From eaa9dab0043bee179ee1e032552be0bc5a5912fd Mon Sep 17 00:00:00 2001 From: support Date: Thu, 9 Jun 2022 15:33:21 +0000 Subject: [PATCH] Built motion from commit df684bcb.|2.6.11 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- public/app/errors/404/i18n/is.json | 8 + public/app/errors/500/i18n/is.json | 11 + public/app/footer/i18n/is.json | 6 + public/app/forgot/i18n/bs.json | 18 +- public/app/forgot/i18n/cs.json | 18 +- public/app/forgot/i18n/is.json | 15 + public/app/header/i18n/is.json | 6 + public/app/login/i18n/bs.json | 40 +- public/app/login/i18n/cs.json | 36 +- public/app/login/i18n/is.json | 26 + public/app/main/apps/analytics/i18n/bs.json | 162 ++-- public/app/main/apps/analytics/i18n/cs.json | 160 ++-- public/app/main/apps/analytics/i18n/is.json | 89 ++ public/app/main/apps/callysquare/i18n/bs.json | 376 +++--- public/app/main/apps/callysquare/i18n/et.json | 5 +- public/app/main/apps/callysquare/i18n/is.json | 244 ++++ public/app/main/apps/callysquare/i18n/pt-BR.json | 18 +- public/app/main/apps/chat/i18n/bs.json | 886 +++++++------- public/app/main/apps/chat/i18n/cs.json | 664 +++++----- public/app/main/apps/chat/i18n/is.json | 491 ++++++++ public/app/main/apps/contactmanager/i18n/bs.json | 356 +++--- public/app/main/apps/contactmanager/i18n/cs.json | 294 +++--- public/app/main/apps/contactmanager/i18n/et.json | 6 +- public/app/main/apps/contactmanager/i18n/is.json | 200 +++ .../app/main/apps/contactmanager/i18n/pt-BR.json | 46 +- public/app/main/apps/dashboards/i18n/ar.json | 4 +- public/app/main/apps/dashboards/i18n/bs.json | 1114 +++++++++--------- public/app/main/apps/dashboards/i18n/cs.json | 4 +- public/app/main/apps/dashboards/i18n/da.json | 4 +- public/app/main/apps/dashboards/i18n/de.json | 4 +- public/app/main/apps/dashboards/i18n/es.json | 4 +- public/app/main/apps/dashboards/i18n/et.json | 9 +- public/app/main/apps/dashboards/i18n/fa.json | 4 +- public/app/main/apps/dashboards/i18n/fi.json | 4 +- public/app/main/apps/dashboards/i18n/fr.json | 4 +- public/app/main/apps/dashboards/i18n/he.json | 4 +- public/app/main/apps/dashboards/i18n/hi.json | 4 +- public/app/main/apps/dashboards/i18n/hu.json | 4 +- public/app/main/apps/dashboards/i18n/id.json | 4 +- public/app/main/apps/dashboards/i18n/is.json | 596 +++++++++ public/app/main/apps/dashboards/i18n/ja.json | 4 +- public/app/main/apps/dashboards/i18n/ko.json | 4 +- public/app/main/apps/dashboards/i18n/lt.json | 4 +- public/app/main/apps/dashboards/i18n/lv.json | 4 +- public/app/main/apps/dashboards/i18n/nl.json | 4 +- public/app/main/apps/dashboards/i18n/no.json | 4 +- public/app/main/apps/dashboards/i18n/pl.json | 4 +- public/app/main/apps/dashboards/i18n/pt-BR.json | 4 +- public/app/main/apps/dashboards/i18n/pt-PT.json | 4 +- public/app/main/apps/dashboards/i18n/ru.json | 4 +- public/app/main/apps/dashboards/i18n/sv.json | 4 +- public/app/main/apps/dashboards/i18n/tr.json | 4 +- public/app/main/apps/dashboards/i18n/zh-CN.json | 4 +- public/app/main/apps/dashboards/i18n/zh-TW.json | 4 +- public/app/main/apps/fax/i18n/bs.json | 454 ++++---- public/app/main/apps/fax/i18n/et.json | 3 +- public/app/main/apps/fax/i18n/is.json | 261 ++++ public/app/main/apps/help/i18n/bs.json | 8 +- public/app/main/apps/help/i18n/is.json | 8 + public/app/main/apps/integrations/i18n/bs.json | 474 ++++---- public/app/main/apps/integrations/i18n/et.json | 9 +- public/app/main/apps/integrations/i18n/is.json | 252 ++++ public/app/main/apps/integrations/i18n/pt-BR.json | 296 +++--- public/app/main/apps/jscripty/i18n/bs.json | 286 +++--- public/app/main/apps/jscripty/i18n/is.json | 228 ++++ public/app/main/apps/mail/i18n/bs.json | 610 +++++----- public/app/main/apps/mail/i18n/et.json | 3 +- public/app/main/apps/mail/i18n/is.json | 346 ++++++ public/app/main/apps/marketplace/i18n/is.json | 51 + public/app/main/apps/motiondialer/i18n/bs.json | 1306 ++++++++++---------- public/app/main/apps/motiondialer/i18n/et.json | 8 +- public/app/main/apps/motiondialer/i18n/is.json | 701 +++++++++++ public/app/main/apps/openchannel/i18n/bs.json | 470 ++++---- public/app/main/apps/openchannel/i18n/is.json | 271 ++++ public/app/main/apps/plugins/i18n/is.json | 7 + public/app/main/apps/settings/i18n/et.json | 3 +- public/app/main/apps/settings/i18n/is.json | 309 +++++ public/app/main/apps/sms/i18n/is.json | 297 +++++ public/app/main/apps/staff/i18n/bs.json | 372 +++--- public/app/main/apps/staff/i18n/et.json | 39 +- public/app/main/apps/staff/i18n/is.json | 424 +++++++ public/app/main/apps/tools/i18n/bs.json | 958 +++++++------- public/app/main/apps/tools/i18n/et.json | 10 +- public/app/main/apps/tools/i18n/is.json | 528 ++++++++ public/app/main/apps/tools/i18n/pt-BR.json | 154 ++-- public/app/main/apps/video/i18n/is.json | 40 + public/app/main/apps/voice/i18n/ar.json | 4 +- public/app/main/apps/voice/i18n/bs.json | 934 +++++++------- public/app/main/apps/voice/i18n/cs.json | 4 +- public/app/main/apps/voice/i18n/da.json | 4 +- public/app/main/apps/voice/i18n/de.json | 4 +- public/app/main/apps/voice/i18n/es.json | 4 +- public/app/main/apps/voice/i18n/et.json | 6 +- public/app/main/apps/voice/i18n/fa.json | 4 +- public/app/main/apps/voice/i18n/fi.json | 4 +- public/app/main/apps/voice/i18n/fr.json | 4 +- public/app/main/apps/voice/i18n/he.json | 4 +- public/app/main/apps/voice/i18n/hi.json | 4 +- public/app/main/apps/voice/i18n/hu.json | 8 +- public/app/main/apps/voice/i18n/id.json | 4 +- public/app/main/apps/voice/i18n/is.json | 511 ++++++++ public/app/main/apps/voice/i18n/ja.json | 4 +- public/app/main/apps/voice/i18n/ko.json | 4 +- public/app/main/apps/voice/i18n/lt.json | 4 +- public/app/main/apps/voice/i18n/lv.json | 4 +- public/app/main/apps/voice/i18n/nl.json | 4 +- public/app/main/apps/voice/i18n/no.json | 4 +- public/app/main/apps/voice/i18n/pl.json | 4 +- public/app/main/apps/voice/i18n/pt-BR.json | 450 ++++---- public/app/main/apps/voice/i18n/pt-PT.json | 4 +- public/app/main/apps/voice/i18n/ru.json | 4 +- public/app/main/apps/voice/i18n/sv.json | 4 +- public/app/main/apps/voice/i18n/tr.json | 4 +- public/app/main/apps/voice/i18n/zh-CN.json | 4 +- public/app/main/apps/voice/i18n/zh-TW.json | 4 +- public/app/main/apps/whatsapp/i18n/bs.json | 432 ++++---- public/app/main/apps/whatsapp/i18n/et.json | 7 +- public/app/main/apps/whatsapp/i18n/is.json | 247 ++++ public/app/quick-panel/i18n/bs.json | 122 +- public/app/quick-panel/i18n/cs.json | 114 +- public/app/quick-panel/i18n/is.json | 73 ++ public/app/reset/i18n/bs.json | 28 +- public/app/reset/i18n/cs.json | 28 +- public/app/reset/i18n/is.json | 20 + public/app/toolbar/i18n/ar.json | 3 +- public/app/toolbar/i18n/bs.json | 229 ++-- public/app/toolbar/i18n/cs.json | 3 +- public/app/toolbar/i18n/da.json | 3 +- public/app/toolbar/i18n/de.json | 3 +- public/app/toolbar/i18n/en.json | 3 +- public/app/toolbar/i18n/es.json | 3 +- public/app/toolbar/i18n/et.json | 3 +- public/app/toolbar/i18n/fa.json | 3 +- public/app/toolbar/i18n/fi.json | 3 +- public/app/toolbar/i18n/fr.json | 3 +- public/app/toolbar/i18n/he.json | 3 +- public/app/toolbar/i18n/hi.json | 3 +- public/app/toolbar/i18n/hu.json | 3 +- public/app/toolbar/i18n/id.json | 3 +- public/app/toolbar/i18n/is.json | 129 ++ public/app/toolbar/i18n/it.json | 3 +- public/app/toolbar/i18n/ja.json | 3 +- public/app/toolbar/i18n/ko.json | 3 +- public/app/toolbar/i18n/lt.json | 3 +- public/app/toolbar/i18n/lv.json | 3 +- public/app/toolbar/i18n/nl.json | 3 +- public/app/toolbar/i18n/no.json | 3 +- public/app/toolbar/i18n/pl.json | 3 +- public/app/toolbar/i18n/pt-BR.json | 3 +- public/app/toolbar/i18n/pt-PT.json | 3 +- public/app/toolbar/i18n/ru.json | 3 +- public/app/toolbar/i18n/sv.json | 3 +- public/app/toolbar/i18n/tr.json | 3 +- public/app/toolbar/i18n/zh-CN.json | 3 +- public/app/toolbar/i18n/zh-TW.json | 3 +- public/assets/images/flags/is.png | Bin 0 -> 14614 bytes public/tvox/answer.controller.js | 3 - public/tvox/answer.html | 4 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/files/chat/iframe.ejs | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/voiceQueueSummary.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/realtime/utils.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1361 files changed, 13867 insertions(+), 7257 deletions(-) create mode 100644 public/app/errors/404/i18n/is.json create mode 100644 public/app/errors/500/i18n/is.json create mode 100644 public/app/footer/i18n/is.json create mode 100644 public/app/forgot/i18n/is.json create mode 100644 public/app/header/i18n/is.json create mode 100644 public/app/login/i18n/is.json create mode 100644 public/app/main/apps/analytics/i18n/is.json create mode 100644 public/app/main/apps/callysquare/i18n/is.json create mode 100644 public/app/main/apps/chat/i18n/is.json create mode 100644 public/app/main/apps/contactmanager/i18n/is.json create mode 100644 public/app/main/apps/dashboards/i18n/is.json create mode 100644 public/app/main/apps/fax/i18n/is.json create mode 100644 public/app/main/apps/help/i18n/is.json create mode 100644 public/app/main/apps/integrations/i18n/is.json create mode 100644 public/app/main/apps/jscripty/i18n/is.json create mode 100644 public/app/main/apps/mail/i18n/is.json create mode 100644 public/app/main/apps/marketplace/i18n/is.json create mode 100644 public/app/main/apps/motiondialer/i18n/is.json create mode 100644 public/app/main/apps/openchannel/i18n/is.json create mode 100644 public/app/main/apps/plugins/i18n/is.json create mode 100644 public/app/main/apps/settings/i18n/is.json create mode 100644 public/app/main/apps/sms/i18n/is.json create mode 100644 public/app/main/apps/staff/i18n/is.json create mode 100644 public/app/main/apps/tools/i18n/is.json create mode 100644 public/app/main/apps/video/i18n/is.json create mode 100644 public/app/main/apps/voice/i18n/is.json create mode 100644 public/app/main/apps/whatsapp/i18n/is.json create mode 100644 public/app/quick-panel/i18n/is.json create mode 100644 public/app/reset/i18n/is.json create mode 100644 public/app/toolbar/i18n/is.json create mode 100644 public/assets/images/flags/is.png diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 3dac3e4..71a8f9e 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-09T09:55:10.080Z", + "time": "2022-06-09T15:25:29.393Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 7b7d272..a5237ca 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-09T09:55:10.080Z", + "time": "2022-06-09T15:25:29.393Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/public/app/errors/404/i18n/is.json b/public/app/errors/404/i18n/is.json new file mode 100644 index 0000000..b061703 --- /dev/null +++ b/public/app/errors/404/i18n/is.json @@ -0,0 +1,8 @@ +{ + "ERROR404": { + "CODE": "404", + "MESSAGE": "Sorry but we couldn’t find the page you are looking for", + "SEARCH": "Search for anything", + "GO_BACK": "Go back to dashboard" + } +} diff --git a/public/app/errors/500/i18n/is.json b/public/app/errors/500/i18n/is.json new file mode 100644 index 0000000..b218b70 --- /dev/null +++ b/public/app/errors/500/i18n/is.json @@ -0,0 +1,11 @@ +{ + "ERROR500": { + "CODE": "500", + "MESSAGE": "Well, you broke the internet!", + "SUBMESSAGE": "Just kidding, looks like we have an internal issue, please try again in couple minutes", + "REPORT": "Report this problem", + "JIRA_MESSAGE": "Your request has been received and will be processed shortly.", + "JIRA_SUBMESSAGE": "Sorry for the inconvenience. If you have any questions or concerns, please do not hesitate to contact us.", + "GO_BACK": "Go back to dashboard" + } +} diff --git a/public/app/footer/i18n/is.json b/public/app/footer/i18n/is.json new file mode 100644 index 0000000..8a47415 --- /dev/null +++ b/public/app/footer/i18n/is.json @@ -0,0 +1,6 @@ +{ + "FOOTER": { + "COOKIE_LAW": "We use cookies to give you the best experience. Read our cookie policy.", + "ERRORS": {} + } +} diff --git a/public/app/forgot/i18n/bs.json b/public/app/forgot/i18n/bs.json index be7b81a..6168cc3 100644 --- a/public/app/forgot/i18n/bs.json +++ b/public/app/forgot/i18n/bs.json @@ -1,15 +1,15 @@ { "FORGOTPASSWORD": { - "TITLE": "Recover your password", - "EMAIL_ADRESS": "Email address", - "SEND_RESET_LINK": "SEND RESET LINK", - "GO_BACK": "Go back to login", - "LINK_SENT": "Link Sent", - "LINNK_SENT_MESSAGE": "An email containing a link to reset your password has been sent to your address!", - "PASSWORD_RESET_ERROR": "Password Reset Error", + "TITLE": "Restartuj svoju lozinku", + "EMAIL_ADRESS": "E-mail adresa", + "SEND_RESET_LINK": "POŠALJI RESET LINK", + "GO_BACK": "Vrati se na prijavu", + "LINK_SENT": "Link je poslan", + "LINNK_SENT_MESSAGE": "E-mail koji sadrži link za poništavanje lozinke je poslan na tvoju adresu!", + "PASSWORD_RESET_ERROR": "Greška restartovanja lozinke", "ERRORS": { - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format" + "EMAIL_REQUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "Pogrešan format" } } } diff --git a/public/app/forgot/i18n/cs.json b/public/app/forgot/i18n/cs.json index be7b81a..277bd94 100644 --- a/public/app/forgot/i18n/cs.json +++ b/public/app/forgot/i18n/cs.json @@ -1,15 +1,15 @@ { "FORGOTPASSWORD": { - "TITLE": "Recover your password", - "EMAIL_ADRESS": "Email address", - "SEND_RESET_LINK": "SEND RESET LINK", - "GO_BACK": "Go back to login", - "LINK_SENT": "Link Sent", - "LINNK_SENT_MESSAGE": "An email containing a link to reset your password has been sent to your address!", - "PASSWORD_RESET_ERROR": "Password Reset Error", + "TITLE": "Obnovit heslo", + "EMAIL_ADRESS": "Emailová adresa", + "SEND_RESET_LINK": "Poslat odkaz pro obnovení", + "GO_BACK": "Zpět na přihlášení", + "LINK_SENT": "Odkaz odeslán", + "LINNK_SENT_MESSAGE": "Email obsahující odkaz pro obnovení hesla byl odeslán na vaši emailovou adresu!", + "PASSWORD_RESET_ERROR": "Chyba při obnovení hesla", "ERRORS": { - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format" + "EMAIL_REQUIRED": "Povinné pole", + "EMAIL_MUST_VALID": "Špatný formát" } } } diff --git a/public/app/forgot/i18n/is.json b/public/app/forgot/i18n/is.json new file mode 100644 index 0000000..be7b81a --- /dev/null +++ b/public/app/forgot/i18n/is.json @@ -0,0 +1,15 @@ +{ + "FORGOTPASSWORD": { + "TITLE": "Recover your password", + "EMAIL_ADRESS": "Email address", + "SEND_RESET_LINK": "SEND RESET LINK", + "GO_BACK": "Go back to login", + "LINK_SENT": "Link Sent", + "LINNK_SENT_MESSAGE": "An email containing a link to reset your password has been sent to your address!", + "PASSWORD_RESET_ERROR": "Password Reset Error", + "ERRORS": { + "EMAIL_REQUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format" + } + } +} diff --git a/public/app/header/i18n/is.json b/public/app/header/i18n/is.json new file mode 100644 index 0000000..f78785b --- /dev/null +++ b/public/app/header/i18n/is.json @@ -0,0 +1,6 @@ +{ + "HEADER": { + "NEWS": "Please visit our Wiki to discover the new cool features available on XCALLY.", + "ERRORS": {} + } +} diff --git a/public/app/login/i18n/bs.json b/public/app/login/i18n/bs.json index 78f3f74..085ff3b 100644 --- a/public/app/login/i18n/bs.json +++ b/public/app/login/i18n/bs.json @@ -1,26 +1,26 @@ { "LOGIN": { - "TELEPHONES": "Telephones", - "SELECT": "Select", - "CANCEL": "Cancel", - "TITLE": "Log in to your account", - "EMAIL": "Email", - "USERNAME": "Username", - "PASSWORD": "Password", - "REMEMBER_ME": "Remember Me", - "FORGOT_PASSWORD": "Forgot Password?", - "LOG_IN": "LOG IN", - "OR": "OR", - "WITH_GOOGLE": "Log in with Google", - "WITH_AD": "Log in with Active Directory", - "WITH_FACEBOOK": "Log in with Facebook", - "DONT_HAVE_ACCOUNT": "No account?", - "CREATE_ACCOUNT": "Create an account", + "TELEPHONES": "Telefoni", + "SELECT": "Odaberi", + "CANCEL": "Poništi", + "TITLE": "Prijavi se na svoj nalog", + "EMAIL": "E-mail", + "USERNAME": "Korisničko ime", + "PASSWORD": "Lozinka", + "REMEMBER_ME": "Zapamti me", + "FORGOT_PASSWORD": "Zaboravio lozinku?", + "LOG_IN": "PRIJAVI SE", + "OR": "ILI", + "WITH_GOOGLE": "Prijavi se sa Google", + "WITH_AD": "Prijavi se sa Aktivnim Direktorijem", + "WITH_FACEBOOK": "Prijavi se sa Facebook", + "DONT_HAVE_ACCOUNT": "Nemaš Nalog?", + "CREATE_ACCOUNT": "Kreiraj Nalog", "ERRORS": { - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "PASSWORD_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field" + "EMAIL_REQUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "Pogrešana format", + "PASSWORD_REQUIRED": "Obavezno polje", + "USERNAME_REQUIRED": "Obavezno polje" } } } diff --git a/public/app/login/i18n/cs.json b/public/app/login/i18n/cs.json index c29c7dc..ff305aa 100644 --- a/public/app/login/i18n/cs.json +++ b/public/app/login/i18n/cs.json @@ -1,25 +1,25 @@ { "LOGIN": { - "TELEPHONES": "Telephones", - "SELECT": "Select", - "CANCEL": "Cancel", - "TITLE": "Log in to your account", + "TELEPHONES": "Telefony", + "SELECT": "Vybrat", + "CANCEL": "Zrušit", + "TITLE": "Příhlášení k účtu", "EMAIL": "Email", - "USERNAME": "Username", - "PASSWORD": "Password", - "REMEMBER_ME": "Remember Me", - "FORGOT_PASSWORD": "Forgot Password?", - "LOG_IN": "LOG IN", - "OR": "OR", - "WITH_GOOGLE": "Log in with Google", - "WITH_FACEBOOK": "Log in with Facebook", - "DONT_HAVE_ACCOUNT": "No account?", - "CREATE_ACCOUNT": "Create an account", + "USERNAME": "Uživatel", + "PASSWORD": "Heslo", + "REMEMBER_ME": "Zapamatovat si", + "FORGOT_PASSWORD": "Zapomenuté heslo?", + "LOG_IN": "PŘIHLÁSIT", + "OR": "nebo", + "WITH_GOOGLE": "Přihlásit pomocí Google", + "WITH_FACEBOOK": "Přihlásit pomocí Facebook", + "DONT_HAVE_ACCOUNT": "Memáte účet?", + "CREATE_ACCOUNT": "Vytvořit nový účet", "ERRORS": { - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "PASSWORD_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field" + "EMAIL_REQUIRED": "Povinné pole", + "EMAIL_MUST_VALID": "Neplatný formát", + "PASSWORD_REQUIRED": "Povinné pole", + "USERNAME_REQUIRED": "Povinné pole" }, "WITH_AD": "Přihlaste se pomocí Active Directory" } diff --git a/public/app/login/i18n/is.json b/public/app/login/i18n/is.json new file mode 100644 index 0000000..78f3f74 --- /dev/null +++ b/public/app/login/i18n/is.json @@ -0,0 +1,26 @@ +{ + "LOGIN": { + "TELEPHONES": "Telephones", + "SELECT": "Select", + "CANCEL": "Cancel", + "TITLE": "Log in to your account", + "EMAIL": "Email", + "USERNAME": "Username", + "PASSWORD": "Password", + "REMEMBER_ME": "Remember Me", + "FORGOT_PASSWORD": "Forgot Password?", + "LOG_IN": "LOG IN", + "OR": "OR", + "WITH_GOOGLE": "Log in with Google", + "WITH_AD": "Log in with Active Directory", + "WITH_FACEBOOK": "Log in with Facebook", + "DONT_HAVE_ACCOUNT": "No account?", + "CREATE_ACCOUNT": "Create an account", + "ERRORS": { + "EMAIL_REQUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format", + "PASSWORD_REQUIRED": "Mandatory field", + "USERNAME_REQUIRED": "Mandatory field" + } + } +} diff --git a/public/app/main/apps/analytics/i18n/bs.json b/public/app/main/apps/analytics/i18n/bs.json index 71cf72f..71678f2 100644 --- a/public/app/main/apps/analytics/i18n/bs.json +++ b/public/app/main/apps/analytics/i18n/bs.json @@ -1,89 +1,89 @@ { "ANALYTICS": { - "SEND_IF_EMPTY": "Send if empty", - "REPORTNAME": "Report Name", - "DELETE": "Delete", - "NAME": "Name", - "ANALYTICS": "Analytics", - "METRICS": "Metrics", - "ID": "Id", - "TABLE": "Table", - "DESCRIPTION": "Description", - "SEARCH_FOR_ANYONE": "Search", - "METRIC": "Metric", + "SEND_IF_EMPTY": "Pošalji ako je prazno", + "REPORTNAME": "Ime Izvještaja", + "DELETE": "Izbriši", + "NAME": "Naziv", + "ANALYTICS": "Analitika", + "METRICS": "Metrika", + "ID": "ID", + "TABLE": "Tablica", + "DESCRIPTION": "Opis", + "SEARCH_FOR_ANYONE": "Traži", + "METRIC": "Metrika", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "METRIC_REQUIRED": "Mandatory field", - "COLUMN_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "CUSTOM_METRIC_REQUIRED": "Mandatory field", - "ALIAS_REQUIRED": "Mandatory field" + "NAME_REQUIRED": "Obavezno Polje", + "METRIC_REQUIRED": "Obavezno Polje", + "COLUMN_REQUIRED": "Obavezno Polje", + "VALUE_REQUIRED": "Obavezno Polje", + "CUSTOM_METRIC_REQUIRED": "Obavezno Polje", + "ALIAS_REQUIRED": "Obavezno Polje" }, - "NEW_METRIC": "New Metric", - "ADD_METRIC": "Add Metric", - "EDIT_METRIC": "Edit Metric", - "DELETE_METRIC": "Delete Metric", - "SAVE": "Save", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "TYPE": "Type", - "EXTRACTEDREPORTS": "Extracted Reports", - "DATE_RANGE_FROM": "Date Range From", - "DATE_RANGE_TO": "Date Range To", - "GENERATED_AT": "Generated At", + "NEW_METRIC": "Nova Metrika", + "ADD_METRIC": "Dodaj Metriku", + "EDIT_METRIC": "Uredi Metriku", + "DELETE_METRIC": "Izbriši Metriku", + "SAVE": "Sačuvaj", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Bez Odabira", + "TYPE": "Tip", + "EXTRACTEDREPORTS": "Izvučeni Izvještaji", + "DATE_RANGE_FROM": "Raspon Datuma Od", + "DATE_RANGE_TO": "Raspon Datuma Do", + "GENERATED_AT": "Generisano U", "STATUS": "Status", - "OUTPUT": "Output", - "REPORTS": "Reports", - "SEARCH_FOR_FOLDER": "Search for folder", - "CREATED_AT": "Created At", - "NEW_REPORT": "New Report", - "ADD_REPORT": "Add Report", - "COPY_REPORT": "Copy Report", - "PREVIEW_REPORT": "Preview Report", - "WEB_REPORT": "Web Report", - "RUN_REPORT": "Run Report", - "DOWNLOAD_JSON_REPORT": "Export Report JSON", - "EDIT_REPORT": "Edit Report", - "DELETE_REPORT": "Delete Report", - "CREATE": "Create Folder", - "RENAME": "Rename Folder", - "REMOVE": "Remove Folder", - "SELECT_NODE": "Select Folder", - "ERROR": "Error", - "QUERY_ERROR": "Query Error", - "MESSAGE": "Message", - "CLOSE": "Close", + "OUTPUT": "Izlaz", + "REPORTS": "Izvještaji", + "SEARCH_FOR_FOLDER": "Traži folder", + "CREATED_AT": "Kreirano U", + "NEW_REPORT": "Novi Izvještaj", + "ADD_REPORT": "Dodaj Izvještaj", + "COPY_REPORT": "Kopiraj Izvještaj", + "PREVIEW_REPORT": "Pregled Izvještaj", + "WEB_REPORT": "Web Izvještaj", + "RUN_REPORT": "Pokreni Izvještaj", + "DOWNLOAD_JSON_REPORT": "Preuzmi Izvještaj JSON", + "EDIT_REPORT": "Uredi Izvještaj", + "DELETE_REPORT": "Izbriši Izvještaj", + "CREATE": "Kreiraj Folder", + "RENAME": "Preimenuj Folder", + "REMOVE": "Ukloni Folder", + "SELECT_NODE": "Odaberi Folder", + "ERROR": "Greška", + "QUERY_ERROR": "Greška U Upitu", + "MESSAGE": "Poruka", + "CLOSE": "Zatvori", "FORMAT": "Format", - "SETTINGS": "Settings", - "GENERAL": "General", - "FIELDS": "Fields", - "CONDITION": "Condition", - "OPERATOR": "Operator", - "GROUP": "Group", - "COLUMN": "Column", - "VALUE": "Value", - "PREVIEW": "Preview", - "LIMITED_RESULT": "*Limited Results", - "NO_DATA": "No data results", - "CONDITIONS": "Conditions", - "ALIAS": "Alias", - "FUNCTION": "Function", - "GROUP_BY": "Group By", - "ORDER_BY": "Order By", - "ADD_REPORTFIELD": "Add Field", - "EDIT_REPORTFIELD": "Edit Field", - "DELETE_REPORTFIELD": "Delete Field", - "METRIC_NAME": "Metric", - "NO_METRIC_FOUND": "No metric found", - "NO_AVAILABLE_INFO": "No available info", - "CUSTOM_METRIC": "Custom Metric", - "DELETE_EXTRACTEDREPORT": "Delete Extracted Report", - "EDIT_EXTRACTEDREPORT": "Edit Extracted Report", - "DOWNLOAD_EXTRACTEDREPORT": "Download Extracted Report", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of" + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "FIELDS": "Polja", + "CONDITION": "Uslov", + "OPERATOR": "Operater", + "GROUP": "Grupa", + "COLUMN": "Kolona", + "VALUE": "Vrijednost", + "PREVIEW": "Pregled", + "LIMITED_RESULT": "*Ograničeni Rezultati", + "NO_DATA": "Nema podataka", + "CONDITIONS": "Uslovi", + "ALIAS": "Pseudonim", + "FUNCTION": "Funkcija", + "GROUP_BY": "Grupiraj Po", + "ORDER_BY": "Naruči Po", + "ADD_REPORTFIELD": "Dodaj Polje", + "EDIT_REPORTFIELD": "Uredi Polje", + "DELETE_REPORTFIELD": "Izbriši Polje", + "METRIC_NAME": "Naziv Metrike", + "NO_METRIC_FOUND": "Nije pronađena metrika", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "CUSTOM_METRIC": "Prilagođena Metrika", + "DELETE_EXTRACTEDREPORT": "Izbriši Izvučeni Izvještaj", + "EDIT_EXTRACTEDREPORT": "Uredi Izvučeni Izvještaj", + "DOWNLOAD_EXTRACTEDREPORT": "Preuzmi Izvučeni Izvještaj", + "PAGE": "Strana", + "ROWSPERPAGE": "Redova po stranici", + "OF": "Od" } } diff --git a/public/app/main/apps/analytics/i18n/cs.json b/public/app/main/apps/analytics/i18n/cs.json index 9555c69..7da42d7 100644 --- a/public/app/main/apps/analytics/i18n/cs.json +++ b/public/app/main/apps/analytics/i18n/cs.json @@ -1,89 +1,89 @@ { "ANALYTICS": { - "SEND_IF_EMPTY": "Send if empty", - "REPORTNAME": "Report Name", - "DELETE": "Delete", - "NAME": "Name", + "SEND_IF_EMPTY": "Odeslat prázdné", + "REPORTNAME": "Název Reportu", + "DELETE": "Smazat", + "NAME": "Název", "ANALYTICS": "Analytics", - "METRICS": "Metrics", + "METRICS": "Metriky", "ID": "Id", - "TABLE": "Table", - "DESCRIPTION": "Description", - "SEARCH_FOR_ANYONE": "Search", - "METRIC": "Metric", + "TABLE": "Tabulka", + "DESCRIPTION": "Popis", + "SEARCH_FOR_ANYONE": "Vyhledat", + "METRIC": "Metrika", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "METRIC_REQUIRED": "Mandatory field", - "COLUMN_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "CUSTOM_METRIC_REQUIRED": "Mandatory field", - "ALIAS_REQUIRED": "Mandatory field" + "NAME_REQUIRED": "Povinné pole", + "METRIC_REQUIRED": "Povinné pole", + "COLUMN_REQUIRED": "Povinné pole", + "VALUE_REQUIRED": "Povinné pole", + "CUSTOM_METRIC_REQUIRED": "Povinné pole", + "ALIAS_REQUIRED": "Povinné pole" }, - "NEW_METRIC": "New Metric", - "ADD_METRIC": "Add Metric", - "EDIT_METRIC": "Edit Metric", - "DELETE_METRIC": "Delete Metric", - "SAVE": "Save", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "TYPE": "Type", - "EXTRACTEDREPORTS": "Extracted Reports", - "DATE_RANGE_FROM": "Date Range From", - "DATE_RANGE_TO": "Date Range To", - "GENERATED_AT": "Generated At", - "STATUS": "Status", - "OUTPUT": "Output", - "REPORTS": "Reports", - "SEARCH_FOR_FOLDER": "Search for folder", - "CREATED_AT": "Created At", - "NEW_REPORT": "New Report", - "ADD_REPORT": "Add Report", - "COPY_REPORT": "Copy Report", - "PREVIEW_REPORT": "Preview Report", - "RUN_REPORT": "Run Report", - "DOWNLOAD_JSON_REPORT": "Export Report JSON", - "EDIT_REPORT": "Edit Report", - "DELETE_REPORT": "Delete Report", - "CREATE": "Create Folder", - "RENAME": "Rename Folder", - "REMOVE": "Remove Folder", - "SELECT_NODE": "Select Folder", - "ERROR": "Error", - "QUERY_ERROR": "Query Error", - "MESSAGE": "Message", - "CLOSE": "Close", - "FORMAT": "Format", - "SETTINGS": "Settings", - "GENERAL": "General", - "FIELDS": "Fields", - "CONDITION": "Condition", - "OPERATOR": "Operator", - "GROUP": "Group", - "COLUMN": "Column", - "VALUE": "Value", - "PREVIEW": "Preview", - "LIMITED_RESULT": "*Limited Results", - "NO_DATA": "No data results", - "CONDITIONS": "Conditions", + "NEW_METRIC": "Nová Metrika", + "ADD_METRIC": "Přidat Metriku", + "EDIT_METRIC": "Upravit Metriku", + "DELETE_METRIC": "Smazat Metriku", + "SAVE": "Uložit", + "BACK": "Zpět", + "SELECTED": "Vybráno", + "SELECT_ALL": "Vybrat vše", + "SELECT_NONE": "Zrušit výběr", + "TYPE": "Typ", + "EXTRACTEDREPORTS": "Povinné pole", + "DATE_RANGE_FROM": "Datum od", + "DATE_RANGE_TO": "Datum do", + "GENERATED_AT": "Vytvořeno", + "STATUS": "Stav", + "OUTPUT": "Výstup", + "REPORTS": "Reporty", + "SEARCH_FOR_FOLDER": "Vyhledat složku", + "CREATED_AT": "Vytvořeno", + "NEW_REPORT": "Nový Report", + "ADD_REPORT": "Přidat Report", + "COPY_REPORT": "Kopírovat Report", + "PREVIEW_REPORT": "Náhledový Report", + "RUN_REPORT": "Spustit Report", + "DOWNLOAD_JSON_REPORT": "Exportovat Report JSON", + "EDIT_REPORT": "Upravit Report", + "DELETE_REPORT": "Smazat Report", + "CREATE": "Vytvořit Složku", + "RENAME": "Přejmenovat složku", + "REMOVE": "Odstranit složku", + "SELECT_NODE": "Vybrat složku", + "ERROR": "Chyba", + "QUERY_ERROR": "Chyba požadavku", + "MESSAGE": "Zpráva", + "CLOSE": "Zavřít", + "FORMAT": "Formát", + "SETTINGS": "Nastavení", + "GENERAL": "Obecné", + "FIELDS": "Pole", + "CONDITION": "Podmínka", + "OPERATOR": "Operátor", + "GROUP": "Seskupit", + "COLUMN": "Sloupec", + "VALUE": "Hodnota", + "PREVIEW": "Náhled", + "LIMITED_RESULT": "*omezený výsledek", + "NO_DATA": "žádná data", + "CONDITIONS": "Podmínky", "ALIAS": "Alias", - "FUNCTION": "Function", - "GROUP_BY": "Group By", - "ORDER_BY": "Order By", - "ADD_REPORTFIELD": "Add Field", - "EDIT_REPORTFIELD": "Edit Field", - "DELETE_REPORTFIELD": "Delete Field", - "METRIC_NAME": "Metric", - "NO_METRIC_FOUND": "No metric found", - "NO_AVAILABLE_INFO": "No available info", - "CUSTOM_METRIC": "Custom Metric", - "DELETE_EXTRACTEDREPORT": "Delete Extracted Report", - "EDIT_EXTRACTEDREPORT": "Edit Extracted Report", - "DOWNLOAD_EXTRACTEDREPORT": "Download Extracted Report", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "WEB_REPORT": "Webová zpráva" + "FUNCTION": "Funkce", + "GROUP_BY": "Seskupit podle", + "ORDER_BY": "Seřadit podle", + "ADD_REPORTFIELD": "Přidat Pole", + "EDIT_REPORTFIELD": "Upravit Pole", + "DELETE_REPORTFIELD": "Smazat Pole", + "METRIC_NAME": "Metrika", + "NO_METRIC_FOUND": "Metrika nenalezena", + "NO_AVAILABLE_INFO": "žádné infromace", + "CUSTOM_METRIC": "Vlastní Metrika", + "DELETE_EXTRACTEDREPORT": "Smazat vytvořené Reporty", + "EDIT_EXTRACTEDREPORT": "Upravit vytvořený Report", + "DOWNLOAD_EXTRACTEDREPORT": "Smazat vytvořený Report", + "PAGE": "Stránka", + "ROWSPERPAGE": "Řádků na stránku", + "OF": "z", + "WEB_REPORT": "Webový report" } } diff --git a/public/app/main/apps/analytics/i18n/is.json b/public/app/main/apps/analytics/i18n/is.json new file mode 100644 index 0000000..71cf72f --- /dev/null +++ b/public/app/main/apps/analytics/i18n/is.json @@ -0,0 +1,89 @@ +{ + "ANALYTICS": { + "SEND_IF_EMPTY": "Send if empty", + "REPORTNAME": "Report Name", + "DELETE": "Delete", + "NAME": "Name", + "ANALYTICS": "Analytics", + "METRICS": "Metrics", + "ID": "Id", + "TABLE": "Table", + "DESCRIPTION": "Description", + "SEARCH_FOR_ANYONE": "Search", + "METRIC": "Metric", + "ERRORS": { + "NAME_REQUIRED": "Mandatory field", + "METRIC_REQUIRED": "Mandatory field", + "COLUMN_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "CUSTOM_METRIC_REQUIRED": "Mandatory field", + "ALIAS_REQUIRED": "Mandatory field" + }, + "NEW_METRIC": "New Metric", + "ADD_METRIC": "Add Metric", + "EDIT_METRIC": "Edit Metric", + "DELETE_METRIC": "Delete Metric", + "SAVE": "Save", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "TYPE": "Type", + "EXTRACTEDREPORTS": "Extracted Reports", + "DATE_RANGE_FROM": "Date Range From", + "DATE_RANGE_TO": "Date Range To", + "GENERATED_AT": "Generated At", + "STATUS": "Status", + "OUTPUT": "Output", + "REPORTS": "Reports", + "SEARCH_FOR_FOLDER": "Search for folder", + "CREATED_AT": "Created At", + "NEW_REPORT": "New Report", + "ADD_REPORT": "Add Report", + "COPY_REPORT": "Copy Report", + "PREVIEW_REPORT": "Preview Report", + "WEB_REPORT": "Web Report", + "RUN_REPORT": "Run Report", + "DOWNLOAD_JSON_REPORT": "Export Report JSON", + "EDIT_REPORT": "Edit Report", + "DELETE_REPORT": "Delete Report", + "CREATE": "Create Folder", + "RENAME": "Rename Folder", + "REMOVE": "Remove Folder", + "SELECT_NODE": "Select Folder", + "ERROR": "Error", + "QUERY_ERROR": "Query Error", + "MESSAGE": "Message", + "CLOSE": "Close", + "FORMAT": "Format", + "SETTINGS": "Settings", + "GENERAL": "General", + "FIELDS": "Fields", + "CONDITION": "Condition", + "OPERATOR": "Operator", + "GROUP": "Group", + "COLUMN": "Column", + "VALUE": "Value", + "PREVIEW": "Preview", + "LIMITED_RESULT": "*Limited Results", + "NO_DATA": "No data results", + "CONDITIONS": "Conditions", + "ALIAS": "Alias", + "FUNCTION": "Function", + "GROUP_BY": "Group By", + "ORDER_BY": "Order By", + "ADD_REPORTFIELD": "Add Field", + "EDIT_REPORTFIELD": "Edit Field", + "DELETE_REPORTFIELD": "Delete Field", + "METRIC_NAME": "Metric", + "NO_METRIC_FOUND": "No metric found", + "NO_AVAILABLE_INFO": "No available info", + "CUSTOM_METRIC": "Custom Metric", + "DELETE_EXTRACTEDREPORT": "Delete Extracted Report", + "EDIT_EXTRACTEDREPORT": "Edit Extracted Report", + "DOWNLOAD_EXTRACTEDREPORT": "Download Extracted Report", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of" + } +} diff --git a/public/app/main/apps/callysquare/i18n/bs.json b/public/app/main/apps/callysquare/i18n/bs.json index 22b9fef..b8fc6d7 100644 --- a/public/app/main/apps/callysquare/i18n/bs.json +++ b/public/app/main/apps/callysquare/i18n/bs.json @@ -1,244 +1,244 @@ { "CALLYSQUARE": { - "ACCOUNT_ID": "Account", - "ADDUSER_PROJECTS": "Add Users to Project", - "ADD_ODBC": "Add ODBC", - "ADD_PROJECT": "Add Project", - "ADD_VARIABLE": "Add Variable", - "AGENTS": "Agents", + "ACCOUNT_ID": "Nalog", + "ADDUSER_PROJECTS": "Dodaj Korisnike u Projekat", + "ADD_ODBC": "Dodaj ODBC", + "ADD_PROJECT": "Dodaj Projekat", + "ADD_VARIABLE": "Dodaj Varijablu", + "AGENTS": "Specijalist", "AGI": "AGI", - "ALL_USERS": "All Users", - "ANSWER": "Answer", - "APIKEY": "ApiKey", - "APPID": "App ID", - "APPLICATION": "Application", - "APPSECRET": "App Secret", - "ARGS": "Arguments", - "ATTACHMENT_NAME": "Attachment Name", - "ATTACHMENT_PATH": "Attachment Path", - "ATTACHMENT_TYPE": "Attachment Type", + "ALL_USERS": "Svi Korisnici", + "ANSWER": "Odgovor", + "APIKEY": "Ključ API", + "APPID": "Aplikacija ID", + "APPLICATION": "Aplikacija", + "APPSECRET": "Tajna Aplikacija", + "ARGS": "Argumenti", + "ATTACHMENT_NAME": "Naziv Priloga", + "ATTACHMENT_PATH": "Putanja Priloga", + "ATTACHMENT_TYPE": "Tip Priloga", "AUDIO": "Audio", - "AUDIOENCODING": "Audio Encoding", + "AUDIOENCODING": "Audio Kodiranje", "AWSLEX": "Amazon Lex", "AWSPOLLY": "AWS Polly", - "AWS_ACCESS_KEY_ID": "Access Key ID", - "AWS_BOT_NAME": "Bot name", + "AWS_ACCESS_KEY_ID": "Pristupni Ključ ID", + "AWS_BOT_NAME": "Naziv Bota", "AWS_LEX_REGION": "Region", "AWS_POLLY_REGION": "Region", "AWS_POLLY_VOICE": "Voice", - "AWS_SECRET_ACCESS_KEY": "Secret Access Key", - "AWS_TEXT_TYPE": "Text type", - "BACK": "Back", + "AWS_SECRET_ACCESS_KEY": "Tajni Pristupni Ključ", + "AWS_TEXT_TYPE": "Vrsta teksta", + "BACK": "Nazad", "BCC": "BCC", "BEEP": "Beep", - "BODY": "Body", - "CALLBACK": "Callback", - "CALLBACK_PRIORITY": "Priority", + "BODY": "Tijelo", + "CALLBACK": "Povratni poziv", + "CALLBACK_PRIORITY": "Prioritet", "CALLYSQUARE": "Cally Square", "CC": "CC", - "CHOOSE_ATTACHMENT": "Choose Attachment", - "CLIENT_EMAIL": "Client Email", - "CLOSE": "Close", - "COMMAND": "Command", - "COMPUTEDVARIABLES": "Computed Variables Script Path", - "CONDITION": "Condition", - "CONTEXT": "Context", - "COPY": "Copy", - "COPY_PROJECT": "Copy Project", - "CREATED_AT": "Created At", - "CUSTOM_ACTION": "Custom Action", - "CUSTOM_ACTION_DATA": "Custom Action Data", - "CUSTOM_APP": "Custom Application", - "DATABASE": "Database", - "DELAY": "delay [min]", - "DELETE": "Delete", - "DELETE_ODBC": "Delete ODBC", - "DELETE_PROJECT": "Delete Project", - "DELETE_SQUARERECORDING": "Delete Square Recording", - "DESCRIPTION": "Description", - "DIAL": "Dial", + "CHOOSE_ATTACHMENT": "Odaberi Prilog", + "CLIENT_EMAIL": "E-mail Stranke", + "CLOSE": "Zatvori", + "COMMAND": "Komanda", + "COMPUTEDVARIABLES": "Putanja Skripte za Izračunate Varijable", + "CONDITION": "Uslov", + "CONTEXT": "Kontekst", + "COPY": "Kopiraj", + "COPY_PROJECT": "Kopiraj Projekat", + "CREATED_AT": "Kreirano U", + "CUSTOM_ACTION": "Prilagođena Aplikacija", + "CUSTOM_ACTION_DATA": "Podaci o Prilagođenim Radnjama", + "CUSTOM_APP": "Prilagođena Aplikacija", + "DATABASE": "Baza Podataka", + "DELAY": "kašnjenje [min]", + "DELETE": "Izbriši", + "DELETE_ODBC": "Izbriši ODBC", + "DELETE_PROJECT": "Izbriši Projekat", + "DELETE_SQUARERECORDING": "Izbriši Square Snimak", + "DESCRIPTION": "Opis", + "DIAL": "Biraj", "DIALOGFLOW": "Dialogflow", "DIALOGFLOWV2": "DialogflowV2", - "DIALOGFLOWV2_LANGUAGE": "Language", - "DIALOGFLOWV2_PROJECT_ID": "Project ID", - "DIALOGFLOW_LANGUAGE": "Language", - "DIALTIMEZONE": "Dial timezone", - "DIGIT": "Max Digits", - "DIGITS": "Digits", - "DOWNLOAD_SQUARERECORDING": "Download Square Recording", - "DROP_TO_UPLOAD": "DROP TO UPLOAD", - "DROP_TO_UPLOAD_MESSAGE": "You can also drop files here to upload. Only XML - Max. 5MB", + "DIALOGFLOWV2_LANGUAGE": "Jezik", + "DIALOGFLOWV2_PROJECT_ID": "Projekat ID", + "DIALOGFLOW_LANGUAGE": "Jezik", + "DIALTIMEZONE": "Vremenska Zona Biranja", + "DIGIT": "Maksimalno Cifara", + "DIGITS": "Cifre", + "DOWNLOAD_SQUARERECORDING": "Preuzmi Square Snimak", + "DROP_TO_UPLOAD": "ISPUSTI ZA UČITAVANJE", + "DROP_TO_UPLOAD_MESSAGE": "Možeš i ovdje ispustiti datoteku za učitavanje. Samo XML - Maks. 5MB", "DSN": "DSN", - "EDIT": "Edit", - "EDIT_ODBC": "Edit ODBC", - "EDIT_PROJECT": "Edit Project", - "EDIT_SQUARERECORDING": "Edit Square Recording", - "EDIT_XML": "Edit XML", - "END": "End", + "EDIT": "Uredi", + "EDIT_ODBC": "Uredi ODBC", + "EDIT_PROJECT": "Uredi Projekat", + "EDIT_SQUARERECORDING": "Uredi Square Snimak", + "EDIT_XML": "Uredit XML", + "END": "Kraj", "ERRORS": { - "DSN_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field", - "NAME_REQUIRED": "Mandatory field", - "PROJECT_REQUIRED": "Mandatory field", - "URL_REQUIRED": "Mandatory field" + "DSN_REQUIRED": "Obavezno polje", + "FIELD_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "PROJECT_REQUIRED": "Obavezno polje", + "URL_REQUIRED": "Obavezno polje" }, - "ESCAPE_DIGITS": "Escape Digits", + "ESCAPE_DIGITS": "Izlazne Cifre", "EXTEN": "Exten", - "EXTENSION": "Extension", - "EXT_DIAL": "External Dial", - "FILE": "Filename", - "FILENAME": "Filename", + "EXTENSION": "Ekstenzija", + "EXT_DIAL": "Eksterno Biranje", + "FILE": "Ime Datoteke", + "FILENAME": "Ime Datoteke", "FILE_ID": "Audio", - "FINALLY": "Finally", - "FINDBY": "Find By", - "GETDIGITS": "Get Digits", - "GETSECRETDIGITS": "Get Secret Digits", - "GOAL": "Goal", - "GOALNAME": "Goal Name", + "FINALLY": "Konačno", + "FINDBY": "Pronađi do", + "GETDIGITS": "Dobiti Cifre", + "GETSECRETDIGITS": "Dobiti Tajne Cifre", + "GOAL": "Cilj", + "GOALNAME": "Ime Cilja", "GOOGLEASR": "GoogleASR", - "GOOGLE_ASR_LANGUAGE": "Language", + "GOOGLE_ASR_LANGUAGE": "Jezik", "GOOGLE_CLOUD_TTS": "Google Cloud TTS", - "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Text Type", - "GOOGLE_TTS_LANGUAGE": "Language", + "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Vrsta Teksta", + "GOOGLE_TTS_LANGUAGE": "Jezik", "GOSUB": "GoSub", "GOTOC": "GoTo", "GOTOIF": "GoToIf", "GOTOIFTIME": "GoToIfTime", - "GO_TO_PROJECTS": "Go to projects", - "GRAMMAR": "Grammar", - "HANGUP": "Hangup", - "HEADERS": "Headers", + "GO_TO_PROJECTS": "Idi na projekte", + "GRAMMAR": "Gramatika", + "HANGUP": "Prekid", + "HEADERS": "Zaglavlje", "HELP": { - "BCC": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "CC": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "DSN": "Example: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion", + "BCC": "Možeš dodati više adresa odvojenih zarezima (npr. korisnik1@toyota.ba, korisnik2@toyota.ba)", + "CC": "Možeš dodati više adresa odvojenih zarezima (npr. korisnik1@toyota.ba, korisnik2@toyota.ba)", + "DSN": "Primjer: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion", "MAILBOX": "mailbox@context", - "MAX_TEXT_TTS": "The maximum number of characters supported is 200", - "TO": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)" + "MAX_TEXT_TTS": "Maksimalan broj podržanih znakova je 200", + "TO": "Možeš dodati više adresa odvojenih zarezima (npr. korisnik1@toyota.ba, korisnik2@toyota.ba)" }, - "HIDDENDIGITSNUM": "Hiddden Digits Number", - "HIDDENDIGITSPOS": "hidden Digits Position", - "ID": "Id", - "IMPORT": "Import", - "IMPORT_XML": "Import XML", + "HIDDENDIGITSNUM": "Broj Sakrivenih Cifara", + "HIDDENDIGITSPOS": "Pozicija Sakrivenih Cifara", + "ID": "ID", + "IMPORT": "Uvoz", + "IMPORT_XML": "Uvezi XML", "INTERVAL_ID": "Interval", - "INTKEY": "Interrupt Key", + "INTKEY": "Ključ Prekida", "ISPEECHASR": "iSpeech ASR", "ISPEECHTTS": "iSpeech Text-To-Speech", - "ISPEECH_ASR_LANGUAGE": "Language", - "ISPEECH_TTS_LANGUAGE": "Language", - "KEY": "Key", - "LABEL": "Label", - "LANGUAGECODE": "Language Code", - "LASTNAME": "Last Name", - "LIST_ID": "List", - "LOGIN": "Login", - "LOGOUT": "Logout", + "ISPEECH_ASR_LANGUAGE": "Jezik", + "ISPEECH_TTS_LANGUAGE": "Jezik", + "KEY": "Ključ", + "LABEL": "Oznaka", + "LANGUAGECODE": "Šifra Jezika", + "LASTNAME": "Prezime", + "LIST_ID": "Lista", + "LOGIN": "Prijava", + "LOGOUT": "Odjava", "LUMENVOXASR": "Lumenvox ASR", "LUMENVOXTTS": "Lumenvox Text-To-Speech", - "MACRO": "Macro", - "MAILBOX": "Mailbox", - "MATH": "Math", - "MAXDIGIT": "Maximum Digits", - "MENU": "Menu", - "METHOD": "Method", - "MINDIGIT": "Minimum Digits", + "MACRO": "Makro", + "MAILBOX": "Poštansko sanduče", + "MATH": "Matematika", + "MAXDIGIT": "Maksimalno Cifara", + "MENU": "Meni", + "METHOD": "Metoda", + "MINDIGIT": "Minimalno Cifara", "MODEL": "Model", "MRCPRECOG": "MRCPRecog", "MRCPSYNTH": "MRCPSynth", - "NAME": "Name", - "NDAACTIVITY_TYPE": "Activity Type", - "NDAGENERATE_AUDIO": "Generate Audio File", - "NDASSISTANT_URL": "NDASSISTANT Url", - "NDAUTH_URL": "NDAUTH Url", - "NEW": "New", - "NEW_ODBC": "New ODBC connection", - "NEW_PROJECT": "New Project", - "NEW_VARIABLE": "New Variable", + "NAME": "Ime", + "NDAACTIVITY_TYPE": "Tip Aktivnosti", + "NDAGENERATE_AUDIO": "Generiši Audio Fajl", + "NDASSISTANT_URL": "NDASSISTANT URL", + "NDAUTH_URL": "NDAUTH URL", + "NEW": "Novo", + "NEW_ODBC": "Nova ODBC konekcija", + "NEW_PROJECT": "Novi Projekat", + "NEW_VARIABLE": "Nova Varijabla", "NOOP": "NoOp", - "NOTES": "Notes", - "NO_AVAILABLE_INFO": "No available info", - "NUMBER": "Number", + "NOTES": "Bilješka", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "NUMBER": "Broj", "ODBC": "ODBC", - "ODBC_ID": "ODBC Connection", - "OF": "of", - "OPEN": "Open", - "OPEN_NEW_WINDOW": "Open in a new window", - "OPEN_PROJECT": "Open Project", - "OPERATION": "Operation", - "OPTIONS": "Options", - "OPTS": "Options", - "OUTPUT": "Output", - "PAGE": "Page", - "PASSWORD": "Password", - "PAUSE": "Pause", - "PAUSE_ID": "Pause type", - "PERMISSIONADD_PROJECTS": "Add Users to Project", - "PHONE": "Phone", - "PLAYBACK": "Playback", - "POSITION": "Position", - "PRIORITY": "Priority", - "PRIVATE_KEY": "Private Key", - "PROJECT": "Project", - "PROJECTS": "Projects", - "PROJECT_ID": "Project", - "QUERY": "Query", + "ODBC_ID": "ODBC Konekcija", + "OF": "od", + "OPEN": "Otvoreno", + "OPEN_NEW_WINDOW": "Otvori u novom prozoru", + "OPEN_PROJECT": "Otvori Projekat", + "OPERATION": "Operacija", + "OPTIONS": "Opcije", + "OPTS": "Opcije", + "OUTPUT": "Izlaz", + "PAGE": "Stranica", + "PASSWORD": "Šifra", + "PAUSE": "Pauza", + "PAUSE_ID": "Pauza ID", + "PERMISSIONADD_PROJECTS": "Dodaj Korisnike na Projekat", + "PHONE": "Telefon", + "PLAYBACK": "Reprodukcija", + "POSITION": "Pozicija", + "PRIORITY": "Prioritet", + "PRIVATE_KEY": "Privatni Ključ", + "PROJECT": "Projekat", + "PROJECTS": "Projekti", + "PROJECT_ID": "Projekat", + "QUERY": "Upit", "QUEUE": "Queue", "QUEUE_ID": "Queue", - "RAWBODY": "Body", - "RAWHEADERS": "Headers", - "RECORD": "Record", - "RECORDINGFORMAT": "Recording Format", - "RESPONSE": "Response Timeout", + "RAWBODY": "Tijelo", + "RAWHEADERS": "Zaglavlje", + "RECORD": "Zapis", + "RECORDINGFORMAT": "Format Snimanja", + "RESPONSE": "Istek vremena za odgovor", "RESTAPI": "Rest API", - "RETRY": "Retries", - "ROWSPERPAGE": "Rows per page", - "SAVE": "Save", - "SAYDIGITS": "Say Digits", - "SAYNUMBER": "Say number", - "SAYPHONETIC": "Say Phonetics", - "SEARCH_FOR_ANYONE": "Search", - "SELECTED": "Selected", - "SELECTED_USERS": "Selected Users", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "SENDFAX": "Send Fax", - "SENDMAIL": "Send Email", - "SENDSMS": "Send SMS", + "RETRY": "Ponovljeni Pokušaj", + "ROWSPERPAGE": "Redova po stranici", + "SAVE": "Sačuvaj", + "SAYDIGITS": "Izgovori Cifre", + "SAYNUMBER": "Izgovori Broj", + "SAYPHONETIC": "Izgovori Fonem", + "SEARCH_FOR_ANYONE": "Traži", + "SELECTED": "Odabrano", + "SELECTED_USERS": "Odabrani Korisnici", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Bez Odabira", + "SENDFAX": "Pošalji Fax", + "SENDMAIL": "Pošalji E-mail", + "SENDSMS": "Pošalji SMS", "SESTEKASR": "Sestek ASR", "SESTEKNDA": "Sestek NDA", "SESTEKTTS": "Sestek TTS", - "SET": "Set", + "SET": "Postavi", "SIP_ID": "SIP", - "SMS_ACCOUNT_ID": "Account", - "SMS_TEXT": "Text", - "SPEED": "Speed", - "SQUARERECORDINGS": "Recordings", - "SSMLGENDER": "Gender", + "SMS_ACCOUNT_ID": "Nalog", + "SMS_TEXT": "Tekst", + "SPEED": "Brzina", + "SQUARERECORDINGS": "Snimci", + "SSMLGENDER": "Spol", "START": "Start", - "SUBJECT": "Subject", - "SUBPROJECT": "Sub Project", - "SYSTEM": "System", - "TELEPHONES": "Telephones", - "TEMPLATE_ID": "Template", + "SUBJECT": "Predmet", + "SUBPROJECT": "Podprojekat", + "SYSTEM": "Sistem", + "TELEPHONES": "Telefoni", + "TEMPLATE_ID": "Šablon", "TEST_ODBC": "Test ODBC", - "TEXT": "Text", + "TEXT": "Tekst", "TILDEASR": "Tilde ASR", "TIMEOUT": "Timeout", - "TO": "To", + "TO": "Za", "TRUNK_NAME": "Trunk", "TTS": "Google Text-To-Speech", - "UNIQUEID": "Unique ID", - "UNPAUSE": "End Pause", - "UPDATE_DESCRIPTION": "Update Description", - "UPDATE_INFO": "Update Info", + "UNIQUEID": "Jedinstveni ID", + "UNPAUSE": "Kraj Pauze", + "UPDATE_DESCRIPTION": "Ažuriraj Opis", + "UPDATE_INFO": "Ažuriraj Informacije", "URI": "URI", "URL": "URL", - "USERNAME": "Username", - "USERS": "Users", - "VARIABLE_ID": "Variable", - "VARIABLE_VALUE": "Value", - "VOICEMAIL": "Voicemail", - "VSWITCH": "Variable Switch" + "USERNAME": "Korisničko Ime", + "USERS": "Korisnici", + "VARIABLE_ID": "Varijabla", + "VARIABLE_VALUE": "Vrijednost", + "VOICEMAIL": "Govorna pošta", + "VSWITCH": "Zamjena Varijable" } } diff --git a/public/app/main/apps/callysquare/i18n/et.json b/public/app/main/apps/callysquare/i18n/et.json index 2389db1..4e87d3b 100644 --- a/public/app/main/apps/callysquare/i18n/et.json +++ b/public/app/main/apps/callysquare/i18n/et.json @@ -76,7 +76,6 @@ "PROJECT_REQUIRED": "Kohustuslik väli", "URL_REQUIRED": "Kohustuslik väli" }, - "ESCAPE_DIGITS": "Väldi numbrimärke", "EXTEN": "Exten", "EXTENSION": "Laiendus", @@ -239,6 +238,8 @@ "DIALOGFLOWV2_LANGUAGE": "Keel", "DIALOGFLOWV2_PROJECT_ID": "Projekti ID", "PRIVATE_KEY": "Privaatne võti", - "DIALTIMEZONE": "Vali ajavöönd" + "DIALTIMEZONE": "Vali ajavöönd", + "APPLICATION": "Rakendus", + "AWSPOLLY": "AWS Polly" } } diff --git a/public/app/main/apps/callysquare/i18n/is.json b/public/app/main/apps/callysquare/i18n/is.json new file mode 100644 index 0000000..22b9fef --- /dev/null +++ b/public/app/main/apps/callysquare/i18n/is.json @@ -0,0 +1,244 @@ +{ + "CALLYSQUARE": { + "ACCOUNT_ID": "Account", + "ADDUSER_PROJECTS": "Add Users to Project", + "ADD_ODBC": "Add ODBC", + "ADD_PROJECT": "Add Project", + "ADD_VARIABLE": "Add Variable", + "AGENTS": "Agents", + "AGI": "AGI", + "ALL_USERS": "All Users", + "ANSWER": "Answer", + "APIKEY": "ApiKey", + "APPID": "App ID", + "APPLICATION": "Application", + "APPSECRET": "App Secret", + "ARGS": "Arguments", + "ATTACHMENT_NAME": "Attachment Name", + "ATTACHMENT_PATH": "Attachment Path", + "ATTACHMENT_TYPE": "Attachment Type", + "AUDIO": "Audio", + "AUDIOENCODING": "Audio Encoding", + "AWSLEX": "Amazon Lex", + "AWSPOLLY": "AWS Polly", + "AWS_ACCESS_KEY_ID": "Access Key ID", + "AWS_BOT_NAME": "Bot name", + "AWS_LEX_REGION": "Region", + "AWS_POLLY_REGION": "Region", + "AWS_POLLY_VOICE": "Voice", + "AWS_SECRET_ACCESS_KEY": "Secret Access Key", + "AWS_TEXT_TYPE": "Text type", + "BACK": "Back", + "BCC": "BCC", + "BEEP": "Beep", + "BODY": "Body", + "CALLBACK": "Callback", + "CALLBACK_PRIORITY": "Priority", + "CALLYSQUARE": "Cally Square", + "CC": "CC", + "CHOOSE_ATTACHMENT": "Choose Attachment", + "CLIENT_EMAIL": "Client Email", + "CLOSE": "Close", + "COMMAND": "Command", + "COMPUTEDVARIABLES": "Computed Variables Script Path", + "CONDITION": "Condition", + "CONTEXT": "Context", + "COPY": "Copy", + "COPY_PROJECT": "Copy Project", + "CREATED_AT": "Created At", + "CUSTOM_ACTION": "Custom Action", + "CUSTOM_ACTION_DATA": "Custom Action Data", + "CUSTOM_APP": "Custom Application", + "DATABASE": "Database", + "DELAY": "delay [min]", + "DELETE": "Delete", + "DELETE_ODBC": "Delete ODBC", + "DELETE_PROJECT": "Delete Project", + "DELETE_SQUARERECORDING": "Delete Square Recording", + "DESCRIPTION": "Description", + "DIAL": "Dial", + "DIALOGFLOW": "Dialogflow", + "DIALOGFLOWV2": "DialogflowV2", + "DIALOGFLOWV2_LANGUAGE": "Language", + "DIALOGFLOWV2_PROJECT_ID": "Project ID", + "DIALOGFLOW_LANGUAGE": "Language", + "DIALTIMEZONE": "Dial timezone", + "DIGIT": "Max Digits", + "DIGITS": "Digits", + "DOWNLOAD_SQUARERECORDING": "Download Square Recording", + "DROP_TO_UPLOAD": "DROP TO UPLOAD", + "DROP_TO_UPLOAD_MESSAGE": "You can also drop files here to upload. Only XML - Max. 5MB", + "DSN": "DSN", + "EDIT": "Edit", + "EDIT_ODBC": "Edit ODBC", + "EDIT_PROJECT": "Edit Project", + "EDIT_SQUARERECORDING": "Edit Square Recording", + "EDIT_XML": "Edit XML", + "END": "End", + "ERRORS": { + "DSN_REQUIRED": "Mandatory field", + "FIELD_REQUIRED": "Mandatory field", + "NAME_REQUIRED": "Mandatory field", + "PROJECT_REQUIRED": "Mandatory field", + "URL_REQUIRED": "Mandatory field" + }, + "ESCAPE_DIGITS": "Escape Digits", + "EXTEN": "Exten", + "EXTENSION": "Extension", + "EXT_DIAL": "External Dial", + "FILE": "Filename", + "FILENAME": "Filename", + "FILE_ID": "Audio", + "FINALLY": "Finally", + "FINDBY": "Find By", + "GETDIGITS": "Get Digits", + "GETSECRETDIGITS": "Get Secret Digits", + "GOAL": "Goal", + "GOALNAME": "Goal Name", + "GOOGLEASR": "GoogleASR", + "GOOGLE_ASR_LANGUAGE": "Language", + "GOOGLE_CLOUD_TTS": "Google Cloud TTS", + "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Text Type", + "GOOGLE_TTS_LANGUAGE": "Language", + "GOSUB": "GoSub", + "GOTOC": "GoTo", + "GOTOIF": "GoToIf", + "GOTOIFTIME": "GoToIfTime", + "GO_TO_PROJECTS": "Go to projects", + "GRAMMAR": "Grammar", + "HANGUP": "Hangup", + "HEADERS": "Headers", + "HELP": { + "BCC": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "CC": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "DSN": "Example: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion", + "MAILBOX": "mailbox@context", + "MAX_TEXT_TTS": "The maximum number of characters supported is 200", + "TO": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)" + }, + "HIDDENDIGITSNUM": "Hiddden Digits Number", + "HIDDENDIGITSPOS": "hidden Digits Position", + "ID": "Id", + "IMPORT": "Import", + "IMPORT_XML": "Import XML", + "INTERVAL_ID": "Interval", + "INTKEY": "Interrupt Key", + "ISPEECHASR": "iSpeech ASR", + "ISPEECHTTS": "iSpeech Text-To-Speech", + "ISPEECH_ASR_LANGUAGE": "Language", + "ISPEECH_TTS_LANGUAGE": "Language", + "KEY": "Key", + "LABEL": "Label", + "LANGUAGECODE": "Language Code", + "LASTNAME": "Last Name", + "LIST_ID": "List", + "LOGIN": "Login", + "LOGOUT": "Logout", + "LUMENVOXASR": "Lumenvox ASR", + "LUMENVOXTTS": "Lumenvox Text-To-Speech", + "MACRO": "Macro", + "MAILBOX": "Mailbox", + "MATH": "Math", + "MAXDIGIT": "Maximum Digits", + "MENU": "Menu", + "METHOD": "Method", + "MINDIGIT": "Minimum Digits", + "MODEL": "Model", + "MRCPRECOG": "MRCPRecog", + "MRCPSYNTH": "MRCPSynth", + "NAME": "Name", + "NDAACTIVITY_TYPE": "Activity Type", + "NDAGENERATE_AUDIO": "Generate Audio File", + "NDASSISTANT_URL": "NDASSISTANT Url", + "NDAUTH_URL": "NDAUTH Url", + "NEW": "New", + "NEW_ODBC": "New ODBC connection", + "NEW_PROJECT": "New Project", + "NEW_VARIABLE": "New Variable", + "NOOP": "NoOp", + "NOTES": "Notes", + "NO_AVAILABLE_INFO": "No available info", + "NUMBER": "Number", + "ODBC": "ODBC", + "ODBC_ID": "ODBC Connection", + "OF": "of", + "OPEN": "Open", + "OPEN_NEW_WINDOW": "Open in a new window", + "OPEN_PROJECT": "Open Project", + "OPERATION": "Operation", + "OPTIONS": "Options", + "OPTS": "Options", + "OUTPUT": "Output", + "PAGE": "Page", + "PASSWORD": "Password", + "PAUSE": "Pause", + "PAUSE_ID": "Pause type", + "PERMISSIONADD_PROJECTS": "Add Users to Project", + "PHONE": "Phone", + "PLAYBACK": "Playback", + "POSITION": "Position", + "PRIORITY": "Priority", + "PRIVATE_KEY": "Private Key", + "PROJECT": "Project", + "PROJECTS": "Projects", + "PROJECT_ID": "Project", + "QUERY": "Query", + "QUEUE": "Queue", + "QUEUE_ID": "Queue", + "RAWBODY": "Body", + "RAWHEADERS": "Headers", + "RECORD": "Record", + "RECORDINGFORMAT": "Recording Format", + "RESPONSE": "Response Timeout", + "RESTAPI": "Rest API", + "RETRY": "Retries", + "ROWSPERPAGE": "Rows per page", + "SAVE": "Save", + "SAYDIGITS": "Say Digits", + "SAYNUMBER": "Say number", + "SAYPHONETIC": "Say Phonetics", + "SEARCH_FOR_ANYONE": "Search", + "SELECTED": "Selected", + "SELECTED_USERS": "Selected Users", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "SENDFAX": "Send Fax", + "SENDMAIL": "Send Email", + "SENDSMS": "Send SMS", + "SESTEKASR": "Sestek ASR", + "SESTEKNDA": "Sestek NDA", + "SESTEKTTS": "Sestek TTS", + "SET": "Set", + "SIP_ID": "SIP", + "SMS_ACCOUNT_ID": "Account", + "SMS_TEXT": "Text", + "SPEED": "Speed", + "SQUARERECORDINGS": "Recordings", + "SSMLGENDER": "Gender", + "START": "Start", + "SUBJECT": "Subject", + "SUBPROJECT": "Sub Project", + "SYSTEM": "System", + "TELEPHONES": "Telephones", + "TEMPLATE_ID": "Template", + "TEST_ODBC": "Test ODBC", + "TEXT": "Text", + "TILDEASR": "Tilde ASR", + "TIMEOUT": "Timeout", + "TO": "To", + "TRUNK_NAME": "Trunk", + "TTS": "Google Text-To-Speech", + "UNIQUEID": "Unique ID", + "UNPAUSE": "End Pause", + "UPDATE_DESCRIPTION": "Update Description", + "UPDATE_INFO": "Update Info", + "URI": "URI", + "URL": "URL", + "USERNAME": "Username", + "USERS": "Users", + "VARIABLE_ID": "Variable", + "VARIABLE_VALUE": "Value", + "VOICEMAIL": "Voicemail", + "VSWITCH": "Variable Switch" + } +} diff --git a/public/app/main/apps/callysquare/i18n/pt-BR.json b/public/app/main/apps/callysquare/i18n/pt-BR.json index 43ccb77..1cb4fc1 100644 --- a/public/app/main/apps/callysquare/i18n/pt-BR.json +++ b/public/app/main/apps/callysquare/i18n/pt-BR.json @@ -56,7 +56,7 @@ "DELETE_SQUARERECORDING": "Excluir Gravação Cally Square", "DESCRIPTION": "Descrição", "DIAL": "Discar", - "DIALOGFLOW": "Dialogflow", + "DIALOGFLOW": "Fluxo de diálogo", "DIALOGFLOW_LANGUAGE": "Idioma", "DIGIT": "Max Dígitos", "DIGITS": "Dígitos", @@ -156,14 +156,14 @@ "NUMBER": "Número", "ODBC": "ODBC", "ODBC_ID": "Conexão ODBC", - "OF": "do", + "OF": "de", "OPEN": "Abrir", "OPEN_NEW_WINDOW": "Abra em uma nova janela", "OPEN_PROJECT": "Projeto Aberto", "OPERATION": "Operação", "OPTIONS": "Opções", "OPTS": "Opções", - "OUTPUT": "Output", + "OUTPUT": "Saída", "PAGE": "Página", "PASSWORD": "Senha", "PAUSE": "Pausa", @@ -178,7 +178,7 @@ "PROJECT_ID": "Projeto", "QUERY": "Query", "QUEUE": "Fila", - "QUEUE_ID": "Fila", + "QUEUE_ID": "ID da Fila", "RAWBODY": "Corpo", "RAWHEADERS": "Cabeçalhos", "RECORD": "Gravação", @@ -203,8 +203,8 @@ "SESTEKNDA": "Sestek NDA", "SESTEKTTS": "Sestek TTS", "SET": "Set", - "SIP_ID": "SIP", - "SMS_ACCOUNT_ID": "Conta", + "SIP_ID": "ID SIP", + "SMS_ACCOUNT_ID": "ID da CONTA SMS", "SMS_TEXT": "Texto", "SPEED": "Velocidade", "SQUARERECORDINGS": "Gravações", @@ -219,8 +219,8 @@ "TEXT": "Texto", "TILDEASR": "Tilde ASR", "TIMEOUT": "Timeout", - "TO": "To", - "TRUNK_NAME": "Tronco", + "TO": "Para", + "TRUNK_NAME": "Nome do Tronco", "TTS": "Google Text-To-Speech", "UNIQUEID": "Unique ID", "UNPAUSE": "Fim da Pausa", @@ -235,7 +235,7 @@ "VOICEMAIL": "Correio de Voz", "VSWITCH": "Variable Switch", "CLIENT_EMAIL": "Email do Cliente", - "DIALOGFLOWV2": "DialogflowV2", + "DIALOGFLOWV2": "Fluxo de diálogo V2", "DIALOGFLOWV2_LANGUAGE": "Idioma", "DIALOGFLOWV2_PROJECT_ID": "ID do Projeto", "PRIVATE_KEY": "Chave Privada", diff --git a/public/app/main/apps/chat/i18n/bs.json b/public/app/main/apps/chat/i18n/bs.json index a8f7e5c..e51bee9 100644 --- a/public/app/main/apps/chat/i18n/bs.json +++ b/public/app/main/apps/chat/i18n/bs.json @@ -1,491 +1,491 @@ { "CHAT": { - "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "EDIT_DIALOGFLOWV2": "Uredi Dialogflow V2", "DIALOGFLOWV2": "Dialogflow V2", - "PRIVATEKEY": "Private Key", - "CLIENTEMAIL": "Client Email", - "PROJECTID": "Project ID", - "VIDAOOESCALATION": "Start Video Call", - "VIDAOOAPIKEY": "Vidaoo Api Key", - "VIDAOOSESSION": "Start Video Call", - "VIDAOOTOPIC": "Vidaoo Topic", - "VIDAOONOTE": "Vidaoo Note", - "VIDAOOMETADATA": "Vidaoo Metadata", + "PRIVATEKEY": "Privatni Ključ", + "CLIENTEMAIL": "E-mail Stranke", + "PROJECTID": "Projekat ID", + "VIDAOOESCALATION": "Započni Video Poziv", + "VIDAOOAPIKEY": "Vidaoo Api Ključ", + "VIDAOOSESSION": "Započni Video Poziv", + "VIDAOOTOPIC": "Vidaoo Tema", + "VIDAOONOTE": "Vidaoo Bilješka", + "VIDAOOMETADATA": "Vidaoo Metapodaci", "VIDEO": "Video", "VIDAOO": "Vidaoo", - "EDIT_AMAZONLEX": "Edit Amazon Lex", + "EDIT_AMAZONLEX": "Uredi Amazon Lex", "AMAZONLEX": "Amazon Lex", - "ACCESSKEYID": "Access Key ID", - "SECRETACCESSKEY": "Secret Access Key", + "ACCESSKEYID": "Pristupni Ključ ID", + "SECRETACCESSKEY": "Tajni Pristupni Ključ", "LEXREGION": "Region", - "BOTNAME": "Bot Name", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "ENABLECUSTOMERCHECKMARKS": "Enable customer delivered/read notifications", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", - "SYSTEMAVATAR": "System Avatar", - "SYSTEMALIAS": "System Alias", - "OPEN_NEW_INTERACTION": "Open new interaction", - "EMAIL_ACCOUNT": "Email account", - "SUBJECT": "Subject", - "WELCOMEMESSAGE": "Welcome Message", - "LANGUAGE": "Language", - "EDIT_DIALOGFLOW": "Edit Dialogflow", + "BOTNAME": "Bot Naziv", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "DOWNLOAD_INTERACTION": "Preuzmi", + "ENABLECUSTOMERCHECKMARKS": "Omogući obavještenja o isporuci/čitanju stranke", + "TRANSFER": "Prijenos", + "QUEUETRANSFER": "Prijenos Queue", + "QUEUETRANSFERTIMEOUT": "Prijenos Queue Timeout", + "AGENTTRANSFER": "Prijenost Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Specijaliste", + "SYSTEMAVATAR": "Avatar Sistema", + "SYSTEMALIAS": "Pseudonim Sistema", + "OPEN_NEW_INTERACTION": "Otvori novu interakciju", + "EMAIL_ACCOUNT": "E-mail nalog", + "SUBJECT": "Predmet", + "WELCOMEMESSAGE": "Poruka Dobrodošlice", + "LANGUAGE": "Jezik", + "EDIT_DIALOGFLOW": "Uredi Dialogflow", "DIALOGFLOW": "Dialogflow", - "BACKGROUNDCOLOR": "Background Color", - "MESSAGEFONTSIZE": "Message Font Size", - "ADD_NOTE": "Add note", - "NOTE": "Note", + "BACKGROUNDCOLOR": "Boja Pozadine", + "MESSAGEFONTSIZE": "Veličina Fonta Poruke", + "ADD_NOTE": "Dodaj Bilješku", + "NOTE": "Bilješka", "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "CUSTOMERALIAS": "Customer Alias", - "SNIPPETSWIPEOUT": "Snippet swipe out", - "CUSTOMERAVATAR": "Customer Avatar", - "SHOWCUSTOMERAVATAR": "Show customer avatar", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "DEFAULTTITLE": "Default Title", - "MESSAGESALIGNMENT": "Messages Alignment", - "ALTERNATE": "Alternate", - "CENTERED": "Centered", - "POSITION": "Position", - "VERTICALPOSITION": "Vertical position", - "ALIGNMENT": "Alignment", - "VERTICALALIGNMENT": "Vertical alignment", - "BOTTOM_RIGHT": "Bottom right", - "RIGHT": "Right", - "LEFT": "Left", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "AGENTIDENTIFIER": "Identifier", - "WEBSITEALIAS": "Website Alias", - "AGENTALIAS": "Agent Alias", - "AGENTFULLNAME": "Agent Fullname", - "INSERT_MESSAGE_HERE": "Insert your text message here", - "HIDEWHENOFFLINE": "Hide", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "TEXTCOLOR": "Text Color", - "TEXT_BUTTON_COLOR": "Text Button Color", - "FONTSIZE": "Font Size", - "WEBSCRIPT": "Web Script", - "CANNEDANSWERS": "Canned Answers", - "CHATCANNEDANSWERS": "Canned Answers", - "NO_CHATCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_CHATCANNEDANSWER": "New Canned Answer", - "ADD_CHATCANNEDANSWER": "Add Canned Answer", - "EDIT_CHATCANNEDANSWER": "Edit", - "DELETE_CHATCANNEDANSWER": "Delete", - "OFFLINEMESSAGESUBJECT": "Message subject", - "OFFLINEMESSAGEBODY": "Message body", - "FORMSUBMITSUCCESSMESSAGE": "Form submit success message", - "FORMSUBMITFAILUREMESSAGE": "Form submit failure message", - "PLACEHOLDERMESSAGE": "Message placeholder", - "NOTETITLE": "Note's title", - "CLOSINGQUESTION": "Closing question", - "TAGS": "Tags", - "SHOWAGENTAVATAR": "Show personal agent avatar", - "AGENTAVATAR": "Agent Avatar", + "EDIT_TAG": "Uredi Tag", + "CUSTOMERALIAS": "Pseudonim Stranke", + "SNIPPETSWIPEOUT": "Isječak swipe out", + "CUSTOMERAVATAR": "Avatar Stranke", + "SHOWCUSTOMERAVATAR": "Prikaži avatar stranke", + "CANNED_ANSWER_NOT_FOUND": "Nije pronađen nijedan pripremljeni odgovor", + "DEFAULTTITLE": "Zadani Naslov", + "MESSAGESALIGNMENT": "Poravnanje Poruke", + "ALTERNATE": "Alternativno", + "CENTERED": "Centrirano", + "POSITION": "Pozicija", + "VERTICALPOSITION": "Vertikalna pozicija", + "ALIGNMENT": "Poravnanje", + "VERTICALALIGNMENT": "Vertikalno poravnanje", + "BOTTOM_RIGHT": "Dole Desno", + "RIGHT": "Desno", + "LEFT": "Lijevo", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog specijalistu", + "AGENTIDENTIFIER": "Identifikator", + "WEBSITEALIAS": "Website Pseudonim", + "AGENTALIAS": "Pseudonim Specijaliste", + "AGENTFULLNAME": "Puno Ime Specijaliste", + "INSERT_MESSAGE_HERE": "Ovdje upiši svoju tekstualnu poruku", + "HIDEWHENOFFLINE": "Sakrij", + "NOTIFICATION": "Obavijest", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Protresi", + "NOTIFICATIONTEMPLATE": "Šablon", + "SYSTEM": "Sistem", + "EDIT_SYSTEM": "Uredi Sistem", + "COMMAND": "Naredba", + "TEXTCOLOR": "Boja Teksta", + "TEXT_BUTTON_COLOR": "Boja Teksta Dugmeta", + "FONTSIZE": "Veličina Fonta", + "WEBSCRIPT": "Web Skripta", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "CHATCANNEDANSWERS": "Pripremljeni Odgovori", + "NO_CHATCANNEDANSWER_AVAILABLE": "Nema dostupnih Pripremljenih Odgovora", + "NEW_CHATCANNEDANSWER": "Novi Pripremljeni Odgovor", + "ADD_CHATCANNEDANSWER": "Dodaj Pripremljeni Odgovor", + "EDIT_CHATCANNEDANSWER": "Uredi", + "DELETE_CHATCANNEDANSWER": "Izbriši", + "OFFLINEMESSAGESUBJECT": "Predmet poruke", + "OFFLINEMESSAGEBODY": "Tijelo poruke", + "FORMSUBMITSUCCESSMESSAGE": "Poruka o uspješnom slanju obrasca", + "FORMSUBMITFAILUREMESSAGE": "Poruka o neuspješnom slanju obrasca", + "PLACEHOLDERMESSAGE": "Placeholder poruke", + "NOTETITLE": "Naslov Bilješke", + "CLOSINGQUESTION": "Završno Pitanje", + "TAGS": "Tagovi", + "SHOWAGENTAVATAR": "Prikaži lični avatar specijaliste", + "AGENTAVATAR": "Avatar Specijaliste", "SPYINTERACTION": "Spy", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_CHATQUEUE": "Go To Realtime Chat Queue", - "PARTIALPAUSE": "Partial Pause", - "BUSY": "Busy", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "GOTOREALTIME_CHATQUEUE": "Idi na Realtime Chat Queue", + "PARTIALPAUSE": "Djelomična pauza", + "BUSY": "Zauzet", "TIMER": "Timer", "IDLE": "Idle", - "CAPACITY": "Capacity", - "AGENTSADD_QUEUE": "Add Agent to Chat Queue", + "CAPACITY": "Kapacitet", + "AGENTSADD_QUEUE": "Dodaj Specijalistu u Chat Queue", "QUEUES": "Queues", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", - "WRITING": "Writing", + "LOGGED_IN": "Prijavljen", + "PAUSED": "Pauzirano", + "READY": "Spreman", + "WAITING": "Čekanje", + "WRITING": "Piše", "CHAT": "Chat", - "MAIL": "Email", + "MAIL": "E-mail", "SMS": "SMS", - "OPENCHANNEL": "Openchannel", + "OPENCHANNEL": "Otvoreni kanal", "FAX": "Fax", - "PAUSE": "Pause", + "PAUSE": "Pauza", "REALTIME": "Realtime", - "AGENTS": "Agents", - "FULLNAME": "Full Name", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "LOGOUT": "Logout", - "UNPAUSE": "End Pause", - "AGENTADD_QUEUE": "Add Agent to Chat Queue", - "TEXT": "Text", - "TIMES": "Number of times per interaction", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "AUTOREPLY": "Auto Reply", - "NEW_CHATDISPOSITION": "New Chat Disposition", - "ENABLECUSTOMERATTACHMENT": "Enable Customer Attachments", - "ENABLESENDBUTTON": "Enable Send Button", - "OFFLINE_CHAT_BUTTON": "'Offline Chat' Button", + "AGENTS": "Specijaliste", + "FULLNAME": "Puno Ime", + "INTERNAL": "Interni", + "PHONE_STATE": "Stanje telefona", + "PHONE_STATUS": "Status telefona", + "LOGOUT": "Odjava", + "UNPAUSE": "Završi Pauzu", + "AGENTADD_QUEUE": "Dodaj Specijalistu u Chat Queue", + "TEXT": "Tekst", + "TIMES": "Broj puta po interakciji", + "EDIT_AUTOREPLY": "Uredi Automatski Odgovor", + "AUTOREPLY": "Automatski Odgovor", + "NEW_CHATDISPOSITION": "Nova Chat Dispozicija", + "ENABLECUSTOMERATTACHMENT": "Omogući Priloge Stranke", + "ENABLESENDBUTTON": "Omogući Dugme za Slanje", + "OFFLINE_CHAT_BUTTON": "'Offline Chat' Dugme", "OFFLINESTATUS": "Offline Status", - "NAME": "Name", - "CHATQUEUES": "Chat Queues", - "SEARCH_FOR_ANYONE": "Search", - "STRATEGY": "Strategy", - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "KEY": "Key", - "ALIAS": "Alias", - "VARIABLE": "Variable", + "NAME": "Ime", + "CHATQUEUES": "Chat Queue", + "SEARCH_FOR_ANYONE": "Traži", + "STRATEGY": "Strategija", + "AGENT_TIMEOUT": "Timeout Specijaliste", + "DESCRIPTION": "Opis", + "KEY": "Ključ", + "ALIAS": "Pseudonim", + "VARIABLE": "Varijabla", "INTERVAL": "Interval", - "EDIT_CLOSE": "Edit Close", - "TIMEZONE": "Timezone", - "MESSAGE": "Message", - "ADVANCED": "Advanced", - "FORWARDTRANSCRIPT": "Forward Transcript", - "FORWARDTRANSCRIPTMESSAGE": "Forward Transcript Message", - "SKIPMESSAGEBUTTON": "Skip Message Button", - "EDIT_MESSAGE": "Edit Message", - "CONDITION_AGREEMENT": "Condition Agreement", - "NONE": "None", - "PRIORITY": "Priority", + "EDIT_CLOSE": "Uredi Zatvaranje", + "TIMEZONE": "Vremenska zona", + "MESSAGE": "Poruka", + "ADVANCED": "Napredno", + "FORWARDTRANSCRIPT": "Proslijedi Transkript", + "FORWARDTRANSCRIPTMESSAGE": "Proslijedi Transkript Poruku", + "SKIPMESSAGEBUTTON": "Dugme Skip Poruke", + "EDIT_MESSAGE": "Uredi Poruku", + "CONDITION_AGREEMENT": "Ugovor o Uslovima", + "NONE": "Ništa", + "PRIORITY": "Prioritet", "ONLINESTATUS": "Online Status", - "UNMANAGEDSTATUS": "Unmanaged Status", - "AUTOCLOSE": "Enable Autoclose", - "ENABLEUNMANAGEDNOTE": "Enable Unmanaged Message", - "UNMANAGEDMESSAGE": "Message", - "SKIPUNMANAGED": "Skip Message", - "SENDUNMANAGED": "Send Message", - "WEBSITESCRIPT": "Website Script", - "DELETE_OFFLINEMESSAGE": "Delete", - "OFFLINEMESSAGES": "Offline Messages", - "FORWARD_OFFLINE": "Forward Offline", - "SHOW_OFFLINEMESSAGE": "Show", - "FORWARD_OFFLINE_ADDRESS": "Forward Offline Address", - "CLOSINGFORM": "Closing Form", - "ENABLERATING": "Enable Rating", - "ENABLECUSTOMERWRITING": "Allow customer writing before agent accepting", - "ENABLEFEEDBACK": "Enable Feedback", - "FEEDBACKTITLE": "Feedback Title", - "RATINGTYPE": "Rating Type", - "CLOSINGMESSAGE": "Closing Message", - "CLOSINGMESSAGEBUTTON": "Closing Message Button", - "RATINGSTARSNUMBER": "Rating Stars Number", - "EDIT_GOTOIF": "Edit GotoIf", - "CONDITION": "Condition", - "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", - "VALUE": "Value", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", - "SERVICEID": "Service ID", - "CHANNELID": "Channel ID", - "EDIT_TVOX": "Edit TVox", - "SERVICENAME": "Service name", + "UNMANAGEDSTATUS": "Neupravljani Status", + "AUTOCLOSE": "Omogući Automatsko Zatvaranje", + "ENABLEUNMANAGEDNOTE": "Omogući Neupravljanu Poruku", + "UNMANAGEDMESSAGE": "Poruka", + "SKIPUNMANAGED": "Skip Poruku", + "SENDUNMANAGED": "Pošalji Poruku", + "WEBSITESCRIPT": "Website Skripta", + "DELETE_OFFLINEMESSAGE": "Izbriši", + "OFFLINEMESSAGES": "Offline Poruke", + "FORWARD_OFFLINE": "Proslijedi Offline", + "SHOW_OFFLINEMESSAGE": "Prikaži", + "FORWARD_OFFLINE_ADDRESS": "Proslijedi Offline Adresu", + "CLOSINGFORM": "Obrazan Zatvaranja", + "ENABLERATING": "Omogući Ocjenjivanje", + "ENABLECUSTOMERWRITING": "Dozvoli stranci pisanje prije nego što Specijalista prihvati", + "ENABLEFEEDBACK": "Omogući Povratne Informacije", + "FEEDBACKTITLE": "Naslov Povratne Informacije", + "RATINGTYPE": "Tip Ocjene", + "CLOSINGMESSAGE": "Završna Poruka", + "CLOSINGMESSAGEBUTTON": "Dugme Završne Poruke", + "RATINGSTARSNUMBER": "Broj Zvjezdica Ocjene", + "EDIT_GOTOIF": "Uredi GotoIf", + "CONDITION": "Uslov", + "TRUEPRIORITY": "Pravi Prioritet", + "FALSEPRIORITY": "Pogrešan Prioritet", + "VALUE": "Vrijednost", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Pauza koja se koristi ukoliko je Obavezna dispozicija uključena", + "SERVICEID": "Servis ID", + "CHANNELID": "Kanal ID", + "EDIT_TVOX": "Uredi TVox", + "SERVICENAME": "Ime Servisa", "TVOX": "TVox", "TVOXURL": "TVox IP URL", - "TVOXIP": "TVox IP Address", - "TVOXUSERNAME": "TVox Username", - "TVOXPASSWD": "TVox Password", - "TVOXLOGINURL": "TVox Login REST Url", - "TVOXSESSIONURL": "TVox Session REST Url", - "MOTIONURLONRING": "Motion URL On Ring", - "MOTIONURLONANSWER": "Motion URL On Answer", - "MOTIONTITLE": "Motion Title", + "TVOXIP": "TVox IP Adresa", + "TVOXUSERNAME": "TVox Korisničko ime", + "TVOXPASSWD": "TVox Šifra", + "TVOXLOGINURL": "TVox Prijava REST Url", + "TVOXSESSIONURL": "TVox Sesija REST Url", + "MOTIONURLONRING": "Motion URL u Zazvoniti", + "MOTIONURLONANSWER": "Motion URL u Odgovoru", + "MOTIONTITLE": "Motion Naslov", "MOTIONURL": "Motion URL", "ERRORS": { - "PROJECTID_REQUIRED": "Mandatory Field", - "CLIENTEMAIL_REQUIRED": "Mandatory Field", - "PRIVATEKEY_REQUIRED": "Mandatory Field", - "VIDAOOAPIKEY_REQUIRED": "Mandatory Field", - "VIDAOOTOPIC_REQUIRED": "Mandatory Field", - "BOTNAME_REQUIRED": "Mandatory Field", - "SECRETACCESSKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Mandatory Field", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "CUSTOMERALIAS_REQUIRED": "Mandatory Field", - "AGENTALIAS_REQUIRED": "Mandatory Field", - "SYSTEMALIAS_REQUIRED": "Mandatory Field", - "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MESSAGEFONTSIZE_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "VERTICALPOSITION_REQUIRED": "Mandatory Field", - "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "COMMAND_REQUIRED": "Mandatory Field", - "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FONTSIZE_REQUIRED": "Mandatory Field", - "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "VALUE_REQUIRED": "Mandatory Field", - "CUSTOMERALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "SYSTEMALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "OFFLINEMESSAGEBODY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "PLACEHOLDERMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "NOTETITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "CLOSINGQUESTION_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "HEADER_OFFLINE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "TEXT_REQUIRED": "Mandatory Field", - "SENDUNMANAGED_REQUIRED": "Mandatory Field", - "SENDUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "SKIPUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "UNMANAGEDMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "WEBSITEALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "AGENT_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "PRIORITY_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", - "EMAIL_MUST_BE_VALID": "Wrong format", - "ADDRESS_REQUIRED": "Mandatory Field", - "ADDRESS_MUST_VALID_URL": "Wrong format", - "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Mandatory Field", - "ACCEPTURL_MUST_VALID_URL": "Wrong format", - "TIMEOUT_REQUIRED": "Mandatory Field", - "REJECTURL_MUST_VALID_URL": "Wrong format", - "CLOSEURL_MUST_VALID_URL": "Wrong format", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "WAITINGMESSAGE_REQUIRED": "Mandatory Field", - "WAITINGTITLE_REQUIRED": "Mandatory Field", - "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "WAITINGMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "WAITINGTITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", - "EMAIL_ACCOUNT_REQUIRED": "Mandatory field" + "PROJECTID_REQUIRED": "Obavezno Polje", + "CLIENTEMAIL_REQUIRED": "Obavezno Polje", + "PRIVATEKEY_REQUIRED": "Obavezno Polje", + "VIDAOOAPIKEY_REQUIRED": "Obavezno Polje", + "VIDAOOTOPIC_REQUIRED": "Obavezno Polje", + "BOTNAME_REQUIRED": "Obavezno Polje", + "SECRETACCESSKEY_REQUIRED": "Obavezno Polje", + "ACCESSKEYID_REQUIRED": "Obavezno Polje", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno Polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno Polje", + "CUSTOMERALIAS_REQUIRED": "Obavezno Polje", + "AGENTALIAS_REQUIRED": "Obavezno Polje", + "SYSTEMALIAS_REQUIRED": "Obavezno Polje", + "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MESSAGEFONTSIZE_REQUIRED": "Obavezno Polje", + "TAG_REQUIRED": "Obavezno Polje", + "VERTICALPOSITION_REQUIRED": "Obavezno Polje", + "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno Polje", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "NAME_MUST_VALID_PATTERN": "Pogrešan Format", + "COMMAND_REQUIRED": "Obavezno Polje", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "FONTSIZE_REQUIRED": "Obavezno Polje", + "TEXT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "VALUE_REQUIRED": "Obavezno Polje", + "CUSTOMERALIAS_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "SYSTEMALIAS_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "OFFLINEMESSAGEBODY_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "PLACEHOLDERMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "NOTETITLE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "CLOSINGQUESTION_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "HEADER_OFFLINE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "TEXT_REQUIRED": "Obavezno Polje", + "SENDUNMANAGED_REQUIRED": "Obavezno Polje", + "SENDUNMANAGED_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "SKIPUNMANAGED_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "UNMANAGEDMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "WEBSITEALIAS_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "AGENT_REQUIRED": "Obavezno Polje", + "QUEUE_REQUIRED": "Obavezno Polje", + "CONDITION_REQUIRED": "Obavezno Polje", + "PRIORITY_REQUIRED": "Obavezno Polje", + "TRUEPRIORITY_REQUIRED": "Obavezno Polje", + "FALSEPRIORITY_REQUIRED": "Obavezno Polje", + "NAME_REQUIRED": "Obavezno Polje", + "LIST_REQUIRED": "Obavezno Polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno Polje", + "MOTIONADDRESS_REQUIRED": "Obavezno Polje", + "DISPOSITION_REQUIRED": "Obavezno Polje", + "MOTIONADDRESS_MUST_VALID_URL": "Pogrešan Format", + "EMAIL_MUST_BE_VALID": "Pogrešan Format", + "ADDRESS_REQUIRED": "Obavezno Polje", + "ADDRESS_MUST_VALID_URL": "Pogrešan Format", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Obavezno Polje", + "ACCEPTURL_MUST_VALID_URL": "Pogrešan Format", + "TIMEOUT_REQUIRED": "Obavezno Polje", + "REJECTURL_MUST_VALID_URL": "Pogrešan Format", + "CLOSEURL_MUST_VALID_URL": "Pogrešan Format", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka", + "WAITINGMESSAGE_REQUIRED": "Obavezno Polje", + "WAITINGTITLE_REQUIRED": "Obavezno Polje", + "KEY_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "KEY_REQUIRED": "Obavezno Polje", + "WAITINGMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "WAITINGTITLE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno Polje", + "EMAIL_ACCOUNT_REQUIRED": "Obavezno Polje" }, - "CM_FIELD": "Contact Manager Field", - "CHATPROACTIVEACTIONS": "Proactive Actions", - "NEW_CHATPROACTIVEACTION": "New Proactive Action", - "EDIT_CHATPROACTIVEACTION": "Edit Proactive Action", - "DELETE_CHATPROACTIVEACTION": "Delete Proactive Action", - "ADD_CHATPROACTIVEACTION": "Add Proactive Action", - "NO_CHATPROACTIVEACTION_AVAILABLE": "No Proactive Actions Available", - "NO_OFFLINEMESSAGE_AVAILABLE": "No Offline Messages Available", - "MOUSEOVER": "Mouse Over", + "CM_FIELD": "Kontakt Menadžer Polje", + "CHATPROACTIVEACTIONS": "Proaktivne Radnje", + "NEW_CHATPROACTIVEACTION": "Nova Proaktivna Radnja", + "EDIT_CHATPROACTIVEACTION": "Uredi Proaktivne Radnje", + "DELETE_CHATPROACTIVEACTION": "Izbriši Proaktivnu Radnju", + "ADD_CHATPROACTIVEACTION": "Dodaj Proaktivnu Radnju", + "NO_CHATPROACTIVEACTION_AVAILABLE": "Nema dostupnih Proaktivnih Radnji", + "NO_OFFLINEMESSAGE_AVAILABLE": "Nema dostupnih Offline Poruka", + "MOUSEOVER": "Miš Preko", "TIMEOUT": "Timeout", - "TYPE": "Type", - "SELECTOR": "Selector", - "AGENT": "Agent", + "TYPE": "Tip", + "SELECTOR": "Selektror", + "AGENT": "Specijalist", "GOTO": "Goto", "GOTOIF": "GotoIf", "NOOP": "Noop", "QUEUE": "Queue", - "BUILDER": "Builder", - "PREVIEW": "Preview", - "EDIT_AGENT": "Edit Agent", - "EDIT_QUEUE": "Edit Queue", - "EDIT_GOTO": "Edit Goto", - "EDIT_GOTOIf": "Edit GotoIf", - "EDIT_NOOP": "Edit Noop", - "ADD_CHATQUEUE": "Add Chat Queue", - "EDIT_CHATQUEUE": "Edit Chat Queue", - "DELETE_CHATQUEUE": "Delete Chat Queue", - "SETTINGS": "Settings", - "SAVE": "Save", - "SCRIPT": "Script", + "BUILDER": "Graditelj", + "PREVIEW": "Pregled", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_QUEUE": "Uredi Queue", + "EDIT_GOTO": "Uredi Goto", + "EDIT_GOTOIf": "Uredi GotoIf", + "EDIT_NOOP": "Uredi Noop", + "ADD_CHATQUEUE": "Dodaj Chat Queue", + "EDIT_CHATQUEUE": "Uredi Chat Red", + "DELETE_CHATQUEUE": "Izbriši Chat Queue", + "SETTINGS": "Postavke", + "SAVE": "Sačuvaj", + "SCRIPT": "Skripta", "TOKEN": "Token", - "CREATED_AT": "Created At", - "CHATWEBSITES": "Chat Websites", - "MOTIONADDRESS": "Website Domain", - "MOTIONPROXY": "Proxy Or Motion Domain", - "ADD_CHATWEBSITE": "Add Chat Website", - "EDIT_CHATWEBSITE": "Edit Chat Website", - "DELETE_CHATWEBSITE": "Delete Chat Website", - "LIST": "List", - "SNIPPET": "Snippet", - "FORMS": "Forms", - "UP": "Up", - "DOWN": "Down", - "COLLAPSE": "Collapse", - "PROACTIVEACTIONS": "Proactive Actions", - "DISPOSITIONS": "Dispositions", + "CREATED_AT": "Kreirano U", + "CHATWEBSITES": "Chat Website", + "MOTIONADDRESS": "Domena Web Stranice", + "MOTIONPROXY": "Proxy Or Motion Domena", + "ADD_CHATWEBSITE": "Dodaj Chat Website", + "EDIT_CHATWEBSITE": "Uredi Chat Website", + "DELETE_CHATWEBSITE": "Izbriši Chat Website", + "LIST": "Lista", + "SNIPPET": "Isječak", + "FORMS": "Obrasci", + "UP": "Gore", + "DOWN": "Dole", + "COLLAPSE": "Zatvori", + "PROACTIVEACTIONS": "Proaktivna Radnja", + "DISPOSITIONS": "Dispozicije", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", - "FIDELITY": "Fidelity", - "APPEARANCE": "Appearance", - "MAINCOLOR": "Main Color", - "FOCUSCOLOR": "Focus Color", - "BUTTONCOLOR": "Button Color", - "HEADERSHAPE": "Header Shape", - "ANIMATION": "Animation", - "DEFAULT": "Default", + "ACTIONS": "Radnje", + "FIDELITY": "Vjernost", + "APPEARANCE": "Izgled", + "MAINCOLOR": "Glavna Boja", + "FOCUSCOLOR": "Boja Fokusa", + "BUTTONCOLOR": "Boja Dugmeta", + "HEADERSHAPE": "Oblik Zaglavlja", + "ANIMATION": "Animacija", + "DEFAULT": "Zadano", "WHITELABEL": "White Label", "LOGO": "Logo", - "DOWNLOADTRANSCRIPT": "Download Transcript", - "ENQUIRY_ENABLE": "Enquiry Enable", - "ENQUIRY_FORWARDING": "Enquiry Forwarding", - "ENQUIRY_FORWARDING_ADDRESS": "Enquiry Forwarding Address", - "LABELS": "Labels", - "HEADER_ONLINE": "Online Header", - "ONLINE_MESSAGE": "Online Message", - "NAME_TITLE": "Name Input Label", - "USERNAME_PLACEHOLDER": "Username Input Placeholder", - "EMAIL_TITLE": "Email Input Label", - "EMAIL_PLACEHOLDER": "Email Input Placeholder", - "START_CHAT_BUTTON": "'Start Chat' Button", - "AGENTS_BUSY": "Busy Agents Message", - "HEADER_OFFLINE": "Offline Header", - "OFFLINE_MESSAGE": "Offline Message", - "MESSAGE_TITLE": "Message Label", - "ENQUIRY_MESSAGE_PLACEHOLDER": "Enquiry Message Input Placeholder", - "ENQUIRY_BUTTON": "Enquiry Button Text", - "RATING_MESSAGE": "Rating Message", - "RATING_SEND": "Rating Send Button Text", - "RATING_SKIP": "Rating Skip Button Text", + "DOWNLOADTRANSCRIPT": "Preuzmi Transkript", + "ENQUIRY_ENABLE": "Omogućen Upit", + "ENQUIRY_FORWARDING": "Prosljeđivanje Upita", + "ENQUIRY_FORWARDING_ADDRESS": "Adresa za Prosljeđivanje Upita", + "LABELS": "Oznake", + "HEADER_ONLINE": "Online Zaglavlje", + "ONLINE_MESSAGE": "Online Poruka", + "NAME_TITLE": "Oznaka Unosa Imena", + "USERNAME_PLACEHOLDER": "Korisničko ime Unos Placeholder", + "EMAIL_TITLE": "E-mail Unos Oznake", + "EMAIL_PLACEHOLDER": "E-mail Unos Placeholder", + "START_CHAT_BUTTON": "'Pokreni Chat' Dugme", + "AGENTS_BUSY": "Poruka Zauzetih Specijalista", + "HEADER_OFFLINE": "Offline Zaglavlje", + "OFFLINE_MESSAGE": "Offline Poruka", + "MESSAGE_TITLE": "Oznaka Poruke", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Upit Poruka Unos Placeholder", + "ENQUIRY_BUTTON": "Tekst Dugmeta za Upit", + "RATING_MESSAGE": "Poruka Ocjene", + "RATING_SEND": "Tekst Dugmeta za Slanje Ocjene", + "RATING_SKIP": "Tekst Dugmeta za Skip Ocjene", "ONLINE": "Online", "OFFLINE": "Offline", - "PROACTIVE": "Proactive", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", - "EMBEDDING": "Embedding", - "GENERAL": "General", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", + "PROACTIVE": "Proaktivni", + "ACCEPT": "Prihvati", + "ACCEPTMETHOD": "Prihvati Metodu", + "ACCEPTURL": "Prihvati URL", + "REJECT": "Odbaci", + "REJECTMETHOD": "Odbaci Metodu", + "REJECTURL": "Odbaci URL", + "CLOSE": "Zatvori", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", + "EMBEDDING": "Ugrađivanje", + "GENERAL": "Općenito", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "BACK": "Nazad", "HELP": { - "VERTICALPOSITION": "Represents the distance in percentage from top", - "AGENTIDENTIFIER": "Represents the agent identifier within the chat session in the snippet", - "HIDEWHENOFFLINE": "Hides snippet when offline", - "KEY": "Website short name (5 char) shown on the Agent Tab", - "TOKEN": "Automatically generated token used in the Script", - "INTEVAL": "To be selected from the list of the available intervals", - "TIMEZONE": "Select one from the list (default=local timezone)", - "ENABLERATING": "Enable it if you want the web visitor can rate the interaction at the end", - "ENABLEFEEDBACK": "Enable it if you want the web visitor can send a feedback (up to 150 char) at the end", - "FORWARDTRANSCRIPT": "Enable it if you want the web visitor is asked to receive a chat transcript via email", - "AUTOCLOSE": "Enable it if you want chat sessions to be closed as Unmanaged if no agent is available. Learn more about it at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", - "ENABLEUNMANAGEDNOTE": "Enable it if you want the visitor is shown a message when all the agents are busy and the chat gets unmanaged", - "WEBSITEALIAS": "A prefix used to compose the agent name (prefix+Agent Id) shown to the web visitor during the chat session", - "ENABLECUSTOMERWRITING": " Enable it if you want the chat starts without waiting for an available agent (pay attention: if you enable it, your chats will never get unmanaged). Learn more at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", - "MAPKEY": "The following Motion Contact Manager field:", - "FROMKEY": "Will be mapped in your Motion Chat Snippet as:", - "COPYSCRIPTTOCLIPBOARD": "Copy and paste the script text into your website", - "FORWARD_OFFLINE": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "MOTIONADDRESS": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", - "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "LIST": "Contact Manager list used to associate Contacts", - "INTERVAL": "Select one from the list", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", - "WELCOMEMESSAGE": "Leave empty if you don't want to send any welcome message" + "VERTICALPOSITION": "Predstavlja udaljenost u postocima sa vrha", + "AGENTIDENTIFIER": "Predstavlja identifikator specijaliste unutar sesije chat-a u isječku", + "HIDEWHENOFFLINE": "Sakriva isječak kada si offline", + "KEY": "Kratak naziv web stranice (5 znakova) prikazan na Kartici Specijaliste", + "TOKEN": "Automatski generisani token koji se koristi u Skripti", + "INTEVAL": "Biti izabran sa liste dostupnih intervala", + "TIMEZONE": "Odaberi jednu sa liste (zadano=lokalna vremenska zona)", + "ENABLERATING": "Omogući ako želiš da posjetitelj web stranice može ocijeniti interakciju na kraju", + "ENABLEFEEDBACK": "Omogući ako želiš da posjetitelj web stranice može poslati povratnu informaciju (do 150 znakova) na kraju", + "FORWARDTRANSCRIPT": "Omogući ako želiš da se posjetitelja web stranice pita da li želi da primi transkript chat-a putem e-maila", + "AUTOCLOSE": "Omogući ako želiš da se sesije chat-a zatvore kao Neupravljane, ako specijalista nije dostupan. Saznaj više o tome na: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "ENABLEUNMANAGEDNOTE": "Omogući ako želiš da se posjetiocu prikaže poruka kada su svi specijalisti zauzeti i chat-om se ne upravlja", + "WEBSITEALIAS": "Prefiks koji se koristi za sastavljanje imena specijaliste (prefiks+ID specijaliste) koji se prikazuje web posjetitelju tokom chat sesije", + "ENABLECUSTOMERWRITING": "Omogući ga ako želiš da chat počne bez čekanja dostupnog specijaliste (obrati pažnju: ako ga omogućiš, tvoji chat-ovi nikada neće ostati kao Neupravljani). Saznaj više na: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "MAPKEY": "Sljedeće Motion Kontakt Menadžer polje:", + "FROMKEY": "Bit će mapirano u tvom Motion Chat Isječku kao:", + "COPYSCRIPTTOCLIPBOARD": "Kopiraj i zalijepi tekst skripte na svoju web stranicu", + "FORWARD_OFFLINE": "Možeš dodati više adresa odvojenih zarezima (npr. korisnik1@toyota.ba, korisnik2@toyota.ba)", + "MOTIONADDRESS": "Polje mora imati sljedeći format:://[:]. Primjer: https://X.Y.Z.W", + "MOTIONPROXY": "Polje mora imati sljedeći format: ://[:]. Primjer: https://X.Y.Z.W", + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)", + "LIST": "Kontakt Menadžer lista koja se koristi za povezivanje Kontakata", + "INTERVAL": "Odaberi jedan sa liste", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Pauza koja se koristi ako je obavezna dispozicija uključena", + "WELCOMEMESSAGE": "Ostavi prazno ako ne želiš da šalješ poruku dobrodošlice" }, - "ADDRESS": "Address", + "ADDRESS": "Adresa", "ONLINESTATE": "Online Status", "OFFLINESTATE": "Offline Status", - "RATINGSTATE": "Rating State", - "ENQUIRY": "Enquiry", - "OFFLINETEMPLATE": "Offline Template", - "CHATDISPOSITIONS": "Chat Dispositions", - "NO_CHATDISPOSITION_AVAILABLE": "No Chat Dispositions available", - "ADD_CHATDISPOSITION": "Add Chat Disposition", - "DELETE": "Delete", - "EDIT_CHATDISPOSITION": "Edit Chat Disposition", - "DELETE_CHATDISPOSITION": "Delete Chat Disposition", - "ID": "Id", - "NEW_CHATQUEUE": "New Chat Queue", - "NEW_CHATWEBSITE": "New Chat Website", - "ROUNDED": "Rounded", - "SQUARED": "Squared", - "NO_AVAILABLE_INFO": "No available info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "CONTACT": "Contact", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", + "RATINGSTATE": "Stanje Ocjene", + "ENQUIRY": "Upit", + "OFFLINETEMPLATE": "Offline Šablon", + "CHATDISPOSITIONS": "Chat Dispozicija", + "NO_CHATDISPOSITION_AVAILABLE": "Nema dostupnih Chat Dispozicija", + "ADD_CHATDISPOSITION": "Dodaj Chat Dispoziciju", + "DELETE": "Izbriši", + "EDIT_CHATDISPOSITION": "Uredi Chat Dispozicije", + "DELETE_CHATDISPOSITION": "Izbriši Chat Dispoziciju", + "ID": "ID", + "NEW_CHATQUEUE": "Novi Chat Queue", + "NEW_CHATWEBSITE": "Novi Chat Website", + "ROUNDED": "Zaobljen", + "SQUARED": "Kvadratno", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "CONTACT": "Kontakt", + "STARTEDAT": "Počelo U", + "LASTMESSAGE": "Zadnja poruka", "STATUS": "Status", - "CLOSED": "Closed", - "OPENED": "Open", - "OPEN": "Open", - "ACCOUNT": "Account", - "INTERACTION": "Interaction", - "INTERACTIONS": "Interactions", + "CLOSED": "Zatvoreno", + "OPENED": "Otvoreno", + "OPEN": "Otvori", + "ACCOUNT": "Nalog", + "INTERACTION": "Interakcija", + "INTERACTIONS": "Interakcije", "WEBSITE": "Website", - "ALL": "All", - "SELECT_STATUS": "Select a status", + "ALL": "Svi", + "SELECT_STATUS": "Odaberi status", "FILTER": "Filter", - "FILTERS": "Filters", - "TEAMADD_CHATQUEUE": "Add Team to Chat Queue", - "AGENTADD_CHATQUEUE": "Add Agent to Chat Queue", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", - "CREATEDAT": "Created At", - "NOTES": "Notes", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "SELECTED_WEBSITE": "Select a website", + "FILTERS": "Filteri", + "TEAMADD_CHATQUEUE": "Dodaj Tim u Chat Queue", + "AGENTADD_CHATQUEUE": "Dodaj Specijalistu u Chat Queue", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "CLOSEDAT": "Zatvoreno U", + "DISPOSITION": "Dispozicija", + "CREATEDAT": "Kreirano U", + "NOTES": "Bilješke", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "SELECTED_WEBSITE": "Odaberi Website", "GOTOP": "Gotop", - "EDIT_GOTOP": "Edit Gotop", - "SELECT_WEBSITE": "Select a website", + "EDIT_GOTOP": "Uredi Gotop", + "SELECT_WEBSITE": "Odaberi website", "INFO": "Info", - "OFFLINEMESSAGES_CHATWEBSITE": "Go to Offline Messages", - "WAITINGTITLE": "Waiting Title", - "WAITINGMESSAGE": "Waiting Message", - "RATING": "Rating", - "NO_RATINGVALUE": "No Rating", - "DEFAULT_PAUSE": "Default pause", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", + "OFFLINEMESSAGES_CHATWEBSITE": "Idi na Offline Poruke", + "WAITINGTITLE": "Naslov Čekanja", + "WAITINGMESSAGE": "Poruka Čekanja", + "RATING": "Ocjena", + "NO_RATINGVALUE": "Bez ocjene", + "DEFAULT_PAUSE": "Zadana Pauza", + "UNKNOWN": "Nepoznato", + "UNREGISTERED": "Neregistrovan", + "UNAVAILABLE": "Nedostupno", + "NOT_INUSE": "Nije u upotrebi", + "REACHABLE": "Dostupno", + "IN_USE": "U upotrebi", "VOICE": "Voice", - "INTERACTIONS_CHATWEBSITE": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_CHATWEBSITE": "Add Agent to Chat Website", - "TEAMS_ASSOCIATION": "Teams Association", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", - "LABELTEXT": "Label text" + "INTERACTIONS_CHATWEBSITE": "Idi na Interakcije", + "REFRESH_INTERACTIONS": "Osvježi Interakciju", + "DELETE_INTERACTION": "Izbriši Interakciju", + "AGENTADD_CHATWEBSITE": "Dodaj Specijalistu u Chat Website", + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje Ekrana u procesu", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje Ekrana dostupno", + "DOWNLOAD_WITH_ATTACHMENTS": "Preuzmi sa prilogom", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Preuzmi bez priloga", + "LABELTEXT": "Tekst oznake" } } diff --git a/public/app/main/apps/chat/i18n/cs.json b/public/app/main/apps/chat/i18n/cs.json index 6df2c80..6140e22 100644 --- a/public/app/main/apps/chat/i18n/cs.json +++ b/public/app/main/apps/chat/i18n/cs.json @@ -1,196 +1,196 @@ { "CHAT": { - "EDIT_AMAZONLEX": "Edit Amazon Lex", + "EDIT_AMAZONLEX": "Upravit Amazon Lex", "AMAZONLEX": "Amazon Lex", - "ACCESSKEYID": "Access Key ID", - "SECRETACCESSKEY": "Secret Access Key", + "ACCESSKEYID": "Přístupový klíč ID", + "SECRETACCESSKEY": "Tajný přístupový klíč", "LEXREGION": "Region", - "BOTNAME": "Bot Name", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "ENABLECUSTOMERCHECKMARKS": "Enable customer delivered/read notifications", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", - "SYSTEMAVATAR": "System Avatar", - "SYSTEMALIAS": "System Alias", - "WELCOMEMESSAGE": "Welcome Message", - "LANGUAGE": "Language", - "EDIT_DIALOGFLOW": "Edit Dialogflow", + "BOTNAME": "Jméno Bota", + "LOGIN_TIME": "Doba přihlášení", + "PAUSE_TIME": "Čas v pauze", + "DOWNLOAD_INTERACTION": "Stáhnout", + "ENABLECUSTOMERCHECKMARKS": "Povolit klientovy doručeno/přečteno notifikace", + "TRANSFER": "Přepojit", + "QUEUETRANSFER": "Přepojení Fronty", + "QUEUETRANSFERTIMEOUT": "Časový limit přepojení fronty", + "AGENTTRANSFER": "Přepojit Agenta", + "AGENTTRANSFERTIMEOUT": "časový limit přepojení Agenta", + "SYSTEMAVATAR": "Avatar Systému", + "SYSTEMALIAS": "Alias Systému", + "WELCOMEMESSAGE": "Uvítací zpráva", + "LANGUAGE": "Jazyk", + "EDIT_DIALOGFLOW": "Upravit Dialogflow", "DIALOGFLOW": "Dialogflow", - "BACKGROUNDCOLOR": "Background Color", - "MESSAGEFONTSIZE": "Message Font Size", - "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "CUSTOMERALIAS": "Customer Alias", - "SNIPPETSWIPEOUT": "Snippet swipe out", - "CUSTOMERAVATAR": "Customer Avatar", - "SHOWCUSTOMERAVATAR": "Show customer avatar", - "DEFAULTTITLE": "Default Title", - "MESSAGESALIGNMENT": "Messages Alignment", + "BACKGROUNDCOLOR": "Barva pozadí", + "MESSAGEFONTSIZE": "Velikost fontu zprávy", + "TAG": "Značka", + "EDIT_TAG": "Upravit Značku", + "CUSTOMERALIAS": "Zákaznický Alias", + "SNIPPETSWIPEOUT": "Snippet mizení", + "CUSTOMERAVATAR": "Zákaznický Avatar", + "SHOWCUSTOMERAVATAR": "Zobrazit avatara klienta", + "DEFAULTTITLE": "Výchozí titulek", + "MESSAGESALIGNMENT": "Zarovnání zprávy", "ALTERNATE": "Alternate", - "CENTERED": "Centered", - "POSITION": "Position", - "VERTICALPOSITION": "Vertical position", - "ALIGNMENT": "Alignment", - "VERTICALALIGNMENT": "Vertical alignment", - "BOTTOM_RIGHT": "Bottom right", - "RIGHT": "Right", - "LEFT": "Left", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "AGENTIDENTIFIER": "Identifier", - "WEBSITEALIAS": "Website Alias", + "CENTERED": "Vystředěno", + "POSITION": "Pozice", + "VERTICALPOSITION": "Vertikální poloha", + "ALIGNMENT": "Zarovnání", + "VERTICALALIGNMENT": "Vertikální zarovnání", + "BOTTOM_RIGHT": "Vpravo dole", + "RIGHT": "Vpravo", + "LEFT": "Opuštěno", + "WAITFORTHEASSIGNEDAGENT": "Vyčkejte na přiřazeného agenta", + "AGENTIDENTIFIER": "Identifikátor", + "WEBSITEALIAS": "Alias Webstránky", "AGENTALIAS": "Agent Alias", - "AGENTFULLNAME": "Agent Fullname", - "INSERT_MESSAGE_HERE": "Insert your text message here", - "HIDEWHENOFFLINE": "Hide", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "TEXTCOLOR": "Text Color", - "FONTSIZE": "Font Size", - "WEBSCRIPT": "Web Script", - "CANNEDANSWERS": "Canned Answers", - "CHATCANNEDANSWERS": "Canned Answers", - "NO_CHATCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_CHATCANNEDANSWER": "New Canned Answer", - "ADD_CHATCANNEDANSWER": "Add Canned Answer", - "EDIT_CHATCANNEDANSWER": "Edit", - "DELETE_CHATCANNEDANSWER": "Delete", - "OFFLINEMESSAGESUBJECT": "Message subject", - "OFFLINEMESSAGEBODY": "Message body", + "AGENTFULLNAME": "Agent celé jméno", + "INSERT_MESSAGE_HERE": "Vložte zde svoji zprávu", + "HIDEWHENOFFLINE": "Schovat", + "NOTIFICATION": "Upozornění", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Zatřesení", + "NOTIFICATIONTEMPLATE": "Šablona", + "SYSTEM": "Systém", + "EDIT_SYSTEM": "Upravit Systém", + "COMMAND": "Příkaz", + "TEXTCOLOR": "Barva Textu", + "FONTSIZE": "Velikost Fontu", + "WEBSCRIPT": "Web Skript", + "CANNEDANSWERS": "Definované odpovědi", + "CHATCANNEDANSWERS": "Definované odpovědi", + "NO_CHATCANNEDANSWER_AVAILABLE": "Žádné definované odpovědi", + "NEW_CHATCANNEDANSWER": "Nová definovaná odpověď", + "ADD_CHATCANNEDANSWER": "Přidat definovanou odpověď", + "EDIT_CHATCANNEDANSWER": "Upravit", + "DELETE_CHATCANNEDANSWER": "Smazat", + "OFFLINEMESSAGESUBJECT": "Předmět zprávy", + "OFFLINEMESSAGEBODY": "Tělo zprávy", "FORMSUBMITSUCCESSMESSAGE": "Form submit success message", "FORMSUBMITFAILUREMESSAGE": "Form submit failure message", - "PLACEHOLDERMESSAGE": "Message placeholder", - "NOTETITLE": "Note's title", - "CLOSINGQUESTION": "Closing question", - "TAGS": "Tags", - "SHOWAGENTAVATAR": "Show personal agent avatar", + "PLACEHOLDERMESSAGE": "Místo pro text zprávy", + "NOTETITLE": "Název poznámky", + "CLOSINGQUESTION": "Otázka při uzavření", + "TAGS": "Značky", + "SHOWAGENTAVATAR": "Zobrazit osobního avatara agenta", "AGENTAVATAR": "Agent Avatar", - "SPYINTERACTION": "Spy", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_CHATQUEUE": "Go To Realtime Chat Queue", - "PARTIALPAUSE": "Partial Pause", - "BUSY": "Busy", - "TIMER": "Timer", - "IDLE": "Idle", - "CAPACITY": "Capacity", - "AGENTSADD_QUEUE": "Add Agent to Chat Queue", - "QUEUES": "Queues", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", - "WRITING": "Writing", + "SPYINTERACTION": "Náhled", + "NO_AGENT_ONLINE": "Žádný Agent nepřihlášen", + "GOTOREALTIME_CHATQUEUE": "Jít na Realtime Frontu Chatu", + "PARTIALPAUSE": "Částečná pauza", + "BUSY": "Obsazeno", + "TIMER": "Časovač", + "IDLE": "V klidu", + "CAPACITY": "Kapacita", + "AGENTSADD_QUEUE": "Přidat agenta do fronty chatu", + "QUEUES": "Fronty", + "LOGGED_IN": "Přihlášen", + "PAUSED": "Pauza", + "READY": "Připraven", + "WAITING": "Čekání", + "WRITING": "Zapisuji", "CHAT": "Chat", "MAIL": "Email", "SMS": "SMS", "OPENCHANNEL": "Openchannel", "FAX": "Fax", - "PAUSE": "Pause", + "PAUSE": "Pauza", "REALTIME": "Realtime", - "AGENTS": "Agents", - "FULLNAME": "Full Name", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "LOGOUT": "Logout", - "UNPAUSE": "End Pause", - "AGENTADD_QUEUE": "Add Agent to Chat Queue", + "AGENTS": "Agenti", + "FULLNAME": "Celé Jméno", + "INTERNAL": "Interní", + "PHONE_STATE": "Stav telefonu", + "PHONE_STATUS": "Status telefonu", + "LOGOUT": "Odhlásit", + "UNPAUSE": "Ukončit Pauzu", + "AGENTADD_QUEUE": "Přidat agenta do fronty chatu", "TEXT": "Text", - "TIMES": "Number of times per interaction", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "AUTOREPLY": "Auto Reply", - "NEW_CHATDISPOSITION": "New Chat Disposition", - "ENABLECUSTOMERATTACHMENT": "Enable Customer Attachments", - "OFFLINE_CHAT_BUTTON": "'Offline Chat' Button", + "TIMES": "Počet na interakci", + "EDIT_AUTOREPLY": "Upravit Automatickou Odpověď", + "AUTOREPLY": "Automaticky odpovědět", + "NEW_CHATDISPOSITION": "Nová dispozice chatu", + "ENABLECUSTOMERATTACHMENT": "Povolit klientovy přílohy", + "OFFLINE_CHAT_BUTTON": "'Offline Chat' Tlačítko", "OFFLINESTATUS": "Offline Status", - "NAME": "Name", - "CHATQUEUES": "Chat Queues", - "SEARCH_FOR_ANYONE": "Search", - "STRATEGY": "Strategy", - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "KEY": "Key", + "NAME": "Jméno", + "CHATQUEUES": "Chat Fronty", + "SEARCH_FOR_ANYONE": "Vyhledat", + "STRATEGY": "Strategie", + "AGENT_TIMEOUT": "Časový limit Agenta", + "DESCRIPTION": "Popis", + "KEY": "Klíč", "ALIAS": "Alias", - "VARIABLE": "Variable", + "VARIABLE": "Proměnná", "INTERVAL": "Interval", - "EDIT_CLOSE": "Edit Close", - "TIMEZONE": "Timezone", - "MESSAGE": "Message", - "ADVANCED": "Advanced", + "EDIT_CLOSE": "Upravit Uzavřít", + "TIMEZONE": "Časová zóna", + "MESSAGE": "Zpráva", + "ADVANCED": "Rozšířené", "FORWARDTRANSCRIPT": "Forward Transcript", "FORWARDTRANSCRIPTMESSAGE": "Forward Transcript Message", - "SKIPMESSAGEBUTTON": "Skip Message Button", - "EDIT_MESSAGE": "Edit Message", - "CONDITION_AGREEMENT": "Condition Agreement", - "NONE": "None", - "PRIORITY": "Priority", + "SKIPMESSAGEBUTTON": "Zpráva tlačítka Přeskočit", + "EDIT_MESSAGE": "Upravit Zprávu", + "CONDITION_AGREEMENT": "Odsouhlasení Podmínek", + "NONE": "Žádné", + "PRIORITY": "Priorita", "ONLINESTATUS": "Online Status", - "UNMANAGEDSTATUS": "Unmanaged Status", - "AUTOCLOSE": "Enable Autoclose", - "ENABLEUNMANAGEDNOTE": "Enable Unmanaged Message", - "UNMANAGEDMESSAGE": "Message", - "SKIPUNMANAGED": "Skip Message", - "SENDUNMANAGED": "Send Message", - "WEBSITESCRIPT": "Website Script", - "DELETE_OFFLINEMESSAGE": "Delete", - "OFFLINEMESSAGES": "Offline Messages", + "UNMANAGEDSTATUS": "Nezpracovaný Status", + "AUTOCLOSE": "Pomolit automatické uzavření", + "ENABLEUNMANAGEDNOTE": "Povolit Nezpracované Zprávy", + "UNMANAGEDMESSAGE": "Zpráva", + "SKIPUNMANAGED": "Zpráva Přeskočit", + "SENDUNMANAGED": "Odeslat zprávu", + "WEBSITESCRIPT": "Skript Webstránky", + "DELETE_OFFLINEMESSAGE": "Smazat", + "OFFLINEMESSAGES": "Offline zpráva", "FORWARD_OFFLINE": "Forward Offline", - "SHOW_OFFLINEMESSAGE": "Show", + "SHOW_OFFLINEMESSAGE": "Zobrazit", "FORWARD_OFFLINE_ADDRESS": "Forward Offline Address", - "CLOSINGFORM": "Closing Form", - "ENABLERATING": "Enable Rating", - "ENABLECUSTOMERWRITING": "Allow customer writing before agent accepting", - "ENABLEFEEDBACK": "Enable Feedback", - "RATINGTYPE": "Rating Type", - "CLOSINGMESSAGE": "Closing Message", - "CLOSINGMESSAGEBUTTON": "Closing Message Button", - "RATINGSTARSNUMBER": "Rating Stars Number", - "EDIT_GOTOIF": "Edit GotoIf", - "CONDITION": "Condition", + "CLOSINGFORM": "Formulář uzavření", + "ENABLERATING": "Povlit hodnocení", + "ENABLECUSTOMERWRITING": "Povolit klientovy napsat před přijmutím agentem", + "ENABLEFEEDBACK": "Povolit zpětnou vazbu", + "RATINGTYPE": "Typ hodnocení", + "CLOSINGMESSAGE": "Zpráva uzavření", + "CLOSINGMESSAGEBUTTON": "Tlačítko uzavření zprávy", + "RATINGSTARSNUMBER": "Číslo hodnocení hvězdičkami", + "EDIT_GOTOIF": "Upravit GotoIf", + "CONDITION": "Podmínka", "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", - "VALUE": "Value", + "FALSEPRIORITY": "Neplatná priorita", + "VALUE": "Hodnota", "ERRORS": { - "BOTNAME_REQUIRED": "Mandatory Field", - "SECRETACCESSKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Mandatory Field", + "BOTNAME_REQUIRED": "Povinné pole", + "SECRETACCESSKEY_REQUIRED": "Povinné pole", + "ACCESSKEYID_REQUIRED": "Povinné pole", "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Povinné pole", "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "CUSTOMERALIAS_REQUIRED": "Mandatory Field", - "AGENTALIAS_REQUIRED": "Mandatory Field", - "SYSTEMALIAS_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Povinné pole", + "CUSTOMERALIAS_REQUIRED": "Povinné pole", + "AGENTALIAS_REQUIRED": "Povinné pole", + "SYSTEMALIAS_REQUIRED": "Povinné pole", "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MESSAGEFONTSIZE_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "VERTICALPOSITION_REQUIRED": "Mandatory Field", + "MESSAGEFONTSIZE_REQUIRED": "Povinné pole", + "TAG_REQUIRED": "Povinné pole", + "VERTICALPOSITION_REQUIRED": "Povinné pole", "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Povinné pole", "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "COMMAND_REQUIRED": "Mandatory Field", + "NAME_MUST_VALID_PATTERN": "Neplatný formát", + "COMMAND_REQUIRED": "Povinné pole", "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FONTSIZE_REQUIRED": "Mandatory Field", + "FONTSIZE_REQUIRED": "Povinné pole", "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "VALUE_REQUIRED": "Mandatory Field", + "VALUE_REQUIRED": "Povinné pole", "CUSTOMERALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "SYSTEMALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", @@ -202,41 +202,41 @@ "CLOSINGQUESTION_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "HEADER_OFFLINE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "TEXT_REQUIRED": "Mandatory Field", - "SENDUNMANAGED_REQUIRED": "Mandatory Field", + "TEXT_REQUIRED": "Povinné pole", + "SENDUNMANAGED_REQUIRED": "Povinné pole", "SENDUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "SKIPUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "UNMANAGEDMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "WEBSITEALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "AGENT_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "PRIORITY_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", - "EMAIL_MUST_BE_VALID": "Wrong format", - "ADDRESS_REQUIRED": "Mandatory Field", - "ADDRESS_MUST_VALID_URL": "Wrong format", - "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Mandatory Field", - "ACCEPTURL_MUST_VALID_URL": "Wrong format", - "TIMEOUT_REQUIRED": "Mandatory Field", - "REJECTURL_MUST_VALID_URL": "Wrong format", - "CLOSEURL_MUST_VALID_URL": "Wrong format", + "AGENT_REQUIRED": "Povinné pole", + "QUEUE_REQUIRED": "Povinné pole", + "CONDITION_REQUIRED": "Povinné pole", + "PRIORITY_REQUIRED": "Povinné pole", + "TRUEPRIORITY_REQUIRED": "Povinné pole", + "FALSEPRIORITY_REQUIRED": "Povinné pole", + "NAME_REQUIRED": "Povinné pole", + "LIST_REQUIRED": "Povinné pole", + "AGENT_TIMEOUT_REQUIRED": "Povinné pole", + "MOTIONADDRESS_REQUIRED": "Povinné pole", + "DISPOSITION_REQUIRED": "Povinné pole", + "MOTIONADDRESS_MUST_VALID_URL": "Neplatný formát", + "EMAIL_MUST_BE_VALID": "Neplatný formát", + "ADDRESS_REQUIRED": "Povinné pole", + "ADDRESS_MUST_VALID_URL": "Neplatný formát", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Povinné pole", + "ACCEPTURL_MUST_VALID_URL": "Neplatný formát", + "TIMEOUT_REQUIRED": "Povinné pole", + "REJECTURL_MUST_VALID_URL": "Neplatný formát", + "CLOSEURL_MUST_VALID_URL": "Neplatný formát", "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "WAITINGMESSAGE_REQUIRED": "Mandatory Field", - "WAITINGTITLE_REQUIRED": "Mandatory Field", + "WAITINGMESSAGE_REQUIRED": "Povinné pole", + "WAITINGTITLE_REQUIRED": "Povinné pole", "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", + "KEY_REQUIRED": "Povinné pole", "WAITINGMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "WAITINGTITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", @@ -248,103 +248,103 @@ "VIDAOOTOPIC_REQUIRED": "Povinné pole", "EMAIL_ACCOUNT_REQUIRED": "Povinné pole" }, - "CM_FIELD": "Contact Manager Field", - "CHATPROACTIVEACTIONS": "Proactive Actions", - "NEW_CHATPROACTIVEACTION": "New Proactive Action", - "EDIT_CHATPROACTIVEACTION": "Edit Proactive Action", - "DELETE_CHATPROACTIVEACTION": "Delete Proactive Action", - "ADD_CHATPROACTIVEACTION": "Add Proactive Action", - "NO_CHATPROACTIVEACTION_AVAILABLE": "No Proactive Actions Available", - "NO_OFFLINEMESSAGE_AVAILABLE": "No Offline Messages Available", - "MOUSEOVER": "Mouse Over", - "TIMEOUT": "Timeout", - "TYPE": "Type", - "SELECTOR": "Selector", + "CM_FIELD": "Pole kontaktního managera", + "CHATPROACTIVEACTIONS": "Proaktivní Akce", + "NEW_CHATPROACTIVEACTION": "Nová proaktivní akce", + "EDIT_CHATPROACTIVEACTION": "Upravit Proaktivní Akci", + "DELETE_CHATPROACTIVEACTION": "Smazat proaktivní akci", + "ADD_CHATPROACTIVEACTION": "Přidat Proaktivní Akci", + "NO_CHATPROACTIVEACTION_AVAILABLE": "Žádné proaktivní akce", + "NO_OFFLINEMESSAGE_AVAILABLE": "Žádné Offline zprávy", + "MOUSEOVER": "Myš přes", + "TIMEOUT": "Časový limit", + "TYPE": "Typ", + "SELECTOR": "Výběr", "AGENT": "Agent", "GOTO": "Goto", "GOTOIF": "GotoIf", "NOOP": "Noop", - "QUEUE": "Queue", + "QUEUE": "Fronta", "BUILDER": "Builder", - "PREVIEW": "Preview", - "EDIT_AGENT": "Edit Agent", - "EDIT_QUEUE": "Edit Queue", - "EDIT_GOTO": "Edit Goto", - "EDIT_GOTOIf": "Edit GotoIf", - "EDIT_NOOP": "Edit Noop", - "ADD_CHATQUEUE": "Add Chat Queue", - "EDIT_CHATQUEUE": "Edit Chat Queue", - "DELETE_CHATQUEUE": "Delete Chat Queue", - "SETTINGS": "Settings", - "SAVE": "Save", - "SCRIPT": "Script", + "PREVIEW": "Náhled", + "EDIT_AGENT": "Upravit Agenta", + "EDIT_QUEUE": "Upravit Frontu", + "EDIT_GOTO": "Upravit Goto", + "EDIT_GOTOIf": "Upravit GotoIf", + "EDIT_NOOP": "Upravit Noop", + "ADD_CHATQUEUE": "Přidat Frontu Chatu", + "EDIT_CHATQUEUE": "Upravit Frontu Chatu", + "DELETE_CHATQUEUE": "Smazat frontu chatu", + "SETTINGS": "Nastavení", + "SAVE": "Uložit", + "SCRIPT": "Skript", "TOKEN": "Token", - "CREATED_AT": "Created At", - "CHATWEBSITES": "Chat Websites", - "MOTIONADDRESS": "Website Domain", - "MOTIONPROXY": "Proxy Or Motion Domain", - "ADD_CHATWEBSITE": "Add Chat Website", - "EDIT_CHATWEBSITE": "Edit Chat Website", - "DELETE_CHATWEBSITE": "Delete Chat Website", - "LIST": "List", + "CREATED_AT": "Vytvořeno", + "CHATWEBSITES": "Chat Webstránky", + "MOTIONADDRESS": "Doména webstránky", + "MOTIONPROXY": "Proxy nebo Motion doména", + "ADD_CHATWEBSITE": "Přidat Webstránku Chatu", + "EDIT_CHATWEBSITE": "Upravit Webstránku Chatu", + "DELETE_CHATWEBSITE": "Smazat webstránku chatu", + "LIST": "Seznam", "SNIPPET": "Snippet", - "FORMS": "Forms", - "UP": "Up", - "DOWN": "Down", - "COLLAPSE": "Collapse", - "PROACTIVEACTIONS": "Proactive Actions", - "DISPOSITIONS": "Dispositions", + "FORMS": "Formuláře", + "UP": "Nahoru", + "DOWN": "Dolů", + "COLLAPSE": "Zabalit", + "PROACTIVEACTIONS": "Proaktivní akce", + "DISPOSITIONS": "Dispozice", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", + "ACTIONS": "Akce", "FIDELITY": "Fidelity", - "APPEARANCE": "Appearance", - "MAINCOLOR": "Main Color", - "FOCUSCOLOR": "Focus Color", - "BUTTONCOLOR": "Button Color", - "HEADERSHAPE": "Header Shape", - "ANIMATION": "Animation", - "DEFAULT": "Default", + "APPEARANCE": "Vzhled", + "MAINCOLOR": "Hlavní Barva", + "FOCUSCOLOR": "Focus Barva", + "BUTTONCOLOR": "Barva tlačítka", + "HEADERSHAPE": "Tvar Záhlaví", + "ANIMATION": "Animace", + "DEFAULT": "Výchozí", "WHITELABEL": "White Label", "LOGO": "Logo", - "DOWNLOADTRANSCRIPT": "Download Transcript", - "ENQUIRY_ENABLE": "Enquiry Enable", - "ENQUIRY_FORWARDING": "Enquiry Forwarding", - "ENQUIRY_FORWARDING_ADDRESS": "Enquiry Forwarding Address", - "LABELS": "Labels", - "HEADER_ONLINE": "Online Header", - "ONLINE_MESSAGE": "Online Message", - "NAME_TITLE": "Name Input Label", - "USERNAME_PLACEHOLDER": "Username Input Placeholder", - "EMAIL_TITLE": "Email Input Label", - "EMAIL_PLACEHOLDER": "Email Input Placeholder", - "START_CHAT_BUTTON": "'Start Chat' Button", - "AGENTS_BUSY": "Busy Agents Message", - "HEADER_OFFLINE": "Offline Header", - "OFFLINE_MESSAGE": "Offline Message", - "MESSAGE_TITLE": "Message Label", - "ENQUIRY_MESSAGE_PLACEHOLDER": "Enquiry Message Input Placeholder", - "ENQUIRY_BUTTON": "Enquiry Button Text", - "RATING_MESSAGE": "Rating Message", - "RATING_SEND": "Rating Send Button Text", - "RATING_SKIP": "Rating Skip Button Text", + "DOWNLOADTRANSCRIPT": "Stáhnout přepis", + "ENQUIRY_ENABLE": "Povolit Dotaz", + "ENQUIRY_FORWARDING": "Přeposlání Dotazu", + "ENQUIRY_FORWARDING_ADDRESS": "Adresa přeposlání dotazu", + "LABELS": "Štítky", + "HEADER_ONLINE": "Online Záhlaví", + "ONLINE_MESSAGE": "Online Zpráva", + "NAME_TITLE": "Štítek Vstupu Jména", + "USERNAME_PLACEHOLDER": "Vstup Jméno užiavtele místo pro text", + "EMAIL_TITLE": "Email Vstup Štítky", + "EMAIL_PLACEHOLDER": "Email Vstup místo pro text", + "START_CHAT_BUTTON": "Tlačítko 'Zahájit Chat'", + "AGENTS_BUSY": "Zpráva při obsazení agentů", + "HEADER_OFFLINE": "Offline Záhlaví", + "OFFLINE_MESSAGE": "Offline zpráva", + "MESSAGE_TITLE": "Štítek zprávy", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Zpráva Dotazu vstupní místo pro text", + "ENQUIRY_BUTTON": "Text Tlačítka Dotaz", + "RATING_MESSAGE": "Zpráva hodnocení", + "RATING_SEND": "Text tlačítka Odeslat hodnocení", + "RATING_SKIP": "Text tlačítka Přeskočit hodnocení", "ONLINE": "Online", "OFFLINE": "Offline", - "PROACTIVE": "Proactive", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", - "EMBEDDING": "Embedding", - "GENERAL": "General", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", + "PROACTIVE": "Proaktivní", + "ACCEPT": "Přijmout", + "ACCEPTMETHOD": "Způsob příjmu", + "ACCEPTURL": "Přijmout URL", + "REJECT": "Odmítnout", + "REJECTMETHOD": "Způsob odmítnutí", + "REJECTURL": "URL Odmítnutí", + "CLOSE": "Uzavřít", + "CLOSEMETHOD": "Způsob uzavření", + "CLOSEURL": "URL Uzavření", + "EMBEDDING": "Vložený", + "GENERAL": "Obecné", + "SELECTED": "Vybráno", + "SELECT_ALL": "Vybrat Vše", + "SELECT_NONE": "Zrušit výběr", + "BACK": "Zpět", "HELP": { "VERTICALPOSITION": "Represents the distance in percentage from top", "AGENTIDENTIFIER": "Represents the agent identifier within the chat session in the snippet", @@ -373,74 +373,74 @@ "MANDATORYDISPOSITION": "Povinná dispozice", "MANDATORYDISPOSITIONPAUSEID": "Pokud je povolena povinná dispozice, pozastavte jej" }, - "ADDRESS": "Address", - "ONLINESTATE": "Online Status", - "OFFLINESTATE": "Offline Status", - "RATINGSTATE": "Rating State", - "ENQUIRY": "Enquiry", - "OFFLINETEMPLATE": "Offline Template", - "CHATDISPOSITIONS": "Chat Dispositions", - "NO_CHATDISPOSITION_AVAILABLE": "No Chat Dispositions available", - "ADD_CHATDISPOSITION": "Add Chat Disposition", - "DELETE": "Delete", - "EDIT_CHATDISPOSITION": "Edit Chat Disposition", - "DELETE_CHATDISPOSITION": "Delete Chat Disposition", + "ADDRESS": "Adresa", + "ONLINESTATE": "Online Stav", + "OFFLINESTATE": "Offline Stav", + "RATINGSTATE": "Stav Hodnocení", + "ENQUIRY": "Dotaz", + "OFFLINETEMPLATE": "Offline Šablona", + "CHATDISPOSITIONS": "Dispozice Chatu", + "NO_CHATDISPOSITION_AVAILABLE": "Žádné dispozice chatu", + "ADD_CHATDISPOSITION": "Přidat Dispozici Chatu", + "DELETE": "Smazat", + "EDIT_CHATDISPOSITION": "Upravit Dispozici Chatu", + "DELETE_CHATDISPOSITION": "Smazat Dispozici Chatu", "ID": "Id", - "NEW_CHATQUEUE": "New Chat Queue", - "NEW_CHATWEBSITE": "New Chat Website", - "ROUNDED": "Rounded", - "SQUARED": "Squared", - "NO_AVAILABLE_INFO": "No available info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "CONTACT": "Contact", - "STARTEDAT": "Started At", + "NEW_CHATQUEUE": "Nová fronta Chatu", + "NEW_CHATWEBSITE": "Nová Webstránka Chatu", + "ROUNDED": "Zakulacen", + "SQUARED": "Hranatý", + "NO_AVAILABLE_INFO": "Žádné dustupné info", + "ALL_TEAMS": "Všechny Týmy", + "SELECTED_TEAMS": "Vybrané Týmy", + "PAGE": "Stránka", + "ROWSPERPAGE": "Řádek na stránku", + "OF": "z", + "CONTACT": "Kontakt", + "STARTEDAT": "Spuštěn", "STATUS": "Status", - "CLOSED": "Closed", - "OPENED": "Open", - "OPEN": "Open", - "ACCOUNT": "Account", - "INTERACTION": "Interaction", - "INTERACTIONS": "Interactions", - "WEBSITE": "Website", - "ALL": "All", - "SELECT_STATUS": "Select a status", - "FILTER": "Filter", - "FILTERS": "Filters", - "TEAMADD_CHATQUEUE": "Add Team to Chat Queue", - "AGENTADD_CHATQUEUE": "Add Agent to Chat Queue", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", - "CREATEDAT": "Created At", - "NOTES": "Notes", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "SELECTED_WEBSITE": "Select a website", + "CLOSED": "Uzavřeno", + "OPENED": "Otevřeno", + "OPEN": "Otevřít", + "ACCOUNT": "Účet", + "INTERACTION": "Interakce", + "INTERACTIONS": "Interakce", + "WEBSITE": "Webstránka", + "ALL": "Vše", + "SELECT_STATUS": "Vybrat status", + "FILTER": "Filtr", + "FILTERS": "Filtry", + "TEAMADD_CHATQUEUE": "Přidat team do fronty chatu", + "AGENTADD_CHATQUEUE": "Přidat agenta do fronty chatu", + "ALL_AGENTS": "Všichni Agenti", + "SELECTED_AGENTS": "Vybraní Agenti", + "CLOSEDAT": "Uzavřeno", + "DISPOSITION": "Dispozice", + "CREATEDAT": "Vytvořeno", + "NOTES": "Poznámky", + "NO_INTERACTION_AVAILABLE": "Žádné interakce", + "SELECTED_WEBSITE": "Vybrat Webstránku", "GOTOP": "Gotop", - "EDIT_GOTOP": "Edit Gotop", - "SELECT_WEBSITE": "Select a website", + "EDIT_GOTOP": "Upravit Gotop", + "SELECT_WEBSITE": "Vybrat webstránku", "INFO": "Info", - "OFFLINEMESSAGES_CHATWEBSITE": "Go to Offline Messages", - "WAITINGTITLE": "Waiting Title", - "WAITINGMESSAGE": "Waiting Message", - "RATING": "Rating", - "NO_RATINGVALUE": "No Rating", - "DEFAULT_PAUSE": "Default pause", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", - "VOICE": "Voice", - "INTERACTIONS_CHATWEBSITE": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_CHATWEBSITE": "Add Agent to Chat Website", + "OFFLINEMESSAGES_CHATWEBSITE": "Přejít na Offline zprávy", + "WAITINGTITLE": "Čekací titulek", + "WAITINGMESSAGE": "Čekací zprává", + "RATING": "Hodnocení", + "NO_RATINGVALUE": "Nehodnoceno", + "DEFAULT_PAUSE": "Výchozí pauza", + "UNKNOWN": "Neznámý", + "UNREGISTERED": "Neregistrován", + "UNAVAILABLE": "Nedostupný", + "NOT_INUSE": "Nepoužíván", + "REACHABLE": "Dostupný", + "IN_USE": "Používán", + "VOICE": "Hlas", + "INTERACTIONS_CHATWEBSITE": "Přejít na Interakce", + "REFRESH_INTERACTIONS": "Aktualizovat interakce", + "DELETE_INTERACTION": "Smazat interakci", + "AGENTADD_CHATWEBSITE": "Přidat agenta k webstránce chatu", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Stahujte bez příloh", "DOWNLOAD_WITH_ATTACHMENTS": "Stáhnout s přílohami", "ENABLESENDBUTTON": "Povolit tlačítko Odeslat", @@ -448,7 +448,7 @@ "LASTMESSAGE": "Poslední zpráva", "MANDATORYDISPOSITION": "Povinná dispozice", "MANDATORYDISPOSITIONPAUSEID": "Pokud je povolena povinná dispozice, pozastavte jej", - "TEAMS_ASSOCIATION": "Asociace týmů", + "TEAMS_ASSOCIATION": "Přiřazení týmů", "TOOLTIP_SCREENRECORDING_OFF": "K dispozici je nahrávání obrazovky", "TOOLTIP_SCREENRECORDING_ON": "Probíhá nahrávání obrazovky", "VIDAOO": "Vidaoo", @@ -456,7 +456,7 @@ "VIDAOOESCALATION": "Zahajte videohovor", "VIDAOOSESSION": "Zahajte videohovor", "VIDEO": "Video", - "CLIENTEMAIL": "E-mail klienta", + "CLIENTEMAIL": "E-mail klient", "DIALOGFLOWV2": "Dialogflow V2", "EDIT_DIALOGFLOWV2": "Upravit Dialogflow V2", "PRIVATEKEY": "Soukromý klíč", @@ -465,17 +465,17 @@ "OPEN_NEW_INTERACTION": "Otevřít novou interakci", "SUBJECT": "Předmět", "ADD_NOTE": "Přidat poznámku", - "CANNED_ANSWER_NOT_FOUND": "Nebyly nalezeny žádné konzervované odpovědi", + "CANNED_ANSWER_NOT_FOUND": "Nebyly nalezeny žádné definované odpovědi", "NOTE": "Poznámka", "VIDAOOMETADATA": "Vidaoo metadata", - "VIDAOONOTE": "Vidaoo Note", + "VIDAOONOTE": "Vidaoo Poznámka", "VIDAOOTOPIC": "Téma Vidaoo", "CHANNELID": "ID kanálu", "EDIT_TVOX": "Upravit TVox", - "MOTIONTITLE": "Název pohybu", - "MOTIONURL": "Pohybová URL", - "MOTIONURLONANSWER": "Pohybovat URL při odpovědi", - "MOTIONURLONRING": "Pohybová URL na prstenu", + "MOTIONTITLE": "Název Motion", + "MOTIONURL": "Motion URL", + "MOTIONURLONANSWER": "Motion URL při odpovědi", + "MOTIONURLONRING": "Motion URL při vyzvánění", "SERVICEID": "ID služby", "SERVICENAME": "Název služby", "TVOX": "TVox", diff --git a/public/app/main/apps/chat/i18n/is.json b/public/app/main/apps/chat/i18n/is.json new file mode 100644 index 0000000..a8f7e5c --- /dev/null +++ b/public/app/main/apps/chat/i18n/is.json @@ -0,0 +1,491 @@ +{ + "CHAT": { + "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "DIALOGFLOWV2": "Dialogflow V2", + "PRIVATEKEY": "Private Key", + "CLIENTEMAIL": "Client Email", + "PROJECTID": "Project ID", + "VIDAOOESCALATION": "Start Video Call", + "VIDAOOAPIKEY": "Vidaoo Api Key", + "VIDAOOSESSION": "Start Video Call", + "VIDAOOTOPIC": "Vidaoo Topic", + "VIDAOONOTE": "Vidaoo Note", + "VIDAOOMETADATA": "Vidaoo Metadata", + "VIDEO": "Video", + "VIDAOO": "Vidaoo", + "EDIT_AMAZONLEX": "Edit Amazon Lex", + "AMAZONLEX": "Amazon Lex", + "ACCESSKEYID": "Access Key ID", + "SECRETACCESSKEY": "Secret Access Key", + "LEXREGION": "Region", + "BOTNAME": "Bot Name", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "DOWNLOAD_INTERACTION": "Download", + "ENABLECUSTOMERCHECKMARKS": "Enable customer delivered/read notifications", + "TRANSFER": "Transfer", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "SYSTEMAVATAR": "System Avatar", + "SYSTEMALIAS": "System Alias", + "OPEN_NEW_INTERACTION": "Open new interaction", + "EMAIL_ACCOUNT": "Email account", + "SUBJECT": "Subject", + "WELCOMEMESSAGE": "Welcome Message", + "LANGUAGE": "Language", + "EDIT_DIALOGFLOW": "Edit Dialogflow", + "DIALOGFLOW": "Dialogflow", + "BACKGROUNDCOLOR": "Background Color", + "MESSAGEFONTSIZE": "Message Font Size", + "ADD_NOTE": "Add note", + "NOTE": "Note", + "TAG": "Tag", + "EDIT_TAG": "Edit Tag", + "CUSTOMERALIAS": "Customer Alias", + "SNIPPETSWIPEOUT": "Snippet swipe out", + "CUSTOMERAVATAR": "Customer Avatar", + "SHOWCUSTOMERAVATAR": "Show customer avatar", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", + "DEFAULTTITLE": "Default Title", + "MESSAGESALIGNMENT": "Messages Alignment", + "ALTERNATE": "Alternate", + "CENTERED": "Centered", + "POSITION": "Position", + "VERTICALPOSITION": "Vertical position", + "ALIGNMENT": "Alignment", + "VERTICALALIGNMENT": "Vertical alignment", + "BOTTOM_RIGHT": "Bottom right", + "RIGHT": "Right", + "LEFT": "Left", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "AGENTIDENTIFIER": "Identifier", + "WEBSITEALIAS": "Website Alias", + "AGENTALIAS": "Agent Alias", + "AGENTFULLNAME": "Agent Fullname", + "INSERT_MESSAGE_HERE": "Insert your text message here", + "HIDEWHENOFFLINE": "Hide", + "NOTIFICATION": "Notification", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONTEMPLATE": "Template", + "SYSTEM": "System", + "EDIT_SYSTEM": "Edit System", + "COMMAND": "Command", + "TEXTCOLOR": "Text Color", + "TEXT_BUTTON_COLOR": "Text Button Color", + "FONTSIZE": "Font Size", + "WEBSCRIPT": "Web Script", + "CANNEDANSWERS": "Canned Answers", + "CHATCANNEDANSWERS": "Canned Answers", + "NO_CHATCANNEDANSWER_AVAILABLE": "No Canned Answers Available", + "NEW_CHATCANNEDANSWER": "New Canned Answer", + "ADD_CHATCANNEDANSWER": "Add Canned Answer", + "EDIT_CHATCANNEDANSWER": "Edit", + "DELETE_CHATCANNEDANSWER": "Delete", + "OFFLINEMESSAGESUBJECT": "Message subject", + "OFFLINEMESSAGEBODY": "Message body", + "FORMSUBMITSUCCESSMESSAGE": "Form submit success message", + "FORMSUBMITFAILUREMESSAGE": "Form submit failure message", + "PLACEHOLDERMESSAGE": "Message placeholder", + "NOTETITLE": "Note's title", + "CLOSINGQUESTION": "Closing question", + "TAGS": "Tags", + "SHOWAGENTAVATAR": "Show personal agent avatar", + "AGENTAVATAR": "Agent Avatar", + "SPYINTERACTION": "Spy", + "NO_AGENT_ONLINE": "No Agent Online", + "GOTOREALTIME_CHATQUEUE": "Go To Realtime Chat Queue", + "PARTIALPAUSE": "Partial Pause", + "BUSY": "Busy", + "TIMER": "Timer", + "IDLE": "Idle", + "CAPACITY": "Capacity", + "AGENTSADD_QUEUE": "Add Agent to Chat Queue", + "QUEUES": "Queues", + "LOGGED_IN": "Logged in", + "PAUSED": "Paused", + "READY": "Ready", + "WAITING": "Waiting", + "WRITING": "Writing", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "SMS", + "OPENCHANNEL": "Openchannel", + "FAX": "Fax", + "PAUSE": "Pause", + "REALTIME": "Realtime", + "AGENTS": "Agents", + "FULLNAME": "Full Name", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "LOGOUT": "Logout", + "UNPAUSE": "End Pause", + "AGENTADD_QUEUE": "Add Agent to Chat Queue", + "TEXT": "Text", + "TIMES": "Number of times per interaction", + "EDIT_AUTOREPLY": "Edit Auto Reply", + "AUTOREPLY": "Auto Reply", + "NEW_CHATDISPOSITION": "New Chat Disposition", + "ENABLECUSTOMERATTACHMENT": "Enable Customer Attachments", + "ENABLESENDBUTTON": "Enable Send Button", + "OFFLINE_CHAT_BUTTON": "'Offline Chat' Button", + "OFFLINESTATUS": "Offline Status", + "NAME": "Name", + "CHATQUEUES": "Chat Queues", + "SEARCH_FOR_ANYONE": "Search", + "STRATEGY": "Strategy", + "AGENT_TIMEOUT": "Agent Timeout", + "DESCRIPTION": "Description", + "KEY": "Key", + "ALIAS": "Alias", + "VARIABLE": "Variable", + "INTERVAL": "Interval", + "EDIT_CLOSE": "Edit Close", + "TIMEZONE": "Timezone", + "MESSAGE": "Message", + "ADVANCED": "Advanced", + "FORWARDTRANSCRIPT": "Forward Transcript", + "FORWARDTRANSCRIPTMESSAGE": "Forward Transcript Message", + "SKIPMESSAGEBUTTON": "Skip Message Button", + "EDIT_MESSAGE": "Edit Message", + "CONDITION_AGREEMENT": "Condition Agreement", + "NONE": "None", + "PRIORITY": "Priority", + "ONLINESTATUS": "Online Status", + "UNMANAGEDSTATUS": "Unmanaged Status", + "AUTOCLOSE": "Enable Autoclose", + "ENABLEUNMANAGEDNOTE": "Enable Unmanaged Message", + "UNMANAGEDMESSAGE": "Message", + "SKIPUNMANAGED": "Skip Message", + "SENDUNMANAGED": "Send Message", + "WEBSITESCRIPT": "Website Script", + "DELETE_OFFLINEMESSAGE": "Delete", + "OFFLINEMESSAGES": "Offline Messages", + "FORWARD_OFFLINE": "Forward Offline", + "SHOW_OFFLINEMESSAGE": "Show", + "FORWARD_OFFLINE_ADDRESS": "Forward Offline Address", + "CLOSINGFORM": "Closing Form", + "ENABLERATING": "Enable Rating", + "ENABLECUSTOMERWRITING": "Allow customer writing before agent accepting", + "ENABLEFEEDBACK": "Enable Feedback", + "FEEDBACKTITLE": "Feedback Title", + "RATINGTYPE": "Rating Type", + "CLOSINGMESSAGE": "Closing Message", + "CLOSINGMESSAGEBUTTON": "Closing Message Button", + "RATINGSTARSNUMBER": "Rating Stars Number", + "EDIT_GOTOIF": "Edit GotoIf", + "CONDITION": "Condition", + "TRUEPRIORITY": "True Priority", + "FALSEPRIORITY": "False Priority", + "VALUE": "Value", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "SERVICEID": "Service ID", + "CHANNELID": "Channel ID", + "EDIT_TVOX": "Edit TVox", + "SERVICENAME": "Service name", + "TVOX": "TVox", + "TVOXURL": "TVox IP URL", + "TVOXIP": "TVox IP Address", + "TVOXUSERNAME": "TVox Username", + "TVOXPASSWD": "TVox Password", + "TVOXLOGINURL": "TVox Login REST Url", + "TVOXSESSIONURL": "TVox Session REST Url", + "MOTIONURLONRING": "Motion URL On Ring", + "MOTIONURLONANSWER": "Motion URL On Answer", + "MOTIONTITLE": "Motion Title", + "MOTIONURL": "Motion URL", + "ERRORS": { + "PROJECTID_REQUIRED": "Mandatory Field", + "CLIENTEMAIL_REQUIRED": "Mandatory Field", + "PRIVATEKEY_REQUIRED": "Mandatory Field", + "VIDAOOAPIKEY_REQUIRED": "Mandatory Field", + "VIDAOOTOPIC_REQUIRED": "Mandatory Field", + "BOTNAME_REQUIRED": "Mandatory Field", + "SECRETACCESSKEY_REQUIRED": "Mandatory Field", + "ACCESSKEYID_REQUIRED": "Mandatory Field", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "CUSTOMERALIAS_REQUIRED": "Mandatory Field", + "AGENTALIAS_REQUIRED": "Mandatory Field", + "SYSTEMALIAS_REQUIRED": "Mandatory Field", + "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MESSAGEFONTSIZE_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "VERTICALPOSITION_REQUIRED": "Mandatory Field", + "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "COMMAND_REQUIRED": "Mandatory Field", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FONTSIZE_REQUIRED": "Mandatory Field", + "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "VALUE_REQUIRED": "Mandatory Field", + "CUSTOMERALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "SYSTEMALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "OFFLINEMESSAGEBODY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "PLACEHOLDERMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "NOTETITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "CLOSINGQUESTION_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "HEADER_OFFLINE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "TEXT_REQUIRED": "Mandatory Field", + "SENDUNMANAGED_REQUIRED": "Mandatory Field", + "SENDUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "SKIPUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "UNMANAGEDMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "WEBSITEALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "AGENT_REQUIRED": "Mandatory Field", + "QUEUE_REQUIRED": "Mandatory Field", + "CONDITION_REQUIRED": "Mandatory Field", + "PRIORITY_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_REQUIRED": "Mandatory Field", + "FALSEPRIORITY_REQUIRED": "Mandatory Field", + "NAME_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_REQUIRED": "Mandatory Field", + "DISPOSITION_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", + "EMAIL_MUST_BE_VALID": "Wrong format", + "ADDRESS_REQUIRED": "Mandatory Field", + "ADDRESS_MUST_VALID_URL": "Wrong format", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Mandatory Field", + "ACCEPTURL_MUST_VALID_URL": "Wrong format", + "TIMEOUT_REQUIRED": "Mandatory Field", + "REJECTURL_MUST_VALID_URL": "Wrong format", + "CLOSEURL_MUST_VALID_URL": "Wrong format", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", + "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", + "WAITINGMESSAGE_REQUIRED": "Mandatory Field", + "WAITINGTITLE_REQUIRED": "Mandatory Field", + "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "KEY_REQUIRED": "Mandatory Field", + "WAITINGMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "WAITINGTITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", + "EMAIL_ACCOUNT_REQUIRED": "Mandatory field" + }, + "CM_FIELD": "Contact Manager Field", + "CHATPROACTIVEACTIONS": "Proactive Actions", + "NEW_CHATPROACTIVEACTION": "New Proactive Action", + "EDIT_CHATPROACTIVEACTION": "Edit Proactive Action", + "DELETE_CHATPROACTIVEACTION": "Delete Proactive Action", + "ADD_CHATPROACTIVEACTION": "Add Proactive Action", + "NO_CHATPROACTIVEACTION_AVAILABLE": "No Proactive Actions Available", + "NO_OFFLINEMESSAGE_AVAILABLE": "No Offline Messages Available", + "MOUSEOVER": "Mouse Over", + "TIMEOUT": "Timeout", + "TYPE": "Type", + "SELECTOR": "Selector", + "AGENT": "Agent", + "GOTO": "Goto", + "GOTOIF": "GotoIf", + "NOOP": "Noop", + "QUEUE": "Queue", + "BUILDER": "Builder", + "PREVIEW": "Preview", + "EDIT_AGENT": "Edit Agent", + "EDIT_QUEUE": "Edit Queue", + "EDIT_GOTO": "Edit Goto", + "EDIT_GOTOIf": "Edit GotoIf", + "EDIT_NOOP": "Edit Noop", + "ADD_CHATQUEUE": "Add Chat Queue", + "EDIT_CHATQUEUE": "Edit Chat Queue", + "DELETE_CHATQUEUE": "Delete Chat Queue", + "SETTINGS": "Settings", + "SAVE": "Save", + "SCRIPT": "Script", + "TOKEN": "Token", + "CREATED_AT": "Created At", + "CHATWEBSITES": "Chat Websites", + "MOTIONADDRESS": "Website Domain", + "MOTIONPROXY": "Proxy Or Motion Domain", + "ADD_CHATWEBSITE": "Add Chat Website", + "EDIT_CHATWEBSITE": "Edit Chat Website", + "DELETE_CHATWEBSITE": "Delete Chat Website", + "LIST": "List", + "SNIPPET": "Snippet", + "FORMS": "Forms", + "UP": "Up", + "DOWN": "Down", + "COLLAPSE": "Collapse", + "PROACTIVEACTIONS": "Proactive Actions", + "DISPOSITIONS": "Dispositions", + "WEBHOOKS": "WebHooks", + "ACTIONS": "Actions", + "FIDELITY": "Fidelity", + "APPEARANCE": "Appearance", + "MAINCOLOR": "Main Color", + "FOCUSCOLOR": "Focus Color", + "BUTTONCOLOR": "Button Color", + "HEADERSHAPE": "Header Shape", + "ANIMATION": "Animation", + "DEFAULT": "Default", + "WHITELABEL": "White Label", + "LOGO": "Logo", + "DOWNLOADTRANSCRIPT": "Download Transcript", + "ENQUIRY_ENABLE": "Enquiry Enable", + "ENQUIRY_FORWARDING": "Enquiry Forwarding", + "ENQUIRY_FORWARDING_ADDRESS": "Enquiry Forwarding Address", + "LABELS": "Labels", + "HEADER_ONLINE": "Online Header", + "ONLINE_MESSAGE": "Online Message", + "NAME_TITLE": "Name Input Label", + "USERNAME_PLACEHOLDER": "Username Input Placeholder", + "EMAIL_TITLE": "Email Input Label", + "EMAIL_PLACEHOLDER": "Email Input Placeholder", + "START_CHAT_BUTTON": "'Start Chat' Button", + "AGENTS_BUSY": "Busy Agents Message", + "HEADER_OFFLINE": "Offline Header", + "OFFLINE_MESSAGE": "Offline Message", + "MESSAGE_TITLE": "Message Label", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Enquiry Message Input Placeholder", + "ENQUIRY_BUTTON": "Enquiry Button Text", + "RATING_MESSAGE": "Rating Message", + "RATING_SEND": "Rating Send Button Text", + "RATING_SKIP": "Rating Skip Button Text", + "ONLINE": "Online", + "OFFLINE": "Offline", + "PROACTIVE": "Proactive", + "ACCEPT": "Accept", + "ACCEPTMETHOD": "Accept Method", + "ACCEPTURL": "Accept URL", + "REJECT": "Reject", + "REJECTMETHOD": "Reject Method", + "REJECTURL": "Reject URL", + "CLOSE": "Close", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "EMBEDDING": "Embedding", + "GENERAL": "General", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "BACK": "Back", + "HELP": { + "VERTICALPOSITION": "Represents the distance in percentage from top", + "AGENTIDENTIFIER": "Represents the agent identifier within the chat session in the snippet", + "HIDEWHENOFFLINE": "Hides snippet when offline", + "KEY": "Website short name (5 char) shown on the Agent Tab", + "TOKEN": "Automatically generated token used in the Script", + "INTEVAL": "To be selected from the list of the available intervals", + "TIMEZONE": "Select one from the list (default=local timezone)", + "ENABLERATING": "Enable it if you want the web visitor can rate the interaction at the end", + "ENABLEFEEDBACK": "Enable it if you want the web visitor can send a feedback (up to 150 char) at the end", + "FORWARDTRANSCRIPT": "Enable it if you want the web visitor is asked to receive a chat transcript via email", + "AUTOCLOSE": "Enable it if you want chat sessions to be closed as Unmanaged if no agent is available. Learn more about it at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "ENABLEUNMANAGEDNOTE": "Enable it if you want the visitor is shown a message when all the agents are busy and the chat gets unmanaged", + "WEBSITEALIAS": "A prefix used to compose the agent name (prefix+Agent Id) shown to the web visitor during the chat session", + "ENABLECUSTOMERWRITING": " Enable it if you want the chat starts without waiting for an available agent (pay attention: if you enable it, your chats will never get unmanaged). Learn more at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "MAPKEY": "The following Motion Contact Manager field:", + "FROMKEY": "Will be mapped in your Motion Chat Snippet as:", + "COPYSCRIPTTOCLIPBOARD": "Copy and paste the script text into your website", + "FORWARD_OFFLINE": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "MOTIONADDRESS": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", + "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "LIST": "Contact Manager list used to associate Contacts", + "INTERVAL": "Select one from the list", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "WELCOMEMESSAGE": "Leave empty if you don't want to send any welcome message" + }, + "ADDRESS": "Address", + "ONLINESTATE": "Online Status", + "OFFLINESTATE": "Offline Status", + "RATINGSTATE": "Rating State", + "ENQUIRY": "Enquiry", + "OFFLINETEMPLATE": "Offline Template", + "CHATDISPOSITIONS": "Chat Dispositions", + "NO_CHATDISPOSITION_AVAILABLE": "No Chat Dispositions available", + "ADD_CHATDISPOSITION": "Add Chat Disposition", + "DELETE": "Delete", + "EDIT_CHATDISPOSITION": "Edit Chat Disposition", + "DELETE_CHATDISPOSITION": "Delete Chat Disposition", + "ID": "Id", + "NEW_CHATQUEUE": "New Chat Queue", + "NEW_CHATWEBSITE": "New Chat Website", + "ROUNDED": "Rounded", + "SQUARED": "Squared", + "NO_AVAILABLE_INFO": "No available info", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "CONTACT": "Contact", + "STARTEDAT": "Started At", + "LASTMESSAGE": "Last message", + "STATUS": "Status", + "CLOSED": "Closed", + "OPENED": "Open", + "OPEN": "Open", + "ACCOUNT": "Account", + "INTERACTION": "Interaction", + "INTERACTIONS": "Interactions", + "WEBSITE": "Website", + "ALL": "All", + "SELECT_STATUS": "Select a status", + "FILTER": "Filter", + "FILTERS": "Filters", + "TEAMADD_CHATQUEUE": "Add Team to Chat Queue", + "AGENTADD_CHATQUEUE": "Add Agent to Chat Queue", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "CLOSEDAT": "Closed At", + "DISPOSITION": "Disposition", + "CREATEDAT": "Created At", + "NOTES": "Notes", + "NO_INTERACTION_AVAILABLE": "No interactions available", + "SELECTED_WEBSITE": "Select a website", + "GOTOP": "Gotop", + "EDIT_GOTOP": "Edit Gotop", + "SELECT_WEBSITE": "Select a website", + "INFO": "Info", + "OFFLINEMESSAGES_CHATWEBSITE": "Go to Offline Messages", + "WAITINGTITLE": "Waiting Title", + "WAITINGMESSAGE": "Waiting Message", + "RATING": "Rating", + "NO_RATINGVALUE": "No Rating", + "DEFAULT_PAUSE": "Default pause", + "UNKNOWN": "Unknown", + "UNREGISTERED": "Unregistered", + "UNAVAILABLE": "Unavailable", + "NOT_INUSE": "Not in use", + "REACHABLE": "Reachable", + "IN_USE": "In use", + "VOICE": "Voice", + "INTERACTIONS_CHATWEBSITE": "Go to Interactions", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "DELETE_INTERACTION": "Delete Interaction", + "AGENTADD_CHATWEBSITE": "Add Agent to Chat Website", + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", + "LABELTEXT": "Label text" + } +} diff --git a/public/app/main/apps/contactmanager/i18n/bs.json b/public/app/main/apps/contactmanager/i18n/bs.json index b700161..f1dcd06 100644 --- a/public/app/main/apps/contactmanager/i18n/bs.json +++ b/public/app/main/apps/contactmanager/i18n/bs.json @@ -1,200 +1,200 @@ { "CONTACTMANAGER": { - "SELECT_TAG": "Select tags", - "CUSTOMER_JOURNEY": "Customer Journey", - "USERID": "Recall Agent ID", - "PRIORITY": "Priority", + "SELECT_TAG": "Odaberi Tagove", + "CUSTOMER_JOURNEY": "Putovanje Kupca", + "USERID": "Pozovi Specijalista ID", + "PRIORITY": "Prioritet", "MOTIONDIALER": "Motion Bull", - "IMPORT_CONTACTS": "Import Contacts", - "PREFIX": "Dial Prefix", + "IMPORT_CONTACTS": "Uvez Kontakte", + "PREFIX": "Prefix Biranja", "VOICEQUEUEID": "VoiceQueue ID", - "CAMPAIGNID": "Campaign ID", - "STATE": "State", - "NAME": "Name", - "LISTS": "Lists", - "UNIQUEID": "Unique Id", + "CAMPAIGNID": "Kampanja ID", + "STATE": "Država", + "NAME": "Ime", + "LISTS": "Liste", + "UNIQUEID": "Jedinstveni ID", "STATUS": "Status", - "STARTTIME": "Start Time", - "ENDTIME": "End Time", + "STARTTIME": "Vrijeme Početka", + "ENDTIME": "Vrijeme završetka", "MOTION_BULL": "Motion Bull", - "MOVE_DOWN": "Move down", - "MOVE_UP": "Move up", + "MOVE_DOWN": "Pomakni dole", + "MOVE_UP": "Pomakni gore", "HOPPER": "Hopper", "FINAL": "Hopper Final", "HISTORY": "Hopper History", - "SCHEDULEDAT": "Scheduled At", - "DIALTIMEZONE": "Dial Timezone", - "TIMEZONE": "Dial Timezone", - "SEARCH_FOR_ANYONE": "Search", - "EDIT_LIST": "Edit List", - "EDIT_HOPPER": "Edit Hopper", - "DELETE_LIST": "Delete List", - "DELETE_HOPPER": "Delete Hopper", - "RELOAD": "Reload", - "ADDITIONAL_PHONES": "Additional phones", - "NO_COMPANIES": "No Company", - "NO_AVAILABLE_ITEMS": "No Available Items", - "ADD": "Add", - "UPDATE_EXISTING_CONTACTS": "Update existing contacts", + "SCHEDULEDAT": "Zakazano U", + "DIALTIMEZONE": "Timezone Pozivanja", + "TIMEZONE": "Timezone Pozivanja", + "SEARCH_FOR_ANYONE": "Traži", + "EDIT_LIST": "Uredi Listu", + "EDIT_HOPPER": "Uredi Hopper", + "DELETE_LIST": "Izbriši Listu", + "DELETE_HOPPER": "Izbriši Hopper", + "RELOAD": "Ponovno učitavanje", + "ADDITIONAL_PHONES": "Dodatni telefoni", + "NO_COMPANIES": "Nema Kompanije", + "NO_AVAILABLE_ITEMS": "Nema Dostupnih Stavki", + "ADD": "Dodaj", + "UPDATE_EXISTING_CONTACTS": "Ažuriraj Postojeće Kontakte", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "FIRSTNAME_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "ALIAS_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "CLICKTOACTION_REQUIRED": "Mandatory field", - "ACTIONTYPE_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "PHONEBAR_API": "Check the MotionBar is running and the remote control switch for the agent is turned on" + "NAME_REQUIRED": "Obavezno polje", + "FIRSTNAME_REQUIRED": "Obavezno polje", + "PHONE_REQUIRED": "Obavezno polje", + "ALIAS_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "CLICKTOACTION_REQUIRED": "Obavezno polje", + "ACTIONTYPE_REQUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "Pogrešan format", + "PHONEBAR_API": "Provjeri da li je MotionBar aktivan, i da li je prekidač za daljinsko upravljanje uključen." }, - "DESCRIPTION": "Description", - "DISPOSITION": "Disposition", - "DISPOSITIONS": "Dispositions", - "VOICEDISPOSITIONS": "Voice Dispositions", - "NEW_VOICEDISPOSITION": "New Voice Disposition", - "CUSTOM_FIELDS": "Custom Fields", - "ADD_LIST": "Add List", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "COMPANIES": "Companies", - "EDIT_COMPANY": "Edit Company", - "DELETE_COMPANY": "Delete Company", - "PHONE": "Phone", - "EMAIL": "Email", - "ADD_COMPANY": "Add Company", - "CONTACTS": "Contacts", - "NEW_LIST": "New List", - "FIRSTNAME": "First Name", - "LASTNAME": "Last Name", - "LIST": "List", - "COMPANY": "Company", - "ADD_CONTACT": "Add Contact", - "EDIT_CONTACT": "Edit Contact", - "MERGE_CONTACT": "Merge Contact", - "DUPLICATE_CONTACT": "Duplicate Contact", - "DELETE_CONTACT": "Delete Contact", - "CREATED_AT": "Created At", - "SAVE": "Save", - "DETAIL": "Detail", - "PERSONAL_INFO": "Personal Info", - "MOBILE": "Mobile", + "DESCRIPTION": "Opis", + "DISPOSITION": "Dispozciija", + "DISPOSITIONS": "Dispozicije", + "VOICEDISPOSITIONS": "Voice Dispozicija", + "NEW_VOICEDISPOSITION": "Nova Voice Dispozicija", + "CUSTOM_FIELDS": "Prilagođena Polja", + "ADD_LIST": "Dodaj Listu", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "COMPANIES": "Kompanije", + "EDIT_COMPANY": "Uredi Kompaniju", + "DELETE_COMPANY": "Izbriši Kompaniju", + "PHONE": "Telefon", + "EMAIL": "E-mail", + "ADD_COMPANY": "Dodaj Kompaniju", + "CONTACTS": "Kontakti", + "NEW_LIST": "Nova Lista", + "FIRSTNAME": "Ime", + "LASTNAME": "Prezime", + "LIST": "Lista", + "COMPANY": "Kompanija", + "ADD_CONTACT": "Dodaj Kontakt", + "EDIT_CONTACT": "Uredi Kontakt", + "MERGE_CONTACT": "Spoji Kontakt", + "DUPLICATE_CONTACT": "Dupliciraj Kontakt", + "DELETE_CONTACT": "Izbriši Kontakt", + "CREATED_AT": "Kreirano U", + "SAVE": "Sačuvaj", + "DETAIL": "Detalji", + "PERSONAL_INFO": "Osobni Podaci", + "MOBILE": "Mobilni", "FAX": "Fax", - "TAGS": "Tags", - "SHOW_ALL_FIELDS": "Show all fields", - "FEWER_FIELDS": "Show less fields", - "COUNTRY": "Country", - "CITY": "City", - "STREET": "Street", - "POSTALCODE": "Postal Code", - "DELETE": "Delete", - "DELETE_ALL": "Delete All", - "CONTACTMANAGER": "Contacts Manager", - "ID": "Id", - "SETTINGS": "Settings", - "GENERAL": "General", - "CUSTOMFIELDS": "Custom Fields", - "NO_CUSTOMFIELD_AVAILABLE": "No Custom Fields available", - "ADD_TAG": "Add Tag", - "NO_TAG": "No Tags", - "ALIAS": "Alias", - "CLICKTOACTION": "Click to action", - "ACTIONTYPE": "Action type", - "TYPE": "Type", - "VALUE": "Value", - "ADD_CUSTOMFIELD": "Add Custom Field", - "EDIT_CUSTOMFIELD": "Edit Custom Field", - "DELETE_CUSTOMFIELD": "Delete Custom Field", - "NEW_COMPANY": "New Company", - "NEW_CONTACT": "New Contact", - "NEW_TAG": "New Tag", - "UPLOAD_CONTACTS": "Upload Contacts", - "FINISH": "Finish", - "SUCCESS": "Success", - "FAILURE": "Failure", - "ALL_CONTACTS": "All Contacts", - "NEW_CUSTOMFIELD": "New Custom Field", - "NO_VOICEDISPOSITION_AVAILABLE": "No Voice Dispositions available", - "ADD_VOICEDISPOSITION": "Add Voice Disposition", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", - "VAT": "VAT", - "COMPANYID": "Company ID", + "TAGS": "Tagovi", + "SHOW_ALL_FIELDS": "Prikaži sva polja", + "FEWER_FIELDS": "Prikaži manje polja", + "COUNTRY": "Država", + "CITY": "Grad", + "STREET": "Ulica", + "POSTALCODE": "Poštanski Broj", + "DELETE": "Izbriši", + "DELETE_ALL": "Izbriši Sve", + "CONTACTMANAGER": "Menadžer Kontakata", + "ID": "ID", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "CUSTOMFIELDS": "Prilagođena Polja", + "NO_CUSTOMFIELD_AVAILABLE": "Nema dostupnih Prilagođenih Polja", + "ADD_TAG": "Dodaj Tag", + "NO_TAG": "Bez Tagova", + "ALIAS": "Pseudonim", + "CLICKTOACTION": "Klikni za Radnju", + "ACTIONTYPE": "Tip Radnje", + "TYPE": "Tip", + "VALUE": "Vrijednost", + "ADD_CUSTOMFIELD": "Dodaj Prilagođeno Polje", + "EDIT_CUSTOMFIELD": "Uredi Prilagođeno Polje", + "DELETE_CUSTOMFIELD": "Izbriši Prilagođeno Polje", + "NEW_COMPANY": "Ime Kompanije", + "NEW_CONTACT": "Ime Kontakta", + "NEW_TAG": "Novi Tag", + "UPLOAD_CONTACTS": "Učitavanje Kontakata", + "FINISH": "Završi", + "SUCCESS": "Uspjeh", + "FAILURE": "Neuspjeh", + "ALL_CONTACTS": "Svi Kontakti", + "NEW_CUSTOMFIELD": "Novo Prilagođeno Polje", + "NO_VOICEDISPOSITION_AVAILABLE": "Nema dostupnih Voice Dispozicija", + "ADD_VOICEDISPOSITION": "Dodaj Voice Dispoziciju", + "EDIT_VOICEDISPOSITION": "Uredi Voice Dispoziciju", + "DELETE_VOICEDISPOSITION": "Izbriši Voice Dispoziciju", + "VAT": "PDV", + "COMPANYID": "Kompanija ID", "WEBSITE": "Website", - "EMAIL_DOMAIN": "Email Domain", - "ADDRESS": "Address", - "POSTAL_CODE": "Postal Code", - "SHIPMENTADDRESS": "Shipment Address", - "COPY_CONTACT": "Copy Contact", - "GOTOCONTACTS_LIST": "Show Contacts", - "GOTOCONTACTS_COMPANY": "Show Contacts", - "ADD_AGENT_TO_LIST": "Add Agent to List", - "AGENTADD_LIST": "Add Agents to List", - "NO_AVAILABLE_INFO": "No available info", - "NONE": "None", - "ALL": "All", - "FULLNAME": "Full Name", - "CHECK_DUPLICATES": "Check Duplicates", - "DUPLICATES": "Duplicates", - "UPLOAD_CSV": "Upload CSV", + "EMAIL_DOMAIN": "E-mail Domena", + "ADDRESS": "Adresa", + "POSTAL_CODE": "Poštanski Broj", + "SHIPMENTADDRESS": "Adresa Isporuke", + "COPY_CONTACT": "Kopiraj Kontakt", + "GOTOCONTACTS_LIST": "Prikaži Kontakte", + "GOTOCONTACTS_COMPANY": "Prikaži Kontakte", + "ADD_AGENT_TO_LIST": "Dodaj Specijalistu na Listu", + "AGENTADD_LIST": "Dodaj Specijaliste na Listu", + "NO_AVAILABLE_INFO": "Nema Dostupnih Informacija", + "NONE": "Ništa", + "ALL": "Svi", + "FULLNAME": "Puno Ime", + "CHECK_DUPLICATES": "Provjeri Duplikate", + "DUPLICATES": "Duplikati", + "UPLOAD_CSV": "Učitaj CSV", "TAG": "Tag", - "UPLOAD": "Upload", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "DATE_OF_BIRTH": "Birthdate", - "DATEOFBIRTH": "Birthdate", - "NOTES": "Notes", - "EXPORTCSVCONTACTS_LIST": "Export to CSV", - "GOTO_LIST": "Show Contacts", - "GOTO_COMPANY": "Show Contacts", - "REQUIRED": "Required", - "GLOBALCUSTOMFIELDS": "Global Custom Fields", - "NEW_GLOBALCUSTOMFIELD": "New Custom Fields", - "ADD_GLOBALCUSTOMFIELD": "Add Custom Field", - "EDIT_GLOBALCUSTOMFIELD": "Edit Custom Field", - "DELETE_GLOBALCUSTOMFIELD": "Delete Custom Field", + "UPLOAD": "Učitaj", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "DATE_OF_BIRTH": "Datum rođenja", + "DATEOFBIRTH": "Datum rođenja", + "NOTES": "Bilješke", + "EXPORTCSVCONTACTS_LIST": "Izvoz u CSV", + "GOTO_LIST": "Prikaži Kontakte", + "GOTO_COMPANY": "Prikaži Kontakte", + "REQUIRED": "Potrebno", + "GLOBALCUSTOMFIELDS": "Globalna Prilagođena Polja", + "NEW_GLOBALCUSTOMFIELD": "Nova Prilagođena Polja", + "ADD_GLOBALCUSTOMFIELD": "Dodaj Prilagođeno Polje", + "EDIT_GLOBALCUSTOMFIELD": "Uredi Prilagođeno Polje", + "DELETE_GLOBALCUSTOMFIELD": "Izbiri Prilagođeno Polje", "JSCRIPTY": "Jscripty", - "SESSIONS": "Sessions", - "AGENT": "Agent", - "PROJECT": "Project", - "SELECT_LIST": "Select a list", - "SELECT_COMPANY": "Select a company", - "SELECT_TAGS": "Select one or more tags", + "SESSIONS": "Sesije", + "AGENT": "Specijalist", + "PROJECT": "Projekat", + "SELECT_LIST": "Odaberi Listu", + "SELECT_COMPANY": "Odaberi Kompaniju", + "SELECT_TAGS": "Odaberi jedan ili više tagova", "HELP": { - "PHONEBAR_API_MESSAGE": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on", - "PHONEBAR_API": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on" + "PHONEBAR_API_MESSAGE": "Da bi omogućio click-to-call, ukucaj broj telefona i provjeri da li je prekidač za daljinsko upravljanje uključen", + "PHONEBAR_API": "Da bi omogućio click-to-call, ukucaj broj telefona i provjeri da li je prekidač za daljinsko upravljanje uključen" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "SOCIAL": "Social", - "ROW": "Row", - "EXPORT_ERRORS": "Export Errors", - "UPLOAD_COMPLETED": "Upload Completed", - "STOP": "Stop", - "SELECT_FILE": "Select File", - "BILLINGINFORMATION": "Billing Information", - "FLATDISCOUNT": "Company Discount", - "EUROPE": "Europe", - "ISOCODE": "ISO National Code", - "VATNUMBER_CF": "Codice Fiscale/VAT", - "PIVA": "VAT Number", - "SDICODE": "SDI Code", - "EXPIREDAY": "Expiration Days", - "INVOICEARTICLE": "Law Articles", - "PAYMENTMETHOD": "Payment Method", - "SOCIAL_CAPITAL": "Share Capital", - "COMPANY_FISCAL_TYPE": "Company Fiscal Type", - "RELATIONSHIP": "Relationship ...", - "RELATIONSHIPCOMPANY": " ... with", - "CREATE": "Create", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redovi po stranici", + "OF": "od", + "SOCIAL": "Društveni", + "ROW": "Red", + "EXPORT_ERRORS": "Izvoz Greška", + "UPLOAD_COMPLETED": "Učitavanje Završeno", + "STOP": "Stani", + "SELECT_FILE": "Odaberi Datoteku", + "BILLINGINFORMATION": "Naplatne Informacije", + "FLATDISCOUNT": "Popusti Kompanije", + "EUROPE": "Europa", + "ISOCODE": "ISO Nacionalna Šifra", + "VATNUMBER_CF": "Fiskalni Kod/PDV", + "PIVA": "PDV Broj", + "SDICODE": "SDI Šifra", + "EXPIREDAY": "Dani Isteka", + "INVOICEARTICLE": "Zakonski Članci", + "PAYMENTMETHOD": "Način Plaćanja", + "SOCIAL_CAPITAL": "Podijeli Kapital", + "COMPANY_FISCAL_TYPE": "Fiskalni Tip Kompanije", + "RELATIONSHIP": "Veza ...", + "RELATIONSHIPCOMPANY": "... sa", + "CREATE": "Kreiraj", "RECALLME": "Recall Me", "NOTIFICATIONS": { - "NO_DATA_ERROR": "Unable to retrieve any data", - "INTERACTION_OPEN_ERROR": "Unable to open the interaction", - "ACCOUNTS_GET_ERROR": "Unable to retrieve any {{channel}} account", - "JSCRIPTY_GET_ERROR": "Unable to retrieve any Jscripty project" + "NO_DATA_ERROR": "Nije moguće povući podatke", + "INTERACTION_OPEN_ERROR": "Nije moguće otvoriti interakciju", + "ACCOUNTS_GET_ERROR": "Nije moguće povući nijedan {{channel}} nalog", + "JSCRIPTY_GET_ERROR": "Nije moguće povući nijdan Jscripty projekat" } } } diff --git a/public/app/main/apps/contactmanager/i18n/cs.json b/public/app/main/apps/contactmanager/i18n/cs.json index f1945cc..d974f01 100644 --- a/public/app/main/apps/contactmanager/i18n/cs.json +++ b/public/app/main/apps/contactmanager/i18n/cs.json @@ -1,170 +1,170 @@ { "CONTACTMANAGER": { - "SELECT_TAG": "Select tags", - "CUSTOMER_JOURNEY": "Customer Journey", - "USERID": "Recall Agent ID", - "PRIORITY": "Priority", + "SELECT_TAG": "Vybrat značku", + "CUSTOMER_JOURNEY": "Historie zákazníka", + "USERID": "Připomenutí Agent ID", + "PRIORITY": "Priorita", "MOTIONDIALER": "Motion Bull", - "IMPORT_CONTACTS": "Import Contacts", - "PREFIX": "Dial Prefix", - "VOICEQUEUEID": "VoiceQueue ID", - "CAMPAIGNID": "Campaign ID", - "STATE": "State", - "NAME": "Name", - "LISTS": "Lists", - "UNIQUEID": "Unique Id", + "IMPORT_CONTACTS": "Importovat kontakty", + "PREFIX": "Prefix vytáčení", + "VOICEQUEUEID": "ID Hlasové fronty", + "CAMPAIGNID": "ID kampaně", + "STATE": "Stát", + "NAME": "Jméno", + "LISTS": "Seznamy", + "UNIQUEID": "Unikátní Id", "STATUS": "Status", - "STARTTIME": "Start Time", - "ENDTIME": "End Time", + "STARTTIME": "Čas začátku", + "ENDTIME": "Čas konce", "MOTION_BULL": "Motion Bull", "HOPPER": "Hopper", - "FINAL": "Hopper Final", - "HISTORY": "Hopper History", - "SCHEDULEDAT": "Scheduled At", - "SEARCH_FOR_ANYONE": "Search", - "EDIT_LIST": "Edit List", - "EDIT_HOPPER": "Edit Hopper", - "DELETE_LIST": "Delete List", - "DELETE_HOPPER": "Delete Hopper", - "RELOAD": "Reload", - "NO_COMPANIES": "No Company", - "NO_AVAILABLE_ITEMS": "No Available Items", - "ADD": "Add", + "FINAL": "Výsledný Hopper", + "HISTORY": "Historie Hopper", + "SCHEDULEDAT": "Naplánováno", + "SEARCH_FOR_ANYONE": "Vyhledat", + "EDIT_LIST": "Upravit seznam", + "EDIT_HOPPER": "Upravit Hopper", + "DELETE_LIST": "Samzat seznam", + "DELETE_HOPPER": "Smazat Hopper", + "RELOAD": "Obnovit", + "NO_COMPANIES": "Žádná společnost", + "NO_AVAILABLE_ITEMS": "Žádné položky", + "ADD": "Přidat", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "FIRSTNAME_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "ALIAS_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "PHONEBAR_API": "Check the MotionBar is running and the remote control switch for the agent is turned on", + "NAME_REQUIRED": "Povinné pole", + "FIRSTNAME_REQUIRED": "Povinné pole", + "PHONE_REQUIRED": "Povinné pole", + "ALIAS_REQUIRED": "Povinné pole", + "VALUE_REQUIRED": "Povinné pole", + "EMAIL_MUST_VALID": "Neplatný formát", + "PHONEBAR_API": "Zkontrolujte zda MotionBar je spuštěn a agent má zapnuto remote control", "ACTIONTYPE_REQUIRED": "Povinné pole", "CLICKTOACTION_REQUIRED": "Povinné pole" }, - "DESCRIPTION": "Description", - "DISPOSITION": "Disposition", - "DISPOSITIONS": "Dispositions", - "VOICEDISPOSITIONS": "Voice Dispositions", - "NEW_VOICEDISPOSITION": "New Voice Disposition", - "CUSTOM_FIELDS": "Custom Fields", - "ADD_LIST": "Add List", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "COMPANIES": "Companies", - "EDIT_COMPANY": "Edit Company", - "DELETE_COMPANY": "Delete Company", - "PHONE": "Phone", + "DESCRIPTION": "Popis", + "DISPOSITION": "Dispozice", + "DISPOSITIONS": "Dispozice", + "VOICEDISPOSITIONS": "Hlasové dispozice", + "NEW_VOICEDISPOSITION": "Nový dispoziční kód", + "CUSTOM_FIELDS": "Uživatelská pole", + "ADD_LIST": "Přidat seznam", + "BACK": "Zpět", + "SELECTED": "Vybráno", + "SELECT_ALL": "Vybrat vše", + "SELECT_NONE": "Zrušit výběr", + "COMPANIES": "Společnosti", + "EDIT_COMPANY": "Upravit společnost", + "DELETE_COMPANY": "Smazat společnost", + "PHONE": "Telefon", "EMAIL": "Email", - "ADD_COMPANY": "Add Company", - "CONTACTS": "Contacts", - "NEW_LIST": "New List", - "FIRSTNAME": "First Name", - "LASTNAME": "Last Name", - "LIST": "List", - "COMPANY": "Company", - "ADD_CONTACT": "Add Contact", - "EDIT_CONTACT": "Edit Contact", - "MERGE_CONTACT": "Merge Contact", - "DUPLICATE_CONTACT": "Duplicate Contact", - "DELETE_CONTACT": "Delete Contact", - "CREATED_AT": "Created At", - "SAVE": "Save", + "ADD_COMPANY": "Přidat společnost", + "CONTACTS": "Kontakty", + "NEW_LIST": "Nový seznam", + "FIRSTNAME": "Jméno", + "LASTNAME": "Příjmení", + "LIST": "Seznam", + "COMPANY": "Společnost", + "ADD_CONTACT": "Přidat kontakt", + "EDIT_CONTACT": "Upravit kontakt", + "MERGE_CONTACT": "Spojit kontakty", + "DUPLICATE_CONTACT": "Kopírovat kontakt", + "DELETE_CONTACT": "Smazat kontakt", + "CREATED_AT": "Vytvořeno", + "SAVE": "Uložit", "DETAIL": "Detail", - "PERSONAL_INFO": "Personal Info", - "MOBILE": "Mobile", + "PERSONAL_INFO": "Osobní Info", + "MOBILE": "Mobil", "FAX": "Fax", - "TAGS": "Tags", - "SHOW_ALL_FIELDS": "Show all fields", - "FEWER_FIELDS": "Show less fields", - "COUNTRY": "Country", - "CITY": "City", - "STREET": "Street", - "POSTALCODE": "Postal Code", - "DELETE": "Delete", - "DELETE_ALL": "Delete All", - "CONTACTMANAGER": "Contacts Manager", + "TAGS": "Značky", + "SHOW_ALL_FIELDS": "Zobrazit všechna pole", + "FEWER_FIELDS": "Zobrazit méně polí", + "COUNTRY": "Země", + "CITY": "Město", + "STREET": "Ulice", + "POSTALCODE": "Poštovní kód", + "DELETE": "Smazat", + "DELETE_ALL": "Smazat vše", + "CONTACTMANAGER": "Kontaktní Manager", "ID": "Id", - "SETTINGS": "Settings", - "GENERAL": "General", - "CUSTOMFIELDS": "Custom Fields", - "NO_CUSTOMFIELD_AVAILABLE": "No Custom Fields available", - "ADD_TAG": "Add Tag", - "NO_TAG": "No Tags", + "SETTINGS": "Nastavení", + "GENERAL": "Obecné", + "CUSTOMFIELDS": "Uživatelská pole", + "NO_CUSTOMFIELD_AVAILABLE": "Žádná uživatelská pole", + "ADD_TAG": "Přidat značku", + "NO_TAG": "Žádné značky", "ALIAS": "Alias", - "TYPE": "Type", - "VALUE": "Value", - "ADD_CUSTOMFIELD": "Add Custom Field", - "EDIT_CUSTOMFIELD": "Edit Custom Field", - "DELETE_CUSTOMFIELD": "Delete Custom Field", - "NEW_COMPANY": "New Company", - "NEW_CONTACT": "New Contact", - "NEW_TAG": "New Tag", - "UPLOAD_CONTACTS": "Upload Contacts", - "FINISH": "Finish", - "SUCCESS": "Success", - "FAILURE": "Failure", - "ALL_CONTACTS": "All Contacts", - "NEW_CUSTOMFIELD": "New Custom Field", - "NO_VOICEDISPOSITION_AVAILABLE": "No Voice Dispositions available", - "ADD_VOICEDISPOSITION": "Add Voice Disposition", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", - "VAT": "VAT", - "COMPANYID": "Company ID", - "WEBSITE": "Website", - "EMAIL_DOMAIN": "Email Domain", - "ADDRESS": "Address", - "POSTAL_CODE": "Postal Code", - "SHIPMENTADDRESS": "Shipment Address", - "COPY_CONTACT": "Copy Contact", - "GOTOCONTACTS_LIST": "Show Contacts", - "GOTOCONTACTS_COMPANY": "Show Contacts", - "ADD_AGENT_TO_LIST": "Add Agent to List", - "AGENTADD_LIST": "Add Agents to List", - "NO_AVAILABLE_INFO": "No available info", - "NONE": "None", - "FULLNAME": "Full Name", - "CHECK_DUPLICATES": "Check Duplicates", - "DUPLICATES": "Duplicates", - "UPLOAD_CSV": "Upload CSV", - "TAG": "Tag", - "UPLOAD": "Upload", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "DATE_OF_BIRTH": "Birthdate", - "DATEOFBIRTH": "Birthdate", - "NOTES": "Notes", - "EXPORTCSVCONTACTS_LIST": "Export to CSV", - "GOTO_LIST": "Show Contacts", - "GOTO_COMPANY": "Show Contacts", - "REQUIRED": "Required", - "GLOBALCUSTOMFIELDS": "Global Custom Fields", - "NEW_GLOBALCUSTOMFIELD": "New Custom Fields", - "ADD_GLOBALCUSTOMFIELD": "Add Custom Field", - "EDIT_GLOBALCUSTOMFIELD": "Edit Custom Field", - "DELETE_GLOBALCUSTOMFIELD": "Delete Custom Field", + "TYPE": "Typ", + "VALUE": "Hodnota", + "ADD_CUSTOMFIELD": "Přidat uživatelské pole", + "EDIT_CUSTOMFIELD": "Upravit uživatelské pole", + "DELETE_CUSTOMFIELD": "Smazat uživatelské pole", + "NEW_COMPANY": "Nová společnost", + "NEW_CONTACT": "Nový kontakt", + "NEW_TAG": "Nová značka", + "UPLOAD_CONTACTS": "Nahrát kontakty", + "FINISH": "Ukončneo", + "SUCCESS": "Úspěch", + "FAILURE": "Chyba", + "ALL_CONTACTS": "Všechny kontakty", + "NEW_CUSTOMFIELD": "Nové uživatelské pole", + "NO_VOICEDISPOSITION_AVAILABLE": "Žádný hlasový dispoziční kód", + "ADD_VOICEDISPOSITION": "Přidat hlasovou Dispozice", + "EDIT_VOICEDISPOSITION": "Upravit uživatelské pole", + "DELETE_VOICEDISPOSITION": "Smazat hlasovou dispozici", + "VAT": "DIČ", + "COMPANYID": "ID Společnosti", + "WEBSITE": "Webová stránka", + "EMAIL_DOMAIN": "Email doména", + "ADDRESS": "Adresa", + "POSTAL_CODE": "Poštovní kód", + "SHIPMENTADDRESS": "Dodací adresa", + "COPY_CONTACT": "Kopírovat kontakt", + "GOTOCONTACTS_LIST": "Zobrazit kontakty", + "GOTOCONTACTS_COMPANY": "Zobrazit kontakty", + "ADD_AGENT_TO_LIST": "Přidat agenta k seznamu", + "AGENTADD_LIST": "Přidat agenty k seznamu", + "NO_AVAILABLE_INFO": "Žádné informace", + "NONE": "žádné", + "FULLNAME": "Celé jméno", + "CHECK_DUPLICATES": "Kontrola duplicit", + "DUPLICATES": "Duplikovat", + "UPLOAD_CSV": "Nahrát CSV", + "TAG": "Značka", + "UPLOAD": "Nahrát", + "ALL_AGENTS": "Všichni agenti", + "SELECTED_AGENTS": "Vybraní agenti", + "DATE_OF_BIRTH": "Narozeniny", + "DATEOFBIRTH": "Narozeniny", + "NOTES": "Poznámky", + "EXPORTCSVCONTACTS_LIST": "Export do CSV", + "GOTO_LIST": "Zobrazit kontakty", + "GOTO_COMPANY": "Zobrazit kontakty", + "REQUIRED": "Vyžadováno", + "GLOBALCUSTOMFIELDS": "Obecné uživatelské pole", + "NEW_GLOBALCUSTOMFIELD": "Nová uživatelská pole", + "ADD_GLOBALCUSTOMFIELD": "Přidat uživatelské pole", + "EDIT_GLOBALCUSTOMFIELD": "Upravit uživatelské pole", + "DELETE_GLOBALCUSTOMFIELD": "Smazat uživatelské pole", "JSCRIPTY": "Jscripty", - "SESSIONS": "Sessions", + "SESSIONS": "Sezení", "AGENT": "Agent", - "PROJECT": "Project", - "SELECT_LIST": "Select a list", - "SELECT_COMPANY": "Select a company", - "SELECT_TAGS": "Select one or more tags", + "PROJECT": "Projekt", + "SELECT_LIST": "Vybrat seznam", + "SELECT_COMPANY": "Vybrat společnost", + "SELECT_TAGS": "Vybrat jednu nebo více značek", "HELP": { - "PHONEBAR_API_MESSAGE": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on", - "PHONEBAR_API": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on" + "PHONEBAR_API_MESSAGE": "Pro click-to-call funkci vložte telefonní číslo a porvěřte že Agent má povoleno remote control", + "PHONEBAR_API": "Pro click-to-call funkci vložte telefonní číslo a porvěřte že Agent má povoleno remote control" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", + "PAGE": "Strana", + "ROWSPERPAGE": "Řádek na stránku", + "OF": "z", "SOCIAL": "Social", - "ROW": "Row", - "EXPORT_ERRORS": "Export Errors", - "UPLOAD_COMPLETED": "Upload Completed", + "ROW": "Řádka", + "EXPORT_ERRORS": "Export chyby", + "UPLOAD_COMPLETED": "Nahrávání kompletní", "STOP": "Stop", - "SELECT_FILE": "Select File", + "SELECT_FILE": "Vybrat soubor", "ALL": "Všechno", "BILLINGINFORMATION": "Fakturační údaje", "COMPANY_FISCAL_TYPE": "Fiskální typ společnosti", @@ -181,7 +181,7 @@ "RELATIONSHIPCOMPANY": " ... s", "SDICODE": "Kód SDI", "SOCIAL_CAPITAL": "Základní kapitál", - "VATNUMBER_CF": "Codice Fiscale / DPH", + "VATNUMBER_CF": "DIČ", "ACTIONTYPE": "Typ akce", "CLICKTOACTION": "Klikněte na akci", "ADDITIONAL_PHONES": "Další telefony", diff --git a/public/app/main/apps/contactmanager/i18n/et.json b/public/app/main/apps/contactmanager/i18n/et.json index 494d629..4daf2c5 100644 --- a/public/app/main/apps/contactmanager/i18n/et.json +++ b/public/app/main/apps/contactmanager/i18n/et.json @@ -185,6 +185,10 @@ "ACTIONTYPE": "Toimingu tüüp", "CLICKTOACTION": "Klõpsake toimimiseks", "DIALTIMEZONE": "Vali ajavöönd", - "TIMEZONE": "Vali ajavöönd" + "TIMEZONE": "Vali ajavöönd", + "ADDITIONAL_PHONES": "Lisatelefonid", + "MOVE_DOWN": "Liigu alla", + "MOVE_UP": "Üles liikuma", + "UPDATE_EXISTING_CONTACTS": "Värskendage olemasolevaid kontakte" } } diff --git a/public/app/main/apps/contactmanager/i18n/is.json b/public/app/main/apps/contactmanager/i18n/is.json new file mode 100644 index 0000000..b700161 --- /dev/null +++ b/public/app/main/apps/contactmanager/i18n/is.json @@ -0,0 +1,200 @@ +{ + "CONTACTMANAGER": { + "SELECT_TAG": "Select tags", + "CUSTOMER_JOURNEY": "Customer Journey", + "USERID": "Recall Agent ID", + "PRIORITY": "Priority", + "MOTIONDIALER": "Motion Bull", + "IMPORT_CONTACTS": "Import Contacts", + "PREFIX": "Dial Prefix", + "VOICEQUEUEID": "VoiceQueue ID", + "CAMPAIGNID": "Campaign ID", + "STATE": "State", + "NAME": "Name", + "LISTS": "Lists", + "UNIQUEID": "Unique Id", + "STATUS": "Status", + "STARTTIME": "Start Time", + "ENDTIME": "End Time", + "MOTION_BULL": "Motion Bull", + "MOVE_DOWN": "Move down", + "MOVE_UP": "Move up", + "HOPPER": "Hopper", + "FINAL": "Hopper Final", + "HISTORY": "Hopper History", + "SCHEDULEDAT": "Scheduled At", + "DIALTIMEZONE": "Dial Timezone", + "TIMEZONE": "Dial Timezone", + "SEARCH_FOR_ANYONE": "Search", + "EDIT_LIST": "Edit List", + "EDIT_HOPPER": "Edit Hopper", + "DELETE_LIST": "Delete List", + "DELETE_HOPPER": "Delete Hopper", + "RELOAD": "Reload", + "ADDITIONAL_PHONES": "Additional phones", + "NO_COMPANIES": "No Company", + "NO_AVAILABLE_ITEMS": "No Available Items", + "ADD": "Add", + "UPDATE_EXISTING_CONTACTS": "Update existing contacts", + "ERRORS": { + "NAME_REQUIRED": "Mandatory field", + "FIRSTNAME_REQUIRED": "Mandatory field", + "PHONE_REQUIRED": "Mandatory field", + "ALIAS_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "CLICKTOACTION_REQUIRED": "Mandatory field", + "ACTIONTYPE_REQUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format", + "PHONEBAR_API": "Check the MotionBar is running and the remote control switch for the agent is turned on" + }, + "DESCRIPTION": "Description", + "DISPOSITION": "Disposition", + "DISPOSITIONS": "Dispositions", + "VOICEDISPOSITIONS": "Voice Dispositions", + "NEW_VOICEDISPOSITION": "New Voice Disposition", + "CUSTOM_FIELDS": "Custom Fields", + "ADD_LIST": "Add List", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "COMPANIES": "Companies", + "EDIT_COMPANY": "Edit Company", + "DELETE_COMPANY": "Delete Company", + "PHONE": "Phone", + "EMAIL": "Email", + "ADD_COMPANY": "Add Company", + "CONTACTS": "Contacts", + "NEW_LIST": "New List", + "FIRSTNAME": "First Name", + "LASTNAME": "Last Name", + "LIST": "List", + "COMPANY": "Company", + "ADD_CONTACT": "Add Contact", + "EDIT_CONTACT": "Edit Contact", + "MERGE_CONTACT": "Merge Contact", + "DUPLICATE_CONTACT": "Duplicate Contact", + "DELETE_CONTACT": "Delete Contact", + "CREATED_AT": "Created At", + "SAVE": "Save", + "DETAIL": "Detail", + "PERSONAL_INFO": "Personal Info", + "MOBILE": "Mobile", + "FAX": "Fax", + "TAGS": "Tags", + "SHOW_ALL_FIELDS": "Show all fields", + "FEWER_FIELDS": "Show less fields", + "COUNTRY": "Country", + "CITY": "City", + "STREET": "Street", + "POSTALCODE": "Postal Code", + "DELETE": "Delete", + "DELETE_ALL": "Delete All", + "CONTACTMANAGER": "Contacts Manager", + "ID": "Id", + "SETTINGS": "Settings", + "GENERAL": "General", + "CUSTOMFIELDS": "Custom Fields", + "NO_CUSTOMFIELD_AVAILABLE": "No Custom Fields available", + "ADD_TAG": "Add Tag", + "NO_TAG": "No Tags", + "ALIAS": "Alias", + "CLICKTOACTION": "Click to action", + "ACTIONTYPE": "Action type", + "TYPE": "Type", + "VALUE": "Value", + "ADD_CUSTOMFIELD": "Add Custom Field", + "EDIT_CUSTOMFIELD": "Edit Custom Field", + "DELETE_CUSTOMFIELD": "Delete Custom Field", + "NEW_COMPANY": "New Company", + "NEW_CONTACT": "New Contact", + "NEW_TAG": "New Tag", + "UPLOAD_CONTACTS": "Upload Contacts", + "FINISH": "Finish", + "SUCCESS": "Success", + "FAILURE": "Failure", + "ALL_CONTACTS": "All Contacts", + "NEW_CUSTOMFIELD": "New Custom Field", + "NO_VOICEDISPOSITION_AVAILABLE": "No Voice Dispositions available", + "ADD_VOICEDISPOSITION": "Add Voice Disposition", + "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", + "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", + "VAT": "VAT", + "COMPANYID": "Company ID", + "WEBSITE": "Website", + "EMAIL_DOMAIN": "Email Domain", + "ADDRESS": "Address", + "POSTAL_CODE": "Postal Code", + "SHIPMENTADDRESS": "Shipment Address", + "COPY_CONTACT": "Copy Contact", + "GOTOCONTACTS_LIST": "Show Contacts", + "GOTOCONTACTS_COMPANY": "Show Contacts", + "ADD_AGENT_TO_LIST": "Add Agent to List", + "AGENTADD_LIST": "Add Agents to List", + "NO_AVAILABLE_INFO": "No available info", + "NONE": "None", + "ALL": "All", + "FULLNAME": "Full Name", + "CHECK_DUPLICATES": "Check Duplicates", + "DUPLICATES": "Duplicates", + "UPLOAD_CSV": "Upload CSV", + "TAG": "Tag", + "UPLOAD": "Upload", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "DATE_OF_BIRTH": "Birthdate", + "DATEOFBIRTH": "Birthdate", + "NOTES": "Notes", + "EXPORTCSVCONTACTS_LIST": "Export to CSV", + "GOTO_LIST": "Show Contacts", + "GOTO_COMPANY": "Show Contacts", + "REQUIRED": "Required", + "GLOBALCUSTOMFIELDS": "Global Custom Fields", + "NEW_GLOBALCUSTOMFIELD": "New Custom Fields", + "ADD_GLOBALCUSTOMFIELD": "Add Custom Field", + "EDIT_GLOBALCUSTOMFIELD": "Edit Custom Field", + "DELETE_GLOBALCUSTOMFIELD": "Delete Custom Field", + "JSCRIPTY": "Jscripty", + "SESSIONS": "Sessions", + "AGENT": "Agent", + "PROJECT": "Project", + "SELECT_LIST": "Select a list", + "SELECT_COMPANY": "Select a company", + "SELECT_TAGS": "Select one or more tags", + "HELP": { + "PHONEBAR_API_MESSAGE": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on", + "PHONEBAR_API": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on" + }, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "SOCIAL": "Social", + "ROW": "Row", + "EXPORT_ERRORS": "Export Errors", + "UPLOAD_COMPLETED": "Upload Completed", + "STOP": "Stop", + "SELECT_FILE": "Select File", + "BILLINGINFORMATION": "Billing Information", + "FLATDISCOUNT": "Company Discount", + "EUROPE": "Europe", + "ISOCODE": "ISO National Code", + "VATNUMBER_CF": "Codice Fiscale/VAT", + "PIVA": "VAT Number", + "SDICODE": "SDI Code", + "EXPIREDAY": "Expiration Days", + "INVOICEARTICLE": "Law Articles", + "PAYMENTMETHOD": "Payment Method", + "SOCIAL_CAPITAL": "Share Capital", + "COMPANY_FISCAL_TYPE": "Company Fiscal Type", + "RELATIONSHIP": "Relationship ...", + "RELATIONSHIPCOMPANY": " ... with", + "CREATE": "Create", + "RECALLME": "Recall Me", + "NOTIFICATIONS": { + "NO_DATA_ERROR": "Unable to retrieve any data", + "INTERACTION_OPEN_ERROR": "Unable to open the interaction", + "ACCOUNTS_GET_ERROR": "Unable to retrieve any {{channel}} account", + "JSCRIPTY_GET_ERROR": "Unable to retrieve any Jscripty project" + } + } +} diff --git a/public/app/main/apps/contactmanager/i18n/pt-BR.json b/public/app/main/apps/contactmanager/i18n/pt-BR.json index df501db..8dae8b1 100644 --- a/public/app/main/apps/contactmanager/i18n/pt-BR.json +++ b/public/app/main/apps/contactmanager/i18n/pt-BR.json @@ -2,7 +2,7 @@ "CONTACTMANAGER": { "SELECT_TAG": "Selecione Tags", "CUSTOMER_JOURNEY": "Jornada do Cliente", - "USERID": "Lembrar ID do Agente", + "USERID": "Recall Agent ID", "PRIORITY": "Prioridade", "MOTIONDIALER": "Motion Bull", "IMPORT_CONTACTS": "Importar Contatos", @@ -18,8 +18,8 @@ "ENDTIME": "Fim", "MOTION_BULL": "Motion Bull", "HOPPER": "Funil", - "FINAL": "Final do Funil", - "HISTORY": "Histórico do Funil", + "FINAL": "Final", + "HISTORY": "Histórico", "SCHEDULEDAT": "Agendado em", "SEARCH_FOR_ANYONE": "Procurar", "EDIT_LIST": "Editar Lista", @@ -37,7 +37,7 @@ "ALIAS_REQUIRED": "Campo obrigatório", "VALUE_REQUIRED": "Campo obrigatório", "EMAIL_MUST_VALID": "Formato incorreto", - "PHONEBAR_API": "Verifique se o MotionBar está em execução e se o interruptor do controle remoto do agente está ligado", + "PHONEBAR_API": "Verifique se o MotionBar está em execução e se foi ativado o controle remoto.", "ACTIONTYPE_REQUIRED": "Campo obrigatório", "CLICKTOACTION_REQUIRED": "Campo obrigatório" }, @@ -84,7 +84,7 @@ "POSTALCODE": "CEP", "DELETE": "Excluir", "DELETE_ALL": "Excluir Tudo", - "CONTACTMANAGER": "Mailing", + "CONTACTMANAGER": "Gestor Contatos", "ID": "Id", "SETTINGS": "Configurações", "GENERAL": "Geral", @@ -101,12 +101,12 @@ "NEW_COMPANY": "Nova Empresa", "NEW_CONTACT": "Novo Contato", "NEW_TAG": "Nova Tag", - "UPLOAD_CONTACTS": "Atualizar Contatos", + "UPLOAD_CONTACTS": "Upload Contatos", "FINISH": "Terminar", "SUCCESS": "Sucesso", "FAILURE": "Falha", "ALL_CONTACTS": "Todos os Contatos", - "NEW_CUSTOMFIELD": "Novo campo Personalizado", + "NEW_CUSTOMFIELD": "Novo Campo Personalizado", "NO_VOICEDISPOSITION_AVAILABLE": "Nenhuma Disposição de Voz Disponível", "ADD_VOICEDISPOSITION": "Adicionar Disposição de Voz", "EDIT_VOICEDISPOSITION": "Editar Disposição de Voz", @@ -128,7 +128,7 @@ "FULLNAME": "Nome Completo", "CHECK_DUPLICATES": "Verificar Duplicados", "DUPLICATES": "Duplicados", - "UPLOAD_CSV": "Envio CSV", + "UPLOAD_CSV": "Upload CSV", "TAG": "Tag", "UPLOAD": "Envio", "ALL_AGENTS": "Todos os Agentes", @@ -153,8 +153,8 @@ "SELECT_COMPANY": "Selecione Empresa", "SELECT_TAGS": "Selecione uma ou mais Tags", "HELP": { - "PHONEBAR_API_MESSAGE": "Para ativar o recurso clique para ligar, insira um número de telefone e verifique se a chave de controle remoto do agente está ativada", - "PHONEBAR_API": "Para ativar o recurso clique para ligar, insira um número de telefone e verifique se a chave de controle remoto do agente está ativada" + "PHONEBAR_API_MESSAGE": "Para habilitar click-to-call, insira o telefone e verifique se o controle remoto esta ativo.", + "PHONEBAR_API": "Para habilitar click-to-call, insira o telefone e verifique se o controle remoto esta ativo." }, "PAGE": "Página", "ROWSPERPAGE": "Linhas por Página", @@ -166,29 +166,29 @@ "STOP": "Pare", "SELECT_FILE": "Selecione o Arquivo", "ALL": "Tudo", - "BILLINGINFORMATION": "Informações de pagamento", + "BILLINGINFORMATION": "Informações de Pagamento", "COMPANY_FISCAL_TYPE": "Tipo Fiscal da Empresa", "CREATE": "Crio", "EUROPE": "Europa", "EXPIREDAY": "Dias de Vencimento", - "FLATDISCOUNT": "Desconto da empresa", - "INVOICEARTICLE": "Artigos de Direito", - "ISOCODE": "Código Nacional ISO", + "FLATDISCOUNT": "Desconto da Empresa", + "INVOICEARTICLE": "Law Articles", + "ISOCODE": "Código ISO", "PAYMENTMETHOD": "Forma de pagamento", "PIVA": "Número de IVA", "RELATIONSHIP": "Relacionamento ...", "RELATIONSHIPCOMPANY": " ... com", "SDICODE": "Código SDI", - "SOCIAL_CAPITAL": "Capital social", - "VATNUMBER_CF": "Codice Fiscale / IVA", + "SOCIAL_CAPITAL": "Capital Social", + "VATNUMBER_CF": "Código Fiscal / IVA", "RECALLME": "Lembre-me", - "ACTIONTYPE": "Tipo de acão", - "CLICKTOACTION": "Clique para ação", - "ADDITIONAL_PHONES": "Telefones adicionais", - "UPDATE_EXISTING_CONTACTS": "Atualizar contatos existentes", + "ACTIONTYPE": "Tipo de Acão", + "CLICKTOACTION": "Clique para Ação", + "ADDITIONAL_PHONES": "Telefones Adicionais", + "UPDATE_EXISTING_CONTACTS": "Atualizar Contatos Existentes", "DIALTIMEZONE": "Disque fuso horário", - "TIMEZONE": "Disque fuso horário", - "MOVE_DOWN": "Mover para baixo", - "MOVE_UP": "Subir" + "TIMEZONE": "Fuso Horário", + "MOVE_DOWN": "Mover para Baixo", + "MOVE_UP": "Mover para Cima" } } diff --git a/public/app/main/apps/dashboards/i18n/ar.json b/public/app/main/apps/dashboards/i18n/ar.json index b372a50..dd64bf1 100644 --- a/public/app/main/apps/dashboards/i18n/ar.json +++ b/public/app/main/apps/dashboards/i18n/ar.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "هاتف الاتصال", "RECALLME_CALL_REMINDER": "تذكرني مكالمة تذكير", "SCHEDULED_TIME": "جدول زمني", - "UPCOMING_RECALLME_CALL": "القادمة تذكرني المكالمة" + "UPCOMING_RECALLME_CALL": "القادمة تذكرني المكالمة", + "WAITING_CALLS": "انتظار المكالمات", + "WAITING_INTERACTIONS": "انتظار التفاعلات" } } diff --git a/public/app/main/apps/dashboards/i18n/bs.json b/public/app/main/apps/dashboards/i18n/bs.json index 3169c3f..35e22cc 100644 --- a/public/app/main/apps/dashboards/i18n/bs.json +++ b/public/app/main/apps/dashboards/i18n/bs.json @@ -1,594 +1,596 @@ { "DASHBOARDS": { - "VISIBILITY": "Visibility", - "PUBLIC": "Public", - "PRIVATE": "Private", - "PUBLIC_INTERACTION": "The interaction is public", - "LOST_CONNECTION": "Experiencing network connectivity issues. Please check your internet connection.", - "SCHEDULED_CALLS": "Scheduled Calls", - "DOWNLOAD": "Download", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", - "UNMANAGED_RATE": "Unmanaged Rate", - "UPCOMING_RECALLME_CALL": "Upcoming Recall Me call", - "RECALLME_CALL_REMINDER": "Recall Me call reminder", - "CONTACT_NAME": "Contact Name", - "CONTACT_PHONE": "Contact Phone", - "SCHEDULED_TIME": "Scheduled time", - "LIST_NAME": "List name", - "UNMANAGED_RATE_TEXT": "Interactions Unmanaged Rate", - "VOICE_WAITING": "WAITING", - "VOICE_WAITING_TEXT": "WAITING QUEUE CALLS", - "VOICE_TALKING": "TALKING", - "VOICE_TALKING_TEXT": "ACTIVE QUEUE CALLS", - "VOICE_ANSWERED": "ANSWERED", - "VOICE_ANSWERED_TEXT": "ANSWERED QUEUE CALLS", - "VOICE_ABANDONED": "ABANDONED", - "VOICE_ABANDONED_TEXT": "ABANDONED QUEUE CALLS", - "VOICE_TOTAL_OFFERED": "TOTAL OFFERED", - "VOICE_TOTAL_OFFERED_TEXT": "TOTAL QUEUE CALLS", - "TODAY_INTERACTIONS_STATS": "Interactions Daily Stats", - "DIAL_TIMEZONE": "Dial timezone", - "VOICE_AVG_HOLD_TIME": "AVERAGE HOLD TIME", - "VOICE_AVG_HOLD_TIME_TEXT": "QUEUE CALLS AVG HOLD TIME", - "VOICE_AVG_TALK_TIME": "AVERAGE TALK TIME", - "VOICE_AVG_TALK_TIME_TEXT": "QUEUE CALLS TALK TIME", - "VOICE_ANSWER_RATE": "ANSWER RATE", - "VOICE_ANSWER_RATE_TEXT": "QUEUE CALLS ANSWER RATE", - "VOICE_ABANDON_RATE": "ABANDON RATE", - "VOICE_ABANDON_RATE_TEXT": "QUEUE CALLS ABANDON RATE", - "VOICE_UNMANAGED": "UNMANAGED", - "VOICE_UNMANAGED_TEXT": "UNMANAGED QUEUE CALLS", - "OPENED_TEXT": "Opened Interactions", - "MANAGED": "Managed", - "MANAGED_TEXT": "Managed Interactions", - "ABANDONED": "Abandoned", - "ABANDONED_TEXT": "Abandoned Interactions", - "ABANDONED_RATE": "Abandoned Rate", - "ABANDONED_RATE_TEXT": "Interactions Abandon Rate", - "SYSTEM_TIME": "System time", - "TOTAL_OFFERED": "Total Offered", - "TOTAL_OFFERED_TEXT": "Offered Interactions", - "AVG_HOLD_TIME_TEXT": "Interactions AVG Hold Time", - "MANAGED_RATE": "Managed Rate", - "MANAGED_RATE_TEXT": "Interactions Managed Rate ", - "AVG_MANAGED_TIME": "AVG Management Time", - "AVG_MANAGED_TIME_TEXT": "Interactions AVG Management Time", - "NO_DISPOSITION_SET": "No disposition set", - "AGENTS": "Agents", - "TRANSFER": "Transfer", - "NO_DATA_AVAILABLE": "No data available", - "CUSTOMER_JOURNEY": "Customer Journey", - "ME": "Me", - "CURRENTLY_IN_USE_BY": "Currently in use by", - "NOTAVAILABLE": "Not available", - "CLICKRELOAD": "New abandoned calls! Reload please", - "ASSIGNTO": "Assign to", - "SELECT_QUEUE": "Select Queue", - "SELECT_CAMPAIGN": "Select Queue", - "FREE": "Free", - "RESERVED": "Reserved", - "QUEUECALLEREXITREASON": "Reason", - "QUEUECALLEREXITAT": "Dropped", - "LASTASSIGNEDTO": "Last Assigned To", - "ABANDONEDQUEUECALLS": "Abandoned Queue Calls", - "ABANDONAT": "Abandoned", + "VISIBILITY": "Vidljivost", + "PUBLIC": "Javno", + "PRIVATE": "Privatno", + "PUBLIC_INTERACTION": "Interakcija je javna", + "LOST_CONNECTION": "Problemi sa mrežnim povezivanjem. Provjerite svoju internet vezu.", + "SCHEDULED_CALLS": "Zakazani Pozivi", + "DOWNLOAD": "Preuzmi", + "DOWNLOAD_WITH_ATTACHMENTS": "Preuzmi sa prilozima", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Preuzmi bez priloga", + "UNMANAGED_RATE": "Stopa Neupravljanih", + "UPCOMING_RECALLME_CALL": "Predstojeći Recall Me poziv", + "RECALLME_CALL_REMINDER": "Recall Me podsjetnik za poziv", + "CONTACT_NAME": "Kontakt Ime", + "CONTACT_PHONE": "Kontakt Telefon", + "SCHEDULED_TIME": "Zakazano Vrijeme", + "LIST_NAME": "Naziv Liste", + "UNMANAGED_RATE_TEXT": "Stopa Neupravjanih Interakcija", + "VOICE_WAITING": "ČEKA", + "VOICE_WAITING_TEXT": "QUEUE POZIVI NA ČEKANJU", + "VOICE_TALKING": "RAZGOVARA", + "VOICE_TALKING_TEXT": "AKTIVNI QUEUE POZIVI", + "VOICE_ANSWERED": "ODGOVRENI", + "VOICE_ANSWERED_TEXT": "ODGOVORENI QUEUE POZIVI", + "VOICE_ABANDONED": "NAPUŠTENI", + "VOICE_ABANDONED_TEXT": "NAPUŠTENI QUEUE POZIVI", + "VOICE_TOTAL_OFFERED": "UKUPNO PONUĐENO", + "VOICE_TOTAL_OFFERED_TEXT": "UKUPNO QUEUE POZIVA", + "TODAY_INTERACTIONS_STATS": "Interakcije Dnevna Statistika", + "DIAL_TIMEZONE": "Vremenska Zona Biranja", + "VOICE_AVG_HOLD_TIME": "PROSJEČNO VRIJEME ČEKANJA", + "VOICE_AVG_HOLD_TIME_TEXT": "PROSJEČNO VRIJEME ČEKANJA QUEUE POZIVA", + "VOICE_AVG_TALK_TIME": "PROSJEČNO VRIJEME RAZGOVORA", + "VOICE_AVG_TALK_TIME_TEXT": "VRIJEME RAZGOVORA QUEUE POZIVA", + "VOICE_ANSWER_RATE": "STOPA ODGOVORENIH", + "VOICE_ANSWER_RATE_TEXT": "STOPA ODGOVORENIH QUEUE POZIVA", + "VOICE_ABANDON_RATE": "STOPA NAPUŠTENIH", + "VOICE_ABANDON_RATE_TEXT": "STOPA NAPUŠTENIH QUEUE POZIVA", + "VOICE_UNMANAGED": "NEUPRAVLJANO", + "VOICE_UNMANAGED_TEXT": "NEUPRAVLJANI QUEUE POZIVI", + "OPENED_TEXT": "Otvorene Interakcije", + "MANAGED": "Obrađeno", + "MANAGED_TEXT": "Obrađene Interakcije", + "ABANDONED": "Napušteno", + "ABANDONED_TEXT": "Napuštene Interakcije", + "ABANDONED_RATE": "Stopa Napuštenih", + "ABANDONED_RATE_TEXT": "Stopa Napuštenih Interakcija", + "SYSTEM_TIME": "Sistem vrijeme", + "TOTAL_OFFERED": "Ukupno Ponuđeno", + "TOTAL_OFFERED_TEXT": "Ponuđenih Interakcija", + "AVG_HOLD_TIME_TEXT": "Interakcije Prosječno Vrijeme Čekanja", + "MANAGED_RATE": "Stopa Obrađenih", + "MANAGED_RATE_TEXT": "Stopa Obrađenih Interakcija", + "AVG_MANAGED_TIME": "Prosječno Vrijeme Obrade", + "AVG_MANAGED_TIME_TEXT": "Interakcije Prosječno Vrijeme Čekanja", + "NO_DISPOSITION_SET": "Nije postavljena dispozicija", + "AGENTS": "Specijalisti", + "TRANSFER": "Prijenos", + "NO_DATA_AVAILABLE": "Nema dostupnih podataka", + "CUSTOMER_JOURNEY": "Putovanje Kupca", + "ME": "Ja", + "CURRENTLY_IN_USE_BY": "Trenutno u upotrebi od", + "NOTAVAILABLE": "Nije dostupno", + "CLICKRELOAD": "Novi napušteni pozivi! Učitaj ponovo", + "ASSIGNTO": "Dodijeli", + "SELECT_QUEUE": "Odaberi Queue", + "SELECT_CAMPAIGN": "Odaberi Queue", + "FREE": "Slobodno", + "RESERVED": "Rezervisano", + "QUEUECALLEREXITREASON": "Razlog", + "QUEUECALLEREXITAT": "Ispušteno", + "LASTASSIGNEDTO": "Posljednje Dodijeljeno", + "ABANDONEDQUEUECALLS": "Napušteni Queue Pozivi", + "ABANDONAT": "Napušteno", "QUEUE": "Queue", - "SELECT_SUBSTATUS": "Select Substatus", - "READ": "Read", - "UNREAD": "Unread", - "SELECT_READ_UNREAD": "Select Read/Unread", - "SELECT_AGENT": "Select Agent", - "MARK_AS_UNREAD": "Mark as unread", - "FILTER_VOICE_QUEUES": "Filter Voice Queues", - "FILTER_CHAT_WEBSITES": "Filter Chat Websites", - "FILTER_SMS_ACCOUNTS": "Filter Sms Accounts", - "FILTER_FAX_ACCOUNTS": "Filter Fax Accounts", - "FILTER_OPENCHANNEL_ACCOUNTS": "Filter Openchannel Accounts", - "FILTER_MAIL_ACCOUNTS": "Filter Mail Accounts", - "FILTER_WHATSAPP_ACCOUNTS": "Filter Whatsapp Accounts", - "SETFILTERS": "Set Filters", - "FILTERS": "Filters", - "CONFIRM": "Confirm", - "CHANNEL_WAITING_TEXT": "Waiting Queue Interactions", + "SELECT_SUBSTATUS": "Odaberi Podstatus", + "READ": "Pročitajte", + "UNREAD": "Nepročitano", + "SELECT_READ_UNREAD": "Odaberi Pročitano/Nepročitano", + "SELECT_AGENT": "Odaberi Specijalistu", + "MARK_AS_UNREAD": "Označi kao nepročitano", + "FILTER_VOICE_QUEUES": "Filtriraj Voice Queues", + "FILTER_CHAT_WEBSITES": "Filtriraj Chat Websites", + "FILTER_SMS_ACCOUNTS": "Filtriraj SMS RačuneNaloge", + "FILTER_FAX_ACCOUNTS": "Filtriraj Fax Naloge", + "FILTER_OPENCHANNEL_ACCOUNTS": "Filtriraj Otvoreni kanal Naloge", + "FILTER_MAIL_ACCOUNTS": "Filtriraj Mail Račune", + "FILTER_WHATSAPP_ACCOUNTS": "Filtriraj Whatsapp Naloge", + "SETFILTERS": "Postafi Filtere", + "FILTERS": "Filteri", + "CONFIRM": "Potvrdi", + "CHANNEL_WAITING_TEXT": "Waiting Queue Interakcija", "CHANNEL_QUEUE": "Queue", - "CHANNEL_FROM": "From", - "LOADING_INTERACTION": "We are loading the interaction...", - "JANUARY": "January", - "FEBRUARY": "February", - "MARCH": "March", + "CHANNEL_FROM": "Od", + "LOADING_INTERACTION": "Učitavamo interakciju...", + "JANUARY": "Januar", + "FEBRUARY": "Februar", + "MARCH": "Mart", "APRIL": "April", - "MAY": "May", - "JUNE": "June", - "JULY": "July", + "MAY": "Maj", + "JUNE": "Juni", + "JULY": "Juli", "AUGUST": "August", - "SEPTEMBER": "September", - "OCTOBER": "October", - "NOVEMBER": "November", - "DECEMBER": "December", - "MON": "Mon", - "TUE": "Tue", - "WED": "Wed", - "THU": "Thu", - "FRI": "Fri", - "SAT": "Sat", - "SUN": "Sun", - "DELETE": "Delete", - "LAST_3_DAYS": "Last 3 Day", - "LAST_YEAR": "Last Year", - "THIS_YEAR": "This Year", - "LAST_MONTH": "Last Month", - "THIS_MONTH": "This Month", - "LAST_WEEK": "Last Week", - "THIS_WEEK": "This Week", - "YESTERDAY": "Yesterday", - "TODAY": "Today", - "SELECT_DATE": "Select Start Date", + "SEPTEMBER": "Septembar", + "OCTOBER": "Oktobar", + "NOVEMBER": "Novembar", + "DECEMBER": "Decembar", + "MON": "Pon", + "TUE": "Uto", + "WED": "Sri", + "THU": "Čet", + "FRI": "Pet", + "SAT": "Sub", + "SUN": "Ned", + "DELETE": "Ibriši", + "LAST_3_DAYS": "Zadnja 3 Dana", + "LAST_YEAR": "Zadnja Godina", + "THIS_YEAR": "Ova Godina", + "LAST_MONTH": "Zadnji Mjesec ", + "THIS_MONTH": "Ovaj Mjesec", + "LAST_WEEK": "Zadnja Sedmica", + "THIS_WEEK": "Ova Sedmica", + "YESTERDAY": "Juče", + "TODAY": "Danas", + "SELECT_DATE": "Odaberi Datum Početka", "HOME": "Home", - "SET_AS": "Set As", - "PENDING": "Pending", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", - "TAGS": "Tags", - "SELECT_TAG": "Select Tag", - "TYPE": "Type", - "SOURCE": "Source", - "DESTINATION": "Destination", - "CALLERID": "Caller ID", - "END_AT": "End At", - "DURATION": "Duration", + "SET_AS": "Postavo Kao", + "PENDING": "Na čekanju", + "CANNED_ANSWER_NOT_FOUND": "Nisu pronađeni Pripremljeni Odgovori", + "CANNED_ANSWER_SEARCH": "Unesi tekst za pretraživanje Pripremljenih Odgovora", + "TAGS": "Tag-ovi", + "SELECT_TAG": "Odaberi Tag", + "TYPE": "Vrsta", + "SOURCE": "Izvor", + "DESTINATION": "Destinacija", + "CALLERID": "Pozivatelj ID", + "END_AT": "Završi Sa", + "DURATION": "Trajanje", "CHAT": "Chat", - "MAIL": "Email", - "SMS": "Sms", - "OPENCHANNEL": "Open Channel", + "MAIL": "E-mail", + "SMS": "SMS", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", - "NOT_ASSIGNED": "Not Assigned", - "UNKNOWN": "Unknown", - "SELECT_USER": "Select User", - "LAST_MESSAGE": "Last message", - "USER": "User", - "RATING": "Rating", - "FEEDBACK": "Feedback", - "SUBJECT": "Subject", - "CUSTOMER_IP": "Originating IP Address", - "REFERER": "Referer", - "ACCOUNT": "Account", + "NOT_ASSIGNED": "Nije Dodijeljeno", + "UNKNOWN": "Nepoznato", + "SELECT_USER": "Odaberi Korisnika", + "LAST_MESSAGE": "Zadnja Poruka", + "USER": "Korisnik", + "RATING": "Ocjena", + "FEEDBACK": "Povratne informacije", + "SUBJECT": "Predmet", + "CUSTOMER_IP": "Izvorna IP Adresa", + "REFERER": "Referent", + "ACCOUNT": "Nalog", "WEBSITE": "Website", - "AGENT": "Agent", - "CREATED_AT": "Created At", - "CLOSED_AT": "Closed At", - "DISPOSITION": "Disposition", - "CONTACT": "Contact", - "INTERACTION": "Interaction", - "BROWSER_NAME": "Browser Name", - "BROWSER_VERSION": "Browser Version", - "OS_NAME": "Operating System Name", - "OS_VERSION": "Operating System Version", - "DEVICE_MODEL": "Device Model", - "DEVICE_VENDOR": "Device Vendor", - "DEVICE_TYPE": "Device Type", - "RECALLME": "Recall Me", - "DROP_RATE": "Drop Rate", - "DROPPED": "Dropped", - "DROPPED_TEXT": "Dropped Queue Calls", - "DETAIL": "Detail", + "AGENT": "Specijalist", + "CREATED_AT": "Stvoreno U", + "CLOSED_AT": "Zatvoreno U", + "DISPOSITION": "Dispozicija", + "CONTACT": "Kontakt", + "INTERACTION": "Interakcija", + "BROWSER_NAME": "Naziv Pretraživača", + "BROWSER_VERSION": "Verzija Pretraživača", + "OS_NAME": "Naziv Operativnog Sistema", + "OS_VERSION": "Verzija Operativnog Sistema", + "DEVICE_MODEL": "Model Uređaja", + "DEVICE_VENDOR": "Prodavač Uređaja", + "DEVICE_TYPE": "Tip Uređaja", + "RECALLME": "Recall me", + "DROP_RATE": "Stopa Prekinutih", + "DROPPED": "Prekinut", + "DROPPED_TEXT": "Prekinuti Queue Pozivi", + "DETAIL": "Detalj", "MOTION_BULL": "Motion Bull", - "LIMITED": "Limited", - "LIMITED_TEXT": "IVR Campaigns Calls Originated/Limit", - "DASHBOARDS": "Dashboards", - "RECORDINGS": "Recordings", - "TODAY_MOTION_BULL_STATS": "Queue Campaigns Daily Stats", - "ORIGINATED": "Originated", - "ORIGINATED_TEXT": "Queue Calls Originated", - "UPDATE": "Update", - "MORE": "More", + "LIMITED": "Ograničeno", + "LIMITED_TEXT": "IVR Pozivi Kampanje Izazvani/Limit", + "DASHBOARDS": "Nadzorne ploče", + "RECORDINGS": "Snimci", + "TODAY_MOTION_BULL_STATS": "Motion Bull Dnevna Statistika", + "ORIGINATED": "Porijeklo", + "ORIGINATED_TEXT": "Porijeklo Queue Poziva", + "UPDATE": "Ažuriraj", + "MORE": "Više", "MOTIONDIALER": "Motion Bull", - "DISPOSE": "Dispose", + "DISPOSE": "Odložiti", "QUEUES": "Queues", - "DIALER_CALL": "Dialer Call", - "ELAPSED_TIME": "Elapsed Time", - "EDIT": "Edit", - "MERGE": "Merge", - "DUPLICATE": "Duplicate", - "UNIQUEID": "Uniqueid", - "AUTOCLOSE": "Automatically close contact tab after disposal", - "CAMPAIGN": "Campaign", - "NONE": "None", - "NAME": "Name", - "ANSWER_MACHINE": "Answer Machine", - "INTERESTED": "Interested", - "NOT_INTERESTED": "Not Interested", - "PERSONAL_INFO": "Personal Info", - "SOLD": "Sold", - "SPECIAL": "Special", + "DIALER_CALL": "Poziv Birača", + "ELAPSED_TIME": "Proteklo Vrijeme", + "EDIT": "Uredi", + "MERGE": "Spoji", + "DUPLICATE": "Duplikat", + "UNIQUEID": "Jedinstveni ID", + "AUTOCLOSE": "Automatski zatvori kontakt tab nakon dispozicije", + "CAMPAIGN": "Kampanja", + "NONE": "Ništa", + "NAME": "Ime", + "ANSWER_MACHINE": "Telefonska Sekretarica", + "INTERESTED": "Zainteresovan", + "NOT_INTERESTED": "Nezainteresovan", + "PERSONAL_INFO": "Lični Podaci", + "SOLD": "Prodato", + "SPECIAL": "Specijalno", "BLACKLIST": "Blacklist", - "RESCHEDULE": "Reschedule", - "FIRSTNAME": "Firstname", - "LASTNAME": "Lastname", - "MOBILE": "Mobile", - "DATE_OF_BIRTH": "Birthdate", - "COMPANY": "Company", + "RESCHEDULE": "Pomjeri raspored", + "FIRSTNAME": "Ime", + "LASTNAME": "Prezime", + "MOBILE": "Mobilni", + "DATE_OF_BIRTH": "Datum rođenja", + "COMPANY": "Kompanija", "TAG": "Tag", - "COUNTRY": "Country", - "CITY": "City", - "STREET": "Address", - "POSTALCODE": "Postal Code", - "CUSTOM_FIELDS": "Custom Fields", - "GENERAL": "General", + "COUNTRY": "Država", + "CITY": "Grad", + "STREET": "Adresa", + "POSTALCODE": "Poštanski Broj", + "CUSTOM_FIELDS": "Prilagođena Polja", + "GENERAL": "Općenito", "VOICE": "Voice", - "TODAY_IVR_CAMPAIGNS_STATS": "Daily Ivr Campaigns Stats", - "TODAY_INBOUND_STATS": "Inbound Queue Daily Stats", - "TODAY_OUTBOUND_STATS": "Outbound Daily Stats", - "WAITING": "Waiting", - "TALKING": "Talking", - "INBOUND_ANSWERED": "Answered", - "OUTBOUND_ANSWERED": "Answered", - "AVG_HOLD_TIME": "Average Hold Time", - "INBOUND_ANSWER_RATE": "Answer Rate", - "OUTBOUND_ANSWER_RATE": "Answer Rate", - "ABANDON_RATE": "Abandon Rate", - "UNMANAGED": "Unmanaged", - "TOTAL": "Total", - "TOT_DURATION": "Total Duration", - "AVG_DURATION": "Average Duration", + "TODAY_IVR_CAMPAIGNS_STATS": "IVR Kampanje Dnevna Statistika", + "TODAY_INBOUND_STATS": "Dolazni Dnevna Statistika", + "TODAY_OUTBOUND_STATS": "Odlazni Dnevna Statistika", + "WAITING": "ČEKA", + "TALKING": "Priča", + "INBOUND_ANSWERED": "Odgovoreno", + "OUTBOUND_ANSWERED": "Odgovoreno", + "AVG_HOLD_TIME": "Prosječno Vrijeme Čekanja", + "INBOUND_ANSWER_RATE": "Stopa Odgovora", + "OUTBOUND_ANSWER_RATE": "Stopa Odgovorenih", + "ABANDON_RATE": "Stopa Napuštenih", + "UNMANAGED": "Neupravljano", + "TOTAL": "Ukupno", + "TOT_DURATION": "Ukupno trajanje", + "AVG_DURATION": "Prosječno Trajanje", "HELP": { - "MANDATORY_DISPOSITION_ENABLED": "Mandatory disposition enabled for this account", - "UNMANAGED_RATE": "The Unmanaged Rate of all the Interactions", - "WAITING": "The total number of Waiting Interactions", - "OPENED": "The total number of Active Interactions", - "MANAGED": "The total number of Completed Interactions", - "ABANDONED": "The total number of Abandoned Interactions", - "TOTAL_OFFERED": "The total number of Interactions (completed + abandoned)", - "AVG_HOLD_TIME": "The Average Interaction Hold Time, namely the average time spent waiting for an agent to answer, for all the existing Interactions", - "AVG_MANAGED_TIME": "The Average Interaction Managed Time, namely the average time spent during conversation", - "MANAGED_RATE": "The Managed Rate of all the Interactions", - "ABANDONED_RATE": "The Abandon Rate of all the Interactions", - "UNMANAGED": "The total number of Unmanaged Interactions", - "VOICE_WAITING": "The total number of Waiting Queue Calls, for all the existing Queues", - "VOICE_TALKING": "The total number of Active Queue Calls, for all the existing Queues", - "VOICE_ANSWERED": "The total number of Completed Queue Calls, for all the existing Queues", - "VOICE_ABANDONED": "The total number of Abandoned Queue Calls, considering all the existing Queues. Note that the calls which are abandoned for timeout and joinempty will not be considered", - "VOICE_TOTAL_OFFERED": "The total number of Queue Calls (completed + abandoned + unmanaged in the last queue of the flow). Note that the calls which enter in an IVR and not in a queue, will not be considered", - "VOICE_AVG_TALK_TIME": "The Average Queue Talk Time, namely the average time spent during conversation, for all the existing Queues", - "VOICE_AVG_HOLD_TIME": "The Average Queue Hold Time, namely the average time spent waiting for an agent to answer, for all the existing Queues", - "VOICE_ANSWER_RATE": "The Answer Rate of all the Queue Calls", - "VOICE_UNMANAGED": "The total number of Unmanaged Queue Calls, for all the existing Queues. It includes the calls which are abandoned for timeout, joinempty, leavewhenempty and exitwithkey (cfr. asterisk doc for more information)", - "ORIGINATED": "Total number of calls dialed in the queue campaigns", - "ORIGINATEDLIMITED": "IVR Campaigns Calls Originated/Limit", - "DROPPED": "The total number of Dropped Queue Calls, for all the existing Queues", - "DROP_RATE": "The Drop Rate of all the Queue Calls", - "OUTBOUND_ANSWERED": "The total number of Completed Outbound Calls", - "OUTBOUND_ANSWER_RATE": "The Answer Rate of all the Outbound Calls", - "ABANDON_RATE": "The Abandon Rate of all the Queue Calls", - "TOTAL": "The total number of Outbound Calls", - "TOT_DURATION": "The total duration of all the Outbound Calls", - "AVG_DURATION": "The average duration of all the Completed Outbound Calls", - "EXACT_MATCH_FILTER": "Search for an exact match", - "LIKE_FILTER": "Search for the specified pattern" + "MANDATORY_DISPOSITION_ENABLED": "Obavezna dispozicija uključena za ovaj račun", + "UNMANAGED_RATE": "Stopa Neupravljanih od svih Interakcija", + "WAITING": "Ukupan broj Interakcija na Čekanju", + "OPENED": "Ukupan broj Aktivnih Interakcija", + "MANAGED": "Ukupan broj Završenih Interakcija", + "ABANDONED": "Ukupan broj Napuštenih Interakcija", + "TOTAL_OFFERED": "Ukupan broj interakcija (Završenih + Napuštenih)", + "AVG_HOLD_TIME": "Prosječno Vrijeme Čekanja, odnosno prosječno vrijeme provedeno čekajući da specijalist odgovori, za sve postojeće Interakcije", + "AVG_MANAGED_TIME": "Prosječno Vrijeme Obrade, odnosno prosječno vrijeme provedeno tokom razgovora", + "MANAGED_RATE": "Stopa Obrade od svih Interakcija", + "ABANDONED_RATE": "Stopa Napuštanja od svih Interakcija", + "UNMANAGED": "Ukupan broj Neupravljanih Interakcija", + "VOICE_WAITING": "Ukupan broj Čekajućih Queue Poziva, za sve postojeće Queues", + "VOICE_TALKING": "Ukupan broj Aktivnih Queue Poziva, za sve postojeće Queues", + "VOICE_ANSWERED": "Ukupan broj Završenih Queue Poziva, za sve postojeće Queues", + "VOICE_ABANDONED": "Ukupan broj Napuštenih Queue Poziva, uzimajući u obzir sve postojeće Queues. Imaj na umu da pozivi koji su napuštenih zbog timeout-a i joinempty neće biti uzeti u obzir", + "VOICE_TOTAL_OFFERED": "Ukupan broj Queue Poziva (Završeni + Napušteni + Neupravljani u posljednjem queueflow). Imaj na umu da pozivi koji ulaze u IVR, a ne Queue, neće biti uzeti u obzir", + "VOICE_AVG_TALK_TIME": "Prosječno Queue Vrijeme Razgovora, odnosno prosječno vrijeme provedeno u konverzaciji, za sve postojeće Queues", + "VOICE_AVG_HOLD_TIME": "Prosječno Queue Vrijeme Čekanja, odnosno prosječno vrijeme provedeno čekajući da specijalista odgovori, za sve postojeće Queues", + "VOICE_ANSWER_RATE": "Stopa Odgovora od svih Queue Poziva", + "VOICE_UNMANAGED": "Ukupan broj Neupravljanih Queue Poziva, za sve postojeće Queue Pozive. Uključuje pozive koji su napušteni zbog timeout-a, joinempty, leavewhenempty and exitwithkey (pogledaj Asterisk dokumentaciju za više informacija)", + "ORIGINATED": "Ukupan broj poziva upućenih u queue kampanjama", + "ORIGINATEDLIMITED": "IVR Pozivi Kampanje Izazvani/Limit", + "DROPPED": "Ukupan broj Prekinutih Queue Poziva, za sve postojeće Queues", + "DROP_RATE": "Stopa Prekida od svih Queue Poziva", + "OUTBOUND_ANSWERED": "Ukupan broj Završenih Odlaznih Poziva", + "OUTBOUND_ANSWER_RATE": "Stopa Odgovora od svih Odlaznih Poziva", + "ABANDON_RATE": "Stopa Napuštanja od svih Queue Poziva", + "TOTAL": "Ukupan broj Odlaznih Poziva", + "TOT_DURATION": "Ukupno trajanje od svih Odlaznih Poziva", + "AVG_DURATION": "Prosječno trajanje od svih Završenih Odlaznih Poziva", + "EXACT_MATCH_FILTER": "Potraži tačno podudaranje", + "LIKE_FILTER": "Potraži specifičan uzorak" }, "ERRORS": { - "CAMPAIGN_REQUIRED": "Mandatory field", - "FIRSTNAME_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "DISPOSITION_REQUIRED": "Mandatory field", - "AGENT_REQUIRED": "Mandatory field", - "QUEUE_REQUIRED": "Mandatory field", - "FAILED_INITIALIZATION": "Error during initialization" + "CAMPAIGN_REQUIRED": "Obavezno polje", + "FIRSTNAME_REQUIRED": "Obavezno polje", + "PHONE_REQUIRED": "Obavezno polje", + "DISPOSITION_REQUIRED": "Obavezno polje", + "AGENT_REQUIRED": "Obavezno polje", + "QUEUE_REQUIRED": "Obavezno polje", + "FAILED_INITIALIZATION": "Greška tokom inicijalizacije" }, - "NO_AVAILABLE_INFO": "No available info", - "WELCOME_TO_MOTION": "Welcome to Motion", - "WELCOME_MESSAGE": "Use the left sidebar to navigate through available sections", - "ADD": "Add", - "CONTACTMANAGER": "Contact Manager", - "DASHBOARD": "Dashboard", - "EDIT_CONTACT": "Edit contact", - "EMAIL": "Email", - "FULLNAME": "Fullname", - "CREATEDAT": "Created At", - "LIST": "List", - "NEW_CONTACT": "New Contact", - "PHONE": "Phone", - "SAVE": "Save", - "INBOUND_WAITING_CALLS": "Inbound Waiting Calls", - "CONTACTS": "Contacts", - "MYCONTACTS": "My Contacts", - "ADD_CONTACT": "Add Contact", - "RELOAD": "Reload", - "WAITING_TEXT": "Waiting Interactions", - "TALKING_TEXT": "Active Queue Calls", - "INBOUND_ANSWERED_TEXT": "Answered Queue Calls", - "DROP_RATE_TEXT": "Queue Calls Drop Rate", - "AVG_TALK_TIME_TEXT": "Queue Calls Talk Time", - "INBOUND_ANSWER_RATE_TEXT": "Queue Calls Answer Rate", - "UNMANAGED_TEXT": "Unmanaged Interactions", - "TOTAL_TEXT": "Total Outbound Calls", - "OUTBOUND_ANSWERED_TEXT": "Outbound Answered Calls", - "TOT_DURATION_TEXT": "Outbound Calls Total Duration", - "AVG_DURATION_TEXT": "Outbound Calls Average Duration", - "OUTBOUND_ANSWER_RATE_TEXT": "Outbound calls Answer Rate", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "REPLY_PLACEHOLDER": "Type and hit enter to send a message", - "CONTACT_INFO": "Contact Info", - "CLOSE_AND_DISPOSE": "Close and dispose", - "DISPOSITIONS": "Dispositions", - "CLOSE_WITHOUT_DISPOSE": "Close without dispose", - "ACCEPT": "Accept", - "REJECT": "Reject", - "CLOSED": "Closed", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "WELCOME_TO_MOTION": "Dobrodošao u Motion", + "WELCOME_MESSAGE": "Koristi lijevu bočnu traku za navigaciju kroz dostupne odjelke", + "ADD": "Dodaj", + "CONTACTMANAGER": "Kontakt Menadžer", + "DASHBOARD": "Nadzorna ploča", + "EDIT_CONTACT": "Uredi kontakt", + "EMAIL": "E-mail", + "FULLNAME": "Puno ime", + "CREATEDAT": "Stvoreno U", + "LIST": "Lista", + "NEW_CONTACT": "Novi Kontakt", + "PHONE": "Telefon", + "SAVE": "Sačuvaj", + "INBOUND_WAITING_CALLS": "Dolazni Čekajući Pozivi", + "CONTACTS": "Kontakti", + "MYCONTACTS": "Moji Kontakti", + "ADD_CONTACT": "Dodaj Kontakt", + "RELOAD": "Ponovo učitaj", + "WAITING_TEXT": "INTERAKCIJE NA ČEKANJU", + "TALKING_TEXT": "Aktivni Queue Pozivi", + "INBOUND_ANSWERED_TEXT": "Odgovoreni Queue Pozivi", + "DROP_RATE_TEXT": "Queue Pozivi Stopa Prekinutih", + "AVG_TALK_TIME_TEXT": "Vrijeme Razgovora za Pozive u Queue", + "INBOUND_ANSWER_RATE_TEXT": "Queue Pozivi Stopa Odgovora", + "UNMANAGED_TEXT": "Neupravljane Interakcije", + "TOTAL_TEXT": "Ukupno Odlaznih Poziva", + "OUTBOUND_ANSWERED_TEXT": "Odgovoreni Odlazni Pozivi", + "TOT_DURATION_TEXT": "Odlazni Pozivi Ukupno Trajanje", + "AVG_DURATION_TEXT": "Odlazni Pozivi Prosječno Trajanje", + "OUTBOUND_ANSWER_RATE_TEXT": "Stopa Odgovorenih Odlaznih Poziva", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "REPLY_PLACEHOLDER": "Unesi i pritisni enter da pošalješ poruku", + "CONTACT_INFO": "Kontakt Info", + "CLOSE_AND_DISPOSE": "Zatvori i rasporedi", + "DISPOSITIONS": "Dispozicije", + "CLOSE_WITHOUT_DISPOSE": "Zatvori bez raspoređivanja", + "ACCEPT": "Prihvati", + "REJECT": "Odbaci", + "CLOSED": "Zatvoreno", "INFO": "Info", - "NOTE": "Note", - "ACCEPT_ELSEWHERE": "Accepted elsewhere", - "ATTENTION": "Attention", - "SOCIAL": "Social", - "NO_JSCRIPTY_PROJECTS_AVAILABLE": "No Jscripty Projects available", - "OPENED": "Opened", + "NOTE": "Bilješka", + "ACCEPT_ELSEWHERE": "Prihvaćeno drugdje", + "ATTENTION": "Pažnja", + "SOCIAL": "Društveni", + "NO_JSCRIPTY_PROJECTS_AVAILABLE": "Nema dostupnih Jscripty Projekata", + "OPENED": "Otvoreno", "FILTER": "Filter", - "SELECT_STATUS": "Select Status", - "SELECT_ACCOUNT": "Select Account", - "SELECT_WEBSITE": "Select Website", - "ALL": "All", - "INTERACTIONS": "Interactions", - "STARTEDAT": "Started At", + "SELECT_STATUS": "Odaberi Status", + "SELECT_ACCOUNT": "Odaberi Nalog", + "SELECT_WEBSITE": "Odaberi Website", + "ALL": "Svi", + "INTERACTIONS": "Interakcije", + "STARTEDAT": "Počelo U", "STATUS": "Status", - "OPEN": "Open", - "SHOW": "Show", - "SHOW_DETAILS": "Show Details", - "HIDE_DETAILS": "Hide Details", - "EXTERNAL_URL": "External Link", - "NO_MAIL_ACCOUNTS_AVAILABLE": "No Email Accounts available", - "NO_FAX_ACCOUNTS_AVAILABLE": "No Fax Accounts available", - "NO_SMS_ACCOUNTS_AVAILABLE": "No SMS Accounts available", - "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "No Whatsapp Account available", - "SELECT_DATE_RANGE": "Select Date Range", - "CLEAR": "Clear", - "CALL_NUMBER": "Call", - "TRANSFER_NUMBER": "Transfer", - "CALL_SAVED": "Call properly saved", - "CALL_DISPOSED": "Call properly disposed", - "CUSTOMER_PORT": "Originating TCP Port", - "INTERACTION_CLOSED": "Interaction properly closed", - "INTERACTION_DISPOSED": "Interaction properly disposed", - "INTERACTION_CLOSED_DISPOSED": "Interaction properly closed and disposed", - "SELECT_ALL": "Select all", - "ASSIGNED_TO_OTHERS": "Assigned to others", - "ID": "Id", - "CHAT_INTERACTIONS": "Chat Interactions", - "MAIL_INTERACTIONS": "Email Interactions", - "SMS_INTERACTIONS": "SMS Interactions", - "OPENCHANNEL_INTERACTIONS": "Open Channel Interactions", - "FAX_INTERACTIONS": "Fax Interactions", - "DRAFT": "Draft", - "DRAFT_SAVE_WARNING_TITLE": "Overwrite existing draft?", - "DRAFT_SAVE_WARNING_MESSAGE": "There is already a draft saved for this interaction. Are you sure you want to overwrite it?", - "OVERWRITE": "Overwrite", - "CANCEL": "Cancel", - "UNTITLED": "Untitled", - "SAVE_AS_DRAFT": "Save as draft", - "UPDATE_DRAFT": "Update draft", - "NO_AVAILABLE_INTERACTION": "No available interaction", - "DOSSIERS": "Dossiers", - "DOSSIER": "Dossier", - "DOSSIER_INFO": "Information", - "SELECT_COMPANY": "Select Company", - "DOSSIERNAME": "Dossier Name", - "OPENDATE": "Open Date", - "ALL_COMPANIES": "All Companies", - "SELECT_WORKFLOW": "Select Workflow", - "WORKFLOW": "Select Workflow", - "SELECT_WORKFLOWSTEPS": "Select Workflow State", - "ALL_WORKFLOW": "All Workflow", - "STATE": "State", - "STEP": "Step", - "NEW_DOSSIER": "New Dossier", - "PRICELIST": "Price List", - "PRODUCTFILTERNAME": "Filter Name", - "PRODUCTNAME": "Product", - "PRODUCTINQUOTATION": "PRODUCT DETAILS", - "REQUEST": "REQUEST", - "QUOTATION": "QUOTATION", - "DOSSIERID": "Dossier ID", - "QUOTATIONNAME": "Quotation Name", - "QUOTATIONNOTES": "Quotation Notes", - "QUOTATIONSTATUS": "State", - "REQUESTNAME": "Request Name", - "REQUESTNOTES": "Request Notes", - "ALL_STEP": "All", - "UPDATED_AT": "Modified on", - "BY": "By", - "ORDER": "Order", + "OPEN": "Otvoreno", + "SHOW": "Pokaži", + "SHOW_DETAILS": "Pokaži Detalje ", + "HIDE_DETAILS": "Sakrij Detalje", + "EXTERNAL_URL": "Eksterni Link", + "NO_MAIL_ACCOUNTS_AVAILABLE": "Nema dostupnih E-mail Naloga", + "NO_FAX_ACCOUNTS_AVAILABLE": "Nema dostupnih Fax Naloga", + "NO_SMS_ACCOUNTS_AVAILABLE": "Nema dostupnih SMS Naloga", + "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Nema dostupnih Whatsapp Naloga", + "SELECT_DATE_RANGE": "Odaberi Datum Raspona", + "CLEAR": "Briši", + "CALL_NUMBER": "Poziv", + "TRANSFER_NUMBER": "Prijenos", + "CALL_SAVED": "Poziv pravilno spremljen", + "CALL_DISPOSED": "Poziv pravilno zbrinut", + "CUSTOMER_PORT": "Izvorni TCP Port", + "INTERACTION_CLOSED": "Interakcija je ispravno zatvorena", + "INTERACTION_DISPOSED": "Interakcija je pravilno odložena", + "INTERACTION_CLOSED_DISPOSED": "Interakcija je ispravno zatvorena i odložena", + "SELECT_ALL": "Odaberi sve", + "ASSIGNED_TO_OTHERS": "Dodijeljeno drugima", + "ID": "ID", + "CHAT_INTERACTIONS": "Chat Interakcija", + "MAIL_INTERACTIONS": "E-mail Interakcije", + "SMS_INTERACTIONS": "SMS Interakcije", + "OPENCHANNEL_INTERACTIONS": "Interakcije Otvorenog Kanala", + "FAX_INTERACTIONS": "Fax Interakcije", + "DRAFT": "Nacrt", + "DRAFT_SAVE_WARNING_TITLE": "Zamijeni postojeći nacrt?", + "DRAFT_SAVE_WARNING_MESSAGE": "Već postoji nacrt za ovu interakciju. Jesi li siguran da ga želiš zamijeniti?", + "OVERWRITE": "Prepiši", + "CANCEL": "Otkaži", + "UNTITLED": "Bez naslova", + "SAVE_AS_DRAFT": "Sačuvaj kao nacrt", + "UPDATE_DRAFT": "Ažuriraj nacrt", + "NO_AVAILABLE_INTERACTION": "Nema dostupnih interakcija", + "DOSSIERS": "Dosjei", + "DOSSIER": "Dosije", + "DOSSIER_INFO": "Informacije", + "SELECT_COMPANY": "Odaberi Kompaniju", + "DOSSIERNAME": "Dosije Naziv", + "OPENDATE": "Datum Otvaranja", + "ALL_COMPANIES": "Sve Kompanije", + "SELECT_WORKFLOW": "Odaberi Workflow", + "WORKFLOW": "Odaberi Workflow", + "SELECT_WORKFLOWSTEPS": "Odaberi Stanje Workflow-a", + "ALL_WORKFLOW": "Sav Workflow", + "STATE": "Država", + "STEP": "Korak", + "NEW_DOSSIER": "Novi Dosije", + "PRICELIST": "Cjenik", + "PRODUCTFILTERNAME": "Naziv Filtera", + "PRODUCTNAME": "Produkt", + "PRODUCTINQUOTATION": "DETALJI O PROIZVODU", + "REQUEST": "ZAHTJEV", + "QUOTATION": "PONUDA", + "DOSSIERID": "Dosije ID", + "QUOTATIONNAME": "Naziv Ponude", + "QUOTATIONNOTES": "Bilješke Ponude", + "QUOTATIONSTATUS": "Država", + "REQUESTNAME": "Naziv Zahtjeva", + "REQUESTNOTES": "Bilješke Zahtjeva", + "ALL_STEP": "Svi", + "UPDATED_AT": "Ažurirano", + "BY": "Od", + "ORDER": "Red", "PROFORMA": "PROFORMA", - "INVOICE": "INVOICE", - "REQUESTID": "Request", - "QUOTATIONID": "Offer", - "ORDERID": "Order", - "PRICELISTNAME": "Price List", - "PRODUCTCODE": "Product Code", - "PRICELISTNETPRICE": "Net Price", - "PRICELISTDISCOUNT": "Price list discount", - "QUOTATIONQTY": "Quantity", - "QUOTATIONTAX": "Tax", + "INVOICE": "FAKTURA", + "REQUESTID": "Zahtjev", + "QUOTATIONID": "PONUDA", + "ORDERID": "Naruči", + "PRICELISTNAME": "Cjenik", + "PRODUCTCODE": "Šifra Produkta", + "PRICELISTNETPRICE": "Neto Cijena", + "PRICELISTDISCOUNT": "Popust na cjenovnik", + "QUOTATIONQTY": "Količina", + "QUOTATIONTAX": "Porez", "QUOTATIONPROFORMAID": "Proforma ID", - "QUOTATIONINVOICEID": "Invoice ID", - "QUOTATIONDISCOUNT": "Quotation Discount", - "ORDER_INFO": "Order", - "REQUEST_INFO": "Request", - "QUOTATION_INFO": "Quotation", - "ORDERCLIENTCODE": "Customer Code", - "ORDERNOTES": "Note", - "PROFORMANAME": "Proforma name", - "AGENTFULLNAME": "Agent", - "PROFORMANOTES": "Note", - "PRODUCTINPROFORMA": "Products in proforma", - "INVOICENAME": "Invoice Name", - "INVOICENOTES": "Note", - "DOSSIERNOTES": "Note", - "QUOTATIONTOTALPRICE": "Total net", - "QUOTATIONTOTALTAX": "Total tax", + "QUOTATIONINVOICEID": "FAKTURA ID", + "QUOTATIONDISCOUNT": "Popust na ponudu", + "ORDER_INFO": "Naruči", + "REQUEST_INFO": "Zahtjev", + "QUOTATION_INFO": "Ponuda", + "ORDERCLIENTCODE": "Šifra Klijenta", + "ORDERNOTES": "Bilješka", + "PROFORMANAME": "Naziv Proforme", + "AGENTFULLNAME": "Specijalist", + "PROFORMANOTES": "Bilješka", + "PRODUCTINPROFORMA": "Produkti u proformi", + "INVOICENAME": "Naziv Fakture", + "INVOICENOTES": "Bilješka", + "DOSSIERNOTES": "Bilješka", + "QUOTATIONTOTALPRICE": "Ukupno net", + "QUOTATIONTOTALTAX": "Ukupno poreza", "PROFORMA_INFO": "Proforma", - "PROFORMAID": "Id Proforma", - "PRICESALELISTNETPRICE": "Prezzo listino", - "PROFORMASTATUS": "State", - "INVOICESTATUS": "State", - "NO_PRODUCTINVOICE_AVAILABLE": "No product", - "INVOICEID": "Invoice", - "PRODUCTNOTE": "Note", - "INVOICE_INFO": "Invoice", - "COMPANYSTREET": "Address", - "COMPANYCITY": "City", - "COMPANYPOSTALCODE": "Postal Code", - "COMPANYCOUNTRY": "Country", + "PROFORMAID": "ID Proforma", + "PRICESALELISTNETPRICE": "Cjenik", + "PROFORMASTATUS": "Država", + "INVOICESTATUS": "Država", + "NO_PRODUCTINVOICE_AVAILABLE": "Nema proizvoda", + "INVOICEID": "Faktura", + "PRODUCTNOTE": "Bilješka", + "INVOICE_INFO": "Faktura", + "COMPANYSTREET": "Adresa", + "COMPANYCITY": "Grad", + "COMPANYPOSTALCODE": "Poštanski Broj", + "COMPANYCOUNTRY": "Država", "COMPANYFAX": "Fax", - "COMPANYVAT": "Fiscal Code/VAT", - "COMPANYPHONE": "Telephone", - "COMPANYEMAIL": "Email", - "NOTES": "Note", - "QUOTATIONPRODUCTNOTE": "Product Note", - "QUOTATIONVAT": "VAT", + "COMPANYVAT": "Fiskalni Kod/PDV", + "COMPANYPHONE": "Telefon", + "COMPANYEMAIL": "E-mail", + "NOTES": "Bilješka", + "QUOTATIONPRODUCTNOTE": "Bilješke Produkta", + "QUOTATIONVAT": "PDV", "AUTOPROFORMA": "SELF-PROFORMA", "AUTOINVOICE": "SELF-INVOICE", - "MOVEASSET": "ASSET", - "ORDERSTATUS": "State", - "QUOTATIONTOTALS": "Total", - "QUOTATIONTOTAL": "TOTAL", - "PRODUCTTYPE": "Type", - "PRODUCTSUBSCRIPTION": "Duration", - "PRODUCTATUNIT": "Unit", - "INASSET": "Asset", - "PRODUCTININVOICE": "Products on the invoice", - "SUBSCRIPTIONS": "CUSTOMER SCHEDULE", - "SUBSCRIPTIONNAME": "Subscription", - "COMPANYNAME": "Company", - "NEXTINVOICE": "Next Invoice", - "SUBSCRIPTIONDETAIL": "Detail", - "PRODUCTDESCRIPTION": "Description", - "NETPRICE": "Price", - "DISCOUNT": "Discount", - "TAX": "Tax", - "ATTENDACELASTINVOICE": "Last invoice", - "ATTENDACENEXTINVOICE": "Next invoice", - "SELECT_PRODUCT": "Select product", - "SELECT_PRODUCTTYPE": "Select type", - "ALL_PRODUCTS": "All", - "ALL_STATUS": "All", - "PAYMENT_INFO": "Payment information", - "PAYMENTMETHOD": "Payment methods", - "PAYMENT": "Payment", - "DETAILS": "Details", - "INVOICEDETAILS": "INVOICE DETAILS", - "QUANTITY": "Quantity", - "MANAGESALES": "Subscriptions", - "ACCOUNTINGDOC": "Accounting", - "INVOICES": "INVOICES", + "MOVEASSET": "IMOVINA", + "ORDERSTATUS": "Država", + "QUOTATIONTOTALS": "Ukupno", + "QUOTATIONTOTAL": "Ukupno", + "PRODUCTTYPE": "Vrsta", + "PRODUCTSUBSCRIPTION": "Trajanje", + "PRODUCTATUNIT": "Jedinica", + "INASSET": "Imovina", + "PRODUCTININVOICE": "Proizvodi na fakturi", + "SUBSCRIPTIONS": "RASPORED STRANKE", + "SUBSCRIPTIONNAME": "Pretplata", + "COMPANYNAME": "Kompanija", + "NEXTINVOICE": "Sljedeća Faktura", + "SUBSCRIPTIONDETAIL": "Detalji", + "PRODUCTDESCRIPTION": "Opis", + "NETPRICE": "Cijena", + "DISCOUNT": "Popust", + "TAX": "Porez", + "ATTENDACELASTINVOICE": "Posljednja faktura", + "ATTENDACENEXTINVOICE": "Sljedeća faktura", + "SELECT_PRODUCT": "Odaberi Proizvod", + "SELECT_PRODUCTTYPE": "Odaberi vrstu", + "ALL_PRODUCTS": "Svi", + "ALL_STATUS": "Svi", + "PAYMENT_INFO": "Informacije o plaćanju", + "PAYMENTMETHOD": "Način plaćanja", + "PAYMENT": "Plaćanje", + "DETAILS": "Detalji", + "INVOICEDETAILS": "DETALJI FAKTURE", + "QUANTITY": "Količina", + "MANAGESALES": "Pretplate", + "ACCOUNTINGDOC": "Računovodstvo", + "INVOICES": "FAKTURE", "PROFORMAS": "PROFORMA", - "PAYMENTS": "PAYMENTS", - "SELECT_PERIOD": "Select range", - "NO_PRODUCTPROFORMA_AVAILABLE": "No data available", - "NO_PRODUCTPRICELIST_AVAILABLE": "No data available", - "PROFORMAAUTHORIZED": "Authorized proforma", - "ADD_PRODUCTPRICELIST": "ADD PRODUCT", - "DELETE_PRODUCT": "Delete Product", - "AUTHORIZED": "AUTHORIZED", - "INVOICEDISCOUNT": "Discount", - "DEPOSIT": "DEPOSIT", - "BALANCE": "BALANCE", - "PRODUCTS": "PRODUCTS", - "INVOICENOPRODUCTDESCRIPTION": "Description on the invoice", + "PAYMENTS": "PLAĆANJA", + "SELECT_PERIOD": "Odaberi raspon", + "NO_PRODUCTPROFORMA_AVAILABLE": "Nema dostupnih podataka", + "NO_PRODUCTPRICELIST_AVAILABLE": "Nema dostupnih podataka", + "PROFORMAAUTHORIZED": "Ovlaštena proforma", + "ADD_PRODUCTPRICELIST": "DODAJ PROIZVOD", + "DELETE_PRODUCT": "Izbriši Produkt", + "AUTHORIZED": "OVLAŠTEN", + "INVOICEDISCOUNT": "Popust na fakturu ", + "DEPOSIT": "DEPOZIT", + "BALANCE": "BALANS", + "PRODUCTS": "PROIZVODI", + "INVOICENOPRODUCTDESCRIPTION": "Opis na fakturi", "INVOICENOPRODUCTAMOUNT": "Amount", - "INVOICENOTAXAMOUNT": "TAX", - "INVOICENOPRODUCTSAVE": "Save", - "INVOICENOPRODUCTUPDATE": "Update", + "INVOICENOTAXAMOUNT": "POREZ", + "INVOICENOPRODUCTSAVE": "Sačuvaj", + "INVOICENOPRODUCTUPDATE": "Ažuriraj", "PDFPROFORMA": "PDF", "PDFINVOICE": "PDF", - "PAIDANDEXPIRED": "Payment", - "CREDITNOTE": "CREDIT NOTE", - "CREDITNOTE_INFO": "Credit Note", - "MOVECREDITNOTE": "SELF-CREDIT NOTE", - "CREDITNOTEDETAILS": "Credit Note Detail", + "PAIDANDEXPIRED": "Plaćanje", + "CREDITNOTE": "KREDITNA NOTA", + "CREDITNOTE_INFO": "Kreditna Nota", + "MOVECREDITNOTE": "SELF-CREDIT BILJEŠKA", + "CREDITNOTEDETAILS": "Kreditna Nota Detalji", "PDFCREDITNOTE": "PDF", - "CREDITINOTENAME": "Name", - "TOTALPAYMENTS": "Total payments", - "PROFORMADETAILS": "Details", - "CREATIONDATE": "Created at", - "STARTDATE": "Invoice Date", - "ENDDATE": "Expiry Date", - "NUMBER": "Number", - "PRODUCTPRICE": "Price", - "PRODUCTTAX": "Tax percentage", - "PRODUCTQTY": "Quantity", - "UPDATE_PRODUCT": "Update Product", - "QUOTATIONPRODUCTTYPE": "Type", - "QUOTATIONUNIT": "Unit", - "QUOTATIONSUBSCRIPTION": "Duration", - "SELECT_PERIOD_CREATION": "Select Creation Date", - "SELECT_PERIOD_START": "Select Date", - "SELECT_PERIOD_EXPIRE": "Select Expiry Date", - "NEW_COMPANY": "New", - "COMPANIES": "Companies", - "PAYED_AY": "Payed on", - "CLONEPROFORMA": "Clone", - "COMPANYDESC": "Description", - "COMPANYNATION": "Nation", - "GRAPHINVOICES": "Invoice emission chart", - "YEARS": "Years", - "FROM": "From", - "TO": "To", - "INVOICEEMITED": "Issued", - "INVOICEPAYED": "Payed", - "INVOICETOTAL": "Total", - "CHOOSE": "Choose", - "ADVANCED_SEARCH": "Advanced Search", - "NEW_CONDITION": "New Condition", - "SELECT_FIELD": "Select field", - "SELECT_OPERATOR": "Select operator", - "VALUE": "Value", - "VALUES": "Values", - "APPLY": "Apply", - "MEET_ALL_CONDITIONS": "Meet all conditions", - "MEET_ANY_CONDITIONS": "Meet at least one condition", - "EQUALS": "Equals", - "IS_NOT_EQUAL": "Does not equal", - "IS_AMONG": "Is among", - "IS_NOT_AMONG": "Is not among", - "IS_GREATER_THAN": "Is greater than", - "IS_GREATER_THAN_OR_EQUAL_TO": "Is greater than or equal to", - "IS_LESS_THAN": "Is less than", - "IS_LESS_THAN_OR_EQUAL_TO": "Is less than or equal to", - "IS_BETWEEN": "Is between", - "CONTAINS": "Contains", - "STARTS_WITH": "Starts with", - "ENDS_WITH": "Ends with", - "STARTING_DATE": "Starting date", - "ENDING_DATE": "Ending date", - "STARTING_VALUE": "Starting value", - "ENDING_VALUE": "Ending value", - "VALUE_RANGE_CHECK": "Value must be greater than", - "AND": "And", - "ENABLED": "Enabled", - "DISABLED": "Disabled", - "ELAPSED_ANSWERED": "Elapsed time since call started", - "ELAPSED_DISPOSED": "Elapsed time since call ended", - "WHATSAPP": "WhatsApp Connector", - "WHATSAPP_INTERACTIONS": "WhatsApp Connector Interactions", - "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", - "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", - "VIDAOOSESSION": "Start Video Call", - "SELECT_CONTACT": "Select contact", - "SELECT": "Select", - "LAST_UPDATED": "Last updated", - "MATCHING_FIELD": "Matching field", - "MULTIPLE_CONTACTS_FOUND": "Multiple contacts found for number", - "WHICH_ONE_TO_USE": "Which one do you want to use?", - "LICENSE_EXPIRE_REMAINING_DAYS": "Your license is about to expire! Please contact your Administrator", - "NO_RESULTS_AVAILABLE": "No results available", - "AVAILABLE": "Available", - "AGENT_PRESENCE": "Agent Presence", - "SELECT_TEAM": "Select Team", + "CREDITINOTENAME": "Ime", + "TOTALPAYMENTS": "Ukupno plaćanja", + "PROFORMADETAILS": "Detalji", + "CREATIONDATE": "Stvoreno U", + "STARTDATE": "Datum Fakture", + "ENDDATE": "Datum Isteka", + "NUMBER": "Broj", + "PRODUCTPRICE": "Cijena", + "PRODUCTTAX": "Porezni postotak", + "PRODUCTQTY": "Količina", + "UPDATE_PRODUCT": "Ažuriraj Proizvod", + "QUOTATIONPRODUCTTYPE": "Vrsta", + "QUOTATIONUNIT": "Jedinica", + "QUOTATIONSUBSCRIPTION": "Trajanje", + "SELECT_PERIOD_CREATION": "Odaberi Datum Kreiranja", + "SELECT_PERIOD_START": "Odaberi Datum", + "SELECT_PERIOD_EXPIRE": "Odaberi Datum Isteka", + "NEW_COMPANY": "Novo", + "COMPANIES": "Kompanije", + "PAYED_AY": "Plaćeno na", + "CLONEPROFORMA": "Kloniraj", + "COMPANYDESC": "Opis", + "COMPANYNATION": "Nacija", + "GRAPHINVOICES": "Emisije Računa Chart", + "YEARS": "Godine", + "FROM": "Od", + "TO": "Do", + "INVOICEEMITED": "Izdato", + "INVOICEPAYED": "Plaćeno", + "INVOICETOTAL": "Ukupno", + "CHOOSE": "Biraj", + "ADVANCED_SEARCH": "Napredno Pretraživanje", + "NEW_CONDITION": "Novo Stanje", + "SELECT_FIELD": "Odaberi polje", + "SELECT_OPERATOR": "Odaberi specijalistu", + "VALUE": "Vrijednost", + "VALUES": "Vrijednosti", + "APPLY": "Primijeni", + "MEET_ALL_CONDITIONS": "Ispunjava sve uslove", + "MEET_ANY_CONDITIONS": "Ispunjava barem jedan uslov", + "EQUALS": "Jednako", + "IS_NOT_EQUAL": "Nije jednako", + "IS_AMONG": "Je među", + "IS_NOT_AMONG": "Nije među", + "IS_GREATER_THAN": "Je veće od", + "IS_GREATER_THAN_OR_EQUAL_TO": "Je veće od ili jednako", + "IS_LESS_THAN": "Je manje od", + "IS_LESS_THAN_OR_EQUAL_TO": "Je manje od ili jednako", + "IS_BETWEEN": "Je izumeđu", + "CONTAINS": "Sadrži", + "STARTS_WITH": "Počinje sa", + "ENDS_WITH": "Završava Sa", + "STARTING_DATE": "Početni datum", + "ENDING_DATE": "Datum Isteka", + "STARTING_VALUE": "Početna vrijednost", + "ENDING_VALUE": "Vrijednost Isteka", + "VALUE_RANGE_CHECK": "Vrijednost mora biti veća od", + "AND": "I", + "ENABLED": "Omogućeno", + "DISABLED": "Onemogućeno", + "ELAPSED_ANSWERED": "Proteklo vrijeme od početka poziva", + "ELAPSED_DISPOSED": "Proteklo vrijeme od završetka poziva", + "WHATSAPP": "WhatsApp Konektor", + "WHATSAPP_INTERACTIONS": "WhatsApp Konektor Interakcija", + "SECOND_LEVEL_DISPOSITION": "Dispozicija Drugog Nivoa", + "THIRD_LEVEL_DISPOSITION": "Disozicija Trećeg Nivoa", + "VIDAOOSESSION": "Započni Video Poziv", + "SELECT_CONTACT": "Odaberi kontakt", + "SELECT": "Odaberi", + "LAST_UPDATED": "Zadnje Ažuriranje", + "MATCHING_FIELD": "Podudarno polje", + "MULTIPLE_CONTACTS_FOUND": "Višestruki kontakti pronađeni za broj", + "WHICH_ONE_TO_USE": "Koji želiš koristiti?", + "LICENSE_EXPIRE_REMAINING_DAYS": "Tvoja licenca uskoro ističe! Molim kontaktiraj svog Kontakt Centar Menadžera", + "NO_RESULTS_AVAILABLE": "Nema dostupnih rezultata", + "AVAILABLE": "Dostupno", + "AGENT_PRESENCE": "Prisutnost Specijaliste", + "SELECT_TEAM": "Odaberi Tim", "NOTIFICATIONS": { - "TRANSFER_AGENT_EXECUTED": "Transfer to agent successfully executed", - "TRANSFER_QUEUE_EXECUTED": "Transfer to queue successfully executed" + "TRANSFER_AGENT_EXECUTED": "Prijenos Specijaliste je uspješno izvršen", + "TRANSFER_QUEUE_EXECUTED": "Prijenos u Queue je uspješno izvršen" }, - "LIMIT_TABS_REACHED": "Maximum number of open tabs reached" + "LIMIT_TABS_REACHED": "Dostignut je maksimalan broj otvorenih tab-ova", + "WAITING_CALLS": "Pozivi na čekanju", + "WAITING_INTERACTIONS": "Interakcije na čekanju" } } diff --git a/public/app/main/apps/dashboards/i18n/cs.json b/public/app/main/apps/dashboards/i18n/cs.json index e0a66cd..72f96de 100644 --- a/public/app/main/apps/dashboards/i18n/cs.json +++ b/public/app/main/apps/dashboards/i18n/cs.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontaktní Telefon", "RECALLME_CALL_REMINDER": "Připomenutí hovoru Recall Me", "SCHEDULED_TIME": "Naplánovaný čas", - "UPCOMING_RECALLME_CALL": "Nadcházející volání Recall Me" + "UPCOMING_RECALLME_CALL": "Nadcházející volání Recall Me", + "WAITING_CALLS": "Čekající hovory", + "WAITING_INTERACTIONS": "Interakce při čekání" } } diff --git a/public/app/main/apps/dashboards/i18n/da.json b/public/app/main/apps/dashboards/i18n/da.json index 20b67fd..abd0dc4 100644 --- a/public/app/main/apps/dashboards/i18n/da.json +++ b/public/app/main/apps/dashboards/i18n/da.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontakt telefon", "RECALLME_CALL_REMINDER": "Husk mig opkaldspåmindelse", "SCHEDULED_TIME": "Planlagt tid", - "UPCOMING_RECALLME_CALL": "Kommende Recall Me-opkald" + "UPCOMING_RECALLME_CALL": "Kommende Recall Me-opkald", + "WAITING_CALLS": "Ventende opkald", + "WAITING_INTERACTIONS": "Ventende interaktioner" } } diff --git a/public/app/main/apps/dashboards/i18n/de.json b/public/app/main/apps/dashboards/i18n/de.json index 6015548..b494e4e 100644 --- a/public/app/main/apps/dashboards/i18n/de.json +++ b/public/app/main/apps/dashboards/i18n/de.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontakt-Telefon", "RECALLME_CALL_REMINDER": "Recall Me Anruferinnerung", "SCHEDULED_TIME": "Geplante Zeit", - "UPCOMING_RECALLME_CALL": "Anstehender Recall Me-Anruf" + "UPCOMING_RECALLME_CALL": "Anstehender Recall Me-Anruf", + "WAITING_CALLS": "Wartende Anrufe", + "WAITING_INTERACTIONS": "Wartende Interaktionen" } } diff --git a/public/app/main/apps/dashboards/i18n/es.json b/public/app/main/apps/dashboards/i18n/es.json index abbb32f..2f1a2c4 100644 --- a/public/app/main/apps/dashboards/i18n/es.json +++ b/public/app/main/apps/dashboards/i18n/es.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "teléfono de contacto", "RECALLME_CALL_REMINDER": "Recuérdame recordatorio de llamada", "SCHEDULED_TIME": "Hora programada", - "UPCOMING_RECALLME_CALL": "Próxima llamada de Recall Me" + "UPCOMING_RECALLME_CALL": "Próxima llamada de Recall Me", + "WAITING_CALLS": "Llamadas en espera", + "WAITING_INTERACTIONS": "Interacciones en espera" } } diff --git a/public/app/main/apps/dashboards/i18n/et.json b/public/app/main/apps/dashboards/i18n/et.json index 739750c..2e257c3 100644 --- a/public/app/main/apps/dashboards/i18n/et.json +++ b/public/app/main/apps/dashboards/i18n/et.json @@ -583,6 +583,13 @@ "PREVIEW_CALL": "Kõne eelvaade", "PREVIEW_CALL_FOR": "Tulevane eelvaatekutse", "SCHEDULED_AT": "kavas kl", - "SYSTEM_TIME": "Süsteemi aeg" + "SYSTEM_TIME": "Süsteemi aeg", + "CONTACT_NAME": "kontaktisiku nimi", + "CONTACT_PHONE": "Kontakt Telefon", + "RECALLME_CALL_REMINDER": "Helista mulle meeldetuletus", + "SCHEDULED_TIME": "Planeeritud aeg", + "UPCOMING_RECALLME_CALL": "Tulevane Recall Me kõne", + "WAITING_CALLS": "Kõnede ootel", + "WAITING_INTERACTIONS": "Interaktsioonide ootel" } } diff --git a/public/app/main/apps/dashboards/i18n/fa.json b/public/app/main/apps/dashboards/i18n/fa.json index 76aa749..036c4a6 100644 --- a/public/app/main/apps/dashboards/i18n/fa.json +++ b/public/app/main/apps/dashboards/i18n/fa.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "تلفن تماس", "RECALLME_CALL_REMINDER": "یادآوری تماس مرا Recall Me", "SCHEDULED_TIME": "زمان برنامه ریزی شده", - "UPCOMING_RECALLME_CALL": "تماس بعدی Recall Me" + "UPCOMING_RECALLME_CALL": "تماس بعدی Recall Me", + "WAITING_CALLS": "تماس های انتظار", + "WAITING_INTERACTIONS": "تعاملات انتظار" } } diff --git a/public/app/main/apps/dashboards/i18n/fi.json b/public/app/main/apps/dashboards/i18n/fi.json index 59d46ce..c2eefe6 100644 --- a/public/app/main/apps/dashboards/i18n/fi.json +++ b/public/app/main/apps/dashboards/i18n/fi.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Yhteyspuhelinnumero", "RECALLME_CALL_REMINDER": "Recall Me -soittomuistutus", "SCHEDULED_TIME": "Sovittu aika", - "UPCOMING_RECALLME_CALL": "Tuleva Recall Me -puhelu" + "UPCOMING_RECALLME_CALL": "Tuleva Recall Me -puhelu", + "WAITING_CALLS": "Odottavat puhelut", + "WAITING_INTERACTIONS": "Vuorovaikutuksia odottamassa" } } diff --git a/public/app/main/apps/dashboards/i18n/fr.json b/public/app/main/apps/dashboards/i18n/fr.json index 40bf467..80f6205 100644 --- a/public/app/main/apps/dashboards/i18n/fr.json +++ b/public/app/main/apps/dashboards/i18n/fr.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Numéro du contact", "RECALLME_CALL_REMINDER": "rappelez-moi rappel d'appel", "SCHEDULED_TIME": "Heure prévue", - "UPCOMING_RECALLME_CALL": "Appel de rappel à venir" + "UPCOMING_RECALLME_CALL": "Appel de rappel à venir", + "WAITING_CALLS": "Appels en attente", + "WAITING_INTERACTIONS": "Interactions en attente" } } diff --git a/public/app/main/apps/dashboards/i18n/he.json b/public/app/main/apps/dashboards/i18n/he.json index fff6efe..edc1037 100644 --- a/public/app/main/apps/dashboards/i18n/he.json +++ b/public/app/main/apps/dashboards/i18n/he.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "טלפון ליצירת קשר", "RECALLME_CALL_REMINDER": "תזכורת להתקשרות זכור לי", "SCHEDULED_TIME": "זמן מתוכנן", - "UPCOMING_RECALLME_CALL": "שיחת Recall Me הקרובה" + "UPCOMING_RECALLME_CALL": "שיחת Recall Me הקרובה", + "WAITING_CALLS": "שיחות ממתינות", + "WAITING_INTERACTIONS": "המתנה לאינטראקציות" } } diff --git a/public/app/main/apps/dashboards/i18n/hi.json b/public/app/main/apps/dashboards/i18n/hi.json index fa4b16a..e89676e 100644 --- a/public/app/main/apps/dashboards/i18n/hi.json +++ b/public/app/main/apps/dashboards/i18n/hi.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "संपर्क फ़ोन", "RECALLME_CALL_REMINDER": "रिकॉल मी कॉल रिमाइंडर", "SCHEDULED_TIME": "निर्धारित समय", - "UPCOMING_RECALLME_CALL": "अपकमिंग रिकॉल मी कॉल" + "UPCOMING_RECALLME_CALL": "अपकमिंग रिकॉल मी कॉल", + "WAITING_CALLS": "वेटिंग कॉल", + "WAITING_INTERACTIONS": "प्रतीक्षा बातचीत" } } diff --git a/public/app/main/apps/dashboards/i18n/hu.json b/public/app/main/apps/dashboards/i18n/hu.json index e6dc890..31b1630 100644 --- a/public/app/main/apps/dashboards/i18n/hu.json +++ b/public/app/main/apps/dashboards/i18n/hu.json @@ -590,6 +590,8 @@ "CONTACT_PHONE": "Kapcsolat Telefon", "RECALLME_CALL_REMINDER": "Recall Me hívás emlékeztető", "SCHEDULED_TIME": "Menetrendszeri idő", - "UPCOMING_RECALLME_CALL": "Közelgő Recall Me hívás" + "UPCOMING_RECALLME_CALL": "Közelgő Recall Me hívás", + "WAITING_CALLS": "Várakozó hívások", + "WAITING_INTERACTIONS": "Várakozó interakciók" } } diff --git a/public/app/main/apps/dashboards/i18n/id.json b/public/app/main/apps/dashboards/i18n/id.json index a6dfab9..fa27c1e 100644 --- a/public/app/main/apps/dashboards/i18n/id.json +++ b/public/app/main/apps/dashboards/i18n/id.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Hubungi Telepon", "RECALLME_CALL_REMINDER": "Ingatkan Saya pengingat panggilan", "SCHEDULED_TIME": "Waktu yang dijadwalkan", - "UPCOMING_RECALLME_CALL": "Panggilan Recall Me yang akan datang" + "UPCOMING_RECALLME_CALL": "Panggilan Recall Me yang akan datang", + "WAITING_CALLS": "Panggilan Menunggu", + "WAITING_INTERACTIONS": "Interaksi Menunggu" } } diff --git a/public/app/main/apps/dashboards/i18n/is.json b/public/app/main/apps/dashboards/i18n/is.json new file mode 100644 index 0000000..34b7937 --- /dev/null +++ b/public/app/main/apps/dashboards/i18n/is.json @@ -0,0 +1,596 @@ +{ + "DASHBOARDS": { + "VISIBILITY": "Visibility", + "PUBLIC": "Public", + "PRIVATE": "Private", + "PUBLIC_INTERACTION": "The interaction is public", + "LOST_CONNECTION": "Experiencing network connectivity issues. Please check your internet connection.", + "SCHEDULED_CALLS": "Scheduled Calls", + "DOWNLOAD": "Download", + "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", + "UNMANAGED_RATE": "Unmanaged Rate", + "UPCOMING_RECALLME_CALL": "Upcoming Recall Me call", + "RECALLME_CALL_REMINDER": "Recall Me call reminder", + "CONTACT_NAME": "Contact Name", + "CONTACT_PHONE": "Contact Phone", + "SCHEDULED_TIME": "Scheduled time", + "LIST_NAME": "List name", + "UNMANAGED_RATE_TEXT": "Interactions Unmanaged Rate", + "VOICE_WAITING": "WAITING", + "VOICE_WAITING_TEXT": "WAITING QUEUE CALLS", + "VOICE_TALKING": "TALKING", + "VOICE_TALKING_TEXT": "ACTIVE QUEUE CALLS", + "VOICE_ANSWERED": "ANSWERED", + "VOICE_ANSWERED_TEXT": "ANSWERED QUEUE CALLS", + "VOICE_ABANDONED": "ABANDONED", + "VOICE_ABANDONED_TEXT": "ABANDONED QUEUE CALLS", + "VOICE_TOTAL_OFFERED": "TOTAL OFFERED", + "VOICE_TOTAL_OFFERED_TEXT": "TOTAL QUEUE CALLS", + "TODAY_INTERACTIONS_STATS": "Interactions Daily Stats", + "DIAL_TIMEZONE": "Dial timezone", + "VOICE_AVG_HOLD_TIME": "AVERAGE HOLD TIME", + "VOICE_AVG_HOLD_TIME_TEXT": "QUEUE CALLS AVG HOLD TIME", + "VOICE_AVG_TALK_TIME": "AVERAGE TALK TIME", + "VOICE_AVG_TALK_TIME_TEXT": "QUEUE CALLS TALK TIME", + "VOICE_ANSWER_RATE": "ANSWER RATE", + "VOICE_ANSWER_RATE_TEXT": "QUEUE CALLS ANSWER RATE", + "VOICE_ABANDON_RATE": "ABANDON RATE", + "VOICE_ABANDON_RATE_TEXT": "QUEUE CALLS ABANDON RATE", + "VOICE_UNMANAGED": "UNMANAGED", + "VOICE_UNMANAGED_TEXT": "UNMANAGED QUEUE CALLS", + "OPENED_TEXT": "Opened Interactions", + "MANAGED": "Managed", + "MANAGED_TEXT": "Managed Interactions", + "ABANDONED": "Abandoned", + "ABANDONED_TEXT": "Abandoned Interactions", + "ABANDONED_RATE": "Abandoned Rate", + "ABANDONED_RATE_TEXT": "Interactions Abandon Rate", + "SYSTEM_TIME": "System time", + "TOTAL_OFFERED": "Total Offered", + "TOTAL_OFFERED_TEXT": "Offered Interactions", + "AVG_HOLD_TIME_TEXT": "Interactions AVG Hold Time", + "MANAGED_RATE": "Managed Rate", + "MANAGED_RATE_TEXT": "Interactions Managed Rate ", + "AVG_MANAGED_TIME": "AVG Management Time", + "AVG_MANAGED_TIME_TEXT": "Interactions AVG Management Time", + "NO_DISPOSITION_SET": "No disposition set", + "AGENTS": "Agents", + "TRANSFER": "Transfer", + "NO_DATA_AVAILABLE": "No data available", + "CUSTOMER_JOURNEY": "Customer Journey", + "ME": "Me", + "CURRENTLY_IN_USE_BY": "Currently in use by", + "NOTAVAILABLE": "Not available", + "CLICKRELOAD": "New abandoned calls! Reload please", + "ASSIGNTO": "Assign to", + "SELECT_QUEUE": "Select Queue", + "SELECT_CAMPAIGN": "Select Queue", + "FREE": "Free", + "RESERVED": "Reserved", + "QUEUECALLEREXITREASON": "Reason", + "QUEUECALLEREXITAT": "Dropped", + "LASTASSIGNEDTO": "Last Assigned To", + "ABANDONEDQUEUECALLS": "Abandoned Queue Calls", + "ABANDONAT": "Abandoned", + "QUEUE": "Queue", + "SELECT_SUBSTATUS": "Select Substatus", + "READ": "Read", + "UNREAD": "Unread", + "SELECT_READ_UNREAD": "Select Read/Unread", + "SELECT_AGENT": "Select Agent", + "MARK_AS_UNREAD": "Mark as unread", + "FILTER_VOICE_QUEUES": "Filter Voice Queues", + "FILTER_CHAT_WEBSITES": "Filter Chat Websites", + "FILTER_SMS_ACCOUNTS": "Filter Sms Accounts", + "FILTER_FAX_ACCOUNTS": "Filter Fax Accounts", + "FILTER_OPENCHANNEL_ACCOUNTS": "Filter Openchannel Accounts", + "FILTER_MAIL_ACCOUNTS": "Filter Mail Accounts", + "FILTER_WHATSAPP_ACCOUNTS": "Filter Whatsapp Accounts", + "SETFILTERS": "Set Filters", + "FILTERS": "Filters", + "CONFIRM": "Confirm", + "CHANNEL_WAITING_TEXT": "Waiting Queue Interactions", + "CHANNEL_QUEUE": "Queue", + "CHANNEL_FROM": "From", + "LOADING_INTERACTION": "We are loading the interaction...", + "JANUARY": "January", + "FEBRUARY": "February", + "MARCH": "March", + "APRIL": "April", + "MAY": "May", + "JUNE": "June", + "JULY": "July", + "AUGUST": "August", + "SEPTEMBER": "September", + "OCTOBER": "October", + "NOVEMBER": "November", + "DECEMBER": "December", + "MON": "Mon", + "TUE": "Tue", + "WED": "Wed", + "THU": "Thu", + "FRI": "Fri", + "SAT": "Sat", + "SUN": "Sun", + "DELETE": "Delete", + "LAST_3_DAYS": "Last 3 Day", + "LAST_YEAR": "Last Year", + "THIS_YEAR": "This Year", + "LAST_MONTH": "Last Month", + "THIS_MONTH": "This Month", + "LAST_WEEK": "Last Week", + "THIS_WEEK": "This Week", + "YESTERDAY": "Yesterday", + "TODAY": "Today", + "SELECT_DATE": "Select Start Date", + "HOME": "Home", + "SET_AS": "Set As", + "PENDING": "Pending", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", + "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", + "TAGS": "Tags", + "SELECT_TAG": "Select Tag", + "TYPE": "Type", + "SOURCE": "Source", + "DESTINATION": "Destination", + "CALLERID": "Caller ID", + "END_AT": "End At", + "DURATION": "Duration", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "Sms", + "OPENCHANNEL": "Open Channel", + "FAX": "Fax", + "NOT_ASSIGNED": "Not Assigned", + "UNKNOWN": "Unknown", + "SELECT_USER": "Select User", + "LAST_MESSAGE": "Last message", + "USER": "User", + "RATING": "Rating", + "FEEDBACK": "Feedback", + "SUBJECT": "Subject", + "CUSTOMER_IP": "Originating IP Address", + "REFERER": "Referer", + "ACCOUNT": "Account", + "WEBSITE": "Website", + "AGENT": "Agent", + "CREATED_AT": "Created At", + "CLOSED_AT": "Closed At", + "DISPOSITION": "Disposition", + "CONTACT": "Contact", + "INTERACTION": "Interaction", + "BROWSER_NAME": "Browser Name", + "BROWSER_VERSION": "Browser Version", + "OS_NAME": "Operating System Name", + "OS_VERSION": "Operating System Version", + "DEVICE_MODEL": "Device Model", + "DEVICE_VENDOR": "Device Vendor", + "DEVICE_TYPE": "Device Type", + "RECALLME": "Recall Me", + "DROP_RATE": "Drop Rate", + "DROPPED": "Dropped", + "DROPPED_TEXT": "Dropped Queue Calls", + "DETAIL": "Detail", + "MOTION_BULL": "Motion Bull", + "LIMITED": "Limited", + "LIMITED_TEXT": "IVR Campaigns Calls Originated/Limit", + "DASHBOARDS": "Dashboards", + "RECORDINGS": "Recordings", + "TODAY_MOTION_BULL_STATS": "Queue Campaigns Daily Stats", + "ORIGINATED": "Originated", + "ORIGINATED_TEXT": "Queue Calls Originated", + "UPDATE": "Update", + "MORE": "More", + "MOTIONDIALER": "Motion Bull", + "DISPOSE": "Dispose", + "QUEUES": "Queues", + "DIALER_CALL": "Dialer Call", + "ELAPSED_TIME": "Elapsed Time", + "EDIT": "Edit", + "MERGE": "Merge", + "DUPLICATE": "Duplicate", + "UNIQUEID": "Uniqueid", + "AUTOCLOSE": "Automatically close contact tab after disposal", + "CAMPAIGN": "Campaign", + "NONE": "None", + "NAME": "Name", + "ANSWER_MACHINE": "Answer Machine", + "INTERESTED": "Interested", + "NOT_INTERESTED": "Not Interested", + "PERSONAL_INFO": "Personal Info", + "SOLD": "Sold", + "SPECIAL": "Special", + "BLACKLIST": "Blacklist", + "RESCHEDULE": "Reschedule", + "FIRSTNAME": "Firstname", + "LASTNAME": "Lastname", + "MOBILE": "Mobile", + "DATE_OF_BIRTH": "Birthdate", + "COMPANY": "Company", + "TAG": "Tag", + "COUNTRY": "Country", + "CITY": "City", + "STREET": "Address", + "POSTALCODE": "Postal Code", + "CUSTOM_FIELDS": "Custom Fields", + "GENERAL": "General", + "VOICE": "Voice", + "TODAY_IVR_CAMPAIGNS_STATS": "Daily Ivr Campaigns Stats", + "TODAY_INBOUND_STATS": "Inbound Queue Daily Stats", + "TODAY_OUTBOUND_STATS": "Outbound Daily Stats", + "WAITING": "Waiting", + "TALKING": "Talking", + "INBOUND_ANSWERED": "Answered", + "OUTBOUND_ANSWERED": "Answered", + "AVG_HOLD_TIME": "Average Hold Time", + "INBOUND_ANSWER_RATE": "Answer Rate", + "OUTBOUND_ANSWER_RATE": "Answer Rate", + "ABANDON_RATE": "Abandon Rate", + "UNMANAGED": "Unmanaged", + "TOTAL": "Total", + "TOT_DURATION": "Total Duration", + "AVG_DURATION": "Average Duration", + "HELP": { + "MANDATORY_DISPOSITION_ENABLED": "Mandatory disposition enabled for this account", + "UNMANAGED_RATE": "The Unmanaged Rate of all the Interactions", + "WAITING": "The total number of Waiting Interactions", + "OPENED": "The total number of Active Interactions", + "MANAGED": "The total number of Completed Interactions", + "ABANDONED": "The total number of Abandoned Interactions", + "TOTAL_OFFERED": "The total number of Interactions (completed + abandoned)", + "AVG_HOLD_TIME": "The Average Interaction Hold Time, namely the average time spent waiting for an agent to answer, for all the existing Interactions", + "AVG_MANAGED_TIME": "The Average Interaction Managed Time, namely the average time spent during conversation", + "MANAGED_RATE": "The Managed Rate of all the Interactions", + "ABANDONED_RATE": "The Abandon Rate of all the Interactions", + "UNMANAGED": "The total number of Unmanaged Interactions", + "VOICE_WAITING": "The total number of Waiting Queue Calls, for all the existing Queues", + "VOICE_TALKING": "The total number of Active Queue Calls, for all the existing Queues", + "VOICE_ANSWERED": "The total number of Completed Queue Calls, for all the existing Queues", + "VOICE_ABANDONED": "The total number of Abandoned Queue Calls, considering all the existing Queues. Note that the calls which are abandoned for timeout and joinempty will not be considered", + "VOICE_TOTAL_OFFERED": "The total number of Queue Calls (completed + abandoned + unmanaged in the last queue of the flow). Note that the calls which enter in an IVR and not in a queue, will not be considered", + "VOICE_AVG_TALK_TIME": "The Average Queue Talk Time, namely the average time spent during conversation, for all the existing Queues", + "VOICE_AVG_HOLD_TIME": "The Average Queue Hold Time, namely the average time spent waiting for an agent to answer, for all the existing Queues", + "VOICE_ANSWER_RATE": "The Answer Rate of all the Queue Calls", + "VOICE_UNMANAGED": "The total number of Unmanaged Queue Calls, for all the existing Queues. It includes the calls which are abandoned for timeout, joinempty, leavewhenempty and exitwithkey (cfr. asterisk doc for more information)", + "ORIGINATED": "Total number of calls dialed in the queue campaigns", + "ORIGINATEDLIMITED": "IVR Campaigns Calls Originated/Limit", + "DROPPED": "The total number of Dropped Queue Calls, for all the existing Queues", + "DROP_RATE": "The Drop Rate of all the Queue Calls", + "OUTBOUND_ANSWERED": "The total number of Completed Outbound Calls", + "OUTBOUND_ANSWER_RATE": "The Answer Rate of all the Outbound Calls", + "ABANDON_RATE": "The Abandon Rate of all the Queue Calls", + "TOTAL": "The total number of Outbound Calls", + "TOT_DURATION": "The total duration of all the Outbound Calls", + "AVG_DURATION": "The average duration of all the Completed Outbound Calls", + "EXACT_MATCH_FILTER": "Search for an exact match", + "LIKE_FILTER": "Search for the specified pattern" + }, + "ERRORS": { + "CAMPAIGN_REQUIRED": "Mandatory field", + "FIRSTNAME_REQUIRED": "Mandatory field", + "PHONE_REQUIRED": "Mandatory field", + "DISPOSITION_REQUIRED": "Mandatory field", + "AGENT_REQUIRED": "Mandatory field", + "QUEUE_REQUIRED": "Mandatory field", + "FAILED_INITIALIZATION": "Error during initialization" + }, + "NO_AVAILABLE_INFO": "No available info", + "WELCOME_TO_MOTION": "Welcome to Motion", + "WELCOME_MESSAGE": "Use the left sidebar to navigate through available sections", + "ADD": "Add", + "CONTACTMANAGER": "Contact Manager", + "DASHBOARD": "Dashboard", + "EDIT_CONTACT": "Edit contact", + "EMAIL": "Email", + "FULLNAME": "Fullname", + "CREATEDAT": "Created At", + "LIST": "List", + "NEW_CONTACT": "New Contact", + "PHONE": "Phone", + "SAVE": "Save", + "INBOUND_WAITING_CALLS": "Inbound Waiting Calls", + "CONTACTS": "Contacts", + "MYCONTACTS": "My Contacts", + "ADD_CONTACT": "Add Contact", + "RELOAD": "Reload", + "WAITING_TEXT": "Waiting Interactions", + "TALKING_TEXT": "Active Queue Calls", + "INBOUND_ANSWERED_TEXT": "Answered Queue Calls", + "DROP_RATE_TEXT": "Queue Calls Drop Rate", + "AVG_TALK_TIME_TEXT": "Queue Calls Talk Time", + "INBOUND_ANSWER_RATE_TEXT": "Queue Calls Answer Rate", + "UNMANAGED_TEXT": "Unmanaged Interactions", + "TOTAL_TEXT": "Total Outbound Calls", + "OUTBOUND_ANSWERED_TEXT": "Outbound Answered Calls", + "TOT_DURATION_TEXT": "Outbound Calls Total Duration", + "AVG_DURATION_TEXT": "Outbound Calls Average Duration", + "OUTBOUND_ANSWER_RATE_TEXT": "Outbound calls Answer Rate", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "REPLY_PLACEHOLDER": "Type and hit enter to send a message", + "CONTACT_INFO": "Contact Info", + "CLOSE_AND_DISPOSE": "Close and dispose", + "DISPOSITIONS": "Dispositions", + "CLOSE_WITHOUT_DISPOSE": "Close without dispose", + "ACCEPT": "Accept", + "REJECT": "Reject", + "CLOSED": "Closed", + "INFO": "Info", + "NOTE": "Note", + "ACCEPT_ELSEWHERE": "Accepted elsewhere", + "ATTENTION": "Attention", + "SOCIAL": "Social", + "NO_JSCRIPTY_PROJECTS_AVAILABLE": "No Jscripty Projects available", + "OPENED": "Opened", + "FILTER": "Filter", + "SELECT_STATUS": "Select Status", + "SELECT_ACCOUNT": "Select Account", + "SELECT_WEBSITE": "Select Website", + "ALL": "All", + "INTERACTIONS": "Interactions", + "STARTEDAT": "Started At", + "STATUS": "Status", + "OPEN": "Open", + "SHOW": "Show", + "SHOW_DETAILS": "Show Details", + "HIDE_DETAILS": "Hide Details", + "EXTERNAL_URL": "External Link", + "NO_MAIL_ACCOUNTS_AVAILABLE": "No Email Accounts available", + "NO_FAX_ACCOUNTS_AVAILABLE": "No Fax Accounts available", + "NO_SMS_ACCOUNTS_AVAILABLE": "No SMS Accounts available", + "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "No Whatsapp Account available", + "SELECT_DATE_RANGE": "Select Date Range", + "CLEAR": "Clear", + "CALL_NUMBER": "Call", + "TRANSFER_NUMBER": "Transfer", + "CALL_SAVED": "Call properly saved", + "CALL_DISPOSED": "Call properly disposed", + "CUSTOMER_PORT": "Originating TCP Port", + "INTERACTION_CLOSED": "Interaction properly closed", + "INTERACTION_DISPOSED": "Interaction properly disposed", + "INTERACTION_CLOSED_DISPOSED": "Interaction properly closed and disposed", + "SELECT_ALL": "Select all", + "ASSIGNED_TO_OTHERS": "Assigned to others", + "ID": "Id", + "CHAT_INTERACTIONS": "Chat Interactions", + "MAIL_INTERACTIONS": "Email Interactions", + "SMS_INTERACTIONS": "SMS Interactions", + "OPENCHANNEL_INTERACTIONS": "Open Channel Interactions", + "FAX_INTERACTIONS": "Fax Interactions", + "DRAFT": "Draft", + "DRAFT_SAVE_WARNING_TITLE": "Overwrite existing draft?", + "DRAFT_SAVE_WARNING_MESSAGE": "There is already a draft saved for this interaction. Are you sure you want to overwrite it?", + "OVERWRITE": "Overwrite", + "CANCEL": "Cancel", + "UNTITLED": "Untitled", + "SAVE_AS_DRAFT": "Save as draft", + "UPDATE_DRAFT": "Update draft", + "NO_AVAILABLE_INTERACTION": "No available interaction", + "DOSSIERS": "Dossiers", + "DOSSIER": "Dossier", + "DOSSIER_INFO": "Information", + "SELECT_COMPANY": "Select Company", + "DOSSIERNAME": "Dossier Name", + "OPENDATE": "Open Date", + "ALL_COMPANIES": "All Companies", + "SELECT_WORKFLOW": "Select Workflow", + "WORKFLOW": "Select Workflow", + "SELECT_WORKFLOWSTEPS": "Select Workflow State", + "ALL_WORKFLOW": "All Workflow", + "STATE": "State", + "STEP": "Step", + "NEW_DOSSIER": "New Dossier", + "PRICELIST": "Price List", + "PRODUCTFILTERNAME": "Filter Name", + "PRODUCTNAME": "Product", + "PRODUCTINQUOTATION": "PRODUCT DETAILS", + "REQUEST": "REQUEST", + "QUOTATION": "QUOTATION", + "DOSSIERID": "Dossier ID", + "QUOTATIONNAME": "Quotation Name", + "QUOTATIONNOTES": "Quotation Notes", + "QUOTATIONSTATUS": "State", + "REQUESTNAME": "Request Name", + "REQUESTNOTES": "Request Notes", + "ALL_STEP": "All", + "UPDATED_AT": "Modified on", + "BY": "By", + "ORDER": "Order", + "PROFORMA": "PROFORMA", + "INVOICE": "INVOICE", + "REQUESTID": "Request", + "QUOTATIONID": "Offer", + "ORDERID": "Order", + "PRICELISTNAME": "Price List", + "PRODUCTCODE": "Product Code", + "PRICELISTNETPRICE": "Net Price", + "PRICELISTDISCOUNT": "Price list discount", + "QUOTATIONQTY": "Quantity", + "QUOTATIONTAX": "Tax", + "QUOTATIONPROFORMAID": "Proforma ID", + "QUOTATIONINVOICEID": "Invoice ID", + "QUOTATIONDISCOUNT": "Quotation Discount", + "ORDER_INFO": "Order", + "REQUEST_INFO": "Request", + "QUOTATION_INFO": "Quotation", + "ORDERCLIENTCODE": "Customer Code", + "ORDERNOTES": "Note", + "PROFORMANAME": "Proforma name", + "AGENTFULLNAME": "Agent", + "PROFORMANOTES": "Note", + "PRODUCTINPROFORMA": "Products in proforma", + "INVOICENAME": "Invoice Name", + "INVOICENOTES": "Note", + "DOSSIERNOTES": "Note", + "QUOTATIONTOTALPRICE": "Total net", + "QUOTATIONTOTALTAX": "Total tax", + "PROFORMA_INFO": "Proforma", + "PROFORMAID": "Id Proforma", + "PRICESALELISTNETPRICE": "Prezzo listino", + "PROFORMASTATUS": "State", + "INVOICESTATUS": "State", + "NO_PRODUCTINVOICE_AVAILABLE": "No product", + "INVOICEID": "Invoice", + "PRODUCTNOTE": "Note", + "INVOICE_INFO": "Invoice", + "COMPANYSTREET": "Address", + "COMPANYCITY": "City", + "COMPANYPOSTALCODE": "Postal Code", + "COMPANYCOUNTRY": "Country", + "COMPANYFAX": "Fax", + "COMPANYVAT": "Fiscal Code/VAT", + "COMPANYPHONE": "Telephone", + "COMPANYEMAIL": "Email", + "NOTES": "Note", + "QUOTATIONPRODUCTNOTE": "Product Note", + "QUOTATIONVAT": "VAT", + "AUTOPROFORMA": "SELF-PROFORMA", + "AUTOINVOICE": "SELF-INVOICE", + "MOVEASSET": "ASSET", + "ORDERSTATUS": "State", + "QUOTATIONTOTALS": "Total", + "QUOTATIONTOTAL": "TOTAL", + "PRODUCTTYPE": "Type", + "PRODUCTSUBSCRIPTION": "Duration", + "PRODUCTATUNIT": "Unit", + "INASSET": "Asset", + "PRODUCTININVOICE": "Products on the invoice", + "SUBSCRIPTIONS": "CUSTOMER SCHEDULE", + "SUBSCRIPTIONNAME": "Subscription", + "COMPANYNAME": "Company", + "NEXTINVOICE": "Next Invoice", + "SUBSCRIPTIONDETAIL": "Detail", + "PRODUCTDESCRIPTION": "Description", + "NETPRICE": "Price", + "DISCOUNT": "Discount", + "TAX": "Tax", + "ATTENDACELASTINVOICE": "Last invoice", + "ATTENDACENEXTINVOICE": "Next invoice", + "SELECT_PRODUCT": "Select product", + "SELECT_PRODUCTTYPE": "Select type", + "ALL_PRODUCTS": "All", + "ALL_STATUS": "All", + "PAYMENT_INFO": "Payment information", + "PAYMENTMETHOD": "Payment methods", + "PAYMENT": "Payment", + "DETAILS": "Details", + "INVOICEDETAILS": "INVOICE DETAILS", + "QUANTITY": "Quantity", + "MANAGESALES": "Subscriptions", + "ACCOUNTINGDOC": "Accounting", + "INVOICES": "INVOICES", + "PROFORMAS": "PROFORMA", + "PAYMENTS": "PAYMENTS", + "SELECT_PERIOD": "Select range", + "NO_PRODUCTPROFORMA_AVAILABLE": "No data available", + "NO_PRODUCTPRICELIST_AVAILABLE": "No data available", + "PROFORMAAUTHORIZED": "Authorized proforma", + "ADD_PRODUCTPRICELIST": "ADD PRODUCT", + "DELETE_PRODUCT": "Delete Product", + "AUTHORIZED": "AUTHORIZED", + "INVOICEDISCOUNT": "Discount", + "DEPOSIT": "DEPOSIT", + "BALANCE": "BALANCE", + "PRODUCTS": "PRODUCTS", + "INVOICENOPRODUCTDESCRIPTION": "Description on the invoice", + "INVOICENOPRODUCTAMOUNT": "Amount", + "INVOICENOTAXAMOUNT": "TAX", + "INVOICENOPRODUCTSAVE": "Save", + "INVOICENOPRODUCTUPDATE": "Update", + "PDFPROFORMA": "PDF", + "PDFINVOICE": "PDF", + "PAIDANDEXPIRED": "Payment", + "CREDITNOTE": "CREDIT NOTE", + "CREDITNOTE_INFO": "Credit Note", + "MOVECREDITNOTE": "SELF-CREDIT NOTE", + "CREDITNOTEDETAILS": "Credit Note Detail", + "PDFCREDITNOTE": "PDF", + "CREDITINOTENAME": "Name", + "TOTALPAYMENTS": "Total payments", + "PROFORMADETAILS": "Details", + "CREATIONDATE": "Created at", + "STARTDATE": "Invoice Date", + "ENDDATE": "Expiry Date", + "NUMBER": "Number", + "PRODUCTPRICE": "Price", + "PRODUCTTAX": "Tax percentage", + "PRODUCTQTY": "Quantity", + "UPDATE_PRODUCT": "Update Product", + "QUOTATIONPRODUCTTYPE": "Type", + "QUOTATIONUNIT": "Unit", + "QUOTATIONSUBSCRIPTION": "Duration", + "SELECT_PERIOD_CREATION": "Select Creation Date", + "SELECT_PERIOD_START": "Select Date", + "SELECT_PERIOD_EXPIRE": "Select Expiry Date", + "NEW_COMPANY": "New", + "COMPANIES": "Companies", + "PAYED_AY": "Payed on", + "CLONEPROFORMA": "Clone", + "COMPANYDESC": "Description", + "COMPANYNATION": "Nation", + "GRAPHINVOICES": "Invoice emission chart", + "YEARS": "Years", + "FROM": "From", + "TO": "To", + "INVOICEEMITED": "Issued", + "INVOICEPAYED": "Payed", + "INVOICETOTAL": "Total", + "CHOOSE": "Choose", + "ADVANCED_SEARCH": "Advanced Search", + "NEW_CONDITION": "New Condition", + "SELECT_FIELD": "Select field", + "SELECT_OPERATOR": "Select operator", + "VALUE": "Value", + "VALUES": "Values", + "APPLY": "Apply", + "MEET_ALL_CONDITIONS": "Meet all conditions", + "MEET_ANY_CONDITIONS": "Meet at least one condition", + "EQUALS": "Equals", + "IS_NOT_EQUAL": "Does not equal", + "IS_AMONG": "Is among", + "IS_NOT_AMONG": "Is not among", + "IS_GREATER_THAN": "Is greater than", + "IS_GREATER_THAN_OR_EQUAL_TO": "Is greater than or equal to", + "IS_LESS_THAN": "Is less than", + "IS_LESS_THAN_OR_EQUAL_TO": "Is less than or equal to", + "IS_BETWEEN": "Is between", + "CONTAINS": "Contains", + "STARTS_WITH": "Starts with", + "ENDS_WITH": "Ends with", + "STARTING_DATE": "Starting date", + "ENDING_DATE": "Ending date", + "STARTING_VALUE": "Starting value", + "ENDING_VALUE": "Ending value", + "VALUE_RANGE_CHECK": "Value must be greater than", + "AND": "And", + "ENABLED": "Enabled", + "DISABLED": "Disabled", + "ELAPSED_ANSWERED": "Elapsed time since call started", + "ELAPSED_DISPOSED": "Elapsed time since call ended", + "WHATSAPP": "WhatsApp Connector", + "WHATSAPP_INTERACTIONS": "WhatsApp Connector Interactions", + "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", + "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", + "VIDAOOSESSION": "Start Video Call", + "SELECT_CONTACT": "Select contact", + "SELECT": "Select", + "LAST_UPDATED": "Last updated", + "MATCHING_FIELD": "Matching field", + "MULTIPLE_CONTACTS_FOUND": "Multiple contacts found for number", + "WHICH_ONE_TO_USE": "Which one do you want to use?", + "LICENSE_EXPIRE_REMAINING_DAYS": "Your license is about to expire! Please contact your Administrator", + "NO_RESULTS_AVAILABLE": "No results available", + "AVAILABLE": "Available", + "AGENT_PRESENCE": "Agent Presence", + "SELECT_TEAM": "Select Team", + "NOTIFICATIONS": { + "TRANSFER_AGENT_EXECUTED": "Transfer to agent successfully executed", + "TRANSFER_QUEUE_EXECUTED": "Transfer to queue successfully executed" + }, + "LIMIT_TABS_REACHED": "Maximum number of open tabs reached", + "WAITING_CALLS": "Waiting Calls", + "WAITING_INTERACTIONS": "Waiting Interactions" + } +} diff --git a/public/app/main/apps/dashboards/i18n/ja.json b/public/app/main/apps/dashboards/i18n/ja.json index 7971add..eae6747 100644 --- a/public/app/main/apps/dashboards/i18n/ja.json +++ b/public/app/main/apps/dashboards/i18n/ja.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "電話に連絡する", "RECALLME_CALL_REMINDER": "リコールミーコールリマインダー", "SCHEDULED_TIME": "予定時間", - "UPCOMING_RECALLME_CALL": "今後のリコールミーコール" + "UPCOMING_RECALLME_CALL": "今後のリコールミーコール", + "WAITING_CALLS": "待機中の電話", + "WAITING_INTERACTIONS": "相互作用を待っています" } } diff --git a/public/app/main/apps/dashboards/i18n/ko.json b/public/app/main/apps/dashboards/i18n/ko.json index bfd643f..622d508 100644 --- a/public/app/main/apps/dashboards/i18n/ko.json +++ b/public/app/main/apps/dashboards/i18n/ko.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "연락 전화 번호", "RECALLME_CALL_REMINDER": "나에게 전화 걸기 알림", "SCHEDULED_TIME": "예정된 시간", - "UPCOMING_RECALLME_CALL": "리콜 미 콜 예정" + "UPCOMING_RECALLME_CALL": "리콜 미 콜 예정", + "WAITING_CALLS": "통화 대기", + "WAITING_INTERACTIONS": "대기 상호 작용" } } diff --git a/public/app/main/apps/dashboards/i18n/lt.json b/public/app/main/apps/dashboards/i18n/lt.json index 21fa3cd..c947204 100644 --- a/public/app/main/apps/dashboards/i18n/lt.json +++ b/public/app/main/apps/dashboards/i18n/lt.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontaktinis Telefonas", "RECALLME_CALL_REMINDER": "„Recall Me“ skambučio priminimas", "SCHEDULED_TIME": "Numatytas laikas", - "UPCOMING_RECALLME_CALL": "Būsimas „Recall Me“ skambutis" + "UPCOMING_RECALLME_CALL": "Būsimas „Recall Me“ skambutis", + "WAITING_CALLS": "Laukia skambučiai", + "WAITING_INTERACTIONS": "Laukiama sąveika" } } diff --git a/public/app/main/apps/dashboards/i18n/lv.json b/public/app/main/apps/dashboards/i18n/lv.json index f70d78b..c5fceea 100644 --- a/public/app/main/apps/dashboards/i18n/lv.json +++ b/public/app/main/apps/dashboards/i18n/lv.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontakttālrunis", "RECALLME_CALL_REMINDER": "Atgādināt man zvanu atgādinājums", "SCHEDULED_TIME": "Plānotais laiks", - "UPCOMING_RECALLME_CALL": "Gaidāmais Recall Me zvans" + "UPCOMING_RECALLME_CALL": "Gaidāmais Recall Me zvans", + "WAITING_CALLS": "Zvanu gaidīšana", + "WAITING_INTERACTIONS": "Mijiedarbības gaidīšana" } } diff --git a/public/app/main/apps/dashboards/i18n/nl.json b/public/app/main/apps/dashboards/i18n/nl.json index 55e3cf9..6a693b5 100644 --- a/public/app/main/apps/dashboards/i18n/nl.json +++ b/public/app/main/apps/dashboards/i18n/nl.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Neem contact op met telefoon", "RECALLME_CALL_REMINDER": "Herinner mij oproepherinnering", "SCHEDULED_TIME": "Geplande tijd", - "UPCOMING_RECALLME_CALL": "Aankomende oproep voor terugroepactie" + "UPCOMING_RECALLME_CALL": "Aankomende oproep voor terugroepactie", + "WAITING_CALLS": "Oproepen in de wacht", + "WAITING_INTERACTIONS": "Wachtende interacties" } } diff --git a/public/app/main/apps/dashboards/i18n/no.json b/public/app/main/apps/dashboards/i18n/no.json index 9d354d3..40a9d0e 100644 --- a/public/app/main/apps/dashboards/i18n/no.json +++ b/public/app/main/apps/dashboards/i18n/no.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "kontakt telefon", "RECALLME_CALL_REMINDER": "Tilbakekall meg ringepåminnelse", "SCHEDULED_TIME": "Planlagt tid", - "UPCOMING_RECALLME_CALL": "Kommende Recall Me-samtale" + "UPCOMING_RECALLME_CALL": "Kommende Recall Me-samtale", + "WAITING_CALLS": "Ventende anrop", + "WAITING_INTERACTIONS": "Ventende interaksjoner" } } diff --git a/public/app/main/apps/dashboards/i18n/pl.json b/public/app/main/apps/dashboards/i18n/pl.json index b032714..8d4594c 100644 --- a/public/app/main/apps/dashboards/i18n/pl.json +++ b/public/app/main/apps/dashboards/i18n/pl.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "telefon kontaktowy", "RECALLME_CALL_REMINDER": "Przypomnij mi przypomnienie o połączeniu", "SCHEDULED_TIME": "Zaplanowany czas", - "UPCOMING_RECALLME_CALL": "Nadchodzące połączenie Przypomnij mnie" + "UPCOMING_RECALLME_CALL": "Nadchodzące połączenie Przypomnij mnie", + "WAITING_CALLS": "Połączenia oczekujące", + "WAITING_INTERACTIONS": "Interakcje oczekujące" } } diff --git a/public/app/main/apps/dashboards/i18n/pt-BR.json b/public/app/main/apps/dashboards/i18n/pt-BR.json index 760ba7d..38d32a2 100644 --- a/public/app/main/apps/dashboards/i18n/pt-BR.json +++ b/public/app/main/apps/dashboards/i18n/pt-BR.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "telefone de contato", "RECALLME_CALL_REMINDER": "Lembrete de chamada de Recall Me", "SCHEDULED_TIME": "Hora marcada", - "UPCOMING_RECALLME_CALL": "Próxima chamada de Recall Me" + "UPCOMING_RECALLME_CALL": "Próxima chamada de Recall Me", + "WAITING_CALLS": "Chamadas em espera", + "WAITING_INTERACTIONS": "Interações em espera" } } diff --git a/public/app/main/apps/dashboards/i18n/pt-PT.json b/public/app/main/apps/dashboards/i18n/pt-PT.json index 1931296..8b34987 100644 --- a/public/app/main/apps/dashboards/i18n/pt-PT.json +++ b/public/app/main/apps/dashboards/i18n/pt-PT.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "telefone de contato", "RECALLME_CALL_REMINDER": "Lembrete de chamada de Recall Me", "SCHEDULED_TIME": "Hora marcada", - "UPCOMING_RECALLME_CALL": "Próxima chamada de Recall Me" + "UPCOMING_RECALLME_CALL": "Próxima chamada de Recall Me", + "WAITING_CALLS": "Chamadas em espera", + "WAITING_INTERACTIONS": "Interações em espera" } } diff --git a/public/app/main/apps/dashboards/i18n/ru.json b/public/app/main/apps/dashboards/i18n/ru.json index 76debab..cd87ab5 100644 --- a/public/app/main/apps/dashboards/i18n/ru.json +++ b/public/app/main/apps/dashboards/i18n/ru.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Контактный телефон", "RECALLME_CALL_REMINDER": "Напомнить мне о звонке", "SCHEDULED_TIME": "Запланированное время", - "UPCOMING_RECALLME_CALL": "Предстоящий вызов «Напомнить мне»" + "UPCOMING_RECALLME_CALL": "Предстоящий вызов «Напомнить мне»", + "WAITING_CALLS": "Ожидание звонков", + "WAITING_INTERACTIONS": "Ожидающие взаимодействия" } } diff --git a/public/app/main/apps/dashboards/i18n/sv.json b/public/app/main/apps/dashboards/i18n/sv.json index cdc4504..a74581e 100644 --- a/public/app/main/apps/dashboards/i18n/sv.json +++ b/public/app/main/apps/dashboards/i18n/sv.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontakt Telefon", "RECALLME_CALL_REMINDER": "Ring mig påminnelse", "SCHEDULED_TIME": "Schemalagd tid", - "UPCOMING_RECALLME_CALL": "Kommande Recall Me-samtal" + "UPCOMING_RECALLME_CALL": "Kommande Recall Me-samtal", + "WAITING_CALLS": "Väntande samtal", + "WAITING_INTERACTIONS": "Väntar på interaktioner" } } diff --git a/public/app/main/apps/dashboards/i18n/tr.json b/public/app/main/apps/dashboards/i18n/tr.json index b5b8081..e173ec1 100644 --- a/public/app/main/apps/dashboards/i18n/tr.json +++ b/public/app/main/apps/dashboards/i18n/tr.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "İletişim Telefonu", "RECALLME_CALL_REMINDER": "Beni Hatırla çağrı hatırlatıcısı", "SCHEDULED_TIME": "Planlanmış zaman", - "UPCOMING_RECALLME_CALL": "Yaklaşan Beni Geri Çağır araması" + "UPCOMING_RECALLME_CALL": "Yaklaşan Beni Geri Çağır araması", + "WAITING_CALLS": "Bekleyen Aramalar", + "WAITING_INTERACTIONS": "Bekleyen Etkileşimler" } } diff --git a/public/app/main/apps/dashboards/i18n/zh-CN.json b/public/app/main/apps/dashboards/i18n/zh-CN.json index 4a3630d..42c9ea0 100644 --- a/public/app/main/apps/dashboards/i18n/zh-CN.json +++ b/public/app/main/apps/dashboards/i18n/zh-CN.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "联系电话", "RECALLME_CALL_REMINDER": "Recall Me 来电提醒", "SCHEDULED_TIME": "计划的时间", - "UPCOMING_RECALLME_CALL": "即将到来的 Recall Me 电话" + "UPCOMING_RECALLME_CALL": "即将到来的 Recall Me 电话", + "WAITING_CALLS": "等待电话", + "WAITING_INTERACTIONS": "等待互动" } } diff --git a/public/app/main/apps/dashboards/i18n/zh-TW.json b/public/app/main/apps/dashboards/i18n/zh-TW.json index 2d4380f..3495a7b 100644 --- a/public/app/main/apps/dashboards/i18n/zh-TW.json +++ b/public/app/main/apps/dashboards/i18n/zh-TW.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "聯繫電話", "RECALLME_CALL_REMINDER": "Recall Me 來電提醒", "SCHEDULED_TIME": "計劃的時間", - "UPCOMING_RECALLME_CALL": "即將到來的 Recall Me 電話" + "UPCOMING_RECALLME_CALL": "即將到來的 Recall Me 電話", + "WAITING_CALLS": "等待電話", + "WAITING_INTERACTIONS": "等待互動" } } diff --git a/public/app/main/apps/fax/i18n/bs.json b/public/app/main/apps/fax/i18n/bs.json index bc9aa75..b099aa4 100644 --- a/public/app/main/apps/fax/i18n/bs.json +++ b/public/app/main/apps/fax/i18n/bs.json @@ -1,261 +1,261 @@ { "FAX": { - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme Pauze", + "DOWNLOAD_INTERACTION": "Skini", + "TRANSFER": "Prijenos", + "QUEUETRANSFER": "Queue Prijenos", + "QUEUETRANSFERTIMEOUT": "Timeout Queue Prijenosa", + "AGENTTRANSFER": "Prijenost Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Specijaliste", "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "VARIABLE": "Variable", - "CANNEDANSWERS": "Canned Answers", - "FAXCANNEDANSWERS": "Canned Answers", - "NO_FAXCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_FAXCANNEDANSWER": "New Canned Answer", - "ADD_FAXCANNEDANSWER": "Add Canned Answer", - "EDIT_CHATCANNEDANSWER": "Edit Canned Answer", - "DELETE_CHATCANNEDANSWER": "Delete Canned Answer", + "EDIT_TAG": "Uredi Tag", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog specijalistu", + "NOTIFICATION": "Notifikacija", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Protresi", + "NOTIFICATIONTEMPLATE": "Šablon", + "SYSTEM": "Sistem", + "EDIT_SYSTEM": "Uredi Sistem", + "COMMAND": "Komanda", + "VARIABLE": "Varijabla", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "FAXCANNEDANSWERS": "Pripremljeni Odgovori", + "NO_FAXCANNEDANSWER_AVAILABLE": "Nema dostupnih Pripremljenih odgovora", + "NEW_FAXCANNEDANSWER": "Novi Pripremljeni Odgovor", + "ADD_FAXCANNEDANSWER": "Dodaj Pripremljeni odgovor", + "EDIT_CHATCANNEDANSWER": "Uredi Pripremljeni Odgovor", + "DELETE_CHATCANNEDANSWER": "Izbriši Pripremljeni Odgovor", "SPYINTERACTION": "Spy", - "TAGS": "Tags", - "REPLY": "Reply", - "SEND": "Send", - "TO": "To", - "FROM": "From", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_FAXQUEUE": "Go To Realtime Fax Queue", - "EDIT_TRUNK": "Edit Trunk", - "REGISTERED": "Registered", - "UNREGISTERED": "Unregistered", - "EDIT_ACCOUNT": "Edit Fax Account", - "PARTIALPAUSE": "Partial Pause", - "BUSY": "Busy", + "TAGS": "Tag-ovi", + "REPLY": "Odgovori", + "SEND": "Pošalji", + "TO": "Do", + "FROM": "Od", + "NO_AGENT_ONLINE": "Nema Online Specijalista", + "GOTOREALTIME_FAXQUEUE": "Idi na Realtime Fax Queue", + "EDIT_TRUNK": "Uredi Trunk", + "REGISTERED": "Registrovano", + "UNREGISTERED": "Neregistrovano", + "EDIT_ACCOUNT": "Uredi Fax Nalog", + "PARTIALPAUSE": "Djelomična Pauza", + "BUSY": "Zauzet", "TIMER": "Timer", - "IDLE": "Idle", - "CAPACITY": "Capacity", - "GOTO_FAXACCOUNT": "Go To Realtime Fax", - "ACCOUNTS": "Accounts", - "GOTOREALTIME_FAXACCOUNT": "Go To Realtime Fax", - "TRUNK_STATUS": "Trunk Status", - "TRUNKS": "Trunks", - "REGISTRY": "Registry", - "NO_REGISTRY": "No Registry", - "PAUSE": "Pause", + "IDLE": "Neaktivan", + "CAPACITY": "Kapacitet", + "GOTO_FAXACCOUNT": "Idi na Realtime Fax", + "ACCOUNTS": "Nalozi", + "GOTOREALTIME_FAXACCOUNT": "Idi na Realtime Fax", + "TRUNK_STATUS": "Status Trunka", + "TRUNKS": "Trunk-ovi", + "REGISTRY": "Registar", + "NO_REGISTRY": "Nema Registra", + "PAUSE": "Pauza", "INFO": "Info", - "FULLNAME": "Fullname", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "LOGOUT": "Logout", - "DEFAULT_PAUSE": "Default pause", - "AGENTADD_QUEUE": "Add Agent to Fax queue", - "AGENTSADD_QUEUE": "Add Agents to Fax queue", - "UNPAUSE": "End Pause", - "AGENTS": "Agents", + "FULLNAME": "Puno ime", + "INTERNAL": "Unutrašnji", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", + "LOGOUT": "Odjava", + "DEFAULT_PAUSE": "Zadana pauza ", + "AGENTADD_QUEUE": "Dodaj Specijalistu na Fax Queue", + "AGENTSADD_QUEUE": "Dodaj Specijalistu na Fax Queue", + "UNPAUSE": "Prekini Pauzu", + "AGENTS": "Specijalisti", "QUEUES": "Queues", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", - "PRIORITY": "Priority", - "CONDITION": "Condition", - "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", - "VALUE": "Value", - "EDIT_FAXQUEUE": "Edit Fax Queue", - "EDIT_AGENT": "Edit Agent", - "EDIT_GOTO": "Edit Goto", - "EDIT_NOOP": "Edit Noop", - "EDIT_GOTOP": "Edit GotoP", - "EDIT_GOTOIF": "Edit GotoIf", - "EDIT_QUEUE": "Edit Fax Queue", - "EDIT_CLOSE": "Edit Close", + "LOGGED_IN": "Prijavljen", + "PAUSED": "Pauzirano", + "READY": "Spreman", + "WAITING": "Čeka", + "PRIORITY": "Prioritet", + "CONDITION": "Stanje", + "TRUEPRIORITY": "Tačan Prioritet", + "FALSEPRIORITY": "Pogrešan Prioritet", + "VALUE": "Vrijednost", + "EDIT_FAXQUEUE": "Uredi Fax Queue", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_GOTO": "Uredi Goto", + "EDIT_NOOP": "Uredi Noop", + "EDIT_GOTOP": "Uredi GoToP", + "EDIT_GOTOIF": "Uredi GoToIf", + "EDIT_QUEUE": "Uredi Fax Queue", + "EDIT_CLOSE": "Uredi Zatvaranje", "QUEUE": "Queue", "GOTOIF": "GotoIf", "GOTOP": "GotoP", "NOOP": "Noop", - "AGENT": "Agent", - "NOTES": "Notes", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", + "AGENT": "Specijalist", + "NOTES": "Bilješke", + "CLOSEDAT": "Zatvoreno U", + "DISPOSITION": "Dispozicija", "REALTIME": "Realtime", - "TEAMADD_FAXQUEUE": "Add Team to Fax Queue", - "AGENTADD_FAXQUEUE": "Add Agent to Fax Queue", - "NAME": "Name", + "TEAMADD_FAXQUEUE": "Dodaj Tim u Fax Queue", + "AGENTADD_FAXQUEUE": "Dodaj Specijalistu na Fax Queue", + "NAME": "Ime", "FAXQUEUES": "Fax Queues", - "SEARCH_FOR_ANYONE": "Search", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause status when in mandatory disposition", + "SEARCH_FOR_ANYONE": "Traži", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Status pauze kada je u obaveznoj dispoziciji", "ERRORS": { - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "COMMAND_REQUIRED": "Mandatory Field", - "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "TEXT_REQUIRED": "Mandatory Field", - "VALUE_REQUIRED": "Mandatory Field", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENT_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "PRIORITY_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", - "LOCALSTATIONID_REQUIRED": "Mandatory Field", - "MODEM_REQUIRED": "Mandatory Field", - "GATEWAY_REQUIRED": "Mandatory Field", - "FAXDETECT_REQUIRED": "Mandatory Field", - "T38TIMEOUT_REQUIRED": "Mandatory Field", - "TIMEOUT_REQUIRED": "Mandatory Field", - "HEADERINFO_REQUIRED": "Mandatory Field", - "TRUNK_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "You should specify a pause status when in mandatory disposition" + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednst mora bit manja od ili jednaka", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "TAG_REQUIRED": "Obavezno polje", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "COMMAND_REQUIRED": "Obavezno polje", + "TEXT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "TEXT_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "AGENT_REQUIRED": "Obavezno polje", + "QUEUE_REQUIRED": "Obavezno polje", + "TRUEPRIORITY_REQUIRED": "Obavezno polje", + "FALSEPRIORITY_REQUIRED": "Obavezno polje", + "CONDITION_REQUIRED": "Obavezno polje", + "PRIORITY_REQUIRED": "Obavezno polje", + "DISPOSITION_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno polje", + "MOTIONADDRESS_REQUIRED": "Obavezno polje", + "MOTIONADDRESS_MUST_VALID_URL": "Pogrešan format", + "LOCALSTATIONID_REQUIRED": "Obavezno polje", + "MODEM_REQUIRED": "Obavezno polje", + "GATEWAY_REQUIRED": "Obavezno polje", + "FAXDETECT_REQUIRED": "Obavezno polje", + "T38TIMEOUT_REQUIRED": "Obavezno polje", + "TIMEOUT_REQUIRED": "Obavezno polje", + "HEADERINFO_REQUIRED": "Obavezno polje", + "TRUNK_REQUIRED": "Obavezno polje", + "LIST_REQUIRED": "Obavezno polje", + "KEY_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "KEY_REQUIRED": "Obavezno polje", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Trebalo bi navesti status pauze kada je u obaveznoj dispoziciji" }, - "STRATEGY": "Strategy", - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "ADD_FAXQUEUE": "Add Fax Queue", - "DELETE_FAXQUEUE": "Delete Fax Queue", - "CREATED_AT": "Created At", - "SAVE": "Save", - "SETTINGS": "Settings", - "GENERAL": "General", - "FAXACCOUNTS": "Fax Accounts", - "MOTIONADDRESS": "Motion Address", - "ADD_FAXACCOUNT": "Add Fax Account", - "EDIT_FAXACCOUNT": "Edit Fax Account", - "DELETE_FAXACCOUNT": "Delete Fax Account", - "DISPOSITIONS": "Dispositions", + "STRATEGY": "Strategija", + "AGENT_TIMEOUT": "Specijalista Timeout", + "DESCRIPTION": "Opis", + "ADD_FAXQUEUE": "Dodaj Fax Queue", + "DELETE_FAXQUEUE": "Izbriši Fax Queue", + "CREATED_AT": "Kreirano U", + "SAVE": "Sačuvaj", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "FAXACCOUNTS": "Fax Nalozi", + "MOTIONADDRESS": "Motion Adresa", + "ADD_FAXACCOUNT": "Dodaj Fax Nalog", + "EDIT_FAXACCOUNT": "Uredi Fax Nalog", + "DELETE_FAXACCOUNT": "Izbriši Fax Nalog", + "DISPOSITIONS": "Dispozicije", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", - "LIST": "List", - "FIDELITY": "Fidelity", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", + "ACTIONS": "Radnje", + "LIST": "Lista", + "FIDELITY": "Vjernost", + "ACCEPT": "Prihvati", + "ACCEPTMETHOD": "Prihvati Metodu", + "ACCEPTURL": "Prihvati URL", + "REJECT": "Odbaci", + "REJECTMETHOD": "Metoda odbacivanja", + "REJECTURL": "Odbaci URL", + "CLOSE": "Zatvori", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", "TRUNK": "Trunk", - "LOCALSTATIONID": "Local Station Identifier", + "LOCALSTATIONID": "Identifikator Lokalne Stanice", "HELP": { - "LOCALSTATIONID": "Local Station Identifier (telephone number)", - "HEADERINFO": "Outbound Fax Header information", - "MODEM": "Modem Type (v17/v27/v29)", - "GATEWAY": "T.38 Fax Gateway, with optional fax activity timeout in seconds (yes/no/[timeout])", - "FAXDETECT": "Enable Fax Detect with optional timeout in seconds (yes/t38/cng/[timeout]/no)", - "T38TIMEOUT": "The timeout used for T.38 negotiation (minimum value=1000)", + "LOCALSTATIONID": "Identifikator Lokalne Stanice (telefonski broj)", + "HEADERINFO": "Informacije Zaglavlja Odlaznog Fax-a", + "MODEM": "Vrsta Modema (v17/v27/v29)", + "GATEWAY": "T.38 Fax Gateway, sa opcionalnim timeout-om aktivnosti faxa u sekundama (yes/no/[timeout])", + "FAXDETECT": "Omogući Otkrivanje Fax-a sa opcionalnim timeout-om u sekundama (yes/t38/cng/[timeout]/no)", + "T38TIMEOUT": "Vremensko ograničenje korišteno za T.38 pregovaranje (minimalna vrijednost=1000)", "ECM": "Error Connection Mode (ECM)", - "MINRATE": "Minimum transfer rate set before transmission", - "MAXRATE": "Maximum transfer rate set before transmission", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause status for mandatory disposition", - "NAME": "Only numbers, letters and specific characters (._) are supported" + "MINRATE": "Minimalna brzina prijenosa postavljena prije prijenosa", + "MAXRATE": "Maksimalna brzina prijenosa postavljena prije prijenosa", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Status pauze za obaveznu dispoziciju", + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)" }, - "ADVANCED": "Advanced", + "ADVANCED": "Napredno", "ECM": "ECM", - "MINRATE": "Min Rate", - "MAXRATE": "Max Rate", + "MINRATE": "Minimalna Brzina", + "MAXRATE": "Maksimalna Brzina", "MODEM": "Modem", "GATEWAY": "Gateway", - "FAXDETECT": "Fax Detect", + "FAXDETECT": "Fax Otkrivanje", "T38TIMEOUT": "T.38 Timeout", - "SIP": "Technology", - "HEADERINFO": "Header Info", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", + "SIP": "Tehnologija", + "HEADERINFO": "Informacije Zaglavlja", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "BACK": "Nazad", "FAX": "Fax", - "ID": "Id", + "ID": "ID", "TIMEOUT": "Timeout", - "FAXDISPOSITIONS": "Fax Dispositions", + "FAXDISPOSITIONS": "Fax Dispozicije", "NO_FAXDISPOSITION_AVAILABLE": "No Fax Dispositions available", - "NEW_FAXDISPOSITION": "New Fax Disposition", - "ADD_FAXDISPOSITION": "Add Fax Disposition", - "EDIT_FAXDISPOSITION": "Edit Fax Disposition", - "DELETE_FAXDISPOSITION": "Delete Fax Disposition", - "NEW_FAXQUEUE": "New Fax Queue", - "NEW_FAXACCOUNT": "New Fax Account", - "NO_AVAILABLE_INFO": "No available info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "DELETE": "Delete", - "KEY": "Key", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", + "NEW_FAXDISPOSITION": "Nova Fax Dispozicija", + "ADD_FAXDISPOSITION": "Dodaj Fax Dispoziciju", + "EDIT_FAXDISPOSITION": "Uredi Fax Dispoziciju", + "DELETE_FAXDISPOSITION": "Izbriši Fax Dispoziciju", + "NEW_FAXQUEUE": "Novi Fax Queue", + "NEW_FAXACCOUNT": "Novi Fax Nalog", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ALL_TEAMS": "Svi TImovi", + "SELECTED_TEAMS": "Odabrani Timovi", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "DELETE": "Izbriši", + "KEY": "Ključ", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", "FILTER": "Filter", - "SELECT_STATUS": "Select Status", - "ALL": "All", - "CLOSED": "Closed", - "OPENED": "Opened", - "SELECT_ACCOUNT": "Select Account", - "INTERACTIONS": "Interactions", - "CONTACT": "Contact", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", + "SELECT_STATUS": "Odaberi Status", + "ALL": "Svi", + "CLOSED": "Zatvoreno", + "OPENED": "Otvoreno", + "SELECT_ACCOUNT": "Odaberi Nalog", + "INTERACTIONS": "Interakcije", + "CONTACT": "Kontakt", + "STARTEDAT": "Počelo U", + "LASTMESSAGE": "Zadnja poruka", "STATUS": "Status", - "ACCOUNT": "Account", - "UNKNOWN": "Unknown", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", + "ACCOUNT": "Nalog", + "UNKNOWN": "Nepoznato", + "UNAVAILABLE": "Nedostupno", + "NOT_INUSE": "Nije u upotrebi", + "REACHABLE": "Dostupno", + "IN_USE": "U upotrebi", "VOICE": "Voice", "CHAT": "Chat", - "MAIL": "Email", + "MAIL": "E-mail", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", - "TOTAL": "Total", - "IN": "In", - "OUT": "Out", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "INTERACTIONS_FAXACCOUNT": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_FAXACCOUNT": "Add Agent to Fax Account", - "TEAMS_ASSOCIATION": "Teams Association", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments" + "OPENCHANNEL": "Otvoreni Kanal", + "TOTAL": "Ukupno", + "IN": "IN", + "OUT": "Van", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "INTERACTIONS_FAXACCOUNT": "Idi na Interakcije", + "REFRESH_INTERACTIONS": "Osvježi Interakcije", + "DELETE_INTERACTION": "Izbriši Interakciju", + "AGENTADD_FAXACCOUNT": "Dodaj Specijalistu na Fax Nalog", + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje Ekrana je u toku", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje Ekrana je dostupno", + "DOWNLOAD_WITH_ATTACHMENTS": "Skini sa prilogom", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Skini bez priloga" } } diff --git a/public/app/main/apps/fax/i18n/et.json b/public/app/main/apps/fax/i18n/et.json index fd6d9b8..13373f5 100644 --- a/public/app/main/apps/fax/i18n/et.json +++ b/public/app/main/apps/fax/i18n/et.json @@ -139,7 +139,8 @@ "LIST_REQUIRED": "Kohustuslik Väli", "KEY_MAX_LENGTH": "Väärtuse maksimaalne pikkus peab olema võrdne {{maks}}", "KEY_REQUIRED": "Kohustuslik Väli", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pead pausi oleku määrama, kui see on kohustuslik" + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pead pausi oleku määrama, kui see on kohustuslik", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Väärtus peab olema suurem või võrdne sellega" }, "STRATEGY": "Strateegia", "AGENT_TIMEOUT": "Agendi Aegumine", diff --git a/public/app/main/apps/fax/i18n/is.json b/public/app/main/apps/fax/i18n/is.json new file mode 100644 index 0000000..bc9aa75 --- /dev/null +++ b/public/app/main/apps/fax/i18n/is.json @@ -0,0 +1,261 @@ +{ + "FAX": { + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "DOWNLOAD_INTERACTION": "Download", + "TRANSFER": "Transfer", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "TAG": "Tag", + "EDIT_TAG": "Edit Tag", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "NOTIFICATION": "Notification", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONTEMPLATE": "Template", + "SYSTEM": "System", + "EDIT_SYSTEM": "Edit System", + "COMMAND": "Command", + "VARIABLE": "Variable", + "CANNEDANSWERS": "Canned Answers", + "FAXCANNEDANSWERS": "Canned Answers", + "NO_FAXCANNEDANSWER_AVAILABLE": "No Canned Answers Available", + "NEW_FAXCANNEDANSWER": "New Canned Answer", + "ADD_FAXCANNEDANSWER": "Add Canned Answer", + "EDIT_CHATCANNEDANSWER": "Edit Canned Answer", + "DELETE_CHATCANNEDANSWER": "Delete Canned Answer", + "SPYINTERACTION": "Spy", + "TAGS": "Tags", + "REPLY": "Reply", + "SEND": "Send", + "TO": "To", + "FROM": "From", + "NO_AGENT_ONLINE": "No Agent Online", + "GOTOREALTIME_FAXQUEUE": "Go To Realtime Fax Queue", + "EDIT_TRUNK": "Edit Trunk", + "REGISTERED": "Registered", + "UNREGISTERED": "Unregistered", + "EDIT_ACCOUNT": "Edit Fax Account", + "PARTIALPAUSE": "Partial Pause", + "BUSY": "Busy", + "TIMER": "Timer", + "IDLE": "Idle", + "CAPACITY": "Capacity", + "GOTO_FAXACCOUNT": "Go To Realtime Fax", + "ACCOUNTS": "Accounts", + "GOTOREALTIME_FAXACCOUNT": "Go To Realtime Fax", + "TRUNK_STATUS": "Trunk Status", + "TRUNKS": "Trunks", + "REGISTRY": "Registry", + "NO_REGISTRY": "No Registry", + "PAUSE": "Pause", + "INFO": "Info", + "FULLNAME": "Fullname", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "LOGOUT": "Logout", + "DEFAULT_PAUSE": "Default pause", + "AGENTADD_QUEUE": "Add Agent to Fax queue", + "AGENTSADD_QUEUE": "Add Agents to Fax queue", + "UNPAUSE": "End Pause", + "AGENTS": "Agents", + "QUEUES": "Queues", + "LOGGED_IN": "Logged in", + "PAUSED": "Paused", + "READY": "Ready", + "WAITING": "Waiting", + "PRIORITY": "Priority", + "CONDITION": "Condition", + "TRUEPRIORITY": "True Priority", + "FALSEPRIORITY": "False Priority", + "VALUE": "Value", + "EDIT_FAXQUEUE": "Edit Fax Queue", + "EDIT_AGENT": "Edit Agent", + "EDIT_GOTO": "Edit Goto", + "EDIT_NOOP": "Edit Noop", + "EDIT_GOTOP": "Edit GotoP", + "EDIT_GOTOIF": "Edit GotoIf", + "EDIT_QUEUE": "Edit Fax Queue", + "EDIT_CLOSE": "Edit Close", + "QUEUE": "Queue", + "GOTOIF": "GotoIf", + "GOTOP": "GotoP", + "NOOP": "Noop", + "AGENT": "Agent", + "NOTES": "Notes", + "CLOSEDAT": "Closed At", + "DISPOSITION": "Disposition", + "REALTIME": "Realtime", + "TEAMADD_FAXQUEUE": "Add Team to Fax Queue", + "AGENTADD_FAXQUEUE": "Add Agent to Fax Queue", + "NAME": "Name", + "FAXQUEUES": "Fax Queues", + "SEARCH_FOR_ANYONE": "Search", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause status when in mandatory disposition", + "ERRORS": { + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "COMMAND_REQUIRED": "Mandatory Field", + "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "TEXT_REQUIRED": "Mandatory Field", + "VALUE_REQUIRED": "Mandatory Field", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENT_REQUIRED": "Mandatory Field", + "QUEUE_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_REQUIRED": "Mandatory Field", + "FALSEPRIORITY_REQUIRED": "Mandatory Field", + "CONDITION_REQUIRED": "Mandatory Field", + "PRIORITY_REQUIRED": "Mandatory Field", + "DISPOSITION_REQUIRED": "Mandatory Field", + "NAME_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", + "LOCALSTATIONID_REQUIRED": "Mandatory Field", + "MODEM_REQUIRED": "Mandatory Field", + "GATEWAY_REQUIRED": "Mandatory Field", + "FAXDETECT_REQUIRED": "Mandatory Field", + "T38TIMEOUT_REQUIRED": "Mandatory Field", + "TIMEOUT_REQUIRED": "Mandatory Field", + "HEADERINFO_REQUIRED": "Mandatory Field", + "TRUNK_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "KEY_REQUIRED": "Mandatory Field", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "You should specify a pause status when in mandatory disposition" + }, + "STRATEGY": "Strategy", + "AGENT_TIMEOUT": "Agent Timeout", + "DESCRIPTION": "Description", + "ADD_FAXQUEUE": "Add Fax Queue", + "DELETE_FAXQUEUE": "Delete Fax Queue", + "CREATED_AT": "Created At", + "SAVE": "Save", + "SETTINGS": "Settings", + "GENERAL": "General", + "FAXACCOUNTS": "Fax Accounts", + "MOTIONADDRESS": "Motion Address", + "ADD_FAXACCOUNT": "Add Fax Account", + "EDIT_FAXACCOUNT": "Edit Fax Account", + "DELETE_FAXACCOUNT": "Delete Fax Account", + "DISPOSITIONS": "Dispositions", + "WEBHOOKS": "WebHooks", + "ACTIONS": "Actions", + "LIST": "List", + "FIDELITY": "Fidelity", + "ACCEPT": "Accept", + "ACCEPTMETHOD": "Accept Method", + "ACCEPTURL": "Accept URL", + "REJECT": "Reject", + "REJECTMETHOD": "Reject Method", + "REJECTURL": "Reject URL", + "CLOSE": "Close", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "TRUNK": "Trunk", + "LOCALSTATIONID": "Local Station Identifier", + "HELP": { + "LOCALSTATIONID": "Local Station Identifier (telephone number)", + "HEADERINFO": "Outbound Fax Header information", + "MODEM": "Modem Type (v17/v27/v29)", + "GATEWAY": "T.38 Fax Gateway, with optional fax activity timeout in seconds (yes/no/[timeout])", + "FAXDETECT": "Enable Fax Detect with optional timeout in seconds (yes/t38/cng/[timeout]/no)", + "T38TIMEOUT": "The timeout used for T.38 negotiation (minimum value=1000)", + "ECM": "Error Connection Mode (ECM)", + "MINRATE": "Minimum transfer rate set before transmission", + "MAXRATE": "Maximum transfer rate set before transmission", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause status for mandatory disposition", + "NAME": "Only numbers, letters and specific characters (._) are supported" + }, + "ADVANCED": "Advanced", + "ECM": "ECM", + "MINRATE": "Min Rate", + "MAXRATE": "Max Rate", + "MODEM": "Modem", + "GATEWAY": "Gateway", + "FAXDETECT": "Fax Detect", + "T38TIMEOUT": "T.38 Timeout", + "SIP": "Technology", + "HEADERINFO": "Header Info", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "BACK": "Back", + "FAX": "Fax", + "ID": "Id", + "TIMEOUT": "Timeout", + "FAXDISPOSITIONS": "Fax Dispositions", + "NO_FAXDISPOSITION_AVAILABLE": "No Fax Dispositions available", + "NEW_FAXDISPOSITION": "New Fax Disposition", + "ADD_FAXDISPOSITION": "Add Fax Disposition", + "EDIT_FAXDISPOSITION": "Edit Fax Disposition", + "DELETE_FAXDISPOSITION": "Delete Fax Disposition", + "NEW_FAXQUEUE": "New Fax Queue", + "NEW_FAXACCOUNT": "New Fax Account", + "NO_AVAILABLE_INFO": "No available info", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "DELETE": "Delete", + "KEY": "Key", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "FILTER": "Filter", + "SELECT_STATUS": "Select Status", + "ALL": "All", + "CLOSED": "Closed", + "OPENED": "Opened", + "SELECT_ACCOUNT": "Select Account", + "INTERACTIONS": "Interactions", + "CONTACT": "Contact", + "STARTEDAT": "Started At", + "LASTMESSAGE": "Last message", + "STATUS": "Status", + "ACCOUNT": "Account", + "UNKNOWN": "Unknown", + "UNAVAILABLE": "Unavailable", + "NOT_INUSE": "Not in use", + "REACHABLE": "Reachable", + "IN_USE": "In use", + "VOICE": "Voice", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "SMS", + "OPENCHANNEL": "Open Channel", + "TOTAL": "Total", + "IN": "In", + "OUT": "Out", + "NO_INTERACTION_AVAILABLE": "No interactions available", + "INTERACTIONS_FAXACCOUNT": "Go to Interactions", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "DELETE_INTERACTION": "Delete Interaction", + "AGENTADD_FAXACCOUNT": "Add Agent to Fax Account", + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments" + } +} diff --git a/public/app/main/apps/help/i18n/bs.json b/public/app/main/apps/help/i18n/bs.json index 4c1be43..33cd974 100644 --- a/public/app/main/apps/help/i18n/bs.json +++ b/public/app/main/apps/help/i18n/bs.json @@ -1,8 +1,8 @@ { "HELP": { - "ABOUT": "About", - "CONTACT_US": "Contact us", - "HELP": "Help", - "USEFUL_LINKS": "Useful links" + "ABOUT": "O nama", + "CONTACT_US": "Kontaktiraj nas", + "HELP": "Pomoć", + "USEFUL_LINKS": "Korisni linkovi" } } diff --git a/public/app/main/apps/help/i18n/is.json b/public/app/main/apps/help/i18n/is.json new file mode 100644 index 0000000..4c1be43 --- /dev/null +++ b/public/app/main/apps/help/i18n/is.json @@ -0,0 +1,8 @@ +{ + "HELP": { + "ABOUT": "About", + "CONTACT_US": "Contact us", + "HELP": "Help", + "USEFUL_LINKS": "Useful links" + } +} diff --git a/public/app/main/apps/integrations/i18n/bs.json b/public/app/main/apps/integrations/i18n/bs.json index da1fa10..74cee29 100644 --- a/public/app/main/apps/integrations/i18n/bs.json +++ b/public/app/main/apps/integrations/i18n/bs.json @@ -1,252 +1,252 @@ { "INTEGRATIONS": { - "ZONE": "Zone", - "ADVANCED": "Advanced", - "MODULE_SEARCH": "Module Search", - "MODULE_CREATE": "Module Create", + "ZONE": "Zona", + "ADVANCED": "Napredno", + "MODULE_SEARCH": "Modul Traži", + "MODULE_CREATE": "Modul kreiraj", "LEADS": "Lead", - "CONTACTS": "Contact", - "INTEGRATIONS": "Integrations", - "ZENDESKACCOUNTS": "Zendesk Accounts", - "ID": "Id", - "NAME": "Name", - "USERNAME": "Username", + "CONTACTS": "Kontakt", + "INTEGRATIONS": "Integracije", + "ZENDESKACCOUNTS": "Zendesk Nalozi", + "ID": "ID", + "NAME": "Ime", + "USERNAME": "Korisničko ime", "URI": "URL", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "EDIT_ZENDESKACCOUNT": "Edit Zendesk Account", - "DELETE_ZENDESKACCOUNT": "Delete Zendesk Account", - "NEW_ZENDESKACCOUNT": "New Zendesk Account", - "AUTHTYPE": "Authentication Type", - "PASSWORD": "Password", - "CONFIRM_PASSWORD": "Confirm Password", - "EMAIL": "Email", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "EDIT_ZENDESKACCOUNT": "Uredi Zendesk Nalog", + "DELETE_ZENDESKACCOUNT": "Izbriši Zendesk Nalo", + "NEW_ZENDESKACCOUNT": "Novi Zendesk Nalog", + "AUTHTYPE": "Vrsta Ovjere", + "PASSWORD": "Lozinka", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "EMAIL": "E-mail", "TOKEN": "Token", - "MOTIONPROXYADDRESS": "Motion or Proxy IP Address", - "DESCRIPTION": "Description", - "ADD_ZENDESKACCOUNT": "Add Zendesk Account", + "MOTIONPROXYADDRESS": "Motion ili Proxy IP Adresa", + "DESCRIPTION": "Opis", + "ADD_ZENDESKACCOUNT": "Dodaj Zendesk Nalog", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field", - "URI_REQUIRED": "Mandatory field", - "URI_MUST_VALID_URL": "Wrong format", - "PASSWORD_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "TOKEN_REQUIRED": "Mandatory field", - "MOTIONPROXYADDRESS_MUST_VALID_URL": "Wrong format", - "CLIENTID_REQUIRED": "Mandatory field", - "CLIENTSECRET_REQUIRED": "Mandatory field", - "SECURITYTOKEN_REQUIRED": "Mandatory field", - "APIKEY_REQUIRED": "Mandatory field", - "CONTENT_REQUIRED": "Mandatory field", - "VARIABLENAME_REQUIRED": "Mandatory field", - "KEY_REQUIRED": "Mandatory field", - "TYPE_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field", - "CONSUMERKEY_REQUIRED": "Mandatory field", - "CONSUMERSECRET_REQUIRED": "Mandatory field", - "TOKENSECRET_REQUIRED": "Mandatory field", - "HOST_REQUIRED": "Mandatory field", - "AUTHTOKEN_REQUIRED": "Mandatory field", - "VTIGER_USER_NAME_REQUIRED": "Mandatory field", - "ACCESS_KEY_REQUIRED": "Mandatory field", - "EMAIL_REQUIRED": "Mandatory field", - "TENANTID_REQUIRED": "Mandatory field", - "CODE_REQUIRED": "Mandatory field", - "MOTIONPROXYADDRESS_REQUIRED": "Mandatory field", - "MODULECREATE_REQUIRED": "Mandatory field" + "NAME_REQUIRED": "Obavezno polje", + "USERNAME_REQUIRED": "Obavezno polje", + "URI_REQUIRED": "Obavezno polje", + "URI_MUST_VALID_URL": "Pogrešan format", + "PASSWORD_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinke se ne slažu", + "TOKEN_REQUIRED": "Obavezno polje", + "MOTIONPROXYADDRESS_MUST_VALID_URL": "Pogrešan format", + "CLIENTID_REQUIRED": "Obavezno polje", + "CLIENTSECRET_REQUIRED": "Obavezno polje", + "SECURITYTOKEN_REQUIRED": "Obavezno polje", + "APIKEY_REQUIRED": "Obavezno polje", + "CONTENT_REQUIRED": "Obavezno polje", + "VARIABLENAME_REQUIRED": "Obavezno polje", + "KEY_REQUIRED": "Obavezno polje", + "TYPE_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "FIELD_REQUIRED": "Obavezno polje", + "CONSUMERKEY_REQUIRED": "Obavezno polje", + "CONSUMERSECRET_REQUIRED": "Obavezno polje", + "TOKENSECRET_REQUIRED": "Obavezno polje", + "HOST_REQUIRED": "Obavezno polje", + "AUTHTOKEN_REQUIRED": "Obavezno polje", + "VTIGER_USER_NAME_REQUIRED": "Obavezno polje", + "ACCESS_KEY_REQUIRED": "Obavezno polje", + "EMAIL_REQUIRED": "Obavezno polje", + "TENANTID_REQUIRED": "Obavezno polje", + "CODE_REQUIRED": "Obavezno polje", + "MOTIONPROXYADDRESS_REQUIRED": "Obavezno polje", + "MODULECREATE_REQUIRED": "Obavezno polje" }, "HELP": { - "MOTIONPROXYADDRESS": "Motion (Proxy) Address: it is reqired if you want to fill the ticket body with Recording URL. Enter the address in the following format: : //[:]. Example: https://X.Y.Z.W", - "TICKETTYPE": "Ticket Type", - "ZONE": "Choose your geographic zone (US, AU, EU, IN, CN) to activate the domain-specific Zoho Accounts", - "CLIENTID": "The specific CLient Id of your application", - "CLIENTSECRET": "The specific CLientSecret of your application", - "CODE": "The specific code generated through Developer Console", - "REFRESHTOKEN": "The automatically generated refresh token used to refresh expired access tokens. Also the access token are automatically generated each time an api is launched.", - "LEADID": "Field name used to link Case and Lead objects", - "ADDITIONALSEARCHACCOUNT": "Additional field name used to search customer phone number in Accounts", - "ADDITIONALSEARCHCONTACT": "Additional field name used to search customer phone number in Contacts", - "ADDITIONALSEARCHLEAD": "Additional field name used to search customer phone number in Leads", - "MODERN_AUTHENTICATION": "Switch to enable Modern Authentication" + "MOTIONPROXYADDRESS": "Motion (Proxy) Adresa: je potrebna ako želiš popuniti tijelo tiketa sa URL-om Snimka. Unesi adresu u sljedećem formatu: : //[:]. Primjer: https://X.Y.Z.W", + "TICKETTYPE": "Tiket Vrsta", + "ZONE": "Odaberi svoju geografsku zonu (US, AU, EU, IN, CN) da aktiviraš Zoho Naloge specifične za domenu", + "CLIENTID": "Specifični Stranka ID u aplikaciji", + "CLIENTSECRET": "Specifični Stranka Tajna u aplikaciji", + "CODE": "Specifična šifra generisana preko Developer Konzole", + "REFRESHTOKEN": "Automatski generisani token za osvježavanje koji se koristi za osvježavanje isteklih token pristupa. Također, pristupni token se automatski generiše svaki put kada se API pokrene.", + "LEADID": "Naziv polja koje se koristi za povezivanje Case i Lead predmeta", + "ADDITIONALSEARCHACCOUNT": "Dodatni naziv polja koji se koristi za pretraživanje broja telefona u Računima", + "ADDITIONALSEARCHCONTACT": "Dodatni naziv polja koji se koristi za pretraživanje broja telefona u Kontaktima", + "ADDITIONALSEARCHLEAD": "Dodatni naziv polja koji se koristi za pretraživanje broja telefona u Leads-ima", + "MODERN_AUTHENTICATION": "Uključi da bi omogućio Modernu Autentifikaciju" }, - "MODULECREATE": "Module create", - "CODE": "Developer Console Code", - "REFRESHTOKEN": "Refresh Token (generated)", - "ACCOUNT": "Account", - "ZENDESKCONFIGURATIONS": "Zendesk Configurations", - "SALESFORCECONFIGURATIONS": "Salesforce Configurations", - "SUGARCRMCONFIGURATIONS": "SugarCRM Configurations", - "FRESHDESKCONFIGURATIONS": "Freshdesk Configurations", - "GENERAL": "General", - "CREATED_AT": "Created At", - "SAVE": "Save", - "NO_ZENDESKCONFIGURATION_AVAILABLE": "No Zendesk Configurations available", - "NEW_ZENDESKCONFIGURATION": "New Zendesk Configuration", - "ADD_ZENDESKCONFIGURATION": "Add Zendesk Configuration", - "EDIT_ZENDESKCONFIGURATION": "Edit Zendesk Configuration", - "DELETE_ZENDESKCONFIGURATION": "Delete Zendesk Configuration", - "NO_SALESFORCECONFIGURATION_AVAILABLE": "No Salesforce Configurations available", - "NEW_SALESFORCECONFIGURATION": "New Salesforce Configuration", - "ADD_SALESFORCECONFIGURATION": "Add Salesforce Configuration", - "EDIT_SALESFORCECONFIGURATION": "Edit Salesforce Configuration", - "DELETE_SALESFORCECONFIGURATION": "Delete Salesforce Configuration", - "NO_SUGARCRMCONFIGURATION_AVAILABLE": "No SugarCRM Configurations available", - "NEW_SUGARCRMCONFIGURATION": "New SugarCRM Configuration", - "ADD_SUGARCRMCONFIGURATION": "Add SugarCRM Configuration", - "EDIT_SUGARCRMCONFIGURATION": "Edit SugarCRM Configuration", - "DELETE_SUGARCRMCONFIGURATION": "Delete SugarCRM Configuration", - "NO_FRESHDESKCONFIGURATION_AVAILABLE": "No Freshdesk Configurations available", - "NEW_FRESHDESKCONFIGURATION": "New Freshdesk Configuration", - "ADD_FRESHDESKCONFIGURATION": "Add Freshdesk Configuration", - "EDIT_FRESHDESKCONFIGURATION": "Edit Freshdesk Configuration", - "DELETE_FRESHDESKCONFIGURATION": "Delete Freshdesk Configuration", - "SALESFORCEACCOUNTS": "Salesforce Accounts", - "EDIT_SALESFORCEACCOUNT": "Edit Salesforce Account", - "DELETE_SALESFORCEACCOUNT": "Delete Salesforce Account", - "NEW_SALESFORCEACCOUNT": "New Salesforce Account", - "ADD_SALESFORCEACCOUNT": "Add Salesforce Account", - "CLIENTID": "Client ID", - "CLIENTSECRET": "Client Secret", - "SECURITYTOKEN": "Security Token", - "SEARCH_FOR_ANYONE": "Search", - "APIKEY": "Api Key", - "FRESHDESKACCOUNTS": "Freshdesk Accounts", - "EDIT_FRESHDESKACCOUNT": "Edit Freshdesk Account", - "DELETE_FRESHDESKACCOUNT": "Delete Freshdesk Account", - "NEW_FRESHDESKACCOUNT": "New Freshdesk Account", - "ADD_FRESHDESKACCOUNT": "Add Freshdesk Account", - "SUGARCRMACCOUNTS": "SugarCRM Accounts", - "EDIT_SUGARCRMACCOUNT": "Edit SugarCRM Account", - "DELETE_SUGARCRMACCOUNT": "Delete SugarCRM Account", - "NEW_SUGARCRMACCOUNT": "New SugarCRM Account", - "ADD_SUGARCRMACCOUNT": "Add SugarCRM Account", - "CONFIGURATIONS": "Configurations", - "NO_CONFIGURATION_AVAILABLE": "No Configurations available", - "NEW_CONFIGURATION": "New Configuration", - "ADD_CONFIGURATION": "Add Configuration", - "EDIT_CONFIGURATION": "Edit Configuration", - "DELETE_CONFIGURATION": "Delete Configuration", - "SUBJECTS": "Subjects", - "DESCRIPTIONS": "Descriptions", - "FIELDS": "Fields", - "TAGS": "Tags", - "TYPE": "Type", - "CONTENT": "Content", - "EDIT_SUBJECT": "Edit Subject", - "DELETE_SUBJECT": "Delete Subject", - "NEW_SUBJECT": "New Subject", - "ADD_SUBJECT": "Add Subject", - "EDIT_DESCRIPTION": "Edit Description", - "DELETE_DESCRIPTION": "Delete Description", - "NEW_DESCRIPTION": "New Description", - "ADD_DESCRIPTION": "Add Description", - "EDIT_FIELD": "Edit Field", - "DELETE_FIELD": "Delete Field", - "NEW_FIELD": "New Field", - "ADD_FIELD": "Add Field", - "ADD": "Add", + "MODULECREATE": "Modul kreiraj", + "CODE": "Šifra Developer Konzole", + "REFRESHTOKEN": "Osvježi Token (generisan)", + "ACCOUNT": "Nalog", + "ZENDESKCONFIGURATIONS": "Zendesk Konfiguracije", + "SALESFORCECONFIGURATIONS": "Salesforce Konfiguracije", + "SUGARCRMCONFIGURATIONS": "SugarCRM Konfiguracije", + "FRESHDESKCONFIGURATIONS": "Freshdesk Konfiguracije", + "GENERAL": "Općenito", + "CREATED_AT": "Kreirano U", + "SAVE": "Sačuvaj", + "NO_ZENDESKCONFIGURATION_AVAILABLE": "Nema dostupnih Zendesk Konfiguracija", + "NEW_ZENDESKCONFIGURATION": "Nova Zendesk Konfiguracija", + "ADD_ZENDESKCONFIGURATION": "Dodaj Zendesk Konfiguraciju", + "EDIT_ZENDESKCONFIGURATION": "Uredi Zendesk Konfiguraciju", + "DELETE_ZENDESKCONFIGURATION": "Izbriši Zendesk Konfiguraciju", + "NO_SALESFORCECONFIGURATION_AVAILABLE": "Nema dostupnih Salesforce Konfiguracija", + "NEW_SALESFORCECONFIGURATION": "Nova Salesforce Konfiguracija", + "ADD_SALESFORCECONFIGURATION": "Dodaj Salesforce Konfiguraciju", + "EDIT_SALESFORCECONFIGURATION": "Uredi Salesforce Konfiguraciju", + "DELETE_SALESFORCECONFIGURATION": "Izbriši Salesforce Konfiguraciju", + "NO_SUGARCRMCONFIGURATION_AVAILABLE": "Nema dostupnih SugarCRM Konfiguracija", + "NEW_SUGARCRMCONFIGURATION": "Nova SugarCRM Konfiguracija", + "ADD_SUGARCRMCONFIGURATION": "Dodaj SugarCRM Konfiguraciju", + "EDIT_SUGARCRMCONFIGURATION": "Uredi SugarCRM Konfiguraciju", + "DELETE_SUGARCRMCONFIGURATION": "Izbriši SugarCRM Konfiguraciju", + "NO_FRESHDESKCONFIGURATION_AVAILABLE": "Nema dostupnih Freshdesk Konfiguracija", + "NEW_FRESHDESKCONFIGURATION": "Nova Freshdesk Konfiguracija", + "ADD_FRESHDESKCONFIGURATION": "Dodaj Freshdesk Konfiguraciju", + "EDIT_FRESHDESKCONFIGURATION": "Uredi Freshdesk Konfiguraciju", + "DELETE_FRESHDESKCONFIGURATION": "Izbriši Freshdesk Konfiguraciju", + "SALESFORCEACCOUNTS": "Salesforce Nalozi", + "EDIT_SALESFORCEACCOUNT": "Uredi Salesforce Nalog", + "DELETE_SALESFORCEACCOUNT": "Izbriši Salesforce Nalog", + "NEW_SALESFORCEACCOUNT": "Novi Salesforce Nalog", + "ADD_SALESFORCEACCOUNT": "Dodaj Salesforce Nalog", + "CLIENTID": "Stranka ID", + "CLIENTSECRET": "Stranka Tajna", + "SECURITYTOKEN": "Sigurnosni Token", + "SEARCH_FOR_ANYONE": "Traži", + "APIKEY": "API Ključ", + "FRESHDESKACCOUNTS": "Freshdesk Nalozi", + "EDIT_FRESHDESKACCOUNT": "Uredi Freshdesk Nalog", + "DELETE_FRESHDESKACCOUNT": "Izbriši Freshdesk Nalog", + "NEW_FRESHDESKACCOUNT": "Novi Freshdesk Nalog", + "ADD_FRESHDESKACCOUNT": "Dodaj Freshdesk Nalog", + "SUGARCRMACCOUNTS": "SugarCRM Nalozi", + "EDIT_SUGARCRMACCOUNT": "Uredi SugarCRM Nalog", + "DELETE_SUGARCRMACCOUNT": "Izbriši SugarCRM Nalog", + "NEW_SUGARCRMACCOUNT": "Novi SugarCRM Nalog", + "ADD_SUGARCRMACCOUNT": "Dodaj SugarCRM Nalog", + "CONFIGURATIONS": "Konfiguracije", + "NO_CONFIGURATION_AVAILABLE": "Nema dostupnih konfiguracija", + "NEW_CONFIGURATION": "Nova Konfiguracija", + "ADD_CONFIGURATION": "Dodaj Konfiguraciju", + "EDIT_CONFIGURATION": "Uredi Konfiguraciju", + "DELETE_CONFIGURATION": "Izbriši Konfiguraciju", + "SUBJECTS": "Predmeti", + "DESCRIPTIONS": "Opisi", + "FIELDS": "Polja", + "TAGS": "Tag-ovi", + "TYPE": "Vrsta", + "CONTENT": "Sadržaj", + "EDIT_SUBJECT": "Uredi Predmet", + "DELETE_SUBJECT": "Izbriši Predmet", + "NEW_SUBJECT": "Nova Tema", + "ADD_SUBJECT": "Dodaj Predmet", + "EDIT_DESCRIPTION": "Uredi Opis", + "DELETE_DESCRIPTION": "Izbriši Opis", + "NEW_DESCRIPTION": "Novi Opis", + "ADD_DESCRIPTION": "Dodaj Opis", + "EDIT_FIELD": "Uredi Polje", + "DELETE_FIELD": "Izbriši Polje", + "NEW_FIELD": "Novo Polje", + "ADD_FIELD": "Dodaj Polje", + "ADD": "Dodaj", "VOICE": "Voice", - "MAIL": "Email", + "MAIL": "E-mail", "CHAT": "Chat", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", - "INBOUND_IN_QUEUE": "Inbound in Queue", - "OUTBOUND_CALL": "Outbound Call", - "VALUE": "Value", - "FIELD": "Field", - "KEY": "Key", - "CHANNEL": "Channel", - "DELETE": "Delete", - "NO_AVAILABLE_INFO": "No available info", - "TEST_ZENDESKACCOUNT": "Test Zendesk Account", - "TEST_FRESHDESKACCOUNT": "Test Freshdesk Account", - "TEST_SUGARCRMACCOUNT": "Test SugerCRM Account", - "TEST_SALESFORCEACCOUNT": "Test Salesforce Account", - "INTEGRATION_TAB": "Integration Tab", - "NEW_TAB": "New Tab", - "DESKACCOUNTS": "Desk Accounts", - "EDIT_DESKACCOUNT": "Edit Desk Account", - "TEST_DESKACCOUNT": "Test Desk Account", - "DELETE_DESKACCOUNT": "Delete Desk Account", - "CONSUMERKEY": "Consumer Key", - "CONSUMERSECRET": "Consumer Secret", - "TOKENSECRET": "Token Secret", - "ADD_DESKACCOUNT": "Add Desk Account", - "NEW_DESKACCOUNT": "New Desk Account", - "ADD_DESKCONFIGURATION": "Add Desk Configuration", - "NEW_DESKCONFIGURATION": "New Desk Configuration", - "DELETE_DESKCONFIGURATION": "Delete Desk Configuration", - "ZOHOACCOUNTS": "Zoho Accounts", - "EDIT_ZOHOACCOUNT": "Edit Zoho Account", - "TEST_ZOHOACCOUNT": "Test Zoho Account", - "DELETE_ZOHOACCOUNT": "Delete Zoho Account", - "ADD_ZOHOACCOUNT": "Add Zoho Account", - "NEW_ZOHOACCOUNT": "New Zoho Account", - "ADD_ZOHOCONFIGURATION": "Add Zoho Configuration", - "NEW_ZOHOCONFIGURATION": "New Zoho Configuration", - "AUTHTOKEN": "Authorization Token", + "OPENCHANNEL": "Otvoreni Kanal", + "INBOUND_IN_QUEUE": "Dolazni u Queue", + "OUTBOUND_CALL": "Odlazni Poziv", + "VALUE": "Vrijednost", + "FIELD": "Polje", + "KEY": "Ključ", + "CHANNEL": "Kanal", + "DELETE": "Izbriši", + "NO_AVAILABLE_INFO": "Nema dostupnih podataka", + "TEST_ZENDESKACCOUNT": "Testiraj Zendesk Nalog", + "TEST_FRESHDESKACCOUNT": "Testiraj Freshdesk Nalog", + "TEST_SUGARCRMACCOUNT": "Testiraj SugarCRM Nalog", + "TEST_SALESFORCEACCOUNT": "Testiraj Salesforce Nalog", + "INTEGRATION_TAB": "Integracija Tab", + "NEW_TAB": "Novi Tab", + "DESKACCOUNTS": "Desk Nalozi", + "EDIT_DESKACCOUNT": "Uredi Desk Nalog", + "TEST_DESKACCOUNT": "Testiraj Desk Nalog", + "DELETE_DESKACCOUNT": "Izbriši Desk Nalog", + "CONSUMERKEY": "Ključ Potrošača", + "CONSUMERSECRET": "Porošač Tajna", + "TOKENSECRET": "Token Tajni", + "ADD_DESKACCOUNT": "Dodaj Desk nalog", + "NEW_DESKACCOUNT": "Novi Desk nalog", + "ADD_DESKCONFIGURATION": "Dodaj Desk Konfiguraciju", + "NEW_DESKCONFIGURATION": "Nova Desk Konfiguracija", + "DELETE_DESKCONFIGURATION": "Izbriši Desk Konfiguraciju", + "ZOHOACCOUNTS": "Zoho Nalozi", + "EDIT_ZOHOACCOUNT": "Uredi Zoho Nalog", + "TEST_ZOHOACCOUNT": "Testiraj Zoho Nalog", + "DELETE_ZOHOACCOUNT": "Izbriši Zoho Nalog", + "ADD_ZOHOACCOUNT": "DOdaj Zoho Nalog", + "NEW_ZOHOACCOUNT": "Novi Zoho Nalog", + "ADD_ZOHOCONFIGURATION": "Dodaj Zoho Konfiguraciju", + "NEW_ZOHOCONFIGURATION": "Nova Zoho Konfiguracija", + "AUTHTOKEN": "Autorizacijski Token", "HOST": "Host", - "DELETE_ZOHOCONFIGURATION": "Delete Zoho Configuration", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "VTIGERACCOUNTS": "vTiger Accounts", - "VTIGER_USER_NAME": "vTiger User Name", - "MODULE_NAME": "vTiger Module Name", - "ACCESS_KEY": "vTiger Access Key", - "ADD_VTIGERACCOUNT": "Add new vTiger Account", - "EDIT_VTIGERACCOUNT": "Edit vTiger Account", - "TEST_VTIGERACCOUNT": "Test vTiger Account", - "DELETE_VTIGERACCOUNT": "Delete vTiger Account", - "NEW_VTIGERACCOUNT": "New vTiger Account", - "NEW_VTIGERCONFIGURATION": "Create vTiger Configuration", - "DELETE_VTIGERCONFIGURATION": "Delete vTiger Configuration", - "ADD_VTIGERCONFIGURATION": "Add vTiger Configuration", - "FRESHSALESACCOUNTS": "Freshsales Accounts", - "EDIT_FRESHSALESACCOUNT": "Edit Freshsales Account", - "DELETE_FRESHSALESACCOUNT": "Delete Freshsales Account", - "NEW_FRESHSALESACCOUNT": "New Freshsales Account", - "ADD_FRESHSALESACCOUNT": "Add Freshsales Account", - "NO_FRESHSALESCONFIGURATION_AVAILABLE": "No Freshsales Configurations available", - "NEW_FRESHSALESCONFIGURATION": "New Freshsales Configuration", - "ADD_FRESHSALESCONFIGURATION": "Add Freshsales Configuration", - "EDIT_FRESHSALESCONFIGURATION": "Edit Freshsales Configuration", - "DELETE_FRESHSALESCONFIGURATION": "Delete Freshsales Configuration", - "TEST_FRESHSALESACCOUNT": "Test Freshsales Account", - "SERVICENOWACCOUNTS": "ServiceNow Accounts", - "ADD_SERVICENOWACCOUNT": "Add new ServiceNow Account", - "EDIT_SERVICENOWACCOUNT": "Edit ServiceNow Account", - "TEST_SERVICENOWACCOUNT": "Test ServiceNow Account", - "DELETE_SERVICENOWACCOUNT": "Delete ServiceNow Account", - "NEW_SERVICENOWACCOUNT": "New ServiceNow Account", - "NEW_SERVICENOWCONFIGURATION": "Create ServiceNow Configuration", - "DELETE_SERVICENOWCONFIGURATION": "Delete ServiceNow Configuration", - "ADD_SERVICENOWCONFIGURATION": "Add ServiceNow Configuration", - "DYNAMICS365ACCOUNTS": "Dynamics365 Accounts", - "TENANTID": "Tenant Id", - "ADD_DYNAMICS365ACCOUNT": "Add new Dynamics365 Account", - "EDIT_DYNAMICS365ACCOUNT": "Edit Dynamics365 Account", - "TEST_DYNAMICS365ACCOUNT": "Test Dynamics365 Account", - "DELETE_DYNAMICS365ACCOUNT": "Delete Dynamics365 Account", - "NEW_DYNAMICS365ACCOUNT": "New Dynamics365 Account", - "NEW_DYNAMICS365CONFIGURATION": "Create Dynamics365 Configuration", - "DELETE_DYNAMICS365CONFIGURATION": "Delete Dynamics365 Configuration", - "ADD_DYNAMICS365CONFIGURATION": "Add Dynamics365 Configuration", - "TICKETTYPE": "Ticket Type", - "CASE": "Case", - "LEADID": "Lead Id", - "ADDITIONALSEARCHACCOUNT": "Additional Search Account", - "ADDITIONALSEARCHCONTACT": "Additional Search Contact", - "ADDITIONALSEARCHLEAD": "Additional Search Lead", - "PHONECALL": "Phonecall", - "TASK": "Task", - "DYNAMIC365CONTACT": "Contact", - "DYNAMIC365NOTHING": "Nothing", - "MODERN_AUTHENTICATION": "Modern Authentication", - "OPENNEWTAB": "Open new tab" + "DELETE_ZOHOCONFIGURATION": "Izbriši Zoho Konfiguraciju", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "VTIGERACCOUNTS": "vTiger Nalozi", + "VTIGER_USER_NAME": "vTiger Korisničko Ime", + "MODULE_NAME": "vTiger Modul Naziv", + "ACCESS_KEY": "vTiger Pristupni Ključ", + "ADD_VTIGERACCOUNT": "Dodaj novi vTiger Nalog", + "EDIT_VTIGERACCOUNT": "Uredi vTiger Nalog", + "TEST_VTIGERACCOUNT": "Testiraj vTiger Nalog", + "DELETE_VTIGERACCOUNT": "Izbriši vTiger Nalog", + "NEW_VTIGERACCOUNT": "Novi vTiger Nalog", + "NEW_VTIGERCONFIGURATION": "Nova vTiger Konfiguracija", + "DELETE_VTIGERCONFIGURATION": "Izbriši vTiger Konfiguraciju", + "ADD_VTIGERCONFIGURATION": "Dodaj vTiger Konfiguraciju", + "FRESHSALESACCOUNTS": "Freshsales Nalozi", + "EDIT_FRESHSALESACCOUNT": "Uredi Freshsales Nalog", + "DELETE_FRESHSALESACCOUNT": "Izbriši Freshsales Nalog", + "NEW_FRESHSALESACCOUNT": "Novi Freshsales Nalog", + "ADD_FRESHSALESACCOUNT": "Dodaj Freshsales Nalog", + "NO_FRESHSALESCONFIGURATION_AVAILABLE": "Nema dostupnih Freshsales Konfiguracija", + "NEW_FRESHSALESCONFIGURATION": "Nova Freshsales Konfiguracija", + "ADD_FRESHSALESCONFIGURATION": "Dodaj Freshsales Konfiguraciju", + "EDIT_FRESHSALESCONFIGURATION": "Uredi Freshsales Konfiguraciju", + "DELETE_FRESHSALESCONFIGURATION": "Izbriši Freshsales Konfiguraciju", + "TEST_FRESHSALESACCOUNT": "Testiraj Freshsales Nalog", + "SERVICENOWACCOUNTS": "ServiceNow Nalozi", + "ADD_SERVICENOWACCOUNT": "Dodaj novi ServiceNow Nalog", + "EDIT_SERVICENOWACCOUNT": "Uredi ServiceNow Nalog", + "TEST_SERVICENOWACCOUNT": "Testiraj ServiceNow Nalog", + "DELETE_SERVICENOWACCOUNT": "Izriši ServiceNow Nalog", + "NEW_SERVICENOWACCOUNT": "Novi ServiceNow Nalog", + "NEW_SERVICENOWCONFIGURATION": "Nova ServiceNow Konfiguracija", + "DELETE_SERVICENOWCONFIGURATION": "Izbriši ServiceNow Konfiguraciju", + "ADD_SERVICENOWCONFIGURATION": "Dodaj ServiceNow Konfiguraciju", + "DYNAMICS365ACCOUNTS": "MD365 Nalozi", + "TENANTID": "Zakupac ID", + "ADD_DYNAMICS365ACCOUNT": "Dodaj novi MD365 Nalog", + "EDIT_DYNAMICS365ACCOUNT": "Uredi MD365 Nalog", + "TEST_DYNAMICS365ACCOUNT": "Testiraj MD365 Nalog", + "DELETE_DYNAMICS365ACCOUNT": "Izbriši MD365 Nalog", + "NEW_DYNAMICS365ACCOUNT": "Novi MD365 Nalog", + "NEW_DYNAMICS365CONFIGURATION": "Kreiraj MD365 Konfiguraciju", + "DELETE_DYNAMICS365CONFIGURATION": "Izbriši MD365 Konfiguraciju", + "ADD_DYNAMICS365CONFIGURATION": "Dodaj MD365 Konfiguraciju", + "TICKETTYPE": "Tiket Vrsta", + "CASE": "Slučaj", + "LEADID": "Lead ID", + "ADDITIONALSEARCHACCOUNT": "Dodatni Nalog za Pretraživanje", + "ADDITIONALSEARCHCONTACT": "Dodatni Kontakt za Pretraživanje", + "ADDITIONALSEARCHLEAD": "Dodatni Lead za Pretraživanje", + "PHONECALL": "Telefonski poiv", + "TASK": "Zadaci", + "DYNAMIC365CONTACT": "Kontakt", + "DYNAMIC365NOTHING": "Ništa", + "MODERN_AUTHENTICATION": "Moderna Autentifikacija", + "OPENNEWTAB": "Otvori novi tab" } } diff --git a/public/app/main/apps/integrations/i18n/et.json b/public/app/main/apps/integrations/i18n/et.json index 7444e6b..cba6b07 100644 --- a/public/app/main/apps/integrations/i18n/et.json +++ b/public/app/main/apps/integrations/i18n/et.json @@ -66,7 +66,8 @@ "ADDITIONALSEARCHACCOUNT": "Täiendav välja nimi, mida kasutatakse kontol kliendi telefoninumbri otsimiseks", "ADDITIONALSEARCHCONTACT": "Täiendav välja nimi, mida kasutatakse kliendi telefoninumbri otsimiseks menüüst Kontaktid", "ADDITIONALSEARCHLEAD": "Potentsiaalsete klientide telefoninumbri otsimiseks kasutatav täiendav välja nimi", - "LEADID": "Välja ja juhtumi objektide linkimiseks kasutatav välja nimi" + "LEADID": "Välja ja juhtumi objektide linkimiseks kasutatav välja nimi", + "MODERN_AUTHENTICATION": "Lülitage sisse, et lubada kaasaegne autentimine" }, "ACCOUNT": "Konto", "ZENDESKCONFIGURATIONS": "Zendesk Konfiguratsioonid", @@ -242,6 +243,10 @@ "ADDITIONALSEARCHACCOUNT": "Täiendav otsingukonto", "ADDITIONALSEARCHCONTACT": "Täiendav otsingu kontakt", "ADDITIONALSEARCHLEAD": "Täiendav otsinguvihje", - "LEADID": "Vihje ID" + "LEADID": "Vihje ID", + "DYNAMIC365CONTACT": "Võtke ühendust", + "DYNAMIC365NOTHING": "Mitte midagi", + "MODERN_AUTHENTICATION": "Kaasaegne autentimine", + "OPENNEWTAB": "Ava uus vaheleht" } } diff --git a/public/app/main/apps/integrations/i18n/is.json b/public/app/main/apps/integrations/i18n/is.json new file mode 100644 index 0000000..da1fa10 --- /dev/null +++ b/public/app/main/apps/integrations/i18n/is.json @@ -0,0 +1,252 @@ +{ + "INTEGRATIONS": { + "ZONE": "Zone", + "ADVANCED": "Advanced", + "MODULE_SEARCH": "Module Search", + "MODULE_CREATE": "Module Create", + "LEADS": "Lead", + "CONTACTS": "Contact", + "INTEGRATIONS": "Integrations", + "ZENDESKACCOUNTS": "Zendesk Accounts", + "ID": "Id", + "NAME": "Name", + "USERNAME": "Username", + "URI": "URL", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "EDIT_ZENDESKACCOUNT": "Edit Zendesk Account", + "DELETE_ZENDESKACCOUNT": "Delete Zendesk Account", + "NEW_ZENDESKACCOUNT": "New Zendesk Account", + "AUTHTYPE": "Authentication Type", + "PASSWORD": "Password", + "CONFIRM_PASSWORD": "Confirm Password", + "EMAIL": "Email", + "TOKEN": "Token", + "MOTIONPROXYADDRESS": "Motion or Proxy IP Address", + "DESCRIPTION": "Description", + "ADD_ZENDESKACCOUNT": "Add Zendesk Account", + "ERRORS": { + "NAME_REQUIRED": "Mandatory field", + "USERNAME_REQUIRED": "Mandatory field", + "URI_REQUIRED": "Mandatory field", + "URI_MUST_VALID_URL": "Wrong format", + "PASSWORD_REQUIRED": "Mandatory field", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "TOKEN_REQUIRED": "Mandatory field", + "MOTIONPROXYADDRESS_MUST_VALID_URL": "Wrong format", + "CLIENTID_REQUIRED": "Mandatory field", + "CLIENTSECRET_REQUIRED": "Mandatory field", + "SECURITYTOKEN_REQUIRED": "Mandatory field", + "APIKEY_REQUIRED": "Mandatory field", + "CONTENT_REQUIRED": "Mandatory field", + "VARIABLENAME_REQUIRED": "Mandatory field", + "KEY_REQUIRED": "Mandatory field", + "TYPE_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "FIELD_REQUIRED": "Mandatory field", + "CONSUMERKEY_REQUIRED": "Mandatory field", + "CONSUMERSECRET_REQUIRED": "Mandatory field", + "TOKENSECRET_REQUIRED": "Mandatory field", + "HOST_REQUIRED": "Mandatory field", + "AUTHTOKEN_REQUIRED": "Mandatory field", + "VTIGER_USER_NAME_REQUIRED": "Mandatory field", + "ACCESS_KEY_REQUIRED": "Mandatory field", + "EMAIL_REQUIRED": "Mandatory field", + "TENANTID_REQUIRED": "Mandatory field", + "CODE_REQUIRED": "Mandatory field", + "MOTIONPROXYADDRESS_REQUIRED": "Mandatory field", + "MODULECREATE_REQUIRED": "Mandatory field" + }, + "HELP": { + "MOTIONPROXYADDRESS": "Motion (Proxy) Address: it is reqired if you want to fill the ticket body with Recording URL. Enter the address in the following format: : //[:]. Example: https://X.Y.Z.W", + "TICKETTYPE": "Ticket Type", + "ZONE": "Choose your geographic zone (US, AU, EU, IN, CN) to activate the domain-specific Zoho Accounts", + "CLIENTID": "The specific CLient Id of your application", + "CLIENTSECRET": "The specific CLientSecret of your application", + "CODE": "The specific code generated through Developer Console", + "REFRESHTOKEN": "The automatically generated refresh token used to refresh expired access tokens. Also the access token are automatically generated each time an api is launched.", + "LEADID": "Field name used to link Case and Lead objects", + "ADDITIONALSEARCHACCOUNT": "Additional field name used to search customer phone number in Accounts", + "ADDITIONALSEARCHCONTACT": "Additional field name used to search customer phone number in Contacts", + "ADDITIONALSEARCHLEAD": "Additional field name used to search customer phone number in Leads", + "MODERN_AUTHENTICATION": "Switch to enable Modern Authentication" + }, + "MODULECREATE": "Module create", + "CODE": "Developer Console Code", + "REFRESHTOKEN": "Refresh Token (generated)", + "ACCOUNT": "Account", + "ZENDESKCONFIGURATIONS": "Zendesk Configurations", + "SALESFORCECONFIGURATIONS": "Salesforce Configurations", + "SUGARCRMCONFIGURATIONS": "SugarCRM Configurations", + "FRESHDESKCONFIGURATIONS": "Freshdesk Configurations", + "GENERAL": "General", + "CREATED_AT": "Created At", + "SAVE": "Save", + "NO_ZENDESKCONFIGURATION_AVAILABLE": "No Zendesk Configurations available", + "NEW_ZENDESKCONFIGURATION": "New Zendesk Configuration", + "ADD_ZENDESKCONFIGURATION": "Add Zendesk Configuration", + "EDIT_ZENDESKCONFIGURATION": "Edit Zendesk Configuration", + "DELETE_ZENDESKCONFIGURATION": "Delete Zendesk Configuration", + "NO_SALESFORCECONFIGURATION_AVAILABLE": "No Salesforce Configurations available", + "NEW_SALESFORCECONFIGURATION": "New Salesforce Configuration", + "ADD_SALESFORCECONFIGURATION": "Add Salesforce Configuration", + "EDIT_SALESFORCECONFIGURATION": "Edit Salesforce Configuration", + "DELETE_SALESFORCECONFIGURATION": "Delete Salesforce Configuration", + "NO_SUGARCRMCONFIGURATION_AVAILABLE": "No SugarCRM Configurations available", + "NEW_SUGARCRMCONFIGURATION": "New SugarCRM Configuration", + "ADD_SUGARCRMCONFIGURATION": "Add SugarCRM Configuration", + "EDIT_SUGARCRMCONFIGURATION": "Edit SugarCRM Configuration", + "DELETE_SUGARCRMCONFIGURATION": "Delete SugarCRM Configuration", + "NO_FRESHDESKCONFIGURATION_AVAILABLE": "No Freshdesk Configurations available", + "NEW_FRESHDESKCONFIGURATION": "New Freshdesk Configuration", + "ADD_FRESHDESKCONFIGURATION": "Add Freshdesk Configuration", + "EDIT_FRESHDESKCONFIGURATION": "Edit Freshdesk Configuration", + "DELETE_FRESHDESKCONFIGURATION": "Delete Freshdesk Configuration", + "SALESFORCEACCOUNTS": "Salesforce Accounts", + "EDIT_SALESFORCEACCOUNT": "Edit Salesforce Account", + "DELETE_SALESFORCEACCOUNT": "Delete Salesforce Account", + "NEW_SALESFORCEACCOUNT": "New Salesforce Account", + "ADD_SALESFORCEACCOUNT": "Add Salesforce Account", + "CLIENTID": "Client ID", + "CLIENTSECRET": "Client Secret", + "SECURITYTOKEN": "Security Token", + "SEARCH_FOR_ANYONE": "Search", + "APIKEY": "Api Key", + "FRESHDESKACCOUNTS": "Freshdesk Accounts", + "EDIT_FRESHDESKACCOUNT": "Edit Freshdesk Account", + "DELETE_FRESHDESKACCOUNT": "Delete Freshdesk Account", + "NEW_FRESHDESKACCOUNT": "New Freshdesk Account", + "ADD_FRESHDESKACCOUNT": "Add Freshdesk Account", + "SUGARCRMACCOUNTS": "SugarCRM Accounts", + "EDIT_SUGARCRMACCOUNT": "Edit SugarCRM Account", + "DELETE_SUGARCRMACCOUNT": "Delete SugarCRM Account", + "NEW_SUGARCRMACCOUNT": "New SugarCRM Account", + "ADD_SUGARCRMACCOUNT": "Add SugarCRM Account", + "CONFIGURATIONS": "Configurations", + "NO_CONFIGURATION_AVAILABLE": "No Configurations available", + "NEW_CONFIGURATION": "New Configuration", + "ADD_CONFIGURATION": "Add Configuration", + "EDIT_CONFIGURATION": "Edit Configuration", + "DELETE_CONFIGURATION": "Delete Configuration", + "SUBJECTS": "Subjects", + "DESCRIPTIONS": "Descriptions", + "FIELDS": "Fields", + "TAGS": "Tags", + "TYPE": "Type", + "CONTENT": "Content", + "EDIT_SUBJECT": "Edit Subject", + "DELETE_SUBJECT": "Delete Subject", + "NEW_SUBJECT": "New Subject", + "ADD_SUBJECT": "Add Subject", + "EDIT_DESCRIPTION": "Edit Description", + "DELETE_DESCRIPTION": "Delete Description", + "NEW_DESCRIPTION": "New Description", + "ADD_DESCRIPTION": "Add Description", + "EDIT_FIELD": "Edit Field", + "DELETE_FIELD": "Delete Field", + "NEW_FIELD": "New Field", + "ADD_FIELD": "Add Field", + "ADD": "Add", + "VOICE": "Voice", + "MAIL": "Email", + "CHAT": "Chat", + "SMS": "SMS", + "OPENCHANNEL": "Open Channel", + "INBOUND_IN_QUEUE": "Inbound in Queue", + "OUTBOUND_CALL": "Outbound Call", + "VALUE": "Value", + "FIELD": "Field", + "KEY": "Key", + "CHANNEL": "Channel", + "DELETE": "Delete", + "NO_AVAILABLE_INFO": "No available info", + "TEST_ZENDESKACCOUNT": "Test Zendesk Account", + "TEST_FRESHDESKACCOUNT": "Test Freshdesk Account", + "TEST_SUGARCRMACCOUNT": "Test SugerCRM Account", + "TEST_SALESFORCEACCOUNT": "Test Salesforce Account", + "INTEGRATION_TAB": "Integration Tab", + "NEW_TAB": "New Tab", + "DESKACCOUNTS": "Desk Accounts", + "EDIT_DESKACCOUNT": "Edit Desk Account", + "TEST_DESKACCOUNT": "Test Desk Account", + "DELETE_DESKACCOUNT": "Delete Desk Account", + "CONSUMERKEY": "Consumer Key", + "CONSUMERSECRET": "Consumer Secret", + "TOKENSECRET": "Token Secret", + "ADD_DESKACCOUNT": "Add Desk Account", + "NEW_DESKACCOUNT": "New Desk Account", + "ADD_DESKCONFIGURATION": "Add Desk Configuration", + "NEW_DESKCONFIGURATION": "New Desk Configuration", + "DELETE_DESKCONFIGURATION": "Delete Desk Configuration", + "ZOHOACCOUNTS": "Zoho Accounts", + "EDIT_ZOHOACCOUNT": "Edit Zoho Account", + "TEST_ZOHOACCOUNT": "Test Zoho Account", + "DELETE_ZOHOACCOUNT": "Delete Zoho Account", + "ADD_ZOHOACCOUNT": "Add Zoho Account", + "NEW_ZOHOACCOUNT": "New Zoho Account", + "ADD_ZOHOCONFIGURATION": "Add Zoho Configuration", + "NEW_ZOHOCONFIGURATION": "New Zoho Configuration", + "AUTHTOKEN": "Authorization Token", + "HOST": "Host", + "DELETE_ZOHOCONFIGURATION": "Delete Zoho Configuration", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "VTIGERACCOUNTS": "vTiger Accounts", + "VTIGER_USER_NAME": "vTiger User Name", + "MODULE_NAME": "vTiger Module Name", + "ACCESS_KEY": "vTiger Access Key", + "ADD_VTIGERACCOUNT": "Add new vTiger Account", + "EDIT_VTIGERACCOUNT": "Edit vTiger Account", + "TEST_VTIGERACCOUNT": "Test vTiger Account", + "DELETE_VTIGERACCOUNT": "Delete vTiger Account", + "NEW_VTIGERACCOUNT": "New vTiger Account", + "NEW_VTIGERCONFIGURATION": "Create vTiger Configuration", + "DELETE_VTIGERCONFIGURATION": "Delete vTiger Configuration", + "ADD_VTIGERCONFIGURATION": "Add vTiger Configuration", + "FRESHSALESACCOUNTS": "Freshsales Accounts", + "EDIT_FRESHSALESACCOUNT": "Edit Freshsales Account", + "DELETE_FRESHSALESACCOUNT": "Delete Freshsales Account", + "NEW_FRESHSALESACCOUNT": "New Freshsales Account", + "ADD_FRESHSALESACCOUNT": "Add Freshsales Account", + "NO_FRESHSALESCONFIGURATION_AVAILABLE": "No Freshsales Configurations available", + "NEW_FRESHSALESCONFIGURATION": "New Freshsales Configuration", + "ADD_FRESHSALESCONFIGURATION": "Add Freshsales Configuration", + "EDIT_FRESHSALESCONFIGURATION": "Edit Freshsales Configuration", + "DELETE_FRESHSALESCONFIGURATION": "Delete Freshsales Configuration", + "TEST_FRESHSALESACCOUNT": "Test Freshsales Account", + "SERVICENOWACCOUNTS": "ServiceNow Accounts", + "ADD_SERVICENOWACCOUNT": "Add new ServiceNow Account", + "EDIT_SERVICENOWACCOUNT": "Edit ServiceNow Account", + "TEST_SERVICENOWACCOUNT": "Test ServiceNow Account", + "DELETE_SERVICENOWACCOUNT": "Delete ServiceNow Account", + "NEW_SERVICENOWACCOUNT": "New ServiceNow Account", + "NEW_SERVICENOWCONFIGURATION": "Create ServiceNow Configuration", + "DELETE_SERVICENOWCONFIGURATION": "Delete ServiceNow Configuration", + "ADD_SERVICENOWCONFIGURATION": "Add ServiceNow Configuration", + "DYNAMICS365ACCOUNTS": "Dynamics365 Accounts", + "TENANTID": "Tenant Id", + "ADD_DYNAMICS365ACCOUNT": "Add new Dynamics365 Account", + "EDIT_DYNAMICS365ACCOUNT": "Edit Dynamics365 Account", + "TEST_DYNAMICS365ACCOUNT": "Test Dynamics365 Account", + "DELETE_DYNAMICS365ACCOUNT": "Delete Dynamics365 Account", + "NEW_DYNAMICS365ACCOUNT": "New Dynamics365 Account", + "NEW_DYNAMICS365CONFIGURATION": "Create Dynamics365 Configuration", + "DELETE_DYNAMICS365CONFIGURATION": "Delete Dynamics365 Configuration", + "ADD_DYNAMICS365CONFIGURATION": "Add Dynamics365 Configuration", + "TICKETTYPE": "Ticket Type", + "CASE": "Case", + "LEADID": "Lead Id", + "ADDITIONALSEARCHACCOUNT": "Additional Search Account", + "ADDITIONALSEARCHCONTACT": "Additional Search Contact", + "ADDITIONALSEARCHLEAD": "Additional Search Lead", + "PHONECALL": "Phonecall", + "TASK": "Task", + "DYNAMIC365CONTACT": "Contact", + "DYNAMIC365NOTHING": "Nothing", + "MODERN_AUTHENTICATION": "Modern Authentication", + "OPENNEWTAB": "Open new tab" + } +} diff --git a/public/app/main/apps/integrations/i18n/pt-BR.json b/public/app/main/apps/integrations/i18n/pt-BR.json index 791db6c..156770a 100644 --- a/public/app/main/apps/integrations/i18n/pt-BR.json +++ b/public/app/main/apps/integrations/i18n/pt-BR.json @@ -1,28 +1,28 @@ { "INTEGRATIONS": { "ADVANCED": "Avançado", - "MODULE_SEARCH": "Pesquisa de módulo", - "MODULE_CREATE": "Módulo Criar", + "MODULE_SEARCH": "Pesquisar Módulo", + "MODULE_CREATE": "Módulo Criado", "INTEGRATIONS": "Integrações", - "ZENDESKACCOUNTS": "Contas do Zendesk", + "ZENDESKACCOUNTS": "Contas Zendesk", "ID": "Id", "NAME": "Nome", "USERNAME": "Usuário", "URI": "URL", "BACK": "Voltar", "SELECTED": "Selecionado", - "SELECT_ALL": "Selecionar tudo", - "SELECT_NONE": "Selecionar nenhum", - "EDIT_ZENDESKACCOUNT": "Editar conta do Zendesk", - "DELETE_ZENDESKACCOUNT": "Excluir conta do Zendesk", - "NEW_ZENDESKACCOUNT": "Nova conta do Zendesk", - "AUTHTYPE": "Tipo de AutenticaçãoType", + "SELECT_ALL": "Selecionar Tudo", + "SELECT_NONE": "Selecionar Nenhum", + "EDIT_ZENDESKACCOUNT": "Editar Conta Zendesk", + "DELETE_ZENDESKACCOUNT": "Excluir Conta Zendesk", + "NEW_ZENDESKACCOUNT": "Nova Conta Zendesk", + "AUTHTYPE": "Tipo de Autenticação", "PASSWORD": "Senha", - "CONFIRM_PASSWORD": "Confirme a Senha", + "CONFIRM_PASSWORD": "Confirme Senha", "TOKEN": "Token", - "MOTIONPROXYADDRESS": "Endereço IP de movimento ou proxy", + "MOTIONPROXYADDRESS": "Endereço IP Motion ou Proxy", "DESCRIPTION": "Descrição", - "ADD_ZENDESKACCOUNT": "Adicionar conta do Zendesk", + "ADD_ZENDESKACCOUNT": "Adicionar Conta Zendesk", "ERRORS": { "NAME_REQUIRED": "Campo obrigatório", "USERNAME_REQUIRED": "Campo obrigatório", @@ -56,13 +56,13 @@ "MODULECREATE_REQUIRED": "Campo obrigatório" }, "HELP": { - "MOTIONPROXYADDRESS": "Endereço de movimento (proxy): é necessário se você quiser preencher o corpo do ticket com o URL de gravação. Digite o endereço no seguinte formato: : // [: ]. Exemplo: https: //X.Y.Z.W", - "TICKETTYPE": "Tipo de bilhete", + "MOTIONPROXYADDRESS": "Motion (Proxy) Address: é necessario se quiser utilizar o ticket body com Recording URL. Entre com o endereço no seguinte formato: : //[:]. Exemplo: https://X.Y.Z.W", + "TICKETTYPE": "Tipo Ticket", "CLIENTID": "O ID do cliente específico do seu aplicativo", "CLIENTSECRET": "O CLientSecret específico do seu aplicativo", "CODE": "O código específico gerado pelo Developer Console", - "REFRESHTOKEN": "O token de atualização gerado automaticamente usado para atualizar os tokens de acesso expirados. Além disso, o token de acesso é gerado automaticamente sempre que uma API é iniciada.", - "ZONE": "Escolha sua zona geográfica (EUA, AU, UE, IN, CN) para ativar as Contas Zoho específicas do domínio", + "REFRESHTOKEN": "O token de atualização gerado automaticamente e usado para atualizar os tokens de acesso expirados. Além disso, o token de acesso é gerado automaticamente toda vez que uma API é iniciada.", + "ZONE": "Escolha sua zona geográfica (EUA, AU, UE, IN, CN) para ativar o domain-specific da conta Zoho", "ADDITIONALSEARCHACCOUNT": "Nome de campo adicional usado para pesquisar o número de telefone do cliente em contas", "ADDITIONALSEARCHCONTACT": "Nome de campo adicional usado para pesquisar o número de telefone do cliente em Contatos", "ADDITIONALSEARCHLEAD": "Nome de campo adicional usado para pesquisar o número de telefone do cliente no Leads", @@ -70,183 +70,183 @@ "MODERN_AUTHENTICATION": "Alterne para habilitar a autenticação moderna" }, "ACCOUNT": "Conta", - "ZENDESKCONFIGURATIONS": "Configurações do Zendesk", - "SALESFORCECONFIGURATIONS": "Configurações do Salesforce", + "ZENDESKCONFIGURATIONS": "Configurações Zendesk", + "SALESFORCECONFIGURATIONS": "Configurações Salesforce", "SUGARCRMCONFIGURATIONS": "Configurações SugarCRM", - "FRESHDESKCONFIGURATIONS": "Configurações do Freshdesk", + "FRESHDESKCONFIGURATIONS": "Configurações Freshdesk", "GENERAL": "Geral", "CREATED_AT": "Criado em", "SAVE": "Salvar", "NO_ZENDESKCONFIGURATION_AVAILABLE": "Nenhuma configuração do Zendesk disponível", - "NEW_ZENDESKCONFIGURATION": "Nova configuração do Zendesk", - "ADD_ZENDESKCONFIGURATION": "Adicionar configuração do Zendesk", - "EDIT_ZENDESKCONFIGURATION": "Editar configuração do Zendesk", - "DELETE_ZENDESKCONFIGURATION": "Excluir configuração do Zendesk", + "NEW_ZENDESKCONFIGURATION": "Nova Configuração Zendesk", + "ADD_ZENDESKCONFIGURATION": "Adicionar Configuração Zendesk", + "EDIT_ZENDESKCONFIGURATION": "Editar Configuração Zendesk", + "DELETE_ZENDESKCONFIGURATION": "Excluir Configuração Zendesk", "NO_SALESFORCECONFIGURATION_AVAILABLE": "Nenhuma configuração do Salesforce disponível", - "NEW_SALESFORCECONFIGURATION": "Nova configuração do Salesforce", - "ADD_SALESFORCECONFIGURATION": "Adicionar configuração do Salesforce", - "EDIT_SALESFORCECONFIGURATION": "Editar configuração do Salesforce", - "DELETE_SALESFORCECONFIGURATION": "Excluir configuração do Salesforce", + "NEW_SALESFORCECONFIGURATION": "Nova Configuração Salesforce", + "ADD_SALESFORCECONFIGURATION": "Adicionar Configuração Salesforce", + "EDIT_SALESFORCECONFIGURATION": "Editar Configuração Salesforce", + "DELETE_SALESFORCECONFIGURATION": "Excluir Configuração Salesforce", "NO_SUGARCRMCONFIGURATION_AVAILABLE": "Nenhuma configuração do SugarCRM disponível", - "NEW_SUGARCRMCONFIGURATION": "Nova configuração do SugarCRM", - "ADD_SUGARCRMCONFIGURATION": "Adicionar configuração do SugarCRM", - "EDIT_SUGARCRMCONFIGURATION": "Editar configuração do SugarCRM", - "DELETE_SUGARCRMCONFIGURATION": "Excluir configuração do SugarCRM", + "NEW_SUGARCRMCONFIGURATION": "Nova Configuração SugarCRM", + "ADD_SUGARCRMCONFIGURATION": "Adicionar Configuração SugarCRM", + "EDIT_SUGARCRMCONFIGURATION": "Editar Configuração SugarCRM", + "DELETE_SUGARCRMCONFIGURATION": "Excluir Configuração SugarCRM", "NO_FRESHDESKCONFIGURATION_AVAILABLE": "Não há configurações Freshdesk disponíveis", - "NEW_FRESHDESKCONFIGURATION": "Nova configuração do Freshdesk", - "ADD_FRESHDESKCONFIGURATION": "Adicionar configuração do Freshdesk", - "EDIT_FRESHDESKCONFIGURATION": "Editar configuração do Freshdesk", - "DELETE_FRESHDESKCONFIGURATION": "Excluir configuração do Freshdesk", - "SALESFORCEACCOUNTS": "Contas do Salesforce", - "EDIT_SALESFORCEACCOUNT": "Editar conta do Salesforce", - "DELETE_SALESFORCEACCOUNT": "Excluir conta do Salesforce", - "NEW_SALESFORCEACCOUNT": "Nova conta do Salesforce", - "ADD_SALESFORCEACCOUNT": "Adicionar conta do Salesforce", + "NEW_FRESHDESKCONFIGURATION": "Nova Configuração Freshdesk", + "ADD_FRESHDESKCONFIGURATION": "Adicionar Configuração Freshdesk", + "EDIT_FRESHDESKCONFIGURATION": "Editar Configuração Freshdesk", + "DELETE_FRESHDESKCONFIGURATION": "Excluir Configuração Freshdesk", + "SALESFORCEACCOUNTS": "Contas Salesforce", + "EDIT_SALESFORCEACCOUNT": "Editar Conta Salesforce", + "DELETE_SALESFORCEACCOUNT": "Excluir Conta Salesforce", + "NEW_SALESFORCEACCOUNT": "Nova Conta Salesforce", + "ADD_SALESFORCEACCOUNT": "Adicionar Conta Salesforce", "CLIENTID": "ID do Cliente", - "CLIENTSECRET": "Segredo do Cliente", - "SECURITYTOKEN": "Token de segurança", + "CLIENTSECRET": "Senha do Cliente", + "SECURITYTOKEN": "Token Segurança", "SEARCH_FOR_ANYONE": "Procurar", "APIKEY": "Api Key", "FRESHDESKACCOUNTS": "Contas Freshdesk", - "EDIT_FRESHDESKACCOUNT": "Editar conta do Freshdesk", - "DELETE_FRESHDESKACCOUNT": "Delete Freshdesk Account", - "NEW_FRESHDESKACCOUNT": "New Freshdesk Account", - "ADD_FRESHDESKACCOUNT": "Add Freshdesk Account", - "SUGARCRMACCOUNTS": "SugarCRM Accounts", - "EDIT_SUGARCRMACCOUNT": "Edit SugarCRM Account", - "DELETE_SUGARCRMACCOUNT": "Excluir conta do Freshdesk", - "NEW_SUGARCRMACCOUNT": "Nova conta do SugarCRM", - "ADD_SUGARCRMACCOUNT": "Adicionar conta do SugarCRM", + "EDIT_FRESHDESKACCOUNT": "Editar Conta Freshdesk", + "DELETE_FRESHDESKACCOUNT": "Excluir Conta Freshdesk", + "NEW_FRESHDESKACCOUNT": "Nova Conta Freshdesk", + "ADD_FRESHDESKACCOUNT": "Adicionar Conta Freshdesk", + "SUGARCRMACCOUNTS": "Contas SugarCRM", + "EDIT_SUGARCRMACCOUNT": "Editar Conta SugarCRM", + "DELETE_SUGARCRMACCOUNT": "Excluir Conta Freshdesk", + "NEW_SUGARCRMACCOUNT": "Nova Conta SugarCRM", + "ADD_SUGARCRMACCOUNT": "Adicionar Conta SugarCRM", "CONFIGURATIONS": "Configurações", - "NO_CONFIGURATION_AVAILABLE": "Nenhuma configuração disponível", - "NEW_CONFIGURATION": "Nova configuração", - "ADD_CONFIGURATION": "Adicionar configuração", - "EDIT_CONFIGURATION": "Editar configuração", - "DELETE_CONFIGURATION": "Excluir configuração", + "NO_CONFIGURATION_AVAILABLE": "Nenhuma Configuração Disponível", + "NEW_CONFIGURATION": "Nova Configuração", + "ADD_CONFIGURATION": "Adicionar Configuração", + "EDIT_CONFIGURATION": "Editar Configuração", + "DELETE_CONFIGURATION": "Excluir Configuração", "SUBJECTS": "Assuntos", "DESCRIPTIONS": "Descrições", "FIELDS": "Campos", "TAGS": "Tags", "TYPE": "Tipo", "CONTENT": "Conteúdo", - "EDIT_SUBJECT": "Editar assunto", - "DELETE_SUBJECT": "Excluir assunto", - "NEW_SUBJECT": "Novo assunto", - "ADD_SUBJECT": "Adicionar assunto", - "EDIT_DESCRIPTION": "Edite a Descrição", - "DELETE_DESCRIPTION": "Excluir descrição", - "NEW_DESCRIPTION": "Nova descrição", - "ADD_DESCRIPTION": "Adicionar descrição", - "EDIT_FIELD": "Editar campo", - "DELETE_FIELD": "Excluir campo", - "NEW_FIELD": "Novo campo", - "ADD_FIELD": "Adicionar campo", + "EDIT_SUBJECT": "Editar Assunto", + "DELETE_SUBJECT": "Excluir Assunto", + "NEW_SUBJECT": "Novo Assunto", + "ADD_SUBJECT": "Adicionar Assunto", + "EDIT_DESCRIPTION": "Editar Descrição", + "DELETE_DESCRIPTION": "Excluir Descrição", + "NEW_DESCRIPTION": "Nova Descrição", + "ADD_DESCRIPTION": "Adicionar Descrição", + "EDIT_FIELD": "Editar Campo", + "DELETE_FIELD": "Excluir Campo", + "NEW_FIELD": "Novo Campo", + "ADD_FIELD": "Adicionar Campo", "ADD": "Adicionar", "VOICE": "Voz", "MAIL": "Email", "CHAT": "Chat", "SMS": "SMS", "OPENCHANNEL": "Open Channel", - "INBOUND_IN_QUEUE": "Entrada na fila", - "OUTBOUND_CALL": "Chamada de saída", + "INBOUND_IN_QUEUE": "Entrada na Fila", + "OUTBOUND_CALL": "Outbound Call", "VALUE": "Valor", "FIELD": "Campo", "KEY": "Key", "CHANNEL": "Canal", "DELETE": "Excluir", - "NO_AVAILABLE_INFO": "Nenhuma informação disponível", - "TEST_ZENDESKACCOUNT": "Testar conta do Zendesk", - "TEST_FRESHDESKACCOUNT": "Testar conta do Freshdesk", - "TEST_SUGARCRMACCOUNT": "Test SugerCRM Account", - "TEST_SALESFORCEACCOUNT": "Testar conta do Salesforce", + "NO_AVAILABLE_INFO": "Nenhuma Informação Disponível", + "TEST_ZENDESKACCOUNT": "Testar Conta Zendesk", + "TEST_FRESHDESKACCOUNT": "Testar Conta Freshdesk", + "TEST_SUGARCRMACCOUNT": "Testar Conta SugerCRM", + "TEST_SALESFORCEACCOUNT": "Testar Conta Salesforce", "INTEGRATION_TAB": "Guia Integração", - "NEW_TAB": "Nova aba", - "DESKACCOUNTS": "Contas de mesa", - "EDIT_DESKACCOUNT": "Editar conta de mesa", - "TEST_DESKACCOUNT": "Conta de teste de mesa", - "DELETE_DESKACCOUNT": "Excluir conta de mesa", - "CONSUMERKEY": "Chave do consumidor", - "CONSUMERSECRET": "Consumidor secreto", - "TOKENSECRET": "Segredo do Token", - "ADD_DESKACCOUNT": "Adicionar conta de mesa", - "NEW_DESKACCOUNT": "Nova conta de mesa", - "ADD_DESKCONFIGURATION": "Adicionar configuração de mesa", - "NEW_DESKCONFIGURATION": "Nova configuração de mesa", - "DELETE_DESKCONFIGURATION": "Excluir configuração da mesa", + "NEW_TAB": "Nova Aba", + "DESKACCOUNTS": "Contas Desk", + "EDIT_DESKACCOUNT": "Editar Conta Desk", + "TEST_DESKACCOUNT": "Contas Desk", + "DELETE_DESKACCOUNT": "Excluir conta Desk", + "CONSUMERKEY": "Chave do Consumidor", + "CONSUMERSECRET": "Senha do Consumidor", + "TOKENSECRET": "Senha do Token", + "ADD_DESKACCOUNT": "Adicionar Conta Desk", + "NEW_DESKACCOUNT": "Nova Conta Desk", + "ADD_DESKCONFIGURATION": "Adicionar Configuração Desk", + "NEW_DESKCONFIGURATION": "Nova Configuração Desk", + "DELETE_DESKCONFIGURATION": "Excluir configuração Desk", "ZOHOACCOUNTS": "Contas Zoho", - "EDIT_ZOHOACCOUNT": "Editar conta Zoho", + "EDIT_ZOHOACCOUNT": "Editar Conta Zoho", "TEST_ZOHOACCOUNT": "Testar Conta Zoho", - "DELETE_ZOHOACCOUNT": "Excluir conta do Zoho", - "ADD_ZOHOACCOUNT": "Add Zoho Account", - "NEW_ZOHOACCOUNT": "New Zoho Account", - "ADD_ZOHOCONFIGURATION": "Adicionar Conta Zoho", - "NEW_ZOHOCONFIGURATION": "Nova configuração Zoho", + "DELETE_ZOHOACCOUNT": "Excluir Conta Zoho", + "ADD_ZOHOACCOUNT": "Adicionar Conta Zoho", + "NEW_ZOHOACCOUNT": "Nova Conta Zoho", + "ADD_ZOHOCONFIGURATION": "Adicionar Configuração Zoho", + "NEW_ZOHOCONFIGURATION": "Nova Configuração Zoho", "AUTHTOKEN": "Token de Autorização", "HOST": "Host", - "DELETE_ZOHOCONFIGURATION": "Excluir configuração do Zoho", + "DELETE_ZOHOCONFIGURATION": "Excluir Configuração Zoho", "PAGE": "Página", "ROWSPERPAGE": "Linhas por Página", "OF": "do", "VTIGERACCOUNTS": "Contas vTiger", - "VTIGER_USER_NAME": "Nome do usuário vTiger", + "VTIGER_USER_NAME": "Nome do Usuário vTiger", "MODULE_NAME": "Nome do Módulo vTiger", - "ACCESS_KEY": "Chave de acesso vTiger", - "ADD_VTIGERACCOUNT": "Adicionar nova conta vTiger", - "EDIT_VTIGERACCOUNT": "Editar conta vTiger", - "TEST_VTIGERACCOUNT": "Testar conta vTiger", - "DELETE_VTIGERACCOUNT": "Excluir conta vTiger", - "NEW_VTIGERACCOUNT": "Nova conta vTiger", - "NEW_VTIGERCONFIGURATION": "Criar configuração vTiger", - "DELETE_VTIGERCONFIGURATION": "Excluir configuração vTiger", - "ADD_VTIGERCONFIGURATION": "Adicionar configuração vTiger", - "ADD_DYNAMICS365ACCOUNT": "Adicionar nova conta do Dynamics365", - "ADD_DYNAMICS365CONFIGURATION": "Adicionar configuração do Dynamics365", - "CASE": "Caso", - "DELETE_DYNAMICS365ACCOUNT": "Excluir conta do Dynamics365", - "DELETE_DYNAMICS365CONFIGURATION": "Excluir configuração do Dynamics365", - "DYNAMICS365ACCOUNTS": "Contas do Dynamics365", - "EDIT_DYNAMICS365ACCOUNT": "Editar conta do Dynamics365", - "NEW_DYNAMICS365ACCOUNT": "Nova conta do Dynamics365", - "NEW_DYNAMICS365CONFIGURATION": "Criar configuração do Dynamics365", - "PHONECALL": "Chamada telefónica", - "TENANTID": "ID do inquilino", - "TEST_DYNAMICS365ACCOUNT": "Testar conta Dynamics365", - "TICKETTYPE": "Tipo de bilhete", - "ADD_SERVICENOWACCOUNT": "Adicionar nova conta ServiceNow", - "ADD_SERVICENOWCONFIGURATION": "Adicionar configuração do ServiceNow", - "DELETE_SERVICENOWACCOUNT": "Excluir conta ServiceNow", - "DELETE_SERVICENOWCONFIGURATION": "Excluir configuração do ServiceNow", - "EDIT_SERVICENOWACCOUNT": "Editar conta ServiceNow", - "EMAIL": "O email", - "NEW_SERVICENOWACCOUNT": "Nova conta ServiceNow", - "NEW_SERVICENOWCONFIGURATION": "Criar configuração do ServiceNow", + "ACCESS_KEY": "Chave de Acesso vTiger", + "ADD_VTIGERACCOUNT": "Adicionar Conta vTiger", + "EDIT_VTIGERACCOUNT": "Editar Conta vTiger", + "TEST_VTIGERACCOUNT": "Testar Conta vTiger", + "DELETE_VTIGERACCOUNT": "Excluir Conta vTiger", + "NEW_VTIGERACCOUNT": "Nova Conta vTiger", + "NEW_VTIGERCONFIGURATION": "Criar Configuração vTiger", + "DELETE_VTIGERCONFIGURATION": "Excluir Configuração vTiger", + "ADD_VTIGERCONFIGURATION": "Adicionar Configuração vTiger", + "ADD_DYNAMICS365ACCOUNT": "Adicionar Conta Dynamics365", + "ADD_DYNAMICS365CONFIGURATION": "Adicionar Configuração Dynamics365", + "CASE": "Case", + "DELETE_DYNAMICS365ACCOUNT": "Excluir Conta Dynamics365", + "DELETE_DYNAMICS365CONFIGURATION": "Excluir Configuração Dynamics365", + "DYNAMICS365ACCOUNTS": "Contas Dynamics365", + "EDIT_DYNAMICS365ACCOUNT": "Editar Conta Dynamics365", + "NEW_DYNAMICS365ACCOUNT": "Nova Conta Dynamics365", + "NEW_DYNAMICS365CONFIGURATION": "Criar Configuração Dynamics365", + "PHONECALL": "Chamada telefônica", + "TENANTID": "Tenant ID", + "TEST_DYNAMICS365ACCOUNT": "Testar Conta Dynamics365", + "TICKETTYPE": "Tipo de Ticket", + "ADD_SERVICENOWACCOUNT": "Adicionar Conta ServiceNow", + "ADD_SERVICENOWCONFIGURATION": "Adicionar Configuração ServiceNow", + "DELETE_SERVICENOWACCOUNT": "Excluir Conta ServiceNow", + "DELETE_SERVICENOWCONFIGURATION": "Excluir Configuração ServiceNow", + "EDIT_SERVICENOWACCOUNT": "Editar Conta ServiceNow", + "EMAIL": "Email", + "NEW_SERVICENOWACCOUNT": "Nova Conta ServiceNow", + "NEW_SERVICENOWCONFIGURATION": "Nova Configuração ServiceNow", "SERVICENOWACCOUNTS": "Contas ServiceNow", - "TEST_SERVICENOWACCOUNT": "Conta de Serviço de Teste", + "TEST_SERVICENOWACCOUNT": "Testar Conta ServiceNow", "TASK": "Tarefa", - "CODE": "Código do console do desenvolvedor", - "REFRESHTOKEN": "Atualizar token (gerado)", + "CODE": "Developer Console Code", + "REFRESHTOKEN": "Atualizar Token (gerado)", "ZONE": "Zona", "CONTACTS": "Contato", - "LEADS": "Conduzir", - "MODULECREATE": "Criar módulo", - "ADD_FRESHSALESACCOUNT": "Adicionar conta Freshsales", - "ADD_FRESHSALESCONFIGURATION": "Adicionar configuração de vendas frescas", - "DELETE_FRESHSALESACCOUNT": "Excluir conta Freshsales", - "DELETE_FRESHSALESCONFIGURATION": "Excluir configuração de vendas recentes", - "EDIT_FRESHSALESACCOUNT": "Editar conta de vendas frescas", - "EDIT_FRESHSALESCONFIGURATION": "Editar configuração de vendas frescas", - "FRESHSALESACCOUNTS": "Contas de vendas frescas", - "NEW_FRESHSALESACCOUNT": "Nova conta de vendas frescas", - "NEW_FRESHSALESCONFIGURATION": "Nova configuração de vendas frescas", - "NO_FRESHSALESCONFIGURATION_AVAILABLE": "Nenhuma configuração de vendas frescas disponível", - "TEST_FRESHSALESACCOUNT": "Conta de teste de vendas frescas", - "ADDITIONALSEARCHACCOUNT": "Conta de pesquisa adicional", - "ADDITIONALSEARCHCONTACT": "Contato de pesquisa adicional", - "ADDITIONALSEARCHLEAD": "Lead de pesquisa adicional", - "LEADID": "Id de chumbo", + "LEADS": "Lead", + "MODULECREATE": "Criar Módulo", + "ADD_FRESHSALESACCOUNT": "Adicionar Conta Freshsales", + "ADD_FRESHSALESCONFIGURATION": "Adicionar Configuração Freshsales", + "DELETE_FRESHSALESACCOUNT": "Excluir Conta Freshsales", + "DELETE_FRESHSALESCONFIGURATION": "Excluir configuração Freshsales", + "EDIT_FRESHSALESACCOUNT": "Editar Conta Freshsales", + "EDIT_FRESHSALESCONFIGURATION": "Editar Configuração Freshsales", + "FRESHSALESACCOUNTS": "Contas Freshsales", + "NEW_FRESHSALESACCOUNT": "Nova Conta Freshsales", + "NEW_FRESHSALESCONFIGURATION": "Nova Configuração Freshsales", + "NO_FRESHSALESCONFIGURATION_AVAILABLE": "Nenhuma configuração de Freshsales disponível", + "TEST_FRESHSALESACCOUNT": "Testar Conta Freshsales", + "ADDITIONALSEARCHACCOUNT": "Conta de Pesquisa Adicional", + "ADDITIONALSEARCHCONTACT": "Contato de Pesquisa Adicional", + "ADDITIONALSEARCHLEAD": "Lead de Pesquisa Adicional", + "LEADID": "Lead ID", "DYNAMIC365CONTACT": "Contato", - "DYNAMIC365NOTHING": "Nenhuma coisa", + "DYNAMIC365NOTHING": "Nothing", "MODERN_AUTHENTICATION": "Autenticação Moderna", - "OPENNEWTAB": "Abrir nova guia" + "OPENNEWTAB": "Abrir Nova Aba" } } diff --git a/public/app/main/apps/jscripty/i18n/bs.json b/public/app/main/apps/jscripty/i18n/bs.json index c5e12d7..8d2329d 100644 --- a/public/app/main/apps/jscripty/i18n/bs.json +++ b/public/app/main/apps/jscripty/i18n/bs.json @@ -1,228 +1,228 @@ { "JSCRIPTY": { - "CLONE_PROJECT": "Clone Project", - "NAME": "Name", - "SEARCH_FOR_ANYONE": "Search", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "DESCRIPTION": "Description", + "CLONE_PROJECT": "Kloniraj Projekat", + "NAME": "Ime", + "SEARCH_FOR_ANYONE": "Traži", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "DESCRIPTION": "Opis", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "PROJECT_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field", - "NAME_MUST_VALID_PATTERN": "Wrong format" + "NAME_REQUIRED": "Obavezno polje", + "PROJECT_REQUIRED": "Obavezno polje", + "FIELD_REQUIRED": "Obavezno polje", + "NAME_MUST_VALID_PATTERN": "Pogrešan format" }, - "SAVE": "Save", - "PROJECTS": "Projects", - "ADD_PROJECT": "Add Project", - "EDIT_PROJECT": "Edit Project", - "DELETE_PROJECT": "Delete Project", + "SAVE": "Sačuvaj", + "PROJECTS": "Projekti", + "ADD_PROJECT": "Dodaj Projekat", + "EDIT_PROJECT": "Uredi Projekat", + "DELETE_PROJECT": "Izbriši Projekat", "JSCRIPTY": "Jscripty", - "ID": "Id", - "PROJECT": "Project", - "CREATED_AT": "Created At", - "NEW_PROJECT": "New Project", - "EDIT": "Edit", - "SETTINGS": "Settings", - "GENERAL": "General", - "BUILDER": "Builder", - "PREVIEW": "Preview", - "OPEN_CONTACT": "Open Contact", - "SENDUNPAUSEONSUBMIT": "Unpause agent on Submit", + "ID": "ID", + "PROJECT": "Projekat", + "CREATED_AT": "Kreirano U", + "NEW_PROJECT": "Novi Projekat", + "EDIT": "Uredi", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "BUILDER": "Graditelj", + "PREVIEW": "Pregled", + "OPEN_CONTACT": "Otvori Kontakt", + "SENDUNPAUSEONSUBMIT": "Skini pauzu specijalista nakon Podnošenja", "HELP": { - "NAME": "Only numbers, letters and specific characters (._) are supported", - "ENABLEUNCOMPLETESAVE": "Allow to save the agent session even if the survey is not complete", - "SENDUNPAUSEONSUBMIT": "At the end of the survey, automatically stop the agent's pause" + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)", + "ENABLEUNCOMPLETESAVE": "Dozvoli da se sesija specijaliste sačuva čak i ako anketa nije završena", + "SENDUNPAUSEONSUBMIT": "Na kraju ankete, automatski zaustavi pauzu specijaliste" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "JSCRIPTYSESSIONS": "Project Sessions", - "SESSIONS": "Sessions", - "STARTTIME": "Start Time", - "ENDTIME": "End Time", - "MEMBERNAME": "Member Name", - "CALLERIDNUM": "Caller Number", - "NO_SESSION_AVAILABLE": "No Sessions available", - "SESSION_RESULTS": "Session Results", - "SHOW_QUESTIONS_SESSION": "Show Session Results", - "ANSWERS": "Answers", - "NO_RESULTS_AVAILABLE": "No results available", - "TOTAL": "Total", - "ANSWER": "Answer", - "EXPORT_TO_CSV": "Export to CSV", - "NO_ANSWERS_AVAILABLE": "No answers available", - "DELETE_SESSION": "Delete Session", - "RESET_SESSION": "Reset Session", - "YES": "Yes", - "NO": "No", - "DO_YOU_WANT_TO_RESET_SESSION": "Do you want to reset the session?", - "ALL_SURVEY_DATA_WILL_BE_LOST": "All survey answers will be lost!", - "ENABLEUNCOMPLETESAVE": "Enable incomplete save", - "SUBMIT": "Submit", - "PROJECT_NOT_AVAILABLE": "Project is not available. Please contact the administrator", - "COMPLETE": "Complete", - "SESSIONS_PROJECT": "Go to Sessions" + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "JSCRIPTYSESSIONS": "Sesija Projekta", + "SESSIONS": "Sesije", + "STARTTIME": "Vrijeme Početka", + "ENDTIME": "Vrijeme Završetka", + "MEMBERNAME": "Ime Člana", + "CALLERIDNUM": "Broj Pozivaoca", + "NO_SESSION_AVAILABLE": "Nema dostupnih sesija", + "SESSION_RESULTS": "Reultati Sesije", + "SHOW_QUESTIONS_SESSION": "Prikaži Rezultate Sesije", + "ANSWERS": "Odgovori", + "NO_RESULTS_AVAILABLE": "Nema dostupnih rezultata", + "TOTAL": "Ukupno", + "ANSWER": "Odgovori", + "EXPORT_TO_CSV": "Izvoz u CSV", + "NO_ANSWERS_AVAILABLE": "Nema dostupnih odgovora", + "DELETE_SESSION": "Izbriši Sesiju", + "RESET_SESSION": "Poništi Sesiju", + "YES": "Da", + "NO": "Ne", + "DO_YOU_WANT_TO_RESET_SESSION": "Želiš li poništiti sesiju?", + "ALL_SURVEY_DATA_WILL_BE_LOST": "Svi odgovori na anketu će biti izgubljeni!", + "ENABLEUNCOMPLETESAVE": "Omogući nepotpuno spremanje", + "SUBMIT": "Podnesi", + "PROJECT_NOT_AVAILABLE": "Projekat nije dostupan. Molimo kontaktiraj Kontakt Centar Menadžera", + "COMPLETE": "Završi", + "SESSIONS_PROJECT": "Idi na Sesije" }, "mwForm": { "form": { - "name": "Title", - "name.placeholder": "Form title", - "description": "Description" + "name": "Naziv", + "name.placeholder": "Naziv forme", + "description": "Opis" }, "buttons": { - "addPage": "Add page", - "moveDown": "Move down", - "moveUp": "Move up", - "removePage": "Remove page", - "remove": "Remove", - "addElement": "Add element", - "questionReady": "Ready", - "next": "Next", - "back": "Back", - "submit": "Submit", - "begin": "Begin", - "fold": "Fold", - "unfold": "Unfold", - "edit": "Edit", - "clone": "Clone", - "view": "View" + "addPage": "Dodaj stranicu", + "moveDown": "Pomakni dolje", + "moveUp": "Pomakni gore", + "removePage": "Ukloni stranicu", + "remove": "Ukloni", + "addElement": "Dodaj element", + "questionReady": "Spreman", + "next": "Sljedeći", + "back": "Nazad", + "submit": "Podnesi", + "begin": "Počni", + "fold": "Preklopi", + "unfold": "Rasklopi", + "edit": "Uredi", + "clone": "Kloniraj", + "view": "Pogledaj" }, "page": { "tab": { - "heading": "Page {{page}} of {{allPages}}" + "heading": "Stranica {{page}} od {{allPages}}" }, "elements": { - "empty": "Empty page" + "empty": "Prazna stranica" }, - "pageWithNameCheckbox": "named", - "name": "Page name" + "pageWithNameCheckbox": "imenovan", + "name": "Naziv stranice" }, "pageFlow": { - "afterPage": "After page {{page}}:", - "afterQuestionAnswer": "Go to page based on answer", - "goToPage": "Go to page {{page.number}}", - "goToNextPage": "Continue to next page", - "submitForm": "Submit form" + "afterPage": "Nakon stranice {{page}}:", + "afterQuestionAnswer": "Idi na stranicu na osnovu odgovora", + "goToPage": "Idi na stranicu {{page.number}}", + "goToNextPage": "Nastavi na sljedeću stranicu", + "submitForm": "Podnesi formu" }, "elements": { - "question": "Question", - "image": "Image", - "paragraph": "Paragraph" + "question": "Pitanje", + "image": "Slika", + "paragraph": "Paragraf" }, "question": { "types": { "text": { - "name": "Short text" + "name": "Kratki tekst" }, "textarea": { - "name": "Long text" + "name": "Dugi tekst" }, "radio": { "name": "Radio" }, "select": { - "name": "Select" + "name": "Odaberi" }, "checkbox": { - "name": "Checkboxes" + "name": "Polja za potvrdu" }, "grid": { - "name": "Grid" + "name": "Mreža" }, "priority": { - "name": "Priority" + "name": "Prioritet" }, "division": { - "name": "Division" + "name": "Divizija" }, "number": { - "name": "Number" + "name": "Broj" }, "date": { - "name": "Date" + "name": "Datum" }, "datetime": { - "name": "Datetime" + "name": "Datum i vrijeme" }, "time": { - "name": "Time" + "name": "Vrijeme" }, "email": { - "name": "Email" + "name": "E-mail" }, "range": { - "name": "Range" + "name": "Raspon" }, "url": { "name": "URL" } }, - "text": "Question text", - "type": "Question type", - "required": "Required", + "text": "Tekst pitanja", + "type": "Vrsta pitanja", + "required": "Obavezno", "preview": { - "text": "Short answer text", - "textarea": "Long answer text", - "otherAnswer": "Other" + "text": "Tekst kratkog odgovora", + "textarea": "Tekst dugog odgovora", + "otherAnswer": "Ostalo" }, "division": { - "quantity": "Quantity", - "unit": "Unit label", - "assignedSumLabel": "Assigned", - "fromRequiredLabel": "from required" + "quantity": "Količina", + "unit": "Oznaka jedinice", + "assignedSumLabel": "Dodijeljeno", + "fromRequiredLabel": "od potrebnog" }, "priority": { - "sorted": "Sorted", - "available": "Available", - "clickToAddItem": "Click to add item" + "sorted": "Sortirano", + "available": "Dostupno", + "clickToAddItem": "Klikni da dodaš stavku" }, "grid": { - "cellInputType": "Cell input type", + "cellInputType": "Vrsta unosa Ćelije", "cellInputTypes": { "radio": "Radio", - "checkbox": "Checkbox", - "text": "Text", - "number": "Number", - "date": "Date", - "time": "Time" + "checkbox": "Polje za potvrdu", + "text": "Tekst", + "number": "Broj", + "date": "Datum", + "time": "Vrijeme" }, - "rowLabel": "Row {{row}}", - "clickToAddRow": "Click to add row", - "columnLabel": "Column {{col}}", - "clickToAddColumn": "Click to add column" + "rowLabel": "Red {{row}}", + "clickToAddRow": "Klikni da dodaš red", + "columnLabel": "Kolona {{col}}", + "clickToAddColumn": "Klikni da dodaš kolonu" }, "range": { - "from": "Range from", - "to": "to" + "from": "Raspon od", + "to": "do" }, "number": { "min": "Min", - "max": "Max" + "max": "Maks" }, - "orLabel": "or ", - "otherLabel": "Other: ", - "userAnswer": "User answer", + "orLabel": "ili", + "otherLabel": "Ostalo:", + "userAnswer": "Odgovor korisnika", "buttons": { - "addOption": "Click to add option", - "addOther": "Add 'Other'" + "addOption": "Klikni da dodate opciju", + "addOther": "Dodaj 'Ostalo'" } }, "image": { - "selectImageButton": "Select image", - "caption": "Image caption" + "selectImageButton": "Odaberi sliku", + "caption": "Natpis slike" }, "paragraph": { - "placeholder": "Enter paragraph text" + "placeholder": "Unesi tekst paragrafa" }, "confirmationPage": { - "title": "Confirmation page", - "customMessage": "Custom confirmation message", - "defaultMessage": "Your response has been saved", - "errorMessage": "Error! Your response has not been saved", - "pendingMessage": "Your response is being saved" + "title": "Stranica potvrde", + "customMessage": "Prilagođena poruka potvrde", + "defaultMessage": "Vaš odgovor je sačuvan", + "errorMessage": "Greška! Vaš odgovor nije sačuvan", + "pendingMessage": "Vaš odgovor se pohranjuje" } } } diff --git a/public/app/main/apps/jscripty/i18n/is.json b/public/app/main/apps/jscripty/i18n/is.json new file mode 100644 index 0000000..c5e12d7 --- /dev/null +++ b/public/app/main/apps/jscripty/i18n/is.json @@ -0,0 +1,228 @@ +{ + "JSCRIPTY": { + "CLONE_PROJECT": "Clone Project", + "NAME": "Name", + "SEARCH_FOR_ANYONE": "Search", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "DESCRIPTION": "Description", + "ERRORS": { + "NAME_REQUIRED": "Mandatory field", + "PROJECT_REQUIRED": "Mandatory field", + "FIELD_REQUIRED": "Mandatory field", + "NAME_MUST_VALID_PATTERN": "Wrong format" + }, + "SAVE": "Save", + "PROJECTS": "Projects", + "ADD_PROJECT": "Add Project", + "EDIT_PROJECT": "Edit Project", + "DELETE_PROJECT": "Delete Project", + "JSCRIPTY": "Jscripty", + "ID": "Id", + "PROJECT": "Project", + "CREATED_AT": "Created At", + "NEW_PROJECT": "New Project", + "EDIT": "Edit", + "SETTINGS": "Settings", + "GENERAL": "General", + "BUILDER": "Builder", + "PREVIEW": "Preview", + "OPEN_CONTACT": "Open Contact", + "SENDUNPAUSEONSUBMIT": "Unpause agent on Submit", + "HELP": { + "NAME": "Only numbers, letters and specific characters (._) are supported", + "ENABLEUNCOMPLETESAVE": "Allow to save the agent session even if the survey is not complete", + "SENDUNPAUSEONSUBMIT": "At the end of the survey, automatically stop the agent's pause" + }, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "JSCRIPTYSESSIONS": "Project Sessions", + "SESSIONS": "Sessions", + "STARTTIME": "Start Time", + "ENDTIME": "End Time", + "MEMBERNAME": "Member Name", + "CALLERIDNUM": "Caller Number", + "NO_SESSION_AVAILABLE": "No Sessions available", + "SESSION_RESULTS": "Session Results", + "SHOW_QUESTIONS_SESSION": "Show Session Results", + "ANSWERS": "Answers", + "NO_RESULTS_AVAILABLE": "No results available", + "TOTAL": "Total", + "ANSWER": "Answer", + "EXPORT_TO_CSV": "Export to CSV", + "NO_ANSWERS_AVAILABLE": "No answers available", + "DELETE_SESSION": "Delete Session", + "RESET_SESSION": "Reset Session", + "YES": "Yes", + "NO": "No", + "DO_YOU_WANT_TO_RESET_SESSION": "Do you want to reset the session?", + "ALL_SURVEY_DATA_WILL_BE_LOST": "All survey answers will be lost!", + "ENABLEUNCOMPLETESAVE": "Enable incomplete save", + "SUBMIT": "Submit", + "PROJECT_NOT_AVAILABLE": "Project is not available. Please contact the administrator", + "COMPLETE": "Complete", + "SESSIONS_PROJECT": "Go to Sessions" + }, + "mwForm": { + "form": { + "name": "Title", + "name.placeholder": "Form title", + "description": "Description" + }, + "buttons": { + "addPage": "Add page", + "moveDown": "Move down", + "moveUp": "Move up", + "removePage": "Remove page", + "remove": "Remove", + "addElement": "Add element", + "questionReady": "Ready", + "next": "Next", + "back": "Back", + "submit": "Submit", + "begin": "Begin", + "fold": "Fold", + "unfold": "Unfold", + "edit": "Edit", + "clone": "Clone", + "view": "View" + }, + "page": { + "tab": { + "heading": "Page {{page}} of {{allPages}}" + }, + "elements": { + "empty": "Empty page" + }, + "pageWithNameCheckbox": "named", + "name": "Page name" + }, + "pageFlow": { + "afterPage": "After page {{page}}:", + "afterQuestionAnswer": "Go to page based on answer", + "goToPage": "Go to page {{page.number}}", + "goToNextPage": "Continue to next page", + "submitForm": "Submit form" + }, + "elements": { + "question": "Question", + "image": "Image", + "paragraph": "Paragraph" + }, + "question": { + "types": { + "text": { + "name": "Short text" + }, + "textarea": { + "name": "Long text" + }, + "radio": { + "name": "Radio" + }, + "select": { + "name": "Select" + }, + "checkbox": { + "name": "Checkboxes" + }, + "grid": { + "name": "Grid" + }, + "priority": { + "name": "Priority" + }, + "division": { + "name": "Division" + }, + "number": { + "name": "Number" + }, + "date": { + "name": "Date" + }, + "datetime": { + "name": "Datetime" + }, + "time": { + "name": "Time" + }, + "email": { + "name": "Email" + }, + "range": { + "name": "Range" + }, + "url": { + "name": "URL" + } + }, + "text": "Question text", + "type": "Question type", + "required": "Required", + "preview": { + "text": "Short answer text", + "textarea": "Long answer text", + "otherAnswer": "Other" + }, + "division": { + "quantity": "Quantity", + "unit": "Unit label", + "assignedSumLabel": "Assigned", + "fromRequiredLabel": "from required" + }, + "priority": { + "sorted": "Sorted", + "available": "Available", + "clickToAddItem": "Click to add item" + }, + "grid": { + "cellInputType": "Cell input type", + "cellInputTypes": { + "radio": "Radio", + "checkbox": "Checkbox", + "text": "Text", + "number": "Number", + "date": "Date", + "time": "Time" + }, + "rowLabel": "Row {{row}}", + "clickToAddRow": "Click to add row", + "columnLabel": "Column {{col}}", + "clickToAddColumn": "Click to add column" + }, + "range": { + "from": "Range from", + "to": "to" + }, + "number": { + "min": "Min", + "max": "Max" + }, + "orLabel": "or ", + "otherLabel": "Other: ", + "userAnswer": "User answer", + "buttons": { + "addOption": "Click to add option", + "addOther": "Add 'Other'" + } + }, + "image": { + "selectImageButton": "Select image", + "caption": "Image caption" + }, + "paragraph": { + "placeholder": "Enter paragraph text" + }, + "confirmationPage": { + "title": "Confirmation page", + "customMessage": "Custom confirmation message", + "defaultMessage": "Your response has been saved", + "errorMessage": "Error! Your response has not been saved", + "pendingMessage": "Your response is being saved" + } + } +} diff --git a/public/app/main/apps/mail/i18n/bs.json b/public/app/main/apps/mail/i18n/bs.json index 22a7db6..caf47e2 100644 --- a/public/app/main/apps/mail/i18n/bs.json +++ b/public/app/main/apps/mail/i18n/bs.json @@ -1,346 +1,346 @@ { "MAIL": { - "ADVANCED": "Advanced", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", - "DOWNLOAD": "Download", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "YOU_ARE_REGISTERED_AS_A": "You are registered as a", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "ADVANCED": "Napredno", + "DOWNLOAD_WITH_ATTACHMENTS": "Skini sa prilozima", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Skini bez priloga", + "DOWNLOAD": "Skini", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "DOWNLOAD_INTERACTION": "Skini", + "YOU_ARE_REGISTERED_AS_A": "Registrovan si kao", + "TRANSFER": "Prijenos", + "QUEUETRANSFER": "Queue Prijenos", + "QUEUETRANSFERTIMEOUT": "Timeout Queue Prijenosa", + "AGENTTRANSFER": "Prijenos Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Spacijaliste", "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "VARIABLE": "Variable", - "SEND_AS": "Send as", - "NEW_MAILSUBSTATUS": "New Sub Status", - "ADD_MAILSUBSTATUS": "Add Sub Status", - "MAILSUBSTATUSES": "Email Sub Statuses", - "EDIT_MAILSUBSTATUS": "Edit", - "DELETE_MAILSUBSTATUS": "Delete", - "FONT_FAMILY": "Font Family", - "FONT_SIZE": "Font Size", - "MARK_AS_UNREAD": "Mark as unread", - "ACCEPTED": "Accepted", - "CANNEDANSWERS": "Canned Answers", - "MAILCANNEDANSWERS": "Canned Answers", - "NO_MAILCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_MAILCANNEDANSWER": "New Canned Answer", - "ADD_MAILCANNEDANSWER": "Add Canned Answer", - "EDIT_MAILCANNEDANSWER": "Edit Canned Answer", - "DELETE_MAILCANNEDANSWER": "Delete Canned Answer", - "SHOW_ORIGINAL_MESSAGE": "Show original message", - "PENDING": "Pending", - "SEND_AS_PENDING": "Send as Pending", - "SEND_AND_CLOSE": "Send and Close", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", + "EDIT_TAG": "Uredi Tag", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog specijalistu", + "NOTIFICATION": "Obavijest", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Protresi", + "NOTIFICATIONTEMPLATE": "Šablon", + "SYSTEM": "Sistem", + "EDIT_SYSTEM": "Uredi Sistem", + "COMMAND": "Komanda", + "VARIABLE": "Varijabla", + "SEND_AS": "Pošalji kao", + "NEW_MAILSUBSTATUS": "Novi Podstatus", + "ADD_MAILSUBSTATUS": "Dodaj Podstatus", + "MAILSUBSTATUSES": "E-mail Podstatusi", + "EDIT_MAILSUBSTATUS": "Uredi", + "DELETE_MAILSUBSTATUS": "Izbriši", + "FONT_FAMILY": "Font", + "FONT_SIZE": "Veličina Fonta", + "MARK_AS_UNREAD": "Označi kao nepročitano", + "ACCEPTED": "Prihvaćeno", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "MAILCANNEDANSWERS": "Pripremljeni Odgovori", + "NO_MAILCANNEDANSWER_AVAILABLE": "Nema dostupnih Pripremljenih Odgovora", + "NEW_MAILCANNEDANSWER": "Novi Pripremljeni Odgovor", + "ADD_MAILCANNEDANSWER": "DOdaj Pripremljeni Odgovor", + "EDIT_MAILCANNEDANSWER": "Uredi Pripremljeni Odgovor", + "DELETE_MAILCANNEDANSWER": "Izbriši Pripremljeni Odgovor", + "SHOW_ORIGINAL_MESSAGE": "Pokaži originalnu poruku", + "PENDING": "Na čekanju", + "SEND_AS_PENDING": "Pošalji kao Na čekanju", + "SEND_AND_CLOSE": "Pošalji i Zatvori", + "CANNED_ANSWER_NOT_FOUND": "Nije pronađen nijedan Pripremljeni Odgovor", + "CANNED_ANSWER_SEARCH": "Unesi tekst za pretraživanje Pripremljenih Odgovora", "SPYINTERACTION": "Spy", - "ADD_NOTE": "Add note", - "NOTE": "Note", - "TAGS": "Tags", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_MAILQUEUE": "Go To Realtime Mail Queue", - "PARTIALPAUSE": "Parital Pause", - "BUSY": "Busy", + "ADD_NOTE": "Dodaj bilješku", + "NOTE": "Bilješka", + "TAGS": "Tag-ovi", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "GOTOREALTIME_MAILQUEUE": "Idi na Realtime E-mail Queue", + "PARTIALPAUSE": "Parcijalna Pauza", + "BUSY": "Zauzet", "TIMER": "Timer", "IDLE": "Idle", - "CAPACITY": "Capacity", - "UNPAUSE": "End Pause", - "DEFAULT_PAUSE": "Default pause", - "LOGOUT": "Logout", - "AGENTADD_QUEUE": "Add agent to Email queue", + "CAPACITY": "Kapacitet", + "UNPAUSE": "Prekini Pauzu", + "DEFAULT_PAUSE": "Zadana pauza", + "LOGOUT": "Odjava", + "AGENTADD_QUEUE": "Dodaj Specijalistu na E-mail Queue", "VOICE": "Voice", "CHAT": "Chat", - "SMS": "Sms", - "OPENCHANNEL": "Open channel", + "SMS": "SMS", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", "REALTIME": "Realtime", - "AGENTS": "Agents", + "AGENTS": "Specijalisti", "QUEUES": "Queues", - "ACCOUNTS": "Accounts", - "FULLNAME": "Full Name", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "PAUSE": "Pause", - "LOGGED_IN": "Logged In", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", - "TOTAL": "Total", - "IN": "In", - "OUT": "Out", + "ACCOUNTS": "Nalozi", + "FULLNAME": "Puno Ime", + "INTERNAL": "Interni", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", + "PAUSE": "Pauza", + "LOGGED_IN": "Prijavljen", + "PAUSED": "Pauzirano", + "READY": "Spreman", + "WAITING": "Čeka", + "TOTAL": "Ukupno", + "IN": "U", + "OUT": "Van", "IMAP_STATUS": "IMAP Status", "SMTP_STATUS": "SMTP Status", - "DISABLED": "Disabled", - "CONNECTED": "Connected", - "NEVER_VERIFIED": "Never Verified", - "ERROR": "Error", - "EDIT_ACCOUNT": "Edit Account", - "VERIFY_SMTP": "Verify SMTP", - "VERIFIED": "Verified", - "VERIFYSMTP_MAILACCOUNT": "Verify SMTP", - "GOTOREALTIME_MAILACCOUNT": "Go to Realtime Email Account", - "GOTO_MAILACCOUNT": "Go to Realtime Email Account", - "TEXT": "Text", - "TIMES": "Number of times per interaction", - "REPLY_TYPE": "Reply Type", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "AUTOREPLY": "Auto Reply", - "SHOW_AUTOREPLY": "Show Auto Reply", - "SHOW_DETAILS": "Show details", - "HIDE_DETAILS": "Hide details", - "TO": "To", - "FROM": "From", - "DATE": "Date", - "CC": "Cc", - "REPLY": "Reply", - "REPLY_ALL": "Reply All", - "FORWARD": "Forward", - "SUBJECT": "Subject", - "BCC": "Bcc", - "SEND": "Send", - "ATTACHMENT": "Attachment", - "ATTACHMENTS": "Attachments", - "NAME": "Name", - "MAILQUEUES": "Email Queues", - "SEARCH_FOR_ANYONE": "Search", - "STRATEGY": "Strategy", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "DISABLED": "Onemogućeno", + "CONNECTED": "Konektovano", + "NEVER_VERIFIED": "Nikad Verifikovano", + "ERROR": "Greška", + "EDIT_ACCOUNT": "Uredi Nalog", + "VERIFY_SMTP": "Verifikuj SMTP", + "VERIFIED": "Verifikovano", + "VERIFYSMTP_MAILACCOUNT": "Verifikuj SMTP", + "GOTOREALTIME_MAILACCOUNT": "Idi na Realtime E-mail Nalog", + "GOTO_MAILACCOUNT": "Idi na Realtime E-mail Nalog", + "TEXT": "Tekst", + "TIMES": "Broj puta po interakciji", + "REPLY_TYPE": "Odgovori Vrsta", + "EDIT_AUTOREPLY": "Uredi Automatski Odgovor", + "AUTOREPLY": "Automatski Odgovor", + "SHOW_AUTOREPLY": "Pokaži Automatski Odgovor", + "SHOW_DETAILS": "Pokaži detalje", + "HIDE_DETAILS": "Sakrij detalje", + "TO": "Za", + "FROM": "Od", + "DATE": "Datum", + "CC": "CC", + "REPLY": "Odgovori", + "REPLY_ALL": "Odgovori Svima", + "FORWARD": "Naprijed", + "SUBJECT": "Predmet", + "BCC": "BCC", + "SEND": "Pošalji", + "ATTACHMENT": "Prilog", + "ATTACHMENTS": "Prilozi", + "NAME": "Ime", + "MAILQUEUES": "E-mail Queues", + "SEARCH_FOR_ANYONE": "Traži", + "STRATEGY": "Strategija", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Zadana pauza ako je obavezna dispozicija omogućena", "ERRORS": { - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "COMMAND_REQUIRED": "Mandatory Field", - "FONT_SIZE_REQUIRED": "Mandatory Field", - "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "VALUE_REQUIRED": "Mandatory Field", - "TEXT_REQUIRED": "Mandatory Field", - "REPLY_TYPE_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "EMAIL_ADDRESS_REQUIRED": "Mandatory Field", - "EMAIL_ADDRESS_MUST_VALID": "Wrong format", - "HOST_REQUIRED": "Mandatory Field", - "USERNAME_REQUIRED": "Mandatory Field", - "PORT_REQUIRED": "Mandatory Field", - "CONNTIMEOUT_REQUIRED": "Mandatory Field", - "AUTHTIMEOUT_REQUIRED": "Mandatory Field", - "ACCEPTURL_MUST_VALID_URL": "Wrong format", - "TIMEOUT_REQUIRED": "Mandatory Field", - "REJECTURL_MUST_VALID_URL": "Wrong format", - "CLOSEURL_MUST_VALID_URL": "Wrong format", - "AGENT_REQUIRED": "Mandatory Field", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "DISPOSITION_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PRIORITY_REQUIRED": "Mandatory Field", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUE_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "PASSWORD_REQUIRED": "Mandatory Field", - "SERVICE_REQUIRED": "Mandatory Field", - "IMAP_HOST_REQUIRED": "Mandatory Field", - "IMAP_PORT_REQUIRED": "Mandatory Field", - "SMTP_HOST_REQUIRED": "Mandatory Field", - "SMTP_PORT_REQUIRED": "Mandatory Field", - "CONFIRM_NOT_MATCH": "The passwords inserted don't match", - "KEY_MAX_LENGTH": "Key must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field" + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "TAG_REQUIRED": "Obavezno polje", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "COMMAND_REQUIRED": "Obavezno polje", + "FONT_SIZE_REQUIRED": "Obavezno polje", + "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "TEXT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "VALUE_REQUIRED": "Obavezno polje", + "TEXT_REQUIRED": "Obavezno polje", + "REPLY_TYPE_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno polje", + "EMAIL_ADDRESS_REQUIRED": "Obavezno polje", + "EMAIL_ADDRESS_MUST_VALID": "Pogrešan format", + "HOST_REQUIRED": "Obavezno polje", + "USERNAME_REQUIRED": "Obavezno polje", + "PORT_REQUIRED": "Obavezno polje", + "CONNTIMEOUT_REQUIRED": "Obavezno polje", + "AUTHTIMEOUT_REQUIRED": "Obavezno polje", + "ACCEPTURL_MUST_VALID_URL": "Pogrešan format", + "TIMEOUT_REQUIRED": "Obavezno polje", + "REJECTURL_MUST_VALID_URL": "Pogrešan format", + "CLOSEURL_MUST_VALID_URL": "Pogrešan format", + "AGENT_REQUIRED": "Obavezno polje", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "DISPOSITION_REQUIRED": "Obavezno polje", + "CONDITION_REQUIRED": "Obavezno polje", + "TRUEPRIORITY_REQUIRED": "Obavezno polje", + "FALSEPRIORITY_REQUIRED": "Obavezno polje", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "PRIORITY_REQUIRED": "Obavezno polje", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "QUEUE_REQUIRED": "Obavezno polje", + "LIST_REQUIRED": "Obavezno polje", + "PASSWORD_REQUIRED": "Obavezno polje", + "SERVICE_REQUIRED": "Obavezno polje", + "IMAP_HOST_REQUIRED": "Obavezno polje", + "IMAP_PORT_REQUIRED": "Obavezno polje", + "SMTP_HOST_REQUIRED": "Obavezno polje", + "SMTP_PORT_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinke se ne podudaraju", + "KEY_MAX_LENGTH": "Ključ mora imati maksimalnu dužinu {{max}}", + "KEY_REQUIRED": "Obavezno polje", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno polje", + "FIELD_REQUIRED": "Obavezno polje" }, - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "ADD_MAILQUEUE": "Add Email Queue", - "EDIT_MAILQUEUE": "Edit Email Queue", - "DELETE_MAILQUEUE": "Delete Email Queue", - "SETTINGS": "Settings", - "GENERAL": "General", - "SAVE": "Save", - "MAILACCOUNTS": "Email Accounts", - "EMAIL_ADDRESS": "Email Address", - "ADD_MAILACCOUNT": "Add Email Account", - "EDIT_MAILACCOUNT": "Edit Email Account", - "DELETE_MAILACCOUNT": "Delete Email Account", - "DISPOSITIONS": "Dispositions", + "AGENT_TIMEOUT": "Timeout Specijaliste", + "DESCRIPTION": "Opis", + "ADD_MAILQUEUE": "Dodaj E-mail Queue", + "EDIT_MAILQUEUE": "Uredi E-mail Queue", + "DELETE_MAILQUEUE": "Izriši E-mail Queue", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "SAVE": "Sačuvaj", + "MAILACCOUNTS": "E-mail Nalozi", + "EMAIL_ADDRESS": "E-mail Adresa", + "ADD_MAILACCOUNT": "Dodaj E-mail nalog", + "EDIT_MAILACCOUNT": "Uredi E-mail Nalog", + "DELETE_MAILACCOUNT": "Izbriši E-mail Nalog", + "DISPOSITIONS": "Dispozicije", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", - "OTHERS": "Others", - "LIST": "List", - "TEMPLATE": "Template", - "FIDELITY": "Fidelity", - "SERVICE": "Service", - "CREATED_AT": "Created At", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", + "ACTIONS": "Radnje", + "OTHERS": "Ostali", + "LIST": "Lista", + "TEMPLATE": "Šablon", + "FIDELITY": "Vjernost", + "SERVICE": "Servis", + "CREATED_AT": "Kreirano U", + "ACCEPT": "Prihvati", + "ACCEPTMETHOD": "Metoda Prihvaćanja", + "ACCEPTURL": "Prihvati URL", + "REJECT": "Odbaci", + "REJECTMETHOD": "Metoda Odbacivanja", + "REJECTURL": "Odbaci URL", + "CLOSE": "Zatvori", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", "WHITELABEL": "White Label", - "SIGNATURE": "Signature", + "SIGNATURE": "Potpis", "IMAP": "IMAP", "HOST": "Host", - "USERNAME": "Username", + "USERNAME": "Korisnično ime", "PORT": "Port", - "MAILBOX": "Mailbox", + "MAILBOX": "Poštansko sanduče", "FILTER": "Filter", - "CONNTIMEOUT": "Connection Timeout [sec]", - "AUTHTIMEOUT": "Authentication Timeout [sec]", - "DELETE": "Delete Email From Server", + "CONNTIMEOUT": "Timeout Konekcije [sec]", + "AUTHTIMEOUT": "Timeout Autentifikacije [sec] ", + "DELETE": "Izbriši E-mail sa Servera", "SSL": "SSL", "KEEPALIVE": "Keepalive", - "POLLING": "Polling", + "POLLING": "Anketiranje", "SMTP": "SMTP", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", - "MAIL": "Email", - "ID": "Id", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "BACK": "Nazad", + "MAIL": "E-mail", + "ID": "ID", "TIMEOUT": "Timeout", - "PASSWORD": "Password", - "NO_MAILDISPOSITION_AVAILABLE": "No Email Dispositions available", - "ADD_MAILDISPOSITION": "Add Email Disposition", - "NEW_MAILDISPOSITION": "New Email Disposition", - "EDIT_MAILDISPOSITION": "Edit Email Disposition", - "DELETE_MAILDISPOSITION": "Delete Email Disposition", - "MAILDISPOSITIONS": "Email Dispositions", - "NEW_MAILQUEUE": "New Email Queue", - "NEW_MAILACCOUNT": "New Email Account", - "NO_AVAILABLE_INFO": "No availables info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", + "PASSWORD": "Lozinka", + "NO_MAILDISPOSITION_AVAILABLE": "Nema dostupnih E-mail Dispozicija", + "ADD_MAILDISPOSITION": "Dodaj E-mail Dispoziciju", + "NEW_MAILDISPOSITION": "Nova E-mail Dispozicija", + "EDIT_MAILDISPOSITION": "Uredi E-mail Dispoziciju", + "DELETE_MAILDISPOSITION": "Izbriši E-mail Dispoziciju", + "MAILDISPOSITIONS": "E-mail Dispozicije", + "NEW_MAILQUEUE": "Novi E-mail Queue", + "NEW_MAILACCOUNT": "Novi E-mail Nalog", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", "HELP": { - "FONT_FAMILY": "Default Font Family", - "FONT_SIZE": "Default Font Size", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "USERNAME": "Username used for authentication", - "PASSWORD": "Password used for authentication", - "SECURE": "If true, the connection will use TLS when connecting to server", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", - "MARK_AS_UNREAD": "Enable/Disable agent to mark as unread the last message of an interaction", - "CLOUD_PROVIDER": "Cloud Provider used for authentication" + "FONT_FAMILY": "Zadani Font", + "FONT_SIZE": "Zadana Veličina Fonta", + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)", + "USERNAME": "Korisničko ime koje se koristi za autentifikaciju", + "PASSWORD": "Lozinka koja se koristi za autentifikaciju", + "SECURE": "Ako je tačno, konekcija će koristiti TLS prilikom povezivanja na server", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Zadana pauza kada je Obavezna dispozicija omogućena", + "MARK_AS_UNREAD": "Omogući/Onemogući specijalistu da oznaži posljednju oruku interakcije kao nepročitanu", + "CLOUD_PROVIDER": "Cloud Provajder koji se koristi za autentifikaciju" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "TEAMADD_MAILQUEUE": "Add Team to Email Queue", - "AGENTADD_MAILQUEUE": "Add Agent to Email Queue", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "AGENT": "Agent", - "EDIT_AGENT": "Edit Agent", - "EDIT_CLOSE": "Edit Close", - "DISPOSITION": "Disposition", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "TEAMADD_MAILQUEUE": "Dodaj Tim na E-mail Queue", + "AGENTADD_MAILQUEUE": "Dodaj Specijalistu na E-mail Queue", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "AGENT": "Specijalist", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_CLOSE": "Uredi Zatvaranje", + "DISPOSITION": "Dispozicija", "GOTOIF": "GotoIf", - "EDIT_GOTOIF": "Edit GotoIf", - "CONDITION": "Condition", - "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", + "EDIT_GOTOIF": "Uredi GotoIf", + "CONDITION": "Stanje", + "TRUEPRIORITY": "Pravi Prioritet", + "FALSEPRIORITY": "Pogrešan Prioritet", "GOTOP": "GotoP", - "EDIT_GOTOP": "Edit GotoP", - "PRIORITY": "Priority", + "EDIT_GOTOP": "Uredi GotoP", + "PRIORITY": "Prioritet", "NOOP": "Noop", - "EDIT_NOOP": "Edit Noop", - "VALUE": "Value", + "EDIT_NOOP": "Uredi Noop", + "VALUE": "Vrijednost", "QUEUE": "Queue", - "EDIT_QUEUE": "Edit Queue", - "INTERACTIONS": "Interactions", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", - "CONTACT": "Contact", - "CLOSEDAT": "Closed At", - "NOTES": "Notes", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "ACTIVE": "Active", - "SECURE": "Secure", - "AUTHENTICATION": "Authentication", + "EDIT_QUEUE": "Uredi Queue", + "INTERACTIONS": "Interakcije", + "STARTEDAT": "Počelo U", + "LASTMESSAGE": "Zadnja poruka", + "CONTACT": "Kontakt", + "CLOSEDAT": "Zatvoreno U", + "NOTES": "Bilješke", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "ACTIVE": "Aktivan", + "SECURE": "Sigurno", + "AUTHENTICATION": "Autentifikacija", "SMTP_HOST": "SMTP Host", "SMTP_PORT": "SMTP Port", "IMAP_HOST": "IMAP Host", "IMAP_PORT": "IMAP Port", - "CONFIRM_PASSWORD": "Confirm Password", - "SELECT_STATUS": "Select Status", - "OPENED": "Open", - "CLOSED": "Closed", - "ALL": "All", - "SELECT_ACCOUNT": "Select Account", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "SELECT_STATUS": "Odaberi Status", + "OPENED": "Otvoreno", + "CLOSED": "Zatvoreno", + "ALL": "Svi", + "SELECT_ACCOUNT": "Odaberi Nalog", "STATUS": "Status", - "ACCOUNT": "Account", - "OPEN": "Open", - "KEY": "Key", - "SMTPSERVICE": "SMTP Service", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", - "AGENTSADD_QUEUE": "Add agents to Email Queue", + "ACCOUNT": "Nalog", + "OPEN": "Otvori", + "KEY": "Ključ", + "SMTPSERVICE": "SMTP Servis", + "UNKNOWN": "Nepoznati", + "UNREGISTERED": "Neregistrovano", + "UNAVAILABLE": "Nedostupno", + "NOT_INUSE": "Nije u upotrebi", + "REACHABLE": "Dostupan", + "IN_USE": "U upotrebi", + "AGENTSADD_QUEUE": "Dodaj Specijaliste na E-mail Queue", "INFO": "Info", - "INTERACTIONS_MAILACCOUNT": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_MAILACCOUNT": "Add Agent to Email Account", - "TEAMS_ASSOCIATION": "Teams Association", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "DOWNLOAD_WITH_ATTACHMENT": "Download with attachment", - "DOWNLOAD_WITHOUT_ATTACHMENT": "Download without attachment", - "MODERN_AUTHENTICATION": "Modern Authentication", - "CLOUD_PROVIDER": "Cloud Provider", - "CUSTOM": "Custom", - "CREDENTIALS": "Credentials", + "INTERACTIONS_MAILACCOUNT": "Idi na Interakcije", + "REFRESH_INTERACTIONS": "Osvježi Interakcije", + "DELETE_INTERACTION": "Izbriši Interakciju", + "AGENTADD_MAILACCOUNT": "Dodaj Specijalistu na E-mail Nalog", + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje ekrana je u toku", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje ekrana je dostupno", + "DOWNLOAD_WITH_ATTACHMENT": "Skini sa prilogom", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Skini bez priloga", + "MODERN_AUTHENTICATION": "Moderna Autentifikacija", + "CLOUD_PROVIDER": "Cloud Provajder", + "CUSTOM": "Prilagođeno", + "CREDENTIALS": "Akreditiv", "NOTIFICATIONS": { - "ACCOUNT_CREATED_SUCCESS_TITLE": "Account successfully created", - "ACCOUNT_SAVED_SUCCESS_TITLE": "Account successfully saved", - "ACCOUNT_DELETE_TITLE": "Are you sure want to delete the account?", - "ACCOUNT_DELETE_MESSAGE": "{{ name }} will be deleted", - "ACCOUNT_DELETED_SUCCESS_TITLE": "Account successfully deleted", - "ACCOUNT_SERVICE_DELETE": "You cannot delete a service account", - "ACCOUNTS_DELETE_TITLE": "Are you sure want to delete the selected accounts?", - "ACCOUNTS_DELETE_MESSAGE": "{{ total }} accounts will be deleted", - "ACCOUNTS_DELETED_SUCCESS_TITLE": "Accounts successfully deleted", - "SMTP_CONNECTION_SUCCESS_TITLE": "Successfully connected to the SMTP server", - "SMTP_CONNECTION_FAIL_TITLE": "Unable to connect to the SMTP server", - "UNKNOWN_SMTP_SERVER": "Unknown STMP server" + "ACCOUNT_CREATED_SUCCESS_TITLE": "Nalog je uspješno kreiran", + "ACCOUNT_SAVED_SUCCESS_TITLE": "Nalog uspješno sačuvan", + "ACCOUNT_DELETE_TITLE": "Jesi li siguran da želiš izbrisati nalog?", + "ACCOUNT_DELETE_MESSAGE": "{{ name }} će biti obrisan", + "ACCOUNT_DELETED_SUCCESS_TITLE": "Nalog je uspješno obrisan", + "ACCOUNT_SERVICE_DELETE": "Ne možete izbrisati servisni nalog", + "ACCOUNTS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane naloge?", + "ACCOUNTS_DELETE_MESSAGE": "{{ total }} naloga će biti izbrisano", + "ACCOUNTS_DELETED_SUCCESS_TITLE": "Nalozi uspješno izbrisani", + "SMTP_CONNECTION_SUCCESS_TITLE": "Uspješno povezan na SMTP server", + "SMTP_CONNECTION_FAIL_TITLE": "Nije se moguće povezati na SMTP server", + "UNKNOWN_SMTP_SERVER": "Nepoznat SMTP server" } } } diff --git a/public/app/main/apps/mail/i18n/et.json b/public/app/main/apps/mail/i18n/et.json index 9c16790..a7ca5e8 100644 --- a/public/app/main/apps/mail/i18n/et.json +++ b/public/app/main/apps/mail/i18n/et.json @@ -326,6 +326,7 @@ "REPLY_TYPE": "Vastamise tüüp", "CLOUD_PROVIDER": "Pilvepakkuja", "CREDENTIALS": "Mandaat", - "CUSTOM": "Kohandatud" + "CUSTOM": "Kohandatud", + "MODERN_AUTHENTICATION": "Kaasaegne autentimine" } } diff --git a/public/app/main/apps/mail/i18n/is.json b/public/app/main/apps/mail/i18n/is.json new file mode 100644 index 0000000..22a7db6 --- /dev/null +++ b/public/app/main/apps/mail/i18n/is.json @@ -0,0 +1,346 @@ +{ + "MAIL": { + "ADVANCED": "Advanced", + "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", + "DOWNLOAD": "Download", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "DOWNLOAD_INTERACTION": "Download", + "YOU_ARE_REGISTERED_AS_A": "You are registered as a", + "TRANSFER": "Transfer", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "TAG": "Tag", + "EDIT_TAG": "Edit Tag", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "NOTIFICATION": "Notification", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONTEMPLATE": "Template", + "SYSTEM": "System", + "EDIT_SYSTEM": "Edit System", + "COMMAND": "Command", + "VARIABLE": "Variable", + "SEND_AS": "Send as", + "NEW_MAILSUBSTATUS": "New Sub Status", + "ADD_MAILSUBSTATUS": "Add Sub Status", + "MAILSUBSTATUSES": "Email Sub Statuses", + "EDIT_MAILSUBSTATUS": "Edit", + "DELETE_MAILSUBSTATUS": "Delete", + "FONT_FAMILY": "Font Family", + "FONT_SIZE": "Font Size", + "MARK_AS_UNREAD": "Mark as unread", + "ACCEPTED": "Accepted", + "CANNEDANSWERS": "Canned Answers", + "MAILCANNEDANSWERS": "Canned Answers", + "NO_MAILCANNEDANSWER_AVAILABLE": "No Canned Answers Available", + "NEW_MAILCANNEDANSWER": "New Canned Answer", + "ADD_MAILCANNEDANSWER": "Add Canned Answer", + "EDIT_MAILCANNEDANSWER": "Edit Canned Answer", + "DELETE_MAILCANNEDANSWER": "Delete Canned Answer", + "SHOW_ORIGINAL_MESSAGE": "Show original message", + "PENDING": "Pending", + "SEND_AS_PENDING": "Send as Pending", + "SEND_AND_CLOSE": "Send and Close", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", + "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", + "SPYINTERACTION": "Spy", + "ADD_NOTE": "Add note", + "NOTE": "Note", + "TAGS": "Tags", + "NO_AGENT_ONLINE": "No Agent Online", + "GOTOREALTIME_MAILQUEUE": "Go To Realtime Mail Queue", + "PARTIALPAUSE": "Parital Pause", + "BUSY": "Busy", + "TIMER": "Timer", + "IDLE": "Idle", + "CAPACITY": "Capacity", + "UNPAUSE": "End Pause", + "DEFAULT_PAUSE": "Default pause", + "LOGOUT": "Logout", + "AGENTADD_QUEUE": "Add agent to Email queue", + "VOICE": "Voice", + "CHAT": "Chat", + "SMS": "Sms", + "OPENCHANNEL": "Open channel", + "FAX": "Fax", + "REALTIME": "Realtime", + "AGENTS": "Agents", + "QUEUES": "Queues", + "ACCOUNTS": "Accounts", + "FULLNAME": "Full Name", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "PAUSE": "Pause", + "LOGGED_IN": "Logged In", + "PAUSED": "Paused", + "READY": "Ready", + "WAITING": "Waiting", + "TOTAL": "Total", + "IN": "In", + "OUT": "Out", + "IMAP_STATUS": "IMAP Status", + "SMTP_STATUS": "SMTP Status", + "DISABLED": "Disabled", + "CONNECTED": "Connected", + "NEVER_VERIFIED": "Never Verified", + "ERROR": "Error", + "EDIT_ACCOUNT": "Edit Account", + "VERIFY_SMTP": "Verify SMTP", + "VERIFIED": "Verified", + "VERIFYSMTP_MAILACCOUNT": "Verify SMTP", + "GOTOREALTIME_MAILACCOUNT": "Go to Realtime Email Account", + "GOTO_MAILACCOUNT": "Go to Realtime Email Account", + "TEXT": "Text", + "TIMES": "Number of times per interaction", + "REPLY_TYPE": "Reply Type", + "EDIT_AUTOREPLY": "Edit Auto Reply", + "AUTOREPLY": "Auto Reply", + "SHOW_AUTOREPLY": "Show Auto Reply", + "SHOW_DETAILS": "Show details", + "HIDE_DETAILS": "Hide details", + "TO": "To", + "FROM": "From", + "DATE": "Date", + "CC": "Cc", + "REPLY": "Reply", + "REPLY_ALL": "Reply All", + "FORWARD": "Forward", + "SUBJECT": "Subject", + "BCC": "Bcc", + "SEND": "Send", + "ATTACHMENT": "Attachment", + "ATTACHMENTS": "Attachments", + "NAME": "Name", + "MAILQUEUES": "Email Queues", + "SEARCH_FOR_ANYONE": "Search", + "STRATEGY": "Strategy", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "ERRORS": { + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "COMMAND_REQUIRED": "Mandatory Field", + "FONT_SIZE_REQUIRED": "Mandatory Field", + "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "VALUE_REQUIRED": "Mandatory Field", + "TEXT_REQUIRED": "Mandatory Field", + "REPLY_TYPE_REQUIRED": "Mandatory Field", + "NAME_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", + "EMAIL_ADDRESS_REQUIRED": "Mandatory Field", + "EMAIL_ADDRESS_MUST_VALID": "Wrong format", + "HOST_REQUIRED": "Mandatory Field", + "USERNAME_REQUIRED": "Mandatory Field", + "PORT_REQUIRED": "Mandatory Field", + "CONNTIMEOUT_REQUIRED": "Mandatory Field", + "AUTHTIMEOUT_REQUIRED": "Mandatory Field", + "ACCEPTURL_MUST_VALID_URL": "Wrong format", + "TIMEOUT_REQUIRED": "Mandatory Field", + "REJECTURL_MUST_VALID_URL": "Wrong format", + "CLOSEURL_MUST_VALID_URL": "Wrong format", + "AGENT_REQUIRED": "Mandatory Field", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "DISPOSITION_REQUIRED": "Mandatory Field", + "CONDITION_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_REQUIRED": "Mandatory Field", + "FALSEPRIORITY_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PRIORITY_REQUIRED": "Mandatory Field", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUE_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "PASSWORD_REQUIRED": "Mandatory Field", + "SERVICE_REQUIRED": "Mandatory Field", + "IMAP_HOST_REQUIRED": "Mandatory Field", + "IMAP_PORT_REQUIRED": "Mandatory Field", + "SMTP_HOST_REQUIRED": "Mandatory Field", + "SMTP_PORT_REQUIRED": "Mandatory Field", + "CONFIRM_NOT_MATCH": "The passwords inserted don't match", + "KEY_MAX_LENGTH": "Key must have a maximum length equal to {{max}}", + "KEY_REQUIRED": "Mandatory Field", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", + "FIELD_REQUIRED": "Mandatory field" + }, + "AGENT_TIMEOUT": "Agent Timeout", + "DESCRIPTION": "Description", + "ADD_MAILQUEUE": "Add Email Queue", + "EDIT_MAILQUEUE": "Edit Email Queue", + "DELETE_MAILQUEUE": "Delete Email Queue", + "SETTINGS": "Settings", + "GENERAL": "General", + "SAVE": "Save", + "MAILACCOUNTS": "Email Accounts", + "EMAIL_ADDRESS": "Email Address", + "ADD_MAILACCOUNT": "Add Email Account", + "EDIT_MAILACCOUNT": "Edit Email Account", + "DELETE_MAILACCOUNT": "Delete Email Account", + "DISPOSITIONS": "Dispositions", + "WEBHOOKS": "WebHooks", + "ACTIONS": "Actions", + "OTHERS": "Others", + "LIST": "List", + "TEMPLATE": "Template", + "FIDELITY": "Fidelity", + "SERVICE": "Service", + "CREATED_AT": "Created At", + "ACCEPT": "Accept", + "ACCEPTMETHOD": "Accept Method", + "ACCEPTURL": "Accept URL", + "REJECT": "Reject", + "REJECTMETHOD": "Reject Method", + "REJECTURL": "Reject URL", + "CLOSE": "Close", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "WHITELABEL": "White Label", + "SIGNATURE": "Signature", + "IMAP": "IMAP", + "HOST": "Host", + "USERNAME": "Username", + "PORT": "Port", + "MAILBOX": "Mailbox", + "FILTER": "Filter", + "CONNTIMEOUT": "Connection Timeout [sec]", + "AUTHTIMEOUT": "Authentication Timeout [sec]", + "DELETE": "Delete Email From Server", + "SSL": "SSL", + "KEEPALIVE": "Keepalive", + "POLLING": "Polling", + "SMTP": "SMTP", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "BACK": "Back", + "MAIL": "Email", + "ID": "Id", + "TIMEOUT": "Timeout", + "PASSWORD": "Password", + "NO_MAILDISPOSITION_AVAILABLE": "No Email Dispositions available", + "ADD_MAILDISPOSITION": "Add Email Disposition", + "NEW_MAILDISPOSITION": "New Email Disposition", + "EDIT_MAILDISPOSITION": "Edit Email Disposition", + "DELETE_MAILDISPOSITION": "Delete Email Disposition", + "MAILDISPOSITIONS": "Email Dispositions", + "NEW_MAILQUEUE": "New Email Queue", + "NEW_MAILACCOUNT": "New Email Account", + "NO_AVAILABLE_INFO": "No availables info", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "HELP": { + "FONT_FAMILY": "Default Font Family", + "FONT_SIZE": "Default Font Size", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "USERNAME": "Username used for authentication", + "PASSWORD": "Password used for authentication", + "SECURE": "If true, the connection will use TLS when connecting to server", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", + "MARK_AS_UNREAD": "Enable/Disable agent to mark as unread the last message of an interaction", + "CLOUD_PROVIDER": "Cloud Provider used for authentication" + }, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "TEAMADD_MAILQUEUE": "Add Team to Email Queue", + "AGENTADD_MAILQUEUE": "Add Agent to Email Queue", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "AGENT": "Agent", + "EDIT_AGENT": "Edit Agent", + "EDIT_CLOSE": "Edit Close", + "DISPOSITION": "Disposition", + "GOTOIF": "GotoIf", + "EDIT_GOTOIF": "Edit GotoIf", + "CONDITION": "Condition", + "TRUEPRIORITY": "True Priority", + "FALSEPRIORITY": "False Priority", + "GOTOP": "GotoP", + "EDIT_GOTOP": "Edit GotoP", + "PRIORITY": "Priority", + "NOOP": "Noop", + "EDIT_NOOP": "Edit Noop", + "VALUE": "Value", + "QUEUE": "Queue", + "EDIT_QUEUE": "Edit Queue", + "INTERACTIONS": "Interactions", + "STARTEDAT": "Started At", + "LASTMESSAGE": "Last message", + "CONTACT": "Contact", + "CLOSEDAT": "Closed At", + "NOTES": "Notes", + "NO_INTERACTION_AVAILABLE": "No interactions available", + "ACTIVE": "Active", + "SECURE": "Secure", + "AUTHENTICATION": "Authentication", + "SMTP_HOST": "SMTP Host", + "SMTP_PORT": "SMTP Port", + "IMAP_HOST": "IMAP Host", + "IMAP_PORT": "IMAP Port", + "CONFIRM_PASSWORD": "Confirm Password", + "SELECT_STATUS": "Select Status", + "OPENED": "Open", + "CLOSED": "Closed", + "ALL": "All", + "SELECT_ACCOUNT": "Select Account", + "STATUS": "Status", + "ACCOUNT": "Account", + "OPEN": "Open", + "KEY": "Key", + "SMTPSERVICE": "SMTP Service", + "UNKNOWN": "Unknown", + "UNREGISTERED": "Unregistered", + "UNAVAILABLE": "Unavailable", + "NOT_INUSE": "Not in use", + "REACHABLE": "Reachable", + "IN_USE": "In use", + "AGENTSADD_QUEUE": "Add agents to Email Queue", + "INFO": "Info", + "INTERACTIONS_MAILACCOUNT": "Go to Interactions", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "DELETE_INTERACTION": "Delete Interaction", + "AGENTADD_MAILACCOUNT": "Add Agent to Email Account", + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "DOWNLOAD_WITH_ATTACHMENT": "Download with attachment", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download without attachment", + "MODERN_AUTHENTICATION": "Modern Authentication", + "CLOUD_PROVIDER": "Cloud Provider", + "CUSTOM": "Custom", + "CREDENTIALS": "Credentials", + "NOTIFICATIONS": { + "ACCOUNT_CREATED_SUCCESS_TITLE": "Account successfully created", + "ACCOUNT_SAVED_SUCCESS_TITLE": "Account successfully saved", + "ACCOUNT_DELETE_TITLE": "Are you sure want to delete the account?", + "ACCOUNT_DELETE_MESSAGE": "{{ name }} will be deleted", + "ACCOUNT_DELETED_SUCCESS_TITLE": "Account successfully deleted", + "ACCOUNT_SERVICE_DELETE": "You cannot delete a service account", + "ACCOUNTS_DELETE_TITLE": "Are you sure want to delete the selected accounts?", + "ACCOUNTS_DELETE_MESSAGE": "{{ total }} accounts will be deleted", + "ACCOUNTS_DELETED_SUCCESS_TITLE": "Accounts successfully deleted", + "SMTP_CONNECTION_SUCCESS_TITLE": "Successfully connected to the SMTP server", + "SMTP_CONNECTION_FAIL_TITLE": "Unable to connect to the SMTP server", + "UNKNOWN_SMTP_SERVER": "Unknown STMP server" + } + } +} diff --git a/public/app/main/apps/marketplace/i18n/is.json b/public/app/main/apps/marketplace/i18n/is.json new file mode 100644 index 0000000..e80fbe2 --- /dev/null +++ b/public/app/main/apps/marketplace/i18n/is.json @@ -0,0 +1,51 @@ +{ + "MARKETPLACE": { + "MARKETPLACE": "App Zone", + "PLUGINS": "Plugins", + "BACK": "Back", + "SEARCH_FOR_ANYONE": "Search", + "SELECTED": "Selected", + "SELECT_ALL": "Select all", + "SELECT_NONE": "Select none", + "NAME": "Name", + "DESCRIPTION": "Description", + "ACTIVE": "Active", + "TYPE": "Type", + "ICON": "Icon", + "ADMINURL": "Admin url", + "AGENTURL": "Agent url", + "SCRIPTNAME": "Script name", + "SCRIPTPATH": "Script path", + "SIDEBAR": "Sidebar", + "VERSION": "Version", + "NO_AVAILABLE_INFO": "No available info", + "MORE": "More", + "INSTALL_PLUGIN": "Install plugin", + "EDIT_PLUGIN": "Edit plugin", + "STOP_PLUGIN": "Stop plugin", + "RESTART_PLUGIN": "Restart plugin", + "DOWNLOAD_PLUGIN": "Download plugin", + "UNINSTALL_PLUGIN": "Uninstall plugin", + "DELETE_PLUGIN": "Remove plugin", + "CANCEL": "Cancel", + "FINISH": "Finish", + "DELETE": "Delete", + "SAVE": "Save", + "INSTALLING": "Installing", + "DROP_TO_UPLOAD": "Drop To Upload", + "DROP_TO_UPLOAD_MESSAGE": "Drop your file here to upload. Only ZIP - Max. 2MB", + "UPLOAD_PLUGIN": "Upload plugin", + "UPLOADING": "Uploading", + "CREATED_AT": "Created at", + "GENERAL": "General", + "SETTINGS": "Settings", + "EDITOR": "Editor", + "ERRORS": { + "URL_REQUIRED": "Mandatory field" + }, + "HELP": {}, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of" + } +} diff --git a/public/app/main/apps/motiondialer/i18n/bs.json b/public/app/main/apps/motiondialer/i18n/bs.json index 6b63309..62d9acb 100644 --- a/public/app/main/apps/motiondialer/i18n/bs.json +++ b/public/app/main/apps/motiondialer/i18n/bs.json @@ -1,701 +1,701 @@ { "MOTIONDIALER": { - "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", - "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", - "ONE_CALL_EVERY": "One call every", - "CURRENT_INTERVAL": "Current Interval", - "PREVIOUS_INTERVAL": "Previous Interval", - "PREDICTIVE_IS_RUNNING": "Predictive is running", - "PREDICTIVE_IS_NOT_RUNNING": "Predictive is not running", - "DATA_COLLECTION_IN_PROGRESSIVE": "Data collection in Progressive", - "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Show Predictive Info", - "AVG_TALK_TIME": "Avg Talk Time", - "ANSWERED_CALLS": "Answered Calls", - "TOTAL_CALLS": "Total Calls", - "THRESHOLDS": "Thresholds", - "PREDICTIVEMAXTHRESHOLD": "Predictive Max Threshold [%]", - "PREDICTIVEMINTHRESHOLD": "Predictive Min Threshold [%]", - "REFRESH_SCHEDULED_CALLS": "Refresh Scheduled Calls", - "RECALLINQUEUE": "Recall in queue", - "SELECT_DATE": "Select Date", - "SELECT_TYPE": "Select Type", - "SELECT_CAMPAIGN": "Select Campaign", - "SCHEDULED_CALLS": "Scheduled Calls", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "PREVIEW_RECALL_ME_REMINDER": "Recall Me Reminder", - "CUTDIGIT": "Cut Digits", - "RANDOMLASTDIGITCALLERIDNUMBER": "Random Outgoing CallerId Number", - "CLONE_IVRCAMPAIGN": "Clone Campaign", - "CLONE_QUEUECAMPAIGN": "Clone Queue Campaign", - "ABANDONEDCALLS": "Abandoned Queue Calls", - "HOPPERWIDGET": "Summary", - "RESETLIST_IVRCAMPAIGN": "Reset Lists", - "RESETLIST_QUEUECAMPAIGN": "Reset Lists", - "RESET": "Reset", - "RESETLIST": "Reset Lists", - "SELECTALL": "Select All", - "UNSELECTALL": "Un-Select All", - "NO_AVAILABLE_INFO": "No available info", + "SECOND_LEVEL_DISPOSITION": "Drugi Nivo Dispozicija", + "THIRD_LEVEL_DISPOSITION": "Treći Nivo Dispozicija", + "ONE_CALL_EVERY": "Jedan poziv svako", + "CURRENT_INTERVAL": "Trenutni Interval", + "PREVIOUS_INTERVAL": "Prethodni Interval", + "PREDICTIVE_IS_RUNNING": "Preditkivni radi", + "PREDICTIVE_IS_NOT_RUNNING": "Prediktivni ne radi ", + "DATA_COLLECTION_IN_PROGRESSIVE": "Prikupljanje podataka u Progressive", + "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Pokaži Prediktivne Informacije", + "AVG_TALK_TIME": "Prosječno Vrijeme Razgovora", + "ANSWERED_CALLS": "Odgovoreni Pozivi", + "TOTAL_CALLS": "Ukupno Poziva", + "THRESHOLDS": "Pragovi", + "PREDICTIVEMAXTHRESHOLD": "Prediktivni Maks Prag [%]", + "PREDICTIVEMINTHRESHOLD": "Prediktivni Maks Prag [%]", + "REFRESH_SCHEDULED_CALLS": "Osvježi Zakazane Pozive", + "RECALLINQUEUE": "Recall u queue", + "SELECT_DATE": "Odaberi Datum", + "SELECT_TYPE": "Odaberi Vrstu", + "SELECT_CAMPAIGN": "Odaberi Kampanju", + "SCHEDULED_CALLS": "Zakazani Pozivi", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "PREVIEW_RECALL_ME_REMINDER": "Recall Me Podsjetnik", + "CUTDIGIT": "Izreži Cifre", + "RANDOMLASTDIGITCALLERIDNUMBER": "Nasumičan Odlazni Pozivatelj ID Broj", + "CLONE_IVRCAMPAIGN": "Kloniraj Kampanju", + "CLONE_QUEUECAMPAIGN": "Kloniraj Queue Kampanju", + "ABANDONEDCALLS": "Napušteni Queue Pozivi", + "HOPPERWIDGET": "Sažetak", + "RESETLIST_IVRCAMPAIGN": "Resetuj Liste", + "RESETLIST_QUEUECAMPAIGN": "Resetuj Liste", + "RESET": "Resetuj", + "RESETLIST": "Resetuj Liste", + "SELECTALL": "Odaberi Sve", + "UNSELECTALL": "Poništi Odabri Svih", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", "TIMEOUT": "Timeout", - "CALLYSQUAREPROJECTPREVIEW": "Cally Square Project Preview", - "CALLYSQUAREPROJECTPREVIEW2": "Cally Square Project After Preview", - "RUNIFHANGUPAGENT": "Run Cally Square Project After even if the agent hangs up the call", - "CALLYSQUAREPROJECT2": "Cally Square Project After Queue", - "NO_AGENT_ONLINE": "No Agent Online", - "PARTIALPAUSE": "Parital Pause", - "ALL": "All", + "CALLYSQUAREPROJECTPREVIEW": "Cally Square Projekat Pregled", + "CALLYSQUAREPROJECTPREVIEW2": "Cally Square Projekat Nakon Pregleda", + "RUNIFHANGUPAGENT": "Pokreni Cally Square Projekat Nakon čak i ako Specijalista prekine poziv", + "CALLYSQUAREPROJECT2": "Cally Square Projekat Nakon Queue", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "PARTIALPAUSE": "Djelimična Pauza", + "ALL": "Svi", "IDLE": "Idle", "TIMER": "Timer", - "MOVE_HOPPERFINAL": "Restore contact", - "RESTORECONTACTS": "Restore Contacts", - "NO_SUCH_NUMBER": "No Such Number", - "ANSWERING_MACHINE": "Answering machine", - "DIALORDERBYSCHEDULEDAT": "Order By scheduledat", + "MOVE_HOPPERFINAL": "Povrati kontakt", + "RESTORECONTACTS": "Vrati Kontakte", + "NO_SUCH_NUMBER": "Nepostojeći broj", + "ANSWERING_MACHINE": "Telefonska sekretarica", + "DIALORDERBYSCHEDULEDAT": "Poredak Po Zakazan U", "ASC": "ASC", "DESC": "DESC", - "RECALLAGENT": "Recall Agent", - "DIALRECALLINQUEUE": "Recall In Queue", + "RECALLAGENT": "Recall Specijalistu", + "DIALRECALLINQUEUE": "Recall u Queue", "DIALRECALLMETIMEOUT": "Recall Me Timeout [min]", "RECALLME": "Recall Me", - "RECALLFAILEDTIMEOUT": "Recall Failed", - "PREVIEW_CAMPAIGN": "Preview Campaigns", - "PREVIEW_CAMPAIGNS": "Preview Campaigns", + "RECALLFAILEDTIMEOUT": "Recall Neuspješno", + "PREVIEW_CAMPAIGN": "Pregled Kampanja", + "PREVIEW_CAMPAIGNS": "Pregled Kampanja", "AMD": "Asterisk Answering Machine Detection (AMD)", - "AMDTOTALANALYSISTIME": "Total Analysis Time", + "AMDTOTALANALYSISTIME": "Ukupno Vrijeme Analize", "AMDACTIVE": "AMD", - "AMDINITIALSILENCE": "Initial Silence", - "AMDGREETING": "Greeting", - "AMDAFTERGREETINGSILENCE": "Silence after Greeting", - "AMDSILENCETHRESHOLD": "Silence Threshold", - "AMDMINWORDLENGTH": "Min Word Length", - "AMDBETWEENWORDSSILENCE": "Silence Between Words", - "AMDMAXIMUMWORDLENGTH": "Maximum Word Length", - "AMDMAXIMUMNUMBEROFWORDS": "Maximum Number Of Words", - "GOTO_QUEUECAMPAIGN": "Go To Realtime Queue Campaigns", - "GOTOREALTIME_QUEUECAMPAIGN": "Go To Realtime Queue Campaigns", - "GOTO_IVRCAMPAIGN": "Go To Realtime IVR Campaigns", - "GOTOREALTIME_IVRCAMPAIGN": "Go To Realtime IVR Campaigns", - "LOGOUT": "Logout", - "EDIT_CAMPAIGN": "Edit Campaign", - "LIMITED": "Limited", - "IVR_CAMPAIGNS": "IVR Campaigns", + "AMDINITIALSILENCE": "Početna Tišina", + "AMDGREETING": "Pozdrav", + "AMDAFTERGREETINGSILENCE": "Tišina nakon Pozdrava", + "AMDSILENCETHRESHOLD": "Prag Tišine", + "AMDMINWORDLENGTH": "Minimalna Dužina Riječi", + "AMDBETWEENWORDSSILENCE": "Tišina Između Riječi", + "AMDMAXIMUMWORDLENGTH": "Maksimalna Dužina Riječi", + "AMDMAXIMUMNUMBEROFWORDS": "Maksimalan Broj Riječi", + "GOTO_QUEUECAMPAIGN": "Idi Na Realtime Queue Kampanje", + "GOTOREALTIME_QUEUECAMPAIGN": "Idi Na Realtime Queue Kampanje", + "GOTO_IVRCAMPAIGN": "Idi Na Realtime IVR Kampanje", + "GOTOREALTIME_IVRCAMPAIGN": "Idi Na Realtime IVR Kampanje", + "LOGOUT": "Odjava", + "EDIT_CAMPAIGN": "Uredi Kampanju", + "LIMITED": "Ograničeno", + "IVR_CAMPAIGNS": "IVR Kampanje", "MOTIONDIALER": "Motion Bull", - "QUEUECAMPAIGNS": "Queue Campaigns", - "IVRCAMPAIGNS": "IVR Campaigns", - "MANAGED": "Managed", - "AVAILABLE_CONTACTS_FINISHED": "Available contacts finished", - "HISTORY": "History", - "SCHEDULEDAT": "Scheduled At", + "QUEUECAMPAIGNS": "Queue Kampanje", + "IVRCAMPAIGNS": "IVR Kampanje", + "MANAGED": "Upravljano", + "AVAILABLE_CONTACTS_FINISHED": "Dostupni kontakti gotovi", + "HISTORY": "Historija", + "SCHEDULEDAT": "Zakazano U", "HOPPERBLACKS": "Hopper Blacklist", - "NO_HOPPERBLACK_AVAILABLE": "No items available", + "NO_HOPPERBLACK_AVAILABLE": "Nema dostupnih stavki", "HOPPERFINALS": "Hopper Final", - "NO_HOPPERFINAL_AVAILABLE": "No items available", - "HOPPERHISTORIES": "Call history", - "NO_HOPPERHISTORY_AVAILABLE": "No items available", - "DELETE_HOPPERHISTORY": "Delete", - "DELETE_HOPPERFINAL": "Delete", - "CONTACTID": "Contact ID", - "STARTTIME": "Start Time", - "RESPONSETIME": "Response Time", - "ENDTIME": "End Time", + "NO_HOPPERFINAL_AVAILABLE": "Nema dostupnih stavki", + "HOPPERHISTORIES": "Historija Poziva", + "NO_HOPPERHISTORY_AVAILABLE": "Nema dostupnih stavki", + "DELETE_HOPPERHISTORY": "Izbriši", + "DELETE_HOPPERFINAL": "Izbriši", + "CONTACTID": "Kontakt ID", + "STARTTIME": "Vrijeme Početka", + "RESPONSETIME": "Vrijeme Odgovora", + "ENDTIME": "Završetak Vrijeme", "STATUS": "Status", "HOPPERS": "Hopper", - "NO_HOPPER_AVAILABLE": "No items available", - "EDIT_HOPPER": "Edit Hopper", - "DELETE_HOPPER": "Delete Hopper", - "FINAL": "Final", - "BLACKLIST": "Blacklist", - "NAME": "Name", + "NO_HOPPER_AVAILABLE": "Nema dostupnih stavki", + "EDIT_HOPPER": "Uredi Hopper", + "DELETE_HOPPER": "Izbriši Hopper", + "FINAL": "Finalan", + "BLACKLIST": "Crna Lista", + "NAME": "Naziv", "VOICEQUEUES": "Voice Queues", - "SEARCH_FOR_ANYONE": "Search", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "EDIT_VOICEQUEUE": "Edit Voice Queue", - "DELETE_VOICEQUEUE": "Delete Voice Queue", - "MOHSOUNDS": "Moh Sounds", - "STRATEGY": "Strategy", - "DESCRIPTION": "Description", - "INTERVAL": "Time Interval", - "ADD_VOICEQUEUE": "Add Voice Queue", - "NEW_QUEUECAMPAIGN": "New Queue Campaign", - "ACTIVE": "Active", - "METHOD": "Method", - "POWERLEVEL": "Power Level", - "DROPRATE": "Drop Rate", - "AGENTBUSYFACTOR": "Agent Busy Factor", - "PREDICTIVEOPTIMIZATION": "Predictive Optimization", - "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Predictive Optimization Percentage", - "PREDICTIVEINTERVAL": "Predictive Interval", - "ADD_QUEUECAMPAIGN": "Add Queue Campaign", - "CAMPAIGN": "Campaign", - "MAXCONCURRENTCALLS": "Max Concurrent Calls", - "CONCURRENTCALLS": "Max Concurrent Calls", - "ORIGINATE": "Originate", - "ORIGINATECALLERIDNAME": "Caller ID Name", - "ORIGINATECALLERIDNUMBER": "Caller ID Number", - "ORIGINATETIMEOUT": "Originate Timeout", - "QUEUEOPTIONS": "Queue Options", + "SEARCH_FOR_ANYONE": "Traži", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "DELETE_VOICEDISPOSITION": "Izbriši Voice Dispoziciju", + "EDIT_VOICEDISPOSITION": "Uredi Voice Dispoziciju", + "EDIT_VOICEQUEUE": "Uredi Voice Queue", + "DELETE_VOICEQUEUE": "Izbriši Voice Queue", + "MOHSOUNDS": "MNČ Zvukovi", + "STRATEGY": "Strategija", + "DESCRIPTION": "Opis", + "INTERVAL": "Vremenski Interval", + "ADD_VOICEQUEUE": "Dodaj Voice Queue", + "NEW_QUEUECAMPAIGN": "Nova Queue Kampanja", + "ACTIVE": "Aktivno", + "METHOD": "Metoda", + "POWERLEVEL": "Nivo Snage", + "DROPRATE": "Stopa Ispuštenih", + "AGENTBUSYFACTOR": "Specijalist Zauzetost Faktor", + "PREDICTIVEOPTIMIZATION": "Prediktivna Optimizacija", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Preditkivni Procenat Optimizacije", + "PREDICTIVEINTERVAL": "Interval Predviđanja", + "ADD_QUEUECAMPAIGN": "Dodaj Queue Kampanju", + "CAMPAIGN": "Kampanja", + "MAXCONCURRENTCALLS": "Maks Istovremenih Poziva", + "CONCURRENTCALLS": "Maksimalno Istovremenih Poziva", + "ORIGINATE": "Porijeklo", + "ORIGINATECALLERIDNAME": "Pozivatelj ID Naziv", + "ORIGINATECALLERIDNUMBER": "Pozivatelj ID Broj", + "ORIGINATETIMEOUT": "Porijeklo Timeout", + "QUEUEOPTIONS": "Queue Opcije", "QUEUETIMEOUT": "Queue Timeout", - "CALLYSQUAREPROJECT": "Cally Square Project", - "RETRYANDFREQUENCY": "Retry Settings", - "GLOBAL": "Global", - "GLOBALMAXRETRY": "Max Retries", - "CONGESTION": "Congestion", - "CONGESTIONMAXRETRY": "Max Retries", - "CONGESTIONRETRYTIME": "Retry Time [min]", - "BUSYMAXRETRY": "Max Retries", - "BUSYRETRYTIME": "Retry Time [min]", - "NOANSWER": "No Answer", - "NOANSWERMAXRETRY": "Max Retries", - "NOANSWERRETRYTIME": "Retry Time [min]", - "NOSUCHNUMBER": "No such number", - "NOSUCHNUMBERMAXRETRY": "Max Retries", - "NOSUCHNUMBERRETRYTIME": "Retry Time [min]", - "DROP": "Drop", - "DROPMAXRETRY": "Max Retries", - "DROPRETRYTIME": "Retry Time [min]", - "ABANDONEDMAXRETRY": "Max Retries", - "ABANDONEDRETRYTIME": "Retry Time [min]", - "MACHINE": "Machine", - "MACHINEMAXRETRY": "Max Retries", - "MACHINERETRYTIME": "Retry Time [min]", - "AGENTREJECT": "Agent Reject", - "AGENTREJECTMAXRETRY": "Max Retries", - "AGENTREJECTRETRYTIME": "Retry Time [min]", - "CALLADDITIONALPHONEAFTERMIN": "Call additional phone after [min]", - "ADDITIONALPHONES": "Additional phones", - "QUEUE_PARAMS": "Queue Parameters", - "ORIGINATED": "Originated", - "MESSAGE": "Message", - "DROPPED": "Dropped", - "CREATED_AT": "Created At", + "CALLYSQUAREPROJECT": "Cally Square Projekat", + "RETRYANDFREQUENCY": "Postavke Ponovljenog Pokušaja", + "GLOBAL": "Globalno", + "GLOBALMAXRETRY": "Maksimalno Pokušaja", + "CONGESTION": "Zagušenje", + "CONGESTIONMAXRETRY": "Maksimalno Pokušaja", + "CONGESTIONRETRYTIME": "Pokušaj Vrijeme [min]", + "BUSYMAXRETRY": "Maksimalno Pokušaja", + "BUSYRETRYTIME": "Pokušaj Vrijeme [min]", + "NOANSWER": "Bez Odgovora", + "NOANSWERMAXRETRY": "Maks Pokušaja", + "NOANSWERRETRYTIME": "Pokušaj Vrijeme [min]", + "NOSUCHNUMBER": "Nepostojeći broj", + "NOSUCHNUMBERMAXRETRY": "Maks Pokušaja", + "NOSUCHNUMBERRETRYTIME": "Pokušaj Vrijeme [min]", + "DROP": "Ispusti", + "DROPMAXRETRY": "Maksimalno Pokušaja", + "DROPRETRYTIME": "Pokušaj Vrijeme [min]", + "ABANDONEDMAXRETRY": "Maksimalno Pokušaja", + "ABANDONEDRETRYTIME": "Pokušaj Vrijeme [min]", + "MACHINE": "Mašina", + "MACHINEMAXRETRY": "Maksimalno Pokušaja", + "MACHINERETRYTIME": "Pokušaja Vrijeme [min]", + "AGENTREJECT": "Specijalist Odbij", + "AGENTREJECTMAXRETRY": "Maksimalno Pokušaja", + "AGENTREJECTRETRYTIME": "Pokušaj Vrijeme [min]", + "CALLADDITIONALPHONEAFTERMIN": "Pozovi dodatni telefon nakon [min]", + "ADDITIONALPHONES": "Dodatni telefoni", + "QUEUE_PARAMS": "Queue Parametri", + "ORIGINATED": "Porijeklo", + "MESSAGE": "Poruka", + "DROPPED": "Ispušteno", + "CREATED_AT": "Kreirano U", "LEGEND": { - "CUSTOM_APPLICATION": "(*) - Custom application." + "CUSTOM_APPLICATION": "(*) - Prilagođena aplikacija." }, "ERRORS": { - "AGENT_REQUIRED": "Mandatory field", - "CUTDIGIT_REQUIRED": "Mandatory field", - "CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED": "Mandatory field", - "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTIMEOUT_REQUIRED": "Mandatory field", - "INTERVAL_REQUIRED": "Mandatory field", - "EMAIL_REQUIRED": "Mandatory field", - "DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "DIALRECALLMETIMEOUT_REQUIRED": "Mandatory field", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "PREFIX_MUST_VALID_PATTERN": "Wrong format", - "NAME_REQUIRED": "Mandatory field", - "TIMEOUT_REQUIRED": "Mandatory field", - "PHONENUMBER_REQUIRED": "Mandatory field", - "CONTEXT_REQUIRED": "Mandatory field", - "DESTINATIONPATTERN_REQUIRED": "Mandatory field", - "FULLNAME_REQUIRED": "Mandatory field", - "EMAIL_REQUUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "MAILBOX_REQUIRED": "Mandatory Field", - "PASSWORD_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "TIMEZONE_REQUIRED": "Mandatory field", - "PREFIX_REQUIRED": "Mandatory field", - "OPTIONS_REQUIRED": "Mandatory field", - "AFTERCALLWORKDURATION_REQUIRED": "Mandatory field", - "TECHNOLOGY/RESOURCE_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "EXTENSION_REQUIRED": "Mandatory field", - "PRIORITY_REQUIRED": "Mandatory field", - "GLOBALMAXRETRY_REQUIRED": "Mandatory field", - "CONGESTIONMAXRETRY_REQUIRED": "Mandatory field", - "CONGESTIONRETRYTIME_REQUIRED": "Mandatory field", - "BUSYMAXRETRY_REQUIRED": "Mandatory field", - "BUSYRETRYTIME_REQUIRED": "Mandatory field", - "NOANSWERMAXRETRY_REQUIRED": "Mandatory field", - "NOANSWERRETRYTIME_REQUIRED": "Mandatory field", - "QUEUETIMEOUT_REQUIRED": "Mandatory field", - "ORIGINATETIMEOUT_REQUIRED": "Mandatory field", - "GLOBALINTERVAL_REQUIRED": "Mandatory field", - "MAXCONCURRENTCALLS_REQUIRED": "Mandatory field", - "CONCURRENTCALLS_REQUIRED": "Mandatory field", - "NOSUCHNUMBERMAXRETRY_REQUIRED": "Mandatory field", - "NOSUCHNUMBERRETRYTIME_REQUIRED": "Mandatory field", - "DROPMAXRETRY_REQUIRED": "Mandatory field", - "DROPRETRYTIME_REQUIRED": "Mandatory field", - "ABANDONEDMAXRETRY_REQUIRED": "Mandatory field", - "ABANDONEDRETRYTIME_REQUIRED": "Mandatory field", - "MACHINEMAXRETRY_REQUIRED": "Mandatory field", - "MACHINERETRYTIME_REQUIRED": "Mandatory field", - "AGENTREJECTMAXRETRY_REQUIRED": "Mandatory field", - "AGENTREJECTRETRYTIME_REQUIRED": "Mandatory field", - "POWERLEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PREDICTIVEINTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "POWERLEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "PREDICTIVEINTERVAL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", - "CALLYSQUAREPROJECT_REQUIRED": "Mandatory field", - "TRUNK_REQUIRED": "Mandatory field", - "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Mandatory field", - "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Call add.phone after min. should be greater than or equal to" + "AGENT_REQUIRED": "Obavezno polje", + "CUTDIGIT_REQUIRED": "Obavezno polje", + "CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED": "Obavezno polje", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AGENTTIMEOUT_REQUIRED": "Obavezno polje", + "INTERVAL_REQUIRED": "Obavezno polje", + "EMAIL_REQUIRED": "Obavezno polje", + "DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "DIALRECALLMETIMEOUT_REQUIRED": "Obavezno polje", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "PREFIX_MUST_VALID_PATTERN": "Pogrešan format", + "NAME_REQUIRED": "Obavezno polje", + "TIMEOUT_REQUIRED": "Obavezno polje", + "PHONENUMBER_REQUIRED": "Obavezno polje", + "CONTEXT_REQUIRED": "Obavezno polje", + "DESTINATIONPATTERN_REQUIRED": "Obavezno polje", + "FULLNAME_REQUIRED": "Obavezno polje", + "EMAIL_REQUUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "Pogrešan format", + "MAILBOX_REQUIRED": "Obavezno polje", + "PASSWORD_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinke se ne poklapaju", + "TIMEZONE_REQUIRED": "Obavezno polje", + "PREFIX_REQUIRED": "Obavezno polje", + "OPTIONS_REQUIRED": "Obavezno polje", + "AFTERCALLWORKDURATION_REQUIRED": "Obavezno polje", + "TECHNOLOGY/RESOURCE_REQUIRED": "Obavezno polje", + "PHONE_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "EXTENSION_REQUIRED": "Obavezno polje", + "PRIORITY_REQUIRED": "Obavezno polje", + "GLOBALMAXRETRY_REQUIRED": "Obavezno polje", + "CONGESTIONMAXRETRY_REQUIRED": "Obavezno polje", + "CONGESTIONRETRYTIME_REQUIRED": "Obavezno polje", + "BUSYMAXRETRY_REQUIRED": "Obavezno polje", + "BUSYRETRYTIME_REQUIRED": "Obavezno polje", + "NOANSWERMAXRETRY_REQUIRED": "Obavezno polje", + "NOANSWERRETRYTIME_REQUIRED": "Obavezno polje", + "QUEUETIMEOUT_REQUIRED": "Obavezno polje", + "ORIGINATETIMEOUT_REQUIRED": "Obavezno polje", + "GLOBALINTERVAL_REQUIRED": "Obavezno polje", + "MAXCONCURRENTCALLS_REQUIRED": "Obavezno polje", + "CONCURRENTCALLS_REQUIRED": "Obavezno polje", + "NOSUCHNUMBERMAXRETRY_REQUIRED": "Obavezno polje", + "NOSUCHNUMBERRETRYTIME_REQUIRED": "Obavezno polje", + "DROPMAXRETRY_REQUIRED": "Obavezno polje", + "DROPRETRYTIME_REQUIRED": "Obavezno polje", + "ABANDONEDMAXRETRY_REQUIRED": "Obavezno polje", + "ABANDONEDRETRYTIME_REQUIRED": "Obavezno polje", + "MACHINEMAXRETRY_REQUIRED": "Obavezno polje", + "MACHINERETRYTIME_REQUIRED": "Obavezno polje", + "AGENTREJECTMAXRETRY_REQUIRED": "Obavezno polje", + "AGENTREJECTRETRYTIME_REQUIRED": "Obavezno polje", + "POWERLEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "PREDICTIVEINTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "POWERLEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "PREDICTIVEINTERVAL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno polje", + "CALLYSQUAREPROJECT_REQUIRED": "Obavezno polje", + "TRUNK_REQUIRED": "Obavezno polje", + "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Obavezno polje", + "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Poziv dod.telefon nakon min. treba biti veći ili jednak od" }, - "GENERAL": "General", - "AGENTTIMEOUT": "Agent Timeout", - "MAXLENGTH": "Maximum Length", - "RETRY": "Retry", - "WRAPUPTIME": "Wrapup Time", - "WEIGHT": "Weight", - "JOINWHENEMPTY": "Join when empty", - "LEAVEWHENEMPTY": "Leave when empty", + "GENERAL": "Općenito", + "AGENTTIMEOUT": "Specijalist Timeout", + "MAXLENGTH": "Maksimalna Dužina", + "RETRY": "Ponovljeni Pokušaj", + "WRAPUPTIME": "Vrijeme Završetka", + "WEIGHT": "Težina", + "JOINWHENEMPTY": "Pridruži se kada je prazno", + "LEAVEWHENEMPTY": "Napusti kada je prazno", "HELP": { - "PREDICTIVEMAXTHRESHOLD": "If the percentage of agents available in the time window, compared to the agents available at the time of prediction, exceeds the configured maximum limit, the predictive recalculates the prediction. ", - "PREDICTIVEMINTHRESHOLD": "If the percentage of agents available in the time window, compared to the agents available at the time of prediction, exceeds the configured minimum limit, the predictive recalculates the prediction.", - "RANDOMLASTDIGITCALLERIDNUMBER": "If greater than 0, it generates randomly the corresponding last digits of the Outgoing Caller Id Number", - "TIMEOUT": "Number of seconds to ring agent in queue", - "CALLYSQUAREPROJECTPREVIEW": "Selecting an IVR project, the dialer will forward the call to the IVR when an agent answers (the IVR will be directed to the agent)", - "CALLYSQUAREPROJECTPREVIEW2": "Selecting an IVR project, the dialer will forward the call to the IVR when an client hangup or unreachable (the IVR will be directed to the agent)", - "RUNIFHANGUPAGENT": "Run Cally Square Project After even if the agent hangs up the call", - "CALLYSQUAREPROJECT2": "Selecting an IVR project, the dialer will forward the call to the IVR after the queue (if the queue ends by timeout)", - "DIALORDERBYSCHEDULEDAT": "Get contacts from hopper (descending or ascending).", - "DIALRECALLINQUEUE": "Reschedule call for agents in the Queue", - "DIALRECALLMETIMEOUT": "Time interval (in minutes) for Recall Me period of validity", - "PRIORITY": "Priority in the list", - "TIMEZONE": "Specify timezone", - "PREVIEW_RECALL_ME_REMINDER": "If enabled, the system will send a notification to the agent n minutes (according to time interval set in general settings) before generating the recall me", - "AMDMAXIMUMWORDLENGTH": "Maximum duration allowed of a single Voice utterance", - "AMDMINWORDLENGTH": "Minimum duration of a Voice to be considered a word", - "AMDSILENCETHRESHOLD": "If the average level of noise in a sample does not reach this value, from a scale of 0 to 32767, then we will consider it as silence", - "AMDTOTALANALYSISTIME": "Maximum time allowed for the algorithm to decide on whether the audio represents a HUMAN or a MACHINE", - "AMDAFTERGREETINGSILENCE": "Silence after detecting a greeting. If exceeded, then the result is detection as a HUMAN", - "AMDGREETING": "Maximum length of a greeting. If exceeded, then the result is detection as a MACHINE", - "AMDINITIALSILENCE": "Maximum silence duration before the greeting. If exceeded, then the result is detection as a MACHINE", - "AMDACTIVE": "Activate or disactivate answering machines detection attempts", - "AMDBETWEENWORDSSILENCE": "Minimum duration of silence after a word to consider the audio that follows as a new word", - "AMDMAXIMUMNUMBEROFWORDS": "Maximum number of words in the greeting. If REACHED, then the result is detection as a MACHINE", - "CALLYSQUAREPROJECT": "Selecting an IVR project, the dialer will forward the call to the IVR before the queue", - "PREFIX": "Telephone prefix", - "ACTIVE": "Active", - "AGENTTIMEOUT": "How long (in seconds) to ring an agent’s device", - "MAXLENGTH": "Maximum number of callers allowed to be waiting in a queue (0=unlimited)", - "RETRY": "How long (in seconds) to wait before calling the next agent in the queue when the agent timeout is expired", - "WRAPUPTIME": "How long (in seconds) to keep an agent unavailable in a queue after completing a call", - "WEIGHT": "Used to determine priority if the agents are associated with more than one queue", - "JOINWHENEMPTY": "If a caller is added to the queue, when no agents are available", - "LEAVEWHENEMPTY": "If a caller is expelled from the queue when no agents are available", - "ANNOUNCEFREQUENCY": "How often to announce the caller’s position and/or estimated hold time in the queue (0=disable)", - "MINANNOUNCEFREQUENCY": "Minimum announcement frequency (useful when the caller’s position changes frequently)", - "PERIODICANNOUNCEFREQUENCY": "Frequency of periodic announcements to the caller", - "ANNOUNCEPOSITIONLIMIT": "Used if you’ve defined announce-position as either 'limit' or 'more'", - "AFTERCALLWORKDURATION": "Pause length triggered by the After Call Work option", - "MEMBERDELAY": "Inserts a delay prior to the caller and agent in queue get connected", - "MUSICONHOLD": "Sets the music class to use for a particular queue", - "ANNOUNCETOAGENT": "Plays an announcement to the agent answering the call (e.g. to let him know which queue the caller is coming from)", - "RANDOMPERIODICANNOUNCE": "If yes, it plays the periodic announcements in random order", - "ANNOUNCEHOLDTIME": "Plays the estimated hold time along with the periodic announcements (Yes/No/Once)", - "ANNOUNCECALLERPOSITION": "Used to define if the caller’s position in the queue should be announced: No=never; Yes=always; Limit=only if it is within the limit defined by announce-position-limit; More= only if it is beyond the value defined by announce-position-limit", - "REPORTHOLDTIMEAGENT": "Enables reporting caller’s hold time to the agent in queue prior to connection", - "PERIODICANNOUNCE": "Set of periodic announcements to be played (in the order)", - "HOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“Hold time”. Undefined=no announcement", - "YOUARENEXTANNOUNCE": "Choose a Sound defined in Tools. Default=“You are now first in line”. Undefined=no announcement", - "THEREAREANNOUNCE": "Choose a Sound defined in Tools. Default=“There are”. Undefined=no announcement", - "WAITINGCALLSANNOUNCE": "Choose a Sound defined in Tools. Default=“calls waiting”. Undefined=no announcement", - "ESTIMATEDHOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“The current estimated hold time is”. Undefined=no announcement", - "MINUTESANNOUNCE": "Choose a Sound defined in Tools. Default=“minutes”. Undefined=no announcement", - "MINUTEANNOUNCE": "Choose a Sound defined in Tools. Default=“minute”. Undefined=no announcement", - "SECONDSANNOUNCE": "Choose a Sound defined in Tools. Default=“seconds”. Undefined=no announcement", - "THANKYOUANNOUNCE": "Choose a Sound defined in Tools. Default=“Thank you for your patience”. Undefined=no announcement", - "AFTERCALLWORK": "If enabled, the agent will be set on Pause after completing a call", - "AUTOPAUSE": "Enables/disables the automatic pause of agents who fail to answer a call. If enabled, it causes the agent to be paused in all queues he belongs to", - "RINGINUSE": "To avoid/allow sending calls to members whose status is In Use", - "TIMEOUTRESTART": "If yes, this resets the timeout for an agent to answer when either a BUSY or CONGESTION status is received from the channel", - "MONITORFORMAT": "Specifies the file format to use when recording. If monitor-format is inactive, calls will not be recorded", - "CONTEXT": "Allows a caller to exit the queue by pressing a single DTMF digit. If a context is specified and the caller enters a number, that digit will attempt to be matched in the context specified, and dialplan execution will continue there", - "SETINTERFACEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information see wiki docs:click here)", - "SETQUEUEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent and leaving the queue, some variables will be set (for more information, see wiki docs:click here)", - "SETQUEUEENTRYVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information, see wiki docs:click here)", - "RECORDING": "Enable call recording", - "VOICEMAIL_CONTEXT": "The context of the relative extension", - "METHOD": "Outbound dialer method", - "POWERLEVEL": "Number of contacts to call for any available agent", - "PREDICTIVEOPTIMIZATION": "A factor to optimize in the predictive algorithm", - "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Percentage based on the selected predictive optimization factor", - "PREDICTIVEINTERVAL": "Time interval (in minutes) considered by the predictive algorithm to calculate the amount of calls to generate to optimize the result", - "MAXCONCURRENTCALLS": "Maximum number of concurrent calls that will be originated by the outbound dialer for this campaign (0=unlimited)", - "CONCURRENTCALLS": "Maximum number of concurrent calls that will be originated by the outbound dialer for this campaign", - "ORIGINATECALLERIDNAME": "Outgoing Caller Id Name", - "ORIGINATECALLERIDNUMBER": "Outgoing Caller Id Number", - "ORIGINATETIMEOUT": "Time (in seconds) for the outbound call to establish a connection, otherwise the status is set to No Answer ", - "QUEUETIMEOUT": "Time (in seconds) a call will wait in the queue before it is dropped (Min 1 and Max 999)", - "GLOBALMAXRETRY": "Maximum number of times a contact is called before considering it closed", - "CONGESTIONMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for congestion", - "CONGESTIONRETRYTIME": "Time in minutes before trying to call again a failed contact due to congestion", - "BUSYMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for busy", - "BUSYRETRYTIME": "Time in minutes before trying to call again a failed contact due to busy", - "NOANSWERMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for no answer", - "NOANSWERRETRYTIME": "Time in minutes before trying to call again a failed contact due to no answer", - "NOSUCHNUMBERMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for no such number", - "NOSUCHNUMBERRETRYTIME": "Time in minutes before trying to call again a failed contact due to no such number", - "DROPMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for drop", - "DROPRETRYTIME": "Time in minutes before trying to call again a failed contact due to drop", - "ABANDONEDMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for abandon", - "ABANDONEDRETRYTIME": "Time in minutes before trying to call again a failed contact due to abandon", - "MACHINEMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for machine", - "MACHINERETRYTIME": "Time in minutes before trying to call again a failed contact due to machine", - "AGENTREJECTMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for agent reject", - "AGENTREJECTRETRYTIME": "Time in minutes before trying to call again a failed contact due to agent reject", + "PREDICTIVEMAXTHRESHOLD": "Ako procenat Specijalista dostupnih u vremenskom intervalu, u poređenju sa Specijalistima dostupnim u vrijeme predviđanja, premašuje konfigurisano maksimalno ograničenje, prediktivni sistem ponovo izračunava predviđanje.", + "PREDICTIVEMINTHRESHOLD": "Ako procenat Specijalista dostupnih u vremenskom intervalu, u poređenju sa Specijalistima dostupnim u vrijeme predviđanja, premašuje konfigurisano mainimalno ograničenje, prediktivni sistem ponovo izračunava predviđanje.", + "RANDOMLASTDIGITCALLERIDNUMBER": "Ako je veći od 0, nasumično generira odgovarajuće posljednje cifre Odlaznog Pozivatelja ID Broj", + "TIMEOUT": "Broj sekundi koliko se poziva Specijalista u queue", + "CALLYSQUAREPROJECTPREVIEW": "Odabirom IVR projekta, birač će proslijediti poziv IVR-u kada se Specijalista javi (IVR će biti usmjeren na Specijalistu)", + "CALLYSQUAREPROJECTPREVIEW2": "Odabirom IVR projekta, birač će proslijediti poziv IVR-u kada klijent prekine vezu ili je nedostupan (IVR će biti usmjeren na Specijalistu)", + "RUNIFHANGUPAGENT": "Pokreni Cally Square Projekat Nakon čak i ako Specijalista prekine poziv", + "CALLYSQUAREPROJECT2": "Odabirom IVR projekta, birač će proslijediti poziv na IVR nakon queue (ako se queue završi do timeout-a)", + "DIALORDERBYSCHEDULEDAT": "Dobijte kontakte iz Hopper (silazni ili uzlazni).", + "DIALRECALLINQUEUE": "Ponovo zakaži pozive za Specijaliste u Queue ", + "DIALRECALLMETIMEOUT": "Vremenski interval (u minutama) za Recall Me period važenja", + "PRIORITY": "Prioritet na listi", + "TIMEZONE": "Odredite vremensku zonu", + "PREVIEW_RECALL_ME_REMINDER": "Ako je omogućeno, sistem će poslati obavještenje Specijalisti n minuta (prema vremenskom intervalu postavljenom u općim postavkama) prije generisanja recall me", + "AMDMAXIMUMWORDLENGTH": "Maksimalno dozvoljeno trajanje jednog govornog izgovora", + "AMDMINWORDLENGTH": "Minimalno trajanje glasa koje se smatra riječju", + "AMDSILENCETHRESHOLD": "Ako prosječan nivo buke u uzorku ne dostigne ovu vrijednost, sa skale od 0 do 32767, onda će se matrati tišinom ", + "AMDTOTALANALYSISTIME": "Maksimalno vrijeme dozvoljeno algoritmu da odluči o tome da li zvuk predstavlja LJUDSKI ili MAŠINSKI", + "AMDAFTERGREETINGSILENCE": "Tišina nakon otkrivanja pozdrava. Ako se prekorači, rezultat je otkrivanje kao LJUDSKO", + "AMDGREETING": "Maksimalna dužina pozdrava. Ako se prekorači, rezultat je detekcija kao MAŠINSKO", + "AMDINITIALSILENCE": "Maksimalno trajanje tišine prije pozdrava. Ako se prekorači, rezultat je detekcija kao MAŠINSKO", + "AMDACTIVE": "Aktiviraj ili deaktiviraj pokušaje otkrivanja telefonskih sekretarica", + "AMDBETWEENWORDSSILENCE": "Minimalno trajanje tišine nakon riječi kako bi se audio koji slijedi smatrao novom riječju", + "AMDMAXIMUMNUMBEROFWORDS": "Maksimalan broj riječi u pozdravu. Ako se DOSTIGNE, onda je rezultat detekcija kao MAŠINSKO", + "CALLYSQUAREPROJECT": "Odabirom IVR projekta, birač će proslijediti poziv IVR-u prije queue", + "PREFIX": "Telefonski prefiks", + "ACTIVE": "Aktivan", + "AGENTTIMEOUT": "Koliko dugo (u sekundama) treba zvoniti uređaj Specijaliste", + "MAXLENGTH": "Maksimalan broj pozivatelja koji mogu čekati u queue (0 = neograničeno)", + "RETRY": "Koliko dugo (u sekundama) treba čekati prije pozivanja sljedećeg Specijaliste u queue kada Specijalistin timeout istekne", + "WRAPUPTIME": "Koliko dugo (u sekundama) treba zadržati Specijalistu nedostupnim u queue nakon završetka poziva", + "WEIGHT": "Koristi se za određivanje prioriteta ako su Specijalisti povezani s više od jednog queue", + "JOINWHENEMPTY": "Ako je pozivatelj dodan u queue, kada nema dostupnih Specijalista", + "LEAVEWHENEMPTY": "Ako je pozivatelj izbačen iz queue kada nema dostupnih Specijalista", + "ANNOUNCEFREQUENCY": "Koliko često najavljivati poziciju pozivaoca i/ili procjenjeno vrijeme čekanja u queue (0=onemogućeno)", + "MINANNOUNCEFREQUENCY": "Minimalna učestalost najava (korisno kada se pozicija pozivatelja često mijenja)", + "PERIODICANNOUNCEFREQUENCY": "Učestalost periodičnih najava pozivatelju", + "ANNOUNCEPOSITIONLIMIT": "Koristi se ako ste definisali poziciju najave kao 'ograničenje' ili 'više'", + "AFTERCALLWORKDURATION": "Dužina pauze koju pokreće opcija Nakon Poziva Posao", + "MEMBERDELAY": "Unosi odgodu prije nego što se pozivatelj i Specijalista u queue se povežu", + "MUSICONHOLD": "Postavlja muzičku klasu za korištenje u određeni queue", + "ANNOUNCETOAGENT": "Reproducira najavu Specijaliste koji odgovara na poziv (npr. da bi ga obavijestio iz kojeg queue pozivatelj dolazi)", + "RANDOMPERIODICANNOUNCE": "Ako je da, reproducira periodične najave slučajnim redoslijedom", + "ANNOUNCEHOLDTIME": "Reproducira procijenjeno vrijeme čekanja zajedno s periodičnim najavama (Da/Ne/Jednom)", + "ANNOUNCECALLERPOSITION": "Koristi se za definisanje da li treba objaviti poziciji pozivatelja u queue: Ne=nikada;Da=uvijek;Limit=samo ako je unutar ograničenja definisanog sa najava-pozicija-limit; Više=samo ako je iznad vrijednositi definisane sa najava-pozicija-limit", + "REPORTHOLDTIMEAGENT": "Omogućuje izvještavanje o vremenu čekanja pozivatelja Specijalisti u queue prije povezivanja", + "PERIODICANNOUNCE": "Set periodičnih najava koje će se puštati (po redoslijedu)", + "HOLDTIMEANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"Vrijeme čekanja\". Nedefinisano=bez najave", + "YOUARENEXTANNOUNCE": "Odaberite Zvuk definiram u Alatima. Zadano=\"Sada ste prvi u redu\". Nedifinirano=bez najave", + "THEREAREANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=\"Ispred su\". Nedefinisano=bez najave", + "WAITINGCALLSANNOUNCE": "Odaberide Zvuk definiran u Alatima. Zadano=\"pozivi na čekanju\". Nedifinirano=bez najave", + "ESTIMATEDHOLDTIMEANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"Trenutno procijenjeno vrijeme čekanja je\". Nedefinisano=Bez najave", + "MINUTESANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=“minute”. Nedefinisano=bez najave", + "MINUTEANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=“minute”. Nedefinisano=bez najave", + "SECONDSANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"sekunde\". Nedefinisano=bez najave", + "THANKYOUANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=\"Hvala Vam na strpljenju\". Nedefinisano=bez najave", + "AFTERCALLWORK": "Ako je omogućeno, Specijalist će biti postavljen na pauzu nakon završetka poziva", + "AUTOPAUSE": "Omogućava/onemogućava automatsku pauzu Specijaliste koji ne odgovaraju na poziv. Ako je omogućeno, to uzrokuje da Specijalista bude pauziran u svim queue kojima pripada", + "RINGINUSE": "Za izbjegavanje/dozvoljavanje slanja poziva članovima čiji je status U Upotrebi", + "TIMEOUTRESTART": "Ako je da, ovo restartuje timeout za Specijalistu da odgovori kada je ili Zauzet ili Zagušen status primljen od kanala", + "MONITORFORMAT": "Određuje format datoteke koji će se koristiti prilikom snimanja. Ako je format monitora neaktivan, pozivi se neće snimati", + "CONTEXT": "Omogućava pozivatelju da napusti queue pritiskom na jednu DTMF cifru. Ako je kontekst određen i pozivatelj unese broj, ta cifra će se pokušati upariti u određenom kontekstu, a izvršavanje plana biranja će se tamo nastaviti.", + "SETINTERFACEVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "SETQUEUEVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue i napusti queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "SETQUEUEENTRYVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "RECORDING": "Omogući snimanje poziva", + "VOICEMAIL_CONTEXT": "Kontekst relativne ekstenzije", + "METHOD": "Odlazni birač metoda", + "POWERLEVEL": "Broj kontakata za pozivanje bilo kojeg dostupnog Specijaliste", + "PREDICTIVEOPTIMIZATION": "Faktor za optimizaciju u prediktivnom algoritmu", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Postotak zasnovan na odabranom faktoru prediktivne optimizacije", + "PREDICTIVEINTERVAL": "Vremenski interval (u minutama) koji prediktivni algoritam razmatra za izračunavanje količine poziva za generisanje radi optimizacije rezultata", + "MAXCONCURRENTCALLS": "Maksimalan broj istovremenih poziva koje će uputiti odlazni birač za ovu kampanju (0 = neograničeno)", + "CONCURRENTCALLS": "Maksimalan broj istovremenih poziva koje će pokrenuti odlazni birač za ovu kampanju", + "ORIGINATECALLERIDNAME": "Odlazni Pozivatelj ID Naziv", + "ORIGINATECALLERIDNUMBER": "Odlazni Pozivatelj ID Broj", + "ORIGINATETIMEOUT": "Vrijeme (u sekundama) za uspostavljanje veze odlaznim pozivom, inače je status postavljen na Bez Odgovora", + "QUEUETIMEOUT": "Vrijeme (u sekundama) koliko će poziv čekati u queue prije nego što bude ispušten (Min 1 i Maks 999)", + "GLOBALMAXRETRY": "Maksimalan broj poziva kontakta prije nego što se smatra zatvorenim", + "CONGESTIONMAXRETRY": "Maksimalan broj poziva kontakta prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog zagušenja", + "CONGESTIONRETRYTIME": "Vrijeme u minutama prije pokušaja ponovnog pozivanja kontakta koji nije uspio zbog zagušenja", + "BUSYMAXRETRY": "Maksimalan broj puta da je kontakt pozvan prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog zauzetosti", + "BUSYRETRYTIME": "Vrijeme u minutama prije ponovnog pokušaja pozivanja kontakta koji nije uspio zbog zauzetosti", + "NOANSWERMAXRETRY": "Maksimalan broj puta da je kontakt pozvan prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog neodgovaranja", + "NOANSWERRETRYTIME": "Vrijeme u minutama prije ponovnog pokušaja pozivanja kontakta koji nije uspio zbog neodgovaranja", + "NOSUCHNUMBERMAXRETRY": "Maksimalan broj poziva kontakta prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog nepostojećeg broja", + "NOSUCHNUMBERRETRYTIME": " Vrijeme u minutama prije pokušaja ponovnog pozivanja kontakta koji nije uspio zbog nepostojećeg broja", + "DROPMAXRETRY": "Vremenski interval (u minutama za Recall Me period važenja", + "DROPRETRYTIME": "Vrijeme u minutama prije pokušaja ponovnog pozivanja neuspjelog kontakta zbog pada", + "ABANDONEDMAXRETRY": "Maksimalan broj puta da je kontakt pozvan prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog napuštanja", + "ABANDONEDRETRYTIME": "Vrijeme u minutama prije pokušaja ponovnog pozivanja kontakta koji nije uspio zbog napuštanja", + "MACHINEMAXRETRY": "Maksimalan broj poiva kontakta prije nego što se smatra zatvorenim, kada poziv nije uspio za mašinu", + "MACHINERETRYTIME": "Vrijeme u minutama prije pokušaja ponovnog pozivanja kontakta koji nije uspio zbog mašine", + "AGENTREJECTMAXRETRY": "Maksimalan broj puta da je kontakt pozvan prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog odbijanja Specijaliste", + "AGENTREJECTRETRYTIME": "Vrijeme u minutam prije pokušaja ponovnog pozivanja neuspjelog kontakta zbog odbijanja Specijaliste", "CALLADDITIONALPHONEAFTERMIN": "", - "GLOBALINTERVAL": "Global time interval during which the dialer is allowed to call contacts. We decline responsibility: pay attention when you modify this field, because you may fail to comply with the national Autodialer Laws and Regulations", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "MANDATORYDISPOSITIONPAUSEID": "Pause status to set during mandatory disposition", - "PREVIEW_AUTO_RECALL_ME": "If enabled, the system will automatically generate the Recall Me calls; otherwise, the agent must do it manually" + "GLOBALINTERVAL": "Globalni vremenski interval tokom kojeg je biraču dozvoljeno da poziva kontakte. Odbijamo odgovornost: obrati pažnju kada se modifikujete ovo polje, jer se možda nećeš pridržavati nacionalnih zakona i propisa o automatskom biranju brojeva", + "NAME": "Samo brojevi, slova i specifični znakovi (._) su podržani", + "MANDATORYDISPOSITIONPAUSEID": "Status pauze za postavljanje tokom obavezne dispozicije", + "PREVIEW_AUTO_RECALL_ME": "Ako je omogućeno, sistem će automatski generisati Recall Me pozive; inače, Specijalista to mora učiniti ručno" }, - "MUSICONHOLD": "Music On Hold", - "ANNOUNCETOAGENT": "Announce To Agent", - "ANNOUNCEMENTS": "Announcements", - "ADVANCEDPREVIEW": "Advanced", - "ADVANCED": "Advanced", - "ADVANCE": "Advanced", - "ANNOUNCEFREQUENCY": "Announce Frequency", - "MINANNOUNCEFREQUENCY": "Minimum Announce Frequency", - "PERIODICANNOUNCEFREQUENCY": "Periodic Announce Frequency", - "RANDOMPERIODICANNOUNCE": "Random Periodic Announce", - "ANNOUNCEHOLDTIME": "Announce Hold Time", - "ANNOUNCECALLERPOSITION": "Announce Caller Position", - "ANNOUNCEPOSITIONLIMIT": "Announce Position Limit", - "REPORTHOLDTIMEAGENT": "Report Agent Hold Time", - "PERIODICANNOUNCE": "Periodic Announce", - "HOLDTIMEANNOUNCE": "Hold Time Announce", - "YOUARENEXTANNOUNCE": "'You are next' Announce", - "THEREAREANNOUNCE": "'There are' Announce", - "WAITINGCALLSANNOUNCE": "Waiting Calls Announce", - "ESTIMATEDHOLDTIMEANNOUNCE": "Estimated Hold Time Announce", - "MINUTESANNOUNCE": "Minutes Announce", - "MINUTEANNOUNCE": "Minute Announce", - "SECONDSANNOUNCE": "Seconds Announce", - "THANKYOUANNOUNCE": "'Thank You' Announce", - "AUTOPAUSE": "Auto Pause", - "AFTERCALLWORK": "After Call Work", - "AFTERCALLWORKDURATION": "After Call Work Duration", - "RINGINUSE": "Ring In Use", - "MEMBERDELAY": "Member Delay", + "MUSICONHOLD": "Muzika Na Čekanju", + "ANNOUNCETOAGENT": "Najavi Specijalisti", + "ANNOUNCEMENTS": "Najave", + "ADVANCEDPREVIEW": "Napredno", + "ADVANCED": "Napredno", + "ADVANCE": "Napredno", + "ANNOUNCEFREQUENCY": "Najava Učestalost", + "MINANNOUNCEFREQUENCY": "Minimalna Učestalost Najava", + "PERIODICANNOUNCEFREQUENCY": "Učestalost Periodičnih Najava", + "RANDOMPERIODICANNOUNCE": "Nasumično Periodično Objavljivanje", + "ANNOUNCEHOLDTIME": "Najavi Vrijeme Čekanja", + "ANNOUNCECALLERPOSITION": "Najavi Poziciju Pozivaoca", + "ANNOUNCEPOSITIONLIMIT": "Najavi Limit Pozicije", + "REPORTHOLDTIMEAGENT": "Izvještaj Vrijeme Čekanja Specijaliste", + "PERIODICANNOUNCE": "Periodična Najava", + "HOLDTIMEANNOUNCE": "Vrijeme Čekanja Najave", + "YOUARENEXTANNOUNCE": "'Vi ste sljedeći' Najava", + "THEREAREANNOUNCE": "'Ispred su' Najava", + "WAITINGCALLSANNOUNCE": "Najava Poziva Na Čekanju", + "ESTIMATEDHOLDTIMEANNOUNCE": "Procjenjeno Hold Vrijeme Najava", + "MINUTESANNOUNCE": "Minute Najava", + "MINUTEANNOUNCE": "Minuta Najava", + "SECONDSANNOUNCE": "Sekunde Najava", + "THANKYOUANNOUNCE": "'Hvala Vam' Najava", + "AUTOPAUSE": "Automatska Pauza", + "AFTERCALLWORK": "Nakon Poziva Posao", + "AFTERCALLWORKDURATION": "Nakon Poziva Posao Trajanje", + "RINGINUSE": "Zvono U Upotrebi", + "MEMBERDELAY": "Član Odgoda", "TIMEOUTRESTART": "Timeout Restart", - "MONITORFORMAT": "Recording Format", - "SETINTERFACEVARIABLES": "Set Interface Variables", - "SETQUEUEVARIABLES": "Set Queue Variables", - "SETQUEUEENTRYVARIABLES": "Set Queue Entry Variables", - "CONTEXT": "Context", - "SAVE": "Save", - "SETTINGS": "Settings", - "INBOUNDROUTES": "Inbound Routes", - "PHONENUMBER": "Phone Number", - "ADD_INBOUNDROUTE": "Add Inbound Route", - "EDIT_INBOUNDROUTE": "Edit Inbound Route", - "DELETE_INBOUNDROUTE": "Delete Inbound Route", - "ACTIONS": "Actions", - "OUTBOUNDROUTES": "Outbound Routes", - "DESTINATIONPATTERN": "Destination Pattern", - "ADD_OUTBOUNDROUTE": "Add Outbound Route", - "EDIT_OUTBOUNDROUTE": "Edit Outbound Route", - "DELETE_OUTBOUNDROUTE": "Delete Outbound Route", - "CUTDIGITS": "Cut Digits", - "RECORDING": "Recording", - "RECORDINGFORMAT": "Recording format", - "INTERNALROUTES": "Internal Routes", - "ADD_INTERNALROUTE": "Add Internal Route", - "EDIT_INTERNALROUTE": "Edit Internal Route", - "DELETE_INTERNALROUTE": "Delete Internal Route", - "CONTEXTS": "Contexts", - "ADD_CONTEXT": "Add Context", - "EDIT_CONTEXT": "Edit Context", - "DELETE_CONTEXT": "Delete Context", - "VOICEMAILS": "Voicemails", - "ADD_VOICEMAIL": "Add Voicemail", - "EDIT_VOICEMAIL": "Edit Voicemail", - "DELETE_VOICEMAIL": "Delete Voicemail", - "FULLNAME": "Full Name", - "EMAIL": "Email", - "MAILBOX": "Mailbox", - "PASSWORD": "Password", - "CONFIRM_PASSWORD": "Confirm Password", - "TIMEZONE": "Timezone", - "ATTACH": "Attach", + "MONITORFORMAT": "Format Snimanja", + "SETINTERFACEVARIABLES": "Postavi Varijable Interfejsa ", + "SETQUEUEVARIABLES": "Postavi Varijable Queue", + "SETQUEUEENTRYVARIABLES": "Postavi Varijable Ulaznog Queue", + "CONTEXT": "Kontekst", + "SAVE": "Sačuvaj", + "SETTINGS": "Postavke", + "INBOUNDROUTES": "Dolazne Rute", + "PHONENUMBER": "Broj Telefona", + "ADD_INBOUNDROUTE": "Dodaj Inbound Rutu", + "EDIT_INBOUNDROUTE": "Uredi Internu Rutu", + "DELETE_INBOUNDROUTE": "Izbriši Dolaznu Rutu", + "ACTIONS": "Radnje", + "OUTBOUNDROUTES": "Odlazne Rute", + "DESTINATIONPATTERN": "Obrazac Odredišta", + "ADD_OUTBOUNDROUTE": "Dodaj Outbound Rutu", + "EDIT_OUTBOUNDROUTE": "Uredi Odlaznu Rutu", + "DELETE_OUTBOUNDROUTE": "Izbriši Odlaznu Rutu", + "CUTDIGITS": "Izreži Cifre", + "RECORDING": "Snimanje", + "RECORDINGFORMAT": "Format snimanja", + "INTERNALROUTES": "Interne Rute", + "ADD_INTERNALROUTE": "Dodaj Internu Rutu", + "EDIT_INTERNALROUTE": "Uredi Internu Rutu", + "DELETE_INTERNALROUTE": "Izbriši Internu Rutu", + "CONTEXTS": "Konteksti", + "ADD_CONTEXT": "Dodaj Kontekst", + "EDIT_CONTEXT": "Uredi Kontekst", + "DELETE_CONTEXT": "Izbriši Kontekst", + "VOICEMAILS": "Govorne pošte", + "ADD_VOICEMAIL": "Dodaj Govornu Poštu ", + "EDIT_VOICEMAIL": "Uredi Govornu Poštu", + "DELETE_VOICEMAIL": "Izbriši Govorno Poštu", + "FULLNAME": "Puno Ime", + "EMAIL": "E-Mail", + "MAILBOX": "Poštansko sanduče", + "PASSWORD": "Lozinka", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "TIMEZONE": "Vremenska Zona", + "ATTACH": "Priloži", "ENVELOPE": "Envelope", - "DELETE": "Delete", - "EMAILBODY": "Email Body", - "EMAILSUBJECT": "Email Subject", - "MAXSECONDS": "Max Seconds", - "MAXMESSAGES": "Max Messages", - "MESSAGES": "Messages", - "SORT": "Sort", - "ADD_MUSICONHOLD": "Add Music On Hold", - "MUSICONHOLDS": "Music On Hold", - "EDIT_MUSICONHOLD": "Edit Music On Hold", - "DELETE_MUSICONHOLD": "Delete Music On Hold", - "DIRECTORY": "Directory", - "AUDIOFILES": "Audio Files", - "RECORDINGS": "Recordings", + "DELETE": "Izbriši", + "EMAILBODY": "E-Mail Tijelo", + "EMAILSUBJECT": "E-Mail Predmet", + "MAXSECONDS": "Maks Sekundi", + "MAXMESSAGES": "Maks Poruka", + "MESSAGES": "Poruke", + "SORT": "Sortiraj", + "ADD_MUSICONHOLD": "Dodaj Muziku Na Čekanju", + "MUSICONHOLDS": "Muzika Na Čekanju", + "EDIT_MUSICONHOLD": "Uredi Muzika Na Čekanju", + "DELETE_MUSICONHOLD": "Izbriši Muzika Na Čekanju", + "DIRECTORY": "Adresar", + "AUDIOFILES": "Audio Datoteke", + "RECORDINGS": "Snimci", "CHANSPY": "ChanSpy", - "PREFIX": "Prefix", - "OPTIONS": "Options", + "PREFIX": "Prefiks", + "OPTIONS": "Opcije", "AUTH": "Auth", - "ADD_CHANSPY": "Add ChanSpy", - "EDIT_CHANSPY": "Edit ChanSpy", - "DELETE_CHANSPY": "Delete ChanSpy", - "AGENTS": "Agents", - "TELEPHONES": "Telephones", + "ADD_CHANSPY": "Dodaj ChanSpy", + "EDIT_CHANSPY": "Uredi ChanSpy", + "DELETE_CHANSPY": "Izbriši ChanSpy", + "AGENTS": "Specijalisti", + "TELEPHONES": "Telefoni", "QUEUES": "Queues", - "QUEUE_CALLS": "Queue Calls", - "QUEUE_PARAMETERS": "Queue Parameters", - "ABANDONED_CALLS": "Abandoned Calls", - "OUTBOUND_CALLS": "Outbound Calls", + "QUEUE_CALLS": "Queue Pozivi", + "QUEUE_PARAMETERS": "Queue Parametri", + "ABANDONED_CALLS": "Napušteni Pozivi", + "OUTBOUND_CALLS": "Odlazni Pozivi", "AGI": "AGI", - "DIAL": "Dial", - "INTERNALDIAL": "Internal Dial", - "EXTERNALDIAL": "External Dial", - "RINGGROUP": "Ring Group", - "PLAYBACK": "Playback", + "DIAL": "Biraj", + "INTERNALDIAL": "Interno Biranje", + "EXTERNALDIAL": "Eksterno Pozivanje", + "RINGGROUP": "Grupa Zvona", + "PLAYBACK": "Reprodukcija", "QUEUE": "Queue", - "SET": "Set", - "VOICEMAIL": "Voicemail", + "SET": "Postavi", + "VOICEMAIL": "Govorna pošta", "GOTO": "GoTo", - "HANGUP": "Hangup", - "CUSTOM": "Custom", - "PROJECT": "Cally-Square Project", - "TECHNOLOGY/RESOURCE": "Technology/Resource", + "HANGUP": "Prekid", + "CUSTOM": "Prilagođeno", + "PROJECT": "Cally-Square Projekat", + "TECHNOLOGY/RESOURCE": "Tehnologija/Resursi", "URL": "URL", - "EDIT_APP": "Edit Application", - "EDIT_INTERVAL": "Edit Interval", - "DELETE_APP": "Delete Application", - "INTERVALS": "Intervals", - "USER": "User", + "EDIT_APP": "Uredi Aplikaciju", + "EDIT_INTERVAL": "Uredi Interval", + "DELETE_APP": "Izbriši Aplikaciju", + "INTERVALS": "Intervali", + "USER": "Korisnik", "TRUNK": "Trunk", - "PHONE": "Phone", - "AUDIO_FILES": "Audio Files", - "ANNOUNCE_OVERRIDES": "Announce Overrides", - "MACRO": "Macro", + "PHONE": "Telefon", + "AUDIO_FILES": "Audio Datoteke", + "ANNOUNCE_OVERRIDES": "Najave Nadjačavanja", + "MACRO": "Makro", "GOSUB": "GoSub", - "RULE": "Rule", - "POSITION": "Position", - "ANSWER": "Answer", - "VALUE": "Value", - "MAILBOX@CONTEXT": "Mailbox@Context", - "EXTENSION": "Extension", - "PRIORITY": "Priority", - "HANGUP_CAUSE": "Hangup Cause", - "OUTBOUNDDIAL": "Outbound Dial", - "CALLER_ID": "Caller ID", - "NO_MESSAGE_AVAILABLE": "No messages available", - "NO_SOUND_AVAILABLE": "No sounds available", - "VOICERECORDINGS": "Voice Recordings", + "RULE": "Pravilo", + "POSITION": "Pozicija", + "ANSWER": "Odgovori", + "VALUE": "Vrijednost", + "MAILBOX@CONTEXT": "Poštanskosanduče@Kontekst", + "EXTENSION": "Ekstenzija", + "PRIORITY": "Prioritet", + "HANGUP_CAUSE": "Hangup Razlog", + "OUTBOUNDDIAL": "Odlazno Biranje", + "CALLER_ID": "Pozivatelj ID", + "NO_MESSAGE_AVAILABLE": "Nema dostupnih poruka", + "NO_SOUND_AVAILABLE": "Nema dostupnih zvukova", + "VOICERECORDINGS": "Voice Snimci", "CHANSPIES": "ChanSpy", "VOICE": "Voice", "REALTIME": "Realtime", - "ID": "Id", - "VOICEMAIL_CONTEXT": "Context", - "NO_MOHSOUND_AVAILABLE": "No Music On Hold available", - "FILE": "File", - "ADD_MOHSOUND": "Add Music On Hold sound", - "DOWNLOAD_MOHSOUND": "Download Music On Hold sound", - "DELETE_MOHSOUND": "Delete Music On Hold sound", - "UNIQUEID": "Unique ID", - "AGENT": "Agent", - "TYPE": "Type", - "RATING": "Rating", + "ID": "ID", + "VOICEMAIL_CONTEXT": "Kontekst", + "NO_MOHSOUND_AVAILABLE": "Nema dostupne Muzike Na Čekanju", + "FILE": "Datoteka", + "ADD_MOHSOUND": "Dodaj Muzika Na Čekanju zvuk ", + "DOWNLOAD_MOHSOUND": "Skini Muzika Na Čekanju zvuk", + "DELETE_MOHSOUND": "Izbriši Muzika Na Čekanju zvuk", + "UNIQUEID": "Jedinstveni ID", + "AGENT": "Specijalist", + "TYPE": "Vrsta", + "RATING": "Ocjena", "AUDIO": "Audio", - "DATE": "Date", - "NEW_VOICEQUEUE": "New Voice Queue", - "NEW_INBOUNDROUTE": "New Inbound Route", - "NEW_OUTBOUNDROUTE": "New Outbound Route", - "NEW_INTERNALROUTE": "New Internal Route", - "NEW_CONTEXT": "New Context", - "NEW_VOICEMAIL": "New Voicemail", - "NEW_MUSICONHOLD": "New Music On Hold", - "NEW_CHANSPY": "New ChanSpy", - "PENALTY": "Penalty", - "ADD_TEAM_TO_VOICEQUEUE": "Add Team to Voice Queue", - "ADD_AGENT_TO_VOICEQUEUE": "Add Agent to Voice Queue", - "EDIT_DIAL": "Edit Dial", - "EDIT_AGI": "Edit AGI", - "EDIT_INTERNALDIAL": "Edit Internal Dial", - "EDIT_EXTERNALDIAL": "Edit External Dial", - "EDIT_RINGGROUP": "Edit Ring Group", - "EDIT_PLAYBACK": "Edit Playback", - "EDIT_QUEUE": "Edit Queue", - "EDIT_SET": "Edit Set", - "EDIT_GOTO": "Edit GoTo", - "EDIT_HANGUP": "Edit Hangup", - "EDIT_CUSTOM": "Edit Custom", - "DURATION": "Duration", - "RECEIVED_AT": "Received At", - "YES": "Yes", - "NO": "No", - "HANGUPCAUSE_1": "1 = Unallocated number", - "HANGUPCAUSE_16": "16 = Normal call clearing", - "HANGUPCAUSE_17": "17 = User busy", - "HANGUPCAUSE_18": "18 = No user responding (telehone device not connected)", - "HANGUPCAUSE_21": "21 = Call rejected", - "HANGUPCAUSE_22": "22 = Number changed", - "HANGUPCAUSE_27": "27 = Destination out of order", - "HANGUPCAUSE_38": "38 = Network out of order", - "HANGUPCAUSE_41": "41 = Temporary failure", - "RANDOM": "Random", - "ALPHABETICAL": "Alphabetical", - "NO_APPS_AVAILABLE": "No applications available", - "DOWNLOAD_VOICERECORDING": "Download Voice Recording", - "DELETE_VOICERECORDING": "Delete Voice Recording", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "REGISTERED": "Registered", - "UNREGISTERED": "Unregistered", - "LAGGED": "Lagged", - "REACHABLE": "Reachable", - "UNREACHABLE": "Unreachable", - "UNKNOWN": "Unknown", - "NOT_INUSE": "Not in use", - "INUSE": "In Use", - "BUSY": "Busy", - "INVALID": "Invalid", - "UNAVAILABLE": "Unavailable", - "RINGING": "Ringing", - "ONHOLD": "On Hold", - "RING": "Ring", - "UP": "Up", + "DATE": "Datum", + "NEW_VOICEQUEUE": "Novi Voice Queue", + "NEW_INBOUNDROUTE": "Nova Dolazna Ruta", + "NEW_OUTBOUNDROUTE": "Nova Odlazna Ruta", + "NEW_INTERNALROUTE": "Nova Interna Ruta", + "NEW_CONTEXT": "Novi Kontekst", + "NEW_VOICEMAIL": "Nova Govorna Pošta", + "NEW_MUSICONHOLD": "Nova Muzika Na Čekanju", + "NEW_CHANSPY": "Novi ChanSpy", + "PENALTY": "Kazna", + "ADD_TEAM_TO_VOICEQUEUE": "Dodaj Tim u Voice Queue", + "ADD_AGENT_TO_VOICEQUEUE": "Dodaj Specijalistu u Voice Queue", + "EDIT_DIAL": "Uredi Biranje", + "EDIT_AGI": "Uredi AGI", + "EDIT_INTERNALDIAL": "Uredi Interno Biranje", + "EDIT_EXTERNALDIAL": "Uredi Eksterno Biranje", + "EDIT_RINGGROUP": "Uredi Ring Grupu", + "EDIT_PLAYBACK": "Uredi Reprodukciju", + "EDIT_QUEUE": "Uredi Queue", + "EDIT_SET": "Uredi Postavljanje", + "EDIT_GOTO": "Uredi GoTo", + "EDIT_HANGUP": "Uredi Hangup", + "EDIT_CUSTOM": "Uredi Prilagođeno", + "DURATION": "Trajanje", + "RECEIVED_AT": "Primljeno U", + "YES": "Da", + "NO": "Ne", + "HANGUPCAUSE_1": "1 = Nedodijeljen broj", + "HANGUPCAUSE_16": "16 = Normalno brisanje poziva", + "HANGUPCAUSE_17": "17 = Korisnik zauzet", + "HANGUPCAUSE_18": "18 = Korisnik ne odgovara (telefonski uređaj nije povezan)", + "HANGUPCAUSE_21": "21 = Poziv odbijen", + "HANGUPCAUSE_22": "22 = Broj promijenjen", + "HANGUPCAUSE_27": "27 = Odredište poremećeno", + "HANGUPCAUSE_38": "38 = Mreža poremećena", + "HANGUPCAUSE_41": "41 = Privremeno neuspješno", + "RANDOM": "Nasumično", + "ALPHABETICAL": "Abecedno", + "NO_APPS_AVAILABLE": "Nema dostupnih aplikacija", + "DOWNLOAD_VOICERECORDING": "Skini Voice Snimanje", + "DELETE_VOICERECORDING": "Izbriši Voice Snimak", + "INTERNAL": "Interno", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", + "REGISTERED": "Registrovan", + "UNREGISTERED": "Neregistrovan", + "LAGGED": "Zaostao", + "REACHABLE": "Dostupno", + "UNREACHABLE": "Nedostupan", + "UNKNOWN": "Nepoznato", + "NOT_INUSE": "Nije u upotrebi", + "INUSE": "U Upotrebi", + "BUSY": "Zauzet", + "INVALID": "Nevažeći", + "UNAVAILABLE": "Nedostupno", + "RINGING": "Zvoniti", + "ONHOLD": "Na Čekanju", + "RING": "Zvono", + "UP": "Gore", "INFO": "Info", - "TRUNKS": "Trunks", - "REGISTRY": "Registry", - "NO_REGISTRY": "No registry", - "LOGGED_IN": "Logged in (SIP connected)", - "PAUSED": "Paused", - "DISPOSITION": "Disposition", - "WAITING": "Waiting", - "TALKING": "Talking", + "TRUNKS": "Trunkovi", + "REGISTRY": "Registar", + "NO_REGISTRY": "Nema registra", + "LOGGED_IN": "Prijavljen (SIP povezan)", + "PAUSED": "Pauzirano", + "DISPOSITION": "Dispozicija", + "WAITING": "Čeka", + "TALKING": "Priča", "DID": "DID", - "CALLER": "Caller", - "TOTAL": "Total", - "ANSWERED": "Answered", - "ABANDONED": "Abandoned", - "UNMANAGED": "Unmanaged", - "REDIRECT_TO_NUMBER": "Redirect to a number", - "REDIRECT_TO_AGENT": "Redirect to an agent", - "CLOSING": "Closing", - "AVG_HOLD_TIME": "Avg Hold Time", - "AVG_DURATION": "Avg Duration", - "AVG_BILLABLE": "Avg Billable", - "SOURCE": "Source", - "DESTINATION": "Destination", - "REJECTED": "Rejected", - "FAILED": "Failed", - "CALLED": "Called", - "CONNECTED": "Connected", - "NO_RATING": "No rating", - "EDIT_VOICERECORDING": "Edit Voice Recording", - "APPLICATION_NAME": "Application Name", - "ARGUMENTS": "Arguments", - "EDIT_QUEUECAMPAIGN": "Edit Campaign", - "LISTADD_QUEUECAMPAIGN": "Add List", - "BLACKLISTADD_QUEUECAMPAIGN": "Add Blacklist", - "TEAMADD_QUEUECAMPAIGN": "Add Team", - "AGENTADD_QUEUECAMPAIGN": "Add Agent", - "DELETE_QUEUECAMPAIGN": "Delete Campaign", - "DELETE_IVRCAMPAIGN": "Delete Campaign", - "EDIT_IVRCAMPAIGN": "Edit Campaign", - "NEW_IVRCAMPAIGN": "New IVR Campaign", - "ADD_IVRCAMPAIGN": "Add IVR Campaign", - "LISTADD_IVRCAMPAIGN": "Add List", - "BLACKLISTADD_IVRCAMPAIGN": "Add Blacklist", - "ENABLED": "Enabled", - "READY": "Ready", - "PAUSE": "Pause", - "UNPAUSE": "End Pause", - "DEFAULT_PAUSE": "Default Pause", - "AGENTADD_QUEUE": "Add Agent to queue campaign", - "AGENTSADD_QUEUE": "Add Agents to queue campaign", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "ALL_LISTS": "All Lists", - "SELECTED_LISTS": "Selected Lists", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "WAITING_FOR_AGENT": "Waiting for Agent", - "TOTAL_OFFERED": "Total Offered", - "RUNNING": "Running", - "TRUNK_IS_NOT_REACHABLE": "Trunk is Not Reachable", - "AGENTS_NOT_LOGGED": "Agent not logged", - "NOT_ACTIVE": "Not Active", - "IS_DISACTIVED": "Deactivated", + "CALLER": "Pozivatelj", + "TOTAL": "Ukupno", + "ANSWERED": "Odgovoreno", + "ABANDONED": "Napušteno", + "UNMANAGED": "Neupravljan", + "REDIRECT_TO_NUMBER": "Preusmjeri na broj", + "REDIRECT_TO_AGENT": "Preusmjeri na Specijalistu", + "CLOSING": "Zatvaranje", + "AVG_HOLD_TIME": "Prosječno Vrijeme Čekanja", + "AVG_DURATION": "Prosječno Trajanje", + "AVG_BILLABLE": "Prosječno Naplativo", + "SOURCE": "Izvor", + "DESTINATION": "Odredište", + "REJECTED": "Odbijeno", + "FAILED": "Neuspješno", + "CALLED": "Zvao", + "CONNECTED": "Povezano", + "NO_RATING": "Nema ocjene", + "EDIT_VOICERECORDING": "Uredi Voice Snimanje", + "APPLICATION_NAME": "Naziv Aplikacije", + "ARGUMENTS": "Argumenti", + "EDIT_QUEUECAMPAIGN": "Uredi Kampanju", + "LISTADD_QUEUECAMPAIGN": "Dodaj Listu", + "BLACKLISTADD_QUEUECAMPAIGN": "Dodaj Crnu Listu", + "TEAMADD_QUEUECAMPAIGN": "Dodaj Tim", + "AGENTADD_QUEUECAMPAIGN": "Dodaj Specijalistu", + "DELETE_QUEUECAMPAIGN": "Izbriši Kampanju", + "DELETE_IVRCAMPAIGN": "Izbriši Kampanju", + "EDIT_IVRCAMPAIGN": "Uredi Kampanju", + "NEW_IVRCAMPAIGN": "Nova IVR Kampanja", + "ADD_IVRCAMPAIGN": "Dodaj IVR Kampanju", + "LISTADD_IVRCAMPAIGN": "Dodaj Listu", + "BLACKLISTADD_IVRCAMPAIGN": "Dodaj Crnu Listu", + "ENABLED": "Omogućeno", + "READY": "Spreman", + "PAUSE": "Pauza", + "UNPAUSE": "Prekini Pauzu", + "DEFAULT_PAUSE": "Zadana Pauza", + "AGENTADD_QUEUE": "Dodaj Specijalistu u queue kampanju ", + "AGENTSADD_QUEUE": "Dodaj Specijalistu u queue kampanju ", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", + "ALL_LISTS": "Sve Liste", + "SELECTED_LISTS": "Odabrane Liste", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "WAITING_FOR_AGENT": "Čeka na Specijalistu", + "TOTAL_OFFERED": "Ukupno Ponuđeno", + "RUNNING": "Pokrenuto", + "TRUNK_IS_NOT_REACHABLE": "Trunk Nije Dostupan", + "AGENTS_NOT_LOGGED": "Specijalist nije prijavljen", + "NOT_ACTIVE": "Nije Aktivno", + "IS_DISACTIVED": "Deaktivirano", "BACKUPTRUNK": "Backup Trunk", - "GLOBALINTERVAL": "Global Interval", - "RESCHEDULED_CONTACTS": "Rescheduled contacts", - "INTERVAL_IS_OVERTIME": "Out of Interval", - "GLOBAL_INTERVAL_IS_OVERTIME": "Out of Interval (Global)", - "INTERVAL_IS_NULL": "Interval is Null", - "TIMEZONE_UNKNOW": "Timezone Unknow", - "INTERVAL_IS_EMPTY": "Interval is Empty", - "TOTAL_MANAGED": "Total Managed", - "OPEN": "Open", - "FRESH": "Fresh", - "CLOSED": "Closed", - "ALWAYS": "Always", - "NEVER": "Never", - "ONLY_IF_OPEN": "Only If Open", - "CHECKDUPLICATE": "Check Duplicate", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", + "GLOBALINTERVAL": "Globalni Interval", + "RESCHEDULED_CONTACTS": "Ponovo zakazati contakti", + "INTERVAL_IS_OVERTIME": "Van Intervala", + "GLOBAL_INTERVAL_IS_OVERTIME": "Van Intervala (Globalno)", + "INTERVAL_IS_NULL": "Interval je Nula", + "TIMEZONE_UNKNOW": "Vremenska Zona Nepoznata", + "INTERVAL_IS_EMPTY": "Interval je Prazan", + "TOTAL_MANAGED": "Ukupno Upravljano", + "OPEN": "Otvori", + "FRESH": "Svježe", + "CLOSED": "Zatvoreno", + "ALWAYS": "Uvijek", + "NEVER": "Nikada", + "ONLY_IF_OPEN": "Samo Ako Je Otvoreno", + "CHECKDUPLICATE": "Provjeri Duplikate", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", "CHAT": "Chat", - "MAIL": "Email", + "MAIL": "E-Mail", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", - "TEAMS_ASSOCIATION": "Teams Association", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Mandatory disposition pause status", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "PREVIEW_AUTO_RECALL_ME": "Automate Recall Me calls" + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Obavezna dispozicija status pauze", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje Ekrana u toku", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje Ekrana dostupno", + "PREVIEW_AUTO_RECALL_ME": "Automatizuj Recall Me pozive" } } diff --git a/public/app/main/apps/motiondialer/i18n/et.json b/public/app/main/apps/motiondialer/i18n/et.json index db6abd5..3b207cb 100644 --- a/public/app/main/apps/motiondialer/i18n/et.json +++ b/public/app/main/apps/motiondialer/i18n/et.json @@ -239,7 +239,9 @@ "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Väärtus peab olema väiksem või võrdne", "NOSUCHNUMBERMAXRETRY_REQUIRED": "Kohustuslik väli", "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Väärtus peab olema väiksem või võrdne", - "NOSUCHNUMBERRETRYTIME_REQUIRED": "Kohustuslik väli" + "NOSUCHNUMBERRETRYTIME_REQUIRED": "Kohustuslik väli", + "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Helista add.phone min. peaks olema suurem või võrdne", + "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Kohustuslik väli" }, "GENERAL": "Üldine", "AGENTTIMEOUT": "Agendi Aegumine", @@ -691,6 +693,8 @@ "SECOND_LEVEL_DISPOSITION": "Teise taseme kasutamine", "THIRD_LEVEL_DISPOSITION": "Kolmanda taseme kasutamine", "PREVIEW_AUTO_RECALL_ME": "Automatiseerige Call Me kõned", - "PREVIEW_RECALL_ME_REMINDER": "Tuleta mulle meelde" + "PREVIEW_RECALL_ME_REMINDER": "Tuleta mulle meelde", + "ADDITIONALPHONES": "Lisatelefonid", + "CALLADDITIONALPHONEAFTERMIN": "Helistage veel pärast [min]" } } diff --git a/public/app/main/apps/motiondialer/i18n/is.json b/public/app/main/apps/motiondialer/i18n/is.json new file mode 100644 index 0000000..6b63309 --- /dev/null +++ b/public/app/main/apps/motiondialer/i18n/is.json @@ -0,0 +1,701 @@ +{ + "MOTIONDIALER": { + "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", + "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", + "ONE_CALL_EVERY": "One call every", + "CURRENT_INTERVAL": "Current Interval", + "PREVIOUS_INTERVAL": "Previous Interval", + "PREDICTIVE_IS_RUNNING": "Predictive is running", + "PREDICTIVE_IS_NOT_RUNNING": "Predictive is not running", + "DATA_COLLECTION_IN_PROGRESSIVE": "Data collection in Progressive", + "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Show Predictive Info", + "AVG_TALK_TIME": "Avg Talk Time", + "ANSWERED_CALLS": "Answered Calls", + "TOTAL_CALLS": "Total Calls", + "THRESHOLDS": "Thresholds", + "PREDICTIVEMAXTHRESHOLD": "Predictive Max Threshold [%]", + "PREDICTIVEMINTHRESHOLD": "Predictive Min Threshold [%]", + "REFRESH_SCHEDULED_CALLS": "Refresh Scheduled Calls", + "RECALLINQUEUE": "Recall in queue", + "SELECT_DATE": "Select Date", + "SELECT_TYPE": "Select Type", + "SELECT_CAMPAIGN": "Select Campaign", + "SCHEDULED_CALLS": "Scheduled Calls", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "PREVIEW_RECALL_ME_REMINDER": "Recall Me Reminder", + "CUTDIGIT": "Cut Digits", + "RANDOMLASTDIGITCALLERIDNUMBER": "Random Outgoing CallerId Number", + "CLONE_IVRCAMPAIGN": "Clone Campaign", + "CLONE_QUEUECAMPAIGN": "Clone Queue Campaign", + "ABANDONEDCALLS": "Abandoned Queue Calls", + "HOPPERWIDGET": "Summary", + "RESETLIST_IVRCAMPAIGN": "Reset Lists", + "RESETLIST_QUEUECAMPAIGN": "Reset Lists", + "RESET": "Reset", + "RESETLIST": "Reset Lists", + "SELECTALL": "Select All", + "UNSELECTALL": "Un-Select All", + "NO_AVAILABLE_INFO": "No available info", + "TIMEOUT": "Timeout", + "CALLYSQUAREPROJECTPREVIEW": "Cally Square Project Preview", + "CALLYSQUAREPROJECTPREVIEW2": "Cally Square Project After Preview", + "RUNIFHANGUPAGENT": "Run Cally Square Project After even if the agent hangs up the call", + "CALLYSQUAREPROJECT2": "Cally Square Project After Queue", + "NO_AGENT_ONLINE": "No Agent Online", + "PARTIALPAUSE": "Parital Pause", + "ALL": "All", + "IDLE": "Idle", + "TIMER": "Timer", + "MOVE_HOPPERFINAL": "Restore contact", + "RESTORECONTACTS": "Restore Contacts", + "NO_SUCH_NUMBER": "No Such Number", + "ANSWERING_MACHINE": "Answering machine", + "DIALORDERBYSCHEDULEDAT": "Order By scheduledat", + "ASC": "ASC", + "DESC": "DESC", + "RECALLAGENT": "Recall Agent", + "DIALRECALLINQUEUE": "Recall In Queue", + "DIALRECALLMETIMEOUT": "Recall Me Timeout [min]", + "RECALLME": "Recall Me", + "RECALLFAILEDTIMEOUT": "Recall Failed", + "PREVIEW_CAMPAIGN": "Preview Campaigns", + "PREVIEW_CAMPAIGNS": "Preview Campaigns", + "AMD": "Asterisk Answering Machine Detection (AMD)", + "AMDTOTALANALYSISTIME": "Total Analysis Time", + "AMDACTIVE": "AMD", + "AMDINITIALSILENCE": "Initial Silence", + "AMDGREETING": "Greeting", + "AMDAFTERGREETINGSILENCE": "Silence after Greeting", + "AMDSILENCETHRESHOLD": "Silence Threshold", + "AMDMINWORDLENGTH": "Min Word Length", + "AMDBETWEENWORDSSILENCE": "Silence Between Words", + "AMDMAXIMUMWORDLENGTH": "Maximum Word Length", + "AMDMAXIMUMNUMBEROFWORDS": "Maximum Number Of Words", + "GOTO_QUEUECAMPAIGN": "Go To Realtime Queue Campaigns", + "GOTOREALTIME_QUEUECAMPAIGN": "Go To Realtime Queue Campaigns", + "GOTO_IVRCAMPAIGN": "Go To Realtime IVR Campaigns", + "GOTOREALTIME_IVRCAMPAIGN": "Go To Realtime IVR Campaigns", + "LOGOUT": "Logout", + "EDIT_CAMPAIGN": "Edit Campaign", + "LIMITED": "Limited", + "IVR_CAMPAIGNS": "IVR Campaigns", + "MOTIONDIALER": "Motion Bull", + "QUEUECAMPAIGNS": "Queue Campaigns", + "IVRCAMPAIGNS": "IVR Campaigns", + "MANAGED": "Managed", + "AVAILABLE_CONTACTS_FINISHED": "Available contacts finished", + "HISTORY": "History", + "SCHEDULEDAT": "Scheduled At", + "HOPPERBLACKS": "Hopper Blacklist", + "NO_HOPPERBLACK_AVAILABLE": "No items available", + "HOPPERFINALS": "Hopper Final", + "NO_HOPPERFINAL_AVAILABLE": "No items available", + "HOPPERHISTORIES": "Call history", + "NO_HOPPERHISTORY_AVAILABLE": "No items available", + "DELETE_HOPPERHISTORY": "Delete", + "DELETE_HOPPERFINAL": "Delete", + "CONTACTID": "Contact ID", + "STARTTIME": "Start Time", + "RESPONSETIME": "Response Time", + "ENDTIME": "End Time", + "STATUS": "Status", + "HOPPERS": "Hopper", + "NO_HOPPER_AVAILABLE": "No items available", + "EDIT_HOPPER": "Edit Hopper", + "DELETE_HOPPER": "Delete Hopper", + "FINAL": "Final", + "BLACKLIST": "Blacklist", + "NAME": "Name", + "VOICEQUEUES": "Voice Queues", + "SEARCH_FOR_ANYONE": "Search", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", + "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", + "EDIT_VOICEQUEUE": "Edit Voice Queue", + "DELETE_VOICEQUEUE": "Delete Voice Queue", + "MOHSOUNDS": "Moh Sounds", + "STRATEGY": "Strategy", + "DESCRIPTION": "Description", + "INTERVAL": "Time Interval", + "ADD_VOICEQUEUE": "Add Voice Queue", + "NEW_QUEUECAMPAIGN": "New Queue Campaign", + "ACTIVE": "Active", + "METHOD": "Method", + "POWERLEVEL": "Power Level", + "DROPRATE": "Drop Rate", + "AGENTBUSYFACTOR": "Agent Busy Factor", + "PREDICTIVEOPTIMIZATION": "Predictive Optimization", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Predictive Optimization Percentage", + "PREDICTIVEINTERVAL": "Predictive Interval", + "ADD_QUEUECAMPAIGN": "Add Queue Campaign", + "CAMPAIGN": "Campaign", + "MAXCONCURRENTCALLS": "Max Concurrent Calls", + "CONCURRENTCALLS": "Max Concurrent Calls", + "ORIGINATE": "Originate", + "ORIGINATECALLERIDNAME": "Caller ID Name", + "ORIGINATECALLERIDNUMBER": "Caller ID Number", + "ORIGINATETIMEOUT": "Originate Timeout", + "QUEUEOPTIONS": "Queue Options", + "QUEUETIMEOUT": "Queue Timeout", + "CALLYSQUAREPROJECT": "Cally Square Project", + "RETRYANDFREQUENCY": "Retry Settings", + "GLOBAL": "Global", + "GLOBALMAXRETRY": "Max Retries", + "CONGESTION": "Congestion", + "CONGESTIONMAXRETRY": "Max Retries", + "CONGESTIONRETRYTIME": "Retry Time [min]", + "BUSYMAXRETRY": "Max Retries", + "BUSYRETRYTIME": "Retry Time [min]", + "NOANSWER": "No Answer", + "NOANSWERMAXRETRY": "Max Retries", + "NOANSWERRETRYTIME": "Retry Time [min]", + "NOSUCHNUMBER": "No such number", + "NOSUCHNUMBERMAXRETRY": "Max Retries", + "NOSUCHNUMBERRETRYTIME": "Retry Time [min]", + "DROP": "Drop", + "DROPMAXRETRY": "Max Retries", + "DROPRETRYTIME": "Retry Time [min]", + "ABANDONEDMAXRETRY": "Max Retries", + "ABANDONEDRETRYTIME": "Retry Time [min]", + "MACHINE": "Machine", + "MACHINEMAXRETRY": "Max Retries", + "MACHINERETRYTIME": "Retry Time [min]", + "AGENTREJECT": "Agent Reject", + "AGENTREJECTMAXRETRY": "Max Retries", + "AGENTREJECTRETRYTIME": "Retry Time [min]", + "CALLADDITIONALPHONEAFTERMIN": "Call additional phone after [min]", + "ADDITIONALPHONES": "Additional phones", + "QUEUE_PARAMS": "Queue Parameters", + "ORIGINATED": "Originated", + "MESSAGE": "Message", + "DROPPED": "Dropped", + "CREATED_AT": "Created At", + "LEGEND": { + "CUSTOM_APPLICATION": "(*) - Custom application." + }, + "ERRORS": { + "AGENT_REQUIRED": "Mandatory field", + "CUTDIGIT_REQUIRED": "Mandatory field", + "CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED": "Mandatory field", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTIMEOUT_REQUIRED": "Mandatory field", + "INTERVAL_REQUIRED": "Mandatory field", + "EMAIL_REQUIRED": "Mandatory field", + "DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "DIALRECALLMETIMEOUT_REQUIRED": "Mandatory field", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "PREFIX_MUST_VALID_PATTERN": "Wrong format", + "NAME_REQUIRED": "Mandatory field", + "TIMEOUT_REQUIRED": "Mandatory field", + "PHONENUMBER_REQUIRED": "Mandatory field", + "CONTEXT_REQUIRED": "Mandatory field", + "DESTINATIONPATTERN_REQUIRED": "Mandatory field", + "FULLNAME_REQUIRED": "Mandatory field", + "EMAIL_REQUUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format", + "MAILBOX_REQUIRED": "Mandatory Field", + "PASSWORD_REQUIRED": "Mandatory field", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "TIMEZONE_REQUIRED": "Mandatory field", + "PREFIX_REQUIRED": "Mandatory field", + "OPTIONS_REQUIRED": "Mandatory field", + "AFTERCALLWORKDURATION_REQUIRED": "Mandatory field", + "TECHNOLOGY/RESOURCE_REQUIRED": "Mandatory field", + "PHONE_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "EXTENSION_REQUIRED": "Mandatory field", + "PRIORITY_REQUIRED": "Mandatory field", + "GLOBALMAXRETRY_REQUIRED": "Mandatory field", + "CONGESTIONMAXRETRY_REQUIRED": "Mandatory field", + "CONGESTIONRETRYTIME_REQUIRED": "Mandatory field", + "BUSYMAXRETRY_REQUIRED": "Mandatory field", + "BUSYRETRYTIME_REQUIRED": "Mandatory field", + "NOANSWERMAXRETRY_REQUIRED": "Mandatory field", + "NOANSWERRETRYTIME_REQUIRED": "Mandatory field", + "QUEUETIMEOUT_REQUIRED": "Mandatory field", + "ORIGINATETIMEOUT_REQUIRED": "Mandatory field", + "GLOBALINTERVAL_REQUIRED": "Mandatory field", + "MAXCONCURRENTCALLS_REQUIRED": "Mandatory field", + "CONCURRENTCALLS_REQUIRED": "Mandatory field", + "NOSUCHNUMBERMAXRETRY_REQUIRED": "Mandatory field", + "NOSUCHNUMBERRETRYTIME_REQUIRED": "Mandatory field", + "DROPMAXRETRY_REQUIRED": "Mandatory field", + "DROPRETRYTIME_REQUIRED": "Mandatory field", + "ABANDONEDMAXRETRY_REQUIRED": "Mandatory field", + "ABANDONEDRETRYTIME_REQUIRED": "Mandatory field", + "MACHINEMAXRETRY_REQUIRED": "Mandatory field", + "MACHINERETRYTIME_REQUIRED": "Mandatory field", + "AGENTREJECTMAXRETRY_REQUIRED": "Mandatory field", + "AGENTREJECTRETRYTIME_REQUIRED": "Mandatory field", + "POWERLEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PREDICTIVEINTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "POWERLEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "PREDICTIVEINTERVAL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", + "CALLYSQUAREPROJECT_REQUIRED": "Mandatory field", + "TRUNK_REQUIRED": "Mandatory field", + "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Mandatory field", + "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Call add.phone after min. should be greater than or equal to" + }, + "GENERAL": "General", + "AGENTTIMEOUT": "Agent Timeout", + "MAXLENGTH": "Maximum Length", + "RETRY": "Retry", + "WRAPUPTIME": "Wrapup Time", + "WEIGHT": "Weight", + "JOINWHENEMPTY": "Join when empty", + "LEAVEWHENEMPTY": "Leave when empty", + "HELP": { + "PREDICTIVEMAXTHRESHOLD": "If the percentage of agents available in the time window, compared to the agents available at the time of prediction, exceeds the configured maximum limit, the predictive recalculates the prediction. ", + "PREDICTIVEMINTHRESHOLD": "If the percentage of agents available in the time window, compared to the agents available at the time of prediction, exceeds the configured minimum limit, the predictive recalculates the prediction.", + "RANDOMLASTDIGITCALLERIDNUMBER": "If greater than 0, it generates randomly the corresponding last digits of the Outgoing Caller Id Number", + "TIMEOUT": "Number of seconds to ring agent in queue", + "CALLYSQUAREPROJECTPREVIEW": "Selecting an IVR project, the dialer will forward the call to the IVR when an agent answers (the IVR will be directed to the agent)", + "CALLYSQUAREPROJECTPREVIEW2": "Selecting an IVR project, the dialer will forward the call to the IVR when an client hangup or unreachable (the IVR will be directed to the agent)", + "RUNIFHANGUPAGENT": "Run Cally Square Project After even if the agent hangs up the call", + "CALLYSQUAREPROJECT2": "Selecting an IVR project, the dialer will forward the call to the IVR after the queue (if the queue ends by timeout)", + "DIALORDERBYSCHEDULEDAT": "Get contacts from hopper (descending or ascending).", + "DIALRECALLINQUEUE": "Reschedule call for agents in the Queue", + "DIALRECALLMETIMEOUT": "Time interval (in minutes) for Recall Me period of validity", + "PRIORITY": "Priority in the list", + "TIMEZONE": "Specify timezone", + "PREVIEW_RECALL_ME_REMINDER": "If enabled, the system will send a notification to the agent n minutes (according to time interval set in general settings) before generating the recall me", + "AMDMAXIMUMWORDLENGTH": "Maximum duration allowed of a single Voice utterance", + "AMDMINWORDLENGTH": "Minimum duration of a Voice to be considered a word", + "AMDSILENCETHRESHOLD": "If the average level of noise in a sample does not reach this value, from a scale of 0 to 32767, then we will consider it as silence", + "AMDTOTALANALYSISTIME": "Maximum time allowed for the algorithm to decide on whether the audio represents a HUMAN or a MACHINE", + "AMDAFTERGREETINGSILENCE": "Silence after detecting a greeting. If exceeded, then the result is detection as a HUMAN", + "AMDGREETING": "Maximum length of a greeting. If exceeded, then the result is detection as a MACHINE", + "AMDINITIALSILENCE": "Maximum silence duration before the greeting. If exceeded, then the result is detection as a MACHINE", + "AMDACTIVE": "Activate or disactivate answering machines detection attempts", + "AMDBETWEENWORDSSILENCE": "Minimum duration of silence after a word to consider the audio that follows as a new word", + "AMDMAXIMUMNUMBEROFWORDS": "Maximum number of words in the greeting. If REACHED, then the result is detection as a MACHINE", + "CALLYSQUAREPROJECT": "Selecting an IVR project, the dialer will forward the call to the IVR before the queue", + "PREFIX": "Telephone prefix", + "ACTIVE": "Active", + "AGENTTIMEOUT": "How long (in seconds) to ring an agent’s device", + "MAXLENGTH": "Maximum number of callers allowed to be waiting in a queue (0=unlimited)", + "RETRY": "How long (in seconds) to wait before calling the next agent in the queue when the agent timeout is expired", + "WRAPUPTIME": "How long (in seconds) to keep an agent unavailable in a queue after completing a call", + "WEIGHT": "Used to determine priority if the agents are associated with more than one queue", + "JOINWHENEMPTY": "If a caller is added to the queue, when no agents are available", + "LEAVEWHENEMPTY": "If a caller is expelled from the queue when no agents are available", + "ANNOUNCEFREQUENCY": "How often to announce the caller’s position and/or estimated hold time in the queue (0=disable)", + "MINANNOUNCEFREQUENCY": "Minimum announcement frequency (useful when the caller’s position changes frequently)", + "PERIODICANNOUNCEFREQUENCY": "Frequency of periodic announcements to the caller", + "ANNOUNCEPOSITIONLIMIT": "Used if you’ve defined announce-position as either 'limit' or 'more'", + "AFTERCALLWORKDURATION": "Pause length triggered by the After Call Work option", + "MEMBERDELAY": "Inserts a delay prior to the caller and agent in queue get connected", + "MUSICONHOLD": "Sets the music class to use for a particular queue", + "ANNOUNCETOAGENT": "Plays an announcement to the agent answering the call (e.g. to let him know which queue the caller is coming from)", + "RANDOMPERIODICANNOUNCE": "If yes, it plays the periodic announcements in random order", + "ANNOUNCEHOLDTIME": "Plays the estimated hold time along with the periodic announcements (Yes/No/Once)", + "ANNOUNCECALLERPOSITION": "Used to define if the caller’s position in the queue should be announced: No=never; Yes=always; Limit=only if it is within the limit defined by announce-position-limit; More= only if it is beyond the value defined by announce-position-limit", + "REPORTHOLDTIMEAGENT": "Enables reporting caller’s hold time to the agent in queue prior to connection", + "PERIODICANNOUNCE": "Set of periodic announcements to be played (in the order)", + "HOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“Hold time”. Undefined=no announcement", + "YOUARENEXTANNOUNCE": "Choose a Sound defined in Tools. Default=“You are now first in line”. Undefined=no announcement", + "THEREAREANNOUNCE": "Choose a Sound defined in Tools. Default=“There are”. Undefined=no announcement", + "WAITINGCALLSANNOUNCE": "Choose a Sound defined in Tools. Default=“calls waiting”. Undefined=no announcement", + "ESTIMATEDHOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“The current estimated hold time is”. Undefined=no announcement", + "MINUTESANNOUNCE": "Choose a Sound defined in Tools. Default=“minutes”. Undefined=no announcement", + "MINUTEANNOUNCE": "Choose a Sound defined in Tools. Default=“minute”. Undefined=no announcement", + "SECONDSANNOUNCE": "Choose a Sound defined in Tools. Default=“seconds”. Undefined=no announcement", + "THANKYOUANNOUNCE": "Choose a Sound defined in Tools. Default=“Thank you for your patience”. Undefined=no announcement", + "AFTERCALLWORK": "If enabled, the agent will be set on Pause after completing a call", + "AUTOPAUSE": "Enables/disables the automatic pause of agents who fail to answer a call. If enabled, it causes the agent to be paused in all queues he belongs to", + "RINGINUSE": "To avoid/allow sending calls to members whose status is In Use", + "TIMEOUTRESTART": "If yes, this resets the timeout for an agent to answer when either a BUSY or CONGESTION status is received from the channel", + "MONITORFORMAT": "Specifies the file format to use when recording. If monitor-format is inactive, calls will not be recorded", + "CONTEXT": "Allows a caller to exit the queue by pressing a single DTMF digit. If a context is specified and the caller enters a number, that digit will attempt to be matched in the context specified, and dialplan execution will continue there", + "SETINTERFACEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information see wiki docs:click here)", + "SETQUEUEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent and leaving the queue, some variables will be set (for more information, see wiki docs:click here)", + "SETQUEUEENTRYVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information, see wiki docs:click here)", + "RECORDING": "Enable call recording", + "VOICEMAIL_CONTEXT": "The context of the relative extension", + "METHOD": "Outbound dialer method", + "POWERLEVEL": "Number of contacts to call for any available agent", + "PREDICTIVEOPTIMIZATION": "A factor to optimize in the predictive algorithm", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Percentage based on the selected predictive optimization factor", + "PREDICTIVEINTERVAL": "Time interval (in minutes) considered by the predictive algorithm to calculate the amount of calls to generate to optimize the result", + "MAXCONCURRENTCALLS": "Maximum number of concurrent calls that will be originated by the outbound dialer for this campaign (0=unlimited)", + "CONCURRENTCALLS": "Maximum number of concurrent calls that will be originated by the outbound dialer for this campaign", + "ORIGINATECALLERIDNAME": "Outgoing Caller Id Name", + "ORIGINATECALLERIDNUMBER": "Outgoing Caller Id Number", + "ORIGINATETIMEOUT": "Time (in seconds) for the outbound call to establish a connection, otherwise the status is set to No Answer ", + "QUEUETIMEOUT": "Time (in seconds) a call will wait in the queue before it is dropped (Min 1 and Max 999)", + "GLOBALMAXRETRY": "Maximum number of times a contact is called before considering it closed", + "CONGESTIONMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for congestion", + "CONGESTIONRETRYTIME": "Time in minutes before trying to call again a failed contact due to congestion", + "BUSYMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for busy", + "BUSYRETRYTIME": "Time in minutes before trying to call again a failed contact due to busy", + "NOANSWERMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for no answer", + "NOANSWERRETRYTIME": "Time in minutes before trying to call again a failed contact due to no answer", + "NOSUCHNUMBERMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for no such number", + "NOSUCHNUMBERRETRYTIME": "Time in minutes before trying to call again a failed contact due to no such number", + "DROPMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for drop", + "DROPRETRYTIME": "Time in minutes before trying to call again a failed contact due to drop", + "ABANDONEDMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for abandon", + "ABANDONEDRETRYTIME": "Time in minutes before trying to call again a failed contact due to abandon", + "MACHINEMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for machine", + "MACHINERETRYTIME": "Time in minutes before trying to call again a failed contact due to machine", + "AGENTREJECTMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for agent reject", + "AGENTREJECTRETRYTIME": "Time in minutes before trying to call again a failed contact due to agent reject", + "CALLADDITIONALPHONEAFTERMIN": "", + "GLOBALINTERVAL": "Global time interval during which the dialer is allowed to call contacts. We decline responsibility: pay attention when you modify this field, because you may fail to comply with the national Autodialer Laws and Regulations", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "MANDATORYDISPOSITIONPAUSEID": "Pause status to set during mandatory disposition", + "PREVIEW_AUTO_RECALL_ME": "If enabled, the system will automatically generate the Recall Me calls; otherwise, the agent must do it manually" + }, + "MUSICONHOLD": "Music On Hold", + "ANNOUNCETOAGENT": "Announce To Agent", + "ANNOUNCEMENTS": "Announcements", + "ADVANCEDPREVIEW": "Advanced", + "ADVANCED": "Advanced", + "ADVANCE": "Advanced", + "ANNOUNCEFREQUENCY": "Announce Frequency", + "MINANNOUNCEFREQUENCY": "Minimum Announce Frequency", + "PERIODICANNOUNCEFREQUENCY": "Periodic Announce Frequency", + "RANDOMPERIODICANNOUNCE": "Random Periodic Announce", + "ANNOUNCEHOLDTIME": "Announce Hold Time", + "ANNOUNCECALLERPOSITION": "Announce Caller Position", + "ANNOUNCEPOSITIONLIMIT": "Announce Position Limit", + "REPORTHOLDTIMEAGENT": "Report Agent Hold Time", + "PERIODICANNOUNCE": "Periodic Announce", + "HOLDTIMEANNOUNCE": "Hold Time Announce", + "YOUARENEXTANNOUNCE": "'You are next' Announce", + "THEREAREANNOUNCE": "'There are' Announce", + "WAITINGCALLSANNOUNCE": "Waiting Calls Announce", + "ESTIMATEDHOLDTIMEANNOUNCE": "Estimated Hold Time Announce", + "MINUTESANNOUNCE": "Minutes Announce", + "MINUTEANNOUNCE": "Minute Announce", + "SECONDSANNOUNCE": "Seconds Announce", + "THANKYOUANNOUNCE": "'Thank You' Announce", + "AUTOPAUSE": "Auto Pause", + "AFTERCALLWORK": "After Call Work", + "AFTERCALLWORKDURATION": "After Call Work Duration", + "RINGINUSE": "Ring In Use", + "MEMBERDELAY": "Member Delay", + "TIMEOUTRESTART": "Timeout Restart", + "MONITORFORMAT": "Recording Format", + "SETINTERFACEVARIABLES": "Set Interface Variables", + "SETQUEUEVARIABLES": "Set Queue Variables", + "SETQUEUEENTRYVARIABLES": "Set Queue Entry Variables", + "CONTEXT": "Context", + "SAVE": "Save", + "SETTINGS": "Settings", + "INBOUNDROUTES": "Inbound Routes", + "PHONENUMBER": "Phone Number", + "ADD_INBOUNDROUTE": "Add Inbound Route", + "EDIT_INBOUNDROUTE": "Edit Inbound Route", + "DELETE_INBOUNDROUTE": "Delete Inbound Route", + "ACTIONS": "Actions", + "OUTBOUNDROUTES": "Outbound Routes", + "DESTINATIONPATTERN": "Destination Pattern", + "ADD_OUTBOUNDROUTE": "Add Outbound Route", + "EDIT_OUTBOUNDROUTE": "Edit Outbound Route", + "DELETE_OUTBOUNDROUTE": "Delete Outbound Route", + "CUTDIGITS": "Cut Digits", + "RECORDING": "Recording", + "RECORDINGFORMAT": "Recording format", + "INTERNALROUTES": "Internal Routes", + "ADD_INTERNALROUTE": "Add Internal Route", + "EDIT_INTERNALROUTE": "Edit Internal Route", + "DELETE_INTERNALROUTE": "Delete Internal Route", + "CONTEXTS": "Contexts", + "ADD_CONTEXT": "Add Context", + "EDIT_CONTEXT": "Edit Context", + "DELETE_CONTEXT": "Delete Context", + "VOICEMAILS": "Voicemails", + "ADD_VOICEMAIL": "Add Voicemail", + "EDIT_VOICEMAIL": "Edit Voicemail", + "DELETE_VOICEMAIL": "Delete Voicemail", + "FULLNAME": "Full Name", + "EMAIL": "Email", + "MAILBOX": "Mailbox", + "PASSWORD": "Password", + "CONFIRM_PASSWORD": "Confirm Password", + "TIMEZONE": "Timezone", + "ATTACH": "Attach", + "ENVELOPE": "Envelope", + "DELETE": "Delete", + "EMAILBODY": "Email Body", + "EMAILSUBJECT": "Email Subject", + "MAXSECONDS": "Max Seconds", + "MAXMESSAGES": "Max Messages", + "MESSAGES": "Messages", + "SORT": "Sort", + "ADD_MUSICONHOLD": "Add Music On Hold", + "MUSICONHOLDS": "Music On Hold", + "EDIT_MUSICONHOLD": "Edit Music On Hold", + "DELETE_MUSICONHOLD": "Delete Music On Hold", + "DIRECTORY": "Directory", + "AUDIOFILES": "Audio Files", + "RECORDINGS": "Recordings", + "CHANSPY": "ChanSpy", + "PREFIX": "Prefix", + "OPTIONS": "Options", + "AUTH": "Auth", + "ADD_CHANSPY": "Add ChanSpy", + "EDIT_CHANSPY": "Edit ChanSpy", + "DELETE_CHANSPY": "Delete ChanSpy", + "AGENTS": "Agents", + "TELEPHONES": "Telephones", + "QUEUES": "Queues", + "QUEUE_CALLS": "Queue Calls", + "QUEUE_PARAMETERS": "Queue Parameters", + "ABANDONED_CALLS": "Abandoned Calls", + "OUTBOUND_CALLS": "Outbound Calls", + "AGI": "AGI", + "DIAL": "Dial", + "INTERNALDIAL": "Internal Dial", + "EXTERNALDIAL": "External Dial", + "RINGGROUP": "Ring Group", + "PLAYBACK": "Playback", + "QUEUE": "Queue", + "SET": "Set", + "VOICEMAIL": "Voicemail", + "GOTO": "GoTo", + "HANGUP": "Hangup", + "CUSTOM": "Custom", + "PROJECT": "Cally-Square Project", + "TECHNOLOGY/RESOURCE": "Technology/Resource", + "URL": "URL", + "EDIT_APP": "Edit Application", + "EDIT_INTERVAL": "Edit Interval", + "DELETE_APP": "Delete Application", + "INTERVALS": "Intervals", + "USER": "User", + "TRUNK": "Trunk", + "PHONE": "Phone", + "AUDIO_FILES": "Audio Files", + "ANNOUNCE_OVERRIDES": "Announce Overrides", + "MACRO": "Macro", + "GOSUB": "GoSub", + "RULE": "Rule", + "POSITION": "Position", + "ANSWER": "Answer", + "VALUE": "Value", + "MAILBOX@CONTEXT": "Mailbox@Context", + "EXTENSION": "Extension", + "PRIORITY": "Priority", + "HANGUP_CAUSE": "Hangup Cause", + "OUTBOUNDDIAL": "Outbound Dial", + "CALLER_ID": "Caller ID", + "NO_MESSAGE_AVAILABLE": "No messages available", + "NO_SOUND_AVAILABLE": "No sounds available", + "VOICERECORDINGS": "Voice Recordings", + "CHANSPIES": "ChanSpy", + "VOICE": "Voice", + "REALTIME": "Realtime", + "ID": "Id", + "VOICEMAIL_CONTEXT": "Context", + "NO_MOHSOUND_AVAILABLE": "No Music On Hold available", + "FILE": "File", + "ADD_MOHSOUND": "Add Music On Hold sound", + "DOWNLOAD_MOHSOUND": "Download Music On Hold sound", + "DELETE_MOHSOUND": "Delete Music On Hold sound", + "UNIQUEID": "Unique ID", + "AGENT": "Agent", + "TYPE": "Type", + "RATING": "Rating", + "AUDIO": "Audio", + "DATE": "Date", + "NEW_VOICEQUEUE": "New Voice Queue", + "NEW_INBOUNDROUTE": "New Inbound Route", + "NEW_OUTBOUNDROUTE": "New Outbound Route", + "NEW_INTERNALROUTE": "New Internal Route", + "NEW_CONTEXT": "New Context", + "NEW_VOICEMAIL": "New Voicemail", + "NEW_MUSICONHOLD": "New Music On Hold", + "NEW_CHANSPY": "New ChanSpy", + "PENALTY": "Penalty", + "ADD_TEAM_TO_VOICEQUEUE": "Add Team to Voice Queue", + "ADD_AGENT_TO_VOICEQUEUE": "Add Agent to Voice Queue", + "EDIT_DIAL": "Edit Dial", + "EDIT_AGI": "Edit AGI", + "EDIT_INTERNALDIAL": "Edit Internal Dial", + "EDIT_EXTERNALDIAL": "Edit External Dial", + "EDIT_RINGGROUP": "Edit Ring Group", + "EDIT_PLAYBACK": "Edit Playback", + "EDIT_QUEUE": "Edit Queue", + "EDIT_SET": "Edit Set", + "EDIT_GOTO": "Edit GoTo", + "EDIT_HANGUP": "Edit Hangup", + "EDIT_CUSTOM": "Edit Custom", + "DURATION": "Duration", + "RECEIVED_AT": "Received At", + "YES": "Yes", + "NO": "No", + "HANGUPCAUSE_1": "1 = Unallocated number", + "HANGUPCAUSE_16": "16 = Normal call clearing", + "HANGUPCAUSE_17": "17 = User busy", + "HANGUPCAUSE_18": "18 = No user responding (telehone device not connected)", + "HANGUPCAUSE_21": "21 = Call rejected", + "HANGUPCAUSE_22": "22 = Number changed", + "HANGUPCAUSE_27": "27 = Destination out of order", + "HANGUPCAUSE_38": "38 = Network out of order", + "HANGUPCAUSE_41": "41 = Temporary failure", + "RANDOM": "Random", + "ALPHABETICAL": "Alphabetical", + "NO_APPS_AVAILABLE": "No applications available", + "DOWNLOAD_VOICERECORDING": "Download Voice Recording", + "DELETE_VOICERECORDING": "Delete Voice Recording", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "REGISTERED": "Registered", + "UNREGISTERED": "Unregistered", + "LAGGED": "Lagged", + "REACHABLE": "Reachable", + "UNREACHABLE": "Unreachable", + "UNKNOWN": "Unknown", + "NOT_INUSE": "Not in use", + "INUSE": "In Use", + "BUSY": "Busy", + "INVALID": "Invalid", + "UNAVAILABLE": "Unavailable", + "RINGING": "Ringing", + "ONHOLD": "On Hold", + "RING": "Ring", + "UP": "Up", + "INFO": "Info", + "TRUNKS": "Trunks", + "REGISTRY": "Registry", + "NO_REGISTRY": "No registry", + "LOGGED_IN": "Logged in (SIP connected)", + "PAUSED": "Paused", + "DISPOSITION": "Disposition", + "WAITING": "Waiting", + "TALKING": "Talking", + "DID": "DID", + "CALLER": "Caller", + "TOTAL": "Total", + "ANSWERED": "Answered", + "ABANDONED": "Abandoned", + "UNMANAGED": "Unmanaged", + "REDIRECT_TO_NUMBER": "Redirect to a number", + "REDIRECT_TO_AGENT": "Redirect to an agent", + "CLOSING": "Closing", + "AVG_HOLD_TIME": "Avg Hold Time", + "AVG_DURATION": "Avg Duration", + "AVG_BILLABLE": "Avg Billable", + "SOURCE": "Source", + "DESTINATION": "Destination", + "REJECTED": "Rejected", + "FAILED": "Failed", + "CALLED": "Called", + "CONNECTED": "Connected", + "NO_RATING": "No rating", + "EDIT_VOICERECORDING": "Edit Voice Recording", + "APPLICATION_NAME": "Application Name", + "ARGUMENTS": "Arguments", + "EDIT_QUEUECAMPAIGN": "Edit Campaign", + "LISTADD_QUEUECAMPAIGN": "Add List", + "BLACKLISTADD_QUEUECAMPAIGN": "Add Blacklist", + "TEAMADD_QUEUECAMPAIGN": "Add Team", + "AGENTADD_QUEUECAMPAIGN": "Add Agent", + "DELETE_QUEUECAMPAIGN": "Delete Campaign", + "DELETE_IVRCAMPAIGN": "Delete Campaign", + "EDIT_IVRCAMPAIGN": "Edit Campaign", + "NEW_IVRCAMPAIGN": "New IVR Campaign", + "ADD_IVRCAMPAIGN": "Add IVR Campaign", + "LISTADD_IVRCAMPAIGN": "Add List", + "BLACKLISTADD_IVRCAMPAIGN": "Add Blacklist", + "ENABLED": "Enabled", + "READY": "Ready", + "PAUSE": "Pause", + "UNPAUSE": "End Pause", + "DEFAULT_PAUSE": "Default Pause", + "AGENTADD_QUEUE": "Add Agent to queue campaign", + "AGENTSADD_QUEUE": "Add Agents to queue campaign", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "ALL_LISTS": "All Lists", + "SELECTED_LISTS": "Selected Lists", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "WAITING_FOR_AGENT": "Waiting for Agent", + "TOTAL_OFFERED": "Total Offered", + "RUNNING": "Running", + "TRUNK_IS_NOT_REACHABLE": "Trunk is Not Reachable", + "AGENTS_NOT_LOGGED": "Agent not logged", + "NOT_ACTIVE": "Not Active", + "IS_DISACTIVED": "Deactivated", + "BACKUPTRUNK": "Backup Trunk", + "GLOBALINTERVAL": "Global Interval", + "RESCHEDULED_CONTACTS": "Rescheduled contacts", + "INTERVAL_IS_OVERTIME": "Out of Interval", + "GLOBAL_INTERVAL_IS_OVERTIME": "Out of Interval (Global)", + "INTERVAL_IS_NULL": "Interval is Null", + "TIMEZONE_UNKNOW": "Timezone Unknow", + "INTERVAL_IS_EMPTY": "Interval is Empty", + "TOTAL_MANAGED": "Total Managed", + "OPEN": "Open", + "FRESH": "Fresh", + "CLOSED": "Closed", + "ALWAYS": "Always", + "NEVER": "Never", + "ONLY_IF_OPEN": "Only If Open", + "CHECKDUPLICATE": "Check Duplicate", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "SMS", + "OPENCHANNEL": "Open Channel", + "FAX": "Fax", + "TEAMS_ASSOCIATION": "Teams Association", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Mandatory disposition pause status", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "PREVIEW_AUTO_RECALL_ME": "Automate Recall Me calls" + } +} diff --git a/public/app/main/apps/openchannel/i18n/bs.json b/public/app/main/apps/openchannel/i18n/bs.json index 49fbeed..304b95b 100644 --- a/public/app/main/apps/openchannel/i18n/bs.json +++ b/public/app/main/apps/openchannel/i18n/bs.json @@ -1,271 +1,271 @@ { "OPENCHANNEL": { - "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "EDIT_DIALOGFLOWV2": "Uredi Dialogflow V2", "DIALOGFLOWV2": "Dialogflow V2", - "PRIVATEKEY": "Private Key", - "CLIENTEMAIL": "Client Email", - "PROJECTID": "Project ID", + "PRIVATEKEY": "Privatni Ključ", + "CLIENTEMAIL": "E-Mail Stranke", + "PROJECTID": "Projekat ID", "AMAZONLEX": "AmazonLex", - "EDIT_AMAZONLEX": "Edit Lex configuration", - "ACCESSKEYID": "Access key ID", - "SECRETACCESSKEY": "Access key secret", + "EDIT_AMAZONLEX": "Uredi Lex konfiguraciju", + "ACCESSKEYID": "Pristupni ključ ID", + "SECRETACCESSKEY": "Tajni Pristupni Ključ", "LEXREGION": "Region", - "BOTNAME": "Bot name", - "WELCOMEMESSAGE": "Welcome message", + "BOTNAME": "Bot naziv", + "WELCOMEMESSAGE": "Poruka dobrodošlice", "DIALOGFLOW": "Dialogflow", - "EDIT_DIALOGFLOW": "Edit Dialogflow configuration", - "LANGUAGE": "Language", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "EDIT_DIALOGFLOW": "Uredi Dialogflow konfiguraciju", + "LANGUAGE": "Jezik", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "DOWNLOAD_INTERACTION": "Skini", + "TRANSFER": "Prijenos", + "QUEUETRANSFER": "Queue Prijenos", + "QUEUETRANSFERTIMEOUT": "Timeout Queue Prijenosa", + "AGENTTRANSFER": "Prijenos Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Specijaliste", "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "ADVANCED": "Advanced", + "EDIT_TAG": "Uredi Tag", + "ADVANCED": "Napredno", "PROXY": "Proxy", "TOKEN": "Token", - "ADD_NOTE": "Add note", - "NOTE": "Note", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "INSERT_MESSAGE_HERE": "Insert your text message here", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "VARIABLE": "Variable", - "DELETE": "Delete", - "CANNEDANSWERS": "Canned Answers", - "OPENCHANNELCANNEDANSWERS": "Canned Answers", - "NO_OPENCHANNELCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_OPENCHANNELCANNEDANSWER": "New Canned Answer", - "ADD_OPENCHANNELCANNEDANSWER": "Add Canned Answer", - "EDIT_OPENCHANNELCANNEDANSWER": "Edit", - "DELETE_OPENCHANNELCANNEDANSWER": "Delete", - "DELIVERYREPORTURL": "Delivery Report URL", - "TAGS": "Tags", + "ADD_NOTE": "Dodaj bilješku", + "NOTE": "Bilješka", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog specijalistu", + "INSERT_MESSAGE_HERE": "Odje unesi svoju tekstualnu poruku", + "NOTIFICATION": "Obavijesti", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Protresi", + "NOTIFICATIONTEMPLATE": "Šablon", + "SYSTEM": "Sistem", + "EDIT_SYSTEM": "Uredi Sistem", + "COMMAND": "Komanda", + "VARIABLE": "Varijabla", + "DELETE": "Izbriši", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "OPENCHANNELCANNEDANSWERS": "Pripremljeni Odgovori", + "NO_OPENCHANNELCANNEDANSWER_AVAILABLE": "Nema dostupnih Pripremljenih Odgovora", + "NEW_OPENCHANNELCANNEDANSWER": "Novi Pripremljeni Odgovor", + "ADD_OPENCHANNELCANNEDANSWER": "Dodaj Pripremljeni Odgovor", + "EDIT_OPENCHANNELCANNEDANSWER": "Uredi", + "DELETE_OPENCHANNELCANNEDANSWER": "Izbriši", + "DELIVERYREPORTURL": "Izvještaj Isporuke URL", + "TAGS": "Tag-ovi", "SPYINTERACTION": "Spy", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_OPENCHANNELQUEUE": "Go To Realtime Open Channel Queue", - "PARTIALPAUSE": "Parital Pause", - "BUSY": "Busy", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "GOTOREALTIME_OPENCHANNELQUEUE": "Idi na Realtime Otvoreni Kanal Queue", + "PARTIALPAUSE": "Parcijalna Pauza", + "BUSY": "Zauzet", "TIMER": "Timer", "IDLE": "Idle", - "CAPACITY": "Capacity", + "CAPACITY": "Kapacitet", "REALTIME": "Realtime", - "TEXT": "Text", - "TIMES": "Number of times per interaction", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "AUTOREPLY": "Auto Reply", - "NAME": "Name", - "OPENCHANNELQUEUES": "Open Channel Queues", - "SEARCH_FOR_ANYONE": "Search", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "TEXT": "Tekst", + "TIMES": "Broj puta po interakciji", + "EDIT_AUTOREPLY": "Uredi Automatski Odgovor", + "AUTOREPLY": "Automatski Odgovor", + "NAME": "Naziv", + "OPENCHANNELQUEUES": "Otvoreni Kanal Queues", + "SEARCH_FOR_ANYONE": "Traži", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Zadana pauza kada je Obavezna dispozicija omogućena", "ERRORS": { - "PROJECTID_REQUIRED": "Mandatory Field", - "CLIENTEMAIL_REQUIRED": "Mandatory Field", - "PRIVATEKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Access key ID is required", - "SECRETACCESSKEY_REQUIRED": "Access key secret is required", - "BOTNAME_REQUIRED": "Bot name is required", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "KEY_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "COMMAND_REQUIRED": "Mandatory Field", - "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "VALUE_REQUIRED": "Mandatory Field", - "TEXT_REQUIRED": "The field text is required", - "NAME_REQUIRED": "Mandatory field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory field", - "MOTIONADDRESS_REQUIRED": "Mandatory field", - "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", - "ACCEPTURL_MUST_VALID_URL": "Wrong format", - "TIMEOUT_REQUIRED": "Mandatory field", - "REJECTURL_MUST_VALID_URL": "Wrong format", - "CLOSEURL_MUST_VALID_URL": "Wrong format", - "REPLYURI_REQUIRED": "Mandatory field", - "REPLYURI_MUST_VALID_URL": "Wrong format", - "PRIORITY_REQUIRED": "Mandatory field", - "CONDITION_REQUIRED": "Mandatory field", - "TRUEPRIORITY_REQUIRED": "Mandatory field", - "FALSEPRIORITY_REQUIRED": "Mandatory field", - "AGENT_REQUIRED": "Mandatory field", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "DISPOSITION_REQUIRED": "Mandatory field", - "QUEUE_REQUIRED": "Mandatory field", - "KEY_MAX_LENGTH": "Key must have a maximum length equal to {{max}}", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field" + "PROJECTID_REQUIRED": "Obavezno polje", + "CLIENTEMAIL_REQUIRED": "Obavezno polje", + "PRIVATEKEY_REQUIRED": "Obavezno polje", + "ACCESSKEYID_REQUIRED": "Pristupni ključ ID je potreban", + "SECRETACCESSKEY_REQUIRED": "Tajni pristupni ključ je potreban", + "BOTNAME_REQUIRED": "Bot naziv je potreban", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "TAG_REQUIRED": "Obavezno polje", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "KEY_REQUIRED": "Obavezno polje", + "LIST_REQUIRED": "Obavezno polje", + "COMMAND_REQUIRED": "Obavezno polje", + "TEXT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "VALUE_REQUIRED": "Obavezno polje", + "TEXT_REQUIRED": "Tekst polja je obavezan", + "NAME_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno polje", + "MOTIONADDRESS_REQUIRED": "Obavezno polje", + "MOTIONADDRESS_MUST_VALID_URL": "Pogrešan format", + "ACCEPTURL_MUST_VALID_URL": "Pogrešan format", + "TIMEOUT_REQUIRED": "Obavezno polje", + "REJECTURL_MUST_VALID_URL": "Pogrešan format", + "CLOSEURL_MUST_VALID_URL": "Pogrešan format", + "REPLYURI_REQUIRED": "Obavezno polje", + "REPLYURI_MUST_VALID_URL": "Pogrešan format", + "PRIORITY_REQUIRED": "Obavezno polje", + "CONDITION_REQUIRED": "Obavezno polje", + "TRUEPRIORITY_REQUIRED": "Obavezno polje", + "FALSEPRIORITY_REQUIRED": "Obavezno polje", + "AGENT_REQUIRED": "Obavezno polje", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "DISPOSITION_REQUIRED": "Obavezno polje", + "QUEUE_REQUIRED": "Obavezno polje", + "KEY_MAX_LENGTH": "Ključ mora imati maksimalnu dužinu {{max}}", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno polje" }, - "STRATEGY": "Strategy", - "AGENT": "Agent", + "STRATEGY": "Strategija", + "AGENT": "Specijalist", "GOTO": "Goto", "GOTOIF": "Gotoif", "NOOP": "Noop", "QUEUE": "Queue", - "EDIT_AGENT": "Edit Agent", - "EDIT_GOTO": "Edit Goto", - "EDIT_NOOP": "Edit Noop", - "EDIT_GOTOIF": "Edit Gotoif", - "EDIT_QUEUE": "Edit Queue", - "CONDITION": "Condition", - "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", - "VALUE": "Value", - "PRIORITY": "Priority", - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "ADD_OPENCHANNELQUEUE": "Add Open Channel Queue", - "EDIT_OPENCHANNELQUEUE": "Edit Open Channel Queue", - "DELETE_OPENCHANNELQUEUE": "Delete Open Channel Queue", - "PENALTY": "Penalty", - "TEAMADD_OPENCHANNELQUEUE": "Add Team To Open Channel Queue", - "AGENTADD_OPENCHANNELQUEUE": "Add Agent To Open Channel Queue", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "CREATED_AT": "Created At", - "SAVE": "Save", - "SETTINGS": "Settings", - "GENERAL": "General", - "OPENCHANNELACCOUNTS": "Open Channel Accounts", - "MOTIONADDRESS": "Motion Address", - "ADD_OPENCHANNELACCOUNT": "Add Open Channel Account", - "EDIT_OPENCHANNELACCOUNT": "Edit Open Channel Account", - "DELETE_OPENCHANNELACCOUNT": "Delete Open Channel Account", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_GOTO": "Uredi Goto", + "EDIT_NOOP": "Uredi Noop", + "EDIT_GOTOIF": "Uredi Gotoif", + "EDIT_QUEUE": "Uredi Queue", + "CONDITION": "Uslov", + "TRUEPRIORITY": "Pravi Prioritet", + "FALSEPRIORITY": "Pogrešan Prioritet", + "VALUE": "Vrijednost", + "PRIORITY": "Prioritet", + "AGENT_TIMEOUT": "Timeout Specijaliste", + "DESCRIPTION": "Opis", + "ADD_OPENCHANNELQUEUE": "Dodaj Otvoreni Kanal Queue", + "EDIT_OPENCHANNELQUEUE": "Uredi Otvoreni Kanal Queue", + "DELETE_OPENCHANNELQUEUE": "Izbriši Otvoreni Kanal Queue", + "PENALTY": "Kazna", + "TEAMADD_OPENCHANNELQUEUE": "Dodaj Tim u Otvoreni Kanal Queue", + "AGENTADD_OPENCHANNELQUEUE": "Dodaj Specijalistu na Otvoreni Kanal Queue", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "CREATED_AT": "Kreirano U", + "SAVE": "Sačuvaj", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "OPENCHANNELACCOUNTS": "Otvoreni Kanal Nalozi", + "MOTIONADDRESS": "Motion Adresa", + "ADD_OPENCHANNELACCOUNT": "Dodaj Otvoreni Kanal Nalog", + "EDIT_OPENCHANNELACCOUNT": "Uredi Otvoreni Kanal Nalog", + "DELETE_OPENCHANNELACCOUNT": "Izbriši Otvoreni Kanal Nalog", "API": "API", - "DISPOSITIONS": "Dispositions", + "DISPOSITIONS": "Dispozicije", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", - "LIST": "List", - "FIDELITY": "Fidelity", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", - "OPENCHANNEL": "Open Channel", - "ID": "Id", + "ACTIONS": "Radnje", + "LIST": "Lista", + "FIDELITY": "Vjernost", + "ACCEPT": "Prihvati", + "ACCEPTMETHOD": "Prihvati Metodu", + "ACCEPTURL": "Prihvati URL", + "REJECT": "Odbaci", + "REJECTMETHOD": "Metoda Odbacivanja", + "REJECTURL": "Odbaci URL", + "CLOSE": "Zatvori", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "BACK": "Nazad", + "OPENCHANNEL": "Otvoreni Kanal", + "ID": "ID", "TIMEOUT": "Timeout", - "OPENCHANNELDISPOSITIONS": "Open Channel Dispositions", - "NO_OPENCHANNELDISPOSITION_AVAILABLE": "No Open Channel Dispositions available", - "NEW_OPENCHANNELDISPOSITION": "New Open Channel Disposition", - "ADD_OPENCHANNELDISPOSITION": "Add Open Channel Disposition", - "EDIT_OPENCHANNELDISPOSITION": "Edit Open Channel Disposition", - "DELETE_OPENCHANNELDISPOSITION": "Delete Open Channel Disposition", - "NEW_OPENCHANNELQUEUE": "New Open channel Queue", - "NEW_OPENCHANNELACCOUNT": "New Open channel Account", - "NO_AVAILABLE_INFO": "No available info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "REPLYURI": "Reply URL", - "RECEIVEURI": "Receive URL", + "OPENCHANNELDISPOSITIONS": "Otvoreni Kanal Dispozicije", + "NO_OPENCHANNELDISPOSITION_AVAILABLE": "Nema dostupnih Otvoreni Kanal Dispozicija", + "NEW_OPENCHANNELDISPOSITION": "Nova Otvoreni Kanal Dispozicija", + "ADD_OPENCHANNELDISPOSITION": "Dodaj Otvoreni Kanal Dispoziciju", + "EDIT_OPENCHANNELDISPOSITION": "Uredi Otvoreni Kanal Dispoziciju", + "DELETE_OPENCHANNELDISPOSITION": "Izbriši Otvoreni Kanal Dispoziciju", + "NEW_OPENCHANNELQUEUE": "Novi Otvoreni Kanal Queue", + "NEW_OPENCHANNELACCOUNT": "Novi Otvoreni Kanal Nalog", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", + "REPLYURI": "Odgovori URL", + "RECEIVEURI": "Prihvati URL", "HELP": { - "WELCOMEMESSAGE": "This is the first response message sent to new interactions.", - "TOKEN": "Add this property as query string in your Web Service URL. For more details see the doc here", - "RECEIVEURI": "Auto-generated API string to be used in order to receive messages inside your open channel from the external application (using POST method). Click the clipboard button to copy it ", - "REPLYURI": "The URL the open channel will call when sending or replying to a message. For more details see the doc here", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "LIST": "Contact Manager List used to associate contacts", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled" + "WELCOMEMESSAGE": "Ovo je prva poruka odgovora poslana novim interakcijama.", + "TOKEN": "Dodajte ovo svojstvo kao query string u URL adresu vaše Web Usluge. Za više detalja pogledajte dokument ovdje", + "RECEIVEURI": "Automatski generisani API niz koji će se koristiti za primanje poruka unutar tvog otvorenog kanala iz vanjske aplikacije (koristeći POST metodu). Kliknite na dugme međuspremnika da ga kopiraš", + "REPLYURI": "URL koji će otvoreni kanal pozvati prilikom slanja ili odgovaranja na poruku. Za više detalja pogledajte dokument ovdje", + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)", + "LIST": "Kontakt Menadžer Lista koja se koristi za povezivanje kontakata", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Zadana pauza kada je Obavezna dispozicija omogućena" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "CONTACT": "Contact", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "CONTACT": "Kontakt", + "STARTEDAT": "Počelo U", + "LASTMESSAGE": "Posljednja poruka", "STATUS": "Status", - "CLOSED": "Closed", - "OPENED": "Open", - "OPEN": "Open", - "ACCOUNT": "Account", - "INTERACTION": "Interaction", - "INTERACTIONS": "Interactions", - "ALL": "All", - "SELECT_STATUS": "Select a status", + "CLOSED": "Zatvoreno", + "OPENED": "Otvori", + "OPEN": "Otvori", + "ACCOUNT": "Nalog", + "INTERACTION": "Interakcija", + "INTERACTIONS": "Interakcije", + "ALL": "Svi", + "SELECT_STATUS": "Odaberi Status", "FILTER": "Filter", - "FILTERS": "Filters", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", - "NOTES": "Notes", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "SELECT_ACCOUNT": "Select an account", + "FILTERS": "Filteri", + "CLOSEDAT": "Zatvoreno U", + "DISPOSITION": "Dispozicija", + "NOTES": "Bilješke", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "SELECT_ACCOUNT": "Odaberi Nalog", "GOTOP": "Gotop", - "EDIT_GOTOP": "Edit Gotop", - "EDIT_CLOSE": "Edit Close", + "EDIT_GOTOP": "Uredi Gotop", + "EDIT_CLOSE": "Uredi Zatvori", "INFO": "Info", - "KEY": "Key", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", - "AGENTS": "Agents", + "KEY": "Ključ", + "UNKNOWN": "Nepoznati", + "UNREGISTERED": "Neregistrovano", + "UNAVAILABLE": "Nedostupno", + "NOT_INUSE": "Nije u upotrebi", + "REACHABLE": "Dostupan", + "IN_USE": "U Upotrebi", + "AGENTS": "Specijalisti", "QUEUES": "Queues", - "FULLNAME": "Fullname", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "PAUSE": "Pause", - "LOGOUT": "Logout", - "AGENTADD_QUEUE": "Add agent to Open Channel queue", - "UNPAUSE": "End Pause", - "DEFAULT_PAUSE": "Default pause", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", + "FULLNAME": "Puno Ime", + "INTERNAL": "Interno", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", + "PAUSE": "Pauza", + "LOGOUT": "Odjava", + "AGENTADD_QUEUE": "Dodaj Specijalistu na Otvoreni Kanal Queue", + "UNPAUSE": "Prekini Pauzu", + "DEFAULT_PAUSE": "Zadana pauza", + "LOGGED_IN": "Prijavljen", + "PAUSED": "Pauzirano", + "READY": "Spreman", + "WAITING": "Čeka", "VOICE": "Voice", "CHAT": "Chat", - "MAIL": "Email", + "MAIL": "E-Mail", "SMS": "SMS", "FAX": "Fax", - "AGENTSADD_QUEUE": "Add agents to Open Channel queue", - "INTERACTIONS_OPENCHANNELACCOUNT": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_OPENCHANNELACCOUNT": "Add Agent to Openchannel Account", - "CANNED_ANSWER_SEARCH": "Enter a text to seach a Canned Answer", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answer were found", - "SEND": "Send", - "TO": "To", + "AGENTSADD_QUEUE": "Dodaj Specijaliste na Otvoreni Kanal Queue", + "INTERACTIONS_OPENCHANNELACCOUNT": "Idi na Interakcije", + "REFRESH_INTERACTIONS": "Osvježi Interakcije", + "DELETE_INTERACTION": "Izbriši Interakciju", + "AGENTADD_OPENCHANNELACCOUNT": "Dodaj Specijalistu na Otvoreni Kanal Nalog", + "CANNED_ANSWER_SEARCH": "Unesi tekst za pretraživanje Pripremljenih Odgovora", + "CANNED_ANSWER_NOT_FOUND": "Nije pronađen nijedan Pripremljeni Odgovor", + "SEND": "Pošalji", + "TO": "Za", "MAPKEY": "Map Key", - "TEAMS_ASSOCIATION": "Teams Association", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments" + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje ekrana je u toku", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje ekrana je dostupno", + "DOWNLOAD_WITH_ATTACHMENTS": "Skini sa prilozima", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Skini bez priloga" } } diff --git a/public/app/main/apps/openchannel/i18n/is.json b/public/app/main/apps/openchannel/i18n/is.json new file mode 100644 index 0000000..49fbeed --- /dev/null +++ b/public/app/main/apps/openchannel/i18n/is.json @@ -0,0 +1,271 @@ +{ + "OPENCHANNEL": { + "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "DIALOGFLOWV2": "Dialogflow V2", + "PRIVATEKEY": "Private Key", + "CLIENTEMAIL": "Client Email", + "PROJECTID": "Project ID", + "AMAZONLEX": "AmazonLex", + "EDIT_AMAZONLEX": "Edit Lex configuration", + "ACCESSKEYID": "Access key ID", + "SECRETACCESSKEY": "Access key secret", + "LEXREGION": "Region", + "BOTNAME": "Bot name", + "WELCOMEMESSAGE": "Welcome message", + "DIALOGFLOW": "Dialogflow", + "EDIT_DIALOGFLOW": "Edit Dialogflow configuration", + "LANGUAGE": "Language", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "DOWNLOAD_INTERACTION": "Download", + "TRANSFER": "Transfer", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "TAG": "Tag", + "EDIT_TAG": "Edit Tag", + "ADVANCED": "Advanced", + "PROXY": "Proxy", + "TOKEN": "Token", + "ADD_NOTE": "Add note", + "NOTE": "Note", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "INSERT_MESSAGE_HERE": "Insert your text message here", + "NOTIFICATION": "Notification", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONTEMPLATE": "Template", + "SYSTEM": "System", + "EDIT_SYSTEM": "Edit System", + "COMMAND": "Command", + "VARIABLE": "Variable", + "DELETE": "Delete", + "CANNEDANSWERS": "Canned Answers", + "OPENCHANNELCANNEDANSWERS": "Canned Answers", + "NO_OPENCHANNELCANNEDANSWER_AVAILABLE": "No Canned Answers Available", + "NEW_OPENCHANNELCANNEDANSWER": "New Canned Answer", + "ADD_OPENCHANNELCANNEDANSWER": "Add Canned Answer", + "EDIT_OPENCHANNELCANNEDANSWER": "Edit", + "DELETE_OPENCHANNELCANNEDANSWER": "Delete", + "DELIVERYREPORTURL": "Delivery Report URL", + "TAGS": "Tags", + "SPYINTERACTION": "Spy", + "NO_AGENT_ONLINE": "No Agent Online", + "GOTOREALTIME_OPENCHANNELQUEUE": "Go To Realtime Open Channel Queue", + "PARTIALPAUSE": "Parital Pause", + "BUSY": "Busy", + "TIMER": "Timer", + "IDLE": "Idle", + "CAPACITY": "Capacity", + "REALTIME": "Realtime", + "TEXT": "Text", + "TIMES": "Number of times per interaction", + "EDIT_AUTOREPLY": "Edit Auto Reply", + "AUTOREPLY": "Auto Reply", + "NAME": "Name", + "OPENCHANNELQUEUES": "Open Channel Queues", + "SEARCH_FOR_ANYONE": "Search", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "ERRORS": { + "PROJECTID_REQUIRED": "Mandatory Field", + "CLIENTEMAIL_REQUIRED": "Mandatory Field", + "PRIVATEKEY_REQUIRED": "Mandatory Field", + "ACCESSKEYID_REQUIRED": "Access key ID is required", + "SECRETACCESSKEY_REQUIRED": "Access key secret is required", + "BOTNAME_REQUIRED": "Bot name is required", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "KEY_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "COMMAND_REQUIRED": "Mandatory Field", + "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "VALUE_REQUIRED": "Mandatory Field", + "TEXT_REQUIRED": "The field text is required", + "NAME_REQUIRED": "Mandatory field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory field", + "MOTIONADDRESS_REQUIRED": "Mandatory field", + "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", + "ACCEPTURL_MUST_VALID_URL": "Wrong format", + "TIMEOUT_REQUIRED": "Mandatory field", + "REJECTURL_MUST_VALID_URL": "Wrong format", + "CLOSEURL_MUST_VALID_URL": "Wrong format", + "REPLYURI_REQUIRED": "Mandatory field", + "REPLYURI_MUST_VALID_URL": "Wrong format", + "PRIORITY_REQUIRED": "Mandatory field", + "CONDITION_REQUIRED": "Mandatory field", + "TRUEPRIORITY_REQUIRED": "Mandatory field", + "FALSEPRIORITY_REQUIRED": "Mandatory field", + "AGENT_REQUIRED": "Mandatory field", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "DISPOSITION_REQUIRED": "Mandatory field", + "QUEUE_REQUIRED": "Mandatory field", + "KEY_MAX_LENGTH": "Key must have a maximum length equal to {{max}}", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field" + }, + "STRATEGY": "Strategy", + "AGENT": "Agent", + "GOTO": "Goto", + "GOTOIF": "Gotoif", + "NOOP": "Noop", + "QUEUE": "Queue", + "EDIT_AGENT": "Edit Agent", + "EDIT_GOTO": "Edit Goto", + "EDIT_NOOP": "Edit Noop", + "EDIT_GOTOIF": "Edit Gotoif", + "EDIT_QUEUE": "Edit Queue", + "CONDITION": "Condition", + "TRUEPRIORITY": "True Priority", + "FALSEPRIORITY": "False Priority", + "VALUE": "Value", + "PRIORITY": "Priority", + "AGENT_TIMEOUT": "Agent Timeout", + "DESCRIPTION": "Description", + "ADD_OPENCHANNELQUEUE": "Add Open Channel Queue", + "EDIT_OPENCHANNELQUEUE": "Edit Open Channel Queue", + "DELETE_OPENCHANNELQUEUE": "Delete Open Channel Queue", + "PENALTY": "Penalty", + "TEAMADD_OPENCHANNELQUEUE": "Add Team To Open Channel Queue", + "AGENTADD_OPENCHANNELQUEUE": "Add Agent To Open Channel Queue", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "CREATED_AT": "Created At", + "SAVE": "Save", + "SETTINGS": "Settings", + "GENERAL": "General", + "OPENCHANNELACCOUNTS": "Open Channel Accounts", + "MOTIONADDRESS": "Motion Address", + "ADD_OPENCHANNELACCOUNT": "Add Open Channel Account", + "EDIT_OPENCHANNELACCOUNT": "Edit Open Channel Account", + "DELETE_OPENCHANNELACCOUNT": "Delete Open Channel Account", + "API": "API", + "DISPOSITIONS": "Dispositions", + "WEBHOOKS": "WebHooks", + "ACTIONS": "Actions", + "LIST": "List", + "FIDELITY": "Fidelity", + "ACCEPT": "Accept", + "ACCEPTMETHOD": "Accept Method", + "ACCEPTURL": "Accept URL", + "REJECT": "Reject", + "REJECTMETHOD": "Reject Method", + "REJECTURL": "Reject URL", + "CLOSE": "Close", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "BACK": "Back", + "OPENCHANNEL": "Open Channel", + "ID": "Id", + "TIMEOUT": "Timeout", + "OPENCHANNELDISPOSITIONS": "Open Channel Dispositions", + "NO_OPENCHANNELDISPOSITION_AVAILABLE": "No Open Channel Dispositions available", + "NEW_OPENCHANNELDISPOSITION": "New Open Channel Disposition", + "ADD_OPENCHANNELDISPOSITION": "Add Open Channel Disposition", + "EDIT_OPENCHANNELDISPOSITION": "Edit Open Channel Disposition", + "DELETE_OPENCHANNELDISPOSITION": "Delete Open Channel Disposition", + "NEW_OPENCHANNELQUEUE": "New Open channel Queue", + "NEW_OPENCHANNELACCOUNT": "New Open channel Account", + "NO_AVAILABLE_INFO": "No available info", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "REPLYURI": "Reply URL", + "RECEIVEURI": "Receive URL", + "HELP": { + "WELCOMEMESSAGE": "This is the first response message sent to new interactions.", + "TOKEN": "Add this property as query string in your Web Service URL. For more details see the doc here", + "RECEIVEURI": "Auto-generated API string to be used in order to receive messages inside your open channel from the external application (using POST method). Click the clipboard button to copy it ", + "REPLYURI": "The URL the open channel will call when sending or replying to a message. For more details see the doc here", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "LIST": "Contact Manager List used to associate contacts", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled" + }, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "CONTACT": "Contact", + "STARTEDAT": "Started At", + "LASTMESSAGE": "Last message", + "STATUS": "Status", + "CLOSED": "Closed", + "OPENED": "Open", + "OPEN": "Open", + "ACCOUNT": "Account", + "INTERACTION": "Interaction", + "INTERACTIONS": "Interactions", + "ALL": "All", + "SELECT_STATUS": "Select a status", + "FILTER": "Filter", + "FILTERS": "Filters", + "CLOSEDAT": "Closed At", + "DISPOSITION": "Disposition", + "NOTES": "Notes", + "NO_INTERACTION_AVAILABLE": "No interactions available", + "SELECT_ACCOUNT": "Select an account", + "GOTOP": "Gotop", + "EDIT_GOTOP": "Edit Gotop", + "EDIT_CLOSE": "Edit Close", + "INFO": "Info", + "KEY": "Key", + "UNKNOWN": "Unknown", + "UNREGISTERED": "Unregistered", + "UNAVAILABLE": "Unavailable", + "NOT_INUSE": "Not in use", + "REACHABLE": "Reachable", + "IN_USE": "In use", + "AGENTS": "Agents", + "QUEUES": "Queues", + "FULLNAME": "Fullname", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "PAUSE": "Pause", + "LOGOUT": "Logout", + "AGENTADD_QUEUE": "Add agent to Open Channel queue", + "UNPAUSE": "End Pause", + "DEFAULT_PAUSE": "Default pause", + "LOGGED_IN": "Logged in", + "PAUSED": "Paused", + "READY": "Ready", + "WAITING": "Waiting", + "VOICE": "Voice", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "SMS", + "FAX": "Fax", + "AGENTSADD_QUEUE": "Add agents to Open Channel queue", + "INTERACTIONS_OPENCHANNELACCOUNT": "Go to Interactions", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "DELETE_INTERACTION": "Delete Interaction", + "AGENTADD_OPENCHANNELACCOUNT": "Add Agent to Openchannel Account", + "CANNED_ANSWER_SEARCH": "Enter a text to seach a Canned Answer", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answer were found", + "SEND": "Send", + "TO": "To", + "MAPKEY": "Map Key", + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments" + } +} diff --git a/public/app/main/apps/plugins/i18n/is.json b/public/app/main/apps/plugins/i18n/is.json new file mode 100644 index 0000000..be8be0f --- /dev/null +++ b/public/app/main/apps/plugins/i18n/is.json @@ -0,0 +1,7 @@ +{ + "PLUGINS": { + "PLUGINS": "Plugins", + "ERRORS": {}, + "HELP": {} + } +} diff --git a/public/app/main/apps/settings/i18n/et.json b/public/app/main/apps/settings/i18n/et.json index 3fc4dff..b1f5844 100644 --- a/public/app/main/apps/settings/i18n/et.json +++ b/public/app/main/apps/settings/i18n/et.json @@ -158,7 +158,8 @@ "USERNAME_REQUIRED": "Kohustuslik väli", "FIELD_REQUIRED": "Kohustuslik väli", "PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED": "Kohustuslik väli", - "WRONG_FORMAT": "Vale formaat" + "WRONG_FORMAT": "Vale formaat", + "PREVIEW_RECALLME_REMINDER_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Väärtus peab olema suurem või võrdne sellega" }, "EDIT_NETWORK": "Redigeeri Võrku", "DELETE_NETWORK": "Kustuta Võrk", diff --git a/public/app/main/apps/settings/i18n/is.json b/public/app/main/apps/settings/i18n/is.json new file mode 100644 index 0000000..6a12726 --- /dev/null +++ b/public/app/main/apps/settings/i18n/is.json @@ -0,0 +1,309 @@ +{ + "SETTINGS": { + "RTLSUPPORT": "RTL Support", + "PREFERRED": "Preferred Logo", + "DEFAULT_PREFERRED": "Default Preferred Logo", + "FAVICON": "Favicon", + "DEFAULT_FAVICON": "Default Favicon", + "MOTIONBARREMEMBERME": "Remember Me", + "CHATTIMEOUT": "Chat closing interaction timeout", + "VIRTUAL": "Chat", + "VOICE": "Voice", + "SESSIONS": "Sessions", + "ADDONS": "Add-ons", + "REPORT": "Report", + "SPLIT": "Split report", + "SPLITSIZECSV": "Split report size [CSV records]", + "SPLITSIZEPDF": "Split report size [PDF records]", + "SPLITSIZEXLSX": "Split report size [XLSX records]", + "ENABLEEMAILPREVIEW": "Enable Email Preview", + "COPY_LICENSE": "Copy token to clipboard", + "DOWNLOAD_LICENSE_LOG_FILE": "Download license log file", + "LICENSE_LOG_FILE": "License log file", + "LICENSE_LOG_FILE_DOWNLOADED": "License log file downloaded!", + "CLIPBOARD": "Clipboard", + "COPIED_TO_CLIPBOARD": "Token copied to clipboard", + "JAWS": "Jaws", + "MOTIONBAR": "Motionbar", + "MOTIONBARAUTOUPDATER": "Auto Updater", + "MOTIONBARAUTOUPDATERURL": "Auto Updater URL", + "SMTP_SSL": "SMTP SSL", + "CALL_RECORDING_ENCRYPTION": "Voice Recording Encryption", + "TURNADDR": "TURN Address", + "TURN_USERNAME": "TURN Username", + "TURN_PASSWORD": "TURN Password", + "WEBRTC": "WebRTC", + "CALLYSQUARE": "Cally Square", + "PREVIEW_RECALLME_REMINDER_INTERVAL": "Preview Recallme Reminder Interval", + "ENABLED": "Enabled", + "DISABLED": "Disabled", + "UNLIMITED_CHANNELS": "Unlimited Channels", + "RELOAD": "Reload", + "VERIFY": "Verify", + "INTERFACE": "Interface", + "UPDATING": "Updating", + "REMOTE_VERSION": "Remote Version", + "NO_NEW_VERSION_AVAILABLE": "No new version available", + "TOP_N_PROCESSES": "Top {{value}} processes", + "SYSTEM": "System", + "FILE_SYSTEM": "File System", + "PROCESSES": "Processes", + "MOUNT_POINT": "Mount", + "AVG_LOAD": "AVG Load", + "TOTAL": "Total", + "USED": "Used", + "FREE": "Free", + "NAME": "Name", + "STATE": "State", + "CHAT": "Chat", + "MAIL": "Email", + "MESSAGING": "Sms", + "WHATSAPP": "WhatsApp Connector", + "FAX": "Fax", + "OPENCHANNEL": "Open Channel", + "AGENTS": "Agents", + "USERS": "Users", + "TELEPHONES": "Telephones", + "STAFF": "Staff", + "CHANNELS": "Channels", + "MODULES": "Modules", + "CM": "Contacts Manager", + "DIALER": "Dialer", + "JSCRIPTY": "Jscripty", + "CUSTOM": "Customization", + "VIDEO": "Video", + "SCREENRECORDING": "Screen Recording", + "UPDATE": "Update", + "OTHERS": "Others", + "SETTINGS": "Settings", + "GENERAL": "General", + "SMTP": "SMTP", + "NETWORKS": "Networks", + "UPDATES": "Updates", + "LICENSE": "License", + "ID": "Id", + "MIN_INTERNAL": "Min Internal", + "MIN_MAILBOX": "Min Mailbox", + "INSTALLED_AT": "Installed At", + "SEARCH_FOR_ANYONE": "Search", + "EDIT_GENERAL": "Edit General", + "SECURE_PASSWORD": "Secure Password", + "LOGO": "Logo", + "DEFAULT_LOGO": "Default Logo", + "DEFAULT_LOGIN_LOGO": "Default Login Logo", + "WHITELABEL": "White Label", + "DEFAULT_HEADER_WHITELABEL": "Default Header White Label", + "HEADER_WHITELABEL": "Header White Label", + "CREATED_AT": "Created At", + "SAVE": "Save", + "SMTP_SERVICE": "Service", + "SMTP_HOST": "Host", + "SMTP_USERNAME": "Username", + "DESCRIPTION": "Description", + "SMTP_PASSWORD": "Password", + "SMTP_PORT": "Port", + "SMTP_SECURE": "Secure", + "TYPE": "Type", + "ADDRESS": "Address", + "USERNAME": "Username", + "NEW_NETWORK": "New Network", + "ADD_NETWORK": "Add Network", + "IMAPGENERALSETTINGS": "IMAP", + "LOGINMAILFREQUENCY": "Login Mail Frequency (sec)", + "DEFAULTSCREENRECORDINGPATH": "Screen Recording path", + "APPZONE": "App Zone", + "EDIT_NETWORK": "Edit Network", + "DELETE_NETWORK": "Delete Network", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "EXPIRATION_DATE": "Expiration Date", + "REQUEST_LICENSE": "Request License", + "EMAIL": "Email", + "SEND": "Send", + "PLAN": "Plan", + "MONTH_TO_MONTH": "Month to month", + "MOTION_PROCESS_MANAGEMENT": "Motion Process Management", + "USEFUL_COMMANDS": "Useful Commands", + "COMMAND": "Command", + "PM2_LIST": "List all processes", + "PM2_START": "Start a process by id or name", + "PM2_STOP": "Stop a process by id or name or insert 'all' to stop all the active processes", + "PM2_RESTART": "Restart a process by id or name", + "PM2_LOGS": "Stream all processes log files, unless a specific process id or name is provided", + "PASSWORD": "Password", + "NO_AVAILABLE_INFO": "No available info", + "STUNADDR": "STUN Address", + "CHANGELOG": "Changelog", + "CURRENT_VERSION": "Current version", + "CUSTOMIZATIONS": "Customizations", + "LOCALNETADDRESS": "Localnet Address", + "NEW_VERSION": "New Version", + "TRIAL_VERSION": "Trial Version", + "TOKEN": "Token", + "NEW_TOKEN_DETECTED": "New Token Detected", + "EXPIRATION_GRAY_PERIOD": "Gray Period Expiration", + "NEW_TOKEN": "New Token", + "PRICES": "Prices", + "UPDATE_LICENSE": "Update License", + "LOGOLOGIN": "Login Logo", + "EXPIRATION_REASON": "Expiration Reason", + "GLOBAL": "Global", + "SMTP_AUTHENTICATION": "Authentication", + "LICENSE_REQUEST_SENT": "Thank you! The Licensing Team will check your account asap in order to approve your request: you will receive an email when the changes become effective. Please refer to license@xcally.com for further informations.", + "ACCOUNTNAME": "Account Name", + "EMAILADDRESS": "Email Address", + "EXPIRATION_REASON_MESSAGE_DISABLED": "Your license has been disabled.", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Your machine unique id has been updated due to a change to your system.", + "EXPIRATION_CHANGED_ADVISE": "Contact xCALLY Motion License Team sending both your old and your new uuid.", + "OLD_TOKEN": "Old Token", + "SEND_EMAIL_TO": "Send Email to", + "JIRA_ERROR_MESSAGE": "Error during license request. Please contact our license team at license@xcally.com with your request", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "PAGE_TITLE": "Page Title", + "DEFAULT_PAGE_TITLE": "Default Page Title", + "PERPETUAL": "Perpetual", + "SECURITY_SUITE": "Security Suite", + "ANNUALLY": "Annually", + "AGENTOMNIDESKTOPINTERFACE": "Agent Omni Desktop Interface", + "MESSAGESALIGNMENT": "Messages Alignment", + "ENTER_LICENSE": "Enter your license", + "UPDATE_LICENSE_MANUALLY": "Do you want to update your license manually?", + "SECURITY": "Security", + "ALLOWEDLOGINATTEMPTS": "Allowed login attempts before locking the user/agent", + "BLOCKDURATION": "Minutes to wait before automatic unlock", + "AI": "A.I. Tools", + "AITOOLS": "A.I. Tools", + "SERVICE": "Service", + "NEW_CLOUDPROVIDER": "New Account", + "ADD_CLOUDPROVIDER": "Add Account", + "DELETE": "Delete", + "SECRETACCESSKEY": "Secret Access Key", + "ACCESSKEY": "Access Key ID", + "EDIT_CLOUDPROVIDER": "Edit Account", + "DELETE_CLOUDPROVIDER": "Delete Account", + "LANGUAGE": "Language", + "BUCKET": "Bucket", + "TRANSCRIBE": "Transcribe", + "TRANSCRIBEREGION": "Transcribe Region", + "TRANSCRIBEACCOUNT": "Transcribe Account", + "SENTIMENTANALYSIS": "Sentiment Analysis", + "SENTIMENTREGION": "Sentiment Analysis Region", + "SENTIMENTACCOUNT": "Sentiment Analysis Account", + "SSO": "SSO", + "GOOGLE_SSO_ENABLED": "Google SSO Enabled", + "ENFORCE_PASSWORD_HISTORY": "Enforce Password History", + "PASSWORD_HISTORY_LIMIT": "Password History Limit", + "PRIVACY_POLICY_EMAIL": "Privacy Policy for Email Addresses", + "PRIVACY_POLICY_NAME": "Privacy Policy for Names", + "PRIVACY_POLICY_NUMBER": "Privacy Policy for Numbers", + "SEARCH_ON_ENTER_KEY": "Search on Enter key", + "CHAT_INTERACTIONS_RELOAD_TIMEOUT": "Chat interactions reload timeout", + "MAIL_INTERACTIONS_RELOAD_TIMEOUT": "Email interactions reload timeout", + "OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT": "Open Channel interactions reload timeout", + "SMS_INTERACTIONS_RELOAD_TIMEOUT": "SMS interactions reload timeout", + "WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT": "WhatsApp Connector interactions reload timeout", + "STOP_RECORDING_ON_VOICE_CALL_TRANSFER": "Stop recording on voice call transfer", + "DISABLED_COOKIE": "Cookies banner", + "AD_SSO_ENABLED": "Active Directory SSO Enabled", + "CLOUD_PROVIDERS": "Cloud Providers", + "APPLICATION_ID": "Application Id", + "TENANT_ID": "Tenant Id", + "CLIENT_SECRET": "Client Secret", + "NEW_CLIENT_SECRET": "New Client Secret", + "REDIRECT_URI": "Redirect URI", + "REMOTE_URI": "Remote URI", + "AUTHENTICATE": "Authenticate", + "AUTHENTICATE_TO_MICROSOFT_IDENTITY_PLATFORM": "Authenticate to Microsoft Identity Platform", + "MICROSOFT_AUTHENTICATION_SUCCESS": "Authentication to the Microsoft Identity Platform completed successfully", + "MICROSOFT_AUTHENTICATION_FAIL": "Something went wrong while authenticating to the Microsoft Identity Platform", + "UPDATE_CLIENT_SECRET": "Update Client Secret", + "HELP": { + "DEFAULTSCREENRECORDINGPATH": "Enter the path where to store screen recording files on the Agent computer (leave empty for default Video Folder path)", + "RTLSUPPORT": "Enables the RTL Support for Arabic, Persian and Hebrew languages", + "ADDRESS": "External (public) ip address", + "LOCALNETADDRESS": "Local ip address/subnet", + "SMTP_SECURE": "If true, the connection to the server will use TLS", + "SMTP_USERNAME": "Username used for authentication", + "SMTP_PASSWORD": "Password used for authentication", + "EMAILADDRESS": "The message origin Email address (from)", + "SECURITY_SUITE": "Enables the secure password format, the mandatory password reset after the first login and the password expiration after 90 days", + "MOTIONBARREMEMBERME": "Enable/Disable the Remember Me feature in Motion Phonebar", + "LOGINMAILFREQUENCY": "Please remember to restart the EMAIL service each time this parameter has been changed", + "USERNAME": "Username", + "PASSWORD": "Password", + "PREVIEW_RECALLME_REMINDER_INTERVAL": "Time interval in minutes before which notification will be sent to agent informing him about preview recall to be made", + "ENFORCE_PASSWORD_HISTORY": "Enables the validation against previously used passwords", + "PASSWORD_HISTORY_LIMIT": "Number of last used unique passwords to check", + "PRIVACY_POLICY": "Number of characters that will be replaced with an asterisk (*) (0 = all characters)", + "SEARCH_ON_ENTER_KEY": "Start searching only after the agent hits the Enter key", + "INTERACTIONS_RELOAD_TIMEOUT": "Time interval in seconds after which interactions are reloaded (0 = real-time update)", + "CLIENT_SECRET": "The secret will no longer be visible once the configuration is saved. Store it safely if you want to use it elsewhere.", + "LIMIT_TABS": "Maximum number of possible interaction tabs open" + }, + "ERRORS": { + "CHATTIMEOUT_REQUIRED": "Mandatory field", + "CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MOTIONBARAUTOUPDATERURL_MUST_VALID_URL": "Wrong format", + "MOTIONBARAUTOUPDATERURL_REQUIRED": "Mandatory field", + "ADDRESS_REQUIRED": "Mandatory field", + "MIN_INTERNAL_REQUIRED": "Mandatory field", + "MIN_MAILBOX_REQUIRED": "Mandatory field", + "NAME_REQUIRED": "Mandatory field", + "HEADER_WHITELABEL_REQUIRED": "Mandatory field", + "LOCALNETADDRESS_REQUIRED": "Mandatory field", + "LOCALNETADDRESS_MUST_VALID_PATTERN": "Wrong format", + "ADDRESS_MUST_VALID_PATTERN": "Wrong format", + "ACCOUNTNAME_REQUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format", + "SMTP_USERNAME_REQUIRED": "Mandatory field", + "PASSWORD_REQUIRED": "Mandatory field", + "SMTP_HOST_REQUIRED": "Mandatory field", + "SMTP_PORT_REQUIRED": "Mandatory field", + "PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED": "Mandatory field", + "MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MIN_MAILBOX_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PAGE_TITLE_REQUIRED": "Mandatory field", + "EMAIL_REQUIRED": "Mandatory field", + "PLAN_REQUIRED": "Mandatory field", + "LICENSE_REQUIRED": "Mandatory field", + "LOGINMAILFREQUENCY_REQUIRED": "Mandatory field", + "LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "ALLOWEDLOGINATTEMPTS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "BLOCKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "ALLOWEDLOGINATTEMPTS_REQUIRED": "Mandatory field", + "BLOCKDURATION_REQUIRED": "Mandatory field", + "SERVICE_REQUIRED": "Mandatory field", + "SECRETACCESSKEY_REQUIRED": "Mandatory field", + "ACCESSKEY_REQUIRED": "Mandatory field", + "LANGUAGE_REQUIRED": "Mandatory field", + "BUCKET_REQUIRED": "Mandatory field", + "TRANSCRIBEREGION_REQUIRED": "Mandatory field", + "TRANSCRIBEACCOUNT_REQUIRED": "Mandatory field", + "SENTIMENTREGION_REQUIRED": "Mandatory field", + "SENTIMENTACCOUNT_REQUIRED": "Mandatory field", + "USERNAME_REQUIRED": "Mandatory field", + "FIELD_REQUIRED": "Mandatory field", + "WRONG_FORMAT": "Wrong format", + "PREVIEW_RECALLME_REMINDER_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to" + }, + "NOTIFICATIONS": { + "MICROSOFT_AUTHENTICATION_SUCCESS": "Authentication to the Microsoft Identity Platform completed successfully", + "MICROSOFT_AUTHENTICATION_FAIL": "Something went wrong while authenticating to the Microsoft Identity Platform", + "CLOUD_PROVIDER_CREATED_SUCCESS_TITLE": "Cloud Provider successfully created", + "CLOUD_PROVIDER_SAVED_SUCCESS_TITLE": "Cloud Provider successfully saved", + "CLOUD_PROVIDER_DELETE_TITLE": "Are you sure want to delete the cloud provider?", + "CLOUD_PROVIDER_DELETE_MESSAGE": "{{ name }} will be deleted", + "CLOUD_PROVIDER_DELETED_SUCCESS_TITLE": "Cloud Provider successfully deleted", + "CLOUD_PROVIDERS_DELETE_TITLE": "Are you sure want to delete the selected cloud providers?", + "CLOUD_PROVIDERS_DELETE_MESSAGE": "{{ total }} cloud providers will be deleted", + "CLOUD_PROVIDERS_DELETED_SUCCESS_TITLE": "Cloud Providers successfully deleted", + "SMTP_SAVED_SUCCESS_TITLE": "SMTP configuration successfully saved", + "CLOUD_PROVIDER_SECRET_UPDATE_SUCCESS_TITLE": "Client Secret successfully updated" + }, + "LIMIT_TABS": "Limit of interaction tab" + } +} diff --git a/public/app/main/apps/sms/i18n/is.json b/public/app/main/apps/sms/i18n/is.json new file mode 100644 index 0000000..9f9a57b --- /dev/null +++ b/public/app/main/apps/sms/i18n/is.json @@ -0,0 +1,297 @@ +{ + "SMS": { + "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "DIALOGFLOWV2": "Dialogflow V2", + "PRIVATEKEY": "Private Key", + "CLIENTEMAIL": "Client Email", + "PROJECTID": "Project ID", + "AMAZONLEX": "AmazonLex", + "EDIT_AMAZONLEX": "Edit Lex configuration", + "ACCESSKEYID": "Access key ID", + "SECRETACCESSKEY": "Access key secret", + "LEXREGION": "Region", + "BOTNAME": "Bot name", + "WELCOMEMESSAGE": "Welcome message", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "DOWNLOAD_INTERACTION": "Download", + "TRANSFER": "Transfer", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "TAG": "Tag", + "EDIT_TAG": "Edit Tag", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "NOTIFICATION": "Notification", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONTEMPLATE": "Template", + "SYSTEM": "System", + "EDIT_SYSTEM": "Edit System", + "COMMAND": "Command", + "VARIABLE": "Variable", + "AUTHID": "Auth ID", + "NO_SMSDISPOSITIONS_AVAILABLE": "No Sms Disposition Available", + "CANNEDANSWERS": "Canned Answers", + "SMSCANNEDANSWERS": "Canned Answers", + "NO_SMSCANNEDANSWER_AVAILABLE": "No Canned Answers Available", + "NEW_SMSCANNEDANSWER": "New Canned Answer", + "ADD_SMSCANNEDANSWER": "Add Canned Answer", + "EDIT_SMSCANNEDANSWER": "Edit", + "DELETE_SMSCANNEDANSWER": "Delete", + "DELIVERYREPORTURL": "Delivery Report URL", + "DELETE": "Delete", + "SENDERSTRING": "Sender String", + "DELIVERYREPORT": "Delivery Report", + "METHOD": "Method", + "ADD_NOTE": "Add note", + "NOTE": "Note", + "SPYINTERACTION": "Spy", + "AUTOREPLY": "Auto Reply", + "EDIT_AUTOREPLY": "Edit Auto Reply", + "TIMES": "Number of times per interaction", + "TEXT": "Text", + "INSERT_MESSAGE_HERE": "Insert your text message here", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", + "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", + "SEND": "Send", + "TO": "To", + "MESSAGE": "Message", + "TAGS": "Tags", + "NO_AGENT_ONLINE": "No Agent Online", + "GOTOREALTIME_SMSQUEUE": "Go To Realtime Sms Queue", + "PARTIALPAUSE": "Parital Pause", + "BUSY": "Busy", + "TIMER": "Timer", + "IDLE": "Idle", + "CAPACITY": "Capacity", + "PROXY": "Proxy", + "ADVANCED": "Advanced", + "MOTIONPROXY": "Proxy Or Motion Domain", + "REALTIME": "Realtime", + "KEY": "Key", + "NAME": "Name", + "SMSQUEUES": "SMS Queues", + "SEARCH_FOR_ANYONE": "Search", + "STRATEGY": "Strategy", + "BASEURL": "Base URL", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", + "ERRORS": { + "PROJECTID_REQUIRED": "Mandatory Field", + "CLIENTEMAIL_REQUIRED": "Mandatory Field", + "PRIVATEKEY_REQUIRED": "Mandatory Field", + "ACCESSKEYID_REQUIRED": "Access key ID is required", + "SECRETACCESSKEY_REQUIRED": "Access key secret is required", + "BOTNAME_REQUIRED": "Bot name is required", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "COMMAND_REQUIRED": "Mandatory Field", + "AUTHID_REQUIRED": "Mandatory Field", + "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "TEXT_REQUIRED": "Mandatory Field", + "VALUE_REQUIRED": "Mandatory Field", + "SENDERSTRING_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "SENDERSTRING_MUST_VALID_PATTERN": "Wrong format", + "METHOD_REQUIRED": "Mandatory Field", + "MOTIONPROXY_REQUIRED": "Mandatory Field", + "MOTIONPROXY_MUST_VALID_URL": "Wrong format", + "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "KEY_REQUIRED": "Mandatory Field", + "NAME_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", + "PHONE_REQUIRED": "Mandatory Field", + "SID_REQUIRED": "Mandatory Field", + "TOKEN_REQUIRED": "Mandatory Field", + "USERNAME_REQUIRED": "Mandatory Field", + "PASSWORD_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", + "ACCEPTURL_MUST_VALID_URL": "Wrong format", + "TIMEOUT_REQUIRED": "Mandatory Field", + "REJECTURL_MUST_VALID_URL": "Wrong format", + "CLOSEURL_MUST_VALID_URL": "Wrong format", + "TYPE_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "PRIORITY_REQUIRED": "Mandatory Field", + "CONDITION_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_REQUIRED": "Mandatory Field", + "FALSEPRIORITY_REQUIRED": "Mandatory Field", + "AGENT_REQUIRED": "Mandatory Field", + "QUEUE_REQUIRED": "Mandatory Field", + "DISPOSITION_REQUIRED": "Mandatory Field", + "ACCOUNTSID_REQUIRED": "Mandatory Field", + "AUTHTOKEN_REQUIRED": "Mandatory Field", + "BASEURL_REQUIRED": "Mandatory Field", + "APIKEY_REQUIRED": "Mandatory Field", + "APPLICATIONID_REQUIRED": "Mandatory Field", + "ACCOUNTID_REQUIRED": "Mandatory Field", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field" + }, + "AGENT_TIMEOUT": "Agent Timeout", + "DESCRIPTION": "Description", + "ADD_SMSQUEUE": "Add SMS Queue", + "EDIT_SMSQUEUE": "Edit SMS Queue", + "DELETE_SMSQUEUE": "Delete SMS Queue", + "SETTINGS": "Settings", + "GENERAL": "General", + "CREATED_AT": "Created At", + "SAVE": "Save", + "SMSACCOUNTS": "SMS Accounts", + "TYPE": "Type", + "PHONE": "Phone", + "SID": "SID", + "TOKEN": "Token", + "SMSTYPE": "SMS Type", + "USERNAME": "Username", + "PASSWORD": "Password", + "MOTIONADDRESS": "Motion Address", + "ADD_SMSACCOUNT": "Add SMS Account", + "EDIT_SMSACCOUNT": "Edit SMS Account", + "DELETE_SMSACCOUNT": "Delete SMS Account", + "LIST": "List", + "FIDELITY": "Fidelity", + "API": "API", + "DISPOSITIONS": "Dispositions", + "WEBHOOKS": "WebHooks", + "ACTIONS": "Actions", + "ACCEPT": "Accept", + "ACCEPTMETHOD": "Accept Method", + "ACCEPTURL": "Accept URL", + "REJECT": "Reject", + "REJECTMETHOD": "Reject Method", + "REJECTURL": "Reject URL", + "CLOSE": "Close", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "BACK": "Back", + "SMS": "SMS", + "ID": "Id", + "APIKEY": "ApiKey", + "APPLICATIONID": "Application ID", + "ACCOUNTID": "Account ID", + "CONFIRM_PASSWORD": "Confirm Password", + "SMSDISPOSITIONS": "SMS Dispositions", + "NO_SMSDISPOSITION_AVAILABLE": "No SMS Dispositions available", + "NEW_SMSDISPOSITION": "New SMS Disposition", + "ADD_SMSDISPOSITION": "Add SMS Disposition", + "EDIT_SMSDISPOSITION": "Edit SMS Disposition", + "DELETE_SMSDISPOSITION": "Delete SMS Disposition", + "NEW_SMSQUEUE": "New SMS Queue", + "NEW_SMSACCOUNT": "New SMS Account", + "NO_AVAILABLE_INFO": "No available info", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "DIALOGFLOW": "DialogFlow", + "EDIT_DIALOGFLOW": "Edit DialogFlow configuration", + "LANGUAGE": "Language", + "HELP": { + "WELCOMEMESSAGE": "This is the first response message sent to new interactions", + "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "LIST": "Contact Manager list used to associate contacts", + "RECEIVEURL": "This is the auto-generated API string you need to use to receive the messages inside your account from your SMS provider (POST method must be used): click the clipboard button to copy it", + "DELIVERYREPORTURL": "This is the auto-generated API string you need to use to receive the delivery report of sent messages from your SMS provider (POST method must be used): click the clipboard button to copy it", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled" + }, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "TEAMADD_SMSQUEUE": "Add Team To SMS Queue", + "AGENTADD_SMSQUEUE": "Add Agent To SMS Queue", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "RECEIVEURL": "Receive URL", + "INTERACTION": "Interaction", + "INTERACTIONS": "Interactions", + "NO_INTERACTION_AVAILABLE": "No interactions available", + "CONTACT": "Contact", + "STARTEDAT": "Started At", + "LASTMESSAGE": "Last message", + "AGENT": "Agent", + "CLOSEDAT": "Closed At", + "DISPOSITION": "Disposition", + "NOTES": "Notes", + "GOTO": "Goto", + "GOTOIF": "Gotoif", + "NOOP": "Noop", + "QUEUE": "Queue", + "TIMEOUT": "Timeout", + "VALUE": "Value", + "EDIT_AGENT": "Edit Agent", + "EDIT_GOTO": "Edit Goto", + "EDIT_NOOP": "Edit Noop", + "EDIT_GOTOIF": "Edit Gotoif", + "EDIT_QUEUE": "Edit Queue", + "CONDITION": "Condition", + "TRUEPRIORITY": "True Priority", + "FALSEPRIORITY": "False Priority", + "PRIORITY": "Priority", + "GOTOP": "Gotop", + "EDIT_GOTOP": "Edit Gotop", + "EDIT_CLOSE": "Edit Close", + "FILTER": "Filter", + "SELECT_STATUS": "Select a status", + "ALL": "All", + "SELECT_ACCOUNT": "Select an account", + "OPENED": "Open", + "CLOSED": "Closed", + "STATUS": "Status", + "ACCOUNT": "Account", + "OPEN": "Open", + "INFO": "Info", + "ACCOUNTSID": "Account SID", + "AUTHTOKEN": "Auth Token", + "UNKNOWN": "Unknown", + "UNREGISTERED": "Unregistered", + "UNAVAILABLE": "Unavailable", + "NOT_INUSE": "Not in use", + "REACHABLE": "Reachable", + "IN_USE": "In use", + "AGENTS": "Agents", + "QUEUES": "Queues", + "FULLNAME": "Fullname", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "PAUSE": "Pause", + "LOGOUT": "Logout", + "AGENTADD_QUEUE": "Add agent to SMS queue", + "UNPAUSE": "End Pause", + "DEFAULT_PAUSE": "Default pause", + "LOGGED_IN": "Logged in", + "PAUSED": "Paused", + "READY": "Ready", + "WAITING": "Waiting", + "VOICE": "Voice", + "CHAT": "Chat", + "MAIL": "Email", + "OPENCHANNEL": "Open channel", + "FAX": "Fax", + "AGENTSADD_QUEUE": "Add agents to SMS queue", + "INTERACTIONS_SMSACCOUNT": "Go to Interactions", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "DELETE_INTERACTION": "Delete Interaction", + "AGENTADD_SMSACCOUNT": "Add Agent to SMS Account", + "TEAMS_ASSOCIATION": "Teams Association", + "DOWNLOAD_WITH_ATTACHMENT": "Download with attachment", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download without attachment" + } +} diff --git a/public/app/main/apps/staff/i18n/bs.json b/public/app/main/apps/staff/i18n/bs.json index 16c4dd6..40425f7 100644 --- a/public/app/main/apps/staff/i18n/bs.json +++ b/public/app/main/apps/staff/i18n/bs.json @@ -1,140 +1,140 @@ { "STAFF": { "MANAGE_API_KEY": "API Key Manager", - "GENERATE": "Generate", + "GENERATE": "Generiši", "REGENERATE": "Regenerate", "REMOVE": "Remove", - "APIKEYMANAGER_USER": "API Key Manager", - "APIKEY": "API Key", + "APIKEYMANAGER_USER": "API Upravitelj Ključeva", + "APIKEY": "API Ključ", "VIDEOSUPPORT": "Video support", "HOTDESK": "Hot desk", - "ENABLEVIDEOECORDING": "Enable Video Recording", - "ENABLESCREENRECORDINGBYAGENT": "Enable Screen Recording by Agent", - "ENABLEAUTOMATICSCREENRECORDING": "Enable Automatic Screen Recording", + "ENABLEVIDEOECORDING": "Omogući Video Snimanje", + "ENABLESCREENRECORDINGBYAGENT": "Omogući Snimanje Ekrana od Specijaliste", + "ENABLEAUTOMATICSCREENRECORDING": "Omogući Automatski Snimanje Ekrana", "OLD_PASSWORD": "Old Password", - "ENABLEJAWSINTEGRATION": "Enable Jaws Integration", - "ALIAS": "Alias", + "ENABLEJAWSINTEGRATION": "Omogući Jaws Intergraciju", + "ALIAS": "Pseudonim", "NO_PASSWORD_CHANGE": "No Password Change", "SECURITY_SUITE": "Security Suite", - "AUTO_ANSWER": "Auto answer", - "CHAT_AUTOANSWER": "Chat auto answer", - "CHAT_AUTOANSWERDELAY": "Chat auto answer delay [s]", - "EMAIL_AUTOANSWER": "Email auto answer", - "EMAIL_AUTOANSWERDELAY": "Email auto answer delay [s]", + "AUTO_ANSWER": "Automatski odgovor", + "CHAT_AUTOANSWER": "Chat automatski odgovor", + "CHAT_AUTOANSWERDELAY": "Chat automatski dogovor odgoda [s]", + "EMAIL_AUTOANSWER": "E-Mail automatski odgovor", + "EMAIL_AUTOANSWERDELAY": "E-Mail automatski odgovor odgoda [s]", "SMS_AUTOANSWER": "Sms auto answer", "SMS_AUTOANSWERDELAY": "Sms auto answer delay [s]", "OPENCHANNEL_AUTOANSWER": "Openchannel auto answer", "OPENCHANNEL_AUTOANSWERDELAY": "Openchannel auto answer delay [s]", - "FAX_AUTOANSWER": "Fax auto answer", - "FAX_AUTOANSWERDELAY": "Fax auto answer delay [s]", + "FAX_AUTOANSWER": "Fax automatski odgovor", + "FAX_AUTOANSWERDELAY": "Fax automatski odgovor odgoda [s]", "WHATSAPP_AUTOANSWER": "Whatsapp connector auto answer", "WHATSAPP_AUTOANSWERDELAY": "Whatsapp connector auto answer delay [s]", "LAST_PASSWORD_RESET_AT": "Last Password Reset At", "SIP_WEBRTC": "Sip", "SETTINGS_WEBRTC": "Settings", "WEBRTC": "WebRTC", - "DTLSCERTFILE": "TLS certificate", - "DTLSPRIVATEKEY": "TLS certificate's private key", - "CONTEXT": "Context", + "DTLSCERTFILE": "TLS certifikat", + "DTLSPRIVATEKEY": "TLS certifikatov privatni ključ", + "CONTEXT": "Kontekst", "RINGINUSE": "Ring In Use", "USERS": "Users", - "AGENTS": "Agents", + "AGENTS": "Specijalisti", "TOGGLE_SIDENAV": "Toggle sidenav", "SEARCH_FOR_ANYONE": "Search", - "BACK": "Back", + "BACK": "Nazad", "MULTI_SELECT_TOGGLE": "multi select toggle", "SELECT_ALL": "Select all", "SELECT_NONE": "Select None", "SELECTED": "Selected", - "DELETE_SELECTED": "Delete selected", - "EXPORT_SELECTED": "Export selected", - "ALL_USERS": "All users", - "ALL_AGENTS": "All agents", + "DELETE_SELECTED": "Izbriši odabrano", + "EXPORT_SELECTED": "Izvezi odabrano", + "ALL_USERS": "Svi Korisnici", + "ALL_AGENTS": "Svi specijalisti", "SORT": "sort", "NAME": "Name", - "FULLNAME": "Full Name", - "A_TO_Z": "(A to Z)", + "FULLNAME": "Puno Ime", + "A_TO_Z": "(A do Z)", "Z_TO_A": "(Z to A)", "MORE": "More", - "DELETE_USER": "Delete User", - "EDIT_USER": "Edit User", - "DELETE_AGENT": "Delete Agent", - "EDIT_AGENT": "Edit Agent", - "DELETE": "Delete", + "DELETE_USER": "Izbriši Korisnika", + "EDIT_USER": "Uredi Korisnika", + "DELETE_AGENT": "Izbriši Specijalistu", + "EDIT_AGENT": "Uredi Specijalistu", + "DELETE": "Izbriši", "SAVE": "SAVE", - "ADD_USER": "ADD USER", - "ADD_AGENT": "ADD AGENT", + "ADD_USER": "DODAJ KORISNIKA", + "ADD_AGENT": "DODAJ SPECIJALISTU", "NO_RESULTS": "No results..", - "CLOSE_DIALOG": "Close dialog", + "CLOSE_DIALOG": "Zatvori dijalog", "NAME_REQUIRED": "Name (required)", "USERNAME": "Username", "SHOW_ALL_FIELDS": "Show All Fields", "PHONE_NUMBER": "Phone number", - "EMAIL": "Email", + "EMAIL": "E-Mail", "PASSWORD": "Password", "ERRORS": { - "CONFIRM_REQUIRED": "Mandatory field", - "ALLOWCODECS_REQUIRED": "Mandatory field", - "ENCRYPTION": "SRTP (Secure Realtime Protocol) Encryption", - "DTLSCERTFILE_REQUIRED": "Mandatory field", - "DTLSPRIVATEKEY_REQUIRED": "Mandatory field", - "FULLNAME_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field", - "EMAIL_REQUIRED": "Mandatory field", - "PASSWORD_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "EMAIL_MUST_VALID": "Wrong format", - "ACCOUNTNAME_REQUIRED": "Mandatory field", - "NAME_REQUIRED": "Mandatory field", - "HOST_REQUIRED": "Mandatory field", - "CHATCAPACITY_REQUIRED": "Mandatory field", - "MAILCAPACITY_REQUIRED": "Mandatory field", - "FAXCAPACITY_REQUIRED": "Mandatory field", - "SMSCAPACITY_REQUIRED": "Mandatory field", - "WHATSAPPCAPACITY_REQUIRED": "Mandatory field", - "OPENCHANNELCAPACITY_REQUIRED": "Mandatory field", - "SIPEXPIRES_REQUIRED": "Mandatory field", - "SIPPORT_REQUIRED": "Mandatory field", - "UNCONDITIONALNUMBER_REQUIRED": "Mandatory field", - "NOREPLYNUMBER_REQUIRED": "Mandatory field", - "BUSYNUMBER_REQUIRED": "Mandatory field", - "USERNAME_MUST_VALID_PATTERN": "Wrong format {{regex}}", - "REMOTECONTROLPORT_REQUIRED": "Mandatory field", - "CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AUTOANSWERDELAY_REQUIRED": "Mandatory field", - "MONITOREXTENSION_REQUIRED": "Mandatory field", - "SECURE_PASSWORD_PATTERN": "The password must be at least 8 characters long and have 1 lowercase character, 1 uppercase character, 1 number and 1 special character ~!@#$%^&-_=+[{]}.", - "CRUDPERMISSIONS_REQUIRED": "Mandatory field", - "USERPROFILE_REQUIRED": "Mandatory field", - "PASSWORD_OLDPASSWORD_MATCH": "New password must be different from previous one" + "CONFIRM_REQUIRED": "Obavezno polje", + "ALLOWCODECS_REQUIRED": "Obavezno polje", + "ENCRYPTION": "SRTP (Secure Realtime Protocol) Enkripcija", + "DTLSCERTFILE_REQUIRED": "Obavezno polje", + "DTLSPRIVATEKEY_REQUIRED": "Obavezno polje", + "FULLNAME_REQUIRED": "Obavezno polje", + "USERNAME_REQUIRED": "Obavezno polje", + "EMAIL_REQUIRED": "Obavezno polje", + "PASSWORD_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinke se ne podudraju", + "EMAIL_MUST_VALID": "Pogrešan format", + "ACCOUNTNAME_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "HOST_REQUIRED": "Obavezno polje", + "CHATCAPACITY_REQUIRED": "Obavezno polje", + "MAILCAPACITY_REQUIRED": "Obavezno polje", + "FAXCAPACITY_REQUIRED": "Obavezno polje", + "SMSCAPACITY_REQUIRED": "Obavezno polje", + "WHATSAPPCAPACITY_REQUIRED": "Obavezno polje", + "OPENCHANNELCAPACITY_REQUIRED": "Obavezno polje", + "SIPEXPIRES_REQUIRED": "Obavezno polje", + "SIPPORT_REQUIRED": "Obavezno polje", + "UNCONDITIONALNUMBER_REQUIRED": "Obavezno polje", + "NOREPLYNUMBER_REQUIRED": "Obavezno polje", + "BUSYNUMBER_REQUIRED": "Obavezno polje", + "USERNAME_MUST_VALID_PATTERN": "Pogrešan format {{regex}}", + "REMOTECONTROLPORT_REQUIRED": "Obavezno polje", + "CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AUTOANSWERDELAY_REQUIRED": "Obavezno polje", + "MONITOREXTENSION_REQUIRED": "Obavezno polje", + "SECURE_PASSWORD_PATTERN": "Lozinka mora imati najmanje 8 znakova i 1 malo slovo, 1 veliko slovo, 1 broj i 1 specijalni znak ~!@#$%^&-_=+[{]}. ", + "CRUDPERMISSIONS_REQUIRED": "Obavezno polje", + "USERPROFILE_REQUIRED": "Obavezno polje", + "PASSWORD_OLDPASSWORD_MATCH": "Nova lozinka mora biti drugačija od prethodne" }, - "ACCOUNT": "Account", + "ACCOUNT": "Nalog", "VOICE": "Voice", - "CREATED_AT": "Created At", + "CREATED_AT": "Kreirano U", "ROLE": "Role", "PERSONAL_INFO": "Personal Info", - "DESCRIPTION": "Description", - "CHANGE_AVATAR": "Change Avatar", - "GENERAL": "General", + "DESCRIPTION": "Opis", + "CHANGE_AVATAR": "Promijeni Avatar", + "GENERAL": "Općenito", "INTERNAL": "Internal", "TRANSPORT": "Transport", - "ALLOWCODECS": "Allowed Codecs", - "DISABLED": "Deactivated", - "BLOCKED": "Locked", + "ALLOWCODECS": "Dozvoljeni Kodeci", + "DISABLED": "Deaktivirano", + "BLOCKED": "Zaključano", "AD_SSO_ENABLED": "Active Directory SSO", - "AUTHENTICATION": "Authentication", + "AUTHENTICATION": "Autentifikacija", "HELP": { "DISABLED": "select to deactivate / unselect to reactivate", "BLOCKED": "Lock / Unlock access", - "APIKEY": "Please use 'API key manager' button on toolbar to manage this key", + "APIKEY": "Molimo koristi 'API Menadžer Ključeva' dugme na traci sa alatkama za upravljanjem ovim ključem", "LAST_PASSWORD_RESET_AT": "Last date and time the password has been changed. If Secure Suite General Setting is enabled, the password will expire after 90 days.", "DTLSCERTFILE": "Link to the valid TLS certificate(.crt file). Default value: '/etc/pki/tls/certs/motion.crt'.", "DTLSPRIVATEKEY": "Link to the certificate's private key(.key file). Default value: '/etc/pki/tls/private/motion.key'.", - "ALLOWCODECS": "Allowed Codecs in order of preference", + "ALLOWCODECS": "Dozvoljeni Kodeci prema željenemo poretku", "TRANSPORT": "Set the default transports in order of preference", "HOST": "How to find the client - IP or host name. If you want the phone to register itself, use the keyword dynamic instead of Host IP", "NAT": "Changes the behaviour of Asterisk for clients behind a firewall. If any of the comma-separated options is 'no', Asterisk will ignore other settings and set nat=no", @@ -156,36 +156,36 @@ "ENABLEAUTOMATICSCREENRECORDING": "The functionality is available only for voice channel", "MASK_SENSITIVE_DATA": "Mask any sensitive data throughout the application (e.g. phone numbers and email addresses)", "WSS_PORT": "Default: 8089", - "AD_SSO_ENABLED": "Login in with your Active Directory credentials" + "AD_SSO_ENABLED": "Prijavi se sa svojima Active Directory akreditivima" }, "NEW_PASSWORD": "New Password", - "CONFIRM_PASSWORD": "Confirm Password", - "CHANGE_PASSWORD": "Change Password", - "CHANGEPASSWORD_AGENT": "Change Password", - "CHANGEPASSWORD_USER": "Change Password", - "CHANGEPASSWORD_TELEPHONE": "Change Password", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "CHANGE_PASSWORD": "Promijeni Lozinku", + "CHANGEPASSWORD_AGENT": "Promijeni Lozinku", + "CHANGEPASSWORD_USER": "Promijeni Lozinku", + "CHANGEPASSWORD_TELEPHONE": "Promijeni Lozinku", "LOGININPAUSE": "Login In Pause", "HOST": "Host", "NAT": "NAT", "CHANSPY": "ChanSpy", "OTHER_CHANNELS": "Other Channels", - "CHATCAPACITY": "Chat Capacity", + "CHATCAPACITY": "Chat Kapacitet", "MAILCAPACITY": "Email Capacity", - "FAXCAPACITY": "Fax Capacity", + "FAXCAPACITY": "Fax Kapacitet", "SMSCAPACITY": "Sms Capacity", "WHATSAPPCAPACITY": "WhatsApp Connector Capacity", "OPENCHANNELCAPACITY": "Open Channel Capacity", "MOTIONBAR": "Motion Bar", "SETTINGS": "Settings", - "AUTOANSWER": "Auto Answer", - "ENABLESETTINGS": "Enable Settings", - "CALL_FORWARDING": "Call Forwarding", + "AUTOANSWER": "Automatski Odgovor", + "ENABLESETTINGS": "Omogući Postavke", + "CALL_FORWARDING": "Prosljeđivanje Poziva", "UNCONDITIONAL": "Unconditional", "UNCONDITIONALNUMBER": "Unconditional Number", "NOREPLY": "No Reply", "NOREPLYNUMBER": "No Reply Number", - "BUSY": "Busy", - "BUSYNUMBER": "Busy Number", + "BUSY": "Zauzet", + "BUSYNUMBER": "Zauzet Broj", "REMOTE_CONTROL": "Remote Control", "REMOTECONTROL": "Remote Control", "REMOTECONTROLPORT": "Remote Control Port", @@ -193,44 +193,44 @@ "SIPEXPIRES": "SIP Expires [sec]", "SIPPORT": "SIP Port", "PENALTY": "Penalty", - "ACCOUNTNAME": "Account Name", - "ADD_TELEPHONE": "Add Telephone", - "EDIT_TELEPHONE": "Edit Telephone", - "DELETE_TELEPHONE": "Delete Telephone", + "ACCOUNTNAME": "Nalog Naziv", + "ADD_TELEPHONE": "Dodaj Telefon", + "EDIT_TELEPHONE": "Uredi Telefon", + "DELETE_TELEPHONE": "Izbriši Telefon", "TEAMS": "Teams", - "DELETE_TEAM": "Delete Team", - "AGENTADD_TEAM": "Add Agents to Team", - "EDIT_TEAM": "Edit Team", + "DELETE_TEAM": "Izbriši Tim", + "AGENTADD_TEAM": "Dodaj Specijaliste u Tim", + "EDIT_TEAM": "Uredi Tim", "TYPE": "Type", "TELEPHONES": "Telephones", - "CALLERID": "Caller ID", - "ENABLERECORDING": "Enable Recording", + "CALLERID": "Pozivatelj ID", + "ENABLERECORDING": "Omogući Snimanje", "STAFF": "Staff", "ID": "Id", "NEW_USER": "New User", "NEW_AGENT": "New Agent", "NEW_TELEPHONE": "New Telephone", "NEW_TEAM": "New Team", - "ADD_TEAM": "Add Team", + "ADD_TEAM": "Dodaj Tim", "JOIN_QUEUE": "Join Queue", - "CAPACITY": "Capacity", - "AUTOINTERNAL": "Auto generate internal number", - "ADD_AGENT_TO_TEAM": "Add Agent to Team", + "CAPACITY": "Kapacitet", + "AUTOINTERNAL": "Automatsko generisanje internog broja", + "ADD_AGENT_TO_TEAM": "Dodaj Specijalistu u Tim", "TEAMADD_AGENT": "Add Agent to Team", "NO_AVAILABLE_INFO": "No available info", "PERMISSIONS": "Permissions", - "ADD_AGENT_TO_QUEUE": "Add Agent to Queue", - "ALL_MODULES_AVAILABLE": "All modules available", - "CALLGROUP": "Call Group", + "ADD_AGENT_TO_QUEUE": "Dodaj Specijalistu u Queue", + "ALL_MODULES_AVAILABLE": "Svi dostupni moduli", + "CALLGROUP": "Grupa Poziva", "PICKUPGROUP": "Pickup Group", - "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Add Agent to Queue Campaigns", - "ADD_AGENT_TO_VOICE_QUEUES": "Add Agent to Voice Queues", - "ADD_AGENT_TO_CHAT_QUEUES": "Add Agent to Chat Queues", - "ADD_AGENT_TO_MAIL_QUEUES": "Add Agent to Email Queues", - "ADD_AGENT_TO_SMS_QUEUES": "Add Agent to SMS Queues", - "ADD_AGENT_TO_WHATSAPP_QUEUES": "Add Agent to WhatsApp Queues", - "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Add Agent to Open Channel Queues", - "ADD_AGENT_TO_FAX_QUEUES": "Add Agent to Fax Queues", + "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Dodaj Specijalistu u Queue Kampanja", + "ADD_AGENT_TO_VOICE_QUEUES": "Dodaj Specijalistu u Voice Queues", + "ADD_AGENT_TO_CHAT_QUEUES": "Dodaj Specijalistu u Chat Queues", + "ADD_AGENT_TO_MAIL_QUEUES": "Dodaj Specijalistu u E-Mail Queues", + "ADD_AGENT_TO_SMS_QUEUES": "Dodaj Specijalistu u SMS Queues", + "ADD_AGENT_TO_WHATSAPP_QUEUES": "Dodaj Specijalistu u WhatsApp Queues", + "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Dodaj Specijalistu u Otvoreni Kanal Queues", + "ADD_AGENT_TO_FAX_QUEUES": "Dodaj Specijalistu u Fax Queues", "QUEUEADD_USER_VOICE_INBOUND": "Add User to Voice Queues", "QUEUEADD_USER_CHAT_INBOUND": "Add User to Chat Queues", "QUEUEADD_USER_MAIL_INBOUND": "Add User to Email Queues", @@ -238,37 +238,37 @@ "QUEUEADD_USER_WHATSAPP_INBOUND": "Add User to WhatsApp Queues", "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Add User to Open Channel Queues", "QUEUEADD_USER_FAX_INBOUND": "Add User to Fax Queues", - "ALL_TEAMS": "All Teams", + "ALL_TEAMS": "Svi Timovi", "SELECTED_TEAMS": "Selected Teams", "SELECTED_AGENTS": "Selected Agents", - "ALL_QUEUE_CAMPAIGNS": "All Queue Campaigns", + "ALL_QUEUE_CAMPAIGNS": "Sve Queue Kampanje", "SELECTED_QUEUE_CAMPAIGNS": "Selected Queue Campaigns", - "ALL_VOICE_QUEUES": "All Voice Queues", + "ALL_VOICE_QUEUES": "Svi Voice Queues", "SELECTED_VOICE_QUEUES": "Selected Voice Queues", - "ALL_CHAT_QUEUES": "All Chat Queues", + "ALL_CHAT_QUEUES": "Svi Chat Queues", "SELECTED_CHAT_QUEUES": "Selected Chat Queues", - "ALL_MAIL_QUEUES": "All Email Queues", + "ALL_MAIL_QUEUES": "Svi E-Mail Queues", "SELECTED_MAIL_QUEUES": "Selected Email Queues", - "ALL_SMS_QUEUES": "All SMS Queues", + "ALL_SMS_QUEUES": "Svi SMS Queues", "SELECTED_SMS_QUEUES": "Selected SMS Queues", - "ALL_WHATSAPP_QUEUES": "All WhatsApp Queues", + "ALL_WHATSAPP_QUEUES": "Svi WhatsApp Queues", "SELECTED_WHATSAPP_QUEUES": "Selected WhatsApp Queues", - "ALL_OPENCHANNEL_QUEUES": "All Open Channel Queues", + "ALL_OPENCHANNEL_QUEUES": "Svi Otvoreni Kanal Queues", "SELECTED_OPENCHANNEL_QUEUES": "Selected Open Channel Queues", - "ALL_FAX_QUEUES": "All Fax Queues", + "ALL_FAX_QUEUES": "Svi Fax Queues", "SELECTED_FAX_QUEUES": "Selected Fax Queues", "VOICEMAIL": "Voicemail", "SHOWWEBCONTROL": "Typology", "PAGE": "Page", "ROWSPERPAGE": "Rows per page", "OF": "of", - "CALLFORWARDING": "Call Forwarding", - "DND": "Do not disturb during pause", + "CALLFORWARDING": "Prosljeđivanje Poziva", + "DND": "Ne ometaj tokom pauze", "UNANSWEREDCALLBADGE": "Show unanswered call badge", - "ENABLEDTMFTONE": "Enable Dtmf tones", - "AUTOANSWERDELAY": "Auto Answer Delay [s]", - "ENCRYPTION": "Encryption", - "CHANNELS": "Channels", + "ENABLEDTMFTONE": "Omogući DTMF tonove", + "AUTOANSWERDELAY": "Automatski Odgovor Odgoda [s]", + "ENCRYPTION": "Enkripcija", + "CHANNELS": "Kanali", "CHAT": "Chat", "SMS": "Sms", "WHATSAPP": "WhatsApp Connector", @@ -276,70 +276,70 @@ "FAX": "Fax", "QUEUEADD_USER_VOICE_OUTBOUND": "Add User to Queue Campaigns", "MONITOREXTENSION": "Record calls to user extension", - "EDITPERMISSIONS": "Editing Permissions", + "EDITPERMISSIONS": "Uredi Prava", "READ_PERMISSION": "Read", - "EDIT_PERMISSION": "Edit", - "DELETE_PERMISSION": "Delete", - "GENERAL_PERMISSIONS": "General", - "ENABLEMESSENGER": "Enable Internal Messenger", + "EDIT_PERMISSION": "Uredi", + "DELETE_PERMISSION": "Izbriši", + "GENERAL_PERMISSIONS": "Općenito", + "ENABLEMESSENGER": "Omogući Interni Messenger", "OUTBOUNDPROXY": "Oubound Proxy", "PHONE": "Phone", "MOBILE": "Mobile", "PREFIXREQUIRED": "Prefix Required", "MANAGE_PERMISSIONS": "Manage Permissions", "USERADD_VOICEQUEUES": "Add Voice Queue to User", - "ALL_VOICEQUEUES": "All Voice Queues", + "ALL_VOICEQUEUES": "Svi Voice Queues", "SELECTED_VOICEQUEUES": "Selected Voice Queues", "USERADD_CHATQUEUES": "Add Chat Queue to User", - "ALL_CHATQUEUES": "All Chat Queues", + "ALL_CHATQUEUES": "Svi Chat Queues", "SELECTED_CHATQUEUES": "Selected Email Queues", "USERADD_MAILQUEUES": "Add Email Queue to User", - "ALL_MAILQUEUES": "All Email Queues", + "ALL_MAILQUEUES": "Svi E-Mail Queues", "SELECTED_MAILQUEUES": "Selected Chat Queues", "USERADD_SMSQUEUES": "Add SMS Queue to User", - "ALL_SMSQUEUES": "All SMS Queues", + "ALL_SMSQUEUES": "Svi SMS Queues", "SELECTED_SMSQUEUES": "Selected SMS Queues", "USERADD_WHATSAPPQUEUES": "Add Whataspp Queue to User", - "ALL_WHATSAPPQUEUES": "All Whataspp Queues", + "ALL_WHATSAPPQUEUES": "Svi WhatsApp Queues", "SELECTED_WHATSAPPQUEUES": "Selected WhatsApp Queues", "USERADD_FAXQUEUES": "Add Fax Queue to User", - "ALL_FAXQUEUES": "All Fax Queues", + "ALL_FAXQUEUES": "Svi Fax Queues", "SELECTED_FAXQUEUES": "Selected Fax Queues", "USERADD_OPENCHANNELQUEUES": "Add Open Channel Queue to User", - "ALL_OPENCHANNELQUEUES": "All Open Channel Queues", + "ALL_OPENCHANNELQUEUES": "Svi Otvoreni Kanal Queues", "SELECTED_OPENCHANNELQUEUES": "Selected Open Channel Queues", "USERADD_PROJECTS": "Add Cally Square Project to User", - "ALL_PROJECTS": "All Cally Square Projects", + "ALL_PROJECTS": "Svi Cally Square Projekti", "SELECTED_PROJECTS": "Selected Cally Square Projects", "USERADD_CHATWEBSITES": "Add Chat Website to User", - "ALL_CHATWEBSITES": "All Chat Websites", + "ALL_CHATWEBSITES": "Sve Chat Webstranice", "SELECTED_CHATWEBSITES": "Selected Chat Websites", "USERADD_QUEUECAMPAIGNS": "Add Queue Campaign to User", - "ALL_QUEUECAMPAIGNS": "All Queue Campaigns", + "ALL_QUEUECAMPAIGNS": "Sve Queue Kampanje", "SELECTED_QUEUECAMPAIGNS": "Selected Queue Campaigns", "USERADD_MAILACCOUNTS": "Add Email Account to User", - "ALL_MAILACCOUNTS": "All Email Accounts", + "ALL_MAILACCOUNTS": "Svi E-Mail Nalozi", "SELECTED_MAILACCOUNTS": "Selected Email Accounts", "USERADD_FAXACCOUNTS": "Add Fax Account to User", - "ALL_FAXACCOUNTS": "All Fax Accounts", + "ALL_FAXACCOUNTS": "Svi Fax Nalozi", "SELECTED_FAXACCOUNTS": "Selected Fax Accounts", "USERADD_SMSACCOUNTS": "Add SMS Account to User", - "ALL_SMSACCOUNTS": "All SMS Accounts", + "ALL_SMSACCOUNTS": "Svi SMS Nalozi", "SELECTED_SMSACCOUNTS": "Selected SMS Accounts", "USERADD_WHATSAPPACCOUNTS": "Add WhatsApp Account to User", - "ALL_WHATSAPPACCOUNTS": "All WhatsApp Accounts", + "ALL_WHATSAPPACCOUNTS": "Svi WhatsApp Nalozi", "SELECTED_WHATSAPPACCOUNTS": "Selected WhatsApp Accounts", "USERADD_OPENCHANNELACCOUNTS": "Add Open Channel Account to User", - "ALL_OPENCHANNELACCOUNTS": "All Open Channel Accounts", + "ALL_OPENCHANNELACCOUNTS": "Svi Otvoreni Kanal Nalozi", "SELECTED_OPENCHANNELACCOUNTS": "Selected Open Channel Accounts", "USERPROFILES": "User Profiles", "USERPROFILE": "User Profile", "NEW_USERPROFILE": "New User Profile", - "ADD_USERPROFILE": "Add User Profile", - "EDIT_USERPROFILE": "Edit User Profile", - "CLONE_USERPROFILE": "Clone User Profile", - "DELETE_USERPROFILE": "Delete User Profile", - "CRUDPERMISSIONS": "Permission Type", + "ADD_USERPROFILE": "DODAJ PROFIL KORISNIKA", + "EDIT_USERPROFILE": "Uredi Profil Korisnika", + "CLONE_USERPROFILE": "Kloniraj Profil Korisnika", + "DELETE_USERPROFILE": "Izbriši Profil Korisnika", + "CRUDPERMISSIONS": "Vrsta Prava", "SECTIONS": "Sections", "MODULES": "Modules", "SUMMARY": "Summary", @@ -366,9 +366,9 @@ "PERMISSIONS_SAVED_SUCCESS_TITLE": "{{sectionName}} section saved", "PERMISSIONS_SAVED_SUCCESS_MESSAGE": "Permissions successfully updated!" }, - "CONFIRM": "Confirm", - "CANCEL": "Cancel", - "CLOSE": "Close", + "CONFIRM": "Potvrdi", + "CANCEL": "Otkaži", + "CLOSE": "Zatvori", "QUEUES_ASSOCIATION": "{{channel}} Queues Association", "TEAMS_ASSOCIATION": "Teams Association", "PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE": "Unauthorized action", @@ -376,26 +376,26 @@ "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "You are not allowed to create the resource", "MASK_SENSITIVE_DATA": "Mask Sensitive Data", "WSS_PORT": "WSS Port", - "DOWNLOADS": "Downloads", - "DOWNLOAD_PERMISSIONS": "Download Permissions", + "DOWNLOADS": "Preuzimanja", + "DOWNLOAD_PERMISSIONS": "Prava za Preuzimanja", "VOICE_RECORDINGS": "Voice Recordings", "OMNICHANNEL_INTERACTIONS": "Omnichannel Interactions", - "ATTACHMENTS": "Attachments", + "ATTACHMENTS": "Prilozi", "SCREEN_RECORDINGS": "Screen Recordings", "JSCRIPTY_SESSIONS": "Jscripty Sessions", - "CONTACT_MANAGER_LISTS": "Contact Manager Lists", - "CALLYSQUARE_RECORDINGS": "Cally Square Recordings", + "CONTACT_MANAGER_LISTS": "Kontakt Menadžer Lista", + "CALLYSQUARE_RECORDINGS": "Cally Square Snimci", "IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS": "Ignore agent break status for preview calls", "SELECT_RECALLME_CAMPAIGN": "Select Recall Me Campaign", - "CLIENT_LOGS": "Client Logs", - "CLIENT_LOGS_DISABLED": "Client logs are disabled", - "CLIENT_LOGS_ENABLED": "Client logs are enabled", - "CLIENT_LOGS_LOGLEVEL_SELECT": "Select min logging level (severity)", - "CLIENT_LOGS_LOGLEVEL": "Log level: {{logLevel}}", - "CLIENT_LOGS_ENABLED_SINCE": "Enabled since: {{enabledSince}}", - "CLIENT_LOGS_ENABLED_MSG": "Client logs have been enabled for your user", - "CLIENT_LOGS_DISABLED_MSG": "Client logs have been disabled for your user", - "CLIENT_LOGS_ALL_ENABLED_WARNING": "Warning: this could severely affect server performances if many agents are logged in at the same time!", + "CLIENT_LOGS": "Logovi Klijenata", + "CLIENT_LOGS_DISABLED": "Logovi klijenata su onemogućeni", + "CLIENT_LOGS_ENABLED": "Logovi klijenata su omogućeni", + "CLIENT_LOGS_LOGLEVEL_SELECT": "Odaberi min nivo evidentiranja (ozbiljnost)", + "CLIENT_LOGS_LOGLEVEL": "Log nivo: {{logLevel}}", + "CLIENT_LOGS_ENABLED_SINCE": "Omogućeno od: {{enabledSince}}", + "CLIENT_LOGS_ENABLED_MSG": "Logovi klijenata su omogućeni za tvog korisnika", + "CLIENT_LOGS_DISABLED_MSG": "Logovi klijenata su onemogućeni za tvog korisnika", + "CLIENT_LOGS_ALL_ENABLED_WARNING": "Upozorenje: ovo može ozbiljno uticati na performanse servera ako je više Specijalista istovremeno prijavljeno!", "QUEUEADD_AGENT_VOICE_OUTBOUND": "Add Agent to Queue Campaigns", "QUEUEADD_AGENT_VOICE_INBOUND": "Add Agent to Voice Queues", "QUEUEADD_AGENT_CHAT_INBOUND": "Add Agent to Chat Queues", @@ -404,21 +404,21 @@ "QUEUEADD_AGENT_WHATSAPP_INBOUND": "Add Agent to WhatsApp Queues", "QUEUEADD_AGENT_OPENCHANNEL_INBOUND": "Add Agent to Open Channel Queues", "QUEUEADD_AGENT_FAX_INBOUND": "Add Agent to Fax Queues", - "ALL_QUEUES_VOICE_OUTBOUND": "All Queue Campaigns", + "ALL_QUEUES_VOICE_OUTBOUND": "Sve Queue Kampanje", "SELECTED_QUEUES_VOICE_OUTBOUND": "Selected Queue Campaigns", - "ALL_QUEUES_VOICE_INBOUND": "All Voice Queues", + "ALL_QUEUES_VOICE_INBOUND": "Svi Voice Queues", "SELECTED_QUEUES_VOICE_INBOUND": "Selected Voice Queues", - "ALL_QUEUES_CHAT_INBOUND": "All Chat Queues", + "ALL_QUEUES_CHAT_INBOUND": "Svi Chat Queues", "SELECTED_QUEUES_CHAT_INBOUND": "Selected Chat Queues", - "ALL_QUEUES_MAIL_INBOUND": "All Email Queues", + "ALL_QUEUES_MAIL_INBOUND": "Svi E-Mail Queues", "SELECTED_QUEUES_MAIL_INBOUND": "Selected Email Queues", - "ALL_QUEUES_SMS_INBOUND": "All SMS Queues", + "ALL_QUEUES_SMS_INBOUND": "Svi SMS Queues", "SELECTED_QUEUES_SMS_INBOUND": "Selected SMS Queues", - "ALL_QUEUES_WHATSAPP_INBOUND": "All WhatsApp Queues", + "ALL_QUEUES_WHATSAPP_INBOUND": "Svi WhatsApp Queues", "SELECTED_QUEUES_WHATSAPP_INBOUND": "Selected WhatsApp Queues", - "ALL_QUEUES_OPENCHANNEL_INBOUND": "All Open Channel Queues", + "ALL_QUEUES_OPENCHANNEL_INBOUND": "Svi Otvoreni Kanal Queues", "SELECTED_QUEUES_OPENCHANNEL_INBOUND": "Selected Open Channel Queues", - "ALL_QUEUES_FAX_INBOUND": "All Fax Queues", + "ALL_QUEUES_FAX_INBOUND": "Svi Fax Queues", "SELECTED_QUEUES_FAX_INBOUND": "Selected Fax Queues" } } diff --git a/public/app/main/apps/staff/i18n/et.json b/public/app/main/apps/staff/i18n/et.json index 75fb8d9..cb39da7 100644 --- a/public/app/main/apps/staff/i18n/et.json +++ b/public/app/main/apps/staff/i18n/et.json @@ -375,6 +375,43 @@ "CLIENT_LOGS_LOGLEVEL": "Logitase: {{logLevel}}", "CLIENT_LOGS_LOGLEVEL_SELECT": "Valige minimaalne logimise tase (raskusaste)", "CLIENT_LOGS_DISABLED_MSG": "Kliendilogid on teie kasutaja jaoks keelatud", - "CLIENT_LOGS_ENABLED_MSG": "Teie kasutaja jaoks on kliendilogid lubatud" + "CLIENT_LOGS_ENABLED_MSG": "Teie kasutaja jaoks on kliendilogid lubatud", + "ADD_AGENT_TO_CHAT_QUEUES": "Lisage agent vestlusjärjekordadesse", + "ADD_AGENT_TO_FAX_QUEUES": "Lisage agent faksijärjekordadesse", + "ADD_AGENT_TO_MAIL_QUEUES": "Lisage agent meilijärjekordadesse", + "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Lisage agent avatud kanalite järjekordadesse", + "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Lisage agent kampaaniate järjekorda", + "ADD_AGENT_TO_SMS_QUEUES": "Lisage agent SMS-i järjekordadesse", + "ADD_AGENT_TO_VOICE_QUEUES": "Lisage agent hääljärjekordadesse", + "ADD_AGENT_TO_WHATSAPP_QUEUES": "Lisage agent WhatsAppi järjekordadesse", + "ALL_CHAT_QUEUES": "Kõik vestlusjärjekorrad", + "ALL_FAX_QUEUES": "Kõik faksijärjekorrad", + "ALL_MAIL_QUEUES": "Kõik meilijärjekorrad", + "ALL_OPENCHANNEL_QUEUES": "Kõik avatud kanalite järjekorrad", + "ALL_QUEUE_CAMPAIGNS": "Kõik järjekorrakampaaniad", + "ALL_SMS_QUEUES": "Kõik SMS-i järjekorrad", + "ALL_VOICE_QUEUES": "Kõik häälejärjekorrad", + "ALL_WHATSAPP_QUEUES": "Kõik WhatsAppi järjekorrad", + "AUTO_ANSWER": "Automaatne vastus", + "CHAT_AUTOANSWER": "Vestluse automaatne vastus", + "CHAT_AUTOANSWERDELAY": "Vestluse automaatse vastuse viivitus [s]", + "EMAIL_AUTOANSWER": "Meili automaatne vastus", + "EMAIL_AUTOANSWERDELAY": "Meili automaatse vastuse viivitus [s]", + "FAX_AUTOANSWER": "Faksi automaatne vastus", + "FAX_AUTOANSWERDELAY": "Faksi automaatvastuse viivitus [s]", + "OPENCHANNEL_AUTOANSWER": "Openchanneli automaatne vastus", + "OPENCHANNEL_AUTOANSWERDELAY": "Avatud kanali automaatvastuse viivitus [s]", + "SELECTED_CHAT_QUEUES": "Valitud vestlusjärjekorrad", + "SELECTED_FAX_QUEUES": "Valitud faksijärjekorrad", + "SELECTED_MAIL_QUEUES": "Valitud meilijärjekorrad", + "SELECTED_OPENCHANNEL_QUEUES": "Valitud Ava kanalite järjekorrad", + "SELECTED_QUEUE_CAMPAIGNS": "Valitud järjekorrakampaaniad", + "SELECTED_SMS_QUEUES": "Valitud SMS-i järjekorrad", + "SELECTED_VOICE_QUEUES": "Valitud häälejärjekorrad", + "SELECTED_WHATSAPP_QUEUES": "Valitud WhatsAppi järjekorrad", + "SMS_AUTOANSWER": "Automaatne SMS-vastus", + "SMS_AUTOANSWERDELAY": "SMS-i automaatvastuse viivitus [s]", + "WHATSAPP_AUTOANSWER": "WhatsAppi pistiku automaatne vastus", + "WHATSAPP_AUTOANSWERDELAY": "WhatsAppi konnektori automaatse vastamise viivitus [s]" } } diff --git a/public/app/main/apps/staff/i18n/is.json b/public/app/main/apps/staff/i18n/is.json new file mode 100644 index 0000000..16c4dd6 --- /dev/null +++ b/public/app/main/apps/staff/i18n/is.json @@ -0,0 +1,424 @@ +{ + "STAFF": { + "MANAGE_API_KEY": "API Key Manager", + "GENERATE": "Generate", + "REGENERATE": "Regenerate", + "REMOVE": "Remove", + "APIKEYMANAGER_USER": "API Key Manager", + "APIKEY": "API Key", + "VIDEOSUPPORT": "Video support", + "HOTDESK": "Hot desk", + "ENABLEVIDEOECORDING": "Enable Video Recording", + "ENABLESCREENRECORDINGBYAGENT": "Enable Screen Recording by Agent", + "ENABLEAUTOMATICSCREENRECORDING": "Enable Automatic Screen Recording", + "OLD_PASSWORD": "Old Password", + "ENABLEJAWSINTEGRATION": "Enable Jaws Integration", + "ALIAS": "Alias", + "NO_PASSWORD_CHANGE": "No Password Change", + "SECURITY_SUITE": "Security Suite", + "AUTO_ANSWER": "Auto answer", + "CHAT_AUTOANSWER": "Chat auto answer", + "CHAT_AUTOANSWERDELAY": "Chat auto answer delay [s]", + "EMAIL_AUTOANSWER": "Email auto answer", + "EMAIL_AUTOANSWERDELAY": "Email auto answer delay [s]", + "SMS_AUTOANSWER": "Sms auto answer", + "SMS_AUTOANSWERDELAY": "Sms auto answer delay [s]", + "OPENCHANNEL_AUTOANSWER": "Openchannel auto answer", + "OPENCHANNEL_AUTOANSWERDELAY": "Openchannel auto answer delay [s]", + "FAX_AUTOANSWER": "Fax auto answer", + "FAX_AUTOANSWERDELAY": "Fax auto answer delay [s]", + "WHATSAPP_AUTOANSWER": "Whatsapp connector auto answer", + "WHATSAPP_AUTOANSWERDELAY": "Whatsapp connector auto answer delay [s]", + "LAST_PASSWORD_RESET_AT": "Last Password Reset At", + "SIP_WEBRTC": "Sip", + "SETTINGS_WEBRTC": "Settings", + "WEBRTC": "WebRTC", + "DTLSCERTFILE": "TLS certificate", + "DTLSPRIVATEKEY": "TLS certificate's private key", + "CONTEXT": "Context", + "RINGINUSE": "Ring In Use", + "USERS": "Users", + "AGENTS": "Agents", + "TOGGLE_SIDENAV": "Toggle sidenav", + "SEARCH_FOR_ANYONE": "Search", + "BACK": "Back", + "MULTI_SELECT_TOGGLE": "multi select toggle", + "SELECT_ALL": "Select all", + "SELECT_NONE": "Select None", + "SELECTED": "Selected", + "DELETE_SELECTED": "Delete selected", + "EXPORT_SELECTED": "Export selected", + "ALL_USERS": "All users", + "ALL_AGENTS": "All agents", + "SORT": "sort", + "NAME": "Name", + "FULLNAME": "Full Name", + "A_TO_Z": "(A to Z)", + "Z_TO_A": "(Z to A)", + "MORE": "More", + "DELETE_USER": "Delete User", + "EDIT_USER": "Edit User", + "DELETE_AGENT": "Delete Agent", + "EDIT_AGENT": "Edit Agent", + "DELETE": "Delete", + "SAVE": "SAVE", + "ADD_USER": "ADD USER", + "ADD_AGENT": "ADD AGENT", + "NO_RESULTS": "No results..", + "CLOSE_DIALOG": "Close dialog", + "NAME_REQUIRED": "Name (required)", + "USERNAME": "Username", + "SHOW_ALL_FIELDS": "Show All Fields", + "PHONE_NUMBER": "Phone number", + "EMAIL": "Email", + "PASSWORD": "Password", + "ERRORS": { + "CONFIRM_REQUIRED": "Mandatory field", + "ALLOWCODECS_REQUIRED": "Mandatory field", + "ENCRYPTION": "SRTP (Secure Realtime Protocol) Encryption", + "DTLSCERTFILE_REQUIRED": "Mandatory field", + "DTLSPRIVATEKEY_REQUIRED": "Mandatory field", + "FULLNAME_REQUIRED": "Mandatory field", + "USERNAME_REQUIRED": "Mandatory field", + "EMAIL_REQUIRED": "Mandatory field", + "PASSWORD_REQUIRED": "Mandatory field", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "EMAIL_MUST_VALID": "Wrong format", + "ACCOUNTNAME_REQUIRED": "Mandatory field", + "NAME_REQUIRED": "Mandatory field", + "HOST_REQUIRED": "Mandatory field", + "CHATCAPACITY_REQUIRED": "Mandatory field", + "MAILCAPACITY_REQUIRED": "Mandatory field", + "FAXCAPACITY_REQUIRED": "Mandatory field", + "SMSCAPACITY_REQUIRED": "Mandatory field", + "WHATSAPPCAPACITY_REQUIRED": "Mandatory field", + "OPENCHANNELCAPACITY_REQUIRED": "Mandatory field", + "SIPEXPIRES_REQUIRED": "Mandatory field", + "SIPPORT_REQUIRED": "Mandatory field", + "UNCONDITIONALNUMBER_REQUIRED": "Mandatory field", + "NOREPLYNUMBER_REQUIRED": "Mandatory field", + "BUSYNUMBER_REQUIRED": "Mandatory field", + "USERNAME_MUST_VALID_PATTERN": "Wrong format {{regex}}", + "REMOTECONTROLPORT_REQUIRED": "Mandatory field", + "CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AUTOANSWERDELAY_REQUIRED": "Mandatory field", + "MONITOREXTENSION_REQUIRED": "Mandatory field", + "SECURE_PASSWORD_PATTERN": "The password must be at least 8 characters long and have 1 lowercase character, 1 uppercase character, 1 number and 1 special character ~!@#$%^&-_=+[{]}.", + "CRUDPERMISSIONS_REQUIRED": "Mandatory field", + "USERPROFILE_REQUIRED": "Mandatory field", + "PASSWORD_OLDPASSWORD_MATCH": "New password must be different from previous one" + }, + "ACCOUNT": "Account", + "VOICE": "Voice", + "CREATED_AT": "Created At", + "ROLE": "Role", + "PERSONAL_INFO": "Personal Info", + "DESCRIPTION": "Description", + "CHANGE_AVATAR": "Change Avatar", + "GENERAL": "General", + "INTERNAL": "Internal", + "TRANSPORT": "Transport", + "ALLOWCODECS": "Allowed Codecs", + "DISABLED": "Deactivated", + "BLOCKED": "Locked", + "AD_SSO_ENABLED": "Active Directory SSO", + "AUTHENTICATION": "Authentication", + "HELP": { + "DISABLED": "select to deactivate / unselect to reactivate", + "BLOCKED": "Lock / Unlock access", + "APIKEY": "Please use 'API key manager' button on toolbar to manage this key", + "LAST_PASSWORD_RESET_AT": "Last date and time the password has been changed. If Secure Suite General Setting is enabled, the password will expire after 90 days.", + "DTLSCERTFILE": "Link to the valid TLS certificate(.crt file). Default value: '/etc/pki/tls/certs/motion.crt'.", + "DTLSPRIVATEKEY": "Link to the certificate's private key(.key file). Default value: '/etc/pki/tls/private/motion.key'.", + "ALLOWCODECS": "Allowed Codecs in order of preference", + "TRANSPORT": "Set the default transports in order of preference", + "HOST": "How to find the client - IP or host name. If you want the phone to register itself, use the keyword dynamic instead of Host IP", + "NAT": "Changes the behaviour of Asterisk for clients behind a firewall. If any of the comma-separated options is 'no', Asterisk will ignore other settings and set nat=no", + "SIPEXPIRES": "Default: 160", + "SIPPORT": "Default: 5160", + "TYPE": "Determines the SIP role within asterisk. User: used to authenticate incoming - Peer: for outgoing calls - Friend: covers both characteristics of the above", + "CHATCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "MAILCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "FAXCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "SMSCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "WHATSAPPCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "OPENCHANNELCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "CALLGROUP": "The agent's callgroup", + "PICKUPGROUP": "The groups in which the agent can answer calls", + "USERNAME": "Only numbers, letters and specific characters (._) are supported", + "ENCRYPTION": "SRTP (Secure Realtime Protocol) Encryption", + "SAVE_PERMISSIONS": "Every section containing any pending changes will be saved", + "CUSTOM_DASHBOARDS_PERMISSIONS": "Custom Dashboards permissions are managed in the Tools module", + "ENABLEAUTOMATICSCREENRECORDING": "The functionality is available only for voice channel", + "MASK_SENSITIVE_DATA": "Mask any sensitive data throughout the application (e.g. phone numbers and email addresses)", + "WSS_PORT": "Default: 8089", + "AD_SSO_ENABLED": "Login in with your Active Directory credentials" + }, + "NEW_PASSWORD": "New Password", + "CONFIRM_PASSWORD": "Confirm Password", + "CHANGE_PASSWORD": "Change Password", + "CHANGEPASSWORD_AGENT": "Change Password", + "CHANGEPASSWORD_USER": "Change Password", + "CHANGEPASSWORD_TELEPHONE": "Change Password", + "LOGININPAUSE": "Login In Pause", + "HOST": "Host", + "NAT": "NAT", + "CHANSPY": "ChanSpy", + "OTHER_CHANNELS": "Other Channels", + "CHATCAPACITY": "Chat Capacity", + "MAILCAPACITY": "Email Capacity", + "FAXCAPACITY": "Fax Capacity", + "SMSCAPACITY": "Sms Capacity", + "WHATSAPPCAPACITY": "WhatsApp Connector Capacity", + "OPENCHANNELCAPACITY": "Open Channel Capacity", + "MOTIONBAR": "Motion Bar", + "SETTINGS": "Settings", + "AUTOANSWER": "Auto Answer", + "ENABLESETTINGS": "Enable Settings", + "CALL_FORWARDING": "Call Forwarding", + "UNCONDITIONAL": "Unconditional", + "UNCONDITIONALNUMBER": "Unconditional Number", + "NOREPLY": "No Reply", + "NOREPLYNUMBER": "No Reply Number", + "BUSY": "Busy", + "BUSYNUMBER": "Busy Number", + "REMOTE_CONTROL": "Remote Control", + "REMOTECONTROL": "Remote Control", + "REMOTECONTROLPORT": "Remote Control Port", + "SIP": "SIP", + "SIPEXPIRES": "SIP Expires [sec]", + "SIPPORT": "SIP Port", + "PENALTY": "Penalty", + "ACCOUNTNAME": "Account Name", + "ADD_TELEPHONE": "Add Telephone", + "EDIT_TELEPHONE": "Edit Telephone", + "DELETE_TELEPHONE": "Delete Telephone", + "TEAMS": "Teams", + "DELETE_TEAM": "Delete Team", + "AGENTADD_TEAM": "Add Agents to Team", + "EDIT_TEAM": "Edit Team", + "TYPE": "Type", + "TELEPHONES": "Telephones", + "CALLERID": "Caller ID", + "ENABLERECORDING": "Enable Recording", + "STAFF": "Staff", + "ID": "Id", + "NEW_USER": "New User", + "NEW_AGENT": "New Agent", + "NEW_TELEPHONE": "New Telephone", + "NEW_TEAM": "New Team", + "ADD_TEAM": "Add Team", + "JOIN_QUEUE": "Join Queue", + "CAPACITY": "Capacity", + "AUTOINTERNAL": "Auto generate internal number", + "ADD_AGENT_TO_TEAM": "Add Agent to Team", + "TEAMADD_AGENT": "Add Agent to Team", + "NO_AVAILABLE_INFO": "No available info", + "PERMISSIONS": "Permissions", + "ADD_AGENT_TO_QUEUE": "Add Agent to Queue", + "ALL_MODULES_AVAILABLE": "All modules available", + "CALLGROUP": "Call Group", + "PICKUPGROUP": "Pickup Group", + "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Add Agent to Queue Campaigns", + "ADD_AGENT_TO_VOICE_QUEUES": "Add Agent to Voice Queues", + "ADD_AGENT_TO_CHAT_QUEUES": "Add Agent to Chat Queues", + "ADD_AGENT_TO_MAIL_QUEUES": "Add Agent to Email Queues", + "ADD_AGENT_TO_SMS_QUEUES": "Add Agent to SMS Queues", + "ADD_AGENT_TO_WHATSAPP_QUEUES": "Add Agent to WhatsApp Queues", + "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Add Agent to Open Channel Queues", + "ADD_AGENT_TO_FAX_QUEUES": "Add Agent to Fax Queues", + "QUEUEADD_USER_VOICE_INBOUND": "Add User to Voice Queues", + "QUEUEADD_USER_CHAT_INBOUND": "Add User to Chat Queues", + "QUEUEADD_USER_MAIL_INBOUND": "Add User to Email Queues", + "QUEUEADD_USER_SMS_INBOUND": "Add User to SMS Queues", + "QUEUEADD_USER_WHATSAPP_INBOUND": "Add User to WhatsApp Queues", + "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Add User to Open Channel Queues", + "QUEUEADD_USER_FAX_INBOUND": "Add User to Fax Queues", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "SELECTED_AGENTS": "Selected Agents", + "ALL_QUEUE_CAMPAIGNS": "All Queue Campaigns", + "SELECTED_QUEUE_CAMPAIGNS": "Selected Queue Campaigns", + "ALL_VOICE_QUEUES": "All Voice Queues", + "SELECTED_VOICE_QUEUES": "Selected Voice Queues", + "ALL_CHAT_QUEUES": "All Chat Queues", + "SELECTED_CHAT_QUEUES": "Selected Chat Queues", + "ALL_MAIL_QUEUES": "All Email Queues", + "SELECTED_MAIL_QUEUES": "Selected Email Queues", + "ALL_SMS_QUEUES": "All SMS Queues", + "SELECTED_SMS_QUEUES": "Selected SMS Queues", + "ALL_WHATSAPP_QUEUES": "All WhatsApp Queues", + "SELECTED_WHATSAPP_QUEUES": "Selected WhatsApp Queues", + "ALL_OPENCHANNEL_QUEUES": "All Open Channel Queues", + "SELECTED_OPENCHANNEL_QUEUES": "Selected Open Channel Queues", + "ALL_FAX_QUEUES": "All Fax Queues", + "SELECTED_FAX_QUEUES": "Selected Fax Queues", + "VOICEMAIL": "Voicemail", + "SHOWWEBCONTROL": "Typology", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "CALLFORWARDING": "Call Forwarding", + "DND": "Do not disturb during pause", + "UNANSWEREDCALLBADGE": "Show unanswered call badge", + "ENABLEDTMFTONE": "Enable Dtmf tones", + "AUTOANSWERDELAY": "Auto Answer Delay [s]", + "ENCRYPTION": "Encryption", + "CHANNELS": "Channels", + "CHAT": "Chat", + "SMS": "Sms", + "WHATSAPP": "WhatsApp Connector", + "OPENCHANNEL": "Open Channel", + "FAX": "Fax", + "QUEUEADD_USER_VOICE_OUTBOUND": "Add User to Queue Campaigns", + "MONITOREXTENSION": "Record calls to user extension", + "EDITPERMISSIONS": "Editing Permissions", + "READ_PERMISSION": "Read", + "EDIT_PERMISSION": "Edit", + "DELETE_PERMISSION": "Delete", + "GENERAL_PERMISSIONS": "General", + "ENABLEMESSENGER": "Enable Internal Messenger", + "OUTBOUNDPROXY": "Oubound Proxy", + "PHONE": "Phone", + "MOBILE": "Mobile", + "PREFIXREQUIRED": "Prefix Required", + "MANAGE_PERMISSIONS": "Manage Permissions", + "USERADD_VOICEQUEUES": "Add Voice Queue to User", + "ALL_VOICEQUEUES": "All Voice Queues", + "SELECTED_VOICEQUEUES": "Selected Voice Queues", + "USERADD_CHATQUEUES": "Add Chat Queue to User", + "ALL_CHATQUEUES": "All Chat Queues", + "SELECTED_CHATQUEUES": "Selected Email Queues", + "USERADD_MAILQUEUES": "Add Email Queue to User", + "ALL_MAILQUEUES": "All Email Queues", + "SELECTED_MAILQUEUES": "Selected Chat Queues", + "USERADD_SMSQUEUES": "Add SMS Queue to User", + "ALL_SMSQUEUES": "All SMS Queues", + "SELECTED_SMSQUEUES": "Selected SMS Queues", + "USERADD_WHATSAPPQUEUES": "Add Whataspp Queue to User", + "ALL_WHATSAPPQUEUES": "All Whataspp Queues", + "SELECTED_WHATSAPPQUEUES": "Selected WhatsApp Queues", + "USERADD_FAXQUEUES": "Add Fax Queue to User", + "ALL_FAXQUEUES": "All Fax Queues", + "SELECTED_FAXQUEUES": "Selected Fax Queues", + "USERADD_OPENCHANNELQUEUES": "Add Open Channel Queue to User", + "ALL_OPENCHANNELQUEUES": "All Open Channel Queues", + "SELECTED_OPENCHANNELQUEUES": "Selected Open Channel Queues", + "USERADD_PROJECTS": "Add Cally Square Project to User", + "ALL_PROJECTS": "All Cally Square Projects", + "SELECTED_PROJECTS": "Selected Cally Square Projects", + "USERADD_CHATWEBSITES": "Add Chat Website to User", + "ALL_CHATWEBSITES": "All Chat Websites", + "SELECTED_CHATWEBSITES": "Selected Chat Websites", + "USERADD_QUEUECAMPAIGNS": "Add Queue Campaign to User", + "ALL_QUEUECAMPAIGNS": "All Queue Campaigns", + "SELECTED_QUEUECAMPAIGNS": "Selected Queue Campaigns", + "USERADD_MAILACCOUNTS": "Add Email Account to User", + "ALL_MAILACCOUNTS": "All Email Accounts", + "SELECTED_MAILACCOUNTS": "Selected Email Accounts", + "USERADD_FAXACCOUNTS": "Add Fax Account to User", + "ALL_FAXACCOUNTS": "All Fax Accounts", + "SELECTED_FAXACCOUNTS": "Selected Fax Accounts", + "USERADD_SMSACCOUNTS": "Add SMS Account to User", + "ALL_SMSACCOUNTS": "All SMS Accounts", + "SELECTED_SMSACCOUNTS": "Selected SMS Accounts", + "USERADD_WHATSAPPACCOUNTS": "Add WhatsApp Account to User", + "ALL_WHATSAPPACCOUNTS": "All WhatsApp Accounts", + "SELECTED_WHATSAPPACCOUNTS": "Selected WhatsApp Accounts", + "USERADD_OPENCHANNELACCOUNTS": "Add Open Channel Account to User", + "ALL_OPENCHANNELACCOUNTS": "All Open Channel Accounts", + "SELECTED_OPENCHANNELACCOUNTS": "Selected Open Channel Accounts", + "USERPROFILES": "User Profiles", + "USERPROFILE": "User Profile", + "NEW_USERPROFILE": "New User Profile", + "ADD_USERPROFILE": "Add User Profile", + "EDIT_USERPROFILE": "Edit User Profile", + "CLONE_USERPROFILE": "Clone User Profile", + "DELETE_USERPROFILE": "Delete User Profile", + "CRUDPERMISSIONS": "Permission Type", + "SECTIONS": "Sections", + "MODULES": "Modules", + "SUMMARY": "Summary", + "REPORT_TYPE": "Report Type", + "PERMISSIONS_MANAGE": "Manage", + "PERMISSIONS_SECTION_TITLE": "{{sectionName}} Permissions", + "PERMISSIONS_AUTO_ASSOCIATION_INFO": "Automatically associate every current and future resource of this section to the User Profile", + "PERMISSIONS_PLACEHOLDER_SEARCH": "Search...", + "PERMISSIONS_SELECT_SECTION": "Select a section", + "PERMISSIONS_SELECT_REPORT_TYPE": "Select report type", + "PERMISSIONS_ALL_RESOURCES": "All resources", + "PERMISSIONS_SELECTED_RESOURCES": "Selected resources", + "PERMISSIONS_SECTION_HIDE": "Hide section to the User", + "PERMISSIONS_SECTION_SHOW": "Show section to the User", + "PERMISSIONS_WARNING_ENABLE_ALL": "All {{sectionName}} subsections and their resources will be enabled. Are you sure you want to continue?", + "PERMISSIONS_WARNING_CLOSE": "You have unsaved changes. Are you sure you want to exit without saving?", + "NOTIFICATIONS": { + "PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE": "{{sectionName}} section enabled", + "PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE": "All {{sectionName}} resources have been added to {{userProfileName}} User Profile", + "PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES": "{{sectionName}} has been added to {{userProfileName}} User Profile", + "PERMISSIONS_DISABLED_ALL_SUCCESS_TITLE": "{{sectionName}} section disabled", + "PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE": "All {{sectionName}} resources have been removed from {{userProfileName}} User Profile", + "PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES": "{{sectionName}} has been removed from {{userProfileName}} User Profile", + "PERMISSIONS_SAVED_SUCCESS_TITLE": "{{sectionName}} section saved", + "PERMISSIONS_SAVED_SUCCESS_MESSAGE": "Permissions successfully updated!" + }, + "CONFIRM": "Confirm", + "CANCEL": "Cancel", + "CLOSE": "Close", + "QUEUES_ASSOCIATION": "{{channel}} Queues Association", + "TEAMS_ASSOCIATION": "Teams Association", + "PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE": "Unauthorized action", + "PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE": "You are not allowed to access the selected section", + "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "You are not allowed to create the resource", + "MASK_SENSITIVE_DATA": "Mask Sensitive Data", + "WSS_PORT": "WSS Port", + "DOWNLOADS": "Downloads", + "DOWNLOAD_PERMISSIONS": "Download Permissions", + "VOICE_RECORDINGS": "Voice Recordings", + "OMNICHANNEL_INTERACTIONS": "Omnichannel Interactions", + "ATTACHMENTS": "Attachments", + "SCREEN_RECORDINGS": "Screen Recordings", + "JSCRIPTY_SESSIONS": "Jscripty Sessions", + "CONTACT_MANAGER_LISTS": "Contact Manager Lists", + "CALLYSQUARE_RECORDINGS": "Cally Square Recordings", + "IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS": "Ignore agent break status for preview calls", + "SELECT_RECALLME_CAMPAIGN": "Select Recall Me Campaign", + "CLIENT_LOGS": "Client Logs", + "CLIENT_LOGS_DISABLED": "Client logs are disabled", + "CLIENT_LOGS_ENABLED": "Client logs are enabled", + "CLIENT_LOGS_LOGLEVEL_SELECT": "Select min logging level (severity)", + "CLIENT_LOGS_LOGLEVEL": "Log level: {{logLevel}}", + "CLIENT_LOGS_ENABLED_SINCE": "Enabled since: {{enabledSince}}", + "CLIENT_LOGS_ENABLED_MSG": "Client logs have been enabled for your user", + "CLIENT_LOGS_DISABLED_MSG": "Client logs have been disabled for your user", + "CLIENT_LOGS_ALL_ENABLED_WARNING": "Warning: this could severely affect server performances if many agents are logged in at the same time!", + "QUEUEADD_AGENT_VOICE_OUTBOUND": "Add Agent to Queue Campaigns", + "QUEUEADD_AGENT_VOICE_INBOUND": "Add Agent to Voice Queues", + "QUEUEADD_AGENT_CHAT_INBOUND": "Add Agent to Chat Queues", + "QUEUEADD_AGENT_MAIL_INBOUND": "Add Agent to Email Queues", + "QUEUEADD_AGENT_SMS_INBOUND": "Add Agent to SMS Queues", + "QUEUEADD_AGENT_WHATSAPP_INBOUND": "Add Agent to WhatsApp Queues", + "QUEUEADD_AGENT_OPENCHANNEL_INBOUND": "Add Agent to Open Channel Queues", + "QUEUEADD_AGENT_FAX_INBOUND": "Add Agent to Fax Queues", + "ALL_QUEUES_VOICE_OUTBOUND": "All Queue Campaigns", + "SELECTED_QUEUES_VOICE_OUTBOUND": "Selected Queue Campaigns", + "ALL_QUEUES_VOICE_INBOUND": "All Voice Queues", + "SELECTED_QUEUES_VOICE_INBOUND": "Selected Voice Queues", + "ALL_QUEUES_CHAT_INBOUND": "All Chat Queues", + "SELECTED_QUEUES_CHAT_INBOUND": "Selected Chat Queues", + "ALL_QUEUES_MAIL_INBOUND": "All Email Queues", + "SELECTED_QUEUES_MAIL_INBOUND": "Selected Email Queues", + "ALL_QUEUES_SMS_INBOUND": "All SMS Queues", + "SELECTED_QUEUES_SMS_INBOUND": "Selected SMS Queues", + "ALL_QUEUES_WHATSAPP_INBOUND": "All WhatsApp Queues", + "SELECTED_QUEUES_WHATSAPP_INBOUND": "Selected WhatsApp Queues", + "ALL_QUEUES_OPENCHANNEL_INBOUND": "All Open Channel Queues", + "SELECTED_QUEUES_OPENCHANNEL_INBOUND": "Selected Open Channel Queues", + "ALL_QUEUES_FAX_INBOUND": "All Fax Queues", + "SELECTED_QUEUES_FAX_INBOUND": "Selected Fax Queues" + } +} diff --git a/public/app/main/apps/tools/i18n/bs.json b/public/app/main/apps/tools/i18n/bs.json index 306ec24..cbafa39 100644 --- a/public/app/main/apps/tools/i18n/bs.json +++ b/public/app/main/apps/tools/i18n/bs.json @@ -1,528 +1,528 @@ { "TOOLS": { - "VIDEOSUPPORT": "Video support", - "PREVIOUSCONTACT": "Previous", + "VIDEOSUPPORT": "Video podrška", + "PREVIOUSCONTACT": "Prethodni", "BOT": "Voicebot", - "CLONE_TRUNK": "Clone Trunk", - "DISPOSITIONS": "Dispositions", - "NEW_DISPOSITION": "New Disposition", - "ADD_DISPOSITION": "Add Disposition", - "EDIT_DISPOSITION": "Edit Disposition", - "DELETE_DISPOSITION": "Delete Disposition", - "RUN_SCHEDULE": "Run schedule", - "SENDIFEMPTY": "Send if empty", - "NEXTCONTACT": "Next", - "OUTBOUND_ROUTE": "Outbound Route", - "EDIT_DASHBOARDITEM": "Edit Dashboard Widget", - "FONTSIZE": "Font Size", - "TITLEFONTSIZE": "Font Title Size", - "CLONE_CUSTOMDASHBOARD": "Clone Custom Dashboard", + "CLONE_TRUNK": "Kloniraj Trunk", + "DISPOSITIONS": "Dispozicije", + "NEW_DISPOSITION": "Nova Dispozicija", + "ADD_DISPOSITION": "Dodaj Dispoziciju", + "EDIT_DISPOSITION": "Uredi Dispoziciju", + "DELETE_DISPOSITION": "Izbriši Dispoziciju", + "RUN_SCHEDULE": "Pokreni raspored", + "SENDIFEMPTY": "Pošalji ako je prazno", + "NEXTCONTACT": "Sljedeći", + "OUTBOUND_ROUTE": "Odlazna Ruta", + "EDIT_DASHBOARDITEM": "Uredi Widget Table", + "FONTSIZE": "Veličina Fonta", + "TITLEFONTSIZE": "Veličina Fonta Naslova", + "CLONE_CUSTOMDASHBOARD": "Kloniraj Prilagođenu Tablu", "LINK": "Link [https://]", - "BACKGROUND": "Background", + "BACKGROUND": "Pozadina", "FOREGROUND": "Foreground", - "IGNOREDIALERCONTACTID": "Ignore dialer contact Id", - "NONE": "None", - "TOTAL": "Total", - "ABANDONED": "Abandoned", - "WAITING": "Waiting", - "TALKING": "Talking", - "ANSWERED": "Answered", - "CONTACTITEMTYPE": "Contact item types", - "ORDER_BY": "Order by", - "RGBBACKGROUNDCOLOR": "RGB Background color", - "NEW_CONTACTITEMTYPE": "New contact item type", - "EDIT_CONTACTITEMTYPE": "Edit contact item type", - "DELETE_CONTACTITEMTYPE": "Delete contact item type", - "ORDER_BY_NUMERIC": "Order by field should be numeric value!", - "ADD_CONTACTITEMTYPE": "Add", - "UNMANAGED": "Unmanaged", - "CUSTOMTYPE": "Custom [path]", - "WEBREPORT": "Web Report", - "PIECHART": "Pie Chart", - "MULTIBARCHART": "Multibar Chart", - "MOVE_WIDGET": "Move Widget", - "USERADD_CUSTOMDASHBOARD": "Add User Permissions", - "GOTODASHBOARD_CUSTOMDASHBOARD": "Go to preview dashboard", - "GOTO_CUSTOMDASHBOARD": "Go to preview dashboard", - "METRIC": "Metric", - "FILTERVOICEQUEUES": "Filter Voice Queues", - "SERIE1": "Serie 1", - "SERIE2": "Serie 2", - "SERIE3": "Serie 3", - "REFRESH": "Refresh [s]", + "IGNOREDIALERCONTACTID": "Ingoriši pozivatelj kondakt ID", + "NONE": "Ništa", + "TOTAL": "Ukupno", + "ABANDONED": "Napušteno", + "WAITING": "Čeka", + "TALKING": "Priča", + "ANSWERED": "Odgovorio", + "CONTACTITEMTYPE": "Kontakt vrste stavki", + "ORDER_BY": "Poredaj po", + "RGBBACKGROUNDCOLOR": "RGB Pozadinska boja", + "NEW_CONTACTITEMTYPE": "Nova vrsta kontakt stavke", + "EDIT_CONTACTITEMTYPE": "Uredi kontakt vrstu stavke", + "DELETE_CONTACTITEMTYPE": "Izbriši kontakt vrstu stavke", + "ORDER_BY_NUMERIC": "Poredaj po polje treba biti numeričke vrijednosti!", + "ADD_CONTACTITEMTYPE": "Dodaj", + "UNMANAGED": "Neupravljan", + "CUSTOMTYPE": "Prilagođeno [path]", + "WEBREPORT": "Web Izvještaj", + "PIECHART": "Pie Grafikon", + "MULTIBARCHART": "Multibar Grafikon", + "MOVE_WIDGET": "Pomjeri Widget", + "USERADD_CUSTOMDASHBOARD": "Dodaj Korisniku Prava", + "GOTODASHBOARD_CUSTOMDASHBOARD": "Idi na pregled table", + "GOTO_CUSTOMDASHBOARD": "Idi na pregled table", + "METRIC": "Metrika", + "FILTERVOICEQUEUES": "Filtriraj Voice Queues", + "SERIE1": "Serija¸1", + "SERIE2": "Serija 2", + "SERIE3": "Serija 3", + "REFRESH": "Osvježi [s]", "FORMAT": "Format", - "PATH": "Absolute Path", - "ALL_USERS": "All Users", - "SELECTED_USERS": "Selected Users", - "ADD_WIDGET": "Add Widget", - "COLOR": "Color", + "PATH": "Apsolutni Put", + "ALL_USERS": "Svi Korisnici", + "SELECTED_USERS": "Odabrani Korisnici", + "ADD_WIDGET": "Dodaj Widget", + "COLOR": "Boja", "FAX": "Fax", - "INTERACTION": "Interaction", - "MESSAGE": "Message", + "INTERACTION": "Interakcija", + "MESSAGE": "Poruka", "T38PT_UDPTL": "T38pt Udptl", - "CALL": "Call", - "NAME": "Name", - "TRUNKS": "Trunks", - "SEARCH_FOR_ANYONE": "Search", - "SCRIPT": "Script", + "CALL": "Poziv", + "NAME": "Naziv", + "TRUNKS": "Trunkovi", + "SEARCH_FOR_ANYONE": "Traži", + "SCRIPT": "Skripta", "SCRIPT_INFO": "Info", - "SCRIPT_TYPE": "Type", - "EMAIL": "Email", - "FILTERFAXACCOUNTS": "Filter Fax Accounts", - "FILTERSMSACCOUNTS": "Filter Sms Accounts", - "FILTERCHATWEBSITES": "Filter Chat Websites", - "FILTERWHATSAPPACCOUNTS": "Filter Whatsapp Accounts", - "FILTEREMAILACCOUNTS": "Filter Email Accounts", - "FILTEROPENCHANNELACCOUNTS": "Filter OpenChannel Accounts", - "OPENED": "Opened", - "OPENED_TEXT": "Opened Interactions", - "MANAGED": "Managed", - "MANAGED_TEXT": "Managed Interactions", + "SCRIPT_TYPE": "Vrsta", + "EMAIL": "E-Mail", + "FILTERFAXACCOUNTS": "Filtriraj Fax Naloge", + "FILTERSMSACCOUNTS": "Filtriraj SMS Naloge", + "FILTERCHATWEBSITES": "Filtriraj Chat Webstranice", + "FILTERWHATSAPPACCOUNTS": "Filtriraj WhatsApp Naloge", + "FILTEREMAILACCOUNTS": "Filtriraj E-Mail Naloge", + "FILTEROPENCHANNELACCOUNTS": "Filtriraj Otvoreni Kanal Naloge", + "OPENED": "Otvoreno", + "OPENED_TEXT": "Otvorene Interakcije", + "MANAGED": "Upravljano", + "MANAGED_TEXT": "Upravljane Interakcije", "ERRORS": { - "INFO_REQUIRED": "Mandatory field", - "SCRIPT_REQUIRED": "Mandatory field", - "NAME_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "TITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "REFRESH_REQUIRED": "Mandatory field", - "FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FONTSIZE_REQUIRED": "Mandatory field", - "PATH_REQUIRED": "Mandatory field", - "FORMAT_REQUIRED": "Mandatory field", - "REPORT_REQUIRED": "Mandatory field", - "TYPE_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "ACCOUNT_REQUIRED": "Mandatory field", - "IGNOREDIALERCONTACTID_REQUIRED": "Ignore dialer contact Id field is required", - "FIELD_REQUIRED": "Mandatory field", - "NAME_REQUIRED": "Mandatory field", - "HOST_REQUIRED": "Mandatory field", - "DEFAULTUSER_REQUIRED": "Mandatory field", - "CALLERID_REQUIRED": "Mandatory field", - "KEY_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The Passwords don't match", - "VALIDITYSTART_REQUIRED": "Mandatory field", - "VALIDITYEND_REQUIRED": "Mandatory field", - "MONTHDAY_REQUIRED": "Mandatory field", - "HOUR_REQUIRED": "Mandatory field", - "CONTENT_REQUIRED": "Mandatory field", - "URL_REQUIRED": "Mandatory field", - "URL_MUST_VALID_URL": "Wrong format", - "APPLICATION_REQUIRED": "Mandatory field", - "ARGUMENTS_REQUIRED": "Mandatory field", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "POLLING_INTERVAL_REQUIRED": "Mandatory field", - "TITLE_REQUIRED": "Mandatory field", - "EMAILADDRESS_REQUIRED": "Mandatory field", - "EVENTVARIABLES_REQUIRED": "Mandatory field", - "INTEGRATION_REQUIRED": "Mandatory field", - "LIST_REQUIRED": "Mandatory field", - "TEMPLATE_REQUIRED": "Mandatory field", - "AUTOCREATECONTACT_REQUIRED": "Mandatory field", - "AUTOCREATE_FIELD_REQUIRED": "Mandatory field", - "OUTBOUNDROUTE_REQUIRED": "Mandatory field", - "QUEUE_REQUIRED": "Mandatory field", - "TIME_RANGE_TO_REQUIRED": "Mandatory field", - "WEEK_DAYS_TO_REQUIRED": "Mandatory field", - "MONTH_DAYS_TO_REQUIRED": "Mandatory field", - "MONTH_TO_REQUIRED": "Mandatory field", - "TIME_RANGE_FROM_INVALID": "Wrong Format", - "TIME_RANGE_TO_INVALID": "Wrong Format", - "ACTION_REQUIRED": "Mandatory field", - "CONFIGURATION_REQUIRED": "Mandatory field", - "PROJECT_REQUIRED": "Mandatory field", - "LOCATION_REQUIRED": "Mandatory field", - "OUTPUT_REQUIRED": "Mandatory field", - "REPORTTYPE_REQUIRED": "Mandatory field", - "REPORTFOLDER_REQUIRED": "Mandatory field", - "REPORTSUBFOLDER_REQUIRED": "Mandatory field", - "AGENT_REQUIRED": "Mandatory field", - "TIMEOUT_REQUIRED": "Mandatory field", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CHANNEL_REQUIRED": "Mandatory field" + "INFO_REQUIRED": "Obavezno polje", + "SCRIPT_REQUIRED": "Obavezno polje", + "NAME_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "TITLE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "REFRESH_REQUIRED": "Obavezno polje", + "FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "FONTSIZE_REQUIRED": "Obavezno polje", + "PATH_REQUIRED": "Obavezno polje", + "FORMAT_REQUIRED": "Obavezno polje", + "REPORT_REQUIRED": "Obavezno polje", + "TYPE_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "ACCOUNT_REQUIRED": "Obavezno polje", + "IGNOREDIALERCONTACTID_REQUIRED": "Zanemari birač kontakt ID polja je obavezno", + "FIELD_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "HOST_REQUIRED": "Obavezno polje", + "DEFAULTUSER_REQUIRED": "Obavezno polje", + "CALLERID_REQUIRED": "Obavezno polje", + "KEY_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinske se ne podudaraju", + "VALIDITYSTART_REQUIRED": "Obavezno polje", + "VALIDITYEND_REQUIRED": "Obavezno polje", + "MONTHDAY_REQUIRED": "Obavezno polje", + "HOUR_REQUIRED": "Obavezno polje", + "CONTENT_REQUIRED": "Obavezno polje", + "URL_REQUIRED": "Obavezno polje", + "URL_MUST_VALID_URL": "Pogrešan format", + "APPLICATION_REQUIRED": "Obavezno polje", + "ARGUMENTS_REQUIRED": "Obavezno polje", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "POLLING_INTERVAL_REQUIRED": "Obavezno polje", + "TITLE_REQUIRED": "Obavezno polje", + "EMAILADDRESS_REQUIRED": "Obavezno polje", + "EVENTVARIABLES_REQUIRED": "Obavezno polje", + "INTEGRATION_REQUIRED": "Obavezno polje", + "LIST_REQUIRED": "Obavezno polje", + "TEMPLATE_REQUIRED": "Obavezno polje", + "AUTOCREATECONTACT_REQUIRED": "Obavezno polje", + "AUTOCREATE_FIELD_REQUIRED": "Obavezno polje", + "OUTBOUNDROUTE_REQUIRED": "Obavezno polje", + "QUEUE_REQUIRED": "Obavezno polje", + "TIME_RANGE_TO_REQUIRED": "Obavezno polje", + "WEEK_DAYS_TO_REQUIRED": "Obavezno polje", + "MONTH_DAYS_TO_REQUIRED": "Obavezno polje", + "MONTH_TO_REQUIRED": "Obavezno polje", + "TIME_RANGE_FROM_INVALID": "Pogrešan format", + "TIME_RANGE_TO_INVALID": "Pogrešan format", + "ACTION_REQUIRED": "Obavezno polje", + "CONFIGURATION_REQUIRED": "Obavezno polje", + "PROJECT_REQUIRED": "Obavezno polje", + "LOCATION_REQUIRED": "Obavezno polje", + "OUTPUT_REQUIRED": "Obavezno polje", + "REPORTTYPE_REQUIRED": "Obavezno polje", + "REPORTFOLDER_REQUIRED": "Obavezno polje", + "REPORTSUBFOLDER_REQUIRED": "Obavezno polje", + "AGENT_REQUIRED": "Obavezno polje", + "TIMEOUT_REQUIRED": "Obavezno polje", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CHANNEL_REQUIRED": "Obavezno polje" }, "HOST": "Host", - "SECRET": "Secret", - "DEFAULTUSER": "Default User", - "DESCRIPTION": "Description", - "ADD_TRUNK": "Add Trunk", + "SECRET": "Tajni", + "DEFAULTUSER": "Zadani Korisnik", + "DESCRIPTION": "Opis", + "ADD_TRUNK": "Dodaj Trunk", "HELP": { - "OPENED": "The total number of Active Interactions", - "MANAGED": "The total number of Completed Interactions", - "SCRIPT_INFO": "Insert a description for the script", - "SCRIPT_TYPE": "Insert a typology for the script (eg. curl, bash...)", - "INFO": "Insert title", - "SCRIPT": "Insert script", + "OPENED": "Ukupan broj Aktivnih Interakcija", + "MANAGED": "Ukupan broj Završenih Interakcija", + "SCRIPT_INFO": "Ubaci opis za skriptu", + "SCRIPT_TYPE": "Ubaci tiplogiju za skriptu (npr. curl, bash...)", + "INFO": "Unesti naslov", + "SCRIPT": "Ubaci skriptu", "T38PT_UDPTL": "Es: yes,redundancy,maxdatagram=400", - "SECRET": "Authentication password", - "HOST": "The domain or host name", - "DEFAULTUSER": "Authentication username", - "CALLERID": "The Caller ID, in the format \"name\" ", - "REGISTRY": "The registry string, if required by provider, usually defaultuser:secret@host", - "FROMDOMAIN": "Set default From:domain in SIP messages when acting as a SIP ua (client). Some destinations may require mandatory identity name instead of only the IP address", - "FROMUSER": "How your provider knows you. This is which user to put instead of callerid when placing calls to peer (another SIP proxy). Valid only for type=peer.", - "OUTBOUNDPROXY": "IP_address or DNS SRV name (excluding the _sip._udp prefix): SRV name, hostname, or IP address of the outbound SIP Proxy. Send outbound signaling to this proxy, not directly to the devices. Valid only for type=peer.", - "PORT": "The SIP port number", - "CONTEXT": "The context for the trunk", - "TYPE": "Determine the SIP role within asterisk. User: used to authenticate incoming - Peer: for outgoing calls - Friend: covers both characteristics of the above.", - "DTMFMODE": "How DTMF (Dual-Tone Multi-Frequency) are sent. RFC2833: the default mode, the DTMF are sent with RTP but outside the audio stream. INBAND: The DTMF is sent in audio stream of the current conversation, becoming audible from the speakers. Requires a high CPU load. INFO: Although this method is very reliable, it is not supported by all PBX devices and many SIP Trunks.", - "NAT": "Change the behaviour of Asterisk for clients behind a firewall. If any of the comma-separated options is 'no', Asterisk will ignore any other settings and set nat=no.", - "QUALIFY": "Determine when the SIP is achievable", - "ALLOWCODECS": "Allowed codecs in order of preference", - "INSECURE": "Specify how to handle connections with peer, allowing insecure settings", - "CALL_LIMIT": "The limit number of the inbound and outbound concurrent calls", - "DIRECTMEDIA": "Asterisk by default tries to redirect the RTP media stream to go directly from the caller to the callee. Some devices do not support this (especially if one of them is behind a NAT). The default setting is YES. If you have all clients behind a NAT, or for some other reason want Asterisk to stay in the audio path, you may want to turn this off.", - "CALLCOUNTER": "Enable call counters on devices", - "ADD_PHONE_TO_URI": "Define if the provider requires ';user=phone' on URL", - "TRUST_REMOTE_PARTY_ID": "Define if Remote-Party-ID should be trusted", - "SEND_REMOTE_PARTY_ID_HEADER": "Define if Remote-Party-ID should be sent (defaults is no)", - "ENCRYPTION": "Whether to offer SRTP encrypted media (and only SRTP encrypted media) on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if the peer does not support SRTP. Defaults value is No", - "TRANSPORT": "Set the default transports, in order of preference", - "OTHERFIELDS": "Other fields to add in the trunks conf files. Follow default asterisk format (key=value), each field on a single row", - "EMAILADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "EMAILCCADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "EMAILBCCADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "EVENTVARIABLES": "If enabled, it adds all the event variables to the url (recommended value=No. Set to Yes only for evaluation purposes) ", - "HEADERS": "Note: Headers section must be in RAW JSON format {\"key\":\"value\"} \nNote: If not filled out, the default value will be sent", - "BODY": "Note: the body must be in RAW JSON format {\"key\":\"value\"} \nNote: If not filled out, the default value will be sent", - "TIMEOUT": "Request timeout in seconds. The value must be between 1 and 10 and the default value is 5." + "SECRET": "Lozinka za autentifikaciju", + "HOST": "Naziv domene ili hosta", + "DEFAULTUSER": "Korisničko ime za autentifikaciju", + "CALLERID": "Pozivatelj ID, u formatu \"ime\" ", + "REGISTRY": "String registratora, ako to zahtijeva provajder, obično zadanikorisnik:secret@host", + "FROMDOMAIN": "Postavi zadano Od:domena u SIP porukama kada djeluje kao SIP ua (klijent). Neka odredišta mogu zahtijevati obavezno ime identiteta umjesto samo IP adrese", + "FROMUSER": "Kako te tvoj provajder prepoznaje. Ovo je kojeg korisnika treba postaviti umjesto Pozivatelj IDa kada upućuje poziv peeru (drugi SIP proxy). Vrijedi samo za type=peer.", + "OUTBOUNDPROXY": "IP adresa ili DNS SRV naziv (isključujući _sip._udp prefiks): SRV naziv, naziv hosta ili IP adresa odlaznog SIP Proxy. Šalji odlazni signal na ovaj proxy, a ne direktno na uređaje. Vrijedi samo za type=peer.", + "PORT": "Broj SIP porta", + "CONTEXT": "Kontekst za Trunk", + "TYPE": "Odredi SIP ulogu unutar asteriska. Korisnik: koristi se za autentifikaciju dolaznih - Peer: za odlazne pozive - Prijatelj: pokriva obje gore navedene karakteristike.", + "DTMFMODE": "Kako se DTMF (Dual-Tone Multi-Frequency) šalje. RFC2833: zadani način rada, DTMF se šalju sa RTPom, ali izvan audio streama. INBAND: DTMF se šalje u audio streamu trenutne konverzacije, postajući čujni iz zvučnika. Zahtijeva veliko CPU opterećenje. INFORMACIJE: Iako je ovaj metod vrlo pouzdan, ne podržavaju ga svi PBX uređaji i mnogi SIP Trunkovi.", + "NAT": "Promijeni ponašanje Asteriska za klijente iza firewalla. Ako je bilo koja od opcija razdvojenih zarezima 'ne', Asterisk će zanemariti sve druge postavke i postaviti nat=no.", + "QUALIFY": "Odredi kada je SIP dostupan", + "ALLOWCODECS": "Dozvoljeni kodeci prema željenom redoslijedu", + "INSECURE": "Odredi kako se rukovati vezama sa peer, dozvoljavajući nesigurne postavke", + "CALL_LIMIT": "Broj ograničenja dolaznih i odlaznih istovremenih poziva", + "DIRECTMEDIA": "Asterisk zadano pokušava da preusmjeri RTP medijski stream da ide direktno od pozivatelja do pozvanog. Neki uređaji to ne podržavaju (posebno ako je jedan od njih iza NATa). Zadana postavka je DA. Ako imate sve klijente iza NATa, ili iz nekog drugog razloga želite da Asterisk ostane na audio putanji, možda biste trebali ovo isključiti.", + "CALLCOUNTER": "Omogući brojače poziva na uređajima", + "ADD_PHONE_TO_URI": "Definiraj da li provajder zahtijeva ';user=phone' na URLu", + "TRUST_REMOTE_PARTY_ID": "Definiši da li se Remote-party-ID treba vjerovati", + "SEND_REMOTE_PARTY_ID_HEADER": "Definiši da li Remote-Party-ID treba biti poslan (zadano je ne)", + "ENCRYPTION": "Da li ponuditi SRTP šifrirane medije (i samo SRTP šifrirane medije) za odlazne pozive prema peer. Pozivi će biti neuspješni sa HANGUPCAUSE=58 ako peer ne podržava SRTP. Zadana vrijednost je Ne", + "TRANSPORT": "Postaiv zadane transporte, prema željenom rasporedu", + "OTHERFIELDS": "Ostala polja za dodavanje u trunk .conf datoteke. Slijedi zadani asterisk format (key=value), svako polje u jednom redu", + "EMAILADDRESS": "Dodaj jednu ili više adresa odvojenih zarezima (npr. din.becirovic@toyota.ba, semir.seferovic@toyota.ba)", + "EMAILCCADDRESS": "Dodaj jednu ili više adresa odvojenih zarezima (npr. din.becirovic@toyota.ba, semir.seferovic@toyota.ba)", + "EMAILBCCADDRESS": "Dodaj jednu ili više adresa odvojenih zarezima (npr. din.becirovic@toyota.ba, semir.seferovic@toyota.ba)", + "NAME": "Samo brojevi, slova i specifični znakovi (._) su podržani", + "EVENTVARIABLES": "Ako je omogućeno, dodaje sve varijable događaja u URL (preporučena vrijednost=Ne. Postavite na Da samo u svrhu evaluacije)", + "HEADERS": "Napomena: odjeljak zaglavlja mora biti u RAW JSON formatu {\"key\":\"value\"} \nNapomena: Ako nije popunjen, bit će poslana zadana vrijednost", + "BODY": "Napomena: tijelo mora biti u RAW JSON formatu {\"key\":\"value\"} \nNapomena: Ako nije popunjeno, bit će poslana zadana vrijednost", + "TIMEOUT": "Timeout zahtjev u sekundama. Vrijednost mora biti između 1 i 10, zadana verzija je 5." }, - "EDIT_TRUNK": "Edit Trunk", - "DELETE_TRUNK": "Delete Trunk", - "CREATED_AT": "Created At", - "SETTINGS": "Settings", - "ADVANCED": "Advanced", - "OTHER": "Other", - "ACTIVE": "Active", - "CONTEXT": "Context", - "CALLERID": "Caller ID", - "TYPE": "Type", - "DTMFMODE": "DTMF Mode", + "EDIT_TRUNK": "Uredi Trunk", + "DELETE_TRUNK": "IZbriši Trunk", + "CREATED_AT": "Kreirano U", + "SETTINGS": "Postavke", + "ADVANCED": "Napredno", + "OTHER": "Ostao", + "ACTIVE": "Aktivno", + "CONTEXT": "Kontekst", + "CALLERID": "Pozivatelj ID", + "TYPE": "Vrsta", + "DTMFMODE": "DTMF Način rada", "NAT": "NAT", - "QUALIFY": "Qualify", - "ALLOWCODECS": "Allowed Codecs", - "INSECURE": "Insecure", - "REGISTRY": "Registry", - "DIRECTMEDIA": "Direct Media", - "CALLCOUNTER": "Call Counter", - "FROMDOMAIN": "From Domain", - "FROMUSER": "From User", - "OUTBOUNDPROXY": "Outbound Proxy", - "ADD_PHONE_TO_URI": "Add Phone to URL", + "QUALIFY": "Kvalifikuj", + "ALLOWCODECS": "Dozvoljeni Kodeci:", + "INSECURE": "Nesiugran", + "REGISTRY": "Registart", + "DIRECTMEDIA": "Direktni Medij", + "CALLCOUNTER": "Brojač Poziva", + "FROMDOMAIN": "Iz Domene", + "FROMUSER": "Od Korisnika", + "OUTBOUNDPROXY": "Odlazni Proxy", + "ADD_PHONE_TO_URI": "Dodaj Telefon u URL", "TRUST_REMOTE_PARTY_ID": "Trust Remote Party ID", - "SEND_REMOTE_PARTY_ID_HEADER": "Send Remote Party ID Header", - "ENCRYPTION": "Encryption", + "SEND_REMOTE_PARTY_ID_HEADER": "Pošalji Remote Party ID Zaglavlje", + "ENCRYPTION": "Enkripcija", "PORT": "Port", "TRANSPORT": "Transport", - "SAVE": "Save", - "VARIABLES": "Variables", - "ADD_VARIABLE": "Add Variable", - "EDIT_VARIABLE": "Edit Variable", - "DELETE_VARIABLE": "Delete Variable", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "TAGS": "Tags", - "ADD_TAG": "Add Tag", - "EDIT_TAG": "Edit Tag", - "DELETE_TAG": "Delete Tag", - "PAUSES": "Pauses", - "ADD_PAUSE": "Add Pause", - "EDIT_PAUSE": "Edit Pause", - "DELETE_PAUSE": "Delete Pause", - "CANNEDANSWERS": "Canned Answers", - "ADD_CANNEDANSWER": "Add Canned Answer", - "EDIT_CANNEDANSWER": "Edit Canned Answer", - "DELETE_CANNEDANSWER": "Delete Canned Answer", - "KEY": "Key", - "VALUE": "Value", - "SOUNDS": "Sounds", - "EDIT_SOUND": "Edit Sound", - "DELETE_SOUND": "Delete Sound", - "CANCEL": "Cancel", - "FINISH": "Finish", - "DROP_TO_UPLOAD": "Drop To Upload", - "UPLOADING": "Uploading", - "TRIGGERS": "Triggers", - "EDIT_TRIGGER": "Edit Trigger", - "DELETE_TRIGGER": "Delete Trigger", - "ADD_TRIGGER": "Add Trigger", - "DELETE": "Delete", - "AUTOMATIONS": "Automations", - "EDIT_AUTOMATION": "Edit Automation", - "DELETE_AUTOMATION": "Delete Automation", - "ADD_AUTOMATION": "Add Automation", - "INTERVALS": "Intervals", - "EDIT_INTERVAL": "Edit Interval", - "DELETE_INTERVAL": "Delete Interval", - "ADD_INTERVAL": "Add Interval", - "TOOLS": "Tools", - "ID": "Id", + "SAVE": "Sačuvaj", + "VARIABLES": "Varijabla", + "ADD_VARIABLE": "Dodaj Varijablu", + "EDIT_VARIABLE": "Uredi Varijablu", + "DELETE_VARIABLE": "Izbriši Varijablu", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "TAGS": "Tagovi", + "ADD_TAG": "Dodaj Tag", + "EDIT_TAG": "Uredi Tag", + "DELETE_TAG": "Izbriši Tag", + "PAUSES": "Pauze", + "ADD_PAUSE": "Dodaj Pauzu", + "EDIT_PAUSE": "Uredi Pauzu", + "DELETE_PAUSE": "Izbriši Pauzu", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "ADD_CANNEDANSWER": "Dodaj Pripremljeni Odgovor", + "EDIT_CANNEDANSWER": "Uredi Pripremljeni Odgovor", + "DELETE_CANNEDANSWER": "Izbriši Pripremljeni Odgovor", + "KEY": "Ključ", + "VALUE": "Vrijednost", + "SOUNDS": "Zvukovi", + "EDIT_SOUND": "Uredi Zvuk", + "DELETE_SOUND": "Izbriši Zvuk", + "CANCEL": "Otkaži", + "FINISH": "Završi", + "DROP_TO_UPLOAD": "Ispusti za Učitavanje", + "UPLOADING": "Učitavanje", + "TRIGGERS": "Trigers", + "EDIT_TRIGGER": "Uredi Triger", + "DELETE_TRIGGER": "Izbriši Triger", + "ADD_TRIGGER": "Dodaj Triger", + "DELETE": "Ibriši", + "AUTOMATIONS": "Automatizacija", + "EDIT_AUTOMATION": "Uredi Automatizaciju", + "DELETE_AUTOMATION": "Izbriši Automatizaciju", + "ADD_AUTOMATION": "Dodaj Automatizaciju", + "INTERVALS": "Intervali", + "EDIT_INTERVAL": "Uredi Interval", + "DELETE_INTERVAL": "Izbriši Interval", + "ADD_INTERVAL": "Dodaj Interval", + "TOOLS": "Alati", + "ID": "ID", "AUDIO": "Audio", - "DOWNLOAD_SOUND": "Download Sound", - "UPLOAD_SOUND": "Tools", - "CHANNEL": "Channel", - "NEW_TRIGGER": "New Trigger", - "GENERAL": "General", + "DOWNLOAD_SOUND": "Skini Zvuk", + "UPLOAD_SOUND": "Alati", + "CHANNEL": "Kanal", + "NEW_TRIGGER": "Novi Triger", + "GENERAL": "Općenito", "STATUS": "Status", - "CONDITIONS&ACTIONS": "Conditions & Actions", - "ALLCONDITIONS": "Meet all these conditions:", - "ANYCONDITIONS": "Meet any of these conditions:", - "ACTIONS": "Actions:", - "NEW_AUTOMATION": "New Automation", + "CONDITIONS&ACTIONS": "Uslovi & Radnje", + "ALLCONDITIONS": "Ispuni sve ove uslove:", + "ANYCONDITIONS": "Ispuni bilo koji od ovih uslova:", + "ACTIONS": "Radnje", + "NEW_AUTOMATION": "Nova Automatizacija", "TIMEOUT": "Timeout", "PEERSTATUS": "Peer Status", - "CALL_LIMIT": "Calls Limit", - "OTHERFIELDS": "Other Fields", - "NEW_VARIABLE": "New Variable", - "NEW_TAG": "New Tag", - "NEW_PAUSE": "New Pause", - "NEW_CANNEDANSWER": "New Canned Answer", - "CONFIRM_PASSWORD": "Confirm Password", - "NEW_TRUNK": "New Trunk", - "FROM": "From", - "TO": "To", - "WEEKDAY": "Week Day", - "MONTHDAY": "Month Day", - "MONTH": "Month", - "ALWAYS": "Always", - "MON": "Monday", - "TUE": "Tuesday", - "WED": "Wednesday", - "THU": "Thursday", - "FRI": "Friday", - "SAT": "Saturday", - "SUN": "Sunday", - "JAN": "January", - "FEB": "February", - "MAR": "March", + "CALL_LIMIT": "Limit Poziva", + "OTHERFIELDS": "Ostala Polja", + "NEW_VARIABLE": "Nova Varijabla", + "NEW_TAG": "Novi Tag", + "NEW_PAUSE": "Nova Pauza", + "NEW_CANNEDANSWER": "Novi Pripremljeni Odgovor", + "CONFIRM_PASSWORD": "Potvrdi lozinku", + "NEW_TRUNK": "Novi Trunk", + "FROM": "Od", + "TO": "Za", + "WEEKDAY": "Dan u Sedmici", + "MONTHDAY": "Dan u Mjesecu", + "MONTH": "Mjesec", + "ALWAYS": "Uvijek", + "MON": "Ponedjeljak", + "TUE": "Utorak", + "WED": "Srijeda", + "THU": "Četvrtak", + "FRI": "Petak", + "SAT": "Subota", + "SUN": "Nedelja", + "JAN": "Januar", + "FEB": "Februar", + "MAR": "Mart", "APR": "April", - "MAY": "May", - "JUN": "June", - "JUL": "July", + "MAY": "Maj", + "JUN": "Juni", + "JUL": "Juli", "AUG": "August", - "SEP": "September", - "OCT": "October", - "NOV": "November", - "DEC": "December", - "PASSWORD": "Password", - "CUSTOMDASHBOARDS": "Custom Dashboards", - "NEW_CUSTOMDASHBOARD": "New Custom Dashboard", - "ADD_CUSTOMDASHBOARD": "Add Custom Dashboard", - "EDIT_CUSTOMDASHBOARD": "Edit Custom Dashboard", - "DELETE_CUSTOMDASHBOARD": "Delete Custom Dashboard", - "SCHEDULER": "Scheduler", - "NEW_SCHEDULE": "New Schedule", - "ADD_SCHEDULE": "Add Schedule", - "EDIT_SCHEDULE": "Edit Schedule", - "DELETE_SCHEDULE": "Delete Schedule", - "SENDMAIL": "Send Email", - "CONFIGURATION": "Configuration", - "MAIL": "Email", - "REPORTTYPE": "Report Type", - "REPORT": "Report", - "OUTPUT": "Output", - "EXECUTEON": "Execute On", - "REPORTRANGE": "Report Range", - "VALIDITYSTART": "Start Time", - "VALIDITYEND": "End Time", - "EXECUTEEVERY": "Execute every", - "ACCOUNT": "Account", - "EMAILADDRESS": "Email Address", + "SEP": "Septembar", + "OCT": "Oktobar", + "NOV": "Novembar", + "DEC": "Decembar", + "PASSWORD": "Lozinka", + "CUSTOMDASHBOARDS": "Prilagođena Tabla", + "NEW_CUSTOMDASHBOARD": "Nova Prilagođena Tabla", + "ADD_CUSTOMDASHBOARD": "Dodaj Prilagođenu Tablu", + "EDIT_CUSTOMDASHBOARD": "Uredi Prilagođenu Tablu", + "DELETE_CUSTOMDASHBOARD": "Izbriši Prilagođenu Tablu", + "SCHEDULER": "Planer", + "NEW_SCHEDULE": "Novi Raspored", + "ADD_SCHEDULE": "Dodaj Raspored", + "EDIT_SCHEDULE": "Uredi Raspored", + "DELETE_SCHEDULE": "Izbriši Raspored", + "SENDMAIL": "Pošalji E-Mail", + "CONFIGURATION": "Konfiguracija", + "MAIL": "E-Mail", + "REPORTTYPE": "Vrsta Izvještaja", + "REPORT": "Izvještaj", + "OUTPUT": "Izlaz", + "EXECUTEON": "Izvrši Na", + "REPORTRANGE": "Opseg Izvještaja", + "VALIDITYSTART": "Vrijeme Početka", + "VALIDITYEND": "Vrijeme Završetka", + "EXECUTEEVERY": "Izvrši svaki", + "ACCOUNT": "Nalog", + "EMAILADDRESS": "E-Mail Adresa", "EMAILCCADDRESS": "Cc", "EMAILBCCADDRESS": "Bcc", - "CURRENTDAY": "Current Day", - "DAILY": "Daily", - "WEEKLY": "Weekly", - "MONTHLY": "Monthly", - "PREVIOUS_DAY": "Previous Day", - "LAST_SEVEN_DAYS": "Last Seven Days", - "LAST_THIRTY_DAYS": "Last Thirthy Days", - "LAST_MONTH": "Last Month", - "WEEKDAYS": "Week Days", - "HOUR": "Hour", - "DEFAULT": "Default", + "CURRENTDAY": "Današnji dan", + "DAILY": "Dnevno", + "WEEKLY": "Sedmično", + "MONTHLY": "Mjesečno", + "PREVIOUS_DAY": "Prethodni Dan", + "LAST_SEVEN_DAYS": "Posljednjih Sedam Dana", + "LAST_THIRTY_DAYS": "Posljednjih Trideset Data", + "LAST_MONTH": "Posljednji Mjesec", + "WEEKDAYS": "Dani u Sedmici", + "HOUR": "Sat", + "DEFAULT": "Zadano", "CSV": "CSV", "PDF": "PDF", - "15MIN": "15 minutes", - "30MIN": "30 minutes", - "1H": "1 hour", + "15MIN": "15 minuta", + "30MIN": "30 minuta", + "1H": "1 sat", "VOICE": "Voice", "CHAT": "Chat", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", - "TEMPLATES": "Templates", - "EDIT_TEMPLATE": "Edit Template", - "DELETE_TEMPLATE": "Delete Template", - "NEW_TEMPLATE": "New Template", - "ADD_TEMPLATE": "Add Template", - "CONTENT": "Content", - "FIELD": "Field", - "NO_ANYCONDITION_AVAILABLE": "No Conditions available", - "NO_ALLCONDITION_AVAILABLE": "No Conditions available", - "NO_ACTION_AVAILABLE": "No Actions available", - "ACTION": "Action", - "EDIT_ANYCONDITION": "Edit Condition", - "DELETE_ANYCONDITION": "Delete Condition", - "NEW_ANYCONDITION": "New Condition", - "ADD_ANYCONDITION": "Add Condition", - "EDIT_ALLCONDITION": "Edit Condition", - "DELETE_ALLCONDITION": "Delete Condition", - "NEW_ALLCONDITION": "New Condition", - "ADD_ALLCONDITION": "Add Condition", - "EDIT_ACTION": "Edit Action", - "DELETE_ACTION": "Delete Action", - "NEW_ACTION": "New Action", - "ADD_ACTION": "Add Action", + "OPENCHANNEL": "Otvoreni Kanal", + "TEMPLATES": "Šabloni", + "EDIT_TEMPLATE": "Uredi Šablon", + "DELETE_TEMPLATE": "Izbriši Šablon", + "NEW_TEMPLATE": "Novi Šablon", + "ADD_TEMPLATE": "Dodaj Šablon", + "CONTENT": "Sadržaj", + "FIELD": "Polje", + "NO_ANYCONDITION_AVAILABLE": "Nema dostupnih Uslova", + "NO_ALLCONDITION_AVAILABLE": "Nema dostupnih Uslova", + "NO_ACTION_AVAILABLE": "Nema dostupnih radnji", + "ACTION": "Radnja", + "EDIT_ANYCONDITION": "Uredi Uslov", + "DELETE_ANYCONDITION": "Izbriši Uslov", + "NEW_ANYCONDITION": "Novi Uslov", + "ADD_ANYCONDITION": "Dodaj Uslov", + "EDIT_ALLCONDITION": "Uredi Uslov", + "DELETE_ALLCONDITION": "Izbriši Uslov", + "NEW_ALLCONDITION": "Novi Uslov", + "ADD_ALLCONDITION": "Dodaj Uslov", + "EDIT_ACTION": "Uredi Radnju", + "DELETE_ACTION": "Izbriši Radnju", + "NEW_ACTION": "Nova Radnja", + "ADD_ACTION": "Dodaj Radnju", "QUEUE": "Queue", - "CALL_STATUS": "Call Status", - "OUTBOUNDROUTE": "Outbound Route", - "MAIL_SUBSTATUS": "Email Substatus", - "OFFLINE_MESSAGE": "Offline Message", - "EQUALS": "Equals", - "NOT_EQUALS": "Not Equals", - "CONTACT_MANAGER": "Contacts Manager", - "INTEGRATIONS": "Integrations", + "CALL_STATUS": "Status Poziva", + "OUTBOUNDROUTE": "Odlazna Ruta", + "MAIL_SUBSTATUS": "E-Mail Podstatusi", + "OFFLINE_MESSAGE": "Offline Poruka", + "EQUALS": "Jednako", + "NOT_EQUALS": "Nije Jednako", + "CONTACT_MANAGER": "Kontakt Menadžer", + "INTEGRATIONS": "Integracije", "MOTIONBAR": "Motion Bar", "JSCRIPTY": "Jscripty", "URL_FORWARD": "URL Forward", "WEB_POPUP": "Web Popup", - "LIST": "List", - "INTEGRATION": "Integration", - "TEMPLATE": "Template", + "LIST": "Lista", + "INTEGRATION": "Integracija", + "TEMPLATE": "Šablon", "URL": "URL", - "APPLICATION": "Application", - "ARGUMENTS": "Arguments", - "NO_APPS_AVAILABLE": "No applications available", - "NEW_INTERVAL": "New Interval", - "OPERATOR": "Operator", - "NO_INTERVALS_AVAILABLE": "No intervals available", - "YES": "Yes", - "NO": "No", - "SUBJECT": "Subject", - "NO_AVAILABLE_INFO": "No available info", - "BROWSER": "Browser", + "APPLICATION": "Aplikacija", + "ARGUMENTS": "Argumenti", + "NO_APPS_AVAILABLE": "Nema dostupnih aplikacija", + "NEW_INTERVAL": "Novi Interval", + "OPERATOR": "Operater", + "NO_INTERVALS_AVAILABLE": "Nema dostupnih intervala", + "YES": "Da", + "NO": "Ne", + "SUBJECT": "Predmet", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "BROWSER": "Pretraživač", "INTERVAL": "Interval", "INFO": "Info", - "TIME_RANGE": "Time Range", - "WEEK_DAYS": "Week Days", - "MONTH_DAYS": "Month Days", - "MONTHS": "Months", - "DROP_TO_UPLOAD_MESSAGE": "Drop audio files here to upload. Only MP3, WAV, GSM - Max. 15MB", - "POLLING_INTERVAL": "Polling Interval (seconds)", - "DASHBOARD": "Dashboard", - "NEW_DASHBOARDITEM": "New Dashboard Widget", - "COUNTER": "Counter", + "TIME_RANGE": "Vremenski Raspon", + "WEEK_DAYS": "Dani u Sedmici", + "MONTH_DAYS": "Dani u Mjesecu", + "MONTHS": "Mjeseci", + "DROP_TO_UPLOAD_MESSAGE": "Ovdje ispusti audio datoteke za učitavanje. Samo MP3, WAV, GSM - Maks. 15MB", + "POLLING_INTERVAL": "Polling Interval (sekunde)", + "DASHBOARD": "Tabla", + "NEW_DASHBOARDITEM": "Nova Tabla Widget", + "COUNTER": "Brojač", "IFRAME": "IFrame", - "CLOCK": "Clock", - "ADD_DASHBOARDITEM": "Add Dashboard Widget", - "EDIT_WIDGET": "Edit Widget", - "DELETE_WIDGET": "Delete Widget", - "FLIP_WIDGET": "Flip Widget", - "TITLE": "Title", - "UPDATE": "Update", - "LAYOUT": "Layout", - "BACKGROUND_COLOR": "Background Color", - "FOREGROUND_COLOR": "Foreground Color", - "FOREGROUND_TITLE_COLOR": "Foreground Title Color", - "THEME": "Theme", - "LIGHT": "Light", - "DARK": "Dark", - "TIMEZONE": "TimeZone", - "DIGITAL_FORMAT": "Digital Date Format", - "TOOLS_QUERY": "Query", - "SELECT": "Select", - "WHERE": "Where", - "BACK": "Back", - "PROJECT": "Project", - "GOTOREALTIME_TRUNK": "Go To Realtime Trunk", - "GOTO_TRUNK": "Go To Trunk", + "CLOCK": "Sat", + "ADD_DASHBOARDITEM": "Dodaj Widget Table", + "EDIT_WIDGET": "Uredi Widget", + "DELETE_WIDGET": "Izbriši Widget", + "FLIP_WIDGET": "Okreni Widget", + "TITLE": "Naslov", + "UPDATE": "Ažuriraj", + "LAYOUT": "Izgled", + "BACKGROUND_COLOR": "Boja Pozadine", + "FOREGROUND_COLOR": "Foreground Boja", + "FOREGROUND_TITLE_COLOR": "Foreground Naslov Boja ", + "THEME": "Tema", + "LIGHT": "Svjetlo", + "DARK": "Tamno", + "TIMEZONE": "Vremenska Zona", + "DIGITAL_FORMAT": "Izbriši Format Datuma", + "TOOLS_QUERY": "Upit", + "SELECT": "Odaberi", + "WHERE": "Gdje", + "BACK": "Nazad", + "PROJECT": "Projekat", + "GOTOREALTIME_TRUNK": "Idi na Realtime Trunk", + "GOTO_TRUNK": "Idi na Trunk", "CRON": "Cron", - "MINUTES": "Minutes", - "HOURLY": "Hourly", - "YEARLY": "Yearly", - "EVERY": "Every", - "MINUTE": "Minute", - "ON_SECOND": "On second", - "HOUR_ON_MINUTE": "Hour on minute", - "AND_SECOND": "And second", - "DAY_AT": "Day at", - "START_TIME": "Start Time", - "ON_THE": "On the", - "OF_EVERY": "Of every", - "MONTH_AT": "Month at", - "AT": "At", - "LAST": "Last", - "LASTUNIT": "Unit", - "MAILACCOUNT": "Email Account", - "OF": "of", - "PAST_THE_HOUR": "Past the hour", - "DAY": "Day", - "WEEK": "Week", - "YEAR": "Year", - "ON": "On", + "MINUTES": "Minute", + "HOURLY": "Po satu", + "YEARLY": "Godišnje", + "EVERY": "Svaki", + "MINUTE": "Minuta", + "ON_SECOND": "Na drugom", + "HOUR_ON_MINUTE": "Sat na minut", + "AND_SECOND": "I drugo", + "DAY_AT": "Dan u", + "START_TIME": "Vrijeme Početka", + "ON_THE": "Na", + "OF_EVERY": "Od svakog", + "MONTH_AT": "Mjesec U", + "AT": "Na", + "LAST": "Posljednji", + "LASTUNIT": "Jedinica", + "MAILACCOUNT": "E-Mail nalog", + "OF": "od", + "PAST_THE_HOUR": "Prošao sat", + "DAY": "Dan", + "WEEK": "Sedmica", + "YEAR": "Godina", + "ON": "Na", "PAI": "P-Asserted-Identity", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "EVENTVARIABLES": "Event Variables", - "AUTOCREATECONTACT": "Create contact automatically", - "LOCATION": "Location", - "NEW_TAB": "New Tab", - "NEW_WINDOW": "New Window", - "MOTION_TAB": "New Agent Dashboard Tab", - "WINDOWWIDTH": "Window Width(px)", - "WINDOWHEIGHT": "Window Height(px)", - "BODY": "Body", - "REPORTFOLDER": "Report Folder", - "REPORTSUBFOLDER": "Report Subfolder", - "AGENT": "Agent", - "HEADERS": "Headers", - "WHATSAPP": "WhatsApp Connector", - "LEVEL": "Level", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "EVENTVARIABLES": "Varijable Događaja", + "AUTOCREATECONTACT": "Kreiraj kontakt automatski", + "LOCATION": "Lokacija", + "NEW_TAB": "Novi Tab", + "NEW_WINDOW": "Novi Prozor", + "MOTION_TAB": "Novi Specijalista Tabla Tab", + "WINDOWWIDTH": "Širina Prozora(px)", + "WINDOWHEIGHT": "Visina Prozora(px)", + "BODY": "Tijelo", + "REPORTFOLDER": "Folder Izvještaja", + "REPORTSUBFOLDER": "Podfolder Izvještaja", + "AGENT": "Specijalista", + "HEADERS": "Zaglavlja", + "WHATSAPP": "WhatsApp Konektor", + "LEVEL": "Nivo", "NOTIFICATIONS": { - "DISPOSITION_CREATED_SUCCESS_TITLE": "Disposition successfully created", - "DISPOSITION_SAVED_SUCCESS_TITLE": "Disposition successfully saved", - "DISPOSITION_DELETE_TITLE": "Are you sure want to delete the disposition?", - "DISPOSITION_DELETE_MESSAGE": "{{ name }} will be deleted", - "DISPOSITION_DELETE_MESSAGE_CHILDREN": "{{ name }} will be deleted with all its sub dispositions", - "DISPOSITION_DELETED_SUCCESS_TITLE": "Disposition successfully deleted", - "DISPOSITIONS_DELETE_TITLE": "Are you sure want to delete the selected dispositions?", - "DISPOSITIONS_DELETE_MESSAGE": "{{ total }} dispositions will be deleted", - "TRIGGER_CREATED_SUCCESS_TITLE": "Trigger successfully created", - "TRIGGER_SAVED_SUCCESS_TITLE": "Trigger successfully saved", - "TRIGGER_DELETE_TITLE": "Are you sure want to delete the trigger?", - "TRIGGER_DELETE_MESSAGE": "{{ name }} will be deleted", - "TRIGGER_DELETED_SUCCESS_TITLE": "Trigger successfully deleted", - "TRIGGERS_DELETE_TITLE": "Are you sure want to delete the selected triggers?", - "TRIGGERS_DELETE_MESSAGE": "{{ total }} triggers will be deleted", - "TRIGGERS_DELETED_SUCCESS_TITLE": "Triggers successfully deleted", - "ACTION_CREATED_SUCCESS_TITLE": "Action successfully created", - "ACTION_SAVED_SUCCESS_TITLE": "Action successfully saved", - "ACTION_DELETE_TITLE": "Are you sure want to delete the action?", - "ACTION_DELETED_SUCCESS_TITLE": "Action successfully deleted", - "ACTIONS_DELETE_TITLE": "Are you sure want to delete the selected actions?", - "ACTIONS_DELETE_MESSAGE": "{{ total }} actions will be deleted", - "ACTIONS_DELETED_SUCCESS_TITLE": "Actions successfully deleted", - "CONDITION_CREATED_SUCCESS_TITLE": "Condition successfully created", - "CONDITION_SAVED_SUCCESS_TITLE": "Condition successfully saved", - "CONDITION_DELETE_TITLE": "Are you sure want to delete the condition?", - "CONDITION_DELETED_SUCCESS_TITLE": "Condition successfully deleted", - "CONDITIONS_DELETE_TITLE": "Are you sure want to delete the selected conditions?", - "CONDITIONS_DELETE_MESSAGE": "{{ total }} conditions will be deleted", - "CONDITIONS_DELETED_SUCCESS_TITLE": "Conditions successfully deleted" + "DISPOSITION_CREATED_SUCCESS_TITLE": "Dispozicija uspješno kreirana", + "DISPOSITION_SAVED_SUCCESS_TITLE": "Dispozicija uspješno sačuvana", + "DISPOSITION_DELETE_TITLE": "Jesi li siguran da želiš izbrisati dispoziciju?", + "DISPOSITION_DELETE_MESSAGE": "{{ name }} će biti izbrisano", + "DISPOSITION_DELETE_MESSAGE_CHILDREN": "{{ name }} će biti izbrisano sa svim pod-dispozicijama", + "DISPOSITION_DELETED_SUCCESS_TITLE": "Dispozicija uspješno izbrisana", + "DISPOSITIONS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane dispozicije?", + "DISPOSITIONS_DELETE_MESSAGE": "{{ total }} dispozicija će biti izbrisano", + "TRIGGER_CREATED_SUCCESS_TITLE": "Triger uspješno kreiran", + "TRIGGER_SAVED_SUCCESS_TITLE": "Triger uspješno sačuvan", + "TRIGGER_DELETE_TITLE": "Jesi li siguran da želiš izbrisati triger?", + "TRIGGER_DELETE_MESSAGE": "{{ name }} će biti izbrisano", + "TRIGGER_DELETED_SUCCESS_TITLE": "Triger uspješno izbrisan", + "TRIGGERS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane trigere?", + "TRIGGERS_DELETE_MESSAGE": "{{ total }} trigera će biti izbrisano", + "TRIGGERS_DELETED_SUCCESS_TITLE": "Trigeri uspješno izbrisani", + "ACTION_CREATED_SUCCESS_TITLE": "Radnja uspješno kreirana", + "ACTION_SAVED_SUCCESS_TITLE": "Radnja je uspješno sačuvana", + "ACTION_DELETE_TITLE": "Jesi li siguran da želiš izbrisati radnju?", + "ACTION_DELETED_SUCCESS_TITLE": "Radnja uspješno izbrisana", + "ACTIONS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane radnje?", + "ACTIONS_DELETE_MESSAGE": "{{ total }} radnji će biti izbrisano", + "ACTIONS_DELETED_SUCCESS_TITLE": "Radnje uspješno izbrisane", + "CONDITION_CREATED_SUCCESS_TITLE": "Uslov uspješno kreiran", + "CONDITION_SAVED_SUCCESS_TITLE": "Uslov uspješno sačuvan", + "CONDITION_DELETE_TITLE": "Jesi li siguran da želiš izbrisati uslov?", + "CONDITION_DELETED_SUCCESS_TITLE": "Uslov uspješno izbrisan", + "CONDITIONS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane uslove?", + "CONDITIONS_DELETE_MESSAGE": "{{ total }} uslova će biti izbrisano", + "CONDITIONS_DELETED_SUCCESS_TITLE": "Uslovi uspješno izbrisani" }, - "ALL_DISPOSITIONS": "All dispositions", - "SELECT_LEVEL": "Select a level", - "ALL": "All", - "FIRST_LEVEL_DISPOSITION": "First Level Disposition", - "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", - "SEARCH_FIELDS": "Search fields", - "AUTOCREATE_FIELD": "Autocreate field", + "ALL_DISPOSITIONS": "Sve dispozicije", + "SELECT_LEVEL": "Odaberi nivo", + "ALL": "Svi", + "FIRST_LEVEL_DISPOSITION": "Prvi Nivo Dispozicija", + "SECOND_LEVEL_DISPOSITION": "Drugi Nivo Dispozicije", + "SEARCH_FIELDS": "Polje pretrage", + "AUTOCREATE_FIELD": "Automatsko kreiranje polje", "STANDARD": "Standard", - "GLOBALS": "Globals", + "GLOBALS": "Globalni", "MOTION_BAR": "Motion Bar" } } diff --git a/public/app/main/apps/tools/i18n/et.json b/public/app/main/apps/tools/i18n/et.json index e2ccdbf..7343b76 100644 --- a/public/app/main/apps/tools/i18n/et.json +++ b/public/app/main/apps/tools/i18n/et.json @@ -483,6 +483,14 @@ "OPENED_TEXT": "Avatud interaktsioonid", "IGNOREDIALERCONTACTID": "Ignoreeri helistaja kontakti ID", "MAIL_SUBSTATUS": "Meili alamolek", - "OFFLINE_MESSAGE": "Võrguühenduseta sõnum" + "OFFLINE_MESSAGE": "Võrguühenduseta sõnum", + "ADD_CONTACTITEMTYPE": "Lisama", + "CONTACTITEMTYPE": "Kontaktüksuste tüübid", + "DELETE_CONTACTITEMTYPE": "Kustuta kontaktiüksuse tüüp", + "EDIT_CONTACTITEMTYPE": "Redigeerige kontaktiüksuse tüüpi", + "NEW_CONTACTITEMTYPE": "Uus kontaktiüksuse tüüp", + "ORDER_BY": "Telli järgi", + "ORDER_BY_NUMERIC": "Järjestus välja järgi peab olema numbriline!", + "RGBBACKGROUNDCOLOR": "RGB taustavärv" } } diff --git a/public/app/main/apps/tools/i18n/is.json b/public/app/main/apps/tools/i18n/is.json new file mode 100644 index 0000000..306ec24 --- /dev/null +++ b/public/app/main/apps/tools/i18n/is.json @@ -0,0 +1,528 @@ +{ + "TOOLS": { + "VIDEOSUPPORT": "Video support", + "PREVIOUSCONTACT": "Previous", + "BOT": "Voicebot", + "CLONE_TRUNK": "Clone Trunk", + "DISPOSITIONS": "Dispositions", + "NEW_DISPOSITION": "New Disposition", + "ADD_DISPOSITION": "Add Disposition", + "EDIT_DISPOSITION": "Edit Disposition", + "DELETE_DISPOSITION": "Delete Disposition", + "RUN_SCHEDULE": "Run schedule", + "SENDIFEMPTY": "Send if empty", + "NEXTCONTACT": "Next", + "OUTBOUND_ROUTE": "Outbound Route", + "EDIT_DASHBOARDITEM": "Edit Dashboard Widget", + "FONTSIZE": "Font Size", + "TITLEFONTSIZE": "Font Title Size", + "CLONE_CUSTOMDASHBOARD": "Clone Custom Dashboard", + "LINK": "Link [https://]", + "BACKGROUND": "Background", + "FOREGROUND": "Foreground", + "IGNOREDIALERCONTACTID": "Ignore dialer contact Id", + "NONE": "None", + "TOTAL": "Total", + "ABANDONED": "Abandoned", + "WAITING": "Waiting", + "TALKING": "Talking", + "ANSWERED": "Answered", + "CONTACTITEMTYPE": "Contact item types", + "ORDER_BY": "Order by", + "RGBBACKGROUNDCOLOR": "RGB Background color", + "NEW_CONTACTITEMTYPE": "New contact item type", + "EDIT_CONTACTITEMTYPE": "Edit contact item type", + "DELETE_CONTACTITEMTYPE": "Delete contact item type", + "ORDER_BY_NUMERIC": "Order by field should be numeric value!", + "ADD_CONTACTITEMTYPE": "Add", + "UNMANAGED": "Unmanaged", + "CUSTOMTYPE": "Custom [path]", + "WEBREPORT": "Web Report", + "PIECHART": "Pie Chart", + "MULTIBARCHART": "Multibar Chart", + "MOVE_WIDGET": "Move Widget", + "USERADD_CUSTOMDASHBOARD": "Add User Permissions", + "GOTODASHBOARD_CUSTOMDASHBOARD": "Go to preview dashboard", + "GOTO_CUSTOMDASHBOARD": "Go to preview dashboard", + "METRIC": "Metric", + "FILTERVOICEQUEUES": "Filter Voice Queues", + "SERIE1": "Serie 1", + "SERIE2": "Serie 2", + "SERIE3": "Serie 3", + "REFRESH": "Refresh [s]", + "FORMAT": "Format", + "PATH": "Absolute Path", + "ALL_USERS": "All Users", + "SELECTED_USERS": "Selected Users", + "ADD_WIDGET": "Add Widget", + "COLOR": "Color", + "FAX": "Fax", + "INTERACTION": "Interaction", + "MESSAGE": "Message", + "T38PT_UDPTL": "T38pt Udptl", + "CALL": "Call", + "NAME": "Name", + "TRUNKS": "Trunks", + "SEARCH_FOR_ANYONE": "Search", + "SCRIPT": "Script", + "SCRIPT_INFO": "Info", + "SCRIPT_TYPE": "Type", + "EMAIL": "Email", + "FILTERFAXACCOUNTS": "Filter Fax Accounts", + "FILTERSMSACCOUNTS": "Filter Sms Accounts", + "FILTERCHATWEBSITES": "Filter Chat Websites", + "FILTERWHATSAPPACCOUNTS": "Filter Whatsapp Accounts", + "FILTEREMAILACCOUNTS": "Filter Email Accounts", + "FILTEROPENCHANNELACCOUNTS": "Filter OpenChannel Accounts", + "OPENED": "Opened", + "OPENED_TEXT": "Opened Interactions", + "MANAGED": "Managed", + "MANAGED_TEXT": "Managed Interactions", + "ERRORS": { + "INFO_REQUIRED": "Mandatory field", + "SCRIPT_REQUIRED": "Mandatory field", + "NAME_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "TITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "REFRESH_REQUIRED": "Mandatory field", + "FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FONTSIZE_REQUIRED": "Mandatory field", + "PATH_REQUIRED": "Mandatory field", + "FORMAT_REQUIRED": "Mandatory field", + "REPORT_REQUIRED": "Mandatory field", + "TYPE_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "ACCOUNT_REQUIRED": "Mandatory field", + "IGNOREDIALERCONTACTID_REQUIRED": "Ignore dialer contact Id field is required", + "FIELD_REQUIRED": "Mandatory field", + "NAME_REQUIRED": "Mandatory field", + "HOST_REQUIRED": "Mandatory field", + "DEFAULTUSER_REQUIRED": "Mandatory field", + "CALLERID_REQUIRED": "Mandatory field", + "KEY_REQUIRED": "Mandatory field", + "CONFIRM_NOT_MATCH": "The Passwords don't match", + "VALIDITYSTART_REQUIRED": "Mandatory field", + "VALIDITYEND_REQUIRED": "Mandatory field", + "MONTHDAY_REQUIRED": "Mandatory field", + "HOUR_REQUIRED": "Mandatory field", + "CONTENT_REQUIRED": "Mandatory field", + "URL_REQUIRED": "Mandatory field", + "URL_MUST_VALID_URL": "Wrong format", + "APPLICATION_REQUIRED": "Mandatory field", + "ARGUMENTS_REQUIRED": "Mandatory field", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "POLLING_INTERVAL_REQUIRED": "Mandatory field", + "TITLE_REQUIRED": "Mandatory field", + "EMAILADDRESS_REQUIRED": "Mandatory field", + "EVENTVARIABLES_REQUIRED": "Mandatory field", + "INTEGRATION_REQUIRED": "Mandatory field", + "LIST_REQUIRED": "Mandatory field", + "TEMPLATE_REQUIRED": "Mandatory field", + "AUTOCREATECONTACT_REQUIRED": "Mandatory field", + "AUTOCREATE_FIELD_REQUIRED": "Mandatory field", + "OUTBOUNDROUTE_REQUIRED": "Mandatory field", + "QUEUE_REQUIRED": "Mandatory field", + "TIME_RANGE_TO_REQUIRED": "Mandatory field", + "WEEK_DAYS_TO_REQUIRED": "Mandatory field", + "MONTH_DAYS_TO_REQUIRED": "Mandatory field", + "MONTH_TO_REQUIRED": "Mandatory field", + "TIME_RANGE_FROM_INVALID": "Wrong Format", + "TIME_RANGE_TO_INVALID": "Wrong Format", + "ACTION_REQUIRED": "Mandatory field", + "CONFIGURATION_REQUIRED": "Mandatory field", + "PROJECT_REQUIRED": "Mandatory field", + "LOCATION_REQUIRED": "Mandatory field", + "OUTPUT_REQUIRED": "Mandatory field", + "REPORTTYPE_REQUIRED": "Mandatory field", + "REPORTFOLDER_REQUIRED": "Mandatory field", + "REPORTSUBFOLDER_REQUIRED": "Mandatory field", + "AGENT_REQUIRED": "Mandatory field", + "TIMEOUT_REQUIRED": "Mandatory field", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CHANNEL_REQUIRED": "Mandatory field" + }, + "HOST": "Host", + "SECRET": "Secret", + "DEFAULTUSER": "Default User", + "DESCRIPTION": "Description", + "ADD_TRUNK": "Add Trunk", + "HELP": { + "OPENED": "The total number of Active Interactions", + "MANAGED": "The total number of Completed Interactions", + "SCRIPT_INFO": "Insert a description for the script", + "SCRIPT_TYPE": "Insert a typology for the script (eg. curl, bash...)", + "INFO": "Insert title", + "SCRIPT": "Insert script", + "T38PT_UDPTL": "Es: yes,redundancy,maxdatagram=400", + "SECRET": "Authentication password", + "HOST": "The domain or host name", + "DEFAULTUSER": "Authentication username", + "CALLERID": "The Caller ID, in the format \"name\" ", + "REGISTRY": "The registry string, if required by provider, usually defaultuser:secret@host", + "FROMDOMAIN": "Set default From:domain in SIP messages when acting as a SIP ua (client). Some destinations may require mandatory identity name instead of only the IP address", + "FROMUSER": "How your provider knows you. This is which user to put instead of callerid when placing calls to peer (another SIP proxy). Valid only for type=peer.", + "OUTBOUNDPROXY": "IP_address or DNS SRV name (excluding the _sip._udp prefix): SRV name, hostname, or IP address of the outbound SIP Proxy. Send outbound signaling to this proxy, not directly to the devices. Valid only for type=peer.", + "PORT": "The SIP port number", + "CONTEXT": "The context for the trunk", + "TYPE": "Determine the SIP role within asterisk. User: used to authenticate incoming - Peer: for outgoing calls - Friend: covers both characteristics of the above.", + "DTMFMODE": "How DTMF (Dual-Tone Multi-Frequency) are sent. RFC2833: the default mode, the DTMF are sent with RTP but outside the audio stream. INBAND: The DTMF is sent in audio stream of the current conversation, becoming audible from the speakers. Requires a high CPU load. INFO: Although this method is very reliable, it is not supported by all PBX devices and many SIP Trunks.", + "NAT": "Change the behaviour of Asterisk for clients behind a firewall. If any of the comma-separated options is 'no', Asterisk will ignore any other settings and set nat=no.", + "QUALIFY": "Determine when the SIP is achievable", + "ALLOWCODECS": "Allowed codecs in order of preference", + "INSECURE": "Specify how to handle connections with peer, allowing insecure settings", + "CALL_LIMIT": "The limit number of the inbound and outbound concurrent calls", + "DIRECTMEDIA": "Asterisk by default tries to redirect the RTP media stream to go directly from the caller to the callee. Some devices do not support this (especially if one of them is behind a NAT). The default setting is YES. If you have all clients behind a NAT, or for some other reason want Asterisk to stay in the audio path, you may want to turn this off.", + "CALLCOUNTER": "Enable call counters on devices", + "ADD_PHONE_TO_URI": "Define if the provider requires ';user=phone' on URL", + "TRUST_REMOTE_PARTY_ID": "Define if Remote-Party-ID should be trusted", + "SEND_REMOTE_PARTY_ID_HEADER": "Define if Remote-Party-ID should be sent (defaults is no)", + "ENCRYPTION": "Whether to offer SRTP encrypted media (and only SRTP encrypted media) on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if the peer does not support SRTP. Defaults value is No", + "TRANSPORT": "Set the default transports, in order of preference", + "OTHERFIELDS": "Other fields to add in the trunks conf files. Follow default asterisk format (key=value), each field on a single row", + "EMAILADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "EMAILCCADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "EMAILBCCADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "EVENTVARIABLES": "If enabled, it adds all the event variables to the url (recommended value=No. Set to Yes only for evaluation purposes) ", + "HEADERS": "Note: Headers section must be in RAW JSON format {\"key\":\"value\"} \nNote: If not filled out, the default value will be sent", + "BODY": "Note: the body must be in RAW JSON format {\"key\":\"value\"} \nNote: If not filled out, the default value will be sent", + "TIMEOUT": "Request timeout in seconds. The value must be between 1 and 10 and the default value is 5." + }, + "EDIT_TRUNK": "Edit Trunk", + "DELETE_TRUNK": "Delete Trunk", + "CREATED_AT": "Created At", + "SETTINGS": "Settings", + "ADVANCED": "Advanced", + "OTHER": "Other", + "ACTIVE": "Active", + "CONTEXT": "Context", + "CALLERID": "Caller ID", + "TYPE": "Type", + "DTMFMODE": "DTMF Mode", + "NAT": "NAT", + "QUALIFY": "Qualify", + "ALLOWCODECS": "Allowed Codecs", + "INSECURE": "Insecure", + "REGISTRY": "Registry", + "DIRECTMEDIA": "Direct Media", + "CALLCOUNTER": "Call Counter", + "FROMDOMAIN": "From Domain", + "FROMUSER": "From User", + "OUTBOUNDPROXY": "Outbound Proxy", + "ADD_PHONE_TO_URI": "Add Phone to URL", + "TRUST_REMOTE_PARTY_ID": "Trust Remote Party ID", + "SEND_REMOTE_PARTY_ID_HEADER": "Send Remote Party ID Header", + "ENCRYPTION": "Encryption", + "PORT": "Port", + "TRANSPORT": "Transport", + "SAVE": "Save", + "VARIABLES": "Variables", + "ADD_VARIABLE": "Add Variable", + "EDIT_VARIABLE": "Edit Variable", + "DELETE_VARIABLE": "Delete Variable", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "TAGS": "Tags", + "ADD_TAG": "Add Tag", + "EDIT_TAG": "Edit Tag", + "DELETE_TAG": "Delete Tag", + "PAUSES": "Pauses", + "ADD_PAUSE": "Add Pause", + "EDIT_PAUSE": "Edit Pause", + "DELETE_PAUSE": "Delete Pause", + "CANNEDANSWERS": "Canned Answers", + "ADD_CANNEDANSWER": "Add Canned Answer", + "EDIT_CANNEDANSWER": "Edit Canned Answer", + "DELETE_CANNEDANSWER": "Delete Canned Answer", + "KEY": "Key", + "VALUE": "Value", + "SOUNDS": "Sounds", + "EDIT_SOUND": "Edit Sound", + "DELETE_SOUND": "Delete Sound", + "CANCEL": "Cancel", + "FINISH": "Finish", + "DROP_TO_UPLOAD": "Drop To Upload", + "UPLOADING": "Uploading", + "TRIGGERS": "Triggers", + "EDIT_TRIGGER": "Edit Trigger", + "DELETE_TRIGGER": "Delete Trigger", + "ADD_TRIGGER": "Add Trigger", + "DELETE": "Delete", + "AUTOMATIONS": "Automations", + "EDIT_AUTOMATION": "Edit Automation", + "DELETE_AUTOMATION": "Delete Automation", + "ADD_AUTOMATION": "Add Automation", + "INTERVALS": "Intervals", + "EDIT_INTERVAL": "Edit Interval", + "DELETE_INTERVAL": "Delete Interval", + "ADD_INTERVAL": "Add Interval", + "TOOLS": "Tools", + "ID": "Id", + "AUDIO": "Audio", + "DOWNLOAD_SOUND": "Download Sound", + "UPLOAD_SOUND": "Tools", + "CHANNEL": "Channel", + "NEW_TRIGGER": "New Trigger", + "GENERAL": "General", + "STATUS": "Status", + "CONDITIONS&ACTIONS": "Conditions & Actions", + "ALLCONDITIONS": "Meet all these conditions:", + "ANYCONDITIONS": "Meet any of these conditions:", + "ACTIONS": "Actions:", + "NEW_AUTOMATION": "New Automation", + "TIMEOUT": "Timeout", + "PEERSTATUS": "Peer Status", + "CALL_LIMIT": "Calls Limit", + "OTHERFIELDS": "Other Fields", + "NEW_VARIABLE": "New Variable", + "NEW_TAG": "New Tag", + "NEW_PAUSE": "New Pause", + "NEW_CANNEDANSWER": "New Canned Answer", + "CONFIRM_PASSWORD": "Confirm Password", + "NEW_TRUNK": "New Trunk", + "FROM": "From", + "TO": "To", + "WEEKDAY": "Week Day", + "MONTHDAY": "Month Day", + "MONTH": "Month", + "ALWAYS": "Always", + "MON": "Monday", + "TUE": "Tuesday", + "WED": "Wednesday", + "THU": "Thursday", + "FRI": "Friday", + "SAT": "Saturday", + "SUN": "Sunday", + "JAN": "January", + "FEB": "February", + "MAR": "March", + "APR": "April", + "MAY": "May", + "JUN": "June", + "JUL": "July", + "AUG": "August", + "SEP": "September", + "OCT": "October", + "NOV": "November", + "DEC": "December", + "PASSWORD": "Password", + "CUSTOMDASHBOARDS": "Custom Dashboards", + "NEW_CUSTOMDASHBOARD": "New Custom Dashboard", + "ADD_CUSTOMDASHBOARD": "Add Custom Dashboard", + "EDIT_CUSTOMDASHBOARD": "Edit Custom Dashboard", + "DELETE_CUSTOMDASHBOARD": "Delete Custom Dashboard", + "SCHEDULER": "Scheduler", + "NEW_SCHEDULE": "New Schedule", + "ADD_SCHEDULE": "Add Schedule", + "EDIT_SCHEDULE": "Edit Schedule", + "DELETE_SCHEDULE": "Delete Schedule", + "SENDMAIL": "Send Email", + "CONFIGURATION": "Configuration", + "MAIL": "Email", + "REPORTTYPE": "Report Type", + "REPORT": "Report", + "OUTPUT": "Output", + "EXECUTEON": "Execute On", + "REPORTRANGE": "Report Range", + "VALIDITYSTART": "Start Time", + "VALIDITYEND": "End Time", + "EXECUTEEVERY": "Execute every", + "ACCOUNT": "Account", + "EMAILADDRESS": "Email Address", + "EMAILCCADDRESS": "Cc", + "EMAILBCCADDRESS": "Bcc", + "CURRENTDAY": "Current Day", + "DAILY": "Daily", + "WEEKLY": "Weekly", + "MONTHLY": "Monthly", + "PREVIOUS_DAY": "Previous Day", + "LAST_SEVEN_DAYS": "Last Seven Days", + "LAST_THIRTY_DAYS": "Last Thirthy Days", + "LAST_MONTH": "Last Month", + "WEEKDAYS": "Week Days", + "HOUR": "Hour", + "DEFAULT": "Default", + "CSV": "CSV", + "PDF": "PDF", + "15MIN": "15 minutes", + "30MIN": "30 minutes", + "1H": "1 hour", + "VOICE": "Voice", + "CHAT": "Chat", + "SMS": "SMS", + "OPENCHANNEL": "Open Channel", + "TEMPLATES": "Templates", + "EDIT_TEMPLATE": "Edit Template", + "DELETE_TEMPLATE": "Delete Template", + "NEW_TEMPLATE": "New Template", + "ADD_TEMPLATE": "Add Template", + "CONTENT": "Content", + "FIELD": "Field", + "NO_ANYCONDITION_AVAILABLE": "No Conditions available", + "NO_ALLCONDITION_AVAILABLE": "No Conditions available", + "NO_ACTION_AVAILABLE": "No Actions available", + "ACTION": "Action", + "EDIT_ANYCONDITION": "Edit Condition", + "DELETE_ANYCONDITION": "Delete Condition", + "NEW_ANYCONDITION": "New Condition", + "ADD_ANYCONDITION": "Add Condition", + "EDIT_ALLCONDITION": "Edit Condition", + "DELETE_ALLCONDITION": "Delete Condition", + "NEW_ALLCONDITION": "New Condition", + "ADD_ALLCONDITION": "Add Condition", + "EDIT_ACTION": "Edit Action", + "DELETE_ACTION": "Delete Action", + "NEW_ACTION": "New Action", + "ADD_ACTION": "Add Action", + "QUEUE": "Queue", + "CALL_STATUS": "Call Status", + "OUTBOUNDROUTE": "Outbound Route", + "MAIL_SUBSTATUS": "Email Substatus", + "OFFLINE_MESSAGE": "Offline Message", + "EQUALS": "Equals", + "NOT_EQUALS": "Not Equals", + "CONTACT_MANAGER": "Contacts Manager", + "INTEGRATIONS": "Integrations", + "MOTIONBAR": "Motion Bar", + "JSCRIPTY": "Jscripty", + "URL_FORWARD": "URL Forward", + "WEB_POPUP": "Web Popup", + "LIST": "List", + "INTEGRATION": "Integration", + "TEMPLATE": "Template", + "URL": "URL", + "APPLICATION": "Application", + "ARGUMENTS": "Arguments", + "NO_APPS_AVAILABLE": "No applications available", + "NEW_INTERVAL": "New Interval", + "OPERATOR": "Operator", + "NO_INTERVALS_AVAILABLE": "No intervals available", + "YES": "Yes", + "NO": "No", + "SUBJECT": "Subject", + "NO_AVAILABLE_INFO": "No available info", + "BROWSER": "Browser", + "INTERVAL": "Interval", + "INFO": "Info", + "TIME_RANGE": "Time Range", + "WEEK_DAYS": "Week Days", + "MONTH_DAYS": "Month Days", + "MONTHS": "Months", + "DROP_TO_UPLOAD_MESSAGE": "Drop audio files here to upload. Only MP3, WAV, GSM - Max. 15MB", + "POLLING_INTERVAL": "Polling Interval (seconds)", + "DASHBOARD": "Dashboard", + "NEW_DASHBOARDITEM": "New Dashboard Widget", + "COUNTER": "Counter", + "IFRAME": "IFrame", + "CLOCK": "Clock", + "ADD_DASHBOARDITEM": "Add Dashboard Widget", + "EDIT_WIDGET": "Edit Widget", + "DELETE_WIDGET": "Delete Widget", + "FLIP_WIDGET": "Flip Widget", + "TITLE": "Title", + "UPDATE": "Update", + "LAYOUT": "Layout", + "BACKGROUND_COLOR": "Background Color", + "FOREGROUND_COLOR": "Foreground Color", + "FOREGROUND_TITLE_COLOR": "Foreground Title Color", + "THEME": "Theme", + "LIGHT": "Light", + "DARK": "Dark", + "TIMEZONE": "TimeZone", + "DIGITAL_FORMAT": "Digital Date Format", + "TOOLS_QUERY": "Query", + "SELECT": "Select", + "WHERE": "Where", + "BACK": "Back", + "PROJECT": "Project", + "GOTOREALTIME_TRUNK": "Go To Realtime Trunk", + "GOTO_TRUNK": "Go To Trunk", + "CRON": "Cron", + "MINUTES": "Minutes", + "HOURLY": "Hourly", + "YEARLY": "Yearly", + "EVERY": "Every", + "MINUTE": "Minute", + "ON_SECOND": "On second", + "HOUR_ON_MINUTE": "Hour on minute", + "AND_SECOND": "And second", + "DAY_AT": "Day at", + "START_TIME": "Start Time", + "ON_THE": "On the", + "OF_EVERY": "Of every", + "MONTH_AT": "Month at", + "AT": "At", + "LAST": "Last", + "LASTUNIT": "Unit", + "MAILACCOUNT": "Email Account", + "OF": "of", + "PAST_THE_HOUR": "Past the hour", + "DAY": "Day", + "WEEK": "Week", + "YEAR": "Year", + "ON": "On", + "PAI": "P-Asserted-Identity", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "EVENTVARIABLES": "Event Variables", + "AUTOCREATECONTACT": "Create contact automatically", + "LOCATION": "Location", + "NEW_TAB": "New Tab", + "NEW_WINDOW": "New Window", + "MOTION_TAB": "New Agent Dashboard Tab", + "WINDOWWIDTH": "Window Width(px)", + "WINDOWHEIGHT": "Window Height(px)", + "BODY": "Body", + "REPORTFOLDER": "Report Folder", + "REPORTSUBFOLDER": "Report Subfolder", + "AGENT": "Agent", + "HEADERS": "Headers", + "WHATSAPP": "WhatsApp Connector", + "LEVEL": "Level", + "NOTIFICATIONS": { + "DISPOSITION_CREATED_SUCCESS_TITLE": "Disposition successfully created", + "DISPOSITION_SAVED_SUCCESS_TITLE": "Disposition successfully saved", + "DISPOSITION_DELETE_TITLE": "Are you sure want to delete the disposition?", + "DISPOSITION_DELETE_MESSAGE": "{{ name }} will be deleted", + "DISPOSITION_DELETE_MESSAGE_CHILDREN": "{{ name }} will be deleted with all its sub dispositions", + "DISPOSITION_DELETED_SUCCESS_TITLE": "Disposition successfully deleted", + "DISPOSITIONS_DELETE_TITLE": "Are you sure want to delete the selected dispositions?", + "DISPOSITIONS_DELETE_MESSAGE": "{{ total }} dispositions will be deleted", + "TRIGGER_CREATED_SUCCESS_TITLE": "Trigger successfully created", + "TRIGGER_SAVED_SUCCESS_TITLE": "Trigger successfully saved", + "TRIGGER_DELETE_TITLE": "Are you sure want to delete the trigger?", + "TRIGGER_DELETE_MESSAGE": "{{ name }} will be deleted", + "TRIGGER_DELETED_SUCCESS_TITLE": "Trigger successfully deleted", + "TRIGGERS_DELETE_TITLE": "Are you sure want to delete the selected triggers?", + "TRIGGERS_DELETE_MESSAGE": "{{ total }} triggers will be deleted", + "TRIGGERS_DELETED_SUCCESS_TITLE": "Triggers successfully deleted", + "ACTION_CREATED_SUCCESS_TITLE": "Action successfully created", + "ACTION_SAVED_SUCCESS_TITLE": "Action successfully saved", + "ACTION_DELETE_TITLE": "Are you sure want to delete the action?", + "ACTION_DELETED_SUCCESS_TITLE": "Action successfully deleted", + "ACTIONS_DELETE_TITLE": "Are you sure want to delete the selected actions?", + "ACTIONS_DELETE_MESSAGE": "{{ total }} actions will be deleted", + "ACTIONS_DELETED_SUCCESS_TITLE": "Actions successfully deleted", + "CONDITION_CREATED_SUCCESS_TITLE": "Condition successfully created", + "CONDITION_SAVED_SUCCESS_TITLE": "Condition successfully saved", + "CONDITION_DELETE_TITLE": "Are you sure want to delete the condition?", + "CONDITION_DELETED_SUCCESS_TITLE": "Condition successfully deleted", + "CONDITIONS_DELETE_TITLE": "Are you sure want to delete the selected conditions?", + "CONDITIONS_DELETE_MESSAGE": "{{ total }} conditions will be deleted", + "CONDITIONS_DELETED_SUCCESS_TITLE": "Conditions successfully deleted" + }, + "ALL_DISPOSITIONS": "All dispositions", + "SELECT_LEVEL": "Select a level", + "ALL": "All", + "FIRST_LEVEL_DISPOSITION": "First Level Disposition", + "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", + "SEARCH_FIELDS": "Search fields", + "AUTOCREATE_FIELD": "Autocreate field", + "STANDARD": "Standard", + "GLOBALS": "Globals", + "MOTION_BAR": "Motion Bar" + } +} diff --git a/public/app/main/apps/tools/i18n/pt-BR.json b/public/app/main/apps/tools/i18n/pt-BR.json index 89475fd..ba506de 100644 --- a/public/app/main/apps/tools/i18n/pt-BR.json +++ b/public/app/main/apps/tools/i18n/pt-BR.json @@ -2,21 +2,21 @@ "TOOLS": { "BOT": "Voicebot", "CLONE_TRUNK": "Clonar Tronco", - "DISPOSITIONS": "Disposições", - "NEW_DISPOSITION": "Nova Disposição", - "ADD_DISPOSITION": "Adicionar Disposição", - "EDIT_DISPOSITION": "Editar Disposição", - "DELETE_DISPOSITION": "Excluir Disposição", + "DISPOSITIONS": "Qualificações", + "NEW_DISPOSITION": "Nova Qualificação", + "ADD_DISPOSITION": "Adicionar Qualificação", + "EDIT_DISPOSITION": "Editar Qualificação", + "DELETE_DISPOSITION": "Excluir Qualificação", "RUN_SCHEDULE": "Horário de execução", "SENDIFEMPTY": "Enviar se vazio", "NEXTCONTACT": "Próximo", "OUTBOUND_ROUTE": "Rota de Saída", - "EDIT_DASHBOARDITEM": "Editar widget do painel", - "FONTSIZE": "Tamanho da fonte", + "EDIT_DASHBOARDITEM": "Editar Widget", + "FONTSIZE": "Tamanho da Fonte", "CLONE_CUSTOMDASHBOARD": "Clonar Dashboard Personalizado", "LINK": "Link [https://]", "BACKGROUND": "Fundo", - "FOREGROUND": "Primeiro plano", + "FOREGROUND": "Primeiro Plano", "NONE": "Nenhum", "TOTAL": "Total", "ABANDONED": "Abandonado", @@ -30,17 +30,17 @@ "MULTIBARCHART": "Gráfico de Multibar", "MOVE_WIDGET": "Mover Widget", "USERADD_CUSTOMDASHBOARD": "Adicionar permissões do usuário", - "GOTODASHBOARD_CUSTOMDASHBOARD": "Ir para o painel de pré-visualização", - "GOTO_CUSTOMDASHBOARD": "Ir para o painel de pré-visualização", + "GOTODASHBOARD_CUSTOMDASHBOARD": "Pré-visualizar Dashboard", + "GOTO_CUSTOMDASHBOARD": "Pré-visualizar Dashboard", "METRIC": "Métrica", - "FILTERVOICEQUEUES": "Filtrar filas de voz", + "FILTERVOICEQUEUES": "Filtrar Filas de Voz", "SERIE1": "Serie 1", "SERIE2": "Serie 2", "SERIE3": "Serie 3", "REFRESH": "Atualizar [s]", "FORMAT": "Formato", "PATH": "Caminho absoluto", - "ALL_USERS": "Todos os usuários", + "ALL_USERS": "Todos Usuários", "SELECTED_USERS": "Usuários Selecionados", "ADD_WIDGET": "Adicionar Widget", "COLOR": "Cor", @@ -115,38 +115,38 @@ "TIMEOUT_REQUIRED": "Campo obrigatório", "AUTOCREATE_FIELD_REQUIRED": "Campo obrigatório", "CHANNEL_REQUIRED": "Campo obrigatório", - "IGNOREDIALERCONTACTID_REQUIRED": "O campo Ignore dialer contact Id é obrigatório" + "IGNOREDIALERCONTACTID_REQUIRED": "O campo Ignore Dialer Contact ID é obrigatório" }, "HOST": "Host", "SECRET": "Segredo", - "DEFAULTUSER": "Usuário padrão", + "DEFAULTUSER": "Usuário Padrão", "DESCRIPTION": "Descrição", - "ADD_TRUNK": "Adicionar tronco", + "ADD_TRUNK": "Adicionar Tronco", "HELP": { "T38PT_UDPTL": "Ex: sim, redundância, maxdatagram = 400", "SECRET": "Senha de autenticação", "HOST": "O domínio ou nome do host", "DEFAULTUSER": "Nome de usuário de autenticação", - "CALLERID": "O identificador de chamadas, no formato \\ \"name \" ", + "CALLERID": "O Caller ID, no formato \"name\" ", "REGISTRY": "A cadeia de registro, se exigida pelo provedor, geralmente defaultuser: secret @ host", "FROMDOMAIN": "Defina o padrão de: domínio em mensagens SIP ao atuar como um SIP ua (cliente). Alguns destinos podem exigir um nome de identidade obrigatório, em vez de apenas o endereço IP", "FROMUSER": "Como seu provedor conhece você. Este é qual usuário colocar em vez de callerid ao fazer chamadas para peer (outro proxy SIP). Válido apenas para type = peer.", "OUTBOUNDPROXY": "IP_address ou DNS SRV name (excluindo o prefixo _sip._udp): nome do SRV, nome do host ou endereço IP do SIP Proxy de saída. Envie a sinalização de saída para este proxy, não diretamente para os dispositivos. Válido apenas para type = peer.", "PORT": "O número da porta SIP", - "CONTEXT": "O contexto para o tronco", + "CONTEXT": "Contexto para o Tronco", "TYPE": "Determine o papel do SIP no asterisco. Usuário: usado para autenticar entrada - Peer: para chamadas de saída - Amigo: abrange as duas características dos itens acima.", - "DTMFMODE": "Como DTMF (Dual-Tone Multi-Frequency) são enviados. RFC2833: o modo padrão, os DTMF são enviados com RTP, mas fora do fluxo de áudio. INBAND: O DTMF é enviado em fluxo de áudio da conversa atual, tornando-se audível pelos alto-falantes. Requer uma alta carga de CPU. INFO: Embora esse método seja muito confiável, ele não é suportado por todos os dispositivos PBX e muitos troncos SIP.", + "DTMFMODE": "Como DTMF (Dual-Tone Multi-Frequency) é enviado. RFC2833: modo padrão, os DTMF são enviados com RTP, mas fora do fluxo de áudio. INBAND: O DTMF é enviado em fluxo de áudio da conversa atual, tornando-se audível pelos alto-falantes. Aumenta uso de CPU. INFO: Embora esse método seja muito confiável, ele não é suportado por todos os PBX e muitos troncos SIP.", "NAT": "Altere o comportamento do Asterisk para clientes atrás de um firewall. Se qualquer uma das opções separadas por vírgula for 'no', o Asterisk irá ignorar quaisquer outras configurações e definir nat = no.", "QUALIFY": "Determinar quando o SIP é realizável", - "ALLOWCODECS": "Codecs permitidos em ordem de preferência", + "ALLOWCODECS": "Codecs Permitidos em Ordem de Preferência", "INSECURE": "Especifique como lidar com conexões com peer, permitindo configurações inseguras", - "CALL_LIMIT": "O número limite das chamadas simultâneas de entrada e saída", - "DIRECTMEDIA": "Por padrão, o Asterisk tenta redirecionar o fluxo de mídia RTP para ir diretamente do chamador para o chamado. Alguns dispositivos não suportam isso (especialmente se um deles estiver por trás de um NAT). A configuração padrão é YES. Se você tiver todos os clientes por trás de um NAT ou, por algum outro motivo, quiser que o Asterisk permaneça no caminho de áudio, talvez seja necessário desativá-lo.", - "CALLCOUNTER": "Ativar contadores de chamadas em dispositivos", + "CALL_LIMIT": "Limite das Chamadas Simultâneas", + "DIRECTMEDIA": "Por padrão, o Asterisk tenta redirecionar o fluxo de mídia RTP para ir diretamente do chamador para o chamado. Alguns dispositivos não suportam isso (especialmente se um deles estiver por trás de um NAT). A configuração padrão é YES.", + "CALLCOUNTER": "Ativar Contagem de Chamadas no Dispositivos", "ADD_PHONE_TO_URI": "Definir se o provedor requer '; user = phone' no URL", "TRUST_REMOTE_PARTY_ID": "Definir se o ID do participante remoto deve ser confiável", "SEND_REMOTE_PARTY_ID_HEADER": "Definir se o Remote-Party-ID deve ser enviado (o padrão é não)", - "ENCRYPTION": "Se deve oferecer mídia criptografada SRTP (e somente mídia criptografada SRTP) em chamadas de saída para um peer. As chamadas falharão com HANGUPCAUSE = 58 se o par não suportar SRTP. O valor padrão é No", + "ENCRYPTION": "Se oferece SRTP encrypted media (e somente SRTP encrypted media) em chamadas outgoing para um peer. Causará falha HANGUPCAUSE=58 se peer não suportar SRTP. Padrão = Não", "TRANSPORT": "Definir os transportes padrão, em ordem de preferência", "OTHERFIELDS": "Outros campos para adicionar nos arquivos conf de troncos. Siga o formato de asterisco padrão (chave = valor), cada campo em uma única linha", "EMAILADDRESS": "Adicione um ou vários endereços separados por vírgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)", @@ -154,7 +154,7 @@ "EMAILBCCADDRESS": "Adicione um ou vários endereços separados por vírgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)", "NAME": "Somente números, letras e caracteres específicos (._) são suportados", "EVENTVARIABLES": "Se ativado, ele adiciona todas as variáveis ​​do evento ao URL (valor recomendado = Não. Defina como Sim somente para fins de avaliação)", - "BODY": "Se não for preenchido, o valor padrão será enviado", + "BODY": "Note: the body must be in RAW JSON format {\"key\":\"value\"} \nNote: If not filled out, o valor padrão será enviado", "INFO": "Inserir título", "SCRIPT": "Inserir script", "SCRIPT_INFO": "Inserir uma descrição para o script", @@ -172,20 +172,20 @@ "OTHER": "Outros", "ACTIVE": "Ativo", "CONTEXT": "Contexto", - "CALLERID": "Identificador de chamadas", + "CALLERID": "Identificador de Chamadas", "TYPE": "Tipo", "DTMFMODE": "Modo DTMF", "NAT": "NAT", "QUALIFY": "Qualificar", - "ALLOWCODECS": "Codecs permitidos", + "ALLOWCODECS": "Codecs Permitidos", "INSECURE": "Inseguro", "REGISTRY": "Registro", "DIRECTMEDIA": "Mídia Direta", - "CALLCOUNTER": "Contador de chamadas", + "CALLCOUNTER": "Contador de Chamadas", "FROMDOMAIN": "Do domínio", "FROMUSER": "Do usuário", "OUTBOUNDPROXY": "Proxy de saída", - "ADD_PHONE_TO_URI": "Adicionar telefone ao URL", + "ADD_PHONE_TO_URI": "Adicionar Telefone ao URL", "TRUST_REMOTE_PARTY_ID": "Trust Remote Party ID", "SEND_REMOTE_PARTY_ID_HEADER": "Send Remote Party ID Header", "ENCRYPTION": "Encriptação", @@ -207,18 +207,18 @@ "ADD_PAUSE": "Adicionar Pausas", "EDIT_PAUSE": "Editar Pausas", "DELETE_PAUSE": "Excluir Pausas", - "CANNEDANSWERS": "Respostas Prontas", - "ADD_CANNEDANSWER": "Adicionar Resposta Pronta", - "EDIT_CANNEDANSWER": "Editar Resposta Pronta", - "DELETE_CANNEDANSWER": "Excluir Resposta Pronta", + "CANNEDANSWERS": "Respostas Pré-definidas", + "ADD_CANNEDANSWER": "Adicionar Resposta Pré-definida", + "EDIT_CANNEDANSWER": "Editar Resposta Pré-fenida", + "DELETE_CANNEDANSWER": "Excluir Resposta Pré-definida", "KEY": "Key", "VALUE": "Valor", "SOUNDS": "Sons", "EDIT_SOUND": "Editar Som", - "DELETE_SOUND": " Ecluir Som", + "DELETE_SOUND": " Ecluir Áudio", "CANCEL": "Cancelar", "FINISH": "Finalizar", - "DROP_TO_UPLOAD": "Largar para fazer o upload", + "DROP_TO_UPLOAD": "Soltar para Fazer Upload", "UPLOADING": "Uploading", "TRIGGERS": "Gatilhos", "EDIT_TRIGGER": "Editar Gatilhos", @@ -235,26 +235,26 @@ "ADD_INTERVAL": "Adicionar Intervalo", "TOOLS": "Ferramentas", "ID": "Id", - "AUDIO": "Audio", - "DOWNLOAD_SOUND": "Download Som", + "AUDIO": "Áudio", + "DOWNLOAD_SOUND": "Download Áudio", "UPLOAD_SOUND": "Ferramentas", "CHANNEL": "Canal", "NEW_TRIGGER": "Novo Gatilho", "GENERAL": "Geral", "STATUS": "Status", - "CONDITIONS&ACTIONS": "Condições e ações", - "ALLCONDITIONS": "Conheça todas estas condições:", - "ANYCONDITIONS": "Conheça qualquer uma destas condições:", + "CONDITIONS&ACTIONS": "Condições e Ações", + "ALLCONDITIONS": "Atenda todas estas condições:", + "ANYCONDITIONS": "Atenda alguma destas condições:", "ACTIONS": "Ações:", "NEW_AUTOMATION": "Nova Automação", "TIMEOUT": "Tempo esgotado", "PEERSTATUS": "Status de par Status", - "CALL_LIMIT": "Limite de chamadas", + "CALL_LIMIT": "Limite de Chamadas", "OTHERFIELDS": "Outros campos", "NEW_VARIABLE": "Nova Variável", "NEW_TAG": "Nova Tag", "NEW_PAUSE": "Nova Pausa", - "NEW_CANNEDANSWER": "Nova Resposta Pronta", + "NEW_CANNEDANSWER": "Nova Resposta Pré-definada", "CONFIRM_PASSWORD": "Confirme a Senha", "NEW_TRUNK": "Novo Tronco", "FROM": "De ", @@ -308,7 +308,7 @@ "EMAILADDRESS": "Endereço de Email", "EMAILCCADDRESS": "Cc", "EMAILBCCADDRESS": "Bcc", - "CURRENTDAY": "Dia atual", + "CURRENTDAY": "Dia Atual", "DAILY": "Diariamente", "WEEKLY": "Semanal", "MONTHLY": "Mensal", @@ -339,14 +339,14 @@ "NO_ALLCONDITION_AVAILABLE": "Nenhuma condição disponível", "NO_ACTION_AVAILABLE": "Nenhuma ação disponível", "ACTION": "Ação", - "EDIT_ANYCONDITION": "Editar condição", - "DELETE_ANYCONDITION": "Excluir condição", - "NEW_ANYCONDITION": "Nova condição", - "ADD_ANYCONDITION": "Adicionar condição", - "EDIT_ALLCONDITION": "Editar condição", - "DELETE_ALLCONDITION": "Excluir condição", - "NEW_ALLCONDITION": "Nova condição", - "ADD_ALLCONDITION": "Adicionar condição", + "EDIT_ANYCONDITION": "Editar Condição", + "DELETE_ANYCONDITION": "Excluir Condição", + "NEW_ANYCONDITION": "Nova Condição", + "ADD_ANYCONDITION": "Adicionar Condição", + "EDIT_ALLCONDITION": "Editar Condição", + "DELETE_ALLCONDITION": "Excluir Condição", + "NEW_ALLCONDITION": "Nova Condição", + "ADD_ALLCONDITION": "Adicionar Condição", "EDIT_ACTION": "Editar Ação", "DELETE_ACTION": "Excluir Ação", "NEW_ACTION": "Nova Ação", @@ -356,9 +356,9 @@ "OUTBOUNDROUTE": "Rota de Saída", "EQUALS": "Igual a", "NOT_EQUALS": "Não é igual a", - "CONTACT_MANAGER": "Gerente de contatos", + "CONTACT_MANAGER": "Gestor de Contatos", "INTEGRATIONS": "Integrações", - "MOTIONBAR": "Motion Bar", + "MOTIONBAR": "MotionBar", "JSCRIPTY": "Jscripty", "URL_FORWARD": "URL Forward", "WEB_POPUP": "Web Popup", @@ -386,11 +386,11 @@ "DROP_TO_UPLOAD_MESSAGE": "Solte arquivos de áudio aqui para fazer o upload. Apenas MP3, WAV, GSM - máx. 15MB", "POLLING_INTERVAL": "Intervalo de pesquisa (segundos)", "DASHBOARD": "Dashboard", - "NEW_DASHBOARDITEM": "Novo widget do Dashboard", + "NEW_DASHBOARDITEM": "Novo Widget do Dashboard", "COUNTER": "Contador", "IFRAME": "IFrame", "CLOCK": "Relógio", - "ADD_DASHBOARDITEM": "Adicionar widget do Dashboard", + "ADD_DASHBOARDITEM": "Adicionar Widget do Dashboard", "EDIT_WIDGET": "Editar Widget", "DELETE_WIDGET": "Excluir Widget", "FLIP_WIDGET": "Girar Widget", @@ -398,28 +398,28 @@ "UPDATE": "Atualizar", "LAYOUT": "Layout", "BACKGROUND_COLOR": "Cor de fundo", - "FOREGROUND_COLOR": "Cor do primeiro plano", + "FOREGROUND_COLOR": "Cor do Primeiro Plano", "FOREGROUND_TITLE_COLOR": "Cor do Título do Primeiro Plano", "THEME": "Tema", "LIGHT": "Claro", - "DARK": "Sombrio", + "DARK": "Dark", "TIMEZONE": "Fuso horário", - "DIGITAL_FORMAT": "Formato de data digital", + "DIGITAL_FORMAT": "Formato Data Digital", "TOOLS_QUERY": "Query", "SELECT": "Selecione", "WHERE": "Where", "BACK": "Voltar", "PROJECT": "Projeto", - "GOTOREALTIME_TRUNK": "Ir para o tronco em tempo real", - "GOTO_TRUNK": "Ir para o tronco", + "GOTOREALTIME_TRUNK": "Ir para o Tronco em Tempo Real", + "GOTO_TRUNK": "Ir para Tronco", "CRON": "Cron", "MINUTES": "Minutos", - "HOURLY": "De hora em hora", + "HOURLY": "De Hora em Hora", "YEARLY": "Anual", "EVERY": "Cada", "MINUTE": "Minuto", "ON_SECOND": "No segundo", - "HOUR_ON_MINUTE": "Hora no minuto", + "HOUR_ON_MINUTE": "Hora no Minuto", "AND_SECOND": "Em segundo lugar", "DAY_AT": "Dia em", "START_TIME": "Hora de início", @@ -440,7 +440,7 @@ "PAGE": "Página", "ROWSPERPAGE": "Linhas por Página", "EVENTVARIABLES": "Variáveis ​​de Eventos", - "AUTOCREATECONTACT": "Criar contato automaticamente", + "AUTOCREATECONTACT": "Criar Contato Automaticamente", "LOCATION": "Localização", "NEW_TAB": "Nova aba", "NEW_WINDOW": "Nova janela", @@ -456,41 +456,41 @@ "SCRIPT": "Roteiro", "SCRIPT_INFO": "Informações", "SCRIPT_TYPE": "Tipo", - "MOTION_TAB": "Nova guia Painel do agente", + "MOTION_TAB": "Nova Aba", "WHATSAPP": "Conector WhatsApp", - "AUTOCREATE_FIELD": "Autocreate field", + "AUTOCREATE_FIELD": "Criar Campo Automaticamente", "GLOBALS": "Globais", "SEARCH_FIELDS": "Campos de busca", "STANDARD": "Padrão", - "MOTION_BAR": "Motion Bar", + "MOTION_BAR": "MotionBar", "ALL": "Tudo", - "ALL_DISPOSITIONS": "Todas as disposições", - "FIRST_LEVEL_DISPOSITION": "Disposição de primeiro nível", + "ALL_DISPOSITIONS": "Todas Qualificações", + "FIRST_LEVEL_DISPOSITION": "Qualificação de Primeiro Nível", "LEVEL": "Nível", "SECOND_LEVEL_DISPOSITION": "Disposição de Segundo Nível", "SELECT_LEVEL": "Selecione um nível", "TITLEFONTSIZE": "Tamanho do título da fonte", "ADD_CONTACTITEMTYPE": "Adicionar", - "CONTACTITEMTYPE": "Tipos de item de contato", + "CONTACTITEMTYPE": "Tipos de Item de Contato", "NEW_CONTACTITEMTYPE": "Novo tipo de item de contato", "ORDER_BY": "Ordenar por", "RGBBACKGROUNDCOLOR": "Cor de fundo RGB", "EMAIL": "E-mail", - "FILTERCHATWEBSITES": "Filtrar sites de bate-papo", - "FILTEREMAILACCOUNTS": "Filtrar contas de e-mail", - "FILTERFAXACCOUNTS": "Filtrar contas de fax", - "FILTEROPENCHANNELACCOUNTS": "Filtrar contas OpenChannel", - "FILTERSMSACCOUNTS": "Filtrar contas de SMS", - "FILTERWHATSAPPACCOUNTS": "Filtrar contas do Whatsapp", + "FILTERCHATWEBSITES": "Filtrar Sites Chat", + "FILTEREMAILACCOUNTS": "Filtrar Contas Email", + "FILTERFAXACCOUNTS": "Filtrar Contas Fax", + "FILTEROPENCHANNELACCOUNTS": "Filtrar Contas OpenChannel", + "FILTERSMSACCOUNTS": "Filtrar Contas SMS", + "FILTERWHATSAPPACCOUNTS": "Filtrar Contas Whatsapp", "MANAGED": "Gerenciou", "MANAGED_TEXT": "Interações gerenciadas", "OPENED": "Aberto", "OPENED_TEXT": "Interações abertas", - "IGNOREDIALERCONTACTID": "Ignorar o ID de contato do discador", + "IGNOREDIALERCONTACTID": "Ignorar o ID de Contato do Discador", "MAIL_SUBSTATUS": "Substatus do Email", "OFFLINE_MESSAGE": "Mensagem offline", - "DELETE_CONTACTITEMTYPE": "Excluir tipo de item de contato", - "EDIT_CONTACTITEMTYPE": "Editar tipo de item de contato", + "DELETE_CONTACTITEMTYPE": "Excluir Tipo de Item de Contato", + "EDIT_CONTACTITEMTYPE": "Editar Tipo de Item de Contato", "ORDER_BY_NUMERIC": "A ordem por campo deve ser um valor numérico!" } } diff --git a/public/app/main/apps/video/i18n/is.json b/public/app/main/apps/video/i18n/is.json new file mode 100644 index 0000000..81b9c5c --- /dev/null +++ b/public/app/main/apps/video/i18n/is.json @@ -0,0 +1,40 @@ +{ + "VIDEO": { + "VIDEO": "Video", + "SCREENRECORDINGS": "Screen Recordings", + "SEARCH_FOR_ANYONE": "Search", + "INTERACTIONID": "Interaction ID", + "CHANNEL": "Channel", + "AGENT": "Agent", + "RATING": "Rating", + "NO_RATING": "No Rating", + "RECORDSTARTTIME": "Record Start Time", + "RECORDENDTIME": "Record End Time", + "DURATION": "Duration", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "NO_AVAILABLE_INFO": "No Available Info", + "EDIT_SCREENRECORDING": "Rate Screen Recording", + "PLAY_SCREENRECORDING": "Play Screen Recording", + "DOWNLOAD_SCREENRECORDING": "Download Screen Recording", + "DELETE_SCREENRECORDING": "Delete Screen Recording", + "CANT_DOWNLOAD_THIS_FILE": "Can't download this file", + "WRONG_EXTENSION": "The file presents the wrong extension", + "FILE_NOT_FOUND": "File not found", + "SAVE": "Save", + "DELETE": "Delete", + "UPDATEDAT": "Last Update", + "PROPERTIES": "Properties", + "FORMAT": "Format", + "STARTEDAT": "Record Start Time", + "CLOSEDAT": "Record End Time", + "CREATEDAT": "Created at", + "ID": "Id", + "AGENTNAME": "Agent", + "CANT_PLAY_THIS_FILE": "Can't play this type of file", + "LEGEND": {}, + "ERRORS": {}, + "HELP": {} + } +} diff --git a/public/app/main/apps/voice/i18n/ar.json b/public/app/main/apps/voice/i18n/ar.json index e913b7d..f58cd7c 100644 --- a/public/app/main/apps/voice/i18n/ar.json +++ b/public/app/main/apps/voice/i18n/ar.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "أضف الفريق إلى البادئة", "ALIAS": "الاسم المستعار", "MAXCAPACITY": "السعة القصوى", - "WORKING": "عمل" + "WORKING": "عمل", + "CALL_NUMBER_REDIRECT": "إلى أي رقم تريد إعادة توجيه المكالمة؟", + "NO_AGENT_AVAILABLE": "لا يوجد وكيل متاح" } } diff --git a/public/app/main/apps/voice/i18n/bs.json b/public/app/main/apps/voice/i18n/bs.json index 28d2655..e88dc1c 100644 --- a/public/app/main/apps/voice/i18n/bs.json +++ b/public/app/main/apps/voice/i18n/bs.json @@ -1,507 +1,511 @@ { "VOICE": { - "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", - "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", - "FAILUREREASON": "Failure reason", - "TEXT": "Text", - "DOWNLOADTRANSCRIBE_VOICERECORDING": "Download Transcript", - "INBOUND": "Inbound", - "OUTBOUND": "Outbound", - "DIALER": "Dialer", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "ABANDONEDCALLS": "Abandoned Queue Calls", - "WAITING_FOR_AGENTS": "Waiting for agents", - "ACTIVE": "Active", - "NO_AGENT_ONLINE": "No Agent Online", - "PARTIALPAUSE": "Partial Pause", + "SECOND_LEVEL_DISPOSITION": "Drugi Nivo Dispozicija", + "THIRD_LEVEL_DISPOSITION": "Treći Nivo Dispozicija", + "FAILUREREASON": "Razlog neuspjeha", + "TEXT": "Tekst", + "DOWNLOADTRANSCRIBE_VOICERECORDING": "Skini Transkript", + "INBOUND": "Dolazni", + "OUTBOUND": "Odlazni", + "DIALER": "Birač", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "ABANDONEDCALLS": "Napušteni Queue Pozivi", + "WAITING_FOR_AGENTS": "Čeka na Specijalistu", + "ACTIVE": "Aktivno", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "PARTIALPAUSE": "Djelimična Pauza", "STATUS": "Status", "TIMER": "Timer", - "ALIAS": "Alias", - "ALL": "All", + "ALIAS": "Pseudonim", + "ALL": "Svi", "IDLE": "Idle", - "EDIT_TRUNK": "Edit Trunk", - "GOTO_VOICEQUEUE": "Go To Realtime Voice Queues", - "GOTOREALTIME_VOICEQUEUE": "Go To Realtime Voice Queues", - "NAME": "Name", - "LOGOUT": "Logout", + "EDIT_TRUNK": "Uredi Trunk", + "GOTO_VOICEQUEUE": "Idi Na Realtime Voice Queues", + "GOTOREALTIME_VOICEQUEUE": "Idi Na Realtime Voice Queues", + "NAME": "Naziv", + "LOGOUT": "Odjava", "VOICEQUEUES": "Voice Queues", - "SEARCH_FOR_ANYONE": "Search", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "EDIT_VOICEQUEUE": "Edit Voice Queue", - "DELETE_VOICEQUEUE": "Delete Voice Queue", - "MOHSOUNDS": "Moh Sounds", - "STRATEGY": "Strategy", - "DESCRIPTION": "Description", - "ADD_VOICEQUEUE": "Add Voice Queue", - "CREATED_AT": "Created At", - "CANT_PLAY_GSM_AUDIO_FILES": "Can't play gsm or wav49 audio files", - "APPLICATIONS_LIST": "Applications List", - "GENERAL": "General", + "SEARCH_FOR_ANYONE": "Traži", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "DELETE_VOICEDISPOSITION": "Izbriši Voice Dispoziciju", + "EDIT_VOICEDISPOSITION": "Uredi Voice Dispoziciju", + "EDIT_VOICEQUEUE": "Uredi Voice Queue", + "DELETE_VOICEQUEUE": "Izbriši Voice Queue", + "MOHSOUNDS": "MNČ Zvukovi", + "STRATEGY": "Strategija", + "DESCRIPTION": "Opis", + "ADD_VOICEQUEUE": "Dodaj Voice Queue", + "CREATED_AT": "Kreirano U", + "CANT_PLAY_GSM_AUDIO_FILES": "Ne mogu reproducirati gsm ili wav49 audio datoteku", + "APPLICATIONS_LIST": "Lista Aplikacija", + "GENERAL": "Općenito", "TIMEOUT": "Timeout", - "MAXLENGTH": "Maximum Length", - "RETRY": "Retry", - "WRAPUPTIME": "Wrapup Time", - "WEIGHT": "Weight", - "JOINWHENEMPTY": "Join when empty", - "LEAVEWHENEMPTY": "Leave when empty", - "MUSICONHOLD": "Music On Hold", - "ANNOUNCETOAGENT": "Announce To Agent", - "ANNOUNCEMENTS": "Announcements", - "ADVANCED": "Advanced", - "ANNOUNCEFREQUENCY": "Announce Frequency", - "MINANNOUNCEFREQUENCY": "Minimum Announce Frequency", - "PERIODICANNOUNCEFREQUENCY": "Periodic Announce Frequency", - "RANDOMPERIODICANNOUNCE": "Random Periodic Announce", - "ANNOUNCEHOLDTIME": "Announce Hold Time", - "ANNOUNCECALLERPOSITION": "Announce Caller Position", - "ANNOUNCEPOSITIONLIMIT": "Announce Position Limit", - "REPORTHOLDTIMEAGENT": "Report Agent Hold Time", - "PERIODICANNOUNCE": "Periodic Announce", - "HOLDTIMEANNOUNCE": "Hold Time Announce", - "YOUARENEXTANNOUNCE": "'You are next' Announce", - "THEREAREANNOUNCE": "'There are' Announce", - "WAITINGCALLSANNOUNCE": "Waiting Calls Announce", - "ESTIMATEDHOLDTIMEANNOUNCE": "Estimated Hold Time Announce", - "MINUTESANNOUNCE": "Minutes Announce", - "MINUTEANNOUNCE": "Minute Announce", - "SECONDSANNOUNCE": "Seconds Announce", - "THANKYOUANNOUNCE": "'Thank You' Announce", - "AUTOPAUSE": "Auto Pause", - "AFTERCALLWORK": "After Call Work", - "AFTERCALLWORKDURATION": "After Call Work Duration", - "RINGINUSE": "Ring In Use", - "MEMBERDELAY": "Member Delay", + "MAXLENGTH": "Maksimalna Dužina", + "RETRY": "Ponovljeni Pokušaj", + "WRAPUPTIME": "Vrijeme Završetka", + "WEIGHT": "Težina", + "JOINWHENEMPTY": "Pridruži se kada je prazno", + "LEAVEWHENEMPTY": "Napusti kada je prazno", + "MUSICONHOLD": "Muzika Na Čekanju", + "ANNOUNCETOAGENT": "Najavi Specijalisti", + "ANNOUNCEMENTS": "Najave", + "ADVANCED": "Napredno", + "ANNOUNCEFREQUENCY": "Najava Učestalost", + "MINANNOUNCEFREQUENCY": "Minimalna Učestalost Najava", + "PERIODICANNOUNCEFREQUENCY": "Učestalost Periodičnih Najava", + "RANDOMPERIODICANNOUNCE": "Nasumično Periodično Objavljivanje", + "ANNOUNCEHOLDTIME": "Najavi Vrijeme Čekanja", + "ANNOUNCECALLERPOSITION": "Najavi Poziciju Pozivaoca", + "ANNOUNCEPOSITIONLIMIT": "Najavi Limit Pozicije", + "REPORTHOLDTIMEAGENT": "Izvještaj Vrijeme Čekanja Specijaliste", + "PERIODICANNOUNCE": "Periodična Najava", + "HOLDTIMEANNOUNCE": "Vrijeme Čekanja Najave", + "YOUARENEXTANNOUNCE": "'Vi ste sljedeći' Najava", + "THEREAREANNOUNCE": "'Ispred su' Najava", + "WAITINGCALLSANNOUNCE": "Najava Poziva Na Čekanju", + "ESTIMATEDHOLDTIMEANNOUNCE": "Procjenjeno Hold Vrijeme Najava", + "MINUTESANNOUNCE": "Minute Najava", + "MINUTEANNOUNCE": "Minuta Najava", + "SECONDSANNOUNCE": "Sekunde Najava", + "THANKYOUANNOUNCE": "'Hvala Vam' Najava", + "AUTOPAUSE": "Automatska Pauza", + "AFTERCALLWORK": "Posao Nakon Poziva", + "AFTERCALLWORKDURATION": "Posao Nakon Poziva Trajanje", + "RINGINUSE": "Zvono U Upotrebi", + "MEMBERDELAY": "Član Odgoda", "TIMEOUTRESTART": "Timeout Restart", - "MONITORFORMAT": "Recording Format", - "SETINTERFACEVARIABLES": "Set Interface Variables", - "SETQUEUEVARIABLES": "Set Queue Variables", - "SETQUEUEENTRYVARIABLES": "Set Queue Entry Variables", - "VARIABLE": "Variable", - "CONTEXT": "Context", - "SAVE": "Save", - "SETTINGS": "Settings", - "INBOUNDROUTES": "Inbound Routes", - "PHONENUMBER": "Phone Number", - "ADD_INBOUNDROUTE": "Add Inbound Route", - "EDIT_INBOUNDROUTE": "Edit Inbound Route", - "DELETE_INBOUNDROUTE": "Delete Inbound Route", - "ACTIONS": "Actions", - "OUTBOUNDROUTES": "Outbound Routes", - "DESTINATIONPATTERN": "Destination Pattern", - "ADD_OUTBOUNDROUTE": "Add Outbound Route", - "EDIT_OUTBOUNDROUTE": "Edit Outbound Route", - "DELETE_OUTBOUNDROUTE": "Delete Outbound Route", - "CUTDIGITS": "Cut Digits", - "RECORDING": "Recording", - "RECORDINGFORMAT": "Recording format", - "INTERNALROUTES": "Internal Routes", - "ADD_INTERNALROUTE": "Add Internal Route", - "EDIT_INTERNALROUTE": "Edit Internal Route", - "DELETE_INTERNALROUTE": "Delete Internal Route", - "CONTEXTS": "Contexts", - "ADD_CONTEXT": "Add Context", - "EDIT_CONTEXT": "Edit Context", - "DELETE_CONTEXT": "Delete Context", - "VOICEMAILS": "Voicemails", - "ADD_VOICEMAIL": "Add Voicemail", - "EDIT_VOICEMAIL": "Edit Voicemail", - "DELETE_VOICEMAIL": "Delete Voicemail", - "FULLNAME": "Full Name", - "EMAIL": "Email", - "MAILBOX": "Mailbox", - "PASSWORD": "Password", - "CONFIRM_PASSWORD": "Confirm Password", - "TIMEZONE": "Timezone", - "ATTACH": "Attach", - "ENVELOPE": "Envelope", - "DELETE": "Delete", - "EMAILBODY": "Email Body", - "EMAILSUBJECT": "Email Subject", - "MAXSECONDS": "Max Seconds", - "MAXMESSAGES": "Max Messages", - "MESSAGES": "Messages", - "SORT": "Sort", - "ADD_MUSICONHOLD": "Add Music On Hold", - "MUSICONHOLDS": "Music On Hold", - "EDIT_MUSICONHOLD": "Edit Music On Hold", - "DELETE_MUSICONHOLD": "Delete Music On Hold", - "DIRECTORY": "Directory", - "AUDIOFILES": "Audio Files", - "RECORDINGS": "Recordings", + "MONITORFORMAT": "Format Snimanja", + "SETINTERFACEVARIABLES": "Postavi Varijable Interfejsa ", + "SETQUEUEVARIABLES": "Postavi Varijable Queue", + "SETQUEUEENTRYVARIABLES": "Postavi Varijable Ulaznog Queue", + "VARIABLE": "Varijabla", + "CONTEXT": "Kontekst", + "SAVE": "Sačuvaj", + "SETTINGS": "Postavke", + "INBOUNDROUTES": "Dolazne Rute", + "PHONENUMBER": "Broj Telefona", + "ADD_INBOUNDROUTE": "Dodaj Inbound Rutu", + "EDIT_INBOUNDROUTE": "Uredi Dolaznu Rutu", + "DELETE_INBOUNDROUTE": "Izbriši Dolaznu Rutu", + "ACTIONS": "Radnje", + "OUTBOUNDROUTES": "Odlazne Rute", + "DESTINATIONPATTERN": "Obrazac Odredišta", + "ADD_OUTBOUNDROUTE": "Dodaj Outbound Rutu", + "EDIT_OUTBOUNDROUTE": "Uredi Odlaznu Rutu", + "DELETE_OUTBOUNDROUTE": "Izbriši Odlaznu Rutu", + "CUTDIGITS": "Izreži Cifre", + "RECORDING": "Snimanje", + "RECORDINGFORMAT": "Format snimanja", + "INTERNALROUTES": "Interne Rute", + "ADD_INTERNALROUTE": "Dodaj Internu Rutu", + "EDIT_INTERNALROUTE": "Uredi Internu Rutu", + "DELETE_INTERNALROUTE": "Izbriši Internu Rutu", + "CONTEXTS": "Konteksti", + "ADD_CONTEXT": "Dodaj Kontekst", + "EDIT_CONTEXT": "Uredi Kontekst", + "DELETE_CONTEXT": "Izbriši Kontekst", + "VOICEMAILS": "Govorne pošte", + "ADD_VOICEMAIL": "Dodaj Govornu Poštu ", + "EDIT_VOICEMAIL": "Uredi Govornu Poštu", + "DELETE_VOICEMAIL": "Izbriši Govorno Poštu", + "FULLNAME": "Puno Ime", + "EMAIL": "E-Mail", + "MAILBOX": "Poštansko sanduče", + "PASSWORD": "Lozinka", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "TIMEZONE": "Vremenska Zona", + "ATTACH": "Priloži", + "ENVELOPE": "Koverta", + "DELETE": "Izbriši", + "EMAILBODY": "E-Mail Tijelo", + "EMAILSUBJECT": "E-Mail Predmet", + "MAXSECONDS": "Maks Sekundi", + "MAXMESSAGES": "Maks Poruka", + "MESSAGES": "Poruke", + "SORT": "Sortiraj", + "ADD_MUSICONHOLD": "Dodaj Muziku Na Čekanju", + "MUSICONHOLDS": "Muzika Na Čekanju", + "EDIT_MUSICONHOLD": "Uredi Muzika Na Čekanju", + "DELETE_MUSICONHOLD": "Izbriši Muzika Na Čekanju", + "DIRECTORY": "Adresar", + "AUDIOFILES": "Audio Datoteke", + "RECORDINGS": "Snimci", "CHANSPY": "ChanSpy", - "PREFIX": "Prefix", - "OPTIONS": "Options", + "PREFIX": "Prefiks", + "OPTIONS": "Opcije", "AUTH": "Auth", - "ADD_CHANSPY": "Add ChanSpy", - "EDIT_CHANSPY": "Edit ChanSpy", - "DELETE_CHANSPY": "Delete ChanSpy", - "AGENTS": "Agents", - "TELEPHONES": "Telephones", + "ADD_CHANSPY": "Dodaj ChanSpy", + "EDIT_CHANSPY": "Uredi ChanSpy", + "DELETE_CHANSPY": "Izbriši ChanSpy", + "AGENTS": "Specijalisti", + "TELEPHONES": "Telefoni", "QUEUES": "Queues", - "QUEUE_CALLS": "Queue Calls", - "QUEUE_PARAMETERS": "Queue Parameters", - "ABANDONED_CALLS": "Abandoned Calls", - "OUTBOUND_CALLS": "Outbound Calls", - "AGI": "Agi", - "DIAL": "Dial", + "QUEUE_CALLS": "Queue Pozivi", + "QUEUE_PARAMETERS": "Queue Parametri", + "ABANDONED_CALLS": "Napušteni Pozivi", + "OUTBOUND_CALLS": "Odlazni Pozivi", + "AGI": "AGI", + "DIAL": "Biraj", "CALLYSQUARE": "CallySquare", - "INTERNALDIAL": "Internal Dial", - "EXTERNALDIAL": "External Dial", - "RINGGROUP": "Ring Group", - "PLAYBACK": "Playback", + "INTERNALDIAL": "Interno Biranje", + "EXTERNALDIAL": "Eksterno Pozivanje", + "RINGGROUP": "Grupa Zvona", + "PLAYBACK": "Reprodukcija", "QUEUE": "Queue", - "SET": "Set", - "VOICEMAIL": "Voicemail", + "SET": "Postavi", + "VOICEMAIL": "Govorna pošta", "GOTO": "GoTo", - "HANGUP": "Hangup", - "CUSTOM": "Custom", - "PROJECT": "Cally-Square Project", - "TECHNOLOGY/RESOURCE": "Technology/Resource", + "HANGUP": "Prekid", + "CUSTOM": "Prilagođeno", + "PROJECT": "Cally-Square Projekat", + "TECHNOLOGY/RESOURCE": "Tehnologija/Resursi", "URL": "URL", - "EDIT_APP": "Edit Application", - "EDIT_INTERVAL": "Edit Interval", - "DELETE_APP": "Delete Application", - "INTERVALS": "Intervals", - "USER": "User", + "EDIT_APP": "Uredi Aplikaciju", + "EDIT_INTERVAL": "Uredi Interval", + "DELETE_APP": "Izbriši Aplikaciju", + "INTERVALS": "Intervali", + "USER": "Korisnik", "TRUNK": "Trunk", - "PHONE": "Phone", - "AUDIO_FILES": "Audio Files", - "ANNOUNCE_OVERRIDES": "Announce Overrides", - "MACRO": "Macro", + "PHONE": "Telefon", + "AUDIO_FILES": "Audio Datoteke", + "ANNOUNCE_OVERRIDES": "Najave Nadjačavanja", + "MACRO": "Makro", "GOSUB": "GoSub", - "RULE": "Rule", - "POSITION": "Position", - "ANSWER": "Answer", - "VALUE": "Value", - "MAILBOX@CONTEXT": "Mailbox@Context", - "EXTENSION": "Extension", - "PRIORITY": "Priority", - "HANGUP_CAUSE": "Hangup Cause", - "OUTBOUNDDIAL": "Outbound Dial", - "CALLER_ID": "Caller ID", - "NO_MESSAGE_AVAILABLE": "No messages available", - "NO_SOUND_AVAILABLE": "No sounds available", - "VOICERECORDINGS": "Voice Recordings", + "RULE": "Pravilo", + "POSITION": "Pozicija", + "ANSWER": "Odgovori", + "VALUE": "Vrijednost", + "MAILBOX@CONTEXT": "Poštanskosanduče@Kontekst", + "EXTENSION": "Ekstenzija", + "PRIORITY": "Prioritet", + "HANGUP_CAUSE": "Uzrok Prekida", + "OUTBOUNDDIAL": "Odlazno Biranje", + "CALLER_ID": "Pozivatelj ID", + "NO_MESSAGE_AVAILABLE": "Nema dostupnih poruka", + "NO_SOUND_AVAILABLE": "Nema dostupnih zvukova", + "VOICERECORDINGS": "Voice Snimci", "CHANSPIES": "ChanSpy", "VOICE": "Voice", "REALTIME": "Realtime", - "ID": "Id", - "VOICEMAIL_CONTEXT": "Context", - "NO_MOHSOUND_AVAILABLE": "No Music On Hold available", - "FILE": "File", - "ADD_MOHSOUND": "Add Music On Hold sound", - "DOWNLOAD_MOHSOUND": "Download Music On Hold sound", - "DELETE_MOHSOUND": "Delete Music On Hold sound", - "UNIQUEID": "Unique ID", - "AGENT": "Agent", - "TYPE": "Type", - "RATING": "Rating", + "ID": "ID", + "VOICEMAIL_CONTEXT": "Kontekst", + "NO_MOHSOUND_AVAILABLE": "Nema dostupne Muzike Na Čekanju", + "FILE": "Datoteka", + "ADD_MOHSOUND": "Dodaj Muzika Na Čekanju zvuk ", + "DOWNLOAD_MOHSOUND": "Skini Muzika Na Čekanju zvuk", + "DELETE_MOHSOUND": "Izbriši Muzika Na Čekanju zvuk", + "UNIQUEID": "Jedinstveni ID", + "AGENT": "Specijalist", + "TYPE": "Vrsta", + "RATING": "Ocjena", "AUDIO": "Audio", - "DATE": "Date", - "NEW_VOICEQUEUE": "New Voice Queue", - "NEW_INBOUNDROUTE": "New Inbound Route", - "NEW_OUTBOUNDROUTE": "New Outbound Route", - "NEW_INTERNALROUTE": "New Internal Route", - "NEW_CONTEXT": "New Context", - "NEW_VOICEMAIL": "New Voicemail", - "NEW_MUSICONHOLD": "New Music On Hold", - "NEW_CHANSPY": "New ChanSpy", - "PENALTY": "Penalty", - "ADD_TEAM_TO_VOICEQUEUE": "Add Team to Voice Queue", - "ADD_AGENT_TO_VOICEQUEUE": "Add Agent to Voice Queue", - "EDIT_DIAL": "Edit Dial", - "EDIT_AGI": "Edit AGI", - "EDIT_INTERNALDIAL": "Edit Internal Dial", - "EDIT_EXTERNALDIAL": "Edit External Dial", - "EDIT_RINGGROUP": "Edit Ring Group", - "EDIT_PLAYBACK": "Edit Playback", - "EDIT_QUEUE": "Edit Queue", - "EDIT_SET": "Edit Set", - "EDIT_GOTO": "Edit GoTo", - "EDIT_HANGUP": "Edit Hangup", - "EDIT_CUSTOM": "Edit Custom", - "DURATION": "Duration", - "RECEIVED_AT": "Received At", - "YES": "Yes", - "NO": "No", - "HANGUPCAUSE_1": "1 = Unallocated number", - "HANGUPCAUSE_16": "16 = Normal call clearing", - "HANGUPCAUSE_17": "17 = User busy", - "HANGUPCAUSE_18": "18 = No user responding (telehone device not connected)", - "HANGUPCAUSE_21": "21 = Call rejected", - "HANGUPCAUSE_22": "22 = Number changed", - "HANGUPCAUSE_27": "27 = Destination out of order", - "HANGUPCAUSE_38": "38 = Network out of order", - "HANGUPCAUSE_41": "41 = Temporary failure", - "RANDOM": "Random", - "ALPHABETICAL": "Alphabetical", - "NO_APPS_AVAILABLE": "No applications available", - "DOWNLOAD_VOICERECORDING": "Download Voice Recording", - "DELETE_VOICERECORDING": "Delete Voice Recording", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", + "DATE": "Datum", + "NEW_VOICEQUEUE": "Novi Voice Queue", + "NEW_INBOUNDROUTE": "Nova Dolazna Ruta", + "NEW_OUTBOUNDROUTE": "Nova Odlazna Ruta", + "NEW_INTERNALROUTE": "Nova Interna Ruta", + "NEW_CONTEXT": "Novi Kontekst", + "NEW_VOICEMAIL": "Nova Govorna Pošta", + "NEW_MUSICONHOLD": "Nova Muzika Na Čekanju", + "NEW_CHANSPY": "Novi ChanSpy", + "PENALTY": "Kazna", + "ADD_TEAM_TO_VOICEQUEUE": "Dodaj Tim u Voice Queue", + "ADD_AGENT_TO_VOICEQUEUE": "Dodaj Specijalistu u Voice Queue", + "EDIT_DIAL": "Uredi Biranje", + "EDIT_AGI": "Uredi AGI", + "EDIT_INTERNALDIAL": "Uredi Interno Biranje", + "EDIT_EXTERNALDIAL": "Uredi Eksterno Biranje", + "EDIT_RINGGROUP": "Uredi Ring Grupu", + "EDIT_PLAYBACK": "Uredi Reprodukciju", + "EDIT_QUEUE": "Uredi Queue", + "EDIT_SET": "Uredi Postavljanje", + "EDIT_GOTO": "Uredi GoTo", + "EDIT_HANGUP": "Uredi Hangup", + "EDIT_CUSTOM": "Uredi Prilagođeno", + "DURATION": "Trajanje", + "RECEIVED_AT": "Primljeno U", + "YES": "Da", + "NO": "Ne", + "HANGUPCAUSE_1": "1 = Nedodijeljen broj", + "HANGUPCAUSE_16": "16 = Normalno brisanje poziva", + "HANGUPCAUSE_17": "17 = Korisnik zauzet", + "HANGUPCAUSE_18": "18 = Korisnik ne odgovara (telefonski uređaj nije povezan)", + "HANGUPCAUSE_21": "21 = Poziv odbijen", + "HANGUPCAUSE_22": "22 = Broj promijenjen", + "HANGUPCAUSE_27": "27 = Odredište poremećeno", + "HANGUPCAUSE_38": "38 = Mreža poremećena", + "HANGUPCAUSE_41": "41 = Privremeno neuspješno", + "RANDOM": "Nasumično", + "ALPHABETICAL": "Abecedno", + "NO_APPS_AVAILABLE": "Nema dostupnih aplikacija", + "DOWNLOAD_VOICERECORDING": "Skini Voice Snimanje", + "DELETE_VOICERECORDING": "Izbriši Voice Snimak", + "INTERNAL": "Interno", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", "TRUNK_STATUS": "Trunk Status", - "REGISTERED": "Registered", - "UNREGISTERED": "Unregistered", - "LAGGED": "Lagged", - "REACHABLE": "Reachable", - "UNREACHABLE": "Unreachable", - "UNKNOWN": "Unknown", - "NOT_INUSE": "Not In Use", - "INUSE": "In Use", - "BUSY": "Busy", - "INVALID": "Invalid", - "UNAVAILABLE": "Unavailable", - "RINGING": "Ringing", - "ONHOLD": "On Hold", - "RING": "Ring", - "UP": "Up", + "REGISTERED": "Registrovan", + "UNREGISTERED": "Neregistrovan", + "LAGGED": "Zaostao", + "REACHABLE": "Dostupno", + "UNREACHABLE": "Nedostupan", + "UNKNOWN": "Nepoznato", + "NOT_INUSE": "Nije u upotrebi", + "INUSE": "U Upotrebi", + "BUSY": "Zauzet", + "INVALID": "Nevažeći", + "UNAVAILABLE": "Nedostupno", + "RINGING": "Zvoniti", + "ONHOLD": "Na Čekanju", + "RING": "Zvono", + "UP": "Gore", "INFO": "Info", - "TRUNKS": "Trunks", - "REGISTRY": "Registry", - "NO_REGISTRY": "No Registry", - "LOGGED_IN": "Logged In (SIP Connected)", - "PAUSED": "Paused", - "WAITING": "Waiting", - "TALKING": "Talking", + "TRUNKS": "Trunkovi", + "REGISTRY": "Registar", + "NO_REGISTRY": "Nema registra", + "LOGGED_IN": "Prijavljen (SIP povezan)", + "PAUSED": "Pauzirano", + "WAITING": "Čeka", + "TALKING": "Priča", "DID": "DID", - "CALLER": "Caller", - "TOTAL": "Total", - "ANSWERED": "Answered", - "ABANDONED": "Abandoned", - "UNMANAGED": "Unmanaged", - "AVG_HOLD_TIME": "Avg Hold Time", - "AVG_DURATION": "Av Duration", - "AVG_BILLABLE": "Avg Billable", - "SOURCE": "Source", - "DESTINATION": "Destination", - "REJECTED": "Rejected", - "FAILED": "Failed", - "CALLED": "Called", - "CONNECTED": "Connected", - "NO_RATING": "No rating", - "EDIT_VOICERECORDING": "Edit Voice Recording", - "APPLICATION_NAME": "Application Name", - "ARGUMENTS": "Arguments", - "NO_AVAILABLE_INFO": "No Available Info", - "ADD_AGENT_TO_QUEUE": "Add Agent To Queue", - "DEFAULT_PAUSE": "DEFAULT PAUSE", - "PAUSE": "Pause", - "UNPAUSE": "End Pause", - "REDIRECT_TO_NUMBER": "Redirect To Number", - "REDIRECT_TO_AGENT": "Redirect To Agent", - "AGENTADD_VOICEQUEUE": "Add Agent To Voice Queue", - "APPLICATION": "Application", - "FILES": "Files", + "CALLER": "Pozivatelj", + "TOTAL": "Ukupno", + "ANSWERED": "Odgovoreno", + "ABANDONED": "Napušteno", + "UNMANAGED": "Neupravljan", + "AVG_HOLD_TIME": "Prosječno Vrijeme Čekanja", + "AVG_DURATION": "Prosječno Trajanje", + "AVG_BILLABLE": "Prosječno Naplativo", + "SOURCE": "Izvor", + "DESTINATION": "Odredište", + "REJECTED": "Odbijeno", + "FAILED": "Neuspješno", + "CALLED": "Zvao", + "CONNECTED": "Povezano", + "NO_RATING": "Nema ocjene", + "EDIT_VOICERECORDING": "Uredi Voice Snimanje", + "APPLICATION_NAME": "Naziv Aplikacije", + "ARGUMENTS": "Argumenti", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ADD_AGENT_TO_QUEUE": "Dodaj Specijalistu u Queue", + "DEFAULT_PAUSE": "ZADANA PAUZA", + "PAUSE": "Pauza", + "UNPAUSE": "Prekini Pauzu", + "REDIRECT_TO_NUMBER": "Preusmjeri na broj", + "REDIRECT_TO_AGENT": "Preusmjeri na Specijalistu", + "AGENTADD_VOICEQUEUE": "Dodaj Specijalistu u Voice Queue", + "APPLICATION": "Aplikacija", + "FILES": "Datoteke", "FORMAT": "Format", - "MODE": "Mode", - "RECORD": "Record", - "TEAMADD_VOICEQUEUE": "Add Team To Voice Queue", - "NEW_MOHSOUND": "New Music On Hold sound", - "DOWNLOAD_MESSAGE": "Download", - "DELETE_MESSAGE": "Delete", - "QUEUE_PARAMS": "Queue Parameters", - "TOTAL_OFFERED": "Total Offered", - "READY": "Ready", - "AGENTADD_QUEUE": "Add Agent To Voice Queue", - "AGENTSADD_QUEUE": "Add Agents To Voice Queue", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "CLOSING": "Closing", - "TAGS": "Tags", - "WAITING_FOR_AGENT": "Waiting For Agents", - "EDIT_OUTBOUNDDIAL": "Edit Outbound Dial", - "ACCOUNTNAME": "Account Name", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "DISPOSITION": "Disposition", + "MODE": "Način", + "RECORD": "Snimai", + "TEAMADD_VOICEQUEUE": "Dodaj Tim u Voice Queue", + "NEW_MOHSOUND": "Novi Muzika Na Čekanju zvuk", + "DOWNLOAD_MESSAGE": "Skini", + "DELETE_MESSAGE": "Izbriši", + "QUEUE_PARAMS": "Queue Parametri", + "TOTAL_OFFERED": "Ukupno Ponuđeno", + "READY": "Spreman", + "AGENTADD_QUEUE": "Dodaj Specijalistu u Voice Queue", + "AGENTSADD_QUEUE": "Dodaj Specijaliste u Voice Queue", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "CLOSING": "Zatvaranje", + "TAGS": "Tagovi", + "WAITING_FOR_AGENT": "Čeka na Specijalistu", + "EDIT_OUTBOUNDDIAL": "Uredi Odlazno Biranje", + "ACCOUNTNAME": "Nalog Naziv", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "DISPOSITION": "Dispozicija", "CHAT": "Chat", - "MAIL": "Email", + "MAIL": "E-Mail", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", - "CLEAR": "Clear", - "CALLS": "Calls", - "STARTEDAT": "Started At", - "ENDEDAT": "Ended At", + "CLEAR": "Izbriši", + "CALLS": "Pozivi", + "STARTEDAT": "Počelo U", + "ENDEDAT": "Završeno U", "TAG": "Tag", "DETAILS": "Details", - "BILLABLESECONDS": "Billable seconds", - "ANSWEREDAT": "Answered At", - "NOTE": "Note", - "CLOSE": "Close", - "SELECT_DATE": "Select Start Date", - "SELECT_TYPE": "Select Type", - "VOICEPREFIXES": "Out Prefixes", - "NEW_VOICEPREFIX": "New Prefix", - "ADD_VOICEPREFIX": "Add Prefix", - "EDIT_VOICEPREFIX": "Edit Prefix", - "AGENTADD_VOICEPREFIX": "Add Agent to Prefix", - "TEAMADD_VOICEPREFIX": "Add Team to Prefix", - "DELETE_VOICEPREFIX": "Delete Prefix", - "OUTBOUNDROUTE": "Outbound Route", - "CALLERIDALL": "Caller Id", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Mandatory disposition pause status", - "SCREENRECORDING": "Manage Screen Recording", - "START_SCREENRECORDING": "Start Screen Recording", - "STOP_SCREENRECORDING": "Stop Screen Recording", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "CANT_DOWNLOAD_THIS_FILE": "Can't download this file", - "WRONG_EXTENSION": "The file presents the wrong extension", - "FILE_NOT_FOUND": "File not found", - "TEAMS_ASSOCIATION": "Teams Association", + "BILLABLESECONDS": "Naplative sekunde", + "ANSWEREDAT": "Odgovoreno Na", + "NOTE": "Bilješka", + "CLOSE": "Zatvori", + "SELECT_DATE": "Odaberi Datum", + "SELECT_TYPE": "Odaberi Vrstu", + "VOICEPREFIXES": "Odlazni Prefiksi", + "NEW_VOICEPREFIX": "Novi Prefiks", + "ADD_VOICEPREFIX": "Dodaj Prefiks", + "EDIT_VOICEPREFIX": "Uredi Prefiks", + "AGENTADD_VOICEPREFIX": "Dodaj Specijalistu u Prefiks", + "TEAMADD_VOICEPREFIX": "Dodaj Tim u Prefiks", + "DELETE_VOICEPREFIX": "Izbriši Prefiks", + "OUTBOUNDROUTE": "Odlazna Ruta", + "CALLERIDALL": "Pozivatelj ID", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Obavezna dispozicija status pauze", + "SCREENRECORDING": "Upravljaj Snimanjem Ekrana", + "START_SCREENRECORDING": "Pokreni Snimanje Ekrana", + "STOP_SCREENRECORDING": "Zaustavi Snimanje Ekrana", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje Ekrana u toku", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje Ekrana dostupno", + "CANT_DOWNLOAD_THIS_FILE": "Ne mogu skinuti ovau datoteku", + "WRONG_EXTENSION": "Datoteka ima pogrešnu ekstenziju", + "FILE_NOT_FOUND": "Datoteka nije pronađen", + "TEAMS_ASSOCIATION": "Asocijacija Timova", "TRANSCRIBE": "Transcribe", - "TRANSCRIPT": "Transcript", - "SENTIMENTANALYSIS": "Sentiment Analysis", - "TRANSCRIBESTATUS_COMPLETED": "Completed", - "TRANSCRIBESTATUS_IN_PROGRESS": "In progress", - "TRANSCRIBESTATUS_FAILED": "Failed", - "TRANSCRIBESTATUS_NEW": "New", - "TRANSCRIPTANALYSIS": "Transcript & Analysis", - "SENTIMENT_POSITIVE": "Positive", - "SENTIMENT_NEGATIVE": "Negative", - "SENTIMENT_NEUTRAL": "Neutral", - "SENTIMENT_MIXED": "Mixed", - "RUNTRANSCRIBE_VOICERECORDING": "Run Transcribe", - "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Run Transcribe&Sentiment", - "RUNSENTIMENT_VOICERECORDING": "Run Sentiment", + "TRANSCRIPT": "Transkript", + "SENTIMENTANALYSIS": "Sentiment Analiza", + "TRANSCRIBESTATUS_COMPLETED": "Završeno", + "TRANSCRIBESTATUS_IN_PROGRESS": "U toku", + "TRANSCRIBESTATUS_FAILED": "Nije uspjelo", + "TRANSCRIBESTATUS_NEW": "Novi", + "TRANSCRIPTANALYSIS": "Transkript & Analiza", + "SENTIMENT_POSITIVE": "Pozitivno", + "SENTIMENT_NEGATIVE": "Negativno", + "SENTIMENT_NEUTRAL": "Neutralno", + "SENTIMENT_MIXED": "Miješano", + "RUNTRANSCRIBE_VOICERECORDING": "Pokreni Transcribe", + "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Pokreni Transcribe&Sentiment", + "RUNSENTIMENT_VOICERECORDING": "Pokreni Sentiment", "SENTIMENT": "Sentiment", - "SERVICELEVEL": "Service level", - "MAXCAPACITY": "Max capacity", + "SERVICELEVEL": "Nivo Servisa", + "MAXCAPACITY": "Maks Kapacitet", "WORKING": "Working", "LEGEND": { - "CUSTOM_APPLICATION": "(*) - Custom application" + "CUSTOM_APPLICATION": "(*) - Prilagođena aplikacija." }, "ERRORS": { - "PROJECT_REQUIRED": "Mandatory field", - "TRUNK_REQUIRED": "Mandatory field", - "VARIABLE_REQUIRED": "Mandatory field", - "NAME_REQUIRED": "Mandatory field", - "APPLICATION_NAME_REQUIRED": "Mandatory field", - "TIMEOUT_REQUIRED": "Mandatory field", - "PHONENUMBER_REQUIRED": "Mandatory field", - "CONTEXT_REQUIRED": "Mandatory field", - "DESTINATIONPATTERN_REQUIRED": "Mandatory field", - "FULLNAME_REQUIRED": "Mandatory field", - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "MAILBOX_REQUIRED": "Mandatory field", - "PASSWORD_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "TIMEZONE_REQUIRED": "Mandatory field", - "PREFIX_REQUIRED": "Mandatory field", - "OPTIONS_REQUIRED": "Mandatory field", - "AFTERCALLWORKDURATION_REQUIRED": "Mandatory field", - "TECHNOLOGY/RESOURCE_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "EXTENSION_REQUIRED": "Mandatory field", - "PRIORITY_REQUIRED": "Mandatory field", - "APPLICATION_REQUIRED": "Mandatory field", - "OUTBOUNDROUTE_REQUIRED": "Mandatory field", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "CALLERIDALL_MUST_VALID_PATTERN": "Wrong format", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", - "CALLER_ID_MUST_VALID_PATTERN": "Wrong format", - "PENALTY_REQUIRED": "You must specify a value for penalty" + "PROJECT_REQUIRED": "Obavezno polje", + "TRUNK_REQUIRED": "Obavezno polje", + "VARIABLE_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "APPLICATION_NAME_REQUIRED": "Obavezno polje", + "TIMEOUT_REQUIRED": "Obavezno polje", + "PHONENUMBER_REQUIRED": "Obavezno polje", + "CONTEXT_REQUIRED": "Obavezno polje", + "DESTINATIONPATTERN_REQUIRED": "Obavezno polje", + "FULLNAME_REQUIRED": "Obavezno polje", + "EMAIL_REQUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "Pogrešan format", + "MAILBOX_REQUIRED": "Obavezno polje", + "PASSWORD_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinke se ne poklapaju", + "TIMEZONE_REQUIRED": "Obavezno polje", + "PREFIX_REQUIRED": "Obavezno polje", + "OPTIONS_REQUIRED": "Obavezno polje", + "AFTERCALLWORKDURATION_REQUIRED": "Obavezno polje", + "TECHNOLOGY/RESOURCE_REQUIRED": "Obavezno polje", + "PHONE_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "EXTENSION_REQUIRED": "Obavezno polje", + "PRIORITY_REQUIRED": "Obavezno polje", + "APPLICATION_REQUIRED": "Obavezno polje", + "OUTBOUNDROUTE_REQUIRED": "Obavezno polje", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "CALLERIDALL_MUST_VALID_PATTERN": "Pogrešan format", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno polje", + "CALLER_ID_MUST_VALID_PATTERN": "Pogrešan format", + "PENALTY_REQUIRED": "Moraš navesti vrijednost za kaznu" }, "HELP": { - "TIMEOUT": "How many seconds to ring a device", - "MAXLENGTH": "Maximum number of callers allowed to wait in a queue: zero means unlimited", - "RETRY": "Time in seconds to wait before calling the next agent in queue when the timeout is expired", - "WRAPUPTIME": "Time in seconds to keep a queue member unavailable after completing a call", - "WEIGHT": "Weight of a queue in order to define priority if members are associated with multiple queues", - "JOINWHENEMPTY": "Used to control whether a caller is passed to a queue when no members are available", - "LEAVEWHENEMPTY": "Used to control whether callers are made leave the queue when no members are available to take calls", - "ANNOUNCEFREQUENCY": "How often to announce the caller’s position and/or estimated hold time in the queue (zero to disable)", - "MINANNOUNCEFREQUENCY": "Minimum announcement frequency (useful when the caller’s position changes frequently)", - "PERIODICANNOUNCEFREQUENCY": "Frequency of periodic announcements to the caller", - "ANNOUNCEPOSITIONLIMIT": "Used if announce-position is defined as either 'limit' or 'more'", - "AFTERCALLWORKDURATION": "Pause length triggered by the After Call Work option", - "MEMBERDELAY": "Inserts a delay prior to the caller and agent in queue get connected", - "MUSICONHOLD": "Sets the music class to use for a particular queue", - "ANNOUNCETOAGENT": "Play an announcement to the agent answering the call (typically to let him know what queue the caller is coming from)", - "RANDOMPERIODICANNOUNCE": "If yes, the defined periodic announcements will be played random", - "ANNOUNCEHOLDTIME": "Plays the estimated hold time along with the periodic announcements (Yes/No/Once)", - "ANNOUNCECALLERPOSITION": "Used to define if the caller’s position in the queue should be announced: No=never; Yes=always; Limit=only if it is within the limit defined by announce-position-limit; More= only if it is beyond the value defined by announce-position-limit", - "REPORTHOLDTIMEAGENT": "Enables reporting caller’s hold time to the agent in queue prior to connection", - "PERIODICANNOUNCE": "Set of periodic announcements to be played (in the order)", - "HOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“Hold time”. Undefined=no announcement", - "YOUARENEXTANNOUNCE": "Choose a Sound defined in Tools. Default=“You are now first in line”. Undefined=no announcement", - "THEREAREANNOUNCE": "Choose a Sound defined in Tools. Default=“There are”. Undefined=no announcement", - "WAITINGCALLSANNOUNCE": "Choose a Sound defined in Tools. Default=“calls waiting”. Undefined=no announcement", - "ESTIMATEDHOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“The current estimated hold time is”. Undefined=no announcement", - "MINUTESANNOUNCE": "Choose a Sound defined in Tools. Default=“minutes”. Undefined=no announcement", - "MINUTEANNOUNCE": "Choose a Sound defined in Tools. Default=“minute”. Undefined=no announcement", - "SECONDSANNOUNCE": "Choose a Sound defined in Tools. Default=“seconds”. Undefined=no announcement", - "THANKYOUANNOUNCE": "Choose a Sound defined in Tools. Default=“Thank you for your patience”. Undefined=no announcement", - "AFTERCALLWORK": "If enabled, the agent will be set on Pause after completing a call", - "AUTOPAUSE": "Enables/disables the automatic pause of agents who fail to answer a call. If enabled it causes the agent to be paused in all queues he belongs to", - "RINGINUSE": "To avoid/allow sending calls to members whose status is In Use", - "TIMEOUTRESTART": "If yes, this resets the timeout for an agent to answer when either a BUSY or CONGESTION status is received from the channel", - "MONITORFORMAT": "Specifies the format of the recording file. If it set to 'inactive', calls will not be recorded", - "CONTEXT": "Allows a caller to exit the queue by pressing a single DTMF digit. If a context is specified and the caller enters a number, that digit will attempt to be matched in the context specified, and dialplan execution will continue there", - "SETINTERFACEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information see wiki docs)", - "SETQUEUEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent and leaving the queue, some variables will be set (for more information, see wiki docs)", - "SETQUEUEENTRYVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information, see wiki docs)", - "RECORDING": "Enable call recording", - "VOICEMAIL_CONTEXT": "The context of the relative extension", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "CALLERIDALL": "Supported format: \"CallerId\" <number>", - "CALLER_ID": "Supported format: \"CallerId\" <number>", - "MANDATORYDISPOSITIONPAUSEID": "Pause status to set during mandatory disposition", - "SERVICELEVEL": "Second settings for service level (default=0, no SL). Used for service level statistics (calls answered within service level time frame)", - "SAVE_ROUTES": "The routing has been modified. Remember to save if you don't want to lose your changes." + "TIMEOUT": "Broj sekundi koliko se poziva Specijalista u queue", + "MAXLENGTH": "Maksimalan broj pozivatelja koji mogu čekati u queue (0 = neograničeno)", + "RETRY": "Koliko dugo (u sekundama) treba čekati prije pozivanja sljedećeg Specijaliste u queue kada Specijalistin timeout istekne", + "WRAPUPTIME": "Koliko dugo (u sekundama) treba zadržati Specijalistu nedostupnim u queue nakon završetka poziva", + "WEIGHT": "Koristi se za određivanje prioriteta ako su Specijalisti povezani s više od jednog queue", + "JOINWHENEMPTY": "Ako je pozivatelj dodan u queue, kada nema dostupnih Specijalista", + "LEAVEWHENEMPTY": "Ako je pozivatelj izbačen iz queue kada nema dostupnih Specijalista", + "ANNOUNCEFREQUENCY": "Koliko često najavljivati poziciju pozivaoca i/ili procjenjeno vrijeme čekanja u queue (0=onemogućeno)", + "MINANNOUNCEFREQUENCY": "Minimalna učestalost najava (korisno kada se pozicija pozivatelja često mijenja)", + "PERIODICANNOUNCEFREQUENCY": "Učestalost periodičnih najava pozivatelju", + "ANNOUNCEPOSITIONLIMIT": "Koristi se ako ste definisali poziciju najave kao 'ograničenje' ili 'više'", + "AFTERCALLWORKDURATION": "Dužina pauze koju pokreće opcija Nakon Poziva Posao", + "MEMBERDELAY": "Unosi odgodu prije nego što se pozivatelj i Specijalista u queue se povežu", + "MUSICONHOLD": "Postavlja muzičku klasu za korištenje u određeni queue", + "ANNOUNCETOAGENT": "Reproducira najavu Specijaliste koji odgovara na poziv (npr. da bi ga obavijestio iz kojeg queue pozivatelj dolazi)", + "RANDOMPERIODICANNOUNCE": "Ako je da, reproducira periodične najave slučajnim redoslijedom", + "ANNOUNCEHOLDTIME": "Reproducira procijenjeno vrijeme čekanja zajedno s periodičnim najavama (Da/Ne/Jednom)", + "ANNOUNCECALLERPOSITION": "Koristi se za definisanje da li treba najaviti poziciju pozivatelja u queue: Ne=nikada; Da=uvijek; Limit=samo ako je unutar ograničenja definisanog sa announce-position-limit; Više=samo ako je preko vrijednosti definisane sa announce-position-limit", + "REPORTHOLDTIMEAGENT": "Omogućuje izvještavanje o vremenu čekanja pozivatelja Specijalisti u queue prije povezivanja", + "PERIODICANNOUNCE": "Set periodičnih najava koje će se puštati (po redoslijedu)", + "HOLDTIMEANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"Vrijeme čekanja\". Nedefinisano=bez najave", + "YOUARENEXTANNOUNCE": "Odaberite Zvuk definiram u Alatima. Zadano=\"Sada ste prvi u redu\". Nedifinirano=bez najave", + "THEREAREANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=\"Ispred su\". Nedefinisano=bez najave", + "WAITINGCALLSANNOUNCE": "Odaberide Zvuk definiran u Alatima. Zadano=\"pozivi na čekanju\". Nedifinirano=bez najave", + "ESTIMATEDHOLDTIMEANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"Trenutno procijenjeno vrijeme čekanja je\". Nedefinisano=bez najave", + "MINUTESANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=“minute”. Nedefinisano=bez najave", + "MINUTEANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=“minute”. Nedefinisano=bez najave", + "SECONDSANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"sekunde\". Nedefinisano=bez najave", + "THANKYOUANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=\"Hvala Vam na strpljenju\". Nedefinisano=bez najave", + "AFTERCALLWORK": "Ako je omogućeno, Specijalist će biti postavljen na pauzu nakon završetka poziva", + "AUTOPAUSE": "Omogućava/onemogućava automatsku pauzu Specijaliste koji ne odgovaraju na poziv. Ako je omogućeno, to uzrokuje da Specijalista bude pauziran u svim queue kojima pripada", + "RINGINUSE": "Za izbjegavanje/dozvoljavanje slanja poziva članovima čiji je status U Upotrebi", + "TIMEOUTRESTART": "Ako je da, ovo restartuje timeout za Specijalistu da odgovori kada je ili Zauzet ili Zagušen status primljen od kanala", + "MONITORFORMAT": "Određuje format datoteke koji će se koristiti prilikom snimanja. Ako je format monitora neaktivan, pozivi se neće snimati", + "CONTEXT": "Omogućava pozivatelju da napusti queue pritiskom na jednu DTMF cifru. Ako je kontekst određen i pozivatelj unese broj, ta cifra će se pokušati upariti u određenom kontekstu, a izvršavanje plana biranja će se tamo nastaviti.", + "SETINTERFACEVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "SETQUEUEVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue i napusti queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "SETQUEUEENTRYVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "RECORDING": "Omogući snimanje poziva", + "VOICEMAIL_CONTEXT": "Kontekst relativne ekstenzije", + "NAME": "Samo brojevi, slova i specifični znakovi (._) su podržani", + "CALLERIDALL": "Podržan format: \"CallerId\" ", + "CALLER_ID": "Podržan format: \"CallerId\" ", + "MANDATORYDISPOSITIONPAUSEID": "Status pauze za postavljanje tokom obavezne dispozicije", + "SERVICELEVEL": "Druga podešavanja za nivo servisa (zadano=0, bez SL). Koristi se za statistiku nivoa servisa (odgovoreni pozivi unutar vremenskog okvira nivoa servisa \"SLA\")", + "SAVE_ROUTES": "Rutiranje je izmijenjeno. Ne zaboravi da sačuvaš ako ne želiš da izgubiš promijene." }, "NOTIFICATIONS": { - "EXTENSION_CREATED_SUCCESS_TITLE": "Route successfully created", - "EXTENSION_SAVED_SUCCESS_TITLE": "Route successfully saved", - "EXTENSION_DELETE_TITLE": "Are you sure want to delete the route?", - "EXTENSION_DELETE_MESSAGE": "{{ name }} will be deleted", - "EXTENSION_DELETED_SUCCESS_TITLE": "Route successfully deleted", - "EXTENSIONS_DELETE_TITLE": "Are you sure want to delete the selected routes?", - "EXTENSIONS_DELETE_MESSAGE": "{{ total }} routes will be deleted", - "ROUTING_APPLICATION_DELETE_TITLE": "Are you sure want to delete the application?", - "ROUTING_APPLICATION_DELETE_MESSAGE": "{{ name }} will be deleted", - "ROUTING_APPLICATIONS_DELETE_TITLE": "Are you sure want to delete the selected applications?", - "ROUTING_APPLICATIONS_DELETE_MESSAGE": "{{ total }} applications will be deleted", - "CALLYSQUARE_PROJECTS_GET_ERROR": "Unable to retrieve any CallySquare project", - "TRUNKS_GET_ERROR": "Unable to retrieve any trunk", - "VOICE_CONTEXTS_GET_ERROR": "Unable to retrieve any voice context", - "QUEUES_GET_ERROR": "Unable to retrieve any queue", - "SOUNDS_GET_ERROR": "Unable to retrieve any sound", - "USERS_GET_ERROR": "Unable to retrieve any user", - "VARIABLES_GET_ERROR": "Unable to retrieve any variable", - "VOICEMAILS_GET_ERROR": "Unable to retrieve any voicemail", - "TAGS_GET_ERROR": "Unable to retrieve any tag", - "INTERVALS_GET_ERROR": "Unable to retrieve any interval" - } + "EXTENSION_CREATED_SUCCESS_TITLE": "Ruta uspješno kreirana", + "EXTENSION_SAVED_SUCCESS_TITLE": "Ruta je uspješno sačuvana", + "EXTENSION_DELETE_TITLE": "Jesi li siguran da želiš izbrisati rutu?", + "EXTENSION_DELETE_MESSAGE": "{{ name }} će biti izbrisan", + "EXTENSION_DELETED_SUCCESS_TITLE": "Ruta uspješno izbrisana", + "EXTENSIONS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane rute?", + "EXTENSIONS_DELETE_MESSAGE": "{{ total }} ruta će biti izbrisano", + "ROUTING_APPLICATION_DELETE_TITLE": "Jesi li siguran da želiš izbrisati aplikaciju?", + "ROUTING_APPLICATION_DELETE_MESSAGE": "{{ name }} će biti izbrisano", + "ROUTING_APPLICATIONS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane aplikacije?", + "ROUTING_APPLICATIONS_DELETE_MESSAGE": "{{ total }} aplikacija će biti izbrisao", + "CALLYSQUARE_PROJECTS_GET_ERROR": "Nije moguće pozvati bilo koji CallySquare projekat", + "TRUNKS_GET_ERROR": "Nije moguće pozvati bilo koji trunk", + "VOICE_CONTEXTS_GET_ERROR": "Nije moguće pozvati bilo kakav voice kontekst", + "QUEUES_GET_ERROR": "Nije moguće pozvati bilo koji queue", + "SOUNDS_GET_ERROR": "Nije moguće pozvati nikakav zvuk", + "USERS_GET_ERROR": "Nije moguće pozvati nijednog korisnika", + "VARIABLES_GET_ERROR": "Nije moguće pozvati nijednu varijablu", + "VOICEMAILS_GET_ERROR": "Nije moguće pozvati govornu poštu", + "TAGS_GET_ERROR": "Nije moguće pozvati nijedan tag", + "INTERVALS_GET_ERROR": "Nije moguće pozvati bilo koji interval", + "CALL_HANGUP_SUCCESS": "Poziv je uspješno prekinuo vezu", + "CALL_REDIRECT_SUCCESS": "Poziv je uspješno preusmjeren" + }, + "CALL_NUMBER_REDIRECT": "Na koji broj želite preusmjeriti poziv?", + "NO_AGENT_AVAILABLE": "Nema raspoloživog agenta" } } diff --git a/public/app/main/apps/voice/i18n/cs.json b/public/app/main/apps/voice/i18n/cs.json index acf12e0..8da2a19 100644 --- a/public/app/main/apps/voice/i18n/cs.json +++ b/public/app/main/apps/voice/i18n/cs.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Přidat tým k předponě", "ALIAS": "Alias", "MAXCAPACITY": "Maximální kapacita", - "WORKING": "Pracovní" + "WORKING": "Pracovní", + "CALL_NUMBER_REDIRECT": "Na jaké číslo chcete hovor přesměrovat?", + "NO_AGENT_AVAILABLE": "Žádný agent není k dispozici" } } diff --git a/public/app/main/apps/voice/i18n/da.json b/public/app/main/apps/voice/i18n/da.json index d178808..e16b6e8 100644 --- a/public/app/main/apps/voice/i18n/da.json +++ b/public/app/main/apps/voice/i18n/da.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Føj team til præfiks", "ALIAS": "Alias", "MAXCAPACITY": "Max kapacitet", - "WORKING": "Arbejder" + "WORKING": "Arbejder", + "CALL_NUMBER_REDIRECT": "Hvilket nummer vil du omdirigere opkaldet til?", + "NO_AGENT_AVAILABLE": "Ingen tilgængelig agent" } } diff --git a/public/app/main/apps/voice/i18n/de.json b/public/app/main/apps/voice/i18n/de.json index 832ae56..b2a2d0e 100644 --- a/public/app/main/apps/voice/i18n/de.json +++ b/public/app/main/apps/voice/i18n/de.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Team zum Präfix hinzufügen", "ALIAS": "Alias", "MAXCAPACITY": "Max. Kapazität erreicht", - "WORKING": "am Arbeiten" + "WORKING": "am Arbeiten", + "CALL_NUMBER_REDIRECT": "Auf welche Nummer möchten Sie den Anruf umleiten?", + "NO_AGENT_AVAILABLE": "Kein Agent verfügbar" } } diff --git a/public/app/main/apps/voice/i18n/es.json b/public/app/main/apps/voice/i18n/es.json index d815a36..c6497be 100644 --- a/public/app/main/apps/voice/i18n/es.json +++ b/public/app/main/apps/voice/i18n/es.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Agregar equipo al prefijo", "ALIAS": "Alias", "MAXCAPACITY": "máxima capacidad", - "WORKING": "Laboral" + "WORKING": "Laboral", + "CALL_NUMBER_REDIRECT": "¿A qué número desea redirigir la llamada?", + "NO_AGENT_AVAILABLE": "Ningún agente disponible" } } diff --git a/public/app/main/apps/voice/i18n/et.json b/public/app/main/apps/voice/i18n/et.json index fe28adb..409e74d 100644 --- a/public/app/main/apps/voice/i18n/et.json +++ b/public/app/main/apps/voice/i18n/et.json @@ -477,6 +477,10 @@ "SECOND_LEVEL_DISPOSITION": "Teise taseme korraldus", "THIRD_LEVEL_DISPOSITION": "Kolmanda taseme korraldus", "TEAMADD_VOICEPREFIX": "Lisa meeskond eesliidesse", - "ALIAS": "Teise nimega" + "ALIAS": "Teise nimega", + "CALL_NUMBER_REDIRECT": "Millisele numbrile soovite kõne ümber suunata?", + "MAXCAPACITY": "Maksimaalne mahutavus", + "NO_AGENT_AVAILABLE": "Agent pole saadaval", + "WORKING": "Töötab" } } diff --git a/public/app/main/apps/voice/i18n/fa.json b/public/app/main/apps/voice/i18n/fa.json index eed1435..71e049b 100644 --- a/public/app/main/apps/voice/i18n/fa.json +++ b/public/app/main/apps/voice/i18n/fa.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "اضافه کردن تیم به پیشوند", "ALIAS": "نام مستعار", "MAXCAPACITY": "حداکثر ظرفیت", - "WORKING": "کار کردن" + "WORKING": "کار کردن", + "CALL_NUMBER_REDIRECT": "می‌خواهید تماس را به کدام شماره تغییر مسیر دهید؟", + "NO_AGENT_AVAILABLE": "هیچ عاملی در دسترس نیست" } } diff --git a/public/app/main/apps/voice/i18n/fi.json b/public/app/main/apps/voice/i18n/fi.json index 3745db0..8b5f5c1 100644 --- a/public/app/main/apps/voice/i18n/fi.json +++ b/public/app/main/apps/voice/i18n/fi.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Lisää joukkue etuliitteeseen", "ALIAS": "Alias", "MAXCAPACITY": "Max kapasiteetti", - "WORKING": "Työskentely" + "WORKING": "Työskentely", + "CALL_NUMBER_REDIRECT": "Mihin numeroon haluat ohjata puhelun?", + "NO_AGENT_AVAILABLE": "Agenttia ei ole saatavilla" } } diff --git a/public/app/main/apps/voice/i18n/fr.json b/public/app/main/apps/voice/i18n/fr.json index 627cf9d..7e3461e 100644 --- a/public/app/main/apps/voice/i18n/fr.json +++ b/public/app/main/apps/voice/i18n/fr.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Ajouter une équipe au préfixe", "ALIAS": "Alias", "MAXCAPACITY": "capacité maximale", - "WORKING": "Travail" + "WORKING": "Travail", + "CALL_NUMBER_REDIRECT": "Vers quel numéro souhaitez-vous rediriger l'appel ?", + "NO_AGENT_AVAILABLE": "Aucun agent disponible" } } diff --git a/public/app/main/apps/voice/i18n/he.json b/public/app/main/apps/voice/i18n/he.json index 84f003f..feefd95 100644 --- a/public/app/main/apps/voice/i18n/he.json +++ b/public/app/main/apps/voice/i18n/he.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "הוסף צוות לקידומת", "ALIAS": "כינוי", "MAXCAPACITY": "קיבולת מקסימלית", - "WORKING": "עובד" + "WORKING": "עובד", + "CALL_NUMBER_REDIRECT": "לאיזה מספר אתה רוצה להפנות את השיחה?", + "NO_AGENT_AVAILABLE": "אין סוכן זמין" } } diff --git a/public/app/main/apps/voice/i18n/hi.json b/public/app/main/apps/voice/i18n/hi.json index 1fa63c5..fcd8f49 100644 --- a/public/app/main/apps/voice/i18n/hi.json +++ b/public/app/main/apps/voice/i18n/hi.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "उपसर्ग में टीम जोड़ें", "ALIAS": "उपनाम", "MAXCAPACITY": "अधिकतम क्षमता", - "WORKING": "काम में हो" + "WORKING": "काम में हो", + "CALL_NUMBER_REDIRECT": "आप कॉल को किस नंबर पर रीडायरेक्ट करना चाहते हैं?", + "NO_AGENT_AVAILABLE": "कोई एजेंट उपलब्ध नहीं" } } diff --git a/public/app/main/apps/voice/i18n/hu.json b/public/app/main/apps/voice/i18n/hu.json index 28d2655..5469f61 100644 --- a/public/app/main/apps/voice/i18n/hu.json +++ b/public/app/main/apps/voice/i18n/hu.json @@ -501,7 +501,11 @@ "VARIABLES_GET_ERROR": "Unable to retrieve any variable", "VOICEMAILS_GET_ERROR": "Unable to retrieve any voicemail", "TAGS_GET_ERROR": "Unable to retrieve any tag", - "INTERVALS_GET_ERROR": "Unable to retrieve any interval" - } + "INTERVALS_GET_ERROR": "Unable to retrieve any interval", + "CALL_HANGUP_SUCCESS": "Sikeresen bontotta a hívást", + "CALL_REDIRECT_SUCCESS": "A hívás átirányítása sikeresen megtörtént" + }, + "CALL_NUMBER_REDIRECT": "Melyik számra szeretné átirányítani a hívást?", + "NO_AGENT_AVAILABLE": "Nincs elérhető ügynök" } } diff --git a/public/app/main/apps/voice/i18n/id.json b/public/app/main/apps/voice/i18n/id.json index 3c7b0cc..fa04692 100644 --- a/public/app/main/apps/voice/i18n/id.json +++ b/public/app/main/apps/voice/i18n/id.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Tambahkan Tim ke Awalan", "ALIAS": "Alias", "MAXCAPACITY": "kapasitas maksimum", - "WORKING": "Bekerja" + "WORKING": "Bekerja", + "CALL_NUMBER_REDIRECT": "Nomor mana yang ingin Anda alihkan panggilannya?", + "NO_AGENT_AVAILABLE": "Tidak ada agen yang tersedia" } } diff --git a/public/app/main/apps/voice/i18n/is.json b/public/app/main/apps/voice/i18n/is.json new file mode 100644 index 0000000..cb5e0a9 --- /dev/null +++ b/public/app/main/apps/voice/i18n/is.json @@ -0,0 +1,511 @@ +{ + "VOICE": { + "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", + "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", + "FAILUREREASON": "Failure reason", + "TEXT": "Text", + "DOWNLOADTRANSCRIBE_VOICERECORDING": "Download Transcript", + "INBOUND": "Inbound", + "OUTBOUND": "Outbound", + "DIALER": "Dialer", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "ABANDONEDCALLS": "Abandoned Queue Calls", + "WAITING_FOR_AGENTS": "Waiting for agents", + "ACTIVE": "Active", + "NO_AGENT_ONLINE": "No Agent Online", + "PARTIALPAUSE": "Partial Pause", + "STATUS": "Status", + "TIMER": "Timer", + "ALIAS": "Alias", + "ALL": "All", + "IDLE": "Idle", + "EDIT_TRUNK": "Edit Trunk", + "GOTO_VOICEQUEUE": "Go To Realtime Voice Queues", + "GOTOREALTIME_VOICEQUEUE": "Go To Realtime Voice Queues", + "NAME": "Name", + "LOGOUT": "Logout", + "VOICEQUEUES": "Voice Queues", + "SEARCH_FOR_ANYONE": "Search", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", + "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", + "EDIT_VOICEQUEUE": "Edit Voice Queue", + "DELETE_VOICEQUEUE": "Delete Voice Queue", + "MOHSOUNDS": "Moh Sounds", + "STRATEGY": "Strategy", + "DESCRIPTION": "Description", + "ADD_VOICEQUEUE": "Add Voice Queue", + "CREATED_AT": "Created At", + "CANT_PLAY_GSM_AUDIO_FILES": "Can't play gsm or wav49 audio files", + "APPLICATIONS_LIST": "Applications List", + "GENERAL": "General", + "TIMEOUT": "Timeout", + "MAXLENGTH": "Maximum Length", + "RETRY": "Retry", + "WRAPUPTIME": "Wrapup Time", + "WEIGHT": "Weight", + "JOINWHENEMPTY": "Join when empty", + "LEAVEWHENEMPTY": "Leave when empty", + "MUSICONHOLD": "Music On Hold", + "ANNOUNCETOAGENT": "Announce To Agent", + "ANNOUNCEMENTS": "Announcements", + "ADVANCED": "Advanced", + "ANNOUNCEFREQUENCY": "Announce Frequency", + "MINANNOUNCEFREQUENCY": "Minimum Announce Frequency", + "PERIODICANNOUNCEFREQUENCY": "Periodic Announce Frequency", + "RANDOMPERIODICANNOUNCE": "Random Periodic Announce", + "ANNOUNCEHOLDTIME": "Announce Hold Time", + "ANNOUNCECALLERPOSITION": "Announce Caller Position", + "ANNOUNCEPOSITIONLIMIT": "Announce Position Limit", + "REPORTHOLDTIMEAGENT": "Report Agent Hold Time", + "PERIODICANNOUNCE": "Periodic Announce", + "HOLDTIMEANNOUNCE": "Hold Time Announce", + "YOUARENEXTANNOUNCE": "'You are next' Announce", + "THEREAREANNOUNCE": "'There are' Announce", + "WAITINGCALLSANNOUNCE": "Waiting Calls Announce", + "ESTIMATEDHOLDTIMEANNOUNCE": "Estimated Hold Time Announce", + "MINUTESANNOUNCE": "Minutes Announce", + "MINUTEANNOUNCE": "Minute Announce", + "SECONDSANNOUNCE": "Seconds Announce", + "THANKYOUANNOUNCE": "'Thank You' Announce", + "AUTOPAUSE": "Auto Pause", + "AFTERCALLWORK": "After Call Work", + "AFTERCALLWORKDURATION": "After Call Work Duration", + "RINGINUSE": "Ring In Use", + "MEMBERDELAY": "Member Delay", + "TIMEOUTRESTART": "Timeout Restart", + "MONITORFORMAT": "Recording Format", + "SETINTERFACEVARIABLES": "Set Interface Variables", + "SETQUEUEVARIABLES": "Set Queue Variables", + "SETQUEUEENTRYVARIABLES": "Set Queue Entry Variables", + "VARIABLE": "Variable", + "CONTEXT": "Context", + "SAVE": "Save", + "SETTINGS": "Settings", + "INBOUNDROUTES": "Inbound Routes", + "PHONENUMBER": "Phone Number", + "ADD_INBOUNDROUTE": "Add Inbound Route", + "EDIT_INBOUNDROUTE": "Edit Inbound Route", + "DELETE_INBOUNDROUTE": "Delete Inbound Route", + "ACTIONS": "Actions", + "OUTBOUNDROUTES": "Outbound Routes", + "DESTINATIONPATTERN": "Destination Pattern", + "ADD_OUTBOUNDROUTE": "Add Outbound Route", + "EDIT_OUTBOUNDROUTE": "Edit Outbound Route", + "DELETE_OUTBOUNDROUTE": "Delete Outbound Route", + "CUTDIGITS": "Cut Digits", + "RECORDING": "Recording", + "RECORDINGFORMAT": "Recording format", + "INTERNALROUTES": "Internal Routes", + "ADD_INTERNALROUTE": "Add Internal Route", + "EDIT_INTERNALROUTE": "Edit Internal Route", + "DELETE_INTERNALROUTE": "Delete Internal Route", + "CONTEXTS": "Contexts", + "ADD_CONTEXT": "Add Context", + "EDIT_CONTEXT": "Edit Context", + "DELETE_CONTEXT": "Delete Context", + "VOICEMAILS": "Voicemails", + "ADD_VOICEMAIL": "Add Voicemail", + "EDIT_VOICEMAIL": "Edit Voicemail", + "DELETE_VOICEMAIL": "Delete Voicemail", + "FULLNAME": "Full Name", + "EMAIL": "Email", + "MAILBOX": "Mailbox", + "PASSWORD": "Password", + "CONFIRM_PASSWORD": "Confirm Password", + "TIMEZONE": "Timezone", + "ATTACH": "Attach", + "ENVELOPE": "Envelope", + "DELETE": "Delete", + "EMAILBODY": "Email Body", + "EMAILSUBJECT": "Email Subject", + "MAXSECONDS": "Max Seconds", + "MAXMESSAGES": "Max Messages", + "MESSAGES": "Messages", + "SORT": "Sort", + "ADD_MUSICONHOLD": "Add Music On Hold", + "MUSICONHOLDS": "Music On Hold", + "EDIT_MUSICONHOLD": "Edit Music On Hold", + "DELETE_MUSICONHOLD": "Delete Music On Hold", + "DIRECTORY": "Directory", + "AUDIOFILES": "Audio Files", + "RECORDINGS": "Recordings", + "CHANSPY": "ChanSpy", + "PREFIX": "Prefix", + "OPTIONS": "Options", + "AUTH": "Auth", + "ADD_CHANSPY": "Add ChanSpy", + "EDIT_CHANSPY": "Edit ChanSpy", + "DELETE_CHANSPY": "Delete ChanSpy", + "AGENTS": "Agents", + "TELEPHONES": "Telephones", + "QUEUES": "Queues", + "QUEUE_CALLS": "Queue Calls", + "QUEUE_PARAMETERS": "Queue Parameters", + "ABANDONED_CALLS": "Abandoned Calls", + "OUTBOUND_CALLS": "Outbound Calls", + "AGI": "Agi", + "DIAL": "Dial", + "CALLYSQUARE": "CallySquare", + "INTERNALDIAL": "Internal Dial", + "EXTERNALDIAL": "External Dial", + "RINGGROUP": "Ring Group", + "PLAYBACK": "Playback", + "QUEUE": "Queue", + "SET": "Set", + "VOICEMAIL": "Voicemail", + "GOTO": "GoTo", + "HANGUP": "Hangup", + "CUSTOM": "Custom", + "PROJECT": "Cally-Square Project", + "TECHNOLOGY/RESOURCE": "Technology/Resource", + "URL": "URL", + "EDIT_APP": "Edit Application", + "EDIT_INTERVAL": "Edit Interval", + "DELETE_APP": "Delete Application", + "INTERVALS": "Intervals", + "USER": "User", + "TRUNK": "Trunk", + "PHONE": "Phone", + "AUDIO_FILES": "Audio Files", + "ANNOUNCE_OVERRIDES": "Announce Overrides", + "MACRO": "Macro", + "GOSUB": "GoSub", + "RULE": "Rule", + "POSITION": "Position", + "ANSWER": "Answer", + "VALUE": "Value", + "MAILBOX@CONTEXT": "Mailbox@Context", + "EXTENSION": "Extension", + "PRIORITY": "Priority", + "HANGUP_CAUSE": "Hangup Cause", + "OUTBOUNDDIAL": "Outbound Dial", + "CALLER_ID": "Caller ID", + "NO_MESSAGE_AVAILABLE": "No messages available", + "NO_SOUND_AVAILABLE": "No sounds available", + "VOICERECORDINGS": "Voice Recordings", + "CHANSPIES": "ChanSpy", + "VOICE": "Voice", + "REALTIME": "Realtime", + "ID": "Id", + "VOICEMAIL_CONTEXT": "Context", + "NO_MOHSOUND_AVAILABLE": "No Music On Hold available", + "FILE": "File", + "ADD_MOHSOUND": "Add Music On Hold sound", + "DOWNLOAD_MOHSOUND": "Download Music On Hold sound", + "DELETE_MOHSOUND": "Delete Music On Hold sound", + "UNIQUEID": "Unique ID", + "AGENT": "Agent", + "TYPE": "Type", + "RATING": "Rating", + "AUDIO": "Audio", + "DATE": "Date", + "NEW_VOICEQUEUE": "New Voice Queue", + "NEW_INBOUNDROUTE": "New Inbound Route", + "NEW_OUTBOUNDROUTE": "New Outbound Route", + "NEW_INTERNALROUTE": "New Internal Route", + "NEW_CONTEXT": "New Context", + "NEW_VOICEMAIL": "New Voicemail", + "NEW_MUSICONHOLD": "New Music On Hold", + "NEW_CHANSPY": "New ChanSpy", + "PENALTY": "Penalty", + "ADD_TEAM_TO_VOICEQUEUE": "Add Team to Voice Queue", + "ADD_AGENT_TO_VOICEQUEUE": "Add Agent to Voice Queue", + "EDIT_DIAL": "Edit Dial", + "EDIT_AGI": "Edit AGI", + "EDIT_INTERNALDIAL": "Edit Internal Dial", + "EDIT_EXTERNALDIAL": "Edit External Dial", + "EDIT_RINGGROUP": "Edit Ring Group", + "EDIT_PLAYBACK": "Edit Playback", + "EDIT_QUEUE": "Edit Queue", + "EDIT_SET": "Edit Set", + "EDIT_GOTO": "Edit GoTo", + "EDIT_HANGUP": "Edit Hangup", + "EDIT_CUSTOM": "Edit Custom", + "DURATION": "Duration", + "RECEIVED_AT": "Received At", + "YES": "Yes", + "NO": "No", + "HANGUPCAUSE_1": "1 = Unallocated number", + "HANGUPCAUSE_16": "16 = Normal call clearing", + "HANGUPCAUSE_17": "17 = User busy", + "HANGUPCAUSE_18": "18 = No user responding (telehone device not connected)", + "HANGUPCAUSE_21": "21 = Call rejected", + "HANGUPCAUSE_22": "22 = Number changed", + "HANGUPCAUSE_27": "27 = Destination out of order", + "HANGUPCAUSE_38": "38 = Network out of order", + "HANGUPCAUSE_41": "41 = Temporary failure", + "RANDOM": "Random", + "ALPHABETICAL": "Alphabetical", + "NO_APPS_AVAILABLE": "No applications available", + "DOWNLOAD_VOICERECORDING": "Download Voice Recording", + "DELETE_VOICERECORDING": "Delete Voice Recording", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "TRUNK_STATUS": "Trunk Status", + "REGISTERED": "Registered", + "UNREGISTERED": "Unregistered", + "LAGGED": "Lagged", + "REACHABLE": "Reachable", + "UNREACHABLE": "Unreachable", + "UNKNOWN": "Unknown", + "NOT_INUSE": "Not In Use", + "INUSE": "In Use", + "BUSY": "Busy", + "INVALID": "Invalid", + "UNAVAILABLE": "Unavailable", + "RINGING": "Ringing", + "ONHOLD": "On Hold", + "RING": "Ring", + "UP": "Up", + "INFO": "Info", + "TRUNKS": "Trunks", + "REGISTRY": "Registry", + "NO_REGISTRY": "No Registry", + "LOGGED_IN": "Logged In (SIP Connected)", + "PAUSED": "Paused", + "WAITING": "Waiting", + "TALKING": "Talking", + "DID": "DID", + "CALLER": "Caller", + "TOTAL": "Total", + "ANSWERED": "Answered", + "ABANDONED": "Abandoned", + "UNMANAGED": "Unmanaged", + "AVG_HOLD_TIME": "Avg Hold Time", + "AVG_DURATION": "Av Duration", + "AVG_BILLABLE": "Avg Billable", + "SOURCE": "Source", + "DESTINATION": "Destination", + "REJECTED": "Rejected", + "FAILED": "Failed", + "CALLED": "Called", + "CONNECTED": "Connected", + "NO_RATING": "No rating", + "EDIT_VOICERECORDING": "Edit Voice Recording", + "APPLICATION_NAME": "Application Name", + "ARGUMENTS": "Arguments", + "NO_AVAILABLE_INFO": "No Available Info", + "ADD_AGENT_TO_QUEUE": "Add Agent To Queue", + "DEFAULT_PAUSE": "DEFAULT PAUSE", + "PAUSE": "Pause", + "UNPAUSE": "End Pause", + "REDIRECT_TO_NUMBER": "Redirect To Number", + "REDIRECT_TO_AGENT": "Redirect To Agent", + "AGENTADD_VOICEQUEUE": "Add Agent To Voice Queue", + "APPLICATION": "Application", + "FILES": "Files", + "FORMAT": "Format", + "MODE": "Mode", + "RECORD": "Record", + "TEAMADD_VOICEQUEUE": "Add Team To Voice Queue", + "NEW_MOHSOUND": "New Music On Hold sound", + "DOWNLOAD_MESSAGE": "Download", + "DELETE_MESSAGE": "Delete", + "QUEUE_PARAMS": "Queue Parameters", + "TOTAL_OFFERED": "Total Offered", + "READY": "Ready", + "AGENTADD_QUEUE": "Add Agent To Voice Queue", + "AGENTSADD_QUEUE": "Add Agents To Voice Queue", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "CLOSING": "Closing", + "TAGS": "Tags", + "WAITING_FOR_AGENT": "Waiting For Agents", + "EDIT_OUTBOUNDDIAL": "Edit Outbound Dial", + "ACCOUNTNAME": "Account Name", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "DISPOSITION": "Disposition", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "SMS", + "OPENCHANNEL": "Open Channel", + "FAX": "Fax", + "CLEAR": "Clear", + "CALLS": "Calls", + "STARTEDAT": "Started At", + "ENDEDAT": "Ended At", + "TAG": "Tag", + "DETAILS": "Details", + "BILLABLESECONDS": "Billable seconds", + "ANSWEREDAT": "Answered At", + "NOTE": "Note", + "CLOSE": "Close", + "SELECT_DATE": "Select Start Date", + "SELECT_TYPE": "Select Type", + "VOICEPREFIXES": "Out Prefixes", + "NEW_VOICEPREFIX": "New Prefix", + "ADD_VOICEPREFIX": "Add Prefix", + "EDIT_VOICEPREFIX": "Edit Prefix", + "AGENTADD_VOICEPREFIX": "Add Agent to Prefix", + "TEAMADD_VOICEPREFIX": "Add Team to Prefix", + "DELETE_VOICEPREFIX": "Delete Prefix", + "OUTBOUNDROUTE": "Outbound Route", + "CALLERIDALL": "Caller Id", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Mandatory disposition pause status", + "SCREENRECORDING": "Manage Screen Recording", + "START_SCREENRECORDING": "Start Screen Recording", + "STOP_SCREENRECORDING": "Stop Screen Recording", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "CANT_DOWNLOAD_THIS_FILE": "Can't download this file", + "WRONG_EXTENSION": "The file presents the wrong extension", + "FILE_NOT_FOUND": "File not found", + "TEAMS_ASSOCIATION": "Teams Association", + "TRANSCRIBE": "Transcribe", + "TRANSCRIPT": "Transcript", + "SENTIMENTANALYSIS": "Sentiment Analysis", + "TRANSCRIBESTATUS_COMPLETED": "Completed", + "TRANSCRIBESTATUS_IN_PROGRESS": "In progress", + "TRANSCRIBESTATUS_FAILED": "Failed", + "TRANSCRIBESTATUS_NEW": "New", + "TRANSCRIPTANALYSIS": "Transcript & Analysis", + "SENTIMENT_POSITIVE": "Positive", + "SENTIMENT_NEGATIVE": "Negative", + "SENTIMENT_NEUTRAL": "Neutral", + "SENTIMENT_MIXED": "Mixed", + "RUNTRANSCRIBE_VOICERECORDING": "Run Transcribe", + "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Run Transcribe&Sentiment", + "RUNSENTIMENT_VOICERECORDING": "Run Sentiment", + "SENTIMENT": "Sentiment", + "SERVICELEVEL": "Service level", + "MAXCAPACITY": "Max capacity", + "WORKING": "Working", + "NO_AGENT_AVAILABLE": "No agent available", + "CALL_NUMBER_REDIRECT": "Which number do you want to redirect the call to?", + "LEGEND": { + "CUSTOM_APPLICATION": "(*) - Custom application" + }, + "ERRORS": { + "PROJECT_REQUIRED": "Mandatory field", + "TRUNK_REQUIRED": "Mandatory field", + "VARIABLE_REQUIRED": "Mandatory field", + "NAME_REQUIRED": "Mandatory field", + "APPLICATION_NAME_REQUIRED": "Mandatory field", + "TIMEOUT_REQUIRED": "Mandatory field", + "PHONENUMBER_REQUIRED": "Mandatory field", + "CONTEXT_REQUIRED": "Mandatory field", + "DESTINATIONPATTERN_REQUIRED": "Mandatory field", + "FULLNAME_REQUIRED": "Mandatory field", + "EMAIL_REQUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format", + "MAILBOX_REQUIRED": "Mandatory field", + "PASSWORD_REQUIRED": "Mandatory field", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "TIMEZONE_REQUIRED": "Mandatory field", + "PREFIX_REQUIRED": "Mandatory field", + "OPTIONS_REQUIRED": "Mandatory field", + "AFTERCALLWORKDURATION_REQUIRED": "Mandatory field", + "TECHNOLOGY/RESOURCE_REQUIRED": "Mandatory field", + "PHONE_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "EXTENSION_REQUIRED": "Mandatory field", + "PRIORITY_REQUIRED": "Mandatory field", + "APPLICATION_REQUIRED": "Mandatory field", + "OUTBOUNDROUTE_REQUIRED": "Mandatory field", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "CALLERIDALL_MUST_VALID_PATTERN": "Wrong format", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", + "CALLER_ID_MUST_VALID_PATTERN": "Wrong format", + "PENALTY_REQUIRED": "You must specify a value for penalty" + }, + "HELP": { + "TIMEOUT": "How many seconds to ring a device", + "MAXLENGTH": "Maximum number of callers allowed to wait in a queue: zero means unlimited", + "RETRY": "Time in seconds to wait before calling the next agent in queue when the timeout is expired", + "WRAPUPTIME": "Time in seconds to keep a queue member unavailable after completing a call", + "WEIGHT": "Weight of a queue in order to define priority if members are associated with multiple queues", + "JOINWHENEMPTY": "Used to control whether a caller is passed to a queue when no members are available", + "LEAVEWHENEMPTY": "Used to control whether callers are made leave the queue when no members are available to take calls", + "ANNOUNCEFREQUENCY": "How often to announce the caller’s position and/or estimated hold time in the queue (zero to disable)", + "MINANNOUNCEFREQUENCY": "Minimum announcement frequency (useful when the caller’s position changes frequently)", + "PERIODICANNOUNCEFREQUENCY": "Frequency of periodic announcements to the caller", + "ANNOUNCEPOSITIONLIMIT": "Used if announce-position is defined as either 'limit' or 'more'", + "AFTERCALLWORKDURATION": "Pause length triggered by the After Call Work option", + "MEMBERDELAY": "Inserts a delay prior to the caller and agent in queue get connected", + "MUSICONHOLD": "Sets the music class to use for a particular queue", + "ANNOUNCETOAGENT": "Play an announcement to the agent answering the call (typically to let him know what queue the caller is coming from)", + "RANDOMPERIODICANNOUNCE": "If yes, the defined periodic announcements will be played random", + "ANNOUNCEHOLDTIME": "Plays the estimated hold time along with the periodic announcements (Yes/No/Once)", + "ANNOUNCECALLERPOSITION": "Used to define if the caller’s position in the queue should be announced: No=never; Yes=always; Limit=only if it is within the limit defined by announce-position-limit; More= only if it is beyond the value defined by announce-position-limit", + "REPORTHOLDTIMEAGENT": "Enables reporting caller’s hold time to the agent in queue prior to connection", + "PERIODICANNOUNCE": "Set of periodic announcements to be played (in the order)", + "HOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“Hold time”. Undefined=no announcement", + "YOUARENEXTANNOUNCE": "Choose a Sound defined in Tools. Default=“You are now first in line”. Undefined=no announcement", + "THEREAREANNOUNCE": "Choose a Sound defined in Tools. Default=“There are”. Undefined=no announcement", + "WAITINGCALLSANNOUNCE": "Choose a Sound defined in Tools. Default=“calls waiting”. Undefined=no announcement", + "ESTIMATEDHOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“The current estimated hold time is”. Undefined=no announcement", + "MINUTESANNOUNCE": "Choose a Sound defined in Tools. Default=“minutes”. Undefined=no announcement", + "MINUTEANNOUNCE": "Choose a Sound defined in Tools. Default=“minute”. Undefined=no announcement", + "SECONDSANNOUNCE": "Choose a Sound defined in Tools. Default=“seconds”. Undefined=no announcement", + "THANKYOUANNOUNCE": "Choose a Sound defined in Tools. Default=“Thank you for your patience”. Undefined=no announcement", + "AFTERCALLWORK": "If enabled, the agent will be set on Pause after completing a call", + "AUTOPAUSE": "Enables/disables the automatic pause of agents who fail to answer a call. If enabled it causes the agent to be paused in all queues he belongs to", + "RINGINUSE": "To avoid/allow sending calls to members whose status is In Use", + "TIMEOUTRESTART": "If yes, this resets the timeout for an agent to answer when either a BUSY or CONGESTION status is received from the channel", + "MONITORFORMAT": "Specifies the format of the recording file. If it set to 'inactive', calls will not be recorded", + "CONTEXT": "Allows a caller to exit the queue by pressing a single DTMF digit. If a context is specified and the caller enters a number, that digit will attempt to be matched in the context specified, and dialplan execution will continue there", + "SETINTERFACEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information see wiki docs)", + "SETQUEUEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent and leaving the queue, some variables will be set (for more information, see wiki docs)", + "SETQUEUEENTRYVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information, see wiki docs)", + "RECORDING": "Enable call recording", + "VOICEMAIL_CONTEXT": "The context of the relative extension", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "CALLERIDALL": "Supported format: \"CallerId\" <number>", + "CALLER_ID": "Supported format: \"CallerId\" <number>", + "MANDATORYDISPOSITIONPAUSEID": "Pause status to set during mandatory disposition", + "SERVICELEVEL": "Second settings for service level (default=0, no SL). Used for service level statistics (calls answered within service level time frame)", + "SAVE_ROUTES": "The routing has been modified. Remember to save if you don't want to lose your changes." + }, + "NOTIFICATIONS": { + "EXTENSION_CREATED_SUCCESS_TITLE": "Route successfully created", + "EXTENSION_SAVED_SUCCESS_TITLE": "Route successfully saved", + "EXTENSION_DELETE_TITLE": "Are you sure want to delete the route?", + "EXTENSION_DELETE_MESSAGE": "{{ name }} will be deleted", + "EXTENSION_DELETED_SUCCESS_TITLE": "Route successfully deleted", + "EXTENSIONS_DELETE_TITLE": "Are you sure want to delete the selected routes?", + "EXTENSIONS_DELETE_MESSAGE": "{{ total }} routes will be deleted", + "ROUTING_APPLICATION_DELETE_TITLE": "Are you sure want to delete the application?", + "ROUTING_APPLICATION_DELETE_MESSAGE": "{{ name }} will be deleted", + "ROUTING_APPLICATIONS_DELETE_TITLE": "Are you sure want to delete the selected applications?", + "ROUTING_APPLICATIONS_DELETE_MESSAGE": "{{ total }} applications will be deleted", + "CALLYSQUARE_PROJECTS_GET_ERROR": "Unable to retrieve any CallySquare project", + "TRUNKS_GET_ERROR": "Unable to retrieve any trunk", + "VOICE_CONTEXTS_GET_ERROR": "Unable to retrieve any voice context", + "QUEUES_GET_ERROR": "Unable to retrieve any queue", + "SOUNDS_GET_ERROR": "Unable to retrieve any sound", + "USERS_GET_ERROR": "Unable to retrieve any user", + "VARIABLES_GET_ERROR": "Unable to retrieve any variable", + "VOICEMAILS_GET_ERROR": "Unable to retrieve any voicemail", + "TAGS_GET_ERROR": "Unable to retrieve any tag", + "INTERVALS_GET_ERROR": "Unable to retrieve any interval", + "CALL_HANGUP_SUCCESS": "Call hung up successfully", + "CALL_REDIRECT_SUCCESS": "Call redirected successfully" + } + } +} diff --git a/public/app/main/apps/voice/i18n/ja.json b/public/app/main/apps/voice/i18n/ja.json index 3aeb53a..2be9d73 100644 --- a/public/app/main/apps/voice/i18n/ja.json +++ b/public/app/main/apps/voice/i18n/ja.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "プレフィックスにチームを追加", "ALIAS": "エイリアス", "MAXCAPACITY": "最大容量", - "WORKING": "働く" + "WORKING": "働く", + "CALL_NUMBER_REDIRECT": "通話をリダイレクトする番号はどれですか。", + "NO_AGENT_AVAILABLE": "利用可能なエージェントはありません" } } diff --git a/public/app/main/apps/voice/i18n/ko.json b/public/app/main/apps/voice/i18n/ko.json index 6792938..6f73a96 100644 --- a/public/app/main/apps/voice/i18n/ko.json +++ b/public/app/main/apps/voice/i18n/ko.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "접두사에 팀 추가", "ALIAS": "별명", "MAXCAPACITY": "최대 용량", - "WORKING": "일하고있는" + "WORKING": "일하고있는", + "CALL_NUMBER_REDIRECT": "어떤 번호로 통화를 재전송하시겠습니까?", + "NO_AGENT_AVAILABLE": "사용 가능한 에이전트 없음" } } diff --git a/public/app/main/apps/voice/i18n/lt.json b/public/app/main/apps/voice/i18n/lt.json index 37fad45..0ef10db 100644 --- a/public/app/main/apps/voice/i18n/lt.json +++ b/public/app/main/apps/voice/i18n/lt.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Pridėti komandą prie priešdėlio", "ALIAS": "Pseudonimas", "MAXCAPACITY": "Maksimali talpa", - "WORKING": "Darbas" + "WORKING": "Darbas", + "CALL_NUMBER_REDIRECT": "Kuriuo numeriu norite peradresuoti skambutį?", + "NO_AGENT_AVAILABLE": "Nėra agento" } } diff --git a/public/app/main/apps/voice/i18n/lv.json b/public/app/main/apps/voice/i18n/lv.json index ee73c26..08b63c0 100644 --- a/public/app/main/apps/voice/i18n/lv.json +++ b/public/app/main/apps/voice/i18n/lv.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Pievienot komandu prefiksam", "ALIAS": "Pseidonīms", "MAXCAPACITY": "Maksimālā ietilpība", - "WORKING": "Darbojas" + "WORKING": "Darbojas", + "CALL_NUMBER_REDIRECT": "Uz kuru numuru vēlaties pāradresēt zvanu?", + "NO_AGENT_AVAILABLE": "Nav pieejams neviens aģents" } } diff --git a/public/app/main/apps/voice/i18n/nl.json b/public/app/main/apps/voice/i18n/nl.json index 656bb91..a6af508 100644 --- a/public/app/main/apps/voice/i18n/nl.json +++ b/public/app/main/apps/voice/i18n/nl.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Team toevoegen aan voorvoegsel", "ALIAS": "Alias", "MAXCAPACITY": "maximum capaciteit", - "WORKING": "Werken" + "WORKING": "Werken", + "CALL_NUMBER_REDIRECT": "Naar welk nummer wilt u de oproep doorschakelen?", + "NO_AGENT_AVAILABLE": "Geen agent beschikbaar" } } diff --git a/public/app/main/apps/voice/i18n/no.json b/public/app/main/apps/voice/i18n/no.json index add2de9..4397cdd 100644 --- a/public/app/main/apps/voice/i18n/no.json +++ b/public/app/main/apps/voice/i18n/no.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Legg Team til prefiks", "ALIAS": "Alias", "MAXCAPACITY": "Maks kapasitet", - "WORKING": "Jobber" + "WORKING": "Jobber", + "CALL_NUMBER_REDIRECT": "Hvilket nummer vil du omdirigere anropet til?", + "NO_AGENT_AVAILABLE": "Ingen agent tilgjengelig" } } diff --git a/public/app/main/apps/voice/i18n/pl.json b/public/app/main/apps/voice/i18n/pl.json index c709395..50dd679 100644 --- a/public/app/main/apps/voice/i18n/pl.json +++ b/public/app/main/apps/voice/i18n/pl.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Dodaj drużynę do prefiksu", "ALIAS": "Alias", "MAXCAPACITY": "Maksymalna pojemność", - "WORKING": "Pracujący" + "WORKING": "Pracujący", + "CALL_NUMBER_REDIRECT": "Na jaki numer chcesz przekierować połączenie?", + "NO_AGENT_AVAILABLE": "Brak dostępnego agenta" } } diff --git a/public/app/main/apps/voice/i18n/pt-BR.json b/public/app/main/apps/voice/i18n/pt-BR.json index 971bf53..5fec1b5 100644 --- a/public/app/main/apps/voice/i18n/pt-BR.json +++ b/public/app/main/apps/voice/i18n/pt-BR.json @@ -1,40 +1,40 @@ { "VOICE": { - "LOGIN_TIME": "Tempo de login", - "PAUSE_TIME": "Tempo de pausa", - "ABANDONEDCALLS": "Chamadas abandonadas", + "LOGIN_TIME": "Tempo de Login", + "PAUSE_TIME": "Tempo de Pausa", + "ABANDONEDCALLS": "Chamadas Abandonadas", "WAITING_FOR_AGENTS": "Esperando por agentes", "ACTIVE": "Ativo", - "NO_AGENT_ONLINE": "Nenhum agente online", + "NO_AGENT_ONLINE": "Nenhum aAente Online", "PARTIALPAUSE": "Pausa Parcial", "STATUS": "Status", "TIMER": "Cronômetro", "ALL": "Todos", "IDLE": "Ocioso", "EDIT_TRUNK": "Editar Tronco", - "GOTO_VOICEQUEUE": "Ir para filas de voz em tempo real", - "GOTOREALTIME_VOICEQUEUE": "Ir para filas de voz em tempo real", + "GOTO_VOICEQUEUE": "Ir para Filas de Voz em Tempo Real", + "GOTOREALTIME_VOICEQUEUE": "Ir para Filas de Voz em Tempo Real", "NAME": "Nome", "LOGOUT": "Logout", - "VOICEQUEUES": "Filas de voz", + "VOICEQUEUES": "Filas de Voz", "SEARCH_FOR_ANYONE": "Procurar", "BACK": "Voltar", "SELECTED": "Selecionado", - "SELECT_ALL": "Selecionar tudo", - "SELECT_NONE": "Selecione nenhum", - "DELETE_VOICEDISPOSITION": "Excluir disposição de voz", - "EDIT_VOICEDISPOSITION": "Editar disposição de voz", - "EDIT_VOICEQUEUE": "Editar fila de voz", - "DELETE_VOICEQUEUE": "Excluir fila de voz", + "SELECT_ALL": "Selecionar Tudo", + "SELECT_NONE": "Selecione Nenhum", + "DELETE_VOICEDISPOSITION": "Excluir Qualicação de Voz", + "EDIT_VOICEDISPOSITION": "Editar Qualificação de Voz", + "EDIT_VOICEQUEUE": "Editar Fila de Voz", + "DELETE_VOICEQUEUE": "Excluir Fila de Voz", "MOHSOUNDS": "Moh Sounds", "STRATEGY": "Estratégia", "DESCRIPTION": "Descrição", - "ADD_VOICEQUEUE": "Adicionar fila de voz", + "ADD_VOICEQUEUE": "Adicionar Fila de Voz", "CREATED_AT": "Criado em", "CANT_PLAY_GSM_AUDIO_FILES": "Não é possível reproduzir arquivos de áudio gsm ou wav49", "APPLICATIONS_LIST": "Lista de Aplicações", "LEGEND": { - "CUSTOM_APPLICATION": "(*) - Aplicativo personalizado" + "CUSTOM_APPLICATION": "(*) - Aplicativo Personalizado" }, "ERRORS": { "TRUNK_REQUIRED": "Campo obrigatório", @@ -85,184 +85,184 @@ "PENALTY_REQUIRED": "Você deve especificar um valor para a penalidade" }, "GENERAL": "Geral", - "TIMEOUT": "Tempo esgotado", - "MAXLENGTH": "Comprimento máximo", - "RETRY": "Tente novamente", - "WRAPUPTIME": "Tempo de finalização", + "TIMEOUT": "Tempo eEgotado", + "MAXLENGTH": "Tamanho Máximo", + "RETRY": "Tente Novamente", + "WRAPUPTIME": "Tempo de Qualificação", "WEIGHT": "Peso", - "JOINWHENEMPTY": "Juntar quando vazio", - "LEAVEWHENEMPTY": "Sair quando vazio", + "JOINWHENEMPTY": "Juntar quando Vazio", + "LEAVEWHENEMPTY": "Sair quando Vazio", "HELP": { - "TIMEOUT": "Quantos segundos para tocar um dispositivo", + "TIMEOUT": "Tempo em segundos ficar chamando (toques) um dispositivo", "MAXLENGTH": "Número máximo de chamadores que podem esperar em uma fila: zero significa ilimitado", - "RETRY": "Tempo em segundos para aguardar antes de chamar o próximo agente na fila quando o tempo limite expirar", - "WRAPUPTIME": "Tempo em segundos para manter um membro da fila indisponível depois de concluir uma chamada", - "WEIGHT": "Peso de uma fila para definir a prioridade se os membros estiverem associados a várias filas", - "JOINWHENEMPTY": "Usado para controlar se um chamador é passado para uma fila quando nenhum membro está disponível", - "LEAVEWHENEMPTY": "Usado para controlar se os chamadores são deixados na fila quando nenhum membro está disponível para receber chamadas", - "ANNOUNCEFREQUENCY": "Com que frequência anunciar a posição do chamador e / ou o tempo estimado de espera na fila (zero para desativar)", + "RETRY": "Tempo em segundos para aguardar antes de chamar o próximo agente quando o tempo limite expirar", + "WRAPUPTIME": "Tempo em segundos para manter um agente indisponível depois de concluir uma chamada", + "WEIGHT": "Peso para definir a prioridade se os agentes estiverem associados a várias filas", + "JOINWHENEMPTY": "Usado para controlar se um chamador é passado para fila quando nenhum agente está disponível", + "LEAVEWHENEMPTY": "Usado para controlar se os chamadores serão passados para fila quando nenhum agente está disponível", + "ANNOUNCEFREQUENCY": "Com que frequência anunciará a posição do chamador e / ou o tempo estimado de espera na fila (zero para desativar)", "MINANNOUNCEFREQUENCY": "Frequência mínima de anúncio (útil quando a posição do chamador muda com frequência)", - "PERIODICANNOUNCEFREQUENCY": "Freqüência de anúncios periódicos para o chamador", + "PERIODICANNOUNCEFREQUENCY": "Frequência de anúncios periódicos para o chamador", "ANNOUNCEPOSITIONLIMIT": "Usado se a posição de anúncio for definida como \"limite\" ou \"mais\"", - "AFTERCALLWORKDURATION": "Comprimento de pausa acionado pela opção After Call Work", + "AFTERCALLWORKDURATION": "Duração da Pausa configurado pela opção Após Chamada", "MEMBERDELAY": "Insere um atraso antes de o chamador e o agente na fila se conectarem", - "MUSICONHOLD": "Define a música a ser usada para uma fila específica", + "MUSICONHOLD": "Define a Música de Espera", "ANNOUNCETOAGENT": "Reproduzir um anúncio para o agente que atende a chamada (geralmente para que ele saiba de qual fila o chamador está vindo)", "RANDOMPERIODICANNOUNCE": "Se sim, os anúncios periódicos definidos serão reproduzidos aleatoriamente", "ANNOUNCEHOLDTIME": "Reproduz o tempo de espera estimado junto com os anúncios periódicos (Sim / Não / Uma vez)", - "ANNOUNCECALLERPOSITION": "Usado para definir se a posição do chamador na fila deve ser anunciada: No = never; Sim = sempre; Limite = somente se estiver dentro do limite definido pelo limite de posição de anúncio; Mais = apenas se estiver além do valor definido pelo limite de posição de anúncio", - "REPORTHOLDTIMEAGENT": "Permite que o tempo de espera do chamador seja informado ao agente na fila antes da conexão", + "ANNOUNCECALLERPOSITION": "Usado para ativar anúncio de posição do chamador na fila: No = nunca; Yes = sempre; Limite = somente se estiver dentro do valor definido pelo limite de posição de anúncio; Mais = apenas se estiver além do valor definido pelo limite de posição de anúncio.", + "REPORTHOLDTIMEAGENT": "Permite que o tempo de espera do chamador seja informado ao agente antes da conexão", "PERIODICANNOUNCE": "Conjunto de anúncios periódicos a serem reproduzidos (na ordem)", "HOLDTIMEANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “Tempo de Espera”. Indefinido = sem anúncio", - "YOUARENEXTANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “Você agora é o primeiro da fila”. Indefinido = sem anúncio", - "THEREAREANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “Existem”. Indefinido = sem anúncio", - "WAITINGCALLSANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “chamadas em espera”. Indefinido = sem anúncio", + "YOUARENEXTANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “Você agora é o primeiro da fila”. Indefinido = sem anúncio", + "THEREAREANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “Existem”. Indefinido = sem anúncio", + "WAITINGCALLSANNOUNCE": "Escolha um aúdio definido em ferramentas. Padrão = “chamadas em espera”. Indefinido = sem anúncio", "ESTIMATEDHOLDTIMEANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “O tempo de espera estimado atual é“. Indefinido = sem anúncio", - "MINUTESANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “minutos”. Indefinido = sem anúncio", - "MINUTEANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “minuto”. Indefinido = sem anúncio", - "SECONDSANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “segundos”. Indefinido = sem anúncio", - "THANKYOUANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “Obrigado pela sua paciência”. Indefinido = sem anúncio", - "AFTERCALLWORK": "Se ativado, o agente será definido em Pausar após concluir uma chamada", - "AUTOPAUSE": "Ativa / desativa a pausa automática de agentes que não atendem uma chamada. Se ativado, faz com que o agente seja pausado em todas as filas às quais ele pertence", - "RINGINUSE": "Para evitar / permitir o envio de chamadas para membros cujo status é Em uso", + "MINUTESANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “minutos”. Indefinido = sem anúncio", + "MINUTEANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “minuto”. Indefinido = sem anúncio", + "SECONDSANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “segundos”. Indefinido = sem anúncio", + "THANKYOUANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “Obrigado pela sua paciência”. Indefinido = sem anúncio", + "AFTERCALLWORK": "Se ativado, o agente entrará em Pausa após desligar", + "AUTOPAUSE": "Ativar / desativar a pausa automática para agentes que não atendem chamada. Se ativado, faz com que o agente entre em pausa em todas as filas às quais ele pertence.", + "RINGINUSE": "Para permitir ou não o envio de chamadas para agentes cujo status é Ocupado", "TIMEOUTRESTART": "Se sim, isso redefine o tempo limite para um agente responder quando um status OCUPADO ou CONGESTIONADO é recebido do canal", - "CONTEXT": "Permite que um chamador saia da fila pressionando um único dígito DTMF. Se um contexto for especificado e o chamador inserir um número, esse dígito tentará ser correspondido no contexto especificado e a execução da planta de discagem continuará lá.", - "SETINTERFACEVARIABLES": "Se configurado como yes, antes de o chamador ser conectado a um agente de fila, algumas variáveis ​​serão configuradas (para obter mais informações, consulte os documentos do wiki)", - "SETQUEUEVARIABLES": "Se definido como yes, logo antes de o chamador se conectar com um agente de fila e sair da fila, algumas variáveis ​​serão configuradas (para obter mais informações, consulte docs do wiki)", - "SETQUEUEENTRYVARIABLES": "Se definido como sim, pouco antes de o chamador ser conectado a um agente de fila, algumas variáveis ​​serão definidas (para obter mais informações, consulte docs do wiki)", - "RECORDING": "Ativar gravação de chamadas", - "VOICEMAIL_CONTEXT": "O contexto da extensão relativa", - "NAME": "Somente números, letras e caracteres específicos (._) são suportados", - "CALLERIDALL": "Formato suportado: \"CallerId \" ", - "CALLER_ID": "Formato suportado: \\ \"CallerId \" ", - "MANDATORYDISPOSITIONPAUSEID": "Pausar status para definir durante a disposição obrigatória", - "SERVICELEVEL": "Segundos ajustes para o nível de serviço (padrão = 0, sem SL). Usado para estatísticas de nível de serviço (chamadas atendidas dentro do período de tempo de nível de serviço)", + "CONTEXT": "Permite que o chamador saia da fila pressionando um dígito DTMF. Se um contexto for configurado e o chamador digitar um número, esse dígito tentará localizar no contexto configurado e continuará o dialplan.", + "SETINTERFACEVARIABLES": "Se configurado como sim, antes de o chamador ser conectado a um agente, algumas variáveis ​​serão configuradas (para obter mais informações, consulte os documentos do wiki)", + "SETQUEUEVARIABLES": "Se definido como sim, pouco antes de o chamador ser conectado a um agente de fila, algumas variáveis ​​serão definidas (para obter mais informações, consulte a wiki)", + "SETQUEUEENTRYVARIABLES": "Se definido como sim, pouco antes de o chamador ser conectado a um agente de fila, algumas variáveis ​​serão definidas (para obter mais informações, consulte a wiki)", + "RECORDING": "Ativar Gravação de Chamadas", + "VOICEMAIL_CONTEXT": "Define contexto da extensão", + "NAME": "Somente é suportado números, letras e caracteres específicos (._)", + "CALLERIDALL": "Supported format: \"CallerId\" ", + "CALLER_ID": "Supported format: \"CallerId\" ", + "MANDATORYDISPOSITIONPAUSEID": "Tipo de Pausa para qualificação obrigatória", + "SERVICELEVEL": "Ajuste de Segundos para o nível de serviço (padrão = 0, sem Nível de Serviço). Usado para estatísticas de nível de serviço (chamadas atendidas dentro do período cumprem o nível de serviço)", "MONITORFORMAT": "Especifica o formato do arquivo de gravação. Se for definido como 'inativo', as chamadas não serão gravadas", "SAVE_ROUTES": "O roteamento foi modificado. Lembre-se de salvar se não quiser perder suas alterações." }, - "MUSICONHOLD": "Música em espera", - "ANNOUNCETOAGENT": "Anunciar ao agente", + "MUSICONHOLD": "Música em Espera", + "ANNOUNCETOAGENT": "Anunciar ao Agente", "ANNOUNCEMENTS": "Anúncios", "ADVANCED": "Avançado", - "ANNOUNCEFREQUENCY": "Anunciar Frequência", + "ANNOUNCEFREQUENCY": "Frequência Anúncio", "MINANNOUNCEFREQUENCY": "Frequência mínima de anúncio", - "PERIODICANNOUNCEFREQUENCY": "Periodicidade periódica de anúncio", - "RANDOMPERIODICANNOUNCE": "Anúncio periódico aleatório", - "ANNOUNCEHOLDTIME": "Anunciar tempo de espera", - "ANNOUNCECALLERPOSITION": "Anunciar a posição do chamador", - "ANNOUNCEPOSITIONLIMIT": "Anunciar limite de posição", - "REPORTHOLDTIMEAGENT": "Tempo de espera do agente de relatório", - "PERIODICANNOUNCE": "Anúncio periódico", - "HOLDTIMEANNOUNCE": "Anuncio em Tempo de Espera", - "YOUARENEXTANNOUNCE": "'Você é o próximo' Anunciar", - "THEREAREANNOUNCE": "'Existem' Anuncie", - "WAITINGCALLSANNOUNCE": "Chamadas em Espera Anunciam", - "ESTIMATEDHOLDTIMEANNOUNCE": "Anuncio estimado em tempo de espera", - "MINUTESANNOUNCE": "Anuncio de minutos", - "MINUTEANNOUNCE": "Anuncio de minuto", - "SECONDSANNOUNCE": "Anuncio de Segundos", - "THANKYOUANNOUNCE": "'Obrigado' Anuncie", + "PERIODICANNOUNCEFREQUENCY": "Frequencia Anúncio Periódico", + "RANDOMPERIODICANNOUNCE": "Anúncio Periódico Aleatório", + "ANNOUNCEHOLDTIME": "Anunciar Tempo de Espera", + "ANNOUNCECALLERPOSITION": "Anunciar a Posição na Fila", + "ANNOUNCEPOSITIONLIMIT": "Anunciar Limite de Posição", + "REPORTHOLDTIMEAGENT": "Relatório de Tempo de Espera do Agente", + "PERIODICANNOUNCE": "Anúncio Periódico", + "HOLDTIMEANNOUNCE": "Anúncio em Tempo de Espera", + "YOUARENEXTANNOUNCE": "Anúncio 'Você é o próximo'", + "THEREAREANNOUNCE": "Anúncio 'Existem'", + "WAITINGCALLSANNOUNCE": "Anúncio Chamadas em Espera", + "ESTIMATEDHOLDTIMEANNOUNCE": "Anunciar Tempo de Espera Estimado", + "MINUTESANNOUNCE": "Anuncio Minutos", + "MINUTEANNOUNCE": "Anúncio Minuto", + "SECONDSANNOUNCE": "Anúncio Segundos", + "THANKYOUANNOUNCE": "Anúncio 'Obrigado'", "AUTOPAUSE": "Pausa Automática", - "AFTERCALLWORK": "Pausa após ligação", - "AFTERCALLWORKDURATION": "Duração de pausa após ligação", - "RINGINUSE": "Toque em uso", + "AFTERCALLWORK": "Pausa Após Ligação", + "AFTERCALLWORKDURATION": "Duração Pausa Após Ligação", + "RINGINUSE": "Toque em Uso", "MEMBERDELAY": "Member Delay", "TIMEOUTRESTART": "Timeout Restart", - "MONITORFORMAT": "Formato de gravação", - "SETINTERFACEVARIABLES": "Definir variáveis ​​de interface", - "SETQUEUEVARIABLES": "Definir as variáveis ​​da fila", - "SETQUEUEENTRYVARIABLES": "Definir as Variáveis ​​de Entrada da Fila", + "MONITORFORMAT": "Formato de Gravação", + "SETINTERFACEVARIABLES": "Definir Variáveis ​​de Interface", + "SETQUEUEVARIABLES": "Definir as Variáveis ​​da Fila", + "SETQUEUEENTRYVARIABLES": "Definir as Variáveis ​​de Entrada na Fila", "VARIABLE": "Variável", "CONTEXT": "Contexto", "SAVE": "Salvar", "SETTINGS": "Configurações", - "INBOUNDROUTES": "Rotas de entrada", - "PHONENUMBER": "Número de telefone", - "ADD_INBOUNDROUTE": "Adicionar rota de entrada", - "EDIT_INBOUNDROUTE": "Editar rota de entrada", - "DELETE_INBOUNDROUTE": "Excluir rota de entrada", + "INBOUNDROUTES": "Rotas de Entrada", + "PHONENUMBER": "Número de Telefone", + "ADD_INBOUNDROUTE": "Adicionar Rota de Entrada", + "EDIT_INBOUNDROUTE": "Editar Rota de Entrada", + "DELETE_INBOUNDROUTE": "Excluir Rota de Entrada", "ACTIONS": "Ações", - "OUTBOUNDROUTES": "Rotas de saída", - "DESTINATIONPATTERN": "Padrão de destino", - "ADD_OUTBOUNDROUTE": "Adicionar rota de saída", - "EDIT_OUTBOUNDROUTE": "Editar rota de saída", - "DELETE_OUTBOUNDROUTE": "Excluir rota de saída", + "OUTBOUNDROUTES": "Rotas de Saída", + "DESTINATIONPATTERN": "Destino Padrão", + "ADD_OUTBOUNDROUTE": "Adicionar Rota de Saída", + "EDIT_OUTBOUNDROUTE": "Editar Rota de Saída", + "DELETE_OUTBOUNDROUTE": "Excluir Rota de Saída", "CUTDIGITS": "Cut Digits", "RECORDING": "Gravação", - "RECORDINGFORMAT": "Formato de gravação", + "RECORDINGFORMAT": "Formato de Gravação", "INTERNALROUTES": "Rotas Internas", - "ADD_INTERNALROUTE": "Adicionar rota interna", - "EDIT_INTERNALROUTE": "Editar rota interna", - "DELETE_INTERNALROUTE": "Excluir rota interna", + "ADD_INTERNALROUTE": "Adicionar Rota Interna", + "EDIT_INTERNALROUTE": "Editar Rota Interna", + "DELETE_INTERNALROUTE": "Excluir Rota Interna", "CONTEXTS": "Contextos", "ADD_CONTEXT": "Adicionar Contexto", - "EDIT_CONTEXT": "Editar contexto", - "DELETE_CONTEXT": "Excluir contexto", - "VOICEMAILS": "Correios de voz", - "ADD_VOICEMAIL": "Adicionar correio de voz", - "EDIT_VOICEMAIL": "Editar correio de voz", - "DELETE_VOICEMAIL": "Excluir correio de voz", - "FULLNAME": "Nome completo", + "EDIT_CONTEXT": "Editar Contexto", + "DELETE_CONTEXT": "Excluir Contexto", + "VOICEMAILS": "Correios de Voz", + "ADD_VOICEMAIL": "Adicionar Correio de Voz", + "EDIT_VOICEMAIL": "Editar Correio de Voz", + "DELETE_VOICEMAIL": "Excluir Correio de Voz", + "FULLNAME": "Nome Completo", "EMAIL": "Email", - "MAILBOX": "Caixa de correio", + "MAILBOX": "Caixa Postal", "PASSWORD": "Senha", "CONFIRM_PASSWORD": "Confirmar Senha", - "TIMEZONE": "Fuso horário", + "TIMEZONE": "Fuso Horário", "ATTACH": "Anexar", "ENVELOPE": "Envelope", "DELETE": "Excluir", "EMAILBODY": "Corpo do e-mail", "EMAILSUBJECT": "Assunto do email", - "MAXSECONDS": "Segundos máximos", - "MAXMESSAGES": "Mensagens máximas", + "MAXSECONDS": "Segundos Máximos", + "MAXMESSAGES": "Mensagens Máximas", "MESSAGES": "Mensagens", "SORT": "Ordenar", - "ADD_MUSICONHOLD": "Adicionar música em espera", - "MUSICONHOLDS": "Música em espera", - "EDIT_MUSICONHOLD": "Editar música em espera", - "DELETE_MUSICONHOLD": "Excluir música em espera", + "ADD_MUSICONHOLD": "Adicionar Música em Espera", + "MUSICONHOLDS": "Música em Espera", + "EDIT_MUSICONHOLD": "Editar Música em Espera", + "DELETE_MUSICONHOLD": "Excluir Música em Espera", "DIRECTORY": "Diretório", "AUDIOFILES": "Arquivos de áudio", "RECORDINGS": "Gravações", - "CHANSPY": "Espião", + "CHANSPY": "Intercalação", "PREFIX": "Prefixo", "OPTIONS": "Opções", "AUTH": "Auth", - "ADD_CHANSPY": "Adicionar Espião", - "EDIT_CHANSPY": "Editar Espião", - "DELETE_CHANSPY": "Excluir Espião", + "ADD_CHANSPY": "Adicionar Intercalação", + "EDIT_CHANSPY": "Editar Intercalação", + "DELETE_CHANSPY": "Excluir Intercalação", "AGENTS": "Agentes", "TELEPHONES": "Telefones", "QUEUES": "Filas", - "QUEUE_CALLS": "Filas de ligação", + "QUEUE_CALLS": "Filas de Ligação", "QUEUE_PARAMETERS": "Parametros da Fila", - "ABANDONED_CALLS": "Chamadas abandonadas", - "OUTBOUND_CALLS": "Chamadas externas", + "ABANDONED_CALLS": "Chamadas Abandonadas", + "OUTBOUND_CALLS": "Chamadas Externas", "AGI": "Agi", "DIAL": "Discar", "CALLYSQUARE": "CallySquare", - "INTERNALDIAL": "Discagem interna", - "EXTERNALDIAL": "Discagem externa", - "RINGGROUP": "Toque de grupo", + "INTERNALDIAL": "Discagem Interna", + "EXTERNALDIAL": "Discagem Externa", + "RINGGROUP": "Grupo de Toque", "PLAYBACK": "Reprodução", "QUEUE": "Fila", "SET": "Conjunto", - "VOICEMAIL": "Correio de voz", + "VOICEMAIL": "Correio de Voz", "GOTO": "GoTo", "HANGUP": "Desligar", "CUSTOM": "Personalizadas", - "PROJECT": "Projeto Cally-Square", + "PROJECT": "Projeto CallySquare", "TECHNOLOGY/RESOURCE": "Tecnologia / Recurso", "URL": "URL", - "EDIT_APP": "Editar aplicativo", - "EDIT_INTERVAL": "Editar intervalo", - "DELETE_APP": "Excluir aplicativo", + "EDIT_APP": "Editar Aplicativo", + "EDIT_INTERVAL": "Editar Intervalo", + "DELETE_APP": "Excluir Aplicativo", "INTERVALS": "Intervalos", - "USER": "Usuarios", + "USER": "Usuários", "TRUNK": "Tronco", "PHONE": "Telefone", "AUDIO_FILES": "Arquivos de áudio", - "ANNOUNCE_OVERRIDES": "Anunciar Substituto", + "ANNOUNCE_OVERRIDES": "Anúncio Substituto", "MACRO": "Macro", "GOSUB": "GoSub", "RULE": "Regra", @@ -272,47 +272,47 @@ "MAILBOX@CONTEXT": "Mailbox@Context", "EXTENSION": "Extensão", "PRIORITY": "Prioridade", - "HANGUP_CAUSE": "Causa do desligamento", - "OUTBOUNDDIAL": "Discagem de saída", - "CALLER_ID": "Identificador de chamadas", - "NO_MESSAGE_AVAILABLE": "Nenhuma mensagem disponível", - "NO_SOUND_AVAILABLE": "Nenhum som disponível", - "VOICERECORDINGS": "Gravações de voz", - "CHANSPIES": "Espião", + "HANGUP_CAUSE": "Causa do Desligamento", + "OUTBOUNDDIAL": "Discagem de Saída", + "CALLER_ID": "Identificador de Chamadas", + "NO_MESSAGE_AVAILABLE": "Nenhuma Mensagem Disponível", + "NO_SOUND_AVAILABLE": "Nenhum Áudio Disponível", + "VOICERECORDINGS": "Gravações de Voz", + "CHANSPIES": "Intercalação", "VOICE": "Voz", "REALTIME": "Tempo Real", "ID": "Id", "VOICEMAIL_CONTEXT": "Contexto", - "NO_MOHSOUND_AVAILABLE": "Não há música na espera disponível", + "NO_MOHSOUND_AVAILABLE": "Não há Música na Espera Disponível", "FILE": "Arquivo", - "ADD_MOHSOUND": "Adicionar som de música em espera", - "DOWNLOAD_MOHSOUND": "Download Musica do som em espera", - "DELETE_MOHSOUND": "Excluir som de música em espera", + "ADD_MOHSOUND": "Adicionar Música em Espera", + "DOWNLOAD_MOHSOUND": "Download Música de Espera", + "DELETE_MOHSOUND": "Excluir Música em Espera", "UNIQUEID": "ID único", "AGENT": "Agente", "TYPE": "Tipo", "RATING": "Avaliação", - "AUDIO": "Audio", + "AUDIO": "Áudio", "DATE": "Data", - "NEW_VOICEQUEUE": "Nova fila de voz", - "NEW_INBOUNDROUTE": "Nova rota de entrada", - "NEW_OUTBOUNDROUTE": "Nova rota de saída", - "NEW_INTERNALROUTE": "Nova rota interna", - "NEW_CONTEXT": "Novo contexto", - "NEW_VOICEMAIL": "Nova mensagem de voz", - "NEW_MUSICONHOLD": "Nova música em espera", - "NEW_CHANSPY": "Novo espião", + "NEW_VOICEQUEUE": "Nova Fila de Voz", + "NEW_INBOUNDROUTE": "Nova Rota de Entrada", + "NEW_OUTBOUNDROUTE": "Nova Rota de Saída", + "NEW_INTERNALROUTE": "Nova Rota Interna", + "NEW_CONTEXT": "Novo Contexto", + "NEW_VOICEMAIL": "Nova Mensagem de Voz", + "NEW_MUSICONHOLD": "Nova Música em Espera", + "NEW_CHANSPY": "Nova Intercalação", "PENALTY": "Peso", - "ADD_TEAM_TO_VOICEQUEUE": "Adicionar equipe à fila de voz", - "ADD_AGENT_TO_VOICEQUEUE": "Adicionar agente à fila de voz", - "EDIT_DIAL": "Editar discagem", + "ADD_TEAM_TO_VOICEQUEUE": "Adicionar Equipe à Fila de Voz", + "ADD_AGENT_TO_VOICEQUEUE": "Adicionar Agente à Fila de Voz", + "EDIT_DIAL": "Editar Discagem", "EDIT_AGI": "Editar AGI", - "EDIT_INTERNALDIAL": "Editar discagem interna", - "EDIT_EXTERNALDIAL": "Editar discagem externa", - "EDIT_RINGGROUP": "Editar grupo de toques", - "EDIT_PLAYBACK": "Editar reprodução", - "EDIT_QUEUE": "Editar fila", - "EDIT_SET": "Editar conjunto", + "EDIT_INTERNALDIAL": "Editar Discagem Interna", + "EDIT_EXTERNALDIAL": "Editar Discagem Externa", + "EDIT_RINGGROUP": "Editar Grupo de Toques", + "EDIT_PLAYBACK": "Editar Reprodução", + "EDIT_QUEUE": "Editar Fila", + "EDIT_SET": "Editar Conjunto", "EDIT_GOTO": "Editar GoTo", "EDIT_HANGUP": "Editar Hangup", "EDIT_CUSTOM": "Editar Customizado", @@ -321,9 +321,9 @@ "YES": "Sim", "NO": "Não", "HANGUPCAUSE_1": "1 = Número não alocado", - "HANGUPCAUSE_16": "16 = Limpeza de chamada normal", + "HANGUPCAUSE_16": "16 = Chamada normal", "HANGUPCAUSE_17": "17 = Usuário ocupado", - "HANGUPCAUSE_18": "18 = Nenhuma resposta do usuário (dispositivo teleônico não conectado)", + "HANGUPCAUSE_18": "18 = Nenhuma resposta do usuário (Não atendeu)", "HANGUPCAUSE_21": "21 = Chamada rejeitada", "HANGUPCAUSE_22": "22 = Número alterado", "HANGUPCAUSE_27": "27 = Destino fora de ordem", @@ -331,32 +331,32 @@ "HANGUPCAUSE_41": "41 = Falha temporária", "RANDOM": "Aleatória", "ALPHABETICAL": "Alfabético", - "NO_APPS_AVAILABLE": "Não há aplicativos disponíveis", + "NO_APPS_AVAILABLE": "Não há Aplicativos Disponíveis", "DOWNLOAD_VOICERECORDING": "Download Gravação de Voz", - "DELETE_VOICERECORDING": "Excluir gravação de voz", + "DELETE_VOICERECORDING": "Excluir Gravação de Voz", "INTERNAL": "Interno", - "PHONE_STATE": "Estado do telefone", - "PHONE_STATUS": "Status do telefone", - "TRUNK_STATUS": "Status do Tronco", + "PHONE_STATE": "Status do Telefone", + "PHONE_STATUS": "Status do Telefone", + "TRUNK_STATUS": "Status Tronco", "REGISTERED": "Registrado", - "UNREGISTERED": "Não registrado", + "UNREGISTERED": "Não Registrado", "LAGGED": "Atrasado", "REACHABLE": "Alcançável", "UNREACHABLE": "Inacessível", "UNKNOWN": "Desconhecido", - "NOT_INUSE": "Fora de uso", + "NOT_INUSE": "Fora de Uso", "INUSE": "Em uso", "BUSY": "Ocupado", - "INVALID": "Invalido", + "INVALID": "Inválido", "UNAVAILABLE": "Indisponível", - "RINGING": "Tocando", - "ONHOLD": "Em espera", + "RINGING": "Chamando", + "ONHOLD": "Em Espera", "RING": "Tocar", "UP": "Cima", "INFO": "Informação", - "TRUNKS": "Trunks", + "TRUNKS": "Troncos", "REGISTRY": "Registro", - "NO_REGISTRY": "Nenhum registro", + "NO_REGISTRY": "Nenhum Registro", "LOGGED_IN": "Conectado (SIP conectado)", "PAUSED": "Pausado", "WAITING": "Esperando", @@ -366,55 +366,55 @@ "TOTAL": "Total", "ANSWERED": "Respondidas", "ABANDONED": "Abandonadas", - "UNMANAGED": "Não gerenciado", - "AVG_HOLD_TIME": "Tempo médio de espera", - "AVG_DURATION": "Duração média", - "AVG_BILLABLE": "Média faturável", + "UNMANAGED": "Não Gerenciado", + "AVG_HOLD_TIME": "Tempo Médio de Epera", + "AVG_DURATION": "Duração Média", + "AVG_BILLABLE": "Média Faturável", "SOURCE": "Fonte", "DESTINATION": "Destino", "REJECTED": "Rejeitado", "FAILED": "Falhou", "CALLED": "Chamado", "CONNECTED": "Conectado", - "NO_RATING": "Sem avaliação", - "EDIT_VOICERECORDING": "Editar gravação de voz", + "NO_RATING": "Sem Avaliação", + "EDIT_VOICERECORDING": "Editar Gravação de Voz", "APPLICATION_NAME": "Nome da Aplicação", "ARGUMENTS": "Argumentos", - "NO_AVAILABLE_INFO": "Nenhuma informação disponível", - "ADD_AGENT_TO_QUEUE": "Adicionar agente à fila", + "NO_AVAILABLE_INFO": "Nenhuma Informação Disponível", + "ADD_AGENT_TO_QUEUE": "Adicionar Agente à Fila", "DEFAULT_PAUSE": "PAUSA PADRÃO", "PAUSE": "Pausa", "UNPAUSE": "Fim Pausa", - "REDIRECT_TO_NUMBER": "Redirecionar para número", - "REDIRECT_TO_AGENT": "Redirecionar para agente", - "AGENTADD_VOICEQUEUE": "Adicionar agente à fila de voz", + "REDIRECT_TO_NUMBER": "Redirecionar para Número", + "REDIRECT_TO_AGENT": "Redirecionar para Agente", + "AGENTADD_VOICEQUEUE": "Adicionar Agente à Fila de Coz", "APPLICATION": "Aplicação", "FILES": "Arquivos", "FORMAT": "Formato", "MODE": "Modo", "RECORD": "Registro", - "TEAMADD_VOICEQUEUE": "Adicionar equipe à fila de voz", - "NEW_MOHSOUND": "Novo som de música em espera", + "TEAMADD_VOICEQUEUE": "Adicionar Equipe à Fila de Voz", + "NEW_MOHSOUND": "Novo aúdio de Música em Espera", "DOWNLOAD_MESSAGE": "Download", "DELETE_MESSAGE": "Excluir", "QUEUE_PARAMS": "Parâmetros da fila", - "TOTAL_OFFERED": "Total oferecido", + "TOTAL_OFFERED": "Total Oferecido", "READY": "Pronto", - "AGENTADD_QUEUE": "Adicionar agente à fila de voz", - "AGENTSADD_QUEUE": "Adicionar agentes à fila de voz", - "ALL_TEAMS": "Todas as equipes", + "AGENTADD_QUEUE": "Adicionar Agente à Fila de Voz", + "AGENTSADD_QUEUE": "Adicionar Agentes à Fila de Voz", + "ALL_TEAMS": "Todas Equipes", "SELECTED_TEAMS": "Equipes Selecionadas", - "ALL_AGENTS": "Todos os agentes", + "ALL_AGENTS": "Todos Agentes", "SELECTED_AGENTS": "Agentes Selecionados", "CLOSING": "Fechamento", "TAGS": "Tags", - "WAITING_FOR_AGENT": "Aguardando Agentes", - "EDIT_OUTBOUNDDIAL": "Editar discagem de saída", - "ACCOUNTNAME": "Nome da conta", + "WAITING_FOR_AGENT": "Aguardando Por Agentes", + "EDIT_OUTBOUNDDIAL": "Editar Discagem de Saída", + "ACCOUNTNAME": "Nome da Conta", "PAGE": "Página", "ROWSPERPAGE": "Linhas por Página", "OF": "do", - "DISPOSITION": "Disposição", + "DISPOSITION": "Qualificação", "CHAT": "Chat", "MAIL": "Email", "SMS": "SMS", @@ -426,41 +426,41 @@ "ENDEDAT": "Terminou em", "TAG": "Tag", "DETAILS": "Detalhes", - "BILLABLESECONDS": "Segundos faturáveis", + "BILLABLESECONDS": "Segundos Faturáveis", "ANSWEREDAT": "Respondido em", "NOTE": "Nota", "CLOSE": "Fechar", - "SELECT_DATE": "Selecione a data de início", - "SELECT_TYPE": "Selecione o tipo", - "VOICEPREFIXES": "Prefixos de saída", - "NEW_VOICEPREFIX": "Novo prefixo", - "ADD_VOICEPREFIX": "Adicionar prefixo", - "EDIT_VOICEPREFIX": "Editar prefixo", - "AGENTADD_VOICEPREFIX": "Adicionar agente ao prefixo", - "DELETE_VOICEPREFIX": "Excluir prefixo", + "SELECT_DATE": "Selecione Data de Início", + "SELECT_TYPE": "Selecione Tipo", + "VOICEPREFIXES": "Prefixos de Saída", + "NEW_VOICEPREFIX": "Novo Prefixo", + "ADD_VOICEPREFIX": "Adicionar Prefixo", + "EDIT_VOICEPREFIX": "Editar Prefixo", + "AGENTADD_VOICEPREFIX": "Adicionar Agente ao Prefixo", + "DELETE_VOICEPREFIX": "Excluir Rrefixo", "OUTBOUNDROUTE": "Rota de Saída", - "CALLERIDALL": "ID do chamador", + "CALLERIDALL": "ID do Chamador", "DIALER": "Discador", "INBOUND": "Entrada", - "OUTBOUND": "Saída", - "MANDATORYDISPOSITION": "Disposição obrigatória", - "MANDATORYDISPOSITIONPAUSEID": "Status de pausa de disposição obrigatória", + "OUTBOUND": "Outbound", + "MANDATORYDISPOSITION": "Qualificação Obrigatória", + "MANDATORYDISPOSITIONPAUSEID": "Status de Pausa para Qualificação Obrigatória", "TEAMS_ASSOCIATION": "Associação de Equipas", "CANT_DOWNLOAD_THIS_FILE": "Não é possível baixar este arquivo", - "FILE_NOT_FOUND": "Arquivo não encontrado", - "SCREENRECORDING": "Gerenciar gravação de tela", - "START_SCREENRECORDING": "Iniciar gravação na tela", - "STOP_SCREENRECORDING": "Parar gravação de tela", - "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "FILE_NOT_FOUND": "Arquivo Não Encontrado", + "SCREENRECORDING": "Gerenciar Gravação de Tela", + "START_SCREENRECORDING": "Iniciar Gravação de Tela", + "STOP_SCREENRECORDING": "Parar Gravação de Tela", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de Tela Disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de Tela em Andamento", "WRONG_EXTENSION": "O arquivo apresenta a extensão incorreta", - "DOWNLOADTRANSCRIBE_VOICERECORDING": "Baixar transcrição", - "FAILUREREASON": "Razão da falha", - "RUNSENTIMENT_VOICERECORDING": "Executar Sentiment", - "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Executar transcrição e sentimento", - "RUNTRANSCRIBE_VOICERECORDING": "Executar a transcrição", + "DOWNLOADTRANSCRIBE_VOICERECORDING": "Baixar Transcrição", + "FAILUREREASON": "Razão da Falha", + "RUNSENTIMENT_VOICERECORDING": "Executar Sentimento", + "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Executar Transcrição e Sentimento", + "RUNTRANSCRIBE_VOICERECORDING": "Executar Transcrição", "SENTIMENT": "Sentimento", - "SENTIMENTANALYSIS": "Análise de sentimentos", + "SENTIMENTANALYSIS": "Análise de Sentimentos", "SENTIMENT_MIXED": "Misturado", "SENTIMENT_NEGATIVE": "Negativo", "SENTIMENT_NEUTRAL": "Neutro", @@ -469,16 +469,18 @@ "TRANSCRIBE": "Transcrever", "TRANSCRIBESTATUS_COMPLETED": "Concluído", "TRANSCRIBESTATUS_FAILED": "Falhou", - "TRANSCRIBESTATUS_IN_PROGRESS": "Em progresso", + "TRANSCRIBESTATUS_IN_PROGRESS": "Em Progresso", "TRANSCRIBESTATUS_NEW": "Novo", "TRANSCRIPT": "Transcrição", "TRANSCRIPTANALYSIS": "Transcrição e Análise", - "SERVICELEVEL": "Nível de serviço", - "SECOND_LEVEL_DISPOSITION": "Disposição de Segundo Nível", - "THIRD_LEVEL_DISPOSITION": "Disposição de terceiro nível", - "TEAMADD_VOICEPREFIX": "Adicionar equipe ao prefixo", - "ALIAS": "Pseudônimo", - "MAXCAPACITY": "capacidade máxima", - "WORKING": "Trabalhando" + "SERVICELEVEL": "Nível de Serviço", + "SECOND_LEVEL_DISPOSITION": "Qualificação de Segundo Nível", + "THIRD_LEVEL_DISPOSITION": "Qualificação de Terceiro Nível", + "TEAMADD_VOICEPREFIX": "Adicionar Equipe ao Prefixo", + "ALIAS": "Alias", + "MAXCAPACITY": "Capacidade Máxima", + "WORKING": "Trabalhando", + "CALL_NUMBER_REDIRECT": "Para qual número você deseja redirecionar a chamada?", + "NO_AGENT_AVAILABLE": "Nenhum agente disponível" } } diff --git a/public/app/main/apps/voice/i18n/pt-PT.json b/public/app/main/apps/voice/i18n/pt-PT.json index faa44b9..7d2439d 100644 --- a/public/app/main/apps/voice/i18n/pt-PT.json +++ b/public/app/main/apps/voice/i18n/pt-PT.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Adicionar equipe ao prefixo", "ALIAS": "Pseudônimo", "MAXCAPACITY": "capacidade máxima", - "WORKING": "Trabalhando" + "WORKING": "Trabalhando", + "CALL_NUMBER_REDIRECT": "Para qual número você deseja redirecionar a chamada?", + "NO_AGENT_AVAILABLE": "Nenhum agente disponível" } } diff --git a/public/app/main/apps/voice/i18n/ru.json b/public/app/main/apps/voice/i18n/ru.json index cc17b0e..b18d4f5 100644 --- a/public/app/main/apps/voice/i18n/ru.json +++ b/public/app/main/apps/voice/i18n/ru.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Добавить команду к префиксу", "ALIAS": "Псевдоним", "MAXCAPACITY": "Максимальная вместимость", - "WORKING": "Работающий" + "WORKING": "Работающий", + "CALL_NUMBER_REDIRECT": "На какой номер вы хотите перенаправить вызов?", + "NO_AGENT_AVAILABLE": "Агент недоступен" } } diff --git a/public/app/main/apps/voice/i18n/sv.json b/public/app/main/apps/voice/i18n/sv.json index fa7f690..4828255 100644 --- a/public/app/main/apps/voice/i18n/sv.json +++ b/public/app/main/apps/voice/i18n/sv.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Lägg till Team i prefixet", "ALIAS": "Alias", "MAXCAPACITY": "Max kapacitet", - "WORKING": "Arbetssätt" + "WORKING": "Arbetssätt", + "CALL_NUMBER_REDIRECT": "Vilket nummer vill du omdirigera samtalet till?", + "NO_AGENT_AVAILABLE": "Ingen agent tillgänglig" } } diff --git a/public/app/main/apps/voice/i18n/tr.json b/public/app/main/apps/voice/i18n/tr.json index 5cd2e05..c93e5db 100644 --- a/public/app/main/apps/voice/i18n/tr.json +++ b/public/app/main/apps/voice/i18n/tr.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Önek'e Takım Ekle", "ALIAS": "takma ad", "MAXCAPACITY": "maksimum kapasite", - "WORKING": "Çalışma" + "WORKING": "Çalışma", + "CALL_NUMBER_REDIRECT": "Aramayı hangi numaraya yönlendirmek istiyorsunuz?", + "NO_AGENT_AVAILABLE": "Temsilci yok" } } diff --git a/public/app/main/apps/voice/i18n/zh-CN.json b/public/app/main/apps/voice/i18n/zh-CN.json index 6792883..1b717c3 100644 --- a/public/app/main/apps/voice/i18n/zh-CN.json +++ b/public/app/main/apps/voice/i18n/zh-CN.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "将团队添加到前缀", "ALIAS": "别名", "MAXCAPACITY": "最大容量", - "WORKING": "在职的" + "WORKING": "在职的", + "CALL_NUMBER_REDIRECT": "您要将呼叫重定向到哪个号码?", + "NO_AGENT_AVAILABLE": "没有可用的代理" } } diff --git a/public/app/main/apps/voice/i18n/zh-TW.json b/public/app/main/apps/voice/i18n/zh-TW.json index 62cf89c..8824a4b 100644 --- a/public/app/main/apps/voice/i18n/zh-TW.json +++ b/public/app/main/apps/voice/i18n/zh-TW.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "將團隊添加到前綴", "ALIAS": "別名", "MAXCAPACITY": "最大容量", - "WORKING": "在職的" + "WORKING": "在職的", + "CALL_NUMBER_REDIRECT": "您要將呼叫重定向到哪個號碼?", + "NO_AGENT_AVAILABLE": "沒有可用的代理" } } diff --git a/public/app/main/apps/whatsapp/i18n/bs.json b/public/app/main/apps/whatsapp/i18n/bs.json index 68808ad..6e95133 100644 --- a/public/app/main/apps/whatsapp/i18n/bs.json +++ b/public/app/main/apps/whatsapp/i18n/bs.json @@ -1,247 +1,247 @@ { "WHATSAPP": { - "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "EDIT_DIALOGFLOWV2": "Uredi Dialogflow V2", "DIALOGFLOWV2": "Dialogflow V2", - "PRIVATEKEY": "Private Key", - "CLIENTEMAIL": "Client Email", - "PROJECTID": "Project ID", - "ACCESSKEYID": "Access Key ID", - "ACCOUNTSID": "Account SID", - "ACTIONS": "Actions", - "ADD_NOTE": "Add note", - "ADD_WHATSAPPACCOUNT": "Add", - "ADD_WHATSAPPCANNEDANSWER": "Add Canned Answer", - "ADD_WHATSAPPDISPOSITION": "Add WhatsApp Disposition", - "ADD_WHATSAPPQUEUE": "Add WhatsApp queue", - "ADVANCED": "Advanced", - "AGENT": "Agent", - "AGENT_TIMEOUT": "Agent Timeout", - "AGENTADD_QUEUE": "Add Agent To WhatsApp Queue", - "AGENTADD_WHATSAPPACCOUNT": "Add Agent To WhatsApp Account", - "AGENTADD_WHATSAPPQUEUE": "Add Agent To WhatsApp Queue", - "AGENTS": "Agents", - "AGENTSADD_QUEUE": "Add agents to WhatsApp queue", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", - "ALL": "All", - "ALL_AGENTS": "All Agents", - "ALL_TEAMS": "All Teams", + "PRIVATEKEY": "Privatni Ključ", + "CLIENTEMAIL": "E-mail Stranke", + "PROJECTID": "Projekat ID", + "ACCESSKEYID": "Pristupni Ključ ID", + "ACCOUNTSID": "Nalog SID", + "ACTIONS": "Radnje", + "ADD_NOTE": "Dodaj Bilješku", + "ADD_WHATSAPPACCOUNT": "Dodaj", + "ADD_WHATSAPPCANNEDANSWER": "Dodaj Pripremljeni Odgovor", + "ADD_WHATSAPPDISPOSITION": "Dodaj WhatsApp Dispoziciju", + "ADD_WHATSAPPQUEUE": "Dodaj WhatsApp Queue", + "ADVANCED": "Napredno", + "AGENT": "Specijalist", + "AGENT_TIMEOUT": "Timeout Specijaliste", + "AGENTADD_QUEUE": "Dodaj Specijalistu u WhatsApp Queue", + "AGENTADD_WHATSAPPACCOUNT": "Dodaj Specijalistu u WhatsApp Nalog", + "AGENTADD_WHATSAPPQUEUE": "Dodaj Specijalistu u WhatsApp Queue", + "AGENTS": "Specijaliste", + "AGENTSADD_QUEUE": "Dodaj Specijaliste u WhatsApp Queue", + "AGENTTRANSFER": "Prijenost Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Specijaliste", + "ALL": "Svi", + "ALL_AGENTS": "Svi Specijalisti", + "ALL_TEAMS": "Svi Timovi", "AMAZONLEX": "AmazonLex", "AUTHTOKEN": "Auth Token", - "AUTOREPLY": "Auto Reply", - "BACK": "Back", + "AUTOREPLY": "Automatski Odgovor", + "BACK": "Nazad", "BASEURL": "Base URL", - "BOTNAME": "Bot Name", - "BUSY": "Busy", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", - "CANNEDANSWERS": "Canned Answers", - "CAPACITY": "Capacity", - "CLOSE": "Close", - "CLOSED": "Closed", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", - "COMMAND": "Command", - "CONDITION": "Condition", - "CONTACT": "Contact", - "CREATED_AT": "Created at", - "DEFAULT_PAUSE": "DEFAULT PAUSE", - "DELETE": "Delete", - "DELETE_INTERACTION": "Delete Interaction", - "DELETE_SELECTED": "Delete selected", - "DELETE_WHATSAPPACCOUNT": "Delete WhatsApp Account", - "DELETE_WHATSAPPCANNEDANSWER": "Deleted", - "DELETE_WHATSAPPDISPOSITION": "Delete WhatsApp Disposition", - "DELETE_WHATSAPPQUEUE": "Delete WhatsApp Queue", - "DESCRIPTION": "Description", + "BOTNAME": "Bot Naziv", + "BUSY": "Zauzet", + "CANNED_ANSWER_NOT_FOUND": "Nije pronađen nijedan pripremljeni odgovor", + "CANNED_ANSWER_SEARCH": "Unesi tekst da pretražiš Pripremljene Odgovore", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "CAPACITY": "Kapacitet", + "CLOSE": "Zatvori", + "CLOSED": "Zatvoreno", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", + "COMMAND": "Naredba", + "CONDITION": "Uslov", + "CONTACT": "Kontakt", + "CREATED_AT": "Kreirano U", + "DEFAULT_PAUSE": "ZADANA PAUZA", + "DELETE": "Izbriši", + "DELETE_INTERACTION": "Izbriši Interakciju", + "DELETE_SELECTED": "Izbriši odabrano", + "DELETE_WHATSAPPACCOUNT": "Izbriši WhatsApp nalog", + "DELETE_WHATSAPPCANNEDANSWER": "Izbrisano", + "DELETE_WHATSAPPDISPOSITION": "Izbriši WhatsApp Dispoziciju", + "DELETE_WHATSAPPQUEUE": "Izbriši WhatsApp Queue", + "DESCRIPTION": "Opis", "DIALOGFLOW": "DialogFlow", - "DISPOSITION": "Disposition", - "DISPOSITIONS": "Dispositions", - "DOWNLOAD_INTERACTION": "Download", - "DOWNLOAD_WITH_ATTACHMENTS": "Download With Attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download Without Attachments", - "EDIT_AGENT": "Edit Agent", - "EDIT_AMAZONLEX": "Edit Lex configuration", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "EDIT_CLOSE": "Edit Close", - "EDIT_DIALOGFLOW": "Edit DialogFlow configuration", - "EDIT_GOTOIF": "Edit Gotoif", - "EDIT_GOTOP": "Edit Gotop", - "EDIT_NOOP": "Edit Noop", - "EDIT_QUEUE": "Edit Queue", - "EDIT_SYSTEM": "Edit System", - "EDIT_TAG": "Edit Tag", - "EDIT_WHATSAPPACCOUNT": "Edit WhatsApp Account", - "EDIT_WHATSAPPCANNEDANSWER": "Edit", - "EDIT_WHATSAPPDISPOSITION": "Edit WhatsApp Disposition", - "EDIT_WHATSAPPQUEUE": "Edit WhatsApp Queue", + "DISPOSITION": "Dispozicija", + "DISPOSITIONS": "Dispozicije", + "DOWNLOAD_INTERACTION": "Skini", + "DOWNLOAD_WITH_ATTACHMENTS": "Skini Sa Prilozima", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Skini Bez Priloga", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_AMAZONLEX": "Uredi Lex konfiguraciju", + "EDIT_AUTOREPLY": "Uredi Automatski Odgovor", + "EDIT_CLOSE": "Uredi Zatvaranje", + "EDIT_DIALOGFLOW": "Uredi DialogFlow konfiguraciju", + "EDIT_GOTOIF": "Uredi Gotoif", + "EDIT_GOTOP": "Uredi Gotop", + "EDIT_NOOP": "Uredi Noop", + "EDIT_QUEUE": "Uredi Queue", + "EDIT_SYSTEM": "Uredi Sistem", + "EDIT_TAG": "Uredi Tag", + "EDIT_WHATSAPPACCOUNT": "Uredi WhatsApp Nalog", + "EDIT_WHATSAPPCANNEDANSWER": "Uredi", + "EDIT_WHATSAPPDISPOSITION": "Uredi WhatsApp Dispoziciju", + "EDIT_WHATSAPPQUEUE": "Uredi WhatsApp Queue", "ERRORS": { - "PROJECTID_REQUIRED": "Mandatory Field", - "CLIENTEMAIL_REQUIRED": "Mandatory Field", - "PRIVATEKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Mandatory Field", - "ACCOUNTSID_REQUIRED": "Mandatory Field", - "AGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AUTHTOKEN_REQUIRED": "Mandatory Field", - "BASEURL_REQUIRED": "Mandatory Field", - "BOTNAME_REQUIRED": "Mandatory Field", - "COMMAND_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "DESCRIPTION_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "LANGUAGE_REQUIRED": "Mandtory Field", - "LEXREGION_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "PHONE_REQUIRED": "Mandatory Field", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "PRIORITY_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "SECRETACCESSKEY_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "TEXT_REQUIRED": "Mandatory Field", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "TIMEOUT_REQUIRED": "Mandatory Field", - "TIMES_REQUIRED": "Mandatory Field", - "TOKEN_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "TYPE_REQUIRED": "Mandatory Field", - "VALUE_REQUIRED": "Mandatory Field", - "VARIABLE_REQUIRED": "Mandatory Field", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "WELCOMEMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "WELCOMEMESSAGE_REQUIRED": "Mandatory Field" + "PROJECTID_REQUIRED": "Obavezno Polje", + "CLIENTEMAIL_REQUIRED": "Obavezno Polje", + "PRIVATEKEY_REQUIRED": "Obavezno Polje", + "ACCESSKEYID_REQUIRED": "Obavezno Polje", + "ACCOUNTSID_REQUIRED": "Obavezno Polje", + "AGENT_REQUIRED": "Obavezno Polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno Polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno Polje", + "AUTHTOKEN_REQUIRED": "Obavezno Polje", + "BASEURL_REQUIRED": "Obavezno Polje", + "BOTNAME_REQUIRED": "Obavezno Polje", + "COMMAND_REQUIRED": "Obavezno Polje", + "CONDITION_REQUIRED": "Obavezno Polje", + "DESCRIPTION_REQUIRED": "Obavezno Polje", + "DISPOSITION_REQUIRED": "Obavezno Polje", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "FALSEPRIORITY_REQUIRED": "Obavezno Polje", + "KEY_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "KEY_REQUIRED": "Obavezno Polje", + "LANGUAGE_REQUIRED": "Obavezno Polje", + "LEXREGION_REQUIRED": "Obavezno Polje", + "LIST_REQUIRED": "Obavezno Polje", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno Polje", + "NAME_REQUIRED": "Obavezno Polje", + "PHONE_REQUIRED": "Obavezno Polje", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "PRIORITY_REQUIRED": "Obavezno Polje", + "QUEUE_REQUIRED": "Obavezno Polje", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno Polje", + "SECRETACCESSKEY_REQUIRED": "Obavezno Polje", + "TAG_REQUIRED": "Obavezno Polje", + "TEXT_REQUIRED": "Obavezno Polje", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "TIMEOUT_REQUIRED": "Obavezno Polje", + "TIMES_REQUIRED": "Obavezno Polje", + "TOKEN_REQUIRED": "Obavezno Polje", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "TRUEPRIORITY_REQUIRED": "Obavezno Polje", + "TYPE_REQUIRED": "Obavezno Polje", + "VALUE_REQUIRED": "Obavezno Polje", + "VARIABLE_REQUIRED": "Obavezno Polje", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno Polje", + "WELCOMEMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "WELCOMEMESSAGE_REQUIRED": "Obavezno Polje" }, "FALSEPRIORITY": "False Priority", - "GENERAL": "General", - "GO_TO_WHATSAPPACCOUNTS": "Go To Account", + "GENERAL": "Općenito", + "GO_TO_WHATSAPPACCOUNTS": "Idi Na Nalog", "GOTOIF": "Gotoif", "GOTOP": "Gotop", - "GOTOREALTIME_WHATSAPPQUEUE": "Go To Realtime WhatsApp Queue", + "GOTOREALTIME_WHATSAPPQUEUE": "Idi na Realtime WhatsApp Queue", "HELP": { - "LIST": "Contact Manager list used to associate contacts", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", - "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "RECEIVEURL": "This is the auto-generated API string you need to use to receive the messages inside your account from your WhatsApp Connector provider (POST method must be used): click the clipboard button to copy it", - "WELCOMEMESSAGE": "This is the first response message sent to new interactions" + "LIST": "Kontakt Menadžer lista koja se koristi za povezivanje Kontakata", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Pauza koja se koristi ako je obavezna dispozicija uključena", + "MOTIONPROXY": "Polje mora imati sljedeći format: ://[:]. Primjer: https://X.Y.Z.W", + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)", + "RECEIVEURL": "Ovo je automatski generisani API niz koji treba koristiti za primanje poruka unutar tvog računa od tvog WhatsApp Konektor provajdera (mora se koristiti POST metoda): kliknite na dugme međuspremnika da biste ga kopirali", + "WELCOMEMESSAGE": "Ovo je prva poruka odgovora poslana novim interakcijama" }, - "ID": "Id", + "ID": "ID", "IDLE": "Idle", - "INSERT_MESSAGE_HERE": "Insert message here", - "INTERACTIONS": "Interactions", - "INTERACTIONS_WHATSAPPACCOUNT": "Go to Interactions", - "KEY": "Key", - "LANGUAGE": "Language", - "LASTMESSAGE": "Last Message", + "INSERT_MESSAGE_HERE": "Ovdje upiši svoju tekstualnu poruku", + "INTERACTIONS": "Interakcije", + "INTERACTIONS_WHATSAPPACCOUNT": "Idi na Interakcije", + "KEY": "Ključ", + "LANGUAGE": "Jezik", + "LASTMESSAGE": "Zadnja poruka", "LEXREGION": "Region", - "LIST": "List", - "LOGGED_IN": "Logged In (SIP Connected)", - "LOGIN_TIME": "Login Time", - "LOGOUT": "Logout", - "MANDATORYDISPOSITION": "Mandatory Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", - "MORE": "More", - "MOTIONPROXY": "Proxy Or Motion Domain", - "MULTI_SELECT_TOGGLE": "Multi select toggle", - "NAME": "Name", - "NEW_WHATSAPPACCOUNT": "New WhatsApp Account", - "NEW_WHATSAPPCANNEDANSWER": "New WhatsApp Canned Answer", - "NEW_WHATSAPPDISPOSITION": "New WhatsApp Disposition", - "NEW_WHATSAPPQUEUE": "New WhatsApp Queue", - "NO_AGENT_ONLINE": "No Agent Online", - "NO_AVAILABLE_INFO": "No Available Info", - "NO_INTERACTION_AVAILABLE": "No Interactions Available", - "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "No WhatsApp Accounts available", - "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "No WhatsApp Canned Answers Available", - "NO_WHATSAPPDISPOSITION_AVAILABLE": "No WhatsApp Dispositions Available", + "LIST": "Lista", + "LOGGED_IN": "Prijavljen (SIP konektovan)", + "LOGIN_TIME": "Vrijeme prijave", + "LOGOUT": "Odjava", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Pauza koja se koristi ukoliko je Obavezna dispozicija uključena", + "MORE": "Više", + "MOTIONPROXY": "Proxy Or Motion Domena", + "MULTI_SELECT_TOGGLE": "Višestruki odabir lista", + "NAME": "Naziv", + "NEW_WHATSAPPACCOUNT": "Novi WhatsApp Nalog", + "NEW_WHATSAPPCANNEDANSWER": "Novi WhatsApp Pripremljeni Odgovor ", + "NEW_WHATSAPPDISPOSITION": "Nova WhatsApp Dispozicija", + "NEW_WHATSAPPQUEUE": "Novi WhatsApp Queue", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Nema WhatsApp dostupnih naloga", + "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "Nema WhatsApp dostupnih Pripremljenih Odgovora", + "NO_WHATSAPPDISPOSITION_AVAILABLE": "Nema dostupnih WhatsApp Dispozicija", "NOOP": "Noop", - "NOTE": "Note", - "NOTIFICATION": "Notification", - "NOTIFICATIONSHAKE": "Shake", + "NOTE": "Bilješka", + "NOTIFICATION": "Obavijest", + "NOTIFICATIONSHAKE": "Protresi", "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONTEMPLATE": "Template", - "OF": "of", - "OPENED": "Opened", - "PAGE": "Page", - "PARTIALPAUSE": "Partial Pause", - "PAUSE": "Pause", - "PAUSE_TIME": "Pause Time", - "PAUSED": "Paused", - "PHONE": "Phone", - "PRIORITY": "Priority", + "NOTIFICATIONTEMPLATE": "Šablon", + "OF": "od", + "OPENED": "Otvoreno", + "PAGE": "Stranica", + "PARTIALPAUSE": "Djelomična pauza", + "PAUSE": "Pauza", + "PAUSE_TIME": "Vrijeme pauze", + "PAUSED": "Pauzirano", + "PHONE": "Telefon", + "PRIORITY": "Prioritet", "PROXY": "Proxy", "QUEUE": "Queue", "QUEUES": "Queues", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "READY": "Ready", + "QUEUETRANSFER": "Prijenos Queue", + "QUEUETRANSFERTIMEOUT": "Prijenos Queue Timeout", + "READY": "Spreman", "REALTIME": "Realtime", - "RECEIVEURL": "Receive URL", - "DELIVERYREPORTURL": "Delivery report URL", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "REMOTE": "Remote", - "ROWSPERPAGE": "Rows per page", - "SAVE": "Save", - "SCREENRECORDING": "Manage Screen Recording", - "SEARCH_FOR_ANYONE": "Search", - "SECRETACCESSKEY": "Access key secret", - "SELECT_ALL": "Select all", - "SELECT_NONE": "Select none", - "SELECTED": "Selected", - "SELECTED_AGENTS": "Selected Agents", - "SELECTED_TEAMS": "Selected Teams", - "SEND": "Send", - "SETTINGS": "Settings", - "SPYINTERACTION": "Spy Interaction", - "START_SCREENRECORDING": "Start Screen Recording", - "STARTEDAT": "Started at", + "RECEIVEURL": "Prihvatni URL", + "DELIVERYREPORTURL": "Izvještaj isporuke URL", + "REFRESH_INTERACTIONS": "Osvježi Interakciju", + "REMOTE": "Daljinski", + "ROWSPERPAGE": "Redova po stranici", + "SAVE": "Sačuvaj", + "SCREENRECORDING": "Upravljanje Snimanjem Ekrana", + "SEARCH_FOR_ANYONE": "Traži", + "SECRETACCESSKEY": "Tajni Pristupni Ključ", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "SELECTED": "Odabrano", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "SELECTED_TEAMS": "Odabrani Timovi", + "SEND": "Pošalji", + "SETTINGS": "Postavke", + "SPYINTERACTION": "Spy Interakcije", + "START_SCREENRECORDING": "Započni Snimanje Ekrana", + "STARTEDAT": "Počelo U", "STATUS": "Status", - "STOP_SCREENRECORDING": "Stop Screen Recording", - "STRATEGY": "Strategy", - "SYSTEM": "System", + "STOP_SCREENRECORDING": "Zaustavi Snimanje Ekrana", + "STRATEGY": "Strategija", + "SYSTEM": "Sistem", "TAG": "Tag", - "TAGS": "Tags", - "TEAMADD_WHATSAPPQUEUE": "Add Team To WhatsApp Queue", - "TEAMS_ASSOCIATION": "Teams Association", - "TEXT": "Text", + "TAGS": "Tagovi", + "TEAMADD_WHATSAPPQUEUE": "Dodaj Team u WhatsApp Queue", + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "TEXT": "Tekst", "TIMEOUT": "Timeout", "TIMER": "Timer", - "TIMES": "Times", - "TO": "To", + "TIMES": "Broj puta po interakciji", + "TO": "Za", "TOKEN": "Token", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TRANSFER": "Transfer", - "TRUEPRIORITY": "True Priority", - "TYPE": "Type", - "UNPAUSE": "End Pause", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje Ekrana dostupno", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje Ekrana u procesu", + "TRANSFER": "Prijenos", + "TRUEPRIORITY": "Pravi Prioritet", + "TYPE": "Vrsta", + "UNPAUSE": "Završi Pauzu", "VALUE": "Value", - "VARIABLE": "Variable", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "WAITING": "Waiting", - "WELCOMEMESSAGE": "Welcome Message", - "WHATSAPP": "WhatsApp Connector", - "WHATSAPPACCOUNTS": "WhatsApp Accounts", - "WHATSAPPCANNEDANSWERS": "WhatsApp Canned Answers", - "WHATSAPPDISPOSITIONS": "WhatsApp Dispositions", + "VARIABLE": "Vrijednost", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog specijalistu", + "WAITING": "Čekanje", + "WELCOMEMESSAGE": "Poruka Čekanja", + "WHATSAPP": "WhatsApp Konektor", + "WHATSAPPACCOUNTS": "WhatsApp Nalozi", + "WHATSAPPCANNEDANSWERS": "WhatsApp Pripremljeni Odgovori", + "WHATSAPPDISPOSITIONS": "WhatsApp Dispozicije", "WHATSAPPQUEUES": "WhatsApp Queues" } } diff --git a/public/app/main/apps/whatsapp/i18n/et.json b/public/app/main/apps/whatsapp/i18n/et.json index e8c6282..330cf45 100644 --- a/public/app/main/apps/whatsapp/i18n/et.json +++ b/public/app/main/apps/whatsapp/i18n/et.json @@ -50,7 +50,8 @@ "WELCOMEMESSAGE_REQUIRED": "Kohustuslik väli", "CLIENTEMAIL_REQUIRED": "Kohustuslik väli", "PRIVATEKEY_REQUIRED": "Kohustuslik väli", - "PROJECTID_REQUIRED": "Kohustuslik väli" + "PROJECTID_REQUIRED": "Kohustuslik väli", + "BASEURL_REQUIRED": "Kohustuslik väli" }, "HELP": { "LIST": "Kontaktide halduri loend, mida kasutatakse kontaktide seostamiseks", @@ -239,6 +240,8 @@ "DIALOGFLOWV2": "Dialoogivoog V2", "EDIT_DIALOGFLOWV2": "Redigeerimise dialoogivoog V2", "PRIVATEKEY": "Privaatne võti", - "PROJECTID": "Projekti ID" + "PROJECTID": "Projekti ID", + "BASEURL": "Baas-URL", + "DELIVERYREPORTURL": "Edastamisaruande URL" } } diff --git a/public/app/main/apps/whatsapp/i18n/is.json b/public/app/main/apps/whatsapp/i18n/is.json new file mode 100644 index 0000000..68808ad --- /dev/null +++ b/public/app/main/apps/whatsapp/i18n/is.json @@ -0,0 +1,247 @@ +{ + "WHATSAPP": { + "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "DIALOGFLOWV2": "Dialogflow V2", + "PRIVATEKEY": "Private Key", + "CLIENTEMAIL": "Client Email", + "PROJECTID": "Project ID", + "ACCESSKEYID": "Access Key ID", + "ACCOUNTSID": "Account SID", + "ACTIONS": "Actions", + "ADD_NOTE": "Add note", + "ADD_WHATSAPPACCOUNT": "Add", + "ADD_WHATSAPPCANNEDANSWER": "Add Canned Answer", + "ADD_WHATSAPPDISPOSITION": "Add WhatsApp Disposition", + "ADD_WHATSAPPQUEUE": "Add WhatsApp queue", + "ADVANCED": "Advanced", + "AGENT": "Agent", + "AGENT_TIMEOUT": "Agent Timeout", + "AGENTADD_QUEUE": "Add Agent To WhatsApp Queue", + "AGENTADD_WHATSAPPACCOUNT": "Add Agent To WhatsApp Account", + "AGENTADD_WHATSAPPQUEUE": "Add Agent To WhatsApp Queue", + "AGENTS": "Agents", + "AGENTSADD_QUEUE": "Add agents to WhatsApp queue", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "ALL": "All", + "ALL_AGENTS": "All Agents", + "ALL_TEAMS": "All Teams", + "AMAZONLEX": "AmazonLex", + "AUTHTOKEN": "Auth Token", + "AUTOREPLY": "Auto Reply", + "BACK": "Back", + "BASEURL": "Base URL", + "BOTNAME": "Bot Name", + "BUSY": "Busy", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", + "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", + "CANNEDANSWERS": "Canned Answers", + "CAPACITY": "Capacity", + "CLOSE": "Close", + "CLOSED": "Closed", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "COMMAND": "Command", + "CONDITION": "Condition", + "CONTACT": "Contact", + "CREATED_AT": "Created at", + "DEFAULT_PAUSE": "DEFAULT PAUSE", + "DELETE": "Delete", + "DELETE_INTERACTION": "Delete Interaction", + "DELETE_SELECTED": "Delete selected", + "DELETE_WHATSAPPACCOUNT": "Delete WhatsApp Account", + "DELETE_WHATSAPPCANNEDANSWER": "Deleted", + "DELETE_WHATSAPPDISPOSITION": "Delete WhatsApp Disposition", + "DELETE_WHATSAPPQUEUE": "Delete WhatsApp Queue", + "DESCRIPTION": "Description", + "DIALOGFLOW": "DialogFlow", + "DISPOSITION": "Disposition", + "DISPOSITIONS": "Dispositions", + "DOWNLOAD_INTERACTION": "Download", + "DOWNLOAD_WITH_ATTACHMENTS": "Download With Attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download Without Attachments", + "EDIT_AGENT": "Edit Agent", + "EDIT_AMAZONLEX": "Edit Lex configuration", + "EDIT_AUTOREPLY": "Edit Auto Reply", + "EDIT_CLOSE": "Edit Close", + "EDIT_DIALOGFLOW": "Edit DialogFlow configuration", + "EDIT_GOTOIF": "Edit Gotoif", + "EDIT_GOTOP": "Edit Gotop", + "EDIT_NOOP": "Edit Noop", + "EDIT_QUEUE": "Edit Queue", + "EDIT_SYSTEM": "Edit System", + "EDIT_TAG": "Edit Tag", + "EDIT_WHATSAPPACCOUNT": "Edit WhatsApp Account", + "EDIT_WHATSAPPCANNEDANSWER": "Edit", + "EDIT_WHATSAPPDISPOSITION": "Edit WhatsApp Disposition", + "EDIT_WHATSAPPQUEUE": "Edit WhatsApp Queue", + "ERRORS": { + "PROJECTID_REQUIRED": "Mandatory Field", + "CLIENTEMAIL_REQUIRED": "Mandatory Field", + "PRIVATEKEY_REQUIRED": "Mandatory Field", + "ACCESSKEYID_REQUIRED": "Mandatory Field", + "ACCOUNTSID_REQUIRED": "Mandatory Field", + "AGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AUTHTOKEN_REQUIRED": "Mandatory Field", + "BASEURL_REQUIRED": "Mandatory Field", + "BOTNAME_REQUIRED": "Mandatory Field", + "COMMAND_REQUIRED": "Mandatory Field", + "CONDITION_REQUIRED": "Mandatory Field", + "DESCRIPTION_REQUIRED": "Mandatory Field", + "DISPOSITION_REQUIRED": "Mandatory Field", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "FALSEPRIORITY_REQUIRED": "Mandatory Field", + "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "KEY_REQUIRED": "Mandatory Field", + "LANGUAGE_REQUIRED": "Mandtory Field", + "LEXREGION_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory Field", + "NAME_REQUIRED": "Mandatory Field", + "PHONE_REQUIRED": "Mandatory Field", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "PRIORITY_REQUIRED": "Mandatory Field", + "QUEUE_REQUIRED": "Mandatory Field", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "SECRETACCESSKEY_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "TEXT_REQUIRED": "Mandatory Field", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", + "TIMEOUT_REQUIRED": "Mandatory Field", + "TIMES_REQUIRED": "Mandatory Field", + "TOKEN_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "TRUEPRIORITY_REQUIRED": "Mandatory Field", + "TYPE_REQUIRED": "Mandatory Field", + "VALUE_REQUIRED": "Mandatory Field", + "VARIABLE_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "WELCOMEMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "WELCOMEMESSAGE_REQUIRED": "Mandatory Field" + }, + "FALSEPRIORITY": "False Priority", + "GENERAL": "General", + "GO_TO_WHATSAPPACCOUNTS": "Go To Account", + "GOTOIF": "Gotoif", + "GOTOP": "Gotop", + "GOTOREALTIME_WHATSAPPQUEUE": "Go To Realtime WhatsApp Queue", + "HELP": { + "LIST": "Contact Manager list used to associate contacts", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", + "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "RECEIVEURL": "This is the auto-generated API string you need to use to receive the messages inside your account from your WhatsApp Connector provider (POST method must be used): click the clipboard button to copy it", + "WELCOMEMESSAGE": "This is the first response message sent to new interactions" + }, + "ID": "Id", + "IDLE": "Idle", + "INSERT_MESSAGE_HERE": "Insert message here", + "INTERACTIONS": "Interactions", + "INTERACTIONS_WHATSAPPACCOUNT": "Go to Interactions", + "KEY": "Key", + "LANGUAGE": "Language", + "LASTMESSAGE": "Last Message", + "LEXREGION": "Region", + "LIST": "List", + "LOGGED_IN": "Logged In (SIP Connected)", + "LOGIN_TIME": "Login Time", + "LOGOUT": "Logout", + "MANDATORYDISPOSITION": "Mandatory Disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", + "MORE": "More", + "MOTIONPROXY": "Proxy Or Motion Domain", + "MULTI_SELECT_TOGGLE": "Multi select toggle", + "NAME": "Name", + "NEW_WHATSAPPACCOUNT": "New WhatsApp Account", + "NEW_WHATSAPPCANNEDANSWER": "New WhatsApp Canned Answer", + "NEW_WHATSAPPDISPOSITION": "New WhatsApp Disposition", + "NEW_WHATSAPPQUEUE": "New WhatsApp Queue", + "NO_AGENT_ONLINE": "No Agent Online", + "NO_AVAILABLE_INFO": "No Available Info", + "NO_INTERACTION_AVAILABLE": "No Interactions Available", + "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "No WhatsApp Accounts available", + "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "No WhatsApp Canned Answers Available", + "NO_WHATSAPPDISPOSITION_AVAILABLE": "No WhatsApp Dispositions Available", + "NOOP": "Noop", + "NOTE": "Note", + "NOTIFICATION": "Notification", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONTEMPLATE": "Template", + "OF": "of", + "OPENED": "Opened", + "PAGE": "Page", + "PARTIALPAUSE": "Partial Pause", + "PAUSE": "Pause", + "PAUSE_TIME": "Pause Time", + "PAUSED": "Paused", + "PHONE": "Phone", + "PRIORITY": "Priority", + "PROXY": "Proxy", + "QUEUE": "Queue", + "QUEUES": "Queues", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "READY": "Ready", + "REALTIME": "Realtime", + "RECEIVEURL": "Receive URL", + "DELIVERYREPORTURL": "Delivery report URL", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "REMOTE": "Remote", + "ROWSPERPAGE": "Rows per page", + "SAVE": "Save", + "SCREENRECORDING": "Manage Screen Recording", + "SEARCH_FOR_ANYONE": "Search", + "SECRETACCESSKEY": "Access key secret", + "SELECT_ALL": "Select all", + "SELECT_NONE": "Select none", + "SELECTED": "Selected", + "SELECTED_AGENTS": "Selected Agents", + "SELECTED_TEAMS": "Selected Teams", + "SEND": "Send", + "SETTINGS": "Settings", + "SPYINTERACTION": "Spy Interaction", + "START_SCREENRECORDING": "Start Screen Recording", + "STARTEDAT": "Started at", + "STATUS": "Status", + "STOP_SCREENRECORDING": "Stop Screen Recording", + "STRATEGY": "Strategy", + "SYSTEM": "System", + "TAG": "Tag", + "TAGS": "Tags", + "TEAMADD_WHATSAPPQUEUE": "Add Team To WhatsApp Queue", + "TEAMS_ASSOCIATION": "Teams Association", + "TEXT": "Text", + "TIMEOUT": "Timeout", + "TIMER": "Timer", + "TIMES": "Times", + "TO": "To", + "TOKEN": "Token", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TRANSFER": "Transfer", + "TRUEPRIORITY": "True Priority", + "TYPE": "Type", + "UNPAUSE": "End Pause", + "VALUE": "Value", + "VARIABLE": "Variable", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "WAITING": "Waiting", + "WELCOMEMESSAGE": "Welcome Message", + "WHATSAPP": "WhatsApp Connector", + "WHATSAPPACCOUNTS": "WhatsApp Accounts", + "WHATSAPPCANNEDANSWERS": "WhatsApp Canned Answers", + "WHATSAPPDISPOSITIONS": "WhatsApp Dispositions", + "WHATSAPPQUEUES": "WhatsApp Queues" + } +} diff --git a/public/app/quick-panel/i18n/bs.json b/public/app/quick-panel/i18n/bs.json index fd2a755..e1803e1 100644 --- a/public/app/quick-panel/i18n/bs.json +++ b/public/app/quick-panel/i18n/bs.json @@ -1,73 +1,73 @@ { "QUICKPANEL": { - "EXPIRATION_GRAY_PERIOD": "Expiration Gray Period", - "NO_AVAILABLE_GROUPS": "No Available Groups", - "SAVE": "Save", + "EXPIRATION_GRAY_PERIOD": "Istek Gray Perioda", + "NO_AVAILABLE_GROUPS": "Nema Dostupnih Grupa", + "SAVE": "Sačuvaj", "INFO": "Info", - "NEW_CHATGROUP": "New Group", - "NAME": "Name", - "MEMBERS": "Members", - "ENABLE_WRITING": "Enable Writing", - "GROUPS": "Groups", - "YOU": "You + {{participants}}", - "NEW_INTERNAL_MESSAGE": "New internal message", - "DELETE": "Delete", - "SEARCH": "Search", - "USERS": "Users", - "TODAY": "TODAY", - "MONDAY": "Monday", - "TUESDAY": "Tuesday", - "WEDNESDAY": "Wednesday", - "THURSDAY": "Thursday", - "FRIDAY": "Friday", - "SATURDAY": "Saturday", - "SUNDAY": "Sunday", - "JANUARY": "January", - "FEBRUARY": "February", - "MARCH": "March", + "NEW_CHATGROUP": "Nova Grupa", + "NAME": "Ime", + "MEMBERS": "Članovi", + "ENABLE_WRITING": "Omogući Pisanje", + "GROUPS": "Grupe", + "YOU": "Ti + {{participants}}", + "NEW_INTERNAL_MESSAGE": "Nova interna poruka", + "DELETE": "Izbriši", + "SEARCH": "Traži", + "USERS": "Korisnici", + "TODAY": "DANAS", + "MONDAY": "Ponedjeljak", + "TUESDAY": "Utorak", + "WEDNESDAY": "Srijeda", + "THURSDAY": "Četvrtak", + "FRIDAY": "Petak", + "SATURDAY": "Subota", + "SUNDAY": "Nedjelja", + "JANUARY": "Januar", + "FEBRUARY": "Februar", + "MARCH": "Mart", "APRIL": "April", - "MAY": "May", - "JUNE": "June", - "JULY": "July", + "MAY": "Maj", + "JUNE": "Juni", + "JULY": "Juli", "AUGUST": "August", - "SEPTEMBER": "September", - "OCTOBER": "October", - "NOVEMBER": "November", - "DECEMBER": "December", + "SEPTEMBER": "Septembar", + "OCTOBER": "Oktobar", + "NOVEMBER": "Novembar", + "DECEMBER": "Decembar", "CHAT": "CHAT", - "ACTIVITY": "ACTIVITY", - "FRIENDS": "Friends", - "APP_SERVERS": "Application Servers", - "USER_STATS": "User Stats", - "EVENTS": "Events", - "NOTES": "Notes", - "QUICK_SETTINGS": "Quick Settings", - "NOTIFICATIONS": "Notifications", + "ACTIVITY": "AKTIVNOST", + "FRIENDS": "Prijatelji", + "APP_SERVERS": "Serveri Aplikacije", + "USER_STATS": "Statusi Korisnika", + "EVENTS": "Događaji", + "NOTES": "Bilješke", + "QUICK_SETTINGS": "Brze Postavke", + "NOTIFICATIONS": "Obavještenja", "CLOUD_SYNC": "Cloud Sync", - "RETRO_THRUSTERS": "Retro Thrusters", - "RECENT": "Recent", - "START_NEW_CHAT": "Start New Chat", - "BACK": "Back", - "CALL": "Call", - "MORE": "More", - "SEND_MESSAGE": "Send message", - "REPLY_PLACEHOLDER": "Type and hit enter to send message", - "CONTACT_XCALLY_MOTION_SUPPORT": "Contact xCALLY Motion Support", - "EXPIRATION_DATE": "Expiration Date", - "EXPIRATION_REASON": "Expiration Reason", - "LICENSE": "License", - "NEW_TOKEN": "New Token", - "OLD_TOKEN": "Old Token", - "SEND_EMAIL_TO": "Send Email To", + "RETRO_THRUSTERS": "Retro Potisnici", + "RECENT": "Nedavno", + "START_NEW_CHAT": "Započni Novi Chat", + "BACK": "Nazad", + "CALL": "Pozovi", + "MORE": "Više", + "SEND_MESSAGE": "Pošalji poruku", + "REPLY_PLACEHOLDER": "Ukucajte i pritisnite enter da pošaljete poruku", + "CONTACT_XCALLY_MOTION_SUPPORT": "Kontaktiraj XCally Motion Podršku", + "EXPIRATION_DATE": "Datum Isteka", + "EXPIRATION_REASON": "Razlog Isteka", + "LICENSE": "Licenca", + "NEW_TOKEN": "Novi Token", + "OLD_TOKEN": "Stari Token", + "SEND_EMAIL_TO": "Pošalji E-mail", "TOKEN": "Token", - "EXPIRATION_REASON_MESSAGE": "Your license has expired or your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", - "GRAY_PERIOD_EXPIRATION": "Gray Period Expiration", - "EXPIRATION_REASON_MESSAGE_GRAY": "Your license has expired or has been disabled. Contact xCALLY Motion Support Team.", - "EXPIRATION_REASON_MESSAGE_CHANGED": "Your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", - "MESSENGER_DISABLED": "The internal messaging is disabled for this agent!", - "WARNING": "Warning", + "EXPIRATION_REASON_MESSAGE": "Tvoja licenca je istekla ili je tvoj jedinstveni ID uređaja ažuriran zbog promjena na tvom sistemu.", + "GRAY_PERIOD_EXPIRATION": "Istek Gray Perioda", + "EXPIRATION_REASON_MESSAGE_GRAY": "Tvoja licenca je istekla ili je onemogućena. Kontaktiraj XCally Motion Podršku.", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Jedinstveni ID uređaja je ažuriran zbog promjena na tvom sistemu. Kontaktiraj XCally Motion Podršku, i pošalji stari i novi UUID. ", + "MESSENGER_DISABLED": "Interna razmjena poruka je onemogućena za ovog specijalistu!", + "WARNING": "Upozorenje", "ERRORS": { - "NAME_REQUIRED": "Mandatory Field" + "NAME_REQUIRED": "Obavezno polje" } } } diff --git a/public/app/quick-panel/i18n/cs.json b/public/app/quick-panel/i18n/cs.json index fd2a755..ed82376 100644 --- a/public/app/quick-panel/i18n/cs.json +++ b/public/app/quick-panel/i18n/cs.json @@ -1,73 +1,73 @@ { "QUICKPANEL": { "EXPIRATION_GRAY_PERIOD": "Expiration Gray Period", - "NO_AVAILABLE_GROUPS": "No Available Groups", - "SAVE": "Save", + "NO_AVAILABLE_GROUPS": "Žádné dostupné skupiny", + "SAVE": "Uložit", "INFO": "Info", - "NEW_CHATGROUP": "New Group", - "NAME": "Name", - "MEMBERS": "Members", - "ENABLE_WRITING": "Enable Writing", - "GROUPS": "Groups", - "YOU": "You + {{participants}}", - "NEW_INTERNAL_MESSAGE": "New internal message", - "DELETE": "Delete", - "SEARCH": "Search", - "USERS": "Users", - "TODAY": "TODAY", - "MONDAY": "Monday", - "TUESDAY": "Tuesday", - "WEDNESDAY": "Wednesday", - "THURSDAY": "Thursday", - "FRIDAY": "Friday", - "SATURDAY": "Saturday", - "SUNDAY": "Sunday", - "JANUARY": "January", - "FEBRUARY": "February", - "MARCH": "March", - "APRIL": "April", - "MAY": "May", - "JUNE": "June", - "JULY": "July", - "AUGUST": "August", - "SEPTEMBER": "September", - "OCTOBER": "October", - "NOVEMBER": "November", - "DECEMBER": "December", + "NEW_CHATGROUP": "Nová skupina", + "NAME": "Jméno", + "MEMBERS": "Členové", + "ENABLE_WRITING": "Povolit zápis", + "GROUPS": "Skupiny", + "YOU": "Vy + {{participants}}", + "NEW_INTERNAL_MESSAGE": "Nová interní zpráva", + "DELETE": "Vymazat", + "SEARCH": "Vyhledat", + "USERS": "Uživatelé", + "TODAY": "DNES", + "MONDAY": "Pondělí", + "TUESDAY": "Úterý", + "WEDNESDAY": "Středa", + "THURSDAY": "Čtvrtek", + "FRIDAY": "Pátek", + "SATURDAY": "Sobota", + "SUNDAY": "Neděle", + "JANUARY": "Leden", + "FEBRUARY": "Únor", + "MARCH": "Březen", + "APRIL": "Duben", + "MAY": "Květen", + "JUNE": "Červen", + "JULY": "Červenec", + "AUGUST": "Srpen", + "SEPTEMBER": "Září", + "OCTOBER": "Říjen", + "NOVEMBER": "Listopad", + "DECEMBER": "Prosinec", "CHAT": "CHAT", - "ACTIVITY": "ACTIVITY", - "FRIENDS": "Friends", - "APP_SERVERS": "Application Servers", - "USER_STATS": "User Stats", - "EVENTS": "Events", - "NOTES": "Notes", - "QUICK_SETTINGS": "Quick Settings", - "NOTIFICATIONS": "Notifications", - "CLOUD_SYNC": "Cloud Sync", + "ACTIVITY": "AKTIVITA", + "FRIENDS": "Přátelé", + "APP_SERVERS": "Aplikační servery", + "USER_STATS": "Uživatelské statistiky", + "EVENTS": "Události", + "NOTES": "Poznámky", + "QUICK_SETTINGS": "Rychlé nastavení", + "NOTIFICATIONS": "Oznámení", + "CLOUD_SYNC": "Cloud Synch", "RETRO_THRUSTERS": "Retro Thrusters", - "RECENT": "Recent", - "START_NEW_CHAT": "Start New Chat", - "BACK": "Back", - "CALL": "Call", - "MORE": "More", - "SEND_MESSAGE": "Send message", - "REPLY_PLACEHOLDER": "Type and hit enter to send message", + "RECENT": "Současný", + "START_NEW_CHAT": "Spustit nový chat", + "BACK": "Zpět", + "CALL": "Zavolat", + "MORE": "Další", + "SEND_MESSAGE": "Odeslat zprávu", + "REPLY_PLACEHOLDER": "Napište zprávu a odešlete pomocí enter", "CONTACT_XCALLY_MOTION_SUPPORT": "Contact xCALLY Motion Support", - "EXPIRATION_DATE": "Expiration Date", - "EXPIRATION_REASON": "Expiration Reason", - "LICENSE": "License", - "NEW_TOKEN": "New Token", - "OLD_TOKEN": "Old Token", - "SEND_EMAIL_TO": "Send Email To", + "EXPIRATION_DATE": "Datum expirace", + "EXPIRATION_REASON": "Důvod expirace", + "LICENSE": "Licence", + "NEW_TOKEN": "Nový Token", + "OLD_TOKEN": "Starý Token", + "SEND_EMAIL_TO": "Odeslat email na", "TOKEN": "Token", "EXPIRATION_REASON_MESSAGE": "Your license has expired or your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", "GRAY_PERIOD_EXPIRATION": "Gray Period Expiration", "EXPIRATION_REASON_MESSAGE_GRAY": "Your license has expired or has been disabled. Contact xCALLY Motion Support Team.", "EXPIRATION_REASON_MESSAGE_CHANGED": "Your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", - "MESSENGER_DISABLED": "The internal messaging is disabled for this agent!", - "WARNING": "Warning", + "MESSENGER_DISABLED": "Interni messager je pro tohoto agenta neaktivní!", + "WARNING": "Varování", "ERRORS": { - "NAME_REQUIRED": "Mandatory Field" + "NAME_REQUIRED": "Povinné pole" } } } diff --git a/public/app/quick-panel/i18n/is.json b/public/app/quick-panel/i18n/is.json new file mode 100644 index 0000000..fd2a755 --- /dev/null +++ b/public/app/quick-panel/i18n/is.json @@ -0,0 +1,73 @@ +{ + "QUICKPANEL": { + "EXPIRATION_GRAY_PERIOD": "Expiration Gray Period", + "NO_AVAILABLE_GROUPS": "No Available Groups", + "SAVE": "Save", + "INFO": "Info", + "NEW_CHATGROUP": "New Group", + "NAME": "Name", + "MEMBERS": "Members", + "ENABLE_WRITING": "Enable Writing", + "GROUPS": "Groups", + "YOU": "You + {{participants}}", + "NEW_INTERNAL_MESSAGE": "New internal message", + "DELETE": "Delete", + "SEARCH": "Search", + "USERS": "Users", + "TODAY": "TODAY", + "MONDAY": "Monday", + "TUESDAY": "Tuesday", + "WEDNESDAY": "Wednesday", + "THURSDAY": "Thursday", + "FRIDAY": "Friday", + "SATURDAY": "Saturday", + "SUNDAY": "Sunday", + "JANUARY": "January", + "FEBRUARY": "February", + "MARCH": "March", + "APRIL": "April", + "MAY": "May", + "JUNE": "June", + "JULY": "July", + "AUGUST": "August", + "SEPTEMBER": "September", + "OCTOBER": "October", + "NOVEMBER": "November", + "DECEMBER": "December", + "CHAT": "CHAT", + "ACTIVITY": "ACTIVITY", + "FRIENDS": "Friends", + "APP_SERVERS": "Application Servers", + "USER_STATS": "User Stats", + "EVENTS": "Events", + "NOTES": "Notes", + "QUICK_SETTINGS": "Quick Settings", + "NOTIFICATIONS": "Notifications", + "CLOUD_SYNC": "Cloud Sync", + "RETRO_THRUSTERS": "Retro Thrusters", + "RECENT": "Recent", + "START_NEW_CHAT": "Start New Chat", + "BACK": "Back", + "CALL": "Call", + "MORE": "More", + "SEND_MESSAGE": "Send message", + "REPLY_PLACEHOLDER": "Type and hit enter to send message", + "CONTACT_XCALLY_MOTION_SUPPORT": "Contact xCALLY Motion Support", + "EXPIRATION_DATE": "Expiration Date", + "EXPIRATION_REASON": "Expiration Reason", + "LICENSE": "License", + "NEW_TOKEN": "New Token", + "OLD_TOKEN": "Old Token", + "SEND_EMAIL_TO": "Send Email To", + "TOKEN": "Token", + "EXPIRATION_REASON_MESSAGE": "Your license has expired or your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", + "GRAY_PERIOD_EXPIRATION": "Gray Period Expiration", + "EXPIRATION_REASON_MESSAGE_GRAY": "Your license has expired or has been disabled. Contact xCALLY Motion Support Team.", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", + "MESSENGER_DISABLED": "The internal messaging is disabled for this agent!", + "WARNING": "Warning", + "ERRORS": { + "NAME_REQUIRED": "Mandatory Field" + } + } +} diff --git a/public/app/reset/i18n/bs.json b/public/app/reset/i18n/bs.json index c3cf8da..2213573 100644 --- a/public/app/reset/i18n/bs.json +++ b/public/app/reset/i18n/bs.json @@ -1,20 +1,20 @@ { "RESETPASSWORD": { - "TITLE": "Reset your password", - "EMAIL_ADRESS": "Email address", - "PASSWORD": "Password", - "PASSWORD_CONFIRM": "Password (Confirm)", - "UPDATE_PASSWORD": "RESET MY PASSWORD", - "GO_BACK": "Go back to login", - "PASSWORD_RESET": "Password Reset", - "PASSWORD_RESET_MESSAGE": "Your password has been correctly reset, you can now login!", - "PASSWORD_RESET_ERROR": "Password Reset Error", + "TITLE": "Resetuj svoju lozinku", + "EMAIL_ADRESS": "E-mail adresa", + "PASSWORD": "Lozinka", + "PASSWORD_CONFIRM": "Lozinka (Potvrdi)", + "UPDATE_PASSWORD": "RESETUJ MOJU LOZINKU", + "GO_BACK": "Vrati se na prijavu", + "PASSWORD_RESET": "Reset Lozinke", + "PASSWORD_RESET_MESSAGE": "Tvoja lozinka je ispravno resetovana, sada se možeš prijaviti! ", + "PASSWORD_RESET_ERROR": "Greška Resetiranja Lozinke", "ERRORS": { - "EMAIL_REQUIRED": "Email field is required", - "EMAIL_MUST_VALID": "Email must be a valid e-mail address", - "PASSWORD_REQUIRED": "Password field is required", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "SECURE_PASSWORD_PATTERN": "Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}." + "EMAIL_REQUIRED": "Polje za E-mail je obavezno", + "EMAIL_MUST_VALID": "E-mail mora biti važeća e-mail adresa", + "PASSWORD_REQUIRED": "Polje za lozinku je obavezno", + "CONFIRM_NOT_MATCH": "Lozinke se ne podudaraju", + "SECURE_PASSWORD_PATTERN": "Mora sadržavati najmanje 8 znakova, sa najmanje 1 malim slovom, 1 velikim slovo, 1 numeričkim znakom i 1 posebnim znakom ~!?*@#$%^&-_=+[{]}." } } } diff --git a/public/app/reset/i18n/cs.json b/public/app/reset/i18n/cs.json index c3cf8da..797c909 100644 --- a/public/app/reset/i18n/cs.json +++ b/public/app/reset/i18n/cs.json @@ -1,20 +1,20 @@ { "RESETPASSWORD": { - "TITLE": "Reset your password", - "EMAIL_ADRESS": "Email address", - "PASSWORD": "Password", - "PASSWORD_CONFIRM": "Password (Confirm)", - "UPDATE_PASSWORD": "RESET MY PASSWORD", - "GO_BACK": "Go back to login", - "PASSWORD_RESET": "Password Reset", - "PASSWORD_RESET_MESSAGE": "Your password has been correctly reset, you can now login!", - "PASSWORD_RESET_ERROR": "Password Reset Error", + "TITLE": "Obnovení hesla", + "EMAIL_ADRESS": "Emailová adresa", + "PASSWORD": "Heslo", + "PASSWORD_CONFIRM": "Heslo (potvrzení)", + "UPDATE_PASSWORD": "OBNOVIT HESLO", + "GO_BACK": "Zpět na přihlášení", + "PASSWORD_RESET": "Obnovení hesla", + "PASSWORD_RESET_MESSAGE": "Vaše heslo bylo obnoveno, můžete se přihlásit!", + "PASSWORD_RESET_ERROR": "Chyba při obnovení hesla", "ERRORS": { - "EMAIL_REQUIRED": "Email field is required", - "EMAIL_MUST_VALID": "Email must be a valid e-mail address", - "PASSWORD_REQUIRED": "Password field is required", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "SECURE_PASSWORD_PATTERN": "Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}." + "EMAIL_REQUIRED": "Emailová adresa je povinná", + "EMAIL_MUST_VALID": "Emailová adresa musí být platná", + "PASSWORD_REQUIRED": "Heslo je povinné", + "CONFIRM_NOT_MATCH": "Hesla nesouhlasí", + "SECURE_PASSWORD_PATTERN": "Musí obsahovat minimálně 8 znaků s minimálně 1 malým, 1 velkým písmenem, číslem a 1 speciální znak ~!?*@#$%^&-_=+[{]}." } } } diff --git a/public/app/reset/i18n/is.json b/public/app/reset/i18n/is.json new file mode 100644 index 0000000..c3cf8da --- /dev/null +++ b/public/app/reset/i18n/is.json @@ -0,0 +1,20 @@ +{ + "RESETPASSWORD": { + "TITLE": "Reset your password", + "EMAIL_ADRESS": "Email address", + "PASSWORD": "Password", + "PASSWORD_CONFIRM": "Password (Confirm)", + "UPDATE_PASSWORD": "RESET MY PASSWORD", + "GO_BACK": "Go back to login", + "PASSWORD_RESET": "Password Reset", + "PASSWORD_RESET_MESSAGE": "Your password has been correctly reset, you can now login!", + "PASSWORD_RESET_ERROR": "Password Reset Error", + "ERRORS": { + "EMAIL_REQUIRED": "Email field is required", + "EMAIL_MUST_VALID": "Email must be a valid e-mail address", + "PASSWORD_REQUIRED": "Password field is required", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "SECURE_PASSWORD_PATTERN": "Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}." + } + } +} diff --git a/public/app/toolbar/i18n/ar.json b/public/app/toolbar/i18n/ar.json index 8783ff5..f7d1abd 100644 --- a/public/app/toolbar/i18n/ar.json +++ b/public/app/toolbar/i18n/ar.json @@ -120,6 +120,7 @@ "SMS": "رسالة قصيرة", "WHATSAPP": "ال WhatsApp", "NO_AUTOANSWER_CONFIGURED": "لم يتم تكوين الرد التلقائي للقنوات", - "BOSNIAN": "البوسنية" + "BOSNIAN": "البوسنية", + "ICELANDIC": "جزيرة" } } diff --git a/public/app/toolbar/i18n/bs.json b/public/app/toolbar/i18n/bs.json index 2b659de..ebaee51 100644 --- a/public/app/toolbar/i18n/bs.json +++ b/public/app/toolbar/i18n/bs.json @@ -1,128 +1,129 @@ { "TOOLBAR": { - "CHANGE_LANGUAGE_TITLE": "Change language", - "CHANGE_LANGUAGE_MESSAGE": "Remember to refresh the page to apply RTL Support (if enabled)", - "HEBREW": "Hebrew", - "PREFIXES": "Prefixes", - "CALL": "Call", - "ARABIC": "Arabic", - "INDONESIAN": "Indonesian", - "RESETPASSWORD": "Reset Password", - "PASSWORD_EXPIRE_REMAINING_DAYS": "Remaining days before your password expires", - "BROWSER_COMPATIBILITY": "Browser Compatibility [Chrome, Opera, Safari]", - "RECORDING": "Recording", - "INVALID_LICENSE": "Invalid License", - "BROWSER": "Browser", - "OS": "Operating System", - "REQUIREMENTS": "Requirements", - "LICENSE": "License", + "CHANGE_LANGUAGE_TITLE": "Promijeni jezik", + "CHANGE_LANGUAGE_MESSAGE": "Ne zaboravite osvježiti stranicu da primijenite RTL Podršku (ako jeo omogućena)", + "HEBREW": "Hebrejski", + "PREFIXES": "Prefiksi", + "CALL": "Pozivi", + "ARABIC": "Arapski", + "INDONESIAN": "Indonezijski", + "RESETPASSWORD": "Resetuj Lozinku", + "PASSWORD_EXPIRE_REMAINING_DAYS": "Preostali dani prije isteka lozinke", + "BROWSER_COMPATIBILITY": "Kompatibilnost Pretraživača [Chrome, Opera, Safari]", + "RECORDING": "Snimanje", + "INVALID_LICENSE": "Nevažeća Licenca", + "BROWSER": "Pretraživač", + "OS": "Operativni Sistem", + "REQUIREMENTS": "Zahtjevi", + "LICENSE": "Licenca", "HTTPS": "HTTPS", - "PHONE2CALL": "Phone to call", - "CHANNELS": "Channels", - "CHANNEL": "Channel", - "NUM_NOTIFICATIONS": "Notifications", - "NOTIFICATIONS": "Autoanswer enabled", - "DELAY": "Autoanswer delay [secs]", - "AUTOANSWER_NOTIFICATIONS": "Autoanswer notifications", + "PHONE2CALL": "Telefon za poziv", + "CHANNELS": "Kanali", + "CHANNEL": "Kanal", + "NUM_NOTIFICATIONS": "Obavještenja", + "NOTIFICATIONS": "Automatski odgovor je omogućen", + "DELAY": "Kašnjenje automatskog odgovora [secs] ", + "AUTOANSWER_NOTIFICATIONS": "Obavještenja o automatskim odgovorima", "CHAT": "Chat", - "EMAIL": "Email", + "EMAIL": "E-mail", "SMS": "SMS", - "OPENCHANNEL": "Openchannel", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", - "WHATSAPP": "Whatsapp connector", - "WEBRTCSUPPORT": "WebRTC Support", - "REGISTERED": "Registered", - "NOT_REGISTERED": "Not registered", - "WEBRTC_LICENSE_NOT_ENABELD": "WebRTC License is not enabled", - "ATTENDED_TRANSFER": "Attended Tranfer", - "TRANSFER": "Transfer", - "TARGET": "Target", - "CANCEL": "Cancel", - "FILENAME": "File name", + "WHATSAPP": "Whatsapp konektor", + "WEBRTCSUPPORT": "WebRTC Podrška", + "REGISTERED": "Registrovan", + "NOT_REGISTERED": "Nije registrovan", + "WEBRTC_LICENSE_NOT_ENABELD": "WebRTC licenca nije omogućena", + "ATTENDED_TRANSFER": "Prisustvovao Prijenosu", + "TRANSFER": "Prijenos", + "TARGET": "Cilj", + "CANCEL": "Otkaži", + "FILENAME": "Ime datoteke", "STATUS": "Status", - "NO_AUTOANSWER_CONFIGURED": "No autoanswer configured for channels", - "ACTIONS": "Actions", - "SPEAKER": "Speaker", - "RINGING": "Ringing tone", - "MICROPHONE": "Microphone", - "CONFERENCE": "Conference with 2 active sessions", - "PROFILE": "Profile", - "SERVICES": "Services", + "NO_AUTOANSWER_CONFIGURED": "Automatski odgovor nije konfigurisan za kanale", + "ACTIONS": "Radnje", + "SPEAKER": "Zvučnik", + "RINGING": "Ton zvuka", + "MICROPHONE": "Mikrofon", + "CONFERENCE": "Konferencija sa 2 aktivne sesije", + "PROFILE": "Profil", + "SERVICES": "Usluge", "AUDIO": "Audio", - "FULLNAME": "Fullname", - "NAME": "Name", - "INTERNAL": "Internal", - "RINGINGDEVICE": "Ringing Device", - "SPEAKERDEVICE": "Speaker Device", - "MICROPHONEDEVICE": "Microphone Device", - "CHANGEPASSWORD": "Change password", - "SETTINGS": "Settings", - "AUTOANSWER": "Auto answer", - "TOGGLE_NAVIGATION": "Toggle navigation", - "TOGGLE_NAVIGATION_FOLD": "Toggle navigation fold", - "TOGGLE_NAVIGATION_MODE": "Toggle navigation mode", - "SEARCH": "Search", - "USER_SETTINGS": "User settings", - "TOGGLE_QUICK_PANEL": "Toggle quick panel", - "SOMEONE_LOGGED_YOU_OUT": "Someone logged out, do you want to stay logged?", - "STAY_LOGGED": "Stay logged", - "WARNING": "Warning", - "ENGLISH": "English", - "ITALIAN": "Italian", - "FRENCH": "French", - "KOREAN": "Korean", - "SPANISH": "Spanish", - "SWEDISH": "Swedish", - "RUSSIAN": "Russian", - "GERMAN": "German", - "JAPANESE": "Japanese", - "CHINESESIMPLIFIED": "Chinese Simplified", - "CHINESETRADITIONAL": "Chinese Traditional", - "DUTCH": "Dutch", - "FINNISH": "Finnish", - "DANISH": "Danish", - "PORTUGUESE": "Portuguese", - "NORWEGIAN": "Norwegian", - "HINDI": "Hindi", - "HUNGARIAN": "Hungarian", - "TURKISH": "Turkish", - "PERSIAN": "Persian", - "LATVIAN": "Latvian", - "POLISH": "Polish", - "LOGIN_TIME": "Login Time", - "PAUSE_TIME": "Pause Time", - "PREVIEW": "Preview", - "CONFIRM_PASSWORD": "Confirm Password", - "NEW_PASSWORD": "New Password", - "OLD_PASSWORD": "Old Password", - "SAVE": "Save", - "TRIAL_VERSION": "Trial Version", - "PAUSE": "Pause", - "RESUME": "End Pause", - "NO_PAUSES_AVAILABLE": "No pauses available", - "CZECH": "Czech", + "FULLNAME": "Puno ime", + "NAME": "Ime", + "INTERNAL": "Interni", + "RINGINGDEVICE": "Uređaj na kojem zvoni", + "SPEAKERDEVICE": "Uređaj za zvučnik", + "MICROPHONEDEVICE": "Uređaj za mikrofon", + "CHANGEPASSWORD": "Promijeni Lozinku", + "SETTINGS": "Postavke", + "AUTOANSWER": "Automatski odgovor", + "TOGGLE_NAVIGATION": "Uključi navigaciju", + "TOGGLE_NAVIGATION_FOLD": "Uključi navigacijski preklop", + "TOGGLE_NAVIGATION_MODE": "Uključi navigacijski način", + "SEARCH": "Traži", + "USER_SETTINGS": "Postavke korisnika", + "TOGGLE_QUICK_PANEL": "Uključi brzi panel", + "SOMEONE_LOGGED_YOU_OUT": "Neko se odjavio, da li želiš ostati prijavljen?", + "STAY_LOGGED": "Ostani prijavljen", + "WARNING": "Upozorenje", + "ENGLISH": "Engleski", + "ITALIAN": "Italijanski", + "FRENCH": "Francuski", + "KOREAN": "Korejski", + "SPANISH": "Španski", + "SWEDISH": "Švedski", + "RUSSIAN": "Ruski", + "GERMAN": "Njemački", + "JAPANESE": "Japanski", + "CHINESESIMPLIFIED": "Kineski Pojednostavljen", + "CHINESETRADITIONAL": "Kineski Tradicionalni", + "DUTCH": "Holandski", + "FINNISH": "Finski", + "DANISH": "Danski", + "PORTUGUESE": "Portugalski", + "NORWEGIAN": "Norveški", + "HINDI": "Hindski", + "HUNGARIAN": "Mađarski", + "TURKISH": "Turski", + "PERSIAN": "Perzijski", + "LATVIAN": "Latvijski", + "POLISH": "Poljski", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "PREVIEW": "Pregled", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "NEW_PASSWORD": "Nova Lozinka", + "OLD_PASSWORD": "Stara Lozinka", + "SAVE": "Sačuvaj", + "TRIAL_VERSION": "Probna Verzija", + "PAUSE": "Pauza", + "RESUME": "Prekini Pauzu", + "NO_PAUSES_AVAILABLE": "Pauze nisu dostupne", + "CZECH": "Češki", "ERRORS": { - "FIELD_REQUIRED": "Mandatory Field", - "PASSWORD_REQUIRED": "Mandatory Field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "SECURE_PASSWORD_PATTERN": "The password must be at least 8 characters long and have 1 lowercase character, 1 uppercase character, 1 number and 1 special character ~!?*@#$%^&-_=+[{]}.", - "PASSWORD_OLDPASSWORD_MATCH": "New password must be different from previous one" + "FIELD_REQUIRED": "Obavezno Polje", + "PASSWORD_REQUIRED": "Obavezno Polje", + "CONFIRM_NOT_MATCH": "Lozinske se ne podudaraju", + "SECURE_PASSWORD_PATTERN": "Lozinka mora imati najmanje 8 znakova i 1 znak malog slova, 1 veliko slovo, 1 broj i 1 specijalni znak ~!?*@#$%^&-_=+[{]}.", + "PASSWORD_OLDPASSWORD_MATCH": "Nova lozinka mora biti drugačija od prethodne" }, - "BRAZILIAN": "Brazilian", - "ESTONIAN": "Estonian", - "WEBRTC_MICROPHONE_NOT_AVAILABLE": "No microphone available", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "No speaker available", - "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "No audio devices available", - "NO_AVAILABLE_INFO": "No available info", - "LITHUANIAN": "Lithuanian", - "NOTIFICATION_TITLE": "New notification from {{sender}}", - "NOTIFICATION_TITLE_RECIPIENT": "to {{recipient}}", - "USER_FORCE_LOGOUT": "{{ip}} has logged in with your credentials. \nMultiple logins are not allowed", - "LOGOUT": "Logout", - "SESSION_TIMEOUT": "The session will be automatically closed after 60 seconds", + "BRAZILIAN": "Brazilski", + "ESTONIAN": "Estonski", + "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Mikrofon nije dostupan", + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Zvučnik nije dostupan", + "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Audio uređaj nije dostupan", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "LITHUANIAN": "Litvanski", + "NOTIFICATION_TITLE": "Novo obavještenje od {{sender}}", + "NOTIFICATION_TITLE_RECIPIENT": "za {{recipient}}", + "USER_FORCE_LOGOUT": "{{ip}} se prijavio sa tvojim akreditivima. \nVišestruke prijave nisu dozvoljene", + "LOGOUT": "Odjava", + "SESSION_TIMEOUT": "Sesija će se automatski zatvoriti nakon 60 sekundi", "HELP": { - "PREVIEW_RECALLME": "This is a Recall Me call scheduled for {{date}}" + "PREVIEW_RECALLME": "Ovo je Recall Me poziv zakazan za {{date}}" }, - "BOSNIAN": "bosanski" + "BOSNIAN": "Bosanski", + "ICELANDIC": "Islandic" } } diff --git a/public/app/toolbar/i18n/cs.json b/public/app/toolbar/i18n/cs.json index 64a44b1..6a0408a 100644 --- a/public/app/toolbar/i18n/cs.json +++ b/public/app/toolbar/i18n/cs.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Pro kanály není nakonfigurována žádná automatická odpověď", - "BOSNIAN": "bosenský" + "BOSNIAN": "bosenský", + "ICELANDIC": "Islandský" } } diff --git a/public/app/toolbar/i18n/da.json b/public/app/toolbar/i18n/da.json index e9b51cb..60ae458 100644 --- a/public/app/toolbar/i18n/da.json +++ b/public/app/toolbar/i18n/da.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Intet autosvar konfigureret for kanaler", - "BOSNIAN": "bosnisk" + "BOSNIAN": "bosnisk", + "ICELANDIC": "Islandsk" } } diff --git a/public/app/toolbar/i18n/de.json b/public/app/toolbar/i18n/de.json index 9d138a9..d452759 100644 --- a/public/app/toolbar/i18n/de.json +++ b/public/app/toolbar/i18n/de.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "WhatsApp", "NO_AUTOANSWER_CONFIGURED": "Keine automatische Antwort für Kanäle konfiguriert", - "BOSNIAN": "bosnisch" + "BOSNIAN": "bosnisch", + "ICELANDIC": "Isländisch" } } diff --git a/public/app/toolbar/i18n/en.json b/public/app/toolbar/i18n/en.json index 7bb2214..37f389e 100644 --- a/public/app/toolbar/i18n/en.json +++ b/public/app/toolbar/i18n/en.json @@ -123,6 +123,7 @@ "HELP": { "PREVIEW_RECALLME": "This is a Recall Me call scheduled for {{date}}" }, - "BOSNIAN": "Bosnian" + "BOSNIAN": "Bosnian", + "ICELANDIC": "Islandic" } } diff --git a/public/app/toolbar/i18n/es.json b/public/app/toolbar/i18n/es.json index 408a79d..2a5f385 100644 --- a/public/app/toolbar/i18n/es.json +++ b/public/app/toolbar/i18n/es.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "No hay respuesta automática configurada para los canales", - "BOSNIAN": "bosnio" + "BOSNIAN": "bosnio", + "ICELANDIC": "isleño" } } diff --git a/public/app/toolbar/i18n/et.json b/public/app/toolbar/i18n/et.json index 5b08987..5092009 100644 --- a/public/app/toolbar/i18n/et.json +++ b/public/app/toolbar/i18n/et.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Kanalite jaoks pole automaatset vastust seadistatud", - "BOSNIAN": "bosnia keel" + "BOSNIAN": "bosnia keel", + "ICELANDIC": "saarlane" } } diff --git a/public/app/toolbar/i18n/fa.json b/public/app/toolbar/i18n/fa.json index 42c27e5..100dc92 100644 --- a/public/app/toolbar/i18n/fa.json +++ b/public/app/toolbar/i18n/fa.json @@ -120,6 +120,7 @@ "SMS": "پیامک", "WHATSAPP": "واتساپ", "NO_AUTOANSWER_CONFIGURED": "هیچ پاسخ خودکار برای کانال ها پیکربندی نشده است", - "BOSNIAN": "بوسنیایی" + "BOSNIAN": "بوسنیایی", + "ICELANDIC": "جزیره ای" } } diff --git a/public/app/toolbar/i18n/fi.json b/public/app/toolbar/i18n/fi.json index 469092f..248942a 100644 --- a/public/app/toolbar/i18n/fi.json +++ b/public/app/toolbar/i18n/fi.json @@ -120,6 +120,7 @@ "SMS": "tekstiviesti", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Kanaville ei ole määritetty automaattista vastausta", - "BOSNIAN": "bosnialainen" + "BOSNIAN": "bosnialainen", + "ICELANDIC": "Islannin kieli" } } diff --git a/public/app/toolbar/i18n/fr.json b/public/app/toolbar/i18n/fr.json index bb1147a..2a35a78 100644 --- a/public/app/toolbar/i18n/fr.json +++ b/public/app/toolbar/i18n/fr.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "WhatsApp", "NO_AUTOANSWER_CONFIGURED": "Aucune réponse automatique configurée pour les canaux", - "BOSNIAN": "bosniaque" + "BOSNIAN": "bosniaque", + "ICELANDIC": "Islandais" } } diff --git a/public/app/toolbar/i18n/he.json b/public/app/toolbar/i18n/he.json index 7204fd1..52611b6 100644 --- a/public/app/toolbar/i18n/he.json +++ b/public/app/toolbar/i18n/he.json @@ -120,6 +120,7 @@ "SMS": "סמס", "WHATSAPP": "וואטסאפ", "NO_AUTOANSWER_CONFIGURED": "לא הוגדר תשובה אוטומטית עבור ערוצים", - "BOSNIAN": "בוסנית" + "BOSNIAN": "בוסנית", + "ICELANDIC": "אילנדית" } } diff --git a/public/app/toolbar/i18n/hi.json b/public/app/toolbar/i18n/hi.json index 7c9bdbb..61c0fbf 100644 --- a/public/app/toolbar/i18n/hi.json +++ b/public/app/toolbar/i18n/hi.json @@ -120,6 +120,7 @@ "SMS": "एसएमएस", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "चैनलों के लिए कोई स्वतः उत्तर कॉन्फ़िगर नहीं किया गया", - "BOSNIAN": "बोस्नियाई" + "BOSNIAN": "बोस्नियाई", + "ICELANDIC": "आइलैंडिक" } } diff --git a/public/app/toolbar/i18n/hu.json b/public/app/toolbar/i18n/hu.json index b34b508..b91b9d5 100644 --- a/public/app/toolbar/i18n/hu.json +++ b/public/app/toolbar/i18n/hu.json @@ -123,6 +123,7 @@ "WHATSAPP": "Whatsapp", "PHONE2CALL": "Telefon a híváshoz", "NO_AUTOANSWER_CONFIGURED": "Nincs automatikus válasz konfigurálva a csatornákhoz", - "BOSNIAN": "bosnyák" + "BOSNIAN": "bosnyák", + "ICELANDIC": "szigeti" } } diff --git a/public/app/toolbar/i18n/id.json b/public/app/toolbar/i18n/id.json index b75a67a..da184b6 100644 --- a/public/app/toolbar/i18n/id.json +++ b/public/app/toolbar/i18n/id.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "ada apa", "NO_AUTOANSWER_CONFIGURED": "Tidak ada jawaban otomatis yang dikonfigurasi untuk saluran", - "BOSNIAN": "Bosnia" + "BOSNIAN": "Bosnia", + "ICELANDIC": "pulau" } } diff --git a/public/app/toolbar/i18n/is.json b/public/app/toolbar/i18n/is.json new file mode 100644 index 0000000..161e45c --- /dev/null +++ b/public/app/toolbar/i18n/is.json @@ -0,0 +1,129 @@ +{ + "TOOLBAR": { + "CHANGE_LANGUAGE_TITLE": "Change language", + "CHANGE_LANGUAGE_MESSAGE": "Remember to refresh the page to apply RTL Support (if enabled)", + "HEBREW": "Hebrew", + "PREFIXES": "Prefixes", + "CALL": "Call", + "ARABIC": "Arabic", + "INDONESIAN": "Indonesian", + "RESETPASSWORD": "Reset Password", + "PASSWORD_EXPIRE_REMAINING_DAYS": "Remaining days before your password expires", + "BROWSER_COMPATIBILITY": "Browser Compatibility [Chrome, Opera, Safari]", + "RECORDING": "Recording", + "INVALID_LICENSE": "Invalid License", + "BROWSER": "Browser", + "OS": "Operating System", + "REQUIREMENTS": "Requirements", + "LICENSE": "License", + "HTTPS": "HTTPS", + "PHONE2CALL": "Phone to call", + "CHANNELS": "Channels", + "CHANNEL": "Channel", + "NUM_NOTIFICATIONS": "Notifications", + "NOTIFICATIONS": "Autoanswer enabled", + "DELAY": "Autoanswer delay [secs]", + "AUTOANSWER_NOTIFICATIONS": "Autoanswer notifications", + "CHAT": "Chat", + "EMAIL": "Email", + "SMS": "SMS", + "OPENCHANNEL": "Openchannel", + "FAX": "Fax", + "WHATSAPP": "Whatsapp connector", + "WEBRTCSUPPORT": "WebRTC Support", + "REGISTERED": "Registered", + "NOT_REGISTERED": "Not registered", + "WEBRTC_LICENSE_NOT_ENABELD": "WebRTC License is not enabled", + "ATTENDED_TRANSFER": "Attended Tranfer", + "TRANSFER": "Transfer", + "TARGET": "Target", + "CANCEL": "Cancel", + "FILENAME": "File name", + "STATUS": "Status", + "NO_AUTOANSWER_CONFIGURED": "No autoanswer configured for channels", + "ACTIONS": "Actions", + "SPEAKER": "Speaker", + "RINGING": "Ringing tone", + "MICROPHONE": "Microphone", + "CONFERENCE": "Conference with 2 active sessions", + "PROFILE": "Profile", + "SERVICES": "Services", + "AUDIO": "Audio", + "FULLNAME": "Fullname", + "NAME": "Name", + "INTERNAL": "Internal", + "RINGINGDEVICE": "Ringing Device", + "SPEAKERDEVICE": "Speaker Device", + "MICROPHONEDEVICE": "Microphone Device", + "CHANGEPASSWORD": "Change password", + "SETTINGS": "Settings", + "AUTOANSWER": "Auto answer", + "TOGGLE_NAVIGATION": "Toggle navigation", + "TOGGLE_NAVIGATION_FOLD": "Toggle navigation fold", + "TOGGLE_NAVIGATION_MODE": "Toggle navigation mode", + "SEARCH": "Search", + "USER_SETTINGS": "User settings", + "TOGGLE_QUICK_PANEL": "Toggle quick panel", + "SOMEONE_LOGGED_YOU_OUT": "Someone logged out, do you want to stay logged?", + "STAY_LOGGED": "Stay logged", + "WARNING": "Warning", + "ENGLISH": "English", + "ITALIAN": "Italian", + "FRENCH": "French", + "KOREAN": "Korean", + "SPANISH": "Spanish", + "SWEDISH": "Swedish", + "RUSSIAN": "Russian", + "GERMAN": "German", + "JAPANESE": "Japanese", + "CHINESESIMPLIFIED": "Chinese Simplified", + "CHINESETRADITIONAL": "Chinese Traditional", + "DUTCH": "Dutch", + "FINNISH": "Finnish", + "DANISH": "Danish", + "PORTUGUESE": "Portuguese", + "NORWEGIAN": "Norwegian", + "HINDI": "Hindi", + "HUNGARIAN": "Hungarian", + "TURKISH": "Turkish", + "PERSIAN": "Persian", + "LATVIAN": "Latvian", + "POLISH": "Polish", + "LOGIN_TIME": "Login Time", + "PAUSE_TIME": "Pause Time", + "PREVIEW": "Preview", + "CONFIRM_PASSWORD": "Confirm Password", + "NEW_PASSWORD": "New Password", + "OLD_PASSWORD": "Old Password", + "SAVE": "Save", + "TRIAL_VERSION": "Trial Version", + "PAUSE": "Pause", + "RESUME": "End Pause", + "NO_PAUSES_AVAILABLE": "No pauses available", + "CZECH": "Czech", + "ERRORS": { + "FIELD_REQUIRED": "Mandatory Field", + "PASSWORD_REQUIRED": "Mandatory Field", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "SECURE_PASSWORD_PATTERN": "The password must be at least 8 characters long and have 1 lowercase character, 1 uppercase character, 1 number and 1 special character ~!?*@#$%^&-_=+[{]}.", + "PASSWORD_OLDPASSWORD_MATCH": "New password must be different from previous one" + }, + "BRAZILIAN": "Brazilian", + "ESTONIAN": "Estonian", + "WEBRTC_MICROPHONE_NOT_AVAILABLE": "No microphone available", + "WEBRTC_SPEAKER_NOT_AVAILABLE": "No speaker available", + "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "No audio devices available", + "NO_AVAILABLE_INFO": "No available info", + "LITHUANIAN": "Lithuanian", + "NOTIFICATION_TITLE": "New notification from {{sender}}", + "NOTIFICATION_TITLE_RECIPIENT": "to {{recipient}}", + "USER_FORCE_LOGOUT": "{{ip}} has logged in with your credentials. \nMultiple logins are not allowed", + "LOGOUT": "Logout", + "SESSION_TIMEOUT": "The session will be automatically closed after 60 seconds", + "HELP": { + "PREVIEW_RECALLME": "This is a Recall Me call scheduled for {{date}}" + }, + "BOSNIAN": "Bosnian", + "ICELANDIC": "íslenskt" + } +} diff --git a/public/app/toolbar/i18n/it.json b/public/app/toolbar/i18n/it.json index 7e3c26d..590be2a 100644 --- a/public/app/toolbar/i18n/it.json +++ b/public/app/toolbar/i18n/it.json @@ -123,6 +123,7 @@ "SMS": "sms", "WHATSAPP": "WhatsApp", "NO_AUTOANSWER_CONFIGURED": "Nessuna risposta automatica configurata per i canali", - "BOSNIAN": "bosniaco" + "BOSNIAN": "bosniaco", + "ICELANDIC": "isolano" } } diff --git a/public/app/toolbar/i18n/ja.json b/public/app/toolbar/i18n/ja.json index 9ce87b6..d58a8eb 100644 --- a/public/app/toolbar/i18n/ja.json +++ b/public/app/toolbar/i18n/ja.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "チャネルに自動応答が設定されていません", - "BOSNIAN": "ボスニア語" + "BOSNIAN": "ボスニア語", + "ICELANDIC": "島の" } } diff --git a/public/app/toolbar/i18n/ko.json b/public/app/toolbar/i18n/ko.json index 33a0099..b39b7a4 100644 --- a/public/app/toolbar/i18n/ko.json +++ b/public/app/toolbar/i18n/ko.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "왓츠앱", "NO_AUTOANSWER_CONFIGURED": "채널에 대해 구성된 자동 응답이 없습니다.", - "BOSNIAN": "보스니아어" + "BOSNIAN": "보스니아어", + "ICELANDIC": "아일랜드어" } } diff --git a/public/app/toolbar/i18n/lt.json b/public/app/toolbar/i18n/lt.json index b6b187e..b4f3558 100644 --- a/public/app/toolbar/i18n/lt.json +++ b/public/app/toolbar/i18n/lt.json @@ -120,6 +120,7 @@ "SMS": "trumpoji žinutė", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Automatinis atsakymas kanalams nesukonfigūruotas", - "BOSNIAN": "bosnių" + "BOSNIAN": "bosnių", + "ICELANDIC": "Islandiškas" } } diff --git a/public/app/toolbar/i18n/lv.json b/public/app/toolbar/i18n/lv.json index 3bfa440..1d28d64 100644 --- a/public/app/toolbar/i18n/lv.json +++ b/public/app/toolbar/i18n/lv.json @@ -120,6 +120,7 @@ "SMS": "īsziņa", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Kanāliem nav konfigurēta automātiskā atbilde", - "BOSNIAN": "bosniešu" + "BOSNIAN": "bosniešu", + "ICELANDIC": "Islandisks" } } diff --git a/public/app/toolbar/i18n/nl.json b/public/app/toolbar/i18n/nl.json index 159c730..da368a8 100644 --- a/public/app/toolbar/i18n/nl.json +++ b/public/app/toolbar/i18n/nl.json @@ -120,6 +120,7 @@ "SMS": "sms", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Geen automatisch antwoord geconfigureerd voor kanalen", - "BOSNIAN": "Bosnisch" + "BOSNIAN": "Bosnisch", + "ICELANDIC": "eilandachtig" } } diff --git a/public/app/toolbar/i18n/no.json b/public/app/toolbar/i18n/no.json index 35f8c16..1829459 100644 --- a/public/app/toolbar/i18n/no.json +++ b/public/app/toolbar/i18n/no.json @@ -120,6 +120,7 @@ "SMS": "tekstmelding", "WHATSAPP": "Hva skjer", "NO_AUTOANSWER_CONFIGURED": "Ingen autosvar konfigurert for kanaler", - "BOSNIAN": "bosnisk" + "BOSNIAN": "bosnisk", + "ICELANDIC": "Islandsk" } } diff --git a/public/app/toolbar/i18n/pl.json b/public/app/toolbar/i18n/pl.json index fa881d4..0239f1b 100644 --- a/public/app/toolbar/i18n/pl.json +++ b/public/app/toolbar/i18n/pl.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Brak automatycznej odpowiedzi skonfigurowanej dla kanałów", - "BOSNIAN": "bośniacki" + "BOSNIAN": "bośniacki", + "ICELANDIC": "Islandzki" } } diff --git a/public/app/toolbar/i18n/pt-BR.json b/public/app/toolbar/i18n/pt-BR.json index e44f597..2ebfc33 100644 --- a/public/app/toolbar/i18n/pt-BR.json +++ b/public/app/toolbar/i18n/pt-BR.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Nenhuma resposta automática configurada para canais", - "BOSNIAN": "bósnio" + "BOSNIAN": "bósnio", + "ICELANDIC": "ilhéu" } } diff --git a/public/app/toolbar/i18n/pt-PT.json b/public/app/toolbar/i18n/pt-PT.json index efc2d09..7a5cb84 100644 --- a/public/app/toolbar/i18n/pt-PT.json +++ b/public/app/toolbar/i18n/pt-PT.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Nenhuma resposta automática configurada para canais", - "BOSNIAN": "bósnio" + "BOSNIAN": "bósnio", + "ICELANDIC": "ilhéu" } } diff --git a/public/app/toolbar/i18n/ru.json b/public/app/toolbar/i18n/ru.json index 12d8d12..ea13d42 100644 --- a/public/app/toolbar/i18n/ru.json +++ b/public/app/toolbar/i18n/ru.json @@ -120,6 +120,7 @@ "SMS": "смс", "WHATSAPP": "WhatsApp", "NO_AUTOANSWER_CONFIGURED": "Для каналов не настроен автоответчик", - "BOSNIAN": "боснийский" + "BOSNIAN": "боснийский", + "ICELANDIC": "островной" } } diff --git a/public/app/toolbar/i18n/sv.json b/public/app/toolbar/i18n/sv.json index 5c41096..dffab42 100644 --- a/public/app/toolbar/i18n/sv.json +++ b/public/app/toolbar/i18n/sv.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Inget autosvar konfigurerat för kanaler", - "BOSNIAN": "bosniska" + "BOSNIAN": "bosniska", + "ICELANDIC": "Islandic" } } diff --git a/public/app/toolbar/i18n/tr.json b/public/app/toolbar/i18n/tr.json index 50eec67..d0e603c 100644 --- a/public/app/toolbar/i18n/tr.json +++ b/public/app/toolbar/i18n/tr.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Naber", "NO_AUTOANSWER_CONFIGURED": "Kanallar için yapılandırılmamış otomatik yanıt yok", - "BOSNIAN": "Boşnakça" + "BOSNIAN": "Boşnakça", + "ICELANDIC": "adalı" } } diff --git a/public/app/toolbar/i18n/zh-CN.json b/public/app/toolbar/i18n/zh-CN.json index 900ccde..34075b2 100644 --- a/public/app/toolbar/i18n/zh-CN.json +++ b/public/app/toolbar/i18n/zh-CN.json @@ -120,6 +120,7 @@ "SMS": "短信", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "没有为频道配置自动应答", - "BOSNIAN": "波斯尼亚语" + "BOSNIAN": "波斯尼亚语", + "ICELANDIC": "岛国" } } diff --git a/public/app/toolbar/i18n/zh-TW.json b/public/app/toolbar/i18n/zh-TW.json index 84404e6..d301196 100644 --- a/public/app/toolbar/i18n/zh-TW.json +++ b/public/app/toolbar/i18n/zh-TW.json @@ -120,6 +120,7 @@ "SMS": "短信", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "沒有為頻道配置自動應答", - "BOSNIAN": "波斯尼亞語" + "BOSNIAN": "波斯尼亞語", + "ICELANDIC": "島國" } } diff --git a/public/assets/images/flags/is.png b/public/assets/images/flags/is.png new file mode 100644 index 0000000000000000000000000000000000000000..a1a77a3f642774d1487ac39fb87d91d16f7c5792 GIT binary patch literal 14614 zcmeHtWmsF^@@{Z9<-SHPg^Ocj3SW~>&teLvvH66 zVRQlC90~nqU;W@N>1<&rf|EEf;o2VkM1Tpx!v7G5tq5o z2e00SJ1dNztq1w9wta6jtUZ*H5Sd@ld^kS-=<^tNkp1JwS&sfhE??sT59H`BYj#=h zRMRxdq=?!KM{cC$oXhpK+oNDr#+fG}=7@&aFEKMXwHFoXs@p16>)G`olU!UN#j9Vv zw}+ns>LdFsY?2;}9y+#FZNU+-srw#&*bf2hr;;s;u+teFIPhpAz;-=-cra&=;mc zu!z?4Dczx6PQfwW?v~t~8welvWZf1Qw*p*oBP^n#B{Qe9Kz^2{KKKfxR zsk72G%RDg>xq!eYo;=hR>TG-<%r*eJOEZco%#)3MQIexlSy7TFmmsp6qe{Z^lTd}9 zG2K+9q9om1E?!{HRJEpgZp|Mn*xIf=-N3}Y>uPj7S1kY3bn^C`K2A7=+$T+2ks^Rl zl5d>?<*`0s& z@DR4JGGhPWt3vw5tM0$P*XevYgCbx6Zr)_yoU_qC^b=B*s5%^`MV_vmVo($7( z2N54^ynz#c(bF-n0V(SA{fF*5Yn8h#p~vnYImyQlQ}FJa6XrUO^gP;6h@guGGT&zSkw zdr5*f^WSSmeWuSnE*usX71x4_*=%iVWi=qr#G1`&s4HXX&wi{G+OL})i7xL` z@@J9r?eoK?PSV2;+2qW8Ux0I-4Zpy#N9$z!9K0i3e@0msyOp?%Th-`S zOc#EBEx+Zka_0FgDC3jJ3h&zW^xA}9FpRvUglDO~q$X1wN!dQf%FVUW`S_=DE`G0M zJuYcXf$n8qI5tY6mYE2X2p@@9rk#6ZWE1)O!Jrw1u`a)n?!vXH*9C$b}aja1!M%mqn$bx)RW)l^R` z)tI&-Ho@uiPV6@N1@6GOIIf^9DgncqqM`p_DYA1F7dCG!yn4dqOKrEbsp81IWxiwWC!}^@VIP%LIZllWflJII*CGd6FP!^RwQ8&&wH*9^b^o zVzo=SfQ@HpgR#Eoc@U3DC1onE&(8a!440*b4b3j?=4g>VkyLYlUtb7Gan8=Cmyy_g z+dl_*w3n`WjneBzm_9eEtP#4WOM31Vms!4-cF)x=kL&SHI>VL+r)E3XGLU$E8nS|N z3VB+0tkYxQe6_mw|8R`V9Me2Zp~G9`Qh2$Z?AH9wbfhieHd_LPjHj-czFZMFYb|iZn zs_=%WbmSdvB(@ql-e#ya!0i`C2oJ3(ainrMC#KYwv&*k>tnQp1xjiR9%nOYdKw24T zd!}J!?a}j|K*NxCplNC60dg&B!$A$Kj)uezophF*ld(74M2A>Irxc9J4S8ood2+O0@zsmn&?MkrxzXar8FB2al&w|c z-Bj*mau~M6_;|KL+HlS>72b8I_3MWkG}EB}K-1`CB6MdtOtm2tj=Y4U2UB@R*)d4+ zlfX=C&%6zvsm|4)$VJ%An&U@@d-(%!O|R8M~!{R{TgUM-2h?^G|v^^VTA;npgtKcn}RdOT^=#}7MS3MMK@ zD$gZ>Ps!Im*}rAH_B8`6L?TW^`OKPZ3!-EV>JP{*G1=#JCM;xY-QjEu%Fa36uF-f_ zq>;##?T83lb-7bn1|cQtC^QMrSTI>|CsEmau$Tr=E2q@H;s90^A&BcXM6U^c@fDu^ z5yTaa`a)`eXHqXXCX@Xauwi(aEihSrjZL0NSq6V%E=xcN~WRhlzqXLPTp3*+y?RjLfJdl zz!A_u7-d+2a5*z0&gWQ6kh}L*dI}QkWo7C#Vl>2v20N^M2PBxb3z5n1xrxa|w=XrC zfS~CCVwsjqX}!l0FmQN;Sia9(zlql(FhjnfA$%usNA6PQw(0zq+&-PUj$Rw7{2nK3 zvEbBrhK<;e)mz1pY%9=Ok-V-*CL9Y%bA|RiWhBv zCwxAK5DB76KGlPDSEKPpnqm|O${IzO&Y%Z!F~p>1bks-qB~<>7qZ(Aw{6LFCMNyjZ*fG2x(eT7m6{EWt)q z`<#s`Rep^Fh{H*?Pf*_o`-hffXWr3rAqdEtFmF3NN^#Y|S z!3%?Z@%uW=KINX#(Qx#nsOPn^xcF9>{0c0{l3)veXX%_uRPWis${h)3y<<-qfFAp_ z3qY&(O#vj7g8g$I@$eCVVAubFZ$=X%pVkUVwKw1buDEYZ#(8Z9LXea@tmaG7Dwd|0 zHVfyOOO;m=qN&I)C!RGRk#R5NuatDD7&2NUpkx!Vh;5_Sj;6{}f&5n(pYUlZ>yxO{V<6H8S}Fp6^A;@eqVJ>U=O$XktfXj_mc0$5M&&8D_Y$z&3tyge5vc^M%+OZSpzC zHzau>1|25k(mnAhZe)ck@d+BF_yt*~0lQ~?#-P}1nX{geqz4b_PPTL#l60m@ah0Q< z@>uy!_wdzs#X>`BcXFE*%O1RBWLoKCJ=i|6YIQQo6yQerTRbJsHqF;Kam5MS z1sh{T-Lnplo$R-1!9hw=S8@;cwD(P#E=1?b-I`x)lq$}CU)LRarB38%wky_F*y?0C z9R+B7cw{)=6AP1iO!9YK&6$y%6%_g{{%d`!L+`GJx;y9${)0ccqE9>OS7?V!US_km zL~kfvL2byvvo|qN3#xu4&;`NExjlXkhxfhPX&A^fnf!bu{I;&FPlJ0{i@fB@U;Ioc z%|uH+Yysz+S~c`555Irk+fI@UyU;w+)26chmWrDdJ-#B(JnM@VvYK3x(2_4RW5t<7 zUrd;UWM;iNaONvLboeEer^y7`le{#Dg)S-)L*ChL1RfDHi4k?g9|4(u;q-)%(MIi) zd0hNq@(|2xezS~K@wG4SGA1pE zov4~|Ij2i!vjoqwtYPD4YJmzz&koA`ys$s{z{j!~GuP+su3RRG`y#wXuM8v-`KcMi zOAz}R@CfudB93F;+AK4@e=WfvWmyqnS_0@R0%dCShD|b;SIqNRKzGG`0=w{<`rBM? z&IS!P8KbkV>$@a=kgvQgMELkh;f?@0n#7~800tU>XJc(yh(rx@fgfJW$lcOkq-^$l z(j4}fv^HYu`AkVlI7D-e~uI@FT z1}l?*3}#6bP*L|%>71945~6~Yqm`U#4^65RX61{l&`OaXboBC38jGkpeTh&?gO&t2 zqT+aXD_Q@uprD4(9ME5)LryVJfPF8%lkWvpcG)AqQaEQ+ zB|Zlzew7XjGZ{ICI+C6b1Y~NaD;Zw#sgj0rta8>dF1|ydapCvrOIQc1gJF)8 zmXn)`SbZYd%!B0O&BX2XO%3}^5AQ>f&~2tV`lG0{4RLGdn@X+Xu<)ha9!NiA7|5#65rZVCr>V7?+_WHQ1a)$2xCqMmX{2VxzP+l5Atv1H}=Y@LEQU zK<(^^SwxzsX*q5`VFIv&kmed8((`%}xwUVd4R=@$b?B5wItif`5_!DK(3ls}uS@W7 z*8p7h##W%(E`A;ZasbbL)*_D*->$Q1vMGuxhL3|NTba#^K70{=5Aq(K8pPjf%=e7y z0RU1iP#MyM^InA~@eYhk$(S2uL7T61DJ38JxgJs}htEAY|gn4xYr#r|tphPUt5tx)3h^w)`&5VC;q%_t(^nMK4; z?Pe>}Pmva{u;Osy^d@)o5nThyPv@l_@FkZwJ|Wi&(h>`}+x?K5!04@xv_svTJY~mB z)Z!44qnomrk$bt&tQgjlJC&P72^gX_4yLnT3{puUhkCW`-o1a8Dm?* zeoUf)8c9BdqA}%5{CE|(5V5zfUgFnydj%hqy2H%}Afz4=Fw}6Ht%=EtG~k1fh{ zS5YOF>ONsh#SP!_e=E$PK5~h5S#f!x0^+P}(Vj0C!9Yvv6i-9qqex)w%kEk#6=Kus zo(FODTU=<9kJxV--wLucE_NQ%8#NpM8fJ@gqR}7Hek&6HrN;^vd&gT|1wp8(eKild z;TPqb7dy=SE7+sk9P+SNgb@^HppLfw&h$jtuVU5LTaZ40Vhv6cCDj*#q=^nQj5 z(uh2ZXPEJdvx0lsMbZof9mflkJC}@Pemi~_*wCqX>j&9Lf$AL( z%^j`D>Y=phfvXMVcgYG~Ezg=kD9*mY=whd->7U*ve&r&)Kg^mpi&z&$+U=S=57%|-S3OO)rC+Yvhx zfo@?Xa`$%}m*bLiK~*=e3T#+J*86gt1QM4JQhM4Viq^YSE_-w5onbsmiJ?}g!I@M& zrn78BgJ({GwBz%yTNOc3q*{;k8D&Tcw^VbaBNEGU$RFb&#UmG#!R@5@(u@qFlA1IA zd1W?fH&!!ydp>%D*&8W~7K z{j$oo+(e|&oV?e+ZT39ZJ++npw(l-nSGaOdgrfi< zM^*d~G4g;;D!ZWDn+%bM|G+yt2$)sXqKAx56k!{AFthG)&41Ol@UunGNG!>Ly<)_V z{mQ>XWpH7vy9$~d8~bu=Zr`U}ky6Qr`O`*wf9=uuMzRa`y)O65`AOHBvVe-oD#_UV z{MX(Br6!|o^T5gbwX)NGIDc?-Ya(HZB&t{9kEWd2@y2&B>g;Yc&Ia=J=^v{Hx6tpo zfjl>q&I&@;Qg}e1mCxbuuDi=k#@NXrgrS6@Dgf+?=Pm2M4|Gri7B1hsWi2 ze5Yr|b*y?HetmhqXis`0Ocv^S0icL|82xNoyhBqpMAMKphZv@`APQVi6&Rt}hRV4P=%B)dygUxz_t=-5_ zMheL@jqD~p^!{`~^iW5|2-AB4&QI^PaRVXl-Jyx;Prq-QRVuzorC3aUq4%8QtabIo zb&k>fS-x!AKswU*Jn38_=>-_6?661^zc$oZ+%Dk+X2p@XzGsimZS;d7F*c+kT9*p4 z2+QwFtVTZaD(L#yjB7*mJfq6HE?R4YTBTg0Hzr_y+Oz3evKL9EHc)+tf=;waGK@-> zp!w|;ZL1To=IAm6TNOg0%--8o*w`hP=L#-EW#AGw_hUWee4z%mr|SIt`nFnnTFI9&eF*?4qN8&$w*(@Se z_-Ge#6uuC?0+yCiL)9ntaXp;vIpD!aU=Nu=zjs~Ei2dn=q&90%17g}Y$cj(8c7&ZE zQ65L0_wxnDksxr0&4f1{j%KFeOra^BAI)&SIkW51Vh+ohp=+;)B}lbEtRuF%C$Y|g`-5@pIQt4LYs={+d`y z!@w5wzC~6_<%~;f)fn;l7Tet5KtbSE7 z$}l^@^vMUo2}zyvw?*GMP{#7T%B37v?iDe!)^|3foR=~uIz78rn{JhQG)+7;FJZ$f zQt-TQej{Doni5{Rc*uDr5z)jrr<^YW)(4!X#!DIzUhka4@q`*g>D{G+mvk(tl(?GV zk!T9;LkJLsHR{^WD4g3X7WpXmawl5LL@&jFV&@bp^loMJ&U=Sz^Z~1u)^iL}ShGO; z1r0}CF`soMFHV||It45dcEfbL=tVqX%eA=8ZaqByIwK^8eir?M$`wGp-~HuFx$mv6 zz7Z?dJRl#X3W^BDP;PScxsg0JD$~#EzExz43ht7~MYwvkMT7@Z8@{QE%7r+lowluKF|+WX34=#uLO> z80l2Gs$iBYZn4u0VAfRlbYW(N{?Dh!WWmUIHS~vDq^l+&P$Nn6+7;u7ipY5r& z{rJZBK~b#ycXr@pHw;Z6Xa?^_=%irJ>%M?Ntfanzl!8k%W=)vI`)swqxY$6XYoEzx z_RHv=YOBVw!&U%k3*u+Ds?-m@u9NA_F^INw0YY($XUi?W9UirO=cBDFW(aSp#5!5&4``U0jMWo7V_GOGDLv;`Ag8`GokKmm_FMH+85 z?XlIg74-Pot%*>Xe2?WB>Q&A8{KYwfQtM;UD@PBMqt4E*0wmWr#0&5DCW-om2P`2j z_C18ZUL+)EvLIlH!Z=jRl5S@XjgD`OUd&@KRtdWOlCPaj3$5{ZN8I%NZPhXRG|%i~ z7O!2&!NHOpidtdm3K{NKam%tobNwBp!r;#4joG7cPb3GVucx?Vf-?IR?tL*SjfkKy zu{8x&G?N5Km6yC&p{O>3cd(&e0F|JwSjv*mtUKv7Z%i~ZRp}df)QRxAul3EwwM5hi z;Qq4va3MQg6D+bJ_Hx6Kz@8Z}qc_|D^WB@@Dzk;TjT?_gG*s#6!!kCg?%$E7PY@nT zav3Z^{)pHycAVApgtbE(w&jLFK0`=9UQf0j(N7&F7m#I|l;yI{e)5-)EMh;aV<%0$ zxh-|Rs(bm+$sqKYwcE|qo}jB>uY{Bnq!}qqP}21Fv3w)OXu3YhuT)kw+9e&oT>a&( z`TQ}%vIa-GC0(QIQW*l#mn-UpSs(lZoKf3@85u0%jk2G?IX}BS0^hBmY7NgEkkgID ztH`m}7DF+=Le#a$I{Su`3T z>wIOJ^j72nM(?q^SA@J3rZ@pXgJ(}#%lH8>nr`Q9BQU?4p3njhp5*T!U)V`cBoRqoD8ui{fyghG?-(bC3*TRW|X=D-Og? zlXv>`wUrvEZ?sis7U#%;?!YeG4HC1&RXQ%pXQiww0g6Y?A|KvT9jv^4mN5cQz+%M{ZiSwd(E)0N^Kedn+?M$6T#E!`K-d^in0?YLdSNQYtRX7D{Aqq<+GTc)e&on#c?Pv_HbN!H~+s<~;1>qVJsjiU`#WE+Qs&Oa! ziP-Vvg-^??SeqhFevu0@QU1VVWK9LqPw9M@_-9px;#_W1QJ#riOM%z&PWbH-jVIR| zsBavASijJ?-Km6~u=I`$$_R3CBU9(>V712Q@?gYe)R!`ImPdp~SVwV5USc;jRNgdj z{C2=dqv*%ZXQ>#(OlTbBY06aJ-+6l42mdbAHC?(Tj_}18q!G|^djH6FKQ~3ZmFh{%66SZ%!kMY%Xy18y0ybr$n^y{{riKf z0amKCH;OazLfU6XiO&WsNN}H-w7r1(AGRpe!oPw7u)Aya3BuI@0E7sboSc@joZLU^ zE1s$i@}&YRHBn=` z{?ucv`7iuFGDJeYA0S_zu-ffoYU+<`@;(OF@Suc1MrYn0dcp~w)%Vdt(Kdn{xmS{| z8R-lWzjC}+3a|*J+{`?G$HS+_}VG%hPM17T-Z z12%#A4(1>*cU{f9b`3b0D?4on18AtcFbgFO|z7^$m?LYy5r!B)iTNvL455YB35)#l9=M& zqE7&hPDX=%TLvPk1Nz-&uI# zgUcK2!o|bM&E@FG^{*OmcX`hzkiR?hf7O8NJ=G0y=|JJm9&Qk*yeHJjo&H}TtRVl? zckys@_$wSM2p7}=>i8rIf3nK+ZzdI$)wTYq@rME%n4`;IT2EyEo1{C;`hUp!H{bsB z{1wi>I`X9cPuzc#{zvS82|r1xtBZo1As&C+QwB-U{jo1<TZwS+@_>1)MJxq{gao<&1xnco?hbZ>K>t8Jfpfy1aKPNWykKD= zZVpQ!VV)-(-X{oNYd#JUOJT4Ozkq;{2%q)8Kxn$bp0X0`@ULF|fwFpnvgWY{3-Ivp za_~U;ML77at%aYwfjr?^Tk{J)!9aPTJbyu1K|~dt-5kMB!wGW)+d#QooNWH;_(Qm; zjFz$l9WUqK9RI6D%K_|e{iN_T2VhQC&R+2U5!Qn_LUrB2fB57P6yWC*5E2x8a)DQn zU-*B744`iCr(FDl%EQgc_c!D}10(tr&J(rZKbiUj@R!C@G@^2DP_VnRo1U|?g9P0l z7l3~>|4MM6_}_*_2?l?X@cEPTf6sbdsO#UZ{x%65V1IQ1fqx~gC>ZiLBXF=M)aoxo zPkMjrg4lwcY@kmw{O>9Ck9OGqWw`htBK!~mAuA4RVJMh`pVx|)Ll^>iN&tRqsGuOP zm6ee2|Ar2Cws!XdyFq1ao+5pU<|&2#iU!E?cQRl6yEk68&_7H)r3DAKAO|YH z|I>?yj_dEia{Zap|A;K^6>HGRg;9nMjC%wP5JuNOzYZcc&7puSX^@qa$kB`5P z!~aJMPtgB0@*na0U%LKF*MG#oe;D;DnE$igfjT|i0eL-b zW&jZ2(;f+cYN@IS0zCeC7Ic-RKDA)DD7}O~ZD-g290=uP0Gy{rGlCUnt*w$7J~4V5U<@w(kRziElHwX>YF9KZ1?MzX>?@VfFR>~21R`Wx#UG3IWTqH~(3KSyV_ zN^R^VeY_B*kYRMDxf*xinn$5m(zEk&Aud1Wtb||gd zVwufZ`6O1Re{skKY-20;p%zz-t8|&;5AZePo==iMaScPu`!!Nr{)cdS$iWMSQ4iz8W!}C{g#*?7mX? zGE5{b^rCsue=zo|8j02> zM8phvDo#}iR(UH`duM!QKi6DS=d|{C{ha_|vFS=pA$R6#{|NQ*Mk_o9xtKWzuB3-Z z-rt-C2uWf$==8VG&JGw9q7gqKBT1@>TJvi1LY1nlzMe>6G40PlM_`nleMS)Rdcl5a zpI`77S2ahVkm|D}8$2_YCVo$vy6P)y7u--D;*eM#Z@e9AN59gAW!;vNooad};4-d% zhSsqISB0CeO}qd)03V$y&HOs7!u~s{Ab-;tm!$t1$+IEVLDv4f+O;!5{vXv8Vxm9F z-f|;%ohlhwTc(dZ-j_0+Ep;hM5~86@f1S--IKrUBjZAk%L`Wjr+NmPMW-D5z@U9=5 z$ra;Hs<;g=eKS72G{8wuOJ+zL-fzl5fT-7gH&8l1u493Ag0^$$JaM1bSYf~E9oDw} zOyE`rQLppvwcxjm&P{4ynWV$y+!GyrynFy6WDwLGL!LOSu|8m|0 zHQ&IOZ~*O52=@TSuK&-H*dsbXLAF=^g1=`Mv~-!Y!LlzrIJk1&?g-sjvU5rtGSUlw zUOATng6A}eQ-U*;$Tb`y>9Lu@+DwyoLCHMUsUp-dLdtR-Z(VV74dPsNaYG0*unCD7 zZ&czzz!tGn!t-yXvMeg@ z&Ztnjy?KlYufAp`^UD$QCKxYfX4<0zz97h-^V3B4SEnK3B>*a%6Yt3GJ z!V0*9&!^(e$9b$=u$#_TlV+JV6xPv}_$;i*(o0Q}ZBSiHz%DCOT}Wq#Oy+@@Cc!AJI=GP*bns>2QyH6y)~r|?8R1m^ld*`s2?wK<8%DAx8-j8eQJa_B`4Uf z1}CV~G|__PW_HGw`x6~j+uUBnXa=is2tM&nDdjV%wu6q1pWhX-mi-uc!v%;35O9aE zrVC?eF@6Ui`1_ZTpR|@;Xj3pUVrNF_H^f5REKT3lH(!U^wjKraTI?8CMU9dTS5+=^ zx^?Qr$Y{Q!%&CZnBUUN`7lOHUF2=*@LU`G1Fh{97QDbNWg2>DSx%G4}#l!ejy`h*K=)4 zn@66|I7i?(UsFsXF#5a2LT$_=OZ+~l)_wf>W)PcBXlyz)%V8~Kn$aHslrH^bnwj!$ zy>J2ZvMo|1u?vCE7DZ%{x^=`_z+jb#@74X+hL2i;*>OQ%R0PtM>5>PrVhQQ-B!rT0@$~J>qKx|OSi>+>oH>S0 z8~uK$pvjVw`vBylVtf~qrhIXnaPo2y|3@gL-KS}@*QUDgl-M%$dWqC@>mzD`SNNy{ zyS-;I{HhZxhj@--Uo@5i-5-g5$gO>^ckq4hEu;A6lP5d8!NZ`Gev=&{E}Sw%fQ%?h z%yOOHiO9H8@XQaB*YT{Z#CU&aU&Hr!=oFfl@%*EaP>|EDKY365+x2qqhAq1hzN>am z6ixW(LQ9Jh16iD7rFUyG;p7z6K_dzpKb?Go{=y68t?sLHq)$ literal 0 HcmV?d00001 diff --git a/public/tvox/answer.controller.js b/public/tvox/answer.controller.js index 9aa5de5..177b62b 100644 --- a/public/tvox/answer.controller.js +++ b/public/tvox/answer.controller.js @@ -50,7 +50,6 @@ angular.module('AnswerApp', ['ngMaterial', 'ngCookies', 'motion', 'ngResource', $scope.dispo.mandatoryDisposition = false; $scope.dispo.mandatoryDispositionPause = ''; $scope.dispo.note = ''; - tvoxCallId = ""; @@ -100,7 +99,6 @@ angular.module('AnswerApp', ['ngMaterial', 'ngCookies', 'motion', 'ngResource', } } - this.$onInit = function() { var urlParams = new URLSearchParams(window.location.search); var params = urlParams.get("params"); @@ -306,7 +304,6 @@ angular.module('AnswerApp', ['ngMaterial', 'ngCookies', 'motion', 'ngResource', }). then( function ret(response) { - console.log("RMID", response.data.id); $scope.reportMemberId = response.data.id; } ); diff --git a/public/tvox/answer.html b/public/tvox/answer.html index 36fd6cd..f4edc0d 100644 --- a/public/tvox/answer.html +++ b/public/tvox/answer.html @@ -53,14 +53,14 @@
{{contactName}} - {{message.createdAt.substring(11,16)}} + {{ message.createdAt | date: 'medium'}}
- {{message.createdAt.substring(11,16)}} + {{ message.createdAt | date: 'medium' }}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 1cfb54d..e3dcfbd 100644 --- a/server/api/action/action.attributes.js +++ b/server/api/action/action.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5565=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','action','STRING','contactManager','integration','jscripty','urlForward','browser','script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x5a2073,_0x4357da){var _0x4501c8=function(_0x251124){while(--_0x251124){_0x5a2073['push'](_0x5a2073['shift']());}};_0x4501c8(++_0x4357da);}(_0x5565,0x104));var _0x5556=function(_0x25fb9d,_0x44d9da){_0x25fb9d=_0x25fb9d-0x0;var _0x6285d9=_0x5565[_0x25fb9d];return _0x6285d9;};'use strict';var Sequelize=require('sequelize');module[_0x5556('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x18fe7d){return this['getDataValue'](_0x5556('0x1'));}},'action':{'type':Sequelize[_0x5556('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5556('0x3'),_0x5556('0x4'),'motionbar',_0x5556('0x5'),_0x5556('0x6'),_0x5556('0x7'),'bot',_0x5556('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x5556('0x2')](0x1000),'comment':_0x5556('0x9')},'data2':{'type':Sequelize[_0x5556('0x2')](0x1000),'comment':_0x5556('0xa')},'data3':{'type':Sequelize[_0x5556('0x2')](0x1000),'comment':_0x5556('0xb')},'data4':{'type':Sequelize[_0x5556('0x2')](0x1000),'comments':_0x5556('0xc')},'data5':{'type':Sequelize[_0x5556('0x2')](0x1000),'comments':_0x5556('0xd')},'data6':{'type':Sequelize[_0x5556('0x2')],'comments':_0x5556('0xe')},'data7':{'type':Sequelize[_0x5556('0xf')],'comments':_0x5556('0x10')}}; \ No newline at end of file +var _0xbb29=['TEXT','sequelize','getDataValue','STRING','contactManager','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x1b63e0,_0x40a5bc){var _0x5a4c6f=function(_0x5d223c){while(--_0x5d223c){_0x1b63e0['push'](_0x1b63e0['shift']());}};_0x5a4c6f(++_0x40a5bc);}(_0xbb29,0x15a));var _0x9bb2=function(_0x2736e8,_0x18423b){_0x2736e8=_0x2736e8-0x0;var _0x57d914=_0xbb29[_0x2736e8];return _0x57d914;};'use strict';var Sequelize=require(_0x9bb2('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x128638){return this[_0x9bb2('0x1')]('action');}},'action':{'type':Sequelize[_0x9bb2('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9bb2('0x3'),'integration','motionbar',_0x9bb2('0x4'),_0x9bb2('0x5'),_0x9bb2('0x6'),_0x9bb2('0x7'),_0x9bb2('0x8')]],'msg':_0x9bb2('0x9')}},'comment':_0x9bb2('0x9')},'data1':{'type':Sequelize[_0x9bb2('0x2')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x9bb2('0xa')},'data3':{'type':Sequelize[_0x9bb2('0x2')](0x1000),'comment':_0x9bb2('0xb')},'data4':{'type':Sequelize[_0x9bb2('0x2')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x9bb2('0xc')},'data6':{'type':Sequelize['STRING'],'comments':_0x9bb2('0xd')},'data7':{'type':Sequelize[_0x9bb2('0xe')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index ad0f9c8..ca7674b 100644 --- a/server/api/action/action.controller.js +++ b/server/api/action/action.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3f0=['catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','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','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','name','body','find','Action','params'];(function(_0x3d456f,_0x312ccb){var _0x3c61b9=function(_0x372dd9){while(--_0x372dd9){_0x3d456f['push'](_0x3d456f['shift']());}};_0x3c61b9(++_0x312ccb);}(_0xf3f0,0x196));var _0x0f3f=function(_0xecbca5,_0x4b2350){_0xecbca5=_0xecbca5-0x0;var _0x53f17a=_0xf3f0[_0xecbca5];return _0x53f17a;};'use strict';var emlformat=require(_0x0f3f('0x0'));var rimraf=require(_0x0f3f('0x1'));var zipdir=require(_0x0f3f('0x2'));var jsonpatch=require(_0x0f3f('0x3'));var rp=require(_0x0f3f('0x4'));var moment=require('moment');var BPromise=require(_0x0f3f('0x5'));var Mustache=require(_0x0f3f('0x6'));var util=require(_0x0f3f('0x7'));var path=require(_0x0f3f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f3f('0x9'));var _=require(_0x0f3f('0xa'));var squel=require(_0x0f3f('0xb'));var crypto=require(_0x0f3f('0xc'));var jsforce=require(_0x0f3f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0f3f('0xe'));var Redis=require(_0x0f3f('0xf'));var authService=require(_0x0f3f('0x10'));var qs=require(_0x0f3f('0x11'));var as=require(_0x0f3f('0x12'));var hardwareService=require(_0x0f3f('0x13'));var logger=require(_0x0f3f('0x14'))(_0x0f3f('0x15'));var utils=require(_0x0f3f('0x16'));var config=require(_0x0f3f('0x17'));var licenseUtil=require(_0x0f3f('0x18'));var db=require(_0x0f3f('0x19'))['db'];function respondWithStatusCode(_0xa5383b,_0x266198){_0x266198=_0x266198||0xcc;return function(_0xee3266){if(_0xee3266){return _0xa5383b['sendStatus'](_0x266198);}return _0xa5383b[_0x0f3f('0x1a')](_0x266198)[_0x0f3f('0x1b')]();};}function respondWithResult(_0x2afb7a,_0x45511a){_0x45511a=_0x45511a||0xc8;return function(_0x470947){if(_0x470947){return _0x2afb7a[_0x0f3f('0x1a')](_0x45511a)[_0x0f3f('0x1c')](_0x470947);}};}function respondWithFilteredResult(_0x1042e8,_0x2ee633){return function(_0x579217){if(_0x579217){var _0x5194ed=typeof _0x2ee633[_0x0f3f('0x1d')]==='undefined'&&typeof _0x2ee633[_0x0f3f('0x1e')]===_0x0f3f('0x1f');var _0x590ffd=_0x579217[_0x0f3f('0x20')];var _0x30bb72=_0x5194ed?0x0:_0x2ee633[_0x0f3f('0x1d')];var _0x492608=_0x5194ed?_0x579217['count']:_0x2ee633[_0x0f3f('0x1d')]+_0x2ee633['limit'];var _0x32b503;if(_0x492608>=_0x590ffd){_0x492608=_0x590ffd;_0x32b503=0xc8;}else{_0x32b503=0xce;}_0x1042e8['status'](_0x32b503);return _0x1042e8['set'](_0x0f3f('0x21'),_0x30bb72+'-'+_0x492608+'/'+_0x590ffd)[_0x0f3f('0x1c')](_0x579217);}return null;};}function patchUpdates(_0x3fd0b3){return function(_0x55b095){try{jsonpatch['apply'](_0x55b095,_0x3fd0b3,!![]);}catch(_0x12c510){return BPromise[_0x0f3f('0x22')](_0x12c510);}return _0x55b095[_0x0f3f('0x23')]();};}function saveUpdates(_0x3a9b09,_0x2e52c6){return function(_0x377e3a){if(_0x377e3a){return _0x377e3a[_0x0f3f('0x24')](_0x3a9b09)[_0x0f3f('0x25')](function(_0x3e47be){return _0x3e47be;});}return null;};}function removeEntity(_0x405142,_0x12ad0a){return function(_0x3d2dc9){if(_0x3d2dc9){return _0x3d2dc9[_0x0f3f('0x26')]()[_0x0f3f('0x25')](function(){_0x405142[_0x0f3f('0x1a')](0xcc)[_0x0f3f('0x1b')]();});}};}function handleEntityNotFound(_0x141c90,_0xaae705){return function(_0x2ff504){if(!_0x2ff504){_0x141c90['sendStatus'](0x194);}return _0x2ff504;};}function handleError(_0x173517,_0x3aa9b4){_0x3aa9b4=_0x3aa9b4||0x1f4;return function(_0x25a4ec){logger['error'](_0x25a4ec['stack']);if(_0x25a4ec['name']){delete _0x25a4ec[_0x0f3f('0x27')];}_0x173517[_0x0f3f('0x1a')](_0x3aa9b4)['send'](_0x25a4ec);};}exports['update']=function(_0x21d26e,_0x16348b){if(_0x21d26e[_0x0f3f('0x28')]['id']){delete _0x21d26e[_0x0f3f('0x28')]['id'];}return db['Action'][_0x0f3f('0x29')]({'where':{'id':_0x21d26e['params']['id']}})[_0x0f3f('0x25')](handleEntityNotFound(_0x16348b,null))[_0x0f3f('0x25')](saveUpdates(_0x21d26e['body'],null))[_0x0f3f('0x25')](respondWithResult(_0x16348b,null))['catch'](handleError(_0x16348b,null));};exports[_0x0f3f('0x26')]=function(_0x190e0f,_0x41e760){return db[_0x0f3f('0x2a')][_0x0f3f('0x29')]({'where':{'id':_0x190e0f[_0x0f3f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x41e760,null))[_0x0f3f('0x25')](removeEntity(_0x41e760,null))[_0x0f3f('0x2c')](handleError(_0x41e760,null));}; \ No newline at end of file +var _0x9a12=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','sendStatus','stack','name','send','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x21e79a,_0x5a7990){var _0x506c02=function(_0x566c95){while(--_0x566c95){_0x21e79a['push'](_0x21e79a['shift']());}};_0x506c02(++_0x5a7990);}(_0x9a12,0x10b));var _0x29a1=function(_0x1c9120,_0x4e2335){_0x1c9120=_0x1c9120-0x0;var _0x279a6b=_0x9a12[_0x1c9120];return _0x279a6b;};'use strict';var emlformat=require(_0x29a1('0x0'));var rimraf=require(_0x29a1('0x1'));var zipdir=require(_0x29a1('0x2'));var jsonpatch=require(_0x29a1('0x3'));var rp=require(_0x29a1('0x4'));var moment=require('moment');var BPromise=require(_0x29a1('0x5'));var Mustache=require(_0x29a1('0x6'));var util=require(_0x29a1('0x7'));var path=require(_0x29a1('0x8'));var sox=require(_0x29a1('0x9'));var csv=require(_0x29a1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29a1('0xb'));var _=require(_0x29a1('0xc'));var squel=require(_0x29a1('0xd'));var crypto=require(_0x29a1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x29a1('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x29a1('0x10'));var Redis=require(_0x29a1('0x11'));var authService=require(_0x29a1('0x12'));var qs=require(_0x29a1('0x13'));var as=require(_0x29a1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x29a1('0x15'));var utils=require('../../config/utils');var config=require(_0x29a1('0x16'));var licenseUtil=require(_0x29a1('0x17'));var db=require(_0x29a1('0x18'))['db'];function respondWithStatusCode(_0x4c8a40,_0x4ed60b){_0x4ed60b=_0x4ed60b||0xcc;return function(_0xa5e51e){if(_0xa5e51e){return _0x4c8a40['sendStatus'](_0x4ed60b);}return _0x4c8a40[_0x29a1('0x19')](_0x4ed60b)[_0x29a1('0x1a')]();};}function respondWithResult(_0x4b20f1,_0x4045bf){_0x4045bf=_0x4045bf||0xc8;return function(_0x55c8a2){if(_0x55c8a2){return _0x4b20f1[_0x29a1('0x19')](_0x4045bf)[_0x29a1('0x1b')](_0x55c8a2);}};}function respondWithFilteredResult(_0x122166,_0x275ff7){return function(_0x2e756a){if(_0x2e756a){var _0x4f2c15=typeof _0x275ff7[_0x29a1('0x1c')]==='undefined'&&typeof _0x275ff7[_0x29a1('0x1d')]===_0x29a1('0x1e');var _0x16cd93=_0x2e756a['count'];var _0x41644f=_0x4f2c15?0x0:_0x275ff7[_0x29a1('0x1c')];var _0x4a1031=_0x4f2c15?_0x2e756a[_0x29a1('0x1f')]:_0x275ff7['offset']+_0x275ff7[_0x29a1('0x1d')];var _0x2a3ab3;if(_0x4a1031>=_0x16cd93){_0x4a1031=_0x16cd93;_0x2a3ab3=0xc8;}else{_0x2a3ab3=0xce;}_0x122166[_0x29a1('0x19')](_0x2a3ab3);return _0x122166[_0x29a1('0x20')]('Content-Range',_0x41644f+'-'+_0x4a1031+'/'+_0x16cd93)[_0x29a1('0x1b')](_0x2e756a);}return null;};}function patchUpdates(_0x9204a8){return function(_0x579dee){try{jsonpatch[_0x29a1('0x21')](_0x579dee,_0x9204a8,!![]);}catch(_0x306550){return BPromise[_0x29a1('0x22')](_0x306550);}return _0x579dee['save']();};}function saveUpdates(_0x24434e,_0x500c15){return function(_0x9f9cad){if(_0x9f9cad){return _0x9f9cad[_0x29a1('0x23')](_0x24434e)['then'](function(_0x36f1fb){return _0x36f1fb;});}return null;};}function removeEntity(_0xc7e4bf,_0x481688){return function(_0x34efbb){if(_0x34efbb){return _0x34efbb[_0x29a1('0x24')]()[_0x29a1('0x25')](function(){_0xc7e4bf[_0x29a1('0x19')](0xcc)[_0x29a1('0x1a')]();});}};}function handleEntityNotFound(_0x3bef7d,_0x38aeaa){return function(_0x35d40){if(!_0x35d40){_0x3bef7d[_0x29a1('0x26')](0x194);}return _0x35d40;};}function handleError(_0x5d5b75,_0xbd09a0){_0xbd09a0=_0xbd09a0||0x1f4;return function(_0x2a680c){logger['error'](_0x2a680c[_0x29a1('0x27')]);if(_0x2a680c[_0x29a1('0x28')]){delete _0x2a680c['name'];}_0x5d5b75[_0x29a1('0x19')](_0xbd09a0)[_0x29a1('0x29')](_0x2a680c);};}exports[_0x29a1('0x23')]=function(_0x19511b,_0x1c75b5){if(_0x19511b[_0x29a1('0x2a')]['id']){delete _0x19511b[_0x29a1('0x2a')]['id'];}return db[_0x29a1('0x2b')][_0x29a1('0x2c')]({'where':{'id':_0x19511b['params']['id']}})[_0x29a1('0x25')](handleEntityNotFound(_0x1c75b5,null))[_0x29a1('0x25')](saveUpdates(_0x19511b[_0x29a1('0x2a')],null))[_0x29a1('0x25')](respondWithResult(_0x1c75b5,null))[_0x29a1('0x2d')](handleError(_0x1c75b5,null));};exports['destroy']=function(_0x3d985f,_0x254053){return db['Action'][_0x29a1('0x2c')]({'where':{'id':_0x3d985f[_0x29a1('0x2e')]['id']}})[_0x29a1('0x25')](handleEntityNotFound(_0x254053,null))[_0x29a1('0x25')](removeEntity(_0x254053,null))[_0x29a1('0x2d')](handleError(_0x254053,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 8d71aa1..96325aa 100644 --- a/server/api/action/action.model.js +++ b/server/api/action/action.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0aae=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x34c936,_0x247e79){var _0x35d89a=function(_0x400af2){while(--_0x400af2){_0x34c936['push'](_0x34c936['shift']());}};_0x35d89a(++_0x247e79);}(_0x0aae,0x1dd));var _0xe0aa=function(_0x3a564d,_0x437f5d){_0x3a564d=_0x3a564d-0x0;var _0x8a2d52=_0x0aae[_0x3a564d];return _0x8a2d52;};'use strict';var _=require(_0xe0aa('0x0'));var util=require(_0xe0aa('0x1'));var logger=require(_0xe0aa('0x2'))(_0xe0aa('0x3'));var moment=require(_0xe0aa('0x4'));var BPromise=require(_0xe0aa('0x5'));var rp=require(_0xe0aa('0x6'));var fs=require('fs');var path=require(_0xe0aa('0x7'));var rimraf=require(_0xe0aa('0x8'));var config=require(_0xe0aa('0x9'));var attributes=require(_0xe0aa('0xa'));module[_0xe0aa('0xb')]=function(_0xb2c531,_0x51f365){return _0xb2c531[_0xe0aa('0xc')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ced=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','tools_actions','lodash'];(function(_0x6d27cc,_0x26721c){var _0x3471dc=function(_0x33f283){while(--_0x33f283){_0x6d27cc['push'](_0x6d27cc['shift']());}};_0x3471dc(++_0x26721c);}(_0x6ced,0x6d));var _0xd6ce=function(_0x46b1ea,_0x2084cf){_0x46b1ea=_0x46b1ea-0x0;var _0x4b31c1=_0x6ced[_0x46b1ea];return _0x4b31c1;};'use strict';var _=require(_0xd6ce('0x0'));var util=require(_0xd6ce('0x1'));var logger=require('../../config/logger')(_0xd6ce('0x2'));var moment=require(_0xd6ce('0x3'));var BPromise=require(_0xd6ce('0x4'));var rp=require(_0xd6ce('0x5'));var fs=require('fs');var path=require(_0xd6ce('0x6'));var rimraf=require(_0xd6ce('0x7'));var config=require(_0xd6ce('0x8'));var attributes=require('./action.attributes');module['exports']=function(_0x45d4e2,_0x200187){return _0x45d4e2[_0xd6ce('0x9')]('Action',attributes,{'tableName':_0xd6ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index c1e4fbe..ed3163d 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x1cb9,0x14e));var _0x91cb=function(_0x35a50a,_0x4923c1){_0x35a50a=_0x35a50a-0x0;var _0x2cd089=_0x1cb9[_0x35a50a];return _0x2cd089;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x7fbe=['request','then','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/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x350d22,_0x298c1f){var _0x5200f1=function(_0x15edc5){while(--_0x15edc5){_0x350d22['push'](_0x350d22['shift']());}};_0x5200f1(++_0x298c1f);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x141a2f,_0x58d944){_0x141a2f=_0x141a2f-0x0;var _0x1e84d3=_0x7fbe[_0x141a2f];return _0x1e84d3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 72c4ab5..0adfc5f 100644 --- a/server/api/action/index.js +++ b/server/api/action/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0021=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','delete','/:id','destroy','exports','util'];(function(_0xb6c9a1,_0x2143b3){var _0x3e1df2=function(_0x45f7a6){while(--_0x45f7a6){_0xb6c9a1['push'](_0xb6c9a1['shift']());}};_0x3e1df2(++_0x2143b3);}(_0x0021,0xfe));var _0x1002=function(_0x318dda,_0x1aa800){_0x318dda=_0x318dda-0x0;var _0x3f97ca=_0x0021[_0x318dda];return _0x3f97ca;};'use strict';var multer=require('multer');var util=require(_0x1002('0x0'));var path=require(_0x1002('0x1'));var timeout=require(_0x1002('0x2'));var express=require(_0x1002('0x3'));var router=express[_0x1002('0x4')]();var fs_extra=require(_0x1002('0x5'));var auth=require(_0x1002('0x6'));var interaction=require(_0x1002('0x7'));var config=require(_0x1002('0x8'));var controller=require('./action.controller');router[_0x1002('0x9')]('/:id',auth[_0x1002('0xa')](),controller['update']);router[_0x1002('0xb')](_0x1002('0xc'),auth[_0x1002('0xa')](),controller[_0x1002('0xd')]);module[_0x1002('0xe')]=router; \ No newline at end of file +var _0x8987=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update'];(function(_0x57dcca,_0x8f782e){var _0x1798b2=function(_0x22394c){while(--_0x22394c){_0x57dcca['push'](_0x57dcca['shift']());}};_0x1798b2(++_0x8f782e);}(_0x8987,0x15c));var _0x7898=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0x8987[_0x124f88];return _0xed0e3b;};'use strict';var multer=require('multer');var util=require(_0x7898('0x0'));var path=require(_0x7898('0x1'));var timeout=require('connect-timeout');var express=require(_0x7898('0x2'));var router=express[_0x7898('0x3')]();var fs_extra=require(_0x7898('0x4'));var auth=require(_0x7898('0x5'));var interaction=require(_0x7898('0x6'));var config=require(_0x7898('0x7'));var controller=require(_0x7898('0x8'));router[_0x7898('0x9')]('/:id',auth[_0x7898('0xa')](),controller[_0x7898('0xb')]);router[_0x7898('0xc')](_0x7898('0xd'),auth[_0x7898('0xa')](),controller['destroy']);module[_0x7898('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index cb82fd1..cf90717 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1a632c,_0x5ccdbd){_0x1a632c=_0x1a632c-0x0;var _0x2c69a0=_0xdc97[_0x1a632c];return _0x2c69a0;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file +var _0xafc4=['sequelize','STRING','TEXT'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xafc4,0x69));var _0x4afc=function(_0x4f4afb,_0x3d31d3){_0x4f4afb=_0x4f4afb-0x0;var _0x467286=_0xafc4[_0x4f4afb];return _0x467286;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index e3dca92..2c3eb6b 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.controller.js +++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc36=['IS\x20NULL','IS\x20NOT\x20EMPTY','replace','DESC','clone','output','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','from','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','includeAll','catch','params','include','create','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','MetricId','metric','field','function','format','groupBy','orderBy','alias','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','join','COUNT(%s)'];(function(_0x25aacd,_0x54f905){var _0x5bc430=function(_0x51fe00){while(--_0x51fe00){_0x25aacd['push'](_0x25aacd['shift']());}};_0x5bc430(++_0x54f905);}(_0xbc36,0x169));var _0x6bc3=function(_0x514853,_0x36564c){_0x514853=_0x514853-0x0;var _0x3f2354=_0xbc36[_0x514853];return _0x3f2354;};'use strict';var emlformat=require(_0x6bc3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6bc3('0x1'));var jsonpatch=require(_0x6bc3('0x2'));var rp=require(_0x6bc3('0x3'));var moment=require(_0x6bc3('0x4'));var BPromise=require(_0x6bc3('0x5'));var Mustache=require(_0x6bc3('0x6'));var util=require(_0x6bc3('0x7'));var path=require(_0x6bc3('0x8'));var sox=require(_0x6bc3('0x9'));var csv=require('to-csv');var ejs=require(_0x6bc3('0xa'));var fs=require('fs');var fs_extra=require(_0x6bc3('0xb'));var _=require('lodash');var squel=require(_0x6bc3('0xc'));var crypto=require(_0x6bc3('0xd'));var jsforce=require(_0x6bc3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6bc3('0xf'));var querystring=require(_0x6bc3('0x10'));var Papa=require(_0x6bc3('0x11'));var Redis=require(_0x6bc3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6bc3('0x13'));var as=require(_0x6bc3('0x14'));var hardwareService=require(_0x6bc3('0x15'));var logger=require(_0x6bc3('0x16'))(_0x6bc3('0x17'));var utils=require(_0x6bc3('0x18'));var config=require(_0x6bc3('0x19'));var licenseUtil=require(_0x6bc3('0x1a'));var db=require(_0x6bc3('0x1b'))['db'];var dbH=require('../../mysqldb')[_0x6bc3('0x1c')];function respondWithStatusCode(_0x5803c0,_0x34a005){_0x34a005=_0x34a005||0xcc;return function(_0x589d36){if(_0x589d36){return _0x5803c0[_0x6bc3('0x1d')](_0x34a005);}return _0x5803c0[_0x6bc3('0x1e')](_0x34a005)['end']();};}function respondWithResult(_0x2869d2,_0x551b0a){_0x551b0a=_0x551b0a||0xc8;return function(_0x5872e1){if(_0x5872e1){return _0x2869d2[_0x6bc3('0x1e')](_0x551b0a)[_0x6bc3('0x1f')](_0x5872e1);}};}function respondWithFilteredResult(_0x3513d4,_0xf57a10){return function(_0x21b60c){if(_0x21b60c){var _0x1e1e58=typeof _0xf57a10[_0x6bc3('0x20')]==='undefined'&&typeof _0xf57a10[_0x6bc3('0x21')]===_0x6bc3('0x22');var _0x4c1894=_0x21b60c[_0x6bc3('0x23')];var _0x1d27db=_0x1e1e58?0x0:_0xf57a10[_0x6bc3('0x20')];var _0x2ad222=_0x1e1e58?_0x21b60c[_0x6bc3('0x23')]:_0xf57a10[_0x6bc3('0x20')]+_0xf57a10[_0x6bc3('0x21')];var _0x3f6bf9;if(_0x2ad222>=_0x4c1894){_0x2ad222=_0x4c1894;_0x3f6bf9=0xc8;}else{_0x3f6bf9=0xce;}_0x3513d4[_0x6bc3('0x1e')](_0x3f6bf9);return _0x3513d4[_0x6bc3('0x24')](_0x6bc3('0x25'),_0x1d27db+'-'+_0x2ad222+'/'+_0x4c1894)[_0x6bc3('0x1f')](_0x21b60c);}return null;};}function patchUpdates(_0x581f99){return function(_0x22652a){try{jsonpatch[_0x6bc3('0x26')](_0x22652a,_0x581f99,!![]);}catch(_0x4ce6bb){return BPromise[_0x6bc3('0x27')](_0x4ce6bb);}return _0x22652a['save']();};}function saveUpdates(_0x4210f3,_0x42acc1){return function(_0x344d2b){if(_0x344d2b){return _0x344d2b[_0x6bc3('0x28')](_0x4210f3)[_0x6bc3('0x29')](function(_0x453ada){return _0x453ada;});}return null;};}function removeEntity(_0xc2df4,_0x179fd9){return function(_0x2cf208){if(_0x2cf208){return _0x2cf208[_0x6bc3('0x2a')]()[_0x6bc3('0x29')](function(){var _0x1e9a9c=_0x2cf208[_0x6bc3('0x2b')]({'plain':!![]});var _0x4bade2=_0x6bc3('0x2c');return db[_0x6bc3('0x2d')][_0x6bc3('0x2a')]({'where':{'type':_0x4bade2,'resourceId':_0x1e9a9c['id']}})[_0x6bc3('0x29')](function(){return _0x2cf208;});})[_0x6bc3('0x29')](function(){_0xc2df4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e6365,_0x58af17){return function(_0x2a476f){if(!_0x2a476f){_0x3e6365[_0x6bc3('0x1d')](0x194);}return _0x2a476f;};}function handleError(_0x3dca98,_0x429d17){_0x429d17=_0x429d17||0x1f4;return function(_0x55c6aa){logger[_0x6bc3('0x2e')](_0x55c6aa[_0x6bc3('0x2f')]);if(_0x55c6aa[_0x6bc3('0x30')]){delete _0x55c6aa[_0x6bc3('0x30')];}_0x3dca98[_0x6bc3('0x1e')](_0x429d17)['send'](_0x55c6aa);};}exports[_0x6bc3('0x31')]=function(_0xe5c34b,_0x18cf51){var _0x2815d9={},_0x956c55={},_0x4fe4c9={'count':0x0,'rows':[]};var _0x1bdc12=_[_0x6bc3('0x32')](db[_0x6bc3('0x33')][_0x6bc3('0x34')],function(_0x37aa10){return{'name':_0x37aa10[_0x6bc3('0x35')],'type':_0x37aa10[_0x6bc3('0x36')][_0x6bc3('0x37')]};});_0x956c55['model']=_[_0x6bc3('0x32')](_0x1bdc12,'name');_0x956c55['query']=_[_0x6bc3('0x38')](_0xe5c34b[_0x6bc3('0x39')]);_0x956c55['filters']=_[_0x6bc3('0x3a')](_0x956c55[_0x6bc3('0x3b')],_0x956c55[_0x6bc3('0x39')]);_0x2815d9[_0x6bc3('0x3c')]=_[_0x6bc3('0x3a')](_0x956c55[_0x6bc3('0x3b')],qs[_0x6bc3('0x3d')](_0xe5c34b[_0x6bc3('0x39')][_0x6bc3('0x3d')]));_0x2815d9[_0x6bc3('0x3c')]=_0x2815d9[_0x6bc3('0x3c')][_0x6bc3('0x3e')]?_0x2815d9[_0x6bc3('0x3c')]:_0x956c55[_0x6bc3('0x3b')];if(!_0xe5c34b['query'][_0x6bc3('0x3f')](_0x6bc3('0x40'))){_0x2815d9['limit']=qs[_0x6bc3('0x21')](_0xe5c34b['query'][_0x6bc3('0x21')]);_0x2815d9[_0x6bc3('0x20')]=qs[_0x6bc3('0x20')](_0xe5c34b[_0x6bc3('0x39')][_0x6bc3('0x20')]);}_0x2815d9[_0x6bc3('0x41')]=qs[_0x6bc3('0x42')](_0xe5c34b[_0x6bc3('0x39')][_0x6bc3('0x42')]);_0x2815d9[_0x6bc3('0x43')]=qs[_0x6bc3('0x44')](_['pick'](_0xe5c34b[_0x6bc3('0x39')],_0x956c55[_0x6bc3('0x44')]),_0x1bdc12);if(_0xe5c34b['query']['filter']){_0x2815d9[_0x6bc3('0x43')]=_[_0x6bc3('0x45')](_0x2815d9[_0x6bc3('0x43')],{'$or':_['map'](_0x1bdc12,function(_0x346390){if(_0x346390[_0x6bc3('0x36')]!=='VIRTUAL'){var _0xeea324={};_0xeea324[_0x346390['name']]={'$like':'%'+_0xe5c34b['query'][_0x6bc3('0x46')]+'%'};return _0xeea324;}})});}_0x2815d9=_[_0x6bc3('0x45')]({},_0x2815d9,_0xe5c34b[_0x6bc3('0x47')]);var _0x4caeb4={'where':_0x2815d9[_0x6bc3('0x43')]};return db['AnalyticCustomReport'][_0x6bc3('0x23')](_0x4caeb4)[_0x6bc3('0x29')](function(_0xd5c534){_0x4fe4c9[_0x6bc3('0x23')]=_0xd5c534;if(_0xe5c34b[_0x6bc3('0x39')][_0x6bc3('0x48')]){_0x2815d9['include']=[{'all':!![]}];}return db[_0x6bc3('0x33')]['findAll'](_0x2815d9);})[_0x6bc3('0x29')](function(_0x12e793){_0x4fe4c9['rows']=_0x12e793;return _0x4fe4c9;})[_0x6bc3('0x29')](respondWithFilteredResult(_0x18cf51,_0x2815d9))[_0x6bc3('0x49')](handleError(_0x18cf51,null));};exports['show']=function(_0x1b64a7,_0x347623){var _0x4015ad={'raw':![],'where':{'id':_0x1b64a7[_0x6bc3('0x4a')]['id']}},_0x110394={};_0x110394[_0x6bc3('0x3b')]=_['keys'](db['AnalyticCustomReport']['rawAttributes']);_0x110394[_0x6bc3('0x39')]=_[_0x6bc3('0x38')](_0x1b64a7[_0x6bc3('0x39')]);_0x110394[_0x6bc3('0x44')]=_[_0x6bc3('0x3a')](_0x110394['model'],_0x110394[_0x6bc3('0x39')]);_0x4015ad[_0x6bc3('0x3c')]=_[_0x6bc3('0x3a')](_0x110394[_0x6bc3('0x3b')],qs['fields'](_0x1b64a7[_0x6bc3('0x39')][_0x6bc3('0x3d')]));_0x4015ad['attributes']=_0x4015ad[_0x6bc3('0x3c')][_0x6bc3('0x3e')]?_0x4015ad['attributes']:_0x110394[_0x6bc3('0x3b')];if(_0x1b64a7[_0x6bc3('0x39')]['includeAll']){_0x4015ad[_0x6bc3('0x4b')]=[{'all':!![]}];}_0x4015ad=_[_0x6bc3('0x45')]({},_0x4015ad,_0x1b64a7[_0x6bc3('0x47')]);return db[_0x6bc3('0x33')]['find'](_0x4015ad)[_0x6bc3('0x29')](handleEntityNotFound(_0x347623,null))[_0x6bc3('0x29')](respondWithResult(_0x347623,null))[_0x6bc3('0x49')](handleError(_0x347623,null));};exports[_0x6bc3('0x4c')]=function(_0x22ed29,_0x5d9bc0){return db[_0x6bc3('0x33')][_0x6bc3('0x4c')](_0x22ed29['body'],{})[_0x6bc3('0x29')](function(_0x14cc29){var _0x5e4833=_0x22ed29['user'][_0x6bc3('0x2b')]({'plain':!![]});if(!_0x5e4833)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e4833[_0x6bc3('0x4d')]==='user'){var _0x5c383a=_0x14cc29[_0x6bc3('0x2b')]({'plain':!![]});var _0x5ce1c6=_0x6bc3('0x4e');return db[_0x6bc3('0x4f')][_0x6bc3('0x50')]({'where':{'name':_0x5ce1c6,'userProfileId':_0x5e4833[_0x6bc3('0x51')]},'raw':!![]})[_0x6bc3('0x29')](function(_0x43569e){if(_0x43569e&&_0x43569e[_0x6bc3('0x52')]===0x0){return db[_0x6bc3('0x2d')][_0x6bc3('0x4c')]({'name':_0x5c383a['name'],'resourceId':_0x5c383a['id'],'type':_0x6bc3('0x2c'),'sectionId':_0x43569e['id']},{})[_0x6bc3('0x29')](function(){return _0x14cc29;});}else{return _0x14cc29;}})['catch'](function(_0xd2b20){logger[_0x6bc3('0x2e')](_0x6bc3('0x53'),_0xd2b20);throw _0xd2b20;});}return _0x14cc29;})['then'](respondWithResult(_0x5d9bc0,0xc9))['catch'](handleError(_0x5d9bc0,null));};exports['update']=function(_0x4cbee9,_0x241d32){if(_0x4cbee9['body']['id']){delete _0x4cbee9[_0x6bc3('0x54')]['id'];}return db[_0x6bc3('0x33')]['find']({'where':{'id':_0x4cbee9[_0x6bc3('0x4a')]['id']}})[_0x6bc3('0x29')](handleEntityNotFound(_0x241d32,null))[_0x6bc3('0x29')](saveUpdates(_0x4cbee9['body'],null))[_0x6bc3('0x29')](respondWithResult(_0x241d32,null))[_0x6bc3('0x49')](handleError(_0x241d32,null));};exports[_0x6bc3('0x2a')]=function(_0x177a63,_0x2321e0){return db[_0x6bc3('0x33')][_0x6bc3('0x50')]({'where':{'id':_0x177a63[_0x6bc3('0x4a')]['id']}})[_0x6bc3('0x29')](handleEntityNotFound(_0x2321e0,null))[_0x6bc3('0x29')](removeEntity(_0x2321e0,null))[_0x6bc3('0x49')](handleError(_0x2321e0,null));};exports['preview']=function(_0x3c3e8b,_0x1ab803){var _0x5816e3=0xa;var _0x50b544=['join',_0x6bc3('0x55'),_0x6bc3('0x56'),_0x6bc3('0x57')];var _0x5dc94d={'SUM':_0x6bc3('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6bc3('0x59'),'MAX':_0x6bc3('0x5a'),'MIN':_0x6bc3('0x5b'),'AVG':_0x6bc3('0x5c'),'GROUP_CONCAT':_0x6bc3('0x5d'),'GROUP_CONCAT ASC':_0x6bc3('0x5e'),'GROUP_CONCAT DESC':_0x6bc3('0x5f')};var _0x3b5a9b={'SEC_TO_TIME':_0x6bc3('0x60'),'DATE':_0x6bc3('0x61'),'HOUR':_0x6bc3('0x62'),'ROUND':_0x6bc3('0x63'),'UNIX_TIMESTAMP':_0x6bc3('0x64')};var _0x197d12=function(_0x42ef9e){return!_[_0x6bc3('0x65')](['IS\x20NULL',_0x6bc3('0x66'),_0x6bc3('0x67'),'IS\x20NOT\x20EMPTY'],_0x42ef9e);};var _0x58549e=function(_0x2d02d1){if(!_0x2d02d1||!_0x2d02d1[_0x6bc3('0x68')][_0x6bc3('0x3e')]){return'';}for(var _0x368074='(',_0x32c09b=0x0;_0x32c09b<_0x2d02d1[_0x6bc3('0x68')][_0x6bc3('0x3e')];_0x32c09b+=0x1){_0x32c09b>0x0&&(_0x368074+='\x20'+_0x2d02d1[_0x6bc3('0x69')]+'\x20');_0x368074+=_0x2d02d1[_0x6bc3('0x68')][_0x32c09b][_0x6bc3('0x6a')]?_0x58549e(_0x2d02d1[_0x6bc3('0x68')][_0x32c09b][_0x6bc3('0x6a')]):_0x2d02d1['rules'][_0x32c09b]['field']+'\x20'+_0x2d02d1[_0x6bc3('0x68')][_0x32c09b][_0x6bc3('0x6b')]+(_0x197d12(_0x2d02d1[_0x6bc3('0x68')][_0x32c09b][_0x6bc3('0x6b')])?'\x20'+_0x2d02d1[_0x6bc3('0x68')][_0x32c09b][_0x6bc3('0x6c')]:'');}return _0x368074+')';};var _0x41860c={'where':{'id':_0x3c3e8b[_0x6bc3('0x4a')]['id']}},_0x47898a,_0xc44469,_0x23ce3a,_0x40b27f,_0x1f2fd3;_0x41860c=_[_0x6bc3('0x45')]({},_0x41860c,_0x3c3e8b[_0x6bc3('0x47')]);return db['AnalyticCustomReport'][_0x6bc3('0x50')](_0x41860c)[_0x6bc3('0x29')](function(_0x3cfe45){if(_0x3cfe45){_0x47898a=_0x3cfe45;return _0x3cfe45[_0x6bc3('0x6d')]();}return null;})[_0x6bc3('0x29')](function(_0x57119f){if(_0x57119f){if(!_0x57119f['length']){throw new db[(_0x6bc3('0x6e'))][(_0x6bc3('0x6f'))](_0x6bc3('0x70'),0x193);}_0xc44469=_0x57119f;return db[_0x6bc3('0x71')][_0x6bc3('0x72')]({'raw':!![]});}return null;})[_0x6bc3('0x29')](function(_0x324624){if(_0x324624){_0x23ce3a=_[_0x6bc3('0x73')](_0x324624,'id');var _0x60312c;var _0x639646=squel[_0x6bc3('0x74')]();_0x639646['from'](_0x47898a['table']);for(var _0xac523=0x0;_0xac523<_0xc44469[_0x6bc3('0x3e')];_0xac523+=0x1){_0x60312c=_0xc44469[_0xac523][_0x6bc3('0x75')]?_0x23ce3a[_0xc44469[_0xac523][_0x6bc3('0x75')]][_0x6bc3('0x76')]:_0xc44469[_0xac523][_0x6bc3('0x77')];_0x60312c=_0xc44469[_0xac523][_0x6bc3('0x78')]?_['replace'](_0x5dc94d[_0xc44469[_0xac523][_0x6bc3('0x78')]],'%s',_0x60312c):_0x60312c;_0x60312c=_0xc44469[_0xac523]['format']?_['replace'](_0x3b5a9b[_0xc44469[_0xac523][_0x6bc3('0x79')]],'%s',_0x60312c):_0x60312c;if(_0xc44469[_0xac523][_0x6bc3('0x7a')]){_0x639646[_0x6bc3('0x6a')](_0x60312c);}_0xc44469[_0xac523][_0x6bc3('0x7b')]&&_0x639646[_0x6bc3('0x41')](_0x60312c,_0xc44469[_0xac523]['orderBy']==='DESC'?![]:!![]);_0x639646['field'](_0x60312c,_0xc44469[_0xac523][_0x6bc3('0x7c')]||_0x60312c);}if(_0x47898a[_0x6bc3('0x7d')]){_0x47898a[_0x6bc3('0x7d')]=JSON[_0x6bc3('0x7e')](_0x47898a['joins']);for(var _0x59d487=0x0;_0x59d487<_0x47898a[_0x6bc3('0x7d')][_0x6bc3('0x3e')];_0x59d487+=0x1){if(_0x47898a[_0x6bc3('0x7d')][_0x59d487][_0x6bc3('0x36')]&&_[_0x6bc3('0x65')](_0x50b544,_0x47898a[_0x6bc3('0x7d')][_0x59d487][_0x6bc3('0x36')])&&_0x47898a[_0x6bc3('0x7d')][_0x59d487]['parentKey']&&_0x47898a[_0x6bc3('0x7d')][_0x59d487]['foreignTable']&&_0x47898a[_0x6bc3('0x7d')][_0x59d487][_0x6bc3('0x7f')]){_0x639646[_0x47898a[_0x6bc3('0x7d')][_0x59d487][_0x6bc3('0x36')]](_0x47898a[_0x6bc3('0x7d')][_0x59d487][_0x6bc3('0x80')],null,util[_0x6bc3('0x79')](_0x6bc3('0x81'),_0x47898a[_0x6bc3('0x82')],_0x47898a['joins'][_0x59d487][_0x6bc3('0x83')],_0x47898a['joins'][_0x59d487][_0x6bc3('0x80')],_0x47898a['joins'][_0x59d487][_0x6bc3('0x7f')]));}}}if(_0x47898a[_0x6bc3('0x84')]){_0x47898a[_0x6bc3('0x84')]=JSON['parse'](_0x47898a[_0x6bc3('0x84')]);_0x639646['where'](_0x58549e(_0x47898a[_0x6bc3('0x84')][_0x6bc3('0x6a')]));}_0x1f2fd3=_0x639646['clone']();_0x639646['limit'](_0x5816e3);_0x639646[_0x6bc3('0x20')](0x0);logger[_0x6bc3('0x85')](_0x6bc3('0x86'),_0x639646[_0x6bc3('0x87')]());return dbH[_0x6bc3('0x88')]['query'](_0x639646[_0x6bc3('0x87')](),{'type':dbH[_0x6bc3('0x88')]['QueryTypes'][_0x6bc3('0x89')]});}})[_0x6bc3('0x29')](respondWithResult(_0x1ab803,null))[_0x6bc3('0x49')](handleError(_0x1ab803,null));};function runReport(_0x35abb0,_0x56df00,_0x2b7897){var _0x1404c5=_0x56df00[_0x6bc3('0x30')];var _0x1cba77=0xa;var _0x31fc23=[_0x6bc3('0x8a'),_0x6bc3('0x55'),_0x6bc3('0x56'),_0x6bc3('0x57')];var _0x520517={'SUM':'SUM(%s)','COUNT':_0x6bc3('0x8b'),'COUNT DISTINCT':_0x6bc3('0x59'),'MAX':'MAX(%s)','MIN':_0x6bc3('0x5b'),'AVG':_0x6bc3('0x5c'),'GROUP_CONCAT':_0x6bc3('0x5d'),'GROUP_CONCAT ASC':_0x6bc3('0x5e'),'GROUP_CONCAT DESC':_0x6bc3('0x5f')};var _0x126c01={'SEC_TO_TIME':_0x6bc3('0x60'),'DATE':_0x6bc3('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x6bc3('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ada8c=function(_0xd020b5){return!_['includes']([_0x6bc3('0x8c'),_0x6bc3('0x66'),_0x6bc3('0x67'),_0x6bc3('0x8d')],_0xd020b5);};var _0x3709bc=function(_0x42802e){if(!_0x42802e||!_0x42802e[_0x6bc3('0x68')][_0x6bc3('0x3e')]){return'';}for(var _0x172b7b='(',_0xa21d6f=0x0;_0xa21d6f<_0x42802e[_0x6bc3('0x68')]['length'];_0xa21d6f+=0x1){_0xa21d6f>0x0&&(_0x172b7b+='\x20'+_0x42802e['operator']+'\x20');_0x172b7b+=_0x42802e['rules'][_0xa21d6f]['group']?_0x3709bc(_0x42802e[_0x6bc3('0x68')][_0xa21d6f][_0x6bc3('0x6a')]):_0x42802e[_0x6bc3('0x68')][_0xa21d6f]['field']+'\x20'+_0x42802e['rules'][_0xa21d6f][_0x6bc3('0x6b')]+(_0x2ada8c(_0x42802e[_0x6bc3('0x68')][_0xa21d6f]['condition'])?'\x20'+_0x42802e[_0x6bc3('0x68')][_0xa21d6f][_0x6bc3('0x6c')]:'');}return _0x172b7b+')';};var _0x140238={'where':{'id':_0x35abb0['id']}},_0x1533e4,_0x2d7644,_0x3cbc24,_0x436e9f,_0x46d839;_0x140238=_['merge']({},_0x140238,_0x2b7897);return db[_0x6bc3('0x33')][_0x6bc3('0x50')](_0x140238)['then'](function(_0x57df17){if(_0x57df17){_0x1533e4=_0x57df17;return _0x57df17[_0x6bc3('0x6d')]();}return null;})[_0x6bc3('0x29')](function(_0x196b62){if(_0x196b62){if(!_0x196b62[_0x6bc3('0x3e')]){throw new db[(_0x6bc3('0x6e'))][(_0x6bc3('0x6f'))](_0x6bc3('0x70'),0x193);}_0x2d7644=_0x196b62;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x5c9817){if(_0x5c9817){_0x3cbc24=_['keyBy'](_0x5c9817,'id');var _0x1212ed;var _0x4843d8=squel[_0x6bc3('0x74')]();_0x4843d8['from'](_0x1533e4[_0x6bc3('0x82')]);for(var _0x309d36=0x0;_0x309d36<_0x2d7644[_0x6bc3('0x3e')];_0x309d36+=0x1){_0x1212ed=_0x2d7644[_0x309d36][_0x6bc3('0x75')]?_0x3cbc24[_0x2d7644[_0x309d36]['MetricId']][_0x6bc3('0x76')]:_0x2d7644[_0x309d36][_0x6bc3('0x77')];_0x1212ed=_0x2d7644[_0x309d36][_0x6bc3('0x78')]?_[_0x6bc3('0x8e')](_0x520517[_0x2d7644[_0x309d36]['function']],'%s',_0x1212ed):_0x1212ed;_0x1212ed=_0x2d7644[_0x309d36]['format']?_[_0x6bc3('0x8e')](_0x126c01[_0x2d7644[_0x309d36][_0x6bc3('0x79')]],'%s',_0x1212ed):_0x1212ed;if(_0x2d7644[_0x309d36][_0x6bc3('0x7a')]){_0x4843d8['group'](_0x1212ed);}_0x2d7644[_0x309d36][_0x6bc3('0x7b')]&&_0x4843d8['order'](_0x1212ed,_0x2d7644[_0x309d36][_0x6bc3('0x7b')]===_0x6bc3('0x8f')?![]:!![]);_0x4843d8[_0x6bc3('0x77')](_0x1212ed,_0x2d7644[_0x309d36][_0x6bc3('0x7c')]||_0x1212ed);}if(_0x1533e4[_0x6bc3('0x7d')]){_0x1533e4[_0x6bc3('0x7d')]=JSON[_0x6bc3('0x7e')](_0x1533e4[_0x6bc3('0x7d')]);for(var _0x2f6c65=0x0;_0x2f6c65<_0x1533e4['joins'][_0x6bc3('0x3e')];_0x2f6c65+=0x1){if(_0x1533e4[_0x6bc3('0x7d')][_0x2f6c65][_0x6bc3('0x36')]&&_['includes'](_0x31fc23,_0x1533e4[_0x6bc3('0x7d')][_0x2f6c65]['type'])&&_0x1533e4[_0x6bc3('0x7d')][_0x2f6c65][_0x6bc3('0x83')]&&_0x1533e4[_0x6bc3('0x7d')][_0x2f6c65]['foreignTable']&&_0x1533e4[_0x6bc3('0x7d')][_0x2f6c65][_0x6bc3('0x7f')]){_0x4843d8[_0x1533e4[_0x6bc3('0x7d')][_0x2f6c65][_0x6bc3('0x36')]](_0x1533e4[_0x6bc3('0x7d')][_0x2f6c65][_0x6bc3('0x80')],null,util[_0x6bc3('0x79')](_0x6bc3('0x81'),_0x1533e4[_0x6bc3('0x82')],_0x1533e4[_0x6bc3('0x7d')][_0x2f6c65][_0x6bc3('0x83')],_0x1533e4[_0x6bc3('0x7d')][_0x2f6c65][_0x6bc3('0x80')],_0x1533e4[_0x6bc3('0x7d')][_0x2f6c65][_0x6bc3('0x7f')]));}}}if(_0x1533e4['conditions']){_0x1533e4[_0x6bc3('0x84')]=JSON[_0x6bc3('0x7e')](_0x1533e4[_0x6bc3('0x84')]);_0x4843d8['where'](_0x3709bc(_0x1533e4[_0x6bc3('0x84')][_0x6bc3('0x6a')]));}_0x46d839=_0x4843d8[_0x6bc3('0x90')]();_0x4843d8[_0x6bc3('0x21')](_0x1cba77);_0x4843d8['offset'](0x0);return;}})[_0x6bc3('0x29')](function(){if(_0x56df00[_0x6bc3('0x91')]==='web'){return null;}var _0x127772=_[_0x6bc3('0x45')](_0x56df00,{'name':_0x56df00['fullPath']||_0x56df00[_0x6bc3('0x30')]||_0x1533e4[_0x6bc3('0x30')],'basename':_0x1404c5,'savename':util[_0x6bc3('0x79')](_0x6bc3('0x92'),_0x56df00['name']||_0x1533e4[_0x6bc3('0x30')],require(_0x6bc3('0x93'))[_0x6bc3('0x94')](0x4),_0x56df00[_0x6bc3('0x91')]||_0x6bc3('0x95')),'reportId':_0x1533e4['id'],'reportType':'custom'});return db[_0x6bc3('0x96')][_0x6bc3('0x4c')](_0x127772,{'raw':!![]});})[_0x6bc3('0x29')](function(_0x5b282b){if(_0x1533e4['table']===_0x6bc3('0x97')){_0x46d839['where'](_0x1533e4[_0x6bc3('0x82')]+_0x6bc3('0x98'),_0x56df00[_0x6bc3('0x99')],_0x56df00[_0x6bc3('0x9a')]);}else{_0x46d839['where'](_0x1533e4['table']+_0x6bc3('0x9b'),_0x56df00[_0x6bc3('0x99')],_0x56df00['endDate']);}if(_0x5b282b){logger['info'](_0x6bc3('0x9c'),_0x46d839['toString']());require(_0x6bc3('0x9d'))[_0x6bc3('0x9e')](path[_0x6bc3('0x8a')](__dirname,_0x6bc3('0x9f'),_0x5b282b[_0x6bc3('0x91')]),[_0x5b282b['id'],_0x46d839[_0x6bc3('0x87')](),path[_0x6bc3('0x8a')](__dirname,_0x6bc3('0xa0'),_0x5b282b[_0x6bc3('0xa1')]),_0x1404c5]);return _0x5b282b;}else{var _0x3256b8=squel[_0x6bc3('0x74')]();_0x3256b8['from']('('+_0x46d839[_0x6bc3('0x87')]()+')',_0x6bc3('0xa2'));_0x3256b8[_0x6bc3('0x77')](_0x6bc3('0xa3'),_0x6bc3('0x23'));_0x46d839['limit'](_0x56df00[_0x6bc3('0x21')]||_0x1cba77);_0x46d839['offset'](_0x56df00[_0x6bc3('0x20')]||0x0);return dbH[_0x6bc3('0x88')][_0x6bc3('0x39')](_0x3256b8[_0x6bc3('0x87')](),{'type':dbH['sequelize'][_0x6bc3('0xa4')][_0x6bc3('0x89')]})[_0x6bc3('0x29')](function(_0x3693e8){if(!_0x3693e8[_0x6bc3('0x3e')]){_0x436e9f=0x0;}else{_0x436e9f=_0x3693e8[0x0][_0x6bc3('0x23')]||0x0;}return dbH[_0x6bc3('0x88')][_0x6bc3('0x39')](_0x46d839['toString'](),{'type':dbH[_0x6bc3('0x88')]['QueryTypes'][_0x6bc3('0x89')]});})['then'](function(_0x46d597){return{'rows':_0x46d597||[],'count':_0x436e9f};});}});}exports[_0x6bc3('0xa5')]=function(_0x566e05,_0x535c14){return runReport(_0x566e05[_0x6bc3('0x4a')],_0x566e05[_0x6bc3('0x39')],_0x566e05['options'])[_0x6bc3('0x29')](respondWithResult(_0x535c14,null))[_0x6bc3('0x49')](handleError(_0x535c14,null));};exports['runReport']=runReport;exports[_0x6bc3('0x39')]=function(_0x509773,_0x1d930e){var _0x8202b2=0xa;var _0x1ea382=['join','left_join',_0x6bc3('0x56'),_0x6bc3('0x57')];var _0x4aa523={'SUM':'SUM(%s)','COUNT':_0x6bc3('0x8b'),'COUNT DISTINCT':_0x6bc3('0x59'),'MAX':_0x6bc3('0x5a'),'MIN':'MIN(%s)','AVG':_0x6bc3('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x6bc3('0x5e'),'GROUP_CONCAT DESC':_0x6bc3('0x5f')};var _0x1796fd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6bc3('0x61'),'HOUR':_0x6bc3('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x365fc9=function(_0x3e7154){return!_['includes']([_0x6bc3('0x8c'),_0x6bc3('0x66'),_0x6bc3('0x67'),_0x6bc3('0x8d')],_0x3e7154);};var _0x47de58=function(_0x34d326){if(!_0x34d326||!_0x34d326['rules']['length']){return'';}for(var _0x7a6521='(',_0xd98835=0x0;_0xd98835<_0x34d326[_0x6bc3('0x68')][_0x6bc3('0x3e')];_0xd98835+=0x1){_0xd98835>0x0&&(_0x7a6521+='\x20'+_0x34d326[_0x6bc3('0x69')]+'\x20');_0x7a6521+=_0x34d326['rules'][_0xd98835][_0x6bc3('0x6a')]?_0x47de58(_0x34d326[_0x6bc3('0x68')][_0xd98835][_0x6bc3('0x6a')]):_0x34d326[_0x6bc3('0x68')][_0xd98835][_0x6bc3('0x77')]+'\x20'+_0x34d326[_0x6bc3('0x68')][_0xd98835][_0x6bc3('0x6b')]+(_0x365fc9(_0x34d326[_0x6bc3('0x68')][_0xd98835][_0x6bc3('0x6b')])?'\x20'+_0x34d326[_0x6bc3('0x68')][_0xd98835][_0x6bc3('0x6c')]:'');}return _0x7a6521+')';};var _0x2180cc={'where':{'id':_0x509773['params']['id']}},_0x16ce91,_0x1e1e70,_0x1ab5b8,_0x31e15c,_0x1f54fe;_0x2180cc=_[_0x6bc3('0x45')]({},_0x2180cc,_0x509773[_0x6bc3('0x47')]);return db[_0x6bc3('0x33')][_0x6bc3('0x50')](_0x2180cc)[_0x6bc3('0x29')](function(_0x525f85){if(_0x525f85){_0x16ce91=_0x525f85;return _0x525f85[_0x6bc3('0x6d')]();}return null;})[_0x6bc3('0x29')](function(_0x4bcfd2){if(_0x4bcfd2){if(!_0x4bcfd2[_0x6bc3('0x3e')]){throw new db[(_0x6bc3('0x6e'))][(_0x6bc3('0x6f'))](_0x6bc3('0x70'),0x193);}_0x1e1e70=_0x4bcfd2;return db[_0x6bc3('0x71')][_0x6bc3('0x72')]({'raw':!![]});}return null;})['then'](function(_0x118b2b){if(_0x118b2b){_0x1ab5b8=_[_0x6bc3('0x73')](_0x118b2b,'id');var _0x5c836d;var _0x311d35=squel[_0x6bc3('0x74')]();_0x311d35[_0x6bc3('0xa6')](_0x16ce91[_0x6bc3('0x82')]);for(var _0x5b5443=0x0;_0x5b5443<_0x1e1e70[_0x6bc3('0x3e')];_0x5b5443+=0x1){_0x5c836d=_0x1e1e70[_0x5b5443][_0x6bc3('0x75')]?_0x1ab5b8[_0x1e1e70[_0x5b5443][_0x6bc3('0x75')]][_0x6bc3('0x76')]:_0x1e1e70[_0x5b5443][_0x6bc3('0x77')];_0x5c836d=_0x1e1e70[_0x5b5443]['function']?_['replace'](_0x4aa523[_0x1e1e70[_0x5b5443][_0x6bc3('0x78')]],'%s',_0x5c836d):_0x5c836d;_0x5c836d=_0x1e1e70[_0x5b5443]['format']?_[_0x6bc3('0x8e')](_0x1796fd[_0x1e1e70[_0x5b5443][_0x6bc3('0x79')]],'%s',_0x5c836d):_0x5c836d;if(_0x1e1e70[_0x5b5443]['groupBy']){_0x311d35[_0x6bc3('0x6a')](_0x5c836d);}_0x1e1e70[_0x5b5443]['orderBy']&&_0x311d35[_0x6bc3('0x41')](_0x5c836d,_0x1e1e70[_0x5b5443][_0x6bc3('0x7b')]===_0x6bc3('0x8f')?![]:!![]);_0x311d35['field'](_0x5c836d,_0x1e1e70[_0x5b5443]['alias']||_0x5c836d);}if(_0x16ce91[_0x6bc3('0x7d')]){_0x16ce91['joins']=JSON[_0x6bc3('0x7e')](_0x16ce91['joins']);for(var _0x2a8cc0=0x0;_0x2a8cc0<_0x16ce91['joins'][_0x6bc3('0x3e')];_0x2a8cc0+=0x1){if(_0x16ce91['joins'][_0x2a8cc0]['type']&&_[_0x6bc3('0x65')](_0x1ea382,_0x16ce91[_0x6bc3('0x7d')][_0x2a8cc0]['type'])&&_0x16ce91[_0x6bc3('0x7d')][_0x2a8cc0][_0x6bc3('0x83')]&&_0x16ce91[_0x6bc3('0x7d')][_0x2a8cc0][_0x6bc3('0x80')]&&_0x16ce91[_0x6bc3('0x7d')][_0x2a8cc0]['foreignKey']){_0x311d35[_0x16ce91['joins'][_0x2a8cc0][_0x6bc3('0x36')]](_0x16ce91['joins'][_0x2a8cc0][_0x6bc3('0x80')],null,util[_0x6bc3('0x79')](_0x6bc3('0x81'),_0x16ce91['table'],_0x16ce91[_0x6bc3('0x7d')][_0x2a8cc0][_0x6bc3('0x83')],_0x16ce91[_0x6bc3('0x7d')][_0x2a8cc0]['foreignTable'],_0x16ce91[_0x6bc3('0x7d')][_0x2a8cc0][_0x6bc3('0x7f')]));}}}if(_0x16ce91[_0x6bc3('0x84')]){_0x16ce91['conditions']=JSON['parse'](_0x16ce91[_0x6bc3('0x84')]);_0x311d35[_0x6bc3('0x43')](_0x47de58(_0x16ce91[_0x6bc3('0x84')][_0x6bc3('0x6a')]));}_0x1f54fe=_0x311d35['clone']();_0x311d35[_0x6bc3('0x21')](_0x8202b2);_0x311d35[_0x6bc3('0x20')](0x0);logger[_0x6bc3('0x85')](_0x6bc3('0x86'),_0x311d35['toString']());return dbH[_0x6bc3('0x88')][_0x6bc3('0x39')](_0x311d35['toString'](),{'type':dbH[_0x6bc3('0x88')][_0x6bc3('0xa4')][_0x6bc3('0x89')]});}})['then'](function(){return{'sql':_0x1f54fe['toString']()};})[_0x6bc3('0x29')](respondWithResult(_0x1d930e,null))['catch'](handleError(_0x1d930e,null));}; \ No newline at end of file +var _0x672d=['countTable','COUNT(*)','SELECT','runReport','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','end','error','name','send','index','map','AnalyticCustomReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','type','filter','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation','CustomReports','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','table','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','right_join','DATE(%s)','AnalyticMetric','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x672d,0x154));var _0xd672=function(_0x3daeba,_0x130354){_0x3daeba=_0x3daeba-0x0;var _0x34500d=_0x672d[_0x3daeba];return _0x34500d;};'use strict';var emlformat=require(_0xd672('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd672('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd672('0x2'));var moment=require(_0xd672('0x3'));var BPromise=require(_0xd672('0x4'));var Mustache=require(_0xd672('0x5'));var util=require('util');var path=require(_0xd672('0x6'));var sox=require(_0xd672('0x7'));var csv=require(_0xd672('0x8'));var ejs=require(_0xd672('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd672('0xa'));var squel=require(_0xd672('0xb'));var crypto=require(_0xd672('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd672('0xd'));var toCsv=require(_0xd672('0x8'));var querystring=require(_0xd672('0xe'));var Papa=require('papaparse');var Redis=require(_0xd672('0xf'));var authService=require(_0xd672('0x10'));var qs=require(_0xd672('0x11'));var as=require(_0xd672('0x12'));var hardwareService=require(_0xd672('0x13'));var logger=require(_0xd672('0x14'))(_0xd672('0x15'));var utils=require(_0xd672('0x16'));var config=require(_0xd672('0x17'));var licenseUtil=require(_0xd672('0x18'));var db=require(_0xd672('0x19'))['db'];var dbH=require(_0xd672('0x19'))[_0xd672('0x1a')];function respondWithStatusCode(_0x4ff02b,_0xa99b58){_0xa99b58=_0xa99b58||0xcc;return function(_0xfd2e4a){if(_0xfd2e4a){return _0x4ff02b[_0xd672('0x1b')](_0xa99b58);}return _0x4ff02b[_0xd672('0x1c')](_0xa99b58)['end']();};}function respondWithResult(_0x2f3d7a,_0x15307c){_0x15307c=_0x15307c||0xc8;return function(_0x56496e){if(_0x56496e){return _0x2f3d7a[_0xd672('0x1c')](_0x15307c)[_0xd672('0x1d')](_0x56496e);}};}function respondWithFilteredResult(_0x31c01a,_0x4ad65f){return function(_0x265360){if(_0x265360){var _0x10e270=typeof _0x4ad65f[_0xd672('0x1e')]==='undefined'&&typeof _0x4ad65f['limit']===_0xd672('0x1f');var _0x27b499=_0x265360[_0xd672('0x20')];var _0xc274d5=_0x10e270?0x0:_0x4ad65f['offset'];var _0x3d59e7=_0x10e270?_0x265360['count']:_0x4ad65f[_0xd672('0x1e')]+_0x4ad65f['limit'];var _0xd57781;if(_0x3d59e7>=_0x27b499){_0x3d59e7=_0x27b499;_0xd57781=0xc8;}else{_0xd57781=0xce;}_0x31c01a[_0xd672('0x1c')](_0xd57781);return _0x31c01a[_0xd672('0x21')](_0xd672('0x22'),_0xc274d5+'-'+_0x3d59e7+'/'+_0x27b499)[_0xd672('0x1d')](_0x265360);}return null;};}function patchUpdates(_0x5111f1){return function(_0x1cb862){try{jsonpatch[_0xd672('0x23')](_0x1cb862,_0x5111f1,!![]);}catch(_0x2c00ca){return BPromise[_0xd672('0x24')](_0x2c00ca);}return _0x1cb862['save']();};}function saveUpdates(_0x30449d,_0x33636b){return function(_0x48737e){if(_0x48737e){return _0x48737e[_0xd672('0x25')](_0x30449d)[_0xd672('0x26')](function(_0x2171af){return _0x2171af;});}return null;};}function removeEntity(_0x537e93,_0x54cec8){return function(_0x3d32c2){if(_0x3d32c2){return _0x3d32c2[_0xd672('0x27')]()['then'](function(){var _0x171824=_0x3d32c2['get']({'plain':!![]});var _0x29c80d='CustomReports';return db[_0xd672('0x28')][_0xd672('0x27')]({'where':{'type':_0x29c80d,'resourceId':_0x171824['id']}})[_0xd672('0x26')](function(){return _0x3d32c2;});})[_0xd672('0x26')](function(){_0x537e93[_0xd672('0x1c')](0xcc)[_0xd672('0x29')]();});}};}function handleEntityNotFound(_0x5b1858,_0x1ed060){return function(_0x5a2b1e){if(!_0x5a2b1e){_0x5b1858[_0xd672('0x1b')](0x194);}return _0x5a2b1e;};}function handleError(_0x48b5af,_0xcbe367){_0xcbe367=_0xcbe367||0x1f4;return function(_0x54f0fd){logger[_0xd672('0x2a')](_0x54f0fd['stack']);if(_0x54f0fd['name']){delete _0x54f0fd[_0xd672('0x2b')];}_0x48b5af[_0xd672('0x1c')](_0xcbe367)[_0xd672('0x2c')](_0x54f0fd);};}exports[_0xd672('0x2d')]=function(_0x2fe4ab,_0x3dd972){var _0x282fb3={},_0xc65055={},_0xf4cf09={'count':0x0,'rows':[]};var _0x471d4c=_[_0xd672('0x2e')](db[_0xd672('0x2f')][_0xd672('0x30')],function(_0x53f3c6){return{'name':_0x53f3c6['fieldName'],'type':_0x53f3c6['type'][_0xd672('0x31')]};});_0xc65055['model']=_[_0xd672('0x2e')](_0x471d4c,_0xd672('0x2b'));_0xc65055[_0xd672('0x32')]=_[_0xd672('0x33')](_0x2fe4ab['query']);_0xc65055[_0xd672('0x34')]=_[_0xd672('0x35')](_0xc65055[_0xd672('0x36')],_0xc65055[_0xd672('0x32')]);_0x282fb3[_0xd672('0x37')]=_['intersection'](_0xc65055[_0xd672('0x36')],qs[_0xd672('0x38')](_0x2fe4ab['query'][_0xd672('0x38')]));_0x282fb3[_0xd672('0x37')]=_0x282fb3[_0xd672('0x37')][_0xd672('0x39')]?_0x282fb3['attributes']:_0xc65055['model'];if(!_0x2fe4ab[_0xd672('0x32')][_0xd672('0x3a')](_0xd672('0x3b'))){_0x282fb3[_0xd672('0x3c')]=qs['limit'](_0x2fe4ab[_0xd672('0x32')][_0xd672('0x3c')]);_0x282fb3[_0xd672('0x1e')]=qs[_0xd672('0x1e')](_0x2fe4ab['query'][_0xd672('0x1e')]);}_0x282fb3[_0xd672('0x3d')]=qs[_0xd672('0x3e')](_0x2fe4ab[_0xd672('0x32')][_0xd672('0x3e')]);_0x282fb3['where']=qs[_0xd672('0x34')](_[_0xd672('0x3f')](_0x2fe4ab['query'],_0xc65055[_0xd672('0x34')]),_0x471d4c);if(_0x2fe4ab[_0xd672('0x32')]['filter']){_0x282fb3[_0xd672('0x40')]=_[_0xd672('0x41')](_0x282fb3[_0xd672('0x40')],{'$or':_[_0xd672('0x2e')](_0x471d4c,function(_0x39277c){if(_0x39277c[_0xd672('0x42')]!=='VIRTUAL'){var _0x29b372={};_0x29b372[_0x39277c[_0xd672('0x2b')]]={'$like':'%'+_0x2fe4ab[_0xd672('0x32')][_0xd672('0x43')]+'%'};return _0x29b372;}})});}_0x282fb3=_[_0xd672('0x41')]({},_0x282fb3,_0x2fe4ab['options']);var _0x240537={'where':_0x282fb3[_0xd672('0x40')]};return db['AnalyticCustomReport'][_0xd672('0x20')](_0x240537)[_0xd672('0x26')](function(_0x56d03d){_0xf4cf09[_0xd672('0x20')]=_0x56d03d;if(_0x2fe4ab['query']['includeAll']){_0x282fb3['include']=[{'all':!![]}];}return db[_0xd672('0x2f')][_0xd672('0x44')](_0x282fb3);})[_0xd672('0x26')](function(_0xd0f09f){_0xf4cf09[_0xd672('0x45')]=_0xd0f09f;return _0xf4cf09;})[_0xd672('0x26')](respondWithFilteredResult(_0x3dd972,_0x282fb3))[_0xd672('0x46')](handleError(_0x3dd972,null));};exports[_0xd672('0x47')]=function(_0x5e15fe,_0xa61968){var _0x54ffe0={'raw':![],'where':{'id':_0x5e15fe[_0xd672('0x48')]['id']}},_0x36db6e={};_0x36db6e[_0xd672('0x36')]=_[_0xd672('0x33')](db['AnalyticCustomReport'][_0xd672('0x30')]);_0x36db6e[_0xd672('0x32')]=_['keys'](_0x5e15fe[_0xd672('0x32')]);_0x36db6e[_0xd672('0x34')]=_['intersection'](_0x36db6e[_0xd672('0x36')],_0x36db6e[_0xd672('0x32')]);_0x54ffe0['attributes']=_[_0xd672('0x35')](_0x36db6e[_0xd672('0x36')],qs[_0xd672('0x38')](_0x5e15fe['query'][_0xd672('0x38')]));_0x54ffe0[_0xd672('0x37')]=_0x54ffe0['attributes'][_0xd672('0x39')]?_0x54ffe0[_0xd672('0x37')]:_0x36db6e[_0xd672('0x36')];if(_0x5e15fe[_0xd672('0x32')][_0xd672('0x49')]){_0x54ffe0[_0xd672('0x4a')]=[{'all':!![]}];}_0x54ffe0=_[_0xd672('0x41')]({},_0x54ffe0,_0x5e15fe[_0xd672('0x4b')]);return db['AnalyticCustomReport'][_0xd672('0x4c')](_0x54ffe0)[_0xd672('0x26')](handleEntityNotFound(_0xa61968,null))[_0xd672('0x26')](respondWithResult(_0xa61968,null))['catch'](handleError(_0xa61968,null));};exports[_0xd672('0x4d')]=function(_0x15e53c,_0x4ce57e){return db[_0xd672('0x2f')][_0xd672('0x4d')](_0x15e53c[_0xd672('0x4e')],{})['then'](function(_0x231cf7){var _0x3b8720=_0x15e53c['user']['get']({'plain':!![]});if(!_0x3b8720)throw new Error(_0xd672('0x4f'));if(_0x3b8720[_0xd672('0x50')]===_0xd672('0x51')){var _0x188ad5=_0x231cf7['get']({'plain':!![]});var _0x547c8e=_0xd672('0x52');return db['UserProfileSection']['find']({'where':{'name':_0x547c8e,'userProfileId':_0x3b8720[_0xd672('0x53')]},'raw':!![]})[_0xd672('0x26')](function(_0x50d59c){if(_0x50d59c&&_0x50d59c[_0xd672('0x54')]===0x0){return db[_0xd672('0x28')][_0xd672('0x4d')]({'name':_0x188ad5[_0xd672('0x2b')],'resourceId':_0x188ad5['id'],'type':_0xd672('0x55'),'sectionId':_0x50d59c['id']},{})[_0xd672('0x26')](function(){return _0x231cf7;});}else{return _0x231cf7;}})['catch'](function(_0x477277){logger[_0xd672('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x477277);throw _0x477277;});}return _0x231cf7;})[_0xd672('0x26')](respondWithResult(_0x4ce57e,0xc9))[_0xd672('0x46')](handleError(_0x4ce57e,null));};exports['update']=function(_0x19e328,_0x1f5ca9){if(_0x19e328['body']['id']){delete _0x19e328[_0xd672('0x4e')]['id'];}return db[_0xd672('0x2f')][_0xd672('0x4c')]({'where':{'id':_0x19e328[_0xd672('0x48')]['id']}})[_0xd672('0x26')](handleEntityNotFound(_0x1f5ca9,null))[_0xd672('0x26')](saveUpdates(_0x19e328[_0xd672('0x4e')],null))[_0xd672('0x26')](respondWithResult(_0x1f5ca9,null))[_0xd672('0x46')](handleError(_0x1f5ca9,null));};exports[_0xd672('0x27')]=function(_0x30f90b,_0x24a6c9){return db['AnalyticCustomReport']['find']({'where':{'id':_0x30f90b[_0xd672('0x48')]['id']}})['then'](handleEntityNotFound(_0x24a6c9,null))[_0xd672('0x26')](removeEntity(_0x24a6c9,null))['catch'](handleError(_0x24a6c9,null));};exports['preview']=function(_0x4d3bd4,_0x543b2b){var _0x22c698=0xa;var _0x1f11c5=[_0xd672('0x56'),_0xd672('0x57'),'right_join',_0xd672('0x58')];var _0x152d22={'SUM':_0xd672('0x59'),'COUNT':_0xd672('0x5a'),'COUNT DISTINCT':_0xd672('0x5b'),'MAX':_0xd672('0x5c'),'MIN':_0xd672('0x5d'),'AVG':_0xd672('0x5e'),'GROUP_CONCAT':_0xd672('0x5f'),'GROUP_CONCAT ASC':_0xd672('0x60'),'GROUP_CONCAT DESC':_0xd672('0x61')};var _0x438f82={'SEC_TO_TIME':_0xd672('0x62'),'DATE':'DATE(%s)','HOUR':_0xd672('0x63'),'ROUND':_0xd672('0x64'),'UNIX_TIMESTAMP':_0xd672('0x65')};var _0x361c37=function(_0x29f359){return!_[_0xd672('0x66')]([_0xd672('0x67'),_0xd672('0x68'),_0xd672('0x69'),'IS\x20NOT\x20EMPTY'],_0x29f359);};var _0x19121d=function(_0x3cb7eb){if(!_0x3cb7eb||!_0x3cb7eb[_0xd672('0x6a')]['length']){return'';}for(var _0x40742a='(',_0x57df7a=0x0;_0x57df7a<_0x3cb7eb['rules']['length'];_0x57df7a+=0x1){_0x57df7a>0x0&&(_0x40742a+='\x20'+_0x3cb7eb[_0xd672('0x6b')]+'\x20');_0x40742a+=_0x3cb7eb[_0xd672('0x6a')][_0x57df7a][_0xd672('0x6c')]?_0x19121d(_0x3cb7eb[_0xd672('0x6a')][_0x57df7a]['group']):_0x3cb7eb['rules'][_0x57df7a][_0xd672('0x6d')]+'\x20'+_0x3cb7eb[_0xd672('0x6a')][_0x57df7a][_0xd672('0x6e')]+(_0x361c37(_0x3cb7eb[_0xd672('0x6a')][_0x57df7a][_0xd672('0x6e')])?'\x20'+_0x3cb7eb[_0xd672('0x6a')][_0x57df7a][_0xd672('0x6f')]:'');}return _0x40742a+')';};var _0x13495e={'where':{'id':_0x4d3bd4['params']['id']}},_0x50db6d,_0x324ae7,_0x1fbcb2,_0x27da97,_0x1e14e1;_0x13495e=_['merge']({},_0x13495e,_0x4d3bd4[_0xd672('0x4b')]);return db[_0xd672('0x2f')][_0xd672('0x4c')](_0x13495e)[_0xd672('0x26')](function(_0x11f721){if(_0x11f721){_0x50db6d=_0x11f721;return _0x11f721[_0xd672('0x70')]();}return null;})[_0xd672('0x26')](function(_0x19b369){if(_0x19b369){if(!_0x19b369['length']){throw new db[(_0xd672('0x71'))][(_0xd672('0x72'))](_0xd672('0x73'),0x193);}_0x324ae7=_0x19b369;return db['AnalyticMetric'][_0xd672('0x44')]({'raw':!![]});}return null;})[_0xd672('0x26')](function(_0x39ced0){if(_0x39ced0){_0x1fbcb2=_[_0xd672('0x74')](_0x39ced0,'id');var _0xcc9889;var _0x3b76b2=squel[_0xd672('0x75')]();_0x3b76b2[_0xd672('0x76')](_0x50db6d['table']);for(var _0x539b30=0x0;_0x539b30<_0x324ae7['length'];_0x539b30+=0x1){_0xcc9889=_0x324ae7[_0x539b30][_0xd672('0x77')]?_0x1fbcb2[_0x324ae7[_0x539b30]['MetricId']][_0xd672('0x78')]:_0x324ae7[_0x539b30][_0xd672('0x6d')];_0xcc9889=_0x324ae7[_0x539b30][_0xd672('0x79')]?_[_0xd672('0x7a')](_0x152d22[_0x324ae7[_0x539b30][_0xd672('0x79')]],'%s',_0xcc9889):_0xcc9889;_0xcc9889=_0x324ae7[_0x539b30][_0xd672('0x7b')]?_['replace'](_0x438f82[_0x324ae7[_0x539b30][_0xd672('0x7b')]],'%s',_0xcc9889):_0xcc9889;if(_0x324ae7[_0x539b30][_0xd672('0x7c')]){_0x3b76b2[_0xd672('0x6c')](_0xcc9889);}_0x324ae7[_0x539b30][_0xd672('0x7d')]&&_0x3b76b2[_0xd672('0x3d')](_0xcc9889,_0x324ae7[_0x539b30]['orderBy']===_0xd672('0x7e')?![]:!![]);_0x3b76b2[_0xd672('0x6d')](_0xcc9889,_0x324ae7[_0x539b30]['alias']||_0xcc9889);}if(_0x50db6d['joins']){_0x50db6d[_0xd672('0x7f')]=JSON[_0xd672('0x80')](_0x50db6d[_0xd672('0x7f')]);for(var _0x4172b9=0x0;_0x4172b9<_0x50db6d[_0xd672('0x7f')][_0xd672('0x39')];_0x4172b9+=0x1){if(_0x50db6d['joins'][_0x4172b9][_0xd672('0x42')]&&_[_0xd672('0x66')](_0x1f11c5,_0x50db6d['joins'][_0x4172b9][_0xd672('0x42')])&&_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x81')]&&_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x82')]&&_0x50db6d['joins'][_0x4172b9]['foreignKey']){_0x3b76b2[_0x50db6d[_0xd672('0x7f')][_0x4172b9]['type']](_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x82')],null,util[_0xd672('0x7b')]('%s.%s\x20=\x20%s.%s',_0x50db6d[_0xd672('0x83')],_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x81')],_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x82')],_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x84')]));}}}if(_0x50db6d[_0xd672('0x85')]){_0x50db6d[_0xd672('0x85')]=JSON[_0xd672('0x80')](_0x50db6d[_0xd672('0x85')]);_0x3b76b2[_0xd672('0x40')](_0x19121d(_0x50db6d[_0xd672('0x85')][_0xd672('0x6c')]));}_0x1e14e1=_0x3b76b2['clone']();_0x3b76b2[_0xd672('0x3c')](_0x22c698);_0x3b76b2[_0xd672('0x1e')](0x0);logger[_0xd672('0x86')](_0xd672('0x87'),_0x3b76b2[_0xd672('0x88')]());return dbH[_0xd672('0x89')]['query'](_0x3b76b2[_0xd672('0x88')](),{'type':dbH['sequelize'][_0xd672('0x8a')]['SELECT']});}})[_0xd672('0x26')](respondWithResult(_0x543b2b,null))[_0xd672('0x46')](handleError(_0x543b2b,null));};function runReport(_0x3c380b,_0xc56793,_0x542049){var _0xa747ea=_0xc56793[_0xd672('0x2b')];var _0x3671ce=0xa;var _0x353bce=[_0xd672('0x56'),'left_join',_0xd672('0x8b'),_0xd672('0x58')];var _0x72d48f={'SUM':_0xd672('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd672('0x5b'),'MAX':_0xd672('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd672('0x5f'),'GROUP_CONCAT ASC':_0xd672('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xfc714={'SEC_TO_TIME':_0xd672('0x62'),'DATE':_0xd672('0x8c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x387434=function(_0x49bfd3){return!_['includes']([_0xd672('0x67'),'IS\x20NOT\x20NULL',_0xd672('0x69'),'IS\x20NOT\x20EMPTY'],_0x49bfd3);};var _0x58c8ed=function(_0xa36803){if(!_0xa36803||!_0xa36803[_0xd672('0x6a')][_0xd672('0x39')]){return'';}for(var _0x5c5a55='(',_0x1ba997=0x0;_0x1ba997<_0xa36803[_0xd672('0x6a')][_0xd672('0x39')];_0x1ba997+=0x1){_0x1ba997>0x0&&(_0x5c5a55+='\x20'+_0xa36803[_0xd672('0x6b')]+'\x20');_0x5c5a55+=_0xa36803[_0xd672('0x6a')][_0x1ba997][_0xd672('0x6c')]?_0x58c8ed(_0xa36803[_0xd672('0x6a')][_0x1ba997]['group']):_0xa36803['rules'][_0x1ba997][_0xd672('0x6d')]+'\x20'+_0xa36803[_0xd672('0x6a')][_0x1ba997][_0xd672('0x6e')]+(_0x387434(_0xa36803['rules'][_0x1ba997]['condition'])?'\x20'+_0xa36803[_0xd672('0x6a')][_0x1ba997][_0xd672('0x6f')]:'');}return _0x5c5a55+')';};var _0x51f019={'where':{'id':_0x3c380b['id']}},_0x4f26bb,_0x67ee3a,_0x15e111,_0x119460,_0x1e95e8;_0x51f019=_[_0xd672('0x41')]({},_0x51f019,_0x542049);return db[_0xd672('0x2f')][_0xd672('0x4c')](_0x51f019)[_0xd672('0x26')](function(_0x282e8a){if(_0x282e8a){_0x4f26bb=_0x282e8a;return _0x282e8a[_0xd672('0x70')]();}return null;})[_0xd672('0x26')](function(_0xb63cb9){if(_0xb63cb9){if(!_0xb63cb9[_0xd672('0x39')]){throw new db[(_0xd672('0x71'))][(_0xd672('0x72'))](_0xd672('0x73'),0x193);}_0x67ee3a=_0xb63cb9;return db[_0xd672('0x8d')][_0xd672('0x44')]({'raw':!![]});}return null;})[_0xd672('0x26')](function(_0xf40871){if(_0xf40871){_0x15e111=_[_0xd672('0x74')](_0xf40871,'id');var _0x1f9550;var _0x58d0a0=squel[_0xd672('0x75')]();_0x58d0a0[_0xd672('0x76')](_0x4f26bb['table']);for(var _0x20bedc=0x0;_0x20bedc<_0x67ee3a[_0xd672('0x39')];_0x20bedc+=0x1){_0x1f9550=_0x67ee3a[_0x20bedc][_0xd672('0x77')]?_0x15e111[_0x67ee3a[_0x20bedc][_0xd672('0x77')]]['metric']:_0x67ee3a[_0x20bedc][_0xd672('0x6d')];_0x1f9550=_0x67ee3a[_0x20bedc]['function']?_[_0xd672('0x7a')](_0x72d48f[_0x67ee3a[_0x20bedc][_0xd672('0x79')]],'%s',_0x1f9550):_0x1f9550;_0x1f9550=_0x67ee3a[_0x20bedc][_0xd672('0x7b')]?_[_0xd672('0x7a')](_0xfc714[_0x67ee3a[_0x20bedc]['format']],'%s',_0x1f9550):_0x1f9550;if(_0x67ee3a[_0x20bedc][_0xd672('0x7c')]){_0x58d0a0[_0xd672('0x6c')](_0x1f9550);}_0x67ee3a[_0x20bedc][_0xd672('0x7d')]&&_0x58d0a0[_0xd672('0x3d')](_0x1f9550,_0x67ee3a[_0x20bedc][_0xd672('0x7d')]===_0xd672('0x7e')?![]:!![]);_0x58d0a0['field'](_0x1f9550,_0x67ee3a[_0x20bedc][_0xd672('0x8e')]||_0x1f9550);}if(_0x4f26bb[_0xd672('0x7f')]){_0x4f26bb[_0xd672('0x7f')]=JSON[_0xd672('0x80')](_0x4f26bb[_0xd672('0x7f')]);for(var _0xd6db57=0x0;_0xd6db57<_0x4f26bb['joins']['length'];_0xd6db57+=0x1){if(_0x4f26bb['joins'][_0xd6db57][_0xd672('0x42')]&&_[_0xd672('0x66')](_0x353bce,_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x42')])&&_0x4f26bb['joins'][_0xd6db57][_0xd672('0x81')]&&_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x82')]&&_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x84')]){_0x58d0a0[_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x42')]](_0x4f26bb['joins'][_0xd6db57][_0xd672('0x82')],null,util[_0xd672('0x7b')](_0xd672('0x8f'),_0x4f26bb[_0xd672('0x83')],_0x4f26bb[_0xd672('0x7f')][_0xd6db57]['parentKey'],_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x82')],_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x84')]));}}}if(_0x4f26bb['conditions']){_0x4f26bb[_0xd672('0x85')]=JSON[_0xd672('0x80')](_0x4f26bb[_0xd672('0x85')]);_0x58d0a0['where'](_0x58c8ed(_0x4f26bb[_0xd672('0x85')][_0xd672('0x6c')]));}_0x1e95e8=_0x58d0a0['clone']();_0x58d0a0[_0xd672('0x3c')](_0x3671ce);_0x58d0a0[_0xd672('0x1e')](0x0);return;}})[_0xd672('0x26')](function(){if(_0xc56793[_0xd672('0x90')]===_0xd672('0x91')){return null;}var _0x142a17=_[_0xd672('0x41')](_0xc56793,{'name':_0xc56793[_0xd672('0x92')]||_0xc56793[_0xd672('0x2b')]||_0x4f26bb[_0xd672('0x2b')],'basename':_0xa747ea,'savename':util['format'](_0xd672('0x93'),_0xc56793[_0xd672('0x2b')]||_0x4f26bb['name'],require(_0xd672('0x94'))[_0xd672('0x95')](0x4),_0xc56793[_0xd672('0x90')]||_0xd672('0x96')),'reportId':_0x4f26bb['id'],'reportType':_0xd672('0x97')});return db[_0xd672('0x98')][_0xd672('0x4d')](_0x142a17,{'raw':!![]});})[_0xd672('0x26')](function(_0x57dfac){if(_0x4f26bb[_0xd672('0x83')]===_0xd672('0x99')){_0x1e95e8[_0xd672('0x40')](_0x4f26bb[_0xd672('0x83')]+_0xd672('0x9a'),_0xc56793[_0xd672('0x9b')],_0xc56793[_0xd672('0x9c')]);}else{_0x1e95e8[_0xd672('0x40')](_0x4f26bb[_0xd672('0x83')]+_0xd672('0x9d'),_0xc56793[_0xd672('0x9b')],_0xc56793[_0xd672('0x9c')]);}if(_0x57dfac){logger[_0xd672('0x9e')](_0xd672('0x9f'),_0x1e95e8[_0xd672('0x88')]());require(_0xd672('0xa0'))[_0xd672('0xa1')](path[_0xd672('0x56')](__dirname,'../../components/export/',_0x57dfac[_0xd672('0x90')]),[_0x57dfac['id'],_0x1e95e8[_0xd672('0x88')](),path['join'](__dirname,_0xd672('0xa2'),_0x57dfac[_0xd672('0xa3')]),_0xa747ea]);return _0x57dfac;}else{var _0x1f7115=squel['select']();_0x1f7115[_0xd672('0x76')]('('+_0x1e95e8['toString']()+')',_0xd672('0xa4'));_0x1f7115[_0xd672('0x6d')](_0xd672('0xa5'),_0xd672('0x20'));_0x1e95e8[_0xd672('0x3c')](_0xc56793[_0xd672('0x3c')]||_0x3671ce);_0x1e95e8[_0xd672('0x1e')](_0xc56793[_0xd672('0x1e')]||0x0);return dbH['sequelize'][_0xd672('0x32')](_0x1f7115[_0xd672('0x88')](),{'type':dbH[_0xd672('0x89')][_0xd672('0x8a')][_0xd672('0xa6')]})[_0xd672('0x26')](function(_0x188668){if(!_0x188668[_0xd672('0x39')]){_0x119460=0x0;}else{_0x119460=_0x188668[0x0]['count']||0x0;}return dbH[_0xd672('0x89')][_0xd672('0x32')](_0x1e95e8[_0xd672('0x88')](),{'type':dbH[_0xd672('0x89')][_0xd672('0x8a')][_0xd672('0xa6')]});})[_0xd672('0x26')](function(_0x19f219){return{'rows':_0x19f219||[],'count':_0x119460};});}});}exports['run']=function(_0x596792,_0x5ad502){return runReport(_0x596792['params'],_0x596792[_0xd672('0x32')],_0x596792[_0xd672('0x4b')])[_0xd672('0x26')](respondWithResult(_0x5ad502,null))[_0xd672('0x46')](handleError(_0x5ad502,null));};exports[_0xd672('0xa7')]=runReport;exports[_0xd672('0x32')]=function(_0x28a67c,_0x3f9029){var _0x4a0148=0xa;var _0x4f5066=['join',_0xd672('0x57'),_0xd672('0x8b'),_0xd672('0x58')];var _0x20290b={'SUM':_0xd672('0x59'),'COUNT':_0xd672('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd672('0x5c'),'MIN':_0xd672('0x5d'),'AVG':_0xd672('0x5e'),'GROUP_CONCAT':_0xd672('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd672('0x61')};var _0x379375={'SEC_TO_TIME':_0xd672('0x62'),'DATE':_0xd672('0x8c'),'HOUR':_0xd672('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd672('0x65')};var _0x2aae63=function(_0xaa0742){return!_[_0xd672('0x66')]([_0xd672('0x67'),'IS\x20NOT\x20NULL',_0xd672('0x69'),'IS\x20NOT\x20EMPTY'],_0xaa0742);};var _0x75c62e=function(_0x3103b2){if(!_0x3103b2||!_0x3103b2['rules'][_0xd672('0x39')]){return'';}for(var _0x525f2c='(',_0x468df8=0x0;_0x468df8<_0x3103b2[_0xd672('0x6a')][_0xd672('0x39')];_0x468df8+=0x1){_0x468df8>0x0&&(_0x525f2c+='\x20'+_0x3103b2[_0xd672('0x6b')]+'\x20');_0x525f2c+=_0x3103b2[_0xd672('0x6a')][_0x468df8][_0xd672('0x6c')]?_0x75c62e(_0x3103b2[_0xd672('0x6a')][_0x468df8][_0xd672('0x6c')]):_0x3103b2['rules'][_0x468df8][_0xd672('0x6d')]+'\x20'+_0x3103b2[_0xd672('0x6a')][_0x468df8][_0xd672('0x6e')]+(_0x2aae63(_0x3103b2[_0xd672('0x6a')][_0x468df8][_0xd672('0x6e')])?'\x20'+_0x3103b2[_0xd672('0x6a')][_0x468df8]['value']:'');}return _0x525f2c+')';};var _0x4e7aa8={'where':{'id':_0x28a67c[_0xd672('0x48')]['id']}},_0x828afc,_0x35ecae,_0x251dd9,_0x304c2b,_0x54db84;_0x4e7aa8=_[_0xd672('0x41')]({},_0x4e7aa8,_0x28a67c[_0xd672('0x4b')]);return db[_0xd672('0x2f')]['find'](_0x4e7aa8)[_0xd672('0x26')](function(_0x8c8e00){if(_0x8c8e00){_0x828afc=_0x8c8e00;return _0x8c8e00['getFields']();}return null;})[_0xd672('0x26')](function(_0x4abc86){if(_0x4abc86){if(!_0x4abc86[_0xd672('0x39')]){throw new db[(_0xd672('0x71'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35ecae=_0x4abc86;return db[_0xd672('0x8d')]['findAll']({'raw':!![]});}return null;})[_0xd672('0x26')](function(_0x177d35){if(_0x177d35){_0x251dd9=_[_0xd672('0x74')](_0x177d35,'id');var _0x55ecb4;var _0x3fbe67=squel[_0xd672('0x75')]();_0x3fbe67['from'](_0x828afc[_0xd672('0x83')]);for(var _0x588855=0x0;_0x588855<_0x35ecae['length'];_0x588855+=0x1){_0x55ecb4=_0x35ecae[_0x588855][_0xd672('0x77')]?_0x251dd9[_0x35ecae[_0x588855][_0xd672('0x77')]][_0xd672('0x78')]:_0x35ecae[_0x588855][_0xd672('0x6d')];_0x55ecb4=_0x35ecae[_0x588855][_0xd672('0x79')]?_[_0xd672('0x7a')](_0x20290b[_0x35ecae[_0x588855][_0xd672('0x79')]],'%s',_0x55ecb4):_0x55ecb4;_0x55ecb4=_0x35ecae[_0x588855][_0xd672('0x7b')]?_[_0xd672('0x7a')](_0x379375[_0x35ecae[_0x588855][_0xd672('0x7b')]],'%s',_0x55ecb4):_0x55ecb4;if(_0x35ecae[_0x588855][_0xd672('0x7c')]){_0x3fbe67[_0xd672('0x6c')](_0x55ecb4);}_0x35ecae[_0x588855][_0xd672('0x7d')]&&_0x3fbe67[_0xd672('0x3d')](_0x55ecb4,_0x35ecae[_0x588855][_0xd672('0x7d')]==='DESC'?![]:!![]);_0x3fbe67[_0xd672('0x6d')](_0x55ecb4,_0x35ecae[_0x588855]['alias']||_0x55ecb4);}if(_0x828afc['joins']){_0x828afc['joins']=JSON[_0xd672('0x80')](_0x828afc['joins']);for(var _0x3e24ef=0x0;_0x3e24ef<_0x828afc[_0xd672('0x7f')]['length'];_0x3e24ef+=0x1){if(_0x828afc[_0xd672('0x7f')][_0x3e24ef][_0xd672('0x42')]&&_[_0xd672('0x66')](_0x4f5066,_0x828afc[_0xd672('0x7f')][_0x3e24ef]['type'])&&_0x828afc[_0xd672('0x7f')][_0x3e24ef][_0xd672('0x81')]&&_0x828afc[_0xd672('0x7f')][_0x3e24ef][_0xd672('0x82')]&&_0x828afc['joins'][_0x3e24ef][_0xd672('0x84')]){_0x3fbe67[_0x828afc[_0xd672('0x7f')][_0x3e24ef]['type']](_0x828afc[_0xd672('0x7f')][_0x3e24ef]['foreignTable'],null,util[_0xd672('0x7b')](_0xd672('0x8f'),_0x828afc['table'],_0x828afc['joins'][_0x3e24ef]['parentKey'],_0x828afc[_0xd672('0x7f')][_0x3e24ef][_0xd672('0x82')],_0x828afc[_0xd672('0x7f')][_0x3e24ef]['foreignKey']));}}}if(_0x828afc['conditions']){_0x828afc[_0xd672('0x85')]=JSON['parse'](_0x828afc['conditions']);_0x3fbe67[_0xd672('0x40')](_0x75c62e(_0x828afc['conditions'][_0xd672('0x6c')]));}_0x54db84=_0x3fbe67['clone']();_0x3fbe67['limit'](_0x4a0148);_0x3fbe67[_0xd672('0x1e')](0x0);logger[_0xd672('0x86')](_0xd672('0x87'),_0x3fbe67['toString']());return dbH[_0xd672('0x89')]['query'](_0x3fbe67[_0xd672('0x88')](),{'type':dbH['sequelize']['QueryTypes'][_0xd672('0xa6')]});}})[_0xd672('0x26')](function(){return{'sql':_0x54db84[_0xd672('0x88')]()};})[_0xd672('0x26')](respondWithResult(_0x3f9029,null))[_0xd672('0x46')](handleError(_0x3f9029,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 7943ffc..7db4837 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.model.js +++ b/server/api/analyticCustomReport/analyticCustomReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c0e=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x52fd88,_0x44c121){var _0x2913e1=function(_0x45bcc8){while(--_0x45bcc8){_0x52fd88['push'](_0x52fd88['shift']());}};_0x2913e1(++_0x44c121);}(_0x5c0e,0x160));var _0xe5c0=function(_0x169a8a,_0x3526b1){_0x169a8a=_0x169a8a-0x0;var _0x2e8502=_0x5c0e[_0x169a8a];return _0x2e8502;};'use strict';var _=require(_0xe5c0('0x0'));var util=require(_0xe5c0('0x1'));var logger=require(_0xe5c0('0x2'))(_0xe5c0('0x3'));var moment=require(_0xe5c0('0x4'));var BPromise=require(_0xe5c0('0x5'));var rp=require(_0xe5c0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5c0('0x7'));var config=require('../../config/environment');var attributes=require(_0xe5c0('0x8'));module[_0xe5c0('0x9')]=function(_0x37dd3f,_0x4a2c41){return _0x37dd3f[_0xe5c0('0xa')](_0xe5c0('0xb'),attributes,{'tableName':_0xe5c0('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd840=['analytics_custom_reports','../../config/logger','api','request-promise','path','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x17f7e0,_0x37d9e1){var _0x98c5f4=function(_0x51e278){while(--_0x51e278){_0x17f7e0['push'](_0x17f7e0['shift']());}};_0x98c5f4(++_0x37d9e1);}(_0xd840,0x1d5));var _0x0d84=function(_0x234e94,_0x947518){_0x234e94=_0x234e94-0x0;var _0x15f65b=_0xd840[_0x234e94];return _0x15f65b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d84('0x0'))(_0x0d84('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0d84('0x2'));var fs=require('fs');var path=require(_0x0d84('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0d84('0x4'));module[_0x0d84('0x5')]=function(_0x2bd512,_0x2c6861){return _0x2bd512[_0x0d84('0x6')](_0x0d84('0x7'),attributes,{'tableName':_0x0d84('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 9ad7ed6..4fe3afe 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js +++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x459d=['rpc','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x28e343,_0x4e1dd2){var _0x4a0514=function(_0x328580){while(--_0x328580){_0x28e343['push'](_0x28e343['shift']());}};_0x4a0514(++_0x4e1dd2);}(_0x459d,0xeb));var _0xd459=function(_0x586d3d,_0x2e86e8){_0x586d3d=_0x586d3d-0x0;var _0x3319e3=_0x459d[_0x586d3d];return _0x3319e3;};'use strict';var _=require(_0xd459('0x0'));var util=require('util');var moment=require(_0xd459('0x1'));var BPromise=require(_0xd459('0x2'));var rs=require(_0xd459('0x3'));var fs=require('fs');var Redis=require(_0xd459('0x4'));var db=require(_0xd459('0x5'))['db'];var utils=require(_0xd459('0x6'));var logger=require('../../config/logger')(_0xd459('0x7'));var config=require('../../config/environment');var jayson=require(_0xd459('0x8'));var client=jayson[_0xd459('0x9')][_0xd459('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3578e5,_0x46f055,_0x3426ae){return new BPromise(function(_0x5204b7,_0x5d649f){return client[_0xd459('0xb')](_0x3578e5,_0x3426ae)['then'](function(_0x3c3732){logger[_0xd459('0xc')](_0xd459('0xd'),_0x46f055,_0xd459('0xe'));logger['debug'](_0xd459('0xf'),_0x46f055,_0xd459('0xe'),JSON[_0xd459('0x10')](_0x3c3732));if(_0x3c3732[_0xd459('0x11')]){if(_0x3c3732['error'][_0xd459('0x12')]===0x1f4){logger[_0xd459('0x11')](_0xd459('0xd'),_0x46f055,_0x3c3732['error']['message']);return _0x5d649f(_0x3c3732['error'][_0xd459('0x13')]);}logger[_0xd459('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x46f055,_0x3c3732[_0xd459('0x11')][_0xd459('0x13')]);return _0x5204b7(_0x3c3732[_0xd459('0x11')][_0xd459('0x13')]);}else{logger[_0xd459('0xc')](_0xd459('0xd'),_0x46f055,_0xd459('0xe'));_0x5204b7(_0x3c3732[_0xd459('0x14')]['message']);}})[_0xd459('0x15')](function(_0x2bfc00){logger[_0xd459('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x46f055,_0x2bfc00);_0x5d649f(_0x2bfc00);});});} \ No newline at end of file +var _0x2b11=['error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','stringify'];(function(_0x169585,_0x476cc6){var _0x5cf666=function(_0x4f7106){while(--_0x4f7106){_0x169585['push'](_0x169585['shift']());}};_0x5cf666(++_0x476cc6);}(_0x2b11,0x140));var _0x12b1=function(_0x4d230c,_0x3862fd){_0x4d230c=_0x4d230c-0x0;var _0x16b044=_0x2b11[_0x4d230c];return _0x16b044;};'use strict';var _=require(_0x12b1('0x0'));var util=require('util');var moment=require(_0x12b1('0x1'));var BPromise=require(_0x12b1('0x2'));var rs=require(_0x12b1('0x3'));var fs=require('fs');var Redis=require(_0x12b1('0x4'));var db=require(_0x12b1('0x5'))['db'];var utils=require(_0x12b1('0x6'));var logger=require(_0x12b1('0x7'))(_0x12b1('0x8'));var config=require(_0x12b1('0x9'));var jayson=require(_0x12b1('0xa'));var client=jayson['client'][_0x12b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cc428,_0x3cc2af,_0x267a13){return new BPromise(function(_0x6c1f8f,_0x40a336){return client[_0x12b1('0xc')](_0x4cc428,_0x267a13)[_0x12b1('0xd')](function(_0x49d673){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x3cc2af,'request\x20sent');logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3cc2af,_0x12b1('0xe'),JSON[_0x12b1('0xf')](_0x49d673));if(_0x49d673[_0x12b1('0x10')]){if(_0x49d673['error'][_0x12b1('0x11')]===0x1f4){logger[_0x12b1('0x10')](_0x12b1('0x12'),_0x3cc2af,_0x49d673[_0x12b1('0x10')][_0x12b1('0x13')]);return _0x40a336(_0x49d673[_0x12b1('0x10')][_0x12b1('0x13')]);}logger[_0x12b1('0x10')](_0x12b1('0x12'),_0x3cc2af,_0x49d673[_0x12b1('0x10')][_0x12b1('0x13')]);return _0x6c1f8f(_0x49d673[_0x12b1('0x10')][_0x12b1('0x13')]);}else{logger[_0x12b1('0x14')](_0x12b1('0x12'),_0x3cc2af,_0x12b1('0xe'));_0x6c1f8f(_0x49d673['result']['message']);}})['catch'](function(_0x4b90f2){logger[_0x12b1('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3cc2af,_0x4b90f2);_0x40a336(_0x4b90f2);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 024678b..b23538c 100644 --- a/server/api/analyticCustomReport/index.js +++ b/server/api/analyticCustomReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5f7=['preview','/:id/run','run','/:id/query','query','put','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xb5f7,0x1ec));var _0x7b5f=function(_0xc8d022,_0x164735){_0xc8d022=_0xc8d022-0x0;var _0x12a591=_0xb5f7[_0xc8d022];return _0x12a591;};'use strict';var multer=require('multer');var util=require(_0x7b5f('0x0'));var path=require(_0x7b5f('0x1'));var timeout=require(_0x7b5f('0x2'));var express=require(_0x7b5f('0x3'));var router=express[_0x7b5f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7b5f('0x5'));var interaction=require(_0x7b5f('0x6'));var config=require(_0x7b5f('0x7'));var controller=require(_0x7b5f('0x8'));router[_0x7b5f('0x9')]('/',auth[_0x7b5f('0xa')](),controller[_0x7b5f('0xb')]);router[_0x7b5f('0x9')](_0x7b5f('0xc'),auth[_0x7b5f('0xa')](),controller[_0x7b5f('0xd')]);router['get']('/:id/preview',auth[_0x7b5f('0xa')](),controller[_0x7b5f('0xe')]);router['get'](_0x7b5f('0xf'),auth[_0x7b5f('0xa')](),controller[_0x7b5f('0x10')]);router[_0x7b5f('0x9')](_0x7b5f('0x11'),auth[_0x7b5f('0xa')](),controller[_0x7b5f('0x12')]);router['post']('/',auth[_0x7b5f('0xa')](),controller['create']);router[_0x7b5f('0x13')](_0x7b5f('0xc'),auth[_0x7b5f('0xa')](),controller['update']);router[_0x7b5f('0x14')](_0x7b5f('0xc'),auth[_0x7b5f('0xa')](),controller[_0x7b5f('0x15')]);module['exports']=router; \ No newline at end of file +var _0x3e33=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/query','post','create','put','/:id','update','delete','destroy'];(function(_0xbcd3f3,_0x404ec1){var _0xdf86f3=function(_0x442550){while(--_0x442550){_0xbcd3f3['push'](_0xbcd3f3['shift']());}};_0xdf86f3(++_0x404ec1);}(_0x3e33,0xfa));var _0x33e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e33[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x33e3('0x0'));var util=require(_0x33e3('0x1'));var path=require(_0x33e3('0x2'));var timeout=require(_0x33e3('0x3'));var express=require(_0x33e3('0x4'));var router=express[_0x33e3('0x5')]();var fs_extra=require(_0x33e3('0x6'));var auth=require(_0x33e3('0x7'));var interaction=require(_0x33e3('0x8'));var config=require(_0x33e3('0x9'));var controller=require(_0x33e3('0xa'));router[_0x33e3('0xb')]('/',auth[_0x33e3('0xc')](),controller[_0x33e3('0xd')]);router[_0x33e3('0xb')]('/:id',auth[_0x33e3('0xc')](),controller[_0x33e3('0xe')]);router[_0x33e3('0xb')](_0x33e3('0xf'),auth['isAuthenticated'](),controller[_0x33e3('0x10')]);router[_0x33e3('0xb')]('/:id/run',auth[_0x33e3('0xc')](),controller['run']);router['get'](_0x33e3('0x11'),auth[_0x33e3('0xc')](),controller['query']);router[_0x33e3('0x12')]('/',auth[_0x33e3('0xc')](),controller[_0x33e3('0x13')]);router[_0x33e3('0x14')](_0x33e3('0x15'),auth[_0x33e3('0xc')](),controller[_0x33e3('0x16')]);router[_0x33e3('0x17')](_0x33e3('0x15'),auth[_0x33e3('0xc')](),controller[_0x33e3('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 373d2ce..168a075 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0x5075,0x73));var _0x5507=function(_0x2c4aef,_0x116fe2){_0x2c4aef=_0x2c4aef-0x0;var _0x3deaed=_0x5075[_0x2c4aef];return _0x3deaed;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x39f52d,_0x487474){var _0x4feded=function(_0x2de468){while(--_0x2de468){_0x39f52d['push'](_0x39f52d['shift']());}};_0x4feded(++_0x487474);}(_0xeff8,0x186));var _0x8eff=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0xeff8[_0x49c057];return _0xd8f0e6;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index a68363d..25f8de8 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2542=['getFields','ValidationErrorItem','metric','format','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','sequelize','SELECT','run','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','save','destroy','then','get','end','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','replace','function','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value'];(function(_0x247717,_0x3dcefc){var _0x378edf=function(_0x4f88ff){while(--_0x4f88ff){_0x247717['push'](_0x247717['shift']());}};_0x378edf(++_0x3dcefc);}(_0x2542,0x169));var _0x2254=function(_0x316a25,_0xbf91c0){_0x316a25=_0x316a25-0x0;var _0x433c0d=_0x2542[_0x316a25];return _0x433c0d;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];var dbH=require(_0x2254('0x19'))[_0x2254('0x1a')];function respondWithStatusCode(_0x3c326b,_0x381efe){_0x381efe=_0x381efe||0xcc;return function(_0x592a4f){if(_0x592a4f){return _0x3c326b[_0x2254('0x1b')](_0x381efe);}return _0x3c326b[_0x2254('0x1c')](_0x381efe)['end']();};}function respondWithResult(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xc8;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1c')](_0x1e582d)[_0x2254('0x1d')](_0xfb23cb);}};}function respondWithFilteredResult(_0xbc5548,_0x50f137){return function(_0x18baf4){if(_0x18baf4){var _0x57247a=typeof _0x50f137[_0x2254('0x1e')]===_0x2254('0x1f')&&typeof _0x50f137[_0x2254('0x20')]===_0x2254('0x1f');var _0x1ae11e=_0x18baf4[_0x2254('0x21')];var _0x497724=_0x57247a?0x0:_0x50f137['offset'];var _0x5ec98d=_0x57247a?_0x18baf4[_0x2254('0x21')]:_0x50f137[_0x2254('0x1e')]+_0x50f137[_0x2254('0x20')];var _0x1f1163;if(_0x5ec98d>=_0x1ae11e){_0x5ec98d=_0x1ae11e;_0x1f1163=0xc8;}else{_0x1f1163=0xce;}_0xbc5548[_0x2254('0x1c')](_0x1f1163);return _0xbc5548[_0x2254('0x22')]('Content-Range',_0x497724+'-'+_0x5ec98d+'/'+_0x1ae11e)[_0x2254('0x1d')](_0x18baf4);}return null;};}function patchUpdates(_0x16148d){return function(_0x906cde){try{jsonpatch['apply'](_0x906cde,_0x16148d,!![]);}catch(_0x52fedc){return BPromise['reject'](_0x52fedc);}return _0x906cde[_0x2254('0x23')]();};}function saveUpdates(_0x559af4,_0xf88b56){return function(_0x56b91e){if(_0x56b91e){return _0x56b91e['update'](_0x559af4)['then'](function(_0x540020){return _0x540020;});}return null;};}function removeEntity(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x24')]()[_0x2254('0x25')](function(){var _0x265467=_0x1aa71f[_0x2254('0x26')]({'plain':!![]});var _0x1349c9='DefaultReports';return db['UserProfileResource'][_0x2254('0x24')]({'where':{'type':_0x1349c9,'resourceId':_0x265467['id']}})['then'](function(){return _0x1aa71f;});})[_0x2254('0x25')](function(){_0x5e5edb[_0x2254('0x1c')](0xcc)[_0x2254('0x27')]();});}};}function handleEntityNotFound(_0x3aa0bd,_0x19043b){return function(_0x482688){if(!_0x482688){_0x3aa0bd[_0x2254('0x1b')](0x194);}return _0x482688;};}function handleError(_0x2a789b,_0x21285d){_0x21285d=_0x21285d||0x1f4;return function(_0x37af8b){logger[_0x2254('0x28')](_0x37af8b[_0x2254('0x29')]);if(_0x37af8b[_0x2254('0x2a')]){delete _0x37af8b[_0x2254('0x2a')];}_0x2a789b[_0x2254('0x1c')](_0x21285d)[_0x2254('0x2b')](_0x37af8b);};}exports[_0x2254('0x2c')]=function(_0xad7774,_0x220f2a){var _0x27d30a={},_0x4577f4={},_0x1b16c8={'count':0x0,'rows':[]};var _0x2c929f=_[_0x2254('0x2d')](db[_0x2254('0x2e')]['rawAttributes'],function(_0xe29526){return{'name':_0xe29526[_0x2254('0x2f')],'type':_0xe29526[_0x2254('0x30')][_0x2254('0x31')]};});_0x4577f4[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x2c929f,_0x2254('0x2a'));_0x4577f4[_0x2254('0x33')]=_[_0x2254('0x34')](_0xad7774['query']);_0x4577f4[_0x2254('0x35')]=_[_0x2254('0x36')](_0x4577f4['model'],_0x4577f4[_0x2254('0x33')]);_0x27d30a[_0x2254('0x37')]=_[_0x2254('0x36')](_0x4577f4[_0x2254('0x32')],qs['fields'](_0xad7774['query'][_0x2254('0x38')]));_0x27d30a['attributes']=_0x27d30a[_0x2254('0x37')][_0x2254('0x39')]?_0x27d30a[_0x2254('0x37')]:_0x4577f4[_0x2254('0x32')];if(!_0xad7774[_0x2254('0x33')][_0x2254('0x3a')](_0x2254('0x3b'))){_0x27d30a['limit']=qs[_0x2254('0x20')](_0xad7774[_0x2254('0x33')][_0x2254('0x20')]);_0x27d30a[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0xad7774[_0x2254('0x33')][_0x2254('0x1e')]);}_0x27d30a[_0x2254('0x3c')]=qs[_0x2254('0x3d')](_0xad7774[_0x2254('0x33')]['sort']);_0x27d30a[_0x2254('0x3e')]=qs[_0x2254('0x35')](_[_0x2254('0x3f')](_0xad7774[_0x2254('0x33')],_0x4577f4['filters']),_0x2c929f);if(_0xad7774[_0x2254('0x33')][_0x2254('0x40')]){_0x27d30a[_0x2254('0x3e')]=_[_0x2254('0x41')](_0x27d30a[_0x2254('0x3e')],{'$or':_[_0x2254('0x2d')](_0x2c929f,function(_0x423377){if(_0x423377[_0x2254('0x30')]!=='VIRTUAL'){var _0x362ad1={};_0x362ad1[_0x423377['name']]={'$like':'%'+_0xad7774[_0x2254('0x33')][_0x2254('0x40')]+'%'};return _0x362ad1;}})});}_0x27d30a=_[_0x2254('0x41')]({},_0x27d30a,_0xad7774[_0x2254('0x42')]);var _0x460bb3={'where':_0x27d30a[_0x2254('0x3e')]};return db[_0x2254('0x2e')]['count'](_0x460bb3)[_0x2254('0x25')](function(_0x2f1ff9){_0x1b16c8[_0x2254('0x21')]=_0x2f1ff9;if(_0xad7774[_0x2254('0x33')][_0x2254('0x43')]){_0x27d30a['include']=[{'all':!![]}];}return db[_0x2254('0x2e')][_0x2254('0x44')](_0x27d30a);})[_0x2254('0x25')](function(_0x135ed8){_0x1b16c8[_0x2254('0x45')]=_0x135ed8;return _0x1b16c8;})['then'](respondWithFilteredResult(_0x220f2a,_0x27d30a))[_0x2254('0x46')](handleError(_0x220f2a,null));};exports['show']=function(_0x91e091,_0x1ded9a){var _0xb4d042={'raw':!![],'where':{'id':_0x91e091[_0x2254('0x47')]['id']}},_0x31c31e={};_0x31c31e[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x48')]);_0x31c31e[_0x2254('0x33')]=_[_0x2254('0x34')](_0x91e091[_0x2254('0x33')]);_0x31c31e[_0x2254('0x35')]=_['intersection'](_0x31c31e[_0x2254('0x32')],_0x31c31e[_0x2254('0x33')]);_0xb4d042[_0x2254('0x37')]=_['intersection'](_0x31c31e[_0x2254('0x32')],qs[_0x2254('0x38')](_0x91e091[_0x2254('0x33')][_0x2254('0x38')]));_0xb4d042[_0x2254('0x37')]=_0xb4d042[_0x2254('0x37')][_0x2254('0x39')]?_0xb4d042[_0x2254('0x37')]:_0x31c31e[_0x2254('0x32')];if(_0x91e091['query'][_0x2254('0x43')]){_0xb4d042[_0x2254('0x49')]=[{'all':!![]}];}_0xb4d042=_[_0x2254('0x41')]({},_0xb4d042,_0x91e091[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0xb4d042)[_0x2254('0x25')](handleEntityNotFound(_0x1ded9a,null))[_0x2254('0x25')](respondWithResult(_0x1ded9a,null))[_0x2254('0x46')](handleError(_0x1ded9a,null));};exports[_0x2254('0x4b')]=function(_0x5b14c5,_0x36b977){return db[_0x2254('0x2e')]['create'](_0x5b14c5[_0x2254('0x4c')],{})[_0x2254('0x25')](function(_0x12e2ff){var _0x4331a9=_0x5b14c5['user'][_0x2254('0x26')]({'plain':!![]});if(!_0x4331a9)throw new Error(_0x2254('0x4d'));if(_0x4331a9['role']===_0x2254('0x4e')){var _0x3f0670=_0x12e2ff[_0x2254('0x26')]({'plain':!![]});var _0x43bb88='Reports';return db[_0x2254('0x4f')][_0x2254('0x4a')]({'where':{'name':_0x43bb88,'userProfileId':_0x4331a9[_0x2254('0x50')]},'raw':!![]})['then'](function(_0x4cc18a){if(_0x4cc18a&&_0x4cc18a[_0x2254('0x51')]===0x0){return db[_0x2254('0x52')]['create']({'name':_0x3f0670[_0x2254('0x2a')],'resourceId':_0x3f0670['id'],'type':'DefaultReports','sectionId':_0x4cc18a['id']},{})['then'](function(){return _0x12e2ff;});}else{return _0x12e2ff;}})[_0x2254('0x46')](function(_0x135962){logger[_0x2254('0x28')](_0x2254('0x53'),_0x135962);throw _0x135962;});}return _0x12e2ff;})[_0x2254('0x25')](respondWithResult(_0x36b977,0xc9))['catch'](handleError(_0x36b977,null));};exports['update']=function(_0x1bd988,_0x5e3fbc){if(_0x1bd988[_0x2254('0x4c')]['id']){delete _0x1bd988[_0x2254('0x4c')]['id'];}return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x1bd988['params']['id']}})[_0x2254('0x25')](handleEntityNotFound(_0x5e3fbc,null))[_0x2254('0x25')](saveUpdates(_0x1bd988['body'],null))['then'](respondWithResult(_0x5e3fbc,null))[_0x2254('0x46')](handleError(_0x5e3fbc,null));};exports['destroy']=function(_0x2cc59c,_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x2cc59c[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x305ace,null))['then'](removeEntity(_0x305ace,null))[_0x2254('0x46')](handleError(_0x305ace,null));};exports['preview']=function(_0x335c66,_0x510fe0){var _0x4da493=0xa;var _0x5999c8=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x13606e={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':_0x2254('0x5b'),'MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f391d={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x329378=function(_0xae171c){return!_[_0x2254('0x65')]([_0x2254('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2254('0x67')],_0xae171c);};var _0x423c17=function(_0x1d73a3){if(!_0x1d73a3||!_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x53b55b='(',_0x45b7bd=0x0;_0x45b7bd<_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')];_0x45b7bd+=0x1){_0x45b7bd>0x0&&(_0x53b55b+='\x20'+_0x1d73a3['operator']+'\x20');_0x53b55b+=_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]?_0x423c17(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]):_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['field']+'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd][_0x2254('0x6a')]+(_0x329378(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x6a')])?'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['value']:'');}return _0x53b55b+')';};var _0x5cc6bd={'where':{'id':_0x335c66['params']['id']}},_0xde4e7,_0xa159a4,_0x486b82,_0x506d95,_0x48406e;_0x5cc6bd=_[_0x2254('0x41')]({},_0x5cc6bd,_0x335c66['options']);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x5cc6bd)[_0x2254('0x25')](function(_0x1ed6b9){if(_0x1ed6b9){_0xde4e7=_0x1ed6b9;return _0x1ed6b9['getFields']();}return null;})[_0x2254('0x25')](function(_0x5ecf82){if(_0x5ecf82){if(!_0x5ecf82[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xa159a4=_0x5ecf82;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x3b3b20){if(_0x3b3b20){_0x486b82=_[_0x2254('0x6e')](_0x3b3b20,'id');var _0x3cefbe;var _0x4f77e5=squel[_0x2254('0x6f')]();_0x4f77e5[_0x2254('0x70')](_0xde4e7['table']);for(var _0x1ac8ff=0x0;_0x1ac8ff<_0xa159a4[_0x2254('0x39')];_0x1ac8ff+=0x1){_0x3cefbe=_0xa159a4[_0x1ac8ff]['MetricId']?_0x486b82[_0xa159a4[_0x1ac8ff][_0x2254('0x71')]]['metric']:_0xa159a4[_0x1ac8ff][_0x2254('0x72')];_0x3cefbe=_0xa159a4[_0x1ac8ff]['function']?_[_0x2254('0x73')](_0x13606e[_0xa159a4[_0x1ac8ff][_0x2254('0x74')]],'%s',_0x3cefbe):_0x3cefbe;_0x3cefbe=_0xa159a4[_0x1ac8ff]['format']?_[_0x2254('0x73')](_0x2f391d[_0xa159a4[_0x1ac8ff]['format']],'%s',_0x3cefbe):_0x3cefbe;if(_0xa159a4[_0x1ac8ff][_0x2254('0x75')]){_0x4f77e5[_0x2254('0x69')](_0x3cefbe);}_0xa159a4[_0x1ac8ff][_0x2254('0x76')]&&_0x4f77e5['order'](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x76')]==='DESC'?![]:!![]);_0x4f77e5[_0x2254('0x72')](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x77')]||_0x3cefbe);}if(_0xde4e7['joins']){_0xde4e7['joins']=JSON[_0x2254('0x78')](_0xde4e7[_0x2254('0x79')]);for(var _0x451520=0x0;_0x451520<_0xde4e7[_0x2254('0x79')]['length'];_0x451520+=0x1){if(_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x5999c8,_0xde4e7[_0x2254('0x79')][_0x451520]['type'])&&_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7a')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7b')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7c')]){_0x4f77e5[_0xde4e7['joins'][_0x451520]['type']](_0xde4e7['joins'][_0x451520][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0xde4e7[_0x2254('0x7e')],_0xde4e7['joins'][_0x451520][_0x2254('0x7a')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7b')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7c')]));}}}if(_0xde4e7[_0x2254('0x7f')]){_0xde4e7['conditions']=JSON['parse'](_0xde4e7[_0x2254('0x7f')]);_0x4f77e5[_0x2254('0x3e')](_0x423c17(_0xde4e7[_0x2254('0x7f')][_0x2254('0x69')]));}_0x48406e=_0x4f77e5[_0x2254('0x80')]();_0x4f77e5[_0x2254('0x20')](_0x4da493);_0x4f77e5[_0x2254('0x1e')](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4f77e5[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4f77e5[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')]['SELECT']});}})[_0x2254('0x25')](respondWithResult(_0x510fe0,null))[_0x2254('0x46')](handleError(_0x510fe0,null));};function runReport(_0x4dfcb4,_0x1c317b,_0x4e699c){var _0x2ad519=_0x1c317b[_0x2254('0x2a')];var _0x30f2c9=0xa;var _0x1f7a48=['join',_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x3a8d4f={'SUM':'SUM(%s)','COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f3650={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x251d70=function(_0x2c7705){return!_['includes']([_0x2254('0x66'),'IS\x20NOT\x20NULL',_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x2c7705);};var _0x36d121=function(_0x207a09){if(!_0x207a09||!_0x207a09[_0x2254('0x68')]['length']){return'';}for(var _0x8a3656='(',_0x1554f1=0x0;_0x1554f1<_0x207a09[_0x2254('0x68')][_0x2254('0x39')];_0x1554f1+=0x1){_0x1554f1>0x0&&(_0x8a3656+='\x20'+_0x207a09[_0x2254('0x87')]+'\x20');_0x8a3656+=_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]?_0x36d121(_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]):_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x72')]+'\x20'+_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x6a')]+(_0x251d70(_0x207a09['rules'][_0x1554f1][_0x2254('0x6a')])?'\x20'+_0x207a09['rules'][_0x1554f1][_0x2254('0x88')]:'');}return _0x8a3656+')';};var _0xb98b40={'where':{'id':_0x4dfcb4['id']}},_0x3b1d5c,_0x2c907a,_0x23b78c,_0x2b5dba,_0x30307a;_0xb98b40=_['merge']({},_0xb98b40,_0x4e699c);return db[_0x2254('0x2e')]['find'](_0xb98b40)[_0x2254('0x25')](function(_0x52712d){if(_0x52712d){_0x3b1d5c=_0x52712d;return _0x52712d[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x1d0c8f){if(_0x1d0c8f){if(!_0x1d0c8f['length']){throw new db[(_0x2254('0x6b'))][(_0x2254('0x8a'))](_0x2254('0x6c'),0x193);}_0x2c907a=_0x1d0c8f;return db[_0x2254('0x6d')][_0x2254('0x44')]({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x34185c){if(_0x34185c){_0x23b78c=_[_0x2254('0x6e')](_0x34185c,'id');var _0x5e94b6;var _0x56239e=squel[_0x2254('0x6f')]();_0x56239e['from'](_0x3b1d5c[_0x2254('0x7e')]);for(var _0x3a1365=0x0;_0x3a1365<_0x2c907a[_0x2254('0x39')];_0x3a1365+=0x1){_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x71')]?_0x23b78c[_0x2c907a[_0x3a1365][_0x2254('0x71')]][_0x2254('0x8b')]:_0x2c907a[_0x3a1365][_0x2254('0x72')];_0x5e94b6=_0x2c907a[_0x3a1365]['function']?_[_0x2254('0x73')](_0x3a8d4f[_0x2c907a[_0x3a1365][_0x2254('0x74')]],'%s',_0x5e94b6):_0x5e94b6;_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x8c')]?_['replace'](_0x2f3650[_0x2c907a[_0x3a1365][_0x2254('0x8c')]],'%s',_0x5e94b6):_0x5e94b6;if(_0x2c907a[_0x3a1365][_0x2254('0x75')]){_0x56239e[_0x2254('0x69')](_0x5e94b6);}_0x2c907a[_0x3a1365][_0x2254('0x76')]&&_0x56239e[_0x2254('0x3c')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x56239e[_0x2254('0x72')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x77')]||_0x5e94b6);}if(_0x3b1d5c['joins']){_0x3b1d5c[_0x2254('0x79')]=JSON[_0x2254('0x78')](_0x3b1d5c['joins']);for(var _0x4cec5b=0x0;_0x4cec5b<_0x3b1d5c[_0x2254('0x79')]['length'];_0x4cec5b+=0x1){if(_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x1f7a48,_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')])&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7a')]&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b]['foreignTable']&&_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7c')]){_0x56239e[_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]](_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1d5c[_0x2254('0x7e')],_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7a')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7c')]));}}}if(_0x3b1d5c[_0x2254('0x7f')]){_0x3b1d5c[_0x2254('0x7f')]=JSON['parse'](_0x3b1d5c[_0x2254('0x7f')]);_0x56239e[_0x2254('0x3e')](_0x36d121(_0x3b1d5c['conditions'][_0x2254('0x69')]));}_0x30307a=_0x56239e[_0x2254('0x80')]();_0x56239e[_0x2254('0x20')](_0x30f2c9);_0x56239e[_0x2254('0x1e')](0x0);return;}})[_0x2254('0x25')](function(){if(_0x1c317b[_0x2254('0x8e')]===_0x2254('0x8f')){return null;}var _0x38e2df=_[_0x2254('0x41')](_0x1c317b,{'name':_0x1c317b[_0x2254('0x90')]||_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c['name'],'basename':_0x2ad519,'savename':util[_0x2254('0x8c')](_0x2254('0x91'),_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c[_0x2254('0x2a')],require(_0x2254('0x92'))[_0x2254('0x93')](0x4),_0x1c317b[_0x2254('0x8e')]||'csv'),'reportId':_0x3b1d5c['id'],'reportType':_0x2254('0x94')});return db[_0x2254('0x95')][_0x2254('0x4b')](_0x38e2df,{'raw':!![]});})['then'](function(_0x60f5ac){if(_0x3b1d5c[_0x2254('0x7e')]===_0x2254('0x96')){_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x97'),_0x1c317b['startDate'],_0x1c317b[_0x2254('0x98')]);}else{_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x99'),_0x1c317b[_0x2254('0x9a')],_0x1c317b['endDate']);}if(_0x60f5ac){logger['info'](_0x2254('0x9b'),_0x30307a['toString']());require(_0x2254('0x9c'))[_0x2254('0x9d')](path[_0x2254('0x54')](__dirname,_0x2254('0x9e'),_0x60f5ac[_0x2254('0x8e')]),[_0x60f5ac['id'],_0x30307a[_0x2254('0x83')](),path['join'](__dirname,'../../files/reports',_0x60f5ac[_0x2254('0x9f')]),_0x2ad519]);return _0x60f5ac;}else{var _0x3317d4=squel[_0x2254('0x6f')]();_0x3317d4[_0x2254('0x70')]('('+_0x30307a['toString']()+')',_0x2254('0xa0'));_0x3317d4[_0x2254('0x72')](_0x2254('0xa1'),_0x2254('0x21'));_0x30307a[_0x2254('0x20')](_0x1c317b[_0x2254('0x20')]||_0x30f2c9);_0x30307a[_0x2254('0x1e')](_0x1c317b[_0x2254('0x1e')]||0x0);return dbH[_0x2254('0xa2')]['query'](_0x3317d4[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')]['SELECT']})[_0x2254('0x25')](function(_0xe38a28){if(!_0xe38a28[_0x2254('0x39')]){_0x2b5dba=0x0;}else{_0x2b5dba=_0xe38a28[0x0]['count']||0x0;}return dbH['sequelize'][_0x2254('0x33')](_0x30307a[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')][_0x2254('0xa3')]});})[_0x2254('0x25')](function(_0x4011de){return{'rows':_0x4011de||[],'count':_0x2b5dba};});}});}exports[_0x2254('0xa4')]=function(_0x5cb3d1,_0x1d8238){return runReport(_0x5cb3d1[_0x2254('0x47')],_0x5cb3d1[_0x2254('0x33')],_0x5cb3d1[_0x2254('0x42')])[_0x2254('0x25')](respondWithResult(_0x1d8238,null))[_0x2254('0x46')](handleError(_0x1d8238,null));};exports['runReport']=runReport;exports['query']=function(_0x40339d,_0x4b3b96){var _0x59b8af=0xa;var _0x408695=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),'cross_join'];var _0x596eae={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x739a29={'SEC_TO_TIME':_0x2254('0x61'),'DATE':'DATE(%s)','HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x243466=function(_0x1b8587){return!_[_0x2254('0x65')]([_0x2254('0x66'),_0x2254('0xa5'),_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x1b8587);};var _0xbec5d0=function(_0x18f841){if(!_0x18f841||!_0x18f841[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x275b56='(',_0x315add=0x0;_0x315add<_0x18f841['rules']['length'];_0x315add+=0x1){_0x315add>0x0&&(_0x275b56+='\x20'+_0x18f841[_0x2254('0x87')]+'\x20');_0x275b56+=_0x18f841['rules'][_0x315add][_0x2254('0x69')]?_0xbec5d0(_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x69')]):_0x18f841[_0x2254('0x68')][_0x315add]['field']+'\x20'+_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x6a')]+(_0x243466(_0x18f841[_0x2254('0x68')][_0x315add]['condition'])?'\x20'+_0x18f841['rules'][_0x315add][_0x2254('0x88')]:'');}return _0x275b56+')';};var _0x51b02a={'where':{'id':_0x40339d[_0x2254('0x47')]['id']}},_0x3e7642,_0xe1abb6,_0x1a44d0,_0x4af6a7,_0x539aba;_0x51b02a=_[_0x2254('0x41')]({},_0x51b02a,_0x40339d[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x51b02a)['then'](function(_0x34e28b){if(_0x34e28b){_0x3e7642=_0x34e28b;return _0x34e28b[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x5d373){if(_0x5d373){if(!_0x5d373[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xe1abb6=_0x5d373;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x56a7ce){if(_0x56a7ce){_0x1a44d0=_[_0x2254('0x6e')](_0x56a7ce,'id');var _0x34bf19;var _0x4965c7=squel[_0x2254('0x6f')]();_0x4965c7[_0x2254('0x70')](_0x3e7642[_0x2254('0x7e')]);for(var _0x45541b=0x0;_0x45541b<_0xe1abb6[_0x2254('0x39')];_0x45541b+=0x1){_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x71')]?_0x1a44d0[_0xe1abb6[_0x45541b][_0x2254('0x71')]][_0x2254('0x8b')]:_0xe1abb6[_0x45541b][_0x2254('0x72')];_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x74')]?_[_0x2254('0x73')](_0x596eae[_0xe1abb6[_0x45541b][_0x2254('0x74')]],'%s',_0x34bf19):_0x34bf19;_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x8c')]?_[_0x2254('0x73')](_0x739a29[_0xe1abb6[_0x45541b]['format']],'%s',_0x34bf19):_0x34bf19;if(_0xe1abb6[_0x45541b][_0x2254('0x75')]){_0x4965c7[_0x2254('0x69')](_0x34bf19);}_0xe1abb6[_0x45541b]['orderBy']&&_0x4965c7['order'](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x4965c7[_0x2254('0x72')](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x77')]||_0x34bf19);}if(_0x3e7642['joins']){_0x3e7642[_0x2254('0x79')]=JSON['parse'](_0x3e7642['joins']);for(var _0x40fec0=0x0;_0x40fec0<_0x3e7642[_0x2254('0x79')][_0x2254('0x39')];_0x40fec0+=0x1){if(_0x3e7642[_0x2254('0x79')][_0x40fec0]['type']&&_[_0x2254('0x65')](_0x408695,_0x3e7642['joins'][_0x40fec0][_0x2254('0x30')])&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]){_0x4965c7[_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x30')]](_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0x3e7642[_0x2254('0x7e')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]));}}}if(_0x3e7642['conditions']){_0x3e7642[_0x2254('0x7f')]=JSON[_0x2254('0x78')](_0x3e7642[_0x2254('0x7f')]);_0x4965c7[_0x2254('0x3e')](_0xbec5d0(_0x3e7642[_0x2254('0x7f')]['group']));}_0x539aba=_0x4965c7[_0x2254('0x80')]();_0x4965c7[_0x2254('0x20')](_0x59b8af);_0x4965c7['offset'](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4965c7[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4965c7[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')][_0x2254('0xa3')]});}})[_0x2254('0x25')](function(){return{'sql':_0x539aba[_0x2254('0x83')]()};})['then'](respondWithResult(_0x4b3b96,null))[_0x2254('0x46')](handleError(_0x4b3b96,null));}; \ No newline at end of file +var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x1b73b1,_0x4aebdc){var _0x337e75=function(_0x5038f8){while(--_0x5038f8){_0x1b73b1['push'](_0x1b73b1['shift']());}};_0x337e75(++_0x4aebdc);}(_0x814b,0x1a2));var _0xb814=function(_0x55754e,_0x286388){_0x55754e=_0x55754e-0x0;var _0x2e9948=_0x814b[_0x55754e];return _0x2e9948;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 13f5221..eb8981c 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c98=['define','AnalyticDefaultReport','analytics_default_reports','api','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x9c98,0xd4));var _0x89c9=function(_0x24393b,_0x109121){_0x24393b=_0x24393b-0x0;var _0x394407=_0x9c98[_0x24393b];return _0x394407;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x89c9('0x0'));var moment=require(_0x89c9('0x1'));var BPromise=require(_0x89c9('0x2'));var rp=require(_0x89c9('0x3'));var fs=require('fs');var path=require(_0x89c9('0x4'));var rimraf=require('rimraf');var config=require(_0x89c9('0x5'));var attributes=require(_0x89c9('0x6'));module[_0x89c9('0x7')]=function(_0x46e1fe,_0x393b95){return _0x46e1fe[_0x89c9('0x8')](_0x89c9('0x9'),attributes,{'tableName':_0x89c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a0d=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x2e349f,_0x313c79){var _0x4a41dd=function(_0x545a71){while(--_0x545a71){_0x2e349f['push'](_0x2e349f['shift']());}};_0x4a41dd(++_0x313c79);}(_0x9a0d,0x1ee));var _0xd9a0=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x9a0d[_0x561f25];return _0x150e4c;};'use strict';var _=require(_0xd9a0('0x0'));var util=require('util');var logger=require(_0xd9a0('0x1'))(_0xd9a0('0x2'));var moment=require(_0xd9a0('0x3'));var BPromise=require(_0xd9a0('0x4'));var rp=require(_0xd9a0('0x5'));var fs=require('fs');var path=require(_0xd9a0('0x6'));var rimraf=require(_0xd9a0('0x7'));var config=require('../../config/environment');var attributes=require(_0xd9a0('0x8'));module[_0xd9a0('0x9')]=function(_0x5d2a9a,_0x1edea1){return _0x5d2a9a[_0xd9a0('0xa')](_0xd9a0('0xb'),attributes,{'tableName':_0xd9a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 3dbb960..8c853f6 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fb1=['request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x4fb1,0x1bb));var _0x14fb=function(_0x1f2525,_0x413e78){_0x1f2525=_0x1f2525-0x0;var _0x385f34=_0x4fb1[_0x1f2525];return _0x385f34;};'use strict';var _=require('lodash');var util=require(_0x14fb('0x0'));var moment=require(_0x14fb('0x1'));var BPromise=require(_0x14fb('0x2'));var rs=require(_0x14fb('0x3'));var fs=require('fs');var Redis=require(_0x14fb('0x4'));var db=require(_0x14fb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x14fb('0x6'))(_0x14fb('0x7'));var config=require(_0x14fb('0x8'));var jayson=require(_0x14fb('0x9'));var client=jayson['client'][_0x14fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a35f7,_0x2d58fa,_0x4420ab){return new BPromise(function(_0x46d617,_0x5dff94){return client['request'](_0x3a35f7,_0x4420ab)[_0x14fb('0xb')](function(_0x2e7d74){logger[_0x14fb('0xc')](_0x14fb('0xd'),_0x2d58fa,'request\x20sent');logger[_0x14fb('0xe')](_0x14fb('0xf'),_0x2d58fa,'request\x20sent',JSON[_0x14fb('0x10')](_0x2e7d74));if(_0x2e7d74['error']){if(_0x2e7d74[_0x14fb('0x11')]['code']===0x1f4){logger[_0x14fb('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d58fa,_0x2e7d74[_0x14fb('0x11')][_0x14fb('0x12')]);return _0x5dff94(_0x2e7d74[_0x14fb('0x11')][_0x14fb('0x12')]);}logger[_0x14fb('0x11')](_0x14fb('0xd'),_0x2d58fa,_0x2e7d74[_0x14fb('0x11')][_0x14fb('0x12')]);return _0x46d617(_0x2e7d74[_0x14fb('0x11')][_0x14fb('0x12')]);}else{logger[_0x14fb('0xc')](_0x14fb('0xd'),_0x2d58fa,_0x14fb('0x13'));_0x46d617(_0x2e7d74[_0x14fb('0x14')][_0x14fb('0x12')]);}})[_0x14fb('0x15')](function(_0x541c21){logger['error'](_0x14fb('0xd'),_0x2d58fa,_0x541c21);_0x5dff94(_0x541c21);});});} \ No newline at end of file +var _0x11e1=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticDefaultReport,\x20%s,\x20%s','debug'];(function(_0x356e8d,_0x24c719){var _0x39e65a=function(_0x27ecc2){while(--_0x27ecc2){_0x356e8d['push'](_0x356e8d['shift']());}};_0x39e65a(++_0x24c719);}(_0x11e1,0x126));var _0x111e=function(_0x143c16,_0x4ea500){_0x143c16=_0x143c16-0x0;var _0x14666b=_0x11e1[_0x143c16];return _0x14666b;};'use strict';var _=require(_0x111e('0x0'));var util=require(_0x111e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x111e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x111e('0x3'))['db'];var utils=require(_0x111e('0x4'));var logger=require(_0x111e('0x5'))(_0x111e('0x6'));var config=require(_0x111e('0x7'));var jayson=require(_0x111e('0x8'));var client=jayson[_0x111e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf2960b,_0x569803,_0x1d2bf6){return new BPromise(function(_0x31d6c0,_0x3ccb19){return client[_0x111e('0xa')](_0xf2960b,_0x1d2bf6)[_0x111e('0xb')](function(_0x11a28e){logger['info'](_0x111e('0xc'),_0x569803,'request\x20sent');logger[_0x111e('0xd')](_0x111e('0xe'),_0x569803,_0x111e('0xf'),JSON[_0x111e('0x10')](_0x11a28e));if(_0x11a28e[_0x111e('0x11')]){if(_0x11a28e[_0x111e('0x11')][_0x111e('0x12')]===0x1f4){logger[_0x111e('0x11')](_0x111e('0xc'),_0x569803,_0x11a28e['error'][_0x111e('0x13')]);return _0x3ccb19(_0x11a28e['error'][_0x111e('0x13')]);}logger[_0x111e('0x11')](_0x111e('0xc'),_0x569803,_0x11a28e[_0x111e('0x11')][_0x111e('0x13')]);return _0x31d6c0(_0x11a28e[_0x111e('0x11')][_0x111e('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x569803,_0x111e('0xf'));_0x31d6c0(_0x11a28e[_0x111e('0x14')]['message']);}})[_0x111e('0x15')](function(_0xd3989b){logger[_0x111e('0x11')](_0x111e('0xc'),_0x569803,_0xd3989b);_0x3ccb19(_0xd3989b);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 2abab0d..d9c32f0 100644 --- a/server/api/analyticDefaultReport/index.js +++ b/server/api/analyticDefaultReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd65e=['isAuthenticated','index','/:id','get','/:id/preview','/:id/run','/:id/query','query','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x56db78,_0x113e0f){var _0x770689=function(_0x38c2f8){while(--_0x38c2f8){_0x56db78['push'](_0x56db78['shift']());}};_0x770689(++_0x113e0f);}(_0xd65e,0x91));var _0xed65=function(_0x128813,_0x289376){_0x128813=_0x128813-0x0;var _0x5e06ac=_0xd65e[_0x128813];return _0x5e06ac;};'use strict';var multer=require(_0xed65('0x0'));var util=require(_0xed65('0x1'));var path=require(_0xed65('0x2'));var timeout=require(_0xed65('0x3'));var express=require(_0xed65('0x4'));var router=express[_0xed65('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xed65('0x6'));var config=require(_0xed65('0x7'));var controller=require(_0xed65('0x8'));router['get']('/',auth[_0xed65('0x9')](),controller[_0xed65('0xa')]);router['get'](_0xed65('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xed65('0xc')](_0xed65('0xd'),auth[_0xed65('0x9')](),controller['preview']);router[_0xed65('0xc')](_0xed65('0xe'),auth['isAuthenticated'](),controller['run']);router[_0xed65('0xc')](_0xed65('0xf'),auth['isAuthenticated'](),controller[_0xed65('0x10')]);router['post']('/',auth[_0xed65('0x9')](),controller[_0xed65('0x11')]);router['put'](_0xed65('0xb'),auth['isAuthenticated'](),controller[_0xed65('0x12')]);router[_0xed65('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xed65('0x14')]);module[_0xed65('0x15')]=router; \ No newline at end of file +var _0x3432=['/:id/preview','/:id/run','run','/:id/query','post','create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show'];(function(_0x185754,_0x54e1e3){var _0x29ee6f=function(_0x320165){while(--_0x320165){_0x185754['push'](_0x185754['shift']());}};_0x29ee6f(++_0x54e1e3);}(_0x3432,0x199));var _0x2343=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3432[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x2343('0x0'));var path=require('path');var timeout=require(_0x2343('0x1'));var express=require(_0x2343('0x2'));var router=express[_0x2343('0x3')]();var fs_extra=require(_0x2343('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2343('0x5'));var config=require('../../config/environment');var controller=require(_0x2343('0x6'));router['get']('/',auth[_0x2343('0x7')](),controller['index']);router[_0x2343('0x8')](_0x2343('0x9'),auth['isAuthenticated'](),controller[_0x2343('0xa')]);router[_0x2343('0x8')](_0x2343('0xb'),auth[_0x2343('0x7')](),controller['preview']);router[_0x2343('0x8')](_0x2343('0xc'),auth[_0x2343('0x7')](),controller[_0x2343('0xd')]);router[_0x2343('0x8')](_0x2343('0xe'),auth['isAuthenticated'](),controller['query']);router[_0x2343('0xf')]('/',auth[_0x2343('0x7')](),controller[_0x2343('0x10')]);router[_0x2343('0x11')](_0x2343('0x9'),auth[_0x2343('0x7')](),controller['update']);router[_0x2343('0x12')]('/:id',auth[_0x2343('0x7')](),controller[_0x2343('0x13')]);module[_0x2343('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index d1c5ed1..23a3bb4 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x655e=['xlsx','DATE','Loading','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x161ac3,_0x142e49){var _0x3bb837=function(_0x269c7c){while(--_0x269c7c){_0x161ac3['push'](_0x161ac3['shift']());}};_0x3bb837(++_0x142e49);}(_0x655e,0x199));var _0xe655=function(_0x1ddcc5,_0xfcc5f8){_0x1ddcc5=_0x1ddcc5-0x0;var _0x15a90e=_0x655e[_0x1ddcc5];return _0x15a90e;};'use strict';var Sequelize=require(_0xe655('0x0'));var moment=require(_0xe655('0x1'));module[_0xe655('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xe655('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xe655('0x4')](_0xe655('0x5'),_0xe655('0x6'),_0xe655('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xe655('0x8')]},'endDate':{'type':Sequelize[_0xe655('0x8')]},'status':{'type':Sequelize[_0xe655('0x3')],'defaultValue':_0xe655('0x9')},'type':{'type':Sequelize[_0xe655('0x4')](_0xe655('0xa'),_0xe655('0xb')),'allowNull':![],'defaultValue':_0xe655('0xa')},'reportId':{'type':Sequelize[_0xe655('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xe655('0x3')]}}; \ No newline at end of file +var _0xb767=['xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf'];(function(_0x38b79c,_0x1801c8){var _0x4e32ad=function(_0x56329c){while(--_0x56329c){_0x38b79c['push'](_0x38b79c['shift']());}};_0x4e32ad(++_0x1801c8);}(_0xb767,0x162));var _0x7b76=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb767[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x7b76('0x0'));var moment=require(_0x7b76('0x1'));module[_0x7b76('0x2')]={'name':{'type':Sequelize[_0x7b76('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x7b76('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x7b76('0x4')]('csv',_0x7b76('0x5'),_0x7b76('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x7b76('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x7b76('0x7')]},'endDate':{'type':Sequelize[_0x7b76('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x7b76('0x8')},'type':{'type':Sequelize[_0x7b76('0x4')](_0x7b76('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x7b76('0x9')},'reportId':{'type':Sequelize[_0x7b76('0xa')](0xb)[_0x7b76('0xb')]},'reportType':{'type':Sequelize[_0x7b76('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index fce16e7..d4c69db 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b8c=['existsSync','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','server/files/reports','format','%s.%s','toLowerCase','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output'];(function(_0x42f1d5,_0x1e907b){var _0x42eaca=function(_0x239d4c){while(--_0x239d4c){_0x42f1d5['push'](_0x42f1d5['shift']());}};_0x42eaca(++_0x1e907b);}(_0x0b8c,0x13d));var _0xc0b8=function(_0x447d2b,_0x1f79c0){_0x447d2b=_0x447d2b-0x0;var _0x48a1f0=_0x0b8c[_0x447d2b];return _0x48a1f0;};'use strict';var emlformat=require(_0xc0b8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc0b8('0x1'));var rp=require('request-promise');var moment=require(_0xc0b8('0x2'));var BPromise=require(_0xc0b8('0x3'));var Mustache=require(_0xc0b8('0x4'));var util=require(_0xc0b8('0x5'));var path=require(_0xc0b8('0x6'));var sox=require(_0xc0b8('0x7'));var csv=require(_0xc0b8('0x8'));var ejs=require(_0xc0b8('0x9'));var fs=require('fs');var fs_extra=require(_0xc0b8('0xa'));var _=require(_0xc0b8('0xb'));var squel=require(_0xc0b8('0xc'));var crypto=require(_0xc0b8('0xd'));var jsforce=require(_0xc0b8('0xe'));var deskjs=require(_0xc0b8('0xf'));var toCsv=require(_0xc0b8('0x8'));var querystring=require(_0xc0b8('0x10'));var Papa=require(_0xc0b8('0x11'));var Redis=require(_0xc0b8('0x12'));var authService=require(_0xc0b8('0x13'));var qs=require(_0xc0b8('0x14'));var as=require(_0xc0b8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc0b8('0x16'));var utils=require(_0xc0b8('0x17'));var config=require(_0xc0b8('0x18'));var licenseUtil=require(_0xc0b8('0x19'));var db=require(_0xc0b8('0x1a'))['db'];function respondWithStatusCode(_0x48c78c,_0xce14ca){_0xce14ca=_0xce14ca||0xcc;return function(_0x14895c){if(_0x14895c){return _0x48c78c[_0xc0b8('0x1b')](_0xce14ca);}return _0x48c78c[_0xc0b8('0x1c')](_0xce14ca)[_0xc0b8('0x1d')]();};}function respondWithResult(_0x2e8919,_0x2b4653){_0x2b4653=_0x2b4653||0xc8;return function(_0x3e73cc){if(_0x3e73cc){return _0x2e8919[_0xc0b8('0x1c')](_0x2b4653)[_0xc0b8('0x1e')](_0x3e73cc);}};}function respondWithFilteredResult(_0x393d4b,_0x1af256){return function(_0x1e06a6){if(_0x1e06a6){var _0x2a1a34=typeof _0x1af256['offset']===_0xc0b8('0x1f')&&typeof _0x1af256[_0xc0b8('0x20')]==='undefined';var _0x3b3f95=_0x1e06a6['count'];var _0x6860c0=_0x2a1a34?0x0:_0x1af256['offset'];var _0x1606e5=_0x2a1a34?_0x1e06a6[_0xc0b8('0x21')]:_0x1af256[_0xc0b8('0x22')]+_0x1af256[_0xc0b8('0x20')];var _0x560c05;if(_0x1606e5>=_0x3b3f95){_0x1606e5=_0x3b3f95;_0x560c05=0xc8;}else{_0x560c05=0xce;}_0x393d4b['status'](_0x560c05);return _0x393d4b[_0xc0b8('0x23')](_0xc0b8('0x24'),_0x6860c0+'-'+_0x1606e5+'/'+_0x3b3f95)['json'](_0x1e06a6);}return null;};}function patchUpdates(_0x3312f2){return function(_0x21c998){try{jsonpatch[_0xc0b8('0x25')](_0x21c998,_0x3312f2,!![]);}catch(_0x950fbe){return BPromise[_0xc0b8('0x26')](_0x950fbe);}return _0x21c998[_0xc0b8('0x27')]();};}function saveUpdates(_0x590996,_0x1e225f){return function(_0x103ea1){if(_0x103ea1){return _0x103ea1[_0xc0b8('0x28')](_0x590996)['then'](function(_0x301a24){return _0x301a24;});}return null;};}function removeEntity(_0x2747a7,_0x1505e5){return function(_0x1f5f1c){if(_0x1f5f1c){return _0x1f5f1c[_0xc0b8('0x29')]()[_0xc0b8('0x2a')](function(){var _0x597a98=_0x1f5f1c['get']({'plain':!![]});var _0x440fc1=_0xc0b8('0x2b');return db[_0xc0b8('0x2c')][_0xc0b8('0x29')]({'where':{'type':_0x440fc1,'resourceId':_0x597a98['id']}})[_0xc0b8('0x2a')](function(){return _0x1f5f1c;});})[_0xc0b8('0x2a')](function(){_0x2747a7[_0xc0b8('0x1c')](0xcc)[_0xc0b8('0x1d')]();});}};}function handleEntityNotFound(_0x36e64d,_0x88faf6){return function(_0x3b94c5){if(!_0x3b94c5){_0x36e64d[_0xc0b8('0x1b')](0x194);}return _0x3b94c5;};}function handleError(_0x268bb0,_0x28d697){_0x28d697=_0x28d697||0x1f4;return function(_0x3a8d41){logger[_0xc0b8('0x2d')](_0x3a8d41[_0xc0b8('0x2e')]);if(_0x3a8d41[_0xc0b8('0x2f')]){delete _0x3a8d41[_0xc0b8('0x2f')];}_0x268bb0['status'](_0x28d697)['send'](_0x3a8d41);};}exports[_0xc0b8('0x30')]=function(_0x5ae4d0,_0x11b56f){var _0x1be62e={},_0x947cbb={},_0x47ff30={'count':0x0,'rows':[]};var _0x5dcec4=_[_0xc0b8('0x31')](db[_0xc0b8('0x32')][_0xc0b8('0x33')],function(_0x38defe){return{'name':_0x38defe[_0xc0b8('0x34')],'type':_0x38defe[_0xc0b8('0x35')][_0xc0b8('0x36')]};});_0x947cbb[_0xc0b8('0x37')]=_[_0xc0b8('0x31')](_0x5dcec4,_0xc0b8('0x2f'));_0x947cbb[_0xc0b8('0x38')]=_['keys'](_0x5ae4d0['query']);_0x947cbb[_0xc0b8('0x39')]=_[_0xc0b8('0x3a')](_0x947cbb[_0xc0b8('0x37')],_0x947cbb[_0xc0b8('0x38')]);_0x1be62e[_0xc0b8('0x3b')]=_[_0xc0b8('0x3a')](_0x947cbb[_0xc0b8('0x37')],qs[_0xc0b8('0x3c')](_0x5ae4d0['query'][_0xc0b8('0x3c')]));_0x1be62e[_0xc0b8('0x3b')]=_0x1be62e[_0xc0b8('0x3b')]['length']?_0x1be62e[_0xc0b8('0x3b')]:_0x947cbb['model'];if(!_0x5ae4d0[_0xc0b8('0x38')][_0xc0b8('0x3d')]('nolimit')){_0x1be62e[_0xc0b8('0x20')]=qs[_0xc0b8('0x20')](_0x5ae4d0[_0xc0b8('0x38')][_0xc0b8('0x20')]);_0x1be62e[_0xc0b8('0x22')]=qs[_0xc0b8('0x22')](_0x5ae4d0[_0xc0b8('0x38')][_0xc0b8('0x22')]);}_0x1be62e[_0xc0b8('0x3e')]=qs[_0xc0b8('0x3f')](_0x5ae4d0['query'][_0xc0b8('0x3f')]);_0x1be62e[_0xc0b8('0x40')]=qs[_0xc0b8('0x39')](_[_0xc0b8('0x41')](_0x5ae4d0[_0xc0b8('0x38')],_0x947cbb[_0xc0b8('0x39')]),_0x5dcec4);if(_0x5ae4d0[_0xc0b8('0x38')]['filter']){_0x1be62e[_0xc0b8('0x40')]=_[_0xc0b8('0x42')](_0x1be62e[_0xc0b8('0x40')],{'$or':_[_0xc0b8('0x31')](_0x5dcec4,function(_0x24ba41){if(_0x24ba41[_0xc0b8('0x35')]!==_0xc0b8('0x43')){var _0x4190b0={};_0x4190b0[_0x24ba41['name']]={'$like':'%'+_0x5ae4d0[_0xc0b8('0x38')]['filter']+'%'};return _0x4190b0;}})});}_0x1be62e=_['merge']({},_0x1be62e,_0x5ae4d0[_0xc0b8('0x44')]);var _0x12771b={'where':_0x1be62e[_0xc0b8('0x40')]};return db[_0xc0b8('0x32')][_0xc0b8('0x21')](_0x12771b)[_0xc0b8('0x2a')](function(_0x34484c){_0x47ff30[_0xc0b8('0x21')]=_0x34484c;if(_0x5ae4d0[_0xc0b8('0x38')][_0xc0b8('0x45')]){_0x1be62e[_0xc0b8('0x46')]=[{'all':!![]}];}return db[_0xc0b8('0x32')][_0xc0b8('0x47')](_0x1be62e);})[_0xc0b8('0x2a')](function(_0x35d9af){_0x47ff30['rows']=_0x35d9af;return _0x47ff30;})[_0xc0b8('0x2a')](respondWithFilteredResult(_0x11b56f,_0x1be62e))[_0xc0b8('0x48')](handleError(_0x11b56f,null));};exports[_0xc0b8('0x49')]=function(_0xf0fa23,_0x1cde79){var _0x115f45={'raw':!![],'where':{'id':_0xf0fa23[_0xc0b8('0x4a')]['id']}},_0x3fdca5={};_0x3fdca5[_0xc0b8('0x37')]=_['keys'](db[_0xc0b8('0x32')][_0xc0b8('0x33')]);_0x3fdca5[_0xc0b8('0x38')]=_[_0xc0b8('0x4b')](_0xf0fa23[_0xc0b8('0x38')]);_0x3fdca5[_0xc0b8('0x39')]=_[_0xc0b8('0x3a')](_0x3fdca5[_0xc0b8('0x37')],_0x3fdca5[_0xc0b8('0x38')]);_0x115f45[_0xc0b8('0x3b')]=_[_0xc0b8('0x3a')](_0x3fdca5[_0xc0b8('0x37')],qs['fields'](_0xf0fa23[_0xc0b8('0x38')][_0xc0b8('0x3c')]));_0x115f45['attributes']=_0x115f45[_0xc0b8('0x3b')][_0xc0b8('0x4c')]?_0x115f45[_0xc0b8('0x3b')]:_0x3fdca5[_0xc0b8('0x37')];if(_0xf0fa23[_0xc0b8('0x38')]['includeAll']){_0x115f45[_0xc0b8('0x46')]=[{'all':!![]}];}_0x115f45=_[_0xc0b8('0x42')]({},_0x115f45,_0xf0fa23[_0xc0b8('0x44')]);return db['AnalyticExtractedReport'][_0xc0b8('0x4d')](_0x115f45)[_0xc0b8('0x2a')](handleEntityNotFound(_0x1cde79,null))[_0xc0b8('0x2a')](respondWithResult(_0x1cde79,null))['catch'](handleError(_0x1cde79,null));};exports[_0xc0b8('0x4e')]=function(_0x5606d3,_0x5d2eb1){return db[_0xc0b8('0x32')]['create'](_0x5606d3[_0xc0b8('0x4f')],{})[_0xc0b8('0x2a')](function(_0x500cec){var _0x33da1d=_0x5606d3[_0xc0b8('0x50')][_0xc0b8('0x51')]({'plain':!![]});if(!_0x33da1d)throw new Error(_0xc0b8('0x52'));if(_0x33da1d[_0xc0b8('0x53')]==='user'){var _0xd958db=_0x500cec[_0xc0b8('0x51')]({'plain':!![]});var _0x3441d1='ExtractedReports';return db[_0xc0b8('0x54')]['find']({'where':{'name':_0x3441d1,'userProfileId':_0x33da1d['userProfileId']},'raw':!![]})[_0xc0b8('0x2a')](function(_0xb813bf){if(_0xb813bf&&_0xb813bf[_0xc0b8('0x55')]===0x0){return db[_0xc0b8('0x2c')]['create']({'name':_0xd958db[_0xc0b8('0x2f')],'resourceId':_0xd958db['id'],'type':_0xb813bf[_0xc0b8('0x2f')],'sectionId':_0xb813bf['id']},{})[_0xc0b8('0x2a')](function(){return _0x500cec;});}else{return _0x500cec;}})[_0xc0b8('0x48')](function(_0x5078a0){logger[_0xc0b8('0x2d')](_0xc0b8('0x56'),_0x5078a0);throw _0x5078a0;});}return _0x500cec;})['then'](respondWithResult(_0x5d2eb1,0xc9))[_0xc0b8('0x48')](handleError(_0x5d2eb1,null));};exports[_0xc0b8('0x28')]=function(_0x199477,_0x7a297a){if(_0x199477[_0xc0b8('0x4f')]['id']){delete _0x199477[_0xc0b8('0x4f')]['id'];}return db[_0xc0b8('0x32')]['find']({'where':{'id':_0x199477[_0xc0b8('0x4a')]['id']}})[_0xc0b8('0x2a')](handleEntityNotFound(_0x7a297a,null))['then'](saveUpdates(_0x199477['body'],null))['then'](respondWithResult(_0x7a297a,null))['catch'](handleError(_0x7a297a,null));};exports[_0xc0b8('0x29')]=function(_0x4ddce2,_0x258bce){return db[_0xc0b8('0x32')][_0xc0b8('0x4d')]({'where':{'id':_0x4ddce2[_0xc0b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x258bce,null))[_0xc0b8('0x2a')](removeEntity(_0x258bce,null))[_0xc0b8('0x48')](handleError(_0x258bce,null));};exports[_0xc0b8('0x57')]=function(_0x1d0a20,_0x240405,_0x2485be){return db['AnalyticExtractedReport'][_0xc0b8('0x4d')]({'where':{'id':_0x1d0a20[_0xc0b8('0x4a')]['id']},'attributes':[_0xc0b8('0x2f'),_0xc0b8('0x58'),_0xc0b8('0x59'),_0xc0b8('0x5a')],'raw':!![]})[_0xc0b8('0x2a')](handleEntityNotFound(_0x240405,null))[_0xc0b8('0x2a')](function(_0x486eb7){if(_0x486eb7){if(!fs[_0xc0b8('0x5b')](path['join'](config[_0xc0b8('0x5c')],'server/files/reports',_0x486eb7[_0xc0b8('0x59')]))){throw new db[(_0xc0b8('0x5d'))][(_0xc0b8('0x5e'))](_0xc0b8('0x5f'));}if(_0x1d0a20['query'][_0xc0b8('0x60')]){return _0x240405[_0xc0b8('0x1b')](0xc8);}return _0x240405[_0xc0b8('0x57')](path[_0xc0b8('0x61')](config[_0xc0b8('0x5c')],_0xc0b8('0x62'),_0x486eb7['savename']),util[_0xc0b8('0x63')](_0xc0b8('0x64'),_0x486eb7[_0xc0b8('0x58')]||_0x486eb7[_0xc0b8('0x2f')],_0x486eb7[_0xc0b8('0x5a')][_0xc0b8('0x65')]()));}})[_0xc0b8('0x48')](handleError(_0x240405,null));}; \ No newline at end of file +var _0xd03b=['query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','intersection','find','create','body','user','get','role','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','output','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','basename','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0xd03b,0xe1));var _0xbd03=function(_0x3db5d4,_0x5cd874){_0x3db5d4=_0x3db5d4-0x0;var _0x213132=_0xd03b[_0x3db5d4];return _0x213132;};'use strict';var emlformat=require(_0xbd03('0x0'));var rimraf=require(_0xbd03('0x1'));var zipdir=require(_0xbd03('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd03('0x3'));var moment=require(_0xbd03('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbd03('0x5'));var sox=require(_0xbd03('0x6'));var csv=require(_0xbd03('0x7'));var ejs=require(_0xbd03('0x8'));var fs=require('fs');var fs_extra=require(_0xbd03('0x9'));var _=require(_0xbd03('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbd03('0xb'));var deskjs=require(_0xbd03('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbd03('0xd'));var Papa=require(_0xbd03('0xe'));var Redis=require(_0xbd03('0xf'));var authService=require(_0xbd03('0x10'));var qs=require(_0xbd03('0x11'));var as=require(_0xbd03('0x12'));var hardwareService=require(_0xbd03('0x13'));var logger=require('../../config/logger')(_0xbd03('0x14'));var utils=require(_0xbd03('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e49b5,_0x20d6fc){_0x20d6fc=_0x20d6fc||0xcc;return function(_0x242e81){if(_0x242e81){return _0x3e49b5['sendStatus'](_0x20d6fc);}return _0x3e49b5['status'](_0x20d6fc)['end']();};}function respondWithResult(_0x122e39,_0x34fdc9){_0x34fdc9=_0x34fdc9||0xc8;return function(_0x29a43d){if(_0x29a43d){return _0x122e39[_0xbd03('0x16')](_0x34fdc9)[_0xbd03('0x17')](_0x29a43d);}};}function respondWithFilteredResult(_0x1459d8,_0x8b4a1a){return function(_0x491529){if(_0x491529){var _0x3f09cc=typeof _0x8b4a1a['offset']===_0xbd03('0x18')&&typeof _0x8b4a1a[_0xbd03('0x19')]==='undefined';var _0x1a2f19=_0x491529[_0xbd03('0x1a')];var _0x24f2f8=_0x3f09cc?0x0:_0x8b4a1a[_0xbd03('0x1b')];var _0x3f8731=_0x3f09cc?_0x491529[_0xbd03('0x1a')]:_0x8b4a1a[_0xbd03('0x1b')]+_0x8b4a1a[_0xbd03('0x19')];var _0x4d22ea;if(_0x3f8731>=_0x1a2f19){_0x3f8731=_0x1a2f19;_0x4d22ea=0xc8;}else{_0x4d22ea=0xce;}_0x1459d8[_0xbd03('0x16')](_0x4d22ea);return _0x1459d8[_0xbd03('0x1c')]('Content-Range',_0x24f2f8+'-'+_0x3f8731+'/'+_0x1a2f19)[_0xbd03('0x17')](_0x491529);}return null;};}function patchUpdates(_0x300e44){return function(_0x57e3e2){try{jsonpatch[_0xbd03('0x1d')](_0x57e3e2,_0x300e44,!![]);}catch(_0x209f2d){return BPromise['reject'](_0x209f2d);}return _0x57e3e2[_0xbd03('0x1e')]();};}function saveUpdates(_0x453050,_0x31be7a){return function(_0x2f3835){if(_0x2f3835){return _0x2f3835[_0xbd03('0x1f')](_0x453050)[_0xbd03('0x20')](function(_0x505db1){return _0x505db1;});}return null;};}function removeEntity(_0x581cde,_0x178817){return function(_0x368382){if(_0x368382){return _0x368382[_0xbd03('0x21')]()[_0xbd03('0x20')](function(){var _0x59f3d6=_0x368382['get']({'plain':!![]});var _0x2cf24b=_0xbd03('0x22');return db[_0xbd03('0x23')][_0xbd03('0x21')]({'where':{'type':_0x2cf24b,'resourceId':_0x59f3d6['id']}})['then'](function(){return _0x368382;});})[_0xbd03('0x20')](function(){_0x581cde[_0xbd03('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15c75e,_0x47bc16){return function(_0x378d96){if(!_0x378d96){_0x15c75e[_0xbd03('0x24')](0x194);}return _0x378d96;};}function handleError(_0xdf7fac,_0x666e92){_0x666e92=_0x666e92||0x1f4;return function(_0x49cc98){logger[_0xbd03('0x25')](_0x49cc98[_0xbd03('0x26')]);if(_0x49cc98['name']){delete _0x49cc98[_0xbd03('0x27')];}_0xdf7fac['status'](_0x666e92)[_0xbd03('0x28')](_0x49cc98);};}exports[_0xbd03('0x29')]=function(_0x3c4ffc,_0x544e92){var _0x593d03={},_0x222beb={},_0x2a75e5={'count':0x0,'rows':[]};var _0x1476f7=_[_0xbd03('0x2a')](db[_0xbd03('0x2b')][_0xbd03('0x2c')],function(_0x34957c){return{'name':_0x34957c[_0xbd03('0x2d')],'type':_0x34957c[_0xbd03('0x2e')]['key']};});_0x222beb[_0xbd03('0x2f')]=_[_0xbd03('0x2a')](_0x1476f7,_0xbd03('0x27'));_0x222beb[_0xbd03('0x30')]=_['keys'](_0x3c4ffc['query']);_0x222beb[_0xbd03('0x31')]=_['intersection'](_0x222beb[_0xbd03('0x2f')],_0x222beb[_0xbd03('0x30')]);_0x593d03[_0xbd03('0x32')]=_['intersection'](_0x222beb[_0xbd03('0x2f')],qs[_0xbd03('0x33')](_0x3c4ffc[_0xbd03('0x30')][_0xbd03('0x33')]));_0x593d03[_0xbd03('0x32')]=_0x593d03[_0xbd03('0x32')][_0xbd03('0x34')]?_0x593d03[_0xbd03('0x32')]:_0x222beb[_0xbd03('0x2f')];if(!_0x3c4ffc[_0xbd03('0x30')]['hasOwnProperty'](_0xbd03('0x35'))){_0x593d03[_0xbd03('0x19')]=qs[_0xbd03('0x19')](_0x3c4ffc[_0xbd03('0x30')][_0xbd03('0x19')]);_0x593d03['offset']=qs[_0xbd03('0x1b')](_0x3c4ffc[_0xbd03('0x30')][_0xbd03('0x1b')]);}_0x593d03[_0xbd03('0x36')]=qs[_0xbd03('0x37')](_0x3c4ffc[_0xbd03('0x30')]['sort']);_0x593d03[_0xbd03('0x38')]=qs['filters'](_[_0xbd03('0x39')](_0x3c4ffc[_0xbd03('0x30')],_0x222beb[_0xbd03('0x31')]),_0x1476f7);if(_0x3c4ffc[_0xbd03('0x30')][_0xbd03('0x3a')]){_0x593d03[_0xbd03('0x38')]=_['merge'](_0x593d03['where'],{'$or':_[_0xbd03('0x2a')](_0x1476f7,function(_0x563a26){if(_0x563a26['type']!==_0xbd03('0x3b')){var _0xc1015c={};_0xc1015c[_0x563a26['name']]={'$like':'%'+_0x3c4ffc[_0xbd03('0x30')][_0xbd03('0x3a')]+'%'};return _0xc1015c;}})});}_0x593d03=_[_0xbd03('0x3c')]({},_0x593d03,_0x3c4ffc[_0xbd03('0x3d')]);var _0x3c0c01={'where':_0x593d03[_0xbd03('0x38')]};return db[_0xbd03('0x2b')][_0xbd03('0x1a')](_0x3c0c01)[_0xbd03('0x20')](function(_0x582679){_0x2a75e5[_0xbd03('0x1a')]=_0x582679;if(_0x3c4ffc[_0xbd03('0x30')]['includeAll']){_0x593d03[_0xbd03('0x3e')]=[{'all':!![]}];}return db[_0xbd03('0x2b')][_0xbd03('0x3f')](_0x593d03);})[_0xbd03('0x20')](function(_0x7525f2){_0x2a75e5[_0xbd03('0x40')]=_0x7525f2;return _0x2a75e5;})[_0xbd03('0x20')](respondWithFilteredResult(_0x544e92,_0x593d03))['catch'](handleError(_0x544e92,null));};exports[_0xbd03('0x41')]=function(_0x4319bb,_0x4c5485){var _0x4448d2={'raw':!![],'where':{'id':_0x4319bb[_0xbd03('0x42')]['id']}},_0x2d8ca7={};_0x2d8ca7['model']=_[_0xbd03('0x43')](db[_0xbd03('0x2b')][_0xbd03('0x2c')]);_0x2d8ca7['query']=_[_0xbd03('0x43')](_0x4319bb[_0xbd03('0x30')]);_0x2d8ca7[_0xbd03('0x31')]=_['intersection'](_0x2d8ca7[_0xbd03('0x2f')],_0x2d8ca7[_0xbd03('0x30')]);_0x4448d2[_0xbd03('0x32')]=_[_0xbd03('0x44')](_0x2d8ca7['model'],qs['fields'](_0x4319bb[_0xbd03('0x30')][_0xbd03('0x33')]));_0x4448d2[_0xbd03('0x32')]=_0x4448d2['attributes'][_0xbd03('0x34')]?_0x4448d2['attributes']:_0x2d8ca7[_0xbd03('0x2f')];if(_0x4319bb[_0xbd03('0x30')]['includeAll']){_0x4448d2[_0xbd03('0x3e')]=[{'all':!![]}];}_0x4448d2=_['merge']({},_0x4448d2,_0x4319bb[_0xbd03('0x3d')]);return db[_0xbd03('0x2b')][_0xbd03('0x45')](_0x4448d2)[_0xbd03('0x20')](handleEntityNotFound(_0x4c5485,null))[_0xbd03('0x20')](respondWithResult(_0x4c5485,null))['catch'](handleError(_0x4c5485,null));};exports['create']=function(_0x102d65,_0x3ae040){return db[_0xbd03('0x2b')][_0xbd03('0x46')](_0x102d65[_0xbd03('0x47')],{})[_0xbd03('0x20')](function(_0x474481){var _0x3a6662=_0x102d65[_0xbd03('0x48')][_0xbd03('0x49')]({'plain':!![]});if(!_0x3a6662)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a6662[_0xbd03('0x4a')]===_0xbd03('0x48')){var _0x28f598=_0x474481[_0xbd03('0x49')]({'plain':!![]});var _0x57c1f3=_0xbd03('0x22');return db[_0xbd03('0x4b')][_0xbd03('0x45')]({'where':{'name':_0x57c1f3,'userProfileId':_0x3a6662['userProfileId']},'raw':!![]})['then'](function(_0x12d3fe){if(_0x12d3fe&&_0x12d3fe['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x28f598[_0xbd03('0x27')],'resourceId':_0x28f598['id'],'type':_0x12d3fe[_0xbd03('0x27')],'sectionId':_0x12d3fe['id']},{})[_0xbd03('0x20')](function(){return _0x474481;});}else{return _0x474481;}})[_0xbd03('0x4c')](function(_0x141973){logger['error'](_0xbd03('0x4d'),_0x141973);throw _0x141973;});}return _0x474481;})['then'](respondWithResult(_0x3ae040,0xc9))[_0xbd03('0x4c')](handleError(_0x3ae040,null));};exports['update']=function(_0x2ef058,_0x46def6){if(_0x2ef058['body']['id']){delete _0x2ef058['body']['id'];}return db[_0xbd03('0x2b')][_0xbd03('0x45')]({'where':{'id':_0x2ef058['params']['id']}})[_0xbd03('0x20')](handleEntityNotFound(_0x46def6,null))[_0xbd03('0x20')](saveUpdates(_0x2ef058[_0xbd03('0x47')],null))['then'](respondWithResult(_0x46def6,null))[_0xbd03('0x4c')](handleError(_0x46def6,null));};exports['destroy']=function(_0x5d2cea,_0x263123){return db[_0xbd03('0x2b')][_0xbd03('0x45')]({'where':{'id':_0x5d2cea[_0xbd03('0x42')]['id']}})[_0xbd03('0x20')](handleEntityNotFound(_0x263123,null))[_0xbd03('0x20')](removeEntity(_0x263123,null))[_0xbd03('0x4c')](handleError(_0x263123,null));};exports['download']=function(_0x4a1611,_0x30c447,_0x5e953d){return db[_0xbd03('0x2b')][_0xbd03('0x45')]({'where':{'id':_0x4a1611[_0xbd03('0x42')]['id']},'attributes':[_0xbd03('0x27'),'basename','savename',_0xbd03('0x4e')],'raw':!![]})[_0xbd03('0x20')](handleEntityNotFound(_0x30c447,null))[_0xbd03('0x20')](function(_0x4a603e){if(_0x4a603e){if(!fs['existsSync'](path[_0xbd03('0x4f')](config[_0xbd03('0x50')],_0xbd03('0x51'),_0x4a603e[_0xbd03('0x52')]))){throw new db[(_0xbd03('0x53'))][(_0xbd03('0x54'))](_0xbd03('0x55'));}if(_0x4a1611['query'][_0xbd03('0x56')]){return _0x30c447[_0xbd03('0x24')](0xc8);}return _0x30c447[_0xbd03('0x57')](path[_0xbd03('0x4f')](config['root'],'server/files/reports',_0x4a603e[_0xbd03('0x52')]),util[_0xbd03('0x58')]('%s.%s',_0x4a603e[_0xbd03('0x59')]||_0x4a603e['name'],_0x4a603e[_0xbd03('0x4e')][_0xbd03('0x5a')]()));}})[_0xbd03('0x4c')](handleError(_0x30c447,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index a8193d7..2fec428 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d77=['exports','define','AnalyticExtractedReport','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x720de0,_0x3af899){var _0x3751ff=function(_0x12903e){while(--_0x12903e){_0x720de0['push'](_0x720de0['shift']());}};_0x3751ff(++_0x3af899);}(_0x3d77,0x179));var _0x73d7=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x3d77[_0x1f9f37];return _0x21c080;};'use strict';var _=require('lodash');var util=require(_0x73d7('0x0'));var logger=require(_0x73d7('0x1'))(_0x73d7('0x2'));var moment=require(_0x73d7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x73d7('0x4'));var rimraf=require(_0x73d7('0x5'));var config=require(_0x73d7('0x6'));var attributes=require(_0x73d7('0x7'));module[_0x73d7('0x8')]=function(_0x253fb9,_0x309235){return _0x253fb9[_0x73d7('0x9')](_0x73d7('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8941=['define','analytics_extracted_reports','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x2d06c4,_0x42e058){var _0x114856=function(_0x13c03b){while(--_0x13c03b){_0x2d06c4['push'](_0x2d06c4['shift']());}};_0x114856(++_0x42e058);}(_0x8941,0x1be));var _0x1894=function(_0x5c62b2,_0x92040c){_0x5c62b2=_0x5c62b2-0x0;var _0x26a129=_0x8941[_0x5c62b2];return _0x26a129;};'use strict';var _=require(_0x1894('0x0'));var util=require(_0x1894('0x1'));var logger=require(_0x1894('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1894('0x3'));var rp=require(_0x1894('0x4'));var fs=require('fs');var path=require(_0x1894('0x5'));var rimraf=require(_0x1894('0x6'));var config=require(_0x1894('0x7'));var attributes=require(_0x1894('0x8'));module[_0x1894('0x9')]=function(_0x388204,_0x2baa05){return _0x388204[_0x1894('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x1894('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 09ba420..34d9203 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x579a=['../../config/utils','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','../../mysqldb'];(function(_0xb326d6,_0x1ccd3e){var _0x13c7e0=function(_0x33c1d3){while(--_0x33c1d3){_0xb326d6['push'](_0xb326d6['shift']());}};_0x13c7e0(++_0x1ccd3e);}(_0x579a,0x9d));var _0xa579=function(_0x2c2749,_0x644b9c){_0x2c2749=_0x2c2749-0x0;var _0x235156=_0x579a[_0x2c2749];return _0x235156;};'use strict';var _=require(_0xa579('0x0'));var util=require(_0xa579('0x1'));var moment=require(_0xa579('0x2'));var BPromise=require(_0xa579('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa579('0x4'))['db'];var utils=require(_0xa579('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa579('0x6'));var client=jayson['client'][_0xa579('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14a544,_0x770152,_0x2aeb20){return new BPromise(function(_0x27e490,_0x4418fd){return client[_0xa579('0x8')](_0x14a544,_0x2aeb20)[_0xa579('0x9')](function(_0x51f0a0){logger[_0xa579('0xa')](_0xa579('0xb'),_0x770152,_0xa579('0xc'));logger[_0xa579('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x770152,_0xa579('0xc'),JSON[_0xa579('0xe')](_0x51f0a0));if(_0x51f0a0[_0xa579('0xf')]){if(_0x51f0a0[_0xa579('0xf')]['code']===0x1f4){logger[_0xa579('0xf')](_0xa579('0xb'),_0x770152,_0x51f0a0[_0xa579('0xf')][_0xa579('0x10')]);return _0x4418fd(_0x51f0a0[_0xa579('0xf')][_0xa579('0x10')]);}logger['error'](_0xa579('0xb'),_0x770152,_0x51f0a0['error'][_0xa579('0x10')]);return _0x27e490(_0x51f0a0[_0xa579('0xf')][_0xa579('0x10')]);}else{logger[_0xa579('0xa')](_0xa579('0xb'),_0x770152,_0xa579('0xc'));_0x27e490(_0x51f0a0[_0xa579('0x11')][_0xa579('0x10')]);}})['catch'](function(_0x567224){logger['error'](_0xa579('0xb'),_0x770152,_0x567224);_0x4418fd(_0x567224);});});} \ No newline at end of file +var _0xd150=['client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x27e481,_0x3d3268){var _0x233ca8=function(_0x2101cf){while(--_0x2101cf){_0x27e481['push'](_0x27e481['shift']());}};_0x233ca8(++_0x3d3268);}(_0xd150,0x114));var _0x0d15=function(_0x25ce73,_0x51c91c){_0x25ce73=_0x25ce73-0x0;var _0x151080=_0xd150[_0x25ce73];return _0x151080;};'use strict';var _=require(_0x0d15('0x0'));var util=require(_0x0d15('0x1'));var moment=require(_0x0d15('0x2'));var BPromise=require(_0x0d15('0x3'));var rs=require(_0x0d15('0x4'));var fs=require('fs');var Redis=require(_0x0d15('0x5'));var db=require(_0x0d15('0x6'))['db'];var utils=require(_0x0d15('0x7'));var logger=require(_0x0d15('0x8'))(_0x0d15('0x9'));var config=require(_0x0d15('0xa'));var jayson=require(_0x0d15('0xb'));var client=jayson[_0x0d15('0xc')][_0x0d15('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x995842,_0x4784cb,_0xa17e7b){return new BPromise(function(_0x36ddc9,_0x413863){return client[_0x0d15('0xe')](_0x995842,_0xa17e7b)['then'](function(_0xc5fbb4){logger[_0x0d15('0xf')](_0x0d15('0x10'),_0x4784cb,'request\x20sent');logger[_0x0d15('0x11')](_0x0d15('0x12'),_0x4784cb,_0x0d15('0x13'),JSON['stringify'](_0xc5fbb4));if(_0xc5fbb4[_0x0d15('0x14')]){if(_0xc5fbb4[_0x0d15('0x14')][_0x0d15('0x15')]===0x1f4){logger[_0x0d15('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4784cb,_0xc5fbb4['error']['message']);return _0x413863(_0xc5fbb4[_0x0d15('0x14')][_0x0d15('0x16')]);}logger[_0x0d15('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4784cb,_0xc5fbb4[_0x0d15('0x14')][_0x0d15('0x16')]);return _0x36ddc9(_0xc5fbb4[_0x0d15('0x14')][_0x0d15('0x16')]);}else{logger[_0x0d15('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4784cb,'request\x20sent');_0x36ddc9(_0xc5fbb4[_0x0d15('0x17')][_0x0d15('0x16')]);}})['catch'](function(_0x37afda){logger[_0x0d15('0x14')](_0x0d15('0x10'),_0x4784cb,_0x37afda);_0x413863(_0x37afda);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index d073775..bd059db 100644 --- a/server/api/analyticExtractedReport/index.js +++ b/server/api/analyticExtractedReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89a0=['show','/:id/download','download','post','create','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id'];(function(_0x1bb87a,_0x390823){var _0x539f1d=function(_0x4d05b5){while(--_0x4d05b5){_0x1bb87a['push'](_0x1bb87a['shift']());}};_0x539f1d(++_0x390823);}(_0x89a0,0xbc));var _0x089a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89a0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x089a('0x0'));var timeout=require(_0x089a('0x1'));var express=require(_0x089a('0x2'));var router=express[_0x089a('0x3')]();var fs_extra=require(_0x089a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x089a('0x5'));var config=require('../../config/environment');var controller=require(_0x089a('0x6'));router[_0x089a('0x7')]('/',auth[_0x089a('0x8')](),controller['index']);router[_0x089a('0x7')](_0x089a('0x9'),auth[_0x089a('0x8')](),controller[_0x089a('0xa')]);router[_0x089a('0x7')](_0x089a('0xb'),auth[_0x089a('0x8')](),controller[_0x089a('0xc')]);router[_0x089a('0xd')]('/',auth['isAuthenticated'](),controller[_0x089a('0xe')]);router[_0x089a('0xf')](_0x089a('0x9'),auth[_0x089a('0x8')](),controller[_0x089a('0x10')]);router['delete'](_0x089a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x089a('0x11')]=router; \ No newline at end of file +var _0xc619=['show','download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x5f3f60,_0x5623b3){var _0x3f0e96=function(_0x2cd826){while(--_0x2cd826){_0x5f3f60['push'](_0x5f3f60['shift']());}};_0x3f0e96(++_0x5623b3);}(_0xc619,0x1d6));var _0x9c61=function(_0x4d7e5d,_0xa3ddfc){_0x4d7e5d=_0x4d7e5d-0x0;var _0x44414d=_0xc619[_0x4d7e5d];return _0x44414d;};'use strict';var multer=require(_0x9c61('0x0'));var util=require(_0x9c61('0x1'));var path=require(_0x9c61('0x2'));var timeout=require(_0x9c61('0x3'));var express=require(_0x9c61('0x4'));var router=express[_0x9c61('0x5')]();var fs_extra=require(_0x9c61('0x6'));var auth=require(_0x9c61('0x7'));var interaction=require(_0x9c61('0x8'));var config=require(_0x9c61('0x9'));var controller=require('./analyticExtractedReport.controller');router[_0x9c61('0xa')]('/',auth[_0x9c61('0xb')](),controller[_0x9c61('0xc')]);router[_0x9c61('0xa')](_0x9c61('0xd'),auth[_0x9c61('0xb')](),controller[_0x9c61('0xe')]);router[_0x9c61('0xa')]('/:id/download',auth[_0x9c61('0xb')](),controller[_0x9c61('0xf')]);router[_0x9c61('0x10')]('/',auth['isAuthenticated'](),controller[_0x9c61('0x11')]);router[_0x9c61('0x12')](_0x9c61('0xd'),auth[_0x9c61('0xb')](),controller['update']);router[_0x9c61('0x13')](_0x9c61('0xd'),auth[_0x9c61('0xb')](),controller[_0x9c61('0x14')]);module[_0x9c61('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 4dcba14..f5b9384 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js +++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd92b=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd92b,0x78));var _0xbd92=function(_0x41c27b,_0xb88971){_0x41c27b=_0x41c27b-0x0;var _0x4ea606=_0xd92b[_0x41c27b];return _0x4ea606;};'use strict';var Sequelize=require(_0xbd92('0x0'));module[_0xbd92('0x1')]={'field':{'type':Sequelize[_0xbd92('0x2')]},'alias':{'type':Sequelize[_0xbd92('0x3')]},'function':{'type':Sequelize[_0xbd92('0x3')]},'format':{'type':Sequelize[_0xbd92('0x3')]},'groupBy':{'type':Sequelize[_0xbd92('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbd92('0x3')]},'custom':{'type':Sequelize[_0xbd92('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x449e=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0xd19cc9,_0x2a7558){var _0x3c0395=function(_0xc05178){while(--_0xc05178){_0xd19cc9['push'](_0xd19cc9['shift']());}};_0x3c0395(++_0x2a7558);}(_0x449e,0x184));var _0xe449=function(_0x46910c,_0x3bb530){_0x46910c=_0x46910c-0x0;var _0x1dfcd4=_0x449e[_0x46910c];return _0x1dfcd4;};'use strict';var Sequelize=require(_0xe449('0x0'));module[_0xe449('0x1')]={'field':{'type':Sequelize[_0xe449('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xe449('0x3')]},'format':{'type':Sequelize[_0xe449('0x3')]},'groupBy':{'type':Sequelize[_0xe449('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe449('0x3')]},'custom':{'type':Sequelize[_0xe449('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index cc576df..561d428 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.controller.js +++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7d1=['destroy','name','send','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','rows','catch','show','params','include','create','body','bulkCreate','update','find','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','then'];(function(_0x25c3d3,_0x37e4a3){var _0x2b8cfe=function(_0x3f937c){while(--_0x3f937c){_0x25c3d3['push'](_0x25c3d3['shift']());}};_0x2b8cfe(++_0x37e4a3);}(_0xf7d1,0x1b9));var _0x1f7d=function(_0x53f34f,_0x8ac41b){_0x53f34f=_0x53f34f-0x0;var _0x23a349=_0xf7d1[_0x53f34f];return _0x23a349;};'use strict';var emlformat=require(_0x1f7d('0x0'));var rimraf=require(_0x1f7d('0x1'));var zipdir=require(_0x1f7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f7d('0x3'));var moment=require(_0x1f7d('0x4'));var BPromise=require(_0x1f7d('0x5'));var Mustache=require(_0x1f7d('0x6'));var util=require(_0x1f7d('0x7'));var path=require(_0x1f7d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1f7d('0x9'));var fs=require('fs');var fs_extra=require(_0x1f7d('0xa'));var _=require(_0x1f7d('0xb'));var squel=require(_0x1f7d('0xc'));var crypto=require(_0x1f7d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1f7d('0xe'));var querystring=require('querystring');var Papa=require(_0x1f7d('0xf'));var Redis=require(_0x1f7d('0x10'));var authService=require(_0x1f7d('0x11'));var qs=require(_0x1f7d('0x12'));var as=require(_0x1f7d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f7d('0x14'))(_0x1f7d('0x15'));var utils=require(_0x1f7d('0x16'));var config=require(_0x1f7d('0x17'));var licenseUtil=require(_0x1f7d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b0608,_0x247720){_0x247720=_0x247720||0xcc;return function(_0x8a9a7f){if(_0x8a9a7f){return _0x3b0608[_0x1f7d('0x19')](_0x247720);}return _0x3b0608['status'](_0x247720)[_0x1f7d('0x1a')]();};}function respondWithResult(_0xa3eebc,_0x5ed86f){_0x5ed86f=_0x5ed86f||0xc8;return function(_0x2d4a16){if(_0x2d4a16){return _0xa3eebc['status'](_0x5ed86f)['json'](_0x2d4a16);}};}function respondWithFilteredResult(_0x3d7cb8,_0x4cfd0e){return function(_0x372cc6){if(_0x372cc6){var _0x40a491=typeof _0x4cfd0e['offset']===_0x1f7d('0x1b')&&typeof _0x4cfd0e[_0x1f7d('0x1c')]===_0x1f7d('0x1b');var _0x7d6e8b=_0x372cc6[_0x1f7d('0x1d')];var _0xcf23ff=_0x40a491?0x0:_0x4cfd0e[_0x1f7d('0x1e')];var _0x4265b3=_0x40a491?_0x372cc6[_0x1f7d('0x1d')]:_0x4cfd0e['offset']+_0x4cfd0e['limit'];var _0x54c211;if(_0x4265b3>=_0x7d6e8b){_0x4265b3=_0x7d6e8b;_0x54c211=0xc8;}else{_0x54c211=0xce;}_0x3d7cb8[_0x1f7d('0x1f')](_0x54c211);return _0x3d7cb8[_0x1f7d('0x20')](_0x1f7d('0x21'),_0xcf23ff+'-'+_0x4265b3+'/'+_0x7d6e8b)[_0x1f7d('0x22')](_0x372cc6);}return null;};}function patchUpdates(_0x5d8d6c){return function(_0x435846){try{jsonpatch[_0x1f7d('0x23')](_0x435846,_0x5d8d6c,!![]);}catch(_0x6b2728){return BPromise[_0x1f7d('0x24')](_0x6b2728);}return _0x435846[_0x1f7d('0x25')]();};}function saveUpdates(_0x372ceb,_0x2ea99a){return function(_0x59ad65){if(_0x59ad65){return _0x59ad65['update'](_0x372ceb)[_0x1f7d('0x26')](function(_0x5ea453){return _0x5ea453;});}return null;};}function removeEntity(_0xa7d027,_0x5604e1){return function(_0x25a85d){if(_0x25a85d){return _0x25a85d[_0x1f7d('0x27')]()[_0x1f7d('0x26')](function(){_0xa7d027['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f59c9,_0x50603c){return function(_0x57a2ec){if(!_0x57a2ec){_0x5f59c9['sendStatus'](0x194);}return _0x57a2ec;};}function handleError(_0x2adc32,_0x45febf){_0x45febf=_0x45febf||0x1f4;return function(_0x74a028){logger['error'](_0x74a028['stack']);if(_0x74a028[_0x1f7d('0x28')]){delete _0x74a028[_0x1f7d('0x28')];}_0x2adc32[_0x1f7d('0x1f')](_0x45febf)[_0x1f7d('0x29')](_0x74a028);};}exports['index']=function(_0x36b085,_0x311279){var _0x3bd527={},_0x5071ea={},_0x424d88={'count':0x0,'rows':[]};var _0x4a35d5=_[_0x1f7d('0x2a')](db[_0x1f7d('0x2b')]['rawAttributes'],function(_0x459cd5){return{'name':_0x459cd5[_0x1f7d('0x2c')],'type':_0x459cd5[_0x1f7d('0x2d')][_0x1f7d('0x2e')]};});_0x5071ea[_0x1f7d('0x2f')]=_[_0x1f7d('0x2a')](_0x4a35d5,_0x1f7d('0x28'));_0x5071ea['query']=_[_0x1f7d('0x30')](_0x36b085[_0x1f7d('0x31')]);_0x5071ea[_0x1f7d('0x32')]=_[_0x1f7d('0x33')](_0x5071ea[_0x1f7d('0x2f')],_0x5071ea[_0x1f7d('0x31')]);_0x3bd527[_0x1f7d('0x34')]=_[_0x1f7d('0x33')](_0x5071ea['model'],qs['fields'](_0x36b085['query'][_0x1f7d('0x35')]));_0x3bd527[_0x1f7d('0x34')]=_0x3bd527[_0x1f7d('0x34')][_0x1f7d('0x36')]?_0x3bd527[_0x1f7d('0x34')]:_0x5071ea[_0x1f7d('0x2f')];if(!_0x36b085[_0x1f7d('0x31')][_0x1f7d('0x37')]('nolimit')){_0x3bd527[_0x1f7d('0x1c')]=qs[_0x1f7d('0x1c')](_0x36b085['query']['limit']);_0x3bd527[_0x1f7d('0x1e')]=qs[_0x1f7d('0x1e')](_0x36b085[_0x1f7d('0x31')][_0x1f7d('0x1e')]);}_0x3bd527[_0x1f7d('0x38')]=qs[_0x1f7d('0x39')](_0x36b085['query'][_0x1f7d('0x39')]);_0x3bd527[_0x1f7d('0x3a')]=qs[_0x1f7d('0x32')](_[_0x1f7d('0x3b')](_0x36b085[_0x1f7d('0x31')],_0x5071ea[_0x1f7d('0x32')]),_0x4a35d5);if(_0x36b085[_0x1f7d('0x31')][_0x1f7d('0x3c')]){_0x3bd527[_0x1f7d('0x3a')]=_[_0x1f7d('0x3d')](_0x3bd527[_0x1f7d('0x3a')],{'$or':_[_0x1f7d('0x2a')](_0x4a35d5,function(_0x65289f){if(_0x65289f[_0x1f7d('0x2d')]!=='VIRTUAL'){var _0x2a47bf={};_0x2a47bf[_0x65289f[_0x1f7d('0x28')]]={'$like':'%'+_0x36b085[_0x1f7d('0x31')]['filter']+'%'};return _0x2a47bf;}})});}_0x3bd527=_[_0x1f7d('0x3d')]({},_0x3bd527,_0x36b085[_0x1f7d('0x3e')]);var _0x3623d7={'where':_0x3bd527[_0x1f7d('0x3a')]};return db['AnalyticFieldReport'][_0x1f7d('0x1d')](_0x3623d7)['then'](function(_0x1007c1){_0x424d88[_0x1f7d('0x1d')]=_0x1007c1;if(_0x36b085[_0x1f7d('0x31')]['includeAll']){_0x3bd527['include']=[{'all':!![]}];}return db[_0x1f7d('0x2b')]['findAll'](_0x3bd527);})[_0x1f7d('0x26')](function(_0x194680){_0x424d88[_0x1f7d('0x3f')]=_0x194680;return _0x424d88;})['then'](respondWithFilteredResult(_0x311279,_0x3bd527))[_0x1f7d('0x40')](handleError(_0x311279,null));};exports[_0x1f7d('0x41')]=function(_0x20a510,_0x27a234){var _0x3181fc={'raw':![],'where':{'id':_0x20a510[_0x1f7d('0x42')]['id']}},_0x2721a3={};_0x2721a3[_0x1f7d('0x2f')]=_[_0x1f7d('0x30')](db[_0x1f7d('0x2b')]['rawAttributes']);_0x2721a3['query']=_[_0x1f7d('0x30')](_0x20a510['query']);_0x2721a3[_0x1f7d('0x32')]=_[_0x1f7d('0x33')](_0x2721a3[_0x1f7d('0x2f')],_0x2721a3[_0x1f7d('0x31')]);_0x3181fc[_0x1f7d('0x34')]=_[_0x1f7d('0x33')](_0x2721a3[_0x1f7d('0x2f')],qs['fields'](_0x20a510[_0x1f7d('0x31')]['fields']));_0x3181fc['attributes']=_0x3181fc[_0x1f7d('0x34')][_0x1f7d('0x36')]?_0x3181fc['attributes']:_0x2721a3[_0x1f7d('0x2f')];if(_0x20a510['query']['includeAll']){_0x3181fc[_0x1f7d('0x43')]=[{'all':!![]}];}_0x3181fc=_[_0x1f7d('0x3d')]({},_0x3181fc,_0x20a510[_0x1f7d('0x3e')]);return db[_0x1f7d('0x2b')]['find'](_0x3181fc)[_0x1f7d('0x26')](handleEntityNotFound(_0x27a234,null))[_0x1f7d('0x26')](respondWithResult(_0x27a234,null))[_0x1f7d('0x40')](handleError(_0x27a234,null));};exports[_0x1f7d('0x44')]=function(_0x5c571e,_0x2a1b46){return db[_0x1f7d('0x2b')][_0x1f7d('0x44')](_0x5c571e[_0x1f7d('0x45')],{})[_0x1f7d('0x26')](respondWithResult(_0x2a1b46,0xc9))[_0x1f7d('0x40')](handleError(_0x2a1b46,null));};exports[_0x1f7d('0x46')]=function(_0x6b2373,_0x1b1cc4){return db[_0x1f7d('0x2b')]['bulkCreate'](_0x6b2373[_0x1f7d('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1b1cc4,0xc9))[_0x1f7d('0x40')](handleError(_0x1b1cc4,null));};exports[_0x1f7d('0x47')]=function(_0x1969dd,_0x372c3e){if(_0x1969dd['body']['id']){delete _0x1969dd[_0x1f7d('0x45')]['id'];}return db[_0x1f7d('0x2b')][_0x1f7d('0x48')]({'where':{'id':_0x1969dd['params']['id']}})[_0x1f7d('0x26')](handleEntityNotFound(_0x372c3e,null))[_0x1f7d('0x26')](saveUpdates(_0x1969dd[_0x1f7d('0x45')],null))[_0x1f7d('0x26')](respondWithResult(_0x372c3e,null))[_0x1f7d('0x40')](handleError(_0x372c3e,null));};exports[_0x1f7d('0x27')]=function(_0x3d1065,_0x357e78){return db[_0x1f7d('0x2b')]['find']({'where':{'id':_0x3d1065[_0x1f7d('0x42')]['id']}})[_0x1f7d('0x26')](handleEntityNotFound(_0x357e78,null))[_0x1f7d('0x26')](removeEntity(_0x357e78,null))[_0x1f7d('0x40')](handleError(_0x357e78,null));};exports['bulkDestroy']=function(_0xb8d3b7,_0x1a6b63){return db[_0x1f7d('0x2b')][_0x1f7d('0x27')]({'where':{'id':_0xb8d3b7[_0x1f7d('0x31')][_0x1f7d('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x1f7d('0x26')](respondWithResult(_0x1a6b63,0xcc))[_0x1f7d('0x40')](handleError(_0x1a6b63,null));};exports[_0x1f7d('0x4a')]=function(_0x210803,_0x2cc6b1,_0x58d303){return db[_0x1f7d('0x4b')][_0x1f7d('0x4c')]({'where':{'id':_0x210803[_0x1f7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x2cc6b1,null))[_0x1f7d('0x26')](function(_0xc1ed41){if(_0xc1ed41){return db['sequelize'][_0x1f7d('0x4d')](function(_0x52ba6){return db[_0x1f7d('0x2b')][_0x1f7d('0x27')]({'where':{'CustomReportId':_0x210803[_0x1f7d('0x42')]['id']},'transaction':_0x52ba6})[_0x1f7d('0x26')](function(_0x548289){var _0x571208=_['map'](_0x210803[_0x1f7d('0x45')],function(_0x21a49b){delete _0x21a49b['id'];_0x21a49b[_0x1f7d('0x4e')]=_0x210803[_0x1f7d('0x42')]['id'];return _0x21a49b;});return db['AnalyticFieldReport']['bulkCreate'](_0x571208,{'transaction':_0x52ba6});});})['then'](function(){return db['AnalyticFieldReport'][_0x1f7d('0x4f')]({'where':{'CustomReportId':_0x210803['params']['id']}});});}})[_0x1f7d('0x26')](respondWithResult(_0x2cc6b1,null))[_0x1f7d('0x40')](handleError(_0x2cc6b1,null));}; \ No newline at end of file +var _0x466c=['ids','AnalyticCustomReport','findOne','CustomReportId','findAll','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','model','keys','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','bulkCreate','update','bulkDestroy'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x466c,0xef));var _0xc466=function(_0x435332,_0x30e9b4){_0x435332=_0x435332-0x0;var _0x4be29f=_0x466c[_0x435332];return _0x4be29f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc466('0x0'));var moment=require(_0xc466('0x1'));var BPromise=require(_0xc466('0x2'));var Mustache=require(_0xc466('0x3'));var util=require(_0xc466('0x4'));var path=require(_0xc466('0x5'));var sox=require('sox');var csv=require(_0xc466('0x6'));var ejs=require(_0xc466('0x7'));var fs=require('fs');var fs_extra=require(_0xc466('0x8'));var _=require(_0xc466('0x9'));var squel=require('squel');var crypto=require(_0xc466('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc466('0xb'));var toCsv=require(_0xc466('0x6'));var querystring=require(_0xc466('0xc'));var Papa=require(_0xc466('0xd'));var Redis=require(_0xc466('0xe'));var authService=require(_0xc466('0xf'));var qs=require(_0xc466('0x10'));var as=require(_0xc466('0x11'));var hardwareService=require(_0xc466('0x12'));var logger=require(_0xc466('0x13'))(_0xc466('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc466('0x15'));var db=require(_0xc466('0x16'))['db'];function respondWithStatusCode(_0xad4c6b,_0x421512){_0x421512=_0x421512||0xcc;return function(_0x5e3467){if(_0x5e3467){return _0xad4c6b[_0xc466('0x17')](_0x421512);}return _0xad4c6b[_0xc466('0x18')](_0x421512)[_0xc466('0x19')]();};}function respondWithResult(_0x448869,_0x336f8c){_0x336f8c=_0x336f8c||0xc8;return function(_0x2ec1d8){if(_0x2ec1d8){return _0x448869['status'](_0x336f8c)[_0xc466('0x1a')](_0x2ec1d8);}};}function respondWithFilteredResult(_0x4e6ddb,_0xdac28f){return function(_0x40f22d){if(_0x40f22d){var _0x1d31c2=typeof _0xdac28f['offset']===_0xc466('0x1b')&&typeof _0xdac28f[_0xc466('0x1c')]===_0xc466('0x1b');var _0x502265=_0x40f22d[_0xc466('0x1d')];var _0x52ec81=_0x1d31c2?0x0:_0xdac28f['offset'];var _0x40f322=_0x1d31c2?_0x40f22d['count']:_0xdac28f[_0xc466('0x1e')]+_0xdac28f[_0xc466('0x1c')];var _0x372a13;if(_0x40f322>=_0x502265){_0x40f322=_0x502265;_0x372a13=0xc8;}else{_0x372a13=0xce;}_0x4e6ddb[_0xc466('0x18')](_0x372a13);return _0x4e6ddb[_0xc466('0x1f')](_0xc466('0x20'),_0x52ec81+'-'+_0x40f322+'/'+_0x502265)[_0xc466('0x1a')](_0x40f22d);}return null;};}function patchUpdates(_0x26724a){return function(_0x1732e6){try{jsonpatch['apply'](_0x1732e6,_0x26724a,!![]);}catch(_0x29285f){return BPromise[_0xc466('0x21')](_0x29285f);}return _0x1732e6['save']();};}function saveUpdates(_0x3d3bff,_0x3c2815){return function(_0x423407){if(_0x423407){return _0x423407['update'](_0x3d3bff)[_0xc466('0x22')](function(_0x20319b){return _0x20319b;});}return null;};}function removeEntity(_0x198ed8,_0x3c33ed){return function(_0x1ebcdd){if(_0x1ebcdd){return _0x1ebcdd[_0xc466('0x23')]()['then'](function(){_0x198ed8[_0xc466('0x18')](0xcc)[_0xc466('0x19')]();});}};}function handleEntityNotFound(_0x63432e,_0x338f85){return function(_0x4e6767){if(!_0x4e6767){_0x63432e['sendStatus'](0x194);}return _0x4e6767;};}function handleError(_0x1cd404,_0x19f3c8){_0x19f3c8=_0x19f3c8||0x1f4;return function(_0x4579b8){logger[_0xc466('0x24')](_0x4579b8[_0xc466('0x25')]);if(_0x4579b8[_0xc466('0x26')]){delete _0x4579b8['name'];}_0x1cd404[_0xc466('0x18')](_0x19f3c8)[_0xc466('0x27')](_0x4579b8);};}exports[_0xc466('0x28')]=function(_0x5b56dc,_0x4db771){var _0x214831={},_0x5e4708={},_0x407f93={'count':0x0,'rows':[]};var _0x372071=_[_0xc466('0x29')](db[_0xc466('0x2a')]['rawAttributes'],function(_0x5d048b){return{'name':_0x5d048b[_0xc466('0x2b')],'type':_0x5d048b[_0xc466('0x2c')]['key']};});_0x5e4708[_0xc466('0x2d')]=_['map'](_0x372071,'name');_0x5e4708['query']=_[_0xc466('0x2e')](_0x5b56dc['query']);_0x5e4708['filters']=_[_0xc466('0x2f')](_0x5e4708[_0xc466('0x2d')],_0x5e4708[_0xc466('0x30')]);_0x214831[_0xc466('0x31')]=_['intersection'](_0x5e4708[_0xc466('0x2d')],qs[_0xc466('0x32')](_0x5b56dc[_0xc466('0x30')][_0xc466('0x32')]));_0x214831[_0xc466('0x31')]=_0x214831[_0xc466('0x31')][_0xc466('0x33')]?_0x214831[_0xc466('0x31')]:_0x5e4708['model'];if(!_0x5b56dc[_0xc466('0x30')]['hasOwnProperty'](_0xc466('0x34'))){_0x214831[_0xc466('0x1c')]=qs[_0xc466('0x1c')](_0x5b56dc[_0xc466('0x30')][_0xc466('0x1c')]);_0x214831[_0xc466('0x1e')]=qs[_0xc466('0x1e')](_0x5b56dc[_0xc466('0x30')][_0xc466('0x1e')]);}_0x214831[_0xc466('0x35')]=qs[_0xc466('0x36')](_0x5b56dc[_0xc466('0x30')][_0xc466('0x36')]);_0x214831[_0xc466('0x37')]=qs['filters'](_[_0xc466('0x38')](_0x5b56dc[_0xc466('0x30')],_0x5e4708[_0xc466('0x39')]),_0x372071);if(_0x5b56dc[_0xc466('0x30')][_0xc466('0x3a')]){_0x214831[_0xc466('0x37')]=_[_0xc466('0x3b')](_0x214831['where'],{'$or':_[_0xc466('0x29')](_0x372071,function(_0x294355){if(_0x294355[_0xc466('0x2c')]!==_0xc466('0x3c')){var _0x5611dd={};_0x5611dd[_0x294355[_0xc466('0x26')]]={'$like':'%'+_0x5b56dc[_0xc466('0x30')][_0xc466('0x3a')]+'%'};return _0x5611dd;}})});}_0x214831=_[_0xc466('0x3b')]({},_0x214831,_0x5b56dc[_0xc466('0x3d')]);var _0x285f5c={'where':_0x214831[_0xc466('0x37')]};return db['AnalyticFieldReport'][_0xc466('0x1d')](_0x285f5c)['then'](function(_0x12a308){_0x407f93[_0xc466('0x1d')]=_0x12a308;if(_0x5b56dc[_0xc466('0x30')][_0xc466('0x3e')]){_0x214831[_0xc466('0x3f')]=[{'all':!![]}];}return db[_0xc466('0x2a')]['findAll'](_0x214831);})['then'](function(_0x301382){_0x407f93[_0xc466('0x40')]=_0x301382;return _0x407f93;})[_0xc466('0x22')](respondWithFilteredResult(_0x4db771,_0x214831))[_0xc466('0x41')](handleError(_0x4db771,null));};exports['show']=function(_0x1174d7,_0x531cce){var _0x2e04dd={'raw':![],'where':{'id':_0x1174d7[_0xc466('0x42')]['id']}},_0xa528d4={};_0xa528d4[_0xc466('0x2d')]=_[_0xc466('0x2e')](db['AnalyticFieldReport']['rawAttributes']);_0xa528d4[_0xc466('0x30')]=_[_0xc466('0x2e')](_0x1174d7[_0xc466('0x30')]);_0xa528d4[_0xc466('0x39')]=_[_0xc466('0x2f')](_0xa528d4['model'],_0xa528d4[_0xc466('0x30')]);_0x2e04dd[_0xc466('0x31')]=_[_0xc466('0x2f')](_0xa528d4[_0xc466('0x2d')],qs[_0xc466('0x32')](_0x1174d7[_0xc466('0x30')][_0xc466('0x32')]));_0x2e04dd[_0xc466('0x31')]=_0x2e04dd['attributes'][_0xc466('0x33')]?_0x2e04dd['attributes']:_0xa528d4[_0xc466('0x2d')];if(_0x1174d7[_0xc466('0x30')]['includeAll']){_0x2e04dd['include']=[{'all':!![]}];}_0x2e04dd=_[_0xc466('0x3b')]({},_0x2e04dd,_0x1174d7[_0xc466('0x3d')]);return db[_0xc466('0x2a')][_0xc466('0x43')](_0x2e04dd)[_0xc466('0x22')](handleEntityNotFound(_0x531cce,null))[_0xc466('0x22')](respondWithResult(_0x531cce,null))['catch'](handleError(_0x531cce,null));};exports['create']=function(_0x289b24,_0x4c5abb){return db[_0xc466('0x2a')][_0xc466('0x44')](_0x289b24[_0xc466('0x45')],{})[_0xc466('0x22')](respondWithResult(_0x4c5abb,0xc9))[_0xc466('0x41')](handleError(_0x4c5abb,null));};exports[_0xc466('0x46')]=function(_0x4a07ff,_0xd6148b){return db[_0xc466('0x2a')][_0xc466('0x46')](_0x4a07ff[_0xc466('0x45')],{'raw':![],'individualHooks':!![]})[_0xc466('0x22')](respondWithResult(_0xd6148b,0xc9))[_0xc466('0x41')](handleError(_0xd6148b,null));};exports[_0xc466('0x47')]=function(_0x3b2bb5,_0x28e4d7){if(_0x3b2bb5[_0xc466('0x45')]['id']){delete _0x3b2bb5[_0xc466('0x45')]['id'];}return db[_0xc466('0x2a')]['find']({'where':{'id':_0x3b2bb5[_0xc466('0x42')]['id']}})['then'](handleEntityNotFound(_0x28e4d7,null))[_0xc466('0x22')](saveUpdates(_0x3b2bb5[_0xc466('0x45')],null))[_0xc466('0x22')](respondWithResult(_0x28e4d7,null))[_0xc466('0x41')](handleError(_0x28e4d7,null));};exports[_0xc466('0x23')]=function(_0x475f57,_0x45d925){return db['AnalyticFieldReport'][_0xc466('0x43')]({'where':{'id':_0x475f57[_0xc466('0x42')]['id']}})[_0xc466('0x22')](handleEntityNotFound(_0x45d925,null))[_0xc466('0x22')](removeEntity(_0x45d925,null))[_0xc466('0x41')](handleError(_0x45d925,null));};exports[_0xc466('0x48')]=function(_0x1be587,_0x176014){return db[_0xc466('0x2a')][_0xc466('0x23')]({'where':{'id':_0x1be587[_0xc466('0x30')][_0xc466('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xc466('0x22')](respondWithResult(_0x176014,0xcc))[_0xc466('0x41')](handleError(_0x176014,null));};exports['addFields']=function(_0x46e5ba,_0x32a729,_0x124015){return db[_0xc466('0x4a')][_0xc466('0x4b')]({'where':{'id':_0x46e5ba[_0xc466('0x42')]['id']}})[_0xc466('0x22')](handleEntityNotFound(_0x32a729,null))[_0xc466('0x22')](function(_0x2b9b82){if(_0x2b9b82){return db['sequelize']['transaction'](function(_0x81cb18){return db[_0xc466('0x2a')][_0xc466('0x23')]({'where':{'CustomReportId':_0x46e5ba[_0xc466('0x42')]['id']},'transaction':_0x81cb18})['then'](function(_0xabee22){var _0x10797e=_[_0xc466('0x29')](_0x46e5ba[_0xc466('0x45')],function(_0x50dbab){delete _0x50dbab['id'];_0x50dbab[_0xc466('0x4c')]=_0x46e5ba[_0xc466('0x42')]['id'];return _0x50dbab;});return db[_0xc466('0x2a')]['bulkCreate'](_0x10797e,{'transaction':_0x81cb18});});})[_0xc466('0x22')](function(){return db[_0xc466('0x2a')][_0xc466('0x4d')]({'where':{'CustomReportId':_0x46e5ba[_0xc466('0x42')]['id']}});});}})[_0xc466('0x22')](respondWithResult(_0x32a729,null))['catch'](handleError(_0x32a729,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 0e54443..4ce92ae 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.model.js +++ b/server/api/analyticFieldReport/analyticFieldReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8321=['define','AnalyticFieldReport','analytics_report_fields','moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports'];(function(_0x458fd2,_0x58d0c3){var _0x4bf700=function(_0x307e1d){while(--_0x307e1d){_0x458fd2['push'](_0x458fd2['shift']());}};_0x4bf700(++_0x58d0c3);}(_0x8321,0x14d));var _0x1832=function(_0x27066f,_0xce5a46){_0x27066f=_0x27066f-0x0;var _0x5f4dff=_0x8321[_0x27066f];return _0x5f4dff;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1832('0x0'));var BPromise=require(_0x1832('0x1'));var rp=require(_0x1832('0x2'));var fs=require('fs');var path=require(_0x1832('0x3'));var rimraf=require(_0x1832('0x4'));var config=require('../../config/environment');var attributes=require(_0x1832('0x5'));module[_0x1832('0x6')]=function(_0x408781,_0x56a220){return _0x408781[_0x1832('0x7')](_0x1832('0x8'),attributes,{'tableName':_0x1832('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea7b=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','lodash','util','api'];(function(_0x33f0f1,_0x1cea77){var _0x398dee=function(_0x26a7e4){while(--_0x26a7e4){_0x33f0f1['push'](_0x33f0f1['shift']());}};_0x398dee(++_0x1cea77);}(_0xea7b,0x183));var _0xbea7=function(_0x9a0c2,_0x48a029){_0x9a0c2=_0x9a0c2-0x0;var _0x5d0fad=_0xea7b[_0x9a0c2];return _0x5d0fad;};'use strict';var _=require(_0xbea7('0x0'));var util=require(_0xbea7('0x1'));var logger=require('../../config/logger')(_0xbea7('0x2'));var moment=require(_0xbea7('0x3'));var BPromise=require(_0xbea7('0x4'));var rp=require(_0xbea7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbea7('0x6'));var config=require(_0xbea7('0x7'));var attributes=require(_0xbea7('0x8'));module['exports']=function(_0x3deb04,_0x242980){return _0x3deb04['define'](_0xbea7('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 7a2ef77..a69c34f 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js +++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca2c=['debug','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x55142d,_0x4e2243){var _0x3264c6=function(_0x193918){while(--_0x193918){_0x55142d['push'](_0x55142d['shift']());}};_0x3264c6(++_0x4e2243);}(_0xca2c,0xfd));var _0xcca2=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xca2c[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0xcca2('0x0'));var moment=require(_0xcca2('0x1'));var BPromise=require(_0xcca2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcca2('0x3'));var db=require(_0xcca2('0x4'))['db'];var utils=require(_0xcca2('0x5'));var logger=require(_0xcca2('0x6'))(_0xcca2('0x7'));var config=require(_0xcca2('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2141da,_0x3d670e,_0x23e4a8){return new BPromise(function(_0x548f3f,_0x336b60){return client[_0xcca2('0x9')](_0x2141da,_0x23e4a8)['then'](function(_0x24d5e5){logger[_0xcca2('0xa')](_0xcca2('0xb'),_0x3d670e,_0xcca2('0xc'));logger[_0xcca2('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3d670e,'request\x20sent',JSON['stringify'](_0x24d5e5));if(_0x24d5e5['error']){if(_0x24d5e5[_0xcca2('0xe')][_0xcca2('0xf')]===0x1f4){logger[_0xcca2('0xe')](_0xcca2('0xb'),_0x3d670e,_0x24d5e5['error'][_0xcca2('0x10')]);return _0x336b60(_0x24d5e5['error'][_0xcca2('0x10')]);}logger[_0xcca2('0xe')](_0xcca2('0xb'),_0x3d670e,_0x24d5e5['error']['message']);return _0x548f3f(_0x24d5e5[_0xcca2('0xe')]['message']);}else{logger[_0xcca2('0xa')](_0xcca2('0xb'),_0x3d670e,_0xcca2('0xc'));_0x548f3f(_0x24d5e5[_0xcca2('0x11')]['message']);}})[_0xcca2('0x12')](function(_0x3673e5){logger[_0xcca2('0xe')](_0xcca2('0xb'),_0x3d670e,_0x3673e5);_0x336b60(_0x3673e5);});});} \ No newline at end of file +var _0x76e4=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x76e4,0x1dd));var _0x476e=function(_0x585a77,_0x587b08){_0x585a77=_0x585a77-0x0;var _0x89feef=_0x76e4[_0x585a77];return _0x89feef;};'use strict';var _=require(_0x476e('0x0'));var util=require(_0x476e('0x1'));var moment=require(_0x476e('0x2'));var BPromise=require('bluebird');var rs=require(_0x476e('0x3'));var fs=require('fs');var Redis=require(_0x476e('0x4'));var db=require(_0x476e('0x5'))['db'];var utils=require(_0x476e('0x6'));var logger=require(_0x476e('0x7'))(_0x476e('0x8'));var config=require('../../config/environment');var jayson=require(_0x476e('0x9'));var client=jayson[_0x476e('0xa')][_0x476e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52d21e,_0x14bcb1,_0x1da3d1){return new BPromise(function(_0x4a60b8,_0x280a97){return client['request'](_0x52d21e,_0x1da3d1)[_0x476e('0xc')](function(_0x30f3be){logger[_0x476e('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x14bcb1,_0x476e('0xe'));logger[_0x476e('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x14bcb1,_0x476e('0xe'),JSON[_0x476e('0x10')](_0x30f3be));if(_0x30f3be[_0x476e('0x11')]){if(_0x30f3be[_0x476e('0x11')][_0x476e('0x12')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x14bcb1,_0x30f3be[_0x476e('0x11')][_0x476e('0x13')]);return _0x280a97(_0x30f3be['error'][_0x476e('0x13')]);}logger[_0x476e('0x11')](_0x476e('0x14'),_0x14bcb1,_0x30f3be[_0x476e('0x11')][_0x476e('0x13')]);return _0x4a60b8(_0x30f3be[_0x476e('0x11')][_0x476e('0x13')]);}else{logger['info'](_0x476e('0x14'),_0x14bcb1,_0x476e('0xe'));_0x4a60b8(_0x30f3be[_0x476e('0x15')][_0x476e('0x13')]);}})[_0x476e('0x16')](function(_0x24d3fc){logger[_0x476e('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x14bcb1,_0x24d3fc);_0x280a97(_0x24d3fc);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 62fcc2c..33ce5d2 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x30448c,_0x3a913b){var _0x1ca286=function(_0x264237){while(--_0x264237){_0x30448c['push'](_0x30448c['shift']());}};_0x1ca286(++_0x3a913b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x1a3cdd,_0x4c5f4f){var _0x1514e5=function(_0x38487f){while(--_0x38487f){_0x1a3cdd['push'](_0x1a3cdd['shift']());}};_0x1514e5(++_0x4c5f4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 95c991d..853dcfd 100644 --- a/server/api/analyticMetric/analyticMetric.attributes.js +++ b/server/api/analyticMetric/analyticMetric.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22a4=['exports','STRING','name','TEXT','sequelize'];(function(_0x24ee40,_0x2daf47){var _0x353ddb=function(_0x2a5828){while(--_0x2a5828){_0x24ee40['push'](_0x24ee40['shift']());}};_0x353ddb(++_0x2daf47);}(_0x22a4,0x1cb));var _0x422a=function(_0x1c2599,_0x4db2c1){_0x1c2599=_0x1c2599-0x0;var _0x5debd9=_0x22a4[_0x1c2599];return _0x5debd9;};'use strict';var Sequelize=require(_0x422a('0x0'));module[_0x422a('0x1')]={'name':{'type':Sequelize[_0x422a('0x2')],'allowNull':![],'unique':_0x422a('0x3')},'table':{'type':Sequelize[_0x422a('0x2')]},'metric':{'type':Sequelize[_0x422a('0x4')]},'description':{'type':Sequelize[_0x422a('0x2')]}}; \ No newline at end of file +var _0x9ffd=['STRING','TEXT','sequelize','exports'];(function(_0x5bf9ea,_0x4668d8){var _0xdccf57=function(_0x454040){while(--_0x454040){_0x5bf9ea['push'](_0x5bf9ea['shift']());}};_0xdccf57(++_0x4668d8);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3f13e9,_0x362482){_0x3f13e9=_0x3f13e9-0x0;var _0x3bf38c=_0x9ffd[_0x3f13e9];return _0x3bf38c;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'name':{'type':Sequelize[_0xd9ff('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xd9ff('0x2')]},'metric':{'type':Sequelize[_0xd9ff('0x3')]},'description':{'type':Sequelize[_0xd9ff('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index bc6067f..0b12743 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1f83da,_0x3b991a){var _0x3e6b53=function(_0x245488){while(--_0x245488){_0x1f83da['push'](_0x1f83da['shift']());}};_0x3e6b53(++_0x3b991a);}(_0x55ca,0x126));var _0xa55c=function(_0x46ee3c,_0x1c08f0){_0x46ee3c=_0x46ee3c-0x0;var _0x530a97=_0x55ca[_0x46ee3c];return _0x530a97;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));}; \ No newline at end of file +var _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x122751,_0x48aa61){var _0xc1ac24=function(_0x307a3f){while(--_0x307a3f){_0x122751['push'](_0x122751['shift']());}};_0xc1ac24(++_0x48aa61);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x4b84[_0x5c2e5e];return _0x46a5da;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index f6317c2..37ed403 100644 --- a/server/api/analyticMetric/analyticMetric.model.js +++ b/server/api/analyticMetric/analyticMetric.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8403=['rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x8403,0x1a5));var _0x3840=function(_0x128b73,_0xcd89ed){_0x128b73=_0x128b73-0x0;var _0x5dfd52=_0x8403[_0x128b73];return _0x5dfd52;};'use strict';var _=require(_0x3840('0x0'));var util=require(_0x3840('0x1'));var logger=require(_0x3840('0x2'))(_0x3840('0x3'));var moment=require(_0x3840('0x4'));var BPromise=require(_0x3840('0x5'));var rp=require(_0x3840('0x6'));var fs=require('fs');var path=require(_0x3840('0x7'));var rimraf=require(_0x3840('0x8'));var config=require('../../config/environment');var attributes=require(_0x3840('0x9'));module[_0x3840('0xa')]=function(_0x1cd658,_0x233be3){return _0x1cd658[_0x3840('0xb')](_0x3840('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56da=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x48083e,_0x5edb05){var _0x1afbdd=function(_0x28289c){while(--_0x28289c){_0x48083e['push'](_0x48083e['shift']());}};_0x1afbdd(++_0x5edb05);}(_0x56da,0x119));var _0xa56d=function(_0x1b8524,_0x1bb669){_0x1b8524=_0x1b8524-0x0;var _0x81418d=_0x56da[_0x1b8524];return _0x81418d;};'use strict';var _=require(_0xa56d('0x0'));var util=require('util');var logger=require(_0xa56d('0x1'))(_0xa56d('0x2'));var moment=require('moment');var BPromise=require(_0xa56d('0x3'));var rp=require(_0xa56d('0x4'));var fs=require('fs');var path=require(_0xa56d('0x5'));var rimraf=require(_0xa56d('0x6'));var config=require(_0xa56d('0x7'));var attributes=require(_0xa56d('0x8'));module[_0xa56d('0x9')]=function(_0x14a16e,_0x4751ee){return _0x14a16e[_0xa56d('0xa')](_0xa56d('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index e2cc752..09fdf9f 100644 --- a/server/api/analyticMetric/analyticMetric.rpc.js +++ b/server/api/analyticMetric/analyticMetric.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x896e=['randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','moment'];(function(_0x3f80af,_0x38d5d7){var _0x4c9125=function(_0x35c760){while(--_0x35c760){_0x3f80af['push'](_0x3f80af['shift']());}};_0x4c9125(++_0x38d5d7);}(_0x896e,0x131));var _0xe896=function(_0x6783c3,_0x476220){_0x6783c3=_0x6783c3-0x0;var _0x1fdaf7=_0x896e[_0x6783c3];return _0x1fdaf7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe896('0x0'));var BPromise=require('bluebird');var rs=require(_0xe896('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe896('0x2'))['db'];var utils=require(_0xe896('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe896('0x4'));var client=jayson[_0xe896('0x5')][_0xe896('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3b7594,_0x55a3ae,_0x5a285a){return new BPromise(function(_0xc3fdfd,_0x1c787b){return client[_0xe896('0x7')](_0x3b7594,_0x5a285a)['then'](function(_0x38110d){logger['info'](_0xe896('0x8'),_0x55a3ae,'request\x20sent');logger[_0xe896('0x9')](_0xe896('0xa'),_0x55a3ae,_0xe896('0xb'),JSON['stringify'](_0x38110d));if(_0x38110d[_0xe896('0xc')]){if(_0x38110d['error'][_0xe896('0xd')]===0x1f4){logger['error'](_0xe896('0x8'),_0x55a3ae,_0x38110d['error'][_0xe896('0xe')]);return _0x1c787b(_0x38110d[_0xe896('0xc')]['message']);}logger[_0xe896('0xc')](_0xe896('0x8'),_0x55a3ae,_0x38110d[_0xe896('0xc')][_0xe896('0xe')]);return _0xc3fdfd(_0x38110d[_0xe896('0xc')][_0xe896('0xe')]);}else{logger[_0xe896('0xf')](_0xe896('0x8'),_0x55a3ae,'request\x20sent');_0xc3fdfd(_0x38110d[_0xe896('0x10')][_0xe896('0xe')]);}})[_0xe896('0x11')](function(_0x4e1717){logger[_0xe896('0xc')](_0xe896('0x8'),_0x55a3ae,_0x4e1717);_0x1c787b(_0x4e1717);});});} \ No newline at end of file +var _0xed5f=['request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4a9dc0,_0x1a8db5){var _0x5da5c2=function(_0x1e2166){while(--_0x1e2166){_0x4a9dc0['push'](_0x4a9dc0['shift']());}};_0x5da5c2(++_0x1a8db5);}(_0xed5f,0x1b6));var _0xfed5=function(_0x12583b,_0x18e3d6){_0x12583b=_0x12583b-0x0;var _0x4c5254=_0xed5f[_0x12583b];return _0x4c5254;};'use strict';var _=require(_0xfed5('0x0'));var util=require(_0xfed5('0x1'));var moment=require(_0xfed5('0x2'));var BPromise=require(_0xfed5('0x3'));var rs=require(_0xfed5('0x4'));var fs=require('fs');var Redis=require(_0xfed5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfed5('0x6'));var logger=require(_0xfed5('0x7'))(_0xfed5('0x8'));var config=require(_0xfed5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfed5('0xa')][_0xfed5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10fe81,_0x106f84,_0x4105ed){return new BPromise(function(_0x52cdc3,_0x2af890){return client[_0xfed5('0xc')](_0x10fe81,_0x4105ed)[_0xfed5('0xd')](function(_0x1fbc61){logger[_0xfed5('0xe')](_0xfed5('0xf'),_0x106f84,'request\x20sent');logger[_0xfed5('0x10')](_0xfed5('0x11'),_0x106f84,_0xfed5('0x12'),JSON[_0xfed5('0x13')](_0x1fbc61));if(_0x1fbc61[_0xfed5('0x14')]){if(_0x1fbc61[_0xfed5('0x14')][_0xfed5('0x15')]===0x1f4){logger['error'](_0xfed5('0xf'),_0x106f84,_0x1fbc61[_0xfed5('0x14')][_0xfed5('0x16')]);return _0x2af890(_0x1fbc61[_0xfed5('0x14')][_0xfed5('0x16')]);}logger[_0xfed5('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x106f84,_0x1fbc61[_0xfed5('0x14')]['message']);return _0x52cdc3(_0x1fbc61[_0xfed5('0x14')][_0xfed5('0x16')]);}else{logger[_0xfed5('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x106f84,_0xfed5('0x12'));_0x52cdc3(_0x1fbc61[_0xfed5('0x17')][_0xfed5('0x16')]);}})[_0xfed5('0x18')](function(_0x2fc432){logger[_0xfed5('0x14')](_0xfed5('0xf'),_0x106f84,_0x2fc432);_0x2af890(_0x2fc432);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 8fa33de..c786c4f 100644 --- a/server/api/analyticMetric/index.js +++ b/server/api/analyticMetric/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6d2=['../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x1b8736,_0xeee7bc){var _0x43d1bb=function(_0x2f6f51){while(--_0x2f6f51){_0x1b8736['push'](_0x1b8736['shift']());}};_0x43d1bb(++_0xeee7bc);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x229f4,_0x33e95c){_0x229f4=_0x229f4-0x0;var _0x9154fe=_0xd6d2[_0x229f4];return _0x9154fe;};'use strict';var multer=require(_0x2d6d('0x0'));var util=require(_0x2d6d('0x1'));var path=require('path');var timeout=require(_0x2d6d('0x2'));var express=require(_0x2d6d('0x3'));var router=express['Router']();var fs_extra=require(_0x2d6d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2d6d('0x5'));var config=require(_0x2d6d('0x6'));var controller=require(_0x2d6d('0x7'));router['get']('/',auth[_0x2d6d('0x8')](),controller[_0x2d6d('0x9')]);router[_0x2d6d('0xa')](_0x2d6d('0xb'),auth[_0x2d6d('0x8')](),controller[_0x2d6d('0xc')]);router[_0x2d6d('0xd')]('/',auth[_0x2d6d('0x8')](),controller[_0x2d6d('0xe')]);router[_0x2d6d('0xf')](_0x2d6d('0xb'),auth['isAuthenticated'](),controller[_0x2d6d('0x10')]);router[_0x2d6d('0x11')](_0x2d6d('0xb'),auth[_0x2d6d('0x8')](),controller[_0x2d6d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x885a=['put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','show','post','isAuthenticated'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x885a,0x180));var _0xa885=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x885a[_0x2be8c2];return _0x97f531;};'use strict';var multer=require('multer');var util=require(_0xa885('0x0'));var path=require(_0xa885('0x1'));var timeout=require(_0xa885('0x2'));var express=require(_0xa885('0x3'));var router=express['Router']();var fs_extra=require(_0xa885('0x4'));var auth=require(_0xa885('0x5'));var interaction=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var controller=require(_0xa885('0x8'));router[_0xa885('0x9')]('/',auth['isAuthenticated'](),controller[_0xa885('0xa')]);router[_0xa885('0x9')](_0xa885('0xb'),auth['isAuthenticated'](),controller[_0xa885('0xc')]);router[_0xa885('0xd')]('/',auth[_0xa885('0xe')](),controller['create']);router[_0xa885('0xf')](_0xa885('0xb'),auth[_0xa885('0xe')](),controller[_0xa885('0x10')]);router[_0xa885('0x11')](_0xa885('0xb'),auth[_0xa885('0xe')](),controller['destroy']);module[_0xa885('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 0112d3c..eef218b 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f17=['exports','TEXT'];(function(_0x488d36,_0x596111){var _0x23fb9f=function(_0x16ad41){while(--_0x16ad41){_0x488d36['push'](_0x488d36['shift']());}};_0x23fb9f(++_0x596111);}(_0x4f17,0x17e));var _0x74f1=function(_0x2e68db,_0x275d04){_0x2e68db=_0x2e68db-0x0;var _0x12df4c=_0x4f17[_0x2e68db];return _0x12df4c;};'use strict';var Sequelize=require('sequelize');module[_0x74f1('0x0')]={'tree':{'type':Sequelize[_0x74f1('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x932f=['exports','TEXT'];(function(_0xefb968,_0x190d8d){var _0x393f43=function(_0x2567f9){while(--_0x2567f9){_0xefb968['push'](_0xefb968['shift']());}};_0x393f43(++_0x190d8d);}(_0x932f,0x9e));var _0xf932=function(_0x4b20bc,_0x2febc4){_0x4b20bc=_0x4b20bc-0x0;var _0x20ff77=_0x932f[_0x4b20bc];return _0x20ff77;};'use strict';var Sequelize=require('sequelize');module[_0xf932('0x0')]={'tree':{'type':Sequelize[_0xf932('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 351ae7f..a921712 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.controller.js +++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe76d=['name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','AnalyticTreeReport','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','error','stack'];(function(_0x4b1871,_0x3313cd){var _0x8d91cb=function(_0x31bfca){while(--_0x31bfca){_0x4b1871['push'](_0x4b1871['shift']());}};_0x8d91cb(++_0x3313cd);}(_0xe76d,0x150));var _0xde76=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xe76d[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require(_0xde76('0x0'));var rimraf=require(_0xde76('0x1'));var zipdir=require(_0xde76('0x2'));var jsonpatch=require(_0xde76('0x3'));var rp=require(_0xde76('0x4'));var moment=require('moment');var BPromise=require(_0xde76('0x5'));var Mustache=require(_0xde76('0x6'));var util=require('util');var path=require(_0xde76('0x7'));var sox=require('sox');var csv=require(_0xde76('0x8'));var ejs=require(_0xde76('0x9'));var fs=require('fs');var fs_extra=require(_0xde76('0xa'));var _=require('lodash');var squel=require(_0xde76('0xb'));var crypto=require(_0xde76('0xc'));var jsforce=require(_0xde76('0xd'));var deskjs=require(_0xde76('0xe'));var toCsv=require(_0xde76('0x8'));var querystring=require(_0xde76('0xf'));var Papa=require('papaparse');var Redis=require(_0xde76('0x10'));var authService=require(_0xde76('0x11'));var qs=require(_0xde76('0x12'));var as=require(_0xde76('0x13'));var hardwareService=require(_0xde76('0x14'));var logger=require(_0xde76('0x15'))('api');var utils=require(_0xde76('0x16'));var config=require(_0xde76('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9df554,_0x1e3353){_0x1e3353=_0x1e3353||0xcc;return function(_0x819530){if(_0x819530){return _0x9df554[_0xde76('0x18')](_0x1e3353);}return _0x9df554[_0xde76('0x19')](_0x1e3353)[_0xde76('0x1a')]();};}function respondWithResult(_0x337f7c,_0x28492e){_0x28492e=_0x28492e||0xc8;return function(_0x1dc493){if(_0x1dc493){return _0x337f7c[_0xde76('0x19')](_0x28492e)[_0xde76('0x1b')](_0x1dc493);}};}function respondWithFilteredResult(_0x89f1ec,_0x91d308){return function(_0x4ed383){if(_0x4ed383){var _0x1dbe39=typeof _0x91d308[_0xde76('0x1c')]===_0xde76('0x1d')&&typeof _0x91d308['limit']===_0xde76('0x1d');var _0x575c8f=_0x4ed383[_0xde76('0x1e')];var _0x8d6ed0=_0x1dbe39?0x0:_0x91d308[_0xde76('0x1c')];var _0x930acb=_0x1dbe39?_0x4ed383[_0xde76('0x1e')]:_0x91d308[_0xde76('0x1c')]+_0x91d308['limit'];var _0x3a61ca;if(_0x930acb>=_0x575c8f){_0x930acb=_0x575c8f;_0x3a61ca=0xc8;}else{_0x3a61ca=0xce;}_0x89f1ec[_0xde76('0x19')](_0x3a61ca);return _0x89f1ec[_0xde76('0x1f')](_0xde76('0x20'),_0x8d6ed0+'-'+_0x930acb+'/'+_0x575c8f)['json'](_0x4ed383);}return null;};}function patchUpdates(_0x5eb7df){return function(_0x5b0e0d){try{jsonpatch['apply'](_0x5b0e0d,_0x5eb7df,!![]);}catch(_0xcbb73d){return BPromise[_0xde76('0x21')](_0xcbb73d);}return _0x5b0e0d[_0xde76('0x22')]();};}function saveUpdates(_0x3ddef8,_0x170080){return function(_0x418fa8){if(_0x418fa8){return _0x418fa8[_0xde76('0x23')](_0x3ddef8)['then'](function(_0x58d1fb){return _0x58d1fb;});}return null;};}function removeEntity(_0x285605,_0x535ec0){return function(_0x2af08c){if(_0x2af08c){return _0x2af08c[_0xde76('0x24')]()['then'](function(){_0x285605[_0xde76('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26b677,_0x2602fb){return function(_0xa03dee){if(!_0xa03dee){_0x26b677[_0xde76('0x18')](0x194);}return _0xa03dee;};}function handleError(_0x26a014,_0x5cf390){_0x5cf390=_0x5cf390||0x1f4;return function(_0xd741f0){logger[_0xde76('0x25')](_0xd741f0[_0xde76('0x26')]);if(_0xd741f0['name']){delete _0xd741f0[_0xde76('0x27')];}_0x26a014[_0xde76('0x19')](_0x5cf390)[_0xde76('0x28')](_0xd741f0);};}exports['index']=function(_0x5e2ac7,_0x4ce5c5){var _0x227487={},_0x878b4a={},_0x3c7427={'count':0x0,'rows':[]};var _0xd73821=_[_0xde76('0x29')](db['AnalyticTreeReport'][_0xde76('0x2a')],function(_0xf6b9ec){return{'name':_0xf6b9ec[_0xde76('0x2b')],'type':_0xf6b9ec[_0xde76('0x2c')]['key']};});_0x878b4a[_0xde76('0x2d')]=_['map'](_0xd73821,_0xde76('0x27'));_0x878b4a[_0xde76('0x2e')]=_[_0xde76('0x2f')](_0x5e2ac7[_0xde76('0x2e')]);_0x878b4a[_0xde76('0x30')]=_['intersection'](_0x878b4a['model'],_0x878b4a[_0xde76('0x2e')]);_0x227487[_0xde76('0x31')]=_[_0xde76('0x32')](_0x878b4a[_0xde76('0x2d')],qs[_0xde76('0x33')](_0x5e2ac7[_0xde76('0x2e')][_0xde76('0x33')]));_0x227487[_0xde76('0x31')]=_0x227487['attributes'][_0xde76('0x34')]?_0x227487[_0xde76('0x31')]:_0x878b4a[_0xde76('0x2d')];if(!_0x5e2ac7[_0xde76('0x2e')][_0xde76('0x35')](_0xde76('0x36'))){_0x227487[_0xde76('0x37')]=qs[_0xde76('0x37')](_0x5e2ac7[_0xde76('0x2e')][_0xde76('0x37')]);_0x227487[_0xde76('0x1c')]=qs[_0xde76('0x1c')](_0x5e2ac7[_0xde76('0x2e')]['offset']);}_0x227487[_0xde76('0x38')]=qs[_0xde76('0x39')](_0x5e2ac7[_0xde76('0x2e')]['sort']);_0x227487[_0xde76('0x3a')]=qs[_0xde76('0x30')](_[_0xde76('0x3b')](_0x5e2ac7[_0xde76('0x2e')],_0x878b4a[_0xde76('0x30')]),_0xd73821);if(_0x5e2ac7[_0xde76('0x2e')][_0xde76('0x3c')]){_0x227487['where']=_[_0xde76('0x3d')](_0x227487[_0xde76('0x3a')],{'$or':_[_0xde76('0x29')](_0xd73821,function(_0x2c78ab){if(_0x2c78ab[_0xde76('0x2c')]!=='VIRTUAL'){var _0x5eadff={};_0x5eadff[_0x2c78ab[_0xde76('0x27')]]={'$like':'%'+_0x5e2ac7[_0xde76('0x2e')][_0xde76('0x3c')]+'%'};return _0x5eadff;}})});}_0x227487=_['merge']({},_0x227487,_0x5e2ac7[_0xde76('0x3e')]);var _0x178097={'where':_0x227487['where']};return db[_0xde76('0x3f')][_0xde76('0x1e')](_0x178097)[_0xde76('0x40')](function(_0x3e4387){_0x3c7427['count']=_0x3e4387;if(_0x5e2ac7['query'][_0xde76('0x41')]){_0x227487[_0xde76('0x42')]=[{'all':!![]}];}return db[_0xde76('0x3f')][_0xde76('0x43')](_0x227487);})[_0xde76('0x40')](function(_0x42fbf2){_0x3c7427[_0xde76('0x44')]=_0x42fbf2;return _0x3c7427;})['then'](respondWithFilteredResult(_0x4ce5c5,_0x227487))[_0xde76('0x45')](handleError(_0x4ce5c5,null));};exports[_0xde76('0x46')]=function(_0x517424,_0x48faf9){var _0x552b80={'raw':!![],'where':{'id':_0x517424[_0xde76('0x47')]['id']}},_0x36102d={};_0x36102d['model']=_[_0xde76('0x2f')](db[_0xde76('0x3f')][_0xde76('0x2a')]);_0x36102d[_0xde76('0x2e')]=_['keys'](_0x517424[_0xde76('0x2e')]);_0x36102d[_0xde76('0x30')]=_[_0xde76('0x32')](_0x36102d[_0xde76('0x2d')],_0x36102d['query']);_0x552b80[_0xde76('0x31')]=_['intersection'](_0x36102d['model'],qs['fields'](_0x517424['query']['fields']));_0x552b80[_0xde76('0x31')]=_0x552b80[_0xde76('0x31')][_0xde76('0x34')]?_0x552b80[_0xde76('0x31')]:_0x36102d[_0xde76('0x2d')];if(_0x517424[_0xde76('0x2e')][_0xde76('0x41')]){_0x552b80[_0xde76('0x42')]=[{'all':!![]}];}_0x552b80=_[_0xde76('0x3d')]({},_0x552b80,_0x517424[_0xde76('0x3e')]);return db[_0xde76('0x3f')][_0xde76('0x48')](_0x552b80)['then'](handleEntityNotFound(_0x48faf9,null))[_0xde76('0x40')](respondWithResult(_0x48faf9,null))[_0xde76('0x45')](handleError(_0x48faf9,null));};exports[_0xde76('0x49')]=function(_0x3d1572,_0x241fb3){return db['AnalyticTreeReport'][_0xde76('0x49')](_0x3d1572['body'],{})['then'](respondWithResult(_0x241fb3,0xc9))[_0xde76('0x45')](handleError(_0x241fb3,null));};exports[_0xde76('0x23')]=function(_0x1b5d90,_0x5dcd65){if(_0x1b5d90[_0xde76('0x4a')]['id']){delete _0x1b5d90[_0xde76('0x4a')]['id'];}return db[_0xde76('0x3f')][_0xde76('0x48')]({'where':{'id':_0x1b5d90[_0xde76('0x47')]['id']}})[_0xde76('0x40')](handleEntityNotFound(_0x5dcd65,null))[_0xde76('0x40')](saveUpdates(_0x1b5d90[_0xde76('0x4a')],null))[_0xde76('0x40')](respondWithResult(_0x5dcd65,null))['catch'](handleError(_0x5dcd65,null));};exports[_0xde76('0x24')]=function(_0x2d2687,_0x4ba9e9){return db['AnalyticTreeReport'][_0xde76('0x48')]({'where':{'id':_0x2d2687['params']['id']}})[_0xde76('0x40')](handleEntityNotFound(_0x4ba9e9,null))[_0xde76('0x40')](removeEntity(_0x4ba9e9,null))['catch'](handleError(_0x4ba9e9,null));}; \ No newline at end of file +var _0x9afa=['model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','rows','catch','params','fields','includeAll','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x9afa,0x191));var _0xa9af=function(_0x3ee007,_0x4d1cf6){_0x3ee007=_0x3ee007-0x0;var _0x26cf0a=_0x9afa[_0x3ee007];return _0x26cf0a;};'use strict';var emlformat=require(_0xa9af('0x0'));var rimraf=require(_0xa9af('0x1'));var zipdir=require(_0xa9af('0x2'));var jsonpatch=require(_0xa9af('0x3'));var rp=require(_0xa9af('0x4'));var moment=require(_0xa9af('0x5'));var BPromise=require(_0xa9af('0x6'));var Mustache=require(_0xa9af('0x7'));var util=require(_0xa9af('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa9af('0x9'));var ejs=require(_0xa9af('0xa'));var fs=require('fs');var fs_extra=require(_0xa9af('0xb'));var _=require(_0xa9af('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9af('0xd'));var deskjs=require(_0xa9af('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa9af('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa9af('0x10'));var logger=require(_0xa9af('0x11'))(_0xa9af('0x12'));var utils=require(_0xa9af('0x13'));var config=require(_0xa9af('0x14'));var licenseUtil=require(_0xa9af('0x15'));var db=require(_0xa9af('0x16'))['db'];function respondWithStatusCode(_0x21fa41,_0x55aab8){_0x55aab8=_0x55aab8||0xcc;return function(_0x3b4233){if(_0x3b4233){return _0x21fa41['sendStatus'](_0x55aab8);}return _0x21fa41[_0xa9af('0x17')](_0x55aab8)[_0xa9af('0x18')]();};}function respondWithResult(_0x29f27f,_0x49ddb2){_0x49ddb2=_0x49ddb2||0xc8;return function(_0x2128f2){if(_0x2128f2){return _0x29f27f[_0xa9af('0x17')](_0x49ddb2)[_0xa9af('0x19')](_0x2128f2);}};}function respondWithFilteredResult(_0x2fd8c9,_0x18748a){return function(_0x542d6e){if(_0x542d6e){var _0x4538a6=typeof _0x18748a[_0xa9af('0x1a')]===_0xa9af('0x1b')&&typeof _0x18748a[_0xa9af('0x1c')]===_0xa9af('0x1b');var _0x51e160=_0x542d6e[_0xa9af('0x1d')];var _0x276e33=_0x4538a6?0x0:_0x18748a['offset'];var _0x1b1030=_0x4538a6?_0x542d6e['count']:_0x18748a[_0xa9af('0x1a')]+_0x18748a[_0xa9af('0x1c')];var _0x207e24;if(_0x1b1030>=_0x51e160){_0x1b1030=_0x51e160;_0x207e24=0xc8;}else{_0x207e24=0xce;}_0x2fd8c9[_0xa9af('0x17')](_0x207e24);return _0x2fd8c9[_0xa9af('0x1e')](_0xa9af('0x1f'),_0x276e33+'-'+_0x1b1030+'/'+_0x51e160)[_0xa9af('0x19')](_0x542d6e);}return null;};}function patchUpdates(_0x3bc223){return function(_0x402820){try{jsonpatch[_0xa9af('0x20')](_0x402820,_0x3bc223,!![]);}catch(_0x207c44){return BPromise[_0xa9af('0x21')](_0x207c44);}return _0x402820[_0xa9af('0x22')]();};}function saveUpdates(_0x1146d4,_0x2e1d11){return function(_0x3b2cf1){if(_0x3b2cf1){return _0x3b2cf1[_0xa9af('0x23')](_0x1146d4)[_0xa9af('0x24')](function(_0x9bd70c){return _0x9bd70c;});}return null;};}function removeEntity(_0x43bd41,_0x1c4e55){return function(_0xc2d706){if(_0xc2d706){return _0xc2d706[_0xa9af('0x25')]()[_0xa9af('0x24')](function(){_0x43bd41[_0xa9af('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x219f15,_0x15a9bf){return function(_0x537321){if(!_0x537321){_0x219f15['sendStatus'](0x194);}return _0x537321;};}function handleError(_0x18b088,_0x320879){_0x320879=_0x320879||0x1f4;return function(_0x515c07){logger[_0xa9af('0x26')](_0x515c07[_0xa9af('0x27')]);if(_0x515c07[_0xa9af('0x28')]){delete _0x515c07['name'];}_0x18b088['status'](_0x320879)[_0xa9af('0x29')](_0x515c07);};}exports[_0xa9af('0x2a')]=function(_0xfe99d,_0xf57176){var _0x47e8b3={},_0x369e00={},_0x4480d1={'count':0x0,'rows':[]};var _0x31d349=_[_0xa9af('0x2b')](db[_0xa9af('0x2c')][_0xa9af('0x2d')],function(_0x4cba5b){return{'name':_0x4cba5b[_0xa9af('0x2e')],'type':_0x4cba5b[_0xa9af('0x2f')][_0xa9af('0x30')]};});_0x369e00[_0xa9af('0x31')]=_[_0xa9af('0x2b')](_0x31d349,'name');_0x369e00[_0xa9af('0x32')]=_[_0xa9af('0x33')](_0xfe99d[_0xa9af('0x32')]);_0x369e00['filters']=_[_0xa9af('0x34')](_0x369e00['model'],_0x369e00['query']);_0x47e8b3['attributes']=_[_0xa9af('0x34')](_0x369e00[_0xa9af('0x31')],qs['fields'](_0xfe99d[_0xa9af('0x32')]['fields']));_0x47e8b3['attributes']=_0x47e8b3[_0xa9af('0x35')][_0xa9af('0x36')]?_0x47e8b3['attributes']:_0x369e00[_0xa9af('0x31')];if(!_0xfe99d[_0xa9af('0x32')][_0xa9af('0x37')](_0xa9af('0x38'))){_0x47e8b3[_0xa9af('0x1c')]=qs[_0xa9af('0x1c')](_0xfe99d['query']['limit']);_0x47e8b3[_0xa9af('0x1a')]=qs[_0xa9af('0x1a')](_0xfe99d[_0xa9af('0x32')][_0xa9af('0x1a')]);}_0x47e8b3[_0xa9af('0x39')]=qs['sort'](_0xfe99d[_0xa9af('0x32')][_0xa9af('0x3a')]);_0x47e8b3[_0xa9af('0x3b')]=qs[_0xa9af('0x3c')](_[_0xa9af('0x3d')](_0xfe99d[_0xa9af('0x32')],_0x369e00[_0xa9af('0x3c')]),_0x31d349);if(_0xfe99d[_0xa9af('0x32')][_0xa9af('0x3e')]){_0x47e8b3['where']=_[_0xa9af('0x3f')](_0x47e8b3[_0xa9af('0x3b')],{'$or':_[_0xa9af('0x2b')](_0x31d349,function(_0x30efc7){if(_0x30efc7[_0xa9af('0x2f')]!==_0xa9af('0x40')){var _0x1869df={};_0x1869df[_0x30efc7['name']]={'$like':'%'+_0xfe99d[_0xa9af('0x32')][_0xa9af('0x3e')]+'%'};return _0x1869df;}})});}_0x47e8b3=_[_0xa9af('0x3f')]({},_0x47e8b3,_0xfe99d['options']);var _0x537116={'where':_0x47e8b3['where']};return db[_0xa9af('0x2c')]['count'](_0x537116)['then'](function(_0x51c562){_0x4480d1[_0xa9af('0x1d')]=_0x51c562;if(_0xfe99d[_0xa9af('0x32')]['includeAll']){_0x47e8b3['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x47e8b3);})['then'](function(_0x43320c){_0x4480d1[_0xa9af('0x41')]=_0x43320c;return _0x4480d1;})['then'](respondWithFilteredResult(_0xf57176,_0x47e8b3))[_0xa9af('0x42')](handleError(_0xf57176,null));};exports['show']=function(_0x5d9a84,_0xd5cc9e){var _0x2fb3e4={'raw':!![],'where':{'id':_0x5d9a84[_0xa9af('0x43')]['id']}},_0x524965={};_0x524965[_0xa9af('0x31')]=_[_0xa9af('0x33')](db[_0xa9af('0x2c')][_0xa9af('0x2d')]);_0x524965[_0xa9af('0x32')]=_[_0xa9af('0x33')](_0x5d9a84[_0xa9af('0x32')]);_0x524965['filters']=_[_0xa9af('0x34')](_0x524965[_0xa9af('0x31')],_0x524965[_0xa9af('0x32')]);_0x2fb3e4[_0xa9af('0x35')]=_['intersection'](_0x524965[_0xa9af('0x31')],qs[_0xa9af('0x44')](_0x5d9a84[_0xa9af('0x32')][_0xa9af('0x44')]));_0x2fb3e4['attributes']=_0x2fb3e4[_0xa9af('0x35')][_0xa9af('0x36')]?_0x2fb3e4[_0xa9af('0x35')]:_0x524965['model'];if(_0x5d9a84[_0xa9af('0x32')][_0xa9af('0x45')]){_0x2fb3e4[_0xa9af('0x46')]=[{'all':!![]}];}_0x2fb3e4=_[_0xa9af('0x3f')]({},_0x2fb3e4,_0x5d9a84[_0xa9af('0x47')]);return db[_0xa9af('0x2c')][_0xa9af('0x48')](_0x2fb3e4)[_0xa9af('0x24')](handleEntityNotFound(_0xd5cc9e,null))['then'](respondWithResult(_0xd5cc9e,null))[_0xa9af('0x42')](handleError(_0xd5cc9e,null));};exports[_0xa9af('0x49')]=function(_0x363137,_0x1ddc3e){return db['AnalyticTreeReport'][_0xa9af('0x49')](_0x363137[_0xa9af('0x4a')],{})[_0xa9af('0x24')](respondWithResult(_0x1ddc3e,0xc9))[_0xa9af('0x42')](handleError(_0x1ddc3e,null));};exports['update']=function(_0x14fa87,_0x2231a4){if(_0x14fa87[_0xa9af('0x4a')]['id']){delete _0x14fa87[_0xa9af('0x4a')]['id'];}return db[_0xa9af('0x2c')]['find']({'where':{'id':_0x14fa87[_0xa9af('0x43')]['id']}})[_0xa9af('0x24')](handleEntityNotFound(_0x2231a4,null))['then'](saveUpdates(_0x14fa87[_0xa9af('0x4a')],null))[_0xa9af('0x24')](respondWithResult(_0x2231a4,null))[_0xa9af('0x42')](handleError(_0x2231a4,null));};exports[_0xa9af('0x25')]=function(_0x58eed9,_0x1e5bcd){return db[_0xa9af('0x2c')][_0xa9af('0x48')]({'where':{'id':_0x58eed9['params']['id']}})[_0xa9af('0x24')](handleEntityNotFound(_0x1e5bcd,null))['then'](removeEntity(_0x1e5bcd,null))[_0xa9af('0x42')](handleError(_0x1e5bcd,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 358d4e6..f264729 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.model.js +++ b/server/api/analyticTreeReport/analyticTreeReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb256=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x42ea7e,_0x5075d2){var _0x567e8c=function(_0x503bea){while(--_0x503bea){_0x42ea7e['push'](_0x42ea7e['shift']());}};_0x567e8c(++_0x5075d2);}(_0xb256,0x1a0));var _0x6b25=function(_0x4b0290,_0x188c34){_0x4b0290=_0x4b0290-0x0;var _0x4bd9f4=_0xb256[_0x4b0290];return _0x4bd9f4;};'use strict';var _=require('lodash');var util=require(_0x6b25('0x0'));var logger=require('../../config/logger')(_0x6b25('0x1'));var moment=require(_0x6b25('0x2'));var BPromise=require(_0x6b25('0x3'));var rp=require(_0x6b25('0x4'));var fs=require('fs');var path=require(_0x6b25('0x5'));var rimraf=require(_0x6b25('0x6'));var config=require(_0x6b25('0x7'));var attributes=require(_0x6b25('0x8'));module[_0x6b25('0x9')]=function(_0x10ac55,_0x53bd62){return _0x10ac55[_0x6b25('0xa')](_0x6b25('0xb'),attributes,{'tableName':_0x6b25('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4060=['moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x565969,_0x41ddac){var _0x4c7cd0=function(_0x37decd){while(--_0x37decd){_0x565969['push'](_0x565969['shift']());}};_0x4c7cd0(++_0x41ddac);}(_0x4060,0x175));var _0x0406=function(_0x45dc6f,_0x4b963b){_0x45dc6f=_0x45dc6f-0x0;var _0x543f58=_0x4060[_0x45dc6f];return _0x543f58;};'use strict';var _=require(_0x0406('0x0'));var util=require(_0x0406('0x1'));var logger=require(_0x0406('0x2'))(_0x0406('0x3'));var moment=require(_0x0406('0x4'));var BPromise=require(_0x0406('0x5'));var rp=require(_0x0406('0x6'));var fs=require('fs');var path=require(_0x0406('0x7'));var rimraf=require(_0x0406('0x8'));var config=require('../../config/environment');var attributes=require(_0x0406('0x9'));module[_0x0406('0xa')]=function(_0x590e60,_0x434d4d){return _0x590e60['define'](_0x0406('0xb'),attributes,{'tableName':_0x0406('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index daacec5..fc35dae 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x29be6c,_0x23340b){var _0x553a33=function(_0x5c1c9d){while(--_0x5c1c9d){_0x29be6c['push'](_0x29be6c['shift']());}};_0x553a33(++_0x23340b);}(_0x1261,0x144));var _0x1126=function(_0x482611,_0x33356d){_0x482611=_0x482611-0x0;var _0x4aeb3a=_0x1261[_0x482611];return _0x4aeb3a;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x55ddb7,_0x3ccea0){var _0x2ab499=function(_0xc0edce){while(--_0xc0edce){_0x55ddb7['push'](_0x55ddb7['shift']());}};_0x2ab499(++_0x3ccea0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index f73a06b..b950594 100644 --- a/server/api/analyticTreeReport/index.js +++ b/server/api/analyticTreeReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xecf2=['Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','create','put','update','destroy','multer','path'];(function(_0x3790a6,_0x276d65){var _0xe6a81b=function(_0x3025a3){while(--_0x3025a3){_0x3790a6['push'](_0x3790a6['shift']());}};_0xe6a81b(++_0x276d65);}(_0xecf2,0xfa));var _0x2ecf=function(_0x32e680,_0x2c71fc){_0x32e680=_0x32e680-0x0;var _0x320daf=_0xecf2[_0x32e680];return _0x320daf;};'use strict';var multer=require(_0x2ecf('0x0'));var util=require('util');var path=require(_0x2ecf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2ecf('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2ecf('0x3'));var config=require(_0x2ecf('0x4'));var controller=require(_0x2ecf('0x5'));router[_0x2ecf('0x6')]('/',auth[_0x2ecf('0x7')](),controller[_0x2ecf('0x8')]);router[_0x2ecf('0x6')](_0x2ecf('0x9'),auth[_0x2ecf('0x7')](),controller['show']);router['post']('/',auth[_0x2ecf('0x7')](),controller[_0x2ecf('0xa')]);router[_0x2ecf('0xb')](_0x2ecf('0x9'),auth[_0x2ecf('0x7')](),controller[_0x2ecf('0xc')]);router['delete'](_0x2ecf('0x9'),auth['isAuthenticated'](),controller[_0x2ecf('0xd')]);module['exports']=router; \ No newline at end of file +var _0xa4d7=['/:id','show','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xa4d7,0x106));var _0x7a4d=function(_0x556e63,_0x16abaf){_0x556e63=_0x556e63-0x0;var _0x1f18a9=_0xa4d7[_0x556e63];return _0x1f18a9;};'use strict';var multer=require('multer');var util=require(_0x7a4d('0x0'));var path=require(_0x7a4d('0x1'));var timeout=require(_0x7a4d('0x2'));var express=require(_0x7a4d('0x3'));var router=express[_0x7a4d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7a4d('0x5'));var interaction=require(_0x7a4d('0x6'));var config=require(_0x7a4d('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x7a4d('0x8')]('/',auth[_0x7a4d('0x9')](),controller['index']);router[_0x7a4d('0x8')](_0x7a4d('0xa'),auth[_0x7a4d('0x9')](),controller[_0x7a4d('0xb')]);router[_0x7a4d('0xc')]('/',auth[_0x7a4d('0x9')](),controller['create']);router[_0x7a4d('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7a4d('0xe')](_0x7a4d('0xa'),auth[_0x7a4d('0x9')](),controller[_0x7a4d('0xf')]);module[_0x7a4d('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 43a3646..a380e9d 100644 --- a/server/api/attachment/attachment.attributes.js +++ b/server/api/attachment/attachment.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcab6=['sequelize','STRING'];(function(_0x12a801,_0x1d8379){var _0x1b91d3=function(_0xcd7fec){while(--_0xcd7fec){_0x12a801['push'](_0x12a801['shift']());}};_0x1b91d3(++_0x1d8379);}(_0xcab6,0xd4));var _0x6cab=function(_0x2c8623,_0x388807){_0x2c8623=_0x2c8623-0x0;var _0x2ea55d=_0xcab6[_0x2c8623];return _0x2ea55d;};'use strict';var Sequelize=require(_0x6cab('0x0'));module['exports']={'name':{'type':Sequelize[_0x6cab('0x1')]},'basename':{'type':Sequelize[_0x6cab('0x1')]},'type':{'type':Sequelize[_0x6cab('0x1')]}}; \ No newline at end of file +var _0x340c=['STRING','sequelize','exports'];(function(_0x430239,_0x16c552){var _0x553c34=function(_0x2676c2){while(--_0x2676c2){_0x430239['push'](_0x430239['shift']());}};_0x553c34(++_0x16c552);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc340('0x0'));module[_0xc340('0x1')]={'name':{'type':Sequelize[_0xc340('0x2')]},'basename':{'type':Sequelize[_0xc340('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 69fa320..f4c5044 100644 --- a/server/api/attachment/attachment.controller.js +++ b/server/api/attachment/attachment.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f47=['type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','clone','params','length','omit','updatedAt','body','createdAt','originalname','basename','filename','mimetype','create','download','findOne','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','then','destroy','error','name','send','index','map','Attachment','rawAttributes','fieldName','model','keys','attributes','intersection','fields','query','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge'];(function(_0x47147e,_0x40a905){var _0x19673f=function(_0x2a7476){while(--_0x2a7476){_0x47147e['push'](_0x47147e['shift']());}};_0x19673f(++_0x40a905);}(_0x4f47,0x129));var _0x74f4=function(_0x5ad37c,_0x48985a){_0x5ad37c=_0x5ad37c-0x0;var _0x322c6a=_0x4f47[_0x5ad37c];return _0x322c6a;};'use strict';var emlformat=require(_0x74f4('0x0'));var rimraf=require(_0x74f4('0x1'));var zipdir=require(_0x74f4('0x2'));var jsonpatch=require(_0x74f4('0x3'));var rp=require(_0x74f4('0x4'));var moment=require(_0x74f4('0x5'));var BPromise=require(_0x74f4('0x6'));var Mustache=require(_0x74f4('0x7'));var util=require(_0x74f4('0x8'));var path=require(_0x74f4('0x9'));var sox=require(_0x74f4('0xa'));var csv=require('to-csv');var ejs=require(_0x74f4('0xb'));var fs=require('fs');var fs_extra=require(_0x74f4('0xc'));var _=require(_0x74f4('0xd'));var squel=require(_0x74f4('0xe'));var crypto=require(_0x74f4('0xf'));var jsforce=require(_0x74f4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x74f4('0x11'));var querystring=require(_0x74f4('0x12'));var Papa=require(_0x74f4('0x13'));var Redis=require(_0x74f4('0x14'));var authService=require(_0x74f4('0x15'));var qs=require(_0x74f4('0x16'));var as=require(_0x74f4('0x17'));var hardwareService=require(_0x74f4('0x18'));var logger=require('../../config/logger')(_0x74f4('0x19'));var utils=require(_0x74f4('0x1a'));var config=require(_0x74f4('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x74f4('0x1c'))['db'];function respondWithStatusCode(_0x4bf57b,_0x195c81){_0x195c81=_0x195c81||0xcc;return function(_0x45a039){if(_0x45a039){return _0x4bf57b[_0x74f4('0x1d')](_0x195c81);}return _0x4bf57b[_0x74f4('0x1e')](_0x195c81)[_0x74f4('0x1f')]();};}function respondWithResult(_0x132ef4,_0x342962){_0x342962=_0x342962||0xc8;return function(_0x211fc3){if(_0x211fc3){return _0x132ef4[_0x74f4('0x1e')](_0x342962)[_0x74f4('0x20')](_0x211fc3);}};}function respondWithFilteredResult(_0x28f550,_0x100038){return function(_0x3f10c2){if(_0x3f10c2){var _0x320312=typeof _0x100038['offset']===_0x74f4('0x21')&&typeof _0x100038[_0x74f4('0x22')]===_0x74f4('0x21');var _0x198caf=_0x3f10c2[_0x74f4('0x23')];var _0x128136=_0x320312?0x0:_0x100038['offset'];var _0x1553c6=_0x320312?_0x3f10c2['count']:_0x100038[_0x74f4('0x24')]+_0x100038[_0x74f4('0x22')];var _0x10236b;if(_0x1553c6>=_0x198caf){_0x1553c6=_0x198caf;_0x10236b=0xc8;}else{_0x10236b=0xce;}_0x28f550[_0x74f4('0x1e')](_0x10236b);return _0x28f550['set'](_0x74f4('0x25'),_0x128136+'-'+_0x1553c6+'/'+_0x198caf)[_0x74f4('0x20')](_0x3f10c2);}return null;};}function patchUpdates(_0x33c5c3){return function(_0x51c545){try{jsonpatch['apply'](_0x51c545,_0x33c5c3,!![]);}catch(_0x346367){return BPromise[_0x74f4('0x26')](_0x346367);}return _0x51c545['save']();};}function saveUpdates(_0x40f68c,_0x4bcc92){return function(_0x2c44ec){if(_0x2c44ec){return _0x2c44ec['update'](_0x40f68c)[_0x74f4('0x27')](function(_0x5ecacb){return _0x5ecacb;});}return null;};}function removeEntity(_0x4242a7,_0x57fb31){return function(_0x46d982){if(_0x46d982){return _0x46d982[_0x74f4('0x28')]()[_0x74f4('0x27')](function(){_0x4242a7[_0x74f4('0x1e')](0xcc)[_0x74f4('0x1f')]();});}};}function handleEntityNotFound(_0x480ef4,_0x36f0ac){return function(_0x1735db){if(!_0x1735db){_0x480ef4[_0x74f4('0x1d')](0x194);}return _0x1735db;};}function handleError(_0x11e758,_0x103f3e){_0x103f3e=_0x103f3e||0x1f4;return function(_0x30784c){logger[_0x74f4('0x29')](_0x30784c['stack']);if(_0x30784c['name']){delete _0x30784c[_0x74f4('0x2a')];}_0x11e758[_0x74f4('0x1e')](_0x103f3e)[_0x74f4('0x2b')](_0x30784c);};}exports[_0x74f4('0x2c')]=function(_0xb31ba0,_0x37e856){var _0x55bca4={},_0x10a7a4={},_0xf337ef={'count':0x0,'rows':[]};var _0x4ecf0b=_[_0x74f4('0x2d')](db[_0x74f4('0x2e')][_0x74f4('0x2f')],function(_0x5015f0){return{'name':_0x5015f0[_0x74f4('0x30')],'type':_0x5015f0['type']['key']};});_0x10a7a4[_0x74f4('0x31')]=_[_0x74f4('0x2d')](_0x4ecf0b,_0x74f4('0x2a'));_0x10a7a4['query']=_[_0x74f4('0x32')](_0xb31ba0['query']);_0x10a7a4['filters']=_['intersection'](_0x10a7a4[_0x74f4('0x31')],_0x10a7a4['query']);_0x55bca4[_0x74f4('0x33')]=_[_0x74f4('0x34')](_0x10a7a4[_0x74f4('0x31')],qs[_0x74f4('0x35')](_0xb31ba0['query'][_0x74f4('0x35')]));_0x55bca4[_0x74f4('0x33')]=_0x55bca4[_0x74f4('0x33')]['length']?_0x55bca4['attributes']:_0x10a7a4[_0x74f4('0x31')];if(!_0xb31ba0[_0x74f4('0x36')][_0x74f4('0x37')](_0x74f4('0x38'))){_0x55bca4['limit']=qs['limit'](_0xb31ba0['query']['limit']);_0x55bca4[_0x74f4('0x24')]=qs[_0x74f4('0x24')](_0xb31ba0[_0x74f4('0x36')]['offset']);}_0x55bca4[_0x74f4('0x39')]=qs['sort'](_0xb31ba0[_0x74f4('0x36')]['sort']);_0x55bca4[_0x74f4('0x3a')]=qs[_0x74f4('0x3b')](_[_0x74f4('0x3c')](_0xb31ba0[_0x74f4('0x36')],_0x10a7a4[_0x74f4('0x3b')]),_0x4ecf0b);if(_0xb31ba0['query'][_0x74f4('0x3d')]){_0x55bca4[_0x74f4('0x3a')]=_[_0x74f4('0x3e')](_0x55bca4[_0x74f4('0x3a')],{'$or':_[_0x74f4('0x2d')](_0x4ecf0b,function(_0x529531){if(_0x529531[_0x74f4('0x3f')]!==_0x74f4('0x40')){var _0x2b034={};_0x2b034[_0x529531[_0x74f4('0x2a')]]={'$like':'%'+_0xb31ba0['query'][_0x74f4('0x3d')]+'%'};return _0x2b034;}})});}_0x55bca4=_[_0x74f4('0x3e')]({},_0x55bca4,_0xb31ba0[_0x74f4('0x41')]);var _0xe4e8ab={'where':_0x55bca4[_0x74f4('0x3a')]};return db[_0x74f4('0x2e')][_0x74f4('0x23')](_0xe4e8ab)[_0x74f4('0x27')](function(_0x18302b){_0xf337ef[_0x74f4('0x23')]=_0x18302b;if(_0xb31ba0[_0x74f4('0x36')][_0x74f4('0x42')]){_0x55bca4[_0x74f4('0x43')]=[{'all':!![]}];}return db[_0x74f4('0x2e')][_0x74f4('0x44')](_0x55bca4);})[_0x74f4('0x27')](function(_0x203a76){_0xf337ef[_0x74f4('0x45')]=_0x203a76;return _0xf337ef;})[_0x74f4('0x27')](respondWithFilteredResult(_0x37e856,_0x55bca4))[_0x74f4('0x46')](handleError(_0x37e856,null));};exports[_0x74f4('0x47')]=function(_0x47106f,_0x4d8d14){var _0x5d15b6={'raw':!![],'where':{'id':_0x47106f['params']['id']}},_0x1f98dd={};_0x1f98dd[_0x74f4('0x31')]=_[_0x74f4('0x32')](db[_0x74f4('0x2e')][_0x74f4('0x2f')]);_0x1f98dd[_0x74f4('0x36')]=_[_0x74f4('0x32')](_0x47106f[_0x74f4('0x36')]);_0x1f98dd[_0x74f4('0x3b')]=_[_0x74f4('0x34')](_0x1f98dd[_0x74f4('0x31')],_0x1f98dd[_0x74f4('0x36')]);_0x5d15b6[_0x74f4('0x33')]=_['intersection'](_0x1f98dd[_0x74f4('0x31')],qs[_0x74f4('0x35')](_0x47106f[_0x74f4('0x36')][_0x74f4('0x35')]));_0x5d15b6[_0x74f4('0x33')]=_0x5d15b6['attributes']['length']?_0x5d15b6[_0x74f4('0x33')]:_0x1f98dd['model'];if(_0x47106f[_0x74f4('0x36')][_0x74f4('0x42')]){_0x5d15b6[_0x74f4('0x43')]=[{'all':!![]}];}_0x5d15b6=_['merge']({},_0x5d15b6,_0x47106f[_0x74f4('0x41')]);return db[_0x74f4('0x2e')][_0x74f4('0x48')](_0x5d15b6)[_0x74f4('0x27')](handleEntityNotFound(_0x4d8d14,null))[_0x74f4('0x27')](respondWithResult(_0x4d8d14,null))[_0x74f4('0x46')](handleError(_0x4d8d14,null));};exports[_0x74f4('0x49')]=function(_0x5bd151,_0x38a25e){var _0x1cedfd={'where':{'id':_0x5bd151[_0x74f4('0x4a')]['id']}},_0x53e275={};_0x53e275[_0x74f4('0x31')]=_[_0x74f4('0x32')](db[_0x74f4('0x2e')]['rawAttributes']);_0x1cedfd['attributes']=_['intersection'](_0x53e275[_0x74f4('0x31')],qs[_0x74f4('0x35')](_0x5bd151[_0x74f4('0x36')][_0x74f4('0x35')]));_0x1cedfd[_0x74f4('0x33')]=_0x1cedfd['attributes'][_0x74f4('0x4b')]?_0x1cedfd[_0x74f4('0x33')]:_0x53e275[_0x74f4('0x31')];if(_0x5bd151['query'][_0x74f4('0x42')]){_0x1cedfd[_0x74f4('0x43')]=[{'all':!![]}];}_0x1cedfd=_[_0x74f4('0x3e')]({},_0x1cedfd,_0x5bd151[_0x74f4('0x41')]);return db[_0x74f4('0x2e')][_0x74f4('0x48')](_0x1cedfd)[_0x74f4('0x27')](handleEntityNotFound(_0x38a25e,null))[_0x74f4('0x27')](function(_0x573e4d){if(_0x573e4d){var _0x28b67b=_0x573e4d['get']({'plain':!![]});_0x28b67b=qs[_0x74f4('0x4c')](_0x28b67b,['id','createdAt',_0x74f4('0x4d')]);_0x5bd151['body']=_[_0x74f4('0x4c')](_0x5bd151[_0x74f4('0x4e')],['id',_0x74f4('0x4f'),'updatedAt']);return db[_0x74f4('0x2e')]['create'](_[_0x74f4('0x3e')](_0x28b67b,_0x5bd151[_0x74f4('0x4e')]),{'include':_0x5bd151[_0x74f4('0x36')][_0x74f4('0x42')]?[{'all':!![]}]:undefined});}})[_0x74f4('0x27')](respondWithResult(_0x38a25e,0xc9))['catch'](handleError(_0x38a25e,null));};exports['update']=function(_0x5eb3f1,_0x2c6467){if(_0x5eb3f1[_0x74f4('0x4e')]['id']){delete _0x5eb3f1[_0x74f4('0x4e')]['id'];}return db[_0x74f4('0x2e')]['find']({'where':{'id':_0x5eb3f1['params']['id']}})[_0x74f4('0x27')](handleEntityNotFound(_0x2c6467,null))[_0x74f4('0x27')](saveUpdates(_0x5eb3f1[_0x74f4('0x4e')],null))[_0x74f4('0x27')](respondWithResult(_0x2c6467,null))[_0x74f4('0x46')](handleError(_0x2c6467,null));};exports[_0x74f4('0x28')]=function(_0x56a64b,_0x3f74bc){return db[_0x74f4('0x2e')]['find']({'where':{'id':_0x56a64b[_0x74f4('0x4a')]['id']}})[_0x74f4('0x27')](handleEntityNotFound(_0x3f74bc,null))[_0x74f4('0x27')](removeEntity(_0x3f74bc,null))[_0x74f4('0x46')](handleError(_0x3f74bc,null));};exports['create']=function(_0x505e24,_0x56e3e7,_0x5419be){_0x505e24['body']['name']=_0x505e24['file'][_0x74f4('0x50')];_0x505e24[_0x74f4('0x4e')][_0x74f4('0x51')]=_0x505e24['file'][_0x74f4('0x52')];_0x505e24[_0x74f4('0x4e')][_0x74f4('0x3f')]=_0x505e24['file'][_0x74f4('0x53')];return db[_0x74f4('0x2e')][_0x74f4('0x54')](_0x505e24[_0x74f4('0x4e')])[_0x74f4('0x27')](respondWithResult(_0x56e3e7,0xc9))['catch'](handleError(_0x56e3e7,null));};exports[_0x74f4('0x55')]=function(_0x4fb8bf,_0x355d3f,_0xc1153){return db[_0x74f4('0x2e')][_0x74f4('0x56')]({'where':{'id':_0x4fb8bf['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x355d3f,null))[_0x74f4('0x27')](function(_0x4180c4){if(_0x4180c4){var _0x27715c=_0x4180c4['ChatOfflineMessageId']!==null;var _0x476186=path[_0x74f4('0x57')](config[_0x74f4('0x58')],_0x74f4('0x59'));if(_0x27715c){_0x476186=path[_0x74f4('0x57')](_0x476186,'offline-chat/');}var _0x3a6ec5=path[_0x74f4('0x57')](_0x476186,_0x4180c4[_0x74f4('0x51')]);return _0x355d3f['download'](_0x3a6ec5);}})[_0x74f4('0x46')](handleError(_0x355d3f,null));}; \ No newline at end of file +var _0xe05b=['keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','Attachment','findAll','rows','catch','show','params','length','find','clone','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query'];(function(_0x1455f9,_0x282ccd){var _0x33b733=function(_0x2396a3){while(--_0x2396a3){_0x1455f9['push'](_0x1455f9['shift']());}};_0x33b733(++_0x282ccd);}(_0xe05b,0x134));var _0xbe05=function(_0x14828d,_0x23a8fe){_0x14828d=_0x14828d-0x0;var _0x24b214=_0xe05b[_0x14828d];return _0x24b214;};'use strict';var emlformat=require(_0xbe05('0x0'));var rimraf=require(_0xbe05('0x1'));var zipdir=require(_0xbe05('0x2'));var jsonpatch=require(_0xbe05('0x3'));var rp=require(_0xbe05('0x4'));var moment=require('moment');var BPromise=require(_0xbe05('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbe05('0x6'));var csv=require(_0xbe05('0x7'));var ejs=require(_0xbe05('0x8'));var fs=require('fs');var fs_extra=require(_0xbe05('0x9'));var _=require(_0xbe05('0xa'));var squel=require(_0xbe05('0xb'));var crypto=require('crypto');var jsforce=require(_0xbe05('0xc'));var deskjs=require(_0xbe05('0xd'));var toCsv=require(_0xbe05('0x7'));var querystring=require('querystring');var Papa=require(_0xbe05('0xe'));var Redis=require(_0xbe05('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbe05('0x10'));var as=require(_0xbe05('0x11'));var hardwareService=require(_0xbe05('0x12'));var logger=require(_0xbe05('0x13'))(_0xbe05('0x14'));var utils=require('../../config/utils');var config=require(_0xbe05('0x15'));var licenseUtil=require(_0xbe05('0x16'));var db=require(_0xbe05('0x17'))['db'];function respondWithStatusCode(_0x560715,_0x4a2208){_0x4a2208=_0x4a2208||0xcc;return function(_0x1ae855){if(_0x1ae855){return _0x560715['sendStatus'](_0x4a2208);}return _0x560715[_0xbe05('0x18')](_0x4a2208)[_0xbe05('0x19')]();};}function respondWithResult(_0x35c216,_0x484c15){_0x484c15=_0x484c15||0xc8;return function(_0x2cf924){if(_0x2cf924){return _0x35c216['status'](_0x484c15)[_0xbe05('0x1a')](_0x2cf924);}};}function respondWithFilteredResult(_0x149c7e,_0x3471f1){return function(_0xb4650b){if(_0xb4650b){var _0x58d883=typeof _0x3471f1[_0xbe05('0x1b')]===_0xbe05('0x1c')&&typeof _0x3471f1[_0xbe05('0x1d')]===_0xbe05('0x1c');var _0x1b4a93=_0xb4650b[_0xbe05('0x1e')];var _0x7c8c06=_0x58d883?0x0:_0x3471f1[_0xbe05('0x1b')];var _0x188d91=_0x58d883?_0xb4650b[_0xbe05('0x1e')]:_0x3471f1[_0xbe05('0x1b')]+_0x3471f1[_0xbe05('0x1d')];var _0x45f704;if(_0x188d91>=_0x1b4a93){_0x188d91=_0x1b4a93;_0x45f704=0xc8;}else{_0x45f704=0xce;}_0x149c7e[_0xbe05('0x18')](_0x45f704);return _0x149c7e['set'](_0xbe05('0x1f'),_0x7c8c06+'-'+_0x188d91+'/'+_0x1b4a93)[_0xbe05('0x1a')](_0xb4650b);}return null;};}function patchUpdates(_0x4fd2a1){return function(_0xa260b9){try{jsonpatch[_0xbe05('0x20')](_0xa260b9,_0x4fd2a1,!![]);}catch(_0x57f278){return BPromise[_0xbe05('0x21')](_0x57f278);}return _0xa260b9['save']();};}function saveUpdates(_0x7c042b,_0x1c3dd0){return function(_0x46f6ed){if(_0x46f6ed){return _0x46f6ed[_0xbe05('0x22')](_0x7c042b)[_0xbe05('0x23')](function(_0x20fd60){return _0x20fd60;});}return null;};}function removeEntity(_0x5149ca,_0x13bbd2){return function(_0x2fba80){if(_0x2fba80){return _0x2fba80[_0xbe05('0x24')]()[_0xbe05('0x23')](function(){_0x5149ca[_0xbe05('0x18')](0xcc)[_0xbe05('0x19')]();});}};}function handleEntityNotFound(_0xc60542,_0x1ee0fe){return function(_0x1b3707){if(!_0x1b3707){_0xc60542[_0xbe05('0x25')](0x194);}return _0x1b3707;};}function handleError(_0x4915b7,_0xfcc9ff){_0xfcc9ff=_0xfcc9ff||0x1f4;return function(_0x25d757){logger[_0xbe05('0x26')](_0x25d757[_0xbe05('0x27')]);if(_0x25d757['name']){delete _0x25d757[_0xbe05('0x28')];}_0x4915b7[_0xbe05('0x18')](_0xfcc9ff)[_0xbe05('0x29')](_0x25d757);};}exports[_0xbe05('0x2a')]=function(_0x4559c5,_0x1d382a){var _0x1d5187={},_0x162527={},_0x36de8d={'count':0x0,'rows':[]};var _0x121e7c=_[_0xbe05('0x2b')](db['Attachment'][_0xbe05('0x2c')],function(_0xa1cca3){return{'name':_0xa1cca3[_0xbe05('0x2d')],'type':_0xa1cca3[_0xbe05('0x2e')]['key']};});_0x162527['model']=_[_0xbe05('0x2b')](_0x121e7c,_0xbe05('0x28'));_0x162527[_0xbe05('0x2f')]=_[_0xbe05('0x30')](_0x4559c5[_0xbe05('0x2f')]);_0x162527[_0xbe05('0x31')]=_[_0xbe05('0x32')](_0x162527['model'],_0x162527[_0xbe05('0x2f')]);_0x1d5187[_0xbe05('0x33')]=_[_0xbe05('0x32')](_0x162527[_0xbe05('0x34')],qs[_0xbe05('0x35')](_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x35')]));_0x1d5187[_0xbe05('0x33')]=_0x1d5187[_0xbe05('0x33')]['length']?_0x1d5187[_0xbe05('0x33')]:_0x162527[_0xbe05('0x34')];if(!_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x36')](_0xbe05('0x37'))){_0x1d5187['limit']=qs['limit'](_0x4559c5['query']['limit']);_0x1d5187[_0xbe05('0x1b')]=qs[_0xbe05('0x1b')](_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x1b')]);}_0x1d5187['order']=qs[_0xbe05('0x38')](_0x4559c5['query'][_0xbe05('0x38')]);_0x1d5187[_0xbe05('0x39')]=qs[_0xbe05('0x31')](_['pick'](_0x4559c5[_0xbe05('0x2f')],_0x162527[_0xbe05('0x31')]),_0x121e7c);if(_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x3a')]){_0x1d5187[_0xbe05('0x39')]=_[_0xbe05('0x3b')](_0x1d5187[_0xbe05('0x39')],{'$or':_[_0xbe05('0x2b')](_0x121e7c,function(_0x443034){if(_0x443034[_0xbe05('0x2e')]!==_0xbe05('0x3c')){var _0x122d86={};_0x122d86[_0x443034[_0xbe05('0x28')]]={'$like':'%'+_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x3a')]+'%'};return _0x122d86;}})});}_0x1d5187=_[_0xbe05('0x3b')]({},_0x1d5187,_0x4559c5[_0xbe05('0x3d')]);var _0x52a936={'where':_0x1d5187[_0xbe05('0x39')]};return db['Attachment'][_0xbe05('0x1e')](_0x52a936)['then'](function(_0x2dbf29){_0x36de8d['count']=_0x2dbf29;if(_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x3e')]){_0x1d5187[_0xbe05('0x3f')]=[{'all':!![]}];}return db[_0xbe05('0x40')][_0xbe05('0x41')](_0x1d5187);})[_0xbe05('0x23')](function(_0x5baf08){_0x36de8d[_0xbe05('0x42')]=_0x5baf08;return _0x36de8d;})[_0xbe05('0x23')](respondWithFilteredResult(_0x1d382a,_0x1d5187))[_0xbe05('0x43')](handleError(_0x1d382a,null));};exports[_0xbe05('0x44')]=function(_0x107df6,_0x33de19){var _0x114a94={'raw':!![],'where':{'id':_0x107df6[_0xbe05('0x45')]['id']}},_0x3f065b={};_0x3f065b[_0xbe05('0x34')]=_[_0xbe05('0x30')](db['Attachment'][_0xbe05('0x2c')]);_0x3f065b[_0xbe05('0x2f')]=_[_0xbe05('0x30')](_0x107df6[_0xbe05('0x2f')]);_0x3f065b[_0xbe05('0x31')]=_[_0xbe05('0x32')](_0x3f065b[_0xbe05('0x34')],_0x3f065b[_0xbe05('0x2f')]);_0x114a94[_0xbe05('0x33')]=_[_0xbe05('0x32')](_0x3f065b[_0xbe05('0x34')],qs[_0xbe05('0x35')](_0x107df6[_0xbe05('0x2f')]['fields']));_0x114a94[_0xbe05('0x33')]=_0x114a94[_0xbe05('0x33')][_0xbe05('0x46')]?_0x114a94[_0xbe05('0x33')]:_0x3f065b[_0xbe05('0x34')];if(_0x107df6[_0xbe05('0x2f')]['includeAll']){_0x114a94[_0xbe05('0x3f')]=[{'all':!![]}];}_0x114a94=_['merge']({},_0x114a94,_0x107df6[_0xbe05('0x3d')]);return db[_0xbe05('0x40')][_0xbe05('0x47')](_0x114a94)['then'](handleEntityNotFound(_0x33de19,null))[_0xbe05('0x23')](respondWithResult(_0x33de19,null))['catch'](handleError(_0x33de19,null));};exports[_0xbe05('0x48')]=function(_0x2e29f6,_0x231c0f){var _0x398e71={'where':{'id':_0x2e29f6[_0xbe05('0x45')]['id']}},_0x3ecc7b={};_0x3ecc7b['model']=_[_0xbe05('0x30')](db[_0xbe05('0x40')][_0xbe05('0x2c')]);_0x398e71[_0xbe05('0x33')]=_[_0xbe05('0x32')](_0x3ecc7b[_0xbe05('0x34')],qs['fields'](_0x2e29f6[_0xbe05('0x2f')]['fields']));_0x398e71[_0xbe05('0x33')]=_0x398e71[_0xbe05('0x33')][_0xbe05('0x46')]?_0x398e71[_0xbe05('0x33')]:_0x3ecc7b[_0xbe05('0x34')];if(_0x2e29f6[_0xbe05('0x2f')][_0xbe05('0x3e')]){_0x398e71[_0xbe05('0x3f')]=[{'all':!![]}];}_0x398e71=_[_0xbe05('0x3b')]({},_0x398e71,_0x2e29f6[_0xbe05('0x3d')]);return db['Attachment']['find'](_0x398e71)[_0xbe05('0x23')](handleEntityNotFound(_0x231c0f,null))[_0xbe05('0x23')](function(_0x5b86e9){if(_0x5b86e9){var _0x43d152=_0x5b86e9[_0xbe05('0x49')]({'plain':!![]});_0x43d152=qs['omit'](_0x43d152,['id',_0xbe05('0x4a'),_0xbe05('0x4b')]);_0x2e29f6[_0xbe05('0x4c')]=_[_0xbe05('0x4d')](_0x2e29f6['body'],['id','createdAt','updatedAt']);return db[_0xbe05('0x40')][_0xbe05('0x4e')](_['merge'](_0x43d152,_0x2e29f6['body']),{'include':_0x2e29f6[_0xbe05('0x2f')][_0xbe05('0x3e')]?[{'all':!![]}]:undefined});}})[_0xbe05('0x23')](respondWithResult(_0x231c0f,0xc9))['catch'](handleError(_0x231c0f,null));};exports[_0xbe05('0x22')]=function(_0x5976ed,_0x241393){if(_0x5976ed[_0xbe05('0x4c')]['id']){delete _0x5976ed[_0xbe05('0x4c')]['id'];}return db['Attachment'][_0xbe05('0x47')]({'where':{'id':_0x5976ed[_0xbe05('0x45')]['id']}})['then'](handleEntityNotFound(_0x241393,null))['then'](saveUpdates(_0x5976ed[_0xbe05('0x4c')],null))['then'](respondWithResult(_0x241393,null))['catch'](handleError(_0x241393,null));};exports[_0xbe05('0x24')]=function(_0x6941f9,_0xf95a18){return db['Attachment']['find']({'where':{'id':_0x6941f9[_0xbe05('0x45')]['id']}})['then'](handleEntityNotFound(_0xf95a18,null))[_0xbe05('0x23')](removeEntity(_0xf95a18,null))[_0xbe05('0x43')](handleError(_0xf95a18,null));};exports[_0xbe05('0x4e')]=function(_0x12b803,_0xa65c07,_0x273b0e){_0x12b803[_0xbe05('0x4c')]['name']=_0x12b803[_0xbe05('0x4f')][_0xbe05('0x50')];_0x12b803[_0xbe05('0x4c')][_0xbe05('0x51')]=_0x12b803[_0xbe05('0x4f')][_0xbe05('0x52')];_0x12b803[_0xbe05('0x4c')][_0xbe05('0x2e')]=_0x12b803[_0xbe05('0x4f')][_0xbe05('0x53')];return db[_0xbe05('0x40')][_0xbe05('0x4e')](_0x12b803['body'])[_0xbe05('0x23')](respondWithResult(_0xa65c07,0xc9))[_0xbe05('0x43')](handleError(_0xa65c07,null));};exports['download']=function(_0x51721e,_0x880f76,_0x3c19d0){return db[_0xbe05('0x40')][_0xbe05('0x54')]({'where':{'id':_0x51721e[_0xbe05('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x880f76,null))[_0xbe05('0x23')](function(_0x439fda){if(_0x439fda){var _0x103d66=_0x439fda[_0xbe05('0x55')]!==null;var _0x2e7427=path[_0xbe05('0x56')](config[_0xbe05('0x57')],'server/files/attachments/');if(_0x103d66){_0x2e7427=path[_0xbe05('0x56')](_0x2e7427,_0xbe05('0x58'));}var _0x3cbe98=path[_0xbe05('0x56')](_0x2e7427,_0x439fda[_0xbe05('0x51')]);return _0x880f76['download'](_0x3cbe98);}})['catch'](handleError(_0x880f76,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 63a51df..6b1adb9 100644 --- a/server/api/attachment/attachment.model.js +++ b/server/api/attachment/attachment.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ae7=['request-promise','rimraf','exports','lodash','util','../../config/logger','api','bluebird'];(function(_0xef88f,_0x2dd2d0){var _0x3ad795=function(_0x4c4e4d){while(--_0x4c4e4d){_0xef88f['push'](_0xef88f['shift']());}};_0x3ad795(++_0x2dd2d0);}(_0x2ae7,0x1bb));var _0x72ae=function(_0x3e5c49,_0x29465f){_0x3e5c49=_0x3e5c49-0x0;var _0x177cc7=_0x2ae7[_0x3e5c49];return _0x177cc7;};'use strict';var _=require(_0x72ae('0x0'));var util=require(_0x72ae('0x1'));var logger=require(_0x72ae('0x2'))(_0x72ae('0x3'));var moment=require('moment');var BPromise=require(_0x72ae('0x4'));var rp=require(_0x72ae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72ae('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x72ae('0x7')]=function(_0xb2ac1,_0x23bcaa){return _0xb2ac1['define']('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee1e=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0xb52a30,_0x9b4336){var _0x160875=function(_0xd23d7a){while(--_0xd23d7a){_0xb52a30['push'](_0xb52a30['shift']());}};_0x160875(++_0x9b4336);}(_0xee1e,0x82));var _0xeee1=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xee1e[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xeee1('0x0'));var util=require(_0xeee1('0x1'));var logger=require(_0xeee1('0x2'))(_0xeee1('0x3'));var moment=require('moment');var BPromise=require(_0xeee1('0x4'));var rp=require(_0xeee1('0x5'));var fs=require('fs');var path=require(_0xeee1('0x6'));var rimraf=require(_0xeee1('0x7'));var config=require(_0xeee1('0x8'));var attributes=require(_0xeee1('0x9'));module[_0xeee1('0xa')]=function(_0x11bc5b,_0x494240){return _0x11bc5b[_0xeee1('0xb')](_0xeee1('0xc'),attributes,{'tableName':_0xeee1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index f058345..6483f02 100644 --- a/server/api/attachment/attachment.rpc.js +++ b/server/api/attachment/attachment.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5712=['message','info','CreateAttachment','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1efe99,_0x43e03b){var _0x38eede=function(_0x28a7e2){while(--_0x28a7e2){_0x1efe99['push'](_0x1efe99['shift']());}};_0x38eede(++_0x43e03b);}(_0x5712,0x140));var _0x2571=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5712[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2571('0x0'));var util=require(_0x2571('0x1'));var moment=require(_0x2571('0x2'));var BPromise=require(_0x2571('0x3'));var rs=require(_0x2571('0x4'));var fs=require('fs');var Redis=require(_0x2571('0x5'));var db=require(_0x2571('0x6'))['db'];var utils=require(_0x2571('0x7'));var logger=require(_0x2571('0x8'))(_0x2571('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2571('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e19b2,_0x251ee6,_0x3ca885){return new BPromise(function(_0x204ecc,_0xda659a){return client[_0x2571('0xb')](_0x3e19b2,_0x3ca885)['then'](function(_0x1f0c98){logger['info'](_0x2571('0xc'),_0x251ee6,_0x2571('0xd'));logger[_0x2571('0xe')](_0x2571('0xf'),_0x251ee6,_0x2571('0xd'),JSON[_0x2571('0x10')](_0x1f0c98));if(_0x1f0c98[_0x2571('0x11')]){if(_0x1f0c98[_0x2571('0x11')]['code']===0x1f4){logger['error'](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0xda659a(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0x204ecc(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}else{logger[_0x2571('0x13')]('Attachment,\x20%s,\x20%s',_0x251ee6,_0x2571('0xd'));_0x204ecc(_0x1f0c98['result']['message']);}})['catch'](function(_0x4c3e11){logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x4c3e11);_0xda659a(_0x4c3e11);});});}exports[_0x2571('0x14')]=function(_0x75af2a){var _0x576222=this;return new Promise(function(_0x7707,_0x3f2e5f){return db['Attachment'][_0x2571('0x15')](_0x75af2a[_0x2571('0x16')],{'raw':_0x75af2a[_0x2571('0x17')]?_0x75af2a[_0x2571('0x17')][_0x2571('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x52da27){logger[_0x2571('0x13')](_0x2571('0x14'),_0x75af2a);logger['debug']('CreateAttachment',_0x75af2a,JSON[_0x2571('0x10')](_0x52da27));_0x7707(_0x52da27);})[_0x2571('0x19')](function(_0x2218fb){logger[_0x2571('0x11')]('CreateAttachment',_0x2218fb[_0x2571('0x12')],_0x75af2a);_0x3f2e5f(_0x576222['error'](0x1f4,_0x2218fb[_0x2571('0x12')]));});});}; \ No newline at end of file +var _0x9224=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','create','body','options','raw'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x9224,0xa3));var _0x4922=function(_0x2539db,_0x5383f0){_0x2539db=_0x2539db-0x0;var _0xb29369=_0x9224[_0x2539db];return _0xb29369;};'use strict';var _=require('lodash');var util=require(_0x4922('0x0'));var moment=require(_0x4922('0x1'));var BPromise=require(_0x4922('0x2'));var rs=require(_0x4922('0x3'));var fs=require('fs');var Redis=require(_0x4922('0x4'));var db=require(_0x4922('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4922('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4922('0x7')][_0x4922('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4216c0,_0x251048,_0x7a8bd1){return new BPromise(function(_0x245562,_0x5c65dd){return client[_0x4922('0x9')](_0x4216c0,_0x7a8bd1)[_0x4922('0xa')](function(_0x50db40){logger[_0x4922('0xb')](_0x4922('0xc'),_0x251048,_0x4922('0xd'));logger[_0x4922('0xe')](_0x4922('0xf'),_0x251048,_0x4922('0xd'),JSON[_0x4922('0x10')](_0x50db40));if(_0x50db40[_0x4922('0x11')]){if(_0x50db40['error'][_0x4922('0x12')]===0x1f4){logger['error'](_0x4922('0xc'),_0x251048,_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);return _0x5c65dd(_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);}logger['error'](_0x4922('0xc'),_0x251048,_0x50db40[_0x4922('0x11')]['message']);return _0x245562(_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);}else{logger[_0x4922('0xb')](_0x4922('0xc'),_0x251048,_0x4922('0xd'));_0x245562(_0x50db40[_0x4922('0x14')][_0x4922('0x13')]);}})['catch'](function(_0x2ae924){logger['error'](_0x4922('0xc'),_0x251048,_0x2ae924);_0x5c65dd(_0x2ae924);});});}exports[_0x4922('0x15')]=function(_0x1d7fc2){var _0x15cdc9=this;return new Promise(function(_0x2ef410,_0x435e7b){return db['Attachment'][_0x4922('0x16')](_0x1d7fc2[_0x4922('0x17')],{'raw':_0x1d7fc2[_0x4922('0x18')]?_0x1d7fc2[_0x4922('0x18')][_0x4922('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2b6a2d){logger[_0x4922('0xb')](_0x4922('0x15'),_0x1d7fc2);logger[_0x4922('0xe')](_0x4922('0x15'),_0x1d7fc2,JSON[_0x4922('0x10')](_0x2b6a2d));_0x2ef410(_0x2b6a2d);})[_0x4922('0x1a')](function(_0x3b182b){logger['error'](_0x4922('0x15'),_0x3b182b[_0x4922('0x13')],_0x1d7fc2);_0x435e7b(_0x15cdc9['error'](0x1f4,_0x3b182b[_0x4922('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index ac34610..b2d6498 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x3b8d57,_0x3dd023){var _0xb61526=function(_0x2b1a37){while(--_0x2b1a37){_0x3b8d57['push'](_0x3b8d57['shift']());}};_0xb61526(++_0x3dd023);}(_0xb10b,0x12a));var _0xbb10=function(_0x484e74,_0x4e62bd){_0x484e74=_0x484e74-0x0;var _0x2874fa=_0xb10b[_0x484e74];return _0x2874fa;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x4af424,_0x224dde){_0x4af424=_0x4af424-0x0;var _0x4ceca5=_0xdb28[_0x4af424];return _0x4ceca5;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 8f85784..f380e65 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7958=['blocked','online','admin','user','agent','disabled','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','signToken','json','use','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0x7958,0x77));var _0x8795=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7958[_0x14add3];return _0x4a174f;};'use strict';var passport=require(_0x8795('0x0'));var LocalStrategy=require(_0x8795('0x1'))[_0x8795('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x8795('0x3'));var BPromise=require(_0x8795('0x4'));var util=require(_0x8795('0x5'));var db=require(_0x8795('0x6'))['db'];var authService=require(_0x8795('0x7'));var utils=require(_0x8795('0x8'));var config=require(_0x8795('0x9'));var logger=require('../../config/logger')(_0x8795('0xa'));function isActiveDirectoryConfigured(_0x48b206){var _0x24d37a=![];if(typeof _0x48b206[_0x8795('0xb')]!==_0x8795('0xc')){_0x24d37a=_0x48b206['activedirectory'][_0x8795('0xd')]&&_0x48b206[_0x8795('0xb')][_0x8795('0xe')]&&_0x48b206[_0x8795('0xb')]['domain'];}return _0x24d37a;}function adAuthenticate(_0x21635b,_0x58bde6,_0x3f9613){return new BPromise(function(_0x15dec8,_0x4ed2cc){try{var _0x4eb1d0=new ActiveDirectory(_0x21635b);_0x4eb1d0['authenticate'](_0x58bde6,_0x3f9613,function(_0x534ea7,_0x2b259b){if(_0x534ea7){logger[_0x8795('0xf')](_0x8795('0x10'),_0x58bde6,util['inspect'](_0x534ea7,{'showHidden':![],'depth':null}));_0x4ed2cc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2b259b){logger[_0x8795('0xf')](_0x8795('0x11'),_0x58bde6);_0x4ed2cc(_0x8795('0x12'));}else{_0x15dec8(_0x2b259b);}});}catch(_0x31168d){_0x4ed2cc(_0x31168d);}});}function ActiveDirectoryAuthenticate(_0x25e602,_0x4cec96,_0x197753,_0x5ef478){var _0x3a6795,_0x22bc5a;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x4cec96);return _0x5ef478(null,![],{'message':_0x8795('0x12')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x8795('0x13'),_0x8795('0x14')],'raw':!![]})[_0x8795('0x15')](function(_0x6e41fd){_0x3a6795=_0x6e41fd;if(!_0x3a6795[_0x8795('0x13')]){logger[_0x8795('0xf')](_0x8795('0x16'),_0x4cec96);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x25e602[_0x8795('0x17')]({'attributes':['id',_0x8795('0x18'),_0x8795('0x19'),_0x8795('0x1a'),_0x8795('0x1b'),'disabled',_0x8795('0x1c'),'blockedAt',_0x8795('0x1d')],'where':{'name':_0x4cec96,'role':{'$or':[_0x8795('0x1e'),_0x8795('0x1f'),_0x8795('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x5bc259){if(!_0x5bc259||_0x5bc259&&_0x5bc259['name']!==_0x4cec96){throw new Error(_0x8795('0x12'));}_0x22bc5a=_0x5bc259;var _0x32ba67=_0x22bc5a['name']+'@'+config[_0x8795('0xb')]['domain'];return adAuthenticate(config[_0x8795('0xb')],_0x32ba67,_0x197753);})[_0x8795('0x15')](function(_0x6b4d4a){if(_0x22bc5a[_0x8795('0x21')]){throw new Error(_0x8795('0x12'));}if(_0x3a6795[_0x8795('0x14')]>0x0){if(_0x22bc5a['blocked']){if(moment(_0x22bc5a[_0x8795('0x22')])[_0x8795('0x23')](_0x3a6795['blockDuration'],_0x8795('0x24'))>moment()){throw new Error(_0x8795('0x12'));}return utils[_0x8795('0x25')](_0x22bc5a,0x0,![],null)[_0x8795('0x15')](function(){return utils[_0x8795('0x26')](_0x22bc5a);})['then'](function(){return _0x5ef478(null,_0x22bc5a);});}else{return utils[_0x8795('0x26')](_0x22bc5a)[_0x8795('0x15')](function(){return _0x5ef478(null,_0x22bc5a);});}}else{return utils['getLicense'](_0x22bc5a)['then'](function(){return _0x5ef478(null,_0x22bc5a);});}})[_0x8795('0x27')](function(_0x2800e4){return _0x5ef478(null,![],_0x2800e4);});}function handleError(_0x45673f,_0x10e928,_0x1d734c){return _0x45673f[_0x8795('0x28')](_0x10e928||0x1f4)['send']({'message':_0x1d734c?_0x1d734c[_0x8795('0x29')]||_0x1d734c:''});}exports[_0x8795('0x2a')]=function(_0x3f8435,_0x4ea29f,_0x4b57cc){passport[_0x8795('0x2b')](_0x8795('0x2c'),function(_0x505928,_0x59d22a,_0x447614){var _0x3b7e4b=_0x505928||_0x447614;if(_0x3b7e4b){return handleError(_0x4ea29f,0x191,_0x3b7e4b);}if(!_0x59d22a){return handleError(_0x4ea29f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4f211b={'payload':{'id':_0x59d22a['id'],'role':_0x59d22a['role']},'options':{'expiresIn':0x15180}};return authService[_0x8795('0x2d')](_0x4f211b)['then'](function(_0x1b23e3){_0x4ea29f[_0x8795('0x2e')]({'id':_0x59d22a['id'],'token':_0x1b23e3,'statusCall':'','isAlreadyLogged':_0x59d22a[_0x8795('0x1d')]});});}})(_0x3f8435,_0x4ea29f,_0x4b57cc);};passport[_0x8795('0x2f')](_0x8795('0x2c'),new LocalStrategy({'usernameField':_0x8795('0x18'),'passwordField':_0x8795('0x19')},function(_0x186e5f,_0x152901,_0x2015e4){return ActiveDirectoryAuthenticate(db[_0x8795('0x30')],_0x186e5f,_0x152901,_0x2015e4);})); \ No newline at end of file +var _0x01d2=['../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','agent','blocked','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport-local','moment','activedirectory2','bluebird','util','../../config/utils','../../config/environment'];(function(_0x416d82,_0xcfd3be){var _0x45096e=function(_0x5e628c){while(--_0x5e628c){_0x416d82['push'](_0x416d82['shift']());}};_0x45096e(++_0xcfd3be);}(_0x01d2,0x86));var _0x201d=function(_0x32ce76,_0x1dc4ee){_0x32ce76=_0x32ce76-0x0;var _0x35d428=_0x01d2[_0x32ce76];return _0x35d428;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x201d('0x0'))['Strategy'];var moment=require(_0x201d('0x1'));var ActiveDirectory=require(_0x201d('0x2'));var BPromise=require(_0x201d('0x3'));var util=require(_0x201d('0x4'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x201d('0x5'));var config=require(_0x201d('0x6'));var logger=require(_0x201d('0x7'))(_0x201d('0x8'));function isActiveDirectoryConfigured(_0x32002f){var _0x278c49=![];if(typeof _0x32002f[_0x201d('0x9')]!==_0x201d('0xa')){_0x278c49=_0x32002f[_0x201d('0x9')][_0x201d('0xb')]&&_0x32002f[_0x201d('0x9')]['url']&&_0x32002f['activedirectory'][_0x201d('0xc')];}return _0x278c49;}function adAuthenticate(_0x422774,_0x47ece5,_0x14267b){return new BPromise(function(_0x416328,_0x17b78c){try{var _0x3d1aa1=new ActiveDirectory(_0x422774);_0x3d1aa1[_0x201d('0xd')](_0x47ece5,_0x14267b,function(_0xb0f6b0,_0x28baff){if(_0xb0f6b0){logger['error'](_0x201d('0xe'),_0x47ece5,util[_0x201d('0xf')](_0xb0f6b0,{'showHidden':![],'depth':null}));_0x17b78c('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x28baff){logger[_0x201d('0x10')](_0x201d('0x11'),_0x47ece5);_0x17b78c(_0x201d('0x12'));}else{_0x416328(_0x28baff);}});}catch(_0x20de31){_0x17b78c(_0x20de31);}});}function ActiveDirectoryAuthenticate(_0x45ce2a,_0x5174ed,_0x1c82ba,_0x56d70f){var _0x25385c,_0x4e02ea;if(!isActiveDirectoryConfigured(config)){logger[_0x201d('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x5174ed);return _0x56d70f(null,![],{'message':_0x201d('0x12')});}return db['Setting'][_0x201d('0x13')]({'where':{'id':0x1},'attributes':[_0x201d('0x14'),_0x201d('0x15')],'raw':!![]})[_0x201d('0x16')](function(_0x199213){_0x25385c=_0x199213;if(!_0x25385c[_0x201d('0x14')]){logger[_0x201d('0x10')](_0x201d('0x17'),_0x5174ed);throw new Error(_0x201d('0x12'));}return _0x45ce2a[_0x201d('0x13')]({'attributes':['id',_0x201d('0x18'),_0x201d('0x19'),_0x201d('0x1a'),_0x201d('0x1b'),_0x201d('0x1c'),'blocked',_0x201d('0x1d'),_0x201d('0x1e')],'where':{'name':_0x5174ed,'role':{'$or':['admin','user',_0x201d('0x1f')]},'adSsoEnabled':!![]}});})[_0x201d('0x16')](function(_0xea7166){if(!_0xea7166||_0xea7166&&_0xea7166[_0x201d('0x18')]!==_0x5174ed){throw new Error(_0x201d('0x12'));}_0x4e02ea=_0xea7166;var _0x49d6d8=_0x4e02ea[_0x201d('0x18')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0x201d('0x9')],_0x49d6d8,_0x1c82ba);})[_0x201d('0x16')](function(_0x1ec11f){if(_0x4e02ea[_0x201d('0x1c')]){throw new Error(_0x201d('0x12'));}if(_0x25385c[_0x201d('0x15')]>0x0){if(_0x4e02ea[_0x201d('0x20')]){if(moment(_0x4e02ea[_0x201d('0x1d')])[_0x201d('0x21')](_0x25385c[_0x201d('0x15')],_0x201d('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x201d('0x23')](_0x4e02ea,0x0,![],null)['then'](function(){return utils[_0x201d('0x24')](_0x4e02ea);})[_0x201d('0x16')](function(){return _0x56d70f(null,_0x4e02ea);});}else{return utils[_0x201d('0x24')](_0x4e02ea)[_0x201d('0x16')](function(){return _0x56d70f(null,_0x4e02ea);});}}else{return utils[_0x201d('0x24')](_0x4e02ea)[_0x201d('0x16')](function(){return _0x56d70f(null,_0x4e02ea);});}})[_0x201d('0x25')](function(_0x2dca4a){return _0x56d70f(null,![],_0x2dca4a);});}function handleError(_0x22e1fc,_0x56930c,_0x4ee995){return _0x22e1fc[_0x201d('0x26')](_0x56930c||0x1f4)[_0x201d('0x27')]({'message':_0x4ee995?_0x4ee995[_0x201d('0x28')]||_0x4ee995:''});}exports[_0x201d('0x29')]=function(_0x4cd6bd,_0x3c5ee5,_0x2bb7e2){passport[_0x201d('0xd')](_0x201d('0x2a'),function(_0x43c47d,_0x432d2e,_0x45b2fd){var _0x30c980=_0x43c47d||_0x45b2fd;if(_0x30c980){return handleError(_0x3c5ee5,0x191,_0x30c980);}if(!_0x432d2e){return handleError(_0x3c5ee5,0x194,{'message':_0x201d('0x2b')});}else{var _0x5c8e74={'payload':{'id':_0x432d2e['id'],'role':_0x432d2e[_0x201d('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x201d('0x2c')](_0x5c8e74)['then'](function(_0x37a5f4){_0x3c5ee5[_0x201d('0x2d')]({'id':_0x432d2e['id'],'token':_0x37a5f4,'statusCall':'','isAlreadyLogged':_0x432d2e[_0x201d('0x1e')]});});}})(_0x4cd6bd,_0x3c5ee5,_0x2bb7e2);};passport[_0x201d('0x2e')](_0x201d('0x2a'),new LocalStrategy({'usernameField':_0x201d('0x18'),'passwordField':'password'},function(_0x5edd4b,_0x1b1ce0,_0xa314a1){return ActiveDirectoryAuthenticate(db['User'],_0x5edd4b,_0x1b1ce0,_0xa314a1);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 0d577c1..71d7529 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe315=['express','Router','./authActiveDirectory.controller','login','exports'];(function(_0x531347,_0x2a31b3){var _0x5b286b=function(_0x4823ec){while(--_0x4823ec){_0x531347['push'](_0x531347['shift']());}};_0x5b286b(++_0x2a31b3);}(_0xe315,0xf5));var _0x5e31=function(_0x54184a,_0x5c5449){_0x54184a=_0x54184a-0x0;var _0x29f6c1=_0xe315[_0x54184a];return _0x29f6c1;};'use strict';var express=require(_0x5e31('0x0'));var router=express[_0x5e31('0x1')]();var controller=require(_0x5e31('0x2'));router['post']('/',controller[_0x5e31('0x3')]);module[_0x5e31('0x4')]=router; \ No newline at end of file +var _0x9e94=['exports','express','Router','post','login'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9e94,0xc4));var _0x49e9=function(_0x4bc40b,_0x4e80e4){_0x4bc40b=_0x4bc40b-0x0;var _0x1f64e7=_0x9e94[_0x4bc40b];return _0x1f64e7;};'use strict';var express=require(_0x49e9('0x0'));var router=express[_0x49e9('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x49e9('0x2')]('/',controller[_0x49e9('0x3')]);module[_0x49e9('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index ae5e0f7..cf9e180 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x7a54,0x106));var _0x47a5=function(_0x50a4cd,_0x56d419){_0x50a4cd=_0x50a4cd-0x0;var _0x225856=_0x7a54[_0x50a4cd];return _0x225856;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7a54,0x106));var _0x47a5=function(_0x2dc3c2,_0x48e3da){_0x2dc3c2=_0x2dc3c2-0x0;var _0x25e4c1=_0x7a54[_0x2dc3c2];return _0x25e4c1;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 4e140ee..865801a 100644 --- a/server/api/authGoogle/index.js +++ b/server/api/authGoogle/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafca=['login','setTokenCookie','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','callback'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xafca,0x185));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0xaafc('0x0'));var passport=require(_0xaafc('0x1'));var router=express[_0xaafc('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xaafc('0x3'));var authService=require(_0xaafc('0x4'));router[_0xaafc('0x5')]('/',controller['login']);router['get']('/callback',controller[_0xaafc('0x6')],authService['isMiddleware'],userController[_0xaafc('0x7')],authService[_0xaafc('0x8')]);module['exports']=router; \ No newline at end of file +var _0xc59c=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback'];(function(_0x5027ee,_0x3b5b7e){var _0x2edca6=function(_0x5214ed){while(--_0x5214ed){_0x5027ee['push'](_0x5027ee['shift']());}};_0x2edca6(++_0x3b5b7e);}(_0xc59c,0x72));var _0xcc59=function(_0x3cb6d8,_0x19ff85){_0x3cb6d8=_0x3cb6d8-0x0;var _0x5c7088=_0xc59c[_0x3cb6d8];return _0x5c7088;};'use strict';var express=require(_0xcc59('0x0'));var passport=require(_0xcc59('0x1'));var router=express[_0xcc59('0x2')]();var controller=require(_0xcc59('0x3'));var userController=require(_0xcc59('0x4'));var authService=require('../../components/auth/service');router[_0xcc59('0x5')]('/',controller['login']);router[_0xcc59('0x5')](_0xcc59('0x6'),controller[_0xcc59('0x7')],authService[_0xcc59('0x8')],userController['login'],authService[_0xcc59('0x9')]);module[_0xcc59('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d4692bd..f28bbb7 100644 --- a/server/api/authLocal/authLocal.controller.js +++ b/server/api/authLocal/authLocal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf250=['email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','body','generate','trim','toLowerCase','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','save','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find'];(function(_0x29b835,_0x25220a){var _0x39c58b=function(_0x3dbd7d){while(--_0x3dbd7d){_0x29b835['push'](_0x29b835['shift']());}};_0x39c58b(++_0x25220a);}(_0xf250,0x1b6));var _0x0f25=function(_0x1bb939,_0x5905e9){_0x1bb939=_0x1bb939-0x0;var _0xf8e8a6=_0xf250[_0x1bb939];return _0xf8e8a6;};'use strict';var util=require(_0x0f25('0x0'));var passport=require(_0x0f25('0x1'));var LocalStrategy=require(_0x0f25('0x2'))[_0x0f25('0x3')];var jayson=require(_0x0f25('0x4'));var _=require('lodash');var rs=require(_0x0f25('0x5'));var moment=require(_0x0f25('0x6'));var db=require(_0x0f25('0x7'))['db'];var authService=require(_0x0f25('0x8'));var utils=require(_0x0f25('0x9'));var client=jayson['client'][_0x0f25('0xa')]({'port':0x232b});function localAuthenticate(_0x2c2f28,_0x3ffd7a,_0x56ed79,_0x5830b6){var _0x576c16,_0x278929;return db[_0x0f25('0xb')][_0x0f25('0xc')]({'where':{'id':0x1},'attributes':[_0x0f25('0xd'),_0x0f25('0xe')],'raw':!![]})[_0x0f25('0xf')](function(_0x10c2bc){_0x576c16=_0x10c2bc;return _0x2c2f28['findOne']({'attributes':['id',_0x0f25('0x10'),_0x0f25('0x11'),_0x0f25('0x12'),_0x0f25('0x13'),'disabled',_0x0f25('0x14'),_0x0f25('0x15'),_0x0f25('0x16')],'where':{'name':_0x3ffd7a,'role':{'$or':[_0x0f25('0x17'),_0x0f25('0x18'),_0x0f25('0x19')]}}});})[_0x0f25('0xf')](function(_0x38c740){if(!_0x38c740||_0x38c740&&_0x38c740[_0x0f25('0x10')]!==_0x3ffd7a){throw new Error(_0x0f25('0x1a'));}else{_0x278929=_0x38c740;return _0x278929;}})[_0x0f25('0xf')](function(){_0x278929[_0x0f25('0x1b')](_0x56ed79,function(_0xefdc62,_0x49e548){var _0x4fab6e=_0x278929['loginAttempts']+0x1;if(_0xefdc62){return _0x5830b6(_0xefdc62);}else if(!_0x49e548){if(_0x278929[_0x0f25('0x1c')]){return _0x5830b6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x576c16[_0x0f25('0xd')]>0x0){if(_0x278929[_0x0f25('0x14')]){if(_0x576c16[_0x0f25('0xe')]>0x0){if(moment(_0x278929[_0x0f25('0x15')])[_0x0f25('0x1d')](_0x576c16['blockDuration'],_0x0f25('0x1e'))>moment()){return _0x5830b6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0f25('0x1f')](_0x278929,_0x4fab6e,![],null)[_0x0f25('0xf')](function(){return _0x5830b6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5830b6(null,![],{'message':_0x0f25('0x1a')});}}else{if(_0x4fab6e>=_0x576c16[_0x0f25('0xd')]){return utils[_0x0f25('0x1f')](_0x278929,0x0,!![],moment())[_0x0f25('0xf')](function(){return _0x5830b6(null,![],{'message':_0x0f25('0x1a')});});}else{return utils[_0x0f25('0x1f')](_0x278929,_0x4fab6e,![],null)['then'](function(){return _0x5830b6(null,![],{'message':_0x0f25('0x1a')});});}}}else{return _0x5830b6(null,![],{'message':_0x0f25('0x1a')});}}else{if(_0x278929[_0x0f25('0x1c')]){return _0x5830b6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x576c16[_0x0f25('0xd')]>0x0){if(_0x278929[_0x0f25('0x14')]){if(_0x576c16[_0x0f25('0xe')]>0x0){if(moment(_0x278929[_0x0f25('0x15')])[_0x0f25('0x1d')](_0x576c16[_0x0f25('0xe')],_0x0f25('0x1e'))>moment()){return _0x5830b6(null,![],{'message':_0x0f25('0x1a')});}else{return utils[_0x0f25('0x1f')](_0x278929,0x0,![],null)['then'](function(){return utils[_0x0f25('0x20')](_0x278929);})[_0x0f25('0xf')](function(){return _0x5830b6(null,_0x278929);});}}else{return _0x5830b6(null,![],{'message':_0x0f25('0x1a')});}}else{return utils[_0x0f25('0x1f')](_0x278929,0x0,![],null)[_0x0f25('0xf')](function(){return utils[_0x0f25('0x20')](_0x278929);})[_0x0f25('0xf')](function(){return _0x5830b6(null,_0x278929);})['catch'](function(_0x348743){return _0x5830b6(null,![],_0x348743);});}}else{if(_0x278929[_0x0f25('0x14')]){return _0x5830b6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0f25('0x20')](_0x278929)[_0x0f25('0xf')](function(){return _0x5830b6(null,_0x278929);});}}}});})[_0x0f25('0x21')](function(_0x4c1c79){return _0x5830b6(null,![],_0x4c1c79);});}function sendServiceMail(_0x2873ce){return db[_0x0f25('0x22')][_0x0f25('0x23')]({'where':{'service':!![]},'attributes':['id',_0x0f25('0x10'),_0x0f25('0x24')],'include':[{'model':db[_0x0f25('0x25')],'as':_0x0f25('0x26'),'include':[{'model':db['CloudProvider'],'as':_0x0f25('0x27')}]}]})[_0x0f25('0xf')](function(_0x390127){if(!_0x390127){throw new Error(_0x0f25('0x28'));}var _0x2466ac=_0x390127['getSmtpOptions']();var _0x5d02f4={'account':_0x2466ac,'message':_['merge']({'from':util['format'](_0x0f25('0x29'),_0x390127['name'],_0x390127['email']||_0x390127['Smtp'][_0x0f25('0x18')])},_0x2873ce)};return client[_0x0f25('0x2a')](_0x0f25('0x2b'),_0x5d02f4);})[_0x0f25('0xf')](function(_0x1ae006){if(_0x1ae006[_0x0f25('0x2c')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1ae006[_0x0f25('0x2c')][_0x0f25('0x2d')]||JSON[_0x0f25('0x2e')](_0x1ae006[_0x0f25('0x2c')])));}return!![];});}function handleError(_0x5916fd,_0x3567c3,_0x48ca66){return _0x5916fd[_0x0f25('0x2f')](_0x3567c3||0x1f4)[_0x0f25('0x30')]({'message':_0x48ca66?_0x48ca66[_0x0f25('0x2d')]||_0x48ca66:''});}exports[_0x0f25('0x31')]=function(_0x3f8f04,_0xb2190e,_0x3982eb){passport[_0x0f25('0x1b')](_0x0f25('0x32'),function(_0x31dd29,_0x222535,_0x37215d){var _0x4ea500=_0x31dd29||_0x37215d;if(_0x4ea500){return handleError(_0xb2190e,0x191,_0x4ea500);}if(!_0x222535){return handleError(_0xb2190e,0x194,{'message':_0x0f25('0x33')});}else{var _0x55d5de={'payload':{'id':_0x222535['id'],'role':_0x222535[_0x0f25('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x0f25('0x34')](_0x55d5de)['then'](function(_0x27a37a){_0xb2190e['json']({'id':_0x222535['id'],'token':_0x27a37a,'statusCall':'','isAlreadyLogged':_0x222535['online']});});}})(_0x3f8f04,_0xb2190e,_0x3982eb);};exports['forgot']=function(_0x19a7d0,_0x1b6330){if(!_0x19a7d0[_0x0f25('0x35')][_0x0f25('0x24')]){return handleError(_0x1b6330,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x12ee76=rs[_0x0f25('0x36')]();_0x19a7d0['body']['email']=_0x19a7d0[_0x0f25('0x35')]['email'][_0x0f25('0x37')]()[_0x0f25('0x38')]();var _0x27f950;return db[_0x0f25('0xb')][_0x0f25('0xc')]({'where':{'id':0x1},'attributes':[_0x0f25('0xd'),_0x0f25('0xe')],'raw':!![]})[_0x0f25('0xf')](function(_0x5cf124){_0x27f950=_0x5cf124;return db[_0x0f25('0x39')][_0x0f25('0x23')]({'where':{'email':_0x19a7d0[_0x0f25('0x35')]['email']}});})['then'](function(_0x141ca3){if(!_0x141ca3){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x141ca3[_0x0f25('0x1c')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x141ca3['blocked']){if(moment(_0x141ca3[_0x0f25('0x15')])[_0x0f25('0x1d')](_0x27f950[_0x0f25('0xe')],_0x0f25('0x1e'))>moment()){throw new Error(_0x0f25('0x3a'));}else{_0x141ca3[_0x0f25('0x14')]=![];_0x141ca3['blockedAt']=null;}}_0x141ca3[_0x0f25('0x3b')]=_0x12ee76;_0x141ca3[_0x0f25('0x3c')]=Date['now']()+0x36ee80;return _0x141ca3['save']();})[_0x0f25('0xf')](function(){return sendServiceMail({'to':_0x19a7d0[_0x0f25('0x35')][_0x0f25('0x24')],'subject':_0x0f25('0x3d'),'text':_0x0f25('0x3e')+_0x0f25('0x3f')+_0x0f25('0x40')+_0x19a7d0[_0x0f25('0x41')][_0x0f25('0x42')]+'/reset/'+_0x12ee76+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0f25('0xf')](function(){_0x1b6330[_0x0f25('0x2f')](0xc8)[_0x0f25('0x30')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x96101f){return handleError(_0x1b6330,0x1f4,_0x96101f);});};exports[_0x0f25('0x43')]=function(_0x3f2b35,_0x47baff){return db[_0x0f25('0x39')]['find']({'where':{'resetPasswordToken':_0x3f2b35[_0x0f25('0x44')][_0x0f25('0x45')],'resetPasswordExpires':{'$gt':Date[_0x0f25('0x46')]()}}})[_0x0f25('0xf')](function(_0x31985a){if(!_0x31985a){throw new Error(_0x0f25('0x47'));}return db[_0x0f25('0xb')][_0x0f25('0xc')]({'attributes':['id',_0x0f25('0x48'),_0x0f25('0x49'),_0x0f25('0x4a')]})['then'](function(_0x39ba32){if(_0x39ba32[_0x0f25('0x48')])authService[_0x0f25('0x4b')](_0x3f2b35[_0x0f25('0x35')][_0x0f25('0x11')]);if(!_0x39ba32[_0x0f25('0x49')]||!_0x31985a[_0x0f25('0x4c')])return _0x31985a;authService['validatePasswordHistory'](_0x3f2b35[_0x0f25('0x35')][_0x0f25('0x11')],_0x31985a[_0x0f25('0x4c')],_0x39ba32[_0x0f25('0x4a')]);return _0x31985a;})[_0x0f25('0xf')](function(){_0x31985a[_0x0f25('0x11')]=_0x3f2b35[_0x0f25('0x35')][_0x0f25('0x11')];_0x31985a[_0x0f25('0x3b')]=null;_0x31985a[_0x0f25('0x3c')]=null;return _0x31985a[_0x0f25('0x4d')]();});})[_0x0f25('0xf')](function(){_0x47baff[_0x0f25('0x2f')](0xc8)[_0x0f25('0x30')]({'message':'Password\x20reset!'});})[_0x0f25('0x21')](function(_0x559579){return handleError(_0x47baff,0x1f4,_0x559579);});};passport[_0x0f25('0x4e')]('local-login',new LocalStrategy({'usernameField':_0x0f25('0x10'),'passwordField':_0x0f25('0x11')},function(_0x33d5df,_0x496acb,_0x4e6997){return localAuthenticate(db[_0x0f25('0x39')],_0x33d5df,_0x496acb,_0x4e6997);})); \ No newline at end of file +var _0xa809=['salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','signToken','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','host','/reset/','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','passport','jayson/promise','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','then','name','password'];(function(_0x57de4f,_0x41d9b1){var _0xf5df85=function(_0x57bffb){while(--_0x57bffb){_0x57de4f['push'](_0x57de4f['shift']());}};_0xf5df85(++_0x41d9b1);}(_0xa809,0x1f3));var _0x9a80=function(_0x13944e,_0x28c7ae){_0x13944e=_0x13944e-0x0;var _0x357a91=_0xa809[_0x13944e];return _0x357a91;};'use strict';var util=require('util');var passport=require(_0x9a80('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x9a80('0x1'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require(_0x9a80('0x2'))['db'];var authService=require(_0x9a80('0x3'));var utils=require(_0x9a80('0x4'));var client=jayson[_0x9a80('0x5')]['http']({'port':0x232b});function localAuthenticate(_0x295910,_0x504ba8,_0x17b704,_0x286ac5){var _0x4ea507,_0x1ef67a;return db[_0x9a80('0x6')][_0x9a80('0x7')]({'where':{'id':0x1},'attributes':[_0x9a80('0x8'),'blockDuration'],'raw':!![]})[_0x9a80('0x9')](function(_0x1e0017){_0x4ea507=_0x1e0017;return _0x295910[_0x9a80('0x7')]({'attributes':['id',_0x9a80('0xa'),_0x9a80('0xb'),_0x9a80('0xc'),_0x9a80('0xd'),_0x9a80('0xe'),'blocked',_0x9a80('0xf'),_0x9a80('0x10')],'where':{'name':_0x504ba8,'role':{'$or':[_0x9a80('0x11'),_0x9a80('0x12'),_0x9a80('0x13')]}}});})[_0x9a80('0x9')](function(_0x25f667){if(!_0x25f667||_0x25f667&&_0x25f667[_0x9a80('0xa')]!==_0x504ba8){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1ef67a=_0x25f667;return _0x1ef67a;}})[_0x9a80('0x9')](function(){_0x1ef67a['authenticate'](_0x17b704,function(_0x384be7,_0x109066){var _0x3625b0=_0x1ef67a['loginAttempts']+0x1;if(_0x384be7){return _0x286ac5(_0x384be7);}else if(!_0x109066){if(_0x1ef67a[_0x9a80('0xe')]){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}else if(_0x4ea507[_0x9a80('0x8')]>0x0){if(_0x1ef67a[_0x9a80('0x15')]){if(_0x4ea507[_0x9a80('0x16')]>0x0){if(moment(_0x1ef67a['blockedAt'])[_0x9a80('0x17')](_0x4ea507['blockDuration'],_0x9a80('0x18'))>moment()){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}else{return utils[_0x9a80('0x19')](_0x1ef67a,_0x3625b0,![],null)[_0x9a80('0x9')](function(){return _0x286ac5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x286ac5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3625b0>=_0x4ea507[_0x9a80('0x8')]){return utils[_0x9a80('0x19')](_0x1ef67a,0x0,!![],moment())[_0x9a80('0x9')](function(){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});});}else{return utils[_0x9a80('0x19')](_0x1ef67a,_0x3625b0,![],null)['then'](function(){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});});}}}else{return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}}else{if(_0x1ef67a[_0x9a80('0xe')]){return _0x286ac5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4ea507['allowedLoginAttempts']>0x0){if(_0x1ef67a[_0x9a80('0x15')]){if(_0x4ea507['blockDuration']>0x0){if(moment(_0x1ef67a[_0x9a80('0xf')])['add'](_0x4ea507[_0x9a80('0x16')],'minutes')>moment()){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}else{return utils[_0x9a80('0x19')](_0x1ef67a,0x0,![],null)[_0x9a80('0x9')](function(){return utils[_0x9a80('0x1a')](_0x1ef67a);})[_0x9a80('0x9')](function(){return _0x286ac5(null,_0x1ef67a);});}}else{return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}}else{return utils[_0x9a80('0x19')](_0x1ef67a,0x0,![],null)[_0x9a80('0x9')](function(){return utils['getLicense'](_0x1ef67a);})[_0x9a80('0x9')](function(){return _0x286ac5(null,_0x1ef67a);})[_0x9a80('0x1b')](function(_0x5b7f91){return _0x286ac5(null,![],_0x5b7f91);});}}else{if(_0x1ef67a[_0x9a80('0x15')]){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}else{return utils['getLicense'](_0x1ef67a)[_0x9a80('0x9')](function(){return _0x286ac5(null,_0x1ef67a);});}}}});})[_0x9a80('0x1b')](function(_0x28ce35){return _0x286ac5(null,![],_0x28ce35);});}function sendServiceMail(_0x2ef801){return db[_0x9a80('0x1c')][_0x9a80('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x9a80('0x1e')],'include':[{'model':db[_0x9a80('0x1f')],'as':_0x9a80('0x20'),'include':[{'model':db[_0x9a80('0x21')],'as':_0x9a80('0x21')}]}]})['then'](function(_0x3c0975){if(!_0x3c0975){throw new Error(_0x9a80('0x22'));}var _0x2ccd6b=_0x3c0975[_0x9a80('0x23')]();var _0x4a9786={'account':_0x2ccd6b,'message':_[_0x9a80('0x24')]({'from':util[_0x9a80('0x25')](_0x9a80('0x26'),_0x3c0975[_0x9a80('0xa')],_0x3c0975['email']||_0x3c0975[_0x9a80('0x20')][_0x9a80('0x12')])},_0x2ef801)};return client['request'](_0x9a80('0x27'),_0x4a9786);})[_0x9a80('0x9')](function(_0x9b4d1b){if(_0x9b4d1b[_0x9a80('0x28')]){throw new Error(util['format'](_0x9a80('0x29'),_0x9b4d1b[_0x9a80('0x28')][_0x9a80('0x2a')]||JSON[_0x9a80('0x2b')](_0x9b4d1b[_0x9a80('0x28')])));}return!![];});}function handleError(_0x435f33,_0x302edd,_0x2e6701){return _0x435f33[_0x9a80('0x2c')](_0x302edd||0x1f4)[_0x9a80('0x2d')]({'message':_0x2e6701?_0x2e6701[_0x9a80('0x2a')]||_0x2e6701:''});}exports[_0x9a80('0x2e')]=function(_0xc26f66,_0x3da968,_0x1d58df){passport['authenticate']('local-login',function(_0x480800,_0x4139a0,_0xf7d39f){var _0xcb098e=_0x480800||_0xf7d39f;if(_0xcb098e){return handleError(_0x3da968,0x191,_0xcb098e);}if(!_0x4139a0){return handleError(_0x3da968,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x16b0f0={'payload':{'id':_0x4139a0['id'],'role':_0x4139a0[_0x9a80('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x9a80('0x2f')](_0x16b0f0)[_0x9a80('0x9')](function(_0x4dee01){_0x3da968['json']({'id':_0x4139a0['id'],'token':_0x4dee01,'statusCall':'','isAlreadyLogged':_0x4139a0['online']});});}})(_0xc26f66,_0x3da968,_0x1d58df);};exports['forgot']=function(_0x377c2a,_0x5b3bc7){if(!_0x377c2a[_0x9a80('0x30')]['email']){return handleError(_0x5b3bc7,0x1f4,{'message':_0x9a80('0x31')});}var _0x594a9b=rs[_0x9a80('0x32')]();_0x377c2a[_0x9a80('0x30')][_0x9a80('0x1e')]=_0x377c2a[_0x9a80('0x30')]['email'][_0x9a80('0x33')]()['toLowerCase']();var _0x44da37;return db[_0x9a80('0x6')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x9a80('0x9')](function(_0x510722){_0x44da37=_0x510722;return db[_0x9a80('0x34')][_0x9a80('0x1d')]({'where':{'email':_0x377c2a[_0x9a80('0x30')][_0x9a80('0x1e')]}});})[_0x9a80('0x9')](function(_0x206301){if(!_0x206301){throw new Error(_0x9a80('0x35'));}if(_0x206301[_0x9a80('0xe')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x206301[_0x9a80('0x15')]){if(moment(_0x206301[_0x9a80('0xf')])[_0x9a80('0x17')](_0x44da37[_0x9a80('0x16')],_0x9a80('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x206301['blocked']=![];_0x206301[_0x9a80('0xf')]=null;}}_0x206301[_0x9a80('0x36')]=_0x594a9b;_0x206301[_0x9a80('0x37')]=Date[_0x9a80('0x38')]()+0x36ee80;return _0x206301[_0x9a80('0x39')]();})[_0x9a80('0x9')](function(){return sendServiceMail({'to':_0x377c2a[_0x9a80('0x30')][_0x9a80('0x1e')],'subject':_0x9a80('0x3a'),'text':_0x9a80('0x3b')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9a80('0x3c')+_0x377c2a['headers'][_0x9a80('0x3d')]+_0x9a80('0x3e')+_0x594a9b+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x9a80('0x9')](function(){_0x5b3bc7[_0x9a80('0x2c')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x9a80('0x1b')](function(_0x126f29){return handleError(_0x5b3bc7,0x1f4,_0x126f29);});};exports[_0x9a80('0x3f')]=function(_0x1aeeca,_0x548472){return db['User'][_0x9a80('0x1d')]({'where':{'resetPasswordToken':_0x1aeeca[_0x9a80('0x40')][_0x9a80('0x41')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x9a80('0x9')](function(_0x52f478){if(!_0x52f478){throw new Error(_0x9a80('0x42'));}return db[_0x9a80('0x6')]['findOne']({'attributes':['id',_0x9a80('0x43'),_0x9a80('0x44'),_0x9a80('0x45')]})[_0x9a80('0x9')](function(_0x39e36b){if(_0x39e36b['securePassword'])authService['validatePasswordPattern'](_0x1aeeca['body']['password']);if(!_0x39e36b[_0x9a80('0x44')]||!_0x52f478[_0x9a80('0x46')])return _0x52f478;authService[_0x9a80('0x47')](_0x1aeeca[_0x9a80('0x30')][_0x9a80('0xb')],_0x52f478['previousPasswords'],_0x39e36b[_0x9a80('0x45')]);return _0x52f478;})[_0x9a80('0x9')](function(){_0x52f478[_0x9a80('0xb')]=_0x1aeeca[_0x9a80('0x30')][_0x9a80('0xb')];_0x52f478['resetPasswordToken']=null;_0x52f478['resetPasswordExpires']=null;return _0x52f478[_0x9a80('0x39')]();});})[_0x9a80('0x9')](function(){_0x548472[_0x9a80('0x2c')](0xc8)[_0x9a80('0x2d')]({'message':_0x9a80('0x48')});})[_0x9a80('0x1b')](function(_0x4735bd){return handleError(_0x548472,0x1f4,_0x4735bd);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x9a80('0xa'),'passwordField':_0x9a80('0xb')},function(_0x47eb9d,_0x55a4e2,_0x371fc1){return localAuthenticate(db[_0x9a80('0x34')],_0x47eb9d,_0x55a4e2,_0x371fc1);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 5b05068..c9aca3a 100644 --- a/server/api/authLocal/index.js +++ b/server/api/authLocal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96e2=['reset','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0x5a5595,_0x145fa0){var _0x43809d=function(_0x48c34f){while(--_0x48c34f){_0x5a5595['push'](_0x5a5595['shift']());}};_0x43809d(++_0x145fa0);}(_0x96e2,0xe9));var _0x296e=function(_0x1d6dea,_0x1f8978){_0x1d6dea=_0x1d6dea-0x0;var _0x1b5967=_0x96e2[_0x1d6dea];return _0x1b5967;};'use strict';var express=require(_0x296e('0x0'));var router=express[_0x296e('0x1')]();var controller=require(_0x296e('0x2'));router[_0x296e('0x3')]('/',controller['login']);router[_0x296e('0x3')](_0x296e('0x4'),controller['forgot']);router[_0x296e('0x3')]('/reset/:token',controller[_0x296e('0x5')]);module[_0x296e('0x6')]=router; \ No newline at end of file +var _0x9367=['exports','express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','reset'];(function(_0x1872c8,_0x35bfe7){var _0x3bdf54=function(_0x1db9a2){while(--_0x1db9a2){_0x1872c8['push'](_0x1872c8['shift']());}};_0x3bdf54(++_0x35bfe7);}(_0x9367,0x1a8));var _0x7936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9367[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x7936('0x0'));var router=express[_0x7936('0x1')]();var controller=require(_0x7936('0x2'));router[_0x7936('0x3')]('/',controller['login']);router[_0x7936('0x3')](_0x7936('0x4'),controller[_0x7936('0x5')]);router[_0x7936('0x3')](_0x7936('0x6'),controller[_0x7936('0x7')]);module[_0x7936('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 18257df..7d37510 100644 --- a/server/api/automation/automation.attributes.js +++ b/server/api/automation/automation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x82ff=['BOOLEAN','INTEGER','STRING'];(function(_0x41c33d,_0x236f3d){var _0x1e782a=function(_0x5bc45c){while(--_0x5bc45c){_0x41c33d['push'](_0x41c33d['shift']());}};_0x1e782a(++_0x236f3d);}(_0x82ff,0x119));var _0xf82f=function(_0x2fcfe0,_0x34d0ec){_0x2fcfe0=_0x2fcfe0-0x0;var _0x2db222=_0x82ff[_0x2fcfe0];return _0x2db222;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf82f('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0xf82f('0x0')]},'description':{'type':Sequelize[_0xf82f('0x0')]},'status':{'type':Sequelize[_0xf82f('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf82f('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xdcfd=['sequelize','exports','STRING','INTEGER'];(function(_0x30063a,_0x4a55c8){var _0x2024d2=function(_0x54df95){while(--_0x54df95){_0x30063a['push'](_0x30063a['shift']());}};_0x2024d2(++_0x4a55c8);}(_0xdcfd,0x16c));var _0xddcf=function(_0x2b2c53,_0x4bcf9b){_0x2b2c53=_0x2b2c53-0x0;var _0x311ec2=_0xdcfd[_0x2b2c53];return _0x311ec2;};'use strict';var Sequelize=require(_0xddcf('0x0'));module[_0xddcf('0x1')]={'name':{'type':Sequelize[_0xddcf('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xddcf('0x2')]},'description':{'type':Sequelize[_0xddcf('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xddcf('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 9c5a0bb..512ec5e 100644 --- a/server/api/automation/automation.controller.js +++ b/server/api/automation/automation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1549=['pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Condition','addConditions','omit','ids','getConditions','findOne','nolimit','Action','addActions','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','then','stack','name','send','map','Automation','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1549,0x1c6));var _0x9154=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0x1549[_0x113e32];return _0x4ff939;};'use strict';var emlformat=require(_0x9154('0x0'));var rimraf=require(_0x9154('0x1'));var zipdir=require(_0x9154('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9154('0x3'));var moment=require(_0x9154('0x4'));var BPromise=require(_0x9154('0x5'));var Mustache=require(_0x9154('0x6'));var util=require('util');var path=require(_0x9154('0x7'));var sox=require(_0x9154('0x8'));var csv=require(_0x9154('0x9'));var ejs=require(_0x9154('0xa'));var fs=require('fs');var fs_extra=require(_0x9154('0xb'));var _=require(_0x9154('0xc'));var squel=require(_0x9154('0xd'));var crypto=require(_0x9154('0xe'));var jsforce=require(_0x9154('0xf'));var deskjs=require(_0x9154('0x10'));var toCsv=require(_0x9154('0x9'));var querystring=require('querystring');var Papa=require(_0x9154('0x11'));var Redis=require(_0x9154('0x12'));var authService=require(_0x9154('0x13'));var qs=require(_0x9154('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9154('0x15'));var logger=require(_0x9154('0x16'))(_0x9154('0x17'));var utils=require(_0x9154('0x18'));var config=require(_0x9154('0x19'));var licenseUtil=require(_0x9154('0x1a'));var db=require(_0x9154('0x1b'))['db'];function respondWithStatusCode(_0x606264,_0x32b0e2){_0x32b0e2=_0x32b0e2||0xcc;return function(_0x2dc4b8){if(_0x2dc4b8){return _0x606264[_0x9154('0x1c')](_0x32b0e2);}return _0x606264[_0x9154('0x1d')](_0x32b0e2)[_0x9154('0x1e')]();};}function respondWithResult(_0x16df2a,_0x591998){_0x591998=_0x591998||0xc8;return function(_0x500dd3){if(_0x500dd3){return _0x16df2a[_0x9154('0x1d')](_0x591998)[_0x9154('0x1f')](_0x500dd3);}};}function respondWithFilteredResult(_0x126dc4,_0xbc74b3){return function(_0x257c74){if(_0x257c74){var _0x2443a3=typeof _0xbc74b3[_0x9154('0x20')]===_0x9154('0x21')&&typeof _0xbc74b3[_0x9154('0x22')]===_0x9154('0x21');var _0x21e04a=_0x257c74[_0x9154('0x23')];var _0x2ef4f6=_0x2443a3?0x0:_0xbc74b3['offset'];var _0x383cf0=_0x2443a3?_0x257c74[_0x9154('0x23')]:_0xbc74b3['offset']+_0xbc74b3[_0x9154('0x22')];var _0x531c8b;if(_0x383cf0>=_0x21e04a){_0x383cf0=_0x21e04a;_0x531c8b=0xc8;}else{_0x531c8b=0xce;}_0x126dc4[_0x9154('0x1d')](_0x531c8b);return _0x126dc4['set'](_0x9154('0x24'),_0x2ef4f6+'-'+_0x383cf0+'/'+_0x21e04a)[_0x9154('0x1f')](_0x257c74);}return null;};}function patchUpdates(_0x3e167d){return function(_0x399fc9){try{jsonpatch[_0x9154('0x25')](_0x399fc9,_0x3e167d,!![]);}catch(_0x5edc45){return BPromise['reject'](_0x5edc45);}return _0x399fc9['save']();};}function saveUpdates(_0x32e543,_0x3bc977){return function(_0x266583){if(_0x266583){return _0x266583[_0x9154('0x26')](_0x32e543)['then'](function(_0x453f0c){return _0x453f0c;});}return null;};}function removeEntity(_0x596456,_0x13bc8d){return function(_0x1742cb){if(_0x1742cb){return _0x1742cb[_0x9154('0x27')]()[_0x9154('0x28')](function(){_0x596456[_0x9154('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14c68d,_0x355182){return function(_0x11e333){if(!_0x11e333){_0x14c68d[_0x9154('0x1c')](0x194);}return _0x11e333;};}function handleError(_0x1c61da,_0x4faaa1){_0x4faaa1=_0x4faaa1||0x1f4;return function(_0x5f4ce8){logger['error'](_0x5f4ce8[_0x9154('0x29')]);if(_0x5f4ce8[_0x9154('0x2a')]){delete _0x5f4ce8['name'];}_0x1c61da[_0x9154('0x1d')](_0x4faaa1)[_0x9154('0x2b')](_0x5f4ce8);};}exports['index']=function(_0x1b69a0,_0x44ce65){var _0x211111={},_0x441526={},_0x572ced={'count':0x0,'rows':[]};var _0x510eb5=_[_0x9154('0x2c')](db[_0x9154('0x2d')][_0x9154('0x2e')],function(_0x281329){return{'name':_0x281329[_0x9154('0x2f')],'type':_0x281329[_0x9154('0x30')][_0x9154('0x31')]};});_0x441526[_0x9154('0x32')]=_[_0x9154('0x2c')](_0x510eb5,_0x9154('0x2a'));_0x441526['query']=_[_0x9154('0x33')](_0x1b69a0[_0x9154('0x34')]);_0x441526[_0x9154('0x35')]=_[_0x9154('0x36')](_0x441526['model'],_0x441526[_0x9154('0x34')]);_0x211111[_0x9154('0x37')]=_[_0x9154('0x36')](_0x441526[_0x9154('0x32')],qs[_0x9154('0x38')](_0x1b69a0[_0x9154('0x34')][_0x9154('0x38')]));_0x211111[_0x9154('0x37')]=_0x211111['attributes'][_0x9154('0x39')]?_0x211111[_0x9154('0x37')]:_0x441526[_0x9154('0x32')];if(!_0x1b69a0['query'][_0x9154('0x3a')]('nolimit')){_0x211111[_0x9154('0x22')]=qs[_0x9154('0x22')](_0x1b69a0[_0x9154('0x34')]['limit']);_0x211111[_0x9154('0x20')]=qs[_0x9154('0x20')](_0x1b69a0[_0x9154('0x34')][_0x9154('0x20')]);}_0x211111[_0x9154('0x3b')]=qs[_0x9154('0x3c')](_0x1b69a0['query'][_0x9154('0x3c')]);_0x211111[_0x9154('0x3d')]=qs[_0x9154('0x35')](_[_0x9154('0x3e')](_0x1b69a0['query'],_0x441526['filters']),_0x510eb5);if(_0x1b69a0['query']['filter']){_0x211111[_0x9154('0x3d')]=_[_0x9154('0x3f')](_0x211111['where'],{'$or':_[_0x9154('0x2c')](_0x510eb5,function(_0x494680){if(_0x494680['type']!=='VIRTUAL'){var _0x383932={};_0x383932[_0x494680[_0x9154('0x2a')]]={'$like':'%'+_0x1b69a0[_0x9154('0x34')][_0x9154('0x40')]+'%'};return _0x383932;}})});}_0x211111=_[_0x9154('0x3f')]({},_0x211111,_0x1b69a0[_0x9154('0x41')]);var _0x5605ac={'where':_0x211111[_0x9154('0x3d')]};return db[_0x9154('0x2d')][_0x9154('0x23')](_0x5605ac)[_0x9154('0x28')](function(_0x4e623e){_0x572ced[_0x9154('0x23')]=_0x4e623e;if(_0x1b69a0[_0x9154('0x34')][_0x9154('0x42')]){_0x211111[_0x9154('0x43')]=[{'all':!![]}];}return db[_0x9154('0x2d')][_0x9154('0x44')](_0x211111);})['then'](function(_0x53dce1){_0x572ced[_0x9154('0x45')]=_0x53dce1;return _0x572ced;})[_0x9154('0x28')](respondWithFilteredResult(_0x44ce65,_0x211111))[_0x9154('0x46')](handleError(_0x44ce65,null));};exports[_0x9154('0x47')]=function(_0x47f879,_0x304560){var _0xc37700={'raw':![],'where':{'id':_0x47f879[_0x9154('0x48')]['id']}},_0x25e085={};_0x25e085['model']=_[_0x9154('0x33')](db[_0x9154('0x2d')]['rawAttributes']);_0x25e085['query']=_[_0x9154('0x33')](_0x47f879[_0x9154('0x34')]);_0x25e085[_0x9154('0x35')]=_[_0x9154('0x36')](_0x25e085[_0x9154('0x32')],_0x25e085[_0x9154('0x34')]);_0xc37700[_0x9154('0x37')]=_[_0x9154('0x36')](_0x25e085[_0x9154('0x32')],qs[_0x9154('0x38')](_0x47f879[_0x9154('0x34')]['fields']));_0xc37700['attributes']=_0xc37700[_0x9154('0x37')][_0x9154('0x39')]?_0xc37700[_0x9154('0x37')]:_0x25e085[_0x9154('0x32')];if(_0x47f879['query']['includeAll']){_0xc37700['include']=[{'all':!![]}];}_0xc37700=_['merge']({},_0xc37700,_0x47f879[_0x9154('0x41')]);return db[_0x9154('0x2d')][_0x9154('0x49')](_0xc37700)['then'](handleEntityNotFound(_0x304560,null))['then'](respondWithResult(_0x304560,null))[_0x9154('0x46')](handleError(_0x304560,null));};exports[_0x9154('0x4a')]=function(_0x2ff94c,_0xaaba93){return db[_0x9154('0x2d')][_0x9154('0x4a')](_0x2ff94c['body'],{})[_0x9154('0x28')](respondWithResult(_0xaaba93,0xc9))[_0x9154('0x46')](handleError(_0xaaba93,null));};exports[_0x9154('0x26')]=function(_0x3d846c,_0x2cee40){if(_0x3d846c[_0x9154('0x4b')]['id']){delete _0x3d846c[_0x9154('0x4b')]['id'];}return db[_0x9154('0x2d')][_0x9154('0x49')]({'where':{'id':_0x3d846c['params']['id']}})[_0x9154('0x28')](handleEntityNotFound(_0x2cee40,null))['then'](saveUpdates(_0x3d846c[_0x9154('0x4b')],null))[_0x9154('0x28')](respondWithResult(_0x2cee40,null))['catch'](handleError(_0x2cee40,null));};exports[_0x9154('0x27')]=function(_0x59e758,_0x35dd87){return db[_0x9154('0x2d')]['find']({'where':{'id':_0x59e758[_0x9154('0x48')]['id']}})[_0x9154('0x28')](handleEntityNotFound(_0x35dd87,null))[_0x9154('0x28')](removeEntity(_0x35dd87,null))[_0x9154('0x46')](handleError(_0x35dd87,null));};exports['addConditions']=function(_0x4ac980,_0x2b41a1,_0x5bc439){return db[_0x9154('0x4c')][_0x9154('0x49')]({'where':{'id':_0x4ac980['params']['id']}})['then'](handleEntityNotFound(_0x2b41a1,null))[_0x9154('0x28')](function(_0x4ed463){if(_0x4ed463){return _0x4ed463[_0x9154('0x4d')](_0x4ac980[_0x9154('0x4b')]['ids'],_[_0x9154('0x4e')](_0x4ac980[_0x9154('0x4b')],[_0x9154('0x4f'),'id'])||{});}})[_0x9154('0x28')](respondWithResult(_0x2b41a1,null))[_0x9154('0x46')](handleError(_0x2b41a1,null));};exports[_0x9154('0x50')]=function(_0x2c9d0a,_0x45485b,_0x5e158c){var _0x3b9903={};var _0x340b01={};var _0x4e50c2;var _0x5c28eb;return db['Automation'][_0x9154('0x51')]({'where':{'id':_0x2c9d0a[_0x9154('0x48')]['id']}})[_0x9154('0x28')](handleEntityNotFound(_0x45485b,null))[_0x9154('0x28')](function(_0x682dc9){if(_0x682dc9){_0x4e50c2=_0x682dc9;_0x340b01[_0x9154('0x32')]=_[_0x9154('0x33')](db['Condition'][_0x9154('0x2e')]);_0x340b01[_0x9154('0x34')]=_[_0x9154('0x33')](_0x2c9d0a['query']);_0x340b01[_0x9154('0x35')]=_[_0x9154('0x36')](_0x340b01['model'],_0x340b01['query']);_0x3b9903[_0x9154('0x37')]=_[_0x9154('0x36')](_0x340b01[_0x9154('0x32')],qs[_0x9154('0x38')](_0x2c9d0a['query'][_0x9154('0x38')]));_0x3b9903[_0x9154('0x37')]=_0x3b9903[_0x9154('0x37')][_0x9154('0x39')]?_0x3b9903[_0x9154('0x37')]:_0x340b01[_0x9154('0x32')];_0x3b9903[_0x9154('0x3b')]=qs[_0x9154('0x3c')](_0x2c9d0a[_0x9154('0x34')][_0x9154('0x3c')]);_0x3b9903[_0x9154('0x3d')]=qs[_0x9154('0x35')](_['pick'](_0x2c9d0a['query'],_0x340b01['filters']));if(_0x2c9d0a[_0x9154('0x34')][_0x9154('0x40')]){_0x3b9903[_0x9154('0x3d')]=_[_0x9154('0x3f')](_0x3b9903['where'],{'$or':_[_0x9154('0x2c')](_0x3b9903[_0x9154('0x37')],function(_0x41e660){var _0x2f1696={};_0x2f1696[_0x41e660]={'$like':'%'+_0x2c9d0a[_0x9154('0x34')][_0x9154('0x40')]+'%'};return _0x2f1696;})});}_0x3b9903=_[_0x9154('0x3f')]({},_0x3b9903,_0x2c9d0a['options']);return _0x4e50c2[_0x9154('0x50')](_0x3b9903);}})[_0x9154('0x28')](function(_0x401924){if(_0x401924){_0x5c28eb=_0x401924['length'];if(!_0x2c9d0a[_0x9154('0x34')][_0x9154('0x3a')](_0x9154('0x52'))){_0x3b9903['limit']=qs['limit'](_0x2c9d0a[_0x9154('0x34')][_0x9154('0x22')]);_0x3b9903[_0x9154('0x20')]=qs[_0x9154('0x20')](_0x2c9d0a[_0x9154('0x34')]['offset']);}return _0x4e50c2[_0x9154('0x50')](_0x3b9903);}})[_0x9154('0x28')](function(_0x324363){if(_0x324363){return _0x324363?{'count':_0x5c28eb,'rows':_0x324363}:null;}})[_0x9154('0x28')](respondWithResult(_0x45485b,null))[_0x9154('0x46')](handleError(_0x45485b,null));};exports['addActions']=function(_0x53072d,_0x107944,_0x3dd9e2){return db[_0x9154('0x53')][_0x9154('0x49')]({'where':{'id':_0x53072d[_0x9154('0x48')]['id']}})['then'](handleEntityNotFound(_0x107944,null))[_0x9154('0x28')](function(_0xc70b5a){if(_0xc70b5a){return _0xc70b5a[_0x9154('0x54')](_0x53072d[_0x9154('0x4b')]['ids'],_[_0x9154('0x4e')](_0x53072d[_0x9154('0x4b')],['ids','id'])||{});}})[_0x9154('0x28')](respondWithResult(_0x107944,null))[_0x9154('0x46')](handleError(_0x107944,null));};exports[_0x9154('0x55')]=function(_0x2d86ec,_0x9bc4f8,_0x3266b3){var _0x19287f={};var _0x4b6c3c={};var _0x26656d;var _0x582a5b;return db[_0x9154('0x2d')][_0x9154('0x51')]({'where':{'id':_0x2d86ec[_0x9154('0x48')]['id']}})[_0x9154('0x28')](handleEntityNotFound(_0x9bc4f8,null))[_0x9154('0x28')](function(_0xb15f46){if(_0xb15f46){_0x26656d=_0xb15f46;_0x4b6c3c[_0x9154('0x32')]=_[_0x9154('0x33')](db[_0x9154('0x53')][_0x9154('0x2e')]);_0x4b6c3c['query']=_[_0x9154('0x33')](_0x2d86ec['query']);_0x4b6c3c[_0x9154('0x35')]=_[_0x9154('0x36')](_0x4b6c3c['model'],_0x4b6c3c['query']);_0x19287f[_0x9154('0x37')]=_[_0x9154('0x36')](_0x4b6c3c[_0x9154('0x32')],qs[_0x9154('0x38')](_0x2d86ec[_0x9154('0x34')]['fields']));_0x19287f['attributes']=_0x19287f[_0x9154('0x37')][_0x9154('0x39')]?_0x19287f[_0x9154('0x37')]:_0x4b6c3c[_0x9154('0x32')];_0x19287f[_0x9154('0x3b')]=qs[_0x9154('0x3c')](_0x2d86ec[_0x9154('0x34')][_0x9154('0x3c')]);_0x19287f[_0x9154('0x3d')]=qs[_0x9154('0x35')](_[_0x9154('0x3e')](_0x2d86ec['query'],_0x4b6c3c['filters']));if(_0x2d86ec[_0x9154('0x34')][_0x9154('0x40')]){_0x19287f[_0x9154('0x3d')]=_[_0x9154('0x3f')](_0x19287f[_0x9154('0x3d')],{'$or':_[_0x9154('0x2c')](_0x19287f[_0x9154('0x37')],function(_0x18f677){var _0x17bc5d={};_0x17bc5d[_0x18f677]={'$like':'%'+_0x2d86ec[_0x9154('0x34')]['filter']+'%'};return _0x17bc5d;})});}_0x19287f=_[_0x9154('0x3f')]({},_0x19287f,_0x2d86ec[_0x9154('0x41')]);return _0x26656d[_0x9154('0x55')](_0x19287f);}})[_0x9154('0x28')](function(_0x1e2ce7){if(_0x1e2ce7){_0x582a5b=_0x1e2ce7[_0x9154('0x39')];if(!_0x2d86ec[_0x9154('0x34')][_0x9154('0x3a')](_0x9154('0x52'))){_0x19287f[_0x9154('0x22')]=qs[_0x9154('0x22')](_0x2d86ec['query']['limit']);_0x19287f['offset']=qs[_0x9154('0x20')](_0x2d86ec[_0x9154('0x34')][_0x9154('0x20')]);}return _0x26656d[_0x9154('0x55')](_0x19287f);}})[_0x9154('0x28')](function(_0x352c5f){if(_0x352c5f){return _0x352c5f?{'count':_0x582a5b,'rows':_0x352c5f}:null;}})[_0x9154('0x28')](respondWithResult(_0x9bc4f8,null))[_0x9154('0x46')](handleError(_0x9bc4f8,null));}; \ No newline at end of file +var _0x5786=['includeAll','include','findAll','rawAttributes','find','catch','create','body','params','addConditions','ids','omit','findOne','pick','hasOwnProperty','getConditions','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','index','map','Automation','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','then'];(function(_0x1921c8,_0x5f4cc4){var _0x18ca16=function(_0x16df03){while(--_0x16df03){_0x1921c8['push'](_0x1921c8['shift']());}};_0x18ca16(++_0x5f4cc4);}(_0x5786,0x1ac));var _0x6578=function(_0x5a158c,_0x56ac5c){_0x5a158c=_0x5a158c-0x0;var _0x598a1a=_0x5786[_0x5a158c];return _0x598a1a;};'use strict';var emlformat=require(_0x6578('0x0'));var rimraf=require(_0x6578('0x1'));var zipdir=require(_0x6578('0x2'));var jsonpatch=require(_0x6578('0x3'));var rp=require(_0x6578('0x4'));var moment=require(_0x6578('0x5'));var BPromise=require(_0x6578('0x6'));var Mustache=require(_0x6578('0x7'));var util=require(_0x6578('0x8'));var path=require(_0x6578('0x9'));var sox=require(_0x6578('0xa'));var csv=require(_0x6578('0xb'));var ejs=require(_0x6578('0xc'));var fs=require('fs');var fs_extra=require(_0x6578('0xd'));var _=require(_0x6578('0xe'));var squel=require(_0x6578('0xf'));var crypto=require(_0x6578('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6578('0x11'));var Redis=require('ioredis');var authService=require(_0x6578('0x12'));var qs=require(_0x6578('0x13'));var as=require(_0x6578('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6578('0x15'))(_0x6578('0x16'));var utils=require(_0x6578('0x17'));var config=require(_0x6578('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6578('0x19'))['db'];function respondWithStatusCode(_0x2ebce1,_0xa39469){_0xa39469=_0xa39469||0xcc;return function(_0x16da82){if(_0x16da82){return _0x2ebce1[_0x6578('0x1a')](_0xa39469);}return _0x2ebce1[_0x6578('0x1b')](_0xa39469)[_0x6578('0x1c')]();};}function respondWithResult(_0x4f3b1f,_0x616640){_0x616640=_0x616640||0xc8;return function(_0x2b8337){if(_0x2b8337){return _0x4f3b1f[_0x6578('0x1b')](_0x616640)[_0x6578('0x1d')](_0x2b8337);}};}function respondWithFilteredResult(_0x470763,_0x3a8f2f){return function(_0x41ba86){if(_0x41ba86){var _0x1f24f4=typeof _0x3a8f2f[_0x6578('0x1e')]===_0x6578('0x1f')&&typeof _0x3a8f2f[_0x6578('0x20')]===_0x6578('0x1f');var _0xe6c3c=_0x41ba86['count'];var _0x2428d4=_0x1f24f4?0x0:_0x3a8f2f[_0x6578('0x1e')];var _0x504b08=_0x1f24f4?_0x41ba86[_0x6578('0x21')]:_0x3a8f2f[_0x6578('0x1e')]+_0x3a8f2f[_0x6578('0x20')];var _0x4c88a5;if(_0x504b08>=_0xe6c3c){_0x504b08=_0xe6c3c;_0x4c88a5=0xc8;}else{_0x4c88a5=0xce;}_0x470763[_0x6578('0x1b')](_0x4c88a5);return _0x470763[_0x6578('0x22')](_0x6578('0x23'),_0x2428d4+'-'+_0x504b08+'/'+_0xe6c3c)['json'](_0x41ba86);}return null;};}function patchUpdates(_0x10f3e6){return function(_0x34452c){try{jsonpatch['apply'](_0x34452c,_0x10f3e6,!![]);}catch(_0x598653){return BPromise[_0x6578('0x24')](_0x598653);}return _0x34452c[_0x6578('0x25')]();};}function saveUpdates(_0xeb9d52,_0x358203){return function(_0x2700fb){if(_0x2700fb){return _0x2700fb[_0x6578('0x26')](_0xeb9d52)['then'](function(_0x5b9f95){return _0x5b9f95;});}return null;};}function removeEntity(_0x451b30,_0x3f5a45){return function(_0x4df8b9){if(_0x4df8b9){return _0x4df8b9[_0x6578('0x27')]()['then'](function(){_0x451b30[_0x6578('0x1b')](0xcc)[_0x6578('0x1c')]();});}};}function handleEntityNotFound(_0x54068a,_0x26f8f1){return function(_0x3b52bd){if(!_0x3b52bd){_0x54068a[_0x6578('0x1a')](0x194);}return _0x3b52bd;};}function handleError(_0x286df6,_0x3e51ed){_0x3e51ed=_0x3e51ed||0x1f4;return function(_0x50987e){logger['error'](_0x50987e[_0x6578('0x28')]);if(_0x50987e['name']){delete _0x50987e['name'];}_0x286df6[_0x6578('0x1b')](_0x3e51ed)['send'](_0x50987e);};}exports[_0x6578('0x29')]=function(_0x19476d,_0x39ba27){var _0x5d01f6={},_0x171bbe={},_0x578f72={'count':0x0,'rows':[]};var _0x391a79=_[_0x6578('0x2a')](db[_0x6578('0x2b')]['rawAttributes'],function(_0x3923e7){return{'name':_0x3923e7['fieldName'],'type':_0x3923e7['type'][_0x6578('0x2c')]};});_0x171bbe[_0x6578('0x2d')]=_['map'](_0x391a79,_0x6578('0x2e'));_0x171bbe[_0x6578('0x2f')]=_[_0x6578('0x30')](_0x19476d[_0x6578('0x2f')]);_0x171bbe[_0x6578('0x31')]=_[_0x6578('0x32')](_0x171bbe[_0x6578('0x2d')],_0x171bbe['query']);_0x5d01f6[_0x6578('0x33')]=_[_0x6578('0x32')](_0x171bbe[_0x6578('0x2d')],qs['fields'](_0x19476d['query'][_0x6578('0x34')]));_0x5d01f6[_0x6578('0x33')]=_0x5d01f6['attributes'][_0x6578('0x35')]?_0x5d01f6['attributes']:_0x171bbe['model'];if(!_0x19476d['query']['hasOwnProperty'](_0x6578('0x36'))){_0x5d01f6[_0x6578('0x20')]=qs[_0x6578('0x20')](_0x19476d[_0x6578('0x2f')][_0x6578('0x20')]);_0x5d01f6[_0x6578('0x1e')]=qs['offset'](_0x19476d['query']['offset']);}_0x5d01f6[_0x6578('0x37')]=qs[_0x6578('0x38')](_0x19476d[_0x6578('0x2f')][_0x6578('0x38')]);_0x5d01f6[_0x6578('0x39')]=qs[_0x6578('0x31')](_['pick'](_0x19476d[_0x6578('0x2f')],_0x171bbe[_0x6578('0x31')]),_0x391a79);if(_0x19476d[_0x6578('0x2f')]['filter']){_0x5d01f6[_0x6578('0x39')]=_[_0x6578('0x3a')](_0x5d01f6[_0x6578('0x39')],{'$or':_[_0x6578('0x2a')](_0x391a79,function(_0x1bda81){if(_0x1bda81[_0x6578('0x3b')]!==_0x6578('0x3c')){var _0x2e33ce={};_0x2e33ce[_0x1bda81['name']]={'$like':'%'+_0x19476d[_0x6578('0x2f')][_0x6578('0x3d')]+'%'};return _0x2e33ce;}})});}_0x5d01f6=_[_0x6578('0x3a')]({},_0x5d01f6,_0x19476d[_0x6578('0x3e')]);var _0x57f503={'where':_0x5d01f6['where']};return db[_0x6578('0x2b')][_0x6578('0x21')](_0x57f503)[_0x6578('0x3f')](function(_0x275475){_0x578f72[_0x6578('0x21')]=_0x275475;if(_0x19476d[_0x6578('0x2f')][_0x6578('0x40')]){_0x5d01f6[_0x6578('0x41')]=[{'all':!![]}];}return db['Automation'][_0x6578('0x42')](_0x5d01f6);})[_0x6578('0x3f')](function(_0x115cfe){_0x578f72['rows']=_0x115cfe;return _0x578f72;})[_0x6578('0x3f')](respondWithFilteredResult(_0x39ba27,_0x5d01f6))['catch'](handleError(_0x39ba27,null));};exports['show']=function(_0x32b047,_0xb01367){var _0x205cb7={'raw':![],'where':{'id':_0x32b047['params']['id']}},_0x51ab7f={};_0x51ab7f['model']=_[_0x6578('0x30')](db[_0x6578('0x2b')][_0x6578('0x43')]);_0x51ab7f[_0x6578('0x2f')]=_['keys'](_0x32b047[_0x6578('0x2f')]);_0x51ab7f[_0x6578('0x31')]=_['intersection'](_0x51ab7f[_0x6578('0x2d')],_0x51ab7f['query']);_0x205cb7[_0x6578('0x33')]=_[_0x6578('0x32')](_0x51ab7f['model'],qs[_0x6578('0x34')](_0x32b047['query'][_0x6578('0x34')]));_0x205cb7[_0x6578('0x33')]=_0x205cb7[_0x6578('0x33')][_0x6578('0x35')]?_0x205cb7[_0x6578('0x33')]:_0x51ab7f[_0x6578('0x2d')];if(_0x32b047[_0x6578('0x2f')]['includeAll']){_0x205cb7[_0x6578('0x41')]=[{'all':!![]}];}_0x205cb7=_['merge']({},_0x205cb7,_0x32b047[_0x6578('0x3e')]);return db['Automation'][_0x6578('0x44')](_0x205cb7)[_0x6578('0x3f')](handleEntityNotFound(_0xb01367,null))[_0x6578('0x3f')](respondWithResult(_0xb01367,null))[_0x6578('0x45')](handleError(_0xb01367,null));};exports['create']=function(_0x5a1880,_0x91f894){return db[_0x6578('0x2b')][_0x6578('0x46')](_0x5a1880[_0x6578('0x47')],{})[_0x6578('0x3f')](respondWithResult(_0x91f894,0xc9))['catch'](handleError(_0x91f894,null));};exports['update']=function(_0xac7011,_0x563aec){if(_0xac7011[_0x6578('0x47')]['id']){delete _0xac7011[_0x6578('0x47')]['id'];}return db[_0x6578('0x2b')]['find']({'where':{'id':_0xac7011[_0x6578('0x48')]['id']}})['then'](handleEntityNotFound(_0x563aec,null))[_0x6578('0x3f')](saveUpdates(_0xac7011['body'],null))[_0x6578('0x3f')](respondWithResult(_0x563aec,null))['catch'](handleError(_0x563aec,null));};exports[_0x6578('0x27')]=function(_0x4f7c53,_0x37366b){return db[_0x6578('0x2b')][_0x6578('0x44')]({'where':{'id':_0x4f7c53[_0x6578('0x48')]['id']}})[_0x6578('0x3f')](handleEntityNotFound(_0x37366b,null))[_0x6578('0x3f')](removeEntity(_0x37366b,null))['catch'](handleError(_0x37366b,null));};exports[_0x6578('0x49')]=function(_0x282d89,_0x489a5b,_0x13464b){return db['Condition'][_0x6578('0x44')]({'where':{'id':_0x282d89[_0x6578('0x48')]['id']}})['then'](handleEntityNotFound(_0x489a5b,null))[_0x6578('0x3f')](function(_0x3bc2c0){if(_0x3bc2c0){return _0x3bc2c0[_0x6578('0x49')](_0x282d89[_0x6578('0x47')][_0x6578('0x4a')],_[_0x6578('0x4b')](_0x282d89[_0x6578('0x47')],[_0x6578('0x4a'),'id'])||{});}})[_0x6578('0x3f')](respondWithResult(_0x489a5b,null))[_0x6578('0x45')](handleError(_0x489a5b,null));};exports['getConditions']=function(_0x15bc20,_0x45a54d,_0x38fe81){var _0xd534ea={};var _0xfa66ca={};var _0x1e2858;var _0x1e5407;return db[_0x6578('0x2b')][_0x6578('0x4c')]({'where':{'id':_0x15bc20['params']['id']}})['then'](handleEntityNotFound(_0x45a54d,null))[_0x6578('0x3f')](function(_0x44c4db){if(_0x44c4db){_0x1e2858=_0x44c4db;_0xfa66ca[_0x6578('0x2d')]=_['keys'](db['Condition']['rawAttributes']);_0xfa66ca['query']=_[_0x6578('0x30')](_0x15bc20[_0x6578('0x2f')]);_0xfa66ca['filters']=_[_0x6578('0x32')](_0xfa66ca[_0x6578('0x2d')],_0xfa66ca[_0x6578('0x2f')]);_0xd534ea[_0x6578('0x33')]=_[_0x6578('0x32')](_0xfa66ca[_0x6578('0x2d')],qs[_0x6578('0x34')](_0x15bc20[_0x6578('0x2f')]['fields']));_0xd534ea[_0x6578('0x33')]=_0xd534ea[_0x6578('0x33')][_0x6578('0x35')]?_0xd534ea[_0x6578('0x33')]:_0xfa66ca[_0x6578('0x2d')];_0xd534ea[_0x6578('0x37')]=qs[_0x6578('0x38')](_0x15bc20[_0x6578('0x2f')][_0x6578('0x38')]);_0xd534ea[_0x6578('0x39')]=qs['filters'](_[_0x6578('0x4d')](_0x15bc20['query'],_0xfa66ca[_0x6578('0x31')]));if(_0x15bc20[_0x6578('0x2f')][_0x6578('0x3d')]){_0xd534ea[_0x6578('0x39')]=_['merge'](_0xd534ea[_0x6578('0x39')],{'$or':_['map'](_0xd534ea['attributes'],function(_0x28fae5){var _0x4f24ee={};_0x4f24ee[_0x28fae5]={'$like':'%'+_0x15bc20[_0x6578('0x2f')][_0x6578('0x3d')]+'%'};return _0x4f24ee;})});}_0xd534ea=_[_0x6578('0x3a')]({},_0xd534ea,_0x15bc20[_0x6578('0x3e')]);return _0x1e2858['getConditions'](_0xd534ea);}})[_0x6578('0x3f')](function(_0x1d5e86){if(_0x1d5e86){_0x1e5407=_0x1d5e86[_0x6578('0x35')];if(!_0x15bc20['query'][_0x6578('0x4e')](_0x6578('0x36'))){_0xd534ea[_0x6578('0x20')]=qs['limit'](_0x15bc20[_0x6578('0x2f')][_0x6578('0x20')]);_0xd534ea[_0x6578('0x1e')]=qs[_0x6578('0x1e')](_0x15bc20[_0x6578('0x2f')]['offset']);}return _0x1e2858[_0x6578('0x4f')](_0xd534ea);}})[_0x6578('0x3f')](function(_0x3531a7){if(_0x3531a7){return _0x3531a7?{'count':_0x1e5407,'rows':_0x3531a7}:null;}})[_0x6578('0x3f')](respondWithResult(_0x45a54d,null))['catch'](handleError(_0x45a54d,null));};exports[_0x6578('0x50')]=function(_0x214912,_0x2fcf3a,_0x22f377){return db['Action'][_0x6578('0x44')]({'where':{'id':_0x214912[_0x6578('0x48')]['id']}})['then'](handleEntityNotFound(_0x2fcf3a,null))['then'](function(_0xe28d21){if(_0xe28d21){return _0xe28d21[_0x6578('0x50')](_0x214912[_0x6578('0x47')]['ids'],_[_0x6578('0x4b')](_0x214912[_0x6578('0x47')],[_0x6578('0x4a'),'id'])||{});}})[_0x6578('0x3f')](respondWithResult(_0x2fcf3a,null))['catch'](handleError(_0x2fcf3a,null));};exports['getActions']=function(_0x48de29,_0x3e62ae,_0xdc752b){var _0x3ae8d1={};var _0x5aa73a={};var _0x4c6e08;var _0x860c05;return db[_0x6578('0x2b')][_0x6578('0x4c')]({'where':{'id':_0x48de29[_0x6578('0x48')]['id']}})[_0x6578('0x3f')](handleEntityNotFound(_0x3e62ae,null))[_0x6578('0x3f')](function(_0x13578b){if(_0x13578b){_0x4c6e08=_0x13578b;_0x5aa73a[_0x6578('0x2d')]=_['keys'](db['Action'][_0x6578('0x43')]);_0x5aa73a[_0x6578('0x2f')]=_[_0x6578('0x30')](_0x48de29[_0x6578('0x2f')]);_0x5aa73a[_0x6578('0x31')]=_[_0x6578('0x32')](_0x5aa73a['model'],_0x5aa73a[_0x6578('0x2f')]);_0x3ae8d1[_0x6578('0x33')]=_[_0x6578('0x32')](_0x5aa73a['model'],qs[_0x6578('0x34')](_0x48de29[_0x6578('0x2f')][_0x6578('0x34')]));_0x3ae8d1['attributes']=_0x3ae8d1[_0x6578('0x33')][_0x6578('0x35')]?_0x3ae8d1[_0x6578('0x33')]:_0x5aa73a[_0x6578('0x2d')];_0x3ae8d1[_0x6578('0x37')]=qs['sort'](_0x48de29[_0x6578('0x2f')]['sort']);_0x3ae8d1['where']=qs[_0x6578('0x31')](_[_0x6578('0x4d')](_0x48de29[_0x6578('0x2f')],_0x5aa73a[_0x6578('0x31')]));if(_0x48de29['query'][_0x6578('0x3d')]){_0x3ae8d1[_0x6578('0x39')]=_[_0x6578('0x3a')](_0x3ae8d1['where'],{'$or':_[_0x6578('0x2a')](_0x3ae8d1[_0x6578('0x33')],function(_0x39e4b0){var _0x4b17e2={};_0x4b17e2[_0x39e4b0]={'$like':'%'+_0x48de29[_0x6578('0x2f')][_0x6578('0x3d')]+'%'};return _0x4b17e2;})});}_0x3ae8d1=_[_0x6578('0x3a')]({},_0x3ae8d1,_0x48de29[_0x6578('0x3e')]);return _0x4c6e08['getActions'](_0x3ae8d1);}})[_0x6578('0x3f')](function(_0x47b902){if(_0x47b902){_0x860c05=_0x47b902[_0x6578('0x35')];if(!_0x48de29['query']['hasOwnProperty'](_0x6578('0x36'))){_0x3ae8d1[_0x6578('0x20')]=qs[_0x6578('0x20')](_0x48de29[_0x6578('0x2f')]['limit']);_0x3ae8d1[_0x6578('0x1e')]=qs[_0x6578('0x1e')](_0x48de29['query']['offset']);}return _0x4c6e08[_0x6578('0x51')](_0x3ae8d1);}})[_0x6578('0x3f')](function(_0xc68ad1){if(_0xc68ad1){return _0xc68ad1?{'count':_0x860c05,'rows':_0xc68ad1}:null;}})['then'](respondWithResult(_0x3e62ae,null))[_0x6578('0x45')](handleError(_0x3e62ae,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 2021ea8..16bfc34 100644 --- a/server/api/automation/automation.model.js +++ b/server/api/automation/automation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16db=['rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','moment','bluebird','request-promise','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x16db,0xde));var _0xb16d=function(_0x47daa1,_0x456720){_0x47daa1=_0x47daa1-0x0;var _0xf6c149=_0x16db[_0x47daa1];return _0xf6c149;};'use strict';var _=require(_0xb16d('0x0'));var util=require(_0xb16d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb16d('0x2'));var BPromise=require(_0xb16d('0x3'));var rp=require(_0xb16d('0x4'));var fs=require('fs');var path=require(_0xb16d('0x5'));var rimraf=require(_0xb16d('0x6'));var config=require('../../config/environment');var attributes=require(_0xb16d('0x7'));module[_0xb16d('0x8')]=function(_0x3b78fe,_0x27d5c2){return _0x3b78fe[_0xb16d('0x9')](_0xb16d('0xa'),attributes,{'tableName':_0xb16d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb97=['exports','define','Automation','tools_automations','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x1d9dfa,_0x30598d){var _0x252661=function(_0x4bcc24){while(--_0x4bcc24){_0x1d9dfa['push'](_0x1d9dfa['shift']());}};_0x252661(++_0x30598d);}(_0xcb97,0x70));var _0x7cb9=function(_0x2dfb29,_0x388079){_0x2dfb29=_0x2dfb29-0x0;var _0x224c04=_0xcb97[_0x2dfb29];return _0x224c04;};'use strict';var _=require('lodash');var util=require(_0x7cb9('0x0'));var logger=require('../../config/logger')(_0x7cb9('0x1'));var moment=require('moment');var BPromise=require(_0x7cb9('0x2'));var rp=require(_0x7cb9('0x3'));var fs=require('fs');var path=require(_0x7cb9('0x4'));var rimraf=require(_0x7cb9('0x5'));var config=require(_0x7cb9('0x6'));var attributes=require(_0x7cb9('0x7'));module[_0x7cb9('0x8')]=function(_0x1d0a85,_0x3d6611){return _0x1d0a85[_0x7cb9('0x9')](_0x7cb9('0xa'),attributes,{'tableName':_0x7cb9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 239d88c..d46d7aa 100644 --- a/server/api/automation/automation.rpc.js +++ b/server/api/automation/automation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf894=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','error','message','result'];(function(_0x3f561c,_0xa4231d){var _0x34fcd2=function(_0x52d566){while(--_0x52d566){_0x3f561c['push'](_0x3f561c['shift']());}};_0x34fcd2(++_0xa4231d);}(_0xf894,0xfd));var _0x4f89=function(_0x149ad0,_0x4fc42d){_0x149ad0=_0x149ad0-0x0;var _0x4c3c8e=_0xf894[_0x149ad0];return _0x4c3c8e;};'use strict';var _=require(_0x4f89('0x0'));var util=require(_0x4f89('0x1'));var moment=require(_0x4f89('0x2'));var BPromise=require(_0x4f89('0x3'));var rs=require(_0x4f89('0x4'));var fs=require('fs');var Redis=require(_0x4f89('0x5'));var db=require(_0x4f89('0x6'))['db'];var utils=require(_0x4f89('0x7'));var logger=require(_0x4f89('0x8'))(_0x4f89('0x9'));var config=require(_0x4f89('0xa'));var jayson=require(_0x4f89('0xb'));var client=jayson[_0x4f89('0xc')][_0x4f89('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x324870,_0x33920a,_0x39b492){return new BPromise(function(_0x188d3f,_0x5cb3a5){return client[_0x4f89('0xe')](_0x324870,_0x39b492)[_0x4f89('0xf')](function(_0x2eb8fe){logger[_0x4f89('0x10')](_0x4f89('0x11'),_0x33920a,_0x4f89('0x12'));logger[_0x4f89('0x13')]('Automation,\x20%s,\x20%s,\x20%s',_0x33920a,'request\x20sent',JSON['stringify'](_0x2eb8fe));if(_0x2eb8fe[_0x4f89('0x14')]){if(_0x2eb8fe[_0x4f89('0x14')]['code']===0x1f4){logger[_0x4f89('0x14')](_0x4f89('0x11'),_0x33920a,_0x2eb8fe[_0x4f89('0x14')][_0x4f89('0x15')]);return _0x5cb3a5(_0x2eb8fe[_0x4f89('0x14')][_0x4f89('0x15')]);}logger[_0x4f89('0x14')](_0x4f89('0x11'),_0x33920a,_0x2eb8fe[_0x4f89('0x14')]['message']);return _0x188d3f(_0x2eb8fe[_0x4f89('0x14')][_0x4f89('0x15')]);}else{logger[_0x4f89('0x10')](_0x4f89('0x11'),_0x33920a,_0x4f89('0x12'));_0x188d3f(_0x2eb8fe[_0x4f89('0x16')][_0x4f89('0x15')]);}})['catch'](function(_0x9c194){logger['error']('Automation,\x20%s,\x20%s',_0x33920a,_0x9c194);_0x5cb3a5(_0x9c194);});});} \ No newline at end of file +var _0xad9f=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x9e113b,_0x58c6f0){var _0xeee1b0=function(_0x278990){while(--_0x278990){_0x9e113b['push'](_0x9e113b['shift']());}};_0xeee1b0(++_0x58c6f0);}(_0xad9f,0x1be));var _0xfad9=function(_0x37cbe4,_0x5a8821){_0x37cbe4=_0x37cbe4-0x0;var _0x4ec353=_0xad9f[_0x37cbe4];return _0x4ec353;};'use strict';var _=require(_0xfad9('0x0'));var util=require(_0xfad9('0x1'));var moment=require(_0xfad9('0x2'));var BPromise=require('bluebird');var rs=require(_0xfad9('0x3'));var fs=require('fs');var Redis=require(_0xfad9('0x4'));var db=require(_0xfad9('0x5'))['db'];var utils=require(_0xfad9('0x6'));var logger=require('../../config/logger')(_0xfad9('0x7'));var config=require('../../config/environment');var jayson=require(_0xfad9('0x8'));var client=jayson[_0xfad9('0x9')][_0xfad9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaea9ba,_0xbbc4a6,_0x19b6cc){return new BPromise(function(_0x4d46a7,_0x5580be){return client[_0xfad9('0xb')](_0xaea9ba,_0x19b6cc)[_0xfad9('0xc')](function(_0x362047){logger[_0xfad9('0xd')](_0xfad9('0xe'),_0xbbc4a6,_0xfad9('0xf'));logger[_0xfad9('0x10')](_0xfad9('0x11'),_0xbbc4a6,'request\x20sent',JSON[_0xfad9('0x12')](_0x362047));if(_0x362047[_0xfad9('0x13')]){if(_0x362047[_0xfad9('0x13')][_0xfad9('0x14')]===0x1f4){logger[_0xfad9('0x13')](_0xfad9('0xe'),_0xbbc4a6,_0x362047[_0xfad9('0x13')][_0xfad9('0x15')]);return _0x5580be(_0x362047[_0xfad9('0x13')][_0xfad9('0x15')]);}logger[_0xfad9('0x13')]('Automation,\x20%s,\x20%s',_0xbbc4a6,_0x362047[_0xfad9('0x13')][_0xfad9('0x15')]);return _0x4d46a7(_0x362047[_0xfad9('0x13')][_0xfad9('0x15')]);}else{logger[_0xfad9('0xd')](_0xfad9('0xe'),_0xbbc4a6,'request\x20sent');_0x4d46a7(_0x362047[_0xfad9('0x16')]['message']);}})[_0xfad9('0x17')](function(_0x43d2ef){logger['error']('Automation,\x20%s,\x20%s',_0xbbc4a6,_0x43d2ef);_0x5580be(_0x43d2ef);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 4e2aa95..4fafff1 100644 --- a/server/api/automation/index.js +++ b/server/api/automation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca8d=['../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x35b27d,_0x3b7ab2){var _0x4e4e78=function(_0x40aebf){while(--_0x40aebf){_0x35b27d['push'](_0x35b27d['shift']());}};_0x4e4e78(++_0x3b7ab2);}(_0xca8d,0x172));var _0xdca8=function(_0x37b2ce,_0x5a6096){_0x37b2ce=_0x37b2ce-0x0;var _0x18e96a=_0xca8d[_0x37b2ce];return _0x18e96a;};'use strict';var multer=require(_0xdca8('0x0'));var util=require(_0xdca8('0x1'));var path=require(_0xdca8('0x2'));var timeout=require(_0xdca8('0x3'));var express=require(_0xdca8('0x4'));var router=express[_0xdca8('0x5')]();var fs_extra=require(_0xdca8('0x6'));var auth=require(_0xdca8('0x7'));var interaction=require(_0xdca8('0x8'));var config=require(_0xdca8('0x9'));var controller=require(_0xdca8('0xa'));router[_0xdca8('0xb')]('/',auth['isAuthenticated'](),controller[_0xdca8('0xc')]);router[_0xdca8('0xb')](_0xdca8('0xd'),auth[_0xdca8('0xe')](),controller[_0xdca8('0xf')]);router['get'](_0xdca8('0x10'),auth[_0xdca8('0xe')](),controller[_0xdca8('0x11')]);router['get'](_0xdca8('0x12'),auth[_0xdca8('0xe')](),controller[_0xdca8('0x13')]);router[_0xdca8('0x14')]('/',auth[_0xdca8('0xe')](),controller[_0xdca8('0x15')]);router[_0xdca8('0x14')](_0xdca8('0x10'),auth[_0xdca8('0xe')](),controller['addConditions']);router['post'](_0xdca8('0x12'),auth[_0xdca8('0xe')](),controller[_0xdca8('0x16')]);router[_0xdca8('0x17')](_0xdca8('0xd'),auth[_0xdca8('0xe')](),controller[_0xdca8('0x18')]);router[_0xdca8('0x19')](_0xdca8('0xd'),auth[_0xdca8('0xe')](),controller[_0xdca8('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xd58c=['/:id','show','/:id/conditions','getConditions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd58c,0xb6));var _0xcd58=function(_0x2a575c,_0x4282a8){_0x2a575c=_0x2a575c-0x0;var _0x499c9e=_0xd58c[_0x2a575c];return _0x499c9e;};'use strict';var multer=require(_0xcd58('0x0'));var util=require(_0xcd58('0x1'));var path=require(_0xcd58('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd58('0x3'));var router=express['Router']();var fs_extra=require(_0xcd58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd58('0x5'));var config=require(_0xcd58('0x6'));var controller=require(_0xcd58('0x7'));router[_0xcd58('0x8')]('/',auth[_0xcd58('0x9')](),controller['index']);router['get'](_0xcd58('0xa'),auth[_0xcd58('0x9')](),controller[_0xcd58('0xb')]);router[_0xcd58('0x8')](_0xcd58('0xc'),auth['isAuthenticated'](),controller[_0xcd58('0xd')]);router[_0xcd58('0x8')]('/:id/actions',auth[_0xcd58('0x9')](),controller['getActions']);router[_0xcd58('0xe')]('/',auth[_0xcd58('0x9')](),controller[_0xcd58('0xf')]);router['post'](_0xcd58('0xc'),auth['isAuthenticated'](),controller[_0xcd58('0x10')]);router['post'](_0xcd58('0x11'),auth[_0xcd58('0x9')](),controller[_0xcd58('0x12')]);router[_0xcd58('0x13')](_0xcd58('0xa'),auth[_0xcd58('0x9')](),controller[_0xcd58('0x14')]);router[_0xcd58('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xcd58('0x16')]);module[_0xcd58('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index d09a3bf..922ccae 100644 --- a/server/api/campaign/campaign.attributes.js +++ b/server/api/campaign/campaign.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa938=['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)','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x5bce6d,_0x3d3b72){var _0x4ee73c=function(_0x23dc99){while(--_0x23dc99){_0x5bce6d['push'](_0x5bce6d['shift']());}};_0x4ee73c(++_0x3d3b72);}(_0xa938,0x172));var _0x8a93=function(_0xb85f81,_0x3c04e8){_0xb85f81=_0xb85f81-0x0;var _0x42dc47=_0xa938[_0xb85f81];return _0x42dc47;};'use strict';var Sequelize=require(_0x8a93('0x0'));module[_0x8a93('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8a93('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x8a93('0x3')],'defaultValue':0x0,'comment':_0x8a93('0x4')},'limitCalls':{'type':Sequelize[_0x8a93('0x5')](0x4)[_0x8a93('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8a93('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8a93('0x8')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8a93('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a93('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8a93('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8a93('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a93('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x8a93('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a93('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8a93('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a93('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8a93('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x8a93('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8a93('0x5')](0x5)[_0x8a93('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a93('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8a93('0x5')](0x3)[_0x8a93('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8a93('0xf')},'dialTimezone':{'type':Sequelize[_0x8a93('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x8a93('0x10')](_0x8a93('0x11'),'never',_0x8a93('0x12')),'defaultValue':_0x8a93('0x11')},'dialAMDActive':{'type':Sequelize[_0x8a93('0x3')],'defaultValue':0x0,'comment':_0x8a93('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x8a93('0x5')](0x9)[_0x8a93('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8a93('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x8a93('0x5')](0x9)[_0x8a93('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8a93('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8a93('0x5')](0x9)[_0x8a93('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8a93('0x5')](0x9)[_0x8a93('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x8a93('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8a93('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8a93('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8a93('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8a93('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8a93('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8a93('0x5')](0x5)[_0x8a93('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8a93('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8a93('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x8a93('0x1a'),_0x8a93('0x1b')),'defaultValue':_0x8a93('0x1a')},'dialPrefix':{'type':Sequelize[_0x8a93('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8a93('0x1c')},'dialCutDigit':{'type':Sequelize[_0x8a93('0x5')](0x3)[_0x8a93('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8a93('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8a93('0x5')](0x3)[_0x8a93('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a93('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8a93('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x8a93('0x5')](0x3)[_0x8a93('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a93('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x8a93('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a93('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8a93('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a93('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8a93('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a93('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x8a93('0x5')](0x3)[_0x8a93('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a93('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8a93('0x5')](0x5)[_0x8a93('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a93('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8a93('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a93('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8a93('0x5')](0x5)[_0x8a93('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x1278=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x32d414,_0x4d23da){var _0x4e0bca=function(_0x15d397){while(--_0x15d397){_0x32d414['push'](_0x32d414['shift']());}};_0x4e0bca(++_0x4d23da);}(_0x1278,0xbe));var _0x8127=function(_0x561098,_0xdd1933){_0x561098=_0x561098-0x0;var _0x42701a=_0x1278[_0x561098];return _0x42701a;};'use strict';var Sequelize=require(_0x8127('0x0'));module[_0x8127('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8127('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8127('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x8127('0x4')},'description':{'type':Sequelize[_0x8127('0x5')]},'active':{'type':Sequelize[_0x8127('0x6')],'defaultValue':0x0,'comment':_0x8127('0x7')},'limitCalls':{'type':Sequelize[_0x8127('0x8')](0x4)[_0x8127('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8127('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x3,'comment':_0x8127('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8127('0x11')},'dialTimezone':{'type':Sequelize[_0x8127('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8127('0x5')],'defaultValue':_0x8127('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x8127('0x3')](_0x8127('0x13'),_0x8127('0x14'),_0x8127('0x15')),'defaultValue':_0x8127('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8127('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0x8127('0x8')](0x9)[_0x8127('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x8127('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8127('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8127('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8127('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8127('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8127('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x8127('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8127('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8127('0x8')](0x9)[_0x8127('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8127('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8127('0x8')](0x9)[_0x8127('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8127('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8127('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8127('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x8127('0x3')](_0x8127('0x1e'),_0x8127('0x1f')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x8127('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8127('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0x22')},'dialDropMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0x23')},'dialDropRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0x25')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0x28')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 3cf6d7b..c9692b5 100644 --- a/server/api/campaign/campaign.controller.js +++ b/server/api/campaign/campaign.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10b8=['findOne','CampaignId','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','scheduledAt','select','field','phone','NOW()','ContactId','ListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','cm_contacts','phone\x20NOT\x20IN\x20(?)','cmHopperId','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','options','Campaign','includeAll','include','show','params','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','merge','omit','createdAt','updatedAt','body','getHoppers'];(function(_0x5823a7,_0x3cc2d7){var _0x4f1d86=function(_0x26ff02){while(--_0x26ff02){_0x5823a7['push'](_0x5823a7['shift']());}};_0x4f1d86(++_0x3cc2d7);}(_0x10b8,0x166));var _0x810b=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x10b8[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0x810b('0x0'));var rimraf=require(_0x810b('0x1'));var zipdir=require(_0x810b('0x2'));var jsonpatch=require(_0x810b('0x3'));var rp=require(_0x810b('0x4'));var moment=require(_0x810b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x810b('0x6'));var util=require(_0x810b('0x7'));var path=require(_0x810b('0x8'));var sox=require('sox');var csv=require(_0x810b('0x9'));var ejs=require(_0x810b('0xa'));var fs=require('fs');var fs_extra=require(_0x810b('0xb'));var _=require(_0x810b('0xc'));var squel=require(_0x810b('0xd'));var crypto=require(_0x810b('0xe'));var jsforce=require(_0x810b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x810b('0x9'));var querystring=require('querystring');var Papa=require(_0x810b('0x10'));var Redis=require(_0x810b('0x11'));var authService=require(_0x810b('0x12'));var qs=require(_0x810b('0x13'));var as=require(_0x810b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x810b('0x15'))(_0x810b('0x16'));var utils=require(_0x810b('0x17'));var config=require(_0x810b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x810b('0x19'))['db'];function respondWithStatusCode(_0x1cc57d,_0x24bb1d){_0x24bb1d=_0x24bb1d||0xcc;return function(_0x2069a9){if(_0x2069a9){return _0x1cc57d[_0x810b('0x1a')](_0x24bb1d);}return _0x1cc57d[_0x810b('0x1b')](_0x24bb1d)[_0x810b('0x1c')]();};}function respondWithResult(_0xcdb5c2,_0x26209b){_0x26209b=_0x26209b||0xc8;return function(_0x3e3e52){if(_0x3e3e52){return _0xcdb5c2['status'](_0x26209b)['json'](_0x3e3e52);}};}function respondWithFilteredResult(_0x249f8a,_0xbbc69b){return function(_0x1f2d52){if(_0x1f2d52){var _0xea1d2a=typeof _0xbbc69b[_0x810b('0x1d')]===_0x810b('0x1e')&&typeof _0xbbc69b[_0x810b('0x1f')]===_0x810b('0x1e');var _0x43f099=_0x1f2d52[_0x810b('0x20')];var _0x4a31a6=_0xea1d2a?0x0:_0xbbc69b[_0x810b('0x1d')];var _0x540741=_0xea1d2a?_0x1f2d52[_0x810b('0x20')]:_0xbbc69b[_0x810b('0x1d')]+_0xbbc69b[_0x810b('0x1f')];var _0x55ea1c;if(_0x540741>=_0x43f099){_0x540741=_0x43f099;_0x55ea1c=0xc8;}else{_0x55ea1c=0xce;}_0x249f8a[_0x810b('0x1b')](_0x55ea1c);return _0x249f8a['set'](_0x810b('0x21'),_0x4a31a6+'-'+_0x540741+'/'+_0x43f099)['json'](_0x1f2d52);}return null;};}function patchUpdates(_0x2906df){return function(_0x51b3be){try{jsonpatch[_0x810b('0x22')](_0x51b3be,_0x2906df,!![]);}catch(_0x24e74c){return BPromise[_0x810b('0x23')](_0x24e74c);}return _0x51b3be['save']();};}function saveUpdates(_0x1e3642,_0x483284){return function(_0x121178){if(_0x121178){return _0x121178[_0x810b('0x24')](_0x1e3642)[_0x810b('0x25')](function(_0x4578a5){return _0x4578a5;});}return null;};}function removeEntity(_0x4fdf04,_0x6196a7){return function(_0x525277){if(_0x525277){return _0x525277[_0x810b('0x26')]()[_0x810b('0x25')](function(){var _0x37bed2=_0x525277[_0x810b('0x27')]({'plain':!![]});var _0x4fbde7=_0x810b('0x28');return db['UserProfileResource'][_0x810b('0x26')]({'where':{'type':_0x4fbde7,'resourceId':_0x37bed2['id']}})[_0x810b('0x25')](function(){return _0x525277;});})[_0x810b('0x25')](function(){_0x4fdf04['status'](0xcc)[_0x810b('0x1c')]();});}};}function handleEntityNotFound(_0x817fd6,_0x430a8e){return function(_0x2e03a1){if(!_0x2e03a1){_0x817fd6[_0x810b('0x1a')](0x194);}return _0x2e03a1;};}function handleError(_0x31d5a7,_0x4f1770){_0x4f1770=_0x4f1770||0x1f4;return function(_0x4eb0f3){logger[_0x810b('0x29')](_0x4eb0f3[_0x810b('0x2a')]);if(_0x4eb0f3[_0x810b('0x2b')]){delete _0x4eb0f3['name'];}_0x31d5a7[_0x810b('0x1b')](_0x4f1770)['send'](_0x4eb0f3);};}exports[_0x810b('0x2c')]=function(_0xa52aa8,_0x387221){var _0x34f72c={},_0x83448b={},_0x212a4b={'count':0x0,'rows':[]};var _0x57d0bc=_[_0x810b('0x2d')](db['Campaign'][_0x810b('0x2e')],function(_0x46582e){return{'name':_0x46582e[_0x810b('0x2f')],'type':_0x46582e['type'][_0x810b('0x30')]};});_0x83448b[_0x810b('0x31')]=_['map'](_0x57d0bc,_0x810b('0x2b'));_0x83448b[_0x810b('0x32')]=_[_0x810b('0x33')](_0xa52aa8['query']);_0x83448b[_0x810b('0x34')]=_[_0x810b('0x35')](_0x83448b[_0x810b('0x31')],_0x83448b['query']);_0x34f72c[_0x810b('0x36')]=_['intersection'](_0x83448b[_0x810b('0x31')],qs['fields'](_0xa52aa8[_0x810b('0x32')][_0x810b('0x37')]));_0x34f72c[_0x810b('0x36')]=_0x34f72c['attributes'][_0x810b('0x38')]?_0x34f72c[_0x810b('0x36')]:_0x83448b[_0x810b('0x31')];if(!_0xa52aa8[_0x810b('0x32')][_0x810b('0x39')](_0x810b('0x3a'))){_0x34f72c[_0x810b('0x1f')]=qs[_0x810b('0x1f')](_0xa52aa8['query'][_0x810b('0x1f')]);_0x34f72c[_0x810b('0x1d')]=qs[_0x810b('0x1d')](_0xa52aa8[_0x810b('0x32')]['offset']);}_0x34f72c[_0x810b('0x3b')]=qs[_0x810b('0x3c')](_0xa52aa8[_0x810b('0x32')][_0x810b('0x3c')]);_0x34f72c[_0x810b('0x3d')]=qs[_0x810b('0x34')](_['pick'](_0xa52aa8[_0x810b('0x32')],_0x83448b[_0x810b('0x34')]),_0x57d0bc);if(_0xa52aa8[_0x810b('0x32')][_0x810b('0x3e')]){_0x34f72c[_0x810b('0x3d')]=_['merge'](_0x34f72c['where'],{'$or':_[_0x810b('0x2d')](_0x57d0bc,function(_0x575dbb){if(_0x575dbb[_0x810b('0x3f')]!==_0x810b('0x40')){var _0x39fa08={};_0x39fa08[_0x575dbb[_0x810b('0x2b')]]={'$like':'%'+_0xa52aa8['query'][_0x810b('0x3e')]+'%'};return _0x39fa08;}})});}_0x34f72c=_['merge']({},_0x34f72c,_0xa52aa8[_0x810b('0x41')]);var _0x3cb4db={'where':_0x34f72c[_0x810b('0x3d')]};return db[_0x810b('0x42')][_0x810b('0x20')](_0x3cb4db)[_0x810b('0x25')](function(_0x6fc7f4){_0x212a4b[_0x810b('0x20')]=_0x6fc7f4;if(_0xa52aa8['query'][_0x810b('0x43')]){_0x34f72c[_0x810b('0x44')]=[{'all':!![]}];}return db[_0x810b('0x42')]['findAll'](_0x34f72c);})[_0x810b('0x25')](function(_0x284260){_0x212a4b['rows']=_0x284260;return _0x212a4b;})[_0x810b('0x25')](respondWithFilteredResult(_0x387221,_0x34f72c))['catch'](handleError(_0x387221,null));};exports[_0x810b('0x45')]=function(_0x3a55ea,_0x249b52){var _0x3666ea={'raw':![],'where':{'id':_0x3a55ea[_0x810b('0x46')]['id']}},_0x39620a={};_0x39620a[_0x810b('0x31')]=_[_0x810b('0x33')](db[_0x810b('0x42')][_0x810b('0x2e')]);_0x39620a[_0x810b('0x32')]=_[_0x810b('0x33')](_0x3a55ea[_0x810b('0x32')]);_0x39620a['filters']=_[_0x810b('0x35')](_0x39620a['model'],_0x39620a[_0x810b('0x32')]);_0x3666ea[_0x810b('0x36')]=_['intersection'](_0x39620a[_0x810b('0x31')],qs[_0x810b('0x37')](_0x3a55ea[_0x810b('0x32')][_0x810b('0x37')]));_0x3666ea[_0x810b('0x36')]=_0x3666ea[_0x810b('0x36')][_0x810b('0x38')]?_0x3666ea[_0x810b('0x36')]:_0x39620a[_0x810b('0x31')];if(_0x3a55ea['query'][_0x810b('0x43')]){_0x3666ea[_0x810b('0x44')]=[{'all':!![]}];}_0x3666ea=_['merge']({},_0x3666ea,_0x3a55ea[_0x810b('0x41')]);return db[_0x810b('0x42')][_0x810b('0x47')](_0x3666ea)[_0x810b('0x25')](handleEntityNotFound(_0x249b52,null))[_0x810b('0x25')](respondWithResult(_0x249b52,null))[_0x810b('0x48')](handleError(_0x249b52,null));};exports[_0x810b('0x49')]=function(_0x427d91,_0x32db35){return db[_0x810b('0x42')][_0x810b('0x49')](_0x427d91['body'],{})['then'](function(_0x12e481){var _0x5521d2=_0x427d91['user']['get']({'plain':!![]});if(!_0x5521d2)throw new Error(_0x810b('0x4a'));if(_0x5521d2[_0x810b('0x4b')]===_0x810b('0x4c')){var _0xae2e2a=_0x12e481[_0x810b('0x27')]({'plain':!![]});var _0x20bd8c='IvrCampaigns';return db[_0x810b('0x4d')][_0x810b('0x47')]({'where':{'name':_0x20bd8c,'userProfileId':_0x5521d2[_0x810b('0x4e')]},'raw':!![]})[_0x810b('0x25')](function(_0x3ee837){if(_0x3ee837&&_0x3ee837[_0x810b('0x4f')]===0x0){return db[_0x810b('0x50')]['create']({'name':_0xae2e2a[_0x810b('0x2b')],'resourceId':_0xae2e2a['id'],'type':_0x3ee837[_0x810b('0x2b')],'sectionId':_0x3ee837['id']},{})[_0x810b('0x25')](function(){return _0x12e481;});}else{return _0x12e481;}})[_0x810b('0x48')](function(_0x4903ac){logger['error'](_0x810b('0x51'),_0x4903ac);throw _0x4903ac;});}return _0x12e481;})['then'](respondWithResult(_0x32db35,0xc9))[_0x810b('0x48')](handleError(_0x32db35,null));};exports[_0x810b('0x52')]=function(_0x1dbc6a,_0x1d7eab){var _0x1c3a0={'where':{'id':_0x1dbc6a[_0x810b('0x46')]['id']}},_0x160d33={};_0x160d33[_0x810b('0x31')]=_[_0x810b('0x33')](db[_0x810b('0x42')][_0x810b('0x2e')]);_0x1c3a0[_0x810b('0x36')]=_[_0x810b('0x35')](_0x160d33[_0x810b('0x31')],qs[_0x810b('0x37')](_0x1dbc6a[_0x810b('0x32')][_0x810b('0x37')]));_0x1c3a0['attributes']=_0x1c3a0[_0x810b('0x36')][_0x810b('0x38')]?_0x1c3a0['attributes']:_0x160d33[_0x810b('0x31')];if(_0x1dbc6a['query']['includeAll']){_0x1c3a0[_0x810b('0x44')]=[{'all':!![]}];}_0x1c3a0=_[_0x810b('0x53')]({},_0x1c3a0,_0x1dbc6a[_0x810b('0x41')]);return db['Campaign'][_0x810b('0x47')](_0x1c3a0)[_0x810b('0x25')](handleEntityNotFound(_0x1d7eab,null))[_0x810b('0x25')](function(_0x5085c8){if(_0x5085c8){var _0x4d5d62=_0x5085c8['get']({'plain':!![]});_0x4d5d62=qs[_0x810b('0x54')](_0x4d5d62,['id',_0x810b('0x55'),_0x810b('0x56')]);_0x1dbc6a['body']=_[_0x810b('0x54')](_0x1dbc6a[_0x810b('0x57')],['id',_0x810b('0x55'),_0x810b('0x56')]);return db[_0x810b('0x42')]['create'](_[_0x810b('0x53')](_0x4d5d62,_0x1dbc6a['body']),{'include':_0x1dbc6a[_0x810b('0x32')][_0x810b('0x43')]?[{'all':!![]}]:undefined})[_0x810b('0x25')](function(_0x773a2c){var _0x240cd6=_0x1dbc6a[_0x810b('0x4c')][_0x810b('0x27')]({'plain':!![]});if(!_0x240cd6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x240cd6['role']===_0x810b('0x4c')){var _0xca30dd=_0x773a2c[_0x810b('0x27')]({'plain':!![]});var _0x27354e='IvrCampaigns';return db[_0x810b('0x4d')][_0x810b('0x47')]({'where':{'name':_0x27354e,'userProfileId':_0x240cd6[_0x810b('0x4e')]},'raw':!![]})['then'](function(_0x5be051){if(_0x5be051&&_0x5be051[_0x810b('0x4f')]===0x0){return db[_0x810b('0x50')][_0x810b('0x49')]({'name':_0xca30dd['name'],'resourceId':_0xca30dd['id'],'type':_0x5be051[_0x810b('0x2b')],'sectionId':_0x5be051['id']},{})['then'](function(){return _0x773a2c;});}else{return _0x773a2c;}})[_0x810b('0x48')](function(_0x2b6f80){logger[_0x810b('0x29')](_0x810b('0x51'),_0x2b6f80);throw _0x2b6f80;});}return _0x773a2c;});}})[_0x810b('0x25')](respondWithResult(_0x1d7eab,0xc9))[_0x810b('0x48')](handleError(_0x1d7eab,null));};exports['update']=function(_0x778105,_0x27963e){if(_0x778105[_0x810b('0x57')]['id']){delete _0x778105[_0x810b('0x57')]['id'];}return db[_0x810b('0x42')][_0x810b('0x47')]({'where':{'id':_0x778105[_0x810b('0x46')]['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x27963e,null))[_0x810b('0x25')](saveUpdates(_0x778105[_0x810b('0x57')],null))['then'](respondWithResult(_0x27963e,null))[_0x810b('0x48')](handleError(_0x27963e,null));};exports[_0x810b('0x26')]=function(_0x232957,_0x1a8865){return db[_0x810b('0x42')][_0x810b('0x47')]({'where':{'id':_0x232957['params']['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x1a8865,null))[_0x810b('0x25')](removeEntity(_0x1a8865,null))[_0x810b('0x48')](handleError(_0x1a8865,null));};exports[_0x810b('0x58')]=function(_0x3e5dbb,_0x565797,_0x1fccf1){var _0x593321={'raw':!![],'where':{}};var _0x2efc1d={};var _0x1f1355={'count':0x0,'rows':[]};return db['Campaign'][_0x810b('0x59')]({'where':{'id':_0x3e5dbb[_0x810b('0x46')]['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x565797,null))[_0x810b('0x25')](function(_0xae4433){if(_0xae4433){_0x2efc1d[_0x810b('0x31')]=_[_0x810b('0x33')](db['CmHopper'][_0x810b('0x2e')]);_0x2efc1d[_0x810b('0x32')]=_[_0x810b('0x33')](_0x3e5dbb[_0x810b('0x32')]);_0x2efc1d[_0x810b('0x34')]=_[_0x810b('0x35')](_0x2efc1d['model'],_0x2efc1d[_0x810b('0x32')]);_0x593321[_0x810b('0x36')]=_['intersection'](_0x2efc1d['model'],qs[_0x810b('0x37')](_0x3e5dbb[_0x810b('0x32')]['fields']));_0x593321[_0x810b('0x36')]=_0x593321[_0x810b('0x36')][_0x810b('0x38')]?_0x593321['attributes']:_0x2efc1d['model'];if(!_0x3e5dbb[_0x810b('0x32')][_0x810b('0x39')](_0x810b('0x3a'))){_0x593321[_0x810b('0x1f')]=qs[_0x810b('0x1f')](_0x3e5dbb['query']['limit']);_0x593321['offset']=qs[_0x810b('0x1d')](_0x3e5dbb[_0x810b('0x32')][_0x810b('0x1d')]);}_0x593321[_0x810b('0x3b')]=qs[_0x810b('0x3c')](_0x3e5dbb[_0x810b('0x32')][_0x810b('0x3c')]);_0x593321[_0x810b('0x3d')]=qs[_0x810b('0x34')](_['pick'](_0x3e5dbb[_0x810b('0x32')],_0x2efc1d[_0x810b('0x34')]));_0x593321['where'][_0x810b('0x5a')]=_0xae4433['id'];if(_0x3e5dbb[_0x810b('0x32')][_0x810b('0x3e')]){_0x593321['where']=_[_0x810b('0x53')](_0x593321['where'],{'$or':_['map'](_0x593321[_0x810b('0x36')],function(_0x2d7a78){var _0x3b4ca7={};_0x3b4ca7[_0x2d7a78]={'$like':'%'+_0x3e5dbb['query'][_0x810b('0x3e')]+'%'};return _0x3b4ca7;})});}_0x593321=_[_0x810b('0x53')]({},_0x593321,_0x3e5dbb[_0x810b('0x41')]);return db[_0x810b('0x5b')][_0x810b('0x20')]({'where':_0x593321[_0x810b('0x3d')]})['then'](function(_0x5bc605){_0x1f1355[_0x810b('0x20')]=_0x5bc605;if(_0x3e5dbb[_0x810b('0x32')][_0x810b('0x43')]){_0x593321[_0x810b('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x810b('0x5c')](_0x593321);})[_0x810b('0x25')](function(_0xd47ffe){_0x1f1355[_0x810b('0x5d')]=_0xd47ffe;return _0x1f1355;});}})[_0x810b('0x25')](respondWithFilteredResult(_0x565797,_0x593321))[_0x810b('0x48')](handleError(_0x565797,null));};exports[_0x810b('0x5e')]=function(_0x316ed4,_0x5a6594,_0x192cc1){var _0x1d9587={'raw':!![],'where':{}};var _0x4eb51f={};var _0x271545={'count':0x0,'rows':[]};return db[_0x810b('0x42')][_0x810b('0x59')]({'where':{'id':_0x316ed4['params']['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x5a6594,null))[_0x810b('0x25')](function(_0x889321){if(_0x889321){_0x4eb51f[_0x810b('0x31')]=_[_0x810b('0x33')](db[_0x810b('0x5f')][_0x810b('0x2e')]);_0x4eb51f[_0x810b('0x32')]=_[_0x810b('0x33')](_0x316ed4[_0x810b('0x32')]);_0x4eb51f['filters']=_[_0x810b('0x35')](_0x4eb51f[_0x810b('0x31')],_0x4eb51f[_0x810b('0x32')]);_0x1d9587['attributes']=_[_0x810b('0x35')](_0x4eb51f[_0x810b('0x31')],qs['fields'](_0x316ed4[_0x810b('0x32')][_0x810b('0x37')]));_0x1d9587[_0x810b('0x36')]=_0x1d9587[_0x810b('0x36')]['length']?_0x1d9587['attributes']:_0x4eb51f[_0x810b('0x31')];if(!_0x316ed4[_0x810b('0x32')][_0x810b('0x39')](_0x810b('0x3a'))){_0x1d9587[_0x810b('0x1f')]=qs[_0x810b('0x1f')](_0x316ed4[_0x810b('0x32')][_0x810b('0x1f')]);_0x1d9587[_0x810b('0x1d')]=qs[_0x810b('0x1d')](_0x316ed4[_0x810b('0x32')][_0x810b('0x1d')]);}_0x1d9587[_0x810b('0x3b')]=qs[_0x810b('0x3c')](_0x316ed4[_0x810b('0x32')][_0x810b('0x3c')]);_0x1d9587['where']=qs[_0x810b('0x34')](_[_0x810b('0x60')](_0x316ed4[_0x810b('0x32')],_0x4eb51f[_0x810b('0x34')]));_0x1d9587['where'][_0x810b('0x5a')]=_0x889321['id'];if(_0x316ed4['query']['filter']){_0x1d9587[_0x810b('0x3d')]=_[_0x810b('0x53')](_0x1d9587[_0x810b('0x3d')],{'$or':_[_0x810b('0x2d')](_0x1d9587['attributes'],function(_0x418803){var _0x54d74b={};_0x54d74b[_0x418803]={'$like':'%'+_0x316ed4[_0x810b('0x32')][_0x810b('0x3e')]+'%'};return _0x54d74b;})});}_0x1d9587=_['merge']({},_0x1d9587,_0x316ed4[_0x810b('0x41')]);return db[_0x810b('0x5f')][_0x810b('0x20')]({'where':_0x1d9587[_0x810b('0x3d')]})['then'](function(_0x17112b){_0x271545[_0x810b('0x20')]=_0x17112b;if(_0x316ed4[_0x810b('0x32')]['includeAll']){_0x1d9587[_0x810b('0x44')]=[{'all':!![]}];}return db[_0x810b('0x5f')]['findAll'](_0x1d9587);})[_0x810b('0x25')](function(_0x2b9274){_0x271545[_0x810b('0x5d')]=_0x2b9274;return _0x271545;});}})[_0x810b('0x25')](respondWithFilteredResult(_0x5a6594,_0x1d9587))['catch'](handleError(_0x5a6594,null));};exports[_0x810b('0x61')]=function(_0x37ff93,_0x3a586f,_0x274dce){var _0x12728c={'raw':!![],'where':{}};var _0x49b89b={};var _0x144f0b={'count':0x0,'rows':[]};return db[_0x810b('0x42')]['findOne']({'where':{'id':_0x37ff93[_0x810b('0x46')]['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x3a586f,null))['then'](function(_0x50c17c){if(_0x50c17c){_0x49b89b[_0x810b('0x31')]=_[_0x810b('0x33')](db[_0x810b('0x62')]['rawAttributes']);_0x49b89b[_0x810b('0x32')]=_['keys'](_0x37ff93[_0x810b('0x32')]);_0x49b89b[_0x810b('0x34')]=_['intersection'](_0x49b89b[_0x810b('0x31')],_0x49b89b[_0x810b('0x32')]);_0x12728c['attributes']=_['intersection'](_0x49b89b[_0x810b('0x31')],qs[_0x810b('0x37')](_0x37ff93[_0x810b('0x32')]['fields']));_0x12728c[_0x810b('0x36')]=_0x12728c[_0x810b('0x36')][_0x810b('0x38')]?_0x12728c[_0x810b('0x36')]:_0x49b89b[_0x810b('0x31')];if(!_0x37ff93[_0x810b('0x32')][_0x810b('0x39')](_0x810b('0x3a'))){_0x12728c[_0x810b('0x1f')]=qs[_0x810b('0x1f')](_0x37ff93[_0x810b('0x32')][_0x810b('0x1f')]);_0x12728c[_0x810b('0x1d')]=qs[_0x810b('0x1d')](_0x37ff93[_0x810b('0x32')]['offset']);}_0x12728c['order']=qs[_0x810b('0x3c')](_0x37ff93['query']['sort']);_0x12728c['where']=qs['filters'](_[_0x810b('0x60')](_0x37ff93[_0x810b('0x32')],_0x49b89b[_0x810b('0x34')]));_0x12728c[_0x810b('0x3d')][_0x810b('0x5a')]=_0x50c17c['id'];if(_0x37ff93['query'][_0x810b('0x3e')]){_0x12728c[_0x810b('0x3d')]=_[_0x810b('0x53')](_0x12728c[_0x810b('0x3d')],{'$or':_['map'](_0x12728c[_0x810b('0x36')],function(_0x518f7a){var _0x54545c={};_0x54545c[_0x518f7a]={'$like':'%'+_0x37ff93[_0x810b('0x32')][_0x810b('0x3e')]+'%'};return _0x54545c;})});}_0x12728c=_['merge']({},_0x12728c,_0x37ff93[_0x810b('0x41')]);return db[_0x810b('0x62')][_0x810b('0x20')]({'where':_0x12728c[_0x810b('0x3d')]})[_0x810b('0x25')](function(_0x20c567){_0x144f0b[_0x810b('0x20')]=_0x20c567;if(_0x37ff93[_0x810b('0x32')]['includeAll']){_0x12728c[_0x810b('0x44')]=[{'all':!![]}];}return db[_0x810b('0x62')]['findAll'](_0x12728c);})[_0x810b('0x25')](function(_0x500789){_0x144f0b[_0x810b('0x5d')]=_0x500789;return _0x144f0b;});}})[_0x810b('0x25')](respondWithFilteredResult(_0x3a586f,_0x12728c))['catch'](handleError(_0x3a586f,null));};exports[_0x810b('0x63')]=function(_0x1fe365,_0x530fe0,_0x3c6135){var _0x34f895={'raw':!![],'where':{}};var _0x5af782={};var _0x552b6c={'count':0x0,'rows':[]};return db['Campaign'][_0x810b('0x59')]({'where':{'id':_0x1fe365[_0x810b('0x46')]['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x530fe0,null))[_0x810b('0x25')](function(_0x376136){if(_0x376136){_0x5af782[_0x810b('0x31')]=_[_0x810b('0x33')](db[_0x810b('0x64')][_0x810b('0x2e')]);_0x5af782[_0x810b('0x32')]=_[_0x810b('0x33')](_0x1fe365[_0x810b('0x32')]);_0x5af782[_0x810b('0x34')]=_[_0x810b('0x35')](_0x5af782['model'],_0x5af782[_0x810b('0x32')]);_0x34f895[_0x810b('0x36')]=_[_0x810b('0x35')](_0x5af782[_0x810b('0x31')],qs[_0x810b('0x37')](_0x1fe365[_0x810b('0x32')][_0x810b('0x37')]));_0x34f895[_0x810b('0x36')]=_0x34f895[_0x810b('0x36')][_0x810b('0x38')]?_0x34f895[_0x810b('0x36')]:_0x5af782[_0x810b('0x31')];if(!_0x1fe365[_0x810b('0x32')][_0x810b('0x39')](_0x810b('0x3a'))){_0x34f895['limit']=qs['limit'](_0x1fe365[_0x810b('0x32')][_0x810b('0x1f')]);_0x34f895[_0x810b('0x1d')]=qs['offset'](_0x1fe365[_0x810b('0x32')][_0x810b('0x1d')]);}_0x34f895[_0x810b('0x3b')]=qs[_0x810b('0x3c')](_0x1fe365[_0x810b('0x32')]['sort']);_0x34f895[_0x810b('0x3d')]=qs['filters'](_[_0x810b('0x60')](_0x1fe365[_0x810b('0x32')],_0x5af782[_0x810b('0x34')]));_0x34f895[_0x810b('0x3d')][_0x810b('0x5a')]=_0x376136['id'];if(_0x1fe365[_0x810b('0x32')][_0x810b('0x3e')]){_0x34f895[_0x810b('0x3d')]=_['merge'](_0x34f895[_0x810b('0x3d')],{'$or':_[_0x810b('0x2d')](_0x34f895[_0x810b('0x36')],function(_0x49b952){var _0xff6dc0={};_0xff6dc0[_0x49b952]={'$like':'%'+_0x1fe365[_0x810b('0x32')][_0x810b('0x3e')]+'%'};return _0xff6dc0;})});}_0x34f895=_[_0x810b('0x53')]({},_0x34f895,_0x1fe365['options']);return db[_0x810b('0x64')][_0x810b('0x20')]({'where':_0x34f895[_0x810b('0x3d')]})[_0x810b('0x25')](function(_0x23a8a5){_0x552b6c[_0x810b('0x20')]=_0x23a8a5;if(_0x1fe365[_0x810b('0x32')][_0x810b('0x43')]){_0x34f895['include']=[{'all':!![]}];}return db[_0x810b('0x64')][_0x810b('0x5c')](_0x34f895);})['then'](function(_0x2bbeab){_0x552b6c[_0x810b('0x5d')]=_0x2bbeab;return _0x552b6c;});}})[_0x810b('0x25')](respondWithFilteredResult(_0x530fe0,_0x34f895))['catch'](handleError(_0x530fe0,null));};exports['getLists']=function(_0x37f3b2,_0x57977b,_0x49ac00){var _0x2e24aa={};var _0xd1a0fb={};var _0x7c5d55;var _0x5c152b;return db[_0x810b('0x42')][_0x810b('0x59')]({'where':{'id':_0x37f3b2[_0x810b('0x46')]['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x57977b,null))[_0x810b('0x25')](function(_0x48b6c0){if(_0x48b6c0){_0x7c5d55=_0x48b6c0;_0xd1a0fb[_0x810b('0x31')]=_[_0x810b('0x33')](db[_0x810b('0x65')][_0x810b('0x2e')]);_0xd1a0fb[_0x810b('0x32')]=_['keys'](_0x37f3b2[_0x810b('0x32')]);_0xd1a0fb['filters']=_[_0x810b('0x35')](_0xd1a0fb['model'],_0xd1a0fb[_0x810b('0x32')]);_0x2e24aa[_0x810b('0x36')]=_['intersection'](_0xd1a0fb[_0x810b('0x31')],qs[_0x810b('0x37')](_0x37f3b2[_0x810b('0x32')]['fields']));_0x2e24aa[_0x810b('0x36')]=_0x2e24aa[_0x810b('0x36')][_0x810b('0x38')]?_0x2e24aa[_0x810b('0x36')]:_0xd1a0fb[_0x810b('0x31')];_0x2e24aa[_0x810b('0x3b')]=qs['sort'](_0x37f3b2[_0x810b('0x32')][_0x810b('0x3c')]);_0x2e24aa[_0x810b('0x3d')]=qs[_0x810b('0x34')](_[_0x810b('0x60')](_0x37f3b2[_0x810b('0x32')],_0xd1a0fb['filters']));if(_0x37f3b2[_0x810b('0x32')][_0x810b('0x3e')]){_0x2e24aa['where']=_[_0x810b('0x53')](_0x2e24aa[_0x810b('0x3d')],{'$or':_[_0x810b('0x2d')](_0x2e24aa[_0x810b('0x36')],function(_0x22a117){var _0x112aec={};_0x112aec[_0x22a117]={'$like':'%'+_0x37f3b2[_0x810b('0x32')][_0x810b('0x3e')]+'%'};return _0x112aec;})});}_0x2e24aa=_[_0x810b('0x53')]({},_0x2e24aa,_0x37f3b2[_0x810b('0x41')]);return _0x7c5d55[_0x810b('0x66')](_0x2e24aa);}})[_0x810b('0x25')](function(_0x2fb026){if(_0x2fb026){_0x5c152b=_0x2fb026[_0x810b('0x38')];if(!_0x37f3b2[_0x810b('0x32')]['hasOwnProperty']('nolimit')){_0x2e24aa['limit']=qs[_0x810b('0x1f')](_0x37f3b2[_0x810b('0x32')]['limit']);_0x2e24aa[_0x810b('0x1d')]=qs[_0x810b('0x1d')](_0x37f3b2['query'][_0x810b('0x1d')]);}return _0x7c5d55[_0x810b('0x66')](_0x2e24aa);}})[_0x810b('0x25')](function(_0xbdbffa){if(_0xbdbffa){return _0xbdbffa?{'count':_0x5c152b,'rows':_0xbdbffa}:null;}})[_0x810b('0x25')](respondWithResult(_0x57977b,null))[_0x810b('0x48')](handleError(_0x57977b,null));};exports[_0x810b('0x67')]=function(_0x4e43cb,_0x3bd8b0,_0x241d5a){var _0x3bd1dd,_0x336022;var _0x435720=[];var _0xc8d646=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x810b('0x42')][_0x810b('0x47')]({'where':{'id':_0x4e43cb[_0x810b('0x46')]['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x3bd8b0,null))[_0x810b('0x25')](function(_0xbb5368){if(_0xbb5368){_0x336022=_0xbb5368;return _0xbb5368[_0x810b('0x67')](_0x4e43cb[_0x810b('0x57')][_0x810b('0x68')],_['omit'](_0x4e43cb[_0x810b('0x57')],[_0x810b('0x68'),'id'])||{});}return null;})[_0x810b('0x69')](function(_0x1e73f5){var _0x26debf;var _0x115562;_0x3bd1dd=_0x1e73f5||[];var _0x22e504=[];if(_0x1e73f5){for(var _0x4f16cd=0x0;_0x4f16cd<_0x1e73f5[_0x810b('0x38')];_0x4f16cd+=0x1){var _0x36d7ac=_0x1e73f5[_0x4f16cd][_0x810b('0x27')]({'plain':!![]});_0x336022[_0x810b('0x6a')]=_0x4e43cb[_0x810b('0x57')][_0x810b('0x6a')]?_0x4e43cb['body'][_0x810b('0x6a')]:_0x336022[_0x810b('0x6a')];switch(_0x336022[_0x810b('0x6a')]){case _0x810b('0x6b'):_0x26debf=squel[_0x810b('0x6c')]()[_0x810b('0x6d')]('cm_hopper')['fromQuery'](['phone',_0x810b('0x6e'),'ContactId','ListId','CampaignId','createdAt',_0x810b('0x56')],squel[_0x810b('0x6f')]()[_0x810b('0x70')](_0x810b('0x71'),_0x810b('0x71'))[_0x810b('0x70')](_0x810b('0x72'),_0x810b('0x6e'))[_0x810b('0x70')]('id',_0x810b('0x73'))[_0x810b('0x70')](_0x36d7ac['CmListId']['toString'](),_0x810b('0x74'))['field'](_0x4e43cb[_0x810b('0x46')]['id'][_0x810b('0x75')](),_0x810b('0x5a'))[_0x810b('0x70')]('\x27'+_0xc8d646+'\x27',_0x810b('0x55'))['field']('\x27'+_0xc8d646+'\x27','updatedAt')[_0x810b('0x76')]('cm_contacts')[_0x810b('0x3d')](_0x810b('0x77'))[_0x810b('0x3d')](_0x810b('0x78'),_0x36d7ac[_0x810b('0x79')][_0x810b('0x75')]())['where'](_0x810b('0x7a'))[_0x810b('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x810b('0x7b'))[_0x810b('0x76')](_0x810b('0x7c'))[_0x810b('0x3d')](_0x810b('0x7d'),_0x4e43cb[_0x810b('0x46')]['id']['toString']()))[_0x810b('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x810b('0x6f')]()['field'](_0x810b('0x7e'))['from'](_0x810b('0x7f'))[_0x810b('0x3d')](_0x810b('0x7d'),_0x4e43cb[_0x810b('0x46')]['id'][_0x810b('0x75')]())))['toString']();break;case _0x810b('0x80'):_0x26debf=squel[_0x810b('0x6c')]()[_0x810b('0x6d')]('cm_hopper')[_0x810b('0x81')]([_0x810b('0x71'),_0x810b('0x6e'),_0x810b('0x73'),'ListId',_0x810b('0x5a'),_0x810b('0x55'),_0x810b('0x56')],squel['select']()[_0x810b('0x70')](_0x810b('0x71'),_0x810b('0x71'))[_0x810b('0x70')]('NOW()',_0x810b('0x6e'))[_0x810b('0x70')]('id',_0x810b('0x73'))['field'](_0x36d7ac[_0x810b('0x79')][_0x810b('0x75')](),_0x810b('0x74'))['field'](_0x4e43cb[_0x810b('0x46')]['id'][_0x810b('0x75')](),_0x810b('0x5a'))['field']('\x27'+_0xc8d646+'\x27','createdAt')[_0x810b('0x70')]('\x27'+_0xc8d646+'\x27',_0x810b('0x56'))[_0x810b('0x76')](_0x810b('0x82'))['where'](_0x810b('0x77'))[_0x810b('0x3d')](_0x810b('0x78'),_0x36d7ac[_0x810b('0x79')][_0x810b('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x810b('0x3d')](_0x810b('0x83'),squel['select']()['field']('COALESCE(phone,\x27\x27)')['from'](_0x810b('0x7f'))[_0x810b('0x3d')](_0x810b('0x7d'),_0x4e43cb[_0x810b('0x46')]['id'][_0x810b('0x75')]())))[_0x810b('0x75')]();break;default:_0x26debf=squel[_0x810b('0x6c')]()['into'](_0x810b('0x7f'))[_0x810b('0x81')]([_0x810b('0x71'),_0x810b('0x6e'),'ContactId',_0x810b('0x74'),_0x810b('0x5a'),_0x810b('0x55'),_0x810b('0x56')],squel[_0x810b('0x6f')]()['field'](_0x810b('0x71'),_0x810b('0x71'))[_0x810b('0x70')](_0x810b('0x72'),_0x810b('0x6e'))[_0x810b('0x70')]('id',_0x810b('0x73'))[_0x810b('0x70')](_0x36d7ac[_0x810b('0x79')][_0x810b('0x75')](),'ListId')[_0x810b('0x70')](_0x4e43cb[_0x810b('0x46')]['id']['toString'](),'CampaignId')[_0x810b('0x70')]('\x27'+_0xc8d646+'\x27',_0x810b('0x55'))[_0x810b('0x70')]('\x27'+_0xc8d646+'\x27',_0x810b('0x56'))[_0x810b('0x76')](_0x810b('0x82'))[_0x810b('0x3d')](_0x810b('0x77'))['where'](_0x810b('0x78'),_0x36d7ac['CmListId'][_0x810b('0x75')]())[_0x810b('0x3d')](_0x810b('0x7a')))['toString']();}_0x115562=squel[_0x810b('0x6c')]()[_0x810b('0x6d')]('cm_hopper_additional_phones')[_0x810b('0x81')]([_0x810b('0x84'),'scheduledAt',_0x810b('0x71'),'OrderBy',_0x810b('0x55'),'updatedAt'],squel['select']()['field']('h.id','id')['field'](_0x810b('0x72'),_0x810b('0x6e'))[_0x810b('0x70')]('ci.item',_0x810b('0x71'))[_0x810b('0x70')](_0x810b('0x85'),'OrderBy')['field']('\x27'+_0xc8d646+'\x27',_0x810b('0x55'))[_0x810b('0x70')]('\x27'+_0xc8d646+'\x27','updatedAt')['from'](_0x810b('0x86'),'ci')[_0x810b('0x87')]('cm_hopper','h',_0x810b('0x88'))[_0x810b('0x3d')]('h.ListId\x20=\x20?',_0x36d7ac['CmListId'][_0x810b('0x75')]())[_0x810b('0x3d')](_0x810b('0x89'),_0x4e43cb['params']['id'][_0x810b('0x75')]())['where'](_0x810b('0x8a'),_0xc8d646))[_0x810b('0x75')]();_0x22e504[_0x810b('0x8b')](db['sequelize']['query'](_0x26debf));_0x435720[_0x810b('0x8b')](db[_0x810b('0x8c')][_0x810b('0x32')](_0x115562));}return BPromise[_0x810b('0x8d')](_0x22e504);}})[_0x810b('0x25')](function(){return BPromise[_0x810b('0x8d')](_0x435720);})[_0x810b('0x25')](function(){return _0x3bd1dd;})[_0x810b('0x25')](respondWithResult(_0x3bd8b0,null))[_0x810b('0x48')](handleError(_0x3bd8b0,null));};exports[_0x810b('0x8e')]=function(_0x2a345d,_0x5a4337,_0x232d18){return db[_0x810b('0x42')][_0x810b('0x47')]({'where':{'id':_0x2a345d['params']['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x5a4337,null))[_0x810b('0x25')](function(_0x3ae878){if(_0x3ae878){return _0x3ae878[_0x810b('0x8e')](_0x2a345d['query'][_0x810b('0x68')]);}})[_0x810b('0x25')](function(_0x46fe41){if(_0x46fe41){return db[_0x810b('0x5b')][_0x810b('0x26')]({'where':{'ListId':_0x2a345d[_0x810b('0x32')]['ids'],'CampaignId':_0x2a345d['params']['id']}})[_0x810b('0x25')](function(){return _0x46fe41;});}})[_0x810b('0x25')](respondWithStatusCode(_0x5a4337,null))[_0x810b('0x48')](handleError(_0x5a4337,null));};exports[_0x810b('0x8f')]=function(_0x131baf,_0x2215e5,_0x2660fa){var _0x383cd3={};var _0xfb31be={};var _0x413e5e;var _0x51d932;return db['Campaign']['findOne']({'where':{'id':_0x131baf[_0x810b('0x46')]['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x2215e5,null))['then'](function(_0x26b211){if(_0x26b211){_0x413e5e=_0x26b211;_0xfb31be[_0x810b('0x31')]=_[_0x810b('0x33')](db[_0x810b('0x65')][_0x810b('0x2e')]);_0xfb31be[_0x810b('0x32')]=_[_0x810b('0x33')](_0x131baf[_0x810b('0x32')]);_0xfb31be[_0x810b('0x34')]=_[_0x810b('0x35')](_0xfb31be[_0x810b('0x31')],_0xfb31be['query']);_0x383cd3['attributes']=_[_0x810b('0x35')](_0xfb31be[_0x810b('0x31')],qs[_0x810b('0x37')](_0x131baf[_0x810b('0x32')][_0x810b('0x37')]));_0x383cd3[_0x810b('0x36')]=_0x383cd3[_0x810b('0x36')][_0x810b('0x38')]?_0x383cd3[_0x810b('0x36')]:_0xfb31be[_0x810b('0x31')];_0x383cd3['order']=qs[_0x810b('0x3c')](_0x131baf[_0x810b('0x32')][_0x810b('0x3c')]);_0x383cd3[_0x810b('0x3d')]=qs[_0x810b('0x34')](_[_0x810b('0x60')](_0x131baf['query'],_0xfb31be['filters']));if(_0x131baf[_0x810b('0x32')]['filter']){_0x383cd3[_0x810b('0x3d')]=_['merge'](_0x383cd3['where'],{'$or':_[_0x810b('0x2d')](_0x383cd3[_0x810b('0x36')],function(_0x33cfbd){var _0x19e231={};_0x19e231[_0x33cfbd]={'$like':'%'+_0x131baf['query'][_0x810b('0x3e')]+'%'};return _0x19e231;})});}_0x383cd3=_[_0x810b('0x53')]({},_0x383cd3,_0x131baf[_0x810b('0x41')]);return _0x413e5e[_0x810b('0x8f')](_0x383cd3);}})[_0x810b('0x25')](function(_0x13ce62){if(_0x13ce62){_0x51d932=_0x13ce62['length'];if(!_0x131baf[_0x810b('0x32')][_0x810b('0x39')](_0x810b('0x3a'))){_0x383cd3[_0x810b('0x1f')]=qs[_0x810b('0x1f')](_0x131baf[_0x810b('0x32')][_0x810b('0x1f')]);_0x383cd3[_0x810b('0x1d')]=qs[_0x810b('0x1d')](_0x131baf[_0x810b('0x32')]['offset']);}return _0x413e5e[_0x810b('0x8f')](_0x383cd3);}})[_0x810b('0x25')](function(_0x20e138){if(_0x20e138){return _0x20e138?{'count':_0x51d932,'rows':_0x20e138}:null;}})['then'](respondWithResult(_0x2215e5,null))['catch'](handleError(_0x2215e5,null));};exports[_0x810b('0x90')]=function(_0x301f60,_0x452eb3,_0x1d1ebd){var _0x5ea1d7,_0xd37e48;var _0x1b36e2=[];var _0x63232f=moment()[_0x810b('0x91')](_0x810b('0x92'));return db[_0x810b('0x42')]['find']({'where':{'id':_0x301f60['params']['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x452eb3,null))['then'](function(_0x21c23b){if(_0x21c23b){_0xd37e48=_0x21c23b;return _0x21c23b[_0x810b('0x90')](_0x301f60['body'][_0x810b('0x68')],_[_0x810b('0x54')](_0x301f60[_0x810b('0x57')],[_0x810b('0x68'),'id'])||{});}return null;})[_0x810b('0x69')](function(_0x5c546d){var _0x2a2796;var _0x381fd3;_0x5ea1d7=_0x5c546d||[];var _0xdda64a=[];if(_0x5c546d){for(var _0x57fa73=0x0;_0x57fa73<_0x5c546d[_0x810b('0x38')];_0x57fa73+=0x1){var _0xaf8710=_0x5c546d[_0x57fa73][_0x810b('0x27')]({'plain':!![]});_0x2a2796=squel[_0x810b('0x6c')]()['into'](_0x810b('0x93'))[_0x810b('0x81')]([_0x810b('0x71'),_0x810b('0x73'),_0x810b('0x74'),'CampaignId',_0x810b('0x55'),_0x810b('0x56')],squel[_0x810b('0x6f')]()['field'](_0x810b('0x71'),'phone')['field']('id','ContactId')[_0x810b('0x70')](_0xaf8710[_0x810b('0x79')][_0x810b('0x75')](),'ListId')[_0x810b('0x70')](_0x301f60[_0x810b('0x46')]['id'][_0x810b('0x75')](),_0x810b('0x5a'))[_0x810b('0x70')](_0x810b('0x72'),_0x810b('0x55'))[_0x810b('0x70')]('NOW()',_0x810b('0x56'))[_0x810b('0x76')](_0x810b('0x82'))[_0x810b('0x3d')](_0x810b('0x77'))[_0x810b('0x3d')]('ListId\x20=\x20?',_0xaf8710['CmListId'][_0x810b('0x75')]())['where'](_0x810b('0x7a')))[_0x810b('0x75')]();_0xdda64a['push'](db[_0x810b('0x8c')]['query'](_0x2a2796));}return BPromise['all'](_0xdda64a);}})[_0x810b('0x25')](function(){return _0x5ea1d7;})['then'](respondWithResult(_0x452eb3,null))[_0x810b('0x48')](handleError(_0x452eb3,null));};exports['removeBlackLists']=function(_0x4a2283,_0x1fc420,_0x1d5435){return db[_0x810b('0x42')][_0x810b('0x47')]({'where':{'id':_0x4a2283[_0x810b('0x46')]['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x1fc420,null))['then'](function(_0x1ebc90){if(_0x1ebc90){return _0x1ebc90[_0x810b('0x94')](_0x4a2283[_0x810b('0x32')][_0x810b('0x68')]);}})[_0x810b('0x25')](function(_0xd3f0ed){if(_0xd3f0ed){return db[_0x810b('0x64')]['destroy']({'where':{'ListId':_0x4a2283[_0x810b('0x32')]['ids'],'CampaignId':_0x4a2283['params']['id']}})[_0x810b('0x25')](function(){return _0xd3f0ed;});}})['then'](respondWithStatusCode(_0x1fc420,null))[_0x810b('0x48')](handleError(_0x1fc420,null));}; \ No newline at end of file +var _0x23a3=['ci.OrderBY','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','name','send','Campaign','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','getHoppers','findOne','CmHopper','pick','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','into','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','OrderBy','h.id'];(function(_0x34b48c,_0xe97afa){var _0x3b9957=function(_0x33095d){while(--_0x33095d){_0x34b48c['push'](_0x34b48c['shift']());}};_0x3b9957(++_0xe97afa);}(_0x23a3,0x131));var _0x323a=function(_0x825ea9,_0x56c3ea){_0x825ea9=_0x825ea9-0x0;var _0x4282a8=_0x23a3[_0x825ea9];return _0x4282a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x323a('0x0'));var rp=require('request-promise');var moment=require(_0x323a('0x1'));var BPromise=require(_0x323a('0x2'));var Mustache=require(_0x323a('0x3'));var util=require(_0x323a('0x4'));var path=require(_0x323a('0x5'));var sox=require(_0x323a('0x6'));var csv=require(_0x323a('0x7'));var ejs=require(_0x323a('0x8'));var fs=require('fs');var fs_extra=require(_0x323a('0x9'));var _=require('lodash');var squel=require(_0x323a('0xa'));var crypto=require(_0x323a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x323a('0xc'));var toCsv=require(_0x323a('0x7'));var querystring=require(_0x323a('0xd'));var Papa=require('papaparse');var Redis=require(_0x323a('0xe'));var authService=require(_0x323a('0xf'));var qs=require(_0x323a('0x10'));var as=require(_0x323a('0x11'));var hardwareService=require(_0x323a('0x12'));var logger=require(_0x323a('0x13'))(_0x323a('0x14'));var utils=require(_0x323a('0x15'));var config=require(_0x323a('0x16'));var licenseUtil=require(_0x323a('0x17'));var db=require(_0x323a('0x18'))['db'];function respondWithStatusCode(_0x33d226,_0x460fd8){_0x460fd8=_0x460fd8||0xcc;return function(_0x1ae315){if(_0x1ae315){return _0x33d226['sendStatus'](_0x460fd8);}return _0x33d226[_0x323a('0x19')](_0x460fd8)['end']();};}function respondWithResult(_0x16b92e,_0x4ccd19){_0x4ccd19=_0x4ccd19||0xc8;return function(_0x5f3922){if(_0x5f3922){return _0x16b92e[_0x323a('0x19')](_0x4ccd19)['json'](_0x5f3922);}};}function respondWithFilteredResult(_0x46c247,_0x582631){return function(_0x1cc64d){if(_0x1cc64d){var _0x64003=typeof _0x582631['offset']===_0x323a('0x1a')&&typeof _0x582631[_0x323a('0x1b')]==='undefined';var _0x5c1947=_0x1cc64d[_0x323a('0x1c')];var _0x221ae4=_0x64003?0x0:_0x582631[_0x323a('0x1d')];var _0x29dd21=_0x64003?_0x1cc64d[_0x323a('0x1c')]:_0x582631[_0x323a('0x1d')]+_0x582631['limit'];var _0x5bf1c9;if(_0x29dd21>=_0x5c1947){_0x29dd21=_0x5c1947;_0x5bf1c9=0xc8;}else{_0x5bf1c9=0xce;}_0x46c247['status'](_0x5bf1c9);return _0x46c247['set'](_0x323a('0x1e'),_0x221ae4+'-'+_0x29dd21+'/'+_0x5c1947)['json'](_0x1cc64d);}return null;};}function patchUpdates(_0xc0f3e4){return function(_0x38bc95){try{jsonpatch[_0x323a('0x1f')](_0x38bc95,_0xc0f3e4,!![]);}catch(_0xd35d83){return BPromise['reject'](_0xd35d83);}return _0x38bc95[_0x323a('0x20')]();};}function saveUpdates(_0x549e64,_0x12c8d7){return function(_0x323517){if(_0x323517){return _0x323517[_0x323a('0x21')](_0x549e64)['then'](function(_0x41ea3d){return _0x41ea3d;});}return null;};}function removeEntity(_0x358bcb,_0x36d4d9){return function(_0x2960e0){if(_0x2960e0){return _0x2960e0[_0x323a('0x22')]()[_0x323a('0x23')](function(){var _0x5ba015=_0x2960e0[_0x323a('0x24')]({'plain':!![]});var _0x5d82c2=_0x323a('0x25');return db[_0x323a('0x26')][_0x323a('0x22')]({'where':{'type':_0x5d82c2,'resourceId':_0x5ba015['id']}})[_0x323a('0x23')](function(){return _0x2960e0;});})[_0x323a('0x23')](function(){_0x358bcb['status'](0xcc)[_0x323a('0x27')]();});}};}function handleEntityNotFound(_0x384c93,_0x30dbe6){return function(_0x17907c){if(!_0x17907c){_0x384c93[_0x323a('0x28')](0x194);}return _0x17907c;};}function handleError(_0x4ba792,_0x23a989){_0x23a989=_0x23a989||0x1f4;return function(_0x571264){logger[_0x323a('0x29')](_0x571264[_0x323a('0x2a')]);if(_0x571264[_0x323a('0x2b')]){delete _0x571264[_0x323a('0x2b')];}_0x4ba792[_0x323a('0x19')](_0x23a989)[_0x323a('0x2c')](_0x571264);};}exports['index']=function(_0x2a1a85,_0x3f6809){var _0x580c2b={},_0x32c05b={},_0x4abf8d={'count':0x0,'rows':[]};var _0x4a70dd=_['map'](db[_0x323a('0x2d')]['rawAttributes'],function(_0x2a8da8){return{'name':_0x2a8da8[_0x323a('0x2e')],'type':_0x2a8da8[_0x323a('0x2f')][_0x323a('0x30')]};});_0x32c05b[_0x323a('0x31')]=_['map'](_0x4a70dd,_0x323a('0x2b'));_0x32c05b['query']=_[_0x323a('0x32')](_0x2a1a85['query']);_0x32c05b[_0x323a('0x33')]=_[_0x323a('0x34')](_0x32c05b['model'],_0x32c05b[_0x323a('0x35')]);_0x580c2b[_0x323a('0x36')]=_[_0x323a('0x34')](_0x32c05b[_0x323a('0x31')],qs[_0x323a('0x37')](_0x2a1a85[_0x323a('0x35')][_0x323a('0x37')]));_0x580c2b[_0x323a('0x36')]=_0x580c2b['attributes'][_0x323a('0x38')]?_0x580c2b[_0x323a('0x36')]:_0x32c05b[_0x323a('0x31')];if(!_0x2a1a85[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x580c2b[_0x323a('0x1b')]=qs['limit'](_0x2a1a85['query'][_0x323a('0x1b')]);_0x580c2b[_0x323a('0x1d')]=qs[_0x323a('0x1d')](_0x2a1a85['query'][_0x323a('0x1d')]);}_0x580c2b[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x2a1a85[_0x323a('0x35')]['sort']);_0x580c2b[_0x323a('0x3d')]=qs[_0x323a('0x33')](_['pick'](_0x2a1a85['query'],_0x32c05b[_0x323a('0x33')]),_0x4a70dd);if(_0x2a1a85['query'][_0x323a('0x3e')]){_0x580c2b[_0x323a('0x3d')]=_[_0x323a('0x3f')](_0x580c2b['where'],{'$or':_[_0x323a('0x40')](_0x4a70dd,function(_0x52f80f){if(_0x52f80f[_0x323a('0x2f')]!==_0x323a('0x41')){var _0x2d6c6f={};_0x2d6c6f[_0x52f80f[_0x323a('0x2b')]]={'$like':'%'+_0x2a1a85[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x2d6c6f;}})});}_0x580c2b=_['merge']({},_0x580c2b,_0x2a1a85[_0x323a('0x42')]);var _0xcff0c6={'where':_0x580c2b[_0x323a('0x3d')]};return db[_0x323a('0x2d')][_0x323a('0x1c')](_0xcff0c6)['then'](function(_0x1482d2){_0x4abf8d[_0x323a('0x1c')]=_0x1482d2;if(_0x2a1a85['query'][_0x323a('0x43')]){_0x580c2b[_0x323a('0x44')]=[{'all':!![]}];}return db[_0x323a('0x2d')][_0x323a('0x45')](_0x580c2b);})[_0x323a('0x23')](function(_0x599b28){_0x4abf8d[_0x323a('0x46')]=_0x599b28;return _0x4abf8d;})['then'](respondWithFilteredResult(_0x3f6809,_0x580c2b))['catch'](handleError(_0x3f6809,null));};exports[_0x323a('0x47')]=function(_0x3543a7,_0x3d98ce){var _0x357a22={'raw':![],'where':{'id':_0x3543a7[_0x323a('0x48')]['id']}},_0x5284dd={};_0x5284dd[_0x323a('0x31')]=_[_0x323a('0x32')](db[_0x323a('0x2d')][_0x323a('0x49')]);_0x5284dd['query']=_[_0x323a('0x32')](_0x3543a7[_0x323a('0x35')]);_0x5284dd['filters']=_['intersection'](_0x5284dd[_0x323a('0x31')],_0x5284dd[_0x323a('0x35')]);_0x357a22[_0x323a('0x36')]=_['intersection'](_0x5284dd[_0x323a('0x31')],qs[_0x323a('0x37')](_0x3543a7[_0x323a('0x35')]['fields']));_0x357a22[_0x323a('0x36')]=_0x357a22[_0x323a('0x36')][_0x323a('0x38')]?_0x357a22[_0x323a('0x36')]:_0x5284dd[_0x323a('0x31')];if(_0x3543a7[_0x323a('0x35')][_0x323a('0x43')]){_0x357a22[_0x323a('0x44')]=[{'all':!![]}];}_0x357a22=_[_0x323a('0x3f')]({},_0x357a22,_0x3543a7[_0x323a('0x42')]);return db[_0x323a('0x2d')][_0x323a('0x4a')](_0x357a22)['then'](handleEntityNotFound(_0x3d98ce,null))[_0x323a('0x23')](respondWithResult(_0x3d98ce,null))[_0x323a('0x4b')](handleError(_0x3d98ce,null));};exports[_0x323a('0x4c')]=function(_0x4dc7da,_0x481f08){return db[_0x323a('0x2d')][_0x323a('0x4c')](_0x4dc7da[_0x323a('0x4d')],{})[_0x323a('0x23')](function(_0x5686f0){var _0x2616bd=_0x4dc7da['user'][_0x323a('0x24')]({'plain':!![]});if(!_0x2616bd)throw new Error(_0x323a('0x4e'));if(_0x2616bd[_0x323a('0x4f')]===_0x323a('0x50')){var _0x2cb64b=_0x5686f0['get']({'plain':!![]});var _0x2f1a14=_0x323a('0x25');return db[_0x323a('0x51')][_0x323a('0x4a')]({'where':{'name':_0x2f1a14,'userProfileId':_0x2616bd['userProfileId']},'raw':!![]})[_0x323a('0x23')](function(_0x5c590e){if(_0x5c590e&&_0x5c590e[_0x323a('0x52')]===0x0){return db[_0x323a('0x26')][_0x323a('0x4c')]({'name':_0x2cb64b[_0x323a('0x2b')],'resourceId':_0x2cb64b['id'],'type':_0x5c590e[_0x323a('0x2b')],'sectionId':_0x5c590e['id']},{})[_0x323a('0x23')](function(){return _0x5686f0;});}else{return _0x5686f0;}})[_0x323a('0x4b')](function(_0x101357){logger[_0x323a('0x29')](_0x323a('0x53'),_0x101357);throw _0x101357;});}return _0x5686f0;})['then'](respondWithResult(_0x481f08,0xc9))['catch'](handleError(_0x481f08,null));};exports[_0x323a('0x54')]=function(_0x14502c,_0x2d86dc){var _0x45ced7={'where':{'id':_0x14502c[_0x323a('0x48')]['id']}},_0x2875ce={};_0x2875ce['model']=_[_0x323a('0x32')](db[_0x323a('0x2d')][_0x323a('0x49')]);_0x45ced7['attributes']=_[_0x323a('0x34')](_0x2875ce[_0x323a('0x31')],qs['fields'](_0x14502c[_0x323a('0x35')]['fields']));_0x45ced7[_0x323a('0x36')]=_0x45ced7[_0x323a('0x36')][_0x323a('0x38')]?_0x45ced7[_0x323a('0x36')]:_0x2875ce['model'];if(_0x14502c[_0x323a('0x35')]['includeAll']){_0x45ced7[_0x323a('0x44')]=[{'all':!![]}];}_0x45ced7=_['merge']({},_0x45ced7,_0x14502c[_0x323a('0x42')]);return db[_0x323a('0x2d')]['find'](_0x45ced7)[_0x323a('0x23')](handleEntityNotFound(_0x2d86dc,null))['then'](function(_0x1aa6dd){if(_0x1aa6dd){var _0x387b40=_0x1aa6dd['get']({'plain':!![]});_0x387b40=qs[_0x323a('0x55')](_0x387b40,['id',_0x323a('0x56'),_0x323a('0x57')]);_0x14502c['body']=_[_0x323a('0x55')](_0x14502c[_0x323a('0x4d')],['id',_0x323a('0x56'),_0x323a('0x57')]);return db[_0x323a('0x2d')][_0x323a('0x4c')](_[_0x323a('0x3f')](_0x387b40,_0x14502c[_0x323a('0x4d')]),{'include':_0x14502c[_0x323a('0x35')][_0x323a('0x43')]?[{'all':!![]}]:undefined})[_0x323a('0x23')](function(_0x1e540e){var _0x181072=_0x14502c[_0x323a('0x50')][_0x323a('0x24')]({'plain':!![]});if(!_0x181072)throw new Error(_0x323a('0x4e'));if(_0x181072['role']===_0x323a('0x50')){var _0x188777=_0x1e540e[_0x323a('0x24')]({'plain':!![]});var _0x40df26='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x40df26,'userProfileId':_0x181072[_0x323a('0x58')]},'raw':!![]})[_0x323a('0x23')](function(_0x17a608){if(_0x17a608&&_0x17a608[_0x323a('0x52')]===0x0){return db[_0x323a('0x26')][_0x323a('0x4c')]({'name':_0x188777[_0x323a('0x2b')],'resourceId':_0x188777['id'],'type':_0x17a608[_0x323a('0x2b')],'sectionId':_0x17a608['id']},{})[_0x323a('0x23')](function(){return _0x1e540e;});}else{return _0x1e540e;}})[_0x323a('0x4b')](function(_0x1291aa){logger[_0x323a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1291aa);throw _0x1291aa;});}return _0x1e540e;});}})[_0x323a('0x23')](respondWithResult(_0x2d86dc,0xc9))[_0x323a('0x4b')](handleError(_0x2d86dc,null));};exports[_0x323a('0x21')]=function(_0x5e4fb3,_0x3744f9){if(_0x5e4fb3[_0x323a('0x4d')]['id']){delete _0x5e4fb3[_0x323a('0x4d')]['id'];}return db['Campaign']['find']({'where':{'id':_0x5e4fb3['params']['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x3744f9,null))[_0x323a('0x23')](saveUpdates(_0x5e4fb3[_0x323a('0x4d')],null))[_0x323a('0x23')](respondWithResult(_0x3744f9,null))[_0x323a('0x4b')](handleError(_0x3744f9,null));};exports[_0x323a('0x22')]=function(_0x205d9f,_0x484f2a){return db['Campaign']['find']({'where':{'id':_0x205d9f['params']['id']}})['then'](handleEntityNotFound(_0x484f2a,null))[_0x323a('0x23')](removeEntity(_0x484f2a,null))[_0x323a('0x4b')](handleError(_0x484f2a,null));};exports[_0x323a('0x59')]=function(_0x605792,_0x1ee247,_0xed1022){var _0x11e7c8={'raw':!![],'where':{}};var _0x540b8c={};var _0x39e692={'count':0x0,'rows':[]};return db['Campaign'][_0x323a('0x5a')]({'where':{'id':_0x605792['params']['id']}})['then'](handleEntityNotFound(_0x1ee247,null))['then'](function(_0x4916e0){if(_0x4916e0){_0x540b8c[_0x323a('0x31')]=_['keys'](db[_0x323a('0x5b')]['rawAttributes']);_0x540b8c[_0x323a('0x35')]=_[_0x323a('0x32')](_0x605792[_0x323a('0x35')]);_0x540b8c['filters']=_['intersection'](_0x540b8c[_0x323a('0x31')],_0x540b8c[_0x323a('0x35')]);_0x11e7c8[_0x323a('0x36')]=_[_0x323a('0x34')](_0x540b8c['model'],qs[_0x323a('0x37')](_0x605792[_0x323a('0x35')][_0x323a('0x37')]));_0x11e7c8[_0x323a('0x36')]=_0x11e7c8[_0x323a('0x36')]['length']?_0x11e7c8[_0x323a('0x36')]:_0x540b8c[_0x323a('0x31')];if(!_0x605792[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x11e7c8[_0x323a('0x1b')]=qs[_0x323a('0x1b')](_0x605792['query']['limit']);_0x11e7c8[_0x323a('0x1d')]=qs['offset'](_0x605792[_0x323a('0x35')]['offset']);}_0x11e7c8[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x605792['query'][_0x323a('0x3c')]);_0x11e7c8[_0x323a('0x3d')]=qs[_0x323a('0x33')](_[_0x323a('0x5c')](_0x605792['query'],_0x540b8c[_0x323a('0x33')]));_0x11e7c8[_0x323a('0x3d')]['CampaignId']=_0x4916e0['id'];if(_0x605792['query'][_0x323a('0x3e')]){_0x11e7c8['where']=_['merge'](_0x11e7c8[_0x323a('0x3d')],{'$or':_[_0x323a('0x40')](_0x11e7c8[_0x323a('0x36')],function(_0x1ec023){var _0x26e50d={};_0x26e50d[_0x1ec023]={'$like':'%'+_0x605792[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x26e50d;})});}_0x11e7c8=_[_0x323a('0x3f')]({},_0x11e7c8,_0x605792['options']);return db[_0x323a('0x5b')]['count']({'where':_0x11e7c8[_0x323a('0x3d')]})['then'](function(_0x540997){_0x39e692[_0x323a('0x1c')]=_0x540997;if(_0x605792[_0x323a('0x35')][_0x323a('0x43')]){_0x11e7c8[_0x323a('0x44')]=[{'all':!![]}];}return db[_0x323a('0x5b')][_0x323a('0x45')](_0x11e7c8);})[_0x323a('0x23')](function(_0xac7a0a){_0x39e692['rows']=_0xac7a0a;return _0x39e692;});}})[_0x323a('0x23')](respondWithFilteredResult(_0x1ee247,_0x11e7c8))[_0x323a('0x4b')](handleError(_0x1ee247,null));};exports[_0x323a('0x5d')]=function(_0x36db83,_0x1caf86,_0x3ab588){var _0x10dced={'raw':!![],'where':{}};var _0x390bed={};var _0x4ba690={'count':0x0,'rows':[]};return db[_0x323a('0x2d')][_0x323a('0x5a')]({'where':{'id':_0x36db83[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x1caf86,null))[_0x323a('0x23')](function(_0x2c61b8){if(_0x2c61b8){_0x390bed[_0x323a('0x31')]=_['keys'](db[_0x323a('0x5e')]['rawAttributes']);_0x390bed[_0x323a('0x35')]=_[_0x323a('0x32')](_0x36db83[_0x323a('0x35')]);_0x390bed[_0x323a('0x33')]=_[_0x323a('0x34')](_0x390bed[_0x323a('0x31')],_0x390bed[_0x323a('0x35')]);_0x10dced['attributes']=_[_0x323a('0x34')](_0x390bed[_0x323a('0x31')],qs[_0x323a('0x37')](_0x36db83['query'][_0x323a('0x37')]));_0x10dced[_0x323a('0x36')]=_0x10dced[_0x323a('0x36')][_0x323a('0x38')]?_0x10dced['attributes']:_0x390bed['model'];if(!_0x36db83[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x10dced[_0x323a('0x1b')]=qs[_0x323a('0x1b')](_0x36db83[_0x323a('0x35')][_0x323a('0x1b')]);_0x10dced['offset']=qs[_0x323a('0x1d')](_0x36db83[_0x323a('0x35')][_0x323a('0x1d')]);}_0x10dced['order']=qs[_0x323a('0x3c')](_0x36db83[_0x323a('0x35')][_0x323a('0x3c')]);_0x10dced[_0x323a('0x3d')]=qs[_0x323a('0x33')](_[_0x323a('0x5c')](_0x36db83[_0x323a('0x35')],_0x390bed[_0x323a('0x33')]));_0x10dced[_0x323a('0x3d')][_0x323a('0x5f')]=_0x2c61b8['id'];if(_0x36db83[_0x323a('0x35')][_0x323a('0x3e')]){_0x10dced[_0x323a('0x3d')]=_['merge'](_0x10dced['where'],{'$or':_[_0x323a('0x40')](_0x10dced['attributes'],function(_0x3116ff){var _0x523b3a={};_0x523b3a[_0x3116ff]={'$like':'%'+_0x36db83[_0x323a('0x35')]['filter']+'%'};return _0x523b3a;})});}_0x10dced=_[_0x323a('0x3f')]({},_0x10dced,_0x36db83['options']);return db[_0x323a('0x5e')][_0x323a('0x1c')]({'where':_0x10dced[_0x323a('0x3d')]})[_0x323a('0x23')](function(_0x8e860f){_0x4ba690['count']=_0x8e860f;if(_0x36db83[_0x323a('0x35')][_0x323a('0x43')]){_0x10dced['include']=[{'all':!![]}];}return db[_0x323a('0x5e')][_0x323a('0x45')](_0x10dced);})[_0x323a('0x23')](function(_0x3a6183){_0x4ba690[_0x323a('0x46')]=_0x3a6183;return _0x4ba690;});}})[_0x323a('0x23')](respondWithFilteredResult(_0x1caf86,_0x10dced))[_0x323a('0x4b')](handleError(_0x1caf86,null));};exports[_0x323a('0x60')]=function(_0x558669,_0x1d7434,_0x3681ee){var _0x255a0a={'raw':!![],'where':{}};var _0x3bbcf3={};var _0x23ea9b={'count':0x0,'rows':[]};return db[_0x323a('0x2d')]['findOne']({'where':{'id':_0x558669[_0x323a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d7434,null))[_0x323a('0x23')](function(_0x31c21d){if(_0x31c21d){_0x3bbcf3['model']=_[_0x323a('0x32')](db['CmHopperFinal']['rawAttributes']);_0x3bbcf3[_0x323a('0x35')]=_['keys'](_0x558669[_0x323a('0x35')]);_0x3bbcf3[_0x323a('0x33')]=_[_0x323a('0x34')](_0x3bbcf3[_0x323a('0x31')],_0x3bbcf3[_0x323a('0x35')]);_0x255a0a[_0x323a('0x36')]=_[_0x323a('0x34')](_0x3bbcf3[_0x323a('0x31')],qs['fields'](_0x558669['query'][_0x323a('0x37')]));_0x255a0a[_0x323a('0x36')]=_0x255a0a[_0x323a('0x36')][_0x323a('0x38')]?_0x255a0a[_0x323a('0x36')]:_0x3bbcf3['model'];if(!_0x558669[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x255a0a[_0x323a('0x1b')]=qs['limit'](_0x558669[_0x323a('0x35')][_0x323a('0x1b')]);_0x255a0a['offset']=qs[_0x323a('0x1d')](_0x558669['query'][_0x323a('0x1d')]);}_0x255a0a[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x558669[_0x323a('0x35')]['sort']);_0x255a0a[_0x323a('0x3d')]=qs[_0x323a('0x33')](_[_0x323a('0x5c')](_0x558669['query'],_0x3bbcf3['filters']));_0x255a0a[_0x323a('0x3d')][_0x323a('0x5f')]=_0x31c21d['id'];if(_0x558669[_0x323a('0x35')]['filter']){_0x255a0a[_0x323a('0x3d')]=_[_0x323a('0x3f')](_0x255a0a[_0x323a('0x3d')],{'$or':_[_0x323a('0x40')](_0x255a0a[_0x323a('0x36')],function(_0x349e63){var _0x1aa0cc={};_0x1aa0cc[_0x349e63]={'$like':'%'+_0x558669[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x1aa0cc;})});}_0x255a0a=_['merge']({},_0x255a0a,_0x558669[_0x323a('0x42')]);return db['CmHopperFinal']['count']({'where':_0x255a0a['where']})['then'](function(_0x29d978){_0x23ea9b[_0x323a('0x1c')]=_0x29d978;if(_0x558669[_0x323a('0x35')][_0x323a('0x43')]){_0x255a0a[_0x323a('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x323a('0x45')](_0x255a0a);})[_0x323a('0x23')](function(_0x470ed9){_0x23ea9b[_0x323a('0x46')]=_0x470ed9;return _0x23ea9b;});}})[_0x323a('0x23')](respondWithFilteredResult(_0x1d7434,_0x255a0a))[_0x323a('0x4b')](handleError(_0x1d7434,null));};exports[_0x323a('0x61')]=function(_0x37a110,_0x521ddb,_0x38d0ce){var _0x56b943={'raw':!![],'where':{}};var _0x3b205c={};var _0x15cc44={'count':0x0,'rows':[]};return db[_0x323a('0x2d')][_0x323a('0x5a')]({'where':{'id':_0x37a110[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x521ddb,null))[_0x323a('0x23')](function(_0x323746){if(_0x323746){_0x3b205c['model']=_[_0x323a('0x32')](db['CmHopperBlack'][_0x323a('0x49')]);_0x3b205c[_0x323a('0x35')]=_[_0x323a('0x32')](_0x37a110['query']);_0x3b205c[_0x323a('0x33')]=_['intersection'](_0x3b205c[_0x323a('0x31')],_0x3b205c[_0x323a('0x35')]);_0x56b943[_0x323a('0x36')]=_[_0x323a('0x34')](_0x3b205c[_0x323a('0x31')],qs[_0x323a('0x37')](_0x37a110['query'][_0x323a('0x37')]));_0x56b943[_0x323a('0x36')]=_0x56b943[_0x323a('0x36')][_0x323a('0x38')]?_0x56b943[_0x323a('0x36')]:_0x3b205c[_0x323a('0x31')];if(!_0x37a110['query'][_0x323a('0x39')](_0x323a('0x3a'))){_0x56b943['limit']=qs[_0x323a('0x1b')](_0x37a110['query'][_0x323a('0x1b')]);_0x56b943[_0x323a('0x1d')]=qs['offset'](_0x37a110[_0x323a('0x35')][_0x323a('0x1d')]);}_0x56b943[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x37a110[_0x323a('0x35')][_0x323a('0x3c')]);_0x56b943['where']=qs['filters'](_[_0x323a('0x5c')](_0x37a110[_0x323a('0x35')],_0x3b205c[_0x323a('0x33')]));_0x56b943['where'][_0x323a('0x5f')]=_0x323746['id'];if(_0x37a110[_0x323a('0x35')]['filter']){_0x56b943['where']=_['merge'](_0x56b943['where'],{'$or':_[_0x323a('0x40')](_0x56b943[_0x323a('0x36')],function(_0x1c36c7){var _0x1478ec={};_0x1478ec[_0x1c36c7]={'$like':'%'+_0x37a110[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x1478ec;})});}_0x56b943=_[_0x323a('0x3f')]({},_0x56b943,_0x37a110[_0x323a('0x42')]);return db[_0x323a('0x62')]['count']({'where':_0x56b943['where']})[_0x323a('0x23')](function(_0x4f2dc2){_0x15cc44[_0x323a('0x1c')]=_0x4f2dc2;if(_0x37a110[_0x323a('0x35')]['includeAll']){_0x56b943[_0x323a('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x323a('0x45')](_0x56b943);})[_0x323a('0x23')](function(_0x48fc68){_0x15cc44['rows']=_0x48fc68;return _0x15cc44;});}})['then'](respondWithFilteredResult(_0x521ddb,_0x56b943))[_0x323a('0x4b')](handleError(_0x521ddb,null));};exports[_0x323a('0x63')]=function(_0x1aa3db,_0x493d73,_0x5cb5dd){var _0x2683b0={};var _0x1ff56f={};var _0x588487;var _0x12ca9e;return db[_0x323a('0x2d')][_0x323a('0x5a')]({'where':{'id':_0x1aa3db[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x493d73,null))[_0x323a('0x23')](function(_0x347711){if(_0x347711){_0x588487=_0x347711;_0x1ff56f['model']=_[_0x323a('0x32')](db[_0x323a('0x64')][_0x323a('0x49')]);_0x1ff56f[_0x323a('0x35')]=_['keys'](_0x1aa3db[_0x323a('0x35')]);_0x1ff56f['filters']=_['intersection'](_0x1ff56f['model'],_0x1ff56f[_0x323a('0x35')]);_0x2683b0[_0x323a('0x36')]=_['intersection'](_0x1ff56f[_0x323a('0x31')],qs[_0x323a('0x37')](_0x1aa3db[_0x323a('0x35')][_0x323a('0x37')]));_0x2683b0['attributes']=_0x2683b0['attributes'][_0x323a('0x38')]?_0x2683b0[_0x323a('0x36')]:_0x1ff56f[_0x323a('0x31')];_0x2683b0[_0x323a('0x3b')]=qs['sort'](_0x1aa3db[_0x323a('0x35')]['sort']);_0x2683b0['where']=qs[_0x323a('0x33')](_[_0x323a('0x5c')](_0x1aa3db[_0x323a('0x35')],_0x1ff56f[_0x323a('0x33')]));if(_0x1aa3db[_0x323a('0x35')][_0x323a('0x3e')]){_0x2683b0[_0x323a('0x3d')]=_[_0x323a('0x3f')](_0x2683b0[_0x323a('0x3d')],{'$or':_[_0x323a('0x40')](_0x2683b0[_0x323a('0x36')],function(_0x1b6c24){var _0x20536e={};_0x20536e[_0x1b6c24]={'$like':'%'+_0x1aa3db[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x20536e;})});}_0x2683b0=_[_0x323a('0x3f')]({},_0x2683b0,_0x1aa3db['options']);return _0x588487[_0x323a('0x63')](_0x2683b0);}})['then'](function(_0x560edb){if(_0x560edb){_0x12ca9e=_0x560edb[_0x323a('0x38')];if(!_0x1aa3db[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x2683b0['limit']=qs[_0x323a('0x1b')](_0x1aa3db[_0x323a('0x35')][_0x323a('0x1b')]);_0x2683b0[_0x323a('0x1d')]=qs[_0x323a('0x1d')](_0x1aa3db[_0x323a('0x35')]['offset']);}return _0x588487[_0x323a('0x63')](_0x2683b0);}})[_0x323a('0x23')](function(_0x47199d){if(_0x47199d){return _0x47199d?{'count':_0x12ca9e,'rows':_0x47199d}:null;}})[_0x323a('0x23')](respondWithResult(_0x493d73,null))['catch'](handleError(_0x493d73,null));};exports['addLists']=function(_0x1a9eed,_0x492b8a,_0x4a6e1d){var _0x29f535,_0x3d09e6;var _0x33cc63=[];var _0x16929e=moment()[_0x323a('0x65')](_0x323a('0x66'));return db[_0x323a('0x2d')]['find']({'where':{'id':_0x1a9eed[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x492b8a,null))[_0x323a('0x23')](function(_0x2be4bc){if(_0x2be4bc){_0x3d09e6=_0x2be4bc;return _0x2be4bc[_0x323a('0x67')](_0x1a9eed[_0x323a('0x4d')][_0x323a('0x68')],_['omit'](_0x1a9eed[_0x323a('0x4d')],[_0x323a('0x68'),'id'])||{});}return null;})[_0x323a('0x69')](function(_0x2abb88){var _0x129240;var _0x2ab78e;_0x29f535=_0x2abb88||[];var _0x4e64e3=[];if(_0x2abb88){for(var _0x597e98=0x0;_0x597e98<_0x2abb88[_0x323a('0x38')];_0x597e98+=0x1){var _0x29f2db=_0x2abb88[_0x597e98][_0x323a('0x24')]({'plain':!![]});_0x3d09e6[_0x323a('0x6a')]=_0x1a9eed[_0x323a('0x4d')][_0x323a('0x6a')]?_0x1a9eed[_0x323a('0x4d')][_0x323a('0x6a')]:_0x3d09e6['dialCheckDuplicateType'];switch(_0x3d09e6[_0x323a('0x6a')]){case _0x323a('0x6b'):_0x129240=squel[_0x323a('0x6c')]()['into'](_0x323a('0x6d'))[_0x323a('0x6e')](['phone',_0x323a('0x6f'),_0x323a('0x70'),_0x323a('0x71'),'CampaignId',_0x323a('0x56'),'updatedAt'],squel[_0x323a('0x72')]()[_0x323a('0x73')](_0x323a('0x74'),_0x323a('0x74'))[_0x323a('0x73')](_0x323a('0x75'),_0x323a('0x6f'))[_0x323a('0x73')]('id','ContactId')[_0x323a('0x73')](_0x29f2db[_0x323a('0x76')][_0x323a('0x77')](),_0x323a('0x71'))[_0x323a('0x73')](_0x1a9eed['params']['id'][_0x323a('0x77')](),'CampaignId')['field']('\x27'+_0x16929e+'\x27',_0x323a('0x56'))['field']('\x27'+_0x16929e+'\x27',_0x323a('0x57'))[_0x323a('0x78')](_0x323a('0x79'))[_0x323a('0x3d')]('deletedAt\x20IS\x20NULL')[_0x323a('0x3d')](_0x323a('0x7a'),_0x29f2db[_0x323a('0x76')][_0x323a('0x77')]())[_0x323a('0x3d')](_0x323a('0x7b'))[_0x323a('0x3d')](_0x323a('0x7c'),squel[_0x323a('0x72')]()[_0x323a('0x73')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x323a('0x7d'))[_0x323a('0x3d')](_0x323a('0x7e'),_0x1a9eed[_0x323a('0x48')]['id'][_0x323a('0x77')]()))[_0x323a('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x323a('0x7f'))[_0x323a('0x78')](_0x323a('0x6d'))['where'](_0x323a('0x7e'),_0x1a9eed[_0x323a('0x48')]['id']['toString']())))[_0x323a('0x77')]();break;case'onlyIfOpen':_0x129240=squel[_0x323a('0x6c')]()[_0x323a('0x80')](_0x323a('0x6d'))['fromQuery']([_0x323a('0x74'),_0x323a('0x6f'),'ContactId','ListId','CampaignId',_0x323a('0x56'),_0x323a('0x57')],squel[_0x323a('0x72')]()[_0x323a('0x73')](_0x323a('0x74'),_0x323a('0x74'))['field']('NOW()',_0x323a('0x6f'))['field']('id',_0x323a('0x70'))[_0x323a('0x73')](_0x29f2db[_0x323a('0x76')][_0x323a('0x77')](),_0x323a('0x71'))[_0x323a('0x73')](_0x1a9eed[_0x323a('0x48')]['id'][_0x323a('0x77')](),_0x323a('0x5f'))[_0x323a('0x73')]('\x27'+_0x16929e+'\x27','createdAt')[_0x323a('0x73')]('\x27'+_0x16929e+'\x27',_0x323a('0x57'))['from'](_0x323a('0x79'))[_0x323a('0x3d')](_0x323a('0x81'))[_0x323a('0x3d')](_0x323a('0x7a'),_0x29f2db[_0x323a('0x76')][_0x323a('0x77')]())[_0x323a('0x3d')](_0x323a('0x7b'))[_0x323a('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x323a('0x72')]()[_0x323a('0x73')]('COALESCE(phone,\x27\x27)')[_0x323a('0x78')](_0x323a('0x6d'))['where'](_0x323a('0x7e'),_0x1a9eed[_0x323a('0x48')]['id']['toString']())))[_0x323a('0x77')]();break;default:_0x129240=squel[_0x323a('0x6c')]()['into'](_0x323a('0x6d'))['fromQuery'](['phone','scheduledAt','ContactId','ListId','CampaignId','createdAt',_0x323a('0x57')],squel[_0x323a('0x72')]()[_0x323a('0x73')]('phone','phone')[_0x323a('0x73')]('NOW()',_0x323a('0x6f'))[_0x323a('0x73')]('id',_0x323a('0x70'))['field'](_0x29f2db[_0x323a('0x76')][_0x323a('0x77')](),'ListId')['field'](_0x1a9eed[_0x323a('0x48')]['id'][_0x323a('0x77')](),_0x323a('0x5f'))[_0x323a('0x73')]('\x27'+_0x16929e+'\x27',_0x323a('0x56'))['field']('\x27'+_0x16929e+'\x27','updatedAt')[_0x323a('0x78')](_0x323a('0x79'))[_0x323a('0x3d')](_0x323a('0x81'))[_0x323a('0x3d')](_0x323a('0x7a'),_0x29f2db['CmListId'][_0x323a('0x77')]())[_0x323a('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x323a('0x77')]();}_0x2ab78e=squel[_0x323a('0x6c')]()[_0x323a('0x80')](_0x323a('0x82'))['fromQuery'](['cmHopperId',_0x323a('0x6f'),_0x323a('0x74'),_0x323a('0x83'),'createdAt','updatedAt'],squel['select']()[_0x323a('0x73')](_0x323a('0x84'),'id')['field'](_0x323a('0x75'),'scheduledAt')[_0x323a('0x73')]('ci.item','phone')['field'](_0x323a('0x85'),_0x323a('0x83'))[_0x323a('0x73')]('\x27'+_0x16929e+'\x27',_0x323a('0x56'))[_0x323a('0x73')]('\x27'+_0x16929e+'\x27',_0x323a('0x57'))[_0x323a('0x78')]('cm_contact_has_items','ci')[_0x323a('0x86')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x323a('0x3d')](_0x323a('0x87'),_0x29f2db[_0x323a('0x76')][_0x323a('0x77')]())[_0x323a('0x3d')](_0x323a('0x88'),_0x1a9eed[_0x323a('0x48')]['id'][_0x323a('0x77')]())['where'](_0x323a('0x89'),_0x16929e))[_0x323a('0x77')]();_0x4e64e3[_0x323a('0x8a')](db[_0x323a('0x8b')][_0x323a('0x35')](_0x129240));_0x33cc63[_0x323a('0x8a')](db['sequelize']['query'](_0x2ab78e));}return BPromise[_0x323a('0x8c')](_0x4e64e3);}})[_0x323a('0x23')](function(){return BPromise[_0x323a('0x8c')](_0x33cc63);})[_0x323a('0x23')](function(){return _0x29f535;})[_0x323a('0x23')](respondWithResult(_0x492b8a,null))[_0x323a('0x4b')](handleError(_0x492b8a,null));};exports[_0x323a('0x8d')]=function(_0x6b45a,_0x5bf9dc,_0x569182){return db[_0x323a('0x2d')][_0x323a('0x4a')]({'where':{'id':_0x6b45a[_0x323a('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bf9dc,null))[_0x323a('0x23')](function(_0x53bf3f){if(_0x53bf3f){return _0x53bf3f[_0x323a('0x8d')](_0x6b45a[_0x323a('0x35')]['ids']);}})[_0x323a('0x23')](function(_0x7071a){if(_0x7071a){return db['CmHopper'][_0x323a('0x22')]({'where':{'ListId':_0x6b45a[_0x323a('0x35')]['ids'],'CampaignId':_0x6b45a['params']['id']}})[_0x323a('0x23')](function(){return _0x7071a;});}})[_0x323a('0x23')](respondWithStatusCode(_0x5bf9dc,null))[_0x323a('0x4b')](handleError(_0x5bf9dc,null));};exports['getBlackLists']=function(_0x527f76,_0xb02c4,_0x536a33){var _0x3e43dd={};var _0x271c45={};var _0x53de48;var _0xdef9ba;return db[_0x323a('0x2d')][_0x323a('0x5a')]({'where':{'id':_0x527f76[_0x323a('0x48')]['id']}})['then'](handleEntityNotFound(_0xb02c4,null))[_0x323a('0x23')](function(_0x1e1b2a){if(_0x1e1b2a){_0x53de48=_0x1e1b2a;_0x271c45[_0x323a('0x31')]=_[_0x323a('0x32')](db[_0x323a('0x64')][_0x323a('0x49')]);_0x271c45[_0x323a('0x35')]=_[_0x323a('0x32')](_0x527f76[_0x323a('0x35')]);_0x271c45['filters']=_[_0x323a('0x34')](_0x271c45[_0x323a('0x31')],_0x271c45[_0x323a('0x35')]);_0x3e43dd[_0x323a('0x36')]=_[_0x323a('0x34')](_0x271c45[_0x323a('0x31')],qs['fields'](_0x527f76['query'][_0x323a('0x37')]));_0x3e43dd[_0x323a('0x36')]=_0x3e43dd[_0x323a('0x36')]['length']?_0x3e43dd[_0x323a('0x36')]:_0x271c45[_0x323a('0x31')];_0x3e43dd[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x527f76[_0x323a('0x35')][_0x323a('0x3c')]);_0x3e43dd['where']=qs['filters'](_[_0x323a('0x5c')](_0x527f76[_0x323a('0x35')],_0x271c45['filters']));if(_0x527f76[_0x323a('0x35')][_0x323a('0x3e')]){_0x3e43dd['where']=_['merge'](_0x3e43dd[_0x323a('0x3d')],{'$or':_[_0x323a('0x40')](_0x3e43dd[_0x323a('0x36')],function(_0x4d2b90){var _0xd16304={};_0xd16304[_0x4d2b90]={'$like':'%'+_0x527f76['query'][_0x323a('0x3e')]+'%'};return _0xd16304;})});}_0x3e43dd=_[_0x323a('0x3f')]({},_0x3e43dd,_0x527f76['options']);return _0x53de48[_0x323a('0x8e')](_0x3e43dd);}})[_0x323a('0x23')](function(_0x117890){if(_0x117890){_0xdef9ba=_0x117890['length'];if(!_0x527f76[_0x323a('0x35')][_0x323a('0x39')]('nolimit')){_0x3e43dd[_0x323a('0x1b')]=qs['limit'](_0x527f76[_0x323a('0x35')][_0x323a('0x1b')]);_0x3e43dd[_0x323a('0x1d')]=qs['offset'](_0x527f76['query']['offset']);}return _0x53de48[_0x323a('0x8e')](_0x3e43dd);}})[_0x323a('0x23')](function(_0x2ad176){if(_0x2ad176){return _0x2ad176?{'count':_0xdef9ba,'rows':_0x2ad176}:null;}})[_0x323a('0x23')](respondWithResult(_0xb02c4,null))['catch'](handleError(_0xb02c4,null));};exports[_0x323a('0x8f')]=function(_0x5a19c6,_0x160ede,_0x14d9a0){var _0x4101aa,_0x5d5645;var _0x1a459a=[];var _0x5bdf97=moment()[_0x323a('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x323a('0x2d')][_0x323a('0x4a')]({'where':{'id':_0x5a19c6[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x160ede,null))['then'](function(_0x5c5d24){if(_0x5c5d24){_0x5d5645=_0x5c5d24;return _0x5c5d24[_0x323a('0x8f')](_0x5a19c6['body']['ids'],_[_0x323a('0x55')](_0x5a19c6[_0x323a('0x4d')],[_0x323a('0x68'),'id'])||{});}return null;})['spread'](function(_0x12479a){var _0x2b5aa0;var _0x113e4b;_0x4101aa=_0x12479a||[];var _0x4e65aa=[];if(_0x12479a){for(var _0x56c61e=0x0;_0x56c61e<_0x12479a[_0x323a('0x38')];_0x56c61e+=0x1){var _0xc0ede7=_0x12479a[_0x56c61e][_0x323a('0x24')]({'plain':!![]});_0x2b5aa0=squel[_0x323a('0x6c')]()[_0x323a('0x80')](_0x323a('0x90'))[_0x323a('0x6e')]([_0x323a('0x74'),_0x323a('0x70'),_0x323a('0x71'),_0x323a('0x5f'),'createdAt','updatedAt'],squel[_0x323a('0x72')]()[_0x323a('0x73')]('phone','phone')[_0x323a('0x73')]('id',_0x323a('0x70'))['field'](_0xc0ede7['CmListId'][_0x323a('0x77')](),_0x323a('0x71'))[_0x323a('0x73')](_0x5a19c6['params']['id'][_0x323a('0x77')](),_0x323a('0x5f'))[_0x323a('0x73')](_0x323a('0x75'),_0x323a('0x56'))[_0x323a('0x73')]('NOW()',_0x323a('0x57'))[_0x323a('0x78')](_0x323a('0x79'))[_0x323a('0x3d')](_0x323a('0x81'))['where'](_0x323a('0x7a'),_0xc0ede7[_0x323a('0x76')][_0x323a('0x77')]())[_0x323a('0x3d')](_0x323a('0x7b')))[_0x323a('0x77')]();_0x4e65aa[_0x323a('0x8a')](db[_0x323a('0x8b')]['query'](_0x2b5aa0));}return BPromise[_0x323a('0x8c')](_0x4e65aa);}})[_0x323a('0x23')](function(){return _0x4101aa;})[_0x323a('0x23')](respondWithResult(_0x160ede,null))[_0x323a('0x4b')](handleError(_0x160ede,null));};exports[_0x323a('0x91')]=function(_0xbdb1e8,_0x213094,_0x21fea6){return db[_0x323a('0x2d')]['find']({'where':{'id':_0xbdb1e8[_0x323a('0x48')]['id']}})['then'](handleEntityNotFound(_0x213094,null))[_0x323a('0x23')](function(_0x39e4f2){if(_0x39e4f2){return _0x39e4f2[_0x323a('0x91')](_0xbdb1e8['query'][_0x323a('0x68')]);}})['then'](function(_0x21e4cd){if(_0x21e4cd){return db[_0x323a('0x62')][_0x323a('0x22')]({'where':{'ListId':_0xbdb1e8[_0x323a('0x35')][_0x323a('0x68')],'CampaignId':_0xbdb1e8[_0x323a('0x48')]['id']}})['then'](function(){return _0x21e4cd;});}})['then'](respondWithStatusCode(_0x213094,null))[_0x323a('0x4b')](handleError(_0x213094,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index b048105..6c120cf 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x545312,_0x563053){var _0x52bc56=function(_0x14a75d){while(--_0x14a75d){_0x545312['push'](_0x545312['shift']());}};_0x52bc56(++_0x563053);}(_0x7a54,0x106));var _0x47a5=function(_0x317555,_0x452338){_0x317555=_0x317555-0x0;var _0x42cd7d=_0x7a54[_0x317555];return _0x42cd7d;};'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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x10abf1,_0x5e3238){var _0xab622a=function(_0x3b7eed){while(--_0x3b7eed){_0x10abf1['push'](_0x10abf1['shift']());}};_0xab622a(++_0x5e3238);}(_0x7a54,0x106));var _0x47a5=function(_0x508de5,_0x4f7b81){_0x508de5=_0x508de5-0x0;var _0x11faa3=_0x7a54[_0x508de5];return _0x11faa3;};'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 diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 3f93eb9..d5de3b6 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0531=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCampaign','Campaign','options','raw','where','limit','map','include','model','attributes','debug','catch','lodash','util'];(function(_0x58d253,_0x130aea){var _0x536b8a=function(_0xdf2efc){while(--_0xdf2efc){_0x58d253['push'](_0x58d253['shift']());}};_0x536b8a(++_0x130aea);}(_0x0531,0xde));var _0x1053=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0x0531[_0x21c6b8];return _0x39d474;};'use strict';var _=require(_0x1053('0x0'));var util=require(_0x1053('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1053('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1053('0x3'));var logger=require(_0x1053('0x4'))(_0x1053('0x5'));var config=require(_0x1053('0x6'));var jayson=require(_0x1053('0x7'));var client=jayson[_0x1053('0x8')][_0x1053('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3350a0,_0x206a55,_0x3d052e){return new BPromise(function(_0x4f1877,_0x3045a7){return client[_0x1053('0xa')](_0x3350a0,_0x3d052e)[_0x1053('0xb')](function(_0x5a906b){logger[_0x1053('0xc')](_0x1053('0xd'),_0x206a55,_0x1053('0xe'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x206a55,_0x1053('0xe'),JSON[_0x1053('0xf')](_0x5a906b));if(_0x5a906b['error']){if(_0x5a906b[_0x1053('0x10')][_0x1053('0x11')]===0x1f4){logger[_0x1053('0x10')](_0x1053('0xd'),_0x206a55,_0x5a906b[_0x1053('0x10')][_0x1053('0x12')]);return _0x3045a7(_0x5a906b[_0x1053('0x10')][_0x1053('0x12')]);}logger[_0x1053('0x10')](_0x1053('0xd'),_0x206a55,_0x5a906b['error']['message']);return _0x4f1877(_0x5a906b[_0x1053('0x10')][_0x1053('0x12')]);}else{logger[_0x1053('0xc')]('Campaign,\x20%s,\x20%s',_0x206a55,'request\x20sent');_0x4f1877(_0x5a906b[_0x1053('0x13')][_0x1053('0x12')]);}})['catch'](function(_0x5d1ff5){logger[_0x1053('0x10')](_0x1053('0xd'),_0x206a55,_0x5d1ff5);_0x3045a7(_0x5d1ff5);});});}exports[_0x1053('0x14')]=function(_0x26c285){var _0x5301fc=this;return new Promise(function(_0x3523c0,_0x30e687){return db[_0x1053('0x15')]['findAll']({'raw':_0x26c285[_0x1053('0x16')]?_0x26c285['options'][_0x1053('0x17')]===undefined?!![]:![]:!![],'where':_0x26c285['options']?_0x26c285['options'][_0x1053('0x18')]||null:null,'attributes':_0x26c285[_0x1053('0x16')]?_0x26c285[_0x1053('0x16')]['attributes']||null:null,'limit':_0x26c285['options']?_0x26c285[_0x1053('0x16')][_0x1053('0x19')]||null:null,'include':_0x26c285[_0x1053('0x16')]?_0x26c285[_0x1053('0x16')]['include']?_[_0x1053('0x1a')](_0x26c285['options'][_0x1053('0x1b')],function(_0x485f14){return{'model':db[_0x485f14[_0x1053('0x1c')]],'as':_0x485f14['as'],'attributes':_0x485f14['attributes'],'include':_0x485f14['include']?_['map'](_0x485f14['include'],function(_0x3dc2c0){return{'model':db[_0x3dc2c0['model']],'as':_0x3dc2c0['as'],'attributes':_0x3dc2c0[_0x1053('0x1d')],'include':_0x3dc2c0[_0x1053('0x1b')]?_[_0x1053('0x1a')](_0x3dc2c0[_0x1053('0x1b')],function(_0x1132f){return{'model':db[_0x1132f[_0x1053('0x1c')]],'as':_0x1132f['as'],'attributes':_0x1132f[_0x1053('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x391194){logger['info'](_0x1053('0x14'),_0x26c285);logger[_0x1053('0x1e')](_0x1053('0x14'),_0x26c285,JSON[_0x1053('0xf')](_0x391194));_0x3523c0(_0x391194);})[_0x1053('0x1f')](function(_0x22cf83){logger[_0x1053('0x10')](_0x1053('0x14'),_0x22cf83[_0x1053('0x12')],_0x26c285);_0x30e687(_0x5301fc[_0x1053('0x10')](0x1f4,_0x22cf83[_0x1053('0x12')]));});});}; \ No newline at end of file +var _0x76dc=['error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0x76dc,0x1f2));var _0xc76d=function(_0x386db2,_0x4992c2){_0x386db2=_0x386db2-0x0;var _0x15c61f=_0x76dc[_0x386db2];return _0x15c61f;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var moment=require(_0xc76d('0x2'));var BPromise=require(_0xc76d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc76d('0x4'));var db=require(_0xc76d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc76d('0x7'));var client=jayson[_0xc76d('0x8')][_0xc76d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4832bd,_0x4ce0bd,_0x119f38){return new BPromise(function(_0x114572,_0x18574f){return client['request'](_0x4832bd,_0x119f38)['then'](function(_0x1dc996){logger[_0xc76d('0xa')]('Campaign,\x20%s,\x20%s',_0x4ce0bd,_0xc76d('0xb'));logger['debug'](_0xc76d('0xc'),_0x4ce0bd,_0xc76d('0xb'),JSON[_0xc76d('0xd')](_0x1dc996));if(_0x1dc996[_0xc76d('0xe')]){if(_0x1dc996[_0xc76d('0xe')][_0xc76d('0xf')]===0x1f4){logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);return _0x18574f(_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);}logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996['error'][_0xc76d('0x11')]);return _0x114572(_0x1dc996[_0xc76d('0xe')]['message']);}else{logger[_0xc76d('0xa')](_0xc76d('0x10'),_0x4ce0bd,_0xc76d('0xb'));_0x114572(_0x1dc996[_0xc76d('0x12')]['message']);}})[_0xc76d('0x13')](function(_0x5d881c){logger['error'](_0xc76d('0x10'),_0x4ce0bd,_0x5d881c);_0x18574f(_0x5d881c);});});}exports[_0xc76d('0x14')]=function(_0x339623){var _0x23f3ca=this;return new Promise(function(_0xd1d16f,_0x4b0402){return db[_0xc76d('0x15')][_0xc76d('0x16')]({'raw':_0x339623[_0xc76d('0x17')]?_0x339623[_0xc76d('0x17')][_0xc76d('0x18')]===undefined?!![]:![]:!![],'where':_0x339623['options']?_0x339623[_0xc76d('0x17')][_0xc76d('0x19')]||null:null,'attributes':_0x339623['options']?_0x339623[_0xc76d('0x17')][_0xc76d('0x1a')]||null:null,'limit':_0x339623[_0xc76d('0x17')]?_0x339623[_0xc76d('0x17')][_0xc76d('0x1b')]||null:null,'include':_0x339623[_0xc76d('0x17')]?_0x339623[_0xc76d('0x17')][_0xc76d('0x1c')]?_[_0xc76d('0x1d')](_0x339623[_0xc76d('0x17')][_0xc76d('0x1c')],function(_0x5de11f){return{'model':db[_0x5de11f[_0xc76d('0x1e')]],'as':_0x5de11f['as'],'attributes':_0x5de11f[_0xc76d('0x1a')],'include':_0x5de11f['include']?_[_0xc76d('0x1d')](_0x5de11f[_0xc76d('0x1c')],function(_0x55ca79){return{'model':db[_0x55ca79[_0xc76d('0x1e')]],'as':_0x55ca79['as'],'attributes':_0x55ca79[_0xc76d('0x1a')],'include':_0x55ca79[_0xc76d('0x1c')]?_[_0xc76d('0x1d')](_0x55ca79[_0xc76d('0x1c')],function(_0x1949c4){return{'model':db[_0x1949c4[_0xc76d('0x1e')]],'as':_0x1949c4['as'],'attributes':_0x1949c4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x285430){logger[_0xc76d('0xa')]('GetCampaign',_0x339623);logger[_0xc76d('0x1f')](_0xc76d('0x14'),_0x339623,JSON[_0xc76d('0xd')](_0x285430));_0xd1d16f(_0x285430);})['catch'](function(_0x2039f4){logger['error'](_0xc76d('0x14'),_0x2039f4[_0xc76d('0x11')],_0x339623);_0x4b0402(_0x23f3ca['error'](0x1f4,_0x2039f4[_0xc76d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 1d5edeb..1a359a4 100644 --- a/server/api/campaign/index.js +++ b/server/api/campaign/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedef=['delete','destroy','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','get','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','post','create','/:id/clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xedef,0xd6));var _0xfede=function(_0x4dd7b9,_0x30ed0e){_0x4dd7b9=_0x4dd7b9-0x0;var _0x49e499=_0xedef[_0x4dd7b9];return _0x49e499;};'use strict';var multer=require(_0xfede('0x0'));var util=require(_0xfede('0x1'));var path=require(_0xfede('0x2'));var timeout=require(_0xfede('0x3'));var express=require(_0xfede('0x4'));var router=express[_0xfede('0x5')]();var fs_extra=require(_0xfede('0x6'));var auth=require(_0xfede('0x7'));var interaction=require(_0xfede('0x8'));var config=require(_0xfede('0x9'));var controller=require(_0xfede('0xa'));router['get']('/',auth[_0xfede('0xb')](),controller[_0xfede('0xc')]);router['get'](_0xfede('0xd'),auth[_0xfede('0xb')](),controller['show']);router[_0xfede('0xe')](_0xfede('0xf'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xfede('0xe')]('/:id/hopper_histories',auth[_0xfede('0xb')](),controller[_0xfede('0x10')]);router[_0xfede('0xe')](_0xfede('0x11'),auth['isAuthenticated'](),controller[_0xfede('0x12')]);router[_0xfede('0xe')](_0xfede('0x13'),auth[_0xfede('0xb')](),controller[_0xfede('0x14')]);router[_0xfede('0xe')]('/:id/lists',auth[_0xfede('0xb')](),controller[_0xfede('0x15')]);router[_0xfede('0xe')]('/:id/blacklists',auth[_0xfede('0xb')](),controller['getBlackLists']);router[_0xfede('0x16')]('/',auth[_0xfede('0xb')](),controller[_0xfede('0x17')]);router['post'](_0xfede('0x18'),auth[_0xfede('0xb')](),controller['clone']);router[_0xfede('0x16')](_0xfede('0x19'),auth['isAuthenticated'](),controller[_0xfede('0x1a')]);router[_0xfede('0x16')](_0xfede('0x1b'),auth['isAuthenticated'](),controller[_0xfede('0x1c')]);router[_0xfede('0x1d')](_0xfede('0xd'),auth[_0xfede('0xb')](),controller[_0xfede('0x1e')]);router[_0xfede('0x1f')](_0xfede('0xd'),auth[_0xfede('0xb')](),controller[_0xfede('0x20')]);router[_0xfede('0x1f')](_0xfede('0x19'),auth['isAuthenticated'](),controller['removeLists']);router[_0xfede('0x1f')](_0xfede('0x1b'),auth[_0xfede('0xb')](),controller[_0xfede('0x21')]);module[_0xfede('0x22')]=router; \ No newline at end of file +var _0xa711=['post','create','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','get','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','getBlackLists'];(function(_0x1651d5,_0x41f59f){var _0x22647d=function(_0x5d7e50){while(--_0x5d7e50){_0x1651d5['push'](_0x1651d5['shift']());}};_0x22647d(++_0x41f59f);}(_0xa711,0x6e));var _0x1a71=function(_0x56ffa2,_0x539043){_0x56ffa2=_0x56ffa2-0x0;var _0x1141b2=_0xa711[_0x56ffa2];return _0x1141b2;};'use strict';var multer=require(_0x1a71('0x0'));var util=require(_0x1a71('0x1'));var path=require('path');var timeout=require(_0x1a71('0x2'));var express=require(_0x1a71('0x3'));var router=express[_0x1a71('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a71('0x5'));var interaction=require(_0x1a71('0x6'));var config=require(_0x1a71('0x7'));var controller=require(_0x1a71('0x8'));router['get']('/',auth[_0x1a71('0x9')](),controller['index']);router[_0x1a71('0xa')](_0x1a71('0xb'),auth[_0x1a71('0x9')](),controller['show']);router['get'](_0x1a71('0xc'),auth['isAuthenticated'](),controller[_0x1a71('0xd')]);router[_0x1a71('0xa')]('/:id/hopper_histories',auth[_0x1a71('0x9')](),controller[_0x1a71('0xe')]);router[_0x1a71('0xa')](_0x1a71('0xf'),auth[_0x1a71('0x9')](),controller['getHopperFinals']);router[_0x1a71('0xa')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x1a71('0x10')]);router[_0x1a71('0xa')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x1a71('0xa')]('/:id/blacklists',auth[_0x1a71('0x9')](),controller[_0x1a71('0x11')]);router[_0x1a71('0x12')]('/',auth[_0x1a71('0x9')](),controller[_0x1a71('0x13')]);router[_0x1a71('0x12')]('/:id/clone',auth['isAuthenticated'](),controller[_0x1a71('0x14')]);router[_0x1a71('0x12')](_0x1a71('0x15'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x16')]);router['post'](_0x1a71('0x17'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x18')]);router[_0x1a71('0x19')](_0x1a71('0xb'),auth['isAuthenticated'](),controller[_0x1a71('0x1a')]);router[_0x1a71('0x1b')](_0x1a71('0xb'),auth['isAuthenticated'](),controller[_0x1a71('0x1c')]);router[_0x1a71('0x1b')](_0x1a71('0x15'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x1d')]);router['delete']('/:id/blacklists',auth[_0x1a71('0x9')](),controller[_0x1a71('0x1e')]);module[_0x1a71('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 60d6fa7..f5868fb 100644 --- a/server/api/cannedAnswer/cannedAnswer.attributes.js +++ b/server/api/cannedAnswer/cannedAnswer.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9970=['exports','STRING','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x49b14d,_0x578d07){var _0x3d2488=function(_0x5a8668){while(--_0x5a8668){_0x49b14d['push'](_0x49b14d['shift']());}};_0x3d2488(++_0x578d07);}(_0x9970,0x1aa));var _0x0997=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x9970[_0xbe200f];return _0x192597;};'use strict';var Sequelize=require(_0x0997('0x0'));module[_0x0997('0x1')]={'key':{'type':Sequelize[_0x0997('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0997('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x0997('0x2')]},'name':{'type':Sequelize[_0x0997('0x4')],'get':function(){return this[_0x0997('0x5')](_0x0997('0x6'));}}}; \ No newline at end of file +var _0x772a=['getDataValue','key','sequelize','exports','STRING','VIRTUAL'];(function(_0x11b9b1,_0x3cfc5b){var _0x4f2aa0=function(_0x219a1e){while(--_0x219a1e){_0x11b9b1['push'](_0x11b9b1['shift']());}};_0x4f2aa0(++_0x3cfc5b);}(_0x772a,0xf2));var _0xa772=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x772a[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xa772('0x0'));module[_0xa772('0x1')]={'key':{'type':Sequelize[_0xa772('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa772('0x3')],'get':function(){return this[_0xa772('0x4')](_0xa772('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 9d940c1..b8dbf36 100644 --- a/server/api/cannedAnswer/cannedAnswer.controller.js +++ b/server/api/cannedAnswer/cannedAnswer.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x388d=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','get','CannedAnswers','UserProfileResource','then','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','options','includeAll','include','rows','catch','show','params','keys','intersection','find','body','destroy','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','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','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x28f658,_0x5a40fa){var _0x2022bc=function(_0x4e7a66){while(--_0x4e7a66){_0x28f658['push'](_0x28f658['shift']());}};_0x2022bc(++_0x5a40fa);}(_0x388d,0xa2));var _0xd388=function(_0x113ca8,_0x3bc9fe){_0x113ca8=_0x113ca8-0x0;var _0x41e123=_0x388d[_0x113ca8];return _0x41e123;};'use strict';var emlformat=require(_0xd388('0x0'));var rimraf=require(_0xd388('0x1'));var zipdir=require(_0xd388('0x2'));var jsonpatch=require(_0xd388('0x3'));var rp=require(_0xd388('0x4'));var moment=require(_0xd388('0x5'));var BPromise=require(_0xd388('0x6'));var Mustache=require(_0xd388('0x7'));var util=require(_0xd388('0x8'));var path=require(_0xd388('0x9'));var sox=require(_0xd388('0xa'));var csv=require(_0xd388('0xb'));var ejs=require(_0xd388('0xc'));var fs=require('fs');var fs_extra=require(_0xd388('0xd'));var _=require(_0xd388('0xe'));var squel=require(_0xd388('0xf'));var crypto=require(_0xd388('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd388('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd388('0x12'));var Papa=require(_0xd388('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd388('0x14'));var as=require(_0xd388('0x15'));var hardwareService=require(_0xd388('0x16'));var logger=require(_0xd388('0x17'))(_0xd388('0x18'));var utils=require(_0xd388('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xd388('0x1a'));var db=require(_0xd388('0x1b'))['db'];function respondWithStatusCode(_0x1b099c,_0x3de1cb){_0x3de1cb=_0x3de1cb||0xcc;return function(_0x27af84){if(_0x27af84){return _0x1b099c[_0xd388('0x1c')](_0x3de1cb);}return _0x1b099c[_0xd388('0x1d')](_0x3de1cb)[_0xd388('0x1e')]();};}function respondWithResult(_0x29ad6c,_0x3ec05a){_0x3ec05a=_0x3ec05a||0xc8;return function(_0x3dfd55){if(_0x3dfd55){return _0x29ad6c[_0xd388('0x1d')](_0x3ec05a)[_0xd388('0x1f')](_0x3dfd55);}};}function respondWithFilteredResult(_0xd49de4,_0xef83a6){return function(_0x68bb95){if(_0x68bb95){var _0xbd9c88=typeof _0xef83a6['offset']===_0xd388('0x20')&&typeof _0xef83a6[_0xd388('0x21')]===_0xd388('0x20');var _0x4e9816=_0x68bb95[_0xd388('0x22')];var _0x26ffa8=_0xbd9c88?0x0:_0xef83a6[_0xd388('0x23')];var _0x2bc9eb=_0xbd9c88?_0x68bb95[_0xd388('0x22')]:_0xef83a6[_0xd388('0x23')]+_0xef83a6[_0xd388('0x21')];var _0x547891;if(_0x2bc9eb>=_0x4e9816){_0x2bc9eb=_0x4e9816;_0x547891=0xc8;}else{_0x547891=0xce;}_0xd49de4[_0xd388('0x1d')](_0x547891);return _0xd49de4[_0xd388('0x24')](_0xd388('0x25'),_0x26ffa8+'-'+_0x2bc9eb+'/'+_0x4e9816)[_0xd388('0x1f')](_0x68bb95);}return null;};}function patchUpdates(_0x2d8c2c){return function(_0x2a937c){try{jsonpatch['apply'](_0x2a937c,_0x2d8c2c,!![]);}catch(_0x56c9a9){return BPromise[_0xd388('0x26')](_0x56c9a9);}return _0x2a937c['save']();};}function saveUpdates(_0x1cd80d,_0x1f97ac){return function(_0xf10d11){if(_0xf10d11){return _0xf10d11[_0xd388('0x27')](_0x1cd80d)['then'](function(_0x2578f7){return _0x2578f7;});}return null;};}function removeEntity(_0x49c561,_0x4259f5){return function(_0x58e4d2){if(_0x58e4d2){return _0x58e4d2['destroy']()['then'](function(){var _0x1c9721=_0x58e4d2[_0xd388('0x28')]({'plain':!![]});var _0x34757b=_0xd388('0x29');return db[_0xd388('0x2a')]['destroy']({'where':{'type':_0x34757b,'resourceId':_0x1c9721['id']}})['then'](function(){return _0x58e4d2;});})[_0xd388('0x2b')](function(){_0x49c561[_0xd388('0x1d')](0xcc)[_0xd388('0x1e')]();});}};}function handleEntityNotFound(_0x21da8f,_0x28c0d7){return function(_0x43f337){if(!_0x43f337){_0x21da8f[_0xd388('0x1c')](0x194);}return _0x43f337;};}function handleError(_0xecfbc,_0x226be4){_0x226be4=_0x226be4||0x1f4;return function(_0x2414d2){logger[_0xd388('0x2c')](_0x2414d2[_0xd388('0x2d')]);if(_0x2414d2[_0xd388('0x2e')]){delete _0x2414d2['name'];}_0xecfbc[_0xd388('0x1d')](_0x226be4)[_0xd388('0x2f')](_0x2414d2);};}exports[_0xd388('0x30')]=function(_0x31c0,_0x1e5156){var _0x41a9a5={},_0x2c75f4={},_0x2b5c3b={'count':0x0,'rows':[]};var _0x4e7cfd=_[_0xd388('0x31')](db[_0xd388('0x32')][_0xd388('0x33')],function(_0x2dfa05){return{'name':_0x2dfa05[_0xd388('0x34')],'type':_0x2dfa05[_0xd388('0x35')]['key']};});_0x2c75f4[_0xd388('0x36')]=_[_0xd388('0x31')](_0x4e7cfd,_0xd388('0x2e'));_0x2c75f4[_0xd388('0x37')]=_['keys'](_0x31c0[_0xd388('0x37')]);_0x2c75f4['filters']=_['intersection'](_0x2c75f4[_0xd388('0x36')],_0x2c75f4[_0xd388('0x37')]);_0x41a9a5['attributes']=_['intersection'](_0x2c75f4[_0xd388('0x36')],qs[_0xd388('0x38')](_0x31c0['query'][_0xd388('0x38')]));_0x41a9a5['attributes']=_0x41a9a5[_0xd388('0x39')][_0xd388('0x3a')]?_0x41a9a5[_0xd388('0x39')]:_0x2c75f4[_0xd388('0x36')];if(!_0x31c0[_0xd388('0x37')][_0xd388('0x3b')](_0xd388('0x3c'))){_0x41a9a5[_0xd388('0x21')]=qs['limit'](_0x31c0[_0xd388('0x37')][_0xd388('0x21')]);_0x41a9a5[_0xd388('0x23')]=qs[_0xd388('0x23')](_0x31c0[_0xd388('0x37')][_0xd388('0x23')]);}_0x41a9a5[_0xd388('0x3d')]=qs[_0xd388('0x3e')](_0x31c0[_0xd388('0x37')][_0xd388('0x3e')]);_0x41a9a5['where']=qs['filters'](_[_0xd388('0x3f')](_0x31c0['query'],_0x2c75f4[_0xd388('0x40')]),_0x4e7cfd);if(_0x31c0[_0xd388('0x37')][_0xd388('0x41')]){_0x41a9a5[_0xd388('0x42')]=_['merge'](_0x41a9a5['where'],{'$or':[{'key':{'$like':'%'+_0x31c0[_0xd388('0x37')]['filter']+'%'}},{'value':{'$like':'%'+_0x31c0[_0xd388('0x37')][_0xd388('0x41')]+'%'}}]});}_0x41a9a5=_['merge']({},_0x41a9a5,_0x31c0[_0xd388('0x43')]);var _0x5ca8a7={'where':_0x41a9a5['where']};return db[_0xd388('0x32')]['count'](_0x5ca8a7)[_0xd388('0x2b')](function(_0x435032){_0x2b5c3b[_0xd388('0x22')]=_0x435032;if(_0x31c0[_0xd388('0x37')][_0xd388('0x44')]){_0x41a9a5[_0xd388('0x45')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x41a9a5);})[_0xd388('0x2b')](function(_0x4d2f67){_0x2b5c3b[_0xd388('0x46')]=_0x4d2f67;return _0x2b5c3b;})[_0xd388('0x2b')](respondWithFilteredResult(_0x1e5156,_0x41a9a5))[_0xd388('0x47')](handleError(_0x1e5156,null));};exports[_0xd388('0x48')]=function(_0x2db608,_0x3ec54c){var _0x2b5809={'raw':!![],'where':{'id':_0x2db608[_0xd388('0x49')]['id']}},_0x3cda88={};_0x3cda88['model']=_['keys'](db[_0xd388('0x32')][_0xd388('0x33')]);_0x3cda88[_0xd388('0x37')]=_[_0xd388('0x4a')](_0x2db608[_0xd388('0x37')]);_0x3cda88['filters']=_[_0xd388('0x4b')](_0x3cda88[_0xd388('0x36')],_0x3cda88[_0xd388('0x37')]);_0x2b5809[_0xd388('0x39')]=_[_0xd388('0x4b')](_0x3cda88[_0xd388('0x36')],qs[_0xd388('0x38')](_0x2db608[_0xd388('0x37')][_0xd388('0x38')]));_0x2b5809[_0xd388('0x39')]=_0x2b5809[_0xd388('0x39')][_0xd388('0x3a')]?_0x2b5809[_0xd388('0x39')]:_0x3cda88['model'];if(_0x2db608[_0xd388('0x37')][_0xd388('0x44')]){_0x2b5809[_0xd388('0x45')]=[{'all':!![]}];}_0x2b5809=_['merge']({},_0x2b5809,_0x2db608['options']);return db[_0xd388('0x32')][_0xd388('0x4c')](_0x2b5809)[_0xd388('0x2b')](handleEntityNotFound(_0x3ec54c,null))['then'](respondWithResult(_0x3ec54c,null))[_0xd388('0x47')](handleError(_0x3ec54c,null));};exports[_0xd388('0x27')]=function(_0x1696fb,_0x302af7){if(_0x1696fb[_0xd388('0x4d')]['id']){delete _0x1696fb[_0xd388('0x4d')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x1696fb[_0xd388('0x49')]['id']}})[_0xd388('0x2b')](handleEntityNotFound(_0x302af7,null))[_0xd388('0x2b')](saveUpdates(_0x1696fb[_0xd388('0x4d')],null))['then'](respondWithResult(_0x302af7,null))[_0xd388('0x47')](handleError(_0x302af7,null));};exports[_0xd388('0x4e')]=function(_0x379b80,_0x51194f){return db[_0xd388('0x32')][_0xd388('0x4c')]({'where':{'id':_0x379b80[_0xd388('0x49')]['id']}})[_0xd388('0x2b')](handleEntityNotFound(_0x51194f,null))[_0xd388('0x2b')](removeEntity(_0x51194f,null))[_0xd388('0x47')](handleError(_0x51194f,null));};exports['create']=function(_0x1850d2,_0x3ef867){var _0x27aaf4={'key':_0x1850d2[_0xd388('0x4d')][_0xd388('0x4f')]};if(_0x1850d2['body'][_0xd388('0x50')]){_0x27aaf4['MailAccountId']=_0x1850d2[_0xd388('0x4d')]['MailAccountId'];}else if(_0x1850d2[_0xd388('0x4d')][_0xd388('0x51')]){_0x27aaf4[_0xd388('0x51')]=_0x1850d2['body'][_0xd388('0x51')];}else if(_0x1850d2[_0xd388('0x4d')][_0xd388('0x52')]){_0x27aaf4[_0xd388('0x52')]=_0x1850d2[_0xd388('0x4d')]['OpenchannelAccountId'];}else if(_0x1850d2['body'][_0xd388('0x53')]){_0x27aaf4[_0xd388('0x53')]=_0x1850d2[_0xd388('0x4d')]['ChatWebsiteId'];}return db[_0xd388('0x32')][_0xd388('0x4c')]({'where':_0x27aaf4})[_0xd388('0x2b')](function(_0x57c827){if(_0x57c827){throw new db[(_0xd388('0x54'))][(_0xd388('0x55'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xd388('0x32')][_0xd388('0x56')](_0x1850d2[_0xd388('0x4d')]);})[_0xd388('0x2b')](function(_0x455f63){var _0x511c4c=_0x1850d2['user'][_0xd388('0x28')]({'plain':!![]});if(!_0x511c4c)throw new Error(_0xd388('0x57'));if(_0x511c4c['role']==='user'){var _0x51b8c2=_0x455f63[_0xd388('0x28')]({'plain':!![]});return db[_0xd388('0x58')][_0xd388('0x4c')]({'where':{'name':_0xd388('0x29'),'userProfileId':_0x511c4c[_0xd388('0x59')]},'raw':!![]})['then'](function(_0xf8485c){if(_0xf8485c&&_0xf8485c[_0xd388('0x5a')]===0x0){return db[_0xd388('0x2a')][_0xd388('0x56')]({'name':_0x51b8c2[_0xd388('0x2e')],'resourceId':_0x51b8c2['id'],'type':_0xf8485c[_0xd388('0x2e')],'sectionId':_0xf8485c['id']},{})['then'](function(){return _0x455f63;});}else{return _0x455f63;}})['catch'](function(_0x43b4b8){logger['error'](_0xd388('0x5b'),_0x43b4b8);throw _0x43b4b8;});}return _0x455f63;})[_0xd388('0x2b')](respondWithResult(_0x3ef867,0xc9))[_0xd388('0x47')](handleError(_0x3ef867,null));}; \ No newline at end of file +var _0xa98b=['intersection','attributes','fields','nolimit','order','where','pick','filter','options','includeAll','include','rows','catch','show','params','keys','length','merge','find','update','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x48b5f5,_0x31038f){var _0x2d84b7=function(_0x283ae4){while(--_0x283ae4){_0x48b5f5['push'](_0x48b5f5['shift']());}};_0x2d84b7(++_0x31038f);}(_0xa98b,0x184));var _0xba98=function(_0xff317f,_0x3b22e6){_0xff317f=_0xff317f-0x0;var _0x2e8007=_0xa98b[_0xff317f];return _0x2e8007;};'use strict';var emlformat=require(_0xba98('0x0'));var rimraf=require(_0xba98('0x1'));var zipdir=require(_0xba98('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba98('0x3'));var moment=require(_0xba98('0x4'));var BPromise=require(_0xba98('0x5'));var Mustache=require(_0xba98('0x6'));var util=require(_0xba98('0x7'));var path=require(_0xba98('0x8'));var sox=require(_0xba98('0x9'));var csv=require(_0xba98('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba98('0xb'));var squel=require(_0xba98('0xc'));var crypto=require(_0xba98('0xd'));var jsforce=require(_0xba98('0xe'));var deskjs=require(_0xba98('0xf'));var toCsv=require(_0xba98('0xa'));var querystring=require(_0xba98('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xba98('0x11'));var as=require(_0xba98('0x12'));var hardwareService=require(_0xba98('0x13'));var logger=require(_0xba98('0x14'))(_0xba98('0x15'));var utils=require('../../config/utils');var config=require(_0xba98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xba98('0x17'))['db'];function respondWithStatusCode(_0x371172,_0x2e4343){_0x2e4343=_0x2e4343||0xcc;return function(_0x458b3a){if(_0x458b3a){return _0x371172[_0xba98('0x18')](_0x2e4343);}return _0x371172[_0xba98('0x19')](_0x2e4343)[_0xba98('0x1a')]();};}function respondWithResult(_0x2f2391,_0x3b0625){_0x3b0625=_0x3b0625||0xc8;return function(_0x48f949){if(_0x48f949){return _0x2f2391[_0xba98('0x19')](_0x3b0625)['json'](_0x48f949);}};}function respondWithFilteredResult(_0x12d684,_0x437c6d){return function(_0x5f43e3){if(_0x5f43e3){var _0x2b0e0d=typeof _0x437c6d[_0xba98('0x1b')]===_0xba98('0x1c')&&typeof _0x437c6d[_0xba98('0x1d')]===_0xba98('0x1c');var _0x5688d8=_0x5f43e3['count'];var _0x3cd62e=_0x2b0e0d?0x0:_0x437c6d[_0xba98('0x1b')];var _0x5bde10=_0x2b0e0d?_0x5f43e3[_0xba98('0x1e')]:_0x437c6d[_0xba98('0x1b')]+_0x437c6d[_0xba98('0x1d')];var _0x31ceaf;if(_0x5bde10>=_0x5688d8){_0x5bde10=_0x5688d8;_0x31ceaf=0xc8;}else{_0x31ceaf=0xce;}_0x12d684[_0xba98('0x19')](_0x31ceaf);return _0x12d684[_0xba98('0x1f')](_0xba98('0x20'),_0x3cd62e+'-'+_0x5bde10+'/'+_0x5688d8)[_0xba98('0x21')](_0x5f43e3);}return null;};}function patchUpdates(_0x489960){return function(_0x734699){try{jsonpatch[_0xba98('0x22')](_0x734699,_0x489960,!![]);}catch(_0x28c0c3){return BPromise['reject'](_0x28c0c3);}return _0x734699[_0xba98('0x23')]();};}function saveUpdates(_0x4c6ec0,_0x48aac9){return function(_0x18597b){if(_0x18597b){return _0x18597b['update'](_0x4c6ec0)[_0xba98('0x24')](function(_0x543c0a){return _0x543c0a;});}return null;};}function removeEntity(_0x1e0e0c,_0x49e458){return function(_0x180411){if(_0x180411){return _0x180411['destroy']()[_0xba98('0x24')](function(){var _0x3ddfdd=_0x180411['get']({'plain':!![]});var _0x4a35fd=_0xba98('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x4a35fd,'resourceId':_0x3ddfdd['id']}})[_0xba98('0x24')](function(){return _0x180411;});})[_0xba98('0x24')](function(){_0x1e0e0c[_0xba98('0x19')](0xcc)[_0xba98('0x1a')]();});}};}function handleEntityNotFound(_0x1a088d,_0x12d137){return function(_0x77ff27){if(!_0x77ff27){_0x1a088d[_0xba98('0x18')](0x194);}return _0x77ff27;};}function handleError(_0x5326d4,_0x377be8){_0x377be8=_0x377be8||0x1f4;return function(_0x64f749){logger[_0xba98('0x26')](_0x64f749[_0xba98('0x27')]);if(_0x64f749['name']){delete _0x64f749[_0xba98('0x28')];}_0x5326d4[_0xba98('0x19')](_0x377be8)[_0xba98('0x29')](_0x64f749);};}exports[_0xba98('0x2a')]=function(_0x17aefa,_0x527115){var _0x5f5af5={},_0x15dfab={},_0x3dc1c5={'count':0x0,'rows':[]};var _0x300a60=_[_0xba98('0x2b')](db[_0xba98('0x2c')][_0xba98('0x2d')],function(_0x37e757){return{'name':_0x37e757[_0xba98('0x2e')],'type':_0x37e757[_0xba98('0x2f')][_0xba98('0x30')]};});_0x15dfab[_0xba98('0x31')]=_['map'](_0x300a60,'name');_0x15dfab[_0xba98('0x32')]=_['keys'](_0x17aefa[_0xba98('0x32')]);_0x15dfab[_0xba98('0x33')]=_[_0xba98('0x34')](_0x15dfab['model'],_0x15dfab[_0xba98('0x32')]);_0x5f5af5[_0xba98('0x35')]=_[_0xba98('0x34')](_0x15dfab[_0xba98('0x31')],qs[_0xba98('0x36')](_0x17aefa[_0xba98('0x32')]['fields']));_0x5f5af5[_0xba98('0x35')]=_0x5f5af5[_0xba98('0x35')]['length']?_0x5f5af5['attributes']:_0x15dfab['model'];if(!_0x17aefa['query']['hasOwnProperty'](_0xba98('0x37'))){_0x5f5af5[_0xba98('0x1d')]=qs[_0xba98('0x1d')](_0x17aefa[_0xba98('0x32')]['limit']);_0x5f5af5[_0xba98('0x1b')]=qs[_0xba98('0x1b')](_0x17aefa[_0xba98('0x32')][_0xba98('0x1b')]);}_0x5f5af5[_0xba98('0x38')]=qs['sort'](_0x17aefa[_0xba98('0x32')]['sort']);_0x5f5af5[_0xba98('0x39')]=qs['filters'](_[_0xba98('0x3a')](_0x17aefa[_0xba98('0x32')],_0x15dfab[_0xba98('0x33')]),_0x300a60);if(_0x17aefa[_0xba98('0x32')]['filter']){_0x5f5af5['where']=_['merge'](_0x5f5af5[_0xba98('0x39')],{'$or':[{'key':{'$like':'%'+_0x17aefa[_0xba98('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x17aefa['query'][_0xba98('0x3b')]+'%'}}]});}_0x5f5af5=_['merge']({},_0x5f5af5,_0x17aefa[_0xba98('0x3c')]);var _0x25a9e8={'where':_0x5f5af5[_0xba98('0x39')]};return db[_0xba98('0x2c')][_0xba98('0x1e')](_0x25a9e8)[_0xba98('0x24')](function(_0x165e5a){_0x3dc1c5[_0xba98('0x1e')]=_0x165e5a;if(_0x17aefa[_0xba98('0x32')][_0xba98('0x3d')]){_0x5f5af5[_0xba98('0x3e')]=[{'all':!![]}];}return db[_0xba98('0x2c')]['findAll'](_0x5f5af5);})['then'](function(_0x194cb7){_0x3dc1c5[_0xba98('0x3f')]=_0x194cb7;return _0x3dc1c5;})['then'](respondWithFilteredResult(_0x527115,_0x5f5af5))[_0xba98('0x40')](handleError(_0x527115,null));};exports[_0xba98('0x41')]=function(_0x5d06f3,_0x574e36){var _0x300807={'raw':!![],'where':{'id':_0x5d06f3[_0xba98('0x42')]['id']}},_0x1e4ec5={};_0x1e4ec5['model']=_[_0xba98('0x43')](db['CannedAnswer'][_0xba98('0x2d')]);_0x1e4ec5['query']=_['keys'](_0x5d06f3[_0xba98('0x32')]);_0x1e4ec5[_0xba98('0x33')]=_[_0xba98('0x34')](_0x1e4ec5[_0xba98('0x31')],_0x1e4ec5['query']);_0x300807['attributes']=_[_0xba98('0x34')](_0x1e4ec5[_0xba98('0x31')],qs[_0xba98('0x36')](_0x5d06f3[_0xba98('0x32')][_0xba98('0x36')]));_0x300807[_0xba98('0x35')]=_0x300807[_0xba98('0x35')][_0xba98('0x44')]?_0x300807[_0xba98('0x35')]:_0x1e4ec5[_0xba98('0x31')];if(_0x5d06f3[_0xba98('0x32')]['includeAll']){_0x300807[_0xba98('0x3e')]=[{'all':!![]}];}_0x300807=_[_0xba98('0x45')]({},_0x300807,_0x5d06f3[_0xba98('0x3c')]);return db[_0xba98('0x2c')][_0xba98('0x46')](_0x300807)[_0xba98('0x24')](handleEntityNotFound(_0x574e36,null))[_0xba98('0x24')](respondWithResult(_0x574e36,null))[_0xba98('0x40')](handleError(_0x574e36,null));};exports[_0xba98('0x47')]=function(_0x958458,_0x1cfecb){if(_0x958458[_0xba98('0x48')]['id']){delete _0x958458[_0xba98('0x48')]['id'];}return db[_0xba98('0x2c')][_0xba98('0x46')]({'where':{'id':_0x958458['params']['id']}})['then'](handleEntityNotFound(_0x1cfecb,null))[_0xba98('0x24')](saveUpdates(_0x958458[_0xba98('0x48')],null))['then'](respondWithResult(_0x1cfecb,null))[_0xba98('0x40')](handleError(_0x1cfecb,null));};exports[_0xba98('0x49')]=function(_0x5e4616,_0x574327){return db['CannedAnswer'][_0xba98('0x46')]({'where':{'id':_0x5e4616[_0xba98('0x42')]['id']}})[_0xba98('0x24')](handleEntityNotFound(_0x574327,null))[_0xba98('0x24')](removeEntity(_0x574327,null))[_0xba98('0x40')](handleError(_0x574327,null));};exports[_0xba98('0x4a')]=function(_0xf2ba9a,_0x1cd4bc){var _0x1792f8={'key':_0xf2ba9a[_0xba98('0x48')][_0xba98('0x30')]};if(_0xf2ba9a[_0xba98('0x48')][_0xba98('0x4b')]){_0x1792f8[_0xba98('0x4b')]=_0xf2ba9a[_0xba98('0x48')]['MailAccountId'];}else if(_0xf2ba9a['body']['SmsAccountId']){_0x1792f8[_0xba98('0x4c')]=_0xf2ba9a[_0xba98('0x48')]['SmsAccountId'];}else if(_0xf2ba9a[_0xba98('0x48')][_0xba98('0x4d')]){_0x1792f8[_0xba98('0x4d')]=_0xf2ba9a[_0xba98('0x48')][_0xba98('0x4d')];}else if(_0xf2ba9a['body'][_0xba98('0x4e')]){_0x1792f8[_0xba98('0x4e')]=_0xf2ba9a['body']['ChatWebsiteId'];}return db['CannedAnswer'][_0xba98('0x46')]({'where':_0x1792f8})[_0xba98('0x24')](function(_0x43ee7f){if(_0x43ee7f){throw new db[(_0xba98('0x4f'))][(_0xba98('0x50'))](_0xba98('0x51'));}return db['CannedAnswer'][_0xba98('0x4a')](_0xf2ba9a[_0xba98('0x48')]);})['then'](function(_0x857f0b){var _0x53afc2=_0xf2ba9a[_0xba98('0x52')][_0xba98('0x53')]({'plain':!![]});if(!_0x53afc2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53afc2['role']===_0xba98('0x52')){var _0x26df38=_0x857f0b['get']({'plain':!![]});return db[_0xba98('0x54')][_0xba98('0x46')]({'where':{'name':_0xba98('0x25'),'userProfileId':_0x53afc2[_0xba98('0x55')]},'raw':!![]})[_0xba98('0x24')](function(_0x1ac0d0){if(_0x1ac0d0&&_0x1ac0d0[_0xba98('0x56')]===0x0){return db[_0xba98('0x57')]['create']({'name':_0x26df38[_0xba98('0x28')],'resourceId':_0x26df38['id'],'type':_0x1ac0d0[_0xba98('0x28')],'sectionId':_0x1ac0d0['id']},{})[_0xba98('0x24')](function(){return _0x857f0b;});}else{return _0x857f0b;}})['catch'](function(_0x119f60){logger[_0xba98('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x119f60);throw _0x119f60;});}return _0x857f0b;})['then'](respondWithResult(_0x1cd4bc,0xc9))['catch'](handleError(_0x1cd4bc,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index d92bee9..2743e7b 100644 --- a/server/api/cannedAnswer/cannedAnswer.model.js +++ b/server/api/cannedAnswer/cannedAnswer.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84ae=['moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x84ae,0x18f));var _0xe84a=function(_0x22c3fe,_0x23ee85){_0x22c3fe=_0x22c3fe-0x0;var _0x5c62cf=_0x84ae[_0x22c3fe];return _0x5c62cf;};'use strict';var _=require(_0xe84a('0x0'));var util=require(_0xe84a('0x1'));var logger=require(_0xe84a('0x2'))(_0xe84a('0x3'));var moment=require(_0xe84a('0x4'));var BPromise=require(_0xe84a('0x5'));var rp=require(_0xe84a('0x6'));var fs=require('fs');var path=require(_0xe84a('0x7'));var rimraf=require('rimraf');var config=require(_0xe84a('0x8'));var attributes=require(_0xe84a('0x9'));module['exports']=function(_0xeae1c5,_0x4b226b){return _0xeae1c5['define'](_0xe84a('0xa'),attributes,{'tableName':_0xe84a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe84a('0xc')});}; \ No newline at end of file +var _0x54cf=['tools_canned_answers','utf8mb4_unicode_ci','lodash','api','moment','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer'];(function(_0x1069ce,_0x15f2a8){var _0x2ce8d6=function(_0x5f5d8b){while(--_0x5f5d8b){_0x1069ce['push'](_0x1069ce['shift']());}};_0x2ce8d6(++_0x15f2a8);}(_0x54cf,0xbd));var _0xf54c=function(_0x428f54,_0x1783db){_0x428f54=_0x428f54-0x0;var _0x201622=_0x54cf[_0x428f54];return _0x201622;};'use strict';var _=require(_0xf54c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf54c('0x1'));var moment=require(_0xf54c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf54c('0x3'));var rimraf=require(_0xf54c('0x4'));var config=require(_0xf54c('0x5'));var attributes=require(_0xf54c('0x6'));module[_0xf54c('0x7')]=function(_0x15f1dc,_0x5f2803){return _0x15f1dc['define'](_0xf54c('0x8'),attributes,{'tableName':_0xf54c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf54c('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 008a344..71c4d5f 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2f3c5d,_0x59e47e){var _0x9d3a84=function(_0x117dcd){while(--_0x117dcd){_0x2f3c5d['push'](_0x2f3c5d['shift']());}};_0x9d3a84(++_0x59e47e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x326568,_0x4b4882){var _0x56dca8=function(_0x510ec8){while(--_0x510ec8){_0x326568['push'](_0x326568['shift']());}};_0x56dca8(++_0x4b4882);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 0b4e7a6..2cb0746 100644 --- a/server/api/cannedAnswer/index.js +++ b/server/api/cannedAnswer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b8f=['destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete'];(function(_0x3b67f4,_0x53c057){var _0x50e6bd=function(_0x20909b){while(--_0x20909b){_0x3b67f4['push'](_0x3b67f4['shift']());}};_0x50e6bd(++_0x53c057);}(_0x7b8f,0x18e));var _0xf7b8=function(_0xdcafe7,_0x3cb34d){_0xdcafe7=_0xdcafe7-0x0;var _0x1d7fb5=_0x7b8f[_0xdcafe7];return _0x1d7fb5;};'use strict';var multer=require(_0xf7b8('0x0'));var util=require(_0xf7b8('0x1'));var path=require(_0xf7b8('0x2'));var timeout=require(_0xf7b8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf7b8('0x4'));var auth=require(_0xf7b8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf7b8('0x6'));var controller=require('./cannedAnswer.controller');router[_0xf7b8('0x7')]('/',auth[_0xf7b8('0x8')](),controller[_0xf7b8('0x9')]);router[_0xf7b8('0x7')](_0xf7b8('0xa'),auth[_0xf7b8('0x8')](),controller['show']);router[_0xf7b8('0xb')]('/',auth[_0xf7b8('0x8')](),controller[_0xf7b8('0xc')]);router[_0xf7b8('0xd')](_0xf7b8('0xa'),auth[_0xf7b8('0x8')](),controller[_0xf7b8('0xe')]);router[_0xf7b8('0xf')](_0xf7b8('0xa'),auth[_0xf7b8('0x8')](),controller[_0xf7b8('0x10')]);module[_0xf7b8('0x11')]=router; \ No newline at end of file +var _0x1ef4=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','post','create','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x3d687a,_0x43bb29){var _0x212213=function(_0x4cad73){while(--_0x4cad73){_0x3d687a['push'](_0x3d687a['shift']());}};_0x212213(++_0x43bb29);}(_0x1ef4,0x94));var _0x41ef=function(_0x45d417,_0x5ca073){_0x45d417=_0x45d417-0x0;var _0x58b698=_0x1ef4[_0x45d417];return _0x58b698;};'use strict';var multer=require(_0x41ef('0x0'));var util=require(_0x41ef('0x1'));var path=require(_0x41ef('0x2'));var timeout=require(_0x41ef('0x3'));var express=require('express');var router=express[_0x41ef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x41ef('0x5'));var config=require(_0x41ef('0x6'));var controller=require(_0x41ef('0x7'));router['get']('/',auth[_0x41ef('0x8')](),controller[_0x41ef('0x9')]);router[_0x41ef('0xa')](_0x41ef('0xb'),auth[_0x41ef('0x8')](),controller['show']);router[_0x41ef('0xc')]('/',auth['isAuthenticated'](),controller[_0x41ef('0xd')]);router['put'](_0x41ef('0xb'),auth[_0x41ef('0x8')](),controller[_0x41ef('0xe')]);router[_0x41ef('0xf')](_0x41ef('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x41ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 23637b3..c8744e5 100644 --- a/server/api/cdr/cdr.attributes.js +++ b/server/api/cdr/cdr.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07be=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x45ffad,_0x1c09f0){var _0x7c936e=function(_0xae7e55){while(--_0xae7e55){_0x45ffad['push'](_0x45ffad['shift']());}};_0x7c936e(++_0x1c09f0);}(_0x07be,0xfb));var _0xe07b=function(_0x21adc1,_0x3337fb){_0x21adc1=_0x21adc1-0x0;var _0xc19f6b=_0x07be[_0x21adc1];return _0xc19f6b;};'use strict';var Sequelize=require(_0xe07b('0x0'));module[_0xe07b('0x1')]={'calldate':{'type':Sequelize[_0xe07b('0x2')],'allowNull':![],'defaultValue':_0xe07b('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xe07b('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xe07b('0x4')]},'channel':{'type':Sequelize[_0xe07b('0x4')]},'dstchannel':{'type':Sequelize[_0xe07b('0x4')]},'lastapp':{'type':Sequelize[_0xe07b('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xe07b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe07b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe07b('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe07b('0x4')]},'userfield':{'type':Sequelize[_0xe07b('0x4')]},'uniqueid':{'type':Sequelize[_0xe07b('0x4')]},'linkedid':{'type':Sequelize[_0xe07b('0x4')]},'sequence':{'type':Sequelize[_0xe07b('0x4')]},'peeraccount':{'type':Sequelize[_0xe07b('0x4')]},'type':{'type':Sequelize[_0xe07b('0x4')]},'tag':{'type':Sequelize[_0xe07b('0x4')]}}; \ No newline at end of file +var _0x4522=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x9808b2,_0x53d925){var _0x56bd58=function(_0x544a75){while(--_0x544a75){_0x9808b2['push'](_0x9808b2['shift']());}};_0x56bd58(++_0x53d925);}(_0x4522,0x1a0));var _0x2452=function(_0x344451,_0x2eaddf){_0x344451=_0x344451-0x0;var _0x5d38b0=_0x4522[_0x344451];return _0x5d38b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x2452('0x0')],'allowNull':![],'defaultValue':_0x2452('0x1')},'clid':{'type':Sequelize[_0x2452('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x2452('0x2')]},'dcontext':{'type':Sequelize[_0x2452('0x2')]},'channel':{'type':Sequelize[_0x2452('0x2')]},'dstchannel':{'type':Sequelize[_0x2452('0x2')]},'lastapp':{'type':Sequelize[_0x2452('0x2')]},'lastdata':{'type':Sequelize[_0x2452('0x2')]},'duration':{'type':Sequelize[_0x2452('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2452('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2452('0x2')]},'amaflags':{'type':Sequelize[_0x2452('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2452('0x2')]},'userfield':{'type':Sequelize[_0x2452('0x2')]},'uniqueid':{'type':Sequelize[_0x2452('0x2')]},'linkedid':{'type':Sequelize[_0x2452('0x2')]},'sequence':{'type':Sequelize[_0x2452('0x2')]},'peeraccount':{'type':Sequelize[_0x2452('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 98171ae..6fc3023 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1dcc=['then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','set','Content-Range','reject','save','update'];(function(_0x16dcf0,_0x558421){var _0x3eabdd=function(_0x180900){while(--_0x180900){_0x16dcf0['push'](_0x16dcf0['shift']());}};_0x3eabdd(++_0x558421);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x13cf62,_0x138fee){_0x13cf62=_0x13cf62-0x0;var _0x133ded=_0x1dcc[_0x13cf62];return _0x133ded;};'use strict';var emlformat=require(_0xc1dc('0x0'));var rimraf=require(_0xc1dc('0x1'));var zipdir=require(_0xc1dc('0x2'));var jsonpatch=require(_0xc1dc('0x3'));var rp=require('request-promise');var moment=require(_0xc1dc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1dc('0x5'));var util=require(_0xc1dc('0x6'));var path=require(_0xc1dc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc1dc('0x8'));var fs=require('fs');var fs_extra=require(_0xc1dc('0x9'));var _=require(_0xc1dc('0xa'));var squel=require('squel');var crypto=require(_0xc1dc('0xb'));var jsforce=require(_0xc1dc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1dc('0xd'));var querystring=require('querystring');var Papa=require(_0xc1dc('0xe'));var Redis=require('ioredis');var authService=require(_0xc1dc('0xf'));var qs=require(_0xc1dc('0x10'));var as=require(_0xc1dc('0x11'));var hardwareService=require(_0xc1dc('0x12'));var logger=require(_0xc1dc('0x13'))(_0xc1dc('0x14'));var utils=require(_0xc1dc('0x15'));var config=require(_0xc1dc('0x16'));var licenseUtil=require(_0xc1dc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226ba3,_0x2c5f41){_0x2c5f41=_0x2c5f41||0xcc;return function(_0xb7e667){if(_0xb7e667){return _0x226ba3['sendStatus'](_0x2c5f41);}return _0x226ba3[_0xc1dc('0x18')](_0x2c5f41)[_0xc1dc('0x19')]();};}function respondWithResult(_0x299520,_0xd51b1e){_0xd51b1e=_0xd51b1e||0xc8;return function(_0x145708){if(_0x145708){return _0x299520[_0xc1dc('0x18')](_0xd51b1e)[_0xc1dc('0x1a')](_0x145708);}};}function respondWithFilteredResult(_0x21aed1,_0x265929){return function(_0x37b23a){if(_0x37b23a){var _0x1cbbfe=typeof _0x265929['offset']===_0xc1dc('0x1b')&&typeof _0x265929[_0xc1dc('0x1c')]===_0xc1dc('0x1b');var _0x3d3315=_0x37b23a['count'];var _0x332400=_0x1cbbfe?0x0:_0x265929[_0xc1dc('0x1d')];var _0x499a42=_0x1cbbfe?_0x37b23a['count']:_0x265929[_0xc1dc('0x1d')]+_0x265929[_0xc1dc('0x1c')];var _0x197941;if(_0x499a42>=_0x3d3315){_0x499a42=_0x3d3315;_0x197941=0xc8;}else{_0x197941=0xce;}_0x21aed1[_0xc1dc('0x18')](_0x197941);return _0x21aed1[_0xc1dc('0x1e')](_0xc1dc('0x1f'),_0x332400+'-'+_0x499a42+'/'+_0x3d3315)[_0xc1dc('0x1a')](_0x37b23a);}return null;};}function patchUpdates(_0xd5a2e){return function(_0x5762e5){try{jsonpatch['apply'](_0x5762e5,_0xd5a2e,!![]);}catch(_0x4efe0d){return BPromise[_0xc1dc('0x20')](_0x4efe0d);}return _0x5762e5[_0xc1dc('0x21')]();};}function saveUpdates(_0x47af1e,_0x367965){return function(_0x19325f){if(_0x19325f){return _0x19325f[_0xc1dc('0x22')](_0x47af1e)[_0xc1dc('0x23')](function(_0x22b80d){return _0x22b80d;});}return null;};}function removeEntity(_0x2944a2,_0x353bf3){return function(_0x18ba56){if(_0x18ba56){return _0x18ba56[_0xc1dc('0x24')]()[_0xc1dc('0x23')](function(){_0x2944a2['status'](0xcc)[_0xc1dc('0x19')]();});}};}function handleEntityNotFound(_0xfeb0b1,_0x17ce2b){return function(_0x52b0b9){if(!_0x52b0b9){_0xfeb0b1['sendStatus'](0x194);}return _0x52b0b9;};}function handleError(_0x296523,_0x109e88){_0x109e88=_0x109e88||0x1f4;return function(_0xfd3f88){logger[_0xc1dc('0x25')](_0xfd3f88[_0xc1dc('0x26')]);if(_0xfd3f88[_0xc1dc('0x27')]){delete _0xfd3f88[_0xc1dc('0x27')];}_0x296523[_0xc1dc('0x18')](_0x109e88)[_0xc1dc('0x28')](_0xfd3f88);};}exports['index']=function(_0x2d5a57,_0x25b7bf){var _0xd77537={},_0x27e54d={},_0x52b0ff={'count':0x0,'rows':[]};var _0x4750a9=_[_0xc1dc('0x29')](db[_0xc1dc('0x2a')][_0xc1dc('0x2b')],function(_0x1182a4){return{'name':_0x1182a4[_0xc1dc('0x2c')],'type':_0x1182a4['type'][_0xc1dc('0x2d')]};});_0x27e54d[_0xc1dc('0x2e')]=_[_0xc1dc('0x29')](_0x4750a9,_0xc1dc('0x27'));_0x27e54d[_0xc1dc('0x2f')]=_[_0xc1dc('0x30')](_0x2d5a57[_0xc1dc('0x2f')]);_0x27e54d[_0xc1dc('0x31')]=_[_0xc1dc('0x32')](_0x27e54d['model'],_0x27e54d['query']);_0xd77537[_0xc1dc('0x33')]=_[_0xc1dc('0x32')](_0x27e54d[_0xc1dc('0x2e')],qs[_0xc1dc('0x34')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x34')]));_0xd77537['attributes']=_0xd77537[_0xc1dc('0x33')][_0xc1dc('0x35')]?_0xd77537['attributes']:_0x27e54d[_0xc1dc('0x2e')];if(!_0x2d5a57[_0xc1dc('0x2f')]['hasOwnProperty'](_0xc1dc('0x36'))){_0xd77537[_0xc1dc('0x1c')]=qs[_0xc1dc('0x1c')](_0x2d5a57['query'][_0xc1dc('0x1c')]);_0xd77537[_0xc1dc('0x1d')]=qs[_0xc1dc('0x1d')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x1d')]);}_0xd77537[_0xc1dc('0x37')]=qs[_0xc1dc('0x38')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x38')]);_0xd77537['where']=qs[_0xc1dc('0x31')](_[_0xc1dc('0x39')](_0x2d5a57[_0xc1dc('0x2f')],_0x27e54d['filters']),_0x4750a9);if(_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x3a')]){_0xd77537[_0xc1dc('0x3b')]=_[_0xc1dc('0x3c')](_0xd77537[_0xc1dc('0x3b')],{'$or':_[_0xc1dc('0x29')](_0x4750a9,function(_0x2e8d34){if(_0x2e8d34[_0xc1dc('0x3d')]!=='VIRTUAL'){var _0x16356d={};_0x16356d[_0x2e8d34[_0xc1dc('0x27')]]={'$like':'%'+_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x3a')]+'%'};return _0x16356d;}})});}_0xd77537=_[_0xc1dc('0x3c')]({},_0xd77537,_0x2d5a57[_0xc1dc('0x3e')]);var _0x503ec8={'where':_0xd77537[_0xc1dc('0x3b')]};return db[_0xc1dc('0x2a')][_0xc1dc('0x3f')](_0x503ec8)[_0xc1dc('0x23')](function(_0x1bcf3d){_0x52b0ff['count']=_0x1bcf3d;if(_0x2d5a57['query'][_0xc1dc('0x40')]){_0xd77537[_0xc1dc('0x41')]=[{'all':!![]}];}return db[_0xc1dc('0x2a')][_0xc1dc('0x42')](_0xd77537);})[_0xc1dc('0x23')](function(_0x2b4190){_0x52b0ff[_0xc1dc('0x43')]=_0x2b4190;return _0x52b0ff;})['then'](respondWithFilteredResult(_0x25b7bf,_0xd77537))[_0xc1dc('0x44')](handleError(_0x25b7bf,null));};exports[_0xc1dc('0x45')]=function(_0xe5c170,_0x4f99ea){var _0x402d3a={'raw':!![],'where':{'id':_0xe5c170[_0xc1dc('0x46')]['id']}},_0x2f52f7={};_0x2f52f7[_0xc1dc('0x2e')]=_['keys'](db['Cdr'][_0xc1dc('0x2b')]);_0x2f52f7[_0xc1dc('0x2f')]=_['keys'](_0xe5c170[_0xc1dc('0x2f')]);_0x2f52f7[_0xc1dc('0x31')]=_[_0xc1dc('0x32')](_0x2f52f7[_0xc1dc('0x2e')],_0x2f52f7[_0xc1dc('0x2f')]);_0x402d3a[_0xc1dc('0x33')]=_[_0xc1dc('0x32')](_0x2f52f7['model'],qs['fields'](_0xe5c170[_0xc1dc('0x2f')]['fields']));_0x402d3a[_0xc1dc('0x33')]=_0x402d3a[_0xc1dc('0x33')][_0xc1dc('0x35')]?_0x402d3a[_0xc1dc('0x33')]:_0x2f52f7[_0xc1dc('0x2e')];if(_0xe5c170[_0xc1dc('0x2f')][_0xc1dc('0x40')]){_0x402d3a[_0xc1dc('0x41')]=[{'all':!![]}];}_0x402d3a=_['merge']({},_0x402d3a,_0xe5c170[_0xc1dc('0x3e')]);return db[_0xc1dc('0x2a')][_0xc1dc('0x47')](_0x402d3a)[_0xc1dc('0x23')](handleEntityNotFound(_0x4f99ea,null))[_0xc1dc('0x23')](respondWithResult(_0x4f99ea,null))[_0xc1dc('0x44')](handleError(_0x4f99ea,null));};exports[_0xc1dc('0x48')]=function(_0x9a48b7,_0x2ca7f1){return db[_0xc1dc('0x2a')]['create'](_0x9a48b7['body'],{})['then'](respondWithResult(_0x2ca7f1,0xc9))[_0xc1dc('0x44')](handleError(_0x2ca7f1,null));};exports[_0xc1dc('0x22')]=function(_0x57b792,_0x129e23){if(_0x57b792[_0xc1dc('0x49')]['id']){delete _0x57b792['body']['id'];}return db[_0xc1dc('0x2a')]['find']({'where':{'id':_0x57b792[_0xc1dc('0x46')]['id']}})[_0xc1dc('0x23')](handleEntityNotFound(_0x129e23,null))[_0xc1dc('0x23')](saveUpdates(_0x57b792[_0xc1dc('0x49')],null))[_0xc1dc('0x23')](respondWithResult(_0x129e23,null))[_0xc1dc('0x44')](handleError(_0x129e23,null));};exports[_0xc1dc('0x24')]=function(_0x34667b,_0x4d4240){return db[_0xc1dc('0x2a')][_0xc1dc('0x47')]({'where':{'id':_0x34667b[_0xc1dc('0x46')]['id']}})[_0xc1dc('0x23')](handleEntityNotFound(_0x4d4240,null))['then'](removeEntity(_0x4d4240,null))[_0xc1dc('0x44')](handleError(_0x4d4240,null));};exports[_0xc1dc('0x4a')]=function(_0x3e3e6c,_0x1755cb){return db[_0xc1dc('0x2a')][_0xc1dc('0x4a')]()[_0xc1dc('0x23')](respondWithResult(_0x1755cb,null))[_0xc1dc('0x44')](handleError(_0x1755cb,null));}; \ No newline at end of file +var _0xf8b2=['sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','Cdr','include','findAll','then','rows','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy'];(function(_0x580409,_0x11a6e8){var _0x126a85=function(_0x1ff8a5){while(--_0x1ff8a5){_0x580409['push'](_0x580409['shift']());}};_0x126a85(++_0x11a6e8);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x2205c5,_0x27128c){_0x2205c5=_0x2205c5-0x0;var _0x18749c=_0xf8b2[_0x2205c5];return _0x18749c;};'use strict';var emlformat=require(_0x2f8b('0x0'));var rimraf=require(_0x2f8b('0x1'));var zipdir=require(_0x2f8b('0x2'));var jsonpatch=require(_0x2f8b('0x3'));var rp=require(_0x2f8b('0x4'));var moment=require(_0x2f8b('0x5'));var BPromise=require(_0x2f8b('0x6'));var Mustache=require(_0x2f8b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2f8b('0x8'));var csv=require(_0x2f8b('0x9'));var ejs=require(_0x2f8b('0xa'));var fs=require('fs');var fs_extra=require(_0x2f8b('0xb'));var _=require(_0x2f8b('0xc'));var squel=require(_0x2f8b('0xd'));var crypto=require(_0x2f8b('0xe'));var jsforce=require(_0x2f8b('0xf'));var deskjs=require(_0x2f8b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2f8b('0x11'));var Papa=require(_0x2f8b('0x12'));var Redis=require(_0x2f8b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2f8b('0x14'));var as=require(_0x2f8b('0x15'));var hardwareService=require(_0x2f8b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x2f8b('0x17'));var config=require(_0x2f8b('0x18'));var licenseUtil=require(_0x2f8b('0x19'));var db=require(_0x2f8b('0x1a'))['db'];function respondWithStatusCode(_0x175111,_0x4cb1e0){_0x4cb1e0=_0x4cb1e0||0xcc;return function(_0x16d5a2){if(_0x16d5a2){return _0x175111['sendStatus'](_0x4cb1e0);}return _0x175111[_0x2f8b('0x1b')](_0x4cb1e0)[_0x2f8b('0x1c')]();};}function respondWithResult(_0x1b6a17,_0x15634){_0x15634=_0x15634||0xc8;return function(_0xf9cbe0){if(_0xf9cbe0){return _0x1b6a17[_0x2f8b('0x1b')](_0x15634)[_0x2f8b('0x1d')](_0xf9cbe0);}};}function respondWithFilteredResult(_0x2b6003,_0x532fe4){return function(_0x14a248){if(_0x14a248){var _0xdec711=typeof _0x532fe4[_0x2f8b('0x1e')]===_0x2f8b('0x1f')&&typeof _0x532fe4[_0x2f8b('0x20')]===_0x2f8b('0x1f');var _0x3d65ee=_0x14a248[_0x2f8b('0x21')];var _0x35ec40=_0xdec711?0x0:_0x532fe4['offset'];var _0x23dd63=_0xdec711?_0x14a248[_0x2f8b('0x21')]:_0x532fe4[_0x2f8b('0x1e')]+_0x532fe4['limit'];var _0xdc8171;if(_0x23dd63>=_0x3d65ee){_0x23dd63=_0x3d65ee;_0xdc8171=0xc8;}else{_0xdc8171=0xce;}_0x2b6003['status'](_0xdc8171);return _0x2b6003[_0x2f8b('0x22')](_0x2f8b('0x23'),_0x35ec40+'-'+_0x23dd63+'/'+_0x3d65ee)[_0x2f8b('0x1d')](_0x14a248);}return null;};}function patchUpdates(_0x26d78f){return function(_0x3be6dc){try{jsonpatch['apply'](_0x3be6dc,_0x26d78f,!![]);}catch(_0x29c2f3){return BPromise[_0x2f8b('0x24')](_0x29c2f3);}return _0x3be6dc[_0x2f8b('0x25')]();};}function saveUpdates(_0x17b251,_0x3ad38b){return function(_0x1ffbae){if(_0x1ffbae){return _0x1ffbae[_0x2f8b('0x26')](_0x17b251)['then'](function(_0x273950){return _0x273950;});}return null;};}function removeEntity(_0x23f73c,_0x3560c4){return function(_0x41e12b){if(_0x41e12b){return _0x41e12b[_0x2f8b('0x27')]()['then'](function(){_0x23f73c[_0x2f8b('0x1b')](0xcc)[_0x2f8b('0x1c')]();});}};}function handleEntityNotFound(_0x152492,_0x46a95a){return function(_0x183e51){if(!_0x183e51){_0x152492[_0x2f8b('0x28')](0x194);}return _0x183e51;};}function handleError(_0x45e313,_0x347f5a){_0x347f5a=_0x347f5a||0x1f4;return function(_0x4145b3){logger['error'](_0x4145b3[_0x2f8b('0x29')]);if(_0x4145b3['name']){delete _0x4145b3[_0x2f8b('0x2a')];}_0x45e313[_0x2f8b('0x1b')](_0x347f5a)[_0x2f8b('0x2b')](_0x4145b3);};}exports[_0x2f8b('0x2c')]=function(_0x72b23b,_0x4adacd){var _0x2cfbea={},_0x5cc78c={},_0x5207a8={'count':0x0,'rows':[]};var _0x194e75=_[_0x2f8b('0x2d')](db['Cdr'][_0x2f8b('0x2e')],function(_0x20d80c){return{'name':_0x20d80c[_0x2f8b('0x2f')],'type':_0x20d80c[_0x2f8b('0x30')][_0x2f8b('0x31')]};});_0x5cc78c[_0x2f8b('0x32')]=_['map'](_0x194e75,_0x2f8b('0x2a'));_0x5cc78c[_0x2f8b('0x33')]=_[_0x2f8b('0x34')](_0x72b23b[_0x2f8b('0x33')]);_0x5cc78c[_0x2f8b('0x35')]=_[_0x2f8b('0x36')](_0x5cc78c[_0x2f8b('0x32')],_0x5cc78c['query']);_0x2cfbea[_0x2f8b('0x37')]=_['intersection'](_0x5cc78c[_0x2f8b('0x32')],qs[_0x2f8b('0x38')](_0x72b23b[_0x2f8b('0x33')][_0x2f8b('0x38')]));_0x2cfbea[_0x2f8b('0x37')]=_0x2cfbea[_0x2f8b('0x37')][_0x2f8b('0x39')]?_0x2cfbea[_0x2f8b('0x37')]:_0x5cc78c[_0x2f8b('0x32')];if(!_0x72b23b['query']['hasOwnProperty'](_0x2f8b('0x3a'))){_0x2cfbea[_0x2f8b('0x20')]=qs[_0x2f8b('0x20')](_0x72b23b[_0x2f8b('0x33')]['limit']);_0x2cfbea[_0x2f8b('0x1e')]=qs[_0x2f8b('0x1e')](_0x72b23b[_0x2f8b('0x33')][_0x2f8b('0x1e')]);}_0x2cfbea[_0x2f8b('0x3b')]=qs['sort'](_0x72b23b['query'][_0x2f8b('0x3c')]);_0x2cfbea[_0x2f8b('0x3d')]=qs[_0x2f8b('0x35')](_[_0x2f8b('0x3e')](_0x72b23b[_0x2f8b('0x33')],_0x5cc78c[_0x2f8b('0x35')]),_0x194e75);if(_0x72b23b[_0x2f8b('0x33')]['filter']){_0x2cfbea[_0x2f8b('0x3d')]=_[_0x2f8b('0x3f')](_0x2cfbea['where'],{'$or':_[_0x2f8b('0x2d')](_0x194e75,function(_0x4594b2){if(_0x4594b2[_0x2f8b('0x30')]!=='VIRTUAL'){var _0xa1d8de={};_0xa1d8de[_0x4594b2[_0x2f8b('0x2a')]]={'$like':'%'+_0x72b23b['query'][_0x2f8b('0x40')]+'%'};return _0xa1d8de;}})});}_0x2cfbea=_[_0x2f8b('0x3f')]({},_0x2cfbea,_0x72b23b['options']);var _0x92b37a={'where':_0x2cfbea['where']};return db[_0x2f8b('0x41')][_0x2f8b('0x21')](_0x92b37a)['then'](function(_0x9030da){_0x5207a8[_0x2f8b('0x21')]=_0x9030da;if(_0x72b23b[_0x2f8b('0x33')]['includeAll']){_0x2cfbea[_0x2f8b('0x42')]=[{'all':!![]}];}return db['Cdr'][_0x2f8b('0x43')](_0x2cfbea);})[_0x2f8b('0x44')](function(_0x1ff6e7){_0x5207a8[_0x2f8b('0x45')]=_0x1ff6e7;return _0x5207a8;})[_0x2f8b('0x44')](respondWithFilteredResult(_0x4adacd,_0x2cfbea))[_0x2f8b('0x46')](handleError(_0x4adacd,null));};exports[_0x2f8b('0x47')]=function(_0xa2fc94,_0x1c0b64){var _0x40577c={'raw':!![],'where':{'id':_0xa2fc94[_0x2f8b('0x48')]['id']}},_0x45c92c={};_0x45c92c[_0x2f8b('0x32')]=_[_0x2f8b('0x34')](db[_0x2f8b('0x41')][_0x2f8b('0x2e')]);_0x45c92c[_0x2f8b('0x33')]=_[_0x2f8b('0x34')](_0xa2fc94[_0x2f8b('0x33')]);_0x45c92c[_0x2f8b('0x35')]=_[_0x2f8b('0x36')](_0x45c92c[_0x2f8b('0x32')],_0x45c92c[_0x2f8b('0x33')]);_0x40577c[_0x2f8b('0x37')]=_[_0x2f8b('0x36')](_0x45c92c['model'],qs['fields'](_0xa2fc94['query'][_0x2f8b('0x38')]));_0x40577c['attributes']=_0x40577c[_0x2f8b('0x37')][_0x2f8b('0x39')]?_0x40577c[_0x2f8b('0x37')]:_0x45c92c['model'];if(_0xa2fc94[_0x2f8b('0x33')]['includeAll']){_0x40577c[_0x2f8b('0x42')]=[{'all':!![]}];}_0x40577c=_['merge']({},_0x40577c,_0xa2fc94[_0x2f8b('0x49')]);return db[_0x2f8b('0x41')]['find'](_0x40577c)[_0x2f8b('0x44')](handleEntityNotFound(_0x1c0b64,null))[_0x2f8b('0x44')](respondWithResult(_0x1c0b64,null))[_0x2f8b('0x46')](handleError(_0x1c0b64,null));};exports[_0x2f8b('0x4a')]=function(_0x1e6ac2,_0x465d59){return db[_0x2f8b('0x41')][_0x2f8b('0x4a')](_0x1e6ac2[_0x2f8b('0x4b')],{})['then'](respondWithResult(_0x465d59,0xc9))[_0x2f8b('0x46')](handleError(_0x465d59,null));};exports[_0x2f8b('0x26')]=function(_0x2d79f9,_0x1bb257){if(_0x2d79f9[_0x2f8b('0x4b')]['id']){delete _0x2d79f9['body']['id'];}return db[_0x2f8b('0x41')][_0x2f8b('0x4c')]({'where':{'id':_0x2d79f9[_0x2f8b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bb257,null))[_0x2f8b('0x44')](saveUpdates(_0x2d79f9['body'],null))[_0x2f8b('0x44')](respondWithResult(_0x1bb257,null))[_0x2f8b('0x46')](handleError(_0x1bb257,null));};exports[_0x2f8b('0x27')]=function(_0x3a25bb,_0x17b855){return db['Cdr']['find']({'where':{'id':_0x3a25bb['params']['id']}})[_0x2f8b('0x44')](handleEntityNotFound(_0x17b855,null))[_0x2f8b('0x44')](removeEntity(_0x17b855,null))[_0x2f8b('0x46')](handleError(_0x17b855,null));};exports[_0x2f8b('0x4d')]=function(_0x49e047,_0x5ea07d){return db[_0x2f8b('0x41')][_0x2f8b('0x4d')]()[_0x2f8b('0x44')](respondWithResult(_0x5ea07d,null))[_0x2f8b('0x46')](handleError(_0x5ea07d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 47a4012..f9a923b 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1f5206,_0xa85c7a){var _0x52c522=function(_0x1f62ea){while(--_0x1f62ea){_0x1f5206['push'](_0x1f5206['shift']());}};_0x52c522(++_0xa85c7a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2afb35,_0x2ecbc5){var _0x2e17d6=function(_0xd78c03){while(--_0xd78c03){_0x2afb35['push'](_0x2afb35['shift']());}};_0x2e17d6(++_0x2ecbc5);}(_0x7a54,0x106));var _0x47a5=function(_0x5da0a4,_0x184ee1){_0x5da0a4=_0x5da0a4-0x0;var _0x4073ea=_0x7a54[_0x5da0a4];return _0x4073ea;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 71a0fd0..0674f5f 100644 --- a/server/api/cdr/cdr.rpc.js +++ b/server/api/cdr/cdr.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f78=['http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','message','Cdr,\x20%s,\x20%s','result','lodash','util','randomstring','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x544f4d,_0x18d200){var _0x37e8b0=function(_0x3b6f9e){while(--_0x3b6f9e){_0x544f4d['push'](_0x544f4d['shift']());}};_0x37e8b0(++_0x18d200);}(_0x9f78,0x109));var _0x89f7=function(_0xe6a680,_0x371148){_0xe6a680=_0xe6a680-0x0;var _0x4a2864=_0x9f78[_0xe6a680];return _0x4a2864;};'use strict';var _=require(_0x89f7('0x0'));var util=require(_0x89f7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x89f7('0x2'));var fs=require('fs');var Redis=require(_0x89f7('0x3'));var db=require(_0x89f7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x89f7('0x5'));var config=require('../../config/environment');var jayson=require(_0x89f7('0x6'));var client=jayson['client'][_0x89f7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44fb02,_0x536130,_0x321c55){return new BPromise(function(_0x7c4e0d,_0x222c8d){return client[_0x89f7('0x8')](_0x44fb02,_0x321c55)[_0x89f7('0x9')](function(_0x4ec971){logger[_0x89f7('0xa')]('Cdr,\x20%s,\x20%s',_0x536130,_0x89f7('0xb'));logger['debug'](_0x89f7('0xc'),_0x536130,_0x89f7('0xb'),JSON['stringify'](_0x4ec971));if(_0x4ec971[_0x89f7('0xd')]){if(_0x4ec971[_0x89f7('0xd')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x536130,_0x4ec971['error'][_0x89f7('0xe')]);return _0x222c8d(_0x4ec971[_0x89f7('0xd')]['message']);}logger[_0x89f7('0xd')](_0x89f7('0xf'),_0x536130,_0x4ec971[_0x89f7('0xd')]['message']);return _0x7c4e0d(_0x4ec971[_0x89f7('0xd')][_0x89f7('0xe')]);}else{logger['info'](_0x89f7('0xf'),_0x536130,_0x89f7('0xb'));_0x7c4e0d(_0x4ec971[_0x89f7('0x10')][_0x89f7('0xe')]);}})['catch'](function(_0x54de51){logger[_0x89f7('0xd')]('Cdr,\x20%s,\x20%s',_0x536130,_0x54de51);_0x222c8d(_0x54de51);});});} \ No newline at end of file +var _0x9ae8=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','message','Cdr,\x20%s,\x20%s','result'];(function(_0x4488a2,_0x5c17b1){var _0x5e616e=function(_0x13bf39){while(--_0x13bf39){_0x4488a2['push'](_0x4488a2['shift']());}};_0x5e616e(++_0x5c17b1);}(_0x9ae8,0x139));var _0x89ae=function(_0x3b67fb,_0x2bc525){_0x3b67fb=_0x3b67fb-0x0;var _0x1d0b61=_0x9ae8[_0x3b67fb];return _0x1d0b61;};'use strict';var _=require('lodash');var util=require(_0x89ae('0x0'));var moment=require(_0x89ae('0x1'));var BPromise=require(_0x89ae('0x2'));var rs=require(_0x89ae('0x3'));var fs=require('fs');var Redis=require(_0x89ae('0x4'));var db=require(_0x89ae('0x5'))['db'];var utils=require(_0x89ae('0x6'));var logger=require(_0x89ae('0x7'))(_0x89ae('0x8'));var config=require(_0x89ae('0x9'));var jayson=require(_0x89ae('0xa'));var client=jayson[_0x89ae('0xb')][_0x89ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x499ba3,_0x297b69,_0x16c210){return new BPromise(function(_0x18b5ed,_0x3029ea){return client[_0x89ae('0xd')](_0x499ba3,_0x16c210)['then'](function(_0x46996c){logger[_0x89ae('0xe')]('Cdr,\x20%s,\x20%s',_0x297b69,_0x89ae('0xf'));logger[_0x89ae('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x297b69,_0x89ae('0xf'),JSON[_0x89ae('0x11')](_0x46996c));if(_0x46996c[_0x89ae('0x12')]){if(_0x46996c[_0x89ae('0x12')][_0x89ae('0x13')]===0x1f4){logger[_0x89ae('0x12')]('Cdr,\x20%s,\x20%s',_0x297b69,_0x46996c[_0x89ae('0x12')]['message']);return _0x3029ea(_0x46996c[_0x89ae('0x12')][_0x89ae('0x14')]);}logger[_0x89ae('0x12')]('Cdr,\x20%s,\x20%s',_0x297b69,_0x46996c[_0x89ae('0x12')][_0x89ae('0x14')]);return _0x18b5ed(_0x46996c[_0x89ae('0x12')][_0x89ae('0x14')]);}else{logger[_0x89ae('0xe')](_0x89ae('0x15'),_0x297b69,_0x89ae('0xf'));_0x18b5ed(_0x46996c[_0x89ae('0x16')]['message']);}})[_0x89ae('0x17')](function(_0x5c4425){logger[_0x89ae('0x12')]('Cdr,\x20%s,\x20%s',_0x297b69,_0x5c4425);_0x3029ea(_0x5c4425);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index d8dc420..51d4825 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x21a2b2,_0x22ba1e){var _0x2060b4=function(_0x38cfcb){while(--_0x38cfcb){_0x21a2b2['push'](_0x21a2b2['shift']());}};_0x2060b4(++_0x22ba1e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3766ad,_0x5f2ced){var _0x1d88ef=function(_0x59b17a){while(--_0x59b17a){_0x3766ad['push'](_0x3766ad['shift']());}};_0x1d88ef(++_0x5f2ced);}(_0xb10b,0x12a));var _0xbb10=function(_0xd8e9f5,_0x29df60){_0xd8e9f5=_0xd8e9f5-0x0;var _0x4b915e=_0xb10b[_0xd8e9f5];return _0x4b915e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index d18edb2..1312d4e 100644 --- a/server/api/chatApplication/chatApplication.attributes.js +++ b/server/api/chatApplication/chatApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdab=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x492739,_0x4d7d80){var _0x4b668c=function(_0x1136af){while(--_0x1136af){_0x492739['push'](_0x492739['shift']());}};_0x4b668c(++_0x4d7d80);}(_0xbdab,0x1c2));var _0xbbda=function(_0x3518d6,_0x5b10ec){_0x3518d6=_0x3518d6-0x0;var _0x2d6d0d=_0xbdab[_0x3518d6];return _0x2d6d0d;};'use strict';var Sequelize=require(_0xbbda('0x0'));module[_0xbbda('0x1')]={'priority':{'type':Sequelize[_0xbbda('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbbda('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbbda('0x4')]()},'description':{'type':Sequelize[_0xbbda('0x3')]},'interval':{'type':Sequelize[_0xbbda('0x3')],'defaultValue':_0xbbda('0x5')}}; \ No newline at end of file +var _0x9461=['sequelize','exports','STRING','noop','*,*,*,*'];(function(_0xc66117,_0x51370a){var _0x32cc75=function(_0x1c3321){while(--_0x1c3321){_0xc66117['push'](_0xc66117['shift']());}};_0x32cc75(++_0x51370a);}(_0x9461,0xaa));var _0x1946=function(_0xc8b494,_0x4be399){_0xc8b494=_0xc8b494-0x0;var _0xe8e653=_0x9461[_0xc8b494];return _0xe8e653;};'use strict';var Sequelize=require(_0x1946('0x0'));module[_0x1946('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1946('0x2')],'allowNull':![],'defaultValue':_0x1946('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1946('0x2')]},'interval':{'type':Sequelize[_0x1946('0x2')],'defaultValue':_0x1946('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 753288a..e46aa68 100644 --- a/server/api/chatApplication/chatApplication.controller.js +++ b/server/api/chatApplication/chatApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5668=['set','apply','reject','save','update','then','error','stack','name','send','show','params','model','ChatApplication','keys','query','intersection','attributes','fields','length','includeAll','include','options','find','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','status','json','undefined','limit','count','offset'];(function(_0x1eb760,_0x29f74a){var _0xd6c821=function(_0xa6a2){while(--_0xa6a2){_0x1eb760['push'](_0x1eb760['shift']());}};_0xd6c821(++_0x29f74a);}(_0x5668,0x8b));var _0x8566=function(_0x471f7f,_0x414dc6){_0x471f7f=_0x471f7f-0x0;var _0x5284ec=_0x5668[_0x471f7f];return _0x5284ec;};'use strict';var emlformat=require(_0x8566('0x0'));var rimraf=require(_0x8566('0x1'));var zipdir=require(_0x8566('0x2'));var jsonpatch=require(_0x8566('0x3'));var rp=require(_0x8566('0x4'));var moment=require(_0x8566('0x5'));var BPromise=require(_0x8566('0x6'));var Mustache=require(_0x8566('0x7'));var util=require(_0x8566('0x8'));var path=require(_0x8566('0x9'));var sox=require(_0x8566('0xa'));var csv=require(_0x8566('0xb'));var ejs=require(_0x8566('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8566('0xd'));var squel=require(_0x8566('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8566('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8566('0x10'));var Redis=require('ioredis');var authService=require(_0x8566('0x11'));var qs=require(_0x8566('0x12'));var as=require(_0x8566('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8566('0x14'))(_0x8566('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11e0a5,_0x3318a3){_0x3318a3=_0x3318a3||0xcc;return function(_0x2025a2){if(_0x2025a2){return _0x11e0a5[_0x8566('0x16')](_0x3318a3);}return _0x11e0a5[_0x8566('0x17')](_0x3318a3)['end']();};}function respondWithResult(_0x581e26,_0x47bef1){_0x47bef1=_0x47bef1||0xc8;return function(_0x489470){if(_0x489470){return _0x581e26['status'](_0x47bef1)[_0x8566('0x18')](_0x489470);}};}function respondWithFilteredResult(_0x229a5c,_0x3076df){return function(_0x396f1b){if(_0x396f1b){var _0x39faee=typeof _0x3076df['offset']===_0x8566('0x19')&&typeof _0x3076df[_0x8566('0x1a')]===_0x8566('0x19');var _0x4e20a2=_0x396f1b[_0x8566('0x1b')];var _0x1a8ae0=_0x39faee?0x0:_0x3076df[_0x8566('0x1c')];var _0x526f23=_0x39faee?_0x396f1b[_0x8566('0x1b')]:_0x3076df['offset']+_0x3076df['limit'];var _0x3c4629;if(_0x526f23>=_0x4e20a2){_0x526f23=_0x4e20a2;_0x3c4629=0xc8;}else{_0x3c4629=0xce;}_0x229a5c['status'](_0x3c4629);return _0x229a5c[_0x8566('0x1d')]('Content-Range',_0x1a8ae0+'-'+_0x526f23+'/'+_0x4e20a2)[_0x8566('0x18')](_0x396f1b);}return null;};}function patchUpdates(_0x581b58){return function(_0x43fc7c){try{jsonpatch[_0x8566('0x1e')](_0x43fc7c,_0x581b58,!![]);}catch(_0x2bd76c){return BPromise[_0x8566('0x1f')](_0x2bd76c);}return _0x43fc7c[_0x8566('0x20')]();};}function saveUpdates(_0x4ca8e2,_0x5b06e6){return function(_0x3d2cf8){if(_0x3d2cf8){return _0x3d2cf8[_0x8566('0x21')](_0x4ca8e2)[_0x8566('0x22')](function(_0xa3efc4){return _0xa3efc4;});}return null;};}function removeEntity(_0x4e19cf,_0x183435){return function(_0x64127b){if(_0x64127b){return _0x64127b['destroy']()[_0x8566('0x22')](function(){_0x4e19cf[_0x8566('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3191f5,_0xf4a090){return function(_0x18ee17){if(!_0x18ee17){_0x3191f5['sendStatus'](0x194);}return _0x18ee17;};}function handleError(_0x12f318,_0x451bbf){_0x451bbf=_0x451bbf||0x1f4;return function(_0x327f7d){logger[_0x8566('0x23')](_0x327f7d[_0x8566('0x24')]);if(_0x327f7d[_0x8566('0x25')]){delete _0x327f7d[_0x8566('0x25')];}_0x12f318['status'](_0x451bbf)[_0x8566('0x26')](_0x327f7d);};}exports[_0x8566('0x27')]=function(_0x40aed8,_0x8a1dff){var _0xea61c9={'raw':!![],'where':{'id':_0x40aed8[_0x8566('0x28')]['id']}},_0x3a3106={};_0x3a3106[_0x8566('0x29')]=_['keys'](db[_0x8566('0x2a')]['rawAttributes']);_0x3a3106['query']=_[_0x8566('0x2b')](_0x40aed8[_0x8566('0x2c')]);_0x3a3106['filters']=_[_0x8566('0x2d')](_0x3a3106[_0x8566('0x29')],_0x3a3106[_0x8566('0x2c')]);_0xea61c9[_0x8566('0x2e')]=_[_0x8566('0x2d')](_0x3a3106[_0x8566('0x29')],qs['fields'](_0x40aed8['query'][_0x8566('0x2f')]));_0xea61c9[_0x8566('0x2e')]=_0xea61c9['attributes'][_0x8566('0x30')]?_0xea61c9['attributes']:_0x3a3106[_0x8566('0x29')];if(_0x40aed8['query'][_0x8566('0x31')]){_0xea61c9[_0x8566('0x32')]=[{'all':!![]}];}_0xea61c9=_['merge']({},_0xea61c9,_0x40aed8[_0x8566('0x33')]);return db[_0x8566('0x2a')][_0x8566('0x34')](_0xea61c9)[_0x8566('0x22')](handleEntityNotFound(_0x8a1dff,null))[_0x8566('0x22')](respondWithResult(_0x8a1dff,null))[_0x8566('0x35')](handleError(_0x8a1dff,null));};exports[_0x8566('0x21')]=function(_0xd21b12,_0x53ac00){if(_0xd21b12[_0x8566('0x36')]['id']){delete _0xd21b12[_0x8566('0x36')]['id'];}return db[_0x8566('0x2a')]['find']({'where':{'id':_0xd21b12[_0x8566('0x28')]['id']}})['then'](handleEntityNotFound(_0x53ac00,null))[_0x8566('0x22')](saveUpdates(_0xd21b12[_0x8566('0x36')],null))[_0x8566('0x22')](respondWithResult(_0x53ac00,null))[_0x8566('0x35')](handleError(_0x53ac00,null));};exports[_0x8566('0x37')]=function(_0xf5732f,_0x2f9d23){return db['ChatApplication']['find']({'where':{'id':_0xf5732f[_0x8566('0x28')]['id']}})['then'](handleEntityNotFound(_0x2f9d23,null))[_0x8566('0x22')](removeEntity(_0x2f9d23,null))[_0x8566('0x35')](handleError(_0x2f9d23,null));}; \ No newline at end of file +var _0xc2e8=['length','include','merge','options','find','catch','body','params','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','limit','offset','set','apply','save','update','destroy','then','error','stack','send','show','ChatApplication','rawAttributes','query','filters','intersection','model','fields','attributes'];(function(_0x456b03,_0x142feb){var _0x4eec22=function(_0x330d26){while(--_0x330d26){_0x456b03['push'](_0x456b03['shift']());}};_0x4eec22(++_0x142feb);}(_0xc2e8,0x70));var _0x8c2e=function(_0x3ce089,_0x1a4890){_0x3ce089=_0x3ce089-0x0;var _0x35b89d=_0xc2e8[_0x3ce089];return _0x35b89d;};'use strict';var emlformat=require(_0x8c2e('0x0'));var rimraf=require(_0x8c2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8c2e('0x2'));var moment=require('moment');var BPromise=require(_0x8c2e('0x3'));var Mustache=require(_0x8c2e('0x4'));var util=require(_0x8c2e('0x5'));var path=require('path');var sox=require(_0x8c2e('0x6'));var csv=require(_0x8c2e('0x7'));var ejs=require(_0x8c2e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8c2e('0x9'));var toCsv=require(_0x8c2e('0x7'));var querystring=require(_0x8c2e('0xa'));var Papa=require(_0x8c2e('0xb'));var Redis=require(_0x8c2e('0xc'));var authService=require(_0x8c2e('0xd'));var qs=require(_0x8c2e('0xe'));var as=require(_0x8c2e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c2e('0x10'))(_0x8c2e('0x11'));var utils=require(_0x8c2e('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31067c,_0x364b18){_0x364b18=_0x364b18||0xcc;return function(_0x2952f4){if(_0x2952f4){return _0x31067c[_0x8c2e('0x13')](_0x364b18);}return _0x31067c[_0x8c2e('0x14')](_0x364b18)[_0x8c2e('0x15')]();};}function respondWithResult(_0x26abe0,_0x4f9398){_0x4f9398=_0x4f9398||0xc8;return function(_0x5bedbb){if(_0x5bedbb){return _0x26abe0[_0x8c2e('0x14')](_0x4f9398)[_0x8c2e('0x16')](_0x5bedbb);}};}function respondWithFilteredResult(_0x2095d4,_0x2787af){return function(_0x203b3a){if(_0x203b3a){var _0x3e5f16=typeof _0x2787af['offset']===_0x8c2e('0x17')&&typeof _0x2787af[_0x8c2e('0x18')]===_0x8c2e('0x17');var _0x160901=_0x203b3a['count'];var _0x944b34=_0x3e5f16?0x0:_0x2787af[_0x8c2e('0x19')];var _0x2e2e46=_0x3e5f16?_0x203b3a['count']:_0x2787af['offset']+_0x2787af[_0x8c2e('0x18')];var _0x56a325;if(_0x2e2e46>=_0x160901){_0x2e2e46=_0x160901;_0x56a325=0xc8;}else{_0x56a325=0xce;}_0x2095d4[_0x8c2e('0x14')](_0x56a325);return _0x2095d4[_0x8c2e('0x1a')]('Content-Range',_0x944b34+'-'+_0x2e2e46+'/'+_0x160901)[_0x8c2e('0x16')](_0x203b3a);}return null;};}function patchUpdates(_0x3b101e){return function(_0x3f98f0){try{jsonpatch[_0x8c2e('0x1b')](_0x3f98f0,_0x3b101e,!![]);}catch(_0x107f13){return BPromise['reject'](_0x107f13);}return _0x3f98f0[_0x8c2e('0x1c')]();};}function saveUpdates(_0x5baf2e,_0x4937b0){return function(_0x308dd9){if(_0x308dd9){return _0x308dd9[_0x8c2e('0x1d')](_0x5baf2e)['then'](function(_0x556e83){return _0x556e83;});}return null;};}function removeEntity(_0xfc60d2,_0x5a389d){return function(_0x350cc5){if(_0x350cc5){return _0x350cc5[_0x8c2e('0x1e')]()[_0x8c2e('0x1f')](function(){_0xfc60d2['status'](0xcc)[_0x8c2e('0x15')]();});}};}function handleEntityNotFound(_0x15d275,_0x2dfd48){return function(_0x389297){if(!_0x389297){_0x15d275['sendStatus'](0x194);}return _0x389297;};}function handleError(_0x3c5f22,_0x50f221){_0x50f221=_0x50f221||0x1f4;return function(_0x4e823d){logger[_0x8c2e('0x20')](_0x4e823d[_0x8c2e('0x21')]);if(_0x4e823d['name']){delete _0x4e823d['name'];}_0x3c5f22[_0x8c2e('0x14')](_0x50f221)[_0x8c2e('0x22')](_0x4e823d);};}exports[_0x8c2e('0x23')]=function(_0x46a69f,_0xf9b0d4){var _0x4696e3={'raw':!![],'where':{'id':_0x46a69f['params']['id']}},_0x39a9bc={};_0x39a9bc['model']=_['keys'](db[_0x8c2e('0x24')][_0x8c2e('0x25')]);_0x39a9bc[_0x8c2e('0x26')]=_['keys'](_0x46a69f[_0x8c2e('0x26')]);_0x39a9bc[_0x8c2e('0x27')]=_[_0x8c2e('0x28')](_0x39a9bc[_0x8c2e('0x29')],_0x39a9bc[_0x8c2e('0x26')]);_0x4696e3['attributes']=_[_0x8c2e('0x28')](_0x39a9bc[_0x8c2e('0x29')],qs['fields'](_0x46a69f[_0x8c2e('0x26')][_0x8c2e('0x2a')]));_0x4696e3[_0x8c2e('0x2b')]=_0x4696e3[_0x8c2e('0x2b')][_0x8c2e('0x2c')]?_0x4696e3[_0x8c2e('0x2b')]:_0x39a9bc[_0x8c2e('0x29')];if(_0x46a69f[_0x8c2e('0x26')]['includeAll']){_0x4696e3[_0x8c2e('0x2d')]=[{'all':!![]}];}_0x4696e3=_[_0x8c2e('0x2e')]({},_0x4696e3,_0x46a69f[_0x8c2e('0x2f')]);return db[_0x8c2e('0x24')][_0x8c2e('0x30')](_0x4696e3)[_0x8c2e('0x1f')](handleEntityNotFound(_0xf9b0d4,null))[_0x8c2e('0x1f')](respondWithResult(_0xf9b0d4,null))[_0x8c2e('0x31')](handleError(_0xf9b0d4,null));};exports[_0x8c2e('0x1d')]=function(_0x570fe3,_0x252346){if(_0x570fe3[_0x8c2e('0x32')]['id']){delete _0x570fe3[_0x8c2e('0x32')]['id'];}return db[_0x8c2e('0x24')][_0x8c2e('0x30')]({'where':{'id':_0x570fe3['params']['id']}})['then'](handleEntityNotFound(_0x252346,null))[_0x8c2e('0x1f')](saveUpdates(_0x570fe3[_0x8c2e('0x32')],null))[_0x8c2e('0x1f')](respondWithResult(_0x252346,null))[_0x8c2e('0x31')](handleError(_0x252346,null));};exports[_0x8c2e('0x1e')]=function(_0x31c677,_0x3877a9){return db['ChatApplication']['find']({'where':{'id':_0x31c677[_0x8c2e('0x33')]['id']}})[_0x8c2e('0x1f')](handleEntityNotFound(_0x3877a9,null))[_0x8c2e('0x1f')](removeEntity(_0x3877a9,null))[_0x8c2e('0x31')](handleError(_0x3877a9,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 63c4826..4ec160e 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0534=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x4b2a60,_0x52669e){var _0x3b1d81=function(_0x17c0e6){while(--_0x17c0e6){_0x4b2a60['push'](_0x4b2a60['shift']());}};_0x3b1d81(++_0x52669e);}(_0x0534,0x190));var _0x4053=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x0534[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x4053('0x0'));var util=require(_0x4053('0x1'));var logger=require('../../config/logger')(_0x4053('0x2'));var moment=require('moment');var BPromise=require(_0x4053('0x3'));var rp=require(_0x4053('0x4'));var fs=require('fs');var path=require(_0x4053('0x5'));var rimraf=require(_0x4053('0x6'));var config=require(_0x4053('0x7'));var attributes=require('./chatApplication.attributes');module[_0x4053('0x8')]=function(_0x3bdcc3,_0x2cf4d4){return _0x3bdcc3[_0x4053('0x9')]('ChatApplication',attributes,{'tableName':_0x4053('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4053('0xb'),'collate':_0x4053('0xc')});}; \ No newline at end of file +var _0x69dd=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x38cab0,_0x1995f2){var _0x2fbf28=function(_0x53e2e3){while(--_0x53e2e3){_0x38cab0['push'](_0x38cab0['shift']());}};_0x2fbf28(++_0x1995f2);}(_0x69dd,0x117));var _0xd69d=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x69dd[_0x4c1ec2];return _0x3f6f1c;};'use strict';var _=require(_0xd69d('0x0'));var util=require('util');var logger=require(_0xd69d('0x1'))(_0xd69d('0x2'));var moment=require(_0xd69d('0x3'));var BPromise=require(_0xd69d('0x4'));var rp=require(_0xd69d('0x5'));var fs=require('fs');var path=require(_0xd69d('0x6'));var rimraf=require(_0xd69d('0x7'));var config=require(_0xd69d('0x8'));var attributes=require(_0xd69d('0x9'));module[_0xd69d('0xa')]=function(_0x59429a,_0x231e00){return _0x59429a[_0xd69d('0xb')](_0xd69d('0xc'),attributes,{'tableName':_0xd69d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd69d('0xe'),'collate':_0xd69d('0xf')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 527de1e..e6b2539 100644 --- a/server/api/chatApplication/chatApplication.rpc.js +++ b/server/api/chatApplication/chatApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x909d=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0x909d,0xcd));var _0xd909=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x909d[_0x257642];return _0x3d813b;};'use strict';var _=require(_0xd909('0x0'));var util=require(_0xd909('0x1'));var moment=require(_0xd909('0x2'));var BPromise=require('bluebird');var rs=require(_0xd909('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd909('0x4'))['db'];var utils=require(_0xd909('0x5'));var logger=require(_0xd909('0x6'))(_0xd909('0x7'));var config=require(_0xd909('0x8'));var jayson=require(_0xd909('0x9'));var client=jayson['client'][_0xd909('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56e541,_0x46a72e,_0x5b2858){return new BPromise(function(_0x5ade91,_0x42a717){return client['request'](_0x56e541,_0x5b2858)[_0xd909('0xb')](function(_0x56adef){logger[_0xd909('0xc')](_0xd909('0xd'),_0x46a72e,'request\x20sent');logger[_0xd909('0xe')](_0xd909('0xf'),_0x46a72e,_0xd909('0x10'),JSON[_0xd909('0x11')](_0x56adef));if(_0x56adef[_0xd909('0x12')]){if(_0x56adef[_0xd909('0x12')][_0xd909('0x13')]===0x1f4){logger[_0xd909('0x12')](_0xd909('0xd'),_0x46a72e,_0x56adef[_0xd909('0x12')][_0xd909('0x14')]);return _0x42a717(_0x56adef[_0xd909('0x12')][_0xd909('0x14')]);}logger[_0xd909('0x12')](_0xd909('0xd'),_0x46a72e,_0x56adef[_0xd909('0x12')][_0xd909('0x14')]);return _0x5ade91(_0x56adef[_0xd909('0x12')][_0xd909('0x14')]);}else{logger[_0xd909('0xc')]('ChatApplication,\x20%s,\x20%s',_0x46a72e,'request\x20sent');_0x5ade91(_0x56adef[_0xd909('0x15')]['message']);}})[_0xd909('0x16')](function(_0x1cb6e8){logger[_0xd909('0x12')]('ChatApplication,\x20%s,\x20%s',_0x46a72e,_0x1cb6e8);_0x42a717(_0x1cb6e8);});});} \ No newline at end of file +var _0xf4d0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0xf4d0,0x10c));var _0x0f4d=function(_0x18ca67,_0x2cf142){_0x18ca67=_0x18ca67-0x0;var _0x356779=_0xf4d0[_0x18ca67];return _0x356779;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0f4d('0x0'));var BPromise=require(_0x0f4d('0x1'));var rs=require(_0x0f4d('0x2'));var fs=require('fs');var Redis=require(_0x0f4d('0x3'));var db=require(_0x0f4d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f4d('0x5'))(_0x0f4d('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f4d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x90c944,_0x6185db,_0x2ffa19){return new BPromise(function(_0x13995f,_0x192111){return client[_0x0f4d('0x8')](_0x90c944,_0x2ffa19)['then'](function(_0x2a81ff){logger[_0x0f4d('0x9')](_0x0f4d('0xa'),_0x6185db,_0x0f4d('0xb'));logger[_0x0f4d('0xc')](_0x0f4d('0xd'),_0x6185db,_0x0f4d('0xb'),JSON['stringify'](_0x2a81ff));if(_0x2a81ff[_0x0f4d('0xe')]){if(_0x2a81ff['error'][_0x0f4d('0xf')]===0x1f4){logger[_0x0f4d('0xe')](_0x0f4d('0xa'),_0x6185db,_0x2a81ff[_0x0f4d('0xe')][_0x0f4d('0x10')]);return _0x192111(_0x2a81ff[_0x0f4d('0xe')][_0x0f4d('0x10')]);}logger['error'](_0x0f4d('0xa'),_0x6185db,_0x2a81ff[_0x0f4d('0xe')][_0x0f4d('0x10')]);return _0x13995f(_0x2a81ff[_0x0f4d('0xe')][_0x0f4d('0x10')]);}else{logger[_0x0f4d('0x9')]('ChatApplication,\x20%s,\x20%s',_0x6185db,_0x0f4d('0xb'));_0x13995f(_0x2a81ff['result']['message']);}})[_0x0f4d('0x11')](function(_0x3b7ab9){logger['error'](_0x0f4d('0xa'),_0x6185db,_0x3b7ab9);_0x192111(_0x3b7ab9);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 4ceddf1..8b6dc32 100644 --- a/server/api/chatApplication/index.js +++ b/server/api/chatApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0c8=['Router','fs-extra','../../components/auth/service','./chatApplication.controller','get','isAuthenticated','show','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xd0c8,0x129));var _0x8d0c=function(_0x551253,_0x49705a){_0x551253=_0x551253-0x0;var _0x4d63b4=_0xd0c8[_0x551253];return _0x4d63b4;};'use strict';var multer=require(_0x8d0c('0x0'));var util=require(_0x8d0c('0x1'));var path=require('path');var timeout=require(_0x8d0c('0x2'));var express=require('express');var router=express[_0x8d0c('0x3')]();var fs_extra=require(_0x8d0c('0x4'));var auth=require(_0x8d0c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8d0c('0x6'));router[_0x8d0c('0x7')]('/:id',auth[_0x8d0c('0x8')](),controller[_0x8d0c('0x9')]);router['put'](_0x8d0c('0xa'),auth[_0x8d0c('0x8')](),controller[_0x8d0c('0xb')]);router[_0x8d0c('0xc')](_0x8d0c('0xa'),auth[_0x8d0c('0x8')](),controller[_0x8d0c('0xd')]);module[_0x8d0c('0xe')]=router; \ No newline at end of file +var _0xc109=['/:id','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatApplication.controller','isAuthenticated'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xc109,0xeb));var _0x9c10=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0xc109[_0x145b3c];return _0x1b6e36;};'use strict';var multer=require('multer');var util=require(_0x9c10('0x0'));var path=require('path');var timeout=require(_0x9c10('0x1'));var express=require(_0x9c10('0x2'));var router=express[_0x9c10('0x3')]();var fs_extra=require(_0x9c10('0x4'));var auth=require(_0x9c10('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9c10('0x6'));router['get']('/:id',auth[_0x9c10('0x7')](),controller['show']);router['put'](_0x9c10('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9c10('0x8'),auth[_0x9c10('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index f46b6b2..8210d7a 100644 --- a/server/api/chatGroup/chatGroup.attributes.js +++ b/server/api/chatGroup/chatGroup.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0146=['BOOLEAN','exports','STRING'];(function(_0x38798c,_0x327289){var _0x44f9bd=function(_0x47090f){while(--_0x47090f){_0x38798c['push'](_0x38798c['shift']());}};_0x44f9bd(++_0x327289);}(_0x0146,0x118));var _0x6014=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x0146[_0xa8883];return _0x479426;};'use strict';var Sequelize=require('sequelize');module[_0x6014('0x0')]={'name':{'type':Sequelize[_0x6014('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x6014('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5707=['sequelize','exports','STRING','BOOLEAN'];(function(_0x6a0348,_0x4e52f1){var _0x319d9e=function(_0x4ce599){while(--_0x4ce599){_0x6a0348['push'](_0x6a0348['shift']());}};_0x319d9e(++_0x4e52f1);}(_0x5707,0x134));var _0x7570=function(_0x210b46,_0x52a05f){_0x210b46=_0x210b46-0x0;var _0x203df2=_0x5707[_0x210b46];return _0x203df2;};'use strict';var Sequelize=require(_0x7570('0x0'));module[_0x7570('0x1')]={'name':{'type':Sequelize[_0x7570('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7570('0x2')]},'write':{'type':Sequelize[_0x7570('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 625d0c1..cc50b5f 100644 --- a/server/api/chatGroup/chatGroup.controller.js +++ b/server/api/chatGroup/chatGroup.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x748d=['addMessage','ChatGroupId','findOne','$gte','format','getMessages','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','sendStatus','error','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','catch','show','params','create','body','find','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','getMembers','removeMembers'];(function(_0x2a7fda,_0x415fac){var _0xd88915=function(_0x16b98c){while(--_0x16b98c){_0x2a7fda['push'](_0x2a7fda['shift']());}};_0xd88915(++_0x415fac);}(_0x748d,0x1d2));var _0xd748=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x748d[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0xd748('0x0'));var rimraf=require(_0xd748('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd748('0x2'));var moment=require(_0xd748('0x3'));var BPromise=require(_0xd748('0x4'));var Mustache=require(_0xd748('0x5'));var util=require(_0xd748('0x6'));var path=require(_0xd748('0x7'));var sox=require(_0xd748('0x8'));var csv=require(_0xd748('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd748('0xa'));var squel=require(_0xd748('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd748('0xc'));var toCsv=require(_0xd748('0x9'));var querystring=require('querystring');var Papa=require(_0xd748('0xd'));var Redis=require(_0xd748('0xe'));var authService=require(_0xd748('0xf'));var qs=require(_0xd748('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd748('0x11'));var logger=require('../../config/logger')(_0xd748('0x12'));var utils=require(_0xd748('0x13'));var config=require(_0xd748('0x14'));var licenseUtil=require(_0xd748('0x15'));var db=require('../../mysqldb')['db'];config[_0xd748('0x16')]=_[_0xd748('0x17')](config['redis'],{'host':_0xd748('0x18'),'port':0x18eb});var socket=require(_0xd748('0x19'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xd748('0x1a')](socket);function respondWithStatusCode(_0x1a7af4,_0x79e398){_0x79e398=_0x79e398||0xcc;return function(_0x4174a0){if(_0x4174a0){return _0x1a7af4['sendStatus'](_0x79e398);}return _0x1a7af4[_0xd748('0x1b')](_0x79e398)[_0xd748('0x1c')]();};}function respondWithResult(_0x4b017e,_0x3b0273){_0x3b0273=_0x3b0273||0xc8;return function(_0xcd34fe){if(_0xcd34fe){return _0x4b017e[_0xd748('0x1b')](_0x3b0273)[_0xd748('0x1d')](_0xcd34fe);}};}function respondWithFilteredResult(_0x1cf5a5,_0x39bfa6){return function(_0x5dfac4){if(_0x5dfac4){var _0x107bcb=typeof _0x39bfa6['offset']==='undefined'&&typeof _0x39bfa6[_0xd748('0x1e')]===_0xd748('0x1f');var _0x11f9f2=_0x5dfac4['count'];var _0x4e78a1=_0x107bcb?0x0:_0x39bfa6['offset'];var _0x1b3645=_0x107bcb?_0x5dfac4[_0xd748('0x20')]:_0x39bfa6[_0xd748('0x21')]+_0x39bfa6['limit'];var _0x4454da;if(_0x1b3645>=_0x11f9f2){_0x1b3645=_0x11f9f2;_0x4454da=0xc8;}else{_0x4454da=0xce;}_0x1cf5a5[_0xd748('0x1b')](_0x4454da);return _0x1cf5a5[_0xd748('0x22')](_0xd748('0x23'),_0x4e78a1+'-'+_0x1b3645+'/'+_0x11f9f2)[_0xd748('0x1d')](_0x5dfac4);}return null;};}function patchUpdates(_0x3357b2){return function(_0x73a93b){try{jsonpatch[_0xd748('0x24')](_0x73a93b,_0x3357b2,!![]);}catch(_0x2a743c){return BPromise['reject'](_0x2a743c);}return _0x73a93b['save']();};}function saveUpdates(_0x42ebfe,_0xefb2a5){return function(_0xf0de35){if(_0xf0de35){return _0xf0de35[_0xd748('0x25')](_0x42ebfe)[_0xd748('0x26')](function(_0x2dd82b){return _0x2dd82b;});}return null;};}function removeEntity(_0x18234e,_0x5a923a){return function(_0x1d358a){if(_0x1d358a){return _0x1d358a['destroy']()[_0xd748('0x26')](function(){_0x18234e[_0xd748('0x1b')](0xcc)[_0xd748('0x1c')]();});}};}function handleEntityNotFound(_0x57b1f0,_0x8c53a9){return function(_0x389ca6){if(!_0x389ca6){_0x57b1f0[_0xd748('0x27')](0x194);}return _0x389ca6;};}function handleError(_0x1d8bb7,_0x42e107){_0x42e107=_0x42e107||0x1f4;return function(_0x18be88){logger[_0xd748('0x28')](_0x18be88['stack']);if(_0x18be88[_0xd748('0x29')]){delete _0x18be88['name'];}_0x1d8bb7['status'](_0x42e107)['send'](_0x18be88);};}exports['index']=function(_0x54e84f,_0x463306){var _0x4d2d5a={},_0x104091={},_0x509a4a={'count':0x0,'rows':[]};var _0x966be6=_[_0xd748('0x2a')](db['ChatGroup'][_0xd748('0x2b')],function(_0x23af1b){return{'name':_0x23af1b[_0xd748('0x2c')],'type':_0x23af1b[_0xd748('0x2d')][_0xd748('0x2e')]};});_0x104091[_0xd748('0x2f')]=_['map'](_0x966be6,_0xd748('0x29'));_0x104091[_0xd748('0x30')]=_[_0xd748('0x31')](_0x54e84f[_0xd748('0x30')]);_0x104091[_0xd748('0x32')]=_[_0xd748('0x33')](_0x104091['model'],_0x104091[_0xd748('0x30')]);_0x4d2d5a['attributes']=_[_0xd748('0x33')](_0x104091[_0xd748('0x2f')],qs[_0xd748('0x34')](_0x54e84f[_0xd748('0x30')][_0xd748('0x34')]));_0x4d2d5a[_0xd748('0x35')]=_0x4d2d5a[_0xd748('0x35')][_0xd748('0x36')]?_0x4d2d5a[_0xd748('0x35')]:_0x104091[_0xd748('0x2f')];if(!_0x54e84f[_0xd748('0x30')][_0xd748('0x37')](_0xd748('0x38'))){_0x4d2d5a['limit']=qs[_0xd748('0x1e')](_0x54e84f[_0xd748('0x30')][_0xd748('0x1e')]);_0x4d2d5a[_0xd748('0x21')]=qs[_0xd748('0x21')](_0x54e84f['query']['offset']);}_0x4d2d5a[_0xd748('0x39')]=qs[_0xd748('0x3a')](_0x54e84f[_0xd748('0x30')][_0xd748('0x3a')]);_0x4d2d5a[_0xd748('0x3b')]=qs[_0xd748('0x32')](_[_0xd748('0x3c')](_0x54e84f['query'],_0x104091[_0xd748('0x32')]),_0x966be6);if(_0x54e84f['query'][_0xd748('0x3d')]){_0x4d2d5a[_0xd748('0x3b')]=_[_0xd748('0x3e')](_0x4d2d5a[_0xd748('0x3b')],{'$or':_[_0xd748('0x2a')](_0x966be6,function(_0x18e5c1){if(_0x18e5c1[_0xd748('0x2d')]!==_0xd748('0x3f')){var _0x305cd5={};_0x305cd5[_0x18e5c1['name']]={'$like':'%'+_0x54e84f[_0xd748('0x30')][_0xd748('0x3d')]+'%'};return _0x305cd5;}})});}_0x4d2d5a=_[_0xd748('0x3e')]({},_0x4d2d5a,_0x54e84f[_0xd748('0x40')]);var _0xd4d822={'where':_0x4d2d5a[_0xd748('0x3b')]};return db[_0xd748('0x41')][_0xd748('0x20')](_0xd4d822)[_0xd748('0x26')](function(_0x18fb52){_0x509a4a[_0xd748('0x20')]=_0x18fb52;if(_0x54e84f[_0xd748('0x30')][_0xd748('0x42')]){_0x4d2d5a[_0xd748('0x43')]=[{'all':!![]}];}return db['ChatGroup'][_0xd748('0x44')](_0x4d2d5a);})[_0xd748('0x26')](function(_0x2c06fa){_0x509a4a['rows']=_0x2c06fa;return _0x509a4a;})[_0xd748('0x26')](respondWithFilteredResult(_0x463306,_0x4d2d5a))[_0xd748('0x45')](handleError(_0x463306,null));};exports[_0xd748('0x46')]=function(_0x9f7466,_0x5e2e63){var _0x10380a={'raw':!![],'where':{'id':_0x9f7466[_0xd748('0x47')]['id']}},_0x3aef0b={};_0x3aef0b['model']=_[_0xd748('0x31')](db[_0xd748('0x41')][_0xd748('0x2b')]);_0x3aef0b[_0xd748('0x30')]=_['keys'](_0x9f7466[_0xd748('0x30')]);_0x3aef0b['filters']=_[_0xd748('0x33')](_0x3aef0b[_0xd748('0x2f')],_0x3aef0b[_0xd748('0x30')]);_0x10380a[_0xd748('0x35')]=_[_0xd748('0x33')](_0x3aef0b[_0xd748('0x2f')],qs[_0xd748('0x34')](_0x9f7466[_0xd748('0x30')][_0xd748('0x34')]));_0x10380a[_0xd748('0x35')]=_0x10380a[_0xd748('0x35')][_0xd748('0x36')]?_0x10380a[_0xd748('0x35')]:_0x3aef0b[_0xd748('0x2f')];if(_0x9f7466[_0xd748('0x30')][_0xd748('0x42')]){_0x10380a[_0xd748('0x43')]=[{'all':!![]}];}_0x10380a=_[_0xd748('0x3e')]({},_0x10380a,_0x9f7466[_0xd748('0x40')]);return db[_0xd748('0x41')]['find'](_0x10380a)[_0xd748('0x26')](handleEntityNotFound(_0x5e2e63,null))[_0xd748('0x26')](respondWithResult(_0x5e2e63,null))[_0xd748('0x45')](handleError(_0x5e2e63,null));};exports[_0xd748('0x48')]=function(_0x4b880c,_0x388337){return db[_0xd748('0x41')][_0xd748('0x48')](_0x4b880c[_0xd748('0x49')],{})[_0xd748('0x26')](respondWithResult(_0x388337,0xc9))[_0xd748('0x45')](handleError(_0x388337,null));};exports[_0xd748('0x25')]=function(_0x1b2e2a,_0x206f2b){if(_0x1b2e2a[_0xd748('0x49')]['id']){delete _0x1b2e2a[_0xd748('0x49')]['id'];}return db[_0xd748('0x41')][_0xd748('0x4a')]({'where':{'id':_0x1b2e2a[_0xd748('0x47')]['id']}})['then'](handleEntityNotFound(_0x206f2b,null))[_0xd748('0x26')](saveUpdates(_0x1b2e2a[_0xd748('0x49')],null))[_0xd748('0x26')](respondWithResult(_0x206f2b,null))['catch'](handleError(_0x206f2b,null));};exports[_0xd748('0x4b')]=function(_0x10e1a5,_0x1a6283){return db[_0xd748('0x41')][_0xd748('0x4a')]({'where':{'id':_0x10e1a5[_0xd748('0x47')]['id']}})[_0xd748('0x26')](handleEntityNotFound(_0x1a6283,null))[_0xd748('0x26')](removeEntity(_0x1a6283,null))[_0xd748('0x45')](handleError(_0x1a6283,null));};exports[_0xd748('0x4c')]=function(_0x4d6d9d,_0x602755){return db[_0xd748('0x41')][_0xd748('0x4c')]()[_0xd748('0x26')](respondWithResult(_0x602755,null))[_0xd748('0x45')](handleError(_0x602755,null));};exports['getUnread']=function(_0x7dc982,_0x3dab7d,_0x5b832c){return db[_0xd748('0x4d')]['count']({'where':{'ChatGroupId':_0x7dc982[_0xd748('0x47')]['id'],'ToId':_0x7dc982[_0xd748('0x4e')]['id'],'read':![]}})[_0xd748('0x26')](function(_0x447f70){return{'id':_[_0xd748('0x4f')](_0x7dc982[_0xd748('0x47')]['id']),'count':_0x447f70};})[_0xd748('0x26')](respondWithResult(_0x3dab7d,null))['catch'](handleError(_0x3dab7d,null));};exports['addMembers']=function(_0x361945,_0x3e281a,_0x240f16){return db[_0xd748('0x41')]['find']({'where':{'id':_0x361945['params']['id']}})[_0xd748('0x26')](handleEntityNotFound(_0x3e281a,null))[_0xd748('0x26')](function(_0x7d210f){if(_0x7d210f){return _0x7d210f[_0xd748('0x50')](_0x361945[_0xd748('0x49')][_0xd748('0x51')],_[_0xd748('0x52')](_0x361945[_0xd748('0x49')],[_0xd748('0x51'),'id'])||{});}})[_0xd748('0x26')](respondWithResult(_0x3e281a,null))[_0xd748('0x45')](handleError(_0x3e281a,null));};exports['getMembers']=function(_0x22e8b6,_0x546190,_0x3e2f60){var _0x87e5f3={};var _0x5c1d0a={};var _0x4979bf;var _0x44489f;return db['ChatGroup']['findOne']({'where':{'id':_0x22e8b6[_0xd748('0x47')]['id']}})[_0xd748('0x26')](handleEntityNotFound(_0x546190,null))[_0xd748('0x26')](function(_0x548b75){if(_0x548b75){_0x4979bf=_0x548b75;_0x5c1d0a[_0xd748('0x2f')]=_[_0xd748('0x31')](db[_0xd748('0x53')][_0xd748('0x2b')]);_0x5c1d0a[_0xd748('0x30')]=_[_0xd748('0x31')](_0x22e8b6[_0xd748('0x30')]);_0x5c1d0a['filters']=_[_0xd748('0x33')](_0x5c1d0a[_0xd748('0x2f')],_0x5c1d0a[_0xd748('0x30')]);_0x87e5f3['attributes']=_[_0xd748('0x33')](_0x5c1d0a[_0xd748('0x2f')],qs[_0xd748('0x34')](_0x22e8b6['query'][_0xd748('0x34')]));_0x87e5f3[_0xd748('0x35')]=_0x87e5f3[_0xd748('0x35')][_0xd748('0x36')]?_0x87e5f3[_0xd748('0x35')]:_0x5c1d0a[_0xd748('0x2f')];_0x87e5f3[_0xd748('0x39')]=qs[_0xd748('0x3a')](_0x22e8b6[_0xd748('0x30')][_0xd748('0x3a')]);_0x87e5f3[_0xd748('0x3b')]=qs['filters'](_['pick'](_0x22e8b6[_0xd748('0x30')],_0x5c1d0a['filters']));if(_0x22e8b6[_0xd748('0x30')]['filter']){_0x87e5f3[_0xd748('0x3b')]=_['merge'](_0x87e5f3['where'],{'$or':_[_0xd748('0x2a')](_0x87e5f3[_0xd748('0x35')],function(_0xc50129){var _0xe7b571={};_0xe7b571[_0xc50129]={'$like':'%'+_0x22e8b6[_0xd748('0x30')][_0xd748('0x3d')]+'%'};return _0xe7b571;})});}_0x87e5f3=_[_0xd748('0x3e')]({},_0x87e5f3,_0x22e8b6['options']);return _0x4979bf[_0xd748('0x54')](_0x87e5f3);}})['then'](function(_0x5d54ec){if(_0x5d54ec){_0x44489f=_0x5d54ec[_0xd748('0x36')];if(!_0x22e8b6[_0xd748('0x30')]['hasOwnProperty'](_0xd748('0x38'))){_0x87e5f3['limit']=qs[_0xd748('0x1e')](_0x22e8b6[_0xd748('0x30')]['limit']);_0x87e5f3[_0xd748('0x21')]=qs[_0xd748('0x21')](_0x22e8b6[_0xd748('0x30')][_0xd748('0x21')]);}return _0x4979bf[_0xd748('0x54')](_0x87e5f3);}})['then'](function(_0x2862bf){if(_0x2862bf){return _0x2862bf?{'count':_0x44489f,'rows':_0x2862bf}:null;}})['then'](respondWithResult(_0x546190,null))[_0xd748('0x45')](handleError(_0x546190,null));};exports[_0xd748('0x55')]=function(_0x3dfcc8,_0x4f4287,_0x8186){return db[_0xd748('0x41')][_0xd748('0x4a')]({'where':{'id':_0x3dfcc8[_0xd748('0x47')]['id']}})[_0xd748('0x26')](handleEntityNotFound(_0x4f4287,null))[_0xd748('0x26')](function(_0x1dd51e){if(_0x1dd51e){return _0x1dd51e[_0xd748('0x55')](_0x3dfcc8[_0xd748('0x30')][_0xd748('0x51')]);}})[_0xd748('0x26')](respondWithStatusCode(_0x4f4287,null))[_0xd748('0x45')](handleError(_0x4f4287,null));};exports[_0xd748('0x56')]=function(_0x11db5d,_0x43253b,_0x31548f){if(_0x11db5d['body']['id']){delete _0x11db5d['body']['id'];}return db['ChatGroup'][_0xd748('0x4a')]({'where':{'id':_0x11db5d['params']['id']}})[_0xd748('0x26')](handleEntityNotFound(_0x43253b,null))[_0xd748('0x26')](function(_0x38627c){if(_0x38627c){_0x11db5d[_0xd748('0x49')][_0xd748('0x57')]=_0x38627c['id'];return db[_0xd748('0x4d')]['create'](_0x11db5d[_0xd748('0x49')]);}})[_0xd748('0x26')](respondWithResult(_0x43253b,null))['catch'](handleError(_0x43253b,null));};exports['getMessages']=function(_0x1f1975,_0x5e8729,_0x40a380){var _0x55b313={};var _0x1cebf4={};var _0xb98bfe;var _0x600b5e;return db[_0xd748('0x41')][_0xd748('0x58')]({'where':{'id':_0x1f1975[_0xd748('0x47')]['id']}})[_0xd748('0x26')](handleEntityNotFound(_0x5e8729,null))[_0xd748('0x26')](function(_0x128e35){if(_0x128e35){_0xb98bfe=_0x128e35;_0x1cebf4[_0xd748('0x2f')]=_[_0xd748('0x31')](db['ChatInternalMessage'][_0xd748('0x2b')]);_0x1cebf4[_0xd748('0x30')]=_[_0xd748('0x31')](_0x1f1975[_0xd748('0x30')]);_0x1cebf4['filters']=_[_0xd748('0x33')](_0x1cebf4[_0xd748('0x2f')],_0x1cebf4[_0xd748('0x30')]);_0x55b313['attributes']=_[_0xd748('0x33')](_0x1cebf4[_0xd748('0x2f')],qs['fields'](_0x1f1975[_0xd748('0x30')][_0xd748('0x34')]));_0x55b313[_0xd748('0x35')]=_0x55b313[_0xd748('0x35')]['length']?_0x55b313['attributes']:_0x1cebf4[_0xd748('0x2f')];_0x55b313[_0xd748('0x39')]=qs[_0xd748('0x3a')](_0x1f1975[_0xd748('0x30')][_0xd748('0x3a')]);_0x55b313[_0xd748('0x3b')]=qs[_0xd748('0x32')](_[_0xd748('0x3c')](_0x1f1975['query'],_0x1cebf4[_0xd748('0x32')]));if(_0x1f1975[_0xd748('0x30')][_0xd748('0x3d')]){_0x55b313['where']=_[_0xd748('0x3e')](_0x55b313['where'],{'$or':_[_0xd748('0x2a')](_0x55b313['attributes'],function(_0x382e19){var _0x2eba41={};_0x2eba41[_0x382e19]={'$like':'%'+_0x1f1975[_0xd748('0x30')][_0xd748('0x3d')]+'%'};return _0x2eba41;})});}if(_0x1f1975[_0xd748('0x30')][_0xd748('0x59')]){var _0x1695e0=_0x1f1975[_0xd748('0x30')][_0xd748('0x59')]['split'](',');var _0x195343={};_0x195343[_0x1695e0[0x0]]={'$gte':moment(_0x1695e0[0x1])[_0xd748('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x55b313[_0xd748('0x3b')]=_[_0xd748('0x3e')](_0x55b313[_0xd748('0x3b')],_0x195343);}_0x55b313=_[_0xd748('0x3e')]({},_0x55b313,_0x1f1975[_0xd748('0x40')]);return _0xb98bfe[_0xd748('0x5b')](_0x55b313);}})[_0xd748('0x26')](function(_0xcb1ce0){if(_0xcb1ce0){_0x600b5e=_0xcb1ce0[_0xd748('0x36')];if(!_0x1f1975[_0xd748('0x30')][_0xd748('0x37')](_0xd748('0x38'))){_0x55b313['limit']=qs[_0xd748('0x1e')](_0x1f1975[_0xd748('0x30')][_0xd748('0x1e')]);_0x55b313['offset']=qs[_0xd748('0x21')](_0x1f1975[_0xd748('0x30')][_0xd748('0x21')]);}return _0xb98bfe[_0xd748('0x5b')](_0x55b313);}})[_0xd748('0x26')](function(_0x1fcf4d){if(_0x1fcf4d){return _0x1fcf4d?{'count':_0x600b5e,'rows':_0x1fcf4d}:null;}})[_0xd748('0x26')](respondWithResult(_0x5e8729,null))[_0xd748('0x45')](handleError(_0x5e8729,null));}; \ No newline at end of file +var _0x7b67=['request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','error','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','removeMembers','addMessage','ChatGroupId','$gte','split','format','getMessages','eml-format','rimraf','fast-json-patch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b67,0x11d));var _0x77b6=function(_0x628cd5,_0x1082c7){_0x628cd5=_0x628cd5-0x0;var _0x309431=_0x7b67[_0x628cd5];return _0x309431;};'use strict';var emlformat=require(_0x77b6('0x0'));var rimraf=require(_0x77b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77b6('0x2'));var rp=require(_0x77b6('0x3'));var moment=require(_0x77b6('0x4'));var BPromise=require(_0x77b6('0x5'));var Mustache=require(_0x77b6('0x6'));var util=require(_0x77b6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x77b6('0x8'));var ejs=require(_0x77b6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77b6('0xa'));var squel=require(_0x77b6('0xb'));var crypto=require(_0x77b6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x77b6('0xd'));var toCsv=require(_0x77b6('0x8'));var querystring=require(_0x77b6('0xe'));var Papa=require(_0x77b6('0xf'));var Redis=require(_0x77b6('0x10'));var authService=require(_0x77b6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x77b6('0x12'));var hardwareService=require(_0x77b6('0x13'));var logger=require('../../config/logger')(_0x77b6('0x14'));var utils=require(_0x77b6('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x77b6('0x16'))['db'];config[_0x77b6('0x17')]=_[_0x77b6('0x18')](config['redis'],{'host':_0x77b6('0x19'),'port':0x18eb});var socket=require(_0x77b6('0x1a'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x77b6('0x1b')](socket);function respondWithStatusCode(_0x542ecb,_0x1c7530){_0x1c7530=_0x1c7530||0xcc;return function(_0x51c7e1){if(_0x51c7e1){return _0x542ecb[_0x77b6('0x1c')](_0x1c7530);}return _0x542ecb[_0x77b6('0x1d')](_0x1c7530)['end']();};}function respondWithResult(_0x5ebc68,_0x3950e0){_0x3950e0=_0x3950e0||0xc8;return function(_0x2d4635){if(_0x2d4635){return _0x5ebc68[_0x77b6('0x1d')](_0x3950e0)['json'](_0x2d4635);}};}function respondWithFilteredResult(_0x21430d,_0x5adf82){return function(_0x1b0812){if(_0x1b0812){var _0x5b9c98=typeof _0x5adf82[_0x77b6('0x1e')]===_0x77b6('0x1f')&&typeof _0x5adf82[_0x77b6('0x20')]==='undefined';var _0x255304=_0x1b0812[_0x77b6('0x21')];var _0x1db050=_0x5b9c98?0x0:_0x5adf82[_0x77b6('0x1e')];var _0x33b35b=_0x5b9c98?_0x1b0812[_0x77b6('0x21')]:_0x5adf82[_0x77b6('0x1e')]+_0x5adf82['limit'];var _0x3b1ad4;if(_0x33b35b>=_0x255304){_0x33b35b=_0x255304;_0x3b1ad4=0xc8;}else{_0x3b1ad4=0xce;}_0x21430d[_0x77b6('0x1d')](_0x3b1ad4);return _0x21430d[_0x77b6('0x22')](_0x77b6('0x23'),_0x1db050+'-'+_0x33b35b+'/'+_0x255304)[_0x77b6('0x24')](_0x1b0812);}return null;};}function patchUpdates(_0x15eec5){return function(_0x35be58){try{jsonpatch[_0x77b6('0x25')](_0x35be58,_0x15eec5,!![]);}catch(_0x5e103d){return BPromise[_0x77b6('0x26')](_0x5e103d);}return _0x35be58[_0x77b6('0x27')]();};}function saveUpdates(_0x496a73,_0x24cb9b){return function(_0xb1cce9){if(_0xb1cce9){return _0xb1cce9[_0x77b6('0x28')](_0x496a73)[_0x77b6('0x29')](function(_0x3458e6){return _0x3458e6;});}return null;};}function removeEntity(_0x667c09,_0x59c152){return function(_0x3bd795){if(_0x3bd795){return _0x3bd795['destroy']()['then'](function(){_0x667c09[_0x77b6('0x1d')](0xcc)[_0x77b6('0x2a')]();});}};}function handleEntityNotFound(_0x16e42c,_0xb7620d){return function(_0x23753f){if(!_0x23753f){_0x16e42c[_0x77b6('0x1c')](0x194);}return _0x23753f;};}function handleError(_0x41f86e,_0x119bf0){_0x119bf0=_0x119bf0||0x1f4;return function(_0x33ca0e){logger[_0x77b6('0x2b')](_0x33ca0e['stack']);if(_0x33ca0e['name']){delete _0x33ca0e['name'];}_0x41f86e[_0x77b6('0x1d')](_0x119bf0)['send'](_0x33ca0e);};}exports[_0x77b6('0x2c')]=function(_0x5cb80d,_0x5d25b7){var _0x2227b6={},_0x3b6c4f={},_0x6c5b75={'count':0x0,'rows':[]};var _0x4bc24b=_[_0x77b6('0x2d')](db[_0x77b6('0x2e')][_0x77b6('0x2f')],function(_0x3beb13){return{'name':_0x3beb13[_0x77b6('0x30')],'type':_0x3beb13[_0x77b6('0x31')][_0x77b6('0x32')]};});_0x3b6c4f[_0x77b6('0x33')]=_[_0x77b6('0x2d')](_0x4bc24b,_0x77b6('0x34'));_0x3b6c4f[_0x77b6('0x35')]=_['keys'](_0x5cb80d['query']);_0x3b6c4f['filters']=_[_0x77b6('0x36')](_0x3b6c4f[_0x77b6('0x33')],_0x3b6c4f[_0x77b6('0x35')]);_0x2227b6['attributes']=_[_0x77b6('0x36')](_0x3b6c4f[_0x77b6('0x33')],qs[_0x77b6('0x37')](_0x5cb80d[_0x77b6('0x35')][_0x77b6('0x37')]));_0x2227b6[_0x77b6('0x38')]=_0x2227b6[_0x77b6('0x38')][_0x77b6('0x39')]?_0x2227b6['attributes']:_0x3b6c4f[_0x77b6('0x33')];if(!_0x5cb80d[_0x77b6('0x35')][_0x77b6('0x3a')](_0x77b6('0x3b'))){_0x2227b6[_0x77b6('0x20')]=qs['limit'](_0x5cb80d['query'][_0x77b6('0x20')]);_0x2227b6[_0x77b6('0x1e')]=qs[_0x77b6('0x1e')](_0x5cb80d[_0x77b6('0x35')]['offset']);}_0x2227b6[_0x77b6('0x3c')]=qs[_0x77b6('0x3d')](_0x5cb80d[_0x77b6('0x35')]['sort']);_0x2227b6[_0x77b6('0x3e')]=qs[_0x77b6('0x3f')](_[_0x77b6('0x40')](_0x5cb80d[_0x77b6('0x35')],_0x3b6c4f[_0x77b6('0x3f')]),_0x4bc24b);if(_0x5cb80d[_0x77b6('0x35')][_0x77b6('0x41')]){_0x2227b6[_0x77b6('0x3e')]=_[_0x77b6('0x42')](_0x2227b6['where'],{'$or':_['map'](_0x4bc24b,function(_0x3c8a1d){if(_0x3c8a1d[_0x77b6('0x31')]!==_0x77b6('0x43')){var _0x2161f0={};_0x2161f0[_0x3c8a1d[_0x77b6('0x34')]]={'$like':'%'+_0x5cb80d[_0x77b6('0x35')][_0x77b6('0x41')]+'%'};return _0x2161f0;}})});}_0x2227b6=_['merge']({},_0x2227b6,_0x5cb80d[_0x77b6('0x44')]);var _0xd579f1={'where':_0x2227b6[_0x77b6('0x3e')]};return db[_0x77b6('0x2e')]['count'](_0xd579f1)[_0x77b6('0x29')](function(_0x4575ac){_0x6c5b75[_0x77b6('0x21')]=_0x4575ac;if(_0x5cb80d['query'][_0x77b6('0x45')]){_0x2227b6[_0x77b6('0x46')]=[{'all':!![]}];}return db[_0x77b6('0x2e')][_0x77b6('0x47')](_0x2227b6);})[_0x77b6('0x29')](function(_0x11d1e5){_0x6c5b75[_0x77b6('0x48')]=_0x11d1e5;return _0x6c5b75;})['then'](respondWithFilteredResult(_0x5d25b7,_0x2227b6))[_0x77b6('0x49')](handleError(_0x5d25b7,null));};exports[_0x77b6('0x4a')]=function(_0x3c8e6a,_0x1c86ea){var _0x424c85={'raw':!![],'where':{'id':_0x3c8e6a['params']['id']}},_0x55102b={};_0x55102b[_0x77b6('0x33')]=_['keys'](db[_0x77b6('0x2e')][_0x77b6('0x2f')]);_0x55102b[_0x77b6('0x35')]=_[_0x77b6('0x4b')](_0x3c8e6a['query']);_0x55102b['filters']=_['intersection'](_0x55102b[_0x77b6('0x33')],_0x55102b[_0x77b6('0x35')]);_0x424c85['attributes']=_[_0x77b6('0x36')](_0x55102b[_0x77b6('0x33')],qs[_0x77b6('0x37')](_0x3c8e6a[_0x77b6('0x35')][_0x77b6('0x37')]));_0x424c85['attributes']=_0x424c85[_0x77b6('0x38')]['length']?_0x424c85[_0x77b6('0x38')]:_0x55102b[_0x77b6('0x33')];if(_0x3c8e6a[_0x77b6('0x35')][_0x77b6('0x45')]){_0x424c85[_0x77b6('0x46')]=[{'all':!![]}];}_0x424c85=_['merge']({},_0x424c85,_0x3c8e6a[_0x77b6('0x44')]);return db[_0x77b6('0x2e')][_0x77b6('0x4c')](_0x424c85)[_0x77b6('0x29')](handleEntityNotFound(_0x1c86ea,null))[_0x77b6('0x29')](respondWithResult(_0x1c86ea,null))[_0x77b6('0x49')](handleError(_0x1c86ea,null));};exports[_0x77b6('0x4d')]=function(_0x1526d1,_0x4262f9){return db[_0x77b6('0x2e')]['create'](_0x1526d1[_0x77b6('0x4e')],{})['then'](respondWithResult(_0x4262f9,0xc9))[_0x77b6('0x49')](handleError(_0x4262f9,null));};exports[_0x77b6('0x28')]=function(_0x648298,_0x22b864){if(_0x648298[_0x77b6('0x4e')]['id']){delete _0x648298[_0x77b6('0x4e')]['id'];}return db[_0x77b6('0x2e')]['find']({'where':{'id':_0x648298[_0x77b6('0x4f')]['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x22b864,null))[_0x77b6('0x29')](saveUpdates(_0x648298[_0x77b6('0x4e')],null))[_0x77b6('0x29')](respondWithResult(_0x22b864,null))[_0x77b6('0x49')](handleError(_0x22b864,null));};exports[_0x77b6('0x50')]=function(_0x3e4324,_0x3342cd){return db[_0x77b6('0x2e')][_0x77b6('0x4c')]({'where':{'id':_0x3e4324[_0x77b6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3342cd,null))[_0x77b6('0x29')](removeEntity(_0x3342cd,null))[_0x77b6('0x49')](handleError(_0x3342cd,null));};exports['describe']=function(_0x4b99f2,_0x3fe18a){return db[_0x77b6('0x2e')][_0x77b6('0x51')]()[_0x77b6('0x29')](respondWithResult(_0x3fe18a,null))[_0x77b6('0x49')](handleError(_0x3fe18a,null));};exports[_0x77b6('0x52')]=function(_0x35ae9f,_0x4265ec,_0x5ccc43){return db[_0x77b6('0x53')]['count']({'where':{'ChatGroupId':_0x35ae9f[_0x77b6('0x4f')]['id'],'ToId':_0x35ae9f['user']['id'],'read':![]}})[_0x77b6('0x29')](function(_0x51ddda){return{'id':_[_0x77b6('0x54')](_0x35ae9f[_0x77b6('0x4f')]['id']),'count':_0x51ddda};})[_0x77b6('0x29')](respondWithResult(_0x4265ec,null))[_0x77b6('0x49')](handleError(_0x4265ec,null));};exports[_0x77b6('0x55')]=function(_0x13b53c,_0x333087,_0x20e141){return db['ChatGroup'][_0x77b6('0x4c')]({'where':{'id':_0x13b53c['params']['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x333087,null))[_0x77b6('0x29')](function(_0x45c171){if(_0x45c171){return _0x45c171[_0x77b6('0x55')](_0x13b53c[_0x77b6('0x4e')][_0x77b6('0x56')],_['omit'](_0x13b53c['body'],[_0x77b6('0x56'),'id'])||{});}})[_0x77b6('0x29')](respondWithResult(_0x333087,null))[_0x77b6('0x49')](handleError(_0x333087,null));};exports[_0x77b6('0x57')]=function(_0x54bf66,_0x16a89c,_0x28ec28){var _0x26c247={};var _0x2ba446={};var _0x507a0f;var _0x4b638a;return db[_0x77b6('0x2e')][_0x77b6('0x58')]({'where':{'id':_0x54bf66[_0x77b6('0x4f')]['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x16a89c,null))[_0x77b6('0x29')](function(_0x3fa972){if(_0x3fa972){_0x507a0f=_0x3fa972;_0x2ba446[_0x77b6('0x33')]=_['keys'](db['User'][_0x77b6('0x2f')]);_0x2ba446[_0x77b6('0x35')]=_[_0x77b6('0x4b')](_0x54bf66[_0x77b6('0x35')]);_0x2ba446['filters']=_['intersection'](_0x2ba446[_0x77b6('0x33')],_0x2ba446[_0x77b6('0x35')]);_0x26c247[_0x77b6('0x38')]=_[_0x77b6('0x36')](_0x2ba446[_0x77b6('0x33')],qs['fields'](_0x54bf66[_0x77b6('0x35')][_0x77b6('0x37')]));_0x26c247[_0x77b6('0x38')]=_0x26c247[_0x77b6('0x38')][_0x77b6('0x39')]?_0x26c247['attributes']:_0x2ba446['model'];_0x26c247[_0x77b6('0x3c')]=qs['sort'](_0x54bf66['query']['sort']);_0x26c247[_0x77b6('0x3e')]=qs[_0x77b6('0x3f')](_[_0x77b6('0x40')](_0x54bf66['query'],_0x2ba446['filters']));if(_0x54bf66[_0x77b6('0x35')][_0x77b6('0x41')]){_0x26c247[_0x77b6('0x3e')]=_[_0x77b6('0x42')](_0x26c247[_0x77b6('0x3e')],{'$or':_[_0x77b6('0x2d')](_0x26c247[_0x77b6('0x38')],function(_0x148685){var _0x1a517a={};_0x1a517a[_0x148685]={'$like':'%'+_0x54bf66[_0x77b6('0x35')]['filter']+'%'};return _0x1a517a;})});}_0x26c247=_[_0x77b6('0x42')]({},_0x26c247,_0x54bf66[_0x77b6('0x44')]);return _0x507a0f[_0x77b6('0x57')](_0x26c247);}})[_0x77b6('0x29')](function(_0x2e5443){if(_0x2e5443){_0x4b638a=_0x2e5443[_0x77b6('0x39')];if(!_0x54bf66['query'][_0x77b6('0x3a')]('nolimit')){_0x26c247[_0x77b6('0x20')]=qs[_0x77b6('0x20')](_0x54bf66[_0x77b6('0x35')][_0x77b6('0x20')]);_0x26c247[_0x77b6('0x1e')]=qs[_0x77b6('0x1e')](_0x54bf66[_0x77b6('0x35')][_0x77b6('0x1e')]);}return _0x507a0f[_0x77b6('0x57')](_0x26c247);}})[_0x77b6('0x29')](function(_0x20dce1){if(_0x20dce1){return _0x20dce1?{'count':_0x4b638a,'rows':_0x20dce1}:null;}})['then'](respondWithResult(_0x16a89c,null))[_0x77b6('0x49')](handleError(_0x16a89c,null));};exports[_0x77b6('0x59')]=function(_0x42dfe5,_0x581747,_0x342661){return db['ChatGroup'][_0x77b6('0x4c')]({'where':{'id':_0x42dfe5[_0x77b6('0x4f')]['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x581747,null))[_0x77b6('0x29')](function(_0xcb3628){if(_0xcb3628){return _0xcb3628[_0x77b6('0x59')](_0x42dfe5[_0x77b6('0x35')][_0x77b6('0x56')]);}})[_0x77b6('0x29')](respondWithStatusCode(_0x581747,null))[_0x77b6('0x49')](handleError(_0x581747,null));};exports[_0x77b6('0x5a')]=function(_0x3cca43,_0x1d0df8,_0x4b9219){if(_0x3cca43[_0x77b6('0x4e')]['id']){delete _0x3cca43[_0x77b6('0x4e')]['id'];}return db[_0x77b6('0x2e')][_0x77b6('0x4c')]({'where':{'id':_0x3cca43['params']['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x1d0df8,null))[_0x77b6('0x29')](function(_0x111ba0){if(_0x111ba0){_0x3cca43['body'][_0x77b6('0x5b')]=_0x111ba0['id'];return db[_0x77b6('0x53')][_0x77b6('0x4d')](_0x3cca43[_0x77b6('0x4e')]);}})['then'](respondWithResult(_0x1d0df8,null))[_0x77b6('0x49')](handleError(_0x1d0df8,null));};exports['getMessages']=function(_0x4d46f2,_0x55a049,_0x1b0e0a){var _0x3cb81d={};var _0x28cf80={};var _0xb41f45;var _0x507aa5;return db[_0x77b6('0x2e')][_0x77b6('0x58')]({'where':{'id':_0x4d46f2['params']['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x55a049,null))['then'](function(_0x3f9cad){if(_0x3f9cad){_0xb41f45=_0x3f9cad;_0x28cf80['model']=_[_0x77b6('0x4b')](db[_0x77b6('0x53')]['rawAttributes']);_0x28cf80[_0x77b6('0x35')]=_[_0x77b6('0x4b')](_0x4d46f2['query']);_0x28cf80[_0x77b6('0x3f')]=_['intersection'](_0x28cf80[_0x77b6('0x33')],_0x28cf80[_0x77b6('0x35')]);_0x3cb81d[_0x77b6('0x38')]=_[_0x77b6('0x36')](_0x28cf80[_0x77b6('0x33')],qs[_0x77b6('0x37')](_0x4d46f2[_0x77b6('0x35')]['fields']));_0x3cb81d[_0x77b6('0x38')]=_0x3cb81d[_0x77b6('0x38')][_0x77b6('0x39')]?_0x3cb81d[_0x77b6('0x38')]:_0x28cf80['model'];_0x3cb81d['order']=qs[_0x77b6('0x3d')](_0x4d46f2['query'][_0x77b6('0x3d')]);_0x3cb81d[_0x77b6('0x3e')]=qs[_0x77b6('0x3f')](_['pick'](_0x4d46f2[_0x77b6('0x35')],_0x28cf80[_0x77b6('0x3f')]));if(_0x4d46f2[_0x77b6('0x35')][_0x77b6('0x41')]){_0x3cb81d[_0x77b6('0x3e')]=_[_0x77b6('0x42')](_0x3cb81d[_0x77b6('0x3e')],{'$or':_['map'](_0x3cb81d['attributes'],function(_0x1d8d12){var _0x4db764={};_0x4db764[_0x1d8d12]={'$like':'%'+_0x4d46f2['query'][_0x77b6('0x41')]+'%'};return _0x4db764;})});}if(_0x4d46f2[_0x77b6('0x35')][_0x77b6('0x5c')]){var _0x54a077=_0x4d46f2[_0x77b6('0x35')][_0x77b6('0x5c')][_0x77b6('0x5d')](',');var _0x502b48={};_0x502b48[_0x54a077[0x0]]={'$gte':moment(_0x54a077[0x1])[_0x77b6('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3cb81d[_0x77b6('0x3e')]=_['merge'](_0x3cb81d['where'],_0x502b48);}_0x3cb81d=_[_0x77b6('0x42')]({},_0x3cb81d,_0x4d46f2['options']);return _0xb41f45[_0x77b6('0x5f')](_0x3cb81d);}})[_0x77b6('0x29')](function(_0x55f297){if(_0x55f297){_0x507aa5=_0x55f297['length'];if(!_0x4d46f2[_0x77b6('0x35')][_0x77b6('0x3a')](_0x77b6('0x3b'))){_0x3cb81d[_0x77b6('0x20')]=qs['limit'](_0x4d46f2[_0x77b6('0x35')][_0x77b6('0x20')]);_0x3cb81d[_0x77b6('0x1e')]=qs[_0x77b6('0x1e')](_0x4d46f2[_0x77b6('0x35')]['offset']);}return _0xb41f45[_0x77b6('0x5f')](_0x3cb81d);}})['then'](function(_0x2c84c9){if(_0x2c84c9){return _0x2c84c9?{'count':_0x507aa5,'rows':_0x2c84c9}:null;}})[_0x77b6('0x29')](respondWithResult(_0x55a049,null))['catch'](handleError(_0x55a049,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 3308b99..13fb357 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d40=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x4ee3d1,_0x38f830){var _0x321629=function(_0x158d42){while(--_0x158d42){_0x4ee3d1['push'](_0x4ee3d1['shift']());}};_0x321629(++_0x38f830);}(_0x6d40,0x188));var _0x06d4=function(_0x3d2002,_0x14377f){_0x3d2002=_0x3d2002-0x0;var _0x288ac2=_0x6d40[_0x3d2002];return _0x288ac2;};'use strict';var EventEmitter=require(_0x06d4('0x0'));var ChatGroup=require(_0x06d4('0x1'))['db'][_0x06d4('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x06d4('0x3')](0x0);var events={'afterCreate':_0x06d4('0x4'),'afterUpdate':_0x06d4('0x5'),'afterDestroy':_0x06d4('0x6')};function emitEvent(_0x5aa255){return function(_0x39af06,_0x276584,_0x43668e){ChatGroupEvents[_0x06d4('0x7')](_0x5aa255+':'+_0x39af06['id'],_0x39af06);ChatGroupEvents['emit'](_0x5aa255,_0x39af06);_0x43668e(null);};}for(var e in events){if(events[_0x06d4('0x8')](e)){var event=events[e];ChatGroup[_0x06d4('0x9')](e,emitEvent(event));}}module[_0x06d4('0xa')]=ChatGroupEvents; \ No newline at end of file +var _0xe0c0=['events','ChatGroup','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x5e6475,_0x24fc6e){var _0x7d48b=function(_0x273091){while(--_0x273091){_0x5e6475['push'](_0x5e6475['shift']());}};_0x7d48b(++_0x24fc6e);}(_0xe0c0,0xe7));var _0x0e0c=function(_0x2535f1,_0x1700c2){_0x2535f1=_0x2535f1-0x0;var _0x191188=_0xe0c0[_0x2535f1];return _0x191188;};'use strict';var EventEmitter=require(_0x0e0c('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x0e0c('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0e0c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0e0c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x45718b){return function(_0x4633b9,_0x2d5f26,_0x23e119){ChatGroupEvents[_0x0e0c('0x4')](_0x45718b+':'+_0x4633b9['id'],_0x4633b9);ChatGroupEvents[_0x0e0c('0x4')](_0x45718b,_0x4633b9);_0x23e119(null);};}for(var e in events){if(events[_0x0e0c('0x5')](e)){var event=events[e];ChatGroup[_0x0e0c('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 1d3dd46..56daab9 100644 --- a/server/api/chatGroup/chatGroup.model.js +++ b/server/api/chatGroup/chatGroup.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x466a=['chat_groups','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x42a8fc,_0x455dab){var _0x5aad21=function(_0x3d038c){while(--_0x3d038c){_0x42a8fc['push'](_0x42a8fc['shift']());}};_0x5aad21(++_0x455dab);}(_0x466a,0x12d));var _0xa466=function(_0x1499f0,_0x37975c){_0x1499f0=_0x1499f0-0x0;var _0x2433a5=_0x466a[_0x1499f0];return _0x2433a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa466('0x0'))(_0xa466('0x1'));var moment=require(_0xa466('0x2'));var BPromise=require(_0xa466('0x3'));var rp=require(_0xa466('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa466('0x5'));var config=require(_0xa466('0x6'));var attributes=require(_0xa466('0x7'));module[_0xa466('0x8')]=function(_0x55ff59,_0x40cc84){return _0x55ff59[_0xa466('0x9')](_0xa466('0xa'),attributes,{'tableName':_0xa466('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7282=['rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','bluebird','request-promise','path'];(function(_0x371b8a,_0x464249){var _0x2c730f=function(_0x58dbf7){while(--_0x58dbf7){_0x371b8a['push'](_0x371b8a['shift']());}};_0x2c730f(++_0x464249);}(_0x7282,0xd8));var _0x2728=function(_0xd0e677,_0x42939d){_0xd0e677=_0xd0e677-0x0;var _0x18aeb9=_0x7282[_0xd0e677];return _0x18aeb9;};'use strict';var _=require('lodash');var util=require(_0x2728('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2728('0x1'));var rp=require(_0x2728('0x2'));var fs=require('fs');var path=require(_0x2728('0x3'));var rimraf=require(_0x2728('0x4'));var config=require('../../config/environment');var attributes=require(_0x2728('0x5'));module[_0x2728('0x6')]=function(_0xa1e123,_0x50e7e9){return _0xa1e123[_0x2728('0x7')](_0x2728('0x8'),attributes,{'tableName':_0x2728('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 5edab46..cbc6dc1 100644 --- a/server/api/chatGroup/chatGroup.rpc.js +++ b/server/api/chatGroup/chatGroup.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x795a=['catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x2585a8,_0x1e3ac4){var _0x67c3b4=function(_0x26893a){while(--_0x26893a){_0x2585a8['push'](_0x2585a8['shift']());}};_0x67c3b4(++_0x1e3ac4);}(_0x795a,0xa2));var _0xa795=function(_0x233629,_0x5b4fd7){_0x233629=_0x233629-0x0;var _0x1dc6af=_0x795a[_0x233629];return _0x1dc6af;};'use strict';var _=require('lodash');var util=require(_0xa795('0x0'));var moment=require(_0xa795('0x1'));var BPromise=require('bluebird');var rs=require(_0xa795('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa795('0x3'))['db'];var utils=require(_0xa795('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa795('0x5'));var jayson=require(_0xa795('0x6'));var client=jayson[_0xa795('0x7')][_0xa795('0x8')]({'port':0x232a});config['redis']=_[_0xa795('0x9')](config['redis'],{'host':_0xa795('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa795('0xb'))[_0xa795('0xc')](socket);function respondWithRpcPromise(_0xfcbb11,_0x41f6b4,_0x2a5008){return new BPromise(function(_0x37a1f0,_0x255749){return client[_0xa795('0xd')](_0xfcbb11,_0x2a5008)['then'](function(_0x578855){logger[_0xa795('0xe')](_0xa795('0xf'),_0x41f6b4,_0xa795('0x10'));logger['debug'](_0xa795('0x11'),_0x41f6b4,_0xa795('0x10'),JSON['stringify'](_0x578855));if(_0x578855[_0xa795('0x12')]){if(_0x578855[_0xa795('0x12')][_0xa795('0x13')]===0x1f4){logger[_0xa795('0x12')](_0xa795('0xf'),_0x41f6b4,_0x578855[_0xa795('0x12')][_0xa795('0x14')]);return _0x255749(_0x578855['error'][_0xa795('0x14')]);}logger[_0xa795('0x12')]('ChatGroup,\x20%s,\x20%s',_0x41f6b4,_0x578855['error'][_0xa795('0x14')]);return _0x37a1f0(_0x578855['error'][_0xa795('0x14')]);}else{logger[_0xa795('0xe')](_0xa795('0xf'),_0x41f6b4,_0xa795('0x10'));_0x37a1f0(_0x578855[_0xa795('0x15')]['message']);}})[_0xa795('0x16')](function(_0x12a0ef){logger[_0xa795('0x12')](_0xa795('0xf'),_0x41f6b4,_0x12a0ef);_0x255749(_0x12a0ef);});});} \ No newline at end of file +var _0x2e35=['stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2e35,0x101));var _0x52e3=function(_0x11bf11,_0x55bea7){_0x11bf11=_0x11bf11-0x0;var _0x10605d=_0x2e35[_0x11bf11];return _0x10605d;};'use strict';var _=require(_0x52e3('0x0'));var util=require('util');var moment=require(_0x52e3('0x1'));var BPromise=require('bluebird');var rs=require(_0x52e3('0x2'));var fs=require('fs');var Redis=require(_0x52e3('0x3'));var db=require(_0x52e3('0x4'))['db'];var utils=require(_0x52e3('0x5'));var logger=require('../../config/logger')(_0x52e3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x52e3('0x7')]({'port':0x232a});config[_0x52e3('0x8')]=_[_0x52e3('0x9')](config[_0x52e3('0x8')],{'host':_0x52e3('0xa'),'port':0x18eb});var socket=require(_0x52e3('0xb'))(new Redis(config[_0x52e3('0x8')]));require(_0x52e3('0xc'))['register'](socket);function respondWithRpcPromise(_0x6090e5,_0x3b407d,_0x3c6075){return new BPromise(function(_0x33155f,_0x34d3aa){return client[_0x52e3('0xd')](_0x6090e5,_0x3c6075)[_0x52e3('0xe')](function(_0x596f70){logger['info']('ChatGroup,\x20%s,\x20%s',_0x3b407d,_0x52e3('0xf'));logger[_0x52e3('0x10')](_0x52e3('0x11'),_0x3b407d,'request\x20sent',JSON[_0x52e3('0x12')](_0x596f70));if(_0x596f70[_0x52e3('0x13')]){if(_0x596f70['error'][_0x52e3('0x14')]===0x1f4){logger[_0x52e3('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3b407d,_0x596f70[_0x52e3('0x13')][_0x52e3('0x15')]);return _0x34d3aa(_0x596f70[_0x52e3('0x13')][_0x52e3('0x15')]);}logger[_0x52e3('0x13')](_0x52e3('0x16'),_0x3b407d,_0x596f70[_0x52e3('0x13')][_0x52e3('0x15')]);return _0x33155f(_0x596f70[_0x52e3('0x13')][_0x52e3('0x15')]);}else{logger['info'](_0x52e3('0x16'),_0x3b407d,_0x52e3('0xf'));_0x33155f(_0x596f70[_0x52e3('0x17')][_0x52e3('0x15')]);}})[_0x52e3('0x18')](function(_0x13f26c){logger[_0x52e3('0x13')](_0x52e3('0x16'),_0x3b407d,_0x13f26c);_0x34d3aa(_0x13f26c);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index df2e78e..b022f91 100644 --- a/server/api/chatGroup/chatGroup.socket.js +++ b/server/api/chatGroup/chatGroup.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d12=['remove','emit','removeListener','register','length'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x6d12,0x1ef));var _0x26d1=function(_0x20e555,_0x40aea6){_0x20e555=_0x20e555-0x0;var _0x182077=_0x6d12[_0x20e555];return _0x182077;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x26d1('0x0'),'update'];function createListener(_0x367e2c,_0x31b8da){return function(_0x404cbe){_0x31b8da[_0x26d1('0x1')](_0x367e2c,_0x404cbe);};}function removeListener(_0x2a9fed,_0x46f24c){return function(){ChatGroupEvents[_0x26d1('0x2')](_0x2a9fed,_0x46f24c);};}exports[_0x26d1('0x3')]=function(_0x4111cc){for(var _0x347ae8=0x0,_0xf010ee=events[_0x26d1('0x4')];_0x347ae8<_0xf010ee;_0x347ae8++){var _0x50a0e0=events[_0x347ae8];var _0x114b24=createListener('chatGroup:'+_0x50a0e0,_0x4111cc);ChatGroupEvents['on'](_0x50a0e0,_0x114b24);}}; \ No newline at end of file +var _0xb024=['remove','emit','register','chatGroup:','./chatGroup.events','save'];(function(_0x241079,_0xe41011){var _0x882307=function(_0x544176){while(--_0x544176){_0x241079['push'](_0x241079['shift']());}};_0x882307(++_0xe41011);}(_0xb024,0x9a));var _0x4b02=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb024[_0x138adb];return _0x1b27f2;};'use strict';var ChatGroupEvents=require(_0x4b02('0x0'));var events=[_0x4b02('0x1'),_0x4b02('0x2'),'update'];function createListener(_0x5c8fa4,_0x3d8b8a){return function(_0x1e6e16){_0x3d8b8a[_0x4b02('0x3')](_0x5c8fa4,_0x1e6e16);};}function removeListener(_0x2017e9,_0x54dcd4){return function(){ChatGroupEvents['removeListener'](_0x2017e9,_0x54dcd4);};}exports[_0x4b02('0x4')]=function(_0x3425b6){for(var _0x35f8a6=0x0,_0x2a1fb7=events['length'];_0x35f8a6<_0x2a1fb7;_0x35f8a6++){var _0x5ab4fe=events[_0x35f8a6];var _0x3260c6=createListener(_0x4b02('0x5')+_0x5ab4fe,_0x3425b6);ChatGroupEvents['on'](_0x5ab4fe,_0x3260c6);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 2e2194b..0ba3584 100644 --- a/server/api/chatGroup/index.js +++ b/server/api/chatGroup/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7019=['describe','show','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMessage','put','/:id','update','delete','destroy','removeMembers','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x7019,0xdf));var _0x9701=function(_0x8f2749,_0x568608){_0x8f2749=_0x8f2749-0x0;var _0x57c69c=_0x7019[_0x8f2749];return _0x57c69c;};'use strict';var multer=require(_0x9701('0x0'));var util=require(_0x9701('0x1'));var path=require('path');var timeout=require(_0x9701('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9701('0x3'));var auth=require(_0x9701('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9701('0x5'));var controller=require(_0x9701('0x6'));router[_0x9701('0x7')]('/',auth[_0x9701('0x8')](),controller[_0x9701('0x9')]);router['get'](_0x9701('0xa'),auth[_0x9701('0x8')](),controller[_0x9701('0xb')]);router[_0x9701('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9701('0xc')]);router[_0x9701('0x7')]('/:id/unread',auth[_0x9701('0x8')](),controller[_0x9701('0xd')]);router[_0x9701('0x7')](_0x9701('0xe'),auth[_0x9701('0x8')](),controller[_0x9701('0xf')]);router[_0x9701('0x7')](_0x9701('0x10'),auth[_0x9701('0x8')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x9701('0x11')]);router[_0x9701('0x12')](_0x9701('0xe'),auth[_0x9701('0x8')](),controller['addMembers']);router[_0x9701('0x12')](_0x9701('0x10'),auth[_0x9701('0x8')](),controller[_0x9701('0x13')]);router[_0x9701('0x14')](_0x9701('0x15'),auth['isAuthenticated'](),controller[_0x9701('0x16')]);router[_0x9701('0x17')]('/:id',auth[_0x9701('0x8')](),controller[_0x9701('0x18')]);router['delete'](_0x9701('0xe'),auth[_0x9701('0x8')](),controller[_0x9701('0x19')]);module['exports']=router; \ No newline at end of file +var _0x2439=['../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','/:id','getUnread','/:id/members','/:id/messages','post','create','addMembers','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ba9ac,_0xa1fdc4){var _0x1b0fc9=function(_0x4343de){while(--_0x4343de){_0x2ba9ac['push'](_0x2ba9ac['shift']());}};_0x1b0fc9(++_0xa1fdc4);}(_0x2439,0x169));var _0x9243=function(_0x1f76a4,_0x433129){_0x1f76a4=_0x1f76a4-0x0;var _0x1f515a=_0x2439[_0x1f76a4];return _0x1f515a;};'use strict';var multer=require(_0x9243('0x0'));var util=require('util');var path=require(_0x9243('0x1'));var timeout=require(_0x9243('0x2'));var express=require(_0x9243('0x3'));var router=express[_0x9243('0x4')]();var fs_extra=require(_0x9243('0x5'));var auth=require(_0x9243('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9243('0x7'));var controller=require(_0x9243('0x8'));router[_0x9243('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9243('0x9')](_0x9243('0xa'),auth[_0x9243('0xb')](),controller['describe']);router[_0x9243('0x9')](_0x9243('0xc'),auth[_0x9243('0xb')](),controller['show']);router[_0x9243('0x9')]('/:id/unread',auth[_0x9243('0xb')](),controller[_0x9243('0xd')]);router[_0x9243('0x9')](_0x9243('0xe'),auth[_0x9243('0xb')](),controller['getMembers']);router[_0x9243('0x9')](_0x9243('0xf'),auth[_0x9243('0xb')](),controller['getMessages']);router[_0x9243('0x10')]('/',auth[_0x9243('0xb')](),controller[_0x9243('0x11')]);router['post'](_0x9243('0xe'),auth['isAuthenticated'](),controller[_0x9243('0x12')]);router[_0x9243('0x10')](_0x9243('0xf'),auth[_0x9243('0xb')](),controller['addMessage']);router['put'](_0x9243('0xc'),auth[_0x9243('0xb')](),controller[_0x9243('0x13')]);router[_0x9243('0x14')](_0x9243('0xc'),auth['isAuthenticated'](),controller[_0x9243('0x15')]);router['delete'](_0x9243('0xe'),auth[_0x9243('0xb')](),controller['removeMembers']);module[_0x9243('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 6aa7536..8136d4e 100644 --- a/server/api/chatInteraction/chatInteraction.attributes.js +++ b/server/api/chatInteraction/chatInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b5=['DATE','long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x2ccd3e,_0x11360c){var _0x1de8cc=function(_0x206741){while(--_0x206741){_0x2ccd3e['push'](_0x2ccd3e['shift']());}};_0x1de8cc(++_0x11360c);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xe5b5[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'closed':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5e5b('0x3')]},'ratingType':{'type':Sequelize[_0x5e5b('0x4')](_0x5e5b('0x5'),_0x5e5b('0x6')),'defaultValue':_0x5e5b('0x5')},'ratingMessage':{'type':Sequelize[_0x5e5b('0x7')]},'pathTranscript':{'type':Sequelize[_0x5e5b('0x7')]},'mailTranscript':{'type':Sequelize[_0x5e5b('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5e5b('0x9')]},'disposition':{'type':Sequelize[_0x5e5b('0x8')]},'secondDisposition':{'type':Sequelize[_0x5e5b('0x8')]},'thirdDisposition':{'type':Sequelize[_0x5e5b('0x8')]},'note':{'type':Sequelize[_0x5e5b('0x8')]},'browserName':{'type':Sequelize[_0x5e5b('0x8')]},'browserVersion':{'type':Sequelize[_0x5e5b('0x8')]},'osName':{'type':Sequelize[_0x5e5b('0x8')]},'osVersion':{'type':Sequelize[_0x5e5b('0x8')]},'deviceModel':{'type':Sequelize[_0x5e5b('0x8')]},'deviceVendor':{'type':Sequelize[_0x5e5b('0x8')]},'deviceType':{'type':Sequelize[_0x5e5b('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x5e5b('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x5e5b('0xa'))},'read1stAt':{'type':Sequelize[_0x5e5b('0x9')]},'lastMsgAt':{'type':Sequelize[_0x5e5b('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x5e5b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x5e5b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x337f=['TEXT','DATE','STRING','out','sequelize','exports','BOOLEAN','ENUM','star','thumb'];(function(_0x559528,_0x455857){var _0x567e33=function(_0xbc0b9f){while(--_0xbc0b9f){_0x559528['push'](_0x559528['shift']());}};_0x567e33(++_0x455857);}(_0x337f,0x11c));var _0xf337=function(_0x1eca98,_0x2621e9){_0x1eca98=_0x1eca98-0x0;var _0x1080bb=_0x337f[_0x1eca98];return _0x1080bb;};'use strict';var Sequelize=require(_0xf337('0x0'));module[_0xf337('0x1')]={'closed':{'type':Sequelize[_0xf337('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xf337('0x3')](_0xf337('0x4'),_0xf337('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xf337('0x6')]},'pathTranscript':{'type':Sequelize[_0xf337('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf337('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf337('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf337('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf337('0x8')]},'osVersion':{'type':Sequelize[_0xf337('0x8')]},'deviceModel':{'type':Sequelize[_0xf337('0x8')]},'deviceVendor':{'type':Sequelize[_0xf337('0x8')]},'deviceType':{'type':Sequelize[_0xf337('0x8')]},'referer':{'type':Sequelize[_0xf337('0x6')]},'customerIp':{'type':Sequelize[_0xf337('0x8')]},'formData':{'type':Sequelize[_0xf337('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xf337('0x7')]},'lastMsgAt':{'type':Sequelize[_0xf337('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xf337('0x3')]('in',_0xf337('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf337('0x8')]},'customerPort':{'type':Sequelize[_0xf337('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xf337('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf337('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 558308d..c9da3f0 100644 --- a/server/api/chatInteraction/chatInteraction.controller.js +++ b/server/api/chatInteraction/chatInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x799f=['createReadStream','pipe','out','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','unlinkSync','zip-dir','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','Content-Range','destroy','sendStatus','name','render','body','contact','agent','interaction','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','model','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','params','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','POST','vidaooTopic','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','sendMail','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','map','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','order','includeAgent','push','setTags','Tag','color','chatInteractionTags:save','removeTags','unix','toString','files','server','attachments','transcript-%d-%s.zip','firstName','lastName','read','get','mkdirSync','Account','Owner','N.A.','createdAt','browserName','customerIp','existsSync'];(function(_0xdb43b8,_0x35e02b){var _0x38d376=function(_0x3c0ef3){while(--_0x3c0ef3){_0xdb43b8['push'](_0xdb43b8['shift']());}};_0x38d376(++_0x35e02b);}(_0x799f,0xd8));var _0xf799=function(_0x59936e,_0x5a9013){_0x59936e=_0x59936e-0x0;var _0x6d05f2=_0x799f[_0x59936e];return _0x6d05f2;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xf799('0x0'));var rp=require('request-promise');var moment=require(_0xf799('0x1'));var BPromise=require(_0xf799('0x2'));var Mustache=require(_0xf799('0x3'));var util=require(_0xf799('0x4'));var path=require(_0xf799('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf799('0x6'));var Redis=require(_0xf799('0x7'));var interaction=require(_0xf799('0x8'));var qs=require(_0xf799('0x9'));var pdf=require(_0xf799('0xa'));var logger=require(_0xf799('0xb'))(_0xf799('0xc'));var config=require('../../config/environment');var db=require(_0xf799('0xd'))['db'];config[_0xf799('0xe')]=_[_0xf799('0xf')](config[_0xf799('0xe')],{'host':_0xf799('0x10'),'port':0x18eb});var socket=require(_0xf799('0x11'))(new Redis(config[_0xf799('0xe')]));require('./chatInteraction.socket')[_0xf799('0x12')](socket);var jayson=require(_0xf799('0x13'));var client=jayson[_0xf799('0x14')][_0xf799('0x15')]({'port':0x232b});var client9004=jayson[_0xf799('0x14')][_0xf799('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x2c3ac1,_0x52226a,_0x24fe09,_0x25931c){return new BPromise(function(_0x499837,_0x5553e6){var _0x2a3cc9=_0x25931c||client;return _0x2a3cc9[_0xf799('0x16')](_0x2c3ac1,_0x24fe09)[_0xf799('0x17')](function(_0x310286){logger[_0xf799('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x52226a,_0xf799('0x19'));logger[_0xf799('0x1a')](_0xf799('0x1b'),_0x52226a,_0xf799('0x19'),JSON[_0xf799('0x1c')](_0x310286));if(_0x310286['error']){if(_0x310286[_0xf799('0x1d')][_0xf799('0x1e')]===0x1f4){logger[_0xf799('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x52226a,_0x310286[_0xf799('0x1d')][_0xf799('0x1f')]);return _0x5553e6(_0x310286['error'][_0xf799('0x1f')]);}logger[_0xf799('0x1d')](_0xf799('0x20'),_0x52226a,_0x310286[_0xf799('0x1d')][_0xf799('0x1f')]);return _0x499837(_0x310286[_0xf799('0x1d')]['message']);}else{logger[_0xf799('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x52226a,_0xf799('0x19'));_0x499837(_0x310286[_0xf799('0x21')][_0xf799('0x1f')]);}})[_0xf799('0x22')](function(_0x165e03){logger[_0xf799('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x52226a,_0x165e03);_0x5553e6(_0x165e03);});});}function respondWithStatusCode(_0x46e474,_0x4e703){_0x4e703=_0x4e703||0xcc;return function(_0x288d06){if(_0x288d06){return _0x46e474['sendStatus'](_0x4e703);}return _0x46e474[_0xf799('0x23')](_0x4e703)[_0xf799('0x24')]();};}function respondWithResult(_0x12ba89,_0xe99143){_0xe99143=_0xe99143||0xc8;return function(_0x4fd290){if(_0x4fd290){return _0x12ba89[_0xf799('0x23')](_0xe99143)[_0xf799('0x25')](_0x4fd290);}};}function respondWithFilteredResult(_0x26e33d,_0x2a38ac){return function(_0xe8b43f){if(_0xe8b43f){var _0x5889d4=typeof _0x2a38ac['offset']===_0xf799('0x26')&&typeof _0x2a38ac[_0xf799('0x27')]==='undefined';var _0x526de2=_0xe8b43f[_0xf799('0x28')];var _0x777012=_0x5889d4?0x0:_0x2a38ac[_0xf799('0x29')];var _0x29f8fb=_0x5889d4?_0xe8b43f[_0xf799('0x28')]:_0x2a38ac[_0xf799('0x29')]+_0x2a38ac[_0xf799('0x27')];var _0x5db1f0;if(_0x29f8fb>=_0x526de2){_0x29f8fb=_0x526de2;_0x5db1f0=0xc8;}else{_0x5db1f0=0xce;}_0x26e33d[_0xf799('0x23')](_0x5db1f0);return _0x26e33d['set'](_0xf799('0x2a'),_0x777012+'-'+_0x29f8fb+'/'+_0x526de2)[_0xf799('0x25')](_0xe8b43f);}return null;};}function saveUpdates(_0x16ea77){return function(_0x42b63e){if(_0x42b63e){return _0x42b63e['update'](_0x16ea77)[_0xf799('0x17')](function(_0x245644){return _0x245644;});}return null;};}function removeEntity(_0x4ef33e){return function(_0x113f38){if(_0x113f38){return _0x113f38[_0xf799('0x2b')]()[_0xf799('0x17')](function(){_0x4ef33e['status'](0xcc)[_0xf799('0x24')]();});}};}function handleEntityNotFound(_0x36cae8){return function(_0x1ce7b2){if(!_0x1ce7b2){_0x36cae8[_0xf799('0x2c')](0x194);}return _0x1ce7b2;};}function handleError(_0x4134d6,_0x504d0c){_0x504d0c=_0x504d0c||0x1f4;return function(_0x5442fc){logger[_0xf799('0x1d')](_0x5442fc['stack']);if(_0x5442fc[_0xf799('0x2d')]){delete _0x5442fc[_0xf799('0x2d')];}_0x4134d6[_0xf799('0x23')](_0x504d0c)['send'](_0x5442fc);};}function getMustacheRender(_0x2f1784,_0x5a6f25){return Mustache[_0xf799('0x2e')](_0x2f1784,_['merge'](_0x5a6f25[_0xf799('0x2f')],{'contact':_0x5a6f25[_0xf799('0x30')],'message':_0x5a6f25[_0xf799('0x1f')],'agent':_0x5a6f25[_0xf799('0x31')],'interaction':_0x5a6f25[_0xf799('0x32')],'account':_0x5a6f25['account']}))||'';}exports['index']=function(_0x5a7e81,_0x4b67b0){var _0x4951ab={};var _0x4318c1=_['map'](db[_0xf799('0x33')][_0xf799('0x34')],function(_0x5b699c){return{'name':_0x5b699c[_0xf799('0x35')],'type':_0x5b699c[_0xf799('0x36')][_0xf799('0x37')]};});_0x4951ab=qs[_0xf799('0x38')](_0x4318c1,_0x5a7e81);return interaction[_0xf799('0x39')](_0xf799('0x3a'),_0x5a7e81[_0xf799('0x3b')],_0x5a7e81[_0xf799('0x3c')],_0x4951ab,_0x4318c1)[_0xf799('0x17')](respondWithFilteredResult(_0x4b67b0,_0x4951ab))['catch'](handleError(_0x4b67b0,null));};exports[_0xf799('0x3d')]=function(_0x8274be,_0x2f927f){var _0x95fef3={'raw':![],'where':{'id':_0x8274be['params']['id']}},_0x35f202={};_0x35f202[_0xf799('0x3e')]=_['keys'](db[_0xf799('0x33')][_0xf799('0x34')]);_0x35f202[_0xf799('0x3b')]=_[_0xf799('0x3f')](_0x8274be[_0xf799('0x3b')]);_0x35f202[_0xf799('0x40')]=_[_0xf799('0x41')](_0x35f202[_0xf799('0x3e')],_0x35f202[_0xf799('0x3b')]);_0x95fef3['attributes']=_[_0xf799('0x41')](_0x35f202[_0xf799('0x3e')],qs[_0xf799('0x42')](_0x8274be[_0xf799('0x3b')]['fields']));_0x95fef3['attributes']=_0x95fef3[_0xf799('0x43')][_0xf799('0x44')]?_0x95fef3[_0xf799('0x43')]:_0x35f202['model'];if(_0x8274be[_0xf799('0x3b')][_0xf799('0x45')]){_0x95fef3[_0xf799('0x46')]=[{'all':!![]}];}_0x95fef3=_[_0xf799('0x47')]({},_0x95fef3,_0x8274be[_0xf799('0x48')]);return db[_0xf799('0x33')][_0xf799('0x49')](_0x95fef3)[_0xf799('0x17')](handleEntityNotFound(_0x2f927f,null))[_0xf799('0x17')](respondWithResult(_0x2f927f,null))[_0xf799('0x22')](handleError(_0x2f927f,null));};exports[_0xf799('0x4a')]=function(_0x145676,_0x4f8c98){return db[_0xf799('0x33')][_0xf799('0x4a')](_0x145676[_0xf799('0x2f')],{})[_0xf799('0x17')](respondWithResult(_0x4f8c98,0xc9))[_0xf799('0x22')](handleError(_0x4f8c98,null));};exports['update']=function(_0x3db48e,_0x3674e1){if(_0x3db48e[_0xf799('0x2f')]['id']){delete _0x3db48e[_0xf799('0x2f')]['id'];}return db[_0xf799('0x33')][_0xf799('0x49')]({'where':{'id':_0x3db48e[_0xf799('0x4b')]['id']}})[_0xf799('0x17')](handleEntityNotFound(_0x3674e1,null))['then'](saveUpdates(_0x3db48e[_0xf799('0x2f')],null))[_0xf799('0x17')](respondWithResult(_0x3674e1,null))[_0xf799('0x22')](handleError(_0x3674e1,null));};exports[_0xf799('0x2b')]=function(_0x42efa1,_0x327c88){return db[_0xf799('0x33')][_0xf799('0x49')]({'where':{'id':_0x42efa1[_0xf799('0x4b')]['id']}})[_0xf799('0x17')](handleEntityNotFound(_0x327c88,null))[_0xf799('0x17')](removeEntity(_0x327c88,null))[_0xf799('0x22')](handleError(_0x327c88,null));};exports['describe']=function(_0x500ba0,_0x3a70c1){return db[_0xf799('0x33')][_0xf799('0x4c')]()[_0xf799('0x17')](respondWithResult(_0x3a70c1,null))[_0xf799('0x22')](handleError(_0x3a70c1,null));};exports[_0xf799('0x4d')]=function(_0x7bd730,_0x2863f0){var _0x40d527=_0x7bd730[_0xf799('0x4b')]['id'];var _0x3c76da;var _0x4ff11c;var _0x1639e5;return db['ChatInteraction'][_0xf799('0x4e')]({'where':{'id':_0x40d527}})[_0xf799('0x17')](function(_0x528a15){_0x3c76da=_0x528a15;return db[_0xf799('0x4f')][_0xf799('0x4e')]({'where':{'id':_0x528a15[_0xf799('0x50')]},'attributes':['id',_0xf799('0x51'),_0xf799('0x52'),'vidaooTopic',_0xf799('0x53'),_0xf799('0x54')],'raw':!![]});})[_0xf799('0x17')](function(_0x1749c9){if(_0x1749c9&&_0x1749c9[_0xf799('0x51')]&&_0x1749c9[_0xf799('0x52')]){_0x4ff11c=_0x1749c9;var _0x31ef23={'interaction':{'id':_0x40d527},'agent':{'id':_0x7bd730['user']['id'],'name':_0x7bd730['user'][_0xf799('0x2d')],'fullname':_0x7bd730[_0xf799('0x3c')][_0xf799('0x55')],'email':_0x7bd730[_0xf799('0x3c')]['email']},'contact':_0x7bd730[_0xf799('0x2f')]['contact'],'account':_0x7bd730[_0xf799('0x2f')]['account']};var _0x397c51={'rejectUnauthorized':![],'method':_0xf799('0x56'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x1749c9['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x7bd730[_0xf799('0x3c')]['email']],'buttons':null,'topic':_0x4ff11c[_0xf799('0x57')],'note':_[_0xf799('0x58')](_0x4ff11c[_0xf799('0x53')])?null:getMustacheRender(_0x4ff11c['vidaooNote'],_0x31ef23),'metadata':null},'redirect':_0xf799('0x59'),'json':!![]};try{if(!_[_0xf799('0x58')](_0x4ff11c[_0xf799('0x54')])){var _0x438092=getMustacheRender(_0x4ff11c['vidaooMetadata'],_0x31ef23);var _0x4f19b3=JSON[_0xf799('0x5a')](_0x438092);_0x397c51[_0xf799('0x2f')]['metadata']=_0x4f19b3;}}catch(_0x134bec){throw new db[(_0xf799('0x5b'))][(_0xf799('0x5c'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x397c51);}else{throw new db[(_0xf799('0x5b'))]['ValidationError'](_0xf799('0x5d'));}})[_0xf799('0x17')](function(_0x129405){_0x1639e5=_0x129405;if(_0x1639e5['id']){var _0x2e7f00={'body':_0x1639e5[_0xf799('0x5e')],'ChatWebsiteId':_0x4ff11c['id'],'ChatInteractionId':_0x3c76da['id'],'direction':'out','UserId':_0x7bd730['user']['id']};return db[_0xf799('0x5f')]['create'](_0x2e7f00,{});}else{throw new db[(_0xf799('0x5b'))]['ValidationError'](_0xf799('0x60'));}})['then'](function(){return _0x3c76da[_0xf799('0x61')]({'vidaooSessionId':_0x1639e5['id']});})[_0xf799('0x17')](respondWithResult(_0x2863f0,null))[_0xf799('0x22')](handleError(_0x2863f0,null));};exports[_0xf799('0x62')]=function(_0x27cdbc,_0x32b22d){if(_0x27cdbc['body']['id']){delete _0x27cdbc[_0xf799('0x2f')]['id'];}return db[_0xf799('0x33')][_0xf799('0x49')]({'where':{'id':_0x27cdbc[_0xf799('0x4b')]['id']},'include':[{'model':db['CmContact'],'as':_0xf799('0x63')}]})[_0xf799('0x17')](handleEntityNotFound(_0x32b22d,null))[_0xf799('0x17')](saveUpdates(_0x27cdbc[_0xf799('0x2f')],null))[_0xf799('0x17')](respondWithResult(_0x32b22d,null))[_0xf799('0x22')](handleError(_0x32b22d,null));};exports[_0xf799('0x64')]=function(_0x3582d8,_0x5c3324){if(_0x3582d8[_0xf799('0x2f')]['id']){delete _0x3582d8[_0xf799('0x2f')]['id'];}return db['ChatInteraction'][_0xf799('0x49')]({'where':{'id':_0x3582d8[_0xf799('0x4b')]['id']}})[_0xf799('0x17')](function(_0x5062bd){if(!_0x5062bd){logger[_0xf799('0x1d')](_0xf799('0x65'),_0xf799('0x64'),0x194,_0xf799('0x66'));_0x5c3324['sendStatus'](0x194);}else{if(_0x5062bd[_0xf799('0x67')]){throw new db[(_0xf799('0x5b'))]['ValidationError'](_0xf799('0x68'));}}return _0x5062bd;})[_0xf799('0x17')](function(_0x1b2344){if(_0x1b2344){return _0x1b2344['update']({'closed':_0x3582d8[_0xf799('0x2f')][_0xf799('0x69')],'disposition':_0x3582d8[_0xf799('0x2f')][_0xf799('0x6a')]})[_0xf799('0x17')](function(_0x89fca5){return _0x89fca5;});}})['then'](function(){return respondWithRpcPromise(_0xf799('0x6b'),'abandon',_0x3582d8[_0xf799('0x2f')],client9004);})[_0xf799('0x17')](respondWithResult(_0x5c3324,null))[_0xf799('0x22')](handleError(_0x5c3324,null));};exports[_0xf799('0x6c')]=function(_0x200947,_0x2ce1c5){_0x200947[_0xf799('0x2f')]['name']=_0x200947['file'][_0xf799('0x6d')];_0x200947[_0xf799('0x2f')][_0xf799('0x6e')]=_0x200947[_0xf799('0x6f')][_0xf799('0x70')];_0x200947[_0xf799('0x2f')][_0xf799('0x36')]=_0x200947[_0xf799('0x6f')][_0xf799('0x71')];return db[_0xf799('0x72')]['create'](_0x200947[_0xf799('0x2f')])['then'](respondWithResult(_0x2ce1c5,0xc9))[_0xf799('0x22')](handleError(_0x2ce1c5,null));};exports[_0xf799('0x73')]=function(_0x1444b7,_0x56c251){return db[_0xf799('0x33')]['findOne']({'where':{'id':_0x1444b7[_0xf799('0x4b')]['id']},'raw':!![]})[_0xf799('0x17')](handleEntityNotFound(_0x56c251,null))[_0xf799('0x17')](function(_0x5265d5){if(_0x5265d5){if(_0x5265d5[_0xf799('0x69')]){return _0x56c251['status'](0x193)[_0xf799('0x25')]({'status':0x193,'message':_0xf799('0x74')});}return db[_0xf799('0x72')][_0xf799('0x4e')]({'where':{'id':_0x1444b7['query'][_0xf799('0x75')]},'raw':!![]})['then'](handleEntityNotFound(_0x56c251,null));}})[_0xf799('0x17')](function(_0x365d7f){if(_0x365d7f){var _0x5a4ecc=_0x365d7f[_0xf799('0x76')]!==null;var _0x76b9fe=path[_0xf799('0x77')](config[_0xf799('0x78')],_0xf799('0x79'));if(_0x5a4ecc){_0x76b9fe=path[_0xf799('0x77')](_0x76b9fe,_0xf799('0x7a'));}var _0x80ef89=path[_0xf799('0x77')](_0x76b9fe,_0x365d7f[_0xf799('0x6e')]);return _0x56c251[_0xf799('0x7b')](_0x80ef89);}})[_0xf799('0x22')](handleError(_0x56c251,null));};exports[_0xf799('0x7c')]=function(_0x3ca15f,_0x427d38){var _0x3c7fe4=null;var _0x1ab79a=null;var _0x29710b=null;if(_0x3ca15f[_0xf799('0x2f')]['id']){delete _0x3ca15f[_0xf799('0x2f')]['id'];}if(_0x3ca15f['body'][_0xf799('0x7d')]){_0x29710b=path['join'](config[_0xf799('0x78')],_0xf799('0x7e'),util[_0xf799('0x7f')](_0xf799('0x80'),Date[_0xf799('0x81')]()));_0x3ca15f['body'][_0xf799('0x82')]=_0x29710b;}return db[_0xf799('0x33')][_0xf799('0x49')]({'where':{'id':_0x3ca15f[_0xf799('0x4b')]['id']},'include':[{'model':db[_0xf799('0x5f')],'as':_0xf799('0x83'),'include':[{'model':db[_0xf799('0x84')],'as':_0xf799('0x84')}]}]})[_0xf799('0x17')](handleEntityNotFound(_0x427d38,null))[_0xf799('0x17')](saveUpdates(_0x3ca15f['body'],null))[_0xf799('0x17')](function(_0xf1d6f6){if(_0xf1d6f6){_0x3c7fe4=_0xf1d6f6;return db['ChatWebsite'][_0xf799('0x49')]({'where':{'id':_0x3c7fe4[_0xf799('0x50')]}});}})['then'](function(_0x3e1937){if(_0x3e1937){_0x1ab79a=_0x3e1937;return db['CmContact']['find']({'where':{'id':_0x3c7fe4[_0xf799('0x85')]}});}})['then'](function(_0x486e49){if(_0x486e49){if(_0x29710b){var _0x2a52ee=null;for(var _0x54d9f9=0x1;_0x54d9f9<_0x3c7fe4[_0xf799('0x83')]['length'];++_0x54d9f9){_0x2a52ee=_0x3c7fe4['Messages'][_0x54d9f9];var _0x550412=_0x2a52ee[_0xf799('0x67')]?util[_0xf799('0x7f')](_0xf799('0x86'),_0x1ab79a[_0xf799('0x87')],_0x2a52ee[_0xf799('0x67')]):_0xf799('0x88');var _0x510a34=_0x3ca15f['body'][_0xf799('0x89')]||util[_0xf799('0x7f')](_0xf799('0x86'),'Visitor',_0x2a52ee[_0xf799('0x85')]);switch(_0x1ab79a['agentIdentifier']){case _0xf799('0x8a'):_0x550412=_0x2a52ee['UserId']?util['format'](_0xf799('0x86'),_0x1ab79a[_0xf799('0x87')],_0x2a52ee[_0xf799('0x67')]):_0xf799('0x88');break;case _0xf799('0x8b'):_0x550412=_0x2a52ee[_0xf799('0x67')]?_0x2a52ee['User'][_0xf799('0x8c')]||_0x2a52ee[_0xf799('0x84')]['fullname']:_0xf799('0x88');break;case'agent_fullname':_0x550412=_0x2a52ee['UserId']?_0x2a52ee['User']['fullname']:_0xf799('0x88');break;default:_0x550412=_0x2a52ee[_0xf799('0x67')]?util['format']('%s%d',_0x1ab79a[_0xf799('0x87')],_0x2a52ee[_0xf799('0x67')]):'System';}var _0x40a680=util['format'](_0xf799('0x8d'),moment(_0x2a52ee['createdAt'])[_0xf799('0x7f')]('MM/DD/YYYY\x20HH:mm:ss'),_0x2a52ee[_0xf799('0x8e')]==='in'?_0x510a34:_0x550412,_0x2a52ee['body']);if(!_0x2a52ee[_0xf799('0x8f')]){fs[_0xf799('0x90')](_0x29710b,_0x40a680);}}return db[_0xf799('0x91')][_0xf799('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0xf799('0x92')],'as':_0xf799('0x93'),'raw':!![],'include':[{'model':db[_0xf799('0x94')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xf799('0x17')](function(_0x4943e3){if(!_0x4943e3||!_0x4943e3[_0xf799('0x93')]||!_0x3ca15f[_0xf799('0x2f')])return _0x3c7fe4;var _0x16194f=_0x4943e3['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xf799('0x95'),{'account':_0x16194f,'message':{'from':util[_0xf799('0x7f')]('\x22%s\x22\x20<%s>',_0x4943e3[_0xf799('0x2d')],_0x4943e3[_0xf799('0x96')]||_0x4943e3[_0xf799('0x93')]['user']),'to':_0x3ca15f[_0xf799('0x2f')][_0xf799('0x7d')],'subject':_0xf799('0x97'),'text':util['format'](_0xf799('0x98'),_0x3ca15f[_0xf799('0x2f')][_0xf799('0x7d')]),'attachments':[{'path':_0x29710b}]}})[_0xf799('0x17')](function(){return _0x3c7fe4;})['catch'](function(_0x4fe8e4){logger[_0xf799('0x1d')](_0x4fe8e4);});})[_0xf799('0x17')](respondWithStatusCode(_0x427d38,0xc8))[_0xf799('0x22')](handleError(_0x427d38,null));};exports[_0xf799('0x99')]=function(_0x3f9159,_0x1a2704){return db[_0xf799('0x5f')][_0xf799('0x49')]({'where':{'id':_0x3f9159[_0xf799('0x4b')]['id']}})[_0xf799('0x17')](handleEntityNotFound(_0x1a2704,null))[_0xf799('0x17')](function(_0x326dae){if(_0x326dae){return _0x326dae[_0xf799('0x99')](_0x3f9159[_0xf799('0x2f')][_0xf799('0x9a')],_[_0xf799('0x9b')](_0x3f9159['body'],['ids','id'])||{});}})[_0xf799('0x17')](respondWithResult(_0x1a2704,null))[_0xf799('0x22')](handleError(_0x1a2704,null));};exports[_0xf799('0x9c')]=function(_0x18d5dd,_0x2216c1){var _0x1f0404={'raw':![],'where':{}};var _0x19bbe={};var _0xecc993={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf799('0x4e')]({'where':{'id':_0x18d5dd['params']['id']}})[_0xf799('0x17')](handleEntityNotFound(_0x2216c1,null))['then'](function(_0xd831a3){if(_0xd831a3){_0x19bbe[_0xf799('0x3e')]=_['keys'](db[_0xf799('0x5f')][_0xf799('0x34')]);_0x19bbe[_0xf799('0x3b')]=_[_0xf799('0x3f')](_0x18d5dd['query']);_0x19bbe[_0xf799('0x40')]=_[_0xf799('0x41')](_0x19bbe[_0xf799('0x3e')],_0x19bbe[_0xf799('0x3b')]);_0x1f0404['attributes']=_[_0xf799('0x41')](_0x19bbe[_0xf799('0x3e')],qs[_0xf799('0x42')](_0x18d5dd[_0xf799('0x3b')][_0xf799('0x42')]));_0x1f0404[_0xf799('0x43')]=_0x1f0404[_0xf799('0x43')]['length']?_0x1f0404[_0xf799('0x43')]:_0x19bbe[_0xf799('0x3e')];if(!_0x18d5dd[_0xf799('0x3b')][_0xf799('0x9d')](_0xf799('0x9e'))){_0x1f0404[_0xf799('0x27')]=qs[_0xf799('0x27')](_0x18d5dd['query']['limit']);_0x1f0404['offset']=qs[_0xf799('0x29')](_0x18d5dd['query'][_0xf799('0x29')]);}_0x1f0404['order']=qs[_0xf799('0x9f')](_0x18d5dd[_0xf799('0x3b')][_0xf799('0x9f')]);_0x1f0404[_0xf799('0xa0')]=qs[_0xf799('0x40')](_[_0xf799('0xa1')](_0x18d5dd['query'],_0x19bbe[_0xf799('0x40')]));_0x1f0404[_0xf799('0xa0')][_0xf799('0xa2')]=_0xd831a3['id'];if(_0x18d5dd[_0xf799('0x3b')]['filter']){_0x1f0404[_0xf799('0xa0')]=_[_0xf799('0x47')](_0x1f0404[_0xf799('0xa0')],{'$or':_[_0xf799('0xa3')](_0x1f0404[_0xf799('0x43')],function(_0x590090){var _0x3edc6a={};_0x3edc6a[_0x590090]={'$like':'%'+_0x18d5dd['query'][_0xf799('0xa4')]+'%'};return _0x3edc6a;})});}if(_0x18d5dd['query']['$gte']){var _0x16066a=_0x18d5dd['query'][_0xf799('0xa5')][_0xf799('0xa6')](',');var _0x331781={};_0x331781[_0x16066a[0x0]]={'$gte':moment(_0x16066a[0x1])[_0xf799('0x7f')](_0xf799('0xa7'))};_0x1f0404[_0xf799('0xa0')]=_[_0xf799('0x47')](_0x1f0404['where'],_0x331781);}_0x1f0404=_[_0xf799('0x47')]({},_0x1f0404,_0x18d5dd['options']);return db[_0xf799('0x5f')][_0xf799('0x28')]({'where':_0x1f0404['where']})[_0xf799('0x17')](function(_0x158507){_0xecc993[_0xf799('0x28')]=_0x158507;if(_0x18d5dd['query'][_0xf799('0x45')]){_0x1f0404['include']=[{'all':!![]}];}return db[_0xf799('0x5f')][_0xf799('0x39')](_0x1f0404);})[_0xf799('0x17')](function(_0x46c9c1){_0xecc993[_0xf799('0xa8')]=_0x46c9c1;return _0xecc993;});}})['then'](respondWithFilteredResult(_0x2216c1,_0x1f0404))[_0xf799('0x22')](handleError(_0x2216c1,null));};exports[_0xf799('0xa9')]=function(_0x364798,_0x5c697b){var _0x258914={'where':{}},_0x32184e={},_0x51727b={'count':0x0,'rows':[]};return db[_0xf799('0x33')][_0xf799('0x4e')]({'where':{'id':_0x364798['params']['id']}})[_0xf799('0x17')](handleEntityNotFound(_0x5c697b,null))[_0xf799('0x17')](function(_0x43aace){if(_0x43aace){_0x32184e[_0xf799('0x3e')]=_['keys'](db[_0xf799('0x5f')]['rawAttributes']);_0x32184e[_0xf799('0x3b')]=_[_0xf799('0x3f')](_0x364798[_0xf799('0x3b')]);_0x32184e[_0xf799('0x40')]=_[_0xf799('0x41')](_0x32184e[_0xf799('0x3e')],_0x32184e[_0xf799('0x3b')]);_0x258914[_0xf799('0x43')]=_[_0xf799('0x41')](_0x32184e[_0xf799('0x3e')],qs[_0xf799('0x42')](_0x364798[_0xf799('0x3b')]['fields']));_0x258914[_0xf799('0x43')]=_0x258914[_0xf799('0x43')][_0xf799('0x44')]?_0x258914[_0xf799('0x43')]:_0x32184e[_0xf799('0x3e')];if(!_0x364798[_0xf799('0x3b')][_0xf799('0x9d')](_0xf799('0x9e'))){_0x258914[_0xf799('0x27')]=qs[_0xf799('0x27')](_0x364798['query']['limit']);_0x258914[_0xf799('0x29')]=qs[_0xf799('0x29')](_0x364798['query'][_0xf799('0x29')]);}_0x258914[_0xf799('0xaa')]=qs[_0xf799('0x9f')](_0x364798[_0xf799('0x3b')][_0xf799('0x9f')]);_0x258914[_0xf799('0xa0')]=qs['filters'](_[_0xf799('0xa1')](_0x364798[_0xf799('0x3b')],_0x32184e[_0xf799('0x40')]));_0x258914[_0xf799('0xa0')][_0xf799('0xa2')]=_0x43aace['id'];if(_0x364798[_0xf799('0x3b')][_0xf799('0xa4')]){_0x258914['where']=_[_0xf799('0x47')](_0x258914[_0xf799('0xa0')],{'$or':_[_0xf799('0xa3')](_0x258914[_0xf799('0x43')],function(_0x157dbb){var _0x2abae5={};_0x2abae5[_0x157dbb]={'$like':'%'+_0x364798[_0xf799('0x3b')][_0xf799('0xa4')]+'%'};return _0x2abae5;})});}_0x258914[_0xf799('0xa0')][_0xf799('0x8f')]=![];if(_0x364798[_0xf799('0x3b')]['id']){_0x258914[_0xf799('0xa0')]['id']={'$gt':_0x364798[_0xf799('0x3b')]['id']};}_0x258914=_[_0xf799('0x47')]({},_0x258914,_0x364798[_0xf799('0x48')]);return db[_0xf799('0x5f')][_0xf799('0x28')]({'where':_0x258914['where']})[_0xf799('0x17')](function(_0x48882a){_0x51727b[_0xf799('0x28')]=_0x48882a;_0x258914[_0xf799('0x46')]=[];if(_0x364798[_0xf799('0x3b')][_0xf799('0xab')]){_0x258914[_0xf799('0x46')][_0xf799('0xac')]({'model':db[_0xf799('0x84')],'as':_0xf799('0x84'),'attributes':['id','fullname','alias']});}if(_0x364798[_0xf799('0x3b')]['includeAll']){_0x258914[_0xf799('0x46')]=[{'all':!![]}];}return db[_0xf799('0x5f')][_0xf799('0x39')](_0x258914);})[_0xf799('0x17')](function(_0x499e1f){_0x51727b[_0xf799('0xa8')]=_0x499e1f;return _0x51727b;});}})[_0xf799('0x17')](respondWithFilteredResult(_0x5c697b,_0x258914))[_0xf799('0x22')](handleError(_0x5c697b,null));};exports['addTags']=function(_0x12361b,_0x43c742){return db['ChatInteraction'][_0xf799('0x49')]({'where':{'id':_0x12361b['params']['id']}})[_0xf799('0x17')](handleEntityNotFound(_0x43c742,null))[_0xf799('0x17')](function(_0x23f0d5){if(_0x23f0d5){return _0x23f0d5[_0xf799('0xad')](_0x12361b[_0xf799('0x2f')][_0xf799('0x9a')],_[_0xf799('0x9b')](_0x12361b[_0xf799('0x2f')],['ids','id'])||{})['spread'](function(){return db[_0xf799('0xae')][_0xf799('0x39')]({'attributes':['id',_0xf799('0x2d'),_0xf799('0xaf')],'where':{'id':_0x12361b['body'][_0xf799('0x9a')]}});})[_0xf799('0x17')](function(_0x4bdd41){socket['emit'](_0xf799('0xb0'),{'id':Number(_0x12361b[_0xf799('0x4b')]['id']),'tags':_0x4bdd41||[]});return{'id':Number(_0x12361b[_0xf799('0x4b')]['id']),'tags':_0x4bdd41||[]};});}})[_0xf799('0x17')](respondWithResult(_0x43c742,null))['catch'](handleError(_0x43c742,null));};exports[_0xf799('0xb1')]=function(_0x51f1f0,_0x549182){return db['ChatInteraction'][_0xf799('0x49')]({'where':{'id':_0x51f1f0[_0xf799('0x4b')]['id']}})[_0xf799('0x17')](handleEntityNotFound(_0x549182,null))['then'](function(_0x3fcdd6){if(_0x3fcdd6){return _0x3fcdd6[_0xf799('0xb1')](_0x51f1f0['query']['ids']);}})['then'](respondWithStatusCode(_0x549182,null))['catch'](handleError(_0x549182,null));};exports[_0xf799('0x7b')]=function(_0x522659,_0x188e18){var _0x2519f1=moment()[_0xf799('0xb2')]()[_0xf799('0xb3')]();var _0x38d3bd=path[_0xf799('0x77')](config[_0xf799('0x78')],'server',_0xf799('0xb4'),'tmp');var _0x1b8dd3=path[_0xf799('0x77')](config['root'],_0xf799('0xb5'),'files',_0xf799('0xb6'));var _0x99135c=path['join'](_0x38d3bd,_0x2519f1);var _0x3818e1=util['format'](_0xf799('0xb7'),_0x522659[_0xf799('0x4b')]['id'],_0x2519f1);var _0x54c29f=path[_0xf799('0x77')](_0x38d3bd,_0x3818e1);var _0x5c86e1=[];_0x5c86e1[_0xf799('0xac')]({'model':db[_0xf799('0x84')],'as':_0xf799('0x84'),'attributes':['id','fullname'],'raw':!![]});_0x5c86e1[_0xf799('0xac')]({'model':db['CmContact'],'as':_0xf799('0x63'),'attributes':['id',_0xf799('0xb8'),_0xf799('0xb9')],'raw':!![]});if(_0x522659[_0xf799('0x3b')][_0xf799('0xb6')]){_0x5c86e1[_0xf799('0xac')]({'model':db['Attachment'],'as':_0xf799('0x72'),'raw':!![]});}var _0x14992b=[{'model':db['ChatMessage'],'as':_0xf799('0x83'),'attributes':['id',_0xf799('0x2f'),'createdAt','direction',_0xf799('0x8f'),_0xf799('0xba')],'include':_0x5c86e1}];_0x14992b[_0xf799('0xac')]({'model':db[_0xf799('0x4f')],'as':'Account','attributes':['id',_0xf799('0x2d')]});_0x14992b[_0xf799('0xac')]({'model':db[_0xf799('0x84')],'as':'Owner','attributes':['id','fullname']});return db[_0xf799('0x33')]['find']({'where':{'id':_0x522659[_0xf799('0x4b')]['id']},'include':_0x14992b})[_0xf799('0x17')](handleEntityNotFound(_0x188e18,null))[_0xf799('0x17')](function(_0x2de339){if(_0x2de339){var _0x797239=_0x2de339[_0xf799('0xbb')]({'plain':!![]});fs[_0xf799('0xbc')](_0x99135c);var _0x1d5699={'channel':'Chat','account':_0x797239[_0xf799('0xbd')][_0xf799('0x2d')],'agent':_0x797239['Owner']?_0x797239[_0xf799('0xbe')]['fullname']:_0xf799('0xbf'),'createdAt':moment(_0x797239[_0xf799('0xc0')])[_0xf799('0x7f')](_0xf799('0xa7'))[_0xf799('0xb3')](),'closedAt':_0x797239[_0xf799('0x69')]?moment(_0x797239['closedAt'])[_0xf799('0x7f')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf799('0xb3')]():'','disposition':_0x797239[_0xf799('0x6a')],'chatInfo':{'browser':_0x797239[_0xf799('0xc1')],'os':_0x797239['osName'],'referer':_0x797239['referer'],'customerIp':_0x797239[_0xf799('0xc2')],'customerPort':_0x797239['customerPort']?_0x797239['customerPort']:_0xf799('0xbf')},'messages':_(_0x797239[_0xf799('0x83')])['tail']()[_0xf799('0xa4')]({'secret':![]})[_0xf799('0xa3')](function(_0x589c9e){if(_0x589c9e[_0xf799('0x72')]){var _0xa6bd34=path[_0xf799('0x77')](_0x1b8dd3,_0x589c9e['Attachment']['basename']);if(fs[_0xf799('0xc3')](_0xa6bd34)){fs[_0xf799('0xc4')](_0xa6bd34)[_0xf799('0xc5')](fs['createWriteStream'](path[_0xf799('0x77')](_0x99135c,_0x589c9e['Attachment']['basename'])));}}return{'date':moment(_0x589c9e[_0xf799('0xc0')])[_0xf799('0x7f')](_0xf799('0xa7'))[_0xf799('0xb3')](),'sender':_0x589c9e[_0xf799('0x8e')]===_0xf799('0xc6')?_0x589c9e[_0xf799('0x84')]?_0x589c9e[_0xf799('0x84')][_0xf799('0x55')]:_0xf799('0x88'):_0x589c9e[_0xf799('0x63')][_0xf799('0xb8')]+(_0x589c9e[_0xf799('0x63')][_0xf799('0xb9')]?'\x20'+_0x589c9e[_0xf799('0x63')][_0xf799('0xb9')]:''),'body':_0x589c9e['Attachment']?_0x589c9e[_0xf799('0x72')][_0xf799('0x6e')]:_0x589c9e[_0xf799('0x2f')],'direction':_0x589c9e['direction']===_0xf799('0xc6')?'A':'C','secret':_0x589c9e[_0xf799('0x8f')],'read':_0x589c9e['read'],'attachment':_0x589c9e[_0xf799('0x72')]};})['value']()};return ejs['renderFile'](path['join'](config[_0xf799('0x78')],'server',_0xf799('0xc7'),_0xf799('0xc8')),{'interaction':_0x1d5699})[_0xf799('0x17')](function(_0x542c49){var _0x441d87=path[_0xf799('0x77')](_0x99135c,_0xf799('0xc9')+_0x797239['id']+'-'+_0x2519f1+_0xf799('0xca'));var _0x4fdc8f={'path':_0x441d87,'channel':_0xf799('0xcb'),'interactionId':_0x797239['id']};return pdf[_0xf799('0xcc')](_0x542c49,_0x4fdc8f);})[_0xf799('0x17')](function(){return new Promise(function(_0x459550,_0x17b112){zipdir(_0x99135c,{'saveTo':_0x54c29f},function(_0x274829,_0x3691f4){if(_0x274829)return _0x17b112(_0x274829);return _0x459550(_0x3691f4);});})[_0xf799('0x17')](function(){return new BPromise(function(_0x6be57d,_0x344424){rimraf(_0x99135c,function(_0xf146a9){if(_0xf146a9)_0x344424(_0xf146a9);return _0x6be57d();});});})[_0xf799('0x17')](function(){return _0x188e18['download'](_0x54c29f,_0x3818e1,function(_0x7c2430){if(_0x7c2430){logger[_0xf799('0x1d')]('err',_0x7c2430);}else{fs[_0xf799('0xcd')](_0x54c29f);}});});});}else{return _0x188e18['sendStatus'](0xc8);}})[_0xf799('0x22')](handleError(_0x188e18,null));}; \ No newline at end of file +var _0xb115=['Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','keys','hasOwnProperty','nolimit','order','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','pick','ChatInteractionId','includeAgent','push','alias','addTags','setTags','spread','Tag','color','emit','removeTags','unix','files','tmp','server','firstName','lastName','attachments','read','Account','Owner','get','mkdirSync','Chat','closedAt','toString','referer','customerPort','N.A.','tail','existsSync','createReadStream','pipe','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','chat','query','user','catch','show','params','model','rawAttributes','filters','intersection','fields','attributes','include','options','create','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','%s%d','agentAlias','System','customer'];(function(_0x4436bc,_0x41d12c){var _0x5e1db5=function(_0x486824){while(--_0x486824){_0x4436bc['push'](_0x4436bc['shift']());}};_0x5e1db5(++_0x41d12c);}(_0xb115,0x128));var _0x5b11=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb115[_0x42cae2];return _0x5f256f;};'use strict';var rimraf=require(_0x5b11('0x0'));var zipdir=require(_0x5b11('0x1'));var rp=require(_0x5b11('0x2'));var moment=require('moment');var BPromise=require(_0x5b11('0x3'));var Mustache=require(_0x5b11('0x4'));var util=require(_0x5b11('0x5'));var path=require(_0x5b11('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5b11('0x7'));var Redis=require(_0x5b11('0x8'));var interaction=require(_0x5b11('0x9'));var qs=require(_0x5b11('0xa'));var pdf=require(_0x5b11('0xb'));var logger=require('../../config/logger')(_0x5b11('0xc'));var config=require(_0x5b11('0xd'));var db=require(_0x5b11('0xe'))['db'];config[_0x5b11('0xf')]=_[_0x5b11('0x10')](config['redis'],{'host':_0x5b11('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5b11('0x12'))[_0x5b11('0x13')](socket);var jayson=require(_0x5b11('0x14'));var client=jayson[_0x5b11('0x15')][_0x5b11('0x16')]({'port':0x232b});var client9004=jayson[_0x5b11('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5bd839,_0x2e5c52,_0x42283b,_0x914f24){return new BPromise(function(_0x1890a4,_0x597c82){var _0x5413f3=_0x914f24||client;return _0x5413f3[_0x5b11('0x17')](_0x5bd839,_0x42283b)['then'](function(_0x4220b0){logger[_0x5b11('0x18')](_0x5b11('0x19'),_0x2e5c52,'request\x20sent');logger[_0x5b11('0x1a')](_0x5b11('0x1b'),_0x2e5c52,_0x5b11('0x1c'),JSON['stringify'](_0x4220b0));if(_0x4220b0[_0x5b11('0x1d')]){if(_0x4220b0[_0x5b11('0x1d')][_0x5b11('0x1e')]===0x1f4){logger[_0x5b11('0x1d')](_0x5b11('0x19'),_0x2e5c52,_0x4220b0['error'][_0x5b11('0x1f')]);return _0x597c82(_0x4220b0[_0x5b11('0x1d')][_0x5b11('0x1f')]);}logger['error'](_0x5b11('0x19'),_0x2e5c52,_0x4220b0[_0x5b11('0x1d')][_0x5b11('0x1f')]);return _0x1890a4(_0x4220b0['error'][_0x5b11('0x1f')]);}else{logger[_0x5b11('0x18')](_0x5b11('0x19'),_0x2e5c52,_0x5b11('0x1c'));_0x1890a4(_0x4220b0[_0x5b11('0x20')][_0x5b11('0x1f')]);}})['catch'](function(_0x3fb0d1){logger[_0x5b11('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x2e5c52,_0x3fb0d1);_0x597c82(_0x3fb0d1);});});}function respondWithStatusCode(_0x4ab370,_0x113a4d){_0x113a4d=_0x113a4d||0xcc;return function(_0x49d27b){if(_0x49d27b){return _0x4ab370[_0x5b11('0x21')](_0x113a4d);}return _0x4ab370['status'](_0x113a4d)[_0x5b11('0x22')]();};}function respondWithResult(_0x1eace6,_0x3c4fd2){_0x3c4fd2=_0x3c4fd2||0xc8;return function(_0x210493){if(_0x210493){return _0x1eace6['status'](_0x3c4fd2)[_0x5b11('0x23')](_0x210493);}};}function respondWithFilteredResult(_0x4d1bc2,_0x1ef776){return function(_0x187cfc){if(_0x187cfc){var _0xa24dab=typeof _0x1ef776[_0x5b11('0x24')]===_0x5b11('0x25')&&typeof _0x1ef776[_0x5b11('0x26')]===_0x5b11('0x25');var _0x1ddf2c=_0x187cfc[_0x5b11('0x27')];var _0x439bd7=_0xa24dab?0x0:_0x1ef776[_0x5b11('0x24')];var _0xd2fba3=_0xa24dab?_0x187cfc[_0x5b11('0x27')]:_0x1ef776[_0x5b11('0x24')]+_0x1ef776[_0x5b11('0x26')];var _0x3ebb0b;if(_0xd2fba3>=_0x1ddf2c){_0xd2fba3=_0x1ddf2c;_0x3ebb0b=0xc8;}else{_0x3ebb0b=0xce;}_0x4d1bc2[_0x5b11('0x28')](_0x3ebb0b);return _0x4d1bc2[_0x5b11('0x29')](_0x5b11('0x2a'),_0x439bd7+'-'+_0xd2fba3+'/'+_0x1ddf2c)[_0x5b11('0x23')](_0x187cfc);}return null;};}function saveUpdates(_0x3e7d4b){return function(_0xec9883){if(_0xec9883){return _0xec9883[_0x5b11('0x2b')](_0x3e7d4b)[_0x5b11('0x2c')](function(_0xfb9cf8){return _0xfb9cf8;});}return null;};}function removeEntity(_0x3936dc){return function(_0x5a6a8e){if(_0x5a6a8e){return _0x5a6a8e[_0x5b11('0x2d')]()['then'](function(){_0x3936dc[_0x5b11('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x941c04){return function(_0x450b00){if(!_0x450b00){_0x941c04[_0x5b11('0x21')](0x194);}return _0x450b00;};}function handleError(_0xf94040,_0x288049){_0x288049=_0x288049||0x1f4;return function(_0x1effdb){logger[_0x5b11('0x1d')](_0x1effdb[_0x5b11('0x2e')]);if(_0x1effdb[_0x5b11('0x2f')]){delete _0x1effdb[_0x5b11('0x2f')];}_0xf94040['status'](_0x288049)[_0x5b11('0x30')](_0x1effdb);};}function getMustacheRender(_0xaa560d,_0x448ddd){return Mustache[_0x5b11('0x31')](_0xaa560d,_[_0x5b11('0x32')](_0x448ddd[_0x5b11('0x33')],{'contact':_0x448ddd[_0x5b11('0x34')],'message':_0x448ddd['message'],'agent':_0x448ddd[_0x5b11('0x35')],'interaction':_0x448ddd[_0x5b11('0x36')],'account':_0x448ddd[_0x5b11('0x37')]}))||'';}exports[_0x5b11('0x38')]=function(_0xd9b1a,_0x416e63){var _0x626f89={};var _0x5e0242=_[_0x5b11('0x39')](db[_0x5b11('0x3a')]['rawAttributes'],function(_0x2ed01f){return{'name':_0x2ed01f[_0x5b11('0x3b')],'type':_0x2ed01f[_0x5b11('0x3c')][_0x5b11('0x3d')]};});_0x626f89=qs['getOptions'](_0x5e0242,_0xd9b1a);return interaction['findAll'](_0x5b11('0x3e'),_0xd9b1a[_0x5b11('0x3f')],_0xd9b1a[_0x5b11('0x40')],_0x626f89,_0x5e0242)[_0x5b11('0x2c')](respondWithFilteredResult(_0x416e63,_0x626f89))[_0x5b11('0x41')](handleError(_0x416e63,null));};exports[_0x5b11('0x42')]=function(_0x38a599,_0x531697){var _0x418742={'raw':![],'where':{'id':_0x38a599[_0x5b11('0x43')]['id']}},_0x52aab2={};_0x52aab2[_0x5b11('0x44')]=_['keys'](db[_0x5b11('0x3a')][_0x5b11('0x45')]);_0x52aab2[_0x5b11('0x3f')]=_['keys'](_0x38a599[_0x5b11('0x3f')]);_0x52aab2[_0x5b11('0x46')]=_[_0x5b11('0x47')](_0x52aab2[_0x5b11('0x44')],_0x52aab2['query']);_0x418742['attributes']=_['intersection'](_0x52aab2[_0x5b11('0x44')],qs[_0x5b11('0x48')](_0x38a599[_0x5b11('0x3f')]['fields']));_0x418742[_0x5b11('0x49')]=_0x418742['attributes']['length']?_0x418742[_0x5b11('0x49')]:_0x52aab2[_0x5b11('0x44')];if(_0x38a599[_0x5b11('0x3f')]['includeAll']){_0x418742[_0x5b11('0x4a')]=[{'all':!![]}];}_0x418742=_['merge']({},_0x418742,_0x38a599[_0x5b11('0x4b')]);return db[_0x5b11('0x3a')]['find'](_0x418742)[_0x5b11('0x2c')](handleEntityNotFound(_0x531697,null))['then'](respondWithResult(_0x531697,null))[_0x5b11('0x41')](handleError(_0x531697,null));};exports[_0x5b11('0x4c')]=function(_0x1a4fc3,_0x4b787b){return db[_0x5b11('0x3a')][_0x5b11('0x4c')](_0x1a4fc3['body'],{})[_0x5b11('0x2c')](respondWithResult(_0x4b787b,0xc9))['catch'](handleError(_0x4b787b,null));};exports[_0x5b11('0x2b')]=function(_0x3008e5,_0x4336e6){if(_0x3008e5[_0x5b11('0x33')]['id']){delete _0x3008e5[_0x5b11('0x33')]['id'];}return db[_0x5b11('0x3a')][_0x5b11('0x4d')]({'where':{'id':_0x3008e5[_0x5b11('0x43')]['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x4336e6,null))['then'](saveUpdates(_0x3008e5['body'],null))[_0x5b11('0x2c')](respondWithResult(_0x4336e6,null))[_0x5b11('0x41')](handleError(_0x4336e6,null));};exports[_0x5b11('0x2d')]=function(_0x81d03d,_0x2c5c6a){return db[_0x5b11('0x3a')]['find']({'where':{'id':_0x81d03d['params']['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x2c5c6a,null))[_0x5b11('0x2c')](removeEntity(_0x2c5c6a,null))[_0x5b11('0x41')](handleError(_0x2c5c6a,null));};exports[_0x5b11('0x4e')]=function(_0x1a892e,_0x5b5691){return db['ChatInteraction'][_0x5b11('0x4e')]()[_0x5b11('0x2c')](respondWithResult(_0x5b5691,null))[_0x5b11('0x41')](handleError(_0x5b5691,null));};exports['createVidaooSession']=function(_0x53c891,_0x212f0e){var _0x59acb3=_0x53c891[_0x5b11('0x43')]['id'];var _0x3a8b3f;var _0x2a7423;var _0x5647da;return db[_0x5b11('0x3a')][_0x5b11('0x4f')]({'where':{'id':_0x59acb3}})[_0x5b11('0x2c')](function(_0x5ad487){_0x3a8b3f=_0x5ad487;return db[_0x5b11('0x50')]['findOne']({'where':{'id':_0x5ad487[_0x5b11('0x51')]},'attributes':['id',_0x5b11('0x52'),_0x5b11('0x53'),_0x5b11('0x54'),_0x5b11('0x55'),_0x5b11('0x56')],'raw':!![]});})[_0x5b11('0x2c')](function(_0x445784){if(_0x445784&&_0x445784[_0x5b11('0x52')]&&_0x445784[_0x5b11('0x53')]){_0x2a7423=_0x445784;var _0x591cca={'interaction':{'id':_0x59acb3},'agent':{'id':_0x53c891[_0x5b11('0x40')]['id'],'name':_0x53c891['user'][_0x5b11('0x2f')],'fullname':_0x53c891['user'][_0x5b11('0x57')],'email':_0x53c891[_0x5b11('0x40')][_0x5b11('0x58')]},'contact':_0x53c891[_0x5b11('0x33')]['contact'],'account':_0x53c891[_0x5b11('0x33')][_0x5b11('0x37')]};var _0x51b6f8={'rejectUnauthorized':![],'method':_0x5b11('0x59'),'url':_0x5b11('0x5a'),'headers':{'X-APIKEY':_0x445784[_0x5b11('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x53c891['user'][_0x5b11('0x58')]],'buttons':null,'topic':_0x2a7423['vidaooTopic'],'note':_['isNull'](_0x2a7423['vidaooNote'])?null:getMustacheRender(_0x2a7423[_0x5b11('0x55')],_0x591cca),'metadata':null},'redirect':_0x5b11('0x5b'),'json':!![]};try{if(!_[_0x5b11('0x5c')](_0x2a7423[_0x5b11('0x56')])){var _0xc41866=getMustacheRender(_0x2a7423[_0x5b11('0x56')],_0x591cca);var _0x14ca43=JSON[_0x5b11('0x5d')](_0xc41866);_0x51b6f8[_0x5b11('0x33')]['metadata']=_0x14ca43;}}catch(_0x39d2d5){throw new db[(_0x5b11('0x5e'))]['ValidationError'](_0x5b11('0x5f'));}return rp(_0x51b6f8);}else{throw new db[(_0x5b11('0x5e'))][(_0x5b11('0x60'))](_0x5b11('0x61'));}})[_0x5b11('0x2c')](function(_0x412904){_0x5647da=_0x412904;if(_0x5647da['id']){var _0x594b59={'body':_0x5647da[_0x5b11('0x62')],'ChatWebsiteId':_0x2a7423['id'],'ChatInteractionId':_0x3a8b3f['id'],'direction':'out','UserId':_0x53c891[_0x5b11('0x40')]['id']};return db[_0x5b11('0x63')][_0x5b11('0x4c')](_0x594b59,{});}else{throw new db[(_0x5b11('0x5e'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x5b11('0x2c')](function(){return _0x3a8b3f[_0x5b11('0x64')]({'vidaooSessionId':_0x5647da['id']});})['then'](respondWithResult(_0x212f0e,null))['catch'](handleError(_0x212f0e,null));};exports[_0x5b11('0x65')]=function(_0x500383,_0x53f5cd){if(_0x500383[_0x5b11('0x33')]['id']){delete _0x500383[_0x5b11('0x33')]['id'];}return db['ChatInteraction'][_0x5b11('0x4d')]({'where':{'id':_0x500383[_0x5b11('0x43')]['id']},'include':[{'model':db[_0x5b11('0x66')],'as':_0x5b11('0x67')}]})[_0x5b11('0x2c')](handleEntityNotFound(_0x53f5cd,null))[_0x5b11('0x2c')](saveUpdates(_0x500383[_0x5b11('0x33')],null))[_0x5b11('0x2c')](respondWithResult(_0x53f5cd,null))[_0x5b11('0x41')](handleError(_0x53f5cd,null));};exports[_0x5b11('0x68')]=function(_0x570ca2,_0x35ffc0){if(_0x570ca2[_0x5b11('0x33')]['id']){delete _0x570ca2['body']['id'];}return db[_0x5b11('0x3a')]['find']({'where':{'id':_0x570ca2[_0x5b11('0x43')]['id']}})['then'](function(_0xba8549){if(!_0xba8549){logger['error'](_0x5b11('0x69'),'abandon',0x194,_0x5b11('0x6a'));_0x35ffc0[_0x5b11('0x21')](0x194);}else{if(_0xba8549[_0x5b11('0x6b')]){throw new db[(_0x5b11('0x5e'))][(_0x5b11('0x60'))]('Interaction\x20already\x20assigned');}}return _0xba8549;})[_0x5b11('0x2c')](function(_0x510583){if(_0x510583){return _0x510583[_0x5b11('0x2b')]({'closed':_0x570ca2[_0x5b11('0x33')][_0x5b11('0x6c')],'disposition':_0x570ca2[_0x5b11('0x33')][_0x5b11('0x6d')]})[_0x5b11('0x2c')](function(_0x4333b6){return _0x4333b6;});}})[_0x5b11('0x2c')](function(){return respondWithRpcPromise('AbandonInteraction',_0x5b11('0x68'),_0x570ca2[_0x5b11('0x33')],client9004);})[_0x5b11('0x2c')](respondWithResult(_0x35ffc0,null))['catch'](handleError(_0x35ffc0,null));};exports[_0x5b11('0x6e')]=function(_0x23d4a5,_0x3c8a60){_0x23d4a5[_0x5b11('0x33')][_0x5b11('0x2f')]=_0x23d4a5[_0x5b11('0x6f')][_0x5b11('0x70')];_0x23d4a5[_0x5b11('0x33')]['basename']=_0x23d4a5['file'][_0x5b11('0x71')];_0x23d4a5['body'][_0x5b11('0x3c')]=_0x23d4a5[_0x5b11('0x6f')][_0x5b11('0x72')];return db[_0x5b11('0x73')][_0x5b11('0x4c')](_0x23d4a5[_0x5b11('0x33')])[_0x5b11('0x2c')](respondWithResult(_0x3c8a60,0xc9))['catch'](handleError(_0x3c8a60,null));};exports[_0x5b11('0x74')]=function(_0x6c6c0f,_0x2f2946){return db[_0x5b11('0x3a')]['findOne']({'where':{'id':_0x6c6c0f[_0x5b11('0x43')]['id']},'raw':!![]})[_0x5b11('0x2c')](handleEntityNotFound(_0x2f2946,null))[_0x5b11('0x2c')](function(_0x4e6368){if(_0x4e6368){if(_0x4e6368[_0x5b11('0x6c')]){return _0x2f2946[_0x5b11('0x28')](0x193)[_0x5b11('0x23')]({'status':0x193,'message':_0x5b11('0x75')});}return db[_0x5b11('0x73')][_0x5b11('0x4f')]({'where':{'id':_0x6c6c0f[_0x5b11('0x3f')][_0x5b11('0x76')]},'raw':!![]})[_0x5b11('0x2c')](handleEntityNotFound(_0x2f2946,null));}})[_0x5b11('0x2c')](function(_0x9f39a1){if(_0x9f39a1){var _0x1180d3=_0x9f39a1['ChatOfflineMessageId']!==null;var _0x43136c=path[_0x5b11('0x77')](config[_0x5b11('0x78')],_0x5b11('0x79'));if(_0x1180d3){_0x43136c=path[_0x5b11('0x77')](_0x43136c,_0x5b11('0x7a'));}var _0x459a22=path[_0x5b11('0x77')](_0x43136c,_0x9f39a1[_0x5b11('0x7b')]);return _0x2f2946[_0x5b11('0x7c')](_0x459a22);}})['catch'](handleError(_0x2f2946,null));};exports[_0x5b11('0x7d')]=function(_0x3fd52d,_0x149ff1){var _0x459fbf=null;var _0x465030=null;var _0x30b6dd=null;if(_0x3fd52d[_0x5b11('0x33')]['id']){delete _0x3fd52d[_0x5b11('0x33')]['id'];}if(_0x3fd52d[_0x5b11('0x33')][_0x5b11('0x7e')]){_0x30b6dd=path[_0x5b11('0x77')](config['root'],'server/files/chat/upload/',util[_0x5b11('0x7f')](_0x5b11('0x80'),Date[_0x5b11('0x81')]()));_0x3fd52d['body'][_0x5b11('0x82')]=_0x30b6dd;}return db[_0x5b11('0x3a')][_0x5b11('0x4d')]({'where':{'id':_0x3fd52d['params']['id']},'include':[{'model':db[_0x5b11('0x63')],'as':'Messages','include':[{'model':db[_0x5b11('0x83')],'as':'User'}]}]})[_0x5b11('0x2c')](handleEntityNotFound(_0x149ff1,null))[_0x5b11('0x2c')](saveUpdates(_0x3fd52d[_0x5b11('0x33')],null))['then'](function(_0x3a2b24){if(_0x3a2b24){_0x459fbf=_0x3a2b24;return db[_0x5b11('0x50')][_0x5b11('0x4d')]({'where':{'id':_0x459fbf['ChatWebsiteId']}});}})['then'](function(_0x5a6c5b){if(_0x5a6c5b){_0x465030=_0x5a6c5b;return db[_0x5b11('0x66')][_0x5b11('0x4d')]({'where':{'id':_0x459fbf[_0x5b11('0x84')]}});}})[_0x5b11('0x2c')](function(_0x1f3adb){if(_0x1f3adb){if(_0x30b6dd){var _0x285ec9=null;for(var _0x433233=0x1;_0x433233<_0x459fbf[_0x5b11('0x85')]['length'];++_0x433233){_0x285ec9=_0x459fbf[_0x5b11('0x85')][_0x433233];var _0x20f084=_0x285ec9[_0x5b11('0x6b')]?util[_0x5b11('0x7f')](_0x5b11('0x86'),_0x465030[_0x5b11('0x87')],_0x285ec9['UserId']):_0x5b11('0x88');var _0x6c9e1d=_0x3fd52d[_0x5b11('0x33')][_0x5b11('0x89')]||util['format'](_0x5b11('0x86'),_0x5b11('0x8a'),_0x285ec9[_0x5b11('0x84')]);switch(_0x465030[_0x5b11('0x8b')]){case _0x5b11('0x8c'):_0x20f084=_0x285ec9['UserId']?util[_0x5b11('0x7f')](_0x5b11('0x86'),_0x465030[_0x5b11('0x87')],_0x285ec9[_0x5b11('0x6b')]):_0x5b11('0x88');break;case _0x5b11('0x8d'):_0x20f084=_0x285ec9['UserId']?_0x285ec9[_0x5b11('0x83')]['alias']||_0x285ec9['User'][_0x5b11('0x57')]:_0x5b11('0x88');break;case _0x5b11('0x8e'):_0x20f084=_0x285ec9[_0x5b11('0x6b')]?_0x285ec9['User'][_0x5b11('0x57')]:'System';break;default:_0x20f084=_0x285ec9[_0x5b11('0x6b')]?util[_0x5b11('0x7f')](_0x5b11('0x86'),_0x465030[_0x5b11('0x87')],_0x285ec9[_0x5b11('0x6b')]):_0x5b11('0x88');}var _0x5ac06c=util[_0x5b11('0x7f')](_0x5b11('0x8f'),moment(_0x285ec9[_0x5b11('0x90')])[_0x5b11('0x7f')](_0x5b11('0x91')),_0x285ec9[_0x5b11('0x92')]==='in'?_0x6c9e1d:_0x20f084,_0x285ec9['body']);if(!_0x285ec9[_0x5b11('0x93')]){fs[_0x5b11('0x94')](_0x30b6dd,_0x5ac06c);}}return db['MailAccount'][_0x5b11('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0x5b11('0x95')],'as':_0x5b11('0x96'),'raw':!![],'include':[{'model':db[_0x5b11('0x97')],'as':_0x5b11('0x97'),'raw':!![]}]}]});}}})[_0x5b11('0x2c')](function(_0x255f66){if(!_0x255f66||!_0x255f66['Smtp']||!_0x3fd52d[_0x5b11('0x33')])return _0x459fbf;var _0x213c97=_0x255f66[_0x5b11('0x98')]();return respondWithRpcPromise(_0x5b11('0x99'),_0x5b11('0x9a'),{'account':_0x213c97,'message':{'from':util[_0x5b11('0x7f')](_0x5b11('0x9b'),_0x255f66[_0x5b11('0x2f')],_0x255f66[_0x5b11('0x58')]||_0x255f66['Smtp'][_0x5b11('0x40')]),'to':_0x3fd52d[_0x5b11('0x33')][_0x5b11('0x7e')],'subject':_0x5b11('0x9c'),'text':util[_0x5b11('0x7f')](_0x5b11('0x9d'),_0x3fd52d['body'][_0x5b11('0x7e')]),'attachments':[{'path':_0x30b6dd}]}})['then'](function(){return _0x459fbf;})[_0x5b11('0x41')](function(_0x30a092){logger[_0x5b11('0x1d')](_0x30a092);});})[_0x5b11('0x2c')](respondWithStatusCode(_0x149ff1,0xc8))[_0x5b11('0x41')](handleError(_0x149ff1,null));};exports['addMessage']=function(_0x5f707e,_0x5c97e0){return db['ChatMessage'][_0x5b11('0x4d')]({'where':{'id':_0x5f707e[_0x5b11('0x43')]['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x5c97e0,null))['then'](function(_0x46d874){if(_0x46d874){return _0x46d874[_0x5b11('0x9e')](_0x5f707e[_0x5b11('0x33')][_0x5b11('0x9f')],_[_0x5b11('0xa0')](_0x5f707e['body'],[_0x5b11('0x9f'),'id'])||{});}})[_0x5b11('0x2c')](respondWithResult(_0x5c97e0,null))['catch'](handleError(_0x5c97e0,null));};exports[_0x5b11('0xa1')]=function(_0x51975c,_0x4f9018){var _0x553784={'raw':![],'where':{}};var _0x2fdeb6={};var _0x162f8c={'count':0x0,'rows':[]};return db[_0x5b11('0x3a')][_0x5b11('0x4f')]({'where':{'id':_0x51975c['params']['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x4f9018,null))['then'](function(_0x152b61){if(_0x152b61){_0x2fdeb6['model']=_[_0x5b11('0xa2')](db[_0x5b11('0x63')][_0x5b11('0x45')]);_0x2fdeb6['query']=_[_0x5b11('0xa2')](_0x51975c['query']);_0x2fdeb6['filters']=_[_0x5b11('0x47')](_0x2fdeb6[_0x5b11('0x44')],_0x2fdeb6[_0x5b11('0x3f')]);_0x553784['attributes']=_[_0x5b11('0x47')](_0x2fdeb6[_0x5b11('0x44')],qs[_0x5b11('0x48')](_0x51975c['query'][_0x5b11('0x48')]));_0x553784[_0x5b11('0x49')]=_0x553784[_0x5b11('0x49')]['length']?_0x553784[_0x5b11('0x49')]:_0x2fdeb6[_0x5b11('0x44')];if(!_0x51975c[_0x5b11('0x3f')][_0x5b11('0xa3')](_0x5b11('0xa4'))){_0x553784[_0x5b11('0x26')]=qs[_0x5b11('0x26')](_0x51975c[_0x5b11('0x3f')][_0x5b11('0x26')]);_0x553784[_0x5b11('0x24')]=qs[_0x5b11('0x24')](_0x51975c[_0x5b11('0x3f')][_0x5b11('0x24')]);}_0x553784[_0x5b11('0xa5')]=qs[_0x5b11('0xa6')](_0x51975c[_0x5b11('0x3f')][_0x5b11('0xa6')]);_0x553784[_0x5b11('0xa7')]=qs[_0x5b11('0x46')](_['pick'](_0x51975c[_0x5b11('0x3f')],_0x2fdeb6[_0x5b11('0x46')]));_0x553784['where']['ChatInteractionId']=_0x152b61['id'];if(_0x51975c[_0x5b11('0x3f')][_0x5b11('0xa8')]){_0x553784['where']=_[_0x5b11('0x32')](_0x553784[_0x5b11('0xa7')],{'$or':_[_0x5b11('0x39')](_0x553784['attributes'],function(_0x47ca23){var _0x17d2b1={};_0x17d2b1[_0x47ca23]={'$like':'%'+_0x51975c['query'][_0x5b11('0xa8')]+'%'};return _0x17d2b1;})});}if(_0x51975c[_0x5b11('0x3f')][_0x5b11('0xa9')]){var _0xa761fd=_0x51975c[_0x5b11('0x3f')]['$gte'][_0x5b11('0xaa')](',');var _0x5207f1={};_0x5207f1[_0xa761fd[0x0]]={'$gte':moment(_0xa761fd[0x1])[_0x5b11('0x7f')](_0x5b11('0xab'))};_0x553784['where']=_[_0x5b11('0x32')](_0x553784[_0x5b11('0xa7')],_0x5207f1);}_0x553784=_[_0x5b11('0x32')]({},_0x553784,_0x51975c[_0x5b11('0x4b')]);return db[_0x5b11('0x63')]['count']({'where':_0x553784['where']})[_0x5b11('0x2c')](function(_0x370e6a){_0x162f8c[_0x5b11('0x27')]=_0x370e6a;if(_0x51975c[_0x5b11('0x3f')][_0x5b11('0xac')]){_0x553784['include']=[{'all':!![]}];}return db[_0x5b11('0x63')][_0x5b11('0xad')](_0x553784);})['then'](function(_0x562f8a){_0x162f8c['rows']=_0x562f8a;return _0x162f8c;});}})['then'](respondWithFilteredResult(_0x4f9018,_0x553784))[_0x5b11('0x41')](handleError(_0x4f9018,null));};exports['getMyMessages']=function(_0x383bfd,_0x2ec3fa){var _0x56e176={'where':{}},_0x352274={},_0x4896ab={'count':0x0,'rows':[]};return db[_0x5b11('0x3a')][_0x5b11('0x4f')]({'where':{'id':_0x383bfd[_0x5b11('0x43')]['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x2ec3fa,null))['then'](function(_0xb0ba21){if(_0xb0ba21){_0x352274[_0x5b11('0x44')]=_[_0x5b11('0xa2')](db['ChatMessage'][_0x5b11('0x45')]);_0x352274[_0x5b11('0x3f')]=_['keys'](_0x383bfd[_0x5b11('0x3f')]);_0x352274[_0x5b11('0x46')]=_['intersection'](_0x352274[_0x5b11('0x44')],_0x352274['query']);_0x56e176[_0x5b11('0x49')]=_[_0x5b11('0x47')](_0x352274['model'],qs[_0x5b11('0x48')](_0x383bfd[_0x5b11('0x3f')][_0x5b11('0x48')]));_0x56e176[_0x5b11('0x49')]=_0x56e176['attributes']['length']?_0x56e176[_0x5b11('0x49')]:_0x352274[_0x5b11('0x44')];if(!_0x383bfd[_0x5b11('0x3f')][_0x5b11('0xa3')]('nolimit')){_0x56e176[_0x5b11('0x26')]=qs[_0x5b11('0x26')](_0x383bfd[_0x5b11('0x3f')][_0x5b11('0x26')]);_0x56e176[_0x5b11('0x24')]=qs[_0x5b11('0x24')](_0x383bfd[_0x5b11('0x3f')][_0x5b11('0x24')]);}_0x56e176['order']=qs['sort'](_0x383bfd['query']['sort']);_0x56e176[_0x5b11('0xa7')]=qs['filters'](_[_0x5b11('0xae')](_0x383bfd[_0x5b11('0x3f')],_0x352274[_0x5b11('0x46')]));_0x56e176[_0x5b11('0xa7')][_0x5b11('0xaf')]=_0xb0ba21['id'];if(_0x383bfd[_0x5b11('0x3f')][_0x5b11('0xa8')]){_0x56e176['where']=_['merge'](_0x56e176[_0x5b11('0xa7')],{'$or':_['map'](_0x56e176['attributes'],function(_0xeef9b9){var _0x163d91={};_0x163d91[_0xeef9b9]={'$like':'%'+_0x383bfd[_0x5b11('0x3f')][_0x5b11('0xa8')]+'%'};return _0x163d91;})});}_0x56e176[_0x5b11('0xa7')]['secret']=![];if(_0x383bfd[_0x5b11('0x3f')]['id']){_0x56e176[_0x5b11('0xa7')]['id']={'$gt':_0x383bfd[_0x5b11('0x3f')]['id']};}_0x56e176=_['merge']({},_0x56e176,_0x383bfd[_0x5b11('0x4b')]);return db[_0x5b11('0x63')]['count']({'where':_0x56e176['where']})[_0x5b11('0x2c')](function(_0x44093e){_0x4896ab[_0x5b11('0x27')]=_0x44093e;_0x56e176['include']=[];if(_0x383bfd[_0x5b11('0x3f')][_0x5b11('0xb0')]){_0x56e176['include'][_0x5b11('0xb1')]({'model':db[_0x5b11('0x83')],'as':'User','attributes':['id',_0x5b11('0x57'),_0x5b11('0xb2')]});}if(_0x383bfd['query'][_0x5b11('0xac')]){_0x56e176['include']=[{'all':!![]}];}return db[_0x5b11('0x63')][_0x5b11('0xad')](_0x56e176);})[_0x5b11('0x2c')](function(_0x529f79){_0x4896ab['rows']=_0x529f79;return _0x4896ab;});}})['then'](respondWithFilteredResult(_0x2ec3fa,_0x56e176))[_0x5b11('0x41')](handleError(_0x2ec3fa,null));};exports[_0x5b11('0xb3')]=function(_0x4d70b0,_0x5dda19){return db['ChatInteraction'][_0x5b11('0x4d')]({'where':{'id':_0x4d70b0[_0x5b11('0x43')]['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x5dda19,null))[_0x5b11('0x2c')](function(_0x11134a){if(_0x11134a){return _0x11134a[_0x5b11('0xb4')](_0x4d70b0[_0x5b11('0x33')][_0x5b11('0x9f')],_[_0x5b11('0xa0')](_0x4d70b0[_0x5b11('0x33')],[_0x5b11('0x9f'),'id'])||{})[_0x5b11('0xb5')](function(){return db[_0x5b11('0xb6')][_0x5b11('0xad')]({'attributes':['id',_0x5b11('0x2f'),_0x5b11('0xb7')],'where':{'id':_0x4d70b0[_0x5b11('0x33')][_0x5b11('0x9f')]}});})[_0x5b11('0x2c')](function(_0x2e62d3){socket[_0x5b11('0xb8')]('chatInteractionTags:save',{'id':Number(_0x4d70b0[_0x5b11('0x43')]['id']),'tags':_0x2e62d3||[]});return{'id':Number(_0x4d70b0[_0x5b11('0x43')]['id']),'tags':_0x2e62d3||[]};});}})['then'](respondWithResult(_0x5dda19,null))['catch'](handleError(_0x5dda19,null));};exports[_0x5b11('0xb9')]=function(_0x5c6015,_0x1c0c59){return db[_0x5b11('0x3a')][_0x5b11('0x4d')]({'where':{'id':_0x5c6015['params']['id']}})['then'](handleEntityNotFound(_0x1c0c59,null))[_0x5b11('0x2c')](function(_0x3a6658){if(_0x3a6658){return _0x3a6658[_0x5b11('0xb9')](_0x5c6015[_0x5b11('0x3f')][_0x5b11('0x9f')]);}})[_0x5b11('0x2c')](respondWithStatusCode(_0x1c0c59,null))[_0x5b11('0x41')](handleError(_0x1c0c59,null));};exports[_0x5b11('0x7c')]=function(_0x57339f,_0x27e8ab){var _0x31acaf=moment()[_0x5b11('0xba')]()['toString']();var _0x403a70=path[_0x5b11('0x77')](config[_0x5b11('0x78')],'server',_0x5b11('0xbb'),_0x5b11('0xbc'));var _0x92cbf3=path[_0x5b11('0x77')](config['root'],_0x5b11('0xbd'),_0x5b11('0xbb'),'attachments');var _0x4bdd1c=path[_0x5b11('0x77')](_0x403a70,_0x31acaf);var _0x4f3e69=util['format']('transcript-%d-%s.zip',_0x57339f[_0x5b11('0x43')]['id'],_0x31acaf);var _0x403ebd=path[_0x5b11('0x77')](_0x403a70,_0x4f3e69);var _0x4a6636=[];_0x4a6636[_0x5b11('0xb1')]({'model':db[_0x5b11('0x83')],'as':_0x5b11('0x83'),'attributes':['id',_0x5b11('0x57')],'raw':!![]});_0x4a6636[_0x5b11('0xb1')]({'model':db[_0x5b11('0x66')],'as':_0x5b11('0x67'),'attributes':['id',_0x5b11('0xbe'),_0x5b11('0xbf')],'raw':!![]});if(_0x57339f[_0x5b11('0x3f')][_0x5b11('0xc0')]){_0x4a6636[_0x5b11('0xb1')]({'model':db[_0x5b11('0x73')],'as':_0x5b11('0x73'),'raw':!![]});}var _0xe33f31=[{'model':db[_0x5b11('0x63')],'as':_0x5b11('0x85'),'attributes':['id',_0x5b11('0x33'),_0x5b11('0x90'),_0x5b11('0x92'),_0x5b11('0x93'),_0x5b11('0xc1')],'include':_0x4a6636}];_0xe33f31[_0x5b11('0xb1')]({'model':db['ChatWebsite'],'as':_0x5b11('0xc2'),'attributes':['id',_0x5b11('0x2f')]});_0xe33f31['push']({'model':db['User'],'as':_0x5b11('0xc3'),'attributes':['id',_0x5b11('0x57')]});return db[_0x5b11('0x3a')]['find']({'where':{'id':_0x57339f[_0x5b11('0x43')]['id']},'include':_0xe33f31})[_0x5b11('0x2c')](handleEntityNotFound(_0x27e8ab,null))[_0x5b11('0x2c')](function(_0x55d213){if(_0x55d213){var _0x2f9dff=_0x55d213[_0x5b11('0xc4')]({'plain':!![]});fs[_0x5b11('0xc5')](_0x4bdd1c);var _0x362ce1={'channel':_0x5b11('0xc6'),'account':_0x2f9dff['Account'][_0x5b11('0x2f')],'agent':_0x2f9dff[_0x5b11('0xc3')]?_0x2f9dff[_0x5b11('0xc3')]['fullname']:'N.A.','createdAt':moment(_0x2f9dff[_0x5b11('0x90')])[_0x5b11('0x7f')](_0x5b11('0xab'))['toString'](),'closedAt':_0x2f9dff[_0x5b11('0x6c')]?moment(_0x2f9dff[_0x5b11('0xc7')])[_0x5b11('0x7f')](_0x5b11('0xab'))[_0x5b11('0xc8')]():'','disposition':_0x2f9dff[_0x5b11('0x6d')],'chatInfo':{'browser':_0x2f9dff['browserName'],'os':_0x2f9dff['osName'],'referer':_0x2f9dff[_0x5b11('0xc9')],'customerIp':_0x2f9dff['customerIp'],'customerPort':_0x2f9dff['customerPort']?_0x2f9dff[_0x5b11('0xca')]:_0x5b11('0xcb')},'messages':_(_0x2f9dff[_0x5b11('0x85')])[_0x5b11('0xcc')]()[_0x5b11('0xa8')]({'secret':![]})[_0x5b11('0x39')](function(_0x4b2304){if(_0x4b2304[_0x5b11('0x73')]){var _0x5b9305=path[_0x5b11('0x77')](_0x92cbf3,_0x4b2304[_0x5b11('0x73')][_0x5b11('0x7b')]);if(fs[_0x5b11('0xcd')](_0x5b9305)){fs[_0x5b11('0xce')](_0x5b9305)[_0x5b11('0xcf')](fs['createWriteStream'](path[_0x5b11('0x77')](_0x4bdd1c,_0x4b2304[_0x5b11('0x73')][_0x5b11('0x7b')])));}}return{'date':moment(_0x4b2304[_0x5b11('0x90')])[_0x5b11('0x7f')](_0x5b11('0xab'))[_0x5b11('0xc8')](),'sender':_0x4b2304[_0x5b11('0x92')]===_0x5b11('0xd0')?_0x4b2304[_0x5b11('0x83')]?_0x4b2304[_0x5b11('0x83')][_0x5b11('0x57')]:'System':_0x4b2304[_0x5b11('0x67')][_0x5b11('0xbe')]+(_0x4b2304[_0x5b11('0x67')][_0x5b11('0xbf')]?'\x20'+_0x4b2304['Contact'][_0x5b11('0xbf')]:''),'body':_0x4b2304[_0x5b11('0x73')]?_0x4b2304[_0x5b11('0x73')]['basename']:_0x4b2304[_0x5b11('0x33')],'direction':_0x4b2304['direction']===_0x5b11('0xd0')?'A':'C','secret':_0x4b2304[_0x5b11('0x93')],'read':_0x4b2304['read'],'attachment':_0x4b2304[_0x5b11('0x73')]};})[_0x5b11('0xd1')]()};return ejs[_0x5b11('0xd2')](path[_0x5b11('0x77')](config[_0x5b11('0x78')],_0x5b11('0xbd'),_0x5b11('0xd3'),_0x5b11('0xd4')),{'interaction':_0x362ce1})['then'](function(_0x1a2b2b){var _0x42b507=path['join'](_0x4bdd1c,_0x5b11('0xd5')+_0x2f9dff['id']+'-'+_0x31acaf+_0x5b11('0xd6'));var _0x297b02={'path':_0x42b507,'channel':'Chat','interactionId':_0x2f9dff['id']};return pdf[_0x5b11('0xd7')](_0x1a2b2b,_0x297b02);})[_0x5b11('0x2c')](function(){return new Promise(function(_0x53df7e,_0x37dea2){zipdir(_0x4bdd1c,{'saveTo':_0x403ebd},function(_0x5409de,_0x4f43bf){if(_0x5409de)return _0x37dea2(_0x5409de);return _0x53df7e(_0x4f43bf);});})[_0x5b11('0x2c')](function(){return new BPromise(function(_0x4afc5c,_0x17c8e7){rimraf(_0x4bdd1c,function(_0x2e0dd1){if(_0x2e0dd1)_0x17c8e7(_0x2e0dd1);return _0x4afc5c();});});})['then'](function(){return _0x27e8ab['download'](_0x403ebd,_0x4f3e69,function(_0x168b7a){if(_0x168b7a){logger[_0x5b11('0x1d')](_0x5b11('0xd8'),_0x168b7a);}else{fs['unlinkSync'](_0x403ebd);}});});});}else{return _0x27e8ab[_0x5b11('0x21')](0xc8);}})[_0x5b11('0x41')](handleError(_0x27e8ab,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index e23440a..ad63792 100644 --- a/server/api/chatInteraction/chatInteraction.events.js +++ b/server/api/chatInteraction/chatInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ae5=['findAll','then','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','Users','map'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0x1ae5,0x7f));var _0x51ae=function(_0x28a599,_0x32d40e){_0x28a599=_0x28a599-0x0;var _0x2d4d0b=_0x1ae5[_0x28a599];return _0x2d4d0b;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x51ae('0x0'))['db'][_0x51ae('0x1')];var ChatMessage=require(_0x51ae('0x0'))['db'][_0x51ae('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x51ae('0x3')](0x0);var events={'afterCreate':_0x51ae('0x4'),'afterUpdate':_0x51ae('0x5'),'afterDestroy':_0x51ae('0x6')};function emitEvent(_0x1a0bda){return function(_0x4ed8c1,_0x4bc0e3,_0x2c03de){_0x4ed8c1['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3d28dd){_0x4ed8c1['setDataValue'](_0x51ae('0x7'),_0x3d28dd[_0x51ae('0x8')](function(_0x32c32b){return{'id':_0x32c32b['id']};}));return ChatMessage[_0x51ae('0x9')]({'where':{'ChatInteractionId':_0x4ed8c1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x51ae('0xa')](function(_0x76c683){_0x4ed8c1[_0x51ae('0xb')](_0x51ae('0xc'),_0x76c683['length']);ChatInteractionEvents[_0x51ae('0xd')](_0x1a0bda+':'+_0x4ed8c1['id'],_0x4ed8c1);ChatInteractionEvents['emit'](_0x1a0bda,_0x4ed8c1);_0x2c03de(null);})[_0x51ae('0xe')](_0x2c03de(null));};}for(var e in events){if(events[_0x51ae('0xf')](e)){var event=events[e];ChatInteraction[_0x51ae('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x4bd7=['exports','ChatInteraction','../../mysqldb','setMaxListeners','save','update','remove','then','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x1ef785,_0x1ea72d){var _0x485e64=function(_0x5d1717){while(--_0x5d1717){_0x1ef785['push'](_0x1ef785['shift']());}};_0x485e64(++_0x1ea72d);}(_0x4bd7,0x144));var _0x74bd=function(_0x767b78,_0x16270b){_0x767b78=_0x767b78-0x0;var _0x5daeed=_0x4bd7[_0x767b78];return _0x5daeed;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x74bd('0x0')];var ChatMessage=require(_0x74bd('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x74bd('0x2')](0x0);var events={'afterCreate':_0x74bd('0x3'),'afterUpdate':_0x74bd('0x4'),'afterDestroy':_0x74bd('0x5')};function emitEvent(_0x1d180f){return function(_0x3fab03,_0x561447,_0x40c17d){_0x3fab03['getUsers']({'attributes':['id'],'raw':!![]})[_0x74bd('0x6')](function(_0x39e1e0){_0x3fab03['setDataValue'](_0x74bd('0x7'),_0x39e1e0[_0x74bd('0x8')](function(_0x336499){return{'id':_0x336499['id']};}));return ChatMessage[_0x74bd('0x9')]({'where':{'ChatInteractionId':_0x3fab03['id'],'direction':'in','read':![]},'raw':!![]});})[_0x74bd('0x6')](function(_0x11d153){_0x3fab03['setDataValue'](_0x74bd('0xa'),_0x11d153[_0x74bd('0xb')]);ChatInteractionEvents[_0x74bd('0xc')](_0x1d180f+':'+_0x3fab03['id'],_0x3fab03);ChatInteractionEvents[_0x74bd('0xc')](_0x1d180f,_0x3fab03);_0x40c17d(null);})[_0x74bd('0xd')](_0x40c17d(null));};}for(var e in events){if(events[_0x74bd('0xe')](e)){var event=events[e];ChatInteraction[_0x74bd('0xf')](e,emitEvent(event));}}module[_0x74bd('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 54f83e8..5459673 100644 --- a/server/api/chatInteraction/chatInteraction.model.js +++ b/server/api/chatInteraction/chatInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8459=['changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','chat_interactions'];(function(_0x20a5de,_0x3e9770){var _0x1985b9=function(_0x572a27){while(--_0x572a27){_0x20a5de['push'](_0x20a5de['shift']());}};_0x1985b9(++_0x3e9770);}(_0x8459,0x105));var _0x9845=function(_0x5286cc,_0x37d69b){_0x5286cc=_0x5286cc-0x0;var _0x1eaaeb=_0x8459[_0x5286cc];return _0x1eaaeb;};'use strict';var _=require(_0x9845('0x0'));var util=require(_0x9845('0x1'));var logger=require(_0x9845('0x2'))('api');var moment=require(_0x9845('0x3'));var BPromise=require(_0x9845('0x4'));var rp=require(_0x9845('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9845('0x6'));var config=require(_0x9845('0x7'));var attributes=require(_0x9845('0x8'));module[_0x9845('0x9')]=function(_0x164097,_0x4b7c99){return _0x164097['define']('ChatInteraction',attributes,{'tableName':_0x9845('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x120ae6,_0x218b4a,_0x4514d4){if(_0x120ae6[_0x9845('0xb')](_0x9845('0xc'))){_0x120ae6[_0x9845('0xd')]=moment()[_0x9845('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4514d4(null,_0x120ae6);}},'charset':_0x9845('0xf'),'collate':_0x9845('0x10')});}; \ No newline at end of file +var _0xe801=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x5c11c7,_0x35cb51){var _0x15a255=function(_0x433662){while(--_0x433662){_0x5c11c7['push'](_0x5c11c7['shift']());}};_0x15a255(++_0x35cb51);}(_0xe801,0xff));var _0x1e80=function(_0x94eb7,_0x39af65){_0x94eb7=_0x94eb7-0x0;var _0x339e8f=_0xe801[_0x94eb7];return _0x339e8f;};'use strict';var _=require('lodash');var util=require(_0x1e80('0x0'));var logger=require(_0x1e80('0x1'))(_0x1e80('0x2'));var moment=require(_0x1e80('0x3'));var BPromise=require(_0x1e80('0x4'));var rp=require(_0x1e80('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1e80('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x1e80('0x7')]=function(_0x5d4a1f,_0x2831c5){return _0x5d4a1f[_0x1e80('0x8')](_0x1e80('0x9'),attributes,{'tableName':_0x1e80('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30a9f8,_0x2c8131,_0x3bf6c8){if(_0x30a9f8[_0x1e80('0xb')]('closed')){_0x30a9f8[_0x1e80('0xc')]=moment()['format'](_0x1e80('0xd'));}_0x3bf6c8(null,_0x30a9f8);}},'charset':_0x1e80('0xe'),'collate':_0x1e80('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 6c4d93d..1037ee5 100644 --- a/server/api/chatInteraction/chatInteraction.rpc.js +++ b/server/api/chatInteraction/chatInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee52=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','update','body','raw','options','where','attributes','limit','then','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring'];(function(_0x39fd05,_0x16c2d1){var _0x6b306f=function(_0x2c4921){while(--_0x2c4921){_0x39fd05['push'](_0x39fd05['shift']());}};_0x6b306f(++_0x16c2d1);}(_0xee52,0x191));var _0x2ee5=function(_0x1a6b6c,_0x359ab6){_0x1a6b6c=_0x1a6b6c-0x0;var _0x9409ae=_0xee52[_0x1a6b6c];return _0x9409ae;};'use strict';var _=require('lodash');var util=require(_0x2ee5('0x0'));var moment=require(_0x2ee5('0x1'));var BPromise=require(_0x2ee5('0x2'));var rs=require(_0x2ee5('0x3'));var fs=require('fs');var Redis=require(_0x2ee5('0x4'));var db=require(_0x2ee5('0x5'))['db'];var utils=require(_0x2ee5('0x6'));var logger=require(_0x2ee5('0x7'))(_0x2ee5('0x8'));var config=require('../../config/environment');var jayson=require(_0x2ee5('0x9'));var client=jayson[_0x2ee5('0xa')][_0x2ee5('0xb')]({'port':0x232a});config[_0x2ee5('0xc')]=_[_0x2ee5('0xd')](config[_0x2ee5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ee5('0xe'))(new Redis(config[_0x2ee5('0xc')]));require(_0x2ee5('0xf'))['register'](socket);function respondWithRpcPromise(_0x659384,_0x10d056,_0x293776){return new BPromise(function(_0xa5bac7,_0x3e017c){return client[_0x2ee5('0x10')](_0x659384,_0x293776)['then'](function(_0x2c011c){logger[_0x2ee5('0x11')](_0x2ee5('0x12'),_0x10d056,'request\x20sent');logger[_0x2ee5('0x13')](_0x2ee5('0x14'),_0x10d056,'request\x20sent',JSON[_0x2ee5('0x15')](_0x2c011c));if(_0x2c011c[_0x2ee5('0x16')]){if(_0x2c011c[_0x2ee5('0x16')][_0x2ee5('0x17')]===0x1f4){logger[_0x2ee5('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x10d056,_0x2c011c[_0x2ee5('0x16')][_0x2ee5('0x18')]);return _0x3e017c(_0x2c011c[_0x2ee5('0x16')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x10d056,_0x2c011c['error'][_0x2ee5('0x18')]);return _0xa5bac7(_0x2c011c[_0x2ee5('0x16')][_0x2ee5('0x18')]);}else{logger[_0x2ee5('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x10d056,_0x2ee5('0x19'));_0xa5bac7(_0x2c011c[_0x2ee5('0x1a')][_0x2ee5('0x18')]);}})[_0x2ee5('0x1b')](function(_0x57378b){logger['error'](_0x2ee5('0x12'),_0x10d056,_0x57378b);_0x3e017c(_0x57378b);});});}exports[_0x2ee5('0x1c')]=function(_0x30c744){var _0x58d472=this;return new Promise(function(_0x280eb0,_0x5944b4){return db[_0x2ee5('0x1d')][_0x2ee5('0x1e')](_0x30c744[_0x2ee5('0x1f')],{'raw':_0x30c744['options']?_0x30c744['options'][_0x2ee5('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30c744['options']?_0x30c744[_0x2ee5('0x21')][_0x2ee5('0x22')]||null:null,'attributes':_0x30c744[_0x2ee5('0x21')]?_0x30c744[_0x2ee5('0x21')][_0x2ee5('0x23')]||null:null,'limit':_0x30c744[_0x2ee5('0x21')]?_0x30c744[_0x2ee5('0x21')][_0x2ee5('0x24')]||null:null})[_0x2ee5('0x25')](function(_0x3cd722){logger[_0x2ee5('0x11')](_0x2ee5('0x1c'),_0x30c744);logger[_0x2ee5('0x13')](_0x2ee5('0x1c'),_0x30c744,JSON['stringify'](_0x3cd722));_0x280eb0(_0x3cd722);})['catch'](function(_0x1ebe79){logger[_0x2ee5('0x16')](_0x2ee5('0x1c'),_0x1ebe79['message'],_0x30c744);_0x5944b4(_0x58d472[_0x2ee5('0x16')](0x1f4,_0x1ebe79[_0x2ee5('0x18')]));});});};exports[_0x2ee5('0x26')]=function(_0x15cda7){return new Promise(function(_0x1e2268,_0xae3de6){return db[_0x2ee5('0x1d')][_0x2ee5('0x27')]({'where':_0x15cda7[_0x2ee5('0x21')]?_0x15cda7[_0x2ee5('0x21')][_0x2ee5('0x22')]||null:null})[_0x2ee5('0x25')](function(_0x147b82){if(_0x147b82){return _0x147b82[_0x2ee5('0x28')](_0x15cda7[_0x2ee5('0x1f')][_0x2ee5('0x29')],_[_0x2ee5('0x2a')](_0x15cda7[_0x2ee5('0x1f')],[_0x2ee5('0x29'),'id'])||{});}})[_0x2ee5('0x2b')](function(_0x4d0107){logger[_0x2ee5('0x11')]('AddTags',_0x15cda7);logger['debug'](_0x2ee5('0x2c'),_0x15cda7,JSON['stringify'](_0x4d0107));_0x1e2268(_0x4d0107);})[_0x2ee5('0x1b')](function(_0xccb0ec){logger[_0x2ee5('0x16')](_0x2ee5('0x2c'),_0xccb0ec[_0x2ee5('0x18')],_0x15cda7);_0xae3de6(_this['error'](0x1f4,_0xccb0ec[_0x2ee5('0x18')]));});});}; \ No newline at end of file +var _0x1815=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','update','body','options','raw','where','limit','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x550285,_0x52655b){var _0x4afa3d=function(_0x12044c){while(--_0x12044c){_0x550285['push'](_0x550285['shift']());}};_0x4afa3d(++_0x52655b);}(_0x1815,0x1d3));var _0x5181=function(_0xf0ac60,_0x4f7285){_0xf0ac60=_0xf0ac60-0x0;var _0x4be5c2=_0x1815[_0xf0ac60];return _0x4be5c2;};'use strict';var _=require(_0x5181('0x0'));var util=require(_0x5181('0x1'));var moment=require(_0x5181('0x2'));var BPromise=require('bluebird');var rs=require(_0x5181('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5181('0x4'))['db'];var utils=require(_0x5181('0x5'));var logger=require(_0x5181('0x6'))(_0x5181('0x7'));var config=require(_0x5181('0x8'));var jayson=require(_0x5181('0x9'));var client=jayson[_0x5181('0xa')][_0x5181('0xb')]({'port':0x232a});config[_0x5181('0xc')]=_[_0x5181('0xd')](config[_0x5181('0xc')],{'host':_0x5181('0xe'),'port':0x18eb});var socket=require(_0x5181('0xf'))(new Redis(config[_0x5181('0xc')]));require(_0x5181('0x10'))['register'](socket);function respondWithRpcPromise(_0x12bd0f,_0x530ad0,_0x376e41){return new BPromise(function(_0x1a605f,_0xaeaff7){return client[_0x5181('0x11')](_0x12bd0f,_0x376e41)[_0x5181('0x12')](function(_0x1f51eb){logger[_0x5181('0x13')](_0x5181('0x14'),_0x530ad0,'request\x20sent');logger[_0x5181('0x15')](_0x5181('0x16'),_0x530ad0,'request\x20sent',JSON[_0x5181('0x17')](_0x1f51eb));if(_0x1f51eb[_0x5181('0x18')]){if(_0x1f51eb['error'][_0x5181('0x19')]===0x1f4){logger[_0x5181('0x18')](_0x5181('0x14'),_0x530ad0,_0x1f51eb[_0x5181('0x18')]['message']);return _0xaeaff7(_0x1f51eb[_0x5181('0x18')]['message']);}logger[_0x5181('0x18')](_0x5181('0x14'),_0x530ad0,_0x1f51eb[_0x5181('0x18')][_0x5181('0x1a')]);return _0x1a605f(_0x1f51eb[_0x5181('0x18')][_0x5181('0x1a')]);}else{logger['info'](_0x5181('0x14'),_0x530ad0,'request\x20sent');_0x1a605f(_0x1f51eb[_0x5181('0x1b')][_0x5181('0x1a')]);}})[_0x5181('0x1c')](function(_0x3d7735){logger[_0x5181('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x530ad0,_0x3d7735);_0xaeaff7(_0x3d7735);});});}exports['UpdateChatInteraction']=function(_0x356852){var _0x2b597f=this;return new Promise(function(_0x5593de,_0x49a821){return db[_0x5181('0x1d')][_0x5181('0x1e')](_0x356852[_0x5181('0x1f')],{'raw':_0x356852[_0x5181('0x20')]?_0x356852[_0x5181('0x20')][_0x5181('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x356852['options']?_0x356852[_0x5181('0x20')][_0x5181('0x22')]||null:null,'attributes':_0x356852[_0x5181('0x20')]?_0x356852[_0x5181('0x20')]['attributes']||null:null,'limit':_0x356852[_0x5181('0x20')]?_0x356852['options'][_0x5181('0x23')]||null:null})[_0x5181('0x12')](function(_0x2264f8){logger[_0x5181('0x13')](_0x5181('0x24'),_0x356852);logger[_0x5181('0x15')]('UpdateChatInteraction',_0x356852,JSON[_0x5181('0x17')](_0x2264f8));_0x5593de(_0x2264f8);})['catch'](function(_0x5735e9){logger['error'](_0x5181('0x24'),_0x5735e9['message'],_0x356852);_0x49a821(_0x2b597f[_0x5181('0x18')](0x1f4,_0x5735e9[_0x5181('0x1a')]));});});};exports[_0x5181('0x25')]=function(_0x20a9a6){return new Promise(function(_0x27505a,_0x13fe41){return db[_0x5181('0x1d')]['find']({'where':_0x20a9a6[_0x5181('0x20')]?_0x20a9a6[_0x5181('0x20')]['where']||null:null})['then'](function(_0x166b58){if(_0x166b58){return _0x166b58[_0x5181('0x26')](_0x20a9a6['body'][_0x5181('0x27')],_[_0x5181('0x28')](_0x20a9a6[_0x5181('0x1f')],[_0x5181('0x27'),'id'])||{});}})[_0x5181('0x29')](function(_0x5b9cbc){logger[_0x5181('0x13')](_0x5181('0x2a'),_0x20a9a6);logger[_0x5181('0x15')]('AddTags',_0x20a9a6,JSON['stringify'](_0x5b9cbc));_0x27505a(_0x5b9cbc);})[_0x5181('0x1c')](function(_0x404026){logger[_0x5181('0x18')](_0x5181('0x2a'),_0x404026['message'],_0x20a9a6);_0x13fe41(_this[_0x5181('0x18')](0x1f4,_0x404026[_0x5181('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index d6845f4..e2d6e3d 100644 --- a/server/api/chatInteraction/chatInteraction.socket.js +++ b/server/api/chatInteraction/chatInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x188e=['save','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x4982eb,_0x472106){var _0x445b43=function(_0x4f13d7){while(--_0x4f13d7){_0x4982eb['push'](_0x4982eb['shift']());}};_0x445b43(++_0x472106);}(_0x188e,0x1df));var _0xe188=function(_0x12f078,_0x3c361){_0x12f078=_0x12f078-0x0;var _0x1f7987=_0x188e[_0x12f078];return _0x1f7987;};'use strict';var ChatInteractionEvents=require(_0xe188('0x0'));var events=[_0xe188('0x1'),'remove','update'];function createListener(_0x33a0d4,_0x252ed4){return function(_0x42a66f){_0x252ed4[_0xe188('0x2')](_0x33a0d4,_0x42a66f);};}function removeListener(_0x2ec6c5,_0x3582f8){return function(){ChatInteractionEvents[_0xe188('0x3')](_0x2ec6c5,_0x3582f8);};}exports[_0xe188('0x4')]=function(_0x20c9f3){for(var _0x4da31d=0x0,_0x547f75=events['length'];_0x4da31d<_0x547f75;_0x4da31d++){var _0x4417f=events[_0x4da31d];var _0x298284=createListener(_0xe188('0x5')+_0x4417f,_0x20c9f3);ChatInteractionEvents['on'](_0x4417f,_0x298284);}}; \ No newline at end of file +var _0x818f=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x324520,_0x42a48d){var _0x4d6de7=function(_0x3bf39d){while(--_0x3bf39d){_0x324520['push'](_0x324520['shift']());}};_0x4d6de7(++_0x42a48d);}(_0x818f,0x1da));var _0xf818=function(_0x292b3e,_0x4faeb3){_0x292b3e=_0x292b3e-0x0;var _0x5c7e80=_0x818f[_0x292b3e];return _0x5c7e80;};'use strict';var ChatInteractionEvents=require(_0xf818('0x0'));var events=[_0xf818('0x1'),_0xf818('0x2'),_0xf818('0x3')];function createListener(_0x121db7,_0x39b430){return function(_0x58f142){_0x39b430[_0xf818('0x4')](_0x121db7,_0x58f142);};}function removeListener(_0xd6c86,_0x2c1bb0){return function(){ChatInteractionEvents[_0xf818('0x5')](_0xd6c86,_0x2c1bb0);};}exports[_0xf818('0x6')]=function(_0x41310f){for(var _0x27119b=0x0,_0x42a23e=events[_0xf818('0x7')];_0x27119b<_0x42a23e;_0x27119b++){var _0x55540d=events[_0x27119b];var _0x1dbfc8=createListener(_0xf818('0x8')+_0x55540d,_0x41310f);ChatInteractionEvents['on'](_0x55540d,_0x1dbfc8);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 4683c16..e6d4f5f 100644 --- a/server/api/chatInteraction/index.js +++ b/server/api/chatInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b7f=['file','attachmentUpload','addMessage','/:id/tags','/:id','tracked','chat','chatinteraction:update','put','/:id/custom_update','customUpdate','/:id/abandon','delete','chatinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','root','server/files/attachments/','originalname','/:id/attachment_upload','single'];(function(_0x3dc21f,_0x590c94){var _0x1b2835=function(_0x4baeca){while(--_0x4baeca){_0x3dc21f['push'](_0x3dc21f['shift']());}};_0x1b2835(++_0x590c94);}(_0x6b7f,0x6a));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf6b7('0x0'));var util=require(_0xf6b7('0x1'));var path=require(_0xf6b7('0x2'));var timeout=require(_0xf6b7('0x3'));var express=require('express');var router=express[_0xf6b7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf6b7('0x5'));var interaction=require(_0xf6b7('0x6'));var config=require('../../config/environment');var controller=require(_0xf6b7('0x7'));router[_0xf6b7('0x8')]('/',auth[_0xf6b7('0x9')](),controller['index']);router[_0xf6b7('0x8')](_0xf6b7('0xa'),auth[_0xf6b7('0x9')](),controller[_0xf6b7('0xb')]);router[_0xf6b7('0x8')]('/:id',auth[_0xf6b7('0xc')](),controller[_0xf6b7('0xd')]);router[_0xf6b7('0x8')](_0xf6b7('0xe'),auth[_0xf6b7('0xc')](),controller['attachmentDownload']);router[_0xf6b7('0x8')](_0xf6b7('0xf'),auth[_0xf6b7('0x9')](),controller['getMessages']);router['get'](_0xf6b7('0x10'),auth['isChatInteractionAuthorized'](),controller[_0xf6b7('0x11')]);router['get'](_0xf6b7('0x12'),auth[_0xf6b7('0x9')](),controller[_0xf6b7('0x13')]);router[_0xf6b7('0x14')]('/',auth['isAuthenticated'](),controller[_0xf6b7('0x15')]);router[_0xf6b7('0x14')](_0xf6b7('0x16'),auth[_0xf6b7('0x9')](),controller[_0xf6b7('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1e9f2c,_0xdd2696,_0x177226){_0x177226(null,path['join'](config[_0xf6b7('0x18')],_0xf6b7('0x19')));},'filename':function(_0x3f12b8,_0x549945,_0x538ed9){_0x538ed9(null,util['format']('%s-%s',Date['now'](),_0x549945[_0xf6b7('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf6b7('0x14')](_0xf6b7('0x1b'),upload[_0xf6b7('0x1c')](_0xf6b7('0x1d')),controller[_0xf6b7('0x1e')]);router[_0xf6b7('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xf6b7('0x1f')]);router[_0xf6b7('0x14')](_0xf6b7('0x20'),auth['isAuthenticated'](),interaction['tracked']('chat','chatinteraction:addtags'),controller['addTags']);router['put'](_0xf6b7('0x21'),auth['isAuthenticated'](),interaction[_0xf6b7('0x22')](_0xf6b7('0x23'),_0xf6b7('0x24')),controller['update']);router[_0xf6b7('0x25')](_0xf6b7('0x26'),controller[_0xf6b7('0x27')]);router[_0xf6b7('0x25')](_0xf6b7('0x28'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xf6b7('0x25')]('/:id/close',controller['close']);router[_0xf6b7('0x29')]('/:id',auth[_0xf6b7('0x9')](),interaction[_0xf6b7('0x22')](_0xf6b7('0x23'),_0xf6b7('0x2a')),controller[_0xf6b7('0x2b')]);router['delete'](_0xf6b7('0x20'),auth[_0xf6b7('0x9')](),controller['removeTags']);module[_0xf6b7('0x2c')]=router; \ No newline at end of file +var _0x71cb=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','customUpdate','close','delete','chatinteraction:destroy','destroy','/:id/tags'];(function(_0xb67251,_0x1f6208){var _0x979d96=function(_0x41d0d0){while(--_0x41d0d0){_0xb67251['push'](_0xb67251['shift']());}};_0x979d96(++_0x1f6208);}(_0x71cb,0x109));var _0xb71c=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x71cb[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0xb71c('0x0'));var util=require(_0xb71c('0x1'));var path=require(_0xb71c('0x2'));var timeout=require(_0xb71c('0x3'));var express=require(_0xb71c('0x4'));var router=express[_0xb71c('0x5')]();var fs_extra=require(_0xb71c('0x6'));var auth=require(_0xb71c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb71c('0x8'));var controller=require(_0xb71c('0x9'));router[_0xb71c('0xa')]('/',auth[_0xb71c('0xb')](),controller['index']);router[_0xb71c('0xa')](_0xb71c('0xc'),auth[_0xb71c('0xb')](),controller[_0xb71c('0xd')]);router['get'](_0xb71c('0xe'),auth[_0xb71c('0xf')](),controller[_0xb71c('0x10')]);router[_0xb71c('0xa')](_0xb71c('0x11'),auth[_0xb71c('0xf')](),controller[_0xb71c('0x12')]);router[_0xb71c('0xa')]('/:id/messages',auth[_0xb71c('0xb')](),controller[_0xb71c('0x13')]);router[_0xb71c('0xa')]('/:id/my_messages',auth[_0xb71c('0xf')](),controller[_0xb71c('0x14')]);router[_0xb71c('0xa')](_0xb71c('0x15'),auth[_0xb71c('0xb')](),controller[_0xb71c('0x16')]);router['post']('/',auth[_0xb71c('0xb')](),controller[_0xb71c('0x17')]);router[_0xb71c('0x18')](_0xb71c('0x19'),auth['isAuthenticated'](),controller[_0xb71c('0x1a')]);var upload=multer({'storage':multer[_0xb71c('0x1b')]({'destination':function(_0x11afe6,_0x251495,_0xb682f8){_0xb682f8(null,path[_0xb71c('0x1c')](config[_0xb71c('0x1d')],_0xb71c('0x1e')));},'filename':function(_0x32de37,_0x1d1078,_0x2294bd){_0x2294bd(null,util[_0xb71c('0x1f')]('%s-%s',Date[_0xb71c('0x20')](),_0x1d1078[_0xb71c('0x21')][_0xb71c('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xb71c('0x23'),upload['single'](_0xb71c('0x24')),controller[_0xb71c('0x25')]);router['post'](_0xb71c('0x26'),auth['isChatInteractionAuthorized'](),controller[_0xb71c('0x27')]);router['post']('/:id/tags',auth[_0xb71c('0xb')](),interaction[_0xb71c('0x28')](_0xb71c('0x29'),_0xb71c('0x2a')),controller[_0xb71c('0x2b')]);router['put'](_0xb71c('0xe'),auth[_0xb71c('0xb')](),interaction[_0xb71c('0x28')](_0xb71c('0x29'),_0xb71c('0x2c')),controller[_0xb71c('0x2d')]);router[_0xb71c('0x2e')]('/:id/custom_update',controller[_0xb71c('0x2f')]);router[_0xb71c('0x2e')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xb71c('0x2e')]('/:id/close',controller[_0xb71c('0x30')]);router[_0xb71c('0x31')](_0xb71c('0xe'),auth[_0xb71c('0xb')](),interaction[_0xb71c('0x28')](_0xb71c('0x29'),_0xb71c('0x32')),controller[_0xb71c('0x33')]);router[_0xb71c('0x31')](_0xb71c('0x34'),auth[_0xb71c('0xb')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 597a286..e4765bc 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js +++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ce9=['BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x2123aa,_0x2e8a74){var _0x413cde=function(_0x3f0042){while(--_0x3f0042){_0x2123aa['push'](_0x2123aa['shift']());}};_0x413cde(++_0x2e8a74);}(_0x8ce9,0x13e));var _0x98ce=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8ce9[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x98ce('0x0'));module['exports']={'body':{'type':Sequelize[_0x98ce('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x98ce('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x98ce('0x3')]}}; \ No newline at end of file +var _0x17bb=['TEXT','INTEGER','exports'];(function(_0x51d526,_0x291bcb){var _0xddb6cc=function(_0x2fade1){while(--_0x2fade1){_0x51d526['push'](_0x51d526['shift']());}};_0xddb6cc(++_0x291bcb);}(_0x17bb,0x131));var _0xb17b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x17bb[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0xb17b('0x0')]={'body':{'type':Sequelize[_0xb17b('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb17b('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 282e6e8..2cd4eb9 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.controller.js +++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d79=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatInternalMessage','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','messages','FromId','read','-createdAt','all','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x1ea075,_0xeadcca){var _0x1a8210=function(_0x9ac8cf){while(--_0x9ac8cf){_0x1ea075['push'](_0x1ea075['shift']());}};_0x1a8210(++_0xeadcca);}(_0x0d79,0x141));var _0x90d7=function(_0x436849,_0x430b00){_0x436849=_0x436849-0x0;var _0x5c5f73=_0x0d79[_0x436849];return _0x5c5f73;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90d7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90d7('0x1'));var rp=require(_0x90d7('0x2'));var moment=require(_0x90d7('0x3'));var BPromise=require(_0x90d7('0x4'));var Mustache=require(_0x90d7('0x5'));var util=require(_0x90d7('0x6'));var path=require(_0x90d7('0x7'));var sox=require(_0x90d7('0x8'));var csv=require(_0x90d7('0x9'));var ejs=require(_0x90d7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90d7('0xb'));var squel=require(_0x90d7('0xc'));var crypto=require(_0x90d7('0xd'));var jsforce=require(_0x90d7('0xe'));var deskjs=require(_0x90d7('0xf'));var toCsv=require(_0x90d7('0x9'));var querystring=require(_0x90d7('0x10'));var Papa=require(_0x90d7('0x11'));var Redis=require(_0x90d7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x90d7('0x13'));var as=require(_0x90d7('0x14'));var hardwareService=require(_0x90d7('0x15'));var logger=require(_0x90d7('0x16'))(_0x90d7('0x17'));var utils=require(_0x90d7('0x18'));var config=require(_0x90d7('0x19'));var licenseUtil=require(_0x90d7('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x90d7('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x90d7('0x1c'))(new Redis(config[_0x90d7('0x1b')]));require('./chatInternalMessage.socket')[_0x90d7('0x1d')](socket);function respondWithStatusCode(_0x110213,_0x28ffd7){_0x28ffd7=_0x28ffd7||0xcc;return function(_0x664a85){if(_0x664a85){return _0x110213['sendStatus'](_0x28ffd7);}return _0x110213[_0x90d7('0x1e')](_0x28ffd7)['end']();};}function respondWithResult(_0x17056e,_0x3c9e37){_0x3c9e37=_0x3c9e37||0xc8;return function(_0x19602e){if(_0x19602e){return _0x17056e['status'](_0x3c9e37)[_0x90d7('0x1f')](_0x19602e);}};}function respondWithFilteredResult(_0x16ea08,_0x416b98){return function(_0x1d9dd8){if(_0x1d9dd8){var _0x52b777=typeof _0x416b98[_0x90d7('0x20')]==='undefined'&&typeof _0x416b98[_0x90d7('0x21')]===_0x90d7('0x22');var _0xf367a2=_0x1d9dd8[_0x90d7('0x23')];var _0xcbd171=_0x52b777?0x0:_0x416b98[_0x90d7('0x20')];var _0x5e00e5=_0x52b777?_0x1d9dd8['count']:_0x416b98[_0x90d7('0x20')]+_0x416b98[_0x90d7('0x21')];var _0x1b2b08;if(_0x5e00e5>=_0xf367a2){_0x5e00e5=_0xf367a2;_0x1b2b08=0xc8;}else{_0x1b2b08=0xce;}_0x16ea08[_0x90d7('0x1e')](_0x1b2b08);return _0x16ea08[_0x90d7('0x24')](_0x90d7('0x25'),_0xcbd171+'-'+_0x5e00e5+'/'+_0xf367a2)[_0x90d7('0x1f')](_0x1d9dd8);}return null;};}function patchUpdates(_0x473d52){return function(_0x181def){try{jsonpatch['apply'](_0x181def,_0x473d52,!![]);}catch(_0x75585f){return BPromise['reject'](_0x75585f);}return _0x181def['save']();};}function saveUpdates(_0x3aff65,_0x3d16d9){return function(_0x40002b){if(_0x40002b){return _0x40002b[_0x90d7('0x26')](_0x3aff65)['then'](function(_0x25e8de){return _0x25e8de;});}return null;};}function removeEntity(_0x4d87bd,_0x4db6f5){return function(_0x2bd744){if(_0x2bd744){return _0x2bd744[_0x90d7('0x27')]()[_0x90d7('0x28')](function(){_0x4d87bd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8fd0dd,_0x112589){return function(_0x12fc38){if(!_0x12fc38){_0x8fd0dd[_0x90d7('0x29')](0x194);}return _0x12fc38;};}function handleError(_0x2366f7,_0x4456a1){_0x4456a1=_0x4456a1||0x1f4;return function(_0x46e529){logger[_0x90d7('0x2a')](_0x46e529[_0x90d7('0x2b')]);if(_0x46e529['name']){delete _0x46e529[_0x90d7('0x2c')];}_0x2366f7[_0x90d7('0x1e')](_0x4456a1)[_0x90d7('0x2d')](_0x46e529);};}exports[_0x90d7('0x2e')]=function(_0x23df76,_0x1c22fd){var _0x377cb2={},_0x342989={},_0x5511e0={'count':0x0,'rows':[]};var _0x529d7a=_[_0x90d7('0x2f')](db['ChatInternalMessage'][_0x90d7('0x30')],function(_0x2910e1){return{'name':_0x2910e1[_0x90d7('0x31')],'type':_0x2910e1[_0x90d7('0x32')][_0x90d7('0x33')]};});_0x342989[_0x90d7('0x34')]=_[_0x90d7('0x2f')](_0x529d7a,_0x90d7('0x2c'));_0x342989[_0x90d7('0x35')]=_[_0x90d7('0x36')](_0x23df76[_0x90d7('0x35')]);_0x342989[_0x90d7('0x37')]=_['intersection'](_0x342989[_0x90d7('0x34')],_0x342989[_0x90d7('0x35')]);_0x377cb2[_0x90d7('0x38')]=_[_0x90d7('0x39')](_0x342989[_0x90d7('0x34')],qs['fields'](_0x23df76[_0x90d7('0x35')][_0x90d7('0x3a')]));_0x377cb2[_0x90d7('0x38')]=_0x377cb2['attributes']['length']?_0x377cb2[_0x90d7('0x38')]:_0x342989[_0x90d7('0x34')];if(!_0x23df76[_0x90d7('0x35')][_0x90d7('0x3b')](_0x90d7('0x3c'))){_0x377cb2[_0x90d7('0x21')]=qs[_0x90d7('0x21')](_0x23df76['query'][_0x90d7('0x21')]);_0x377cb2['offset']=qs[_0x90d7('0x20')](_0x23df76['query'][_0x90d7('0x20')]);}_0x377cb2[_0x90d7('0x3d')]=qs[_0x90d7('0x3e')](_0x23df76['query'][_0x90d7('0x3e')]);_0x377cb2[_0x90d7('0x3f')]=qs[_0x90d7('0x37')](_[_0x90d7('0x40')](_0x23df76[_0x90d7('0x35')],_0x342989['filters']),_0x529d7a);if(_0x23df76['query'][_0x90d7('0x41')]){_0x377cb2[_0x90d7('0x3f')]=_[_0x90d7('0x42')](_0x377cb2[_0x90d7('0x3f')],{'$or':_['map'](_0x529d7a,function(_0x970955){if(_0x970955[_0x90d7('0x32')]!=='VIRTUAL'){var _0x48a747={};_0x48a747[_0x970955[_0x90d7('0x2c')]]={'$like':'%'+_0x23df76['query'][_0x90d7('0x41')]+'%'};return _0x48a747;}})});}_0x377cb2=_[_0x90d7('0x42')]({},_0x377cb2,_0x23df76[_0x90d7('0x43')]);var _0x4c2f86={'where':_0x377cb2['where']};return db[_0x90d7('0x44')][_0x90d7('0x23')](_0x4c2f86)['then'](function(_0xd29962){_0x5511e0[_0x90d7('0x23')]=_0xd29962;if(_0x23df76['query']['includeAll']){_0x377cb2[_0x90d7('0x45')]=[{'all':!![]}];}return db[_0x90d7('0x44')][_0x90d7('0x46')](_0x377cb2);})['then'](function(_0x3673a8){_0x5511e0[_0x90d7('0x47')]=_0x3673a8;return _0x5511e0;})[_0x90d7('0x28')](respondWithFilteredResult(_0x1c22fd,_0x377cb2))[_0x90d7('0x48')](handleError(_0x1c22fd,null));};exports[_0x90d7('0x49')]=function(_0xe706d8,_0x14046e){var _0x4ede31={'raw':!![],'where':{'id':_0xe706d8[_0x90d7('0x4a')]['id']}},_0x2903e5={};_0x2903e5[_0x90d7('0x34')]=_[_0x90d7('0x36')](db[_0x90d7('0x44')][_0x90d7('0x30')]);_0x2903e5[_0x90d7('0x35')]=_[_0x90d7('0x36')](_0xe706d8[_0x90d7('0x35')]);_0x2903e5[_0x90d7('0x37')]=_[_0x90d7('0x39')](_0x2903e5[_0x90d7('0x34')],_0x2903e5[_0x90d7('0x35')]);_0x4ede31[_0x90d7('0x38')]=_[_0x90d7('0x39')](_0x2903e5[_0x90d7('0x34')],qs[_0x90d7('0x3a')](_0xe706d8[_0x90d7('0x35')][_0x90d7('0x3a')]));_0x4ede31[_0x90d7('0x38')]=_0x4ede31['attributes'][_0x90d7('0x4b')]?_0x4ede31[_0x90d7('0x38')]:_0x2903e5['model'];if(_0xe706d8[_0x90d7('0x35')][_0x90d7('0x4c')]){_0x4ede31['include']=[{'all':!![]}];}_0x4ede31=_[_0x90d7('0x42')]({},_0x4ede31,_0xe706d8['options']);return db[_0x90d7('0x44')][_0x90d7('0x4d')](_0x4ede31)[_0x90d7('0x28')](handleEntityNotFound(_0x14046e,null))['then'](respondWithResult(_0x14046e,null))[_0x90d7('0x48')](handleError(_0x14046e,null));};exports[_0x90d7('0x4e')]=function(_0x15122d,_0x123ec7){return db[_0x90d7('0x44')]['create'](_0x15122d[_0x90d7('0x4f')],{})[_0x90d7('0x28')](respondWithResult(_0x123ec7,0xc9))[_0x90d7('0x48')](handleError(_0x123ec7,null));};exports[_0x90d7('0x26')]=function(_0x58669f,_0x2c345a){if(_0x58669f[_0x90d7('0x4f')]['id']){delete _0x58669f[_0x90d7('0x4f')]['id'];}return db[_0x90d7('0x44')]['find']({'where':{'id':_0x58669f['params']['id']}})[_0x90d7('0x28')](handleEntityNotFound(_0x2c345a,null))[_0x90d7('0x28')](saveUpdates(_0x58669f[_0x90d7('0x4f')],null))[_0x90d7('0x28')](respondWithResult(_0x2c345a,null))[_0x90d7('0x48')](handleError(_0x2c345a,null));};exports[_0x90d7('0x27')]=function(_0x44d632,_0x594894){return db[_0x90d7('0x44')]['find']({'where':{'id':_0x44d632['params']['id']}})[_0x90d7('0x28')](handleEntityNotFound(_0x594894,null))['then'](removeEntity(_0x594894,null))['catch'](handleError(_0x594894,null));};exports['describe']=function(_0x567695,_0x824a0){return db[_0x90d7('0x44')][_0x90d7('0x50')]()['then'](respondWithResult(_0x824a0,null))['catch'](handleError(_0x824a0,null));};function wrapUser(_0x4c0fa1){return function(_0x1b23ac){var _0x1b4350=_0x4c0fa1[_0x90d7('0x51')]({'plain':!![]});_0x1b4350['messages']=[];if(_0x1b23ac){_0x1b4350['lastMessageAt']=_0x1b23ac[_0x90d7('0x52')];_0x1b4350[_0x90d7('0x53')]=_0x1b23ac;}else{_0x1b4350[_0x90d7('0x54')]=moment(0x0)[_0x90d7('0x55')](_0x90d7('0x56'));_0x1b4350['lastMessage']={};}return _0x1b4350;};}exports['getUsers']=function(_0xbf86c1,_0x4a0d86,_0x173331){var _0x470494=[];return db['User'][_0x90d7('0x46')]({'where':{'role':[_0x90d7('0x57'),_0x90d7('0x58'),'user']},'attributes':['id',_0x90d7('0x59'),'name',_0x90d7('0x5a'),_0x90d7('0x5b'),_0x90d7('0x5c'),_0x90d7('0x5d'),_0x90d7('0x5e'),_0x90d7('0x5f'),'showWebBar'],'order':qs['sort']('-online'),'include':[{'model':db[_0x90d7('0x60')],'as':'VoiceQueues','attributes':['id','name',_0x90d7('0x32')],'through':{'attributes':[]}}]})[_0x90d7('0x28')](function(_0x42cd72){if(_0x42cd72){var _0x3d50f8=_0xbf86c1[_0x90d7('0x61')]['get']({'plain':!![]});if(!_0x3d50f8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d50f8['role']===_0x90d7('0x61')){return db[_0x90d7('0x62')][_0x90d7('0x4d')]({'where':{'name':_0x90d7('0x63'),'userProfileId':_0x3d50f8[_0x90d7('0x64')]},'raw':!![]})[_0x90d7('0x28')](function(_0x53e2ee){if(_0x53e2ee){if(_0x53e2ee[_0x90d7('0x65')]===0x0){return db[_0x90d7('0x66')][_0x90d7('0x46')]({'where':{'sectionId':_0x53e2ee['id']},'raw':!![]})[_0x90d7('0x28')](function(_0x42c37a){var _0x35e67f=[];if(_[_0x90d7('0x67')](_0x42c37a)){_0x35e67f=_['filter'](_0x42cd72,function(_0xb595b3){if(_0xb595b3['role']!==_0x90d7('0x57')){return _0xb595b3;}});return _0x35e67f;}else{for(var _0x192e9c=0x0;_0x192e9c<_0x42cd72[_0x90d7('0x4b')];_0x192e9c++){var _0x3d875a=_0x42cd72[_0x192e9c];if(_0x3d875a[_0x90d7('0x5a')]===_0x90d7('0x57')){var _0x517119=_['find'](_0x42c37a,function(_0x5153b6){return _0x5153b6['resourceId']===_0x3d875a['id'];});if(_0x517119)_0x35e67f[_0x90d7('0x68')](_0x3d875a);}else{_0x35e67f[_0x90d7('0x68')](_0x3d875a);}}return _0x35e67f;}});}else{return _0x42cd72;}}else{var _0x20d0ac=_[_0x90d7('0x41')](_0x42cd72,function(_0x7905bc){if(_0x7905bc[_0x90d7('0x5a')]!==_0x90d7('0x57')){return _0x7905bc;}});return _0x20d0ac;}});}else{return _0x42cd72;}}})[_0x90d7('0x28')](function(_0x5b28e0){var _0x38bb2f=[];if(_0x5b28e0){_0x470494=_0x5b28e0;for(var _0x23018e=0x0;_0x23018e<_0x5b28e0['length'];_0x23018e+=0x1){_0x470494[_0x23018e][_0x90d7('0x69')]=[];_0x38bb2f[_0x90d7('0x68')](db['ChatInternalMessage'][_0x90d7('0x4d')]({'where':{'FromId':[_0xbf86c1['user']['id'],_0x5b28e0[_0x23018e]['id']],'ToId':[_0xbf86c1[_0x90d7('0x61')]['id'],_0x5b28e0[_0x23018e]['id']],'ChatGroupId':null},'attributes':['id',_0x90d7('0x52'),_0x90d7('0x6a'),'ToId',_0x90d7('0x6b'),_0x90d7('0x4f')],'order':qs[_0x90d7('0x3e')](_0x90d7('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x90d7('0x28')](wrapUser(_0x5b28e0[_0x23018e])));}return BPromise[_0x90d7('0x6d')](_0x38bb2f);}return[];})[_0x90d7('0x28')](function(_0x3feed6){return{'rows':_0x3feed6,'count':_0x3feed6[_0x90d7('0x4b')]};})[_0x90d7('0x28')](respondWithResult(_0x4a0d86,null))[_0x90d7('0x48')](handleError(_0x4a0d86,null));}; \ No newline at end of file +var _0xd059=['lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','userpic','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','end','error','name','send','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','update','find','describe','messages','lastMessageAt'];(function(_0x334763,_0x575eff){var _0x566db0=function(_0x217cc2){while(--_0x217cc2){_0x334763['push'](_0x334763['shift']());}};_0x566db0(++_0x575eff);}(_0xd059,0x172));var _0x9d05=function(_0x4a7763,_0x5e8437){_0x4a7763=_0x4a7763-0x0;var _0x682b2f=_0xd059[_0x4a7763];return _0x682b2f;};'use strict';var emlformat=require(_0x9d05('0x0'));var rimraf=require(_0x9d05('0x1'));var zipdir=require(_0x9d05('0x2'));var jsonpatch=require(_0x9d05('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9d05('0x4'));var Mustache=require(_0x9d05('0x5'));var util=require(_0x9d05('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9d05('0x7'));var ejs=require(_0x9d05('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d05('0x9'));var squel=require(_0x9d05('0xa'));var crypto=require(_0x9d05('0xb'));var jsforce=require(_0x9d05('0xc'));var deskjs=require(_0x9d05('0xd'));var toCsv=require(_0x9d05('0x7'));var querystring=require(_0x9d05('0xe'));var Papa=require(_0x9d05('0xf'));var Redis=require(_0x9d05('0x10'));var authService=require(_0x9d05('0x11'));var qs=require(_0x9d05('0x12'));var as=require(_0x9d05('0x13'));var hardwareService=require(_0x9d05('0x14'));var logger=require(_0x9d05('0x15'))(_0x9d05('0x16'));var utils=require('../../config/utils');var config=require(_0x9d05('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d05('0x18'))['db'];config[_0x9d05('0x19')]=_[_0x9d05('0x1a')](config[_0x9d05('0x19')],{'host':_0x9d05('0x1b'),'port':0x18eb});var socket=require(_0x9d05('0x1c'))(new Redis(config[_0x9d05('0x19')]));require(_0x9d05('0x1d'))[_0x9d05('0x1e')](socket);function respondWithStatusCode(_0x16ea19,_0x44c8f8){_0x44c8f8=_0x44c8f8||0xcc;return function(_0x35fd2e){if(_0x35fd2e){return _0x16ea19[_0x9d05('0x1f')](_0x44c8f8);}return _0x16ea19['status'](_0x44c8f8)['end']();};}function respondWithResult(_0x545521,_0x143ed5){_0x143ed5=_0x143ed5||0xc8;return function(_0xd6dd7f){if(_0xd6dd7f){return _0x545521[_0x9d05('0x20')](_0x143ed5)[_0x9d05('0x21')](_0xd6dd7f);}};}function respondWithFilteredResult(_0x5a290e,_0x3ef6b8){return function(_0xe3f129){if(_0xe3f129){var _0x6f46db=typeof _0x3ef6b8[_0x9d05('0x22')]==='undefined'&&typeof _0x3ef6b8[_0x9d05('0x23')]===_0x9d05('0x24');var _0xe22eb6=_0xe3f129[_0x9d05('0x25')];var _0x27bda1=_0x6f46db?0x0:_0x3ef6b8[_0x9d05('0x22')];var _0x5378d3=_0x6f46db?_0xe3f129[_0x9d05('0x25')]:_0x3ef6b8[_0x9d05('0x22')]+_0x3ef6b8['limit'];var _0x14ae3c;if(_0x5378d3>=_0xe22eb6){_0x5378d3=_0xe22eb6;_0x14ae3c=0xc8;}else{_0x14ae3c=0xce;}_0x5a290e['status'](_0x14ae3c);return _0x5a290e[_0x9d05('0x26')](_0x9d05('0x27'),_0x27bda1+'-'+_0x5378d3+'/'+_0xe22eb6)[_0x9d05('0x21')](_0xe3f129);}return null;};}function patchUpdates(_0x26af89){return function(_0xff50d){try{jsonpatch[_0x9d05('0x28')](_0xff50d,_0x26af89,!![]);}catch(_0xc4dad6){return BPromise[_0x9d05('0x29')](_0xc4dad6);}return _0xff50d[_0x9d05('0x2a')]();};}function saveUpdates(_0x54c036,_0x13f981){return function(_0xa3a4){if(_0xa3a4){return _0xa3a4['update'](_0x54c036)['then'](function(_0x48f61b){return _0x48f61b;});}return null;};}function removeEntity(_0x2d3951,_0x271ded){return function(_0x57bcfa){if(_0x57bcfa){return _0x57bcfa[_0x9d05('0x2b')]()[_0x9d05('0x2c')](function(){_0x2d3951[_0x9d05('0x20')](0xcc)[_0x9d05('0x2d')]();});}};}function handleEntityNotFound(_0x149cd1,_0xac6807){return function(_0x3f1f7b){if(!_0x3f1f7b){_0x149cd1[_0x9d05('0x1f')](0x194);}return _0x3f1f7b;};}function handleError(_0x5cf4a7,_0x4f82c5){_0x4f82c5=_0x4f82c5||0x1f4;return function(_0x2f96f7){logger[_0x9d05('0x2e')](_0x2f96f7['stack']);if(_0x2f96f7[_0x9d05('0x2f')]){delete _0x2f96f7[_0x9d05('0x2f')];}_0x5cf4a7[_0x9d05('0x20')](_0x4f82c5)[_0x9d05('0x30')](_0x2f96f7);};}exports['index']=function(_0x4e82a0,_0x35e8bc){var _0xdb73ea={},_0xf248e2={},_0x329357={'count':0x0,'rows':[]};var _0x40f79c=_['map'](db[_0x9d05('0x31')][_0x9d05('0x32')],function(_0x340d73){return{'name':_0x340d73[_0x9d05('0x33')],'type':_0x340d73[_0x9d05('0x34')][_0x9d05('0x35')]};});_0xf248e2[_0x9d05('0x36')]=_[_0x9d05('0x37')](_0x40f79c,'name');_0xf248e2['query']=_['keys'](_0x4e82a0['query']);_0xf248e2[_0x9d05('0x38')]=_[_0x9d05('0x39')](_0xf248e2['model'],_0xf248e2[_0x9d05('0x3a')]);_0xdb73ea['attributes']=_[_0x9d05('0x39')](_0xf248e2[_0x9d05('0x36')],qs[_0x9d05('0x3b')](_0x4e82a0[_0x9d05('0x3a')][_0x9d05('0x3b')]));_0xdb73ea[_0x9d05('0x3c')]=_0xdb73ea['attributes'][_0x9d05('0x3d')]?_0xdb73ea['attributes']:_0xf248e2[_0x9d05('0x36')];if(!_0x4e82a0[_0x9d05('0x3a')][_0x9d05('0x3e')](_0x9d05('0x3f'))){_0xdb73ea[_0x9d05('0x23')]=qs[_0x9d05('0x23')](_0x4e82a0[_0x9d05('0x3a')][_0x9d05('0x23')]);_0xdb73ea[_0x9d05('0x22')]=qs[_0x9d05('0x22')](_0x4e82a0[_0x9d05('0x3a')][_0x9d05('0x22')]);}_0xdb73ea['order']=qs[_0x9d05('0x40')](_0x4e82a0[_0x9d05('0x3a')]['sort']);_0xdb73ea[_0x9d05('0x41')]=qs[_0x9d05('0x38')](_[_0x9d05('0x42')](_0x4e82a0[_0x9d05('0x3a')],_0xf248e2[_0x9d05('0x38')]),_0x40f79c);if(_0x4e82a0[_0x9d05('0x3a')]['filter']){_0xdb73ea['where']=_['merge'](_0xdb73ea[_0x9d05('0x41')],{'$or':_[_0x9d05('0x37')](_0x40f79c,function(_0x53877b){if(_0x53877b[_0x9d05('0x34')]!==_0x9d05('0x43')){var _0x50097b={};_0x50097b[_0x53877b['name']]={'$like':'%'+_0x4e82a0[_0x9d05('0x3a')][_0x9d05('0x44')]+'%'};return _0x50097b;}})});}_0xdb73ea=_[_0x9d05('0x45')]({},_0xdb73ea,_0x4e82a0[_0x9d05('0x46')]);var _0x2165d9={'where':_0xdb73ea[_0x9d05('0x41')]};return db[_0x9d05('0x31')][_0x9d05('0x25')](_0x2165d9)[_0x9d05('0x2c')](function(_0x4dde26){_0x329357[_0x9d05('0x25')]=_0x4dde26;if(_0x4e82a0['query'][_0x9d05('0x47')]){_0xdb73ea[_0x9d05('0x48')]=[{'all':!![]}];}return db[_0x9d05('0x31')][_0x9d05('0x49')](_0xdb73ea);})[_0x9d05('0x2c')](function(_0x34d32d){_0x329357[_0x9d05('0x4a')]=_0x34d32d;return _0x329357;})[_0x9d05('0x2c')](respondWithFilteredResult(_0x35e8bc,_0xdb73ea))['catch'](handleError(_0x35e8bc,null));};exports[_0x9d05('0x4b')]=function(_0x2f795d,_0x47cb58){var _0x1b56db={'raw':!![],'where':{'id':_0x2f795d[_0x9d05('0x4c')]['id']}},_0x386434={};_0x386434[_0x9d05('0x36')]=_[_0x9d05('0x4d')](db[_0x9d05('0x31')][_0x9d05('0x32')]);_0x386434[_0x9d05('0x3a')]=_['keys'](_0x2f795d[_0x9d05('0x3a')]);_0x386434[_0x9d05('0x38')]=_['intersection'](_0x386434[_0x9d05('0x36')],_0x386434[_0x9d05('0x3a')]);_0x1b56db[_0x9d05('0x3c')]=_[_0x9d05('0x39')](_0x386434['model'],qs[_0x9d05('0x3b')](_0x2f795d[_0x9d05('0x3a')][_0x9d05('0x3b')]));_0x1b56db['attributes']=_0x1b56db['attributes'][_0x9d05('0x3d')]?_0x1b56db['attributes']:_0x386434['model'];if(_0x2f795d['query'][_0x9d05('0x47')]){_0x1b56db[_0x9d05('0x48')]=[{'all':!![]}];}_0x1b56db=_[_0x9d05('0x45')]({},_0x1b56db,_0x2f795d[_0x9d05('0x46')]);return db[_0x9d05('0x31')]['find'](_0x1b56db)[_0x9d05('0x2c')](handleEntityNotFound(_0x47cb58,null))[_0x9d05('0x2c')](respondWithResult(_0x47cb58,null))[_0x9d05('0x4e')](handleError(_0x47cb58,null));};exports[_0x9d05('0x4f')]=function(_0x212aa8,_0x47ef9e){return db[_0x9d05('0x31')][_0x9d05('0x4f')](_0x212aa8[_0x9d05('0x50')],{})[_0x9d05('0x2c')](respondWithResult(_0x47ef9e,0xc9))[_0x9d05('0x4e')](handleError(_0x47ef9e,null));};exports[_0x9d05('0x51')]=function(_0x553556,_0x351b5f){if(_0x553556[_0x9d05('0x50')]['id']){delete _0x553556[_0x9d05('0x50')]['id'];}return db[_0x9d05('0x31')][_0x9d05('0x52')]({'where':{'id':_0x553556[_0x9d05('0x4c')]['id']}})[_0x9d05('0x2c')](handleEntityNotFound(_0x351b5f,null))['then'](saveUpdates(_0x553556['body'],null))[_0x9d05('0x2c')](respondWithResult(_0x351b5f,null))['catch'](handleError(_0x351b5f,null));};exports['destroy']=function(_0x547e73,_0x1bd8cc){return db['ChatInternalMessage'][_0x9d05('0x52')]({'where':{'id':_0x547e73[_0x9d05('0x4c')]['id']}})[_0x9d05('0x2c')](handleEntityNotFound(_0x1bd8cc,null))[_0x9d05('0x2c')](removeEntity(_0x1bd8cc,null))[_0x9d05('0x4e')](handleError(_0x1bd8cc,null));};exports[_0x9d05('0x53')]=function(_0x1ef358,_0x250a39){return db['ChatInternalMessage'][_0x9d05('0x53')]()['then'](respondWithResult(_0x250a39,null))[_0x9d05('0x4e')](handleError(_0x250a39,null));};function wrapUser(_0x52e6dd){return function(_0x37c44b){var _0x3775f3=_0x52e6dd['get']({'plain':!![]});_0x3775f3[_0x9d05('0x54')]=[];if(_0x37c44b){_0x3775f3[_0x9d05('0x55')]=_0x37c44b['createdAt'];_0x3775f3[_0x9d05('0x56')]=_0x37c44b;}else{_0x3775f3['lastMessageAt']=moment(0x0)[_0x9d05('0x57')](_0x9d05('0x58'));_0x3775f3[_0x9d05('0x56')]={};}return _0x3775f3;};}exports[_0x9d05('0x59')]=function(_0x49e7af,_0x4ad39d,_0x569597){var _0x4232b4=[];return db[_0x9d05('0x5a')]['findAll']({'where':{'role':[_0x9d05('0x5b'),'admin',_0x9d05('0x5c')]},'attributes':['id',_0x9d05('0x5d'),_0x9d05('0x2f'),_0x9d05('0x5e'),_0x9d05('0x5f'),_0x9d05('0x60'),_0x9d05('0x61'),_0x9d05('0x62'),'allowmessenger','showWebBar'],'order':qs[_0x9d05('0x40')](_0x9d05('0x63')),'include':[{'model':db[_0x9d05('0x64')],'as':_0x9d05('0x65'),'attributes':['id',_0x9d05('0x2f'),_0x9d05('0x34')],'through':{'attributes':[]}}]})[_0x9d05('0x2c')](function(_0x2a97fa){if(_0x2a97fa){var _0x5cda3a=_0x49e7af[_0x9d05('0x5c')][_0x9d05('0x66')]({'plain':!![]});if(!_0x5cda3a)throw new Error(_0x9d05('0x67'));if(_0x5cda3a['role']==='user'){return db['UserProfileSection']['find']({'where':{'name':_0x9d05('0x68'),'userProfileId':_0x5cda3a['userProfileId']},'raw':!![]})[_0x9d05('0x2c')](function(_0x1667de){if(_0x1667de){if(_0x1667de[_0x9d05('0x69')]===0x0){return db[_0x9d05('0x6a')][_0x9d05('0x49')]({'where':{'sectionId':_0x1667de['id']},'raw':!![]})[_0x9d05('0x2c')](function(_0x3aed0e){var _0x3a8c38=[];if(_[_0x9d05('0x6b')](_0x3aed0e)){_0x3a8c38=_[_0x9d05('0x44')](_0x2a97fa,function(_0x18d9fe){if(_0x18d9fe[_0x9d05('0x5e')]!==_0x9d05('0x5b')){return _0x18d9fe;}});return _0x3a8c38;}else{for(var _0x1932d2=0x0;_0x1932d2<_0x2a97fa[_0x9d05('0x3d')];_0x1932d2++){var _0x5a29d4=_0x2a97fa[_0x1932d2];if(_0x5a29d4[_0x9d05('0x5e')]===_0x9d05('0x5b')){var _0x351ee6=_[_0x9d05('0x52')](_0x3aed0e,function(_0x246248){return _0x246248[_0x9d05('0x6c')]===_0x5a29d4['id'];});if(_0x351ee6)_0x3a8c38['push'](_0x5a29d4);}else{_0x3a8c38['push'](_0x5a29d4);}}return _0x3a8c38;}});}else{return _0x2a97fa;}}else{var _0x24d2ba=_['filter'](_0x2a97fa,function(_0x54d50b){if(_0x54d50b['role']!==_0x9d05('0x5b')){return _0x54d50b;}});return _0x24d2ba;}});}else{return _0x2a97fa;}}})[_0x9d05('0x2c')](function(_0x5d3ab0){var _0x108bb1=[];if(_0x5d3ab0){_0x4232b4=_0x5d3ab0;for(var _0x228e89=0x0;_0x228e89<_0x5d3ab0['length'];_0x228e89+=0x1){_0x4232b4[_0x228e89][_0x9d05('0x54')]=[];_0x108bb1[_0x9d05('0x6d')](db['ChatInternalMessage'][_0x9d05('0x52')]({'where':{'FromId':[_0x49e7af[_0x9d05('0x5c')]['id'],_0x5d3ab0[_0x228e89]['id']],'ToId':[_0x49e7af[_0x9d05('0x5c')]['id'],_0x5d3ab0[_0x228e89]['id']],'ChatGroupId':null},'attributes':['id',_0x9d05('0x6e'),_0x9d05('0x6f'),'ToId','read',_0x9d05('0x50')],'order':qs[_0x9d05('0x40')](_0x9d05('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9d05('0x2c')](wrapUser(_0x5d3ab0[_0x228e89])));}return BPromise[_0x9d05('0x71')](_0x108bb1);}return[];})[_0x9d05('0x2c')](function(_0x4b9336){return{'rows':_0x4b9336,'count':_0x4b9336[_0x9d05('0x3d')]};})[_0x9d05('0x2c')](respondWithResult(_0x4ad39d,null))[_0x9d05('0x4e')](handleError(_0x4ad39d,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index e903105..ab744d1 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.events.js +++ b/server/api/chatInternalMessage/chatInternalMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x014b=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x014b,0x1a8));var _0xb014=function(_0x2f04a5,_0x29fb54){_0x2f04a5=_0x2f04a5-0x0;var _0x48016a=_0x014b[_0x2f04a5];return _0x48016a;};'use strict';var EventEmitter=require(_0xb014('0x0'));var ChatInternalMessage=require(_0xb014('0x1'))['db'][_0xb014('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb014('0x3')](0x0);var events={'afterCreate':_0xb014('0x4'),'afterUpdate':_0xb014('0x5'),'afterDestroy':_0xb014('0x6')};function emitEvent(_0x15dcd3){return function(_0xa9af8b,_0x2be87d,_0x2985bb){ChatInternalMessageEvents[_0xb014('0x7')](_0x15dcd3+':'+_0xa9af8b['id'],_0xa9af8b);ChatInternalMessageEvents['emit'](_0x15dcd3,_0xa9af8b);_0x2985bb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb014('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x7a52=['save','update','emit','hasOwnProperty','exports','events','ChatInternalMessage','setMaxListeners'];(function(_0x3e145e,_0x44bde7){var _0x263072=function(_0x63468a){while(--_0x63468a){_0x3e145e['push'](_0x3e145e['shift']());}};_0x263072(++_0x44bde7);}(_0x7a52,0x1bd));var _0x27a5=function(_0x7077b9,_0x348873){_0x7077b9=_0x7077b9-0x0;var _0x45fe02=_0x7a52[_0x7077b9];return _0x45fe02;};'use strict';var EventEmitter=require(_0x27a5('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x27a5('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x27a5('0x2')](0x0);var events={'afterCreate':_0x27a5('0x3'),'afterUpdate':_0x27a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa9f75c){return function(_0x2ef39c,_0x43dc0d,_0x7fff17){ChatInternalMessageEvents[_0x27a5('0x5')](_0xa9f75c+':'+_0x2ef39c['id'],_0x2ef39c);ChatInternalMessageEvents[_0x27a5('0x5')](_0xa9f75c,_0x2ef39c);_0x7fff17(null);};}for(var e in events){if(events[_0x27a5('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x27a5('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 96c15bf..7ba65e8 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.model.js +++ b/server/api/chatInternalMessage/chatInternalMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd981=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x267a50,_0x46cdcc){var _0x52f407=function(_0x250ae0){while(--_0x250ae0){_0x267a50['push'](_0x267a50['shift']());}};_0x52f407(++_0x46cdcc);}(_0xd981,0xfb));var _0x1d98=function(_0x385588,_0x42ea2b){_0x385588=_0x385588-0x0;var _0x9434d9=_0xd981[_0x385588];return _0x9434d9;};'use strict';var _=require(_0x1d98('0x0'));var util=require(_0x1d98('0x1'));var logger=require(_0x1d98('0x2'))(_0x1d98('0x3'));var moment=require(_0x1d98('0x4'));var BPromise=require(_0x1d98('0x5'));var rp=require(_0x1d98('0x6'));var fs=require('fs');var path=require(_0x1d98('0x7'));var rimraf=require(_0x1d98('0x8'));var config=require(_0x1d98('0x9'));var attributes=require(_0x1d98('0xa'));module[_0x1d98('0xb')]=function(_0x12bc44,_0x2ee549){return _0x12bc44['define']('ChatInternalMessage',attributes,{'tableName':_0x1d98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1d98('0xd'),'collate':_0x1d98('0xe')});}; \ No newline at end of file +var _0x4fd7=['define','ChatInternalMessage','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x5a3169,_0xf62d84){var _0x3524a3=function(_0x5d7128){while(--_0x5d7128){_0x5a3169['push'](_0x5a3169['shift']());}};_0x3524a3(++_0xf62d84);}(_0x4fd7,0x81));var _0x74fd=function(_0x3133d0,_0x1d524c){_0x3133d0=_0x3133d0-0x0;var _0x1ee127=_0x4fd7[_0x3133d0];return _0x1ee127;};'use strict';var _=require('lodash');var util=require(_0x74fd('0x0'));var logger=require(_0x74fd('0x1'))(_0x74fd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x74fd('0x3'));var fs=require('fs');var path=require(_0x74fd('0x4'));var rimraf=require(_0x74fd('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x36acc8,_0x2adac){return _0x36acc8[_0x74fd('0x6')](_0x74fd('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x74fd('0x8')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 2aaa844..2b34159 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js +++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5a1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xf5a1,0x129));var _0x1f5a=function(_0x57cd19,_0x5148f1){_0x57cd19=_0x57cd19-0x0;var _0x3836ac=_0xf5a1[_0x57cd19];return _0x3836ac;};'use strict';var _=require(_0x1f5a('0x0'));var util=require(_0x1f5a('0x1'));var moment=require(_0x1f5a('0x2'));var BPromise=require(_0x1f5a('0x3'));var rs=require(_0x1f5a('0x4'));var fs=require('fs');var Redis=require(_0x1f5a('0x5'));var db=require(_0x1f5a('0x6'))['db'];var utils=require(_0x1f5a('0x7'));var logger=require('../../config/logger')(_0x1f5a('0x8'));var config=require(_0x1f5a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1f5a('0xa')][_0x1f5a('0xb')]({'port':0x232a});config[_0x1f5a('0xc')]=_['defaults'](config[_0x1f5a('0xc')],{'host':_0x1f5a('0xd'),'port':0x18eb});var socket=require(_0x1f5a('0xe'))(new Redis(config[_0x1f5a('0xc')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x52d0dd,_0x10b3fe,_0x4babe9){return new BPromise(function(_0x34ee57,_0x44c941){return client[_0x1f5a('0xf')](_0x52d0dd,_0x4babe9)[_0x1f5a('0x10')](function(_0x29001e){logger['info'](_0x1f5a('0x11'),_0x10b3fe,_0x1f5a('0x12'));logger[_0x1f5a('0x13')](_0x1f5a('0x14'),_0x10b3fe,_0x1f5a('0x12'),JSON[_0x1f5a('0x15')](_0x29001e));if(_0x29001e['error']){if(_0x29001e[_0x1f5a('0x16')]['code']===0x1f4){logger['error'](_0x1f5a('0x11'),_0x10b3fe,_0x29001e[_0x1f5a('0x16')][_0x1f5a('0x17')]);return _0x44c941(_0x29001e[_0x1f5a('0x16')][_0x1f5a('0x17')]);}logger[_0x1f5a('0x16')](_0x1f5a('0x11'),_0x10b3fe,_0x29001e[_0x1f5a('0x16')][_0x1f5a('0x17')]);return _0x34ee57(_0x29001e[_0x1f5a('0x16')]['message']);}else{logger[_0x1f5a('0x18')](_0x1f5a('0x11'),_0x10b3fe,_0x1f5a('0x12'));_0x34ee57(_0x29001e[_0x1f5a('0x19')]['message']);}})[_0x1f5a('0x1a')](function(_0x253e2a){logger[_0x1f5a('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x10b3fe,_0x253e2a);_0x44c941(_0x253e2a);});});} \ No newline at end of file +var _0xf3cd=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x40bdcd,_0x56c95e){var _0x3780cf=function(_0x442918){while(--_0x442918){_0x40bdcd['push'](_0x40bdcd['shift']());}};_0x3780cf(++_0x56c95e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0xf3cd[_0xb0fe92];return _0x41787f;};'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});config[_0xdf3c('0xc')]=_[_0xdf3c('0xd')](config[_0xdf3c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf3c('0xe'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xdf3c('0xf')](socket);function respondWithRpcPromise(_0x981616,_0x5ef936,_0x1dba4c){return new BPromise(function(_0x205f33,_0x2d420c){return client[_0xdf3c('0x10')](_0x981616,_0x1dba4c)[_0xdf3c('0x11')](function(_0x1c456b){logger[_0xdf3c('0x12')](_0xdf3c('0x13'),_0x5ef936,'request\x20sent');logger[_0xdf3c('0x14')](_0xdf3c('0x15'),_0x5ef936,_0xdf3c('0x16'),JSON[_0xdf3c('0x17')](_0x1c456b));if(_0x1c456b['error']){if(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x19')]===0x1f4){logger[_0xdf3c('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x5ef936,_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);return _0x2d420c(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);}logger[_0xdf3c('0x18')](_0xdf3c('0x13'),_0x5ef936,_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);return _0x205f33(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);}else{logger['info'](_0xdf3c('0x13'),_0x5ef936,_0xdf3c('0x16'));_0x205f33(_0x1c456b[_0xdf3c('0x1b')][_0xdf3c('0x1a')]);}})[_0xdf3c('0x1c')](function(_0x113b56){logger[_0xdf3c('0x18')](_0xdf3c('0x13'),_0x5ef936,_0x113b56);_0x2d420c(_0x113b56);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 78ebc7c..77794a7 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.socket.js +++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1811=['removeListener','length','chatInternalMessage:','update','emit'];(function(_0x504b92,_0x4787c9){var _0x1f4056=function(_0x3cfb66){while(--_0x3cfb66){_0x504b92['push'](_0x504b92['shift']());}};_0x1f4056(++_0x4787c9);}(_0x1811,0x107));var _0x1181=function(_0x39da12,_0x2365e3){_0x39da12=_0x39da12-0x0;var _0x3c68a3=_0x1811[_0x39da12];return _0x3c68a3;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove',_0x1181('0x0')];function createListener(_0x25fe43,_0x5a17d0){return function(_0x19d35e){_0x5a17d0[_0x1181('0x1')](_0x25fe43,_0x19d35e);};}function removeListener(_0x142374,_0x1bbc83){return function(){ChatInternalMessageEvents[_0x1181('0x2')](_0x142374,_0x1bbc83);};}exports['register']=function(_0x24f3ff){for(var _0x5d17bf=0x0,_0x346716=events[_0x1181('0x3')];_0x5d17bf<_0x346716;_0x5d17bf++){var _0x3c1a12=events[_0x5d17bf];var _0xa1828e=createListener(_0x1181('0x4')+_0x3c1a12,_0x24f3ff);ChatInternalMessageEvents['on'](_0x3c1a12,_0xa1828e);}}; \ No newline at end of file +var _0x4a7a=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x362288,_0xb4a728){var _0x96611d=function(_0x23d4bb){while(--_0x23d4bb){_0x362288['push'](_0x362288['shift']());}};_0x96611d(++_0xb4a728);}(_0x4a7a,0xf5));var _0xa4a7=function(_0xe82d5f,_0x30fa26){_0xe82d5f=_0xe82d5f-0x0;var _0x2080dc=_0x4a7a[_0xe82d5f];return _0x2080dc;};'use strict';var ChatInternalMessageEvents=require(_0xa4a7('0x0'));var events=[_0xa4a7('0x1'),_0xa4a7('0x2'),_0xa4a7('0x3')];function createListener(_0x3b2f1d,_0x23fd28){return function(_0xa7d815){_0x23fd28[_0xa4a7('0x4')](_0x3b2f1d,_0xa7d815);};}function removeListener(_0x1cf1fc,_0x373a9d){return function(){ChatInternalMessageEvents[_0xa4a7('0x5')](_0x1cf1fc,_0x373a9d);};}exports[_0xa4a7('0x6')]=function(_0x419296){for(var _0x9b4ddc=0x0,_0x19e684=events['length'];_0x9b4ddc<_0x19e684;_0x9b4ddc++){var _0x36608b=events[_0x9b4ddc];var _0x281364=createListener(_0xa4a7('0x7')+_0x36608b,_0x419296);ChatInternalMessageEvents['on'](_0x36608b,_0x281364);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 8a0050e..f0f8b07 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8729=['getUsers','/:id','show','post','create','put','update','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x8729,0x181));var _0x9872=function(_0x4f8e6f,_0x73700c){_0x4f8e6f=_0x4f8e6f-0x0;var _0x2b9c68=_0x8729[_0x4f8e6f];return _0x2b9c68;};'use strict';var multer=require(_0x9872('0x0'));var util=require(_0x9872('0x1'));var path=require('path');var timeout=require(_0x9872('0x2'));var express=require('express');var router=express[_0x9872('0x3')]();var fs_extra=require(_0x9872('0x4'));var auth=require(_0x9872('0x5'));var interaction=require(_0x9872('0x6'));var config=require(_0x9872('0x7'));var controller=require(_0x9872('0x8'));router['get']('/',auth[_0x9872('0x9')](),controller[_0x9872('0xa')]);router[_0x9872('0xb')](_0x9872('0xc'),auth[_0x9872('0x9')](),controller[_0x9872('0xd')]);router['get']('/users',auth['isAuthenticated'](),controller[_0x9872('0xe')]);router['get'](_0x9872('0xf'),auth[_0x9872('0x9')](),controller[_0x9872('0x10')]);router[_0x9872('0x11')]('/',auth[_0x9872('0x9')](),controller[_0x9872('0x12')]);router[_0x9872('0x13')](_0x9872('0xf'),controller[_0x9872('0x14')]);router['delete'](_0x9872('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc3e5=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','index','get','/describe','isAuthenticated','describe','/users','post','create','put','update','destroy'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0xc3e5,0x19e));var _0x5c3e=function(_0x48fef8,_0x3bb29a){_0x48fef8=_0x48fef8-0x0;var _0x384dfe=_0xc3e5[_0x48fef8];return _0x384dfe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c3e('0x0'));var timeout=require(_0x5c3e('0x1'));var express=require(_0x5c3e('0x2'));var router=express[_0x5c3e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5c3e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5c3e('0x5'));var controller=require(_0x5c3e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5c3e('0x7')]);router[_0x5c3e('0x8')](_0x5c3e('0x9'),auth[_0x5c3e('0xa')](),controller[_0x5c3e('0xb')]);router[_0x5c3e('0x8')](_0x5c3e('0xc'),auth[_0x5c3e('0xa')](),controller['getUsers']);router[_0x5c3e('0x8')]('/:id',auth[_0x5c3e('0xa')](),controller['show']);router[_0x5c3e('0xd')]('/',auth[_0x5c3e('0xa')](),controller[_0x5c3e('0xe')]);router[_0x5c3e('0xf')]('/:id',controller[_0x5c3e('0x10')]);router['delete']('/:id',auth[_0x5c3e('0xa')](),controller[_0x5c3e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 91f03fd..e7025e8 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd523=['medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x1e9654,_0x25a59f){var _0x410b32=function(_0x2848b9){while(--_0x2848b9){_0x1e9654['push'](_0x1e9654['shift']());}};_0x410b32(++_0x25a59f);}(_0xd523,0x153));var _0x3d52=function(_0x501690,_0xbdff3a){_0x501690=_0x501690-0x0;var _0x2f830e=_0xd523[_0x501690];return _0x2f830e;};'use strict';var Sequelize=require(_0x3d52('0x0'));module[_0x3d52('0x1')]={'body':{'type':Sequelize[_0x3d52('0x2')](_0x3d52('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3d52('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3d52('0x5')]('in',_0x3d52('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3d52('0x7')]},'providerName':{'type':Sequelize[_0x3d52('0x8')]},'providerResponse':{'type':Sequelize[_0x3d52('0x2')]}}; \ No newline at end of file +var _0xbbdd=['out','TEXT','exports','medium','BOOLEAN'];(function(_0x25595e,_0x4a303e){var _0x11e262=function(_0x507a17){while(--_0x507a17){_0x25595e['push'](_0x25595e['shift']());}};_0x11e262(++_0x4a303e);}(_0xbbdd,0x1ba));var _0xdbbd=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xbbdd[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0xdbbd('0x0')]={'body':{'type':Sequelize['TEXT'](_0xdbbd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xdbbd('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xdbbd('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdbbd('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 2125d6f..651b929 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1048=['status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','describe','../../config/logger','read','readAt','format','UserId','user','ChatInteraction','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','User','agent','email','internal','manual','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','merge','parse','chat-interactions','chat','params','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','QueryTypes','SELECT','fullname','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus'];(function(_0x191dff,_0xb60d16){var _0x410a43=function(_0x25ccdc){while(--_0x25ccdc){_0x191dff['push'](_0x191dff['shift']());}};_0x410a43(++_0xb60d16);}(_0x1048,0xec));var _0x8104=function(_0x4e8373,_0x4aac44){_0x4e8373=_0x4e8373-0x0;var _0x4e9496=_0x1048[_0x4e8373];return _0x4e9496;};'use strict';var emlformat=require(_0x8104('0x0'));var rimraf=require(_0x8104('0x1'));var zipdir=require(_0x8104('0x2'));var jsonpatch=require(_0x8104('0x3'));var rp=require(_0x8104('0x4'));var moment=require(_0x8104('0x5'));var BPromise=require(_0x8104('0x6'));var Mustache=require(_0x8104('0x7'));var util=require(_0x8104('0x8'));var path=require(_0x8104('0x9'));var sox=require(_0x8104('0xa'));var csv=require(_0x8104('0xb'));var ejs=require(_0x8104('0xc'));var fs=require('fs');var fs_extra=require(_0x8104('0xd'));var _=require(_0x8104('0xe'));var squel=require(_0x8104('0xf'));var crypto=require(_0x8104('0x10'));var jsforce=require(_0x8104('0x11'));var deskjs=require(_0x8104('0x12'));var toCsv=require(_0x8104('0xb'));var querystring=require(_0x8104('0x13'));var Papa=require(_0x8104('0x14'));var Redis=require(_0x8104('0x15'));var authService=require(_0x8104('0x16'));var qs=require(_0x8104('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8104('0x18'));var logger=require('../../config/logger')(_0x8104('0x19'));var utils=require(_0x8104('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x8104('0x1b'));var db=require(_0x8104('0x1c'))['db'];config[_0x8104('0x1d')]=_[_0x8104('0x1e')](config[_0x8104('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x8104('0x1f'))(new Redis(config[_0x8104('0x1d')]));require(_0x8104('0x20'))[_0x8104('0x21')](socket);var jayson=require(_0x8104('0x22'));var client=jayson[_0x8104('0x23')]['http']({'port':0x232c});var client9002=jayson['client'][_0x8104('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x1ff33b,_0x2a88f9,_0x2d69c3,_0x450121){return new BPromise(function(_0x794a2e,_0x4e69f5){var _0x294cb5=_0x450121||client;return _0x294cb5[_0x8104('0x25')](_0x1ff33b,_0x2d69c3)['then'](function(_0x2672d3){logger[_0x8104('0x26')](_0x8104('0x27'),_0x2a88f9,_0x8104('0x28'));logger[_0x8104('0x29')](_0x8104('0x2a'),_0x2a88f9,_0x8104('0x28'),JSON[_0x8104('0x2b')](_0x2672d3));if(_0x2672d3[_0x8104('0x2c')]){if(_0x2672d3[_0x8104('0x2c')][_0x8104('0x2d')]===0x1f4){logger[_0x8104('0x2c')]('ChatMessage,\x20%s,\x20%s',_0x2a88f9,_0x2672d3[_0x8104('0x2c')]['message']);return _0x4e69f5(_0x2672d3[_0x8104('0x2c')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x2a88f9,_0x2672d3[_0x8104('0x2c')][_0x8104('0x2e')]);return _0x794a2e(_0x2672d3['error'][_0x8104('0x2e')]);}else{logger['info'](_0x8104('0x27'),_0x2a88f9,_0x8104('0x28'));_0x794a2e(_0x2672d3[_0x8104('0x2f')][_0x8104('0x2e')]);}})[_0x8104('0x30')](function(_0x3f9dfd){logger[_0x8104('0x2c')](_0x8104('0x27'),_0x2a88f9,_0x3f9dfd);_0x4e69f5(_0x3f9dfd);});});}function respondWithStatusCode(_0x2754f9,_0x26cb4b){_0x26cb4b=_0x26cb4b||0xcc;return function(_0x31e5fd){if(_0x31e5fd){return _0x2754f9[_0x8104('0x31')](_0x26cb4b);}return _0x2754f9[_0x8104('0x32')](_0x26cb4b)[_0x8104('0x33')]();};}function respondWithResult(_0x4ec7d9,_0x227d31){_0x227d31=_0x227d31||0xc8;return function(_0x2dc84a){if(_0x2dc84a){return _0x4ec7d9['status'](_0x227d31)[_0x8104('0x34')](_0x2dc84a);}};}function respondWithFilteredResult(_0x5cb77c,_0x539608){return function(_0x160de6){if(_0x160de6){var _0x2ff2fb=typeof _0x539608[_0x8104('0x35')]===_0x8104('0x36')&&typeof _0x539608[_0x8104('0x37')]==='undefined';var _0x68f93c=_0x160de6[_0x8104('0x38')];var _0x4abc6f=_0x2ff2fb?0x0:_0x539608['offset'];var _0x1cac62=_0x2ff2fb?_0x160de6[_0x8104('0x38')]:_0x539608[_0x8104('0x35')]+_0x539608['limit'];var _0x51920a;if(_0x1cac62>=_0x68f93c){_0x1cac62=_0x68f93c;_0x51920a=0xc8;}else{_0x51920a=0xce;}_0x5cb77c[_0x8104('0x32')](_0x51920a);return _0x5cb77c['set'](_0x8104('0x39'),_0x4abc6f+'-'+_0x1cac62+'/'+_0x68f93c)[_0x8104('0x34')](_0x160de6);}return null;};}function patchUpdates(_0x58c418){return function(_0x16ba3f){try{jsonpatch[_0x8104('0x3a')](_0x16ba3f,_0x58c418,!![]);}catch(_0x10cd24){return BPromise[_0x8104('0x3b')](_0x10cd24);}return _0x16ba3f[_0x8104('0x3c')]();};}function saveUpdates(_0x113120,_0x1ac936){return function(_0x47d4b3){if(_0x47d4b3){return _0x47d4b3[_0x8104('0x3d')](_0x113120)[_0x8104('0x3e')](function(_0x12845d){return _0x12845d;});}return null;};}function removeEntity(_0x277db7,_0x2d761e){return function(_0x1c8e9a){if(_0x1c8e9a){return _0x1c8e9a[_0x8104('0x3f')]()[_0x8104('0x3e')](function(){_0x277db7[_0x8104('0x32')](0xcc)[_0x8104('0x33')]();});}};}function handleEntityNotFound(_0x255820,_0x3b1ba3){return function(_0x4524b9){if(!_0x4524b9){_0x255820[_0x8104('0x31')](0x194);}return _0x4524b9;};}function handleError(_0x3b606b,_0x9551b5){_0x9551b5=_0x9551b5||0x1f4;return function(_0x2e5eea){logger[_0x8104('0x2c')](_0x2e5eea[_0x8104('0x40')]);if(_0x2e5eea[_0x8104('0x41')]){delete _0x2e5eea[_0x8104('0x41')];}_0x3b606b[_0x8104('0x32')](_0x9551b5)[_0x8104('0x42')](_0x2e5eea);};}exports[_0x8104('0x43')]=function(_0x2ffa79,_0x2cebbc){var _0x367404={},_0x4d8744={},_0xc20d0b={'count':0x0,'rows':[]};var _0x3d0d55=_['map'](db[_0x8104('0x44')][_0x8104('0x45')],function(_0x23ae1d){return{'name':_0x23ae1d[_0x8104('0x46')],'type':_0x23ae1d[_0x8104('0x47')]['key']};});_0x4d8744[_0x8104('0x48')]=_[_0x8104('0x49')](_0x3d0d55,'name');_0x4d8744[_0x8104('0x4a')]=_[_0x8104('0x4b')](_0x2ffa79['query']);_0x4d8744['filters']=_[_0x8104('0x4c')](_0x4d8744['model'],_0x4d8744[_0x8104('0x4a')]);_0x367404[_0x8104('0x4d')]=_[_0x8104('0x4c')](_0x4d8744[_0x8104('0x48')],qs['fields'](_0x2ffa79[_0x8104('0x4a')][_0x8104('0x4e')]));_0x367404[_0x8104('0x4d')]=_0x367404[_0x8104('0x4d')][_0x8104('0x4f')]?_0x367404[_0x8104('0x4d')]:_0x4d8744[_0x8104('0x48')];if(!_0x2ffa79['query'][_0x8104('0x50')](_0x8104('0x51'))){_0x367404[_0x8104('0x37')]=qs[_0x8104('0x37')](_0x2ffa79[_0x8104('0x4a')]['limit']);_0x367404[_0x8104('0x35')]=qs['offset'](_0x2ffa79[_0x8104('0x4a')][_0x8104('0x35')]);}_0x367404[_0x8104('0x52')]=qs[_0x8104('0x53')](_0x2ffa79[_0x8104('0x4a')]['sort']);_0x367404[_0x8104('0x54')]=qs[_0x8104('0x55')](_[_0x8104('0x56')](_0x2ffa79[_0x8104('0x4a')],_0x4d8744[_0x8104('0x55')]),_0x3d0d55);if(_0x2ffa79[_0x8104('0x4a')][_0x8104('0x57')]){_0x367404[_0x8104('0x54')]=_['merge'](_0x367404['where'],{'$or':_[_0x8104('0x49')](_0x3d0d55,function(_0x35dc6a){if(_0x35dc6a[_0x8104('0x47')]!==_0x8104('0x58')){var _0x3d7955={};_0x3d7955[_0x35dc6a[_0x8104('0x41')]]={'$like':'%'+_0x2ffa79['query']['filter']+'%'};return _0x3d7955;}})});}_0x367404=_['merge']({},_0x367404,_0x2ffa79[_0x8104('0x59')]);var _0x228a9d={'where':_0x367404[_0x8104('0x54')]};return db[_0x8104('0x44')][_0x8104('0x38')](_0x228a9d)[_0x8104('0x3e')](function(_0x468c6a){_0xc20d0b[_0x8104('0x38')]=_0x468c6a;if(_0x2ffa79[_0x8104('0x4a')][_0x8104('0x5a')]){_0x367404[_0x8104('0x5b')]=[{'all':!![]}];}return db['ChatMessage'][_0x8104('0x5c')](_0x367404);})['then'](function(_0x53a712){_0xc20d0b[_0x8104('0x5d')]=_0x53a712;return _0xc20d0b;})[_0x8104('0x3e')](respondWithFilteredResult(_0x2cebbc,_0x367404))[_0x8104('0x30')](handleError(_0x2cebbc,null));};exports['show']=function(_0xeba1c5,_0x566ca1){var _0x38e7c6={'raw':!![],'where':{'id':_0xeba1c5['params']['id']}},_0x20cf21={};_0x20cf21[_0x8104('0x48')]=_['keys'](db[_0x8104('0x44')][_0x8104('0x45')]);_0x20cf21[_0x8104('0x4a')]=_[_0x8104('0x4b')](_0xeba1c5[_0x8104('0x4a')]);_0x20cf21[_0x8104('0x55')]=_['intersection'](_0x20cf21[_0x8104('0x48')],_0x20cf21['query']);_0x38e7c6[_0x8104('0x4d')]=_[_0x8104('0x4c')](_0x20cf21['model'],qs['fields'](_0xeba1c5[_0x8104('0x4a')]['fields']));_0x38e7c6['attributes']=_0x38e7c6[_0x8104('0x4d')][_0x8104('0x4f')]?_0x38e7c6[_0x8104('0x4d')]:_0x20cf21[_0x8104('0x48')];if(_0xeba1c5['query']['includeAll']){_0x38e7c6[_0x8104('0x5b')]=[{'all':!![]}];}_0x38e7c6=_['merge']({},_0x38e7c6,_0xeba1c5[_0x8104('0x59')]);return db[_0x8104('0x44')][_0x8104('0x5e')](_0x38e7c6)[_0x8104('0x3e')](handleEntityNotFound(_0x566ca1,null))[_0x8104('0x3e')](respondWithResult(_0x566ca1,null))['catch'](handleError(_0x566ca1,null));};exports[_0x8104('0x5f')]=function(_0x1fcc58,_0x2fa00d){return db[_0x8104('0x44')][_0x8104('0x5f')](_0x1fcc58[_0x8104('0x60')],{})[_0x8104('0x3e')](respondWithResult(_0x2fa00d,0xc9))[_0x8104('0x30')](handleError(_0x2fa00d,null));};exports[_0x8104('0x3d')]=function(_0x23935b,_0x277f9d){if(_0x23935b[_0x8104('0x60')]['id']){delete _0x23935b[_0x8104('0x60')]['id'];}return db[_0x8104('0x44')][_0x8104('0x5e')]({'where':{'id':_0x23935b['params']['id']}})[_0x8104('0x3e')](handleEntityNotFound(_0x277f9d,null))['then'](saveUpdates(_0x23935b[_0x8104('0x60')],null))['then'](respondWithResult(_0x277f9d,null))[_0x8104('0x30')](handleError(_0x277f9d,null));};exports['destroy']=function(_0x11a2c1,_0x29731d){return db[_0x8104('0x44')][_0x8104('0x5e')]({'where':{'id':_0x11a2c1['params']['id']}})[_0x8104('0x3e')](handleEntityNotFound(_0x29731d,null))[_0x8104('0x3e')](removeEntity(_0x29731d,null))[_0x8104('0x30')](handleError(_0x29731d,null));};exports[_0x8104('0x61')]=function(_0x4e5d04,_0x393490){return db[_0x8104('0x44')][_0x8104('0x61')]()[_0x8104('0x3e')](respondWithResult(_0x393490,null))[_0x8104('0x30')](handleError(_0x393490,null));};var interaction_log=require(_0x8104('0x62'))('chat-interactions');exports['accept']=function(_0x1c4168,_0x14078a,_0x1a6bb1){var _0x57672c={'agent':{},'channel':'chat'};if(_0x1c4168['body']['id']){delete _0x1c4168['body']['id'];}_0x1c4168[_0x8104('0x60')][_0x8104('0x63')]=!![];_0x1c4168[_0x8104('0x60')][_0x8104('0x64')]=moment()[_0x8104('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c4168[_0x8104('0x60')]['UserId']=_0x1c4168['body'][_0x8104('0x66')]||_0x1c4168[_0x8104('0x67')]['id'];_0x57672c['agent']['id']=_0x1c4168['body']['UserId'];return db[_0x8104('0x44')][_0x8104('0x5e')]({'where':{'id':_0x1c4168['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x14078a,null))[_0x8104('0x3e')](saveUpdates(_0x1c4168[_0x8104('0x60')],null))['then'](function(_0x2ebfef){if(_0x2ebfef){_0x57672c['message']=_0x2ebfef['get']({'plain':!![]});return db[_0x8104('0x68')][_0x8104('0x5e')]({'where':{'id':_0x2ebfef[_0x8104('0x69')]}});}return null;})[_0x8104('0x3e')](handleEntityNotFound(_0x14078a,null))[_0x8104('0x3e')](function(_0x3b285d){if(_0x3b285d){return _0x3b285d[_0x8104('0x3d')]({'UserId':_0x1c4168[_0x8104('0x60')][_0x8104('0x66')],'read1stAt':_[_0x8104('0x6a')](_0x3b285d['read1stAt'])?moment()[_0x8104('0x65')](_0x8104('0x6b')):undefined});}return null;})[_0x8104('0x3e')](function(_0xce1304){if(_0xce1304){_0x57672c['interaction']=_0xce1304[_0x8104('0x6c')]({'plain':!![]});interaction_log[_0x8104('0x26')](_0x8104('0x6d'),_0x1c4168[_0x8104('0x67')]['id'],_0x1c4168[_0x8104('0x67')]['name'],_0x1c4168[_0x8104('0x67')][_0x8104('0x6e')],_0x57672c[_0x8104('0x6f')]['id'],_0x1c4168[_0x8104('0x60')]?JSON[_0x8104('0x2b')](_0x1c4168[_0x8104('0x60')]):_0x8104('0x70'));return respondWithRpcPromise(_0x8104('0x71'),'acceptMessage',_0x57672c);}return null;})['then'](function(_0x4537cf){var _0x294b0a=_0x8104('0x72')+_0x4537cf[_0x8104('0x2e')][_0x8104('0x73')];return db['sequelize'][_0x8104('0x4a')](_0x294b0a,{'type':db[_0x8104('0x74')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x15ec0f){return _0x15ec0f;});})[_0x8104('0x3e')](function(_0x3499cc){if(_0x3499cc){_0x57672c[_0x8104('0x2e')][_0x8104('0x75')]=_0x3499cc[0x0];if(!_0x1c4168[_0x8104('0x60')][_0x8104('0x66')])return;return db[_0x8104('0x76')][_0x8104('0x5e')]({'where':{'id':_0x1c4168[_0x8104('0x60')][_0x8104('0x66')],'role':_0x8104('0x77')},'attributes':['id',_0x8104('0x41'),'fullname',_0x8104('0x78'),_0x8104('0x79')],'raw':!![]});}return null;})[_0x8104('0x3e')](function(_0x33b78e){if(!_0x33b78e)return null;_0x57672c[_0x8104('0x2e')]['agent']=_0x33b78e;return _0x57672c;})[_0x8104('0x3e')](function(_0x32f8e6){if(_0x32f8e6){if(_0x1c4168['body'][_0x8104('0x7a')]){_0x57672c[_0x8104('0x2e')]['interface']=util[_0x8104('0x65')](_0x8104('0x7b'),_0x1c4168[_0x8104('0x67')]['name']);_0x57672c[_0x8104('0x2e')]['channel']=_0x57672c['channel'];_0x57672c['message'][_0x8104('0x7c')]=_0x57672c[_0x8104('0x7d')];_0x57672c[_0x8104('0x2e')][_0x8104('0x7e')]='accept';return respondWithRpcPromise(_0x8104('0x7f'),_0x8104('0x7f'),{'event':_0x8104('0x80'),'message':_[_0x8104('0x81')](_0x57672c[_0x8104('0x2e')],JSON[_0x8104('0x82')](_0x57672c[_0x8104('0x6f')]['formData']))},client9002)[_0x8104('0x3e')](function(){return _0x57672c;});}return _0x57672c;}return null;})['then'](respondWithResult(_0x14078a,null))[_0x8104('0x30')](handleError(_0x14078a,null));};var interaction_log=require('../../config/logger')(_0x8104('0x83'));exports['reject']=function(_0x2922bb,_0x11f0be,_0x411cc0){var _0x25ae8d={'agent':{},'channel':_0x8104('0x84')};if(_0x2922bb[_0x8104('0x60')]['id']){delete _0x2922bb[_0x8104('0x60')]['id'];}_0x2922bb[_0x8104('0x60')]['UserId']=_0x2922bb[_0x8104('0x60')][_0x8104('0x66')]||_0x2922bb['user']['id'];_0x25ae8d['agent']['id']=_0x2922bb['body'][_0x8104('0x66')];return db[_0x8104('0x44')]['find']({'where':{'id':_0x2922bb[_0x8104('0x85')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x11f0be,null))['then'](function(_0x5bb8cc){if(_0x5bb8cc){_0x25ae8d[_0x8104('0x2e')]=_0x5bb8cc['get']({'plain':!![]});return db[_0x8104('0x68')][_0x8104('0x5e')]({'where':{'id':_0x5bb8cc['ChatInteractionId']}});}return null;})[_0x8104('0x3e')](handleEntityNotFound(_0x11f0be,null))['then'](function(_0x13e120){if(_0x13e120){_0x25ae8d['interaction']=_0x13e120['get']({'plain':!![]});interaction_log[_0x8104('0x26')](_0x8104('0x86'),_0x2922bb[_0x8104('0x67')]['id'],_0x2922bb['user']['name'],_0x2922bb[_0x8104('0x67')]['role'],_0x25ae8d[_0x8104('0x6f')]['id'],_0x2922bb['body']?JSON[_0x8104('0x2b')](_0x2922bb[_0x8104('0x60')]):_0x8104('0x70'));return respondWithRpcPromise(_0x8104('0x87'),_0x8104('0x88'),_0x25ae8d);}return null;})['then'](function(_0x6553b7){var _0x3fbefc=_0x8104('0x72')+_0x6553b7[_0x8104('0x2e')][_0x8104('0x73')];return db[_0x8104('0x89')][_0x8104('0x4a')](_0x3fbefc,{'type':db[_0x8104('0x74')][_0x8104('0x8a')][_0x8104('0x8b')],'raw':!![]})['then'](function(_0x5c7041){return _0x5c7041;});})[_0x8104('0x3e')](function(_0xbf5a7a){if(_0xbf5a7a){_0x25ae8d[_0x8104('0x2e')][_0x8104('0x75')]=_0xbf5a7a[0x0];if(!_0x2922bb[_0x8104('0x60')]['UserId'])return;return db['User'][_0x8104('0x5e')]({'where':{'id':_0x2922bb[_0x8104('0x60')][_0x8104('0x66')],'role':'agent'},'attributes':['id',_0x8104('0x41'),_0x8104('0x8c'),_0x8104('0x78'),_0x8104('0x79')],'raw':!![]});}return null;})[_0x8104('0x3e')](function(_0x3778d6){if(!_0x3778d6)return null;_0x25ae8d[_0x8104('0x2e')]['agent']=_0x3778d6;return _0x25ae8d;})[_0x8104('0x3e')](function(_0x5545b8){if(_0x5545b8){_0x5545b8[_0x8104('0x2e')]['interface']=util[_0x8104('0x65')](_0x8104('0x7b'),_0x2922bb[_0x8104('0x67')][_0x8104('0x41')]);_0x5545b8['message'][_0x8104('0x7d')]=_0x25ae8d['channel'];_0x5545b8[_0x8104('0x2e')][_0x8104('0x7c')]=_0x25ae8d[_0x8104('0x7d')];_0x5545b8[_0x8104('0x2e')]['event']=_0x8104('0x3b');respondWithRpcPromise(_0x8104('0x7f'),_0x8104('0x7f'),{'event':_0x8104('0x8d'),'message':_[_0x8104('0x81')](_0x25ae8d[_0x8104('0x2e')],JSON[_0x8104('0x82')](_0x25ae8d[_0x8104('0x6f')][_0x8104('0x8e')]))},client9002);return _0x25ae8d;}return null;})['then'](respondWithResult(_0x11f0be,null))[_0x8104('0x30')](handleError(_0x11f0be,null));}; \ No newline at end of file +var _0xd6a2=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','sendStatus','status','limit','undefined','offset','set','json','reject','save','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatMessage','count','includeAll','findAll','show','include','find','catch','create','body','update','params','describe','chat-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','isNil','read1stAt','format','interaction','user','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xd6a2,0x176));var _0x2d6a=function(_0x5c942a,_0x2d3ae8){_0x5c942a=_0x5c942a-0x0;var _0x28080b=_0xd6a2[_0x5c942a];return _0x28080b;};'use strict';var emlformat=require(_0x2d6a('0x0'));var rimraf=require(_0x2d6a('0x1'));var zipdir=require(_0x2d6a('0x2'));var jsonpatch=require(_0x2d6a('0x3'));var rp=require(_0x2d6a('0x4'));var moment=require('moment');var BPromise=require(_0x2d6a('0x5'));var Mustache=require(_0x2d6a('0x6'));var util=require('util');var path=require(_0x2d6a('0x7'));var sox=require('sox');var csv=require(_0x2d6a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d6a('0x9'));var _=require(_0x2d6a('0xa'));var squel=require(_0x2d6a('0xb'));var crypto=require(_0x2d6a('0xc'));var jsforce=require(_0x2d6a('0xd'));var deskjs=require(_0x2d6a('0xe'));var toCsv=require(_0x2d6a('0x8'));var querystring=require(_0x2d6a('0xf'));var Papa=require(_0x2d6a('0x10'));var Redis=require(_0x2d6a('0x11'));var authService=require(_0x2d6a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2d6a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d6a('0x14'))(_0x2d6a('0x15'));var utils=require(_0x2d6a('0x16'));var config=require(_0x2d6a('0x17'));var licenseUtil=require(_0x2d6a('0x18'));var db=require(_0x2d6a('0x19'))['db'];config[_0x2d6a('0x1a')]=_[_0x2d6a('0x1b')](config[_0x2d6a('0x1a')],{'host':_0x2d6a('0x1c'),'port':0x18eb});var socket=require(_0x2d6a('0x1d'))(new Redis(config[_0x2d6a('0x1a')]));require(_0x2d6a('0x1e'))[_0x2d6a('0x1f')](socket);var jayson=require(_0x2d6a('0x20'));var client=jayson['client'][_0x2d6a('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x2d6a('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x56afcc,_0x2f71a3,_0x4a8cbc,_0x39c511){return new BPromise(function(_0x13a470,_0x372fa5){var _0x5a7eea=_0x39c511||client;return _0x5a7eea[_0x2d6a('0x22')](_0x56afcc,_0x4a8cbc)[_0x2d6a('0x23')](function(_0xbb11ce){logger[_0x2d6a('0x24')]('ChatMessage,\x20%s,\x20%s',_0x2f71a3,_0x2d6a('0x25'));logger[_0x2d6a('0x26')](_0x2d6a('0x27'),_0x2f71a3,_0x2d6a('0x25'),JSON[_0x2d6a('0x28')](_0xbb11ce));if(_0xbb11ce[_0x2d6a('0x29')]){if(_0xbb11ce[_0x2d6a('0x29')][_0x2d6a('0x2a')]===0x1f4){logger[_0x2d6a('0x29')](_0x2d6a('0x2b'),_0x2f71a3,_0xbb11ce[_0x2d6a('0x29')][_0x2d6a('0x2c')]);return _0x372fa5(_0xbb11ce[_0x2d6a('0x29')][_0x2d6a('0x2c')]);}logger['error'](_0x2d6a('0x2b'),_0x2f71a3,_0xbb11ce[_0x2d6a('0x29')][_0x2d6a('0x2c')]);return _0x13a470(_0xbb11ce[_0x2d6a('0x29')][_0x2d6a('0x2c')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2f71a3,_0x2d6a('0x25'));_0x13a470(_0xbb11ce[_0x2d6a('0x2d')][_0x2d6a('0x2c')]);}})['catch'](function(_0x4fd971){logger[_0x2d6a('0x29')](_0x2d6a('0x2b'),_0x2f71a3,_0x4fd971);_0x372fa5(_0x4fd971);});});}function respondWithStatusCode(_0x36a8a6,_0xf9342d){_0xf9342d=_0xf9342d||0xcc;return function(_0x37a5f4){if(_0x37a5f4){return _0x36a8a6[_0x2d6a('0x2e')](_0xf9342d);}return _0x36a8a6[_0x2d6a('0x2f')](_0xf9342d)['end']();};}function respondWithResult(_0x2587e9,_0x5ec0df){_0x5ec0df=_0x5ec0df||0xc8;return function(_0x3f8e3f){if(_0x3f8e3f){return _0x2587e9[_0x2d6a('0x2f')](_0x5ec0df)['json'](_0x3f8e3f);}};}function respondWithFilteredResult(_0x413bc3,_0x2724d3){return function(_0x10d08c){if(_0x10d08c){var _0x2409c7=typeof _0x2724d3['offset']==='undefined'&&typeof _0x2724d3[_0x2d6a('0x30')]===_0x2d6a('0x31');var _0x24db55=_0x10d08c['count'];var _0x3447b7=_0x2409c7?0x0:_0x2724d3[_0x2d6a('0x32')];var _0x1291a5=_0x2409c7?_0x10d08c['count']:_0x2724d3[_0x2d6a('0x32')]+_0x2724d3['limit'];var _0x2c2da0;if(_0x1291a5>=_0x24db55){_0x1291a5=_0x24db55;_0x2c2da0=0xc8;}else{_0x2c2da0=0xce;}_0x413bc3[_0x2d6a('0x2f')](_0x2c2da0);return _0x413bc3[_0x2d6a('0x33')]('Content-Range',_0x3447b7+'-'+_0x1291a5+'/'+_0x24db55)[_0x2d6a('0x34')](_0x10d08c);}return null;};}function patchUpdates(_0x360953){return function(_0x55218c){try{jsonpatch['apply'](_0x55218c,_0x360953,!![]);}catch(_0x7dc6a8){return BPromise[_0x2d6a('0x35')](_0x7dc6a8);}return _0x55218c[_0x2d6a('0x36')]();};}function saveUpdates(_0x56b41c,_0x2235e){return function(_0x5a3cbf){if(_0x5a3cbf){return _0x5a3cbf['update'](_0x56b41c)[_0x2d6a('0x23')](function(_0x20f693){return _0x20f693;});}return null;};}function removeEntity(_0x21849c,_0x4fabf6){return function(_0x2219be){if(_0x2219be){return _0x2219be[_0x2d6a('0x37')]()[_0x2d6a('0x23')](function(){_0x21849c[_0x2d6a('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aa88a,_0xe8ab23){return function(_0x332631){if(!_0x332631){_0x3aa88a[_0x2d6a('0x2e')](0x194);}return _0x332631;};}function handleError(_0x19dcac,_0x27f984){_0x27f984=_0x27f984||0x1f4;return function(_0x4b4d09){logger[_0x2d6a('0x29')](_0x4b4d09[_0x2d6a('0x38')]);if(_0x4b4d09[_0x2d6a('0x39')]){delete _0x4b4d09['name'];}_0x19dcac[_0x2d6a('0x2f')](_0x27f984)[_0x2d6a('0x3a')](_0x4b4d09);};}exports['index']=function(_0x26becd,_0x1cdaba){var _0x619f57={},_0x5696fc={},_0x2c7e34={'count':0x0,'rows':[]};var _0x465416=_[_0x2d6a('0x3b')](db['ChatMessage'][_0x2d6a('0x3c')],function(_0x38d1da){return{'name':_0x38d1da[_0x2d6a('0x3d')],'type':_0x38d1da[_0x2d6a('0x3e')][_0x2d6a('0x3f')]};});_0x5696fc[_0x2d6a('0x40')]=_[_0x2d6a('0x3b')](_0x465416,_0x2d6a('0x39'));_0x5696fc[_0x2d6a('0x41')]=_[_0x2d6a('0x42')](_0x26becd[_0x2d6a('0x41')]);_0x5696fc[_0x2d6a('0x43')]=_[_0x2d6a('0x44')](_0x5696fc['model'],_0x5696fc['query']);_0x619f57[_0x2d6a('0x45')]=_[_0x2d6a('0x44')](_0x5696fc['model'],qs['fields'](_0x26becd['query'][_0x2d6a('0x46')]));_0x619f57['attributes']=_0x619f57['attributes'][_0x2d6a('0x47')]?_0x619f57['attributes']:_0x5696fc[_0x2d6a('0x40')];if(!_0x26becd[_0x2d6a('0x41')]['hasOwnProperty'](_0x2d6a('0x48'))){_0x619f57[_0x2d6a('0x30')]=qs[_0x2d6a('0x30')](_0x26becd[_0x2d6a('0x41')]['limit']);_0x619f57[_0x2d6a('0x32')]=qs[_0x2d6a('0x32')](_0x26becd['query'][_0x2d6a('0x32')]);}_0x619f57['order']=qs[_0x2d6a('0x49')](_0x26becd[_0x2d6a('0x41')][_0x2d6a('0x49')]);_0x619f57[_0x2d6a('0x4a')]=qs['filters'](_['pick'](_0x26becd[_0x2d6a('0x41')],_0x5696fc[_0x2d6a('0x43')]),_0x465416);if(_0x26becd[_0x2d6a('0x41')][_0x2d6a('0x4b')]){_0x619f57['where']=_[_0x2d6a('0x4c')](_0x619f57['where'],{'$or':_[_0x2d6a('0x3b')](_0x465416,function(_0x2f3283){if(_0x2f3283['type']!==_0x2d6a('0x4d')){var _0x4bd331={};_0x4bd331[_0x2f3283[_0x2d6a('0x39')]]={'$like':'%'+_0x26becd[_0x2d6a('0x41')][_0x2d6a('0x4b')]+'%'};return _0x4bd331;}})});}_0x619f57=_['merge']({},_0x619f57,_0x26becd[_0x2d6a('0x4e')]);var _0x51087c={'where':_0x619f57['where']};return db[_0x2d6a('0x4f')][_0x2d6a('0x50')](_0x51087c)[_0x2d6a('0x23')](function(_0x7364f1){_0x2c7e34[_0x2d6a('0x50')]=_0x7364f1;if(_0x26becd['query'][_0x2d6a('0x51')]){_0x619f57['include']=[{'all':!![]}];}return db['ChatMessage'][_0x2d6a('0x52')](_0x619f57);})['then'](function(_0x497e49){_0x2c7e34['rows']=_0x497e49;return _0x2c7e34;})[_0x2d6a('0x23')](respondWithFilteredResult(_0x1cdaba,_0x619f57))['catch'](handleError(_0x1cdaba,null));};exports[_0x2d6a('0x53')]=function(_0x4ae732,_0x5c05d3){var _0x19abcb={'raw':!![],'where':{'id':_0x4ae732['params']['id']}},_0x8ee60e={};_0x8ee60e[_0x2d6a('0x40')]=_[_0x2d6a('0x42')](db[_0x2d6a('0x4f')]['rawAttributes']);_0x8ee60e['query']=_[_0x2d6a('0x42')](_0x4ae732[_0x2d6a('0x41')]);_0x8ee60e[_0x2d6a('0x43')]=_[_0x2d6a('0x44')](_0x8ee60e[_0x2d6a('0x40')],_0x8ee60e['query']);_0x19abcb[_0x2d6a('0x45')]=_['intersection'](_0x8ee60e['model'],qs[_0x2d6a('0x46')](_0x4ae732[_0x2d6a('0x41')]['fields']));_0x19abcb[_0x2d6a('0x45')]=_0x19abcb[_0x2d6a('0x45')][_0x2d6a('0x47')]?_0x19abcb['attributes']:_0x8ee60e[_0x2d6a('0x40')];if(_0x4ae732[_0x2d6a('0x41')][_0x2d6a('0x51')]){_0x19abcb[_0x2d6a('0x54')]=[{'all':!![]}];}_0x19abcb=_[_0x2d6a('0x4c')]({},_0x19abcb,_0x4ae732[_0x2d6a('0x4e')]);return db[_0x2d6a('0x4f')][_0x2d6a('0x55')](_0x19abcb)[_0x2d6a('0x23')](handleEntityNotFound(_0x5c05d3,null))[_0x2d6a('0x23')](respondWithResult(_0x5c05d3,null))[_0x2d6a('0x56')](handleError(_0x5c05d3,null));};exports[_0x2d6a('0x57')]=function(_0x562b0a,_0xbdb7ad){return db['ChatMessage'][_0x2d6a('0x57')](_0x562b0a[_0x2d6a('0x58')],{})[_0x2d6a('0x23')](respondWithResult(_0xbdb7ad,0xc9))['catch'](handleError(_0xbdb7ad,null));};exports[_0x2d6a('0x59')]=function(_0x2243b2,_0x41f964){if(_0x2243b2[_0x2d6a('0x58')]['id']){delete _0x2243b2['body']['id'];}return db[_0x2d6a('0x4f')][_0x2d6a('0x55')]({'where':{'id':_0x2243b2[_0x2d6a('0x5a')]['id']}})[_0x2d6a('0x23')](handleEntityNotFound(_0x41f964,null))[_0x2d6a('0x23')](saveUpdates(_0x2243b2[_0x2d6a('0x58')],null))[_0x2d6a('0x23')](respondWithResult(_0x41f964,null))[_0x2d6a('0x56')](handleError(_0x41f964,null));};exports[_0x2d6a('0x37')]=function(_0x506b49,_0x538cb7){return db['ChatMessage']['find']({'where':{'id':_0x506b49[_0x2d6a('0x5a')]['id']}})[_0x2d6a('0x23')](handleEntityNotFound(_0x538cb7,null))[_0x2d6a('0x23')](removeEntity(_0x538cb7,null))[_0x2d6a('0x56')](handleError(_0x538cb7,null));};exports[_0x2d6a('0x5b')]=function(_0x3eb829,_0x32b43c){return db[_0x2d6a('0x4f')]['describe']()[_0x2d6a('0x23')](respondWithResult(_0x32b43c,null))[_0x2d6a('0x56')](handleError(_0x32b43c,null));};var interaction_log=require(_0x2d6a('0x14'))(_0x2d6a('0x5c'));exports[_0x2d6a('0x5d')]=function(_0x29f4f3,_0x1ff37b,_0x45890b){var _0x1fb076={'agent':{},'channel':'chat'};if(_0x29f4f3[_0x2d6a('0x58')]['id']){delete _0x29f4f3[_0x2d6a('0x58')]['id'];}_0x29f4f3[_0x2d6a('0x58')][_0x2d6a('0x5e')]=!![];_0x29f4f3[_0x2d6a('0x58')][_0x2d6a('0x5f')]=moment()['format'](_0x2d6a('0x60'));_0x29f4f3['body'][_0x2d6a('0x61')]=_0x29f4f3[_0x2d6a('0x58')][_0x2d6a('0x61')]||_0x29f4f3['user']['id'];_0x1fb076['agent']['id']=_0x29f4f3[_0x2d6a('0x58')]['UserId'];return db[_0x2d6a('0x4f')]['find']({'where':{'id':_0x29f4f3['params']['id'],'UserId':null}})[_0x2d6a('0x23')](handleEntityNotFound(_0x1ff37b,null))[_0x2d6a('0x23')](saveUpdates(_0x29f4f3[_0x2d6a('0x58')],null))[_0x2d6a('0x23')](function(_0x45fc00){if(_0x45fc00){_0x1fb076[_0x2d6a('0x2c')]=_0x45fc00[_0x2d6a('0x62')]({'plain':!![]});return db[_0x2d6a('0x63')][_0x2d6a('0x55')]({'where':{'id':_0x45fc00['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1ff37b,null))[_0x2d6a('0x23')](function(_0x29a4d1){if(_0x29a4d1){return _0x29a4d1[_0x2d6a('0x59')]({'UserId':_0x29f4f3[_0x2d6a('0x58')][_0x2d6a('0x61')],'read1stAt':_[_0x2d6a('0x64')](_0x29a4d1[_0x2d6a('0x65')])?moment()[_0x2d6a('0x66')](_0x2d6a('0x60')):undefined});}return null;})[_0x2d6a('0x23')](function(_0x182cee){if(_0x182cee){_0x1fb076[_0x2d6a('0x67')]=_0x182cee[_0x2d6a('0x62')]({'plain':!![]});interaction_log[_0x2d6a('0x24')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x29f4f3[_0x2d6a('0x68')]['id'],_0x29f4f3[_0x2d6a('0x68')][_0x2d6a('0x39')],_0x29f4f3[_0x2d6a('0x68')][_0x2d6a('0x69')],_0x1fb076[_0x2d6a('0x67')]['id'],_0x29f4f3[_0x2d6a('0x58')]?JSON[_0x2d6a('0x28')](_0x29f4f3[_0x2d6a('0x58')]):_0x2d6a('0x6a'));return respondWithRpcPromise(_0x2d6a('0x6b'),_0x2d6a('0x6c'),_0x1fb076);}return null;})[_0x2d6a('0x23')](function(_0x45761b){var _0x24bb0b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x45761b[_0x2d6a('0x2c')][_0x2d6a('0x6d')];return db['sequelize'][_0x2d6a('0x41')](_0x24bb0b,{'type':db[_0x2d6a('0x6e')][_0x2d6a('0x6f')][_0x2d6a('0x70')],'raw':!![]})[_0x2d6a('0x23')](function(_0x38f4be){return _0x38f4be;});})[_0x2d6a('0x23')](function(_0x4aa321){if(_0x4aa321){_0x1fb076['message']['contact']=_0x4aa321[0x0];if(!_0x29f4f3[_0x2d6a('0x58')]['UserId'])return;return db[_0x2d6a('0x71')][_0x2d6a('0x55')]({'where':{'id':_0x29f4f3[_0x2d6a('0x58')]['UserId'],'role':_0x2d6a('0x72')},'attributes':['id',_0x2d6a('0x39'),_0x2d6a('0x73'),_0x2d6a('0x74'),'internal'],'raw':!![]});}return null;})[_0x2d6a('0x23')](function(_0x47491c){if(!_0x47491c)return null;_0x1fb076[_0x2d6a('0x2c')][_0x2d6a('0x72')]=_0x47491c;return _0x1fb076;})[_0x2d6a('0x23')](function(_0x441ee){if(_0x441ee){if(_0x29f4f3['body']['manual']){_0x1fb076[_0x2d6a('0x2c')]['interface']=util[_0x2d6a('0x66')](_0x2d6a('0x75'),_0x29f4f3[_0x2d6a('0x68')]['name']);_0x1fb076[_0x2d6a('0x2c')][_0x2d6a('0x76')]=_0x1fb076[_0x2d6a('0x76')];_0x1fb076[_0x2d6a('0x2c')][_0x2d6a('0x77')]=_0x1fb076['channel'];_0x1fb076[_0x2d6a('0x2c')][_0x2d6a('0x78')]=_0x2d6a('0x5d');return respondWithRpcPromise(_0x2d6a('0x79'),_0x2d6a('0x79'),{'event':_0x2d6a('0x7a'),'message':_[_0x2d6a('0x4c')](_0x1fb076[_0x2d6a('0x2c')],JSON['parse'](_0x1fb076[_0x2d6a('0x67')][_0x2d6a('0x7b')]))},client9002)[_0x2d6a('0x23')](function(){return _0x1fb076;});}return _0x1fb076;}return null;})[_0x2d6a('0x23')](respondWithResult(_0x1ff37b,null))[_0x2d6a('0x56')](handleError(_0x1ff37b,null));};var interaction_log=require('../../config/logger')(_0x2d6a('0x5c'));exports[_0x2d6a('0x35')]=function(_0x2489b9,_0x2c2c4c,_0x4e1619){var _0x5309a2={'agent':{},'channel':_0x2d6a('0x7c')};if(_0x2489b9[_0x2d6a('0x58')]['id']){delete _0x2489b9[_0x2d6a('0x58')]['id'];}_0x2489b9['body'][_0x2d6a('0x61')]=_0x2489b9['body'][_0x2d6a('0x61')]||_0x2489b9[_0x2d6a('0x68')]['id'];_0x5309a2[_0x2d6a('0x72')]['id']=_0x2489b9['body'][_0x2d6a('0x61')];return db[_0x2d6a('0x4f')][_0x2d6a('0x55')]({'where':{'id':_0x2489b9[_0x2d6a('0x5a')]['id'],'UserId':null}})[_0x2d6a('0x23')](handleEntityNotFound(_0x2c2c4c,null))[_0x2d6a('0x23')](function(_0x9c036a){if(_0x9c036a){_0x5309a2['message']=_0x9c036a['get']({'plain':!![]});return db['ChatInteraction'][_0x2d6a('0x55')]({'where':{'id':_0x9c036a[_0x2d6a('0x7d')]}});}return null;})[_0x2d6a('0x23')](handleEntityNotFound(_0x2c2c4c,null))[_0x2d6a('0x23')](function(_0x17595d){if(_0x17595d){_0x5309a2[_0x2d6a('0x67')]=_0x17595d[_0x2d6a('0x62')]({'plain':!![]});interaction_log[_0x2d6a('0x24')](_0x2d6a('0x7e'),_0x2489b9[_0x2d6a('0x68')]['id'],_0x2489b9[_0x2d6a('0x68')][_0x2d6a('0x39')],_0x2489b9['user'][_0x2d6a('0x69')],_0x5309a2['interaction']['id'],_0x2489b9['body']?JSON[_0x2d6a('0x28')](_0x2489b9[_0x2d6a('0x58')]):'null');return respondWithRpcPromise(_0x2d6a('0x7f'),_0x2d6a('0x80'),_0x5309a2);}return null;})[_0x2d6a('0x23')](function(_0x412d29){var _0x30516e=_0x2d6a('0x81')+_0x412d29[_0x2d6a('0x2c')][_0x2d6a('0x6d')];return db[_0x2d6a('0x82')][_0x2d6a('0x41')](_0x30516e,{'type':db[_0x2d6a('0x6e')]['QueryTypes'][_0x2d6a('0x70')],'raw':!![]})[_0x2d6a('0x23')](function(_0x3212e8){return _0x3212e8;});})[_0x2d6a('0x23')](function(_0x534b75){if(_0x534b75){_0x5309a2[_0x2d6a('0x2c')]['contact']=_0x534b75[0x0];if(!_0x2489b9[_0x2d6a('0x58')]['UserId'])return;return db[_0x2d6a('0x71')]['find']({'where':{'id':_0x2489b9[_0x2d6a('0x58')]['UserId'],'role':_0x2d6a('0x72')},'attributes':['id',_0x2d6a('0x39'),_0x2d6a('0x73'),_0x2d6a('0x74'),_0x2d6a('0x83')],'raw':!![]});}return null;})[_0x2d6a('0x23')](function(_0x1d8256){if(!_0x1d8256)return null;_0x5309a2[_0x2d6a('0x2c')]['agent']=_0x1d8256;return _0x5309a2;})['then'](function(_0x4d5816){if(_0x4d5816){_0x4d5816['message']['interface']=util[_0x2d6a('0x66')](_0x2d6a('0x75'),_0x2489b9[_0x2d6a('0x68')][_0x2d6a('0x39')]);_0x4d5816[_0x2d6a('0x2c')]['channel']=_0x5309a2['channel'];_0x4d5816[_0x2d6a('0x2c')][_0x2d6a('0x77')]=_0x5309a2[_0x2d6a('0x76')];_0x4d5816[_0x2d6a('0x2c')]['event']='reject';respondWithRpcPromise(_0x2d6a('0x79'),_0x2d6a('0x79'),{'event':_0x2d6a('0x84'),'message':_[_0x2d6a('0x4c')](_0x5309a2[_0x2d6a('0x2c')],JSON['parse'](_0x5309a2[_0x2d6a('0x67')][_0x2d6a('0x7b')]))},client9002);return _0x5309a2;}return null;})[_0x2d6a('0x23')](respondWithResult(_0x2c2c4c,null))[_0x2d6a('0x56')](handleError(_0x2c2c4c,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index ba2ae5f..834bf61 100644 --- a/server/api/chatMessage/chatMessage.events.js +++ b/server/api/chatMessage/chatMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cef=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x572499,_0x37619d){var _0x5466e3=function(_0x1c78a7){while(--_0x1c78a7){_0x572499['push'](_0x572499['shift']());}};_0x5466e3(++_0x37619d);}(_0x9cef,0x1e2));var _0xf9ce=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0x9cef[_0x912d27];return _0x31b918;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xf9ce('0x0'))['db'][_0xf9ce('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf9ce('0x2')](0x0);var events={'afterCreate':_0xf9ce('0x3'),'afterUpdate':_0xf9ce('0x4'),'afterDestroy':_0xf9ce('0x5')};function emitEvent(_0x564e70){return function(_0x318d07,_0x297923,_0x58e097){ChatMessageEvents[_0xf9ce('0x6')](_0x564e70+':'+_0x318d07['id'],_0x318d07);ChatMessageEvents['emit'](_0x564e70,_0x318d07);_0x58e097(null);};}for(var e in events){if(events[_0xf9ce('0x7')](e)){var event=events[e];ChatMessage[_0xf9ce('0x8')](e,emitEvent(event));}}module[_0xf9ce('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x66e5=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x66e5,0xea));var _0x566e=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0x66e5[_0x562362];return _0x3a18ce;};'use strict';var EventEmitter=require(_0x566e('0x0'));var ChatMessage=require(_0x566e('0x1'))['db'][_0x566e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x566e('0x3')](0x0);var events={'afterCreate':_0x566e('0x4'),'afterUpdate':_0x566e('0x5'),'afterDestroy':_0x566e('0x6')};function emitEvent(_0x3f75e5){return function(_0x45f315,_0x3ee81f,_0x45a8d5){ChatMessageEvents[_0x566e('0x7')](_0x3f75e5+':'+_0x45f315['id'],_0x45f315);ChatMessageEvents[_0x566e('0x7')](_0x3f75e5,_0x45f315);_0x45a8d5(null);};}for(var e in events){if(events[_0x566e('0x8')](e)){var event=events[e];ChatMessage[_0x566e('0x9')](e,emitEvent(event));}}module[_0x566e('0xa')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 0f9d3e9..5f4b7ad 100644 --- a/server/api/chatMessage/chatMessage.model.js +++ b/server/api/chatMessage/chatMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6089=['body','FULLTEXT','models','direction','toLowerCase','out','secret','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages'];(function(_0x1c0466,_0x318a40){var _0xca7ef=function(_0x5497a7){while(--_0x5497a7){_0x1c0466['push'](_0x1c0466['shift']());}};_0xca7ef(++_0x318a40);}(_0x6089,0x100));var _0x9608=function(_0x37a212,_0x454276){_0x37a212=_0x37a212-0x0;var _0x511731=_0x6089[_0x37a212];return _0x511731;};'use strict';var _=require(_0x9608('0x0'));var util=require(_0x9608('0x1'));var logger=require(_0x9608('0x2'))(_0x9608('0x3'));var moment=require(_0x9608('0x4'));var BPromise=require(_0x9608('0x5'));var rp=require(_0x9608('0x6'));var fs=require('fs');var path=require(_0x9608('0x7'));var rimraf=require('rimraf');var config=require(_0x9608('0x8'));var attributes=require(_0x9608('0x9'));module[_0x9608('0xa')]=function(_0x59f428,_0x3cbbe1){return _0x59f428['define'](_0x9608('0xb'),attributes,{'tableName':_0x9608('0xc'),'paranoid':![],'indexes':[{'name':_0x9608('0xd'),'fields':[_0x9608('0xe')],'type':_0x9608('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x10d447,_0x23b68e,_0x19a9c0){var _0x3b86fc=_0x59f428[_0x9608('0x10')];var _0x1d6237=_0x10d447['get']({'plain':!![]});if(_0x1d6237[_0x9608('0x11')][_0x9608('0x12')]()==='in'||_0x1d6237['direction']['toLowerCase']()===_0x9608('0x13')&&!_0x1d6237[_0x9608('0x14')]&&!_['isNil'](_0x1d6237['UserId'])){_0x3b86fc[_0x9608('0x15')][_0x9608('0x16')]({'where':{'id':_0x1d6237[_0x9608('0x17')]}})['then'](function(_0x2ae0ca){if(_0x2ae0ca){_0x2ae0ca[_0x9608('0x18')]({'lastMsgAt':_0x1d6237[_0x9608('0x19')],'lastMsgDirection':_0x1d6237[_0x9608('0x11')][_0x9608('0x12')]()});}})[_0x9608('0x1a')](function(_0x1ca5e8){console[_0x9608('0x1b')](_0x1ca5e8);});}_0x19a9c0();}},'charset':_0x9608('0x1c'),'collate':_0x9608('0x1d')});}; \ No newline at end of file +var _0x2aaa=['../../config/logger','api','bluebird','path','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','update','error','utf8mb4','util'];(function(_0x34ec01,_0x3b2fc1){var _0x36f296=function(_0x2481d5){while(--_0x2481d5){_0x34ec01['push'](_0x34ec01['shift']());}};_0x36f296(++_0x3b2fc1);}(_0x2aaa,0x185));var _0xa2aa=function(_0x44fb19,_0x1e8074){_0x44fb19=_0x44fb19-0x0;var _0x4c6e34=_0x2aaa[_0x44fb19];return _0x4c6e34;};'use strict';var _=require('lodash');var util=require(_0xa2aa('0x0'));var logger=require(_0xa2aa('0x1'))(_0xa2aa('0x2'));var moment=require('moment');var BPromise=require(_0xa2aa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2aa('0x4'));var rimraf=require('rimraf');var config=require(_0xa2aa('0x5'));var attributes=require('./chatMessage.attributes');module[_0xa2aa('0x6')]=function(_0x5b775f,_0x4b9eb0){return _0x5b775f[_0xa2aa('0x7')](_0xa2aa('0x8'),attributes,{'tableName':_0xa2aa('0x9'),'paranoid':![],'indexes':[{'name':_0xa2aa('0xa'),'fields':[_0xa2aa('0xb')],'type':_0xa2aa('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b5515,_0x29a3f9,_0x1ecde6){var _0x547fcc=_0x5b775f[_0xa2aa('0xd')];var _0x130d03=_0x3b5515[_0xa2aa('0xe')]({'plain':!![]});if(_0x130d03[_0xa2aa('0xf')][_0xa2aa('0x10')]()==='in'||_0x130d03[_0xa2aa('0xf')][_0xa2aa('0x10')]()===_0xa2aa('0x11')&&!_0x130d03[_0xa2aa('0x12')]&&!_[_0xa2aa('0x13')](_0x130d03[_0xa2aa('0x14')])){_0x547fcc['ChatInteraction'][_0xa2aa('0x15')]({'where':{'id':_0x130d03[_0xa2aa('0x16')]}})['then'](function(_0x5b2b6e){if(_0x5b2b6e){_0x5b2b6e[_0xa2aa('0x17')]({'lastMsgAt':_0x130d03['createdAt'],'lastMsgDirection':_0x130d03['direction'][_0xa2aa('0x10')]()});}})['catch'](function(_0x460060){console[_0xa2aa('0x18')](_0x460060);});}_0x1ecde6();}},'charset':_0xa2aa('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 80333f1..b9a7554 100644 --- a/server/api/chatMessage/chatMessage.rpc.js +++ b/server/api/chatMessage/chatMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf2d=['CreateChatMessage','ChatMessage','create','body','options','raw','info','debug','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatMessage.socket','register','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x45b16f,_0x295bc7){var _0x1cfb30=function(_0x1eff84){while(--_0x1eff84){_0x45b16f['push'](_0x45b16f['shift']());}};_0x1cfb30(++_0x295bc7);}(_0xaf2d,0xbc));var _0xdaf2=function(_0x1f5746,_0x12e2a7){_0x1f5746=_0x1f5746-0x0;var _0x5796ef=_0xaf2d[_0x1f5746];return _0x5796ef;};'use strict';var _=require('lodash');var util=require(_0xdaf2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdaf2('0x1'));var fs=require('fs');var Redis=require(_0xdaf2('0x2'));var db=require(_0xdaf2('0x3'))['db'];var utils=require(_0xdaf2('0x4'));var logger=require('../../config/logger')(_0xdaf2('0x5'));var config=require(_0xdaf2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdaf2('0x7')]['http']({'port':0x232a});config[_0xdaf2('0x8')]=_['defaults'](config[_0xdaf2('0x8')],{'host':_0xdaf2('0x9'),'port':0x18eb});var socket=require(_0xdaf2('0xa'))(new Redis(config[_0xdaf2('0x8')]));require(_0xdaf2('0xb'))[_0xdaf2('0xc')](socket);function respondWithRpcPromise(_0x58163c,_0xb5a4c,_0x176f2e){return new BPromise(function(_0x5b0513,_0x1cb30e){return client['request'](_0x58163c,_0x176f2e)['then'](function(_0x5e3603){logger['info'](_0xdaf2('0xd'),_0xb5a4c,'request\x20sent');logger['debug'](_0xdaf2('0xe'),_0xb5a4c,'request\x20sent',JSON[_0xdaf2('0xf')](_0x5e3603));if(_0x5e3603[_0xdaf2('0x10')]){if(_0x5e3603[_0xdaf2('0x10')][_0xdaf2('0x11')]===0x1f4){logger[_0xdaf2('0x10')](_0xdaf2('0xd'),_0xb5a4c,_0x5e3603[_0xdaf2('0x10')][_0xdaf2('0x12')]);return _0x1cb30e(_0x5e3603[_0xdaf2('0x10')][_0xdaf2('0x12')]);}logger[_0xdaf2('0x10')](_0xdaf2('0xd'),_0xb5a4c,_0x5e3603[_0xdaf2('0x10')][_0xdaf2('0x12')]);return _0x5b0513(_0x5e3603[_0xdaf2('0x10')][_0xdaf2('0x12')]);}else{logger['info'](_0xdaf2('0xd'),_0xb5a4c,_0xdaf2('0x13'));_0x5b0513(_0x5e3603[_0xdaf2('0x14')][_0xdaf2('0x12')]);}})[_0xdaf2('0x15')](function(_0x35b8bf){logger[_0xdaf2('0x10')](_0xdaf2('0xd'),_0xb5a4c,_0x35b8bf);_0x1cb30e(_0x35b8bf);});});}exports[_0xdaf2('0x16')]=function(_0x418e40){var _0x3afa4f=this;return new Promise(function(_0x2c1501,_0x40f024){return db[_0xdaf2('0x17')][_0xdaf2('0x18')](_0x418e40[_0xdaf2('0x19')],{'raw':_0x418e40[_0xdaf2('0x1a')]?_0x418e40['options'][_0xdaf2('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x42c870){logger[_0xdaf2('0x1c')](_0xdaf2('0x16'),_0x418e40);logger[_0xdaf2('0x1d')](_0xdaf2('0x16'),_0x418e40,JSON[_0xdaf2('0xf')](_0x42c870));_0x2c1501(_0x42c870);})['catch'](function(_0x39cdf1){logger[_0xdaf2('0x10')](_0xdaf2('0x16'),_0x39cdf1[_0xdaf2('0x12')],_0x418e40);_0x40f024(_0x3afa4f['error'](0x1f4,_0x39cdf1[_0xdaf2('0x12')]));});});}; \ No newline at end of file +var _0x0b09=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0x0b09,0x69));var _0x90b0=function(_0x56c1d6,_0x50e5a6){_0x56c1d6=_0x56c1d6-0x0;var _0x5cde99=_0x0b09[_0x56c1d6];return _0x5cde99;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x90b0('0x0'));var BPromise=require('bluebird');var rs=require(_0x90b0('0x1'));var fs=require('fs');var Redis=require(_0x90b0('0x2'));var db=require(_0x90b0('0x3'))['db'];var utils=require(_0x90b0('0x4'));var logger=require(_0x90b0('0x5'))('rpc');var config=require(_0x90b0('0x6'));var jayson=require(_0x90b0('0x7'));var client=jayson[_0x90b0('0x8')][_0x90b0('0x9')]({'port':0x232a});config[_0x90b0('0xa')]=_['defaults'](config['redis'],{'host':_0x90b0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x90b0('0xa')]));require(_0x90b0('0xc'))[_0x90b0('0xd')](socket);function respondWithRpcPromise(_0x381609,_0x8b9199,_0x4ca1cf){return new BPromise(function(_0x3c9336,_0x196b56){return client[_0x90b0('0xe')](_0x381609,_0x4ca1cf)[_0x90b0('0xf')](function(_0x4b1f5c){logger[_0x90b0('0x10')](_0x90b0('0x11'),_0x8b9199,_0x90b0('0x12'));logger[_0x90b0('0x13')](_0x90b0('0x14'),_0x8b9199,_0x90b0('0x12'),JSON[_0x90b0('0x15')](_0x4b1f5c));if(_0x4b1f5c[_0x90b0('0x16')]){if(_0x4b1f5c[_0x90b0('0x16')][_0x90b0('0x17')]===0x1f4){logger[_0x90b0('0x16')](_0x90b0('0x11'),_0x8b9199,_0x4b1f5c[_0x90b0('0x16')][_0x90b0('0x18')]);return _0x196b56(_0x4b1f5c[_0x90b0('0x16')][_0x90b0('0x18')]);}logger[_0x90b0('0x16')](_0x90b0('0x11'),_0x8b9199,_0x4b1f5c[_0x90b0('0x16')]['message']);return _0x3c9336(_0x4b1f5c[_0x90b0('0x16')]['message']);}else{logger[_0x90b0('0x10')](_0x90b0('0x11'),_0x8b9199,'request\x20sent');_0x3c9336(_0x4b1f5c[_0x90b0('0x19')][_0x90b0('0x18')]);}})[_0x90b0('0x1a')](function(_0x42eeab){logger[_0x90b0('0x16')](_0x90b0('0x11'),_0x8b9199,_0x42eeab);_0x196b56(_0x42eeab);});});}exports[_0x90b0('0x1b')]=function(_0x309b09){var _0x40a11d=this;return new Promise(function(_0x3faa7d,_0x45414c){return db[_0x90b0('0x1c')][_0x90b0('0x1d')](_0x309b09['body'],{'raw':_0x309b09['options']?_0x309b09[_0x90b0('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x90b0('0xf')](function(_0x5724d7){logger[_0x90b0('0x10')](_0x90b0('0x1b'),_0x309b09);logger[_0x90b0('0x13')](_0x90b0('0x1b'),_0x309b09,JSON[_0x90b0('0x15')](_0x5724d7));_0x3faa7d(_0x5724d7);})[_0x90b0('0x1a')](function(_0x2dea26){logger[_0x90b0('0x16')](_0x90b0('0x1b'),_0x2dea26[_0x90b0('0x18')],_0x309b09);_0x45414c(_0x40a11d[_0x90b0('0x16')](0x1f4,_0x2dea26[_0x90b0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 126f142..25b8f2f 100644 --- a/server/api/chatMessage/chatMessage.socket.js +++ b/server/api/chatMessage/chatMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38d3=['save','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x38d3,0x1a7));var _0x338d=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x38d3[_0x138f59];return _0x3d114d;};'use strict';var ChatMessageEvents=require(_0x338d('0x0'));var events=[_0x338d('0x1'),'remove',_0x338d('0x2')];function createListener(_0x338ef5,_0x22c076){return function(_0x43ebf7){_0x22c076[_0x338d('0x3')](_0x338ef5,_0x43ebf7);};}function removeListener(_0x1c47c6,_0x2b867){return function(){ChatMessageEvents[_0x338d('0x4')](_0x1c47c6,_0x2b867);};}exports[_0x338d('0x5')]=function(_0x4e32b4){for(var _0x2a056d=0x0,_0x2012c3=events[_0x338d('0x6')];_0x2a056d<_0x2012c3;_0x2a056d++){var _0x2b7aab=events[_0x2a056d];var _0x60eaa1=createListener(_0x338d('0x7')+_0x2b7aab,_0x4e32b4);ChatMessageEvents['on'](_0x2b7aab,_0x60eaa1);}}; \ No newline at end of file +var _0x8c32=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x29c70f,_0xb99305){var _0x32bcac=function(_0x2df03a){while(--_0x2df03a){_0x29c70f['push'](_0x29c70f['shift']());}};_0x32bcac(++_0xb99305);}(_0x8c32,0x130));var _0x28c3=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x8c32[_0x11005e];return _0x29338f;};'use strict';var ChatMessageEvents=require(_0x28c3('0x0'));var events=[_0x28c3('0x1'),_0x28c3('0x2'),_0x28c3('0x3')];function createListener(_0x27dd09,_0xc522d5){return function(_0x36d4ad){_0xc522d5[_0x28c3('0x4')](_0x27dd09,_0x36d4ad);};}function removeListener(_0x2f94e0,_0x40df22){return function(){ChatMessageEvents[_0x28c3('0x5')](_0x2f94e0,_0x40df22);};}exports[_0x28c3('0x6')]=function(_0x537b4f){for(var _0x2861c9=0x0,_0x4ed515=events[_0x28c3('0x7')];_0x2861c9<_0x4ed515;_0x2861c9++){var _0x482952=events[_0x2861c9];var _0xbaee6f=createListener(_0x28c3('0x8')+_0x482952,_0x537b4f);ChatMessageEvents['on'](_0x482952,_0xbaee6f);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index ba3d350..e4381c3 100644 --- a/server/api/chatMessage/index.js +++ b/server/api/chatMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8528=['/:id/accept','accept','/:id/reject','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','chat','chatmessage:create','put','update'];(function(_0x533224,_0x529d55){var _0x447493=function(_0x52b1d0){while(--_0x52b1d0){_0x533224['push'](_0x533224['shift']());}};_0x447493(++_0x529d55);}(_0x8528,0xac));var _0x8852=function(_0x104a2,_0x50fda4){_0x104a2=_0x104a2-0x0;var _0x4fc538=_0x8528[_0x104a2];return _0x4fc538;};'use strict';var multer=require('multer');var util=require(_0x8852('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8852('0x1'));var router=express[_0x8852('0x2')]();var fs_extra=require(_0x8852('0x3'));var auth=require(_0x8852('0x4'));var interaction=require(_0x8852('0x5'));var config=require(_0x8852('0x6'));var controller=require(_0x8852('0x7'));router[_0x8852('0x8')]('/',auth[_0x8852('0x9')](),controller[_0x8852('0xa')]);router[_0x8852('0x8')](_0x8852('0xb'),auth['isAuthenticated'](),controller[_0x8852('0xc')]);router['get'](_0x8852('0xd'),auth[_0x8852('0x9')](),controller[_0x8852('0xe')]);router['post']('/',auth[_0x8852('0x9')](),interaction[_0x8852('0xf')](_0x8852('0x10'),_0x8852('0x11')),controller['create']);router[_0x8852('0x12')]('/:id',controller[_0x8852('0x13')]);router['put'](_0x8852('0x14'),auth[_0x8852('0x9')](),controller[_0x8852('0x15')]);router[_0x8852('0x12')](_0x8852('0x16'),auth[_0x8852('0x9')](),controller['reject']);router['delete'](_0x8852('0xd'),auth[_0x8852('0x9')](),controller['destroy']);module[_0x8852('0x17')]=router; \ No newline at end of file +var _0x190f=['index','/describe','isAuthenticated','/:id','show','post','create','put','update','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x190f,0x15e));var _0xf190=function(_0x58b94e,_0x48d05f){_0x58b94e=_0x58b94e-0x0;var _0x505342=_0x190f[_0x58b94e];return _0x505342;};'use strict';var multer=require(_0xf190('0x0'));var util=require(_0xf190('0x1'));var path=require(_0xf190('0x2'));var timeout=require(_0xf190('0x3'));var express=require(_0xf190('0x4'));var router=express[_0xf190('0x5')]();var fs_extra=require(_0xf190('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf190('0x7'));var config=require(_0xf190('0x8'));var controller=require(_0xf190('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf190('0xa')]);router['get'](_0xf190('0xb'),auth[_0xf190('0xc')](),controller['describe']);router['get'](_0xf190('0xd'),auth[_0xf190('0xc')](),controller[_0xf190('0xe')]);router[_0xf190('0xf')]('/',auth['isAuthenticated'](),interaction['tracked']('chat','chatmessage:create'),controller[_0xf190('0x10')]);router[_0xf190('0x11')](_0xf190('0xd'),controller[_0xf190('0x12')]);router[_0xf190('0x11')]('/:id/accept',auth[_0xf190('0xc')](),controller['accept']);router[_0xf190('0x11')](_0xf190('0x13'),auth[_0xf190('0xc')](),controller[_0xf190('0x14')]);router[_0xf190('0x15')](_0xf190('0xd'),auth[_0xf190('0xc')](),controller[_0xf190('0x16')]);module[_0xf190('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 834ef91..7f20aed 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['medium','TEXT','exports'];(function(_0x20c04f,_0x34798a){var _0x36d499=function(_0x431b57){while(--_0x431b57){_0x20c04f['push'](_0x20c04f['shift']());}};_0x36d499(++_0x34798a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x16803a,_0x5313d7){var _0x2dde47=function(_0x3cc2fa){while(--_0x3cc2fa){_0x16803a['push'](_0x16803a['shift']());}};_0x2dde47(++_0x5313d7);}(_0xdb28,0x106));var _0x8db2=function(_0x415cb8,_0x213075){_0x415cb8=_0x415cb8-0x0;var _0x2b89c6=_0xdb28[_0x415cb8];return _0x2b89c6;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 52ed3a8..7ab5fd8 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x7a54,0x106));var _0x47a5=function(_0x5e0a26,_0x560d1b){_0x5e0a26=_0x5e0a26-0x0;var _0x16041d=_0x7a54[_0x5e0a26];return _0x16041d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x7a54,0x106));var _0x47a5=function(_0x24cb63,_0x42e91f){_0x24cb63=_0x24cb63-0x0;var _0x21f029=_0x7a54[_0x24cb63];return _0x21f029;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 1c0b105..02ca27e 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe91=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','update','remove'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0xfe91,0xd4));var _0x1fe9=function(_0x3a4318,_0x13c6eb){_0x3a4318=_0x3a4318-0x0;var _0x36d746=_0xfe91[_0x3a4318];return _0x36d746;};'use strict';var EventEmitter=require(_0x1fe9('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1fe9('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fe9('0x2'),'afterDestroy':_0x1fe9('0x3')};function emitEvent(_0x1b26ca){return function(_0xf47d94,_0x40c26c,_0x16259f){ChatOfflineMessageEvents[_0x1fe9('0x4')](_0x1b26ca+':'+_0xf47d94['id'],_0xf47d94);ChatOfflineMessageEvents['emit'](_0x1b26ca,_0xf47d94);_0x16259f(null);};}for(var e in events){if(events[_0x1fe9('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x1fe9('0x6')](e,emitEvent(event));}}module[_0x1fe9('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x1487=['ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5060ab,_0x5763a1){var _0x5b9cd9=function(_0x4e47cf){while(--_0x4e47cf){_0x5060ab['push'](_0x5060ab['shift']());}};_0x5b9cd9(++_0x5763a1);}(_0x1487,0xf2));var _0x7148=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x1487[_0x5806c3];return _0x48ac77;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x7148('0x0'))['db'][_0x7148('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7148('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7148('0x3'),'afterDestroy':_0x7148('0x4')};function emitEvent(_0x48f2b6){return function(_0x440aff,_0x2e82c8,_0xe5315a){ChatOfflineMessageEvents[_0x7148('0x5')](_0x48f2b6+':'+_0x440aff['id'],_0x440aff);ChatOfflineMessageEvents[_0x7148('0x5')](_0x48f2b6,_0x440aff);_0xe5315a(null);};}for(var e in events){if(events[_0x7148('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x7148('0x7')](e,emitEvent(event));}}module[_0x7148('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index b0ac029..fc9dae6 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf0e=['./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0x9a0c7,_0x338db2){var _0x5ecfb2=function(_0x34aee7){while(--_0x34aee7){_0x9a0c7['push'](_0x9a0c7['shift']());}};_0x5ecfb2(++_0x338db2);}(_0xcf0e,0x64));var _0xecf0=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0xcf0e[_0x541ea6];return _0x3c3e84;};'use strict';var attributes=require(_0xecf0('0x0'));module[_0xecf0('0x1')]=function(_0x485ab0){return _0x485ab0[_0xecf0('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0xecf0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xecf0('0x4')});}; \ No newline at end of file +var _0x5437=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5437,0x1e7));var _0x7543=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0x5437[_0x4afac5];return _0x2404b3;};'use strict';var attributes=require(_0x7543('0x0'));module['exports']=function(_0x3250e4){return _0x3250e4[_0x7543('0x1')](_0x7543('0x2'),attributes,{'tableName':_0x7543('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7543('0x4'),'collate':_0x7543('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 2f02975..3d76904 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c03=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x1fcd1f,_0x10bb5b){var _0x572353=function(_0x3eac51){while(--_0x3eac51){_0x1fcd1f['push'](_0x1fcd1f['shift']());}};_0x572353(++_0x10bb5b);}(_0x6c03,0x98));var _0x36c0=function(_0x23f801,_0x5bf0e8){_0x23f801=_0x23f801-0x0;var _0xa0beb4=_0x6c03[_0x23f801];return _0xa0beb4;};'use strict';var _=require(_0x36c0('0x0'));var util=require(_0x36c0('0x1'));var moment=require(_0x36c0('0x2'));var BPromise=require(_0x36c0('0x3'));var rs=require(_0x36c0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x36c0('0x5'))['db'];var utils=require(_0x36c0('0x6'));var logger=require(_0x36c0('0x7'))(_0x36c0('0x8'));var config=require('../../config/environment');var jayson=require(_0x36c0('0x9'));var client=jayson[_0x36c0('0xa')][_0x36c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x278765,_0x18f4b3,_0x53d992){return new BPromise(function(_0x4f63f5,_0x1a2805){return client[_0x36c0('0xc')](_0x278765,_0x53d992)[_0x36c0('0xd')](function(_0x37c2e3){logger[_0x36c0('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x18f4b3,_0x36c0('0xf'));logger['debug'](_0x36c0('0x10'),_0x18f4b3,_0x36c0('0xf'),JSON[_0x36c0('0x11')](_0x37c2e3));if(_0x37c2e3[_0x36c0('0x12')]){if(_0x37c2e3['error'][_0x36c0('0x13')]===0x1f4){logger[_0x36c0('0x12')](_0x36c0('0x14'),_0x18f4b3,_0x37c2e3['error']['message']);return _0x1a2805(_0x37c2e3[_0x36c0('0x12')][_0x36c0('0x15')]);}logger[_0x36c0('0x12')](_0x36c0('0x14'),_0x18f4b3,_0x37c2e3['error'][_0x36c0('0x15')]);return _0x4f63f5(_0x37c2e3[_0x36c0('0x12')][_0x36c0('0x15')]);}else{logger[_0x36c0('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x18f4b3,_0x36c0('0xf'));_0x4f63f5(_0x37c2e3[_0x36c0('0x16')][_0x36c0('0x15')]);}})[_0x36c0('0x17')](function(_0x5f0254){logger['error'](_0x36c0('0x14'),_0x18f4b3,_0x5f0254);_0x1a2805(_0x5f0254);});});} \ No newline at end of file +var _0x18c9=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x1368db,_0x4b94de){var _0x45a75f=function(_0x4b17ee){while(--_0x4b17ee){_0x1368db['push'](_0x1368db['shift']());}};_0x45a75f(++_0x4b94de);}(_0x18c9,0x1bf));var _0x918c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x18c9[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x918c('0x0'));var util=require(_0x918c('0x1'));var moment=require(_0x918c('0x2'));var BPromise=require(_0x918c('0x3'));var rs=require(_0x918c('0x4'));var fs=require('fs');var Redis=require(_0x918c('0x5'));var db=require(_0x918c('0x6'))['db'];var utils=require(_0x918c('0x7'));var logger=require(_0x918c('0x8'))(_0x918c('0x9'));var config=require(_0x918c('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x918c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f463b,_0x321ab8,_0x1b774e){return new BPromise(function(_0x4f5bd8,_0x5b14e5){return client[_0x918c('0xc')](_0x2f463b,_0x1b774e)[_0x918c('0xd')](function(_0x2c63e0){logger[_0x918c('0xe')](_0x918c('0xf'),_0x321ab8,_0x918c('0x10'));logger[_0x918c('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x321ab8,_0x918c('0x10'),JSON[_0x918c('0x12')](_0x2c63e0));if(_0x2c63e0['error']){if(_0x2c63e0[_0x918c('0x13')][_0x918c('0x14')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x321ab8,_0x2c63e0[_0x918c('0x13')][_0x918c('0x15')]);return _0x5b14e5(_0x2c63e0['error']['message']);}logger[_0x918c('0x13')](_0x918c('0xf'),_0x321ab8,_0x2c63e0[_0x918c('0x13')][_0x918c('0x15')]);return _0x4f5bd8(_0x2c63e0[_0x918c('0x13')][_0x918c('0x15')]);}else{logger[_0x918c('0xe')](_0x918c('0xf'),_0x321ab8,_0x918c('0x10'));_0x4f5bd8(_0x2c63e0['result'][_0x918c('0x15')]);}})[_0x918c('0x16')](function(_0x5253cb){logger[_0x918c('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x321ab8,_0x5253cb);_0x5b14e5(_0x5253cb);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 85e89de..3379723 100644 --- a/server/api/chatOfflineMessage/index.js +++ b/server/api/chatOfflineMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabe8=['update','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','/:id','post','create','put'];(function(_0x5f111d,_0xb19040){var _0x5bd6fb=function(_0x183329){while(--_0x183329){_0x5f111d['push'](_0x5f111d['shift']());}};_0x5bd6fb(++_0xb19040);}(_0xabe8,0x1d1));var _0x8abe=function(_0x3bdce4,_0x5013c2){_0x3bdce4=_0x3bdce4-0x0;var _0x1c338d=_0xabe8[_0x3bdce4];return _0x1c338d;};'use strict';var multer=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var path=require(_0x8abe('0x2'));var timeout=require(_0x8abe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8abe('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8abe('0x5'));var config=require(_0x8abe('0x6'));var controller=require(_0x8abe('0x7'));router[_0x8abe('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8abe('0x8')](_0x8abe('0x9'),auth[_0x8abe('0xa')](),controller['describe']);router[_0x8abe('0x8')](_0x8abe('0xb'),auth[_0x8abe('0xa')](),controller['show']);router[_0x8abe('0xc')]('/',auth[_0x8abe('0xa')](),controller[_0x8abe('0xd')]);router[_0x8abe('0xe')](_0x8abe('0xb'),auth[_0x8abe('0xa')](),controller[_0x8abe('0xf')]);router['delete']('/:id',auth[_0x8abe('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfbc4=['fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x11e454,_0x381b52){var _0xbd4b0b=function(_0x2e09c9){while(--_0x2e09c9){_0x11e454['push'](_0x11e454['shift']());}};_0xbd4b0b(++_0x381b52);}(_0xfbc4,0x94));var _0x4fbc=function(_0x473d4a,_0x4bf1e2){_0x473d4a=_0x473d4a-0x0;var _0x2d067f=_0xfbc4[_0x473d4a];return _0x2d067f;};'use strict';var multer=require(_0x4fbc('0x0'));var util=require(_0x4fbc('0x1'));var path=require(_0x4fbc('0x2'));var timeout=require(_0x4fbc('0x3'));var express=require(_0x4fbc('0x4'));var router=express[_0x4fbc('0x5')]();var fs_extra=require(_0x4fbc('0x6'));var auth=require(_0x4fbc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4fbc('0x8'));var controller=require(_0x4fbc('0x9'));router[_0x4fbc('0xa')]('/',auth[_0x4fbc('0xb')](),controller[_0x4fbc('0xc')]);router[_0x4fbc('0xa')](_0x4fbc('0xd'),auth[_0x4fbc('0xb')](),controller[_0x4fbc('0xe')]);router['get'](_0x4fbc('0xf'),auth[_0x4fbc('0xb')](),controller['show']);router[_0x4fbc('0x10')]('/',auth[_0x4fbc('0xb')](),controller[_0x4fbc('0x11')]);router[_0x4fbc('0x12')](_0x4fbc('0xf'),auth[_0x4fbc('0xb')](),controller[_0x4fbc('0x13')]);router[_0x4fbc('0x14')](_0x4fbc('0xf'),auth[_0x4fbc('0xb')](),controller['destroy']);module[_0x4fbc('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 8bb54c1..7a1771d 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js +++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x141d=['sequelize','exports','timeout','STRING','INTEGER'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x141d,0xa0));var _0xd141=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x141d[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0xd141('0x0'));module[_0xd141('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xd141('0x2')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xd141('0x3')]},'timeout':{'type':Sequelize[_0xd141('0x4')]}}; \ No newline at end of file +var _0x0666=['ENUM','mouseOver','timeout','exports','STRING'];(function(_0x40331f,_0x508503){var _0x52cb62=function(_0x2d9ac7){while(--_0x2d9ac7){_0x40331f['push'](_0x40331f['shift']());}};_0x52cb62(++_0x508503);}(_0x0666,0x1a7));var _0x6066=function(_0x73395e,_0x4774e7){_0x73395e=_0x73395e-0x0;var _0x372fc1=_0x0666[_0x73395e];return _0x372fc1;};'use strict';var Sequelize=require('sequelize');module[_0x6066('0x0')]={'name':{'type':Sequelize[_0x6066('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6066('0x2')](_0x6066('0x3'),_0x6066('0x4')),'defaultValue':_0x6066('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 770620e..b980de9 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.controller.js +++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa381=['rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','catch','create','body','eml-format'];(function(_0x566508,_0x5ef753){var _0x220f12=function(_0x3cffaa){while(--_0x3cffaa){_0x566508['push'](_0x566508['shift']());}};_0x220f12(++_0x5ef753);}(_0xa381,0x79));var _0x1a38=function(_0x4bae0c,_0x36ce6d){_0x4bae0c=_0x4bae0c-0x0;var _0x4f9a94=_0xa381[_0x4bae0c];return _0x4f9a94;};'use strict';var emlformat=require(_0x1a38('0x0'));var rimraf=require(_0x1a38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1a38('0x2'));var moment=require(_0x1a38('0x3'));var BPromise=require(_0x1a38('0x4'));var Mustache=require('mustache');var util=require(_0x1a38('0x5'));var path=require(_0x1a38('0x6'));var sox=require(_0x1a38('0x7'));var csv=require(_0x1a38('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a38('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1a38('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1a38('0xb'));var toCsv=require(_0x1a38('0x8'));var querystring=require(_0x1a38('0xc'));var Papa=require(_0x1a38('0xd'));var Redis=require('ioredis');var authService=require(_0x1a38('0xe'));var qs=require(_0x1a38('0xf'));var as=require(_0x1a38('0x10'));var hardwareService=require(_0x1a38('0x11'));var logger=require(_0x1a38('0x12'))(_0x1a38('0x13'));var utils=require(_0x1a38('0x14'));var config=require(_0x1a38('0x15'));var licenseUtil=require(_0x1a38('0x16'));var db=require(_0x1a38('0x17'))['db'];function respondWithStatusCode(_0x332dab,_0x28f875){_0x28f875=_0x28f875||0xcc;return function(_0x8c19e){if(_0x8c19e){return _0x332dab[_0x1a38('0x18')](_0x28f875);}return _0x332dab[_0x1a38('0x19')](_0x28f875)[_0x1a38('0x1a')]();};}function respondWithResult(_0x3177ec,_0x111055){_0x111055=_0x111055||0xc8;return function(_0x3392cb){if(_0x3392cb){return _0x3177ec[_0x1a38('0x19')](_0x111055)[_0x1a38('0x1b')](_0x3392cb);}};}function respondWithFilteredResult(_0x478419,_0x3a60ea){return function(_0x5d6cce){if(_0x5d6cce){var _0x54d688=typeof _0x3a60ea[_0x1a38('0x1c')]==='undefined'&&typeof _0x3a60ea[_0x1a38('0x1d')]===_0x1a38('0x1e');var _0x44a325=_0x5d6cce[_0x1a38('0x1f')];var _0x25ebb0=_0x54d688?0x0:_0x3a60ea[_0x1a38('0x1c')];var _0x408e8f=_0x54d688?_0x5d6cce[_0x1a38('0x1f')]:_0x3a60ea[_0x1a38('0x1c')]+_0x3a60ea['limit'];var _0x65f17c;if(_0x408e8f>=_0x44a325){_0x408e8f=_0x44a325;_0x65f17c=0xc8;}else{_0x65f17c=0xce;}_0x478419['status'](_0x65f17c);return _0x478419[_0x1a38('0x20')](_0x1a38('0x21'),_0x25ebb0+'-'+_0x408e8f+'/'+_0x44a325)['json'](_0x5d6cce);}return null;};}function patchUpdates(_0x45272f){return function(_0x50fccb){try{jsonpatch['apply'](_0x50fccb,_0x45272f,!![]);}catch(_0x1b87d9){return BPromise[_0x1a38('0x22')](_0x1b87d9);}return _0x50fccb[_0x1a38('0x23')]();};}function saveUpdates(_0x205c5b,_0x561fa4){return function(_0x391040){if(_0x391040){return _0x391040[_0x1a38('0x24')](_0x205c5b)[_0x1a38('0x25')](function(_0x4bfa67){return _0x4bfa67;});}return null;};}function removeEntity(_0x18912c,_0x214228){return function(_0x2877fe){if(_0x2877fe){return _0x2877fe[_0x1a38('0x26')]()[_0x1a38('0x25')](function(){_0x18912c[_0x1a38('0x19')](0xcc)[_0x1a38('0x1a')]();});}};}function handleEntityNotFound(_0x160ac1,_0x37a7d9){return function(_0x20daca){if(!_0x20daca){_0x160ac1['sendStatus'](0x194);}return _0x20daca;};}function handleError(_0x1c4d20,_0x54e4a9){_0x54e4a9=_0x54e4a9||0x1f4;return function(_0x398827){logger[_0x1a38('0x27')](_0x398827['stack']);if(_0x398827[_0x1a38('0x28')]){delete _0x398827['name'];}_0x1c4d20[_0x1a38('0x19')](_0x54e4a9)[_0x1a38('0x29')](_0x398827);};}exports[_0x1a38('0x2a')]=function(_0x59d9cc,_0x4be61f){var _0x39ac00={'raw':!![],'where':{'id':_0x59d9cc[_0x1a38('0x2b')]['id']}},_0x2a4027={};_0x2a4027[_0x1a38('0x2c')]=_[_0x1a38('0x2d')](db[_0x1a38('0x2e')][_0x1a38('0x2f')]);_0x2a4027[_0x1a38('0x30')]=_['keys'](_0x59d9cc['query']);_0x2a4027[_0x1a38('0x31')]=_[_0x1a38('0x32')](_0x2a4027[_0x1a38('0x2c')],_0x2a4027[_0x1a38('0x30')]);_0x39ac00[_0x1a38('0x33')]=_[_0x1a38('0x32')](_0x2a4027[_0x1a38('0x2c')],qs['fields'](_0x59d9cc[_0x1a38('0x30')]['fields']));_0x39ac00[_0x1a38('0x33')]=_0x39ac00[_0x1a38('0x33')][_0x1a38('0x34')]?_0x39ac00[_0x1a38('0x33')]:_0x2a4027[_0x1a38('0x2c')];if(_0x59d9cc['query'][_0x1a38('0x35')]){_0x39ac00[_0x1a38('0x36')]=[{'all':!![]}];}_0x39ac00=_[_0x1a38('0x37')]({},_0x39ac00,_0x59d9cc[_0x1a38('0x38')]);return db[_0x1a38('0x2e')][_0x1a38('0x39')](_0x39ac00)['then'](handleEntityNotFound(_0x4be61f,null))[_0x1a38('0x25')](respondWithResult(_0x4be61f,null))[_0x1a38('0x3a')](handleError(_0x4be61f,null));};exports[_0x1a38('0x3b')]=function(_0x54baf1,_0x2c8b24){return db[_0x1a38('0x2e')]['create'](_0x54baf1['body'],{})[_0x1a38('0x25')](respondWithResult(_0x2c8b24,0xc9))[_0x1a38('0x3a')](handleError(_0x2c8b24,null));};exports[_0x1a38('0x24')]=function(_0x29a32b,_0x490ab4){if(_0x29a32b['body']['id']){delete _0x29a32b[_0x1a38('0x3c')]['id'];}return db[_0x1a38('0x2e')][_0x1a38('0x39')]({'where':{'id':_0x29a32b[_0x1a38('0x2b')]['id']}})[_0x1a38('0x25')](handleEntityNotFound(_0x490ab4,null))[_0x1a38('0x25')](saveUpdates(_0x29a32b[_0x1a38('0x3c')],null))[_0x1a38('0x25')](respondWithResult(_0x490ab4,null))[_0x1a38('0x3a')](handleError(_0x490ab4,null));};exports[_0x1a38('0x26')]=function(_0x433755,_0x4971d0){return db[_0x1a38('0x2e')][_0x1a38('0x39')]({'where':{'id':_0x433755[_0x1a38('0x2b')]['id']}})[_0x1a38('0x25')](handleEntityNotFound(_0x4971d0,null))[_0x1a38('0x25')](removeEntity(_0x4971d0,null))[_0x1a38('0x3a')](handleError(_0x4971d0,null));}; \ No newline at end of file +var _0xe002=['merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','sendStatus','error','stack','name','show','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','include'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe002,0xf7));var _0x2e00=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0xe002[_0x15cdcb];return _0x37b069;};'use strict';var emlformat=require(_0x2e00('0x0'));var rimraf=require(_0x2e00('0x1'));var zipdir=require(_0x2e00('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e00('0x3'));var moment=require(_0x2e00('0x4'));var BPromise=require(_0x2e00('0x5'));var Mustache=require('mustache');var util=require(_0x2e00('0x6'));var path=require(_0x2e00('0x7'));var sox=require(_0x2e00('0x8'));var csv=require(_0x2e00('0x9'));var ejs=require(_0x2e00('0xa'));var fs=require('fs');var fs_extra=require(_0x2e00('0xb'));var _=require(_0x2e00('0xc'));var squel=require(_0x2e00('0xd'));var crypto=require('crypto');var jsforce=require(_0x2e00('0xe'));var deskjs=require(_0x2e00('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2e00('0x10'));var Papa=require(_0x2e00('0x11'));var Redis=require(_0x2e00('0x12'));var authService=require(_0x2e00('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e00('0x14'));var logger=require(_0x2e00('0x15'))(_0x2e00('0x16'));var utils=require('../../config/utils');var config=require(_0x2e00('0x17'));var licenseUtil=require(_0x2e00('0x18'));var db=require(_0x2e00('0x19'))['db'];function respondWithStatusCode(_0x40e6d1,_0x34cb45){_0x34cb45=_0x34cb45||0xcc;return function(_0x4ec979){if(_0x4ec979){return _0x40e6d1['sendStatus'](_0x34cb45);}return _0x40e6d1[_0x2e00('0x1a')](_0x34cb45)[_0x2e00('0x1b')]();};}function respondWithResult(_0x23796c,_0x24c603){_0x24c603=_0x24c603||0xc8;return function(_0x13e130){if(_0x13e130){return _0x23796c['status'](_0x24c603)[_0x2e00('0x1c')](_0x13e130);}};}function respondWithFilteredResult(_0x53a6fa,_0x1d805a){return function(_0x1247f9){if(_0x1247f9){var _0x554dd4=typeof _0x1d805a[_0x2e00('0x1d')]===_0x2e00('0x1e')&&typeof _0x1d805a[_0x2e00('0x1f')]===_0x2e00('0x1e');var _0x4be341=_0x1247f9[_0x2e00('0x20')];var _0x3d5593=_0x554dd4?0x0:_0x1d805a['offset'];var _0xa19ca1=_0x554dd4?_0x1247f9[_0x2e00('0x20')]:_0x1d805a[_0x2e00('0x1d')]+_0x1d805a['limit'];var _0x280804;if(_0xa19ca1>=_0x4be341){_0xa19ca1=_0x4be341;_0x280804=0xc8;}else{_0x280804=0xce;}_0x53a6fa[_0x2e00('0x1a')](_0x280804);return _0x53a6fa['set']('Content-Range',_0x3d5593+'-'+_0xa19ca1+'/'+_0x4be341)['json'](_0x1247f9);}return null;};}function patchUpdates(_0x5c022f){return function(_0x2a2bf3){try{jsonpatch[_0x2e00('0x21')](_0x2a2bf3,_0x5c022f,!![]);}catch(_0x2a10ad){return BPromise['reject'](_0x2a10ad);}return _0x2a2bf3[_0x2e00('0x22')]();};}function saveUpdates(_0x10b55b,_0x1b0cab){return function(_0x465af0){if(_0x465af0){return _0x465af0[_0x2e00('0x23')](_0x10b55b)[_0x2e00('0x24')](function(_0x415b6f){return _0x415b6f;});}return null;};}function removeEntity(_0xac65da,_0x7c262f){return function(_0x172967){if(_0x172967){return _0x172967[_0x2e00('0x25')]()[_0x2e00('0x24')](function(){_0xac65da[_0x2e00('0x1a')](0xcc)[_0x2e00('0x1b')]();});}};}function handleEntityNotFound(_0x36d576,_0x811a65){return function(_0x550ecb){if(!_0x550ecb){_0x36d576[_0x2e00('0x26')](0x194);}return _0x550ecb;};}function handleError(_0x102faa,_0xe8ee4){_0xe8ee4=_0xe8ee4||0x1f4;return function(_0x497b2d){logger[_0x2e00('0x27')](_0x497b2d[_0x2e00('0x28')]);if(_0x497b2d[_0x2e00('0x29')]){delete _0x497b2d[_0x2e00('0x29')];}_0x102faa[_0x2e00('0x1a')](_0xe8ee4)['send'](_0x497b2d);};}exports[_0x2e00('0x2a')]=function(_0x5a75ad,_0x133967){var _0x4842c5={'raw':!![],'where':{'id':_0x5a75ad['params']['id']}},_0x388d82={};_0x388d82[_0x2e00('0x2b')]=_[_0x2e00('0x2c')](db[_0x2e00('0x2d')]['rawAttributes']);_0x388d82[_0x2e00('0x2e')]=_[_0x2e00('0x2c')](_0x5a75ad[_0x2e00('0x2e')]);_0x388d82[_0x2e00('0x2f')]=_[_0x2e00('0x30')](_0x388d82['model'],_0x388d82[_0x2e00('0x2e')]);_0x4842c5[_0x2e00('0x31')]=_[_0x2e00('0x30')](_0x388d82[_0x2e00('0x2b')],qs[_0x2e00('0x32')](_0x5a75ad[_0x2e00('0x2e')][_0x2e00('0x32')]));_0x4842c5[_0x2e00('0x31')]=_0x4842c5['attributes'][_0x2e00('0x33')]?_0x4842c5['attributes']:_0x388d82[_0x2e00('0x2b')];if(_0x5a75ad[_0x2e00('0x2e')]['includeAll']){_0x4842c5[_0x2e00('0x34')]=[{'all':!![]}];}_0x4842c5=_[_0x2e00('0x35')]({},_0x4842c5,_0x5a75ad[_0x2e00('0x36')]);return db[_0x2e00('0x2d')][_0x2e00('0x37')](_0x4842c5)['then'](handleEntityNotFound(_0x133967,null))[_0x2e00('0x24')](respondWithResult(_0x133967,null))[_0x2e00('0x38')](handleError(_0x133967,null));};exports[_0x2e00('0x39')]=function(_0x5754c9,_0x17e785){return db[_0x2e00('0x2d')][_0x2e00('0x39')](_0x5754c9[_0x2e00('0x3a')],{})[_0x2e00('0x24')](respondWithResult(_0x17e785,0xc9))[_0x2e00('0x38')](handleError(_0x17e785,null));};exports[_0x2e00('0x23')]=function(_0x59d1cc,_0x5de126){if(_0x59d1cc['body']['id']){delete _0x59d1cc['body']['id'];}return db[_0x2e00('0x2d')][_0x2e00('0x37')]({'where':{'id':_0x59d1cc[_0x2e00('0x3b')]['id']}})[_0x2e00('0x24')](handleEntityNotFound(_0x5de126,null))['then'](saveUpdates(_0x59d1cc[_0x2e00('0x3a')],null))[_0x2e00('0x24')](respondWithResult(_0x5de126,null))[_0x2e00('0x38')](handleError(_0x5de126,null));};exports[_0x2e00('0x25')]=function(_0x1269eb,_0x563517){return db[_0x2e00('0x2d')][_0x2e00('0x37')]({'where':{'id':_0x1269eb['params']['id']}})[_0x2e00('0x24')](handleEntityNotFound(_0x563517,null))['then'](removeEntity(_0x563517,null))['catch'](handleError(_0x563517,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index b666003..aee8f9f 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.model.js +++ b/server/api/chatProactiveAction/chatProactiveAction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x702a=['bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x23c7ec,_0x418530){var _0x53c95d=function(_0x13cc77){while(--_0x13cc77){_0x23c7ec['push'](_0x23c7ec['shift']());}};_0x53c95d(++_0x418530);}(_0x702a,0x98));var _0xa702=function(_0x1d1559,_0xd83e1a){_0x1d1559=_0x1d1559-0x0;var _0x5701df=_0x702a[_0x1d1559];return _0x5701df;};'use strict';var _=require(_0xa702('0x0'));var util=require(_0xa702('0x1'));var logger=require(_0xa702('0x2'))(_0xa702('0x3'));var moment=require('moment');var BPromise=require(_0xa702('0x4'));var rp=require(_0xa702('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa702('0x6'));var config=require(_0xa702('0x7'));var attributes=require(_0xa702('0x8'));module[_0xa702('0x9')]=function(_0x379b42,_0x2c78f7){return _0x379b42[_0xa702('0xa')]('ChatProactiveAction',attributes,{'tableName':_0xa702('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef34=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xef34,0x1d9));var _0x4ef3=function(_0xe094eb,_0x2d5eb5){_0xe094eb=_0xe094eb-0x0;var _0x6ef104=_0xef34[_0xe094eb];return _0x6ef104;};'use strict';var _=require(_0x4ef3('0x0'));var util=require(_0x4ef3('0x1'));var logger=require('../../config/logger')(_0x4ef3('0x2'));var moment=require(_0x4ef3('0x3'));var BPromise=require(_0x4ef3('0x4'));var rp=require(_0x4ef3('0x5'));var fs=require('fs');var path=require(_0x4ef3('0x6'));var rimraf=require(_0x4ef3('0x7'));var config=require(_0x4ef3('0x8'));var attributes=require(_0x4ef3('0x9'));module[_0x4ef3('0xa')]=function(_0xbafacd,_0x45ea46){return _0xbafacd[_0x4ef3('0xb')](_0x4ef3('0xc'),attributes,{'tableName':_0x4ef3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 8659152..9046916 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js +++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73da=['then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4fc398,_0x3eb069){var _0x48cc53=function(_0x166dbc){while(--_0x166dbc){_0x4fc398['push'](_0x4fc398['shift']());}};_0x48cc53(++_0x3eb069);}(_0x73da,0xf6));var _0xa73d=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0x73da[_0x286bfb];return _0x52b683;};'use strict';var _=require(_0xa73d('0x0'));var util=require(_0xa73d('0x1'));var moment=require(_0xa73d('0x2'));var BPromise=require(_0xa73d('0x3'));var rs=require(_0xa73d('0x4'));var fs=require('fs');var Redis=require(_0xa73d('0x5'));var db=require(_0xa73d('0x6'))['db'];var utils=require(_0xa73d('0x7'));var logger=require(_0xa73d('0x8'))(_0xa73d('0x9'));var config=require(_0xa73d('0xa'));var jayson=require(_0xa73d('0xb'));var client=jayson[_0xa73d('0xc')][_0xa73d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5d8cdb,_0x564ddb,_0x469cd3){return new BPromise(function(_0x35f34f,_0x320e10){return client['request'](_0x5d8cdb,_0x469cd3)[_0xa73d('0xe')](function(_0x503867){logger['info'](_0xa73d('0xf'),_0x564ddb,_0xa73d('0x10'));logger[_0xa73d('0x11')](_0xa73d('0x12'),_0x564ddb,'request\x20sent',JSON[_0xa73d('0x13')](_0x503867));if(_0x503867[_0xa73d('0x14')]){if(_0x503867[_0xa73d('0x14')][_0xa73d('0x15')]===0x1f4){logger[_0xa73d('0x14')](_0xa73d('0xf'),_0x564ddb,_0x503867[_0xa73d('0x14')][_0xa73d('0x16')]);return _0x320e10(_0x503867[_0xa73d('0x14')][_0xa73d('0x16')]);}logger[_0xa73d('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x564ddb,_0x503867[_0xa73d('0x14')][_0xa73d('0x16')]);return _0x35f34f(_0x503867[_0xa73d('0x14')][_0xa73d('0x16')]);}else{logger[_0xa73d('0x17')]('ChatProactiveAction,\x20%s,\x20%s',_0x564ddb,_0xa73d('0x10'));_0x35f34f(_0x503867[_0xa73d('0x18')][_0xa73d('0x16')]);}})[_0xa73d('0x19')](function(_0x5221d9){logger[_0xa73d('0x14')](_0xa73d('0xf'),_0x564ddb,_0x5221d9);_0x320e10(_0x5221d9);});});} \ No newline at end of file +var _0xb3cd=['ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x261d26,_0x21e1d7){var _0xfb6428=function(_0x213148){while(--_0x213148){_0x261d26['push'](_0x261d26['shift']());}};_0xfb6428(++_0x21e1d7);}(_0xb3cd,0xd0));var _0xdb3c=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xb3cd[_0x25a0b9];return _0x30b9ab;};'use strict';var _=require(_0xdb3c('0x0'));var util=require(_0xdb3c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdb3c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb3c('0x3'))['db'];var utils=require(_0xdb3c('0x4'));var logger=require(_0xdb3c('0x5'))(_0xdb3c('0x6'));var config=require(_0xdb3c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdb3c('0x8')][_0xdb3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33aab2,_0x3a1280,_0x255c5c){return new BPromise(function(_0xae035a,_0x5a8092){return client[_0xdb3c('0xa')](_0x33aab2,_0x255c5c)[_0xdb3c('0xb')](function(_0x1e132c){logger['info'](_0xdb3c('0xc'),_0x3a1280,_0xdb3c('0xd'));logger[_0xdb3c('0xe')](_0xdb3c('0xf'),_0x3a1280,_0xdb3c('0xd'),JSON['stringify'](_0x1e132c));if(_0x1e132c[_0xdb3c('0x10')]){if(_0x1e132c[_0xdb3c('0x10')][_0xdb3c('0x11')]===0x1f4){logger[_0xdb3c('0x10')](_0xdb3c('0xc'),_0x3a1280,_0x1e132c['error'][_0xdb3c('0x12')]);return _0x5a8092(_0x1e132c[_0xdb3c('0x10')][_0xdb3c('0x12')]);}logger[_0xdb3c('0x10')](_0xdb3c('0xc'),_0x3a1280,_0x1e132c[_0xdb3c('0x10')][_0xdb3c('0x12')]);return _0xae035a(_0x1e132c['error'][_0xdb3c('0x12')]);}else{logger[_0xdb3c('0x13')](_0xdb3c('0xc'),_0x3a1280,'request\x20sent');_0xae035a(_0x1e132c['result'][_0xdb3c('0x12')]);}})['catch'](function(_0x1565e9){logger[_0xdb3c('0x10')](_0xdb3c('0xc'),_0x3a1280,_0x1565e9);_0x5a8092(_0x1565e9);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 64bc030..e27369c 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x1a9f8b,_0x53ac1b){var _0x12a2c1=function(_0x1123fb){while(--_0x1123fb){_0x1a9f8b['push'](_0x1a9f8b['shift']());}};_0x12a2c1(++_0x53ac1b);}(_0x4819,0xcd));var _0x9481=function(_0x500aeb,_0x29fdba){_0x500aeb=_0x500aeb-0x0;var _0x5f3052=_0x4819[_0x500aeb];return _0x5f3052;};'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 fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router; \ No newline at end of file +var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x4490e8,_0x3fd1b2){var _0x41af10=function(_0x3c1cf2){while(--_0x3c1cf2){_0x4490e8['push'](_0x4490e8['shift']());}};_0x41af10(++_0x3fd1b2);}(_0xf494,0x1c6));var _0x4f49=function(_0x4b6b39,_0x547f83){_0x4b6b39=_0x4b6b39-0x0;var _0x5145df=_0xf494[_0x4b6b39];return _0x5145df;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 13dfbf0..71f7dad 100644 --- a/server/api/chatQueue/chatQueue.attributes.js +++ b/server/api/chatQueue/chatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2d1=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb2d1,0x1ce));var _0x1b2d=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xb2d1[_0x2f5a22];return _0x326b70;};'use strict';var Sequelize=require(_0x1b2d('0x0'));module[_0x1b2d('0x1')]={'name':{'type':Sequelize[_0x1b2d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1b2d('0x2')]},'timeout':{'type':Sequelize[_0x1b2d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1b2d('0x4')](_0x1b2d('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x5ade=['ENUM','rrmemory','beepall','sequelize','exports','name','STRING','INTEGER'];(function(_0x1ce7d3,_0x75e31b){var _0x1d651a=function(_0x5dd5b6){while(--_0x5dd5b6){_0x1ce7d3['push'](_0x1ce7d3['shift']());}};_0x1d651a(++_0x75e31b);}(_0x5ade,0xf3));var _0xe5ad=function(_0x33913d,_0x102307){_0x33913d=_0x33913d-0x0;var _0x439923=_0x5ade[_0x33913d];return _0x439923;};'use strict';var Sequelize=require(_0xe5ad('0x0'));module[_0xe5ad('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe5ad('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe5ad('0x3')]},'timeout':{'type':Sequelize[_0xe5ad('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe5ad('0x5')](_0xe5ad('0x6'),_0xe5ad('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 32df936..8e9746e 100644 --- a/server/api/chatQueue/chatQueue.controller.js +++ b/server/api/chatQueue/chatQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd0c=['fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','length','create','body','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','pick','ChatQueueId','map','options','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','chatPause','updatedAt','getTeams','Team','ids','User','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','./chatQueue.socket','jayson/promise','client','request','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','save','update','then','destroy','get','ChatQueues','UserProfileResource','stack','send','index','ChatQueue','rawAttributes','fieldName','key','name','query','filters','intersection','attributes','model'];(function(_0x3ddb4e,_0x5d9ecf){var _0x16202e=function(_0x505a25){while(--_0x505a25){_0x3ddb4e['push'](_0x3ddb4e['shift']());}};_0x16202e(++_0x5d9ecf);}(_0xfd0c,0x175));var _0xcfd0=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0xfd0c[_0x29ce14];return _0x48f289;};'use strict';var emlformat=require(_0xcfd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfd0('0x1'));var jsonpatch=require(_0xcfd0('0x2'));var rp=require(_0xcfd0('0x3'));var moment=require('moment');var BPromise=require(_0xcfd0('0x4'));var Mustache=require(_0xcfd0('0x5'));var util=require(_0xcfd0('0x6'));var path=require('path');var sox=require(_0xcfd0('0x7'));var csv=require(_0xcfd0('0x8'));var ejs=require(_0xcfd0('0x9'));var fs=require('fs');var fs_extra=require(_0xcfd0('0xa'));var _=require(_0xcfd0('0xb'));var squel=require(_0xcfd0('0xc'));var crypto=require(_0xcfd0('0xd'));var jsforce=require(_0xcfd0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcfd0('0x8'));var querystring=require(_0xcfd0('0xf'));var Papa=require(_0xcfd0('0x10'));var Redis=require('ioredis');var authService=require(_0xcfd0('0x11'));var qs=require(_0xcfd0('0x12'));var as=require(_0xcfd0('0x13'));var hardwareService=require(_0xcfd0('0x14'));var logger=require(_0xcfd0('0x15'))('api');var utils=require(_0xcfd0('0x16'));var config=require(_0xcfd0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcfd0('0x18'))['db'];config[_0xcfd0('0x19')]=_[_0xcfd0('0x1a')](config[_0xcfd0('0x19')],{'host':_0xcfd0('0x1b'),'port':0x18eb});var socket=require(_0xcfd0('0x1c'))(new Redis(config['redis']));require(_0xcfd0('0x1d'))['register'](socket);var jayson=require(_0xcfd0('0x1e'));var client=jayson[_0xcfd0('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20d22e,_0x2b2a2e,_0x553579,_0x906105){return new BPromise(function(_0x293bd0,_0x3072b5){var _0xe35899=_0x906105||client;return _0xe35899[_0xcfd0('0x20')](_0x20d22e,_0x553579)['then'](function(_0x508dea){logger['info'](_0xcfd0('0x21'),_0x2b2a2e,_0xcfd0('0x22'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2b2a2e,_0xcfd0('0x22'),JSON['stringify'](_0x508dea));if(_0x508dea['error']){if(_0x508dea[_0xcfd0('0x23')][_0xcfd0('0x24')]===0x1f4){logger[_0xcfd0('0x23')](_0xcfd0('0x21'),_0x2b2a2e,_0x508dea[_0xcfd0('0x23')]['message']);return _0x3072b5(_0x508dea[_0xcfd0('0x23')][_0xcfd0('0x25')]);}logger[_0xcfd0('0x23')](_0xcfd0('0x21'),_0x2b2a2e,_0x508dea['error'][_0xcfd0('0x25')]);return _0x293bd0(_0x508dea['error'][_0xcfd0('0x25')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2b2a2e,_0xcfd0('0x22'));_0x293bd0(_0x508dea['result'][_0xcfd0('0x25')]);}})[_0xcfd0('0x26')](function(_0x390664){logger[_0xcfd0('0x23')](_0xcfd0('0x21'),_0x2b2a2e,_0x390664);_0x3072b5(_0x390664);});});}function respondWithStatusCode(_0x584626,_0x134236){_0x134236=_0x134236||0xcc;return function(_0x14681f){if(_0x14681f){return _0x584626[_0xcfd0('0x27')](_0x134236);}return _0x584626[_0xcfd0('0x28')](_0x134236)[_0xcfd0('0x29')]();};}function respondWithResult(_0x206184,_0xeeac0c){_0xeeac0c=_0xeeac0c||0xc8;return function(_0x33dd1e){if(_0x33dd1e){return _0x206184[_0xcfd0('0x28')](_0xeeac0c)['json'](_0x33dd1e);}};}function respondWithFilteredResult(_0x4e8b62,_0x5e9049){return function(_0x5da8d0){if(_0x5da8d0){var _0xf1ea8f=typeof _0x5e9049['offset']===_0xcfd0('0x2a')&&typeof _0x5e9049[_0xcfd0('0x2b')]===_0xcfd0('0x2a');var _0xc801c1=_0x5da8d0[_0xcfd0('0x2c')];var _0xf17ead=_0xf1ea8f?0x0:_0x5e9049[_0xcfd0('0x2d')];var _0x38f9d6=_0xf1ea8f?_0x5da8d0[_0xcfd0('0x2c')]:_0x5e9049[_0xcfd0('0x2d')]+_0x5e9049[_0xcfd0('0x2b')];var _0x1aa753;if(_0x38f9d6>=_0xc801c1){_0x38f9d6=_0xc801c1;_0x1aa753=0xc8;}else{_0x1aa753=0xce;}_0x4e8b62[_0xcfd0('0x28')](_0x1aa753);return _0x4e8b62['set'](_0xcfd0('0x2e'),_0xf17ead+'-'+_0x38f9d6+'/'+_0xc801c1)[_0xcfd0('0x2f')](_0x5da8d0);}return null;};}function patchUpdates(_0x240103){return function(_0x15d81c){try{jsonpatch['apply'](_0x15d81c,_0x240103,!![]);}catch(_0x1047ff){return BPromise['reject'](_0x1047ff);}return _0x15d81c[_0xcfd0('0x30')]();};}function saveUpdates(_0x3fcc63,_0x4c228a){return function(_0x13fd53){if(_0x13fd53){return _0x13fd53[_0xcfd0('0x31')](_0x3fcc63)[_0xcfd0('0x32')](function(_0x552bc3){return _0x552bc3;});}return null;};}function removeEntity(_0x5c8ced,_0x2f5fb5){return function(_0x2885dd){if(_0x2885dd){return _0x2885dd[_0xcfd0('0x33')]()[_0xcfd0('0x32')](function(){var _0x597b05=_0x2885dd[_0xcfd0('0x34')]({'plain':!![]});var _0x4d7646=_0xcfd0('0x35');return db[_0xcfd0('0x36')]['destroy']({'where':{'type':_0x4d7646,'resourceId':_0x597b05['id']}})['then'](function(){return _0x2885dd;});})['then'](function(){_0x5c8ced[_0xcfd0('0x28')](0xcc)[_0xcfd0('0x29')]();});}};}function handleEntityNotFound(_0x48b619,_0x528fdb){return function(_0x34d5e3){if(!_0x34d5e3){_0x48b619['sendStatus'](0x194);}return _0x34d5e3;};}function handleError(_0x72ead1,_0x24ff00){_0x24ff00=_0x24ff00||0x1f4;return function(_0x53b10e){logger[_0xcfd0('0x23')](_0x53b10e[_0xcfd0('0x37')]);if(_0x53b10e['name']){delete _0x53b10e['name'];}_0x72ead1[_0xcfd0('0x28')](_0x24ff00)[_0xcfd0('0x38')](_0x53b10e);};}exports[_0xcfd0('0x39')]=function(_0x43864f,_0x13674c){var _0x3b3084={},_0x31489a={},_0x445e13={'count':0x0,'rows':[]};var _0x1076b4=_['map'](db[_0xcfd0('0x3a')][_0xcfd0('0x3b')],function(_0xcaebd6){return{'name':_0xcaebd6[_0xcfd0('0x3c')],'type':_0xcaebd6['type'][_0xcfd0('0x3d')]};});_0x31489a['model']=_['map'](_0x1076b4,_0xcfd0('0x3e'));_0x31489a[_0xcfd0('0x3f')]=_['keys'](_0x43864f[_0xcfd0('0x3f')]);_0x31489a[_0xcfd0('0x40')]=_[_0xcfd0('0x41')](_0x31489a['model'],_0x31489a[_0xcfd0('0x3f')]);_0x3b3084[_0xcfd0('0x42')]=_[_0xcfd0('0x41')](_0x31489a[_0xcfd0('0x43')],qs['fields'](_0x43864f[_0xcfd0('0x3f')][_0xcfd0('0x44')]));_0x3b3084[_0xcfd0('0x42')]=_0x3b3084['attributes']['length']?_0x3b3084[_0xcfd0('0x42')]:_0x31489a[_0xcfd0('0x43')];if(!_0x43864f[_0xcfd0('0x3f')][_0xcfd0('0x45')](_0xcfd0('0x46'))){_0x3b3084[_0xcfd0('0x2b')]=qs[_0xcfd0('0x2b')](_0x43864f[_0xcfd0('0x3f')]['limit']);_0x3b3084[_0xcfd0('0x2d')]=qs[_0xcfd0('0x2d')](_0x43864f['query'][_0xcfd0('0x2d')]);}_0x3b3084[_0xcfd0('0x47')]=qs[_0xcfd0('0x48')](_0x43864f[_0xcfd0('0x3f')][_0xcfd0('0x48')]);_0x3b3084[_0xcfd0('0x49')]=qs[_0xcfd0('0x40')](_['pick'](_0x43864f[_0xcfd0('0x3f')],_0x31489a[_0xcfd0('0x40')]),_0x1076b4);if(_0x43864f['query'][_0xcfd0('0x4a')]){_0x3b3084['where']=_[_0xcfd0('0x4b')](_0x3b3084[_0xcfd0('0x49')],{'$or':_['map'](_0x1076b4,function(_0x458f12){if(_0x458f12['type']!==_0xcfd0('0x4c')){var _0x21b76b={};_0x21b76b[_0x458f12['name']]={'$like':'%'+_0x43864f[_0xcfd0('0x3f')][_0xcfd0('0x4a')]+'%'};return _0x21b76b;}})});}_0x3b3084=_['merge']({},_0x3b3084,_0x43864f['options']);var _0x52fe6d={'where':_0x3b3084['where']};return db[_0xcfd0('0x3a')][_0xcfd0('0x2c')](_0x52fe6d)[_0xcfd0('0x32')](function(_0x499498){_0x445e13['count']=_0x499498;if(_0x43864f[_0xcfd0('0x3f')][_0xcfd0('0x4d')]){_0x3b3084[_0xcfd0('0x4e')]=[{'all':!![]}];}return db[_0xcfd0('0x3a')][_0xcfd0('0x4f')](_0x3b3084);})['then'](function(_0x292b4c){_0x445e13[_0xcfd0('0x50')]=_0x292b4c;return _0x445e13;})[_0xcfd0('0x32')](respondWithFilteredResult(_0x13674c,_0x3b3084))[_0xcfd0('0x26')](handleError(_0x13674c,null));};exports[_0xcfd0('0x51')]=function(_0x486a8c,_0x237680){var _0x5a1333={'raw':!![],'where':{'id':_0x486a8c['params']['id']}},_0x400aa6={};_0x400aa6[_0xcfd0('0x43')]=_['keys'](db[_0xcfd0('0x3a')]['rawAttributes']);_0x400aa6[_0xcfd0('0x3f')]=_[_0xcfd0('0x52')](_0x486a8c[_0xcfd0('0x3f')]);_0x400aa6[_0xcfd0('0x40')]=_[_0xcfd0('0x41')](_0x400aa6[_0xcfd0('0x43')],_0x400aa6[_0xcfd0('0x3f')]);_0x5a1333[_0xcfd0('0x42')]=_[_0xcfd0('0x41')](_0x400aa6['model'],qs[_0xcfd0('0x44')](_0x486a8c['query'][_0xcfd0('0x44')]));_0x5a1333[_0xcfd0('0x42')]=_0x5a1333[_0xcfd0('0x42')][_0xcfd0('0x53')]?_0x5a1333[_0xcfd0('0x42')]:_0x400aa6[_0xcfd0('0x43')];if(_0x486a8c[_0xcfd0('0x3f')][_0xcfd0('0x4d')]){_0x5a1333[_0xcfd0('0x4e')]=[{'all':!![]}];}_0x5a1333=_[_0xcfd0('0x4b')]({},_0x5a1333,_0x486a8c['options']);return db[_0xcfd0('0x3a')]['find'](_0x5a1333)[_0xcfd0('0x32')](handleEntityNotFound(_0x237680,null))[_0xcfd0('0x32')](respondWithResult(_0x237680,null))['catch'](handleError(_0x237680,null));};exports[_0xcfd0('0x54')]=function(_0x14ed82,_0x53b246){return db[_0xcfd0('0x3a')][_0xcfd0('0x54')](_0x14ed82[_0xcfd0('0x55')],{})[_0xcfd0('0x32')](function(_0x4e924e){var _0x414bb0=_0x14ed82[_0xcfd0('0x56')][_0xcfd0('0x34')]({'plain':!![]});if(!_0x414bb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x414bb0[_0xcfd0('0x57')]===_0xcfd0('0x56')){var _0x57a903=_0x4e924e[_0xcfd0('0x34')]({'plain':!![]});var _0x5e8641=_0xcfd0('0x35');return db[_0xcfd0('0x58')][_0xcfd0('0x59')]({'where':{'name':_0x5e8641,'userProfileId':_0x414bb0[_0xcfd0('0x5a')]},'raw':!![]})[_0xcfd0('0x32')](function(_0x2fa0a2){if(_0x2fa0a2&&_0x2fa0a2['autoAssociation']===0x0){return db[_0xcfd0('0x36')][_0xcfd0('0x54')]({'name':_0x57a903[_0xcfd0('0x3e')],'resourceId':_0x57a903['id'],'type':_0x2fa0a2[_0xcfd0('0x3e')],'sectionId':_0x2fa0a2['id']},{})[_0xcfd0('0x32')](function(){return _0x4e924e;});}else{return _0x4e924e;}})['catch'](function(_0x2777ab){logger[_0xcfd0('0x23')](_0xcfd0('0x5b'),_0x2777ab);throw _0x2777ab;});}return _0x4e924e;})[_0xcfd0('0x32')](respondWithResult(_0x53b246,0xc9))[_0xcfd0('0x26')](handleError(_0x53b246,null));};exports[_0xcfd0('0x31')]=function(_0x47f229,_0x53a299){if(_0x47f229[_0xcfd0('0x55')]['id']){delete _0x47f229['body']['id'];}return db['ChatQueue'][_0xcfd0('0x59')]({'where':{'id':_0x47f229[_0xcfd0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x53a299,null))['then'](saveUpdates(_0x47f229[_0xcfd0('0x55')],null))[_0xcfd0('0x32')](respondWithResult(_0x53a299,null))['catch'](handleError(_0x53a299,null));};exports[_0xcfd0('0x33')]=function(_0x2df1f0,_0x4874ed){return db[_0xcfd0('0x3a')][_0xcfd0('0x59')]({'where':{'id':_0x2df1f0['params']['id']}})[_0xcfd0('0x32')](handleEntityNotFound(_0x4874ed,null))[_0xcfd0('0x32')](removeEntity(_0x4874ed,null))['catch'](handleError(_0x4874ed,null));};exports[_0xcfd0('0x5d')]=function(_0x2e546f,_0x1a7d50){return db[_0xcfd0('0x3a')][_0xcfd0('0x5d')]()[_0xcfd0('0x32')](respondWithResult(_0x1a7d50,null))[_0xcfd0('0x26')](handleError(_0x1a7d50,null));};exports[_0xcfd0('0x5e')]=function(_0x2ed0d2,_0x48fb46,_0x306105){var _0x4f21ec={'raw':!![],'where':{}},_0x1d1e1d={},_0x10d8a4;return db[_0xcfd0('0x3a')][_0xcfd0('0x5f')]({'where':{'id':_0x2ed0d2[_0xcfd0('0x5c')]['id']}})[_0xcfd0('0x32')](handleEntityNotFound(_0x48fb46,null))[_0xcfd0('0x32')](function(_0xa2291d){if(_0xa2291d){_0x10d8a4=_0xa2291d[_0xcfd0('0x34')]({'plain':!![]});_0x1d1e1d[_0xcfd0('0x43')]=_['keys'](db[_0xcfd0('0x60')][_0xcfd0('0x3b')]);_0x1d1e1d[_0xcfd0('0x3f')]=_[_0xcfd0('0x52')](_0x2ed0d2['query']);_0x1d1e1d['filters']=_[_0xcfd0('0x41')](_0x1d1e1d['model'],_0x1d1e1d[_0xcfd0('0x3f')]);_0x4f21ec[_0xcfd0('0x42')]=_[_0xcfd0('0x41')](_0x1d1e1d[_0xcfd0('0x43')],qs[_0xcfd0('0x44')](_0x2ed0d2[_0xcfd0('0x3f')]['fields']));_0x4f21ec['attributes']=_0x4f21ec['attributes'][_0xcfd0('0x53')]?_0x4f21ec[_0xcfd0('0x42')]:_0x1d1e1d[_0xcfd0('0x43')];if(!_0x2ed0d2['query'][_0xcfd0('0x45')](_0xcfd0('0x46'))){_0x4f21ec[_0xcfd0('0x2b')]=qs[_0xcfd0('0x2b')](_0x2ed0d2[_0xcfd0('0x3f')][_0xcfd0('0x2b')]);_0x4f21ec['offset']=qs[_0xcfd0('0x2d')](_0x2ed0d2[_0xcfd0('0x3f')][_0xcfd0('0x2d')]);}_0x4f21ec['order']=qs[_0xcfd0('0x48')](_0x2ed0d2[_0xcfd0('0x3f')]['sort']);_0x4f21ec['where']=qs['filters'](_[_0xcfd0('0x61')](_0x2ed0d2[_0xcfd0('0x3f')],_0x1d1e1d[_0xcfd0('0x40')]));_0x4f21ec[_0xcfd0('0x49')][_0xcfd0('0x62')]=_0xa2291d['id'];if(_0x2ed0d2[_0xcfd0('0x3f')][_0xcfd0('0x4a')]){_0x4f21ec[_0xcfd0('0x49')]=_['merge'](_0x4f21ec[_0xcfd0('0x49')],{'$or':_[_0xcfd0('0x63')](_0x4f21ec[_0xcfd0('0x42')],function(_0xc17c3e){var _0x4a6e4b={};_0x4a6e4b[_0xc17c3e]={'$like':'%'+_0x2ed0d2['query'][_0xcfd0('0x4a')]+'%'};return _0x4a6e4b;})});}_0x4f21ec=_[_0xcfd0('0x4b')]({},_0x4f21ec,_0x2ed0d2[_0xcfd0('0x64')]);return db[_0xcfd0('0x60')][_0xcfd0('0x4f')](_0x4f21ec);}})['then'](function(_0x237143){if(_0x237143){return db['User'][_0xcfd0('0x65')]({'where':{'id':_[_0xcfd0('0x63')](_0x237143,_0xcfd0('0x66')),'role':_0xcfd0('0x67')},'attributes':['id',_0xcfd0('0x3e'),'chatPause','updatedAt',_0xcfd0('0x68')]});}})['then'](function(_0x534172){if(_0x534172){return{'count':_0x534172[_0xcfd0('0x2c')],'rows':_[_0xcfd0('0x63')](_0x534172[_0xcfd0('0x50')],function(_0x43c85e){return{'membername':_0x43c85e[_0xcfd0('0x3e')],'UserId':_0x43c85e['id'],'queue_name':_0x10d8a4[_0xcfd0('0x3e')],'ChatQueueId':_0x10d8a4['id'],'interface':util[_0xcfd0('0x69')](_0xcfd0('0x6a'),_0xcfd0('0x6b'),_0x43c85e[_0xcfd0('0x3e')]),'penalty':0x0,'paused':_0x43c85e[_0xcfd0('0x6c')],'createdAt':_0x43c85e[_0xcfd0('0x68')],'updatedAt':_0x43c85e[_0xcfd0('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcfd0('0x32')](respondWithFilteredResult(_0x48fb46,_0x4f21ec))[_0xcfd0('0x26')](handleError(_0x48fb46,null));};exports[_0xcfd0('0x6e')]=function(_0x34c0d3,_0x5deb80,_0x57f47f){var _0x311486={};var _0x47410c={};var _0x42da76;var _0x23d30f;return db[_0xcfd0('0x3a')][_0xcfd0('0x5f')]({'where':{'id':_0x34c0d3['params']['id']}})['then'](handleEntityNotFound(_0x5deb80,null))['then'](function(_0x714b76){if(_0x714b76){_0x42da76=_0x714b76;_0x47410c[_0xcfd0('0x43')]=_[_0xcfd0('0x52')](db[_0xcfd0('0x6f')][_0xcfd0('0x3b')]);_0x47410c[_0xcfd0('0x3f')]=_[_0xcfd0('0x52')](_0x34c0d3[_0xcfd0('0x3f')]);_0x47410c[_0xcfd0('0x40')]=_[_0xcfd0('0x41')](_0x47410c['model'],_0x47410c[_0xcfd0('0x3f')]);_0x311486['attributes']=_[_0xcfd0('0x41')](_0x47410c[_0xcfd0('0x43')],qs[_0xcfd0('0x44')](_0x34c0d3['query']['fields']));_0x311486[_0xcfd0('0x42')]=_0x311486[_0xcfd0('0x42')]['length']?_0x311486[_0xcfd0('0x42')]:_0x47410c[_0xcfd0('0x43')];_0x311486[_0xcfd0('0x47')]=qs[_0xcfd0('0x48')](_0x34c0d3['query'][_0xcfd0('0x48')]);_0x311486[_0xcfd0('0x49')]=qs[_0xcfd0('0x40')](_[_0xcfd0('0x61')](_0x34c0d3['query'],_0x47410c['filters']));if(_0x34c0d3[_0xcfd0('0x3f')][_0xcfd0('0x4a')]){_0x311486[_0xcfd0('0x49')]=_[_0xcfd0('0x4b')](_0x311486['where'],{'$or':_['map'](_0x311486[_0xcfd0('0x42')],function(_0x2fe173){var _0xacaccc={};_0xacaccc[_0x2fe173]={'$like':'%'+_0x34c0d3['query'][_0xcfd0('0x4a')]+'%'};return _0xacaccc;})});}_0x311486=_[_0xcfd0('0x4b')]({},_0x311486,_0x34c0d3['options']);return _0x42da76[_0xcfd0('0x6e')](_0x311486);}})[_0xcfd0('0x32')](function(_0x285cb2){if(_0x285cb2){_0x23d30f=_0x285cb2[_0xcfd0('0x53')];if(!_0x34c0d3['query']['hasOwnProperty'](_0xcfd0('0x46'))){_0x311486[_0xcfd0('0x2b')]=qs['limit'](_0x34c0d3['query']['limit']);_0x311486[_0xcfd0('0x2d')]=qs[_0xcfd0('0x2d')](_0x34c0d3[_0xcfd0('0x3f')][_0xcfd0('0x2d')]);}return _0x42da76[_0xcfd0('0x6e')](_0x311486);}})[_0xcfd0('0x32')](function(_0x4060b2){if(_0x4060b2){return _0x4060b2?{'count':_0x23d30f,'rows':_0x4060b2}:null;}})['then'](respondWithResult(_0x5deb80,null))[_0xcfd0('0x26')](handleError(_0x5deb80,null));};exports['addTeams']=function(_0x50927a,_0xdecd4a,_0x29136a){var _0xcc53c4=_0x50927a['body'][_0xcfd0('0x70')];return db[_0xcfd0('0x6f')][_0xcfd0('0x4f')]({'where':{'id':_0xcc53c4},'attributes':['id'],'include':[{'model':db[_0xcfd0('0x71')],'as':_0xcfd0('0x72'),'attributes':['id','name','online',_0xcfd0('0x73'),'interface'],'raw':!![]}]})['then'](function(_0x18b9bc){if(_0x18b9bc){var _0x871c9f=_[_0xcfd0('0x74')](_0x18b9bc,function(_0x32b14f){var _0x123e7c=_0x32b14f[_0xcfd0('0x34')]({'plain':!![]});return _0x123e7c['Agents'];});return db[_0xcfd0('0x3a')][_0xcfd0('0x59')]({'where':{'id':_0x50927a[_0xcfd0('0x5c')]['id']}})[_0xcfd0('0x32')](function(_0x12fc78){return db[_0xcfd0('0x75')][_0xcfd0('0x76')](function(_0x61ce64){return _0x12fc78['addTeams'](_0xcc53c4,{'transaction':_0x61ce64})[_0xcfd0('0x32')](function(){return BPromise[_0xcfd0('0x77')](_0x871c9f,function(_0x6c7add){return db[_0xcfd0('0x60')][_0xcfd0('0x78')]({'where':{'UserId':_0x6c7add['id'],'ChatQueueId':_0x50927a[_0xcfd0('0x5c')]['id']},'transaction':_0x61ce64});});})[_0xcfd0('0x32')](function(){_0x871c9f[_0xcfd0('0x79')](function(_0x22f2c6){socket['emit'](_0xcfd0('0x7a'),{'UserId':_0x22f2c6['id'],'ChatQueueId':_0x12fc78['id']});});});});});}})[_0xcfd0('0x32')](respondWithStatusCode(_0xdecd4a,null))['catch'](handleError(_0xdecd4a,null));};exports[_0xcfd0('0x7b')]=function(_0x4e0e98,_0x20df22,_0x230238){return db[_0xcfd0('0x6f')]['findAll']({'where':{'id':_0x4e0e98[_0xcfd0('0x3f')][_0xcfd0('0x70')]},'attributes':['id'],'include':[{'model':db[_0xcfd0('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xcfd0('0x32')](handleEntityNotFound(_0x20df22,null))[_0xcfd0('0x32')](function(_0x5a85a0){var _0x453c04=_[_0xcfd0('0x63')](_0x5a85a0,'id');var _0x3df06b=[];var _0x18b878=[];var _0x3011d4=squel[_0xcfd0('0x7c')]();_0x3011d4[_0xcfd0('0x7d')](_0xcfd0('0x7e'))['from']('team_has_chat_queues','tq')[_0xcfd0('0x7f')](_0xcfd0('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x4e0e98[_0xcfd0('0x5c')]['id']);for(var _0x3303fd=0x0;_0x3303fd<_0x5a85a0[_0xcfd0('0x53')];_0x3303fd+=0x1){let _0x2437eb=_0x5a85a0[_0x3303fd];for(var _0x5bfb15=0x0;_0x5bfb15<_0x2437eb[_0xcfd0('0x72')][_0xcfd0('0x53')];_0x5bfb15+=0x1){let _0x1483c0=_0x2437eb[_0xcfd0('0x72')][_0x5bfb15];var _0x554370=_0x3011d4[_0xcfd0('0x81')]();_0x554370[_0xcfd0('0x49')](_0xcfd0('0x82'),_0x1483c0['id']);_0x18b878[_0xcfd0('0x83')](db['sequelize'][_0xcfd0('0x3f')](_0x554370['toString'](),{'type':db['sequelize'][_0xcfd0('0x84')][_0xcfd0('0x85')]})[_0xcfd0('0x32')](function(_0x10ffec){if(_0x10ffec[_0xcfd0('0x53')]===0x1){return _0x1483c0['id'];}else{var _0x10250c=_['every'](_[_0xcfd0('0x63')](_0x10ffec,_0xcfd0('0x86')),function(_0x475f78){return _[_0xcfd0('0x87')](_0x453c04,_0x475f78);});if(_0x10250c){return _0x1483c0['id'];}}}));}}return BPromise['all'](_0x18b878)[_0xcfd0('0x32')](function(_0x2f7489){_0x3df06b=_(_0x3df06b)[_0xcfd0('0x88')](_0x2f7489)[_0xcfd0('0x89')]()[_0xcfd0('0x8a')]();return db[_0xcfd0('0x3a')][_0xcfd0('0x59')]({'where':{'id':_0x4e0e98[_0xcfd0('0x5c')]['id']}})[_0xcfd0('0x32')](function(_0x2e0196){return db[_0xcfd0('0x75')]['transaction'](function(_0x9ce011){return _0x2e0196[_0xcfd0('0x7b')](_0x4e0e98[_0xcfd0('0x3f')][_0xcfd0('0x70')],{'transaction':_0x9ce011})['then'](function(){if(!_[_0xcfd0('0x8b')](_0x3df06b)){return _0x2e0196[_0xcfd0('0x8c')](_0x3df06b,{'transaction':_0x9ce011});}})[_0xcfd0('0x32')](function(){_0x3df06b['forEach'](function(_0x14d181){socket[_0xcfd0('0x8d')](_0xcfd0('0x8e'),{'UserId':_0x14d181,'ChatQueueId':_0x2e0196['id']});});});});});});})[_0xcfd0('0x32')](respondWithStatusCode(_0x20df22,null))[_0xcfd0('0x26')](handleError(_0x20df22,null));};exports['addAgents']=function(_0x2e281e,_0x4a9501,_0x2e11c3){return db[_0xcfd0('0x3a')]['find']({'where':{'id':_0x2e281e['params']['id']}})[_0xcfd0('0x32')](handleEntityNotFound(_0x4a9501,null))['then'](function(_0x5b5145){if(_0x5b5145){return _0x5b5145['addAgents'](_0x2e281e['body'][_0xcfd0('0x70')],_[_0xcfd0('0x8f')](_0x2e281e[_0xcfd0('0x55')],[_0xcfd0('0x70'),'id'])||{})[_0xcfd0('0x90')](function(_0x525960){for(var _0x1bae75=0x0;_0x1bae75<_0x2e281e[_0xcfd0('0x55')][_0xcfd0('0x70')][_0xcfd0('0x53')];_0x1bae75+=0x1){socket['emit'](_0xcfd0('0x7a'),{'UserId':Number(_0x2e281e[_0xcfd0('0x55')][_0xcfd0('0x70')][_0x1bae75]),'ChatQueueId':Number(_0x2e281e[_0xcfd0('0x5c')]['id'])});}return _0x525960;});}})[_0xcfd0('0x32')](respondWithResult(_0x4a9501,null))[_0xcfd0('0x26')](handleError(_0x4a9501,null));};exports[_0xcfd0('0x8c')]=function(_0xcbb27,_0x969039,_0x2c2314){return db['ChatQueue'][_0xcfd0('0x59')]({'where':{'id':_0xcbb27[_0xcfd0('0x5c')]['id']}})[_0xcfd0('0x32')](handleEntityNotFound(_0x969039,null))[_0xcfd0('0x32')](function(_0x4f6229){if(_0x4f6229){return _0x4f6229[_0xcfd0('0x8c')](_0xcbb27[_0xcfd0('0x3f')]['ids'])[_0xcfd0('0x32')](function(){if(_[_0xcfd0('0x91')](_0xcbb27[_0xcfd0('0x3f')][_0xcfd0('0x70')])){for(var _0x4c0871=0x0;_0x4c0871<_0xcbb27[_0xcfd0('0x3f')][_0xcfd0('0x70')]['length'];_0x4c0871+=0x1){socket['emit'](_0xcfd0('0x8e'),{'UserId':Number(_0xcbb27[_0xcfd0('0x3f')][_0xcfd0('0x70')][_0x4c0871]),'ChatQueueId':Number(_0xcbb27[_0xcfd0('0x5c')]['id'])});}}else{socket['emit'](_0xcfd0('0x8e'),{'UserId':Number(_0xcbb27[_0xcfd0('0x3f')][_0xcfd0('0x70')]),'ChatQueueId':Number(_0xcbb27[_0xcfd0('0x5c')]['id'])});}});}})[_0xcfd0('0x32')](respondWithStatusCode(_0x969039,null))['catch'](handleError(_0x969039,null));};exports[_0xcfd0('0x92')]=function(_0x1d86f9,_0x453904,_0x2e0535){var _0x4f34be={};var _0x36b889={};var _0x484073;var _0x26b632;return db['ChatQueue'][_0xcfd0('0x5f')]({'where':{'id':_0x1d86f9['params']['id']}})[_0xcfd0('0x32')](handleEntityNotFound(_0x453904,null))[_0xcfd0('0x32')](function(_0x1d334a){if(_0x1d334a){_0x484073=_0x1d334a;_0x36b889['model']=_[_0xcfd0('0x52')](db['User'][_0xcfd0('0x3b')]);_0x36b889[_0xcfd0('0x3f')]=_[_0xcfd0('0x52')](_0x1d86f9[_0xcfd0('0x3f')]);_0x36b889[_0xcfd0('0x40')]=_[_0xcfd0('0x41')](_0x36b889['model'],_0x36b889[_0xcfd0('0x3f')]);_0x4f34be[_0xcfd0('0x42')]=_[_0xcfd0('0x41')](_0x36b889['model'],qs['fields'](_0x1d86f9[_0xcfd0('0x3f')][_0xcfd0('0x44')]));_0x4f34be[_0xcfd0('0x42')]=_0x4f34be['attributes'][_0xcfd0('0x53')]?_0x4f34be[_0xcfd0('0x42')]:_0x36b889[_0xcfd0('0x43')];_0x4f34be[_0xcfd0('0x47')]=qs['sort'](_0x1d86f9['query'][_0xcfd0('0x48')]);_0x4f34be[_0xcfd0('0x49')]=qs[_0xcfd0('0x40')](_['pick'](_0x1d86f9[_0xcfd0('0x3f')],_0x36b889[_0xcfd0('0x40')]));if(_0x1d86f9[_0xcfd0('0x3f')][_0xcfd0('0x4a')]){_0x4f34be[_0xcfd0('0x49')]=_[_0xcfd0('0x4b')](_0x4f34be[_0xcfd0('0x49')],{'$or':_['map'](_0x4f34be['attributes'],function(_0x9ca30e){var _0x524ea0={};_0x524ea0[_0x9ca30e]={'$like':'%'+_0x1d86f9[_0xcfd0('0x3f')][_0xcfd0('0x4a')]+'%'};return _0x524ea0;})});}_0x4f34be=_[_0xcfd0('0x4b')]({},_0x4f34be,_0x1d86f9[_0xcfd0('0x64')]);return _0x484073[_0xcfd0('0x92')](_0x4f34be);}})[_0xcfd0('0x32')](function(_0x52aee6){if(_0x52aee6){_0x26b632=_0x52aee6[_0xcfd0('0x53')];if(!_0x1d86f9['query'][_0xcfd0('0x45')]('nolimit')){_0x4f34be[_0xcfd0('0x2b')]=qs[_0xcfd0('0x2b')](_0x1d86f9['query']['limit']);_0x4f34be[_0xcfd0('0x2d')]=qs[_0xcfd0('0x2d')](_0x1d86f9[_0xcfd0('0x3f')]['offset']);}return _0x484073[_0xcfd0('0x92')](_0x4f34be);}})[_0xcfd0('0x32')](function(_0x115dea){if(_0x115dea){return _0x115dea?{'count':_0x26b632,'rows':_0x115dea}:null;}})[_0xcfd0('0x32')](respondWithResult(_0x453904,null))['catch'](handleError(_0x453904,null));}; \ No newline at end of file +var _0x7536=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','pick','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','ids','online','voicePause','interface','sequelize','addTeams','each','findOrCreate','forEach','emit','Agents','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeTeams','isEmpty','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update','get','ChatQueues','destroy','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','rows','catch','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x1be5aa,_0x42fefb){var _0x8848c1=function(_0x466706){while(--_0x466706){_0x1be5aa['push'](_0x1be5aa['shift']());}};_0x8848c1(++_0x42fefb);}(_0x7536,0xdf));var _0x6753=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x7536[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6753('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6753('0x1'));var moment=require(_0x6753('0x2'));var BPromise=require(_0x6753('0x3'));var Mustache=require(_0x6753('0x4'));var util=require(_0x6753('0x5'));var path=require(_0x6753('0x6'));var sox=require(_0x6753('0x7'));var csv=require(_0x6753('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6753('0x9'));var _=require(_0x6753('0xa'));var squel=require(_0x6753('0xb'));var crypto=require(_0x6753('0xc'));var jsforce=require(_0x6753('0xd'));var deskjs=require(_0x6753('0xe'));var toCsv=require(_0x6753('0x8'));var querystring=require(_0x6753('0xf'));var Papa=require(_0x6753('0x10'));var Redis=require(_0x6753('0x11'));var authService=require(_0x6753('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6753('0x13'));var hardwareService=require(_0x6753('0x14'));var logger=require(_0x6753('0x15'))('api');var utils=require(_0x6753('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6753('0x17'))['db'];config[_0x6753('0x18')]=_[_0x6753('0x19')](config[_0x6753('0x18')],{'host':_0x6753('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6753('0x1b'))[_0x6753('0x1c')](socket);var jayson=require(_0x6753('0x1d'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2406ab,_0x5d9b82,_0x2eb20a,_0x4e16f7){return new BPromise(function(_0x488737,_0x12f50c){var _0x2830ba=_0x4e16f7||client;return _0x2830ba[_0x6753('0x1e')](_0x2406ab,_0x2eb20a)[_0x6753('0x1f')](function(_0x38cbff){logger[_0x6753('0x20')](_0x6753('0x21'),_0x5d9b82,'request\x20sent');logger[_0x6753('0x22')](_0x6753('0x23'),_0x5d9b82,_0x6753('0x24'),JSON[_0x6753('0x25')](_0x38cbff));if(_0x38cbff[_0x6753('0x26')]){if(_0x38cbff[_0x6753('0x26')][_0x6753('0x27')]===0x1f4){logger[_0x6753('0x26')](_0x6753('0x21'),_0x5d9b82,_0x38cbff['error']['message']);return _0x12f50c(_0x38cbff[_0x6753('0x26')][_0x6753('0x28')]);}logger['error'](_0x6753('0x21'),_0x5d9b82,_0x38cbff['error'][_0x6753('0x28')]);return _0x488737(_0x38cbff[_0x6753('0x26')][_0x6753('0x28')]);}else{logger[_0x6753('0x20')](_0x6753('0x21'),_0x5d9b82,_0x6753('0x24'));_0x488737(_0x38cbff[_0x6753('0x29')]['message']);}})['catch'](function(_0x40be8d){logger[_0x6753('0x26')](_0x6753('0x21'),_0x5d9b82,_0x40be8d);_0x12f50c(_0x40be8d);});});}function respondWithStatusCode(_0x5a0497,_0x401844){_0x401844=_0x401844||0xcc;return function(_0x3b08b7){if(_0x3b08b7){return _0x5a0497[_0x6753('0x2a')](_0x401844);}return _0x5a0497[_0x6753('0x2b')](_0x401844)[_0x6753('0x2c')]();};}function respondWithResult(_0x223dd9,_0x391e18){_0x391e18=_0x391e18||0xc8;return function(_0xd95ea1){if(_0xd95ea1){return _0x223dd9[_0x6753('0x2b')](_0x391e18)[_0x6753('0x2d')](_0xd95ea1);}};}function respondWithFilteredResult(_0x4e1179,_0x410552){return function(_0x4652ca){if(_0x4652ca){var _0x2af936=typeof _0x410552[_0x6753('0x2e')]===_0x6753('0x2f')&&typeof _0x410552['limit']===_0x6753('0x2f');var _0x54fe33=_0x4652ca[_0x6753('0x30')];var _0x1b74d5=_0x2af936?0x0:_0x410552[_0x6753('0x2e')];var _0x5024a4=_0x2af936?_0x4652ca['count']:_0x410552[_0x6753('0x2e')]+_0x410552[_0x6753('0x31')];var _0xc8bbf;if(_0x5024a4>=_0x54fe33){_0x5024a4=_0x54fe33;_0xc8bbf=0xc8;}else{_0xc8bbf=0xce;}_0x4e1179['status'](_0xc8bbf);return _0x4e1179['set'](_0x6753('0x32'),_0x1b74d5+'-'+_0x5024a4+'/'+_0x54fe33)[_0x6753('0x2d')](_0x4652ca);}return null;};}function patchUpdates(_0x28331c){return function(_0xdec56f){try{jsonpatch['apply'](_0xdec56f,_0x28331c,!![]);}catch(_0x44465f){return BPromise['reject'](_0x44465f);}return _0xdec56f[_0x6753('0x33')]();};}function saveUpdates(_0x349a8f,_0x8d8524){return function(_0xb98c4){if(_0xb98c4){return _0xb98c4[_0x6753('0x34')](_0x349a8f)[_0x6753('0x1f')](function(_0xf91db9){return _0xf91db9;});}return null;};}function removeEntity(_0x3b2391,_0x5ee2a7){return function(_0xe10585){if(_0xe10585){return _0xe10585['destroy']()['then'](function(){var _0x1bad76=_0xe10585[_0x6753('0x35')]({'plain':!![]});var _0x57f1d8=_0x6753('0x36');return db['UserProfileResource'][_0x6753('0x37')]({'where':{'type':_0x57f1d8,'resourceId':_0x1bad76['id']}})['then'](function(){return _0xe10585;});})[_0x6753('0x1f')](function(){_0x3b2391[_0x6753('0x2b')](0xcc)[_0x6753('0x2c')]();});}};}function handleEntityNotFound(_0x3e4581,_0x58867a){return function(_0x59840b){if(!_0x59840b){_0x3e4581['sendStatus'](0x194);}return _0x59840b;};}function handleError(_0x2e49b5,_0x268b2b){_0x268b2b=_0x268b2b||0x1f4;return function(_0x198123){logger[_0x6753('0x26')](_0x198123[_0x6753('0x38')]);if(_0x198123[_0x6753('0x39')]){delete _0x198123[_0x6753('0x39')];}_0x2e49b5[_0x6753('0x2b')](_0x268b2b)[_0x6753('0x3a')](_0x198123);};}exports[_0x6753('0x3b')]=function(_0x14d991,_0x20da21){var _0x4ccc84={},_0x1357a8={},_0x1d766b={'count':0x0,'rows':[]};var _0x23f7ca=_['map'](db[_0x6753('0x3c')][_0x6753('0x3d')],function(_0x438fe3){return{'name':_0x438fe3[_0x6753('0x3e')],'type':_0x438fe3[_0x6753('0x3f')][_0x6753('0x40')]};});_0x1357a8[_0x6753('0x41')]=_['map'](_0x23f7ca,_0x6753('0x39'));_0x1357a8[_0x6753('0x42')]=_['keys'](_0x14d991[_0x6753('0x42')]);_0x1357a8['filters']=_[_0x6753('0x43')](_0x1357a8[_0x6753('0x41')],_0x1357a8[_0x6753('0x42')]);_0x4ccc84[_0x6753('0x44')]=_[_0x6753('0x43')](_0x1357a8[_0x6753('0x41')],qs[_0x6753('0x45')](_0x14d991[_0x6753('0x42')]['fields']));_0x4ccc84[_0x6753('0x44')]=_0x4ccc84[_0x6753('0x44')][_0x6753('0x46')]?_0x4ccc84[_0x6753('0x44')]:_0x1357a8['model'];if(!_0x14d991['query'][_0x6753('0x47')](_0x6753('0x48'))){_0x4ccc84[_0x6753('0x31')]=qs['limit'](_0x14d991[_0x6753('0x42')][_0x6753('0x31')]);_0x4ccc84['offset']=qs[_0x6753('0x2e')](_0x14d991[_0x6753('0x42')]['offset']);}_0x4ccc84[_0x6753('0x49')]=qs['sort'](_0x14d991[_0x6753('0x42')][_0x6753('0x4a')]);_0x4ccc84[_0x6753('0x4b')]=qs[_0x6753('0x4c')](_['pick'](_0x14d991[_0x6753('0x42')],_0x1357a8['filters']),_0x23f7ca);if(_0x14d991[_0x6753('0x42')][_0x6753('0x4d')]){_0x4ccc84[_0x6753('0x4b')]=_[_0x6753('0x4e')](_0x4ccc84[_0x6753('0x4b')],{'$or':_[_0x6753('0x4f')](_0x23f7ca,function(_0x4c1cd8){if(_0x4c1cd8[_0x6753('0x3f')]!==_0x6753('0x50')){var _0x39927b={};_0x39927b[_0x4c1cd8[_0x6753('0x39')]]={'$like':'%'+_0x14d991[_0x6753('0x42')]['filter']+'%'};return _0x39927b;}})});}_0x4ccc84=_['merge']({},_0x4ccc84,_0x14d991[_0x6753('0x51')]);var _0x463e87={'where':_0x4ccc84[_0x6753('0x4b')]};return db[_0x6753('0x3c')][_0x6753('0x30')](_0x463e87)['then'](function(_0x354873){_0x1d766b[_0x6753('0x30')]=_0x354873;if(_0x14d991['query'][_0x6753('0x52')]){_0x4ccc84['include']=[{'all':!![]}];}return db[_0x6753('0x3c')]['findAll'](_0x4ccc84);})[_0x6753('0x1f')](function(_0x1feaab){_0x1d766b[_0x6753('0x53')]=_0x1feaab;return _0x1d766b;})['then'](respondWithFilteredResult(_0x20da21,_0x4ccc84))[_0x6753('0x54')](handleError(_0x20da21,null));};exports['show']=function(_0x41a117,_0x31e641){var _0x544026={'raw':!![],'where':{'id':_0x41a117[_0x6753('0x55')]['id']}},_0x4d1ad7={};_0x4d1ad7[_0x6753('0x41')]=_[_0x6753('0x56')](db[_0x6753('0x3c')]['rawAttributes']);_0x4d1ad7['query']=_[_0x6753('0x56')](_0x41a117['query']);_0x4d1ad7[_0x6753('0x4c')]=_[_0x6753('0x43')](_0x4d1ad7[_0x6753('0x41')],_0x4d1ad7['query']);_0x544026[_0x6753('0x44')]=_['intersection'](_0x4d1ad7['model'],qs['fields'](_0x41a117[_0x6753('0x42')][_0x6753('0x45')]));_0x544026['attributes']=_0x544026['attributes'][_0x6753('0x46')]?_0x544026[_0x6753('0x44')]:_0x4d1ad7[_0x6753('0x41')];if(_0x41a117[_0x6753('0x42')][_0x6753('0x52')]){_0x544026[_0x6753('0x57')]=[{'all':!![]}];}_0x544026=_['merge']({},_0x544026,_0x41a117[_0x6753('0x51')]);return db[_0x6753('0x3c')][_0x6753('0x58')](_0x544026)[_0x6753('0x1f')](handleEntityNotFound(_0x31e641,null))[_0x6753('0x1f')](respondWithResult(_0x31e641,null))['catch'](handleError(_0x31e641,null));};exports[_0x6753('0x59')]=function(_0x86b448,_0x17a82b){return db[_0x6753('0x3c')]['create'](_0x86b448[_0x6753('0x5a')],{})['then'](function(_0x5e2345){var _0x3b2f35=_0x86b448[_0x6753('0x5b')][_0x6753('0x35')]({'plain':!![]});if(!_0x3b2f35)throw new Error(_0x6753('0x5c'));if(_0x3b2f35[_0x6753('0x5d')]===_0x6753('0x5b')){var _0x3d0314=_0x5e2345[_0x6753('0x35')]({'plain':!![]});var _0x3c9291=_0x6753('0x36');return db[_0x6753('0x5e')][_0x6753('0x58')]({'where':{'name':_0x3c9291,'userProfileId':_0x3b2f35['userProfileId']},'raw':!![]})['then'](function(_0x2b350a){if(_0x2b350a&&_0x2b350a[_0x6753('0x5f')]===0x0){return db[_0x6753('0x60')][_0x6753('0x59')]({'name':_0x3d0314[_0x6753('0x39')],'resourceId':_0x3d0314['id'],'type':_0x2b350a[_0x6753('0x39')],'sectionId':_0x2b350a['id']},{})[_0x6753('0x1f')](function(){return _0x5e2345;});}else{return _0x5e2345;}})['catch'](function(_0x36dce6){logger[_0x6753('0x26')](_0x6753('0x61'),_0x36dce6);throw _0x36dce6;});}return _0x5e2345;})[_0x6753('0x1f')](respondWithResult(_0x17a82b,0xc9))[_0x6753('0x54')](handleError(_0x17a82b,null));};exports[_0x6753('0x34')]=function(_0xa090bf,_0x3f127a){if(_0xa090bf['body']['id']){delete _0xa090bf[_0x6753('0x5a')]['id'];}return db['ChatQueue'][_0x6753('0x58')]({'where':{'id':_0xa090bf['params']['id']}})['then'](handleEntityNotFound(_0x3f127a,null))[_0x6753('0x1f')](saveUpdates(_0xa090bf[_0x6753('0x5a')],null))[_0x6753('0x1f')](respondWithResult(_0x3f127a,null))[_0x6753('0x54')](handleError(_0x3f127a,null));};exports['destroy']=function(_0x2a7e14,_0x17dfba){return db[_0x6753('0x3c')][_0x6753('0x58')]({'where':{'id':_0x2a7e14[_0x6753('0x55')]['id']}})['then'](handleEntityNotFound(_0x17dfba,null))[_0x6753('0x1f')](removeEntity(_0x17dfba,null))[_0x6753('0x54')](handleError(_0x17dfba,null));};exports['describe']=function(_0x35de06,_0x2d3267){return db[_0x6753('0x3c')][_0x6753('0x62')]()[_0x6753('0x1f')](respondWithResult(_0x2d3267,null))[_0x6753('0x54')](handleError(_0x2d3267,null));};exports[_0x6753('0x63')]=function(_0x57b8ce,_0x464d7e,_0x1a3f26){var _0x3ad93d={'raw':!![],'where':{}},_0x494b91={},_0x5214a0;return db[_0x6753('0x3c')][_0x6753('0x64')]({'where':{'id':_0x57b8ce[_0x6753('0x55')]['id']}})[_0x6753('0x1f')](handleEntityNotFound(_0x464d7e,null))['then'](function(_0x2d28a8){if(_0x2d28a8){_0x5214a0=_0x2d28a8[_0x6753('0x35')]({'plain':!![]});_0x494b91[_0x6753('0x41')]=_[_0x6753('0x56')](db[_0x6753('0x65')][_0x6753('0x3d')]);_0x494b91['query']=_[_0x6753('0x56')](_0x57b8ce[_0x6753('0x42')]);_0x494b91[_0x6753('0x4c')]=_[_0x6753('0x43')](_0x494b91['model'],_0x494b91[_0x6753('0x42')]);_0x3ad93d[_0x6753('0x44')]=_[_0x6753('0x43')](_0x494b91['model'],qs[_0x6753('0x45')](_0x57b8ce[_0x6753('0x42')][_0x6753('0x45')]));_0x3ad93d[_0x6753('0x44')]=_0x3ad93d[_0x6753('0x44')][_0x6753('0x46')]?_0x3ad93d[_0x6753('0x44')]:_0x494b91[_0x6753('0x41')];if(!_0x57b8ce[_0x6753('0x42')][_0x6753('0x47')]('nolimit')){_0x3ad93d[_0x6753('0x31')]=qs[_0x6753('0x31')](_0x57b8ce[_0x6753('0x42')][_0x6753('0x31')]);_0x3ad93d['offset']=qs[_0x6753('0x2e')](_0x57b8ce[_0x6753('0x42')][_0x6753('0x2e')]);}_0x3ad93d[_0x6753('0x49')]=qs['sort'](_0x57b8ce['query'][_0x6753('0x4a')]);_0x3ad93d[_0x6753('0x4b')]=qs['filters'](_[_0x6753('0x66')](_0x57b8ce['query'],_0x494b91[_0x6753('0x4c')]));_0x3ad93d[_0x6753('0x4b')][_0x6753('0x67')]=_0x2d28a8['id'];if(_0x57b8ce[_0x6753('0x42')][_0x6753('0x4d')]){_0x3ad93d[_0x6753('0x4b')]=_[_0x6753('0x4e')](_0x3ad93d[_0x6753('0x4b')],{'$or':_[_0x6753('0x4f')](_0x3ad93d[_0x6753('0x44')],function(_0x505461){var _0x52180c={};_0x52180c[_0x505461]={'$like':'%'+_0x57b8ce[_0x6753('0x42')]['filter']+'%'};return _0x52180c;})});}_0x3ad93d=_['merge']({},_0x3ad93d,_0x57b8ce[_0x6753('0x51')]);return db['UserChatQueue'][_0x6753('0x68')](_0x3ad93d);}})[_0x6753('0x1f')](function(_0x557a8f){if(_0x557a8f){return db[_0x6753('0x69')][_0x6753('0x6a')]({'where':{'id':_[_0x6753('0x4f')](_0x557a8f,_0x6753('0x6b')),'role':_0x6753('0x6c')},'attributes':['id',_0x6753('0x39'),_0x6753('0x6d'),_0x6753('0x6e'),'createdAt']});}})[_0x6753('0x1f')](function(_0x423b60){if(_0x423b60){return{'count':_0x423b60[_0x6753('0x30')],'rows':_[_0x6753('0x4f')](_0x423b60[_0x6753('0x53')],function(_0x1246f8){return{'membername':_0x1246f8['name'],'UserId':_0x1246f8['id'],'queue_name':_0x5214a0[_0x6753('0x39')],'ChatQueueId':_0x5214a0['id'],'interface':util[_0x6753('0x6f')](_0x6753('0x70'),_0x6753('0x71'),_0x1246f8[_0x6753('0x39')]),'penalty':0x0,'paused':_0x1246f8['chatPause'],'createdAt':_0x1246f8[_0x6753('0x72')],'updatedAt':_0x1246f8[_0x6753('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6753('0x1f')](respondWithFilteredResult(_0x464d7e,_0x3ad93d))['catch'](handleError(_0x464d7e,null));};exports[_0x6753('0x73')]=function(_0x38e38e,_0x51a46a,_0x1d56fa){var _0x1abf44={};var _0xbf35ce={};var _0x1f7582;var _0x2442ea;return db[_0x6753('0x3c')][_0x6753('0x64')]({'where':{'id':_0x38e38e[_0x6753('0x55')]['id']}})['then'](handleEntityNotFound(_0x51a46a,null))[_0x6753('0x1f')](function(_0x51395b){if(_0x51395b){_0x1f7582=_0x51395b;_0xbf35ce[_0x6753('0x41')]=_[_0x6753('0x56')](db[_0x6753('0x74')][_0x6753('0x3d')]);_0xbf35ce[_0x6753('0x42')]=_[_0x6753('0x56')](_0x38e38e[_0x6753('0x42')]);_0xbf35ce[_0x6753('0x4c')]=_['intersection'](_0xbf35ce['model'],_0xbf35ce[_0x6753('0x42')]);_0x1abf44['attributes']=_[_0x6753('0x43')](_0xbf35ce[_0x6753('0x41')],qs[_0x6753('0x45')](_0x38e38e[_0x6753('0x42')][_0x6753('0x45')]));_0x1abf44[_0x6753('0x44')]=_0x1abf44[_0x6753('0x44')][_0x6753('0x46')]?_0x1abf44[_0x6753('0x44')]:_0xbf35ce[_0x6753('0x41')];_0x1abf44[_0x6753('0x49')]=qs[_0x6753('0x4a')](_0x38e38e[_0x6753('0x42')][_0x6753('0x4a')]);_0x1abf44[_0x6753('0x4b')]=qs[_0x6753('0x4c')](_['pick'](_0x38e38e[_0x6753('0x42')],_0xbf35ce[_0x6753('0x4c')]));if(_0x38e38e[_0x6753('0x42')][_0x6753('0x4d')]){_0x1abf44[_0x6753('0x4b')]=_[_0x6753('0x4e')](_0x1abf44[_0x6753('0x4b')],{'$or':_[_0x6753('0x4f')](_0x1abf44['attributes'],function(_0x55abfd){var _0xcf6266={};_0xcf6266[_0x55abfd]={'$like':'%'+_0x38e38e[_0x6753('0x42')][_0x6753('0x4d')]+'%'};return _0xcf6266;})});}_0x1abf44=_['merge']({},_0x1abf44,_0x38e38e['options']);return _0x1f7582['getTeams'](_0x1abf44);}})['then'](function(_0xdb2ca0){if(_0xdb2ca0){_0x2442ea=_0xdb2ca0[_0x6753('0x46')];if(!_0x38e38e[_0x6753('0x42')][_0x6753('0x47')](_0x6753('0x48'))){_0x1abf44[_0x6753('0x31')]=qs['limit'](_0x38e38e['query'][_0x6753('0x31')]);_0x1abf44['offset']=qs['offset'](_0x38e38e['query'][_0x6753('0x2e')]);}return _0x1f7582[_0x6753('0x73')](_0x1abf44);}})['then'](function(_0xaed4f3){if(_0xaed4f3){return _0xaed4f3?{'count':_0x2442ea,'rows':_0xaed4f3}:null;}})[_0x6753('0x1f')](respondWithResult(_0x51a46a,null))[_0x6753('0x54')](handleError(_0x51a46a,null));};exports['addTeams']=function(_0x3f9491,_0x88e0f7,_0x35c042){var _0x2e67dc=_0x3f9491[_0x6753('0x5a')][_0x6753('0x75')];return db['Team'][_0x6753('0x68')]({'where':{'id':_0x2e67dc},'attributes':['id'],'include':[{'model':db[_0x6753('0x69')],'as':'Agents','attributes':['id',_0x6753('0x39'),_0x6753('0x76'),_0x6753('0x77'),_0x6753('0x78')],'raw':!![]}]})[_0x6753('0x1f')](function(_0x1731a7){if(_0x1731a7){var _0x5d2bc6=_['flatMap'](_0x1731a7,function(_0x13d777){var _0x452451=_0x13d777[_0x6753('0x35')]({'plain':!![]});return _0x452451['Agents'];});return db[_0x6753('0x3c')][_0x6753('0x58')]({'where':{'id':_0x3f9491[_0x6753('0x55')]['id']}})[_0x6753('0x1f')](function(_0x5a5581){return db[_0x6753('0x79')]['transaction'](function(_0x30980e){return _0x5a5581[_0x6753('0x7a')](_0x2e67dc,{'transaction':_0x30980e})[_0x6753('0x1f')](function(){return BPromise[_0x6753('0x7b')](_0x5d2bc6,function(_0x20e422){return db[_0x6753('0x65')][_0x6753('0x7c')]({'where':{'UserId':_0x20e422['id'],'ChatQueueId':_0x3f9491[_0x6753('0x55')]['id']},'transaction':_0x30980e});});})[_0x6753('0x1f')](function(){_0x5d2bc6[_0x6753('0x7d')](function(_0xa89099){socket[_0x6753('0x7e')]('userChatQueue:save',{'UserId':_0xa89099['id'],'ChatQueueId':_0x5a5581['id']});});});});});}})[_0x6753('0x1f')](respondWithStatusCode(_0x88e0f7,null))[_0x6753('0x54')](handleError(_0x88e0f7,null));};exports['removeTeams']=function(_0x4ddf1c,_0x588623,_0x191a66){return db[_0x6753('0x74')]['findAll']({'where':{'id':_0x4ddf1c[_0x6753('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6753('0x69')],'as':_0x6753('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x6753('0x1f')](handleEntityNotFound(_0x588623,null))['then'](function(_0x3cbc7b){var _0x3c421d=_[_0x6753('0x4f')](_0x3cbc7b,'id');var _0x45c0d3=[];var _0x1e45a0=[];var _0x10a96c=squel[_0x6753('0x80')]();_0x10a96c[_0x6753('0x81')](_0x6753('0x82'))[_0x6753('0x83')](_0x6753('0x84'),'tq')[_0x6753('0x85')](_0x6753('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6753('0x4b')](_0x6753('0x87'),_0x4ddf1c[_0x6753('0x55')]['id']);for(var _0x45c762=0x0;_0x45c762<_0x3cbc7b[_0x6753('0x46')];_0x45c762+=0x1){let _0xf1cfac=_0x3cbc7b[_0x45c762];for(var _0x2e9f1f=0x0;_0x2e9f1f<_0xf1cfac[_0x6753('0x7f')][_0x6753('0x46')];_0x2e9f1f+=0x1){let _0x57b55a=_0xf1cfac[_0x6753('0x7f')][_0x2e9f1f];var _0x1c9ce5=_0x10a96c[_0x6753('0x88')]();_0x1c9ce5[_0x6753('0x4b')](_0x6753('0x89'),_0x57b55a['id']);_0x1e45a0['push'](db['sequelize'][_0x6753('0x42')](_0x1c9ce5[_0x6753('0x8a')](),{'type':db['sequelize'][_0x6753('0x8b')][_0x6753('0x8c')]})[_0x6753('0x1f')](function(_0x59d9c4){if(_0x59d9c4['length']===0x1){return _0x57b55a['id'];}else{var _0x135e33=_[_0x6753('0x8d')](_[_0x6753('0x4f')](_0x59d9c4,_0x6753('0x8e')),function(_0x6e7cd9){return _[_0x6753('0x8f')](_0x3c421d,_0x6e7cd9);});if(_0x135e33){return _0x57b55a['id'];}}}));}}return BPromise[_0x6753('0x90')](_0x1e45a0)['then'](function(_0x3f8d7f){_0x45c0d3=_(_0x45c0d3)[_0x6753('0x91')](_0x3f8d7f)[_0x6753('0x92')]()[_0x6753('0x93')]();return db[_0x6753('0x3c')][_0x6753('0x58')]({'where':{'id':_0x4ddf1c[_0x6753('0x55')]['id']}})[_0x6753('0x1f')](function(_0x4f2a89){return db['sequelize'][_0x6753('0x94')](function(_0x23fc26){return _0x4f2a89[_0x6753('0x95')](_0x4ddf1c['query'][_0x6753('0x75')],{'transaction':_0x23fc26})['then'](function(){if(!_[_0x6753('0x96')](_0x45c0d3)){return _0x4f2a89['removeAgents'](_0x45c0d3,{'transaction':_0x23fc26});}})[_0x6753('0x1f')](function(){_0x45c0d3['forEach'](function(_0x2395a6){socket['emit'](_0x6753('0x97'),{'UserId':_0x2395a6,'ChatQueueId':_0x4f2a89['id']});});});});});});})[_0x6753('0x1f')](respondWithStatusCode(_0x588623,null))['catch'](handleError(_0x588623,null));};exports[_0x6753('0x98')]=function(_0x343b3b,_0x34527b,_0xa38831){return db[_0x6753('0x3c')][_0x6753('0x58')]({'where':{'id':_0x343b3b[_0x6753('0x55')]['id']}})[_0x6753('0x1f')](handleEntityNotFound(_0x34527b,null))[_0x6753('0x1f')](function(_0x2915f9){if(_0x2915f9){return _0x2915f9[_0x6753('0x98')](_0x343b3b[_0x6753('0x5a')][_0x6753('0x75')],_[_0x6753('0x99')](_0x343b3b[_0x6753('0x5a')],[_0x6753('0x75'),'id'])||{})[_0x6753('0x9a')](function(_0x278f05){for(var _0xd8260d=0x0;_0xd8260d<_0x343b3b['body']['ids'][_0x6753('0x46')];_0xd8260d+=0x1){socket[_0x6753('0x7e')](_0x6753('0x9b'),{'UserId':Number(_0x343b3b[_0x6753('0x5a')]['ids'][_0xd8260d]),'ChatQueueId':Number(_0x343b3b[_0x6753('0x55')]['id'])});}return _0x278f05;});}})[_0x6753('0x1f')](respondWithResult(_0x34527b,null))[_0x6753('0x54')](handleError(_0x34527b,null));};exports[_0x6753('0x9c')]=function(_0x25392d,_0x3776c5,_0x342b8d){return db['ChatQueue'][_0x6753('0x58')]({'where':{'id':_0x25392d['params']['id']}})['then'](handleEntityNotFound(_0x3776c5,null))[_0x6753('0x1f')](function(_0x4b217b){if(_0x4b217b){return _0x4b217b[_0x6753('0x9c')](_0x25392d[_0x6753('0x42')][_0x6753('0x75')])[_0x6753('0x1f')](function(){if(_[_0x6753('0x9d')](_0x25392d[_0x6753('0x42')][_0x6753('0x75')])){for(var _0xe070c9=0x0;_0xe070c9<_0x25392d[_0x6753('0x42')]['ids'][_0x6753('0x46')];_0xe070c9+=0x1){socket[_0x6753('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x25392d[_0x6753('0x42')][_0x6753('0x75')][_0xe070c9]),'ChatQueueId':Number(_0x25392d[_0x6753('0x55')]['id'])});}}else{socket[_0x6753('0x7e')](_0x6753('0x97'),{'UserId':Number(_0x25392d[_0x6753('0x42')]['ids']),'ChatQueueId':Number(_0x25392d[_0x6753('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x3776c5,null))[_0x6753('0x54')](handleError(_0x3776c5,null));};exports[_0x6753('0x9e')]=function(_0x5a4caa,_0x59c936,_0x175693){var _0x190cb8={};var _0x39f5cb={};var _0x136ae2;var _0x2b00f5;return db['ChatQueue'][_0x6753('0x64')]({'where':{'id':_0x5a4caa['params']['id']}})[_0x6753('0x1f')](handleEntityNotFound(_0x59c936,null))[_0x6753('0x1f')](function(_0x4f806f){if(_0x4f806f){_0x136ae2=_0x4f806f;_0x39f5cb[_0x6753('0x41')]=_['keys'](db[_0x6753('0x69')][_0x6753('0x3d')]);_0x39f5cb[_0x6753('0x42')]=_[_0x6753('0x56')](_0x5a4caa[_0x6753('0x42')]);_0x39f5cb[_0x6753('0x4c')]=_[_0x6753('0x43')](_0x39f5cb[_0x6753('0x41')],_0x39f5cb[_0x6753('0x42')]);_0x190cb8[_0x6753('0x44')]=_[_0x6753('0x43')](_0x39f5cb[_0x6753('0x41')],qs['fields'](_0x5a4caa['query'][_0x6753('0x45')]));_0x190cb8[_0x6753('0x44')]=_0x190cb8['attributes'][_0x6753('0x46')]?_0x190cb8[_0x6753('0x44')]:_0x39f5cb[_0x6753('0x41')];_0x190cb8[_0x6753('0x49')]=qs[_0x6753('0x4a')](_0x5a4caa[_0x6753('0x42')]['sort']);_0x190cb8[_0x6753('0x4b')]=qs[_0x6753('0x4c')](_[_0x6753('0x66')](_0x5a4caa['query'],_0x39f5cb[_0x6753('0x4c')]));if(_0x5a4caa[_0x6753('0x42')][_0x6753('0x4d')]){_0x190cb8[_0x6753('0x4b')]=_['merge'](_0x190cb8[_0x6753('0x4b')],{'$or':_['map'](_0x190cb8[_0x6753('0x44')],function(_0xed2e5b){var _0x23b015={};_0x23b015[_0xed2e5b]={'$like':'%'+_0x5a4caa[_0x6753('0x42')][_0x6753('0x4d')]+'%'};return _0x23b015;})});}_0x190cb8=_[_0x6753('0x4e')]({},_0x190cb8,_0x5a4caa['options']);return _0x136ae2[_0x6753('0x9e')](_0x190cb8);}})[_0x6753('0x1f')](function(_0x59b939){if(_0x59b939){_0x2b00f5=_0x59b939[_0x6753('0x46')];if(!_0x5a4caa[_0x6753('0x42')][_0x6753('0x47')](_0x6753('0x48'))){_0x190cb8[_0x6753('0x31')]=qs[_0x6753('0x31')](_0x5a4caa['query'][_0x6753('0x31')]);_0x190cb8[_0x6753('0x2e')]=qs[_0x6753('0x2e')](_0x5a4caa[_0x6753('0x42')][_0x6753('0x2e')]);}return _0x136ae2['getAgents'](_0x190cb8);}})[_0x6753('0x1f')](function(_0x15358e){if(_0x15358e){return _0x15358e?{'count':_0x2b00f5,'rows':_0x15358e}:null;}})[_0x6753('0x1f')](respondWithResult(_0x59c936,null))[_0x6753('0x54')](handleError(_0x59c936,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index db3261d..82afc9f 100644 --- a/server/api/chatQueue/chatQueue.events.js +++ b/server/api/chatQueue/chatQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9992=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove'];(function(_0x269d72,_0x6af7bb){var _0x2feb94=function(_0x34e6bf){while(--_0x34e6bf){_0x269d72['push'](_0x269d72['shift']());}};_0x2feb94(++_0x6af7bb);}(_0x9992,0x135));var _0x2999=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x9992[_0x1e3c16];return _0x47a0c9;};'use strict';var EventEmitter=require(_0x2999('0x0'));var ChatQueue=require(_0x2999('0x1'))['db'][_0x2999('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2999('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2999('0x4'),'afterDestroy':_0x2999('0x5')};function emitEvent(_0x3ba76a){return function(_0x392b19,_0x4ab30e,_0x4e8d59){ChatQueueEvents[_0x2999('0x6')](_0x3ba76a+':'+_0x392b19['id'],_0x392b19);ChatQueueEvents[_0x2999('0x6')](_0x3ba76a,_0x392b19);_0x4e8d59(null);};}for(var e in events){if(events[_0x2999('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x2999('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x099f=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0xcaf223,_0xd39f07){var _0x17e00d=function(_0xe2852e){while(--_0xe2852e){_0xcaf223['push'](_0xcaf223['shift']());}};_0x17e00d(++_0xd39f07);}(_0x099f,0x1e2));var _0xf099=function(_0x11ba2a,_0xedb88f){_0x11ba2a=_0x11ba2a-0x0;var _0x3bd79f=_0x099f[_0x11ba2a];return _0x3bd79f;};'use strict';var EventEmitter=require(_0xf099('0x0'));var ChatQueue=require(_0xf099('0x1'))['db'][_0xf099('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf099('0x3')](0x0);var events={'afterCreate':_0xf099('0x4'),'afterUpdate':'update','afterDestroy':_0xf099('0x5')};function emitEvent(_0x3caf0d){return function(_0x6c40aa,_0x16efc8,_0x244c9a){ChatQueueEvents[_0xf099('0x6')](_0x3caf0d+':'+_0x6c40aa['id'],_0x6c40aa);ChatQueueEvents[_0xf099('0x6')](_0x3caf0d,_0x6c40aa);_0x244c9a(null);};}for(var e in events){if(events[_0xf099('0x7')](e)){var event=events[e];ChatQueue[_0xf099('0x8')](e,emitEvent(event));}}module[_0xf099('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 76d13ce..abe81ad 100644 --- a/server/api/chatQueue/chatQueue.model.js +++ b/server/api/chatQueue/chatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a38=['rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x4fcf4b,_0x39bb6b){var _0x53918f=function(_0x50f9e1){while(--_0x50f9e1){_0x4fcf4b['push'](_0x4fcf4b['shift']());}};_0x53918f(++_0x39bb6b);}(_0x3a38,0x1e6));var _0x83a3=function(_0x13e59e,_0xee9021){_0x13e59e=_0x13e59e-0x0;var _0x1f859f=_0x3a38[_0x13e59e];return _0x1f859f;};'use strict';var _=require(_0x83a3('0x0'));var util=require(_0x83a3('0x1'));var logger=require(_0x83a3('0x2'))('api');var moment=require(_0x83a3('0x3'));var BPromise=require('bluebird');var rp=require(_0x83a3('0x4'));var fs=require('fs');var path=require(_0x83a3('0x5'));var rimraf=require(_0x83a3('0x6'));var config=require(_0x83a3('0x7'));var attributes=require(_0x83a3('0x8'));module[_0x83a3('0x9')]=function(_0x5c38b8,_0xedbda3){return _0x5c38b8['define'](_0x83a3('0xa'),attributes,{'tableName':_0x83a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ad6=['rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x42589f,_0x495906){var _0x3aa564=function(_0x1d0c8c){while(--_0x1d0c8c){_0x42589f['push'](_0x42589f['shift']());}};_0x3aa564(++_0x495906);}(_0x8ad6,0x106));var _0x68ad=function(_0x507aaf,_0x1a66af){_0x507aaf=_0x507aaf-0x0;var _0x5cb95c=_0x8ad6[_0x507aaf];return _0x5cb95c;};'use strict';var _=require(_0x68ad('0x0'));var util=require(_0x68ad('0x1'));var logger=require(_0x68ad('0x2'))(_0x68ad('0x3'));var moment=require(_0x68ad('0x4'));var BPromise=require(_0x68ad('0x5'));var rp=require(_0x68ad('0x6'));var fs=require('fs');var path=require(_0x68ad('0x7'));var rimraf=require(_0x68ad('0x8'));var config=require(_0x68ad('0x9'));var attributes=require(_0x68ad('0xa'));module[_0x68ad('0xb')]=function(_0x1ec236,_0x75d828){return _0x1ec236[_0x68ad('0xc')](_0x68ad('0xd'),attributes,{'tableName':_0x68ad('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 6977922..fd13758 100644 --- a/server/api/chatQueue/chatQueue.rpc.js +++ b/server/api/chatQueue/chatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ebd=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','attributes','limit','map','include','model','ShowChatQueue','where'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2ebd,0x1c8));var _0xd2eb=function(_0x4f9d26,_0x641341){_0x4f9d26=_0x4f9d26-0x0;var _0x57debc=_0x2ebd[_0x4f9d26];return _0x57debc;};'use strict';var _=require(_0xd2eb('0x0'));var util=require(_0xd2eb('0x1'));var moment=require(_0xd2eb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2eb('0x3'));var db=require(_0xd2eb('0x4'))['db'];var utils=require(_0xd2eb('0x5'));var logger=require(_0xd2eb('0x6'))(_0xd2eb('0x7'));var config=require(_0xd2eb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd2eb('0x9')]({'port':0x232a});config[_0xd2eb('0xa')]=_[_0xd2eb('0xb')](config[_0xd2eb('0xa')],{'host':_0xd2eb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd2eb('0xa')]));require(_0xd2eb('0xd'))['register'](socket);function respondWithRpcPromise(_0x5f0f7e,_0x3fa18f,_0x40d650){return new BPromise(function(_0xe2cadc,_0x17eaac){return client[_0xd2eb('0xe')](_0x5f0f7e,_0x40d650)[_0xd2eb('0xf')](function(_0x149f3f){logger[_0xd2eb('0x10')](_0xd2eb('0x11'),_0x3fa18f,_0xd2eb('0x12'));logger[_0xd2eb('0x13')](_0xd2eb('0x14'),_0x3fa18f,'request\x20sent',JSON[_0xd2eb('0x15')](_0x149f3f));if(_0x149f3f['error']){if(_0x149f3f[_0xd2eb('0x16')][_0xd2eb('0x17')]===0x1f4){logger['error'](_0xd2eb('0x11'),_0x3fa18f,_0x149f3f[_0xd2eb('0x16')]['message']);return _0x17eaac(_0x149f3f[_0xd2eb('0x16')][_0xd2eb('0x18')]);}logger[_0xd2eb('0x16')]('ChatQueue,\x20%s,\x20%s',_0x3fa18f,_0x149f3f['error'][_0xd2eb('0x18')]);return _0xe2cadc(_0x149f3f['error']['message']);}else{logger[_0xd2eb('0x10')](_0xd2eb('0x11'),_0x3fa18f,'request\x20sent');_0xe2cadc(_0x149f3f[_0xd2eb('0x19')][_0xd2eb('0x18')]);}})[_0xd2eb('0x1a')](function(_0x3a9fcd){logger[_0xd2eb('0x16')](_0xd2eb('0x11'),_0x3fa18f,_0x3a9fcd);_0x17eaac(_0x3a9fcd);});});}exports[_0xd2eb('0x1b')]=function(_0x29a605){var _0x496586=this;return new Promise(function(_0x137026,_0x4d57ee){return db[_0xd2eb('0x1c')][_0xd2eb('0x1d')]({'raw':_0x29a605[_0xd2eb('0x1e')]?_0x29a605[_0xd2eb('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x29a605[_0xd2eb('0x1e')]?_0x29a605[_0xd2eb('0x1e')]['where']||null:null,'attributes':_0x29a605[_0xd2eb('0x1e')]?_0x29a605[_0xd2eb('0x1e')][_0xd2eb('0x1f')]||null:null,'limit':_0x29a605[_0xd2eb('0x1e')]?_0x29a605[_0xd2eb('0x1e')][_0xd2eb('0x20')]||null:null,'include':_0x29a605[_0xd2eb('0x1e')]?_0x29a605[_0xd2eb('0x1e')]['include']?_[_0xd2eb('0x21')](_0x29a605[_0xd2eb('0x1e')][_0xd2eb('0x22')],function(_0x3e6eb1){return{'model':db[_0x3e6eb1[_0xd2eb('0x23')]],'as':_0x3e6eb1['as'],'attributes':_0x3e6eb1[_0xd2eb('0x1f')],'include':_0x3e6eb1[_0xd2eb('0x22')]?_[_0xd2eb('0x21')](_0x3e6eb1[_0xd2eb('0x22')],function(_0x3db184){return{'model':db[_0x3db184[_0xd2eb('0x23')]],'as':_0x3db184['as'],'attributes':_0x3db184[_0xd2eb('0x1f')],'include':_0x3db184[_0xd2eb('0x22')]?_[_0xd2eb('0x21')](_0x3db184[_0xd2eb('0x22')],function(_0x39ee3d){return{'model':db[_0x39ee3d[_0xd2eb('0x23')]],'as':_0x39ee3d['as'],'attributes':_0x39ee3d[_0xd2eb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd2eb('0xf')](function(_0x39ed9d){logger[_0xd2eb('0x10')]('GetChatQueue',_0x29a605);logger[_0xd2eb('0x13')](_0xd2eb('0x1b'),_0x29a605,JSON[_0xd2eb('0x15')](_0x39ed9d));_0x137026(_0x39ed9d);})['catch'](function(_0x87cede){logger['error'](_0xd2eb('0x1b'),_0x87cede[_0xd2eb('0x18')],_0x29a605);_0x4d57ee(_0x496586['error'](0x1f4,_0x87cede[_0xd2eb('0x18')]));});});};exports[_0xd2eb('0x24')]=function(_0x3f5b16){var _0x13af38=this;return new Promise(function(_0x19b833,_0x10a247){return db['ChatQueue']['find']({'raw':_0x3f5b16[_0xd2eb('0x1e')]?_0x3f5b16['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f5b16[_0xd2eb('0x1e')]?_0x3f5b16['options'][_0xd2eb('0x25')]||null:null,'attributes':_0x3f5b16['options']?_0x3f5b16[_0xd2eb('0x1e')][_0xd2eb('0x1f')]||null:null,'include':_0x3f5b16['options']?_0x3f5b16['options'][_0xd2eb('0x22')]?_['map'](_0x3f5b16[_0xd2eb('0x1e')][_0xd2eb('0x22')],function(_0x1944a3){return{'model':db[_0x1944a3['model']],'as':_0x1944a3['as'],'attributes':_0x1944a3['attributes'],'include':_0x1944a3[_0xd2eb('0x22')]?_['map'](_0x1944a3[_0xd2eb('0x22')],function(_0x13ab01){return{'model':db[_0x13ab01[_0xd2eb('0x23')]],'as':_0x13ab01['as'],'attributes':_0x13ab01[_0xd2eb('0x1f')],'include':_0x13ab01['include']?_[_0xd2eb('0x21')](_0x13ab01['include'],function(_0x46de47){return{'model':db[_0x46de47['model']],'as':_0x46de47['as'],'attributes':_0x46de47[_0xd2eb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd2eb('0xf')](function(_0x45ada1){logger[_0xd2eb('0x10')](_0xd2eb('0x24'),_0x3f5b16);logger[_0xd2eb('0x13')](_0xd2eb('0x24'),_0x3f5b16,JSON[_0xd2eb('0x15')](_0x45ada1));_0x19b833(_0x45ada1);})[_0xd2eb('0x1a')](function(_0x2c8280){logger['error'](_0xd2eb('0x24'),_0x2c8280[_0xd2eb('0x18')],_0x3f5b16);_0x10a247(_0x13af38['error'](0x1f4,_0x2c8280[_0xd2eb('0x18')]));});});}; \ No newline at end of file +var _0x07a2=['stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ChatQueue','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2643d3,_0x54f179){var _0x3d697d=function(_0x25c73f){while(--_0x25c73f){_0x2643d3['push'](_0x2643d3['shift']());}};_0x3d697d(++_0x54f179);}(_0x07a2,0x12c));var _0x207a=function(_0x1c1da1,_0x4755d8){_0x1c1da1=_0x1c1da1-0x0;var _0x3c1816=_0x07a2[_0x1c1da1];return _0x3c1816;};'use strict';var _=require(_0x207a('0x0'));var util=require(_0x207a('0x1'));var moment=require('moment');var BPromise=require(_0x207a('0x2'));var rs=require(_0x207a('0x3'));var fs=require('fs');var Redis=require(_0x207a('0x4'));var db=require(_0x207a('0x5'))['db'];var utils=require(_0x207a('0x6'));var logger=require(_0x207a('0x7'))(_0x207a('0x8'));var config=require(_0x207a('0x9'));var jayson=require(_0x207a('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x207a('0xb')]=_[_0x207a('0xc')](config[_0x207a('0xb')],{'host':_0x207a('0xd'),'port':0x18eb});var socket=require(_0x207a('0xe'))(new Redis(config[_0x207a('0xb')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3cca2d,_0x5614e1,_0x4eab73){return new BPromise(function(_0x3dd07d,_0x5a7d85){return client['request'](_0x3cca2d,_0x4eab73)[_0x207a('0xf')](function(_0x39950f){logger[_0x207a('0x10')]('ChatQueue,\x20%s,\x20%s',_0x5614e1,_0x207a('0x11'));logger[_0x207a('0x12')](_0x207a('0x13'),_0x5614e1,'request\x20sent',JSON[_0x207a('0x14')](_0x39950f));if(_0x39950f[_0x207a('0x15')]){if(_0x39950f[_0x207a('0x15')][_0x207a('0x16')]===0x1f4){logger[_0x207a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x5614e1,_0x39950f[_0x207a('0x15')]['message']);return _0x5a7d85(_0x39950f[_0x207a('0x15')][_0x207a('0x17')]);}logger[_0x207a('0x15')](_0x207a('0x18'),_0x5614e1,_0x39950f[_0x207a('0x15')][_0x207a('0x17')]);return _0x3dd07d(_0x39950f[_0x207a('0x15')][_0x207a('0x17')]);}else{logger[_0x207a('0x10')](_0x207a('0x18'),_0x5614e1,'request\x20sent');_0x3dd07d(_0x39950f[_0x207a('0x19')]['message']);}})[_0x207a('0x1a')](function(_0x28246e){logger[_0x207a('0x15')](_0x207a('0x18'),_0x5614e1,_0x28246e);_0x5a7d85(_0x28246e);});});}exports[_0x207a('0x1b')]=function(_0x1afb14){var _0x5b20bc=this;return new Promise(function(_0x104593,_0x30ff20){return db['ChatQueue'][_0x207a('0x1c')]({'raw':_0x1afb14[_0x207a('0x1d')]?_0x1afb14[_0x207a('0x1d')][_0x207a('0x1e')]===undefined?!![]:![]:!![],'where':_0x1afb14[_0x207a('0x1d')]?_0x1afb14[_0x207a('0x1d')][_0x207a('0x1f')]||null:null,'attributes':_0x1afb14[_0x207a('0x1d')]?_0x1afb14[_0x207a('0x1d')][_0x207a('0x20')]||null:null,'limit':_0x1afb14[_0x207a('0x1d')]?_0x1afb14[_0x207a('0x1d')][_0x207a('0x21')]||null:null,'include':_0x1afb14['options']?_0x1afb14[_0x207a('0x1d')][_0x207a('0x22')]?_[_0x207a('0x23')](_0x1afb14[_0x207a('0x1d')]['include'],function(_0x1bf684){return{'model':db[_0x1bf684[_0x207a('0x24')]],'as':_0x1bf684['as'],'attributes':_0x1bf684['attributes'],'include':_0x1bf684[_0x207a('0x22')]?_['map'](_0x1bf684['include'],function(_0x3c81bd){return{'model':db[_0x3c81bd['model']],'as':_0x3c81bd['as'],'attributes':_0x3c81bd[_0x207a('0x20')],'include':_0x3c81bd[_0x207a('0x22')]?_['map'](_0x3c81bd['include'],function(_0xb41124){return{'model':db[_0xb41124[_0x207a('0x24')]],'as':_0xb41124['as'],'attributes':_0xb41124['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x25d852){logger[_0x207a('0x10')](_0x207a('0x1b'),_0x1afb14);logger[_0x207a('0x12')](_0x207a('0x1b'),_0x1afb14,JSON[_0x207a('0x14')](_0x25d852));_0x104593(_0x25d852);})[_0x207a('0x1a')](function(_0x507dc9){logger[_0x207a('0x15')](_0x207a('0x1b'),_0x507dc9[_0x207a('0x17')],_0x1afb14);_0x30ff20(_0x5b20bc['error'](0x1f4,_0x507dc9['message']));});});};exports['ShowChatQueue']=function(_0x4b76cd){var _0x290385=this;return new Promise(function(_0x358231,_0x3afd69){return db[_0x207a('0x25')][_0x207a('0x26')]({'raw':_0x4b76cd[_0x207a('0x1d')]?_0x4b76cd[_0x207a('0x1d')][_0x207a('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b76cd[_0x207a('0x1d')]?_0x4b76cd[_0x207a('0x1d')]['where']||null:null,'attributes':_0x4b76cd[_0x207a('0x1d')]?_0x4b76cd[_0x207a('0x1d')][_0x207a('0x20')]||null:null,'include':_0x4b76cd['options']?_0x4b76cd['options'][_0x207a('0x22')]?_[_0x207a('0x23')](_0x4b76cd['options'][_0x207a('0x22')],function(_0x1de18e){return{'model':db[_0x1de18e['model']],'as':_0x1de18e['as'],'attributes':_0x1de18e[_0x207a('0x20')],'include':_0x1de18e[_0x207a('0x22')]?_[_0x207a('0x23')](_0x1de18e['include'],function(_0x405415){return{'model':db[_0x405415['model']],'as':_0x405415['as'],'attributes':_0x405415['attributes'],'include':_0x405415[_0x207a('0x22')]?_[_0x207a('0x23')](_0x405415['include'],function(_0x2597a2){return{'model':db[_0x2597a2[_0x207a('0x24')]],'as':_0x2597a2['as'],'attributes':_0x2597a2['attributes']};}):[]};}):[]};}):[]:[]})[_0x207a('0xf')](function(_0x1bf9c0){logger[_0x207a('0x10')](_0x207a('0x27'),_0x4b76cd);logger[_0x207a('0x12')]('ShowChatQueue',_0x4b76cd,JSON[_0x207a('0x14')](_0x1bf9c0));_0x358231(_0x1bf9c0);})[_0x207a('0x1a')](function(_0xd24dc6){logger[_0x207a('0x15')](_0x207a('0x27'),_0xd24dc6[_0x207a('0x17')],_0x4b76cd);_0x3afd69(_0x290385[_0x207a('0x15')](0x1f4,_0xd24dc6['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 57b7b10..6d2202b 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb469=['./chatQueue.events','save','remove','update','register'];(function(_0x150a88,_0x4caec0){var _0x445a2f=function(_0x1df14e){while(--_0x1df14e){_0x150a88['push'](_0x150a88['shift']());}};_0x445a2f(++_0x4caec0);}(_0xb469,0x13b));var _0x9b46=function(_0x21d570,_0x2f7e86){_0x21d570=_0x21d570-0x0;var _0x4095fe=_0xb469[_0x21d570];return _0x4095fe;};'use strict';var ChatQueueEvents=require(_0x9b46('0x0'));var events=[_0x9b46('0x1'),_0x9b46('0x2'),_0x9b46('0x3')];function createListener(_0x1a41e8,_0x895347){return function(_0x9212ae){_0x895347['emit'](_0x1a41e8,_0x9212ae);};}function removeListener(_0x31f853,_0x45322f){return function(){ChatQueueEvents['removeListener'](_0x31f853,_0x45322f);};}exports[_0x9b46('0x4')]=function(_0x405d1c){for(var _0x50b49e=0x0,_0x1b2dd3=events['length'];_0x50b49e<_0x1b2dd3;_0x50b49e++){var _0x4c1ed9=events[_0x50b49e];var _0x34c0de=createListener('chatQueue:'+_0x4c1ed9,_0x405d1c);ChatQueueEvents['on'](_0x4c1ed9,_0x34c0de);}}; \ No newline at end of file +var _0x57d4=['length','./chatQueue.events','save','update','emit','removeListener','register'];(function(_0x15d1e0,_0x2a4d69){var _0x12bd18=function(_0x117920){while(--_0x117920){_0x15d1e0['push'](_0x15d1e0['shift']());}};_0x12bd18(++_0x2a4d69);}(_0x57d4,0x78));var _0x457d=function(_0x52e288,_0x3a08d8){_0x52e288=_0x52e288-0x0;var _0x5d13ea=_0x57d4[_0x52e288];return _0x5d13ea;};'use strict';var ChatQueueEvents=require(_0x457d('0x0'));var events=[_0x457d('0x1'),'remove',_0x457d('0x2')];function createListener(_0xa408c8,_0x1e26ab){return function(_0x30a25c){_0x1e26ab[_0x457d('0x3')](_0xa408c8,_0x30a25c);};}function removeListener(_0x3c89b2,_0x3e2239){return function(){ChatQueueEvents[_0x457d('0x4')](_0x3c89b2,_0x3e2239);};}exports[_0x457d('0x5')]=function(_0x247ec7){for(var _0x3fd867=0x0,_0x5c6816=events[_0x457d('0x6')];_0x3fd867<_0x5c6816;_0x3fd867++){var _0x381e22=events[_0x3fd867];var _0x4e32c0=createListener('chatQueue:'+_0x381e22,_0x247ec7);ChatQueueEvents['on'](_0x381e22,_0x4e32c0);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 47e4e6d..057b7b0 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x19f07d,_0xb52bdc){var _0x278b31=function(_0x454360){while(--_0x454360){_0x19f07d['push'](_0x19f07d['shift']());}};_0x278b31(++_0xb52bdc);}(_0xe14b,0x93));var _0xbe14=function(_0x24cc8e,_0xbb5df7){_0x24cc8e=_0x24cc8e-0x0;var _0x40912d=_0xe14b[_0x24cc8e];return _0x40912d;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x5fc3,0xa8));var _0x35fc=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0x5fc3[_0x17a32f];return _0x15a293;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index ec563ff..84420ba 100644 --- a/server/api/chatQueueReport/chatQueueReport.attributes.js +++ b/server/api/chatQueueReport/chatQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4d1=['STRING','DATE','sequelize','exports'];(function(_0x45163c,_0x549bc7){var _0x2c0289=function(_0x380a71){while(--_0x380a71){_0x45163c['push'](_0x45163c['shift']());}};_0x2c0289(++_0x549bc7);}(_0xc4d1,0x1b2));var _0x1c4d=function(_0x1c852c,_0x113e2d){_0x1c852c=_0x1c852c-0x0;var _0x5037f4=_0xc4d1[_0x1c852c];return _0x5037f4;};'use strict';var moment=require('moment');var Sequelize=require(_0x1c4d('0x0'));module[_0x1c4d('0x1')]={'uniqueid':{'type':Sequelize[_0x1c4d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1c4d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1c4d('0x3')]},'acceptAt':{'type':Sequelize[_0x1c4d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1c4d('0x2')]}}; \ No newline at end of file +var _0xa007=['moment','sequelize','exports','STRING','DATE'];(function(_0x39d483,_0x331941){var _0x5afec1=function(_0x292a36){while(--_0x292a36){_0x39d483['push'](_0x39d483['shift']());}};_0x5afec1(++_0x331941);}(_0xa007,0x15e));var _0x7a00=function(_0xea4b97,_0x3c0f0f){_0xea4b97=_0xea4b97-0x0;var _0x5056d3=_0xa007[_0xea4b97];return _0x5056d3;};'use strict';var moment=require(_0x7a00('0x0'));var Sequelize=require(_0x7a00('0x1'));module[_0x7a00('0x2')]={'uniqueid':{'type':Sequelize[_0x7a00('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7a00('0x3')]},'joinAt':{'type':Sequelize[_0x7a00('0x4')]},'leaveAt':{'type':Sequelize[_0x7a00('0x4')]},'acceptAt':{'type':Sequelize[_0x7a00('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7a00('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 87aca64..8e74e51 100644 --- a/server/api/chatQueueReport/chatQueueReport.controller.js +++ b/server/api/chatQueueReport/chatQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaee6=['filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x1c1da1,_0x4755d8){var _0x3c1816=function(_0x547090){while(--_0x547090){_0x1c1da1['push'](_0x1c1da1['shift']());}};_0x3c1816(++_0x4755d8);}(_0xaee6,0x187));var _0x6aee=function(_0x3244b1,_0xdd4c9e){_0x3244b1=_0x3244b1-0x0;var _0x3edae3=_0xaee6[_0x3244b1];return _0x3edae3;};'use strict';var emlformat=require(_0x6aee('0x0'));var rimraf=require(_0x6aee('0x1'));var zipdir=require(_0x6aee('0x2'));var jsonpatch=require(_0x6aee('0x3'));var rp=require(_0x6aee('0x4'));var moment=require(_0x6aee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6aee('0x6'));var util=require(_0x6aee('0x7'));var path=require(_0x6aee('0x8'));var sox=require('sox');var csv=require(_0x6aee('0x9'));var ejs=require(_0x6aee('0xa'));var fs=require('fs');var fs_extra=require(_0x6aee('0xb'));var _=require(_0x6aee('0xc'));var squel=require(_0x6aee('0xd'));var crypto=require(_0x6aee('0xe'));var jsforce=require(_0x6aee('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6aee('0x10'));var Papa=require('papaparse');var Redis=require(_0x6aee('0x11'));var authService=require(_0x6aee('0x12'));var qs=require(_0x6aee('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6aee('0x14'));var logger=require(_0x6aee('0x15'))(_0x6aee('0x16'));var utils=require(_0x6aee('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6aee('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b4551,_0x46e458){_0x46e458=_0x46e458||0xcc;return function(_0x25eddf){if(_0x25eddf){return _0x5b4551[_0x6aee('0x19')](_0x46e458);}return _0x5b4551[_0x6aee('0x1a')](_0x46e458)['end']();};}function respondWithResult(_0x2d13f5,_0x238b4d){_0x238b4d=_0x238b4d||0xc8;return function(_0x5a7fc5){if(_0x5a7fc5){return _0x2d13f5['status'](_0x238b4d)[_0x6aee('0x1b')](_0x5a7fc5);}};}function respondWithFilteredResult(_0x10a0c8,_0x658ef){return function(_0x18b259){if(_0x18b259){var _0x16cc61=typeof _0x658ef[_0x6aee('0x1c')]===_0x6aee('0x1d')&&typeof _0x658ef[_0x6aee('0x1e')]==='undefined';var _0x124794=_0x18b259[_0x6aee('0x1f')];var _0x511486=_0x16cc61?0x0:_0x658ef[_0x6aee('0x1c')];var _0x29f71c=_0x16cc61?_0x18b259['count']:_0x658ef[_0x6aee('0x1c')]+_0x658ef[_0x6aee('0x1e')];var _0x39a9c1;if(_0x29f71c>=_0x124794){_0x29f71c=_0x124794;_0x39a9c1=0xc8;}else{_0x39a9c1=0xce;}_0x10a0c8[_0x6aee('0x1a')](_0x39a9c1);return _0x10a0c8[_0x6aee('0x20')](_0x6aee('0x21'),_0x511486+'-'+_0x29f71c+'/'+_0x124794)[_0x6aee('0x1b')](_0x18b259);}return null;};}function patchUpdates(_0x5969b2){return function(_0x25c43f){try{jsonpatch['apply'](_0x25c43f,_0x5969b2,!![]);}catch(_0x495ec5){return BPromise[_0x6aee('0x22')](_0x495ec5);}return _0x25c43f[_0x6aee('0x23')]();};}function saveUpdates(_0x409295,_0x4619b1){return function(_0x2f9a08){if(_0x2f9a08){return _0x2f9a08[_0x6aee('0x24')](_0x409295)[_0x6aee('0x25')](function(_0x1ffa47){return _0x1ffa47;});}return null;};}function removeEntity(_0x57b997,_0xc1b66c){return function(_0x511ea6){if(_0x511ea6){return _0x511ea6['destroy']()[_0x6aee('0x25')](function(){_0x57b997[_0x6aee('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3445b1,_0x166dcd){return function(_0x56716f){if(!_0x56716f){_0x3445b1[_0x6aee('0x19')](0x194);}return _0x56716f;};}function handleError(_0x43f0bb,_0x1c110c){_0x1c110c=_0x1c110c||0x1f4;return function(_0x1f1b19){logger[_0x6aee('0x26')](_0x1f1b19[_0x6aee('0x27')]);if(_0x1f1b19[_0x6aee('0x28')]){delete _0x1f1b19[_0x6aee('0x28')];}_0x43f0bb[_0x6aee('0x1a')](_0x1c110c)[_0x6aee('0x29')](_0x1f1b19);};}exports[_0x6aee('0x2a')]=function(_0x3376d1,_0x3d06bb){var _0x7327d4={},_0x15e0db={},_0x2fc285={'count':0x0,'rows':[]};var _0x52244f=_['map'](db[_0x6aee('0x2b')][_0x6aee('0x2c')],function(_0x2822b9){return{'name':_0x2822b9[_0x6aee('0x2d')],'type':_0x2822b9['type'][_0x6aee('0x2e')]};});_0x15e0db['model']=_[_0x6aee('0x2f')](_0x52244f,_0x6aee('0x28'));_0x15e0db[_0x6aee('0x30')]=_[_0x6aee('0x31')](_0x3376d1[_0x6aee('0x30')]);_0x15e0db[_0x6aee('0x32')]=_[_0x6aee('0x33')](_0x15e0db[_0x6aee('0x34')],_0x15e0db[_0x6aee('0x30')]);_0x7327d4[_0x6aee('0x35')]=_[_0x6aee('0x33')](_0x15e0db[_0x6aee('0x34')],qs[_0x6aee('0x36')](_0x3376d1['query'][_0x6aee('0x36')]));_0x7327d4[_0x6aee('0x35')]=_0x7327d4[_0x6aee('0x35')][_0x6aee('0x37')]?_0x7327d4[_0x6aee('0x35')]:_0x15e0db[_0x6aee('0x34')];if(!_0x3376d1[_0x6aee('0x30')][_0x6aee('0x38')]('nolimit')){_0x7327d4[_0x6aee('0x1e')]=qs[_0x6aee('0x1e')](_0x3376d1[_0x6aee('0x30')][_0x6aee('0x1e')]);_0x7327d4[_0x6aee('0x1c')]=qs[_0x6aee('0x1c')](_0x3376d1[_0x6aee('0x30')][_0x6aee('0x1c')]);}_0x7327d4[_0x6aee('0x39')]=qs[_0x6aee('0x3a')](_0x3376d1[_0x6aee('0x30')]['sort']);_0x7327d4['where']=qs[_0x6aee('0x32')](_['pick'](_0x3376d1['query'],_0x15e0db[_0x6aee('0x32')]),_0x52244f);if(_0x3376d1[_0x6aee('0x30')][_0x6aee('0x3b')]){_0x7327d4['where']=_[_0x6aee('0x3c')](_0x7327d4[_0x6aee('0x3d')],{'$or':_[_0x6aee('0x2f')](_0x52244f,function(_0x39784e){if(_0x39784e['type']!==_0x6aee('0x3e')){var _0x3b8fda={};_0x3b8fda[_0x39784e[_0x6aee('0x28')]]={'$like':'%'+_0x3376d1[_0x6aee('0x30')][_0x6aee('0x3b')]+'%'};return _0x3b8fda;}})});}_0x7327d4=_['merge']({},_0x7327d4,_0x3376d1[_0x6aee('0x3f')]);var _0x43fbd={'where':_0x7327d4[_0x6aee('0x3d')]};return db[_0x6aee('0x2b')][_0x6aee('0x1f')](_0x43fbd)['then'](function(_0x3e01e1){_0x2fc285['count']=_0x3e01e1;if(_0x3376d1[_0x6aee('0x30')][_0x6aee('0x40')]){_0x7327d4[_0x6aee('0x41')]=[{'all':!![]}];}return db[_0x6aee('0x2b')][_0x6aee('0x42')](_0x7327d4);})[_0x6aee('0x25')](function(_0x5ba53b){_0x2fc285['rows']=_0x5ba53b;return _0x2fc285;})[_0x6aee('0x25')](respondWithFilteredResult(_0x3d06bb,_0x7327d4))['catch'](handleError(_0x3d06bb,null));};exports[_0x6aee('0x43')]=function(_0x2cfa2a,_0x285b9f){var _0x3c58a3={'raw':!![],'where':{'id':_0x2cfa2a[_0x6aee('0x44')]['id']}},_0x5029d3={};_0x5029d3['model']=_[_0x6aee('0x31')](db['ChatQueueReport'][_0x6aee('0x2c')]);_0x5029d3[_0x6aee('0x30')]=_[_0x6aee('0x31')](_0x2cfa2a[_0x6aee('0x30')]);_0x5029d3[_0x6aee('0x32')]=_[_0x6aee('0x33')](_0x5029d3[_0x6aee('0x34')],_0x5029d3[_0x6aee('0x30')]);_0x3c58a3['attributes']=_[_0x6aee('0x33')](_0x5029d3[_0x6aee('0x34')],qs['fields'](_0x2cfa2a['query'][_0x6aee('0x36')]));_0x3c58a3[_0x6aee('0x35')]=_0x3c58a3['attributes'][_0x6aee('0x37')]?_0x3c58a3['attributes']:_0x5029d3[_0x6aee('0x34')];if(_0x2cfa2a[_0x6aee('0x30')][_0x6aee('0x40')]){_0x3c58a3[_0x6aee('0x41')]=[{'all':!![]}];}_0x3c58a3=_['merge']({},_0x3c58a3,_0x2cfa2a['options']);return db[_0x6aee('0x2b')][_0x6aee('0x45')](_0x3c58a3)[_0x6aee('0x25')](handleEntityNotFound(_0x285b9f,null))[_0x6aee('0x25')](respondWithResult(_0x285b9f,null))['catch'](handleError(_0x285b9f,null));};exports[_0x6aee('0x46')]=function(_0x573005,_0x40ea5e){return db[_0x6aee('0x2b')][_0x6aee('0x46')](_0x573005[_0x6aee('0x47')],{})['then'](respondWithResult(_0x40ea5e,0xc9))[_0x6aee('0x48')](handleError(_0x40ea5e,null));};exports[_0x6aee('0x24')]=function(_0x316f51,_0x23a7ed){if(_0x316f51[_0x6aee('0x47')]['id']){delete _0x316f51[_0x6aee('0x47')]['id'];}return db[_0x6aee('0x2b')][_0x6aee('0x45')]({'where':{'id':_0x316f51['params']['id']}})[_0x6aee('0x25')](handleEntityNotFound(_0x23a7ed,null))[_0x6aee('0x25')](saveUpdates(_0x316f51['body'],null))[_0x6aee('0x25')](respondWithResult(_0x23a7ed,null))[_0x6aee('0x48')](handleError(_0x23a7ed,null));};exports[_0x6aee('0x49')]=function(_0x132aa9,_0x5b9036){return db['ChatQueueReport'][_0x6aee('0x45')]({'where':{'id':_0x132aa9[_0x6aee('0x44')]['id']}})[_0x6aee('0x25')](handleEntityNotFound(_0x5b9036,null))[_0x6aee('0x25')](removeEntity(_0x5b9036,null))['catch'](handleError(_0x5b9036,null));};exports[_0x6aee('0x4a')]=function(_0x56587e,_0x44e3ea){return db['ChatQueueReport'][_0x6aee('0x4a')]()[_0x6aee('0x25')](respondWithResult(_0x44e3ea,null))[_0x6aee('0x48')](handleError(_0x44e3ea,null));}; \ No newline at end of file +var _0x0755=['util','path','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','findAll','show','params','includeAll','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x0755,0x7c));var _0x5075=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0x0755[_0x47c5bf];return _0x11b779;};'use strict';var emlformat=require(_0x5075('0x0'));var rimraf=require(_0x5075('0x1'));var zipdir=require(_0x5075('0x2'));var jsonpatch=require(_0x5075('0x3'));var rp=require(_0x5075('0x4'));var moment=require(_0x5075('0x5'));var BPromise=require(_0x5075('0x6'));var Mustache=require(_0x5075('0x7'));var util=require(_0x5075('0x8'));var path=require(_0x5075('0x9'));var sox=require('sox');var csv=require(_0x5075('0xa'));var ejs=require(_0x5075('0xb'));var fs=require('fs');var fs_extra=require(_0x5075('0xc'));var _=require(_0x5075('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5075('0xe'));var toCsv=require(_0x5075('0xa'));var querystring=require('querystring');var Papa=require(_0x5075('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5075('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5075('0x11'))(_0x5075('0x12'));var utils=require(_0x5075('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5075('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11c5e3,_0x1a131e){_0x1a131e=_0x1a131e||0xcc;return function(_0x413cec){if(_0x413cec){return _0x11c5e3[_0x5075('0x15')](_0x1a131e);}return _0x11c5e3[_0x5075('0x16')](_0x1a131e)[_0x5075('0x17')]();};}function respondWithResult(_0x92710a,_0x32b1a1){_0x32b1a1=_0x32b1a1||0xc8;return function(_0x339420){if(_0x339420){return _0x92710a[_0x5075('0x16')](_0x32b1a1)[_0x5075('0x18')](_0x339420);}};}function respondWithFilteredResult(_0x13e267,_0x4235cd){return function(_0x49ff22){if(_0x49ff22){var _0x128a1b=typeof _0x4235cd[_0x5075('0x19')]===_0x5075('0x1a')&&typeof _0x4235cd[_0x5075('0x1b')]===_0x5075('0x1a');var _0x57fedb=_0x49ff22[_0x5075('0x1c')];var _0xc8b69a=_0x128a1b?0x0:_0x4235cd['offset'];var _0x2159a8=_0x128a1b?_0x49ff22[_0x5075('0x1c')]:_0x4235cd[_0x5075('0x19')]+_0x4235cd[_0x5075('0x1b')];var _0x53232c;if(_0x2159a8>=_0x57fedb){_0x2159a8=_0x57fedb;_0x53232c=0xc8;}else{_0x53232c=0xce;}_0x13e267[_0x5075('0x16')](_0x53232c);return _0x13e267['set'](_0x5075('0x1d'),_0xc8b69a+'-'+_0x2159a8+'/'+_0x57fedb)['json'](_0x49ff22);}return null;};}function patchUpdates(_0x17382e){return function(_0x545364){try{jsonpatch[_0x5075('0x1e')](_0x545364,_0x17382e,!![]);}catch(_0x4c65c7){return BPromise[_0x5075('0x1f')](_0x4c65c7);}return _0x545364[_0x5075('0x20')]();};}function saveUpdates(_0x5ea539,_0x530244){return function(_0x510d4e){if(_0x510d4e){return _0x510d4e[_0x5075('0x21')](_0x5ea539)[_0x5075('0x22')](function(_0xd48fad){return _0xd48fad;});}return null;};}function removeEntity(_0x396c08,_0x1d7758){return function(_0x4e2c16){if(_0x4e2c16){return _0x4e2c16[_0x5075('0x23')]()[_0x5075('0x22')](function(){_0x396c08[_0x5075('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f16cc,_0x212438){return function(_0x57fcb5){if(!_0x57fcb5){_0x1f16cc[_0x5075('0x15')](0x194);}return _0x57fcb5;};}function handleError(_0x3b178d,_0x1340ea){_0x1340ea=_0x1340ea||0x1f4;return function(_0x38a4ea){logger['error'](_0x38a4ea['stack']);if(_0x38a4ea['name']){delete _0x38a4ea[_0x5075('0x24')];}_0x3b178d[_0x5075('0x16')](_0x1340ea)['send'](_0x38a4ea);};}exports[_0x5075('0x25')]=function(_0x36dbf7,_0x444c06){var _0x4efb14={},_0x264777={},_0x514349={'count':0x0,'rows':[]};var _0x5d3a5c=_[_0x5075('0x26')](db[_0x5075('0x27')][_0x5075('0x28')],function(_0x1102cc){return{'name':_0x1102cc['fieldName'],'type':_0x1102cc[_0x5075('0x29')][_0x5075('0x2a')]};});_0x264777[_0x5075('0x2b')]=_['map'](_0x5d3a5c,_0x5075('0x24'));_0x264777[_0x5075('0x2c')]=_[_0x5075('0x2d')](_0x36dbf7[_0x5075('0x2c')]);_0x264777['filters']=_[_0x5075('0x2e')](_0x264777[_0x5075('0x2b')],_0x264777[_0x5075('0x2c')]);_0x4efb14['attributes']=_[_0x5075('0x2e')](_0x264777[_0x5075('0x2b')],qs[_0x5075('0x2f')](_0x36dbf7[_0x5075('0x2c')][_0x5075('0x2f')]));_0x4efb14['attributes']=_0x4efb14[_0x5075('0x30')][_0x5075('0x31')]?_0x4efb14['attributes']:_0x264777[_0x5075('0x2b')];if(!_0x36dbf7['query']['hasOwnProperty']('nolimit')){_0x4efb14[_0x5075('0x1b')]=qs[_0x5075('0x1b')](_0x36dbf7[_0x5075('0x2c')]['limit']);_0x4efb14[_0x5075('0x19')]=qs['offset'](_0x36dbf7['query'][_0x5075('0x19')]);}_0x4efb14['order']=qs[_0x5075('0x32')](_0x36dbf7[_0x5075('0x2c')]['sort']);_0x4efb14[_0x5075('0x33')]=qs[_0x5075('0x34')](_[_0x5075('0x35')](_0x36dbf7['query'],_0x264777[_0x5075('0x34')]),_0x5d3a5c);if(_0x36dbf7[_0x5075('0x2c')][_0x5075('0x36')]){_0x4efb14[_0x5075('0x33')]=_[_0x5075('0x37')](_0x4efb14[_0x5075('0x33')],{'$or':_[_0x5075('0x26')](_0x5d3a5c,function(_0x1f230a){if(_0x1f230a[_0x5075('0x29')]!=='VIRTUAL'){var _0x4c9568={};_0x4c9568[_0x1f230a[_0x5075('0x24')]]={'$like':'%'+_0x36dbf7[_0x5075('0x2c')][_0x5075('0x36')]+'%'};return _0x4c9568;}})});}_0x4efb14=_[_0x5075('0x37')]({},_0x4efb14,_0x36dbf7['options']);var _0x63b935={'where':_0x4efb14[_0x5075('0x33')]};return db[_0x5075('0x27')][_0x5075('0x1c')](_0x63b935)[_0x5075('0x22')](function(_0xbb29e8){_0x514349[_0x5075('0x1c')]=_0xbb29e8;if(_0x36dbf7['query']['includeAll']){_0x4efb14['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x5075('0x38')](_0x4efb14);})[_0x5075('0x22')](function(_0x12f169){_0x514349['rows']=_0x12f169;return _0x514349;})[_0x5075('0x22')](respondWithFilteredResult(_0x444c06,_0x4efb14))['catch'](handleError(_0x444c06,null));};exports[_0x5075('0x39')]=function(_0x1e5a34,_0x1f9165){var _0x2afa26={'raw':!![],'where':{'id':_0x1e5a34[_0x5075('0x3a')]['id']}},_0x42d4b4={};_0x42d4b4['model']=_[_0x5075('0x2d')](db[_0x5075('0x27')][_0x5075('0x28')]);_0x42d4b4[_0x5075('0x2c')]=_[_0x5075('0x2d')](_0x1e5a34['query']);_0x42d4b4[_0x5075('0x34')]=_[_0x5075('0x2e')](_0x42d4b4[_0x5075('0x2b')],_0x42d4b4['query']);_0x2afa26[_0x5075('0x30')]=_[_0x5075('0x2e')](_0x42d4b4[_0x5075('0x2b')],qs[_0x5075('0x2f')](_0x1e5a34[_0x5075('0x2c')][_0x5075('0x2f')]));_0x2afa26[_0x5075('0x30')]=_0x2afa26[_0x5075('0x30')][_0x5075('0x31')]?_0x2afa26[_0x5075('0x30')]:_0x42d4b4[_0x5075('0x2b')];if(_0x1e5a34[_0x5075('0x2c')][_0x5075('0x3b')]){_0x2afa26['include']=[{'all':!![]}];}_0x2afa26=_['merge']({},_0x2afa26,_0x1e5a34[_0x5075('0x3c')]);return db['ChatQueueReport']['find'](_0x2afa26)[_0x5075('0x22')](handleEntityNotFound(_0x1f9165,null))[_0x5075('0x22')](respondWithResult(_0x1f9165,null))[_0x5075('0x3d')](handleError(_0x1f9165,null));};exports['create']=function(_0x49b9a0,_0x35f55d){return db['ChatQueueReport'][_0x5075('0x3e')](_0x49b9a0['body'],{})['then'](respondWithResult(_0x35f55d,0xc9))[_0x5075('0x3d')](handleError(_0x35f55d,null));};exports[_0x5075('0x21')]=function(_0x137e67,_0x3cbcf5){if(_0x137e67['body']['id']){delete _0x137e67[_0x5075('0x3f')]['id'];}return db[_0x5075('0x27')][_0x5075('0x40')]({'where':{'id':_0x137e67[_0x5075('0x3a')]['id']}})[_0x5075('0x22')](handleEntityNotFound(_0x3cbcf5,null))[_0x5075('0x22')](saveUpdates(_0x137e67[_0x5075('0x3f')],null))['then'](respondWithResult(_0x3cbcf5,null))[_0x5075('0x3d')](handleError(_0x3cbcf5,null));};exports['destroy']=function(_0x4d386c,_0x4113e7){return db['ChatQueueReport']['find']({'where':{'id':_0x4d386c['params']['id']}})['then'](handleEntityNotFound(_0x4113e7,null))[_0x5075('0x22')](removeEntity(_0x4113e7,null))[_0x5075('0x3d')](handleError(_0x4113e7,null));};exports[_0x5075('0x41')]=function(_0x207329,_0x12c3a5){return db[_0x5075('0x27')]['describe']()[_0x5075('0x22')](respondWithResult(_0x12c3a5,null))[_0x5075('0x3d')](handleError(_0x12c3a5,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index f8b174a..f0b6598 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x430d8e,_0x229f9a){var _0x411e7e=function(_0x5a236c){while(--_0x5a236c){_0x430d8e['push'](_0x430d8e['shift']());}};_0x411e7e(++_0x229f9a);}(_0x757a,0xde));var _0xa757=function(_0x4b2992,_0x48ca3e){_0x4b2992=_0x4b2992-0x0;var _0x20c8b4=_0x757a[_0x4b2992];return _0x20c8b4;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 7eb4158..090bae9 100644 --- a/server/api/chatQueueReport/chatQueueReport.rpc.js +++ b/server/api/chatQueueReport/chatQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c8e=['update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','stringify','UpdateChatQueueReport'];(function(_0x1a8092,_0x37be14){var _0x570de5=function(_0x9303f1){while(--_0x9303f1){_0x1a8092['push'](_0x1a8092['shift']());}};_0x570de5(++_0x37be14);}(_0x3c8e,0xf3));var _0xe3c8=function(_0x27b5bd,_0x191e3b){_0x27b5bd=_0x27b5bd-0x0;var _0x4d85b9=_0x3c8e[_0x27b5bd];return _0x4d85b9;};'use strict';var _=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var moment=require(_0xe3c8('0x2'));var BPromise=require(_0xe3c8('0x3'));var rs=require(_0xe3c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3c8('0x5'))['db'];var utils=require(_0xe3c8('0x6'));var logger=require('../../config/logger')(_0xe3c8('0x7'));var config=require(_0xe3c8('0x8'));var jayson=require(_0xe3c8('0x9'));var client=jayson[_0xe3c8('0xa')][_0xe3c8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50646d,_0x2fa85e,_0xc99a52){return new BPromise(function(_0x1a9a91,_0x11ceed){return client[_0xe3c8('0xc')](_0x50646d,_0xc99a52)[_0xe3c8('0xd')](function(_0x4bcf40){logger[_0xe3c8('0xe')](_0xe3c8('0xf'),_0x2fa85e,'request\x20sent');logger[_0xe3c8('0x10')](_0xe3c8('0x11'),_0x2fa85e,'request\x20sent',JSON['stringify'](_0x4bcf40));if(_0x4bcf40['error']){if(_0x4bcf40[_0xe3c8('0x12')]['code']===0x1f4){logger[_0xe3c8('0x12')](_0xe3c8('0xf'),_0x2fa85e,_0x4bcf40[_0xe3c8('0x12')][_0xe3c8('0x13')]);return _0x11ceed(_0x4bcf40['error'][_0xe3c8('0x13')]);}logger['error'](_0xe3c8('0xf'),_0x2fa85e,_0x4bcf40[_0xe3c8('0x12')]['message']);return _0x1a9a91(_0x4bcf40[_0xe3c8('0x12')][_0xe3c8('0x13')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x2fa85e,'request\x20sent');_0x1a9a91(_0x4bcf40[_0xe3c8('0x14')][_0xe3c8('0x13')]);}})[_0xe3c8('0x15')](function(_0x4d62e9){logger[_0xe3c8('0x12')](_0xe3c8('0xf'),_0x2fa85e,_0x4d62e9);_0x11ceed(_0x4d62e9);});});}exports[_0xe3c8('0x16')]=function(_0x42a6b6){var _0x156561=this;return new Promise(function(_0x29a1b7,_0x1ff882){return db[_0xe3c8('0x17')][_0xe3c8('0x18')](_0x42a6b6[_0xe3c8('0x19')],{'raw':_0x42a6b6['options']?_0x42a6b6[_0xe3c8('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xe3c8('0xd')](function(_0x2d1553){logger[_0xe3c8('0xe')]('CreateChatQueueReport',_0x42a6b6);logger[_0xe3c8('0x10')](_0xe3c8('0x16'),_0x42a6b6,JSON[_0xe3c8('0x1b')](_0x2d1553));_0x29a1b7(_0x2d1553);})[_0xe3c8('0x15')](function(_0x187e34){logger[_0xe3c8('0x12')]('CreateChatQueueReport',_0x187e34['message'],_0x42a6b6);_0x1ff882(_0x156561['error'](0x1f4,_0x187e34[_0xe3c8('0x13')]));});});};exports[_0xe3c8('0x1c')]=function(_0x127e89){var _0x36bd75=this;return new Promise(function(_0x29fa11,_0x2e0e74){return db[_0xe3c8('0x17')][_0xe3c8('0x1d')](_0x127e89[_0xe3c8('0x19')],{'raw':_0x127e89[_0xe3c8('0x1a')]?_0x127e89[_0xe3c8('0x1a')][_0xe3c8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x127e89['options']?_0x127e89['options'][_0xe3c8('0x1f')]||null:null,'attributes':_0x127e89[_0xe3c8('0x1a')]?_0x127e89['options'][_0xe3c8('0x20')]||null:null,'limit':_0x127e89[_0xe3c8('0x1a')]?_0x127e89['options'][_0xe3c8('0x21')]||null:null})[_0xe3c8('0xd')](function(_0x2f888e){logger[_0xe3c8('0xe')](_0xe3c8('0x1c'),_0x127e89);logger[_0xe3c8('0x10')](_0xe3c8('0x1c'),_0x127e89,JSON[_0xe3c8('0x1b')](_0x2f888e));_0x29fa11(_0x2f888e);})[_0xe3c8('0x15')](function(_0x311c70){logger[_0xe3c8('0x12')]('UpdateChatQueueReport',_0x311c70['message'],_0x127e89);_0x2e0e74(_0x36bd75[_0xe3c8('0x12')](0x1f4,_0x311c70[_0xe3c8('0x13')]));});});}; \ No newline at end of file +var _0xcea5=['update','where','attributes','limit','UpdateChatQueueReport','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','create','body','options','raw','CreateChatQueueReport','stringify','catch'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0xcea5,0x1a9));var _0x5cea=function(_0x108702,_0x14cb3d){_0x108702=_0x108702-0x0;var _0x1ee29f=_0xcea5[_0x108702];return _0x1ee29f;};'use strict';var _=require(_0x5cea('0x0'));var util=require('util');var moment=require(_0x5cea('0x1'));var BPromise=require('bluebird');var rs=require(_0x5cea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cea('0x3'))['db'];var utils=require(_0x5cea('0x4'));var logger=require(_0x5cea('0x5'))('rpc');var config=require(_0x5cea('0x6'));var jayson=require(_0x5cea('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44b156,_0x2d8d6a,_0x19d73f){return new BPromise(function(_0x57f80e,_0x5e83ff){return client[_0x5cea('0x8')](_0x44b156,_0x19d73f)['then'](function(_0x5c3e17){logger[_0x5cea('0x9')](_0x5cea('0xa'),_0x2d8d6a,_0x5cea('0xb'));logger[_0x5cea('0xc')](_0x5cea('0xd'),_0x2d8d6a,_0x5cea('0xb'),JSON['stringify'](_0x5c3e17));if(_0x5c3e17[_0x5cea('0xe')]){if(_0x5c3e17[_0x5cea('0xe')]['code']===0x1f4){logger[_0x5cea('0xe')](_0x5cea('0xa'),_0x2d8d6a,_0x5c3e17['error'][_0x5cea('0xf')]);return _0x5e83ff(_0x5c3e17[_0x5cea('0xe')][_0x5cea('0xf')]);}logger[_0x5cea('0xe')](_0x5cea('0xa'),_0x2d8d6a,_0x5c3e17[_0x5cea('0xe')][_0x5cea('0xf')]);return _0x57f80e(_0x5c3e17[_0x5cea('0xe')][_0x5cea('0xf')]);}else{logger[_0x5cea('0x9')](_0x5cea('0xa'),_0x2d8d6a,_0x5cea('0xb'));_0x57f80e(_0x5c3e17['result']['message']);}})['catch'](function(_0x4a0be6){logger[_0x5cea('0xe')](_0x5cea('0xa'),_0x2d8d6a,_0x4a0be6);_0x5e83ff(_0x4a0be6);});});}exports['CreateChatQueueReport']=function(_0x32ac32){var _0x1575c9=this;return new Promise(function(_0x5f3bcf,_0x228a1f){return db['ChatQueueReport'][_0x5cea('0x10')](_0x32ac32[_0x5cea('0x11')],{'raw':_0x32ac32[_0x5cea('0x12')]?_0x32ac32[_0x5cea('0x12')][_0x5cea('0x13')]===undefined?!![]:![]:!![]})['then'](function(_0x203c9a){logger[_0x5cea('0x9')](_0x5cea('0x14'),_0x32ac32);logger[_0x5cea('0xc')]('CreateChatQueueReport',_0x32ac32,JSON[_0x5cea('0x15')](_0x203c9a));_0x5f3bcf(_0x203c9a);})[_0x5cea('0x16')](function(_0x545735){logger['error'](_0x5cea('0x14'),_0x545735['message'],_0x32ac32);_0x228a1f(_0x1575c9['error'](0x1f4,_0x545735[_0x5cea('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0xe3b859){var _0x313b60=this;return new Promise(function(_0x47f4f3,_0xb58feb){return db['ChatQueueReport'][_0x5cea('0x17')](_0xe3b859[_0x5cea('0x11')],{'raw':_0xe3b859[_0x5cea('0x12')]?_0xe3b859[_0x5cea('0x12')][_0x5cea('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe3b859[_0x5cea('0x12')]?_0xe3b859['options'][_0x5cea('0x18')]||null:null,'attributes':_0xe3b859['options']?_0xe3b859[_0x5cea('0x12')][_0x5cea('0x19')]||null:null,'limit':_0xe3b859[_0x5cea('0x12')]?_0xe3b859[_0x5cea('0x12')][_0x5cea('0x1a')]||null:null})['then'](function(_0x1b1e8f){logger[_0x5cea('0x9')](_0x5cea('0x1b'),_0xe3b859);logger[_0x5cea('0xc')](_0x5cea('0x1b'),_0xe3b859,JSON['stringify'](_0x1b1e8f));_0x47f4f3(_0x1b1e8f);})[_0x5cea('0x16')](function(_0x159b85){logger[_0x5cea('0xe')](_0x5cea('0x1b'),_0x159b85[_0x5cea('0xf')],_0xe3b859);_0xb58feb(_0x313b60[_0x5cea('0xe')](0x1f4,_0x159b85[_0x5cea('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 26f56c8..8f63ede 100644 --- a/server/api/chatQueueReport/index.js +++ b/server/api/chatQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37cb=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3f9727,_0xf55e7e){var _0x522219=function(_0x379df6){while(--_0x379df6){_0x3f9727['push'](_0x3f9727['shift']());}};_0x522219(++_0xf55e7e);}(_0x37cb,0xb6));var _0xb37c=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x37cb[_0x46d0c9];return _0x174506;};'use strict';var multer=require(_0xb37c('0x0'));var util=require('util');var path=require(_0xb37c('0x1'));var timeout=require(_0xb37c('0x2'));var express=require(_0xb37c('0x3'));var router=express[_0xb37c('0x4')]();var fs_extra=require(_0xb37c('0x5'));var auth=require(_0xb37c('0x6'));var interaction=require(_0xb37c('0x7'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xb37c('0x8')]('/',auth[_0xb37c('0x9')](),controller[_0xb37c('0xa')]);router[_0xb37c('0x8')](_0xb37c('0xb'),auth[_0xb37c('0x9')](),controller[_0xb37c('0xc')]);router[_0xb37c('0x8')](_0xb37c('0xd'),auth[_0xb37c('0x9')](),controller[_0xb37c('0xe')]);router[_0xb37c('0xf')]('/',auth[_0xb37c('0x9')](),controller[_0xb37c('0x10')]);router[_0xb37c('0x11')]('/:id',auth[_0xb37c('0x9')](),controller[_0xb37c('0x12')]);router[_0xb37c('0x13')](_0xb37c('0xd'),auth[_0xb37c('0x9')](),controller[_0xb37c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x0842=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy'];(function(_0x1296ac,_0x4882bb){var _0x5ba9f6=function(_0x3bed8c){while(--_0x3bed8c){_0x1296ac['push'](_0x1296ac['shift']());}};_0x5ba9f6(++_0x4882bb);}(_0x0842,0x18d));var _0x2084=function(_0x5017cf,_0x22e92c){_0x5017cf=_0x5017cf-0x0;var _0x4df0af=_0x0842[_0x5017cf];return _0x4df0af;};'use strict';var multer=require(_0x2084('0x0'));var util=require(_0x2084('0x1'));var path=require(_0x2084('0x2'));var timeout=require(_0x2084('0x3'));var express=require(_0x2084('0x4'));var router=express[_0x2084('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2084('0x6'));var interaction=require(_0x2084('0x7'));var config=require(_0x2084('0x8'));var controller=require(_0x2084('0x9'));router[_0x2084('0xa')]('/',auth[_0x2084('0xb')](),controller[_0x2084('0xc')]);router['get'](_0x2084('0xd'),auth['isAuthenticated'](),controller[_0x2084('0xe')]);router[_0x2084('0xa')](_0x2084('0xf'),auth[_0x2084('0xb')](),controller['show']);router['post']('/',auth[_0x2084('0xb')](),controller[_0x2084('0x10')]);router[_0x2084('0x11')](_0x2084('0xf'),auth[_0x2084('0xb')](),controller[_0x2084('0x12')]);router[_0x2084('0x13')](_0x2084('0xf'),auth[_0x2084('0xb')](),controller[_0x2084('0x14')]);module[_0x2084('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 57c23a2..3190726 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x21a917,_0x28dae9){var _0x532a3e=function(_0x5c0b35){while(--_0x5c0b35){_0x21a917['push'](_0x21a917['shift']());}};_0x532a3e(++_0x28dae9);}(_0x00bb,0x1d8));var _0xb00b=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x00bb[_0x40ac5e];return _0x2839d6;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0xa103cd,_0x4c7ef6){var _0x19eafc=function(_0x32d57c){while(--_0x32d57c){_0xa103cd['push'](_0xa103cd['shift']());}};_0x19eafc(++_0x4c7ef6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0xcb91[_0x27c068];return _0xe5a67f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index aec91b4..b945bf4 100644 --- a/server/api/chatTransferReport/chatTransferReport.controller.js +++ b/server/api/chatTransferReport/chatTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f1a=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','fields','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x37c5e2,_0x333baf){var _0x3959cd=function(_0x138bc2){while(--_0x138bc2){_0x37c5e2['push'](_0x37c5e2['shift']());}};_0x3959cd(++_0x333baf);}(_0x1f1a,0xdc));var _0xa1f1=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x1f1a[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xa1f1('0x0'));var rimraf=require(_0xa1f1('0x1'));var zipdir=require(_0xa1f1('0x2'));var jsonpatch=require(_0xa1f1('0x3'));var rp=require(_0xa1f1('0x4'));var moment=require(_0xa1f1('0x5'));var BPromise=require(_0xa1f1('0x6'));var Mustache=require('mustache');var util=require(_0xa1f1('0x7'));var path=require(_0xa1f1('0x8'));var sox=require(_0xa1f1('0x9'));var csv=require('to-csv');var ejs=require(_0xa1f1('0xa'));var fs=require('fs');var fs_extra=require(_0xa1f1('0xb'));var _=require(_0xa1f1('0xc'));var squel=require(_0xa1f1('0xd'));var crypto=require(_0xa1f1('0xe'));var jsforce=require(_0xa1f1('0xf'));var deskjs=require(_0xa1f1('0x10'));var toCsv=require(_0xa1f1('0x11'));var querystring=require(_0xa1f1('0x12'));var Papa=require(_0xa1f1('0x13'));var Redis=require(_0xa1f1('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xa1f1('0x15'));var as=require(_0xa1f1('0x16'));var hardwareService=require(_0xa1f1('0x17'));var logger=require(_0xa1f1('0x18'))('api');var utils=require(_0xa1f1('0x19'));var config=require(_0xa1f1('0x1a'));var licenseUtil=require(_0xa1f1('0x1b'));var db=require(_0xa1f1('0x1c'))['db'];function respondWithStatusCode(_0x4a9f28,_0x532f4f){_0x532f4f=_0x532f4f||0xcc;return function(_0x68242e){if(_0x68242e){return _0x4a9f28[_0xa1f1('0x1d')](_0x532f4f);}return _0x4a9f28[_0xa1f1('0x1e')](_0x532f4f)[_0xa1f1('0x1f')]();};}function respondWithResult(_0x346a5a,_0x1dc8ec){_0x1dc8ec=_0x1dc8ec||0xc8;return function(_0x5f23c2){if(_0x5f23c2){return _0x346a5a[_0xa1f1('0x1e')](_0x1dc8ec)[_0xa1f1('0x20')](_0x5f23c2);}};}function respondWithFilteredResult(_0x421500,_0x9555a){return function(_0x7f4358){if(_0x7f4358){var _0x559cd6=typeof _0x9555a['offset']===_0xa1f1('0x21')&&typeof _0x9555a[_0xa1f1('0x22')]==='undefined';var _0x1ddf20=_0x7f4358[_0xa1f1('0x23')];var _0xfc2b0f=_0x559cd6?0x0:_0x9555a[_0xa1f1('0x24')];var _0x534fa3=_0x559cd6?_0x7f4358[_0xa1f1('0x23')]:_0x9555a[_0xa1f1('0x24')]+_0x9555a['limit'];var _0x4e9806;if(_0x534fa3>=_0x1ddf20){_0x534fa3=_0x1ddf20;_0x4e9806=0xc8;}else{_0x4e9806=0xce;}_0x421500[_0xa1f1('0x1e')](_0x4e9806);return _0x421500['set'](_0xa1f1('0x25'),_0xfc2b0f+'-'+_0x534fa3+'/'+_0x1ddf20)['json'](_0x7f4358);}return null;};}function patchUpdates(_0x233cc0){return function(_0x273038){try{jsonpatch[_0xa1f1('0x26')](_0x273038,_0x233cc0,!![]);}catch(_0x57c130){return BPromise['reject'](_0x57c130);}return _0x273038[_0xa1f1('0x27')]();};}function saveUpdates(_0x43cd64,_0x1d6738){return function(_0x41ca3c){if(_0x41ca3c){return _0x41ca3c['update'](_0x43cd64)[_0xa1f1('0x28')](function(_0x33e9c3){return _0x33e9c3;});}return null;};}function removeEntity(_0x56c5bd,_0xa6c95d){return function(_0x2cd7eb){if(_0x2cd7eb){return _0x2cd7eb[_0xa1f1('0x29')]()[_0xa1f1('0x28')](function(){_0x56c5bd[_0xa1f1('0x1e')](0xcc)[_0xa1f1('0x1f')]();});}};}function handleEntityNotFound(_0x55d7c1,_0x9a8389){return function(_0x104967){if(!_0x104967){_0x55d7c1[_0xa1f1('0x1d')](0x194);}return _0x104967;};}function handleError(_0x574e7c,_0x1d9cbe){_0x1d9cbe=_0x1d9cbe||0x1f4;return function(_0x10dc52){logger['error'](_0x10dc52[_0xa1f1('0x2a')]);if(_0x10dc52[_0xa1f1('0x2b')]){delete _0x10dc52[_0xa1f1('0x2b')];}_0x574e7c[_0xa1f1('0x1e')](_0x1d9cbe)[_0xa1f1('0x2c')](_0x10dc52);};}exports[_0xa1f1('0x2d')]=function(_0x254614,_0xda850d){var _0x5f3e6b={},_0x449207={},_0x449521={'count':0x0,'rows':[]};var _0x52e4ca=_[_0xa1f1('0x2e')](db[_0xa1f1('0x2f')][_0xa1f1('0x30')],function(_0x1e1c35){return{'name':_0x1e1c35['fieldName'],'type':_0x1e1c35[_0xa1f1('0x31')][_0xa1f1('0x32')]};});_0x449207[_0xa1f1('0x33')]=_[_0xa1f1('0x2e')](_0x52e4ca,'name');_0x449207['query']=_[_0xa1f1('0x34')](_0x254614[_0xa1f1('0x35')]);_0x449207[_0xa1f1('0x36')]=_[_0xa1f1('0x37')](_0x449207[_0xa1f1('0x33')],_0x449207[_0xa1f1('0x35')]);_0x5f3e6b[_0xa1f1('0x38')]=_[_0xa1f1('0x37')](_0x449207[_0xa1f1('0x33')],qs['fields'](_0x254614[_0xa1f1('0x35')]['fields']));_0x5f3e6b[_0xa1f1('0x38')]=_0x5f3e6b[_0xa1f1('0x38')]['length']?_0x5f3e6b[_0xa1f1('0x38')]:_0x449207[_0xa1f1('0x33')];if(!_0x254614[_0xa1f1('0x35')][_0xa1f1('0x39')]('nolimit')){_0x5f3e6b[_0xa1f1('0x22')]=qs[_0xa1f1('0x22')](_0x254614[_0xa1f1('0x35')][_0xa1f1('0x22')]);_0x5f3e6b[_0xa1f1('0x24')]=qs[_0xa1f1('0x24')](_0x254614['query']['offset']);}_0x5f3e6b[_0xa1f1('0x3a')]=qs[_0xa1f1('0x3b')](_0x254614[_0xa1f1('0x35')]['sort']);_0x5f3e6b[_0xa1f1('0x3c')]=qs[_0xa1f1('0x36')](_['pick'](_0x254614['query'],_0x449207[_0xa1f1('0x36')]),_0x52e4ca);if(_0x254614[_0xa1f1('0x35')]['filter']){_0x5f3e6b[_0xa1f1('0x3c')]=_[_0xa1f1('0x3d')](_0x5f3e6b['where'],{'$or':_[_0xa1f1('0x2e')](_0x52e4ca,function(_0x377b1c){if(_0x377b1c['type']!==_0xa1f1('0x3e')){var _0x1f1951={};_0x1f1951[_0x377b1c[_0xa1f1('0x2b')]]={'$like':'%'+_0x254614[_0xa1f1('0x35')][_0xa1f1('0x3f')]+'%'};return _0x1f1951;}})});}_0x5f3e6b=_[_0xa1f1('0x3d')]({},_0x5f3e6b,_0x254614[_0xa1f1('0x40')]);var _0x158568={'where':_0x5f3e6b[_0xa1f1('0x3c')]};return db['ChatTransferReport'][_0xa1f1('0x23')](_0x158568)[_0xa1f1('0x28')](function(_0x21cf9b){_0x449521[_0xa1f1('0x23')]=_0x21cf9b;if(_0x254614[_0xa1f1('0x35')][_0xa1f1('0x41')]){_0x5f3e6b[_0xa1f1('0x42')]=[{'all':!![]}];}return db[_0xa1f1('0x2f')]['findAll'](_0x5f3e6b);})['then'](function(_0x4912f4){_0x449521[_0xa1f1('0x43')]=_0x4912f4;return _0x449521;})[_0xa1f1('0x28')](respondWithFilteredResult(_0xda850d,_0x5f3e6b))[_0xa1f1('0x44')](handleError(_0xda850d,null));};exports['show']=function(_0x4735e7,_0x175cf3){var _0x7e1056={'raw':!![],'where':{'id':_0x4735e7['params']['id']}},_0x5c48d4={};_0x5c48d4['model']=_[_0xa1f1('0x34')](db['ChatTransferReport']['rawAttributes']);_0x5c48d4['query']=_[_0xa1f1('0x34')](_0x4735e7[_0xa1f1('0x35')]);_0x5c48d4[_0xa1f1('0x36')]=_[_0xa1f1('0x37')](_0x5c48d4[_0xa1f1('0x33')],_0x5c48d4[_0xa1f1('0x35')]);_0x7e1056[_0xa1f1('0x38')]=_[_0xa1f1('0x37')](_0x5c48d4[_0xa1f1('0x33')],qs[_0xa1f1('0x45')](_0x4735e7[_0xa1f1('0x35')][_0xa1f1('0x45')]));_0x7e1056[_0xa1f1('0x38')]=_0x7e1056[_0xa1f1('0x38')][_0xa1f1('0x46')]?_0x7e1056[_0xa1f1('0x38')]:_0x5c48d4[_0xa1f1('0x33')];if(_0x4735e7['query']['includeAll']){_0x7e1056[_0xa1f1('0x42')]=[{'all':!![]}];}_0x7e1056=_['merge']({},_0x7e1056,_0x4735e7['options']);return db[_0xa1f1('0x2f')][_0xa1f1('0x47')](_0x7e1056)[_0xa1f1('0x28')](handleEntityNotFound(_0x175cf3,null))[_0xa1f1('0x28')](respondWithResult(_0x175cf3,null))[_0xa1f1('0x44')](handleError(_0x175cf3,null));};exports[_0xa1f1('0x48')]=function(_0x33845a,_0x16e3b3){return db[_0xa1f1('0x2f')][_0xa1f1('0x48')](_0x33845a[_0xa1f1('0x49')],{})['then'](respondWithResult(_0x16e3b3,0xc9))['catch'](handleError(_0x16e3b3,null));};exports['update']=function(_0x2845e3,_0x11caf7){if(_0x2845e3[_0xa1f1('0x49')]['id']){delete _0x2845e3[_0xa1f1('0x49')]['id'];}return db[_0xa1f1('0x2f')][_0xa1f1('0x47')]({'where':{'id':_0x2845e3[_0xa1f1('0x4a')]['id']}})[_0xa1f1('0x28')](handleEntityNotFound(_0x11caf7,null))[_0xa1f1('0x28')](saveUpdates(_0x2845e3[_0xa1f1('0x49')],null))[_0xa1f1('0x28')](respondWithResult(_0x11caf7,null))['catch'](handleError(_0x11caf7,null));};exports[_0xa1f1('0x29')]=function(_0x31b967,_0x22f3df){return db[_0xa1f1('0x2f')][_0xa1f1('0x47')]({'where':{'id':_0x31b967[_0xa1f1('0x4a')]['id']}})[_0xa1f1('0x28')](handleEntityNotFound(_0x22f3df,null))['then'](removeEntity(_0x22f3df,null))[_0xa1f1('0x44')](handleError(_0x22f3df,null));};exports[_0xa1f1('0x4b')]=function(_0x1a6329,_0x14fda0){return db[_0xa1f1('0x2f')][_0xa1f1('0x4b')]()[_0xa1f1('0x28')](respondWithResult(_0x14fda0,null))[_0xa1f1('0x44')](handleError(_0x14fda0,null));}; \ No newline at end of file +var _0x7081=['count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','length','catch','create','update','find','params','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x46e9f2,_0xb8c5f9){var _0x2ff437=function(_0x231e71){while(--_0x231e71){_0x46e9f2['push'](_0x46e9f2['shift']());}};_0x2ff437(++_0xb8c5f9);}(_0x7081,0x1b0));var _0x1708=function(_0x3cb41d,_0x2d7f6d){_0x3cb41d=_0x3cb41d-0x0;var _0x4dc372=_0x7081[_0x3cb41d];return _0x4dc372;};'use strict';var emlformat=require(_0x1708('0x0'));var rimraf=require(_0x1708('0x1'));var zipdir=require(_0x1708('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1708('0x3'));var moment=require(_0x1708('0x4'));var BPromise=require(_0x1708('0x5'));var Mustache=require(_0x1708('0x6'));var util=require(_0x1708('0x7'));var path=require(_0x1708('0x8'));var sox=require(_0x1708('0x9'));var csv=require(_0x1708('0xa'));var ejs=require(_0x1708('0xb'));var fs=require('fs');var fs_extra=require(_0x1708('0xc'));var _=require(_0x1708('0xd'));var squel=require(_0x1708('0xe'));var crypto=require(_0x1708('0xf'));var jsforce=require(_0x1708('0x10'));var deskjs=require(_0x1708('0x11'));var toCsv=require(_0x1708('0xa'));var querystring=require(_0x1708('0x12'));var Papa=require(_0x1708('0x13'));var Redis=require(_0x1708('0x14'));var authService=require(_0x1708('0x15'));var qs=require(_0x1708('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1708('0x17'));var logger=require(_0x1708('0x18'))(_0x1708('0x19'));var utils=require(_0x1708('0x1a'));var config=require(_0x1708('0x1b'));var licenseUtil=require(_0x1708('0x1c'));var db=require(_0x1708('0x1d'))['db'];function respondWithStatusCode(_0x2aa92b,_0x49119e){_0x49119e=_0x49119e||0xcc;return function(_0x24e49d){if(_0x24e49d){return _0x2aa92b[_0x1708('0x1e')](_0x49119e);}return _0x2aa92b[_0x1708('0x1f')](_0x49119e)[_0x1708('0x20')]();};}function respondWithResult(_0x3a3803,_0x58db99){_0x58db99=_0x58db99||0xc8;return function(_0x3e3475){if(_0x3e3475){return _0x3a3803[_0x1708('0x1f')](_0x58db99)[_0x1708('0x21')](_0x3e3475);}};}function respondWithFilteredResult(_0x4641ab,_0x4b2fdb){return function(_0x44e42c){if(_0x44e42c){var _0x3d6c49=typeof _0x4b2fdb[_0x1708('0x22')]===_0x1708('0x23')&&typeof _0x4b2fdb['limit']===_0x1708('0x23');var _0x9fe0de=_0x44e42c[_0x1708('0x24')];var _0x35ac0f=_0x3d6c49?0x0:_0x4b2fdb[_0x1708('0x22')];var _0x9a66ee=_0x3d6c49?_0x44e42c[_0x1708('0x24')]:_0x4b2fdb[_0x1708('0x22')]+_0x4b2fdb[_0x1708('0x25')];var _0x17e8bc;if(_0x9a66ee>=_0x9fe0de){_0x9a66ee=_0x9fe0de;_0x17e8bc=0xc8;}else{_0x17e8bc=0xce;}_0x4641ab[_0x1708('0x1f')](_0x17e8bc);return _0x4641ab[_0x1708('0x26')](_0x1708('0x27'),_0x35ac0f+'-'+_0x9a66ee+'/'+_0x9fe0de)[_0x1708('0x21')](_0x44e42c);}return null;};}function patchUpdates(_0x3c9290){return function(_0x5e23e4){try{jsonpatch[_0x1708('0x28')](_0x5e23e4,_0x3c9290,!![]);}catch(_0x2636d2){return BPromise[_0x1708('0x29')](_0x2636d2);}return _0x5e23e4[_0x1708('0x2a')]();};}function saveUpdates(_0x56894c,_0x31f4b4){return function(_0x4b74f0){if(_0x4b74f0){return _0x4b74f0['update'](_0x56894c)[_0x1708('0x2b')](function(_0x167105){return _0x167105;});}return null;};}function removeEntity(_0xf27153,_0x31a2d0){return function(_0x213fcf){if(_0x213fcf){return _0x213fcf[_0x1708('0x2c')]()[_0x1708('0x2b')](function(){_0xf27153[_0x1708('0x1f')](0xcc)[_0x1708('0x20')]();});}};}function handleEntityNotFound(_0x4e6a26,_0x55a2f5){return function(_0x43b557){if(!_0x43b557){_0x4e6a26[_0x1708('0x1e')](0x194);}return _0x43b557;};}function handleError(_0x2810f1,_0xff4709){_0xff4709=_0xff4709||0x1f4;return function(_0x403295){logger[_0x1708('0x2d')](_0x403295[_0x1708('0x2e')]);if(_0x403295['name']){delete _0x403295[_0x1708('0x2f')];}_0x2810f1[_0x1708('0x1f')](_0xff4709)[_0x1708('0x30')](_0x403295);};}exports['index']=function(_0x1ca7ef,_0x24527a){var _0x15b4c7={},_0x4c8c30={},_0x43be32={'count':0x0,'rows':[]};var _0x4589c3=_[_0x1708('0x31')](db[_0x1708('0x32')][_0x1708('0x33')],function(_0x3c04f0){return{'name':_0x3c04f0['fieldName'],'type':_0x3c04f0[_0x1708('0x34')][_0x1708('0x35')]};});_0x4c8c30[_0x1708('0x36')]=_[_0x1708('0x31')](_0x4589c3,_0x1708('0x2f'));_0x4c8c30['query']=_[_0x1708('0x37')](_0x1ca7ef[_0x1708('0x38')]);_0x4c8c30[_0x1708('0x39')]=_[_0x1708('0x3a')](_0x4c8c30[_0x1708('0x36')],_0x4c8c30[_0x1708('0x38')]);_0x15b4c7[_0x1708('0x3b')]=_[_0x1708('0x3a')](_0x4c8c30[_0x1708('0x36')],qs[_0x1708('0x3c')](_0x1ca7ef[_0x1708('0x38')][_0x1708('0x3c')]));_0x15b4c7[_0x1708('0x3b')]=_0x15b4c7[_0x1708('0x3b')]['length']?_0x15b4c7[_0x1708('0x3b')]:_0x4c8c30[_0x1708('0x36')];if(!_0x1ca7ef[_0x1708('0x38')]['hasOwnProperty'](_0x1708('0x3d'))){_0x15b4c7['limit']=qs['limit'](_0x1ca7ef[_0x1708('0x38')]['limit']);_0x15b4c7[_0x1708('0x22')]=qs[_0x1708('0x22')](_0x1ca7ef[_0x1708('0x38')]['offset']);}_0x15b4c7[_0x1708('0x3e')]=qs[_0x1708('0x3f')](_0x1ca7ef[_0x1708('0x38')][_0x1708('0x3f')]);_0x15b4c7[_0x1708('0x40')]=qs[_0x1708('0x39')](_['pick'](_0x1ca7ef[_0x1708('0x38')],_0x4c8c30['filters']),_0x4589c3);if(_0x1ca7ef[_0x1708('0x38')][_0x1708('0x41')]){_0x15b4c7['where']=_['merge'](_0x15b4c7[_0x1708('0x40')],{'$or':_[_0x1708('0x31')](_0x4589c3,function(_0x1f4949){if(_0x1f4949[_0x1708('0x34')]!==_0x1708('0x42')){var _0x36f09b={};_0x36f09b[_0x1f4949[_0x1708('0x2f')]]={'$like':'%'+_0x1ca7ef[_0x1708('0x38')][_0x1708('0x41')]+'%'};return _0x36f09b;}})});}_0x15b4c7=_[_0x1708('0x43')]({},_0x15b4c7,_0x1ca7ef['options']);var _0x5074cd={'where':_0x15b4c7[_0x1708('0x40')]};return db['ChatTransferReport'][_0x1708('0x24')](_0x5074cd)[_0x1708('0x2b')](function(_0x519604){_0x43be32[_0x1708('0x24')]=_0x519604;if(_0x1ca7ef[_0x1708('0x38')][_0x1708('0x44')]){_0x15b4c7[_0x1708('0x45')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x15b4c7);})[_0x1708('0x2b')](function(_0x44a306){_0x43be32['rows']=_0x44a306;return _0x43be32;})[_0x1708('0x2b')](respondWithFilteredResult(_0x24527a,_0x15b4c7))['catch'](handleError(_0x24527a,null));};exports['show']=function(_0x928f6d,_0x56e64f){var _0x2b9131={'raw':!![],'where':{'id':_0x928f6d['params']['id']}},_0x1ba296={};_0x1ba296[_0x1708('0x36')]=_[_0x1708('0x37')](db[_0x1708('0x32')][_0x1708('0x33')]);_0x1ba296[_0x1708('0x38')]=_[_0x1708('0x37')](_0x928f6d[_0x1708('0x38')]);_0x1ba296['filters']=_[_0x1708('0x3a')](_0x1ba296[_0x1708('0x36')],_0x1ba296[_0x1708('0x38')]);_0x2b9131[_0x1708('0x3b')]=_[_0x1708('0x3a')](_0x1ba296[_0x1708('0x36')],qs[_0x1708('0x3c')](_0x928f6d[_0x1708('0x38')]['fields']));_0x2b9131[_0x1708('0x3b')]=_0x2b9131[_0x1708('0x3b')][_0x1708('0x46')]?_0x2b9131[_0x1708('0x3b')]:_0x1ba296['model'];if(_0x928f6d[_0x1708('0x38')][_0x1708('0x44')]){_0x2b9131[_0x1708('0x45')]=[{'all':!![]}];}_0x2b9131=_[_0x1708('0x43')]({},_0x2b9131,_0x928f6d['options']);return db[_0x1708('0x32')]['find'](_0x2b9131)[_0x1708('0x2b')](handleEntityNotFound(_0x56e64f,null))[_0x1708('0x2b')](respondWithResult(_0x56e64f,null))[_0x1708('0x47')](handleError(_0x56e64f,null));};exports[_0x1708('0x48')]=function(_0x171eed,_0x210aae){return db[_0x1708('0x32')][_0x1708('0x48')](_0x171eed['body'],{})[_0x1708('0x2b')](respondWithResult(_0x210aae,0xc9))['catch'](handleError(_0x210aae,null));};exports[_0x1708('0x49')]=function(_0x44f60e,_0x125498){if(_0x44f60e['body']['id']){delete _0x44f60e['body']['id'];}return db[_0x1708('0x32')][_0x1708('0x4a')]({'where':{'id':_0x44f60e[_0x1708('0x4b')]['id']}})[_0x1708('0x2b')](handleEntityNotFound(_0x125498,null))[_0x1708('0x2b')](saveUpdates(_0x44f60e[_0x1708('0x4c')],null))[_0x1708('0x2b')](respondWithResult(_0x125498,null))[_0x1708('0x47')](handleError(_0x125498,null));};exports['destroy']=function(_0x4d19bc,_0x3fa49c){return db['ChatTransferReport'][_0x1708('0x4a')]({'where':{'id':_0x4d19bc[_0x1708('0x4b')]['id']}})[_0x1708('0x2b')](handleEntityNotFound(_0x3fa49c,null))[_0x1708('0x2b')](removeEntity(_0x3fa49c,null))['catch'](handleError(_0x3fa49c,null));};exports[_0x1708('0x4d')]=function(_0x225ed1,_0x199ec0){return db['ChatTransferReport']['describe']()[_0x1708('0x2b')](respondWithResult(_0x199ec0,null))[_0x1708('0x47')](handleError(_0x199ec0,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 9492b8e..a414d6b 100644 --- a/server/api/chatTransferReport/chatTransferReport.model.js +++ b/server/api/chatTransferReport/chatTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x153f=['../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x153f,0x1a5));var _0xf153=function(_0x491bd9,_0x150382){_0x491bd9=_0x491bd9-0x0;var _0x462dc0=_0x153f[_0x491bd9];return _0x462dc0;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var logger=require(_0xf153('0x2'))(_0xf153('0x3'));var moment=require(_0xf153('0x4'));var BPromise=require(_0xf153('0x5'));var rp=require(_0xf153('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf153('0x7'));var config=require(_0xf153('0x8'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x44b0e7,_0x16ac14){return _0x44b0e7[_0xf153('0x9')](_0xf153('0xa'),attributes,{'tableName':_0xf153('0xb'),'paranoid':![],'indexes':[{'name':_0xf153('0xc'),'fields':[_0xf153('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbdb9=['define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x181d63,_0x4c5932){var _0x2b32c3=function(_0x2b14aa){while(--_0x2b14aa){_0x181d63['push'](_0x181d63['shift']());}};_0x2b32c3(++_0x4c5932);}(_0xbdb9,0x11b));var _0x9bdb=function(_0x52b4a2,_0x1c5e9b){_0x52b4a2=_0x52b4a2-0x0;var _0x44ce7f=_0xbdb9[_0x52b4a2];return _0x44ce7f;};'use strict';var _=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var logger=require(_0x9bdb('0x2'))(_0x9bdb('0x3'));var moment=require(_0x9bdb('0x4'));var BPromise=require(_0x9bdb('0x5'));var rp=require(_0x9bdb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9bdb('0x7'));var config=require(_0x9bdb('0x8'));var attributes=require(_0x9bdb('0x9'));module[_0x9bdb('0xa')]=function(_0x3b3954,_0x4cdd03){return _0x3b3954[_0x9bdb('0xb')]('ChatTransferReport',attributes,{'tableName':_0x9bdb('0xc'),'paranoid':![],'indexes':[{'name':_0x9bdb('0xd'),'fields':[_0x9bdb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index ba3a7b7..438bbaa 100644 --- a/server/api/chatTransferReport/chatTransferReport.rpc.js +++ b/server/api/chatTransferReport/chatTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc01a=['rpc','../../config/environment','jayson/promise','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4ec898,_0x29ad51){var _0x359ecb=function(_0x6548a4){while(--_0x6548a4){_0x4ec898['push'](_0x4ec898['shift']());}};_0x359ecb(++_0x29ad51);}(_0xc01a,0xef));var _0xac01=function(_0x3dfa59,_0x4c3ad0){_0x3dfa59=_0x3dfa59-0x0;var _0x8dd739=_0xc01a[_0x3dfa59];return _0x8dd739;};'use strict';var _=require(_0xac01('0x0'));var util=require('util');var moment=require(_0xac01('0x1'));var BPromise=require(_0xac01('0x2'));var rs=require(_0xac01('0x3'));var fs=require('fs');var Redis=require(_0xac01('0x4'));var db=require(_0xac01('0x5'))['db'];var utils=require(_0xac01('0x6'));var logger=require(_0xac01('0x7'))(_0xac01('0x8'));var config=require(_0xac01('0x9'));var jayson=require(_0xac01('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ee830,_0x35e891,_0x5e3dcd){return new BPromise(function(_0x96d1b,_0x36b3d6){return client['request'](_0x1ee830,_0x5e3dcd)[_0xac01('0xb')](function(_0x5bf9ff){logger[_0xac01('0xc')](_0xac01('0xd'),_0x35e891,_0xac01('0xe'));logger['debug'](_0xac01('0xf'),_0x35e891,_0xac01('0xe'),JSON[_0xac01('0x10')](_0x5bf9ff));if(_0x5bf9ff[_0xac01('0x11')]){if(_0x5bf9ff[_0xac01('0x11')]['code']===0x1f4){logger['error'](_0xac01('0xd'),_0x35e891,_0x5bf9ff[_0xac01('0x11')][_0xac01('0x12')]);return _0x36b3d6(_0x5bf9ff[_0xac01('0x11')][_0xac01('0x12')]);}logger[_0xac01('0x11')](_0xac01('0xd'),_0x35e891,_0x5bf9ff[_0xac01('0x11')]['message']);return _0x96d1b(_0x5bf9ff['error'][_0xac01('0x12')]);}else{logger[_0xac01('0xc')](_0xac01('0xd'),_0x35e891,_0xac01('0xe'));_0x96d1b(_0x5bf9ff['result'][_0xac01('0x12')]);}})['catch'](function(_0x477aa1){logger[_0xac01('0x11')](_0xac01('0xd'),_0x35e891,_0x477aa1);_0x36b3d6(_0x477aa1);});});} \ No newline at end of file +var _0xd830=['stringify','error','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4023fd,_0x360c96){var _0x4aa334=function(_0x4593c4){while(--_0x4593c4){_0x4023fd['push'](_0x4023fd['shift']());}};_0x4aa334(++_0x360c96);}(_0xd830,0x1d0));var _0x0d83=function(_0x3bba68,_0x2dd2f0){_0x3bba68=_0x3bba68-0x0;var _0x13fa7f=_0xd830[_0x3bba68];return _0x13fa7f;};'use strict';var _=require(_0x0d83('0x0'));var util=require(_0x0d83('0x1'));var moment=require(_0x0d83('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d83('0x3'));var db=require(_0x0d83('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d83('0x5'))('rpc');var config=require(_0x0d83('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6a88f4,_0x36e14f,_0x548191){return new BPromise(function(_0x3e150c,_0x5e777a){return client[_0x0d83('0x7')](_0x6a88f4,_0x548191)[_0x0d83('0x8')](function(_0x174e8f){logger['info'](_0x0d83('0x9'),_0x36e14f,_0x0d83('0xa'));logger['debug'](_0x0d83('0xb'),_0x36e14f,_0x0d83('0xa'),JSON[_0x0d83('0xc')](_0x174e8f));if(_0x174e8f[_0x0d83('0xd')]){if(_0x174e8f[_0x0d83('0xd')]['code']===0x1f4){logger[_0x0d83('0xd')](_0x0d83('0x9'),_0x36e14f,_0x174e8f['error'][_0x0d83('0xe')]);return _0x5e777a(_0x174e8f[_0x0d83('0xd')][_0x0d83('0xe')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x36e14f,_0x174e8f['error'][_0x0d83('0xe')]);return _0x3e150c(_0x174e8f[_0x0d83('0xd')][_0x0d83('0xe')]);}else{logger[_0x0d83('0xf')](_0x0d83('0x9'),_0x36e14f,_0x0d83('0xa'));_0x3e150c(_0x174e8f[_0x0d83('0x10')]['message']);}})['catch'](function(_0x3a25b6){logger[_0x0d83('0xd')](_0x0d83('0x9'),_0x36e14f,_0x3a25b6);_0x5e777a(_0x3a25b6);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6c90bc8..8cd0eb4 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3168=['util','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy'];(function(_0x44bb08,_0x11e300){var _0x1d5878=function(_0x4c6a34){while(--_0x4c6a34){_0x44bb08['push'](_0x44bb08['shift']());}};_0x1d5878(++_0x11e300);}(_0x3168,0x110));var _0x8316=function(_0x200673,_0x4bf4e7){_0x200673=_0x200673-0x0;var _0x260b41=_0x3168[_0x200673];return _0x260b41;};'use strict';var multer=require('multer');var util=require(_0x8316('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8316('0x1'));var router=express[_0x8316('0x2')]();var fs_extra=require(_0x8316('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8316('0x4'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x8316('0x5')]('/',auth[_0x8316('0x6')](),controller[_0x8316('0x7')]);router['get'](_0x8316('0x8'),auth[_0x8316('0x6')](),controller[_0x8316('0x9')]);router[_0x8316('0x5')](_0x8316('0xa'),auth[_0x8316('0x6')](),controller[_0x8316('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8316('0xc')]);router[_0x8316('0xd')]('/:id',auth[_0x8316('0x6')](),controller[_0x8316('0xe')]);router['delete'](_0x8316('0xa'),auth[_0x8316('0x6')](),controller[_0x8316('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb9da=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','multer','util'];(function(_0x3627f6,_0x452fda){var _0x9521cb=function(_0x5de9e3){while(--_0x5de9e3){_0x3627f6['push'](_0x3627f6['shift']());}};_0x9521cb(++_0x452fda);}(_0xb9da,0x154));var _0xab9d=function(_0x5b36bd,_0x4dfb36){_0x5b36bd=_0x5b36bd-0x0;var _0x1614fe=_0xb9da[_0x5b36bd];return _0x1614fe;};'use strict';var multer=require(_0xab9d('0x0'));var util=require(_0xab9d('0x1'));var path=require(_0xab9d('0x2'));var timeout=require(_0xab9d('0x3'));var express=require('express');var router=express[_0xab9d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xab9d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab9d('0x6'));var controller=require(_0xab9d('0x7'));router[_0xab9d('0x8')]('/',auth[_0xab9d('0x9')](),controller['index']);router[_0xab9d('0x8')](_0xab9d('0xa'),auth['isAuthenticated'](),controller[_0xab9d('0xb')]);router[_0xab9d('0x8')](_0xab9d('0xc'),auth[_0xab9d('0x9')](),controller[_0xab9d('0xd')]);router[_0xab9d('0xe')]('/',auth['isAuthenticated'](),controller[_0xab9d('0xf')]);router['put'](_0xab9d('0xc'),auth[_0xab9d('0x9')](),controller[_0xab9d('0x10')]);router[_0xab9d('0x11')](_0xab9d('0xc'),auth[_0xab9d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 54cefc4..de95b46 100644 --- a/server/api/chatWebsite/chatWebsite.attributes.js +++ b/server/api/chatWebsite/chatWebsite.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','offlineForm','parse','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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x317eb4,_0x182228){var _0x47778c=function(_0x388c44){while(--_0x388c44){_0x317eb4['push'](_0x317eb4['shift']());}};_0x47778c(++_0x182228);}(_0xee5b,0x1f4));var _0xbee5=function(_0x46da9b,_0x323563){_0x46da9b=_0x46da9b-0x0;var _0x4bd690=_0xee5b[_0x46da9b];return _0x4bd690;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}}; \ No newline at end of file +var _0xd2ea=['Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#011F6A','INTEGER','BOOLEAN','ENUM','squared','We\x20are\x20here!','Chat','Send','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','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea'];(function(_0x4d13b4,_0x3fd061){var _0x92ba98=function(_0x470028){while(--_0x470028){_0x4d13b4['push'](_0x4d13b4['shift']());}};_0x92ba98(++_0x3fd061);}(_0xd2ea,0x15f));var _0xad2e=function(_0x24c57b,_0x2ab0c0){_0x24c57b=_0x24c57b-0x0;var _0x1d0146=_0xd2ea[_0x24c57b];return _0x1d0146;};'use strict';var Sequelize=require(_0xad2e('0x0'));var rs=require(_0xad2e('0x1'));module[_0xad2e('0x2')]={'name':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xad2e('0x3')]},'mapKey':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x4')},'mapKeyOffline':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x4')},'key':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':_0xad2e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xad2e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xad2e('0x3')]},'animation':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xad2e('0x8')]('rounded',_0xad2e('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xa')},'start_chat_button':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xad2e('0xe')]},'closingQuestion':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x11')},'noteTitle':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x12')},'placeholderMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x13')},'closingMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x14')},'closingMessageButton':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x16')},'ratingType':{'type':Sequelize[_0xad2e('0x8')](_0xad2e('0x17'),_0xad2e('0x18')),'defaultValue':_0xad2e('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xad2e('0xe')],'defaultValue':function(){return JSON[_0xad2e('0x19')]({'items':[{'type':_0xad2e('0x1a'),'variable':null,'config':{'placeholder':_0xad2e('0x1b'),'type':_0xad2e('0x1c'),'required':!![]},'props':{'title':_0xad2e('0x1b'),'helpText':''}},{'type':_0xad2e('0x1a'),'props':{'title':_0xad2e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xad2e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xad2e('0x1d')](_0xad2e('0x1e'))?JSON[_0xad2e('0x1f')](this[_0xad2e('0x1d')](_0xad2e('0x1e'))):{};},'set':function(_0x58acc8){return this[_0xad2e('0x20')](_0xad2e('0x1e'),JSON[_0xad2e('0x19')](_0x58acc8));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xad2e('0x19')]({'items':[{'type':'input','props':{'title':_0xad2e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xad2e('0x4'),'type':_0xad2e('0x4')},'variable':null},{'type':_0xad2e('0x21'),'config':{'placeholder':_0xad2e('0x22')},'props':{'title':_0xad2e('0x22'),'helpText':_0xad2e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xad2e('0x1d')](_0xad2e('0x24'))?JSON[_0xad2e('0x1f')](this['getDataValue'](_0xad2e('0x24'))):{};},'set':function(_0xfd2087){return this[_0xad2e('0x20')](_0xad2e('0x24'),JSON[_0xad2e('0x19')](_0xfd2087));}},'token':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':function(){return rs[_0xad2e('0x25')]();}},'autoclose':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xad2e('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xad2e('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x26')},'waitingMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xad2e('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xad2e('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xad2e('0x2b');}},'notificationSound':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xad2e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2e')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2f')},'defaultTitle':{'type':Sequelize[_0xad2e('0x3')]},'customerAvatar':{'type':Sequelize[_0xad2e('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xad2e('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xad2e('0x6')],'comment':_0xad2e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![],'comment':_0xad2e('0x32'),'set':function(_0x6f4fbc){if(!_0x6f4fbc)this[_0xad2e('0x20')](_0xad2e('0x33'),null);this['setDataValue'](_0xad2e('0x34'),_0x6f4fbc);}},'vidaooEscalation':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xad2e('0x3')]},'vidaooTopic':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':_0xad2e('0x35')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xad2e('0x36');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xad2e('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 2175bdd..60f097d 100644 --- a/server/api/chatWebsite/chatWebsite.controller.js +++ b/server/api/chatWebsite/chatWebsite.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ab7=['asc','account','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','format','device','vendor','stringify','threadId','externalUrl','ChatInteraction','interaction','spread','messageId','created','autoclose','push','close','unmanaged','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','startRouting','EventManager','offline','files','CompanyId','ListId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','ChatOfflineMessage','fromString','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','email','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','omit','getInteractions','Owner','fullname','Tag','Tags','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','URL','3.1.0','remote','x-real-ip','referer','alignment','verticalAlignment','labelText','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','register','html-to-text','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','ChatWebsite','includeAll','include','rows','show','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','body','describe','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','systemAvatar','join','root','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','ChatApplication','Applications','orderBy','applications','priority'];(function(_0x11527e,_0x28531f){var _0x403cde=function(_0x256cae){while(--_0x256cae){_0x11527e['push'](_0x11527e['shift']());}};_0x403cde(++_0x28531f);}(_0x6ab7,0x95));var _0x76ab=function(_0x646593,_0x4cb166){_0x646593=_0x646593-0x0;var _0x13c3f7=_0x6ab7[_0x646593];return _0x13c3f7;};'use strict';var BPromise=require(_0x76ab('0x0'));var Mustache=require(_0x76ab('0x1'));var util=require(_0x76ab('0x2'));var path=require(_0x76ab('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76ab('0x4'));var _=require(_0x76ab('0x5'));var querystring=require(_0x76ab('0x6'));var Redis=require(_0x76ab('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x76ab('0x8'))(_0x76ab('0x9'));var config=require(_0x76ab('0xa'));var url=require('url');var db=require(_0x76ab('0xb'))['db'];config['redis']=_[_0x76ab('0xc')](config[_0x76ab('0xd')],{'host':_0x76ab('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x76ab('0xf')](socket);var htmlToText=require(_0x76ab('0x10'));var jayson=require('jayson/promise');var client=jayson[_0x76ab('0x11')][_0x76ab('0x12')]({'port':0x232c});var client9002=jayson[_0x76ab('0x11')][_0x76ab('0x12')]({'port':0x232a});var client9003=jayson[_0x76ab('0x11')][_0x76ab('0x12')]({'port':0x232b});var client9001=jayson['client'][_0x76ab('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x107ba7,_0x21cb19,_0x550bca,_0x1d6223){return new BPromise(function(_0x49c5bb,_0x5708d0){var _0xb00b6c=_0x1d6223||client;return _0xb00b6c[_0x76ab('0x13')](_0x107ba7,_0x550bca)[_0x76ab('0x14')](function(_0x309a40){logger[_0x76ab('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x21cb19,_0x76ab('0x16'));logger[_0x76ab('0x17')](_0x76ab('0x18'),_0x21cb19,_0x76ab('0x16'),JSON['stringify'](_0x309a40));if(_0x309a40[_0x76ab('0x19')]){if(_0x309a40['error']['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x21cb19,_0x309a40[_0x76ab('0x19')][_0x76ab('0x1a')]);return _0x5708d0(_0x309a40[_0x76ab('0x19')][_0x76ab('0x1a')]);}logger[_0x76ab('0x19')](_0x76ab('0x1b'),_0x21cb19,_0x309a40[_0x76ab('0x19')][_0x76ab('0x1a')]);return _0x49c5bb(_0x309a40[_0x76ab('0x19')][_0x76ab('0x1a')]);}else{logger['info'](_0x76ab('0x1b'),_0x21cb19,_0x76ab('0x16'));_0x49c5bb(_0x309a40[_0x76ab('0x1c')][_0x76ab('0x1a')]);}})[_0x76ab('0x1d')](function(_0x453fcc){logger['error'](_0x76ab('0x1b'),_0x21cb19,_0x453fcc);_0x5708d0(_0x453fcc);});});}function respondWithStatusCode(_0x414e74,_0x1f653d){_0x1f653d=_0x1f653d||0xcc;return function(_0x35f68b){if(_0x35f68b){return _0x414e74[_0x76ab('0x1e')](_0x1f653d);}return _0x414e74[_0x76ab('0x1f')](_0x1f653d)[_0x76ab('0x20')]();};}function respondWithResult(_0x3df8cc,_0x55117d){_0x55117d=_0x55117d||0xc8;return function(_0x3bfaa7){if(_0x3bfaa7){return _0x3df8cc[_0x76ab('0x1f')](_0x55117d)[_0x76ab('0x21')](_0x3bfaa7);}};}function respondWithFilteredResult(_0x1d6d30,_0x38c7cf){return function(_0x4736a7){if(_0x4736a7){var _0x43e234=typeof _0x38c7cf[_0x76ab('0x22')]===_0x76ab('0x23')&&typeof _0x38c7cf[_0x76ab('0x24')]==='undefined';var _0x1146ad=_0x4736a7[_0x76ab('0x25')];var _0x16a6c6=_0x43e234?0x0:_0x38c7cf[_0x76ab('0x22')];var _0x4925a0=_0x43e234?_0x4736a7[_0x76ab('0x25')]:_0x38c7cf['offset']+_0x38c7cf['limit'];var _0x302142;if(_0x4925a0>=_0x1146ad){_0x4925a0=_0x1146ad;_0x302142=0xc8;}else{_0x302142=0xce;}_0x1d6d30['status'](_0x302142);return _0x1d6d30[_0x76ab('0x26')]('Content-Range',_0x16a6c6+'-'+_0x4925a0+'/'+_0x1146ad)[_0x76ab('0x21')](_0x4736a7);}return null;};}function saveUpdates(_0x4667c1){return function(_0x24fee8){if(_0x24fee8){return _0x24fee8[_0x76ab('0x27')](_0x4667c1)[_0x76ab('0x14')](function(_0x5db0f5){return _0x5db0f5;});}return null;};}function removeEntity(_0x2f29e0){return function(_0x4a1aa9){if(_0x4a1aa9){return _0x4a1aa9[_0x76ab('0x28')]()[_0x76ab('0x14')](function(){var _0x5d44c0=_0x4a1aa9[_0x76ab('0x29')]({'plain':!![]});var _0x1459b3=_0x76ab('0x2a');return db[_0x76ab('0x2b')][_0x76ab('0x28')]({'where':{'type':_0x1459b3,'resourceId':_0x5d44c0['id']}})[_0x76ab('0x14')](function(){return _0x4a1aa9;});})[_0x76ab('0x14')](function(){_0x2f29e0[_0x76ab('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x547c6f){return function(_0x6bbe58){if(!_0x6bbe58){_0x547c6f[_0x76ab('0x1e')](0x194);}return _0x6bbe58;};}function handleError(_0x52ab39,_0x18d564){_0x18d564=_0x18d564||0x1f4;return function(_0x54c295){logger[_0x76ab('0x19')](_0x54c295[_0x76ab('0x2c')]);if(_0x54c295[_0x76ab('0x2d')]){delete _0x54c295[_0x76ab('0x2d')];}_0x52ab39['status'](_0x18d564)[_0x76ab('0x2e')](_0x54c295);};}exports[_0x76ab('0x2f')]=function(_0x479483,_0x777e6){var _0x180599={'include':[{'model':db[_0x76ab('0x30')],'as':_0x76ab('0x31')}]},_0x14897c={},_0x498180={'count':0x0,'rows':[]};var _0x3c0f06=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x1e6b08){return{'name':_0x1e6b08[_0x76ab('0x32')],'type':_0x1e6b08[_0x76ab('0x33')][_0x76ab('0x34')]};});_0x14897c[_0x76ab('0x35')]=_[_0x76ab('0x36')](_0x3c0f06,'name');_0x14897c[_0x76ab('0x37')]=_[_0x76ab('0x38')](_0x479483[_0x76ab('0x37')]);_0x14897c[_0x76ab('0x39')]=_[_0x76ab('0x3a')](_0x14897c[_0x76ab('0x35')],_0x14897c[_0x76ab('0x37')]);_0x180599[_0x76ab('0x3b')]=_[_0x76ab('0x3a')](_0x14897c[_0x76ab('0x35')],qs['fields'](_0x479483['query'][_0x76ab('0x3c')]));_0x180599[_0x76ab('0x3b')]=_0x180599[_0x76ab('0x3b')][_0x76ab('0x3d')]?_0x180599['attributes']:_0x14897c[_0x76ab('0x35')];if(!_0x479483[_0x76ab('0x37')][_0x76ab('0x3e')](_0x76ab('0x3f'))){_0x180599['limit']=qs['limit'](_0x479483[_0x76ab('0x37')][_0x76ab('0x24')]);_0x180599[_0x76ab('0x22')]=qs[_0x76ab('0x22')](_0x479483[_0x76ab('0x37')][_0x76ab('0x22')]);}_0x180599[_0x76ab('0x40')]=qs[_0x76ab('0x41')](_0x479483[_0x76ab('0x37')][_0x76ab('0x41')]);_0x180599['where']=qs['filters'](_[_0x76ab('0x42')](_0x479483[_0x76ab('0x37')],_0x14897c[_0x76ab('0x39')]),_0x3c0f06);if(_0x479483[_0x76ab('0x37')]['filter']){_0x180599[_0x76ab('0x43')]=_[_0x76ab('0x44')](_0x180599[_0x76ab('0x43')],{'$or':_[_0x76ab('0x36')](_0x3c0f06,function(_0x1f0d17){if(_0x1f0d17[_0x76ab('0x33')]!==_0x76ab('0x45')){var _0x56fa6b={};_0x56fa6b[_0x1f0d17['name']]={'$like':'%'+_0x479483[_0x76ab('0x37')][_0x76ab('0x46')]+'%'};return _0x56fa6b;}})});}_0x180599=_['merge']({},_0x180599,_0x479483[_0x76ab('0x47')]);var _0x30395e={'where':_0x180599[_0x76ab('0x43')]};return db[_0x76ab('0x48')]['count'](_0x30395e)[_0x76ab('0x14')](function(_0x435921){_0x498180[_0x76ab('0x25')]=_0x435921;if(_0x479483[_0x76ab('0x37')][_0x76ab('0x49')]){_0x180599[_0x76ab('0x4a')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x180599);})['then'](function(_0x130a04){_0x498180[_0x76ab('0x4b')]=_0x130a04;return _0x498180;})[_0x76ab('0x14')](respondWithFilteredResult(_0x777e6,_0x180599))[_0x76ab('0x1d')](handleError(_0x777e6,null));};exports[_0x76ab('0x4c')]=function(_0x52ba11,_0x19b773){var _0x2cac8a={'raw':![],'where':{'id':_0x52ba11[_0x76ab('0x4d')]['id']},'include':[{'model':db[_0x76ab('0x30')],'as':_0x76ab('0x31')}]},_0x1832eb={};_0x1832eb['model']=_[_0x76ab('0x38')](db[_0x76ab('0x48')][_0x76ab('0x4e')]);_0x1832eb[_0x76ab('0x37')]=_['keys'](_0x52ba11[_0x76ab('0x37')]);_0x1832eb[_0x76ab('0x39')]=_[_0x76ab('0x3a')](_0x1832eb['model'],_0x1832eb[_0x76ab('0x37')]);_0x2cac8a[_0x76ab('0x3b')]=_[_0x76ab('0x3a')](_0x1832eb[_0x76ab('0x35')],qs[_0x76ab('0x3c')](_0x52ba11[_0x76ab('0x37')]['fields']));_0x2cac8a['attributes']=_0x2cac8a[_0x76ab('0x3b')][_0x76ab('0x3d')]?_0x2cac8a['attributes']:_0x1832eb['model'];if(_0x52ba11['query']['includeAll']){_0x2cac8a['include']=[{'all':!![]}];}_0x2cac8a=_[_0x76ab('0x44')]({},_0x2cac8a,_0x52ba11['options']);return db[_0x76ab('0x48')]['find'](_0x2cac8a)[_0x76ab('0x14')](handleEntityNotFound(_0x19b773,null))[_0x76ab('0x14')](respondWithResult(_0x19b773,null))[_0x76ab('0x1d')](handleError(_0x19b773,null));};exports[_0x76ab('0x4f')]=function(_0x365f5c,_0x2b6764){return db[_0x76ab('0x48')][_0x76ab('0x4f')](_0x365f5c['body'],{})[_0x76ab('0x14')](function(_0x31404a){var _0x5b3288=_0x365f5c[_0x76ab('0x50')][_0x76ab('0x29')]({'plain':!![]});if(!_0x5b3288)throw new Error(_0x76ab('0x51'));if(_0x5b3288[_0x76ab('0x52')]==='user'){var _0x402631=_0x31404a[_0x76ab('0x29')]({'plain':!![]});var _0x2f3010='ChatWebsites';return db['UserProfileSection'][_0x76ab('0x53')]({'where':{'name':_0x2f3010,'userProfileId':_0x5b3288['userProfileId']},'raw':!![]})['then'](function(_0x1dd630){if(_0x1dd630&&_0x1dd630['autoAssociation']===0x0){return db[_0x76ab('0x2b')][_0x76ab('0x4f')]({'name':_0x402631[_0x76ab('0x2d')],'resourceId':_0x402631['id'],'type':_0x1dd630[_0x76ab('0x2d')],'sectionId':_0x1dd630['id']},{})[_0x76ab('0x14')](function(){return _0x31404a;});}else{return _0x31404a;}})['catch'](function(_0xbd8989){logger[_0x76ab('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbd8989);throw _0xbd8989;});}return _0x31404a;})['then'](respondWithResult(_0x2b6764,0xc9))[_0x76ab('0x1d')](handleError(_0x2b6764,null));};exports[_0x76ab('0x27')]=function(_0x399424,_0x3ca783){if(_0x399424[_0x76ab('0x54')]['id']){delete _0x399424['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x399424[_0x76ab('0x4d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3ca783,null))[_0x76ab('0x14')](saveUpdates(_0x399424[_0x76ab('0x54')],null))[_0x76ab('0x14')](respondWithResult(_0x3ca783,null))[_0x76ab('0x1d')](handleError(_0x3ca783,null));};exports['destroy']=function(_0x1ce449,_0xf0edf3){return db['ChatWebsite'][_0x76ab('0x53')]({'where':{'id':_0x1ce449[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0xf0edf3,null))[_0x76ab('0x14')](removeEntity(_0xf0edf3,null))[_0x76ab('0x1d')](handleError(_0xf0edf3,null));};exports[_0x76ab('0x55')]=function(_0x21cc1e,_0x4ddc34){return db['ChatWebsite']['describe']()['then'](respondWithResult(_0x4ddc34,null))[_0x76ab('0x1d')](handleError(_0x4ddc34,null));};exports['addDisposition']=function(_0x2bd640,_0x5cf742){if(_0x2bd640[_0x76ab('0x54')]['id']){delete _0x2bd640[_0x76ab('0x54')]['id'];}return db['ChatWebsite'][_0x76ab('0x53')]({'where':{'id':_0x2bd640[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x5cf742,null))['then'](function(_0x3a6f67){if(_0x3a6f67){_0x2bd640[_0x76ab('0x54')][_0x76ab('0x56')]=_0x3a6f67['id'];return db[_0x76ab('0x57')][_0x76ab('0x4f')](_0x2bd640[_0x76ab('0x54')]);}})[_0x76ab('0x14')](respondWithResult(_0x5cf742,null))[_0x76ab('0x1d')](handleError(_0x5cf742,null));};exports[_0x76ab('0x58')]=function(_0x1fd9c5,_0x530bd3){var _0x23b655={'raw':![],'where':{}};var _0x2635ed={};var _0x3a2284={'count':0x0,'rows':[]};return db[_0x76ab('0x48')][_0x76ab('0x59')]({'where':{'id':_0x1fd9c5[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x530bd3,null))[_0x76ab('0x14')](function(_0xad01b7){if(_0xad01b7){_0x2635ed['model']=_['keys'](db[_0x76ab('0x57')]['rawAttributes']);_0x2635ed[_0x76ab('0x37')]=_[_0x76ab('0x38')](_0x1fd9c5['query']);_0x2635ed[_0x76ab('0x39')]=_[_0x76ab('0x3a')](_0x2635ed[_0x76ab('0x35')],_0x2635ed[_0x76ab('0x37')]);_0x23b655[_0x76ab('0x3b')]=_[_0x76ab('0x3a')](_0x2635ed['model'],qs['fields'](_0x1fd9c5[_0x76ab('0x37')][_0x76ab('0x3c')]));_0x23b655[_0x76ab('0x3b')]=_0x23b655[_0x76ab('0x3b')][_0x76ab('0x3d')]?_0x23b655[_0x76ab('0x3b')]:_0x2635ed[_0x76ab('0x35')];if(!_0x1fd9c5['query'][_0x76ab('0x3e')](_0x76ab('0x3f'))){_0x23b655[_0x76ab('0x24')]=qs[_0x76ab('0x24')](_0x1fd9c5[_0x76ab('0x37')]['limit']);_0x23b655[_0x76ab('0x22')]=qs[_0x76ab('0x22')](_0x1fd9c5[_0x76ab('0x37')][_0x76ab('0x22')]);}_0x23b655[_0x76ab('0x40')]=qs[_0x76ab('0x41')](_0x1fd9c5['query'][_0x76ab('0x41')]);_0x23b655[_0x76ab('0x43')]=qs[_0x76ab('0x39')](_[_0x76ab('0x42')](_0x1fd9c5[_0x76ab('0x37')],_0x2635ed['filters']));_0x23b655[_0x76ab('0x43')][_0x76ab('0x56')]=_0xad01b7['id'];if(_0x1fd9c5[_0x76ab('0x37')][_0x76ab('0x46')]){_0x23b655[_0x76ab('0x43')]=_['merge'](_0x23b655[_0x76ab('0x43')],{'$or':_[_0x76ab('0x36')](_0x23b655[_0x76ab('0x3b')],function(_0x495cb2){var _0x2ae566={};_0x2ae566[_0x495cb2]={'$like':'%'+_0x1fd9c5['query'][_0x76ab('0x46')]+'%'};return _0x2ae566;})});}_0x23b655=_[_0x76ab('0x44')]({},_0x23b655,_0x1fd9c5['options']);return db['Disposition'][_0x76ab('0x25')]({'where':_0x23b655[_0x76ab('0x43')]})['then'](function(_0x1ef161){_0x3a2284[_0x76ab('0x25')]=_0x1ef161;if(_0x1fd9c5[_0x76ab('0x37')][_0x76ab('0x49')]){_0x23b655[_0x76ab('0x4a')]=[{'all':!![]}];}return db['Disposition'][_0x76ab('0x5a')](_0x23b655);})[_0x76ab('0x14')](function(_0x202824){_0x3a2284[_0x76ab('0x4b')]=_0x202824;return _0x3a2284;});}})[_0x76ab('0x14')](respondWithFilteredResult(_0x530bd3,_0x23b655))['catch'](handleError(_0x530bd3,null));};exports['removeDispositions']=function(_0x597ece,_0xed4e9d){return db[_0x76ab('0x48')]['find']({'where':{'id':_0x597ece['params']['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0xed4e9d,null))[_0x76ab('0x14')](function(_0x26836b){if(_0x26836b){return _0x26836b[_0x76ab('0x5b')](_0x597ece[_0x76ab('0x37')][_0x76ab('0x5c')]);}})[_0x76ab('0x14')](respondWithStatusCode(_0xed4e9d,null))['catch'](handleError(_0xed4e9d,null));};exports[_0x76ab('0x5d')]=function(_0x41067a,_0x507c19){if(_0x41067a['body']['id']){delete _0x41067a[_0x76ab('0x54')]['id'];}return db['ChatWebsite'][_0x76ab('0x53')]({'where':{'id':_0x41067a[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x507c19,null))[_0x76ab('0x14')](function(_0x1c3e7b){if(_0x1c3e7b){_0x41067a[_0x76ab('0x54')][_0x76ab('0x56')]=_0x1c3e7b['id'];return db[_0x76ab('0x5e')][_0x76ab('0x4f')](_0x41067a[_0x76ab('0x54')]);}})[_0x76ab('0x14')](respondWithResult(_0x507c19,null))[_0x76ab('0x1d')](handleError(_0x507c19,null));};exports[_0x76ab('0x5f')]=function(_0x160bc6,_0x45f5a1){var _0x5ded8b={'raw':![],'where':{}};var _0x4b3f35={};var _0x3775a6={'count':0x0,'rows':[]};return db[_0x76ab('0x48')]['findOne']({'where':{'id':_0x160bc6[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x45f5a1,null))[_0x76ab('0x14')](function(_0x4ba1fd){if(_0x4ba1fd){_0x4b3f35[_0x76ab('0x35')]=_[_0x76ab('0x38')](db[_0x76ab('0x5e')]['rawAttributes']);_0x4b3f35[_0x76ab('0x37')]=_[_0x76ab('0x38')](_0x160bc6[_0x76ab('0x37')]);_0x4b3f35[_0x76ab('0x39')]=_[_0x76ab('0x3a')](_0x4b3f35[_0x76ab('0x35')],_0x4b3f35[_0x76ab('0x37')]);_0x5ded8b[_0x76ab('0x3b')]=_[_0x76ab('0x3a')](_0x4b3f35['model'],qs['fields'](_0x160bc6[_0x76ab('0x37')][_0x76ab('0x3c')]));_0x5ded8b[_0x76ab('0x3b')]=_0x5ded8b[_0x76ab('0x3b')]['length']?_0x5ded8b[_0x76ab('0x3b')]:_0x4b3f35[_0x76ab('0x35')];if(!_0x160bc6[_0x76ab('0x37')]['hasOwnProperty'](_0x76ab('0x3f'))){_0x5ded8b[_0x76ab('0x24')]=qs[_0x76ab('0x24')](_0x160bc6[_0x76ab('0x37')][_0x76ab('0x24')]);_0x5ded8b['offset']=qs[_0x76ab('0x22')](_0x160bc6[_0x76ab('0x37')][_0x76ab('0x22')]);}_0x5ded8b['order']=qs[_0x76ab('0x41')](_0x160bc6[_0x76ab('0x37')][_0x76ab('0x41')]);_0x5ded8b[_0x76ab('0x43')]=qs[_0x76ab('0x39')](_['pick'](_0x160bc6[_0x76ab('0x37')],_0x4b3f35['filters']));_0x5ded8b[_0x76ab('0x43')][_0x76ab('0x56')]=_0x4ba1fd['id'];if(_0x160bc6[_0x76ab('0x37')]['filter']){_0x5ded8b['where']=_[_0x76ab('0x44')](_0x5ded8b[_0x76ab('0x43')],{'$or':_[_0x76ab('0x36')](_0x5ded8b[_0x76ab('0x3b')],function(_0x40d816){var _0x379977={};_0x379977[_0x40d816]={'$like':'%'+_0x160bc6[_0x76ab('0x37')][_0x76ab('0x46')]+'%'};return _0x379977;})});}_0x5ded8b=_[_0x76ab('0x44')]({},_0x5ded8b,_0x160bc6[_0x76ab('0x47')]);return db[_0x76ab('0x5e')]['count']({'where':_0x5ded8b['where']})[_0x76ab('0x14')](function(_0x389d0e){_0x3775a6[_0x76ab('0x25')]=_0x389d0e;if(_0x160bc6[_0x76ab('0x37')]['includeAll']){_0x5ded8b[_0x76ab('0x4a')]=[{'all':!![]}];}return db[_0x76ab('0x5e')]['findAll'](_0x5ded8b);})[_0x76ab('0x14')](function(_0xb7802d){_0x3775a6[_0x76ab('0x4b')]=_0xb7802d;return _0x3775a6;});}})[_0x76ab('0x14')](respondWithFilteredResult(_0x45f5a1,_0x5ded8b))[_0x76ab('0x1d')](handleError(_0x45f5a1,null));};exports['removeAnswers']=function(_0x222622,_0x5ccfc6){return db[_0x76ab('0x48')][_0x76ab('0x53')]({'where':{'id':_0x222622['params']['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x5ccfc6,null))[_0x76ab('0x14')](function(_0x16a908){if(_0x16a908){return _0x16a908[_0x76ab('0x60')](_0x222622['query'][_0x76ab('0x5c')]);}})[_0x76ab('0x14')](respondWithStatusCode(_0x5ccfc6,null))[_0x76ab('0x1d')](handleError(_0x5ccfc6,null));};exports[_0x76ab('0x61')]=function(_0x122bd6,_0x5133ef){_0x122bd6[_0x76ab('0x54')][_0x76ab('0x62')]=_0x122bd6[_0x76ab('0x63')]['filename'];return db[_0x76ab('0x48')][_0x76ab('0x53')]({'where':{'id':_0x122bd6[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x5133ef,null))['then'](saveUpdates(_0x122bd6[_0x76ab('0x54')],null))[_0x76ab('0x14')](respondWithResult(_0x5133ef,null))[_0x76ab('0x1d')](handleError(_0x5133ef,null));};exports[_0x76ab('0x64')]=function(_0xa9eb48,_0x537439){_0xa9eb48[_0x76ab('0x54')][_0x76ab('0x65')]=_0xa9eb48[_0x76ab('0x63')]['filename'];return db[_0x76ab('0x48')][_0x76ab('0x53')]({'where':{'id':_0xa9eb48[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x537439,null))[_0x76ab('0x14')](saveUpdates(_0xa9eb48[_0x76ab('0x54')],null))[_0x76ab('0x14')](respondWithResult(_0x537439,null))[_0x76ab('0x1d')](handleError(_0x537439,null));};exports['addCustomerAvatar']=function(_0x325ff5,_0x8a005e){_0x325ff5[_0x76ab('0x54')]['customerAvatar']=_0x325ff5['file'][_0x76ab('0x66')];return db[_0x76ab('0x48')]['find']({'where':{'id':_0x325ff5[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x8a005e,null))['then'](saveUpdates(_0x325ff5['body'],null))[_0x76ab('0x14')](respondWithResult(_0x8a005e,null))[_0x76ab('0x1d')](handleError(_0x8a005e,null));};exports['addSystemAvatar']=function(_0x2d2965,_0x4ce81d){_0x2d2965['body'][_0x76ab('0x67')]=_0x2d2965[_0x76ab('0x63')][_0x76ab('0x66')];return db['ChatWebsite'][_0x76ab('0x53')]({'where':{'id':_0x2d2965['params']['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x4ce81d,null))[_0x76ab('0x14')](saveUpdates(_0x2d2965[_0x76ab('0x54')],null))[_0x76ab('0x14')](respondWithResult(_0x4ce81d,null))['catch'](handleError(_0x4ce81d,null));};exports['getLogo']=function(_0x3fc003,_0x1516a5){var _0x2ebff7=path[_0x76ab('0x68')](config[_0x76ab('0x69')],'server/files/images/logos/default_logo.svg');var _0x23b1d2={'where':{'id':_0x3fc003['params']['id']},'attributes':['id',_0x76ab('0x62')],'raw':!![]};var _0x389746=![];return require(_0x76ab('0x6a'))['getLicense']()[_0x76ab('0x14')](function(_0x47d9e2){if(_0x47d9e2){_0x389746=_0x47d9e2[_0x76ab('0x6b')];}})[_0x76ab('0x14')](function(){return db['ChatWebsite'][_0x76ab('0x53')](_0x23b1d2);})[_0x76ab('0x14')](handleEntityNotFound(_0x1516a5,null))[_0x76ab('0x14')](function(_0x500588){if(_0x500588){if(!_[_0x76ab('0x6c')](_0x500588[_0x76ab('0x62')])){if(fs[_0x76ab('0x6d')](path['join'](config[_0x76ab('0x69')],'server/files/images/logos/',_0x500588['sitepic']))&&_0x389746){_0x2ebff7=path[_0x76ab('0x68')](config[_0x76ab('0x69')],_0x76ab('0x6e'),_0x500588['sitepic']);}}return _0x1516a5[_0x76ab('0x6f')](_0x2ebff7);}})[_0x76ab('0x1d')](handleError(_0x1516a5,null));};exports['getAvatar']=function(_0x5ecfca,_0x1fb381){var _0x5adbf1=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x1efe2f={'where':{'id':_0x5ecfca[_0x76ab('0x4d')]['id']},'attributes':['id',_0x76ab('0x65')],'raw':!![]};return db[_0x76ab('0x48')][_0x76ab('0x53')](_0x1efe2f)[_0x76ab('0x14')](handleEntityNotFound(_0x1fb381,null))[_0x76ab('0x14')](function(_0x3e52e7){if(_0x3e52e7){if(!_[_0x76ab('0x6c')](_0x3e52e7[_0x76ab('0x65')])){if(fs[_0x76ab('0x6d')](path['join'](config[_0x76ab('0x69')],'server/files/images/avatars/',_0x3e52e7['agentAvatar']))){_0x5adbf1=path[_0x76ab('0x68')](config[_0x76ab('0x69')],_0x76ab('0x70'),_0x3e52e7[_0x76ab('0x65')]);}}return _0x1fb381[_0x76ab('0x6f')](_0x5adbf1);}})['catch'](handleError(_0x1fb381,null));};exports[_0x76ab('0x71')]=function(_0x2b6325,_0x4aab8b){var _0x30775b=path[_0x76ab('0x68')](config[_0x76ab('0x69')],_0x76ab('0x72'));var _0x28e174={'where':{'id':_0x2b6325['params']['id']},'attributes':['id','customerAvatar',_0x76ab('0x73')],'raw':!![]};return db[_0x76ab('0x48')][_0x76ab('0x53')](_0x28e174)['then'](handleEntityNotFound(_0x4aab8b,null))['then'](function(_0x45f8bb){if(_0x45f8bb){if(!_[_0x76ab('0x6c')](_0x45f8bb['customerAvatar'])){if(fs[_0x76ab('0x6d')](path[_0x76ab('0x68')](config[_0x76ab('0x69')],_0x76ab('0x70'),_0x45f8bb[_0x76ab('0x74')]))&&_0x45f8bb['showCustomerAvatar']){_0x30775b=path[_0x76ab('0x68')](config[_0x76ab('0x69')],_0x76ab('0x70'),_0x45f8bb[_0x76ab('0x74')]);}}return _0x4aab8b['download'](_0x30775b);}})['catch'](handleError(_0x4aab8b,null));};exports[_0x76ab('0x75')]=function(_0x794e9b,_0x169f78){var _0x3f601f=path[_0x76ab('0x68')](config['root'],_0x76ab('0x76'));var _0x411115={'where':{'id':_0x794e9b['params']['id']},'attributes':['id',_0x76ab('0x67')],'raw':!![]};return db[_0x76ab('0x48')][_0x76ab('0x53')](_0x411115)[_0x76ab('0x14')](handleEntityNotFound(_0x169f78,null))[_0x76ab('0x14')](function(_0x537713){if(_0x537713){if(!_[_0x76ab('0x6c')](_0x537713[_0x76ab('0x67')])){if(fs[_0x76ab('0x6d')](path['join'](config[_0x76ab('0x69')],_0x76ab('0x70'),_0x537713[_0x76ab('0x67')]))){_0x3f601f=path[_0x76ab('0x68')](config['root'],_0x76ab('0x70'),_0x537713[_0x76ab('0x67')]);}}return _0x169f78[_0x76ab('0x6f')](_0x3f601f);}})[_0x76ab('0x1d')](handleError(_0x169f78,null));};exports[_0x76ab('0x77')]=function(_0x23d332,_0x16f7ed){var _0x223787=require(_0x76ab('0x78'));var _0x1a753e=new _0x223787();var _0x5b7dd2=_0x1a753e['setUA'](_0x23d332[_0x76ab('0x79')][_0x76ab('0x7a')])[_0x76ab('0x7b')]();var _0x4710a3={'body':_0x23d332[_0x76ab('0x54')],'channel':_0x76ab('0x7c')};var _0x81685f=[];var _0x508dc1=[];var _0x1a4134={};var _0x52e270=![];return db['CmContact']['describe']()[_0x76ab('0x14')](function(_0x52cfda){if(!_0x52cfda){throw new db[(_0x76ab('0x7d'))][(_0x76ab('0x7e'))](_0x76ab('0x7f'));}_0x81685f=_['difference'](_[_0x76ab('0x38')](_0x52cfda),['createdAt',_0x76ab('0x80')]);_0x508dc1=_[_0x76ab('0x81')](_['keys'](_0x52cfda),[_0x76ab('0x82'),'updatedAt','CompanyId','ListId']);if(_0x23d332[_0x76ab('0x54')]['id']){delete _0x23d332[_0x76ab('0x54')]['id'];}if(_[_0x76ab('0x6c')](_0x23d332[_0x76ab('0x54')][_0x76ab('0x83')])){throw new db[(_0x76ab('0x7d'))][(_0x76ab('0x7e'))](_0x76ab('0x84'));}if(_[_0x76ab('0x6c')](_0x23d332[_0x76ab('0x54')][_0x76ab('0x54')])||_0x23d332[_0x76ab('0x54')][_0x76ab('0x54')]===''){throw new db[(_0x76ab('0x7d'))][(_0x76ab('0x7e'))](_0x76ab('0x85'));}if(_[_0x76ab('0x6c')](_0x23d332[_0x76ab('0x54')][_0x76ab('0x86')])){throw new db[(_0x76ab('0x7d'))][(_0x76ab('0x7e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x508dc1);}if(!_['includes'](_0x508dc1,_0x23d332['body'][_0x76ab('0x86')])){throw new db[(_0x76ab('0x7d'))][(_0x76ab('0x7e'))](_0x76ab('0x87')+_0x508dc1);}_0x1a4134[_0x23d332[_0x76ab('0x54')][_0x76ab('0x86')]]=_0x23d332[_0x76ab('0x54')][_0x76ab('0x83')];})[_0x76ab('0x14')](function(){return db[_0x76ab('0x48')]['find']({'where':{'id':_0x23d332['params']['id']},'include':[{'model':db['CmList'],'as':_0x76ab('0x88'),'include':[{'model':db[_0x76ab('0x89')],'as':_0x76ab('0x8a'),'where':_0x1a4134,'limit':0x1,'order':[[_0x76ab('0x80'),'DESC']]}]},{'model':db[_0x76ab('0x8b')],'as':_0x76ab('0x8c')}]});})[_0x76ab('0x14')](handleEntityNotFound(_0x16f7ed,null))[_0x76ab('0x14')](function(_0x2a183e){if(_0x2a183e&&_0x2a183e[_0x76ab('0x88')]){_0x4710a3['account']=_0x2a183e;_0x4710a3['applications']=_0x2a183e[_0x76ab('0x8c')];_0x4710a3['list']=_0x2a183e[_0x76ab('0x88')];_0x4710a3['applications']=_[_0x76ab('0x8d')](_0x4710a3[_0x76ab('0x8e')],[_0x76ab('0x8f')],[_0x76ab('0x90')]);if(_0x4710a3[_0x76ab('0x91')][_0x76ab('0x8c')]){delete _0x4710a3[_0x76ab('0x91')][_0x76ab('0x8c')];}if(_0x4710a3['account'][_0x76ab('0x88')]&&_0x4710a3[_0x76ab('0x91')][_0x76ab('0x88')][_0x76ab('0x8a')][_0x76ab('0x3d')]){return _0x4710a3[_0x76ab('0x91')]['List']['Contacts'][0x0];}var _0x179f42=_['defaults'](_0x23d332[_0x76ab('0x54')],{'firstName':_0x23d332['body']['from'],'ListId':_0x2a183e['ListId']});_0x179f42[_0x23d332[_0x76ab('0x54')][_0x76ab('0x86')]]=_0x23d332[_0x76ab('0x54')][_0x76ab('0x83')];return db['CmContact'][_0x76ab('0x4f')](_0x179f42,{'fields':_0x81685f,'raw':!![]});}})[_0x76ab('0x14')](handleEntityNotFound(_0x16f7ed,null))[_0x76ab('0x14')](function(_0x23fe16){_0x4710a3[_0x76ab('0x92')]=_0x23fe16;var _0x39e4c1=_0x23d332['body'][_0x76ab('0x93')];if(_0x23d332[_0x76ab('0x79')][_0x76ab('0x94')]){_0x39e4c1=_0x23d332['headers'][_0x76ab('0x94')];}else if(_0x23d332[_0x76ab('0x79')]['x-forwarded-for']){_0x39e4c1=_[_0x76ab('0x95')](_0x23d332[_0x76ab('0x79')][_0x76ab('0x96')][_0x76ab('0x97')](','));}if(_0x23fe16){var _0x220f68={'ContactId':_0x23fe16['id'],'ChatWebsiteId':_0x23d332[_0x76ab('0x4d')]['id'],'from':(_0x23fe16[_0x76ab('0x98')]||'')+'\x20'+(_0x23fe16[_0x76ab('0x99')]||''),'customerIp':_0x39e4c1,'customerPort':_0x23d332['headers'][_0x76ab('0x9a')]?_0x23d332['headers'][_0x76ab('0x9a')]:null,'referer':_0x23d332[_0x76ab('0x54')]['referer'],'browserName':_0x5b7dd2[_0x76ab('0x9b')][_0x76ab('0x2d')]&&_0x5b7dd2[_0x76ab('0x9b')][_0x76ab('0x9c')]?util['format'](_0x76ab('0x9d'),_0x5b7dd2[_0x76ab('0x9b')][_0x76ab('0x2d')],_0x5b7dd2[_0x76ab('0x9b')][_0x76ab('0x9c')]):_0x76ab('0x9e'),'browserVersion':_0x5b7dd2[_0x76ab('0x9b')][_0x76ab('0x9c')]||_0x76ab('0x9e'),'osName':util[_0x76ab('0x9f')]('%s\x20%s',_0x5b7dd2['os']['name'],_0x5b7dd2['os'][_0x76ab('0x9c')]),'osVersion':_0x5b7dd2['os'][_0x76ab('0x9c')],'deviceModel':_0x5b7dd2[_0x76ab('0xa0')][_0x76ab('0x35')]&&_0x5b7dd2[_0x76ab('0xa0')][_0x76ab('0xa1')]?util['format']('%s\x20%s\x20%s',_0x5b7dd2[_0x76ab('0xa0')][_0x76ab('0x35')],_0x5b7dd2['device'][_0x76ab('0xa1')],_0x5b7dd2[_0x76ab('0xa0')][_0x76ab('0x33')]):null,'deviceVendor':_0x5b7dd2[_0x76ab('0xa0')]['vendor'],'deviceType':_0x5b7dd2[_0x76ab('0xa0')]['type'],'formData':JSON[_0x76ab('0xa2')](_0x23d332['body'])};var _0x38ca22={'ChatWebsiteId':_0x23d332[_0x76ab('0x4d')]['id'],'closed':![]};if(_0x23d332['body'][_0x76ab('0xa3')]){_0x38ca22[_0x76ab('0xa3')]=_0x23d332[_0x76ab('0x54')][_0x76ab('0xa3')];return db['ChatInteraction'][_0x76ab('0x53')]({'where':_0x38ca22})['then'](function(_0x103fac){if(_0x103fac){return[_0x103fac,![]];}_0x220f68[_0x76ab('0xa3')]=_0x23d332[_0x76ab('0x54')][_0x76ab('0xa3')];_0x220f68[_0x76ab('0xa4')]=_0x23d332[_0x76ab('0x54')][_0x76ab('0xa4')];return db[_0x76ab('0xa5')]['create'](_0x220f68)['then'](function(_0x418607){return[_0x418607,!![]];});});}_0x38ca22['ContactId']=_0x23fe16['id'];if(_0x23d332[_0x76ab('0x54')][_0x76ab('0xa6')]&&_0x23d332[_0x76ab('0x54')][_0x76ab('0xa6')]['id']){_0x38ca22['id']=_0x23d332[_0x76ab('0x54')]['interaction']['id'];return db[_0x76ab('0xa5')][_0x76ab('0x53')]({'where':_0x38ca22})[_0x76ab('0x14')](function(_0x2046ae){if(_0x2046ae){return[_0x2046ae,![]];}return db[_0x76ab('0xa5')]['create'](_0x220f68)[_0x76ab('0x14')](function(_0x3db89f){return[_0x3db89f,!![]];});});}return db[_0x76ab('0xa5')][_0x76ab('0x4f')](_0x220f68)[_0x76ab('0x14')](function(_0x749300){return[_0x749300,!![]];});}})[_0x76ab('0xa7')](function(_0x59cd45,_0x2a0d28){if(_0x59cd45){_0x52e270=_0x2a0d28;if(!_0x2a0d28){var _0x2c329a={'from':(_0x4710a3[_0x76ab('0x92')]['firstName']||'')+'\x20'+(_0x4710a3[_0x76ab('0x92')][_0x76ab('0x99')]||'')};if(_0x23d332['body']['threadId']&&_0x23d332[_0x76ab('0x54')][_0x76ab('0xa8')]&&_0x23d332[_0x76ab('0x54')][_0x76ab('0xa3')]!=_0x23d332[_0x76ab('0x54')][_0x76ab('0xa8')]){_0x2c329a['threadId']=_0x23d332[_0x76ab('0x54')][_0x76ab('0xa8')];}return _0x59cd45['update'](_0x2c329a);}else{return _0x59cd45;}}})[_0x76ab('0x14')](function(_0x13dbe0){_0x4710a3[_0x76ab('0xa6')]=_0x13dbe0[_0x76ab('0x29')]({'plain':!![]});_0x4710a3[_0x76ab('0xa6')][_0x76ab('0xa9')]=_0x52e270;if(_0x4710a3['interaction'][_0x76ab('0xa9')]){if(_0x4710a3[_0x76ab('0x91')][_0x76ab('0xaa')]){_0x4710a3[_0x76ab('0x8e')][_0x76ab('0xab')]({'id':0x0,'priority':_0x4710a3[_0x76ab('0x8e')]['length']+0x1,'app':_0x76ab('0xac'),'appdata':_0x76ab('0xad'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x23d332['body']['body'],'ChatWebsiteId':_0x23d332[_0x76ab('0x4d')]['id'],'ChatInteractionId':_0x13dbe0['id'],'direction':'in','ContactId':_0x4710a3[_0x76ab('0x92')]['id'],'AttachmentId':_0x23d332[_0x76ab('0x54')][_0x76ab('0xae')]});})[_0x76ab('0x14')](function(_0x432b27){_0x4710a3[_0x76ab('0x1a')]=_0x432b27;if(_0x4710a3[_0x76ab('0xa6')][_0x76ab('0xaf')]){return db[_0x76ab('0xb0')][_0x76ab('0x53')]({'attributes':['id',_0x76ab('0x2d')],'where':{'id':_0x4710a3[_0x76ab('0xa6')][_0x76ab('0xaf')]}})[_0x76ab('0x14')](function(_0x2ec9c7){if(_0x2ec9c7){_0x4710a3[_0x76ab('0x8e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x76ab('0xb1'),'appdata':_0x2ec9c7['name']+','+(_0x4710a3[_0x76ab('0x91')][_0x76ab('0xb2')]||0xa),'interval':'*,*,*,*'});_0x4710a3['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x76ab('0xb3'),_0x4710a3);});}return respondWithRpcPromise('Start',_0x76ab('0xb3'),_0x4710a3);})[_0x76ab('0x14')](function(_0x682745){respondWithRpcPromise(_0x76ab('0xb4'),'EventManager',{'event':_0x76ab('0x77'),'message':_0x682745},client9002);return _0x682745;})[_0x76ab('0x14')](respondWithResult(_0x16f7ed,null))[_0x76ab('0x1d')](handleError(_0x16f7ed,null));};exports[_0x76ab('0xb5')]=function(_0x27b10b,_0x150774){var _0x1ad4a5,_0x244b8c,_0x38128f;var _0xf8308c=[];var _0x75b70a={};var _0x3e066f=_0x27b10b[_0x76ab('0xb6')]||[];var _0x30136a=[];var _0x3ec2da;return db[_0x76ab('0x89')]['describe']()[_0x76ab('0x14')](function(_0x521209){if(!_0x521209){throw new db['Sequelize'][(_0x76ab('0x7e'))]('no\x20available\x20attributes');}_0xf8308c=_['difference'](_['keys'](_0x521209),[_0x76ab('0x82'),_0x76ab('0x80'),_0x76ab('0xb7'),_0x76ab('0xb8')]);if(_0x27b10b[_0x76ab('0x54')]['id']){delete _0x27b10b[_0x76ab('0x54')]['id'];}if(_['isNil'](_0x27b10b['body']['from'])){throw _0x150774[_0x76ab('0x1f')](0x1f4)[_0x76ab('0x2e')](new db[(_0x76ab('0x7d'))][(_0x76ab('0x7e'))](_0x76ab('0x84')));}if(_['isNil'](_0x27b10b[_0x76ab('0x54')][_0x76ab('0x54')])||_0x27b10b[_0x76ab('0x54')][_0x76ab('0x54')]===''){throw _0x150774['status'](0x1f4)[_0x76ab('0x2e')](new db[(_0x76ab('0x7d'))][(_0x76ab('0x7e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x27b10b[_0x76ab('0x54')][_0x76ab('0xb9')])){throw _0x150774['status'](0x1f4)[_0x76ab('0x2e')](new db[(_0x76ab('0x7d'))][(_0x76ab('0x7e'))](_0x76ab('0xba')+_0xf8308c));}if(!_[_0x76ab('0xbb')](_0xf8308c,_0x27b10b[_0x76ab('0x54')][_0x76ab('0xb9')])){throw _0x150774[_0x76ab('0x1f')](0x1f4)[_0x76ab('0x2e')](new db[(_0x76ab('0x7d'))][(_0x76ab('0x7e'))](_0x76ab('0xbc')+_0xf8308c));}_0x75b70a[_0x27b10b['body'][_0x76ab('0xb9')]]=_0x27b10b['body'][_0x76ab('0x83')];})[_0x76ab('0x14')](function(){return db[_0x76ab('0x48')][_0x76ab('0x53')]({'where':{'id':_0x27b10b[_0x76ab('0x4d')]['id']},'include':[{'model':db[_0x76ab('0xbd')],'as':'List'},{'model':db[_0x76ab('0xbe')],'as':_0x76ab('0xbe')}]});})[_0x76ab('0x14')](handleEntityNotFound(_0x150774,null))['then'](function(_0x84a804){if(_0x84a804&&_0x84a804[_0x76ab('0x88')]){_0x244b8c=_0x84a804;var _0x2b689f=_['defaults'](_0x27b10b[_0x76ab('0x54')],{'firstName':_0x27b10b['body'][_0x76ab('0x83')],'phone':_0x27b10b['body']['from'],'ListId':_0x84a804[_0x76ab('0xb8')]});_0x2b689f[_0x27b10b['body'][_0x76ab('0xb9')]]=_0x27b10b[_0x76ab('0x54')][_0x76ab('0x83')];return db['CmContact'][_0x76ab('0xbf')]({'where':_0x75b70a,'defaults':_0x2b689f});}})[_0x76ab('0xa7')](function(_0x2bc1c6){if(_0x2bc1c6){_0x38128f=_0x2bc1c6;var _0x37d7a2=fs[_0x76ab('0xc0')](path['join'](config[_0x76ab('0x69')],'server/files/templates/chatOfflineMessage.ejs'),_0x76ab('0xc1'));var _0x50c8fb=ejs[_0x76ab('0xc2')](_0x37d7a2,{'body':_[_0x76ab('0xc3')](_0x27b10b[_0x76ab('0x54')]['body']),'bodyTitle':_0x244b8c['offlineMessageBody']});return db[_0x76ab('0xc4')][_0x76ab('0x4f')]({'body':_0x50c8fb,'plainBody':htmlToText[_0x76ab('0xc5')](_0x50c8fb),'ContactId':_0x2bc1c6['id'],'ChatWebsiteId':_0x244b8c['id']});}})[_0x76ab('0x14')](function(_0x37dd12){_0x3ec2da=_0x37dd12;if(_0x3e066f['length']){var _0x2479e2=_0x3e066f['map'](function(_0x2d4f66){return{'name':_0x2d4f66['originalname'],'basename':_0x2d4f66['filename'],'type':_0x2d4f66[_0x76ab('0xc6')],'ChatOfflineMessageId':_0x37dd12['id']};});_0x30136a=_0x2479e2[_0x76ab('0x36')](_0x202cbd=>{var _0x1dfd13={'filename':_0x202cbd[_0x76ab('0x2d')],'path':path[_0x76ab('0x68')](config[_0x76ab('0x69')],_0x76ab('0xc7'),'files',_0x76ab('0xc8'),'offline-chat',_0x202cbd[_0x76ab('0xc9')])};return _0x1dfd13;});if(!_0x244b8c[_0x76ab('0xca')]){return db[_0x76ab('0xcb')][_0x76ab('0xcc')](function(_0x2fb1fd){return db[_0x76ab('0xcd')][_0x76ab('0xce')](_0x2479e2,{'transaction':_0x2fb1fd});});}}})[_0x76ab('0x14')](function(){if(_0x3ec2da){_0x1ad4a5=_0x3ec2da;return db[_0x76ab('0xbe')][_0x76ab('0x59')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x76ab('0xcf')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x76ab('0x14')](function(_0x4977de){if(_0x4977de&&_0x4977de[_0x76ab('0xd0')]&&_0x244b8c[_0x76ab('0xd1')]&&_0x244b8c[_0x76ab('0xd2')]){var _0xff817b=_0x4977de[_0x76ab('0xd3')]();return respondWithRpcPromise('SendMail',_0x76ab('0xd4'),{'account':_0xff817b,'message':{'from':util[_0x76ab('0x9f')](_0x76ab('0xd5'),_0x4977de[_0x76ab('0x2d')],_0x4977de['email']||_0x4977de[_0x76ab('0xd0')][_0x76ab('0x50')]),'to':_0x244b8c[_0x76ab('0xd2')],'subject':_0x244b8c[_0x76ab('0xd6')],'html':_0x1ad4a5['body'],'attachments':_0x30136a}},client9003)[_0x76ab('0x14')](function(){return _0x1ad4a5;})[_0x76ab('0x1d')](function(_0x1ec7d9){logger[_0x76ab('0x19')](_0x1ec7d9);});}})[_0x76ab('0x14')](function(){if(_0x244b8c&&_0x244b8c[_0x76ab('0xca')]&&_0x244b8c[_0x76ab('0xd7')]){var _0x28ff21=[];if(_0x3e066f[_0x76ab('0x3d')]){_0x28ff21=_0x3e066f['map'](function(_0x21502b){return{'name':_0x21502b[_0x76ab('0xd8')],'basename':_0x21502b[_0x76ab('0x66')],'type':_0x21502b[_0x76ab('0xc6')],'ChatOfflineMessageId':_0x3ec2da['id']};});}var _0x5762c2;if(!_[_0x76ab('0x6c')](_0x244b8c[_0x76ab('0xd9')])){var _0x59796e=_[_0x76ab('0x36')](_0x27b10b['body'],function(_0x4d8261){return _0x4d8261;});var _0x2832fc=_['toPairsIn'](_0x59796e)[0x0];var _0x574327=_[_0x76ab('0xda')](_0x2832fc,function(_0x7c07cb){return _0x7c07cb;});_0x5762c2=_0x574327[0x1][_0x244b8c[_0x76ab('0xd9')]];}var _0x5df669={'from':_0x38128f[_0x76ab('0xdb')],'firstName':_0x38128f[_0x76ab('0x98')],'lastName':_0x38128f['lastName'],'mapKey':_0x76ab('0xdb'),'message':{'from':_0x38128f[_0x76ab('0xdb')],'to':_0x244b8c[_0x76ab('0xbe')][_0x76ab('0xdb')],'cc':'','subject':_[_0x76ab('0x6c')](_0x5762c2)?_0x244b8c[_0x76ab('0xd6')]:_0x5762c2,'messageId':'','sentAt':new Date(),'attach':_0x28ff21[_0x76ab('0x3d')],'attachments':_0x28ff21,'originChannel':'Chat','ChatWebsiteId':_0x244b8c['id'],'ChatOfflineMessageId':_0x1ad4a5['id'],'originTo':_0x244b8c['MailAccount'][_0x76ab('0xdb')]},'body':_0x1ad4a5[_0x76ab('0x54')]};var _0x52aa6e={'account':{'id':_0x244b8c[_0x76ab('0xd7')]},'body':_0x5df669,'log':_0x76ab('0xdc')};return respondWithRpcPromise('NotifyMailAccount',_0x76ab('0xdd'),_0x52aa6e,client9001)[_0x76ab('0x14')](function(){return _0x1ad4a5;})[_0x76ab('0x1d')](function(_0x3b2f81){logger['error'](_0x3b2f81);});}return;})[_0x76ab('0x14')](function(){if(_0x1ad4a5){return _0x1ad4a5;}})[_0x76ab('0x14')](respondWithResult(_0x150774,null))[_0x76ab('0x1d')](function(_0x504be8){logger[_0x76ab('0x19')]('catch',_0x504be8);for(var _0x453e1d of _0x3e066f){var _0x2f986b=path['join'](config['root'],_0x76ab('0xc7'),'files',_0x76ab('0xc8'),_0x76ab('0xde'),_0x453e1d['filename']);fs_extra[_0x76ab('0xdf')](_0x2f986b)[_0x76ab('0x1d')](function(_0x10ac6d){logger['error'](_0x76ab('0xe0'),_0x2f986b,_0x10ac6d);});}});};exports['addInteraction']=function(_0x38d176,_0x1cb2d4){return db[_0x76ab('0xa5')][_0x76ab('0x53')]({'where':{'id':_0x38d176[_0x76ab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1cb2d4,null))[_0x76ab('0x14')](function(_0xc9fcb){if(_0xc9fcb){return _0xc9fcb['addInteraction'](_0x38d176['body']['ids'],_[_0x76ab('0xe1')](_0x38d176['body'],[_0x76ab('0x5c'),'id'])||{});}})[_0x76ab('0x14')](respondWithResult(_0x1cb2d4,null))[_0x76ab('0x1d')](handleError(_0x1cb2d4,null));};exports[_0x76ab('0xe2')]=function(_0x84cb83,_0x1a2958){var _0x430c4c={'raw':![],'where':{}};var _0x1aa8e0={};var _0x49ae54={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x76ab('0x59')]({'where':{'id':_0x84cb83[_0x76ab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1a2958,null))['then'](function(_0x2d728e){if(_0x2d728e){_0x1aa8e0[_0x76ab('0x35')]=_[_0x76ab('0x38')](db[_0x76ab('0xa5')][_0x76ab('0x4e')]);_0x1aa8e0[_0x76ab('0x37')]=_[_0x76ab('0x38')](_0x84cb83[_0x76ab('0x37')]);_0x1aa8e0[_0x76ab('0x39')]=_[_0x76ab('0x3a')](_0x1aa8e0[_0x76ab('0x35')],_0x1aa8e0[_0x76ab('0x37')]);_0x430c4c[_0x76ab('0x3b')]=_['intersection'](_0x1aa8e0[_0x76ab('0x35')],qs['fields'](_0x84cb83['query'][_0x76ab('0x3c')]));_0x430c4c[_0x76ab('0x3b')]=_0x430c4c['attributes'][_0x76ab('0x3d')]?_0x430c4c[_0x76ab('0x3b')]:_0x1aa8e0[_0x76ab('0x35')];if(!_0x84cb83['query'][_0x76ab('0x3e')](_0x76ab('0x3f'))){_0x430c4c['limit']=qs[_0x76ab('0x24')](_0x84cb83['query'][_0x76ab('0x24')]);_0x430c4c[_0x76ab('0x22')]=qs[_0x76ab('0x22')](_0x84cb83[_0x76ab('0x37')][_0x76ab('0x22')]);}_0x430c4c[_0x76ab('0x40')]=qs['sort'](_0x84cb83[_0x76ab('0x37')][_0x76ab('0x41')]);_0x430c4c['where']=qs[_0x76ab('0x39')](_['pick'](_0x84cb83['query'],_0x1aa8e0[_0x76ab('0x39')]));_0x430c4c[_0x76ab('0x43')][_0x76ab('0x56')]=_0x2d728e['id'];if(_0x84cb83[_0x76ab('0x37')][_0x76ab('0x46')]){_0x430c4c[_0x76ab('0x43')]=_[_0x76ab('0x44')](_0x430c4c[_0x76ab('0x43')],{'$or':_[_0x76ab('0x36')](_0x430c4c[_0x76ab('0x3b')],function(_0x4af726){var _0x11f3c3={};_0x11f3c3[_0x4af726]={'$like':'%'+_0x84cb83['query']['filter']+'%'};return _0x11f3c3;})});}_0x430c4c=_[_0x76ab('0x44')]({},_0x430c4c,_0x84cb83['options']);return db[_0x76ab('0xa5')][_0x76ab('0x25')]({'where':_0x430c4c[_0x76ab('0x43')]})[_0x76ab('0x14')](function(_0x1af6cd){_0x49ae54[_0x76ab('0x25')]=_0x1af6cd;if(_0x84cb83['query'][_0x76ab('0x49')]){_0x430c4c[_0x76ab('0x4a')]=[{'model':db[_0x76ab('0x89')],'as':'Contact','required':![]},{'model':db[_0x76ab('0xb0')],'as':_0x76ab('0xe3'),'attributes':[_0x76ab('0x2d'),_0x76ab('0xe4'),'internal'],'required':![]},{'model':db[_0x76ab('0xe5')],'as':_0x76ab('0xe6'),'attributes':['id',_0x76ab('0x2d'),'color'],'where':_0x84cb83[_0x76ab('0x37')][_0x76ab('0xe7')]?{'id':_0x84cb83[_0x76ab('0x37')][_0x76ab('0xe7')]}:undefined,'required':_0x84cb83['query'][_0x76ab('0xe7')]?!![]:![]}];}return db[_0x76ab('0xa5')][_0x76ab('0x5a')](_0x430c4c);})['then'](function(_0x149c8e){_0x49ae54[_0x76ab('0x4b')]=_0x149c8e;return _0x49ae54;});}})[_0x76ab('0x14')](respondWithFilteredResult(_0x1a2958,_0x430c4c))[_0x76ab('0x1d')](handleError(_0x1a2958,null));};function iftimePromise(_0x286b6d,_0x55135c){return respondWithRpcPromise(_0x76ab('0xe8'),'getSnippet',{'command':_0x55135c['timezone']?util['format'](_0x76ab('0xe9'),_0x286b6d[_0x76ab('0xea')],_0x55135c[_0x76ab('0xeb')]):util[_0x76ab('0x9f')](_0x76ab('0xec'),_0x286b6d[_0x76ab('0xea')])},client9002)[_0x76ab('0x14')](function(_0x165512){var _0x41b0f5=_0x165512&&_0x165512[_0x76ab('0xed')](_0x76ab('0xee'))>=0x0?!![]:![];logger[_0x76ab('0x15')](_0x76ab('0xef'),_0x55135c['id'],_0x286b6d['id'],_0x286b6d[_0x76ab('0xea')],_0x41b0f5?_0x76ab('0xf0'):_0x76ab('0xf1'),_0x55135c[_0x76ab('0xeb')]?_0x55135c['timezone']:_0x76ab('0xf2'));return _0x41b0f5;})[_0x76ab('0x1d')](function(_0x5da12f){logger[_0x76ab('0x19')](_0x76ab('0xef'),_0x55135c['id'],_0x286b6d['id'],_0x286b6d[_0x76ab('0xea')],util[_0x76ab('0xf3')](_0x5da12f,{'showHidden':![],'depth':null}),_0x55135c[_0x76ab('0xeb')]?_0x55135c[_0x76ab('0xeb')]:_0x76ab('0xf2'));return![];});}exports[_0x76ab('0xf4')]=function(_0x12620e,_0x2e3ec4){var _0x3fafff=0x0;var _0x51bae5=0x0;var _0x516f97=![];var _0x529636;var _0x433905;return db[_0x76ab('0x48')][_0x76ab('0x53')]({'where':{'id':_0x12620e[_0x76ab('0x4d')]['id']},'include':[{'model':db[_0x76ab('0xf5')],'as':_0x76ab('0xf5'),'include':[{'model':db[_0x76ab('0xf5')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x76ab('0x14')](handleEntityNotFound(_0x2e3ec4,null))[_0x76ab('0x14')](function(_0x3ab8cb){if(_0x3ab8cb){_0x529636=_0x3ab8cb;return _0x3ab8cb[_0x76ab('0xf6')]({'raw':!![]});}})[_0x76ab('0x14')](function(_0x39d6f7){if(_0x529636){if(_0x39d6f7){_0x433905=_0x39d6f7;}}return require(_0x76ab('0x6a'))[_0x76ab('0xf7')]();})['then'](function(_0x914138){if(_0x914138){_0x51bae5=_0x914138[_0x76ab('0xf8')];_0x516f97=_0x914138[_0x76ab('0x6b')];}})[_0x76ab('0x14')](function(){return db[_0x76ab('0xa5')][_0x76ab('0x25')]({'where':{'closed':![]}});})[_0x76ab('0x14')](function(_0x3a311c){_0x3fafff=_0x3a311c;if(_0x51bae5&&_0x3a311c>_0x51bae5){return db[_0x76ab('0xf9')][_0x76ab('0x59')]({'where':{'id':0x1}})[_0x76ab('0x14')](function(_0x503929){if(_0x503929){_0x503929[_0x76ab('0xfa')](_0x76ab('0xfb'));}});}})[_0x76ab('0x14')](function(){if(_0x529636[_0x76ab('0xf5')]&&_0x529636[_0x76ab('0xf5')][_0x76ab('0xfc')]){var _0x5015b1=[];for(var _0x501e0d=0x0;_0x501e0d<_0x529636[_0x76ab('0xf5')][_0x76ab('0xfc')]['length'];_0x501e0d++){var _0x575835=_0x529636[_0x76ab('0xf5')][_0x76ab('0xfc')][_0x501e0d][_0x76ab('0x29')]({'plain':!![]});_0x5015b1['push'](iftimePromise(_0x575835,_0x529636));}return BPromise[_0x76ab('0xfd')](_0x5015b1)[_0x76ab('0x14')](function(_0x531eca){return _[_0x76ab('0xfe')](_0x531eca);});}else{return!![];}})[_0x76ab('0x14')](function(_0x48bd22){var _0x5de13f=fs['readFileSync'](path[_0x76ab('0x68')](config[_0x76ab('0x69')],_0x76ab('0xff')),'utf8');var _0x5c5de1=new url[(_0x76ab('0x100'))](_0x529636['address'])['origin'];var _0x3051ce=_0x76ab('0x101');var _0x1bde47=![];var _0x5a3126={'chatVersion':_0x3051ce,'chatWebsiteAddressOrigin':_0x5c5de1,'remote':_0x529636[_0x76ab('0x102')],'query':querystring[_0x76ab('0xa2')](_[_0x76ab('0x44')](_0x529636[_0x76ab('0x29')]({'plain':!![]}),{'customerIp':_0x12620e[_0x76ab('0x79')][_0x76ab('0x96')]||_0x12620e[_0x76ab('0x79')][_0x76ab('0x103')]||_0x12620e['connection']['remoteAddress']||_0x12620e['ip'],'referer':_0x12620e[_0x76ab('0x79')][_0x76ab('0x104')],'openedInteractions':_0x3fafff,'maxInteractions':_0x51bae5,'virtual':_0x516f97[_0x76ab('0xf8')],'online':_0x48bd22,'custom':_0x516f97}))['replace'](/'/g,'\x5c\x27')};_0x2e3ec4[_0x76ab('0x2e')](ejs[_0x76ab('0xc2')](Mustache[_0x76ab('0xc2')](_0x5de13f,_0x5a3126),{'proactiveActions':_0x433905,'alignment':_0x529636[_0x76ab('0x105')],'verticalAlignment':_0x529636[_0x76ab('0x106')],'div_color':_0x529636['color'],'labelText':_0x529636[_0x76ab('0x107')],'text_color':_0x529636['textColor'],'text_button_color':_0x529636[_0x76ab('0x108')],'button_color':_0x529636[_0x76ab('0x109')],'background_color':_0x529636['backgroundColor'],'hideWhenOffline':_0x529636[_0x76ab('0x10a')],'intervalId':_0x529636[_0x76ab('0x10b')],'isDevelopment':_0x1bde47,'chatVersion':_0x3051ce}));})['catch'](handleError(_0x2e3ec4,null));};exports[_0x76ab('0x10c')]=function(_0x3b614c,_0x5e61b0){var _0x14304d=_0x3b614c[_0x76ab('0x4d')]['id'];var _0x1713e9=_0x3b614c[_0x76ab('0x54')];var _0x3f7152=0xc8;var _0x58f3cb=null;return db[_0x76ab('0xcb')][_0x76ab('0xcc')]({'isolationLevel':db[_0x76ab('0xcb')][_0x76ab('0x10d')][_0x76ab('0x10e')][_0x76ab('0x10f')]},function(_0x4c1f3c){return db['ChatWebsite'][_0x76ab('0x59')]({'where':{'id':_0x14304d},'transaction':_0x4c1f3c})['then'](function(_0x4fa5a1){if(_0x4fa5a1){return db['ChatApplication'][_0x76ab('0x28')]({'where':{'ChatWebsiteId':_0x14304d},'transaction':_0x4c1f3c})[_0x76ab('0x14')](function(){var _0x22fc5e=_[_0x76ab('0x36')](_0x1713e9,function(_0x26a291){_0x26a291[_0x76ab('0x56')]=_0x14304d;return _0x26a291;});return db[_0x76ab('0x8b')][_0x76ab('0xce')](_0x22fc5e,{'transaction':_0x4c1f3c});});}else{_0x3f7152=0x194;_0x58f3cb=[];}});})[_0x76ab('0x14')](function(){if(_0x3f7152!==0x194){return db['ChatApplication'][_0x76ab('0x110')]({'where':{'ChatWebsiteId':_0x14304d},'order':'priority'})[_0x76ab('0x14')](function(_0x8818e8){_0x58f3cb=_0x8818e8;});}})[_0x76ab('0x1d')](function(_0x1f8e89){_0x3f7152=0x1f4;logger[_0x76ab('0x19')](_0x1f8e89[_0x76ab('0x2c')]);if(_0x1f8e89['name']){delete _0x1f8e89[_0x76ab('0x2d')];}_0x58f3cb=_0x1f8e89;})[_0x76ab('0x111')](function(){if(_0x58f3cb===null){_0x5e61b0[_0x76ab('0x1e')](_0x3f7152);}else{if(_0x3f7152===0x1f4){_0x5e61b0['status'](_0x3f7152)[_0x76ab('0x2e')](_0x58f3cb);}else{_0x5e61b0[_0x76ab('0x1f')](_0x3f7152)[_0x76ab('0x21')](_0x58f3cb);}}});};exports['getApplications']=function(_0x6817a1,_0x5126c6){var _0x1c3103={};var _0x309434={};var _0x276912;var _0x177b14;return db['ChatWebsite'][_0x76ab('0x59')]({'where':{'id':_0x6817a1[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x5126c6,null))['then'](function(_0x2c2e99){if(_0x2c2e99){_0x276912=_0x2c2e99;_0x309434[_0x76ab('0x35')]=_['keys'](db['ChatApplication'][_0x76ab('0x4e')]);_0x309434[_0x76ab('0x37')]=_[_0x76ab('0x38')](_0x6817a1['query']);_0x309434[_0x76ab('0x39')]=_[_0x76ab('0x3a')](_0x309434[_0x76ab('0x35')],_0x309434[_0x76ab('0x37')]);_0x1c3103[_0x76ab('0x3b')]=_[_0x76ab('0x3a')](_0x309434['model'],qs[_0x76ab('0x3c')](_0x6817a1['query'][_0x76ab('0x3c')]));_0x1c3103[_0x76ab('0x3b')]=_0x1c3103[_0x76ab('0x3b')][_0x76ab('0x3d')]?_0x1c3103[_0x76ab('0x3b')]:_0x309434[_0x76ab('0x35')];_0x1c3103[_0x76ab('0x40')]=qs[_0x76ab('0x41')](_0x6817a1[_0x76ab('0x37')]['sort']);_0x1c3103['where']=qs[_0x76ab('0x39')](_[_0x76ab('0x42')](_0x6817a1[_0x76ab('0x37')],_0x309434[_0x76ab('0x39')]));if(_0x6817a1[_0x76ab('0x37')][_0x76ab('0x46')]){_0x1c3103['where']=_[_0x76ab('0x44')](_0x1c3103[_0x76ab('0x43')],{'$or':_[_0x76ab('0x36')](_0x1c3103[_0x76ab('0x3b')],function(_0x2c877e){var _0x5a7aac={};_0x5a7aac[_0x2c877e]={'$like':'%'+_0x6817a1['query'][_0x76ab('0x46')]+'%'};return _0x5a7aac;})});}_0x1c3103=_[_0x76ab('0x44')]({},_0x1c3103,_0x6817a1[_0x76ab('0x47')]);return _0x276912['getApplications'](_0x1c3103);}})[_0x76ab('0x14')](function(_0x28f02a){if(_0x28f02a){_0x177b14=_0x28f02a[_0x76ab('0x3d')];if(!_0x6817a1['query'][_0x76ab('0x3e')]('nolimit')){_0x1c3103[_0x76ab('0x24')]=qs[_0x76ab('0x24')](_0x6817a1[_0x76ab('0x37')][_0x76ab('0x24')]);_0x1c3103[_0x76ab('0x22')]=qs[_0x76ab('0x22')](_0x6817a1[_0x76ab('0x37')][_0x76ab('0x22')]);}return _0x276912[_0x76ab('0x112')](_0x1c3103);}})[_0x76ab('0x14')](function(_0x1709ac){if(_0x1709ac){return _0x1709ac?{'count':_0x177b14,'rows':_0x1709ac}:null;}})[_0x76ab('0x14')](respondWithResult(_0x5126c6,null))[_0x76ab('0x1d')](handleError(_0x5126c6,null));};exports[_0x76ab('0x113')]=function(_0x23274f,_0x5e3e27){return db[_0x76ab('0x114')]['find']({'where':{'id':_0x23274f[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x5e3e27,null))[_0x76ab('0x14')](function(_0x807a1d){if(_0x807a1d){return _0x807a1d['addProactiveActions'](_0x23274f[_0x76ab('0x54')]['ids'],_[_0x76ab('0xe1')](_0x23274f['body'],[_0x76ab('0x5c'),'id'])||{});}})[_0x76ab('0x14')](respondWithResult(_0x5e3e27,null))['catch'](handleError(_0x5e3e27,null));};exports['getProactiveActions']=function(_0x595115,_0x115827){var _0x47b7ad={};var _0x39e77f={};var _0x27330f;var _0x1a29e5;return db[_0x76ab('0x48')][_0x76ab('0x59')]({'where':{'id':_0x595115['params']['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x115827,null))['then'](function(_0xdb8b84){if(_0xdb8b84){_0x27330f=_0xdb8b84;_0x39e77f[_0x76ab('0x35')]=_['keys'](db['ChatProactiveAction'][_0x76ab('0x4e')]);_0x39e77f[_0x76ab('0x37')]=_[_0x76ab('0x38')](_0x595115[_0x76ab('0x37')]);_0x39e77f[_0x76ab('0x39')]=_[_0x76ab('0x3a')](_0x39e77f[_0x76ab('0x35')],_0x39e77f[_0x76ab('0x37')]);_0x47b7ad[_0x76ab('0x3b')]=_['intersection'](_0x39e77f[_0x76ab('0x35')],qs[_0x76ab('0x3c')](_0x595115[_0x76ab('0x37')]['fields']));_0x47b7ad[_0x76ab('0x3b')]=_0x47b7ad[_0x76ab('0x3b')][_0x76ab('0x3d')]?_0x47b7ad[_0x76ab('0x3b')]:_0x39e77f[_0x76ab('0x35')];_0x47b7ad[_0x76ab('0x40')]=qs[_0x76ab('0x41')](_0x595115[_0x76ab('0x37')][_0x76ab('0x41')]);_0x47b7ad[_0x76ab('0x43')]=qs[_0x76ab('0x39')](_[_0x76ab('0x42')](_0x595115[_0x76ab('0x37')],_0x39e77f[_0x76ab('0x39')]));if(_0x595115[_0x76ab('0x37')][_0x76ab('0x46')]){_0x47b7ad[_0x76ab('0x43')]=_[_0x76ab('0x44')](_0x47b7ad[_0x76ab('0x43')],{'$or':_[_0x76ab('0x36')](_0x47b7ad[_0x76ab('0x3b')],function(_0x3aa0c9){var _0x4ea81d={};_0x4ea81d[_0x3aa0c9]={'$like':'%'+_0x595115[_0x76ab('0x37')][_0x76ab('0x46')]+'%'};return _0x4ea81d;})});}_0x47b7ad=_[_0x76ab('0x44')]({},_0x47b7ad,_0x595115[_0x76ab('0x47')]);return _0x27330f['getProactiveActions'](_0x47b7ad);}})[_0x76ab('0x14')](function(_0x345f56){if(_0x345f56){_0x1a29e5=_0x345f56[_0x76ab('0x3d')];if(!_0x595115[_0x76ab('0x37')][_0x76ab('0x3e')]('nolimit')){_0x47b7ad[_0x76ab('0x24')]=qs['limit'](_0x595115['query'][_0x76ab('0x24')]);_0x47b7ad[_0x76ab('0x22')]=qs[_0x76ab('0x22')](_0x595115[_0x76ab('0x37')][_0x76ab('0x22')]);}return _0x27330f[_0x76ab('0xf6')](_0x47b7ad);}})[_0x76ab('0x14')](function(_0x49601b){if(_0x49601b){return _0x49601b?{'count':_0x1a29e5,'rows':_0x49601b}:null;}})[_0x76ab('0x14')](respondWithResult(_0x115827,null))[_0x76ab('0x1d')](handleError(_0x115827,null));};exports[_0x76ab('0x115')]=function(_0x53b8d4,_0x5e3020){var _0x40b29e=_0x53b8d4[_0x76ab('0x37')][_0x76ab('0x116')]===_0x76ab('0x117')?_0x76ab('0x118'):_0x76ab('0x119');return db[_0x76ab('0x48')][_0x76ab('0x53')]({'attributes':['id',_0x40b29e],'where':{'id':_0x53b8d4[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x5e3020,null))['then'](function(_0x48ddf3){if(_0x48ddf3){var _0x28d4b9=_0x48ddf3[_0x40b29e];var _0x283ec2=_0x28d4b9&&_0x28d4b9[_0x76ab('0x11a')]?_0x28d4b9[_0x76ab('0x11a')]:[];_0x5e3020[_0x76ab('0x2e')]({'fromKey':_['isNil'](_0x28d4b9['fromKey'])?undefined:_0x28d4b9['fromKey'],'count':_0x283ec2[_0x76ab('0x3d')],'rows':_0x283ec2});}})[_0x76ab('0x1d')](handleError(_0x5e3020,null));};exports[_0x76ab('0x11b')]=function(_0x2606b1,_0x5dbc49){var _0x172afc={'raw':![],'where':{}};var _0x1d2aad={};var _0x2c90c9={'count':0x0,'rows':[]};return db[_0x76ab('0x48')][_0x76ab('0x59')]({'where':{'id':_0x2606b1[_0x76ab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5dbc49,null))[_0x76ab('0x14')](function(_0x511228){if(_0x511228){_0x1d2aad[_0x76ab('0x35')]=_[_0x76ab('0x38')](db[_0x76ab('0xc4')]['rawAttributes']);_0x1d2aad[_0x76ab('0x37')]=_['keys'](_0x2606b1[_0x76ab('0x37')]);_0x1d2aad[_0x76ab('0x39')]=_[_0x76ab('0x3a')](_0x1d2aad[_0x76ab('0x35')],_0x1d2aad[_0x76ab('0x37')]);_0x172afc[_0x76ab('0x3b')]=_[_0x76ab('0x3a')](_0x1d2aad['model'],qs[_0x76ab('0x3c')](_0x2606b1[_0x76ab('0x37')][_0x76ab('0x3c')]));_0x172afc[_0x76ab('0x3b')]=_0x172afc['attributes'][_0x76ab('0x3d')]?_0x172afc[_0x76ab('0x3b')]:_0x1d2aad[_0x76ab('0x35')];if(!_0x2606b1['query'][_0x76ab('0x3e')](_0x76ab('0x3f'))){_0x172afc[_0x76ab('0x24')]=qs[_0x76ab('0x24')](_0x2606b1[_0x76ab('0x37')][_0x76ab('0x24')]);_0x172afc[_0x76ab('0x22')]=qs['offset'](_0x2606b1['query'][_0x76ab('0x22')]);}_0x172afc[_0x76ab('0x40')]=qs[_0x76ab('0x41')](_0x2606b1[_0x76ab('0x37')][_0x76ab('0x41')]);_0x172afc['where']=qs[_0x76ab('0x39')](_[_0x76ab('0x42')](_0x2606b1[_0x76ab('0x37')],_0x1d2aad[_0x76ab('0x39')]));_0x172afc['where'][_0x76ab('0x56')]=_0x511228['id'];if(_0x2606b1[_0x76ab('0x37')][_0x76ab('0x46')]){_0x172afc[_0x76ab('0x43')]=_[_0x76ab('0x44')](_0x172afc['where'],{'$or':_[_0x76ab('0x36')](_0x172afc[_0x76ab('0x3b')],function(_0x198b17){var _0x5aa4cc={};_0x5aa4cc[_0x198b17]={'$like':'%'+_0x2606b1[_0x76ab('0x37')][_0x76ab('0x46')]+'%'};return _0x5aa4cc;})});}_0x172afc=_[_0x76ab('0x44')]({},_0x172afc,_0x2606b1[_0x76ab('0x47')]);return db[_0x76ab('0xc4')]['count']({'where':_0x172afc[_0x76ab('0x43')]})[_0x76ab('0x14')](function(_0x2e90f8){_0x2c90c9['count']=_0x2e90f8;if(_0x2606b1[_0x76ab('0x37')][_0x76ab('0x49')]){_0x172afc[_0x76ab('0x4a')]=[{'all':!![]}];}else{_0x172afc[_0x76ab('0x4a')]=[{'model':db[_0x76ab('0x89')],'as':_0x76ab('0x11c'),'required':![]},{'model':db[_0x76ab('0xcd')],'as':_0x76ab('0x11d'),'required':![]}];}return db['ChatOfflineMessage'][_0x76ab('0x5a')](_0x172afc);})[_0x76ab('0x14')](function(_0x1fd2e1){_0x2c90c9[_0x76ab('0x4b')]=_0x1fd2e1;return _0x2c90c9;});}})['then'](respondWithFilteredResult(_0x5dbc49,_0x172afc))['catch'](handleError(_0x5dbc49,null));};exports[_0x76ab('0x11e')]=function(_0x30a277,_0x551af8){return db[_0x76ab('0x48')][_0x76ab('0x53')]({'where':{'id':_0x30a277[_0x76ab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x551af8,null))[_0x76ab('0x14')](function(_0x46fdd5){if(_0x46fdd5){return _0x46fdd5[_0x76ab('0x11e')](_0x30a277['body']['ids'],_['omit'](_0x30a277['body'],[_0x76ab('0x5c'),'id'])||{})['spread'](function(_0x730da0){for(var _0x49ee74=0x0;_0x49ee74<_0x30a277[_0x76ab('0x54')][_0x76ab('0x5c')]['length'];_0x49ee74+=0x1){socket[_0x76ab('0x11f')](_0x76ab('0x120'),{'UserId':Number(_0x30a277[_0x76ab('0x54')][_0x76ab('0x5c')][_0x49ee74]),'ChatWebsiteId':Number(_0x30a277['params']['id'])});}return _0x730da0;});}})[_0x76ab('0x14')](respondWithResult(_0x551af8,null))[_0x76ab('0x1d')](handleError(_0x551af8,null));};exports[_0x76ab('0x121')]=function(_0x422804,_0x1284aa){return db['ChatWebsite'][_0x76ab('0x53')]({'where':{'id':_0x422804[_0x76ab('0x4d')]['id']}})[_0x76ab('0x14')](handleEntityNotFound(_0x1284aa,null))[_0x76ab('0x14')](function(_0xd57858){if(_0xd57858){return _0xd57858[_0x76ab('0x121')](_0x422804[_0x76ab('0x37')][_0x76ab('0x5c')])[_0x76ab('0x14')](function(){if(_[_0x76ab('0x122')](_0x422804[_0x76ab('0x37')][_0x76ab('0x5c')])){for(var _0x3322b7=0x0;_0x3322b7<_0x422804[_0x76ab('0x37')]['ids'][_0x76ab('0x3d')];_0x3322b7+=0x1){socket[_0x76ab('0x11f')](_0x76ab('0x123'),{'UserId':Number(_0x422804[_0x76ab('0x37')][_0x76ab('0x5c')][_0x3322b7]),'ChatWebsiteId':Number(_0x422804[_0x76ab('0x4d')]['id'])});}}else{socket[_0x76ab('0x11f')](_0x76ab('0x123'),{'UserId':Number(_0x422804['query'][_0x76ab('0x5c')]),'ChatWebsiteId':Number(_0x422804[_0x76ab('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x1284aa,null))[_0x76ab('0x1d')](handleError(_0x1284aa,null));};exports[_0x76ab('0x124')]=function(_0xd401c1,_0x4fbed7){var _0x310d={};var _0x440a0a={};var _0xd26234;var _0x292d02;return db['ChatWebsite']['findOne']({'where':{'id':_0xd401c1[_0x76ab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4fbed7,null))['then'](function(_0x55aaf6){if(_0x55aaf6){_0xd26234=_0x55aaf6;_0x440a0a[_0x76ab('0x35')]=_[_0x76ab('0x38')](db['User']['rawAttributes']);_0x440a0a[_0x76ab('0x37')]=_['keys'](_0xd401c1['query']);_0x440a0a[_0x76ab('0x39')]=_['intersection'](_0x440a0a[_0x76ab('0x35')],_0x440a0a[_0x76ab('0x37')]);_0x310d[_0x76ab('0x3b')]=_['intersection'](_0x440a0a[_0x76ab('0x35')],qs[_0x76ab('0x3c')](_0xd401c1[_0x76ab('0x37')][_0x76ab('0x3c')]));_0x310d[_0x76ab('0x3b')]=_0x310d['attributes'][_0x76ab('0x3d')]?_0x310d[_0x76ab('0x3b')]:_0x440a0a[_0x76ab('0x35')];_0x310d['order']=qs[_0x76ab('0x41')](_0xd401c1[_0x76ab('0x37')][_0x76ab('0x41')]);_0x310d[_0x76ab('0x43')]=qs[_0x76ab('0x39')](_[_0x76ab('0x42')](_0xd401c1[_0x76ab('0x37')],_0x440a0a['filters']));if(_0xd401c1[_0x76ab('0x37')]['filter']){_0x310d['where']=_[_0x76ab('0x44')](_0x310d[_0x76ab('0x43')],{'$or':_['map'](_0x310d[_0x76ab('0x3b')],function(_0x41e486){var _0xf391b3={};_0xf391b3[_0x41e486]={'$like':'%'+_0xd401c1[_0x76ab('0x37')][_0x76ab('0x46')]+'%'};return _0xf391b3;})});}_0x310d=_[_0x76ab('0x44')]({},_0x310d,_0xd401c1[_0x76ab('0x47')]);return _0xd26234['getAgents'](_0x310d);}})['then'](function(_0x2704e2){if(_0x2704e2){_0x292d02=_0x2704e2[_0x76ab('0x3d')];if(!_0xd401c1[_0x76ab('0x37')][_0x76ab('0x3e')](_0x76ab('0x3f'))){_0x310d['limit']=qs[_0x76ab('0x24')](_0xd401c1[_0x76ab('0x37')][_0x76ab('0x24')]);_0x310d[_0x76ab('0x22')]=qs['offset'](_0xd401c1[_0x76ab('0x37')][_0x76ab('0x22')]);}return _0xd26234[_0x76ab('0x124')](_0x310d);}})[_0x76ab('0x14')](function(_0x3a8f58){if(_0x3a8f58){return _0x3a8f58?{'count':_0x292d02,'rows':_0x3a8f58}:null;}})[_0x76ab('0x14')](respondWithResult(_0x4fbed7,null))[_0x76ab('0x1d')](handleError(_0x4fbed7,null));}; \ No newline at end of file +var _0x0340=['rows','show','params','mandatoryDispositionPause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','order','pick','findAll','removeDispositions','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','headers','getResult','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','lastName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','attachments','remove','addInteraction','getInteractions','Contact','User','fullname','Tags','tag','Command','getSnippet','timezone','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getLicense','virtual','custom','License','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','URL','3.1.0','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','omit','getProactiveActions','ChatProactiveAction','online','false','offlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll'];(function(_0x4f51f9,_0x5d5613){var _0x533984=function(_0x578319){while(--_0x578319){_0x4f51f9['push'](_0x4f51f9['shift']());}};_0x533984(++_0x5d5613);}(_0x0340,0xdd));var _0x0034=function(_0x325b53,_0x58e11b){_0x325b53=_0x325b53-0x0;var _0x223e32=_0x0340[_0x325b53];return _0x223e32;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0034('0x0'));var path=require(_0x0034('0x1'));var ejs=require(_0x0034('0x2'));var fs=require('fs');var fs_extra=require(_0x0034('0x3'));var _=require('lodash');var querystring=require(_0x0034('0x4'));var Redis=require(_0x0034('0x5'));var qs=require(_0x0034('0x6'));var logger=require(_0x0034('0x7'))(_0x0034('0x8'));var config=require(_0x0034('0x9'));var url=require(_0x0034('0xa'));var db=require(_0x0034('0xb'))['db'];config[_0x0034('0xc')]=_[_0x0034('0xd')](config['redis'],{'host':_0x0034('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0034('0xf'))[_0x0034('0x10')](socket);var htmlToText=require(_0x0034('0x11'));var jayson=require(_0x0034('0x12'));var client=jayson[_0x0034('0x13')][_0x0034('0x14')]({'port':0x232c});var client9002=jayson[_0x0034('0x13')]['http']({'port':0x232a});var client9003=jayson[_0x0034('0x13')]['http']({'port':0x232b});var client9001=jayson[_0x0034('0x13')][_0x0034('0x14')]({'port':0x2329});function respondWithRpcPromise(_0xe09feb,_0x345a99,_0xd90170,_0x21078d){return new BPromise(function(_0x2fddf2,_0x2f7cb9){var _0x431f6e=_0x21078d||client;return _0x431f6e[_0x0034('0x15')](_0xe09feb,_0xd90170)[_0x0034('0x16')](function(_0x490d82){logger[_0x0034('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x345a99,_0x0034('0x18'));logger[_0x0034('0x19')](_0x0034('0x1a'),_0x345a99,_0x0034('0x18'),JSON[_0x0034('0x1b')](_0x490d82));if(_0x490d82['error']){if(_0x490d82[_0x0034('0x1c')][_0x0034('0x1d')]===0x1f4){logger[_0x0034('0x1c')](_0x0034('0x1e'),_0x345a99,_0x490d82[_0x0034('0x1c')][_0x0034('0x1f')]);return _0x2f7cb9(_0x490d82['error'][_0x0034('0x1f')]);}logger[_0x0034('0x1c')](_0x0034('0x1e'),_0x345a99,_0x490d82[_0x0034('0x1c')][_0x0034('0x1f')]);return _0x2fddf2(_0x490d82[_0x0034('0x1c')]['message']);}else{logger[_0x0034('0x17')](_0x0034('0x1e'),_0x345a99,_0x0034('0x18'));_0x2fddf2(_0x490d82['result']['message']);}})[_0x0034('0x20')](function(_0x2bf03a){logger[_0x0034('0x1c')](_0x0034('0x1e'),_0x345a99,_0x2bf03a);_0x2f7cb9(_0x2bf03a);});});}function respondWithStatusCode(_0x117b0c,_0x1e4811){_0x1e4811=_0x1e4811||0xcc;return function(_0x5d90aa){if(_0x5d90aa){return _0x117b0c[_0x0034('0x21')](_0x1e4811);}return _0x117b0c[_0x0034('0x22')](_0x1e4811)[_0x0034('0x23')]();};}function respondWithResult(_0x42ee30,_0x21a531){_0x21a531=_0x21a531||0xc8;return function(_0x3850db){if(_0x3850db){return _0x42ee30[_0x0034('0x22')](_0x21a531)[_0x0034('0x24')](_0x3850db);}};}function respondWithFilteredResult(_0x2fc9dd,_0x444ddc){return function(_0x23e6c3){if(_0x23e6c3){var _0x236f2c=typeof _0x444ddc[_0x0034('0x25')]===_0x0034('0x26')&&typeof _0x444ddc[_0x0034('0x27')]==='undefined';var _0x57ac26=_0x23e6c3[_0x0034('0x28')];var _0x4ba014=_0x236f2c?0x0:_0x444ddc[_0x0034('0x25')];var _0x26f999=_0x236f2c?_0x23e6c3[_0x0034('0x28')]:_0x444ddc[_0x0034('0x25')]+_0x444ddc[_0x0034('0x27')];var _0x1fa0d0;if(_0x26f999>=_0x57ac26){_0x26f999=_0x57ac26;_0x1fa0d0=0xc8;}else{_0x1fa0d0=0xce;}_0x2fc9dd['status'](_0x1fa0d0);return _0x2fc9dd['set']('Content-Range',_0x4ba014+'-'+_0x26f999+'/'+_0x57ac26)[_0x0034('0x24')](_0x23e6c3);}return null;};}function saveUpdates(_0x110ad5){return function(_0x30faa3){if(_0x30faa3){return _0x30faa3[_0x0034('0x29')](_0x110ad5)[_0x0034('0x16')](function(_0x2f5d88){return _0x2f5d88;});}return null;};}function removeEntity(_0x42af5f){return function(_0x4abd0e){if(_0x4abd0e){return _0x4abd0e[_0x0034('0x2a')]()[_0x0034('0x16')](function(){var _0x1e9499=_0x4abd0e[_0x0034('0x2b')]({'plain':!![]});var _0x35c55f=_0x0034('0x2c');return db[_0x0034('0x2d')][_0x0034('0x2a')]({'where':{'type':_0x35c55f,'resourceId':_0x1e9499['id']}})['then'](function(){return _0x4abd0e;});})[_0x0034('0x16')](function(){_0x42af5f[_0x0034('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b94c4){return function(_0x10d84b){if(!_0x10d84b){_0x5b94c4['sendStatus'](0x194);}return _0x10d84b;};}function handleError(_0x3b327c,_0x4713c6){_0x4713c6=_0x4713c6||0x1f4;return function(_0x26c563){logger[_0x0034('0x1c')](_0x26c563[_0x0034('0x2e')]);if(_0x26c563[_0x0034('0x2f')]){delete _0x26c563['name'];}_0x3b327c[_0x0034('0x22')](_0x4713c6)['send'](_0x26c563);};}exports[_0x0034('0x30')]=function(_0x13851d,_0x390b6a){var _0x26aba2={'include':[{'model':db[_0x0034('0x31')],'as':'mandatoryDispositionPause'}]},_0x11e2b3={},_0x2910b2={'count':0x0,'rows':[]};var _0x5b5bd0=_['map'](db[_0x0034('0x32')][_0x0034('0x33')],function(_0x248ece){return{'name':_0x248ece[_0x0034('0x34')],'type':_0x248ece[_0x0034('0x35')][_0x0034('0x36')]};});_0x11e2b3[_0x0034('0x37')]=_[_0x0034('0x38')](_0x5b5bd0,_0x0034('0x2f'));_0x11e2b3[_0x0034('0x39')]=_[_0x0034('0x3a')](_0x13851d['query']);_0x11e2b3[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x11e2b3[_0x0034('0x37')],_0x11e2b3[_0x0034('0x39')]);_0x26aba2[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x11e2b3[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x13851d[_0x0034('0x39')]['fields']));_0x26aba2[_0x0034('0x3d')]=_0x26aba2[_0x0034('0x3d')][_0x0034('0x3f')]?_0x26aba2[_0x0034('0x3d')]:_0x11e2b3[_0x0034('0x37')];if(!_0x13851d[_0x0034('0x39')][_0x0034('0x40')](_0x0034('0x41'))){_0x26aba2[_0x0034('0x27')]=qs[_0x0034('0x27')](_0x13851d['query'][_0x0034('0x27')]);_0x26aba2['offset']=qs[_0x0034('0x25')](_0x13851d[_0x0034('0x39')][_0x0034('0x25')]);}_0x26aba2['order']=qs['sort'](_0x13851d[_0x0034('0x39')][_0x0034('0x42')]);_0x26aba2['where']=qs['filters'](_['pick'](_0x13851d[_0x0034('0x39')],_0x11e2b3[_0x0034('0x3b')]),_0x5b5bd0);if(_0x13851d['query'][_0x0034('0x43')]){_0x26aba2['where']=_[_0x0034('0x44')](_0x26aba2[_0x0034('0x45')],{'$or':_[_0x0034('0x38')](_0x5b5bd0,function(_0x3469f7){if(_0x3469f7[_0x0034('0x35')]!==_0x0034('0x46')){var _0x1c29bf={};_0x1c29bf[_0x3469f7[_0x0034('0x2f')]]={'$like':'%'+_0x13851d[_0x0034('0x39')][_0x0034('0x43')]+'%'};return _0x1c29bf;}})});}_0x26aba2=_[_0x0034('0x44')]({},_0x26aba2,_0x13851d[_0x0034('0x47')]);var _0x3524da={'where':_0x26aba2[_0x0034('0x45')]};return db[_0x0034('0x32')][_0x0034('0x28')](_0x3524da)[_0x0034('0x16')](function(_0x33bcec){_0x2910b2[_0x0034('0x28')]=_0x33bcec;if(_0x13851d[_0x0034('0x39')][_0x0034('0x48')]){_0x26aba2['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x26aba2);})['then'](function(_0x416cc1){_0x2910b2[_0x0034('0x49')]=_0x416cc1;return _0x2910b2;})['then'](respondWithFilteredResult(_0x390b6a,_0x26aba2))[_0x0034('0x20')](handleError(_0x390b6a,null));};exports[_0x0034('0x4a')]=function(_0xf47c42,_0x53f17c){var _0x39388f={'raw':![],'where':{'id':_0xf47c42[_0x0034('0x4b')]['id']},'include':[{'model':db[_0x0034('0x31')],'as':_0x0034('0x4c')}]},_0x56e10c={};_0x56e10c[_0x0034('0x37')]=_[_0x0034('0x3a')](db['ChatWebsite'][_0x0034('0x33')]);_0x56e10c[_0x0034('0x39')]=_[_0x0034('0x3a')](_0xf47c42[_0x0034('0x39')]);_0x56e10c[_0x0034('0x3b')]=_['intersection'](_0x56e10c[_0x0034('0x37')],_0x56e10c[_0x0034('0x39')]);_0x39388f[_0x0034('0x3d')]=_['intersection'](_0x56e10c[_0x0034('0x37')],qs[_0x0034('0x3e')](_0xf47c42[_0x0034('0x39')]['fields']));_0x39388f[_0x0034('0x3d')]=_0x39388f[_0x0034('0x3d')][_0x0034('0x3f')]?_0x39388f[_0x0034('0x3d')]:_0x56e10c[_0x0034('0x37')];if(_0xf47c42[_0x0034('0x39')]['includeAll']){_0x39388f[_0x0034('0x4d')]=[{'all':!![]}];}_0x39388f=_['merge']({},_0x39388f,_0xf47c42[_0x0034('0x47')]);return db['ChatWebsite'][_0x0034('0x4e')](_0x39388f)[_0x0034('0x16')](handleEntityNotFound(_0x53f17c,null))['then'](respondWithResult(_0x53f17c,null))['catch'](handleError(_0x53f17c,null));};exports[_0x0034('0x4f')]=function(_0x387256,_0x57ce22){return db[_0x0034('0x32')]['create'](_0x387256[_0x0034('0x50')],{})[_0x0034('0x16')](function(_0x708de6){var _0x3fe4ca=_0x387256[_0x0034('0x51')]['get']({'plain':!![]});if(!_0x3fe4ca)throw new Error(_0x0034('0x52'));if(_0x3fe4ca[_0x0034('0x53')]===_0x0034('0x51')){var _0x5c58de=_0x708de6[_0x0034('0x2b')]({'plain':!![]});var _0x19483a='ChatWebsites';return db[_0x0034('0x54')][_0x0034('0x4e')]({'where':{'name':_0x19483a,'userProfileId':_0x3fe4ca['userProfileId']},'raw':!![]})[_0x0034('0x16')](function(_0x445a49){if(_0x445a49&&_0x445a49[_0x0034('0x55')]===0x0){return db[_0x0034('0x2d')][_0x0034('0x4f')]({'name':_0x5c58de['name'],'resourceId':_0x5c58de['id'],'type':_0x445a49['name'],'sectionId':_0x445a49['id']},{})[_0x0034('0x16')](function(){return _0x708de6;});}else{return _0x708de6;}})[_0x0034('0x20')](function(_0x21ca26){logger[_0x0034('0x1c')](_0x0034('0x56'),_0x21ca26);throw _0x21ca26;});}return _0x708de6;})['then'](respondWithResult(_0x57ce22,0xc9))[_0x0034('0x20')](handleError(_0x57ce22,null));};exports['update']=function(_0x371ba5,_0x33c7cf){if(_0x371ba5[_0x0034('0x50')]['id']){delete _0x371ba5[_0x0034('0x50')]['id'];}return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x371ba5['params']['id']},'include':[{'model':db[_0x0034('0x31')],'as':_0x0034('0x4c')}]})['then'](handleEntityNotFound(_0x33c7cf,null))[_0x0034('0x16')](saveUpdates(_0x371ba5['body'],null))[_0x0034('0x16')](respondWithResult(_0x33c7cf,null))[_0x0034('0x20')](handleError(_0x33c7cf,null));};exports[_0x0034('0x2a')]=function(_0x3158ee,_0xf04834){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x3158ee[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0xf04834,null))[_0x0034('0x16')](removeEntity(_0xf04834,null))[_0x0034('0x20')](handleError(_0xf04834,null));};exports['describe']=function(_0x3972d4,_0x58b06c){return db['ChatWebsite'][_0x0034('0x57')]()[_0x0034('0x16')](respondWithResult(_0x58b06c,null))[_0x0034('0x20')](handleError(_0x58b06c,null));};exports[_0x0034('0x58')]=function(_0x11d7f9,_0xefaee1){if(_0x11d7f9[_0x0034('0x50')]['id']){delete _0x11d7f9[_0x0034('0x50')]['id'];}return db[_0x0034('0x32')]['find']({'where':{'id':_0x11d7f9[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0xefaee1,null))[_0x0034('0x16')](function(_0x20e3aa){if(_0x20e3aa){_0x11d7f9['body']['ChatWebsiteId']=_0x20e3aa['id'];return db[_0x0034('0x59')][_0x0034('0x4f')](_0x11d7f9['body']);}})[_0x0034('0x16')](respondWithResult(_0xefaee1,null))[_0x0034('0x20')](handleError(_0xefaee1,null));};exports[_0x0034('0x5a')]=function(_0x51ecfe,_0x1d1a85){var _0xe59225={'raw':![],'where':{}};var _0x23d649={};var _0x109372={'count':0x0,'rows':[]};return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0x51ecfe[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x1d1a85,null))[_0x0034('0x16')](function(_0x346209){if(_0x346209){_0x23d649[_0x0034('0x37')]=_[_0x0034('0x3a')](db[_0x0034('0x59')]['rawAttributes']);_0x23d649[_0x0034('0x39')]=_[_0x0034('0x3a')](_0x51ecfe[_0x0034('0x39')]);_0x23d649[_0x0034('0x3b')]=_['intersection'](_0x23d649[_0x0034('0x37')],_0x23d649[_0x0034('0x39')]);_0xe59225[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x23d649[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x51ecfe['query'][_0x0034('0x3e')]));_0xe59225[_0x0034('0x3d')]=_0xe59225[_0x0034('0x3d')][_0x0034('0x3f')]?_0xe59225[_0x0034('0x3d')]:_0x23d649[_0x0034('0x37')];if(!_0x51ecfe[_0x0034('0x39')][_0x0034('0x40')](_0x0034('0x41'))){_0xe59225[_0x0034('0x27')]=qs['limit'](_0x51ecfe[_0x0034('0x39')][_0x0034('0x27')]);_0xe59225[_0x0034('0x25')]=qs[_0x0034('0x25')](_0x51ecfe[_0x0034('0x39')][_0x0034('0x25')]);}_0xe59225[_0x0034('0x5c')]=qs['sort'](_0x51ecfe['query'][_0x0034('0x42')]);_0xe59225[_0x0034('0x45')]=qs[_0x0034('0x3b')](_[_0x0034('0x5d')](_0x51ecfe[_0x0034('0x39')],_0x23d649[_0x0034('0x3b')]));_0xe59225[_0x0034('0x45')]['ChatWebsiteId']=_0x346209['id'];if(_0x51ecfe[_0x0034('0x39')][_0x0034('0x43')]){_0xe59225[_0x0034('0x45')]=_['merge'](_0xe59225['where'],{'$or':_['map'](_0xe59225[_0x0034('0x3d')],function(_0x499d1a){var _0x1fafc1={};_0x1fafc1[_0x499d1a]={'$like':'%'+_0x51ecfe[_0x0034('0x39')][_0x0034('0x43')]+'%'};return _0x1fafc1;})});}_0xe59225=_['merge']({},_0xe59225,_0x51ecfe[_0x0034('0x47')]);return db[_0x0034('0x59')][_0x0034('0x28')]({'where':_0xe59225['where']})[_0x0034('0x16')](function(_0x47c264){_0x109372[_0x0034('0x28')]=_0x47c264;if(_0x51ecfe[_0x0034('0x39')]['includeAll']){_0xe59225[_0x0034('0x4d')]=[{'all':!![]}];}return db[_0x0034('0x59')][_0x0034('0x5e')](_0xe59225);})[_0x0034('0x16')](function(_0x49df65){_0x109372[_0x0034('0x49')]=_0x49df65;return _0x109372;});}})['then'](respondWithFilteredResult(_0x1d1a85,_0xe59225))[_0x0034('0x20')](handleError(_0x1d1a85,null));};exports[_0x0034('0x5f')]=function(_0x32d5a6,_0x5abecd){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x32d5a6[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x5abecd,null))[_0x0034('0x16')](function(_0x25ca4e){if(_0x25ca4e){return _0x25ca4e[_0x0034('0x5f')](_0x32d5a6[_0x0034('0x39')]['ids']);}})[_0x0034('0x16')](respondWithStatusCode(_0x5abecd,null))[_0x0034('0x20')](handleError(_0x5abecd,null));};exports[_0x0034('0x60')]=function(_0x5a0dd6,_0x1bd869){if(_0x5a0dd6[_0x0034('0x50')]['id']){delete _0x5a0dd6[_0x0034('0x50')]['id'];}return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x5a0dd6[_0x0034('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1bd869,null))[_0x0034('0x16')](function(_0x406a2){if(_0x406a2){_0x5a0dd6['body'][_0x0034('0x61')]=_0x406a2['id'];return db[_0x0034('0x62')][_0x0034('0x4f')](_0x5a0dd6['body']);}})['then'](respondWithResult(_0x1bd869,null))['catch'](handleError(_0x1bd869,null));};exports[_0x0034('0x63')]=function(_0x51d1c5,_0x3dbf48){var _0x543bb3={'raw':![],'where':{}};var _0x56429e={};var _0x1673ef={'count':0x0,'rows':[]};return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0x51d1c5['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x3dbf48,null))[_0x0034('0x16')](function(_0xb2993f){if(_0xb2993f){_0x56429e[_0x0034('0x37')]=_[_0x0034('0x3a')](db['CannedAnswer'][_0x0034('0x33')]);_0x56429e[_0x0034('0x39')]=_[_0x0034('0x3a')](_0x51d1c5[_0x0034('0x39')]);_0x56429e[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x56429e[_0x0034('0x37')],_0x56429e[_0x0034('0x39')]);_0x543bb3[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x56429e[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x51d1c5['query']['fields']));_0x543bb3[_0x0034('0x3d')]=_0x543bb3[_0x0034('0x3d')][_0x0034('0x3f')]?_0x543bb3[_0x0034('0x3d')]:_0x56429e[_0x0034('0x37')];if(!_0x51d1c5[_0x0034('0x39')]['hasOwnProperty'](_0x0034('0x41'))){_0x543bb3[_0x0034('0x27')]=qs['limit'](_0x51d1c5[_0x0034('0x39')][_0x0034('0x27')]);_0x543bb3[_0x0034('0x25')]=qs['offset'](_0x51d1c5['query'][_0x0034('0x25')]);}_0x543bb3['order']=qs[_0x0034('0x42')](_0x51d1c5[_0x0034('0x39')]['sort']);_0x543bb3[_0x0034('0x45')]=qs['filters'](_[_0x0034('0x5d')](_0x51d1c5[_0x0034('0x39')],_0x56429e[_0x0034('0x3b')]));_0x543bb3['where']['ChatWebsiteId']=_0xb2993f['id'];if(_0x51d1c5[_0x0034('0x39')][_0x0034('0x43')]){_0x543bb3['where']=_[_0x0034('0x44')](_0x543bb3[_0x0034('0x45')],{'$or':_[_0x0034('0x38')](_0x543bb3[_0x0034('0x3d')],function(_0x177ba1){var _0x2ba8ae={};_0x2ba8ae[_0x177ba1]={'$like':'%'+_0x51d1c5[_0x0034('0x39')][_0x0034('0x43')]+'%'};return _0x2ba8ae;})});}_0x543bb3=_[_0x0034('0x44')]({},_0x543bb3,_0x51d1c5[_0x0034('0x47')]);return db[_0x0034('0x62')][_0x0034('0x28')]({'where':_0x543bb3[_0x0034('0x45')]})[_0x0034('0x16')](function(_0x4d91ae){_0x1673ef[_0x0034('0x28')]=_0x4d91ae;if(_0x51d1c5[_0x0034('0x39')]['includeAll']){_0x543bb3['include']=[{'all':!![]}];}return db[_0x0034('0x62')][_0x0034('0x5e')](_0x543bb3);})[_0x0034('0x16')](function(_0x597a1d){_0x1673ef['rows']=_0x597a1d;return _0x1673ef;});}})['then'](respondWithFilteredResult(_0x3dbf48,_0x543bb3))[_0x0034('0x20')](handleError(_0x3dbf48,null));};exports[_0x0034('0x64')]=function(_0x7a0f24,_0x2701eb){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x7a0f24[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x2701eb,null))[_0x0034('0x16')](function(_0x3888d8){if(_0x3888d8){return _0x3888d8[_0x0034('0x64')](_0x7a0f24[_0x0034('0x39')][_0x0034('0x65')]);}})['then'](respondWithStatusCode(_0x2701eb,null))[_0x0034('0x20')](handleError(_0x2701eb,null));};exports[_0x0034('0x66')]=function(_0x3c36f6,_0x1ca5d7){_0x3c36f6['body']['sitepic']=_0x3c36f6[_0x0034('0x67')][_0x0034('0x68')];return db['ChatWebsite']['find']({'where':{'id':_0x3c36f6[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x1ca5d7,null))['then'](saveUpdates(_0x3c36f6[_0x0034('0x50')],null))[_0x0034('0x16')](respondWithResult(_0x1ca5d7,null))[_0x0034('0x20')](handleError(_0x1ca5d7,null));};exports[_0x0034('0x69')]=function(_0x2de6d1,_0x218ac0){_0x2de6d1[_0x0034('0x50')]['agentAvatar']=_0x2de6d1[_0x0034('0x67')][_0x0034('0x68')];return db['ChatWebsite']['find']({'where':{'id':_0x2de6d1[_0x0034('0x4b')]['id']}})['then'](handleEntityNotFound(_0x218ac0,null))[_0x0034('0x16')](saveUpdates(_0x2de6d1['body'],null))[_0x0034('0x16')](respondWithResult(_0x218ac0,null))[_0x0034('0x20')](handleError(_0x218ac0,null));};exports[_0x0034('0x6a')]=function(_0x1997f7,_0x572748){_0x1997f7['body'][_0x0034('0x6b')]=_0x1997f7['file'][_0x0034('0x68')];return db['ChatWebsite'][_0x0034('0x4e')]({'where':{'id':_0x1997f7[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x572748,null))['then'](saveUpdates(_0x1997f7[_0x0034('0x50')],null))['then'](respondWithResult(_0x572748,null))[_0x0034('0x20')](handleError(_0x572748,null));};exports['addSystemAvatar']=function(_0x35d75c,_0x20410c){_0x35d75c[_0x0034('0x50')]['systemAvatar']=_0x35d75c[_0x0034('0x67')]['filename'];return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x35d75c[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x20410c,null))[_0x0034('0x16')](saveUpdates(_0x35d75c['body'],null))[_0x0034('0x16')](respondWithResult(_0x20410c,null))[_0x0034('0x20')](handleError(_0x20410c,null));};exports[_0x0034('0x6c')]=function(_0x1017d3,_0x2633c3){var _0x1f9497=path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x6f'));var _0x47b084={'where':{'id':_0x1017d3['params']['id']},'attributes':['id',_0x0034('0x70')],'raw':!![]};var _0x3f1cef=![];return require(_0x0034('0x71'))['getLicense']()[_0x0034('0x16')](function(_0x1cf0ab){if(_0x1cf0ab){_0x3f1cef=_0x1cf0ab['custom'];}})[_0x0034('0x16')](function(){return db[_0x0034('0x32')][_0x0034('0x4e')](_0x47b084);})[_0x0034('0x16')](handleEntityNotFound(_0x2633c3,null))['then'](function(_0x1a9c99){if(_0x1a9c99){if(!_[_0x0034('0x72')](_0x1a9c99[_0x0034('0x70')])){if(fs[_0x0034('0x73')](path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x74'),_0x1a9c99[_0x0034('0x70')]))&&_0x3f1cef){_0x1f9497=path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x74'),_0x1a9c99[_0x0034('0x70')]);}}return _0x2633c3[_0x0034('0x75')](_0x1f9497);}})[_0x0034('0x20')](handleError(_0x2633c3,null));};exports[_0x0034('0x76')]=function(_0x28ec3f,_0x299367){var _0x27b621=path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x77'));var _0x5c2aa2={'where':{'id':_0x28ec3f[_0x0034('0x4b')]['id']},'attributes':['id',_0x0034('0x78')],'raw':!![]};return db[_0x0034('0x32')][_0x0034('0x4e')](_0x5c2aa2)['then'](handleEntityNotFound(_0x299367,null))[_0x0034('0x16')](function(_0x14796c){if(_0x14796c){if(!_['isNil'](_0x14796c[_0x0034('0x78')])){if(fs[_0x0034('0x73')](path[_0x0034('0x6d')](config['root'],_0x0034('0x79'),_0x14796c[_0x0034('0x78')]))){_0x27b621=path[_0x0034('0x6d')](config['root'],_0x0034('0x79'),_0x14796c[_0x0034('0x78')]);}}return _0x299367[_0x0034('0x75')](_0x27b621);}})[_0x0034('0x20')](handleError(_0x299367,null));};exports['getCustomerAvatar']=function(_0x3093fc,_0x582064){var _0x4f06bd=path[_0x0034('0x6d')](config[_0x0034('0x6e')],'server/files/images/avatars/customer_avatar.png');var _0x509047={'where':{'id':_0x3093fc['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x0034('0x32')][_0x0034('0x4e')](_0x509047)[_0x0034('0x16')](handleEntityNotFound(_0x582064,null))['then'](function(_0x342ce5){if(_0x342ce5){if(!_[_0x0034('0x72')](_0x342ce5[_0x0034('0x6b')])){if(fs[_0x0034('0x73')](path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x79'),_0x342ce5[_0x0034('0x6b')]))&&_0x342ce5['showCustomerAvatar']){_0x4f06bd=path[_0x0034('0x6d')](config[_0x0034('0x6e')],'server/files/images/avatars/',_0x342ce5['customerAvatar']);}}return _0x582064['download'](_0x4f06bd);}})[_0x0034('0x20')](handleError(_0x582064,null));};exports[_0x0034('0x7a')]=function(_0x53f5d1,_0x568929){var _0xb141b4=path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x7b'));var _0x48216b={'where':{'id':_0x53f5d1['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x0034('0x4e')](_0x48216b)[_0x0034('0x16')](handleEntityNotFound(_0x568929,null))['then'](function(_0x3e56d0){if(_0x3e56d0){if(!_[_0x0034('0x72')](_0x3e56d0[_0x0034('0x7c')])){if(fs[_0x0034('0x73')](path[_0x0034('0x6d')](config[_0x0034('0x6e')],'server/files/images/avatars/',_0x3e56d0[_0x0034('0x7c')]))){_0xb141b4=path[_0x0034('0x6d')](config['root'],_0x0034('0x79'),_0x3e56d0[_0x0034('0x7c')]);}}return _0x568929[_0x0034('0x75')](_0xb141b4);}})[_0x0034('0x20')](handleError(_0x568929,null));};exports[_0x0034('0x7d')]=function(_0x4640d7,_0x337bbc){var _0x415cd0=require(_0x0034('0x7e'));var _0x405c34=new _0x415cd0();var _0x375894=_0x405c34['setUA'](_0x4640d7[_0x0034('0x7f')]['user-agent'])[_0x0034('0x80')]();var _0x2fcb33={'body':_0x4640d7[_0x0034('0x50')],'channel':'chat'};var _0x3df169=[];var _0xfdbdbd=[];var _0x4d367c={};var _0xbd2533=![];return db[_0x0034('0x81')][_0x0034('0x57')]()[_0x0034('0x16')](function(_0x43c730){if(!_0x43c730){throw new db['Sequelize'][(_0x0034('0x82'))](_0x0034('0x83'));}_0x3df169=_[_0x0034('0x84')](_[_0x0034('0x3a')](_0x43c730),[_0x0034('0x85'),_0x0034('0x86')]);_0xfdbdbd=_[_0x0034('0x84')](_[_0x0034('0x3a')](_0x43c730),[_0x0034('0x85'),_0x0034('0x86'),'CompanyId',_0x0034('0x87')]);if(_0x4640d7[_0x0034('0x50')]['id']){delete _0x4640d7[_0x0034('0x50')]['id'];}if(_[_0x0034('0x72')](_0x4640d7[_0x0034('0x50')][_0x0034('0x88')])){throw new db[(_0x0034('0x89'))][(_0x0034('0x82'))](_0x0034('0x8a'));}if(_[_0x0034('0x72')](_0x4640d7[_0x0034('0x50')][_0x0034('0x50')])||_0x4640d7[_0x0034('0x50')]['body']===''){throw new db[(_0x0034('0x89'))][(_0x0034('0x82'))](_0x0034('0x8b'));}if(_['isNil'](_0x4640d7[_0x0034('0x50')][_0x0034('0x8c')])){throw new db[(_0x0034('0x89'))][(_0x0034('0x82'))](_0x0034('0x8d')+_0xfdbdbd);}if(!_[_0x0034('0x8e')](_0xfdbdbd,_0x4640d7[_0x0034('0x50')]['mapKey'])){throw new db[(_0x0034('0x89'))][(_0x0034('0x82'))](_0x0034('0x8f')+_0xfdbdbd);}_0x4d367c[_0x4640d7[_0x0034('0x50')][_0x0034('0x8c')]]=_0x4640d7[_0x0034('0x50')][_0x0034('0x88')];})[_0x0034('0x16')](function(){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x4640d7['params']['id']},'include':[{'model':db[_0x0034('0x90')],'as':_0x0034('0x91'),'include':[{'model':db[_0x0034('0x81')],'as':_0x0034('0x92'),'where':_0x4d367c,'limit':0x1,'order':[[_0x0034('0x86'),'DESC']]}]},{'model':db[_0x0034('0x93')],'as':_0x0034('0x94')}]});})[_0x0034('0x16')](handleEntityNotFound(_0x337bbc,null))[_0x0034('0x16')](function(_0xe2461){if(_0xe2461&&_0xe2461[_0x0034('0x91')]){_0x2fcb33[_0x0034('0x95')]=_0xe2461;_0x2fcb33[_0x0034('0x96')]=_0xe2461[_0x0034('0x94')];_0x2fcb33[_0x0034('0x97')]=_0xe2461[_0x0034('0x91')];_0x2fcb33[_0x0034('0x96')]=_[_0x0034('0x98')](_0x2fcb33[_0x0034('0x96')],[_0x0034('0x99')],[_0x0034('0x9a')]);if(_0x2fcb33[_0x0034('0x95')]['Applications']){delete _0x2fcb33['account'][_0x0034('0x94')];}if(_0x2fcb33[_0x0034('0x95')]['List']&&_0x2fcb33['account']['List'][_0x0034('0x92')]['length']){return _0x2fcb33[_0x0034('0x95')][_0x0034('0x91')]['Contacts'][0x0];}var _0x4d729f=_['defaults'](_0x4640d7[_0x0034('0x50')],{'firstName':_0x4640d7[_0x0034('0x50')][_0x0034('0x88')],'ListId':_0xe2461[_0x0034('0x87')]});_0x4d729f[_0x4640d7['body'][_0x0034('0x8c')]]=_0x4640d7[_0x0034('0x50')]['from'];return db[_0x0034('0x81')][_0x0034('0x4f')](_0x4d729f,{'fields':_0x3df169,'raw':!![]});}})[_0x0034('0x16')](handleEntityNotFound(_0x337bbc,null))[_0x0034('0x16')](function(_0x1ff00f){_0x2fcb33[_0x0034('0x9b')]=_0x1ff00f;var _0x42b939=_0x4640d7[_0x0034('0x50')][_0x0034('0x9c')];if(_0x4640d7[_0x0034('0x7f')][_0x0034('0x9d')]){_0x42b939=_0x4640d7['headers'][_0x0034('0x9d')];}else if(_0x4640d7[_0x0034('0x7f')][_0x0034('0x9e')]){_0x42b939=_['first'](_0x4640d7['headers'][_0x0034('0x9e')][_0x0034('0x9f')](','));}if(_0x1ff00f){var _0x23d1e1={'ContactId':_0x1ff00f['id'],'ChatWebsiteId':_0x4640d7['params']['id'],'from':(_0x1ff00f[_0x0034('0xa0')]||'')+'\x20'+(_0x1ff00f['lastName']||''),'customerIp':_0x42b939,'customerPort':_0x4640d7[_0x0034('0x7f')][_0x0034('0xa1')]?_0x4640d7[_0x0034('0x7f')][_0x0034('0xa1')]:null,'referer':_0x4640d7['body']['referer'],'browserName':_0x375894['browser'][_0x0034('0x2f')]&&_0x375894[_0x0034('0xa2')][_0x0034('0xa3')]?util[_0x0034('0xa4')](_0x0034('0xa5'),_0x375894[_0x0034('0xa2')][_0x0034('0x2f')],_0x375894['browser'][_0x0034('0xa3')]):_0x0034('0xa6'),'browserVersion':_0x375894[_0x0034('0xa2')][_0x0034('0xa3')]||'unknown','osName':util[_0x0034('0xa4')](_0x0034('0xa5'),_0x375894['os'][_0x0034('0x2f')],_0x375894['os'][_0x0034('0xa3')]),'osVersion':_0x375894['os']['version'],'deviceModel':_0x375894[_0x0034('0xa7')][_0x0034('0x37')]&&_0x375894[_0x0034('0xa7')][_0x0034('0xa8')]?util[_0x0034('0xa4')](_0x0034('0xa9'),_0x375894['device'][_0x0034('0x37')],_0x375894[_0x0034('0xa7')]['vendor'],_0x375894[_0x0034('0xa7')][_0x0034('0x35')]):null,'deviceVendor':_0x375894['device'][_0x0034('0xa8')],'deviceType':_0x375894['device'][_0x0034('0x35')],'formData':JSON[_0x0034('0x1b')](_0x4640d7[_0x0034('0x50')])};var _0x265cba={'ChatWebsiteId':_0x4640d7[_0x0034('0x4b')]['id'],'closed':![]};if(_0x4640d7['body'][_0x0034('0xaa')]){_0x265cba['threadId']=_0x4640d7[_0x0034('0x50')][_0x0034('0xaa')];return db[_0x0034('0xab')][_0x0034('0x4e')]({'where':_0x265cba})[_0x0034('0x16')](function(_0x11673f){if(_0x11673f){return[_0x11673f,![]];}_0x23d1e1[_0x0034('0xaa')]=_0x4640d7[_0x0034('0x50')][_0x0034('0xaa')];_0x23d1e1[_0x0034('0xac')]=_0x4640d7['body'][_0x0034('0xac')];return db['ChatInteraction'][_0x0034('0x4f')](_0x23d1e1)[_0x0034('0x16')](function(_0x2ac908){return[_0x2ac908,!![]];});});}_0x265cba['ContactId']=_0x1ff00f['id'];if(_0x4640d7[_0x0034('0x50')][_0x0034('0xad')]&&_0x4640d7[_0x0034('0x50')]['interaction']['id']){_0x265cba['id']=_0x4640d7[_0x0034('0x50')][_0x0034('0xad')]['id'];return db[_0x0034('0xab')][_0x0034('0x4e')]({'where':_0x265cba})[_0x0034('0x16')](function(_0x46651d){if(_0x46651d){return[_0x46651d,![]];}return db[_0x0034('0xab')][_0x0034('0x4f')](_0x23d1e1)[_0x0034('0x16')](function(_0x317507){return[_0x317507,!![]];});});}return db[_0x0034('0xab')][_0x0034('0x4f')](_0x23d1e1)['then'](function(_0x5640fa){return[_0x5640fa,!![]];});}})['spread'](function(_0x479b64,_0xc70c52){if(_0x479b64){_0xbd2533=_0xc70c52;if(!_0xc70c52){var _0x5ce37b={'from':(_0x2fcb33[_0x0034('0x9b')][_0x0034('0xa0')]||'')+'\x20'+(_0x2fcb33[_0x0034('0x9b')][_0x0034('0xae')]||'')};if(_0x4640d7['body']['threadId']&&_0x4640d7[_0x0034('0x50')]['messageId']&&_0x4640d7[_0x0034('0x50')]['threadId']!=_0x4640d7[_0x0034('0x50')][_0x0034('0xaf')]){_0x5ce37b[_0x0034('0xaa')]=_0x4640d7[_0x0034('0x50')]['messageId'];}return _0x479b64['update'](_0x5ce37b);}else{return _0x479b64;}}})[_0x0034('0x16')](function(_0x29a931){_0x2fcb33[_0x0034('0xad')]=_0x29a931['get']({'plain':!![]});_0x2fcb33[_0x0034('0xad')][_0x0034('0xb0')]=_0xbd2533;if(_0x2fcb33[_0x0034('0xad')][_0x0034('0xb0')]){if(_0x2fcb33[_0x0034('0x95')]['autoclose']){_0x2fcb33['applications'][_0x0034('0xb1')]({'id':0x0,'priority':_0x2fcb33[_0x0034('0x96')][_0x0034('0x3f')]+0x1,'app':_0x0034('0xb2'),'appdata':_0x0034('0xb3'),'interval':_0x0034('0xb4')});}}return db[_0x0034('0xb5')][_0x0034('0x4f')]({'body':_0x4640d7['body'][_0x0034('0x50')],'ChatWebsiteId':_0x4640d7[_0x0034('0x4b')]['id'],'ChatInteractionId':_0x29a931['id'],'direction':'in','ContactId':_0x2fcb33['contact']['id'],'AttachmentId':_0x4640d7['body']['AttachmentId']});})[_0x0034('0x16')](function(_0x1413a3){_0x2fcb33[_0x0034('0x1f')]=_0x1413a3;if(_0x2fcb33[_0x0034('0xad')][_0x0034('0xb6')]){return db['User']['find']({'attributes':['id',_0x0034('0x2f')],'where':{'id':_0x2fcb33[_0x0034('0xad')][_0x0034('0xb6')]}})[_0x0034('0x16')](function(_0x3b7fb0){if(_0x3b7fb0){_0x2fcb33[_0x0034('0x96')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0034('0xb7'),'appdata':_0x3b7fb0['name']+','+(_0x2fcb33[_0x0034('0x95')][_0x0034('0xb8')]||0xa),'interval':_0x0034('0xb4')});_0x2fcb33[_0x0034('0xb9')]=!![];}return respondWithRpcPromise(_0x0034('0xba'),'startRouting',_0x2fcb33);});}return respondWithRpcPromise('Start',_0x0034('0xbb'),_0x2fcb33);})['then'](function(_0x4f5540){respondWithRpcPromise(_0x0034('0xbc'),_0x0034('0xbc'),{'event':_0x0034('0x7d'),'message':_0x4f5540},client9002);return _0x4f5540;})['then'](respondWithResult(_0x337bbc,null))['catch'](handleError(_0x337bbc,null));};exports[_0x0034('0xbd')]=function(_0x335a9f,_0x3106bb){var _0x3269fb,_0x49f407,_0x6788a6;var _0x65a599=[];var _0x395102={};var _0x57e793=_0x335a9f[_0x0034('0xbe')]||[];var _0x97b2b9=[];var _0x145ad1;return db[_0x0034('0x81')][_0x0034('0x57')]()[_0x0034('0x16')](function(_0x376000){if(!_0x376000){throw new db['Sequelize'][(_0x0034('0x82'))](_0x0034('0x83'));}_0x65a599=_[_0x0034('0x84')](_['keys'](_0x376000),['createdAt',_0x0034('0x86'),'CompanyId',_0x0034('0x87')]);if(_0x335a9f[_0x0034('0x50')]['id']){delete _0x335a9f[_0x0034('0x50')]['id'];}if(_[_0x0034('0x72')](_0x335a9f[_0x0034('0x50')][_0x0034('0x88')])){throw _0x3106bb[_0x0034('0x22')](0x1f4)[_0x0034('0xbf')](new db[(_0x0034('0x89'))][(_0x0034('0x82'))]('from\x20is\x20mandatory'));}if(_[_0x0034('0x72')](_0x335a9f[_0x0034('0x50')][_0x0034('0x50')])||_0x335a9f[_0x0034('0x50')][_0x0034('0x50')]===''){throw _0x3106bb[_0x0034('0x22')](0x1f4)[_0x0034('0xbf')](new db['Sequelize']['ValidationError'](_0x0034('0x8b')));}if(_[_0x0034('0x72')](_0x335a9f['body'][_0x0034('0xc0')])){throw _0x3106bb[_0x0034('0x22')](0x1f4)[_0x0034('0xbf')](new db[(_0x0034('0x89'))][(_0x0034('0x82'))](_0x0034('0xc1')+_0x65a599));}if(!_[_0x0034('0x8e')](_0x65a599,_0x335a9f['body']['mapKeyOffline'])){throw _0x3106bb['status'](0x1f4)['send'](new db[(_0x0034('0x89'))]['ValidationError'](_0x0034('0xc2')+_0x65a599));}_0x395102[_0x335a9f[_0x0034('0x50')][_0x0034('0xc0')]]=_0x335a9f[_0x0034('0x50')]['from'];})[_0x0034('0x16')](function(){return db[_0x0034('0x32')]['find']({'where':{'id':_0x335a9f['params']['id']},'include':[{'model':db[_0x0034('0x90')],'as':'List'},{'model':db[_0x0034('0xc3')],'as':_0x0034('0xc3')}]});})[_0x0034('0x16')](handleEntityNotFound(_0x3106bb,null))['then'](function(_0xc7ab5e){if(_0xc7ab5e&&_0xc7ab5e[_0x0034('0x91')]){_0x49f407=_0xc7ab5e;var _0x597490=_[_0x0034('0xd')](_0x335a9f['body'],{'firstName':_0x335a9f[_0x0034('0x50')][_0x0034('0x88')],'phone':_0x335a9f[_0x0034('0x50')][_0x0034('0x88')],'ListId':_0xc7ab5e['ListId']});_0x597490[_0x335a9f['body'][_0x0034('0xc0')]]=_0x335a9f['body'][_0x0034('0x88')];return db[_0x0034('0x81')][_0x0034('0xc4')]({'where':_0x395102,'defaults':_0x597490});}})[_0x0034('0xc5')](function(_0xc423e6){if(_0xc423e6){_0x6788a6=_0xc423e6;var _0x4fbb74=fs['readFileSync'](path[_0x0034('0x6d')](config['root'],_0x0034('0xc6')),_0x0034('0xc7'));var _0x589a52=ejs[_0x0034('0xc8')](_0x4fbb74,{'body':_['toPairs'](_0x335a9f['body'][_0x0034('0x50')]),'bodyTitle':_0x49f407[_0x0034('0xc9')]});return db[_0x0034('0xca')][_0x0034('0x4f')]({'body':_0x589a52,'plainBody':htmlToText[_0x0034('0xcb')](_0x589a52),'ContactId':_0xc423e6['id'],'ChatWebsiteId':_0x49f407['id']});}})[_0x0034('0x16')](function(_0x31b434){_0x145ad1=_0x31b434;if(_0x57e793[_0x0034('0x3f')]){var _0x13a168=_0x57e793['map'](function(_0x1b3ae3){return{'name':_0x1b3ae3['originalname'],'basename':_0x1b3ae3[_0x0034('0x68')],'type':_0x1b3ae3[_0x0034('0xcc')],'ChatOfflineMessageId':_0x31b434['id']};});_0x97b2b9=_0x13a168[_0x0034('0x38')](_0x251f80=>{var _0xed7213={'filename':_0x251f80[_0x0034('0x2f')],'path':path['join'](config['root'],_0x0034('0xcd'),_0x0034('0xbe'),'attachments',_0x0034('0xce'),_0x251f80[_0x0034('0xcf')])};return _0xed7213;});if(!_0x49f407[_0x0034('0xd0')]){return db[_0x0034('0xd1')]['transaction'](function(_0x311d19){return db[_0x0034('0xd2')][_0x0034('0xd3')](_0x13a168,{'transaction':_0x311d19});});}}})['then'](function(){if(_0x145ad1){_0x3269fb=_0x145ad1;return db[_0x0034('0xc3')][_0x0034('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0x0034('0xd4')],'as':_0x0034('0xd5'),'raw':!![],'include':[{'model':db[_0x0034('0xd6')],'as':_0x0034('0xd6'),'raw':!![]}]}]});}})[_0x0034('0x16')](function(_0x1ef6c9){if(_0x1ef6c9&&_0x1ef6c9[_0x0034('0xd5')]&&_0x49f407[_0x0034('0xd7')]&&_0x49f407['forwardOfflineAddress']){var _0x29a6cc=_0x1ef6c9[_0x0034('0xd8')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x29a6cc,'message':{'from':util[_0x0034('0xa4')](_0x0034('0xd9'),_0x1ef6c9[_0x0034('0x2f')],_0x1ef6c9[_0x0034('0xda')]||_0x1ef6c9[_0x0034('0xd5')]['user']),'to':_0x49f407[_0x0034('0xdb')],'subject':_0x49f407[_0x0034('0xdc')],'html':_0x3269fb[_0x0034('0x50')],'attachments':_0x97b2b9}},client9003)[_0x0034('0x16')](function(){return _0x3269fb;})['catch'](function(_0xaa920d){logger[_0x0034('0x1c')](_0xaa920d);});}})[_0x0034('0x16')](function(){if(_0x49f407&&_0x49f407['openNewInteraction']&&_0x49f407[_0x0034('0xdd')]){var _0x483b96=[];if(_0x57e793[_0x0034('0x3f')]){_0x483b96=_0x57e793[_0x0034('0x38')](function(_0x5da66b){return{'name':_0x5da66b[_0x0034('0xde')],'basename':_0x5da66b[_0x0034('0x68')],'type':_0x5da66b[_0x0034('0xcc')],'ChatOfflineMessageId':_0x145ad1['id']};});}var _0x3f9925;if(!_[_0x0034('0x72')](_0x49f407[_0x0034('0xdf')])){var _0x58fd3d=_[_0x0034('0x38')](_0x335a9f[_0x0034('0x50')],function(_0x8e754a){return _0x8e754a;});var _0x138367=_['toPairsIn'](_0x58fd3d)[0x0];var _0x1c299d=_[_0x0034('0xe0')](_0x138367,function(_0x59bcdb){return _0x59bcdb;});_0x3f9925=_0x1c299d[0x1][_0x49f407[_0x0034('0xdf')]];}var _0x5b8444={'from':_0x6788a6[_0x0034('0xda')],'firstName':_0x6788a6[_0x0034('0xa0')],'lastName':_0x6788a6[_0x0034('0xae')],'mapKey':'email','message':{'from':_0x6788a6['email'],'to':_0x49f407[_0x0034('0xc3')][_0x0034('0xda')],'cc':'','subject':_[_0x0034('0x72')](_0x3f9925)?_0x49f407[_0x0034('0xdc')]:_0x3f9925,'messageId':'','sentAt':new Date(),'attach':_0x483b96[_0x0034('0x3f')],'attachments':_0x483b96,'originChannel':_0x0034('0xe1'),'ChatWebsiteId':_0x49f407['id'],'ChatOfflineMessageId':_0x3269fb['id'],'originTo':_0x49f407[_0x0034('0xc3')][_0x0034('0xda')]},'body':_0x3269fb['body']};var _0x567b9f={'account':{'id':_0x49f407[_0x0034('0xdd')]},'body':_0x5b8444,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x0034('0xe2'),_0x0034('0xe3'),_0x567b9f,client9001)['then'](function(){return _0x3269fb;})[_0x0034('0x20')](function(_0xd5240a){logger[_0x0034('0x1c')](_0xd5240a);});}return;})[_0x0034('0x16')](function(){if(_0x3269fb){return _0x3269fb;}})[_0x0034('0x16')](respondWithResult(_0x3106bb,null))['catch'](function(_0x17c6d0){logger[_0x0034('0x1c')](_0x0034('0x20'),_0x17c6d0);for(var _0x1243b4 of _0x57e793){var _0x131634=path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0xcd'),_0x0034('0xbe'),_0x0034('0xe4'),_0x0034('0xce'),_0x1243b4[_0x0034('0x68')]);fs_extra[_0x0034('0xe5')](_0x131634)[_0x0034('0x20')](function(_0x1779a2){logger[_0x0034('0x1c')]('Could\x20not\x20remove\x20attachment\x20file',_0x131634,_0x1779a2);});}});};exports[_0x0034('0xe6')]=function(_0x4d664b,_0x58966a){return db['ChatInteraction'][_0x0034('0x4e')]({'where':{'id':_0x4d664b['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x58966a,null))[_0x0034('0x16')](function(_0x4f0442){if(_0x4f0442){return _0x4f0442[_0x0034('0xe6')](_0x4d664b[_0x0034('0x50')]['ids'],_['omit'](_0x4d664b['body'],[_0x0034('0x65'),'id'])||{});}})['then'](respondWithResult(_0x58966a,null))[_0x0034('0x20')](handleError(_0x58966a,null));};exports[_0x0034('0xe7')]=function(_0x512fab,_0x44aaf6){var _0x432b3e={'raw':![],'where':{}};var _0x4ace8a={};var _0x18c4bf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0034('0x5b')]({'where':{'id':_0x512fab['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x44aaf6,null))[_0x0034('0x16')](function(_0x100757){if(_0x100757){_0x4ace8a['model']=_[_0x0034('0x3a')](db[_0x0034('0xab')][_0x0034('0x33')]);_0x4ace8a[_0x0034('0x39')]=_[_0x0034('0x3a')](_0x512fab[_0x0034('0x39')]);_0x4ace8a[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x4ace8a[_0x0034('0x37')],_0x4ace8a[_0x0034('0x39')]);_0x432b3e['attributes']=_[_0x0034('0x3c')](_0x4ace8a[_0x0034('0x37')],qs['fields'](_0x512fab['query'][_0x0034('0x3e')]));_0x432b3e['attributes']=_0x432b3e[_0x0034('0x3d')][_0x0034('0x3f')]?_0x432b3e['attributes']:_0x4ace8a[_0x0034('0x37')];if(!_0x512fab[_0x0034('0x39')]['hasOwnProperty'](_0x0034('0x41'))){_0x432b3e[_0x0034('0x27')]=qs[_0x0034('0x27')](_0x512fab[_0x0034('0x39')][_0x0034('0x27')]);_0x432b3e[_0x0034('0x25')]=qs[_0x0034('0x25')](_0x512fab[_0x0034('0x39')][_0x0034('0x25')]);}_0x432b3e[_0x0034('0x5c')]=qs['sort'](_0x512fab[_0x0034('0x39')][_0x0034('0x42')]);_0x432b3e[_0x0034('0x45')]=qs['filters'](_[_0x0034('0x5d')](_0x512fab[_0x0034('0x39')],_0x4ace8a['filters']));_0x432b3e[_0x0034('0x45')][_0x0034('0x61')]=_0x100757['id'];if(_0x512fab[_0x0034('0x39')][_0x0034('0x43')]){_0x432b3e['where']=_[_0x0034('0x44')](_0x432b3e[_0x0034('0x45')],{'$or':_[_0x0034('0x38')](_0x432b3e[_0x0034('0x3d')],function(_0x26715b){var _0x1279c4={};_0x1279c4[_0x26715b]={'$like':'%'+_0x512fab[_0x0034('0x39')]['filter']+'%'};return _0x1279c4;})});}_0x432b3e=_['merge']({},_0x432b3e,_0x512fab[_0x0034('0x47')]);return db['ChatInteraction']['count']({'where':_0x432b3e['where']})[_0x0034('0x16')](function(_0x255df2){_0x18c4bf[_0x0034('0x28')]=_0x255df2;if(_0x512fab['query'][_0x0034('0x48')]){_0x432b3e[_0x0034('0x4d')]=[{'model':db[_0x0034('0x81')],'as':_0x0034('0xe8'),'required':![]},{'model':db[_0x0034('0xe9')],'as':'Owner','attributes':[_0x0034('0x2f'),_0x0034('0xea'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x0034('0xeb'),'attributes':['id',_0x0034('0x2f'),'color'],'where':_0x512fab[_0x0034('0x39')]['tag']?{'id':_0x512fab[_0x0034('0x39')][_0x0034('0xec')]}:undefined,'required':_0x512fab[_0x0034('0x39')][_0x0034('0xec')]?!![]:![]}];}return db['ChatInteraction'][_0x0034('0x5e')](_0x432b3e);})[_0x0034('0x16')](function(_0x301860){_0x18c4bf[_0x0034('0x49')]=_0x301860;return _0x18c4bf;});}})[_0x0034('0x16')](respondWithFilteredResult(_0x44aaf6,_0x432b3e))['catch'](handleError(_0x44aaf6,null));};function iftimePromise(_0x2c63ea,_0x44b6ea){return respondWithRpcPromise(_0x0034('0xed'),_0x0034('0xee'),{'command':_0x44b6ea[_0x0034('0xef')]?util['format']('iftime\x20%s,%s',_0x2c63ea[_0x0034('0xf0')],_0x44b6ea['timezone']):util[_0x0034('0xa4')](_0x0034('0xf1'),_0x2c63ea[_0x0034('0xf0')])},client9002)['then'](function(_0x455c3c){var _0x1c0a04=_0x455c3c&&_0x455c3c['indexOf'](_0x0034('0xf2'))>=0x0?!![]:![];logger[_0x0034('0x17')](_0x0034('0xf3'),_0x44b6ea['id'],_0x2c63ea['id'],_0x2c63ea[_0x0034('0xf0')],_0x1c0a04?_0x0034('0xf4'):_0x0034('0xf5'),_0x44b6ea['timezone']?_0x44b6ea['timezone']:_0x0034('0xf6'));return _0x1c0a04;})['catch'](function(_0x15fb0c){logger[_0x0034('0x1c')](_0x0034('0xf3'),_0x44b6ea['id'],_0x2c63ea['id'],_0x2c63ea['interval'],util[_0x0034('0xf7')](_0x15fb0c,{'showHidden':![],'depth':null}),_0x44b6ea['timezone']?_0x44b6ea[_0x0034('0xef')]:_0x0034('0xf6'));return![];});}exports[_0x0034('0xee')]=function(_0x4972ce,_0x32cc8d){var _0x37a299=0x0;var _0x28a5dd=0x0;var _0x769dda=![];var _0x441ec9;var _0x1f660e;return db[_0x0034('0x32')]['find']({'where':{'id':_0x4972ce[_0x0034('0x4b')]['id']},'include':[{'model':db[_0x0034('0xf8')],'as':_0x0034('0xf8'),'include':[{'model':db['Interval'],'as':_0x0034('0xf9'),'attributes':['id',_0x0034('0xf0')],'raw':!![]}]}]})[_0x0034('0x16')](handleEntityNotFound(_0x32cc8d,null))[_0x0034('0x16')](function(_0x283ccc){if(_0x283ccc){_0x441ec9=_0x283ccc;return _0x283ccc['getProactiveActions']({'raw':!![]});}})[_0x0034('0x16')](function(_0xcf2ea6){if(_0x441ec9){if(_0xcf2ea6){_0x1f660e=_0xcf2ea6;}}return require(_0x0034('0x71'))[_0x0034('0xfa')]();})[_0x0034('0x16')](function(_0xa441f5){if(_0xa441f5){_0x28a5dd=_0xa441f5[_0x0034('0xfb')];_0x769dda=_0xa441f5[_0x0034('0xfc')];}})[_0x0034('0x16')](function(){return db['ChatInteraction'][_0x0034('0x28')]({'where':{'closed':![]}});})[_0x0034('0x16')](function(_0x54ee78){_0x37a299=_0x54ee78;if(_0x28a5dd&&_0x54ee78>_0x28a5dd){return db[_0x0034('0xfd')][_0x0034('0x5b')]({'where':{'id':0x1}})[_0x0034('0x16')](function(_0x75de71){if(_0x75de71){_0x75de71['increment'](_0x0034('0xfe'));}});}})[_0x0034('0x16')](function(){if(_0x441ec9[_0x0034('0xf8')]&&_0x441ec9[_0x0034('0xf8')]['Intervals']){var _0x17969d=[];for(var _0xf3a830=0x0;_0xf3a830<_0x441ec9[_0x0034('0xf8')][_0x0034('0xf9')]['length'];_0xf3a830++){var _0x143f42=_0x441ec9['Interval'][_0x0034('0xf9')][_0xf3a830][_0x0034('0x2b')]({'plain':!![]});_0x17969d[_0x0034('0xb1')](iftimePromise(_0x143f42,_0x441ec9));}return BPromise[_0x0034('0xff')](_0x17969d)[_0x0034('0x16')](function(_0x14c9f0){return _[_0x0034('0x100')](_0x14c9f0);});}else{return!![];}})['then'](function(_0x871a01){var _0xb00951=fs[_0x0034('0x101')](path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x102')),_0x0034('0xc7'));var _0x9d58c4=new url[(_0x0034('0x103'))](_0x441ec9['address'])['origin'];var _0x43d1ee=_0x0034('0x104');var _0x11afcf=![];var _0x2b630d={'chatVersion':_0x43d1ee,'chatWebsiteAddressOrigin':_0x9d58c4,'remote':_0x441ec9[_0x0034('0x105')],'query':querystring[_0x0034('0x1b')](_[_0x0034('0x44')](_0x441ec9[_0x0034('0x2b')]({'plain':!![]}),{'customerIp':_0x4972ce[_0x0034('0x7f')][_0x0034('0x9e')]||_0x4972ce[_0x0034('0x7f')][_0x0034('0x106')]||_0x4972ce[_0x0034('0x107')][_0x0034('0x108')]||_0x4972ce['ip'],'referer':_0x4972ce['headers'][_0x0034('0x109')],'openedInteractions':_0x37a299,'maxInteractions':_0x28a5dd,'virtual':_0x769dda['virtual'],'online':_0x871a01,'custom':_0x769dda}))[_0x0034('0x10a')](/'/g,'\x5c\x27')};_0x32cc8d[_0x0034('0xbf')](ejs[_0x0034('0xc8')](Mustache[_0x0034('0xc8')](_0xb00951,_0x2b630d),{'proactiveActions':_0x1f660e,'alignment':_0x441ec9[_0x0034('0x10b')],'verticalAlignment':_0x441ec9[_0x0034('0x10c')],'div_color':_0x441ec9['color'],'labelText':_0x441ec9['labelText'],'text_color':_0x441ec9[_0x0034('0x10d')],'text_button_color':_0x441ec9['textButtonColor'],'button_color':_0x441ec9[_0x0034('0x10e')],'background_color':_0x441ec9[_0x0034('0x10f')],'hideWhenOffline':_0x441ec9['hideWhenOffline'],'intervalId':_0x441ec9['IntervalId'],'isDevelopment':_0x11afcf,'chatVersion':_0x43d1ee}));})[_0x0034('0x20')](handleError(_0x32cc8d,null));};exports[_0x0034('0x110')]=function(_0x4e191d,_0x49c424){var _0x12cdd9=_0x4e191d[_0x0034('0x4b')]['id'];var _0x33e8a5=_0x4e191d[_0x0034('0x50')];var _0x536533=0xc8;var _0x2ce73c=null;return db[_0x0034('0xd1')]['transaction']({'isolationLevel':db[_0x0034('0xd1')]['Transaction'][_0x0034('0x111')][_0x0034('0x112')]},function(_0x49e408){return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0x12cdd9},'transaction':_0x49e408})[_0x0034('0x16')](function(_0x5077d0){if(_0x5077d0){return db['ChatApplication'][_0x0034('0x2a')]({'where':{'ChatWebsiteId':_0x12cdd9},'transaction':_0x49e408})['then'](function(){var _0x3af708=_[_0x0034('0x38')](_0x33e8a5,function(_0x184ca3){_0x184ca3[_0x0034('0x61')]=_0x12cdd9;return _0x184ca3;});return db[_0x0034('0x93')][_0x0034('0xd3')](_0x3af708,{'transaction':_0x49e408});});}else{_0x536533=0x194;_0x2ce73c=[];}});})['then'](function(){if(_0x536533!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x12cdd9},'order':_0x0034('0x99')})['then'](function(_0x280a73){_0x2ce73c=_0x280a73;});}})[_0x0034('0x20')](function(_0x28e423){_0x536533=0x1f4;logger['error'](_0x28e423[_0x0034('0x2e')]);if(_0x28e423[_0x0034('0x2f')]){delete _0x28e423[_0x0034('0x2f')];}_0x2ce73c=_0x28e423;})[_0x0034('0x113')](function(){if(_0x2ce73c===null){_0x49c424[_0x0034('0x21')](_0x536533);}else{if(_0x536533===0x1f4){_0x49c424['status'](_0x536533)['send'](_0x2ce73c);}else{_0x49c424[_0x0034('0x22')](_0x536533)['json'](_0x2ce73c);}}});};exports['getApplications']=function(_0x2acf2a,_0x182f48){var _0x27e7c7={};var _0x502e54={};var _0x477eab;var _0x710b77;return db['ChatWebsite'][_0x0034('0x5b')]({'where':{'id':_0x2acf2a[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x182f48,null))['then'](function(_0x214a16){if(_0x214a16){_0x477eab=_0x214a16;_0x502e54['model']=_[_0x0034('0x3a')](db[_0x0034('0x93')]['rawAttributes']);_0x502e54['query']=_[_0x0034('0x3a')](_0x2acf2a[_0x0034('0x39')]);_0x502e54[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x502e54['model'],_0x502e54[_0x0034('0x39')]);_0x27e7c7[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x502e54[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x2acf2a[_0x0034('0x39')]['fields']));_0x27e7c7[_0x0034('0x3d')]=_0x27e7c7['attributes'][_0x0034('0x3f')]?_0x27e7c7[_0x0034('0x3d')]:_0x502e54[_0x0034('0x37')];_0x27e7c7[_0x0034('0x5c')]=qs[_0x0034('0x42')](_0x2acf2a[_0x0034('0x39')][_0x0034('0x42')]);_0x27e7c7[_0x0034('0x45')]=qs[_0x0034('0x3b')](_['pick'](_0x2acf2a['query'],_0x502e54[_0x0034('0x3b')]));if(_0x2acf2a[_0x0034('0x39')][_0x0034('0x43')]){_0x27e7c7['where']=_[_0x0034('0x44')](_0x27e7c7['where'],{'$or':_[_0x0034('0x38')](_0x27e7c7[_0x0034('0x3d')],function(_0x44f562){var _0x5ecb0f={};_0x5ecb0f[_0x44f562]={'$like':'%'+_0x2acf2a['query'][_0x0034('0x43')]+'%'};return _0x5ecb0f;})});}_0x27e7c7=_[_0x0034('0x44')]({},_0x27e7c7,_0x2acf2a[_0x0034('0x47')]);return _0x477eab[_0x0034('0x114')](_0x27e7c7);}})['then'](function(_0x514ede){if(_0x514ede){_0x710b77=_0x514ede[_0x0034('0x3f')];if(!_0x2acf2a[_0x0034('0x39')][_0x0034('0x40')]('nolimit')){_0x27e7c7[_0x0034('0x27')]=qs['limit'](_0x2acf2a[_0x0034('0x39')]['limit']);_0x27e7c7[_0x0034('0x25')]=qs[_0x0034('0x25')](_0x2acf2a['query'][_0x0034('0x25')]);}return _0x477eab['getApplications'](_0x27e7c7);}})[_0x0034('0x16')](function(_0x45eac2){if(_0x45eac2){return _0x45eac2?{'count':_0x710b77,'rows':_0x45eac2}:null;}})['then'](respondWithResult(_0x182f48,null))[_0x0034('0x20')](handleError(_0x182f48,null));};exports[_0x0034('0x115')]=function(_0x493095,_0x3c8a9f){return db['chatProactiveAction']['find']({'where':{'id':_0x493095['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x3c8a9f,null))[_0x0034('0x16')](function(_0x56bec3){if(_0x56bec3){return _0x56bec3[_0x0034('0x115')](_0x493095[_0x0034('0x50')][_0x0034('0x65')],_[_0x0034('0x116')](_0x493095[_0x0034('0x50')],['ids','id'])||{});}})[_0x0034('0x16')](respondWithResult(_0x3c8a9f,null))['catch'](handleError(_0x3c8a9f,null));};exports[_0x0034('0x117')]=function(_0xc6806e,_0x366894){var _0x1d8b4a={};var _0x42eab6={};var _0x194f94;var _0x3d1214;return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0xc6806e[_0x0034('0x4b')]['id']}})['then'](handleEntityNotFound(_0x366894,null))[_0x0034('0x16')](function(_0x31947f){if(_0x31947f){_0x194f94=_0x31947f;_0x42eab6[_0x0034('0x37')]=_[_0x0034('0x3a')](db[_0x0034('0x118')][_0x0034('0x33')]);_0x42eab6[_0x0034('0x39')]=_[_0x0034('0x3a')](_0xc6806e['query']);_0x42eab6[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x42eab6[_0x0034('0x37')],_0x42eab6['query']);_0x1d8b4a[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x42eab6[_0x0034('0x37')],qs[_0x0034('0x3e')](_0xc6806e[_0x0034('0x39')][_0x0034('0x3e')]));_0x1d8b4a[_0x0034('0x3d')]=_0x1d8b4a[_0x0034('0x3d')]['length']?_0x1d8b4a[_0x0034('0x3d')]:_0x42eab6['model'];_0x1d8b4a[_0x0034('0x5c')]=qs['sort'](_0xc6806e[_0x0034('0x39')][_0x0034('0x42')]);_0x1d8b4a[_0x0034('0x45')]=qs['filters'](_['pick'](_0xc6806e[_0x0034('0x39')],_0x42eab6[_0x0034('0x3b')]));if(_0xc6806e[_0x0034('0x39')][_0x0034('0x43')]){_0x1d8b4a[_0x0034('0x45')]=_['merge'](_0x1d8b4a['where'],{'$or':_[_0x0034('0x38')](_0x1d8b4a[_0x0034('0x3d')],function(_0x3cce3d){var _0x374c27={};_0x374c27[_0x3cce3d]={'$like':'%'+_0xc6806e['query'][_0x0034('0x43')]+'%'};return _0x374c27;})});}_0x1d8b4a=_[_0x0034('0x44')]({},_0x1d8b4a,_0xc6806e['options']);return _0x194f94[_0x0034('0x117')](_0x1d8b4a);}})[_0x0034('0x16')](function(_0x10e459){if(_0x10e459){_0x3d1214=_0x10e459[_0x0034('0x3f')];if(!_0xc6806e[_0x0034('0x39')]['hasOwnProperty'](_0x0034('0x41'))){_0x1d8b4a['limit']=qs[_0x0034('0x27')](_0xc6806e['query'][_0x0034('0x27')]);_0x1d8b4a[_0x0034('0x25')]=qs[_0x0034('0x25')](_0xc6806e[_0x0034('0x39')][_0x0034('0x25')]);}return _0x194f94[_0x0034('0x117')](_0x1d8b4a);}})[_0x0034('0x16')](function(_0x5cd42){if(_0x5cd42){return _0x5cd42?{'count':_0x3d1214,'rows':_0x5cd42}:null;}})[_0x0034('0x16')](respondWithResult(_0x366894,null))['catch'](handleError(_0x366894,null));};exports['getFields']=function(_0x1bae2c,_0x5f135f){var _0x532073=_0x1bae2c[_0x0034('0x39')][_0x0034('0x119')]===_0x0034('0x11a')?_0x0034('0x11b'):'onlineForm';return db[_0x0034('0x32')][_0x0034('0x4e')]({'attributes':['id',_0x532073],'where':{'id':_0x1bae2c['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x5f135f,null))[_0x0034('0x16')](function(_0x456011){if(_0x456011){var _0x4e4573=_0x456011[_0x532073];var _0x9cf77=_0x4e4573&&_0x4e4573[_0x0034('0x11c')]?_0x4e4573[_0x0034('0x11c')]:[];_0x5f135f['send']({'fromKey':_['isNil'](_0x4e4573['fromKey'])?undefined:_0x4e4573[_0x0034('0x11d')],'count':_0x9cf77[_0x0034('0x3f')],'rows':_0x9cf77});}})['catch'](handleError(_0x5f135f,null));};exports['getOfflineMessages']=function(_0x25b3da,_0x189b36){var _0x27e2e9={'raw':![],'where':{}};var _0x537285={};var _0x3fd1bf={'count':0x0,'rows':[]};return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0x25b3da[_0x0034('0x4b')]['id']}})['then'](handleEntityNotFound(_0x189b36,null))[_0x0034('0x16')](function(_0xa10e28){if(_0xa10e28){_0x537285[_0x0034('0x37')]=_[_0x0034('0x3a')](db[_0x0034('0xca')]['rawAttributes']);_0x537285['query']=_[_0x0034('0x3a')](_0x25b3da['query']);_0x537285[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x537285[_0x0034('0x37')],_0x537285[_0x0034('0x39')]);_0x27e2e9[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x537285[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x25b3da['query'][_0x0034('0x3e')]));_0x27e2e9[_0x0034('0x3d')]=_0x27e2e9[_0x0034('0x3d')][_0x0034('0x3f')]?_0x27e2e9[_0x0034('0x3d')]:_0x537285[_0x0034('0x37')];if(!_0x25b3da[_0x0034('0x39')][_0x0034('0x40')](_0x0034('0x41'))){_0x27e2e9[_0x0034('0x27')]=qs['limit'](_0x25b3da[_0x0034('0x39')][_0x0034('0x27')]);_0x27e2e9[_0x0034('0x25')]=qs[_0x0034('0x25')](_0x25b3da['query'][_0x0034('0x25')]);}_0x27e2e9[_0x0034('0x5c')]=qs[_0x0034('0x42')](_0x25b3da[_0x0034('0x39')]['sort']);_0x27e2e9['where']=qs[_0x0034('0x3b')](_[_0x0034('0x5d')](_0x25b3da[_0x0034('0x39')],_0x537285[_0x0034('0x3b')]));_0x27e2e9[_0x0034('0x45')]['ChatWebsiteId']=_0xa10e28['id'];if(_0x25b3da[_0x0034('0x39')][_0x0034('0x43')]){_0x27e2e9['where']=_[_0x0034('0x44')](_0x27e2e9[_0x0034('0x45')],{'$or':_[_0x0034('0x38')](_0x27e2e9['attributes'],function(_0x2ed6d9){var _0x308f56={};_0x308f56[_0x2ed6d9]={'$like':'%'+_0x25b3da[_0x0034('0x39')][_0x0034('0x43')]+'%'};return _0x308f56;})});}_0x27e2e9=_[_0x0034('0x44')]({},_0x27e2e9,_0x25b3da['options']);return db[_0x0034('0xca')][_0x0034('0x28')]({'where':_0x27e2e9[_0x0034('0x45')]})[_0x0034('0x16')](function(_0xa55687){_0x3fd1bf[_0x0034('0x28')]=_0xa55687;if(_0x25b3da[_0x0034('0x39')][_0x0034('0x48')]){_0x27e2e9[_0x0034('0x4d')]=[{'all':!![]}];}else{_0x27e2e9[_0x0034('0x4d')]=[{'model':db[_0x0034('0x81')],'as':_0x0034('0xe8'),'required':![]},{'model':db[_0x0034('0xd2')],'as':_0x0034('0x11e'),'required':![]}];}return db[_0x0034('0xca')]['findAll'](_0x27e2e9);})[_0x0034('0x16')](function(_0x40fae9){_0x3fd1bf[_0x0034('0x49')]=_0x40fae9;return _0x3fd1bf;});}})[_0x0034('0x16')](respondWithFilteredResult(_0x189b36,_0x27e2e9))['catch'](handleError(_0x189b36,null));};exports[_0x0034('0x11f')]=function(_0x3ed9fc,_0x5109b1){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x3ed9fc[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x5109b1,null))[_0x0034('0x16')](function(_0x5309b3){if(_0x5309b3){return _0x5309b3['addAgents'](_0x3ed9fc['body']['ids'],_[_0x0034('0x116')](_0x3ed9fc[_0x0034('0x50')],[_0x0034('0x65'),'id'])||{})[_0x0034('0xc5')](function(_0x5ea2b2){for(var _0x22ecf5=0x0;_0x22ecf5<_0x3ed9fc[_0x0034('0x50')][_0x0034('0x65')]['length'];_0x22ecf5+=0x1){socket[_0x0034('0x120')](_0x0034('0x121'),{'UserId':Number(_0x3ed9fc[_0x0034('0x50')][_0x0034('0x65')][_0x22ecf5]),'ChatWebsiteId':Number(_0x3ed9fc['params']['id'])});}return _0x5ea2b2;});}})[_0x0034('0x16')](respondWithResult(_0x5109b1,null))['catch'](handleError(_0x5109b1,null));};exports[_0x0034('0x122')]=function(_0x177b53,_0x4da5d4){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x177b53['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x4da5d4,null))[_0x0034('0x16')](function(_0x45bfe0){if(_0x45bfe0){return _0x45bfe0[_0x0034('0x122')](_0x177b53['query']['ids'])[_0x0034('0x16')](function(){if(_[_0x0034('0x123')](_0x177b53[_0x0034('0x39')][_0x0034('0x65')])){for(var _0x261c99=0x0;_0x261c99<_0x177b53[_0x0034('0x39')][_0x0034('0x65')][_0x0034('0x3f')];_0x261c99+=0x1){socket[_0x0034('0x120')](_0x0034('0x124'),{'UserId':Number(_0x177b53[_0x0034('0x39')][_0x0034('0x65')][_0x261c99]),'ChatWebsiteId':Number(_0x177b53[_0x0034('0x4b')]['id'])});}}else{socket[_0x0034('0x120')]('userChatWebsite:remove',{'UserId':Number(_0x177b53['query'][_0x0034('0x65')]),'ChatWebsiteId':Number(_0x177b53[_0x0034('0x4b')]['id'])});}});}})[_0x0034('0x16')](respondWithStatusCode(_0x4da5d4,null))[_0x0034('0x20')](handleError(_0x4da5d4,null));};exports[_0x0034('0x125')]=function(_0x3773f9,_0x4fcfc2){var _0x1e695d={};var _0x64d869={};var _0x6798e8;var _0x1110ec;return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0x3773f9[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x4fcfc2,null))[_0x0034('0x16')](function(_0x167860){if(_0x167860){_0x6798e8=_0x167860;_0x64d869[_0x0034('0x37')]=_[_0x0034('0x3a')](db[_0x0034('0xe9')][_0x0034('0x33')]);_0x64d869[_0x0034('0x39')]=_[_0x0034('0x3a')](_0x3773f9[_0x0034('0x39')]);_0x64d869[_0x0034('0x3b')]=_['intersection'](_0x64d869['model'],_0x64d869[_0x0034('0x39')]);_0x1e695d[_0x0034('0x3d')]=_['intersection'](_0x64d869[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x3773f9['query'][_0x0034('0x3e')]));_0x1e695d[_0x0034('0x3d')]=_0x1e695d['attributes']['length']?_0x1e695d[_0x0034('0x3d')]:_0x64d869[_0x0034('0x37')];_0x1e695d[_0x0034('0x5c')]=qs[_0x0034('0x42')](_0x3773f9[_0x0034('0x39')][_0x0034('0x42')]);_0x1e695d[_0x0034('0x45')]=qs[_0x0034('0x3b')](_[_0x0034('0x5d')](_0x3773f9[_0x0034('0x39')],_0x64d869['filters']));if(_0x3773f9[_0x0034('0x39')]['filter']){_0x1e695d[_0x0034('0x45')]=_[_0x0034('0x44')](_0x1e695d['where'],{'$or':_[_0x0034('0x38')](_0x1e695d[_0x0034('0x3d')],function(_0x51e4c4){var _0x5e8bcb={};_0x5e8bcb[_0x51e4c4]={'$like':'%'+_0x3773f9[_0x0034('0x39')]['filter']+'%'};return _0x5e8bcb;})});}_0x1e695d=_[_0x0034('0x44')]({},_0x1e695d,_0x3773f9[_0x0034('0x47')]);return _0x6798e8[_0x0034('0x125')](_0x1e695d);}})[_0x0034('0x16')](function(_0xb60b3b){if(_0xb60b3b){_0x1110ec=_0xb60b3b[_0x0034('0x3f')];if(!_0x3773f9[_0x0034('0x39')]['hasOwnProperty'](_0x0034('0x41'))){_0x1e695d['limit']=qs['limit'](_0x3773f9[_0x0034('0x39')][_0x0034('0x27')]);_0x1e695d['offset']=qs['offset'](_0x3773f9[_0x0034('0x39')][_0x0034('0x25')]);}return _0x6798e8[_0x0034('0x125')](_0x1e695d);}})[_0x0034('0x16')](function(_0x56b924){if(_0x56b924){return _0x56b924?{'count':_0x1110ec,'rows':_0x56b924}:null;}})[_0x0034('0x16')](respondWithResult(_0x4fcfc2,null))['catch'](handleError(_0x4fcfc2,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 5730257..bd0da45 100644 --- a/server/api/chatWebsite/chatWebsite.events.js +++ b/server/api/chatWebsite/chatWebsite.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5243=['setMaxListeners','save','emit','hook','exports','events'];(function(_0x5de15b,_0xae0f09){var _0x54b3e0=function(_0x491903){while(--_0x491903){_0x5de15b['push'](_0x5de15b['shift']());}};_0x54b3e0(++_0xae0f09);}(_0x5243,0x71));var _0x3524=function(_0x251b79,_0x3bdf2d){_0x251b79=_0x251b79-0x0;var _0x3da799=_0x5243[_0x251b79];return _0x3da799;};'use strict';var EventEmitter=require(_0x3524('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3524('0x1')](0x0);var events={'afterCreate':_0x3524('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xb74439){return function(_0x34bba7,_0x4855ea,_0x451e4d){ChatWebsiteEvents['emit'](_0xb74439+':'+_0x34bba7['id'],_0x34bba7);ChatWebsiteEvents[_0x3524('0x3')](_0xb74439,_0x34bba7);_0x451e4d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x3524('0x4')](e,emitEvent(event));}}module[_0x3524('0x5')]=ChatWebsiteEvents; \ No newline at end of file +var _0xdb13=['setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb','ChatWebsite'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdb13,0x10c));var _0x3db1=function(_0x52dc4b,_0x1166ae){_0x52dc4b=_0x52dc4b-0x0;var _0x2b83e3=_0xdb13[_0x52dc4b];return _0x2b83e3;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x3db1('0x0'))['db'][_0x3db1('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3db1('0x2')](0x0);var events={'afterCreate':_0x3db1('0x3'),'afterUpdate':_0x3db1('0x4'),'afterDestroy':_0x3db1('0x5')};function emitEvent(_0x581a73){return function(_0x3352e3,_0x41fb5d,_0x1c1495){ChatWebsiteEvents[_0x3db1('0x6')](_0x581a73+':'+_0x3352e3['id'],_0x3352e3);ChatWebsiteEvents[_0x3db1('0x6')](_0x581a73,_0x3352e3);_0x1c1495(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x3db1('0x7')](e,emitEvent(event));}}module[_0x3db1('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index cc742c5..be3469a 100644 --- a/server/api/chatWebsite/chatWebsite.model.js +++ b/server/api/chatWebsite/chatWebsite.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfea3=['moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger'];(function(_0x4831f0,_0x818669){var _0x59d9b7=function(_0x116e1f){while(--_0x116e1f){_0x4831f0['push'](_0x4831f0['shift']());}};_0x59d9b7(++_0x818669);}(_0xfea3,0xa6));var _0x3fea=function(_0x23d81e,_0x4f42d7){_0x23d81e=_0x23d81e-0x0;var _0x20e768=_0xfea3[_0x23d81e];return _0x20e768;};'use strict';var _=require(_0x3fea('0x0'));var util=require('util');var logger=require(_0x3fea('0x1'))('api');var moment=require(_0x3fea('0x2'));var BPromise=require(_0x3fea('0x3'));var rp=require(_0x3fea('0x4'));var fs=require('fs');var path=require(_0x3fea('0x5'));var rimraf=require(_0x3fea('0x6'));var config=require('../../config/environment');var attributes=require(_0x3fea('0x7'));module[_0x3fea('0x8')]=function(_0x6c9114,_0x52707c){return _0x6c9114[_0x3fea('0x9')](_0x3fea('0xa'),attributes,{'tableName':_0x3fea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef14=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','moment','request-promise','path'];(function(_0x44b7bb,_0x460592){var _0x370e81=function(_0x1c5d02){while(--_0x1c5d02){_0x44b7bb['push'](_0x44b7bb['shift']());}};_0x370e81(++_0x460592);}(_0xef14,0x13f));var _0x4ef1=function(_0x892b46,_0x16538e){_0x892b46=_0x892b46-0x0;var _0x4a7633=_0xef14[_0x892b46];return _0x4a7633;};'use strict';var _=require('lodash');var util=require(_0x4ef1('0x0'));var logger=require(_0x4ef1('0x1'))('api');var moment=require(_0x4ef1('0x2'));var BPromise=require('bluebird');var rp=require(_0x4ef1('0x3'));var fs=require('fs');var path=require(_0x4ef1('0x4'));var rimraf=require(_0x4ef1('0x5'));var config=require(_0x4ef1('0x6'));var attributes=require(_0x4ef1('0x7'));module[_0x4ef1('0x8')]=function(_0x5986ac,_0x17fae1){return _0x5986ac[_0x4ef1('0x9')](_0x4ef1('0xa'),attributes,{'tableName':_0x4ef1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index dd4108b..36462f6 100644 --- a/server/api/chatWebsite/chatWebsite.rpc.js +++ b/server/api/chatWebsite/chatWebsite.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefc8=['http','redis','localhost','./chatWebsite.socket','register','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x363cc0,_0x2c438b){var _0x4c5cd5=function(_0x247a9a){while(--_0x247a9a){_0x363cc0['push'](_0x363cc0['shift']());}};_0x4c5cd5(++_0x2c438b);}(_0xefc8,0xf1));var _0x8efc=function(_0x2cdfd6,_0x168798){_0x2cdfd6=_0x2cdfd6-0x0;var _0x5d14d2=_0xefc8[_0x2cdfd6];return _0x5d14d2;};'use strict';var _=require(_0x8efc('0x0'));var util=require('util');var moment=require(_0x8efc('0x1'));var BPromise=require('bluebird');var rs=require(_0x8efc('0x2'));var fs=require('fs');var Redis=require(_0x8efc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8efc('0x4'));var logger=require('../../config/logger')(_0x8efc('0x5'));var config=require(_0x8efc('0x6'));var jayson=require(_0x8efc('0x7'));var client=jayson[_0x8efc('0x8')][_0x8efc('0x9')]({'port':0x232a});config[_0x8efc('0xa')]=_['defaults'](config[_0x8efc('0xa')],{'host':_0x8efc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8efc('0xa')]));require(_0x8efc('0xc'))[_0x8efc('0xd')](socket);function respondWithRpcPromise(_0x1d3200,_0xcf6e4c,_0x40fcfa){return new BPromise(function(_0x128a52,_0x3d9197){return client['request'](_0x1d3200,_0x40fcfa)[_0x8efc('0xe')](function(_0x39bf93){logger[_0x8efc('0xf')]('ChatWebsite,\x20%s,\x20%s',_0xcf6e4c,_0x8efc('0x10'));logger['debug'](_0x8efc('0x11'),_0xcf6e4c,_0x8efc('0x10'),JSON[_0x8efc('0x12')](_0x39bf93));if(_0x39bf93['error']){if(_0x39bf93['error'][_0x8efc('0x13')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xcf6e4c,_0x39bf93[_0x8efc('0x14')][_0x8efc('0x15')]);return _0x3d9197(_0x39bf93['error'][_0x8efc('0x15')]);}logger[_0x8efc('0x14')]('ChatWebsite,\x20%s,\x20%s',_0xcf6e4c,_0x39bf93[_0x8efc('0x14')][_0x8efc('0x15')]);return _0x128a52(_0x39bf93['error'][_0x8efc('0x15')]);}else{logger[_0x8efc('0xf')](_0x8efc('0x16'),_0xcf6e4c,'request\x20sent');_0x128a52(_0x39bf93[_0x8efc('0x17')]['message']);}})[_0x8efc('0x18')](function(_0x4b76f4){logger[_0x8efc('0x14')](_0x8efc('0x16'),_0xcf6e4c,_0x4b76f4);_0x3d9197(_0x4b76f4);});});} \ No newline at end of file +var _0xb7e4=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','info','request\x20sent','debug','error','code','message','result'];(function(_0x3f0dbd,_0x1887e6){var _0xd6e757=function(_0x112413){while(--_0x112413){_0x3f0dbd['push'](_0x3f0dbd['shift']());}};_0xd6e757(++_0x1887e6);}(_0xb7e4,0xd9));var _0x4b7e=function(_0x5e33f0,_0x2d835f){_0x5e33f0=_0x5e33f0-0x0;var _0x40ca04=_0xb7e4[_0x5e33f0];return _0x40ca04;};'use strict';var _=require(_0x4b7e('0x0'));var util=require(_0x4b7e('0x1'));var moment=require(_0x4b7e('0x2'));var BPromise=require(_0x4b7e('0x3'));var rs=require(_0x4b7e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b7e('0x5'))['db'];var utils=require(_0x4b7e('0x6'));var logger=require(_0x4b7e('0x7'))(_0x4b7e('0x8'));var config=require(_0x4b7e('0x9'));var jayson=require(_0x4b7e('0xa'));var client=jayson[_0x4b7e('0xb')][_0x4b7e('0xc')]({'port':0x232a});config[_0x4b7e('0xd')]=_[_0x4b7e('0xe')](config[_0x4b7e('0xd')],{'host':_0x4b7e('0xf'),'port':0x18eb});var socket=require(_0x4b7e('0x10'))(new Redis(config['redis']));require(_0x4b7e('0x11'))['register'](socket);function respondWithRpcPromise(_0x534461,_0x40eb18,_0x2894b4){return new BPromise(function(_0x4709f9,_0x22c525){return client[_0x4b7e('0x12')](_0x534461,_0x2894b4)['then'](function(_0x3acbdb){logger[_0x4b7e('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x40eb18,_0x4b7e('0x14'));logger[_0x4b7e('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x40eb18,'request\x20sent',JSON['stringify'](_0x3acbdb));if(_0x3acbdb[_0x4b7e('0x16')]){if(_0x3acbdb[_0x4b7e('0x16')][_0x4b7e('0x17')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x40eb18,_0x3acbdb[_0x4b7e('0x16')]['message']);return _0x22c525(_0x3acbdb[_0x4b7e('0x16')][_0x4b7e('0x18')]);}logger[_0x4b7e('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x40eb18,_0x3acbdb[_0x4b7e('0x16')][_0x4b7e('0x18')]);return _0x4709f9(_0x3acbdb[_0x4b7e('0x16')][_0x4b7e('0x18')]);}else{logger[_0x4b7e('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x40eb18,_0x4b7e('0x14'));_0x4709f9(_0x3acbdb[_0x4b7e('0x19')]['message']);}})[_0x4b7e('0x1a')](function(_0x5dd8b4){logger[_0x4b7e('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x40eb18,_0x5dd8b4);_0x22c525(_0x5dd8b4);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index c39cf93..321237c 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x818e=['register','length','chatWebsite:','save','remove','update','emit','removeListener'];(function(_0xd3348b,_0x288d47){var _0x583cdc=function(_0x743e06){while(--_0x743e06){_0xd3348b['push'](_0xd3348b['shift']());}};_0x583cdc(++_0x288d47);}(_0x818e,0x1e3));var _0xe818=function(_0x3013ae,_0x49837f){_0x3013ae=_0x3013ae-0x0;var _0x4bc194=_0x818e[_0x3013ae];return _0x4bc194;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xe818('0x0'),_0xe818('0x1'),_0xe818('0x2')];function createListener(_0xcbbbef,_0x186646){return function(_0x50145e){_0x186646[_0xe818('0x3')](_0xcbbbef,_0x50145e);};}function removeListener(_0x1ab2d6,_0x2bce8b){return function(){ChatWebsiteEvents[_0xe818('0x4')](_0x1ab2d6,_0x2bce8b);};}exports[_0xe818('0x5')]=function(_0x2a692c){for(var _0x412461=0x0,_0x51acf3=events[_0xe818('0x6')];_0x412461<_0x51acf3;_0x412461++){var _0xd775b6=events[_0x412461];var _0x1c6a65=createListener(_0xe818('0x7')+_0xd775b6,_0x2a692c);ChatWebsiteEvents['on'](_0xd775b6,_0x1c6a65);}}; \ No newline at end of file +var _0x9d4d=['register','chatWebsite:','remove','update'];(function(_0x41da30,_0x650d80){var _0xe46cef=function(_0x5eabd7){while(--_0x5eabd7){_0x41da30['push'](_0x41da30['shift']());}};_0xe46cef(++_0x650d80);}(_0x9d4d,0x1e6));var _0xd9d4=function(_0x1a467c,_0x2c05ad){_0x1a467c=_0x1a467c-0x0;var _0x21c1eb=_0x9d4d[_0x1a467c];return _0x21c1eb;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xd9d4('0x0'),_0xd9d4('0x1')];function createListener(_0xd437c7,_0x36484d){return function(_0x1fbfb4){_0x36484d['emit'](_0xd437c7,_0x1fbfb4);};}function removeListener(_0x3ca428,_0x4e68f2){return function(){ChatWebsiteEvents['removeListener'](_0x3ca428,_0x4e68f2);};}exports[_0xd9d4('0x2')]=function(_0x39fc60){for(var _0x32b918=0x0,_0x19c0ce=events['length'];_0x32b918<_0x19c0ce;_0x32b918++){var _0x4aa40e=events[_0x32b918];var _0xdcee32=createListener(_0xd9d4('0x3')+_0x4aa40e,_0x39fc60);ChatWebsiteEvents['on'](_0x4aa40e,_0xdcee32);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 2b57447..eaa76b0 100644 --- a/server/api/chatWebsite/index.js +++ b/server/api/chatWebsite/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafe0=['get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','diskStorage','root','server/files/images/logos/','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','join','format','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','/:id','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller'];(function(_0x2d0203,_0x5f408a){var _0x5a1b02=function(_0x156422){while(--_0x156422){_0x2d0203['push'](_0x2d0203['shift']());}};_0x5a1b02(++_0x5f408a);}(_0xafe0,0xc9));var _0x0afe=function(_0x2484c6,_0x17dbbd){_0x2484c6=_0x2484c6-0x0;var _0x3d09a6=_0xafe0[_0x2484c6];return _0x3d09a6;};'use strict';var multer=require(_0x0afe('0x0'));var util=require(_0x0afe('0x1'));var path=require(_0x0afe('0x2'));var timeout=require(_0x0afe('0x3'));var express=require(_0x0afe('0x4'));var router=express[_0x0afe('0x5')]();var fs_extra=require(_0x0afe('0x6'));var auth=require(_0x0afe('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0afe('0x8'));router[_0x0afe('0x9')]('/',auth[_0x0afe('0xa')](),controller['index']);router['get'](_0x0afe('0xb'),auth[_0x0afe('0xa')](),controller[_0x0afe('0xc')]);router[_0x0afe('0x9')]('/:id',auth[_0x0afe('0xa')](),controller[_0x0afe('0xd')]);router['get'](_0x0afe('0xe'),auth[_0x0afe('0xa')](),controller[_0x0afe('0xf')]);router[_0x0afe('0x9')](_0x0afe('0x10'),auth[_0x0afe('0xa')](),controller[_0x0afe('0x11')]);router[_0x0afe('0x9')](_0x0afe('0x12'),controller[_0x0afe('0x13')]);router[_0x0afe('0x9')](_0x0afe('0x14'),controller[_0x0afe('0x15')]);router['get'](_0x0afe('0x16'),controller[_0x0afe('0x17')]);router[_0x0afe('0x9')](_0x0afe('0x18'),controller[_0x0afe('0x19')]);router[_0x0afe('0x9')](_0x0afe('0x1a'),auth[_0x0afe('0xa')](),controller[_0x0afe('0x1b')]);router['get']('/:id/snippet',controller[_0x0afe('0x1c')]);router[_0x0afe('0x9')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router['get']('/:id/proactive_actions',auth[_0x0afe('0xa')](),controller['getProactiveActions']);router['get']('/:id/fields',controller[_0x0afe('0x1d')]);router[_0x0afe('0x9')](_0x0afe('0x1e'),auth[_0x0afe('0xa')](),controller[_0x0afe('0x1f')]);router[_0x0afe('0x9')](_0x0afe('0x20'),auth['isAuthenticated'](),controller[_0x0afe('0x21')]);router[_0x0afe('0x22')]('/',auth[_0x0afe('0xa')](),controller[_0x0afe('0x23')]);router[_0x0afe('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x0afe('0x22')](_0x0afe('0x10'),auth[_0x0afe('0xa')](),controller[_0x0afe('0x24')]);var upload=multer({'storage':multer[_0x0afe('0x25')]({'destination':function(_0x543435,_0x176a56,_0x3ca1bb){_0x3ca1bb(null,path['join'](config[_0x0afe('0x26')],_0x0afe('0x27')));},'filename':function(_0x16fb34,_0x2e458a,_0x4273b5){_0x4273b5(null,util['format']('%s-%s',Date[_0x0afe('0x28')](),_0x2e458a[_0x0afe('0x29')]));}})});router[_0x0afe('0x22')](_0x0afe('0x12'),upload[_0x0afe('0x2a')](_0x0afe('0x2b')),controller[_0x0afe('0x2c')]);var upload=multer({'storage':multer[_0x0afe('0x25')]({'destination':function(_0xc8eae7,_0x1b5ed8,_0x2ca4af){_0x2ca4af(null,path['join'](config[_0x0afe('0x26')],_0x0afe('0x2d')));},'filename':function(_0x1f05de,_0x52b061,_0x3b52c5){_0x3b52c5(null,util['format'](_0x0afe('0x2e'),Date['now'](),_0x52b061['originalname']));}})});router[_0x0afe('0x22')]('/:id/avatar',upload[_0x0afe('0x2a')]('file'),controller[_0x0afe('0x2f')]);var upload=multer({'storage':multer[_0x0afe('0x25')]({'destination':function(_0x3eb058,_0x372e15,_0x501ec6){_0x501ec6(null,path[_0x0afe('0x30')](config[_0x0afe('0x26')],'server/files/images/avatars/'));},'filename':function(_0x44f89d,_0x110446,_0x53fe51){_0x53fe51(null,util[_0x0afe('0x31')](_0x0afe('0x2e'),Date['now'](),_0x110446[_0x0afe('0x29')]));}})});router['post'](_0x0afe('0x16'),upload[_0x0afe('0x2a')](_0x0afe('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x0afe('0x25')]({'destination':function(_0x56c3ea,_0x545f1d,_0x2016b4){_0x2016b4(null,path['join'](config[_0x0afe('0x26')],'server/files/images/avatars/'));},'filename':function(_0x4cde90,_0x7acc03,_0x5c1394){_0x5c1394(null,util['format'](_0x0afe('0x2e'),Date[_0x0afe('0x28')](),_0x7acc03[_0x0afe('0x29')]));}})});router['post']('/:id/system_avatar',upload[_0x0afe('0x2a')]('file'),controller[_0x0afe('0x32')]);router[_0x0afe('0x22')](_0x0afe('0x33'),controller[_0x0afe('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x0afe('0x25')]({'destination':function(_0x486f61,_0x50a944,_0x31cd90){const _0x1b3fae=path[_0x0afe('0x30')](config[_0x0afe('0x26')],_0x0afe('0x35'),_0x0afe('0x36'),_0x0afe('0x37'));fs_extra[_0x0afe('0x38')](_0x1b3fae,function(){_0x31cd90(null,_0x1b3fae);});},'filename':function(_0x525ceb,_0x43154e,_0x3c36f4){const _0x41cc52=_0x43154e[_0x0afe('0x29')][_0x0afe('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5664fc=path[_0x0afe('0x3a')](_0x41cc52);const _0x3ebd5e=Date['now']()+'-'+_0x41cc52[_0x0afe('0x39')](_0x5664fc,'')+_0x5664fc;_0x3c36f4(null,_0x3ebd5e);}})});router[_0x0afe('0x22')](_0x0afe('0x3b'),offlineUploadMulter[_0x0afe('0x3c')](),controller['offline']);router[_0x0afe('0x22')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x0afe('0x3d')]);router[_0x0afe('0x22')](_0x0afe('0x3e'),auth['isAuthenticated'](),controller[_0x0afe('0x3f')]);router[_0x0afe('0x22')](_0x0afe('0x40'),auth[_0x0afe('0xa')](),controller['addProactiveActions']);router['post'](_0x0afe('0x20'),auth[_0x0afe('0xa')](),controller['addAgents']);router['put'](_0x0afe('0x41'),auth[_0x0afe('0xa')](),controller['update']);router[_0x0afe('0x42')](_0x0afe('0x41'),auth[_0x0afe('0xa')](),controller['destroy']);router['delete'](_0x0afe('0xe'),auth['isAuthenticated'](),controller[_0x0afe('0x43')]);router['delete'](_0x0afe('0x10'),auth[_0x0afe('0xa')](),controller['removeAnswers']);router[_0x0afe('0x42')]('/:id/users',auth[_0x0afe('0xa')](),controller[_0x0afe('0x44')]);module[_0x0afe('0x45')]=router; \ No newline at end of file +var _0x3a9e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','addDisposition','diskStorage','root','format','%s-%s','originalname','single','file','join','server/files/images/avatars/','addCustomerAvatar','now','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','offline','addApplications','addProactiveActions','/:id/users','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout'];(function(_0x5a22fc,_0x3acd64){var _0x29fde1=function(_0x26987e){while(--_0x26987e){_0x5a22fc['push'](_0x5a22fc['shift']());}};_0x29fde1(++_0x3acd64);}(_0x3a9e,0x1d8));var _0xe3a9=function(_0x3ba0af,_0xccb8a1){_0x3ba0af=_0x3ba0af-0x0;var _0x650db7=_0x3a9e[_0x3ba0af];return _0x650db7;};'use strict';var multer=require(_0xe3a9('0x0'));var util=require(_0xe3a9('0x1'));var path=require(_0xe3a9('0x2'));var timeout=require(_0xe3a9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe3a9('0x4'));var auth=require(_0xe3a9('0x5'));var interaction=require(_0xe3a9('0x6'));var config=require(_0xe3a9('0x7'));var controller=require('./chatWebsite.controller');router[_0xe3a9('0x8')]('/',auth['isAuthenticated'](),controller[_0xe3a9('0x9')]);router[_0xe3a9('0x8')](_0xe3a9('0xa'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0xc')]);router[_0xe3a9('0x8')]('/:id',auth[_0xe3a9('0xb')](),controller[_0xe3a9('0xd')]);router[_0xe3a9('0x8')](_0xe3a9('0xe'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0xf')]);router['get'](_0xe3a9('0x10'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x11')]);router[_0xe3a9('0x8')](_0xe3a9('0x12'),controller[_0xe3a9('0x13')]);router[_0xe3a9('0x8')]('/:id/avatar',controller[_0xe3a9('0x14')]);router[_0xe3a9('0x8')](_0xe3a9('0x15'),controller['getCustomerAvatar']);router[_0xe3a9('0x8')](_0xe3a9('0x16'),controller[_0xe3a9('0x17')]);router['get'](_0xe3a9('0x18'),auth['isAuthenticated'](),controller[_0xe3a9('0x19')]);router[_0xe3a9('0x8')](_0xe3a9('0x1a'),controller[_0xe3a9('0x1b')]);router['get'](_0xe3a9('0x1c'),auth['isAuthenticated'](),controller[_0xe3a9('0x1d')]);router[_0xe3a9('0x8')](_0xe3a9('0x1e'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x1f')]);router['get'](_0xe3a9('0x20'),controller[_0xe3a9('0x21')]);router[_0xe3a9('0x8')]('/:id/offline_messages',auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x22')]);router[_0xe3a9('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xe3a9('0x23')]);router[_0xe3a9('0x24')]('/',auth[_0xe3a9('0xb')](),controller['create']);router[_0xe3a9('0x24')](_0xe3a9('0xe'),auth['isAuthenticated'](),controller[_0xe3a9('0x25')]);router['post']('/:id/canned_answers',auth[_0xe3a9('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xe3a9('0x26')]({'destination':function(_0x41de7f,_0x4820d6,_0x382071){_0x382071(null,path['join'](config[_0xe3a9('0x27')],'server/files/images/logos/'));},'filename':function(_0x78f76b,_0x237b54,_0x5ce486){_0x5ce486(null,util[_0xe3a9('0x28')](_0xe3a9('0x29'),Date['now'](),_0x237b54[_0xe3a9('0x2a')]));}})});router['post'](_0xe3a9('0x12'),upload[_0xe3a9('0x2b')](_0xe3a9('0x2c')),controller['addLogo']);var upload=multer({'storage':multer[_0xe3a9('0x26')]({'destination':function(_0x4f43f6,_0x4d943b,_0x1d5659){_0x1d5659(null,path[_0xe3a9('0x2d')](config[_0xe3a9('0x27')],_0xe3a9('0x2e')));},'filename':function(_0x51ab1d,_0x4c5e54,_0x4041f7){_0x4041f7(null,util[_0xe3a9('0x28')]('%s-%s',Date['now'](),_0x4c5e54[_0xe3a9('0x2a')]));}})});router[_0xe3a9('0x24')]('/:id/avatar',upload[_0xe3a9('0x2b')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xe3a9('0x26')]({'destination':function(_0x3e4fea,_0x3fc986,_0x340bcf){_0x340bcf(null,path[_0xe3a9('0x2d')](config['root'],_0xe3a9('0x2e')));},'filename':function(_0x1340e0,_0x25c1fc,_0x28efe7){_0x28efe7(null,util[_0xe3a9('0x28')](_0xe3a9('0x29'),Date['now'](),_0x25c1fc[_0xe3a9('0x2a')]));}})});router[_0xe3a9('0x24')]('/:id/customer_avatar',upload['single'](_0xe3a9('0x2c')),controller[_0xe3a9('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4be1a8,_0xa3da92,_0x3e72cf){_0x3e72cf(null,path[_0xe3a9('0x2d')](config[_0xe3a9('0x27')],_0xe3a9('0x2e')));},'filename':function(_0xfd7bcc,_0x5694c5,_0x29ec42){_0x29ec42(null,util['format'](_0xe3a9('0x29'),Date[_0xe3a9('0x30')](),_0x5694c5['originalname']));}})});router[_0xe3a9('0x24')](_0xe3a9('0x16'),upload[_0xe3a9('0x2b')](_0xe3a9('0x2c')),controller['addSystemAvatar']);router[_0xe3a9('0x24')](_0xe3a9('0x31'),controller[_0xe3a9('0x32')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x6b345e,_0x29b465,_0x5ca9e3){const _0x937c62=path[_0xe3a9('0x2d')](config[_0xe3a9('0x27')],_0xe3a9('0x33'),'attachments',_0xe3a9('0x34'));fs_extra[_0xe3a9('0x35')](_0x937c62,function(){_0x5ca9e3(null,_0x937c62);});},'filename':function(_0x178427,_0x217944,_0x1c7c29){const _0x19e037=_0x217944['originalname'][_0xe3a9('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x753e00=path[_0xe3a9('0x37')](_0x19e037);const _0x2af89b=Date[_0xe3a9('0x30')]()+'-'+_0x19e037[_0xe3a9('0x36')](_0x753e00,'')+_0x753e00;_0x1c7c29(null,_0x2af89b);}})});router[_0xe3a9('0x24')]('/:id/offline',offlineUploadMulter['any'](),controller[_0xe3a9('0x38')]);router[_0xe3a9('0x24')](_0xe3a9('0x18'),auth[_0xe3a9('0xb')](),controller['addInteraction']);router[_0xe3a9('0x24')](_0xe3a9('0x1c'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x39')]);router['post'](_0xe3a9('0x1e'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x3a')]);router[_0xe3a9('0x24')](_0xe3a9('0x3b'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x3c')]);router[_0xe3a9('0x3d')](_0xe3a9('0x3e'),auth[_0xe3a9('0xb')](),controller['update']);router[_0xe3a9('0x3f')](_0xe3a9('0x3e'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x40')]);router['delete'](_0xe3a9('0xe'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x41')]);router[_0xe3a9('0x3f')](_0xe3a9('0x10'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x42')]);router['delete'](_0xe3a9('0x3b'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x43')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 3318c8a..597726e 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ce5=['beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','exports'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0x3ce5,0x1ba));var _0x53ce=function(_0xfe97ba,_0x57482a){_0xfe97ba=_0xfe97ba-0x0;var _0x34867a=_0x3ce5[_0xfe97ba];return _0x34867a;};var beaverLogger=require(_0x53ce('0x0'));var express=require(_0x53ce('0x1'));var auth=require(_0x53ce('0x2'));var config=require(_0x53ce('0x3'));var router=express[_0x53ce('0x4')]();var isProduction=config[_0x53ce('0x5')]===_0x53ce('0x6')||![];function clientSideLogs(_0x33349c,_0x1fff31,_0x1ea0c7){var _0x408c99=_0x33349c['app'][_0x53ce('0x7')](_0x53ce('0x8'));if(!_0x408c99){throw new Error(_0x53ce('0x9'));}return beaverLogger[_0x53ce('0xa')]({'uri':'/client-logs','logger':_0x408c99,'enableCors':!isProduction})(_0x33349c,_0x1fff31,_0x1ea0c7);}router[_0x53ce('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0x53ce('0xc')]=router; \ No newline at end of file +var _0xb29e=['expressEndpoint','/client-logs','use','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','client-side-logger'];(function(_0x37d22f,_0x19a56b){var _0x3b06e6=function(_0xae9189){while(--_0xae9189){_0x37d22f['push'](_0x37d22f['shift']());}};_0x3b06e6(++_0x19a56b);}(_0xb29e,0x1cf));var _0xeb29=function(_0x3b5ccb,_0x3c7d78){_0x3b5ccb=_0x3b5ccb-0x0;var _0x2c6c10=_0xb29e[_0x3b5ccb];return _0x2c6c10;};var beaverLogger=require(_0xeb29('0x0'));var express=require(_0xeb29('0x1'));var auth=require(_0xeb29('0x2'));var config=require(_0xeb29('0x3'));var router=express['Router']();var isProduction=config[_0xeb29('0x4')]===_0xeb29('0x5')||![];function clientSideLogs(_0x2137b2,_0x27276b,_0x7a1880){var _0x47a970=_0x2137b2['app']['get'](_0xeb29('0x6'));if(!_0x47a970){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xeb29('0x7')]({'uri':_0xeb29('0x8'),'logger':_0x47a970,'enableCors':!isProduction})(_0x2137b2,_0x27276b,_0x7a1880);}router[_0xeb29('0x9')](auth['isAuthenticated'](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index ea9c22b..e666bd1 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x749f=['MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x749f,0x1e4));var _0xf749=function(_0x233c11,_0x1083e4){_0x233c11=_0x233c11-0x0;var _0x381729=_0x749f[_0x233c11];return _0x381729;};'use strict';var Sequelize=require(_0xf749('0x0'));module[_0xf749('0x1')]={'name':{'type':Sequelize[_0xf749('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf749('0x3')]('AmazonAWS','Google',_0xf749('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf749('0x3')](_0xf749('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0xf749('0x2')],'comment':_0xf749('0x6')},'data2':{'type':Sequelize[_0xf749('0x2')],'comment':_0xf749('0x7')},'data3':{'type':Sequelize[_0xf749('0x2')],'comment':_0xf749('0x8')},'data4':{'type':Sequelize[_0xf749('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xf749('0x9')],'comment':_0xf749('0xa')},'data6':{'type':Sequelize[_0xf749('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xf749('0x9')],'comment':_0xf749('0xb')}}; \ No newline at end of file +var _0xbeb5=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','ENUM','Outlook365','Dynamics365'];(function(_0x3353f3,_0x189c73){var _0x2c268c=function(_0x478936){while(--_0x478936){_0x3353f3['push'](_0x3353f3['shift']());}};_0x2c268c(++_0x189c73);}(_0xbeb5,0x1d9));var _0x5beb=function(_0x9470af,_0x2e5f2d){_0x9470af=_0x9470af-0x0;var _0x56ee2b=_0xbeb5[_0x9470af];return _0x56ee2b;};'use strict';var Sequelize=require(_0x5beb('0x0'));module[_0x5beb('0x1')]={'name':{'type':Sequelize[_0x5beb('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x5beb('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5beb('0x4')](_0x5beb('0x5'),_0x5beb('0x6'))},'data1':{'type':Sequelize[_0x5beb('0x2')],'comment':_0x5beb('0x7')},'data2':{'type':Sequelize[_0x5beb('0x2')],'comment':_0x5beb('0x8')},'data3':{'type':Sequelize[_0x5beb('0x2')],'comment':_0x5beb('0x9')},'data4':{'type':Sequelize[_0x5beb('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x5beb('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x5beb('0xa')],'comment':_0x5beb('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 55b2c2c..c0493c7 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c53=['data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','end','json','offset','undefined','limit','count','Content-Range','destroy','then','status','stack','name','send','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','MicrosoftAzure','decryptString','data3','catch','show','params','length','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','state','from','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token'];(function(_0x5a5aec,_0x4ad7f8){var _0x4fe293=function(_0x18ae46){while(--_0x18ae46){_0x5a5aec['push'](_0x5a5aec['shift']());}};_0x4fe293(++_0x4ad7f8);}(_0x1c53,0x1de));var _0x31c5=function(_0x599390,_0x4dd7cd){_0x599390=_0x599390-0x0;var _0x477cf6=_0x1c53[_0x599390];return _0x477cf6;};'use strict';var _=require(_0x31c5('0x0'));var Redis=require(_0x31c5('0x1'));var qs=require(_0x31c5('0x2'));var encryptor=require(_0x31c5('0x3'));var config=require(_0x31c5('0x4'));var logger=require(_0x31c5('0x5'))(_0x31c5('0x6'));var db=require(_0x31c5('0x7'))['db'];var oauth=require(_0x31c5('0x8'));config[_0x31c5('0x9')]=_[_0x31c5('0xa')](config[_0x31c5('0x9')],{'host':_0x31c5('0xb'),'port':0x18eb});var socket=require(_0x31c5('0xc'))(new Redis(config[_0x31c5('0x9')]));var redis=new Redis(config[_0x31c5('0x9')]);function respondWithStatusCode(_0x5178e0,_0x39bea3){_0x39bea3=_0x39bea3||0xcc;return function(_0xf8a6ba){if(_0xf8a6ba){return _0x5178e0[_0x31c5('0xd')](_0x39bea3);}return _0x5178e0['status'](_0x39bea3)[_0x31c5('0xe')]();};}function respondWithResult(_0x611970,_0x1c7f82){_0x1c7f82=_0x1c7f82||0xc8;return function(_0xe2a063){if(_0xe2a063){return _0x611970['status'](_0x1c7f82)[_0x31c5('0xf')](_0xe2a063);}};}function respondWithFilteredResult(_0x1398e3,_0x5cf3c5){return function(_0x39ac11){if(_0x39ac11){var _0x5a4fc2=typeof _0x5cf3c5[_0x31c5('0x10')]===_0x31c5('0x11')&&typeof _0x5cf3c5[_0x31c5('0x12')]===_0x31c5('0x11');var _0x191f27=_0x39ac11[_0x31c5('0x13')];var _0x2853eb=_0x5a4fc2?0x0:_0x5cf3c5[_0x31c5('0x10')];var _0x56b5d6=_0x5a4fc2?_0x39ac11['count']:_0x5cf3c5[_0x31c5('0x10')]+_0x5cf3c5[_0x31c5('0x12')];var _0x757e25;if(_0x56b5d6>=_0x191f27){_0x56b5d6=_0x191f27;_0x757e25=0xc8;}else{_0x757e25=0xce;}_0x1398e3['status'](_0x757e25);return _0x1398e3['set'](_0x31c5('0x14'),_0x2853eb+'-'+_0x56b5d6+'/'+_0x191f27)['json'](_0x39ac11);}return null;};}function saveUpdates(_0xb9d8e0){return function(_0x1658b8){if(_0x1658b8){return _0x1658b8['update'](_0xb9d8e0)['then'](function(_0x346f41){return _0x346f41;});}return null;};}function removeEntity(_0x4d996f){return function(_0x314b53){if(_0x314b53){return _0x314b53[_0x31c5('0x15')]()[_0x31c5('0x16')](function(){_0x4d996f[_0x31c5('0x17')](0xcc)[_0x31c5('0xe')]();});}};}function handleEntityNotFound(_0x5dd88f){return function(_0x3702cf){if(!_0x3702cf){_0x5dd88f[_0x31c5('0xd')](0x194);}return _0x3702cf;};}function handleError(_0x37919a,_0x2e92db){_0x2e92db=_0x2e92db||0x1f4;return function(_0x40ff01){logger['error'](_0x40ff01[_0x31c5('0x18')]);if(_0x40ff01[_0x31c5('0x19')]){delete _0x40ff01['name'];}_0x37919a[_0x31c5('0x17')](_0x2e92db)[_0x31c5('0x1a')](_0x40ff01);};}function maskClientSecret(_0x23745e){return _['padEnd'](_0x23745e['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x4bec89,_0x5a8fa0){var _0x3ec9a2={},_0x45521a={},_0xeefb7a={'count':0x0,'rows':[]};var _0x2ea72a=_[_0x31c5('0x1b')](db[_0x31c5('0x1c')][_0x31c5('0x1d')],function(_0x5519f7){return{'name':_0x5519f7[_0x31c5('0x1e')],'type':_0x5519f7[_0x31c5('0x1f')][_0x31c5('0x20')]};});_0x45521a[_0x31c5('0x21')]=_[_0x31c5('0x1b')](_0x2ea72a,_0x31c5('0x19'));_0x45521a[_0x31c5('0x22')]=_[_0x31c5('0x23')](_0x4bec89[_0x31c5('0x22')]);_0x45521a[_0x31c5('0x24')]=_[_0x31c5('0x25')](_0x45521a[_0x31c5('0x21')],_0x45521a['query']);_0x3ec9a2[_0x31c5('0x26')]=_['intersection'](_0x45521a[_0x31c5('0x21')],qs[_0x31c5('0x27')](_0x4bec89[_0x31c5('0x22')][_0x31c5('0x27')]));_0x3ec9a2[_0x31c5('0x26')]=_0x3ec9a2[_0x31c5('0x26')]['length']?_0x3ec9a2[_0x31c5('0x26')]:_0x45521a[_0x31c5('0x21')];if(!_0x4bec89[_0x31c5('0x22')][_0x31c5('0x28')](_0x31c5('0x29'))){_0x3ec9a2['limit']=qs[_0x31c5('0x12')](_0x4bec89[_0x31c5('0x22')]['limit']);_0x3ec9a2[_0x31c5('0x10')]=qs[_0x31c5('0x10')](_0x4bec89[_0x31c5('0x22')][_0x31c5('0x10')]);}_0x3ec9a2[_0x31c5('0x2a')]=qs['sort'](_0x4bec89['query']['sort']);_0x3ec9a2[_0x31c5('0x2b')]=qs['filters'](_[_0x31c5('0x2c')](_0x4bec89[_0x31c5('0x22')],_0x45521a[_0x31c5('0x24')]),_0x2ea72a);if(_0x4bec89[_0x31c5('0x22')][_0x31c5('0x2d')]){_0x3ec9a2['where']=_[_0x31c5('0x2e')](_0x3ec9a2[_0x31c5('0x2b')],{'$or':_[_0x31c5('0x1b')](_0x2ea72a,function(_0x3941cf){if(_0x3941cf[_0x31c5('0x1f')]!==_0x31c5('0x2f')){var _0x4fa832={};_0x4fa832[_0x3941cf[_0x31c5('0x19')]]={'$like':'%'+_0x4bec89[_0x31c5('0x22')][_0x31c5('0x2d')]+'%'};return _0x4fa832;}})});}_0x3ec9a2=_['merge']({},_0x3ec9a2,_0x4bec89[_0x31c5('0x30')]);var _0x12bdd9={'where':_0x3ec9a2[_0x31c5('0x2b')]};return db[_0x31c5('0x1c')][_0x31c5('0x13')](_0x12bdd9)[_0x31c5('0x16')](function(_0x1a6323){_0xeefb7a[_0x31c5('0x13')]=_0x1a6323;if(_0x4bec89['query'][_0x31c5('0x31')]){_0x3ec9a2[_0x31c5('0x32')]=[{'all':!![]}];}return db['CloudProvider'][_0x31c5('0x33')](_0x3ec9a2);})[_0x31c5('0x16')](function(_0x27a2ee){_0xeefb7a['rows']=_[_0x31c5('0x1b')](_0x27a2ee,function(_0x101f36){if(_0x101f36['service']===_0x31c5('0x34')){var _0x409ca5=encryptor[_0x31c5('0x35')](_0x101f36[_0x31c5('0x36')]);_0x101f36[_0x31c5('0x36')]=maskClientSecret(_0x409ca5);}return _0x101f36;});return _0xeefb7a;})[_0x31c5('0x16')](respondWithFilteredResult(_0x5a8fa0,_0x3ec9a2))[_0x31c5('0x37')](handleError(_0x5a8fa0,null));};exports[_0x31c5('0x38')]=function(_0x293056,_0x4cad16){var _0x4846b2={'raw':!![],'where':{'id':_0x293056[_0x31c5('0x39')]['id']}},_0x251d78={};_0x251d78[_0x31c5('0x21')]=_[_0x31c5('0x23')](db[_0x31c5('0x1c')][_0x31c5('0x1d')]);_0x251d78['query']=_[_0x31c5('0x23')](_0x293056[_0x31c5('0x22')]);_0x251d78[_0x31c5('0x24')]=_['intersection'](_0x251d78[_0x31c5('0x21')],_0x251d78['query']);_0x4846b2[_0x31c5('0x26')]=_['intersection'](_0x251d78[_0x31c5('0x21')],qs[_0x31c5('0x27')](_0x293056[_0x31c5('0x22')]['fields']));_0x4846b2[_0x31c5('0x26')]=_0x4846b2[_0x31c5('0x26')][_0x31c5('0x3a')]?_0x4846b2[_0x31c5('0x26')]:_0x251d78[_0x31c5('0x21')];if(_0x293056[_0x31c5('0x22')][_0x31c5('0x31')]){_0x4846b2[_0x31c5('0x32')]=[{'all':!![]}];}_0x4846b2=_[_0x31c5('0x2e')]({},_0x4846b2,_0x293056[_0x31c5('0x30')]);return db[_0x31c5('0x1c')][_0x31c5('0x3b')](_0x4846b2)[_0x31c5('0x16')](handleEntityNotFound(_0x4cad16,null))[_0x31c5('0x16')](function(_0x2ceaf7){if(_0x2ceaf7[_0x31c5('0x3c')]===_0x31c5('0x34')){var _0x2b131c=encryptor[_0x31c5('0x35')](_0x2ceaf7[_0x31c5('0x36')]);_0x2ceaf7['data3']=maskClientSecret(_0x2b131c);}return _0x2ceaf7;})[_0x31c5('0x16')](respondWithResult(_0x4cad16,null))[_0x31c5('0x37')](handleError(_0x4cad16,null));};exports[_0x31c5('0x3d')]=function(_0x593bac,_0x1ea5d7){if(!_0x593bac[_0x31c5('0x3e')][_0x31c5('0x19')])throw new Error(_0x31c5('0x3f'));if(!_0x593bac['body'][_0x31c5('0x3c')])throw new Error(_0x31c5('0x40'));var _0x18fd18=db[_0x31c5('0x1c')][_0x31c5('0x1d')][_0x31c5('0x3c')]['values'];if(!_0x18fd18[_0x31c5('0x41')](_0x593bac[_0x31c5('0x3e')][_0x31c5('0x3c')]))throw new Error(_0x31c5('0x42')+_0x18fd18[_0x31c5('0x43')](',\x20'));if(_0x593bac[_0x31c5('0x3e')][_0x31c5('0x3c')]===_0x31c5('0x34')&&_0x593bac[_0x31c5('0x3e')][_0x31c5('0x36')]){_0x593bac[_0x31c5('0x3e')][_0x31c5('0x36')]=encryptor['encryptString'](_0x593bac[_0x31c5('0x3e')][_0x31c5('0x36')]);}return db[_0x31c5('0x1c')][_0x31c5('0x3d')](_0x593bac['body'],{})[_0x31c5('0x16')](respondWithResult(_0x1ea5d7,0xc9))['catch'](handleError(_0x1ea5d7,null));};exports[_0x31c5('0x44')]=function(_0x5b03f0,_0x133c6f){if(_0x5b03f0[_0x31c5('0x3e')]['id']){delete _0x5b03f0[_0x31c5('0x3e')]['id'];}return db[_0x31c5('0x1c')][_0x31c5('0x3b')]({'where':{'id':_0x5b03f0[_0x31c5('0x39')]['id']}})['then'](handleEntityNotFound(_0x133c6f,null))[_0x31c5('0x16')](function(_0x440587){if(_0x440587[_0x31c5('0x3c')]==='MicrosoftAzure'&&_0x5b03f0['body'][_0x31c5('0x36')]){_0x5b03f0[_0x31c5('0x3e')][_0x31c5('0x36')]=encryptor['encryptString'](_0x5b03f0['body'][_0x31c5('0x36')]);}return _0x440587;})[_0x31c5('0x16')](saveUpdates(_0x5b03f0[_0x31c5('0x3e')],null))[_0x31c5('0x16')](respondWithResult(_0x133c6f,null))[_0x31c5('0x37')](handleError(_0x133c6f,null));};exports['destroy']=function(_0x2bcc45,_0x167494){return db[_0x31c5('0x1c')]['find']({'where':{'id':_0x2bcc45[_0x31c5('0x39')]['id']}})[_0x31c5('0x16')](handleEntityNotFound(_0x167494,null))[_0x31c5('0x16')](removeEntity(_0x167494,null))[_0x31c5('0x37')](handleError(_0x167494,null));};exports[_0x31c5('0x45')]=function(_0x2ee72d,_0x3cf68f){return db[_0x31c5('0x1c')]['findOne']({'where':{'id':_0x2ee72d[_0x31c5('0x39')]['id']},'raw':!![]})[_0x31c5('0x16')](function(_0x46b2e4){if(!_0x46b2e4)return _0x3cf68f[_0x31c5('0xd')](0x194);return{'url':oauth[_0x31c5('0x46')](_0x46b2e4,_0x2ee72d['user']['id'])};})['then'](respondWithResult(_0x3cf68f,null))[_0x31c5('0x37')](handleError(_0x3cf68f,null));};exports[_0x31c5('0x47')]=function(_0x440a0b,_0x570904){var _0x332736=_0x440a0b[_0x31c5('0x3e')];var _0x41bebe;var _0x271528;if(_0x332736[_0x31c5('0x48')])throw _0x332736;redis['get'](_0x332736[_0x31c5('0x49')])['then'](function(_0x374058){if(!_0x374058)throw new Error('Invalid\x20state\x20parameter');_0x41bebe=JSON['parse'](_0x374058);var _0x548a52=Buffer[_0x31c5('0x4a')](_0x332736[_0x31c5('0x49')],'base64')[_0x31c5('0x4b')](_0x31c5('0x4c'));_0x271528=JSON[_0x31c5('0x4d')](_0x548a52);if(!oauth[_0x31c5('0x4e')](_0x332736[_0x31c5('0x4f')],_0x41bebe[_0x31c5('0x50')]))throw new Error(_0x31c5('0x51'));redis[_0x31c5('0x52')](_0x332736[_0x31c5('0x49')]);return oauth[_0x31c5('0x53')](_0x332736['code'],_0x41bebe);})['then'](function(_0x4ce7d4){_0x41bebe[_0x31c5('0x54')]=_0x4ce7d4[_0x31c5('0x55')];_0x41bebe[_0x31c5('0x56')]=_0x4ce7d4['refresh_token'];return db[_0x31c5('0x1c')][_0x31c5('0x44')]({'data5':_0x41bebe['data5'],'data6':_0x41bebe['data6']},{'where':{'id':_0x41bebe['id']}});})[_0x31c5('0x16')](function(){oauth[_0x31c5('0x57')](_0x41bebe);socket[_0x31c5('0x58')](_0x31c5('0x59'),{'id':_0x271528['id']});return;})[_0x31c5('0x16')](respondWithStatusCode(_0x570904,null))[_0x31c5('0x37')](function(_0x49ba39){if(_0x271528){socket['emit'](_0x31c5('0x5a'),{'id':_0x271528['id']});}if(!_0x41bebe){logger[_0x31c5('0x48')](_0x31c5('0x5b'),_0x49ba39);return _0x570904[_0x31c5('0x17')](0x1f4)[_0x31c5('0x1a')](_0x49ba39[_0x31c5('0x5c')]);}logger[_0x31c5('0x48')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x41bebe['id'],JSON[_0x31c5('0x5d')](_0x49ba39));});}; \ No newline at end of file +var _0x0b25=['refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','error','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','destroy','end','stack','name','padEnd','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','filter','then','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','length','options','find','create','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','catch','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','code','data5','access_token','data6'];(function(_0x51dae4,_0xa7f367){var _0x27d0b0=function(_0x5575d1){while(--_0x5575d1){_0x51dae4['push'](_0x51dae4['shift']());}};_0x27d0b0(++_0xa7f367);}(_0x0b25,0x1cf));var _0x50b2=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x0b25[_0x40dd56];return _0x4f850f;};'use strict';var _=require(_0x50b2('0x0'));var Redis=require('ioredis');var qs=require(_0x50b2('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x50b2('0x2'));var logger=require(_0x50b2('0x3'))('api');var db=require(_0x50b2('0x4'))['db'];var oauth=require(_0x50b2('0x5'));config[_0x50b2('0x6')]=_['defaults'](config[_0x50b2('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x50b2('0x7'))(new Redis(config[_0x50b2('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x34f230,_0x435d70){_0x435d70=_0x435d70||0xcc;return function(_0x212cb5){if(_0x212cb5){return _0x34f230[_0x50b2('0x8')](_0x435d70);}return _0x34f230[_0x50b2('0x9')](_0x435d70)['end']();};}function respondWithResult(_0x1be4d6,_0x597593){_0x597593=_0x597593||0xc8;return function(_0x55a439){if(_0x55a439){return _0x1be4d6[_0x50b2('0x9')](_0x597593)[_0x50b2('0xa')](_0x55a439);}};}function respondWithFilteredResult(_0x407fd3,_0x424c00){return function(_0x3962e4){if(_0x3962e4){var _0x79559a=typeof _0x424c00[_0x50b2('0xb')]===_0x50b2('0xc')&&typeof _0x424c00[_0x50b2('0xd')]===_0x50b2('0xc');var _0x1fe18a=_0x3962e4[_0x50b2('0xe')];var _0x87df19=_0x79559a?0x0:_0x424c00[_0x50b2('0xb')];var _0x4a4eef=_0x79559a?_0x3962e4[_0x50b2('0xe')]:_0x424c00[_0x50b2('0xb')]+_0x424c00[_0x50b2('0xd')];var _0x38ebf0;if(_0x4a4eef>=_0x1fe18a){_0x4a4eef=_0x1fe18a;_0x38ebf0=0xc8;}else{_0x38ebf0=0xce;}_0x407fd3['status'](_0x38ebf0);return _0x407fd3['set'](_0x50b2('0xf'),_0x87df19+'-'+_0x4a4eef+'/'+_0x1fe18a)[_0x50b2('0xa')](_0x3962e4);}return null;};}function saveUpdates(_0x2ac238){return function(_0x3199cc){if(_0x3199cc){return _0x3199cc[_0x50b2('0x10')](_0x2ac238)['then'](function(_0x2006e9){return _0x2006e9;});}return null;};}function removeEntity(_0x3e1e47){return function(_0x558174){if(_0x558174){return _0x558174[_0x50b2('0x11')]()['then'](function(){_0x3e1e47[_0x50b2('0x9')](0xcc)[_0x50b2('0x12')]();});}};}function handleEntityNotFound(_0x144e5b){return function(_0x3f64c7){if(!_0x3f64c7){_0x144e5b[_0x50b2('0x8')](0x194);}return _0x3f64c7;};}function handleError(_0x228d62,_0x34f6a0){_0x34f6a0=_0x34f6a0||0x1f4;return function(_0x4b78e1){logger['error'](_0x4b78e1[_0x50b2('0x13')]);if(_0x4b78e1[_0x50b2('0x14')]){delete _0x4b78e1[_0x50b2('0x14')];}_0x228d62[_0x50b2('0x9')](_0x34f6a0)['send'](_0x4b78e1);};}function maskClientSecret(_0x58d7e4){return _[_0x50b2('0x15')](_0x58d7e4['slice'](0x0,0x3),0x14,'*');}exports[_0x50b2('0x16')]=function(_0x34d24e,_0xfef346){var _0x5ec733={},_0x3a632c={},_0x316246={'count':0x0,'rows':[]};var _0x3968c4=_['map'](db[_0x50b2('0x17')][_0x50b2('0x18')],function(_0x287860){return{'name':_0x287860[_0x50b2('0x19')],'type':_0x287860[_0x50b2('0x1a')][_0x50b2('0x1b')]};});_0x3a632c[_0x50b2('0x1c')]=_[_0x50b2('0x1d')](_0x3968c4,'name');_0x3a632c[_0x50b2('0x1e')]=_[_0x50b2('0x1f')](_0x34d24e[_0x50b2('0x1e')]);_0x3a632c['filters']=_[_0x50b2('0x20')](_0x3a632c[_0x50b2('0x1c')],_0x3a632c[_0x50b2('0x1e')]);_0x5ec733[_0x50b2('0x21')]=_[_0x50b2('0x20')](_0x3a632c[_0x50b2('0x1c')],qs[_0x50b2('0x22')](_0x34d24e['query'][_0x50b2('0x22')]));_0x5ec733[_0x50b2('0x21')]=_0x5ec733[_0x50b2('0x21')]['length']?_0x5ec733[_0x50b2('0x21')]:_0x3a632c[_0x50b2('0x1c')];if(!_0x34d24e[_0x50b2('0x1e')]['hasOwnProperty'](_0x50b2('0x23'))){_0x5ec733[_0x50b2('0xd')]=qs['limit'](_0x34d24e['query'][_0x50b2('0xd')]);_0x5ec733[_0x50b2('0xb')]=qs[_0x50b2('0xb')](_0x34d24e['query'][_0x50b2('0xb')]);}_0x5ec733[_0x50b2('0x24')]=qs[_0x50b2('0x25')](_0x34d24e[_0x50b2('0x1e')][_0x50b2('0x25')]);_0x5ec733[_0x50b2('0x26')]=qs[_0x50b2('0x27')](_[_0x50b2('0x28')](_0x34d24e[_0x50b2('0x1e')],_0x3a632c[_0x50b2('0x27')]),_0x3968c4);if(_0x34d24e[_0x50b2('0x1e')]['filter']){_0x5ec733[_0x50b2('0x26')]=_[_0x50b2('0x29')](_0x5ec733[_0x50b2('0x26')],{'$or':_[_0x50b2('0x1d')](_0x3968c4,function(_0x17d11d){if(_0x17d11d[_0x50b2('0x1a')]!=='VIRTUAL'){var _0x3db1fe={};_0x3db1fe[_0x17d11d['name']]={'$like':'%'+_0x34d24e[_0x50b2('0x1e')][_0x50b2('0x2a')]+'%'};return _0x3db1fe;}})});}_0x5ec733=_[_0x50b2('0x29')]({},_0x5ec733,_0x34d24e['options']);var _0x2cff02={'where':_0x5ec733[_0x50b2('0x26')]};return db[_0x50b2('0x17')][_0x50b2('0xe')](_0x2cff02)[_0x50b2('0x2b')](function(_0x392204){_0x316246['count']=_0x392204;if(_0x34d24e[_0x50b2('0x1e')][_0x50b2('0x2c')]){_0x5ec733[_0x50b2('0x2d')]=[{'all':!![]}];}return db[_0x50b2('0x17')][_0x50b2('0x2e')](_0x5ec733);})[_0x50b2('0x2b')](function(_0x1384ad){_0x316246[_0x50b2('0x2f')]=_['map'](_0x1384ad,function(_0x15c0bf){if(_0x15c0bf[_0x50b2('0x30')]===_0x50b2('0x31')){var _0x5fd966=encryptor[_0x50b2('0x32')](_0x15c0bf[_0x50b2('0x33')]);_0x15c0bf[_0x50b2('0x33')]=maskClientSecret(_0x5fd966);}return _0x15c0bf;});return _0x316246;})[_0x50b2('0x2b')](respondWithFilteredResult(_0xfef346,_0x5ec733))['catch'](handleError(_0xfef346,null));};exports[_0x50b2('0x34')]=function(_0x322c7b,_0x203fa6){var _0x47165a={'raw':!![],'where':{'id':_0x322c7b['params']['id']}},_0x3e9646={};_0x3e9646[_0x50b2('0x1c')]=_[_0x50b2('0x1f')](db['CloudProvider'][_0x50b2('0x18')]);_0x3e9646[_0x50b2('0x1e')]=_['keys'](_0x322c7b[_0x50b2('0x1e')]);_0x3e9646[_0x50b2('0x27')]=_['intersection'](_0x3e9646[_0x50b2('0x1c')],_0x3e9646[_0x50b2('0x1e')]);_0x47165a['attributes']=_['intersection'](_0x3e9646[_0x50b2('0x1c')],qs['fields'](_0x322c7b['query'][_0x50b2('0x22')]));_0x47165a[_0x50b2('0x21')]=_0x47165a[_0x50b2('0x21')][_0x50b2('0x35')]?_0x47165a['attributes']:_0x3e9646[_0x50b2('0x1c')];if(_0x322c7b['query'][_0x50b2('0x2c')]){_0x47165a['include']=[{'all':!![]}];}_0x47165a=_[_0x50b2('0x29')]({},_0x47165a,_0x322c7b[_0x50b2('0x36')]);return db[_0x50b2('0x17')][_0x50b2('0x37')](_0x47165a)[_0x50b2('0x2b')](handleEntityNotFound(_0x203fa6,null))[_0x50b2('0x2b')](function(_0x2d5308){if(_0x2d5308[_0x50b2('0x30')]===_0x50b2('0x31')){var _0x5976f5=encryptor['decryptString'](_0x2d5308[_0x50b2('0x33')]);_0x2d5308[_0x50b2('0x33')]=maskClientSecret(_0x5976f5);}return _0x2d5308;})[_0x50b2('0x2b')](respondWithResult(_0x203fa6,null))['catch'](handleError(_0x203fa6,null));};exports[_0x50b2('0x38')]=function(_0x4e7a3d,_0x2e96e2){if(!_0x4e7a3d[_0x50b2('0x39')][_0x50b2('0x14')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x4e7a3d[_0x50b2('0x39')][_0x50b2('0x30')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x1112ce=db[_0x50b2('0x17')][_0x50b2('0x18')][_0x50b2('0x30')][_0x50b2('0x3a')];if(!_0x1112ce[_0x50b2('0x3b')](_0x4e7a3d['body']['service']))throw new Error(_0x50b2('0x3c')+_0x1112ce['join'](',\x20'));if(_0x4e7a3d[_0x50b2('0x39')][_0x50b2('0x30')]===_0x50b2('0x31')&&_0x4e7a3d[_0x50b2('0x39')][_0x50b2('0x33')]){_0x4e7a3d['body']['data3']=encryptor[_0x50b2('0x3d')](_0x4e7a3d[_0x50b2('0x39')][_0x50b2('0x33')]);}return db['CloudProvider']['create'](_0x4e7a3d['body'],{})[_0x50b2('0x2b')](respondWithResult(_0x2e96e2,0xc9))[_0x50b2('0x3e')](handleError(_0x2e96e2,null));};exports['update']=function(_0x48ce08,_0x4e434f){if(_0x48ce08[_0x50b2('0x39')]['id']){delete _0x48ce08[_0x50b2('0x39')]['id'];}return db['CloudProvider'][_0x50b2('0x37')]({'where':{'id':_0x48ce08['params']['id']}})['then'](handleEntityNotFound(_0x4e434f,null))[_0x50b2('0x2b')](function(_0x50581e){if(_0x50581e[_0x50b2('0x30')]==='MicrosoftAzure'&&_0x48ce08[_0x50b2('0x39')][_0x50b2('0x33')]){_0x48ce08['body'][_0x50b2('0x33')]=encryptor[_0x50b2('0x3d')](_0x48ce08[_0x50b2('0x39')][_0x50b2('0x33')]);}return _0x50581e;})[_0x50b2('0x2b')](saveUpdates(_0x48ce08['body'],null))['then'](respondWithResult(_0x4e434f,null))[_0x50b2('0x3e')](handleError(_0x4e434f,null));};exports[_0x50b2('0x11')]=function(_0x1af08d,_0x144e71){return db[_0x50b2('0x17')][_0x50b2('0x37')]({'where':{'id':_0x1af08d[_0x50b2('0x3f')]['id']}})[_0x50b2('0x2b')](handleEntityNotFound(_0x144e71,null))[_0x50b2('0x2b')](removeEntity(_0x144e71,null))['catch'](handleError(_0x144e71,null));};exports[_0x50b2('0x40')]=function(_0x58fad1,_0x13367e){return db[_0x50b2('0x17')]['findOne']({'where':{'id':_0x58fad1[_0x50b2('0x3f')]['id']},'raw':!![]})[_0x50b2('0x2b')](function(_0x393c82){if(!_0x393c82)return _0x13367e[_0x50b2('0x8')](0x194);return{'url':oauth[_0x50b2('0x41')](_0x393c82,_0x58fad1[_0x50b2('0x42')]['id'])};})[_0x50b2('0x2b')](respondWithResult(_0x13367e,null))[_0x50b2('0x3e')](handleError(_0x13367e,null));};exports[_0x50b2('0x43')]=function(_0x505ae7,_0x17d57c){var _0x3839fc=_0x505ae7[_0x50b2('0x39')];var _0x2bfc3c;var _0x1324b8;if(_0x3839fc['error'])throw _0x3839fc;redis['get'](_0x3839fc[_0x50b2('0x44')])[_0x50b2('0x2b')](function(_0x380491){if(!_0x380491)throw new Error(_0x50b2('0x45'));_0x2bfc3c=JSON[_0x50b2('0x46')](_0x380491);var _0x31d337=Buffer[_0x50b2('0x47')](_0x3839fc[_0x50b2('0x44')],_0x50b2('0x48'))[_0x50b2('0x49')](_0x50b2('0x4a'));_0x1324b8=JSON[_0x50b2('0x46')](_0x31d337);if(!oauth[_0x50b2('0x4b')](_0x3839fc[_0x50b2('0x4c')],_0x2bfc3c[_0x50b2('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x50b2('0x4e')](_0x3839fc[_0x50b2('0x44')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3839fc[_0x50b2('0x4f')],_0x2bfc3c);})['then'](function(_0x4edeb8){_0x2bfc3c[_0x50b2('0x50')]=_0x4edeb8[_0x50b2('0x51')];_0x2bfc3c[_0x50b2('0x52')]=_0x4edeb8[_0x50b2('0x53')];return db[_0x50b2('0x17')][_0x50b2('0x10')]({'data5':_0x2bfc3c[_0x50b2('0x50')],'data6':_0x2bfc3c['data6']},{'where':{'id':_0x2bfc3c['id']}});})[_0x50b2('0x2b')](function(){oauth['startRefreshInterval'](_0x2bfc3c);socket[_0x50b2('0x54')](_0x50b2('0x55'),{'id':_0x1324b8['id']});return;})[_0x50b2('0x2b')](respondWithStatusCode(_0x17d57c,null))[_0x50b2('0x3e')](function(_0x490795){if(_0x1324b8){socket['emit'](_0x50b2('0x56'),{'id':_0x1324b8['id']});}if(!_0x2bfc3c){logger[_0x50b2('0x57')]('Invalid\x20authentication\x20state\x20parameter',_0x490795);return _0x17d57c[_0x50b2('0x9')](0x1f4)[_0x50b2('0x58')](_0x490795['message']);}logger[_0x50b2('0x57')](_0x50b2('0x59'),_0x2bfc3c['id'],JSON[_0x50b2('0x5a')](_0x490795));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index fa9cf59..07d4813 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd227=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x3bad89,_0x391f87){var _0x44f4c5=function(_0x549044){while(--_0x549044){_0x3bad89['push'](_0x3bad89['shift']());}};_0x44f4c5(++_0x391f87);}(_0xd227,0x178));var _0x7d22=function(_0x587783,_0x6296e6){_0x587783=_0x587783-0x0;var _0x1cca44=_0xd227[_0x587783];return _0x1cca44;};'use strict';var _=require(_0x7d22('0x0'));var util=require(_0x7d22('0x1'));var logger=require(_0x7d22('0x2'))(_0x7d22('0x3'));var moment=require(_0x7d22('0x4'));var BPromise=require(_0x7d22('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d22('0x6'));var rimraf=require('rimraf');var config=require(_0x7d22('0x7'));var attributes=require(_0x7d22('0x8'));module[_0x7d22('0x9')]=function(_0x2338e1,_0x2cf66c){return _0x2338e1[_0x7d22('0xa')](_0x7d22('0xb'),attributes,{'tableName':_0x7d22('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0976=['rimraf','./cloudProvider.attributes','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x0976,0x1e8));var _0x6097=function(_0x5d520f,_0x8422d1){_0x5d520f=_0x5d520f-0x0;var _0x16e308=_0x0976[_0x5d520f];return _0x16e308;};'use strict';var _=require(_0x6097('0x0'));var util=require(_0x6097('0x1'));var logger=require(_0x6097('0x2'))('api');var moment=require(_0x6097('0x3'));var BPromise=require(_0x6097('0x4'));var rp=require(_0x6097('0x5'));var fs=require('fs');var path=require(_0x6097('0x6'));var rimraf=require(_0x6097('0x7'));var config=require('../../config/environment');var attributes=require(_0x6097('0x8'));module['exports']=function(_0x4c832a,_0x329972){return _0x4c832a['define']('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 0ca1cb4..30c8f9f 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5b7=['POST','{TENANT_ID}','data5','access_token','data6','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','code','stringify','toString','base64','hex','client_id','response_type','redirect_uri','data4','form_post','scope','state','nonce','prompt','login','value','oauth2/','data1','set','decode','payload','iss','issuer','audience','data3','CloudProvider','then','refresh_token','decryptString'];(function(_0x4f1e96,_0x3bd758){var _0x974e38=function(_0x470d29){while(--_0x470d29){_0x4f1e96['push'](_0x4f1e96['shift']());}};_0x974e38(++_0x3bd758);}(_0xd5b7,0xf4));var _0x7d5b=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0xd5b7[_0x22b39b];return _0x280e1d;};'use strict';var _=require('lodash');var crypto=require(_0x7d5b('0x0'));var jwt=require('jsonwebtoken');var moment=require(_0x7d5b('0x1'));var Redis=require(_0x7d5b('0x2'));var rp=require(_0x7d5b('0x3'));var util=require(_0x7d5b('0x4'));var encryptor=require(_0x7d5b('0x5'));var config=require(_0x7d5b('0x6'));var logger=require('../../config/logger')(_0x7d5b('0x7'));var schedule=require(_0x7d5b('0x8'));var db=require(_0x7d5b('0x9'))['db'];config[_0x7d5b('0xa')]=_[_0x7d5b('0xb')](config[_0x7d5b('0xa')],{'host':_0x7d5b('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x7d5b('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7d5b('0xe'),_0x7d5b('0xf'),'email','offline_access',_0x7d5b('0x10'),_0x7d5b('0x11'),_0x7d5b('0x12')],'Dynamics365':[_0x7d5b('0xe'),_0x7d5b('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x7d5b('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1a978d){var _0x1bc672=_[_0x7d5b('0x15')](AZURE_AUTH_SCOPES[_0x1a978d[_0x7d5b('0x16')]]);if(_0x1a978d[_0x7d5b('0x16')]===_0x7d5b('0x17'))_0x1bc672[_0x7d5b('0x18')](_0x1a978d[_0x7d5b('0x19')]+_0x7d5b('0x1a'));return _0x1bc672[_0x7d5b('0x1b')]('\x20');}function getAccessTokenScope(_0x1a671d){if(_0x1a671d[_0x7d5b('0x16')]===_0x7d5b('0x1c'))return _0x7d5b('0x10');if(_0x1a671d[_0x7d5b('0x16')]===_0x7d5b('0x17'))return _0x1a671d[_0x7d5b('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x13284f,_0x4a6201){var _0x33683b=MICROSOFT_AUTH_URL[_0x7d5b('0x1d')]('{TENANT_ID}',_0x13284f[_0x7d5b('0x1e')]);var _0x2ca4e9=[_0x7d5b('0x1f'),'id_token'];var _0x43081d=Buffer['from'](JSON[_0x7d5b('0x20')]({'id':_0x4a6201}))[_0x7d5b('0x21')](_0x7d5b('0x22'));var _0x3876d2=crypto['randomBytes'](0x10)[_0x7d5b('0x21')](_0x7d5b('0x23'));var _0x1090a8=getAuthorizationScopes(_0x13284f);var _0x12f835=[{'key':_0x7d5b('0x24'),'value':_0x13284f['data1']},{'key':_0x7d5b('0x25'),'value':encodeURIComponent(_0x2ca4e9[_0x7d5b('0x1b')]('\x20'))},{'key':_0x7d5b('0x26'),'value':_0x13284f[_0x7d5b('0x27')]},{'key':'response_mode','value':_0x7d5b('0x28')},{'key':_0x7d5b('0x29'),'value':encodeURIComponent(_0x1090a8)},{'key':_0x7d5b('0x2a'),'value':_0x43081d},{'key':_0x7d5b('0x2b'),'value':_0x3876d2},{'key':_0x7d5b('0x2c'),'value':_0x7d5b('0x2d')}];var _0x28ce2e=_0x33683b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7d5b('0x15')](_0x12f835,function(_0x222002){return _0x222002['key']+'='+_0x222002[_0x7d5b('0x2e')];})[_0x7d5b('0x1b')]('&');_0x13284f['oauth2Claims']={'issuer':_0x33683b[_0x7d5b('0x1d')](_0x7d5b('0x2f'),''),'audience':_0x13284f[_0x7d5b('0x30')],'state':_0x43081d,'nonce':_0x3876d2};redis[_0x7d5b('0x31')](_0x43081d,JSON[_0x7d5b('0x20')](_0x13284f));return _0x28ce2e;}function isValidIdToken(_0x2c851f,_0x38bc37){try{var _0x2204c7=jwt[_0x7d5b('0x32')](_0x2c851f,{'complete':!![]});var _0x9baab4=_0x2204c7[_0x7d5b('0x33')];if(_0x9baab4[_0x7d5b('0x34')]!==_0x38bc37[_0x7d5b('0x35')])return![];if(_0x9baab4['aud']!==_0x38bc37[_0x7d5b('0x36')])return![];if(_0x9baab4[_0x7d5b('0x2b')]!==_0x38bc37[_0x7d5b('0x2b')])return![];if(moment()['isAfter'](moment['unix'](_0x9baab4['exp'])))return![];return!![];}catch(_0x418fd0){throw _0x418fd0;}}function refreshOauth2MicrosoftAccessToken(_0x453ed9){return Promise['resolve']()['then'](function(){if(_0x453ed9[_0x7d5b('0x37')])return _0x453ed9;return db[_0x7d5b('0x38')]['findOne']({'where':{'id':_0x453ed9['id']},'raw':!![]});})[_0x7d5b('0x39')](function(_0x1a6a11){var _0x2f0665={'grant_type':_0x7d5b('0x3a'),'refresh_token':_0x1a6a11['data6'],'scope':getAccessTokenScope(_0x1a6a11),'redirect_uri':_0x1a6a11[_0x7d5b('0x27')],'client_id':_0x1a6a11['data1'],'client_secret':encryptor[_0x7d5b('0x3b')](_0x1a6a11[_0x7d5b('0x37')])};var _0x2b7330={'method':_0x7d5b('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x7d5b('0x1d')](_0x7d5b('0x3d'),_0x1a6a11[_0x7d5b('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2f0665,'json':!![]};return rp(_0x2b7330);})[_0x7d5b('0x39')](function(_0x44d4ea){_0x453ed9[_0x7d5b('0x3e')]=_0x44d4ea[_0x7d5b('0x3f')];_0x453ed9[_0x7d5b('0x40')]=_0x44d4ea[_0x7d5b('0x3a')];return db[_0x7d5b('0x38')][_0x7d5b('0x41')]({'data5':_0x453ed9[_0x7d5b('0x3e')],'data6':_0x453ed9['data6']},{'where':{'id':_0x453ed9['id']}});})['then'](function(){return _0x453ed9;})['catch'](function(_0x41ecc8){logger[_0x7d5b('0x42')](_0x7d5b('0x43'),_0x453ed9['id'],_0x41ecc8);});}function getOauth2MicrosoftAccessToken(_0xa8c666,_0x10b0f2){var _0x30f9de={'grant_type':_0x7d5b('0x44'),'code':_0xa8c666,'scope':getAccessTokenScope(_0x10b0f2),'redirect_uri':_0x10b0f2[_0x7d5b('0x27')],'client_id':_0x10b0f2[_0x7d5b('0x30')],'client_secret':encryptor[_0x7d5b('0x3b')](_0x10b0f2['data3'])};var _0x3b5e55={'method':_0x7d5b('0x3c'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x10b0f2[_0x7d5b('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x30f9de,'json':!![]};return rp(_0x3b5e55);}function startRefreshInterval(_0x4768d0){var _0x4c3a77=schedule[_0x7d5b('0x45')];if(_0x4c3a77[_0x4768d0['id']])clearInterval(_0x4c3a77[_0x4768d0['id']]);_0x4c3a77[_0x4768d0['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7d5b('0x46')](this,{'id':_0x4768d0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7d5b('0x45')]=_0x4c3a77;}function startAllRefreshIntervals(){return db[_0x7d5b('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7d5b('0x39')](function(_0x3dbd9c){var _0x1ab020=_0x3dbd9c[_0x7d5b('0x15')](function(_0x480100){return refreshOauth2MicrosoftAccessToken(_0x480100)[_0x7d5b('0x39')](function(_0x41fcff){startRefreshInterval(_0x41fcff);});});return Promise[_0x7d5b('0x47')](_0x1ab020);})[_0x7d5b('0x48')](function(_0x4234c4){var _0x601169=_0x4234c4?util[_0x7d5b('0x49')](_0x4234c4,{'showHidden':![],'depth':null}):'';logger['error'](_0x7d5b('0x4a'),_0x601169);});}module[_0x7d5b('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x7837=['data3','CloudProvider','findOne','refresh_token','data6','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','{TENANT_ID}','intervals','bind','all','inspect','exports','lodash','crypto','jsonwebtoken','moment','ioredis','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','defaults','localhost','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/token','map','type','Dynamics365','data7','/.default','Outlook365','replace','data2','code','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','response_type','join','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','value','oauth2Claims','oauth2/','payload','aud','audience','isAfter','unix','exp','resolve','then'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0x7837,0x104));var _0x7783=function(_0x1a15f7,_0x4b1474){_0x1a15f7=_0x1a15f7-0x0;var _0x1dd560=_0x7837[_0x1a15f7];return _0x1dd560;};'use strict';var _=require(_0x7783('0x0'));var crypto=require(_0x7783('0x1'));var jwt=require(_0x7783('0x2'));var moment=require(_0x7783('0x3'));var Redis=require(_0x7783('0x4'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0x7783('0x5'));var config=require(_0x7783('0x6'));var logger=require(_0x7783('0x7'))('api');var schedule=require(_0x7783('0x8'));var db=require(_0x7783('0x9'))['db'];config['redis']=_[_0x7783('0xa')](config['redis'],{'host':_0x7783('0xb'),'port':0x18eb});var redis=new Redis(config[_0x7783('0xc')]);var MICROSOFT_AUTH_URL=_0x7783('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x7783('0xe'),'offline_access',_0x7783('0xf'),_0x7783('0x10'),_0x7783('0x11')],'Dynamics365':[_0x7783('0x12'),_0x7783('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x7783('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x324d50){var _0x5a777b=_[_0x7783('0x15')](AZURE_AUTH_SCOPES[_0x324d50[_0x7783('0x16')]]);if(_0x324d50[_0x7783('0x16')]===_0x7783('0x17'))_0x5a777b['push'](_0x324d50[_0x7783('0x18')]+_0x7783('0x19'));return _0x5a777b['join']('\x20');}function getAccessTokenScope(_0x42fbf2){if(_0x42fbf2['type']===_0x7783('0x1a'))return _0x7783('0xf');if(_0x42fbf2[_0x7783('0x16')]===_0x7783('0x17'))return _0x42fbf2['data7']+_0x7783('0x19');}function generateMicrosoftAuthorizationUrl(_0xc45502,_0x42e23f){var _0x3169ce=MICROSOFT_AUTH_URL[_0x7783('0x1b')]('{TENANT_ID}',_0xc45502[_0x7783('0x1c')]);var _0x2a97bb=[_0x7783('0x1d'),_0x7783('0x1e')];var _0x57a99b=Buffer[_0x7783('0x1f')](JSON[_0x7783('0x20')]({'id':_0x42e23f}))['toString'](_0x7783('0x21'));var _0x474bf0=crypto[_0x7783('0x22')](0x10)[_0x7783('0x23')](_0x7783('0x24'));var _0x48c979=getAuthorizationScopes(_0xc45502);var _0x1a3ca5=[{'key':_0x7783('0x25'),'value':_0xc45502[_0x7783('0x26')]},{'key':_0x7783('0x27'),'value':encodeURIComponent(_0x2a97bb[_0x7783('0x28')]('\x20'))},{'key':_0x7783('0x29'),'value':_0xc45502[_0x7783('0x2a')]},{'key':_0x7783('0x2b'),'value':_0x7783('0x2c')},{'key':'scope','value':encodeURIComponent(_0x48c979)},{'key':_0x7783('0x2d'),'value':_0x57a99b},{'key':_0x7783('0x2e'),'value':_0x474bf0},{'key':_0x7783('0x2f'),'value':_0x7783('0x30')}];var _0x6a23cd=_0x3169ce+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7783('0x15')](_0x1a3ca5,function(_0x12f197){return _0x12f197['key']+'='+_0x12f197[_0x7783('0x31')];})[_0x7783('0x28')]('&');_0xc45502[_0x7783('0x32')]={'issuer':_0x3169ce['replace'](_0x7783('0x33'),''),'audience':_0xc45502['data1'],'state':_0x57a99b,'nonce':_0x474bf0};redis['set'](_0x57a99b,JSON[_0x7783('0x20')](_0xc45502));return _0x6a23cd;}function isValidIdToken(_0x5134a4,_0xc2668e){try{var _0x3193a8=jwt['decode'](_0x5134a4,{'complete':!![]});var _0x3ed03c=_0x3193a8[_0x7783('0x34')];if(_0x3ed03c['iss']!==_0xc2668e['issuer'])return![];if(_0x3ed03c[_0x7783('0x35')]!==_0xc2668e[_0x7783('0x36')])return![];if(_0x3ed03c[_0x7783('0x2e')]!==_0xc2668e['nonce'])return![];if(moment()[_0x7783('0x37')](moment[_0x7783('0x38')](_0x3ed03c[_0x7783('0x39')])))return![];return!![];}catch(_0x2d672d){throw _0x2d672d;}}function refreshOauth2MicrosoftAccessToken(_0x9feabf){return Promise[_0x7783('0x3a')]()[_0x7783('0x3b')](function(){if(_0x9feabf[_0x7783('0x3c')])return _0x9feabf;return db[_0x7783('0x3d')][_0x7783('0x3e')]({'where':{'id':_0x9feabf['id']},'raw':!![]});})[_0x7783('0x3b')](function(_0x56791e){var _0x466309={'grant_type':_0x7783('0x3f'),'refresh_token':_0x56791e[_0x7783('0x40')],'scope':getAccessTokenScope(_0x56791e),'redirect_uri':_0x56791e[_0x7783('0x2a')],'client_id':_0x56791e['data1'],'client_secret':encryptor['decryptString'](_0x56791e[_0x7783('0x3c')])};var _0x1b49c1={'method':_0x7783('0x41'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x56791e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x466309,'json':!![]};return rp(_0x1b49c1);})[_0x7783('0x3b')](function(_0x526931){_0x9feabf[_0x7783('0x42')]=_0x526931[_0x7783('0x43')];_0x9feabf[_0x7783('0x40')]=_0x526931[_0x7783('0x3f')];return db[_0x7783('0x3d')][_0x7783('0x44')]({'data5':_0x9feabf[_0x7783('0x42')],'data6':_0x9feabf[_0x7783('0x40')]},{'where':{'id':_0x9feabf['id']}});})[_0x7783('0x3b')](function(){return _0x9feabf;})[_0x7783('0x45')](function(_0x1fbeb2){logger[_0x7783('0x46')](_0x7783('0x47'),_0x9feabf['id'],_0x1fbeb2);});}function getOauth2MicrosoftAccessToken(_0x134988,_0xc23b77){var _0x486084={'grant_type':_0x7783('0x48'),'code':_0x134988,'scope':getAccessTokenScope(_0xc23b77),'redirect_uri':_0xc23b77[_0x7783('0x2a')],'client_id':_0xc23b77['data1'],'client_secret':encryptor[_0x7783('0x49')](_0xc23b77['data3'])};var _0x4b4743={'method':_0x7783('0x41'),'uri':MICROSOFT_AUTH_URL[_0x7783('0x1b')](_0x7783('0x4a'),_0xc23b77[_0x7783('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x486084,'json':!![]};return rp(_0x4b4743);}function startRefreshInterval(_0x54b4b9){var _0x2a9f39=schedule[_0x7783('0x4b')];if(_0x2a9f39[_0x54b4b9['id']])clearInterval(_0x2a9f39[_0x54b4b9['id']]);_0x2a9f39[_0x54b4b9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7783('0x4c')](this,{'id':_0x54b4b9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x2a9f39;}function startAllRefreshIntervals(){return db[_0x7783('0x3d')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7783('0x3b')](function(_0x1082bb){var _0x2ba5a6=_0x1082bb['map'](function(_0x390e5b){return refreshOauth2MicrosoftAccessToken(_0x390e5b)['then'](function(_0x8c9f5){startRefreshInterval(_0x8c9f5);});});return Promise[_0x7783('0x4d')](_0x2ba5a6);})[_0x7783('0x45')](function(_0x5615bf){var _0x59b954=_0x5615bf?util[_0x7783('0x4e')](_0x5615bf,{'showHidden':![],'depth':null}):'';logger[_0x7783('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x59b954);});}module[_0x7783('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 89b3b15..b022507 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4dcb=['client','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x306df2,_0x3cb11d){var _0x5de872=function(_0x46c775){while(--_0x46c775){_0x306df2['push'](_0x306df2['shift']());}};_0x5de872(++_0x3cb11d);}(_0x4dcb,0x186));var _0xb4dc=function(_0x3e266a,_0x1b3623){_0x3e266a=_0x3e266a-0x0;var _0x51688f=_0x4dcb[_0x3e266a];return _0x51688f;};'use strict';var _=require('lodash');var util=require(_0xb4dc('0x0'));var moment=require(_0xb4dc('0x1'));var BPromise=require(_0xb4dc('0x2'));var rs=require(_0xb4dc('0x3'));var fs=require('fs');var Redis=require(_0xb4dc('0x4'));var db=require(_0xb4dc('0x5'))['db'];var utils=require(_0xb4dc('0x6'));var logger=require(_0xb4dc('0x7'))(_0xb4dc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb4dc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x445f93,_0x14790e,_0x2d4522){return new BPromise(function(_0x34c857,_0x6d25){return client[_0xb4dc('0xa')](_0x445f93,_0x2d4522)['then'](function(_0xa50528){logger[_0xb4dc('0xb')](_0xb4dc('0xc'),_0x14790e,_0xb4dc('0xd'));logger[_0xb4dc('0xe')](_0xb4dc('0xf'),_0x14790e,_0xb4dc('0xd'),JSON[_0xb4dc('0x10')](_0xa50528));if(_0xa50528[_0xb4dc('0x11')]){if(_0xa50528[_0xb4dc('0x11')][_0xb4dc('0x12')]===0x1f4){logger[_0xb4dc('0x11')](_0xb4dc('0xc'),_0x14790e,_0xa50528['error'][_0xb4dc('0x13')]);return _0x6d25(_0xa50528[_0xb4dc('0x11')][_0xb4dc('0x13')]);}logger[_0xb4dc('0x11')](_0xb4dc('0xc'),_0x14790e,_0xa50528['error']['message']);return _0x34c857(_0xa50528[_0xb4dc('0x11')][_0xb4dc('0x13')]);}else{logger[_0xb4dc('0xb')](_0xb4dc('0xc'),_0x14790e,_0xb4dc('0xd'));_0x34c857(_0xa50528[_0xb4dc('0x14')]['message']);}})['catch'](function(_0x301ef4){logger[_0xb4dc('0x11')](_0xb4dc('0xc'),_0x14790e,_0x301ef4);_0x6d25(_0x301ef4);});});} \ No newline at end of file +var _0xa693=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x1d28ca,_0x29bbc5){var _0x33ed76=function(_0x2511ce){while(--_0x2511ce){_0x1d28ca['push'](_0x1d28ca['shift']());}};_0x33ed76(++_0x29bbc5);}(_0xa693,0xf1));var _0x3a69=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xa693[_0x288f5e];return _0x476cc9;};'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});function respondWithRpcPromise(_0x125226,_0x290e84,_0x5e7d90){return new BPromise(function(_0x1d564b,_0x2b8e2e){return client['request'](_0x125226,_0x5e7d90)['then'](function(_0x4e65a5){logger[_0x3a69('0xb')]('CloudProvider,\x20%s,\x20%s',_0x290e84,_0x3a69('0xc'));logger[_0x3a69('0xd')](_0x3a69('0xe'),_0x290e84,_0x3a69('0xc'),JSON[_0x3a69('0xf')](_0x4e65a5));if(_0x4e65a5['error']){if(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x11')]===0x1f4){logger['error'](_0x3a69('0x12'),_0x290e84,_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);return _0x2b8e2e(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);}logger[_0x3a69('0x10')](_0x3a69('0x12'),_0x290e84,_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);return _0x1d564b(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);}else{logger[_0x3a69('0xb')]('CloudProvider,\x20%s,\x20%s',_0x290e84,'request\x20sent');_0x1d564b(_0x4e65a5[_0x3a69('0x14')][_0x3a69('0x13')]);}})[_0x3a69('0x15')](function(_0x24fb29){logger[_0x3a69('0x10')](_0x3a69('0x12'),_0x290e84,_0x24fb29);_0x2b8e2e(_0x24fb29);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index a3741cc..6d55d04 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x1acf8f,_0x27391f){var _0x23d1cd=function(_0x3c8267){while(--_0x3c8267){_0x1acf8f['push'](_0x1acf8f['shift']());}};_0x23d1cd(++_0x27391f);}(_0xadb5,0xad));var _0x5adb=function(_0x2fcd9b,_0x3bb4d3){_0x2fcd9b=_0x2fcd9b-0x0;var _0x413c1c=_0xadb5[_0x2fcd9b];return _0x413c1c;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x56bd67,_0x63aa28){var _0x20a151=function(_0x56badc){while(--_0x56badc){_0x56bd67['push'](_0x56bd67['shift']());}};_0x20a151(++_0x63aa28);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 9fc0387..e270cca 100644 --- a/server/api/cmCompany/cmCompany.attributes.js +++ b/server/api/cmCompany/cmCompany.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87b5=['sequelize','exports','STRING','name'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x87b5,0x160));var _0x587b=function(_0x2312fe,_0x5a4c44){_0x2312fe=_0x2312fe-0x0;var _0x3599ff=_0x87b5[_0x2312fe];return _0x3599ff;};'use strict';var Sequelize=require(_0x587b('0x0'));module[_0x587b('0x1')]={'name':{'type':Sequelize[_0x587b('0x2')],'unique':_0x587b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x587b('0x2')]},'website':{'type':Sequelize[_0x587b('0x2')]},'phone':{'type':Sequelize[_0x587b('0x2')]},'fax':{'type':Sequelize[_0x587b('0x2')]},'type':{'type':Sequelize[_0x587b('0x2')]},'street':{'type':Sequelize[_0x587b('0x2')]},'postalCode':{'type':Sequelize[_0x587b('0x2')]},'city':{'type':Sequelize[_0x587b('0x2')]},'country':{'type':Sequelize[_0x587b('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x587b('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x587b('0x2')]},'sCity':{'type':Sequelize[_0x587b('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x162e=['exports','STRING','name','sequelize'];(function(_0x4d2ed7,_0x1999e5){var _0x12af27=function(_0x28e2d4){while(--_0x28e2d4){_0x4d2ed7['push'](_0x4d2ed7['shift']());}};_0x12af27(++_0x1999e5);}(_0x162e,0x6b));var _0xe162=function(_0x25e33e,_0x4c7bb4){_0x25e33e=_0x25e33e-0x0;var _0x15b216=_0x162e[_0x25e33e];return _0x15b216;};'use strict';var Sequelize=require(_0xe162('0x0'));module[_0xe162('0x1')]={'name':{'type':Sequelize[_0xe162('0x2')],'unique':_0xe162('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe162('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xe162('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe162('0x2')]},'type':{'type':Sequelize[_0xe162('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe162('0x2')]},'city':{'type':Sequelize[_0xe162('0x2')]},'country':{'type':Sequelize[_0xe162('0x2')]},'email':{'type':Sequelize[_0xe162('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe162('0x2')]},'sStreet':{'type':Sequelize[_0xe162('0x2')]},'sPostalCode':{'type':Sequelize[_0xe162('0x2')]},'sCity':{'type':Sequelize[_0xe162('0x2')]},'sCountry':{'type':Sequelize[_0xe162('0x2')]},'description':{'type':Sequelize[_0xe162('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2b07f2f..84efee7 100644 --- a/server/api/cmCompany/cmCompany.controller.js +++ b/server/api/cmCompany/cmCompany.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc09b=['fields','length','nolimit','sort','where','filters','pick','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','rawAttributes','order','filter','map','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','limit','count','set','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','attributes','intersection'];(function(_0x4c5578,_0xf9faa1){var _0x4c0cc5=function(_0x4fbd23){while(--_0x4fbd23){_0x4c5578['push'](_0x4c5578['shift']());}};_0x4c0cc5(++_0xf9faa1);}(_0xc09b,0x18c));var _0xbc09=function(_0x49821a,_0x3fa85c){_0x49821a=_0x49821a-0x0;var _0x53647e=_0xc09b[_0x49821a];return _0x53647e;};'use strict';var emlformat=require(_0xbc09('0x0'));var rimraf=require(_0xbc09('0x1'));var zipdir=require(_0xbc09('0x2'));var jsonpatch=require(_0xbc09('0x3'));var rp=require(_0xbc09('0x4'));var moment=require(_0xbc09('0x5'));var BPromise=require(_0xbc09('0x6'));var Mustache=require(_0xbc09('0x7'));var util=require(_0xbc09('0x8'));var path=require('path');var sox=require(_0xbc09('0x9'));var csv=require(_0xbc09('0xa'));var ejs=require(_0xbc09('0xb'));var fs=require('fs');var fs_extra=require(_0xbc09('0xc'));var _=require(_0xbc09('0xd'));var squel=require(_0xbc09('0xe'));var crypto=require(_0xbc09('0xf'));var jsforce=require(_0xbc09('0x10'));var deskjs=require(_0xbc09('0x11'));var toCsv=require('to-csv');var querystring=require(_0xbc09('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbc09('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbc09('0x14'));var hardwareService=require(_0xbc09('0x15'));var logger=require(_0xbc09('0x16'))(_0xbc09('0x17'));var utils=require(_0xbc09('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbc09('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x109a26,_0x2fa8a9){_0x2fa8a9=_0x2fa8a9||0xcc;return function(_0x585f68){if(_0x585f68){return _0x109a26[_0xbc09('0x1a')](_0x2fa8a9);}return _0x109a26[_0xbc09('0x1b')](_0x2fa8a9)[_0xbc09('0x1c')]();};}function respondWithResult(_0x5bd249,_0x1ead15){_0x1ead15=_0x1ead15||0xc8;return function(_0x28a044){if(_0x28a044){return _0x5bd249[_0xbc09('0x1b')](_0x1ead15)['json'](_0x28a044);}};}function respondWithFilteredResult(_0x557a3b,_0x47e05a){return function(_0x1feef3){if(_0x1feef3){var _0x91dc1b=typeof _0x47e05a[_0xbc09('0x1d')]==='undefined'&&typeof _0x47e05a[_0xbc09('0x1e')]==='undefined';var _0x2a1795=_0x1feef3[_0xbc09('0x1f')];var _0xe4f91b=_0x91dc1b?0x0:_0x47e05a[_0xbc09('0x1d')];var _0x3bd822=_0x91dc1b?_0x1feef3[_0xbc09('0x1f')]:_0x47e05a[_0xbc09('0x1d')]+_0x47e05a[_0xbc09('0x1e')];var _0x2def19;if(_0x3bd822>=_0x2a1795){_0x3bd822=_0x2a1795;_0x2def19=0xc8;}else{_0x2def19=0xce;}_0x557a3b['status'](_0x2def19);return _0x557a3b[_0xbc09('0x20')]('Content-Range',_0xe4f91b+'-'+_0x3bd822+'/'+_0x2a1795)['json'](_0x1feef3);}return null;};}function patchUpdates(_0x4a3636){return function(_0x2637d7){try{jsonpatch[_0xbc09('0x21')](_0x2637d7,_0x4a3636,!![]);}catch(_0x38c558){return BPromise[_0xbc09('0x22')](_0x38c558);}return _0x2637d7[_0xbc09('0x23')]();};}function saveUpdates(_0x371b10,_0x1b1ff1){return function(_0x2cd7ff){if(_0x2cd7ff){return _0x2cd7ff[_0xbc09('0x24')](_0x371b10)[_0xbc09('0x25')](function(_0x2d9115){return _0x2d9115;});}return null;};}function removeEntity(_0x364ccd,_0x57e9bc){return function(_0x37d7d6){if(_0x37d7d6){return _0x37d7d6[_0xbc09('0x26')]()['then'](function(){var _0x48e8ae=_0x37d7d6[_0xbc09('0x27')]({'plain':!![]});var _0x91757e=_0xbc09('0x28');return db[_0xbc09('0x29')][_0xbc09('0x26')]({'where':{'type':_0x91757e,'resourceId':_0x48e8ae['id']}})[_0xbc09('0x25')](function(){return _0x37d7d6;});})[_0xbc09('0x25')](function(){_0x364ccd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d551f,_0x45b748){return function(_0x29ccd3){if(!_0x29ccd3){_0x5d551f[_0xbc09('0x1a')](0x194);}return _0x29ccd3;};}function handleError(_0x73a5bb,_0x51c9f5){_0x51c9f5=_0x51c9f5||0x1f4;return function(_0x576d99){logger[_0xbc09('0x2a')](_0x576d99[_0xbc09('0x2b')]);if(_0x576d99[_0xbc09('0x2c')]){delete _0x576d99[_0xbc09('0x2c')];}_0x73a5bb[_0xbc09('0x1b')](_0x51c9f5)[_0xbc09('0x2d')](_0x576d99);};}exports[_0xbc09('0x2e')]=function(_0x308db4,_0x63f7d9){var _0x2cbb47={},_0x40811a={},_0x5007a6={'count':0x0,'rows':[]};return db[_0xbc09('0x2f')][_0xbc09('0x30')]()['then'](function(_0x45c6c5){_0x40811a[_0xbc09('0x31')]=_[_0xbc09('0x32')](_0x45c6c5);_0x40811a[_0xbc09('0x33')]=_[_0xbc09('0x32')](_0x308db4['query']);_0x40811a['filters']=_['intersection'](_0x40811a[_0xbc09('0x31')],_0x40811a[_0xbc09('0x33')]);_0x2cbb47[_0xbc09('0x34')]=_[_0xbc09('0x35')](_0x40811a[_0xbc09('0x31')],qs['fields'](_0x308db4[_0xbc09('0x33')][_0xbc09('0x36')]));_0x2cbb47[_0xbc09('0x34')]=_0x2cbb47['attributes'][_0xbc09('0x37')]?_0x2cbb47['attributes']:_0x40811a[_0xbc09('0x31')];if(!_0x308db4['query']['hasOwnProperty'](_0xbc09('0x38'))){_0x2cbb47['limit']=qs[_0xbc09('0x1e')](_0x308db4[_0xbc09('0x33')][_0xbc09('0x1e')]);_0x2cbb47[_0xbc09('0x1d')]=qs[_0xbc09('0x1d')](_0x308db4['query']['offset']);}_0x2cbb47['order']=qs[_0xbc09('0x39')](_0x308db4['query'][_0xbc09('0x39')]);_0x2cbb47[_0xbc09('0x3a')]=qs[_0xbc09('0x3b')](_[_0xbc09('0x3c')](_0x308db4[_0xbc09('0x33')],_0x40811a[_0xbc09('0x3b')]),_0x45c6c5);if(_0x308db4[_0xbc09('0x33')]['filter']){_0x2cbb47['where']=_[_0xbc09('0x3d')](_0x2cbb47['where'],{'$or':_['map'](_0x2cbb47[_0xbc09('0x34')],function(_0x139fbd){var _0x151dfb={};_0x151dfb[_0x139fbd]={'$like':'%'+_0x308db4[_0xbc09('0x33')]['filter']+'%'};return _0x151dfb;})});}_0x2cbb47=_[_0xbc09('0x3d')]({},_0x2cbb47,_0x308db4[_0xbc09('0x3e')]);var _0x4c9203={'where':_0x2cbb47[_0xbc09('0x3a')]};return db[_0xbc09('0x2f')][_0xbc09('0x1f')](_0x4c9203)['then'](function(_0x558c57){_0x5007a6[_0xbc09('0x1f')]=_0x558c57;if(_0x308db4[_0xbc09('0x33')][_0xbc09('0x3f')]){_0x2cbb47[_0xbc09('0x40')]=[{'all':!![]}];}return db[_0xbc09('0x2f')][_0xbc09('0x41')](_0x2cbb47);})['then'](function(_0x1560ed){_0x5007a6[_0xbc09('0x42')]=_0x1560ed;return _0x5007a6;})[_0xbc09('0x25')](respondWithFilteredResult(_0x63f7d9,_0x2cbb47))[_0xbc09('0x43')](handleError(_0x63f7d9,null));})['catch'](handleError(_0x63f7d9,null));};exports[_0xbc09('0x44')]=function(_0x1d7ba6,_0x204365){var _0x590653={'raw':![],'where':{'id':_0x1d7ba6[_0xbc09('0x45')]['id']}},_0x446b08={};_0x446b08[_0xbc09('0x31')]=_[_0xbc09('0x32')](db[_0xbc09('0x2f')]['rawAttributes']);_0x446b08[_0xbc09('0x33')]=_[_0xbc09('0x32')](_0x1d7ba6[_0xbc09('0x33')]);_0x446b08[_0xbc09('0x3b')]=_[_0xbc09('0x35')](_0x446b08[_0xbc09('0x31')],_0x446b08['query']);_0x590653[_0xbc09('0x34')]=_[_0xbc09('0x35')](_0x446b08['model'],qs['fields'](_0x1d7ba6[_0xbc09('0x33')]['fields']));_0x590653['attributes']=_0x590653['attributes']['length']?_0x590653['attributes']:_0x446b08[_0xbc09('0x31')];if(_0x1d7ba6[_0xbc09('0x33')][_0xbc09('0x3f')]){_0x590653[_0xbc09('0x40')]=[{'all':!![]}];}_0x590653=_['merge']({},_0x590653,_0x1d7ba6[_0xbc09('0x3e')]);return db['CmCompany']['find'](_0x590653)['then'](handleEntityNotFound(_0x204365,null))[_0xbc09('0x25')](respondWithResult(_0x204365,null))[_0xbc09('0x43')](handleError(_0x204365,null));};exports[_0xbc09('0x46')]=function(_0x4632b8,_0x56adda){return db[_0xbc09('0x2f')][_0xbc09('0x46')](_0x4632b8[_0xbc09('0x47')],{})['then'](function(_0x3ddcd6){var _0x16c09d=_0x4632b8[_0xbc09('0x48')][_0xbc09('0x27')]({'plain':!![]});if(!_0x16c09d)throw new Error(_0xbc09('0x49'));if(_0x16c09d[_0xbc09('0x4a')]===_0xbc09('0x48')){var _0x49ccef=_0x3ddcd6[_0xbc09('0x27')]({'plain':!![]});var _0x152898=_0xbc09('0x28');return db[_0xbc09('0x4b')][_0xbc09('0x4c')]({'where':{'name':_0x152898,'userProfileId':_0x16c09d[_0xbc09('0x4d')]},'raw':!![]})['then'](function(_0x4a0499){if(_0x4a0499&&_0x4a0499[_0xbc09('0x4e')]===0x0){return db[_0xbc09('0x29')][_0xbc09('0x46')]({'name':_0x49ccef['name'],'resourceId':_0x49ccef['id'],'type':_0x4a0499[_0xbc09('0x2c')],'sectionId':_0x4a0499['id']},{})[_0xbc09('0x25')](function(){return _0x3ddcd6;});}else{return _0x3ddcd6;}})[_0xbc09('0x43')](function(_0x51c7c9){logger[_0xbc09('0x2a')](_0xbc09('0x4f'),_0x51c7c9);throw _0x51c7c9;});}return _0x3ddcd6;})[_0xbc09('0x25')](respondWithResult(_0x56adda,0xc9))[_0xbc09('0x43')](handleError(_0x56adda,null));};exports[_0xbc09('0x24')]=function(_0x340087,_0x360e60){if(_0x340087[_0xbc09('0x47')]['id']){delete _0x340087[_0xbc09('0x47')]['id'];}return db[_0xbc09('0x2f')][_0xbc09('0x4c')]({'where':{'id':_0x340087[_0xbc09('0x45')]['id']}})[_0xbc09('0x25')](handleEntityNotFound(_0x360e60,null))[_0xbc09('0x25')](saveUpdates(_0x340087[_0xbc09('0x47')],null))[_0xbc09('0x25')](respondWithResult(_0x360e60,null))['catch'](handleError(_0x360e60,null));};exports[_0xbc09('0x26')]=function(_0x181662,_0x169fe0){return db[_0xbc09('0x2f')][_0xbc09('0x4c')]({'where':{'id':_0x181662['params']['id']}})[_0xbc09('0x25')](handleEntityNotFound(_0x169fe0,null))[_0xbc09('0x25')](removeEntity(_0x169fe0,null))['catch'](handleError(_0x169fe0,null));};exports[_0xbc09('0x30')]=function(_0x4976a3,_0x6d1caa){return db[_0xbc09('0x2f')]['describe']()['then'](respondWithResult(_0x6d1caa,null))[_0xbc09('0x43')](handleError(_0x6d1caa,null));};exports['addContacts']=function(_0x1898e3,_0x271991,_0x238640){return db[_0xbc09('0x50')][_0xbc09('0x4c')]({'where':{'id':_0x1898e3['params']['id']}})[_0xbc09('0x25')](handleEntityNotFound(_0x271991,null))[_0xbc09('0x25')](function(_0x4e7c76){if(_0x4e7c76){return _0x4e7c76[_0xbc09('0x51')](_0x1898e3[_0xbc09('0x47')][_0xbc09('0x52')],_[_0xbc09('0x53')](_0x1898e3[_0xbc09('0x47')],[_0xbc09('0x52'),'id'])||{});}})[_0xbc09('0x25')](respondWithResult(_0x271991,null))[_0xbc09('0x43')](handleError(_0x271991,null));};exports[_0xbc09('0x54')]=function(_0x3cd9c4,_0x1e6875,_0x3256b7){var _0x1543b9={};var _0x425aba={};var _0x15e7ff;var _0xbd819;return db['CmCompany']['findOne']({'where':{'id':_0x3cd9c4[_0xbc09('0x45')]['id']}})[_0xbc09('0x25')](handleEntityNotFound(_0x1e6875,null))[_0xbc09('0x25')](function(_0xb735f5){if(_0xb735f5){_0x15e7ff=_0xb735f5;_0x425aba[_0xbc09('0x31')]=_['keys'](db[_0xbc09('0x50')][_0xbc09('0x55')]);_0x425aba[_0xbc09('0x33')]=_[_0xbc09('0x32')](_0x3cd9c4[_0xbc09('0x33')]);_0x425aba['filters']=_['intersection'](_0x425aba[_0xbc09('0x31')],_0x425aba[_0xbc09('0x33')]);_0x1543b9[_0xbc09('0x34')]=_[_0xbc09('0x35')](_0x425aba[_0xbc09('0x31')],qs['fields'](_0x3cd9c4[_0xbc09('0x33')][_0xbc09('0x36')]));_0x1543b9[_0xbc09('0x34')]=_0x1543b9['attributes'][_0xbc09('0x37')]?_0x1543b9['attributes']:_0x425aba['model'];_0x1543b9[_0xbc09('0x56')]=qs[_0xbc09('0x39')](_0x3cd9c4[_0xbc09('0x33')][_0xbc09('0x39')]);_0x1543b9['where']=qs['filters'](_['pick'](_0x3cd9c4['query'],_0x425aba['filters']));if(_0x3cd9c4[_0xbc09('0x33')][_0xbc09('0x57')]){_0x1543b9[_0xbc09('0x3a')]=_[_0xbc09('0x3d')](_0x1543b9['where'],{'$or':_[_0xbc09('0x58')](_0x1543b9[_0xbc09('0x34')],function(_0x24f232){var _0x397cec={};_0x397cec[_0x24f232]={'$like':'%'+_0x3cd9c4['query'][_0xbc09('0x57')]+'%'};return _0x397cec;})});}_0x1543b9=_[_0xbc09('0x3d')]({},_0x1543b9,_0x3cd9c4[_0xbc09('0x3e')]);return _0x15e7ff[_0xbc09('0x54')](_0x1543b9);}})['then'](function(_0x27374e){if(_0x27374e){_0xbd819=_0x27374e[_0xbc09('0x37')];if(!_0x3cd9c4[_0xbc09('0x33')][_0xbc09('0x59')](_0xbc09('0x38'))){_0x1543b9['limit']=qs[_0xbc09('0x1e')](_0x3cd9c4[_0xbc09('0x33')][_0xbc09('0x1e')]);_0x1543b9['offset']=qs[_0xbc09('0x1d')](_0x3cd9c4[_0xbc09('0x33')]['offset']);}return _0x15e7ff['getContacts'](_0x1543b9);}})[_0xbc09('0x25')](function(_0x2022d6){if(_0x2022d6){return _0x2022d6?{'count':_0xbd819,'rows':_0x2022d6}:null;}})[_0xbc09('0x25')](respondWithResult(_0x1e6875,null))[_0xbc09('0x43')](handleError(_0x1e6875,null));}; \ No newline at end of file +var _0x7c1f=['catch','show','params','rawAttributes','fields','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','Companies','UserProfileResource','end','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','findAll','rows'];(function(_0x54eb72,_0x3e9cf6){var _0x16adc8=function(_0x250302){while(--_0x250302){_0x54eb72['push'](_0x54eb72['shift']());}};_0x16adc8(++_0x3e9cf6);}(_0x7c1f,0xc5));var _0xf7c1=function(_0x2a7f9f,_0x20f33a){_0x2a7f9f=_0x2a7f9f-0x0;var _0x201d29=_0x7c1f[_0x2a7f9f];return _0x201d29;};'use strict';var emlformat=require(_0xf7c1('0x0'));var rimraf=require(_0xf7c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7c1('0x2'));var rp=require('request-promise');var moment=require(_0xf7c1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf7c1('0x4'));var path=require(_0xf7c1('0x5'));var sox=require(_0xf7c1('0x6'));var csv=require(_0xf7c1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf7c1('0x8'));var crypto=require(_0xf7c1('0x9'));var jsforce=require(_0xf7c1('0xa'));var deskjs=require(_0xf7c1('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf7c1('0xc'));var Papa=require('papaparse');var Redis=require(_0xf7c1('0xd'));var authService=require(_0xf7c1('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7c1('0xf'));var logger=require(_0xf7c1('0x10'))(_0xf7c1('0x11'));var utils=require(_0xf7c1('0x12'));var config=require(_0xf7c1('0x13'));var licenseUtil=require(_0xf7c1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b5d51,_0x53eb33){_0x53eb33=_0x53eb33||0xcc;return function(_0x558b22){if(_0x558b22){return _0x5b5d51[_0xf7c1('0x15')](_0x53eb33);}return _0x5b5d51[_0xf7c1('0x16')](_0x53eb33)['end']();};}function respondWithResult(_0x16f360,_0x4c9324){_0x4c9324=_0x4c9324||0xc8;return function(_0x1fee81){if(_0x1fee81){return _0x16f360[_0xf7c1('0x16')](_0x4c9324)[_0xf7c1('0x17')](_0x1fee81);}};}function respondWithFilteredResult(_0xb4c414,_0x1f325e){return function(_0x1ba3fa){if(_0x1ba3fa){var _0x39b56e=typeof _0x1f325e['offset']===_0xf7c1('0x18')&&typeof _0x1f325e[_0xf7c1('0x19')]===_0xf7c1('0x18');var _0x4312e5=_0x1ba3fa[_0xf7c1('0x1a')];var _0x47a530=_0x39b56e?0x0:_0x1f325e[_0xf7c1('0x1b')];var _0x4086c4=_0x39b56e?_0x1ba3fa['count']:_0x1f325e[_0xf7c1('0x1b')]+_0x1f325e['limit'];var _0xdba50e;if(_0x4086c4>=_0x4312e5){_0x4086c4=_0x4312e5;_0xdba50e=0xc8;}else{_0xdba50e=0xce;}_0xb4c414['status'](_0xdba50e);return _0xb4c414[_0xf7c1('0x1c')](_0xf7c1('0x1d'),_0x47a530+'-'+_0x4086c4+'/'+_0x4312e5)[_0xf7c1('0x17')](_0x1ba3fa);}return null;};}function patchUpdates(_0x2693cd){return function(_0x49b1dd){try{jsonpatch[_0xf7c1('0x1e')](_0x49b1dd,_0x2693cd,!![]);}catch(_0x1cc0ce){return BPromise[_0xf7c1('0x1f')](_0x1cc0ce);}return _0x49b1dd[_0xf7c1('0x20')]();};}function saveUpdates(_0x59db9a,_0x186de5){return function(_0x30c9cc){if(_0x30c9cc){return _0x30c9cc['update'](_0x59db9a)[_0xf7c1('0x21')](function(_0x548f54){return _0x548f54;});}return null;};}function removeEntity(_0x104b93,_0x3b2cad){return function(_0x2653d2){if(_0x2653d2){return _0x2653d2[_0xf7c1('0x22')]()[_0xf7c1('0x21')](function(){var _0x843b39=_0x2653d2[_0xf7c1('0x23')]({'plain':!![]});var _0xf7e299=_0xf7c1('0x24');return db[_0xf7c1('0x25')][_0xf7c1('0x22')]({'where':{'type':_0xf7e299,'resourceId':_0x843b39['id']}})[_0xf7c1('0x21')](function(){return _0x2653d2;});})[_0xf7c1('0x21')](function(){_0x104b93[_0xf7c1('0x16')](0xcc)[_0xf7c1('0x26')]();});}};}function handleEntityNotFound(_0x2a411a,_0x4c2cc6){return function(_0x1aa033){if(!_0x1aa033){_0x2a411a[_0xf7c1('0x15')](0x194);}return _0x1aa033;};}function handleError(_0x1ff4bf,_0x172b33){_0x172b33=_0x172b33||0x1f4;return function(_0x500524){logger['error'](_0x500524[_0xf7c1('0x27')]);if(_0x500524[_0xf7c1('0x28')]){delete _0x500524['name'];}_0x1ff4bf[_0xf7c1('0x16')](_0x172b33)[_0xf7c1('0x29')](_0x500524);};}exports[_0xf7c1('0x2a')]=function(_0x55b84e,_0x499b2b){var _0x2fe4b8={},_0x46ddd3={},_0x10af8a={'count':0x0,'rows':[]};return db[_0xf7c1('0x2b')][_0xf7c1('0x2c')]()[_0xf7c1('0x21')](function(_0x38a5bf){_0x46ddd3['model']=_[_0xf7c1('0x2d')](_0x38a5bf);_0x46ddd3[_0xf7c1('0x2e')]=_[_0xf7c1('0x2d')](_0x55b84e[_0xf7c1('0x2e')]);_0x46ddd3[_0xf7c1('0x2f')]=_[_0xf7c1('0x30')](_0x46ddd3[_0xf7c1('0x31')],_0x46ddd3[_0xf7c1('0x2e')]);_0x2fe4b8[_0xf7c1('0x32')]=_[_0xf7c1('0x30')](_0x46ddd3[_0xf7c1('0x31')],qs['fields'](_0x55b84e[_0xf7c1('0x2e')]['fields']));_0x2fe4b8[_0xf7c1('0x32')]=_0x2fe4b8['attributes'][_0xf7c1('0x33')]?_0x2fe4b8[_0xf7c1('0x32')]:_0x46ddd3['model'];if(!_0x55b84e['query'][_0xf7c1('0x34')](_0xf7c1('0x35'))){_0x2fe4b8[_0xf7c1('0x19')]=qs['limit'](_0x55b84e[_0xf7c1('0x2e')][_0xf7c1('0x19')]);_0x2fe4b8['offset']=qs['offset'](_0x55b84e[_0xf7c1('0x2e')][_0xf7c1('0x1b')]);}_0x2fe4b8[_0xf7c1('0x36')]=qs[_0xf7c1('0x37')](_0x55b84e[_0xf7c1('0x2e')][_0xf7c1('0x37')]);_0x2fe4b8[_0xf7c1('0x38')]=qs[_0xf7c1('0x2f')](_[_0xf7c1('0x39')](_0x55b84e['query'],_0x46ddd3[_0xf7c1('0x2f')]),_0x38a5bf);if(_0x55b84e[_0xf7c1('0x2e')][_0xf7c1('0x3a')]){_0x2fe4b8[_0xf7c1('0x38')]=_[_0xf7c1('0x3b')](_0x2fe4b8['where'],{'$or':_[_0xf7c1('0x3c')](_0x2fe4b8['attributes'],function(_0x44eb56){var _0x438354={};_0x438354[_0x44eb56]={'$like':'%'+_0x55b84e[_0xf7c1('0x2e')][_0xf7c1('0x3a')]+'%'};return _0x438354;})});}_0x2fe4b8=_[_0xf7c1('0x3b')]({},_0x2fe4b8,_0x55b84e['options']);var _0x9efd81={'where':_0x2fe4b8['where']};return db[_0xf7c1('0x2b')][_0xf7c1('0x1a')](_0x9efd81)['then'](function(_0x4bbff3){_0x10af8a['count']=_0x4bbff3;if(_0x55b84e['query'][_0xf7c1('0x3d')]){_0x2fe4b8['include']=[{'all':!![]}];}return db[_0xf7c1('0x2b')][_0xf7c1('0x3e')](_0x2fe4b8);})[_0xf7c1('0x21')](function(_0xf44d72){_0x10af8a[_0xf7c1('0x3f')]=_0xf44d72;return _0x10af8a;})[_0xf7c1('0x21')](respondWithFilteredResult(_0x499b2b,_0x2fe4b8))[_0xf7c1('0x40')](handleError(_0x499b2b,null));})['catch'](handleError(_0x499b2b,null));};exports[_0xf7c1('0x41')]=function(_0x54272e,_0x1dcd1e){var _0x170123={'raw':![],'where':{'id':_0x54272e[_0xf7c1('0x42')]['id']}},_0x3001bb={};_0x3001bb[_0xf7c1('0x31')]=_[_0xf7c1('0x2d')](db[_0xf7c1('0x2b')][_0xf7c1('0x43')]);_0x3001bb[_0xf7c1('0x2e')]=_[_0xf7c1('0x2d')](_0x54272e['query']);_0x3001bb[_0xf7c1('0x2f')]=_[_0xf7c1('0x30')](_0x3001bb[_0xf7c1('0x31')],_0x3001bb[_0xf7c1('0x2e')]);_0x170123[_0xf7c1('0x32')]=_[_0xf7c1('0x30')](_0x3001bb[_0xf7c1('0x31')],qs[_0xf7c1('0x44')](_0x54272e[_0xf7c1('0x2e')][_0xf7c1('0x44')]));_0x170123[_0xf7c1('0x32')]=_0x170123[_0xf7c1('0x32')][_0xf7c1('0x33')]?_0x170123['attributes']:_0x3001bb[_0xf7c1('0x31')];if(_0x54272e['query']['includeAll']){_0x170123[_0xf7c1('0x45')]=[{'all':!![]}];}_0x170123=_['merge']({},_0x170123,_0x54272e[_0xf7c1('0x46')]);return db[_0xf7c1('0x2b')][_0xf7c1('0x47')](_0x170123)[_0xf7c1('0x21')](handleEntityNotFound(_0x1dcd1e,null))[_0xf7c1('0x21')](respondWithResult(_0x1dcd1e,null))[_0xf7c1('0x40')](handleError(_0x1dcd1e,null));};exports[_0xf7c1('0x48')]=function(_0x432bf9,_0x1ffd97){return db[_0xf7c1('0x2b')][_0xf7c1('0x48')](_0x432bf9[_0xf7c1('0x49')],{})[_0xf7c1('0x21')](function(_0x40fda9){var _0x1a4926=_0x432bf9[_0xf7c1('0x4a')]['get']({'plain':!![]});if(!_0x1a4926)throw new Error(_0xf7c1('0x4b'));if(_0x1a4926['role']===_0xf7c1('0x4a')){var _0x32d253=_0x40fda9[_0xf7c1('0x23')]({'plain':!![]});var _0x27c030=_0xf7c1('0x24');return db[_0xf7c1('0x4c')][_0xf7c1('0x47')]({'where':{'name':_0x27c030,'userProfileId':_0x1a4926[_0xf7c1('0x4d')]},'raw':!![]})[_0xf7c1('0x21')](function(_0x3fd730){if(_0x3fd730&&_0x3fd730[_0xf7c1('0x4e')]===0x0){return db['UserProfileResource'][_0xf7c1('0x48')]({'name':_0x32d253['name'],'resourceId':_0x32d253['id'],'type':_0x3fd730[_0xf7c1('0x28')],'sectionId':_0x3fd730['id']},{})[_0xf7c1('0x21')](function(){return _0x40fda9;});}else{return _0x40fda9;}})[_0xf7c1('0x40')](function(_0x352773){logger[_0xf7c1('0x4f')](_0xf7c1('0x50'),_0x352773);throw _0x352773;});}return _0x40fda9;})[_0xf7c1('0x21')](respondWithResult(_0x1ffd97,0xc9))[_0xf7c1('0x40')](handleError(_0x1ffd97,null));};exports[_0xf7c1('0x51')]=function(_0x2efd64,_0x3ef215){if(_0x2efd64['body']['id']){delete _0x2efd64[_0xf7c1('0x49')]['id'];}return db['CmCompany'][_0xf7c1('0x47')]({'where':{'id':_0x2efd64['params']['id']}})[_0xf7c1('0x21')](handleEntityNotFound(_0x3ef215,null))[_0xf7c1('0x21')](saveUpdates(_0x2efd64[_0xf7c1('0x49')],null))['then'](respondWithResult(_0x3ef215,null))[_0xf7c1('0x40')](handleError(_0x3ef215,null));};exports[_0xf7c1('0x22')]=function(_0x77e9d5,_0x5780ed){return db[_0xf7c1('0x2b')][_0xf7c1('0x47')]({'where':{'id':_0x77e9d5[_0xf7c1('0x42')]['id']}})[_0xf7c1('0x21')](handleEntityNotFound(_0x5780ed,null))[_0xf7c1('0x21')](removeEntity(_0x5780ed,null))[_0xf7c1('0x40')](handleError(_0x5780ed,null));};exports[_0xf7c1('0x2c')]=function(_0x387192,_0x4386af){return db['CmCompany'][_0xf7c1('0x2c')]()[_0xf7c1('0x21')](respondWithResult(_0x4386af,null))[_0xf7c1('0x40')](handleError(_0x4386af,null));};exports['addContacts']=function(_0x27fa54,_0x53551d,_0x252a2d){return db[_0xf7c1('0x52')][_0xf7c1('0x47')]({'where':{'id':_0x27fa54[_0xf7c1('0x42')]['id']}})[_0xf7c1('0x21')](handleEntityNotFound(_0x53551d,null))[_0xf7c1('0x21')](function(_0x3f9d65){if(_0x3f9d65){return _0x3f9d65['addContacts'](_0x27fa54[_0xf7c1('0x49')][_0xf7c1('0x53')],_[_0xf7c1('0x54')](_0x27fa54[_0xf7c1('0x49')],[_0xf7c1('0x53'),'id'])||{});}})['then'](respondWithResult(_0x53551d,null))[_0xf7c1('0x40')](handleError(_0x53551d,null));};exports[_0xf7c1('0x55')]=function(_0x3b3a04,_0x261921,_0x45cc3d){var _0x18055b={};var _0x265a0e={};var _0x2a4f38;var _0x4a4cbc;return db['CmCompany'][_0xf7c1('0x56')]({'where':{'id':_0x3b3a04[_0xf7c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x261921,null))[_0xf7c1('0x21')](function(_0x4ce645){if(_0x4ce645){_0x2a4f38=_0x4ce645;_0x265a0e[_0xf7c1('0x31')]=_[_0xf7c1('0x2d')](db[_0xf7c1('0x52')][_0xf7c1('0x43')]);_0x265a0e[_0xf7c1('0x2e')]=_['keys'](_0x3b3a04[_0xf7c1('0x2e')]);_0x265a0e[_0xf7c1('0x2f')]=_[_0xf7c1('0x30')](_0x265a0e[_0xf7c1('0x31')],_0x265a0e[_0xf7c1('0x2e')]);_0x18055b[_0xf7c1('0x32')]=_['intersection'](_0x265a0e['model'],qs[_0xf7c1('0x44')](_0x3b3a04[_0xf7c1('0x2e')][_0xf7c1('0x44')]));_0x18055b[_0xf7c1('0x32')]=_0x18055b[_0xf7c1('0x32')][_0xf7c1('0x33')]?_0x18055b['attributes']:_0x265a0e[_0xf7c1('0x31')];_0x18055b[_0xf7c1('0x36')]=qs[_0xf7c1('0x37')](_0x3b3a04[_0xf7c1('0x2e')][_0xf7c1('0x37')]);_0x18055b[_0xf7c1('0x38')]=qs[_0xf7c1('0x2f')](_['pick'](_0x3b3a04['query'],_0x265a0e['filters']));if(_0x3b3a04[_0xf7c1('0x2e')]['filter']){_0x18055b[_0xf7c1('0x38')]=_[_0xf7c1('0x3b')](_0x18055b['where'],{'$or':_[_0xf7c1('0x3c')](_0x18055b['attributes'],function(_0x3f6704){var _0x51de5d={};_0x51de5d[_0x3f6704]={'$like':'%'+_0x3b3a04[_0xf7c1('0x2e')]['filter']+'%'};return _0x51de5d;})});}_0x18055b=_[_0xf7c1('0x3b')]({},_0x18055b,_0x3b3a04[_0xf7c1('0x46')]);return _0x2a4f38[_0xf7c1('0x55')](_0x18055b);}})[_0xf7c1('0x21')](function(_0x2ce2c0){if(_0x2ce2c0){_0x4a4cbc=_0x2ce2c0[_0xf7c1('0x33')];if(!_0x3b3a04['query'][_0xf7c1('0x34')](_0xf7c1('0x35'))){_0x18055b['limit']=qs[_0xf7c1('0x19')](_0x3b3a04[_0xf7c1('0x2e')]['limit']);_0x18055b[_0xf7c1('0x1b')]=qs[_0xf7c1('0x1b')](_0x3b3a04[_0xf7c1('0x2e')][_0xf7c1('0x1b')]);}return _0x2a4f38[_0xf7c1('0x55')](_0x18055b);}})[_0xf7c1('0x21')](function(_0x255d32){if(_0x255d32){return _0x255d32?{'count':_0x4a4cbc,'rows':_0x255d32}:null;}})[_0xf7c1('0x21')](respondWithResult(_0x261921,null))[_0xf7c1('0x40')](handleError(_0x261921,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index d4091dd..b38ddfa 100644 --- a/server/api/cmCompany/cmCompany.model.js +++ b/server/api/cmCompany/cmCompany.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3ed=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger'];(function(_0x54c885,_0x4bcf10){var _0x256fbf=function(_0x163d19){while(--_0x163d19){_0x54c885['push'](_0x54c885['shift']());}};_0x256fbf(++_0x4bcf10);}(_0xc3ed,0x10f));var _0xdc3e=function(_0x40942e,_0x54c755){_0x40942e=_0x40942e-0x0;var _0x5a4935=_0xc3ed[_0x40942e];return _0x5a4935;};'use strict';var _=require(_0xdc3e('0x0'));var util=require('util');var logger=require(_0xdc3e('0x1'))(_0xdc3e('0x2'));var moment=require('moment');var BPromise=require(_0xdc3e('0x3'));var rp=require(_0xdc3e('0x4'));var fs=require('fs');var path=require(_0xdc3e('0x5'));var rimraf=require(_0xdc3e('0x6'));var config=require(_0xdc3e('0x7'));var attributes=require(_0xdc3e('0x8'));module[_0xdc3e('0x9')]=function(_0x9d286d,_0x100786){return _0x9d286d[_0xdc3e('0xa')](_0xdc3e('0xb'),attributes,{'tableName':_0xdc3e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d28=['api','path','../../config/environment','exports','CmCompany','cm_companies','util','../../config/logger'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x3d28,0xd6));var _0x83d2=function(_0x5c1918,_0x4fca67){_0x5c1918=_0x5c1918-0x0;var _0x3d28b6=_0x3d28[_0x5c1918];return _0x3d28b6;};'use strict';var _=require('lodash');var util=require(_0x83d2('0x0'));var logger=require(_0x83d2('0x1'))(_0x83d2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x83d2('0x3'));var rimraf=require('rimraf');var config=require(_0x83d2('0x4'));var attributes=require('./cmCompany.attributes');module[_0x83d2('0x5')]=function(_0x51af66,_0x525236){return _0x51af66['define'](_0x83d2('0x6'),attributes,{'tableName':_0x83d2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 54b0717..f1f7d14 100644 --- a/server/api/cmCompany/cmCompany.rpc.js +++ b/server/api/cmCompany/cmCompany.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3d1=['../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x96aaae,_0x59cc51){var _0x269cdf=function(_0x5ed9ed){while(--_0x5ed9ed){_0x96aaae['push'](_0x96aaae['shift']());}};_0x269cdf(++_0x59cc51);}(_0xe3d1,0x1db));var _0x1e3d=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0xe3d1[_0x5d31f3];return _0x1cc88c;};'use strict';var _=require(_0x1e3d('0x0'));var util=require(_0x1e3d('0x1'));var moment=require(_0x1e3d('0x2'));var BPromise=require(_0x1e3d('0x3'));var rs=require(_0x1e3d('0x4'));var fs=require('fs');var Redis=require(_0x1e3d('0x5'));var db=require(_0x1e3d('0x6'))['db'];var utils=require(_0x1e3d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1e3d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1e3d('0x9')][_0x1e3d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16ed07,_0x3cb800,_0x4ebf5a){return new BPromise(function(_0x1cd783,_0xc2dc84){return client[_0x1e3d('0xb')](_0x16ed07,_0x4ebf5a)[_0x1e3d('0xc')](function(_0x52071d){logger[_0x1e3d('0xd')](_0x1e3d('0xe'),_0x3cb800,_0x1e3d('0xf'));logger[_0x1e3d('0x10')](_0x1e3d('0x11'),_0x3cb800,_0x1e3d('0xf'),JSON[_0x1e3d('0x12')](_0x52071d));if(_0x52071d[_0x1e3d('0x13')]){if(_0x52071d['error'][_0x1e3d('0x14')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x3cb800,_0x52071d[_0x1e3d('0x13')][_0x1e3d('0x15')]);return _0xc2dc84(_0x52071d[_0x1e3d('0x13')][_0x1e3d('0x15')]);}logger[_0x1e3d('0x13')](_0x1e3d('0xe'),_0x3cb800,_0x52071d['error'][_0x1e3d('0x15')]);return _0x1cd783(_0x52071d[_0x1e3d('0x13')][_0x1e3d('0x15')]);}else{logger[_0x1e3d('0xd')](_0x1e3d('0xe'),_0x3cb800,'request\x20sent');_0x1cd783(_0x52071d['result'][_0x1e3d('0x15')]);}})[_0x1e3d('0x16')](function(_0x2b07a3){logger['error'](_0x1e3d('0xe'),_0x3cb800,_0x2b07a3);_0xc2dc84(_0x2b07a3);});});} \ No newline at end of file +var _0x30e1=['rpc','../../config/environment','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x30e1,0x19b));var _0x130e=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x30e1[_0x3a78a0];return _0x48e917;};'use strict';var _=require(_0x130e('0x0'));var util=require(_0x130e('0x1'));var moment=require('moment');var BPromise=require(_0x130e('0x2'));var rs=require(_0x130e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x130e('0x4'))['db'];var utils=require(_0x130e('0x5'));var logger=require(_0x130e('0x6'))(_0x130e('0x7'));var config=require(_0x130e('0x8'));var jayson=require(_0x130e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x265e70,_0x51b853,_0x1b7707){return new BPromise(function(_0xf044ff,_0x549dfc){return client[_0x130e('0xa')](_0x265e70,_0x1b7707)[_0x130e('0xb')](function(_0x56a90c){logger[_0x130e('0xc')](_0x130e('0xd'),_0x51b853,'request\x20sent');logger[_0x130e('0xe')](_0x130e('0xf'),_0x51b853,_0x130e('0x10'),JSON[_0x130e('0x11')](_0x56a90c));if(_0x56a90c[_0x130e('0x12')]){if(_0x56a90c[_0x130e('0x12')][_0x130e('0x13')]===0x1f4){logger[_0x130e('0x12')](_0x130e('0xd'),_0x51b853,_0x56a90c[_0x130e('0x12')][_0x130e('0x14')]);return _0x549dfc(_0x56a90c[_0x130e('0x12')][_0x130e('0x14')]);}logger['error'](_0x130e('0xd'),_0x51b853,_0x56a90c['error']['message']);return _0xf044ff(_0x56a90c[_0x130e('0x12')][_0x130e('0x14')]);}else{logger[_0x130e('0xc')](_0x130e('0xd'),_0x51b853,_0x130e('0x10'));_0xf044ff(_0x56a90c['result'][_0x130e('0x14')]);}})[_0x130e('0x15')](function(_0x3d7fa5){logger[_0x130e('0x12')](_0x130e('0xd'),_0x51b853,_0x3d7fa5);_0x549dfc(_0x3d7fa5);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index d168aa2..bbeb516 100644 --- a/server/api/cmCompany/index.js +++ b/server/api/cmCompany/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae3f=['/:id/contacts','addContacts','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create'];(function(_0x2fd46e,_0xc7f8a5){var _0x260fb5=function(_0x4ccfb1){while(--_0x4ccfb1){_0x2fd46e['push'](_0x2fd46e['shift']());}};_0x260fb5(++_0xc7f8a5);}(_0xae3f,0x115));var _0xfae3=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xae3f[_0x1b6186];return _0x186121;};'use strict';var multer=require('multer');var util=require(_0xfae3('0x0'));var path=require('path');var timeout=require(_0xfae3('0x1'));var express=require(_0xfae3('0x2'));var router=express['Router']();var fs_extra=require(_0xfae3('0x3'));var auth=require(_0xfae3('0x4'));var interaction=require(_0xfae3('0x5'));var config=require(_0xfae3('0x6'));var controller=require('./cmCompany.controller');router[_0xfae3('0x7')]('/',auth[_0xfae3('0x8')](),controller[_0xfae3('0x9')]);router['get'](_0xfae3('0xa'),auth[_0xfae3('0x8')](),controller[_0xfae3('0xb')]);router[_0xfae3('0x7')](_0xfae3('0xc'),auth[_0xfae3('0x8')](),controller[_0xfae3('0xd')]);router[_0xfae3('0x7')]('/:id/contacts',auth[_0xfae3('0x8')](),controller[_0xfae3('0xe')]);router[_0xfae3('0xf')]('/',auth[_0xfae3('0x8')](),controller[_0xfae3('0x10')]);router[_0xfae3('0xf')](_0xfae3('0x11'),auth[_0xfae3('0x8')](),controller[_0xfae3('0x12')]);router['put']('/:id',auth[_0xfae3('0x8')](),controller['update']);router['delete'](_0xfae3('0xc'),auth[_0xfae3('0x8')](),controller[_0xfae3('0x13')]);module[_0xfae3('0x14')]=router; \ No newline at end of file +var _0xe254=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller'];(function(_0x2e7f96,_0x2ffe43){var _0x315277=function(_0x26bcae){while(--_0x26bcae){_0x2e7f96['push'](_0x2e7f96['shift']());}};_0x315277(++_0x2ffe43);}(_0xe254,0xa8));var _0x4e25=function(_0xc7909f,_0x473d1c){_0xc7909f=_0xc7909f-0x0;var _0x540885=_0xe254[_0xc7909f];return _0x540885;};'use strict';var multer=require(_0x4e25('0x0'));var util=require(_0x4e25('0x1'));var path=require(_0x4e25('0x2'));var timeout=require(_0x4e25('0x3'));var express=require('express');var router=express[_0x4e25('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4e25('0x5'));var interaction=require(_0x4e25('0x6'));var config=require('../../config/environment');var controller=require(_0x4e25('0x7'));router[_0x4e25('0x8')]('/',auth[_0x4e25('0x9')](),controller[_0x4e25('0xa')]);router['get'](_0x4e25('0xb'),auth['isAuthenticated'](),controller[_0x4e25('0xc')]);router[_0x4e25('0x8')](_0x4e25('0xd'),auth[_0x4e25('0x9')](),controller[_0x4e25('0xe')]);router[_0x4e25('0x8')](_0x4e25('0xf'),auth['isAuthenticated'](),controller[_0x4e25('0x10')]);router[_0x4e25('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4e25('0x11')]('/:id/contacts',auth[_0x4e25('0x9')](),controller[_0x4e25('0x12')]);router[_0x4e25('0x13')](_0x4e25('0xd'),auth[_0x4e25('0x9')](),controller[_0x4e25('0x14')]);router[_0x4e25('0x15')](_0x4e25('0xd'),auth[_0x4e25('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 813d959..078fe65 100644 --- a/server/api/cmContact/cmContact.attributes.js +++ b/server/api/cmContact/cmContact.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd07=['INTEGER','UNSIGNED','DATE','NOW','exports','STRING','TEXT'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0xfd07,0x107));var _0x7fd0=function(_0x34473f,_0x2b9c5c){_0x34473f=_0x34473f-0x0;var _0x25cf6f=_0xfd07[_0x34473f];return _0x25cf6f;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x7fd0('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x7fd0('0x1')]},'street':{'type':Sequelize[_0x7fd0('0x1')]},'postalCode':{'type':Sequelize[_0x7fd0('0x1')]},'city':{'type':Sequelize[_0x7fd0('0x1')]},'country':{'type':Sequelize[_0x7fd0('0x1')]},'dateOfBirth':{'type':Sequelize[_0x7fd0('0x1')]},'description':{'type':Sequelize[_0x7fd0('0x2')]},'phone':{'type':Sequelize[_0x7fd0('0x1')]},'mobile':{'type':Sequelize[_0x7fd0('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7fd0('0x1')]},'url':{'type':Sequelize[_0x7fd0('0x1')]},'facebook':{'type':Sequelize[_0x7fd0('0x1')]},'fb_data':{'type':Sequelize[_0x7fd0('0x1')]},'twitter':{'type':Sequelize[_0x7fd0('0x1')]},'skype':{'type':Sequelize[_0x7fd0('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x7fd0('0x1')]},'line':{'type':Sequelize[_0x7fd0('0x1')]},'wechat':{'type':Sequelize[_0x7fd0('0x1')]},'telegram':{'type':Sequelize[_0x7fd0('0x1')]},'UserId':{'type':Sequelize[_0x7fd0('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x7fd0('0x1')]},'priority':{'type':Sequelize[_0x7fd0('0x3')](0x2)[_0x7fd0('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7fd0('0x5')],'defaultValue':Sequelize[_0x7fd0('0x6')]},'dialTimezone':{'type':Sequelize[_0x7fd0('0x1')]},'utcOffset':{'type':Sequelize[_0x7fd0('0x3')]}}; \ No newline at end of file +var _0xffb8=['NOW','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x5fa802,_0x10d6b5){var _0x39ebf1=function(_0x1b845f){while(--_0x1b845f){_0x5fa802['push'](_0x5fa802['shift']());}};_0x39ebf1(++_0x10d6b5);}(_0xffb8,0xc9));var _0x8ffb=function(_0x3a8b4b,_0x4167f5){_0x3a8b4b=_0x3a8b4b-0x0;var _0x2e762c=_0xffb8[_0x3a8b4b];return _0x2e762c;};'use strict';var _=require(_0x8ffb('0x0'));var Sequelize=require(_0x8ffb('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x8ffb('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8ffb('0x2')]},'street':{'type':Sequelize[_0x8ffb('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x8ffb('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8ffb('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x8ffb('0x2')]},'fax':{'type':Sequelize[_0x8ffb('0x2')]},'email':{'type':Sequelize[_0x8ffb('0x2')]},'url':{'type':Sequelize[_0x8ffb('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x8ffb('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8ffb('0x2')]},'teams':{'type':Sequelize[_0x8ffb('0x2')]},'viber':{'type':Sequelize[_0x8ffb('0x2')]},'line':{'type':Sequelize[_0x8ffb('0x2')]},'wechat':{'type':Sequelize[_0x8ffb('0x2')]},'telegram':{'type':Sequelize[_0x8ffb('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x8ffb('0x2')]},'priority':{'type':Sequelize[_0x8ffb('0x4')](0x2)[_0x8ffb('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8ffb('0x6')],'defaultValue':Sequelize[_0x8ffb('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x8ffb('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 0d2c095..c9836c9 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index d9adb88..edf2c0a 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d24=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','CmContact','setMaxListeners','save','update'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1d24,0xae));var _0x41d2=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x1d24[_0x1e3671];return _0x48d5f5;};'use strict';var EventEmitter=require(_0x41d2('0x0'));var CmContact=require(_0x41d2('0x1'))['db'][_0x41d2('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x41d2('0x3')](0x0);var events={'afterCreate':_0x41d2('0x4'),'afterUpdate':_0x41d2('0x5'),'afterDestroy':_0x41d2('0x6')};function emitEvent(_0x2a611c){return function(_0xa18d97,_0x41c3b8,_0x45ee4c){CmContactEvents[_0x41d2('0x7')](_0x2a611c+':'+_0xa18d97['id'],_0xa18d97);CmContactEvents[_0x41d2('0x7')](_0x2a611c,_0xa18d97);_0x45ee4c(null);};}for(var e in events){if(events[_0x41d2('0x8')](e)){var event=events[e];CmContact[_0x41d2('0x9')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x782c=['events','../../mysqldb','CmContact','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x229330,_0x1a4694){var _0x4b663d=function(_0x389e20){while(--_0x389e20){_0x229330['push'](_0x229330['shift']());}};_0x4b663d(++_0x1a4694);}(_0x782c,0x6c));var _0xc782=function(_0x23fed8,_0x40f44e){_0x23fed8=_0x23fed8-0x0;var _0x430b09=_0x782c[_0x23fed8];return _0x430b09;};'use strict';var EventEmitter=require(_0xc782('0x0'));var CmContact=require(_0xc782('0x1'))['db'][_0xc782('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc782('0x3'),'afterUpdate':_0xc782('0x4'),'afterDestroy':_0xc782('0x5')};function emitEvent(_0x399918){return function(_0x236391,_0x145e7a,_0x128b89){CmContactEvents[_0xc782('0x6')](_0x399918+':'+_0x236391['id'],_0x236391);CmContactEvents[_0xc782('0x6')](_0x399918,_0x236391);_0x128b89(null);};}for(var e in events){if(events[_0xc782('0x7')](e)){var event=events[e];CmContact[_0xc782('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 964b341..261b220 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda57=['length','always','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','message','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Error]','util','api','moment','bluebird','request-promise','path','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','firstName','lastName','phone','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','timezones','utcOffset','add','ret','CmHopper','then','cmContact,\x20afterCreate\x20','create','priority','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','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','ListId','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists'];(function(_0x7880d2,_0x32e7d6){var _0x35ebbe=function(_0x5c27fa){while(--_0x5c27fa){_0x7880d2['push'](_0x7880d2['shift']());}};_0x35ebbe(++_0x32e7d6);}(_0xda57,0xf4));var _0x7da5=function(_0x54359c,_0x51944d){_0x54359c=_0x54359c-0x0;var _0xb82fea=_0xda57[_0x54359c];return _0xb82fea;};'use strict';var _=require('lodash');var util=require(_0x7da5('0x0'));var logger=require('../../config/logger')(_0x7da5('0x1'));var moment=require(_0x7da5('0x2'));var BPromise=require(_0x7da5('0x3'));var rp=require(_0x7da5('0x4'));var fs=require('fs');var path=require(_0x7da5('0x5'));var rimraf=require('rimraf');var config=require(_0x7da5('0x6'));var shared=require(_0x7da5('0x7'));var attributes=require(_0x7da5('0x8'));module[_0x7da5('0x9')]=function(_0x544af2,_0x4274e9){return _0x544af2[_0x7da5('0xa')](_0x7da5('0xb'),attributes,{'tableName':_0x7da5('0xc'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':'fti_cm_contacts','fields':[_0x7da5('0xd'),_0x7da5('0xe'),_0x7da5('0xf'),_0x7da5('0x10'),'fax',_0x7da5('0x11')],'type':_0x7da5('0x12')}],'timestamps':!![],'charset':_0x7da5('0x13'),'collate':_0x7da5('0x14'),'hooks':{'afterCreate':function(_0x1fa806,_0x4b1021,_0x527aed){var _0x3821be=_0x544af2[_0x7da5('0x15')];var _0x32ac01=_0x1fa806[_0x7da5('0x16')]({'plain':!![]});function _0x1d2550(){return function(_0x5d2326){logger[_0x7da5('0x17')](_0x7da5('0x18'),_0x7da5('0x19'),util[_0x7da5('0x1a')](_0x5d2326,{'showHidden':![],'depth':null}));};}function _0x372893(_0x376f19,_0x53df76){var _0x598b1a=_0x53df76[_0x7da5('0x1b')]?_0x53df76[_0x7da5('0x1b')]:moment()[_0x7da5('0x1c')](_0x7da5('0x1d'));return new BPromise(function(_0x3a563b,_0xf1b84a){if(_[_0x7da5('0x1e')](_0x53df76[_0x7da5('0x1f')])){_0x3a563b({'ret':_0x598b1a});}else{_0x3821be[_0x7da5('0x20')][_0x7da5('0x21')]({'where':{'id':_0x376f19['id']}})['then'](function(_0x2f63d3){if(!_[_0x7da5('0x1e')](_0x2f63d3)){var _0x2d6058=_0x2f63d3['dialTimezone'];if(!_['isNil'](_0x2d6058)){var _0xd0836=shared[_0x7da5('0x22')];var _0x11d93f=_0xd0836[_0x2d6058];var _0x4ee7aa=_0xd0836[_0x53df76[_0x7da5('0x1f')]];if(!_['isNil'](_0x11d93f)&&!_[_0x7da5('0x1e')](_0x4ee7aa)){var _0x4a57e2=_0x11d93f['utcOffset']-_0x4ee7aa[_0x7da5('0x23')];_0x598b1a=_0x53df76[_0x7da5('0x1b')]?_0x53df76[_0x7da5('0x1b')]:moment();var _0x30de5c=moment(_0x598b1a)[_0x7da5('0x24')](_0x4a57e2,'minutes');_0x3a563b({'ret':_0x30de5c['format'](_0x7da5('0x1d'))});}else _0x3a563b({'ret':_0x598b1a});}else _0x3a563b({'ret':_0x598b1a});}else{_0x3a563b({'ret':_0x598b1a});}});}});return 0xa;}var _0x978707=function(_0x9f2611){return new BPromise(function(_0x2974fb,_0x3f251c){_0x372893(_0x9f2611,_0x32ac01)['then'](function(_0x496c57){_0x32ac01[_0x7da5('0x1b')]=_0x496c57[_0x7da5('0x25')];_0x3821be[_0x7da5('0x26')][_0x7da5('0x21')]({'where':{'phone':_0x32ac01[_0x7da5('0xf')],'VoiceQueueId':_0x9f2611['id']}})[_0x7da5('0x27')](function(_0x1a84c5){if(!_[_0x7da5('0x1e')](_0x1a84c5)){throw new Error(_0x7da5('0x28')+_0x32ac01[_0x7da5('0xf')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x9f2611['id']);}return _0x3821be[_0x7da5('0x26')][_0x7da5('0x29')]({'phone':_0x32ac01['phone'],'ContactId':_0x32ac01['id'],'ListId':_0x32ac01['ListId'],'priority':_0x32ac01['priority']?_0x32ac01[_0x7da5('0x2a')]:0x2,'scheduledat':_0x32ac01[_0x7da5('0x1b')]?_0x32ac01['scheduledat']:moment()[_0x7da5('0x1c')](_0x7da5('0x1d')),'callback':_0x32ac01['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x32ac01['callbackUniqueid']?_0x32ac01[_0x7da5('0x2b')]:undefined,'callbackat':_0x32ac01[_0x7da5('0x2b')]?moment()[_0x7da5('0x1c')](_0x7da5('0x1d')):undefined,'VoiceQueueId':_0x9f2611['id']});})[_0x7da5('0x2c')](function(_0x2ca784){_0x3f251c(_0x2ca784);});});});};var _0x22f00c=function(_0x3d47ec){return new BPromise(function(_0x4915c5,_0xc755f5){_0x372893(_0x3d47ec,_0x32ac01)['then'](function(_0x4e23c9){_0x32ac01[_0x7da5('0x1b')]=_0x4e23c9[_0x7da5('0x25')];_0x3821be[_0x7da5('0x26')][_0x7da5('0x21')]({'where':{'phone':_0x32ac01[_0x7da5('0xf')],'VoiceQueueId':_0x3d47ec['id']}})[_0x7da5('0x27')](function(_0x547f6b){if(!_[_0x7da5('0x1e')](_0x547f6b)){throw new Error(_0x7da5('0x28')+_0x32ac01[_0x7da5('0xf')]+_0x7da5('0x2d')+_0x3d47ec['id']);}return _0x3821be[_0x7da5('0x2e')][_0x7da5('0x21')]({'where':{'calleridnum':_0x32ac01['phone'],'VoiceQueueId':_0x3d47ec['id']}});})['then'](function(_0x3793cd){if(!_[_0x7da5('0x1e')](_0x3793cd)){throw new Error(_0x7da5('0x2f')+_0x32ac01[_0x7da5('0xf')]+_0x7da5('0x30')+_0x3d47ec['id']);}return _0x3821be['CmHopper']['create']({'phone':_0x32ac01[_0x7da5('0xf')],'ContactId':_0x32ac01['id'],'ListId':_0x32ac01['ListId'],'priority':_0x32ac01[_0x7da5('0x2a')]?_0x32ac01[_0x7da5('0x2a')]:0x2,'scheduledat':_0x32ac01['scheduledat']?_0x32ac01[_0x7da5('0x1b')]:moment()[_0x7da5('0x1c')](_0x7da5('0x1d')),'callback':_0x32ac01[_0x7da5('0x2b')]?!![]:![],'callbackuniqueid':_0x32ac01[_0x7da5('0x2b')]?_0x32ac01[_0x7da5('0x2b')]:undefined,'callbackat':_0x32ac01['callbackUniqueid']?moment()[_0x7da5('0x1c')](_0x7da5('0x1d')):undefined,'VoiceQueueId':_0x3d47ec['id']});})[_0x7da5('0x2c')](function(_0xf87e94){_0xc755f5(_0xf87e94);});});});};function _0x67c590(){return function(_0x5aff6d){logger[_0x7da5('0x17')](_0x7da5('0x18'),_0x7da5('0x19'),util['inspect'](_0x5aff6d,{'showHidden':![],'depth':null}));};}function _0x532c25(_0x103a31,_0x4df9c4){var _0x250f0d=_0x4df9c4[_0x7da5('0x1b')]?_0x4df9c4['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x498181,_0x276911){if(_[_0x7da5('0x1e')](_0x4df9c4[_0x7da5('0x1f')])){_0x498181({'ret':_0x250f0d});}else{_0x3821be[_0x7da5('0x31')][_0x7da5('0x21')]({'where':{'id':_0x103a31['id']}})[_0x7da5('0x27')](function(_0x1ca93e){if(!_['isNil'](_0x1ca93e)){var _0x22d4be=_0x1ca93e[_0x7da5('0x1f')];if(!_[_0x7da5('0x1e')](_0x22d4be)){var _0x2078fe=shared[_0x7da5('0x22')];var _0x26e894=_0x2078fe[_0x22d4be];var _0x52a24d=_0x2078fe[_0x4df9c4[_0x7da5('0x1f')]];if(!_['isNil'](_0x26e894)&&!_[_0x7da5('0x1e')](_0x52a24d)){var _0x290313=_0x26e894[_0x7da5('0x23')]-_0x52a24d['utcOffset'];_0x250f0d=_0x4df9c4[_0x7da5('0x1b')]?_0x4df9c4['scheduledat']:moment();var _0x299562=moment(_0x250f0d)['add'](_0x290313,_0x7da5('0x32'));_0x498181({'ret':_0x299562['format'](_0x7da5('0x1d'))});}else _0x498181({'ret':_0x250f0d});}else _0x498181({'ret':_0x250f0d});}else{_0x498181({'ret':_0x250f0d});}});}});return 0xa;}var _0x620055=function(_0x1c1b40){return new BPromise(function(_0x4062ef,_0x1230ac){_0x532c25(_0x1c1b40,_0x32ac01)['then'](function(_0x5e0405){_0x32ac01['scheduledat']=_0x5e0405[_0x7da5('0x25')];_0x3821be[_0x7da5('0x26')][_0x7da5('0x21')]({'where':{'phone':_0x32ac01[_0x7da5('0xf')],'CampaignId':_0x1c1b40['id']}})['then'](function(_0x5d0a49){if(!_['isNil'](_0x5d0a49)){throw new Error(_0x7da5('0x28')+_0x32ac01[_0x7da5('0xf')]+_0x7da5('0x33')+_0x1c1b40['id']);}return _0x3821be['CmHopper']['create']({'phone':_0x32ac01[_0x7da5('0xf')],'ContactId':_0x32ac01['id'],'ListId':_0x32ac01[_0x7da5('0x34')],'priority':_0x32ac01[_0x7da5('0x2a')]?_0x32ac01[_0x7da5('0x2a')]:0x2,'scheduledat':_0x32ac01[_0x7da5('0x1b')]?_0x32ac01[_0x7da5('0x1b')]:moment()[_0x7da5('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x32ac01['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x32ac01[_0x7da5('0x2b')]?_0x32ac01[_0x7da5('0x2b')]:undefined,'callbackat':_0x32ac01['callbackUniqueid']?moment()[_0x7da5('0x1c')](_0x7da5('0x1d')):undefined,'CampaignId':_0x1c1b40['id']});})[_0x7da5('0x2c')](function(_0x13e087){_0x1230ac(_0x13e087);});});});};var _0x5669e0=function(_0x8c73c2){return new BPromise(function(_0x3ddd42,_0x52c1aa){_0x532c25(_0x8c73c2,_0x32ac01)[_0x7da5('0x27')](function(_0x46b0ab){_0x32ac01[_0x7da5('0x1b')]=_0x46b0ab[_0x7da5('0x25')];_0x3821be[_0x7da5('0x26')][_0x7da5('0x21')]({'where':{'phone':_0x32ac01[_0x7da5('0xf')],'CampaignId':_0x8c73c2['id']}})['then'](function(_0x515174){if(!_[_0x7da5('0x1e')](_0x515174)){throw new Error(_0x7da5('0x28')+_0x32ac01[_0x7da5('0xf')]+_0x7da5('0x35')+_0x8c73c2['id']);}return _0x3821be[_0x7da5('0x2e')]['findOne']({'where':{'calleridnum':_0x32ac01['phone'],'CampaignId':_0x8c73c2['id']}});})[_0x7da5('0x27')](function(_0x4c840b){if(!_[_0x7da5('0x1e')](_0x4c840b)){throw new Error(_0x7da5('0x2f')+_0x32ac01['phone']+_0x7da5('0x36')+_0x8c73c2['id']);}return _0x3821be[_0x7da5('0x26')][_0x7da5('0x29')]({'phone':_0x32ac01[_0x7da5('0xf')],'ContactId':_0x32ac01['id'],'ListId':_0x32ac01[_0x7da5('0x34')],'priority':_0x32ac01[_0x7da5('0x2a')]?_0x32ac01[_0x7da5('0x2a')]:0x2,'scheduledat':_0x32ac01[_0x7da5('0x1b')]?_0x32ac01[_0x7da5('0x1b')]:moment()[_0x7da5('0x1c')](_0x7da5('0x1d')),'callback':_0x32ac01[_0x7da5('0x2b')]?!![]:![],'callbackuniqueid':_0x32ac01[_0x7da5('0x2b')]?_0x32ac01[_0x7da5('0x2b')]:undefined,'callbackat':_0x32ac01[_0x7da5('0x2b')]?moment()[_0x7da5('0x1c')](_0x7da5('0x1d')):undefined,'CampaignId':_0x8c73c2['id']});})[_0x7da5('0x2c')](function(_0x42cf5e){_0x52c1aa(_0x42cf5e);});});});};if(_0x32ac01['ListId']){_0x3821be[_0x7da5('0x20')][_0x7da5('0x37')]({'where':{'type':_0x7da5('0x38')},'attributes':['id',_0x7da5('0x39'),_0x7da5('0x1f')],'include':[{'model':_0x3821be[_0x7da5('0x3a')],'as':_0x7da5('0x3b'),'where':{'id':_0x32ac01[_0x7da5('0x34')]}}]})[_0x7da5('0x27')](function(_0x18c198){if(_0x18c198){var _0x5de1d5=[];for(var _0x2afad4=0x0,_0x50b431;_0x2afad4<_0x18c198[_0x7da5('0x3c')];_0x2afad4+=0x1){_0x50b431=_0x18c198[_0x2afad4]['get']({'plain':!![]});switch(_0x50b431[_0x7da5('0x39')]){case _0x7da5('0x3d'):_0x22f00c(_0x50b431)['catch'](_0x1d2550());break;case _0x7da5('0x3e'):_0x978707(_0x50b431)[_0x7da5('0x2c')](_0x1d2550());break;default:_0x532c25(_0x50b431,_0x32ac01)[_0x7da5('0x27')](function(_0x3d52fb){_0x32ac01[_0x7da5('0x1b')]=_0x3d52fb[_0x7da5('0x25')];_0x3821be[_0x7da5('0x26')][_0x7da5('0x29')]({'phone':_0x32ac01[_0x7da5('0xf')],'ContactId':_0x32ac01['id'],'ListId':_0x32ac01[_0x7da5('0x34')],'scheduledat':_0x32ac01['scheduledat']?_0x32ac01['scheduledat']:moment()['format'](_0x7da5('0x1d')),'priority':_0x32ac01[_0x7da5('0x2a')]?_0x32ac01[_0x7da5('0x2a')]:0x2,'callback':_0x32ac01[_0x7da5('0x2b')]?!![]:![],'callbackuniqueid':_0x32ac01[_0x7da5('0x2b')]?_0x32ac01[_0x7da5('0x2b')]:undefined,'callbackat':_0x32ac01[_0x7da5('0x2b')]?moment()[_0x7da5('0x1c')](_0x7da5('0x1d')):undefined,'VoiceQueueId':_0x50b431['id']})[_0x7da5('0x2c')](_0x1d2550());});}}}})[_0x7da5('0x27')](function(){return _0x3821be[_0x7da5('0x20')][_0x7da5('0x37')]({'where':{'type':_0x7da5('0x38')},'attributes':['id'],'include':[{'model':_0x3821be['CmList'],'as':_0x7da5('0x3f'),'where':{'id':_0x32ac01['ListId']}}]})[_0x7da5('0x27')](function(_0x13b97){if(_0x13b97){var _0x477bc1=[];for(var _0x2d5a82=0x0,_0x15442f;_0x2d5a82<_0x13b97[_0x7da5('0x3c')];_0x2d5a82+=0x1){_0x15442f=_0x13b97[_0x2d5a82][_0x7da5('0x16')]({'plain':!![]});_0x3821be['CmHopperBlack'][_0x7da5('0x29')]({'phone':_0x32ac01['phone'],'ContactId':_0x32ac01['id'],'ListId':_0x32ac01['ListId'],'VoiceQueueId':_0x15442f['id']})[_0x7da5('0x2c')](function(_0x2f08b2){logger[_0x7da5('0x17')](_0x7da5('0x40'),_0x7da5('0x19'),_0x2f08b2[_0x7da5('0x41')]);});}}});})[_0x7da5('0x27')](function(){return _0x3821be[_0x7da5('0x31')][_0x7da5('0x37')]({'attributes':['id','dialCheckDuplicateType',_0x7da5('0x1f')],'include':[{'model':_0x3821be[_0x7da5('0x3a')],'as':'Lists','where':{'id':_0x32ac01[_0x7da5('0x34')]}}]})['then'](function(_0x20ec96){if(_0x20ec96){var _0x102fcc=[];for(var _0x24ef67=0x0,_0x55ae02;_0x24ef67<_0x20ec96['length'];_0x24ef67+=0x1){_0x55ae02=_0x20ec96[_0x24ef67][_0x7da5('0x16')]({'plain':!![]});switch(_0x55ae02[_0x7da5('0x39')]){case _0x7da5('0x3d'):_0x5669e0(_0x55ae02)[_0x7da5('0x2c')](_0x67c590());break;case _0x7da5('0x3e'):_0x620055(_0x55ae02)[_0x7da5('0x2c')](_0x67c590());break;default:_0x3821be[_0x7da5('0x26')]['create']({'phone':_0x32ac01[_0x7da5('0xf')],'ContactId':_0x32ac01['id'],'ListId':_0x32ac01[_0x7da5('0x34')],'scheduledat':_0x32ac01[_0x7da5('0x1b')]?_0x32ac01[_0x7da5('0x1b')]:moment()[_0x7da5('0x1c')](_0x7da5('0x1d')),'priority':_0x32ac01[_0x7da5('0x2a')]?_0x32ac01['priority']:0x2,'callback':_0x32ac01['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x32ac01[_0x7da5('0x2b')]?_0x32ac01['callbackUniqueid']:undefined,'callbackat':_0x32ac01[_0x7da5('0x2b')]?moment()[_0x7da5('0x1c')](_0x7da5('0x1d')):undefined,'CampaignId':_0x55ae02['id']})[_0x7da5('0x2c')](_0x67c590());}}}});})[_0x7da5('0x27')](function(){return _0x3821be[_0x7da5('0x31')][_0x7da5('0x37')]({'attributes':['id'],'include':[{'model':_0x3821be[_0x7da5('0x3a')],'as':'BlackLists','where':{'id':_0x32ac01[_0x7da5('0x34')]}}]})[_0x7da5('0x27')](function(_0x27a3fc){if(_0x27a3fc){var _0x4ae759=[];for(var _0x5338c9=0x0,_0x1b0337;_0x5338c9<_0x27a3fc[_0x7da5('0x3c')];_0x5338c9+=0x1){_0x1b0337=_0x27a3fc[_0x5338c9][_0x7da5('0x16')]({'plain':!![]});_0x3821be[_0x7da5('0x42')][_0x7da5('0x29')]({'phone':_0x32ac01[_0x7da5('0xf')],'ContactId':_0x32ac01['id'],'ListId':_0x32ac01[_0x7da5('0x34')],'CampaignId':_0x1b0337['id']})[_0x7da5('0x2c')](function(_0x1bdd03){logger['error'](_0x7da5('0x40'),_0x7da5('0x19'),_0x1bdd03[_0x7da5('0x41')]);});}}});})[_0x7da5('0x27')](function(){_0x527aed();})[_0x7da5('0x2c')](function(_0x346872){logger['error']('cmContact,\x20%s,\x20%s',_0x7da5('0x19'),_0x346872['message']);_0x527aed(_0x346872);});}else{_0x527aed(new Error(_0x7da5('0x43')));}},'afterDestroy':function(_0x423db4,_0x4bb395,_0x1b8986){var _0x18c90b=_0x544af2['models'];var _0x501087=_0x423db4[_0x7da5('0x16')]({'plain':!![]});return _0x18c90b['CmHopper'][_0x7da5('0x37')]({'raw':!![],'where':{'ListId':_0x501087[_0x7da5('0x34')],'ContactId':_0x501087['id']}})['then'](function(_0x5dc45c){if(!_[_0x7da5('0x44')](_0x5dc45c)){var _0xc7bdcd=[];for(var _0x11da30=0x0;_0x11da30<_0x5dc45c[_0x7da5('0x3c')];_0x11da30+=0x1){var _0x2e6077=_0x18c90b[_0x7da5('0x26')][_0x7da5('0x45')]({'where':{'ListId':_0x5dc45c[_0x11da30][_0x7da5('0x34')],'ContactId':_0x5dc45c[_0x11da30][_0x7da5('0x46')],'VoiceQueueId':_0x5dc45c[_0x11da30][_0x7da5('0x47')],'CampaignId':_0x5dc45c[_0x11da30]['CampaignId']}});_0xc7bdcd[_0x7da5('0x48')](_0x2e6077);}return BPromise[_0x7da5('0x49')](_0xc7bdcd);}})[_0x7da5('0x27')](function(_0x6e1b4c){logger[_0x7da5('0x4a')]('[CmContact][afterDestroy][Succesfull]',util[_0x7da5('0x1a')](_0x6e1b4c,{'showHidden':![],'depth':null}));_0x1b8986();})[_0x7da5('0x2c')](function(_0x19539f){logger[_0x7da5('0x17')](_0x7da5('0x4b'),util[_0x7da5('0x1a')](_0x19539f,{'showHidden':![],'depth':null}));_0x1b8986(_0x19539f);});}}});}; \ No newline at end of file +var _0x803d=['ContactId','CampaignId','push','info','[CmContact][afterDestroy][Error]','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','exports','define','phone','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT','models','get','error','afterCreate','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','priority','format','callbackUniqueid','\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','create','ListId','catch','inspect','Campaign','minutes','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','outbound','CmList','dialCheckDuplicateType','always','onlyIfOpen','findAll','CmHopperBlack','Lists','BlackLists','length','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','destroy'];(function(_0x357301,_0x59dcf6){var _0x3cc84d=function(_0x31257f){while(--_0x31257f){_0x357301['push'](_0x357301['shift']());}};_0x3cc84d(++_0x59dcf6);}(_0x803d,0x121));var _0xd803=function(_0x2ad1d1,_0x43c474){_0x2ad1d1=_0x2ad1d1-0x0;var _0x4cb6ef=_0x803d[_0x2ad1d1];return _0x4cb6ef;};'use strict';var _=require(_0xd803('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd803('0x1'));var moment=require(_0xd803('0x2'));var BPromise=require(_0xd803('0x3'));var rp=require(_0xd803('0x4'));var fs=require('fs');var path=require(_0xd803('0x5'));var rimraf=require(_0xd803('0x6'));var config=require(_0xd803('0x7'));var shared=require(_0xd803('0x8'));var attributes=require('./cmContact.attributes');module[_0xd803('0x9')]=function(_0x26edc5,_0x397391){return _0x26edc5[_0xd803('0xa')]('CmContact',attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xd803('0xb'),'fields':[_0xd803('0xb')]},{'name':_0xd803('0xc'),'fields':[_0xd803('0xd'),_0xd803('0xe'),'phone','mobile',_0xd803('0xf'),_0xd803('0x10')],'type':_0xd803('0x11')}],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x75ba6f,_0x49d2fc,_0x56a4ce){var _0x3a208c=_0x26edc5[_0xd803('0x12')];var _0x4e95f6=_0x75ba6f[_0xd803('0x13')]({'plain':!![]});function _0x1a0301(){return function(_0x59e5d5){logger[_0xd803('0x14')]('cmContact',_0xd803('0x15'),util['inspect'](_0x59e5d5,{'showHidden':![],'depth':null}));};}function _0x45199c(_0x1f1da4,_0x2ec611){var _0x40dc5d=_0x2ec611[_0xd803('0x16')]?_0x2ec611[_0xd803('0x16')]:moment()['format'](_0xd803('0x17'));return new BPromise(function(_0x4870ef,_0x39c289){if(_[_0xd803('0x18')](_0x2ec611[_0xd803('0x19')])){_0x4870ef({'ret':_0x40dc5d});}else{_0x3a208c[_0xd803('0x1a')][_0xd803('0x1b')]({'where':{'id':_0x1f1da4['id']}})[_0xd803('0x1c')](function(_0x380af4){if(!_[_0xd803('0x18')](_0x380af4)){var _0x37e9ca=_0x380af4['dialTimezone'];if(!_[_0xd803('0x18')](_0x37e9ca)){var _0x54040b=shared[_0xd803('0x1d')];var _0x189b9d=_0x54040b[_0x37e9ca];var _0x368fda=_0x54040b[_0x2ec611[_0xd803('0x19')]];if(!_[_0xd803('0x18')](_0x189b9d)&&!_[_0xd803('0x18')](_0x368fda)){var _0x5a4a2e=_0x189b9d[_0xd803('0x1e')]-_0x368fda['utcOffset'];_0x40dc5d=_0x2ec611[_0xd803('0x16')]?_0x2ec611['scheduledat']:moment();var _0x56a3ed=moment(_0x40dc5d)[_0xd803('0x1f')](_0x5a4a2e,'minutes');_0x4870ef({'ret':_0x56a3ed['format'](_0xd803('0x17'))});}else _0x4870ef({'ret':_0x40dc5d});}else _0x4870ef({'ret':_0x40dc5d});}else{_0x4870ef({'ret':_0x40dc5d});}});}});return 0xa;}var _0x4d8105=function(_0x53f35e){return new BPromise(function(_0x2bde1f,_0x215cce){_0x45199c(_0x53f35e,_0x4e95f6)[_0xd803('0x1c')](function(_0x6c038c){_0x4e95f6[_0xd803('0x16')]=_0x6c038c['ret'];_0x3a208c['CmHopper'][_0xd803('0x1b')]({'where':{'phone':_0x4e95f6['phone'],'VoiceQueueId':_0x53f35e['id']}})['then'](function(_0x58af58){if(!_[_0xd803('0x18')](_0x58af58)){throw new Error(_0xd803('0x20')+_0x4e95f6[_0xd803('0xb')]+_0xd803('0x21')+_0x53f35e['id']);}return _0x3a208c[_0xd803('0x22')]['create']({'phone':_0x4e95f6['phone'],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6['ListId'],'priority':_0x4e95f6[_0xd803('0x23')]?_0x4e95f6['priority']:0x2,'scheduledat':_0x4e95f6[_0xd803('0x16')]?_0x4e95f6[_0xd803('0x16')]:moment()[_0xd803('0x24')](_0xd803('0x17')),'callback':_0x4e95f6[_0xd803('0x25')]?!![]:![],'callbackuniqueid':_0x4e95f6['callbackUniqueid']?_0x4e95f6[_0xd803('0x25')]:undefined,'callbackat':_0x4e95f6[_0xd803('0x25')]?moment()['format'](_0xd803('0x17')):undefined,'VoiceQueueId':_0x53f35e['id']});})['catch'](function(_0x1548a5){_0x215cce(_0x1548a5);});});});};var _0x2c8e40=function(_0xf370d7){return new BPromise(function(_0x58c032,_0x583333){_0x45199c(_0xf370d7,_0x4e95f6)[_0xd803('0x1c')](function(_0x5907a7){_0x4e95f6[_0xd803('0x16')]=_0x5907a7['ret'];_0x3a208c[_0xd803('0x22')][_0xd803('0x1b')]({'where':{'phone':_0x4e95f6[_0xd803('0xb')],'VoiceQueueId':_0xf370d7['id']}})[_0xd803('0x1c')](function(_0x3fdd74){if(!_['isNil'](_0x3fdd74)){throw new Error(_0xd803('0x20')+_0x4e95f6[_0xd803('0xb')]+_0xd803('0x26')+_0xf370d7['id']);}return _0x3a208c[_0xd803('0x27')]['findOne']({'where':{'calleridnum':_0x4e95f6[_0xd803('0xb')],'VoiceQueueId':_0xf370d7['id']}});})[_0xd803('0x1c')](function(_0x389977){if(!_['isNil'](_0x389977)){throw new Error(_0xd803('0x28')+_0x4e95f6[_0xd803('0xb')]+_0xd803('0x29')+_0xf370d7['id']);}return _0x3a208c[_0xd803('0x22')][_0xd803('0x2a')]({'phone':_0x4e95f6[_0xd803('0xb')],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'priority':_0x4e95f6[_0xd803('0x23')]?_0x4e95f6[_0xd803('0x23')]:0x2,'scheduledat':_0x4e95f6['scheduledat']?_0x4e95f6['scheduledat']:moment()[_0xd803('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4e95f6[_0xd803('0x25')]?!![]:![],'callbackuniqueid':_0x4e95f6[_0xd803('0x25')]?_0x4e95f6[_0xd803('0x25')]:undefined,'callbackat':_0x4e95f6['callbackUniqueid']?moment()[_0xd803('0x24')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0xf370d7['id']});})[_0xd803('0x2c')](function(_0x54cdb5){_0x583333(_0x54cdb5);});});});};function _0x4b8165(){return function(_0x464a5f){logger[_0xd803('0x14')]('cmContact',_0xd803('0x15'),util[_0xd803('0x2d')](_0x464a5f,{'showHidden':![],'depth':null}));};}function _0x1a135a(_0x53299d,_0x1d2e7d){var _0x1178b7=_0x1d2e7d['scheduledat']?_0x1d2e7d[_0xd803('0x16')]:moment()[_0xd803('0x24')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x20d868,_0x1ba1c4){if(_[_0xd803('0x18')](_0x1d2e7d['dialTimezone'])){_0x20d868({'ret':_0x1178b7});}else{_0x3a208c[_0xd803('0x2e')]['findOne']({'where':{'id':_0x53299d['id']}})[_0xd803('0x1c')](function(_0x29a49c){if(!_[_0xd803('0x18')](_0x29a49c)){var _0x488b0b=_0x29a49c[_0xd803('0x19')];if(!_[_0xd803('0x18')](_0x488b0b)){var _0x38f93a=shared['timezones'];var _0x34bf21=_0x38f93a[_0x488b0b];var _0x5abe0b=_0x38f93a[_0x1d2e7d[_0xd803('0x19')]];if(!_[_0xd803('0x18')](_0x34bf21)&&!_[_0xd803('0x18')](_0x5abe0b)){var _0x2d37be=_0x34bf21[_0xd803('0x1e')]-_0x5abe0b[_0xd803('0x1e')];_0x1178b7=_0x1d2e7d[_0xd803('0x16')]?_0x1d2e7d[_0xd803('0x16')]:moment();var _0x5b21f3=moment(_0x1178b7)[_0xd803('0x1f')](_0x2d37be,_0xd803('0x2f'));_0x20d868({'ret':_0x5b21f3[_0xd803('0x24')](_0xd803('0x17'))});}else _0x20d868({'ret':_0x1178b7});}else _0x20d868({'ret':_0x1178b7});}else{_0x20d868({'ret':_0x1178b7});}});}});return 0xa;}var _0x1065b3=function(_0x5555b7){return new BPromise(function(_0x529c25,_0x4745a6){_0x1a135a(_0x5555b7,_0x4e95f6)[_0xd803('0x1c')](function(_0x2e9ef8){_0x4e95f6['scheduledat']=_0x2e9ef8[_0xd803('0x30')];_0x3a208c[_0xd803('0x22')]['findOne']({'where':{'phone':_0x4e95f6[_0xd803('0xb')],'CampaignId':_0x5555b7['id']}})['then'](function(_0x2b2776){if(!_['isNil'](_0x2b2776)){throw new Error(_0xd803('0x20')+_0x4e95f6[_0xd803('0xb')]+_0xd803('0x31')+_0x5555b7['id']);}return _0x3a208c[_0xd803('0x22')][_0xd803('0x2a')]({'phone':_0x4e95f6['phone'],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'priority':_0x4e95f6[_0xd803('0x23')]?_0x4e95f6['priority']:0x2,'scheduledat':_0x4e95f6['scheduledat']?_0x4e95f6['scheduledat']:moment()[_0xd803('0x24')](_0xd803('0x17')),'callback':_0x4e95f6[_0xd803('0x25')]?!![]:![],'callbackuniqueid':_0x4e95f6[_0xd803('0x25')]?_0x4e95f6[_0xd803('0x25')]:undefined,'callbackat':_0x4e95f6[_0xd803('0x25')]?moment()[_0xd803('0x24')](_0xd803('0x17')):undefined,'CampaignId':_0x5555b7['id']});})['catch'](function(_0x5d4db9){_0x4745a6(_0x5d4db9);});});});};var _0x1dd1f8=function(_0x5d789a){return new BPromise(function(_0xd6ee02,_0x3bca4b){_0x1a135a(_0x5d789a,_0x4e95f6)['then'](function(_0x441d42){_0x4e95f6['scheduledat']=_0x441d42[_0xd803('0x30')];_0x3a208c[_0xd803('0x22')][_0xd803('0x1b')]({'where':{'phone':_0x4e95f6[_0xd803('0xb')],'CampaignId':_0x5d789a['id']}})['then'](function(_0x3fd28e){if(!_[_0xd803('0x18')](_0x3fd28e)){throw new Error(_0xd803('0x20')+_0x4e95f6[_0xd803('0xb')]+_0xd803('0x32')+_0x5d789a['id']);}return _0x3a208c['CmHopperFinal'][_0xd803('0x1b')]({'where':{'calleridnum':_0x4e95f6['phone'],'CampaignId':_0x5d789a['id']}});})[_0xd803('0x1c')](function(_0x50e777){if(!_[_0xd803('0x18')](_0x50e777)){throw new Error(_0xd803('0x28')+_0x4e95f6[_0xd803('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x5d789a['id']);}return _0x3a208c['CmHopper'][_0xd803('0x2a')]({'phone':_0x4e95f6[_0xd803('0xb')],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'priority':_0x4e95f6[_0xd803('0x23')]?_0x4e95f6[_0xd803('0x23')]:0x2,'scheduledat':_0x4e95f6['scheduledat']?_0x4e95f6['scheduledat']:moment()['format'](_0xd803('0x17')),'callback':_0x4e95f6[_0xd803('0x25')]?!![]:![],'callbackuniqueid':_0x4e95f6[_0xd803('0x25')]?_0x4e95f6[_0xd803('0x25')]:undefined,'callbackat':_0x4e95f6[_0xd803('0x25')]?moment()[_0xd803('0x24')](_0xd803('0x17')):undefined,'CampaignId':_0x5d789a['id']});})[_0xd803('0x2c')](function(_0x24ae6a){_0x3bca4b(_0x24ae6a);});});});};if(_0x4e95f6['ListId']){_0x3a208c[_0xd803('0x1a')]['findAll']({'where':{'type':_0xd803('0x33')},'attributes':['id','dialCheckDuplicateType',_0xd803('0x19')],'include':[{'model':_0x3a208c[_0xd803('0x34')],'as':'Lists','where':{'id':_0x4e95f6[_0xd803('0x2b')]}}]})[_0xd803('0x1c')](function(_0x35448d){if(_0x35448d){var _0x48d14e=[];for(var _0x51ef6a=0x0,_0x54d47;_0x51ef6a<_0x35448d['length'];_0x51ef6a+=0x1){_0x54d47=_0x35448d[_0x51ef6a][_0xd803('0x13')]({'plain':!![]});switch(_0x54d47[_0xd803('0x35')]){case _0xd803('0x36'):_0x2c8e40(_0x54d47)[_0xd803('0x2c')](_0x1a0301());break;case _0xd803('0x37'):_0x4d8105(_0x54d47)[_0xd803('0x2c')](_0x1a0301());break;default:_0x1a135a(_0x54d47,_0x4e95f6)[_0xd803('0x1c')](function(_0x3fcd74){_0x4e95f6['scheduledat']=_0x3fcd74[_0xd803('0x30')];_0x3a208c[_0xd803('0x22')][_0xd803('0x2a')]({'phone':_0x4e95f6[_0xd803('0xb')],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6['ListId'],'scheduledat':_0x4e95f6['scheduledat']?_0x4e95f6['scheduledat']:moment()['format'](_0xd803('0x17')),'priority':_0x4e95f6['priority']?_0x4e95f6['priority']:0x2,'callback':_0x4e95f6[_0xd803('0x25')]?!![]:![],'callbackuniqueid':_0x4e95f6[_0xd803('0x25')]?_0x4e95f6['callbackUniqueid']:undefined,'callbackat':_0x4e95f6[_0xd803('0x25')]?moment()['format'](_0xd803('0x17')):undefined,'VoiceQueueId':_0x54d47['id']})['catch'](_0x1a0301());});}}}})[_0xd803('0x1c')](function(){return _0x3a208c[_0xd803('0x1a')][_0xd803('0x38')]({'where':{'type':_0xd803('0x33')},'attributes':['id'],'include':[{'model':_0x3a208c[_0xd803('0x34')],'as':'BlackLists','where':{'id':_0x4e95f6[_0xd803('0x2b')]}}]})[_0xd803('0x1c')](function(_0x9e6d97){if(_0x9e6d97){var _0x29ed8a=[];for(var _0x2ece1f=0x0,_0x11719e;_0x2ece1f<_0x9e6d97['length'];_0x2ece1f+=0x1){_0x11719e=_0x9e6d97[_0x2ece1f][_0xd803('0x13')]({'plain':!![]});_0x3a208c[_0xd803('0x39')]['create']({'phone':_0x4e95f6[_0xd803('0xb')],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'VoiceQueueId':_0x11719e['id']})['catch'](function(_0x120521){logger[_0xd803('0x14')]('cmContact,\x20%s,\x20%s','afterCreate',_0x120521['message']);});}}});})[_0xd803('0x1c')](function(){return _0x3a208c[_0xd803('0x2e')][_0xd803('0x38')]({'attributes':['id',_0xd803('0x35'),_0xd803('0x19')],'include':[{'model':_0x3a208c[_0xd803('0x34')],'as':_0xd803('0x3a'),'where':{'id':_0x4e95f6['ListId']}}]})[_0xd803('0x1c')](function(_0xa2563e){if(_0xa2563e){var _0x141b64=[];for(var _0x45b030=0x0,_0x576485;_0x45b030<_0xa2563e['length'];_0x45b030+=0x1){_0x576485=_0xa2563e[_0x45b030][_0xd803('0x13')]({'plain':!![]});switch(_0x576485[_0xd803('0x35')]){case _0xd803('0x36'):_0x1dd1f8(_0x576485)[_0xd803('0x2c')](_0x4b8165());break;case _0xd803('0x37'):_0x1065b3(_0x576485)['catch'](_0x4b8165());break;default:_0x3a208c['CmHopper']['create']({'phone':_0x4e95f6['phone'],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'scheduledat':_0x4e95f6[_0xd803('0x16')]?_0x4e95f6[_0xd803('0x16')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4e95f6[_0xd803('0x23')]?_0x4e95f6[_0xd803('0x23')]:0x2,'callback':_0x4e95f6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4e95f6['callbackUniqueid']?_0x4e95f6['callbackUniqueid']:undefined,'callbackat':_0x4e95f6['callbackUniqueid']?moment()['format'](_0xd803('0x17')):undefined,'CampaignId':_0x576485['id']})[_0xd803('0x2c')](_0x4b8165());}}}});})['then'](function(){return _0x3a208c[_0xd803('0x2e')][_0xd803('0x38')]({'attributes':['id'],'include':[{'model':_0x3a208c[_0xd803('0x34')],'as':_0xd803('0x3b'),'where':{'id':_0x4e95f6[_0xd803('0x2b')]}}]})[_0xd803('0x1c')](function(_0x55faa6){if(_0x55faa6){var _0x551d1d=[];for(var _0x1b55d7=0x0,_0x540fa8;_0x1b55d7<_0x55faa6[_0xd803('0x3c')];_0x1b55d7+=0x1){_0x540fa8=_0x55faa6[_0x1b55d7][_0xd803('0x13')]({'plain':!![]});_0x3a208c['CmHopperBlack'][_0xd803('0x2a')]({'phone':_0x4e95f6[_0xd803('0xb')],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'CampaignId':_0x540fa8['id']})[_0xd803('0x2c')](function(_0x9487c7){logger[_0xd803('0x14')](_0xd803('0x3d'),_0xd803('0x15'),_0x9487c7['message']);});}}});})[_0xd803('0x1c')](function(){_0x56a4ce();})[_0xd803('0x2c')](function(_0x2fd089){logger[_0xd803('0x14')](_0xd803('0x3d'),_0xd803('0x15'),_0x2fd089[_0xd803('0x3e')]);_0x56a4ce(_0x2fd089);});}else{_0x56a4ce(new Error(_0xd803('0x3f')));}},'afterDestroy':function(_0x23eb13,_0x5b3b31,_0x3277a0){var _0x38c191=_0x26edc5[_0xd803('0x12')];var _0x3b4689=_0x23eb13[_0xd803('0x13')]({'plain':!![]});return _0x38c191[_0xd803('0x22')]['findAll']({'raw':!![],'where':{'ListId':_0x3b4689['ListId'],'ContactId':_0x3b4689['id']}})[_0xd803('0x1c')](function(_0x16d790){if(!_[_0xd803('0x40')](_0x16d790)){var _0x5299e1=[];for(var _0xabd05d=0x0;_0xabd05d<_0x16d790[_0xd803('0x3c')];_0xabd05d+=0x1){var _0x3bedb2=_0x38c191[_0xd803('0x22')][_0xd803('0x41')]({'where':{'ListId':_0x16d790[_0xabd05d][_0xd803('0x2b')],'ContactId':_0x16d790[_0xabd05d][_0xd803('0x42')],'VoiceQueueId':_0x16d790[_0xabd05d]['VoiceQueueId'],'CampaignId':_0x16d790[_0xabd05d][_0xd803('0x43')]}});_0x5299e1[_0xd803('0x44')](_0x3bedb2);}return BPromise['all'](_0x5299e1);}})[_0xd803('0x1c')](function(_0x3f76c5){logger[_0xd803('0x45')]('[CmContact][afterDestroy][Succesfull]',util[_0xd803('0x2d')](_0x3f76c5,{'showHidden':![],'depth':null}));_0x3277a0();})[_0xd803('0x2c')](function(_0x413bfa){logger[_0xd803('0x14')](_0xd803('0x46'),util['inspect'](_0x413bfa,{'showHidden':![],'depth':null}));_0x3277a0(_0x413bfa);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index c91d18b..e4b2d53 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x406c09,_0x16e720){var _0x5be749=function(_0x21dacf){while(--_0x21dacf){_0x406c09['push'](_0x406c09['shift']());}};_0x5be749(++_0x16e720);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x54642b,_0x15456b){var _0x35a7ec=function(_0x228a3a){while(--_0x228a3a){_0x54642b['push'](_0x54642b['shift']());}};_0x35a7ec(++_0x15456b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 97ba068..788a729 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25a3=['exports','INTEGER','PHONE','STRING','sequelize'];(function(_0x290694,_0x281935){var _0x5a0f2e=function(_0x58d7d4){while(--_0x58d7d4){_0x290694['push'](_0x290694['shift']());}};_0x5a0f2e(++_0x281935);}(_0x25a3,0x121));var _0x325a=function(_0x427417,_0x3f8be0){_0x427417=_0x427417-0x0;var _0x40259f=_0x25a3[_0x427417];return _0x40259f;};'use strict';var Sequelize=require(_0x325a('0x0'));module[_0x325a('0x1')]={'CmContactId':{'type':Sequelize[_0x325a('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x325a('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x325a('0x3')},'OrderBy':{'type':Sequelize[_0x325a('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x325a('0x4')],'defaultValue':null}}; \ No newline at end of file +var _0x04b8=['PHONE','exports','STRING','INTEGER'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x04b8,0x159));var _0x804b=function(_0x26972c,_0x5d230a){_0x26972c=_0x26972c-0x0;var _0x28e22f=_0x04b8[_0x26972c];return _0x28e22f;};'use strict';var Sequelize=require('sequelize');module[_0x804b('0x0')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x804b('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x804b('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x804b('0x3')},'OrderBy':{'type':Sequelize[_0x804b('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index ac4e920..13265cf 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9dbc=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','CmContactHasItems','UserProfileResource','destroy','stack','name','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring'];(function(_0x1dc29a,_0x1f1951){var _0x1ceeed=function(_0x2aa68d){while(--_0x2aa68d){_0x1dc29a['push'](_0x1dc29a['shift']());}};_0x1ceeed(++_0x1f1951);}(_0x9dbc,0x98));var _0xc9db=function(_0x3841cc,_0x34c50d){_0x3841cc=_0x3841cc-0x0;var _0x4bd9f3=_0x9dbc[_0x3841cc];return _0x4bd9f3;};'use strict';var emlformat=require(_0xc9db('0x0'));var rimraf=require(_0xc9db('0x1'));var zipdir=require(_0xc9db('0x2'));var jsonpatch=require(_0xc9db('0x3'));var rp=require(_0xc9db('0x4'));var moment=require(_0xc9db('0x5'));var BPromise=require(_0xc9db('0x6'));var Mustache=require(_0xc9db('0x7'));var util=require(_0xc9db('0x8'));var path=require('path');var sox=require(_0xc9db('0x9'));var csv=require(_0xc9db('0xa'));var ejs=require(_0xc9db('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9db('0xc'));var squel=require(_0xc9db('0xd'));var crypto=require(_0xc9db('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc9db('0xa'));var querystring=require(_0xc9db('0xf'));var Papa=require(_0xc9db('0x10'));var Redis=require(_0xc9db('0x11'));var authService=require(_0xc9db('0x12'));var qs=require(_0xc9db('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9db('0x14'));var logger=require('../../config/logger')(_0xc9db('0x15'));var utils=require(_0xc9db('0x16'));var config=require(_0xc9db('0x17'));var licenseUtil=require(_0xc9db('0x18'));var db=require(_0xc9db('0x19'))['db'];function respondWithStatusCode(_0x137c5d,_0x529bce){_0x529bce=_0x529bce||0xcc;return function(_0x13e6a3){if(_0x13e6a3){return _0x137c5d[_0xc9db('0x1a')](_0x529bce);}return _0x137c5d[_0xc9db('0x1b')](_0x529bce)[_0xc9db('0x1c')]();};}function respondWithResult(_0x46a742,_0x2599c7){_0x2599c7=_0x2599c7||0xc8;return function(_0x3063c5){if(_0x3063c5){return _0x46a742[_0xc9db('0x1b')](_0x2599c7)[_0xc9db('0x1d')](_0x3063c5);}};}function respondWithFilteredResult(_0x545609,_0x2d27bc){return function(_0x585e0a){if(_0x585e0a){var _0x1d04f8=typeof _0x2d27bc[_0xc9db('0x1e')]===_0xc9db('0x1f')&&typeof _0x2d27bc[_0xc9db('0x20')]===_0xc9db('0x1f');var _0x186a51=_0x585e0a[_0xc9db('0x21')];var _0x484745=_0x1d04f8?0x0:_0x2d27bc[_0xc9db('0x1e')];var _0x2487f9=_0x1d04f8?_0x585e0a[_0xc9db('0x21')]:_0x2d27bc[_0xc9db('0x1e')]+_0x2d27bc[_0xc9db('0x20')];var _0x19998a;if(_0x2487f9>=_0x186a51){_0x2487f9=_0x186a51;_0x19998a=0xc8;}else{_0x19998a=0xce;}_0x545609[_0xc9db('0x1b')](_0x19998a);return _0x545609[_0xc9db('0x22')](_0xc9db('0x23'),_0x484745+'-'+_0x2487f9+'/'+_0x186a51)[_0xc9db('0x1d')](_0x585e0a);}return null;};}function patchUpdates(_0x3a7358){return function(_0x31b1f9){try{jsonpatch[_0xc9db('0x24')](_0x31b1f9,_0x3a7358,!![]);}catch(_0x684ccd){return BPromise['reject'](_0x684ccd);}return _0x31b1f9[_0xc9db('0x25')]();};}function saveUpdates(_0x406a76,_0x4333f8){return function(_0x385fec){if(_0x385fec){return _0x385fec[_0xc9db('0x26')](_0x406a76)[_0xc9db('0x27')](function(_0x7a7a4d){return _0x7a7a4d;});}return null;};}function removeEntity(_0x387dd6,_0x48c5fd){return function(_0x1cb0eb){if(_0x1cb0eb){return _0x1cb0eb['destroy']()['then'](function(){var _0xdb809d=_0x1cb0eb[_0xc9db('0x28')]({'plain':!![]});var _0x5699f7=_0xc9db('0x29');return db[_0xc9db('0x2a')][_0xc9db('0x2b')]({'where':{'type':_0x5699f7,'resourceId':_0xdb809d['id']}})[_0xc9db('0x27')](function(){return _0x1cb0eb;});})['then'](function(){_0x387dd6[_0xc9db('0x1b')](0xcc)[_0xc9db('0x1c')]();});}};}function handleEntityNotFound(_0x18a6af,_0x4c14f1){return function(_0x5e7f5a){if(!_0x5e7f5a){_0x18a6af['sendStatus'](0x194);}return _0x5e7f5a;};}function handleError(_0x29bd98,_0x182225){_0x182225=_0x182225||0x1f4;return function(_0x103527){logger['error'](_0x103527[_0xc9db('0x2c')]);if(_0x103527[_0xc9db('0x2d')]){delete _0x103527[_0xc9db('0x2d')];}_0x29bd98[_0xc9db('0x1b')](_0x182225)['send'](_0x103527);};}exports[_0xc9db('0x2e')]=function(_0x5d6dc6,_0x113e79){var _0x1005ae={},_0x5f4c25={},_0x3eda65={'count':0x0,'rows':[]};var _0x514015=_[_0xc9db('0x2f')](db[_0xc9db('0x30')][_0xc9db('0x31')],function(_0x861dd3){return{'name':_0x861dd3[_0xc9db('0x32')],'type':_0x861dd3[_0xc9db('0x33')][_0xc9db('0x34')]};});_0x5f4c25[_0xc9db('0x35')]=_[_0xc9db('0x2f')](_0x514015,_0xc9db('0x2d'));_0x5f4c25[_0xc9db('0x36')]=_[_0xc9db('0x37')](_0x5d6dc6[_0xc9db('0x36')]);_0x5f4c25[_0xc9db('0x38')]=_[_0xc9db('0x39')](_0x5f4c25[_0xc9db('0x35')],_0x5f4c25[_0xc9db('0x36')]);_0x1005ae[_0xc9db('0x3a')]=_[_0xc9db('0x39')](_0x5f4c25[_0xc9db('0x35')],qs[_0xc9db('0x3b')](_0x5d6dc6[_0xc9db('0x36')][_0xc9db('0x3b')]));_0x1005ae[_0xc9db('0x3a')]=_0x1005ae[_0xc9db('0x3a')]['length']?_0x1005ae['attributes']:_0x5f4c25[_0xc9db('0x35')];if(!_0x5d6dc6[_0xc9db('0x36')]['hasOwnProperty'](_0xc9db('0x3c'))){_0x1005ae['limit']=qs['limit'](_0x5d6dc6['query'][_0xc9db('0x20')]);_0x1005ae['offset']=qs[_0xc9db('0x1e')](_0x5d6dc6['query'][_0xc9db('0x1e')]);}_0x1005ae[_0xc9db('0x3d')]=qs[_0xc9db('0x3e')](_0x5d6dc6[_0xc9db('0x36')]['sort']);_0x1005ae[_0xc9db('0x3f')]=qs[_0xc9db('0x38')](_[_0xc9db('0x40')](_0x5d6dc6['query'],_0x5f4c25['filters']),_0x514015);if(_0x5d6dc6[_0xc9db('0x36')]['filter']){_0x1005ae[_0xc9db('0x3f')]=_[_0xc9db('0x41')](_0x1005ae['where'],{'$or':_[_0xc9db('0x2f')](_0x514015,function(_0xe5d5e3){if(_0xe5d5e3['type']!==_0xc9db('0x42')){var _0x42be32={};_0x42be32[_0xe5d5e3[_0xc9db('0x2d')]]={'$like':'%'+_0x5d6dc6['query'][_0xc9db('0x43')]+'%'};return _0x42be32;}})});}_0x1005ae=_[_0xc9db('0x41')]({},_0x1005ae,_0x5d6dc6[_0xc9db('0x44')]);var _0x40d1d4={'where':_0x1005ae[_0xc9db('0x3f')]};return db[_0xc9db('0x30')][_0xc9db('0x21')](_0x40d1d4)[_0xc9db('0x27')](function(_0x1148c3){_0x3eda65['count']=_0x1148c3;if(_0x5d6dc6[_0xc9db('0x36')][_0xc9db('0x45')]){_0x1005ae[_0xc9db('0x46')]=[{'all':!![]}];}return db[_0xc9db('0x30')][_0xc9db('0x47')](_0x1005ae);})[_0xc9db('0x27')](function(_0x43336b){_0x3eda65[_0xc9db('0x48')]=_0x43336b;return _0x3eda65;})[_0xc9db('0x27')](respondWithFilteredResult(_0x113e79,_0x1005ae))[_0xc9db('0x49')](handleError(_0x113e79,null));};exports[_0xc9db('0x4a')]=function(_0x2304cc,_0x268a57){var _0x54240a={'raw':!![],'where':{'id':_0x2304cc[_0xc9db('0x4b')]['id']}},_0x4f162e={};_0x4f162e[_0xc9db('0x35')]=_['keys'](db[_0xc9db('0x30')]['rawAttributes']);_0x4f162e[_0xc9db('0x36')]=_[_0xc9db('0x37')](_0x2304cc[_0xc9db('0x36')]);_0x4f162e[_0xc9db('0x38')]=_['intersection'](_0x4f162e[_0xc9db('0x35')],_0x4f162e[_0xc9db('0x36')]);_0x54240a[_0xc9db('0x3a')]=_[_0xc9db('0x39')](_0x4f162e[_0xc9db('0x35')],qs[_0xc9db('0x3b')](_0x2304cc[_0xc9db('0x36')][_0xc9db('0x3b')]));_0x54240a[_0xc9db('0x3a')]=_0x54240a[_0xc9db('0x3a')]['length']?_0x54240a[_0xc9db('0x3a')]:_0x4f162e[_0xc9db('0x35')];if(_0x2304cc[_0xc9db('0x36')]['includeAll']){_0x54240a[_0xc9db('0x46')]=[{'all':!![]}];}_0x54240a=_[_0xc9db('0x41')]({},_0x54240a,_0x2304cc[_0xc9db('0x44')]);return db[_0xc9db('0x30')]['find'](_0x54240a)[_0xc9db('0x27')](handleEntityNotFound(_0x268a57,null))['then'](respondWithResult(_0x268a57,null))[_0xc9db('0x49')](handleError(_0x268a57,null));};exports['create']=function(_0x432c6d,_0x23dc8f){return db[_0xc9db('0x30')][_0xc9db('0x4c')](_0x432c6d[_0xc9db('0x4d')],{})[_0xc9db('0x27')](function(_0x5526a9){var _0x158d73=_0x432c6d['user'][_0xc9db('0x28')]({'plain':!![]});if(!_0x158d73)throw new Error(_0xc9db('0x4e'));if(_0x158d73[_0xc9db('0x4f')]===_0xc9db('0x50')){var _0x3abca4=_0x5526a9[_0xc9db('0x28')]({'plain':!![]});var _0x526fde=_0xc9db('0x29');return db['UserProfileSection'][_0xc9db('0x51')]({'where':{'name':_0x526fde,'userProfileId':_0x158d73[_0xc9db('0x52')]},'raw':!![]})[_0xc9db('0x27')](function(_0x405393){if(_0x405393&&_0x405393['autoAssociation']===0x0){return db[_0xc9db('0x2a')][_0xc9db('0x4c')]({'name':_0x3abca4[_0xc9db('0x2d')],'resourceId':_0x3abca4['id'],'type':_0x405393[_0xc9db('0x2d')],'sectionId':_0x405393['id']},{})[_0xc9db('0x27')](function(){return _0x5526a9;});}else{return _0x5526a9;}})[_0xc9db('0x49')](function(_0x564eb5){logger[_0xc9db('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x564eb5);throw _0x564eb5;});}return _0x5526a9;})[_0xc9db('0x27')](respondWithResult(_0x23dc8f,0xc9))[_0xc9db('0x49')](handleError(_0x23dc8f,null));};exports[_0xc9db('0x26')]=function(_0x31a93b,_0x29f4ec){if(_0x31a93b[_0xc9db('0x4d')]['id']){delete _0x31a93b[_0xc9db('0x4d')]['id'];}return db[_0xc9db('0x30')][_0xc9db('0x51')]({'where':{'id':_0x31a93b[_0xc9db('0x4b')]['id']}})[_0xc9db('0x27')](handleEntityNotFound(_0x29f4ec,null))[_0xc9db('0x27')](saveUpdates(_0x31a93b[_0xc9db('0x4d')],null))[_0xc9db('0x27')](respondWithResult(_0x29f4ec,null))[_0xc9db('0x49')](handleError(_0x29f4ec,null));};exports[_0xc9db('0x2b')]=function(_0x5e1e5a,_0x5634c5){return db[_0xc9db('0x30')][_0xc9db('0x51')]({'where':{'id':_0x5e1e5a['params']['id']}})[_0xc9db('0x27')](handleEntityNotFound(_0x5634c5,null))[_0xc9db('0x27')](removeEntity(_0x5634c5,null))[_0xc9db('0x49')](handleError(_0x5634c5,null));}; \ No newline at end of file +var _0xca88=['VIRTUAL','filter','CmContactHasItem','includeAll','include','show','params','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CmContactHasItems','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where'];(function(_0x4218d0,_0x18aa4c){var _0x2c142c=function(_0x27a612){while(--_0x27a612){_0x4218d0['push'](_0x4218d0['shift']());}};_0x2c142c(++_0x18aa4c);}(_0xca88,0x160));var _0x8ca8=function(_0x53b945,_0x5b5459){_0x53b945=_0x53b945-0x0;var _0x3d5094=_0xca88[_0x53b945];return _0x3d5094;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ca8('0x0'));var zipdir=require(_0x8ca8('0x1'));var jsonpatch=require(_0x8ca8('0x2'));var rp=require(_0x8ca8('0x3'));var moment=require('moment');var BPromise=require(_0x8ca8('0x4'));var Mustache=require(_0x8ca8('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8ca8('0x6'));var csv=require(_0x8ca8('0x7'));var ejs=require(_0x8ca8('0x8'));var fs=require('fs');var fs_extra=require(_0x8ca8('0x9'));var _=require(_0x8ca8('0xa'));var squel=require(_0x8ca8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8ca8('0xc'));var toCsv=require(_0x8ca8('0x7'));var querystring=require('querystring');var Papa=require(_0x8ca8('0xd'));var Redis=require(_0x8ca8('0xe'));var authService=require(_0x8ca8('0xf'));var qs=require(_0x8ca8('0x10'));var as=require(_0x8ca8('0x11'));var hardwareService=require(_0x8ca8('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8ca8('0x13'));var licenseUtil=require(_0x8ca8('0x14'));var db=require(_0x8ca8('0x15'))['db'];function respondWithStatusCode(_0x5bb67e,_0x276081){_0x276081=_0x276081||0xcc;return function(_0x26cc17){if(_0x26cc17){return _0x5bb67e[_0x8ca8('0x16')](_0x276081);}return _0x5bb67e[_0x8ca8('0x17')](_0x276081)[_0x8ca8('0x18')]();};}function respondWithResult(_0x32e12e,_0x4d0d2d){_0x4d0d2d=_0x4d0d2d||0xc8;return function(_0x327e37){if(_0x327e37){return _0x32e12e[_0x8ca8('0x17')](_0x4d0d2d)[_0x8ca8('0x19')](_0x327e37);}};}function respondWithFilteredResult(_0x239632,_0x2ed5ce){return function(_0x28c1dc){if(_0x28c1dc){var _0xf37d55=typeof _0x2ed5ce[_0x8ca8('0x1a')]===_0x8ca8('0x1b')&&typeof _0x2ed5ce[_0x8ca8('0x1c')]===_0x8ca8('0x1b');var _0x5537b1=_0x28c1dc[_0x8ca8('0x1d')];var _0x31e3cc=_0xf37d55?0x0:_0x2ed5ce['offset'];var _0x4ee3c1=_0xf37d55?_0x28c1dc['count']:_0x2ed5ce[_0x8ca8('0x1a')]+_0x2ed5ce[_0x8ca8('0x1c')];var _0x235bf4;if(_0x4ee3c1>=_0x5537b1){_0x4ee3c1=_0x5537b1;_0x235bf4=0xc8;}else{_0x235bf4=0xce;}_0x239632[_0x8ca8('0x17')](_0x235bf4);return _0x239632[_0x8ca8('0x1e')](_0x8ca8('0x1f'),_0x31e3cc+'-'+_0x4ee3c1+'/'+_0x5537b1)[_0x8ca8('0x19')](_0x28c1dc);}return null;};}function patchUpdates(_0x2a259b){return function(_0x195ffd){try{jsonpatch[_0x8ca8('0x20')](_0x195ffd,_0x2a259b,!![]);}catch(_0x5f2083){return BPromise[_0x8ca8('0x21')](_0x5f2083);}return _0x195ffd[_0x8ca8('0x22')]();};}function saveUpdates(_0x4195f2,_0x4ef9e1){return function(_0x1893cb){if(_0x1893cb){return _0x1893cb[_0x8ca8('0x23')](_0x4195f2)[_0x8ca8('0x24')](function(_0x39c9ea){return _0x39c9ea;});}return null;};}function removeEntity(_0x35c7cc,_0x1ca240){return function(_0x5cd2dd){if(_0x5cd2dd){return _0x5cd2dd[_0x8ca8('0x25')]()[_0x8ca8('0x24')](function(){var _0x53811a=_0x5cd2dd[_0x8ca8('0x26')]({'plain':!![]});var _0x2d5c99=_0x8ca8('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x2d5c99,'resourceId':_0x53811a['id']}})[_0x8ca8('0x24')](function(){return _0x5cd2dd;});})[_0x8ca8('0x24')](function(){_0x35c7cc['status'](0xcc)[_0x8ca8('0x18')]();});}};}function handleEntityNotFound(_0x4e11ee,_0x578446){return function(_0x2fd2ea){if(!_0x2fd2ea){_0x4e11ee[_0x8ca8('0x16')](0x194);}return _0x2fd2ea;};}function handleError(_0x257527,_0x3d7f13){_0x3d7f13=_0x3d7f13||0x1f4;return function(_0x565c6b){logger[_0x8ca8('0x28')](_0x565c6b[_0x8ca8('0x29')]);if(_0x565c6b[_0x8ca8('0x2a')]){delete _0x565c6b[_0x8ca8('0x2a')];}_0x257527[_0x8ca8('0x17')](_0x3d7f13)[_0x8ca8('0x2b')](_0x565c6b);};}exports[_0x8ca8('0x2c')]=function(_0x1e433c,_0x1ce88d){var _0x4554d8={},_0x4d13dd={},_0x47959a={'count':0x0,'rows':[]};var _0x34bd42=_['map'](db['CmContactHasItem'][_0x8ca8('0x2d')],function(_0xdb7901){return{'name':_0xdb7901['fieldName'],'type':_0xdb7901[_0x8ca8('0x2e')][_0x8ca8('0x2f')]};});_0x4d13dd[_0x8ca8('0x30')]=_[_0x8ca8('0x31')](_0x34bd42,_0x8ca8('0x2a'));_0x4d13dd[_0x8ca8('0x32')]=_[_0x8ca8('0x33')](_0x1e433c['query']);_0x4d13dd[_0x8ca8('0x34')]=_[_0x8ca8('0x35')](_0x4d13dd[_0x8ca8('0x30')],_0x4d13dd['query']);_0x4554d8['attributes']=_['intersection'](_0x4d13dd[_0x8ca8('0x30')],qs[_0x8ca8('0x36')](_0x1e433c[_0x8ca8('0x32')]['fields']));_0x4554d8[_0x8ca8('0x37')]=_0x4554d8['attributes'][_0x8ca8('0x38')]?_0x4554d8[_0x8ca8('0x37')]:_0x4d13dd[_0x8ca8('0x30')];if(!_0x1e433c[_0x8ca8('0x32')][_0x8ca8('0x39')](_0x8ca8('0x3a'))){_0x4554d8['limit']=qs[_0x8ca8('0x1c')](_0x1e433c[_0x8ca8('0x32')][_0x8ca8('0x1c')]);_0x4554d8[_0x8ca8('0x1a')]=qs[_0x8ca8('0x1a')](_0x1e433c[_0x8ca8('0x32')]['offset']);}_0x4554d8[_0x8ca8('0x3b')]=qs['sort'](_0x1e433c[_0x8ca8('0x32')][_0x8ca8('0x3c')]);_0x4554d8['where']=qs[_0x8ca8('0x34')](_[_0x8ca8('0x3d')](_0x1e433c[_0x8ca8('0x32')],_0x4d13dd['filters']),_0x34bd42);if(_0x1e433c['query']['filter']){_0x4554d8[_0x8ca8('0x3e')]=_['merge'](_0x4554d8[_0x8ca8('0x3e')],{'$or':_[_0x8ca8('0x31')](_0x34bd42,function(_0x1bce87){if(_0x1bce87[_0x8ca8('0x2e')]!==_0x8ca8('0x3f')){var _0x53e8f6={};_0x53e8f6[_0x1bce87[_0x8ca8('0x2a')]]={'$like':'%'+_0x1e433c['query'][_0x8ca8('0x40')]+'%'};return _0x53e8f6;}})});}_0x4554d8=_['merge']({},_0x4554d8,_0x1e433c['options']);var _0x5745f0={'where':_0x4554d8[_0x8ca8('0x3e')]};return db[_0x8ca8('0x41')][_0x8ca8('0x1d')](_0x5745f0)[_0x8ca8('0x24')](function(_0x44c978){_0x47959a['count']=_0x44c978;if(_0x1e433c[_0x8ca8('0x32')][_0x8ca8('0x42')]){_0x4554d8[_0x8ca8('0x43')]=[{'all':!![]}];}return db[_0x8ca8('0x41')]['findAll'](_0x4554d8);})[_0x8ca8('0x24')](function(_0x298e32){_0x47959a['rows']=_0x298e32;return _0x47959a;})[_0x8ca8('0x24')](respondWithFilteredResult(_0x1ce88d,_0x4554d8))['catch'](handleError(_0x1ce88d,null));};exports[_0x8ca8('0x44')]=function(_0x577a7a,_0x483452){var _0xb289bf={'raw':!![],'where':{'id':_0x577a7a[_0x8ca8('0x45')]['id']}},_0x47aae3={};_0x47aae3[_0x8ca8('0x30')]=_[_0x8ca8('0x33')](db['CmContactHasItem'][_0x8ca8('0x2d')]);_0x47aae3['query']=_[_0x8ca8('0x33')](_0x577a7a[_0x8ca8('0x32')]);_0x47aae3['filters']=_[_0x8ca8('0x35')](_0x47aae3[_0x8ca8('0x30')],_0x47aae3['query']);_0xb289bf[_0x8ca8('0x37')]=_[_0x8ca8('0x35')](_0x47aae3[_0x8ca8('0x30')],qs[_0x8ca8('0x36')](_0x577a7a['query'][_0x8ca8('0x36')]));_0xb289bf[_0x8ca8('0x37')]=_0xb289bf[_0x8ca8('0x37')][_0x8ca8('0x38')]?_0xb289bf[_0x8ca8('0x37')]:_0x47aae3[_0x8ca8('0x30')];if(_0x577a7a[_0x8ca8('0x32')][_0x8ca8('0x42')]){_0xb289bf[_0x8ca8('0x43')]=[{'all':!![]}];}_0xb289bf=_[_0x8ca8('0x46')]({},_0xb289bf,_0x577a7a[_0x8ca8('0x47')]);return db[_0x8ca8('0x41')][_0x8ca8('0x48')](_0xb289bf)['then'](handleEntityNotFound(_0x483452,null))[_0x8ca8('0x24')](respondWithResult(_0x483452,null))['catch'](handleError(_0x483452,null));};exports['create']=function(_0xe248a1,_0x231abf){return db[_0x8ca8('0x41')][_0x8ca8('0x49')](_0xe248a1['body'],{})['then'](function(_0x525ba6){var _0x5c8ade=_0xe248a1['user'][_0x8ca8('0x26')]({'plain':!![]});if(!_0x5c8ade)throw new Error(_0x8ca8('0x4a'));if(_0x5c8ade[_0x8ca8('0x4b')]===_0x8ca8('0x4c')){var _0x34f589=_0x525ba6[_0x8ca8('0x26')]({'plain':!![]});var _0x26d64e=_0x8ca8('0x27');return db[_0x8ca8('0x4d')][_0x8ca8('0x48')]({'where':{'name':_0x26d64e,'userProfileId':_0x5c8ade['userProfileId']},'raw':!![]})[_0x8ca8('0x24')](function(_0x2871d4){if(_0x2871d4&&_0x2871d4[_0x8ca8('0x4e')]===0x0){return db[_0x8ca8('0x4f')]['create']({'name':_0x34f589[_0x8ca8('0x2a')],'resourceId':_0x34f589['id'],'type':_0x2871d4[_0x8ca8('0x2a')],'sectionId':_0x2871d4['id']},{})[_0x8ca8('0x24')](function(){return _0x525ba6;});}else{return _0x525ba6;}})[_0x8ca8('0x50')](function(_0x493fc9){logger[_0x8ca8('0x28')](_0x8ca8('0x51'),_0x493fc9);throw _0x493fc9;});}return _0x525ba6;})['then'](respondWithResult(_0x231abf,0xc9))[_0x8ca8('0x50')](handleError(_0x231abf,null));};exports[_0x8ca8('0x23')]=function(_0x3c8504,_0x5c891b){if(_0x3c8504[_0x8ca8('0x52')]['id']){delete _0x3c8504[_0x8ca8('0x52')]['id'];}return db[_0x8ca8('0x41')][_0x8ca8('0x48')]({'where':{'id':_0x3c8504[_0x8ca8('0x45')]['id']}})[_0x8ca8('0x24')](handleEntityNotFound(_0x5c891b,null))[_0x8ca8('0x24')](saveUpdates(_0x3c8504['body'],null))[_0x8ca8('0x24')](respondWithResult(_0x5c891b,null))[_0x8ca8('0x50')](handleError(_0x5c891b,null));};exports[_0x8ca8('0x25')]=function(_0x7d8e2b,_0x21efcb){return db['CmContactHasItem'][_0x8ca8('0x48')]({'where':{'id':_0x7d8e2b[_0x8ca8('0x45')]['id']}})[_0x8ca8('0x24')](handleEntityNotFound(_0x21efcb,null))[_0x8ca8('0x24')](removeEntity(_0x21efcb,null))[_0x8ca8('0x50')](handleError(_0x21efcb,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 86268c9..38caef3 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6dc=['path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x584bac,_0x4fc772){var _0x149584=function(_0x2d5d1a){while(--_0x2d5d1a){_0x584bac['push'](_0x584bac['shift']());}};_0x149584(++_0x4fc772);}(_0xc6dc,0x125));var _0xcc6d=function(_0x466dbc,_0x23cd2e){_0x466dbc=_0x466dbc-0x0;var _0x23574d=_0xc6dc[_0x466dbc];return _0x23574d;};'use strict';var _=require(_0xcc6d('0x0'));var util=require('util');var logger=require(_0xcc6d('0x1'))(_0xcc6d('0x2'));var moment=require(_0xcc6d('0x3'));var BPromise=require(_0xcc6d('0x4'));var rp=require(_0xcc6d('0x5'));var fs=require('fs');var path=require(_0xcc6d('0x6'));var rimraf=require(_0xcc6d('0x7'));var config=require(_0xcc6d('0x8'));var attributes=require(_0xcc6d('0x9'));module['exports']=function(_0x4a6682,_0x5b4be7){return _0x4a6682[_0xcc6d('0xa')](_0xcc6d('0xb'),attributes,{'tableName':_0xcc6d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa614=['./cmContactHasItem.attributes','exports','define','cm_contact_has_items','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17c0ec,_0x34cf45){var _0x4e591c=function(_0x55c201){while(--_0x55c201){_0x17c0ec['push'](_0x17c0ec['shift']());}};_0x4e591c(++_0x34cf45);}(_0xa614,0x88));var _0x4a61=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xa614[_0x1d70db];return _0x3060c6;};'use strict';var _=require('lodash');var util=require(_0x4a61('0x0'));var logger=require(_0x4a61('0x1'))(_0x4a61('0x2'));var moment=require('moment');var BPromise=require(_0x4a61('0x3'));var rp=require(_0x4a61('0x4'));var fs=require('fs');var path=require(_0x4a61('0x5'));var rimraf=require(_0x4a61('0x6'));var config=require(_0x4a61('0x7'));var attributes=require(_0x4a61('0x8'));module[_0x4a61('0x9')]=function(_0x582b98,_0x328a94){return _0x582b98[_0x4a61('0xa')]('CmContactHasItem',attributes,{'tableName':_0x4a61('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 7ab06c0..b92fc43 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd15=['stringify','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xfd15,0xd5));var _0x5fd1=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfd15[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x5fd1('0x0'));var util=require(_0x5fd1('0x1'));var moment=require(_0x5fd1('0x2'));var BPromise=require('bluebird');var rs=require(_0x5fd1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fd1('0x4'))['db'];var utils=require(_0x5fd1('0x5'));var logger=require(_0x5fd1('0x6'))('rpc');var config=require(_0x5fd1('0x7'));var jayson=require(_0x5fd1('0x8'));var client=jayson[_0x5fd1('0x9')][_0x5fd1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c6be2,_0x46cafb,_0x2db73a){return new BPromise(function(_0x3386c3,_0x5959d9){return client['request'](_0x3c6be2,_0x2db73a)['then'](function(_0x3df718){logger['info'](_0x5fd1('0xb'),_0x46cafb,_0x5fd1('0xc'));logger[_0x5fd1('0xd')](_0x5fd1('0xe'),_0x46cafb,_0x5fd1('0xc'),JSON[_0x5fd1('0xf')](_0x3df718));if(_0x3df718[_0x5fd1('0x10')]){if(_0x3df718[_0x5fd1('0x10')]['code']===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x46cafb,_0x3df718['error']['message']);return _0x5959d9(_0x3df718[_0x5fd1('0x10')]['message']);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x46cafb,_0x3df718[_0x5fd1('0x10')][_0x5fd1('0x11')]);return _0x3386c3(_0x3df718[_0x5fd1('0x10')][_0x5fd1('0x11')]);}else{logger['info'](_0x5fd1('0xb'),_0x46cafb,_0x5fd1('0xc'));_0x3386c3(_0x3df718[_0x5fd1('0x12')][_0x5fd1('0x11')]);}})['catch'](function(_0x1dd505){logger[_0x5fd1('0x10')](_0x5fd1('0xb'),_0x46cafb,_0x1dd505);_0x5959d9(_0x1dd505);});});} \ No newline at end of file +var _0x8ea0=['jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xd58b32,_0x175bc9){var _0x2a5e16=function(_0x365a59){while(--_0x365a59){_0xd58b32['push'](_0xd58b32['shift']());}};_0x2a5e16(++_0x175bc9);}(_0x8ea0,0xcb));var _0x08ea=function(_0x1b2bf1,_0x380a49){_0x1b2bf1=_0x1b2bf1-0x0;var _0x31f744=_0x8ea0[_0x1b2bf1];return _0x31f744;};'use strict';var _=require(_0x08ea('0x0'));var util=require('util');var moment=require(_0x08ea('0x1'));var BPromise=require(_0x08ea('0x2'));var rs=require(_0x08ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08ea('0x4'))['db'];var utils=require(_0x08ea('0x5'));var logger=require(_0x08ea('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x08ea('0x7'));var client=jayson[_0x08ea('0x8')][_0x08ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d70cf,_0x2ced5b,_0x15f03e){return new BPromise(function(_0x1f0e17,_0x1437dc){return client[_0x08ea('0xa')](_0x1d70cf,_0x15f03e)[_0x08ea('0xb')](function(_0x122812){logger[_0x08ea('0xc')](_0x08ea('0xd'),_0x2ced5b,_0x08ea('0xe'));logger['debug'](_0x08ea('0xf'),_0x2ced5b,'request\x20sent',JSON[_0x08ea('0x10')](_0x122812));if(_0x122812[_0x08ea('0x11')]){if(_0x122812[_0x08ea('0x11')][_0x08ea('0x12')]===0x1f4){logger[_0x08ea('0x11')](_0x08ea('0xd'),_0x2ced5b,_0x122812[_0x08ea('0x11')]['message']);return _0x1437dc(_0x122812['error'][_0x08ea('0x13')]);}logger[_0x08ea('0x11')](_0x08ea('0xd'),_0x2ced5b,_0x122812[_0x08ea('0x11')][_0x08ea('0x13')]);return _0x1f0e17(_0x122812[_0x08ea('0x11')]['message']);}else{logger[_0x08ea('0xc')](_0x08ea('0xd'),_0x2ced5b,_0x08ea('0xe'));_0x1f0e17(_0x122812[_0x08ea('0x14')]['message']);}})['catch'](function(_0x561a5a){logger[_0x08ea('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x2ced5b,_0x561a5a);_0x1437dc(_0x561a5a);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 42d1a92..ecdd469 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a6d=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id','show'];(function(_0x5f806d,_0x20a414){var _0x2dfba9=function(_0x4ba943){while(--_0x4ba943){_0x5f806d['push'](_0x5f806d['shift']());}};_0x2dfba9(++_0x20a414);}(_0x3a6d,0x196));var _0xd3a6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3a6d[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require(_0xd3a6('0x2'));var timeout=require(_0xd3a6('0x3'));var express=require(_0xd3a6('0x4'));var router=express['Router']();var fs_extra=require(_0xd3a6('0x5'));var auth=require(_0xd3a6('0x6'));var interaction=require(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var controller=require(_0xd3a6('0x9'));router[_0xd3a6('0xa')]('/',auth[_0xd3a6('0xb')](),controller['index']);router[_0xd3a6('0xa')](_0xd3a6('0xc'),auth[_0xd3a6('0xb')](),controller[_0xd3a6('0xd')]);router[_0xd3a6('0xe')]('/',auth[_0xd3a6('0xb')](),controller[_0xd3a6('0xf')]);router[_0xd3a6('0x10')](_0xd3a6('0xc'),auth['isAuthenticated'](),controller[_0xd3a6('0x11')]);router[_0xd3a6('0x12')](_0xd3a6('0xc'),auth[_0xd3a6('0xb')](),controller[_0xd3a6('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0972=['isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get'];(function(_0x150aef,_0x580edd){var _0x26c7ff=function(_0x426e06){while(--_0x426e06){_0x150aef['push'](_0x150aef['shift']());}};_0x26c7ff(++_0x580edd);}(_0x0972,0x64));var _0x2097=function(_0x589819,_0x3d5db7){_0x589819=_0x589819-0x0;var _0x1d27d4=_0x0972[_0x589819];return _0x1d27d4;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/:id',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0xb')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0xc')]);router['put'](_0x2097('0xd'),auth[_0x2097('0x8')](),controller[_0x2097('0xe')]);router[_0x2097('0xf')](_0x2097('0xd'),auth[_0x2097('0x8')](),controller[_0x2097('0x10')]);module[_0x2097('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 3c6e60f..26e3fd0 100644 --- a/server/api/cmCustomField/cmCustomField.attributes.js +++ b/server/api/cmCustomField/cmCustomField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdd4=['exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long','select','values','isArray','stringify','ENUM','voice','lodash'];(function(_0x5acb78,_0x6c6922){var _0x2eb44d=function(_0x471472){while(--_0x471472){_0x5acb78['push'](_0x5acb78['shift']());}};_0x2eb44d(++_0x6c6922);}(_0xfdd4,0xe0));var _0x4fdd=function(_0x13f1eb,_0x141549){_0x13f1eb=_0x13f1eb-0x0;var _0x27fded=_0xfdd4[_0x13f1eb];return _0x27fded;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4fdd('0x0'));module[_0x4fdd('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x27ee32){return this[_0x4fdd('0x2')](_0x4fdd('0x3'));}},'alias':{'type':Sequelize[_0x4fdd('0x4')],'allowNull':![],'set':function(_0x128d03){this[_0x4fdd('0x5')](_0x4fdd('0x3'),_0x128d03?_0x128d03:this[_0x4fdd('0x2')](_0x4fdd('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x4fdd('0x7')](_0x4fdd('0x8')),'get':function(){if(this[_0x4fdd('0x2')]('type')===_0x4fdd('0x9')){return JSON['parse'](this[_0x4fdd('0x2')]('values'));}else{return this[_0x4fdd('0x2')](_0x4fdd('0xa'));}},'set':function(_0x54333c){if(Array[_0x4fdd('0xb')](_0x54333c)){this[_0x4fdd('0x5')](_0x4fdd('0xa'),JSON[_0x4fdd('0xc')](_0x54333c));}else{this[_0x4fdd('0x5')](_0x4fdd('0xa'),_0x54333c);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x4fdd('0xd')](_0x4fdd('0xe'))}}; \ No newline at end of file +var _0xba71=['BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','isArray','stringify','values'];(function(_0x8f7537,_0x5126bf){var _0x30971d=function(_0x48a4d7){while(--_0x48a4d7){_0x8f7537['push'](_0x8f7537['shift']());}};_0x30971d(++_0x5126bf);}(_0xba71,0x17f));var _0x1ba7=function(_0x175ac7,_0x5e8d45){_0x175ac7=_0x175ac7-0x0;var _0x125dec=_0xba71[_0x175ac7];return _0x125dec;};'use strict';var Sequelize=require(_0x1ba7('0x0'));var _=require(_0x1ba7('0x1'));module[_0x1ba7('0x2')]={'name':{'type':Sequelize[_0x1ba7('0x3')],'get':function(_0x35ca2b){return this[_0x1ba7('0x4')](_0x1ba7('0x5'));}},'alias':{'type':Sequelize[_0x1ba7('0x6')],'allowNull':![],'set':function(_0x165ec7){this[_0x1ba7('0x7')](_0x1ba7('0x5'),_0x165ec7?_0x165ec7:this[_0x1ba7('0x4')](_0x1ba7('0x8')));}},'type':{'type':Sequelize[_0x1ba7('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x1ba7('0x9')](_0x1ba7('0xa')),'get':function(){if(this[_0x1ba7('0x4')](_0x1ba7('0xb'))===_0x1ba7('0xc')){return JSON[_0x1ba7('0xd')](this['getDataValue']('values'));}else{return this[_0x1ba7('0x4')]('values');}},'set':function(_0x5ad25e){if(Array[_0x1ba7('0xe')](_0x5ad25e)){this['setDataValue']('values',JSON[_0x1ba7('0xf')](_0x5ad25e));}else{this[_0x1ba7('0x7')](_0x1ba7('0x10'),_0x5ad25e);}}},'required':{'type':Sequelize[_0x1ba7('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x1ba7('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1ba7('0x12')](_0x1ba7('0x13'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 6bbe6d0..dbb00f8 100644 --- a/server/api/cmCustomField/cmCustomField.controller.js +++ b/server/api/cmCustomField/cmCustomField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e55=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','CmCustomField','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','sequelize','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce'];(function(_0x4602ce,_0x4ef929){var _0x450352=function(_0x33409c){while(--_0x33409c){_0x4602ce['push'](_0x4602ce['shift']());}};_0x450352(++_0x4ef929);}(_0x4e55,0x106));var _0x54e5=function(_0x4313c5,_0x52f90d){_0x4313c5=_0x4313c5-0x0;var _0x42fe42=_0x4e55[_0x4313c5];return _0x42fe42;};'use strict';var emlformat=require(_0x54e5('0x0'));var rimraf=require(_0x54e5('0x1'));var zipdir=require(_0x54e5('0x2'));var jsonpatch=require(_0x54e5('0x3'));var rp=require(_0x54e5('0x4'));var moment=require('moment');var BPromise=require(_0x54e5('0x5'));var Mustache=require(_0x54e5('0x6'));var util=require(_0x54e5('0x7'));var path=require('path');var sox=require(_0x54e5('0x8'));var csv=require(_0x54e5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54e5('0xa'));var _=require(_0x54e5('0xb'));var squel=require(_0x54e5('0xc'));var crypto=require('crypto');var jsforce=require(_0x54e5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x54e5('0x9'));var querystring=require('querystring');var Papa=require(_0x54e5('0xe'));var Redis=require(_0x54e5('0xf'));var authService=require(_0x54e5('0x10'));var qs=require(_0x54e5('0x11'));var as=require(_0x54e5('0x12'));var hardwareService=require(_0x54e5('0x13'));var logger=require(_0x54e5('0x14'))(_0x54e5('0x15'));var utils=require(_0x54e5('0x16'));var config=require(_0x54e5('0x17'));var licenseUtil=require(_0x54e5('0x18'));var db=require(_0x54e5('0x19'))['db'];function respondWithStatusCode(_0xf295d1,_0x3493f0){_0x3493f0=_0x3493f0||0xcc;return function(_0x1ecc6a){if(_0x1ecc6a){return _0xf295d1[_0x54e5('0x1a')](_0x3493f0);}return _0xf295d1[_0x54e5('0x1b')](_0x3493f0)[_0x54e5('0x1c')]();};}function respondWithResult(_0x4d43c1,_0x534472){_0x534472=_0x534472||0xc8;return function(_0x39df77){if(_0x39df77){return _0x4d43c1['status'](_0x534472)[_0x54e5('0x1d')](_0x39df77);}};}function respondWithFilteredResult(_0x5efa1e,_0x6accb5){return function(_0x31daec){if(_0x31daec){var _0x3df45a=typeof _0x6accb5[_0x54e5('0x1e')]===_0x54e5('0x1f')&&typeof _0x6accb5[_0x54e5('0x20')]===_0x54e5('0x1f');var _0x3a71cf=_0x31daec[_0x54e5('0x21')];var _0x2d8e5d=_0x3df45a?0x0:_0x6accb5[_0x54e5('0x1e')];var _0x1304df=_0x3df45a?_0x31daec[_0x54e5('0x21')]:_0x6accb5[_0x54e5('0x1e')]+_0x6accb5[_0x54e5('0x20')];var _0x4b7f9e;if(_0x1304df>=_0x3a71cf){_0x1304df=_0x3a71cf;_0x4b7f9e=0xc8;}else{_0x4b7f9e=0xce;}_0x5efa1e[_0x54e5('0x1b')](_0x4b7f9e);return _0x5efa1e[_0x54e5('0x22')](_0x54e5('0x23'),_0x2d8e5d+'-'+_0x1304df+'/'+_0x3a71cf)['json'](_0x31daec);}return null;};}function patchUpdates(_0x31685d){return function(_0x4e0da7){try{jsonpatch[_0x54e5('0x24')](_0x4e0da7,_0x31685d,!![]);}catch(_0x138816){return BPromise[_0x54e5('0x25')](_0x138816);}return _0x4e0da7[_0x54e5('0x26')]();};}function saveUpdates(_0x56defb,_0x4abadd){return function(_0x272665){if(_0x272665){return _0x272665[_0x54e5('0x27')](_0x56defb)[_0x54e5('0x28')](function(_0xb91262){return _0xb91262;});}return null;};}function removeEntity(_0x4461cc,_0x52c18f){return function(_0x27be8f){if(_0x27be8f){return _0x27be8f[_0x54e5('0x29')]()[_0x54e5('0x28')](function(){_0x4461cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d96ff,_0x499791){return function(_0x12e3c3){if(!_0x12e3c3){_0x5d96ff[_0x54e5('0x1a')](0x194);}return _0x12e3c3;};}function handleError(_0x196ed5,_0x3896e2){_0x3896e2=_0x3896e2||0x1f4;return function(_0x323d90){logger[_0x54e5('0x2a')](_0x323d90[_0x54e5('0x2b')]);if(_0x323d90['name']){delete _0x323d90[_0x54e5('0x2c')];}_0x196ed5[_0x54e5('0x1b')](_0x3896e2)[_0x54e5('0x2d')](_0x323d90);};}exports[_0x54e5('0x2e')]=function(_0x536044,_0x3ccac1){var _0x11c410={},_0x2c549a={},_0x2a0ad6={'count':0x0,'rows':[]};var _0x43ca22=_[_0x54e5('0x2f')](db['CmCustomField'][_0x54e5('0x30')],function(_0x4c359d){return{'name':_0x4c359d[_0x54e5('0x31')],'type':_0x4c359d[_0x54e5('0x32')]['key']};});_0x2c549a[_0x54e5('0x33')]=_[_0x54e5('0x34')](_['map'](_0x43ca22,'name'),[_0x54e5('0x2c')]);_0x2c549a[_0x54e5('0x35')]=_['keys'](_0x536044[_0x54e5('0x35')]);_0x2c549a[_0x54e5('0x36')]=_[_0x54e5('0x37')](_0x2c549a[_0x54e5('0x33')],_0x2c549a['query']);_0x11c410[_0x54e5('0x38')]=_[_0x54e5('0x37')](_0x2c549a['model'],qs[_0x54e5('0x39')](_0x536044[_0x54e5('0x35')][_0x54e5('0x39')]));_0x11c410[_0x54e5('0x38')]=_0x11c410[_0x54e5('0x38')][_0x54e5('0x3a')]?_0x11c410['attributes']:_0x2c549a['model'];if(!_0x536044[_0x54e5('0x35')][_0x54e5('0x3b')](_0x54e5('0x3c'))){_0x11c410[_0x54e5('0x20')]=qs[_0x54e5('0x20')](_0x536044[_0x54e5('0x35')][_0x54e5('0x20')]);_0x11c410[_0x54e5('0x1e')]=qs[_0x54e5('0x1e')](_0x536044[_0x54e5('0x35')][_0x54e5('0x1e')]);}_0x11c410[_0x54e5('0x3d')]=qs[_0x54e5('0x3e')](_0x536044[_0x54e5('0x35')][_0x54e5('0x3e')]);_0x11c410[_0x54e5('0x3f')]=qs[_0x54e5('0x36')](_[_0x54e5('0x40')](_0x536044[_0x54e5('0x35')],_0x2c549a[_0x54e5('0x36')]),_0x43ca22);if(_0x536044[_0x54e5('0x35')][_0x54e5('0x41')]){_0x11c410[_0x54e5('0x3f')]=_[_0x54e5('0x42')](_0x11c410[_0x54e5('0x3f')],{'$or':_['map'](_0x43ca22,function(_0x245277){if(_0x245277[_0x54e5('0x32')]!=='VIRTUAL'){var _0xdb8526={};_0xdb8526[_0x245277['name']]={'$like':'%'+_0x536044['query']['filter']+'%'};return _0xdb8526;}})});}_0x11c410=_[_0x54e5('0x42')]({},_0x11c410,_0x536044['options']);var _0x33a148={'where':_0x11c410['where']};return db[_0x54e5('0x43')][_0x54e5('0x21')](_0x33a148)[_0x54e5('0x28')](function(_0xa2ddc8){_0x2a0ad6['count']=_0xa2ddc8;if(_0x536044[_0x54e5('0x35')][_0x54e5('0x44')]){_0x11c410[_0x54e5('0x45')]=[{'all':!![]}];}return db[_0x54e5('0x43')][_0x54e5('0x46')](_0x11c410);})[_0x54e5('0x28')](function(_0x2e6a0c){_0x2a0ad6[_0x54e5('0x47')]=_0x2e6a0c;return _0x2a0ad6;})[_0x54e5('0x28')](respondWithFilteredResult(_0x3ccac1,_0x11c410))[_0x54e5('0x48')](handleError(_0x3ccac1,null));};exports[_0x54e5('0x49')]=function(_0x12b4cd,_0x39d119){var _0x2eb1d7={'raw':!![],'where':{'id':_0x12b4cd[_0x54e5('0x4a')]['id']}},_0x590f4e={};_0x590f4e[_0x54e5('0x33')]=_['keys'](db[_0x54e5('0x43')][_0x54e5('0x30')]);_0x590f4e[_0x54e5('0x35')]=_[_0x54e5('0x4b')](_0x12b4cd[_0x54e5('0x35')]);_0x590f4e['filters']=_[_0x54e5('0x37')](_0x590f4e['model'],_0x590f4e[_0x54e5('0x35')]);_0x2eb1d7['attributes']=_['intersection'](_0x590f4e[_0x54e5('0x33')],qs['fields'](_0x12b4cd[_0x54e5('0x35')][_0x54e5('0x39')]));_0x2eb1d7[_0x54e5('0x38')]=_0x2eb1d7['attributes']['length']?_0x2eb1d7[_0x54e5('0x38')]:_0x590f4e['model'];if(_0x12b4cd['query'][_0x54e5('0x44')]){_0x2eb1d7[_0x54e5('0x45')]=[{'all':!![]}];}_0x2eb1d7=_[_0x54e5('0x42')]({},_0x2eb1d7,_0x12b4cd['options']);return db[_0x54e5('0x43')][_0x54e5('0x4c')](_0x2eb1d7)[_0x54e5('0x28')](handleEntityNotFound(_0x39d119,null))[_0x54e5('0x28')](respondWithResult(_0x39d119,null))['catch'](handleError(_0x39d119,null));};exports[_0x54e5('0x27')]=function(_0x2a2ed9,_0x33f696){if(_0x2a2ed9['body']['id']){delete _0x2a2ed9['body']['id'];}return db[_0x54e5('0x43')]['find']({'where':{'id':_0x2a2ed9[_0x54e5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x33f696,null))[_0x54e5('0x28')](saveUpdates(_0x2a2ed9[_0x54e5('0x4d')],null))['then'](respondWithResult(_0x33f696,null))[_0x54e5('0x48')](handleError(_0x33f696,null));};exports[_0x54e5('0x29')]=function(_0x1f9ce0,_0x23108f){return db[_0x54e5('0x43')][_0x54e5('0x4c')]({'where':{'id':_0x1f9ce0[_0x54e5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x23108f,null))[_0x54e5('0x28')](removeEntity(_0x23108f,null))['catch'](handleError(_0x23108f,null));};exports[_0x54e5('0x4e')]=function(_0x1c719c,_0x2dc5bc){var _0x2c00c7;return db[_0x54e5('0x4f')]['transaction'](function(_0x32747d){return db[_0x54e5('0x43')][_0x54e5('0x4e')](_0x1c719c['body'],{'transaction':_0x32747d})[_0x54e5('0x28')](function(_0x466706){_0x2c00c7=_0x466706;var _0x11084a={'type':db['Sequelize']['TEXT'],'transaction':_0x32747d};switch(_0x1c719c['body'][_0x54e5('0x32')]){case _0x54e5('0x50'):_0x11084a[_0x54e5('0x32')]=db[_0x54e5('0x51')]['TEXT'];break;case _0x54e5('0x52'):_0x11084a[_0x54e5('0x32')]=db[_0x54e5('0x51')][_0x54e5('0x53')];break;case _0x54e5('0x54'):_0x11084a[_0x54e5('0x32')]=db[_0x54e5('0x51')][_0x54e5('0x55')];_0x11084a[_0x54e5('0x56')]=![];break;default:}return db[_0x54e5('0x4f')][_0x54e5('0x57')][_0x54e5('0x58')](_0x54e5('0x59'),util[_0x54e5('0x5a')](_0x54e5('0x5b'),_0x2c00c7['id']),_0x11084a);})[_0x54e5('0x28')](function(){return _0x2c00c7;});})['then'](respondWithResult(_0x2dc5bc,0xc9))[_0x54e5('0x48')](handleError(_0x2dc5bc,null));}; \ No newline at end of file +var _0x8ba6=['queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','CmCustomField','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','include','findAll','rows','catch','params','rawAttributes','includeAll','options','find','body','destroy','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue'];(function(_0x5d6aca,_0xa7e6ec){var _0x3d6481=function(_0x9683a2){while(--_0x9683a2){_0x5d6aca['push'](_0x5d6aca['shift']());}};_0x3d6481(++_0xa7e6ec);}(_0x8ba6,0x164));var _0x68ba=function(_0x3f2d07,_0x35674d){_0x3f2d07=_0x3f2d07-0x0;var _0x3cd224=_0x8ba6[_0x3f2d07];return _0x3cd224;};'use strict';var emlformat=require(_0x68ba('0x0'));var rimraf=require(_0x68ba('0x1'));var zipdir=require(_0x68ba('0x2'));var jsonpatch=require(_0x68ba('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68ba('0x4'));var Mustache=require(_0x68ba('0x5'));var util=require(_0x68ba('0x6'));var path=require('path');var sox=require(_0x68ba('0x7'));var csv=require(_0x68ba('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68ba('0x9'));var _=require('lodash');var squel=require(_0x68ba('0xa'));var crypto=require(_0x68ba('0xb'));var jsforce=require(_0x68ba('0xc'));var deskjs=require(_0x68ba('0xd'));var toCsv=require(_0x68ba('0x8'));var querystring=require(_0x68ba('0xe'));var Papa=require(_0x68ba('0xf'));var Redis=require(_0x68ba('0x10'));var authService=require(_0x68ba('0x11'));var qs=require(_0x68ba('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68ba('0x13'));var logger=require('../../config/logger')(_0x68ba('0x14'));var utils=require(_0x68ba('0x15'));var config=require(_0x68ba('0x16'));var licenseUtil=require(_0x68ba('0x17'));var db=require(_0x68ba('0x18'))['db'];function respondWithStatusCode(_0x518d5f,_0x4dc4d1){_0x4dc4d1=_0x4dc4d1||0xcc;return function(_0x3c14c2){if(_0x3c14c2){return _0x518d5f[_0x68ba('0x19')](_0x4dc4d1);}return _0x518d5f[_0x68ba('0x1a')](_0x4dc4d1)[_0x68ba('0x1b')]();};}function respondWithResult(_0x1b26e4,_0x5f474e){_0x5f474e=_0x5f474e||0xc8;return function(_0x38dfea){if(_0x38dfea){return _0x1b26e4['status'](_0x5f474e)[_0x68ba('0x1c')](_0x38dfea);}};}function respondWithFilteredResult(_0x80b0ca,_0x16563e){return function(_0x1458bf){if(_0x1458bf){var _0x5e85ab=typeof _0x16563e['offset']===_0x68ba('0x1d')&&typeof _0x16563e[_0x68ba('0x1e')]==='undefined';var _0x3e8b1c=_0x1458bf[_0x68ba('0x1f')];var _0x4d3c02=_0x5e85ab?0x0:_0x16563e[_0x68ba('0x20')];var _0x2c00a5=_0x5e85ab?_0x1458bf['count']:_0x16563e[_0x68ba('0x20')]+_0x16563e[_0x68ba('0x1e')];var _0x5211d6;if(_0x2c00a5>=_0x3e8b1c){_0x2c00a5=_0x3e8b1c;_0x5211d6=0xc8;}else{_0x5211d6=0xce;}_0x80b0ca[_0x68ba('0x1a')](_0x5211d6);return _0x80b0ca[_0x68ba('0x21')](_0x68ba('0x22'),_0x4d3c02+'-'+_0x2c00a5+'/'+_0x3e8b1c)[_0x68ba('0x1c')](_0x1458bf);}return null;};}function patchUpdates(_0x2bfbce){return function(_0x23cd3b){try{jsonpatch[_0x68ba('0x23')](_0x23cd3b,_0x2bfbce,!![]);}catch(_0x3758bb){return BPromise[_0x68ba('0x24')](_0x3758bb);}return _0x23cd3b[_0x68ba('0x25')]();};}function saveUpdates(_0x3b67b3,_0x107863){return function(_0x59c5fb){if(_0x59c5fb){return _0x59c5fb[_0x68ba('0x26')](_0x3b67b3)[_0x68ba('0x27')](function(_0x542de3){return _0x542de3;});}return null;};}function removeEntity(_0x577b8a,_0x52013e){return function(_0x31a90d){if(_0x31a90d){return _0x31a90d['destroy']()[_0x68ba('0x27')](function(){_0x577b8a[_0x68ba('0x1a')](0xcc)[_0x68ba('0x1b')]();});}};}function handleEntityNotFound(_0x210b07,_0x3f9bad){return function(_0x1e92b8){if(!_0x1e92b8){_0x210b07[_0x68ba('0x19')](0x194);}return _0x1e92b8;};}function handleError(_0x4a3b15,_0x4f1cf1){_0x4f1cf1=_0x4f1cf1||0x1f4;return function(_0x532e1c){logger[_0x68ba('0x28')](_0x532e1c[_0x68ba('0x29')]);if(_0x532e1c['name']){delete _0x532e1c[_0x68ba('0x2a')];}_0x4a3b15[_0x68ba('0x1a')](_0x4f1cf1)[_0x68ba('0x2b')](_0x532e1c);};}exports['index']=function(_0x3b59e2,_0x14ca1b){var _0x31c4ac={},_0x41d55c={},_0x179043={'count':0x0,'rows':[]};var _0x19bf99=_['map'](db[_0x68ba('0x2c')]['rawAttributes'],function(_0x1961eb){return{'name':_0x1961eb['fieldName'],'type':_0x1961eb[_0x68ba('0x2d')][_0x68ba('0x2e')]};});_0x41d55c[_0x68ba('0x2f')]=_[_0x68ba('0x30')](_[_0x68ba('0x31')](_0x19bf99,_0x68ba('0x2a')),[_0x68ba('0x2a')]);_0x41d55c[_0x68ba('0x32')]=_[_0x68ba('0x33')](_0x3b59e2[_0x68ba('0x32')]);_0x41d55c[_0x68ba('0x34')]=_[_0x68ba('0x35')](_0x41d55c[_0x68ba('0x2f')],_0x41d55c[_0x68ba('0x32')]);_0x31c4ac[_0x68ba('0x36')]=_['intersection'](_0x41d55c[_0x68ba('0x2f')],qs[_0x68ba('0x37')](_0x3b59e2[_0x68ba('0x32')][_0x68ba('0x37')]));_0x31c4ac['attributes']=_0x31c4ac['attributes'][_0x68ba('0x38')]?_0x31c4ac[_0x68ba('0x36')]:_0x41d55c['model'];if(!_0x3b59e2[_0x68ba('0x32')][_0x68ba('0x39')]('nolimit')){_0x31c4ac['limit']=qs['limit'](_0x3b59e2[_0x68ba('0x32')]['limit']);_0x31c4ac['offset']=qs[_0x68ba('0x20')](_0x3b59e2[_0x68ba('0x32')][_0x68ba('0x20')]);}_0x31c4ac[_0x68ba('0x3a')]=qs[_0x68ba('0x3b')](_0x3b59e2[_0x68ba('0x32')]['sort']);_0x31c4ac[_0x68ba('0x3c')]=qs['filters'](_[_0x68ba('0x3d')](_0x3b59e2[_0x68ba('0x32')],_0x41d55c[_0x68ba('0x34')]),_0x19bf99);if(_0x3b59e2[_0x68ba('0x32')][_0x68ba('0x3e')]){_0x31c4ac[_0x68ba('0x3c')]=_['merge'](_0x31c4ac['where'],{'$or':_[_0x68ba('0x31')](_0x19bf99,function(_0x24e137){if(_0x24e137['type']!=='VIRTUAL'){var _0x5619ee={};_0x5619ee[_0x24e137[_0x68ba('0x2a')]]={'$like':'%'+_0x3b59e2[_0x68ba('0x32')][_0x68ba('0x3e')]+'%'};return _0x5619ee;}})});}_0x31c4ac=_['merge']({},_0x31c4ac,_0x3b59e2['options']);var _0x1bfe14={'where':_0x31c4ac[_0x68ba('0x3c')]};return db[_0x68ba('0x2c')][_0x68ba('0x1f')](_0x1bfe14)[_0x68ba('0x27')](function(_0x430e96){_0x179043[_0x68ba('0x1f')]=_0x430e96;if(_0x3b59e2[_0x68ba('0x32')]['includeAll']){_0x31c4ac[_0x68ba('0x3f')]=[{'all':!![]}];}return db[_0x68ba('0x2c')][_0x68ba('0x40')](_0x31c4ac);})[_0x68ba('0x27')](function(_0xf03db){_0x179043[_0x68ba('0x41')]=_0xf03db;return _0x179043;})[_0x68ba('0x27')](respondWithFilteredResult(_0x14ca1b,_0x31c4ac))[_0x68ba('0x42')](handleError(_0x14ca1b,null));};exports['show']=function(_0x20bcb9,_0x386feb){var _0x911e62={'raw':!![],'where':{'id':_0x20bcb9[_0x68ba('0x43')]['id']}},_0x335b2e={};_0x335b2e[_0x68ba('0x2f')]=_[_0x68ba('0x33')](db[_0x68ba('0x2c')][_0x68ba('0x44')]);_0x335b2e['query']=_[_0x68ba('0x33')](_0x20bcb9[_0x68ba('0x32')]);_0x335b2e[_0x68ba('0x34')]=_[_0x68ba('0x35')](_0x335b2e[_0x68ba('0x2f')],_0x335b2e[_0x68ba('0x32')]);_0x911e62[_0x68ba('0x36')]=_['intersection'](_0x335b2e[_0x68ba('0x2f')],qs[_0x68ba('0x37')](_0x20bcb9['query']['fields']));_0x911e62[_0x68ba('0x36')]=_0x911e62[_0x68ba('0x36')][_0x68ba('0x38')]?_0x911e62[_0x68ba('0x36')]:_0x335b2e[_0x68ba('0x2f')];if(_0x20bcb9[_0x68ba('0x32')][_0x68ba('0x45')]){_0x911e62['include']=[{'all':!![]}];}_0x911e62=_['merge']({},_0x911e62,_0x20bcb9[_0x68ba('0x46')]);return db[_0x68ba('0x2c')][_0x68ba('0x47')](_0x911e62)[_0x68ba('0x27')](handleEntityNotFound(_0x386feb,null))[_0x68ba('0x27')](respondWithResult(_0x386feb,null))['catch'](handleError(_0x386feb,null));};exports[_0x68ba('0x26')]=function(_0x3b9124,_0x2ac70b){if(_0x3b9124[_0x68ba('0x48')]['id']){delete _0x3b9124[_0x68ba('0x48')]['id'];}return db[_0x68ba('0x2c')][_0x68ba('0x47')]({'where':{'id':_0x3b9124[_0x68ba('0x43')]['id']}})[_0x68ba('0x27')](handleEntityNotFound(_0x2ac70b,null))[_0x68ba('0x27')](saveUpdates(_0x3b9124[_0x68ba('0x48')],null))['then'](respondWithResult(_0x2ac70b,null))[_0x68ba('0x42')](handleError(_0x2ac70b,null));};exports[_0x68ba('0x49')]=function(_0xfb3ce0,_0xdbada1){return db[_0x68ba('0x2c')][_0x68ba('0x47')]({'where':{'id':_0xfb3ce0[_0x68ba('0x43')]['id']}})[_0x68ba('0x27')](handleEntityNotFound(_0xdbada1,null))[_0x68ba('0x27')](removeEntity(_0xdbada1,null))[_0x68ba('0x42')](handleError(_0xdbada1,null));};exports['create']=function(_0x57a477,_0x597d9f){var _0x101f26;return db[_0x68ba('0x4a')][_0x68ba('0x4b')](function(_0x154c48){return db[_0x68ba('0x2c')]['create'](_0x57a477[_0x68ba('0x48')],{'transaction':_0x154c48})[_0x68ba('0x27')](function(_0x461b35){_0x101f26=_0x461b35;var _0x3e8e39={'type':db[_0x68ba('0x4c')][_0x68ba('0x4d')],'transaction':_0x154c48};switch(_0x57a477[_0x68ba('0x48')][_0x68ba('0x2d')]){case _0x68ba('0x4e'):_0x3e8e39[_0x68ba('0x2d')]=db[_0x68ba('0x4c')][_0x68ba('0x4d')];break;case _0x68ba('0x4f'):_0x3e8e39[_0x68ba('0x2d')]=db[_0x68ba('0x4c')][_0x68ba('0x50')];break;case _0x68ba('0x51'):_0x3e8e39['type']=db['Sequelize'][_0x68ba('0x52')];_0x3e8e39[_0x68ba('0x53')]=![];break;default:}return db[_0x68ba('0x4a')][_0x68ba('0x54')][_0x68ba('0x55')](_0x68ba('0x56'),util['format'](_0x68ba('0x57'),_0x101f26['id']),_0x3e8e39);})[_0x68ba('0x27')](function(){return _0x101f26;});})[_0x68ba('0x27')](respondWithResult(_0x597d9f,0xc9))['catch'](handleError(_0x597d9f,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index e211459..b80e620 100644 --- a/server/api/cmCustomField/cmCustomField.model.js +++ b/server/api/cmCustomField/cmCustomField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e5c=['request-promise','path','rimraf','exports','define','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0x4e5c,0x10e));var _0xc4e5=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x4e5c[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xc4e5('0x0'));var util=require(_0xc4e5('0x1'));var logger=require(_0xc4e5('0x2'))(_0xc4e5('0x3'));var moment=require(_0xc4e5('0x4'));var BPromise=require(_0xc4e5('0x5'));var rp=require(_0xc4e5('0x6'));var fs=require('fs');var path=require(_0xc4e5('0x7'));var rimraf=require(_0xc4e5('0x8'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0xc4e5('0x9')]=function(_0x23dd3d,_0x3e102a){return _0x23dd3d[_0xc4e5('0xa')]('CmCustomField',attributes,{'tableName':_0xc4e5('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd421=['request-promise','path','rimraf','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','../../config/logger','api'];(function(_0x270554,_0x12eb20){var _0x2079c3=function(_0x38b75e){while(--_0x38b75e){_0x270554['push'](_0x270554['shift']());}};_0x2079c3(++_0x12eb20);}(_0xd421,0x104));var _0x1d42=function(_0x6af591,_0x380e70){_0x6af591=_0x6af591-0x0;var _0x270e66=_0xd421[_0x6af591];return _0x270e66;};'use strict';var _=require(_0x1d42('0x0'));var util=require(_0x1d42('0x1'));var logger=require(_0x1d42('0x2'))(_0x1d42('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1d42('0x4'));var fs=require('fs');var path=require(_0x1d42('0x5'));var rimraf=require(_0x1d42('0x6'));var config=require('../../config/environment');var attributes=require(_0x1d42('0x7'));module[_0x1d42('0x8')]=function(_0x593539,_0x193697){return _0x593539[_0x1d42('0x9')]('CmCustomField',attributes,{'tableName':_0x1d42('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 361e9b0..eb3418a 100644 --- a/server/api/cmCustomField/cmCustomField.rpc.js +++ b/server/api/cmCustomField/cmCustomField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54eb=['jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3b27ef,_0x20a499){var _0x317470=function(_0x435ead){while(--_0x435ead){_0x3b27ef['push'](_0x3b27ef['shift']());}};_0x317470(++_0x20a499);}(_0x54eb,0x116));var _0xb54e=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x54eb[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require(_0xb54e('0x0'));var moment=require(_0xb54e('0x1'));var BPromise=require('bluebird');var rs=require(_0xb54e('0x2'));var fs=require('fs');var Redis=require(_0xb54e('0x3'));var db=require(_0xb54e('0x4'))['db'];var utils=require(_0xb54e('0x5'));var logger=require(_0xb54e('0x6'))(_0xb54e('0x7'));var config=require('../../config/environment');var jayson=require(_0xb54e('0x8'));var client=jayson[_0xb54e('0x9')][_0xb54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b54f5,_0xb04d75,_0x2f3b16){return new BPromise(function(_0x11915c,_0x47e3c3){return client[_0xb54e('0xb')](_0x3b54f5,_0x2f3b16)[_0xb54e('0xc')](function(_0x29759b){logger[_0xb54e('0xd')](_0xb54e('0xe'),_0xb04d75,'request\x20sent');logger[_0xb54e('0xf')](_0xb54e('0x10'),_0xb04d75,_0xb54e('0x11'),JSON['stringify'](_0x29759b));if(_0x29759b[_0xb54e('0x12')]){if(_0x29759b[_0xb54e('0x12')][_0xb54e('0x13')]===0x1f4){logger[_0xb54e('0x12')](_0xb54e('0xe'),_0xb04d75,_0x29759b[_0xb54e('0x12')][_0xb54e('0x14')]);return _0x47e3c3(_0x29759b[_0xb54e('0x12')]['message']);}logger[_0xb54e('0x12')](_0xb54e('0xe'),_0xb04d75,_0x29759b[_0xb54e('0x12')][_0xb54e('0x14')]);return _0x11915c(_0x29759b[_0xb54e('0x12')][_0xb54e('0x14')]);}else{logger[_0xb54e('0xd')](_0xb54e('0xe'),_0xb04d75,'request\x20sent');_0x11915c(_0x29759b['result']['message']);}})[_0xb54e('0x15')](function(_0x15f925){logger['error'](_0xb54e('0xe'),_0xb04d75,_0x15f925);_0x47e3c3(_0x15f925);});});} \ No newline at end of file +var _0x72c8=['request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x4c26d2,_0x386a43){var _0x3b4400=function(_0x49d934){while(--_0x49d934){_0x4c26d2['push'](_0x4c26d2['shift']());}};_0x3b4400(++_0x386a43);}(_0x72c8,0x1ea));var _0x872c=function(_0x3f6da1,_0x238c3d){_0x3f6da1=_0x3f6da1-0x0;var _0x1a0f9a=_0x72c8[_0x3f6da1];return _0x1a0f9a;};'use strict';var _=require(_0x872c('0x0'));var util=require(_0x872c('0x1'));var moment=require(_0x872c('0x2'));var BPromise=require(_0x872c('0x3'));var rs=require(_0x872c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x872c('0x5'))['db'];var utils=require(_0x872c('0x6'));var logger=require(_0x872c('0x7'))(_0x872c('0x8'));var config=require(_0x872c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x872c('0xa')][_0x872c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3aed93,_0x1fcfb3,_0x58921f){return new BPromise(function(_0x5a621b,_0xe9f935){return client['request'](_0x3aed93,_0x58921f)[_0x872c('0xc')](function(_0x2176f6){logger['info'](_0x872c('0xd'),_0x1fcfb3,'request\x20sent');logger[_0x872c('0xe')](_0x872c('0xf'),_0x1fcfb3,_0x872c('0x10'),JSON[_0x872c('0x11')](_0x2176f6));if(_0x2176f6['error']){if(_0x2176f6[_0x872c('0x12')][_0x872c('0x13')]===0x1f4){logger[_0x872c('0x12')]('CmCustomField,\x20%s,\x20%s',_0x1fcfb3,_0x2176f6[_0x872c('0x12')]['message']);return _0xe9f935(_0x2176f6[_0x872c('0x12')][_0x872c('0x14')]);}logger[_0x872c('0x12')](_0x872c('0xd'),_0x1fcfb3,_0x2176f6[_0x872c('0x12')][_0x872c('0x14')]);return _0x5a621b(_0x2176f6[_0x872c('0x12')][_0x872c('0x14')]);}else{logger[_0x872c('0x15')]('CmCustomField,\x20%s,\x20%s',_0x1fcfb3,'request\x20sent');_0x5a621b(_0x2176f6['result'][_0x872c('0x14')]);}})[_0x872c('0x16')](function(_0x364a47){logger[_0x872c('0x12')](_0x872c('0xd'),_0x1fcfb3,_0x364a47);_0xe9f935(_0x364a47);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index fe32a55..c112786 100644 --- a/server/api/cmCustomField/index.js +++ b/server/api/cmCustomField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x251b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x34f733,_0x3e8b80){var _0x2097b0=function(_0x59e540){while(--_0x59e540){_0x34f733['push'](_0x34f733['shift']());}};_0x2097b0(++_0x3e8b80);}(_0x251b,0x185));var _0xb251=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0x251b[_0x1fc84d];return _0x2658fa;};'use strict';var multer=require(_0xb251('0x0'));var util=require(_0xb251('0x1'));var path=require(_0xb251('0x2'));var timeout=require(_0xb251('0x3'));var express=require(_0xb251('0x4'));var router=express[_0xb251('0x5')]();var fs_extra=require(_0xb251('0x6'));var auth=require(_0xb251('0x7'));var interaction=require(_0xb251('0x8'));var config=require(_0xb251('0x9'));var controller=require(_0xb251('0xa'));router[_0xb251('0xb')]('/',auth['isAuthenticated'](),controller[_0xb251('0xc')]);router['get'](_0xb251('0xd'),auth[_0xb251('0xe')](),controller[_0xb251('0xf')]);router['post']('/',auth[_0xb251('0xe')](),controller[_0xb251('0x10')]);router[_0xb251('0x11')]('/:id',auth[_0xb251('0xe')](),controller[_0xb251('0x12')]);router[_0xb251('0x13')](_0xb251('0xd'),auth['isAuthenticated'](),controller[_0xb251('0x14')]);module[_0xb251('0x15')]=router; \ No newline at end of file +var _0x7181=['exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy'];(function(_0x5c48de,_0x25e709){var _0x17f619=function(_0x2e50a0){while(--_0x2e50a0){_0x5c48de['push'](_0x5c48de['shift']());}};_0x17f619(++_0x25e709);}(_0x7181,0x1ef));var _0x1718=function(_0x9bca53,_0x59b4f8){_0x9bca53=_0x9bca53-0x0;var _0x3894bc=_0x7181[_0x9bca53];return _0x3894bc;};'use strict';var multer=require(_0x1718('0x0'));var util=require(_0x1718('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1718('0x2')]();var fs_extra=require(_0x1718('0x3'));var auth=require(_0x1718('0x4'));var interaction=require(_0x1718('0x5'));var config=require(_0x1718('0x6'));var controller=require(_0x1718('0x7'));router[_0x1718('0x8')]('/',auth[_0x1718('0x9')](),controller[_0x1718('0xa')]);router[_0x1718('0x8')](_0x1718('0xb'),auth[_0x1718('0x9')](),controller[_0x1718('0xc')]);router[_0x1718('0xd')]('/',auth[_0x1718('0x9')](),controller[_0x1718('0xe')]);router['put'](_0x1718('0xb'),auth[_0x1718('0x9')](),controller[_0x1718('0xf')]);router[_0x1718('0x10')](_0x1718('0xb'),auth[_0x1718('0x9')](),controller[_0x1718('0x11')]);module[_0x1718('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 9d078d7..2fe0986 100644 --- a/server/api/cmHopper/cmHopper.attributes.js +++ b/server/api/cmHopper/cmHopper.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb268=['contactListQueue','moment','sequelize','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','DATE','UNSIGNED'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb268,0x191));var _0x8b26=function(_0xd6f95a,_0x20ddca){_0xd6f95a=_0xd6f95a-0x0;var _0x33aab7=_0xb268[_0xd6f95a];return _0x33aab7;};'use strict';var moment=require(_0x8b26('0x0'));var Sequelize=require(_0x8b26('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x8b26('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x8b26('0x3')](_0x8b26('0x4'))},'countbusyretry':{'type':Sequelize[_0x8b26('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8b26('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8b26('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8b26('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8b26('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8b26('0x7')]},'priority':{'type':Sequelize[_0x8b26('0x5')](0x2)[_0x8b26('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8b26('0x5')],'unique':_0x8b26('0x9')},'ListId':{'type':Sequelize[_0x8b26('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x8b26('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x8b26('0x5')],'unique':_0x8b26('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x8b26('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8b26('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8b26('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8b26('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8b26('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x8b26('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x3abd=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE'];(function(_0x15a515,_0x35ba23){var _0x27db15=function(_0x2f00f5){while(--_0x2f00f5){_0x15a515['push'](_0x15a515['shift']());}};_0x27db15(++_0x35ba23);}(_0x3abd,0x1bd));var _0xd3ab=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x3abd[_0x11ce46];return _0x368a1e;};'use strict';var moment=require(_0xd3ab('0x0'));var Sequelize=require(_0xd3ab('0x1'));module[_0xd3ab('0x2')]={'phone':{'type':Sequelize[_0xd3ab('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xd3ab('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xd3ab('0x5')],'defaultValue':moment()[_0xd3ab('0x6')](_0xd3ab('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd3ab('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xd3ab('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xd3ab('0x8')](0x2)[_0xd3ab('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xd3ab('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xd3ab('0x8')],'unique':_0xd3ab('0xa')},'ListId':{'type':Sequelize[_0xd3ab('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xd3ab('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xd3ab('0x8')],'unique':_0xd3ab('0xa')},'CampaignId':{'type':Sequelize[_0xd3ab('0x8')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd3ab('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd3ab('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xd3ab('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd3ab('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xd3ab('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index d2f8ae0..bbd875a 100644 --- a/server/api/cmHopper/cmHopper.controller.js +++ b/server/api/cmHopper/cmHopper.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde64=['where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','state','statedesc','deleted','campaign','membername','user','deletedat','format','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','length','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','sequelize','literal','priority','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','getPreviewRecall','transaction','Company','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','push','utcOffset','getTimezone','timezones','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','json','offset','undefined','limit','status','set','update','then','sendStatus','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','query','keys','intersection','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','model','fields','nolimit','order','sort'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xde64,0x17c));var _0x4de6=function(_0x3b9a7b,_0x2547bf){_0x3b9a7b=_0x3b9a7b-0x0;var _0x2309c7=_0xde64[_0x3b9a7b];return _0x2309c7;};'use strict';var moment=require(_0x4de6('0x0'));var _=require(_0x4de6('0x1'));var qs=require(_0x4de6('0x2'));var logger=require(_0x4de6('0x3'))(_0x4de6('0x4'));var shared=require(_0x4de6('0x5'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x3c4b91,_0x3bd290){_0x3bd290=_0x3bd290||0xc8;return function(_0x5a5c5a){if(_0x5a5c5a){return _0x3c4b91['status'](_0x3bd290)[_0x4de6('0x6')](_0x5a5c5a);}};}function respondWithFilteredResult(_0x45867b,_0x4da17f){return function(_0x568496){if(_0x568496){var _0x24edef=typeof _0x4da17f[_0x4de6('0x7')]===_0x4de6('0x8')&&typeof _0x4da17f[_0x4de6('0x9')]===_0x4de6('0x8');var _0x202cdc=_0x568496['count'];var _0x267c1a=_0x24edef?0x0:_0x4da17f[_0x4de6('0x7')];var _0x1dbeed=_0x24edef?_0x568496['count']:_0x4da17f[_0x4de6('0x7')]+_0x4da17f[_0x4de6('0x9')];var _0x2e205b;if(_0x1dbeed>=_0x202cdc){_0x1dbeed=_0x202cdc;_0x2e205b=0xc8;}else{_0x2e205b=0xce;}_0x45867b[_0x4de6('0xa')](_0x2e205b);return _0x45867b[_0x4de6('0xb')]('Content-Range',_0x267c1a+'-'+_0x1dbeed+'/'+_0x202cdc)[_0x4de6('0x6')](_0x568496);}return null;};}function saveUpdates(_0x3baa31,_0xb8e256){return function(_0x509002){if(_0x509002){return _0x509002[_0x4de6('0xc')](_0x3baa31)[_0x4de6('0xd')](function(_0x27c108){return _0x27c108;});}return null;};}function handleEntityNotFound(_0x2bd121,_0x58b0c1){return function(_0x1ccfee){if(!_0x1ccfee){_0x2bd121[_0x4de6('0xe')](0x194);}return _0x1ccfee;};}function handleError(_0x43d59b,_0x4dd3b5){_0x4dd3b5=_0x4dd3b5||0x1f4;return function(_0x33fd67){logger['error'](_0x33fd67['stack']);if(_0x33fd67[_0x4de6('0xf')]){delete _0x33fd67[_0x4de6('0xf')];}_0x43d59b[_0x4de6('0xa')](_0x4dd3b5)[_0x4de6('0x10')](_0x33fd67);};}exports[_0x4de6('0x11')]=function(_0x279278,_0x324202){var _0x5aacb4={},_0x420f7c={},_0xea1610={'count':0x0,'rows':[]};var _0x2c7e57=_[_0x4de6('0x12')](db[_0x4de6('0x13')][_0x4de6('0x14')],function(_0x20855f){return{'name':_0x20855f[_0x4de6('0x15')],'type':_0x20855f[_0x4de6('0x16')][_0x4de6('0x17')]};});_0x420f7c['model']=_[_0x4de6('0x12')](_0x2c7e57,'name');_0x420f7c[_0x4de6('0x18')]=_[_0x4de6('0x19')](_0x279278[_0x4de6('0x18')]);_0x420f7c['filters']=_[_0x4de6('0x1a')](_0x420f7c['model'],_0x420f7c[_0x4de6('0x18')]);_0x420f7c[_0x4de6('0x1b')]=_[_0x4de6('0x1c')](_0x420f7c['filters'],[_0x4de6('0x1d'),_0x4de6('0x1e'),_0x4de6('0x1f'),_0x4de6('0x20'),_0x4de6('0x21'),_0x4de6('0x22'),_0x4de6('0x23'),'$eq',_0x4de6('0x24'),_0x4de6('0x25'),_0x4de6('0x26'),_0x4de6('0x27'),_0x4de6('0x28'),_0x4de6('0x29'),_0x4de6('0x2a'),_0x4de6('0x2b'),_0x4de6('0x2c'),'$like',_0x4de6('0x2d'),_0x4de6('0x2e'),_0x4de6('0x2f'),_0x4de6('0x30')]);_0x5aacb4[_0x4de6('0x31')]=_['intersection'](_0x420f7c[_0x4de6('0x32')],qs['fields'](_0x279278[_0x4de6('0x18')][_0x4de6('0x33')]));_0x5aacb4[_0x4de6('0x31')]=_0x5aacb4[_0x4de6('0x31')]['length']?_0x5aacb4['attributes']:_0x420f7c['model'];if(!_0x279278['query']['hasOwnProperty'](_0x4de6('0x34'))){_0x5aacb4[_0x4de6('0x9')]=qs[_0x4de6('0x9')](_0x279278[_0x4de6('0x18')][_0x4de6('0x9')]);_0x5aacb4[_0x4de6('0x7')]=qs[_0x4de6('0x7')](_0x279278[_0x4de6('0x18')][_0x4de6('0x7')]);}_0x5aacb4[_0x4de6('0x35')]=qs[_0x4de6('0x36')](_0x279278[_0x4de6('0x18')][_0x4de6('0x36')]);_0x5aacb4[_0x4de6('0x37')]=qs[_0x4de6('0x1b')](_[_0x4de6('0x38')](_0x279278[_0x4de6('0x18')],_0x420f7c[_0x4de6('0x1b')]),_0x2c7e57);if(_0x279278[_0x4de6('0x18')][_0x4de6('0x39')]){_0x5aacb4[_0x4de6('0x37')]=_[_0x4de6('0x3a')](_0x5aacb4[_0x4de6('0x37')],{'$or':_[_0x4de6('0x12')](_0x2c7e57,function(_0x1aab6e){if(_0x1aab6e[_0x4de6('0x16')]!==_0x4de6('0x3b')){var _0x12d20e={};_0x12d20e[_0x1aab6e[_0x4de6('0xf')]]={'$like':'%'+_0x279278['query'][_0x4de6('0x39')]+'%'};return _0x12d20e;}})});}_0x5aacb4=_[_0x4de6('0x3a')]({},_0x5aacb4,_0x279278[_0x4de6('0x3c')]);var _0x3bf31f={'where':_0x5aacb4['where']};return db[_0x4de6('0x13')][_0x4de6('0x3d')](_0x3bf31f)[_0x4de6('0xd')](function(_0x122493){_0xea1610['count']=_0x122493;if(_0x279278[_0x4de6('0x18')]['includeAll']){_0x5aacb4[_0x4de6('0x3e')]=[{'all':!![]}];}return db[_0x4de6('0x13')][_0x4de6('0x3f')](_0x5aacb4);})[_0x4de6('0xd')](function(_0x37feb0){_0xea1610[_0x4de6('0x40')]=_0x37feb0;return _0xea1610;})[_0x4de6('0xd')](respondWithFilteredResult(_0x324202,_0x5aacb4))[_0x4de6('0x41')](handleError(_0x324202,null));};exports[_0x4de6('0x42')]=function(_0xdfa5ed,_0x85581b){var _0x1f0262={'raw':!![],'where':{'id':_0xdfa5ed['params']['id']}},_0x551440={};_0x551440[_0x4de6('0x32')]=_[_0x4de6('0x19')](db[_0x4de6('0x13')][_0x4de6('0x14')]);_0x551440['query']=_['keys'](_0xdfa5ed[_0x4de6('0x18')]);_0x551440['filters']=_[_0x4de6('0x1a')](_0x551440['model'],_0x551440[_0x4de6('0x18')]);_0x1f0262['attributes']=_[_0x4de6('0x1a')](_0x551440[_0x4de6('0x32')],qs[_0x4de6('0x33')](_0xdfa5ed[_0x4de6('0x18')]['fields']));_0x1f0262[_0x4de6('0x31')]=_0x1f0262[_0x4de6('0x31')]['length']?_0x1f0262['attributes']:_0x551440[_0x4de6('0x32')];if(_0xdfa5ed['query'][_0x4de6('0x43')]){_0x1f0262[_0x4de6('0x3e')]=[{'all':!![]}];}_0x1f0262=_[_0x4de6('0x3a')]({},_0x1f0262,_0xdfa5ed[_0x4de6('0x3c')]);return db[_0x4de6('0x13')][_0x4de6('0x44')](_0x1f0262)[_0x4de6('0xd')](handleEntityNotFound(_0x85581b,null))[_0x4de6('0xd')](respondWithResult(_0x85581b,null))[_0x4de6('0x41')](handleError(_0x85581b,null));};exports[_0x4de6('0x45')]=function(_0x2cb079,_0x90ad4f){return db['CmHopper']['create'](_0x2cb079['body'],{})[_0x4de6('0xd')](respondWithResult(_0x90ad4f,0xc9))[_0x4de6('0x41')](handleError(_0x90ad4f,null));};exports['update']=function(_0x57fb2f,_0x16a12d){if(_0x57fb2f['body']['id']){delete _0x57fb2f[_0x4de6('0x46')]['id'];}return db[_0x4de6('0x13')]['find']({'where':{'id':_0x57fb2f[_0x4de6('0x47')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x16a12d,null))[_0x4de6('0xd')](saveUpdates(_0x57fb2f[_0x4de6('0x46')],null))[_0x4de6('0xd')](respondWithResult(_0x16a12d,null))['catch'](handleError(_0x16a12d,null));};exports[_0x4de6('0x48')]=function(_0x388b78,_0x2e23ad){return db[_0x4de6('0x13')][_0x4de6('0x48')]()[_0x4de6('0xd')](respondWithResult(_0x2e23ad,null))[_0x4de6('0x41')](handleError(_0x2e23ad,null));};exports[_0x4de6('0x49')]=function(_0x698dcb,_0x3126f1){var _0x367c8f;var _0x35df53=_0x698dcb[_0x4de6('0x47')]['id'];return db[_0x4de6('0x13')][_0x4de6('0x44')]({'where':{'id':_0x698dcb[_0x4de6('0x47')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x3126f1,null))['then'](function(_0x5eab19){if(_0x5eab19){return _0x5eab19[_0x4de6('0x49')]()[_0x4de6('0xd')](function(_0x524807){return _0x524807;});}})[_0x4de6('0xd')](function(_0x191f93){_0x367c8f=_0x191f93;if(_0x191f93){if(_0x191f93[_0x4de6('0x4a')]||_0x191f93[_0x4de6('0x4b')]){return db[_0x191f93[_0x4de6('0x4a')]?_0x4de6('0x4c'):_0x4de6('0x4d')]['find']({'where':{'id':_0x191f93[_0x4de6('0x4a')]?_0x191f93['VoiceQueueId']:_0x191f93[_0x4de6('0x4b')]},'attributes':['id',_0x4de6('0xf')],'raw':!![]});}}})[_0x4de6('0xd')](function(_0xb8b798){var _0x3326ad={};if(_0xb8b798){_[_0x4de6('0x3a')](_0x3326ad,_[_0x4de6('0x4e')](_0x367c8f[_0x4de6('0x4f')],['createdAt','updatedAt','id']));_0x3326ad[_0x4de6('0x50')]=0x15;_0x3326ad[_0x4de6('0x51')]=_0x4de6('0x52');_0x3326ad[_0x4de6('0x53')]=_0xb8b798['name'];_0x3326ad[_0x4de6('0x54')]=_0x698dcb[_0x4de6('0x55')][_0x4de6('0xf')];_0x3326ad['UserId']=_0x698dcb[_0x4de6('0x55')]['id'];_0x3326ad['deleted']=!![];_0x3326ad[_0x4de6('0x56')]=moment()[_0x4de6('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x3326ad[_0x4de6('0x58')]=_0x367c8f[_0x4de6('0x59')];_0x3326ad['campaigntype']=_0x367c8f[_0x4de6('0x4a')]?_0x4de6('0x5a'):_0x4de6('0x5b');return db[_0x4de6('0x5c')][_0x4de6('0x44')]({'where':{'id':_0x3326ad[_0x4de6('0x5d')]},'attributes':[_0x4de6('0x5e'),_0x4de6('0x5f')]})[_0x4de6('0xd')](function(_0x46b82f){if(!_[_0x4de6('0x60')](_0x3126f1)&&!_['isNil'](_0x46b82f[_0x4de6('0x5e')])){_0x3326ad[_0x4de6('0x61')]=_0x46b82f[_0x4de6('0x5e')];if(!_['isNil'](_0x46b82f[_0x4de6('0x5f')])){_0x3326ad[_0x4de6('0x61')]+='\x20'+_0x46b82f['lastName'];}}})[_0x4de6('0x62')](function(){return db[_0x4de6('0x63')][_0x4de6('0x45')](_0x3326ad);});}})[_0x4de6('0xd')](function(_0x49b8c2){return db[_0x4de6('0x64')][_0x4de6('0x49')]({'where':{'CmHopperId':_0x35df53}});})[_0x4de6('0xd')](function(){return _0x3126f1['status'](0xcc)[_0x4de6('0x65')]();})[_0x4de6('0x41')](handleError(_0x3126f1,null));};exports[_0x4de6('0x66')]=function(_0x34065e,_0x1e4dc2){var _0x358faa=[];return db[_0x4de6('0x5c')][_0x4de6('0x48')]()[_0x4de6('0xd')](function(_0x2e748a){_0x358faa=_[_0x4de6('0x19')](_0x2e748a);return _0x34065e[_0x4de6('0x55')][_0x4de6('0x67')]({'where':{'type':_0x4de6('0x68'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x4de6('0x69'),_0x4de6('0x6a')],'raw':!![]});})['then'](function(_0x2f68e2){if(_0x2f68e2&&_0x2f68e2[_0x4de6('0x6b')]){return db['sequelize']['transaction'](function(_0x5b4fe9){var _0x4ebcd3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4de6('0x57')](_0x4de6('0x6c'))},'VoiceQueueId':{'$in':_[_0x4de6('0x12')](_0x2f68e2,'id')},'$or':[{'UserId':null},{'UserId':_0x34065e[_0x4de6('0x55')]['id']}]};var _0x3b3a3c={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2f68e2)[_0x4de6('0x39')]([_0x4de6('0x6a'),0x0])[_0x4de6('0x12')]('id')[_0x4de6('0x6d')]()},'$or':[{'UserId':null},{'UserId':_0x34065e['user']['id']}]};var _0x5e400b={'$or':[_0x4ebcd3,_0x3b3a3c]};var _0x1dae3a=[];if(_0x34065e[_0x4de6('0x46')]['direction']&&_0x34065e[_0x4de6('0x46')][_0x4de6('0x6e')]===_0x4de6('0x6f')){if(!_[_0x4de6('0x70')](_0x34065e[_0x4de6('0x46')][_0x4de6('0x71')])){_0x5e400b['id']={'$in':_0x34065e[_0x4de6('0x46')][_0x4de6('0x71')]};}_0x1dae3a=[['priority',_0x4de6('0x72')],[_0x4de6('0x73'),_0x2f68e2[0x0]['dialOrderByScheduledAt']==='ASC'?_0x4de6('0x74'):_0x4de6('0x72')],db[_0x4de6('0x75')][_0x4de6('0x76')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x4de6('0x74')]];}else{if(!_['isEmpty'](_0x34065e['body'][_0x4de6('0x71')])){_0x5e400b['id']={'$notIn':_0x34065e['body']['hopperIds']};}_0x1dae3a=[[_0x4de6('0x77'),_0x4de6('0x74')],['scheduledAt',_0x2f68e2[0x0][_0x4de6('0x69')]],db[_0x4de6('0x75')][_0x4de6('0x76')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db['CmHopper'][_0x4de6('0x78')]({'attributes':['id',_0x4de6('0x79'),_0x4de6('0x59'),_0x4de6('0x7a')],'where':_0x5e400b,'order':_0x1dae3a,'transaction':_0x5b4fe9,'lock':_0x5b4fe9[_0x4de6('0x7b')][_0x4de6('0x7c')],'include':[{'model':db['CmContact'],'as':_0x4de6('0x7d'),'attributes':_0x358faa,'include':[{'model':db[_0x4de6('0x7e')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x4de6('0x7f')],'as':_0x4de6('0x80'),'attributes':['id','name']},{'model':db[_0x4de6('0x4c')],'as':_0x4de6('0x81'),'attributes':['id',_0x4de6('0xf'),_0x4de6('0x82')]}]})['then'](function(_0x1b5b36){if(_0x1b5b36){return _0x1b5b36[_0x4de6('0xc')]({'UserId':_0x34065e['user']['id']},{'transaction':_0x5b4fe9});}});});}})[_0x4de6('0xd')](handleEntityNotFound(_0x1e4dc2,null))[_0x4de6('0xd')](respondWithResult(_0x1e4dc2,null))[_0x4de6('0x41')](handleError(_0x1e4dc2,null));};exports[_0x4de6('0x83')]=function(_0x7efb2,_0x3129cb,_0xeaf72e){var _0x5f3afe=[];var _0x318caa=_0x7efb2[_0x4de6('0x47')]['id'];var _0x43380a=_0x7efb2[_0x4de6('0x55')]['id'];return db[_0x4de6('0x5c')][_0x4de6('0x48')]()['then'](function(_0x1eca16){_0x5f3afe=_[_0x4de6('0x19')](_0x1eca16);return db[_0x4de6('0x75')][_0x4de6('0x84')](function(_0x17519a){const _0x1d504f={'id':_0x318caa};return db[_0x4de6('0x13')][_0x4de6('0x78')]({'attributes':['id',_0x4de6('0x79'),_0x4de6('0x7a')],'where':_0x1d504f,'transaction':_0x17519a,'lock':_0x17519a[_0x4de6('0x7b')][_0x4de6('0x7c')],'include':[{'model':db[_0x4de6('0x5c')],'as':_0x4de6('0x7d'),'attributes':_0x5f3afe,'include':[{'model':db[_0x4de6('0x7e')],'as':_0x4de6('0x85'),'attributes':['id',_0x4de6('0xf')]}]},{'model':db['CmList'],'as':_0x4de6('0x80'),'attributes':['id',_0x4de6('0xf')]},{'model':db[_0x4de6('0x4c')],'as':_0x4de6('0x81'),'attributes':['id','name',_0x4de6('0x82')]}]})['then'](function(_0x3d6e0d){if(_0x3d6e0d){return _0x3d6e0d[_0x4de6('0xc')]({'UserId':_0x43380a},{'transaction':_0x17519a});}});});})[_0x4de6('0xd')](handleEntityNotFound(_0x3129cb,null))[_0x4de6('0xd')](respondWithResult(_0x3129cb,null))[_0x4de6('0x41')](handleError(_0x3129cb,null));};exports['getOpenContacts']=function(_0x104b48,_0x58e78c){return _0x104b48[_0x4de6('0x55')][_0x4de6('0x67')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x4de6('0x86')},'attributes':['id'],'raw':!![]})['then'](function(_0x4d0cde){if(_0x4d0cde&&_0x4d0cde['length']){return db[_0x4de6('0x13')][_0x4de6('0x3d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4de6('0x57')](_0x4de6('0x6c'))},'VoiceQueueId':{'$in':_[_0x4de6('0x12')](_0x4d0cde,'id')},'$or':[{'UserId':null},{'UserId':_0x104b48[_0x4de6('0x55')]['id']}]}});}return 0x0;})[_0x4de6('0xd')](function(_0x43bd4b){if(!_['isNil'](_0x43bd4b)&&_[_0x4de6('0x87')](_0x43bd4b)){return _0x58e78c[_0x4de6('0xa')](0xc8)[_0x4de6('0x6')]({'contacts':_0x43bd4b});}else{logger[_0x4de6('0x88')](_0x4de6('0x89'),_0x4de6('0x8a'),0x194,_0x4de6('0x8b'));_0x58e78c[_0x4de6('0xe')](0x194);}})[_0x4de6('0x41')](handleError(_0x58e78c,null));};exports[_0x4de6('0x8c')]=function(_0x261539,_0x1582be){var _0x4cfe36=shared['timezones'];var _0x2060da=[];_[_0x4de6('0x12')](_0x4cfe36,function(_0x117272){_0x2060da[_0x4de6('0x8d')]({'id':_0x117272[_0x4de6('0xf')],'name':_0x117272[_0x4de6('0xf')],'utcOffset':_0x117272[_0x4de6('0x8e')]});});return _0x1582be['status'](0xc8)['json']({'tz':_0x2060da});};exports[_0x4de6('0x8f')]=function(_0xd3fe83,_0x427a2b){var _0x556bd4=shared[_0x4de6('0x90')];var _0x874c1f={};if(!_[_0x4de6('0x60')](_0x556bd4[_0xd3fe83[_0x4de6('0x46')]['id']]))_0x874c1f=_0x556bd4[_0xd3fe83[_0x4de6('0x46')]['id']];return _0x427a2b[_0x4de6('0xa')](0xc8)[_0x4de6('0x6')](_0x874c1f);}; \ No newline at end of file +var _0x0e85=['json','offset','undefined','limit','count','update','then','sendStatus','error','stack','name','send','map','CmHopper','type','key','model','keys','query','intersection','filters','concat','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$notIn','$like','$notLike','$iLike','$contains','$contained','$any','fields','attributes','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','length','merge','create','body','find','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','deleted','campaign','membername','user','deletedat','format','calleridnum','phone','campaigntype','queue','ivr','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','CmHopperAdditionalPhone','end','CmContact','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','CmList','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','moment','lodash','../../config/logger','api','status'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x0e85,0x7c));var _0x50e8=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x0e85[_0x173441];return _0x2423a8;};'use strict';var moment=require(_0x50e8('0x0'));var _=require(_0x50e8('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x50e8('0x2'))(_0x50e8('0x3'));var shared=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithResult(_0x4ce6cd,_0x236cf3){_0x236cf3=_0x236cf3||0xc8;return function(_0x4e90e7){if(_0x4e90e7){return _0x4ce6cd[_0x50e8('0x4')](_0x236cf3)[_0x50e8('0x5')](_0x4e90e7);}};}function respondWithFilteredResult(_0xe3151e,_0xfde42){return function(_0x5e8b01){if(_0x5e8b01){var _0x3ce904=typeof _0xfde42[_0x50e8('0x6')]===_0x50e8('0x7')&&typeof _0xfde42[_0x50e8('0x8')]===_0x50e8('0x7');var _0x15f2bc=_0x5e8b01['count'];var _0x11717c=_0x3ce904?0x0:_0xfde42[_0x50e8('0x6')];var _0x19d1bc=_0x3ce904?_0x5e8b01[_0x50e8('0x9')]:_0xfde42[_0x50e8('0x6')]+_0xfde42[_0x50e8('0x8')];var _0x45dc6f;if(_0x19d1bc>=_0x15f2bc){_0x19d1bc=_0x15f2bc;_0x45dc6f=0xc8;}else{_0x45dc6f=0xce;}_0xe3151e[_0x50e8('0x4')](_0x45dc6f);return _0xe3151e['set']('Content-Range',_0x11717c+'-'+_0x19d1bc+'/'+_0x15f2bc)[_0x50e8('0x5')](_0x5e8b01);}return null;};}function saveUpdates(_0x24d381,_0x508377){return function(_0x49e02f){if(_0x49e02f){return _0x49e02f[_0x50e8('0xa')](_0x24d381)[_0x50e8('0xb')](function(_0x1a4c85){return _0x1a4c85;});}return null;};}function handleEntityNotFound(_0x473aa7,_0x54efd3){return function(_0x18596f){if(!_0x18596f){_0x473aa7[_0x50e8('0xc')](0x194);}return _0x18596f;};}function handleError(_0x24313d,_0x5c3baa){_0x5c3baa=_0x5c3baa||0x1f4;return function(_0x5524a3){logger[_0x50e8('0xd')](_0x5524a3[_0x50e8('0xe')]);if(_0x5524a3[_0x50e8('0xf')]){delete _0x5524a3[_0x50e8('0xf')];}_0x24313d[_0x50e8('0x4')](_0x5c3baa)[_0x50e8('0x10')](_0x5524a3);};}exports['index']=function(_0x5a5ef2,_0x441f25){var _0xc97063={},_0x40d060={},_0x45ce11={'count':0x0,'rows':[]};var _0x5dae4e=_[_0x50e8('0x11')](db[_0x50e8('0x12')]['rawAttributes'],function(_0x415596){return{'name':_0x415596['fieldName'],'type':_0x415596[_0x50e8('0x13')][_0x50e8('0x14')]};});_0x40d060[_0x50e8('0x15')]=_[_0x50e8('0x11')](_0x5dae4e,_0x50e8('0xf'));_0x40d060['query']=_[_0x50e8('0x16')](_0x5a5ef2[_0x50e8('0x17')]);_0x40d060['filters']=_[_0x50e8('0x18')](_0x40d060[_0x50e8('0x15')],_0x40d060['query']);_0x40d060[_0x50e8('0x19')]=_[_0x50e8('0x1a')](_0x40d060['filters'],['$and','$or',_0x50e8('0x1b'),_0x50e8('0x1c'),_0x50e8('0x1d'),_0x50e8('0x1e'),_0x50e8('0x1f'),_0x50e8('0x20'),'$not',_0x50e8('0x21'),_0x50e8('0x22'),'$in',_0x50e8('0x23'),_0x50e8('0x24'),_0x50e8('0x25'),_0x50e8('0x26'),'$notILike',_0x50e8('0x24'),'$overlap',_0x50e8('0x27'),_0x50e8('0x28'),_0x50e8('0x29')]);_0xc97063['attributes']=_[_0x50e8('0x18')](_0x40d060[_0x50e8('0x15')],qs[_0x50e8('0x2a')](_0x5a5ef2[_0x50e8('0x17')][_0x50e8('0x2a')]));_0xc97063[_0x50e8('0x2b')]=_0xc97063[_0x50e8('0x2b')]['length']?_0xc97063[_0x50e8('0x2b')]:_0x40d060[_0x50e8('0x15')];if(!_0x5a5ef2['query']['hasOwnProperty'](_0x50e8('0x2c'))){_0xc97063[_0x50e8('0x8')]=qs[_0x50e8('0x8')](_0x5a5ef2['query']['limit']);_0xc97063[_0x50e8('0x6')]=qs[_0x50e8('0x6')](_0x5a5ef2['query'][_0x50e8('0x6')]);}_0xc97063[_0x50e8('0x2d')]=qs[_0x50e8('0x2e')](_0x5a5ef2[_0x50e8('0x17')]['sort']);_0xc97063[_0x50e8('0x2f')]=qs['filters'](_[_0x50e8('0x30')](_0x5a5ef2[_0x50e8('0x17')],_0x40d060[_0x50e8('0x19')]),_0x5dae4e);if(_0x5a5ef2['query'][_0x50e8('0x31')]){_0xc97063[_0x50e8('0x2f')]=_['merge'](_0xc97063[_0x50e8('0x2f')],{'$or':_[_0x50e8('0x11')](_0x5dae4e,function(_0x5db19b){if(_0x5db19b[_0x50e8('0x13')]!=='VIRTUAL'){var _0x1c513c={};_0x1c513c[_0x5db19b[_0x50e8('0xf')]]={'$like':'%'+_0x5a5ef2[_0x50e8('0x17')][_0x50e8('0x31')]+'%'};return _0x1c513c;}})});}_0xc97063=_['merge']({},_0xc97063,_0x5a5ef2[_0x50e8('0x32')]);var _0x2d0ccf={'where':_0xc97063[_0x50e8('0x2f')]};return db['CmHopper']['count'](_0x2d0ccf)['then'](function(_0xd39553){_0x45ce11[_0x50e8('0x9')]=_0xd39553;if(_0x5a5ef2[_0x50e8('0x17')][_0x50e8('0x33')]){_0xc97063[_0x50e8('0x34')]=[{'all':!![]}];}return db[_0x50e8('0x12')][_0x50e8('0x35')](_0xc97063);})[_0x50e8('0xb')](function(_0x35f802){_0x45ce11[_0x50e8('0x36')]=_0x35f802;return _0x45ce11;})['then'](respondWithFilteredResult(_0x441f25,_0xc97063))[_0x50e8('0x37')](handleError(_0x441f25,null));};exports[_0x50e8('0x38')]=function(_0x2379cf,_0x2bf413){var _0x5dbbe1={'raw':!![],'where':{'id':_0x2379cf[_0x50e8('0x39')]['id']}},_0x443aa2={};_0x443aa2[_0x50e8('0x15')]=_[_0x50e8('0x16')](db[_0x50e8('0x12')]['rawAttributes']);_0x443aa2['query']=_[_0x50e8('0x16')](_0x2379cf[_0x50e8('0x17')]);_0x443aa2['filters']=_[_0x50e8('0x18')](_0x443aa2[_0x50e8('0x15')],_0x443aa2[_0x50e8('0x17')]);_0x5dbbe1[_0x50e8('0x2b')]=_[_0x50e8('0x18')](_0x443aa2[_0x50e8('0x15')],qs[_0x50e8('0x2a')](_0x2379cf[_0x50e8('0x17')]['fields']));_0x5dbbe1[_0x50e8('0x2b')]=_0x5dbbe1[_0x50e8('0x2b')][_0x50e8('0x3a')]?_0x5dbbe1[_0x50e8('0x2b')]:_0x443aa2['model'];if(_0x2379cf[_0x50e8('0x17')][_0x50e8('0x33')]){_0x5dbbe1[_0x50e8('0x34')]=[{'all':!![]}];}_0x5dbbe1=_[_0x50e8('0x3b')]({},_0x5dbbe1,_0x2379cf['options']);return db[_0x50e8('0x12')]['find'](_0x5dbbe1)['then'](handleEntityNotFound(_0x2bf413,null))['then'](respondWithResult(_0x2bf413,null))[_0x50e8('0x37')](handleError(_0x2bf413,null));};exports[_0x50e8('0x3c')]=function(_0x48f145,_0x6fef25){return db[_0x50e8('0x12')][_0x50e8('0x3c')](_0x48f145[_0x50e8('0x3d')],{})[_0x50e8('0xb')](respondWithResult(_0x6fef25,0xc9))[_0x50e8('0x37')](handleError(_0x6fef25,null));};exports['update']=function(_0x16fdf6,_0x596f62){if(_0x16fdf6[_0x50e8('0x3d')]['id']){delete _0x16fdf6[_0x50e8('0x3d')]['id'];}return db['CmHopper'][_0x50e8('0x3e')]({'where':{'id':_0x16fdf6['params']['id']}})[_0x50e8('0xb')](handleEntityNotFound(_0x596f62,null))[_0x50e8('0xb')](saveUpdates(_0x16fdf6[_0x50e8('0x3d')],null))[_0x50e8('0xb')](respondWithResult(_0x596f62,null))[_0x50e8('0x37')](handleError(_0x596f62,null));};exports[_0x50e8('0x3f')]=function(_0x229d60,_0x3e52b3){return db[_0x50e8('0x12')][_0x50e8('0x3f')]()[_0x50e8('0xb')](respondWithResult(_0x3e52b3,null))['catch'](handleError(_0x3e52b3,null));};exports[_0x50e8('0x40')]=function(_0x275a1b,_0x479431){var _0x3692ba;var _0x58f14e=_0x275a1b[_0x50e8('0x39')]['id'];return db['CmHopper'][_0x50e8('0x3e')]({'where':{'id':_0x275a1b[_0x50e8('0x39')]['id']}})[_0x50e8('0xb')](handleEntityNotFound(_0x479431,null))[_0x50e8('0xb')](function(_0x10b229){if(_0x10b229){return _0x10b229[_0x50e8('0x40')]()[_0x50e8('0xb')](function(_0x5f256a){return _0x5f256a;});}})[_0x50e8('0xb')](function(_0x212ece){_0x3692ba=_0x212ece;if(_0x212ece){if(_0x212ece[_0x50e8('0x41')]||_0x212ece[_0x50e8('0x42')]){return db[_0x212ece[_0x50e8('0x41')]?_0x50e8('0x43'):'Campaign'][_0x50e8('0x3e')]({'where':{'id':_0x212ece[_0x50e8('0x41')]?_0x212ece[_0x50e8('0x41')]:_0x212ece[_0x50e8('0x42')]},'attributes':['id','name'],'raw':!![]});}}})[_0x50e8('0xb')](function(_0x167b8f){var _0x3476c5={};if(_0x167b8f){_[_0x50e8('0x3b')](_0x3476c5,_[_0x50e8('0x44')](_0x3692ba[_0x50e8('0x45')],[_0x50e8('0x46'),'updatedAt','id']));_0x3476c5['state']=0x15;_0x3476c5['statedesc']=_0x50e8('0x47');_0x3476c5[_0x50e8('0x48')]=_0x167b8f[_0x50e8('0xf')];_0x3476c5[_0x50e8('0x49')]=_0x275a1b[_0x50e8('0x4a')][_0x50e8('0xf')];_0x3476c5['UserId']=_0x275a1b[_0x50e8('0x4a')]['id'];_0x3476c5[_0x50e8('0x47')]=!![];_0x3476c5[_0x50e8('0x4b')]=moment()[_0x50e8('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3476c5[_0x50e8('0x4d')]=_0x3692ba[_0x50e8('0x4e')];_0x3476c5[_0x50e8('0x4f')]=_0x3692ba[_0x50e8('0x41')]?_0x50e8('0x50'):_0x50e8('0x51');return db['CmContact'][_0x50e8('0x3e')]({'where':{'id':_0x3476c5['ContactId']},'attributes':['firstName','lastName']})[_0x50e8('0xb')](function(_0x49e96f){if(!_[_0x50e8('0x52')](_0x479431)&&!_[_0x50e8('0x52')](_0x49e96f[_0x50e8('0x53')])){_0x3476c5[_0x50e8('0x54')]=_0x49e96f[_0x50e8('0x53')];if(!_[_0x50e8('0x52')](_0x49e96f[_0x50e8('0x55')])){_0x3476c5['calleridname']+='\x20'+_0x49e96f[_0x50e8('0x55')];}}})[_0x50e8('0x56')](function(){return db[_0x50e8('0x57')]['create'](_0x3476c5);});}})['then'](function(_0x53dcdc){return db[_0x50e8('0x58')][_0x50e8('0x40')]({'where':{'CmHopperId':_0x58f14e}});})[_0x50e8('0xb')](function(){return _0x479431[_0x50e8('0x4')](0xcc)[_0x50e8('0x59')]();})[_0x50e8('0x37')](handleError(_0x479431,null));};exports['getPreview']=function(_0x42c2d0,_0x52d00b){var _0x255b48=[];return db[_0x50e8('0x5a')]['describe']()['then'](function(_0x51775a){_0x255b48=_[_0x50e8('0x16')](_0x51775a);return _0x42c2d0[_0x50e8('0x4a')]['getVoiceQueues']({'where':{'type':_0x50e8('0x5b'),'dialActive':!![],'dialMethod':_0x50e8('0x5c')},'attributes':['id',_0x50e8('0x5d'),_0x50e8('0x5e')],'raw':!![]});})[_0x50e8('0xb')](function(_0x47b428){if(_0x47b428&&_0x47b428[_0x50e8('0x3a')]){return db[_0x50e8('0x5f')][_0x50e8('0x60')](function(_0x4b80ac){var _0x583e58={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x50e8('0x4c')](_0x50e8('0x61'))},'VoiceQueueId':{'$in':_[_0x50e8('0x11')](_0x47b428,'id')},'$or':[{'UserId':null},{'UserId':_0x42c2d0[_0x50e8('0x4a')]['id']}]};var _0x2b59f5={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x47b428)[_0x50e8('0x31')](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0x50e8('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x42c2d0['user']['id']}]};var _0x1fc530={'$or':[_0x583e58,_0x2b59f5]};var _0x36a288=[];if(_0x42c2d0['body'][_0x50e8('0x63')]&&_0x42c2d0['body']['direction']==='prev'){if(!_[_0x50e8('0x64')](_0x42c2d0[_0x50e8('0x3d')][_0x50e8('0x65')])){_0x1fc530['id']={'$in':_0x42c2d0[_0x50e8('0x3d')]['hopperIds']};}_0x36a288=[['priority',_0x50e8('0x66')],[_0x50e8('0x67'),_0x47b428[0x0][_0x50e8('0x5d')]===_0x50e8('0x66')?_0x50e8('0x68'):_0x50e8('0x66')],db[_0x50e8('0x5f')][_0x50e8('0x69')](_0x50e8('0x6a')),['id',_0x50e8('0x68')]];}else{if(!_[_0x50e8('0x64')](_0x42c2d0[_0x50e8('0x3d')][_0x50e8('0x65')])){_0x1fc530['id']={'$notIn':_0x42c2d0[_0x50e8('0x3d')][_0x50e8('0x65')]};}_0x36a288=[[_0x50e8('0x6b'),_0x50e8('0x68')],[_0x50e8('0x67'),_0x47b428[0x0]['dialOrderByScheduledAt']],db[_0x50e8('0x5f')][_0x50e8('0x69')](_0x50e8('0x6c')),['id',_0x50e8('0x66')]];}return db['CmHopper'][_0x50e8('0x6d')]({'attributes':['id',_0x50e8('0x6e'),_0x50e8('0x4e'),_0x50e8('0x6f')],'where':_0x1fc530,'order':_0x36a288,'transaction':_0x4b80ac,'lock':_0x4b80ac[_0x50e8('0x70')][_0x50e8('0x71')],'include':[{'model':db['CmContact'],'as':_0x50e8('0x72'),'attributes':_0x255b48,'include':[{'model':db[_0x50e8('0x73')],'as':_0x50e8('0x74'),'attributes':['id',_0x50e8('0xf')]}]},{'model':db['CmList'],'as':_0x50e8('0x75'),'attributes':['id','name']},{'model':db[_0x50e8('0x43')],'as':_0x50e8('0x76'),'attributes':['id',_0x50e8('0xf'),_0x50e8('0x77')]}]})[_0x50e8('0xb')](function(_0x581d02){if(_0x581d02){return _0x581d02[_0x50e8('0xa')]({'UserId':_0x42c2d0[_0x50e8('0x4a')]['id']},{'transaction':_0x4b80ac});}});});}})[_0x50e8('0xb')](handleEntityNotFound(_0x52d00b,null))[_0x50e8('0xb')](respondWithResult(_0x52d00b,null))[_0x50e8('0x37')](handleError(_0x52d00b,null));};exports[_0x50e8('0x78')]=function(_0x58541c,_0x248f73,_0x1cc566){var _0x4fc73d=[];var _0x2d35ab=_0x58541c[_0x50e8('0x39')]['id'];var _0x4f72e7=_0x58541c[_0x50e8('0x4a')]['id'];return db['CmContact'][_0x50e8('0x3f')]()[_0x50e8('0xb')](function(_0x5f20dc){_0x4fc73d=_[_0x50e8('0x16')](_0x5f20dc);return db[_0x50e8('0x5f')][_0x50e8('0x60')](function(_0x10bdad){const _0x5df5e8={'id':_0x2d35ab};return db[_0x50e8('0x12')]['findOne']({'attributes':['id',_0x50e8('0x6e'),_0x50e8('0x6f')],'where':_0x5df5e8,'transaction':_0x10bdad,'lock':_0x10bdad['LOCK'][_0x50e8('0x71')],'include':[{'model':db[_0x50e8('0x5a')],'as':_0x50e8('0x72'),'attributes':_0x4fc73d,'include':[{'model':db[_0x50e8('0x73')],'as':_0x50e8('0x74'),'attributes':['id',_0x50e8('0xf')]}]},{'model':db[_0x50e8('0x79')],'as':_0x50e8('0x75'),'attributes':['id',_0x50e8('0xf')]},{'model':db['VoiceQueue'],'as':_0x50e8('0x76'),'attributes':['id',_0x50e8('0xf'),_0x50e8('0x77')]}]})['then'](function(_0x7d64e0){if(_0x7d64e0){return _0x7d64e0[_0x50e8('0xa')]({'UserId':_0x4f72e7},{'transaction':_0x10bdad});}});});})[_0x50e8('0xb')](handleEntityNotFound(_0x248f73,null))['then'](respondWithResult(_0x248f73,null))['catch'](handleError(_0x248f73,null));};exports[_0x50e8('0x7a')]=function(_0x440fc7,_0x5d922b){return _0x440fc7[_0x50e8('0x4a')]['getVoiceQueues']({'where':{'type':_0x50e8('0x5b'),'dialActive':!![],'dialMethod':_0x50e8('0x5c')},'attributes':['id'],'raw':!![]})[_0x50e8('0xb')](function(_0x157b27){if(_0x157b27&&_0x157b27['length']){return db[_0x50e8('0x12')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x50e8('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x157b27,'id')},'$or':[{'UserId':null},{'UserId':_0x440fc7[_0x50e8('0x4a')]['id']}]}});}return 0x0;})[_0x50e8('0xb')](function(_0x4a98c9){if(!_[_0x50e8('0x52')](_0x4a98c9)&&_['isNumber'](_0x4a98c9)){return _0x5d922b[_0x50e8('0x4')](0xc8)['json']({'contacts':_0x4a98c9});}else{logger['error'](_0x50e8('0x7b'),_0x50e8('0x7a'),0x194,_0x50e8('0x7c'));_0x5d922b[_0x50e8('0xc')](0x194);}})['catch'](handleError(_0x5d922b,null));};exports[_0x50e8('0x7d')]=function(_0x4ecec9,_0x4a6075){var _0x32879a=shared[_0x50e8('0x7e')];var _0x35def7=[];_['map'](_0x32879a,function(_0x4f6906){_0x35def7['push']({'id':_0x4f6906[_0x50e8('0xf')],'name':_0x4f6906[_0x50e8('0xf')],'utcOffset':_0x4f6906[_0x50e8('0x7f')]});});return _0x4a6075[_0x50e8('0x4')](0xc8)[_0x50e8('0x5')]({'tz':_0x35def7});};exports[_0x50e8('0x80')]=function(_0x500cdd,_0x5a7248){var _0x2e24=shared[_0x50e8('0x7e')];var _0xab3ba={};if(!_[_0x50e8('0x52')](_0x2e24[_0x500cdd[_0x50e8('0x3d')]['id']]))_0xab3ba=_0x2e24[_0x500cdd['body']['id']];return _0x5a7248[_0x50e8('0x4')](0xc8)[_0x50e8('0x5')](_0xab3ba);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 1590947..9d6eb60 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper'];(function(_0x44180d,_0xd2e5be){var _0x495992=function(_0x342203){while(--_0x342203){_0x44180d['push'](_0x44180d['shift']());}};_0x495992(++_0xd2e5be);}(_0x5fc3,0xa8));var _0x35fc=function(_0x21bfab,_0x2fee48){_0x21bfab=_0x21bfab-0x0;var _0x4db318=_0x5fc3[_0x21bfab];return _0x4db318;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('CmHopper',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]},{'name':_0x35fc('0xd'),'fields':[_0x35fc('0xd')]},{'name':_0x35fc('0xe'),'fields':[_0x35fc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','api'];(function(_0x2646a5,_0x1b5c85){var _0x22d33c=function(_0xee2db1){while(--_0xee2db1){_0x2646a5['push'](_0x2646a5['shift']());}};_0x22d33c(++_0x1b5c85);}(_0xfcf0,0x138));var _0x0fcf=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0xfcf0[_0x38987f];return _0x4cb697;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['phone']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 46131c0..5051726 100644 --- a/server/api/cmHopper/cmHopper.rpc.js +++ b/server/api/cmHopper/cmHopper.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf544=['moment','bluebird','../../mysqldb','rpc','GetCmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','CmHopper','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper','update','body','active','DestroyCmHopper','destroy','describe','sequelize','transaction','order','LOCK','UPDATE','CmContact','Contact','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','GetContactDialer','CmHopperFinal','MoveContactManagedDialer','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','dialTimezone','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','\x20MINUTE','NOW()','User','name','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash'];(function(_0x36ed7d,_0x69e281){var _0x529d15=function(_0x57114e){while(--_0x57114e){_0x36ed7d['push'](_0x36ed7d['shift']());}};_0x529d15(++_0x69e281);}(_0xf544,0x99));var _0x4f54=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0xf544[_0x479509];return _0x382da8;};'use strict';var _=require(_0x4f54('0x0'));var util=require('util');var moment=require(_0x4f54('0x1'));var BPromise=require(_0x4f54('0x2'));var db=require(_0x4f54('0x3'))['db'];var logger=require('../../config/logger')(_0x4f54('0x4'));exports[_0x4f54('0x5')]=function(_0x293b80){var _0x40538a=this;return new Promise(function(_0x3cebe6,_0x5bad1a){return db['CmHopper'][_0x4f54('0x6')]({'raw':_0x293b80[_0x4f54('0x7')]?_0x293b80[_0x4f54('0x7')][_0x4f54('0x8')]===undefined?!![]:![]:!![],'where':_0x293b80[_0x4f54('0x7')]?_0x293b80[_0x4f54('0x7')][_0x4f54('0x9')]||null:null,'attributes':_0x293b80[_0x4f54('0x7')]?_0x293b80[_0x4f54('0x7')][_0x4f54('0xa')]||null:null,'limit':_0x293b80[_0x4f54('0x7')]?_0x293b80[_0x4f54('0x7')][_0x4f54('0xb')]||null:null,'include':_0x293b80['options']?_0x293b80[_0x4f54('0x7')][_0x4f54('0xc')]?_[_0x4f54('0xd')](_0x293b80[_0x4f54('0x7')][_0x4f54('0xc')],function(_0x1c10f9){return{'model':db[_0x1c10f9[_0x4f54('0xe')]],'as':_0x1c10f9['as'],'attributes':_0x1c10f9[_0x4f54('0xa')],'include':_0x1c10f9['include']?_['map'](_0x1c10f9[_0x4f54('0xc')],function(_0x41005e){return{'model':db[_0x41005e[_0x4f54('0xe')]],'as':_0x41005e['as'],'attributes':_0x41005e[_0x4f54('0xa')],'include':_0x41005e['include']?_['map'](_0x41005e[_0x4f54('0xc')],function(_0x44e14f){return{'model':db[_0x44e14f['model']],'as':_0x44e14f['as'],'attributes':_0x44e14f[_0x4f54('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4f54('0xf')](function(_0x16a446){logger[_0x4f54('0x10')](_0x4f54('0x5'),_0x293b80);logger[_0x4f54('0x11')](_0x4f54('0x5'),_0x293b80,JSON[_0x4f54('0x12')](_0x16a446));_0x3cebe6(_0x16a446);})[_0x4f54('0x13')](function(_0x33df70){logger[_0x4f54('0x14')](_0x4f54('0x5'),_0x33df70['message'],_0x293b80);_0x5bad1a(_0x40538a['error'](0x1f4,_0x33df70[_0x4f54('0x15')]));});});};exports['ShowCmHopper']=function(_0x24e48d){var _0x2b2eba=this;return new Promise(function(_0x115650,_0x459ae4){return db[_0x4f54('0x16')]['find']({'raw':_0x24e48d[_0x4f54('0x7')]?_0x24e48d[_0x4f54('0x7')][_0x4f54('0x8')]===undefined?!![]:![]:!![],'where':_0x24e48d[_0x4f54('0x7')]?_0x24e48d[_0x4f54('0x7')][_0x4f54('0x9')]||null:null,'attributes':_0x24e48d[_0x4f54('0x7')]?_0x24e48d[_0x4f54('0x7')][_0x4f54('0xa')]||null:null,'include':_0x24e48d[_0x4f54('0x7')]?_0x24e48d['options'][_0x4f54('0xc')]?_['map'](_0x24e48d['options'][_0x4f54('0xc')],function(_0x2bc62d){return{'model':db[_0x2bc62d[_0x4f54('0xe')]],'as':_0x2bc62d['as'],'attributes':_0x2bc62d['attributes'],'include':_0x2bc62d[_0x4f54('0xc')]?_['map'](_0x2bc62d[_0x4f54('0xc')],function(_0x62f9f){return{'model':db[_0x62f9f[_0x4f54('0xe')]],'as':_0x62f9f['as'],'attributes':_0x62f9f['attributes'],'include':_0x62f9f[_0x4f54('0xc')]?_['map'](_0x62f9f[_0x4f54('0xc')],function(_0x172d63){return{'model':db[_0x172d63['model']],'as':_0x172d63['as'],'attributes':_0x172d63['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xfc6095){logger['info'](_0x4f54('0x17'),_0x24e48d);logger[_0x4f54('0x11')](_0x4f54('0x17'),_0x24e48d,JSON[_0x4f54('0x12')](_0xfc6095));_0x115650(_0xfc6095);})['catch'](function(_0x5385fa){logger['error'](_0x4f54('0x17'),_0x5385fa[_0x4f54('0x15')],_0x24e48d);_0x459ae4(_0x2b2eba[_0x4f54('0x14')](0x1f4,_0x5385fa[_0x4f54('0x15')]));});});};exports[_0x4f54('0x18')]=function(_0x58d168){var _0x541ef1=this;return new Promise(function(_0xd1cd2d,_0x2718a1){return db[_0x4f54('0x16')][_0x4f54('0x19')](_0x58d168['body'],{'raw':_0x58d168['options']?_0x58d168[_0x4f54('0x7')]['raw']===undefined?!![]:![]:!![]})[_0x4f54('0xf')](function(_0x3ff4d1){logger[_0x4f54('0x10')](_0x4f54('0x18'),_0x58d168);logger['debug'](_0x4f54('0x18'),_0x58d168,JSON['stringify'](_0x3ff4d1));_0xd1cd2d(_0x3ff4d1);})[_0x4f54('0x13')](function(_0xe89c11){logger[_0x4f54('0x14')]('CreateCmHopper',_0xe89c11[_0x4f54('0x15')],_0x58d168);_0x2718a1(_0x541ef1['error'](0x1f4,_0xe89c11['message']));});});};exports[_0x4f54('0x1a')]=function(_0x1eef53){var _0x44eefd=this;return new Promise(function(_0x3d2ba9,_0x567f56){return db[_0x4f54('0x16')][_0x4f54('0x1b')](_0x1eef53[_0x4f54('0x1c')],{'raw':_0x1eef53[_0x4f54('0x7')]?_0x1eef53[_0x4f54('0x7')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eef53[_0x4f54('0x7')]?_0x1eef53[_0x4f54('0x7')][_0x4f54('0x9')]||null:null,'attributes':_0x1eef53['options']?_0x1eef53[_0x4f54('0x7')]['attributes']||null:null,'limit':_0x1eef53[_0x4f54('0x7')]?_0x1eef53['options']['limit']||null:null})[_0x4f54('0xf')](function(_0x1f942e){logger[_0x4f54('0x10')](_0x4f54('0x1a'),_0x1eef53);logger[_0x4f54('0x10')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x4f54('0x12')](_0x1eef53[_0x4f54('0x7')]['where']),_0x1eef53[_0x4f54('0x1c')][_0x4f54('0x1d')]);logger[_0x4f54('0x11')](_0x4f54('0x1a'),_0x1eef53,JSON[_0x4f54('0x12')](_0x1f942e));_0x3d2ba9(_0x1f942e);})[_0x4f54('0x13')](function(_0xa9c1a5){logger[_0x4f54('0x14')]('UpdateCmHopper',_0xa9c1a5[_0x4f54('0x15')],_0x1eef53);_0x567f56(_0x44eefd['error'](0x1f4,_0xa9c1a5[_0x4f54('0x15')]));});});};exports[_0x4f54('0x1e')]=function(_0x5b9519){var _0x5f2bde=this;return new Promise(function(_0x46ea2e,_0x3be877){return db[_0x4f54('0x16')][_0x4f54('0x1f')]({'where':_0x5b9519[_0x4f54('0x7')]?_0x5b9519[_0x4f54('0x7')][_0x4f54('0x9')]||null:null})[_0x4f54('0xf')](function(_0x278722){logger[_0x4f54('0x10')]('DestroyCmHopper',_0x5b9519);logger[_0x4f54('0x11')]('DestroyCmHopper',_0x5b9519,JSON[_0x4f54('0x12')](_0x278722));_0x46ea2e(_0x278722);})['catch'](function(_0x3e2939){logger[_0x4f54('0x14')](_0x4f54('0x1e'),_0x3e2939[_0x4f54('0x15')],_0x5b9519);_0x3be877(_0x5f2bde['error'](0x1f4,_0x3e2939[_0x4f54('0x15')]));});});};exports['GetContactDialer']=function(_0x4286c0){var _0xbd17aa=this;return new Promise(function(_0x1ae561,_0x56d43f){return db['CmContact'][_0x4f54('0x20')]()[_0x4f54('0xf')](function(_0x27ec05){return db[_0x4f54('0x21')][_0x4f54('0x22')](function(_0x5e0237){return db[_0x4f54('0x16')][_0x4f54('0x6')]({'where':_0x4286c0['options']?_0x4286c0[_0x4f54('0x7')][_0x4f54('0x9')]||null:null,'attributes':_0x4286c0[_0x4f54('0x7')]?_0x4286c0[_0x4f54('0x7')][_0x4f54('0xa')]||null:null,'limit':_0x4286c0[_0x4f54('0x7')]?_0x4286c0[_0x4f54('0x7')][_0x4f54('0xb')]||null:null,'order':_0x4286c0[_0x4f54('0x7')]?_0x4286c0[_0x4f54('0x7')][_0x4f54('0x23')]||null:null,'transaction':_0x5e0237,'lock':_0x5e0237[_0x4f54('0x24')][_0x4f54('0x25')],'include':[{'model':db[_0x4f54('0x26')],'as':_0x4f54('0x27'),'attributes':_['keys'](_0x27ec05)},{'model':db['User'],'as':'Agent','attributes':['id','name',_0x4f54('0x28')]}]})[_0x4f54('0xf')](function(_0x160e46){var _0x34dc3b=[];var _0x254882=[];for(var _0x3e1064=0x0;_0x3e1064<_0x160e46[_0x4f54('0x29')];_0x3e1064+=0x1){var _0x2edb33=_0x160e46[_0x3e1064][_0x4f54('0x2a')];if(_0x2edb33===null){_0x34dc3b[_0x4f54('0x2b')](_0x160e46[_0x3e1064][_0x4f54('0x1b')](_0x4286c0[_0x4f54('0x1c')],{'transaction':_0x5e0237}));}else if(!_0x254882[_0x4f54('0x2c')](_0x2edb33)){_0x254882[_0x4f54('0x2b')](_0x2edb33);_0x34dc3b[_0x4f54('0x2b')](_0x160e46[_0x3e1064]['update'](_0x4286c0[_0x4f54('0x1c')],{'transaction':_0x5e0237}));}}return BPromise[_0x4f54('0x2d')](_0x34dc3b);});})['then'](function(_0x1c4c65){logger[_0x4f54('0x10')]('GetContactDialer',_0x4286c0);if(_0x1c4c65[_0x4f54('0x29')]>0x0){logger[_0x4f54('0x10')](_0x4f54('0x2e'),_0x1c4c65[0x0][_0x4f54('0x2f')]['id'],_0x1c4c65[0x0][_0x4f54('0x2f')][_0x4f54('0x30')],_0x1c4c65[0x0][_0x4f54('0x2f')][_0x4f54('0x1d')]);}logger['debug'](_0x4f54('0x31'),_0x4286c0,JSON[_0x4f54('0x12')](_0x1c4c65));_0x1ae561(_0x1c4c65);})['catch'](function(_0x2b489d){logger[_0x4f54('0x14')](_0x4f54('0x31'),_0x2b489d['message'],_0x4286c0);_0x56d43f(_0xbd17aa[_0x4f54('0x14')](0x1f4,_0x2b489d[_0x4f54('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x28f8b3){var _0x5dc7f9=this;return new Promise(function(_0x18e72e,_0x3d09f9){return db[_0x4f54('0x21')][_0x4f54('0x22')](function(_0x20ef63){return db[_0x4f54('0x32')]['create'](_0x28f8b3['body'],{'raw':_0x28f8b3['options']?_0x28f8b3[_0x4f54('0x7')][_0x4f54('0x8')]===undefined?!![]:![]:!![],'transaction':_0x20ef63})[_0x4f54('0xf')](function(){logger[_0x4f54('0x10')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x4f54('0x12')](_0x28f8b3['options'][_0x4f54('0x9')]),_0x28f8b3[_0x4f54('0x7')][_0x4f54('0x9')]['active']);return db['CmHopper'][_0x4f54('0x1f')]({'where':_0x28f8b3[_0x4f54('0x7')]?_0x28f8b3['options']['where']||null:null,'transaction':_0x20ef63});});})[_0x4f54('0xf')](function(_0x3ff6d5){logger[_0x4f54('0x10')](_0x4f54('0x33'),_0x28f8b3);logger[_0x4f54('0x11')]('MoveContactManagedDialer',_0x28f8b3,JSON['stringify'](_0x3ff6d5));_0x18e72e(_0x3ff6d5);})['catch'](function(_0x40786f){logger[_0x4f54('0x14')](_0x4f54('0x33'),_0x40786f[_0x4f54('0x15')],_0x28f8b3);_0x3d09f9(_0x5dc7f9[_0x4f54('0x14')](0x1f4,_0x40786f[_0x4f54('0x15')]));});});};exports['CountReScheduled']=function(_0x3595fb){var _0x2dbb27=this;return new Promise(function(_0x5e70a7,_0x3723e4){return db[_0x4f54('0x16')][_0x4f54('0x6')]({'raw':_0x3595fb['options']?_0x3595fb[_0x4f54('0x7')][_0x4f54('0x8')]===undefined?!![]:![]:!![],'where':_0x3595fb['options']?_0x3595fb[_0x4f54('0x7')]['where']||null:null,'attributes':[[db[_0x4f54('0x21')]['fn'](_0x4f54('0x34'),db[_0x4f54('0x21')]['fn']('IF',db[_0x4f54('0x21')][_0x4f54('0x35')]('`scheduledat`\x20>=\x20'+util[_0x4f54('0x36')](_0x4f54('0x37'),moment()[_0x4f54('0x36')](_0x4f54('0x38')))+_0x4f54('0x39')))),_0x4f54('0x3a')]]})[_0x4f54('0xf')](function(_0x4518a1){logger['info'](_0x4f54('0x3b'),_0x3595fb);logger[_0x4f54('0x11')](_0x4f54('0x3b'),_0x3595fb,JSON[_0x4f54('0x12')](_0x4518a1));_0x5e70a7(_0x4518a1);})[_0x4f54('0x13')](function(_0x4ba6a4){logger[_0x4f54('0x14')](_0x4f54('0x3b'),_0x4ba6a4['message'],_0x3595fb);_0x3723e4(_0x2dbb27['error'](0x1f4,_0x4ba6a4[_0x4f54('0x15')]));});});};exports[_0x4f54('0x3c')]=function(_0x4e627b){var _0x177e88=this;return new Promise(function(_0x132087,_0x2b0437){return db[_0x4f54('0x26')][_0x4f54('0x20')]()[_0x4f54('0xf')](function(){return db[_0x4f54('0x21')][_0x4f54('0x22')](function(_0x2c3aca){return db[_0x4f54('0x16')]['findAll']({'where':_0x4e627b[_0x4f54('0x7')]?_0x4e627b['options'][_0x4f54('0x9')]||null:null,'attributes':_0x4e627b[_0x4f54('0x7')]?_0x4e627b[_0x4f54('0x7')][_0x4f54('0xa')]||null:null,'limit':0x1,'order':_0x4e627b[_0x4f54('0x7')]?_0x4e627b[_0x4f54('0x7')][_0x4f54('0x23')]||null:null,'group':db[_0x4f54('0x16')][_0x4f54('0x2a')],'transaction':_0x2c3aca,'lock':_0x2c3aca[_0x4f54('0x24')][_0x4f54('0x25')],'include':_0x4e627b['options']?_0x4e627b[_0x4f54('0x7')][_0x4f54('0xc')]?_[_0x4f54('0xd')](_0x4e627b[_0x4f54('0x7')][_0x4f54('0xc')],function(_0xfa4430){return{'model':db[_0xfa4430[_0x4f54('0xe')]],'as':_0xfa4430['as'],'attributes':_0xfa4430[_0x4f54('0xa')],'include':_0xfa4430[_0x4f54('0xc')]?_[_0x4f54('0xd')](_0xfa4430[_0x4f54('0xc')],function(_0x97acd0){return{'model':db[_0x97acd0[_0x4f54('0xe')]],'as':_0x97acd0['as'],'attributes':_0x97acd0[_0x4f54('0xa')],'include':_0x97acd0[_0x4f54('0xc')]?_[_0x4f54('0xd')](_0x97acd0['include'],function(_0x2f1d1f){return{'model':db[_0x2f1d1f[_0x4f54('0xe')]],'as':_0x2f1d1f['as'],'attributes':_0x2f1d1f[_0x4f54('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4f54('0xf')](function(_0x1b7d75){var _0x156728=[];for(var _0x48ef3d=0x0;_0x48ef3d<_0x1b7d75[_0x4f54('0x29')];_0x48ef3d+=0x1){_0x156728[_0x4f54('0x2b')](_0x1b7d75[_0x48ef3d]['update'](_0x4e627b[_0x4f54('0x1c')],{'transaction':_0x2c3aca}));}return BPromise[_0x4f54('0x2d')](_0x156728);});})['then'](function(_0x44ebbb){logger[_0x4f54('0x10')](_0x4f54('0x3c'),_0x4e627b);logger[_0x4f54('0x11')](_0x4f54('0x3c'),_0x4e627b,JSON['stringify'](_0x44ebbb));_0x132087(_0x44ebbb);})['catch'](function(_0x52ee80){logger['error'](_0x4f54('0x3c'),_0x52ee80[_0x4f54('0x15')],_0x4e627b);_0x2b0437(_0x177e88[_0x4f54('0x14')](0x1f4,_0x52ee80['message']));});});});};exports[_0x4f54('0x3d')]=function(_0x402041){var _0x2f0499=this;return new Promise(function(_0x2ddc9f,_0x197dac){db['CmContact'][_0x4f54('0x20')]()[_0x4f54('0xf')](function(_0x35e821){return db['CmHopper'][_0x4f54('0x6')]({'raw':_0x402041['options']?_0x402041['options'][_0x4f54('0x8')]===undefined?!![]:![]:!![],'where':_0x402041[_0x4f54('0x7')]?_0x402041[_0x4f54('0x7')][_0x4f54('0x9')]||null:null,'attributes':_0x402041[_0x4f54('0x7')]?_0x402041[_0x4f54('0x7')][_0x4f54('0xa')]||null:null,'limit':_0x402041['options']?_0x402041[_0x4f54('0x7')][_0x4f54('0xb')]||null:null,'include':_0x402041[_0x4f54('0x7')]?_0x402041[_0x4f54('0x7')][_0x4f54('0xc')]?_[_0x4f54('0xd')](_0x402041[_0x4f54('0x7')]['include'],function(_0x5e8986){return{'model':db[_0x5e8986['model']],'as':_0x5e8986['as'],'attributes':_0x5e8986['as']===_0x4f54('0x27')?_['keys'](_0x35e821):_0x5e8986[_0x4f54('0xa')],'include':_0x5e8986[_0x4f54('0xc')]?_[_0x4f54('0xd')](_0x5e8986['include'],function(_0x599ff5){return{'model':db[_0x599ff5[_0x4f54('0xe')]],'as':_0x599ff5['as'],'attributes':_0x599ff5[_0x4f54('0xa')],'include':_0x599ff5[_0x4f54('0xc')]?_[_0x4f54('0xd')](_0x599ff5[_0x4f54('0xc')],function(_0x3790af){return{'model':db[_0x3790af[_0x4f54('0xe')]],'as':_0x3790af['as'],'attributes':_0x3790af[_0x4f54('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4f54('0xf')](function(_0x247306){logger[_0x4f54('0x10')](_0x4f54('0x5'),_0x402041);logger[_0x4f54('0x11')](_0x4f54('0x5'),_0x402041,JSON[_0x4f54('0x12')](_0x247306));_0x2ddc9f(_0x247306);})[_0x4f54('0x13')](function(_0x106e5d){logger[_0x4f54('0x14')]('GetCmHopper',_0x106e5d['message'],_0x402041);_0x197dac(_0x2f0499['error'](0x1f4,_0x106e5d[_0x4f54('0x15')]));});});});};exports[_0x4f54('0x3e')]=function(_0x32242b){var _0x2d2af3=this;return new Promise(function(_0x214af6,_0x4ccc48){return db['CmContact'][_0x4f54('0x3f')]({'raw':!![],'where':{'phone':_0x32242b[_0x4f54('0x7')]['where']['phone']},'attributes':['id',_0x4f54('0x40')],'order':[['id','DESC']]})[_0x4f54('0xf')](function(_0x921f5f){logger[_0x4f54('0x10')](_0x4f54('0x41'),_0x32242b);logger[_0x4f54('0x11')]('getContactByPhone',_0x32242b,JSON['stringify'](_0x921f5f));_0x214af6(_0x921f5f);})['catch'](function(_0x4123b6){logger[_0x4f54('0x14')](_0x4f54('0x41'),_0x4123b6[_0x4f54('0x15')],_0x32242b);_0x4ccc48(_0x2d2af3[_0x4f54('0x14')](0x1f4,_0x4123b6['message']));});});};exports[_0x4f54('0x42')]=function(_0x95f176){var _0x97484f=this;return new Promise(function(_0x3e20b2,_0x390e98){return db[_0x4f54('0x21')][_0x4f54('0x22')](function(_0x4ece5d){var _0x137017=_0x95f176[_0x4f54('0x7')]&&_0x95f176['options'][_0x4f54('0x9')]?_0x95f176[_0x4f54('0x7')][_0x4f54('0x9')]:{};return db['CmHopper'][_0x4f54('0x1b')](_0x95f176[_0x4f54('0x1c')],{'where':_0x137017,'transaction':_0x4ece5d})['then'](function(_0x3e882f){logger[_0x4f54('0x10')](_0x4f54('0x42'),_0x95f176);logger[_0x4f54('0x11')](_0x4f54('0x42'),_0x95f176,JSON[_0x4f54('0x12')](_0x3e882f));_0x3e20b2(_0x3e882f);})['catch'](function(_0x53964d){logger[_0x4f54('0x14')](_0x4f54('0x42'),_0x53964d['message'],_0x95f176);_0x390e98(_0x97484f[_0x4f54('0x14')](0x1f4,_0x53964d[_0x4f54('0x15')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x819a53){var _0x47f96e=this;var _0x1b6edc=_0x819a53['body'][_0x4f54('0x9')][_0x4f54('0x43')];var _0x464f6f=_0x819a53['body'][_0x4f54('0x9')][_0x4f54('0x44')];var _0x30cb3f=_0x819a53[_0x4f54('0x1c')][_0x4f54('0x9')][_0x4f54('0x45')];return new Promise(function(_0x423f86,_0x1cab90){return db[_0x4f54('0x16')]['findAll']({'where':{'voiceQueueId':{'$in':_0x1b6edc},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x4f54('0x21')][_0x4f54('0x35')]('NOW()\x20+\x20INTERVAL\x20'+_0x464f6f+_0x4f54('0x46')),'$gt':db[_0x4f54('0x21')][_0x4f54('0x35')](_0x4f54('0x47'))}},'UserId':{'$in':_0x30cb3f}},'include':[{'model':db[_0x4f54('0x26')],'as':_0x4f54('0x27')},{'model':db[_0x4f54('0x48')],'as':'Agent','attributes':['id',_0x4f54('0x49'),'voicePause']},{'model':db[_0x4f54('0x4a')],'as':_0x4f54('0x4b')}]})['then'](function(_0x49b26a){if(_0x49b26a[_0x4f54('0x29')]>0x0){return db['sequelize'][_0x4f54('0x22')](function(_0x351c91){return db[_0x4f54('0x16')][_0x4f54('0x1b')]({'recallmeNotifiedDate':db[_0x4f54('0x21')][_0x4f54('0x35')](_0x4f54('0x47'))},{'where':{'id':{'$in':_[_0x4f54('0xd')](_0x49b26a,'id')}},'transaction':_0x351c91})[_0x4f54('0xf')](function(){_0x423f86(_0x49b26a);})['catch'](function(_0x31d41f){logger[_0x4f54('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x31d41f[_0x4f54('0x15')],_0x819a53);_0x1cab90(_0x47f96e['error'](0x1f4,_0x31d41f[_0x4f54('0x15')]));});})[_0x4f54('0x13')](function(_0x685fdd){logger[_0x4f54('0x14')](_0x4f54('0x4c'),_0x685fdd[_0x4f54('0x15')],_0x819a53);_0x1cab90(_0x47f96e[_0x4f54('0x14')](0x1f4,_0x685fdd['message']));});}else{_0x423f86(_0x49b26a);}});});}; \ No newline at end of file +var _0x737e=['moment','bluebird','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper','create','body','info','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','Contact','User','Agent','name','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','UPDATE','keys','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','voicePause','CmList','List','lodash','util'];(function(_0x2478cf,_0x16f120){var _0x3e2ffa=function(_0x3caaf2){while(--_0x3caaf2){_0x2478cf['push'](_0x2478cf['shift']());}};_0x3e2ffa(++_0x16f120);}(_0x737e,0x1cc));var _0xe737=function(_0x4700dd,_0x539906){_0x4700dd=_0x4700dd-0x0;var _0x12f6e7=_0x737e[_0x4700dd];return _0x12f6e7;};'use strict';var _=require(_0xe737('0x0'));var util=require(_0xe737('0x1'));var moment=require(_0xe737('0x2'));var BPromise=require(_0xe737('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xe737('0x4'))('rpc');exports[_0xe737('0x5')]=function(_0x5ac07a){var _0x519c54=this;return new Promise(function(_0x137e20,_0x3668ae){return db[_0xe737('0x6')][_0xe737('0x7')]({'raw':_0x5ac07a[_0xe737('0x8')]?_0x5ac07a['options'][_0xe737('0x9')]===undefined?!![]:![]:!![],'where':_0x5ac07a['options']?_0x5ac07a[_0xe737('0x8')][_0xe737('0xa')]||null:null,'attributes':_0x5ac07a[_0xe737('0x8')]?_0x5ac07a['options'][_0xe737('0xb')]||null:null,'limit':_0x5ac07a['options']?_0x5ac07a[_0xe737('0x8')][_0xe737('0xc')]||null:null,'include':_0x5ac07a[_0xe737('0x8')]?_0x5ac07a[_0xe737('0x8')][_0xe737('0xd')]?_[_0xe737('0xe')](_0x5ac07a[_0xe737('0x8')][_0xe737('0xd')],function(_0x34ad12){return{'model':db[_0x34ad12[_0xe737('0xf')]],'as':_0x34ad12['as'],'attributes':_0x34ad12[_0xe737('0xb')],'include':_0x34ad12[_0xe737('0xd')]?_[_0xe737('0xe')](_0x34ad12['include'],function(_0x394904){return{'model':db[_0x394904[_0xe737('0xf')]],'as':_0x394904['as'],'attributes':_0x394904[_0xe737('0xb')],'include':_0x394904[_0xe737('0xd')]?_[_0xe737('0xe')](_0x394904[_0xe737('0xd')],function(_0x16c99d){return{'model':db[_0x16c99d[_0xe737('0xf')]],'as':_0x16c99d['as'],'attributes':_0x16c99d[_0xe737('0xb')]};}):[]};}):[]};}):[]:[]})[_0xe737('0x10')](function(_0x26b831){logger['info'](_0xe737('0x5'),_0x5ac07a);logger[_0xe737('0x11')]('GetCmHopper',_0x5ac07a,JSON[_0xe737('0x12')](_0x26b831));_0x137e20(_0x26b831);})[_0xe737('0x13')](function(_0xb6f570){logger[_0xe737('0x14')]('GetCmHopper',_0xb6f570[_0xe737('0x15')],_0x5ac07a);_0x3668ae(_0x519c54[_0xe737('0x14')](0x1f4,_0xb6f570[_0xe737('0x15')]));});});};exports[_0xe737('0x16')]=function(_0x1540eb){var _0x5de660=this;return new Promise(function(_0x28842a,_0x7d7d6f){return db[_0xe737('0x6')][_0xe737('0x17')]({'raw':_0x1540eb[_0xe737('0x8')]?_0x1540eb[_0xe737('0x8')][_0xe737('0x9')]===undefined?!![]:![]:!![],'where':_0x1540eb[_0xe737('0x8')]?_0x1540eb['options'][_0xe737('0xa')]||null:null,'attributes':_0x1540eb[_0xe737('0x8')]?_0x1540eb['options'][_0xe737('0xb')]||null:null,'include':_0x1540eb[_0xe737('0x8')]?_0x1540eb[_0xe737('0x8')][_0xe737('0xd')]?_[_0xe737('0xe')](_0x1540eb[_0xe737('0x8')][_0xe737('0xd')],function(_0x5c8794){return{'model':db[_0x5c8794['model']],'as':_0x5c8794['as'],'attributes':_0x5c8794[_0xe737('0xb')],'include':_0x5c8794[_0xe737('0xd')]?_[_0xe737('0xe')](_0x5c8794['include'],function(_0x49650c){return{'model':db[_0x49650c[_0xe737('0xf')]],'as':_0x49650c['as'],'attributes':_0x49650c[_0xe737('0xb')],'include':_0x49650c[_0xe737('0xd')]?_['map'](_0x49650c[_0xe737('0xd')],function(_0x3ad39c){return{'model':db[_0x3ad39c[_0xe737('0xf')]],'as':_0x3ad39c['as'],'attributes':_0x3ad39c[_0xe737('0xb')]};}):[]};}):[]};}):[]:[]})[_0xe737('0x10')](function(_0x1eb619){logger['info']('ShowCmHopper',_0x1540eb);logger[_0xe737('0x11')](_0xe737('0x16'),_0x1540eb,JSON[_0xe737('0x12')](_0x1eb619));_0x28842a(_0x1eb619);})[_0xe737('0x13')](function(_0x55fe02){logger[_0xe737('0x14')](_0xe737('0x16'),_0x55fe02['message'],_0x1540eb);_0x7d7d6f(_0x5de660['error'](0x1f4,_0x55fe02[_0xe737('0x15')]));});});};exports[_0xe737('0x18')]=function(_0x1cbc47){var _0x1edbec=this;return new Promise(function(_0x454db6,_0x440f0c){return db[_0xe737('0x6')][_0xe737('0x19')](_0x1cbc47[_0xe737('0x1a')],{'raw':_0x1cbc47['options']?_0x1cbc47[_0xe737('0x8')][_0xe737('0x9')]===undefined?!![]:![]:!![]})[_0xe737('0x10')](function(_0x27c929){logger[_0xe737('0x1b')](_0xe737('0x18'),_0x1cbc47);logger[_0xe737('0x11')]('CreateCmHopper',_0x1cbc47,JSON[_0xe737('0x12')](_0x27c929));_0x454db6(_0x27c929);})[_0xe737('0x13')](function(_0x365e89){logger['error'](_0xe737('0x18'),_0x365e89['message'],_0x1cbc47);_0x440f0c(_0x1edbec[_0xe737('0x14')](0x1f4,_0x365e89[_0xe737('0x15')]));});});};exports['UpdateCmHopper']=function(_0x5686d1){var _0x3f0c5d=this;return new Promise(function(_0x5912c9,_0x10400f){return db['CmHopper'][_0xe737('0x1c')](_0x5686d1[_0xe737('0x1a')],{'raw':_0x5686d1[_0xe737('0x8')]?_0x5686d1[_0xe737('0x8')][_0xe737('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5686d1['options']?_0x5686d1[_0xe737('0x8')][_0xe737('0xa')]||null:null,'attributes':_0x5686d1[_0xe737('0x8')]?_0x5686d1[_0xe737('0x8')][_0xe737('0xb')]||null:null,'limit':_0x5686d1[_0xe737('0x8')]?_0x5686d1[_0xe737('0x8')][_0xe737('0xc')]||null:null})['then'](function(_0x3e114c){logger[_0xe737('0x1b')](_0xe737('0x1d'),_0x5686d1);logger['info'](_0xe737('0x1e'),JSON[_0xe737('0x12')](_0x5686d1[_0xe737('0x8')][_0xe737('0xa')]),_0x5686d1['body'][_0xe737('0x1f')]);logger[_0xe737('0x11')]('UpdateCmHopper',_0x5686d1,JSON[_0xe737('0x12')](_0x3e114c));_0x5912c9(_0x3e114c);})[_0xe737('0x13')](function(_0xb0d044){logger[_0xe737('0x14')](_0xe737('0x1d'),_0xb0d044[_0xe737('0x15')],_0x5686d1);_0x10400f(_0x3f0c5d[_0xe737('0x14')](0x1f4,_0xb0d044['message']));});});};exports[_0xe737('0x20')]=function(_0x5138bc){var _0x3329f6=this;return new Promise(function(_0x1dd101,_0x17d034){return db[_0xe737('0x6')]['destroy']({'where':_0x5138bc[_0xe737('0x8')]?_0x5138bc[_0xe737('0x8')][_0xe737('0xa')]||null:null})[_0xe737('0x10')](function(_0x2061d9){logger['info']('DestroyCmHopper',_0x5138bc);logger[_0xe737('0x11')](_0xe737('0x20'),_0x5138bc,JSON[_0xe737('0x12')](_0x2061d9));_0x1dd101(_0x2061d9);})[_0xe737('0x13')](function(_0x677379){logger['error']('DestroyCmHopper',_0x677379[_0xe737('0x15')],_0x5138bc);_0x17d034(_0x3329f6[_0xe737('0x14')](0x1f4,_0x677379[_0xe737('0x15')]));});});};exports[_0xe737('0x21')]=function(_0x5ee413){var _0x522987=this;return new Promise(function(_0xd8622f,_0x3ca1bd){return db[_0xe737('0x22')][_0xe737('0x23')]()[_0xe737('0x10')](function(_0x50c981){return db[_0xe737('0x24')][_0xe737('0x25')](function(_0x2dc516){return db[_0xe737('0x6')][_0xe737('0x7')]({'where':_0x5ee413[_0xe737('0x8')]?_0x5ee413[_0xe737('0x8')][_0xe737('0xa')]||null:null,'attributes':_0x5ee413[_0xe737('0x8')]?_0x5ee413[_0xe737('0x8')][_0xe737('0xb')]||null:null,'limit':_0x5ee413[_0xe737('0x8')]?_0x5ee413[_0xe737('0x8')][_0xe737('0xc')]||null:null,'order':_0x5ee413[_0xe737('0x8')]?_0x5ee413[_0xe737('0x8')][_0xe737('0x26')]||null:null,'transaction':_0x2dc516,'lock':_0x2dc516[_0xe737('0x27')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xe737('0x28'),'attributes':_['keys'](_0x50c981)},{'model':db[_0xe737('0x29')],'as':_0xe737('0x2a'),'attributes':['id',_0xe737('0x2b'),'voicePause']}]})[_0xe737('0x10')](function(_0x3de6e8){var _0x287335=[];var _0x2284a1=[];for(var _0x13ef5e=0x0;_0x13ef5e<_0x3de6e8['length'];_0x13ef5e+=0x1){var _0x3305ab=_0x3de6e8[_0x13ef5e]['UserId'];if(_0x3305ab===null){_0x287335[_0xe737('0x2c')](_0x3de6e8[_0x13ef5e]['update'](_0x5ee413[_0xe737('0x1a')],{'transaction':_0x2dc516}));}else if(!_0x2284a1['includes'](_0x3305ab)){_0x2284a1[_0xe737('0x2c')](_0x3305ab);_0x287335[_0xe737('0x2c')](_0x3de6e8[_0x13ef5e][_0xe737('0x1c')](_0x5ee413[_0xe737('0x1a')],{'transaction':_0x2dc516}));}}return BPromise[_0xe737('0x2d')](_0x287335);});})['then'](function(_0x3f6ac6){logger[_0xe737('0x1b')](_0xe737('0x21'),_0x5ee413);if(_0x3f6ac6[_0xe737('0x2e')]>0x0){logger[_0xe737('0x1b')](_0xe737('0x2f'),_0x3f6ac6[0x0]['dataValues']['id'],_0x3f6ac6[0x0][_0xe737('0x30')][_0xe737('0x31')],_0x3f6ac6[0x0]['dataValues'][_0xe737('0x1f')]);}logger[_0xe737('0x11')]('GetContactDialer',_0x5ee413,JSON[_0xe737('0x12')](_0x3f6ac6));_0xd8622f(_0x3f6ac6);})[_0xe737('0x13')](function(_0x488008){logger[_0xe737('0x14')](_0xe737('0x21'),_0x488008[_0xe737('0x15')],_0x5ee413);_0x3ca1bd(_0x522987[_0xe737('0x14')](0x1f4,_0x488008['message']));});});});};exports[_0xe737('0x32')]=function(_0x1463f4){var _0x18e8fd=this;return new Promise(function(_0x34d448,_0x22a395){return db['sequelize']['transaction'](function(_0x3c8114){return db[_0xe737('0x33')]['create'](_0x1463f4[_0xe737('0x1a')],{'raw':_0x1463f4[_0xe737('0x8')]?_0x1463f4[_0xe737('0x8')][_0xe737('0x9')]===undefined?!![]:![]:!![],'transaction':_0x3c8114})[_0xe737('0x10')](function(){logger['info'](_0xe737('0x34'),JSON['stringify'](_0x1463f4[_0xe737('0x8')][_0xe737('0xa')]),_0x1463f4['options'][_0xe737('0xa')][_0xe737('0x1f')]);return db[_0xe737('0x6')]['destroy']({'where':_0x1463f4[_0xe737('0x8')]?_0x1463f4['options'][_0xe737('0xa')]||null:null,'transaction':_0x3c8114});});})['then'](function(_0x9c266d){logger['info'](_0xe737('0x32'),_0x1463f4);logger[_0xe737('0x11')](_0xe737('0x32'),_0x1463f4,JSON[_0xe737('0x12')](_0x9c266d));_0x34d448(_0x9c266d);})[_0xe737('0x13')](function(_0x3d975b){logger[_0xe737('0x14')]('MoveContactManagedDialer',_0x3d975b[_0xe737('0x15')],_0x1463f4);_0x22a395(_0x18e8fd[_0xe737('0x14')](0x1f4,_0x3d975b['message']));});});};exports['CountReScheduled']=function(_0x5e1e0f){var _0x46bb43=this;return new Promise(function(_0x4d39ac,_0x25b0c6){return db['CmHopper']['findAll']({'raw':_0x5e1e0f[_0xe737('0x8')]?_0x5e1e0f[_0xe737('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5e1e0f[_0xe737('0x8')]?_0x5e1e0f[_0xe737('0x8')][_0xe737('0xa')]||null:null,'attributes':[[db[_0xe737('0x24')]['fn']('COUNT',db[_0xe737('0x24')]['fn']('IF',db[_0xe737('0x24')][_0xe737('0x35')](_0xe737('0x36')+util['format'](_0xe737('0x37'),moment()[_0xe737('0x38')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xe737('0x39')))),_0xe737('0x3a')]]})[_0xe737('0x10')](function(_0x50fcaf){logger[_0xe737('0x1b')](_0xe737('0x3b'),_0x5e1e0f);logger[_0xe737('0x11')](_0xe737('0x3b'),_0x5e1e0f,JSON[_0xe737('0x12')](_0x50fcaf));_0x4d39ac(_0x50fcaf);})[_0xe737('0x13')](function(_0x485a2b){logger['error']('CountReScheduled',_0x485a2b['message'],_0x5e1e0f);_0x25b0c6(_0x46bb43[_0xe737('0x14')](0x1f4,_0x485a2b[_0xe737('0x15')]));});});};exports[_0xe737('0x3c')]=function(_0x3f45b7){var _0x38bef6=this;return new Promise(function(_0x123287,_0xf37fa5){return db[_0xe737('0x22')][_0xe737('0x23')]()[_0xe737('0x10')](function(){return db[_0xe737('0x24')][_0xe737('0x25')](function(_0x379627){return db[_0xe737('0x6')][_0xe737('0x7')]({'where':_0x3f45b7[_0xe737('0x8')]?_0x3f45b7['options'][_0xe737('0xa')]||null:null,'attributes':_0x3f45b7[_0xe737('0x8')]?_0x3f45b7['options'][_0xe737('0xb')]||null:null,'limit':0x1,'order':_0x3f45b7['options']?_0x3f45b7[_0xe737('0x8')][_0xe737('0x26')]||null:null,'group':db[_0xe737('0x6')][_0xe737('0x3d')],'transaction':_0x379627,'lock':_0x379627[_0xe737('0x27')][_0xe737('0x3e')],'include':_0x3f45b7['options']?_0x3f45b7[_0xe737('0x8')][_0xe737('0xd')]?_[_0xe737('0xe')](_0x3f45b7[_0xe737('0x8')][_0xe737('0xd')],function(_0x458102){return{'model':db[_0x458102[_0xe737('0xf')]],'as':_0x458102['as'],'attributes':_0x458102[_0xe737('0xb')],'include':_0x458102[_0xe737('0xd')]?_[_0xe737('0xe')](_0x458102[_0xe737('0xd')],function(_0x27e608){return{'model':db[_0x27e608['model']],'as':_0x27e608['as'],'attributes':_0x27e608['attributes'],'include':_0x27e608[_0xe737('0xd')]?_[_0xe737('0xe')](_0x27e608[_0xe737('0xd')],function(_0x15bb0f){return{'model':db[_0x15bb0f[_0xe737('0xf')]],'as':_0x15bb0f['as'],'attributes':_0x15bb0f[_0xe737('0xb')]};}):[]};}):[]};}):[]:[]})[_0xe737('0x10')](function(_0x6ce3fd){var _0x3533a5=[];for(var _0x41ec65=0x0;_0x41ec65<_0x6ce3fd[_0xe737('0x2e')];_0x41ec65+=0x1){_0x3533a5[_0xe737('0x2c')](_0x6ce3fd[_0x41ec65][_0xe737('0x1c')](_0x3f45b7[_0xe737('0x1a')],{'transaction':_0x379627}));}return BPromise['all'](_0x3533a5);});})[_0xe737('0x10')](function(_0x54013d){logger[_0xe737('0x1b')](_0xe737('0x3c'),_0x3f45b7);logger[_0xe737('0x11')](_0xe737('0x3c'),_0x3f45b7,JSON[_0xe737('0x12')](_0x54013d));_0x123287(_0x54013d);})[_0xe737('0x13')](function(_0x45cfe5){logger[_0xe737('0x14')](_0xe737('0x3c'),_0x45cfe5[_0xe737('0x15')],_0x3f45b7);_0xf37fa5(_0x38bef6[_0xe737('0x14')](0x1f4,_0x45cfe5[_0xe737('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0x2c2eaa){var _0x50d266=this;return new Promise(function(_0x1d9dad,_0x380aa1){db[_0xe737('0x22')][_0xe737('0x23')]()['then'](function(_0x1ce64e){return db[_0xe737('0x6')][_0xe737('0x7')]({'raw':_0x2c2eaa['options']?_0x2c2eaa[_0xe737('0x8')][_0xe737('0x9')]===undefined?!![]:![]:!![],'where':_0x2c2eaa[_0xe737('0x8')]?_0x2c2eaa['options'][_0xe737('0xa')]||null:null,'attributes':_0x2c2eaa['options']?_0x2c2eaa[_0xe737('0x8')]['attributes']||null:null,'limit':_0x2c2eaa[_0xe737('0x8')]?_0x2c2eaa[_0xe737('0x8')][_0xe737('0xc')]||null:null,'include':_0x2c2eaa[_0xe737('0x8')]?_0x2c2eaa['options'][_0xe737('0xd')]?_['map'](_0x2c2eaa[_0xe737('0x8')][_0xe737('0xd')],function(_0x48f467){return{'model':db[_0x48f467[_0xe737('0xf')]],'as':_0x48f467['as'],'attributes':_0x48f467['as']===_0xe737('0x28')?_[_0xe737('0x3f')](_0x1ce64e):_0x48f467[_0xe737('0xb')],'include':_0x48f467[_0xe737('0xd')]?_[_0xe737('0xe')](_0x48f467[_0xe737('0xd')],function(_0x501a66){return{'model':db[_0x501a66['model']],'as':_0x501a66['as'],'attributes':_0x501a66[_0xe737('0xb')],'include':_0x501a66[_0xe737('0xd')]?_[_0xe737('0xe')](_0x501a66['include'],function(_0x1af0f7){return{'model':db[_0x1af0f7[_0xe737('0xf')]],'as':_0x1af0f7['as'],'attributes':_0x1af0f7[_0xe737('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ffbed){logger['info'](_0xe737('0x5'),_0x2c2eaa);logger[_0xe737('0x11')](_0xe737('0x5'),_0x2c2eaa,JSON[_0xe737('0x12')](_0x4ffbed));_0x1d9dad(_0x4ffbed);})[_0xe737('0x13')](function(_0x171d0b){logger[_0xe737('0x14')]('GetCmHopper',_0x171d0b['message'],_0x2c2eaa);_0x380aa1(_0x50d266[_0xe737('0x14')](0x1f4,_0x171d0b[_0xe737('0x15')]));});});});};exports['GetContactByPhone']=function(_0x8634f6){var _0x3061d5=this;return new Promise(function(_0x1ba75c,_0x38ed5c){return db[_0xe737('0x22')]['findOne']({'raw':!![],'where':{'phone':_0x8634f6[_0xe737('0x8')]['where'][_0xe737('0x40')]},'attributes':['id',_0xe737('0x41')],'order':[['id',_0xe737('0x42')]]})[_0xe737('0x10')](function(_0x54ff1a){logger['info'](_0xe737('0x43'),_0x8634f6);logger['debug'](_0xe737('0x43'),_0x8634f6,JSON[_0xe737('0x12')](_0x54ff1a));_0x1ba75c(_0x54ff1a);})[_0xe737('0x13')](function(_0x76de4d){logger[_0xe737('0x14')](_0xe737('0x43'),_0x76de4d[_0xe737('0x15')],_0x8634f6);_0x38ed5c(_0x3061d5[_0xe737('0x14')](0x1f4,_0x76de4d[_0xe737('0x15')]));});});};exports['ResetActiveCalls']=function(_0x1b94c1){var _0xf69083=this;return new Promise(function(_0x326771,_0x237ce1){return db[_0xe737('0x24')][_0xe737('0x25')](function(_0x3e6291){var _0x2055fb=_0x1b94c1[_0xe737('0x8')]&&_0x1b94c1[_0xe737('0x8')]['where']?_0x1b94c1[_0xe737('0x8')]['where']:{};return db['CmHopper']['update'](_0x1b94c1[_0xe737('0x1a')],{'where':_0x2055fb,'transaction':_0x3e6291})[_0xe737('0x10')](function(_0x4fe2c0){logger[_0xe737('0x1b')](_0xe737('0x44'),_0x1b94c1);logger[_0xe737('0x11')](_0xe737('0x44'),_0x1b94c1,JSON[_0xe737('0x12')](_0x4fe2c0));_0x326771(_0x4fe2c0);})[_0xe737('0x13')](function(_0x17b8b2){logger['error'](_0xe737('0x44'),_0x17b8b2['message'],_0x1b94c1);_0x237ce1(_0xf69083[_0xe737('0x14')](0x1f4,_0x17b8b2[_0xe737('0x15')]));});});});};exports[_0xe737('0x45')]=function(_0x4faeb8){var _0x122a13=this;var _0xc7ffcb=_0x4faeb8['body'][_0xe737('0xa')]['voiceQueueIds'];var _0x227ffa=_0x4faeb8['body'][_0xe737('0xa')]['interval'];var _0x2366d9=_0x4faeb8[_0xe737('0x1a')][_0xe737('0xa')][_0xe737('0x46')];return new Promise(function(_0x327dae,_0x3a445a){return db[_0xe737('0x6')][_0xe737('0x7')]({'where':{'voiceQueueId':{'$in':_0xc7ffcb},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0xe737('0x47')+_0x227ffa+_0xe737('0x48')),'$gt':db[_0xe737('0x24')][_0xe737('0x35')](_0xe737('0x49'))}},'UserId':{'$in':_0x2366d9}},'include':[{'model':db['CmContact'],'as':_0xe737('0x28')},{'model':db['User'],'as':'Agent','attributes':['id',_0xe737('0x2b'),_0xe737('0x4a')]},{'model':db[_0xe737('0x4b')],'as':_0xe737('0x4c')}]})[_0xe737('0x10')](function(_0x4e8ad4){if(_0x4e8ad4[_0xe737('0x2e')]>0x0){return db['sequelize'][_0xe737('0x25')](function(_0x3f6536){return db[_0xe737('0x6')][_0xe737('0x1c')]({'recallmeNotifiedDate':db['sequelize'][_0xe737('0x35')](_0xe737('0x49'))},{'where':{'id':{'$in':_[_0xe737('0xe')](_0x4e8ad4,'id')}},'transaction':_0x3f6536})['then'](function(){_0x327dae(_0x4e8ad4);})['catch'](function(_0x5cd594){logger[_0xe737('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x5cd594[_0xe737('0x15')],_0x4faeb8);_0x3a445a(_0x122a13[_0xe737('0x14')](0x1f4,_0x5cd594[_0xe737('0x15')]));});})[_0xe737('0x13')](function(_0x62c900){logger[_0xe737('0x14')](_0xe737('0x45'),_0x62c900['message'],_0x4faeb8);_0x3a445a(_0x122a13[_0xe737('0x14')](0x1f4,_0x62c900[_0xe737('0x15')]));});}else{_0x327dae(_0x4e8ad4);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 3765d03..0113e9c 100644 --- a/server/api/cmHopper/index.js +++ b/server/api/cmHopper/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15a3=['create','/preview','getPreview','/:id','update','delete','Router','../../components/auth/service','./cmHopper.controller','index','get','describe','/opencontacts','isAuthenticated','show','/:id/previewrecall','getPreviewRecall','post'];(function(_0x26ac27,_0x574b86){var _0x44a599=function(_0x130e2c){while(--_0x130e2c){_0x26ac27['push'](_0x26ac27['shift']());}};_0x44a599(++_0x574b86);}(_0x15a3,0x138));var _0x315a=function(_0x3804da,_0x4b1678){_0x3804da=_0x3804da-0x0;var _0x1038e3=_0x15a3[_0x3804da];return _0x1038e3;};'use strict';var express=require('express');var router=express[_0x315a('0x0')]();var auth=require(_0x315a('0x1'));var controller=require(_0x315a('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x315a('0x3')]);router[_0x315a('0x4')]('/describe',auth['isAuthenticated'](),controller[_0x315a('0x5')]);router['get'](_0x315a('0x6'),auth[_0x315a('0x7')](),controller['getOpenContacts']);router[_0x315a('0x4')]('/timezones',auth[_0x315a('0x7')](),controller['getTimezones']);router[_0x315a('0x4')]('/:id',auth[_0x315a('0x7')](),controller[_0x315a('0x8')]);router[_0x315a('0x4')](_0x315a('0x9'),auth[_0x315a('0x7')](),controller[_0x315a('0xa')]);router[_0x315a('0xb')]('/',auth[_0x315a('0x7')](),controller[_0x315a('0xc')]);router['post'](_0x315a('0xd'),auth[_0x315a('0x7')](),controller[_0x315a('0xe')]);router[_0x315a('0xb')]('/timezone',auth[_0x315a('0x7')](),controller['getTimezone']);router['put'](_0x315a('0xf'),auth['isAuthenticated'](),controller[_0x315a('0x10')]);router[_0x315a('0x11')]('/:id',auth[_0x315a('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x692b=['update','delete','destroy','exports','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','post','create','/preview','/timezone','put'];(function(_0x31d040,_0x46742e){var _0xf4812a=function(_0x3e1d93){while(--_0x3e1d93){_0x31d040['push'](_0x31d040['shift']());}};_0xf4812a(++_0x46742e);}(_0x692b,0x13f));var _0xb692=function(_0x14f466,_0xa58628){_0x14f466=_0x14f466-0x0;var _0xd8d98b=_0x692b[_0x14f466];return _0xd8d98b;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xb692('0x0'));var controller=require(_0xb692('0x1'));router[_0xb692('0x2')]('/',auth[_0xb692('0x3')](),controller[_0xb692('0x4')]);router[_0xb692('0x2')]('/describe',auth[_0xb692('0x3')](),controller['describe']);router[_0xb692('0x2')](_0xb692('0x5'),auth[_0xb692('0x3')](),controller[_0xb692('0x6')]);router[_0xb692('0x2')](_0xb692('0x7'),auth[_0xb692('0x3')](),controller[_0xb692('0x8')]);router['get'](_0xb692('0x9'),auth[_0xb692('0x3')](),controller['show']);router[_0xb692('0x2')](_0xb692('0xa'),auth[_0xb692('0x3')](),controller[_0xb692('0xb')]);router[_0xb692('0xc')]('/',auth[_0xb692('0x3')](),controller[_0xb692('0xd')]);router[_0xb692('0xc')](_0xb692('0xe'),auth[_0xb692('0x3')](),controller['getPreview']);router['post'](_0xb692('0xf'),auth[_0xb692('0x3')](),controller['getTimezone']);router[_0xb692('0x10')](_0xb692('0x9'),auth[_0xb692('0x3')](),controller[_0xb692('0x11')]);router[_0xb692('0x12')](_0xb692('0x9'),auth[_0xb692('0x3')](),controller[_0xb692('0x13')]);module[_0xb692('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 455d507..1ae8550 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7221=['INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x47f4d1,_0x17d7a7){var _0x3ca68d=function(_0x391fc5){while(--_0x391fc5){_0x47f4d1['push'](_0x47f4d1['shift']());}};_0x3ca68d(++_0x17d7a7);}(_0x7221,0x98));var _0x1722=function(_0x918eb4,_0x1e2eca){_0x918eb4=_0x918eb4-0x0;var _0x5b07db=_0x7221[_0x918eb4];return _0x5b07db;};'use strict';var moment=require(_0x1722('0x0'));var Sequelize=require('sequelize');module[_0x1722('0x1')]={'CmHopperId':{'type':Sequelize[_0x1722('0x2')]},'phone':{'type':Sequelize[_0x1722('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x1722('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x1722('0x4')],'defaultValue':moment()[_0x1722('0x5')](_0x1722('0x6'))},'countbusyretry':{'type':Sequelize[_0x1722('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1722('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1722('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1722('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1722('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1722('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1722('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2ce5=['YYYY-MM-DD\x20HH:mm:ss','sequelize','STRING','INTEGER','DATE'];(function(_0x353a5f,_0x14b8a1){var _0x1ad2d8=function(_0x30dbe0){while(--_0x30dbe0){_0x353a5f['push'](_0x353a5f['shift']());}};_0x1ad2d8(++_0x14b8a1);}(_0x2ce5,0xdd));var _0x52ce=function(_0x125b59,_0x4290ac){_0x125b59=_0x125b59-0x0;var _0x10e3f8=_0x2ce5[_0x125b59];return _0x10e3f8;};'use strict';var moment=require('moment');var Sequelize=require(_0x52ce('0x0'));module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x52ce('0x1')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x52ce('0x3')],'defaultValue':moment()['format'](_0x52ce('0x4'))},'countbusyretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 62963d4..e9a3eba 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa955=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','apply','reject','save','then','destroy','get','CmHopperAdditionalPhones','status','sendStatus','error','stack','name','send','map','CmHopperAdditionalPhone','rawAttributes'];(function(_0x52017c,_0x393604){var _0xada67d=function(_0x452feb){while(--_0x452feb){_0x52017c['push'](_0x52017c['shift']());}};_0xada67d(++_0x393604);}(_0xa955,0x120));var _0x5a95=function(_0x4978fd,_0x2177e1){_0x4978fd=_0x4978fd-0x0;var _0x3a5c78=_0xa955[_0x4978fd];return _0x3a5c78;};'use strict';var emlformat=require(_0x5a95('0x0'));var rimraf=require(_0x5a95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5a95('0x2'));var moment=require('moment');var BPromise=require(_0x5a95('0x3'));var Mustache=require(_0x5a95('0x4'));var util=require(_0x5a95('0x5'));var path=require(_0x5a95('0x6'));var sox=require(_0x5a95('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a95('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5a95('0x9'));var toCsv=require(_0x5a95('0xa'));var querystring=require('querystring');var Papa=require(_0x5a95('0xb'));var Redis=require(_0x5a95('0xc'));var authService=require(_0x5a95('0xd'));var qs=require(_0x5a95('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a95('0xf'));var logger=require(_0x5a95('0x10'))(_0x5a95('0x11'));var utils=require(_0x5a95('0x12'));var config=require(_0x5a95('0x13'));var licenseUtil=require(_0x5a95('0x14'));var db=require(_0x5a95('0x15'))['db'];function respondWithStatusCode(_0x51f909,_0x42b3e2){_0x42b3e2=_0x42b3e2||0xcc;return function(_0x5f5b63){if(_0x5f5b63){return _0x51f909['sendStatus'](_0x42b3e2);}return _0x51f909['status'](_0x42b3e2)[_0x5a95('0x16')]();};}function respondWithResult(_0xc286d,_0x4a25f2){_0x4a25f2=_0x4a25f2||0xc8;return function(_0x4e383f){if(_0x4e383f){return _0xc286d['status'](_0x4a25f2)[_0x5a95('0x17')](_0x4e383f);}};}function respondWithFilteredResult(_0x3cfc33,_0x281b5f){return function(_0x413dea){if(_0x413dea){var _0x310b67=typeof _0x281b5f[_0x5a95('0x18')]==='undefined'&&typeof _0x281b5f[_0x5a95('0x19')]===_0x5a95('0x1a');var _0x20afd4=_0x413dea[_0x5a95('0x1b')];var _0x1575f0=_0x310b67?0x0:_0x281b5f[_0x5a95('0x18')];var _0x5be2d9=_0x310b67?_0x413dea['count']:_0x281b5f[_0x5a95('0x18')]+_0x281b5f['limit'];var _0x34e2fe;if(_0x5be2d9>=_0x20afd4){_0x5be2d9=_0x20afd4;_0x34e2fe=0xc8;}else{_0x34e2fe=0xce;}_0x3cfc33['status'](_0x34e2fe);return _0x3cfc33['set']('Content-Range',_0x1575f0+'-'+_0x5be2d9+'/'+_0x20afd4)[_0x5a95('0x17')](_0x413dea);}return null;};}function patchUpdates(_0x2fb7f0){return function(_0x21b6d7){try{jsonpatch[_0x5a95('0x1c')](_0x21b6d7,_0x2fb7f0,!![]);}catch(_0x2a7969){return BPromise[_0x5a95('0x1d')](_0x2a7969);}return _0x21b6d7[_0x5a95('0x1e')]();};}function saveUpdates(_0x1bf02f,_0x5e2c1c){return function(_0x434efb){if(_0x434efb){return _0x434efb['update'](_0x1bf02f)[_0x5a95('0x1f')](function(_0x3acf1f){return _0x3acf1f;});}return null;};}function removeEntity(_0x296cb2,_0x5de59f){return function(_0xd88e47){if(_0xd88e47){return _0xd88e47[_0x5a95('0x20')]()[_0x5a95('0x1f')](function(){var _0x4914d7=_0xd88e47[_0x5a95('0x21')]({'plain':!![]});var _0x47ff48=_0x5a95('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x47ff48,'resourceId':_0x4914d7['id']}})[_0x5a95('0x1f')](function(){return _0xd88e47;});})['then'](function(){_0x296cb2[_0x5a95('0x23')](0xcc)[_0x5a95('0x16')]();});}};}function handleEntityNotFound(_0x417dd9,_0xc7ed5f){return function(_0x2e94fa){if(!_0x2e94fa){_0x417dd9[_0x5a95('0x24')](0x194);}return _0x2e94fa;};}function handleError(_0x3f8118,_0x5599cf){_0x5599cf=_0x5599cf||0x1f4;return function(_0x46d8b0){logger[_0x5a95('0x25')](_0x46d8b0[_0x5a95('0x26')]);if(_0x46d8b0['name']){delete _0x46d8b0[_0x5a95('0x27')];}_0x3f8118['status'](_0x5599cf)[_0x5a95('0x28')](_0x46d8b0);};}exports['index']=function(_0x10740c,_0x1cf4e1){var _0x5bb0fe={},_0x21835a={},_0x1ec9f4={'count':0x0,'rows':[]};var _0x39b5a4=_[_0x5a95('0x29')](db[_0x5a95('0x2a')][_0x5a95('0x2b')],function(_0x55ad60){return{'name':_0x55ad60[_0x5a95('0x2c')],'type':_0x55ad60[_0x5a95('0x2d')][_0x5a95('0x2e')]};});_0x21835a[_0x5a95('0x2f')]=_[_0x5a95('0x29')](_0x39b5a4,'name');_0x21835a[_0x5a95('0x30')]=_[_0x5a95('0x31')](_0x10740c['query']);_0x21835a[_0x5a95('0x32')]=_['intersection'](_0x21835a[_0x5a95('0x2f')],_0x21835a[_0x5a95('0x30')]);_0x5bb0fe['attributes']=_[_0x5a95('0x33')](_0x21835a['model'],qs[_0x5a95('0x34')](_0x10740c[_0x5a95('0x30')][_0x5a95('0x34')]));_0x5bb0fe['attributes']=_0x5bb0fe[_0x5a95('0x35')][_0x5a95('0x36')]?_0x5bb0fe[_0x5a95('0x35')]:_0x21835a[_0x5a95('0x2f')];if(!_0x10740c[_0x5a95('0x30')][_0x5a95('0x37')](_0x5a95('0x38'))){_0x5bb0fe[_0x5a95('0x19')]=qs[_0x5a95('0x19')](_0x10740c[_0x5a95('0x30')][_0x5a95('0x19')]);_0x5bb0fe[_0x5a95('0x18')]=qs[_0x5a95('0x18')](_0x10740c[_0x5a95('0x30')]['offset']);}_0x5bb0fe[_0x5a95('0x39')]=qs[_0x5a95('0x3a')](_0x10740c[_0x5a95('0x30')][_0x5a95('0x3a')]);_0x5bb0fe[_0x5a95('0x3b')]=qs['filters'](_[_0x5a95('0x3c')](_0x10740c[_0x5a95('0x30')],_0x21835a[_0x5a95('0x32')]),_0x39b5a4);if(_0x10740c['query'][_0x5a95('0x3d')]){_0x5bb0fe['where']=_[_0x5a95('0x3e')](_0x5bb0fe['where'],{'$or':_['map'](_0x39b5a4,function(_0x2b775e){if(_0x2b775e[_0x5a95('0x2d')]!==_0x5a95('0x3f')){var _0x5033d1={};_0x5033d1[_0x2b775e[_0x5a95('0x27')]]={'$like':'%'+_0x10740c[_0x5a95('0x30')][_0x5a95('0x3d')]+'%'};return _0x5033d1;}})});}_0x5bb0fe=_[_0x5a95('0x3e')]({},_0x5bb0fe,_0x10740c[_0x5a95('0x40')]);var _0x1a8d1b={'where':_0x5bb0fe['where']};return db[_0x5a95('0x2a')][_0x5a95('0x1b')](_0x1a8d1b)['then'](function(_0x35bcab){_0x1ec9f4[_0x5a95('0x1b')]=_0x35bcab;if(_0x10740c['query'][_0x5a95('0x41')]){_0x5bb0fe[_0x5a95('0x42')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x5a95('0x43')](_0x5bb0fe);})[_0x5a95('0x1f')](function(_0x504463){_0x1ec9f4[_0x5a95('0x44')]=_0x504463;return _0x1ec9f4;})[_0x5a95('0x1f')](respondWithFilteredResult(_0x1cf4e1,_0x5bb0fe))[_0x5a95('0x45')](handleError(_0x1cf4e1,null));};exports[_0x5a95('0x46')]=function(_0x289a97,_0x2bfa05){var _0x56e2f2={'raw':!![],'where':{'id':_0x289a97[_0x5a95('0x47')]['id']}},_0x16bafe={};_0x16bafe['model']=_['keys'](db[_0x5a95('0x2a')]['rawAttributes']);_0x16bafe[_0x5a95('0x30')]=_[_0x5a95('0x31')](_0x289a97[_0x5a95('0x30')]);_0x16bafe[_0x5a95('0x32')]=_['intersection'](_0x16bafe[_0x5a95('0x2f')],_0x16bafe['query']);_0x56e2f2['attributes']=_[_0x5a95('0x33')](_0x16bafe['model'],qs[_0x5a95('0x34')](_0x289a97[_0x5a95('0x30')]['fields']));_0x56e2f2[_0x5a95('0x35')]=_0x56e2f2['attributes'][_0x5a95('0x36')]?_0x56e2f2[_0x5a95('0x35')]:_0x16bafe[_0x5a95('0x2f')];if(_0x289a97[_0x5a95('0x30')][_0x5a95('0x41')]){_0x56e2f2[_0x5a95('0x42')]=[{'all':!![]}];}_0x56e2f2=_[_0x5a95('0x3e')]({},_0x56e2f2,_0x289a97[_0x5a95('0x40')]);return db['CmHopperAdditionalPhone'][_0x5a95('0x48')](_0x56e2f2)[_0x5a95('0x1f')](handleEntityNotFound(_0x2bfa05,null))[_0x5a95('0x1f')](respondWithResult(_0x2bfa05,null))[_0x5a95('0x45')](handleError(_0x2bfa05,null));};exports[_0x5a95('0x49')]=function(_0x49837e,_0x2ef27c){return db[_0x5a95('0x2a')][_0x5a95('0x49')](_0x49837e['body'],{})[_0x5a95('0x1f')](function(_0x23c724){var _0x2cb788=_0x49837e[_0x5a95('0x4a')]['get']({'plain':!![]});if(!_0x2cb788)throw new Error(_0x5a95('0x4b'));if(_0x2cb788[_0x5a95('0x4c')]==='user'){var _0x4a680c=_0x23c724[_0x5a95('0x21')]({'plain':!![]});var _0x383d27=_0x5a95('0x22');return db[_0x5a95('0x4d')][_0x5a95('0x48')]({'where':{'name':_0x383d27,'userProfileId':_0x2cb788[_0x5a95('0x4e')]},'raw':!![]})[_0x5a95('0x1f')](function(_0x1feff6){if(_0x1feff6&&_0x1feff6[_0x5a95('0x4f')]===0x0){return db['UserProfileResource'][_0x5a95('0x49')]({'name':_0x4a680c[_0x5a95('0x27')],'resourceId':_0x4a680c['id'],'type':_0x1feff6[_0x5a95('0x27')],'sectionId':_0x1feff6['id']},{})[_0x5a95('0x1f')](function(){return _0x23c724;});}else{return _0x23c724;}})[_0x5a95('0x45')](function(_0x582c39){logger[_0x5a95('0x25')](_0x5a95('0x50'),_0x582c39);throw _0x582c39;});}return _0x23c724;})[_0x5a95('0x1f')](respondWithResult(_0x2ef27c,0xc9))[_0x5a95('0x45')](handleError(_0x2ef27c,null));};exports[_0x5a95('0x51')]=function(_0x12ecf7,_0x2945ab){if(_0x12ecf7['body']['id']){delete _0x12ecf7[_0x5a95('0x52')]['id'];}return db[_0x5a95('0x2a')][_0x5a95('0x48')]({'where':{'id':_0x12ecf7['params']['id']}})[_0x5a95('0x1f')](handleEntityNotFound(_0x2945ab,null))[_0x5a95('0x1f')](saveUpdates(_0x12ecf7['body'],null))[_0x5a95('0x1f')](respondWithResult(_0x2945ab,null))[_0x5a95('0x45')](handleError(_0x2945ab,null));};exports['destroy']=function(_0x4dd65f,_0xdc33df){return db[_0x5a95('0x2a')][_0x5a95('0x48')]({'where':{'id':_0x4dd65f[_0x5a95('0x47')]['id']}})[_0x5a95('0x1f')](handleEntityNotFound(_0xdc33df,null))['then'](removeEntity(_0xdc33df,null))[_0x5a95('0x45')](handleError(_0xdc33df,null));}; \ No newline at end of file +var _0x2216=['ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','end','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','findAll','catch','show','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0xf1e782,_0x1d9645){var _0x779680=function(_0x438d64){while(--_0x438d64){_0xf1e782['push'](_0xf1e782['shift']());}};_0x779680(++_0x1d9645);}(_0x2216,0x14b));var _0x6221=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2216[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x6221('0x0'));var rimraf=require(_0x6221('0x1'));var zipdir=require(_0x6221('0x2'));var jsonpatch=require(_0x6221('0x3'));var rp=require(_0x6221('0x4'));var moment=require('moment');var BPromise=require(_0x6221('0x5'));var Mustache=require(_0x6221('0x6'));var util=require(_0x6221('0x7'));var path=require(_0x6221('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6221('0x9'));var fs=require('fs');var fs_extra=require(_0x6221('0xa'));var _=require(_0x6221('0xb'));var squel=require(_0x6221('0xc'));var crypto=require('crypto');var jsforce=require(_0x6221('0xd'));var deskjs=require(_0x6221('0xe'));var toCsv=require(_0x6221('0xf'));var querystring=require(_0x6221('0x10'));var Papa=require(_0x6221('0x11'));var Redis=require(_0x6221('0x12'));var authService=require(_0x6221('0x13'));var qs=require(_0x6221('0x14'));var as=require(_0x6221('0x15'));var hardwareService=require(_0x6221('0x16'));var logger=require('../../config/logger')(_0x6221('0x17'));var utils=require(_0x6221('0x18'));var config=require(_0x6221('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6221('0x1a'))['db'];function respondWithStatusCode(_0x5cc462,_0x33874a){_0x33874a=_0x33874a||0xcc;return function(_0x1f3332){if(_0x1f3332){return _0x5cc462[_0x6221('0x1b')](_0x33874a);}return _0x5cc462[_0x6221('0x1c')](_0x33874a)['end']();};}function respondWithResult(_0x59d2c8,_0x4d2f00){_0x4d2f00=_0x4d2f00||0xc8;return function(_0x2be0d4){if(_0x2be0d4){return _0x59d2c8['status'](_0x4d2f00)[_0x6221('0x1d')](_0x2be0d4);}};}function respondWithFilteredResult(_0x2d19e2,_0x3b14a6){return function(_0x4e4d37){if(_0x4e4d37){var _0x4ff3ac=typeof _0x3b14a6['offset']===_0x6221('0x1e')&&typeof _0x3b14a6[_0x6221('0x1f')]==='undefined';var _0x55802f=_0x4e4d37[_0x6221('0x20')];var _0x7c2c7=_0x4ff3ac?0x0:_0x3b14a6['offset'];var _0x189b3e=_0x4ff3ac?_0x4e4d37[_0x6221('0x20')]:_0x3b14a6[_0x6221('0x21')]+_0x3b14a6[_0x6221('0x1f')];var _0x337511;if(_0x189b3e>=_0x55802f){_0x189b3e=_0x55802f;_0x337511=0xc8;}else{_0x337511=0xce;}_0x2d19e2[_0x6221('0x1c')](_0x337511);return _0x2d19e2[_0x6221('0x22')]('Content-Range',_0x7c2c7+'-'+_0x189b3e+'/'+_0x55802f)[_0x6221('0x1d')](_0x4e4d37);}return null;};}function patchUpdates(_0x289203){return function(_0x711ce5){try{jsonpatch[_0x6221('0x23')](_0x711ce5,_0x289203,!![]);}catch(_0x2553f2){return BPromise[_0x6221('0x24')](_0x2553f2);}return _0x711ce5[_0x6221('0x25')]();};}function saveUpdates(_0x3af181,_0x358249){return function(_0x543fb1){if(_0x543fb1){return _0x543fb1[_0x6221('0x26')](_0x3af181)[_0x6221('0x27')](function(_0x18c6db){return _0x18c6db;});}return null;};}function removeEntity(_0x240c05,_0x40e290){return function(_0x744d4a){if(_0x744d4a){return _0x744d4a[_0x6221('0x28')]()['then'](function(){var _0x47ac58=_0x744d4a['get']({'plain':!![]});var _0x3c93ac=_0x6221('0x29');return db[_0x6221('0x2a')][_0x6221('0x28')]({'where':{'type':_0x3c93ac,'resourceId':_0x47ac58['id']}})[_0x6221('0x27')](function(){return _0x744d4a;});})[_0x6221('0x27')](function(){_0x240c05[_0x6221('0x1c')](0xcc)[_0x6221('0x2b')]();});}};}function handleEntityNotFound(_0x256f1f,_0x9e2056){return function(_0x5e4e4d){if(!_0x5e4e4d){_0x256f1f['sendStatus'](0x194);}return _0x5e4e4d;};}function handleError(_0x3340a9,_0x2872c3){_0x2872c3=_0x2872c3||0x1f4;return function(_0x42d5c6){logger[_0x6221('0x2c')](_0x42d5c6[_0x6221('0x2d')]);if(_0x42d5c6[_0x6221('0x2e')]){delete _0x42d5c6[_0x6221('0x2e')];}_0x3340a9[_0x6221('0x1c')](_0x2872c3)[_0x6221('0x2f')](_0x42d5c6);};}exports[_0x6221('0x30')]=function(_0x2a1b92,_0x368544){var _0x516976={},_0x34c9ad={},_0x595c1d={'count':0x0,'rows':[]};var _0x4e7dbf=_['map'](db[_0x6221('0x31')][_0x6221('0x32')],function(_0x1123b5){return{'name':_0x1123b5[_0x6221('0x33')],'type':_0x1123b5['type'][_0x6221('0x34')]};});_0x34c9ad[_0x6221('0x35')]=_['map'](_0x4e7dbf,_0x6221('0x2e'));_0x34c9ad[_0x6221('0x36')]=_[_0x6221('0x37')](_0x2a1b92[_0x6221('0x36')]);_0x34c9ad[_0x6221('0x38')]=_[_0x6221('0x39')](_0x34c9ad[_0x6221('0x35')],_0x34c9ad['query']);_0x516976['attributes']=_[_0x6221('0x39')](_0x34c9ad[_0x6221('0x35')],qs[_0x6221('0x3a')](_0x2a1b92[_0x6221('0x36')]['fields']));_0x516976[_0x6221('0x3b')]=_0x516976[_0x6221('0x3b')]['length']?_0x516976['attributes']:_0x34c9ad['model'];if(!_0x2a1b92['query']['hasOwnProperty'](_0x6221('0x3c'))){_0x516976['limit']=qs['limit'](_0x2a1b92[_0x6221('0x36')][_0x6221('0x1f')]);_0x516976['offset']=qs['offset'](_0x2a1b92[_0x6221('0x36')]['offset']);}_0x516976[_0x6221('0x3d')]=qs[_0x6221('0x3e')](_0x2a1b92[_0x6221('0x36')][_0x6221('0x3e')]);_0x516976[_0x6221('0x3f')]=qs[_0x6221('0x38')](_['pick'](_0x2a1b92[_0x6221('0x36')],_0x34c9ad[_0x6221('0x38')]),_0x4e7dbf);if(_0x2a1b92[_0x6221('0x36')][_0x6221('0x40')]){_0x516976['where']=_[_0x6221('0x41')](_0x516976['where'],{'$or':_[_0x6221('0x42')](_0x4e7dbf,function(_0x3b01ca){if(_0x3b01ca['type']!=='VIRTUAL'){var _0x3fc163={};_0x3fc163[_0x3b01ca['name']]={'$like':'%'+_0x2a1b92[_0x6221('0x36')]['filter']+'%'};return _0x3fc163;}})});}_0x516976=_[_0x6221('0x41')]({},_0x516976,_0x2a1b92[_0x6221('0x43')]);var _0x18a89d={'where':_0x516976[_0x6221('0x3f')]};return db['CmHopperAdditionalPhone'][_0x6221('0x20')](_0x18a89d)[_0x6221('0x27')](function(_0x49a71b){_0x595c1d[_0x6221('0x20')]=_0x49a71b;if(_0x2a1b92[_0x6221('0x36')][_0x6221('0x44')]){_0x516976[_0x6221('0x45')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x6221('0x46')](_0x516976);})[_0x6221('0x27')](function(_0x52d062){_0x595c1d['rows']=_0x52d062;return _0x595c1d;})[_0x6221('0x27')](respondWithFilteredResult(_0x368544,_0x516976))[_0x6221('0x47')](handleError(_0x368544,null));};exports[_0x6221('0x48')]=function(_0x392615,_0x28912c){var _0x5f294b={'raw':!![],'where':{'id':_0x392615['params']['id']}},_0x3f4045={};_0x3f4045['model']=_[_0x6221('0x37')](db[_0x6221('0x31')][_0x6221('0x32')]);_0x3f4045[_0x6221('0x36')]=_[_0x6221('0x37')](_0x392615[_0x6221('0x36')]);_0x3f4045[_0x6221('0x38')]=_[_0x6221('0x39')](_0x3f4045['model'],_0x3f4045['query']);_0x5f294b[_0x6221('0x3b')]=_[_0x6221('0x39')](_0x3f4045[_0x6221('0x35')],qs[_0x6221('0x3a')](_0x392615[_0x6221('0x36')][_0x6221('0x3a')]));_0x5f294b[_0x6221('0x3b')]=_0x5f294b[_0x6221('0x3b')][_0x6221('0x49')]?_0x5f294b[_0x6221('0x3b')]:_0x3f4045[_0x6221('0x35')];if(_0x392615['query']['includeAll']){_0x5f294b[_0x6221('0x45')]=[{'all':!![]}];}_0x5f294b=_[_0x6221('0x41')]({},_0x5f294b,_0x392615[_0x6221('0x43')]);return db[_0x6221('0x31')][_0x6221('0x4a')](_0x5f294b)[_0x6221('0x27')](handleEntityNotFound(_0x28912c,null))[_0x6221('0x27')](respondWithResult(_0x28912c,null))[_0x6221('0x47')](handleError(_0x28912c,null));};exports[_0x6221('0x4b')]=function(_0x1fd267,_0x1a4597){return db[_0x6221('0x31')]['create'](_0x1fd267[_0x6221('0x4c')],{})[_0x6221('0x27')](function(_0x52ea16){var _0x4d5cc3=_0x1fd267['user'][_0x6221('0x4d')]({'plain':!![]});if(!_0x4d5cc3)throw new Error(_0x6221('0x4e'));if(_0x4d5cc3[_0x6221('0x4f')]===_0x6221('0x50')){var _0x36c9ad=_0x52ea16[_0x6221('0x4d')]({'plain':!![]});var _0x2f860e=_0x6221('0x29');return db[_0x6221('0x51')][_0x6221('0x4a')]({'where':{'name':_0x2f860e,'userProfileId':_0x4d5cc3['userProfileId']},'raw':!![]})['then'](function(_0x54cfdc){if(_0x54cfdc&&_0x54cfdc[_0x6221('0x52')]===0x0){return db[_0x6221('0x2a')][_0x6221('0x4b')]({'name':_0x36c9ad[_0x6221('0x2e')],'resourceId':_0x36c9ad['id'],'type':_0x54cfdc[_0x6221('0x2e')],'sectionId':_0x54cfdc['id']},{})[_0x6221('0x27')](function(){return _0x52ea16;});}else{return _0x52ea16;}})[_0x6221('0x47')](function(_0x207b63){logger['error'](_0x6221('0x53'),_0x207b63);throw _0x207b63;});}return _0x52ea16;})[_0x6221('0x27')](respondWithResult(_0x1a4597,0xc9))[_0x6221('0x47')](handleError(_0x1a4597,null));};exports['update']=function(_0x1d8082,_0x407c2b){if(_0x1d8082[_0x6221('0x4c')]['id']){delete _0x1d8082[_0x6221('0x4c')]['id'];}return db[_0x6221('0x31')]['find']({'where':{'id':_0x1d8082[_0x6221('0x54')]['id']}})[_0x6221('0x27')](handleEntityNotFound(_0x407c2b,null))[_0x6221('0x27')](saveUpdates(_0x1d8082[_0x6221('0x4c')],null))[_0x6221('0x27')](respondWithResult(_0x407c2b,null))['catch'](handleError(_0x407c2b,null));};exports['destroy']=function(_0x2ab362,_0x2cab3f){return db[_0x6221('0x31')]['find']({'where':{'id':_0x2ab362[_0x6221('0x54')]['id']}})[_0x6221('0x27')](handleEntityNotFound(_0x2cab3f,null))[_0x6221('0x27')](removeEntity(_0x2cab3f,null))[_0x6221('0x47')](handleError(_0x2cab3f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 29677c5..c9d0594 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce6e=['../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3a1953,_0x440442){var _0x51c757=function(_0x7846eb){while(--_0x7846eb){_0x3a1953['push'](_0x3a1953['shift']());}};_0x51c757(++_0x440442);}(_0xce6e,0x7e));var _0xece6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce6e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xece6('0x0'));var util=require('util');var logger=require(_0xece6('0x1'))('api');var moment=require(_0xece6('0x2'));var BPromise=require(_0xece6('0x3'));var rp=require(_0xece6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xece6('0x5'));var config=require(_0xece6('0x6'));var attributes=require(_0xece6('0x7'));module[_0xece6('0x8')]=function(_0x2ef674,_0x3004b0){return _0x2ef674[_0xece6('0x9')](_0xece6('0xa'),attributes,{'tableName':_0xece6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb06c=['./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x306f7b,_0x5a39d8){var _0x16f26d=function(_0x475c6c){while(--_0x475c6c){_0x306f7b['push'](_0x306f7b['shift']());}};_0x16f26d(++_0x5a39d8);}(_0xb06c,0x123));var _0xcb06=function(_0x328b3e,_0x2d47a3){_0x328b3e=_0x328b3e-0x0;var _0x28f6a1=_0xb06c[_0x328b3e];return _0x28f6a1;};'use strict';var _=require('lodash');var util=require(_0xcb06('0x0'));var logger=require(_0xcb06('0x1'))('api');var moment=require(_0xcb06('0x2'));var BPromise=require(_0xcb06('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb06('0x4'));var rimraf=require('rimraf');var config=require(_0xcb06('0x5'));var attributes=require(_0xcb06('0x6'));module[_0xcb06('0x7')]=function(_0x4fd7d9,_0x3f7c42){return _0x4fd7d9[_0xcb06('0x8')](_0xcb06('0x9'),attributes,{'tableName':_0xcb06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 83191ad..c760d75 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc6c=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','SwapAdditionalPhones','CmHopper','VoiceQueueId','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','updatedAt','phone','sequelize','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','CampaignId','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x447813,_0x25cabb){var _0x913e49=function(_0x2c85c6){while(--_0x2c85c6){_0x447813['push'](_0x447813['shift']());}};_0x913e49(++_0x25cabb);}(_0xfc6c,0x1e2));var _0xcfc6=function(_0x4f1b39,_0x2ceb4d){_0x4f1b39=_0x4f1b39-0x0;var _0x333102=_0xfc6c[_0x4f1b39];return _0x333102;};'use strict';var _=require(_0xcfc6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcfc6('0x1'));var rs=require(_0xcfc6('0x2'));var fs=require('fs');var Redis=require(_0xcfc6('0x3'));var db=require(_0xcfc6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcfc6('0x5'))('rpc');var config=require(_0xcfc6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcfc6('0x7')][_0xcfc6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ea774,_0x3f5f82,_0x5072f7){return new BPromise(function(_0x5618ad,_0x2223e7){return client[_0xcfc6('0x9')](_0x1ea774,_0x5072f7)[_0xcfc6('0xa')](function(_0xee1e2){logger['info'](_0xcfc6('0xb'),_0x3f5f82,'request\x20sent');logger[_0xcfc6('0xc')](_0xcfc6('0xd'),_0x3f5f82,_0xcfc6('0xe'),JSON['stringify'](_0xee1e2));if(_0xee1e2[_0xcfc6('0xf')]){if(_0xee1e2[_0xcfc6('0xf')][_0xcfc6('0x10')]===0x1f4){logger[_0xcfc6('0xf')](_0xcfc6('0xb'),_0x3f5f82,_0xee1e2[_0xcfc6('0xf')][_0xcfc6('0x11')]);return _0x2223e7(_0xee1e2['error'][_0xcfc6('0x11')]);}logger[_0xcfc6('0xf')](_0xcfc6('0xb'),_0x3f5f82,_0xee1e2[_0xcfc6('0xf')][_0xcfc6('0x11')]);return _0x5618ad(_0xee1e2['error'][_0xcfc6('0x11')]);}else{logger['info'](_0xcfc6('0xb'),_0x3f5f82,_0xcfc6('0xe'));_0x5618ad(_0xee1e2[_0xcfc6('0x12')][_0xcfc6('0x11')]);}})[_0xcfc6('0x13')](function(_0x5e7269){logger['error'](_0xcfc6('0xb'),_0x3f5f82,_0x5e7269);_0x2223e7(_0x5e7269);});});}exports[_0xcfc6('0x14')]=function(_0x36b98f){var _0x51bc52=this;return new Promise(function(_0x47f139,_0x49db5f){return db['CmHopper'][_0xcfc6('0x15')]({'raw':!![],'where':{'ContactId':_0x36b98f[_0xcfc6('0x16')][_0xcfc6('0x17')],'ListId':_0x36b98f[_0xcfc6('0x16')][_0xcfc6('0x18')],'VoiceQueueId':_0x36b98f[_0xcfc6('0x16')]['VoiceQueueId']===undefined?null:_0x36b98f[_0xcfc6('0x16')]['VoiceQueueId'],'CampaignId':_0x36b98f[_0xcfc6('0x16')][_0xcfc6('0x19')]===undefined?null:_0x36b98f['body'][_0xcfc6('0x19')]}})[_0xcfc6('0xa')](function(_0x2d3618){if(_0x2d3618!=null){return db['CmHopperAdditionalPhone'][_0xcfc6('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2d3618['id'],'OrderBy':{'$gt':_0x2d3618[_0xcfc6('0x1a')]}},'order':[['OrderBy',_0xcfc6('0x1b')]]})[_0xcfc6('0xa')](function(_0x49db51){var _0x3f1e07=0x0;if(_0x49db51){if(_0x49db51[_0xcfc6('0x1c')]+_0x49db51[_0xcfc6('0x1d')]+_0x49db51[_0xcfc6('0x1e')]+_0x49db51[_0xcfc6('0x1f')]+_0x49db51[_0xcfc6('0x20')]+_0x49db51[_0xcfc6('0x21')]+_0x49db51[_0xcfc6('0x22')]+_0x49db51[_0xcfc6('0x23')]<_0x36b98f[_0xcfc6('0x24')][_0xcfc6('0x25')])_0x3f1e07=0x1;_0x47f139({'additional':_0x3f1e07});}else{return db[_0xcfc6('0x26')][_0xcfc6('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2d3618['id']},'order':[[_0xcfc6('0x1a'),_0xcfc6('0x1b')]]})[_0xcfc6('0xa')](function(_0x31aef9){var _0x85b39e=0x0;if(_0x31aef9){if(_0x31aef9[_0xcfc6('0x1c')]+_0x31aef9[_0xcfc6('0x1d')]+_0x31aef9[_0xcfc6('0x1e')]+_0x31aef9[_0xcfc6('0x1f')]+_0x31aef9[_0xcfc6('0x20')]+_0x31aef9[_0xcfc6('0x21')]+_0x31aef9['countmachineretry']+_0x31aef9['countagentrejectretry']<_0x36b98f['entity'][_0xcfc6('0x25')])_0x85b39e=0x1;_0x47f139({'additional':_0x85b39e});}else{_0x47f139({'additional':0x0});}})[_0xcfc6('0x13')](function(_0x4da42a){logger[_0xcfc6('0xf')](_0xcfc6('0x14'),_0x4da42a[_0xcfc6('0x11')]);_0x49db5f(_0x51bc52[_0xcfc6('0xf')](0x1f4,_0x4da42a[_0xcfc6('0x11')]));});}})[_0xcfc6('0x13')](function(_0x2fd073){logger[_0xcfc6('0xf')](_0xcfc6('0x14'),_0x2fd073[_0xcfc6('0x11')]);_0x49db5f(_0x51bc52['error'](0x1f4,_0x2fd073[_0xcfc6('0x11')]));});}else _0x47f139({'additional':0x0});});});};exports[_0xcfc6('0x27')]=function(_0x300c4e){var _0x16bbb9=this;return new Promise(function(_0x9ef86d,_0x196674){return db[_0xcfc6('0x28')][_0xcfc6('0x15')]({'raw':!![],'where':{'ContactId':_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x17')],'ListId':_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x18')],'VoiceQueueId':_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x29')]===undefined?null:_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x29')],'CampaignId':_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x19')]===undefined?null:_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x19')]}})['then'](function(_0x2c2d25){if(_0x2c2d25!=null){return db['CmHopperAdditionalPhone'][_0xcfc6('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2c2d25['id'],'OrderBy':{'$gte':_0x2c2d25[_0xcfc6('0x1a')]}},'order':[['OrderBy',_0xcfc6('0x1b')]]})[_0xcfc6('0xa')](function(_0x266545){if(_0x266545)return activateAdditionalPhone(_0x2c2d25,_0x300c4e['body'],_0x266545,_0x300c4e[_0xcfc6('0x2a')],_0x300c4e[_0xcfc6('0x2b')])[_0xcfc6('0xa')](function(_0x5ecfcd){_0x9ef86d(_0x5ecfcd);});else{return db[_0xcfc6('0x26')][_0xcfc6('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2c2d25['id']},'order':[['OrderBy',_0xcfc6('0x1b')]]})['then'](function(_0xf710ff){if(_0xf710ff)return activateAdditionalPhone(_0x2c2d25,_0x300c4e[_0xcfc6('0x16')],_0xf710ff,_0x300c4e[_0xcfc6('0x2a')],_0x300c4e['waitTime'])[_0xcfc6('0xa')](function(_0x27f3f1){_0x9ef86d(_0x27f3f1);});else{_0x9ef86d({'id':_0x2c2d25['id'],'phone':''});}})[_0xcfc6('0x13')](function(_0xe00a85){logger[_0xcfc6('0xf')](_0xcfc6('0x14'),_0xe00a85[_0xcfc6('0x11')]);_0x196674(_0x16bbb9[_0xcfc6('0xf')](0x1f4,_0xe00a85[_0xcfc6('0x11')]));});}})[_0xcfc6('0x13')](function(_0x55a127){logger['error']('VerifyAdditionalPhones',_0x55a127['message']);_0x196674(_0x16bbb9['error'](0x1f4,_0x55a127[_0xcfc6('0x11')]));});}else _0x9ef86d(0x1);});});};function activateAdditionalPhone(_0x9a4360,_0x1ea0fb,_0x35d610,_0x22e80,_0x37bb37){return new Promise(function(_0x1bcba7,_0xb323aa){var _0x1d1ef4;if(_[_0xcfc6('0x2c')](_0x35d610[_0xcfc6('0x2d')])){_0x35d610['scheduledat']=moment();}if(moment()>moment(_0x35d610[_0xcfc6('0x2d')])){_0x1d1ef4=moment()[_0xcfc6('0x2e')](_0x37bb37||0x3,'minutes');}else{if(_0x35d610[_0xcfc6('0x1a')]==0x0){_0x1d1ef4=moment(_0x35d610[_0xcfc6('0x2d')]);}else{_0x1d1ef4=moment()[_0xcfc6('0x2e')](_0x37bb37||0x3,_0xcfc6('0x2f'));}}if(_['isNil'](_0x1d1ef4)){_0x1d1ef4=moment()['add'](_0x37bb37||0x3,_0xcfc6('0x2f'));}var _0x33eb60={'phone':_0x9a4360['phone'],'active':0x0,'OrderBy':_[_0xcfc6('0x2c')](_0x9a4360[_0xcfc6('0x1a')])?0x0:_0x9a4360[_0xcfc6('0x1a')],'scheduledat':moment()[_0xcfc6('0x2e')](_0x22e80||0x1,_0xcfc6('0x2f')),'countbusyretry':_0x1ea0fb[_0xcfc6('0x1c')],'countcongestionretry':_0x1ea0fb['countcongestionretry'],'countnoanswerretry':_0x1ea0fb[_0xcfc6('0x1e')],'countnosuchnumberretry':_0x1ea0fb[_0xcfc6('0x1f')],'countdropretry':_0x1ea0fb[_0xcfc6('0x20')],'countabandonedretry':_0x1ea0fb[_0xcfc6('0x21')],'countmachineretry':_0x1ea0fb[_0xcfc6('0x22')],'countagentrejectretry':_0x1ea0fb[_0xcfc6('0x23')],'createdAt':_0x1ea0fb[_0xcfc6('0x30')],'updatedAt':_0x1ea0fb[_0xcfc6('0x31')]};var _0x2a1f95={'CmHopperId':_0x9a4360['id'],'phone':_0x35d610[_0xcfc6('0x32')],'active':0x0,'OrderBy':_[_0xcfc6('0x2c')](_0x35d610[_0xcfc6('0x1a')])?0x0:_0x35d610[_0xcfc6('0x1a')],'scheduledat':_0x1d1ef4,'countbusyretry':_0x35d610['countbusyretry'],'countcongestionretry':_0x35d610[_0xcfc6('0x1d')],'countnoanswerretry':_0x35d610[_0xcfc6('0x1e')],'countnosuchnumberretry':_0x35d610[_0xcfc6('0x1f')],'countdropretry':_0x35d610[_0xcfc6('0x20')],'countabandonedretry':_0x35d610[_0xcfc6('0x21')],'countmachineretry':_0x35d610[_0xcfc6('0x22')],'countagentrejectretry':_0x35d610[_0xcfc6('0x23')],'createdAt':_0x35d610[_0xcfc6('0x30')],'updatedAt':_0x35d610[_0xcfc6('0x31')]};return db[_0xcfc6('0x33')][_0xcfc6('0x34')](function(_0x374c42){return db['CmHopperAdditionalPhone'][_0xcfc6('0x35')](_0x33eb60,{'where':{'id':_0x35d610['id']}},{'transaction':_0x374c42})[_0xcfc6('0xa')](function(){return db[_0xcfc6('0x28')][_0xcfc6('0x35')](_0x2a1f95,{'where':{'id':_0x9a4360['id']}},{'transaction':_0x374c42});});})[_0xcfc6('0xa')](function(_0x23cb30){_0x1bcba7({'id':_0x9a4360['id'],'phone':_0x35d610['phone']});})['catch'](function(_0x967bad){logger[_0xcfc6('0xf')](_0xcfc6('0x36'),_0x967bad['message']);_0xb323aa({'error':_0x967bad['message']});});});}exports['IncrementPreviewCounters']=function(_0x4d0522){var _0x14a0ee=this;return new Promise(function(_0x29a050,_0x32b39f){return db[_0xcfc6('0x28')]['update'](_0x4d0522[_0xcfc6('0x16')][_0xcfc6('0x37')],{'where':{'id':_0x4d0522[_0xcfc6('0x16')]['id']}})['then'](function(_0xa37766){_0x29a050(_0xa37766);})[_0xcfc6('0x13')](function(_0x3f6c0d){logger[_0xcfc6('0xf')](_0xcfc6('0x38'),_0x3f6c0d[_0xcfc6('0x11')]);_0x32b39f(_0x14a0ee[_0xcfc6('0xf')](0x1f4,_0x3f6c0d['message']));});});}; \ No newline at end of file +var _0x22a2=['createdAt','updatedAt','phone','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper','findOne','body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnoanswerretry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','scheduledat','minutes','add','isNil'];(function(_0x32156e,_0x502add){var _0x584e82=function(_0x1de230){while(--_0x1de230){_0x32156e['push'](_0x32156e['shift']());}};_0x584e82(++_0x502add);}(_0x22a2,0xf0));var _0x222a=function(_0x2c5bf8,_0x436e68){_0x2c5bf8=_0x2c5bf8-0x0;var _0x1b5ace=_0x22a2[_0x2c5bf8];return _0x1b5ace;};'use strict';var _=require(_0x222a('0x0'));var util=require(_0x222a('0x1'));var moment=require(_0x222a('0x2'));var BPromise=require(_0x222a('0x3'));var rs=require(_0x222a('0x4'));var fs=require('fs');var Redis=require(_0x222a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x222a('0x6'));var logger=require(_0x222a('0x7'))('rpc');var config=require(_0x222a('0x8'));var jayson=require(_0x222a('0x9'));var client=jayson[_0x222a('0xa')][_0x222a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b83e2,_0x40b517,_0x3a4060){return new BPromise(function(_0x2b223f,_0x552b20){return client['request'](_0x5b83e2,_0x3a4060)[_0x222a('0xc')](function(_0x548656){logger[_0x222a('0xd')](_0x222a('0xe'),_0x40b517,_0x222a('0xf'));logger[_0x222a('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x40b517,_0x222a('0xf'),JSON[_0x222a('0x11')](_0x548656));if(_0x548656[_0x222a('0x12')]){if(_0x548656[_0x222a('0x12')][_0x222a('0x13')]===0x1f4){logger[_0x222a('0x12')](_0x222a('0xe'),_0x40b517,_0x548656[_0x222a('0x12')][_0x222a('0x14')]);return _0x552b20(_0x548656[_0x222a('0x12')]['message']);}logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x40b517,_0x548656[_0x222a('0x12')][_0x222a('0x14')]);return _0x2b223f(_0x548656['error'][_0x222a('0x14')]);}else{logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x40b517,_0x222a('0xf'));_0x2b223f(_0x548656[_0x222a('0x15')][_0x222a('0x14')]);}})[_0x222a('0x16')](function(_0x1e92da){logger[_0x222a('0x12')](_0x222a('0xe'),_0x40b517,_0x1e92da);_0x552b20(_0x1e92da);});});}exports['VerifyAdditionalPhones']=function(_0x15bbcc){var _0x2bec49=this;return new Promise(function(_0x18c82a,_0xba529b){return db[_0x222a('0x17')][_0x222a('0x18')]({'raw':!![],'where':{'ContactId':_0x15bbcc[_0x222a('0x19')][_0x222a('0x1a')],'ListId':_0x15bbcc['body']['ListId'],'VoiceQueueId':_0x15bbcc['body'][_0x222a('0x1b')]===undefined?null:_0x15bbcc[_0x222a('0x19')]['VoiceQueueId'],'CampaignId':_0x15bbcc[_0x222a('0x19')][_0x222a('0x1c')]===undefined?null:_0x15bbcc[_0x222a('0x19')][_0x222a('0x1c')]}})[_0x222a('0xc')](function(_0x54211){if(_0x54211!=null){return db[_0x222a('0x1d')][_0x222a('0x18')]({'raw':!![],'where':{'CmHopperId':_0x54211['id'],'OrderBy':{'$gt':_0x54211[_0x222a('0x1e')]}},'order':[['OrderBy',_0x222a('0x1f')]]})[_0x222a('0xc')](function(_0xc44ee8){var _0xe25a02=0x0;if(_0xc44ee8){if(_0xc44ee8[_0x222a('0x20')]+_0xc44ee8[_0x222a('0x21')]+_0xc44ee8['countnoanswerretry']+_0xc44ee8[_0x222a('0x22')]+_0xc44ee8[_0x222a('0x23')]+_0xc44ee8[_0x222a('0x24')]+_0xc44ee8[_0x222a('0x25')]+_0xc44ee8[_0x222a('0x26')]<_0x15bbcc[_0x222a('0x27')][_0x222a('0x28')])_0xe25a02=0x1;_0x18c82a({'additional':_0xe25a02});}else{return db[_0x222a('0x1d')][_0x222a('0x18')]({'raw':!![],'where':{'CmHopperId':_0x54211['id']},'order':[[_0x222a('0x1e'),_0x222a('0x1f')]]})[_0x222a('0xc')](function(_0x5d1170){var _0x254111=0x0;if(_0x5d1170){if(_0x5d1170[_0x222a('0x20')]+_0x5d1170['countcongestionretry']+_0x5d1170[_0x222a('0x29')]+_0x5d1170['countnosuchnumberretry']+_0x5d1170['countdropretry']+_0x5d1170[_0x222a('0x24')]+_0x5d1170[_0x222a('0x25')]+_0x5d1170['countagentrejectretry']<_0x15bbcc['entity'][_0x222a('0x28')])_0x254111=0x1;_0x18c82a({'additional':_0x254111});}else{_0x18c82a({'additional':0x0});}})[_0x222a('0x16')](function(_0xee7aa9){logger[_0x222a('0x12')](_0x222a('0x2a'),_0xee7aa9[_0x222a('0x14')]);_0xba529b(_0x2bec49[_0x222a('0x12')](0x1f4,_0xee7aa9[_0x222a('0x14')]));});}})['catch'](function(_0x2c2fdf){logger[_0x222a('0x12')](_0x222a('0x2a'),_0x2c2fdf[_0x222a('0x14')]);_0xba529b(_0x2bec49[_0x222a('0x12')](0x1f4,_0x2c2fdf[_0x222a('0x14')]));});}else _0x18c82a({'additional':0x0});});});};exports[_0x222a('0x2b')]=function(_0x4f6aa1){var _0x1f39d5=this;return new Promise(function(_0x4f9212,_0x3d30d4){return db[_0x222a('0x17')][_0x222a('0x18')]({'raw':!![],'where':{'ContactId':_0x4f6aa1[_0x222a('0x19')][_0x222a('0x1a')],'ListId':_0x4f6aa1[_0x222a('0x19')]['ListId'],'VoiceQueueId':_0x4f6aa1[_0x222a('0x19')][_0x222a('0x1b')]===undefined?null:_0x4f6aa1['body'][_0x222a('0x1b')],'CampaignId':_0x4f6aa1[_0x222a('0x19')][_0x222a('0x1c')]===undefined?null:_0x4f6aa1[_0x222a('0x19')][_0x222a('0x1c')]}})[_0x222a('0xc')](function(_0x36a830){if(_0x36a830!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x36a830['id'],'OrderBy':{'$gte':_0x36a830[_0x222a('0x1e')]}},'order':[[_0x222a('0x1e'),_0x222a('0x1f')]]})[_0x222a('0xc')](function(_0x1e03b1){if(_0x1e03b1)return activateAdditionalPhone(_0x36a830,_0x4f6aa1[_0x222a('0x19')],_0x1e03b1,_0x4f6aa1[_0x222a('0x2c')],_0x4f6aa1[_0x222a('0x2d')])[_0x222a('0xc')](function(_0x5bde33){_0x4f9212(_0x5bde33);});else{return db['CmHopperAdditionalPhone'][_0x222a('0x18')]({'raw':!![],'where':{'CmHopperId':_0x36a830['id']},'order':[[_0x222a('0x1e'),_0x222a('0x1f')]]})[_0x222a('0xc')](function(_0x27265b){if(_0x27265b)return activateAdditionalPhone(_0x36a830,_0x4f6aa1['body'],_0x27265b,_0x4f6aa1['duration'],_0x4f6aa1[_0x222a('0x2d')])[_0x222a('0xc')](function(_0x2171b9){_0x4f9212(_0x2171b9);});else{_0x4f9212({'id':_0x36a830['id'],'phone':''});}})['catch'](function(_0x3123a7){logger[_0x222a('0x12')](_0x222a('0x2a'),_0x3123a7[_0x222a('0x14')]);_0x3d30d4(_0x1f39d5['error'](0x1f4,_0x3123a7[_0x222a('0x14')]));});}})[_0x222a('0x16')](function(_0x397e4a){logger[_0x222a('0x12')](_0x222a('0x2a'),_0x397e4a[_0x222a('0x14')]);_0x3d30d4(_0x1f39d5[_0x222a('0x12')](0x1f4,_0x397e4a[_0x222a('0x14')]));});}else _0x4f9212(0x1);});});};function activateAdditionalPhone(_0x442fdb,_0xc5d910,_0x36af97,_0x177c23,_0x3e8f5d){return new Promise(function(_0x2406af,_0x1695d2){var _0xd3397a;if(_['isNil'](_0x36af97[_0x222a('0x2e')])){_0x36af97[_0x222a('0x2e')]=moment();}if(moment()>moment(_0x36af97[_0x222a('0x2e')])){_0xd3397a=moment()['add'](_0x3e8f5d||0x3,_0x222a('0x2f'));}else{if(_0x36af97[_0x222a('0x1e')]==0x0){_0xd3397a=moment(_0x36af97[_0x222a('0x2e')]);}else{_0xd3397a=moment()[_0x222a('0x30')](_0x3e8f5d||0x3,_0x222a('0x2f'));}}if(_['isNil'](_0xd3397a)){_0xd3397a=moment()[_0x222a('0x30')](_0x3e8f5d||0x3,_0x222a('0x2f'));}var _0x2688a9={'phone':_0x442fdb['phone'],'active':0x0,'OrderBy':_[_0x222a('0x31')](_0x442fdb[_0x222a('0x1e')])?0x0:_0x442fdb[_0x222a('0x1e')],'scheduledat':moment()[_0x222a('0x30')](_0x177c23||0x1,'minutes'),'countbusyretry':_0xc5d910[_0x222a('0x20')],'countcongestionretry':_0xc5d910['countcongestionretry'],'countnoanswerretry':_0xc5d910[_0x222a('0x29')],'countnosuchnumberretry':_0xc5d910[_0x222a('0x22')],'countdropretry':_0xc5d910[_0x222a('0x23')],'countabandonedretry':_0xc5d910[_0x222a('0x24')],'countmachineretry':_0xc5d910[_0x222a('0x25')],'countagentrejectretry':_0xc5d910['countagentrejectretry'],'createdAt':_0xc5d910[_0x222a('0x32')],'updatedAt':_0xc5d910[_0x222a('0x33')]};var _0x4c2fe4={'CmHopperId':_0x442fdb['id'],'phone':_0x36af97[_0x222a('0x34')],'active':0x0,'OrderBy':_[_0x222a('0x31')](_0x36af97[_0x222a('0x1e')])?0x0:_0x36af97[_0x222a('0x1e')],'scheduledat':_0xd3397a,'countbusyretry':_0x36af97[_0x222a('0x20')],'countcongestionretry':_0x36af97[_0x222a('0x21')],'countnoanswerretry':_0x36af97['countnoanswerretry'],'countnosuchnumberretry':_0x36af97[_0x222a('0x22')],'countdropretry':_0x36af97[_0x222a('0x23')],'countabandonedretry':_0x36af97[_0x222a('0x24')],'countmachineretry':_0x36af97[_0x222a('0x25')],'countagentrejectretry':_0x36af97['countagentrejectretry'],'createdAt':_0x36af97[_0x222a('0x32')],'updatedAt':_0x36af97[_0x222a('0x33')]};return db[_0x222a('0x35')]['transaction'](function(_0x2919b8){return db[_0x222a('0x1d')][_0x222a('0x36')](_0x2688a9,{'where':{'id':_0x36af97['id']}},{'transaction':_0x2919b8})['then'](function(){return db[_0x222a('0x17')][_0x222a('0x36')](_0x4c2fe4,{'where':{'id':_0x442fdb['id']}},{'transaction':_0x2919b8});});})[_0x222a('0xc')](function(_0x5b77aa){_0x2406af({'id':_0x442fdb['id'],'phone':_0x36af97[_0x222a('0x34')]});})['catch'](function(_0x3a7661){logger[_0x222a('0x12')](_0x222a('0x37'),_0x3a7661[_0x222a('0x14')]);_0x1695d2({'error':_0x3a7661[_0x222a('0x14')]});});});}exports[_0x222a('0x38')]=function(_0x25250c){var _0x4c1489=this;return new Promise(function(_0x26e1ad,_0x19bd0d){return db['CmHopper'][_0x222a('0x36')](_0x25250c[_0x222a('0x19')][_0x222a('0x39')],{'where':{'id':_0x25250c[_0x222a('0x19')]['id']}})['then'](function(_0x1a7d4b){_0x26e1ad(_0x1a7d4b);})[_0x222a('0x16')](function(_0x5b1090){logger['error'](_0x222a('0x38'),_0x5b1090[_0x222a('0x14')]);_0x19bd0d(_0x4c1489['error'](0x1f4,_0x5b1090[_0x222a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 2808271..eb55a96 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4cf=['isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc4cf,0xc8));var _0xfc4c=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xc4cf[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0xfc4c('0x0'));var util=require(_0xfc4c('0x1'));var path=require(_0xfc4c('0x2'));var timeout=require(_0xfc4c('0x3'));var express=require(_0xfc4c('0x4'));var router=express[_0xfc4c('0x5')]();var fs_extra=require(_0xfc4c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfc4c('0x7'));var config=require(_0xfc4c('0x8'));var controller=require('./cmHopperAdditionalPhone.controller');router['get']('/',auth[_0xfc4c('0x9')](),controller[_0xfc4c('0xa')]);router[_0xfc4c('0xb')](_0xfc4c('0xc'),auth['isAuthenticated'](),controller[_0xfc4c('0xd')]);router[_0xfc4c('0xe')]('/',auth[_0xfc4c('0x9')](),controller[_0xfc4c('0xf')]);router[_0xfc4c('0x10')](_0xfc4c('0xc'),auth[_0xfc4c('0x9')](),controller['update']);router['delete']('/:id',auth[_0xfc4c('0x9')](),controller[_0xfc4c('0x11')]);module[_0xfc4c('0x12')]=router; \ No newline at end of file +var _0x7da2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','exports','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7da2,0xba));var _0x27da=function(_0x2f6a18,_0x199b71){_0x2f6a18=_0x2f6a18-0x0;var _0x5150d2=_0x7da2[_0x2f6a18];return _0x5150d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x27da('0x0'));var timeout=require(_0x27da('0x1'));var express=require(_0x27da('0x2'));var router=express[_0x27da('0x3')]();var fs_extra=require(_0x27da('0x4'));var auth=require(_0x27da('0x5'));var interaction=require(_0x27da('0x6'));var config=require(_0x27da('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x27da('0x8')]('/',auth[_0x27da('0x9')](),controller[_0x27da('0xa')]);router[_0x27da('0x8')](_0x27da('0xb'),auth['isAuthenticated'](),controller[_0x27da('0xc')]);router['post']('/',auth[_0x27da('0x9')](),controller[_0x27da('0xd')]);router[_0x27da('0xe')](_0x27da('0xb'),auth[_0x27da('0x9')](),controller[_0x27da('0xf')]);router['delete'](_0x27da('0xb'),auth[_0x27da('0x9')](),controller['destroy']);module[_0x27da('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index be28937..c65efaf 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js +++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb69e=['STRING','contactListQueue','INTEGER','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb69e,0xb3));var _0xeb69=function(_0x58a938,_0x419e11){_0x58a938=_0x58a938-0x0;var _0x17c84b=_0xb69e[_0x58a938];return _0x17c84b;};'use strict';var moment=require(_0xeb69('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xeb69('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xeb69('0x2')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xeb69('0x2')},'VoiceQueueId':{'type':Sequelize[_0xeb69('0x3')],'unique':_0xeb69('0x2')}}; \ No newline at end of file +var _0x2bae=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xe2ba('0x0'));var Sequelize=require(_0xe2ba('0x1'));module[_0xe2ba('0x2')]={'phone':{'type':Sequelize[_0xe2ba('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe2ba('0x4')],'unique':_0xe2ba('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xe2ba('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xe2ba('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 9cab502..5117629 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.controller.js +++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9564=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','include','findAll','rows','catch','show','includeAll','find','update','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9564,0x1eb));var _0x4956=function(_0x47d454,_0xf3253a){_0x47d454=_0x47d454-0x0;var _0x1188b9=_0x9564[_0x47d454];return _0x1188b9;};'use strict';var emlformat=require(_0x4956('0x0'));var rimraf=require(_0x4956('0x1'));var zipdir=require(_0x4956('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4956('0x3'));var moment=require(_0x4956('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4956('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4956('0x6'));var csv=require(_0x4956('0x7'));var ejs=require(_0x4956('0x8'));var fs=require('fs');var fs_extra=require(_0x4956('0x9'));var _=require(_0x4956('0xa'));var squel=require(_0x4956('0xb'));var crypto=require(_0x4956('0xc'));var jsforce=require(_0x4956('0xd'));var deskjs=require(_0x4956('0xe'));var toCsv=require(_0x4956('0x7'));var querystring=require(_0x4956('0xf'));var Papa=require(_0x4956('0x10'));var Redis=require(_0x4956('0x11'));var authService=require(_0x4956('0x12'));var qs=require(_0x4956('0x13'));var as=require(_0x4956('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4956('0x15'))('api');var utils=require(_0x4956('0x16'));var config=require(_0x4956('0x17'));var licenseUtil=require(_0x4956('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13ae9f,_0x45540c){_0x45540c=_0x45540c||0xcc;return function(_0x15f70e){if(_0x15f70e){return _0x13ae9f['sendStatus'](_0x45540c);}return _0x13ae9f['status'](_0x45540c)[_0x4956('0x19')]();};}function respondWithResult(_0x195c32,_0x586d53){_0x586d53=_0x586d53||0xc8;return function(_0x3bb03d){if(_0x3bb03d){return _0x195c32[_0x4956('0x1a')](_0x586d53)[_0x4956('0x1b')](_0x3bb03d);}};}function respondWithFilteredResult(_0x1097ce,_0x41c443){return function(_0x38cbe7){if(_0x38cbe7){var _0x290884=typeof _0x41c443[_0x4956('0x1c')]===_0x4956('0x1d')&&typeof _0x41c443[_0x4956('0x1e')]==='undefined';var _0x2d0acb=_0x38cbe7[_0x4956('0x1f')];var _0x2738dc=_0x290884?0x0:_0x41c443[_0x4956('0x1c')];var _0x382781=_0x290884?_0x38cbe7[_0x4956('0x1f')]:_0x41c443[_0x4956('0x1c')]+_0x41c443[_0x4956('0x1e')];var _0x6e90ce;if(_0x382781>=_0x2d0acb){_0x382781=_0x2d0acb;_0x6e90ce=0xc8;}else{_0x6e90ce=0xce;}_0x1097ce[_0x4956('0x1a')](_0x6e90ce);return _0x1097ce[_0x4956('0x20')](_0x4956('0x21'),_0x2738dc+'-'+_0x382781+'/'+_0x2d0acb)[_0x4956('0x1b')](_0x38cbe7);}return null;};}function patchUpdates(_0x45c1a9){return function(_0x2eb428){try{jsonpatch[_0x4956('0x22')](_0x2eb428,_0x45c1a9,!![]);}catch(_0x1e0c8a){return BPromise[_0x4956('0x23')](_0x1e0c8a);}return _0x2eb428[_0x4956('0x24')]();};}function saveUpdates(_0x88a9e,_0x112f87){return function(_0x5e3eec){if(_0x5e3eec){return _0x5e3eec['update'](_0x88a9e)[_0x4956('0x25')](function(_0x507a50){return _0x507a50;});}return null;};}function removeEntity(_0x55f635,_0x1dee67){return function(_0x1dc13c){if(_0x1dc13c){return _0x1dc13c[_0x4956('0x26')]()['then'](function(){_0x55f635[_0x4956('0x1a')](0xcc)[_0x4956('0x19')]();});}};}function handleEntityNotFound(_0x438d7a,_0x1987ad){return function(_0x386c16){if(!_0x386c16){_0x438d7a[_0x4956('0x27')](0x194);}return _0x386c16;};}function handleError(_0x5ce72d,_0x381c05){_0x381c05=_0x381c05||0x1f4;return function(_0x4a0412){logger[_0x4956('0x28')](_0x4a0412[_0x4956('0x29')]);if(_0x4a0412[_0x4956('0x2a')]){delete _0x4a0412[_0x4956('0x2a')];}_0x5ce72d[_0x4956('0x1a')](_0x381c05)[_0x4956('0x2b')](_0x4a0412);};}exports[_0x4956('0x2c')]=function(_0x130d2f,_0x4a2096){var _0x5659db={},_0x521870={},_0x16245c={'count':0x0,'rows':[]};var _0x4ec774=_['map'](db[_0x4956('0x2d')][_0x4956('0x2e')],function(_0x2421ea){return{'name':_0x2421ea[_0x4956('0x2f')],'type':_0x2421ea['type'][_0x4956('0x30')]};});_0x521870[_0x4956('0x31')]=_['map'](_0x4ec774,_0x4956('0x2a'));_0x521870[_0x4956('0x32')]=_[_0x4956('0x33')](_0x130d2f[_0x4956('0x32')]);_0x521870[_0x4956('0x34')]=_[_0x4956('0x35')](_0x521870[_0x4956('0x31')],_0x521870[_0x4956('0x32')]);_0x5659db[_0x4956('0x36')]=_['intersection'](_0x521870[_0x4956('0x31')],qs['fields'](_0x130d2f[_0x4956('0x32')][_0x4956('0x37')]));_0x5659db[_0x4956('0x36')]=_0x5659db[_0x4956('0x36')][_0x4956('0x38')]?_0x5659db[_0x4956('0x36')]:_0x521870[_0x4956('0x31')];if(!_0x130d2f[_0x4956('0x32')][_0x4956('0x39')]('nolimit')){_0x5659db[_0x4956('0x1e')]=qs[_0x4956('0x1e')](_0x130d2f['query'][_0x4956('0x1e')]);_0x5659db[_0x4956('0x1c')]=qs['offset'](_0x130d2f[_0x4956('0x32')][_0x4956('0x1c')]);}_0x5659db[_0x4956('0x3a')]=qs['sort'](_0x130d2f[_0x4956('0x32')][_0x4956('0x3b')]);_0x5659db[_0x4956('0x3c')]=qs[_0x4956('0x34')](_[_0x4956('0x3d')](_0x130d2f[_0x4956('0x32')],_0x521870[_0x4956('0x34')]),_0x4ec774);if(_0x130d2f[_0x4956('0x32')][_0x4956('0x3e')]){_0x5659db['where']=_['merge'](_0x5659db[_0x4956('0x3c')],{'$or':_['map'](_0x4ec774,function(_0x326a54){if(_0x326a54[_0x4956('0x3f')]!=='VIRTUAL'){var _0x5ccb03={};_0x5ccb03[_0x326a54[_0x4956('0x2a')]]={'$like':'%'+_0x130d2f[_0x4956('0x32')][_0x4956('0x3e')]+'%'};return _0x5ccb03;}})});}_0x5659db=_[_0x4956('0x40')]({},_0x5659db,_0x130d2f[_0x4956('0x41')]);var _0x40c315={'where':_0x5659db[_0x4956('0x3c')]};return db[_0x4956('0x2d')][_0x4956('0x1f')](_0x40c315)[_0x4956('0x25')](function(_0x19c1d6){_0x16245c[_0x4956('0x1f')]=_0x19c1d6;if(_0x130d2f[_0x4956('0x32')]['includeAll']){_0x5659db[_0x4956('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x4956('0x43')](_0x5659db);})['then'](function(_0x182b57){_0x16245c[_0x4956('0x44')]=_0x182b57;return _0x16245c;})[_0x4956('0x25')](respondWithFilteredResult(_0x4a2096,_0x5659db))[_0x4956('0x45')](handleError(_0x4a2096,null));};exports[_0x4956('0x46')]=function(_0x1c83a7,_0x912a04){var _0x58c2c7={'raw':!![],'where':{'id':_0x1c83a7['params']['id']}},_0x2a89be={};_0x2a89be[_0x4956('0x31')]=_[_0x4956('0x33')](db['CmHopperBlack'][_0x4956('0x2e')]);_0x2a89be[_0x4956('0x32')]=_['keys'](_0x1c83a7[_0x4956('0x32')]);_0x2a89be[_0x4956('0x34')]=_[_0x4956('0x35')](_0x2a89be[_0x4956('0x31')],_0x2a89be[_0x4956('0x32')]);_0x58c2c7[_0x4956('0x36')]=_['intersection'](_0x2a89be[_0x4956('0x31')],qs[_0x4956('0x37')](_0x1c83a7[_0x4956('0x32')]['fields']));_0x58c2c7[_0x4956('0x36')]=_0x58c2c7['attributes'][_0x4956('0x38')]?_0x58c2c7[_0x4956('0x36')]:_0x2a89be['model'];if(_0x1c83a7[_0x4956('0x32')][_0x4956('0x47')]){_0x58c2c7[_0x4956('0x42')]=[{'all':!![]}];}_0x58c2c7=_[_0x4956('0x40')]({},_0x58c2c7,_0x1c83a7[_0x4956('0x41')]);return db[_0x4956('0x2d')][_0x4956('0x48')](_0x58c2c7)[_0x4956('0x25')](handleEntityNotFound(_0x912a04,null))[_0x4956('0x25')](respondWithResult(_0x912a04,null))[_0x4956('0x45')](handleError(_0x912a04,null));};exports[_0x4956('0x49')]=function(_0x1a1466,_0x2a3bb4){if(_0x1a1466[_0x4956('0x4a')]['id']){delete _0x1a1466[_0x4956('0x4a')]['id'];}return db[_0x4956('0x2d')][_0x4956('0x48')]({'where':{'id':_0x1a1466[_0x4956('0x4b')]['id']}})[_0x4956('0x25')](handleEntityNotFound(_0x2a3bb4,null))[_0x4956('0x25')](saveUpdates(_0x1a1466[_0x4956('0x4a')],null))[_0x4956('0x25')](respondWithResult(_0x2a3bb4,null))[_0x4956('0x45')](handleError(_0x2a3bb4,null));};exports[_0x4956('0x26')]=function(_0x3dcc06,_0x4ca75b){return db['CmHopperBlack'][_0x4956('0x48')]({'where':{'id':_0x3dcc06[_0x4956('0x4b')]['id']}})[_0x4956('0x25')](handleEntityNotFound(_0x4ca75b,null))[_0x4956('0x25')](removeEntity(_0x4ca75b,null))[_0x4956('0x45')](handleError(_0x4ca75b,null));};exports[_0x4956('0x4c')]=function(_0x4a3f65,_0x5e8397){return db[_0x4956('0x2d')][_0x4956('0x4c')]()['then'](respondWithResult(_0x5e8397,null))['catch'](handleError(_0x5e8397,null));}; \ No newline at end of file +var _0x958a=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperBlack','include','findAll','rows','catch','show','params','keys','includeAll','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x958a,0x128));var _0xa958=function(_0x3e8d88,_0x42890d){_0x3e8d88=_0x3e8d88-0x0;var _0x475517=_0x958a[_0x3e8d88];return _0x475517;};'use strict';var emlformat=require(_0xa958('0x0'));var rimraf=require(_0xa958('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa958('0x2'));var rp=require(_0xa958('0x3'));var moment=require(_0xa958('0x4'));var BPromise=require(_0xa958('0x5'));var Mustache=require(_0xa958('0x6'));var util=require('util');var path=require(_0xa958('0x7'));var sox=require('sox');var csv=require(_0xa958('0x8'));var ejs=require(_0xa958('0x9'));var fs=require('fs');var fs_extra=require(_0xa958('0xa'));var _=require(_0xa958('0xb'));var squel=require(_0xa958('0xc'));var crypto=require(_0xa958('0xd'));var jsforce=require(_0xa958('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa958('0xf'));var Papa=require(_0xa958('0x10'));var Redis=require(_0xa958('0x11'));var authService=require(_0xa958('0x12'));var qs=require(_0xa958('0x13'));var as=require(_0xa958('0x14'));var hardwareService=require(_0xa958('0x15'));var logger=require(_0xa958('0x16'))(_0xa958('0x17'));var utils=require(_0xa958('0x18'));var config=require(_0xa958('0x19'));var licenseUtil=require(_0xa958('0x1a'));var db=require(_0xa958('0x1b'))['db'];function respondWithStatusCode(_0x53bf27,_0x5063ae){_0x5063ae=_0x5063ae||0xcc;return function(_0x5bcc66){if(_0x5bcc66){return _0x53bf27[_0xa958('0x1c')](_0x5063ae);}return _0x53bf27[_0xa958('0x1d')](_0x5063ae)[_0xa958('0x1e')]();};}function respondWithResult(_0x591d4d,_0x3ebc66){_0x3ebc66=_0x3ebc66||0xc8;return function(_0x54c439){if(_0x54c439){return _0x591d4d['status'](_0x3ebc66)['json'](_0x54c439);}};}function respondWithFilteredResult(_0x1fe41e,_0x15fca8){return function(_0xb90ac6){if(_0xb90ac6){var _0x6a81c7=typeof _0x15fca8[_0xa958('0x1f')]===_0xa958('0x20')&&typeof _0x15fca8[_0xa958('0x21')]===_0xa958('0x20');var _0x4d836f=_0xb90ac6[_0xa958('0x22')];var _0x4eadc9=_0x6a81c7?0x0:_0x15fca8[_0xa958('0x1f')];var _0x70d13e=_0x6a81c7?_0xb90ac6['count']:_0x15fca8[_0xa958('0x1f')]+_0x15fca8[_0xa958('0x21')];var _0x47636f;if(_0x70d13e>=_0x4d836f){_0x70d13e=_0x4d836f;_0x47636f=0xc8;}else{_0x47636f=0xce;}_0x1fe41e[_0xa958('0x1d')](_0x47636f);return _0x1fe41e[_0xa958('0x23')](_0xa958('0x24'),_0x4eadc9+'-'+_0x70d13e+'/'+_0x4d836f)['json'](_0xb90ac6);}return null;};}function patchUpdates(_0x4a90c2){return function(_0x373661){try{jsonpatch[_0xa958('0x25')](_0x373661,_0x4a90c2,!![]);}catch(_0x16c0be){return BPromise['reject'](_0x16c0be);}return _0x373661[_0xa958('0x26')]();};}function saveUpdates(_0x383aa3,_0x5c091a){return function(_0x28cf12){if(_0x28cf12){return _0x28cf12[_0xa958('0x27')](_0x383aa3)['then'](function(_0x5c5a2b){return _0x5c5a2b;});}return null;};}function removeEntity(_0x201ed3,_0x40b51e){return function(_0x50b3c3){if(_0x50b3c3){return _0x50b3c3[_0xa958('0x28')]()[_0xa958('0x29')](function(){_0x201ed3[_0xa958('0x1d')](0xcc)[_0xa958('0x1e')]();});}};}function handleEntityNotFound(_0x16b04a,_0xf1436e){return function(_0x50fdb1){if(!_0x50fdb1){_0x16b04a[_0xa958('0x1c')](0x194);}return _0x50fdb1;};}function handleError(_0x48ef34,_0x43df63){_0x43df63=_0x43df63||0x1f4;return function(_0x3c2ea3){logger[_0xa958('0x2a')](_0x3c2ea3[_0xa958('0x2b')]);if(_0x3c2ea3[_0xa958('0x2c')]){delete _0x3c2ea3[_0xa958('0x2c')];}_0x48ef34[_0xa958('0x1d')](_0x43df63)[_0xa958('0x2d')](_0x3c2ea3);};}exports[_0xa958('0x2e')]=function(_0x404d07,_0x4c4c37){var _0x47895c={},_0xd2fcc9={},_0x4ef4f6={'count':0x0,'rows':[]};var _0x1febd2=_[_0xa958('0x2f')](db['CmHopperBlack'][_0xa958('0x30')],function(_0x3d4711){return{'name':_0x3d4711[_0xa958('0x31')],'type':_0x3d4711[_0xa958('0x32')][_0xa958('0x33')]};});_0xd2fcc9['model']=_['map'](_0x1febd2,_0xa958('0x2c'));_0xd2fcc9['query']=_['keys'](_0x404d07[_0xa958('0x34')]);_0xd2fcc9[_0xa958('0x35')]=_[_0xa958('0x36')](_0xd2fcc9[_0xa958('0x37')],_0xd2fcc9[_0xa958('0x34')]);_0x47895c[_0xa958('0x38')]=_['intersection'](_0xd2fcc9[_0xa958('0x37')],qs['fields'](_0x404d07['query'][_0xa958('0x39')]));_0x47895c[_0xa958('0x38')]=_0x47895c[_0xa958('0x38')][_0xa958('0x3a')]?_0x47895c[_0xa958('0x38')]:_0xd2fcc9[_0xa958('0x37')];if(!_0x404d07[_0xa958('0x34')][_0xa958('0x3b')]('nolimit')){_0x47895c['limit']=qs[_0xa958('0x21')](_0x404d07[_0xa958('0x34')][_0xa958('0x21')]);_0x47895c[_0xa958('0x1f')]=qs[_0xa958('0x1f')](_0x404d07['query'][_0xa958('0x1f')]);}_0x47895c[_0xa958('0x3c')]=qs[_0xa958('0x3d')](_0x404d07[_0xa958('0x34')]['sort']);_0x47895c[_0xa958('0x3e')]=qs[_0xa958('0x35')](_[_0xa958('0x3f')](_0x404d07[_0xa958('0x34')],_0xd2fcc9[_0xa958('0x35')]),_0x1febd2);if(_0x404d07['query'][_0xa958('0x40')]){_0x47895c[_0xa958('0x3e')]=_[_0xa958('0x41')](_0x47895c[_0xa958('0x3e')],{'$or':_[_0xa958('0x2f')](_0x1febd2,function(_0x45603f){if(_0x45603f[_0xa958('0x32')]!==_0xa958('0x42')){var _0x2378df={};_0x2378df[_0x45603f[_0xa958('0x2c')]]={'$like':'%'+_0x404d07['query'][_0xa958('0x40')]+'%'};return _0x2378df;}})});}_0x47895c=_[_0xa958('0x41')]({},_0x47895c,_0x404d07[_0xa958('0x43')]);var _0x5d5ae1={'where':_0x47895c[_0xa958('0x3e')]};return db[_0xa958('0x44')]['count'](_0x5d5ae1)['then'](function(_0x53710e){_0x4ef4f6['count']=_0x53710e;if(_0x404d07[_0xa958('0x34')]['includeAll']){_0x47895c[_0xa958('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa958('0x46')](_0x47895c);})[_0xa958('0x29')](function(_0x44fa44){_0x4ef4f6[_0xa958('0x47')]=_0x44fa44;return _0x4ef4f6;})[_0xa958('0x29')](respondWithFilteredResult(_0x4c4c37,_0x47895c))[_0xa958('0x48')](handleError(_0x4c4c37,null));};exports[_0xa958('0x49')]=function(_0x18f110,_0x517319){var _0x10e4ee={'raw':!![],'where':{'id':_0x18f110[_0xa958('0x4a')]['id']}},_0x38dfb4={};_0x38dfb4['model']=_['keys'](db['CmHopperBlack'][_0xa958('0x30')]);_0x38dfb4[_0xa958('0x34')]=_[_0xa958('0x4b')](_0x18f110[_0xa958('0x34')]);_0x38dfb4[_0xa958('0x35')]=_['intersection'](_0x38dfb4[_0xa958('0x37')],_0x38dfb4[_0xa958('0x34')]);_0x10e4ee[_0xa958('0x38')]=_[_0xa958('0x36')](_0x38dfb4[_0xa958('0x37')],qs[_0xa958('0x39')](_0x18f110[_0xa958('0x34')][_0xa958('0x39')]));_0x10e4ee[_0xa958('0x38')]=_0x10e4ee[_0xa958('0x38')][_0xa958('0x3a')]?_0x10e4ee[_0xa958('0x38')]:_0x38dfb4[_0xa958('0x37')];if(_0x18f110[_0xa958('0x34')][_0xa958('0x4c')]){_0x10e4ee[_0xa958('0x45')]=[{'all':!![]}];}_0x10e4ee=_[_0xa958('0x41')]({},_0x10e4ee,_0x18f110['options']);return db['CmHopperBlack']['find'](_0x10e4ee)[_0xa958('0x29')](handleEntityNotFound(_0x517319,null))[_0xa958('0x29')](respondWithResult(_0x517319,null))[_0xa958('0x48')](handleError(_0x517319,null));};exports[_0xa958('0x27')]=function(_0x55ab45,_0x34faa2){if(_0x55ab45[_0xa958('0x4d')]['id']){delete _0x55ab45[_0xa958('0x4d')]['id'];}return db[_0xa958('0x44')][_0xa958('0x4e')]({'where':{'id':_0x55ab45['params']['id']}})[_0xa958('0x29')](handleEntityNotFound(_0x34faa2,null))[_0xa958('0x29')](saveUpdates(_0x55ab45[_0xa958('0x4d')],null))['then'](respondWithResult(_0x34faa2,null))[_0xa958('0x48')](handleError(_0x34faa2,null));};exports['destroy']=function(_0xf5ef34,_0x26e79b){return db[_0xa958('0x44')]['find']({'where':{'id':_0xf5ef34[_0xa958('0x4a')]['id']}})['then'](handleEntityNotFound(_0x26e79b,null))[_0xa958('0x29')](removeEntity(_0x26e79b,null))[_0xa958('0x48')](handleError(_0x26e79b,null));};exports[_0xa958('0x4f')]=function(_0x402d0a,_0x472d96){return db['CmHopperBlack'][_0xa958('0x4f')]()['then'](respondWithResult(_0x472d96,null))[_0xa958('0x48')](handleError(_0x472d96,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 7d99b87..c9100dd 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.model.js +++ b/server/api/cmHopperBlack/cmHopperBlack.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32fa=['exports','define','CmHopperBlack','lodash','util','api','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x131ec2,_0xbdc46d){var _0x19ad67=function(_0x53cd00){while(--_0x53cd00){_0x131ec2['push'](_0x131ec2['shift']());}};_0x19ad67(++_0xbdc46d);}(_0x32fa,0x1d1));var _0xa32f=function(_0x354dc8,_0x2ec8b8){_0x354dc8=_0x354dc8-0x0;var _0x116fc1=_0x32fa[_0x354dc8];return _0x116fc1;};'use strict';var _=require(_0xa32f('0x0'));var util=require(_0xa32f('0x1'));var logger=require('../../config/logger')(_0xa32f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa32f('0x3'));var fs=require('fs');var path=require(_0xa32f('0x4'));var rimraf=require(_0xa32f('0x5'));var config=require(_0xa32f('0x6'));var attributes=require(_0xa32f('0x7'));module[_0xa32f('0x8')]=function(_0x3a0f7a,_0x1af9aa){return _0x3a0f7a[_0xa32f('0x9')](_0xa32f('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc2e=['define','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xcc2e,0x1e3));var _0xecc2=function(_0x3d94fd,_0x2e2021){_0x3d94fd=_0x3d94fd-0x0;var _0x337888=_0xcc2e[_0x3d94fd];return _0x337888;};'use strict';var _=require(_0xecc2('0x0'));var util=require(_0xecc2('0x1'));var logger=require(_0xecc2('0x2'))(_0xecc2('0x3'));var moment=require(_0xecc2('0x4'));var BPromise=require(_0xecc2('0x5'));var rp=require(_0xecc2('0x6'));var fs=require('fs');var path=require(_0xecc2('0x7'));var rimraf=require(_0xecc2('0x8'));var config=require(_0xecc2('0x9'));var attributes=require(_0xecc2('0xa'));module['exports']=function(_0x570eae,_0x41a816){return _0x570eae[_0xecc2('0xb')]('CmHopperBlack',attributes,{'tableName':_0xecc2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 76ddaa6..076b1e9 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js +++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2ed=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopperBlack','options','raw','where','attributes','include','model','map','then','catch','UpdateCmHopperBlack','CmHopperBlack','update','body','limit','DestroyCmHopperBlack','destroy','lodash','util','moment'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0xf2ed,0x135));var _0xdf2e=function(_0x37f364,_0x56f6ae){_0x37f364=_0x37f364-0x0;var _0x1a97dd=_0xf2ed[_0x37f364];return _0x1a97dd;};'use strict';var _=require(_0xdf2e('0x0'));var util=require(_0xdf2e('0x1'));var moment=require(_0xdf2e('0x2'));var BPromise=require(_0xdf2e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf2e('0x4'));var db=require(_0xdf2e('0x5'))['db'];var utils=require(_0xdf2e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xdf2e('0x7'));var jayson=require(_0xdf2e('0x8'));var client=jayson[_0xdf2e('0x9')][_0xdf2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1995f6,_0x1b1ccc,_0xc83b95){return new BPromise(function(_0x5f3e98,_0x4bd0ee){return client[_0xdf2e('0xb')](_0x1995f6,_0xc83b95)['then'](function(_0x15f8af){logger[_0xdf2e('0xc')](_0xdf2e('0xd'),_0x1b1ccc,_0xdf2e('0xe'));logger[_0xdf2e('0xf')](_0xdf2e('0x10'),_0x1b1ccc,'request\x20sent',JSON[_0xdf2e('0x11')](_0x15f8af));if(_0x15f8af['error']){if(_0x15f8af[_0xdf2e('0x12')][_0xdf2e('0x13')]===0x1f4){logger[_0xdf2e('0x12')](_0xdf2e('0xd'),_0x1b1ccc,_0x15f8af[_0xdf2e('0x12')]['message']);return _0x4bd0ee(_0x15f8af['error'][_0xdf2e('0x14')]);}logger[_0xdf2e('0x12')](_0xdf2e('0xd'),_0x1b1ccc,_0x15f8af[_0xdf2e('0x12')][_0xdf2e('0x14')]);return _0x5f3e98(_0x15f8af['error'][_0xdf2e('0x14')]);}else{logger[_0xdf2e('0xc')](_0xdf2e('0xd'),_0x1b1ccc,_0xdf2e('0xe'));_0x5f3e98(_0x15f8af[_0xdf2e('0x15')][_0xdf2e('0x14')]);}})['catch'](function(_0xc49d53){logger[_0xdf2e('0x12')](_0xdf2e('0xd'),_0x1b1ccc,_0xc49d53);_0x4bd0ee(_0xc49d53);});});}exports[_0xdf2e('0x16')]=function(_0x401efc){var _0x4ec915=this;return new Promise(function(_0x212af1,_0x43f8ef){return db['CmHopperBlack']['findAll']({'raw':_0x401efc[_0xdf2e('0x17')]?_0x401efc[_0xdf2e('0x17')][_0xdf2e('0x18')]===undefined?!![]:![]:!![],'where':_0x401efc[_0xdf2e('0x17')]?_0x401efc[_0xdf2e('0x17')][_0xdf2e('0x19')]||null:null,'attributes':_0x401efc[_0xdf2e('0x17')]?_0x401efc[_0xdf2e('0x17')][_0xdf2e('0x1a')]||null:null,'limit':_0x401efc[_0xdf2e('0x17')]?_0x401efc[_0xdf2e('0x17')]['limit']||null:null,'include':_0x401efc['options']?_0x401efc[_0xdf2e('0x17')][_0xdf2e('0x1b')]?_['map'](_0x401efc[_0xdf2e('0x17')]['include'],function(_0xee66b){return{'model':db[_0xee66b[_0xdf2e('0x1c')]],'as':_0xee66b['as'],'attributes':_0xee66b[_0xdf2e('0x1a')],'include':_0xee66b[_0xdf2e('0x1b')]?_['map'](_0xee66b['include'],function(_0x2b069d){return{'model':db[_0x2b069d[_0xdf2e('0x1c')]],'as':_0x2b069d['as'],'attributes':_0x2b069d[_0xdf2e('0x1a')],'include':_0x2b069d[_0xdf2e('0x1b')]?_[_0xdf2e('0x1d')](_0x2b069d[_0xdf2e('0x1b')],function(_0xba0e1d){return{'model':db[_0xba0e1d[_0xdf2e('0x1c')]],'as':_0xba0e1d['as'],'attributes':_0xba0e1d[_0xdf2e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xdf2e('0x1e')](function(_0x38faae){logger[_0xdf2e('0xc')](_0xdf2e('0x16'),_0x401efc);logger['debug'](_0xdf2e('0x16'),_0x401efc,JSON[_0xdf2e('0x11')](_0x38faae));_0x212af1(_0x38faae);})[_0xdf2e('0x1f')](function(_0x368c4f){logger[_0xdf2e('0x12')](_0xdf2e('0x16'),_0x368c4f[_0xdf2e('0x14')],_0x401efc);_0x43f8ef(_0x4ec915[_0xdf2e('0x12')](0x1f4,_0x368c4f[_0xdf2e('0x14')]));});});};exports[_0xdf2e('0x20')]=function(_0xc196de){var _0x3e1fe5=this;return new Promise(function(_0x303dd7,_0x30870f){return db[_0xdf2e('0x21')][_0xdf2e('0x22')](_0xc196de[_0xdf2e('0x23')],{'raw':_0xc196de['options']?_0xc196de[_0xdf2e('0x17')][_0xdf2e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc196de[_0xdf2e('0x17')]?_0xc196de[_0xdf2e('0x17')][_0xdf2e('0x19')]||null:null,'attributes':_0xc196de[_0xdf2e('0x17')]?_0xc196de[_0xdf2e('0x17')]['attributes']||null:null,'limit':_0xc196de[_0xdf2e('0x17')]?_0xc196de['options'][_0xdf2e('0x24')]||null:null})['then'](function(_0x294d02){logger[_0xdf2e('0xc')](_0xdf2e('0x20'),_0xc196de);logger[_0xdf2e('0xf')](_0xdf2e('0x20'),_0xc196de,JSON['stringify'](_0x294d02));_0x303dd7(_0x294d02);})[_0xdf2e('0x1f')](function(_0x7ae82a){logger['error']('UpdateCmHopperBlack',_0x7ae82a[_0xdf2e('0x14')],_0xc196de);_0x30870f(_0x3e1fe5[_0xdf2e('0x12')](0x1f4,_0x7ae82a[_0xdf2e('0x14')]));});});};exports[_0xdf2e('0x25')]=function(_0x440e45){var _0x43ef69=this;return new Promise(function(_0x1b3eed,_0x321b9d){return db['CmHopperBlack'][_0xdf2e('0x26')]({'where':_0x440e45['options']?_0x440e45[_0xdf2e('0x17')][_0xdf2e('0x19')]||null:null})[_0xdf2e('0x1e')](function(_0x44c295){logger[_0xdf2e('0xc')](_0xdf2e('0x25'),_0x440e45);logger['debug'](_0xdf2e('0x25'),_0x440e45,JSON['stringify'](_0x44c295));_0x1b3eed(_0x44c295);})['catch'](function(_0x48c171){logger[_0xdf2e('0x12')](_0xdf2e('0x25'),_0x48c171[_0xdf2e('0x14')],_0x440e45);_0x321b9d(_0x43ef69[_0xdf2e('0x12')](0x1f4,_0x48c171[_0xdf2e('0x14')]));});});}; \ No newline at end of file +var _0x993f=['jayson/promise','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','catch','CmHopperBlack','options','where','limit','include','map','model','attributes','GetCmHopperBlack','stringify','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','destroy','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x51847d,_0x3c6e25){var _0x28268b=function(_0x36a1d0){while(--_0x36a1d0){_0x51847d['push'](_0x51847d['shift']());}};_0x28268b(++_0x3c6e25);}(_0x993f,0x1a7));var _0xf993=function(_0x4901b2,_0x3a7ed9){_0x4901b2=_0x4901b2-0x0;var _0x1a00e9=_0x993f[_0x4901b2];return _0x1a00e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf993('0x0'));var BPromise=require(_0xf993('0x1'));var rs=require(_0xf993('0x2'));var fs=require('fs');var Redis=require(_0xf993('0x3'));var db=require(_0xf993('0x4'))['db'];var utils=require(_0xf993('0x5'));var logger=require(_0xf993('0x6'))(_0xf993('0x7'));var config=require(_0xf993('0x8'));var jayson=require(_0xf993('0x9'));var client=jayson['client'][_0xf993('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dd952,_0x4c0392,_0x5d4155){return new BPromise(function(_0x17284b,_0x5573ce){return client['request'](_0x3dd952,_0x5d4155)[_0xf993('0xb')](function(_0x48f929){logger[_0xf993('0xc')](_0xf993('0xd'),_0x4c0392,_0xf993('0xe'));logger[_0xf993('0xf')](_0xf993('0x10'),_0x4c0392,_0xf993('0xe'),JSON['stringify'](_0x48f929));if(_0x48f929[_0xf993('0x11')]){if(_0x48f929[_0xf993('0x11')]['code']===0x1f4){logger[_0xf993('0x11')](_0xf993('0xd'),_0x4c0392,_0x48f929[_0xf993('0x11')][_0xf993('0x12')]);return _0x5573ce(_0x48f929['error'][_0xf993('0x12')]);}logger[_0xf993('0x11')](_0xf993('0xd'),_0x4c0392,_0x48f929['error'][_0xf993('0x12')]);return _0x17284b(_0x48f929[_0xf993('0x11')][_0xf993('0x12')]);}else{logger['info'](_0xf993('0xd'),_0x4c0392,_0xf993('0xe'));_0x17284b(_0x48f929['result'][_0xf993('0x12')]);}})[_0xf993('0x13')](function(_0x428263){logger[_0xf993('0x11')](_0xf993('0xd'),_0x4c0392,_0x428263);_0x5573ce(_0x428263);});});}exports['GetCmHopperBlack']=function(_0x1932dc){var _0x488e7f=this;return new Promise(function(_0x570f48,_0x3c6dea){return db[_0xf993('0x14')]['findAll']({'raw':_0x1932dc[_0xf993('0x15')]?_0x1932dc[_0xf993('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1932dc['options']?_0x1932dc[_0xf993('0x15')][_0xf993('0x16')]||null:null,'attributes':_0x1932dc[_0xf993('0x15')]?_0x1932dc[_0xf993('0x15')]['attributes']||null:null,'limit':_0x1932dc[_0xf993('0x15')]?_0x1932dc['options'][_0xf993('0x17')]||null:null,'include':_0x1932dc[_0xf993('0x15')]?_0x1932dc[_0xf993('0x15')][_0xf993('0x18')]?_[_0xf993('0x19')](_0x1932dc[_0xf993('0x15')]['include'],function(_0x47c1d7){return{'model':db[_0x47c1d7[_0xf993('0x1a')]],'as':_0x47c1d7['as'],'attributes':_0x47c1d7[_0xf993('0x1b')],'include':_0x47c1d7[_0xf993('0x18')]?_[_0xf993('0x19')](_0x47c1d7[_0xf993('0x18')],function(_0x54d62f){return{'model':db[_0x54d62f[_0xf993('0x1a')]],'as':_0x54d62f['as'],'attributes':_0x54d62f[_0xf993('0x1b')],'include':_0x54d62f[_0xf993('0x18')]?_[_0xf993('0x19')](_0x54d62f[_0xf993('0x18')],function(_0x1e201b){return{'model':db[_0x1e201b[_0xf993('0x1a')]],'as':_0x1e201b['as'],'attributes':_0x1e201b[_0xf993('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e04be){logger['info']('GetCmHopperBlack',_0x1932dc);logger[_0xf993('0xf')](_0xf993('0x1c'),_0x1932dc,JSON[_0xf993('0x1d')](_0x4e04be));_0x570f48(_0x4e04be);})[_0xf993('0x13')](function(_0x92466f){logger[_0xf993('0x11')](_0xf993('0x1c'),_0x92466f['message'],_0x1932dc);_0x3c6dea(_0x488e7f[_0xf993('0x11')](0x1f4,_0x92466f[_0xf993('0x12')]));});});};exports[_0xf993('0x1e')]=function(_0x12c2c7){var _0x360830=this;return new Promise(function(_0x564a5d,_0x28cafe){return db[_0xf993('0x14')][_0xf993('0x1f')](_0x12c2c7[_0xf993('0x20')],{'raw':_0x12c2c7['options']?_0x12c2c7[_0xf993('0x15')][_0xf993('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12c2c7['options']?_0x12c2c7[_0xf993('0x15')]['where']||null:null,'attributes':_0x12c2c7['options']?_0x12c2c7[_0xf993('0x15')]['attributes']||null:null,'limit':_0x12c2c7[_0xf993('0x15')]?_0x12c2c7[_0xf993('0x15')][_0xf993('0x17')]||null:null})[_0xf993('0xb')](function(_0x2e0e75){logger[_0xf993('0xc')]('UpdateCmHopperBlack',_0x12c2c7);logger[_0xf993('0xf')]('UpdateCmHopperBlack',_0x12c2c7,JSON[_0xf993('0x1d')](_0x2e0e75));_0x564a5d(_0x2e0e75);})[_0xf993('0x13')](function(_0x3edca3){logger[_0xf993('0x11')](_0xf993('0x1e'),_0x3edca3[_0xf993('0x12')],_0x12c2c7);_0x28cafe(_0x360830['error'](0x1f4,_0x3edca3[_0xf993('0x12')]));});});};exports[_0xf993('0x22')]=function(_0x4b5866){var _0x199928=this;return new Promise(function(_0x7f7d80,_0x49331d){return db[_0xf993('0x14')][_0xf993('0x23')]({'where':_0x4b5866[_0xf993('0x15')]?_0x4b5866['options'][_0xf993('0x16')]||null:null})[_0xf993('0xb')](function(_0x5b3460){logger[_0xf993('0xc')]('DestroyCmHopperBlack',_0x4b5866);logger['debug']('DestroyCmHopperBlack',_0x4b5866,JSON[_0xf993('0x1d')](_0x5b3460));_0x7f7d80(_0x5b3460);})['catch'](function(_0x1d8352){logger[_0xf993('0x11')]('DestroyCmHopperBlack',_0x1d8352['message'],_0x4b5866);_0x49331d(_0x199928[_0xf993('0x11')](0x1f4,_0x1d8352[_0xf993('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 1708864..ea733db 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','show','put','delete','destroy','multer','util'];(function(_0x33e837,_0x2964e2){var _0x25da49=function(_0x308dd7){while(--_0x308dd7){_0x33e837['push'](_0x33e837['shift']());}};_0x25da49(++_0x2964e2);}(_0xf494,0x1c6));var _0x4f49=function(_0x50cce4,_0x3c0fbc){_0x50cce4=_0x50cce4-0x0;var _0x2d72c1=_0xf494[_0x50cce4];return _0x2d72c1;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x11')](_0x4f49('0xe'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7046=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','show','put','/:id','update','delete'];(function(_0x3e28cd,_0x3842b6){var _0x5c4f99=function(_0x21a71d){while(--_0x21a71d){_0x3e28cd['push'](_0x3e28cd['shift']());}};_0x5c4f99(++_0x3842b6);}(_0x7046,0x144));var _0x6704=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7046[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6704('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0xe')](_0x6704('0xf'),auth[_0x6704('0xa')](),controller[_0x6704('0x10')]);router[_0x6704('0x11')](_0x6704('0xf'),auth[_0x6704('0xa')](),controller['destroy']);module[_0x6704('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 8eac88c..7972508 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js +++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9953=['endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x4a7bac,_0x1a8719){var _0x284a73=function(_0x19afeb){while(--_0x19afeb){_0x4a7bac['push'](_0x4a7bac['shift']());}};_0x284a73(++_0x1a8719);}(_0x9953,0xa2));var _0x3995=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x9953[_0xbeb808];return _0x5d6909;};'use strict';var Sequelize=require(_0x3995('0x0'));var moment=require(_0x3995('0x1'));module[_0x3995('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3995('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x3995('0x4')]},'originatecalleridname':{'type':Sequelize[_0x3995('0x4')]},'calleridnum':{'type':Sequelize[_0x3995('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x3995('0x5')]},'responsetime':{'type':Sequelize[_0x3995('0x5')]},'answertime':{'type':Sequelize[_0x3995('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3995('0x4')]},'campaign':{'type':Sequelize[_0x3995('0x4')]},'campaigntype':{'type':Sequelize[_0x3995('0x4')]},'membername':{'type':Sequelize[_0x3995('0x4')]},'reason':{'type':Sequelize[_0x3995('0x4')]},'disposition':{'type':Sequelize[_0x3995('0x4')]},'secondDisposition':{'type':Sequelize[_0x3995('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x3995('0x5')],'set':function(_0xaf412f){var _0x669119=this[_0x3995('0x6')](_0x3995('0x7'));if(_0x669119&&_0xaf412f){this[_0x3995('0x8')](_0x3995('0x9'),moment(_0xaf412f)[_0x3995('0xa')](moment(_0x669119),_0x3995('0xb')));}}},'amd':{'type':Sequelize[_0x3995('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3995('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x3995('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x3995('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3995('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3995('0x5')]},'deleted':{'type':Sequelize[_0x3995('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3995('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3995('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6500=['seconds','BOOLEAN','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','diff'];(function(_0x9d5b2f,_0x3a7784){var _0x5c7e41=function(_0x31e8e0){while(--_0x31e8e0){_0x9d5b2f['push'](_0x9d5b2f['shift']());}};_0x5c7e41(++_0x3a7784);}(_0x6500,0xd1));var _0x0650=function(_0xcff24d,_0x9a1aba){_0xcff24d=_0xcff24d-0x0;var _0x303f5f=_0x6500[_0xcff24d];return _0x303f5f;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x0650('0x0')]={'state':{'type':Sequelize[_0x0650('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x0650('0x2')]},'scheduledat':{'type':Sequelize[_0x0650('0x3')]},'countbusyretry':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x0650('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0650('0x2')]},'calleridname':{'type':Sequelize[_0x0650('0x2')]},'starttime':{'type':Sequelize[_0x0650('0x3')]},'responsetime':{'type':Sequelize[_0x0650('0x3')]},'answertime':{'type':Sequelize[_0x0650('0x3')]},'droptime':{'type':Sequelize[_0x0650('0x3')]},'endtime':{'type':Sequelize[_0x0650('0x3')]},'ringtime':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0650('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x0650('0x2')]},'membername':{'type':Sequelize[_0x0650('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0650('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0650('0x2')]},'dispositionat':{'type':Sequelize[_0x0650('0x3')],'set':function(_0x3f0e95){var _0x4808fd=this[_0x0650('0x4')]('endtime');if(_0x4808fd&&_0x3f0e95){this[_0x0650('0x5')]('followuptime',moment(_0x3f0e95)[_0x0650('0x6')](moment(_0x4808fd),_0x0650('0x7')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0650('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0650('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0650('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x0650('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0650('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0650('0x3')]},'deleted':{'type':Sequelize[_0x0650('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0650('0x3')]},'recallme':{'type':Sequelize[_0x0650('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0650('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 9f47d02..95611d1 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd51=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','rows','show','params','keys','length','catch','describe','body','uniqueid','find','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x208,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','NOW()','scheduledAt'];(function(_0x304490,_0x1cc9a5){var _0x4fe1a6=function(_0xbda4cd){while(--_0xbda4cd){_0x304490['push'](_0x304490['shift']());}};_0x4fe1a6(++_0x1cc9a5);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x29f781,_0x2a8c60){_0x29f781=_0x29f781-0x0;var _0x560235=_0xbd51[_0x29f781];return _0x560235;};'use strict';var emlformat=require(_0x1bd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bd5('0x1'));var jsonpatch=require(_0x1bd5('0x2'));var rp=require(_0x1bd5('0x3'));var moment=require(_0x1bd5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1bd5('0x5'));var csv=require(_0x1bd5('0x6'));var ejs=require(_0x1bd5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bd5('0x8'));var squel=require(_0x1bd5('0x9'));var crypto=require(_0x1bd5('0xa'));var jsforce=require(_0x1bd5('0xb'));var deskjs=require(_0x1bd5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1bd5('0xd'));var Papa=require('papaparse');var Redis=require(_0x1bd5('0xe'));var authService=require(_0x1bd5('0xf'));var qs=require(_0x1bd5('0x10'));var as=require(_0x1bd5('0x11'));var hardwareService=require(_0x1bd5('0x12'));var logger=require(_0x1bd5('0x13'))('api');var utils=require(_0x1bd5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1bd5('0x15'));var db=require(_0x1bd5('0x16'))['db'];function respondWithStatusCode(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xcc;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0x17')](_0x14606b);}return _0x37e8e1[_0x1bd5('0x18')](_0x14606b)['end']();};}function respondWithResult(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0xc8;return function(_0x6d2c40){if(_0x6d2c40){return _0x5650b5[_0x1bd5('0x18')](_0x8b2390)[_0x1bd5('0x19')](_0x6d2c40);}};}function respondWithFilteredResult(_0x48d048,_0x5072c2){return function(_0xa63190){if(_0xa63190){var _0xc7277e=typeof _0x5072c2[_0x1bd5('0x1a')]===_0x1bd5('0x1b')&&typeof _0x5072c2[_0x1bd5('0x1c')]===_0x1bd5('0x1b');var _0x13cf34=_0xa63190[_0x1bd5('0x1d')];var _0x4670b5=_0xc7277e?0x0:_0x5072c2['offset'];var _0x53ad5e=_0xc7277e?_0xa63190[_0x1bd5('0x1d')]:_0x5072c2[_0x1bd5('0x1a')]+_0x5072c2[_0x1bd5('0x1c')];var _0xb95d4e;if(_0x53ad5e>=_0x13cf34){_0x53ad5e=_0x13cf34;_0xb95d4e=0xc8;}else{_0xb95d4e=0xce;}_0x48d048[_0x1bd5('0x18')](_0xb95d4e);return _0x48d048[_0x1bd5('0x1e')](_0x1bd5('0x1f'),_0x4670b5+'-'+_0x53ad5e+'/'+_0x13cf34)[_0x1bd5('0x19')](_0xa63190);}return null;};}function patchUpdates(_0x456051){return function(_0xb1ac1e){try{jsonpatch[_0x1bd5('0x20')](_0xb1ac1e,_0x456051,!![]);}catch(_0x2447c4){return BPromise[_0x1bd5('0x21')](_0x2447c4);}return _0xb1ac1e[_0x1bd5('0x22')]();};}function saveUpdates(_0x253d79,_0x46c580){return function(_0x1f13e7){if(_0x1f13e7){return _0x1f13e7[_0x1bd5('0x23')](_0x253d79)['then'](function(_0x42c43d){return _0x42c43d;});}return null;};}function removeEntity(_0x50c663,_0x18fd18){return function(_0x1e534e){if(_0x1e534e){return _0x1e534e[_0x1bd5('0x24')]()['then'](function(){_0x50c663[_0x1bd5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed551,_0x30676d){return function(_0x3dba4f){if(!_0x3dba4f){_0x2ed551[_0x1bd5('0x17')](0x194);}return _0x3dba4f;};}function handleError(_0x47c84b,_0x202ed3){_0x202ed3=_0x202ed3||0x1f4;return function(_0x69bb17){logger[_0x1bd5('0x25')](_0x69bb17[_0x1bd5('0x26')]);if(_0x69bb17['name']){delete _0x69bb17[_0x1bd5('0x27')];}_0x47c84b[_0x1bd5('0x18')](_0x202ed3)[_0x1bd5('0x28')](_0x69bb17);};}exports[_0x1bd5('0x29')]=function(_0xe54b9f,_0xc73670){var _0x4e72b2={},_0x289097={},_0x472b22={'count':0x0,'rows':[]};var _0x8d53ba=_['map'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')],function(_0x345181){return{'name':_0x345181[_0x1bd5('0x2c')],'type':_0x345181[_0x1bd5('0x2d')][_0x1bd5('0x2e')]};});_0x289097['model']=_['map'](_0x8d53ba,_0x1bd5('0x27'));_0x289097[_0x1bd5('0x2f')]=_['keys'](_0xe54b9f[_0x1bd5('0x2f')]);_0x289097[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],_0x289097['query']);_0x4e72b2[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],qs[_0x1bd5('0x34')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x4e72b2[_0x1bd5('0x33')]=_0x4e72b2[_0x1bd5('0x33')]['length']?_0x4e72b2[_0x1bd5('0x33')]:_0x289097[_0x1bd5('0x32')];if(!_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x35')](_0x1bd5('0x36'))){_0x4e72b2[_0x1bd5('0x1c')]=qs[_0x1bd5('0x1c')](_0xe54b9f['query'][_0x1bd5('0x1c')]);_0x4e72b2[_0x1bd5('0x1a')]=qs[_0x1bd5('0x1a')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x1a')]);}_0x4e72b2[_0x1bd5('0x37')]=qs[_0x1bd5('0x38')](_0xe54b9f['query']['sort']);_0x4e72b2[_0x1bd5('0x39')]=qs[_0x1bd5('0x30')](_[_0x1bd5('0x3a')](_0xe54b9f['query'],_0x289097[_0x1bd5('0x30')]),_0x8d53ba);if(_0xe54b9f['query'][_0x1bd5('0x3b')]){_0x4e72b2[_0x1bd5('0x39')]=_[_0x1bd5('0x3c')](_0x4e72b2[_0x1bd5('0x39')],{'$or':_[_0x1bd5('0x3d')](_0x8d53ba,function(_0x2470ec){if(_0x2470ec[_0x1bd5('0x2d')]!==_0x1bd5('0x3e')){var _0x4bbefc={};_0x4bbefc[_0x2470ec[_0x1bd5('0x27')]]={'$like':'%'+_0xe54b9f[_0x1bd5('0x2f')]['filter']+'%'};return _0x4bbefc;}})});}_0x4e72b2=_[_0x1bd5('0x3c')]({},_0x4e72b2,_0xe54b9f[_0x1bd5('0x3f')]);var _0x20b25c={'where':_0x4e72b2['where']};return db[_0x1bd5('0x2a')][_0x1bd5('0x1d')](_0x20b25c)[_0x1bd5('0x40')](function(_0x4074f1){_0x472b22['count']=_0x4074f1;if(_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x41')]){_0x4e72b2[_0x1bd5('0x42')]=[{'all':!![]}];}return db[_0x1bd5('0x2a')]['findAll'](_0x4e72b2);})['then'](function(_0x40eeff){_0x472b22[_0x1bd5('0x43')]=_0x40eeff;return _0x472b22;})[_0x1bd5('0x40')](respondWithFilteredResult(_0xc73670,_0x4e72b2))['catch'](handleError(_0xc73670,null));};exports[_0x1bd5('0x44')]=function(_0x3b1092,_0x574d95){var _0x1eacac={'raw':!![],'where':{'id':_0x3b1092[_0x1bd5('0x45')]['id']}},_0x5761b8={};_0x5761b8[_0x1bd5('0x32')]=_['keys'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')]);_0x5761b8[_0x1bd5('0x2f')]=_[_0x1bd5('0x46')](_0x3b1092[_0x1bd5('0x2f')]);_0x5761b8[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],_0x5761b8[_0x1bd5('0x2f')]);_0x1eacac[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],qs['fields'](_0x3b1092[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x1eacac[_0x1bd5('0x33')]=_0x1eacac['attributes'][_0x1bd5('0x47')]?_0x1eacac[_0x1bd5('0x33')]:_0x5761b8['model'];if(_0x3b1092[_0x1bd5('0x2f')]['includeAll']){_0x1eacac[_0x1bd5('0x42')]=[{'all':!![]}];}_0x1eacac=_['merge']({},_0x1eacac,_0x3b1092[_0x1bd5('0x3f')]);return db[_0x1bd5('0x2a')]['find'](_0x1eacac)[_0x1bd5('0x40')](handleEntityNotFound(_0x574d95,null))['then'](respondWithResult(_0x574d95,null))[_0x1bd5('0x48')](handleError(_0x574d95,null));};exports[_0x1bd5('0x49')]=function(_0x1a29f3,_0xe71454){return db[_0x1bd5('0x2a')][_0x1bd5('0x49')]()[_0x1bd5('0x40')](respondWithResult(_0xe71454,null))[_0x1bd5('0x48')](handleError(_0xe71454,null));};exports['update']=function(_0x13985e,_0x227a68){if(_0x13985e[_0x1bd5('0x4a')][_0x1bd5('0x4b')]){delete _0x13985e[_0x1bd5('0x4a')][_0x1bd5('0x4b')];}return db['CmHopperFinal'][_0x1bd5('0x4c')]({'where':{'uniqueid':_0x13985e[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x227a68,null))[_0x1bd5('0x40')](saveUpdates(_0x13985e[_0x1bd5('0x4a')],null))[_0x1bd5('0x40')](respondWithResult(_0x227a68,null))[_0x1bd5('0x48')](handleError(_0x227a68,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x587c46,_0x126221,_0x2d713b){return db[_0x1bd5('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x587c46[_0x1bd5('0x45')]['id']},'attributes':[[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x50')))),'noSuchContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')]['literal'](_0x1bd5('0x51')))),'noAnswerContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x52')))),_0x1bd5('0x53')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),_0x1bd5('0x54')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x55')))),_0x1bd5('0x56')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x57')))),_0x1bd5('0x58')],[db['sequelize']['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x59')))),'reCallContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x5a')))),_0x1bd5('0x5b')]]})[_0x1bd5('0x40')](handleEntityNotFound(_0x126221,null))['then'](respondWithResult(_0x126221,null))['catch'](handleError(_0x126221,null));};exports[_0x1bd5('0x5c')]=function(_0xec9fac,_0x1790af,_0x54a8c4){return db['CmHopperFinal'][_0x1bd5('0x5d')]({'raw':![],'where':{'CampaignId':_0xec9fac['params']['id']},'attributes':[[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')]['literal'](_0x1bd5('0x50')))),'noSuchContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x5e')))),'congestionContacts'],[db['sequelize']['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x55')))),'dropContacts'],[db[_0x1bd5('0x4d')]['fn']('COUNT',db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x57')))),'abandonedContacts'],[db['sequelize']['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x59')))),_0x1bd5('0x5f')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x5a')))),_0x1bd5('0x5b')]]})[_0x1bd5('0x40')](handleEntityNotFound(_0x1790af,null))[_0x1bd5('0x40')](respondWithResult(_0x1790af,null))[_0x1bd5('0x48')](handleError(_0x1790af,null));};exports[_0x1bd5('0x60')]=function(_0x195176,_0x393a8f,_0x1ffbab){return db[_0x1bd5('0x61')][_0x1bd5('0x4c')]({'where':{'id':_0x195176[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x393a8f,null))['then'](function(_0x3bd058){var _0x1d6223;if(_0x3bd058){_0x1d6223=squel[_0x1bd5('0x62')]()[_0x1bd5('0x63')](_0x1bd5('0x64'))[_0x1bd5('0x65')]([_0x1bd5('0x66'),'scheduledAt',_0x1bd5('0x67'),_0x1bd5('0x68'),_0x1bd5('0x69'),_0x1bd5('0x6a'),'updatedAt'],squel[_0x1bd5('0x6b')]()[_0x1bd5('0x6c')](_0x1bd5('0x6d'),_0x1bd5('0x66'))[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x6f'))['field'](_0x1bd5('0x70'),'ContactId')['field'](_0x1bd5('0x71'),'ListId')[_0x1bd5('0x6c')](_0x1bd5('0x72'),'VoiceQueueId')[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x6a'))[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x73'))['from'](_0x1bd5('0x74'))[_0x1bd5('0x39')](_0x1bd5('0x75'),_0x195176[_0x1bd5('0x45')]['id']['toString']())['where'](_0x1bd5('0x76'),_0x195176[_0x1bd5('0x4a')][_0x1bd5('0x77')][_0x1bd5('0x78')]())['where'](_0x1bd5('0x79'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1bd5('0x6b')]()['field'](_0x1bd5('0x66'))[_0x1bd5('0x7a')](_0x1bd5('0x64'))[_0x1bd5('0x39')](_0x1bd5('0x75'),_0x195176[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]()))[_0x1bd5('0x39')](_0x1bd5('0x7b'),squel['select']()[_0x1bd5('0x6c')]('calleridnum')['from']('cm_hopper_final')[_0x1bd5('0x39')]('VoiceQueueId\x20=\x20?',_0x195176[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]())[_0x1bd5('0x39')](_0x1bd5('0x7c')))[_0x1bd5('0x7d')](_0x1bd5('0x67')))[_0x1bd5('0x78')]();return db['sequelize'][_0x1bd5('0x2f')](_0x1d6223);}return[];})['then'](respondWithResult(_0x393a8f,null))[_0x1bd5('0x48')](handleError(_0x393a8f,null));};exports[_0x1bd5('0x7e')]=function(_0x7d097,_0x50f2ac,_0x5db61c){return db[_0x1bd5('0x7f')]['find']({'where':{'id':_0x7d097[_0x1bd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x50f2ac,null))[_0x1bd5('0x40')](function(_0x16f996){var _0x248d66;if(_0x16f996){_0x248d66=squel[_0x1bd5('0x62')]()[_0x1bd5('0x63')](_0x1bd5('0x64'))[_0x1bd5('0x65')]([_0x1bd5('0x66'),_0x1bd5('0x6f'),_0x1bd5('0x67'),_0x1bd5('0x68'),_0x1bd5('0x80'),_0x1bd5('0x6a'),_0x1bd5('0x73')],squel['select']()[_0x1bd5('0x6c')](_0x1bd5('0x6d'),_0x1bd5('0x66'))['field'](_0x1bd5('0x6e'),_0x1bd5('0x6f'))['field'](_0x1bd5('0x70'),_0x1bd5('0x67'))[_0x1bd5('0x6c')]('ANY_VALUE(ListId)',_0x1bd5('0x68'))[_0x1bd5('0x6c')](_0x1bd5('0x81'),_0x1bd5('0x80'))['field'](_0x1bd5('0x6e'),_0x1bd5('0x6a'))[_0x1bd5('0x6c')]('NOW()',_0x1bd5('0x73'))[_0x1bd5('0x7a')]('cm_hopper_final')['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id']['toString']())['where'](_0x1bd5('0x76'),_0x7d097['body']['state'][_0x1bd5('0x78')]())['where'](_0x1bd5('0x79'))[_0x1bd5('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1bd5('0x6b')]()[_0x1bd5('0x6c')](_0x1bd5('0x66'))['from'](_0x1bd5('0x64'))['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]()))[_0x1bd5('0x39')](_0x1bd5('0x7b'),squel['select']()[_0x1bd5('0x6c')]('calleridnum')[_0x1bd5('0x7a')]('cm_hopper_final')['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]())[_0x1bd5('0x39')]('state\x20=\x204'))[_0x1bd5('0x7d')](_0x1bd5('0x67')))[_0x1bd5('0x78')]();return db[_0x1bd5('0x4d')][_0x1bd5('0x2f')](_0x248d66);}return[];})[_0x1bd5('0x40')](respondWithResult(_0x50f2ac,null))[_0x1bd5('0x48')](handleError(_0x50f2ac,null));};exports[_0x1bd5('0x83')]=function(_0x22e1f4,_0x347d06,_0x3cf023){return db[_0x1bd5('0x84')][_0x1bd5('0x85')]({'where':{'VoiceQueueId':_0x22e1f4[_0x1bd5('0x4a')]['VoiceQueueId'],'CampaignId':_0x22e1f4[_0x1bd5('0x4a')][_0x1bd5('0x80')],'ContactId':_0x22e1f4[_0x1bd5('0x4a')][_0x1bd5('0x67')]}})[_0x1bd5('0x40')](handleEntityNotFound(_0x347d06,null))[_0x1bd5('0x40')](function(_0x28f567){if(_0x28f567){return _0x28f567;}return null;})[_0x1bd5('0x40')](respondWithResult(_0x347d06,null))[_0x1bd5('0x48')](handleError(_0x347d06,null));}; \ No newline at end of file +var _0xfdbd=['status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','length','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','params','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','checkContactHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5dee43,_0x35aa9b){var _0x3bcfb0=function(_0x22dad2){while(--_0x22dad2){_0x5dee43['push'](_0x5dee43['shift']());}};_0x3bcfb0(++_0x35aa9b);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x18baf4,_0x33086b){_0x18baf4=_0x18baf4-0x0;var _0x278ed1=_0xfdbd[_0x18baf4];return _0x278ed1;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':!![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['CmHopperFinal']['describe']()[_0xdfdb('0x26')](respondWithResult(_0x273477,null))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports[_0xdfdb('0x24')]=function(_0x4bbb88,_0x36149e){if(_0x4bbb88[_0xdfdb('0x4b')][_0xdfdb('0x4c')]){delete _0x4bbb88[_0xdfdb('0x4b')]['uniqueid'];}return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'uniqueid':_0x4bbb88['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x36149e,null))[_0xdfdb('0x26')](saveUpdates(_0x4bbb88[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x36149e,null))[_0xdfdb('0x49')](handleError(_0x36149e,null));};exports[_0xdfdb('0x4d')]=function(_0x17dfdb,_0x1f5b88,_0x1da7af){return db['CmHopperFinal'][_0xdfdb('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x17dfdb['params']['id']},'attributes':[[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x53')))),'noAnswerContacts'],[db[_0xdfdb('0x4e')]['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x54')))),_0xdfdb('0x55')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x56')))),_0xdfdb('0x57')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x58')))),_0xdfdb('0x59')],[db['sequelize']['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5b')))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')]['literal'](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x1f5b88,null))['then'](respondWithResult(_0x1f5b88,null))[_0xdfdb('0x49')](handleError(_0x1f5b88,null));};exports[_0xdfdb('0x5f')]=function(_0x349cf7,_0x2f69a8,_0x424212){return db[_0xdfdb('0x2d')][_0xdfdb('0x44')]({'raw':![],'where':{'CampaignId':_0x349cf7[_0xdfdb('0x60')]['id']},'attributes':[[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x203,\x201,\x20null'))),_0xdfdb('0x61')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x54')))),'busyContacts'],[db['sequelize']['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xdfdb('0x57')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xdfdb('0x59')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x2f69a8,null))[_0xdfdb('0x26')](respondWithResult(_0x2f69a8,null))['catch'](handleError(_0x2f69a8,null));};exports[_0xdfdb('0x62')]=function(_0x198cfa,_0x2831d6,_0x45bfc0){return db[_0xdfdb('0x63')]['find']({'where':{'id':_0x198cfa[_0xdfdb('0x60')]['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x2831d6,null))[_0xdfdb('0x26')](function(_0x1a31b9){var _0x4999c4;if(_0x1a31b9){_0x4999c4=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')](_0xdfdb('0x66'))[_0xdfdb('0x67')]([_0xdfdb('0x68'),_0xdfdb('0x69'),_0xdfdb('0x6a'),_0xdfdb('0x6b'),_0xdfdb('0x6c'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel['select']()[_0xdfdb('0x6f')](_0xdfdb('0x70'),'phone')[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)','ContactId')[_0xdfdb('0x6f')](_0xdfdb('0x72'),_0xdfdb('0x6b'))[_0xdfdb('0x6f')](_0xdfdb('0x73'),_0xdfdb('0x6c'))[_0xdfdb('0x6f')]('NOW()',_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')]('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id'][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x77'),_0x198cfa[_0xdfdb('0x4b')]['state'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')]('phone')[_0xdfdb('0x74')](_0xdfdb('0x66'))['where']('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id']['toString']()))['where'](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x7c'),_0x198cfa['params']['id'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x7d')))[_0xdfdb('0x7e')](_0xdfdb('0x6a')))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x4999c4);}return[];})[_0xdfdb('0x26')](respondWithResult(_0x2831d6,null))[_0xdfdb('0x49')](handleError(_0x2831d6,null));};exports[_0xdfdb('0x7f')]=function(_0x1b6445,_0x36241c,_0x4c833f){return db['Campaign'][_0xdfdb('0x48')]({'where':{'id':_0x1b6445[_0xdfdb('0x60')]['id']}})['then'](handleEntityNotFound(_0x36241c,null))[_0xdfdb('0x26')](function(_0x50d5d4){var _0x158454;if(_0x50d5d4){_0x158454=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')]('cm_hopper')[_0xdfdb('0x67')](['phone','scheduledAt',_0xdfdb('0x6a'),'ListId',_0xdfdb('0x80'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x70'),_0xdfdb('0x68'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)',_0xdfdb('0x6a'))['field']('ANY_VALUE(ListId)','ListId')['field'](_0xdfdb('0x81'),_0xdfdb('0x80'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x77'),_0x1b6445[_0xdfdb('0x4b')][_0xdfdb('0x83')][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()['field'](_0xdfdb('0x68'))[_0xdfdb('0x74')](_0xdfdb('0x66'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']()))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')]('cm_hopper_final')[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x7d')))['group']('ContactId'))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x158454);}return[];})['then'](respondWithResult(_0x36241c,null))[_0xdfdb('0x49')](handleError(_0x36241c,null));};exports[_0xdfdb('0x84')]=function(_0x1f87d3,_0x1bc293,_0x36b01e){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x1f87d3[_0xdfdb('0x4b')]['VoiceQueueId'],'CampaignId':_0x1f87d3[_0xdfdb('0x4b')][_0xdfdb('0x80')],'ContactId':_0x1f87d3[_0xdfdb('0x4b')]['ContactId']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x1bc293,null))[_0xdfdb('0x26')](function(_0x3e0208){if(_0x3e0208){return _0x3e0208;}return null;})[_0xdfdb('0x26')](respondWithResult(_0x1bc293,null))['catch'](handleError(_0x1bc293,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index bccbd58..2faa1e6 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.model.js +++ b/server/api/cmHopperFinal/cmHopperFinal.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf89c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','util'];(function(_0x1b2bd8,_0x3b59e3){var _0x1a977d=function(_0x34b22){while(--_0x34b22){_0x1b2bd8['push'](_0x1b2bd8['shift']());}};_0x1a977d(++_0x3b59e3);}(_0xf89c,0x1db));var _0xcf89=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf89c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xcf89('0x0'));var logger=require(_0xcf89('0x1'))(_0xcf89('0x2'));var moment=require(_0xcf89('0x3'));var BPromise=require(_0xcf89('0x4'));var rp=require(_0xcf89('0x5'));var fs=require('fs');var path=require(_0xcf89('0x6'));var rimraf=require(_0xcf89('0x7'));var config=require('../../config/environment');var attributes=require(_0xcf89('0x8'));module[_0xcf89('0x9')]=function(_0x1742b0,_0x2f99d8){return _0x1742b0[_0xcf89('0xa')](_0xcf89('0xb'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xcf89('0xc')]},{'name':_0xcf89('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xefa5=['util','../../config/logger','moment','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define','calleridnum','uniqueid','lodash'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0xefa5,0x1df));var _0x5efa=function(_0x270ed1,_0x471778){_0x270ed1=_0x270ed1-0x0;var _0x26d741=_0xefa5[_0x270ed1];return _0x26d741;};'use strict';var _=require(_0x5efa('0x0'));var util=require(_0x5efa('0x1'));var logger=require(_0x5efa('0x2'))('api');var moment=require(_0x5efa('0x3'));var BPromise=require('bluebird');var rp=require(_0x5efa('0x4'));var fs=require('fs');var path=require(_0x5efa('0x5'));var rimraf=require(_0x5efa('0x6'));var config=require('../../config/environment');var attributes=require(_0x5efa('0x7'));module[_0x5efa('0x8')]=function(_0x4d7945,_0x28bc35){return _0x4d7945[_0x5efa('0x9')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x5efa('0xa')]},{'name':'uniqueid','fields':[_0x5efa('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 5b43b0e..8e27e05 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xa79fe5,_0x4e73e4){var _0x4d378a=function(_0x3552c7){while(--_0x3552c7){_0xa79fe5['push'](_0xa79fe5['shift']());}};_0x4d378a(++_0x4e73e4);}(_0x7a54,0x106));var _0x47a5=function(_0x79ef06,_0x59fda9){_0x79ef06=_0x79ef06-0x0;var _0x11bf07=_0x7a54[_0x79ef06];return _0x11bf07;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x195cb0,_0x1a3ede){var _0x1eb232=function(_0x257360){while(--_0x257360){_0x195cb0['push'](_0x195cb0['shift']());}};_0x1eb232(++_0x1a3ede);}(_0xb10b,0x12a));var _0xbb10=function(_0xe506a9,_0x3105d4){_0xe506a9=_0xe506a9-0x0;var _0x12ca6f=_0xb10b[_0xe506a9];return _0x12ca6f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 25fab78..cd015f6 100644 --- a/server/api/cmHopperFinal/index.js +++ b/server/api/cmHopperFinal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa620=['/checkContactHopper','put','update','exports','util','path','connect-timeout','express','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','get','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa620,0x138));var _0x0a62=function(_0x280a2e,_0x244c6f){_0x280a2e=_0x280a2e-0x0;var _0x286f67=_0xa620[_0x280a2e];return _0x286f67;};'use strict';var multer=require('multer');var util=require(_0x0a62('0x0'));var path=require(_0x0a62('0x1'));var timeout=require(_0x0a62('0x2'));var express=require(_0x0a62('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0a62('0x4'));var config=require('../../config/environment');var controller=require(_0x0a62('0x5'));router['get']('/',auth[_0x0a62('0x6')](),controller['index']);router[_0x0a62('0x7')](_0x0a62('0x8'),auth['isAuthenticated'](),controller[_0x0a62('0x9')]);router[_0x0a62('0x7')](_0x0a62('0xa'),auth[_0x0a62('0x6')](),controller['show']);router[_0x0a62('0x7')](_0x0a62('0xb'),auth['isAuthenticated'](),controller[_0x0a62('0xc')]);router[_0x0a62('0x7')](_0x0a62('0xd'),auth[_0x0a62('0x6')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x0a62('0xe')](_0x0a62('0xf'),auth['isAuthenticated'](),controller[_0x0a62('0x10')]);router['post'](_0x0a62('0x11'),auth[_0x0a62('0x6')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x0a62('0xe')](_0x0a62('0x12'),auth[_0x0a62('0x6')](),controller['checkContactHopper']);router[_0x0a62('0x13')](_0x0a62('0xa'),auth[_0x0a62('0x6')](),controller[_0x0a62('0x14')]);module[_0x0a62('0x15')]=router; \ No newline at end of file +var _0x383b=['/:id','update','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put'];(function(_0x5b3219,_0x4f5f74){var _0x575525=function(_0x447cf6){while(--_0x447cf6){_0x5b3219['push'](_0x5b3219['shift']());}};_0x575525(++_0x4f5f74);}(_0x383b,0x89));var _0xb383=function(_0x4ab42f,_0x437617){_0x4ab42f=_0x4ab42f-0x0;var _0xbdf43=_0x383b[_0x4ab42f];return _0xbdf43;};'use strict';var multer=require(_0xb383('0x0'));var util=require('util');var path=require(_0xb383('0x1'));var timeout=require(_0xb383('0x2'));var express=require(_0xb383('0x3'));var router=express['Router']();var fs_extra=require(_0xb383('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb383('0x5'));var config=require(_0xb383('0x6'));var controller=require(_0xb383('0x7'));router[_0xb383('0x8')]('/',auth[_0xb383('0x9')](),controller[_0xb383('0xa')]);router['get'](_0xb383('0xb'),auth[_0xb383('0x9')](),controller[_0xb383('0xc')]);router['get']('/:id',auth[_0xb383('0x9')](),controller[_0xb383('0xd')]);router[_0xb383('0x8')](_0xb383('0xe'),auth['isAuthenticated'](),controller[_0xb383('0xf')]);router[_0xb383('0x8')](_0xb383('0x10'),auth[_0xb383('0x9')](),controller[_0xb383('0x11')]);router['post'](_0xb383('0x12'),auth[_0xb383('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xb383('0x13')](_0xb383('0x14'),auth[_0xb383('0x9')](),controller[_0xb383('0x15')]);router[_0xb383('0x13')](_0xb383('0x16'),auth[_0xb383('0x9')](),controller[_0xb383('0x17')]);router[_0xb383('0x18')](_0xb383('0x19'),auth[_0xb383('0x9')](),controller[_0xb383('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 51fc2a3..00cb4ca 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js +++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e1d=['STRING','DATE','INTEGER','BOOLEAN','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e1d,0x13a));var _0xd3e1=function(_0x2df13f,_0x3a3921){_0x2df13f=_0x2df13f-0x0;var _0x5c8a3f=_0x3e1d[_0x2df13f];return _0x5c8a3f;};'use strict';var Sequelize=require('sequelize');module[_0xd3e1('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd3e1('0x1')]},'scheduledat':{'type':Sequelize[_0xd3e1('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd3e1('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd3e1('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd3e1('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xd3e1('0x1')]},'originatecalleridname':{'type':Sequelize[_0xd3e1('0x1')]},'calleridnum':{'type':Sequelize[_0xd3e1('0x1')]},'calleridname':{'type':Sequelize[_0xd3e1('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xd3e1('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xd3e1('0x2')]},'endtime':{'type':Sequelize[_0xd3e1('0x2')]},'ringtime':{'type':Sequelize[_0xd3e1('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd3e1('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd3e1('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd3e1('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd3e1('0x1')]},'campaign':{'type':Sequelize[_0xd3e1('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd3e1('0x1')]},'reason':{'type':Sequelize[_0xd3e1('0x1')]},'amd':{'type':Sequelize[_0xd3e1('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd3e1('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xd3e1('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd3e1('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xd3e1('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd3e1('0x2')]},'edited':{'type':Sequelize[_0xd3e1('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xd3e1('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd3e1('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd3e1('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd3e1('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd3e1('0x1')]}}; \ No newline at end of file +var _0xb8de=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x40b74d,_0xd77223){var _0x2a1b96=function(_0x5a73fe){while(--_0x5a73fe){_0x40b74d['push'](_0x40b74d['shift']());}};_0x2a1b96(++_0xd77223);}(_0xb8de,0x152));var _0xeb8d=function(_0x1746f9,_0x408d55){_0x1746f9=_0x1746f9-0x0;var _0x5ef847=_0xb8de[_0x1746f9];return _0x5ef847;};'use strict';var Sequelize=require(_0xeb8d('0x0'));module[_0xeb8d('0x1')]={'state':{'type':Sequelize[_0xeb8d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xeb8d('0x3')]},'scheduledat':{'type':Sequelize[_0xeb8d('0x4')]},'countbusyretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xeb8d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xeb8d('0x3')]},'originatecalleridname':{'type':Sequelize[_0xeb8d('0x3')]},'calleridnum':{'type':Sequelize[_0xeb8d('0x3')]},'calleridname':{'type':Sequelize[_0xeb8d('0x3')]},'starttime':{'type':Sequelize[_0xeb8d('0x4')]},'responsetime':{'type':Sequelize[_0xeb8d('0x4')]},'answertime':{'type':Sequelize[_0xeb8d('0x4')]},'droptime':{'type':Sequelize[_0xeb8d('0x4')]},'endtime':{'type':Sequelize[_0xeb8d('0x4')]},'ringtime':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xeb8d('0x3')]},'campaign':{'type':Sequelize[_0xeb8d('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xeb8d('0x3')]},'amd':{'type':Sequelize[_0xeb8d('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xeb8d('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xeb8d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xeb8d('0x4')]},'recallme':{'type':Sequelize[_0xeb8d('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xeb8d('0x4')]},'edited':{'type':Sequelize[_0xeb8d('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index ad64581..05f623b 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.controller.js +++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f81=['reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','CmHopperHistory','includeAll','include','rows','catch','show','params','keys','length','find','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','undefined','limit','offset','count','status','set','Content-Range','json','apply'];(function(_0x26a060,_0x4d7d50){var _0x4f43b1=function(_0x148dc7){while(--_0x148dc7){_0x26a060['push'](_0x26a060['shift']());}};_0x4f43b1(++_0x4d7d50);}(_0x3f81,0x1a7));var _0x13f8=function(_0x2a4935,_0x4be768){_0x2a4935=_0x2a4935-0x0;var _0x144798=_0x3f81[_0x2a4935];return _0x144798;};'use strict';var emlformat=require(_0x13f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x13f8('0x1'));var jsonpatch=require(_0x13f8('0x2'));var rp=require(_0x13f8('0x3'));var moment=require('moment');var BPromise=require(_0x13f8('0x4'));var Mustache=require('mustache');var util=require(_0x13f8('0x5'));var path=require(_0x13f8('0x6'));var sox=require(_0x13f8('0x7'));var csv=require(_0x13f8('0x8'));var ejs=require(_0x13f8('0x9'));var fs=require('fs');var fs_extra=require(_0x13f8('0xa'));var _=require('lodash');var squel=require(_0x13f8('0xb'));var crypto=require(_0x13f8('0xc'));var jsforce=require(_0x13f8('0xd'));var deskjs=require(_0x13f8('0xe'));var toCsv=require(_0x13f8('0x8'));var querystring=require(_0x13f8('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x13f8('0x10'));var as=require(_0x13f8('0x11'));var hardwareService=require(_0x13f8('0x12'));var logger=require(_0x13f8('0x13'))('api');var utils=require(_0x13f8('0x14'));var config=require(_0x13f8('0x15'));var licenseUtil=require(_0x13f8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1872e7,_0xb941f4){_0xb941f4=_0xb941f4||0xcc;return function(_0x453153){if(_0x453153){return _0x1872e7['sendStatus'](_0xb941f4);}return _0x1872e7['status'](_0xb941f4)[_0x13f8('0x17')]();};}function respondWithResult(_0x3295fe,_0x67cb87){_0x67cb87=_0x67cb87||0xc8;return function(_0x3875fd){if(_0x3875fd){return _0x3295fe['status'](_0x67cb87)['json'](_0x3875fd);}};}function respondWithFilteredResult(_0x971eb1,_0x3cc6c0){return function(_0x4a9659){if(_0x4a9659){var _0x561f82=typeof _0x3cc6c0['offset']===_0x13f8('0x18')&&typeof _0x3cc6c0[_0x13f8('0x19')]===_0x13f8('0x18');var _0x5a99cd=_0x4a9659['count'];var _0x378d92=_0x561f82?0x0:_0x3cc6c0[_0x13f8('0x1a')];var _0x53e069=_0x561f82?_0x4a9659[_0x13f8('0x1b')]:_0x3cc6c0[_0x13f8('0x1a')]+_0x3cc6c0[_0x13f8('0x19')];var _0xf7ad6e;if(_0x53e069>=_0x5a99cd){_0x53e069=_0x5a99cd;_0xf7ad6e=0xc8;}else{_0xf7ad6e=0xce;}_0x971eb1[_0x13f8('0x1c')](_0xf7ad6e);return _0x971eb1[_0x13f8('0x1d')](_0x13f8('0x1e'),_0x378d92+'-'+_0x53e069+'/'+_0x5a99cd)[_0x13f8('0x1f')](_0x4a9659);}return null;};}function patchUpdates(_0x4c1540){return function(_0x39fead){try{jsonpatch[_0x13f8('0x20')](_0x39fead,_0x4c1540,!![]);}catch(_0x1c659d){return BPromise[_0x13f8('0x21')](_0x1c659d);}return _0x39fead['save']();};}function saveUpdates(_0x5715ee,_0x2d3b4a){return function(_0x3813fd){if(_0x3813fd){return _0x3813fd[_0x13f8('0x22')](_0x5715ee)[_0x13f8('0x23')](function(_0x4031b8){return _0x4031b8;});}return null;};}function removeEntity(_0x10424c,_0x259ce9){return function(_0x574a3e){if(_0x574a3e){return _0x574a3e[_0x13f8('0x24')]()[_0x13f8('0x23')](function(){_0x10424c[_0x13f8('0x1c')](0xcc)[_0x13f8('0x17')]();});}};}function handleEntityNotFound(_0x55c737,_0x28602f){return function(_0x1fa560){if(!_0x1fa560){_0x55c737['sendStatus'](0x194);}return _0x1fa560;};}function handleError(_0x3b7b2b,_0x3bb286){_0x3bb286=_0x3bb286||0x1f4;return function(_0x2b9685){logger[_0x13f8('0x25')](_0x2b9685[_0x13f8('0x26')]);if(_0x2b9685['name']){delete _0x2b9685[_0x13f8('0x27')];}_0x3b7b2b['status'](_0x3bb286)[_0x13f8('0x28')](_0x2b9685);};}exports[_0x13f8('0x29')]=function(_0x4f4972,_0x390c5b){var _0x3194eb={},_0x175ea9={},_0x3218bc={'count':0x0,'rows':[]};var _0x16e0cd=_[_0x13f8('0x2a')](db['CmHopperHistory'][_0x13f8('0x2b')],function(_0x2496f3){return{'name':_0x2496f3['fieldName'],'type':_0x2496f3['type'][_0x13f8('0x2c')]};});_0x175ea9['model']=_[_0x13f8('0x2a')](_0x16e0cd,_0x13f8('0x27'));_0x175ea9[_0x13f8('0x2d')]=_['keys'](_0x4f4972['query']);_0x175ea9[_0x13f8('0x2e')]=_[_0x13f8('0x2f')](_0x175ea9[_0x13f8('0x30')],_0x175ea9[_0x13f8('0x2d')]);_0x3194eb['attributes']=_[_0x13f8('0x2f')](_0x175ea9[_0x13f8('0x30')],qs[_0x13f8('0x31')](_0x4f4972['query']['fields']));_0x3194eb[_0x13f8('0x32')]=_0x3194eb[_0x13f8('0x32')]['length']?_0x3194eb[_0x13f8('0x32')]:_0x175ea9[_0x13f8('0x30')];if(!_0x4f4972['query'][_0x13f8('0x33')](_0x13f8('0x34'))){_0x3194eb[_0x13f8('0x19')]=qs[_0x13f8('0x19')](_0x4f4972[_0x13f8('0x2d')][_0x13f8('0x19')]);_0x3194eb[_0x13f8('0x1a')]=qs[_0x13f8('0x1a')](_0x4f4972[_0x13f8('0x2d')][_0x13f8('0x1a')]);}_0x3194eb[_0x13f8('0x35')]=qs[_0x13f8('0x36')](_0x4f4972[_0x13f8('0x2d')][_0x13f8('0x36')]);_0x3194eb['where']=qs[_0x13f8('0x2e')](_[_0x13f8('0x37')](_0x4f4972[_0x13f8('0x2d')],_0x175ea9['filters']),_0x16e0cd);if(_0x4f4972[_0x13f8('0x2d')][_0x13f8('0x38')]){_0x3194eb['where']=_[_0x13f8('0x39')](_0x3194eb['where'],{'$or':_['map'](_0x16e0cd,function(_0x7d0a3d){if(_0x7d0a3d[_0x13f8('0x3a')]!==_0x13f8('0x3b')){var _0x5e6a57={};_0x5e6a57[_0x7d0a3d[_0x13f8('0x27')]]={'$like':'%'+_0x4f4972[_0x13f8('0x2d')][_0x13f8('0x38')]+'%'};return _0x5e6a57;}})});}_0x3194eb=_[_0x13f8('0x39')]({},_0x3194eb,_0x4f4972[_0x13f8('0x3c')]);var _0x4418a3={'where':_0x3194eb[_0x13f8('0x3d')]};return db[_0x13f8('0x3e')][_0x13f8('0x1b')](_0x4418a3)[_0x13f8('0x23')](function(_0x237fee){_0x3218bc[_0x13f8('0x1b')]=_0x237fee;if(_0x4f4972[_0x13f8('0x2d')][_0x13f8('0x3f')]){_0x3194eb[_0x13f8('0x40')]=[{'all':!![]}];}return db[_0x13f8('0x3e')]['findAll'](_0x3194eb);})[_0x13f8('0x23')](function(_0xda7c76){_0x3218bc[_0x13f8('0x41')]=_0xda7c76;return _0x3218bc;})['then'](respondWithFilteredResult(_0x390c5b,_0x3194eb))[_0x13f8('0x42')](handleError(_0x390c5b,null));};exports[_0x13f8('0x43')]=function(_0x5b4624,_0x20b431){var _0xf3427={'raw':!![],'where':{'id':_0x5b4624[_0x13f8('0x44')]['id']}},_0x3bbfaf={};_0x3bbfaf[_0x13f8('0x30')]=_[_0x13f8('0x45')](db['CmHopperHistory'][_0x13f8('0x2b')]);_0x3bbfaf[_0x13f8('0x2d')]=_[_0x13f8('0x45')](_0x5b4624[_0x13f8('0x2d')]);_0x3bbfaf[_0x13f8('0x2e')]=_[_0x13f8('0x2f')](_0x3bbfaf['model'],_0x3bbfaf[_0x13f8('0x2d')]);_0xf3427[_0x13f8('0x32')]=_[_0x13f8('0x2f')](_0x3bbfaf[_0x13f8('0x30')],qs[_0x13f8('0x31')](_0x5b4624[_0x13f8('0x2d')][_0x13f8('0x31')]));_0xf3427[_0x13f8('0x32')]=_0xf3427[_0x13f8('0x32')][_0x13f8('0x46')]?_0xf3427[_0x13f8('0x32')]:_0x3bbfaf[_0x13f8('0x30')];if(_0x5b4624[_0x13f8('0x2d')][_0x13f8('0x3f')]){_0xf3427[_0x13f8('0x40')]=[{'all':!![]}];}_0xf3427=_[_0x13f8('0x39')]({},_0xf3427,_0x5b4624['options']);return db['CmHopperHistory'][_0x13f8('0x47')](_0xf3427)[_0x13f8('0x23')](handleEntityNotFound(_0x20b431,null))['then'](respondWithResult(_0x20b431,null))[_0x13f8('0x42')](handleError(_0x20b431,null));};exports['create']=function(_0x4cefa1,_0x5d1449){return db[_0x13f8('0x3e')][_0x13f8('0x48')](_0x4cefa1[_0x13f8('0x49')],{})['then'](respondWithResult(_0x5d1449,0xc9))[_0x13f8('0x42')](handleError(_0x5d1449,null));};exports[_0x13f8('0x4a')]=function(_0x1ea79e,_0x282ee9){return db[_0x13f8('0x3e')][_0x13f8('0x4a')]()[_0x13f8('0x23')](respondWithResult(_0x282ee9,null))[_0x13f8('0x42')](handleError(_0x282ee9,null));};exports['update']=function(_0x4ba0a5,_0x222102){if(_0x4ba0a5[_0x13f8('0x49')]['uniqueid']){delete _0x4ba0a5[_0x13f8('0x49')][_0x13f8('0x4b')];}return db[_0x13f8('0x3e')]['find']({'where':{'uniqueid':_0x4ba0a5['params']['id']}})['then'](handleEntityNotFound(_0x222102,null))[_0x13f8('0x23')](saveUpdates(_0x4ba0a5[_0x13f8('0x49')],null))[_0x13f8('0x23')](respondWithResult(_0x222102,null))[_0x13f8('0x42')](handleError(_0x222102,null));}; \ No newline at end of file +var _0x932b=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','status','end','stack','name','send','index','CmHopperHistory','fieldName','type','key','model','map','keys','filters','intersection','query','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','include','merge','find','catch','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5d169d,_0x1125f4){var _0x28a17e=function(_0x6e28a3){while(--_0x6e28a3){_0x5d169d['push'](_0x5d169d['shift']());}};_0x28a17e(++_0x1125f4);}(_0x932b,0x1cc));var _0xb932=function(_0x4ef1b6,_0x502ac2){_0x4ef1b6=_0x4ef1b6-0x0;var _0x164c1f=_0x932b[_0x4ef1b6];return _0x164c1f;};'use strict';var emlformat=require(_0xb932('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb932('0x1'));var jsonpatch=require(_0xb932('0x2'));var rp=require(_0xb932('0x3'));var moment=require(_0xb932('0x4'));var BPromise=require(_0xb932('0x5'));var Mustache=require('mustache');var util=require(_0xb932('0x6'));var path=require('path');var sox=require(_0xb932('0x7'));var csv=require(_0xb932('0x8'));var ejs=require(_0xb932('0x9'));var fs=require('fs');var fs_extra=require(_0xb932('0xa'));var _=require(_0xb932('0xb'));var squel=require(_0xb932('0xc'));var crypto=require('crypto');var jsforce=require(_0xb932('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb932('0x8'));var querystring=require(_0xb932('0xe'));var Papa=require(_0xb932('0xf'));var Redis=require(_0xb932('0x10'));var authService=require(_0xb932('0x11'));var qs=require(_0xb932('0x12'));var as=require(_0xb932('0x13'));var hardwareService=require(_0xb932('0x14'));var logger=require(_0xb932('0x15'))(_0xb932('0x16'));var utils=require(_0xb932('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb932('0x18'));var db=require(_0xb932('0x19'))['db'];function respondWithStatusCode(_0x556ea9,_0x20573a){_0x20573a=_0x20573a||0xcc;return function(_0x1a2ade){if(_0x1a2ade){return _0x556ea9[_0xb932('0x1a')](_0x20573a);}return _0x556ea9['status'](_0x20573a)['end']();};}function respondWithResult(_0x56209e,_0x1c93a7){_0x1c93a7=_0x1c93a7||0xc8;return function(_0x264f3b){if(_0x264f3b){return _0x56209e['status'](_0x1c93a7)[_0xb932('0x1b')](_0x264f3b);}};}function respondWithFilteredResult(_0x4d6cfb,_0xec0f42){return function(_0x25d1c3){if(_0x25d1c3){var _0xf32ee8=typeof _0xec0f42['offset']===_0xb932('0x1c')&&typeof _0xec0f42[_0xb932('0x1d')]===_0xb932('0x1c');var _0x347112=_0x25d1c3[_0xb932('0x1e')];var _0x3e644a=_0xf32ee8?0x0:_0xec0f42[_0xb932('0x1f')];var _0x4ece27=_0xf32ee8?_0x25d1c3['count']:_0xec0f42[_0xb932('0x1f')]+_0xec0f42[_0xb932('0x1d')];var _0x11b325;if(_0x4ece27>=_0x347112){_0x4ece27=_0x347112;_0x11b325=0xc8;}else{_0x11b325=0xce;}_0x4d6cfb['status'](_0x11b325);return _0x4d6cfb[_0xb932('0x20')](_0xb932('0x21'),_0x3e644a+'-'+_0x4ece27+'/'+_0x347112)[_0xb932('0x1b')](_0x25d1c3);}return null;};}function patchUpdates(_0x1cd4fe){return function(_0x556faf){try{jsonpatch[_0xb932('0x22')](_0x556faf,_0x1cd4fe,!![]);}catch(_0x1ca03){return BPromise[_0xb932('0x23')](_0x1ca03);}return _0x556faf['save']();};}function saveUpdates(_0x14034f,_0x2484cd){return function(_0x131920){if(_0x131920){return _0x131920[_0xb932('0x24')](_0x14034f)[_0xb932('0x25')](function(_0xa1b681){return _0xa1b681;});}return null;};}function removeEntity(_0x1d83fc,_0x57ebb6){return function(_0xaa257e){if(_0xaa257e){return _0xaa257e[_0xb932('0x26')]()[_0xb932('0x25')](function(){_0x1d83fc[_0xb932('0x27')](0xcc)[_0xb932('0x28')]();});}};}function handleEntityNotFound(_0x30c564,_0x36fa5b){return function(_0x33b0fb){if(!_0x33b0fb){_0x30c564[_0xb932('0x1a')](0x194);}return _0x33b0fb;};}function handleError(_0x41a67a,_0x412706){_0x412706=_0x412706||0x1f4;return function(_0x26d52c){logger['error'](_0x26d52c[_0xb932('0x29')]);if(_0x26d52c[_0xb932('0x2a')]){delete _0x26d52c[_0xb932('0x2a')];}_0x41a67a['status'](_0x412706)[_0xb932('0x2b')](_0x26d52c);};}exports[_0xb932('0x2c')]=function(_0x3f2d6e,_0x1568cd){var _0x306cf5={},_0x3e9434={},_0x11d064={'count':0x0,'rows':[]};var _0x40a658=_['map'](db[_0xb932('0x2d')]['rawAttributes'],function(_0x54b776){return{'name':_0x54b776[_0xb932('0x2e')],'type':_0x54b776[_0xb932('0x2f')][_0xb932('0x30')]};});_0x3e9434[_0xb932('0x31')]=_[_0xb932('0x32')](_0x40a658,_0xb932('0x2a'));_0x3e9434['query']=_[_0xb932('0x33')](_0x3f2d6e['query']);_0x3e9434[_0xb932('0x34')]=_[_0xb932('0x35')](_0x3e9434[_0xb932('0x31')],_0x3e9434[_0xb932('0x36')]);_0x306cf5['attributes']=_[_0xb932('0x35')](_0x3e9434['model'],qs['fields'](_0x3f2d6e['query'][_0xb932('0x37')]));_0x306cf5['attributes']=_0x306cf5['attributes'][_0xb932('0x38')]?_0x306cf5[_0xb932('0x39')]:_0x3e9434[_0xb932('0x31')];if(!_0x3f2d6e[_0xb932('0x36')][_0xb932('0x3a')](_0xb932('0x3b'))){_0x306cf5[_0xb932('0x1d')]=qs[_0xb932('0x1d')](_0x3f2d6e['query'][_0xb932('0x1d')]);_0x306cf5[_0xb932('0x1f')]=qs['offset'](_0x3f2d6e[_0xb932('0x36')][_0xb932('0x1f')]);}_0x306cf5[_0xb932('0x3c')]=qs[_0xb932('0x3d')](_0x3f2d6e['query'][_0xb932('0x3d')]);_0x306cf5[_0xb932('0x3e')]=qs[_0xb932('0x34')](_[_0xb932('0x3f')](_0x3f2d6e[_0xb932('0x36')],_0x3e9434[_0xb932('0x34')]),_0x40a658);if(_0x3f2d6e[_0xb932('0x36')][_0xb932('0x40')]){_0x306cf5['where']=_['merge'](_0x306cf5[_0xb932('0x3e')],{'$or':_[_0xb932('0x32')](_0x40a658,function(_0x133731){if(_0x133731[_0xb932('0x2f')]!==_0xb932('0x41')){var _0x43e834={};_0x43e834[_0x133731['name']]={'$like':'%'+_0x3f2d6e[_0xb932('0x36')][_0xb932('0x40')]+'%'};return _0x43e834;}})});}_0x306cf5=_['merge']({},_0x306cf5,_0x3f2d6e[_0xb932('0x42')]);var _0xec5b7e={'where':_0x306cf5[_0xb932('0x3e')]};return db[_0xb932('0x2d')][_0xb932('0x1e')](_0xec5b7e)[_0xb932('0x25')](function(_0x196702){_0x11d064[_0xb932('0x1e')]=_0x196702;if(_0x3f2d6e[_0xb932('0x36')][_0xb932('0x43')]){_0x306cf5['include']=[{'all':!![]}];}return db[_0xb932('0x2d')]['findAll'](_0x306cf5);})[_0xb932('0x25')](function(_0xb2cbff){_0x11d064[_0xb932('0x44')]=_0xb2cbff;return _0x11d064;})[_0xb932('0x25')](respondWithFilteredResult(_0x1568cd,_0x306cf5))['catch'](handleError(_0x1568cd,null));};exports[_0xb932('0x45')]=function(_0xbeb28b,_0x28535a){var _0x517071={'raw':!![],'where':{'id':_0xbeb28b[_0xb932('0x46')]['id']}},_0x21149b={};_0x21149b['model']=_[_0xb932('0x33')](db[_0xb932('0x2d')][_0xb932('0x47')]);_0x21149b[_0xb932('0x36')]=_[_0xb932('0x33')](_0xbeb28b[_0xb932('0x36')]);_0x21149b['filters']=_['intersection'](_0x21149b['model'],_0x21149b[_0xb932('0x36')]);_0x517071[_0xb932('0x39')]=_[_0xb932('0x35')](_0x21149b[_0xb932('0x31')],qs[_0xb932('0x37')](_0xbeb28b[_0xb932('0x36')][_0xb932('0x37')]));_0x517071['attributes']=_0x517071[_0xb932('0x39')][_0xb932('0x38')]?_0x517071[_0xb932('0x39')]:_0x21149b[_0xb932('0x31')];if(_0xbeb28b['query'][_0xb932('0x43')]){_0x517071[_0xb932('0x48')]=[{'all':!![]}];}_0x517071=_[_0xb932('0x49')]({},_0x517071,_0xbeb28b['options']);return db[_0xb932('0x2d')][_0xb932('0x4a')](_0x517071)['then'](handleEntityNotFound(_0x28535a,null))[_0xb932('0x25')](respondWithResult(_0x28535a,null))[_0xb932('0x4b')](handleError(_0x28535a,null));};exports[_0xb932('0x4c')]=function(_0x502323,_0x315f62){return db['CmHopperHistory'][_0xb932('0x4c')](_0x502323[_0xb932('0x4d')],{})[_0xb932('0x25')](respondWithResult(_0x315f62,0xc9))[_0xb932('0x4b')](handleError(_0x315f62,null));};exports[_0xb932('0x4e')]=function(_0x1c85ff,_0x732f95){return db['CmHopperHistory'][_0xb932('0x4e')]()[_0xb932('0x25')](respondWithResult(_0x732f95,null))['catch'](handleError(_0x732f95,null));};exports[_0xb932('0x24')]=function(_0x8f35f9,_0x20d57f){if(_0x8f35f9[_0xb932('0x4d')][_0xb932('0x4f')]){delete _0x8f35f9[_0xb932('0x4d')][_0xb932('0x4f')];}return db[_0xb932('0x2d')][_0xb932('0x4a')]({'where':{'uniqueid':_0x8f35f9[_0xb932('0x46')]['id']}})[_0xb932('0x25')](handleEntityNotFound(_0x20d57f,null))[_0xb932('0x25')](saveUpdates(_0x8f35f9[_0xb932('0x4d')],null))[_0xb932('0x25')](respondWithResult(_0x20d57f,null))[_0xb932('0x4b')](handleError(_0x20d57f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 2048e1d..35f7c7d 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.model.js +++ b/server/api/cmHopperHistory/cmHopperHistory.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc7a=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x1a88de,_0x54e301){var _0x1a7bbe=function(_0xdf8f80){while(--_0xdf8f80){_0x1a88de['push'](_0x1a88de['shift']());}};_0x1a7bbe(++_0x54e301);}(_0xbc7a,0xa4));var _0xabc7=function(_0x110b4e,_0x5a0036){_0x110b4e=_0x110b4e-0x0;var _0x4c5813=_0xbc7a[_0x110b4e];return _0x4c5813;};'use strict';var _=require(_0xabc7('0x0'));var util=require(_0xabc7('0x1'));var logger=require(_0xabc7('0x2'))('api');var moment=require(_0xabc7('0x3'));var BPromise=require(_0xabc7('0x4'));var rp=require(_0xabc7('0x5'));var fs=require('fs');var path=require(_0xabc7('0x6'));var rimraf=require(_0xabc7('0x7'));var config=require(_0xabc7('0x8'));var attributes=require('./cmHopperHistory.attributes');module[_0xabc7('0x9')]=function(_0xc4f32a,_0x3a5248){return _0xc4f32a[_0xabc7('0xa')](_0xabc7('0xb'),attributes,{'tableName':_0xabc7('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xabc7('0xd')]},{'name':'uniqueid','fields':[_0xabc7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f75=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','endtime'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x6f75,0x71));var _0x56f7=function(_0x444243,_0x138203){_0x444243=_0x444243-0x0;var _0x2a8529=_0x6f75[_0x444243];return _0x2a8529;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var logger=require(_0x56f7('0x2'))(_0x56f7('0x3'));var moment=require(_0x56f7('0x4'));var BPromise=require(_0x56f7('0x5'));var rp=require(_0x56f7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56f7('0x7'));var config=require(_0x56f7('0x8'));var attributes=require(_0x56f7('0x9'));module['exports']=function(_0x4d0f0c,_0x5da455){return _0x4d0f0c[_0x56f7('0xa')](_0x56f7('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x56f7('0xc'),'fields':['endtime']},{'name':'uniqueid','fields':[_0x56f7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index e78554d..49f6929 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2948=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','stringify','GetVoiceQueueHopperHistory','campaign','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3428b3,_0x4396cc){var _0x4474ad=function(_0x5df2bc){while(--_0x5df2bc){_0x3428b3['push'](_0x3428b3['shift']());}};_0x4474ad(++_0x4396cc);}(_0x2948,0xcb));var _0x8294=function(_0x2f9d26,_0x69e053){_0x2f9d26=_0x2f9d26-0x0;var _0x1a4c07=_0x2948[_0x2f9d26];return _0x1a4c07;};'use strict';var _=require(_0x8294('0x0'));var util=require(_0x8294('0x1'));var moment=require(_0x8294('0x2'));var BPromise=require(_0x8294('0x3'));var rs=require(_0x8294('0x4'));var fs=require('fs');var Redis=require(_0x8294('0x5'));var db=require(_0x8294('0x6'))['db'];var utils=require(_0x8294('0x7'));var logger=require(_0x8294('0x8'))('rpc');var config=require(_0x8294('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8294('0xa')][_0x8294('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39aa65,_0x514609,_0x5a7135){return new BPromise(function(_0x56f7c8,_0x530786){return client[_0x8294('0xc')](_0x39aa65,_0x5a7135)[_0x8294('0xd')](function(_0x545613){logger[_0x8294('0xe')](_0x8294('0xf'),_0x514609,_0x8294('0x10'));logger[_0x8294('0x11')](_0x8294('0x12'),_0x514609,_0x8294('0x10'),JSON['stringify'](_0x545613));if(_0x545613[_0x8294('0x13')]){if(_0x545613[_0x8294('0x13')][_0x8294('0x14')]===0x1f4){logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x545613[_0x8294('0x13')][_0x8294('0x15')]);return _0x530786(_0x545613[_0x8294('0x13')]['message']);}logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x545613[_0x8294('0x13')]['message']);return _0x56f7c8(_0x545613['error']['message']);}else{logger[_0x8294('0xe')](_0x8294('0xf'),_0x514609,_0x8294('0x10'));_0x56f7c8(_0x545613[_0x8294('0x16')][_0x8294('0x15')]);}})[_0x8294('0x17')](function(_0x2a501a){logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x2a501a);_0x530786(_0x2a501a);});});}exports[_0x8294('0x18')]=function(_0x3d194a){var _0x49dd8e=this;return new Promise(function(_0x40175a,_0x4d1981){return db[_0x8294('0x19')][_0x8294('0x1a')](_0x3d194a[_0x8294('0x1b')],{'raw':_0x3d194a[_0x8294('0x1c')]?_0x3d194a[_0x8294('0x1c')][_0x8294('0x1d')]===undefined?!![]:![]:!![]})[_0x8294('0xd')](function(_0x27273d){logger[_0x8294('0xe')]('CreateCmHopperHistory',_0x3d194a);logger[_0x8294('0x11')](_0x8294('0x18'),_0x3d194a,JSON['stringify'](_0x27273d));_0x40175a(_0x27273d);})[_0x8294('0x17')](function(_0x140666){logger[_0x8294('0x13')](_0x8294('0x18'),_0x140666[_0x8294('0x15')],_0x3d194a);_0x4d1981(_0x49dd8e[_0x8294('0x13')](0x1f4,_0x140666[_0x8294('0x15')]));});});};exports[_0x8294('0x1e')]=function(_0x3aa9f6){var _0x402d09=this;return new Promise(function(_0x1bb559,_0x54fbf3){return db['CmHopperHistory'][_0x8294('0x1f')]({'raw':_0x3aa9f6['options']?_0x3aa9f6[_0x8294('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3aa9f6['options']?_0x3aa9f6[_0x8294('0x1c')][_0x8294('0x20')]||null:null,'attributes':[[db['sequelize']['fn'](_0x8294('0x21'),db[_0x8294('0x22')][_0x8294('0x23')]('id')),_0x8294('0x24')],[db['sequelize']['fn']('COUNT',db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')][_0x8294('0x25')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x8294('0x22')]['fn'](_0x8294('0x21'),db[_0x8294('0x22')]['fn']('IF',db['sequelize']['literal'](_0x8294('0x26')))),_0x8294('0x27')],[db['sequelize']['fn'](_0x8294('0x21'),db[_0x8294('0x22')]['fn']('IF',db['sequelize'][_0x8294('0x25')]('`state`\x20=\x2011,\x201,\x20null'))),_0x8294('0x28')],[db['sequelize']['fn'](_0x8294('0x29'),db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')][_0x8294('0x25')](_0x8294('0x2a')))),_0x8294('0x2b')],[db[_0x8294('0x22')]['fn']('AVG',db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')][_0x8294('0x25')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x8294('0x2c')]]})[_0x8294('0xd')](function(_0xd22e91){logger['info']('AvgHandleTime',_0x3aa9f6);logger[_0x8294('0x11')](_0x8294('0x1e'),_0x3aa9f6,JSON[_0x8294('0x2d')](_0xd22e91));_0x1bb559(_0xd22e91);})[_0x8294('0x17')](function(_0x9b3ea8){logger[_0x8294('0x13')](_0x8294('0x1e'),_0x9b3ea8[_0x8294('0x15')],_0x3aa9f6);_0x54fbf3(_0x402d09[_0x8294('0x13')](0x1f4,_0x9b3ea8['message']));});});};exports[_0x8294('0x2e')]=function(_0x1a9a0d){var _0x49c90d=this;return new Promise(function(_0xbf910,_0x8ad38c){return db[_0x8294('0x19')][_0x8294('0x1f')]({'raw':_0x1a9a0d['options']?_0x1a9a0d[_0x8294('0x1c')][_0x8294('0x1d')]===undefined?!![]:![]:!![],'where':_0x1a9a0d[_0x8294('0x1c')]?_0x1a9a0d[_0x8294('0x1c')][_0x8294('0x20')]||null:null,'attributes':[[_0x8294('0x2f'),'name'],[db['sequelize']['fn'](_0x8294('0x21'),db['sequelize']['fn']('IF',db[_0x8294('0x22')][_0x8294('0x25')]('`state`\x20=\x200,\x201,\x20null'))),_0x8294('0x30')],[db[_0x8294('0x22')]['fn'](_0x8294('0x21'),db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')][_0x8294('0x25')](_0x8294('0x31')))),_0x8294('0x32')],[db[_0x8294('0x22')]['fn'](_0x8294('0x21'),db[_0x8294('0x22')]['fn']('IF',db['sequelize'][_0x8294('0x25')](_0x8294('0x33')))),_0x8294('0x34')],[db['sequelize']['fn'](_0x8294('0x21'),db['sequelize']['fn']('IF',db[_0x8294('0x22')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x8294('0x35')],[db['sequelize']['fn'](_0x8294('0x21'),db['sequelize']['fn']('IF',db[_0x8294('0x22')]['literal'](_0x8294('0x36')))),_0x8294('0x37')],[db[_0x8294('0x22')]['fn']('COUNT',db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')][_0x8294('0x25')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8294('0x38')],[db[_0x8294('0x22')]['fn']('COUNT',db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')][_0x8294('0x25')](_0x8294('0x39')))),_0x8294('0x3a')],[db[_0x8294('0x22')]['fn']('COUNT',db[_0x8294('0x22')]['fn']('IF',db['sequelize'][_0x8294('0x25')]('`state`\x20=\x2012,\x201,\x20null'))),_0x8294('0x3b')],[db[_0x8294('0x22')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x8294('0x3c')))),_0x8294('0x3d')],[db[_0x8294('0x22')]['fn']('COUNT',db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')][_0x8294('0x25')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0x8294('0x22')]['fn'](_0x8294('0x21'),db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')]['literal'](_0x8294('0x3e')))),_0x8294('0x3f')],[db[_0x8294('0x22')]['fn'](_0x8294('0x21'),db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')]['literal'](_0x8294('0x40')))),'outboundAnswerAgiCallsDay'],[db[_0x8294('0x22')]['fn'](_0x8294('0x21'),db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')][_0x8294('0x25')]('`state`\x20=\x2020,\x201,\x20null'))),_0x8294('0x3f')],[db[_0x8294('0x22')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x8294('0x41')]],'group':[_0x8294('0x2f')]})['then'](function(_0x1bcdfd){logger['info'](_0x8294('0x2e'),_0x1a9a0d);logger['debug']('GetVoiceQueueHopperHistory',_0x1a9a0d,JSON[_0x8294('0x2d')](_0x1bcdfd));_0xbf910(_0x1bcdfd);})[_0x8294('0x17')](function(_0x255b9a){logger[_0x8294('0x13')]('GetVoiceQueueHopperHistory',_0x255b9a['message'],_0x1a9a0d);_0x8ad38c(_0x49c90d[_0x8294('0x13')](0x1f4,_0x255b9a[_0x8294('0x15')]));});});};exports[_0x8294('0x42')]=function(_0x4b5709){var _0x59bc97=this;return new Promise(function(_0xf7dd03,_0x208247){return db[_0x8294('0x19')][_0x8294('0x1f')]({'raw':_0x4b5709[_0x8294('0x1c')]?_0x4b5709[_0x8294('0x1c')][_0x8294('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b5709[_0x8294('0x1c')]?_0x4b5709[_0x8294('0x1c')][_0x8294('0x20')]||null:null,'attributes':[[_0x8294('0x2f'),_0x8294('0x43')],[db[_0x8294('0x22')]['fn'](_0x8294('0x21'),db['sequelize'][_0x8294('0x23')]('id')),_0x8294('0x44')],[db['sequelize']['fn'](_0x8294('0x21'),db[_0x8294('0x22')]['fn']('IF',db[_0x8294('0x22')][_0x8294('0x25')](_0x8294('0x33')))),_0x8294('0x45')]],'group':[_0x8294('0x2f')]})['then'](function(_0x520954){logger[_0x8294('0xe')](_0x8294('0x42'),_0x4b5709);logger[_0x8294('0x11')](_0x8294('0x42'),_0x4b5709,JSON[_0x8294('0x2d')](_0x520954));_0xf7dd03(_0x520954);})[_0x8294('0x17')](function(_0x3b62ec){logger['error'](_0x8294('0x42'),_0x3b62ec[_0x8294('0x15')],_0x4b5709);_0x208247(_0x59bc97['error'](0x1f4,_0x3b62ec[_0x8294('0x15')]));});});}; \ No newline at end of file +var _0x70e0=['`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','findAll','raw','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x70e0,0x17b));var _0x070e=function(_0x4c55c9,_0x3c2af0){_0x4c55c9=_0x4c55c9-0x0;var _0x58a245=_0x70e0[_0x4c55c9];return _0x58a245;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}exports[_0x070e('0x16')]=function(_0x38f6e6){var _0x2060cc=this;return new Promise(function(_0x364b3f,_0x5037eb){return db[_0x070e('0x17')][_0x070e('0x18')](_0x38f6e6[_0x070e('0x19')],{'raw':_0x38f6e6[_0x070e('0x1a')]?_0x38f6e6[_0x070e('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4e958f){logger[_0x070e('0xb')](_0x070e('0x16'),_0x38f6e6);logger[_0x070e('0xc')]('CreateCmHopperHistory',_0x38f6e6,JSON[_0x070e('0xf')](_0x4e958f));_0x364b3f(_0x4e958f);})['catch'](function(_0xf8dd5d){logger[_0x070e('0x10')](_0x070e('0x16'),_0xf8dd5d[_0x070e('0x13')],_0x38f6e6);_0x5037eb(_0x2060cc[_0x070e('0x10')](0x1f4,_0xf8dd5d[_0x070e('0x13')]));});});};exports[_0x070e('0x1b')]=function(_0x164cdf){var _0x595c7e=this;return new Promise(function(_0x2f8055,_0x270061){return db[_0x070e('0x17')]['findAll']({'raw':_0x164cdf[_0x070e('0x1a')]?_0x164cdf['options']['raw']===undefined?!![]:![]:!![],'where':_0x164cdf[_0x070e('0x1a')]?_0x164cdf[_0x070e('0x1a')][_0x070e('0x1c')]||null:null,'attributes':[[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db['sequelize'][_0x070e('0x1f')]('id')),_0x070e('0x20')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x070e('0x23')))),_0x070e('0x24')],[db[_0x070e('0x1d')]['fn']('COUNT',db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x25')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn']('AVG',db['sequelize']['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x26')))),_0x070e('0x27')],[db['sequelize']['fn']('AVG',db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x070e('0x28')]]})[_0x070e('0xa')](function(_0x444d02){logger[_0x070e('0xb')](_0x070e('0x1b'),_0x164cdf);logger['debug']('AvgHandleTime',_0x164cdf,JSON[_0x070e('0xf')](_0x444d02));_0x2f8055(_0x444d02);})[_0x070e('0x15')](function(_0x4bb439){logger[_0x070e('0x10')](_0x070e('0x1b'),_0x4bb439['message'],_0x164cdf);_0x270061(_0x595c7e[_0x070e('0x10')](0x1f4,_0x4bb439[_0x070e('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x2d6bb6){var _0x34746e=this;return new Promise(function(_0x4ba6f0,_0x4d4ee8){return db['CmHopperHistory'][_0x070e('0x29')]({'raw':_0x2d6bb6[_0x070e('0x1a')]?_0x2d6bb6[_0x070e('0x1a')][_0x070e('0x2a')]===undefined?!![]:![]:!![],'where':_0x2d6bb6[_0x070e('0x1a')]?_0x2d6bb6['options'][_0x070e('0x1c')]||null:null,'attributes':[[_0x070e('0x2b'),_0x070e('0x2c')],[db['sequelize']['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x2d')))),_0x070e('0x2e')],[db['sequelize']['fn'](_0x070e('0x1e'),db['sequelize']['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x2f')))),_0x070e('0x30')],[db[_0x070e('0x1d')]['fn']('COUNT',db[_0x070e('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x070e('0x22')))),_0x070e('0x31')],[db[_0x070e('0x1d')]['fn']('COUNT',db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x32')))),'outboundBusyCallsDay'],[db[_0x070e('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x070e('0x21')](_0x070e('0x33')))),_0x070e('0x34')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db['sequelize']['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x35')))),_0x070e('0x36')],[db[_0x070e('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x37')))),_0x070e('0x38')],[db[_0x070e('0x1d')]['fn']('COUNT',db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x070e('0x39')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x3a')))),_0x070e('0x3b')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x3c')))),_0x070e('0x3d')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x3e')))),'outboundRejectCallsDay'],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x3f')))),_0x070e('0x40')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db['sequelize']['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x41')))),_0x070e('0x42')],[db['sequelize']['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x43')))),_0x070e('0x44')]],'group':[_0x070e('0x2b')]})['then'](function(_0x296978){logger['info']('GetVoiceQueueHopperHistory',_0x2d6bb6);logger[_0x070e('0xc')](_0x070e('0x45'),_0x2d6bb6,JSON[_0x070e('0xf')](_0x296978));_0x4ba6f0(_0x296978);})[_0x070e('0x15')](function(_0x202015){logger[_0x070e('0x10')](_0x070e('0x45'),_0x202015[_0x070e('0x13')],_0x2d6bb6);_0x4d4ee8(_0x34746e['error'](0x1f4,_0x202015[_0x070e('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x564d82){var _0x3a76e2=this;return new Promise(function(_0x20acc6,_0x589aee){return db[_0x070e('0x17')][_0x070e('0x29')]({'raw':_0x564d82[_0x070e('0x1a')]?_0x564d82[_0x070e('0x1a')][_0x070e('0x2a')]===undefined?!![]:![]:!![],'where':_0x564d82[_0x070e('0x1a')]?_0x564d82[_0x070e('0x1a')]['where']||null:null,'attributes':[['campaign','name'],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')][_0x070e('0x1f')]('id')),'ivrTotalCallsDays'],[db[_0x070e('0x1d')]['fn']('COUNT',db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x22')))),_0x070e('0x46')]],'group':[_0x070e('0x2b')]})['then'](function(_0x20ff87){logger[_0x070e('0xb')](_0x070e('0x47'),_0x564d82);logger['debug'](_0x070e('0x47'),_0x564d82,JSON[_0x070e('0xf')](_0x20ff87));_0x20acc6(_0x20ff87);})['catch'](function(_0x1f1df5){logger['error'](_0x070e('0x47'),_0x1f1df5['message'],_0x564d82);_0x589aee(_0x3a76e2['error'](0x1f4,_0x1f1df5['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 0802d36..6dc9fb0 100644 --- a/server/api/cmHopperHistory/index.js +++ b/server/api/cmHopperHistory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e5c=['put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x343154,_0x439559){var _0x23bfc6=function(_0x2722de){while(--_0x2722de){_0x343154['push'](_0x343154['shift']());}};_0x23bfc6(++_0x439559);}(_0x3e5c,0x1c5));var _0xc3e5=function(_0x2b7ca7,_0x263fae){_0x2b7ca7=_0x2b7ca7-0x0;var _0x192cea=_0x3e5c[_0x2b7ca7];return _0x192cea;};'use strict';var multer=require('multer');var util=require(_0xc3e5('0x0'));var path=require(_0xc3e5('0x1'));var timeout=require(_0xc3e5('0x2'));var express=require(_0xc3e5('0x3'));var router=express[_0xc3e5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc3e5('0x5'));var interaction=require(_0xc3e5('0x6'));var config=require(_0xc3e5('0x7'));var controller=require(_0xc3e5('0x8'));router[_0xc3e5('0x9')]('/',auth[_0xc3e5('0xa')](),controller[_0xc3e5('0xb')]);router[_0xc3e5('0x9')](_0xc3e5('0xc'),auth[_0xc3e5('0xa')](),controller['describe']);router['get'](_0xc3e5('0xd'),auth[_0xc3e5('0xa')](),controller[_0xc3e5('0xe')]);router['post']('/',auth[_0xc3e5('0xa')](),controller['create']);router[_0xc3e5('0xf')](_0xc3e5('0xd'),auth[_0xc3e5('0xa')](),controller[_0xc3e5('0x10')]);module[_0xc3e5('0x11')]=router; \ No newline at end of file +var _0x8af9=['/describe','describe','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x4deeef,_0x9c0653){var _0x3c50a8=function(_0x595d01){while(--_0x595d01){_0x4deeef['push'](_0x4deeef['shift']());}};_0x3c50a8(++_0x9c0653);}(_0x8af9,0x126));var _0x98af=function(_0x4feb84,_0x3f58fd){_0x4feb84=_0x4feb84-0x0;var _0x441956=_0x8af9[_0x4feb84];return _0x441956;};'use strict';var multer=require(_0x98af('0x0'));var util=require(_0x98af('0x1'));var path=require(_0x98af('0x2'));var timeout=require(_0x98af('0x3'));var express=require(_0x98af('0x4'));var router=express[_0x98af('0x5')]();var fs_extra=require(_0x98af('0x6'));var auth=require(_0x98af('0x7'));var interaction=require(_0x98af('0x8'));var config=require(_0x98af('0x9'));var controller=require(_0x98af('0xa'));router[_0x98af('0xb')]('/',auth[_0x98af('0xc')](),controller[_0x98af('0xd')]);router[_0x98af('0xb')](_0x98af('0xe'),auth[_0x98af('0xc')](),controller[_0x98af('0xf')]);router[_0x98af('0xb')](_0x98af('0x10'),auth[_0x98af('0xc')](),controller[_0x98af('0x11')]);router[_0x98af('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x98af('0x13')](_0x98af('0x10'),auth[_0x98af('0xc')](),controller[_0x98af('0x14')]);module[_0x98af('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 5ce7d80..357ef8c 100644 --- a/server/api/cmList/cmList.attributes.js +++ b/server/api/cmList/cmList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x943c=['sequelize','exports','STRING','name'];(function(_0x1d4eb5,_0xa3107b){var _0x395c26=function(_0x2791de){while(--_0x2791de){_0x1d4eb5['push'](_0x1d4eb5['shift']());}};_0x395c26(++_0xa3107b);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc943('0x0'));module[_0xc943('0x1')]={'name':{'type':Sequelize[_0xc943('0x2')],'unique':_0xc943('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x27bf=['exports','STRING','name','sequelize'];(function(_0xa73194,_0x123c26){var _0x3d6685=function(_0x4dc77a){while(--_0x4dc77a){_0xa73194['push'](_0xa73194['shift']());}};_0x3d6685(++_0x123c26);}(_0x27bf,0x117));var _0xf27b=function(_0x5528e6,_0x3b329f){_0x5528e6=_0x5528e6-0x0;var _0x4aee56=_0x27bf[_0x5528e6];return _0x4aee56;};'use strict';var Sequelize=require(_0xf27b('0x0'));module[_0xf27b('0x1')]={'name':{'type':Sequelize[_0xf27b('0x2')],'unique':_0xf27b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf27b('0x2')]},'dialPrefix':{'type':Sequelize[_0xf27b('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index c416b2f..3a370f5 100644 --- a/server/api/cmList/cmList.controller.js +++ b/server/api/cmList/cmList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeddd=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','end','status','json','offset','limit','undefined','count','Content-Range','apply','then','destroy','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Lists','find','UserProfileResource','error','update','describe','addDisposition','ListId','Disposition','getDispositions','findOne','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','isEmpty','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sendStatus','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','addColumn','cf_%s','findAndCountAll','addAgents','ids','emit','userCmList:save','userCmList:remove','User','getAgents','info','spread','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xeddd,0x1d7));var _0xdedd=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xeddd[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require(_0xdedd('0x0'));var rimraf=require(_0xdedd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdedd('0x2'));var rp=require(_0xdedd('0x3'));var moment=require(_0xdedd('0x4'));var BPromise=require(_0xdedd('0x5'));var Mustache=require('mustache');var util=require(_0xdedd('0x6'));var path=require(_0xdedd('0x7'));var sox=require('sox');var csv=require(_0xdedd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdedd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdedd('0xa'));var deskjs=require(_0xdedd('0xb'));var toCsv=require(_0xdedd('0x8'));var querystring=require(_0xdedd('0xc'));var Papa=require('papaparse');var Redis=require(_0xdedd('0xd'));var authService=require(_0xdedd('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdedd('0xf'));var logger=require(_0xdedd('0x10'))('api');var utils=require(_0xdedd('0x11'));var config=require(_0xdedd('0x12'));var licenseUtil=require(_0xdedd('0x13'));var db=require(_0xdedd('0x14'))['db'];var csv_results;config[_0xdedd('0x15')]=_[_0xdedd('0x16')](config[_0xdedd('0x15')],{'host':_0xdedd('0x17'),'port':0x18eb});var socket=require(_0xdedd('0x18'))(new Redis(config[_0xdedd('0x15')]));require(_0xdedd('0x19'))[_0xdedd('0x1a')](socket);function respondWithStatusCode(_0x51c437,_0x540f13){_0x540f13=_0x540f13||0xcc;return function(_0x5c3f34){if(_0x5c3f34){return _0x51c437['sendStatus'](_0x540f13);}return _0x51c437['status'](_0x540f13)[_0xdedd('0x1b')]();};}function respondWithResult(_0x782c33,_0x3ae158){_0x3ae158=_0x3ae158||0xc8;return function(_0x2375c3){if(_0x2375c3){return _0x782c33[_0xdedd('0x1c')](_0x3ae158)[_0xdedd('0x1d')](_0x2375c3);}};}function respondWithFilteredResult(_0x11b909,_0xf00c2){return function(_0x3b2e28){if(_0x3b2e28){var _0x8aa08e=typeof _0xf00c2[_0xdedd('0x1e')]==='undefined'&&typeof _0xf00c2[_0xdedd('0x1f')]===_0xdedd('0x20');var _0x286467=_0x3b2e28[_0xdedd('0x21')];var _0x51809b=_0x8aa08e?0x0:_0xf00c2[_0xdedd('0x1e')];var _0x1efaca=_0x8aa08e?_0x3b2e28[_0xdedd('0x21')]:_0xf00c2[_0xdedd('0x1e')]+_0xf00c2['limit'];var _0xdf7c2d;if(_0x1efaca>=_0x286467){_0x1efaca=_0x286467;_0xdf7c2d=0xc8;}else{_0xdf7c2d=0xce;}_0x11b909[_0xdedd('0x1c')](_0xdf7c2d);return _0x11b909['set'](_0xdedd('0x22'),_0x51809b+'-'+_0x1efaca+'/'+_0x286467)[_0xdedd('0x1d')](_0x3b2e28);}return null;};}function patchUpdates(_0x46884f){return function(_0x14ba00){try{jsonpatch[_0xdedd('0x23')](_0x14ba00,_0x46884f,!![]);}catch(_0x1c10fa){return BPromise['reject'](_0x1c10fa);}return _0x14ba00['save']();};}function saveUpdates(_0x1fafeb,_0x1ad2eb){return function(_0x5ef11d){if(_0x5ef11d){return _0x5ef11d['update'](_0x1fafeb)[_0xdedd('0x24')](function(_0x5b3541){return _0x5b3541;});}return null;};}function removeEntity(_0x572f51,_0x507efa){return function(_0x4ec1cf){if(_0x4ec1cf){return _0x4ec1cf[_0xdedd('0x25')]()[_0xdedd('0x24')](function(){var _0xe268a3=_0x4ec1cf['get']({'plain':!![]});var _0x45af9b='Lists';return db['UserProfileResource'][_0xdedd('0x25')]({'where':{'type':_0x45af9b,'resourceId':_0xe268a3['id']}})[_0xdedd('0x24')](function(){return _0x4ec1cf;});})[_0xdedd('0x24')](function(){_0x572f51['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10e3a2,_0x1d600d){return function(_0xf20095){if(!_0xf20095){_0x10e3a2['sendStatus'](0x194);}return _0xf20095;};}function handleError(_0x262029,_0x23bed6){_0x23bed6=_0x23bed6||0x1f4;return function(_0x58829b){logger['error'](_0x58829b[_0xdedd('0x26')]);if(_0x58829b[_0xdedd('0x27')]){delete _0x58829b[_0xdedd('0x27')];}_0x262029['status'](_0x23bed6)[_0xdedd('0x28')](_0x58829b);};}exports[_0xdedd('0x29')]=function(_0x53c51f,_0x15ed36){var _0x17d7bd={},_0x41c5d3={},_0x5d5429={'count':0x0,'rows':[]};var _0x32862d=_[_0xdedd('0x2a')](db[_0xdedd('0x2b')][_0xdedd('0x2c')],function(_0x303f2f){return{'name':_0x303f2f[_0xdedd('0x2d')],'type':_0x303f2f[_0xdedd('0x2e')][_0xdedd('0x2f')]};});_0x41c5d3['model']=_[_0xdedd('0x2a')](_0x32862d,_0xdedd('0x27'));_0x41c5d3[_0xdedd('0x30')]=_[_0xdedd('0x31')](_0x53c51f[_0xdedd('0x30')]);_0x41c5d3['filters']=_[_0xdedd('0x32')](_0x41c5d3['model'],_0x41c5d3[_0xdedd('0x30')]);_0x17d7bd[_0xdedd('0x33')]=_[_0xdedd('0x32')](_0x41c5d3['model'],qs[_0xdedd('0x34')](_0x53c51f[_0xdedd('0x30')][_0xdedd('0x34')]));_0x17d7bd[_0xdedd('0x33')]=_0x17d7bd[_0xdedd('0x33')]['length']?_0x17d7bd[_0xdedd('0x33')]:_0x41c5d3[_0xdedd('0x35')];if(!_0x53c51f[_0xdedd('0x30')][_0xdedd('0x36')](_0xdedd('0x37'))){_0x17d7bd['limit']=qs[_0xdedd('0x1f')](_0x53c51f[_0xdedd('0x30')][_0xdedd('0x1f')]);_0x17d7bd[_0xdedd('0x1e')]=qs[_0xdedd('0x1e')](_0x53c51f[_0xdedd('0x30')][_0xdedd('0x1e')]);}_0x17d7bd[_0xdedd('0x38')]=qs[_0xdedd('0x39')](_0x53c51f['query'][_0xdedd('0x39')]);_0x17d7bd[_0xdedd('0x3a')]=qs[_0xdedd('0x3b')](_[_0xdedd('0x3c')](_0x53c51f[_0xdedd('0x30')],_0x41c5d3[_0xdedd('0x3b')]),_0x32862d);if(_0x53c51f['query']['filter']){_0x17d7bd[_0xdedd('0x3a')]=_[_0xdedd('0x3d')](_0x17d7bd[_0xdedd('0x3a')],{'$or':_['map'](_0x32862d,function(_0x3d917a){if(_0x3d917a[_0xdedd('0x2e')]!==_0xdedd('0x3e')){var _0x14b022={};_0x14b022[_0x3d917a['name']]={'$like':'%'+_0x53c51f[_0xdedd('0x30')][_0xdedd('0x3f')]+'%'};return _0x14b022;}})});}_0x17d7bd=_[_0xdedd('0x3d')]({},_0x17d7bd,_0x53c51f[_0xdedd('0x40')]);var _0x5b1de1={'where':_0x17d7bd['where']};return db['CmList'][_0xdedd('0x21')](_0x5b1de1)[_0xdedd('0x24')](function(_0x343008){_0x5d5429[_0xdedd('0x21')]=_0x343008;if(_0x53c51f['query'][_0xdedd('0x41')]){_0x17d7bd[_0xdedd('0x42')]=[{'all':!![]}];}return db[_0xdedd('0x2b')][_0xdedd('0x43')](_0x17d7bd);})['then'](function(_0x45780f){_0x5d5429[_0xdedd('0x44')]=_0x45780f;return _0x5d5429;})[_0xdedd('0x24')](respondWithFilteredResult(_0x15ed36,_0x17d7bd))[_0xdedd('0x45')](handleError(_0x15ed36,null));};exports[_0xdedd('0x46')]=function(_0x483e0b,_0x5c6cf2){var _0x4c6a93={'raw':![],'where':{'id':_0x483e0b[_0xdedd('0x47')]['id']}},_0x3d6918={};_0x3d6918[_0xdedd('0x35')]=_[_0xdedd('0x31')](db[_0xdedd('0x2b')][_0xdedd('0x2c')]);_0x3d6918['query']=_[_0xdedd('0x31')](_0x483e0b['query']);_0x3d6918[_0xdedd('0x3b')]=_[_0xdedd('0x32')](_0x3d6918[_0xdedd('0x35')],_0x3d6918[_0xdedd('0x30')]);_0x4c6a93[_0xdedd('0x33')]=_[_0xdedd('0x32')](_0x3d6918[_0xdedd('0x35')],qs[_0xdedd('0x34')](_0x483e0b[_0xdedd('0x30')][_0xdedd('0x34')]));_0x4c6a93['attributes']=_0x4c6a93[_0xdedd('0x33')][_0xdedd('0x48')]?_0x4c6a93[_0xdedd('0x33')]:_0x3d6918[_0xdedd('0x35')];if(_0x483e0b[_0xdedd('0x30')][_0xdedd('0x41')]){_0x4c6a93[_0xdedd('0x42')]=[{'all':!![]}];}_0x4c6a93=_[_0xdedd('0x3d')]({},_0x4c6a93,_0x483e0b[_0xdedd('0x40')]);return db[_0xdedd('0x2b')]['find'](_0x4c6a93)[_0xdedd('0x24')](handleEntityNotFound(_0x5c6cf2,null))[_0xdedd('0x24')](respondWithResult(_0x5c6cf2,null))['catch'](handleError(_0x5c6cf2,null));};exports[_0xdedd('0x49')]=function(_0x45a787,_0x569d1c){return db[_0xdedd('0x2b')]['create'](_0x45a787[_0xdedd('0x4a')],{})['then'](function(_0x3464ed){var _0x1a840e=_0x45a787['user'][_0xdedd('0x4b')]({'plain':!![]});if(!_0x1a840e)throw new Error(_0xdedd('0x4c'));if(_0x1a840e[_0xdedd('0x4d')]===_0xdedd('0x4e')){var _0x2bc901=_0x3464ed[_0xdedd('0x4b')]({'plain':!![]});var _0x35efce=_0xdedd('0x4f');return db['UserProfileSection'][_0xdedd('0x50')]({'where':{'name':_0x35efce,'userProfileId':_0x1a840e['userProfileId']},'raw':!![]})[_0xdedd('0x24')](function(_0xa7472f){if(_0xa7472f&&_0xa7472f['autoAssociation']===0x0){return db[_0xdedd('0x51')]['create']({'name':_0x2bc901[_0xdedd('0x27')],'resourceId':_0x2bc901['id'],'type':_0xa7472f[_0xdedd('0x27')],'sectionId':_0xa7472f['id']},{})['then'](function(){return _0x3464ed;});}else{return _0x3464ed;}})[_0xdedd('0x45')](function(_0x3280bd){logger[_0xdedd('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3280bd);throw _0x3280bd;});}return _0x3464ed;})['then'](respondWithResult(_0x569d1c,0xc9))[_0xdedd('0x45')](handleError(_0x569d1c,null));};exports[_0xdedd('0x53')]=function(_0x3ace84,_0x44b9f5){if(_0x3ace84[_0xdedd('0x4a')]['id']){delete _0x3ace84[_0xdedd('0x4a')]['id'];}return db['CmList'][_0xdedd('0x50')]({'where':{'id':_0x3ace84[_0xdedd('0x47')]['id']}})[_0xdedd('0x24')](handleEntityNotFound(_0x44b9f5,null))[_0xdedd('0x24')](saveUpdates(_0x3ace84['body'],null))[_0xdedd('0x24')](respondWithResult(_0x44b9f5,null))[_0xdedd('0x45')](handleError(_0x44b9f5,null));};exports[_0xdedd('0x25')]=function(_0x578867,_0x2bccb4){return db['CmList']['find']({'where':{'id':_0x578867[_0xdedd('0x47')]['id']}})['then'](handleEntityNotFound(_0x2bccb4,null))[_0xdedd('0x24')](removeEntity(_0x2bccb4,null))[_0xdedd('0x45')](handleError(_0x2bccb4,null));};exports[_0xdedd('0x54')]=function(_0x2e9ac0,_0x25a689){return db[_0xdedd('0x2b')]['describe']()[_0xdedd('0x24')](respondWithResult(_0x25a689,null))[_0xdedd('0x45')](handleError(_0x25a689,null));};exports[_0xdedd('0x55')]=function(_0xecd9de,_0x869d7a,_0x749fbb){if(_0xecd9de[_0xdedd('0x4a')]['id']){delete _0xecd9de[_0xdedd('0x4a')]['id'];}return db[_0xdedd('0x2b')][_0xdedd('0x50')]({'where':{'id':_0xecd9de[_0xdedd('0x47')]['id']}})[_0xdedd('0x24')](handleEntityNotFound(_0x869d7a,null))[_0xdedd('0x24')](function(_0x247f02){if(_0x247f02){_0xecd9de[_0xdedd('0x4a')][_0xdedd('0x56')]=_0x247f02['id'];return db[_0xdedd('0x57')]['create'](_0xecd9de['body']);}})['then'](respondWithResult(_0x869d7a,null))[_0xdedd('0x45')](handleError(_0x869d7a,null));};exports[_0xdedd('0x58')]=function(_0x575e6e,_0x7e4602,_0x230023){var _0x283ee2={'raw':![],'where':{}};var _0xc83fa0={};var _0x5f4841={'count':0x0,'rows':[]};return db['CmList'][_0xdedd('0x59')]({'where':{'id':_0x575e6e[_0xdedd('0x47')]['id']}})[_0xdedd('0x24')](handleEntityNotFound(_0x7e4602,null))[_0xdedd('0x24')](function(_0x46c0b8){if(_0x46c0b8){_0xc83fa0[_0xdedd('0x35')]=_[_0xdedd('0x31')](db[_0xdedd('0x57')][_0xdedd('0x2c')]);_0xc83fa0[_0xdedd('0x30')]=_['keys'](_0x575e6e['query']);_0xc83fa0[_0xdedd('0x3b')]=_[_0xdedd('0x32')](_0xc83fa0[_0xdedd('0x35')],_0xc83fa0[_0xdedd('0x30')]);_0x283ee2['attributes']=_[_0xdedd('0x32')](_0xc83fa0[_0xdedd('0x35')],qs[_0xdedd('0x34')](_0x575e6e[_0xdedd('0x30')][_0xdedd('0x34')]));_0x283ee2['attributes']=_0x283ee2['attributes']['length']?_0x283ee2[_0xdedd('0x33')]:_0xc83fa0[_0xdedd('0x35')];if(!_0x575e6e[_0xdedd('0x30')][_0xdedd('0x36')](_0xdedd('0x37'))){_0x283ee2['limit']=qs['limit'](_0x575e6e[_0xdedd('0x30')]['limit']);_0x283ee2[_0xdedd('0x1e')]=qs[_0xdedd('0x1e')](_0x575e6e[_0xdedd('0x30')][_0xdedd('0x1e')]);}_0x283ee2[_0xdedd('0x38')]=qs[_0xdedd('0x39')](_0x575e6e['query']['sort']);_0x283ee2['where']=qs['filters'](_[_0xdedd('0x3c')](_0x575e6e[_0xdedd('0x30')],_0xc83fa0[_0xdedd('0x3b')]));_0x283ee2[_0xdedd('0x3a')]['ListId']=_0x46c0b8['id'];if(_0x575e6e[_0xdedd('0x30')]['filter']){_0x283ee2[_0xdedd('0x3a')]=_[_0xdedd('0x3d')](_0x283ee2[_0xdedd('0x3a')],{'$or':_['map'](_0x283ee2[_0xdedd('0x33')],function(_0x24e32e){var _0x387bcc={};_0x387bcc[_0x24e32e]={'$like':'%'+_0x575e6e[_0xdedd('0x30')]['filter']+'%'};return _0x387bcc;})});}_0x283ee2=_[_0xdedd('0x3d')]({},_0x283ee2,_0x575e6e['options']);return db[_0xdedd('0x57')][_0xdedd('0x21')]({'where':_0x283ee2[_0xdedd('0x3a')]})[_0xdedd('0x24')](function(_0x394e0e){_0x5f4841[_0xdedd('0x21')]=_0x394e0e;if(_0x575e6e[_0xdedd('0x30')][_0xdedd('0x41')]){_0x283ee2[_0xdedd('0x42')]=[{'all':!![]}];}return db[_0xdedd('0x57')][_0xdedd('0x43')](_0x283ee2);})[_0xdedd('0x24')](function(_0xb8833a){_0x5f4841['rows']=_0xb8833a;return _0x5f4841;});}})['then'](respondWithFilteredResult(_0x7e4602,_0x283ee2))[_0xdedd('0x45')](handleError(_0x7e4602,null));};exports['removeDispositions']=function(_0x54f7bf,_0x1b4e02,_0x6e8ade){return db['CmList'][_0xdedd('0x50')]({'where':{'id':_0x54f7bf[_0xdedd('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b4e02,null))['then'](function(_0x2d7208){if(_0x2d7208){return _0x2d7208['removeDispositions'](_0x54f7bf[_0xdedd('0x30')]['ids']);}})[_0xdedd('0x24')](respondWithStatusCode(_0x1b4e02,null))[_0xdedd('0x45')](handleError(_0x1b4e02,null));};exports[_0xdedd('0x5a')]=function(_0x233a71,_0x19b6cb,_0xb29b80){return db[_0xdedd('0x2b')][_0xdedd('0x50')]({'where':{'id':_0x233a71[_0xdedd('0x47')]['id']}})[_0xdedd('0x24')](handleEntityNotFound(_0x19b6cb,null))[_0xdedd('0x24')](function(_0x48750d){if(_0x48750d){var _0x491bb1=[];var _0x5500cc={'success':[],'errors':[]};return db[_0xdedd('0x5b')][_0xdedd('0x54')]()['then'](function(_0x431411){if(_0x233a71[_0xdedd('0x4a')][_0xdedd('0x5c')]&&_[_0xdedd('0x5d')](_0x233a71[_0xdedd('0x4a')][_0xdedd('0x5c')])){if(_0x233a71[_0xdedd('0x4a')]['tags'][_0xdedd('0x48')]){_0x233a71['body'][_0xdedd('0x5c')]=_0x233a71[_0xdedd('0x4a')]['tags'][_0xdedd('0x5e')](';')+';';}else{_0x233a71['body'][_0xdedd('0x5c')]=null;}}else{_0x233a71[_0xdedd('0x4a')][_0xdedd('0x5c')]=null;}if(_0x233a71[_0xdedd('0x4a')]&&_[_0xdedd('0x5d')](_0x233a71[_0xdedd('0x4a')])){for(var _0x26c342=0x0;_0x26c342<_0x233a71[_0xdedd('0x4a')][_0xdedd('0x48')];_0x26c342+=0x1){_0x233a71[_0xdedd('0x4a')][_0x26c342][_0xdedd('0x56')]=_0x233a71['params']['id'];_0x491bb1[_0xdedd('0x5f')](_0x233a71[_0xdedd('0x4a')][_0x26c342]);}return BPromise[_0xdedd('0x60')](_0x491bb1,function(_0x2b390b){return db['CmContact'][_0xdedd('0x49')](_[_0xdedd('0x61')](_0x2b390b,['ids','id'])||{},{'fields':_[_0xdedd('0x31')](_0x431411),'raw':!![]})['then'](function(_0x1b6c79){_0x5500cc[_0xdedd('0x62')][_0xdedd('0x5f')](_0x1b6c79[_0xdedd('0x63')]);})['catch'](function(_0x565ed8){_0x5500cc[_0xdedd('0x64')][_0xdedd('0x5f')]({'data':_0x2b390b,'error':_0x565ed8[_0xdedd('0x65')]});});})[_0xdedd('0x24')](function(_0x1a81a8){return _0x5500cc;})['catch'](function(_0x9d6c1f){return _0x9d6c1f;});}else{_0x19b6cb[_0xdedd('0x1c')](0x190)[_0xdedd('0x1d')]({'message':_0xdedd('0x66')});}});}})[_0xdedd('0x24')](respondWithResult(_0x19b6cb,null))['catch'](handleError(_0x19b6cb,null));};exports[_0xdedd('0x67')]=function(_0xed425a,_0x3d1379,_0x2c9e58){var _0xddef41;return db['CmList'][_0xdedd('0x50')]({'where':{'id':_0xed425a['params']['id']},'include':[{'model':db[_0xdedd('0x68')],'as':_0xdedd('0x69')}]})[_0xdedd('0x24')](handleEntityNotFound(_0x3d1379,null))['then'](function(_0x25e94d){if(_0x25e94d){_0xddef41=_0x25e94d;return db['CmContact'][_0xdedd('0x2c')];}})[_0xdedd('0x24')](function(_0x50ea59){if(_0x50ea59){var _0x3dfd01={};var _0x9eabc7={};_0x9eabc7[_0xdedd('0x35')]=_[_0xdedd('0x6a')](_[_0xdedd('0x31')](_0x50ea59),_[_0xdedd('0x2a')](_0xddef41[_0xdedd('0x69')],function(_0x4574e0){return util['format'](_0xdedd('0x6b'),_0x4574e0['id']);}));_0x9eabc7[_0xdedd('0x30')]=_[_0xdedd('0x31')](_0xed425a[_0xdedd('0x30')]);_0x9eabc7[_0xdedd('0x3b')]=_[_0xdedd('0x32')](_0x9eabc7[_0xdedd('0x35')],_0x9eabc7[_0xdedd('0x30')]);_0x3dfd01[_0xdedd('0x33')]=_[_0xdedd('0x32')](_0x9eabc7['model'],qs['fields'](_0xed425a[_0xdedd('0x30')]['fields']));_0x3dfd01['attributes']=_0x3dfd01[_0xdedd('0x33')][_0xdedd('0x48')]?_0x3dfd01[_0xdedd('0x33')]:_0x9eabc7[_0xdedd('0x35')];if(!_0xed425a[_0xdedd('0x30')][_0xdedd('0x36')]('nolimit')){_0x3dfd01[_0xdedd('0x1f')]=qs['limit'](_0xed425a['query'][_0xdedd('0x1f')]);_0x3dfd01[_0xdedd('0x1e')]=qs[_0xdedd('0x1e')](_0xed425a['query'][_0xdedd('0x1e')]);}_0x3dfd01[_0xdedd('0x38')]=qs[_0xdedd('0x39')](_0xed425a[_0xdedd('0x30')][_0xdedd('0x39')]);_0x3dfd01[_0xdedd('0x3a')]=qs[_0xdedd('0x3b')](_[_0xdedd('0x3c')](_0xed425a[_0xdedd('0x30')],_0x9eabc7['filters']));_0x3dfd01[_0xdedd('0x6c')]=!![];if(_0xed425a[_0xdedd('0x30')]['filter']){_0x3dfd01[_0xdedd('0x3a')]=_[_0xdedd('0x3d')](_0x3dfd01[_0xdedd('0x3a')],{'$or':_['map'](_0x3dfd01[_0xdedd('0x33')],function(_0x1ae928){var _0x43f40a={};_0x43f40a[_0x1ae928]={'$like':'%'+_0xed425a['query'][_0xdedd('0x3f')]+'%'};return _0x43f40a;})});}_0x3dfd01=_[_0xdedd('0x3d')]({},_0x3dfd01,_0xed425a[_0xdedd('0x40')]);return _0xddef41[_0xdedd('0x67')](_0x3dfd01);}})[_0xdedd('0x24')](respondWithResult(_0x3d1379,null))[_0xdedd('0x45')](handleError(_0x3d1379,null));};exports[_0xdedd('0x6d')]=function(_0xfb9948,_0x3a4f1b,_0x1c4705){var _0x2dd9b1;var _0x21c777;var _0x4f4226;var _0x85274f=_0xfb9948[_0xdedd('0x47')]['id'];csv_results=[];return db[_0xdedd('0x6e')][_0xdedd('0x43')]({'attributes':['id',_0xdedd('0x27')],'raw':!![],'order':[_0xdedd('0x6f')]})[_0xdedd('0x24')](function(_0x421c90){_0x2dd9b1=_0x421c90;var _0x3b9e27=_[_0xdedd('0x31')](db[_0xdedd('0x5b')][_0xdedd('0x2c')]);return db[_0xdedd('0x68')][_0xdedd('0x43')]({'raw':!![],'attributes':['id',_0xdedd('0x70')]})[_0xdedd('0x24')](function(_0xd223dd){_0x21c777=_0xd223dd;var _0x57f8cb=squel[_0xdedd('0x71')]()[_0xdedd('0x34')](_0x3b9e27)[_0xdedd('0x72')](_0xdedd('0x73'),'c')['where'](_0xdedd('0x74'),_0x85274f)['where']('c.deletedAt\x20is\x20null')[_0xdedd('0x75')]();for(var _0x4db5ed=0x0;_0x4db5ed<_0x21c777['length'];_0x4db5ed++){_0x57f8cb[_0xdedd('0x76')](_0xdedd('0x77')+_0x21c777[_0x4db5ed]['id'],'customField_'+_0x21c777[_0x4db5ed]['alias']);}for(var _0x4db5ed=0x0;_0x4db5ed<_0x2dd9b1[_0xdedd('0x48')];_0x4db5ed++){_0x57f8cb[_0xdedd('0x76')](squel[_0xdedd('0x71')]()[_0xdedd('0x76')](_0xdedd('0x78'))[_0xdedd('0x72')](_0xdedd('0x79'))[_0xdedd('0x3a')]('ItemTypeId\x20=\x20?',_0x2dd9b1[_0x4db5ed]['id'])[_0xdedd('0x3a')](_0xdedd('0x7a')),_0xdedd('0x7b')+_0x2dd9b1[_0x4db5ed]['name']);_0x57f8cb['field'](squel['select']()['field'](_0xdedd('0x7c'))[_0xdedd('0x72')](_0xdedd('0x79'))[_0xdedd('0x3a')](_0xdedd('0x7d'),_0x2dd9b1[_0x4db5ed]['id'])['where'](_0xdedd('0x7a')),_0xdedd('0x7e')+_0x2dd9b1[_0x4db5ed][_0xdedd('0x27')]);}var _0xa4a1e6=[];_0xa4a1e6['push'](_0x57f8cb[_0xdedd('0x7f')]());BPromise[_0xdedd('0x60')](_0xa4a1e6,handleQuery)[_0xdedd('0x24')](function(_0x47b2e9){handleQuery(_0x57f8cb[_0xdedd('0x7f')]());var _0x362847=csv_results[0x0];if(!_[_0xdedd('0x80')](_0x362847)){var _0x524e1f=toCsv(_0x362847);var _0x33e57c=Date['now']();fs[_0xdedd('0x81')](util[_0xdedd('0x82')](_0xdedd('0x83'),_0x85274f,_0x33e57c),_0x524e1f);_0x3a4f1b[_0xdedd('0x84')](_0xdedd('0x85'),_0xdedd('0x86')+util['format'](_0xdedd('0x87'),_0x85274f,_0x33e57c));_0x3a4f1b['setHeader'](_0xdedd('0x88'),_0xdedd('0x89'));return _0x3a4f1b[_0xdedd('0x8a')](util[_0xdedd('0x82')](_0xdedd('0x83'),_0x85274f,_0x33e57c));}else{return _0x3a4f1b[_0xdedd('0x8b')](0xcc);}});});});};exports[_0xdedd('0x8c')]=function(_0x351494,_0x5d1abd,_0x4ee521){var _0x4f7b5b;delete _0x351494['body']['id'];return db[_0xdedd('0x2b')][_0xdedd('0x59')]({'where':{'id':_0x351494[_0xdedd('0x47')]['id']}})[_0xdedd('0x24')](handleEntityNotFound(_0x5d1abd,null))['then'](function(_0x2b0564){if(_0x2b0564){return db[_0xdedd('0x8d')][_0xdedd('0x8e')](function(_0x5469c8){return db[_0xdedd('0x68')][_0xdedd('0x49')](_0x351494['body'],{'transaction':_0x5469c8})[_0xdedd('0x24')](function(_0x3f89f9){_0x4f7b5b=_0x3f89f9;return _0x2b0564[_0xdedd('0x8f')](_0x3f89f9,{'transaction':_0x5469c8});})['then'](function(){var _0x56b0de={'type':db[_0xdedd('0x90')][_0xdedd('0x91')],'transaction':_0x5469c8};switch(_0x351494[_0xdedd('0x4a')][_0xdedd('0x2e')]){case _0xdedd('0x92'):_0x56b0de[_0xdedd('0x2e')]=db[_0xdedd('0x90')][_0xdedd('0x91')];break;case _0xdedd('0x93'):_0x56b0de[_0xdedd('0x2e')]=db[_0xdedd('0x90')][_0xdedd('0x94')];break;case'switch':_0x56b0de[_0xdedd('0x2e')]=db['Sequelize'][_0xdedd('0x95')];_0x56b0de[_0xdedd('0x96')]=![];break;default:}return db['sequelize']['queryInterface'][_0xdedd('0x97')](_0xdedd('0x73'),util['format'](_0xdedd('0x98'),_0x4f7b5b['id']),_0x56b0de);})['then'](function(){return _0x4f7b5b;});});}})[_0xdedd('0x24')](respondWithResult(_0x5d1abd,null))[_0xdedd('0x45')](handleError(_0x5d1abd,null));};exports['getCustomFields']=function(_0x548cfb,_0x2f608e,_0x4530c9){var _0x19bec0={};var _0x3f8af1={};var _0x34353e;var _0x35539a;return db[_0xdedd('0x2b')][_0xdedd('0x59')]({'where':{'id':_0x548cfb[_0xdedd('0x47')]['id']}})[_0xdedd('0x24')](handleEntityNotFound(_0x2f608e,null))[_0xdedd('0x24')](function(_0x37ee81){if(_0x37ee81){_0x34353e=_0x37ee81;_0x3f8af1['model']=_['keys'](db[_0xdedd('0x68')]['rawAttributes']);_0x3f8af1[_0xdedd('0x30')]=_['keys'](_0x548cfb['query']);_0x3f8af1[_0xdedd('0x3b')]=_[_0xdedd('0x32')](_0x3f8af1['model'],_0x3f8af1[_0xdedd('0x30')]);_0x19bec0[_0xdedd('0x33')]=_[_0xdedd('0x32')](_0x3f8af1[_0xdedd('0x35')],qs[_0xdedd('0x34')](_0x548cfb['query'][_0xdedd('0x34')]));_0x19bec0['attributes']=_0x19bec0['attributes'][_0xdedd('0x48')]?_0x19bec0[_0xdedd('0x33')]:_0x3f8af1[_0xdedd('0x35')];_0x19bec0[_0xdedd('0x38')]=qs[_0xdedd('0x39')](_0x548cfb[_0xdedd('0x30')][_0xdedd('0x39')]);_0x19bec0['where']=qs[_0xdedd('0x3b')](_[_0xdedd('0x3c')](_0x548cfb[_0xdedd('0x30')],_0x3f8af1[_0xdedd('0x3b')]));_0x19bec0[_0xdedd('0x3a')]=_[_0xdedd('0x3d')](_0x19bec0[_0xdedd('0x3a')],{'$or':[{'ListId':_0x37ee81['id']},{'ListId':null}]});if(_0x548cfb['query'][_0xdedd('0x3f')]){_0x19bec0['where']=_[_0xdedd('0x3d')](_0x19bec0['where'],{'$or':_[_0xdedd('0x2a')](_0x19bec0['attributes'],function(_0x4cf1e8){var _0x4f7c85={};_0x4f7c85[_0x4cf1e8]={'$like':'%'+_0x548cfb['query'][_0xdedd('0x3f')]+'%'};return _0x4f7c85;})});}_0x19bec0=_[_0xdedd('0x3d')]({},_0x19bec0,_0x548cfb[_0xdedd('0x40')]);return db[_0xdedd('0x68')][_0xdedd('0x99')](_0x19bec0);}})[_0xdedd('0x24')](respondWithResult(_0x2f608e,null))['catch'](handleError(_0x2f608e,null));};exports['getGlobalCustomFields']=function(_0x580478,_0x349cf0){return db[_0xdedd('0x68')][_0xdedd('0x99')]({'where':{'ListId':null}})[_0xdedd('0x24')](handleEntityNotFound(_0x349cf0,null))[_0xdedd('0x24')](function(_0x41c0e3){return _0x41c0e3;})['then'](respondWithResult(_0x349cf0,null))[_0xdedd('0x45')](handleError(_0x349cf0,null));};exports[_0xdedd('0x9a')]=function(_0x27a928,_0x3eabab,_0xdf55ab){return db[_0xdedd('0x2b')][_0xdedd('0x50')]({'where':{'id':_0x27a928[_0xdedd('0x47')]['id']}})['then'](handleEntityNotFound(_0x3eabab,null))[_0xdedd('0x24')](function(_0x551552){if(_0x551552){return _0x551552['addAgents'](_0x27a928['body'][_0xdedd('0x9b')],_[_0xdedd('0x61')](_0x27a928[_0xdedd('0x4a')],[_0xdedd('0x9b'),'id'])||{})['spread'](function(_0x180687){for(var _0xc156fb=0x0;_0xc156fb<_0x27a928['body'][_0xdedd('0x9b')][_0xdedd('0x48')];_0xc156fb+=0x1){socket[_0xdedd('0x9c')](_0xdedd('0x9d'),{'UserId':Number(_0x27a928[_0xdedd('0x4a')][_0xdedd('0x9b')][_0xc156fb]),'CmListId':Number(_0x27a928[_0xdedd('0x47')]['id'])});}return _0x180687;});}})[_0xdedd('0x24')](respondWithResult(_0x3eabab,null))[_0xdedd('0x45')](handleError(_0x3eabab,null));};exports['removeAgents']=function(_0x51af64,_0x3f660d,_0x2815f9){return db['CmList'][_0xdedd('0x50')]({'where':{'id':_0x51af64[_0xdedd('0x47')]['id']}})[_0xdedd('0x24')](handleEntityNotFound(_0x3f660d,null))['then'](function(_0x346ee4){if(_0x346ee4){return _0x346ee4['removeAgents'](_0x51af64['query'][_0xdedd('0x9b')])['then'](function(){if(_[_0xdedd('0x5d')](_0x51af64[_0xdedd('0x30')][_0xdedd('0x9b')])){for(var _0x2602a9=0x0;_0x2602a9<_0x51af64[_0xdedd('0x30')]['ids'][_0xdedd('0x48')];_0x2602a9+=0x1){socket['emit'](_0xdedd('0x9e'),{'UserId':Number(_0x51af64[_0xdedd('0x30')]['ids'][_0x2602a9]),'CmListId':Number(_0x51af64[_0xdedd('0x47')]['id'])});}}else{socket[_0xdedd('0x9c')](_0xdedd('0x9e'),{'UserId':Number(_0x51af64['query'][_0xdedd('0x9b')]),'CmListId':Number(_0x51af64['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3f660d,null))[_0xdedd('0x45')](handleError(_0x3f660d,null));};exports['getAgents']=function(_0x4f7f59,_0x2b858d,_0x205d8b){var _0x10d30e={};var _0x98916f={};var _0x3862f8;var _0x5b8528;return db['CmList'][_0xdedd('0x59')]({'where':{'id':_0x4f7f59[_0xdedd('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b858d,null))[_0xdedd('0x24')](function(_0x344547){if(_0x344547){_0x3862f8=_0x344547;_0x98916f[_0xdedd('0x35')]=_['keys'](db[_0xdedd('0x9f')][_0xdedd('0x2c')]);_0x98916f['query']=_[_0xdedd('0x31')](_0x4f7f59[_0xdedd('0x30')]);_0x98916f[_0xdedd('0x3b')]=_[_0xdedd('0x32')](_0x98916f[_0xdedd('0x35')],_0x98916f[_0xdedd('0x30')]);_0x10d30e[_0xdedd('0x33')]=_[_0xdedd('0x32')](_0x98916f[_0xdedd('0x35')],qs['fields'](_0x4f7f59[_0xdedd('0x30')][_0xdedd('0x34')]));_0x10d30e[_0xdedd('0x33')]=_0x10d30e[_0xdedd('0x33')]['length']?_0x10d30e[_0xdedd('0x33')]:_0x98916f[_0xdedd('0x35')];_0x10d30e[_0xdedd('0x38')]=qs[_0xdedd('0x39')](_0x4f7f59[_0xdedd('0x30')][_0xdedd('0x39')]);_0x10d30e[_0xdedd('0x3a')]=qs[_0xdedd('0x3b')](_['pick'](_0x4f7f59['query'],_0x98916f[_0xdedd('0x3b')]));if(_0x4f7f59[_0xdedd('0x30')][_0xdedd('0x3f')]){_0x10d30e[_0xdedd('0x3a')]=_[_0xdedd('0x3d')](_0x10d30e[_0xdedd('0x3a')],{'$or':_[_0xdedd('0x2a')](_0x10d30e[_0xdedd('0x33')],function(_0xb1f599){var _0x2cc716={};_0x2cc716[_0xb1f599]={'$like':'%'+_0x4f7f59[_0xdedd('0x30')]['filter']+'%'};return _0x2cc716;})});}_0x10d30e=_[_0xdedd('0x3d')]({},_0x10d30e,_0x4f7f59[_0xdedd('0x40')]);return _0x3862f8['getAgents'](_0x10d30e);}})[_0xdedd('0x24')](function(_0x36eb80){if(_0x36eb80){_0x5b8528=_0x36eb80[_0xdedd('0x48')];if(!_0x4f7f59['query'][_0xdedd('0x36')](_0xdedd('0x37'))){_0x10d30e[_0xdedd('0x1f')]=qs['limit'](_0x4f7f59[_0xdedd('0x30')][_0xdedd('0x1f')]);_0x10d30e[_0xdedd('0x1e')]=qs[_0xdedd('0x1e')](_0x4f7f59[_0xdedd('0x30')]['offset']);}return _0x3862f8[_0xdedd('0xa0')](_0x10d30e);}})['then'](function(_0x315938){if(_0x315938){return _0x315938?{'count':_0x5b8528,'rows':_0x315938}:null;}})[_0xdedd('0x24')](respondWithResult(_0x2b858d,null))[_0xdedd('0x45')](handleError(_0x2b858d,null));};function handleQuery(_0x548aac){logger[_0xdedd('0xa1')](_0x548aac);return db[_0xdedd('0x8d')][_0xdedd('0x30')](_0x548aac)[_0xdedd('0xa2')](function(_0x9d05b3){csv_results[_0xdedd('0x5f')](_0x9d05b3);})[_0xdedd('0x45')](function(_0xb44d1a){logger[_0xdedd('0x52')](_0xb44d1a['message']);});} \ No newline at end of file +var _0x7b8a=['status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','get','Lists','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','CmList','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','limit','rows','removeDispositions','addContacts','CmContact','tags','isArray','push','each','omit','success','dataValues','errors','message','concat','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','findAll','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description','toString','isEmpty','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','sequelize','transaction','CmCustomField','addCustomFields','TEXT','text','number','INTEGER','switch','Sequelize','defaultValue','findAndCountAll','getGlobalCustomFields','addAgents','ids','spread','userCmList:save','removeAgents','userCmList:remove','emit','getAgents','User','info','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','localhost','./cmList.socket','register','sendStatus'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0x7b8a,0x11f));var _0xa7b8=function(_0x17a647,_0x2bbe12){_0x17a647=_0x17a647-0x0;var _0x219a38=_0x7b8a[_0x17a647];return _0x219a38;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7b8('0x0'));var zipdir=require(_0xa7b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7b8('0x2'));var moment=require(_0xa7b8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa7b8('0x4'));var util=require(_0xa7b8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa7b8('0x6'));var ejs=require(_0xa7b8('0x7'));var fs=require('fs');var fs_extra=require(_0xa7b8('0x8'));var _=require(_0xa7b8('0x9'));var squel=require(_0xa7b8('0xa'));var crypto=require('crypto');var jsforce=require(_0xa7b8('0xb'));var deskjs=require(_0xa7b8('0xc'));var toCsv=require(_0xa7b8('0x6'));var querystring=require(_0xa7b8('0xd'));var Papa=require(_0xa7b8('0xe'));var Redis=require(_0xa7b8('0xf'));var authService=require(_0xa7b8('0x10'));var qs=require(_0xa7b8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7b8('0x12'));var logger=require(_0xa7b8('0x13'))(_0xa7b8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa7b8('0x15'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xa7b8('0x16')]=_['defaults'](config[_0xa7b8('0x16')],{'host':_0xa7b8('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7b8('0x16')]));require(_0xa7b8('0x18'))[_0xa7b8('0x19')](socket);function respondWithStatusCode(_0x4f32b4,_0x2493d8){_0x2493d8=_0x2493d8||0xcc;return function(_0x395124){if(_0x395124){return _0x4f32b4[_0xa7b8('0x1a')](_0x2493d8);}return _0x4f32b4[_0xa7b8('0x1b')](_0x2493d8)[_0xa7b8('0x1c')]();};}function respondWithResult(_0x45549e,_0x2847ce){_0x2847ce=_0x2847ce||0xc8;return function(_0x1daf54){if(_0x1daf54){return _0x45549e[_0xa7b8('0x1b')](_0x2847ce)[_0xa7b8('0x1d')](_0x1daf54);}};}function respondWithFilteredResult(_0x98ef38,_0x22a94a){return function(_0x51e61b){if(_0x51e61b){var _0x3bef50=typeof _0x22a94a[_0xa7b8('0x1e')]==='undefined'&&typeof _0x22a94a['limit']===_0xa7b8('0x1f');var _0x14b50c=_0x51e61b[_0xa7b8('0x20')];var _0x35fbbb=_0x3bef50?0x0:_0x22a94a['offset'];var _0x200003=_0x3bef50?_0x51e61b[_0xa7b8('0x20')]:_0x22a94a[_0xa7b8('0x1e')]+_0x22a94a['limit'];var _0x2607ab;if(_0x200003>=_0x14b50c){_0x200003=_0x14b50c;_0x2607ab=0xc8;}else{_0x2607ab=0xce;}_0x98ef38[_0xa7b8('0x1b')](_0x2607ab);return _0x98ef38['set'](_0xa7b8('0x21'),_0x35fbbb+'-'+_0x200003+'/'+_0x14b50c)['json'](_0x51e61b);}return null;};}function patchUpdates(_0x45891b){return function(_0x767e5c){try{jsonpatch[_0xa7b8('0x22')](_0x767e5c,_0x45891b,!![]);}catch(_0x24974c){return BPromise[_0xa7b8('0x23')](_0x24974c);}return _0x767e5c['save']();};}function saveUpdates(_0x4bf533,_0x3395a3){return function(_0x200749){if(_0x200749){return _0x200749[_0xa7b8('0x24')](_0x4bf533)[_0xa7b8('0x25')](function(_0x23847f){return _0x23847f;});}return null;};}function removeEntity(_0x3d3320,_0x5860f8){return function(_0x4b648a){if(_0x4b648a){return _0x4b648a[_0xa7b8('0x26')]()['then'](function(){var _0x808478=_0x4b648a[_0xa7b8('0x27')]({'plain':!![]});var _0x118e30=_0xa7b8('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x118e30,'resourceId':_0x808478['id']}})[_0xa7b8('0x25')](function(){return _0x4b648a;});})[_0xa7b8('0x25')](function(){_0x3d3320[_0xa7b8('0x1b')](0xcc)[_0xa7b8('0x1c')]();});}};}function handleEntityNotFound(_0x372b81,_0x5beb2f){return function(_0x266f7e){if(!_0x266f7e){_0x372b81[_0xa7b8('0x1a')](0x194);}return _0x266f7e;};}function handleError(_0x1317f0,_0x9fe87e){_0x9fe87e=_0x9fe87e||0x1f4;return function(_0x410773){logger[_0xa7b8('0x29')](_0x410773[_0xa7b8('0x2a')]);if(_0x410773[_0xa7b8('0x2b')]){delete _0x410773[_0xa7b8('0x2b')];}_0x1317f0['status'](_0x9fe87e)[_0xa7b8('0x2c')](_0x410773);};}exports[_0xa7b8('0x2d')]=function(_0x36c5b1,_0xacef9f){var _0x3f5e94={},_0xcd927b={},_0x1c4fe1={'count':0x0,'rows':[]};var _0x19f5e4=_[_0xa7b8('0x2e')](db['CmList'][_0xa7b8('0x2f')],function(_0x57bfef){return{'name':_0x57bfef[_0xa7b8('0x30')],'type':_0x57bfef[_0xa7b8('0x31')]['key']};});_0xcd927b[_0xa7b8('0x32')]=_[_0xa7b8('0x2e')](_0x19f5e4,_0xa7b8('0x2b'));_0xcd927b['query']=_[_0xa7b8('0x33')](_0x36c5b1[_0xa7b8('0x34')]);_0xcd927b[_0xa7b8('0x35')]=_[_0xa7b8('0x36')](_0xcd927b[_0xa7b8('0x32')],_0xcd927b[_0xa7b8('0x34')]);_0x3f5e94[_0xa7b8('0x37')]=_[_0xa7b8('0x36')](_0xcd927b[_0xa7b8('0x32')],qs[_0xa7b8('0x38')](_0x36c5b1[_0xa7b8('0x34')][_0xa7b8('0x38')]));_0x3f5e94[_0xa7b8('0x37')]=_0x3f5e94[_0xa7b8('0x37')][_0xa7b8('0x39')]?_0x3f5e94[_0xa7b8('0x37')]:_0xcd927b['model'];if(!_0x36c5b1[_0xa7b8('0x34')][_0xa7b8('0x3a')](_0xa7b8('0x3b'))){_0x3f5e94['limit']=qs['limit'](_0x36c5b1[_0xa7b8('0x34')]['limit']);_0x3f5e94[_0xa7b8('0x1e')]=qs[_0xa7b8('0x1e')](_0x36c5b1[_0xa7b8('0x34')][_0xa7b8('0x1e')]);}_0x3f5e94[_0xa7b8('0x3c')]=qs[_0xa7b8('0x3d')](_0x36c5b1['query'][_0xa7b8('0x3d')]);_0x3f5e94[_0xa7b8('0x3e')]=qs[_0xa7b8('0x35')](_[_0xa7b8('0x3f')](_0x36c5b1[_0xa7b8('0x34')],_0xcd927b[_0xa7b8('0x35')]),_0x19f5e4);if(_0x36c5b1[_0xa7b8('0x34')][_0xa7b8('0x40')]){_0x3f5e94['where']=_['merge'](_0x3f5e94['where'],{'$or':_[_0xa7b8('0x2e')](_0x19f5e4,function(_0x32fe03){if(_0x32fe03[_0xa7b8('0x31')]!==_0xa7b8('0x41')){var _0x5620d3={};_0x5620d3[_0x32fe03[_0xa7b8('0x2b')]]={'$like':'%'+_0x36c5b1[_0xa7b8('0x34')]['filter']+'%'};return _0x5620d3;}})});}_0x3f5e94=_[_0xa7b8('0x42')]({},_0x3f5e94,_0x36c5b1[_0xa7b8('0x43')]);var _0x5ed6b9={'where':_0x3f5e94['where']};return db['CmList'][_0xa7b8('0x20')](_0x5ed6b9)[_0xa7b8('0x25')](function(_0x328825){_0x1c4fe1[_0xa7b8('0x20')]=_0x328825;if(_0x36c5b1[_0xa7b8('0x34')]['includeAll']){_0x3f5e94[_0xa7b8('0x44')]=[{'all':!![]}];}return db[_0xa7b8('0x45')]['findAll'](_0x3f5e94);})[_0xa7b8('0x25')](function(_0x10f02a){_0x1c4fe1['rows']=_0x10f02a;return _0x1c4fe1;})['then'](respondWithFilteredResult(_0xacef9f,_0x3f5e94))[_0xa7b8('0x46')](handleError(_0xacef9f,null));};exports[_0xa7b8('0x47')]=function(_0x1189e2,_0xf16fc1){var _0x4d2f87={'raw':![],'where':{'id':_0x1189e2['params']['id']}},_0x458cb1={};_0x458cb1[_0xa7b8('0x32')]=_['keys'](db[_0xa7b8('0x45')][_0xa7b8('0x2f')]);_0x458cb1[_0xa7b8('0x34')]=_[_0xa7b8('0x33')](_0x1189e2[_0xa7b8('0x34')]);_0x458cb1['filters']=_[_0xa7b8('0x36')](_0x458cb1[_0xa7b8('0x32')],_0x458cb1[_0xa7b8('0x34')]);_0x4d2f87['attributes']=_[_0xa7b8('0x36')](_0x458cb1[_0xa7b8('0x32')],qs['fields'](_0x1189e2[_0xa7b8('0x34')][_0xa7b8('0x38')]));_0x4d2f87[_0xa7b8('0x37')]=_0x4d2f87[_0xa7b8('0x37')][_0xa7b8('0x39')]?_0x4d2f87[_0xa7b8('0x37')]:_0x458cb1[_0xa7b8('0x32')];if(_0x1189e2[_0xa7b8('0x34')][_0xa7b8('0x48')]){_0x4d2f87[_0xa7b8('0x44')]=[{'all':!![]}];}_0x4d2f87=_['merge']({},_0x4d2f87,_0x1189e2['options']);return db[_0xa7b8('0x45')][_0xa7b8('0x49')](_0x4d2f87)[_0xa7b8('0x25')](handleEntityNotFound(_0xf16fc1,null))[_0xa7b8('0x25')](respondWithResult(_0xf16fc1,null))['catch'](handleError(_0xf16fc1,null));};exports[_0xa7b8('0x4a')]=function(_0x34a30b,_0x3b31c5){return db[_0xa7b8('0x45')][_0xa7b8('0x4a')](_0x34a30b[_0xa7b8('0x4b')],{})[_0xa7b8('0x25')](function(_0x10a025){var _0x44b538=_0x34a30b[_0xa7b8('0x4c')][_0xa7b8('0x27')]({'plain':!![]});if(!_0x44b538)throw new Error(_0xa7b8('0x4d'));if(_0x44b538['role']===_0xa7b8('0x4c')){var _0x380e4e=_0x10a025[_0xa7b8('0x27')]({'plain':!![]});var _0x230d99=_0xa7b8('0x28');return db[_0xa7b8('0x4e')][_0xa7b8('0x49')]({'where':{'name':_0x230d99,'userProfileId':_0x44b538['userProfileId']},'raw':!![]})['then'](function(_0x2f666f){if(_0x2f666f&&_0x2f666f['autoAssociation']===0x0){return db[_0xa7b8('0x4f')][_0xa7b8('0x4a')]({'name':_0x380e4e[_0xa7b8('0x2b')],'resourceId':_0x380e4e['id'],'type':_0x2f666f[_0xa7b8('0x2b')],'sectionId':_0x2f666f['id']},{})[_0xa7b8('0x25')](function(){return _0x10a025;});}else{return _0x10a025;}})['catch'](function(_0x5baf0){logger[_0xa7b8('0x29')](_0xa7b8('0x50'),_0x5baf0);throw _0x5baf0;});}return _0x10a025;})[_0xa7b8('0x25')](respondWithResult(_0x3b31c5,0xc9))[_0xa7b8('0x46')](handleError(_0x3b31c5,null));};exports[_0xa7b8('0x24')]=function(_0x201e47,_0x416d43){if(_0x201e47[_0xa7b8('0x4b')]['id']){delete _0x201e47[_0xa7b8('0x4b')]['id'];}return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x201e47[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x416d43,null))['then'](saveUpdates(_0x201e47['body'],null))[_0xa7b8('0x25')](respondWithResult(_0x416d43,null))['catch'](handleError(_0x416d43,null));};exports[_0xa7b8('0x26')]=function(_0x32e48e,_0x1ba695){return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x32e48e[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x1ba695,null))['then'](removeEntity(_0x1ba695,null))['catch'](handleError(_0x1ba695,null));};exports[_0xa7b8('0x52')]=function(_0x49c1ef,_0x369b3a){return db[_0xa7b8('0x45')][_0xa7b8('0x52')]()[_0xa7b8('0x25')](respondWithResult(_0x369b3a,null))[_0xa7b8('0x46')](handleError(_0x369b3a,null));};exports[_0xa7b8('0x53')]=function(_0x3d7cac,_0x3e0e80,_0x188523){if(_0x3d7cac[_0xa7b8('0x4b')]['id']){delete _0x3d7cac[_0xa7b8('0x4b')]['id'];}return db['CmList'][_0xa7b8('0x49')]({'where':{'id':_0x3d7cac[_0xa7b8('0x51')]['id']}})['then'](handleEntityNotFound(_0x3e0e80,null))['then'](function(_0x354d62){if(_0x354d62){_0x3d7cac['body'][_0xa7b8('0x54')]=_0x354d62['id'];return db[_0xa7b8('0x55')][_0xa7b8('0x4a')](_0x3d7cac[_0xa7b8('0x4b')]);}})['then'](respondWithResult(_0x3e0e80,null))[_0xa7b8('0x46')](handleError(_0x3e0e80,null));};exports[_0xa7b8('0x56')]=function(_0x2a7d28,_0x5153ac,_0x571821){var _0x3187c0={'raw':![],'where':{}};var _0x58bfaa={};var _0x1ba308={'count':0x0,'rows':[]};return db[_0xa7b8('0x45')][_0xa7b8('0x57')]({'where':{'id':_0x2a7d28[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x5153ac,null))[_0xa7b8('0x25')](function(_0x54819b){if(_0x54819b){_0x58bfaa['model']=_[_0xa7b8('0x33')](db[_0xa7b8('0x55')][_0xa7b8('0x2f')]);_0x58bfaa['query']=_[_0xa7b8('0x33')](_0x2a7d28['query']);_0x58bfaa['filters']=_[_0xa7b8('0x36')](_0x58bfaa[_0xa7b8('0x32')],_0x58bfaa[_0xa7b8('0x34')]);_0x3187c0['attributes']=_[_0xa7b8('0x36')](_0x58bfaa[_0xa7b8('0x32')],qs[_0xa7b8('0x38')](_0x2a7d28[_0xa7b8('0x34')]['fields']));_0x3187c0[_0xa7b8('0x37')]=_0x3187c0[_0xa7b8('0x37')][_0xa7b8('0x39')]?_0x3187c0['attributes']:_0x58bfaa['model'];if(!_0x2a7d28[_0xa7b8('0x34')][_0xa7b8('0x3a')](_0xa7b8('0x3b'))){_0x3187c0[_0xa7b8('0x58')]=qs[_0xa7b8('0x58')](_0x2a7d28[_0xa7b8('0x34')][_0xa7b8('0x58')]);_0x3187c0[_0xa7b8('0x1e')]=qs[_0xa7b8('0x1e')](_0x2a7d28[_0xa7b8('0x34')]['offset']);}_0x3187c0[_0xa7b8('0x3c')]=qs[_0xa7b8('0x3d')](_0x2a7d28[_0xa7b8('0x34')][_0xa7b8('0x3d')]);_0x3187c0[_0xa7b8('0x3e')]=qs['filters'](_[_0xa7b8('0x3f')](_0x2a7d28[_0xa7b8('0x34')],_0x58bfaa[_0xa7b8('0x35')]));_0x3187c0[_0xa7b8('0x3e')]['ListId']=_0x54819b['id'];if(_0x2a7d28[_0xa7b8('0x34')][_0xa7b8('0x40')]){_0x3187c0[_0xa7b8('0x3e')]=_[_0xa7b8('0x42')](_0x3187c0[_0xa7b8('0x3e')],{'$or':_[_0xa7b8('0x2e')](_0x3187c0[_0xa7b8('0x37')],function(_0x44b51d){var _0x5c08cb={};_0x5c08cb[_0x44b51d]={'$like':'%'+_0x2a7d28[_0xa7b8('0x34')]['filter']+'%'};return _0x5c08cb;})});}_0x3187c0=_[_0xa7b8('0x42')]({},_0x3187c0,_0x2a7d28['options']);return db['Disposition']['count']({'where':_0x3187c0[_0xa7b8('0x3e')]})['then'](function(_0x1c5732){_0x1ba308[_0xa7b8('0x20')]=_0x1c5732;if(_0x2a7d28['query'][_0xa7b8('0x48')]){_0x3187c0[_0xa7b8('0x44')]=[{'all':!![]}];}return db[_0xa7b8('0x55')]['findAll'](_0x3187c0);})[_0xa7b8('0x25')](function(_0x4ba34f){_0x1ba308[_0xa7b8('0x59')]=_0x4ba34f;return _0x1ba308;});}})[_0xa7b8('0x25')](respondWithFilteredResult(_0x5153ac,_0x3187c0))['catch'](handleError(_0x5153ac,null));};exports[_0xa7b8('0x5a')]=function(_0x273c27,_0x2929a6,_0x4f609f){return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x273c27['params']['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x2929a6,null))[_0xa7b8('0x25')](function(_0x4360df){if(_0x4360df){return _0x4360df['removeDispositions'](_0x273c27[_0xa7b8('0x34')]['ids']);}})[_0xa7b8('0x25')](respondWithStatusCode(_0x2929a6,null))['catch'](handleError(_0x2929a6,null));};exports[_0xa7b8('0x5b')]=function(_0x1e3ff8,_0xade684,_0x569fbc){return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x1e3ff8[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0xade684,null))[_0xa7b8('0x25')](function(_0x894bac){if(_0x894bac){var _0x582b22=[];var _0xbe717e={'success':[],'errors':[]};return db[_0xa7b8('0x5c')][_0xa7b8('0x52')]()[_0xa7b8('0x25')](function(_0x10a3dd){if(_0x1e3ff8['body'][_0xa7b8('0x5d')]&&_[_0xa7b8('0x5e')](_0x1e3ff8[_0xa7b8('0x4b')]['tags'])){if(_0x1e3ff8['body'][_0xa7b8('0x5d')]['length']){_0x1e3ff8[_0xa7b8('0x4b')][_0xa7b8('0x5d')]=_0x1e3ff8[_0xa7b8('0x4b')][_0xa7b8('0x5d')]['join'](';')+';';}else{_0x1e3ff8[_0xa7b8('0x4b')][_0xa7b8('0x5d')]=null;}}else{_0x1e3ff8[_0xa7b8('0x4b')]['tags']=null;}if(_0x1e3ff8[_0xa7b8('0x4b')]&&_[_0xa7b8('0x5e')](_0x1e3ff8[_0xa7b8('0x4b')])){for(var _0x5e5aa6=0x0;_0x5e5aa6<_0x1e3ff8['body'][_0xa7b8('0x39')];_0x5e5aa6+=0x1){_0x1e3ff8['body'][_0x5e5aa6]['ListId']=_0x1e3ff8[_0xa7b8('0x51')]['id'];_0x582b22[_0xa7b8('0x5f')](_0x1e3ff8['body'][_0x5e5aa6]);}return BPromise[_0xa7b8('0x60')](_0x582b22,function(_0x4b2963){return db[_0xa7b8('0x5c')][_0xa7b8('0x4a')](_[_0xa7b8('0x61')](_0x4b2963,['ids','id'])||{},{'fields':_[_0xa7b8('0x33')](_0x10a3dd),'raw':!![]})[_0xa7b8('0x25')](function(_0x437787){_0xbe717e[_0xa7b8('0x62')]['push'](_0x437787[_0xa7b8('0x63')]);})[_0xa7b8('0x46')](function(_0x12e05a){_0xbe717e[_0xa7b8('0x64')][_0xa7b8('0x5f')]({'data':_0x4b2963,'error':_0x12e05a[_0xa7b8('0x65')]});});})[_0xa7b8('0x25')](function(_0x3f5f0b){return _0xbe717e;})['catch'](function(_0x1861e7){return _0x1861e7;});}else{_0xade684[_0xa7b8('0x1b')](0x190)[_0xa7b8('0x1d')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0xade684,null))[_0xa7b8('0x46')](handleError(_0xade684,null));};exports['getContacts']=function(_0x2f89fc,_0x65e1bc,_0x2aafdf){var _0x40c95a;return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x2f89fc['params']['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xa7b8('0x25')](handleEntityNotFound(_0x65e1bc,null))[_0xa7b8('0x25')](function(_0x1edd41){if(_0x1edd41){_0x40c95a=_0x1edd41;return db[_0xa7b8('0x5c')]['rawAttributes'];}})[_0xa7b8('0x25')](function(_0x579429){if(_0x579429){var _0x3bd164={};var _0x1a6383={};_0x1a6383['model']=_[_0xa7b8('0x66')](_[_0xa7b8('0x33')](_0x579429),_[_0xa7b8('0x2e')](_0x40c95a[_0xa7b8('0x67')],function(_0x1bb8df){return util[_0xa7b8('0x68')](_0xa7b8('0x69'),_0x1bb8df['id']);}));_0x1a6383['query']=_['keys'](_0x2f89fc[_0xa7b8('0x34')]);_0x1a6383['filters']=_['intersection'](_0x1a6383['model'],_0x1a6383[_0xa7b8('0x34')]);_0x3bd164['attributes']=_['intersection'](_0x1a6383['model'],qs['fields'](_0x2f89fc[_0xa7b8('0x34')][_0xa7b8('0x38')]));_0x3bd164['attributes']=_0x3bd164[_0xa7b8('0x37')]['length']?_0x3bd164[_0xa7b8('0x37')]:_0x1a6383[_0xa7b8('0x32')];if(!_0x2f89fc[_0xa7b8('0x34')][_0xa7b8('0x3a')](_0xa7b8('0x3b'))){_0x3bd164[_0xa7b8('0x58')]=qs[_0xa7b8('0x58')](_0x2f89fc['query'][_0xa7b8('0x58')]);_0x3bd164[_0xa7b8('0x1e')]=qs['offset'](_0x2f89fc['query'][_0xa7b8('0x1e')]);}_0x3bd164[_0xa7b8('0x3c')]=qs[_0xa7b8('0x3d')](_0x2f89fc['query'][_0xa7b8('0x3d')]);_0x3bd164['where']=qs[_0xa7b8('0x35')](_[_0xa7b8('0x3f')](_0x2f89fc[_0xa7b8('0x34')],_0x1a6383[_0xa7b8('0x35')]));_0x3bd164[_0xa7b8('0x6a')]=!![];if(_0x2f89fc[_0xa7b8('0x34')][_0xa7b8('0x40')]){_0x3bd164[_0xa7b8('0x3e')]=_[_0xa7b8('0x42')](_0x3bd164[_0xa7b8('0x3e')],{'$or':_[_0xa7b8('0x2e')](_0x3bd164['attributes'],function(_0x4bc8a0){var _0x2be72f={};_0x2be72f[_0x4bc8a0]={'$like':'%'+_0x2f89fc[_0xa7b8('0x34')][_0xa7b8('0x40')]+'%'};return _0x2be72f;})});}_0x3bd164=_[_0xa7b8('0x42')]({},_0x3bd164,_0x2f89fc['options']);return _0x40c95a['getContacts'](_0x3bd164);}})[_0xa7b8('0x25')](respondWithResult(_0x65e1bc,null))[_0xa7b8('0x46')](handleError(_0x65e1bc,null));};exports[_0xa7b8('0x6b')]=function(_0x463a0d,_0x437877,_0x346aac){var _0x318a04;var _0x52aa65;var _0x139c61;var _0x35094e=_0x463a0d[_0xa7b8('0x51')]['id'];csv_results=[];return db[_0xa7b8('0x6c')][_0xa7b8('0x6d')]({'attributes':['id',_0xa7b8('0x2b')],'raw':!![],'order':[_0xa7b8('0x6e')]})[_0xa7b8('0x25')](function(_0x163a98){_0x318a04=_0x163a98;var _0x2db792=_[_0xa7b8('0x33')](db[_0xa7b8('0x5c')][_0xa7b8('0x2f')]);return db['CmCustomField'][_0xa7b8('0x6d')]({'raw':!![],'attributes':['id',_0xa7b8('0x6f')]})[_0xa7b8('0x25')](function(_0x2530d5){_0x52aa65=_0x2530d5;var _0x42f9a8=squel[_0xa7b8('0x70')]()[_0xa7b8('0x38')](_0x2db792)[_0xa7b8('0x71')](_0xa7b8('0x72'),'c')[_0xa7b8('0x3e')](_0xa7b8('0x73'),_0x35094e)['where'](_0xa7b8('0x74'))[_0xa7b8('0x75')]();for(var _0x272377=0x0;_0x272377<_0x52aa65[_0xa7b8('0x39')];_0x272377++){_0x42f9a8[_0xa7b8('0x76')](_0xa7b8('0x77')+_0x52aa65[_0x272377]['id'],_0xa7b8('0x78')+_0x52aa65[_0x272377][_0xa7b8('0x6f')]);}for(var _0x272377=0x0;_0x272377<_0x318a04[_0xa7b8('0x39')];_0x272377++){_0x42f9a8[_0xa7b8('0x76')](squel[_0xa7b8('0x70')]()[_0xa7b8('0x76')](_0xa7b8('0x79'))[_0xa7b8('0x71')](_0xa7b8('0x7a'))[_0xa7b8('0x3e')](_0xa7b8('0x7b'),_0x318a04[_0x272377]['id'])[_0xa7b8('0x3e')](_0xa7b8('0x7c')),'additionalPhone_'+_0x318a04[_0x272377][_0xa7b8('0x2b')]);_0x42f9a8[_0xa7b8('0x76')](squel[_0xa7b8('0x70')]()[_0xa7b8('0x76')](_0xa7b8('0x7d'))['from']('cm_contact_has_items')[_0xa7b8('0x3e')](_0xa7b8('0x7b'),_0x318a04[_0x272377]['id'])[_0xa7b8('0x3e')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x318a04[_0x272377][_0xa7b8('0x2b')]);}var _0xea4197=[];_0xea4197['push'](_0x42f9a8['toString']());BPromise[_0xa7b8('0x60')](_0xea4197,handleQuery)[_0xa7b8('0x25')](function(_0x21517e){handleQuery(_0x42f9a8[_0xa7b8('0x7e')]());var _0x5efb4b=csv_results[0x0];if(!_[_0xa7b8('0x7f')](_0x5efb4b)){var _0x507614=toCsv(_0x5efb4b);var _0x1efa90=Date['now']();fs[_0xa7b8('0x80')](util['format']('/tmp/list_%d_%s.csv',_0x35094e,_0x1efa90),_0x507614);_0x437877[_0xa7b8('0x81')]('Content-disposition',_0xa7b8('0x82')+util[_0xa7b8('0x68')](_0xa7b8('0x83'),_0x35094e,_0x1efa90));_0x437877[_0xa7b8('0x81')](_0xa7b8('0x84'),_0xa7b8('0x85'));return _0x437877['download'](util['format']('/tmp/list_%d_%s.csv',_0x35094e,_0x1efa90));}else{return _0x437877[_0xa7b8('0x1a')](0xcc);}});});});};exports['addCustomField']=function(_0x544b7e,_0xf83b67,_0x7196e0){var _0x483dbe;delete _0x544b7e[_0xa7b8('0x4b')]['id'];return db[_0xa7b8('0x45')]['findOne']({'where':{'id':_0x544b7e['params']['id']}})['then'](handleEntityNotFound(_0xf83b67,null))[_0xa7b8('0x25')](function(_0x135c41){if(_0x135c41){return db[_0xa7b8('0x86')][_0xa7b8('0x87')](function(_0x1181dc){return db[_0xa7b8('0x88')]['create'](_0x544b7e[_0xa7b8('0x4b')],{'transaction':_0x1181dc})['then'](function(_0x54fe5b){_0x483dbe=_0x54fe5b;return _0x135c41[_0xa7b8('0x89')](_0x54fe5b,{'transaction':_0x1181dc});})[_0xa7b8('0x25')](function(){var _0x1febac={'type':db['Sequelize'][_0xa7b8('0x8a')],'transaction':_0x1181dc};switch(_0x544b7e[_0xa7b8('0x4b')]['type']){case _0xa7b8('0x8b'):_0x1febac[_0xa7b8('0x31')]=db['Sequelize'][_0xa7b8('0x8a')];break;case _0xa7b8('0x8c'):_0x1febac['type']=db['Sequelize'][_0xa7b8('0x8d')];break;case _0xa7b8('0x8e'):_0x1febac[_0xa7b8('0x31')]=db[_0xa7b8('0x8f')]['BOOLEAN'];_0x1febac[_0xa7b8('0x90')]=![];break;default:}return db[_0xa7b8('0x86')]['queryInterface']['addColumn'](_0xa7b8('0x72'),util[_0xa7b8('0x68')]('cf_%s',_0x483dbe['id']),_0x1febac);})[_0xa7b8('0x25')](function(){return _0x483dbe;});});}})['then'](respondWithResult(_0xf83b67,null))[_0xa7b8('0x46')](handleError(_0xf83b67,null));};exports['getCustomFields']=function(_0x23bab0,_0x1faf1e,_0x38e1e9){var _0xe82a44={};var _0x2bf695={};var _0x3ec2b3;var _0x50e23b;return db[_0xa7b8('0x45')][_0xa7b8('0x57')]({'where':{'id':_0x23bab0[_0xa7b8('0x51')]['id']}})['then'](handleEntityNotFound(_0x1faf1e,null))[_0xa7b8('0x25')](function(_0x22b99a){if(_0x22b99a){_0x3ec2b3=_0x22b99a;_0x2bf695[_0xa7b8('0x32')]=_[_0xa7b8('0x33')](db[_0xa7b8('0x88')][_0xa7b8('0x2f')]);_0x2bf695[_0xa7b8('0x34')]=_[_0xa7b8('0x33')](_0x23bab0[_0xa7b8('0x34')]);_0x2bf695['filters']=_[_0xa7b8('0x36')](_0x2bf695[_0xa7b8('0x32')],_0x2bf695['query']);_0xe82a44[_0xa7b8('0x37')]=_['intersection'](_0x2bf695[_0xa7b8('0x32')],qs['fields'](_0x23bab0[_0xa7b8('0x34')][_0xa7b8('0x38')]));_0xe82a44[_0xa7b8('0x37')]=_0xe82a44['attributes'][_0xa7b8('0x39')]?_0xe82a44[_0xa7b8('0x37')]:_0x2bf695[_0xa7b8('0x32')];_0xe82a44[_0xa7b8('0x3c')]=qs[_0xa7b8('0x3d')](_0x23bab0[_0xa7b8('0x34')][_0xa7b8('0x3d')]);_0xe82a44['where']=qs['filters'](_[_0xa7b8('0x3f')](_0x23bab0[_0xa7b8('0x34')],_0x2bf695[_0xa7b8('0x35')]));_0xe82a44['where']=_[_0xa7b8('0x42')](_0xe82a44[_0xa7b8('0x3e')],{'$or':[{'ListId':_0x22b99a['id']},{'ListId':null}]});if(_0x23bab0[_0xa7b8('0x34')][_0xa7b8('0x40')]){_0xe82a44['where']=_[_0xa7b8('0x42')](_0xe82a44['where'],{'$or':_['map'](_0xe82a44[_0xa7b8('0x37')],function(_0x5a8f5b){var _0x51473a={};_0x51473a[_0x5a8f5b]={'$like':'%'+_0x23bab0[_0xa7b8('0x34')][_0xa7b8('0x40')]+'%'};return _0x51473a;})});}_0xe82a44=_[_0xa7b8('0x42')]({},_0xe82a44,_0x23bab0[_0xa7b8('0x43')]);return db[_0xa7b8('0x88')][_0xa7b8('0x91')](_0xe82a44);}})[_0xa7b8('0x25')](respondWithResult(_0x1faf1e,null))[_0xa7b8('0x46')](handleError(_0x1faf1e,null));};exports[_0xa7b8('0x92')]=function(_0x41903c,_0x1564ee){return db[_0xa7b8('0x88')]['findAndCountAll']({'where':{'ListId':null}})[_0xa7b8('0x25')](handleEntityNotFound(_0x1564ee,null))[_0xa7b8('0x25')](function(_0x498c74){return _0x498c74;})[_0xa7b8('0x25')](respondWithResult(_0x1564ee,null))['catch'](handleError(_0x1564ee,null));};exports[_0xa7b8('0x93')]=function(_0x21a9f4,_0x4d600e,_0x3b5872){return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x21a9f4[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x4d600e,null))[_0xa7b8('0x25')](function(_0x224496){if(_0x224496){return _0x224496['addAgents'](_0x21a9f4[_0xa7b8('0x4b')][_0xa7b8('0x94')],_[_0xa7b8('0x61')](_0x21a9f4[_0xa7b8('0x4b')],[_0xa7b8('0x94'),'id'])||{})[_0xa7b8('0x95')](function(_0x668142){for(var _0x2fbae6=0x0;_0x2fbae6<_0x21a9f4[_0xa7b8('0x4b')][_0xa7b8('0x94')][_0xa7b8('0x39')];_0x2fbae6+=0x1){socket['emit'](_0xa7b8('0x96'),{'UserId':Number(_0x21a9f4['body'][_0xa7b8('0x94')][_0x2fbae6]),'CmListId':Number(_0x21a9f4[_0xa7b8('0x51')]['id'])});}return _0x668142;});}})[_0xa7b8('0x25')](respondWithResult(_0x4d600e,null))[_0xa7b8('0x46')](handleError(_0x4d600e,null));};exports['removeAgents']=function(_0x1a2fd6,_0x251f42,_0x171591){return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x1a2fd6[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x251f42,null))['then'](function(_0x21c6e6){if(_0x21c6e6){return _0x21c6e6[_0xa7b8('0x97')](_0x1a2fd6[_0xa7b8('0x34')]['ids'])[_0xa7b8('0x25')](function(){if(_['isArray'](_0x1a2fd6[_0xa7b8('0x34')][_0xa7b8('0x94')])){for(var _0x3a9886=0x0;_0x3a9886<_0x1a2fd6[_0xa7b8('0x34')][_0xa7b8('0x94')][_0xa7b8('0x39')];_0x3a9886+=0x1){socket['emit'](_0xa7b8('0x98'),{'UserId':Number(_0x1a2fd6[_0xa7b8('0x34')][_0xa7b8('0x94')][_0x3a9886]),'CmListId':Number(_0x1a2fd6[_0xa7b8('0x51')]['id'])});}}else{socket[_0xa7b8('0x99')](_0xa7b8('0x98'),{'UserId':Number(_0x1a2fd6[_0xa7b8('0x34')][_0xa7b8('0x94')]),'CmListId':Number(_0x1a2fd6['params']['id'])});}});}})['then'](respondWithStatusCode(_0x251f42,null))['catch'](handleError(_0x251f42,null));};exports[_0xa7b8('0x9a')]=function(_0x4a9be1,_0x3a8b01,_0x4daa24){var _0xc3b23f={};var _0x1bfd6e={};var _0x1bc0c5;var _0x5cf826;return db[_0xa7b8('0x45')][_0xa7b8('0x57')]({'where':{'id':_0x4a9be1[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x3a8b01,null))[_0xa7b8('0x25')](function(_0x236dc4){if(_0x236dc4){_0x1bc0c5=_0x236dc4;_0x1bfd6e['model']=_['keys'](db[_0xa7b8('0x9b')][_0xa7b8('0x2f')]);_0x1bfd6e[_0xa7b8('0x34')]=_['keys'](_0x4a9be1[_0xa7b8('0x34')]);_0x1bfd6e[_0xa7b8('0x35')]=_[_0xa7b8('0x36')](_0x1bfd6e['model'],_0x1bfd6e[_0xa7b8('0x34')]);_0xc3b23f[_0xa7b8('0x37')]=_[_0xa7b8('0x36')](_0x1bfd6e[_0xa7b8('0x32')],qs[_0xa7b8('0x38')](_0x4a9be1[_0xa7b8('0x34')][_0xa7b8('0x38')]));_0xc3b23f[_0xa7b8('0x37')]=_0xc3b23f[_0xa7b8('0x37')][_0xa7b8('0x39')]?_0xc3b23f[_0xa7b8('0x37')]:_0x1bfd6e[_0xa7b8('0x32')];_0xc3b23f['order']=qs[_0xa7b8('0x3d')](_0x4a9be1[_0xa7b8('0x34')]['sort']);_0xc3b23f[_0xa7b8('0x3e')]=qs[_0xa7b8('0x35')](_[_0xa7b8('0x3f')](_0x4a9be1['query'],_0x1bfd6e[_0xa7b8('0x35')]));if(_0x4a9be1[_0xa7b8('0x34')]['filter']){_0xc3b23f['where']=_['merge'](_0xc3b23f['where'],{'$or':_[_0xa7b8('0x2e')](_0xc3b23f[_0xa7b8('0x37')],function(_0x2a1015){var _0xc92dcb={};_0xc92dcb[_0x2a1015]={'$like':'%'+_0x4a9be1[_0xa7b8('0x34')]['filter']+'%'};return _0xc92dcb;})});}_0xc3b23f=_[_0xa7b8('0x42')]({},_0xc3b23f,_0x4a9be1[_0xa7b8('0x43')]);return _0x1bc0c5[_0xa7b8('0x9a')](_0xc3b23f);}})[_0xa7b8('0x25')](function(_0x1556f7){if(_0x1556f7){_0x5cf826=_0x1556f7['length'];if(!_0x4a9be1['query'][_0xa7b8('0x3a')](_0xa7b8('0x3b'))){_0xc3b23f['limit']=qs['limit'](_0x4a9be1['query'][_0xa7b8('0x58')]);_0xc3b23f[_0xa7b8('0x1e')]=qs[_0xa7b8('0x1e')](_0x4a9be1[_0xa7b8('0x34')][_0xa7b8('0x1e')]);}return _0x1bc0c5[_0xa7b8('0x9a')](_0xc3b23f);}})[_0xa7b8('0x25')](function(_0x2ae1be){if(_0x2ae1be){return _0x2ae1be?{'count':_0x5cf826,'rows':_0x2ae1be}:null;}})[_0xa7b8('0x25')](respondWithResult(_0x3a8b01,null))[_0xa7b8('0x46')](handleError(_0x3a8b01,null));};function handleQuery(_0x4042de){logger[_0xa7b8('0x9c')](_0x4042de);return db[_0xa7b8('0x86')][_0xa7b8('0x34')](_0x4042de)['spread'](function(_0x28a3e){csv_results[_0xa7b8('0x5f')](_0x28a3e);})[_0xa7b8('0x46')](function(_0x48b604){logger[_0xa7b8('0x29')](_0x48b604['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 8c14857..29087a7 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x49b9fc,_0x4747b7){var _0x51ade2=function(_0x5ab0a8){while(--_0x5ab0a8){_0x49b9fc['push'](_0x49b9fc['shift']());}};_0x51ade2(++_0x4747b7);}(_0x814b,0x1a2));var _0xb814=function(_0x379799,_0x4ccf16){_0x379799=_0x379799-0x0;var _0x46e431=_0x814b[_0x379799];return _0x46e431;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x39abaf,_0x264258){var _0x2f7166=function(_0x1bc01e){while(--_0x1bc01e){_0x39abaf['push'](_0x39abaf['shift']());}};_0x2f7166(++_0x264258);}(_0x814b,0x1a2));var _0xb814=function(_0x3cb86b,_0x3c75f6){_0x3cb86b=_0x3cb86b-0x0;var _0x3c10a0=_0x814b[_0x3cb86b];return _0x3c10a0;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 11b8931..f3dded8 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['cm_lists','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes'];(function(_0x1879a6,_0x2cb4df){var _0x3ca317=function(_0x2c15d2){while(--_0x2c15d2){_0x1879a6['push'](_0x1879a6['shift']());}};_0x3ca317(++_0x2cb4df);}(_0x70e0,0x17b));var _0x070e=function(_0x4f491e,_0x5e11dc){_0x4f491e=_0x4f491e-0x0;var _0xc04091=_0x70e0[_0x4f491e];return _0xc04091;};'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']('CmList',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd28=['rimraf','./cmList.attributes','exports','define','util','../../config/logger','moment','request-promise','path'];(function(_0x13f6dc,_0x323f62){var _0x1ad525=function(_0x473f36){while(--_0x473f36){_0x13f6dc['push'](_0x13f6dc['shift']());}};_0x1ad525(++_0x323f62);}(_0xfd28,0x148));var _0x8fd2=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xfd28[_0x11c573];return _0x6b72de;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var logger=require(_0x8fd2('0x1'))('api');var moment=require(_0x8fd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x8fd2('0x3'));var fs=require('fs');var path=require(_0x8fd2('0x4'));var rimraf=require(_0x8fd2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8fd2('0x6'));module[_0x8fd2('0x7')]=function(_0x2ee87e,_0x36178a){return _0x2ee87e[_0x8fd2('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 5a988ac..65afadc 100644 --- a/server/api/cmList/cmList.rpc.js +++ b/server/api/cmList/cmList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a2d=['CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info'];(function(_0x53a601,_0x47435d){var _0x19214e=function(_0x24e155){while(--_0x24e155){_0x53a601['push'](_0x53a601['shift']());}};_0x19214e(++_0x47435d);}(_0x7a2d,0x9b));var _0xd7a2=function(_0x38a3ba,_0x33a595){_0x38a3ba=_0x38a3ba-0x0;var _0x38f0d4=_0x7a2d[_0x38a3ba];return _0x38f0d4;};'use strict';var _=require(_0xd7a2('0x0'));var util=require(_0xd7a2('0x1'));var moment=require('moment');var BPromise=require(_0xd7a2('0x2'));var rs=require(_0xd7a2('0x3'));var fs=require('fs');var Redis=require(_0xd7a2('0x4'));var db=require(_0xd7a2('0x5'))['db'];var utils=require(_0xd7a2('0x6'));var logger=require(_0xd7a2('0x7'))(_0xd7a2('0x8'));var config=require(_0xd7a2('0x9'));var jayson=require(_0xd7a2('0xa'));var client=jayson['client'][_0xd7a2('0xb')]({'port':0x232a});config[_0xd7a2('0xc')]=_[_0xd7a2('0xd')](config[_0xd7a2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd7a2('0xe'))(new Redis(config['redis']));require('./cmList.socket')[_0xd7a2('0xf')](socket);function respondWithRpcPromise(_0x286137,_0x2bd1c,_0x330cb4){return new BPromise(function(_0x154315,_0x305ba2){return client[_0xd7a2('0x10')](_0x286137,_0x330cb4)[_0xd7a2('0x11')](function(_0x1f4785){logger[_0xd7a2('0x12')](_0xd7a2('0x13'),_0x2bd1c,_0xd7a2('0x14'));logger[_0xd7a2('0x15')](_0xd7a2('0x16'),_0x2bd1c,_0xd7a2('0x14'),JSON[_0xd7a2('0x17')](_0x1f4785));if(_0x1f4785['error']){if(_0x1f4785[_0xd7a2('0x18')][_0xd7a2('0x19')]===0x1f4){logger[_0xd7a2('0x18')]('CmList,\x20%s,\x20%s',_0x2bd1c,_0x1f4785[_0xd7a2('0x18')][_0xd7a2('0x1a')]);return _0x305ba2(_0x1f4785[_0xd7a2('0x18')][_0xd7a2('0x1a')]);}logger[_0xd7a2('0x18')](_0xd7a2('0x13'),_0x2bd1c,_0x1f4785[_0xd7a2('0x18')][_0xd7a2('0x1a')]);return _0x154315(_0x1f4785[_0xd7a2('0x18')]['message']);}else{logger[_0xd7a2('0x12')](_0xd7a2('0x13'),_0x2bd1c,_0xd7a2('0x14'));_0x154315(_0x1f4785[_0xd7a2('0x1b')][_0xd7a2('0x1a')]);}})[_0xd7a2('0x1c')](function(_0x2d38f1){logger['error'](_0xd7a2('0x13'),_0x2bd1c,_0x2d38f1);_0x305ba2(_0x2d38f1);});});} \ No newline at end of file +var _0x0364=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x183bbd,_0x4dfd13){var _0x3773a9=function(_0x48b9bf){while(--_0x48b9bf){_0x183bbd['push'](_0x183bbd['shift']());}};_0x3773a9(++_0x4dfd13);}(_0x0364,0x1bc));var _0x4036=function(_0x2fe8c6,_0x44591c){_0x2fe8c6=_0x2fe8c6-0x0;var _0x16c16d=_0x0364[_0x2fe8c6];return _0x16c16d;};'use strict';var _=require(_0x4036('0x0'));var util=require(_0x4036('0x1'));var moment=require(_0x4036('0x2'));var BPromise=require(_0x4036('0x3'));var rs=require(_0x4036('0x4'));var fs=require('fs');var Redis=require(_0x4036('0x5'));var db=require(_0x4036('0x6'))['db'];var utils=require(_0x4036('0x7'));var logger=require(_0x4036('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4036('0x9'));var client=jayson[_0x4036('0xa')][_0x4036('0xb')]({'port':0x232a});config[_0x4036('0xc')]=_[_0x4036('0xd')](config['redis'],{'host':_0x4036('0xe'),'port':0x18eb});var socket=require(_0x4036('0xf'))(new Redis(config['redis']));require(_0x4036('0x10'))[_0x4036('0x11')](socket);function respondWithRpcPromise(_0x4125ab,_0x1e6dd8,_0x4f924d){return new BPromise(function(_0x3bd39e,_0x15e011){return client['request'](_0x4125ab,_0x4f924d)['then'](function(_0x1c1c12){logger[_0x4036('0x12')](_0x4036('0x13'),_0x1e6dd8,_0x4036('0x14'));logger[_0x4036('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x1e6dd8,'request\x20sent',JSON[_0x4036('0x16')](_0x1c1c12));if(_0x1c1c12['error']){if(_0x1c1c12[_0x4036('0x17')][_0x4036('0x18')]===0x1f4){logger['error'](_0x4036('0x13'),_0x1e6dd8,_0x1c1c12[_0x4036('0x17')]['message']);return _0x15e011(_0x1c1c12[_0x4036('0x17')][_0x4036('0x19')]);}logger['error']('CmList,\x20%s,\x20%s',_0x1e6dd8,_0x1c1c12['error'][_0x4036('0x19')]);return _0x3bd39e(_0x1c1c12[_0x4036('0x17')]['message']);}else{logger[_0x4036('0x12')](_0x4036('0x13'),_0x1e6dd8,_0x4036('0x14'));_0x3bd39e(_0x1c1c12[_0x4036('0x1a')]['message']);}})[_0x4036('0x1b')](function(_0x3b63a0){logger[_0x4036('0x17')](_0x4036('0x13'),_0x1e6dd8,_0x3b63a0);_0x15e011(_0x3b63a0);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 3cd75a6..ad6c0b7 100644 --- a/server/api/cmList/cmList.socket.js +++ b/server/api/cmList/cmList.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c72=['emit','removeListener','length','save','remove','update'];(function(_0x17eed7,_0x294cfc){var _0x1715fc=function(_0x1aa92e){while(--_0x1aa92e){_0x17eed7['push'](_0x17eed7['shift']());}};_0x1715fc(++_0x294cfc);}(_0x6c72,0xf9));var _0x26c7=function(_0x16ca2a,_0xfbd599){_0x16ca2a=_0x16ca2a-0x0;var _0x4add8=_0x6c72[_0x16ca2a];return _0x4add8;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x26c7('0x0'),_0x26c7('0x1'),_0x26c7('0x2')];function createListener(_0x440842,_0x49922b){return function(_0x3ca0aa){_0x49922b[_0x26c7('0x3')](_0x440842,_0x3ca0aa);};}function removeListener(_0xd5d735,_0x49e557){return function(){CmListEvents[_0x26c7('0x4')](_0xd5d735,_0x49e557);};}exports['register']=function(_0x167798){for(var _0x4d27c1=0x0,_0x33db03=events[_0x26c7('0x5')];_0x4d27c1<_0x33db03;_0x4d27c1++){var _0x51fd47=events[_0x4d27c1];var _0x1567f1=createListener('cmList:'+_0x51fd47,_0x167798);CmListEvents['on'](_0x51fd47,_0x1567f1);}}; \ No newline at end of file +var _0xbd83=['removeListener','register','cmList:','./cmList.events','save','update'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xbd83,0x14d));var _0x3bd8=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xbd83[_0x21f9c2];return _0x3da17f;};'use strict';var CmListEvents=require(_0x3bd8('0x0'));var events=[_0x3bd8('0x1'),'remove',_0x3bd8('0x2')];function createListener(_0x535911,_0x13cba5){return function(_0x3c25ad){_0x13cba5['emit'](_0x535911,_0x3c25ad);};}function removeListener(_0x467c0d,_0x37975c){return function(){CmListEvents[_0x3bd8('0x3')](_0x467c0d,_0x37975c);};}exports[_0x3bd8('0x4')]=function(_0x54259b){for(var _0x242563=0x0,_0x58c6d5=events['length'];_0x242563<_0x58c6d5;_0x242563++){var _0x206fa9=events[_0x242563];var _0x535fec=createListener(_0x3bd8('0x5')+_0x206fa9,_0x54259b);CmListEvents['on'](_0x206fa9,_0x535fec);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 89212fc..2dff992 100644 --- a/server/api/cmList/index.js +++ b/server/api/cmList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x751f=['create','post','/:id/dispositions','addDisposition','addContacts','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0x751f,0x150));var _0xf751=function(_0x13f41e,_0x4a2f8b){_0x13f41e=_0x13f41e-0x0;var _0x5e2583=_0x751f[_0x13f41e];return _0x5e2583;};'use strict';var multer=require(_0xf751('0x0'));var util=require(_0xf751('0x1'));var path=require(_0xf751('0x2'));var timeout=require(_0xf751('0x3'));var express=require(_0xf751('0x4'));var router=express[_0xf751('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf751('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf751('0x7'));var controller=require(_0xf751('0x8'));router[_0xf751('0x9')]('/',auth['isAuthenticated'](),controller[_0xf751('0xa')]);router['get'](_0xf751('0xb'),auth[_0xf751('0xc')](),controller[_0xf751('0xd')]);router[_0xf751('0x9')]('/global_fields',auth[_0xf751('0xc')](),controller['getGlobalCustomFields']);router[_0xf751('0x9')](_0xf751('0xe'),auth[_0xf751('0xc')](),controller[_0xf751('0xf')]);router[_0xf751('0x9')]('/:id/dispositions',auth[_0xf751('0xc')](),controller['getDispositions']);router[_0xf751('0x9')](_0xf751('0x10'),auth[_0xf751('0xc')](),controller[_0xf751('0x11')]);router[_0xf751('0x9')](_0xf751('0x12'),auth[_0xf751('0xc')](),controller[_0xf751('0x13')]);router['get'](_0xf751('0x14'),auth[_0xf751('0xc')](),controller[_0xf751('0x15')]);router[_0xf751('0x9')](_0xf751('0x16'),auth['isAuthenticated'](),controller[_0xf751('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf751('0x18')]);router[_0xf751('0x19')](_0xf751('0x1a'),auth[_0xf751('0xc')](),controller[_0xf751('0x1b')]);router['post']('/:id/contacts',auth[_0xf751('0xc')](),controller[_0xf751('0x1c')]);router[_0xf751('0x19')]('/:id/fields',auth[_0xf751('0xc')](),controller['addCustomField']);router[_0xf751('0x19')](_0xf751('0x16'),auth[_0xf751('0xc')](),controller[_0xf751('0x1d')]);router[_0xf751('0x1e')](_0xf751('0xe'),auth[_0xf751('0xc')](),controller[_0xf751('0x1f')]);router[_0xf751('0x20')](_0xf751('0xe'),auth['isAuthenticated'](),controller[_0xf751('0x21')]);router[_0xf751('0x20')](_0xf751('0x1a'),auth[_0xf751('0xc')](),controller[_0xf751('0x22')]);router['delete'](_0xf751('0x16'),auth['isAuthenticated'](),controller[_0xf751('0x23')]);module['exports']=router; \ No newline at end of file +var _0x2385=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x2385,0x11b));var _0x5238=function(_0x5ac17d,_0x359c3e){_0x5ac17d=_0x5ac17d-0x0;var _0xbc667c=_0x2385[_0x5ac17d];return _0xbc667c;};'use strict';var multer=require('multer');var util=require(_0x5238('0x0'));var path=require(_0x5238('0x1'));var timeout=require(_0x5238('0x2'));var express=require(_0x5238('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5238('0x4'));var interaction=require(_0x5238('0x5'));var config=require(_0x5238('0x6'));var controller=require('./cmList.controller');router[_0x5238('0x7')]('/',auth[_0x5238('0x8')](),controller['index']);router[_0x5238('0x7')](_0x5238('0x9'),auth[_0x5238('0x8')](),controller[_0x5238('0xa')]);router[_0x5238('0x7')]('/global_fields',auth[_0x5238('0x8')](),controller[_0x5238('0xb')]);router[_0x5238('0x7')](_0x5238('0xc'),auth[_0x5238('0x8')](),controller[_0x5238('0xd')]);router[_0x5238('0x7')](_0x5238('0xe'),auth['isAuthenticated'](),controller[_0x5238('0xf')]);router[_0x5238('0x7')](_0x5238('0x10'),auth[_0x5238('0x8')](),controller['getContacts']);router[_0x5238('0x7')](_0x5238('0x11'),auth[_0x5238('0x8')](),controller['getContactsCsv']);router['get'](_0x5238('0x12'),auth[_0x5238('0x8')](),controller[_0x5238('0x13')]);router[_0x5238('0x7')](_0x5238('0x14'),auth[_0x5238('0x8')](),controller[_0x5238('0x15')]);router[_0x5238('0x16')]('/',auth['isAuthenticated'](),controller[_0x5238('0x17')]);router['post'](_0x5238('0xe'),auth[_0x5238('0x8')](),controller[_0x5238('0x18')]);router[_0x5238('0x16')](_0x5238('0x10'),auth[_0x5238('0x8')](),controller['addContacts']);router[_0x5238('0x16')](_0x5238('0x12'),auth[_0x5238('0x8')](),controller['addCustomField']);router['post']('/:id/users',auth[_0x5238('0x8')](),controller[_0x5238('0x19')]);router['put']('/:id',auth[_0x5238('0x8')](),controller[_0x5238('0x1a')]);router[_0x5238('0x1b')](_0x5238('0xc'),auth[_0x5238('0x8')](),controller[_0x5238('0x1c')]);router[_0x5238('0x1b')]('/:id/dispositions',auth[_0x5238('0x8')](),controller[_0x5238('0x1d')]);router[_0x5238('0x1b')](_0x5238('0x14'),auth['isAuthenticated'](),controller[_0x5238('0x1e')]);module[_0x5238('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 2aa2f72..97e5d60 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf1b=['getDataValue','STRING'];(function(_0x2bd8e2,_0x2ad25d){var _0x5bbb87=function(_0x4edbca){while(--_0x4edbca){_0x2bd8e2['push'](_0x2bd8e2['shift']());}};_0x5bbb87(++_0x2ad25d);}(_0xaf1b,0x106));var _0xbaf1=function(_0x392d5a,_0x47c4c5){_0x392d5a=_0x392d5a-0x0;var _0x1fc5f9=_0xaf1b[_0x392d5a];return _0x1fc5f9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xeebe01){return this[_0xbaf1('0x0')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xbaf1('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xbaf1('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xdd84=['VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x11322c,_0x82a898){var _0x2c296c=function(_0x3cd6c9){while(--_0x3cd6c9){_0x11322c['push'](_0x11322c['shift']());}};_0x2c296c(++_0x82a898);}(_0xdd84,0x162));var _0x4dd8=function(_0x152fc2,_0x1a96ad){_0x152fc2=_0x152fc2-0x0;var _0x1a74df=_0xdd84[_0x152fc2];return _0x1a74df;};'use strict';var Sequelize=require(_0x4dd8('0x0'));module['exports']={'name':{'type':Sequelize[_0x4dd8('0x1')],'get':function(_0x372db1){return this[_0x4dd8('0x2')](_0x4dd8('0x3'));}},'field':{'type':Sequelize[_0x4dd8('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x4dd8('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index d501cc1..3f89b15 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x42e268,_0x35c2d4){var _0x313838=function(_0x50d58a){while(--_0x50d58a){_0x42e268['push'](_0x42e268['shift']());}};_0x313838(++_0x35c2d4);}(_0x7a54,0x106));var _0x47a5=function(_0x57a484,_0x37cacf){_0x57a484=_0x57a484-0x0;var _0x4e2b69=_0x7a54[_0x57a484];return _0x4e2b69;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x1300dd,_0x488ae0){var _0x501f62=function(_0x11e9b7){while(--_0x11e9b7){_0x1300dd['push'](_0x1300dd['shift']());}};_0x501f62(++_0x488ae0);}(_0x7a54,0x106));var _0x47a5=function(_0xee84be,_0x2df2b0){_0xee84be=_0xee84be-0x0;var _0x4cc938=_0x7a54[_0xee84be];return _0x4cc938;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 7257557..c1a1048 100644 --- a/server/api/condition/condition.model.js +++ b/server/api/condition/condition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f4d=['moment','bluebird','request-promise','path','../../config/environment','exports','Condition','tools_conditions','lodash','util','../../config/logger','api'];(function(_0x402c88,_0x2e4772){var _0x2eb17e=function(_0x544295){while(--_0x544295){_0x402c88['push'](_0x402c88['shift']());}};_0x2eb17e(++_0x2e4772);}(_0x1f4d,0x1a0));var _0xd1f4=function(_0x4981c8,_0x1453d0){_0x4981c8=_0x4981c8-0x0;var _0xe82a75=_0x1f4d[_0x4981c8];return _0xe82a75;};'use strict';var _=require(_0xd1f4('0x0'));var util=require(_0xd1f4('0x1'));var logger=require(_0xd1f4('0x2'))(_0xd1f4('0x3'));var moment=require(_0xd1f4('0x4'));var BPromise=require(_0xd1f4('0x5'));var rp=require(_0xd1f4('0x6'));var fs=require('fs');var path=require(_0xd1f4('0x7'));var rimraf=require('rimraf');var config=require(_0xd1f4('0x8'));var attributes=require('./condition.attributes');module[_0xd1f4('0x9')]=function(_0x528eb4,_0x43ed22){return _0x528eb4['define'](_0xd1f4('0xa'),attributes,{'tableName':_0xd1f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02e2=['./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58e531,_0x424a60){var _0x5bc2c4=function(_0xfaa3b9){while(--_0xfaa3b9){_0x58e531['push'](_0x58e531['shift']());}};_0x5bc2c4(++_0x424a60);}(_0x02e2,0x1f3));var _0x202e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02e2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x202e('0x0'));var util=require(_0x202e('0x1'));var logger=require(_0x202e('0x2'))('api');var moment=require(_0x202e('0x3'));var BPromise=require(_0x202e('0x4'));var rp=require(_0x202e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x202e('0x6'));var config=require(_0x202e('0x7'));var attributes=require(_0x202e('0x8'));module[_0x202e('0x9')]=function(_0x141daf,_0xa73dea){return _0x141daf[_0x202e('0xa')](_0x202e('0xb'),attributes,{'tableName':_0x202e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 53e2b02..efd545e 100644 --- a/server/api/condition/condition.rpc.js +++ b/server/api/condition/condition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1658=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x44da97,_0x76853d){var _0x594d87=function(_0x195d9a){while(--_0x195d9a){_0x44da97['push'](_0x44da97['shift']());}};_0x594d87(++_0x76853d);}(_0x1658,0x126));var _0x8165=function(_0x13e253,_0x3e8a19){_0x13e253=_0x13e253-0x0;var _0x1a17e6=_0x1658[_0x13e253];return _0x1a17e6;};'use strict';var _=require(_0x8165('0x0'));var util=require(_0x8165('0x1'));var moment=require('moment');var BPromise=require(_0x8165('0x2'));var rs=require(_0x8165('0x3'));var fs=require('fs');var Redis=require(_0x8165('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8165('0x5'));var logger=require('../../config/logger')(_0x8165('0x6'));var config=require('../../config/environment');var jayson=require(_0x8165('0x7'));var client=jayson[_0x8165('0x8')][_0x8165('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f3cf7,_0xaa5b4,_0x425bff){return new BPromise(function(_0x192f8a,_0x1cf65e){return client[_0x8165('0xa')](_0x4f3cf7,_0x425bff)[_0x8165('0xb')](function(_0x4173f5){logger[_0x8165('0xc')](_0x8165('0xd'),_0xaa5b4,'request\x20sent');logger[_0x8165('0xe')](_0x8165('0xf'),_0xaa5b4,_0x8165('0x10'),JSON[_0x8165('0x11')](_0x4173f5));if(_0x4173f5['error']){if(_0x4173f5[_0x8165('0x12')][_0x8165('0x13')]===0x1f4){logger[_0x8165('0x12')](_0x8165('0xd'),_0xaa5b4,_0x4173f5['error'][_0x8165('0x14')]);return _0x1cf65e(_0x4173f5[_0x8165('0x12')][_0x8165('0x14')]);}logger[_0x8165('0x12')](_0x8165('0xd'),_0xaa5b4,_0x4173f5[_0x8165('0x12')][_0x8165('0x14')]);return _0x192f8a(_0x4173f5['error'][_0x8165('0x14')]);}else{logger[_0x8165('0xc')](_0x8165('0xd'),_0xaa5b4,_0x8165('0x10'));_0x192f8a(_0x4173f5[_0x8165('0x15')]['message']);}})[_0x8165('0x16')](function(_0x8fb6f2){logger[_0x8165('0x12')](_0x8165('0xd'),_0xaa5b4,_0x8fb6f2);_0x1cf65e(_0x8fb6f2);});});} \ No newline at end of file +var _0xaf13=['error','code','Condition,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4649d6,_0x9edb55){var _0x418668=function(_0x1c3a04){while(--_0x1c3a04){_0x4649d6['push'](_0x4649d6['shift']());}};_0x418668(++_0x9edb55);}(_0xaf13,0xcd));var _0x3af1=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xaf13[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x3af1('0x0'));var util=require(_0x3af1('0x1'));var moment=require(_0x3af1('0x2'));var BPromise=require(_0x3af1('0x3'));var rs=require(_0x3af1('0x4'));var fs=require('fs');var Redis=require(_0x3af1('0x5'));var db=require(_0x3af1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3af1('0x7'));var config=require('../../config/environment');var jayson=require(_0x3af1('0x8'));var client=jayson[_0x3af1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ce159,_0x21b7b5,_0x59ca64){return new BPromise(function(_0x2d4b6d,_0x177491){return client[_0x3af1('0xa')](_0x1ce159,_0x59ca64)['then'](function(_0x375c19){logger[_0x3af1('0xb')]('Condition,\x20%s,\x20%s',_0x21b7b5,_0x3af1('0xc'));logger['debug'](_0x3af1('0xd'),_0x21b7b5,'request\x20sent',JSON[_0x3af1('0xe')](_0x375c19));if(_0x375c19[_0x3af1('0xf')]){if(_0x375c19[_0x3af1('0xf')][_0x3af1('0x10')]===0x1f4){logger[_0x3af1('0xf')](_0x3af1('0x11'),_0x21b7b5,_0x375c19['error'][_0x3af1('0x12')]);return _0x177491(_0x375c19[_0x3af1('0xf')]['message']);}logger['error'](_0x3af1('0x11'),_0x21b7b5,_0x375c19['error']['message']);return _0x2d4b6d(_0x375c19[_0x3af1('0xf')]['message']);}else{logger[_0x3af1('0xb')](_0x3af1('0x11'),_0x21b7b5,_0x3af1('0xc'));_0x2d4b6d(_0x375c19['result'][_0x3af1('0x12')]);}})[_0x3af1('0x13')](function(_0x38242b){logger['error'](_0x3af1('0x11'),_0x21b7b5,_0x38242b);_0x177491(_0x38242b);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index a864d7b..174910f 100644 --- a/server/api/condition/index.js +++ b/server/api/condition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2bc=['/:id','update','delete','isAuthenticated','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./condition.controller','put'];(function(_0x5e2f48,_0x4f114c){var _0x17bce0=function(_0x532e96){while(--_0x532e96){_0x5e2f48['push'](_0x5e2f48['shift']());}};_0x17bce0(++_0x4f114c);}(_0xd2bc,0x10f));var _0xcd2b=function(_0x1bc5ca,_0x23c930){_0x1bc5ca=_0x1bc5ca-0x0;var _0x71a920=_0xd2bc[_0x1bc5ca];return _0x71a920;};'use strict';var multer=require('multer');var util=require(_0xcd2b('0x0'));var path=require(_0xcd2b('0x1'));var timeout=require(_0xcd2b('0x2'));var express=require(_0xcd2b('0x3'));var router=express[_0xcd2b('0x4')]();var fs_extra=require(_0xcd2b('0x5'));var auth=require(_0xcd2b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcd2b('0x7'));router[_0xcd2b('0x8')](_0xcd2b('0x9'),auth['isAuthenticated'](),controller[_0xcd2b('0xa')]);router[_0xcd2b('0xb')](_0xcd2b('0x9'),auth[_0xcd2b('0xc')](),controller[_0xcd2b('0xd')]);module['exports']=router; \ No newline at end of file +var _0x7761=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x51d351,_0x3e1c83){var _0x1e0311=function(_0x1da5f5){while(--_0x1da5f5){_0x51d351['push'](_0x51d351['shift']());}};_0x1e0311(++_0x3e1c83);}(_0x7761,0x7b));var _0x1776=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7761[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1776('0x0'));var util=require(_0x1776('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1776('0x2'));var router=express[_0x1776('0x3')]();var fs_extra=require(_0x1776('0x4'));var auth=require(_0x1776('0x5'));var interaction=require(_0x1776('0x6'));var config=require(_0x1776('0x7'));var controller=require(_0x1776('0x8'));router[_0x1776('0x9')](_0x1776('0xa'),auth[_0x1776('0xb')](),controller[_0x1776('0xc')]);router[_0x1776('0xd')]('/:id',auth[_0x1776('0xb')](),controller[_0x1776('0xe')]);module[_0x1776('0xf')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index eb54069..9cf0583 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9f7=['STRING','sequelize','exports'];(function(_0x543ccc,_0x11a788){var _0x10d1bc=function(_0xaf8f4c){while(--_0xaf8f4c){_0x543ccc['push'](_0x543ccc['shift']());}};_0x10d1bc(++_0x11a788);}(_0xc9f7,0x1ae));var _0x7c9f=function(_0x4f0f9c,_0x1d6f61){_0x4f0f9c=_0x4f0f9c-0x0;var _0x1e1be4=_0xc9f7[_0x4f0f9c];return _0x1e1be4;};'use strict';var Sequelize=require(_0x7c9f('0x0'));module[_0x7c9f('0x1')]={'name':{'type':Sequelize[_0x7c9f('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x7c9f('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x0214=['exports','STRING','name','sequelize'];(function(_0x333734,_0x412291){var _0x4e91e7=function(_0x272e12){while(--_0x272e12){_0x333734['push'](_0x333734['shift']());}};_0x4e91e7(++_0x412291);}(_0x0214,0x1f3));var _0x4021=function(_0x3c222b,_0x5d2eb7){_0x3c222b=_0x3c222b-0x0;var _0xd9fdbb=_0x0214[_0x3c222b];return _0xd9fdbb;};'use strict';var Sequelize=require(_0x4021('0x0'));module[_0x4021('0x1')]={'name':{'type':Sequelize[_0x4021('0x2')],'allowNull':![],'unique':_0x4021('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index cd3b43f..60ebace 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbbc=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','options','create','body','user','ContactItemTypes','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x3fe0d6,_0x568ce6){var _0x5aefe8=function(_0x58a402){while(--_0x58a402){_0x3fe0d6['push'](_0x3fe0d6['shift']());}};_0x5aefe8(++_0x568ce6);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x24e721,_0x4aec0c){_0x24e721=_0x24e721-0x0;var _0x16434e=_0xbbbc[_0x24e721];return _0x16434e;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];function respondWithStatusCode(_0x53e651,_0x56f81){_0x56f81=_0x56f81||0xcc;return function(_0x523c50){if(_0x523c50){return _0x53e651[_0xcbbb('0x18')](_0x56f81);}return _0x53e651[_0xcbbb('0x19')](_0x56f81)[_0xcbbb('0x1a')]();};}function respondWithResult(_0x47ea6a,_0x27ba56){_0x27ba56=_0x27ba56||0xc8;return function(_0x3ff767){if(_0x3ff767){return _0x47ea6a[_0xcbbb('0x19')](_0x27ba56)[_0xcbbb('0x1b')](_0x3ff767);}};}function respondWithFilteredResult(_0x47e679,_0x5af226){return function(_0x1bba39){if(_0x1bba39){var _0x30297d=typeof _0x5af226[_0xcbbb('0x1c')]===_0xcbbb('0x1d')&&typeof _0x5af226['limit']===_0xcbbb('0x1d');var _0x4ff973=_0x1bba39[_0xcbbb('0x1e')];var _0x3436af=_0x30297d?0x0:_0x5af226[_0xcbbb('0x1c')];var _0x5052df=_0x30297d?_0x1bba39['count']:_0x5af226['offset']+_0x5af226[_0xcbbb('0x1f')];var _0x3ae91b;if(_0x5052df>=_0x4ff973){_0x5052df=_0x4ff973;_0x3ae91b=0xc8;}else{_0x3ae91b=0xce;}_0x47e679[_0xcbbb('0x19')](_0x3ae91b);return _0x47e679[_0xcbbb('0x20')](_0xcbbb('0x21'),_0x3436af+'-'+_0x5052df+'/'+_0x4ff973)[_0xcbbb('0x1b')](_0x1bba39);}return null;};}function patchUpdates(_0x45de5f){return function(_0x2be36c){try{jsonpatch[_0xcbbb('0x22')](_0x2be36c,_0x45de5f,!![]);}catch(_0x2d4335){return BPromise['reject'](_0x2d4335);}return _0x2be36c[_0xcbbb('0x23')]();};}function saveUpdates(_0xe07b0,_0x159c62){return function(_0x42aaf1){if(_0x42aaf1){return _0x42aaf1[_0xcbbb('0x24')](_0xe07b0)[_0xcbbb('0x25')](function(_0x297eae){return _0x297eae;});}return null;};}function removeEntity(_0xabb565,_0x3ca570){return function(_0x5e3970){if(_0x5e3970){return _0x5e3970[_0xcbbb('0x26')]()[_0xcbbb('0x25')](function(){var _0x4c543a=_0x5e3970[_0xcbbb('0x27')]({'plain':!![]});var _0x4ffa80='ContactItemTypes';return db[_0xcbbb('0x28')][_0xcbbb('0x26')]({'where':{'type':_0x4ffa80,'resourceId':_0x4c543a['id']}})['then'](function(){return _0x5e3970;});})['then'](function(){_0xabb565['status'](0xcc)[_0xcbbb('0x1a')]();});}};}function handleEntityNotFound(_0x55e1d8,_0x4da775){return function(_0x21e3b1){if(!_0x21e3b1){_0x55e1d8[_0xcbbb('0x18')](0x194);}return _0x21e3b1;};}function handleError(_0x38f1c6,_0x13121e){_0x13121e=_0x13121e||0x1f4;return function(_0x372024){logger[_0xcbbb('0x29')](_0x372024[_0xcbbb('0x2a')]);if(_0x372024[_0xcbbb('0x2b')]){delete _0x372024[_0xcbbb('0x2b')];}_0x38f1c6[_0xcbbb('0x19')](_0x13121e)[_0xcbbb('0x2c')](_0x372024);};}exports[_0xcbbb('0x2d')]=function(_0xfa973b,_0x1ce741){var _0x2a9639={},_0xcae72c={},_0x117739={'count':0x0,'rows':[]};var _0x21c560=_['map'](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')],function(_0x5332f9){return{'name':_0x5332f9[_0xcbbb('0x30')],'type':_0x5332f9['type'][_0xcbbb('0x31')]};});_0xcae72c[_0xcbbb('0x32')]=_[_0xcbbb('0x33')](_0x21c560,'name');_0xcae72c[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0xfa973b[_0xcbbb('0x34')]);_0xcae72c[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],_0xcae72c[_0xcbbb('0x34')]);_0x2a9639[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],qs['fields'](_0xfa973b['query']['fields']));_0x2a9639['attributes']=_0x2a9639[_0xcbbb('0x38')][_0xcbbb('0x39')]?_0x2a9639[_0xcbbb('0x38')]:_0xcae72c[_0xcbbb('0x32')];if(!_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3a')](_0xcbbb('0x3b'))){_0x2a9639[_0xcbbb('0x1f')]=qs[_0xcbbb('0x1f')](_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x1f')]);_0x2a9639[_0xcbbb('0x1c')]=qs['offset'](_0xfa973b['query'][_0xcbbb('0x1c')]);}_0x2a9639['order']=qs['sort'](_0xfa973b['query'][_0xcbbb('0x3c')]);_0x2a9639[_0xcbbb('0x3d')]=qs[_0xcbbb('0x36')](_[_0xcbbb('0x3e')](_0xfa973b[_0xcbbb('0x34')],_0xcae72c[_0xcbbb('0x36')]),_0x21c560);if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]){_0x2a9639[_0xcbbb('0x3d')]=_[_0xcbbb('0x40')](_0x2a9639[_0xcbbb('0x3d')],{'$or':_['map'](_0x21c560,function(_0x21ec4b){if(_0x21ec4b['type']!==_0xcbbb('0x41')){var _0xf5b6f9={};_0xf5b6f9[_0x21ec4b[_0xcbbb('0x2b')]]={'$like':'%'+_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]+'%'};return _0xf5b6f9;}})});}_0x2a9639=_[_0xcbbb('0x40')]({},_0x2a9639,_0xfa973b['options']);var _0x4d31d2={'where':_0x2a9639['where']};return db[_0xcbbb('0x2e')][_0xcbbb('0x1e')](_0x4d31d2)[_0xcbbb('0x25')](function(_0x162979){_0x117739[_0xcbbb('0x1e')]=_0x162979;if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x2a9639['include']=[{'all':!![]}];}return db[_0xcbbb('0x2e')][_0xcbbb('0x43')](_0x2a9639);})['then'](function(_0x15b3bc){_0x117739[_0xcbbb('0x44')]=_0x15b3bc;return _0x117739;})[_0xcbbb('0x25')](respondWithFilteredResult(_0x1ce741,_0x2a9639))[_0xcbbb('0x45')](handleError(_0x1ce741,null));};exports[_0xcbbb('0x46')]=function(_0x50adf5,_0x224682){var _0x58d5cb={'raw':!![],'where':{'id':_0x50adf5[_0xcbbb('0x47')]['id']}},_0x520448={};_0x520448[_0xcbbb('0x32')]=_[_0xcbbb('0x35')](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')]);_0x520448[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0x50adf5[_0xcbbb('0x34')]);_0x520448[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0x520448[_0xcbbb('0x32')],_0x520448[_0xcbbb('0x34')]);_0x58d5cb[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0x520448['model'],qs[_0xcbbb('0x48')](_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x48')]));_0x58d5cb[_0xcbbb('0x38')]=_0x58d5cb['attributes']['length']?_0x58d5cb['attributes']:_0x520448[_0xcbbb('0x32')];if(_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x58d5cb[_0xcbbb('0x49')]=[{'all':!![]}];}_0x58d5cb=_[_0xcbbb('0x40')]({},_0x58d5cb,_0x50adf5[_0xcbbb('0x4a')]);return db[_0xcbbb('0x2e')]['find'](_0x58d5cb)[_0xcbbb('0x25')](handleEntityNotFound(_0x224682,null))[_0xcbbb('0x25')](respondWithResult(_0x224682,null))[_0xcbbb('0x45')](handleError(_0x224682,null));};exports[_0xcbbb('0x4b')]=function(_0x478c22,_0x3378cd){return db[_0xcbbb('0x2e')][_0xcbbb('0x4b')](_0x478c22[_0xcbbb('0x4c')],{})['then'](function(_0x5e0366){var _0x3e1fdc=_0x478c22[_0xcbbb('0x4d')][_0xcbbb('0x27')]({'plain':!![]});if(!_0x3e1fdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1fdc['role']==='user'){var _0x189a40=_0x5e0366[_0xcbbb('0x27')]({'plain':!![]});var _0x4b866e=_0xcbbb('0x4e');return db[_0xcbbb('0x4f')][_0xcbbb('0x50')]({'where':{'name':_0x4b866e,'userProfileId':_0x3e1fdc[_0xcbbb('0x51')]},'raw':!![]})['then'](function(_0x33d21c){if(_0x33d21c&&_0x33d21c[_0xcbbb('0x52')]===0x0){return db[_0xcbbb('0x28')][_0xcbbb('0x4b')]({'name':_0x189a40[_0xcbbb('0x2b')],'resourceId':_0x189a40['id'],'type':_0x33d21c[_0xcbbb('0x2b')],'sectionId':_0x33d21c['id']},{})[_0xcbbb('0x25')](function(){return _0x5e0366;});}else{return _0x5e0366;}})[_0xcbbb('0x45')](function(_0x2d3990){logger[_0xcbbb('0x29')](_0xcbbb('0x53'),_0x2d3990);throw _0x2d3990;});}return _0x5e0366;})['then'](respondWithResult(_0x3378cd,0xc9))['catch'](handleError(_0x3378cd,null));};exports[_0xcbbb('0x24')]=function(_0x1eb822,_0x354efc){if(_0x1eb822['body']['id']){delete _0x1eb822[_0xcbbb('0x4c')]['id'];}return db['ContactItemType'][_0xcbbb('0x50')]({'where':{'id':_0x1eb822[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x354efc,null))[_0xcbbb('0x25')](saveUpdates(_0x1eb822[_0xcbbb('0x4c')],null))[_0xcbbb('0x25')](respondWithResult(_0x354efc,null))['catch'](handleError(_0x354efc,null));};exports['destroy']=function(_0x4cc098,_0x370e6d){return db[_0xcbbb('0x2e')][_0xcbbb('0x50')]({'where':{'id':_0x4cc098[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x370e6d,null))[_0xcbbb('0x25')](db[_0xcbbb('0x54')][_0xcbbb('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4cc098[_0xcbbb('0x47')]['id']}}))[_0xcbbb('0x25')](removeEntity(_0x370e6d,null))[_0xcbbb('0x45')](handleError(_0x370e6d,null));}; \ No newline at end of file +var _0x77e6=['catch','params','intersection','find','create','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','merge','filter','options','include','findAll','rows'];(function(_0x5c22cc,_0x55d72f){var _0x65f835=function(_0x4e27f1){while(--_0x4e27f1){_0x5c22cc['push'](_0x5c22cc['shift']());}};_0x65f835(++_0x55d72f);}(_0x77e6,0x1a6));var _0x677e=function(_0x340b4b,_0x199271){_0x340b4b=_0x340b4b-0x0;var _0x27850b=_0x77e6[_0x340b4b];return _0x27850b;};'use strict';var emlformat=require(_0x677e('0x0'));var rimraf=require(_0x677e('0x1'));var zipdir=require(_0x677e('0x2'));var jsonpatch=require(_0x677e('0x3'));var rp=require(_0x677e('0x4'));var moment=require(_0x677e('0x5'));var BPromise=require(_0x677e('0x6'));var Mustache=require(_0x677e('0x7'));var util=require('util');var path=require(_0x677e('0x8'));var sox=require(_0x677e('0x9'));var csv=require('to-csv');var ejs=require(_0x677e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');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('0xe'));var querystring=require(_0x677e('0xf'));var Papa=require('papaparse');var Redis=require(_0x677e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x677e('0x11'));var as=require(_0x677e('0x12'));var hardwareService=require(_0x677e('0x13'));var logger=require(_0x677e('0x14'))(_0x677e('0x15'));var utils=require(_0x677e('0x16'));var config=require(_0x677e('0x17'));var licenseUtil=require(_0x677e('0x18'));var db=require(_0x677e('0x19'))['db'];function respondWithStatusCode(_0x46a67e,_0x366490){_0x366490=_0x366490||0xcc;return function(_0x2a5f95){if(_0x2a5f95){return _0x46a67e[_0x677e('0x1a')](_0x366490);}return _0x46a67e[_0x677e('0x1b')](_0x366490)['end']();};}function respondWithResult(_0x512631,_0x5c7351){_0x5c7351=_0x5c7351||0xc8;return function(_0x213a50){if(_0x213a50){return _0x512631[_0x677e('0x1b')](_0x5c7351)[_0x677e('0x1c')](_0x213a50);}};}function respondWithFilteredResult(_0x36e976,_0x4daa04){return function(_0x42d0c3){if(_0x42d0c3){var _0x24c9eb=typeof _0x4daa04[_0x677e('0x1d')]===_0x677e('0x1e')&&typeof _0x4daa04[_0x677e('0x1f')]===_0x677e('0x1e');var _0xe4d960=_0x42d0c3['count'];var _0x1c5124=_0x24c9eb?0x0:_0x4daa04[_0x677e('0x1d')];var _0x385b06=_0x24c9eb?_0x42d0c3[_0x677e('0x20')]:_0x4daa04[_0x677e('0x1d')]+_0x4daa04[_0x677e('0x1f')];var _0x52f65d;if(_0x385b06>=_0xe4d960){_0x385b06=_0xe4d960;_0x52f65d=0xc8;}else{_0x52f65d=0xce;}_0x36e976[_0x677e('0x1b')](_0x52f65d);return _0x36e976['set'](_0x677e('0x21'),_0x1c5124+'-'+_0x385b06+'/'+_0xe4d960)[_0x677e('0x1c')](_0x42d0c3);}return null;};}function patchUpdates(_0x26e9c5){return function(_0x593aed){try{jsonpatch[_0x677e('0x22')](_0x593aed,_0x26e9c5,!![]);}catch(_0x1a6122){return BPromise[_0x677e('0x23')](_0x1a6122);}return _0x593aed[_0x677e('0x24')]();};}function saveUpdates(_0x295964,_0x8732e0){return function(_0x3a7895){if(_0x3a7895){return _0x3a7895['update'](_0x295964)['then'](function(_0x52d915){return _0x52d915;});}return null;};}function removeEntity(_0x357466,_0x154fce){return function(_0x31a1e4){if(_0x31a1e4){return _0x31a1e4[_0x677e('0x25')]()[_0x677e('0x26')](function(){var _0x2cda81=_0x31a1e4[_0x677e('0x27')]({'plain':!![]});var _0x42f2b8=_0x677e('0x28');return db[_0x677e('0x29')]['destroy']({'where':{'type':_0x42f2b8,'resourceId':_0x2cda81['id']}})['then'](function(){return _0x31a1e4;});})[_0x677e('0x26')](function(){_0x357466[_0x677e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e39d,_0x264ed3){return function(_0xf6b3ad){if(!_0xf6b3ad){_0x51e39d[_0x677e('0x1a')](0x194);}return _0xf6b3ad;};}function handleError(_0x21a26b,_0x1c0f28){_0x1c0f28=_0x1c0f28||0x1f4;return function(_0x56ad40){logger[_0x677e('0x2a')](_0x56ad40[_0x677e('0x2b')]);if(_0x56ad40[_0x677e('0x2c')]){delete _0x56ad40[_0x677e('0x2c')];}_0x21a26b[_0x677e('0x1b')](_0x1c0f28)[_0x677e('0x2d')](_0x56ad40);};}exports[_0x677e('0x2e')]=function(_0x10eb66,_0x9d49b5){var _0x4c5113={},_0x22ccfb={},_0x3cac19={'count':0x0,'rows':[]};var _0x2fb815=_[_0x677e('0x2f')](db[_0x677e('0x30')][_0x677e('0x31')],function(_0x34bb3d){return{'name':_0x34bb3d[_0x677e('0x32')],'type':_0x34bb3d[_0x677e('0x33')][_0x677e('0x34')]};});_0x22ccfb['model']=_[_0x677e('0x2f')](_0x2fb815,_0x677e('0x2c'));_0x22ccfb[_0x677e('0x35')]=_[_0x677e('0x36')](_0x10eb66[_0x677e('0x35')]);_0x22ccfb[_0x677e('0x37')]=_['intersection'](_0x22ccfb[_0x677e('0x38')],_0x22ccfb[_0x677e('0x35')]);_0x4c5113[_0x677e('0x39')]=_['intersection'](_0x22ccfb[_0x677e('0x38')],qs[_0x677e('0x3a')](_0x10eb66[_0x677e('0x35')][_0x677e('0x3a')]));_0x4c5113[_0x677e('0x39')]=_0x4c5113['attributes'][_0x677e('0x3b')]?_0x4c5113[_0x677e('0x39')]:_0x22ccfb[_0x677e('0x38')];if(!_0x10eb66[_0x677e('0x35')]['hasOwnProperty'](_0x677e('0x3c'))){_0x4c5113[_0x677e('0x1f')]=qs[_0x677e('0x1f')](_0x10eb66['query']['limit']);_0x4c5113[_0x677e('0x1d')]=qs[_0x677e('0x1d')](_0x10eb66['query'][_0x677e('0x1d')]);}_0x4c5113[_0x677e('0x3d')]=qs['sort'](_0x10eb66['query'][_0x677e('0x3e')]);_0x4c5113[_0x677e('0x3f')]=qs['filters'](_['pick'](_0x10eb66[_0x677e('0x35')],_0x22ccfb[_0x677e('0x37')]),_0x2fb815);if(_0x10eb66[_0x677e('0x35')]['filter']){_0x4c5113[_0x677e('0x3f')]=_[_0x677e('0x40')](_0x4c5113[_0x677e('0x3f')],{'$or':_[_0x677e('0x2f')](_0x2fb815,function(_0x6756e8){if(_0x6756e8['type']!=='VIRTUAL'){var _0x15faa3={};_0x15faa3[_0x6756e8[_0x677e('0x2c')]]={'$like':'%'+_0x10eb66[_0x677e('0x35')][_0x677e('0x41')]+'%'};return _0x15faa3;}})});}_0x4c5113=_[_0x677e('0x40')]({},_0x4c5113,_0x10eb66[_0x677e('0x42')]);var _0x1b9a35={'where':_0x4c5113[_0x677e('0x3f')]};return db[_0x677e('0x30')][_0x677e('0x20')](_0x1b9a35)['then'](function(_0x56eb30){_0x3cac19[_0x677e('0x20')]=_0x56eb30;if(_0x10eb66[_0x677e('0x35')]['includeAll']){_0x4c5113[_0x677e('0x43')]=[{'all':!![]}];}return db['ContactItemType'][_0x677e('0x44')](_0x4c5113);})[_0x677e('0x26')](function(_0x283aaa){_0x3cac19[_0x677e('0x45')]=_0x283aaa;return _0x3cac19;})[_0x677e('0x26')](respondWithFilteredResult(_0x9d49b5,_0x4c5113))[_0x677e('0x46')](handleError(_0x9d49b5,null));};exports['show']=function(_0x17fe91,_0x1f2bf5){var _0x2c2fd4={'raw':!![],'where':{'id':_0x17fe91[_0x677e('0x47')]['id']}},_0x33fce2={};_0x33fce2[_0x677e('0x38')]=_['keys'](db[_0x677e('0x30')]['rawAttributes']);_0x33fce2[_0x677e('0x35')]=_[_0x677e('0x36')](_0x17fe91[_0x677e('0x35')]);_0x33fce2[_0x677e('0x37')]=_[_0x677e('0x48')](_0x33fce2[_0x677e('0x38')],_0x33fce2[_0x677e('0x35')]);_0x2c2fd4[_0x677e('0x39')]=_[_0x677e('0x48')](_0x33fce2[_0x677e('0x38')],qs['fields'](_0x17fe91[_0x677e('0x35')]['fields']));_0x2c2fd4['attributes']=_0x2c2fd4[_0x677e('0x39')][_0x677e('0x3b')]?_0x2c2fd4[_0x677e('0x39')]:_0x33fce2[_0x677e('0x38')];if(_0x17fe91[_0x677e('0x35')]['includeAll']){_0x2c2fd4[_0x677e('0x43')]=[{'all':!![]}];}_0x2c2fd4=_[_0x677e('0x40')]({},_0x2c2fd4,_0x17fe91[_0x677e('0x42')]);return db[_0x677e('0x30')][_0x677e('0x49')](_0x2c2fd4)['then'](handleEntityNotFound(_0x1f2bf5,null))[_0x677e('0x26')](respondWithResult(_0x1f2bf5,null))[_0x677e('0x46')](handleError(_0x1f2bf5,null));};exports[_0x677e('0x4a')]=function(_0x496627,_0x30ed5c){return db['ContactItemType'][_0x677e('0x4a')](_0x496627['body'],{})['then'](function(_0x3bd614){var _0x23f9ec=_0x496627[_0x677e('0x4b')][_0x677e('0x27')]({'plain':!![]});if(!_0x23f9ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23f9ec[_0x677e('0x4c')]===_0x677e('0x4b')){var _0x51b2b8=_0x3bd614[_0x677e('0x27')]({'plain':!![]});var _0x558d43=_0x677e('0x28');return db[_0x677e('0x4d')][_0x677e('0x49')]({'where':{'name':_0x558d43,'userProfileId':_0x23f9ec['userProfileId']},'raw':!![]})[_0x677e('0x26')](function(_0x4fa910){if(_0x4fa910&&_0x4fa910['autoAssociation']===0x0){return db[_0x677e('0x29')]['create']({'name':_0x51b2b8[_0x677e('0x2c')],'resourceId':_0x51b2b8['id'],'type':_0x4fa910[_0x677e('0x2c')],'sectionId':_0x4fa910['id']},{})[_0x677e('0x26')](function(){return _0x3bd614;});}else{return _0x3bd614;}})[_0x677e('0x46')](function(_0x410012){logger[_0x677e('0x2a')](_0x677e('0x4e'),_0x410012);throw _0x410012;});}return _0x3bd614;})['then'](respondWithResult(_0x30ed5c,0xc9))['catch'](handleError(_0x30ed5c,null));};exports['update']=function(_0x42799b,_0x3d374d){if(_0x42799b[_0x677e('0x4f')]['id']){delete _0x42799b[_0x677e('0x4f')]['id'];}return db[_0x677e('0x30')][_0x677e('0x49')]({'where':{'id':_0x42799b['params']['id']}})[_0x677e('0x26')](handleEntityNotFound(_0x3d374d,null))[_0x677e('0x26')](saveUpdates(_0x42799b['body'],null))[_0x677e('0x26')](respondWithResult(_0x3d374d,null))['catch'](handleError(_0x3d374d,null));};exports[_0x677e('0x25')]=function(_0x20ae18,_0x284a3a){return db[_0x677e('0x30')]['find']({'where':{'id':_0x20ae18[_0x677e('0x47')]['id']}})['then'](handleEntityNotFound(_0x284a3a,null))[_0x677e('0x26')](db[_0x677e('0x50')][_0x677e('0x51')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x20ae18[_0x677e('0x47')]['id']}}))[_0x677e('0x26')](removeEntity(_0x284a3a,null))['catch'](handleError(_0x284a3a,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index e4e90d5..88e9c0e 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd262=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger'];(function(_0x15b44b,_0x16fe09){var _0x3d6945=function(_0x50bb52){while(--_0x50bb52){_0x15b44b['push'](_0x15b44b['shift']());}};_0x3d6945(++_0x16fe09);}(_0xd262,0x97));var _0x2d26=function(_0x2b5a7c,_0x3c6053){_0x2b5a7c=_0x2b5a7c-0x0;var _0x1a5deb=_0xd262[_0x2b5a7c];return _0x1a5deb;};'use strict';var _=require(_0x2d26('0x0'));var util=require(_0x2d26('0x1'));var logger=require(_0x2d26('0x2'))(_0x2d26('0x3'));var moment=require(_0x2d26('0x4'));var BPromise=require(_0x2d26('0x5'));var rp=require(_0x2d26('0x6'));var fs=require('fs');var path=require(_0x2d26('0x7'));var rimraf=require(_0x2d26('0x8'));var config=require(_0x2d26('0x9'));var attributes=require('./contactItemType.attributes');module[_0x2d26('0xa')]=function(_0x5e079f,_0x3a6877){return _0x5e079f[_0x2d26('0xb')](_0x2d26('0xc'),attributes,{'tableName':_0x2d26('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2ae=['define','ContactItemType','tools_contact_item_types','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./contactItemType.attributes','exports'];(function(_0x2c618f,_0x35c490){var _0x24397a=function(_0x2c3d7c){while(--_0x2c3d7c){_0x2c618f['push'](_0x2c618f['shift']());}};_0x24397a(++_0x35c490);}(_0xf2ae,0x19b));var _0xef2a=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xf2ae[_0x20589d];return _0x422de9;};'use strict';var _=require('lodash');var util=require(_0xef2a('0x0'));var logger=require(_0xef2a('0x1'))(_0xef2a('0x2'));var moment=require(_0xef2a('0x3'));var BPromise=require(_0xef2a('0x4'));var rp=require(_0xef2a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef2a('0x6'));var config=require('../../config/environment');var attributes=require(_0xef2a('0x7'));module[_0xef2a('0x8')]=function(_0xf0aab5,_0x21465a){return _0xf0aab5[_0xef2a('0x9')](_0xef2a('0xa'),attributes,{'tableName':_0xef2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 05077f8..4b600e9 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07f5=['error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','ContactItemType,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x4b9640,_0xdd86b9){var _0xa45ebc=function(_0x125af1){while(--_0x125af1){_0x4b9640['push'](_0x4b9640['shift']());}};_0xa45ebc(++_0xdd86b9);}(_0x07f5,0xc1));var _0x507f=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x07f5[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x507f('0x0'));var util=require(_0x507f('0x1'));var moment=require(_0x507f('0x2'));var BPromise=require(_0x507f('0x3'));var rs=require(_0x507f('0x4'));var fs=require('fs');var Redis=require(_0x507f('0x5'));var db=require(_0x507f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x507f('0x7'))(_0x507f('0x8'));var config=require(_0x507f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x507f('0xa')][_0x507f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28aef4,_0xad9415,_0x406f7b){return new BPromise(function(_0x4ab3d0,_0xcd952f){return client[_0x507f('0xc')](_0x28aef4,_0x406f7b)[_0x507f('0xd')](function(_0x621c9c){logger['info'](_0x507f('0xe'),_0xad9415,'request\x20sent');logger[_0x507f('0xf')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0xad9415,_0x507f('0x10'),JSON['stringify'](_0x621c9c));if(_0x621c9c[_0x507f('0x11')]){if(_0x621c9c['error']['code']===0x1f4){logger[_0x507f('0x11')](_0x507f('0xe'),_0xad9415,_0x621c9c['error'][_0x507f('0x12')]);return _0xcd952f(_0x621c9c[_0x507f('0x11')]['message']);}logger['error'](_0x507f('0xe'),_0xad9415,_0x621c9c[_0x507f('0x11')][_0x507f('0x12')]);return _0x4ab3d0(_0x621c9c[_0x507f('0x11')][_0x507f('0x12')]);}else{logger[_0x507f('0x13')](_0x507f('0xe'),_0xad9415,_0x507f('0x10'));_0x4ab3d0(_0x621c9c['result'][_0x507f('0x12')]);}})[_0x507f('0x14')](function(_0xf4e4fa){logger[_0x507f('0x11')](_0x507f('0xe'),_0xad9415,_0xf4e4fa);_0xcd952f(_0xf4e4fa);});});} \ No newline at end of file +var _0xbc50=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x4737e0,_0x2d334b){var _0x38b9b2=function(_0x180389){while(--_0x180389){_0x4737e0['push'](_0x4737e0['shift']());}};_0x38b9b2(++_0x2d334b);}(_0xbc50,0x85));var _0x0bc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0bc5('0x0'));var BPromise=require('bluebird');var rs=require(_0x0bc5('0x1'));var fs=require('fs');var Redis=require(_0x0bc5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bc5('0x3'));var logger=require(_0x0bc5('0x4'))(_0x0bc5('0x5'));var config=require(_0x0bc5('0x6'));var jayson=require(_0x0bc5('0x7'));var client=jayson['client'][_0x0bc5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53d57b,_0x411946,_0x12a938){return new BPromise(function(_0x51ed70,_0x296aea){return client['request'](_0x53d57b,_0x12a938)['then'](function(_0x3ed3f4){logger[_0x0bc5('0x9')](_0x0bc5('0xa'),_0x411946,_0x0bc5('0xb'));logger[_0x0bc5('0xc')](_0x0bc5('0xd'),_0x411946,_0x0bc5('0xb'),JSON[_0x0bc5('0xe')](_0x3ed3f4));if(_0x3ed3f4[_0x0bc5('0xf')]){if(_0x3ed3f4[_0x0bc5('0xf')]['code']===0x1f4){logger[_0x0bc5('0xf')](_0x0bc5('0xa'),_0x411946,_0x3ed3f4[_0x0bc5('0xf')][_0x0bc5('0x10')]);return _0x296aea(_0x3ed3f4[_0x0bc5('0xf')][_0x0bc5('0x10')]);}logger[_0x0bc5('0xf')]('ContactItemType,\x20%s,\x20%s',_0x411946,_0x3ed3f4[_0x0bc5('0xf')][_0x0bc5('0x10')]);return _0x51ed70(_0x3ed3f4['error']['message']);}else{logger['info'](_0x0bc5('0xa'),_0x411946,_0x0bc5('0xb'));_0x51ed70(_0x3ed3f4[_0x0bc5('0x11')]['message']);}})[_0x0bc5('0x12')](function(_0x2b4194){logger[_0x0bc5('0xf')]('ContactItemType,\x20%s,\x20%s',_0x411946,_0x2b4194);_0x296aea(_0x2b4194);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 91b1ff1..ec2dd5b 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9191=['isAuthenticated','index','/:id','show','create','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get'];(function(_0x3d53d4,_0x479e0b){var _0x58a1ae=function(_0x22889a){while(--_0x22889a){_0x3d53d4['push'](_0x3d53d4['shift']());}};_0x58a1ae(++_0x479e0b);}(_0x9191,0xd2));var _0x1919=function(_0x411b68,_0x52e768){_0x411b68=_0x411b68-0x0;var _0x41ff90=_0x9191[_0x411b68];return _0x41ff90;};'use strict';var multer=require('multer');var util=require(_0x1919('0x0'));var path=require(_0x1919('0x1'));var timeout=require(_0x1919('0x2'));var express=require(_0x1919('0x3'));var router=express[_0x1919('0x4')]();var fs_extra=require(_0x1919('0x5'));var auth=require(_0x1919('0x6'));var interaction=require(_0x1919('0x7'));var config=require(_0x1919('0x8'));var controller=require(_0x1919('0x9'));router[_0x1919('0xa')]('/',auth[_0x1919('0xb')](),controller[_0x1919('0xc')]);router['get'](_0x1919('0xd'),auth['isAuthenticated'](),controller[_0x1919('0xe')]);router['post']('/',auth[_0x1919('0xb')](),controller[_0x1919('0xf')]);router['put'](_0x1919('0xd'),auth[_0x1919('0xb')](),controller[_0x1919('0x10')]);router['delete']('/:id',auth[_0x1919('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9a0c=['express','Router','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','multer','util','connect-timeout'];(function(_0x5a7032,_0x1b87d7){var _0x326576=function(_0x96f5f6){while(--_0x96f5f6){_0x5a7032['push'](_0x5a7032['shift']());}};_0x326576(++_0x1b87d7);}(_0x9a0c,0x173));var _0xc9a0=function(_0x2f1030,_0x1d32ca){_0x2f1030=_0x2f1030-0x0;var _0x50cce1=_0x9a0c[_0x2f1030];return _0x50cce1;};'use strict';var multer=require(_0xc9a0('0x0'));var util=require(_0xc9a0('0x1'));var path=require('path');var timeout=require(_0xc9a0('0x2'));var express=require(_0xc9a0('0x3'));var router=express[_0xc9a0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc9a0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9a0('0x6'));var controller=require(_0xc9a0('0x7'));router[_0xc9a0('0x8')]('/',auth[_0xc9a0('0x9')](),controller[_0xc9a0('0xa')]);router['get'](_0xc9a0('0xb'),auth['isAuthenticated'](),controller[_0xc9a0('0xc')]);router[_0xc9a0('0xd')]('/',auth[_0xc9a0('0x9')](),controller[_0xc9a0('0xe')]);router[_0xc9a0('0xf')](_0xc9a0('0xb'),auth[_0xc9a0('0x9')](),controller['update']);router['delete'](_0xc9a0('0xb'),auth[_0xc9a0('0x9')](),controller[_0xc9a0('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 5fcc6bf..1c3eed0 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x1d0f04,_0x5054ab){var _0x1181e0=function(_0x3dd27d){while(--_0x3dd27d){_0x1d0f04['push'](_0x1d0f04['shift']());}};_0x1181e0(++_0x5054ab);}(_0xb10b,0x12a));var _0xbb10=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0xb10b[_0x393500];return _0x120d3b;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x5e8d8b,_0x3defdb){var _0xc38051=function(_0x12dca7){while(--_0x12dca7){_0x5e8d8b['push'](_0x5e8d8b['shift']());}};_0xc38051(++_0x3defdb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 16eabab..31737c3 100644 --- a/server/api/dashboard/dashboard.controller.js +++ b/server/api/dashboard/dashboard.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0d9=['attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','type','attrRefresh','stringify','addItem','DashboardItem','getItems','findOne','order','nolimit','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','CustomDashboards','error','name','send','index','map','Dashboard','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','body','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter'];(function(_0xffd8b0,_0x12c51f){var _0x301ba0=function(_0x103c05){while(--_0x103c05){_0xffd8b0['push'](_0xffd8b0['shift']());}};_0x301ba0(++_0x12c51f);}(_0xb0d9,0x187));var _0x9b0d=function(_0x25fed6,_0x77900e){_0x25fed6=_0x25fed6-0x0;var _0x31d536=_0xb0d9[_0x25fed6];return _0x31d536;};'use strict';var emlformat=require(_0x9b0d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b0d('0x1'));var jsonpatch=require(_0x9b0d('0x2'));var rp=require('request-promise');var moment=require(_0x9b0d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9b0d('0x4'));var util=require(_0x9b0d('0x5'));var path=require('path');var sox=require(_0x9b0d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b0d('0x7'));var _=require(_0x9b0d('0x8'));var squel=require('squel');var crypto=require(_0x9b0d('0x9'));var jsforce=require(_0x9b0d('0xa'));var deskjs=require(_0x9b0d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9b0d('0xc'));var Papa=require('papaparse');var Redis=require(_0x9b0d('0xd'));var authService=require(_0x9b0d('0xe'));var qs=require(_0x9b0d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b0d('0x10'));var logger=require(_0x9b0d('0x11'))('api');var utils=require(_0x9b0d('0x12'));var config=require(_0x9b0d('0x13'));var licenseUtil=require(_0x9b0d('0x14'));var db=require('../../mysqldb')['db'];config[_0x9b0d('0x15')]=_['defaults'](config['redis'],{'host':_0x9b0d('0x16'),'port':0x18eb});var socket=require(_0x9b0d('0x17'))(new Redis(config[_0x9b0d('0x15')]));require(_0x9b0d('0x18'))[_0x9b0d('0x19')](socket);function respondWithStatusCode(_0x49092c,_0x4dc7f8){_0x4dc7f8=_0x4dc7f8||0xcc;return function(_0x34c0ec){if(_0x34c0ec){return _0x49092c[_0x9b0d('0x1a')](_0x4dc7f8);}return _0x49092c[_0x9b0d('0x1b')](_0x4dc7f8)['end']();};}function respondWithResult(_0x5054b1,_0xd44f25){_0xd44f25=_0xd44f25||0xc8;return function(_0x28a2ce){if(_0x28a2ce){return _0x5054b1[_0x9b0d('0x1b')](_0xd44f25)['json'](_0x28a2ce);}};}function respondWithFilteredResult(_0x5008af,_0x52a650){return function(_0x3d0bbe){if(_0x3d0bbe){var _0x26c0f7=typeof _0x52a650['offset']===_0x9b0d('0x1c')&&typeof _0x52a650[_0x9b0d('0x1d')]===_0x9b0d('0x1c');var _0x3f4e06=_0x3d0bbe[_0x9b0d('0x1e')];var _0x43b371=_0x26c0f7?0x0:_0x52a650[_0x9b0d('0x1f')];var _0x5ba1be=_0x26c0f7?_0x3d0bbe[_0x9b0d('0x1e')]:_0x52a650[_0x9b0d('0x1f')]+_0x52a650[_0x9b0d('0x1d')];var _0x46c1c8;if(_0x5ba1be>=_0x3f4e06){_0x5ba1be=_0x3f4e06;_0x46c1c8=0xc8;}else{_0x46c1c8=0xce;}_0x5008af[_0x9b0d('0x1b')](_0x46c1c8);return _0x5008af['set'](_0x9b0d('0x20'),_0x43b371+'-'+_0x5ba1be+'/'+_0x3f4e06)[_0x9b0d('0x21')](_0x3d0bbe);}return null;};}function patchUpdates(_0x2955bf){return function(_0x589278){try{jsonpatch[_0x9b0d('0x22')](_0x589278,_0x2955bf,!![]);}catch(_0x45b4be){return BPromise[_0x9b0d('0x23')](_0x45b4be);}return _0x589278[_0x9b0d('0x24')]();};}function saveUpdates(_0x33e6e4,_0x464c1e){return function(_0xb153d1){if(_0xb153d1){return _0xb153d1[_0x9b0d('0x25')](_0x33e6e4)[_0x9b0d('0x26')](function(_0x438a7b){return _0x438a7b;});}return null;};}function removeEntity(_0xa2b4af,_0x3bcda1){return function(_0x34b9cb){if(_0x34b9cb){return _0x34b9cb[_0x9b0d('0x27')]()[_0x9b0d('0x26')](function(){var _0x34f775=_0x34b9cb[_0x9b0d('0x28')]({'plain':!![]});var _0x1b11fd=_0x9b0d('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x1b11fd,'resourceId':_0x34f775['id']}})[_0x9b0d('0x26')](function(){return _0x34b9cb;});})['then'](function(){_0xa2b4af[_0x9b0d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e19d1,_0x44c496){return function(_0x3f5f06){if(!_0x3f5f06){_0x1e19d1[_0x9b0d('0x1a')](0x194);}return _0x3f5f06;};}function handleError(_0x4e6da4,_0x4ec829){_0x4ec829=_0x4ec829||0x1f4;return function(_0x4d82b7){logger[_0x9b0d('0x2a')](_0x4d82b7['stack']);if(_0x4d82b7[_0x9b0d('0x2b')]){delete _0x4d82b7[_0x9b0d('0x2b')];}_0x4e6da4[_0x9b0d('0x1b')](_0x4ec829)[_0x9b0d('0x2c')](_0x4d82b7);};}exports[_0x9b0d('0x2d')]=function(_0x211bba,_0x406f41){var _0x794fb4={},_0x12ed6d={},_0x469c7={'count':0x0,'rows':[]};var _0x5a4865=_[_0x9b0d('0x2e')](db[_0x9b0d('0x2f')][_0x9b0d('0x30')],function(_0x3d4625){return{'name':_0x3d4625['fieldName'],'type':_0x3d4625['type'][_0x9b0d('0x31')]};});_0x12ed6d[_0x9b0d('0x32')]=_[_0x9b0d('0x2e')](_0x5a4865,'name');_0x12ed6d[_0x9b0d('0x33')]=_[_0x9b0d('0x34')](_0x211bba[_0x9b0d('0x33')]);_0x12ed6d[_0x9b0d('0x35')]=_[_0x9b0d('0x36')](_0x12ed6d['model'],_0x12ed6d[_0x9b0d('0x33')]);_0x794fb4[_0x9b0d('0x37')]=_[_0x9b0d('0x36')](_0x12ed6d[_0x9b0d('0x32')],qs[_0x9b0d('0x38')](_0x211bba['query']['fields']));_0x794fb4[_0x9b0d('0x37')]=_0x794fb4[_0x9b0d('0x37')]['length']?_0x794fb4[_0x9b0d('0x37')]:_0x12ed6d[_0x9b0d('0x32')];if(!_0x211bba[_0x9b0d('0x33')][_0x9b0d('0x39')]('nolimit')){_0x794fb4['limit']=qs[_0x9b0d('0x1d')](_0x211bba[_0x9b0d('0x33')][_0x9b0d('0x1d')]);_0x794fb4[_0x9b0d('0x1f')]=qs[_0x9b0d('0x1f')](_0x211bba[_0x9b0d('0x33')][_0x9b0d('0x1f')]);}_0x794fb4['order']=qs[_0x9b0d('0x3a')](_0x211bba[_0x9b0d('0x33')]['sort']);_0x794fb4['where']=qs[_0x9b0d('0x35')](_[_0x9b0d('0x3b')](_0x211bba['query'],_0x12ed6d['filters']),_0x5a4865);if(_0x211bba[_0x9b0d('0x33')][_0x9b0d('0x3c')]){_0x794fb4[_0x9b0d('0x3d')]=_[_0x9b0d('0x3e')](_0x794fb4[_0x9b0d('0x3d')],{'$or':_['map'](_0x5a4865,function(_0x41f1bf){if(_0x41f1bf['type']!==_0x9b0d('0x3f')){var _0x299872={};_0x299872[_0x41f1bf[_0x9b0d('0x2b')]]={'$like':'%'+_0x211bba[_0x9b0d('0x33')][_0x9b0d('0x3c')]+'%'};return _0x299872;}})});}_0x794fb4=_['merge']({},_0x794fb4,_0x211bba[_0x9b0d('0x40')]);var _0x3c4b8e={'where':_0x794fb4[_0x9b0d('0x3d')]};return db[_0x9b0d('0x2f')][_0x9b0d('0x1e')](_0x3c4b8e)[_0x9b0d('0x26')](function(_0x4d3c2a){_0x469c7[_0x9b0d('0x1e')]=_0x4d3c2a;if(_0x211bba[_0x9b0d('0x33')][_0x9b0d('0x41')]){_0x794fb4['include']=[{'all':!![]}];}return db[_0x9b0d('0x2f')]['findAll'](_0x794fb4);})[_0x9b0d('0x26')](function(_0x35ea79){_0x469c7[_0x9b0d('0x42')]=_0x35ea79;return _0x469c7;})[_0x9b0d('0x26')](respondWithFilteredResult(_0x406f41,_0x794fb4))[_0x9b0d('0x43')](handleError(_0x406f41,null));};exports[_0x9b0d('0x44')]=function(_0x17061d,_0x55354f){var _0x1fca12={'raw':![],'where':{'id':_0x17061d[_0x9b0d('0x45')]['id']}},_0x412ae9={};_0x412ae9['model']=_[_0x9b0d('0x34')](db[_0x9b0d('0x2f')]['rawAttributes']);_0x412ae9[_0x9b0d('0x33')]=_[_0x9b0d('0x34')](_0x17061d['query']);_0x412ae9[_0x9b0d('0x35')]=_[_0x9b0d('0x36')](_0x412ae9[_0x9b0d('0x32')],_0x412ae9['query']);_0x1fca12[_0x9b0d('0x37')]=_[_0x9b0d('0x36')](_0x412ae9[_0x9b0d('0x32')],qs[_0x9b0d('0x38')](_0x17061d[_0x9b0d('0x33')][_0x9b0d('0x38')]));_0x1fca12[_0x9b0d('0x37')]=_0x1fca12[_0x9b0d('0x37')][_0x9b0d('0x46')]?_0x1fca12['attributes']:_0x412ae9[_0x9b0d('0x32')];if(_0x17061d[_0x9b0d('0x33')][_0x9b0d('0x41')]){_0x1fca12[_0x9b0d('0x47')]=[{'all':!![]}];}_0x1fca12=_['merge']({},_0x1fca12,_0x17061d['options']);return db['Dashboard'][_0x9b0d('0x48')](_0x1fca12)[_0x9b0d('0x26')](handleEntityNotFound(_0x55354f,null))[_0x9b0d('0x26')](respondWithResult(_0x55354f,null))[_0x9b0d('0x43')](handleError(_0x55354f,null));};exports[_0x9b0d('0x49')]=function(_0x2de0a2,_0x450cb2){return db[_0x9b0d('0x2f')][_0x9b0d('0x49')](_0x2de0a2['body'],{})[_0x9b0d('0x26')](function(_0x2acc1d){var _0x509412=_0x2de0a2[_0x9b0d('0x4a')][_0x9b0d('0x28')]({'plain':!![]});if(!_0x509412)throw new Error(_0x9b0d('0x4b'));if(_0x509412[_0x9b0d('0x4c')]===_0x9b0d('0x4a')){var _0x26aafd=_0x2acc1d[_0x9b0d('0x28')]({'plain':!![]});var _0x3aad4b=_0x9b0d('0x29');return db[_0x9b0d('0x4d')][_0x9b0d('0x48')]({'where':{'name':_0x3aad4b,'userProfileId':_0x509412[_0x9b0d('0x4e')]},'raw':!![]})[_0x9b0d('0x26')](function(_0x519a6d){if(_0x519a6d&&_0x519a6d[_0x9b0d('0x4f')]===0x0){return db['UserProfileResource'][_0x9b0d('0x49')]({'name':_0x26aafd[_0x9b0d('0x2b')],'resourceId':_0x26aafd['id'],'type':_0x519a6d[_0x9b0d('0x2b')],'sectionId':_0x519a6d['id']},{})[_0x9b0d('0x26')](function(){return _0x2acc1d;});}else{return _0x2acc1d;}})['catch'](function(_0x54c2c5){logger['error'](_0x9b0d('0x50'),_0x54c2c5);throw _0x54c2c5;});}return _0x2acc1d;})['then'](respondWithResult(_0x450cb2,0xc9))[_0x9b0d('0x43')](handleError(_0x450cb2,null));};exports['clone']=function(_0x2d5972,_0x42c2c9){var _0x3dc94b={'where':{'id':_0x2d5972[_0x9b0d('0x45')]['id']}},_0x5c044d={};_0x5c044d[_0x9b0d('0x32')]=_[_0x9b0d('0x34')](db[_0x9b0d('0x2f')][_0x9b0d('0x30')]);_0x3dc94b[_0x9b0d('0x37')]=_[_0x9b0d('0x36')](_0x5c044d[_0x9b0d('0x32')],qs['fields'](_0x2d5972[_0x9b0d('0x33')][_0x9b0d('0x38')]));_0x3dc94b[_0x9b0d('0x37')]=_0x3dc94b[_0x9b0d('0x37')][_0x9b0d('0x46')]?_0x3dc94b['attributes']:_0x5c044d[_0x9b0d('0x32')];if(_0x2d5972[_0x9b0d('0x33')][_0x9b0d('0x41')]){_0x3dc94b[_0x9b0d('0x47')]=[{'all':!![]}];}_0x3dc94b=_[_0x9b0d('0x3e')]({},_0x3dc94b,_0x2d5972['options']);return db[_0x9b0d('0x2f')][_0x9b0d('0x48')](_0x3dc94b)['then'](handleEntityNotFound(_0x42c2c9,null))[_0x9b0d('0x26')](function(_0x2b0454){if(_0x2b0454){var _0x223e27=_0x2b0454[_0x9b0d('0x28')]({'plain':!![]});_0x223e27=qs[_0x9b0d('0x51')](_0x223e27,['id','createdAt','updatedAt']);_0x2d5972[_0x9b0d('0x52')]=_[_0x9b0d('0x51')](_0x2d5972[_0x9b0d('0x52')],['id',_0x9b0d('0x53'),_0x9b0d('0x54')]);return db[_0x9b0d('0x2f')][_0x9b0d('0x49')](_[_0x9b0d('0x3e')](_0x223e27,_0x2d5972[_0x9b0d('0x52')]),{'include':_0x2d5972[_0x9b0d('0x33')][_0x9b0d('0x41')]?[{'all':!![]}]:undefined})[_0x9b0d('0x26')](function(_0x5d1f97){var _0xd5fe4e=_0x2d5972[_0x9b0d('0x4a')][_0x9b0d('0x28')]({'plain':!![]});if(!_0xd5fe4e)throw new Error(_0x9b0d('0x4b'));if(_0xd5fe4e[_0x9b0d('0x4c')]==='user'){var _0x4fc292=_0x5d1f97[_0x9b0d('0x28')]({'plain':!![]});var _0x9320c1=_0x9b0d('0x29');return db['UserProfileSection'][_0x9b0d('0x48')]({'where':{'name':_0x9320c1,'userProfileId':_0xd5fe4e[_0x9b0d('0x4e')]},'raw':!![]})[_0x9b0d('0x26')](function(_0x47bb15){if(_0x47bb15&&_0x47bb15['autoAssociation']===0x0){return db['UserProfileResource'][_0x9b0d('0x49')]({'name':_0x4fc292[_0x9b0d('0x2b')],'resourceId':_0x4fc292['id'],'type':_0x47bb15[_0x9b0d('0x2b')],'sectionId':_0x47bb15['id']},{})['then'](function(){return _0x5d1f97;});}else{return _0x5d1f97;}})[_0x9b0d('0x43')](function(_0x57da76){logger[_0x9b0d('0x2a')](_0x9b0d('0x50'),_0x57da76);throw _0x57da76;});}return _0x5d1f97;});}})['then'](respondWithResult(_0x42c2c9,0xc9))[_0x9b0d('0x43')](handleError(_0x42c2c9,null));};exports[_0x9b0d('0x25')]=function(_0x4daa3a,_0x3286e4){if(_0x4daa3a['body']['id']){delete _0x4daa3a[_0x9b0d('0x52')]['id'];}return db['Dashboard'][_0x9b0d('0x48')]({'where':{'id':_0x4daa3a[_0x9b0d('0x45')]['id']}})[_0x9b0d('0x26')](handleEntityNotFound(_0x3286e4,null))['then'](saveUpdates(_0x4daa3a[_0x9b0d('0x52')],null))[_0x9b0d('0x26')](respondWithResult(_0x3286e4,null))[_0x9b0d('0x43')](handleError(_0x3286e4,null));};exports['destroy']=function(_0x9fb60d,_0x54b8a4){return db[_0x9b0d('0x2f')][_0x9b0d('0x48')]({'where':{'id':_0x9fb60d[_0x9b0d('0x45')]['id']}})['then'](handleEntityNotFound(_0x54b8a4,null))['then'](removeEntity(_0x54b8a4,null))['catch'](handleError(_0x54b8a4,null));};function widgetAttributes(_0x3f0cc4){try{switch(_0x3f0cc4['type']){case _0x9b0d('0x55'):return[{'name':_0x9b0d('0x56'),'value':_0x3f0cc4[_0x9b0d('0x56')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x0]?_0x3f0cc4[_0x9b0d('0x57')][0x0][_0x9b0d('0x58')]:undefined)||_0x9b0d('0x59')}];case _0x9b0d('0x5a'):return[{'name':_0x9b0d('0x5b'),'value':_0x3f0cc4[_0x9b0d('0x5b')]||(_0x3f0cc4['attrs']&&_0x3f0cc4[_0x9b0d('0x57')][0x0]?_0x3f0cc4[_0x9b0d('0x57')][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x3f0cc4['attrHourFormat']||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x0]?_0x3f0cc4['attrs'][0x0][_0x9b0d('0x58')]:undefined)||_0x9b0d('0x5c')},{'name':'attrTimezone','value':_0x3f0cc4[_0x9b0d('0x5d')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x1]?_0x3f0cc4['attrs'][0x1]['value']:undefined)||_0x9b0d('0x5e')},{'name':_0x9b0d('0x5f'),'value':_0x3f0cc4[_0x9b0d('0x5f')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x2]?_0x3f0cc4['attrs'][0x2][_0x9b0d('0x58')]:undefined)||0xc}];case _0x9b0d('0x60'):return[{'name':'attrMetric','value':_0x3f0cc4[_0x9b0d('0x61')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4['attrs'][0x0]?_0x3f0cc4[_0x9b0d('0x57')][0x0][_0x9b0d('0x58')]:undefined)||_0x9b0d('0x62')},{'name':_0x9b0d('0x63'),'value':_0x3f0cc4[_0x9b0d('0x63')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4['attrs'][0x1]?_0x3f0cc4[_0x9b0d('0x57')][0x1][_0x9b0d('0x58')]:undefined)||[]},{'name':'attrFontSize','value':_0x3f0cc4['attrFontSize']||(_0x3f0cc4['attrs']&&_0x3f0cc4[_0x9b0d('0x57')][0x2]?_0x3f0cc4['attrs'][0x2]['value']:undefined)||0x14},{'name':_0x9b0d('0x64'),'value':_0x3f0cc4[_0x9b0d('0x64')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4['attrs'][0x3]?_0x3f0cc4[_0x9b0d('0x57')][0x3][_0x9b0d('0x58')]:undefined)||'voice'},{'name':_0x9b0d('0x65'),'value':_0x3f0cc4[_0x9b0d('0x65')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x4]?_0x3f0cc4[_0x9b0d('0x57')][0x4][_0x9b0d('0x58')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x3f0cc4[_0x9b0d('0x66')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x5]?_0x3f0cc4['attrs'][0x5][_0x9b0d('0x58')]:undefined)||''},{'name':_0x9b0d('0x67'),'value':_0x3f0cc4[_0x9b0d('0x67')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4['attrs'][0x6]?_0x3f0cc4['attrs'][0x6][_0x9b0d('0x58')]:undefined)||''},{'name':_0x9b0d('0x68'),'value':_0x3f0cc4[_0x9b0d('0x68')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x7]?_0x3f0cc4[_0x9b0d('0x57')][0x7]['value']:undefined)||''},{'name':_0x9b0d('0x69'),'value':_0x3f0cc4[_0x9b0d('0x69')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x8]?_0x3f0cc4[_0x9b0d('0x57')][0x8][_0x9b0d('0x58')]:undefined)||''},{'name':_0x9b0d('0x6a'),'value':_0x3f0cc4[_0x9b0d('0x6a')]||(_0x3f0cc4['attrs']&&_0x3f0cc4[_0x9b0d('0x57')][0x9]?_0x3f0cc4[_0x9b0d('0x57')][0x9][_0x9b0d('0x58')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x9b0d('0x6b'),'value':_0x3f0cc4[_0x9b0d('0x6b')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x0]?_0x3f0cc4[_0x9b0d('0x57')][0x0][_0x9b0d('0x58')]:undefined)||_0x9b0d('0x62')},{'name':_0x9b0d('0x6c'),'value':_0x3f0cc4['attrSerie2']||(_0x3f0cc4['attrs']&&_0x3f0cc4[_0x9b0d('0x57')][0x1]?_0x3f0cc4[_0x9b0d('0x57')][0x1][_0x9b0d('0x58')]:undefined)||null},{'name':_0x9b0d('0x6d'),'value':_0x3f0cc4['attrSerie3']||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x2]?_0x3f0cc4[_0x9b0d('0x57')][0x2][_0x9b0d('0x58')]:undefined)||null},{'name':_0x9b0d('0x63'),'value':_0x3f0cc4['attrVoiceQueues']||(_0x3f0cc4['attrs']&&_0x3f0cc4[_0x9b0d('0x57')][0x3]?_0x3f0cc4[_0x9b0d('0x57')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x3f0cc4[_0x9b0d('0x64')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4['attrs'][0x4]?_0x3f0cc4[_0x9b0d('0x57')][0x4][_0x9b0d('0x58')]:undefined)||_0x9b0d('0x6e')},{'name':_0x9b0d('0x65'),'value':_0x3f0cc4[_0x9b0d('0x65')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x5]?_0x3f0cc4['attrs'][0x5][_0x9b0d('0x58')]:undefined)||''},{'name':_0x9b0d('0x66'),'value':_0x3f0cc4[_0x9b0d('0x66')]||(_0x3f0cc4['attrs']&&_0x3f0cc4['attrs'][0x6]?_0x3f0cc4[_0x9b0d('0x57')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x3f0cc4[_0x9b0d('0x67')]||(_0x3f0cc4['attrs']&&_0x3f0cc4[_0x9b0d('0x57')][0x7]?_0x3f0cc4[_0x9b0d('0x57')][0x7][_0x9b0d('0x58')]:undefined)||''},{'name':_0x9b0d('0x68'),'value':_0x3f0cc4[_0x9b0d('0x68')]||(_0x3f0cc4['attrs']&&_0x3f0cc4[_0x9b0d('0x57')][0x8]?_0x3f0cc4['attrs'][0x8][_0x9b0d('0x58')]:undefined)||''},{'name':_0x9b0d('0x69'),'value':_0x3f0cc4[_0x9b0d('0x69')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x9]?_0x3f0cc4[_0x9b0d('0x57')][0x9]['value']:undefined)||''},{'name':_0x9b0d('0x6a'),'value':_0x3f0cc4[_0x9b0d('0x6a')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4['attrs'][0xa]?_0x3f0cc4[_0x9b0d('0x57')][0xa]['value']:undefined)||''}];case _0x9b0d('0x6f'):return[{'name':_0x9b0d('0x70'),'type':_0x3f0cc4['reportType']||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4['attrs'][0x0]?_0x3f0cc4[_0x9b0d('0x57')][0x0][_0x9b0d('0x71')]:undefined)||null,'value':_0x3f0cc4[_0x9b0d('0x70')]||(_0x3f0cc4[_0x9b0d('0x57')]&&_0x3f0cc4[_0x9b0d('0x57')][0x0]?_0x3f0cc4[_0x9b0d('0x57')][0x0][_0x9b0d('0x58')]:undefined)||null},{'name':_0x9b0d('0x72'),'value':_0x3f0cc4['attrRefresh']||(_0x3f0cc4['attrs']&&_0x3f0cc4[_0x9b0d('0x57')][0x1]?_0x3f0cc4[_0x9b0d('0x57')][0x1][_0x9b0d('0x58')]:undefined)||0x0}];default:return[];}}catch(_0x51ecf7){logger[_0x9b0d('0x2a')]('widgetAttributes:\x20%s',JSON[_0x9b0d('0x73')](_0x51ecf7));return[];}}exports[_0x9b0d('0x74')]=function(_0x515a0e,_0x4b4eb2,_0x13ce90){if(_0x515a0e[_0x9b0d('0x52')]['id']){delete _0x515a0e[_0x9b0d('0x52')]['id'];}return db[_0x9b0d('0x2f')]['find']({'where':{'id':_0x515a0e[_0x9b0d('0x45')]['id']}})[_0x9b0d('0x26')](handleEntityNotFound(_0x4b4eb2,null))[_0x9b0d('0x26')](function(_0x266297){if(_0x266297){_0x515a0e['body']['DashboardId']=_0x266297['id'];_0x515a0e[_0x9b0d('0x52')]['attrs']=widgetAttributes(_0x515a0e['body']);return db[_0x9b0d('0x75')][_0x9b0d('0x49')](_0x515a0e[_0x9b0d('0x52')]);}})['then'](respondWithResult(_0x4b4eb2,null))[_0x9b0d('0x43')](handleError(_0x4b4eb2,null));};exports[_0x9b0d('0x76')]=function(_0x163244,_0x518a34,_0x240f1a){var _0x394556={};var _0x12c0fb={};var _0x38ed5c;var _0x5c88af;return db[_0x9b0d('0x2f')][_0x9b0d('0x77')]({'where':{'id':_0x163244[_0x9b0d('0x45')]['id']}})[_0x9b0d('0x26')](handleEntityNotFound(_0x518a34,null))['then'](function(_0x3421b0){if(_0x3421b0){_0x38ed5c=_0x3421b0;_0x12c0fb[_0x9b0d('0x32')]=_[_0x9b0d('0x34')](db[_0x9b0d('0x75')]['rawAttributes']);_0x12c0fb[_0x9b0d('0x33')]=_['keys'](_0x163244[_0x9b0d('0x33')]);_0x12c0fb['filters']=_[_0x9b0d('0x36')](_0x12c0fb[_0x9b0d('0x32')],_0x12c0fb['query']);_0x394556['attributes']=_[_0x9b0d('0x36')](_0x12c0fb[_0x9b0d('0x32')],qs[_0x9b0d('0x38')](_0x163244[_0x9b0d('0x33')][_0x9b0d('0x38')]));_0x394556[_0x9b0d('0x37')]=_0x394556['attributes'][_0x9b0d('0x46')]?_0x394556[_0x9b0d('0x37')]:_0x12c0fb[_0x9b0d('0x32')];_0x394556[_0x9b0d('0x78')]=qs['sort'](_0x163244['query']['sort']);_0x394556[_0x9b0d('0x3d')]=qs[_0x9b0d('0x35')](_[_0x9b0d('0x3b')](_0x163244[_0x9b0d('0x33')],_0x12c0fb[_0x9b0d('0x35')]));if(_0x163244[_0x9b0d('0x33')]['filter']){_0x394556['where']=_[_0x9b0d('0x3e')](_0x394556[_0x9b0d('0x3d')],{'$or':_['map'](_0x394556[_0x9b0d('0x37')],function(_0x12fdbb){var _0x306def={};_0x306def[_0x12fdbb]={'$like':'%'+_0x163244[_0x9b0d('0x33')][_0x9b0d('0x3c')]+'%'};return _0x306def;})});}_0x394556=_[_0x9b0d('0x3e')]({},_0x394556,_0x163244['options']);return _0x38ed5c[_0x9b0d('0x76')](_0x394556);}})[_0x9b0d('0x26')](function(_0x4345fa){if(_0x4345fa){_0x5c88af=_0x4345fa[_0x9b0d('0x46')];if(!_0x163244[_0x9b0d('0x33')][_0x9b0d('0x39')](_0x9b0d('0x79'))){_0x394556['limit']=qs[_0x9b0d('0x1d')](_0x163244['query']['limit']);_0x394556['offset']=qs[_0x9b0d('0x1f')](_0x163244[_0x9b0d('0x33')][_0x9b0d('0x1f')]);}return _0x38ed5c[_0x9b0d('0x76')](_0x394556);}})['then'](function(_0x49d507){if(_0x49d507){return _0x49d507?{'count':_0x5c88af,'rows':_0x49d507}:null;}})[_0x9b0d('0x26')](respondWithResult(_0x518a34,null))[_0x9b0d('0x43')](handleError(_0x518a34,null));}; \ No newline at end of file +var _0x4ed9=['pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','clone','options','omit','createdAt','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','getItems','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','send','index','map','Dashboard','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x1d3739,_0x59831d){var _0x2a33e4=function(_0x296c1a){while(--_0x296c1a){_0x1d3739['push'](_0x1d3739['shift']());}};_0x2a33e4(++_0x59831d);}(_0x4ed9,0x1d6));var _0x94ed=function(_0x426d5c,_0x43a606){_0x426d5c=_0x426d5c-0x0;var _0x2a06da=_0x4ed9[_0x426d5c];return _0x2a06da;};'use strict';var emlformat=require(_0x94ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x94ed('0x1'));var jsonpatch=require(_0x94ed('0x2'));var rp=require(_0x94ed('0x3'));var moment=require(_0x94ed('0x4'));var BPromise=require(_0x94ed('0x5'));var Mustache=require(_0x94ed('0x6'));var util=require(_0x94ed('0x7'));var path=require('path');var sox=require(_0x94ed('0x8'));var csv=require('to-csv');var ejs=require(_0x94ed('0x9'));var fs=require('fs');var fs_extra=require(_0x94ed('0xa'));var _=require(_0x94ed('0xb'));var squel=require(_0x94ed('0xc'));var crypto=require(_0x94ed('0xd'));var jsforce=require(_0x94ed('0xe'));var deskjs=require(_0x94ed('0xf'));var toCsv=require(_0x94ed('0x10'));var querystring=require(_0x94ed('0x11'));var Papa=require(_0x94ed('0x12'));var Redis=require('ioredis');var authService=require(_0x94ed('0x13'));var qs=require(_0x94ed('0x14'));var as=require(_0x94ed('0x15'));var hardwareService=require(_0x94ed('0x16'));var logger=require(_0x94ed('0x17'))(_0x94ed('0x18'));var utils=require(_0x94ed('0x19'));var config=require(_0x94ed('0x1a'));var licenseUtil=require(_0x94ed('0x1b'));var db=require(_0x94ed('0x1c'))['db'];config[_0x94ed('0x1d')]=_[_0x94ed('0x1e')](config[_0x94ed('0x1d')],{'host':_0x94ed('0x1f'),'port':0x18eb});var socket=require(_0x94ed('0x20'))(new Redis(config[_0x94ed('0x1d')]));require(_0x94ed('0x21'))[_0x94ed('0x22')](socket);function respondWithStatusCode(_0x36d362,_0x12f568){_0x12f568=_0x12f568||0xcc;return function(_0x2f7f02){if(_0x2f7f02){return _0x36d362['sendStatus'](_0x12f568);}return _0x36d362[_0x94ed('0x23')](_0x12f568)['end']();};}function respondWithResult(_0x5cec04,_0x3e13bb){_0x3e13bb=_0x3e13bb||0xc8;return function(_0x5e81c1){if(_0x5e81c1){return _0x5cec04[_0x94ed('0x23')](_0x3e13bb)[_0x94ed('0x24')](_0x5e81c1);}};}function respondWithFilteredResult(_0x1a9c56,_0x78e064){return function(_0x2fef13){if(_0x2fef13){var _0x409b27=typeof _0x78e064[_0x94ed('0x25')]===_0x94ed('0x26')&&typeof _0x78e064[_0x94ed('0x27')]==='undefined';var _0x597ea8=_0x2fef13[_0x94ed('0x28')];var _0x467322=_0x409b27?0x0:_0x78e064[_0x94ed('0x25')];var _0x3e2b5b=_0x409b27?_0x2fef13[_0x94ed('0x28')]:_0x78e064[_0x94ed('0x25')]+_0x78e064['limit'];var _0x45d551;if(_0x3e2b5b>=_0x597ea8){_0x3e2b5b=_0x597ea8;_0x45d551=0xc8;}else{_0x45d551=0xce;}_0x1a9c56[_0x94ed('0x23')](_0x45d551);return _0x1a9c56[_0x94ed('0x29')](_0x94ed('0x2a'),_0x467322+'-'+_0x3e2b5b+'/'+_0x597ea8)[_0x94ed('0x24')](_0x2fef13);}return null;};}function patchUpdates(_0x559be8){return function(_0x5c28a8){try{jsonpatch[_0x94ed('0x2b')](_0x5c28a8,_0x559be8,!![]);}catch(_0x2baa43){return BPromise[_0x94ed('0x2c')](_0x2baa43);}return _0x5c28a8[_0x94ed('0x2d')]();};}function saveUpdates(_0x2ab5e4,_0x12b1f0){return function(_0x37afb2){if(_0x37afb2){return _0x37afb2[_0x94ed('0x2e')](_0x2ab5e4)[_0x94ed('0x2f')](function(_0x129463){return _0x129463;});}return null;};}function removeEntity(_0x559cc8,_0x44eb13){return function(_0x377154){if(_0x377154){return _0x377154[_0x94ed('0x30')]()['then'](function(){var _0x5aea8e=_0x377154[_0x94ed('0x31')]({'plain':!![]});var _0x36cdd6='CustomDashboards';return db[_0x94ed('0x32')][_0x94ed('0x30')]({'where':{'type':_0x36cdd6,'resourceId':_0x5aea8e['id']}})['then'](function(){return _0x377154;});})['then'](function(){_0x559cc8[_0x94ed('0x23')](0xcc)[_0x94ed('0x33')]();});}};}function handleEntityNotFound(_0x3348bd,_0x5de5c4){return function(_0x267cdf){if(!_0x267cdf){_0x3348bd[_0x94ed('0x34')](0x194);}return _0x267cdf;};}function handleError(_0x3e44c0,_0x44f216){_0x44f216=_0x44f216||0x1f4;return function(_0x5da297){logger['error'](_0x5da297['stack']);if(_0x5da297['name']){delete _0x5da297['name'];}_0x3e44c0[_0x94ed('0x23')](_0x44f216)[_0x94ed('0x35')](_0x5da297);};}exports[_0x94ed('0x36')]=function(_0xeccec8,_0x1bbe18){var _0x21c2ec={},_0x214f11={},_0x58ef5c={'count':0x0,'rows':[]};var _0x30349d=_[_0x94ed('0x37')](db[_0x94ed('0x38')][_0x94ed('0x39')],function(_0x99e6ab){return{'name':_0x99e6ab[_0x94ed('0x3a')],'type':_0x99e6ab[_0x94ed('0x3b')][_0x94ed('0x3c')]};});_0x214f11['model']=_[_0x94ed('0x37')](_0x30349d,_0x94ed('0x3d'));_0x214f11[_0x94ed('0x3e')]=_[_0x94ed('0x3f')](_0xeccec8[_0x94ed('0x3e')]);_0x214f11['filters']=_[_0x94ed('0x40')](_0x214f11[_0x94ed('0x41')],_0x214f11[_0x94ed('0x3e')]);_0x21c2ec['attributes']=_[_0x94ed('0x40')](_0x214f11[_0x94ed('0x41')],qs[_0x94ed('0x42')](_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x42')]));_0x21c2ec['attributes']=_0x21c2ec[_0x94ed('0x43')][_0x94ed('0x44')]?_0x21c2ec['attributes']:_0x214f11[_0x94ed('0x41')];if(!_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x45')](_0x94ed('0x46'))){_0x21c2ec['limit']=qs[_0x94ed('0x27')](_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x27')]);_0x21c2ec[_0x94ed('0x25')]=qs[_0x94ed('0x25')](_0xeccec8['query'][_0x94ed('0x25')]);}_0x21c2ec[_0x94ed('0x47')]=qs[_0x94ed('0x48')](_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x48')]);_0x21c2ec['where']=qs[_0x94ed('0x49')](_[_0x94ed('0x4a')](_0xeccec8['query'],_0x214f11['filters']),_0x30349d);if(_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x4b')]){_0x21c2ec[_0x94ed('0x4c')]=_[_0x94ed('0x4d')](_0x21c2ec[_0x94ed('0x4c')],{'$or':_['map'](_0x30349d,function(_0x5081f4){if(_0x5081f4[_0x94ed('0x3b')]!==_0x94ed('0x4e')){var _0x5b7b4f={};_0x5b7b4f[_0x5081f4[_0x94ed('0x3d')]]={'$like':'%'+_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x4b')]+'%'};return _0x5b7b4f;}})});}_0x21c2ec=_[_0x94ed('0x4d')]({},_0x21c2ec,_0xeccec8['options']);var _0x1800dd={'where':_0x21c2ec[_0x94ed('0x4c')]};return db[_0x94ed('0x38')]['count'](_0x1800dd)['then'](function(_0x394c8e){_0x58ef5c[_0x94ed('0x28')]=_0x394c8e;if(_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x4f')]){_0x21c2ec[_0x94ed('0x50')]=[{'all':!![]}];}return db['Dashboard'][_0x94ed('0x51')](_0x21c2ec);})[_0x94ed('0x2f')](function(_0x172ba6){_0x58ef5c[_0x94ed('0x52')]=_0x172ba6;return _0x58ef5c;})[_0x94ed('0x2f')](respondWithFilteredResult(_0x1bbe18,_0x21c2ec))[_0x94ed('0x53')](handleError(_0x1bbe18,null));};exports[_0x94ed('0x54')]=function(_0x3fcf83,_0x531197){var _0x2d0282={'raw':![],'where':{'id':_0x3fcf83[_0x94ed('0x55')]['id']}},_0x3a63b9={};_0x3a63b9['model']=_[_0x94ed('0x3f')](db[_0x94ed('0x38')][_0x94ed('0x39')]);_0x3a63b9['query']=_[_0x94ed('0x3f')](_0x3fcf83[_0x94ed('0x3e')]);_0x3a63b9[_0x94ed('0x49')]=_[_0x94ed('0x40')](_0x3a63b9[_0x94ed('0x41')],_0x3a63b9['query']);_0x2d0282[_0x94ed('0x43')]=_[_0x94ed('0x40')](_0x3a63b9[_0x94ed('0x41')],qs[_0x94ed('0x42')](_0x3fcf83[_0x94ed('0x3e')][_0x94ed('0x42')]));_0x2d0282[_0x94ed('0x43')]=_0x2d0282[_0x94ed('0x43')][_0x94ed('0x44')]?_0x2d0282['attributes']:_0x3a63b9['model'];if(_0x3fcf83[_0x94ed('0x3e')][_0x94ed('0x4f')]){_0x2d0282[_0x94ed('0x50')]=[{'all':!![]}];}_0x2d0282=_[_0x94ed('0x4d')]({},_0x2d0282,_0x3fcf83['options']);return db[_0x94ed('0x38')][_0x94ed('0x56')](_0x2d0282)[_0x94ed('0x2f')](handleEntityNotFound(_0x531197,null))[_0x94ed('0x2f')](respondWithResult(_0x531197,null))['catch'](handleError(_0x531197,null));};exports[_0x94ed('0x57')]=function(_0x48be7e,_0x5c421d){return db[_0x94ed('0x38')]['create'](_0x48be7e[_0x94ed('0x58')],{})['then'](function(_0x1fa663){var _0x420e10=_0x48be7e['user'][_0x94ed('0x31')]({'plain':!![]});if(!_0x420e10)throw new Error(_0x94ed('0x59'));if(_0x420e10[_0x94ed('0x5a')]===_0x94ed('0x5b')){var _0x3dd2db=_0x1fa663[_0x94ed('0x31')]({'plain':!![]});var _0x1f71c8='CustomDashboards';return db[_0x94ed('0x5c')][_0x94ed('0x56')]({'where':{'name':_0x1f71c8,'userProfileId':_0x420e10[_0x94ed('0x5d')]},'raw':!![]})[_0x94ed('0x2f')](function(_0xb7f7a3){if(_0xb7f7a3&&_0xb7f7a3['autoAssociation']===0x0){return db[_0x94ed('0x32')][_0x94ed('0x57')]({'name':_0x3dd2db[_0x94ed('0x3d')],'resourceId':_0x3dd2db['id'],'type':_0xb7f7a3['name'],'sectionId':_0xb7f7a3['id']},{})[_0x94ed('0x2f')](function(){return _0x1fa663;});}else{return _0x1fa663;}})['catch'](function(_0x5c3fec){logger[_0x94ed('0x5e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c3fec);throw _0x5c3fec;});}return _0x1fa663;})[_0x94ed('0x2f')](respondWithResult(_0x5c421d,0xc9))[_0x94ed('0x53')](handleError(_0x5c421d,null));};exports[_0x94ed('0x5f')]=function(_0x3d0c89,_0x9c79ee){var _0x454bfa={'where':{'id':_0x3d0c89[_0x94ed('0x55')]['id']}},_0x544d91={};_0x544d91['model']=_[_0x94ed('0x3f')](db[_0x94ed('0x38')][_0x94ed('0x39')]);_0x454bfa[_0x94ed('0x43')]=_[_0x94ed('0x40')](_0x544d91[_0x94ed('0x41')],qs[_0x94ed('0x42')](_0x3d0c89[_0x94ed('0x3e')][_0x94ed('0x42')]));_0x454bfa['attributes']=_0x454bfa[_0x94ed('0x43')][_0x94ed('0x44')]?_0x454bfa[_0x94ed('0x43')]:_0x544d91[_0x94ed('0x41')];if(_0x3d0c89['query'][_0x94ed('0x4f')]){_0x454bfa[_0x94ed('0x50')]=[{'all':!![]}];}_0x454bfa=_[_0x94ed('0x4d')]({},_0x454bfa,_0x3d0c89[_0x94ed('0x60')]);return db[_0x94ed('0x38')][_0x94ed('0x56')](_0x454bfa)[_0x94ed('0x2f')](handleEntityNotFound(_0x9c79ee,null))['then'](function(_0x4cb186){if(_0x4cb186){var _0x39f361=_0x4cb186['get']({'plain':!![]});_0x39f361=qs[_0x94ed('0x61')](_0x39f361,['id',_0x94ed('0x62'),_0x94ed('0x63')]);_0x3d0c89['body']=_['omit'](_0x3d0c89[_0x94ed('0x58')],['id',_0x94ed('0x62'),_0x94ed('0x63')]);return db[_0x94ed('0x38')]['create'](_[_0x94ed('0x4d')](_0x39f361,_0x3d0c89['body']),{'include':_0x3d0c89[_0x94ed('0x3e')][_0x94ed('0x4f')]?[{'all':!![]}]:undefined})[_0x94ed('0x2f')](function(_0x1e88e5){var _0x1ab46e=_0x3d0c89['user']['get']({'plain':!![]});if(!_0x1ab46e)throw new Error(_0x94ed('0x59'));if(_0x1ab46e[_0x94ed('0x5a')]===_0x94ed('0x5b')){var _0xe699de=_0x1e88e5[_0x94ed('0x31')]({'plain':!![]});var _0x3d3854='CustomDashboards';return db[_0x94ed('0x5c')][_0x94ed('0x56')]({'where':{'name':_0x3d3854,'userProfileId':_0x1ab46e[_0x94ed('0x5d')]},'raw':!![]})[_0x94ed('0x2f')](function(_0x1d8d52){if(_0x1d8d52&&_0x1d8d52[_0x94ed('0x64')]===0x0){return db[_0x94ed('0x32')][_0x94ed('0x57')]({'name':_0xe699de[_0x94ed('0x3d')],'resourceId':_0xe699de['id'],'type':_0x1d8d52[_0x94ed('0x3d')],'sectionId':_0x1d8d52['id']},{})[_0x94ed('0x2f')](function(){return _0x1e88e5;});}else{return _0x1e88e5;}})[_0x94ed('0x53')](function(_0x159a5a){logger[_0x94ed('0x5e')](_0x94ed('0x65'),_0x159a5a);throw _0x159a5a;});}return _0x1e88e5;});}})['then'](respondWithResult(_0x9c79ee,0xc9))[_0x94ed('0x53')](handleError(_0x9c79ee,null));};exports['update']=function(_0x4d3fbd,_0x3fb052){if(_0x4d3fbd[_0x94ed('0x58')]['id']){delete _0x4d3fbd['body']['id'];}return db[_0x94ed('0x38')][_0x94ed('0x56')]({'where':{'id':_0x4d3fbd[_0x94ed('0x55')]['id']}})['then'](handleEntityNotFound(_0x3fb052,null))[_0x94ed('0x2f')](saveUpdates(_0x4d3fbd[_0x94ed('0x58')],null))[_0x94ed('0x2f')](respondWithResult(_0x3fb052,null))['catch'](handleError(_0x3fb052,null));};exports[_0x94ed('0x30')]=function(_0x261597,_0x418fb1){return db[_0x94ed('0x38')]['find']({'where':{'id':_0x261597[_0x94ed('0x55')]['id']}})['then'](handleEntityNotFound(_0x418fb1,null))['then'](removeEntity(_0x418fb1,null))[_0x94ed('0x53')](handleError(_0x418fb1,null));};function widgetAttributes(_0x780ec0){try{switch(_0x780ec0[_0x94ed('0x3b')]){case'iframe':return[{'name':_0x94ed('0x66'),'value':_0x780ec0[_0x94ed('0x66')]||(_0x780ec0['attrs']&&_0x780ec0['attrs'][0x0]?_0x780ec0[_0x94ed('0x67')][0x0][_0x94ed('0x68')]:undefined)||_0x94ed('0x69')}];case'custom':return[{'name':_0x94ed('0x6a'),'value':_0x780ec0[_0x94ed('0x6a')]||(_0x780ec0['attrs']&&_0x780ec0[_0x94ed('0x67')][0x0]?_0x780ec0[_0x94ed('0x67')][0x0][_0x94ed('0x68')]:undefined)||''}];case _0x94ed('0x6b'):return[{'name':_0x94ed('0x6c'),'value':_0x780ec0[_0x94ed('0x6c')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x0]?_0x780ec0['attrs'][0x0][_0x94ed('0x68')]:undefined)||'HH:mm:ss'},{'name':_0x94ed('0x6d'),'value':_0x780ec0['attrTimezone']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x1]?_0x780ec0[_0x94ed('0x67')][0x1][_0x94ed('0x68')]:undefined)||_0x94ed('0x6e')},{'name':'attrFontSize','value':_0x780ec0[_0x94ed('0x6f')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x2]?_0x780ec0[_0x94ed('0x67')][0x2][_0x94ed('0x68')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x780ec0[_0x94ed('0x70')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x0]?_0x780ec0[_0x94ed('0x67')][0x0][_0x94ed('0x68')]:undefined)||_0x94ed('0x71')},{'name':_0x94ed('0x72'),'value':_0x780ec0[_0x94ed('0x72')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x1]?_0x780ec0[_0x94ed('0x67')][0x1]['value']:undefined)||[]},{'name':_0x94ed('0x6f'),'value':_0x780ec0[_0x94ed('0x6f')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x2]?_0x780ec0[_0x94ed('0x67')][0x2]['value']:undefined)||0x14},{'name':_0x94ed('0x73'),'value':_0x780ec0[_0x94ed('0x73')]||(_0x780ec0['attrs']&&_0x780ec0[_0x94ed('0x67')][0x3]?_0x780ec0[_0x94ed('0x67')][0x3][_0x94ed('0x68')]:undefined)||_0x94ed('0x74')},{'name':_0x94ed('0x75'),'value':_0x780ec0['attrEmailAccounts']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x4]?_0x780ec0['attrs'][0x4]['value']:undefined)||''},{'name':_0x94ed('0x76'),'value':_0x780ec0[_0x94ed('0x76')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x5]?_0x780ec0[_0x94ed('0x67')][0x5]['value']:undefined)||''},{'name':_0x94ed('0x77'),'value':_0x780ec0[_0x94ed('0x77')]||(_0x780ec0['attrs']&&_0x780ec0['attrs'][0x6]?_0x780ec0[_0x94ed('0x67')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x780ec0[_0x94ed('0x78')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x7]?_0x780ec0[_0x94ed('0x67')][0x7][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x79'),'value':_0x780ec0[_0x94ed('0x79')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x8]?_0x780ec0[_0x94ed('0x67')][0x8][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x7a'),'value':_0x780ec0[_0x94ed('0x7a')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x9]?_0x780ec0['attrs'][0x9][_0x94ed('0x68')]:undefined)||''}];case _0x94ed('0x7b'):case _0x94ed('0x7c'):return[{'name':'attrSerie1','value':_0x780ec0[_0x94ed('0x7d')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x0]?_0x780ec0['attrs'][0x0]['value']:undefined)||_0x94ed('0x71')},{'name':_0x94ed('0x7e'),'value':_0x780ec0['attrSerie2']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x1]?_0x780ec0[_0x94ed('0x67')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x780ec0['attrSerie3']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x2]?_0x780ec0['attrs'][0x2][_0x94ed('0x68')]:undefined)||null},{'name':_0x94ed('0x72'),'value':_0x780ec0['attrVoiceQueues']||(_0x780ec0['attrs']&&_0x780ec0[_0x94ed('0x67')][0x3]?_0x780ec0[_0x94ed('0x67')][0x3][_0x94ed('0x68')]:undefined)||[]},{'name':_0x94ed('0x73'),'value':_0x780ec0[_0x94ed('0x73')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x4]?_0x780ec0['attrs'][0x4][_0x94ed('0x68')]:undefined)||_0x94ed('0x74')},{'name':_0x94ed('0x75'),'value':_0x780ec0['attrEmailAccounts']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x5]?_0x780ec0[_0x94ed('0x67')][0x5][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x76'),'value':_0x780ec0[_0x94ed('0x76')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x6]?_0x780ec0[_0x94ed('0x67')][0x6][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x77'),'value':_0x780ec0[_0x94ed('0x77')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x7]?_0x780ec0[_0x94ed('0x67')][0x7][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x78'),'value':_0x780ec0[_0x94ed('0x78')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x8]?_0x780ec0[_0x94ed('0x67')][0x8][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x79'),'value':_0x780ec0[_0x94ed('0x79')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x9]?_0x780ec0[_0x94ed('0x67')][0x9][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x7a'),'value':_0x780ec0[_0x94ed('0x7a')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0xa]?_0x780ec0['attrs'][0xa][_0x94ed('0x68')]:undefined)||''}];case _0x94ed('0x7f'):return[{'name':_0x94ed('0x80'),'type':_0x780ec0[_0x94ed('0x81')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x0]?_0x780ec0['attrs'][0x0][_0x94ed('0x3b')]:undefined)||null,'value':_0x780ec0['attrReport']||(_0x780ec0['attrs']&&_0x780ec0['attrs'][0x0]?_0x780ec0[_0x94ed('0x67')][0x0][_0x94ed('0x68')]:undefined)||null},{'name':_0x94ed('0x82'),'value':_0x780ec0['attrRefresh']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x1]?_0x780ec0['attrs'][0x1][_0x94ed('0x68')]:undefined)||0x0}];default:return[];}}catch(_0x542550){logger[_0x94ed('0x5e')](_0x94ed('0x83'),JSON[_0x94ed('0x84')](_0x542550));return[];}}exports['addItem']=function(_0x253d77,_0x41f91b,_0x272e99){if(_0x253d77[_0x94ed('0x58')]['id']){delete _0x253d77[_0x94ed('0x58')]['id'];}return db[_0x94ed('0x38')]['find']({'where':{'id':_0x253d77['params']['id']}})[_0x94ed('0x2f')](handleEntityNotFound(_0x41f91b,null))[_0x94ed('0x2f')](function(_0x1b87e8){if(_0x1b87e8){_0x253d77[_0x94ed('0x58')][_0x94ed('0x85')]=_0x1b87e8['id'];_0x253d77[_0x94ed('0x58')][_0x94ed('0x67')]=widgetAttributes(_0x253d77[_0x94ed('0x58')]);return db['DashboardItem'][_0x94ed('0x57')](_0x253d77[_0x94ed('0x58')]);}})[_0x94ed('0x2f')](respondWithResult(_0x41f91b,null))[_0x94ed('0x53')](handleError(_0x41f91b,null));};exports[_0x94ed('0x86')]=function(_0x1cf907,_0x23ec91,_0x14e6d9){var _0x6b8e80={};var _0x2ceac8={};var _0x17d08d;var _0x30c33a;return db[_0x94ed('0x38')][_0x94ed('0x87')]({'where':{'id':_0x1cf907[_0x94ed('0x55')]['id']}})['then'](handleEntityNotFound(_0x23ec91,null))[_0x94ed('0x2f')](function(_0x54cb3c){if(_0x54cb3c){_0x17d08d=_0x54cb3c;_0x2ceac8[_0x94ed('0x41')]=_[_0x94ed('0x3f')](db['DashboardItem'][_0x94ed('0x39')]);_0x2ceac8['query']=_[_0x94ed('0x3f')](_0x1cf907[_0x94ed('0x3e')]);_0x2ceac8[_0x94ed('0x49')]=_[_0x94ed('0x40')](_0x2ceac8[_0x94ed('0x41')],_0x2ceac8[_0x94ed('0x3e')]);_0x6b8e80[_0x94ed('0x43')]=_[_0x94ed('0x40')](_0x2ceac8[_0x94ed('0x41')],qs['fields'](_0x1cf907[_0x94ed('0x3e')][_0x94ed('0x42')]));_0x6b8e80['attributes']=_0x6b8e80[_0x94ed('0x43')][_0x94ed('0x44')]?_0x6b8e80[_0x94ed('0x43')]:_0x2ceac8['model'];_0x6b8e80[_0x94ed('0x47')]=qs[_0x94ed('0x48')](_0x1cf907[_0x94ed('0x3e')][_0x94ed('0x48')]);_0x6b8e80[_0x94ed('0x4c')]=qs[_0x94ed('0x49')](_[_0x94ed('0x4a')](_0x1cf907[_0x94ed('0x3e')],_0x2ceac8[_0x94ed('0x49')]));if(_0x1cf907[_0x94ed('0x3e')][_0x94ed('0x4b')]){_0x6b8e80['where']=_[_0x94ed('0x4d')](_0x6b8e80[_0x94ed('0x4c')],{'$or':_[_0x94ed('0x37')](_0x6b8e80['attributes'],function(_0x2b9913){var _0x515a94={};_0x515a94[_0x2b9913]={'$like':'%'+_0x1cf907[_0x94ed('0x3e')][_0x94ed('0x4b')]+'%'};return _0x515a94;})});}_0x6b8e80=_[_0x94ed('0x4d')]({},_0x6b8e80,_0x1cf907['options']);return _0x17d08d[_0x94ed('0x86')](_0x6b8e80);}})[_0x94ed('0x2f')](function(_0x131727){if(_0x131727){_0x30c33a=_0x131727['length'];if(!_0x1cf907[_0x94ed('0x3e')]['hasOwnProperty'](_0x94ed('0x46'))){_0x6b8e80[_0x94ed('0x27')]=qs[_0x94ed('0x27')](_0x1cf907[_0x94ed('0x3e')]['limit']);_0x6b8e80[_0x94ed('0x25')]=qs[_0x94ed('0x25')](_0x1cf907[_0x94ed('0x3e')][_0x94ed('0x25')]);}return _0x17d08d[_0x94ed('0x86')](_0x6b8e80);}})[_0x94ed('0x2f')](function(_0x36462f){if(_0x36462f){return _0x36462f?{'count':_0x30c33a,'rows':_0x36462f}:null;}})[_0x94ed('0x2f')](respondWithResult(_0x23ec91,null))[_0x94ed('0x53')](handleError(_0x23ec91,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 501c09a..2c179d1 100644 --- a/server/api/dashboard/dashboard.events.js +++ b/server/api/dashboard/dashboard.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b12=['setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x17257b,_0x4ad627){var _0x378e57=function(_0x4df7a8){while(--_0x4df7a8){_0x17257b['push'](_0x17257b['shift']());}};_0x378e57(++_0x4ad627);}(_0x9b12,0x83));var _0x29b1=function(_0x3a0cc5,_0x27540f){_0x3a0cc5=_0x3a0cc5-0x0;var _0x5eca0a=_0x9b12[_0x3a0cc5];return _0x5eca0a;};'use strict';var EventEmitter=require(_0x29b1('0x0'));var Dashboard=require(_0x29b1('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x29b1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x29b1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x53d4a3){return function(_0x45a1fe,_0x26a172,_0xe4fb09){DashboardEvents[_0x29b1('0x4')](_0x53d4a3+':'+_0x45a1fe['id'],_0x45a1fe);DashboardEvents[_0x29b1('0x4')](_0x53d4a3,_0x45a1fe);_0xe4fb09(null);};}for(var e in events){if(events[_0x29b1('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x29b1('0x6')]=DashboardEvents; \ No newline at end of file +var _0x0c32=['hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','remove','emit'];(function(_0x5856e2,_0x936acc){var _0x5ae467=function(_0x59d7a5){while(--_0x59d7a5){_0x5856e2['push'](_0x5856e2['shift']());}};_0x5ae467(++_0x936acc);}(_0x0c32,0x158));var _0x20c3=function(_0x4e31e1,_0x593f5b){_0x4e31e1=_0x4e31e1-0x0;var _0x2a2ad1=_0x0c32[_0x4e31e1];return _0x2a2ad1;};'use strict';var EventEmitter=require(_0x20c3('0x0'));var Dashboard=require(_0x20c3('0x1'))['db'][_0x20c3('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x20c3('0x3')](0x0);var events={'afterCreate':_0x20c3('0x4'),'afterUpdate':'update','afterDestroy':_0x20c3('0x5')};function emitEvent(_0x58f349){return function(_0x16e633,_0x2da504,_0x1cffb3){DashboardEvents[_0x20c3('0x6')](_0x58f349+':'+_0x16e633['id'],_0x16e633);DashboardEvents[_0x20c3('0x6')](_0x58f349,_0x16e633);_0x1cffb3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x20c3('0x7')](e,emitEvent(event));}}module[_0x20c3('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 6053447..3b015ec 100644 --- a/server/api/dashboard/dashboard.model.js +++ b/server/api/dashboard/dashboard.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf781=['api','moment','bluebird','request-promise','path','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger'];(function(_0x5392af,_0x4e23d1){var _0x57a116=function(_0x17b12e){while(--_0x17b12e){_0x5392af['push'](_0x5392af['shift']());}};_0x57a116(++_0x4e23d1);}(_0xf781,0x1b7));var _0x1f78=function(_0x54f73a,_0xfc06d1){_0x54f73a=_0x54f73a-0x0;var _0x5a09b5=_0xf781[_0x54f73a];return _0x5a09b5;};'use strict';var _=require(_0x1f78('0x0'));var util=require(_0x1f78('0x1'));var logger=require(_0x1f78('0x2'))(_0x1f78('0x3'));var moment=require(_0x1f78('0x4'));var BPromise=require(_0x1f78('0x5'));var rp=require(_0x1f78('0x6'));var fs=require('fs');var path=require(_0x1f78('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1f78('0x8'));module[_0x1f78('0x9')]=function(_0x102db0,_0x1c2172){return _0x102db0[_0x1f78('0xa')](_0x1f78('0xb'),attributes,{'tableName':_0x1f78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa273=['path','rimraf','../../config/environment','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x607a68,_0x48c96c){var _0x4995ce=function(_0x93b724){while(--_0x93b724){_0x607a68['push'](_0x607a68['shift']());}};_0x4995ce(++_0x48c96c);}(_0xa273,0x1d5));var _0x3a27=function(_0x40e4ef,_0xa1ba40){_0x40e4ef=_0x40e4ef-0x0;var _0x637f65=_0xa273[_0x40e4ef];return _0x637f65;};'use strict';var _=require(_0x3a27('0x0'));var util=require(_0x3a27('0x1'));var logger=require(_0x3a27('0x2'))(_0x3a27('0x3'));var moment=require(_0x3a27('0x4'));var BPromise=require(_0x3a27('0x5'));var rp=require(_0x3a27('0x6'));var fs=require('fs');var path=require(_0x3a27('0x7'));var rimraf=require(_0x3a27('0x8'));var config=require(_0x3a27('0x9'));var attributes=require('./dashboard.attributes');module[_0x3a27('0xa')]=function(_0xf9418d,_0x530abf){return _0xf9418d[_0x3a27('0xb')](_0x3a27('0xc'),attributes,{'tableName':_0x3a27('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 8208157..f39558d 100644 --- a/server/api/dashboard/dashboard.rpc.js +++ b/server/api/dashboard/dashboard.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4b8=['redis','defaults','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http'];(function(_0x34a860,_0x3d51dd){var _0x5885ab=function(_0x590b83){while(--_0x590b83){_0x34a860['push'](_0x34a860['shift']());}};_0x5885ab(++_0x3d51dd);}(_0xf4b8,0xb6));var _0x8f4b=function(_0xf86fa2,_0x200d15){_0xf86fa2=_0xf86fa2-0x0;var _0x520baa=_0xf4b8[_0xf86fa2];return _0x520baa;};'use strict';var _=require(_0x8f4b('0x0'));var util=require(_0x8f4b('0x1'));var moment=require(_0x8f4b('0x2'));var BPromise=require(_0x8f4b('0x3'));var rs=require(_0x8f4b('0x4'));var fs=require('fs');var Redis=require(_0x8f4b('0x5'));var db=require(_0x8f4b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8f4b('0x7'));var config=require(_0x8f4b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8f4b('0x9')]({'port':0x232a});config[_0x8f4b('0xa')]=_[_0x8f4b('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8f4b('0xc'))(new Redis(config[_0x8f4b('0xa')]));require(_0x8f4b('0xd'))[_0x8f4b('0xe')](socket);function respondWithRpcPromise(_0x4c7329,_0x1b7fe5,_0x44bb4e){return new BPromise(function(_0x286bbd,_0x3555cd){return client[_0x8f4b('0xf')](_0x4c7329,_0x44bb4e)['then'](function(_0x1c4f8d){logger[_0x8f4b('0x10')](_0x8f4b('0x11'),_0x1b7fe5,_0x8f4b('0x12'));logger['debug'](_0x8f4b('0x13'),_0x1b7fe5,_0x8f4b('0x12'),JSON['stringify'](_0x1c4f8d));if(_0x1c4f8d[_0x8f4b('0x14')]){if(_0x1c4f8d[_0x8f4b('0x14')][_0x8f4b('0x15')]===0x1f4){logger[_0x8f4b('0x14')]('Dashboard,\x20%s,\x20%s',_0x1b7fe5,_0x1c4f8d[_0x8f4b('0x14')]['message']);return _0x3555cd(_0x1c4f8d['error'][_0x8f4b('0x16')]);}logger[_0x8f4b('0x14')]('Dashboard,\x20%s,\x20%s',_0x1b7fe5,_0x1c4f8d['error'][_0x8f4b('0x16')]);return _0x286bbd(_0x1c4f8d[_0x8f4b('0x14')][_0x8f4b('0x16')]);}else{logger[_0x8f4b('0x10')](_0x8f4b('0x11'),_0x1b7fe5,_0x8f4b('0x12'));_0x286bbd(_0x1c4f8d['result'][_0x8f4b('0x16')]);}})[_0x8f4b('0x17')](function(_0x3a92d8){logger[_0x8f4b('0x14')](_0x8f4b('0x11'),_0x1b7fe5,_0x3a92d8);_0x3555cd(_0x3a92d8);});});} \ No newline at end of file +var _0xe9ab=['info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0xe9ab,0xdb));var _0xbe9a=function(_0x32447f,_0x383fa1){_0x32447f=_0x32447f-0x0;var _0x2d6432=_0xe9ab[_0x32447f];return _0x2d6432;};'use strict';var _=require(_0xbe9a('0x0'));var util=require(_0xbe9a('0x1'));var moment=require(_0xbe9a('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe9a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbe9a('0x4'));var config=require('../../config/environment');var jayson=require(_0xbe9a('0x5'));var client=jayson['client'][_0xbe9a('0x6')]({'port':0x232a});config[_0xbe9a('0x7')]=_[_0xbe9a('0x8')](config['redis'],{'host':_0xbe9a('0x9'),'port':0x18eb});var socket=require(_0xbe9a('0xa'))(new Redis(config[_0xbe9a('0x7')]));require(_0xbe9a('0xb'))[_0xbe9a('0xc')](socket);function respondWithRpcPromise(_0x2880f2,_0x357942,_0x5c370d){return new BPromise(function(_0x50a93b,_0x372cb3){return client[_0xbe9a('0xd')](_0x2880f2,_0x5c370d)[_0xbe9a('0xe')](function(_0x33b190){logger[_0xbe9a('0xf')](_0xbe9a('0x10'),_0x357942,_0xbe9a('0x11'));logger[_0xbe9a('0x12')](_0xbe9a('0x13'),_0x357942,_0xbe9a('0x11'),JSON[_0xbe9a('0x14')](_0x33b190));if(_0x33b190['error']){if(_0x33b190['error'][_0xbe9a('0x15')]===0x1f4){logger[_0xbe9a('0x16')](_0xbe9a('0x10'),_0x357942,_0x33b190[_0xbe9a('0x16')][_0xbe9a('0x17')]);return _0x372cb3(_0x33b190[_0xbe9a('0x16')][_0xbe9a('0x17')]);}logger[_0xbe9a('0x16')](_0xbe9a('0x10'),_0x357942,_0x33b190['error'][_0xbe9a('0x17')]);return _0x50a93b(_0x33b190[_0xbe9a('0x16')][_0xbe9a('0x17')]);}else{logger['info'](_0xbe9a('0x10'),_0x357942,_0xbe9a('0x11'));_0x50a93b(_0x33b190[_0xbe9a('0x18')][_0xbe9a('0x17')]);}})[_0xbe9a('0x19')](function(_0x2201c1){logger[_0xbe9a('0x16')](_0xbe9a('0x10'),_0x357942,_0x2201c1);_0x372cb3(_0x2201c1);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index b394a2b..003db1a 100644 --- a/server/api/dashboard/dashboard.socket.js +++ b/server/api/dashboard/dashboard.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x336e=['dashboard:','./dashboard.events','save','remove','emit','removeListener','length'];(function(_0x2a8917,_0x4a0828){var _0x18b307=function(_0x473aaf){while(--_0x473aaf){_0x2a8917['push'](_0x2a8917['shift']());}};_0x18b307(++_0x4a0828);}(_0x336e,0x1b3));var _0xe336=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x336e[_0x38537f];return _0x141e23;};'use strict';var DashboardEvents=require(_0xe336('0x0'));var events=[_0xe336('0x1'),_0xe336('0x2'),'update'];function createListener(_0x1e829b,_0x15cf6a){return function(_0xb53948){_0x15cf6a[_0xe336('0x3')](_0x1e829b,_0xb53948);};}function removeListener(_0x191971,_0x5d0812){return function(){DashboardEvents[_0xe336('0x4')](_0x191971,_0x5d0812);};}exports['register']=function(_0x346efd){for(var _0x584327=0x0,_0x423093=events[_0xe336('0x5')];_0x584327<_0x423093;_0x584327++){var _0x5305d4=events[_0x584327];var _0x4cddc4=createListener(_0xe336('0x6')+_0x5305d4,_0x346efd);DashboardEvents['on'](_0x5305d4,_0x4cddc4);}}; \ No newline at end of file +var _0x53f2=['length','dashboard:','./dashboard.events','remove','emit','removeListener'];(function(_0x84dbc9,_0x804160){var _0x365eea=function(_0x5c11c6){while(--_0x5c11c6){_0x84dbc9['push'](_0x84dbc9['shift']());}};_0x365eea(++_0x804160);}(_0x53f2,0xfe));var _0x253f=function(_0x2e723c,_0x1f383d){_0x2e723c=_0x2e723c-0x0;var _0x2157f8=_0x53f2[_0x2e723c];return _0x2157f8;};'use strict';var DashboardEvents=require(_0x253f('0x0'));var events=['save',_0x253f('0x1'),'update'];function createListener(_0xd0b98a,_0x173b19){return function(_0x18c7fa){_0x173b19[_0x253f('0x2')](_0xd0b98a,_0x18c7fa);};}function removeListener(_0x4c13aa,_0x30c433){return function(){DashboardEvents[_0x253f('0x3')](_0x4c13aa,_0x30c433);};}exports['register']=function(_0x1ad599){for(var _0x422c9a=0x0,_0x581783=events[_0x253f('0x4')];_0x422c9a<_0x581783;_0x422c9a++){var _0x53e271=events[_0x422c9a];var _0x389914=createListener(_0x253f('0x5')+_0x53e271,_0x1ad599);DashboardEvents['on'](_0x53e271,_0x389914);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index afbbc7f..06013fe 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44f6=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','index','get','/:id','isAuthenticated','show','/:id/items','getItems','/:id/clone','post','put','update','destroy','exports','multer'];(function(_0x56dd8a,_0xc6f59a){var _0xddcc21=function(_0x1118e5){while(--_0x1118e5){_0x56dd8a['push'](_0x56dd8a['shift']());}};_0xddcc21(++_0xc6f59a);}(_0x44f6,0xa0));var _0x644f=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0x44f6[_0x523adf];return _0x283870;};'use strict';var multer=require(_0x644f('0x0'));var util=require(_0x644f('0x1'));var path=require(_0x644f('0x2'));var timeout=require(_0x644f('0x3'));var express=require(_0x644f('0x4'));var router=express[_0x644f('0x5')]();var fs_extra=require(_0x644f('0x6'));var auth=require(_0x644f('0x7'));var interaction=require(_0x644f('0x8'));var config=require('../../config/environment');var controller=require(_0x644f('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x644f('0xa')]);router[_0x644f('0xb')](_0x644f('0xc'),auth[_0x644f('0xd')](),controller[_0x644f('0xe')]);router[_0x644f('0xb')](_0x644f('0xf'),auth[_0x644f('0xd')](),controller[_0x644f('0x10')]);router['post']('/',auth[_0x644f('0xd')](),controller['create']);router['post'](_0x644f('0x11'),auth[_0x644f('0xd')](),controller['clone']);router[_0x644f('0x12')](_0x644f('0xf'),auth[_0x644f('0xd')](),controller['addItem']);router[_0x644f('0x13')](_0x644f('0xc'),auth['isAuthenticated'](),controller[_0x644f('0x14')]);router['delete'](_0x644f('0xc'),auth[_0x644f('0xd')](),controller[_0x644f('0x15')]);module[_0x644f('0x16')]=router; \ No newline at end of file +var _0x77b4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./dashboard.controller','get','index','/:id','isAuthenticated','/:id/items','getItems','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x58df2a,_0x47be57){var _0x2900ed=function(_0x9a8a9a){while(--_0x9a8a9a){_0x58df2a['push'](_0x58df2a['shift']());}};_0x2900ed(++_0x47be57);}(_0x77b4,0x105));var _0x477b=function(_0x425755,_0x16e311){_0x425755=_0x425755-0x0;var _0x38c60b=_0x77b4[_0x425755];return _0x38c60b;};'use strict';var multer=require(_0x477b('0x0'));var util=require(_0x477b('0x1'));var path=require(_0x477b('0x2'));var timeout=require(_0x477b('0x3'));var express=require(_0x477b('0x4'));var router=express[_0x477b('0x5')]();var fs_extra=require(_0x477b('0x6'));var auth=require(_0x477b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x477b('0x8'));router[_0x477b('0x9')]('/',auth['isAuthenticated'](),controller[_0x477b('0xa')]);router[_0x477b('0x9')](_0x477b('0xb'),auth[_0x477b('0xc')](),controller['show']);router[_0x477b('0x9')](_0x477b('0xd'),auth['isAuthenticated'](),controller[_0x477b('0xe')]);router[_0x477b('0xf')]('/',auth[_0x477b('0xc')](),controller[_0x477b('0x10')]);router[_0x477b('0xf')]('/:id/clone',auth[_0x477b('0xc')](),controller['clone']);router['post'](_0x477b('0xd'),auth[_0x477b('0xc')](),controller['addItem']);router[_0x477b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x477b('0x12')]);router[_0x477b('0x13')](_0x477b('0xb'),auth[_0x477b('0xc')](),controller[_0x477b('0x14')]);module[_0x477b('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 2d07de1..0923fa2 100644 --- a/server/api/dashboardItem/dashboardItem.attributes.js +++ b/server/api/dashboardItem/dashboardItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['squel','exports','STRING','TEXT','long','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x4828b1,_0x5c8cf3){var _0x1fec1b=function(_0x3f2e5a){while(--_0x3f2e5a){_0x4828b1['push'](_0x4828b1['shift']());}};_0x1fec1b(++_0x5c8cf3);}(_0x5fc3,0xa8));var _0x35fc=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x5fc3[_0x421196];return _0x2738af;};'use strict';var Sequelize=require(_0x35fc('0x0'));var squel=require(_0x35fc('0x1'));var _=require('lodash');module[_0x35fc('0x2')]={'title':{'type':Sequelize[_0x35fc('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x35fc('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x35fc('0x4')](_0x35fc('0x5')),'get':function(){try{return JSON['parse'](this[_0x35fc('0x6')](_0x35fc('0x7')));}catch(_0x186a06){return[];}},'set':function(_0x5b85ad){try{this['setDataValue'](_0x35fc('0x7'),JSON['stringify'](_0x5b85ad));}catch(_0x16e153){this[_0x35fc('0x8')](_0x35fc('0x7'),JSON[_0x35fc('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x35fc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x35fc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x35fc('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x35fc('0x3')],'allowNull':![],'defaultValue':_0x35fc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35fc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x35fc('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xabce=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xabce,0x103));var _0xeabc=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xabce[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0xeabc('0x0'));var squel=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));module[_0xeabc('0x3')]={'title':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xeabc('0x5')),'get':function(){try{return JSON[_0xeabc('0x6')](this[_0xeabc('0x7')]('attrs'));}catch(_0x54e4a8){return[];}},'set':function(_0x1b07a8){try{this['setDataValue'](_0xeabc('0x8'),JSON['stringify'](_0x1b07a8));}catch(_0x3bdc29){this[_0xeabc('0x9')](_0xeabc('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xeabc('0xa')]},'col':{'type':Sequelize[_0xeabc('0xa')]},'background':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xeabc('0x4')]},'titleFontSize':{'type':Sequelize[_0xeabc('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 7bdec94..0cf84d9 100644 --- a/server/api/dashboardItem/dashboardItem.controller.js +++ b/server/api/dashboardItem/dashboardItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1224=['offset','undefined','count','limit','set','apply','save','update','destroy','then','stack','name','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','options','find','type','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json'];(function(_0x27ceb7,_0x3e2666){var _0x456a8b=function(_0x58eaeb){while(--_0x58eaeb){_0x27ceb7['push'](_0x27ceb7['shift']());}};_0x456a8b(++_0x3e2666);}(_0x1224,0x10d));var _0x4122=function(_0xab7710,_0x1bf517){_0xab7710=_0xab7710-0x0;var _0x238bad=_0x1224[_0xab7710];return _0x238bad;};'use strict';var emlformat=require(_0x4122('0x0'));var rimraf=require(_0x4122('0x1'));var zipdir=require(_0x4122('0x2'));var jsonpatch=require(_0x4122('0x3'));var rp=require(_0x4122('0x4'));var moment=require(_0x4122('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4122('0x6'));var util=require(_0x4122('0x7'));var path=require(_0x4122('0x8'));var sox=require('sox');var csv=require(_0x4122('0x9'));var ejs=require(_0x4122('0xa'));var fs=require('fs');var fs_extra=require(_0x4122('0xb'));var _=require(_0x4122('0xc'));var squel=require(_0x4122('0xd'));var crypto=require(_0x4122('0xe'));var jsforce=require(_0x4122('0xf'));var deskjs=require(_0x4122('0x10'));var toCsv=require(_0x4122('0x9'));var querystring=require(_0x4122('0x11'));var Papa=require(_0x4122('0x12'));var Redis=require(_0x4122('0x13'));var authService=require(_0x4122('0x14'));var qs=require(_0x4122('0x15'));var as=require(_0x4122('0x16'));var hardwareService=require(_0x4122('0x17'));var logger=require(_0x4122('0x18'))(_0x4122('0x19'));var utils=require(_0x4122('0x1a'));var config=require(_0x4122('0x1b'));var licenseUtil=require(_0x4122('0x1c'));var db=require(_0x4122('0x1d'))['db'];config[_0x4122('0x1e')]=_[_0x4122('0x1f')](config[_0x4122('0x1e')],{'host':_0x4122('0x20'),'port':0x18eb});var socket=require(_0x4122('0x21'))(new Redis(config[_0x4122('0x1e')]));require(_0x4122('0x22'))[_0x4122('0x23')](socket);function respondWithStatusCode(_0x3a88fe,_0x47ae9b){_0x47ae9b=_0x47ae9b||0xcc;return function(_0x4761a0){if(_0x4761a0){return _0x3a88fe[_0x4122('0x24')](_0x47ae9b);}return _0x3a88fe[_0x4122('0x25')](_0x47ae9b)[_0x4122('0x26')]();};}function respondWithResult(_0x520300,_0x2e33cf){_0x2e33cf=_0x2e33cf||0xc8;return function(_0x19684e){if(_0x19684e){return _0x520300['status'](_0x2e33cf)[_0x4122('0x27')](_0x19684e);}};}function respondWithFilteredResult(_0x3ec4d3,_0x399003){return function(_0x4636ae){if(_0x4636ae){var _0xf6ba87=typeof _0x399003[_0x4122('0x28')]===_0x4122('0x29')&&typeof _0x399003['limit']==='undefined';var _0x586105=_0x4636ae[_0x4122('0x2a')];var _0x2d95e8=_0xf6ba87?0x0:_0x399003[_0x4122('0x28')];var _0x1dde85=_0xf6ba87?_0x4636ae[_0x4122('0x2a')]:_0x399003[_0x4122('0x28')]+_0x399003[_0x4122('0x2b')];var _0x46b24e;if(_0x1dde85>=_0x586105){_0x1dde85=_0x586105;_0x46b24e=0xc8;}else{_0x46b24e=0xce;}_0x3ec4d3['status'](_0x46b24e);return _0x3ec4d3[_0x4122('0x2c')]('Content-Range',_0x2d95e8+'-'+_0x1dde85+'/'+_0x586105)['json'](_0x4636ae);}return null;};}function patchUpdates(_0x508cd7){return function(_0x36d8d9){try{jsonpatch[_0x4122('0x2d')](_0x36d8d9,_0x508cd7,!![]);}catch(_0x317418){return BPromise['reject'](_0x317418);}return _0x36d8d9[_0x4122('0x2e')]();};}function saveUpdates(_0x386cdc,_0x5b259d){return function(_0x4a5711){if(_0x4a5711){return _0x4a5711[_0x4122('0x2f')](_0x386cdc)['then'](function(_0x4db23e){return _0x4db23e;});}return null;};}function removeEntity(_0x59895d,_0x1b449b){return function(_0x2e71f4){if(_0x2e71f4){return _0x2e71f4[_0x4122('0x30')]()[_0x4122('0x31')](function(){_0x59895d[_0x4122('0x25')](0xcc)[_0x4122('0x26')]();});}};}function handleEntityNotFound(_0x26768b,_0x7fe50d){return function(_0x36a450){if(!_0x36a450){_0x26768b[_0x4122('0x24')](0x194);}return _0x36a450;};}function handleError(_0x28c89f,_0x419275){_0x419275=_0x419275||0x1f4;return function(_0xfefaf6){logger['error'](_0xfefaf6[_0x4122('0x32')]);if(_0xfefaf6[_0x4122('0x33')]){delete _0xfefaf6[_0x4122('0x33')];}_0x28c89f[_0x4122('0x25')](_0x419275)['send'](_0xfefaf6);};}exports[_0x4122('0x34')]=function(_0x47e8bc,_0x3e4eee){var _0x431430={'raw':![],'where':{'id':_0x47e8bc[_0x4122('0x35')]['id']}},_0x3a9633={};_0x3a9633[_0x4122('0x36')]=_[_0x4122('0x37')](db[_0x4122('0x38')][_0x4122('0x39')]);_0x3a9633['query']=_[_0x4122('0x37')](_0x47e8bc[_0x4122('0x3a')]);_0x3a9633['filters']=_[_0x4122('0x3b')](_0x3a9633[_0x4122('0x36')],_0x3a9633[_0x4122('0x3a')]);_0x431430[_0x4122('0x3c')]=_['intersection'](_0x3a9633[_0x4122('0x36')],qs[_0x4122('0x3d')](_0x47e8bc['query']['fields']));_0x431430[_0x4122('0x3c')]=_0x431430['attributes'][_0x4122('0x3e')]?_0x431430[_0x4122('0x3c')]:_0x3a9633['model'];if(_0x47e8bc[_0x4122('0x3a')][_0x4122('0x3f')]){_0x431430[_0x4122('0x40')]=[{'all':!![]}];}_0x431430=_['merge']({},_0x431430,_0x47e8bc[_0x4122('0x41')]);return db['DashboardItem'][_0x4122('0x42')](_0x431430)[_0x4122('0x31')](handleEntityNotFound(_0x3e4eee,null))[_0x4122('0x31')](respondWithResult(_0x3e4eee,null))['catch'](handleError(_0x3e4eee,null));};exports[_0x4122('0x30')]=function(_0x5427ca,_0x2da1bd){return db[_0x4122('0x38')]['find']({'where':{'id':_0x5427ca['params']['id']}})['then'](handleEntityNotFound(_0x2da1bd,null))[_0x4122('0x31')](removeEntity(_0x2da1bd,null))['catch'](handleError(_0x2da1bd,null));};function widgetAttributes(_0x477e51){try{switch(_0x477e51[_0x4122('0x43')]){case _0x4122('0x44'):return[{'name':_0x4122('0x45'),'value':_0x477e51[_0x4122('0x45')]||(_0x477e51['attrs']&&_0x477e51['attrs'][0x0]?_0x477e51[_0x4122('0x46')][0x0]['value']:undefined)||_0x4122('0x47')}];case'custom':return[{'name':_0x4122('0x48'),'value':_0x477e51[_0x4122('0x48')]||(_0x477e51['attrs']&&_0x477e51[_0x4122('0x46')][0x0]?_0x477e51[_0x4122('0x46')][0x0][_0x4122('0x49')]:undefined)||''}];case _0x4122('0x4a'):return[{'name':_0x4122('0x4b'),'value':_0x477e51[_0x4122('0x4b')]||(_0x477e51['attrs']&&_0x477e51[_0x4122('0x46')][0x0]?_0x477e51['attrs'][0x0][_0x4122('0x49')]:undefined)||'HH:mm:ss'},{'name':_0x4122('0x4c'),'value':_0x477e51[_0x4122('0x4c')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x1]?_0x477e51[_0x4122('0x46')][0x1]['value']:undefined)||_0x4122('0x4d')},{'name':_0x4122('0x4e'),'value':_0x477e51['attrFontSize']||(_0x477e51['attrs']&&_0x477e51['attrs'][0x2]?_0x477e51[_0x4122('0x46')][0x2][_0x4122('0x49')]:undefined)||0xc}];case _0x4122('0x4f'):return[{'name':_0x4122('0x50'),'value':_0x477e51[_0x4122('0x50')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x0]?_0x477e51[_0x4122('0x46')][0x0][_0x4122('0x49')]:undefined)||'total'},{'name':_0x4122('0x51'),'value':_0x477e51['attrVoiceQueues']||(_0x477e51['attrs']&&_0x477e51[_0x4122('0x46')][0x1]?_0x477e51[_0x4122('0x46')][0x1][_0x4122('0x49')]:undefined)||[]},{'name':'attrFontSize','value':_0x477e51[_0x4122('0x4e')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51['attrs'][0x2]?_0x477e51[_0x4122('0x46')][0x2][_0x4122('0x49')]:undefined)||0x14},{'name':_0x4122('0x52'),'value':_0x477e51[_0x4122('0x52')]||(_0x477e51['attrs']&&_0x477e51[_0x4122('0x46')][0x3]?_0x477e51[_0x4122('0x46')][0x3][_0x4122('0x49')]:undefined)||_0x4122('0x53')},{'name':_0x4122('0x54'),'value':_0x477e51['attrEmailAccounts']||(_0x477e51['attrs']&&_0x477e51[_0x4122('0x46')][0x4]?_0x477e51[_0x4122('0x46')][0x4][_0x4122('0x49')]:undefined)||''},{'name':_0x4122('0x55'),'value':_0x477e51[_0x4122('0x55')]||(_0x477e51['attrs']&&_0x477e51[_0x4122('0x46')][0x5]?_0x477e51[_0x4122('0x46')][0x5][_0x4122('0x49')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x477e51[_0x4122('0x56')]||(_0x477e51['attrs']&&_0x477e51[_0x4122('0x46')][0x6]?_0x477e51[_0x4122('0x46')][0x6][_0x4122('0x49')]:undefined)||''},{'name':_0x4122('0x57'),'value':_0x477e51['attrOpenchannelAccounts']||(_0x477e51['attrs']&&_0x477e51[_0x4122('0x46')][0x7]?_0x477e51[_0x4122('0x46')][0x7][_0x4122('0x49')]:undefined)||''},{'name':_0x4122('0x58'),'value':_0x477e51['attrWhatsappAccounts']||(_0x477e51[_0x4122('0x46')]&&_0x477e51['attrs'][0x8]?_0x477e51[_0x4122('0x46')][0x8]['value']:undefined)||''},{'name':_0x4122('0x59'),'value':_0x477e51[_0x4122('0x59')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x9]?_0x477e51[_0x4122('0x46')][0x9][_0x4122('0x49')]:undefined)||''}];case'multibar-chart':case _0x4122('0x5a'):return[{'name':'attrSerie1','value':_0x477e51[_0x4122('0x5b')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x0]?_0x477e51[_0x4122('0x46')][0x0][_0x4122('0x49')]:undefined)||'total'},{'name':_0x4122('0x5c'),'value':_0x477e51[_0x4122('0x5c')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x1]?_0x477e51['attrs'][0x1][_0x4122('0x49')]:undefined)||null},{'name':'attrSerie3','value':_0x477e51[_0x4122('0x5d')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x2]?_0x477e51[_0x4122('0x46')][0x2][_0x4122('0x49')]:undefined)||null},{'name':_0x4122('0x51'),'value':_0x477e51[_0x4122('0x51')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x3]?_0x477e51['attrs'][0x3][_0x4122('0x49')]:undefined)||[]},{'name':_0x4122('0x52'),'value':_0x477e51[_0x4122('0x52')]||(_0x477e51['attrs']&&_0x477e51['attrs'][0x4]?_0x477e51['attrs'][0x4][_0x4122('0x49')]:undefined)||_0x4122('0x53')},{'name':_0x4122('0x54'),'value':_0x477e51['attrEmailAccounts']||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x5]?_0x477e51[_0x4122('0x46')][0x5][_0x4122('0x49')]:undefined)||''},{'name':_0x4122('0x55'),'value':_0x477e51[_0x4122('0x55')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x6]?_0x477e51[_0x4122('0x46')][0x6][_0x4122('0x49')]:undefined)||''},{'name':_0x4122('0x56'),'value':_0x477e51[_0x4122('0x56')]||(_0x477e51['attrs']&&_0x477e51[_0x4122('0x46')][0x7]?_0x477e51['attrs'][0x7][_0x4122('0x49')]:undefined)||''},{'name':_0x4122('0x57'),'value':_0x477e51[_0x4122('0x57')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x8]?_0x477e51[_0x4122('0x46')][0x8]['value']:undefined)||''},{'name':_0x4122('0x58'),'value':_0x477e51['attrWhatsappAccounts']||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x9]?_0x477e51[_0x4122('0x46')][0x9]['value']:undefined)||''},{'name':_0x4122('0x59'),'value':_0x477e51[_0x4122('0x59')]||(_0x477e51['attrs']&&_0x477e51[_0x4122('0x46')][0xa]?_0x477e51[_0x4122('0x46')][0xa]['value']:undefined)||''}];case _0x4122('0x5e'):return[{'name':_0x4122('0x5f'),'type':_0x477e51[_0x4122('0x60')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x0]?_0x477e51[_0x4122('0x46')][0x0][_0x4122('0x43')]:undefined)||null,'value':_0x477e51[_0x4122('0x5f')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51[_0x4122('0x46')][0x0]?_0x477e51['attrs'][0x0][_0x4122('0x49')]:undefined)||null},{'name':_0x4122('0x61'),'value':_0x477e51[_0x4122('0x61')]||(_0x477e51[_0x4122('0x46')]&&_0x477e51['attrs'][0x1]?_0x477e51[_0x4122('0x46')][0x1][_0x4122('0x49')]:undefined)||0x0}];default:return[];}}catch(_0x521b92){logger['error'](_0x4122('0x62'),JSON[_0x4122('0x63')](_0x521b92));return[];}}exports[_0x4122('0x64')]=function(_0x49199d,_0x4e7c0d){if(_0x49199d['body']){_0x49199d[_0x4122('0x65')]['attrs']=widgetAttributes(_0x49199d['body']);}return db[_0x4122('0x38')][_0x4122('0x64')](_0x49199d[_0x4122('0x65')],{})['then'](respondWithResult(_0x4e7c0d,0xc9))[_0x4122('0x66')](handleError(_0x4e7c0d,null));};exports[_0x4122('0x2f')]=function(_0xfb7f12,_0x33619f){if(_0xfb7f12[_0x4122('0x65')]['id']){delete _0xfb7f12[_0x4122('0x65')]['id'];}_0xfb7f12[_0x4122('0x65')][_0x4122('0x46')]=widgetAttributes(_0xfb7f12[_0x4122('0x65')]);return db[_0x4122('0x38')][_0x4122('0x42')]({'where':{'id':_0xfb7f12[_0x4122('0x35')]['id']}})['then'](handleEntityNotFound(_0x33619f,null))['then'](saveUpdates(_0xfb7f12[_0x4122('0x65')],null))[_0x4122('0x31')](respondWithResult(_0x33619f,null))[_0x4122('0x66')](handleError(_0x33619f,null));}; \ No newline at end of file +var _0xe829=['HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','sendStatus','stack','name','show','params','query','keys','intersection','model','attributes','fields','length','includeAll','include','merge','options','DashboardItem','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat'];(function(_0x5034cb,_0x322be8){var _0x44c8e2=function(_0xd9946e){while(--_0xd9946e){_0x5034cb['push'](_0x5034cb['shift']());}};_0x44c8e2(++_0x322be8);}(_0xe829,0xde));var _0x9e82=function(_0x4ec612,_0x57dfd6){_0x4ec612=_0x4ec612-0x0;var _0x52a015=_0xe829[_0x4ec612];return _0x52a015;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e82('0x0'));var zipdir=require(_0x9e82('0x1'));var jsonpatch=require(_0x9e82('0x2'));var rp=require(_0x9e82('0x3'));var moment=require(_0x9e82('0x4'));var BPromise=require(_0x9e82('0x5'));var Mustache=require('mustache');var util=require(_0x9e82('0x6'));var path=require(_0x9e82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e82('0x8'));var _=require(_0x9e82('0x9'));var squel=require(_0x9e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e82('0xb'));var deskjs=require(_0x9e82('0xc'));var toCsv=require(_0x9e82('0xd'));var querystring=require(_0x9e82('0xe'));var Papa=require('papaparse');var Redis=require(_0x9e82('0xf'));var authService=require(_0x9e82('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9e82('0x11'));var hardwareService=require(_0x9e82('0x12'));var logger=require('../../config/logger')(_0x9e82('0x13'));var utils=require(_0x9e82('0x14'));var config=require(_0x9e82('0x15'));var licenseUtil=require(_0x9e82('0x16'));var db=require(_0x9e82('0x17'))['db'];config['redis']=_[_0x9e82('0x18')](config[_0x9e82('0x19')],{'host':_0x9e82('0x1a'),'port':0x18eb});var socket=require(_0x9e82('0x1b'))(new Redis(config['redis']));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x4aaa5f,_0x5909a6){_0x5909a6=_0x5909a6||0xcc;return function(_0xa4bd12){if(_0xa4bd12){return _0x4aaa5f['sendStatus'](_0x5909a6);}return _0x4aaa5f[_0x9e82('0x1c')](_0x5909a6)[_0x9e82('0x1d')]();};}function respondWithResult(_0x1bdf3f,_0x37cea0){_0x37cea0=_0x37cea0||0xc8;return function(_0x4fa628){if(_0x4fa628){return _0x1bdf3f[_0x9e82('0x1c')](_0x37cea0)[_0x9e82('0x1e')](_0x4fa628);}};}function respondWithFilteredResult(_0x4e5203,_0x495af4){return function(_0x2a0afd){if(_0x2a0afd){var _0x1554b5=typeof _0x495af4[_0x9e82('0x1f')]===_0x9e82('0x20')&&typeof _0x495af4[_0x9e82('0x21')]===_0x9e82('0x20');var _0xaeaa71=_0x2a0afd['count'];var _0x243a46=_0x1554b5?0x0:_0x495af4[_0x9e82('0x1f')];var _0x3463e6=_0x1554b5?_0x2a0afd['count']:_0x495af4[_0x9e82('0x1f')]+_0x495af4['limit'];var _0x2e8cec;if(_0x3463e6>=_0xaeaa71){_0x3463e6=_0xaeaa71;_0x2e8cec=0xc8;}else{_0x2e8cec=0xce;}_0x4e5203[_0x9e82('0x1c')](_0x2e8cec);return _0x4e5203[_0x9e82('0x22')](_0x9e82('0x23'),_0x243a46+'-'+_0x3463e6+'/'+_0xaeaa71)[_0x9e82('0x1e')](_0x2a0afd);}return null;};}function patchUpdates(_0x4d23ed){return function(_0x8eabaa){try{jsonpatch[_0x9e82('0x24')](_0x8eabaa,_0x4d23ed,!![]);}catch(_0x221969){return BPromise[_0x9e82('0x25')](_0x221969);}return _0x8eabaa['save']();};}function saveUpdates(_0x551f4d,_0x2f7d3f){return function(_0x16e006){if(_0x16e006){return _0x16e006[_0x9e82('0x26')](_0x551f4d)[_0x9e82('0x27')](function(_0x1840ae){return _0x1840ae;});}return null;};}function removeEntity(_0x10628d,_0x54ffa4){return function(_0x18c645){if(_0x18c645){return _0x18c645['destroy']()['then'](function(){_0x10628d[_0x9e82('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a5a4e,_0x371df8){return function(_0x1ac8ee){if(!_0x1ac8ee){_0x5a5a4e[_0x9e82('0x28')](0x194);}return _0x1ac8ee;};}function handleError(_0x2690ef,_0x19491d){_0x19491d=_0x19491d||0x1f4;return function(_0x495b77){logger['error'](_0x495b77[_0x9e82('0x29')]);if(_0x495b77[_0x9e82('0x2a')]){delete _0x495b77[_0x9e82('0x2a')];}_0x2690ef['status'](_0x19491d)['send'](_0x495b77);};}exports[_0x9e82('0x2b')]=function(_0x41c424,_0x46afaf){var _0x23669={'raw':![],'where':{'id':_0x41c424[_0x9e82('0x2c')]['id']}},_0x30f973={};_0x30f973['model']=_['keys'](db['DashboardItem']['rawAttributes']);_0x30f973[_0x9e82('0x2d')]=_[_0x9e82('0x2e')](_0x41c424[_0x9e82('0x2d')]);_0x30f973['filters']=_[_0x9e82('0x2f')](_0x30f973[_0x9e82('0x30')],_0x30f973['query']);_0x23669[_0x9e82('0x31')]=_[_0x9e82('0x2f')](_0x30f973[_0x9e82('0x30')],qs[_0x9e82('0x32')](_0x41c424[_0x9e82('0x2d')][_0x9e82('0x32')]));_0x23669[_0x9e82('0x31')]=_0x23669[_0x9e82('0x31')][_0x9e82('0x33')]?_0x23669[_0x9e82('0x31')]:_0x30f973[_0x9e82('0x30')];if(_0x41c424[_0x9e82('0x2d')][_0x9e82('0x34')]){_0x23669[_0x9e82('0x35')]=[{'all':!![]}];}_0x23669=_[_0x9e82('0x36')]({},_0x23669,_0x41c424[_0x9e82('0x37')]);return db[_0x9e82('0x38')][_0x9e82('0x39')](_0x23669)[_0x9e82('0x27')](handleEntityNotFound(_0x46afaf,null))[_0x9e82('0x27')](respondWithResult(_0x46afaf,null))[_0x9e82('0x3a')](handleError(_0x46afaf,null));};exports[_0x9e82('0x3b')]=function(_0x51847f,_0x164c4d){return db[_0x9e82('0x38')][_0x9e82('0x39')]({'where':{'id':_0x51847f[_0x9e82('0x2c')]['id']}})['then'](handleEntityNotFound(_0x164c4d,null))['then'](removeEntity(_0x164c4d,null))['catch'](handleError(_0x164c4d,null));};function widgetAttributes(_0x5b02df){try{switch(_0x5b02df[_0x9e82('0x3c')]){case _0x9e82('0x3d'):return[{'name':_0x9e82('0x3e'),'value':_0x5b02df[_0x9e82('0x3e')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df[_0x9e82('0x3f')][0x0][_0x9e82('0x40')]:undefined)||_0x9e82('0x41')}];case _0x9e82('0x42'):return[{'name':_0x9e82('0x43'),'value':_0x5b02df[_0x9e82('0x43')]||(_0x5b02df['attrs']&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df[_0x9e82('0x3f')][0x0][_0x9e82('0x40')]:undefined)||''}];case'clock':return[{'name':_0x9e82('0x44'),'value':_0x5b02df[_0x9e82('0x44')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df['attrs'][0x0]?_0x5b02df[_0x9e82('0x3f')][0x0][_0x9e82('0x40')]:undefined)||_0x9e82('0x45')},{'name':_0x9e82('0x46'),'value':_0x5b02df[_0x9e82('0x46')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x1]?_0x5b02df[_0x9e82('0x3f')][0x1][_0x9e82('0x40')]:undefined)||_0x9e82('0x47')},{'name':_0x9e82('0x48'),'value':_0x5b02df['attrFontSize']||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x2]?_0x5b02df[_0x9e82('0x3f')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x5b02df[_0x9e82('0x49')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df['attrs'][0x0][_0x9e82('0x40')]:undefined)||_0x9e82('0x4a')},{'name':_0x9e82('0x4b'),'value':_0x5b02df[_0x9e82('0x4b')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x1]?_0x5b02df['attrs'][0x1][_0x9e82('0x40')]:undefined)||[]},{'name':'attrFontSize','value':_0x5b02df['attrFontSize']||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x2]?_0x5b02df[_0x9e82('0x3f')][0x2][_0x9e82('0x40')]:undefined)||0x14},{'name':_0x9e82('0x4c'),'value':_0x5b02df[_0x9e82('0x4c')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x3]?_0x5b02df['attrs'][0x3][_0x9e82('0x40')]:undefined)||'voice'},{'name':_0x9e82('0x4d'),'value':_0x5b02df[_0x9e82('0x4d')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x4]?_0x5b02df[_0x9e82('0x3f')][0x4][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x4e'),'value':_0x5b02df[_0x9e82('0x4e')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df['attrs'][0x5]?_0x5b02df[_0x9e82('0x3f')][0x5][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x4f'),'value':_0x5b02df[_0x9e82('0x4f')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x6]?_0x5b02df[_0x9e82('0x3f')][0x6][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x50'),'value':_0x5b02df[_0x9e82('0x50')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x7]?_0x5b02df[_0x9e82('0x3f')][0x7][_0x9e82('0x40')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5b02df[_0x9e82('0x51')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x8]?_0x5b02df[_0x9e82('0x3f')][0x8][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x52'),'value':_0x5b02df[_0x9e82('0x52')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x9]?_0x5b02df[_0x9e82('0x3f')][0x9][_0x9e82('0x40')]:undefined)||''}];case _0x9e82('0x53'):case _0x9e82('0x54'):return[{'name':_0x9e82('0x55'),'value':_0x5b02df[_0x9e82('0x55')]||(_0x5b02df['attrs']&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df[_0x9e82('0x3f')][0x0][_0x9e82('0x40')]:undefined)||'total'},{'name':_0x9e82('0x56'),'value':_0x5b02df[_0x9e82('0x56')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x1]?_0x5b02df['attrs'][0x1][_0x9e82('0x40')]:undefined)||null},{'name':_0x9e82('0x57'),'value':_0x5b02df[_0x9e82('0x57')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df['attrs'][0x2]?_0x5b02df[_0x9e82('0x3f')][0x2][_0x9e82('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5b02df[_0x9e82('0x4b')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x3]?_0x5b02df[_0x9e82('0x3f')][0x3][_0x9e82('0x40')]:undefined)||[]},{'name':_0x9e82('0x4c'),'value':_0x5b02df['attrChannel']||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df['attrs'][0x4]?_0x5b02df[_0x9e82('0x3f')][0x4][_0x9e82('0x40')]:undefined)||_0x9e82('0x58')},{'name':_0x9e82('0x4d'),'value':_0x5b02df[_0x9e82('0x4d')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x5]?_0x5b02df['attrs'][0x5][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x4e'),'value':_0x5b02df['attrFaxAccounts']||(_0x5b02df['attrs']&&_0x5b02df['attrs'][0x6]?_0x5b02df['attrs'][0x6][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x4f'),'value':_0x5b02df[_0x9e82('0x4f')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x7]?_0x5b02df['attrs'][0x7][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x50'),'value':_0x5b02df[_0x9e82('0x50')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df['attrs'][0x8]?_0x5b02df['attrs'][0x8]['value']:undefined)||''},{'name':_0x9e82('0x51'),'value':_0x5b02df[_0x9e82('0x51')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x9]?_0x5b02df['attrs'][0x9][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x52'),'value':_0x5b02df[_0x9e82('0x52')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0xa]?_0x5b02df[_0x9e82('0x3f')][0xa][_0x9e82('0x40')]:undefined)||''}];case _0x9e82('0x59'):return[{'name':_0x9e82('0x5a'),'type':_0x5b02df[_0x9e82('0x5b')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df[_0x9e82('0x3f')][0x0][_0x9e82('0x3c')]:undefined)||null,'value':_0x5b02df[_0x9e82('0x5a')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x5b02df[_0x9e82('0x5c')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x1]?_0x5b02df['attrs'][0x1][_0x9e82('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x9ee546){logger['error'](_0x9e82('0x5d'),JSON[_0x9e82('0x5e')](_0x9ee546));return[];}}exports[_0x9e82('0x5f')]=function(_0x1acc06,_0x1a8c47){if(_0x1acc06[_0x9e82('0x60')]){_0x1acc06[_0x9e82('0x60')][_0x9e82('0x3f')]=widgetAttributes(_0x1acc06['body']);}return db[_0x9e82('0x38')][_0x9e82('0x5f')](_0x1acc06[_0x9e82('0x60')],{})[_0x9e82('0x27')](respondWithResult(_0x1a8c47,0xc9))['catch'](handleError(_0x1a8c47,null));};exports['update']=function(_0x26a872,_0x388e4f){if(_0x26a872[_0x9e82('0x60')]['id']){delete _0x26a872[_0x9e82('0x60')]['id'];}_0x26a872[_0x9e82('0x60')][_0x9e82('0x3f')]=widgetAttributes(_0x26a872[_0x9e82('0x60')]);return db[_0x9e82('0x38')][_0x9e82('0x39')]({'where':{'id':_0x26a872['params']['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x388e4f,null))[_0x9e82('0x27')](saveUpdates(_0x26a872[_0x9e82('0x60')],null))['then'](respondWithResult(_0x388e4f,null))[_0x9e82('0x3a')](handleError(_0x388e4f,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a0559d8..9bc13e4 100644 --- a/server/api/dashboardItem/dashboardItem.events.js +++ b/server/api/dashboardItem/dashboardItem.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a78=['hasOwnProperty','hook','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit'];(function(_0x19ce89,_0x5e7c3f){var _0x38da45=function(_0x28b148){while(--_0x28b148){_0x19ce89['push'](_0x19ce89['shift']());}};_0x38da45(++_0x5e7c3f);}(_0x6a78,0x1c4));var _0x86a7=function(_0x2bfda5,_0x1c8661){_0x2bfda5=_0x2bfda5-0x0;var _0x2bce46=_0x6a78[_0x2bfda5];return _0x2bce46;};'use strict';var EventEmitter=require(_0x86a7('0x0'));var DashboardItem=require(_0x86a7('0x1'))['db'][_0x86a7('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x86a7('0x3')](0x0);var events={'afterCreate':_0x86a7('0x4'),'afterUpdate':_0x86a7('0x5'),'afterDestroy':_0x86a7('0x6')};function emitEvent(_0x44a8a5){return function(_0x426435,_0x363dc4,_0x530d7c){DashboardItemEvents[_0x86a7('0x7')](_0x44a8a5+':'+_0x426435['id'],_0x426435);DashboardItemEvents[_0x86a7('0x7')](_0x44a8a5,_0x426435);_0x530d7c(null);};}for(var e in events){if(events[_0x86a7('0x8')](e)){var event=events[e];DashboardItem[_0x86a7('0x9')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xf4de=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x17448f,_0x4378e9){var _0x257b50=function(_0x4702d3){while(--_0x4702d3){_0x17448f['push'](_0x17448f['shift']());}};_0x257b50(++_0x4378e9);}(_0xf4de,0xdf));var _0xef4d=function(_0xa862c7,_0x694523){_0xa862c7=_0xa862c7-0x0;var _0x2dbcb3=_0xf4de[_0xa862c7];return _0x2dbcb3;};'use strict';var EventEmitter=require(_0xef4d('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xef4d('0x1')](0x0);var events={'afterCreate':_0xef4d('0x2'),'afterUpdate':_0xef4d('0x3'),'afterDestroy':_0xef4d('0x4')};function emitEvent(_0x32300f){return function(_0x425b38,_0x426c3e,_0x126893){DashboardItemEvents[_0xef4d('0x5')](_0x32300f+':'+_0x425b38['id'],_0x425b38);DashboardItemEvents[_0xef4d('0x5')](_0x32300f,_0x425b38);_0x126893(null);};}for(var e in events){if(events[_0xef4d('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xef4d('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index f4befb6..6641b05 100644 --- a/server/api/dashboardItem/dashboardItem.model.js +++ b/server/api/dashboardItem/dashboardItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1671=['api','moment','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','dashboard_items','lodash','util'];(function(_0x4af584,_0x399c0f){var _0x4cf991=function(_0x57699d){while(--_0x57699d){_0x4af584['push'](_0x4af584['shift']());}};_0x4cf991(++_0x399c0f);}(_0x1671,0xfb));var _0x1167=function(_0x1bc29e,_0x48ca67){_0x1bc29e=_0x1bc29e-0x0;var _0x3e49a2=_0x1671[_0x1bc29e];return _0x3e49a2;};'use strict';var _=require(_0x1167('0x0'));var util=require(_0x1167('0x1'));var logger=require('../../config/logger')(_0x1167('0x2'));var moment=require(_0x1167('0x3'));var BPromise=require('bluebird');var rp=require(_0x1167('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1167('0x5'));var config=require(_0x1167('0x6'));var attributes=require(_0x1167('0x7'));module[_0x1167('0x8')]=function(_0x59fae4,_0x480d94){return _0x59fae4[_0x1167('0x9')]('DashboardItem',attributes,{'tableName':_0x1167('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe9a=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items'];(function(_0x1759f5,_0x2f3d31){var _0x535ce0=function(_0x2293ef){while(--_0x2293ef){_0x1759f5['push'](_0x1759f5['shift']());}};_0x535ce0(++_0x2f3d31);}(_0xbe9a,0x1a4));var _0xabe9=function(_0x554f23,_0x5a5460){_0x554f23=_0x554f23-0x0;var _0x51e7da=_0xbe9a[_0x554f23];return _0x51e7da;};'use strict';var _=require(_0xabe9('0x0'));var util=require('util');var logger=require(_0xabe9('0x1'))(_0xabe9('0x2'));var moment=require(_0xabe9('0x3'));var BPromise=require('bluebird');var rp=require(_0xabe9('0x4'));var fs=require('fs');var path=require(_0xabe9('0x5'));var rimraf=require(_0xabe9('0x6'));var config=require(_0xabe9('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xabe9('0x8')]=function(_0x40b9aa,_0x1ee7e0){return _0x40b9aa[_0xabe9('0x9')](_0xabe9('0xa'),attributes,{'tableName':_0xabe9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 1b1e2d6..84079fb 100644 --- a/server/api/dashboardItem/dashboardItem.rpc.js +++ b/server/api/dashboardItem/dashboardItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49f2=['request','then','info','request\x20sent','debug','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x43f301,_0x27d61b){var _0x34fd8f=function(_0xcbd6ed){while(--_0xcbd6ed){_0x43f301['push'](_0x43f301['shift']());}};_0x34fd8f(++_0x27d61b);}(_0x49f2,0x192));var _0x249f=function(_0x15ee40,_0xcdbbd8){_0x15ee40=_0x15ee40-0x0;var _0x2515e6=_0x49f2[_0x15ee40];return _0x2515e6;};'use strict';var _=require(_0x249f('0x0'));var util=require(_0x249f('0x1'));var moment=require(_0x249f('0x2'));var BPromise=require('bluebird');var rs=require(_0x249f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x249f('0x4'))(_0x249f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x249f('0x6')][_0x249f('0x7')]({'port':0x232a});config[_0x249f('0x8')]=_[_0x249f('0x9')](config[_0x249f('0x8')],{'host':_0x249f('0xa'),'port':0x18eb});var socket=require(_0x249f('0xb'))(new Redis(config['redis']));require(_0x249f('0xc'))[_0x249f('0xd')](socket);function respondWithRpcPromise(_0x510893,_0x2e4788,_0x4b62a4){return new BPromise(function(_0x35b2d3,_0x464e86){return client[_0x249f('0xe')](_0x510893,_0x4b62a4)[_0x249f('0xf')](function(_0x4b9a3a){logger[_0x249f('0x10')]('DashboardItem,\x20%s,\x20%s',_0x2e4788,_0x249f('0x11'));logger[_0x249f('0x12')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x2e4788,_0x249f('0x11'),JSON[_0x249f('0x13')](_0x4b9a3a));if(_0x4b9a3a[_0x249f('0x14')]){if(_0x4b9a3a['error'][_0x249f('0x15')]===0x1f4){logger['error'](_0x249f('0x16'),_0x2e4788,_0x4b9a3a['error'][_0x249f('0x17')]);return _0x464e86(_0x4b9a3a[_0x249f('0x14')][_0x249f('0x17')]);}logger[_0x249f('0x14')](_0x249f('0x16'),_0x2e4788,_0x4b9a3a['error'][_0x249f('0x17')]);return _0x35b2d3(_0x4b9a3a[_0x249f('0x14')]['message']);}else{logger[_0x249f('0x10')]('DashboardItem,\x20%s,\x20%s',_0x2e4788,_0x249f('0x11'));_0x35b2d3(_0x4b9a3a[_0x249f('0x18')]['message']);}})[_0x249f('0x19')](function(_0x13590d){logger[_0x249f('0x14')]('DashboardItem,\x20%s,\x20%s',_0x2e4788,_0x13590d);_0x464e86(_0x13590d);});});} \ No newline at end of file +var _0x15ef=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring'];(function(_0x38a760,_0x520b0c){var _0x478963=function(_0x1e91bf){while(--_0x1e91bf){_0x38a760['push'](_0x38a760['shift']());}};_0x478963(++_0x520b0c);}(_0x15ef,0xf8));var _0xf15e=function(_0x553969,_0x12bc3b){_0x553969=_0x553969-0x0;var _0x4d074a=_0x15ef[_0x553969];return _0x4d074a;};'use strict';var _=require('lodash');var util=require(_0xf15e('0x0'));var moment=require(_0xf15e('0x1'));var BPromise=require(_0xf15e('0x2'));var rs=require(_0xf15e('0x3'));var fs=require('fs');var Redis=require(_0xf15e('0x4'));var db=require(_0xf15e('0x5'))['db'];var utils=require(_0xf15e('0x6'));var logger=require(_0xf15e('0x7'))(_0xf15e('0x8'));var config=require(_0xf15e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf15e('0xa')][_0xf15e('0xb')]({'port':0x232a});config[_0xf15e('0xc')]=_[_0xf15e('0xd')](config[_0xf15e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf15e('0xe'))(new Redis(config[_0xf15e('0xc')]));require(_0xf15e('0xf'))[_0xf15e('0x10')](socket);function respondWithRpcPromise(_0x1ba612,_0x2b6860,_0x14f0d2){return new BPromise(function(_0x46e262,_0x30f52a){return client[_0xf15e('0x11')](_0x1ba612,_0x14f0d2)['then'](function(_0x3cdbef){logger['info'](_0xf15e('0x12'),_0x2b6860,_0xf15e('0x13'));logger[_0xf15e('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x2b6860,_0xf15e('0x13'),JSON[_0xf15e('0x15')](_0x3cdbef));if(_0x3cdbef[_0xf15e('0x16')]){if(_0x3cdbef[_0xf15e('0x16')][_0xf15e('0x17')]===0x1f4){logger['error'](_0xf15e('0x12'),_0x2b6860,_0x3cdbef[_0xf15e('0x16')][_0xf15e('0x18')]);return _0x30f52a(_0x3cdbef[_0xf15e('0x16')][_0xf15e('0x18')]);}logger[_0xf15e('0x16')]('DashboardItem,\x20%s,\x20%s',_0x2b6860,_0x3cdbef[_0xf15e('0x16')]['message']);return _0x46e262(_0x3cdbef[_0xf15e('0x16')][_0xf15e('0x18')]);}else{logger[_0xf15e('0x19')](_0xf15e('0x12'),_0x2b6860,_0xf15e('0x13'));_0x46e262(_0x3cdbef[_0xf15e('0x1a')]['message']);}})[_0xf15e('0x1b')](function(_0x834670){logger[_0xf15e('0x16')](_0xf15e('0x12'),_0x2b6860,_0x834670);_0x30f52a(_0x834670);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index ab37fd0..c76e309 100644 --- a/server/api/dashboardItem/dashboardItem.socket.js +++ b/server/api/dashboardItem/dashboardItem.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ab7=['save','remove','update','removeListener','length','dashboardItem:','./dashboardItem.events'];(function(_0xa579db,_0x4c5469){var _0x46b079=function(_0x1e07e4){while(--_0x1e07e4){_0xa579db['push'](_0xa579db['shift']());}};_0x46b079(++_0x4c5469);}(_0x6ab7,0xdf));var _0x76ab=function(_0x6f8b69,_0x8e4086){_0x6f8b69=_0x6f8b69-0x0;var _0x4e32e8=_0x6ab7[_0x6f8b69];return _0x4e32e8;};'use strict';var DashboardItemEvents=require(_0x76ab('0x0'));var events=[_0x76ab('0x1'),_0x76ab('0x2'),_0x76ab('0x3')];function createListener(_0x371e89,_0x19bf43){return function(_0x3bb1d5){_0x19bf43['emit'](_0x371e89,_0x3bb1d5);};}function removeListener(_0xae7e09,_0x18650a){return function(){DashboardItemEvents[_0x76ab('0x4')](_0xae7e09,_0x18650a);};}exports['register']=function(_0x32dbd8){for(var _0x35de67=0x0,_0x139ff6=events[_0x76ab('0x5')];_0x35de67<_0x139ff6;_0x35de67++){var _0x4efff5=events[_0x35de67];var _0xda52bb=createListener(_0x76ab('0x6')+_0x4efff5,_0x32dbd8);DashboardItemEvents['on'](_0x4efff5,_0xda52bb);}}; \ No newline at end of file +var _0xf277=['update','emit','removeListener','register','dashboardItem:','./dashboardItem.events','remove'];(function(_0x47bcee,_0x5c0311){var _0x4b88a8=function(_0x170762){while(--_0x170762){_0x47bcee['push'](_0x47bcee['shift']());}};_0x4b88a8(++_0x5c0311);}(_0xf277,0x67));var _0x7f27=function(_0x5a31cb,_0x4c64a0){_0x5a31cb=_0x5a31cb-0x0;var _0x3a440f=_0xf277[_0x5a31cb];return _0x3a440f;};'use strict';var DashboardItemEvents=require(_0x7f27('0x0'));var events=['save',_0x7f27('0x1'),_0x7f27('0x2')];function createListener(_0x59cda4,_0x37e849){return function(_0x74aaf8){_0x37e849[_0x7f27('0x3')](_0x59cda4,_0x74aaf8);};}function removeListener(_0x2adb83,_0xd7f98d){return function(){DashboardItemEvents[_0x7f27('0x4')](_0x2adb83,_0xd7f98d);};}exports[_0x7f27('0x5')]=function(_0x49ddce){for(var _0x53d7bb=0x0,_0x149687=events['length'];_0x53d7bb<_0x149687;_0x53d7bb++){var _0x26f0c7=events[_0x53d7bb];var _0x449f36=createListener(_0x7f27('0x6')+_0x26f0c7,_0x49ddce);DashboardItemEvents['on'](_0x26f0c7,_0x449f36);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c30952c..4c687eb 100644 --- a/server/api/dashboardItem/index.js +++ b/server/api/dashboardItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb795=['../../components/interaction/service','../../config/environment','get','isAuthenticated','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x309dde,_0x5e832c){var _0x3bc341=function(_0x4acaaa){while(--_0x4acaaa){_0x309dde['push'](_0x309dde['shift']());}};_0x3bc341(++_0x5e832c);}(_0xb795,0x1a2));var _0x5b79=function(_0x3c8d4a,_0x3c8f18){_0x3c8d4a=_0x3c8d4a-0x0;var _0x1e5d47=_0xb795[_0x3c8d4a];return _0x1e5d47;};'use strict';var multer=require(_0x5b79('0x0'));var util=require(_0x5b79('0x1'));var path=require(_0x5b79('0x2'));var timeout=require(_0x5b79('0x3'));var express=require('express');var router=express[_0x5b79('0x4')]();var fs_extra=require(_0x5b79('0x5'));var auth=require(_0x5b79('0x6'));var interaction=require(_0x5b79('0x7'));var config=require(_0x5b79('0x8'));var controller=require('./dashboardItem.controller');router[_0x5b79('0x9')]('/:id',auth[_0x5b79('0xa')](),controller['show']);router[_0x5b79('0xb')]('/',auth[_0x5b79('0xa')](),controller[_0x5b79('0xc')]);router[_0x5b79('0xd')](_0x5b79('0xe'),auth[_0x5b79('0xa')](),controller[_0x5b79('0xf')]);router['delete'](_0x5b79('0xe'),auth['isAuthenticated'](),controller[_0x5b79('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4691=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x1a7383,_0x3fd99f){var _0x8d39e5=function(_0x118e05){while(--_0x118e05){_0x1a7383['push'](_0x1a7383['shift']());}};_0x8d39e5(++_0x3fd99f);}(_0x4691,0x153));var _0x1469=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x4691[_0x1762b4];return _0x29beda;};'use strict';var multer=require('multer');var util=require(_0x1469('0x0'));var path=require(_0x1469('0x1'));var timeout=require(_0x1469('0x2'));var express=require(_0x1469('0x3'));var router=express[_0x1469('0x4')]();var fs_extra=require(_0x1469('0x5'));var auth=require(_0x1469('0x6'));var interaction=require(_0x1469('0x7'));var config=require(_0x1469('0x8'));var controller=require('./dashboardItem.controller');router['get'](_0x1469('0x9'),auth[_0x1469('0xa')](),controller[_0x1469('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1469('0xc')]);router[_0x1469('0xd')](_0x1469('0x9'),auth['isAuthenticated'](),controller[_0x1469('0xe')]);router[_0x1469('0xf')]('/:id',auth[_0x1469('0xa')](),controller[_0x1469('0x10')]);module[_0x1469('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index c6cf986..8ea2f81 100644 --- a/server/api/disposition/disposition.attributes.js +++ b/server/api/disposition/disposition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa441=['first','second','third','STRING','sequelize','ENUM'];(function(_0x48625b,_0x52ffcf){var _0x51fa2e=function(_0x475bed){while(--_0x475bed){_0x48625b['push'](_0x48625b['shift']());}};_0x51fa2e(++_0x52ffcf);}(_0xa441,0x1e4));var _0x1a44=function(_0x363e33,_0x12a5f8){_0x363e33=_0x363e33-0x0;var _0x237d27=_0xa441[_0x363e33];return _0x237d27;};'use strict';var Sequelize=require(_0x1a44('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x1a44('0x1')](_0x1a44('0x2'),_0x1a44('0x3'),_0x1a44('0x4')),'allowNull':![],'defaultValue':_0x1a44('0x2')},'description':{'type':Sequelize[_0x1a44('0x5')]}}; \ No newline at end of file +var _0x2663=['ENUM','first','second','third','sequelize','STRING'];(function(_0x4e3699,_0x42a2d3){var _0x910ae4=function(_0x5e0577){while(--_0x5e0577){_0x4e3699['push'](_0x4e3699['shift']());}};_0x910ae4(++_0x42a2d3);}(_0x2663,0x10c));var _0x3266=function(_0x177c8d,_0x15a8af){_0x177c8d=_0x177c8d-0x0;var _0x2a771b=_0x2663[_0x177c8d];return _0x2a771b;};'use strict';var Sequelize=require(_0x3266('0x0'));module['exports']={'name':{'type':Sequelize[_0x3266('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x3266('0x2')](_0x3266('0x3'),_0x3266('0x4'),_0x3266('0x5')),'allowNull':![],'defaultValue':_0x3266('0x3')},'description':{'type':Sequelize[_0x3266('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index dbdd615..500d886 100644 --- a/server/api/disposition/disposition.controller.js +++ b/server/api/disposition/disposition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2af=['pick','filter','merge','VIRTUAL','Disposition','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Dispositions','error','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where'];(function(_0x121ebd,_0x408cfa){var _0x578b97=function(_0x558da){while(--_0x558da){_0x121ebd['push'](_0x121ebd['shift']());}};_0x578b97(++_0x408cfa);}(_0xe2af,0x6a));var _0xfe2a=function(_0x287c24,_0x4038c7){_0x287c24=_0x287c24-0x0;var _0xc80fcc=_0xe2af[_0x287c24];return _0xc80fcc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2a('0x0'));var zipdir=require(_0xfe2a('0x1'));var jsonpatch=require(_0xfe2a('0x2'));var rp=require(_0xfe2a('0x3'));var moment=require(_0xfe2a('0x4'));var BPromise=require(_0xfe2a('0x5'));var Mustache=require(_0xfe2a('0x6'));var util=require('util');var path=require(_0xfe2a('0x7'));var sox=require(_0xfe2a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe2a('0x9'));var squel=require(_0xfe2a('0xa'));var crypto=require('crypto');var jsforce=require(_0xfe2a('0xb'));var deskjs=require(_0xfe2a('0xc'));var toCsv=require(_0xfe2a('0xd'));var querystring=require('querystring');var Papa=require(_0xfe2a('0xe'));var Redis=require(_0xfe2a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfe2a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe2a('0x11'));var logger=require(_0xfe2a('0x12'))(_0xfe2a('0x13'));var utils=require(_0xfe2a('0x14'));var config=require(_0xfe2a('0x15'));var licenseUtil=require(_0xfe2a('0x16'));var db=require(_0xfe2a('0x17'))['db'];function respondWithStatusCode(_0x5da98e,_0x1f2ed2){_0x1f2ed2=_0x1f2ed2||0xcc;return function(_0x1ac883){if(_0x1ac883){return _0x5da98e[_0xfe2a('0x18')](_0x1f2ed2);}return _0x5da98e[_0xfe2a('0x19')](_0x1f2ed2)[_0xfe2a('0x1a')]();};}function respondWithResult(_0x18a30b,_0x27a740){_0x27a740=_0x27a740||0xc8;return function(_0x4bb463){if(_0x4bb463){return _0x18a30b['status'](_0x27a740)[_0xfe2a('0x1b')](_0x4bb463);}};}function respondWithFilteredResult(_0xc24caa,_0x213a13){return function(_0x428f02){if(_0x428f02){var _0x3026dc=typeof _0x213a13[_0xfe2a('0x1c')]===_0xfe2a('0x1d')&&typeof _0x213a13[_0xfe2a('0x1e')]===_0xfe2a('0x1d');var _0x499452=_0x428f02[_0xfe2a('0x1f')];var _0x4969a9=_0x3026dc?0x0:_0x213a13['offset'];var _0x4f2b86=_0x3026dc?_0x428f02[_0xfe2a('0x1f')]:_0x213a13[_0xfe2a('0x1c')]+_0x213a13[_0xfe2a('0x1e')];var _0x430a5f;if(_0x4f2b86>=_0x499452){_0x4f2b86=_0x499452;_0x430a5f=0xc8;}else{_0x430a5f=0xce;}_0xc24caa[_0xfe2a('0x19')](_0x430a5f);return _0xc24caa[_0xfe2a('0x20')]('Content-Range',_0x4969a9+'-'+_0x4f2b86+'/'+_0x499452)[_0xfe2a('0x1b')](_0x428f02);}return null;};}function patchUpdates(_0x36bbd1){return function(_0x304920){try{jsonpatch[_0xfe2a('0x21')](_0x304920,_0x36bbd1,!![]);}catch(_0x18ccef){return BPromise['reject'](_0x18ccef);}return _0x304920[_0xfe2a('0x22')]();};}function saveUpdates(_0x36274c,_0x4e51c6){return function(_0x20afcd){if(_0x20afcd){return _0x20afcd[_0xfe2a('0x23')](_0x36274c)[_0xfe2a('0x24')](function(_0x5d1829){return _0x5d1829;});}return null;};}function removeEntity(_0x2cb58c,_0xbf719f){return function(_0x1a31f1){if(_0x1a31f1){return _0x1a31f1[_0xfe2a('0x25')]()[_0xfe2a('0x24')](function(){var _0x41a072=_0x1a31f1[_0xfe2a('0x26')]({'plain':!![]});var _0x59e1fd=_0xfe2a('0x27');return db['UserProfileResource'][_0xfe2a('0x25')]({'where':{'type':_0x59e1fd,'resourceId':_0x41a072['id']}})[_0xfe2a('0x24')](function(){return _0x1a31f1;});})[_0xfe2a('0x24')](function(){_0x2cb58c['status'](0xcc)[_0xfe2a('0x1a')]();});}};}function handleEntityNotFound(_0x3bf4a0,_0x4a980b){return function(_0x4d8d5e){if(!_0x4d8d5e){_0x3bf4a0['sendStatus'](0x194);}return _0x4d8d5e;};}function handleError(_0x24ff7b,_0x3209fa){_0x3209fa=_0x3209fa||0x1f4;return function(_0x5a715c){logger[_0xfe2a('0x28')](_0x5a715c['stack']);if(_0x5a715c[_0xfe2a('0x29')]){delete _0x5a715c['name'];}_0x24ff7b['status'](_0x3209fa)[_0xfe2a('0x2a')](_0x5a715c);};}exports['index']=function(_0x17541d,_0x518365){var _0xb9a17f={},_0x2387d1={},_0x1d8146={'count':0x0,'rows':[]};var _0x415d4d=_[_0xfe2a('0x2b')](db['Disposition'][_0xfe2a('0x2c')],function(_0x3efbb6){return{'name':_0x3efbb6[_0xfe2a('0x2d')],'type':_0x3efbb6[_0xfe2a('0x2e')][_0xfe2a('0x2f')]};});_0x2387d1[_0xfe2a('0x30')]=_[_0xfe2a('0x2b')](_0x415d4d,_0xfe2a('0x29'));_0x2387d1[_0xfe2a('0x31')]=_['keys'](_0x17541d[_0xfe2a('0x31')]);_0x2387d1[_0xfe2a('0x32')]=_[_0xfe2a('0x33')](_0x2387d1[_0xfe2a('0x30')],_0x2387d1['query']);_0xb9a17f[_0xfe2a('0x34')]=_['intersection'](_0x2387d1[_0xfe2a('0x30')],qs[_0xfe2a('0x35')](_0x17541d[_0xfe2a('0x31')][_0xfe2a('0x35')]));_0xb9a17f[_0xfe2a('0x34')]=_0xb9a17f[_0xfe2a('0x34')][_0xfe2a('0x36')]?_0xb9a17f['attributes']:_0x2387d1[_0xfe2a('0x30')];if(!_0x17541d[_0xfe2a('0x31')]['hasOwnProperty'](_0xfe2a('0x37'))){_0xb9a17f[_0xfe2a('0x1e')]=qs[_0xfe2a('0x1e')](_0x17541d[_0xfe2a('0x31')][_0xfe2a('0x1e')]);_0xb9a17f[_0xfe2a('0x1c')]=qs[_0xfe2a('0x1c')](_0x17541d['query'][_0xfe2a('0x1c')]);}_0xb9a17f['order']=qs[_0xfe2a('0x38')](_0x17541d[_0xfe2a('0x31')][_0xfe2a('0x38')]);_0xb9a17f[_0xfe2a('0x39')]=qs[_0xfe2a('0x32')](_[_0xfe2a('0x3a')](_0x17541d[_0xfe2a('0x31')],_0x2387d1[_0xfe2a('0x32')]),_0x415d4d);if(_0x17541d[_0xfe2a('0x31')][_0xfe2a('0x3b')]){_0xb9a17f[_0xfe2a('0x39')]=_[_0xfe2a('0x3c')](_0xb9a17f[_0xfe2a('0x39')],{'$or':_[_0xfe2a('0x2b')](_0x415d4d,function(_0x178b10){if(_0x178b10[_0xfe2a('0x2e')]!==_0xfe2a('0x3d')){var _0x11f16d={};_0x11f16d[_0x178b10[_0xfe2a('0x29')]]={'$like':'%'+_0x17541d['query']['filter']+'%'};return _0x11f16d;}})});}_0xb9a17f=_['merge']({},_0xb9a17f,_0x17541d['options']);var _0x2026c7={'where':_0xb9a17f['where']};return db[_0xfe2a('0x3e')][_0xfe2a('0x1f')](_0x2026c7)[_0xfe2a('0x24')](function(_0x42b659){_0x1d8146[_0xfe2a('0x1f')]=_0x42b659;if(_0x17541d[_0xfe2a('0x31')][_0xfe2a('0x3f')]){_0xb9a17f[_0xfe2a('0x40')]=[{'all':!![]}];}return db[_0xfe2a('0x3e')][_0xfe2a('0x41')](_0xb9a17f);})['then'](function(_0x1d1de1){_0x1d8146[_0xfe2a('0x42')]=_0x1d1de1;return _0x1d8146;})[_0xfe2a('0x24')](respondWithFilteredResult(_0x518365,_0xb9a17f))[_0xfe2a('0x43')](handleError(_0x518365,null));};exports[_0xfe2a('0x44')]=function(_0x7ed669,_0xa32d4d){var _0x2d7462={'raw':!![],'where':{'id':_0x7ed669[_0xfe2a('0x45')]['id']}},_0x3287af={};_0x3287af[_0xfe2a('0x30')]=_[_0xfe2a('0x46')](db['Disposition'][_0xfe2a('0x2c')]);_0x3287af[_0xfe2a('0x31')]=_['keys'](_0x7ed669[_0xfe2a('0x31')]);_0x3287af[_0xfe2a('0x32')]=_[_0xfe2a('0x33')](_0x3287af[_0xfe2a('0x30')],_0x3287af['query']);_0x2d7462[_0xfe2a('0x34')]=_['intersection'](_0x3287af[_0xfe2a('0x30')],qs[_0xfe2a('0x35')](_0x7ed669[_0xfe2a('0x31')]['fields']));_0x2d7462[_0xfe2a('0x34')]=_0x2d7462[_0xfe2a('0x34')][_0xfe2a('0x36')]?_0x2d7462['attributes']:_0x3287af[_0xfe2a('0x30')];if(_0x7ed669['query'][_0xfe2a('0x3f')]){_0x2d7462[_0xfe2a('0x40')]=[{'all':!![]}];}_0x2d7462=_[_0xfe2a('0x3c')]({},_0x2d7462,_0x7ed669[_0xfe2a('0x47')]);return db['Disposition'][_0xfe2a('0x48')](_0x2d7462)[_0xfe2a('0x24')](handleEntityNotFound(_0xa32d4d,null))[_0xfe2a('0x24')](respondWithResult(_0xa32d4d,null))[_0xfe2a('0x43')](handleError(_0xa32d4d,null));};exports[_0xfe2a('0x49')]=function(_0x1c8693,_0x2ef065){return db[_0xfe2a('0x3e')][_0xfe2a('0x49')](_0x1c8693[_0xfe2a('0x4a')],{})[_0xfe2a('0x24')](function(_0x5b0d9f){var _0x5da79f=_0x1c8693[_0xfe2a('0x4b')][_0xfe2a('0x26')]({'plain':!![]});if(!_0x5da79f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5da79f[_0xfe2a('0x4c')]===_0xfe2a('0x4b')){var _0x51b796=_0x5b0d9f['get']({'plain':!![]});var _0x20a274='Dispositions';return db[_0xfe2a('0x4d')][_0xfe2a('0x48')]({'where':{'name':_0x20a274,'userProfileId':_0x5da79f[_0xfe2a('0x4e')]},'raw':!![]})[_0xfe2a('0x24')](function(_0x2370ba){if(_0x2370ba&&_0x2370ba[_0xfe2a('0x4f')]===0x0){return db[_0xfe2a('0x50')][_0xfe2a('0x49')]({'name':_0x51b796[_0xfe2a('0x29')],'resourceId':_0x51b796['id'],'type':_0x2370ba[_0xfe2a('0x29')],'sectionId':_0x2370ba['id']},{})[_0xfe2a('0x24')](function(){return _0x5b0d9f;});}else{return _0x5b0d9f;}})[_0xfe2a('0x43')](function(_0x30b2bc){logger[_0xfe2a('0x28')](_0xfe2a('0x51'),_0x30b2bc);throw _0x30b2bc;});}return _0x5b0d9f;})[_0xfe2a('0x24')](respondWithResult(_0x2ef065,0xc9))[_0xfe2a('0x43')](handleError(_0x2ef065,null));};exports[_0xfe2a('0x23')]=function(_0x2d4728,_0x3dbb48){if(_0x2d4728[_0xfe2a('0x4a')]['id']){delete _0x2d4728[_0xfe2a('0x4a')]['id'];}return db[_0xfe2a('0x3e')]['find']({'where':{'id':_0x2d4728[_0xfe2a('0x45')]['id']}})[_0xfe2a('0x24')](handleEntityNotFound(_0x3dbb48,null))['then'](saveUpdates(_0x2d4728[_0xfe2a('0x4a')],null))[_0xfe2a('0x24')](respondWithResult(_0x3dbb48,null))[_0xfe2a('0x43')](handleError(_0x3dbb48,null));};exports[_0xfe2a('0x25')]=function(_0x4fc5a5,_0x3d87a1){return db['Disposition'][_0xfe2a('0x48')]({'where':{'id':_0x4fc5a5[_0xfe2a('0x45')]['id']}})[_0xfe2a('0x24')](handleEntityNotFound(_0x3d87a1,null))[_0xfe2a('0x24')](removeEntity(_0x3d87a1,null))[_0xfe2a('0x43')](handleError(_0x3d87a1,null));}; \ No newline at end of file +var _0x4108=['index','Disposition','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','Dispositions','error','name','send'];(function(_0x59f6cf,_0x330311){var _0x2f7e2d=function(_0x55ad35){while(--_0x55ad35){_0x59f6cf['push'](_0x59f6cf['shift']());}};_0x2f7e2d(++_0x330311);}(_0x4108,0x1d0));var _0x8410=function(_0x23e2d2,_0x269497){_0x23e2d2=_0x23e2d2-0x0;var _0x84f2fb=_0x4108[_0x23e2d2];return _0x84f2fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8410('0x0'));var zipdir=require(_0x8410('0x1'));var jsonpatch=require(_0x8410('0x2'));var rp=require(_0x8410('0x3'));var moment=require(_0x8410('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8410('0x5'));var util=require(_0x8410('0x6'));var path=require(_0x8410('0x7'));var sox=require(_0x8410('0x8'));var csv=require(_0x8410('0x9'));var ejs=require(_0x8410('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8410('0xb'));var crypto=require(_0x8410('0xc'));var jsforce=require(_0x8410('0xd'));var deskjs=require(_0x8410('0xe'));var toCsv=require(_0x8410('0x9'));var querystring=require(_0x8410('0xf'));var Papa=require(_0x8410('0x10'));var Redis=require('ioredis');var authService=require(_0x8410('0x11'));var qs=require(_0x8410('0x12'));var as=require(_0x8410('0x13'));var hardwareService=require(_0x8410('0x14'));var logger=require(_0x8410('0x15'))(_0x8410('0x16'));var utils=require(_0x8410('0x17'));var config=require(_0x8410('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8410('0x19'))['db'];function respondWithStatusCode(_0x2a3b50,_0x227ddc){_0x227ddc=_0x227ddc||0xcc;return function(_0x28a52a){if(_0x28a52a){return _0x2a3b50[_0x8410('0x1a')](_0x227ddc);}return _0x2a3b50[_0x8410('0x1b')](_0x227ddc)[_0x8410('0x1c')]();};}function respondWithResult(_0x14f098,_0x3cb039){_0x3cb039=_0x3cb039||0xc8;return function(_0x4161ac){if(_0x4161ac){return _0x14f098[_0x8410('0x1b')](_0x3cb039)[_0x8410('0x1d')](_0x4161ac);}};}function respondWithFilteredResult(_0x1a597c,_0x226e3a){return function(_0x162b3f){if(_0x162b3f){var _0x59118e=typeof _0x226e3a['offset']==='undefined'&&typeof _0x226e3a[_0x8410('0x1e')]===_0x8410('0x1f');var _0x5b9f40=_0x162b3f[_0x8410('0x20')];var _0x3ab562=_0x59118e?0x0:_0x226e3a[_0x8410('0x21')];var _0x6c5da0=_0x59118e?_0x162b3f[_0x8410('0x20')]:_0x226e3a[_0x8410('0x21')]+_0x226e3a['limit'];var _0x12489e;if(_0x6c5da0>=_0x5b9f40){_0x6c5da0=_0x5b9f40;_0x12489e=0xc8;}else{_0x12489e=0xce;}_0x1a597c[_0x8410('0x1b')](_0x12489e);return _0x1a597c[_0x8410('0x22')](_0x8410('0x23'),_0x3ab562+'-'+_0x6c5da0+'/'+_0x5b9f40)[_0x8410('0x1d')](_0x162b3f);}return null;};}function patchUpdates(_0x1f2d91){return function(_0x49d606){try{jsonpatch[_0x8410('0x24')](_0x49d606,_0x1f2d91,!![]);}catch(_0x43bc6d){return BPromise[_0x8410('0x25')](_0x43bc6d);}return _0x49d606[_0x8410('0x26')]();};}function saveUpdates(_0x1f132d,_0x20b07e){return function(_0x20c96f){if(_0x20c96f){return _0x20c96f[_0x8410('0x27')](_0x1f132d)['then'](function(_0x10ea65){return _0x10ea65;});}return null;};}function removeEntity(_0x4390a9,_0x21eb83){return function(_0x154dfd){if(_0x154dfd){return _0x154dfd[_0x8410('0x28')]()[_0x8410('0x29')](function(){var _0x1c0061=_0x154dfd['get']({'plain':!![]});var _0xb6a7bf=_0x8410('0x2a');return db['UserProfileResource'][_0x8410('0x28')]({'where':{'type':_0xb6a7bf,'resourceId':_0x1c0061['id']}})[_0x8410('0x29')](function(){return _0x154dfd;});})[_0x8410('0x29')](function(){_0x4390a9['status'](0xcc)[_0x8410('0x1c')]();});}};}function handleEntityNotFound(_0xa10fe0,_0x48171f){return function(_0x400ef3){if(!_0x400ef3){_0xa10fe0[_0x8410('0x1a')](0x194);}return _0x400ef3;};}function handleError(_0x1aeaa1,_0x529056){_0x529056=_0x529056||0x1f4;return function(_0xb4b646){logger[_0x8410('0x2b')](_0xb4b646['stack']);if(_0xb4b646[_0x8410('0x2c')]){delete _0xb4b646[_0x8410('0x2c')];}_0x1aeaa1[_0x8410('0x1b')](_0x529056)[_0x8410('0x2d')](_0xb4b646);};}exports[_0x8410('0x2e')]=function(_0x3852af,_0x33aeb4){var _0x520948={},_0x439981={},_0x2c6bf2={'count':0x0,'rows':[]};var _0x1e269f=_['map'](db[_0x8410('0x2f')]['rawAttributes'],function(_0x6a3c02){return{'name':_0x6a3c02[_0x8410('0x30')],'type':_0x6a3c02[_0x8410('0x31')][_0x8410('0x32')]};});_0x439981[_0x8410('0x33')]=_[_0x8410('0x34')](_0x1e269f,_0x8410('0x2c'));_0x439981[_0x8410('0x35')]=_[_0x8410('0x36')](_0x3852af[_0x8410('0x35')]);_0x439981['filters']=_[_0x8410('0x37')](_0x439981[_0x8410('0x33')],_0x439981[_0x8410('0x35')]);_0x520948[_0x8410('0x38')]=_['intersection'](_0x439981[_0x8410('0x33')],qs[_0x8410('0x39')](_0x3852af[_0x8410('0x35')][_0x8410('0x39')]));_0x520948['attributes']=_0x520948[_0x8410('0x38')]['length']?_0x520948[_0x8410('0x38')]:_0x439981[_0x8410('0x33')];if(!_0x3852af[_0x8410('0x35')]['hasOwnProperty']('nolimit')){_0x520948[_0x8410('0x1e')]=qs[_0x8410('0x1e')](_0x3852af[_0x8410('0x35')]['limit']);_0x520948[_0x8410('0x21')]=qs[_0x8410('0x21')](_0x3852af['query'][_0x8410('0x21')]);}_0x520948[_0x8410('0x3a')]=qs[_0x8410('0x3b')](_0x3852af[_0x8410('0x35')]['sort']);_0x520948[_0x8410('0x3c')]=qs['filters'](_[_0x8410('0x3d')](_0x3852af['query'],_0x439981[_0x8410('0x3e')]),_0x1e269f);if(_0x3852af[_0x8410('0x35')][_0x8410('0x3f')]){_0x520948['where']=_['merge'](_0x520948[_0x8410('0x3c')],{'$or':_[_0x8410('0x34')](_0x1e269f,function(_0x307586){if(_0x307586[_0x8410('0x31')]!==_0x8410('0x40')){var _0xefd3c9={};_0xefd3c9[_0x307586['name']]={'$like':'%'+_0x3852af[_0x8410('0x35')][_0x8410('0x3f')]+'%'};return _0xefd3c9;}})});}_0x520948=_[_0x8410('0x41')]({},_0x520948,_0x3852af[_0x8410('0x42')]);var _0x591eb9={'where':_0x520948['where']};return db[_0x8410('0x2f')]['count'](_0x591eb9)[_0x8410('0x29')](function(_0x26bcc6){_0x2c6bf2[_0x8410('0x20')]=_0x26bcc6;if(_0x3852af[_0x8410('0x35')][_0x8410('0x43')]){_0x520948[_0x8410('0x44')]=[{'all':!![]}];}return db[_0x8410('0x2f')][_0x8410('0x45')](_0x520948);})['then'](function(_0x3a2519){_0x2c6bf2['rows']=_0x3a2519;return _0x2c6bf2;})['then'](respondWithFilteredResult(_0x33aeb4,_0x520948))[_0x8410('0x46')](handleError(_0x33aeb4,null));};exports[_0x8410('0x47')]=function(_0x91a304,_0x50025b){var _0x2d83e2={'raw':!![],'where':{'id':_0x91a304[_0x8410('0x48')]['id']}},_0xba539c={};_0xba539c[_0x8410('0x33')]=_['keys'](db[_0x8410('0x2f')][_0x8410('0x49')]);_0xba539c[_0x8410('0x35')]=_[_0x8410('0x36')](_0x91a304['query']);_0xba539c['filters']=_[_0x8410('0x37')](_0xba539c[_0x8410('0x33')],_0xba539c['query']);_0x2d83e2[_0x8410('0x38')]=_[_0x8410('0x37')](_0xba539c[_0x8410('0x33')],qs['fields'](_0x91a304['query'][_0x8410('0x39')]));_0x2d83e2['attributes']=_0x2d83e2['attributes'][_0x8410('0x4a')]?_0x2d83e2[_0x8410('0x38')]:_0xba539c[_0x8410('0x33')];if(_0x91a304[_0x8410('0x35')][_0x8410('0x43')]){_0x2d83e2['include']=[{'all':!![]}];}_0x2d83e2=_['merge']({},_0x2d83e2,_0x91a304[_0x8410('0x42')]);return db[_0x8410('0x2f')][_0x8410('0x4b')](_0x2d83e2)[_0x8410('0x29')](handleEntityNotFound(_0x50025b,null))[_0x8410('0x29')](respondWithResult(_0x50025b,null))[_0x8410('0x46')](handleError(_0x50025b,null));};exports['create']=function(_0x44191c,_0x119049){return db[_0x8410('0x2f')]['create'](_0x44191c[_0x8410('0x4c')],{})[_0x8410('0x29')](function(_0x32177f){var _0x5d675b=_0x44191c[_0x8410('0x4d')][_0x8410('0x4e')]({'plain':!![]});if(!_0x5d675b)throw new Error(_0x8410('0x4f'));if(_0x5d675b[_0x8410('0x50')]===_0x8410('0x4d')){var _0x551afc=_0x32177f[_0x8410('0x4e')]({'plain':!![]});var _0x190576=_0x8410('0x2a');return db['UserProfileSection'][_0x8410('0x4b')]({'where':{'name':_0x190576,'userProfileId':_0x5d675b['userProfileId']},'raw':!![]})[_0x8410('0x29')](function(_0x45cd1e){if(_0x45cd1e&&_0x45cd1e[_0x8410('0x51')]===0x0){return db[_0x8410('0x52')][_0x8410('0x53')]({'name':_0x551afc['name'],'resourceId':_0x551afc['id'],'type':_0x45cd1e[_0x8410('0x2c')],'sectionId':_0x45cd1e['id']},{})[_0x8410('0x29')](function(){return _0x32177f;});}else{return _0x32177f;}})[_0x8410('0x46')](function(_0x109b5f){logger['error'](_0x8410('0x54'),_0x109b5f);throw _0x109b5f;});}return _0x32177f;})[_0x8410('0x29')](respondWithResult(_0x119049,0xc9))['catch'](handleError(_0x119049,null));};exports['update']=function(_0x4638c8,_0x1721ba){if(_0x4638c8[_0x8410('0x4c')]['id']){delete _0x4638c8[_0x8410('0x4c')]['id'];}return db['Disposition']['find']({'where':{'id':_0x4638c8[_0x8410('0x48')]['id']}})[_0x8410('0x29')](handleEntityNotFound(_0x1721ba,null))[_0x8410('0x29')](saveUpdates(_0x4638c8[_0x8410('0x4c')],null))['then'](respondWithResult(_0x1721ba,null))[_0x8410('0x46')](handleError(_0x1721ba,null));};exports[_0x8410('0x28')]=function(_0xafc10a,_0x2cda3f){return db[_0x8410('0x2f')][_0x8410('0x4b')]({'where':{'id':_0xafc10a['params']['id']}})[_0x8410('0x29')](handleEntityNotFound(_0x2cda3f,null))[_0x8410('0x29')](removeEntity(_0x2cda3f,null))[_0x8410('0x46')](handleError(_0x2cda3f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3a9eacb..8ac1ed4 100644 --- a/server/api/disposition/disposition.model.js +++ b/server/api/disposition/disposition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fec=['name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ChatWebsiteId','name_mail','name_sms','SmsAccountId'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x5fec,0xad));var _0xc5fe=function(_0x15dac3,_0x362317){_0x15dac3=_0x15dac3-0x0;var _0x49f079=_0x5fec[_0x15dac3];return _0x49f079;};'use strict';var _=require(_0xc5fe('0x0'));var util=require(_0xc5fe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc5fe('0x2'));var BPromise=require(_0xc5fe('0x3'));var rp=require(_0xc5fe('0x4'));var fs=require('fs');var path=require(_0xc5fe('0x5'));var rimraf=require(_0xc5fe('0x6'));var config=require(_0xc5fe('0x7'));var attributes=require(_0xc5fe('0x8'));module[_0xc5fe('0x9')]=function(_0x4f1cc6,_0x4a53fe){return _0x4f1cc6[_0xc5fe('0xa')](_0xc5fe('0xb'),attributes,{'tableName':_0xc5fe('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xc5fe('0xd'),'fields':[_0xc5fe('0xe'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0xc5fe('0xe'),_0xc5fe('0xf')]},{'unique':!![],'name':_0xc5fe('0x10'),'fields':[_0xc5fe('0xe'),'MailAccountId']},{'unique':!![],'name':_0xc5fe('0x11'),'fields':[_0xc5fe('0xe'),_0xc5fe('0x12')]},{'unique':!![],'name':_0xc5fe('0x13'),'fields':[_0xc5fe('0xe'),_0xc5fe('0x14')]},{'unique':!![],'name':_0xc5fe('0x15'),'fields':[_0xc5fe('0xe'),_0xc5fe('0x16')]},{'unique':!![],'name':'name_whatsapp','fields':[_0xc5fe('0xe'),_0xc5fe('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x29d3=['FaxAccountId','name_openchannel','WhatsappAccountId','util','api','moment','request-promise','path','../../config/environment','exports','define','name_voice','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax'];(function(_0x3eabef,_0x92ea3f){var _0x5a410d=function(_0x2babbc){while(--_0x2babbc){_0x3eabef['push'](_0x3eabef['shift']());}};_0x5a410d(++_0x92ea3f);}(_0x29d3,0x107));var _0x329d=function(_0x16dc79,_0x327142){_0x16dc79=_0x16dc79-0x0;var _0x2c8289=_0x29d3[_0x16dc79];return _0x2c8289;};'use strict';var _=require('lodash');var util=require(_0x329d('0x0'));var logger=require('../../config/logger')(_0x329d('0x1'));var moment=require(_0x329d('0x2'));var BPromise=require('bluebird');var rp=require(_0x329d('0x3'));var fs=require('fs');var path=require(_0x329d('0x4'));var rimraf=require('rimraf');var config=require(_0x329d('0x5'));var attributes=require('./disposition.attributes');module[_0x329d('0x6')]=function(_0x4e3486,_0x204b2b){return _0x4e3486[_0x329d('0x7')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x329d('0x8'),'fields':[_0x329d('0x9'),_0x329d('0xa')]},{'unique':!![],'name':'name_chat','fields':[_0x329d('0x9'),_0x329d('0xb')]},{'unique':!![],'name':_0x329d('0xc'),'fields':[_0x329d('0x9'),_0x329d('0xd')]},{'unique':!![],'name':_0x329d('0xe'),'fields':[_0x329d('0x9'),_0x329d('0xf')]},{'unique':!![],'name':_0x329d('0x10'),'fields':[_0x329d('0x9'),_0x329d('0x11')]},{'unique':!![],'name':_0x329d('0x12'),'fields':[_0x329d('0x9'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x329d('0x13')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index da544e2..6ad7a0e 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4c584a,_0x57526e){var _0x3616f6=function(_0x54731d){while(--_0x54731d){_0x4c584a['push'](_0x4c584a['shift']());}};_0x3616f6(++_0x57526e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2421cc,_0x2a99a8){var _0x173909=function(_0x13b085){while(--_0x13b085){_0x2421cc['push'](_0x2421cc['shift']());}};_0x173909(++_0x2a99a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 8c4c0b0..013af66 100644 --- a/server/api/disposition/index.js +++ b/server/api/disposition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fc8=['isAuthenticated','/:id','show','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get'];(function(_0x5b9ca3,_0x1b075f){var _0x2502fd=function(_0x5f36f9){while(--_0x5f36f9){_0x5b9ca3['push'](_0x5b9ca3['shift']());}};_0x2502fd(++_0x1b075f);}(_0x7fc8,0xd6));var _0x87fc=function(_0x5a91b8,_0x544afe){_0x5a91b8=_0x5a91b8-0x0;var _0x5d8a05=_0x7fc8[_0x5a91b8];return _0x5d8a05;};'use strict';var multer=require('multer');var util=require(_0x87fc('0x0'));var path=require(_0x87fc('0x1'));var timeout=require(_0x87fc('0x2'));var express=require(_0x87fc('0x3'));var router=express[_0x87fc('0x4')]();var fs_extra=require(_0x87fc('0x5'));var auth=require(_0x87fc('0x6'));var interaction=require(_0x87fc('0x7'));var config=require('../../config/environment');var controller=require(_0x87fc('0x8'));router[_0x87fc('0x9')]('/',auth[_0x87fc('0xa')](),controller['index']);router[_0x87fc('0x9')](_0x87fc('0xb'),auth[_0x87fc('0xa')](),controller[_0x87fc('0xc')]);router['post']('/',auth[_0x87fc('0xa')](),controller['create']);router['put'](_0x87fc('0xb'),auth['isAuthenticated'](),controller[_0x87fc('0xd')]);router['delete'](_0x87fc('0xb'),auth['isAuthenticated'](),controller[_0x87fc('0xe')]);module[_0x87fc('0xf')]=router; \ No newline at end of file +var _0x6519=['get','isAuthenticated','index','/:id','show','post','update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller'];(function(_0x12b859,_0x40804e){var _0x867976=function(_0x43246a){while(--_0x43246a){_0x12b859['push'](_0x12b859['shift']());}};_0x867976(++_0x40804e);}(_0x6519,0x1c9));var _0x9651=function(_0x3f6460,_0x3bdb9b){_0x3f6460=_0x3f6460-0x0;var _0x5d9ac6=_0x6519[_0x3f6460];return _0x5d9ac6;};'use strict';var multer=require('multer');var util=require(_0x9651('0x0'));var path=require('path');var timeout=require(_0x9651('0x1'));var express=require(_0x9651('0x2'));var router=express['Router']();var fs_extra=require(_0x9651('0x3'));var auth=require(_0x9651('0x4'));var interaction=require(_0x9651('0x5'));var config=require('../../config/environment');var controller=require(_0x9651('0x6'));router[_0x9651('0x7')]('/',auth[_0x9651('0x8')](),controller[_0x9651('0x9')]);router['get'](_0x9651('0xa'),auth[_0x9651('0x8')](),controller[_0x9651('0xb')]);router[_0x9651('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9651('0xa'),auth[_0x9651('0x8')](),controller[_0x9651('0xd')]);router['delete'](_0x9651('0xa'),auth[_0x9651('0x8')](),controller[_0x9651('0xe')]);module[_0x9651('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 22476b5..24a0471 100644 --- a/server/api/faxAccount/faxAccount.attributes.js +++ b/server/api/faxAccount/faxAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa480=['STRING','ENUM','yes','localstationid','2400','4800','9600','14400','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x32d225,_0x459300){var _0x22293b=function(_0x27cc1c){while(--_0x27cc1c){_0x32d225['push'](_0x32d225['shift']());}};_0x22293b(++_0x459300);}(_0xa480,0x18a));var _0x0a48=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xa480[_0x3a7a9c];return _0x59156e;};'use strict';var Sequelize=require(_0x0a48('0x0'));module[_0x0a48('0x1')]={'name':{'type':Sequelize[_0x0a48('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0a48('0x2')]},'ecm':{'type':Sequelize[_0x0a48('0x3')](_0x0a48('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x0a48('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x0a48('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x0a48('0x6'),_0x0a48('0x7'),'7200',_0x0a48('0x8'),'12000',_0x0a48('0x9')),'defaultValue':_0x0a48('0x7')},'maxrate':{'type':Sequelize[_0x0a48('0x3')](_0x0a48('0x6'),_0x0a48('0x7'),'7200',_0x0a48('0x8'),'12000',_0x0a48('0x9')),'defaultValue':_0x0a48('0x9')},'modem':{'type':Sequelize[_0x0a48('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0a48('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0a48('0x3')](_0x0a48('0xa'),'IAX',_0x0a48('0xb'),_0x0a48('0xc')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x0a48('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0a48('0xd')],'defaultValue':function(){return _0x0a48('0xe');}},'notificationSound':{'type':Sequelize[_0x0a48('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0a48('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0a48('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0a48('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0a48('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0a48('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a48('0x10')],'allowNull':!![],'defaultValue':null,'comment':_0x0a48('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x0a48('0xf')],'defaultValue':![],'comment':_0x0a48('0x12'),'set':function(_0x452c9b){if(!_0x452c9b)this['setDataValue'](_0x0a48('0x13'),null);this[_0x0a48('0x14')](_0x0a48('0x15'),_0x452c9b);}}}; \ No newline at end of file +var _0x3130=['ENUM','yes','xCALLY\x20Motion\x20Fax','4800','7200','14400','2400','9600','v17,v27,v29','INTEGER','IAX','KHOMP','SIP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x6f91b0,_0x2b25eb){var _0x4ac42f=function(_0x5cb247){while(--_0x5cb247){_0x6f91b0['push'](_0x6f91b0['shift']());}};_0x4ac42f(++_0x2b25eb);}(_0x3130,0xef));var _0x0313=function(_0x4c3c98,_0x559b0c){_0x4c3c98=_0x4c3c98-0x0;var _0x467c76=_0x3130[_0x4c3c98];return _0x467c76;};'use strict';var Sequelize=require(_0x0313('0x0'));module[_0x0313('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0313('0x2')]},'ecm':{'type':Sequelize[_0x0313('0x3')](_0x0313('0x4'),'no'),'defaultValue':_0x0313('0x4')},'headerinfo':{'type':Sequelize[_0x0313('0x2')],'defaultValue':_0x0313('0x5')},'localstationid':{'type':Sequelize[_0x0313('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x0313('0x3')]('2400',_0x0313('0x6'),_0x0313('0x7'),'9600','12000',_0x0313('0x8')),'defaultValue':_0x0313('0x6')},'maxrate':{'type':Sequelize['ENUM'](_0x0313('0x9'),_0x0313('0x6'),_0x0313('0x7'),_0x0313('0xa'),'12000',_0x0313('0x8')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x0313('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0313('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0313('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0313('0x3')]('SIP',_0x0313('0xd'),'DADHI',_0x0313('0xe')),'defaultValue':_0x0313('0xf')},'key':{'type':Sequelize[_0x0313('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0313('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0313('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0313('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0313('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0313('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0313('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0313('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0313('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0313('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x0313('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x0313('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2a522c){if(!_0x2a522c)this[_0x0313('0x13')](_0x0313('0x14'),null);this['setDataValue'](_0x0313('0x15'),_0x2a522c);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 10810b0..f0e4b77 100644 --- a/server/api/faxAccount/faxAccount.controller.js +++ b/server/api/faxAccount/faxAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9eca=['filter','merge','VIRTUAL','options','FaxAccount','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','params','destroy','describe','FaxAccountId','Disposition','findOne','nolimit','removeDispositions','CannedAnswer','removeAnswers','ids','addInteraction','omit','getInteractions','FaxInteraction','CmContact','User','Owner','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','addAccountApplications','update','createdAt','updatedAt','TrunkId','ListId','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','Send\x20Fax\x20failed','spread','out','ContactId','dataValues','Messages','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x298bda,_0x219b51){var _0x3ebe46=function(_0x5b69a8){while(--_0x5b69a8){_0x298bda['push'](_0x298bda['shift']());}};_0x3ebe46(++_0x219b51);}(_0x9eca,0x71));var _0xa9ec=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0x9eca[_0x3ef45e];return _0x69e7c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9ec('0x0'));var zipdir=require(_0xa9ec('0x1'));var jsonpatch=require(_0xa9ec('0x2'));var rp=require(_0xa9ec('0x3'));var moment=require('moment');var BPromise=require(_0xa9ec('0x4'));var Mustache=require(_0xa9ec('0x5'));var util=require('util');var path=require(_0xa9ec('0x6'));var sox=require('sox');var csv=require(_0xa9ec('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9ec('0x8'));var _=require(_0xa9ec('0x9'));var squel=require(_0xa9ec('0xa'));var crypto=require(_0xa9ec('0xb'));var jsforce=require(_0xa9ec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa9ec('0x7'));var querystring=require('querystring');var Papa=require(_0xa9ec('0xd'));var Redis=require(_0xa9ec('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa9ec('0xf'));var hardwareService=require(_0xa9ec('0x10'));var logger=require(_0xa9ec('0x11'))(_0xa9ec('0x12'));var utils=require(_0xa9ec('0x13'));var config=require(_0xa9ec('0x14'));var licenseUtil=require(_0xa9ec('0x15'));var db=require(_0xa9ec('0x16'))['db'];config['redis']=_[_0xa9ec('0x17')](config['redis'],{'host':_0xa9ec('0x18'),'port':0x18eb});var socket=require(_0xa9ec('0x19'))(new Redis(config[_0xa9ec('0x1a')]));require(_0xa9ec('0x1b'))[_0xa9ec('0x1c')](socket);var jayson=require(_0xa9ec('0x1d'));var client=jayson[_0xa9ec('0x1e')][_0xa9ec('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xa9ec('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5eb126,_0x3546d7,_0x3f59c7,_0x20272a){return new BPromise(function(_0x28bb25,_0x44dda5){var _0xfc6531=_0x20272a||client;return _0xfc6531[_0xa9ec('0x20')](_0x5eb126,_0x3f59c7)['then'](function(_0x5edeab){logger[_0xa9ec('0x21')](_0xa9ec('0x22'),_0x3546d7,'request\x20sent');logger[_0xa9ec('0x23')](_0xa9ec('0x24'),_0x3546d7,_0xa9ec('0x25'),JSON[_0xa9ec('0x26')](_0x5edeab));if(_0x5edeab[_0xa9ec('0x27')]){if(_0x5edeab['error']['code']===0x1f4){logger[_0xa9ec('0x27')](_0xa9ec('0x22'),_0x3546d7,_0x5edeab[_0xa9ec('0x27')][_0xa9ec('0x28')]);return _0x44dda5(_0x5edeab['error']['message']);}logger[_0xa9ec('0x27')](_0xa9ec('0x22'),_0x3546d7,_0x5edeab[_0xa9ec('0x27')][_0xa9ec('0x28')]);return _0x28bb25(_0x5edeab[_0xa9ec('0x27')]['message']);}else{logger[_0xa9ec('0x21')](_0xa9ec('0x22'),_0x3546d7,_0xa9ec('0x25'));_0x28bb25(_0x5edeab[_0xa9ec('0x29')][_0xa9ec('0x28')]);}})['catch'](function(_0x18027f){logger['error'](_0xa9ec('0x22'),_0x3546d7,_0x18027f);_0x44dda5(_0x18027f);});});}function respondWithStatusCode(_0x2591bf,_0x4df225){_0x4df225=_0x4df225||0xcc;return function(_0x1aa703){if(_0x1aa703){return _0x2591bf[_0xa9ec('0x2a')](_0x4df225);}return _0x2591bf[_0xa9ec('0x2b')](_0x4df225)[_0xa9ec('0x2c')]();};}function respondWithResult(_0x902f10,_0x41c430){_0x41c430=_0x41c430||0xc8;return function(_0x30fcec){if(_0x30fcec){return _0x902f10['status'](_0x41c430)['json'](_0x30fcec);}};}function respondWithFilteredResult(_0x498041,_0x3df3d){return function(_0xebd495){if(_0xebd495){var _0xa41b46=typeof _0x3df3d[_0xa9ec('0x2d')]===_0xa9ec('0x2e')&&typeof _0x3df3d[_0xa9ec('0x2f')]===_0xa9ec('0x2e');var _0x1b29eb=_0xebd495[_0xa9ec('0x30')];var _0x47afc4=_0xa41b46?0x0:_0x3df3d[_0xa9ec('0x2d')];var _0x34e0b6=_0xa41b46?_0xebd495[_0xa9ec('0x30')]:_0x3df3d[_0xa9ec('0x2d')]+_0x3df3d[_0xa9ec('0x2f')];var _0x344472;if(_0x34e0b6>=_0x1b29eb){_0x34e0b6=_0x1b29eb;_0x344472=0xc8;}else{_0x344472=0xce;}_0x498041['status'](_0x344472);return _0x498041[_0xa9ec('0x31')](_0xa9ec('0x32'),_0x47afc4+'-'+_0x34e0b6+'/'+_0x1b29eb)[_0xa9ec('0x33')](_0xebd495);}return null;};}function patchUpdates(_0x154044){return function(_0x5f11f3){try{jsonpatch[_0xa9ec('0x34')](_0x5f11f3,_0x154044,!![]);}catch(_0x46a74e){return BPromise[_0xa9ec('0x35')](_0x46a74e);}return _0x5f11f3[_0xa9ec('0x36')]();};}function saveUpdates(_0x4b09a9,_0x4e99bf){return function(_0x9314e){if(_0x9314e){return _0x9314e['update'](_0x4b09a9)[_0xa9ec('0x37')](function(_0x5ab764){return _0x5ab764;});}return null;};}function removeEntity(_0x4707ea,_0x5154c5){return function(_0x248a69){if(_0x248a69){return _0x248a69['destroy']()['then'](function(){var _0x2cb1a5=_0x248a69[_0xa9ec('0x38')]({'plain':!![]});var _0x1f3775='FaxAccounts';return db[_0xa9ec('0x39')]['destroy']({'where':{'type':_0x1f3775,'resourceId':_0x2cb1a5['id']}})['then'](function(){return _0x248a69;});})[_0xa9ec('0x37')](function(){_0x4707ea[_0xa9ec('0x2b')](0xcc)[_0xa9ec('0x2c')]();});}};}function handleEntityNotFound(_0x26bdaf,_0x38737d){return function(_0x10a05c){if(!_0x10a05c){_0x26bdaf['sendStatus'](0x194);}return _0x10a05c;};}function handleError(_0x50e150,_0x507c23){_0x507c23=_0x507c23||0x1f4;return function(_0x501f9f){logger['error'](_0x501f9f[_0xa9ec('0x3a')]);if(_0x501f9f['name']){delete _0x501f9f['name'];}_0x50e150[_0xa9ec('0x2b')](_0x507c23)[_0xa9ec('0x3b')](_0x501f9f);};}exports[_0xa9ec('0x3c')]=function(_0x35f118,_0x572299){var _0x479062={'include':[{'model':db[_0xa9ec('0x3d')],'as':_0xa9ec('0x3e')}]},_0x379e51={},_0x1d64ca={'count':0x0,'rows':[]};var _0x54588f=_['map'](db['FaxAccount'][_0xa9ec('0x3f')],function(_0x28f558){return{'name':_0x28f558[_0xa9ec('0x40')],'type':_0x28f558[_0xa9ec('0x41')][_0xa9ec('0x42')]};});_0x379e51[_0xa9ec('0x43')]=_[_0xa9ec('0x44')](_0x54588f,_0xa9ec('0x45'));_0x379e51[_0xa9ec('0x46')]=_[_0xa9ec('0x47')](_0x35f118[_0xa9ec('0x46')]);_0x379e51[_0xa9ec('0x48')]=_['intersection'](_0x379e51[_0xa9ec('0x43')],_0x379e51[_0xa9ec('0x46')]);_0x479062[_0xa9ec('0x49')]=_[_0xa9ec('0x4a')](_0x379e51[_0xa9ec('0x43')],qs[_0xa9ec('0x4b')](_0x35f118[_0xa9ec('0x46')][_0xa9ec('0x4b')]));_0x479062['attributes']=_0x479062[_0xa9ec('0x49')][_0xa9ec('0x4c')]?_0x479062[_0xa9ec('0x49')]:_0x379e51['model'];if(!_0x35f118[_0xa9ec('0x46')][_0xa9ec('0x4d')]('nolimit')){_0x479062['limit']=qs[_0xa9ec('0x2f')](_0x35f118[_0xa9ec('0x46')]['limit']);_0x479062[_0xa9ec('0x2d')]=qs['offset'](_0x35f118[_0xa9ec('0x46')]['offset']);}_0x479062[_0xa9ec('0x4e')]=qs[_0xa9ec('0x4f')](_0x35f118[_0xa9ec('0x46')][_0xa9ec('0x4f')]);_0x479062[_0xa9ec('0x50')]=qs[_0xa9ec('0x48')](_[_0xa9ec('0x51')](_0x35f118[_0xa9ec('0x46')],_0x379e51[_0xa9ec('0x48')]),_0x54588f);if(_0x35f118['query'][_0xa9ec('0x52')]){_0x479062[_0xa9ec('0x50')]=_[_0xa9ec('0x53')](_0x479062[_0xa9ec('0x50')],{'$or':_[_0xa9ec('0x44')](_0x54588f,function(_0x1f35f8){if(_0x1f35f8[_0xa9ec('0x41')]!==_0xa9ec('0x54')){var _0x1b3ca1={};_0x1b3ca1[_0x1f35f8[_0xa9ec('0x45')]]={'$like':'%'+_0x35f118[_0xa9ec('0x46')]['filter']+'%'};return _0x1b3ca1;}})});}_0x479062=_[_0xa9ec('0x53')]({},_0x479062,_0x35f118[_0xa9ec('0x55')]);var _0x4237e6={'where':_0x479062[_0xa9ec('0x50')]};return db[_0xa9ec('0x56')][_0xa9ec('0x30')](_0x4237e6)['then'](function(_0x259fa3){_0x1d64ca[_0xa9ec('0x30')]=_0x259fa3;if(_0x35f118[_0xa9ec('0x46')][_0xa9ec('0x57')]){_0x479062[_0xa9ec('0x58')]=[{'all':!![]}];}return db['FaxAccount'][_0xa9ec('0x59')](_0x479062);})['then'](function(_0x1a82ea){_0x1d64ca[_0xa9ec('0x5a')]=_0x1a82ea;return _0x1d64ca;})[_0xa9ec('0x37')](respondWithFilteredResult(_0x572299,_0x479062))[_0xa9ec('0x5b')](handleError(_0x572299,null));};exports[_0xa9ec('0x5c')]=function(_0x5a03ec,_0x4a843f){var _0x5571e2={'raw':![],'where':{'id':_0x5a03ec['params']['id']},'include':[{'model':db[_0xa9ec('0x3d')],'as':_0xa9ec('0x3e')}]},_0x5bc538={};_0x5bc538[_0xa9ec('0x43')]=_[_0xa9ec('0x47')](db['FaxAccount'][_0xa9ec('0x3f')]);_0x5bc538[_0xa9ec('0x46')]=_['keys'](_0x5a03ec[_0xa9ec('0x46')]);_0x5bc538[_0xa9ec('0x48')]=_[_0xa9ec('0x4a')](_0x5bc538[_0xa9ec('0x43')],_0x5bc538[_0xa9ec('0x46')]);_0x5571e2['attributes']=_[_0xa9ec('0x4a')](_0x5bc538[_0xa9ec('0x43')],qs[_0xa9ec('0x4b')](_0x5a03ec['query']['fields']));_0x5571e2['attributes']=_0x5571e2['attributes'][_0xa9ec('0x4c')]?_0x5571e2['attributes']:_0x5bc538[_0xa9ec('0x43')];if(_0x5a03ec[_0xa9ec('0x46')]['includeAll']){_0x5571e2[_0xa9ec('0x58')]=[{'all':!![]}];}_0x5571e2=_[_0xa9ec('0x53')]({},_0x5571e2,_0x5a03ec[_0xa9ec('0x55')]);return db['FaxAccount'][_0xa9ec('0x5d')](_0x5571e2)[_0xa9ec('0x37')](handleEntityNotFound(_0x4a843f,null))[_0xa9ec('0x37')](respondWithResult(_0x4a843f,null))['catch'](handleError(_0x4a843f,null));};exports[_0xa9ec('0x5e')]=function(_0x4c9ec0,_0x17bac2){return db['FaxAccount'][_0xa9ec('0x5e')](_0x4c9ec0[_0xa9ec('0x5f')],{})[_0xa9ec('0x37')](function(_0x3b9fc1){var _0x2dac49=_0x4c9ec0['user']['get']({'plain':!![]});if(!_0x2dac49)throw new Error(_0xa9ec('0x60'));if(_0x2dac49['role']===_0xa9ec('0x61')){var _0x207290=_0x3b9fc1['get']({'plain':!![]});var _0xdf72b0=_0xa9ec('0x62');return db[_0xa9ec('0x63')]['find']({'where':{'name':_0xdf72b0,'userProfileId':_0x2dac49[_0xa9ec('0x64')]},'raw':!![]})[_0xa9ec('0x37')](function(_0x24e40d){if(_0x24e40d&&_0x24e40d[_0xa9ec('0x65')]===0x0){return db[_0xa9ec('0x39')]['create']({'name':_0x207290[_0xa9ec('0x45')],'resourceId':_0x207290['id'],'type':_0x24e40d[_0xa9ec('0x45')],'sectionId':_0x24e40d['id']},{})[_0xa9ec('0x37')](function(){return _0x3b9fc1;});}else{return _0x3b9fc1;}})[_0xa9ec('0x5b')](function(_0x3dc71d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dc71d);throw _0x3dc71d;});}return _0x3b9fc1;})[_0xa9ec('0x37')](respondWithResult(_0x17bac2,0xc9))[_0xa9ec('0x5b')](handleError(_0x17bac2,null));};exports['update']=function(_0x369a94,_0x4cf554){if(_0x369a94[_0xa9ec('0x5f')]['id']){delete _0x369a94[_0xa9ec('0x5f')]['id'];}return db[_0xa9ec('0x56')]['find']({'where':{'id':_0x369a94[_0xa9ec('0x66')]['id']},'include':[{'model':db[_0xa9ec('0x3d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4cf554,null))[_0xa9ec('0x37')](saveUpdates(_0x369a94[_0xa9ec('0x5f')],null))[_0xa9ec('0x37')](respondWithResult(_0x4cf554,null))[_0xa9ec('0x5b')](handleError(_0x4cf554,null));};exports[_0xa9ec('0x67')]=function(_0xf485b4,_0x41999d){return db[_0xa9ec('0x56')][_0xa9ec('0x5d')]({'where':{'id':_0xf485b4[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x41999d,null))['then'](removeEntity(_0x41999d,null))[_0xa9ec('0x5b')](handleError(_0x41999d,null));};exports[_0xa9ec('0x68')]=function(_0x498a96,_0x6ab59e){return db[_0xa9ec('0x56')][_0xa9ec('0x68')]()[_0xa9ec('0x37')](respondWithResult(_0x6ab59e,null))[_0xa9ec('0x5b')](handleError(_0x6ab59e,null));};exports['addDisposition']=function(_0x3c424b,_0x228ecc,_0x1f7669){if(_0x3c424b[_0xa9ec('0x5f')]['id']){delete _0x3c424b[_0xa9ec('0x5f')]['id'];}return db[_0xa9ec('0x56')][_0xa9ec('0x5d')]({'where':{'id':_0x3c424b[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x228ecc,null))[_0xa9ec('0x37')](function(_0x570793){if(_0x570793){_0x3c424b['body'][_0xa9ec('0x69')]=_0x570793['id'];return db[_0xa9ec('0x6a')][_0xa9ec('0x5e')](_0x3c424b[_0xa9ec('0x5f')]);}})['then'](respondWithResult(_0x228ecc,null))[_0xa9ec('0x5b')](handleError(_0x228ecc,null));};exports['getDispositions']=function(_0x15a9a3,_0x58c4ff,_0x427ddd){var _0x58c658={'raw':![],'where':{}};var _0x41d9b7={};var _0x4407d1={'count':0x0,'rows':[]};return db[_0xa9ec('0x56')][_0xa9ec('0x6b')]({'where':{'id':_0x15a9a3['params']['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x58c4ff,null))['then'](function(_0x12a98e){if(_0x12a98e){_0x41d9b7[_0xa9ec('0x43')]=_[_0xa9ec('0x47')](db['Disposition'][_0xa9ec('0x3f')]);_0x41d9b7[_0xa9ec('0x46')]=_[_0xa9ec('0x47')](_0x15a9a3[_0xa9ec('0x46')]);_0x41d9b7['filters']=_[_0xa9ec('0x4a')](_0x41d9b7['model'],_0x41d9b7['query']);_0x58c658['attributes']=_[_0xa9ec('0x4a')](_0x41d9b7[_0xa9ec('0x43')],qs[_0xa9ec('0x4b')](_0x15a9a3[_0xa9ec('0x46')][_0xa9ec('0x4b')]));_0x58c658[_0xa9ec('0x49')]=_0x58c658[_0xa9ec('0x49')][_0xa9ec('0x4c')]?_0x58c658['attributes']:_0x41d9b7[_0xa9ec('0x43')];if(!_0x15a9a3[_0xa9ec('0x46')][_0xa9ec('0x4d')](_0xa9ec('0x6c'))){_0x58c658[_0xa9ec('0x2f')]=qs[_0xa9ec('0x2f')](_0x15a9a3[_0xa9ec('0x46')]['limit']);_0x58c658['offset']=qs['offset'](_0x15a9a3['query'][_0xa9ec('0x2d')]);}_0x58c658['order']=qs[_0xa9ec('0x4f')](_0x15a9a3['query'][_0xa9ec('0x4f')]);_0x58c658[_0xa9ec('0x50')]=qs[_0xa9ec('0x48')](_[_0xa9ec('0x51')](_0x15a9a3[_0xa9ec('0x46')],_0x41d9b7['filters']));_0x58c658[_0xa9ec('0x50')][_0xa9ec('0x69')]=_0x12a98e['id'];if(_0x15a9a3[_0xa9ec('0x46')][_0xa9ec('0x52')]){_0x58c658[_0xa9ec('0x50')]=_[_0xa9ec('0x53')](_0x58c658[_0xa9ec('0x50')],{'$or':_['map'](_0x58c658[_0xa9ec('0x49')],function(_0x389815){var _0x330c5b={};_0x330c5b[_0x389815]={'$like':'%'+_0x15a9a3[_0xa9ec('0x46')][_0xa9ec('0x52')]+'%'};return _0x330c5b;})});}_0x58c658=_[_0xa9ec('0x53')]({},_0x58c658,_0x15a9a3[_0xa9ec('0x55')]);return db[_0xa9ec('0x6a')][_0xa9ec('0x30')]({'where':_0x58c658[_0xa9ec('0x50')]})['then'](function(_0x3d4f25){_0x4407d1[_0xa9ec('0x30')]=_0x3d4f25;if(_0x15a9a3['query'][_0xa9ec('0x57')]){_0x58c658[_0xa9ec('0x58')]=[{'all':!![]}];}return db[_0xa9ec('0x6a')][_0xa9ec('0x59')](_0x58c658);})[_0xa9ec('0x37')](function(_0x5d478e){_0x4407d1[_0xa9ec('0x5a')]=_0x5d478e;return _0x4407d1;});}})[_0xa9ec('0x37')](respondWithFilteredResult(_0x58c4ff,_0x58c658))['catch'](handleError(_0x58c4ff,null));};exports['removeDispositions']=function(_0x425e58,_0x1409c1,_0x120e92){return db[_0xa9ec('0x56')][_0xa9ec('0x5d')]({'where':{'id':_0x425e58[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x1409c1,null))['then'](function(_0x484d16){if(_0x484d16){return _0x484d16[_0xa9ec('0x6d')](_0x425e58['query']['ids']);}})['then'](respondWithStatusCode(_0x1409c1,null))[_0xa9ec('0x5b')](handleError(_0x1409c1,null));};exports['addAnswer']=function(_0x4905d6,_0x28726a,_0x4fe58f){if(_0x4905d6[_0xa9ec('0x5f')]['id']){delete _0x4905d6['body']['id'];}return db[_0xa9ec('0x56')][_0xa9ec('0x5d')]({'where':{'id':_0x4905d6[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x28726a,null))[_0xa9ec('0x37')](function(_0x3a38f){if(_0x3a38f){_0x4905d6[_0xa9ec('0x5f')]['FaxAccountId']=_0x3a38f['id'];return db[_0xa9ec('0x6e')][_0xa9ec('0x5e')](_0x4905d6[_0xa9ec('0x5f')]);}})['then'](respondWithResult(_0x28726a,null))[_0xa9ec('0x5b')](handleError(_0x28726a,null));};exports['getAnswers']=function(_0x373d9c,_0x5a0c21,_0x4b89d7){var _0x4591a3={'raw':![],'where':{}};var _0x2bca69={};var _0xf8c5f8={'count':0x0,'rows':[]};return db[_0xa9ec('0x56')][_0xa9ec('0x6b')]({'where':{'id':_0x373d9c[_0xa9ec('0x66')]['id']}})['then'](handleEntityNotFound(_0x5a0c21,null))[_0xa9ec('0x37')](function(_0xa792c){if(_0xa792c){_0x2bca69[_0xa9ec('0x43')]=_[_0xa9ec('0x47')](db[_0xa9ec('0x6e')][_0xa9ec('0x3f')]);_0x2bca69['query']=_[_0xa9ec('0x47')](_0x373d9c['query']);_0x2bca69[_0xa9ec('0x48')]=_[_0xa9ec('0x4a')](_0x2bca69[_0xa9ec('0x43')],_0x2bca69[_0xa9ec('0x46')]);_0x4591a3[_0xa9ec('0x49')]=_[_0xa9ec('0x4a')](_0x2bca69['model'],qs['fields'](_0x373d9c[_0xa9ec('0x46')]['fields']));_0x4591a3['attributes']=_0x4591a3[_0xa9ec('0x49')][_0xa9ec('0x4c')]?_0x4591a3[_0xa9ec('0x49')]:_0x2bca69['model'];if(!_0x373d9c[_0xa9ec('0x46')][_0xa9ec('0x4d')]('nolimit')){_0x4591a3[_0xa9ec('0x2f')]=qs[_0xa9ec('0x2f')](_0x373d9c[_0xa9ec('0x46')][_0xa9ec('0x2f')]);_0x4591a3[_0xa9ec('0x2d')]=qs['offset'](_0x373d9c[_0xa9ec('0x46')][_0xa9ec('0x2d')]);}_0x4591a3[_0xa9ec('0x4e')]=qs['sort'](_0x373d9c['query'][_0xa9ec('0x4f')]);_0x4591a3[_0xa9ec('0x50')]=qs[_0xa9ec('0x48')](_[_0xa9ec('0x51')](_0x373d9c['query'],_0x2bca69[_0xa9ec('0x48')]));_0x4591a3['where'][_0xa9ec('0x69')]=_0xa792c['id'];if(_0x373d9c['query']['filter']){_0x4591a3[_0xa9ec('0x50')]=_[_0xa9ec('0x53')](_0x4591a3[_0xa9ec('0x50')],{'$or':_['map'](_0x4591a3[_0xa9ec('0x49')],function(_0x374613){var _0x1f6cb3={};_0x1f6cb3[_0x374613]={'$like':'%'+_0x373d9c[_0xa9ec('0x46')]['filter']+'%'};return _0x1f6cb3;})});}_0x4591a3=_[_0xa9ec('0x53')]({},_0x4591a3,_0x373d9c[_0xa9ec('0x55')]);return db[_0xa9ec('0x6e')][_0xa9ec('0x30')]({'where':_0x4591a3[_0xa9ec('0x50')]})[_0xa9ec('0x37')](function(_0x57e683){_0xf8c5f8['count']=_0x57e683;if(_0x373d9c[_0xa9ec('0x46')][_0xa9ec('0x57')]){_0x4591a3['include']=[{'all':!![]}];}return db[_0xa9ec('0x6e')][_0xa9ec('0x59')](_0x4591a3);})[_0xa9ec('0x37')](function(_0x22348c){_0xf8c5f8['rows']=_0x22348c;return _0xf8c5f8;});}})['then'](respondWithFilteredResult(_0x5a0c21,_0x4591a3))[_0xa9ec('0x5b')](handleError(_0x5a0c21,null));};exports[_0xa9ec('0x6f')]=function(_0x5e3678,_0x41deed,_0x172caa){return db[_0xa9ec('0x56')][_0xa9ec('0x5d')]({'where':{'id':_0x5e3678[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x41deed,null))[_0xa9ec('0x37')](function(_0x278025){if(_0x278025){return _0x278025[_0xa9ec('0x6f')](_0x5e3678['query'][_0xa9ec('0x70')]);}})['then'](respondWithStatusCode(_0x41deed,null))[_0xa9ec('0x5b')](handleError(_0x41deed,null));};exports[_0xa9ec('0x71')]=function(_0xede143,_0x161e2e,_0x20d15a){return db['FaxInteraction'][_0xa9ec('0x5d')]({'where':{'id':_0xede143[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x161e2e,null))['then'](function(_0x9c6bcd){if(_0x9c6bcd){return _0x9c6bcd[_0xa9ec('0x71')](_0xede143['body']['ids'],_[_0xa9ec('0x72')](_0xede143[_0xa9ec('0x5f')],[_0xa9ec('0x70'),'id'])||{});}})[_0xa9ec('0x37')](respondWithResult(_0x161e2e,null))['catch'](handleError(_0x161e2e,null));};exports[_0xa9ec('0x73')]=function(_0x1bef09,_0x5210f5,_0xed3f45){var _0x52baa0={'raw':![],'where':{}};var _0x481594={};var _0x5cd0b3={'count':0x0,'rows':[]};return db[_0xa9ec('0x56')][_0xa9ec('0x6b')]({'where':{'id':_0x1bef09['params']['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x5210f5,null))[_0xa9ec('0x37')](function(_0x45d6e6){if(_0x45d6e6){_0x481594[_0xa9ec('0x43')]=_[_0xa9ec('0x47')](db[_0xa9ec('0x74')]['rawAttributes']);_0x481594['query']=_[_0xa9ec('0x47')](_0x1bef09[_0xa9ec('0x46')]);_0x481594['filters']=_[_0xa9ec('0x4a')](_0x481594[_0xa9ec('0x43')],_0x481594['query']);_0x52baa0[_0xa9ec('0x49')]=_[_0xa9ec('0x4a')](_0x481594[_0xa9ec('0x43')],qs['fields'](_0x1bef09[_0xa9ec('0x46')][_0xa9ec('0x4b')]));_0x52baa0['attributes']=_0x52baa0[_0xa9ec('0x49')][_0xa9ec('0x4c')]?_0x52baa0['attributes']:_0x481594[_0xa9ec('0x43')];if(!_0x1bef09['query']['hasOwnProperty'](_0xa9ec('0x6c'))){_0x52baa0[_0xa9ec('0x2f')]=qs[_0xa9ec('0x2f')](_0x1bef09[_0xa9ec('0x46')][_0xa9ec('0x2f')]);_0x52baa0[_0xa9ec('0x2d')]=qs[_0xa9ec('0x2d')](_0x1bef09[_0xa9ec('0x46')]['offset']);}_0x52baa0[_0xa9ec('0x4e')]=qs[_0xa9ec('0x4f')](_0x1bef09['query'][_0xa9ec('0x4f')]);_0x52baa0[_0xa9ec('0x50')]=qs[_0xa9ec('0x48')](_[_0xa9ec('0x51')](_0x1bef09[_0xa9ec('0x46')],_0x481594['filters']));_0x52baa0[_0xa9ec('0x50')]['FaxAccountId']=_0x45d6e6['id'];if(_0x1bef09[_0xa9ec('0x46')][_0xa9ec('0x52')]){_0x52baa0[_0xa9ec('0x50')]=_[_0xa9ec('0x53')](_0x52baa0[_0xa9ec('0x50')],{'$or':_[_0xa9ec('0x44')](_0x52baa0[_0xa9ec('0x49')],function(_0x42bb9d){var _0x56b5f5={};_0x56b5f5[_0x42bb9d]={'$like':'%'+_0x1bef09[_0xa9ec('0x46')][_0xa9ec('0x52')]+'%'};return _0x56b5f5;})});}_0x52baa0=_['merge']({},_0x52baa0,_0x1bef09[_0xa9ec('0x55')]);return db['FaxInteraction']['count']({'where':_0x52baa0[_0xa9ec('0x50')]})[_0xa9ec('0x37')](function(_0xdecc51){_0x5cd0b3[_0xa9ec('0x30')]=_0xdecc51;if(_0x1bef09[_0xa9ec('0x46')][_0xa9ec('0x57')]){_0x52baa0[_0xa9ec('0x58')]=[{'model':db[_0xa9ec('0x75')],'as':'Contact','required':![]},{'model':db[_0xa9ec('0x76')],'as':_0xa9ec('0x77'),'attributes':[_0xa9ec('0x45'),'fullname',_0xa9ec('0x78')],'required':![]},{'model':db[_0xa9ec('0x79')],'as':_0xa9ec('0x7a'),'attributes':['id',_0xa9ec('0x45'),_0xa9ec('0x7b')],'where':_0x1bef09[_0xa9ec('0x46')][_0xa9ec('0x7c')]?{'id':_0x1bef09[_0xa9ec('0x46')][_0xa9ec('0x7c')]}:undefined,'required':_0x1bef09[_0xa9ec('0x46')][_0xa9ec('0x7c')]?!![]:![]}];}return db[_0xa9ec('0x74')]['findAll'](_0x52baa0);})[_0xa9ec('0x37')](function(_0x306e89){_0x5cd0b3[_0xa9ec('0x5a')]=_0x306e89;return _0x5cd0b3;});}})['then'](respondWithFilteredResult(_0x5210f5,_0x52baa0))[_0xa9ec('0x5b')](handleError(_0x5210f5,null));};exports[_0xa9ec('0x7d')]=function(_0xe4302e,_0x2ced78){var _0x4beea0=_0xe4302e[_0xa9ec('0x66')]['id'];var _0x28c08d=_0xe4302e['body'];var _0xe1f283=0xc8;var _0x4a51bb=null;return db['sequelize'][_0xa9ec('0x7e')]({'isolationLevel':db[_0xa9ec('0x7f')]['Transaction'][_0xa9ec('0x80')][_0xa9ec('0x81')]},function(_0x5bcc79){return db[_0xa9ec('0x56')][_0xa9ec('0x6b')]({'where':{'id':_0x4beea0},'transaction':_0x5bcc79})[_0xa9ec('0x37')](function(_0x1d211f){if(_0x1d211f){return db[_0xa9ec('0x82')]['destroy']({'where':{'FaxAccountId':_0x4beea0},'transaction':_0x5bcc79})[_0xa9ec('0x37')](function(){var _0xac3271=_[_0xa9ec('0x44')](_0x28c08d,function(_0x1008d7){_0x1008d7[_0xa9ec('0x69')]=_0x4beea0;return _0x1008d7;});return db[_0xa9ec('0x82')][_0xa9ec('0x83')](_0xac3271,{'transaction':_0x5bcc79});});}else{_0xe1f283=0x194;_0x4a51bb=[];}});})[_0xa9ec('0x37')](function(){if(_0xe1f283!==0x194){return db[_0xa9ec('0x82')][_0xa9ec('0x84')]({'where':{'FaxAccountId':_0x4beea0},'order':'priority'})[_0xa9ec('0x37')](function(_0x54a885){_0x4a51bb=_0x54a885;});}})[_0xa9ec('0x5b')](function(_0x391d98){_0xe1f283=0x1f4;logger[_0xa9ec('0x27')](_0x391d98['stack']);if(_0x391d98['name']){delete _0x391d98[_0xa9ec('0x45')];}_0x4a51bb=_0x391d98;})['finally'](function(){if(_0x4a51bb===null){_0x2ced78['sendStatus'](_0xe1f283);}else{if(_0xe1f283===0x1f4){_0x2ced78['status'](_0xe1f283)['send'](_0x4a51bb);}else{_0x2ced78[_0xa9ec('0x2b')](_0xe1f283)[_0xa9ec('0x33')](_0x4a51bb);}}});};exports['getApplications']=function(_0x113537,_0x4fe684,_0x540a8b){var _0x4c3559={};var _0x5c32b7={};var _0x5ca469;var _0x223bfc;return db[_0xa9ec('0x56')][_0xa9ec('0x6b')]({'where':{'id':_0x113537[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x4fe684,null))[_0xa9ec('0x37')](function(_0x16c9ad){if(_0x16c9ad){_0x5ca469=_0x16c9ad;_0x5c32b7[_0xa9ec('0x43')]=_['keys'](db[_0xa9ec('0x82')][_0xa9ec('0x3f')]);_0x5c32b7[_0xa9ec('0x46')]=_[_0xa9ec('0x47')](_0x113537[_0xa9ec('0x46')]);_0x5c32b7[_0xa9ec('0x48')]=_['intersection'](_0x5c32b7['model'],_0x5c32b7[_0xa9ec('0x46')]);_0x4c3559[_0xa9ec('0x49')]=_[_0xa9ec('0x4a')](_0x5c32b7[_0xa9ec('0x43')],qs[_0xa9ec('0x4b')](_0x113537['query'][_0xa9ec('0x4b')]));_0x4c3559['attributes']=_0x4c3559[_0xa9ec('0x49')][_0xa9ec('0x4c')]?_0x4c3559['attributes']:_0x5c32b7[_0xa9ec('0x43')];_0x4c3559[_0xa9ec('0x4e')]=qs[_0xa9ec('0x4f')](_0x113537[_0xa9ec('0x46')][_0xa9ec('0x4f')]);_0x4c3559[_0xa9ec('0x50')]=qs[_0xa9ec('0x48')](_[_0xa9ec('0x51')](_0x113537[_0xa9ec('0x46')],_0x5c32b7['filters']));if(_0x113537['query'][_0xa9ec('0x52')]){_0x4c3559[_0xa9ec('0x50')]=_['merge'](_0x4c3559[_0xa9ec('0x50')],{'$or':_[_0xa9ec('0x44')](_0x4c3559[_0xa9ec('0x49')],function(_0x3d83fd){var _0x2fc065={};_0x2fc065[_0x3d83fd]={'$like':'%'+_0x113537[_0xa9ec('0x46')]['filter']+'%'};return _0x2fc065;})});}_0x4c3559=_['merge']({},_0x4c3559,_0x113537[_0xa9ec('0x55')]);return _0x5ca469[_0xa9ec('0x85')](_0x4c3559);}})[_0xa9ec('0x37')](function(_0x574c7b){if(_0x574c7b){_0x223bfc=_0x574c7b['length'];if(!_0x113537[_0xa9ec('0x46')][_0xa9ec('0x4d')](_0xa9ec('0x6c'))){_0x4c3559['limit']=qs['limit'](_0x113537['query'][_0xa9ec('0x2f')]);_0x4c3559[_0xa9ec('0x2d')]=qs[_0xa9ec('0x2d')](_0x113537['query'][_0xa9ec('0x2d')]);}return _0x5ca469[_0xa9ec('0x85')](_0x4c3559);}})[_0xa9ec('0x37')](function(_0x47d8bb){if(_0x47d8bb){return _0x47d8bb?{'count':_0x223bfc,'rows':_0x47d8bb}:null;}})[_0xa9ec('0x37')](respondWithResult(_0x4fe684,null))['catch'](handleError(_0x4fe684,null));};function Extension(_0x5e65eb,_0x11f37f,_0x16b128,_0x59efa3){this[_0xa9ec('0x86')]=_0xa9ec('0x87');this[_0xa9ec('0x88')]=_0x5e65eb[_0xa9ec('0x89')];this[_0xa9ec('0x8a')]=_0x59efa3;this[_0xa9ec('0x41')]=_0xa9ec('0x8b');this[_0xa9ec('0x8c')]=_0xa9ec('0x8d');this[_0xa9ec('0x69')]=_0x5e65eb['id'];this[_0xa9ec('0x8e')]=_0x11f37f;this[_0xa9ec('0x8f')]=_0x16b128;}function createExtensionsReciveFax(_0x538581){var _0x50a188=0x1;var _0x34b8f7=[];_0x34b8f7[_0xa9ec('0x90')](new Extension(_0x538581,_0x50a188,'',_0xa9ec('0x91')));_0x50a188+=0x1;_0x34b8f7[_0xa9ec('0x90')](new Extension(_0x538581,_0x50a188,_0xa9ec('0x92'),_0xa9ec('0x93')));_0x50a188+=0x1;for(var _0x2f7754 in _0x538581){if(_0x538581[_0xa9ec('0x4d')](_0x2f7754)&&(_0x2f7754===_0xa9ec('0x94')||_0x2f7754==='localstationid'||_0x2f7754==='gateway'||_0x2f7754===_0xa9ec('0x95')||_0x2f7754==='headerinfo'||_0x2f7754===_0xa9ec('0x96')||_0x2f7754===_0xa9ec('0x97')||_0x2f7754===_0xa9ec('0x98')||_0x2f7754===_0xa9ec('0x99'))){_0x34b8f7[_0xa9ec('0x90')](new Extension(_0x538581,_0x50a188,_0xa9ec('0x9a')+_0x2f7754+')='+_0x538581[_0x2f7754],_0xa9ec('0x93')));_0x50a188+=0x1;}}_0x34b8f7[_0xa9ec('0x90')](new Extension(_0x538581,_0x50a188,'6',_0xa9ec('0x9b')));_0x50a188+=0x1;_0x34b8f7[_0xa9ec('0x90')](new Extension(_0x538581,_0x50a188,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax'));_0x50a188=0x0;return _0x34b8f7;}exports[_0xa9ec('0x9c')]=function(_0x1213f2,_0x30b0f9,_0x281646){var _0x509940;return db[_0xa9ec('0x7f')]['transaction'](function(_0x3d56a){return db[_0xa9ec('0x56')][_0xa9ec('0x5e')](_0x1213f2[_0xa9ec('0x5f')],{'transaction':_0x3d56a})[_0xa9ec('0x37')](function(_0x4233b8){_0x509940=_0x4233b8[_0xa9ec('0x38')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x509940),{'transaction':_0x3d56a});});})[_0xa9ec('0x37')](function(){return _0x509940;})[_0xa9ec('0x37')](respondWithResult(_0x30b0f9,null))[_0xa9ec('0x5b')](handleError(_0x30b0f9,null));};exports['updateAccountApplications']=function(_0x368f88,_0x420e78,_0x1fa157){var _0x3383fa;return db['sequelize'][_0xa9ec('0x7e')](function(_0x492459){return db['FaxAccount'][_0xa9ec('0x9d')](_0x368f88[_0xa9ec('0x5f')],{'where':{'id':_0x368f88[_0xa9ec('0x5f')]['id']},'transaction':_0x492459})[_0xa9ec('0x37')](function(_0x497222){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x368f88[_0xa9ec('0x5f')]['id']},'transaction':_0x492459})[_0xa9ec('0x37')](function(_0x5c0fbb){return db['VoiceExtension'][_0xa9ec('0x83')](createExtensionsReciveFax(_['omit'](_0x368f88[_0xa9ec('0x5f')],['tech',_0xa9ec('0x42'),_0xa9ec('0x9e'),_0xa9ec('0x9f'),_0xa9ec('0xa0'),_0xa9ec('0xa1')])),{'transaction':_0x492459});});});})[_0xa9ec('0x37')](function(){return db[_0xa9ec('0x56')][_0xa9ec('0xa2')](_0x368f88['body']['id']);})[_0xa9ec('0x37')](respondWithResult(_0x420e78,null))['catch'](handleError(_0x420e78,null));};exports['getMessages']=function(_0x823e92,_0xe39a3b,_0x4c1af6){var _0x5791da={'raw':!![],'where':{}};var _0x44058b={};var _0x5cc680={'count':0x0,'rows':[]};return db[_0xa9ec('0x56')][_0xa9ec('0x6b')]({'where':{'id':_0x823e92[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0xe39a3b,null))[_0xa9ec('0x37')](function(_0x2ba823){if(_0x2ba823){_0x44058b[_0xa9ec('0x43')]=_[_0xa9ec('0x47')](db['FaxMessage'][_0xa9ec('0x3f')]);_0x44058b[_0xa9ec('0x46')]=_[_0xa9ec('0x47')](_0x823e92['query']);_0x44058b['filters']=_[_0xa9ec('0x4a')](_0x44058b[_0xa9ec('0x43')],_0x44058b[_0xa9ec('0x46')]);_0x5791da[_0xa9ec('0x49')]=_['intersection'](_0x44058b[_0xa9ec('0x43')],qs['fields'](_0x823e92[_0xa9ec('0x46')][_0xa9ec('0x4b')]));_0x5791da[_0xa9ec('0x49')]=_0x5791da[_0xa9ec('0x49')][_0xa9ec('0x4c')]?_0x5791da[_0xa9ec('0x49')]:_0x44058b['model'];if(!_0x823e92['query'][_0xa9ec('0x4d')]('nolimit')){_0x5791da['limit']=qs[_0xa9ec('0x2f')](_0x823e92['query']['limit']);_0x5791da[_0xa9ec('0x2d')]=qs[_0xa9ec('0x2d')](_0x823e92[_0xa9ec('0x46')][_0xa9ec('0x2d')]);}_0x5791da[_0xa9ec('0x4e')]=qs[_0xa9ec('0x4f')](_0x823e92['query'][_0xa9ec('0x4f')]);_0x5791da['where']=qs['filters'](_[_0xa9ec('0x51')](_0x823e92[_0xa9ec('0x46')],_0x44058b[_0xa9ec('0x48')]));_0x5791da[_0xa9ec('0x50')][_0xa9ec('0x69')]=_0x2ba823['id'];if(_0x823e92['query'][_0xa9ec('0x52')]){_0x5791da['where']=_[_0xa9ec('0x53')](_0x5791da[_0xa9ec('0x50')],{'$or':_[_0xa9ec('0x44')](_0x5791da['attributes'],function(_0x3cdd99){var _0x51274c={};_0x51274c[_0x3cdd99]={'$like':'%'+_0x823e92[_0xa9ec('0x46')][_0xa9ec('0x52')]+'%'};return _0x51274c;})});}if(_0x823e92[_0xa9ec('0x46')][_0xa9ec('0xa3')]){var _0x23a9ec=_0x823e92[_0xa9ec('0x46')][_0xa9ec('0xa3')][_0xa9ec('0xa4')](',');var _0x3b1cf6={};_0x3b1cf6[_0x23a9ec[0x0]]={'$gte':moment(_0x23a9ec[0x1])[_0xa9ec('0xa5')](_0xa9ec('0xa6'))};_0x5791da[_0xa9ec('0x50')]=_[_0xa9ec('0x53')](_0x5791da['where'],_0x3b1cf6);}_0x5791da=_[_0xa9ec('0x53')]({},_0x5791da,_0x823e92[_0xa9ec('0x55')]);return db[_0xa9ec('0xa7')][_0xa9ec('0x30')]({'where':_0x5791da[_0xa9ec('0x50')]})[_0xa9ec('0x37')](function(_0x28af11){_0x5cc680[_0xa9ec('0x30')]=_0x28af11;if(_0x823e92[_0xa9ec('0x46')]['includeAll']){_0x5791da[_0xa9ec('0x58')]=[{'all':!![]}];}return db['FaxMessage'][_0xa9ec('0x59')](_0x5791da);})[_0xa9ec('0x37')](function(_0x46b726){_0x5cc680[_0xa9ec('0x5a')]=_0x46b726;return _0x5cc680;});}})['then'](respondWithFilteredResult(_0xe39a3b,_0x5791da))['catch'](handleError(_0xe39a3b,null));};exports[_0xa9ec('0x3b')]=function(_0xb9605b,_0x10ec44,_0x1f22a5){var _0xb7d013,_0x310ff1={},_0x539512;if(_0xb9605b[_0xa9ec('0x5f')]['to']){_0x539512=_0xb9605b['body']['to'][0x0];}return db[_0xa9ec('0x56')][_0xa9ec('0x5d')]({'where':{'id':_0xb9605b[_0xa9ec('0x66')]['id']},'include':[{'model':db[_0xa9ec('0xa8')],'as':'List','include':[{'model':db[_0xa9ec('0x75')],'as':_0xa9ec('0xa9'),'where':{'fax':_0x539512},'limit':0x1,'order':[[_0xa9ec('0x9f'),_0xa9ec('0xaa')]]}]}]})['then'](handleEntityNotFound(_0x10ec44,null))[_0xa9ec('0x37')](function(_0x582a60){_0xb7d013=_0x582a60;if(_0xb9605b[_0xa9ec('0x5f')][_0xa9ec('0xab')]&&_0xb9605b[_0xa9ec('0x5f')][_0xa9ec('0xab')][_0xa9ec('0x4c')]){for(var _0x25a004=0x0;_0x25a004<_0xb9605b[_0xa9ec('0x5f')]['attachments']['length'];_0x25a004+=0x1){_0xb9605b['body'][_0xa9ec('0xab')][_0x25a004]={'filename':_0xb9605b[_0xa9ec('0x5f')][_0xa9ec('0xab')][_0x25a004][_0xa9ec('0x45')],'id':_0xb9605b[_0xa9ec('0x5f')][_0xa9ec('0xab')][_0x25a004]['id'],'path':path[_0xa9ec('0xac')](config['root'],_0xa9ec('0xad'),_0xb9605b['body'][_0xa9ec('0xab')][_0x25a004][_0xa9ec('0xae')])};}}return respondWithRpcPromise(_0xa9ec('0xaf'),_0xa9ec('0xaf'),{'FaxAccountId':_[_0xa9ec('0xb0')](_0xb9605b[_0xa9ec('0x66')]['id'])?undefined:_0xb9605b[_0xa9ec('0x66')]['id'],'path':_['isNil'](_0xb9605b['body'][_0xa9ec('0xab')][0x0][_0xa9ec('0x6')])?undefined:_0xb9605b[_0xa9ec('0x5f')]['attachments'][0x0][_0xa9ec('0x6')],'fax':_[_0xa9ec('0xb0')](_0xb9605b[_0xa9ec('0x5f')]['to'][0x0])?undefined:_0xb9605b[_0xa9ec('0x5f')]['to'][0x0]},client9002);})[_0xa9ec('0x37')](function(){if(_0xb7d013){if(_[_0xa9ec('0xb0')](_0xb9605b[_0xa9ec('0x5f')][_0xa9ec('0xb1')])){_0xb9605b[_0xa9ec('0x5f')][_0xa9ec('0xb1')]=util[_0xa9ec('0xa5')](_0xa9ec('0xb2'),_0xb7d013[_0xa9ec('0x45')],_0xb7d013[_0xa9ec('0xb3')]);}if(_0xb7d013[_0xa9ec('0xb4')]){if(_0xb7d013[_0xa9ec('0xb4')][_0xa9ec('0xa9')][_0xa9ec('0x4c')]){return _0xb7d013[_0xa9ec('0xb4')][_0xa9ec('0xa9')][0x0];}else{return db[_0xa9ec('0x75')]['create'](_[_0xa9ec('0x17')](_0xb9605b[_0xa9ec('0x5f')],{'firstName':_0xb9605b[_0xa9ec('0x5f')]['to'][0x0],'phone':_0xb9605b[_0xa9ec('0x5f')]['to'][0x0],'fax':_0xb9605b[_0xa9ec('0x5f')]['to'][0x0],'ListId':_0xb7d013[_0xa9ec('0xa1')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xa9ec('0xb5'));}})[_0xa9ec('0x37')](function(_0x23d454){if(_0x23d454){return db[_0xa9ec('0x74')][_0xa9ec('0x5d')]({'where':{'ContactId':_0x23d454['id'],'closed':![],'FaxAccountId':_0xb7d013['id']}})[_0xa9ec('0x37')](function(_0x15afe1){if(_0x15afe1){return[_0x15afe1,![]];}return db[_0xa9ec('0x74')][_0xa9ec('0x5e')]({'UserId':_0xb9605b['user']['id'],'ContactId':_0x23d454['id'],'FaxAccountId':_0xb7d013['id'],'fax':_0xb9605b['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xa9ec('0x53')](_0xb9605b[_0xa9ec('0x5f')],{'read':![],'body':_0xb9605b[_0xa9ec('0x5f')][_0xa9ec('0xab')][0x0]['filename'],'FaxAccountId':_0xb7d013['id'],'UserId':_0xb9605b['user']['id'],'ContactId':_0x23d454['id'],'AttachmentId':_0xb9605b[_0xa9ec('0x5f')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xa9ec('0xa7')],'as':'Messages'}]})[_0xa9ec('0x37')](function(_0x7933a7){return[_0x7933a7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xa9ec('0xb6')](function(_0x4aee12,_0x33570f){if(_0x33570f){return _0x4aee12;}return db[_0xa9ec('0xa7')][_0xa9ec('0x5e')]({'direction':_0xa9ec('0xb7'),'read':![],'body':_0xb9605b['body'][_0xa9ec('0xab')][0x0]['filename'],'FaxAccountId':_0xb7d013['id'],'FaxInteractionId':_0x4aee12['id'],'UserId':_0xb9605b[_0xa9ec('0x61')]['id'],'ContactId':_0x4aee12[_0xa9ec('0xb8')],'AttachmentId':_0xb9605b['body'][_0xa9ec('0xab')][0x0]['id']})[_0xa9ec('0x37')](function(_0x3bfe4c){_0x4aee12['dataValues']['Messages']=[];_0x4aee12[_0xa9ec('0xb9')][_0xa9ec('0xba')][_0xa9ec('0x90')](_0x3bfe4c[_0xa9ec('0xb9')]);return _0x4aee12;});})[_0xa9ec('0x37')](function(_0x354f90){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0xb9605b['params']['id'])?undefined:_0xb9605b['params']['id'],'path':_[_0xa9ec('0xb0')](_0xb9605b[_0xa9ec('0x5f')]['attachments'][0x0][_0xa9ec('0x6')])?undefined:_0xb9605b[_0xa9ec('0x5f')]['attachments'][0x0]['path'],'fax':_[_0xa9ec('0xb0')](_0xb9605b[_0xa9ec('0x5f')]['to'][0x0])?undefined:_0xb9605b[_0xa9ec('0x5f')]['to'][0x0],'AttachmentId':_0xb9605b[_0xa9ec('0x5f')]['attachments'][0x0]['id']},client9002)[_0xa9ec('0x37')](function(_0x555363){logger[_0xa9ec('0x21')](_0xa9ec('0xbb'),_0x555363);})[_0xa9ec('0x5b')](function(_0x3c8e35){logger[_0xa9ec('0x21')](_0xa9ec('0xbb'),_0x3c8e35);});return _0x354f90;})[_0xa9ec('0x37')](respondWithResult(_0x10ec44,null))[_0xa9ec('0x5b')](handleError(_0x10ec44,null));};exports[_0xa9ec('0xbc')]=function(_0x5df08c,_0x440336,_0x8f7e9c){return db[_0xa9ec('0x56')]['find']({'where':{'id':_0x5df08c[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x440336,null))[_0xa9ec('0x37')](function(_0x157d50){if(_0x157d50){return _0x157d50[_0xa9ec('0xbc')](_0x5df08c[_0xa9ec('0x5f')][_0xa9ec('0x70')],_['omit'](_0x5df08c[_0xa9ec('0x5f')],[_0xa9ec('0x70'),'id'])||{})[_0xa9ec('0xb6')](function(_0x1845df){for(var _0x354922=0x0;_0x354922<_0x5df08c[_0xa9ec('0x5f')][_0xa9ec('0x70')][_0xa9ec('0x4c')];_0x354922+=0x1){socket[_0xa9ec('0xbd')](_0xa9ec('0xbe'),{'UserId':Number(_0x5df08c[_0xa9ec('0x5f')][_0xa9ec('0x70')][_0x354922]),'FaxAccountId':Number(_0x5df08c[_0xa9ec('0x66')]['id'])});}return _0x1845df;});}})[_0xa9ec('0x37')](respondWithResult(_0x440336,null))[_0xa9ec('0x5b')](handleError(_0x440336,null));};exports[_0xa9ec('0xbf')]=function(_0x5bbc2e,_0xcd3d24,_0x280b29){return db[_0xa9ec('0x56')][_0xa9ec('0x5d')]({'where':{'id':_0x5bbc2e[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0xcd3d24,null))['then'](function(_0x5a6845){if(_0x5a6845){return _0x5a6845[_0xa9ec('0xbf')](_0x5bbc2e[_0xa9ec('0x46')][_0xa9ec('0x70')])[_0xa9ec('0x37')](function(){if(_[_0xa9ec('0xc0')](_0x5bbc2e['query'][_0xa9ec('0x70')])){for(var _0x5c01ae=0x0;_0x5c01ae<_0x5bbc2e[_0xa9ec('0x46')]['ids']['length'];_0x5c01ae+=0x1){socket[_0xa9ec('0xbd')](_0xa9ec('0xc1'),{'UserId':Number(_0x5bbc2e[_0xa9ec('0x46')][_0xa9ec('0x70')][_0x5c01ae]),'FaxAccountId':Number(_0x5bbc2e[_0xa9ec('0x66')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x5bbc2e['query']['ids']),'FaxAccountId':Number(_0x5bbc2e['params']['id'])});}});}})[_0xa9ec('0x37')](respondWithStatusCode(_0xcd3d24,null))[_0xa9ec('0x5b')](handleError(_0xcd3d24,null));};exports[_0xa9ec('0xc2')]=function(_0x50981c,_0x202d7e,_0x459148){var _0x3990ef={};var _0x3b1e66={};var _0x5e336b;var _0x31e050;return db['FaxAccount'][_0xa9ec('0x6b')]({'where':{'id':_0x50981c[_0xa9ec('0x66')]['id']}})[_0xa9ec('0x37')](handleEntityNotFound(_0x202d7e,null))[_0xa9ec('0x37')](function(_0x1eb94e){if(_0x1eb94e){_0x5e336b=_0x1eb94e;_0x3b1e66[_0xa9ec('0x43')]=_['keys'](db[_0xa9ec('0x76')][_0xa9ec('0x3f')]);_0x3b1e66[_0xa9ec('0x46')]=_['keys'](_0x50981c[_0xa9ec('0x46')]);_0x3b1e66['filters']=_[_0xa9ec('0x4a')](_0x3b1e66['model'],_0x3b1e66[_0xa9ec('0x46')]);_0x3990ef[_0xa9ec('0x49')]=_[_0xa9ec('0x4a')](_0x3b1e66[_0xa9ec('0x43')],qs[_0xa9ec('0x4b')](_0x50981c['query'][_0xa9ec('0x4b')]));_0x3990ef[_0xa9ec('0x49')]=_0x3990ef[_0xa9ec('0x49')][_0xa9ec('0x4c')]?_0x3990ef['attributes']:_0x3b1e66[_0xa9ec('0x43')];_0x3990ef[_0xa9ec('0x4e')]=qs[_0xa9ec('0x4f')](_0x50981c['query'][_0xa9ec('0x4f')]);_0x3990ef[_0xa9ec('0x50')]=qs[_0xa9ec('0x48')](_[_0xa9ec('0x51')](_0x50981c[_0xa9ec('0x46')],_0x3b1e66[_0xa9ec('0x48')]));if(_0x50981c['query'][_0xa9ec('0x52')]){_0x3990ef[_0xa9ec('0x50')]=_[_0xa9ec('0x53')](_0x3990ef[_0xa9ec('0x50')],{'$or':_[_0xa9ec('0x44')](_0x3990ef[_0xa9ec('0x49')],function(_0x37452){var _0x5522b2={};_0x5522b2[_0x37452]={'$like':'%'+_0x50981c[_0xa9ec('0x46')]['filter']+'%'};return _0x5522b2;})});}_0x3990ef=_[_0xa9ec('0x53')]({},_0x3990ef,_0x50981c[_0xa9ec('0x55')]);return _0x5e336b[_0xa9ec('0xc2')](_0x3990ef);}})['then'](function(_0x1f77fb){if(_0x1f77fb){_0x31e050=_0x1f77fb[_0xa9ec('0x4c')];if(!_0x50981c[_0xa9ec('0x46')]['hasOwnProperty'](_0xa9ec('0x6c'))){_0x3990ef[_0xa9ec('0x2f')]=qs[_0xa9ec('0x2f')](_0x50981c['query']['limit']);_0x3990ef[_0xa9ec('0x2d')]=qs[_0xa9ec('0x2d')](_0x50981c[_0xa9ec('0x46')][_0xa9ec('0x2d')]);}return _0x5e336b[_0xa9ec('0xc2')](_0x3990ef);}})['then'](function(_0x1691f1){if(_0x1691f1){return _0x1691f1?{'count':_0x31e050,'rows':_0x1691f1}:null;}})[_0xa9ec('0x37')](respondWithResult(_0x202d7e,null))[_0xa9ec('0x5b')](handleError(_0x202d7e,null));}; \ No newline at end of file +var _0xb9a5=['userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','status','stack','name','index','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','Pause','find','create','user','UserProfileSection','autoAssociation','body','params','describe','addDisposition','FaxAccountId','getDispositions','Disposition','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','from-voip-provider','exten','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','maxrate','minrate','modem','t38timeout','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','ReceiveFax','addAccountApplications','VoiceExtension','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','out','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save'];(function(_0x162f4b,_0x31b569){var _0x57b00b=function(_0xef34c9){while(--_0xef34c9){_0x162f4b['push'](_0x162f4b['shift']());}};_0x57b00b(++_0x31b569);}(_0xb9a5,0x18e));var _0x5b9a=function(_0x1c57a5,_0x433064){_0x1c57a5=_0x1c57a5-0x0;var _0x3dadb9=_0xb9a5[_0x1c57a5];return _0x3dadb9;};'use strict';var emlformat=require(_0x5b9a('0x0'));var rimraf=require(_0x5b9a('0x1'));var zipdir=require(_0x5b9a('0x2'));var jsonpatch=require(_0x5b9a('0x3'));var rp=require(_0x5b9a('0x4'));var moment=require(_0x5b9a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5b9a('0x6'));var path=require(_0x5b9a('0x7'));var sox=require(_0x5b9a('0x8'));var csv=require(_0x5b9a('0x9'));var ejs=require(_0x5b9a('0xa'));var fs=require('fs');var fs_extra=require(_0x5b9a('0xb'));var _=require(_0x5b9a('0xc'));var squel=require(_0x5b9a('0xd'));var crypto=require('crypto');var jsforce=require(_0x5b9a('0xe'));var deskjs=require(_0x5b9a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5b9a('0x10'));var Papa=require(_0x5b9a('0x11'));var Redis=require(_0x5b9a('0x12'));var authService=require(_0x5b9a('0x13'));var qs=require(_0x5b9a('0x14'));var as=require(_0x5b9a('0x15'));var hardwareService=require(_0x5b9a('0x16'));var logger=require(_0x5b9a('0x17'))(_0x5b9a('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5b9a('0x19'));var db=require(_0x5b9a('0x1a'))['db'];config[_0x5b9a('0x1b')]=_['defaults'](config[_0x5b9a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b9a('0x1c'))(new Redis(config[_0x5b9a('0x1b')]));require(_0x5b9a('0x1d'))[_0x5b9a('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5b9a('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x5b9a('0x1f')][_0x5b9a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x21505b,_0xa8e080,_0x28fbd9,_0x3dd7a1){return new BPromise(function(_0x6fd41b,_0x45f3f5){var _0x3880e7=_0x3dd7a1||client;return _0x3880e7[_0x5b9a('0x21')](_0x21505b,_0x28fbd9)[_0x5b9a('0x22')](function(_0x186d6e){logger[_0x5b9a('0x23')](_0x5b9a('0x24'),_0xa8e080,_0x5b9a('0x25'));logger[_0x5b9a('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0xa8e080,_0x5b9a('0x25'),JSON['stringify'](_0x186d6e));if(_0x186d6e[_0x5b9a('0x27')]){if(_0x186d6e['error']['code']===0x1f4){logger[_0x5b9a('0x27')]('FaxAccount,\x20%s,\x20%s',_0xa8e080,_0x186d6e[_0x5b9a('0x27')][_0x5b9a('0x28')]);return _0x45f3f5(_0x186d6e[_0x5b9a('0x27')][_0x5b9a('0x28')]);}logger[_0x5b9a('0x27')](_0x5b9a('0x24'),_0xa8e080,_0x186d6e[_0x5b9a('0x27')]['message']);return _0x6fd41b(_0x186d6e[_0x5b9a('0x27')]['message']);}else{logger[_0x5b9a('0x23')](_0x5b9a('0x24'),_0xa8e080,_0x5b9a('0x25'));_0x6fd41b(_0x186d6e[_0x5b9a('0x29')][_0x5b9a('0x28')]);}})[_0x5b9a('0x2a')](function(_0x327522){logger[_0x5b9a('0x27')]('FaxAccount,\x20%s,\x20%s',_0xa8e080,_0x327522);_0x45f3f5(_0x327522);});});}function respondWithStatusCode(_0x17fed3,_0x199535){_0x199535=_0x199535||0xcc;return function(_0x13c594){if(_0x13c594){return _0x17fed3[_0x5b9a('0x2b')](_0x199535);}return _0x17fed3['status'](_0x199535)[_0x5b9a('0x2c')]();};}function respondWithResult(_0x1ef6e3,_0x5eaf1b){_0x5eaf1b=_0x5eaf1b||0xc8;return function(_0x5dec65){if(_0x5dec65){return _0x1ef6e3['status'](_0x5eaf1b)[_0x5b9a('0x2d')](_0x5dec65);}};}function respondWithFilteredResult(_0x54b0db,_0x2e1c4e){return function(_0x48616e){if(_0x48616e){var _0x220b69=typeof _0x2e1c4e[_0x5b9a('0x2e')]===_0x5b9a('0x2f')&&typeof _0x2e1c4e[_0x5b9a('0x30')]===_0x5b9a('0x2f');var _0x3b54dd=_0x48616e[_0x5b9a('0x31')];var _0x5d4345=_0x220b69?0x0:_0x2e1c4e[_0x5b9a('0x2e')];var _0xaf4e80=_0x220b69?_0x48616e['count']:_0x2e1c4e[_0x5b9a('0x2e')]+_0x2e1c4e[_0x5b9a('0x30')];var _0x55a8bc;if(_0xaf4e80>=_0x3b54dd){_0xaf4e80=_0x3b54dd;_0x55a8bc=0xc8;}else{_0x55a8bc=0xce;}_0x54b0db['status'](_0x55a8bc);return _0x54b0db[_0x5b9a('0x32')](_0x5b9a('0x33'),_0x5d4345+'-'+_0xaf4e80+'/'+_0x3b54dd)[_0x5b9a('0x2d')](_0x48616e);}return null;};}function patchUpdates(_0xd6a67){return function(_0x54f3f7){try{jsonpatch[_0x5b9a('0x34')](_0x54f3f7,_0xd6a67,!![]);}catch(_0x44c813){return BPromise[_0x5b9a('0x35')](_0x44c813);}return _0x54f3f7[_0x5b9a('0x36')]();};}function saveUpdates(_0x352cdd,_0x3c76bc){return function(_0x18bd98){if(_0x18bd98){return _0x18bd98[_0x5b9a('0x37')](_0x352cdd)['then'](function(_0x3f67a0){return _0x3f67a0;});}return null;};}function removeEntity(_0x3bb3b3,_0x2eacad){return function(_0x59fafc){if(_0x59fafc){return _0x59fafc[_0x5b9a('0x38')]()['then'](function(){var _0x33fe9a=_0x59fafc[_0x5b9a('0x39')]({'plain':!![]});var _0x33ffd9=_0x5b9a('0x3a');return db[_0x5b9a('0x3b')]['destroy']({'where':{'type':_0x33ffd9,'resourceId':_0x33fe9a['id']}})[_0x5b9a('0x22')](function(){return _0x59fafc;});})[_0x5b9a('0x22')](function(){_0x3bb3b3[_0x5b9a('0x3c')](0xcc)[_0x5b9a('0x2c')]();});}};}function handleEntityNotFound(_0x2ab572,_0x30e091){return function(_0xaff85a){if(!_0xaff85a){_0x2ab572[_0x5b9a('0x2b')](0x194);}return _0xaff85a;};}function handleError(_0x1a05ff,_0x29724a){_0x29724a=_0x29724a||0x1f4;return function(_0x27e042){logger[_0x5b9a('0x27')](_0x27e042[_0x5b9a('0x3d')]);if(_0x27e042['name']){delete _0x27e042[_0x5b9a('0x3e')];}_0x1a05ff[_0x5b9a('0x3c')](_0x29724a)['send'](_0x27e042);};}exports[_0x5b9a('0x3f')]=function(_0x22677d,_0x1a42d2){var _0x3d729a={'include':[{'model':db['Pause'],'as':_0x5b9a('0x40')}]},_0x2fdd6e={},_0x4353f1={'count':0x0,'rows':[]};var _0x1ab99f=_['map'](db[_0x5b9a('0x41')][_0x5b9a('0x42')],function(_0x3ac3eb){return{'name':_0x3ac3eb[_0x5b9a('0x43')],'type':_0x3ac3eb[_0x5b9a('0x44')][_0x5b9a('0x45')]};});_0x2fdd6e[_0x5b9a('0x46')]=_[_0x5b9a('0x47')](_0x1ab99f,'name');_0x2fdd6e[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x22677d[_0x5b9a('0x48')]);_0x2fdd6e['filters']=_[_0x5b9a('0x4a')](_0x2fdd6e['model'],_0x2fdd6e[_0x5b9a('0x48')]);_0x3d729a[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x2fdd6e['model'],qs[_0x5b9a('0x4c')](_0x22677d[_0x5b9a('0x48')][_0x5b9a('0x4c')]));_0x3d729a['attributes']=_0x3d729a[_0x5b9a('0x4b')][_0x5b9a('0x4d')]?_0x3d729a[_0x5b9a('0x4b')]:_0x2fdd6e[_0x5b9a('0x46')];if(!_0x22677d[_0x5b9a('0x48')][_0x5b9a('0x4e')](_0x5b9a('0x4f'))){_0x3d729a[_0x5b9a('0x30')]=qs['limit'](_0x22677d[_0x5b9a('0x48')][_0x5b9a('0x30')]);_0x3d729a['offset']=qs[_0x5b9a('0x2e')](_0x22677d[_0x5b9a('0x48')]['offset']);}_0x3d729a[_0x5b9a('0x50')]=qs[_0x5b9a('0x51')](_0x22677d[_0x5b9a('0x48')]['sort']);_0x3d729a[_0x5b9a('0x52')]=qs[_0x5b9a('0x53')](_[_0x5b9a('0x54')](_0x22677d[_0x5b9a('0x48')],_0x2fdd6e[_0x5b9a('0x53')]),_0x1ab99f);if(_0x22677d[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x3d729a[_0x5b9a('0x52')]=_[_0x5b9a('0x56')](_0x3d729a[_0x5b9a('0x52')],{'$or':_[_0x5b9a('0x47')](_0x1ab99f,function(_0x17db5c){if(_0x17db5c['type']!==_0x5b9a('0x57')){var _0x361f56={};_0x361f56[_0x17db5c['name']]={'$like':'%'+_0x22677d['query']['filter']+'%'};return _0x361f56;}})});}_0x3d729a=_[_0x5b9a('0x56')]({},_0x3d729a,_0x22677d[_0x5b9a('0x58')]);var _0x30d595={'where':_0x3d729a[_0x5b9a('0x52')]};return db[_0x5b9a('0x41')][_0x5b9a('0x31')](_0x30d595)[_0x5b9a('0x22')](function(_0x2672dd){_0x4353f1[_0x5b9a('0x31')]=_0x2672dd;if(_0x22677d[_0x5b9a('0x48')]['includeAll']){_0x3d729a[_0x5b9a('0x59')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x3d729a);})['then'](function(_0x2e416c){_0x4353f1[_0x5b9a('0x5a')]=_0x2e416c;return _0x4353f1;})[_0x5b9a('0x22')](respondWithFilteredResult(_0x1a42d2,_0x3d729a))['catch'](handleError(_0x1a42d2,null));};exports[_0x5b9a('0x5b')]=function(_0x178a72,_0x58af38){var _0x28c3b0={'raw':![],'where':{'id':_0x178a72['params']['id']},'include':[{'model':db[_0x5b9a('0x5c')],'as':_0x5b9a('0x40')}]},_0x714999={};_0x714999[_0x5b9a('0x46')]=_[_0x5b9a('0x49')](db[_0x5b9a('0x41')][_0x5b9a('0x42')]);_0x714999[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x178a72[_0x5b9a('0x48')]);_0x714999[_0x5b9a('0x53')]=_['intersection'](_0x714999[_0x5b9a('0x46')],_0x714999[_0x5b9a('0x48')]);_0x28c3b0[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x714999[_0x5b9a('0x46')],qs['fields'](_0x178a72['query']['fields']));_0x28c3b0['attributes']=_0x28c3b0[_0x5b9a('0x4b')][_0x5b9a('0x4d')]?_0x28c3b0[_0x5b9a('0x4b')]:_0x714999[_0x5b9a('0x46')];if(_0x178a72['query']['includeAll']){_0x28c3b0[_0x5b9a('0x59')]=[{'all':!![]}];}_0x28c3b0=_['merge']({},_0x28c3b0,_0x178a72[_0x5b9a('0x58')]);return db['FaxAccount'][_0x5b9a('0x5d')](_0x28c3b0)[_0x5b9a('0x22')](handleEntityNotFound(_0x58af38,null))[_0x5b9a('0x22')](respondWithResult(_0x58af38,null))[_0x5b9a('0x2a')](handleError(_0x58af38,null));};exports[_0x5b9a('0x5e')]=function(_0x27245e,_0x5500fc){return db[_0x5b9a('0x41')][_0x5b9a('0x5e')](_0x27245e['body'],{})[_0x5b9a('0x22')](function(_0x1e4e5d){var _0x1a031c=_0x27245e[_0x5b9a('0x5f')][_0x5b9a('0x39')]({'plain':!![]});if(!_0x1a031c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a031c['role']===_0x5b9a('0x5f')){var _0x5dd2bd=_0x1e4e5d[_0x5b9a('0x39')]({'plain':!![]});var _0x472088=_0x5b9a('0x3a');return db[_0x5b9a('0x60')][_0x5b9a('0x5d')]({'where':{'name':_0x472088,'userProfileId':_0x1a031c['userProfileId']},'raw':!![]})[_0x5b9a('0x22')](function(_0x34b078){if(_0x34b078&&_0x34b078[_0x5b9a('0x61')]===0x0){return db['UserProfileResource'][_0x5b9a('0x5e')]({'name':_0x5dd2bd[_0x5b9a('0x3e')],'resourceId':_0x5dd2bd['id'],'type':_0x34b078['name'],'sectionId':_0x34b078['id']},{})['then'](function(){return _0x1e4e5d;});}else{return _0x1e4e5d;}})[_0x5b9a('0x2a')](function(_0x2571bd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2571bd);throw _0x2571bd;});}return _0x1e4e5d;})['then'](respondWithResult(_0x5500fc,0xc9))[_0x5b9a('0x2a')](handleError(_0x5500fc,null));};exports['update']=function(_0x8ce41b,_0x183a60){if(_0x8ce41b[_0x5b9a('0x62')]['id']){delete _0x8ce41b[_0x5b9a('0x62')]['id'];}return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x8ce41b[_0x5b9a('0x63')]['id']},'include':[{'model':db[_0x5b9a('0x5c')],'as':'mandatoryDispositionPause'}]})[_0x5b9a('0x22')](handleEntityNotFound(_0x183a60,null))[_0x5b9a('0x22')](saveUpdates(_0x8ce41b['body'],null))['then'](respondWithResult(_0x183a60,null))['catch'](handleError(_0x183a60,null));};exports[_0x5b9a('0x38')]=function(_0x34e4db,_0x3e24c5){return db['FaxAccount'][_0x5b9a('0x5d')]({'where':{'id':_0x34e4db[_0x5b9a('0x63')]['id']}})['then'](handleEntityNotFound(_0x3e24c5,null))[_0x5b9a('0x22')](removeEntity(_0x3e24c5,null))[_0x5b9a('0x2a')](handleError(_0x3e24c5,null));};exports[_0x5b9a('0x64')]=function(_0x1bcefe,_0x3fcaa7){return db[_0x5b9a('0x41')][_0x5b9a('0x64')]()[_0x5b9a('0x22')](respondWithResult(_0x3fcaa7,null))[_0x5b9a('0x2a')](handleError(_0x3fcaa7,null));};exports[_0x5b9a('0x65')]=function(_0x833cd8,_0x5c665f,_0x113dd3){if(_0x833cd8['body']['id']){delete _0x833cd8[_0x5b9a('0x62')]['id'];}return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x833cd8[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x5c665f,null))[_0x5b9a('0x22')](function(_0x5d5f18){if(_0x5d5f18){_0x833cd8[_0x5b9a('0x62')][_0x5b9a('0x66')]=_0x5d5f18['id'];return db['Disposition'][_0x5b9a('0x5e')](_0x833cd8[_0x5b9a('0x62')]);}})[_0x5b9a('0x22')](respondWithResult(_0x5c665f,null))['catch'](handleError(_0x5c665f,null));};exports[_0x5b9a('0x67')]=function(_0x2c68c6,_0x46b2bc,_0x290583){var _0x2705a2={'raw':![],'where':{}};var _0x4503c1={};var _0x123a3d={'count':0x0,'rows':[]};return db[_0x5b9a('0x41')]['findOne']({'where':{'id':_0x2c68c6[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x46b2bc,null))['then'](function(_0x1c5097){if(_0x1c5097){_0x4503c1[_0x5b9a('0x46')]=_['keys'](db[_0x5b9a('0x68')][_0x5b9a('0x42')]);_0x4503c1[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x2c68c6['query']);_0x4503c1['filters']=_[_0x5b9a('0x4a')](_0x4503c1[_0x5b9a('0x46')],_0x4503c1[_0x5b9a('0x48')]);_0x2705a2[_0x5b9a('0x4b')]=_['intersection'](_0x4503c1[_0x5b9a('0x46')],qs[_0x5b9a('0x4c')](_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x4c')]));_0x2705a2[_0x5b9a('0x4b')]=_0x2705a2[_0x5b9a('0x4b')][_0x5b9a('0x4d')]?_0x2705a2['attributes']:_0x4503c1[_0x5b9a('0x46')];if(!_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x4e')](_0x5b9a('0x4f'))){_0x2705a2[_0x5b9a('0x30')]=qs['limit'](_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x30')]);_0x2705a2['offset']=qs[_0x5b9a('0x2e')](_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x2e')]);}_0x2705a2[_0x5b9a('0x50')]=qs[_0x5b9a('0x51')](_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x51')]);_0x2705a2[_0x5b9a('0x52')]=qs[_0x5b9a('0x53')](_[_0x5b9a('0x54')](_0x2c68c6[_0x5b9a('0x48')],_0x4503c1[_0x5b9a('0x53')]));_0x2705a2[_0x5b9a('0x52')][_0x5b9a('0x66')]=_0x1c5097['id'];if(_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x2705a2[_0x5b9a('0x52')]=_['merge'](_0x2705a2[_0x5b9a('0x52')],{'$or':_[_0x5b9a('0x47')](_0x2705a2[_0x5b9a('0x4b')],function(_0x1ec825){var _0x7608b5={};_0x7608b5[_0x1ec825]={'$like':'%'+_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x55')]+'%'};return _0x7608b5;})});}_0x2705a2=_[_0x5b9a('0x56')]({},_0x2705a2,_0x2c68c6[_0x5b9a('0x58')]);return db[_0x5b9a('0x68')][_0x5b9a('0x31')]({'where':_0x2705a2[_0x5b9a('0x52')]})[_0x5b9a('0x22')](function(_0x2e4ae6){_0x123a3d[_0x5b9a('0x31')]=_0x2e4ae6;if(_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x69')]){_0x2705a2[_0x5b9a('0x59')]=[{'all':!![]}];}return db[_0x5b9a('0x68')]['findAll'](_0x2705a2);})['then'](function(_0x5a7920){_0x123a3d[_0x5b9a('0x5a')]=_0x5a7920;return _0x123a3d;});}})['then'](respondWithFilteredResult(_0x46b2bc,_0x2705a2))[_0x5b9a('0x2a')](handleError(_0x46b2bc,null));};exports[_0x5b9a('0x6a')]=function(_0x15b1e2,_0x4bff70,_0xfe6165){return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x15b1e2['params']['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x4bff70,null))[_0x5b9a('0x22')](function(_0x558836){if(_0x558836){return _0x558836[_0x5b9a('0x6a')](_0x15b1e2[_0x5b9a('0x48')][_0x5b9a('0x6b')]);}})[_0x5b9a('0x22')](respondWithStatusCode(_0x4bff70,null))[_0x5b9a('0x2a')](handleError(_0x4bff70,null));};exports[_0x5b9a('0x6c')]=function(_0x1b8058,_0xa6424e,_0x59075c){if(_0x1b8058[_0x5b9a('0x62')]['id']){delete _0x1b8058[_0x5b9a('0x62')]['id'];}return db[_0x5b9a('0x41')]['find']({'where':{'id':_0x1b8058[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0xa6424e,null))[_0x5b9a('0x22')](function(_0x491142){if(_0x491142){_0x1b8058['body'][_0x5b9a('0x66')]=_0x491142['id'];return db[_0x5b9a('0x6d')][_0x5b9a('0x5e')](_0x1b8058[_0x5b9a('0x62')]);}})[_0x5b9a('0x22')](respondWithResult(_0xa6424e,null))[_0x5b9a('0x2a')](handleError(_0xa6424e,null));};exports[_0x5b9a('0x6e')]=function(_0x34f88d,_0x4da7c6,_0x40bcd2){var _0x46ae0f={'raw':![],'where':{}};var _0x56034c={};var _0x55292c={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5b9a('0x6f')]({'where':{'id':_0x34f88d[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x4da7c6,null))[_0x5b9a('0x22')](function(_0x551583){if(_0x551583){_0x56034c[_0x5b9a('0x46')]=_[_0x5b9a('0x49')](db[_0x5b9a('0x6d')][_0x5b9a('0x42')]);_0x56034c[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x34f88d[_0x5b9a('0x48')]);_0x56034c['filters']=_[_0x5b9a('0x4a')](_0x56034c[_0x5b9a('0x46')],_0x56034c[_0x5b9a('0x48')]);_0x46ae0f[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x56034c[_0x5b9a('0x46')],qs['fields'](_0x34f88d[_0x5b9a('0x48')][_0x5b9a('0x4c')]));_0x46ae0f['attributes']=_0x46ae0f['attributes'][_0x5b9a('0x4d')]?_0x46ae0f[_0x5b9a('0x4b')]:_0x56034c[_0x5b9a('0x46')];if(!_0x34f88d[_0x5b9a('0x48')][_0x5b9a('0x4e')](_0x5b9a('0x4f'))){_0x46ae0f[_0x5b9a('0x30')]=qs[_0x5b9a('0x30')](_0x34f88d[_0x5b9a('0x48')]['limit']);_0x46ae0f['offset']=qs['offset'](_0x34f88d['query'][_0x5b9a('0x2e')]);}_0x46ae0f[_0x5b9a('0x50')]=qs['sort'](_0x34f88d[_0x5b9a('0x48')][_0x5b9a('0x51')]);_0x46ae0f[_0x5b9a('0x52')]=qs[_0x5b9a('0x53')](_['pick'](_0x34f88d[_0x5b9a('0x48')],_0x56034c[_0x5b9a('0x53')]));_0x46ae0f[_0x5b9a('0x52')][_0x5b9a('0x66')]=_0x551583['id'];if(_0x34f88d[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x46ae0f['where']=_['merge'](_0x46ae0f[_0x5b9a('0x52')],{'$or':_['map'](_0x46ae0f['attributes'],function(_0x18159f){var _0x4b1829={};_0x4b1829[_0x18159f]={'$like':'%'+_0x34f88d['query']['filter']+'%'};return _0x4b1829;})});}_0x46ae0f=_[_0x5b9a('0x56')]({},_0x46ae0f,_0x34f88d[_0x5b9a('0x58')]);return db['CannedAnswer']['count']({'where':_0x46ae0f[_0x5b9a('0x52')]})['then'](function(_0x5e5ad0){_0x55292c[_0x5b9a('0x31')]=_0x5e5ad0;if(_0x34f88d[_0x5b9a('0x48')]['includeAll']){_0x46ae0f['include']=[{'all':!![]}];}return db[_0x5b9a('0x6d')][_0x5b9a('0x70')](_0x46ae0f);})[_0x5b9a('0x22')](function(_0xa19f02){_0x55292c[_0x5b9a('0x5a')]=_0xa19f02;return _0x55292c;});}})[_0x5b9a('0x22')](respondWithFilteredResult(_0x4da7c6,_0x46ae0f))[_0x5b9a('0x2a')](handleError(_0x4da7c6,null));};exports[_0x5b9a('0x71')]=function(_0x44ec94,_0x1bc7f5,_0x299ede){return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x44ec94['params']['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x1bc7f5,null))[_0x5b9a('0x22')](function(_0x4327ee){if(_0x4327ee){return _0x4327ee['removeAnswers'](_0x44ec94[_0x5b9a('0x48')][_0x5b9a('0x6b')]);}})[_0x5b9a('0x22')](respondWithStatusCode(_0x1bc7f5,null))[_0x5b9a('0x2a')](handleError(_0x1bc7f5,null));};exports[_0x5b9a('0x72')]=function(_0x23b6fc,_0x36b816,_0x435d5f){return db[_0x5b9a('0x73')]['find']({'where':{'id':_0x23b6fc[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x36b816,null))[_0x5b9a('0x22')](function(_0x441f34){if(_0x441f34){return _0x441f34[_0x5b9a('0x72')](_0x23b6fc['body'][_0x5b9a('0x6b')],_[_0x5b9a('0x74')](_0x23b6fc[_0x5b9a('0x62')],[_0x5b9a('0x6b'),'id'])||{});}})[_0x5b9a('0x22')](respondWithResult(_0x36b816,null))[_0x5b9a('0x2a')](handleError(_0x36b816,null));};exports[_0x5b9a('0x75')]=function(_0x227858,_0x57ea78,_0x401be2){var _0x23c47a={'raw':![],'where':{}};var _0x59df8c={};var _0x569066={'count':0x0,'rows':[]};return db[_0x5b9a('0x41')][_0x5b9a('0x6f')]({'where':{'id':_0x227858[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x57ea78,null))['then'](function(_0x416e4c){if(_0x416e4c){_0x59df8c[_0x5b9a('0x46')]=_[_0x5b9a('0x49')](db['FaxInteraction'][_0x5b9a('0x42')]);_0x59df8c[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x227858['query']);_0x59df8c[_0x5b9a('0x53')]=_[_0x5b9a('0x4a')](_0x59df8c[_0x5b9a('0x46')],_0x59df8c[_0x5b9a('0x48')]);_0x23c47a[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x59df8c['model'],qs['fields'](_0x227858[_0x5b9a('0x48')]['fields']));_0x23c47a['attributes']=_0x23c47a[_0x5b9a('0x4b')][_0x5b9a('0x4d')]?_0x23c47a[_0x5b9a('0x4b')]:_0x59df8c[_0x5b9a('0x46')];if(!_0x227858['query'][_0x5b9a('0x4e')]('nolimit')){_0x23c47a[_0x5b9a('0x30')]=qs[_0x5b9a('0x30')](_0x227858[_0x5b9a('0x48')][_0x5b9a('0x30')]);_0x23c47a[_0x5b9a('0x2e')]=qs[_0x5b9a('0x2e')](_0x227858[_0x5b9a('0x48')][_0x5b9a('0x2e')]);}_0x23c47a['order']=qs[_0x5b9a('0x51')](_0x227858['query'][_0x5b9a('0x51')]);_0x23c47a[_0x5b9a('0x52')]=qs[_0x5b9a('0x53')](_[_0x5b9a('0x54')](_0x227858['query'],_0x59df8c['filters']));_0x23c47a[_0x5b9a('0x52')][_0x5b9a('0x66')]=_0x416e4c['id'];if(_0x227858['query']['filter']){_0x23c47a['where']=_[_0x5b9a('0x56')](_0x23c47a['where'],{'$or':_['map'](_0x23c47a[_0x5b9a('0x4b')],function(_0x302e68){var _0x2a16a2={};_0x2a16a2[_0x302e68]={'$like':'%'+_0x227858[_0x5b9a('0x48')][_0x5b9a('0x55')]+'%'};return _0x2a16a2;})});}_0x23c47a=_[_0x5b9a('0x56')]({},_0x23c47a,_0x227858[_0x5b9a('0x58')]);return db[_0x5b9a('0x73')][_0x5b9a('0x31')]({'where':_0x23c47a[_0x5b9a('0x52')]})[_0x5b9a('0x22')](function(_0x197306){_0x569066[_0x5b9a('0x31')]=_0x197306;if(_0x227858['query']['includeAll']){_0x23c47a[_0x5b9a('0x59')]=[{'model':db[_0x5b9a('0x76')],'as':_0x5b9a('0x77'),'required':![]},{'model':db[_0x5b9a('0x78')],'as':_0x5b9a('0x79'),'attributes':[_0x5b9a('0x3e'),_0x5b9a('0x7a'),_0x5b9a('0x7b')],'required':![]},{'model':db[_0x5b9a('0x7c')],'as':_0x5b9a('0x7d'),'attributes':['id',_0x5b9a('0x3e'),'color'],'where':_0x227858[_0x5b9a('0x48')][_0x5b9a('0x7e')]?{'id':_0x227858[_0x5b9a('0x48')][_0x5b9a('0x7e')]}:undefined,'required':_0x227858[_0x5b9a('0x48')]['tag']?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x23c47a);})[_0x5b9a('0x22')](function(_0x391ded){_0x569066[_0x5b9a('0x5a')]=_0x391ded;return _0x569066;});}})[_0x5b9a('0x22')](respondWithFilteredResult(_0x57ea78,_0x23c47a))['catch'](handleError(_0x57ea78,null));};exports[_0x5b9a('0x7f')]=function(_0x9ebfb2,_0x46db0c){var _0x9b3bd6=_0x9ebfb2[_0x5b9a('0x63')]['id'];var _0x17ee45=_0x9ebfb2[_0x5b9a('0x62')];var _0x1349b0=0xc8;var _0x48ce00=null;return db[_0x5b9a('0x80')][_0x5b9a('0x81')]({'isolationLevel':db[_0x5b9a('0x80')][_0x5b9a('0x82')][_0x5b9a('0x83')][_0x5b9a('0x84')]},function(_0x2a3121){return db[_0x5b9a('0x41')]['findOne']({'where':{'id':_0x9b3bd6},'transaction':_0x2a3121})[_0x5b9a('0x22')](function(_0x1d6a1e){if(_0x1d6a1e){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x9b3bd6},'transaction':_0x2a3121})[_0x5b9a('0x22')](function(){var _0x3a39f4=_[_0x5b9a('0x47')](_0x17ee45,function(_0x2add1f){_0x2add1f['FaxAccountId']=_0x9b3bd6;return _0x2add1f;});return db[_0x5b9a('0x85')][_0x5b9a('0x86')](_0x3a39f4,{'transaction':_0x2a3121});});}else{_0x1349b0=0x194;_0x48ce00=[];}});})[_0x5b9a('0x22')](function(){if(_0x1349b0!==0x194){return db[_0x5b9a('0x85')][_0x5b9a('0x87')]({'where':{'FaxAccountId':_0x9b3bd6},'order':_0x5b9a('0x88')})[_0x5b9a('0x22')](function(_0xc11d6b){_0x48ce00=_0xc11d6b;});}})[_0x5b9a('0x2a')](function(_0x518c17){_0x1349b0=0x1f4;logger[_0x5b9a('0x27')](_0x518c17['stack']);if(_0x518c17[_0x5b9a('0x3e')]){delete _0x518c17['name'];}_0x48ce00=_0x518c17;})[_0x5b9a('0x89')](function(){if(_0x48ce00===null){_0x46db0c[_0x5b9a('0x2b')](_0x1349b0);}else{if(_0x1349b0===0x1f4){_0x46db0c[_0x5b9a('0x3c')](_0x1349b0)[_0x5b9a('0x8a')](_0x48ce00);}else{_0x46db0c[_0x5b9a('0x3c')](_0x1349b0)[_0x5b9a('0x2d')](_0x48ce00);}}});};exports[_0x5b9a('0x8b')]=function(_0x23e215,_0x5ed50a,_0x5100bd){var _0x4582f={};var _0x2cc791={};var _0x2b075f;var _0x413b1e;return db[_0x5b9a('0x41')][_0x5b9a('0x6f')]({'where':{'id':_0x23e215[_0x5b9a('0x63')]['id']}})['then'](handleEntityNotFound(_0x5ed50a,null))['then'](function(_0x18d4e5){if(_0x18d4e5){_0x2b075f=_0x18d4e5;_0x2cc791[_0x5b9a('0x46')]=_['keys'](db['FaxApplication'][_0x5b9a('0x42')]);_0x2cc791[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x23e215[_0x5b9a('0x48')]);_0x2cc791[_0x5b9a('0x53')]=_[_0x5b9a('0x4a')](_0x2cc791[_0x5b9a('0x46')],_0x2cc791['query']);_0x4582f[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x2cc791[_0x5b9a('0x46')],qs[_0x5b9a('0x4c')](_0x23e215[_0x5b9a('0x48')][_0x5b9a('0x4c')]));_0x4582f[_0x5b9a('0x4b')]=_0x4582f[_0x5b9a('0x4b')][_0x5b9a('0x4d')]?_0x4582f[_0x5b9a('0x4b')]:_0x2cc791[_0x5b9a('0x46')];_0x4582f['order']=qs[_0x5b9a('0x51')](_0x23e215[_0x5b9a('0x48')][_0x5b9a('0x51')]);_0x4582f[_0x5b9a('0x52')]=qs['filters'](_[_0x5b9a('0x54')](_0x23e215[_0x5b9a('0x48')],_0x2cc791[_0x5b9a('0x53')]));if(_0x23e215[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x4582f[_0x5b9a('0x52')]=_['merge'](_0x4582f[_0x5b9a('0x52')],{'$or':_['map'](_0x4582f[_0x5b9a('0x4b')],function(_0x2b3f0b){var _0x2b87f0={};_0x2b87f0[_0x2b3f0b]={'$like':'%'+_0x23e215[_0x5b9a('0x48')][_0x5b9a('0x55')]+'%'};return _0x2b87f0;})});}_0x4582f=_['merge']({},_0x4582f,_0x23e215[_0x5b9a('0x58')]);return _0x2b075f[_0x5b9a('0x8b')](_0x4582f);}})[_0x5b9a('0x22')](function(_0x33206b){if(_0x33206b){_0x413b1e=_0x33206b[_0x5b9a('0x4d')];if(!_0x23e215[_0x5b9a('0x48')]['hasOwnProperty'](_0x5b9a('0x4f'))){_0x4582f[_0x5b9a('0x30')]=qs['limit'](_0x23e215[_0x5b9a('0x48')][_0x5b9a('0x30')]);_0x4582f[_0x5b9a('0x2e')]=qs['offset'](_0x23e215['query'][_0x5b9a('0x2e')]);}return _0x2b075f[_0x5b9a('0x8b')](_0x4582f);}})[_0x5b9a('0x22')](function(_0x571319){if(_0x571319){return _0x571319?{'count':_0x413b1e,'rows':_0x571319}:null;}})[_0x5b9a('0x22')](respondWithResult(_0x5ed50a,null))[_0x5b9a('0x2a')](handleError(_0x5ed50a,null));};function Extension(_0x37a551,_0x40afc2,_0x30fdbc,_0x195481){this['context']=_0x5b9a('0x8c');this[_0x5b9a('0x8d')]=_0x37a551['localstationid'];this['app']=_0x195481;this[_0x5b9a('0x44')]=_0x5b9a('0x8e');this[_0x5b9a('0x8f')]=_0x5b9a('0x90');this[_0x5b9a('0x66')]=_0x37a551['id'];this[_0x5b9a('0x88')]=_0x40afc2;this[_0x5b9a('0x91')]=_0x30fdbc;}function createExtensionsReciveFax(_0x4aba15){var _0x1abedb=0x1;var _0x35f091=[];_0x35f091[_0x5b9a('0x92')](new Extension(_0x4aba15,_0x1abedb,'','Answer'));_0x1abedb+=0x1;_0x35f091['push'](new Extension(_0x4aba15,_0x1abedb,_0x5b9a('0x93'),_0x5b9a('0x94')));_0x1abedb+=0x1;for(var _0x388bcc in _0x4aba15){if(_0x4aba15['hasOwnProperty'](_0x388bcc)&&(_0x388bcc===_0x5b9a('0x95')||_0x388bcc===_0x5b9a('0x96')||_0x388bcc===_0x5b9a('0x97')||_0x388bcc===_0x5b9a('0x98')||_0x388bcc==='headerinfo'||_0x388bcc===_0x5b9a('0x99')||_0x388bcc===_0x5b9a('0x9a')||_0x388bcc===_0x5b9a('0x9b')||_0x388bcc===_0x5b9a('0x9c'))){_0x35f091[_0x5b9a('0x92')](new Extension(_0x4aba15,_0x1abedb,_0x5b9a('0x9d')+_0x388bcc+')='+_0x4aba15[_0x388bcc],_0x5b9a('0x94')));_0x1abedb+=0x1;}}_0x35f091[_0x5b9a('0x92')](new Extension(_0x4aba15,_0x1abedb,'6',_0x5b9a('0x9e')));_0x1abedb+=0x1;_0x35f091[_0x5b9a('0x92')](new Extension(_0x4aba15,_0x1abedb,_0x5b9a('0x9f'),_0x5b9a('0xa0')));_0x1abedb=0x0;return _0x35f091;}exports[_0x5b9a('0xa1')]=function(_0xdf9424,_0x3a518c,_0x41cf20){var _0x514451;return db['sequelize'][_0x5b9a('0x81')](function(_0x58b06f){return db[_0x5b9a('0x41')]['create'](_0xdf9424[_0x5b9a('0x62')],{'transaction':_0x58b06f})[_0x5b9a('0x22')](function(_0x4ac7c4){_0x514451=_0x4ac7c4['get']({'plain':!![]});return db[_0x5b9a('0xa2')][_0x5b9a('0x86')](createExtensionsReciveFax(_0x514451),{'transaction':_0x58b06f});});})[_0x5b9a('0x22')](function(){return _0x514451;})[_0x5b9a('0x22')](respondWithResult(_0x3a518c,null))['catch'](handleError(_0x3a518c,null));};exports['updateAccountApplications']=function(_0x2a10a1,_0x4c5828,_0x21ca8e){var _0x2a5ecc;return db[_0x5b9a('0x80')][_0x5b9a('0x81')](function(_0x23cce5){return db[_0x5b9a('0x41')]['update'](_0x2a10a1['body'],{'where':{'id':_0x2a10a1['body']['id']},'transaction':_0x23cce5})[_0x5b9a('0x22')](function(_0x10589f){return db[_0x5b9a('0xa2')][_0x5b9a('0x38')]({'where':{'FaxAccountId':_0x2a10a1[_0x5b9a('0x62')]['id']},'transaction':_0x23cce5})[_0x5b9a('0x22')](function(_0x33ce89){return db['VoiceExtension'][_0x5b9a('0x86')](createExtensionsReciveFax(_[_0x5b9a('0x74')](_0x2a10a1['body'],['tech',_0x5b9a('0x45'),'createdAt','updatedAt','TrunkId',_0x5b9a('0xa3')])),{'transaction':_0x23cce5});});});})[_0x5b9a('0x22')](function(){return db[_0x5b9a('0x41')][_0x5b9a('0xa4')](_0x2a10a1['body']['id']);})['then'](respondWithResult(_0x4c5828,null))[_0x5b9a('0x2a')](handleError(_0x4c5828,null));};exports[_0x5b9a('0xa5')]=function(_0x5b04a5,_0xfb600a,_0x25fa0b){var _0x560038={'raw':!![],'where':{}};var _0x1aba42={};var _0x1ea67a={'count':0x0,'rows':[]};return db[_0x5b9a('0x41')][_0x5b9a('0x6f')]({'where':{'id':_0x5b04a5['params']['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0xfb600a,null))[_0x5b9a('0x22')](function(_0x4ce2bc){if(_0x4ce2bc){_0x1aba42[_0x5b9a('0x46')]=_[_0x5b9a('0x49')](db[_0x5b9a('0xa6')][_0x5b9a('0x42')]);_0x1aba42['query']=_['keys'](_0x5b04a5[_0x5b9a('0x48')]);_0x1aba42['filters']=_['intersection'](_0x1aba42[_0x5b9a('0x46')],_0x1aba42[_0x5b9a('0x48')]);_0x560038[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x1aba42[_0x5b9a('0x46')],qs[_0x5b9a('0x4c')](_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x4c')]));_0x560038[_0x5b9a('0x4b')]=_0x560038['attributes'][_0x5b9a('0x4d')]?_0x560038[_0x5b9a('0x4b')]:_0x1aba42[_0x5b9a('0x46')];if(!_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x4e')](_0x5b9a('0x4f'))){_0x560038[_0x5b9a('0x30')]=qs[_0x5b9a('0x30')](_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x30')]);_0x560038['offset']=qs['offset'](_0x5b04a5[_0x5b9a('0x48')]['offset']);}_0x560038[_0x5b9a('0x50')]=qs[_0x5b9a('0x51')](_0x5b04a5[_0x5b9a('0x48')]['sort']);_0x560038['where']=qs[_0x5b9a('0x53')](_['pick'](_0x5b04a5[_0x5b9a('0x48')],_0x1aba42[_0x5b9a('0x53')]));_0x560038['where'][_0x5b9a('0x66')]=_0x4ce2bc['id'];if(_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x560038['where']=_[_0x5b9a('0x56')](_0x560038[_0x5b9a('0x52')],{'$or':_[_0x5b9a('0x47')](_0x560038[_0x5b9a('0x4b')],function(_0x5ed625){var _0x4460d8={};_0x4460d8[_0x5ed625]={'$like':'%'+_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x55')]+'%'};return _0x4460d8;})});}if(_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0xa7')]){var _0x23103f=_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0xa7')][_0x5b9a('0xa8')](',');var _0xe0f2b={};_0xe0f2b[_0x23103f[0x0]]={'$gte':moment(_0x23103f[0x1])[_0x5b9a('0xa9')](_0x5b9a('0xaa'))};_0x560038[_0x5b9a('0x52')]=_['merge'](_0x560038['where'],_0xe0f2b);}_0x560038=_['merge']({},_0x560038,_0x5b04a5[_0x5b9a('0x58')]);return db['FaxMessage'][_0x5b9a('0x31')]({'where':_0x560038[_0x5b9a('0x52')]})[_0x5b9a('0x22')](function(_0x336369){_0x1ea67a[_0x5b9a('0x31')]=_0x336369;if(_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x69')]){_0x560038[_0x5b9a('0x59')]=[{'all':!![]}];}return db[_0x5b9a('0xa6')]['findAll'](_0x560038);})['then'](function(_0x16dcf3){_0x1ea67a[_0x5b9a('0x5a')]=_0x16dcf3;return _0x1ea67a;});}})[_0x5b9a('0x22')](respondWithFilteredResult(_0xfb600a,_0x560038))[_0x5b9a('0x2a')](handleError(_0xfb600a,null));};exports[_0x5b9a('0x8a')]=function(_0xc98e92,_0x226695,_0x2a3fd3){var _0x482d6d,_0x2f8670={},_0x36531d;if(_0xc98e92['body']['to']){_0x36531d=_0xc98e92['body']['to'][0x0];}return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0xc98e92['params']['id']},'include':[{'model':db[_0x5b9a('0xab')],'as':_0x5b9a('0xac'),'include':[{'model':db[_0x5b9a('0x76')],'as':'Contacts','where':{'fax':_0x36531d},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x5b9a('0x22')](handleEntityNotFound(_0x226695,null))['then'](function(_0x24fc4b){_0x482d6d=_0x24fc4b;if(_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')]&&_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][_0x5b9a('0x4d')]){for(var _0x28565a=0x0;_0x28565a<_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][_0x5b9a('0x4d')];_0x28565a+=0x1){_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][_0x28565a]={'filename':_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][_0x28565a][_0x5b9a('0x3e')],'id':_0xc98e92['body']['attachments'][_0x28565a]['id'],'path':path['join'](config[_0x5b9a('0xae')],_0x5b9a('0xaf'),_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][_0x28565a][_0x5b9a('0xb0')])};}}return respondWithRpcPromise('CheckAfterSend',_0x5b9a('0xb1'),{'FaxAccountId':_[_0x5b9a('0xb2')](_0xc98e92['params']['id'])?undefined:_0xc98e92[_0x5b9a('0x63')]['id'],'path':_['isNil'](_0xc98e92['body']['attachments'][0x0][_0x5b9a('0x7')])?undefined:_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][0x0]['path'],'fax':_[_0x5b9a('0xb2')](_0xc98e92[_0x5b9a('0x62')]['to'][0x0])?undefined:_0xc98e92[_0x5b9a('0x62')]['to'][0x0]},client9002);})['then'](function(){if(_0x482d6d){if(_[_0x5b9a('0xb2')](_0xc98e92['body'][_0x5b9a('0xb3')])){_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xb3')]=util['format'](_0x5b9a('0xb4'),_0x482d6d[_0x5b9a('0x3e')],_0x482d6d[_0x5b9a('0xb5')]);}if(_0x482d6d[_0x5b9a('0xac')]){if(_0x482d6d[_0x5b9a('0xac')][_0x5b9a('0xb6')][_0x5b9a('0x4d')]){return _0x482d6d[_0x5b9a('0xac')][_0x5b9a('0xb6')][0x0];}else{return db[_0x5b9a('0x76')][_0x5b9a('0x5e')](_['defaults'](_0xc98e92['body'],{'firstName':_0xc98e92['body']['to'][0x0],'phone':_0xc98e92[_0x5b9a('0x62')]['to'][0x0],'fax':_0xc98e92[_0x5b9a('0x62')]['to'][0x0],'ListId':_0x482d6d[_0x5b9a('0xa3')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x5b9a('0xb7'));}})[_0x5b9a('0x22')](function(_0x30e9c0){if(_0x30e9c0){return db[_0x5b9a('0x73')][_0x5b9a('0x5d')]({'where':{'ContactId':_0x30e9c0['id'],'closed':![],'FaxAccountId':_0x482d6d['id']}})['then'](function(_0x2b93b3){if(_0x2b93b3){return[_0x2b93b3,![]];}return db[_0x5b9a('0x73')]['create']({'UserId':_0xc98e92[_0x5b9a('0x5f')]['id'],'ContactId':_0x30e9c0['id'],'FaxAccountId':_0x482d6d['id'],'fax':_0xc98e92[_0x5b9a('0x62')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x5b9a('0x56')](_0xc98e92[_0x5b9a('0x62')],{'read':![],'body':_0xc98e92[_0x5b9a('0x62')]['attachments'][0x0]['filename'],'FaxAccountId':_0x482d6d['id'],'UserId':_0xc98e92[_0x5b9a('0x5f')]['id'],'ContactId':_0x30e9c0['id'],'AttachmentId':_0xc98e92['body'][_0x5b9a('0xad')][0x0]['id']})]},{'include':[{'model':db[_0x5b9a('0xa6')],'as':_0x5b9a('0xb8')}]})[_0x5b9a('0x22')](function(_0x13c557){return[_0x13c557,!![]];});});}else{throw new Error(_0x5b9a('0xb9'));}})[_0x5b9a('0xba')](function(_0x5c2d62,_0x45d464){if(_0x45d464){return _0x5c2d62;}return db[_0x5b9a('0xa6')][_0x5b9a('0x5e')]({'direction':_0x5b9a('0xbb'),'read':![],'body':_0xc98e92['body'][_0x5b9a('0xad')][0x0][_0x5b9a('0xbc')],'FaxAccountId':_0x482d6d['id'],'FaxInteractionId':_0x5c2d62['id'],'UserId':_0xc98e92[_0x5b9a('0x5f')]['id'],'ContactId':_0x5c2d62[_0x5b9a('0xbd')],'AttachmentId':_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][0x0]['id']})[_0x5b9a('0x22')](function(_0x43ba51){_0x5c2d62['dataValues'][_0x5b9a('0xb8')]=[];_0x5c2d62['dataValues'][_0x5b9a('0xb8')][_0x5b9a('0x92')](_0x43ba51[_0x5b9a('0xbe')]);return _0x5c2d62;});})[_0x5b9a('0x22')](function(_0x205883){respondWithRpcPromise(_0x5b9a('0xbf'),_0x5b9a('0xbf'),{'FaxAccountId':_[_0x5b9a('0xb2')](_0xc98e92[_0x5b9a('0x63')]['id'])?undefined:_0xc98e92[_0x5b9a('0x63')]['id'],'path':_[_0x5b9a('0xb2')](_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][0x0][_0x5b9a('0x7')])?undefined:_0xc98e92['body'][_0x5b9a('0xad')][0x0]['path'],'fax':_['isNil'](_0xc98e92[_0x5b9a('0x62')]['to'][0x0])?undefined:_0xc98e92[_0x5b9a('0x62')]['to'][0x0],'AttachmentId':_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][0x0]['id']},client9002)['then'](function(_0x2edf71){logger[_0x5b9a('0x23')](_0x5b9a('0xc0'),_0x2edf71);})[_0x5b9a('0x2a')](function(_0x259c9f){logger[_0x5b9a('0x23')](_0x5b9a('0xc0'),_0x259c9f);});return _0x205883;})[_0x5b9a('0x22')](respondWithResult(_0x226695,null))[_0x5b9a('0x2a')](handleError(_0x226695,null));};exports[_0x5b9a('0xc1')]=function(_0x366919,_0x5e9b80,_0x3c5304){return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x366919[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x5e9b80,null))['then'](function(_0x5a4f76){if(_0x5a4f76){return _0x5a4f76['addAgents'](_0x366919[_0x5b9a('0x62')][_0x5b9a('0x6b')],_['omit'](_0x366919['body'],[_0x5b9a('0x6b'),'id'])||{})['spread'](function(_0x3ff68f){for(var _0x1e803c=0x0;_0x1e803c<_0x366919[_0x5b9a('0x62')][_0x5b9a('0x6b')]['length'];_0x1e803c+=0x1){socket[_0x5b9a('0xc2')](_0x5b9a('0xc3'),{'UserId':Number(_0x366919[_0x5b9a('0x62')]['ids'][_0x1e803c]),'FaxAccountId':Number(_0x366919[_0x5b9a('0x63')]['id'])});}return _0x3ff68f;});}})[_0x5b9a('0x22')](respondWithResult(_0x5e9b80,null))[_0x5b9a('0x2a')](handleError(_0x5e9b80,null));};exports['removeAgents']=function(_0x595b7d,_0x5d6cba,_0x4d9ec5){return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x595b7d[_0x5b9a('0x63')]['id']}})['then'](handleEntityNotFound(_0x5d6cba,null))[_0x5b9a('0x22')](function(_0x33e20b){if(_0x33e20b){return _0x33e20b['removeAgents'](_0x595b7d['query'][_0x5b9a('0x6b')])[_0x5b9a('0x22')](function(){if(_['isArray'](_0x595b7d[_0x5b9a('0x48')]['ids'])){for(var _0x5284f9=0x0;_0x5284f9<_0x595b7d[_0x5b9a('0x48')][_0x5b9a('0x6b')][_0x5b9a('0x4d')];_0x5284f9+=0x1){socket[_0x5b9a('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x595b7d[_0x5b9a('0x48')][_0x5b9a('0x6b')][_0x5284f9]),'FaxAccountId':Number(_0x595b7d['params']['id'])});}}else{socket[_0x5b9a('0xc2')](_0x5b9a('0xc4'),{'UserId':Number(_0x595b7d[_0x5b9a('0x48')][_0x5b9a('0x6b')]),'FaxAccountId':Number(_0x595b7d[_0x5b9a('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x5d6cba,null))['catch'](handleError(_0x5d6cba,null));};exports[_0x5b9a('0xc5')]=function(_0x1ee319,_0x8e827b,_0x4779bc){var _0x356f15={};var _0x3a9e23={};var _0x564ff2;var _0x410093;return db[_0x5b9a('0x41')]['findOne']({'where':{'id':_0x1ee319[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x8e827b,null))['then'](function(_0x375e98){if(_0x375e98){_0x564ff2=_0x375e98;_0x3a9e23[_0x5b9a('0x46')]=_[_0x5b9a('0x49')](db[_0x5b9a('0x78')]['rawAttributes']);_0x3a9e23[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x1ee319[_0x5b9a('0x48')]);_0x3a9e23[_0x5b9a('0x53')]=_[_0x5b9a('0x4a')](_0x3a9e23[_0x5b9a('0x46')],_0x3a9e23[_0x5b9a('0x48')]);_0x356f15[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x3a9e23[_0x5b9a('0x46')],qs[_0x5b9a('0x4c')](_0x1ee319[_0x5b9a('0x48')]['fields']));_0x356f15[_0x5b9a('0x4b')]=_0x356f15['attributes'][_0x5b9a('0x4d')]?_0x356f15[_0x5b9a('0x4b')]:_0x3a9e23[_0x5b9a('0x46')];_0x356f15[_0x5b9a('0x50')]=qs[_0x5b9a('0x51')](_0x1ee319['query'][_0x5b9a('0x51')]);_0x356f15[_0x5b9a('0x52')]=qs['filters'](_[_0x5b9a('0x54')](_0x1ee319['query'],_0x3a9e23[_0x5b9a('0x53')]));if(_0x1ee319[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x356f15['where']=_[_0x5b9a('0x56')](_0x356f15[_0x5b9a('0x52')],{'$or':_['map'](_0x356f15['attributes'],function(_0x119395){var _0x5b8b4e={};_0x5b8b4e[_0x119395]={'$like':'%'+_0x1ee319[_0x5b9a('0x48')]['filter']+'%'};return _0x5b8b4e;})});}_0x356f15=_['merge']({},_0x356f15,_0x1ee319[_0x5b9a('0x58')]);return _0x564ff2[_0x5b9a('0xc5')](_0x356f15);}})[_0x5b9a('0x22')](function(_0x1accef){if(_0x1accef){_0x410093=_0x1accef[_0x5b9a('0x4d')];if(!_0x1ee319[_0x5b9a('0x48')]['hasOwnProperty'](_0x5b9a('0x4f'))){_0x356f15['limit']=qs[_0x5b9a('0x30')](_0x1ee319['query'][_0x5b9a('0x30')]);_0x356f15[_0x5b9a('0x2e')]=qs[_0x5b9a('0x2e')](_0x1ee319['query'][_0x5b9a('0x2e')]);}return _0x564ff2[_0x5b9a('0xc5')](_0x356f15);}})[_0x5b9a('0x22')](function(_0xe9ad9c){if(_0xe9ad9c){return _0xe9ad9c?{'count':_0x410093,'rows':_0xe9ad9c}:null;}})[_0x5b9a('0x22')](respondWithResult(_0x8e827b,null))[_0x5b9a('0x2a')](handleError(_0x8e827b,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 943c178..fbf6551 100644 --- a/server/api/faxAccount/faxAccount.events.js +++ b/server/api/faxAccount/faxAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4994=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x51dfaa,_0x42bbda){var _0x5ac993=function(_0x2435f8){while(--_0x2435f8){_0x51dfaa['push'](_0x51dfaa['shift']());}};_0x5ac993(++_0x42bbda);}(_0x4994,0x122));var _0x4499=function(_0x2e43c9,_0x41a0e3){_0x2e43c9=_0x2e43c9-0x0;var _0x4089dd=_0x4994[_0x2e43c9];return _0x4089dd;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x4499('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4499('0x1')](0x0);var events={'afterCreate':_0x4499('0x2'),'afterUpdate':_0x4499('0x3'),'afterDestroy':_0x4499('0x4')};function emitEvent(_0x2ff71e){return function(_0x30fe09,_0x213b08,_0x15b49e){FaxAccountEvents['emit'](_0x2ff71e+':'+_0x30fe09['id'],_0x30fe09);FaxAccountEvents[_0x4499('0x5')](_0x2ff71e,_0x30fe09);_0x15b49e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x4499('0x6')](e,emitEvent(event));}}module[_0x4499('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0xee35=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update','remove','emit'];(function(_0x2d518d,_0x4e74a7){var _0x46da35=function(_0x31645a){while(--_0x31645a){_0x2d518d['push'](_0x2d518d['shift']());}};_0x46da35(++_0x4e74a7);}(_0xee35,0x7b));var _0x5ee3=function(_0x7cacf9,_0x6dac99){_0x7cacf9=_0x7cacf9-0x0;var _0xde6456=_0xee35[_0x7cacf9];return _0xde6456;};'use strict';var EventEmitter=require(_0x5ee3('0x0'));var FaxAccount=require(_0x5ee3('0x1'))['db'][_0x5ee3('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5ee3('0x3'),'afterUpdate':_0x5ee3('0x4'),'afterDestroy':_0x5ee3('0x5')};function emitEvent(_0x39f9fe){return function(_0x19b3b1,_0x577fa5,_0x52f994){FaxAccountEvents['emit'](_0x39f9fe+':'+_0x19b3b1['id'],_0x19b3b1);FaxAccountEvents[_0x5ee3('0x6')](_0x39f9fe,_0x19b3b1);_0x52f994(null);};}for(var e in events){if(events[_0x5ee3('0x7')](e)){var event=events[e];FaxAccount[_0x5ee3('0x8')](e,emitEvent(event));}}module[_0x5ee3('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index f745a81..f8997d7 100644 --- a/server/api/faxAccount/faxAccount.model.js +++ b/server/api/faxAccount/faxAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bfc=['FaxAccount','fax_accounts','lodash','util','api','bluebird','request-promise','path','rimraf','./faxAccount.attributes'];(function(_0x31ed74,_0x96d0de){var _0x260f84=function(_0x49e5f2){while(--_0x49e5f2){_0x31ed74['push'](_0x31ed74['shift']());}};_0x260f84(++_0x96d0de);}(_0x3bfc,0x1c4));var _0xc3bf=function(_0x2d3d18,_0x475f4c){_0x2d3d18=_0x2d3d18-0x0;var _0x202f49=_0x3bfc[_0x2d3d18];return _0x202f49;};'use strict';var _=require(_0xc3bf('0x0'));var util=require(_0xc3bf('0x1'));var logger=require('../../config/logger')(_0xc3bf('0x2'));var moment=require('moment');var BPromise=require(_0xc3bf('0x3'));var rp=require(_0xc3bf('0x4'));var fs=require('fs');var path=require(_0xc3bf('0x5'));var rimraf=require(_0xc3bf('0x6'));var config=require('../../config/environment');var attributes=require(_0xc3bf('0x7'));module['exports']=function(_0x55b54c,_0x50059c){return _0x55b54c['define'](_0xc3bf('0x8'),attributes,{'tableName':_0xc3bf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf48=['define','FaxAccount','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xbf48,0xe6));var _0x8bf4=function(_0x38f014,_0x35c5e3){_0x38f014=_0x38f014-0x0;var _0x4f141b=_0xbf48[_0x38f014];return _0x4f141b;};'use strict';var _=require(_0x8bf4('0x0'));var util=require(_0x8bf4('0x1'));var logger=require('../../config/logger')(_0x8bf4('0x2'));var moment=require(_0x8bf4('0x3'));var BPromise=require(_0x8bf4('0x4'));var rp=require(_0x8bf4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bf4('0x6'));var config=require(_0x8bf4('0x7'));var attributes=require(_0x8bf4('0x8'));module[_0x8bf4('0x9')]=function(_0xd2046e,_0x4467d0){return _0xd2046e[_0x8bf4('0xa')](_0x8bf4('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index c3101d0..dc078a1 100644 --- a/server/api/faxAccount/faxAccount.rpc.js +++ b/server/api/faxAccount/faxAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea66=['account','list','applications','orderBy','asc','length','defaults','ListId','create','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetFaxAccount','findAll','options','raw','attributes','include','map','model','NotifyFaxAccount','Sequelize','difference','keys','createdAt','updatedAt','CompanyId','body','isNil','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','FaxAccount','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0xea66,0x129));var _0x6ea6=function(_0x27d10a,_0x35ff44){_0x27d10a=_0x27d10a-0x0;var _0x63302e=_0xea66[_0x27d10a];return _0x63302e;};'use strict';var _=require(_0x6ea6('0x0'));var util=require('util');var moment=require(_0x6ea6('0x1'));var BPromise=require(_0x6ea6('0x2'));var rs=require(_0x6ea6('0x3'));var fs=require('fs');var Redis=require(_0x6ea6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ea6('0x5'));var logger=require(_0x6ea6('0x6'))('rpc');var config=require(_0x6ea6('0x7'));var jayson=require(_0x6ea6('0x8'));var client=jayson[_0x6ea6('0x9')][_0x6ea6('0xa')]({'port':0x232c});config['redis']=_['defaults'](config[_0x6ea6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ea6('0xc'))(new Redis(config[_0x6ea6('0xb')]));require('./faxAccount.socket')[_0x6ea6('0xd')](socket);function respondWithRpcPromise(_0x52cf97,_0x3193d7,_0x55f48c){return new BPromise(function(_0x3bb733,_0xeb5ccb){return client[_0x6ea6('0xe')](_0x52cf97,_0x55f48c)[_0x6ea6('0xf')](function(_0x70f902){logger['info'](_0x6ea6('0x10'),_0x3193d7,_0x6ea6('0x11'));logger[_0x6ea6('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3193d7,_0x6ea6('0x11'),JSON[_0x6ea6('0x13')](_0x70f902));if(_0x70f902[_0x6ea6('0x14')]){if(_0x70f902[_0x6ea6('0x14')][_0x6ea6('0x15')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x3193d7,_0x70f902[_0x6ea6('0x14')][_0x6ea6('0x16')]);return _0xeb5ccb(_0x70f902['error'][_0x6ea6('0x16')]);}logger[_0x6ea6('0x14')](_0x6ea6('0x10'),_0x3193d7,_0x70f902[_0x6ea6('0x14')]['message']);return _0x3bb733(_0x70f902[_0x6ea6('0x14')][_0x6ea6('0x16')]);}else{logger[_0x6ea6('0x17')](_0x6ea6('0x10'),_0x3193d7,_0x6ea6('0x11'));_0x3bb733(_0x70f902[_0x6ea6('0x18')][_0x6ea6('0x16')]);}})[_0x6ea6('0x19')](function(_0x4e4124){logger[_0x6ea6('0x14')]('FaxAccount,\x20%s,\x20%s',_0x3193d7,_0x4e4124);_0xeb5ccb(_0x4e4124);});});}exports[_0x6ea6('0x1a')]=function(_0x385037){var _0x321240=this;return new Promise(function(_0xaea258,_0x16610c){return db['FaxAccount'][_0x6ea6('0x1b')]({'raw':_0x385037[_0x6ea6('0x1c')]?_0x385037[_0x6ea6('0x1c')][_0x6ea6('0x1d')]===undefined?!![]:![]:!![],'where':_0x385037[_0x6ea6('0x1c')]?_0x385037[_0x6ea6('0x1c')]['where']||null:null,'attributes':_0x385037[_0x6ea6('0x1c')]?_0x385037['options'][_0x6ea6('0x1e')]||null:null,'limit':_0x385037[_0x6ea6('0x1c')]?_0x385037[_0x6ea6('0x1c')]['limit']||null:null,'include':_0x385037[_0x6ea6('0x1c')]?_0x385037[_0x6ea6('0x1c')][_0x6ea6('0x1f')]?_['map'](_0x385037[_0x6ea6('0x1c')][_0x6ea6('0x1f')],function(_0x1d9942){return{'model':db[_0x1d9942['model']],'as':_0x1d9942['as'],'attributes':_0x1d9942[_0x6ea6('0x1e')],'include':_0x1d9942['include']?_[_0x6ea6('0x20')](_0x1d9942[_0x6ea6('0x1f')],function(_0xd0ef1c){return{'model':db[_0xd0ef1c[_0x6ea6('0x21')]],'as':_0xd0ef1c['as'],'attributes':_0xd0ef1c[_0x6ea6('0x1e')],'include':_0xd0ef1c['include']?_[_0x6ea6('0x20')](_0xd0ef1c[_0x6ea6('0x1f')],function(_0x5ca1e4){return{'model':db[_0x5ca1e4[_0x6ea6('0x21')]],'as':_0x5ca1e4['as'],'attributes':_0x5ca1e4[_0x6ea6('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24bf17){logger[_0x6ea6('0x17')](_0x6ea6('0x1a'),_0x385037);logger[_0x6ea6('0x12')]('GetFaxAccount',_0x385037,JSON[_0x6ea6('0x13')](_0x24bf17));_0xaea258(_0x24bf17);})[_0x6ea6('0x19')](function(_0x6fc817){logger[_0x6ea6('0x14')](_0x6ea6('0x1a'),_0x6fc817[_0x6ea6('0x16')],_0x385037);_0x16610c(_0x321240[_0x6ea6('0x14')](0x1f4,_0x6fc817[_0x6ea6('0x16')]));});});};exports[_0x6ea6('0x22')]=function(_0x3af886,_0x585601,_0x3aea66){var _0x191251=this;return new Promise(function(_0x5584c0,_0x132960){var _0x23a5a9={'body':_0x3af886['body'],'channel':'fax'};var _0x30d144=[];var _0x410038=[];var _0x2cdfeb={};return db['CmContact']['describe']()['then'](function(_0xe2906c){if(!_0xe2906c){throw new db[(_0x6ea6('0x23'))]['ValidationError']('no\x20available\x20attributes');}_0x30d144=_[_0x6ea6('0x24')](_[_0x6ea6('0x25')](_0xe2906c),[_0x6ea6('0x26'),'updatedAt']);_0x410038=_[_0x6ea6('0x24')](_[_0x6ea6('0x25')](_0xe2906c),[_0x6ea6('0x26'),_0x6ea6('0x27'),_0x6ea6('0x28'),'ListId']);if(_0x3af886[_0x6ea6('0x29')]['id']){delete _0x3af886['body']['id'];}if(_[_0x6ea6('0x2a')](_0x3af886[_0x6ea6('0x29')][_0x6ea6('0x2b')])){throw new db[(_0x6ea6('0x23'))]['ValidationError'](_0x6ea6('0x2c'));}if(_[_0x6ea6('0x2a')](_0x3af886[_0x6ea6('0x29')][_0x6ea6('0x29')])||_0x3af886[_0x6ea6('0x29')][_0x6ea6('0x29')]===''){throw new db[(_0x6ea6('0x23'))][(_0x6ea6('0x2d'))](_0x6ea6('0x2e'));}if(_[_0x6ea6('0x2a')](_0x3af886['body'][_0x6ea6('0x2f')])){throw new db['Sequelize'][(_0x6ea6('0x2d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x410038);}if(!_[_0x6ea6('0x30')](_0x410038,_0x3af886[_0x6ea6('0x29')][_0x6ea6('0x2f')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x410038);}_0x2cdfeb[_0x3af886[_0x6ea6('0x29')][_0x6ea6('0x2f')]]=_0x3af886['body'][_0x6ea6('0x2b')];})[_0x6ea6('0xf')](function(){return db[_0x6ea6('0x31')][_0x6ea6('0x32')]({'where':{'id':_0x3af886['account']['id']},'include':[{'model':db[_0x6ea6('0x33')],'as':_0x6ea6('0x34'),'include':[{'model':db[_0x6ea6('0x35')],'as':_0x6ea6('0x36'),'where':_0x2cdfeb,'limit':0x1,'order':[[_0x6ea6('0x27'),_0x6ea6('0x37')]]}]},{'model':db[_0x6ea6('0x38')],'as':_0x6ea6('0x39')}]});})['then'](function(_0x194bd0){if(_0x194bd0&&_0x194bd0['List']){var _0x38f495=_0x194bd0[_0x6ea6('0x3a')]({'plain':!![]});_0x23a5a9[_0x6ea6('0x3b')]=_0x38f495;_0x23a5a9['applications']=_0x38f495['Applications'];_0x23a5a9[_0x6ea6('0x3c')]=_0x38f495[_0x6ea6('0x34')];_0x23a5a9[_0x6ea6('0x3d')]=_[_0x6ea6('0x3e')](_0x23a5a9[_0x6ea6('0x3d')],['priority'],[_0x6ea6('0x3f')]);if(_0x23a5a9[_0x6ea6('0x3b')][_0x6ea6('0x39')]){delete _0x23a5a9[_0x6ea6('0x3b')][_0x6ea6('0x39')];}if(_0x23a5a9[_0x6ea6('0x3b')][_0x6ea6('0x34')]&&_0x23a5a9[_0x6ea6('0x3b')]['List'][_0x6ea6('0x36')][_0x6ea6('0x40')]){return _0x23a5a9[_0x6ea6('0x3b')][_0x6ea6('0x34')][_0x6ea6('0x36')][0x0];}var _0x558c37=_[_0x6ea6('0x41')](_0x3af886[_0x6ea6('0x29')],{'firstName':_0x3af886[_0x6ea6('0x29')][_0x6ea6('0x2b')],'ListId':_0x38f495[_0x6ea6('0x42')]});_0x558c37[_0x3af886[_0x6ea6('0x29')]['mapKey']]=_0x3af886[_0x6ea6('0x29')][_0x6ea6('0x2b')];return db[_0x6ea6('0x35')][_0x6ea6('0x43')](_0x558c37,{'fields':_0x30d144,'raw':!![]});}})[_0x6ea6('0xf')](function(_0x3cefb3){_0x23a5a9[_0x6ea6('0x44')]=_0x3cefb3;if(_0x3cefb3){var _0x18dbdc={'ContactId':_0x3cefb3['id'],'FaxAccountId':_0x3af886[_0x6ea6('0x3b')]['id'],'fax':_0x3cefb3[_0x6ea6('0x45')]};return db['FaxInteraction'][_0x6ea6('0x32')]({'where':{'ContactId':_0x3cefb3['id'],'closed':![],'FaxAccountId':_0x3af886['account']['id']}})[_0x6ea6('0xf')](function(_0x4e2b6f){if(_0x4e2b6f){return[_0x4e2b6f,![]];}return db[_0x6ea6('0x46')]['create'](_0x18dbdc)['then'](function(_0x5d034f){return[_0x5d034f,!![]];});});}else{throw new Error(_0x6ea6('0x47'));}})[_0x6ea6('0x48')](function(_0x13ecaf,_0x7fc97f){var _0x232989=_0x13ecaf[_0x6ea6('0x3a')]({'plain':!![]});if(_0x7fc97f){if(_0x23a5a9[_0x6ea6('0x3b')][_0x6ea6('0x49')]){_0x23a5a9['applications'][_0x6ea6('0x4a')]({'id':0x0,'priority':_0x23a5a9[_0x6ea6('0x3d')][_0x6ea6('0x40')]+0x1,'app':'close','appdata':_0x6ea6('0x4b'),'interval':_0x6ea6('0x4c')});}_0x232989[_0x6ea6('0x4d')]=!![];}else{_0x232989[_0x6ea6('0x4d')]=![];}_0x23a5a9['interaction']=_0x232989;return db[_0x6ea6('0x4e')][_0x6ea6('0x43')]({'body':_0x3af886[_0x6ea6('0x29')][_0x6ea6('0x29')],'FaxAccountId':_0x3af886[_0x6ea6('0x3b')]['id'],'FaxInteractionId':_0x13ecaf['id'],'direction':'in','ContactId':_0x13ecaf[_0x6ea6('0x4f')],'AttachmentId':_0x3af886[_0x6ea6('0x29')][_0x6ea6('0x50')]});})[_0x6ea6('0xf')](function(_0x29fe76){_0x23a5a9['message']=_0x29fe76;if(_0x23a5a9['interaction']['UserId']){return db[_0x6ea6('0x51')][_0x6ea6('0x32')]({'attributes':['id',_0x6ea6('0x52')],'where':{'id':_0x23a5a9['interaction'][_0x6ea6('0x53')]}})['then'](function(_0x56b868){if(_0x56b868){_0x23a5a9[_0x6ea6('0x3d')][_0x6ea6('0x54')]({'id':0x0,'priority':0x0,'app':_0x6ea6('0x55'),'appdata':_0x56b868[_0x6ea6('0x52')]+','+(_0x23a5a9[_0x6ea6('0x3b')][_0x6ea6('0x56')]||0xa),'interval':_0x6ea6('0x4c')});}return respondWithRpcPromise(_0x6ea6('0x57'),_0x6ea6('0x58'),_0x23a5a9);});}return respondWithRpcPromise('Start',_0x6ea6('0x58'),_0x23a5a9);})['then'](function(_0x1b81ce){_0x5584c0(_0x1b81ce);})[_0x6ea6('0x19')](function(_0x4c2b15){_0x132960(_0x191251['error'](0x1f4,_0x4c2b15['message']));});});}; \ No newline at end of file +var _0xa8fc=['CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','priority','asc','length','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','name','waitForTheAssignedAgent','Start','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','attributes','include','model','map','NotifyFaxAccount','fax','CmContact','Sequelize','difference','createdAt','updatedAt','keys','CompanyId','ListId','body','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','FaxAccount','find','account'];(function(_0x164193,_0x41bb4d){var _0x2d4e30=function(_0x3e5153){while(--_0x3e5153){_0x164193['push'](_0x164193['shift']());}};_0x2d4e30(++_0x41bb4d);}(_0xa8fc,0xca));var _0xca8f=function(_0x580831,_0x2e293d){_0x580831=_0x580831-0x0;var _0x14c21a=_0xa8fc[_0x580831];return _0x14c21a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca8f('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca8f('0x1'))['db'];var utils=require(_0xca8f('0x2'));var logger=require(_0xca8f('0x3'))(_0xca8f('0x4'));var config=require(_0xca8f('0x5'));var jayson=require(_0xca8f('0x6'));var client=jayson[_0xca8f('0x7')]['http']({'port':0x232c});config[_0xca8f('0x8')]=_[_0xca8f('0x9')](config[_0xca8f('0x8')],{'host':_0xca8f('0xa'),'port':0x18eb});var socket=require(_0xca8f('0xb'))(new Redis(config[_0xca8f('0x8')]));require('./faxAccount.socket')[_0xca8f('0xc')](socket);function respondWithRpcPromise(_0x38c8f4,_0x5bb5aa,_0x5073e3){return new BPromise(function(_0x33d12a,_0x46eeff){return client[_0xca8f('0xd')](_0x38c8f4,_0x5073e3)[_0xca8f('0xe')](function(_0x1eedd4){logger[_0xca8f('0xf')](_0xca8f('0x10'),_0x5bb5aa,_0xca8f('0x11'));logger[_0xca8f('0x12')](_0xca8f('0x13'),_0x5bb5aa,'request\x20sent',JSON[_0xca8f('0x14')](_0x1eedd4));if(_0x1eedd4[_0xca8f('0x15')]){if(_0x1eedd4[_0xca8f('0x15')][_0xca8f('0x16')]===0x1f4){logger[_0xca8f('0x15')](_0xca8f('0x10'),_0x5bb5aa,_0x1eedd4[_0xca8f('0x15')][_0xca8f('0x17')]);return _0x46eeff(_0x1eedd4['error'][_0xca8f('0x17')]);}logger['error'](_0xca8f('0x10'),_0x5bb5aa,_0x1eedd4['error'][_0xca8f('0x17')]);return _0x33d12a(_0x1eedd4[_0xca8f('0x15')][_0xca8f('0x17')]);}else{logger[_0xca8f('0xf')](_0xca8f('0x10'),_0x5bb5aa,_0xca8f('0x11'));_0x33d12a(_0x1eedd4[_0xca8f('0x18')][_0xca8f('0x17')]);}})[_0xca8f('0x19')](function(_0x25f097){logger[_0xca8f('0x15')]('FaxAccount,\x20%s,\x20%s',_0x5bb5aa,_0x25f097);_0x46eeff(_0x25f097);});});}exports[_0xca8f('0x1a')]=function(_0x518370){var _0x4ec5da=this;return new Promise(function(_0x56d4a4,_0x3363d5){return db['FaxAccount'][_0xca8f('0x1b')]({'raw':_0x518370['options']?_0x518370[_0xca8f('0x1c')][_0xca8f('0x1d')]===undefined?!![]:![]:!![],'where':_0x518370[_0xca8f('0x1c')]?_0x518370['options']['where']||null:null,'attributes':_0x518370[_0xca8f('0x1c')]?_0x518370[_0xca8f('0x1c')][_0xca8f('0x1e')]||null:null,'limit':_0x518370['options']?_0x518370['options']['limit']||null:null,'include':_0x518370[_0xca8f('0x1c')]?_0x518370[_0xca8f('0x1c')][_0xca8f('0x1f')]?_['map'](_0x518370[_0xca8f('0x1c')]['include'],function(_0x8d9f79){return{'model':db[_0x8d9f79[_0xca8f('0x20')]],'as':_0x8d9f79['as'],'attributes':_0x8d9f79[_0xca8f('0x1e')],'include':_0x8d9f79[_0xca8f('0x1f')]?_[_0xca8f('0x21')](_0x8d9f79[_0xca8f('0x1f')],function(_0x5c83d5){return{'model':db[_0x5c83d5['model']],'as':_0x5c83d5['as'],'attributes':_0x5c83d5[_0xca8f('0x1e')],'include':_0x5c83d5[_0xca8f('0x1f')]?_['map'](_0x5c83d5[_0xca8f('0x1f')],function(_0x28bea6){return{'model':db[_0x28bea6['model']],'as':_0x28bea6['as'],'attributes':_0x28bea6[_0xca8f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ed34b){logger[_0xca8f('0xf')](_0xca8f('0x1a'),_0x518370);logger[_0xca8f('0x12')](_0xca8f('0x1a'),_0x518370,JSON[_0xca8f('0x14')](_0x1ed34b));_0x56d4a4(_0x1ed34b);})[_0xca8f('0x19')](function(_0x5ddd1d){logger[_0xca8f('0x15')]('GetFaxAccount',_0x5ddd1d[_0xca8f('0x17')],_0x518370);_0x3363d5(_0x4ec5da[_0xca8f('0x15')](0x1f4,_0x5ddd1d[_0xca8f('0x17')]));});});};exports[_0xca8f('0x22')]=function(_0xf040bc,_0x340010,_0x4b7c8){var _0x4e8e4d=this;return new Promise(function(_0x501a29,_0x148d3a){var _0x33db81={'body':_0xf040bc['body'],'channel':_0xca8f('0x23')};var _0xa8503b=[];var _0xaf67ca=[];var _0x2250d5={};return db[_0xca8f('0x24')]['describe']()[_0xca8f('0xe')](function(_0x3cc4be){if(!_0x3cc4be){throw new db[(_0xca8f('0x25'))]['ValidationError']('no\x20available\x20attributes');}_0xa8503b=_[_0xca8f('0x26')](_['keys'](_0x3cc4be),[_0xca8f('0x27'),_0xca8f('0x28')]);_0xaf67ca=_[_0xca8f('0x26')](_[_0xca8f('0x29')](_0x3cc4be),['createdAt',_0xca8f('0x28'),_0xca8f('0x2a'),_0xca8f('0x2b')]);if(_0xf040bc[_0xca8f('0x2c')]['id']){delete _0xf040bc[_0xca8f('0x2c')]['id'];}if(_[_0xca8f('0x2d')](_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2e')])){throw new db[(_0xca8f('0x25'))][(_0xca8f('0x2f'))](_0xca8f('0x30'));}if(_['isNil'](_0xf040bc['body']['body'])||_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2c')]===''){throw new db[(_0xca8f('0x25'))][(_0xca8f('0x2f'))](_0xca8f('0x31'));}if(_[_0xca8f('0x2d')](_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x32')])){throw new db[(_0xca8f('0x25'))][(_0xca8f('0x2f'))](_0xca8f('0x33')+_0xaf67ca);}if(!_[_0xca8f('0x34')](_0xaf67ca,_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x32')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xaf67ca);}_0x2250d5[_0xf040bc[_0xca8f('0x2c')]['mapKey']]=_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2e')];})[_0xca8f('0xe')](function(){return db[_0xca8f('0x35')][_0xca8f('0x36')]({'where':{'id':_0xf040bc[_0xca8f('0x37')]['id']},'include':[{'model':db[_0xca8f('0x38')],'as':_0xca8f('0x39'),'include':[{'model':db[_0xca8f('0x24')],'as':_0xca8f('0x3a'),'where':_0x2250d5,'limit':0x1,'order':[[_0xca8f('0x28'),_0xca8f('0x3b')]]}]},{'model':db[_0xca8f('0x3c')],'as':_0xca8f('0x3d')}]});})[_0xca8f('0xe')](function(_0xd94767){if(_0xd94767&&_0xd94767[_0xca8f('0x39')]){var _0x4eb71e=_0xd94767[_0xca8f('0x3e')]({'plain':!![]});_0x33db81[_0xca8f('0x37')]=_0x4eb71e;_0x33db81[_0xca8f('0x3f')]=_0x4eb71e[_0xca8f('0x3d')];_0x33db81[_0xca8f('0x40')]=_0x4eb71e[_0xca8f('0x39')];_0x33db81[_0xca8f('0x3f')]=_['orderBy'](_0x33db81[_0xca8f('0x3f')],[_0xca8f('0x41')],[_0xca8f('0x42')]);if(_0x33db81[_0xca8f('0x37')]['Applications']){delete _0x33db81[_0xca8f('0x37')]['Applications'];}if(_0x33db81[_0xca8f('0x37')][_0xca8f('0x39')]&&_0x33db81['account'][_0xca8f('0x39')]['Contacts'][_0xca8f('0x43')]){return _0x33db81['account'][_0xca8f('0x39')][_0xca8f('0x3a')][0x0];}var _0x466452=_[_0xca8f('0x9')](_0xf040bc[_0xca8f('0x2c')],{'firstName':_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2e')],'ListId':_0x4eb71e[_0xca8f('0x2b')]});_0x466452[_0xf040bc[_0xca8f('0x2c')]['mapKey']]=_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2e')];return db[_0xca8f('0x24')][_0xca8f('0x44')](_0x466452,{'fields':_0xa8503b,'raw':!![]});}})[_0xca8f('0xe')](function(_0x2481e3){_0x33db81['contact']=_0x2481e3;if(_0x2481e3){var _0xfafc9f={'ContactId':_0x2481e3['id'],'FaxAccountId':_0xf040bc[_0xca8f('0x37')]['id'],'fax':_0x2481e3[_0xca8f('0x23')]};return db[_0xca8f('0x45')]['find']({'where':{'ContactId':_0x2481e3['id'],'closed':![],'FaxAccountId':_0xf040bc[_0xca8f('0x37')]['id']}})[_0xca8f('0xe')](function(_0xb386cd){if(_0xb386cd){return[_0xb386cd,![]];}return db['FaxInteraction'][_0xca8f('0x44')](_0xfafc9f)[_0xca8f('0xe')](function(_0x22e548){return[_0x22e548,!![]];});});}else{throw new Error(_0xca8f('0x46'));}})[_0xca8f('0x47')](function(_0xab5e5e,_0x5c9db2){var _0x259c46=_0xab5e5e[_0xca8f('0x3e')]({'plain':!![]});if(_0x5c9db2){if(_0x33db81[_0xca8f('0x37')][_0xca8f('0x48')]){_0x33db81[_0xca8f('0x3f')][_0xca8f('0x49')]({'id':0x0,'priority':_0x33db81[_0xca8f('0x3f')][_0xca8f('0x43')]+0x1,'app':_0xca8f('0x4a'),'appdata':_0xca8f('0x4b'),'interval':_0xca8f('0x4c')});}_0x259c46[_0xca8f('0x4d')]=!![];}else{_0x259c46[_0xca8f('0x4d')]=![];}_0x33db81['interaction']=_0x259c46;return db[_0xca8f('0x4e')][_0xca8f('0x44')]({'body':_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2c')],'FaxAccountId':_0xf040bc[_0xca8f('0x37')]['id'],'FaxInteractionId':_0xab5e5e['id'],'direction':'in','ContactId':_0xab5e5e[_0xca8f('0x4f')],'AttachmentId':_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x50')]});})[_0xca8f('0xe')](function(_0x35ab29){_0x33db81[_0xca8f('0x17')]=_0x35ab29;if(_0x33db81[_0xca8f('0x51')][_0xca8f('0x52')]){return db['User'][_0xca8f('0x36')]({'attributes':['id',_0xca8f('0x53')],'where':{'id':_0x33db81[_0xca8f('0x51')][_0xca8f('0x52')]}})[_0xca8f('0xe')](function(_0x5cfb56){if(_0x5cfb56){_0x33db81['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5cfb56['name']+','+(_0x33db81[_0xca8f('0x37')][_0xca8f('0x54')]||0xa),'interval':_0xca8f('0x4c')});}return respondWithRpcPromise(_0xca8f('0x55'),'startRouting',_0x33db81);});}return respondWithRpcPromise(_0xca8f('0x55'),'startRouting',_0x33db81);})['then'](function(_0x38ccaa){_0x501a29(_0x38ccaa);})[_0xca8f('0x19')](function(_0x5264c9){_0x148d3a(_0x4e8e4d[_0xca8f('0x15')](0x1f4,_0x5264c9[_0xca8f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 32be2d6..b894cbe 100644 --- a/server/api/faxAccount/faxAccount.socket.js +++ b/server/api/faxAccount/faxAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d9e=['faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x441e4a,_0x6678a6){var _0x1ce284=function(_0x43587c){while(--_0x43587c){_0x441e4a['push'](_0x441e4a['shift']());}};_0x1ce284(++_0x6678a6);}(_0x5d9e,0x1cc));var _0xe5d9=function(_0x2ab279,_0x36040b){_0x2ab279=_0x2ab279-0x0;var _0x198e95=_0x5d9e[_0x2ab279];return _0x198e95;};'use strict';var FaxAccountEvents=require(_0xe5d9('0x0'));var events=[_0xe5d9('0x1'),_0xe5d9('0x2'),_0xe5d9('0x3')];function createListener(_0x3fe75f,_0x3ed886){return function(_0xb0aad7){_0x3ed886[_0xe5d9('0x4')](_0x3fe75f,_0xb0aad7);};}function removeListener(_0x3a057d,_0x33814a){return function(){FaxAccountEvents[_0xe5d9('0x5')](_0x3a057d,_0x33814a);};}exports[_0xe5d9('0x6')]=function(_0x4361ab){for(var _0x44dfbb=0x0,_0x56735c=events[_0xe5d9('0x7')];_0x44dfbb<_0x56735c;_0x44dfbb++){var _0x4b48e2=events[_0x44dfbb];var _0x107358=createListener(_0xe5d9('0x8')+_0x4b48e2,_0x4361ab);FaxAccountEvents['on'](_0x4b48e2,_0x107358);}}; \ No newline at end of file +var _0xaeb1=['remove','removeListener','./faxAccount.events','save'];(function(_0xd9f6eb,_0x3c3f50){var _0x478e44=function(_0x50d873){while(--_0x50d873){_0xd9f6eb['push'](_0xd9f6eb['shift']());}};_0x478e44(++_0x3c3f50);}(_0xaeb1,0x13a));var _0x1aeb=function(_0x338569,_0x1917eb){_0x338569=_0x338569-0x0;var _0x2e0cf5=_0xaeb1[_0x338569];return _0x2e0cf5;};'use strict';var FaxAccountEvents=require(_0x1aeb('0x0'));var events=[_0x1aeb('0x1'),_0x1aeb('0x2'),'update'];function createListener(_0x3237f3,_0xe3a552){return function(_0x3701ef){_0xe3a552['emit'](_0x3237f3,_0x3701ef);};}function removeListener(_0x458e80,_0x5f509c){return function(){FaxAccountEvents[_0x1aeb('0x3')](_0x458e80,_0x5f509c);};}exports['register']=function(_0x4e6407){for(var _0x49b212=0x0,_0x302e4a=events['length'];_0x49b212<_0x302e4a;_0x49b212++){var _0x720a99=events[_0x49b212];var _0x14d38a=createListener('faxAccount:'+_0x720a99,_0x4e6407);FaxAccountEvents['on'](_0x720a99,_0x14d38a);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index a580ba4..dd692c5 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x36568f,_0x2a2b3a){var _0x426aa1=function(_0x429e02){while(--_0x429e02){_0x36568f['push'](_0x36568f['shift']());}};_0x426aa1(++_0x2a2b3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x1de9b9,_0x50a9fd){var _0x262280=function(_0xb34cb8){while(--_0xb34cb8){_0x1de9b9['push'](_0x1de9b9['shift']());}};_0x262280(++_0x50a9fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 23300d7..4b26753 100644 --- a/server/api/faxApplication/faxApplication.attributes.js +++ b/server/api/faxApplication/faxApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca8c=['STRING','noop','TEXT','INTEGER'];(function(_0x4bac4e,_0x289218){var _0x39f3a7=function(_0x3b8220){while(--_0x3b8220){_0x4bac4e['push'](_0x4bac4e['shift']());}};_0x39f3a7(++_0x289218);}(_0xca8c,0x11f));var _0xcca8=function(_0x1e6196,_0x2df24b){_0x1e6196=_0x1e6196-0x0;var _0x909f88=_0xca8c[_0x1e6196];return _0x909f88;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xcca8('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xcca8('0x1')],'allowNull':![],'defaultValue':_0xcca8('0x2')},'appdata':{'type':Sequelize[_0xcca8('0x3')]()},'description':{'type':Sequelize[_0xcca8('0x1')]},'interval':{'type':Sequelize[_0xcca8('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xdeab=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x402718,_0x22529c){var _0x3e6afb=function(_0x456b60){while(--_0x456b60){_0x402718['push'](_0x402718['shift']());}};_0x3e6afb(++_0x22529c);}(_0xdeab,0xb1));var _0xbdea=function(_0x2fceb3,_0x1e08ae){_0x2fceb3=_0x2fceb3-0x0;var _0x3624af=_0xdeab[_0x2fceb3];return _0x3624af;};'use strict';var Sequelize=require(_0xbdea('0x0'));module[_0xbdea('0x1')]={'priority':{'type':Sequelize[_0xbdea('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbdea('0x3')],'allowNull':![],'defaultValue':_0xbdea('0x4')},'appdata':{'type':Sequelize[_0xbdea('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbdea('0x3')],'defaultValue':_0xbdea('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b4e0594..963543a 100644 --- a/server/api/faxApplication/faxApplication.controller.js +++ b/server/api/faxApplication/faxApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76d7=['squel','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','apply','reject','then','destroy','error','name','send','index','map','FaxApplication','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x4e0ea1,_0x32d973){var _0x80a15=function(_0xf7856a){while(--_0xf7856a){_0x4e0ea1['push'](_0x4e0ea1['shift']());}};_0x80a15(++_0x32d973);}(_0x76d7,0x1d0));var _0x776d=function(_0x5b3782,_0x581c67){_0x5b3782=_0x5b3782-0x0;var _0x5921ec=_0x76d7[_0x5b3782];return _0x5921ec;};'use strict';var emlformat=require(_0x776d('0x0'));var rimraf=require(_0x776d('0x1'));var zipdir=require(_0x776d('0x2'));var jsonpatch=require(_0x776d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x776d('0x4'));var Mustache=require('mustache');var util=require(_0x776d('0x5'));var path=require(_0x776d('0x6'));var sox=require(_0x776d('0x7'));var csv=require(_0x776d('0x8'));var ejs=require(_0x776d('0x9'));var fs=require('fs');var fs_extra=require(_0x776d('0xa'));var _=require(_0x776d('0xb'));var squel=require(_0x776d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x776d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x776d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x776d('0xe'));var hardwareService=require(_0x776d('0xf'));var logger=require('../../config/logger')(_0x776d('0x10'));var utils=require(_0x776d('0x11'));var config=require(_0x776d('0x12'));var licenseUtil=require(_0x776d('0x13'));var db=require(_0x776d('0x14'))['db'];function respondWithStatusCode(_0x43e98b,_0x1fa136){_0x1fa136=_0x1fa136||0xcc;return function(_0x197f74){if(_0x197f74){return _0x43e98b[_0x776d('0x15')](_0x1fa136);}return _0x43e98b['status'](_0x1fa136)[_0x776d('0x16')]();};}function respondWithResult(_0x5be812,_0x5108e2){_0x5108e2=_0x5108e2||0xc8;return function(_0x18c796){if(_0x18c796){return _0x5be812['status'](_0x5108e2)[_0x776d('0x17')](_0x18c796);}};}function respondWithFilteredResult(_0x20660c,_0x56d4fd){return function(_0x2b4a91){if(_0x2b4a91){var _0x4ee1d2=typeof _0x56d4fd[_0x776d('0x18')]==='undefined'&&typeof _0x56d4fd[_0x776d('0x19')]===_0x776d('0x1a');var _0x5fb8af=_0x2b4a91[_0x776d('0x1b')];var _0x49a5a4=_0x4ee1d2?0x0:_0x56d4fd[_0x776d('0x18')];var _0x4b35a3=_0x4ee1d2?_0x2b4a91[_0x776d('0x1b')]:_0x56d4fd[_0x776d('0x18')]+_0x56d4fd['limit'];var _0x65cf4b;if(_0x4b35a3>=_0x5fb8af){_0x4b35a3=_0x5fb8af;_0x65cf4b=0xc8;}else{_0x65cf4b=0xce;}_0x20660c[_0x776d('0x1c')](_0x65cf4b);return _0x20660c['set']('Content-Range',_0x49a5a4+'-'+_0x4b35a3+'/'+_0x5fb8af)[_0x776d('0x17')](_0x2b4a91);}return null;};}function patchUpdates(_0x2e0bfd){return function(_0x2894f0){try{jsonpatch[_0x776d('0x1d')](_0x2894f0,_0x2e0bfd,!![]);}catch(_0x181342){return BPromise[_0x776d('0x1e')](_0x181342);}return _0x2894f0['save']();};}function saveUpdates(_0x551eb8,_0xc7497b){return function(_0x46cd7a){if(_0x46cd7a){return _0x46cd7a['update'](_0x551eb8)[_0x776d('0x1f')](function(_0x1b5c0b){return _0x1b5c0b;});}return null;};}function removeEntity(_0x66d24,_0x5e9345){return function(_0x4ba135){if(_0x4ba135){return _0x4ba135[_0x776d('0x20')]()['then'](function(){_0x66d24[_0x776d('0x1c')](0xcc)[_0x776d('0x16')]();});}};}function handleEntityNotFound(_0x55bdff,_0x1249c3){return function(_0x4398a1){if(!_0x4398a1){_0x55bdff[_0x776d('0x15')](0x194);}return _0x4398a1;};}function handleError(_0x25dde3,_0x56651c){_0x56651c=_0x56651c||0x1f4;return function(_0x541277){logger[_0x776d('0x21')](_0x541277['stack']);if(_0x541277[_0x776d('0x22')]){delete _0x541277[_0x776d('0x22')];}_0x25dde3[_0x776d('0x1c')](_0x56651c)[_0x776d('0x23')](_0x541277);};}exports[_0x776d('0x24')]=function(_0xcf1505,_0x5edb34){var _0x141704={},_0x508886={},_0x2b1529={'count':0x0,'rows':[]};var _0x53b89b=_[_0x776d('0x25')](db[_0x776d('0x26')]['rawAttributes'],function(_0x46dbf3){return{'name':_0x46dbf3['fieldName'],'type':_0x46dbf3[_0x776d('0x27')][_0x776d('0x28')]};});_0x508886['model']=_[_0x776d('0x25')](_0x53b89b,_0x776d('0x22'));_0x508886[_0x776d('0x29')]=_[_0x776d('0x2a')](_0xcf1505['query']);_0x508886['filters']=_[_0x776d('0x2b')](_0x508886[_0x776d('0x2c')],_0x508886['query']);_0x141704[_0x776d('0x2d')]=_[_0x776d('0x2b')](_0x508886[_0x776d('0x2c')],qs[_0x776d('0x2e')](_0xcf1505[_0x776d('0x29')][_0x776d('0x2e')]));_0x141704[_0x776d('0x2d')]=_0x141704[_0x776d('0x2d')][_0x776d('0x2f')]?_0x141704[_0x776d('0x2d')]:_0x508886['model'];if(!_0xcf1505[_0x776d('0x29')]['hasOwnProperty'](_0x776d('0x30'))){_0x141704[_0x776d('0x19')]=qs[_0x776d('0x19')](_0xcf1505[_0x776d('0x29')]['limit']);_0x141704[_0x776d('0x18')]=qs[_0x776d('0x18')](_0xcf1505[_0x776d('0x29')][_0x776d('0x18')]);}_0x141704[_0x776d('0x31')]=qs['sort'](_0xcf1505[_0x776d('0x29')]['sort']);_0x141704[_0x776d('0x32')]=qs[_0x776d('0x33')](_['pick'](_0xcf1505[_0x776d('0x29')],_0x508886[_0x776d('0x33')]),_0x53b89b);if(_0xcf1505['query'][_0x776d('0x34')]){_0x141704[_0x776d('0x32')]=_[_0x776d('0x35')](_0x141704[_0x776d('0x32')],{'$or':_[_0x776d('0x25')](_0x53b89b,function(_0x2a8ef6){if(_0x2a8ef6['type']!==_0x776d('0x36')){var _0x16d219={};_0x16d219[_0x2a8ef6[_0x776d('0x22')]]={'$like':'%'+_0xcf1505[_0x776d('0x29')]['filter']+'%'};return _0x16d219;}})});}_0x141704=_[_0x776d('0x35')]({},_0x141704,_0xcf1505[_0x776d('0x37')]);var _0x4287bc={'where':_0x141704[_0x776d('0x32')]};return db[_0x776d('0x26')][_0x776d('0x1b')](_0x4287bc)['then'](function(_0x53e06f){_0x2b1529['count']=_0x53e06f;if(_0xcf1505['query'][_0x776d('0x38')]){_0x141704[_0x776d('0x39')]=[{'all':!![]}];}return db['FaxApplication'][_0x776d('0x3a')](_0x141704);})['then'](function(_0x149b2a){_0x2b1529[_0x776d('0x3b')]=_0x149b2a;return _0x2b1529;})[_0x776d('0x1f')](respondWithFilteredResult(_0x5edb34,_0x141704))[_0x776d('0x3c')](handleError(_0x5edb34,null));};exports[_0x776d('0x3d')]=function(_0x559ce0,_0x5b0ef1){var _0x1fa317={'raw':!![],'where':{'id':_0x559ce0[_0x776d('0x3e')]['id']}},_0x4c2e66={};_0x4c2e66[_0x776d('0x2c')]=_[_0x776d('0x2a')](db[_0x776d('0x26')][_0x776d('0x3f')]);_0x4c2e66[_0x776d('0x29')]=_[_0x776d('0x2a')](_0x559ce0['query']);_0x4c2e66[_0x776d('0x33')]=_['intersection'](_0x4c2e66[_0x776d('0x2c')],_0x4c2e66[_0x776d('0x29')]);_0x1fa317['attributes']=_[_0x776d('0x2b')](_0x4c2e66[_0x776d('0x2c')],qs['fields'](_0x559ce0[_0x776d('0x29')]['fields']));_0x1fa317[_0x776d('0x2d')]=_0x1fa317[_0x776d('0x2d')]['length']?_0x1fa317[_0x776d('0x2d')]:_0x4c2e66[_0x776d('0x2c')];if(_0x559ce0[_0x776d('0x29')][_0x776d('0x38')]){_0x1fa317[_0x776d('0x39')]=[{'all':!![]}];}_0x1fa317=_['merge']({},_0x1fa317,_0x559ce0['options']);return db[_0x776d('0x26')][_0x776d('0x40')](_0x1fa317)['then'](handleEntityNotFound(_0x5b0ef1,null))[_0x776d('0x1f')](respondWithResult(_0x5b0ef1,null))[_0x776d('0x3c')](handleError(_0x5b0ef1,null));};exports[_0x776d('0x41')]=function(_0x5be9a7,_0x56a59f){return db[_0x776d('0x26')][_0x776d('0x41')](_0x5be9a7[_0x776d('0x42')],{})[_0x776d('0x1f')](respondWithResult(_0x56a59f,0xc9))[_0x776d('0x3c')](handleError(_0x56a59f,null));};exports[_0x776d('0x43')]=function(_0x821906,_0x27d459){if(_0x821906['body']['id']){delete _0x821906[_0x776d('0x42')]['id'];}return db['FaxApplication'][_0x776d('0x40')]({'where':{'id':_0x821906[_0x776d('0x3e')]['id']}})[_0x776d('0x1f')](handleEntityNotFound(_0x27d459,null))[_0x776d('0x1f')](saveUpdates(_0x821906[_0x776d('0x42')],null))[_0x776d('0x1f')](respondWithResult(_0x27d459,null))[_0x776d('0x3c')](handleError(_0x27d459,null));};exports[_0x776d('0x20')]=function(_0x5ac327,_0x251650){return db['FaxApplication'][_0x776d('0x40')]({'where':{'id':_0x5ac327['params']['id']}})[_0x776d('0x1f')](handleEntityNotFound(_0x251650,null))[_0x776d('0x1f')](removeEntity(_0x251650,null))[_0x776d('0x3c')](handleError(_0x251650,null));}; \ No newline at end of file +var _0xc43c=['json','offset','undefined','count','limit','reject','save','update','then','destroy','sendStatus','error','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x343d5d,_0x5b0c5a){var _0x40a5eb=function(_0x1dca07){while(--_0x1dca07){_0x343d5d['push'](_0x343d5d['shift']());}};_0x40a5eb(++_0x5b0c5a);}(_0xc43c,0x113));var _0xcc43=function(_0x50e161,_0x5be39b){_0x50e161=_0x50e161-0x0;var _0x3616b1=_0xc43c[_0x50e161];return _0x3616b1;};'use strict';var emlformat=require(_0xcc43('0x0'));var rimraf=require(_0xcc43('0x1'));var zipdir=require(_0xcc43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc43('0x3'));var moment=require(_0xcc43('0x4'));var BPromise=require(_0xcc43('0x5'));var Mustache=require(_0xcc43('0x6'));var util=require(_0xcc43('0x7'));var path=require(_0xcc43('0x8'));var sox=require(_0xcc43('0x9'));var csv=require(_0xcc43('0xa'));var ejs=require(_0xcc43('0xb'));var fs=require('fs');var fs_extra=require(_0xcc43('0xc'));var _=require(_0xcc43('0xd'));var squel=require(_0xcc43('0xe'));var crypto=require(_0xcc43('0xf'));var jsforce=require(_0xcc43('0x10'));var deskjs=require(_0xcc43('0x11'));var toCsv=require(_0xcc43('0xa'));var querystring=require(_0xcc43('0x12'));var Papa=require('papaparse');var Redis=require(_0xcc43('0x13'));var authService=require(_0xcc43('0x14'));var qs=require(_0xcc43('0x15'));var as=require(_0xcc43('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc43('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xcc43('0x18'));var licenseUtil=require(_0xcc43('0x19'));var db=require(_0xcc43('0x1a'))['db'];function respondWithStatusCode(_0x3df966,_0x4550c0){_0x4550c0=_0x4550c0||0xcc;return function(_0x3230cc){if(_0x3230cc){return _0x3df966['sendStatus'](_0x4550c0);}return _0x3df966[_0xcc43('0x1b')](_0x4550c0)[_0xcc43('0x1c')]();};}function respondWithResult(_0x56197b,_0x15fcaf){_0x15fcaf=_0x15fcaf||0xc8;return function(_0x43d1c4){if(_0x43d1c4){return _0x56197b[_0xcc43('0x1b')](_0x15fcaf)[_0xcc43('0x1d')](_0x43d1c4);}};}function respondWithFilteredResult(_0x56f70d,_0x13a00b){return function(_0x499b60){if(_0x499b60){var _0x41efa7=typeof _0x13a00b[_0xcc43('0x1e')]===_0xcc43('0x1f')&&typeof _0x13a00b['limit']==='undefined';var _0xa39738=_0x499b60['count'];var _0x1e42e6=_0x41efa7?0x0:_0x13a00b[_0xcc43('0x1e')];var _0x1973b9=_0x41efa7?_0x499b60[_0xcc43('0x20')]:_0x13a00b[_0xcc43('0x1e')]+_0x13a00b[_0xcc43('0x21')];var _0x4f7c7e;if(_0x1973b9>=_0xa39738){_0x1973b9=_0xa39738;_0x4f7c7e=0xc8;}else{_0x4f7c7e=0xce;}_0x56f70d[_0xcc43('0x1b')](_0x4f7c7e);return _0x56f70d['set']('Content-Range',_0x1e42e6+'-'+_0x1973b9+'/'+_0xa39738)[_0xcc43('0x1d')](_0x499b60);}return null;};}function patchUpdates(_0x4c5197){return function(_0x3b56c0){try{jsonpatch['apply'](_0x3b56c0,_0x4c5197,!![]);}catch(_0x3b8e90){return BPromise[_0xcc43('0x22')](_0x3b8e90);}return _0x3b56c0[_0xcc43('0x23')]();};}function saveUpdates(_0x2e9a04,_0x245ec8){return function(_0x3a0678){if(_0x3a0678){return _0x3a0678[_0xcc43('0x24')](_0x2e9a04)[_0xcc43('0x25')](function(_0x320ebf){return _0x320ebf;});}return null;};}function removeEntity(_0x46a902,_0x197939){return function(_0x2978fb){if(_0x2978fb){return _0x2978fb[_0xcc43('0x26')]()['then'](function(){_0x46a902[_0xcc43('0x1b')](0xcc)[_0xcc43('0x1c')]();});}};}function handleEntityNotFound(_0x292c59,_0x435d5b){return function(_0x366391){if(!_0x366391){_0x292c59[_0xcc43('0x27')](0x194);}return _0x366391;};}function handleError(_0x3b6e0c,_0xaab1b8){_0xaab1b8=_0xaab1b8||0x1f4;return function(_0x329621){logger[_0xcc43('0x28')](_0x329621['stack']);if(_0x329621['name']){delete _0x329621[_0xcc43('0x29')];}_0x3b6e0c[_0xcc43('0x1b')](_0xaab1b8)[_0xcc43('0x2a')](_0x329621);};}exports[_0xcc43('0x2b')]=function(_0x5eeb39,_0x442885){var _0x44d748={},_0x3f3320={},_0x46cda9={'count':0x0,'rows':[]};var _0x3bcba8=_['map'](db[_0xcc43('0x2c')][_0xcc43('0x2d')],function(_0x392cb9){return{'name':_0x392cb9[_0xcc43('0x2e')],'type':_0x392cb9[_0xcc43('0x2f')][_0xcc43('0x30')]};});_0x3f3320[_0xcc43('0x31')]=_[_0xcc43('0x32')](_0x3bcba8,'name');_0x3f3320[_0xcc43('0x33')]=_[_0xcc43('0x34')](_0x5eeb39[_0xcc43('0x33')]);_0x3f3320['filters']=_['intersection'](_0x3f3320[_0xcc43('0x31')],_0x3f3320['query']);_0x44d748[_0xcc43('0x35')]=_[_0xcc43('0x36')](_0x3f3320[_0xcc43('0x31')],qs[_0xcc43('0x37')](_0x5eeb39[_0xcc43('0x33')][_0xcc43('0x37')]));_0x44d748[_0xcc43('0x35')]=_0x44d748[_0xcc43('0x35')][_0xcc43('0x38')]?_0x44d748['attributes']:_0x3f3320[_0xcc43('0x31')];if(!_0x5eeb39['query'][_0xcc43('0x39')](_0xcc43('0x3a'))){_0x44d748[_0xcc43('0x21')]=qs[_0xcc43('0x21')](_0x5eeb39[_0xcc43('0x33')][_0xcc43('0x21')]);_0x44d748[_0xcc43('0x1e')]=qs['offset'](_0x5eeb39['query'][_0xcc43('0x1e')]);}_0x44d748[_0xcc43('0x3b')]=qs['sort'](_0x5eeb39[_0xcc43('0x33')][_0xcc43('0x3c')]);_0x44d748[_0xcc43('0x3d')]=qs[_0xcc43('0x3e')](_[_0xcc43('0x3f')](_0x5eeb39['query'],_0x3f3320['filters']),_0x3bcba8);if(_0x5eeb39['query'][_0xcc43('0x40')]){_0x44d748[_0xcc43('0x3d')]=_[_0xcc43('0x41')](_0x44d748[_0xcc43('0x3d')],{'$or':_[_0xcc43('0x32')](_0x3bcba8,function(_0x37f430){if(_0x37f430[_0xcc43('0x2f')]!==_0xcc43('0x42')){var _0x5eab80={};_0x5eab80[_0x37f430[_0xcc43('0x29')]]={'$like':'%'+_0x5eeb39[_0xcc43('0x33')][_0xcc43('0x40')]+'%'};return _0x5eab80;}})});}_0x44d748=_[_0xcc43('0x41')]({},_0x44d748,_0x5eeb39['options']);var _0x58ae4d={'where':_0x44d748['where']};return db['FaxApplication']['count'](_0x58ae4d)['then'](function(_0x2809e4){_0x46cda9[_0xcc43('0x20')]=_0x2809e4;if(_0x5eeb39[_0xcc43('0x33')][_0xcc43('0x43')]){_0x44d748[_0xcc43('0x44')]=[{'all':!![]}];}return db[_0xcc43('0x2c')][_0xcc43('0x45')](_0x44d748);})[_0xcc43('0x25')](function(_0x4e9083){_0x46cda9['rows']=_0x4e9083;return _0x46cda9;})[_0xcc43('0x25')](respondWithFilteredResult(_0x442885,_0x44d748))['catch'](handleError(_0x442885,null));};exports[_0xcc43('0x46')]=function(_0x1f0921,_0x170eec){var _0x36a681={'raw':!![],'where':{'id':_0x1f0921[_0xcc43('0x47')]['id']}},_0x14f6e2={};_0x14f6e2[_0xcc43('0x31')]=_['keys'](db[_0xcc43('0x2c')][_0xcc43('0x2d')]);_0x14f6e2[_0xcc43('0x33')]=_[_0xcc43('0x34')](_0x1f0921['query']);_0x14f6e2[_0xcc43('0x3e')]=_[_0xcc43('0x36')](_0x14f6e2[_0xcc43('0x31')],_0x14f6e2[_0xcc43('0x33')]);_0x36a681['attributes']=_['intersection'](_0x14f6e2[_0xcc43('0x31')],qs[_0xcc43('0x37')](_0x1f0921['query'][_0xcc43('0x37')]));_0x36a681[_0xcc43('0x35')]=_0x36a681[_0xcc43('0x35')][_0xcc43('0x38')]?_0x36a681[_0xcc43('0x35')]:_0x14f6e2[_0xcc43('0x31')];if(_0x1f0921[_0xcc43('0x33')][_0xcc43('0x43')]){_0x36a681['include']=[{'all':!![]}];}_0x36a681=_['merge']({},_0x36a681,_0x1f0921['options']);return db[_0xcc43('0x2c')][_0xcc43('0x48')](_0x36a681)['then'](handleEntityNotFound(_0x170eec,null))[_0xcc43('0x25')](respondWithResult(_0x170eec,null))[_0xcc43('0x49')](handleError(_0x170eec,null));};exports[_0xcc43('0x4a')]=function(_0x1f7d54,_0x1f3bfb){return db[_0xcc43('0x2c')][_0xcc43('0x4a')](_0x1f7d54[_0xcc43('0x4b')],{})[_0xcc43('0x25')](respondWithResult(_0x1f3bfb,0xc9))[_0xcc43('0x49')](handleError(_0x1f3bfb,null));};exports[_0xcc43('0x24')]=function(_0xc2f8a6,_0x24d4c6){if(_0xc2f8a6['body']['id']){delete _0xc2f8a6['body']['id'];}return db[_0xcc43('0x2c')][_0xcc43('0x48')]({'where':{'id':_0xc2f8a6[_0xcc43('0x47')]['id']}})[_0xcc43('0x25')](handleEntityNotFound(_0x24d4c6,null))[_0xcc43('0x25')](saveUpdates(_0xc2f8a6[_0xcc43('0x4b')],null))[_0xcc43('0x25')](respondWithResult(_0x24d4c6,null))[_0xcc43('0x49')](handleError(_0x24d4c6,null));};exports[_0xcc43('0x26')]=function(_0x58c3b7,_0x157151){return db[_0xcc43('0x2c')][_0xcc43('0x48')]({'where':{'id':_0x58c3b7[_0xcc43('0x47')]['id']}})[_0xcc43('0x25')](handleEntityNotFound(_0x157151,null))[_0xcc43('0x25')](removeEntity(_0x157151,null))['catch'](handleError(_0x157151,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 77e597b..63b35d8 100644 --- a/server/api/faxApplication/faxApplication.model.js +++ b/server/api/faxApplication/faxApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd37a=['exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxApplication.attributes'];(function(_0x514116,_0x5c633f){var _0x258c1e=function(_0x56e6a9){while(--_0x56e6a9){_0x514116['push'](_0x514116['shift']());}};_0x258c1e(++_0x5c633f);}(_0xd37a,0xd8));var _0xad37=function(_0x5e5d94,_0x502613){_0x5e5d94=_0x5e5d94-0x0;var _0xead4e4=_0xd37a[_0x5e5d94];return _0xead4e4;};'use strict';var _=require(_0xad37('0x0'));var util=require('util');var logger=require(_0xad37('0x1'))(_0xad37('0x2'));var moment=require(_0xad37('0x3'));var BPromise=require(_0xad37('0x4'));var rp=require(_0xad37('0x5'));var fs=require('fs');var path=require(_0xad37('0x6'));var rimraf=require(_0xad37('0x7'));var config=require('../../config/environment');var attributes=require(_0xad37('0x8'));module[_0xad37('0x9')]=function(_0x71ffaa,_0x14cd61){return _0x71ffaa[_0xad37('0xa')](_0xad37('0xb'),attributes,{'tableName':_0xad37('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xad37('0xd'),'collate':_0xad37('0xe')});}; \ No newline at end of file +var _0x9e8c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x36d353,_0x16848f){var _0x22caa8=function(_0x5d14e8){while(--_0x5d14e8){_0x36d353['push'](_0x36d353['shift']());}};_0x22caa8(++_0x16848f);}(_0x9e8c,0x15e));var _0xc9e8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x9e8c[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xc9e8('0x0'));var util=require(_0xc9e8('0x1'));var logger=require(_0xc9e8('0x2'))(_0xc9e8('0x3'));var moment=require(_0xc9e8('0x4'));var BPromise=require(_0xc9e8('0x5'));var rp=require(_0xc9e8('0x6'));var fs=require('fs');var path=require(_0xc9e8('0x7'));var rimraf=require(_0xc9e8('0x8'));var config=require(_0xc9e8('0x9'));var attributes=require(_0xc9e8('0xa'));module['exports']=function(_0x3a5185,_0x59cdae){return _0x3a5185[_0xc9e8('0xb')](_0xc9e8('0xc'),attributes,{'tableName':_0xc9e8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc9e8('0xe'),'collate':_0xc9e8('0xf')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 6dbf7bc..b40b084 100644 --- a/server/api/faxApplication/faxApplication.rpc.js +++ b/server/api/faxApplication/faxApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a44=['attributes','limit','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','result','UpdateFaxApplication','FaxApplication','update','options','raw','where'];(function(_0x66ef11,_0x42f78b){var _0x318579=function(_0x2532a7){while(--_0x2532a7){_0x66ef11['push'](_0x66ef11['shift']());}};_0x318579(++_0x42f78b);}(_0x7a44,0x196));var _0x47a4=function(_0x41d8ad,_0x15ed19){_0x41d8ad=_0x41d8ad-0x0;var _0x14505c=_0x7a44[_0x41d8ad];return _0x14505c;};'use strict';var _=require(_0x47a4('0x0'));var util=require('util');var moment=require(_0x47a4('0x1'));var BPromise=require(_0x47a4('0x2'));var rs=require(_0x47a4('0x3'));var fs=require('fs');var Redis=require(_0x47a4('0x4'));var db=require(_0x47a4('0x5'))['db'];var utils=require(_0x47a4('0x6'));var logger=require('../../config/logger')(_0x47a4('0x7'));var config=require(_0x47a4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x47a4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e364,_0x396c86,_0x2f0647){return new BPromise(function(_0x6f768d,_0x575234){return client[_0x47a4('0xa')](_0x56e364,_0x2f0647)[_0x47a4('0xb')](function(_0x450c3d){logger[_0x47a4('0xc')]('FaxApplication,\x20%s,\x20%s',_0x396c86,'request\x20sent');logger[_0x47a4('0xd')](_0x47a4('0xe'),_0x396c86,_0x47a4('0xf'),JSON[_0x47a4('0x10')](_0x450c3d));if(_0x450c3d[_0x47a4('0x11')]){if(_0x450c3d['error'][_0x47a4('0x12')]===0x1f4){logger[_0x47a4('0x11')]('FaxApplication,\x20%s,\x20%s',_0x396c86,_0x450c3d[_0x47a4('0x11')][_0x47a4('0x13')]);return _0x575234(_0x450c3d[_0x47a4('0x11')][_0x47a4('0x13')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x396c86,_0x450c3d[_0x47a4('0x11')][_0x47a4('0x13')]);return _0x6f768d(_0x450c3d['error'][_0x47a4('0x13')]);}else{logger[_0x47a4('0xc')](_0x47a4('0x14'),_0x396c86,_0x47a4('0xf'));_0x6f768d(_0x450c3d[_0x47a4('0x15')][_0x47a4('0x13')]);}})['catch'](function(_0x17aea5){logger[_0x47a4('0x11')]('FaxApplication,\x20%s,\x20%s',_0x396c86,_0x17aea5);_0x575234(_0x17aea5);});});}exports[_0x47a4('0x16')]=function(_0x1ed541){var _0x51fe6b=this;return new Promise(function(_0xf09d2c,_0x319ea4){return db[_0x47a4('0x17')][_0x47a4('0x18')](_0x1ed541['body'],{'raw':_0x1ed541[_0x47a4('0x19')]?_0x1ed541[_0x47a4('0x19')][_0x47a4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ed541[_0x47a4('0x19')]?_0x1ed541[_0x47a4('0x19')][_0x47a4('0x1b')]||null:null,'attributes':_0x1ed541[_0x47a4('0x19')]?_0x1ed541[_0x47a4('0x19')][_0x47a4('0x1c')]||null:null,'limit':_0x1ed541[_0x47a4('0x19')]?_0x1ed541['options'][_0x47a4('0x1d')]||null:null})[_0x47a4('0xb')](function(_0xcc8385){logger['info']('UpdateFaxApplication',_0x1ed541);logger[_0x47a4('0xd')](_0x47a4('0x16'),_0x1ed541,JSON[_0x47a4('0x10')](_0xcc8385));_0xf09d2c(_0xcc8385);})[_0x47a4('0x1e')](function(_0x6f1d2a){logger['error'](_0x47a4('0x16'),_0x6f1d2a[_0x47a4('0x13')],_0x1ed541);_0x319ea4(_0x51fe6b[_0x47a4('0x11')](0x1f4,_0x6f1d2a[_0x47a4('0x13')]));});});}; \ No newline at end of file +var _0xec86=['catch','FaxApplication','update','body','options','raw','where','limit','then','UpdateFaxApplication','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4702c2,_0x3154b8){var _0x30e737=function(_0x47c289){while(--_0x47c289){_0x4702c2['push'](_0x4702c2['shift']());}};_0x30e737(++_0x3154b8);}(_0xec86,0x7f));var _0x6ec8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xec86[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x6ec8('0x0'));var util=require(_0x6ec8('0x1'));var moment=require(_0x6ec8('0x2'));var BPromise=require(_0x6ec8('0x3'));var rs=require(_0x6ec8('0x4'));var fs=require('fs');var Redis=require(_0x6ec8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ec8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ec8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6ec8('0x8')][_0x6ec8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11fb2b,_0x2c2636,_0x110d2c){return new BPromise(function(_0x1881bc,_0x58d55f){return client[_0x6ec8('0xa')](_0x11fb2b,_0x110d2c)['then'](function(_0x40bb60){logger[_0x6ec8('0xb')](_0x6ec8('0xc'),_0x2c2636,_0x6ec8('0xd'));logger[_0x6ec8('0xe')](_0x6ec8('0xf'),_0x2c2636,'request\x20sent',JSON['stringify'](_0x40bb60));if(_0x40bb60[_0x6ec8('0x10')]){if(_0x40bb60[_0x6ec8('0x10')]['code']===0x1f4){logger[_0x6ec8('0x10')](_0x6ec8('0xc'),_0x2c2636,_0x40bb60[_0x6ec8('0x10')]['message']);return _0x58d55f(_0x40bb60[_0x6ec8('0x10')][_0x6ec8('0x11')]);}logger[_0x6ec8('0x10')](_0x6ec8('0xc'),_0x2c2636,_0x40bb60['error'][_0x6ec8('0x11')]);return _0x1881bc(_0x40bb60[_0x6ec8('0x10')][_0x6ec8('0x11')]);}else{logger[_0x6ec8('0xb')](_0x6ec8('0xc'),_0x2c2636,_0x6ec8('0xd'));_0x1881bc(_0x40bb60['result'][_0x6ec8('0x11')]);}})[_0x6ec8('0x12')](function(_0x343b5c){logger['error'](_0x6ec8('0xc'),_0x2c2636,_0x343b5c);_0x58d55f(_0x343b5c);});});}exports['UpdateFaxApplication']=function(_0x3ce12f){var _0x13fe2e=this;return new Promise(function(_0x1d836a,_0xe9b881){return db[_0x6ec8('0x13')][_0x6ec8('0x14')](_0x3ce12f[_0x6ec8('0x15')],{'raw':_0x3ce12f[_0x6ec8('0x16')]?_0x3ce12f[_0x6ec8('0x16')][_0x6ec8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ce12f['options']?_0x3ce12f[_0x6ec8('0x16')][_0x6ec8('0x18')]||null:null,'attributes':_0x3ce12f[_0x6ec8('0x16')]?_0x3ce12f[_0x6ec8('0x16')]['attributes']||null:null,'limit':_0x3ce12f['options']?_0x3ce12f[_0x6ec8('0x16')][_0x6ec8('0x19')]||null:null})[_0x6ec8('0x1a')](function(_0x562a84){logger[_0x6ec8('0xb')](_0x6ec8('0x1b'),_0x3ce12f);logger[_0x6ec8('0xe')](_0x6ec8('0x1b'),_0x3ce12f,JSON[_0x6ec8('0x1c')](_0x562a84));_0x1d836a(_0x562a84);})['catch'](function(_0x4f6805){logger['error'](_0x6ec8('0x1b'),_0x4f6805[_0x6ec8('0x11')],_0x3ce12f);_0xe9b881(_0x13fe2e['error'](0x1f4,_0x4f6805[_0x6ec8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 075b969..d8f2b61 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','path','express'];(function(_0x2ee822,_0x4c15ab){var _0x3df987=function(_0x29e89a){while(--_0x29e89a){_0x2ee822['push'](_0x2ee822['shift']());}};_0x3df987(++_0x4c15ab);}(_0x36ee,0xe8));var _0xe36e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x36ee[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['post']('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xd')]);router[_0xe36e('0xe')]('/:id',auth[_0xe36e('0x9')](),controller['update']);router[_0xe36e('0xf')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x10')]);module[_0xe36e('0x11')]=router; \ No newline at end of file +var _0xd7d1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x17ebb6,_0x465af7){var _0x32ec22=function(_0x160ff0){while(--_0x160ff0){_0x17ebb6['push'](_0x17ebb6['shift']());}};_0x32ec22(++_0x465af7);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x265914,_0x18caf1){_0x265914=_0x265914-0x0;var _0x3ee8f0=_0xd7d1[_0x265914];return _0x3ee8f0;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xf')]('/',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0x11')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router['delete'](_0x1d7d('0xd'),auth['isAuthenticated'](),controller[_0x1d7d('0x13')]);module[_0x1d7d('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 114dd91..ffe9948 100644 --- a/server/api/faxInteraction/faxInteraction.attributes.js +++ b/server/api/faxInteraction/faxInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x385e=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3b0147,_0x5ceb55){var _0x43d4a2=function(_0xbe8a3e){while(--_0xbe8a3e){_0x3b0147['push'](_0x3b0147['shift']());}};_0x43d4a2(++_0x5ceb55);}(_0x385e,0xcc));var _0xe385=function(_0xa041de,_0x3600e2){_0xa041de=_0xa041de-0x0;var _0x1d654c=_0x385e[_0xa041de];return _0x1d654c;};'use strict';var Sequelize=require(_0xe385('0x0'));module[_0xe385('0x1')]={'closed':{'type':Sequelize[_0xe385('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe385('0x3')]},'disposition':{'type':Sequelize[_0xe385('0x4')]},'secondDisposition':{'type':Sequelize[_0xe385('0x4')]},'thirdDisposition':{'type':Sequelize[_0xe385('0x4')]},'note':{'type':Sequelize[_0xe385('0x4')]},'read1stAt':{'type':Sequelize[_0xe385('0x3')]},'fax':{'type':Sequelize[_0xe385('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xe385('0x5')]('in',_0xe385('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xaa3e=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x2fab8a,_0x31e041){var _0x1cfa34=function(_0x217404){while(--_0x217404){_0x2fab8a['push'](_0x2fab8a['shift']());}};_0x1cfa34(++_0x31e041);}(_0xaa3e,0x69));var _0xeaa3=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0xaa3e[_0x1faaa1];return _0x994ec;};'use strict';var Sequelize=require('sequelize');module[_0xeaa3('0x0')]={'closed':{'type':Sequelize[_0xeaa3('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xeaa3('0x2')]},'disposition':{'type':Sequelize[_0xeaa3('0x3')]},'secondDisposition':{'type':Sequelize[_0xeaa3('0x3')]},'thirdDisposition':{'type':Sequelize[_0xeaa3('0x3')]},'note':{'type':Sequelize[_0xeaa3('0x3')]},'read1stAt':{'type':Sequelize[_0xeaa3('0x2')]},'fax':{'type':Sequelize[_0xeaa3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xeaa3('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xeaa3('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xeaa3('0x4')]('in',_0xeaa3('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 073703e..2fcd866 100644 --- a/server/api/faxInteraction/faxInteraction.controller.js +++ b/server/api/faxInteraction/faxInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x711b=['setTags','spread','color','faxInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','existsSync','pipe','createWriteStream','basename','resolve','err','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','update','then','destroy','error','name','send','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','sort','pick','FaxInteractionId','filter','where','$gte','split','format','include','rows','addTags'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x711b,0x80));var _0xb711=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x711b[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0xb711('0x0'));var zipdir=require(_0xb711('0x1'));var moment=require(_0xb711('0x2'));var BPromise=require('bluebird');var util=require(_0xb711('0x3'));var path=require(_0xb711('0x4'));var fs=require('fs');var _=require(_0xb711('0x5'));var Redis=require('ioredis');var interaction=require(_0xb711('0x6'));var qs=require(_0xb711('0x7'));var logger=require(_0xb711('0x8'))(_0xb711('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xb711('0xa')](config[_0xb711('0xb')],{'host':_0xb711('0xc'),'port':0x18eb});var socket=require(_0xb711('0xd'))(new Redis(config[_0xb711('0xb')]));require(_0xb711('0xe'))[_0xb711('0xf')](socket);function respondWithStatusCode(_0xeb61ae,_0x44ac19){_0x44ac19=_0x44ac19||0xcc;return function(_0x10a3ec){if(_0x10a3ec){return _0xeb61ae[_0xb711('0x10')](_0x44ac19);}return _0xeb61ae['status'](_0x44ac19)[_0xb711('0x11')]();};}function respondWithResult(_0x59336e,_0x46d2fa){_0x46d2fa=_0x46d2fa||0xc8;return function(_0x4a30af){if(_0x4a30af){return _0x59336e['status'](_0x46d2fa)[_0xb711('0x12')](_0x4a30af);}};}function respondWithFilteredResult(_0x321c9d,_0x5544d6){return function(_0x5dd7d1){if(_0x5dd7d1){var _0x1cb288=typeof _0x5544d6[_0xb711('0x13')]===_0xb711('0x14')&&typeof _0x5544d6[_0xb711('0x15')]===_0xb711('0x14');var _0x1f7450=_0x5dd7d1[_0xb711('0x16')];var _0x33cdf1=_0x1cb288?0x0:_0x5544d6[_0xb711('0x13')];var _0x963ffd=_0x1cb288?_0x5dd7d1[_0xb711('0x16')]:_0x5544d6[_0xb711('0x13')]+_0x5544d6[_0xb711('0x15')];var _0x4bef93;if(_0x963ffd>=_0x1f7450){_0x963ffd=_0x1f7450;_0x4bef93=0xc8;}else{_0x4bef93=0xce;}_0x321c9d[_0xb711('0x17')](_0x4bef93);return _0x321c9d[_0xb711('0x18')]('Content-Range',_0x33cdf1+'-'+_0x963ffd+'/'+_0x1f7450)[_0xb711('0x12')](_0x5dd7d1);}return null;};}function saveUpdates(_0x1cd0b7){return function(_0x945007){if(_0x945007){return _0x945007[_0xb711('0x19')](_0x1cd0b7)[_0xb711('0x1a')](function(_0xc7e043){return _0xc7e043;});}return null;};}function removeEntity(_0x575139){return function(_0x3d9de5){if(_0x3d9de5){return _0x3d9de5[_0xb711('0x1b')]()[_0xb711('0x1a')](function(){_0x575139['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c39d8){return function(_0x4f369b){if(!_0x4f369b){_0x3c39d8[_0xb711('0x10')](0x194);}return _0x4f369b;};}function handleError(_0x99ec2e,_0x13df5b){_0x13df5b=_0x13df5b||0x1f4;return function(_0x1e2246){logger[_0xb711('0x1c')](_0x1e2246['stack']);if(_0x1e2246['name']){delete _0x1e2246[_0xb711('0x1d')];}_0x99ec2e[_0xb711('0x17')](_0x13df5b)[_0xb711('0x1e')](_0x1e2246);};}exports['index']=function(_0x45741a,_0x2efdc4){var _0x3c6c5d={};var _0x3cedd7=_[_0xb711('0x1f')](db[_0xb711('0x20')][_0xb711('0x21')],function(_0x49b529){return{'name':_0x49b529[_0xb711('0x22')],'type':_0x49b529[_0xb711('0x23')][_0xb711('0x24')]};});_0x3c6c5d=qs[_0xb711('0x25')](_0x3cedd7,_0x45741a);return interaction[_0xb711('0x26')]('fax',_0x45741a[_0xb711('0x27')],_0x45741a[_0xb711('0x28')],_0x3c6c5d,_0x3cedd7)[_0xb711('0x1a')](respondWithFilteredResult(_0x2efdc4,_0x3c6c5d))[_0xb711('0x29')](handleError(_0x2efdc4,null));};exports[_0xb711('0x2a')]=function(_0x3f6327,_0x4bf1a7){var _0x412954={'raw':![],'where':{'id':_0x3f6327[_0xb711('0x2b')]['id']}},_0x2c9d27={};_0x2c9d27[_0xb711('0x2c')]=_[_0xb711('0x2d')](db[_0xb711('0x20')][_0xb711('0x21')]);_0x2c9d27[_0xb711('0x27')]=_['keys'](_0x3f6327[_0xb711('0x27')]);_0x2c9d27[_0xb711('0x2e')]=_[_0xb711('0x2f')](_0x2c9d27['model'],_0x2c9d27[_0xb711('0x27')]);_0x412954[_0xb711('0x30')]=_[_0xb711('0x2f')](_0x2c9d27[_0xb711('0x2c')],qs['fields'](_0x3f6327[_0xb711('0x27')][_0xb711('0x31')]));_0x412954[_0xb711('0x30')]=_0x412954[_0xb711('0x30')][_0xb711('0x32')]?_0x412954['attributes']:_0x2c9d27[_0xb711('0x2c')];if(_0x3f6327[_0xb711('0x27')][_0xb711('0x33')]){_0x412954['include']=[{'all':!![]}];}_0x412954=_[_0xb711('0x34')]({},_0x412954,_0x3f6327[_0xb711('0x35')]);return db[_0xb711('0x20')][_0xb711('0x36')](_0x412954)[_0xb711('0x1a')](handleEntityNotFound(_0x4bf1a7,null))[_0xb711('0x1a')](respondWithResult(_0x4bf1a7,null))['catch'](handleError(_0x4bf1a7,null));};exports[_0xb711('0x37')]=function(_0x3c5d28,_0x26d799){return db['FaxInteraction'][_0xb711('0x37')](_0x3c5d28[_0xb711('0x38')],{})[_0xb711('0x1a')](respondWithResult(_0x26d799,0xc9))['catch'](handleError(_0x26d799,null));};exports['update']=function(_0x2f3f98,_0x22d53c){if(_0x2f3f98['body']['id']){delete _0x2f3f98[_0xb711('0x38')]['id'];}return db[_0xb711('0x20')][_0xb711('0x36')]({'where':{'id':_0x2f3f98[_0xb711('0x2b')]['id']}})[_0xb711('0x1a')](handleEntityNotFound(_0x22d53c,null))[_0xb711('0x1a')](saveUpdates(_0x2f3f98[_0xb711('0x38')],null))[_0xb711('0x1a')](respondWithResult(_0x22d53c,null))[_0xb711('0x29')](handleError(_0x22d53c,null));};exports['destroy']=function(_0x5b534b,_0xdc0190){return db[_0xb711('0x20')][_0xb711('0x36')]({'where':{'id':_0x5b534b[_0xb711('0x2b')]['id']}})[_0xb711('0x1a')](handleEntityNotFound(_0xdc0190,null))[_0xb711('0x1a')](removeEntity(_0xdc0190,null))[_0xb711('0x29')](handleError(_0xdc0190,null));};exports['describe']=function(_0x4c4def,_0x3623f1){return db['FaxInteraction']['describe']()[_0xb711('0x1a')](respondWithResult(_0x3623f1,null))[_0xb711('0x29')](handleError(_0x3623f1,null));};exports[_0xb711('0x39')]=function(_0x4ec2c0,_0x53d93e){return db[_0xb711('0x3a')][_0xb711('0x36')]({'where':{'id':_0x4ec2c0[_0xb711('0x2b')]['id']}})[_0xb711('0x1a')](handleEntityNotFound(_0x53d93e,null))['then'](function(_0x4e9ceb){if(_0x4e9ceb){return _0x4e9ceb[_0xb711('0x39')](_0x4ec2c0[_0xb711('0x38')][_0xb711('0x3b')],_[_0xb711('0x3c')](_0x4ec2c0[_0xb711('0x38')],[_0xb711('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x53d93e,null))[_0xb711('0x29')](handleError(_0x53d93e,null));};exports[_0xb711('0x3d')]=function(_0x33f4c9,_0x21437e){var _0x1f7321={'raw':![],'where':{}};var _0x5504da={};var _0x2df430={'count':0x0,'rows':[]};return db[_0xb711('0x20')][_0xb711('0x3e')]({'where':{'id':_0x33f4c9[_0xb711('0x2b')]['id']}})[_0xb711('0x1a')](handleEntityNotFound(_0x21437e,null))[_0xb711('0x1a')](function(_0x42d12d){if(_0x42d12d){_0x5504da[_0xb711('0x2c')]=_[_0xb711('0x2d')](db[_0xb711('0x3a')][_0xb711('0x21')]);_0x5504da[_0xb711('0x27')]=_[_0xb711('0x2d')](_0x33f4c9['query']);_0x5504da[_0xb711('0x2e')]=_[_0xb711('0x2f')](_0x5504da[_0xb711('0x2c')],_0x5504da[_0xb711('0x27')]);_0x1f7321[_0xb711('0x30')]=_[_0xb711('0x2f')](_0x5504da['model'],qs[_0xb711('0x31')](_0x33f4c9[_0xb711('0x27')][_0xb711('0x31')]));_0x1f7321[_0xb711('0x30')]=_0x1f7321[_0xb711('0x30')][_0xb711('0x32')]?_0x1f7321[_0xb711('0x30')]:_0x5504da[_0xb711('0x2c')];if(!_0x33f4c9['query'][_0xb711('0x3f')](_0xb711('0x40'))){_0x1f7321[_0xb711('0x15')]=qs['limit'](_0x33f4c9['query'][_0xb711('0x15')]);_0x1f7321['offset']=qs['offset'](_0x33f4c9[_0xb711('0x27')][_0xb711('0x13')]);}_0x1f7321['order']=qs[_0xb711('0x41')](_0x33f4c9[_0xb711('0x27')][_0xb711('0x41')]);_0x1f7321['where']=qs['filters'](_[_0xb711('0x42')](_0x33f4c9[_0xb711('0x27')],_0x5504da[_0xb711('0x2e')]));_0x1f7321['where'][_0xb711('0x43')]=_0x42d12d['id'];if(_0x33f4c9[_0xb711('0x27')][_0xb711('0x44')]){_0x1f7321['where']=_[_0xb711('0x34')](_0x1f7321[_0xb711('0x45')],{'$or':_['map'](_0x1f7321[_0xb711('0x30')],function(_0x2d02c7){var _0x4e3fc2={};_0x4e3fc2[_0x2d02c7]={'$like':'%'+_0x33f4c9[_0xb711('0x27')][_0xb711('0x44')]+'%'};return _0x4e3fc2;})});}if(_0x33f4c9[_0xb711('0x27')]['$gte']){var _0x19b5c8=_0x33f4c9[_0xb711('0x27')][_0xb711('0x46')][_0xb711('0x47')](',');var _0x3e8b14={};_0x3e8b14[_0x19b5c8[0x0]]={'$gte':moment(_0x19b5c8[0x1])[_0xb711('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1f7321['where']=_[_0xb711('0x34')](_0x1f7321['where'],_0x3e8b14);}_0x1f7321=_[_0xb711('0x34')]({},_0x1f7321,_0x33f4c9[_0xb711('0x35')]);return db[_0xb711('0x3a')][_0xb711('0x16')]({'where':_0x1f7321[_0xb711('0x45')]})['then'](function(_0x348a53){_0x2df430[_0xb711('0x16')]=_0x348a53;if(_0x33f4c9[_0xb711('0x27')]['includeAll']){_0x1f7321[_0xb711('0x49')]=[{'all':!![]}];}return db[_0xb711('0x3a')][_0xb711('0x26')](_0x1f7321);})[_0xb711('0x1a')](function(_0x128b5a){_0x2df430[_0xb711('0x4a')]=_0x128b5a;return _0x2df430;});}})[_0xb711('0x1a')](respondWithFilteredResult(_0x21437e,_0x1f7321))[_0xb711('0x29')](handleError(_0x21437e,null));};exports[_0xb711('0x4b')]=function(_0x826ea7,_0x551d73){return db[_0xb711('0x20')]['find']({'where':{'id':_0x826ea7[_0xb711('0x2b')]['id']}})['then'](handleEntityNotFound(_0x551d73,null))[_0xb711('0x1a')](function(_0x44295f){if(_0x44295f){return _0x44295f[_0xb711('0x4c')](_0x826ea7[_0xb711('0x38')][_0xb711('0x3b')],_[_0xb711('0x3c')](_0x826ea7['body'],[_0xb711('0x3b'),'id'])||{})[_0xb711('0x4d')](function(){return db['Tag'][_0xb711('0x26')]({'attributes':['id',_0xb711('0x1d'),_0xb711('0x4e')],'where':{'id':_0x826ea7[_0xb711('0x38')][_0xb711('0x3b')]}});})[_0xb711('0x1a')](function(_0x4b0fc3){socket['emit'](_0xb711('0x4f'),{'id':Number(_0x826ea7['params']['id']),'tags':_0x4b0fc3||[]});return{'id':Number(_0x826ea7['params']['id']),'tags':_0x4b0fc3||[]};});}})[_0xb711('0x1a')](respondWithResult(_0x551d73,null))[_0xb711('0x29')](handleError(_0x551d73,null));};exports[_0xb711('0x50')]=function(_0x223828,_0x243d9e){return db['FaxInteraction'][_0xb711('0x36')]({'where':{'id':_0x223828['params']['id']}})['then'](handleEntityNotFound(_0x243d9e,null))[_0xb711('0x1a')](function(_0x3f3159){if(_0x3f3159){return _0x3f3159[_0xb711('0x50')](_0x223828[_0xb711('0x27')][_0xb711('0x3b')]);}})[_0xb711('0x1a')](respondWithStatusCode(_0x243d9e,null))['catch'](handleError(_0x243d9e,null));};exports[_0xb711('0x51')]=function(_0x5f4571,_0x1b067b){var _0x153b62=moment()['unix']()[_0xb711('0x52')]();var _0x5dd2cc=path[_0xb711('0x53')](config[_0xb711('0x54')],_0xb711('0x55'),_0xb711('0x56'),_0xb711('0x57'));var _0x3e6369=path[_0xb711('0x53')](config[_0xb711('0x54')],'server',_0xb711('0x56'),_0xb711('0x58'));var _0x268ba3=path[_0xb711('0x53')](_0x5dd2cc,_0x153b62);var _0xa8fe0f=util[_0xb711('0x48')](_0xb711('0x59'),_0x5f4571[_0xb711('0x2b')]['id'],_0x153b62);var _0x350aff=path[_0xb711('0x53')](_0x5dd2cc,_0xa8fe0f);var _0x2abda5=[];_0x2abda5[_0xb711('0x5a')]({'model':db[_0xb711('0x5b')],'as':_0xb711('0x5b'),'raw':!![]});var _0x29f5ff=[{'model':db[_0xb711('0x3a')],'as':_0xb711('0x5c'),'attributes':['id',_0xb711('0x38'),_0xb711('0x5d')],'include':_0x2abda5}];return db[_0xb711('0x20')]['find']({'where':{'id':_0x5f4571[_0xb711('0x2b')]['id']},'include':_0x29f5ff})['then'](handleEntityNotFound(_0x1b067b,null))[_0xb711('0x1a')](function(_0x386846){if(_0x386846&&_0x386846['Messages']){var _0x5082fa=_0x386846['get']({'plain':!![]});fs[_0xb711('0x5e')](_0x268ba3);for(var _0x219c91=0x0;_0x219c91<_0x5082fa['Messages'][_0xb711('0x32')];_0x219c91++){var _0x1465f5=_0x5082fa[_0xb711('0x5c')][_0x219c91][_0xb711('0x5b')];if(_0x1465f5){var _0x242b39=path['join'](_0x3e6369,_0x1465f5['basename']);if(fs[_0xb711('0x5f')](_0x242b39)){fs['createReadStream'](_0x242b39)[_0xb711('0x60')](fs[_0xb711('0x61')](path[_0xb711('0x53')](_0x268ba3,_0x1465f5[_0xb711('0x62')])));}}}return BPromise[_0xb711('0x63')]()[_0xb711('0x1a')](function(){return new BPromise(function(_0x40b5c8,_0x28ff30){zipdir(_0x268ba3,{'saveTo':_0x350aff},function(_0x476224,_0x151de0){if(_0x476224)return _0x28ff30(_0x476224);return _0x40b5c8(_0x151de0);});})[_0xb711('0x1a')](function(){return new BPromise(function(_0x4807c0,_0x30a456){rimraf(_0x268ba3,function(_0x576863){if(_0x576863)_0x30a456(_0x576863);return _0x4807c0();});});})[_0xb711('0x1a')](function(){return _0x1b067b[_0xb711('0x51')](_0x350aff,_0xa8fe0f,function(_0x509edf){if(_0x509edf){console['log'](_0xb711('0x64'),_0x509edf);}else{fs[_0xb711('0x65')](_0x350aff);}});});});}else{return _0x1b067b[_0xb711('0x10')](0xc8);}})['catch'](handleError(_0x1b067b,null));}; \ No newline at end of file +var _0x72aa=['key','getOptions','findAll','fax','query','user','catch','show','params','model','filters','intersection','attributes','fields','includeAll','include','merge','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','keys','length','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','setTags','spread','Tag','color','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','createdAt','Messages','basename','existsSync','createReadStream','pipe','resolve','err','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','stack','name','send','index','map','FaxInteraction','fieldName'];(function(_0x379581,_0x1123d9){var _0x5a071e=function(_0x208fbe){while(--_0x208fbe){_0x379581['push'](_0x379581['shift']());}};_0x5a071e(++_0x1123d9);}(_0x72aa,0x1d2));var _0xa72a=function(_0x46415a,_0x15013b){_0x46415a=_0x46415a-0x0;var _0x22a3cd=_0x72aa[_0x46415a];return _0x22a3cd;};'use strict';var rimraf=require(_0xa72a('0x0'));var zipdir=require(_0xa72a('0x1'));var moment=require('moment');var BPromise=require(_0xa72a('0x2'));var util=require(_0xa72a('0x3'));var path=require(_0xa72a('0x4'));var fs=require('fs');var _=require(_0xa72a('0x5'));var Redis=require(_0xa72a('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xa72a('0x7'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xa72a('0x8'))['db'];config[_0xa72a('0x9')]=_[_0xa72a('0xa')](config['redis'],{'host':_0xa72a('0xb'),'port':0x18eb});var socket=require(_0xa72a('0xc'))(new Redis(config[_0xa72a('0x9')]));require('./faxInteraction.socket')[_0xa72a('0xd')](socket);function respondWithStatusCode(_0x1d7bdb,_0x28edf0){_0x28edf0=_0x28edf0||0xcc;return function(_0x28b885){if(_0x28b885){return _0x1d7bdb[_0xa72a('0xe')](_0x28edf0);}return _0x1d7bdb[_0xa72a('0xf')](_0x28edf0)[_0xa72a('0x10')]();};}function respondWithResult(_0x137c8a,_0x21468e){_0x21468e=_0x21468e||0xc8;return function(_0x327647){if(_0x327647){return _0x137c8a[_0xa72a('0xf')](_0x21468e)[_0xa72a('0x11')](_0x327647);}};}function respondWithFilteredResult(_0x1df06b,_0x36ef9b){return function(_0x46a113){if(_0x46a113){var _0x1a4775=typeof _0x36ef9b['offset']===_0xa72a('0x12')&&typeof _0x36ef9b[_0xa72a('0x13')]===_0xa72a('0x12');var _0x5cc7fc=_0x46a113[_0xa72a('0x14')];var _0x39f513=_0x1a4775?0x0:_0x36ef9b['offset'];var _0x23ab47=_0x1a4775?_0x46a113[_0xa72a('0x14')]:_0x36ef9b[_0xa72a('0x15')]+_0x36ef9b[_0xa72a('0x13')];var _0xe4471e;if(_0x23ab47>=_0x5cc7fc){_0x23ab47=_0x5cc7fc;_0xe4471e=0xc8;}else{_0xe4471e=0xce;}_0x1df06b['status'](_0xe4471e);return _0x1df06b[_0xa72a('0x16')](_0xa72a('0x17'),_0x39f513+'-'+_0x23ab47+'/'+_0x5cc7fc)[_0xa72a('0x11')](_0x46a113);}return null;};}function saveUpdates(_0x228db4){return function(_0x55c2ab){if(_0x55c2ab){return _0x55c2ab[_0xa72a('0x18')](_0x228db4)[_0xa72a('0x19')](function(_0x52eb7a){return _0x52eb7a;});}return null;};}function removeEntity(_0x636659){return function(_0x523b9a){if(_0x523b9a){return _0x523b9a[_0xa72a('0x1a')]()[_0xa72a('0x19')](function(){_0x636659[_0xa72a('0xf')](0xcc)[_0xa72a('0x10')]();});}};}function handleEntityNotFound(_0x578332){return function(_0xce28f7){if(!_0xce28f7){_0x578332['sendStatus'](0x194);}return _0xce28f7;};}function handleError(_0x3effa8,_0x359b1a){_0x359b1a=_0x359b1a||0x1f4;return function(_0x11b26f){logger['error'](_0x11b26f[_0xa72a('0x1b')]);if(_0x11b26f[_0xa72a('0x1c')]){delete _0x11b26f[_0xa72a('0x1c')];}_0x3effa8[_0xa72a('0xf')](_0x359b1a)[_0xa72a('0x1d')](_0x11b26f);};}exports[_0xa72a('0x1e')]=function(_0x75eb53,_0x57c32b){var _0x22d264={};var _0x355e02=_[_0xa72a('0x1f')](db[_0xa72a('0x20')]['rawAttributes'],function(_0x141f8e){return{'name':_0x141f8e[_0xa72a('0x21')],'type':_0x141f8e['type'][_0xa72a('0x22')]};});_0x22d264=qs[_0xa72a('0x23')](_0x355e02,_0x75eb53);return interaction[_0xa72a('0x24')](_0xa72a('0x25'),_0x75eb53[_0xa72a('0x26')],_0x75eb53[_0xa72a('0x27')],_0x22d264,_0x355e02)[_0xa72a('0x19')](respondWithFilteredResult(_0x57c32b,_0x22d264))[_0xa72a('0x28')](handleError(_0x57c32b,null));};exports[_0xa72a('0x29')]=function(_0x5273fe,_0x1a8551){var _0xe6f765={'raw':![],'where':{'id':_0x5273fe[_0xa72a('0x2a')]['id']}},_0x5cd07e={};_0x5cd07e[_0xa72a('0x2b')]=_['keys'](db[_0xa72a('0x20')]['rawAttributes']);_0x5cd07e[_0xa72a('0x26')]=_['keys'](_0x5273fe[_0xa72a('0x26')]);_0x5cd07e[_0xa72a('0x2c')]=_[_0xa72a('0x2d')](_0x5cd07e[_0xa72a('0x2b')],_0x5cd07e[_0xa72a('0x26')]);_0xe6f765[_0xa72a('0x2e')]=_[_0xa72a('0x2d')](_0x5cd07e[_0xa72a('0x2b')],qs[_0xa72a('0x2f')](_0x5273fe[_0xa72a('0x26')]['fields']));_0xe6f765[_0xa72a('0x2e')]=_0xe6f765['attributes']['length']?_0xe6f765[_0xa72a('0x2e')]:_0x5cd07e['model'];if(_0x5273fe['query'][_0xa72a('0x30')]){_0xe6f765[_0xa72a('0x31')]=[{'all':!![]}];}_0xe6f765=_[_0xa72a('0x32')]({},_0xe6f765,_0x5273fe['options']);return db[_0xa72a('0x20')][_0xa72a('0x33')](_0xe6f765)[_0xa72a('0x19')](handleEntityNotFound(_0x1a8551,null))['then'](respondWithResult(_0x1a8551,null))[_0xa72a('0x28')](handleError(_0x1a8551,null));};exports[_0xa72a('0x34')]=function(_0xa887f4,_0x189a58){return db[_0xa72a('0x20')][_0xa72a('0x34')](_0xa887f4['body'],{})[_0xa72a('0x19')](respondWithResult(_0x189a58,0xc9))[_0xa72a('0x28')](handleError(_0x189a58,null));};exports[_0xa72a('0x18')]=function(_0x170878,_0x326a95){if(_0x170878['body']['id']){delete _0x170878[_0xa72a('0x35')]['id'];}return db[_0xa72a('0x20')][_0xa72a('0x33')]({'where':{'id':_0x170878[_0xa72a('0x2a')]['id']}})[_0xa72a('0x19')](handleEntityNotFound(_0x326a95,null))[_0xa72a('0x19')](saveUpdates(_0x170878[_0xa72a('0x35')],null))[_0xa72a('0x19')](respondWithResult(_0x326a95,null))[_0xa72a('0x28')](handleError(_0x326a95,null));};exports['destroy']=function(_0x531835,_0xaf3d13){return db[_0xa72a('0x20')][_0xa72a('0x33')]({'where':{'id':_0x531835[_0xa72a('0x2a')]['id']}})['then'](handleEntityNotFound(_0xaf3d13,null))['then'](removeEntity(_0xaf3d13,null))[_0xa72a('0x28')](handleError(_0xaf3d13,null));};exports[_0xa72a('0x36')]=function(_0x5031de,_0x1a201c){return db['FaxInteraction'][_0xa72a('0x36')]()[_0xa72a('0x19')](respondWithResult(_0x1a201c,null))[_0xa72a('0x28')](handleError(_0x1a201c,null));};exports[_0xa72a('0x37')]=function(_0x317818,_0x233991){return db[_0xa72a('0x38')]['find']({'where':{'id':_0x317818[_0xa72a('0x2a')]['id']}})[_0xa72a('0x19')](handleEntityNotFound(_0x233991,null))[_0xa72a('0x19')](function(_0x3eb04f){if(_0x3eb04f){return _0x3eb04f[_0xa72a('0x37')](_0x317818[_0xa72a('0x35')][_0xa72a('0x39')],_[_0xa72a('0x3a')](_0x317818[_0xa72a('0x35')],[_0xa72a('0x39'),'id'])||{});}})[_0xa72a('0x19')](respondWithResult(_0x233991,null))[_0xa72a('0x28')](handleError(_0x233991,null));};exports[_0xa72a('0x3b')]=function(_0x2b3f50,_0x3f99a0){var _0x3e9ad4={'raw':![],'where':{}};var _0x225a61={};var _0x2d6ea5={'count':0x0,'rows':[]};return db[_0xa72a('0x20')]['findOne']({'where':{'id':_0x2b3f50['params']['id']}})[_0xa72a('0x19')](handleEntityNotFound(_0x3f99a0,null))[_0xa72a('0x19')](function(_0x482348){if(_0x482348){_0x225a61['model']=_[_0xa72a('0x3c')](db[_0xa72a('0x38')]['rawAttributes']);_0x225a61[_0xa72a('0x26')]=_['keys'](_0x2b3f50[_0xa72a('0x26')]);_0x225a61[_0xa72a('0x2c')]=_[_0xa72a('0x2d')](_0x225a61[_0xa72a('0x2b')],_0x225a61[_0xa72a('0x26')]);_0x3e9ad4[_0xa72a('0x2e')]=_['intersection'](_0x225a61['model'],qs['fields'](_0x2b3f50[_0xa72a('0x26')]['fields']));_0x3e9ad4[_0xa72a('0x2e')]=_0x3e9ad4[_0xa72a('0x2e')][_0xa72a('0x3d')]?_0x3e9ad4[_0xa72a('0x2e')]:_0x225a61[_0xa72a('0x2b')];if(!_0x2b3f50['query'][_0xa72a('0x3e')](_0xa72a('0x3f'))){_0x3e9ad4[_0xa72a('0x13')]=qs[_0xa72a('0x13')](_0x2b3f50[_0xa72a('0x26')][_0xa72a('0x13')]);_0x3e9ad4[_0xa72a('0x15')]=qs[_0xa72a('0x15')](_0x2b3f50[_0xa72a('0x26')]['offset']);}_0x3e9ad4[_0xa72a('0x40')]=qs['sort'](_0x2b3f50[_0xa72a('0x26')][_0xa72a('0x41')]);_0x3e9ad4[_0xa72a('0x42')]=qs[_0xa72a('0x2c')](_['pick'](_0x2b3f50[_0xa72a('0x26')],_0x225a61[_0xa72a('0x2c')]));_0x3e9ad4[_0xa72a('0x42')][_0xa72a('0x43')]=_0x482348['id'];if(_0x2b3f50[_0xa72a('0x26')]['filter']){_0x3e9ad4[_0xa72a('0x42')]=_[_0xa72a('0x32')](_0x3e9ad4['where'],{'$or':_[_0xa72a('0x1f')](_0x3e9ad4[_0xa72a('0x2e')],function(_0x42d417){var _0x323f1f={};_0x323f1f[_0x42d417]={'$like':'%'+_0x2b3f50[_0xa72a('0x26')][_0xa72a('0x44')]+'%'};return _0x323f1f;})});}if(_0x2b3f50[_0xa72a('0x26')][_0xa72a('0x45')]){var _0x5ab7d9=_0x2b3f50[_0xa72a('0x26')]['$gte'][_0xa72a('0x46')](',');var _0x2890a3={};_0x2890a3[_0x5ab7d9[0x0]]={'$gte':moment(_0x5ab7d9[0x1])[_0xa72a('0x47')](_0xa72a('0x48'))};_0x3e9ad4['where']=_[_0xa72a('0x32')](_0x3e9ad4[_0xa72a('0x42')],_0x2890a3);}_0x3e9ad4=_['merge']({},_0x3e9ad4,_0x2b3f50[_0xa72a('0x49')]);return db[_0xa72a('0x38')][_0xa72a('0x14')]({'where':_0x3e9ad4[_0xa72a('0x42')]})[_0xa72a('0x19')](function(_0x928558){_0x2d6ea5[_0xa72a('0x14')]=_0x928558;if(_0x2b3f50[_0xa72a('0x26')]['includeAll']){_0x3e9ad4[_0xa72a('0x31')]=[{'all':!![]}];}return db['FaxMessage'][_0xa72a('0x24')](_0x3e9ad4);})[_0xa72a('0x19')](function(_0x2b502b){_0x2d6ea5[_0xa72a('0x4a')]=_0x2b502b;return _0x2d6ea5;});}})[_0xa72a('0x19')](respondWithFilteredResult(_0x3f99a0,_0x3e9ad4))[_0xa72a('0x28')](handleError(_0x3f99a0,null));};exports['addTags']=function(_0x16119f,_0x2cfc73){return db[_0xa72a('0x20')][_0xa72a('0x33')]({'where':{'id':_0x16119f[_0xa72a('0x2a')]['id']}})[_0xa72a('0x19')](handleEntityNotFound(_0x2cfc73,null))[_0xa72a('0x19')](function(_0x5a8fca){if(_0x5a8fca){return _0x5a8fca[_0xa72a('0x4b')](_0x16119f[_0xa72a('0x35')][_0xa72a('0x39')],_[_0xa72a('0x3a')](_0x16119f['body'],[_0xa72a('0x39'),'id'])||{})[_0xa72a('0x4c')](function(){return db[_0xa72a('0x4d')][_0xa72a('0x24')]({'attributes':['id',_0xa72a('0x1c'),_0xa72a('0x4e')],'where':{'id':_0x16119f['body'][_0xa72a('0x39')]}});})[_0xa72a('0x19')](function(_0x10f816){socket['emit'](_0xa72a('0x4f'),{'id':Number(_0x16119f[_0xa72a('0x2a')]['id']),'tags':_0x10f816||[]});return{'id':Number(_0x16119f['params']['id']),'tags':_0x10f816||[]};});}})['then'](respondWithResult(_0x2cfc73,null))[_0xa72a('0x28')](handleError(_0x2cfc73,null));};exports[_0xa72a('0x50')]=function(_0x54dc25,_0x402389){return db[_0xa72a('0x20')][_0xa72a('0x33')]({'where':{'id':_0x54dc25['params']['id']}})[_0xa72a('0x19')](handleEntityNotFound(_0x402389,null))[_0xa72a('0x19')](function(_0x4dfbe2){if(_0x4dfbe2){return _0x4dfbe2['removeTags'](_0x54dc25[_0xa72a('0x26')][_0xa72a('0x39')]);}})[_0xa72a('0x19')](respondWithStatusCode(_0x402389,null))[_0xa72a('0x28')](handleError(_0x402389,null));};exports[_0xa72a('0x51')]=function(_0x4ea4ce,_0x26a27e){var _0x4bb9c4=moment()[_0xa72a('0x52')]()[_0xa72a('0x53')]();var _0x40f6b3=path[_0xa72a('0x54')](config[_0xa72a('0x55')],_0xa72a('0x56'),_0xa72a('0x57'),_0xa72a('0x58'));var _0x5fc803=path[_0xa72a('0x54')](config[_0xa72a('0x55')],'server',_0xa72a('0x57'),_0xa72a('0x59'));var _0x53a3a7=path[_0xa72a('0x54')](_0x40f6b3,_0x4bb9c4);var _0x5e3167=util[_0xa72a('0x47')](_0xa72a('0x5a'),_0x4ea4ce[_0xa72a('0x2a')]['id'],_0x4bb9c4);var _0x92a12d=path[_0xa72a('0x54')](_0x40f6b3,_0x5e3167);var _0x1d8be8=[];_0x1d8be8['push']({'model':db[_0xa72a('0x5b')],'as':_0xa72a('0x5b'),'raw':!![]});var _0xbb4a43=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0xa72a('0x35'),_0xa72a('0x5c')],'include':_0x1d8be8}];return db[_0xa72a('0x20')][_0xa72a('0x33')]({'where':{'id':_0x4ea4ce[_0xa72a('0x2a')]['id']},'include':_0xbb4a43})['then'](handleEntityNotFound(_0x26a27e,null))['then'](function(_0x1ae5fe){if(_0x1ae5fe&&_0x1ae5fe['Messages']){var _0x28c2f2=_0x1ae5fe['get']({'plain':!![]});fs['mkdirSync'](_0x53a3a7);for(var _0x3d5d5d=0x0;_0x3d5d5d<_0x28c2f2['Messages'][_0xa72a('0x3d')];_0x3d5d5d++){var _0x40c928=_0x28c2f2[_0xa72a('0x5d')][_0x3d5d5d][_0xa72a('0x5b')];if(_0x40c928){var _0x19c447=path[_0xa72a('0x54')](_0x5fc803,_0x40c928[_0xa72a('0x5e')]);if(fs[_0xa72a('0x5f')](_0x19c447)){fs[_0xa72a('0x60')](_0x19c447)[_0xa72a('0x61')](fs['createWriteStream'](path[_0xa72a('0x54')](_0x53a3a7,_0x40c928['basename'])));}}}return BPromise[_0xa72a('0x62')]()[_0xa72a('0x19')](function(){return new BPromise(function(_0x4942f2,_0x46924b){zipdir(_0x53a3a7,{'saveTo':_0x92a12d},function(_0x493abe,_0x2665a9){if(_0x493abe)return _0x46924b(_0x493abe);return _0x4942f2(_0x2665a9);});})[_0xa72a('0x19')](function(){return new BPromise(function(_0x4d5c4e,_0x5680b3){rimraf(_0x53a3a7,function(_0x2af5a0){if(_0x2af5a0)_0x5680b3(_0x2af5a0);return _0x4d5c4e();});});})[_0xa72a('0x19')](function(){return _0x26a27e[_0xa72a('0x51')](_0x92a12d,_0x5e3167,function(_0x4d35b5){if(_0x4d35b5){console['log'](_0xa72a('0x63'),_0x4d35b5);}else{fs['unlinkSync'](_0x92a12d);}});});});}else{return _0x26a27e['sendStatus'](0xc8);}})[_0xa72a('0x28')](handleError(_0x26a27e,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4db35cd..692838b 100644 --- a/server/api/faxInteraction/faxInteraction.events.js +++ b/server/api/faxInteraction/faxInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4f6=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4f6,0x115));var _0x6c4f=function(_0x2db2b3,_0x486a55){_0x2db2b3=_0x2db2b3-0x0;var _0xe435ac=_0xc4f6[_0x2db2b3];return _0xe435ac;};'use strict';var EventEmitter=require(_0x6c4f('0x0'));var FaxInteraction=require(_0x6c4f('0x1'))['db'][_0x6c4f('0x2')];var FaxMessage=require(_0x6c4f('0x1'))['db'][_0x6c4f('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6c4f('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6c4f('0x5'),'afterDestroy':_0x6c4f('0x6')};function emitEvent(_0x56fbf8){return function(_0x52e83f,_0x8bf871,_0x5318a0){_0x52e83f[_0x6c4f('0x7')]({'attributes':['id'],'raw':!![]})[_0x6c4f('0x8')](function(_0x4e7c6c){_0x52e83f[_0x6c4f('0x9')](_0x6c4f('0xa'),_0x4e7c6c[_0x6c4f('0xb')](function(_0x483146){return{'id':_0x483146['id']};}));return FaxMessage[_0x6c4f('0xc')]({'where':{'FaxInteractionId':_0x52e83f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6c4f('0x8')](function(_0x5ceb0f){_0x52e83f[_0x6c4f('0x9')](_0x6c4f('0xd'),_0x5ceb0f[_0x6c4f('0xe')]);FaxInteractionEvents[_0x6c4f('0xf')](_0x56fbf8+':'+_0x52e83f['id'],_0x52e83f);FaxInteractionEvents[_0x6c4f('0xf')](_0x56fbf8,_0x52e83f);_0x5318a0(null);})[_0x6c4f('0x10')](_0x5318a0(null));};}for(var e in events){if(events[_0x6c4f('0x11')](e)){var event=events[e];FaxInteraction[_0x6c4f('0x12')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x34de=['FaxInteraction','setMaxListeners','update','remove','then','Users','emit','catch','hook','exports','../../mysqldb'];(function(_0x2e627c,_0x5c0435){var _0x3c8fe9=function(_0x4c6028){while(--_0x4c6028){_0x2e627c['push'](_0x2e627c['shift']());}};_0x3c8fe9(++_0x5c0435);}(_0x34de,0x1c2));var _0xe34d=function(_0x58a62b,_0x37bf42){_0x58a62b=_0x58a62b-0x0;var _0x104020=_0x34de[_0x58a62b];return _0x104020;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xe34d('0x0'))['db'][_0xe34d('0x1')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe34d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe34d('0x3'),'afterDestroy':_0xe34d('0x4')};function emitEvent(_0x537c6a){return function(_0x3a71ac,_0x14995a,_0x35937e){_0x3a71ac['getUsers']({'attributes':['id'],'raw':!![]})[_0xe34d('0x5')](function(_0x257b89){_0x3a71ac['setDataValue'](_0xe34d('0x6'),_0x257b89['map'](function(_0x8d65d6){return{'id':_0x8d65d6['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3a71ac['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe34d('0x5')](function(_0x270d36){_0x3a71ac['setDataValue']('unreadMessages',_0x270d36['length']);FaxInteractionEvents['emit'](_0x537c6a+':'+_0x3a71ac['id'],_0x3a71ac);FaxInteractionEvents[_0xe34d('0x7')](_0x537c6a,_0x3a71ac);_0x35937e(null);})[_0xe34d('0x8')](_0x35937e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xe34d('0x9')](e,emitEvent(event));}}module[_0xe34d('0xa')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index a1cb08a..0a9368e 100644 --- a/server/api/faxInteraction/faxInteraction.model.js +++ b/server/api/faxInteraction/faxInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce79=['api','moment','bluebird','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','lodash','util'];(function(_0x5ae501,_0x378179){var _0x242d92=function(_0x1ac83a){while(--_0x1ac83a){_0x5ae501['push'](_0x5ae501['shift']());}};_0x242d92(++_0x378179);}(_0xce79,0xc2));var _0x9ce7=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0xce79[_0x4b4b0e];return _0x4c2d91;};'use strict';var _=require(_0x9ce7('0x0'));var util=require(_0x9ce7('0x1'));var logger=require('../../config/logger')(_0x9ce7('0x2'));var moment=require(_0x9ce7('0x3'));var BPromise=require(_0x9ce7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ce7('0x5'));var attributes=require(_0x9ce7('0x6'));module[_0x9ce7('0x7')]=function(_0x6b9896,_0x3cdf23){return _0x6b9896['define'](_0x9ce7('0x8'),attributes,{'tableName':_0x9ce7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x593e40,_0x5832c4,_0x5d4415){if(_0x593e40[_0x9ce7('0xa')](_0x9ce7('0xb'))){_0x593e40[_0x9ce7('0xc')]=moment()[_0x9ce7('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5d4415(null,_0x593e40);}}});}; \ No newline at end of file +var _0x9172=['FaxInteraction','fax_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','api','moment','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define'];(function(_0x2300fa,_0x41c382){var _0x11fef0=function(_0x597ffb){while(--_0x597ffb){_0x2300fa['push'](_0x2300fa['shift']());}};_0x11fef0(++_0x41c382);}(_0x9172,0x1a5));var _0x2917=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x9172[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2917('0x0'));var moment=require(_0x2917('0x1'));var BPromise=require('bluebird');var rp=require(_0x2917('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2917('0x3'));var config=require(_0x2917('0x4'));var attributes=require(_0x2917('0x5'));module[_0x2917('0x6')]=function(_0x2df3d0,_0x36b35d){return _0x2df3d0[_0x2917('0x7')](_0x2917('0x8'),attributes,{'tableName':_0x2917('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1265f,_0x6bce6b,_0x181d98){if(_0x1265f['changed'](_0x2917('0xa'))){_0x1265f['closedAt']=moment()[_0x2917('0xb')](_0x2917('0xc'));}_0x181d98(null,_0x1265f);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index df2466d..cbdedd4 100644 --- a/server/api/faxInteraction/faxInteraction.rpc.js +++ b/server/api/faxInteraction/faxInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf3e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','raw','options','limit','debug','find','where','ids','omit','spread','AddTags','lodash','util','bluebird'];(function(_0x31ea6f,_0x5d2e87){var _0x164b40=function(_0x5d1924){while(--_0x5d1924){_0x31ea6f['push'](_0x31ea6f['shift']());}};_0x164b40(++_0x5d2e87);}(_0xbf3e,0x12a));var _0xebf3=function(_0x394f38,_0x284410){_0x394f38=_0x394f38-0x0;var _0x135f8d=_0xbf3e[_0x394f38];return _0x135f8d;};'use strict';var _=require(_0xebf3('0x0'));var util=require(_0xebf3('0x1'));var moment=require('moment');var BPromise=require(_0xebf3('0x2'));var rs=require(_0xebf3('0x3'));var fs=require('fs');var Redis=require(_0xebf3('0x4'));var db=require(_0xebf3('0x5'))['db'];var utils=require(_0xebf3('0x6'));var logger=require(_0xebf3('0x7'))('rpc');var config=require(_0xebf3('0x8'));var jayson=require(_0xebf3('0x9'));var client=jayson[_0xebf3('0xa')][_0xebf3('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xebf3('0xc')],{'host':_0xebf3('0xd'),'port':0x18eb});var socket=require(_0xebf3('0xe'))(new Redis(config[_0xebf3('0xc')]));require(_0xebf3('0xf'))[_0xebf3('0x10')](socket);function respondWithRpcPromise(_0x2bbfd7,_0x1922b4,_0x460d9f){return new BPromise(function(_0x235bff,_0x52e0e4){return client[_0xebf3('0x11')](_0x2bbfd7,_0x460d9f)[_0xebf3('0x12')](function(_0x16a7d0){logger[_0xebf3('0x13')](_0xebf3('0x14'),_0x1922b4,_0xebf3('0x15'));logger['debug'](_0xebf3('0x16'),_0x1922b4,_0xebf3('0x15'),JSON[_0xebf3('0x17')](_0x16a7d0));if(_0x16a7d0['error']){if(_0x16a7d0[_0xebf3('0x18')][_0xebf3('0x19')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x1922b4,_0x16a7d0[_0xebf3('0x18')][_0xebf3('0x1a')]);return _0x52e0e4(_0x16a7d0[_0xebf3('0x18')]['message']);}logger[_0xebf3('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x1922b4,_0x16a7d0['error'][_0xebf3('0x1a')]);return _0x235bff(_0x16a7d0[_0xebf3('0x18')]['message']);}else{logger[_0xebf3('0x13')](_0xebf3('0x14'),_0x1922b4,_0xebf3('0x15'));_0x235bff(_0x16a7d0[_0xebf3('0x1b')]['message']);}})[_0xebf3('0x1c')](function(_0x11dd67){logger[_0xebf3('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x1922b4,_0x11dd67);_0x52e0e4(_0x11dd67);});});}exports[_0xebf3('0x1d')]=function(_0x5f4e1f){var _0x1de502=this;return new Promise(function(_0x3aedd9,_0x169dd3){return db[_0xebf3('0x1e')][_0xebf3('0x1f')](_0x5f4e1f[_0xebf3('0x20')],{'raw':_0x5f4e1f['options']?_0x5f4e1f['options'][_0xebf3('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f4e1f[_0xebf3('0x22')]?_0x5f4e1f['options']['where']||null:null,'attributes':_0x5f4e1f[_0xebf3('0x22')]?_0x5f4e1f[_0xebf3('0x22')]['attributes']||null:null,'limit':_0x5f4e1f['options']?_0x5f4e1f[_0xebf3('0x22')][_0xebf3('0x23')]||null:null})[_0xebf3('0x12')](function(_0x8f000){logger['info'](_0xebf3('0x1d'),_0x5f4e1f);logger[_0xebf3('0x24')](_0xebf3('0x1d'),_0x5f4e1f,JSON[_0xebf3('0x17')](_0x8f000));_0x3aedd9(_0x8f000);})[_0xebf3('0x1c')](function(_0x2ad0c5){logger['error'](_0xebf3('0x1d'),_0x2ad0c5['message'],_0x5f4e1f);_0x169dd3(_0x1de502[_0xebf3('0x18')](0x1f4,_0x2ad0c5[_0xebf3('0x1a')]));});});};exports['AddTagsToFaxInteraction']=function(_0x38aa3e){return new Promise(function(_0x3c8d98,_0x2dd2d4){return db[_0xebf3('0x1e')][_0xebf3('0x25')]({'where':_0x38aa3e[_0xebf3('0x22')]?_0x38aa3e[_0xebf3('0x22')][_0xebf3('0x26')]||null:null})[_0xebf3('0x12')](function(_0x54653e){if(_0x54653e){return _0x54653e['addTags'](_0x38aa3e[_0xebf3('0x20')][_0xebf3('0x27')],_[_0xebf3('0x28')](_0x38aa3e[_0xebf3('0x20')],[_0xebf3('0x27'),'id'])||{});}})[_0xebf3('0x29')](function(_0x456f29){logger[_0xebf3('0x13')](_0xebf3('0x2a'),_0x38aa3e);logger[_0xebf3('0x24')]('AddTags',_0x38aa3e,JSON[_0xebf3('0x17')](_0x456f29));_0x3c8d98(_0x456f29);})[_0xebf3('0x1c')](function(_0x391a46){logger['error'](_0xebf3('0x2a'),_0x391a46['message'],_0x38aa3e);_0x2dd2d4(_this['error'](0x1f4,_0x391a46[_0xebf3('0x1a')]));});});}; \ No newline at end of file +var _0x0def=['find','addTags','body','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','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','result','UpdateFaxInteraction','FaxInteraction','update','options','raw','attributes','limit','stringify','catch','AddTagsToFaxInteraction'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0def,0x177));var _0xf0de=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x0def[_0x390733];return _0x33beb9;};'use strict';var _=require('lodash');var util=require(_0xf0de('0x0'));var moment=require(_0xf0de('0x1'));var BPromise=require(_0xf0de('0x2'));var rs=require(_0xf0de('0x3'));var fs=require('fs');var Redis=require(_0xf0de('0x4'));var db=require(_0xf0de('0x5'))['db'];var utils=require(_0xf0de('0x6'));var logger=require(_0xf0de('0x7'))(_0xf0de('0x8'));var config=require(_0xf0de('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf0de('0xa')]({'port':0x232a});config[_0xf0de('0xb')]=_[_0xf0de('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf0de('0xd'))(new Redis(config[_0xf0de('0xb')]));require(_0xf0de('0xe'))['register'](socket);function respondWithRpcPromise(_0xc1d611,_0x5b8f07,_0x1d9f40){return new BPromise(function(_0x268ca2,_0x26f912){return client['request'](_0xc1d611,_0x1d9f40)[_0xf0de('0xf')](function(_0x5e342c){logger[_0xf0de('0x10')](_0xf0de('0x11'),_0x5b8f07,_0xf0de('0x12'));logger[_0xf0de('0x13')](_0xf0de('0x14'),_0x5b8f07,'request\x20sent',JSON['stringify'](_0x5e342c));if(_0x5e342c[_0xf0de('0x15')]){if(_0x5e342c[_0xf0de('0x15')][_0xf0de('0x16')]===0x1f4){logger['error'](_0xf0de('0x11'),_0x5b8f07,_0x5e342c['error'][_0xf0de('0x17')]);return _0x26f912(_0x5e342c['error'][_0xf0de('0x17')]);}logger[_0xf0de('0x15')](_0xf0de('0x11'),_0x5b8f07,_0x5e342c[_0xf0de('0x15')][_0xf0de('0x17')]);return _0x268ca2(_0x5e342c[_0xf0de('0x15')][_0xf0de('0x17')]);}else{logger[_0xf0de('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x5b8f07,'request\x20sent');_0x268ca2(_0x5e342c[_0xf0de('0x18')]['message']);}})['catch'](function(_0x43b939){logger[_0xf0de('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x5b8f07,_0x43b939);_0x26f912(_0x43b939);});});}exports[_0xf0de('0x19')]=function(_0x4c7d22){var _0x662aa2=this;return new Promise(function(_0x2a012a,_0x5d1377){return db[_0xf0de('0x1a')][_0xf0de('0x1b')](_0x4c7d22['body'],{'raw':_0x4c7d22[_0xf0de('0x1c')]?_0x4c7d22[_0xf0de('0x1c')][_0xf0de('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c7d22[_0xf0de('0x1c')]?_0x4c7d22[_0xf0de('0x1c')]['where']||null:null,'attributes':_0x4c7d22[_0xf0de('0x1c')]?_0x4c7d22[_0xf0de('0x1c')][_0xf0de('0x1e')]||null:null,'limit':_0x4c7d22[_0xf0de('0x1c')]?_0x4c7d22['options'][_0xf0de('0x1f')]||null:null})[_0xf0de('0xf')](function(_0x42a039){logger[_0xf0de('0x10')](_0xf0de('0x19'),_0x4c7d22);logger[_0xf0de('0x13')]('UpdateFaxInteraction',_0x4c7d22,JSON[_0xf0de('0x20')](_0x42a039));_0x2a012a(_0x42a039);})[_0xf0de('0x21')](function(_0x21a14b){logger[_0xf0de('0x15')](_0xf0de('0x19'),_0x21a14b[_0xf0de('0x17')],_0x4c7d22);_0x5d1377(_0x662aa2[_0xf0de('0x15')](0x1f4,_0x21a14b['message']));});});};exports[_0xf0de('0x22')]=function(_0x37d588){return new Promise(function(_0x6bad91,_0x2719af){return db['FaxInteraction'][_0xf0de('0x23')]({'where':_0x37d588['options']?_0x37d588[_0xf0de('0x1c')]['where']||null:null})[_0xf0de('0xf')](function(_0x4fc5f8){if(_0x4fc5f8){return _0x4fc5f8[_0xf0de('0x24')](_0x37d588[_0xf0de('0x25')][_0xf0de('0x26')],_['omit'](_0x37d588[_0xf0de('0x25')],[_0xf0de('0x26'),'id'])||{});}})[_0xf0de('0x27')](function(_0x3cb5c8){logger[_0xf0de('0x10')](_0xf0de('0x28'),_0x37d588);logger[_0xf0de('0x13')](_0xf0de('0x28'),_0x37d588,JSON[_0xf0de('0x20')](_0x3cb5c8));_0x6bad91(_0x3cb5c8);})[_0xf0de('0x21')](function(_0x53394d){logger['error'](_0xf0de('0x28'),_0x53394d['message'],_0x37d588);_0x2719af(_this[_0xf0de('0x15')](0x1f4,_0x53394d[_0xf0de('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 196b969..baedf52 100644 --- a/server/api/faxInteraction/faxInteraction.socket.js +++ b/server/api/faxInteraction/faxInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e57=['register','length','faxInteraction:','./faxInteraction.events','remove','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6e57,0x153));var _0x76e5=function(_0x16fe11,_0x54962f){_0x16fe11=_0x16fe11-0x0;var _0x2e18f6=_0x6e57[_0x16fe11];return _0x2e18f6;};'use strict';var FaxInteractionEvents=require(_0x76e5('0x0'));var events=['save',_0x76e5('0x1'),_0x76e5('0x2')];function createListener(_0x331dd1,_0x250c6d){return function(_0xe71195){_0x250c6d['emit'](_0x331dd1,_0xe71195);};}function removeListener(_0x1edc03,_0x303044){return function(){FaxInteractionEvents['removeListener'](_0x1edc03,_0x303044);};}exports[_0x76e5('0x3')]=function(_0x13a7ad){for(var _0x2125e4=0x0,_0x483f1e=events[_0x76e5('0x4')];_0x2125e4<_0x483f1e;_0x2125e4++){var _0x50acb8=events[_0x2125e4];var _0x226eb4=createListener(_0x76e5('0x5')+_0x50acb8,_0x13a7ad);FaxInteractionEvents['on'](_0x50acb8,_0x226eb4);}}; \ No newline at end of file +var _0xf08a=['remove','update','emit','removeListener','register','length','./faxInteraction.events','save'];(function(_0x4fc975,_0xbf1959){var _0x1510da=function(_0x5b8d7c){while(--_0x5b8d7c){_0x4fc975['push'](_0x4fc975['shift']());}};_0x1510da(++_0xbf1959);}(_0xf08a,0x106));var _0xaf08=function(_0x5d7770,_0x581d65){_0x5d7770=_0x5d7770-0x0;var _0x4ba61c=_0xf08a[_0x5d7770];return _0x4ba61c;};'use strict';var FaxInteractionEvents=require(_0xaf08('0x0'));var events=[_0xaf08('0x1'),_0xaf08('0x2'),_0xaf08('0x3')];function createListener(_0x10cb2c,_0x47ec99){return function(_0x2242f5){_0x47ec99[_0xaf08('0x4')](_0x10cb2c,_0x2242f5);};}function removeListener(_0x304367,_0x4ddee8){return function(){FaxInteractionEvents[_0xaf08('0x5')](_0x304367,_0x4ddee8);};}exports[_0xaf08('0x6')]=function(_0x20757e){for(var _0x32a64d=0x0,_0x1c9bfa=events[_0xaf08('0x7')];_0x32a64d<_0x1c9bfa;_0x32a64d++){var _0x22a0c2=events[_0x32a64d];var _0x16dc83=createListener('faxInteraction:'+_0x22a0c2,_0x20757e);FaxInteractionEvents['on'](_0x22a0c2,_0x16dc83);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index fac6ed1..8c37028 100644 --- a/server/api/faxInteraction/index.js +++ b/server/api/faxInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3fe=['express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','download','post','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','multer','util'];(function(_0x519a91,_0x271c3d){var _0xa9cc20=function(_0x522eeb){while(--_0x522eeb){_0x519a91['push'](_0x519a91['shift']());}};_0xa9cc20(++_0x271c3d);}(_0xa3fe,0x102));var _0xea3f=function(_0x344ed7,_0x56a3b4){_0x344ed7=_0x344ed7-0x0;var _0x29a318=_0xa3fe[_0x344ed7];return _0x29a318;};'use strict';var multer=require(_0xea3f('0x0'));var util=require(_0xea3f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xea3f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xea3f('0x3'));var interaction=require(_0xea3f('0x4'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0xea3f('0x5')]('/',auth[_0xea3f('0x6')](),controller[_0xea3f('0x7')]);router[_0xea3f('0x5')](_0xea3f('0x8'),auth[_0xea3f('0x6')](),controller[_0xea3f('0x9')]);router[_0xea3f('0x5')](_0xea3f('0xa'),auth[_0xea3f('0x6')](),controller['show']);router['get'](_0xea3f('0xb'),auth[_0xea3f('0x6')](),controller[_0xea3f('0xc')]);router[_0xea3f('0x5')]('/:id/download',auth[_0xea3f('0x6')](),controller[_0xea3f('0xd')]);router[_0xea3f('0xe')]('/',auth[_0xea3f('0x6')](),controller['create']);router[_0xea3f('0xe')](_0xea3f('0xb'),auth[_0xea3f('0x6')](),controller['addMessage']);router[_0xea3f('0xe')](_0xea3f('0xf'),auth['isAuthenticated'](),interaction[_0xea3f('0x10')](_0xea3f('0x11'),_0xea3f('0x12')),controller[_0xea3f('0x13')]);router[_0xea3f('0x14')](_0xea3f('0xa'),auth[_0xea3f('0x6')](),interaction[_0xea3f('0x10')](_0xea3f('0x11'),_0xea3f('0x15')),controller[_0xea3f('0x16')]);router[_0xea3f('0x17')](_0xea3f('0xa'),auth['isAuthenticated'](),interaction[_0xea3f('0x10')](_0xea3f('0x11'),_0xea3f('0x18')),controller['destroy']);router[_0xea3f('0x17')](_0xea3f('0xf'),auth['isAuthenticated'](),controller[_0xea3f('0x19')]);module['exports']=router; \ No newline at end of file +var _0xc3f0=['show','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','fax','faxinteraction:addtags','put','faxinteraction:update','delete','tracked','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc3f0,0xac));var _0x0c3f=function(_0x5a34bf,_0x26ec3a){_0x5a34bf=_0x5a34bf-0x0;var _0x213944=_0xc3f0[_0x5a34bf];return _0x213944;};'use strict';var multer=require(_0x0c3f('0x0'));var util=require(_0x0c3f('0x1'));var path=require(_0x0c3f('0x2'));var timeout=require(_0x0c3f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0c3f('0x4'));var auth=require(_0x0c3f('0x5'));var interaction=require(_0x0c3f('0x6'));var config=require('../../config/environment');var controller=require(_0x0c3f('0x7'));router[_0x0c3f('0x8')]('/',auth[_0x0c3f('0x9')](),controller[_0x0c3f('0xa')]);router['get'](_0x0c3f('0xb'),auth[_0x0c3f('0x9')](),controller[_0x0c3f('0xc')]);router['get'](_0x0c3f('0xd'),auth[_0x0c3f('0x9')](),controller[_0x0c3f('0xe')]);router[_0x0c3f('0x8')]('/:id/messages',auth[_0x0c3f('0x9')](),controller['getMessages']);router[_0x0c3f('0x8')](_0x0c3f('0xf'),auth[_0x0c3f('0x9')](),controller[_0x0c3f('0x10')]);router[_0x0c3f('0x11')]('/',auth[_0x0c3f('0x9')](),controller[_0x0c3f('0x12')]);router[_0x0c3f('0x11')](_0x0c3f('0x13'),auth[_0x0c3f('0x9')](),controller[_0x0c3f('0x14')]);router[_0x0c3f('0x11')](_0x0c3f('0x15'),auth[_0x0c3f('0x9')](),interaction['tracked'](_0x0c3f('0x16'),_0x0c3f('0x17')),controller['addTags']);router[_0x0c3f('0x18')](_0x0c3f('0xd'),auth[_0x0c3f('0x9')](),interaction['tracked']('fax',_0x0c3f('0x19')),controller['update']);router[_0x0c3f('0x1a')](_0x0c3f('0xd'),auth[_0x0c3f('0x9')](),interaction[_0x0c3f('0x1b')](_0x0c3f('0x16'),_0x0c3f('0x1c')),controller['destroy']);router[_0x0c3f('0x1a')](_0x0c3f('0x15'),auth['isAuthenticated'](),controller[_0x0c3f('0x1d')]);module[_0x0c3f('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index cd5806d..ab31039 100644 --- a/server/api/faxMessage/faxMessage.attributes.js +++ b/server/api/faxMessage/faxMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde6c=['DATE','sequelize','exports','medium','BOOLEAN','ENUM','out','TEXT'];(function(_0x422600,_0x10ffa5){var _0x1a7e3f=function(_0x495309){while(--_0x495309){_0x422600['push'](_0x422600['shift']());}};_0x1a7e3f(++_0x10ffa5);}(_0xde6c,0x119));var _0xcde6=function(_0x4f9b3a,_0x4b31a2){_0x4f9b3a=_0x4f9b3a-0x0;var _0x10cb16=_0xde6c[_0x4f9b3a];return _0x10cb16;};'use strict';var Sequelize=require(_0xcde6('0x0'));module[_0xcde6('0x1')]={'body':{'type':Sequelize['TEXT'](_0xcde6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcde6('0x4')]('in',_0xcde6('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xcde6('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0xcde6('0x7')]}}; \ No newline at end of file +var _0x3248=['exports','BOOLEAN','ENUM','out','TEXT','DATE'];(function(_0x1292e9,_0x2a7113){var _0x119cb7=function(_0xa320a0){while(--_0xa320a0){_0x1292e9['push'](_0x1292e9['shift']());}};_0x119cb7(++_0x2a7113);}(_0x3248,0x1bc));var _0x8324=function(_0x397845,_0x5568da){_0x397845=_0x397845-0x0;var _0x2f1b6a=_0x3248[_0x397845];return _0x2f1b6a;};'use strict';var Sequelize=require('sequelize');module[_0x8324('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8324('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8324('0x2')]('in',_0x8324('0x3')),'defaultValue':_0x8324('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8324('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8324('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 52c460b..943edca 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8df2=['get','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','manual','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','fax-interactions','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','internal','motionChannel','reject','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','join','root','server','files','attachments','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','FaxMessage','includeAll','include','findAll','show','params','keys','find','body','describe','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent'];(function(_0x209d30,_0x5db27a){var _0x4b8517=function(_0x5ba94d){while(--_0x5ba94d){_0x209d30['push'](_0x209d30['shift']());}};_0x4b8517(++_0x5db27a);}(_0x8df2,0xc8));var _0x28df=function(_0x4774f4,_0x9d61f4){_0x4774f4=_0x4774f4-0x0;var _0x11d876=_0x8df2[_0x4774f4];return _0x11d876;};'use strict';var emlformat=require(_0x28df('0x0'));var rimraf=require(_0x28df('0x1'));var zipdir=require(_0x28df('0x2'));var jsonpatch=require(_0x28df('0x3'));var rp=require(_0x28df('0x4'));var moment=require(_0x28df('0x5'));var BPromise=require(_0x28df('0x6'));var Mustache=require('mustache');var util=require(_0x28df('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x28df('0x8'));var ejs=require(_0x28df('0x9'));var fs=require('fs');var fs_extra=require(_0x28df('0xa'));var _=require(_0x28df('0xb'));var squel=require(_0x28df('0xc'));var crypto=require('crypto');var jsforce=require(_0x28df('0xd'));var deskjs=require(_0x28df('0xe'));var toCsv=require(_0x28df('0x8'));var querystring=require('querystring');var Papa=require(_0x28df('0xf'));var Redis=require(_0x28df('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x28df('0x11'));var as=require(_0x28df('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28df('0x13'))(_0x28df('0x14'));var utils=require(_0x28df('0x15'));var config=require(_0x28df('0x16'));var licenseUtil=require(_0x28df('0x17'));var db=require(_0x28df('0x18'))['db'];config[_0x28df('0x19')]=_[_0x28df('0x1a')](config['redis'],{'host':_0x28df('0x1b'),'port':0x18eb});var socket=require(_0x28df('0x1c'))(new Redis(config[_0x28df('0x19')]));require(_0x28df('0x1d'))[_0x28df('0x1e')](socket);var jayson=require(_0x28df('0x1f'));var client=jayson['client'][_0x28df('0x20')]({'port':0x232c});var client9002=jayson[_0x28df('0x21')][_0x28df('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x343be0,_0x53ef5c,_0x1aad52,_0x18db54){return new BPromise(function(_0xf25b84,_0x5d0b3d){var _0x32f99b=_0x18db54||client;return _0x32f99b[_0x28df('0x22')](_0x343be0,_0x1aad52)['then'](function(_0x29e9cf){logger[_0x28df('0x23')](_0x28df('0x24'),_0x53ef5c,_0x28df('0x25'));logger[_0x28df('0x26')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x53ef5c,'request\x20sent',JSON[_0x28df('0x27')](_0x29e9cf));if(_0x29e9cf['error']){if(_0x29e9cf[_0x28df('0x28')][_0x28df('0x29')]===0x1f4){logger[_0x28df('0x28')]('FaxMessage,\x20%s,\x20%s',_0x53ef5c,_0x29e9cf['error']['message']);return _0x5d0b3d(_0x29e9cf[_0x28df('0x28')]['message']);}logger[_0x28df('0x28')](_0x28df('0x24'),_0x53ef5c,_0x29e9cf[_0x28df('0x28')][_0x28df('0x2a')]);return _0xf25b84(_0x29e9cf[_0x28df('0x28')][_0x28df('0x2a')]);}else{logger[_0x28df('0x23')]('FaxMessage,\x20%s,\x20%s',_0x53ef5c,'request\x20sent');_0xf25b84(_0x29e9cf[_0x28df('0x2b')][_0x28df('0x2a')]);}})[_0x28df('0x2c')](function(_0x81c798){logger[_0x28df('0x28')]('FaxMessage,\x20%s,\x20%s',_0x53ef5c,_0x81c798);_0x5d0b3d(_0x81c798);});});}function respondWithStatusCode(_0x120e01,_0x262d15){_0x262d15=_0x262d15||0xcc;return function(_0x3ad95b){if(_0x3ad95b){return _0x120e01[_0x28df('0x2d')](_0x262d15);}return _0x120e01[_0x28df('0x2e')](_0x262d15)[_0x28df('0x2f')]();};}function respondWithResult(_0x1162e6,_0x459758){_0x459758=_0x459758||0xc8;return function(_0x5c1c04){if(_0x5c1c04){return _0x1162e6['status'](_0x459758)['json'](_0x5c1c04);}};}function respondWithFilteredResult(_0x53464f,_0x3174ab){return function(_0x154c40){if(_0x154c40){var _0x587814=typeof _0x3174ab[_0x28df('0x30')]===_0x28df('0x31')&&typeof _0x3174ab['limit']===_0x28df('0x31');var _0x36b9e4=_0x154c40[_0x28df('0x32')];var _0x245f72=_0x587814?0x0:_0x3174ab[_0x28df('0x30')];var _0xb82957=_0x587814?_0x154c40['count']:_0x3174ab[_0x28df('0x30')]+_0x3174ab[_0x28df('0x33')];var _0x2aa547;if(_0xb82957>=_0x36b9e4){_0xb82957=_0x36b9e4;_0x2aa547=0xc8;}else{_0x2aa547=0xce;}_0x53464f[_0x28df('0x2e')](_0x2aa547);return _0x53464f[_0x28df('0x34')](_0x28df('0x35'),_0x245f72+'-'+_0xb82957+'/'+_0x36b9e4)[_0x28df('0x36')](_0x154c40);}return null;};}function patchUpdates(_0x5c6aea){return function(_0x4df86c){try{jsonpatch[_0x28df('0x37')](_0x4df86c,_0x5c6aea,!![]);}catch(_0x22dbc9){return BPromise['reject'](_0x22dbc9);}return _0x4df86c[_0x28df('0x38')]();};}function saveUpdates(_0x1cc5e0,_0x11b7e1){return function(_0x47b0c0){if(_0x47b0c0){return _0x47b0c0[_0x28df('0x39')](_0x1cc5e0)[_0x28df('0x3a')](function(_0x566e24){return _0x566e24;});}return null;};}function removeEntity(_0x1359d9,_0x1e997a){return function(_0x22aad6){if(_0x22aad6){return _0x22aad6[_0x28df('0x3b')]()[_0x28df('0x3a')](function(){_0x1359d9['status'](0xcc)[_0x28df('0x2f')]();});}};}function handleEntityNotFound(_0x948740,_0x3130eb){return function(_0x4b9adc){if(!_0x4b9adc){_0x948740['sendStatus'](0x194);}return _0x4b9adc;};}function handleError(_0x19ca86,_0x286bfa){_0x286bfa=_0x286bfa||0x1f4;return function(_0x14f2e2){logger[_0x28df('0x28')](_0x14f2e2[_0x28df('0x3c')]);if(_0x14f2e2[_0x28df('0x3d')]){delete _0x14f2e2[_0x28df('0x3d')];}_0x19ca86[_0x28df('0x2e')](_0x286bfa)[_0x28df('0x3e')](_0x14f2e2);};}exports[_0x28df('0x3f')]=function(_0x5bd55,_0x2d4a72){var _0x3c38c4={},_0x46b358={},_0x405470={'count':0x0,'rows':[]};var _0x3f765a=_['map'](db['FaxMessage'][_0x28df('0x40')],function(_0x1e1609){return{'name':_0x1e1609['fieldName'],'type':_0x1e1609[_0x28df('0x41')][_0x28df('0x42')]};});_0x46b358['model']=_[_0x28df('0x43')](_0x3f765a,_0x28df('0x3d'));_0x46b358['query']=_['keys'](_0x5bd55[_0x28df('0x44')]);_0x46b358[_0x28df('0x45')]=_[_0x28df('0x46')](_0x46b358[_0x28df('0x47')],_0x46b358['query']);_0x3c38c4['attributes']=_[_0x28df('0x46')](_0x46b358[_0x28df('0x47')],qs[_0x28df('0x48')](_0x5bd55[_0x28df('0x44')][_0x28df('0x48')]));_0x3c38c4['attributes']=_0x3c38c4[_0x28df('0x49')][_0x28df('0x4a')]?_0x3c38c4['attributes']:_0x46b358[_0x28df('0x47')];if(!_0x5bd55[_0x28df('0x44')]['hasOwnProperty'](_0x28df('0x4b'))){_0x3c38c4['limit']=qs['limit'](_0x5bd55[_0x28df('0x44')][_0x28df('0x33')]);_0x3c38c4[_0x28df('0x30')]=qs[_0x28df('0x30')](_0x5bd55[_0x28df('0x44')][_0x28df('0x30')]);}_0x3c38c4[_0x28df('0x4c')]=qs[_0x28df('0x4d')](_0x5bd55[_0x28df('0x44')][_0x28df('0x4d')]);_0x3c38c4[_0x28df('0x4e')]=qs['filters'](_[_0x28df('0x4f')](_0x5bd55[_0x28df('0x44')],_0x46b358['filters']),_0x3f765a);if(_0x5bd55['query']['filter']){_0x3c38c4[_0x28df('0x4e')]=_['merge'](_0x3c38c4[_0x28df('0x4e')],{'$or':_['map'](_0x3f765a,function(_0x1804bd){if(_0x1804bd[_0x28df('0x41')]!==_0x28df('0x50')){var _0x2960bc={};_0x2960bc[_0x1804bd[_0x28df('0x3d')]]={'$like':'%'+_0x5bd55[_0x28df('0x44')][_0x28df('0x51')]+'%'};return _0x2960bc;}})});}_0x3c38c4=_[_0x28df('0x52')]({},_0x3c38c4,_0x5bd55[_0x28df('0x53')]);var _0x1735c7={'where':_0x3c38c4[_0x28df('0x4e')]};return db[_0x28df('0x54')]['count'](_0x1735c7)[_0x28df('0x3a')](function(_0xcd547e){_0x405470['count']=_0xcd547e;if(_0x5bd55['query'][_0x28df('0x55')]){_0x3c38c4[_0x28df('0x56')]=[{'all':!![]}];}return db[_0x28df('0x54')][_0x28df('0x57')](_0x3c38c4);})[_0x28df('0x3a')](function(_0x15bf28){_0x405470['rows']=_0x15bf28;return _0x405470;})['then'](respondWithFilteredResult(_0x2d4a72,_0x3c38c4))[_0x28df('0x2c')](handleError(_0x2d4a72,null));};exports[_0x28df('0x58')]=function(_0x2bc991,_0x302735){var _0x46e779={'raw':!![],'where':{'id':_0x2bc991[_0x28df('0x59')]['id']}},_0x315276={};_0x315276['model']=_['keys'](db[_0x28df('0x54')]['rawAttributes']);_0x315276[_0x28df('0x44')]=_[_0x28df('0x5a')](_0x2bc991[_0x28df('0x44')]);_0x315276[_0x28df('0x45')]=_[_0x28df('0x46')](_0x315276[_0x28df('0x47')],_0x315276[_0x28df('0x44')]);_0x46e779[_0x28df('0x49')]=_[_0x28df('0x46')](_0x315276['model'],qs[_0x28df('0x48')](_0x2bc991[_0x28df('0x44')][_0x28df('0x48')]));_0x46e779['attributes']=_0x46e779[_0x28df('0x49')][_0x28df('0x4a')]?_0x46e779[_0x28df('0x49')]:_0x315276[_0x28df('0x47')];if(_0x2bc991['query'][_0x28df('0x55')]){_0x46e779[_0x28df('0x56')]=[{'all':!![]}];}_0x46e779=_[_0x28df('0x52')]({},_0x46e779,_0x2bc991[_0x28df('0x53')]);return db[_0x28df('0x54')][_0x28df('0x5b')](_0x46e779)['then'](handleEntityNotFound(_0x302735,null))[_0x28df('0x3a')](respondWithResult(_0x302735,null))[_0x28df('0x2c')](handleError(_0x302735,null));};exports[_0x28df('0x39')]=function(_0xbd514a,_0x189cab){if(_0xbd514a[_0x28df('0x5c')]['id']){delete _0xbd514a[_0x28df('0x5c')]['id'];}return db[_0x28df('0x54')][_0x28df('0x5b')]({'where':{'id':_0xbd514a[_0x28df('0x59')]['id']}})['then'](handleEntityNotFound(_0x189cab,null))[_0x28df('0x3a')](saveUpdates(_0xbd514a['body'],null))[_0x28df('0x3a')](respondWithResult(_0x189cab,null))['catch'](handleError(_0x189cab,null));};exports['destroy']=function(_0x3bf67a,_0x4b5c68){return db[_0x28df('0x54')][_0x28df('0x5b')]({'where':{'id':_0x3bf67a[_0x28df('0x59')]['id']}})[_0x28df('0x3a')](handleEntityNotFound(_0x4b5c68,null))[_0x28df('0x3a')](removeEntity(_0x4b5c68,null))[_0x28df('0x2c')](handleError(_0x4b5c68,null));};exports[_0x28df('0x5d')]=function(_0x2be8e,_0x182fb8){return db[_0x28df('0x54')][_0x28df('0x5d')]()[_0x28df('0x3a')](respondWithResult(_0x182fb8,null))['catch'](handleError(_0x182fb8,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x28df('0x5e')]=function(_0x3a3b07,_0x46ec84,_0x4ee0a2){var _0x2d5bd8={'agent':{},'channel':_0x28df('0x5f')};if(_0x3a3b07[_0x28df('0x5c')]['id']){delete _0x3a3b07['body']['id'];}_0x3a3b07[_0x28df('0x5c')][_0x28df('0x60')]=!![];_0x3a3b07['body'][_0x28df('0x61')]=moment()['format'](_0x28df('0x62'));_0x3a3b07[_0x28df('0x5c')][_0x28df('0x63')]=_0x3a3b07['body'][_0x28df('0x63')]||_0x3a3b07[_0x28df('0x64')]['id'];_0x2d5bd8[_0x28df('0x65')]['id']=_0x3a3b07[_0x28df('0x5c')][_0x28df('0x63')];return db[_0x28df('0x54')][_0x28df('0x5b')]({'where':{'id':_0x3a3b07['params']['id'],'UserId':null}})[_0x28df('0x3a')](handleEntityNotFound(_0x46ec84,null))[_0x28df('0x3a')](saveUpdates(_0x3a3b07[_0x28df('0x5c')],null))[_0x28df('0x3a')](function(_0x10bc9d){if(_0x10bc9d){_0x2d5bd8[_0x28df('0x2a')]=_0x10bc9d[_0x28df('0x66')]({'plain':!![]});return db['FaxInteraction'][_0x28df('0x5b')]({'where':{'id':_0x10bc9d[_0x28df('0x67')]}});}return null;})[_0x28df('0x3a')](handleEntityNotFound(_0x46ec84,null))[_0x28df('0x3a')](function(_0x522564){if(_0x522564){return _0x522564[_0x28df('0x39')]({'UserId':_0x3a3b07[_0x28df('0x5c')]['UserId'],'read1stAt':_[_0x28df('0x68')](_0x522564['read1stAt'])?moment()['format'](_0x28df('0x62')):undefined});}return null;})[_0x28df('0x3a')](function(_0x1e7ba2){if(_0x1e7ba2){_0x2d5bd8[_0x28df('0x69')]=_0x1e7ba2[_0x28df('0x66')]({'plain':!![]});interaction_log['info'](_0x28df('0x6a'),_0x3a3b07['user']['id'],_0x3a3b07[_0x28df('0x64')][_0x28df('0x3d')],_0x3a3b07[_0x28df('0x64')][_0x28df('0x6b')],_0x2d5bd8[_0x28df('0x69')]['id'],_0x3a3b07[_0x28df('0x5c')]?JSON[_0x28df('0x27')](_0x3a3b07['body']):_0x28df('0x6c'));return respondWithRpcPromise(_0x28df('0x6d'),_0x28df('0x6e'),_0x2d5bd8);}return null;})['then'](function(_0xa1a4f5){var _0x4a11a1=_0x28df('0x6f')+_0xa1a4f5[_0x28df('0x2a')][_0x28df('0x70')];return db[_0x28df('0x71')]['query'](_0x4a11a1,{'type':db[_0x28df('0x72')]['QueryTypes']['SELECT'],'raw':!![]})[_0x28df('0x3a')](function(_0x46f4bc){return _0x46f4bc;});})['then'](function(_0x8efa8d){if(_0x8efa8d){_0x2d5bd8[_0x28df('0x2a')][_0x28df('0x73')]=_0x8efa8d[0x0];if(!_0x3a3b07['body'][_0x28df('0x63')])return;return db[_0x28df('0x74')]['find']({'where':{'id':_0x3a3b07[_0x28df('0x5c')][_0x28df('0x63')],'role':'agent'},'attributes':['id',_0x28df('0x3d'),_0x28df('0x75'),_0x28df('0x76'),'internal'],'raw':!![]});}return null;})[_0x28df('0x3a')](function(_0x18e072){if(!_0x18e072)return null;_0x2d5bd8[_0x28df('0x2a')][_0x28df('0x65')]=_0x18e072;return _0x2d5bd8;})[_0x28df('0x3a')](function(_0x1cabac){if(_0x1cabac){if(_0x3a3b07[_0x28df('0x5c')][_0x28df('0x77')]){_0x2d5bd8['message'][_0x28df('0x78')]=util[_0x28df('0x79')](_0x28df('0x7a'),_0x3a3b07[_0x28df('0x64')][_0x28df('0x3d')]);_0x2d5bd8[_0x28df('0x2a')][_0x28df('0x7b')]=_0x2d5bd8[_0x28df('0x7b')];_0x2d5bd8['message']['motionChannel']=_0x2d5bd8['channel'];_0x2d5bd8[_0x28df('0x2a')][_0x28df('0x7c')]=_0x28df('0x5e');return respondWithRpcPromise(_0x28df('0x7d'),'EventManager',{'event':_0x28df('0x7e'),'message':_0x2d5bd8[_0x28df('0x2a')]},client9002)[_0x28df('0x3a')](function(){return _0x2d5bd8;});}return _0x2d5bd8;}return null;})['then'](respondWithResult(_0x46ec84,null))[_0x28df('0x2c')](handleError(_0x46ec84,null));};var interaction_log=require(_0x28df('0x13'))(_0x28df('0x7f'));exports['reject']=function(_0x436499,_0x3f4c9e,_0x20145b){var _0x10557b={'agent':{},'channel':_0x28df('0x5f')};if(_0x436499['body']['id']){delete _0x436499['body']['id'];}_0x436499['body'][_0x28df('0x63')]=_0x436499[_0x28df('0x5c')][_0x28df('0x63')]||_0x436499[_0x28df('0x64')]['id'];_0x10557b[_0x28df('0x65')]['id']=_0x436499[_0x28df('0x5c')][_0x28df('0x63')];return db[_0x28df('0x54')]['find']({'where':{'id':_0x436499[_0x28df('0x59')]['id'],'UserId':null}})[_0x28df('0x3a')](handleEntityNotFound(_0x3f4c9e,null))[_0x28df('0x3a')](function(_0xb935ef){if(_0xb935ef){_0x10557b[_0x28df('0x2a')]=_0xb935ef[_0x28df('0x66')]({'plain':!![]});return db[_0x28df('0x80')][_0x28df('0x5b')]({'where':{'id':_0xb935ef['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3f4c9e,null))[_0x28df('0x3a')](function(_0x3f200b){if(_0x3f200b){_0x10557b[_0x28df('0x69')]=_0x3f200b[_0x28df('0x66')]({'plain':!![]});interaction_log[_0x28df('0x23')](_0x28df('0x81'),_0x436499[_0x28df('0x64')]['id'],_0x436499[_0x28df('0x64')][_0x28df('0x3d')],_0x436499[_0x28df('0x64')][_0x28df('0x6b')],_0x10557b['interaction']['id'],_0x436499[_0x28df('0x5c')]?JSON[_0x28df('0x27')](_0x436499[_0x28df('0x5c')]):'null');return respondWithRpcPromise(_0x28df('0x82'),_0x28df('0x83'),_0x10557b);}return null;})[_0x28df('0x3a')](function(_0x2f4e66){var _0x2caf0a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2f4e66['message']['ContactId'];return db[_0x28df('0x71')]['query'](_0x2caf0a,{'type':db[_0x28df('0x72')][_0x28df('0x84')]['SELECT'],'raw':!![]})[_0x28df('0x3a')](function(_0x14c85e){return _0x14c85e;});})[_0x28df('0x3a')](function(_0x22865f){if(_0x22865f){_0x10557b[_0x28df('0x2a')][_0x28df('0x73')]=_0x22865f[0x0];if(!_0x436499[_0x28df('0x5c')][_0x28df('0x63')])return;return db['User'][_0x28df('0x5b')]({'where':{'id':_0x436499[_0x28df('0x5c')][_0x28df('0x63')],'role':_0x28df('0x65')},'attributes':['id',_0x28df('0x3d'),_0x28df('0x75'),_0x28df('0x76'),_0x28df('0x85')],'raw':!![]});}return null;})[_0x28df('0x3a')](function(_0x18826c){if(!_0x18826c)return null;_0x10557b[_0x28df('0x2a')][_0x28df('0x65')]=_0x18826c;return _0x10557b;})[_0x28df('0x3a')](function(_0x9ccb8b){if(_0x9ccb8b){_0x9ccb8b[_0x28df('0x2a')]['interface']=util[_0x28df('0x79')](_0x28df('0x7a'),_0x436499[_0x28df('0x64')][_0x28df('0x3d')]);_0x9ccb8b[_0x28df('0x2a')][_0x28df('0x7b')]=_0x10557b[_0x28df('0x7b')];_0x9ccb8b[_0x28df('0x2a')][_0x28df('0x86')]=_0x10557b[_0x28df('0x7b')];_0x9ccb8b['message']['event']=_0x28df('0x87');respondWithRpcPromise(_0x28df('0x7d'),'EventManager',{'event':_0x28df('0x88'),'message':_0x9ccb8b['message']},client9002);return _0x10557b;}return null;})[_0x28df('0x3a')](respondWithResult(_0x3f4c9e,null))[_0x28df('0x2c')](handleError(_0x3f4c9e,null));};exports[_0x28df('0x89')]=function(_0x3916ef,_0x3b0efc){var _0x5b3899;return db[_0x28df('0x54')][_0x28df('0x89')](_0x3916ef[_0x28df('0x5c')],{})[_0x28df('0x3a')](function(_0x50f721){_0x5b3899=_0x50f721;return db[_0x28df('0x8a')][_0x28df('0x8b')]({'where':{'id':_0x5b3899[_0x28df('0x70')]}});})[_0x28df('0x3a')](function(_0x452e0b){if(_[_0x28df('0x68')](_0x452e0b)){return;}else{_0x5b3899[_0x28df('0x5f')]=_0x452e0b[_0x28df('0x5f')];return db[_0x28df('0x8c')][_0x28df('0x8b')]({'where':{'id':_0x5b3899[_0x28df('0x8d')]}});}})['then'](function(_0x1def45){return respondWithRpcPromise(_0x28df('0x8e'),_0x28df('0x8e'),{'FaxAccountId':_['isNil'](_0x3916ef[_0x28df('0x5c')])?undefined:_0x3916ef[_0x28df('0x5c')][_0x28df('0x8f')],'path':_[_0x28df('0x68')](_0x1def45)?undefined:util[_0x28df('0x79')]('/var/opt/motion2/server/files/attachments/%s',_0x1def45[_0x28df('0x90')]),'fax':_[_0x28df('0x68')](_0x5b3899[_0x28df('0x5f')])?undefined:_0x5b3899[_0x28df('0x5f')],'AttachmentId':_0x5b3899[_0x28df('0x8d')]},client9002);})[_0x28df('0x3a')](respondWithResult(_0x3b0efc,0xc9))[_0x28df('0x2c')](handleError(_0x3b0efc,null));};exports['download']=function(_0x173b14,_0x1dbbfc){var _0x2ba0a5=path[_0x28df('0x91')](config[_0x28df('0x92')],_0x28df('0x93'),_0x28df('0x94'),_0x28df('0x95'));return db[_0x28df('0x54')][_0x28df('0x5b')]({'where':{'id':_0x173b14[_0x28df('0x59')]['id']},'include':[{'model':db[_0x28df('0x8c')],'as':'Attachment'}]})[_0x28df('0x3a')](handleEntityNotFound(_0x1dbbfc,null))[_0x28df('0x3a')](function(_0x349480){if(_0x349480){return _0x1dbbfc[_0x28df('0x96')](path[_0x28df('0x91')](_0x2ba0a5,_0x349480[_0x28df('0x8c')][_0x28df('0x90')]));}})[_0x28df('0x2c')](handleError(_0x1dbbfc,null));}; \ No newline at end of file +var _0xd19e=['filter','VIRTUAL','merge','includeAll','findAll','show','params','include','update','body','find','describe','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','FaxInteraction','FaxInteractionId','isNil','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','internal','format','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','basename','download','join','server','attachments','Attachment','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','end','stack','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0xd19e,0x1f3));var _0xed19=function(_0x44de79,_0x2a6fcc){_0x44de79=_0x44de79-0x0;var _0x2ce323=_0xd19e[_0x44de79];return _0x2ce323;};'use strict';var emlformat=require(_0xed19('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xed19('0x1'));var rp=require(_0xed19('0x2'));var moment=require(_0xed19('0x3'));var BPromise=require(_0xed19('0x4'));var Mustache=require(_0xed19('0x5'));var util=require(_0xed19('0x6'));var path=require(_0xed19('0x7'));var sox=require(_0xed19('0x8'));var csv=require('to-csv');var ejs=require(_0xed19('0x9'));var fs=require('fs');var fs_extra=require(_0xed19('0xa'));var _=require('lodash');var squel=require(_0xed19('0xb'));var crypto=require(_0xed19('0xc'));var jsforce=require(_0xed19('0xd'));var deskjs=require(_0xed19('0xe'));var toCsv=require('to-csv');var querystring=require(_0xed19('0xf'));var Papa=require(_0xed19('0x10'));var Redis=require('ioredis');var authService=require(_0xed19('0x11'));var qs=require(_0xed19('0x12'));var as=require(_0xed19('0x13'));var hardwareService=require(_0xed19('0x14'));var logger=require(_0xed19('0x15'))(_0xed19('0x16'));var utils=require(_0xed19('0x17'));var config=require(_0xed19('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xed19('0x19'))['db'];config[_0xed19('0x1a')]=_[_0xed19('0x1b')](config[_0xed19('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xed19('0x1c'))(new Redis(config[_0xed19('0x1a')]));require(_0xed19('0x1d'))[_0xed19('0x1e')](socket);var jayson=require(_0xed19('0x1f'));var client=jayson[_0xed19('0x20')][_0xed19('0x21')]({'port':0x232c});var client9002=jayson[_0xed19('0x20')][_0xed19('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xe8fb3a,_0x1fe3b5,_0x7f17e5,_0x100f32){return new BPromise(function(_0x36f546,_0x1489fa){var _0x17f90f=_0x100f32||client;return _0x17f90f['request'](_0xe8fb3a,_0x7f17e5)[_0xed19('0x22')](function(_0x5770f2){logger[_0xed19('0x23')](_0xed19('0x24'),_0x1fe3b5,_0xed19('0x25'));logger['debug'](_0xed19('0x26'),_0x1fe3b5,_0xed19('0x25'),JSON[_0xed19('0x27')](_0x5770f2));if(_0x5770f2[_0xed19('0x28')]){if(_0x5770f2[_0xed19('0x28')][_0xed19('0x29')]===0x1f4){logger[_0xed19('0x28')](_0xed19('0x24'),_0x1fe3b5,_0x5770f2[_0xed19('0x28')][_0xed19('0x2a')]);return _0x1489fa(_0x5770f2[_0xed19('0x28')][_0xed19('0x2a')]);}logger[_0xed19('0x28')]('FaxMessage,\x20%s,\x20%s',_0x1fe3b5,_0x5770f2['error']['message']);return _0x36f546(_0x5770f2[_0xed19('0x28')][_0xed19('0x2a')]);}else{logger[_0xed19('0x23')]('FaxMessage,\x20%s,\x20%s',_0x1fe3b5,'request\x20sent');_0x36f546(_0x5770f2[_0xed19('0x2b')][_0xed19('0x2a')]);}})[_0xed19('0x2c')](function(_0xa52fff){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1fe3b5,_0xa52fff);_0x1489fa(_0xa52fff);});});}function respondWithStatusCode(_0x96ce0,_0x1caf1c){_0x1caf1c=_0x1caf1c||0xcc;return function(_0x371608){if(_0x371608){return _0x96ce0[_0xed19('0x2d')](_0x1caf1c);}return _0x96ce0[_0xed19('0x2e')](_0x1caf1c)['end']();};}function respondWithResult(_0x650914,_0x37fc4e){_0x37fc4e=_0x37fc4e||0xc8;return function(_0x29f789){if(_0x29f789){return _0x650914[_0xed19('0x2e')](_0x37fc4e)['json'](_0x29f789);}};}function respondWithFilteredResult(_0x170e67,_0x2192f1){return function(_0x4ed0e2){if(_0x4ed0e2){var _0x571eec=typeof _0x2192f1['offset']===_0xed19('0x2f')&&typeof _0x2192f1[_0xed19('0x30')]===_0xed19('0x2f');var _0x132b49=_0x4ed0e2[_0xed19('0x31')];var _0x17b43b=_0x571eec?0x0:_0x2192f1[_0xed19('0x32')];var _0x3690e6=_0x571eec?_0x4ed0e2[_0xed19('0x31')]:_0x2192f1[_0xed19('0x32')]+_0x2192f1[_0xed19('0x30')];var _0x1fbcab;if(_0x3690e6>=_0x132b49){_0x3690e6=_0x132b49;_0x1fbcab=0xc8;}else{_0x1fbcab=0xce;}_0x170e67[_0xed19('0x2e')](_0x1fbcab);return _0x170e67[_0xed19('0x33')](_0xed19('0x34'),_0x17b43b+'-'+_0x3690e6+'/'+_0x132b49)[_0xed19('0x35')](_0x4ed0e2);}return null;};}function patchUpdates(_0x5c63f4){return function(_0x22afa0){try{jsonpatch[_0xed19('0x36')](_0x22afa0,_0x5c63f4,!![]);}catch(_0x2f5f1f){return BPromise[_0xed19('0x37')](_0x2f5f1f);}return _0x22afa0[_0xed19('0x38')]();};}function saveUpdates(_0x1a6dd2,_0x48c26c){return function(_0x46fddd){if(_0x46fddd){return _0x46fddd['update'](_0x1a6dd2)[_0xed19('0x22')](function(_0x3c0cf1){return _0x3c0cf1;});}return null;};}function removeEntity(_0x1f588f,_0x2b443c){return function(_0x1d498a){if(_0x1d498a){return _0x1d498a['destroy']()[_0xed19('0x22')](function(){_0x1f588f[_0xed19('0x2e')](0xcc)[_0xed19('0x39')]();});}};}function handleEntityNotFound(_0x470267,_0x3ad0f1){return function(_0x487b4e){if(!_0x487b4e){_0x470267[_0xed19('0x2d')](0x194);}return _0x487b4e;};}function handleError(_0x2fb68c,_0x15a70a){_0x15a70a=_0x15a70a||0x1f4;return function(_0x1bcbde){logger[_0xed19('0x28')](_0x1bcbde[_0xed19('0x3a')]);if(_0x1bcbde['name']){delete _0x1bcbde['name'];}_0x2fb68c[_0xed19('0x2e')](_0x15a70a)[_0xed19('0x3b')](_0x1bcbde);};}exports[_0xed19('0x3c')]=function(_0x19c8b5,_0x16fca0){var _0x5ce4db={},_0x4fbe3a={},_0x56b475={'count':0x0,'rows':[]};var _0x1d5f44=_[_0xed19('0x3d')](db[_0xed19('0x3e')][_0xed19('0x3f')],function(_0x308697){return{'name':_0x308697[_0xed19('0x40')],'type':_0x308697[_0xed19('0x41')][_0xed19('0x42')]};});_0x4fbe3a['model']=_[_0xed19('0x3d')](_0x1d5f44,_0xed19('0x43'));_0x4fbe3a[_0xed19('0x44')]=_[_0xed19('0x45')](_0x19c8b5[_0xed19('0x44')]);_0x4fbe3a[_0xed19('0x46')]=_[_0xed19('0x47')](_0x4fbe3a[_0xed19('0x48')],_0x4fbe3a[_0xed19('0x44')]);_0x5ce4db[_0xed19('0x49')]=_[_0xed19('0x47')](_0x4fbe3a[_0xed19('0x48')],qs[_0xed19('0x4a')](_0x19c8b5[_0xed19('0x44')][_0xed19('0x4a')]));_0x5ce4db[_0xed19('0x49')]=_0x5ce4db[_0xed19('0x49')][_0xed19('0x4b')]?_0x5ce4db['attributes']:_0x4fbe3a[_0xed19('0x48')];if(!_0x19c8b5['query'][_0xed19('0x4c')](_0xed19('0x4d'))){_0x5ce4db['limit']=qs[_0xed19('0x30')](_0x19c8b5['query'][_0xed19('0x30')]);_0x5ce4db[_0xed19('0x32')]=qs[_0xed19('0x32')](_0x19c8b5['query'][_0xed19('0x32')]);}_0x5ce4db['order']=qs[_0xed19('0x4e')](_0x19c8b5[_0xed19('0x44')][_0xed19('0x4e')]);_0x5ce4db[_0xed19('0x4f')]=qs['filters'](_[_0xed19('0x50')](_0x19c8b5[_0xed19('0x44')],_0x4fbe3a[_0xed19('0x46')]),_0x1d5f44);if(_0x19c8b5[_0xed19('0x44')][_0xed19('0x51')]){_0x5ce4db[_0xed19('0x4f')]=_['merge'](_0x5ce4db[_0xed19('0x4f')],{'$or':_[_0xed19('0x3d')](_0x1d5f44,function(_0x392394){if(_0x392394[_0xed19('0x41')]!==_0xed19('0x52')){var _0x13322f={};_0x13322f[_0x392394[_0xed19('0x43')]]={'$like':'%'+_0x19c8b5['query']['filter']+'%'};return _0x13322f;}})});}_0x5ce4db=_[_0xed19('0x53')]({},_0x5ce4db,_0x19c8b5['options']);var _0xe9ff1c={'where':_0x5ce4db[_0xed19('0x4f')]};return db[_0xed19('0x3e')][_0xed19('0x31')](_0xe9ff1c)['then'](function(_0x33bb6e){_0x56b475[_0xed19('0x31')]=_0x33bb6e;if(_0x19c8b5[_0xed19('0x44')][_0xed19('0x54')]){_0x5ce4db['include']=[{'all':!![]}];}return db[_0xed19('0x3e')][_0xed19('0x55')](_0x5ce4db);})[_0xed19('0x22')](function(_0x55525a){_0x56b475['rows']=_0x55525a;return _0x56b475;})[_0xed19('0x22')](respondWithFilteredResult(_0x16fca0,_0x5ce4db))[_0xed19('0x2c')](handleError(_0x16fca0,null));};exports[_0xed19('0x56')]=function(_0x4bc590,_0x46b1fa){var _0x563a79={'raw':!![],'where':{'id':_0x4bc590[_0xed19('0x57')]['id']}},_0x25d142={};_0x25d142[_0xed19('0x48')]=_[_0xed19('0x45')](db['FaxMessage'][_0xed19('0x3f')]);_0x25d142[_0xed19('0x44')]=_['keys'](_0x4bc590[_0xed19('0x44')]);_0x25d142[_0xed19('0x46')]=_[_0xed19('0x47')](_0x25d142[_0xed19('0x48')],_0x25d142['query']);_0x563a79[_0xed19('0x49')]=_['intersection'](_0x25d142[_0xed19('0x48')],qs[_0xed19('0x4a')](_0x4bc590[_0xed19('0x44')][_0xed19('0x4a')]));_0x563a79[_0xed19('0x49')]=_0x563a79['attributes']['length']?_0x563a79[_0xed19('0x49')]:_0x25d142['model'];if(_0x4bc590['query']['includeAll']){_0x563a79[_0xed19('0x58')]=[{'all':!![]}];}_0x563a79=_[_0xed19('0x53')]({},_0x563a79,_0x4bc590['options']);return db[_0xed19('0x3e')]['find'](_0x563a79)[_0xed19('0x22')](handleEntityNotFound(_0x46b1fa,null))[_0xed19('0x22')](respondWithResult(_0x46b1fa,null))['catch'](handleError(_0x46b1fa,null));};exports[_0xed19('0x59')]=function(_0x2b7922,_0x40d792){if(_0x2b7922[_0xed19('0x5a')]['id']){delete _0x2b7922[_0xed19('0x5a')]['id'];}return db[_0xed19('0x3e')][_0xed19('0x5b')]({'where':{'id':_0x2b7922[_0xed19('0x57')]['id']}})[_0xed19('0x22')](handleEntityNotFound(_0x40d792,null))['then'](saveUpdates(_0x2b7922[_0xed19('0x5a')],null))[_0xed19('0x22')](respondWithResult(_0x40d792,null))['catch'](handleError(_0x40d792,null));};exports['destroy']=function(_0x58041e,_0x2d0c40){return db[_0xed19('0x3e')][_0xed19('0x5b')]({'where':{'id':_0x58041e['params']['id']}})[_0xed19('0x22')](handleEntityNotFound(_0x2d0c40,null))[_0xed19('0x22')](removeEntity(_0x2d0c40,null))[_0xed19('0x2c')](handleError(_0x2d0c40,null));};exports[_0xed19('0x5c')]=function(_0x171e5a,_0x35993f){return db[_0xed19('0x3e')]['describe']()[_0xed19('0x22')](respondWithResult(_0x35993f,null))[_0xed19('0x2c')](handleError(_0x35993f,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['accept']=function(_0x3e64ee,_0xe3a03,_0x2d0d47){var _0x3fb53d={'agent':{},'channel':_0xed19('0x5d')};if(_0x3e64ee[_0xed19('0x5a')]['id']){delete _0x3e64ee['body']['id'];}_0x3e64ee[_0xed19('0x5a')][_0xed19('0x5e')]=!![];_0x3e64ee['body'][_0xed19('0x5f')]=moment()['format'](_0xed19('0x60'));_0x3e64ee['body'][_0xed19('0x61')]=_0x3e64ee[_0xed19('0x5a')][_0xed19('0x61')]||_0x3e64ee['user']['id'];_0x3fb53d[_0xed19('0x62')]['id']=_0x3e64ee['body'][_0xed19('0x61')];return db[_0xed19('0x3e')][_0xed19('0x5b')]({'where':{'id':_0x3e64ee[_0xed19('0x57')]['id'],'UserId':null}})[_0xed19('0x22')](handleEntityNotFound(_0xe3a03,null))['then'](saveUpdates(_0x3e64ee['body'],null))['then'](function(_0x53e438){if(_0x53e438){_0x3fb53d[_0xed19('0x2a')]=_0x53e438['get']({'plain':!![]});return db[_0xed19('0x63')]['find']({'where':{'id':_0x53e438[_0xed19('0x64')]}});}return null;})[_0xed19('0x22')](handleEntityNotFound(_0xe3a03,null))['then'](function(_0x47a35a){if(_0x47a35a){return _0x47a35a[_0xed19('0x59')]({'UserId':_0x3e64ee[_0xed19('0x5a')][_0xed19('0x61')],'read1stAt':_[_0xed19('0x65')](_0x47a35a['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xed19('0x22')](function(_0x9a1b0){if(_0x9a1b0){_0x3fb53d[_0xed19('0x66')]=_0x9a1b0[_0xed19('0x67')]({'plain':!![]});interaction_log['info'](_0xed19('0x68'),_0x3e64ee[_0xed19('0x69')]['id'],_0x3e64ee[_0xed19('0x69')][_0xed19('0x43')],_0x3e64ee['user'][_0xed19('0x6a')],_0x3fb53d[_0xed19('0x66')]['id'],_0x3e64ee[_0xed19('0x5a')]?JSON[_0xed19('0x27')](_0x3e64ee['body']):_0xed19('0x6b'));return respondWithRpcPromise(_0xed19('0x6c'),_0xed19('0x6d'),_0x3fb53d);}return null;})[_0xed19('0x22')](function(_0x2a2c06){var _0x100247='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a2c06[_0xed19('0x2a')][_0xed19('0x6e')];return db[_0xed19('0x6f')][_0xed19('0x44')](_0x100247,{'type':db[_0xed19('0x70')]['QueryTypes'][_0xed19('0x71')],'raw':!![]})[_0xed19('0x22')](function(_0x21a891){return _0x21a891;});})[_0xed19('0x22')](function(_0x1d7a81){if(_0x1d7a81){_0x3fb53d[_0xed19('0x2a')][_0xed19('0x72')]=_0x1d7a81[0x0];if(!_0x3e64ee[_0xed19('0x5a')][_0xed19('0x61')])return;return db[_0xed19('0x73')][_0xed19('0x5b')]({'where':{'id':_0x3e64ee[_0xed19('0x5a')][_0xed19('0x61')],'role':_0xed19('0x62')},'attributes':['id','name','fullname',_0xed19('0x74'),'internal'],'raw':!![]});}return null;})[_0xed19('0x22')](function(_0x38d860){if(!_0x38d860)return null;_0x3fb53d[_0xed19('0x2a')]['agent']=_0x38d860;return _0x3fb53d;})['then'](function(_0x12400e){if(_0x12400e){if(_0x3e64ee['body'][_0xed19('0x75')]){_0x3fb53d[_0xed19('0x2a')][_0xed19('0x76')]=util['format'](_0xed19('0x77'),_0x3e64ee[_0xed19('0x69')][_0xed19('0x43')]);_0x3fb53d[_0xed19('0x2a')][_0xed19('0x78')]=_0x3fb53d[_0xed19('0x78')];_0x3fb53d[_0xed19('0x2a')][_0xed19('0x79')]=_0x3fb53d[_0xed19('0x78')];_0x3fb53d[_0xed19('0x2a')][_0xed19('0x7a')]=_0xed19('0x7b');return respondWithRpcPromise(_0xed19('0x7c'),_0xed19('0x7c'),{'event':_0xed19('0x7d'),'message':_0x3fb53d[_0xed19('0x2a')]},client9002)[_0xed19('0x22')](function(){return _0x3fb53d;});}return _0x3fb53d;}return null;})[_0xed19('0x22')](respondWithResult(_0xe3a03,null))[_0xed19('0x2c')](handleError(_0xe3a03,null));};var interaction_log=require(_0xed19('0x15'))(_0xed19('0x7e'));exports[_0xed19('0x37')]=function(_0x3c7d68,_0x30a433,_0x4b7a48){var _0x8c1ca0={'agent':{},'channel':_0xed19('0x5d')};if(_0x3c7d68[_0xed19('0x5a')]['id']){delete _0x3c7d68[_0xed19('0x5a')]['id'];}_0x3c7d68[_0xed19('0x5a')][_0xed19('0x61')]=_0x3c7d68[_0xed19('0x5a')][_0xed19('0x61')]||_0x3c7d68['user']['id'];_0x8c1ca0[_0xed19('0x62')]['id']=_0x3c7d68[_0xed19('0x5a')][_0xed19('0x61')];return db[_0xed19('0x3e')]['find']({'where':{'id':_0x3c7d68['params']['id'],'UserId':null}})[_0xed19('0x22')](handleEntityNotFound(_0x30a433,null))[_0xed19('0x22')](function(_0x195c2f){if(_0x195c2f){_0x8c1ca0[_0xed19('0x2a')]=_0x195c2f[_0xed19('0x67')]({'plain':!![]});return db['FaxInteraction'][_0xed19('0x5b')]({'where':{'id':_0x195c2f[_0xed19('0x64')]}});}return null;})[_0xed19('0x22')](handleEntityNotFound(_0x30a433,null))[_0xed19('0x22')](function(_0x45cb3c){if(_0x45cb3c){_0x8c1ca0[_0xed19('0x66')]=_0x45cb3c[_0xed19('0x67')]({'plain':!![]});interaction_log['info'](_0xed19('0x7f'),_0x3c7d68['user']['id'],_0x3c7d68[_0xed19('0x69')][_0xed19('0x43')],_0x3c7d68[_0xed19('0x69')][_0xed19('0x6a')],_0x8c1ca0[_0xed19('0x66')]['id'],_0x3c7d68['body']?JSON[_0xed19('0x27')](_0x3c7d68[_0xed19('0x5a')]):_0xed19('0x6b'));return respondWithRpcPromise(_0xed19('0x80'),'rejectMessage',_0x8c1ca0);}return null;})[_0xed19('0x22')](function(_0x2159d9){var _0x9752a6=_0xed19('0x81')+_0x2159d9[_0xed19('0x2a')]['ContactId'];return db[_0xed19('0x6f')][_0xed19('0x44')](_0x9752a6,{'type':db[_0xed19('0x70')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x184e12){return _0x184e12;});})[_0xed19('0x22')](function(_0x4cf97a){if(_0x4cf97a){_0x8c1ca0['message'][_0xed19('0x72')]=_0x4cf97a[0x0];if(!_0x3c7d68[_0xed19('0x5a')]['UserId'])return;return db['User']['find']({'where':{'id':_0x3c7d68[_0xed19('0x5a')][_0xed19('0x61')],'role':_0xed19('0x62')},'attributes':['id','name',_0xed19('0x82'),_0xed19('0x74'),_0xed19('0x83')],'raw':!![]});}return null;})[_0xed19('0x22')](function(_0x2b76c4){if(!_0x2b76c4)return null;_0x8c1ca0[_0xed19('0x2a')][_0xed19('0x62')]=_0x2b76c4;return _0x8c1ca0;})[_0xed19('0x22')](function(_0x202669){if(_0x202669){_0x202669[_0xed19('0x2a')][_0xed19('0x76')]=util[_0xed19('0x84')](_0xed19('0x77'),_0x3c7d68[_0xed19('0x69')][_0xed19('0x43')]);_0x202669[_0xed19('0x2a')]['channel']=_0x8c1ca0['channel'];_0x202669['message'][_0xed19('0x79')]=_0x8c1ca0[_0xed19('0x78')];_0x202669[_0xed19('0x2a')][_0xed19('0x7a')]=_0xed19('0x37');respondWithRpcPromise(_0xed19('0x7c'),_0xed19('0x7c'),{'event':'rejectmessage','message':_0x202669[_0xed19('0x2a')]},client9002);return _0x8c1ca0;}return null;})['then'](respondWithResult(_0x30a433,null))[_0xed19('0x2c')](handleError(_0x30a433,null));};exports[_0xed19('0x85')]=function(_0x3e6dd0,_0x12b177){var _0x2cd41f;return db['FaxMessage']['create'](_0x3e6dd0[_0xed19('0x5a')],{})[_0xed19('0x22')](function(_0x23a9da){_0x2cd41f=_0x23a9da;return db[_0xed19('0x86')][_0xed19('0x87')]({'where':{'id':_0x2cd41f[_0xed19('0x6e')]}});})[_0xed19('0x22')](function(_0x5bc692){if(_[_0xed19('0x65')](_0x5bc692)){return;}else{_0x2cd41f[_0xed19('0x5d')]=_0x5bc692[_0xed19('0x5d')];return db['Attachment'][_0xed19('0x87')]({'where':{'id':_0x2cd41f[_0xed19('0x88')]}});}})[_0xed19('0x22')](function(_0x3f144a){return respondWithRpcPromise(_0xed19('0x89'),_0xed19('0x89'),{'FaxAccountId':_[_0xed19('0x65')](_0x3e6dd0[_0xed19('0x5a')])?undefined:_0x3e6dd0[_0xed19('0x5a')][_0xed19('0x8a')],'path':_[_0xed19('0x65')](_0x3f144a)?undefined:util[_0xed19('0x84')]('/var/opt/motion2/server/files/attachments/%s',_0x3f144a[_0xed19('0x8b')]),'fax':_['isNil'](_0x2cd41f[_0xed19('0x5d')])?undefined:_0x2cd41f[_0xed19('0x5d')],'AttachmentId':_0x2cd41f[_0xed19('0x88')]},client9002);})[_0xed19('0x22')](respondWithResult(_0x12b177,0xc9))[_0xed19('0x2c')](handleError(_0x12b177,null));};exports[_0xed19('0x8c')]=function(_0x40540b,_0x4d5756){var _0x4442b9=path[_0xed19('0x8d')](config['root'],_0xed19('0x8e'),'files',_0xed19('0x8f'));return db[_0xed19('0x3e')][_0xed19('0x5b')]({'where':{'id':_0x40540b[_0xed19('0x57')]['id']},'include':[{'model':db[_0xed19('0x90')],'as':_0xed19('0x90')}]})[_0xed19('0x22')](handleEntityNotFound(_0x4d5756,null))['then'](function(_0x30c6a0){if(_0x30c6a0){return _0x4d5756[_0xed19('0x8c')](path['join'](_0x4442b9,_0x30c6a0[_0xed19('0x90')][_0xed19('0x8b')]));}})[_0xed19('0x2c')](handleError(_0x4d5756,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index ec78933..eaded52 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe829=['save','update','remove','hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x3e2b19,_0xe8f108){var _0x2ba24b=function(_0x5e2fa8){while(--_0x5e2fa8){_0x3e2b19['push'](_0x3e2b19['shift']());}};_0x2ba24b(++_0xe8f108);}(_0xe829,0xde));var _0x9e82=function(_0x288efd,_0x86ff6b){_0x288efd=_0x288efd-0x0;var _0x7466bb=_0xe829[_0x288efd];return _0x7466bb;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x9e82('0x0'))['db'][_0x9e82('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9e82('0x2')](0x0);var events={'afterCreate':_0x9e82('0x3'),'afterUpdate':_0x9e82('0x4'),'afterDestroy':_0x9e82('0x5')};function emitEvent(_0x487d2d){return function(_0xc8aec1,_0x19ece0,_0x4bd524){FaxMessageEvents['emit'](_0x487d2d+':'+_0xc8aec1['id'],_0xc8aec1);FaxMessageEvents['emit'](_0x487d2d,_0xc8aec1);_0x4bd524(null);};}for(var e in events){if(events[_0x9e82('0x6')](e)){var event=events[e];FaxMessage[_0x9e82('0x7')](e,emitEvent(event));}}module[_0x9e82('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x6869=['hook','exports','events','../../mysqldb','FaxMessage','save','emit','hasOwnProperty'];(function(_0x2c3611,_0x1c1615){var _0x464eee=function(_0x443872){while(--_0x443872){_0x2c3611['push'](_0x2c3611['shift']());}};_0x464eee(++_0x1c1615);}(_0x6869,0xe2));var _0x9686=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6869[_0x4cf98e];return _0x1623ac;};'use strict';var EventEmitter=require(_0x9686('0x0'));var FaxMessage=require(_0x9686('0x1'))['db'][_0x9686('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9686('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x10b5dd){return function(_0x1214bf,_0x3afe82,_0x2a1a62){FaxMessageEvents[_0x9686('0x4')](_0x10b5dd+':'+_0x1214bf['id'],_0x1214bf);FaxMessageEvents['emit'](_0x10b5dd,_0x1214bf);_0x2a1a62(null);};}for(var e in events){if(events[_0x9686('0x5')](e)){var event=events[e];FaxMessage[_0x9686('0x6')](e,emitEvent(event));}}module[_0x9686('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 25ba15f..e4d3b9e 100644 --- a/server/api/faxMessage/faxMessage.model.js +++ b/server/api/faxMessage/faxMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc72f=['../../config/logger','request-promise','../../config/environment','./faxMessage.attributes','define','FaxMessage','body','FULLTEXT','models','direction','toLowerCase','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1f8541,_0x478be6){var _0x58d505=function(_0x4ad5c3){while(--_0x4ad5c3){_0x1f8541['push'](_0x1f8541['shift']());}};_0x58d505(++_0x478be6);}(_0xc72f,0xee));var _0xfc72=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xc72f[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0xfc72('0x0'));var util=require(_0xfc72('0x1'));var logger=require(_0xfc72('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfc72('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfc72('0x4'));var attributes=require(_0xfc72('0x5'));module['exports']=function(_0x1f367f,_0x1525eb){return _0x1f367f[_0xfc72('0x6')](_0xfc72('0x7'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xfc72('0x8')],'type':_0xfc72('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x551128,_0x403b7c,_0x41c70f){var _0x1932b6=_0x1f367f[_0xfc72('0xa')];var _0x1f4cb7=_0x551128['get']({'plain':!![]});if(_0x1f4cb7[_0xfc72('0xb')][_0xfc72('0xc')]()==='in'||_0x1f4cb7['direction'][_0xfc72('0xc')]()==='out'&&!_0x1f4cb7['secret']&&!_[_0xfc72('0xd')](_0x1f4cb7[_0xfc72('0xe')])){_0x1932b6[_0xfc72('0xf')][_0xfc72('0x10')]({'where':{'id':_0x1f4cb7[_0xfc72('0x11')]}})[_0xfc72('0x12')](function(_0x5a6f03){if(_0x5a6f03){_0x5a6f03[_0xfc72('0x13')]({'lastMsgAt':_0x1f4cb7['createdAt'],'lastMsgDirection':_0x1f4cb7['direction'][_0xfc72('0xc')]()});}})[_0xfc72('0x14')](function(_0xef88c7){console[_0xfc72('0x15')](_0xef88c7);});}_0x41c70f();}},'charset':_0xfc72('0x16'),'collate':_0xfc72('0x17')});}; \ No newline at end of file +var _0x658d=['FaxInteractionId','update','createdAt','direction','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports','fax_messages','body','models','get','toLowerCase','out','secret','FaxInteraction','findOne'];(function(_0x453b1e,_0x677eae){var _0x1ae017=function(_0x572e7c){while(--_0x572e7c){_0x453b1e['push'](_0x453b1e['shift']());}};_0x1ae017(++_0x677eae);}(_0x658d,0x13f));var _0xd658=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x658d[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xd658('0x0'));var util=require('util');var logger=require(_0xd658('0x1'))(_0xd658('0x2'));var moment=require(_0xd658('0x3'));var BPromise=require('bluebird');var rp=require(_0xd658('0x4'));var fs=require('fs');var path=require(_0xd658('0x5'));var rimraf=require(_0xd658('0x6'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0xd658('0x7')]=function(_0xfd1044,_0x27b36e){return _0xfd1044['define']('FaxMessage',attributes,{'tableName':_0xd658('0x8'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xd658('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3efaa9,_0x1c5b4b,_0x4dae31){var _0x1e41ff=_0xfd1044[_0xd658('0xa')];var _0xc8cc21=_0x3efaa9[_0xd658('0xb')]({'plain':!![]});if(_0xc8cc21['direction'][_0xd658('0xc')]()==='in'||_0xc8cc21['direction']['toLowerCase']()===_0xd658('0xd')&&!_0xc8cc21[_0xd658('0xe')]&&!_['isNil'](_0xc8cc21['UserId'])){_0x1e41ff[_0xd658('0xf')][_0xd658('0x10')]({'where':{'id':_0xc8cc21[_0xd658('0x11')]}})['then'](function(_0x2ca367){if(_0x2ca367){_0x2ca367[_0xd658('0x12')]({'lastMsgAt':_0xc8cc21[_0xd658('0x13')],'lastMsgDirection':_0xc8cc21[_0xd658('0x14')]['toLowerCase']()});}})[_0xd658('0x15')](function(_0x5bc725){console[_0xd658('0x16')](_0x5bc725);});}_0x4dae31();}},'charset':'utf8mb4','collate':_0xd658('0x17')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index fce9707..43db8bd 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x668b=['./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body','raw','UpdateFaxMessage','update','options','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x668b,0x140));var _0xb668=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x668b[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});config[_0xb668('0xa')]=_[_0xb668('0xb')](config[_0xb668('0xa')],{'host':_0xb668('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb668('0xa')]));require(_0xb668('0xd'))[_0xb668('0xe')](socket);function respondWithRpcPromise(_0x16d50d,_0x39b79c,_0x3606a7){return new BPromise(function(_0x45bc39,_0x3616e9){return client['request'](_0x16d50d,_0x3606a7)[_0xb668('0xf')](function(_0x27dbf7){logger[_0xb668('0x10')](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));logger[_0xb668('0x13')](_0xb668('0x14'),_0x39b79c,_0xb668('0x12'),JSON[_0xb668('0x15')](_0x27dbf7));if(_0x27dbf7[_0xb668('0x16')]){if(_0x27dbf7[_0xb668('0x16')][_0xb668('0x17')]===0x1f4){logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x3616e9(_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);}logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x45bc39(_0x27dbf7['error'][_0xb668('0x18')]);}else{logger['info'](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));_0x45bc39(_0x27dbf7['result'][_0xb668('0x18')]);}})[_0xb668('0x19')](function(_0x53ff78){logger[_0xb668('0x16')]('FaxMessage,\x20%s,\x20%s',_0x39b79c,_0x53ff78);_0x3616e9(_0x53ff78);});});}exports[_0xb668('0x1a')]=function(_0x178a5d){var _0x253ba5=this;return new Promise(function(_0x12805a,_0x5d33ae){return db[_0xb668('0x1b')][_0xb668('0x1c')](_0x178a5d[_0xb668('0x1d')],{'raw':_0x178a5d['options']?_0x178a5d['options'][_0xb668('0x1e')]===undefined?!![]:![]:!![]})[_0xb668('0xf')](function(_0x517eee){logger[_0xb668('0x10')]('CreateFaxMessage',_0x178a5d);logger[_0xb668('0x13')]('CreateFaxMessage',_0x178a5d,JSON[_0xb668('0x15')](_0x517eee));_0x12805a(_0x517eee);})[_0xb668('0x19')](function(_0x3f84c7){logger[_0xb668('0x16')](_0xb668('0x1a'),_0x3f84c7[_0xb668('0x18')],_0x178a5d);_0x5d33ae(_0x253ba5['error'](0x1f4,_0x3f84c7[_0xb668('0x18')]));});});};exports[_0xb668('0x1f')]=function(_0x2ab8c2){var _0x49abfd=this;return new Promise(function(_0x5e0cee,_0xe62fce){return db[_0xb668('0x1b')][_0xb668('0x20')](_0x2ab8c2['body'],{'raw':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab8c2['options']?_0x2ab8c2['options'][_0xb668('0x22')]||null:null,'attributes':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2['options'][_0xb668('0x23')]||null:null,'limit':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x24')]||null:null})[_0xb668('0xf')](function(_0x5f36b5){logger[_0xb668('0x10')](_0xb668('0x1f'),_0x2ab8c2);logger['debug'](_0xb668('0x1f'),_0x2ab8c2,JSON['stringify'](_0x5f36b5));_0x5e0cee(_0x5f36b5);})[_0xb668('0x19')](function(_0x406cc5){logger[_0xb668('0x16')](_0xb668('0x1f'),_0x406cc5[_0xb668('0x18')],_0x2ab8c2);_0xe62fce(_0x49abfd[_0xb668('0x16')](0x1f4,_0x406cc5[_0xb668('0x18')]));});});}; \ No newline at end of file +var _0xd6d6=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','update','where','limit','UpdateFaxMessage'];(function(_0x5128f5,_0x1c3dc7){var _0xfb645a=function(_0x3426c0){while(--_0x3426c0){_0x5128f5['push'](_0x5128f5['shift']());}};_0xfb645a(++_0x1c3dc7);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x17aafe,_0x12446f){_0x17aafe=_0x17aafe-0x0;var _0x45e0c2=_0xd6d6[_0x17aafe];return _0x45e0c2;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});config[_0x6d6d('0xc')]=_[_0x6d6d('0xd')](config[_0x6d6d('0xc')],{'host':_0x6d6d('0xe'),'port':0x18eb});var socket=require(_0x6d6d('0xf'))(new Redis(config[_0x6d6d('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x404c88,_0x1fa46d,_0x23b18a){return new BPromise(function(_0x290dfb,_0xf84314){return client['request'](_0x404c88,_0x23b18a)[_0x6d6d('0x10')](function(_0x158f82){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));logger[_0x6d6d('0x12')](_0x6d6d('0x13'),_0x1fa46d,_0x6d6d('0x11'),JSON[_0x6d6d('0x14')](_0x158f82));if(_0x158f82[_0x6d6d('0x15')]){if(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x16')]===0x1f4){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);return _0xf84314(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82['error'][_0x6d6d('0x18')]);return _0x290dfb(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));_0x290dfb(_0x158f82[_0x6d6d('0x19')][_0x6d6d('0x18')]);}})[_0x6d6d('0x1a')](function(_0x51fff6){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x51fff6);_0xf84314(_0x51fff6);});});}exports['CreateFaxMessage']=function(_0x26f631){var _0xb8590d=this;return new Promise(function(_0x30d87d,_0x450352){return db[_0x6d6d('0x1b')][_0x6d6d('0x1c')](_0x26f631[_0x6d6d('0x1d')],{'raw':_0x26f631[_0x6d6d('0x1e')]?_0x26f631[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![]})[_0x6d6d('0x10')](function(_0x6e58e3){logger[_0x6d6d('0x20')](_0x6d6d('0x21'),_0x26f631);logger[_0x6d6d('0x12')](_0x6d6d('0x21'),_0x26f631,JSON[_0x6d6d('0x14')](_0x6e58e3));_0x30d87d(_0x6e58e3);})['catch'](function(_0x3b73e5){logger[_0x6d6d('0x15')](_0x6d6d('0x21'),_0x3b73e5[_0x6d6d('0x18')],_0x26f631);_0x450352(_0xb8590d[_0x6d6d('0x15')](0x1f4,_0x3b73e5[_0x6d6d('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x2851dd){var _0x2b5e31=this;return new Promise(function(_0x235451,_0x126ac8){return db[_0x6d6d('0x1b')][_0x6d6d('0x22')](_0x2851dd[_0x6d6d('0x1d')],{'raw':_0x2851dd['options']?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2851dd['options']?_0x2851dd['options'][_0x6d6d('0x23')]||null:null,'attributes':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')]['attributes']||null:null,'limit':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x24')]||null:null})[_0x6d6d('0x10')](function(_0x64d1f7){logger[_0x6d6d('0x20')](_0x6d6d('0x25'),_0x2851dd);logger[_0x6d6d('0x12')](_0x6d6d('0x25'),_0x2851dd,JSON[_0x6d6d('0x14')](_0x64d1f7));_0x235451(_0x64d1f7);})['catch'](function(_0x1f9469){logger['error'](_0x6d6d('0x25'),_0x1f9469[_0x6d6d('0x18')],_0x2851dd);_0x126ac8(_0x2b5e31[_0x6d6d('0x15')](0x1f4,_0x1f9469[_0x6d6d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 2c82b63..65331a2 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a8c=['emit','removeListener','register','length','faxMessage:','./faxMessage.events','remove','update'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x4a8c,0x85));var _0xc4a8=function(_0x35fb93,_0x520d74){_0x35fb93=_0x35fb93-0x0;var _0x41be31=_0x4a8c[_0x35fb93];return _0x41be31;};'use strict';var FaxMessageEvents=require(_0xc4a8('0x0'));var events=['save',_0xc4a8('0x1'),_0xc4a8('0x2')];function createListener(_0x3516de,_0x2ade7f){return function(_0xa7df86){_0x2ade7f[_0xc4a8('0x3')](_0x3516de,_0xa7df86);};}function removeListener(_0x3306b2,_0x1a37c4){return function(){FaxMessageEvents[_0xc4a8('0x4')](_0x3306b2,_0x1a37c4);};}exports[_0xc4a8('0x5')]=function(_0x5019ff){for(var _0x11edc1=0x0,_0x2e59bd=events[_0xc4a8('0x6')];_0x11edc1<_0x2e59bd;_0x11edc1++){var _0x50f505=events[_0x11edc1];var _0x444ce7=createListener(_0xc4a8('0x7')+_0x50f505,_0x5019ff);FaxMessageEvents['on'](_0x50f505,_0x444ce7);}}; \ No newline at end of file +var _0x9c8a=['update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x207080,_0x44adf7){var _0x41bfda=function(_0x9ccd62){while(--_0x9ccd62){_0x207080['push'](_0x207080['shift']());}};_0x41bfda(++_0x44adf7);}(_0x9c8a,0x180));var _0xa9c8=function(_0x4c4958,_0x4aaeac){_0x4c4958=_0x4c4958-0x0;var _0x203577=_0x9c8a[_0x4c4958];return _0x203577;};'use strict';var FaxMessageEvents=require(_0xa9c8('0x0'));var events=[_0xa9c8('0x1'),_0xa9c8('0x2'),_0xa9c8('0x3')];function createListener(_0xb753fd,_0x2f2705){return function(_0x49570e){_0x2f2705[_0xa9c8('0x4')](_0xb753fd,_0x49570e);};}function removeListener(_0x21f45c,_0x58e778){return function(){FaxMessageEvents[_0xa9c8('0x5')](_0x21f45c,_0x58e778);};}exports[_0xa9c8('0x6')]=function(_0x36618c){for(var _0x212c14=0x0,_0x363626=events[_0xa9c8('0x7')];_0x212c14<_0x363626;_0x212c14++){var _0x2635e4=events[_0x212c14];var _0x1bc48f=createListener(_0xa9c8('0x8')+_0x2635e4,_0x36618c);FaxMessageEvents['on'](_0x2635e4,_0x1bc48f);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index bf46817..55c9b8a 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3140=['download','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x4a4699,_0x1a5c39){var _0x226675=function(_0x547376){while(--_0x547376){_0x4a4699['push'](_0x4a4699['shift']());}};_0x226675(++_0x1a5c39);}(_0x3140,0xaf));var _0x0314=function(_0x2f3067,_0x3bd93d){_0x2f3067=_0x2f3067-0x0;var _0x63e41e=_0x3140[_0x2f3067];return _0x63e41e;};'use strict';var multer=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var path=require(_0x0314('0x2'));var timeout=require(_0x0314('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0314('0x4'));var auth=require(_0x0314('0x5'));var interaction=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var controller=require(_0x0314('0x8'));router[_0x0314('0x9')]('/',auth[_0x0314('0xa')](),controller[_0x0314('0xb')]);router[_0x0314('0x9')](_0x0314('0xc'),auth[_0x0314('0xa')](),controller['describe']);router[_0x0314('0x9')](_0x0314('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0314('0x9')]('/:id/download',auth[_0x0314('0xa')](),controller[_0x0314('0xe')]);router[_0x0314('0xf')]('/',auth[_0x0314('0xa')](),interaction[_0x0314('0x10')](_0x0314('0x11'),'faxmessage:create'),controller[_0x0314('0x12')]);router[_0x0314('0x13')](_0x0314('0xd'),auth[_0x0314('0xa')](),controller[_0x0314('0x14')]);router[_0x0314('0x13')](_0x0314('0x15'),auth['isAuthenticated'](),controller[_0x0314('0x16')]);router[_0x0314('0x13')](_0x0314('0x17'),auth[_0x0314('0xa')](),controller[_0x0314('0x18')]);router[_0x0314('0x19')](_0x0314('0xd'),auth[_0x0314('0xa')](),controller['destroy']);module[_0x0314('0x1a')]=router; \ No newline at end of file +var _0x6f0d=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','/describe','describe','show','/:id/download','post','tracked','fax','create','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports'];(function(_0x379ee5,_0x336c42){var _0x114694=function(_0x55b2f5){while(--_0x55b2f5){_0x379ee5['push'](_0x379ee5['shift']());}};_0x114694(++_0x336c42);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xfa1196,_0x59a1ef){_0xfa1196=_0xfa1196-0x0;var _0x1e48c7=_0x6f0d[_0xfa1196];return _0x1e48c7;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var fs_extra=require(_0xd6f0('0x4'));var auth=require(_0xd6f0('0x5'));var interaction=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var controller=require(_0xd6f0('0x8'));router['get']('/',auth[_0xd6f0('0x9')](),controller['index']);router[_0xd6f0('0xa')](_0xd6f0('0xb'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xc')]);router['get']('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xa')](_0xd6f0('0xe'),auth[_0xd6f0('0x9')](),controller['download']);router[_0xd6f0('0xf')]('/',auth[_0xd6f0('0x9')](),interaction[_0xd6f0('0x10')](_0xd6f0('0x11'),'faxmessage:create'),controller[_0xd6f0('0x12')]);router[_0xd6f0('0x13')](_0xd6f0('0x14'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x15')]);router[_0xd6f0('0x13')](_0xd6f0('0x16'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x17')]);router['put'](_0xd6f0('0x18'),auth[_0xd6f0('0x9')](),controller['reject']);router[_0xd6f0('0x19')]('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x1a')]);module[_0xd6f0('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 4c3fcf5..c7b4933 100644 --- a/server/api/faxQueue/faxQueue.attributes.js +++ b/server/api/faxQueue/faxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8328=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x508c98,_0x4852ff){var _0x2b477e=function(_0x4e41f6){while(--_0x4e41f6){_0x508c98['push'](_0x508c98['shift']());}};_0x2b477e(++_0x4852ff);}(_0x8328,0xb3));var _0x8832=function(_0x5962e6,_0x15d851){_0x5962e6=_0x5962e6-0x0;var _0x1c975e=_0x8328[_0x5962e6];return _0x1c975e;};'use strict';var Sequelize=require(_0x8832('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8832('0x1')]},'timeout':{'type':Sequelize[_0x8832('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8832('0x3')](_0x8832('0x4'),_0x8832('0x5'),_0x8832('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x98f9=['sequelize','name','rrmemory','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98f9,0x1a8));var _0x998f=function(_0x54062d,_0x3aa5ff){_0x54062d=_0x54062d-0x0;var _0x35c8fb=_0x98f9[_0x54062d];return _0x35c8fb;};'use strict';var Sequelize=require(_0x998f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x998f('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x998f('0x2'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x998f('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index e869ac3..d04849a 100644 --- a/server/api/faxQueue/faxQueue.controller.js +++ b/server/api/faxQueue/faxQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfae4=['get','UserProfileResource','sendStatus','name','send','index','map','FaxQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','fields','include','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserFaxQueue','pick','FaxQueueId','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','team_has_fax_queues','join','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','addAgents','omit','isArray','userFaxQueue:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxQueue.socket','register','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x57c977,_0x3e2b21){var _0xae9995=function(_0x43f948){while(--_0x43f948){_0x57c977['push'](_0x57c977['shift']());}};_0xae9995(++_0x3e2b21);}(_0xfae4,0x187));var _0x4fae=function(_0x6a9bbe,_0x25e32e){_0x6a9bbe=_0x6a9bbe-0x0;var _0x45bf2d=_0xfae4[_0x6a9bbe];return _0x45bf2d;};'use strict';var emlformat=require(_0x4fae('0x0'));var rimraf=require(_0x4fae('0x1'));var zipdir=require(_0x4fae('0x2'));var jsonpatch=require(_0x4fae('0x3'));var rp=require(_0x4fae('0x4'));var moment=require(_0x4fae('0x5'));var BPromise=require(_0x4fae('0x6'));var Mustache=require(_0x4fae('0x7'));var util=require(_0x4fae('0x8'));var path=require(_0x4fae('0x9'));var sox=require('sox');var csv=require(_0x4fae('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4fae('0xb'));var crypto=require(_0x4fae('0xc'));var jsforce=require(_0x4fae('0xd'));var deskjs=require(_0x4fae('0xe'));var toCsv=require(_0x4fae('0xa'));var querystring=require(_0x4fae('0xf'));var Papa=require(_0x4fae('0x10'));var Redis=require(_0x4fae('0x11'));var authService=require(_0x4fae('0x12'));var qs=require(_0x4fae('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fae('0x14'));var logger=require(_0x4fae('0x15'))(_0x4fae('0x16'));var utils=require(_0x4fae('0x17'));var config=require(_0x4fae('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4fae('0x19'))['db'];config[_0x4fae('0x1a')]=_[_0x4fae('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4fae('0x1a')]));require(_0x4fae('0x1c'))[_0x4fae('0x1d')](socket);function respondWithStatusCode(_0xef8384,_0xae26c1){_0xae26c1=_0xae26c1||0xcc;return function(_0x12bdd9){if(_0x12bdd9){return _0xef8384['sendStatus'](_0xae26c1);}return _0xef8384[_0x4fae('0x1e')](_0xae26c1)[_0x4fae('0x1f')]();};}function respondWithResult(_0x4ce143,_0x3e172d){_0x3e172d=_0x3e172d||0xc8;return function(_0x553800){if(_0x553800){return _0x4ce143[_0x4fae('0x1e')](_0x3e172d)['json'](_0x553800);}};}function respondWithFilteredResult(_0xdcbf6,_0x3e0809){return function(_0x5622fb){if(_0x5622fb){var _0x3b1a01=typeof _0x3e0809[_0x4fae('0x20')]==='undefined'&&typeof _0x3e0809[_0x4fae('0x21')]===_0x4fae('0x22');var _0x50e51a=_0x5622fb[_0x4fae('0x23')];var _0x580aae=_0x3b1a01?0x0:_0x3e0809['offset'];var _0x3d2889=_0x3b1a01?_0x5622fb[_0x4fae('0x23')]:_0x3e0809[_0x4fae('0x20')]+_0x3e0809[_0x4fae('0x21')];var _0x25fafe;if(_0x3d2889>=_0x50e51a){_0x3d2889=_0x50e51a;_0x25fafe=0xc8;}else{_0x25fafe=0xce;}_0xdcbf6[_0x4fae('0x1e')](_0x25fafe);return _0xdcbf6['set'](_0x4fae('0x24'),_0x580aae+'-'+_0x3d2889+'/'+_0x50e51a)[_0x4fae('0x25')](_0x5622fb);}return null;};}function patchUpdates(_0x50e2ae){return function(_0xee0da){try{jsonpatch[_0x4fae('0x26')](_0xee0da,_0x50e2ae,!![]);}catch(_0x533c86){return BPromise[_0x4fae('0x27')](_0x533c86);}return _0xee0da[_0x4fae('0x28')]();};}function saveUpdates(_0x41ceb4,_0x313ce1){return function(_0xc67038){if(_0xc67038){return _0xc67038[_0x4fae('0x29')](_0x41ceb4)[_0x4fae('0x2a')](function(_0x532e01){return _0x532e01;});}return null;};}function removeEntity(_0x20f109,_0x3f18ed){return function(_0x5c75be){if(_0x5c75be){return _0x5c75be[_0x4fae('0x2b')]()[_0x4fae('0x2a')](function(){var _0x146b61=_0x5c75be[_0x4fae('0x2c')]({'plain':!![]});var _0x1b04e8='FaxQueues';return db[_0x4fae('0x2d')][_0x4fae('0x2b')]({'where':{'type':_0x1b04e8,'resourceId':_0x146b61['id']}})['then'](function(){return _0x5c75be;});})[_0x4fae('0x2a')](function(){_0x20f109[_0x4fae('0x1e')](0xcc)[_0x4fae('0x1f')]();});}};}function handleEntityNotFound(_0x1113ff,_0x5db36e){return function(_0x6426b7){if(!_0x6426b7){_0x1113ff[_0x4fae('0x2e')](0x194);}return _0x6426b7;};}function handleError(_0xd96efd,_0xd55278){_0xd55278=_0xd55278||0x1f4;return function(_0x3e5f18){logger['error'](_0x3e5f18['stack']);if(_0x3e5f18[_0x4fae('0x2f')]){delete _0x3e5f18[_0x4fae('0x2f')];}_0xd96efd[_0x4fae('0x1e')](_0xd55278)[_0x4fae('0x30')](_0x3e5f18);};}exports[_0x4fae('0x31')]=function(_0x448b47,_0x4c702d){var _0x9f03ee={},_0x586ced={},_0x47e569={'count':0x0,'rows':[]};var _0x338939=_[_0x4fae('0x32')](db[_0x4fae('0x33')][_0x4fae('0x34')],function(_0x2dcf12){return{'name':_0x2dcf12[_0x4fae('0x35')],'type':_0x2dcf12['type']['key']};});_0x586ced[_0x4fae('0x36')]=_[_0x4fae('0x32')](_0x338939,_0x4fae('0x2f'));_0x586ced[_0x4fae('0x37')]=_[_0x4fae('0x38')](_0x448b47[_0x4fae('0x37')]);_0x586ced[_0x4fae('0x39')]=_[_0x4fae('0x3a')](_0x586ced[_0x4fae('0x36')],_0x586ced[_0x4fae('0x37')]);_0x9f03ee[_0x4fae('0x3b')]=_[_0x4fae('0x3a')](_0x586ced['model'],qs['fields'](_0x448b47[_0x4fae('0x37')]['fields']));_0x9f03ee[_0x4fae('0x3b')]=_0x9f03ee[_0x4fae('0x3b')][_0x4fae('0x3c')]?_0x9f03ee[_0x4fae('0x3b')]:_0x586ced['model'];if(!_0x448b47[_0x4fae('0x37')][_0x4fae('0x3d')](_0x4fae('0x3e'))){_0x9f03ee[_0x4fae('0x21')]=qs[_0x4fae('0x21')](_0x448b47[_0x4fae('0x37')][_0x4fae('0x21')]);_0x9f03ee[_0x4fae('0x20')]=qs[_0x4fae('0x20')](_0x448b47[_0x4fae('0x37')]['offset']);}_0x9f03ee[_0x4fae('0x3f')]=qs[_0x4fae('0x40')](_0x448b47[_0x4fae('0x37')]['sort']);_0x9f03ee[_0x4fae('0x41')]=qs[_0x4fae('0x39')](_['pick'](_0x448b47['query'],_0x586ced[_0x4fae('0x39')]),_0x338939);if(_0x448b47['query']['filter']){_0x9f03ee[_0x4fae('0x41')]=_[_0x4fae('0x42')](_0x9f03ee['where'],{'$or':_[_0x4fae('0x32')](_0x338939,function(_0x163c0d){if(_0x163c0d[_0x4fae('0x43')]!==_0x4fae('0x44')){var _0x4e67e2={};_0x4e67e2[_0x163c0d['name']]={'$like':'%'+_0x448b47[_0x4fae('0x37')][_0x4fae('0x45')]+'%'};return _0x4e67e2;}})});}_0x9f03ee=_[_0x4fae('0x42')]({},_0x9f03ee,_0x448b47['options']);var _0x6384d8={'where':_0x9f03ee[_0x4fae('0x41')]};return db[_0x4fae('0x33')]['count'](_0x6384d8)[_0x4fae('0x2a')](function(_0x10b1fe){_0x47e569[_0x4fae('0x23')]=_0x10b1fe;if(_0x448b47[_0x4fae('0x37')][_0x4fae('0x46')]){_0x9f03ee['include']=[{'all':!![]}];}return db['FaxQueue'][_0x4fae('0x47')](_0x9f03ee);})[_0x4fae('0x2a')](function(_0x7fe3ef){_0x47e569[_0x4fae('0x48')]=_0x7fe3ef;return _0x47e569;})[_0x4fae('0x2a')](respondWithFilteredResult(_0x4c702d,_0x9f03ee))[_0x4fae('0x49')](handleError(_0x4c702d,null));};exports[_0x4fae('0x4a')]=function(_0x4a5dc0,_0xc423ef){var _0x117ebd={'raw':!![],'where':{'id':_0x4a5dc0[_0x4fae('0x4b')]['id']}},_0x5876a6={};_0x5876a6['model']=_[_0x4fae('0x38')](db['FaxQueue']['rawAttributes']);_0x5876a6[_0x4fae('0x37')]=_[_0x4fae('0x38')](_0x4a5dc0[_0x4fae('0x37')]);_0x5876a6[_0x4fae('0x39')]=_[_0x4fae('0x3a')](_0x5876a6[_0x4fae('0x36')],_0x5876a6['query']);_0x117ebd[_0x4fae('0x3b')]=_[_0x4fae('0x3a')](_0x5876a6[_0x4fae('0x36')],qs[_0x4fae('0x4c')](_0x4a5dc0[_0x4fae('0x37')][_0x4fae('0x4c')]));_0x117ebd[_0x4fae('0x3b')]=_0x117ebd[_0x4fae('0x3b')]['length']?_0x117ebd[_0x4fae('0x3b')]:_0x5876a6['model'];if(_0x4a5dc0['query']['includeAll']){_0x117ebd[_0x4fae('0x4d')]=[{'all':!![]}];}_0x117ebd=_[_0x4fae('0x42')]({},_0x117ebd,_0x4a5dc0[_0x4fae('0x4e')]);return db[_0x4fae('0x33')][_0x4fae('0x4f')](_0x117ebd)['then'](handleEntityNotFound(_0xc423ef,null))[_0x4fae('0x2a')](respondWithResult(_0xc423ef,null))['catch'](handleError(_0xc423ef,null));};exports[_0x4fae('0x50')]=function(_0x4df740,_0x35431c){return db[_0x4fae('0x33')][_0x4fae('0x50')](_0x4df740['body'],{})['then'](function(_0x904154){var _0x1b8878=_0x4df740['user']['get']({'plain':!![]});if(!_0x1b8878)throw new Error(_0x4fae('0x51'));if(_0x1b8878[_0x4fae('0x52')]===_0x4fae('0x53')){var _0x55e4cf=_0x904154[_0x4fae('0x2c')]({'plain':!![]});var _0x3145cd='FaxQueues';return db[_0x4fae('0x54')]['find']({'where':{'name':_0x3145cd,'userProfileId':_0x1b8878[_0x4fae('0x55')]},'raw':!![]})['then'](function(_0x954a3c){if(_0x954a3c&&_0x954a3c['autoAssociation']===0x0){return db[_0x4fae('0x2d')][_0x4fae('0x50')]({'name':_0x55e4cf['name'],'resourceId':_0x55e4cf['id'],'type':_0x954a3c[_0x4fae('0x2f')],'sectionId':_0x954a3c['id']},{})[_0x4fae('0x2a')](function(){return _0x904154;});}else{return _0x904154;}})[_0x4fae('0x49')](function(_0x25a88d){logger[_0x4fae('0x56')](_0x4fae('0x57'),_0x25a88d);throw _0x25a88d;});}return _0x904154;})[_0x4fae('0x2a')](respondWithResult(_0x35431c,0xc9))[_0x4fae('0x49')](handleError(_0x35431c,null));};exports[_0x4fae('0x29')]=function(_0x323e0c,_0x285b1e){if(_0x323e0c[_0x4fae('0x58')]['id']){delete _0x323e0c['body']['id'];}return db[_0x4fae('0x33')]['find']({'where':{'id':_0x323e0c['params']['id']}})[_0x4fae('0x2a')](handleEntityNotFound(_0x285b1e,null))[_0x4fae('0x2a')](saveUpdates(_0x323e0c['body'],null))['then'](respondWithResult(_0x285b1e,null))['catch'](handleError(_0x285b1e,null));};exports[_0x4fae('0x2b')]=function(_0x36679c,_0x100000){return db[_0x4fae('0x33')]['find']({'where':{'id':_0x36679c[_0x4fae('0x4b')]['id']}})[_0x4fae('0x2a')](handleEntityNotFound(_0x100000,null))[_0x4fae('0x2a')](removeEntity(_0x100000,null))['catch'](handleError(_0x100000,null));};exports[_0x4fae('0x59')]=function(_0x3444a4,_0x40e825){return db[_0x4fae('0x33')]['describe']()[_0x4fae('0x2a')](respondWithResult(_0x40e825,null))[_0x4fae('0x49')](handleError(_0x40e825,null));};exports[_0x4fae('0x5a')]=function(_0x59e2b0,_0x37cf65,_0x207c8a){var _0x271544={'raw':!![],'where':{}},_0x47f744={},_0x5c60d4;return db[_0x4fae('0x33')]['findOne']({'where':{'id':_0x59e2b0[_0x4fae('0x4b')]['id']}})[_0x4fae('0x2a')](handleEntityNotFound(_0x37cf65,null))['then'](function(_0x381517){if(_0x381517){_0x5c60d4=_0x381517[_0x4fae('0x2c')]({'plain':!![]});_0x47f744[_0x4fae('0x36')]=_[_0x4fae('0x38')](db[_0x4fae('0x5b')][_0x4fae('0x34')]);_0x47f744['query']=_['keys'](_0x59e2b0['query']);_0x47f744[_0x4fae('0x39')]=_[_0x4fae('0x3a')](_0x47f744['model'],_0x47f744[_0x4fae('0x37')]);_0x271544['attributes']=_[_0x4fae('0x3a')](_0x47f744[_0x4fae('0x36')],qs[_0x4fae('0x4c')](_0x59e2b0[_0x4fae('0x37')]['fields']));_0x271544['attributes']=_0x271544[_0x4fae('0x3b')][_0x4fae('0x3c')]?_0x271544[_0x4fae('0x3b')]:_0x47f744[_0x4fae('0x36')];if(!_0x59e2b0[_0x4fae('0x37')][_0x4fae('0x3d')]('nolimit')){_0x271544['limit']=qs[_0x4fae('0x21')](_0x59e2b0[_0x4fae('0x37')][_0x4fae('0x21')]);_0x271544[_0x4fae('0x20')]=qs['offset'](_0x59e2b0[_0x4fae('0x37')]['offset']);}_0x271544[_0x4fae('0x3f')]=qs[_0x4fae('0x40')](_0x59e2b0[_0x4fae('0x37')][_0x4fae('0x40')]);_0x271544['where']=qs[_0x4fae('0x39')](_[_0x4fae('0x5c')](_0x59e2b0[_0x4fae('0x37')],_0x47f744[_0x4fae('0x39')]));_0x271544[_0x4fae('0x41')][_0x4fae('0x5d')]=_0x381517['id'];if(_0x59e2b0[_0x4fae('0x37')][_0x4fae('0x45')]){_0x271544[_0x4fae('0x41')]=_['merge'](_0x271544[_0x4fae('0x41')],{'$or':_['map'](_0x271544[_0x4fae('0x3b')],function(_0xc1a69b){var _0x107ffe={};_0x107ffe[_0xc1a69b]={'$like':'%'+_0x59e2b0[_0x4fae('0x37')]['filter']+'%'};return _0x107ffe;})});}_0x271544=_[_0x4fae('0x42')]({},_0x271544,_0x59e2b0[_0x4fae('0x4e')]);return db[_0x4fae('0x5b')][_0x4fae('0x47')](_0x271544);}})[_0x4fae('0x2a')](function(_0x7feda2){if(_0x7feda2){return db['User'][_0x4fae('0x5e')]({'where':{'id':_[_0x4fae('0x32')](_0x7feda2,'UserId'),'role':_0x4fae('0x5f')},'attributes':['id','name',_0x4fae('0x60'),_0x4fae('0x61'),_0x4fae('0x62')]});}})[_0x4fae('0x2a')](function(_0x197352){if(_0x197352){return{'count':_0x197352[_0x4fae('0x23')],'rows':_[_0x4fae('0x32')](_0x197352[_0x4fae('0x48')],function(_0x5cba9e){return{'membername':_0x5cba9e[_0x4fae('0x2f')],'UserId':_0x5cba9e['id'],'queue_name':_0x5c60d4['name'],'FaxQueueId':_0x5c60d4['id'],'interface':util[_0x4fae('0x63')](_0x4fae('0x64'),_0x4fae('0x65'),_0x5cba9e[_0x4fae('0x2f')]),'penalty':0x0,'paused':_0x5cba9e[_0x4fae('0x60')],'createdAt':_0x5cba9e[_0x4fae('0x62')],'updatedAt':_0x5cba9e[_0x4fae('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x37cf65,_0x271544))['catch'](handleError(_0x37cf65,null));};exports['getTeams']=function(_0x36e902,_0x545458,_0x54dde2){var _0x3cd866={};var _0x1300ff={};var _0x19d48d;var _0x50611a;return db['FaxQueue'][_0x4fae('0x66')]({'where':{'id':_0x36e902[_0x4fae('0x4b')]['id']}})[_0x4fae('0x2a')](handleEntityNotFound(_0x545458,null))[_0x4fae('0x2a')](function(_0x79e0a8){if(_0x79e0a8){_0x19d48d=_0x79e0a8;_0x1300ff[_0x4fae('0x36')]=_[_0x4fae('0x38')](db[_0x4fae('0x67')][_0x4fae('0x34')]);_0x1300ff[_0x4fae('0x37')]=_['keys'](_0x36e902[_0x4fae('0x37')]);_0x1300ff[_0x4fae('0x39')]=_[_0x4fae('0x3a')](_0x1300ff['model'],_0x1300ff[_0x4fae('0x37')]);_0x3cd866[_0x4fae('0x3b')]=_[_0x4fae('0x3a')](_0x1300ff['model'],qs['fields'](_0x36e902['query']['fields']));_0x3cd866[_0x4fae('0x3b')]=_0x3cd866['attributes'][_0x4fae('0x3c')]?_0x3cd866[_0x4fae('0x3b')]:_0x1300ff[_0x4fae('0x36')];_0x3cd866[_0x4fae('0x3f')]=qs['sort'](_0x36e902[_0x4fae('0x37')][_0x4fae('0x40')]);_0x3cd866[_0x4fae('0x41')]=qs[_0x4fae('0x39')](_[_0x4fae('0x5c')](_0x36e902[_0x4fae('0x37')],_0x1300ff[_0x4fae('0x39')]));if(_0x36e902['query'][_0x4fae('0x45')]){_0x3cd866[_0x4fae('0x41')]=_[_0x4fae('0x42')](_0x3cd866['where'],{'$or':_['map'](_0x3cd866['attributes'],function(_0x247587){var _0x1da1e0={};_0x1da1e0[_0x247587]={'$like':'%'+_0x36e902['query'][_0x4fae('0x45')]+'%'};return _0x1da1e0;})});}_0x3cd866=_[_0x4fae('0x42')]({},_0x3cd866,_0x36e902[_0x4fae('0x4e')]);return _0x19d48d[_0x4fae('0x68')](_0x3cd866);}})[_0x4fae('0x2a')](function(_0x5f0c42){if(_0x5f0c42){_0x50611a=_0x5f0c42[_0x4fae('0x3c')];if(!_0x36e902['query'][_0x4fae('0x3d')]('nolimit')){_0x3cd866['limit']=qs[_0x4fae('0x21')](_0x36e902[_0x4fae('0x37')]['limit']);_0x3cd866[_0x4fae('0x20')]=qs[_0x4fae('0x20')](_0x36e902[_0x4fae('0x37')][_0x4fae('0x20')]);}return _0x19d48d[_0x4fae('0x68')](_0x3cd866);}})[_0x4fae('0x2a')](function(_0x77bd4a){if(_0x77bd4a){return _0x77bd4a?{'count':_0x50611a,'rows':_0x77bd4a}:null;}})['then'](respondWithResult(_0x545458,null))[_0x4fae('0x49')](handleError(_0x545458,null));};exports['addTeams']=function(_0x572874,_0x2786fb,_0x267a24){var _0x29c861=_0x572874[_0x4fae('0x58')][_0x4fae('0x69')];return db[_0x4fae('0x67')]['findAll']({'where':{'id':_0x29c861},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4fae('0x6a'),'attributes':['id',_0x4fae('0x2f'),_0x4fae('0x6b'),_0x4fae('0x6c'),_0x4fae('0x6d')],'raw':!![]}]})[_0x4fae('0x2a')](function(_0x180a5c){if(_0x180a5c){var _0x4bf7e3=_[_0x4fae('0x6e')](_0x180a5c,function(_0x4fe0ff){var _0x1ce59f=_0x4fe0ff[_0x4fae('0x2c')]({'plain':!![]});return _0x1ce59f['Agents'];});return db['FaxQueue'][_0x4fae('0x4f')]({'where':{'id':_0x572874[_0x4fae('0x4b')]['id']}})[_0x4fae('0x2a')](function(_0x2b9264){return db[_0x4fae('0x6f')][_0x4fae('0x70')](function(_0x345306){return _0x2b9264[_0x4fae('0x71')](_0x29c861,{'transaction':_0x345306})['then'](function(){return BPromise[_0x4fae('0x72')](_0x4bf7e3,function(_0x1ad206){return db[_0x4fae('0x5b')][_0x4fae('0x73')]({'where':{'UserId':_0x1ad206['id'],'FaxQueueId':_0x572874[_0x4fae('0x4b')]['id']},'transaction':_0x345306});});})[_0x4fae('0x2a')](function(){_0x4bf7e3['forEach'](function(_0x328736){socket[_0x4fae('0x74')](_0x4fae('0x75'),{'UserId':_0x328736['id'],'FaxQueueId':_0x2b9264['id']});});});});});}})['then'](respondWithStatusCode(_0x2786fb,null))[_0x4fae('0x49')](handleError(_0x2786fb,null));};exports[_0x4fae('0x76')]=function(_0x300556,_0x39f74d,_0x1f53b8){return db[_0x4fae('0x67')][_0x4fae('0x47')]({'where':{'id':_0x300556['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4fae('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x4fae('0x2a')](handleEntityNotFound(_0x39f74d,null))[_0x4fae('0x2a')](function(_0x5d5ac2){var _0x614e88=_[_0x4fae('0x32')](_0x5d5ac2,'id');var _0x39dfcb=[];var _0xb34535=[];var _0x35f91b=squel[_0x4fae('0x77')]();_0x35f91b[_0x4fae('0x78')](_0x4fae('0x79'))['from'](_0x4fae('0x7a'),'tq')[_0x4fae('0x7b')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4fae('0x41')](_0x4fae('0x7c'),_0x300556[_0x4fae('0x4b')]['id']);for(var _0x1dcc20=0x0;_0x1dcc20<_0x5d5ac2[_0x4fae('0x3c')];_0x1dcc20+=0x1){let _0x59b43a=_0x5d5ac2[_0x1dcc20];for(var _0x390004=0x0;_0x390004<_0x59b43a[_0x4fae('0x6a')][_0x4fae('0x3c')];_0x390004+=0x1){let _0xe3d05c=_0x59b43a[_0x4fae('0x6a')][_0x390004];var _0x1277a6=_0x35f91b[_0x4fae('0x7d')]();_0x1277a6['where'](_0x4fae('0x7e'),_0xe3d05c['id']);_0xb34535[_0x4fae('0x7f')](db[_0x4fae('0x6f')]['query'](_0x1277a6[_0x4fae('0x80')](),{'type':db['sequelize'][_0x4fae('0x81')][_0x4fae('0x82')]})[_0x4fae('0x2a')](function(_0x111929){if(_0x111929['length']===0x1){return _0xe3d05c['id'];}else{var _0x5d38d3=_[_0x4fae('0x83')](_['map'](_0x111929,_0x4fae('0x84')),function(_0x51f3f9){return _[_0x4fae('0x85')](_0x614e88,_0x51f3f9);});if(_0x5d38d3){return _0xe3d05c['id'];}}}));}}return BPromise[_0x4fae('0x86')](_0xb34535)[_0x4fae('0x2a')](function(_0x481b71){_0x39dfcb=_(_0x39dfcb)[_0x4fae('0x87')](_0x481b71)['compact']()[_0x4fae('0x88')]();return db[_0x4fae('0x33')]['find']({'where':{'id':_0x300556['params']['id']}})['then'](function(_0x47a9d3){return db[_0x4fae('0x6f')]['transaction'](function(_0x1273d8){return _0x47a9d3[_0x4fae('0x76')](_0x300556[_0x4fae('0x37')]['ids'],{'transaction':_0x1273d8})['then'](function(){if(!_[_0x4fae('0x89')](_0x39dfcb)){return _0x47a9d3[_0x4fae('0x8a')](_0x39dfcb,{'transaction':_0x1273d8});}})[_0x4fae('0x2a')](function(){_0x39dfcb['forEach'](function(_0xdedee4){socket[_0x4fae('0x74')]('userFaxQueue:remove',{'UserId':_0xdedee4,'FaxQueueId':_0x47a9d3['id']});});});});});});})['then'](respondWithStatusCode(_0x39f74d,null))['catch'](handleError(_0x39f74d,null));};exports[_0x4fae('0x8b')]=function(_0xc12eb5,_0x35f6b7,_0x26c136){return db[_0x4fae('0x33')][_0x4fae('0x4f')]({'where':{'id':_0xc12eb5[_0x4fae('0x4b')]['id']}})[_0x4fae('0x2a')](handleEntityNotFound(_0x35f6b7,null))[_0x4fae('0x2a')](function(_0xaee02c){if(_0xaee02c){return _0xaee02c[_0x4fae('0x8b')](_0xc12eb5['body']['ids'],_[_0x4fae('0x8c')](_0xc12eb5[_0x4fae('0x58')],[_0x4fae('0x69'),'id'])||{})['spread'](function(_0x31c3b5){for(var _0x383c56=0x0;_0x383c56<_0xc12eb5[_0x4fae('0x58')][_0x4fae('0x69')][_0x4fae('0x3c')];_0x383c56+=0x1){socket['emit'](_0x4fae('0x75'),{'UserId':Number(_0xc12eb5[_0x4fae('0x58')][_0x4fae('0x69')][_0x383c56]),'FaxQueueId':Number(_0xc12eb5['params']['id'])});}return _0x31c3b5;});}})[_0x4fae('0x2a')](respondWithResult(_0x35f6b7,null))['catch'](handleError(_0x35f6b7,null));};exports[_0x4fae('0x8a')]=function(_0x16704,_0x587ae6,_0x26adde){return db[_0x4fae('0x33')][_0x4fae('0x4f')]({'where':{'id':_0x16704[_0x4fae('0x4b')]['id']}})[_0x4fae('0x2a')](handleEntityNotFound(_0x587ae6,null))[_0x4fae('0x2a')](function(_0x3db05a){if(_0x3db05a){return _0x3db05a[_0x4fae('0x8a')](_0x16704[_0x4fae('0x37')][_0x4fae('0x69')])[_0x4fae('0x2a')](function(){if(_[_0x4fae('0x8d')](_0x16704[_0x4fae('0x37')][_0x4fae('0x69')])){for(var _0x1bf10d=0x0;_0x1bf10d<_0x16704[_0x4fae('0x37')]['ids'][_0x4fae('0x3c')];_0x1bf10d+=0x1){socket['emit'](_0x4fae('0x8e'),{'UserId':Number(_0x16704[_0x4fae('0x37')][_0x4fae('0x69')][_0x1bf10d]),'FaxQueueId':Number(_0x16704[_0x4fae('0x4b')]['id'])});}}else{socket['emit'](_0x4fae('0x8e'),{'UserId':Number(_0x16704['query']['ids']),'FaxQueueId':Number(_0x16704['params']['id'])});}});}})[_0x4fae('0x2a')](respondWithStatusCode(_0x587ae6,null))['catch'](handleError(_0x587ae6,null));};exports[_0x4fae('0x8f')]=function(_0x168a4e,_0x41d3dc,_0x13fd7e){var _0x5a31f1={};var _0x25783a={};var _0x5564a2;var _0x179cf4;return db[_0x4fae('0x33')][_0x4fae('0x66')]({'where':{'id':_0x168a4e[_0x4fae('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41d3dc,null))[_0x4fae('0x2a')](function(_0x5a0576){if(_0x5a0576){_0x5564a2=_0x5a0576;_0x25783a[_0x4fae('0x36')]=_[_0x4fae('0x38')](db[_0x4fae('0x90')][_0x4fae('0x34')]);_0x25783a['query']=_['keys'](_0x168a4e[_0x4fae('0x37')]);_0x25783a[_0x4fae('0x39')]=_[_0x4fae('0x3a')](_0x25783a['model'],_0x25783a[_0x4fae('0x37')]);_0x5a31f1[_0x4fae('0x3b')]=_['intersection'](_0x25783a['model'],qs[_0x4fae('0x4c')](_0x168a4e[_0x4fae('0x37')][_0x4fae('0x4c')]));_0x5a31f1[_0x4fae('0x3b')]=_0x5a31f1[_0x4fae('0x3b')][_0x4fae('0x3c')]?_0x5a31f1[_0x4fae('0x3b')]:_0x25783a[_0x4fae('0x36')];_0x5a31f1[_0x4fae('0x3f')]=qs[_0x4fae('0x40')](_0x168a4e[_0x4fae('0x37')][_0x4fae('0x40')]);_0x5a31f1[_0x4fae('0x41')]=qs[_0x4fae('0x39')](_[_0x4fae('0x5c')](_0x168a4e[_0x4fae('0x37')],_0x25783a[_0x4fae('0x39')]));if(_0x168a4e[_0x4fae('0x37')][_0x4fae('0x45')]){_0x5a31f1[_0x4fae('0x41')]=_[_0x4fae('0x42')](_0x5a31f1[_0x4fae('0x41')],{'$or':_[_0x4fae('0x32')](_0x5a31f1[_0x4fae('0x3b')],function(_0x127f44){var _0x2314fd={};_0x2314fd[_0x127f44]={'$like':'%'+_0x168a4e[_0x4fae('0x37')][_0x4fae('0x45')]+'%'};return _0x2314fd;})});}_0x5a31f1=_[_0x4fae('0x42')]({},_0x5a31f1,_0x168a4e[_0x4fae('0x4e')]);return _0x5564a2['getAgents'](_0x5a31f1);}})[_0x4fae('0x2a')](function(_0x3aed08){if(_0x3aed08){_0x179cf4=_0x3aed08[_0x4fae('0x3c')];if(!_0x168a4e[_0x4fae('0x37')]['hasOwnProperty'](_0x4fae('0x3e'))){_0x5a31f1[_0x4fae('0x21')]=qs[_0x4fae('0x21')](_0x168a4e[_0x4fae('0x37')][_0x4fae('0x21')]);_0x5a31f1[_0x4fae('0x20')]=qs[_0x4fae('0x20')](_0x168a4e[_0x4fae('0x37')]['offset']);}return _0x5564a2[_0x4fae('0x8f')](_0x5a31f1);}})['then'](function(_0x6bfe26){if(_0x6bfe26){return _0x6bfe26?{'count':_0x179cf4,'rows':_0x6bfe26}:null;}})[_0x4fae('0x2a')](respondWithResult(_0x41d3dc,null))[_0x4fae('0x49')](handleError(_0x41d3dc,null));}; \ No newline at end of file +var _0x0071=['../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','undefined','limit','offset','Content-Range','apply','reject','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','sort','where','filter','merge','type','options','includeAll','findAll','rows','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','order','pick','User','findAndCountAll','UserId','agent','faxPause','updatedAt','count','format','%s/%s','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','removeTeams','ids','select','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','transaction','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','request-promise','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x433962,_0x45dac4){var _0x5daa34=function(_0x135afc){while(--_0x135afc){_0x433962['push'](_0x433962['shift']());}};_0x5daa34(++_0x45dac4);}(_0x0071,0x70));var _0x1007=function(_0x5ea60b,_0x3225bd){_0x5ea60b=_0x5ea60b-0x0;var _0x4a584a=_0x0071[_0x5ea60b];return _0x4a584a;};'use strict';var emlformat=require(_0x1007('0x0'));var rimraf=require(_0x1007('0x1'));var zipdir=require(_0x1007('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1007('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1007('0x4'));var _=require(_0x1007('0x5'));var squel=require(_0x1007('0x6'));var crypto=require(_0x1007('0x7'));var jsforce=require(_0x1007('0x8'));var deskjs=require(_0x1007('0x9'));var toCsv=require(_0x1007('0xa'));var querystring=require(_0x1007('0xb'));var Papa=require(_0x1007('0xc'));var Redis=require('ioredis');var authService=require(_0x1007('0xd'));var qs=require(_0x1007('0xe'));var as=require(_0x1007('0xf'));var hardwareService=require(_0x1007('0x10'));var logger=require(_0x1007('0x11'))(_0x1007('0x12'));var utils=require(_0x1007('0x13'));var config=require(_0x1007('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1007('0x15'))['db'];config[_0x1007('0x16')]=_[_0x1007('0x17')](config[_0x1007('0x16')],{'host':_0x1007('0x18'),'port':0x18eb});var socket=require(_0x1007('0x19'))(new Redis(config[_0x1007('0x16')]));require(_0x1007('0x1a'))[_0x1007('0x1b')](socket);function respondWithStatusCode(_0x5394b9,_0x4da941){_0x4da941=_0x4da941||0xcc;return function(_0x5a4b48){if(_0x5a4b48){return _0x5394b9[_0x1007('0x1c')](_0x4da941);}return _0x5394b9[_0x1007('0x1d')](_0x4da941)[_0x1007('0x1e')]();};}function respondWithResult(_0x35d9fa,_0x5ad2c9){_0x5ad2c9=_0x5ad2c9||0xc8;return function(_0x270530){if(_0x270530){return _0x35d9fa[_0x1007('0x1d')](_0x5ad2c9)['json'](_0x270530);}};}function respondWithFilteredResult(_0x446fa5,_0x1bdc35){return function(_0x1a2c75){if(_0x1a2c75){var _0x14ec11=typeof _0x1bdc35['offset']===_0x1007('0x1f')&&typeof _0x1bdc35[_0x1007('0x20')]==='undefined';var _0x570b18=_0x1a2c75['count'];var _0x124700=_0x14ec11?0x0:_0x1bdc35['offset'];var _0x3fa003=_0x14ec11?_0x1a2c75['count']:_0x1bdc35[_0x1007('0x21')]+_0x1bdc35['limit'];var _0x221d6f;if(_0x3fa003>=_0x570b18){_0x3fa003=_0x570b18;_0x221d6f=0xc8;}else{_0x221d6f=0xce;}_0x446fa5[_0x1007('0x1d')](_0x221d6f);return _0x446fa5['set'](_0x1007('0x22'),_0x124700+'-'+_0x3fa003+'/'+_0x570b18)['json'](_0x1a2c75);}return null;};}function patchUpdates(_0x1f6a1e){return function(_0x5218d3){try{jsonpatch[_0x1007('0x23')](_0x5218d3,_0x1f6a1e,!![]);}catch(_0x283e93){return BPromise[_0x1007('0x24')](_0x283e93);}return _0x5218d3['save']();};}function saveUpdates(_0x25758b,_0x571ad4){return function(_0x193fef){if(_0x193fef){return _0x193fef[_0x1007('0x25')](_0x25758b)[_0x1007('0x26')](function(_0x445dca){return _0x445dca;});}return null;};}function removeEntity(_0x352d90,_0x4a87af){return function(_0x2fc1b2){if(_0x2fc1b2){return _0x2fc1b2[_0x1007('0x27')]()['then'](function(){var _0x2171bf=_0x2fc1b2[_0x1007('0x28')]({'plain':!![]});var _0x53e04c=_0x1007('0x29');return db[_0x1007('0x2a')]['destroy']({'where':{'type':_0x53e04c,'resourceId':_0x2171bf['id']}})[_0x1007('0x26')](function(){return _0x2fc1b2;});})[_0x1007('0x26')](function(){_0x352d90[_0x1007('0x1d')](0xcc)[_0x1007('0x1e')]();});}};}function handleEntityNotFound(_0x115b94,_0x11981b){return function(_0x3f3a3d){if(!_0x3f3a3d){_0x115b94[_0x1007('0x1c')](0x194);}return _0x3f3a3d;};}function handleError(_0x5b42e2,_0x2b51d0){_0x2b51d0=_0x2b51d0||0x1f4;return function(_0x236ffb){logger[_0x1007('0x2b')](_0x236ffb[_0x1007('0x2c')]);if(_0x236ffb[_0x1007('0x2d')]){delete _0x236ffb[_0x1007('0x2d')];}_0x5b42e2[_0x1007('0x1d')](_0x2b51d0)[_0x1007('0x2e')](_0x236ffb);};}exports[_0x1007('0x2f')]=function(_0x1aaedd,_0x361544){var _0x252e2f={},_0x15ee35={},_0x13f54b={'count':0x0,'rows':[]};var _0x3ca86b=_[_0x1007('0x30')](db[_0x1007('0x31')][_0x1007('0x32')],function(_0x3f1870){return{'name':_0x3f1870['fieldName'],'type':_0x3f1870['type']['key']};});_0x15ee35['model']=_[_0x1007('0x30')](_0x3ca86b,_0x1007('0x2d'));_0x15ee35[_0x1007('0x33')]=_[_0x1007('0x34')](_0x1aaedd[_0x1007('0x33')]);_0x15ee35[_0x1007('0x35')]=_[_0x1007('0x36')](_0x15ee35['model'],_0x15ee35[_0x1007('0x33')]);_0x252e2f[_0x1007('0x37')]=_[_0x1007('0x36')](_0x15ee35[_0x1007('0x38')],qs[_0x1007('0x39')](_0x1aaedd[_0x1007('0x33')]['fields']));_0x252e2f[_0x1007('0x37')]=_0x252e2f['attributes'][_0x1007('0x3a')]?_0x252e2f[_0x1007('0x37')]:_0x15ee35[_0x1007('0x38')];if(!_0x1aaedd[_0x1007('0x33')]['hasOwnProperty']('nolimit')){_0x252e2f[_0x1007('0x20')]=qs[_0x1007('0x20')](_0x1aaedd[_0x1007('0x33')][_0x1007('0x20')]);_0x252e2f[_0x1007('0x21')]=qs[_0x1007('0x21')](_0x1aaedd[_0x1007('0x33')]['offset']);}_0x252e2f['order']=qs[_0x1007('0x3b')](_0x1aaedd['query']['sort']);_0x252e2f[_0x1007('0x3c')]=qs[_0x1007('0x35')](_['pick'](_0x1aaedd[_0x1007('0x33')],_0x15ee35[_0x1007('0x35')]),_0x3ca86b);if(_0x1aaedd[_0x1007('0x33')][_0x1007('0x3d')]){_0x252e2f[_0x1007('0x3c')]=_[_0x1007('0x3e')](_0x252e2f[_0x1007('0x3c')],{'$or':_[_0x1007('0x30')](_0x3ca86b,function(_0x3a9cd8){if(_0x3a9cd8[_0x1007('0x3f')]!=='VIRTUAL'){var _0x1d7763={};_0x1d7763[_0x3a9cd8['name']]={'$like':'%'+_0x1aaedd[_0x1007('0x33')][_0x1007('0x3d')]+'%'};return _0x1d7763;}})});}_0x252e2f=_['merge']({},_0x252e2f,_0x1aaedd[_0x1007('0x40')]);var _0x5ecf12={'where':_0x252e2f[_0x1007('0x3c')]};return db[_0x1007('0x31')]['count'](_0x5ecf12)[_0x1007('0x26')](function(_0x57bd92){_0x13f54b['count']=_0x57bd92;if(_0x1aaedd[_0x1007('0x33')][_0x1007('0x41')]){_0x252e2f['include']=[{'all':!![]}];}return db['FaxQueue'][_0x1007('0x42')](_0x252e2f);})[_0x1007('0x26')](function(_0x1d35c1){_0x13f54b[_0x1007('0x43')]=_0x1d35c1;return _0x13f54b;})[_0x1007('0x26')](respondWithFilteredResult(_0x361544,_0x252e2f))[_0x1007('0x44')](handleError(_0x361544,null));};exports['show']=function(_0x1c6af3,_0x3d10ba){var _0x583a81={'raw':!![],'where':{'id':_0x1c6af3[_0x1007('0x45')]['id']}},_0x5ec951={};_0x5ec951[_0x1007('0x38')]=_[_0x1007('0x34')](db[_0x1007('0x31')][_0x1007('0x32')]);_0x5ec951[_0x1007('0x33')]=_[_0x1007('0x34')](_0x1c6af3[_0x1007('0x33')]);_0x5ec951[_0x1007('0x35')]=_[_0x1007('0x36')](_0x5ec951[_0x1007('0x38')],_0x5ec951[_0x1007('0x33')]);_0x583a81[_0x1007('0x37')]=_['intersection'](_0x5ec951[_0x1007('0x38')],qs['fields'](_0x1c6af3[_0x1007('0x33')][_0x1007('0x39')]));_0x583a81['attributes']=_0x583a81[_0x1007('0x37')][_0x1007('0x3a')]?_0x583a81[_0x1007('0x37')]:_0x5ec951[_0x1007('0x38')];if(_0x1c6af3[_0x1007('0x33')][_0x1007('0x41')]){_0x583a81[_0x1007('0x46')]=[{'all':!![]}];}_0x583a81=_[_0x1007('0x3e')]({},_0x583a81,_0x1c6af3[_0x1007('0x40')]);return db['FaxQueue'][_0x1007('0x47')](_0x583a81)['then'](handleEntityNotFound(_0x3d10ba,null))[_0x1007('0x26')](respondWithResult(_0x3d10ba,null))[_0x1007('0x44')](handleError(_0x3d10ba,null));};exports[_0x1007('0x48')]=function(_0xaa20dc,_0x515652){return db[_0x1007('0x31')][_0x1007('0x48')](_0xaa20dc[_0x1007('0x49')],{})['then'](function(_0x2220cd){var _0x5b609f=_0xaa20dc[_0x1007('0x4a')]['get']({'plain':!![]});if(!_0x5b609f)throw new Error(_0x1007('0x4b'));if(_0x5b609f[_0x1007('0x4c')]===_0x1007('0x4a')){var _0x10bdfb=_0x2220cd['get']({'plain':!![]});var _0x28286c=_0x1007('0x29');return db[_0x1007('0x4d')]['find']({'where':{'name':_0x28286c,'userProfileId':_0x5b609f['userProfileId']},'raw':!![]})[_0x1007('0x26')](function(_0x35dc57){if(_0x35dc57&&_0x35dc57['autoAssociation']===0x0){return db[_0x1007('0x2a')][_0x1007('0x48')]({'name':_0x10bdfb[_0x1007('0x2d')],'resourceId':_0x10bdfb['id'],'type':_0x35dc57[_0x1007('0x2d')],'sectionId':_0x35dc57['id']},{})['then'](function(){return _0x2220cd;});}else{return _0x2220cd;}})[_0x1007('0x44')](function(_0x4787aa){logger[_0x1007('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4787aa);throw _0x4787aa;});}return _0x2220cd;})['then'](respondWithResult(_0x515652,0xc9))[_0x1007('0x44')](handleError(_0x515652,null));};exports[_0x1007('0x25')]=function(_0x3e842b,_0x3a31c8){if(_0x3e842b[_0x1007('0x49')]['id']){delete _0x3e842b[_0x1007('0x49')]['id'];}return db[_0x1007('0x31')][_0x1007('0x47')]({'where':{'id':_0x3e842b[_0x1007('0x45')]['id']}})[_0x1007('0x26')](handleEntityNotFound(_0x3a31c8,null))[_0x1007('0x26')](saveUpdates(_0x3e842b[_0x1007('0x49')],null))[_0x1007('0x26')](respondWithResult(_0x3a31c8,null))['catch'](handleError(_0x3a31c8,null));};exports['destroy']=function(_0x3e5ba0,_0x147156){return db[_0x1007('0x31')][_0x1007('0x47')]({'where':{'id':_0x3e5ba0[_0x1007('0x45')]['id']}})[_0x1007('0x26')](handleEntityNotFound(_0x147156,null))[_0x1007('0x26')](removeEntity(_0x147156,null))[_0x1007('0x44')](handleError(_0x147156,null));};exports[_0x1007('0x4e')]=function(_0x24281c,_0x2ed1b5){return db[_0x1007('0x31')][_0x1007('0x4e')]()[_0x1007('0x26')](respondWithResult(_0x2ed1b5,null))[_0x1007('0x44')](handleError(_0x2ed1b5,null));};exports[_0x1007('0x4f')]=function(_0x16f013,_0x4a8569,_0x50c353){var _0x3d21d4={'raw':!![],'where':{}},_0x4d6d55={},_0x172a93;return db['FaxQueue'][_0x1007('0x50')]({'where':{'id':_0x16f013['params']['id']}})[_0x1007('0x26')](handleEntityNotFound(_0x4a8569,null))['then'](function(_0x440959){if(_0x440959){_0x172a93=_0x440959[_0x1007('0x28')]({'plain':!![]});_0x4d6d55[_0x1007('0x38')]=_[_0x1007('0x34')](db[_0x1007('0x51')][_0x1007('0x32')]);_0x4d6d55[_0x1007('0x33')]=_['keys'](_0x16f013[_0x1007('0x33')]);_0x4d6d55[_0x1007('0x35')]=_[_0x1007('0x36')](_0x4d6d55[_0x1007('0x38')],_0x4d6d55[_0x1007('0x33')]);_0x3d21d4[_0x1007('0x37')]=_[_0x1007('0x36')](_0x4d6d55[_0x1007('0x38')],qs[_0x1007('0x39')](_0x16f013[_0x1007('0x33')][_0x1007('0x39')]));_0x3d21d4[_0x1007('0x37')]=_0x3d21d4[_0x1007('0x37')][_0x1007('0x3a')]?_0x3d21d4['attributes']:_0x4d6d55[_0x1007('0x38')];if(!_0x16f013[_0x1007('0x33')][_0x1007('0x52')](_0x1007('0x53'))){_0x3d21d4['limit']=qs[_0x1007('0x20')](_0x16f013[_0x1007('0x33')][_0x1007('0x20')]);_0x3d21d4[_0x1007('0x21')]=qs[_0x1007('0x21')](_0x16f013['query'][_0x1007('0x21')]);}_0x3d21d4[_0x1007('0x54')]=qs[_0x1007('0x3b')](_0x16f013['query'][_0x1007('0x3b')]);_0x3d21d4[_0x1007('0x3c')]=qs[_0x1007('0x35')](_[_0x1007('0x55')](_0x16f013['query'],_0x4d6d55['filters']));_0x3d21d4[_0x1007('0x3c')]['FaxQueueId']=_0x440959['id'];if(_0x16f013['query'][_0x1007('0x3d')]){_0x3d21d4[_0x1007('0x3c')]=_[_0x1007('0x3e')](_0x3d21d4['where'],{'$or':_[_0x1007('0x30')](_0x3d21d4[_0x1007('0x37')],function(_0x54e4a7){var _0x38849c={};_0x38849c[_0x54e4a7]={'$like':'%'+_0x16f013['query']['filter']+'%'};return _0x38849c;})});}_0x3d21d4=_[_0x1007('0x3e')]({},_0x3d21d4,_0x16f013['options']);return db['UserFaxQueue']['findAll'](_0x3d21d4);}})[_0x1007('0x26')](function(_0x29534b){if(_0x29534b){return db[_0x1007('0x56')][_0x1007('0x57')]({'where':{'id':_[_0x1007('0x30')](_0x29534b,_0x1007('0x58')),'role':_0x1007('0x59')},'attributes':['id',_0x1007('0x2d'),_0x1007('0x5a'),_0x1007('0x5b'),'createdAt']});}})[_0x1007('0x26')](function(_0x2edfcb){if(_0x2edfcb){return{'count':_0x2edfcb[_0x1007('0x5c')],'rows':_[_0x1007('0x30')](_0x2edfcb[_0x1007('0x43')],function(_0x2852af){return{'membername':_0x2852af[_0x1007('0x2d')],'UserId':_0x2852af['id'],'queue_name':_0x172a93[_0x1007('0x2d')],'FaxQueueId':_0x172a93['id'],'interface':util[_0x1007('0x5d')](_0x1007('0x5e'),'SIP',_0x2852af[_0x1007('0x2d')]),'penalty':0x0,'paused':_0x2852af[_0x1007('0x5a')],'createdAt':_0x2852af['createdAt'],'updatedAt':_0x2852af[_0x1007('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1007('0x26')](respondWithFilteredResult(_0x4a8569,_0x3d21d4))[_0x1007('0x44')](handleError(_0x4a8569,null));};exports['getTeams']=function(_0x5df4b5,_0x20dba9,_0x1a4812){var _0x193b87={};var _0x3bff2c={};var _0x1cd3ff;var _0x35b8b4;return db[_0x1007('0x31')]['findOne']({'where':{'id':_0x5df4b5[_0x1007('0x45')]['id']}})[_0x1007('0x26')](handleEntityNotFound(_0x20dba9,null))['then'](function(_0x446ad8){if(_0x446ad8){_0x1cd3ff=_0x446ad8;_0x3bff2c[_0x1007('0x38')]=_[_0x1007('0x34')](db[_0x1007('0x5f')][_0x1007('0x32')]);_0x3bff2c[_0x1007('0x33')]=_[_0x1007('0x34')](_0x5df4b5[_0x1007('0x33')]);_0x3bff2c['filters']=_[_0x1007('0x36')](_0x3bff2c['model'],_0x3bff2c['query']);_0x193b87['attributes']=_['intersection'](_0x3bff2c['model'],qs[_0x1007('0x39')](_0x5df4b5[_0x1007('0x33')][_0x1007('0x39')]));_0x193b87['attributes']=_0x193b87[_0x1007('0x37')][_0x1007('0x3a')]?_0x193b87[_0x1007('0x37')]:_0x3bff2c[_0x1007('0x38')];_0x193b87[_0x1007('0x54')]=qs['sort'](_0x5df4b5['query'][_0x1007('0x3b')]);_0x193b87[_0x1007('0x3c')]=qs[_0x1007('0x35')](_[_0x1007('0x55')](_0x5df4b5[_0x1007('0x33')],_0x3bff2c[_0x1007('0x35')]));if(_0x5df4b5['query']['filter']){_0x193b87[_0x1007('0x3c')]=_[_0x1007('0x3e')](_0x193b87[_0x1007('0x3c')],{'$or':_[_0x1007('0x30')](_0x193b87['attributes'],function(_0x2cad3a){var _0x51d9d2={};_0x51d9d2[_0x2cad3a]={'$like':'%'+_0x5df4b5[_0x1007('0x33')][_0x1007('0x3d')]+'%'};return _0x51d9d2;})});}_0x193b87=_[_0x1007('0x3e')]({},_0x193b87,_0x5df4b5['options']);return _0x1cd3ff['getTeams'](_0x193b87);}})['then'](function(_0x222d78){if(_0x222d78){_0x35b8b4=_0x222d78['length'];if(!_0x5df4b5['query']['hasOwnProperty'](_0x1007('0x53'))){_0x193b87['limit']=qs[_0x1007('0x20')](_0x5df4b5[_0x1007('0x33')]['limit']);_0x193b87[_0x1007('0x21')]=qs[_0x1007('0x21')](_0x5df4b5[_0x1007('0x33')][_0x1007('0x21')]);}return _0x1cd3ff['getTeams'](_0x193b87);}})[_0x1007('0x26')](function(_0x408c08){if(_0x408c08){return _0x408c08?{'count':_0x35b8b4,'rows':_0x408c08}:null;}})[_0x1007('0x26')](respondWithResult(_0x20dba9,null))['catch'](handleError(_0x20dba9,null));};exports[_0x1007('0x60')]=function(_0x5bd14d,_0x26ef1d,_0x489e7f){var _0x485acb=_0x5bd14d[_0x1007('0x49')]['ids'];return db[_0x1007('0x5f')]['findAll']({'where':{'id':_0x485acb},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1007('0x61'),'attributes':['id',_0x1007('0x2d'),_0x1007('0x62'),_0x1007('0x63'),_0x1007('0x64')],'raw':!![]}]})[_0x1007('0x26')](function(_0x5d5b26){if(_0x5d5b26){var _0x44e94a=_[_0x1007('0x65')](_0x5d5b26,function(_0x532729){var _0x513045=_0x532729[_0x1007('0x28')]({'plain':!![]});return _0x513045[_0x1007('0x61')];});return db[_0x1007('0x31')]['find']({'where':{'id':_0x5bd14d[_0x1007('0x45')]['id']}})[_0x1007('0x26')](function(_0x413469){return db[_0x1007('0x66')]['transaction'](function(_0x183c4b){return _0x413469['addTeams'](_0x485acb,{'transaction':_0x183c4b})[_0x1007('0x26')](function(){return BPromise[_0x1007('0x67')](_0x44e94a,function(_0x5f5679){return db['UserFaxQueue'][_0x1007('0x68')]({'where':{'UserId':_0x5f5679['id'],'FaxQueueId':_0x5bd14d[_0x1007('0x45')]['id']},'transaction':_0x183c4b});});})['then'](function(){_0x44e94a['forEach'](function(_0x250964){socket[_0x1007('0x69')]('userFaxQueue:save',{'UserId':_0x250964['id'],'FaxQueueId':_0x413469['id']});});});});});}})['then'](respondWithStatusCode(_0x26ef1d,null))[_0x1007('0x44')](handleError(_0x26ef1d,null));};exports[_0x1007('0x6a')]=function(_0x541d61,_0x208e3a,_0x333b73){return db[_0x1007('0x5f')]['findAll']({'where':{'id':_0x541d61[_0x1007('0x33')][_0x1007('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x1007('0x56')],'as':_0x1007('0x61'),'attributes':['id'],'raw':!![]}]})[_0x1007('0x26')](handleEntityNotFound(_0x208e3a,null))[_0x1007('0x26')](function(_0x177935){var _0xb7fe3f=_[_0x1007('0x30')](_0x177935,'id');var _0x32a471=[];var _0x39365f=[];var _0x11ba1e=squel[_0x1007('0x6c')]();_0x11ba1e['field'](_0x1007('0x6d'))[_0x1007('0x6e')](_0x1007('0x6f'),'tq')[_0x1007('0x70')]('user_has_teams','ut',_0x1007('0x71'))[_0x1007('0x3c')](_0x1007('0x72'),_0x541d61[_0x1007('0x45')]['id']);for(var _0x236c50=0x0;_0x236c50<_0x177935['length'];_0x236c50+=0x1){let _0x45158e=_0x177935[_0x236c50];for(var _0x41c6e8=0x0;_0x41c6e8<_0x45158e[_0x1007('0x61')]['length'];_0x41c6e8+=0x1){let _0x44ccaa=_0x45158e[_0x1007('0x61')][_0x41c6e8];var _0x11ffaf=_0x11ba1e['clone']();_0x11ffaf[_0x1007('0x3c')]('ut.UserId\x20=\x20?',_0x44ccaa['id']);_0x39365f[_0x1007('0x73')](db[_0x1007('0x66')]['query'](_0x11ffaf[_0x1007('0x74')](),{'type':db[_0x1007('0x66')][_0x1007('0x75')][_0x1007('0x76')]})['then'](function(_0x3f1f1c){if(_0x3f1f1c[_0x1007('0x3a')]===0x1){return _0x44ccaa['id'];}else{var _0x10bb3b=_[_0x1007('0x77')](_[_0x1007('0x30')](_0x3f1f1c,_0x1007('0x78')),function(_0x5763e6){return _['includes'](_0xb7fe3f,_0x5763e6);});if(_0x10bb3b){return _0x44ccaa['id'];}}}));}}return BPromise[_0x1007('0x79')](_0x39365f)[_0x1007('0x26')](function(_0xe5ce28){_0x32a471=_(_0x32a471)[_0x1007('0x7a')](_0xe5ce28)['compact']()['value']();return db[_0x1007('0x31')][_0x1007('0x47')]({'where':{'id':_0x541d61[_0x1007('0x45')]['id']}})['then'](function(_0x260ef6){return db['sequelize'][_0x1007('0x7b')](function(_0x45e74c){return _0x260ef6['removeTeams'](_0x541d61['query'][_0x1007('0x6b')],{'transaction':_0x45e74c})['then'](function(){if(!_[_0x1007('0x7c')](_0x32a471)){return _0x260ef6[_0x1007('0x7d')](_0x32a471,{'transaction':_0x45e74c});}})['then'](function(){_0x32a471[_0x1007('0x7e')](function(_0x42d8fa){socket['emit'](_0x1007('0x7f'),{'UserId':_0x42d8fa,'FaxQueueId':_0x260ef6['id']});});});});});});})['then'](respondWithStatusCode(_0x208e3a,null))[_0x1007('0x44')](handleError(_0x208e3a,null));};exports[_0x1007('0x80')]=function(_0x16cdc1,_0x272adc,_0x4377be){return db[_0x1007('0x31')][_0x1007('0x47')]({'where':{'id':_0x16cdc1[_0x1007('0x45')]['id']}})['then'](handleEntityNotFound(_0x272adc,null))[_0x1007('0x26')](function(_0x270431){if(_0x270431){return _0x270431[_0x1007('0x80')](_0x16cdc1['body'][_0x1007('0x6b')],_[_0x1007('0x81')](_0x16cdc1[_0x1007('0x49')],['ids','id'])||{})['spread'](function(_0x4f20a6){for(var _0x5bc347=0x0;_0x5bc347<_0x16cdc1['body'][_0x1007('0x6b')]['length'];_0x5bc347+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x16cdc1['body'][_0x1007('0x6b')][_0x5bc347]),'FaxQueueId':Number(_0x16cdc1[_0x1007('0x45')]['id'])});}return _0x4f20a6;});}})[_0x1007('0x26')](respondWithResult(_0x272adc,null))[_0x1007('0x44')](handleError(_0x272adc,null));};exports[_0x1007('0x7d')]=function(_0x426452,_0x30fa29,_0x1ea2c1){return db[_0x1007('0x31')][_0x1007('0x47')]({'where':{'id':_0x426452['params']['id']}})['then'](handleEntityNotFound(_0x30fa29,null))[_0x1007('0x26')](function(_0x88999d){if(_0x88999d){return _0x88999d[_0x1007('0x7d')](_0x426452[_0x1007('0x33')]['ids'])[_0x1007('0x26')](function(){if(_['isArray'](_0x426452[_0x1007('0x33')][_0x1007('0x6b')])){for(var _0x4e5e1f=0x0;_0x4e5e1f<_0x426452[_0x1007('0x33')]['ids'][_0x1007('0x3a')];_0x4e5e1f+=0x1){socket['emit'](_0x1007('0x7f'),{'UserId':Number(_0x426452[_0x1007('0x33')][_0x1007('0x6b')][_0x4e5e1f]),'FaxQueueId':Number(_0x426452[_0x1007('0x45')]['id'])});}}else{socket[_0x1007('0x69')](_0x1007('0x7f'),{'UserId':Number(_0x426452[_0x1007('0x33')][_0x1007('0x6b')]),'FaxQueueId':Number(_0x426452['params']['id'])});}});}})[_0x1007('0x26')](respondWithStatusCode(_0x30fa29,null))[_0x1007('0x44')](handleError(_0x30fa29,null));};exports[_0x1007('0x82')]=function(_0x258bcf,_0x469129,_0x4cbec0){var _0x80ddfd={};var _0x2b268a={};var _0x51eda8;var _0x57e8ee;return db[_0x1007('0x31')][_0x1007('0x50')]({'where':{'id':_0x258bcf[_0x1007('0x45')]['id']}})[_0x1007('0x26')](handleEntityNotFound(_0x469129,null))[_0x1007('0x26')](function(_0x535a18){if(_0x535a18){_0x51eda8=_0x535a18;_0x2b268a[_0x1007('0x38')]=_[_0x1007('0x34')](db[_0x1007('0x56')][_0x1007('0x32')]);_0x2b268a[_0x1007('0x33')]=_[_0x1007('0x34')](_0x258bcf[_0x1007('0x33')]);_0x2b268a[_0x1007('0x35')]=_['intersection'](_0x2b268a[_0x1007('0x38')],_0x2b268a[_0x1007('0x33')]);_0x80ddfd[_0x1007('0x37')]=_[_0x1007('0x36')](_0x2b268a[_0x1007('0x38')],qs[_0x1007('0x39')](_0x258bcf[_0x1007('0x33')][_0x1007('0x39')]));_0x80ddfd[_0x1007('0x37')]=_0x80ddfd[_0x1007('0x37')][_0x1007('0x3a')]?_0x80ddfd[_0x1007('0x37')]:_0x2b268a['model'];_0x80ddfd[_0x1007('0x54')]=qs[_0x1007('0x3b')](_0x258bcf[_0x1007('0x33')]['sort']);_0x80ddfd[_0x1007('0x3c')]=qs[_0x1007('0x35')](_[_0x1007('0x55')](_0x258bcf[_0x1007('0x33')],_0x2b268a[_0x1007('0x35')]));if(_0x258bcf[_0x1007('0x33')][_0x1007('0x3d')]){_0x80ddfd['where']=_['merge'](_0x80ddfd[_0x1007('0x3c')],{'$or':_[_0x1007('0x30')](_0x80ddfd[_0x1007('0x37')],function(_0x1a4647){var _0x5cffb8={};_0x5cffb8[_0x1a4647]={'$like':'%'+_0x258bcf[_0x1007('0x33')][_0x1007('0x3d')]+'%'};return _0x5cffb8;})});}_0x80ddfd=_[_0x1007('0x3e')]({},_0x80ddfd,_0x258bcf[_0x1007('0x40')]);return _0x51eda8[_0x1007('0x82')](_0x80ddfd);}})[_0x1007('0x26')](function(_0x497b95){if(_0x497b95){_0x57e8ee=_0x497b95[_0x1007('0x3a')];if(!_0x258bcf[_0x1007('0x33')]['hasOwnProperty'](_0x1007('0x53'))){_0x80ddfd['limit']=qs[_0x1007('0x20')](_0x258bcf['query'][_0x1007('0x20')]);_0x80ddfd[_0x1007('0x21')]=qs[_0x1007('0x21')](_0x258bcf[_0x1007('0x33')][_0x1007('0x21')]);}return _0x51eda8[_0x1007('0x82')](_0x80ddfd);}})[_0x1007('0x26')](function(_0x5c3353){if(_0x5c3353){return _0x5c3353?{'count':_0x57e8ee,'rows':_0x5c3353}:null;}})[_0x1007('0x26')](respondWithResult(_0x469129,null))['catch'](handleError(_0x469129,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 2d9e512..b803ee9 100644 --- a/server/api/faxQueue/faxQueue.events.js +++ b/server/api/faxQueue/faxQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7ba=['save','update','remove','emit','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xb7ba,0x164));var _0xab7b=function(_0x30f68d,_0x12cb44){_0x30f68d=_0x30f68d-0x0;var _0x4ac6bf=_0xb7ba[_0x30f68d];return _0x4ac6bf;};'use strict';var EventEmitter=require(_0xab7b('0x0'));var FaxQueue=require(_0xab7b('0x1'))['db'][_0xab7b('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xab7b('0x3')](0x0);var events={'afterCreate':_0xab7b('0x4'),'afterUpdate':_0xab7b('0x5'),'afterDestroy':_0xab7b('0x6')};function emitEvent(_0x20818c){return function(_0x242258,_0x3a9e9e,_0x37d8b9){FaxQueueEvents[_0xab7b('0x7')](_0x20818c+':'+_0x242258['id'],_0x242258);FaxQueueEvents[_0xab7b('0x7')](_0x20818c,_0x242258);_0x37d8b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x189f=['exports','../../mysqldb','FaxQueue','setMaxListeners','update','remove','hasOwnProperty','hook'];(function(_0x7ab10d,_0x50ac6f){var _0x2c24cc=function(_0x55f11c){while(--_0x55f11c){_0x7ab10d['push'](_0x7ab10d['shift']());}};_0x2c24cc(++_0x50ac6f);}(_0x189f,0x189));var _0xf189=function(_0x288267,_0x12e1e3){_0x288267=_0x288267-0x0;var _0x5b245c=_0x189f[_0x288267];return _0x5b245c;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xf189('0x0'))['db'][_0xf189('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf189('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf189('0x3'),'afterDestroy':_0xf189('0x4')};function emitEvent(_0x245907){return function(_0x3d7b52,_0x53cb30,_0x4727da){FaxQueueEvents['emit'](_0x245907+':'+_0x3d7b52['id'],_0x3d7b52);FaxQueueEvents['emit'](_0x245907,_0x3d7b52);_0x4727da(null);};}for(var e in events){if(events[_0xf189('0x5')](e)){var event=events[e];FaxQueue[_0xf189('0x6')](e,emitEvent(event));}}module[_0xf189('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index dea3525..ae014e4 100644 --- a/server/api/faxQueue/faxQueue.model.js +++ b/server/api/faxQueue/faxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba30=['moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','util','api'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xba30,0x15e));var _0x0ba3=function(_0x194618,_0x2b8535){_0x194618=_0x194618-0x0;var _0x3a6638=_0xba30[_0x194618];return _0x3a6638;};'use strict';var _=require('lodash');var util=require(_0x0ba3('0x0'));var logger=require('../../config/logger')(_0x0ba3('0x1'));var moment=require(_0x0ba3('0x2'));var BPromise=require('bluebird');var rp=require(_0x0ba3('0x3'));var fs=require('fs');var path=require(_0x0ba3('0x4'));var rimraf=require(_0x0ba3('0x5'));var config=require(_0x0ba3('0x6'));var attributes=require(_0x0ba3('0x7'));module[_0x0ba3('0x8')]=function(_0x490e84,_0x2f889c){return _0x490e84[_0x0ba3('0x9')]('FaxQueue',attributes,{'tableName':_0x0ba3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a9e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxQueue.attributes','define','FaxQueue','lodash'];(function(_0x201947,_0x4182e0){var _0x577ead=function(_0x25c45b){while(--_0x25c45b){_0x201947['push'](_0x201947['shift']());}};_0x577ead(++_0x4182e0);}(_0x1a9e,0x18b));var _0xe1a9=function(_0x1d6b5c,_0x264959){_0x1d6b5c=_0x1d6b5c-0x0;var _0x464b42=_0x1a9e[_0x1d6b5c];return _0x464b42;};'use strict';var _=require(_0xe1a9('0x0'));var util=require(_0xe1a9('0x1'));var logger=require(_0xe1a9('0x2'))(_0xe1a9('0x3'));var moment=require(_0xe1a9('0x4'));var BPromise=require(_0xe1a9('0x5'));var rp=require(_0xe1a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1a9('0x7'));var config=require('../../config/environment');var attributes=require(_0xe1a9('0x8'));module['exports']=function(_0x1f1061,_0xd3c7d6){return _0x1f1061[_0xe1a9('0x9')](_0xe1a9('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index a505f35..041c118 100644 --- a/server/api/faxQueue/faxQueue.rpc.js +++ b/server/api/faxQueue/faxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80a0=['include','map','attributes','model','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','request\x20sent','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0x80a0,0xa6));var _0x080a=function(_0x23ce88,_0x249ece){_0x23ce88=_0x23ce88-0x0;var _0x54d929=_0x80a0[_0x23ce88];return _0x54d929;};'use strict';var _=require(_0x080a('0x0'));var util=require(_0x080a('0x1'));var moment=require(_0x080a('0x2'));var BPromise=require(_0x080a('0x3'));var rs=require(_0x080a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x080a('0x5'))['db'];var utils=require(_0x080a('0x6'));var logger=require('../../config/logger')(_0x080a('0x7'));var config=require(_0x080a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x080a('0x9')][_0x080a('0xa')]({'port':0x232a});config['redis']=_[_0x080a('0xb')](config[_0x080a('0xc')],{'host':_0x080a('0xd'),'port':0x18eb});var socket=require(_0x080a('0xe'))(new Redis(config[_0x080a('0xc')]));require(_0x080a('0xf'))[_0x080a('0x10')](socket);function respondWithRpcPromise(_0x3ba493,_0x35514a,_0x1dfb83){return new BPromise(function(_0x22ffb0,_0x2f4326){return client['request'](_0x3ba493,_0x1dfb83)[_0x080a('0x11')](function(_0x50ab0b){logger[_0x080a('0x12')]('FaxQueue,\x20%s,\x20%s',_0x35514a,'request\x20sent');logger[_0x080a('0x13')](_0x080a('0x14'),_0x35514a,'request\x20sent',JSON[_0x080a('0x15')](_0x50ab0b));if(_0x50ab0b[_0x080a('0x16')]){if(_0x50ab0b['error']['code']===0x1f4){logger[_0x080a('0x16')](_0x080a('0x17'),_0x35514a,_0x50ab0b['error'][_0x080a('0x18')]);return _0x2f4326(_0x50ab0b['error'][_0x080a('0x18')]);}logger[_0x080a('0x16')](_0x080a('0x17'),_0x35514a,_0x50ab0b['error'][_0x080a('0x18')]);return _0x22ffb0(_0x50ab0b[_0x080a('0x16')][_0x080a('0x18')]);}else{logger[_0x080a('0x12')]('FaxQueue,\x20%s,\x20%s',_0x35514a,_0x080a('0x19'));_0x22ffb0(_0x50ab0b['result'][_0x080a('0x18')]);}})[_0x080a('0x1a')](function(_0x337844){logger[_0x080a('0x16')](_0x080a('0x17'),_0x35514a,_0x337844);_0x2f4326(_0x337844);});});}exports[_0x080a('0x1b')]=function(_0x2450ee){var _0xe606a6=this;return new Promise(function(_0x3f48b2,_0x25d4a2){return db[_0x080a('0x1c')][_0x080a('0x1d')]({'raw':_0x2450ee[_0x080a('0x1e')]?_0x2450ee['options'][_0x080a('0x1f')]===undefined?!![]:![]:!![],'where':_0x2450ee[_0x080a('0x1e')]?_0x2450ee['options'][_0x080a('0x20')]||null:null,'attributes':_0x2450ee['options']?_0x2450ee[_0x080a('0x1e')]['attributes']||null:null,'limit':_0x2450ee['options']?_0x2450ee[_0x080a('0x1e')][_0x080a('0x21')]||null:null,'include':_0x2450ee[_0x080a('0x1e')]?_0x2450ee['options'][_0x080a('0x22')]?_[_0x080a('0x23')](_0x2450ee[_0x080a('0x1e')][_0x080a('0x22')],function(_0x709fbe){return{'model':db[_0x709fbe['model']],'as':_0x709fbe['as'],'attributes':_0x709fbe[_0x080a('0x24')],'include':_0x709fbe[_0x080a('0x22')]?_[_0x080a('0x23')](_0x709fbe['include'],function(_0x4bc457){return{'model':db[_0x4bc457[_0x080a('0x25')]],'as':_0x4bc457['as'],'attributes':_0x4bc457[_0x080a('0x24')],'include':_0x4bc457[_0x080a('0x22')]?_[_0x080a('0x23')](_0x4bc457[_0x080a('0x22')],function(_0x4b7737){return{'model':db[_0x4b7737[_0x080a('0x25')]],'as':_0x4b7737['as'],'attributes':_0x4b7737[_0x080a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x080a('0x11')](function(_0x2b41ed){logger['info'](_0x080a('0x1b'),_0x2450ee);logger[_0x080a('0x13')](_0x080a('0x1b'),_0x2450ee,JSON[_0x080a('0x15')](_0x2b41ed));_0x3f48b2(_0x2b41ed);})[_0x080a('0x1a')](function(_0x536fa2){logger[_0x080a('0x16')](_0x080a('0x1b'),_0x536fa2[_0x080a('0x18')],_0x2450ee);_0x25d4a2(_0xe606a6[_0x080a('0x16')](0x1f4,_0x536fa2[_0x080a('0x18')]));});});};exports[_0x080a('0x26')]=function(_0x55f3b8){var _0x458141=this;return new Promise(function(_0x1a4945,_0xcae0e0){return db[_0x080a('0x1c')][_0x080a('0x27')]({'raw':_0x55f3b8['options']?_0x55f3b8['options'][_0x080a('0x1f')]===undefined?!![]:![]:!![],'where':_0x55f3b8[_0x080a('0x1e')]?_0x55f3b8[_0x080a('0x1e')]['where']||null:null,'attributes':_0x55f3b8['options']?_0x55f3b8[_0x080a('0x1e')]['attributes']||null:null,'include':_0x55f3b8[_0x080a('0x1e')]?_0x55f3b8['options']['include']?_[_0x080a('0x23')](_0x55f3b8[_0x080a('0x1e')][_0x080a('0x22')],function(_0x218873){return{'model':db[_0x218873[_0x080a('0x25')]],'as':_0x218873['as'],'attributes':_0x218873['attributes'],'include':_0x218873[_0x080a('0x22')]?_[_0x080a('0x23')](_0x218873[_0x080a('0x22')],function(_0x1ecb1a){return{'model':db[_0x1ecb1a[_0x080a('0x25')]],'as':_0x1ecb1a['as'],'attributes':_0x1ecb1a['attributes'],'include':_0x1ecb1a[_0x080a('0x22')]?_[_0x080a('0x23')](_0x1ecb1a['include'],function(_0x2ee54b){return{'model':db[_0x2ee54b[_0x080a('0x25')]],'as':_0x2ee54b['as'],'attributes':_0x2ee54b[_0x080a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x080a('0x11')](function(_0x3b8bf6){logger[_0x080a('0x12')](_0x080a('0x26'),_0x55f3b8);logger['debug'](_0x080a('0x26'),_0x55f3b8,JSON[_0x080a('0x15')](_0x3b8bf6));_0x1a4945(_0x3b8bf6);})['catch'](function(_0x2bd582){logger[_0x080a('0x16')]('ShowFaxQueue',_0x2bd582[_0x080a('0x18')],_0x55f3b8);_0xcae0e0(_0x458141['error'](0x1f4,_0x2bd582[_0x080a('0x18')]));});});}; \ No newline at end of file +var _0xbf97=['client','http','defaults','redis','./faxQueue.socket','register','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','FaxQueue,\x20%s,\x20%s','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','map','include','model','stringify','ShowFaxQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xc1265a,_0x5b3085){var _0x592cca=function(_0x9739ec){while(--_0x9739ec){_0xc1265a['push'](_0xc1265a['shift']());}};_0x592cca(++_0x5b3085);}(_0xbf97,0x136));var _0x7bf9=function(_0x4bd81f,_0x39c2ff){_0x4bd81f=_0x4bd81f-0x0;var _0x92a430=_0xbf97[_0x4bd81f];return _0x92a430;};'use strict';var _=require('lodash');var util=require(_0x7bf9('0x0'));var moment=require(_0x7bf9('0x1'));var BPromise=require(_0x7bf9('0x2'));var rs=require(_0x7bf9('0x3'));var fs=require('fs');var Redis=require(_0x7bf9('0x4'));var db=require(_0x7bf9('0x5'))['db'];var utils=require(_0x7bf9('0x6'));var logger=require(_0x7bf9('0x7'))(_0x7bf9('0x8'));var config=require(_0x7bf9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7bf9('0xa')][_0x7bf9('0xb')]({'port':0x232a});config['redis']=_[_0x7bf9('0xc')](config[_0x7bf9('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7bf9('0xe'))[_0x7bf9('0xf')](socket);function respondWithRpcPromise(_0x3525b7,_0x56f407,_0x32c466){return new BPromise(function(_0x47cec6,_0x2bfb78){return client['request'](_0x3525b7,_0x32c466)[_0x7bf9('0x10')](function(_0x266476){logger[_0x7bf9('0x11')]('FaxQueue,\x20%s,\x20%s',_0x56f407,_0x7bf9('0x12'));logger[_0x7bf9('0x13')](_0x7bf9('0x14'),_0x56f407,'request\x20sent',JSON['stringify'](_0x266476));if(_0x266476[_0x7bf9('0x15')]){if(_0x266476[_0x7bf9('0x15')][_0x7bf9('0x16')]===0x1f4){logger[_0x7bf9('0x15')]('FaxQueue,\x20%s,\x20%s',_0x56f407,_0x266476['error'][_0x7bf9('0x17')]);return _0x2bfb78(_0x266476[_0x7bf9('0x15')][_0x7bf9('0x17')]);}logger[_0x7bf9('0x15')](_0x7bf9('0x18'),_0x56f407,_0x266476[_0x7bf9('0x15')][_0x7bf9('0x17')]);return _0x47cec6(_0x266476[_0x7bf9('0x15')][_0x7bf9('0x17')]);}else{logger[_0x7bf9('0x11')](_0x7bf9('0x18'),_0x56f407,_0x7bf9('0x12'));_0x47cec6(_0x266476['result'][_0x7bf9('0x17')]);}})[_0x7bf9('0x19')](function(_0x218569){logger[_0x7bf9('0x15')](_0x7bf9('0x18'),_0x56f407,_0x218569);_0x2bfb78(_0x218569);});});}exports[_0x7bf9('0x1a')]=function(_0xeee1f7){var _0x5e0a40=this;return new Promise(function(_0xc5ec9d,_0x71076d){return db[_0x7bf9('0x1b')][_0x7bf9('0x1c')]({'raw':_0xeee1f7[_0x7bf9('0x1d')]?_0xeee1f7['options']['raw']===undefined?!![]:![]:!![],'where':_0xeee1f7['options']?_0xeee1f7[_0x7bf9('0x1d')][_0x7bf9('0x1e')]||null:null,'attributes':_0xeee1f7['options']?_0xeee1f7[_0x7bf9('0x1d')][_0x7bf9('0x1f')]||null:null,'limit':_0xeee1f7[_0x7bf9('0x1d')]?_0xeee1f7['options'][_0x7bf9('0x20')]||null:null,'include':_0xeee1f7[_0x7bf9('0x1d')]?_0xeee1f7['options']['include']?_[_0x7bf9('0x21')](_0xeee1f7[_0x7bf9('0x1d')][_0x7bf9('0x22')],function(_0x202bc8){return{'model':db[_0x202bc8['model']],'as':_0x202bc8['as'],'attributes':_0x202bc8[_0x7bf9('0x1f')],'include':_0x202bc8[_0x7bf9('0x22')]?_[_0x7bf9('0x21')](_0x202bc8['include'],function(_0x29967c){return{'model':db[_0x29967c[_0x7bf9('0x23')]],'as':_0x29967c['as'],'attributes':_0x29967c['attributes'],'include':_0x29967c['include']?_['map'](_0x29967c[_0x7bf9('0x22')],function(_0x4a206c){return{'model':db[_0x4a206c[_0x7bf9('0x23')]],'as':_0x4a206c['as'],'attributes':_0x4a206c[_0x7bf9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7bf9('0x10')](function(_0xd9ed03){logger[_0x7bf9('0x11')](_0x7bf9('0x1a'),_0xeee1f7);logger[_0x7bf9('0x13')](_0x7bf9('0x1a'),_0xeee1f7,JSON[_0x7bf9('0x24')](_0xd9ed03));_0xc5ec9d(_0xd9ed03);})[_0x7bf9('0x19')](function(_0x13f1f1){logger[_0x7bf9('0x15')](_0x7bf9('0x1a'),_0x13f1f1[_0x7bf9('0x17')],_0xeee1f7);_0x71076d(_0x5e0a40[_0x7bf9('0x15')](0x1f4,_0x13f1f1['message']));});});};exports[_0x7bf9('0x25')]=function(_0x13a94){var _0x4d209d=this;return new Promise(function(_0x4f6609,_0x4dc78f){return db['FaxQueue'][_0x7bf9('0x26')]({'raw':_0x13a94[_0x7bf9('0x1d')]?_0x13a94[_0x7bf9('0x1d')][_0x7bf9('0x27')]===undefined?!![]:![]:!![],'where':_0x13a94['options']?_0x13a94[_0x7bf9('0x1d')]['where']||null:null,'attributes':_0x13a94[_0x7bf9('0x1d')]?_0x13a94[_0x7bf9('0x1d')][_0x7bf9('0x1f')]||null:null,'include':_0x13a94['options']?_0x13a94[_0x7bf9('0x1d')]['include']?_[_0x7bf9('0x21')](_0x13a94[_0x7bf9('0x1d')][_0x7bf9('0x22')],function(_0x256d36){return{'model':db[_0x256d36['model']],'as':_0x256d36['as'],'attributes':_0x256d36[_0x7bf9('0x1f')],'include':_0x256d36[_0x7bf9('0x22')]?_[_0x7bf9('0x21')](_0x256d36[_0x7bf9('0x22')],function(_0x2fcf66){return{'model':db[_0x2fcf66[_0x7bf9('0x23')]],'as':_0x2fcf66['as'],'attributes':_0x2fcf66[_0x7bf9('0x1f')],'include':_0x2fcf66[_0x7bf9('0x22')]?_[_0x7bf9('0x21')](_0x2fcf66['include'],function(_0x15a473){return{'model':db[_0x15a473['model']],'as':_0x15a473['as'],'attributes':_0x15a473['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bf9('0x10')](function(_0x51055e){logger[_0x7bf9('0x11')]('ShowFaxQueue',_0x13a94);logger['debug'](_0x7bf9('0x25'),_0x13a94,JSON[_0x7bf9('0x24')](_0x51055e));_0x4f6609(_0x51055e);})[_0x7bf9('0x19')](function(_0x4f58ed){logger[_0x7bf9('0x15')](_0x7bf9('0x25'),_0x4f58ed[_0x7bf9('0x17')],_0x13a94);_0x4dc78f(_0x4d209d['error'](0x1f4,_0x4f58ed[_0x7bf9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index aea8063..80bb87e 100644 --- a/server/api/faxQueue/faxQueue.socket.js +++ b/server/api/faxQueue/faxQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d83=['save','remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x1a4665,_0xe1e35f){var _0x33b385=function(_0x1b5ec8){while(--_0x1b5ec8){_0x1a4665['push'](_0x1a4665['shift']());}};_0x33b385(++_0xe1e35f);}(_0x2d83,0x1dc));var _0x32d8=function(_0x39a23c,_0x5dd719){_0x39a23c=_0x39a23c-0x0;var _0x52f7fb=_0x2d83[_0x39a23c];return _0x52f7fb;};'use strict';var FaxQueueEvents=require(_0x32d8('0x0'));var events=[_0x32d8('0x1'),_0x32d8('0x2'),_0x32d8('0x3')];function createListener(_0x676811,_0x250f8b){return function(_0x15f0b4){_0x250f8b[_0x32d8('0x4')](_0x676811,_0x15f0b4);};}function removeListener(_0x5cd26e,_0x26c26e){return function(){FaxQueueEvents[_0x32d8('0x5')](_0x5cd26e,_0x26c26e);};}exports[_0x32d8('0x6')]=function(_0x170256){for(var _0x31c0f9=0x0,_0x45273a=events[_0x32d8('0x7')];_0x31c0f9<_0x45273a;_0x31c0f9++){var _0x13494e=events[_0x31c0f9];var _0x5190c1=createListener(_0x32d8('0x8')+_0x13494e,_0x170256);FaxQueueEvents['on'](_0x13494e,_0x5190c1);}}; \ No newline at end of file +var _0x6a26=['save','remove','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x555d6c,_0x2c6c27){var _0x5125d5=function(_0x4fe503){while(--_0x4fe503){_0x555d6c['push'](_0x555d6c['shift']());}};_0x5125d5(++_0x2c6c27);}(_0x6a26,0x14f));var _0x66a2=function(_0xe13a01,_0x22d7e8){_0xe13a01=_0xe13a01-0x0;var _0x13a73c=_0x6a26[_0xe13a01];return _0x13a73c;};'use strict';var FaxQueueEvents=require(_0x66a2('0x0'));var events=[_0x66a2('0x1'),_0x66a2('0x2'),'update'];function createListener(_0xe8ca9e,_0x4c6914){return function(_0x4e9f1a){_0x4c6914[_0x66a2('0x3')](_0xe8ca9e,_0x4e9f1a);};}function removeListener(_0x5bd95a,_0x13529d){return function(){FaxQueueEvents[_0x66a2('0x4')](_0x5bd95a,_0x13529d);};}exports['register']=function(_0x1264ad){for(var _0x57ebc9=0x0,_0x37c000=events[_0x66a2('0x5')];_0x57ebc9<_0x37c000;_0x57ebc9++){var _0x3d8fda=events[_0x57ebc9];var _0x2d3930=createListener(_0x66a2('0x6')+_0x3d8fda,_0x1264ad);FaxQueueEvents['on'](_0x3d8fda,_0x2d3930);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 3815755..bd2e4a8 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafb9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x473ee7,_0x4dd754){var _0x30f0d4=function(_0x4d961d){while(--_0x4d961d){_0x473ee7['push'](_0x473ee7['shift']());}};_0x30f0d4(++_0x4dd754);}(_0xafb9,0x68));var _0x9afb=function(_0x1098bc,_0x2f4af1){_0x1098bc=_0x1098bc-0x0;var _0x26567d=_0xafb9[_0x1098bc];return _0x26567d;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require(_0x9afb('0x4'));var router=express[_0x9afb('0x5')]();var fs_extra=require(_0x9afb('0x6'));var auth=require(_0x9afb('0x7'));var interaction=require(_0x9afb('0x8'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x9afb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9afb('0xa')]);router['get']('/describe',auth[_0x9afb('0xb')](),controller[_0x9afb('0xc')]);router[_0x9afb('0x9')]('/:id',auth[_0x9afb('0xb')](),controller[_0x9afb('0xd')]);router[_0x9afb('0x9')](_0x9afb('0xe'),auth[_0x9afb('0xb')](),controller['getMembers']);router['get'](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x10')]);router[_0x9afb('0x9')](_0x9afb('0x11'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x12')]);router[_0x9afb('0x13')]('/',auth[_0x9afb('0xb')](),controller[_0x9afb('0x14')]);router['post'](_0x9afb('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0x9afb('0x13')](_0x9afb('0x11'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x15')]);router[_0x9afb('0x16')](_0x9afb('0x17'),auth[_0x9afb('0xb')](),controller['update']);router[_0x9afb('0x18')](_0x9afb('0x17'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x19')]);router[_0x9afb('0x18')]('/:id/teams',auth[_0x9afb('0xb')](),controller['removeTeams']);router[_0x9afb('0x18')](_0x9afb('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x9afb('0x1a')]=router; \ No newline at end of file +var _0xe944=['/:id/teams','getTeams','/:id/users','create','post','addAgents','put','update','delete','destroy','removeTeams','exports','multer','connect-timeout','fs-extra','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members'];(function(_0x5594a8,_0x33eddf){var _0x322a14=function(_0xa66ee1){while(--_0xa66ee1){_0x5594a8['push'](_0x5594a8['shift']());}};_0x322a14(++_0x33eddf);}(_0xe944,0x174));var _0x4e94=function(_0x2ce5c0,_0x3b19b8){_0x2ce5c0=_0x2ce5c0-0x0;var _0x10e807=_0xe944[_0x2ce5c0];return _0x10e807;};'use strict';var multer=require(_0x4e94('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4e94('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4e94('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4e94('0x3'));var controller=require(_0x4e94('0x4'));router[_0x4e94('0x5')]('/',auth[_0x4e94('0x6')](),controller['index']);router[_0x4e94('0x5')](_0x4e94('0x7'),auth[_0x4e94('0x6')](),controller[_0x4e94('0x8')]);router['get'](_0x4e94('0x9'),auth['isAuthenticated'](),controller[_0x4e94('0xa')]);router[_0x4e94('0x5')](_0x4e94('0xb'),auth[_0x4e94('0x6')](),controller['getMembers']);router[_0x4e94('0x5')](_0x4e94('0xc'),auth[_0x4e94('0x6')](),controller[_0x4e94('0xd')]);router[_0x4e94('0x5')](_0x4e94('0xe'),auth[_0x4e94('0x6')](),controller['getAgents']);router['post']('/',auth[_0x4e94('0x6')](),controller[_0x4e94('0xf')]);router[_0x4e94('0x10')](_0x4e94('0xc'),auth[_0x4e94('0x6')](),controller['addTeams']);router[_0x4e94('0x10')](_0x4e94('0xe'),auth[_0x4e94('0x6')](),controller[_0x4e94('0x11')]);router[_0x4e94('0x12')](_0x4e94('0x9'),auth[_0x4e94('0x6')](),controller[_0x4e94('0x13')]);router[_0x4e94('0x14')](_0x4e94('0x9'),auth[_0x4e94('0x6')](),controller[_0x4e94('0x15')]);router['delete']('/:id/teams',auth[_0x4e94('0x6')](),controller[_0x4e94('0x16')]);router[_0x4e94('0x14')](_0x4e94('0xe'),auth[_0x4e94('0x6')](),controller['removeAgents']);module[_0x4e94('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 20667e1..f86c8b0 100644 --- a/server/api/faxQueueReport/faxQueueReport.attributes.js +++ b/server/api/faxQueueReport/faxQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8610=['moment','sequelize','exports','STRING','DATE'];(function(_0x29fa48,_0x466688){var _0x2a0f79=function(_0x2ae4fc){while(--_0x2ae4fc){_0x29fa48['push'](_0x29fa48['shift']());}};_0x2a0f79(++_0x466688);}(_0x8610,0x154));var _0x0861=function(_0x5d4b33,_0x233a51){_0x5d4b33=_0x5d4b33-0x0;var _0x19118f=_0x8610[_0x5d4b33];return _0x19118f;};'use strict';var moment=require(_0x0861('0x0'));var Sequelize=require(_0x0861('0x1'));module[_0x0861('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0861('0x3')]},'joinAt':{'type':Sequelize[_0x0861('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0861('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6a6c=['DATE','moment','sequelize','STRING'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x6a6c,0x199));var _0xc6a6=function(_0x37d047,_0x64ccf9){_0x37d047=_0x37d047-0x0;var _0x283c7a=_0x6a6c[_0x37d047];return _0x283c7a;};'use strict';var moment=require(_0xc6a6('0x0'));var Sequelize=require(_0xc6a6('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc6a6('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc6a6('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc6a6('0x3')]},'exitAt':{'type':Sequelize[_0xc6a6('0x3')]},'reason':{'type':Sequelize[_0xc6a6('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 0256165..02b7bc4 100644 --- a/server/api/faxQueueReport/faxQueueReport.controller.js +++ b/server/api/faxQueueReport/faxQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfaa4=['limit','set','Content-Range','reject','update','then','error','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count'];(function(_0x3add4f,_0x45745f){var _0x18e303=function(_0x51972b){while(--_0x51972b){_0x3add4f['push'](_0x3add4f['shift']());}};_0x18e303(++_0x45745f);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x2d20c3,_0x181464){_0x2d20c3=_0x2d20c3-0x0;var _0x52c7a0=_0xfaa4[_0x2d20c3];return _0x52c7a0;};'use strict';var emlformat=require(_0x4faa('0x0'));var rimraf=require(_0x4faa('0x1'));var zipdir=require(_0x4faa('0x2'));var jsonpatch=require(_0x4faa('0x3'));var rp=require(_0x4faa('0x4'));var moment=require(_0x4faa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4faa('0x6'));var util=require(_0x4faa('0x7'));var path=require(_0x4faa('0x8'));var sox=require(_0x4faa('0x9'));var csv=require('to-csv');var ejs=require(_0x4faa('0xa'));var fs=require('fs');var fs_extra=require(_0x4faa('0xb'));var _=require(_0x4faa('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4faa('0xd'));var toCsv=require(_0x4faa('0xe'));var querystring=require(_0x4faa('0xf'));var Papa=require('papaparse');var Redis=require(_0x4faa('0x10'));var authService=require(_0x4faa('0x11'));var qs=require(_0x4faa('0x12'));var as=require(_0x4faa('0x13'));var hardwareService=require(_0x4faa('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4faa('0x15'));var config=require(_0x4faa('0x16'));var licenseUtil=require(_0x4faa('0x17'));var db=require(_0x4faa('0x18'))['db'];function respondWithStatusCode(_0x3faf67,_0x2ca0f1){_0x2ca0f1=_0x2ca0f1||0xcc;return function(_0x265621){if(_0x265621){return _0x3faf67[_0x4faa('0x19')](_0x2ca0f1);}return _0x3faf67[_0x4faa('0x1a')](_0x2ca0f1)[_0x4faa('0x1b')]();};}function respondWithResult(_0x269899,_0x325030){_0x325030=_0x325030||0xc8;return function(_0x24ef94){if(_0x24ef94){return _0x269899['status'](_0x325030)[_0x4faa('0x1c')](_0x24ef94);}};}function respondWithFilteredResult(_0x2c8a7d,_0x195569){return function(_0x5a1ca5){if(_0x5a1ca5){var _0xb2a974=typeof _0x195569[_0x4faa('0x1d')]===_0x4faa('0x1e')&&typeof _0x195569['limit']===_0x4faa('0x1e');var _0x44bd3b=_0x5a1ca5['count'];var _0x5d8c8a=_0xb2a974?0x0:_0x195569['offset'];var _0x33592d=_0xb2a974?_0x5a1ca5[_0x4faa('0x1f')]:_0x195569[_0x4faa('0x1d')]+_0x195569[_0x4faa('0x20')];var _0x4ab91c;if(_0x33592d>=_0x44bd3b){_0x33592d=_0x44bd3b;_0x4ab91c=0xc8;}else{_0x4ab91c=0xce;}_0x2c8a7d[_0x4faa('0x1a')](_0x4ab91c);return _0x2c8a7d[_0x4faa('0x21')](_0x4faa('0x22'),_0x5d8c8a+'-'+_0x33592d+'/'+_0x44bd3b)[_0x4faa('0x1c')](_0x5a1ca5);}return null;};}function patchUpdates(_0x492417){return function(_0x137132){try{jsonpatch['apply'](_0x137132,_0x492417,!![]);}catch(_0x59cfda){return BPromise[_0x4faa('0x23')](_0x59cfda);}return _0x137132['save']();};}function saveUpdates(_0x59e077,_0x14683b){return function(_0xb7f23c){if(_0xb7f23c){return _0xb7f23c[_0x4faa('0x24')](_0x59e077)[_0x4faa('0x25')](function(_0x40184b){return _0x40184b;});}return null;};}function removeEntity(_0xb31ae9,_0x80e1ef){return function(_0x177774){if(_0x177774){return _0x177774['destroy']()[_0x4faa('0x25')](function(){_0xb31ae9[_0x4faa('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d4545,_0x29d08d){return function(_0x3448b1){if(!_0x3448b1){_0x3d4545[_0x4faa('0x19')](0x194);}return _0x3448b1;};}function handleError(_0x5206ca,_0x925fe9){_0x925fe9=_0x925fe9||0x1f4;return function(_0x5beae8){logger[_0x4faa('0x26')](_0x5beae8[_0x4faa('0x27')]);if(_0x5beae8[_0x4faa('0x28')]){delete _0x5beae8[_0x4faa('0x28')];}_0x5206ca[_0x4faa('0x1a')](_0x925fe9)[_0x4faa('0x29')](_0x5beae8);};}exports['index']=function(_0x6a4ce8,_0xa70839){var _0x368749={},_0x1960ae={},_0x59e876={'count':0x0,'rows':[]};var _0x5cc565=_[_0x4faa('0x2a')](db[_0x4faa('0x2b')][_0x4faa('0x2c')],function(_0x55ea1e){return{'name':_0x55ea1e[_0x4faa('0x2d')],'type':_0x55ea1e[_0x4faa('0x2e')][_0x4faa('0x2f')]};});_0x1960ae[_0x4faa('0x30')]=_[_0x4faa('0x2a')](_0x5cc565,_0x4faa('0x28'));_0x1960ae['query']=_[_0x4faa('0x31')](_0x6a4ce8['query']);_0x1960ae[_0x4faa('0x32')]=_['intersection'](_0x1960ae[_0x4faa('0x30')],_0x1960ae[_0x4faa('0x33')]);_0x368749[_0x4faa('0x34')]=_[_0x4faa('0x35')](_0x1960ae['model'],qs[_0x4faa('0x36')](_0x6a4ce8[_0x4faa('0x33')][_0x4faa('0x36')]));_0x368749[_0x4faa('0x34')]=_0x368749[_0x4faa('0x34')][_0x4faa('0x37')]?_0x368749[_0x4faa('0x34')]:_0x1960ae[_0x4faa('0x30')];if(!_0x6a4ce8['query'][_0x4faa('0x38')](_0x4faa('0x39'))){_0x368749[_0x4faa('0x20')]=qs['limit'](_0x6a4ce8[_0x4faa('0x33')][_0x4faa('0x20')]);_0x368749[_0x4faa('0x1d')]=qs[_0x4faa('0x1d')](_0x6a4ce8[_0x4faa('0x33')][_0x4faa('0x1d')]);}_0x368749[_0x4faa('0x3a')]=qs[_0x4faa('0x3b')](_0x6a4ce8[_0x4faa('0x33')][_0x4faa('0x3b')]);_0x368749[_0x4faa('0x3c')]=qs[_0x4faa('0x32')](_[_0x4faa('0x3d')](_0x6a4ce8[_0x4faa('0x33')],_0x1960ae['filters']),_0x5cc565);if(_0x6a4ce8[_0x4faa('0x33')]['filter']){_0x368749['where']=_[_0x4faa('0x3e')](_0x368749[_0x4faa('0x3c')],{'$or':_['map'](_0x5cc565,function(_0x390e62){if(_0x390e62[_0x4faa('0x2e')]!==_0x4faa('0x3f')){var _0x1c3d55={};_0x1c3d55[_0x390e62[_0x4faa('0x28')]]={'$like':'%'+_0x6a4ce8['query'][_0x4faa('0x40')]+'%'};return _0x1c3d55;}})});}_0x368749=_[_0x4faa('0x3e')]({},_0x368749,_0x6a4ce8[_0x4faa('0x41')]);var _0x8fd2f5={'where':_0x368749[_0x4faa('0x3c')]};return db[_0x4faa('0x2b')][_0x4faa('0x1f')](_0x8fd2f5)['then'](function(_0xd3bb8d){_0x59e876[_0x4faa('0x1f')]=_0xd3bb8d;if(_0x6a4ce8[_0x4faa('0x33')][_0x4faa('0x42')]){_0x368749[_0x4faa('0x43')]=[{'all':!![]}];}return db[_0x4faa('0x2b')][_0x4faa('0x44')](_0x368749);})[_0x4faa('0x25')](function(_0x1a66b2){_0x59e876['rows']=_0x1a66b2;return _0x59e876;})[_0x4faa('0x25')](respondWithFilteredResult(_0xa70839,_0x368749))[_0x4faa('0x45')](handleError(_0xa70839,null));};exports[_0x4faa('0x46')]=function(_0x2e0589,_0x240209){var _0x4d8a65={'raw':!![],'where':{'id':_0x2e0589[_0x4faa('0x47')]['id']}},_0x14a907={};_0x14a907[_0x4faa('0x30')]=_['keys'](db[_0x4faa('0x2b')][_0x4faa('0x2c')]);_0x14a907[_0x4faa('0x33')]=_['keys'](_0x2e0589[_0x4faa('0x33')]);_0x14a907[_0x4faa('0x32')]=_[_0x4faa('0x35')](_0x14a907[_0x4faa('0x30')],_0x14a907[_0x4faa('0x33')]);_0x4d8a65['attributes']=_['intersection'](_0x14a907[_0x4faa('0x30')],qs[_0x4faa('0x36')](_0x2e0589['query']['fields']));_0x4d8a65[_0x4faa('0x34')]=_0x4d8a65[_0x4faa('0x34')][_0x4faa('0x37')]?_0x4d8a65[_0x4faa('0x34')]:_0x14a907['model'];if(_0x2e0589[_0x4faa('0x33')][_0x4faa('0x42')]){_0x4d8a65['include']=[{'all':!![]}];}_0x4d8a65=_[_0x4faa('0x3e')]({},_0x4d8a65,_0x2e0589[_0x4faa('0x41')]);return db[_0x4faa('0x2b')][_0x4faa('0x48')](_0x4d8a65)[_0x4faa('0x25')](handleEntityNotFound(_0x240209,null))[_0x4faa('0x25')](respondWithResult(_0x240209,null))[_0x4faa('0x45')](handleError(_0x240209,null));};exports[_0x4faa('0x49')]=function(_0x5d67d6,_0x33a878){return db[_0x4faa('0x2b')][_0x4faa('0x49')](_0x5d67d6[_0x4faa('0x4a')],{})[_0x4faa('0x25')](respondWithResult(_0x33a878,0xc9))[_0x4faa('0x45')](handleError(_0x33a878,null));};exports['update']=function(_0x49a7b4,_0x35bf48){if(_0x49a7b4[_0x4faa('0x4a')]['id']){delete _0x49a7b4[_0x4faa('0x4a')]['id'];}return db[_0x4faa('0x2b')][_0x4faa('0x48')]({'where':{'id':_0x49a7b4['params']['id']}})['then'](handleEntityNotFound(_0x35bf48,null))[_0x4faa('0x25')](saveUpdates(_0x49a7b4[_0x4faa('0x4a')],null))[_0x4faa('0x25')](respondWithResult(_0x35bf48,null))['catch'](handleError(_0x35bf48,null));};exports['destroy']=function(_0x49aa69,_0x3f45ba){return db[_0x4faa('0x2b')]['find']({'where':{'id':_0x49aa69[_0x4faa('0x47')]['id']}})[_0x4faa('0x25')](handleEntityNotFound(_0x3f45ba,null))[_0x4faa('0x25')](removeEntity(_0x3f45ba,null))[_0x4faa('0x45')](handleError(_0x3f45ba,null));};exports[_0x4faa('0x4b')]=function(_0x2c5d3e,_0x3c1af9){return db[_0x4faa('0x2b')][_0x4faa('0x4b')]()['then'](respondWithResult(_0x3c1af9,null))[_0x4faa('0x45')](handleError(_0x3c1af9,null));}; \ No newline at end of file +var _0x18a9=['Content-Range','json','save','update','destroy','then','end','error','stack','name','send','index','map','FaxQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','includeAll','findAll','rows','catch','rawAttributes','include','options','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x18a9,0x15b));var _0x918a=function(_0x2ed210,_0x303da8){_0x2ed210=_0x2ed210-0x0;var _0x58ae3=_0x18a9[_0x2ed210];return _0x58ae3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x918a('0x0'));var jsonpatch=require(_0x918a('0x1'));var rp=require(_0x918a('0x2'));var moment=require(_0x918a('0x3'));var BPromise=require(_0x918a('0x4'));var Mustache=require(_0x918a('0x5'));var util=require(_0x918a('0x6'));var path=require(_0x918a('0x7'));var sox=require(_0x918a('0x8'));var csv=require(_0x918a('0x9'));var ejs=require(_0x918a('0xa'));var fs=require('fs');var fs_extra=require(_0x918a('0xb'));var _=require('lodash');var squel=require(_0x918a('0xc'));var crypto=require(_0x918a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x918a('0xe'));var toCsv=require(_0x918a('0x9'));var querystring=require(_0x918a('0xf'));var Papa=require(_0x918a('0x10'));var Redis=require(_0x918a('0x11'));var authService=require(_0x918a('0x12'));var qs=require(_0x918a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x918a('0x14'));var logger=require(_0x918a('0x15'))(_0x918a('0x16'));var utils=require(_0x918a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x918a('0x18'));var db=require(_0x918a('0x19'))['db'];function respondWithStatusCode(_0x5c0f68,_0x36f4aa){_0x36f4aa=_0x36f4aa||0xcc;return function(_0x3e4490){if(_0x3e4490){return _0x5c0f68[_0x918a('0x1a')](_0x36f4aa);}return _0x5c0f68[_0x918a('0x1b')](_0x36f4aa)['end']();};}function respondWithResult(_0x162d88,_0x55c90e){_0x55c90e=_0x55c90e||0xc8;return function(_0x19583e){if(_0x19583e){return _0x162d88['status'](_0x55c90e)['json'](_0x19583e);}};}function respondWithFilteredResult(_0x325a8f,_0x22bd74){return function(_0x47ce2d){if(_0x47ce2d){var _0x355174=typeof _0x22bd74['offset']===_0x918a('0x1c')&&typeof _0x22bd74[_0x918a('0x1d')]===_0x918a('0x1c');var _0x4ae164=_0x47ce2d[_0x918a('0x1e')];var _0x51e467=_0x355174?0x0:_0x22bd74[_0x918a('0x1f')];var _0x22e347=_0x355174?_0x47ce2d[_0x918a('0x1e')]:_0x22bd74[_0x918a('0x1f')]+_0x22bd74['limit'];var _0x21a4a3;if(_0x22e347>=_0x4ae164){_0x22e347=_0x4ae164;_0x21a4a3=0xc8;}else{_0x21a4a3=0xce;}_0x325a8f[_0x918a('0x1b')](_0x21a4a3);return _0x325a8f[_0x918a('0x20')](_0x918a('0x21'),_0x51e467+'-'+_0x22e347+'/'+_0x4ae164)[_0x918a('0x22')](_0x47ce2d);}return null;};}function patchUpdates(_0x161142){return function(_0x2cf02b){try{jsonpatch['apply'](_0x2cf02b,_0x161142,!![]);}catch(_0x17acb7){return BPromise['reject'](_0x17acb7);}return _0x2cf02b[_0x918a('0x23')]();};}function saveUpdates(_0x4961fb,_0x4c5993){return function(_0x4c7675){if(_0x4c7675){return _0x4c7675[_0x918a('0x24')](_0x4961fb)['then'](function(_0x32a67d){return _0x32a67d;});}return null;};}function removeEntity(_0xd40a6c,_0xadd3bc){return function(_0x2d8077){if(_0x2d8077){return _0x2d8077[_0x918a('0x25')]()[_0x918a('0x26')](function(){_0xd40a6c[_0x918a('0x1b')](0xcc)[_0x918a('0x27')]();});}};}function handleEntityNotFound(_0xfdad4a,_0xc10404){return function(_0x5a6695){if(!_0x5a6695){_0xfdad4a[_0x918a('0x1a')](0x194);}return _0x5a6695;};}function handleError(_0x1bdb27,_0x262d5c){_0x262d5c=_0x262d5c||0x1f4;return function(_0x4a77c6){logger[_0x918a('0x28')](_0x4a77c6[_0x918a('0x29')]);if(_0x4a77c6[_0x918a('0x2a')]){delete _0x4a77c6['name'];}_0x1bdb27[_0x918a('0x1b')](_0x262d5c)[_0x918a('0x2b')](_0x4a77c6);};}exports[_0x918a('0x2c')]=function(_0x2a4e28,_0x1e47f4){var _0x36a55c={},_0x51361c={},_0x57b6a7={'count':0x0,'rows':[]};var _0x5ac4b4=_[_0x918a('0x2d')](db[_0x918a('0x2e')]['rawAttributes'],function(_0x1dd40a){return{'name':_0x1dd40a[_0x918a('0x2f')],'type':_0x1dd40a['type']['key']};});_0x51361c[_0x918a('0x30')]=_['map'](_0x5ac4b4,_0x918a('0x2a'));_0x51361c[_0x918a('0x31')]=_[_0x918a('0x32')](_0x2a4e28[_0x918a('0x31')]);_0x51361c[_0x918a('0x33')]=_[_0x918a('0x34')](_0x51361c['model'],_0x51361c[_0x918a('0x31')]);_0x36a55c[_0x918a('0x35')]=_[_0x918a('0x34')](_0x51361c[_0x918a('0x30')],qs[_0x918a('0x36')](_0x2a4e28[_0x918a('0x31')]['fields']));_0x36a55c[_0x918a('0x35')]=_0x36a55c[_0x918a('0x35')][_0x918a('0x37')]?_0x36a55c['attributes']:_0x51361c[_0x918a('0x30')];if(!_0x2a4e28['query'][_0x918a('0x38')]('nolimit')){_0x36a55c[_0x918a('0x1d')]=qs[_0x918a('0x1d')](_0x2a4e28[_0x918a('0x31')][_0x918a('0x1d')]);_0x36a55c[_0x918a('0x1f')]=qs['offset'](_0x2a4e28['query'][_0x918a('0x1f')]);}_0x36a55c[_0x918a('0x39')]=qs['sort'](_0x2a4e28[_0x918a('0x31')][_0x918a('0x3a')]);_0x36a55c[_0x918a('0x3b')]=qs[_0x918a('0x33')](_[_0x918a('0x3c')](_0x2a4e28[_0x918a('0x31')],_0x51361c[_0x918a('0x33')]),_0x5ac4b4);if(_0x2a4e28['query'][_0x918a('0x3d')]){_0x36a55c['where']=_['merge'](_0x36a55c[_0x918a('0x3b')],{'$or':_[_0x918a('0x2d')](_0x5ac4b4,function(_0xbf15){if(_0xbf15[_0x918a('0x3e')]!=='VIRTUAL'){var _0xa86b9d={};_0xa86b9d[_0xbf15[_0x918a('0x2a')]]={'$like':'%'+_0x2a4e28[_0x918a('0x31')][_0x918a('0x3d')]+'%'};return _0xa86b9d;}})});}_0x36a55c=_[_0x918a('0x3f')]({},_0x36a55c,_0x2a4e28['options']);var _0xca5fdb={'where':_0x36a55c[_0x918a('0x3b')]};return db[_0x918a('0x2e')][_0x918a('0x1e')](_0xca5fdb)[_0x918a('0x26')](function(_0xb30a66){_0x57b6a7[_0x918a('0x1e')]=_0xb30a66;if(_0x2a4e28[_0x918a('0x31')][_0x918a('0x40')]){_0x36a55c['include']=[{'all':!![]}];}return db[_0x918a('0x2e')][_0x918a('0x41')](_0x36a55c);})[_0x918a('0x26')](function(_0x4440bd){_0x57b6a7[_0x918a('0x42')]=_0x4440bd;return _0x57b6a7;})[_0x918a('0x26')](respondWithFilteredResult(_0x1e47f4,_0x36a55c))[_0x918a('0x43')](handleError(_0x1e47f4,null));};exports['show']=function(_0x1ac156,_0xae4f7a){var _0x9dc719={'raw':!![],'where':{'id':_0x1ac156['params']['id']}},_0x44c419={};_0x44c419[_0x918a('0x30')]=_['keys'](db[_0x918a('0x2e')][_0x918a('0x44')]);_0x44c419['query']=_['keys'](_0x1ac156[_0x918a('0x31')]);_0x44c419[_0x918a('0x33')]=_[_0x918a('0x34')](_0x44c419[_0x918a('0x30')],_0x44c419['query']);_0x9dc719['attributes']=_[_0x918a('0x34')](_0x44c419[_0x918a('0x30')],qs[_0x918a('0x36')](_0x1ac156[_0x918a('0x31')]['fields']));_0x9dc719['attributes']=_0x9dc719[_0x918a('0x35')]['length']?_0x9dc719[_0x918a('0x35')]:_0x44c419[_0x918a('0x30')];if(_0x1ac156[_0x918a('0x31')][_0x918a('0x40')]){_0x9dc719[_0x918a('0x45')]=[{'all':!![]}];}_0x9dc719=_[_0x918a('0x3f')]({},_0x9dc719,_0x1ac156[_0x918a('0x46')]);return db[_0x918a('0x2e')][_0x918a('0x47')](_0x9dc719)[_0x918a('0x26')](handleEntityNotFound(_0xae4f7a,null))[_0x918a('0x26')](respondWithResult(_0xae4f7a,null))[_0x918a('0x43')](handleError(_0xae4f7a,null));};exports[_0x918a('0x48')]=function(_0x1982a5,_0x5048b8){return db[_0x918a('0x2e')]['create'](_0x1982a5['body'],{})[_0x918a('0x26')](respondWithResult(_0x5048b8,0xc9))['catch'](handleError(_0x5048b8,null));};exports[_0x918a('0x24')]=function(_0x31cb92,_0x5e1a6a){if(_0x31cb92['body']['id']){delete _0x31cb92[_0x918a('0x49')]['id'];}return db['FaxQueueReport'][_0x918a('0x47')]({'where':{'id':_0x31cb92[_0x918a('0x4a')]['id']}})[_0x918a('0x26')](handleEntityNotFound(_0x5e1a6a,null))[_0x918a('0x26')](saveUpdates(_0x31cb92[_0x918a('0x49')],null))['then'](respondWithResult(_0x5e1a6a,null))[_0x918a('0x43')](handleError(_0x5e1a6a,null));};exports[_0x918a('0x25')]=function(_0x3f4103,_0x4fc77d){return db[_0x918a('0x2e')]['find']({'where':{'id':_0x3f4103[_0x918a('0x4a')]['id']}})[_0x918a('0x26')](handleEntityNotFound(_0x4fc77d,null))[_0x918a('0x26')](removeEntity(_0x4fc77d,null))[_0x918a('0x43')](handleError(_0x4fc77d,null));};exports['describe']=function(_0x2b8a6b,_0x3eb9be){return db[_0x918a('0x2e')][_0x918a('0x4b')]()[_0x918a('0x26')](respondWithResult(_0x3eb9be,null))['catch'](handleError(_0x3eb9be,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 88e6d56..a8d1a51 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x44d537,_0x3fa888){var _0x18684d=function(_0x5395d5){while(--_0x5395d5){_0x44d537['push'](_0x44d537['shift']());}};_0x18684d(++_0x3fa888);}(_0x5fab,0x177));var _0xb5fa=function(_0x134c79,_0x2136d3){_0x134c79=_0x134c79-0x0;var _0x2c2142=_0x5fab[_0x134c79];return _0x2c2142;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x2e75ba,_0xeb009c){var _0x5ace1d=function(_0x434504){while(--_0x434504){_0x2e75ba['push'](_0x2e75ba['shift']());}};_0x5ace1d(++_0xeb009c);}(_0x1261,0x144));var _0x1126=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x1261[_0x9d14e3];return _0x19bf32;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index fadc589..9e38af7 100644 --- a/server/api/faxQueueReport/faxQueueReport.rpc.js +++ b/server/api/faxQueueReport/faxQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29d1=['body','raw','where','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','create','options','UpdateFaxQueueReport','FaxQueueReport','update'];(function(_0x4f9d3d,_0x41196e){var _0x4ab7c6=function(_0x477548){while(--_0x477548){_0x4f9d3d['push'](_0x4f9d3d['shift']());}};_0x4ab7c6(++_0x41196e);}(_0x29d1,0x136));var _0x129d=function(_0x516044,_0x3677f7){_0x516044=_0x516044-0x0;var _0x31684b=_0x29d1[_0x516044];return _0x31684b;};'use strict';var _=require(_0x129d('0x0'));var util=require(_0x129d('0x1'));var moment=require('moment');var BPromise=require(_0x129d('0x2'));var rs=require(_0x129d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x129d('0x4'))['db'];var utils=require(_0x129d('0x5'));var logger=require(_0x129d('0x6'))(_0x129d('0x7'));var config=require(_0x129d('0x8'));var jayson=require(_0x129d('0x9'));var client=jayson[_0x129d('0xa')][_0x129d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x284efd,_0x4f189c,_0x55e7f1){return new BPromise(function(_0x2e8bf9,_0x2c5544){return client[_0x129d('0xc')](_0x284efd,_0x55e7f1)[_0x129d('0xd')](function(_0x12529e){logger[_0x129d('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x4f189c,_0x129d('0xf'));logger[_0x129d('0x10')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x4f189c,_0x129d('0xf'),JSON[_0x129d('0x11')](_0x12529e));if(_0x12529e['error']){if(_0x12529e[_0x129d('0x12')][_0x129d('0x13')]===0x1f4){logger[_0x129d('0x12')](_0x129d('0x14'),_0x4f189c,_0x12529e[_0x129d('0x12')][_0x129d('0x15')]);return _0x2c5544(_0x12529e[_0x129d('0x12')][_0x129d('0x15')]);}logger[_0x129d('0x12')](_0x129d('0x14'),_0x4f189c,_0x12529e['error']['message']);return _0x2e8bf9(_0x12529e[_0x129d('0x12')][_0x129d('0x15')]);}else{logger[_0x129d('0xe')](_0x129d('0x14'),_0x4f189c,_0x129d('0xf'));_0x2e8bf9(_0x12529e[_0x129d('0x16')][_0x129d('0x15')]);}})[_0x129d('0x17')](function(_0x98f301){logger[_0x129d('0x12')](_0x129d('0x14'),_0x4f189c,_0x98f301);_0x2c5544(_0x98f301);});});}exports[_0x129d('0x18')]=function(_0x18b2a2){var _0x591450=this;return new Promise(function(_0x1cb3de,_0x402e88){return db['FaxQueueReport'][_0x129d('0x19')](_0x18b2a2['body'],{'raw':_0x18b2a2[_0x129d('0x1a')]?_0x18b2a2['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0xfaacda){logger[_0x129d('0xe')]('CreateFaxQueueReport',_0x18b2a2);logger['debug']('CreateFaxQueueReport',_0x18b2a2,JSON[_0x129d('0x11')](_0xfaacda));_0x1cb3de(_0xfaacda);})[_0x129d('0x17')](function(_0x23c3ed){logger[_0x129d('0x12')]('CreateFaxQueueReport',_0x23c3ed[_0x129d('0x15')],_0x18b2a2);_0x402e88(_0x591450['error'](0x1f4,_0x23c3ed[_0x129d('0x15')]));});});};exports[_0x129d('0x1b')]=function(_0x40faca){var _0x5a8deb=this;return new Promise(function(_0x37181f,_0x3faac9){return db[_0x129d('0x1c')][_0x129d('0x1d')](_0x40faca[_0x129d('0x1e')],{'raw':_0x40faca[_0x129d('0x1a')]?_0x40faca['options'][_0x129d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40faca[_0x129d('0x1a')]?_0x40faca[_0x129d('0x1a')][_0x129d('0x20')]||null:null,'attributes':_0x40faca['options']?_0x40faca[_0x129d('0x1a')]['attributes']||null:null,'limit':_0x40faca['options']?_0x40faca[_0x129d('0x1a')][_0x129d('0x21')]||null:null})[_0x129d('0xd')](function(_0x1605aa){logger[_0x129d('0xe')](_0x129d('0x1b'),_0x40faca);logger['debug'](_0x129d('0x1b'),_0x40faca,JSON[_0x129d('0x11')](_0x1605aa));_0x37181f(_0x1605aa);})[_0x129d('0x17')](function(_0x12a5c2){logger['error'](_0x129d('0x1b'),_0x12a5c2[_0x129d('0x15')],_0x40faca);_0x3faac9(_0x5a8deb[_0x129d('0x12')](0x1f4,_0x12a5c2[_0x129d('0x15')]));});});}; \ No newline at end of file +var _0x3672=['../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4b8428,_0x3b9fee){var _0x22dcb0=function(_0x39d796){while(--_0x39d796){_0x4b8428['push'](_0x4b8428['shift']());}};_0x22dcb0(++_0x3b9fee);}(_0x3672,0x107));var _0x2367=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x3672[_0x237546];return _0x233e29;};'use strict';var _=require(_0x2367('0x0'));var util=require(_0x2367('0x1'));var moment=require(_0x2367('0x2'));var BPromise=require(_0x2367('0x3'));var rs=require(_0x2367('0x4'));var fs=require('fs');var Redis=require(_0x2367('0x5'));var db=require(_0x2367('0x6'))['db'];var utils=require(_0x2367('0x7'));var logger=require(_0x2367('0x8'))('rpc');var config=require(_0x2367('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2367('0xa')][_0x2367('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x403316,_0x761d8c,_0x253fb5){return new BPromise(function(_0x31493a,_0x385380){return client[_0x2367('0xc')](_0x403316,_0x253fb5)[_0x2367('0xd')](function(_0x4ae952){logger[_0x2367('0xe')](_0x2367('0xf'),_0x761d8c,_0x2367('0x10'));logger[_0x2367('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x761d8c,'request\x20sent',JSON[_0x2367('0x12')](_0x4ae952));if(_0x4ae952[_0x2367('0x13')]){if(_0x4ae952[_0x2367('0x13')][_0x2367('0x14')]===0x1f4){logger[_0x2367('0x13')](_0x2367('0xf'),_0x761d8c,_0x4ae952[_0x2367('0x13')][_0x2367('0x15')]);return _0x385380(_0x4ae952[_0x2367('0x13')][_0x2367('0x15')]);}logger[_0x2367('0x13')](_0x2367('0xf'),_0x761d8c,_0x4ae952[_0x2367('0x13')][_0x2367('0x15')]);return _0x31493a(_0x4ae952[_0x2367('0x13')][_0x2367('0x15')]);}else{logger[_0x2367('0xe')](_0x2367('0xf'),_0x761d8c,_0x2367('0x10'));_0x31493a(_0x4ae952['result'][_0x2367('0x15')]);}})[_0x2367('0x16')](function(_0x2982d0){logger[_0x2367('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x761d8c,_0x2982d0);_0x385380(_0x2982d0);});});}exports[_0x2367('0x17')]=function(_0x85cc58){var _0x14bdba=this;return new Promise(function(_0x1fc4ce,_0x8dadaf){return db[_0x2367('0x18')][_0x2367('0x19')](_0x85cc58[_0x2367('0x1a')],{'raw':_0x85cc58[_0x2367('0x1b')]?_0x85cc58[_0x2367('0x1b')][_0x2367('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x39bd9a){logger[_0x2367('0xe')](_0x2367('0x17'),_0x85cc58);logger[_0x2367('0x11')]('CreateFaxQueueReport',_0x85cc58,JSON['stringify'](_0x39bd9a));_0x1fc4ce(_0x39bd9a);})['catch'](function(_0x13e2c9){logger[_0x2367('0x13')]('CreateFaxQueueReport',_0x13e2c9[_0x2367('0x15')],_0x85cc58);_0x8dadaf(_0x14bdba['error'](0x1f4,_0x13e2c9['message']));});});};exports[_0x2367('0x1d')]=function(_0x449742){var _0x548f69=this;return new Promise(function(_0xef7e38,_0x327914){return db[_0x2367('0x18')][_0x2367('0x1e')](_0x449742[_0x2367('0x1a')],{'raw':_0x449742[_0x2367('0x1b')]?_0x449742[_0x2367('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x449742[_0x2367('0x1b')]?_0x449742[_0x2367('0x1b')][_0x2367('0x1f')]||null:null,'attributes':_0x449742['options']?_0x449742[_0x2367('0x1b')][_0x2367('0x20')]||null:null,'limit':_0x449742[_0x2367('0x1b')]?_0x449742['options'][_0x2367('0x21')]||null:null})[_0x2367('0xd')](function(_0x2f34cf){logger[_0x2367('0xe')](_0x2367('0x1d'),_0x449742);logger[_0x2367('0x11')](_0x2367('0x1d'),_0x449742,JSON[_0x2367('0x12')](_0x2f34cf));_0xef7e38(_0x2f34cf);})[_0x2367('0x16')](function(_0x504c82){logger[_0x2367('0x13')](_0x2367('0x1d'),_0x504c82[_0x2367('0x15')],_0x449742);_0x327914(_0x548f69[_0x2367('0x13')](0x1f4,_0x504c82['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index f6f5106..e57ae5b 100644 --- a/server/api/faxQueueReport/index.js +++ b/server/api/faxQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x044f=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','show','post','create','put','update','delete','/:id','destroy'];(function(_0xa66be4,_0x1b2845){var _0x199af6=function(_0x116479){while(--_0x116479){_0xa66be4['push'](_0xa66be4['shift']());}};_0x199af6(++_0x1b2845);}(_0x044f,0x1e4));var _0xf044=function(_0x5d0725,_0x1ae8ad){_0x5d0725=_0x5d0725-0x0;var _0x157c30=_0x044f[_0x5d0725];return _0x157c30;};'use strict';var multer=require('multer');var util=require(_0xf044('0x0'));var path=require(_0xf044('0x1'));var timeout=require(_0xf044('0x2'));var express=require(_0xf044('0x3'));var router=express[_0xf044('0x4')]();var fs_extra=require(_0xf044('0x5'));var auth=require(_0xf044('0x6'));var interaction=require(_0xf044('0x7'));var config=require(_0xf044('0x8'));var controller=require(_0xf044('0x9'));router[_0xf044('0xa')]('/',auth['isAuthenticated'](),controller[_0xf044('0xb')]);router[_0xf044('0xa')](_0xf044('0xc'),auth[_0xf044('0xd')](),controller['describe']);router[_0xf044('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf044('0xe')]);router[_0xf044('0xf')]('/',auth['isAuthenticated'](),controller[_0xf044('0x10')]);router[_0xf044('0x11')]('/:id',auth[_0xf044('0xd')](),controller[_0xf044('0x12')]);router[_0xf044('0x13')](_0xf044('0x14'),auth[_0xf044('0xd')](),controller[_0xf044('0x15')]);module[_0xf044('0x16')]=router; \ No newline at end of file +var _0x11f9=['/describe','describe','/:id','show','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11f9,0x10d));var _0x911f=function(_0x48965f,_0x5c8550){_0x48965f=_0x48965f-0x0;var _0x274747=_0x11f9[_0x48965f];return _0x274747;};'use strict';var multer=require(_0x911f('0x0'));var util=require('util');var path=require(_0x911f('0x1'));var timeout=require('connect-timeout');var express=require(_0x911f('0x2'));var router=express[_0x911f('0x3')]();var fs_extra=require(_0x911f('0x4'));var auth=require(_0x911f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x911f('0x6'));var controller=require(_0x911f('0x7'));router[_0x911f('0x8')]('/',auth[_0x911f('0x9')](),controller[_0x911f('0xa')]);router[_0x911f('0x8')](_0x911f('0xb'),auth[_0x911f('0x9')](),controller[_0x911f('0xc')]);router['get'](_0x911f('0xd'),auth['isAuthenticated'](),controller[_0x911f('0xe')]);router['post']('/',auth[_0x911f('0x9')](),controller[_0x911f('0xf')]);router[_0x911f('0x10')](_0x911f('0xd'),auth[_0x911f('0x9')](),controller[_0x911f('0x11')]);router[_0x911f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x911f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9ef78b6..25db66f 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3fcfda,_0xa0bfeb){var _0x132ce0=function(_0x5d227b){while(--_0x5d227b){_0x3fcfda['push'](_0x3fcfda['shift']());}};_0x132ce0(++_0xa0bfeb);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4ea03c,_0x63db75){var _0x348561=function(_0x430499){while(--_0x430499){_0x4ea03c['push'](_0x4ea03c['shift']());}};_0x348561(++_0x63db75);}(_0xaa88,0x137));var _0x8aa8=function(_0x47e309,_0x1e771a){_0x47e309=_0x47e309-0x0;var _0x2e1900=_0xaa88[_0x47e309];return _0x2e1900;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 300a207..9928781 100644 --- a/server/api/faxTransferReport/faxTransferReport.controller.js +++ b/server/api/faxTransferReport/faxTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda52=['destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','find','create','body','params','describe','catch','eml-format','zip-dir','fast-json-patch','mustache','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','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','then'];(function(_0x29a8df,_0x220d0d){var _0x1fe5c4=function(_0x48084b){while(--_0x48084b){_0x29a8df['push'](_0x29a8df['shift']());}};_0x1fe5c4(++_0x220d0d);}(_0xda52,0x1ea));var _0x2da5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xda52[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x2da5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2da5('0x1'));var jsonpatch=require(_0x2da5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2da5('0x3'));var util=require(_0x2da5('0x4'));var path=require(_0x2da5('0x5'));var sox=require(_0x2da5('0x6'));var csv=require(_0x2da5('0x7'));var ejs=require(_0x2da5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2da5('0x9'));var squel=require(_0x2da5('0xa'));var crypto=require(_0x2da5('0xb'));var jsforce=require(_0x2da5('0xc'));var deskjs=require(_0x2da5('0xd'));var toCsv=require(_0x2da5('0x7'));var querystring=require(_0x2da5('0xe'));var Papa=require(_0x2da5('0xf'));var Redis=require(_0x2da5('0x10'));var authService=require(_0x2da5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2da5('0x12'));var hardwareService=require(_0x2da5('0x13'));var logger=require(_0x2da5('0x14'))(_0x2da5('0x15'));var utils=require(_0x2da5('0x16'));var config=require(_0x2da5('0x17'));var licenseUtil=require(_0x2da5('0x18'));var db=require(_0x2da5('0x19'))['db'];function respondWithStatusCode(_0x3b4ff7,_0x56abb7){_0x56abb7=_0x56abb7||0xcc;return function(_0x2b75c1){if(_0x2b75c1){return _0x3b4ff7['sendStatus'](_0x56abb7);}return _0x3b4ff7['status'](_0x56abb7)[_0x2da5('0x1a')]();};}function respondWithResult(_0x7ae24b,_0xefa6f0){_0xefa6f0=_0xefa6f0||0xc8;return function(_0x1c50e9){if(_0x1c50e9){return _0x7ae24b[_0x2da5('0x1b')](_0xefa6f0)[_0x2da5('0x1c')](_0x1c50e9);}};}function respondWithFilteredResult(_0x30bb40,_0x1331c2){return function(_0x5f1beb){if(_0x5f1beb){var _0x27544e=typeof _0x1331c2[_0x2da5('0x1d')]===_0x2da5('0x1e')&&typeof _0x1331c2[_0x2da5('0x1f')]===_0x2da5('0x1e');var _0x4c668c=_0x5f1beb[_0x2da5('0x20')];var _0x523573=_0x27544e?0x0:_0x1331c2[_0x2da5('0x1d')];var _0x19d9bb=_0x27544e?_0x5f1beb['count']:_0x1331c2['offset']+_0x1331c2[_0x2da5('0x1f')];var _0x5b492a;if(_0x19d9bb>=_0x4c668c){_0x19d9bb=_0x4c668c;_0x5b492a=0xc8;}else{_0x5b492a=0xce;}_0x30bb40[_0x2da5('0x1b')](_0x5b492a);return _0x30bb40['set']('Content-Range',_0x523573+'-'+_0x19d9bb+'/'+_0x4c668c)[_0x2da5('0x1c')](_0x5f1beb);}return null;};}function patchUpdates(_0x3778e8){return function(_0x299416){try{jsonpatch[_0x2da5('0x21')](_0x299416,_0x3778e8,!![]);}catch(_0x3c6816){return BPromise['reject'](_0x3c6816);}return _0x299416['save']();};}function saveUpdates(_0xd77dc0,_0x39dbff){return function(_0x4fb46c){if(_0x4fb46c){return _0x4fb46c['update'](_0xd77dc0)[_0x2da5('0x22')](function(_0x1157ad){return _0x1157ad;});}return null;};}function removeEntity(_0x504de6,_0x51cfbc){return function(_0x48ca0a){if(_0x48ca0a){return _0x48ca0a[_0x2da5('0x23')]()[_0x2da5('0x22')](function(){_0x504de6[_0x2da5('0x1b')](0xcc)[_0x2da5('0x1a')]();});}};}function handleEntityNotFound(_0x383508,_0x308cbc){return function(_0x4cc403){if(!_0x4cc403){_0x383508['sendStatus'](0x194);}return _0x4cc403;};}function handleError(_0x112542,_0x58f286){_0x58f286=_0x58f286||0x1f4;return function(_0x4dd2c9){logger[_0x2da5('0x24')](_0x4dd2c9[_0x2da5('0x25')]);if(_0x4dd2c9[_0x2da5('0x26')]){delete _0x4dd2c9[_0x2da5('0x26')];}_0x112542['status'](_0x58f286)[_0x2da5('0x27')](_0x4dd2c9);};}exports[_0x2da5('0x28')]=function(_0x53c852,_0x5526c5){var _0x327c2b={},_0x218276={},_0x4d4a5c={'count':0x0,'rows':[]};var _0x2dd486=_[_0x2da5('0x29')](db[_0x2da5('0x2a')][_0x2da5('0x2b')],function(_0xa2914b){return{'name':_0xa2914b['fieldName'],'type':_0xa2914b[_0x2da5('0x2c')][_0x2da5('0x2d')]};});_0x218276[_0x2da5('0x2e')]=_[_0x2da5('0x29')](_0x2dd486,_0x2da5('0x26'));_0x218276['query']=_[_0x2da5('0x2f')](_0x53c852[_0x2da5('0x30')]);_0x218276[_0x2da5('0x31')]=_[_0x2da5('0x32')](_0x218276[_0x2da5('0x2e')],_0x218276['query']);_0x327c2b[_0x2da5('0x33')]=_['intersection'](_0x218276[_0x2da5('0x2e')],qs[_0x2da5('0x34')](_0x53c852[_0x2da5('0x30')][_0x2da5('0x34')]));_0x327c2b['attributes']=_0x327c2b[_0x2da5('0x33')][_0x2da5('0x35')]?_0x327c2b['attributes']:_0x218276[_0x2da5('0x2e')];if(!_0x53c852[_0x2da5('0x30')][_0x2da5('0x36')](_0x2da5('0x37'))){_0x327c2b[_0x2da5('0x1f')]=qs[_0x2da5('0x1f')](_0x53c852['query']['limit']);_0x327c2b[_0x2da5('0x1d')]=qs[_0x2da5('0x1d')](_0x53c852[_0x2da5('0x30')][_0x2da5('0x1d')]);}_0x327c2b[_0x2da5('0x38')]=qs[_0x2da5('0x39')](_0x53c852[_0x2da5('0x30')][_0x2da5('0x39')]);_0x327c2b[_0x2da5('0x3a')]=qs[_0x2da5('0x31')](_[_0x2da5('0x3b')](_0x53c852[_0x2da5('0x30')],_0x218276[_0x2da5('0x31')]),_0x2dd486);if(_0x53c852[_0x2da5('0x30')][_0x2da5('0x3c')]){_0x327c2b[_0x2da5('0x3a')]=_[_0x2da5('0x3d')](_0x327c2b['where'],{'$or':_[_0x2da5('0x29')](_0x2dd486,function(_0x286532){if(_0x286532[_0x2da5('0x2c')]!==_0x2da5('0x3e')){var _0x546d3c={};_0x546d3c[_0x286532[_0x2da5('0x26')]]={'$like':'%'+_0x53c852[_0x2da5('0x30')][_0x2da5('0x3c')]+'%'};return _0x546d3c;}})});}_0x327c2b=_[_0x2da5('0x3d')]({},_0x327c2b,_0x53c852[_0x2da5('0x3f')]);var _0x130bb={'where':_0x327c2b[_0x2da5('0x3a')]};return db['FaxTransferReport'][_0x2da5('0x20')](_0x130bb)['then'](function(_0xd617b9){_0x4d4a5c[_0x2da5('0x20')]=_0xd617b9;if(_0x53c852[_0x2da5('0x30')]['includeAll']){_0x327c2b[_0x2da5('0x40')]=[{'all':!![]}];}return db[_0x2da5('0x2a')][_0x2da5('0x41')](_0x327c2b);})[_0x2da5('0x22')](function(_0x303495){_0x4d4a5c[_0x2da5('0x42')]=_0x303495;return _0x4d4a5c;})[_0x2da5('0x22')](respondWithFilteredResult(_0x5526c5,_0x327c2b))['catch'](handleError(_0x5526c5,null));};exports[_0x2da5('0x43')]=function(_0x2c47f8,_0x3c8b01){var _0x124d38={'raw':!![],'where':{'id':_0x2c47f8['params']['id']}},_0x2ddbe5={};_0x2ddbe5[_0x2da5('0x2e')]=_[_0x2da5('0x2f')](db[_0x2da5('0x2a')][_0x2da5('0x2b')]);_0x2ddbe5[_0x2da5('0x30')]=_[_0x2da5('0x2f')](_0x2c47f8[_0x2da5('0x30')]);_0x2ddbe5['filters']=_[_0x2da5('0x32')](_0x2ddbe5[_0x2da5('0x2e')],_0x2ddbe5[_0x2da5('0x30')]);_0x124d38[_0x2da5('0x33')]=_['intersection'](_0x2ddbe5[_0x2da5('0x2e')],qs['fields'](_0x2c47f8[_0x2da5('0x30')][_0x2da5('0x34')]));_0x124d38[_0x2da5('0x33')]=_0x124d38[_0x2da5('0x33')][_0x2da5('0x35')]?_0x124d38['attributes']:_0x2ddbe5[_0x2da5('0x2e')];if(_0x2c47f8[_0x2da5('0x30')][_0x2da5('0x44')]){_0x124d38['include']=[{'all':!![]}];}_0x124d38=_[_0x2da5('0x3d')]({},_0x124d38,_0x2c47f8[_0x2da5('0x3f')]);return db[_0x2da5('0x2a')][_0x2da5('0x45')](_0x124d38)[_0x2da5('0x22')](handleEntityNotFound(_0x3c8b01,null))['then'](respondWithResult(_0x3c8b01,null))['catch'](handleError(_0x3c8b01,null));};exports[_0x2da5('0x46')]=function(_0x5b0f33,_0x426ee3){return db[_0x2da5('0x2a')]['create'](_0x5b0f33[_0x2da5('0x47')],{})['then'](respondWithResult(_0x426ee3,0xc9))['catch'](handleError(_0x426ee3,null));};exports['update']=function(_0x2e2299,_0x3c85b7){if(_0x2e2299[_0x2da5('0x47')]['id']){delete _0x2e2299[_0x2da5('0x47')]['id'];}return db[_0x2da5('0x2a')][_0x2da5('0x45')]({'where':{'id':_0x2e2299[_0x2da5('0x48')]['id']}})[_0x2da5('0x22')](handleEntityNotFound(_0x3c85b7,null))[_0x2da5('0x22')](saveUpdates(_0x2e2299['body'],null))['then'](respondWithResult(_0x3c85b7,null))['catch'](handleError(_0x3c85b7,null));};exports[_0x2da5('0x23')]=function(_0x29b83e,_0x42a0b0){return db['FaxTransferReport'][_0x2da5('0x45')]({'where':{'id':_0x29b83e[_0x2da5('0x48')]['id']}})[_0x2da5('0x22')](handleEntityNotFound(_0x42a0b0,null))[_0x2da5('0x22')](removeEntity(_0x42a0b0,null))['catch'](handleError(_0x42a0b0,null));};exports['describe']=function(_0x5925d7,_0xded5){return db['FaxTransferReport'][_0x2da5('0x49')]()[_0x2da5('0x22')](respondWithResult(_0xded5,null))[_0x2da5('0x4a')](handleError(_0xded5,null));}; \ No newline at end of file +var _0xfab8=['includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','FaxTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','options','where'];(function(_0x5c0cc4,_0x41e3f4){var _0x302c1a=function(_0x2d3f25){while(--_0x2d3f25){_0x5c0cc4['push'](_0x5c0cc4['shift']());}};_0x302c1a(++_0x41e3f4);}(_0xfab8,0x140));var _0x8fab=function(_0x2e67e9,_0x344707){_0x2e67e9=_0x2e67e9-0x0;var _0xf737d9=_0xfab8[_0x2e67e9];return _0xf737d9;};'use strict';var emlformat=require(_0x8fab('0x0'));var rimraf=require(_0x8fab('0x1'));var zipdir=require(_0x8fab('0x2'));var jsonpatch=require(_0x8fab('0x3'));var rp=require(_0x8fab('0x4'));var moment=require(_0x8fab('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8fab('0x6'));var util=require('util');var path=require(_0x8fab('0x7'));var sox=require(_0x8fab('0x8'));var csv=require('to-csv');var ejs=require(_0x8fab('0x9'));var fs=require('fs');var fs_extra=require(_0x8fab('0xa'));var _=require(_0x8fab('0xb'));var squel=require('squel');var crypto=require(_0x8fab('0xc'));var jsforce=require(_0x8fab('0xd'));var deskjs=require(_0x8fab('0xe'));var toCsv=require(_0x8fab('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8fab('0x10'));var authService=require(_0x8fab('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8fab('0x12'));var hardwareService=require(_0x8fab('0x13'));var logger=require(_0x8fab('0x14'))(_0x8fab('0x15'));var utils=require('../../config/utils');var config=require(_0x8fab('0x16'));var licenseUtil=require(_0x8fab('0x17'));var db=require(_0x8fab('0x18'))['db'];function respondWithStatusCode(_0x1a20c8,_0x1a4604){_0x1a4604=_0x1a4604||0xcc;return function(_0x196e20){if(_0x196e20){return _0x1a20c8['sendStatus'](_0x1a4604);}return _0x1a20c8[_0x8fab('0x19')](_0x1a4604)[_0x8fab('0x1a')]();};}function respondWithResult(_0x33e61d,_0x32504e){_0x32504e=_0x32504e||0xc8;return function(_0x21fd3c){if(_0x21fd3c){return _0x33e61d[_0x8fab('0x19')](_0x32504e)[_0x8fab('0x1b')](_0x21fd3c);}};}function respondWithFilteredResult(_0x1b4b88,_0x2d21e3){return function(_0x3bc17a){if(_0x3bc17a){var _0x1a55db=typeof _0x2d21e3[_0x8fab('0x1c')]===_0x8fab('0x1d')&&typeof _0x2d21e3['limit']===_0x8fab('0x1d');var _0xe7c9a2=_0x3bc17a[_0x8fab('0x1e')];var _0x536d78=_0x1a55db?0x0:_0x2d21e3['offset'];var _0x3f1583=_0x1a55db?_0x3bc17a[_0x8fab('0x1e')]:_0x2d21e3[_0x8fab('0x1c')]+_0x2d21e3[_0x8fab('0x1f')];var _0x38e408;if(_0x3f1583>=_0xe7c9a2){_0x3f1583=_0xe7c9a2;_0x38e408=0xc8;}else{_0x38e408=0xce;}_0x1b4b88['status'](_0x38e408);return _0x1b4b88[_0x8fab('0x20')]('Content-Range',_0x536d78+'-'+_0x3f1583+'/'+_0xe7c9a2)['json'](_0x3bc17a);}return null;};}function patchUpdates(_0x41cd5f){return function(_0x74c080){try{jsonpatch[_0x8fab('0x21')](_0x74c080,_0x41cd5f,!![]);}catch(_0x5d20f1){return BPromise['reject'](_0x5d20f1);}return _0x74c080[_0x8fab('0x22')]();};}function saveUpdates(_0x12a1b7,_0x37411e){return function(_0x539bd9){if(_0x539bd9){return _0x539bd9[_0x8fab('0x23')](_0x12a1b7)[_0x8fab('0x24')](function(_0x591c99){return _0x591c99;});}return null;};}function removeEntity(_0x27aaaf,_0x40334f){return function(_0x17f2a6){if(_0x17f2a6){return _0x17f2a6[_0x8fab('0x25')]()[_0x8fab('0x24')](function(){_0x27aaaf['status'](0xcc)[_0x8fab('0x1a')]();});}};}function handleEntityNotFound(_0x58dee4,_0x3044fb){return function(_0x47384f){if(!_0x47384f){_0x58dee4[_0x8fab('0x26')](0x194);}return _0x47384f;};}function handleError(_0x582f93,_0x3bc980){_0x3bc980=_0x3bc980||0x1f4;return function(_0x5098cf){logger[_0x8fab('0x27')](_0x5098cf[_0x8fab('0x28')]);if(_0x5098cf[_0x8fab('0x29')]){delete _0x5098cf[_0x8fab('0x29')];}_0x582f93[_0x8fab('0x19')](_0x3bc980)['send'](_0x5098cf);};}exports[_0x8fab('0x2a')]=function(_0x154195,_0x3da39f){var _0x466dac={},_0x22207b={},_0x4d5b2a={'count':0x0,'rows':[]};var _0x16c799=_[_0x8fab('0x2b')](db[_0x8fab('0x2c')]['rawAttributes'],function(_0x30e9d2){return{'name':_0x30e9d2[_0x8fab('0x2d')],'type':_0x30e9d2[_0x8fab('0x2e')][_0x8fab('0x2f')]};});_0x22207b[_0x8fab('0x30')]=_['map'](_0x16c799,_0x8fab('0x29'));_0x22207b[_0x8fab('0x31')]=_[_0x8fab('0x32')](_0x154195[_0x8fab('0x31')]);_0x22207b[_0x8fab('0x33')]=_[_0x8fab('0x34')](_0x22207b['model'],_0x22207b[_0x8fab('0x31')]);_0x466dac[_0x8fab('0x35')]=_[_0x8fab('0x34')](_0x22207b[_0x8fab('0x30')],qs[_0x8fab('0x36')](_0x154195[_0x8fab('0x31')][_0x8fab('0x36')]));_0x466dac[_0x8fab('0x35')]=_0x466dac[_0x8fab('0x35')][_0x8fab('0x37')]?_0x466dac['attributes']:_0x22207b[_0x8fab('0x30')];if(!_0x154195[_0x8fab('0x31')][_0x8fab('0x38')](_0x8fab('0x39'))){_0x466dac[_0x8fab('0x1f')]=qs[_0x8fab('0x1f')](_0x154195[_0x8fab('0x31')]['limit']);_0x466dac[_0x8fab('0x1c')]=qs[_0x8fab('0x1c')](_0x154195['query'][_0x8fab('0x1c')]);}_0x466dac[_0x8fab('0x3a')]=qs['sort'](_0x154195[_0x8fab('0x31')][_0x8fab('0x3b')]);_0x466dac['where']=qs[_0x8fab('0x33')](_['pick'](_0x154195[_0x8fab('0x31')],_0x22207b['filters']),_0x16c799);if(_0x154195[_0x8fab('0x31')][_0x8fab('0x3c')]){_0x466dac['where']=_[_0x8fab('0x3d')](_0x466dac['where'],{'$or':_[_0x8fab('0x2b')](_0x16c799,function(_0x4ec5f4){if(_0x4ec5f4[_0x8fab('0x2e')]!==_0x8fab('0x3e')){var _0x108597={};_0x108597[_0x4ec5f4[_0x8fab('0x29')]]={'$like':'%'+_0x154195[_0x8fab('0x31')][_0x8fab('0x3c')]+'%'};return _0x108597;}})});}_0x466dac=_[_0x8fab('0x3d')]({},_0x466dac,_0x154195[_0x8fab('0x3f')]);var _0x46081a={'where':_0x466dac[_0x8fab('0x40')]};return db['FaxTransferReport'][_0x8fab('0x1e')](_0x46081a)[_0x8fab('0x24')](function(_0x4458f4){_0x4d5b2a[_0x8fab('0x1e')]=_0x4458f4;if(_0x154195['query'][_0x8fab('0x41')]){_0x466dac[_0x8fab('0x42')]=[{'all':!![]}];}return db[_0x8fab('0x2c')][_0x8fab('0x43')](_0x466dac);})['then'](function(_0x8ea291){_0x4d5b2a[_0x8fab('0x44')]=_0x8ea291;return _0x4d5b2a;})['then'](respondWithFilteredResult(_0x3da39f,_0x466dac))[_0x8fab('0x45')](handleError(_0x3da39f,null));};exports[_0x8fab('0x46')]=function(_0x27e083,_0x1835ad){var _0x2d06f2={'raw':!![],'where':{'id':_0x27e083[_0x8fab('0x47')]['id']}},_0x2e7641={};_0x2e7641[_0x8fab('0x30')]=_['keys'](db['FaxTransferReport'][_0x8fab('0x48')]);_0x2e7641[_0x8fab('0x31')]=_[_0x8fab('0x32')](_0x27e083[_0x8fab('0x31')]);_0x2e7641['filters']=_[_0x8fab('0x34')](_0x2e7641['model'],_0x2e7641['query']);_0x2d06f2['attributes']=_['intersection'](_0x2e7641[_0x8fab('0x30')],qs[_0x8fab('0x36')](_0x27e083[_0x8fab('0x31')][_0x8fab('0x36')]));_0x2d06f2[_0x8fab('0x35')]=_0x2d06f2[_0x8fab('0x35')][_0x8fab('0x37')]?_0x2d06f2[_0x8fab('0x35')]:_0x2e7641[_0x8fab('0x30')];if(_0x27e083['query'][_0x8fab('0x41')]){_0x2d06f2[_0x8fab('0x42')]=[{'all':!![]}];}_0x2d06f2=_[_0x8fab('0x3d')]({},_0x2d06f2,_0x27e083['options']);return db['FaxTransferReport']['find'](_0x2d06f2)[_0x8fab('0x24')](handleEntityNotFound(_0x1835ad,null))[_0x8fab('0x24')](respondWithResult(_0x1835ad,null))[_0x8fab('0x45')](handleError(_0x1835ad,null));};exports[_0x8fab('0x49')]=function(_0x253570,_0x3a0412){return db[_0x8fab('0x2c')]['create'](_0x253570[_0x8fab('0x4a')],{})['then'](respondWithResult(_0x3a0412,0xc9))[_0x8fab('0x45')](handleError(_0x3a0412,null));};exports['update']=function(_0x4b6d12,_0x5eb229){if(_0x4b6d12[_0x8fab('0x4a')]['id']){delete _0x4b6d12[_0x8fab('0x4a')]['id'];}return db['FaxTransferReport'][_0x8fab('0x4b')]({'where':{'id':_0x4b6d12[_0x8fab('0x47')]['id']}})['then'](handleEntityNotFound(_0x5eb229,null))[_0x8fab('0x24')](saveUpdates(_0x4b6d12[_0x8fab('0x4a')],null))[_0x8fab('0x24')](respondWithResult(_0x5eb229,null))[_0x8fab('0x45')](handleError(_0x5eb229,null));};exports[_0x8fab('0x25')]=function(_0x35c649,_0x15b488){return db[_0x8fab('0x2c')]['find']({'where':{'id':_0x35c649[_0x8fab('0x47')]['id']}})[_0x8fab('0x24')](handleEntityNotFound(_0x15b488,null))[_0x8fab('0x24')](removeEntity(_0x15b488,null))[_0x8fab('0x45')](handleError(_0x15b488,null));};exports[_0x8fab('0x4c')]=function(_0x47f5c1,_0x2056df){return db[_0x8fab('0x2c')]['describe']()[_0x8fab('0x24')](respondWithResult(_0x2056df,null))['catch'](handleError(_0x2056df,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index ce6e4ea..5b31842 100644 --- a/server/api/faxTransferReport/faxTransferReport.model.js +++ b/server/api/faxTransferReport/faxTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a0c=['bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','define','report_fax_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x9a0c,0x8b));var _0xc9a0=function(_0x51e5db,_0x3c8b57){_0x51e5db=_0x51e5db-0x0;var _0x32e23c=_0x9a0c[_0x51e5db];return _0x32e23c;};'use strict';var _=require('lodash');var util=require(_0xc9a0('0x0'));var logger=require(_0xc9a0('0x1'))(_0xc9a0('0x2'));var moment=require(_0xc9a0('0x3'));var BPromise=require(_0xc9a0('0x4'));var rp=require(_0xc9a0('0x5'));var fs=require('fs');var path=require(_0xc9a0('0x6'));var rimraf=require(_0xc9a0('0x7'));var config=require(_0xc9a0('0x8'));var attributes=require(_0xc9a0('0x9'));module['exports']=function(_0x2195d7,_0x150993){return _0x2195d7[_0xc9a0('0xa')]('FaxTransferReport',attributes,{'tableName':_0xc9a0('0xb'),'paranoid':![],'indexes':[{'name':_0xc9a0('0xc'),'fields':[_0xc9a0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c6c=['./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2475b9,_0x12ee6a){var _0x2cb2be=function(_0x5a8295){while(--_0x5a8295){_0x2475b9['push'](_0x2475b9['shift']());}};_0x2cb2be(++_0x12ee6a);}(_0x3c6c,0x1f4));var _0xc3c6=function(_0x10dfb3,_0x44ee65){_0x10dfb3=_0x10dfb3-0x0;var _0x142ac0=_0x3c6c[_0x10dfb3];return _0x142ac0;};'use strict';var _=require(_0xc3c6('0x0'));var util=require(_0xc3c6('0x1'));var logger=require(_0xc3c6('0x2'))(_0xc3c6('0x3'));var moment=require(_0xc3c6('0x4'));var BPromise=require(_0xc3c6('0x5'));var rp=require(_0xc3c6('0x6'));var fs=require('fs');var path=require(_0xc3c6('0x7'));var rimraf=require(_0xc3c6('0x8'));var config=require(_0xc3c6('0x9'));var attributes=require(_0xc3c6('0xa'));module['exports']=function(_0x55b919,_0x5b6d9f){return _0x55b919[_0xc3c6('0xb')](_0xc3c6('0xc'),attributes,{'tableName':_0xc3c6('0xd'),'paranoid':![],'indexes':[{'name':_0xc3c6('0xe'),'fields':[_0xc3c6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 45bda0c..c373fc2 100644 --- a/server/api/faxTransferReport/faxTransferReport.rpc.js +++ b/server/api/faxTransferReport/faxTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe55c=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe55c,0x1d3));var _0xce55=function(_0x354a7f,_0x4d1ede){_0x354a7f=_0x354a7f-0x0;var _0xbda426=_0xe55c[_0x354a7f];return _0xbda426;};'use strict';var _=require('lodash');var util=require(_0xce55('0x0'));var moment=require(_0xce55('0x1'));var BPromise=require(_0xce55('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce55('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce55('0x4'));var logger=require('../../config/logger')(_0xce55('0x5'));var config=require(_0xce55('0x6'));var jayson=require(_0xce55('0x7'));var client=jayson[_0xce55('0x8')][_0xce55('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fc4af,_0xf96df,_0x25b601){return new BPromise(function(_0x346c05,_0x3d6b5d){return client[_0xce55('0xa')](_0x3fc4af,_0x25b601)['then'](function(_0x3d9dc0){logger[_0xce55('0xb')](_0xce55('0xc'),_0xf96df,_0xce55('0xd'));logger[_0xce55('0xe')](_0xce55('0xf'),_0xf96df,_0xce55('0xd'),JSON[_0xce55('0x10')](_0x3d9dc0));if(_0x3d9dc0[_0xce55('0x11')]){if(_0x3d9dc0[_0xce55('0x11')]['code']===0x1f4){logger[_0xce55('0x11')](_0xce55('0xc'),_0xf96df,_0x3d9dc0['error'][_0xce55('0x12')]);return _0x3d6b5d(_0x3d9dc0[_0xce55('0x11')][_0xce55('0x12')]);}logger['error'](_0xce55('0xc'),_0xf96df,_0x3d9dc0[_0xce55('0x11')]['message']);return _0x346c05(_0x3d9dc0[_0xce55('0x11')][_0xce55('0x12')]);}else{logger[_0xce55('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0xf96df,_0xce55('0xd'));_0x346c05(_0x3d9dc0[_0xce55('0x13')][_0xce55('0x12')]);}})[_0xce55('0x14')](function(_0x56aec1){logger[_0xce55('0x11')](_0xce55('0xc'),_0xf96df,_0x56aec1);_0x3d6b5d(_0x56aec1);});});} \ No newline at end of file +var _0x3176=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x233843,_0x2d4516){var _0x4081f8=function(_0x7ab30c){while(--_0x7ab30c){_0x233843['push'](_0x233843['shift']());}};_0x4081f8(++_0x2d4516);}(_0x3176,0x1c0));var _0x6317=function(_0x2e2242,_0x46851f){_0x2e2242=_0x2e2242-0x0;var _0x26d8ab=_0x3176[_0x2e2242];return _0x26d8ab;};'use strict';var _=require(_0x6317('0x0'));var util=require(_0x6317('0x1'));var moment=require('moment');var BPromise=require(_0x6317('0x2'));var rs=require(_0x6317('0x3'));var fs=require('fs');var Redis=require(_0x6317('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6317('0x5'))(_0x6317('0x6'));var config=require(_0x6317('0x7'));var jayson=require(_0x6317('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x218b4c,_0x1ed415,_0x23a165){return new BPromise(function(_0xb94c50,_0x27ff32){return client[_0x6317('0x9')](_0x218b4c,_0x23a165)[_0x6317('0xa')](function(_0x46bf71){logger[_0x6317('0xb')](_0x6317('0xc'),_0x1ed415,_0x6317('0xd'));logger[_0x6317('0xe')](_0x6317('0xf'),_0x1ed415,_0x6317('0xd'),JSON[_0x6317('0x10')](_0x46bf71));if(_0x46bf71[_0x6317('0x11')]){if(_0x46bf71['error'][_0x6317('0x12')]===0x1f4){logger[_0x6317('0x11')](_0x6317('0xc'),_0x1ed415,_0x46bf71[_0x6317('0x11')][_0x6317('0x13')]);return _0x27ff32(_0x46bf71[_0x6317('0x11')]['message']);}logger[_0x6317('0x11')](_0x6317('0xc'),_0x1ed415,_0x46bf71[_0x6317('0x11')][_0x6317('0x13')]);return _0xb94c50(_0x46bf71['error'][_0x6317('0x13')]);}else{logger['info'](_0x6317('0xc'),_0x1ed415,_0x6317('0xd'));_0xb94c50(_0x46bf71['result']['message']);}})['catch'](function(_0x317cf1){logger[_0x6317('0x11')](_0x6317('0xc'),_0x1ed415,_0x317cf1);_0x27ff32(_0x317cf1);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 6d5da45..0788636 100644 --- a/server/api/faxTransferReport/index.js +++ b/server/api/faxTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d81=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5bc338,_0x597f7a){var _0xb87637=function(_0x1a7e42){while(--_0x1a7e42){_0x5bc338['push'](_0x5bc338['shift']());}};_0xb87637(++_0x597f7a);}(_0x2d81,0x1ae));var _0x12d8=function(_0x46e669,_0x5d711d){_0x46e669=_0x46e669-0x0;var _0x51ae5b=_0x2d81[_0x46e669];return _0x51ae5b;};'use strict';var multer=require(_0x12d8('0x0'));var util=require(_0x12d8('0x1'));var path=require(_0x12d8('0x2'));var timeout=require(_0x12d8('0x3'));var express=require(_0x12d8('0x4'));var router=express[_0x12d8('0x5')]();var fs_extra=require(_0x12d8('0x6'));var auth=require(_0x12d8('0x7'));var interaction=require(_0x12d8('0x8'));var config=require(_0x12d8('0x9'));var controller=require(_0x12d8('0xa'));router[_0x12d8('0xb')]('/',auth[_0x12d8('0xc')](),controller[_0x12d8('0xd')]);router[_0x12d8('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x12d8('0xe')]);router[_0x12d8('0xb')](_0x12d8('0xf'),auth[_0x12d8('0xc')](),controller[_0x12d8('0x10')]);router[_0x12d8('0x11')]('/',auth['isAuthenticated'](),controller[_0x12d8('0x12')]);router[_0x12d8('0x13')]('/:id',auth[_0x12d8('0xc')](),controller['update']);router[_0x12d8('0x14')]('/:id',auth[_0x12d8('0xc')](),controller[_0x12d8('0x15')]);module[_0x12d8('0x16')]=router; \ No newline at end of file +var _0x190b=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra'];(function(_0x141cdc,_0xa038e9){var _0x2d7d88=function(_0x5d161f){while(--_0x5d161f){_0x141cdc['push'](_0x141cdc['shift']());}};_0x2d7d88(++_0xa038e9);}(_0x190b,0x13e));var _0xb190=function(_0x4d28e7,_0x353ff1){_0x4d28e7=_0x4d28e7-0x0;var _0x5dddd2=_0x190b[_0x4d28e7];return _0x5dddd2;};'use strict';var multer=require(_0xb190('0x0'));var util=require('util');var path=require(_0xb190('0x1'));var timeout=require(_0xb190('0x2'));var express=require(_0xb190('0x3'));var router=express['Router']();var fs_extra=require(_0xb190('0x4'));var auth=require(_0xb190('0x5'));var interaction=require(_0xb190('0x6'));var config=require(_0xb190('0x7'));var controller=require('./faxTransferReport.controller');router[_0xb190('0x8')]('/',auth[_0xb190('0x9')](),controller[_0xb190('0xa')]);router[_0xb190('0x8')](_0xb190('0xb'),auth[_0xb190('0x9')](),controller['describe']);router['get'](_0xb190('0xc'),auth[_0xb190('0x9')](),controller[_0xb190('0xd')]);router['post']('/',auth[_0xb190('0x9')](),controller[_0xb190('0xe')]);router[_0xb190('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb190('0x10')]);router[_0xb190('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb190('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 6aeca41..05b55b8 100644 --- a/server/api/intDeskAccount/index.js +++ b/server/api/intDeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x194e=['multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','put','delete','destroy','exports'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x194e,0x1a2));var _0xe194=function(_0x20a86c,_0x3ba154){_0x20a86c=_0x20a86c-0x0;var _0x1da357=_0x194e[_0x20a86c];return _0x1da357;};'use strict';var multer=require(_0xe194('0x0'));var util=require(_0xe194('0x1'));var path=require(_0xe194('0x2'));var timeout=require(_0xe194('0x3'));var express=require('express');var router=express[_0xe194('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe194('0x5'));var config=require(_0xe194('0x6'));var controller=require(_0xe194('0x7'));router[_0xe194('0x8')]('/',auth[_0xe194('0x9')](),controller[_0xe194('0xa')]);router[_0xe194('0x8')](_0xe194('0xb'),auth[_0xe194('0x9')](),controller['show']);router['get']('/:id/configurations',auth[_0xe194('0x9')](),controller[_0xe194('0xc')]);router[_0xe194('0x8')](_0xe194('0xd'),auth[_0xe194('0x9')](),controller[_0xe194('0xe')]);router['post']('/',auth[_0xe194('0x9')](),controller[_0xe194('0xf')]);router['post'](_0xe194('0x10'),auth[_0xe194('0x9')](),controller[_0xe194('0x11')]);router[_0xe194('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe194('0x13')](_0xe194('0xb'),auth['isAuthenticated'](),controller[_0xe194('0x14')]);module[_0xe194('0x15')]=router; \ No newline at end of file +var _0x5063=['./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x5063,0x180));var _0x3506=function(_0x8c941b,_0x5a72f7){_0x8c941b=_0x8c941b-0x0;var _0x2e0df7=_0x5063[_0x8c941b];return _0x2e0df7;};'use strict';var multer=require('multer');var util=require(_0x3506('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3506('0x1'));var router=express[_0x3506('0x2')]();var fs_extra=require(_0x3506('0x3'));var auth=require(_0x3506('0x4'));var interaction=require(_0x3506('0x5'));var config=require(_0x3506('0x6'));var controller=require(_0x3506('0x7'));router[_0x3506('0x8')]('/',auth[_0x3506('0x9')](),controller[_0x3506('0xa')]);router['get'](_0x3506('0xb'),auth[_0x3506('0x9')](),controller['show']);router[_0x3506('0x8')](_0x3506('0xc'),auth[_0x3506('0x9')](),controller[_0x3506('0xd')]);router[_0x3506('0x8')]('/:id/fields',auth[_0x3506('0x9')](),controller[_0x3506('0xe')]);router['post']('/',auth[_0x3506('0x9')](),controller[_0x3506('0xf')]);router[_0x3506('0x10')](_0x3506('0xc'),auth[_0x3506('0x9')](),controller[_0x3506('0x11')]);router[_0x3506('0x12')](_0x3506('0xb'),auth[_0x3506('0x9')](),controller[_0x3506('0x13')]);router[_0x3506('0x14')](_0x3506('0xb'),auth[_0x3506('0x9')](),controller[_0x3506('0x15')]);module[_0x3506('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index c6e13a8..07b82ad 100644 --- a/server/api/intDeskAccount/intDeskAccount.attributes.js +++ b/server/api/intDeskAccount/intDeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x743d=['basic','integrationTab','newTab','exports','STRING','ENUM'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x743d,0x123));var _0xd743=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x743d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xd743('0x0')]={'name':{'type':Sequelize[_0xd743('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd743('0x1')]},'authType':{'type':Sequelize[_0xd743('0x2')](_0xd743('0x3')),'defaultValue':_0xd743('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xd743('0x1')]},'consumerSecret':{'type':Sequelize[_0xd743('0x1')]},'token':{'type':Sequelize[_0xd743('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xd743('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd743('0x4'),_0xd743('0x5')),'defaultValue':_0xd743('0x4')}}; \ No newline at end of file +var _0xed90=['integrationTab','sequelize','exports','STRING','basic','ENUM','newTab'];(function(_0x3eb695,_0x269afc){var _0x31e571=function(_0x7be1cb){while(--_0x7be1cb){_0x3eb695['push'](_0x3eb695['shift']());}};_0x31e571(++_0x269afc);}(_0xed90,0x197));var _0x0ed9=function(_0x1016ad,_0x5a74aa){_0x1016ad=_0x1016ad-0x0;var _0x2c19a6=_0xed90[_0x1016ad];return _0x2c19a6;};'use strict';var Sequelize=require(_0x0ed9('0x0'));module[_0x0ed9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0ed9('0x2')]},'remoteUri':{'type':Sequelize[_0x0ed9('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x0ed9('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x0ed9('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x0ed9('0x2')]},'token':{'type':Sequelize[_0x0ed9('0x2')]},'tokenSecret':{'type':Sequelize[_0x0ed9('0x2')]},'serverUrl':{'type':Sequelize[_0x0ed9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0ed9('0x4')]('integrationTab',_0x0ed9('0x5')),'defaultValue':_0x0ed9('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index cfb23af..82dd70f 100644 --- a/server/api/intDeskAccount/intDeskAccount.controller.js +++ b/server/api/intDeskAccount/intDeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x354c=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','apply','reject','save','destroy','then','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','fields','find','body','findOne','order','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','DeskField','getFields','priority','authType','username','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','password','toString','base64','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials'];(function(_0x38555b,_0x213700){var _0x3e7cb6=function(_0x3fec50){while(--_0x3fec50){_0x38555b['push'](_0x38555b['shift']());}};_0x3e7cb6(++_0x213700);}(_0x354c,0x147));var _0xc354=function(_0x3a5a9c,_0x2f2d2a){_0x3a5a9c=_0x3a5a9c-0x0;var _0x2369bf=_0x354c[_0x3a5a9c];return _0x2369bf;};'use strict';var emlformat=require(_0xc354('0x0'));var rimraf=require(_0xc354('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc354('0x2'));var rp=require(_0xc354('0x3'));var moment=require(_0xc354('0x4'));var BPromise=require(_0xc354('0x5'));var Mustache=require('mustache');var util=require(_0xc354('0x6'));var path=require(_0xc354('0x7'));var sox=require('sox');var csv=require(_0xc354('0x8'));var ejs=require(_0xc354('0x9'));var fs=require('fs');var fs_extra=require(_0xc354('0xa'));var _=require(_0xc354('0xb'));var squel=require(_0xc354('0xc'));var crypto=require(_0xc354('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc354('0x8'));var querystring=require(_0xc354('0xe'));var Papa=require(_0xc354('0xf'));var Redis=require(_0xc354('0x10'));var authService=require(_0xc354('0x11'));var qs=require(_0xc354('0x12'));var as=require(_0xc354('0x13'));var hardwareService=require(_0xc354('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc354('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc354('0x16'))['db'];var integrations=require(_0xc354('0x17'));function respondWithStatusCode(_0x21421a,_0x13f38a){_0x13f38a=_0x13f38a||0xcc;return function(_0x10fb11){if(_0x10fb11){return _0x21421a['sendStatus'](_0x13f38a);}return _0x21421a[_0xc354('0x18')](_0x13f38a)[_0xc354('0x19')]();};}function respondWithResult(_0x20bfd8,_0x7faf36){_0x7faf36=_0x7faf36||0xc8;return function(_0x4810bf){if(_0x4810bf){return _0x20bfd8[_0xc354('0x18')](_0x7faf36)[_0xc354('0x1a')](_0x4810bf);}};}function respondWithFilteredResult(_0x3144a6,_0x44a275){return function(_0x4eacb1){if(_0x4eacb1){var _0x2f6d84=typeof _0x44a275[_0xc354('0x1b')]==='undefined'&&typeof _0x44a275[_0xc354('0x1c')]===_0xc354('0x1d');var _0x54cdd3=_0x4eacb1[_0xc354('0x1e')];var _0x446b42=_0x2f6d84?0x0:_0x44a275['offset'];var _0x33bd23=_0x2f6d84?_0x4eacb1[_0xc354('0x1e')]:_0x44a275[_0xc354('0x1b')]+_0x44a275[_0xc354('0x1c')];var _0x250db4;if(_0x33bd23>=_0x54cdd3){_0x33bd23=_0x54cdd3;_0x250db4=0xc8;}else{_0x250db4=0xce;}_0x3144a6['status'](_0x250db4);return _0x3144a6[_0xc354('0x1f')]('Content-Range',_0x446b42+'-'+_0x33bd23+'/'+_0x54cdd3)[_0xc354('0x1a')](_0x4eacb1);}return null;};}function patchUpdates(_0x57d84e){return function(_0x4e13c7){try{jsonpatch[_0xc354('0x20')](_0x4e13c7,_0x57d84e,!![]);}catch(_0x539da7){return BPromise[_0xc354('0x21')](_0x539da7);}return _0x4e13c7[_0xc354('0x22')]();};}function saveUpdates(_0x2a0c1c,_0x1d1004){return function(_0x3ab5dd){if(_0x3ab5dd){return _0x3ab5dd['update'](_0x2a0c1c)['then'](function(_0x1c0794){return _0x1c0794;});}return null;};}function removeEntity(_0x575197,_0x15d869){return function(_0x179d7e){if(_0x179d7e){return _0x179d7e[_0xc354('0x23')]()[_0xc354('0x24')](function(){_0x575197[_0xc354('0x18')](0xcc)[_0xc354('0x19')]();});}};}function handleEntityNotFound(_0x1180a3,_0x45fed2){return function(_0x5a906c){if(!_0x5a906c){_0x1180a3['sendStatus'](0x194);}return _0x5a906c;};}function handleError(_0x333ae3,_0x3a72f1){_0x3a72f1=_0x3a72f1||0x1f4;return function(_0x285c8f){logger[_0xc354('0x25')](_0x285c8f[_0xc354('0x26')]);if(_0x285c8f[_0xc354('0x27')]){delete _0x285c8f[_0xc354('0x27')];}_0x333ae3[_0xc354('0x18')](_0x3a72f1)[_0xc354('0x28')](_0x285c8f);};}exports['index']=function(_0x332582,_0x30f484){var _0x59eb7d={},_0x4964dd={},_0x76b105={'count':0x0,'rows':[]};var _0x1bc3df=_[_0xc354('0x29')](db[_0xc354('0x2a')][_0xc354('0x2b')],function(_0xec98c8){return{'name':_0xec98c8[_0xc354('0x2c')],'type':_0xec98c8[_0xc354('0x2d')]['key']};});_0x4964dd[_0xc354('0x2e')]=_['map'](_0x1bc3df,_0xc354('0x27'));_0x4964dd['query']=_[_0xc354('0x2f')](_0x332582[_0xc354('0x30')]);_0x4964dd[_0xc354('0x31')]=_[_0xc354('0x32')](_0x4964dd[_0xc354('0x2e')],_0x4964dd['query']);_0x59eb7d[_0xc354('0x33')]=_[_0xc354('0x32')](_0x4964dd[_0xc354('0x2e')],qs['fields'](_0x332582[_0xc354('0x30')]['fields']));_0x59eb7d[_0xc354('0x33')]=_0x59eb7d[_0xc354('0x33')][_0xc354('0x34')]?_0x59eb7d[_0xc354('0x33')]:_0x4964dd['model'];if(!_0x332582[_0xc354('0x30')][_0xc354('0x35')]('nolimit')){_0x59eb7d['limit']=qs[_0xc354('0x1c')](_0x332582[_0xc354('0x30')]['limit']);_0x59eb7d[_0xc354('0x1b')]=qs[_0xc354('0x1b')](_0x332582[_0xc354('0x30')][_0xc354('0x1b')]);}_0x59eb7d['order']=qs['sort'](_0x332582[_0xc354('0x30')][_0xc354('0x36')]);_0x59eb7d['where']=qs['filters'](_[_0xc354('0x37')](_0x332582[_0xc354('0x30')],_0x4964dd['filters']),_0x1bc3df);if(_0x332582[_0xc354('0x30')][_0xc354('0x38')]){_0x59eb7d[_0xc354('0x39')]=_['merge'](_0x59eb7d[_0xc354('0x39')],{'$or':_[_0xc354('0x29')](_0x1bc3df,function(_0x1bd68d){if(_0x1bd68d['type']!=='VIRTUAL'){var _0x2c05a5={};_0x2c05a5[_0x1bd68d[_0xc354('0x27')]]={'$like':'%'+_0x332582[_0xc354('0x30')][_0xc354('0x38')]+'%'};return _0x2c05a5;}})});}_0x59eb7d=_[_0xc354('0x3a')]({},_0x59eb7d,_0x332582[_0xc354('0x3b')]);var _0x3fa9f4={'where':_0x59eb7d[_0xc354('0x39')]};return db['DeskAccount'][_0xc354('0x1e')](_0x3fa9f4)[_0xc354('0x24')](function(_0x11a4b9){_0x76b105[_0xc354('0x1e')]=_0x11a4b9;if(_0x332582['query'][_0xc354('0x3c')]){_0x59eb7d[_0xc354('0x3d')]=[{'all':!![]}];}return db['DeskAccount'][_0xc354('0x3e')](_0x59eb7d);})['then'](function(_0x3977cf){_0x76b105['rows']=_0x3977cf;return _0x76b105;})['then'](respondWithFilteredResult(_0x30f484,_0x59eb7d))[_0xc354('0x3f')](handleError(_0x30f484,null));};exports[_0xc354('0x40')]=function(_0x478c0f,_0x5c6060){var _0x26d121={'raw':![],'where':{'id':_0x478c0f[_0xc354('0x41')]['id']}},_0x5c4664={};_0x5c4664['model']=_[_0xc354('0x2f')](db[_0xc354('0x2a')][_0xc354('0x2b')]);_0x5c4664['query']=_[_0xc354('0x2f')](_0x478c0f[_0xc354('0x30')]);_0x5c4664[_0xc354('0x31')]=_['intersection'](_0x5c4664[_0xc354('0x2e')],_0x5c4664['query']);_0x26d121[_0xc354('0x33')]=_[_0xc354('0x32')](_0x5c4664[_0xc354('0x2e')],qs['fields'](_0x478c0f[_0xc354('0x30')][_0xc354('0x42')]));_0x26d121[_0xc354('0x33')]=_0x26d121[_0xc354('0x33')][_0xc354('0x34')]?_0x26d121['attributes']:_0x5c4664[_0xc354('0x2e')];if(_0x478c0f[_0xc354('0x30')][_0xc354('0x3c')]){_0x26d121['include']=[{'all':!![]}];}_0x26d121=_[_0xc354('0x3a')]({},_0x26d121,_0x478c0f['options']);return db[_0xc354('0x2a')][_0xc354('0x43')](_0x26d121)['then'](handleEntityNotFound(_0x5c6060,null))[_0xc354('0x24')](respondWithResult(_0x5c6060,null))['catch'](handleError(_0x5c6060,null));};exports['create']=function(_0x2e5847,_0x194d04){return db[_0xc354('0x2a')]['create'](_0x2e5847['body'],{})[_0xc354('0x24')](respondWithResult(_0x194d04,0xc9))[_0xc354('0x3f')](handleError(_0x194d04,null));};exports['update']=function(_0x1b5ab1,_0x3bb4e9){if(_0x1b5ab1[_0xc354('0x44')]['id']){delete _0x1b5ab1[_0xc354('0x44')]['id'];}return db[_0xc354('0x2a')][_0xc354('0x43')]({'where':{'id':_0x1b5ab1['params']['id']}})['then'](handleEntityNotFound(_0x3bb4e9,null))[_0xc354('0x24')](saveUpdates(_0x1b5ab1[_0xc354('0x44')],null))[_0xc354('0x24')](respondWithResult(_0x3bb4e9,null))['catch'](handleError(_0x3bb4e9,null));};exports['destroy']=function(_0x474033,_0x22086f){return db[_0xc354('0x2a')][_0xc354('0x43')]({'where':{'id':_0x474033['params']['id']}})['then'](handleEntityNotFound(_0x22086f,null))[_0xc354('0x24')](removeEntity(_0x22086f,null))[_0xc354('0x3f')](handleError(_0x22086f,null));};exports['getConfigurations']=function(_0x4a9765,_0x1f9a31,_0x5bcbfe){var _0xedad75={};var _0x57d7a9={};var _0x5a6417;var _0xb99465;return db['DeskAccount'][_0xc354('0x45')]({'where':{'id':_0x4a9765[_0xc354('0x41')]['id']}})[_0xc354('0x24')](handleEntityNotFound(_0x1f9a31,null))[_0xc354('0x24')](function(_0x55c30f){if(_0x55c30f){_0x5a6417=_0x55c30f;_0x57d7a9[_0xc354('0x2e')]=_[_0xc354('0x2f')](db['DeskConfiguration']['rawAttributes']);_0x57d7a9[_0xc354('0x30')]=_[_0xc354('0x2f')](_0x4a9765[_0xc354('0x30')]);_0x57d7a9[_0xc354('0x31')]=_['intersection'](_0x57d7a9['model'],_0x57d7a9[_0xc354('0x30')]);_0xedad75[_0xc354('0x33')]=_[_0xc354('0x32')](_0x57d7a9[_0xc354('0x2e')],qs[_0xc354('0x42')](_0x4a9765[_0xc354('0x30')][_0xc354('0x42')]));_0xedad75['attributes']=_0xedad75[_0xc354('0x33')]['length']?_0xedad75[_0xc354('0x33')]:_0x57d7a9[_0xc354('0x2e')];_0xedad75[_0xc354('0x46')]=qs[_0xc354('0x36')](_0x4a9765[_0xc354('0x30')][_0xc354('0x36')]);_0xedad75[_0xc354('0x39')]=qs['filters'](_[_0xc354('0x37')](_0x4a9765['query'],_0x57d7a9[_0xc354('0x31')]));if(_0x4a9765[_0xc354('0x30')]['filter']){_0xedad75[_0xc354('0x39')]=_['merge'](_0xedad75[_0xc354('0x39')],{'$or':_[_0xc354('0x29')](_0xedad75[_0xc354('0x33')],function(_0x3cf6af){var _0x51e3fa={};_0x51e3fa[_0x3cf6af]={'$like':'%'+_0x4a9765[_0xc354('0x30')]['filter']+'%'};return _0x51e3fa;})});}_0xedad75=_[_0xc354('0x3a')]({},_0xedad75,_0x4a9765[_0xc354('0x3b')]);return _0x5a6417[_0xc354('0x47')](_0xedad75);}})[_0xc354('0x24')](function(_0x4a8051){if(_0x4a8051){_0xb99465=_0x4a8051[_0xc354('0x34')];if(!_0x4a9765['query']['hasOwnProperty'](_0xc354('0x48'))){_0xedad75[_0xc354('0x1c')]=qs[_0xc354('0x1c')](_0x4a9765[_0xc354('0x30')][_0xc354('0x1c')]);_0xedad75[_0xc354('0x1b')]=qs[_0xc354('0x1b')](_0x4a9765['query'][_0xc354('0x1b')]);}return _0x5a6417[_0xc354('0x47')](_0xedad75);}})[_0xc354('0x24')](function(_0x53013e){if(_0x53013e){return _0x53013e?{'count':_0xb99465,'rows':_0x53013e}:null;}})['then'](respondWithResult(_0x1f9a31,null))[_0xc354('0x3f')](handleError(_0x1f9a31,null));};exports[_0xc354('0x49')]=function(_0x52fcad,_0x5bc2cc,_0x2eb109){if(_0x52fcad[_0xc354('0x44')]['id']){delete _0x52fcad['body']['id'];}return db[_0xc354('0x2a')]['findOne']({'where':{'id':_0x52fcad[_0xc354('0x41')]['id']}})[_0xc354('0x24')](handleEntityNotFound(_0x5bc2cc,null))[_0xc354('0x24')](function(_0x5838ce){if(_0x5838ce){_0x52fcad['body'][_0xc354('0x4a')]=_0x5838ce['id'];_0x52fcad[_0xc354('0x44')][_0xc354('0x4b')]=integrations[_0xc354('0x4c')](_0x52fcad[_0xc354('0x44')]['channel'],_0x52fcad[_0xc354('0x44')][_0xc354('0x2d')]);_0x52fcad[_0xc354('0x44')]['Descriptions']=integrations[_0xc354('0x4d')](_0x52fcad['body'][_0xc354('0x4e')],_0x52fcad['body']['type']);return db['DeskConfiguration']['create'](_0x52fcad[_0xc354('0x44')],{'include':[{'model':db[_0xc354('0x4f')],'as':_0xc354('0x4b')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0xc354('0x24')](respondWithResult(_0x5bc2cc,null))[_0xc354('0x3f')](handleError(_0x5bc2cc,null));};exports[_0xc354('0x50')]=function(_0x5b3d2b,_0x33b104,_0x25ea53){var _0x10d0c0=[{'name':_0xc354('0x51'),'label':_0xc354('0x51'),'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 _0x549294='';return db[_0xc354('0x2a')][_0xc354('0x45')]({'where':{'id':_0x5b3d2b['params']['id']},'attributes':['id','remoteUri',_0xc354('0x52'),_0xc354('0x53'),'password','consumerKey',_0xc354('0x54'),_0xc354('0x55'),_0xc354('0x56')]})[_0xc354('0x24')](handleEntityNotFound(_0x33b104,null))[_0xc354('0x24')](function(_0x3ea7a1){if(_0x3ea7a1){_0x549294=_0x3ea7a1['remoteUri'];var _0x1c11f0=_0x549294[_0xc354('0x57')](-0x1);if(_0x1c11f0==='/'){_0x549294=_0x549294[_0xc354('0x58')](0x0,_0x549294[_0xc354('0x59')](_0x1c11f0));}var _0x5e5553={'method':_0xc354('0x5a'),'uri':util[_0xc354('0x5b')](_0xc354('0x5c'),_0x549294),'headers':{'Content-Type':'application/json','Accept':_0xc354('0x5d')},'json':!![]};if(_0x3ea7a1[_0xc354('0x52')]===_0xc354('0x5e')){_0x5e5553[_0xc354('0x5f')][_0xc354('0x60')]=util[_0xc354('0x5b')]('Basic\x20%s',new Buffer(util['format'](_0xc354('0x61'),_0x3ea7a1[_0xc354('0x53')],_0x3ea7a1[_0xc354('0x62')]))[_0xc354('0x63')](_0xc354('0x64')));}return rp(_0x5e5553)['then'](function(_0x5362cb){return _0x10d0c0['concat'](_[_0xc354('0x29')](_0x5362cb[_0xc354('0x65')][_0xc354('0x66')],function(_0x61c5d3){return{'id':_0x61c5d3[_0xc354('0x27')],'name':_0x61c5d3[_0xc354('0x27')],'type':_0x61c5d3[_0xc354('0x2d')],'active':_0x61c5d3['active'],'label':_0x61c5d3[_0xc354('0x67')],'custom':!![]};}));});}})['then'](function(_0x1ac9c4){return{'count':_0x1ac9c4['length'],'rows':_0x1ac9c4};})[_0xc354('0x24')](respondWithResult(_0x33b104,null))[_0xc354('0x3f')](function(_0x58142a){var _0x39dda3=_0x5b3d2b[_0xc354('0x30')][_0xc354('0x68')]?0x1f4:_0x58142a[_0xc354('0x69')]||0x1f4;logger[_0xc354('0x25')](_0xc354('0x6a'),_0xc354('0x50'),_0x39dda3,JSON[_0xc354('0x6b')](_0x58142a));delete _0x58142a[_0xc354('0x27')];if(_0x39dda3===0x191){_0x39dda3=0x190;}_0x33b104[_0xc354('0x18')](_0x39dda3)[_0xc354('0x28')](_0x5b3d2b[_0xc354('0x30')][_0xc354('0x68')]?{'message':_0xc354('0x6c'),'statusCode':_0x58142a[_0xc354('0x69')]}:_0x58142a);});}; \ No newline at end of file +var _0x59f4=['undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','order','addConfiguration','AccountId','Subjects','channel','getDescriptions','DeskField','Descriptions','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x59f4,0xca));var _0x459f=function(_0x5d0609,_0x127562){_0x5d0609=_0x5d0609-0x0;var _0xaa3fd1=_0x59f4[_0x5d0609];return _0xaa3fd1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x459f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x459f('0x1'));var rp=require(_0x459f('0x2'));var moment=require(_0x459f('0x3'));var BPromise=require(_0x459f('0x4'));var Mustache=require(_0x459f('0x5'));var util=require(_0x459f('0x6'));var path=require(_0x459f('0x7'));var sox=require(_0x459f('0x8'));var csv=require(_0x459f('0x9'));var ejs=require(_0x459f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x459f('0xb'));var squel=require(_0x459f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x459f('0xd'));var toCsv=require(_0x459f('0x9'));var querystring=require(_0x459f('0xe'));var Papa=require('papaparse');var Redis=require(_0x459f('0xf'));var authService=require(_0x459f('0x10'));var qs=require(_0x459f('0x11'));var as=require(_0x459f('0x12'));var hardwareService=require(_0x459f('0x13'));var logger=require(_0x459f('0x14'))(_0x459f('0x15'));var utils=require(_0x459f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x459f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x459f('0x18'));function respondWithStatusCode(_0x9ea1a8,_0xf3cc90){_0xf3cc90=_0xf3cc90||0xcc;return function(_0x2d67f0){if(_0x2d67f0){return _0x9ea1a8[_0x459f('0x19')](_0xf3cc90);}return _0x9ea1a8['status'](_0xf3cc90)[_0x459f('0x1a')]();};}function respondWithResult(_0x505adf,_0x44627c){_0x44627c=_0x44627c||0xc8;return function(_0x23ce59){if(_0x23ce59){return _0x505adf[_0x459f('0x1b')](_0x44627c)[_0x459f('0x1c')](_0x23ce59);}};}function respondWithFilteredResult(_0x2601bf,_0x2bee14){return function(_0x19cec2){if(_0x19cec2){var _0x5e2dbc=typeof _0x2bee14[_0x459f('0x1d')]===_0x459f('0x1e')&&typeof _0x2bee14[_0x459f('0x1f')]===_0x459f('0x1e');var _0xbddd3b=_0x19cec2[_0x459f('0x20')];var _0x1b5611=_0x5e2dbc?0x0:_0x2bee14['offset'];var _0x46b4eb=_0x5e2dbc?_0x19cec2[_0x459f('0x20')]:_0x2bee14['offset']+_0x2bee14['limit'];var _0x53605e;if(_0x46b4eb>=_0xbddd3b){_0x46b4eb=_0xbddd3b;_0x53605e=0xc8;}else{_0x53605e=0xce;}_0x2601bf[_0x459f('0x1b')](_0x53605e);return _0x2601bf['set']('Content-Range',_0x1b5611+'-'+_0x46b4eb+'/'+_0xbddd3b)[_0x459f('0x1c')](_0x19cec2);}return null;};}function patchUpdates(_0x3715a7){return function(_0x52fed2){try{jsonpatch[_0x459f('0x21')](_0x52fed2,_0x3715a7,!![]);}catch(_0x5cb1b6){return BPromise[_0x459f('0x22')](_0x5cb1b6);}return _0x52fed2[_0x459f('0x23')]();};}function saveUpdates(_0x568a1d,_0x2f4a5a){return function(_0x5c0fa5){if(_0x5c0fa5){return _0x5c0fa5[_0x459f('0x24')](_0x568a1d)['then'](function(_0x4c8ccf){return _0x4c8ccf;});}return null;};}function removeEntity(_0x9ca105,_0x21f4cb){return function(_0x371ecf){if(_0x371ecf){return _0x371ecf[_0x459f('0x25')]()[_0x459f('0x26')](function(){_0x9ca105['status'](0xcc)[_0x459f('0x1a')]();});}};}function handleEntityNotFound(_0x16c8aa,_0x4057b3){return function(_0x594375){if(!_0x594375){_0x16c8aa['sendStatus'](0x194);}return _0x594375;};}function handleError(_0x58c6be,_0xd5e27a){_0xd5e27a=_0xd5e27a||0x1f4;return function(_0x2a62a5){logger[_0x459f('0x27')](_0x2a62a5[_0x459f('0x28')]);if(_0x2a62a5[_0x459f('0x29')]){delete _0x2a62a5[_0x459f('0x29')];}_0x58c6be[_0x459f('0x1b')](_0xd5e27a)['send'](_0x2a62a5);};}exports[_0x459f('0x2a')]=function(_0x483c4d,_0xf83b24){var _0x2082c8={},_0x5e14d4={},_0x165a10={'count':0x0,'rows':[]};var _0xacd92a=_['map'](db[_0x459f('0x2b')][_0x459f('0x2c')],function(_0x385f8b){return{'name':_0x385f8b[_0x459f('0x2d')],'type':_0x385f8b[_0x459f('0x2e')][_0x459f('0x2f')]};});_0x5e14d4[_0x459f('0x30')]=_[_0x459f('0x31')](_0xacd92a,_0x459f('0x29'));_0x5e14d4[_0x459f('0x32')]=_[_0x459f('0x33')](_0x483c4d[_0x459f('0x32')]);_0x5e14d4[_0x459f('0x34')]=_[_0x459f('0x35')](_0x5e14d4[_0x459f('0x30')],_0x5e14d4[_0x459f('0x32')]);_0x2082c8[_0x459f('0x36')]=_['intersection'](_0x5e14d4['model'],qs[_0x459f('0x37')](_0x483c4d['query'][_0x459f('0x37')]));_0x2082c8[_0x459f('0x36')]=_0x2082c8['attributes'][_0x459f('0x38')]?_0x2082c8[_0x459f('0x36')]:_0x5e14d4['model'];if(!_0x483c4d['query'][_0x459f('0x39')](_0x459f('0x3a'))){_0x2082c8['limit']=qs[_0x459f('0x1f')](_0x483c4d['query'][_0x459f('0x1f')]);_0x2082c8[_0x459f('0x1d')]=qs[_0x459f('0x1d')](_0x483c4d[_0x459f('0x32')][_0x459f('0x1d')]);}_0x2082c8['order']=qs[_0x459f('0x3b')](_0x483c4d[_0x459f('0x32')][_0x459f('0x3b')]);_0x2082c8[_0x459f('0x3c')]=qs[_0x459f('0x34')](_[_0x459f('0x3d')](_0x483c4d['query'],_0x5e14d4['filters']),_0xacd92a);if(_0x483c4d[_0x459f('0x32')][_0x459f('0x3e')]){_0x2082c8[_0x459f('0x3c')]=_[_0x459f('0x3f')](_0x2082c8[_0x459f('0x3c')],{'$or':_['map'](_0xacd92a,function(_0x28fa2f){if(_0x28fa2f['type']!==_0x459f('0x40')){var _0x936fb3={};_0x936fb3[_0x28fa2f['name']]={'$like':'%'+_0x483c4d[_0x459f('0x32')][_0x459f('0x3e')]+'%'};return _0x936fb3;}})});}_0x2082c8=_[_0x459f('0x3f')]({},_0x2082c8,_0x483c4d[_0x459f('0x41')]);var _0x31410a={'where':_0x2082c8[_0x459f('0x3c')]};return db[_0x459f('0x2b')][_0x459f('0x20')](_0x31410a)['then'](function(_0x161c1a){_0x165a10[_0x459f('0x20')]=_0x161c1a;if(_0x483c4d[_0x459f('0x32')][_0x459f('0x42')]){_0x2082c8[_0x459f('0x43')]=[{'all':!![]}];}return db['DeskAccount'][_0x459f('0x44')](_0x2082c8);})['then'](function(_0xffd6c9){_0x165a10[_0x459f('0x45')]=_0xffd6c9;return _0x165a10;})['then'](respondWithFilteredResult(_0xf83b24,_0x2082c8))[_0x459f('0x46')](handleError(_0xf83b24,null));};exports[_0x459f('0x47')]=function(_0xcca265,_0x2d1001){var _0x12e20c={'raw':![],'where':{'id':_0xcca265[_0x459f('0x48')]['id']}},_0x3fb35a={};_0x3fb35a[_0x459f('0x30')]=_[_0x459f('0x33')](db[_0x459f('0x2b')][_0x459f('0x2c')]);_0x3fb35a[_0x459f('0x32')]=_['keys'](_0xcca265[_0x459f('0x32')]);_0x3fb35a[_0x459f('0x34')]=_[_0x459f('0x35')](_0x3fb35a[_0x459f('0x30')],_0x3fb35a['query']);_0x12e20c[_0x459f('0x36')]=_[_0x459f('0x35')](_0x3fb35a[_0x459f('0x30')],qs['fields'](_0xcca265['query'][_0x459f('0x37')]));_0x12e20c['attributes']=_0x12e20c[_0x459f('0x36')]['length']?_0x12e20c[_0x459f('0x36')]:_0x3fb35a[_0x459f('0x30')];if(_0xcca265[_0x459f('0x32')][_0x459f('0x42')]){_0x12e20c[_0x459f('0x43')]=[{'all':!![]}];}_0x12e20c=_[_0x459f('0x3f')]({},_0x12e20c,_0xcca265[_0x459f('0x41')]);return db['DeskAccount'][_0x459f('0x49')](_0x12e20c)['then'](handleEntityNotFound(_0x2d1001,null))[_0x459f('0x26')](respondWithResult(_0x2d1001,null))[_0x459f('0x46')](handleError(_0x2d1001,null));};exports[_0x459f('0x4a')]=function(_0x11533a,_0x24d4b6){return db[_0x459f('0x2b')][_0x459f('0x4a')](_0x11533a['body'],{})[_0x459f('0x26')](respondWithResult(_0x24d4b6,0xc9))[_0x459f('0x46')](handleError(_0x24d4b6,null));};exports[_0x459f('0x24')]=function(_0x282413,_0x2d6bbc){if(_0x282413['body']['id']){delete _0x282413[_0x459f('0x4b')]['id'];}return db['DeskAccount'][_0x459f('0x49')]({'where':{'id':_0x282413[_0x459f('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d6bbc,null))[_0x459f('0x26')](saveUpdates(_0x282413[_0x459f('0x4b')],null))['then'](respondWithResult(_0x2d6bbc,null))[_0x459f('0x46')](handleError(_0x2d6bbc,null));};exports['destroy']=function(_0x17b2f6,_0x5eaf7b){return db[_0x459f('0x2b')]['find']({'where':{'id':_0x17b2f6[_0x459f('0x48')]['id']}})['then'](handleEntityNotFound(_0x5eaf7b,null))[_0x459f('0x26')](removeEntity(_0x5eaf7b,null))[_0x459f('0x46')](handleError(_0x5eaf7b,null));};exports[_0x459f('0x4c')]=function(_0x477e65,_0x5beae6,_0x1a7146){var _0x45c499={};var _0x58132b={};var _0x1a6f05;var _0x2ba517;return db[_0x459f('0x2b')][_0x459f('0x4d')]({'where':{'id':_0x477e65['params']['id']}})[_0x459f('0x26')](handleEntityNotFound(_0x5beae6,null))[_0x459f('0x26')](function(_0x5ad6fa){if(_0x5ad6fa){_0x1a6f05=_0x5ad6fa;_0x58132b[_0x459f('0x30')]=_[_0x459f('0x33')](db[_0x459f('0x4e')]['rawAttributes']);_0x58132b[_0x459f('0x32')]=_[_0x459f('0x33')](_0x477e65['query']);_0x58132b['filters']=_[_0x459f('0x35')](_0x58132b['model'],_0x58132b['query']);_0x45c499[_0x459f('0x36')]=_[_0x459f('0x35')](_0x58132b[_0x459f('0x30')],qs[_0x459f('0x37')](_0x477e65[_0x459f('0x32')][_0x459f('0x37')]));_0x45c499[_0x459f('0x36')]=_0x45c499[_0x459f('0x36')][_0x459f('0x38')]?_0x45c499[_0x459f('0x36')]:_0x58132b['model'];_0x45c499[_0x459f('0x4f')]=qs[_0x459f('0x3b')](_0x477e65[_0x459f('0x32')]['sort']);_0x45c499[_0x459f('0x3c')]=qs[_0x459f('0x34')](_[_0x459f('0x3d')](_0x477e65['query'],_0x58132b[_0x459f('0x34')]));if(_0x477e65[_0x459f('0x32')][_0x459f('0x3e')]){_0x45c499[_0x459f('0x3c')]=_[_0x459f('0x3f')](_0x45c499[_0x459f('0x3c')],{'$or':_['map'](_0x45c499[_0x459f('0x36')],function(_0x225aed){var _0x319621={};_0x319621[_0x225aed]={'$like':'%'+_0x477e65[_0x459f('0x32')][_0x459f('0x3e')]+'%'};return _0x319621;})});}_0x45c499=_[_0x459f('0x3f')]({},_0x45c499,_0x477e65['options']);return _0x1a6f05['getConfigurations'](_0x45c499);}})['then'](function(_0x2eb752){if(_0x2eb752){_0x2ba517=_0x2eb752['length'];if(!_0x477e65[_0x459f('0x32')][_0x459f('0x39')]('nolimit')){_0x45c499[_0x459f('0x1f')]=qs['limit'](_0x477e65['query'][_0x459f('0x1f')]);_0x45c499[_0x459f('0x1d')]=qs[_0x459f('0x1d')](_0x477e65['query'][_0x459f('0x1d')]);}return _0x1a6f05[_0x459f('0x4c')](_0x45c499);}})[_0x459f('0x26')](function(_0x3cecac){if(_0x3cecac){return _0x3cecac?{'count':_0x2ba517,'rows':_0x3cecac}:null;}})[_0x459f('0x26')](respondWithResult(_0x5beae6,null))[_0x459f('0x46')](handleError(_0x5beae6,null));};exports[_0x459f('0x50')]=function(_0x386c1e,_0x272f66,_0x571239){if(_0x386c1e[_0x459f('0x4b')]['id']){delete _0x386c1e[_0x459f('0x4b')]['id'];}return db[_0x459f('0x2b')]['findOne']({'where':{'id':_0x386c1e[_0x459f('0x48')]['id']}})[_0x459f('0x26')](handleEntityNotFound(_0x272f66,null))[_0x459f('0x26')](function(_0x52741f){if(_0x52741f){_0x386c1e['body'][_0x459f('0x51')]=_0x52741f['id'];_0x386c1e[_0x459f('0x4b')][_0x459f('0x52')]=integrations['getSubjects'](_0x386c1e[_0x459f('0x4b')][_0x459f('0x53')],_0x386c1e['body'][_0x459f('0x2e')]);_0x386c1e[_0x459f('0x4b')]['Descriptions']=integrations[_0x459f('0x54')](_0x386c1e[_0x459f('0x4b')]['channel'],_0x386c1e[_0x459f('0x4b')][_0x459f('0x2e')]);return db[_0x459f('0x4e')][_0x459f('0x4a')](_0x386c1e['body'],{'include':[{'model':db[_0x459f('0x55')],'as':_0x459f('0x52')},{'model':db['DeskField'],'as':_0x459f('0x56')}]});}return null;})[_0x459f('0x26')](respondWithResult(_0x272f66,null))[_0x459f('0x46')](handleError(_0x272f66,null));};exports['getFields']=function(_0x47e6bf,_0x921d9d,_0x16ee6e){var _0x159f3b=[{'name':_0x459f('0x57'),'label':_0x459f('0x57'),'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 _0x5a5229='';return db[_0x459f('0x2b')]['findOne']({'where':{'id':_0x47e6bf[_0x459f('0x48')]['id']},'attributes':['id','remoteUri',_0x459f('0x58'),_0x459f('0x59'),_0x459f('0x5a'),_0x459f('0x5b'),'consumerSecret',_0x459f('0x5c'),_0x459f('0x5d')]})[_0x459f('0x26')](handleEntityNotFound(_0x921d9d,null))[_0x459f('0x26')](function(_0x171f2b){if(_0x171f2b){_0x5a5229=_0x171f2b[_0x459f('0x5e')];var _0x1fe156=_0x5a5229[_0x459f('0x5f')](-0x1);if(_0x1fe156==='/'){_0x5a5229=_0x5a5229['substring'](0x0,_0x5a5229['lastIndexOf'](_0x1fe156));}var _0x5d9595={'method':_0x459f('0x60'),'uri':util[_0x459f('0x61')](_0x459f('0x62'),_0x5a5229),'headers':{'Content-Type':_0x459f('0x63'),'Accept':_0x459f('0x63')},'json':!![]};if(_0x171f2b[_0x459f('0x58')]===_0x459f('0x64')){_0x5d9595[_0x459f('0x65')][_0x459f('0x66')]=util[_0x459f('0x61')](_0x459f('0x67'),new Buffer(util[_0x459f('0x61')](_0x459f('0x68'),_0x171f2b[_0x459f('0x59')],_0x171f2b[_0x459f('0x5a')]))[_0x459f('0x69')]('base64'));}return rp(_0x5d9595)['then'](function(_0x17801f){return _0x159f3b[_0x459f('0x6a')](_[_0x459f('0x31')](_0x17801f[_0x459f('0x6b')]['entries'],function(_0xfd07e0){return{'id':_0xfd07e0[_0x459f('0x29')],'name':_0xfd07e0[_0x459f('0x29')],'type':_0xfd07e0[_0x459f('0x2e')],'active':_0xfd07e0[_0x459f('0x6c')],'label':_0xfd07e0['label'],'custom':!![]};}));});}})[_0x459f('0x26')](function(_0x1f8c8b){return{'count':_0x1f8c8b[_0x459f('0x38')],'rows':_0x1f8c8b};})[_0x459f('0x26')](respondWithResult(_0x921d9d,null))[_0x459f('0x46')](function(_0x2078dd){var _0x12a961=_0x47e6bf[_0x459f('0x32')][_0x459f('0x6d')]?0x1f4:_0x2078dd[_0x459f('0x6e')]||0x1f4;logger[_0x459f('0x27')](_0x459f('0x6f'),_0x459f('0x70'),_0x12a961,JSON[_0x459f('0x71')](_0x2078dd));delete _0x2078dd[_0x459f('0x29')];if(_0x12a961===0x191){_0x12a961=0x190;}_0x921d9d[_0x459f('0x1b')](_0x12a961)[_0x459f('0x72')](_0x47e6bf[_0x459f('0x32')][_0x459f('0x6d')]?{'message':_0x459f('0x73'),'statusCode':_0x2078dd[_0x459f('0x6e')]}:_0x2078dd);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 4d9c284..cab1fa9 100644 --- a/server/api/intDeskAccount/intDeskAccount.model.js +++ b/server/api/intDeskAccount/intDeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7027=['bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','util','../../config/logger','api'];(function(_0x368f47,_0x5ed298){var _0x4cbfc7=function(_0x4a3085){while(--_0x4a3085){_0x368f47['push'](_0x368f47['shift']());}};_0x4cbfc7(++_0x5ed298);}(_0x7027,0x126));var _0x7702=function(_0x446e22,_0x1ed2f4){_0x446e22=_0x446e22-0x0;var _0x411bda=_0x7027[_0x446e22];return _0x411bda;};'use strict';var _=require('lodash');var util=require(_0x7702('0x0'));var logger=require(_0x7702('0x1'))(_0x7702('0x2'));var moment=require('moment');var BPromise=require(_0x7702('0x3'));var rp=require(_0x7702('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7702('0x5'));var config=require(_0x7702('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x7702('0x7'));module['exports']=function(_0x5123e6,_0x39cbd8){return _0x5123e6[_0x7702('0x8')](_0x7702('0x9'),attributes,{'tableName':_0x7702('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa244=['moment','bluebird','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','api'];(function(_0x573347,_0x5d0032){var _0x1324ef=function(_0x13e331){while(--_0x13e331){_0x573347['push'](_0x573347['shift']());}};_0x1324ef(++_0x5d0032);}(_0xa244,0xa5));var _0x4a24=function(_0xd07e92,_0x595161){_0xd07e92=_0xd07e92-0x0;var _0x20f541=_0xa244[_0xd07e92];return _0x20f541;};'use strict';var _=require(_0x4a24('0x0'));var util=require(_0x4a24('0x1'));var logger=require(_0x4a24('0x2'))(_0x4a24('0x3'));var moment=require(_0x4a24('0x4'));var BPromise=require(_0x4a24('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a24('0x6'));var rimraf=require(_0x4a24('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a24('0x8'));var integrations=require(_0x4a24('0x9'));module[_0x4a24('0xa')]=function(_0x387b08,_0x31a5f2){return _0x387b08[_0x4a24('0xb')](_0x4a24('0xc'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 863be24..905e52f 100644 --- a/server/api/intDeskAccount/intDeskAccount.rpc.js +++ b/server/api/intDeskAccount/intDeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b61=['DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetDeskAccount','DeskAccount','options','attributes','limit','include','map','model','catch','ShowDeskAccount','find','raw','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x50f0a9,_0x2b0c57){var _0x5a33d9=function(_0x40338e){while(--_0x40338e){_0x50f0a9['push'](_0x50f0a9['shift']());}};_0x5a33d9(++_0x2b0c57);}(_0x4b61,0x156));var _0x14b6=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0x4b61[_0x45c262];return _0x4f2ba6;};'use strict';var _=require(_0x14b6('0x0'));var util=require(_0x14b6('0x1'));var moment=require(_0x14b6('0x2'));var BPromise=require(_0x14b6('0x3'));var rs=require(_0x14b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14b6('0x5'))['db'];var utils=require(_0x14b6('0x6'));var logger=require(_0x14b6('0x7'))(_0x14b6('0x8'));var config=require(_0x14b6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x14b6('0xa')][_0x14b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x154576,_0x28d077,_0x2dcd4c){return new BPromise(function(_0x193920,_0x4055c0){return client[_0x14b6('0xc')](_0x154576,_0x2dcd4c)[_0x14b6('0xd')](function(_0x468471){logger[_0x14b6('0xe')](_0x14b6('0xf'),_0x28d077,_0x14b6('0x10'));logger[_0x14b6('0x11')](_0x14b6('0x12'),_0x28d077,_0x14b6('0x10'),JSON[_0x14b6('0x13')](_0x468471));if(_0x468471[_0x14b6('0x14')]){if(_0x468471[_0x14b6('0x14')]['code']===0x1f4){logger[_0x14b6('0x14')]('DeskAccount,\x20%s,\x20%s',_0x28d077,_0x468471[_0x14b6('0x14')][_0x14b6('0x15')]);return _0x4055c0(_0x468471[_0x14b6('0x14')][_0x14b6('0x15')]);}logger[_0x14b6('0x14')](_0x14b6('0xf'),_0x28d077,_0x468471[_0x14b6('0x14')][_0x14b6('0x15')]);return _0x193920(_0x468471[_0x14b6('0x14')]['message']);}else{logger[_0x14b6('0xe')]('DeskAccount,\x20%s,\x20%s',_0x28d077,_0x14b6('0x10'));_0x193920(_0x468471[_0x14b6('0x16')][_0x14b6('0x15')]);}})['catch'](function(_0x3b1812){logger[_0x14b6('0x14')](_0x14b6('0xf'),_0x28d077,_0x3b1812);_0x4055c0(_0x3b1812);});});}exports[_0x14b6('0x17')]=function(_0x988092){var _0xffccd0=this;return new Promise(function(_0x4c0e03,_0x5dca64){return db[_0x14b6('0x18')]['findAll']({'raw':_0x988092[_0x14b6('0x19')]?_0x988092[_0x14b6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x988092[_0x14b6('0x19')]?_0x988092[_0x14b6('0x19')]['where']||null:null,'attributes':_0x988092[_0x14b6('0x19')]?_0x988092[_0x14b6('0x19')][_0x14b6('0x1a')]||null:null,'limit':_0x988092[_0x14b6('0x19')]?_0x988092[_0x14b6('0x19')][_0x14b6('0x1b')]||null:null,'include':_0x988092[_0x14b6('0x19')]?_0x988092[_0x14b6('0x19')][_0x14b6('0x1c')]?_[_0x14b6('0x1d')](_0x988092[_0x14b6('0x19')]['include'],function(_0x1966ea){return{'model':db[_0x1966ea[_0x14b6('0x1e')]],'as':_0x1966ea['as'],'attributes':_0x1966ea[_0x14b6('0x1a')],'include':_0x1966ea[_0x14b6('0x1c')]?_[_0x14b6('0x1d')](_0x1966ea['include'],function(_0x58e509){return{'model':db[_0x58e509['model']],'as':_0x58e509['as'],'attributes':_0x58e509['attributes'],'include':_0x58e509[_0x14b6('0x1c')]?_[_0x14b6('0x1d')](_0x58e509[_0x14b6('0x1c')],function(_0x2073f8){return{'model':db[_0x2073f8['model']],'as':_0x2073f8['as'],'attributes':_0x2073f8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b5a46){logger[_0x14b6('0xe')](_0x14b6('0x17'),_0x988092);logger[_0x14b6('0x11')]('GetDeskAccount',_0x988092,JSON[_0x14b6('0x13')](_0x4b5a46));_0x4c0e03(_0x4b5a46);})[_0x14b6('0x1f')](function(_0x215fae){logger[_0x14b6('0x14')]('GetDeskAccount',_0x215fae[_0x14b6('0x15')],_0x988092);_0x5dca64(_0xffccd0[_0x14b6('0x14')](0x1f4,_0x215fae[_0x14b6('0x15')]));});});};exports[_0x14b6('0x20')]=function(_0x4223d4){var _0x14fc59=this;return new Promise(function(_0xb25ee3,_0x2e34d7){return db[_0x14b6('0x18')][_0x14b6('0x21')]({'raw':_0x4223d4[_0x14b6('0x19')]?_0x4223d4['options'][_0x14b6('0x22')]===undefined?!![]:![]:!![],'where':_0x4223d4[_0x14b6('0x19')]?_0x4223d4[_0x14b6('0x19')][_0x14b6('0x23')]||null:null,'attributes':_0x4223d4['options']?_0x4223d4[_0x14b6('0x19')][_0x14b6('0x1a')]||null:null,'include':_0x4223d4[_0x14b6('0x19')]?_0x4223d4[_0x14b6('0x19')][_0x14b6('0x1c')]?_['map'](_0x4223d4[_0x14b6('0x19')][_0x14b6('0x1c')],function(_0x1916df){return{'model':db[_0x1916df['model']],'as':_0x1916df['as'],'attributes':_0x1916df[_0x14b6('0x1a')],'include':_0x1916df[_0x14b6('0x1c')]?_['map'](_0x1916df['include'],function(_0x9590a1){return{'model':db[_0x9590a1[_0x14b6('0x1e')]],'as':_0x9590a1['as'],'attributes':_0x9590a1[_0x14b6('0x1a')],'include':_0x9590a1['include']?_[_0x14b6('0x1d')](_0x9590a1[_0x14b6('0x1c')],function(_0x4d0474){return{'model':db[_0x4d0474[_0x14b6('0x1e')]],'as':_0x4d0474['as'],'attributes':_0x4d0474[_0x14b6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x14b6('0xd')](function(_0x79cd0b){logger[_0x14b6('0xe')](_0x14b6('0x20'),_0x4223d4);logger[_0x14b6('0x11')](_0x14b6('0x20'),_0x4223d4,JSON[_0x14b6('0x13')](_0x79cd0b));_0xb25ee3(_0x79cd0b);})[_0x14b6('0x1f')](function(_0x134068){logger[_0x14b6('0x14')](_0x14b6('0x20'),_0x134068[_0x14b6('0x15')],_0x4223d4);_0x2e34d7(_0x14fc59[_0x14b6('0x14')](0x1f4,_0x134068[_0x14b6('0x15')]));});});}; \ No newline at end of file +var _0x844b=['request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetDeskAccount','options','raw','where','attributes','limit','include','map','model','info','stringify','DeskAccount','find','ShowDeskAccount','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','client','request','then','DeskAccount,\x20%s,\x20%s'];(function(_0x228d7c,_0xf01e7d){var _0x1ffa97=function(_0x5418dd){while(--_0x5418dd){_0x228d7c['push'](_0x228d7c['shift']());}};_0x1ffa97(++_0xf01e7d);}(_0x844b,0x135));var _0xb844=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x844b[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xb844('0x0'));var util=require(_0xb844('0x1'));var moment=require(_0xb844('0x2'));var BPromise=require('bluebird');var rs=require(_0xb844('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb844('0x4'));var logger=require(_0xb844('0x5'))(_0xb844('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb844('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x152d3b,_0x2dd0a8,_0x262f0a){return new BPromise(function(_0x3c5e67,_0x14975b){return client[_0xb844('0x8')](_0x152d3b,_0x262f0a)[_0xb844('0x9')](function(_0x564fe9){logger['info'](_0xb844('0xa'),_0x2dd0a8,_0xb844('0xb'));logger[_0xb844('0xc')](_0xb844('0xd'),_0x2dd0a8,_0xb844('0xb'),JSON['stringify'](_0x564fe9));if(_0x564fe9[_0xb844('0xe')]){if(_0x564fe9[_0xb844('0xe')][_0xb844('0xf')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x2dd0a8,_0x564fe9['error'][_0xb844('0x10')]);return _0x14975b(_0x564fe9[_0xb844('0xe')][_0xb844('0x10')]);}logger[_0xb844('0xe')]('DeskAccount,\x20%s,\x20%s',_0x2dd0a8,_0x564fe9[_0xb844('0xe')][_0xb844('0x10')]);return _0x3c5e67(_0x564fe9['error'][_0xb844('0x10')]);}else{logger['info'](_0xb844('0xa'),_0x2dd0a8,_0xb844('0xb'));_0x3c5e67(_0x564fe9['result'][_0xb844('0x10')]);}})[_0xb844('0x11')](function(_0x5934ba){logger['error'](_0xb844('0xa'),_0x2dd0a8,_0x5934ba);_0x14975b(_0x5934ba);});});}exports[_0xb844('0x12')]=function(_0x5ed296){var _0x433ce4=this;return new Promise(function(_0x46cbd3,_0x3474c7){return db['DeskAccount']['findAll']({'raw':_0x5ed296[_0xb844('0x13')]?_0x5ed296[_0xb844('0x13')][_0xb844('0x14')]===undefined?!![]:![]:!![],'where':_0x5ed296[_0xb844('0x13')]?_0x5ed296[_0xb844('0x13')][_0xb844('0x15')]||null:null,'attributes':_0x5ed296['options']?_0x5ed296['options'][_0xb844('0x16')]||null:null,'limit':_0x5ed296[_0xb844('0x13')]?_0x5ed296['options'][_0xb844('0x17')]||null:null,'include':_0x5ed296[_0xb844('0x13')]?_0x5ed296['options'][_0xb844('0x18')]?_[_0xb844('0x19')](_0x5ed296[_0xb844('0x13')]['include'],function(_0x29513a){return{'model':db[_0x29513a['model']],'as':_0x29513a['as'],'attributes':_0x29513a['attributes'],'include':_0x29513a[_0xb844('0x18')]?_[_0xb844('0x19')](_0x29513a[_0xb844('0x18')],function(_0x83502d){return{'model':db[_0x83502d[_0xb844('0x1a')]],'as':_0x83502d['as'],'attributes':_0x83502d[_0xb844('0x16')],'include':_0x83502d[_0xb844('0x18')]?_['map'](_0x83502d[_0xb844('0x18')],function(_0x4d0ea6){return{'model':db[_0x4d0ea6[_0xb844('0x1a')]],'as':_0x4d0ea6['as'],'attributes':_0x4d0ea6[_0xb844('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bff58){logger[_0xb844('0x1b')](_0xb844('0x12'),_0x5ed296);logger[_0xb844('0xc')](_0xb844('0x12'),_0x5ed296,JSON[_0xb844('0x1c')](_0x2bff58));_0x46cbd3(_0x2bff58);})['catch'](function(_0x5a91f9){logger[_0xb844('0xe')](_0xb844('0x12'),_0x5a91f9[_0xb844('0x10')],_0x5ed296);_0x3474c7(_0x433ce4[_0xb844('0xe')](0x1f4,_0x5a91f9['message']));});});};exports['ShowDeskAccount']=function(_0x417b6c){var _0x3d44c5=this;return new Promise(function(_0x3de346,_0x85f71b){return db[_0xb844('0x1d')][_0xb844('0x1e')]({'raw':_0x417b6c[_0xb844('0x13')]?_0x417b6c[_0xb844('0x13')][_0xb844('0x14')]===undefined?!![]:![]:!![],'where':_0x417b6c[_0xb844('0x13')]?_0x417b6c[_0xb844('0x13')][_0xb844('0x15')]||null:null,'attributes':_0x417b6c['options']?_0x417b6c[_0xb844('0x13')][_0xb844('0x16')]||null:null,'include':_0x417b6c[_0xb844('0x13')]?_0x417b6c[_0xb844('0x13')][_0xb844('0x18')]?_[_0xb844('0x19')](_0x417b6c[_0xb844('0x13')][_0xb844('0x18')],function(_0x404de6){return{'model':db[_0x404de6['model']],'as':_0x404de6['as'],'attributes':_0x404de6['attributes'],'include':_0x404de6[_0xb844('0x18')]?_[_0xb844('0x19')](_0x404de6[_0xb844('0x18')],function(_0x472bde){return{'model':db[_0x472bde[_0xb844('0x1a')]],'as':_0x472bde['as'],'attributes':_0x472bde[_0xb844('0x16')],'include':_0x472bde[_0xb844('0x18')]?_['map'](_0x472bde[_0xb844('0x18')],function(_0x5d9bfa){return{'model':db[_0x5d9bfa[_0xb844('0x1a')]],'as':_0x5d9bfa['as'],'attributes':_0x5d9bfa['attributes']};}):[]};}):[]};}):[]:[]})[_0xb844('0x9')](function(_0x246cc5){logger[_0xb844('0x1b')](_0xb844('0x1f'),_0x417b6c);logger[_0xb844('0xc')](_0xb844('0x1f'),_0x417b6c,JSON[_0xb844('0x1c')](_0x246cc5));_0x3de346(_0x246cc5);})[_0xb844('0x11')](function(_0x271990){logger['error'](_0xb844('0x1f'),_0x271990['message'],_0x417b6c);_0x85f71b(_0x3d44c5['error'](0x1f4,_0x271990[_0xb844('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 745df5d..bbb9de7 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x1870a7,_0x5335bf){var _0x2c420e=function(_0x1a0d1c){while(--_0x1a0d1c){_0x1870a7['push'](_0x1870a7['shift']());}};_0x2c420e(++_0x5335bf);}(_0xedd9,0xfc));var _0x9edd=function(_0x4570a3,_0x4f8d6e){_0x4570a3=_0x4570a3-0x0;var _0x1ddbd3=_0xedd9[_0x4570a3];return _0x1ddbd3;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b47d8,_0x291aef){var _0x1a19b0=function(_0x592686){while(--_0x592686){_0x1b47d8['push'](_0x1b47d8['shift']());}};_0x1a19b0(++_0x291aef);}(_0x008c,0x188));var _0xc008=function(_0x2e030a,_0x8e4c48){_0x2e030a=_0x2e030a-0x0;var _0x597df6=_0x008c[_0x2e030a];return _0x597df6;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 924f076..a835dca 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa581=['exports','STRING'];(function(_0x15c196,_0x85fccc){var _0x1d3bee=function(_0x4a39d0){while(--_0x4a39d0){_0x15c196['push'](_0x15c196['shift']());}};_0x1d3bee(++_0x85fccc);}(_0xa581,0x126));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x1a58('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a58('0x1')]}}; \ No newline at end of file +var _0x6395=['exports','STRING','sequelize'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0x6395,0xe0));var _0x5639=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6395[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x5639('0x0'));module[_0x5639('0x1')]={'name':{'type':Sequelize[_0x5639('0x2')]},'description':{'type':Sequelize[_0x5639('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1ee103f..ead101a 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x915e=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','keys','catch','body','find','getFields','DeskField','getSubjects','findOne','getDescriptions','hasOwnProperty','getTags','Tag','ids','eml-format'];(function(_0x5bdf7a,_0x1383eb){var _0xed72=function(_0x3bda17){while(--_0x3bda17){_0x5bdf7a['push'](_0x5bdf7a['shift']());}};_0xed72(++_0x1383eb);}(_0x915e,0xa5));var _0xe915=function(_0x39af85,_0x35a3e3){_0x39af85=_0x39af85-0x0;var _0x1ecc63=_0x915e[_0x39af85];return _0x1ecc63;};'use strict';var emlformat=require(_0xe915('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe915('0x1'));var rp=require(_0xe915('0x2'));var moment=require(_0xe915('0x3'));var BPromise=require(_0xe915('0x4'));var Mustache=require(_0xe915('0x5'));var util=require(_0xe915('0x6'));var path=require('path');var sox=require(_0xe915('0x7'));var csv=require('to-csv');var ejs=require(_0xe915('0x8'));var fs=require('fs');var fs_extra=require(_0xe915('0x9'));var _=require(_0xe915('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe915('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe915('0xc'));var querystring=require(_0xe915('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe915('0xe'));var qs=require(_0xe915('0xf'));var as=require(_0xe915('0x10'));var hardwareService=require(_0xe915('0x11'));var logger=require(_0xe915('0x12'))(_0xe915('0x13'));var utils=require(_0xe915('0x14'));var config=require(_0xe915('0x15'));var licenseUtil=require(_0xe915('0x16'));var db=require(_0xe915('0x17'))['db'];function respondWithStatusCode(_0x3553bf,_0x2777b3){_0x2777b3=_0x2777b3||0xcc;return function(_0xf8dab){if(_0xf8dab){return _0x3553bf['sendStatus'](_0x2777b3);}return _0x3553bf['status'](_0x2777b3)[_0xe915('0x18')]();};}function respondWithResult(_0x3024a4,_0x23be07){_0x23be07=_0x23be07||0xc8;return function(_0x22f571){if(_0x22f571){return _0x3024a4[_0xe915('0x19')](_0x23be07)['json'](_0x22f571);}};}function respondWithFilteredResult(_0x6cda9e,_0x2480c3){return function(_0x6aeea8){if(_0x6aeea8){var _0x2a69b1=typeof _0x2480c3[_0xe915('0x1a')]===_0xe915('0x1b')&&typeof _0x2480c3[_0xe915('0x1c')]===_0xe915('0x1b');var _0x33de1e=_0x6aeea8[_0xe915('0x1d')];var _0xc62131=_0x2a69b1?0x0:_0x2480c3[_0xe915('0x1a')];var _0x55b678=_0x2a69b1?_0x6aeea8[_0xe915('0x1d')]:_0x2480c3[_0xe915('0x1a')]+_0x2480c3[_0xe915('0x1c')];var _0x43b86b;if(_0x55b678>=_0x33de1e){_0x55b678=_0x33de1e;_0x43b86b=0xc8;}else{_0x43b86b=0xce;}_0x6cda9e[_0xe915('0x19')](_0x43b86b);return _0x6cda9e[_0xe915('0x1e')](_0xe915('0x1f'),_0xc62131+'-'+_0x55b678+'/'+_0x33de1e)['json'](_0x6aeea8);}return null;};}function patchUpdates(_0x55373a){return function(_0x2997bf){try{jsonpatch[_0xe915('0x20')](_0x2997bf,_0x55373a,!![]);}catch(_0xad509f){return BPromise[_0xe915('0x21')](_0xad509f);}return _0x2997bf[_0xe915('0x22')]();};}function saveUpdates(_0x3755d0,_0x123028){return function(_0x3fb5c3){if(_0x3fb5c3){return _0x3fb5c3[_0xe915('0x23')](_0x3755d0)[_0xe915('0x24')](function(_0x256224){return _0x256224;});}return null;};}function removeEntity(_0x289405,_0x2779b0){return function(_0xee77f0){if(_0xee77f0){return _0xee77f0[_0xe915('0x25')]()[_0xe915('0x24')](function(){_0x289405['status'](0xcc)[_0xe915('0x18')]();});}};}function handleEntityNotFound(_0x374744,_0x3aab03){return function(_0x203c23){if(!_0x203c23){_0x374744[_0xe915('0x26')](0x194);}return _0x203c23;};}function handleError(_0x3e5cf4,_0xbf5cf4){_0xbf5cf4=_0xbf5cf4||0x1f4;return function(_0x215118){logger[_0xe915('0x27')](_0x215118[_0xe915('0x28')]);if(_0x215118[_0xe915('0x29')]){delete _0x215118[_0xe915('0x29')];}_0x3e5cf4[_0xe915('0x19')](_0xbf5cf4)[_0xe915('0x2a')](_0x215118);};}exports[_0xe915('0x2b')]=function(_0x320a4d,_0x555086){var _0x1d4477={},_0x14543b={},_0x28aa47={'count':0x0,'rows':[]};var _0x9550f4=_[_0xe915('0x2c')](db[_0xe915('0x2d')][_0xe915('0x2e')],function(_0xf6c396){return{'name':_0xf6c396[_0xe915('0x2f')],'type':_0xf6c396[_0xe915('0x30')][_0xe915('0x31')]};});_0x14543b[_0xe915('0x32')]=_['map'](_0x9550f4,_0xe915('0x29'));_0x14543b[_0xe915('0x33')]=_['keys'](_0x320a4d[_0xe915('0x33')]);_0x14543b[_0xe915('0x34')]=_[_0xe915('0x35')](_0x14543b[_0xe915('0x32')],_0x14543b['query']);_0x1d4477[_0xe915('0x36')]=_[_0xe915('0x35')](_0x14543b[_0xe915('0x32')],qs[_0xe915('0x37')](_0x320a4d[_0xe915('0x33')][_0xe915('0x37')]));_0x1d4477[_0xe915('0x36')]=_0x1d4477[_0xe915('0x36')][_0xe915('0x38')]?_0x1d4477[_0xe915('0x36')]:_0x14543b['model'];if(!_0x320a4d[_0xe915('0x33')]['hasOwnProperty'](_0xe915('0x39'))){_0x1d4477[_0xe915('0x1c')]=qs[_0xe915('0x1c')](_0x320a4d[_0xe915('0x33')][_0xe915('0x1c')]);_0x1d4477[_0xe915('0x1a')]=qs[_0xe915('0x1a')](_0x320a4d['query']['offset']);}_0x1d4477[_0xe915('0x3a')]=qs[_0xe915('0x3b')](_0x320a4d['query']['sort']);_0x1d4477[_0xe915('0x3c')]=qs[_0xe915('0x34')](_[_0xe915('0x3d')](_0x320a4d[_0xe915('0x33')],_0x14543b[_0xe915('0x34')]),_0x9550f4);if(_0x320a4d[_0xe915('0x33')][_0xe915('0x3e')]){_0x1d4477[_0xe915('0x3c')]=_[_0xe915('0x3f')](_0x1d4477[_0xe915('0x3c')],{'$or':_[_0xe915('0x2c')](_0x9550f4,function(_0xa74de0){if(_0xa74de0[_0xe915('0x30')]!=='VIRTUAL'){var _0x2ecc90={};_0x2ecc90[_0xa74de0['name']]={'$like':'%'+_0x320a4d[_0xe915('0x33')]['filter']+'%'};return _0x2ecc90;}})});}_0x1d4477=_[_0xe915('0x3f')]({},_0x1d4477,_0x320a4d[_0xe915('0x40')]);var _0x2515ab={'where':_0x1d4477['where']};return db[_0xe915('0x2d')][_0xe915('0x1d')](_0x2515ab)[_0xe915('0x24')](function(_0x434b85){_0x28aa47[_0xe915('0x1d')]=_0x434b85;if(_0x320a4d[_0xe915('0x33')][_0xe915('0x41')]){_0x1d4477[_0xe915('0x42')]=[{'all':!![]}];}return db[_0xe915('0x2d')][_0xe915('0x43')](_0x1d4477);})[_0xe915('0x24')](function(_0x26ab6d){_0x28aa47['rows']=_0x26ab6d;return _0x28aa47;})[_0xe915('0x24')](respondWithFilteredResult(_0x555086,_0x1d4477))['catch'](handleError(_0x555086,null));};exports[_0xe915('0x44')]=function(_0x243f94,_0x3ba44d){var _0x2df460={'raw':![],'where':{'id':_0x243f94[_0xe915('0x45')]['id']}},_0x53bf4a={};_0x53bf4a[_0xe915('0x32')]=_[_0xe915('0x46')](db[_0xe915('0x2d')]['rawAttributes']);_0x53bf4a[_0xe915('0x33')]=_[_0xe915('0x46')](_0x243f94[_0xe915('0x33')]);_0x53bf4a[_0xe915('0x34')]=_['intersection'](_0x53bf4a[_0xe915('0x32')],_0x53bf4a['query']);_0x2df460[_0xe915('0x36')]=_[_0xe915('0x35')](_0x53bf4a['model'],qs[_0xe915('0x37')](_0x243f94[_0xe915('0x33')]['fields']));_0x2df460[_0xe915('0x36')]=_0x2df460[_0xe915('0x36')][_0xe915('0x38')]?_0x2df460[_0xe915('0x36')]:_0x53bf4a['model'];if(_0x243f94[_0xe915('0x33')][_0xe915('0x41')]){_0x2df460[_0xe915('0x42')]=[{'all':!![]}];}_0x2df460=_[_0xe915('0x3f')]({},_0x2df460,_0x243f94[_0xe915('0x40')]);return db['DeskConfiguration']['find'](_0x2df460)['then'](handleEntityNotFound(_0x3ba44d,null))['then'](respondWithResult(_0x3ba44d,null))[_0xe915('0x47')](handleError(_0x3ba44d,null));};exports['create']=function(_0x31cb19,_0xc3db52){return db['DeskConfiguration']['create'](_0x31cb19[_0xe915('0x48')],{})[_0xe915('0x24')](respondWithResult(_0xc3db52,0xc9))[_0xe915('0x47')](handleError(_0xc3db52,null));};exports['update']=function(_0xbcbb3b,_0x3af2b4){if(_0xbcbb3b[_0xe915('0x48')]['id']){delete _0xbcbb3b[_0xe915('0x48')]['id'];}return db[_0xe915('0x2d')][_0xe915('0x49')]({'where':{'id':_0xbcbb3b[_0xe915('0x45')]['id']}})[_0xe915('0x24')](handleEntityNotFound(_0x3af2b4,null))[_0xe915('0x24')](saveUpdates(_0xbcbb3b[_0xe915('0x48')],null))[_0xe915('0x24')](respondWithResult(_0x3af2b4,null))[_0xe915('0x47')](handleError(_0x3af2b4,null));};exports[_0xe915('0x25')]=function(_0x3a5c93,_0x2333ef){return db[_0xe915('0x2d')]['find']({'where':{'id':_0x3a5c93[_0xe915('0x45')]['id']}})['then'](handleEntityNotFound(_0x2333ef,null))[_0xe915('0x24')](removeEntity(_0x2333ef,null))[_0xe915('0x47')](handleError(_0x2333ef,null));};exports[_0xe915('0x4a')]=function(_0x16cde7,_0x427fe5,_0x20dbcb){var _0x206443={};var _0x754386={};var _0x40dfd6;var _0x4124c9;return db[_0xe915('0x2d')]['findOne']({'where':{'id':_0x16cde7[_0xe915('0x45')]['id']}})['then'](handleEntityNotFound(_0x427fe5,null))[_0xe915('0x24')](function(_0x7de8c6){if(_0x7de8c6){_0x40dfd6=_0x7de8c6;_0x754386[_0xe915('0x32')]=_[_0xe915('0x46')](db[_0xe915('0x4b')][_0xe915('0x2e')]);_0x754386['query']=_[_0xe915('0x46')](_0x16cde7[_0xe915('0x33')]);_0x754386[_0xe915('0x34')]=_[_0xe915('0x35')](_0x754386[_0xe915('0x32')],_0x754386[_0xe915('0x33')]);_0x206443[_0xe915('0x36')]=_[_0xe915('0x35')](_0x754386[_0xe915('0x32')],qs[_0xe915('0x37')](_0x16cde7['query'][_0xe915('0x37')]));_0x206443[_0xe915('0x36')]=_0x206443[_0xe915('0x36')]['length']?_0x206443[_0xe915('0x36')]:_0x754386[_0xe915('0x32')];_0x206443[_0xe915('0x3a')]=qs[_0xe915('0x3b')](_0x16cde7[_0xe915('0x33')]['sort']);_0x206443[_0xe915('0x3c')]=qs[_0xe915('0x34')](_[_0xe915('0x3d')](_0x16cde7[_0xe915('0x33')],_0x754386[_0xe915('0x34')]));if(_0x16cde7[_0xe915('0x33')][_0xe915('0x3e')]){_0x206443[_0xe915('0x3c')]=_['merge'](_0x206443[_0xe915('0x3c')],{'$or':_[_0xe915('0x2c')](_0x206443[_0xe915('0x36')],function(_0x40ea5c){var _0x2a4d31={};_0x2a4d31[_0x40ea5c]={'$like':'%'+_0x16cde7['query'][_0xe915('0x3e')]+'%'};return _0x2a4d31;})});}_0x206443=_[_0xe915('0x3f')]({},_0x206443,_0x16cde7[_0xe915('0x40')]);return _0x40dfd6[_0xe915('0x4a')](_0x206443);}})[_0xe915('0x24')](function(_0x972672){if(_0x972672){_0x4124c9=_0x972672['length'];if(!_0x16cde7['query']['hasOwnProperty'](_0xe915('0x39'))){_0x206443['limit']=qs[_0xe915('0x1c')](_0x16cde7[_0xe915('0x33')][_0xe915('0x1c')]);_0x206443[_0xe915('0x1a')]=qs[_0xe915('0x1a')](_0x16cde7[_0xe915('0x33')]['offset']);}return _0x40dfd6[_0xe915('0x4a')](_0x206443);}})[_0xe915('0x24')](function(_0xda2847){if(_0xda2847){return _0xda2847?{'count':_0x4124c9,'rows':_0xda2847}:null;}})[_0xe915('0x24')](respondWithResult(_0x427fe5,null))[_0xe915('0x47')](handleError(_0x427fe5,null));};exports[_0xe915('0x4c')]=function(_0x16f489,_0x36923f,_0x30fea3){var _0x31dfe5={};var _0x5a4416={};var _0x4ee8e3;var _0x5a0530;return db['DeskConfiguration'][_0xe915('0x4d')]({'where':{'id':_0x16f489[_0xe915('0x45')]['id']}})['then'](handleEntityNotFound(_0x36923f,null))[_0xe915('0x24')](function(_0x4f7585){if(_0x4f7585){_0x4ee8e3=_0x4f7585;_0x5a4416[_0xe915('0x32')]=_['keys'](db['DeskField'][_0xe915('0x2e')]);_0x5a4416['query']=_[_0xe915('0x46')](_0x16f489[_0xe915('0x33')]);_0x5a4416[_0xe915('0x34')]=_[_0xe915('0x35')](_0x5a4416[_0xe915('0x32')],_0x5a4416[_0xe915('0x33')]);_0x31dfe5[_0xe915('0x36')]=_['intersection'](_0x5a4416['model'],qs[_0xe915('0x37')](_0x16f489[_0xe915('0x33')][_0xe915('0x37')]));_0x31dfe5[_0xe915('0x36')]=_0x31dfe5[_0xe915('0x36')]['length']?_0x31dfe5['attributes']:_0x5a4416[_0xe915('0x32')];_0x31dfe5[_0xe915('0x3a')]=qs[_0xe915('0x3b')](_0x16f489[_0xe915('0x33')][_0xe915('0x3b')]);_0x31dfe5[_0xe915('0x3c')]=qs[_0xe915('0x34')](_[_0xe915('0x3d')](_0x16f489[_0xe915('0x33')],_0x5a4416['filters']));if(_0x16f489[_0xe915('0x33')][_0xe915('0x3e')]){_0x31dfe5[_0xe915('0x3c')]=_['merge'](_0x31dfe5[_0xe915('0x3c')],{'$or':_[_0xe915('0x2c')](_0x31dfe5[_0xe915('0x36')],function(_0x3ad9a1){var _0x3d8581={};_0x3d8581[_0x3ad9a1]={'$like':'%'+_0x16f489['query'][_0xe915('0x3e')]+'%'};return _0x3d8581;})});}_0x31dfe5=_[_0xe915('0x3f')]({},_0x31dfe5,_0x16f489[_0xe915('0x40')]);return _0x4ee8e3[_0xe915('0x4c')](_0x31dfe5);}})[_0xe915('0x24')](function(_0x196075){if(_0x196075){_0x5a0530=_0x196075[_0xe915('0x38')];if(!_0x16f489[_0xe915('0x33')]['hasOwnProperty'](_0xe915('0x39'))){_0x31dfe5[_0xe915('0x1c')]=qs['limit'](_0x16f489[_0xe915('0x33')][_0xe915('0x1c')]);_0x31dfe5[_0xe915('0x1a')]=qs['offset'](_0x16f489['query'][_0xe915('0x1a')]);}return _0x4ee8e3[_0xe915('0x4c')](_0x31dfe5);}})['then'](function(_0x473de7){if(_0x473de7){return _0x473de7?{'count':_0x5a0530,'rows':_0x473de7}:null;}})['then'](respondWithResult(_0x36923f,null))[_0xe915('0x47')](handleError(_0x36923f,null));};exports[_0xe915('0x4e')]=function(_0x1a8d0,_0x310008,_0x34eb7a){var _0xfc75a5={};var _0x3488e5={};var _0x3af534;var _0x5e2bed;return db[_0xe915('0x2d')][_0xe915('0x4d')]({'where':{'id':_0x1a8d0[_0xe915('0x45')]['id']}})[_0xe915('0x24')](handleEntityNotFound(_0x310008,null))[_0xe915('0x24')](function(_0x1c49dc){if(_0x1c49dc){_0x3af534=_0x1c49dc;_0x3488e5[_0xe915('0x32')]=_[_0xe915('0x46')](db[_0xe915('0x4b')][_0xe915('0x2e')]);_0x3488e5[_0xe915('0x33')]=_[_0xe915('0x46')](_0x1a8d0[_0xe915('0x33')]);_0x3488e5[_0xe915('0x34')]=_[_0xe915('0x35')](_0x3488e5[_0xe915('0x32')],_0x3488e5['query']);_0xfc75a5[_0xe915('0x36')]=_[_0xe915('0x35')](_0x3488e5[_0xe915('0x32')],qs[_0xe915('0x37')](_0x1a8d0[_0xe915('0x33')]['fields']));_0xfc75a5[_0xe915('0x36')]=_0xfc75a5['attributes']['length']?_0xfc75a5[_0xe915('0x36')]:_0x3488e5['model'];_0xfc75a5[_0xe915('0x3a')]=qs[_0xe915('0x3b')](_0x1a8d0['query'][_0xe915('0x3b')]);_0xfc75a5[_0xe915('0x3c')]=qs[_0xe915('0x34')](_['pick'](_0x1a8d0[_0xe915('0x33')],_0x3488e5['filters']));if(_0x1a8d0[_0xe915('0x33')][_0xe915('0x3e')]){_0xfc75a5[_0xe915('0x3c')]=_['merge'](_0xfc75a5[_0xe915('0x3c')],{'$or':_[_0xe915('0x2c')](_0xfc75a5[_0xe915('0x36')],function(_0x3e83c9){var _0x1551e2={};_0x1551e2[_0x3e83c9]={'$like':'%'+_0x1a8d0[_0xe915('0x33')]['filter']+'%'};return _0x1551e2;})});}_0xfc75a5=_['merge']({},_0xfc75a5,_0x1a8d0['options']);return _0x3af534[_0xe915('0x4e')](_0xfc75a5);}})[_0xe915('0x24')](function(_0x39d54){if(_0x39d54){_0x5e2bed=_0x39d54[_0xe915('0x38')];if(!_0x1a8d0['query'][_0xe915('0x4f')](_0xe915('0x39'))){_0xfc75a5['limit']=qs[_0xe915('0x1c')](_0x1a8d0[_0xe915('0x33')]['limit']);_0xfc75a5[_0xe915('0x1a')]=qs[_0xe915('0x1a')](_0x1a8d0[_0xe915('0x33')][_0xe915('0x1a')]);}return _0x3af534[_0xe915('0x4e')](_0xfc75a5);}})[_0xe915('0x24')](function(_0x429486){if(_0x429486){return _0x429486?{'count':_0x5e2bed,'rows':_0x429486}:null;}})[_0xe915('0x24')](respondWithResult(_0x310008,null))[_0xe915('0x47')](handleError(_0x310008,null));};exports[_0xe915('0x50')]=function(_0x24496f,_0x1cdd7c,_0x543321){var _0x2cb350={};var _0x5baee3={};var _0xea2aef;var _0x2384a6;return db[_0xe915('0x2d')][_0xe915('0x4d')]({'where':{'id':_0x24496f[_0xe915('0x45')]['id']}})[_0xe915('0x24')](handleEntityNotFound(_0x1cdd7c,null))[_0xe915('0x24')](function(_0x3a5c2e){if(_0x3a5c2e){_0xea2aef=_0x3a5c2e;_0x5baee3[_0xe915('0x32')]=_['keys'](db[_0xe915('0x51')][_0xe915('0x2e')]);_0x5baee3[_0xe915('0x33')]=_['keys'](_0x24496f[_0xe915('0x33')]);_0x5baee3[_0xe915('0x34')]=_['intersection'](_0x5baee3[_0xe915('0x32')],_0x5baee3['query']);_0x2cb350[_0xe915('0x36')]=_[_0xe915('0x35')](_0x5baee3[_0xe915('0x32')],qs['fields'](_0x24496f[_0xe915('0x33')]['fields']));_0x2cb350[_0xe915('0x36')]=_0x2cb350[_0xe915('0x36')][_0xe915('0x38')]?_0x2cb350[_0xe915('0x36')]:_0x5baee3['model'];_0x2cb350[_0xe915('0x3a')]=qs[_0xe915('0x3b')](_0x24496f[_0xe915('0x33')][_0xe915('0x3b')]);_0x2cb350[_0xe915('0x3c')]=qs[_0xe915('0x34')](_['pick'](_0x24496f[_0xe915('0x33')],_0x5baee3['filters']));if(_0x24496f[_0xe915('0x33')][_0xe915('0x3e')]){_0x2cb350[_0xe915('0x3c')]=_[_0xe915('0x3f')](_0x2cb350['where'],{'$or':_['map'](_0x2cb350[_0xe915('0x36')],function(_0x10fb25){var _0x39fbfe={};_0x39fbfe[_0x10fb25]={'$like':'%'+_0x24496f['query'][_0xe915('0x3e')]+'%'};return _0x39fbfe;})});}_0x2cb350=_[_0xe915('0x3f')]({},_0x2cb350,_0x24496f['options']);return _0xea2aef[_0xe915('0x50')](_0x2cb350);}})[_0xe915('0x24')](function(_0x1f1161){if(_0x1f1161){_0x2384a6=_0x1f1161[_0xe915('0x38')];if(!_0x24496f[_0xe915('0x33')]['hasOwnProperty'](_0xe915('0x39'))){_0x2cb350[_0xe915('0x1c')]=qs['limit'](_0x24496f[_0xe915('0x33')][_0xe915('0x1c')]);_0x2cb350[_0xe915('0x1a')]=qs[_0xe915('0x1a')](_0x24496f[_0xe915('0x33')][_0xe915('0x1a')]);}return _0xea2aef[_0xe915('0x50')](_0x2cb350);}})[_0xe915('0x24')](function(_0xd12e90){if(_0xd12e90){return _0xd12e90?{'count':_0x2384a6,'rows':_0xd12e90}:null;}})[_0xe915('0x24')](respondWithResult(_0x1cdd7c,null))['catch'](handleError(_0x1cdd7c,null));};exports['setTags']=function(_0x4b44c4,_0x4415eb,_0x5323fa){if(_0x4b44c4[_0xe915('0x48')]['id']){delete _0x4b44c4[_0xe915('0x48')]['id'];}return db[_0xe915('0x2d')][_0xe915('0x4d')]({'where':{'id':_0x4b44c4[_0xe915('0x45')]['id']}})['then'](handleEntityNotFound(_0x4415eb,null))[_0xe915('0x24')](function(_0x2b8018){if(_0x2b8018){return _0x2b8018['setTags'](_0x4b44c4[_0xe915('0x48')][_0xe915('0x52')]||[]);}return null;})[_0xe915('0x24')](respondWithResult(_0x4415eb,null))[_0xe915('0x47')](handleError(_0x4415eb,null));}; \ No newline at end of file +var _0x2920=['count','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2920,0x120));var _0x0292=function(_0x49bcb5,_0x142793){_0x49bcb5=_0x49bcb5-0x0;var _0x290125=_0x2920[_0x49bcb5];return _0x290125;};'use strict';var emlformat=require(_0x0292('0x0'));var rimraf=require(_0x0292('0x1'));var zipdir=require(_0x0292('0x2'));var jsonpatch=require(_0x0292('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0292('0x4'));var Mustache=require(_0x0292('0x5'));var util=require(_0x0292('0x6'));var path=require(_0x0292('0x7'));var sox=require(_0x0292('0x8'));var csv=require(_0x0292('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0292('0xa'));var _=require(_0x0292('0xb'));var squel=require(_0x0292('0xc'));var crypto=require(_0x0292('0xd'));var jsforce=require(_0x0292('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0292('0x9'));var querystring=require('querystring');var Papa=require(_0x0292('0xf'));var Redis=require(_0x0292('0x10'));var authService=require(_0x0292('0x11'));var qs=require(_0x0292('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0292('0x13'));var utils=require(_0x0292('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0292('0x15'))['db'];function respondWithStatusCode(_0x28283f,_0x1058b7){_0x1058b7=_0x1058b7||0xcc;return function(_0xf579d7){if(_0xf579d7){return _0x28283f[_0x0292('0x16')](_0x1058b7);}return _0x28283f[_0x0292('0x17')](_0x1058b7)['end']();};}function respondWithResult(_0xa94cab,_0x3063c4){_0x3063c4=_0x3063c4||0xc8;return function(_0x530a71){if(_0x530a71){return _0xa94cab[_0x0292('0x17')](_0x3063c4)[_0x0292('0x18')](_0x530a71);}};}function respondWithFilteredResult(_0x3b6f16,_0x33c669){return function(_0x4ddff2){if(_0x4ddff2){var _0x1d459a=typeof _0x33c669[_0x0292('0x19')]===_0x0292('0x1a')&&typeof _0x33c669[_0x0292('0x1b')]===_0x0292('0x1a');var _0x47f6ef=_0x4ddff2['count'];var _0x5af540=_0x1d459a?0x0:_0x33c669[_0x0292('0x19')];var _0x26cc41=_0x1d459a?_0x4ddff2[_0x0292('0x1c')]:_0x33c669[_0x0292('0x19')]+_0x33c669[_0x0292('0x1b')];var _0x1b469a;if(_0x26cc41>=_0x47f6ef){_0x26cc41=_0x47f6ef;_0x1b469a=0xc8;}else{_0x1b469a=0xce;}_0x3b6f16[_0x0292('0x17')](_0x1b469a);return _0x3b6f16['set'](_0x0292('0x1d'),_0x5af540+'-'+_0x26cc41+'/'+_0x47f6ef)[_0x0292('0x18')](_0x4ddff2);}return null;};}function patchUpdates(_0x125533){return function(_0x59b35c){try{jsonpatch[_0x0292('0x1e')](_0x59b35c,_0x125533,!![]);}catch(_0x415a09){return BPromise[_0x0292('0x1f')](_0x415a09);}return _0x59b35c[_0x0292('0x20')]();};}function saveUpdates(_0x45bf62,_0xf1407a){return function(_0x591fd1){if(_0x591fd1){return _0x591fd1['update'](_0x45bf62)[_0x0292('0x21')](function(_0xacc9f2){return _0xacc9f2;});}return null;};}function removeEntity(_0x1130f6,_0x2b231d){return function(_0x13e1f1){if(_0x13e1f1){return _0x13e1f1[_0x0292('0x22')]()[_0x0292('0x21')](function(){_0x1130f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dbcd8,_0x440690){return function(_0x23c4c9){if(!_0x23c4c9){_0x1dbcd8[_0x0292('0x16')](0x194);}return _0x23c4c9;};}function handleError(_0x33b116,_0x1308ab){_0x1308ab=_0x1308ab||0x1f4;return function(_0x43b09e){logger['error'](_0x43b09e[_0x0292('0x23')]);if(_0x43b09e[_0x0292('0x24')]){delete _0x43b09e['name'];}_0x33b116[_0x0292('0x17')](_0x1308ab)['send'](_0x43b09e);};}exports[_0x0292('0x25')]=function(_0x55bec3,_0x589d9f){var _0x2cc657={},_0x2a2941={},_0x2ebea9={'count':0x0,'rows':[]};var _0x11b76e=_[_0x0292('0x26')](db[_0x0292('0x27')][_0x0292('0x28')],function(_0x390ba3){return{'name':_0x390ba3[_0x0292('0x29')],'type':_0x390ba3['type'][_0x0292('0x2a')]};});_0x2a2941[_0x0292('0x2b')]=_[_0x0292('0x26')](_0x11b76e,_0x0292('0x24'));_0x2a2941['query']=_[_0x0292('0x2c')](_0x55bec3[_0x0292('0x2d')]);_0x2a2941[_0x0292('0x2e')]=_[_0x0292('0x2f')](_0x2a2941[_0x0292('0x2b')],_0x2a2941[_0x0292('0x2d')]);_0x2cc657['attributes']=_[_0x0292('0x2f')](_0x2a2941[_0x0292('0x2b')],qs[_0x0292('0x30')](_0x55bec3['query'][_0x0292('0x30')]));_0x2cc657[_0x0292('0x31')]=_0x2cc657[_0x0292('0x31')][_0x0292('0x32')]?_0x2cc657[_0x0292('0x31')]:_0x2a2941['model'];if(!_0x55bec3[_0x0292('0x2d')][_0x0292('0x33')](_0x0292('0x34'))){_0x2cc657[_0x0292('0x1b')]=qs[_0x0292('0x1b')](_0x55bec3[_0x0292('0x2d')][_0x0292('0x1b')]);_0x2cc657[_0x0292('0x19')]=qs['offset'](_0x55bec3['query']['offset']);}_0x2cc657[_0x0292('0x35')]=qs[_0x0292('0x36')](_0x55bec3['query'][_0x0292('0x36')]);_0x2cc657[_0x0292('0x37')]=qs['filters'](_[_0x0292('0x38')](_0x55bec3[_0x0292('0x2d')],_0x2a2941['filters']),_0x11b76e);if(_0x55bec3[_0x0292('0x2d')][_0x0292('0x39')]){_0x2cc657[_0x0292('0x37')]=_[_0x0292('0x3a')](_0x2cc657[_0x0292('0x37')],{'$or':_['map'](_0x11b76e,function(_0x22b703){if(_0x22b703[_0x0292('0x3b')]!=='VIRTUAL'){var _0x1796e2={};_0x1796e2[_0x22b703[_0x0292('0x24')]]={'$like':'%'+_0x55bec3[_0x0292('0x2d')]['filter']+'%'};return _0x1796e2;}})});}_0x2cc657=_[_0x0292('0x3a')]({},_0x2cc657,_0x55bec3[_0x0292('0x3c')]);var _0x319a79={'where':_0x2cc657[_0x0292('0x37')]};return db[_0x0292('0x27')][_0x0292('0x1c')](_0x319a79)['then'](function(_0x4a1053){_0x2ebea9['count']=_0x4a1053;if(_0x55bec3['query'][_0x0292('0x3d')]){_0x2cc657[_0x0292('0x3e')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x0292('0x3f')](_0x2cc657);})[_0x0292('0x21')](function(_0x573eaa){_0x2ebea9[_0x0292('0x40')]=_0x573eaa;return _0x2ebea9;})[_0x0292('0x21')](respondWithFilteredResult(_0x589d9f,_0x2cc657))[_0x0292('0x41')](handleError(_0x589d9f,null));};exports['show']=function(_0x39fa89,_0x281721){var _0x91335c={'raw':![],'where':{'id':_0x39fa89[_0x0292('0x42')]['id']}},_0x421ad7={};_0x421ad7[_0x0292('0x2b')]=_[_0x0292('0x2c')](db['DeskConfiguration'][_0x0292('0x28')]);_0x421ad7[_0x0292('0x2d')]=_['keys'](_0x39fa89[_0x0292('0x2d')]);_0x421ad7['filters']=_[_0x0292('0x2f')](_0x421ad7[_0x0292('0x2b')],_0x421ad7[_0x0292('0x2d')]);_0x91335c['attributes']=_[_0x0292('0x2f')](_0x421ad7[_0x0292('0x2b')],qs[_0x0292('0x30')](_0x39fa89[_0x0292('0x2d')]['fields']));_0x91335c['attributes']=_0x91335c[_0x0292('0x31')][_0x0292('0x32')]?_0x91335c[_0x0292('0x31')]:_0x421ad7['model'];if(_0x39fa89[_0x0292('0x2d')][_0x0292('0x3d')]){_0x91335c[_0x0292('0x3e')]=[{'all':!![]}];}_0x91335c=_[_0x0292('0x3a')]({},_0x91335c,_0x39fa89['options']);return db[_0x0292('0x27')][_0x0292('0x43')](_0x91335c)[_0x0292('0x21')](handleEntityNotFound(_0x281721,null))[_0x0292('0x21')](respondWithResult(_0x281721,null))['catch'](handleError(_0x281721,null));};exports[_0x0292('0x44')]=function(_0x2db315,_0x3c64a8){return db[_0x0292('0x27')]['create'](_0x2db315[_0x0292('0x45')],{})[_0x0292('0x21')](respondWithResult(_0x3c64a8,0xc9))[_0x0292('0x41')](handleError(_0x3c64a8,null));};exports[_0x0292('0x46')]=function(_0x29b4b0,_0x25239f){if(_0x29b4b0[_0x0292('0x45')]['id']){delete _0x29b4b0[_0x0292('0x45')]['id'];}return db[_0x0292('0x27')][_0x0292('0x43')]({'where':{'id':_0x29b4b0['params']['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x25239f,null))[_0x0292('0x21')](saveUpdates(_0x29b4b0[_0x0292('0x45')],null))[_0x0292('0x21')](respondWithResult(_0x25239f,null))[_0x0292('0x41')](handleError(_0x25239f,null));};exports[_0x0292('0x22')]=function(_0x5c9b02,_0x1a6f15){return db[_0x0292('0x27')][_0x0292('0x43')]({'where':{'id':_0x5c9b02['params']['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x1a6f15,null))[_0x0292('0x21')](removeEntity(_0x1a6f15,null))['catch'](handleError(_0x1a6f15,null));};exports[_0x0292('0x47')]=function(_0x4f1547,_0x171ff3,_0x2f1065){var _0x1ea1b7={};var _0xeddde5={};var _0x13b698;var _0x140f17;return db[_0x0292('0x27')][_0x0292('0x48')]({'where':{'id':_0x4f1547[_0x0292('0x42')]['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x171ff3,null))[_0x0292('0x21')](function(_0x28a839){if(_0x28a839){_0x13b698=_0x28a839;_0xeddde5[_0x0292('0x2b')]=_['keys'](db[_0x0292('0x49')]['rawAttributes']);_0xeddde5[_0x0292('0x2d')]=_[_0x0292('0x2c')](_0x4f1547[_0x0292('0x2d')]);_0xeddde5[_0x0292('0x2e')]=_[_0x0292('0x2f')](_0xeddde5[_0x0292('0x2b')],_0xeddde5[_0x0292('0x2d')]);_0x1ea1b7[_0x0292('0x31')]=_[_0x0292('0x2f')](_0xeddde5['model'],qs[_0x0292('0x30')](_0x4f1547[_0x0292('0x2d')][_0x0292('0x30')]));_0x1ea1b7[_0x0292('0x31')]=_0x1ea1b7['attributes']['length']?_0x1ea1b7[_0x0292('0x31')]:_0xeddde5[_0x0292('0x2b')];_0x1ea1b7[_0x0292('0x35')]=qs[_0x0292('0x36')](_0x4f1547[_0x0292('0x2d')][_0x0292('0x36')]);_0x1ea1b7[_0x0292('0x37')]=qs[_0x0292('0x2e')](_[_0x0292('0x38')](_0x4f1547[_0x0292('0x2d')],_0xeddde5[_0x0292('0x2e')]));if(_0x4f1547[_0x0292('0x2d')][_0x0292('0x39')]){_0x1ea1b7[_0x0292('0x37')]=_[_0x0292('0x3a')](_0x1ea1b7[_0x0292('0x37')],{'$or':_[_0x0292('0x26')](_0x1ea1b7[_0x0292('0x31')],function(_0xdc7fb5){var _0x4375c8={};_0x4375c8[_0xdc7fb5]={'$like':'%'+_0x4f1547[_0x0292('0x2d')][_0x0292('0x39')]+'%'};return _0x4375c8;})});}_0x1ea1b7=_[_0x0292('0x3a')]({},_0x1ea1b7,_0x4f1547[_0x0292('0x3c')]);return _0x13b698[_0x0292('0x47')](_0x1ea1b7);}})[_0x0292('0x21')](function(_0x2a4cc6){if(_0x2a4cc6){_0x140f17=_0x2a4cc6[_0x0292('0x32')];if(!_0x4f1547[_0x0292('0x2d')][_0x0292('0x33')]('nolimit')){_0x1ea1b7[_0x0292('0x1b')]=qs[_0x0292('0x1b')](_0x4f1547[_0x0292('0x2d')][_0x0292('0x1b')]);_0x1ea1b7['offset']=qs[_0x0292('0x19')](_0x4f1547[_0x0292('0x2d')][_0x0292('0x19')]);}return _0x13b698[_0x0292('0x47')](_0x1ea1b7);}})[_0x0292('0x21')](function(_0x43ad50){if(_0x43ad50){return _0x43ad50?{'count':_0x140f17,'rows':_0x43ad50}:null;}})[_0x0292('0x21')](respondWithResult(_0x171ff3,null))[_0x0292('0x41')](handleError(_0x171ff3,null));};exports[_0x0292('0x4a')]=function(_0x428f3c,_0x2c4cc8,_0x296b06){var _0x3c6b0f={};var _0x1b9cd1={};var _0x29d731;var _0x3cf230;return db[_0x0292('0x27')][_0x0292('0x48')]({'where':{'id':_0x428f3c[_0x0292('0x42')]['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x2c4cc8,null))['then'](function(_0x101392){if(_0x101392){_0x29d731=_0x101392;_0x1b9cd1[_0x0292('0x2b')]=_['keys'](db[_0x0292('0x49')][_0x0292('0x28')]);_0x1b9cd1['query']=_[_0x0292('0x2c')](_0x428f3c[_0x0292('0x2d')]);_0x1b9cd1[_0x0292('0x2e')]=_[_0x0292('0x2f')](_0x1b9cd1[_0x0292('0x2b')],_0x1b9cd1[_0x0292('0x2d')]);_0x3c6b0f['attributes']=_[_0x0292('0x2f')](_0x1b9cd1['model'],qs['fields'](_0x428f3c[_0x0292('0x2d')][_0x0292('0x30')]));_0x3c6b0f[_0x0292('0x31')]=_0x3c6b0f[_0x0292('0x31')][_0x0292('0x32')]?_0x3c6b0f[_0x0292('0x31')]:_0x1b9cd1[_0x0292('0x2b')];_0x3c6b0f[_0x0292('0x35')]=qs[_0x0292('0x36')](_0x428f3c[_0x0292('0x2d')][_0x0292('0x36')]);_0x3c6b0f[_0x0292('0x37')]=qs['filters'](_[_0x0292('0x38')](_0x428f3c['query'],_0x1b9cd1['filters']));if(_0x428f3c['query'][_0x0292('0x39')]){_0x3c6b0f[_0x0292('0x37')]=_['merge'](_0x3c6b0f[_0x0292('0x37')],{'$or':_[_0x0292('0x26')](_0x3c6b0f[_0x0292('0x31')],function(_0xef0eed){var _0x3dbbee={};_0x3dbbee[_0xef0eed]={'$like':'%'+_0x428f3c['query']['filter']+'%'};return _0x3dbbee;})});}_0x3c6b0f=_[_0x0292('0x3a')]({},_0x3c6b0f,_0x428f3c[_0x0292('0x3c')]);return _0x29d731[_0x0292('0x4a')](_0x3c6b0f);}})['then'](function(_0x1b1190){if(_0x1b1190){_0x3cf230=_0x1b1190[_0x0292('0x32')];if(!_0x428f3c[_0x0292('0x2d')][_0x0292('0x33')](_0x0292('0x34'))){_0x3c6b0f['limit']=qs[_0x0292('0x1b')](_0x428f3c['query'][_0x0292('0x1b')]);_0x3c6b0f[_0x0292('0x19')]=qs['offset'](_0x428f3c[_0x0292('0x2d')][_0x0292('0x19')]);}return _0x29d731[_0x0292('0x4a')](_0x3c6b0f);}})[_0x0292('0x21')](function(_0x7e9698){if(_0x7e9698){return _0x7e9698?{'count':_0x3cf230,'rows':_0x7e9698}:null;}})[_0x0292('0x21')](respondWithResult(_0x2c4cc8,null))['catch'](handleError(_0x2c4cc8,null));};exports[_0x0292('0x4b')]=function(_0x2e973f,_0x4d8abb,_0x4ce638){var _0xd025da={};var _0x550e6c={};var _0x27df2b;var _0x9b6230;return db['DeskConfiguration'][_0x0292('0x48')]({'where':{'id':_0x2e973f[_0x0292('0x42')]['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x4d8abb,null))[_0x0292('0x21')](function(_0x47dc4c){if(_0x47dc4c){_0x27df2b=_0x47dc4c;_0x550e6c[_0x0292('0x2b')]=_[_0x0292('0x2c')](db[_0x0292('0x49')]['rawAttributes']);_0x550e6c[_0x0292('0x2d')]=_['keys'](_0x2e973f[_0x0292('0x2d')]);_0x550e6c[_0x0292('0x2e')]=_[_0x0292('0x2f')](_0x550e6c[_0x0292('0x2b')],_0x550e6c[_0x0292('0x2d')]);_0xd025da[_0x0292('0x31')]=_['intersection'](_0x550e6c[_0x0292('0x2b')],qs[_0x0292('0x30')](_0x2e973f[_0x0292('0x2d')][_0x0292('0x30')]));_0xd025da[_0x0292('0x31')]=_0xd025da[_0x0292('0x31')][_0x0292('0x32')]?_0xd025da['attributes']:_0x550e6c['model'];_0xd025da[_0x0292('0x35')]=qs[_0x0292('0x36')](_0x2e973f[_0x0292('0x2d')][_0x0292('0x36')]);_0xd025da['where']=qs['filters'](_['pick'](_0x2e973f[_0x0292('0x2d')],_0x550e6c[_0x0292('0x2e')]));if(_0x2e973f[_0x0292('0x2d')]['filter']){_0xd025da[_0x0292('0x37')]=_[_0x0292('0x3a')](_0xd025da[_0x0292('0x37')],{'$or':_[_0x0292('0x26')](_0xd025da[_0x0292('0x31')],function(_0x3fb630){var _0x35abd6={};_0x35abd6[_0x3fb630]={'$like':'%'+_0x2e973f['query'][_0x0292('0x39')]+'%'};return _0x35abd6;})});}_0xd025da=_[_0x0292('0x3a')]({},_0xd025da,_0x2e973f['options']);return _0x27df2b['getDescriptions'](_0xd025da);}})[_0x0292('0x21')](function(_0x3fb7b4){if(_0x3fb7b4){_0x9b6230=_0x3fb7b4[_0x0292('0x32')];if(!_0x2e973f[_0x0292('0x2d')][_0x0292('0x33')](_0x0292('0x34'))){_0xd025da[_0x0292('0x1b')]=qs[_0x0292('0x1b')](_0x2e973f['query'][_0x0292('0x1b')]);_0xd025da[_0x0292('0x19')]=qs[_0x0292('0x19')](_0x2e973f[_0x0292('0x2d')][_0x0292('0x19')]);}return _0x27df2b[_0x0292('0x4b')](_0xd025da);}})[_0x0292('0x21')](function(_0x4ae35c){if(_0x4ae35c){return _0x4ae35c?{'count':_0x9b6230,'rows':_0x4ae35c}:null;}})[_0x0292('0x21')](respondWithResult(_0x4d8abb,null))['catch'](handleError(_0x4d8abb,null));};exports['getTags']=function(_0x6a5227,_0x3036a5,_0x304de7){var _0x3374d4={};var _0x414537={};var _0x5a397c;var _0x3c66c8;return db[_0x0292('0x27')][_0x0292('0x48')]({'where':{'id':_0x6a5227[_0x0292('0x42')]['id']}})['then'](handleEntityNotFound(_0x3036a5,null))[_0x0292('0x21')](function(_0x267ebc){if(_0x267ebc){_0x5a397c=_0x267ebc;_0x414537['model']=_[_0x0292('0x2c')](db['Tag']['rawAttributes']);_0x414537['query']=_['keys'](_0x6a5227[_0x0292('0x2d')]);_0x414537[_0x0292('0x2e')]=_[_0x0292('0x2f')](_0x414537['model'],_0x414537['query']);_0x3374d4[_0x0292('0x31')]=_['intersection'](_0x414537['model'],qs[_0x0292('0x30')](_0x6a5227[_0x0292('0x2d')][_0x0292('0x30')]));_0x3374d4[_0x0292('0x31')]=_0x3374d4[_0x0292('0x31')][_0x0292('0x32')]?_0x3374d4[_0x0292('0x31')]:_0x414537[_0x0292('0x2b')];_0x3374d4[_0x0292('0x35')]=qs['sort'](_0x6a5227[_0x0292('0x2d')][_0x0292('0x36')]);_0x3374d4['where']=qs[_0x0292('0x2e')](_[_0x0292('0x38')](_0x6a5227[_0x0292('0x2d')],_0x414537[_0x0292('0x2e')]));if(_0x6a5227['query']['filter']){_0x3374d4[_0x0292('0x37')]=_[_0x0292('0x3a')](_0x3374d4[_0x0292('0x37')],{'$or':_['map'](_0x3374d4['attributes'],function(_0x2e1286){var _0xa9d999={};_0xa9d999[_0x2e1286]={'$like':'%'+_0x6a5227[_0x0292('0x2d')][_0x0292('0x39')]+'%'};return _0xa9d999;})});}_0x3374d4=_[_0x0292('0x3a')]({},_0x3374d4,_0x6a5227[_0x0292('0x3c')]);return _0x5a397c[_0x0292('0x4c')](_0x3374d4);}})[_0x0292('0x21')](function(_0x28868c){if(_0x28868c){_0x3c66c8=_0x28868c['length'];if(!_0x6a5227[_0x0292('0x2d')]['hasOwnProperty'](_0x0292('0x34'))){_0x3374d4[_0x0292('0x1b')]=qs['limit'](_0x6a5227['query'][_0x0292('0x1b')]);_0x3374d4[_0x0292('0x19')]=qs[_0x0292('0x19')](_0x6a5227[_0x0292('0x2d')][_0x0292('0x19')]);}return _0x5a397c[_0x0292('0x4c')](_0x3374d4);}})['then'](function(_0x4bb6a5){if(_0x4bb6a5){return _0x4bb6a5?{'count':_0x3c66c8,'rows':_0x4bb6a5}:null;}})[_0x0292('0x21')](respondWithResult(_0x3036a5,null))[_0x0292('0x41')](handleError(_0x3036a5,null));};exports['setTags']=function(_0x599676,_0x14553c,_0x5a2f1c){if(_0x599676[_0x0292('0x45')]['id']){delete _0x599676[_0x0292('0x45')]['id'];}return db['DeskConfiguration'][_0x0292('0x48')]({'where':{'id':_0x599676[_0x0292('0x42')]['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x14553c,null))['then'](function(_0x58ac5e){if(_0x58ac5e){return _0x58ac5e[_0x0292('0x4d')](_0x599676[_0x0292('0x45')][_0x0292('0x4e')]||[]);}return null;})[_0x0292('0x21')](respondWithResult(_0x14553c,null))[_0x0292('0x41')](handleError(_0x14553c,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 3c2e9cb..629c1f1 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf8d=['./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','rimraf'];(function(_0x3bed3f,_0x2bc543){var _0x45344b=function(_0x34e192){while(--_0x34e192){_0x3bed3f['push'](_0x3bed3f['shift']());}};_0x45344b(++_0x2bc543);}(_0xaf8d,0x125));var _0xdaf8=function(_0xb7248c,_0x167148){_0xb7248c=_0xb7248c-0x0;var _0x5b11dc=_0xaf8d[_0xb7248c];return _0x5b11dc;};'use strict';var _=require(_0xdaf8('0x0'));var util=require(_0xdaf8('0x1'));var logger=require(_0xdaf8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdaf8('0x3'));var config=require('../../config/environment');var attributes=require(_0xdaf8('0x4'));module[_0xdaf8('0x5')]=function(_0x58d813,_0x290043){return _0x58d813[_0xdaf8('0x6')](_0xdaf8('0x7'),attributes,{'tableName':_0xdaf8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad26=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad26,0x1b1));var _0x6ad2=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xad26[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x6ad2('0x0'));var util=require(_0x6ad2('0x1'));var logger=require(_0x6ad2('0x2'))(_0x6ad2('0x3'));var moment=require(_0x6ad2('0x4'));var BPromise=require('bluebird');var rp=require(_0x6ad2('0x5'));var fs=require('fs');var path=require(_0x6ad2('0x6'));var rimraf=require(_0x6ad2('0x7'));var config=require(_0x6ad2('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0x6ad2('0x9')]=function(_0x1d8635,_0x22fb2c){return _0x1d8635[_0x6ad2('0xa')](_0x6ad2('0xb'),attributes,{'tableName':_0x6ad2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index b50a7e0..bd49e48 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8f2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x3cec45,_0x37d817){var _0x51d691=function(_0x2c671f){while(--_0x2c671f){_0x3cec45['push'](_0x3cec45['shift']());}};_0x51d691(++_0x37d817);}(_0xf8f2,0xc2));var _0x2f8f=function(_0x1cacc3,_0x2195c6){_0x1cacc3=_0x1cacc3-0x0;var _0x2719cf=_0xf8f2[_0x1cacc3];return _0x2719cf;};'use strict';var _=require(_0x2f8f('0x0'));var util=require(_0x2f8f('0x1'));var moment=require(_0x2f8f('0x2'));var BPromise=require(_0x2f8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f8f('0x4'));var db=require(_0x2f8f('0x5'))['db'];var utils=require(_0x2f8f('0x6'));var logger=require(_0x2f8f('0x7'))(_0x2f8f('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f8f('0x9'));var client=jayson[_0x2f8f('0xa')][_0x2f8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x107748,_0x590ff4,_0xb4473){return new BPromise(function(_0x10d128,_0x1237d5){return client['request'](_0x107748,_0xb4473)[_0x2f8f('0xc')](function(_0x1ce821){logger[_0x2f8f('0xd')](_0x2f8f('0xe'),_0x590ff4,'request\x20sent');logger[_0x2f8f('0xf')](_0x2f8f('0x10'),_0x590ff4,'request\x20sent',JSON[_0x2f8f('0x11')](_0x1ce821));if(_0x1ce821[_0x2f8f('0x12')]){if(_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x13')]===0x1f4){logger['error'](_0x2f8f('0xe'),_0x590ff4,_0x1ce821[_0x2f8f('0x12')]['message']);return _0x1237d5(_0x1ce821['error'][_0x2f8f('0x14')]);}logger[_0x2f8f('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x590ff4,_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x14')]);return _0x10d128(_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x14')]);}else{logger[_0x2f8f('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x590ff4,'request\x20sent');_0x10d128(_0x1ce821['result']['message']);}})[_0x2f8f('0x15')](function(_0xee85bb){logger[_0x2f8f('0x12')](_0x2f8f('0xe'),_0x590ff4,_0xee85bb);_0x1237d5(_0xee85bb);});});} \ No newline at end of file +var _0xa3c3=['code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1379fa,_0x1f6e63){var _0x4ff875=function(_0x463852){while(--_0x463852){_0x1379fa['push'](_0x1379fa['shift']());}};_0x4ff875(++_0x1f6e63);}(_0xa3c3,0xcc));var _0x3a3c=function(_0x57ef4f,_0x5a7e1f){_0x57ef4f=_0x57ef4f-0x0;var _0x1f33ba=_0xa3c3[_0x57ef4f];return _0x1f33ba;};'use strict';var _=require(_0x3a3c('0x0'));var util=require('util');var moment=require(_0x3a3c('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a3c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a3c('0x3'))['db'];var utils=require(_0x3a3c('0x4'));var logger=require('../../config/logger')(_0x3a3c('0x5'));var config=require(_0x3a3c('0x6'));var jayson=require(_0x3a3c('0x7'));var client=jayson[_0x3a3c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5557ec,_0x40bb5f,_0x41a760){return new BPromise(function(_0x32f0f3,_0x320953){return client[_0x3a3c('0x9')](_0x5557ec,_0x41a760)['then'](function(_0x358367){logger[_0x3a3c('0xa')](_0x3a3c('0xb'),_0x40bb5f,_0x3a3c('0xc'));logger['debug'](_0x3a3c('0xd'),_0x40bb5f,_0x3a3c('0xc'),JSON[_0x3a3c('0xe')](_0x358367));if(_0x358367[_0x3a3c('0xf')]){if(_0x358367['error'][_0x3a3c('0x10')]===0x1f4){logger[_0x3a3c('0xf')](_0x3a3c('0xb'),_0x40bb5f,_0x358367[_0x3a3c('0xf')][_0x3a3c('0x11')]);return _0x320953(_0x358367[_0x3a3c('0xf')][_0x3a3c('0x11')]);}logger[_0x3a3c('0xf')](_0x3a3c('0xb'),_0x40bb5f,_0x358367[_0x3a3c('0xf')]['message']);return _0x32f0f3(_0x358367[_0x3a3c('0xf')][_0x3a3c('0x11')]);}else{logger['info'](_0x3a3c('0xb'),_0x40bb5f,_0x3a3c('0xc'));_0x32f0f3(_0x358367[_0x3a3c('0x12')][_0x3a3c('0x11')]);}})[_0x3a3c('0x13')](function(_0x33163e){logger[_0x3a3c('0xf')](_0x3a3c('0xb'),_0x40bb5f,_0x33163e);_0x320953(_0x33163e);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 8590ec1..60628e8 100644 --- a/server/api/intDeskField/index.js +++ b/server/api/intDeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4377=['/:id','show','create','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index'];(function(_0x3d9565,_0x5db973){var _0x546f66=function(_0x137352){while(--_0x137352){_0x3d9565['push'](_0x3d9565['shift']());}};_0x546f66(++_0x5db973);}(_0x4377,0xcb));var _0x7437=function(_0x3faf06,_0x1f3bd8){_0x3faf06=_0x3faf06-0x0;var _0x51947a=_0x4377[_0x3faf06];return _0x51947a;};'use strict';var multer=require(_0x7437('0x0'));var util=require(_0x7437('0x1'));var path=require(_0x7437('0x2'));var timeout=require(_0x7437('0x3'));var express=require(_0x7437('0x4'));var router=express['Router']();var fs_extra=require(_0x7437('0x5'));var auth=require(_0x7437('0x6'));var interaction=require(_0x7437('0x7'));var config=require(_0x7437('0x8'));var controller=require(_0x7437('0x9'));router[_0x7437('0xa')]('/',auth[_0x7437('0xb')](),controller[_0x7437('0xc')]);router['get'](_0x7437('0xd'),auth[_0x7437('0xb')](),controller[_0x7437('0xe')]);router['post']('/',auth[_0x7437('0xb')](),controller[_0x7437('0xf')]);router['put'](_0x7437('0xd'),auth[_0x7437('0xb')](),controller[_0x7437('0x10')]);router['delete'](_0x7437('0xd'),auth[_0x7437('0xb')](),controller[_0x7437('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3aae=['show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated'];(function(_0x21130b,_0x519278){var _0x5babb1=function(_0x12a5ad){while(--_0x12a5ad){_0x21130b['push'](_0x21130b['shift']());}};_0x5babb1(++_0x519278);}(_0x3aae,0x102));var _0xe3aa=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3aae[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xe3aa('0x0'));var util=require(_0xe3aa('0x1'));var path=require(_0xe3aa('0x2'));var timeout=require(_0xe3aa('0x3'));var express=require(_0xe3aa('0x4'));var router=express[_0xe3aa('0x5')]();var fs_extra=require(_0xe3aa('0x6'));var auth=require(_0xe3aa('0x7'));var interaction=require(_0xe3aa('0x8'));var config=require(_0xe3aa('0x9'));var controller=require(_0xe3aa('0xa'));router[_0xe3aa('0xb')]('/',auth['isAuthenticated'](),controller[_0xe3aa('0xc')]);router[_0xe3aa('0xb')](_0xe3aa('0xd'),auth[_0xe3aa('0xe')](),controller[_0xe3aa('0xf')]);router[_0xe3aa('0x10')]('/',auth[_0xe3aa('0xe')](),controller[_0xe3aa('0x11')]);router[_0xe3aa('0x12')](_0xe3aa('0xd'),auth[_0xe3aa('0xe')](),controller[_0xe3aa('0x13')]);router[_0xe3aa('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index f6f863e..84b0096 100644 --- a/server/api/intDeskField/intDeskField.attributes.js +++ b/server/api/intDeskField/intDeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe96=['string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x43f602,_0x223f29){var _0x45822b=function(_0x209f81){while(--_0x209f81){_0x43f602['push'](_0x43f602['shift']());}};_0x45822b(++_0x223f29);}(_0xfe96,0x66));var _0x6fe9=function(_0x446a05,_0x4c16ae){_0x446a05=_0x446a05-0x0;var _0x725df=_0xfe96[_0x446a05];return _0x725df;};'use strict';var Sequelize=require(_0x6fe9('0x0'));module['exports']={'type':{'type':Sequelize[_0x6fe9('0x1')]('string',_0x6fe9('0x2'),_0x6fe9('0x3'),_0x6fe9('0x4'),_0x6fe9('0x5')),'defaultValue':_0x6fe9('0x6')},'content':{'type':Sequelize[_0x6fe9('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6fe9('0x1')](_0x6fe9('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x6fe9('0x7')]},'idField':{'type':Sequelize[_0x6fe9('0x7')]},'nameField':{'type':Sequelize[_0x6fe9('0x7')]},'customField':{'type':Sequelize[_0x6fe9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6fe9('0x7')]}}; \ No newline at end of file +var _0xec0a=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x10255f,_0x125b63){var _0x5ac535=function(_0x359993){while(--_0x359993){_0x10255f['push'](_0x10255f['shift']());}};_0x5ac535(++_0x125b63);}(_0xec0a,0x1ed));var _0xaec0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xec0a[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xaec0('0x0'));module[_0xaec0('0x1')]={'type':{'type':Sequelize[_0xaec0('0x2')](_0xaec0('0x3'),_0xaec0('0x4'),_0xaec0('0x5'),_0xaec0('0x6'),_0xaec0('0x7')),'defaultValue':_0xaec0('0x3')},'content':{'type':Sequelize[_0xaec0('0x8')]},'key':{'type':Sequelize[_0xaec0('0x8')]},'keyType':{'type':Sequelize[_0xaec0('0x2')]('string',_0xaec0('0x4'),_0xaec0('0x5'))},'keyContent':{'type':Sequelize[_0xaec0('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaec0('0x8')]},'customField':{'type':Sequelize[_0xaec0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaec0('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 4c6ed09..0314c4c 100644 --- a/server/api/intDeskField/intDeskField.controller.js +++ b/server/api/intDeskField/intDeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e5b=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','DeskField','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x195a84,_0x37a11b){var _0x35fa94=function(_0x2e50e1){while(--_0x2e50e1){_0x195a84['push'](_0x195a84['shift']());}};_0x35fa94(++_0x37a11b);}(_0x7e5b,0x9f));var _0xb7e5=function(_0x5b2e43,_0x49e77f){_0x5b2e43=_0x5b2e43-0x0;var _0x57d34e=_0x7e5b[_0x5b2e43];return _0x57d34e;};'use strict';var emlformat=require(_0xb7e5('0x0'));var rimraf=require(_0xb7e5('0x1'));var zipdir=require(_0xb7e5('0x2'));var jsonpatch=require(_0xb7e5('0x3'));var rp=require(_0xb7e5('0x4'));var moment=require(_0xb7e5('0x5'));var BPromise=require(_0xb7e5('0x6'));var Mustache=require(_0xb7e5('0x7'));var util=require(_0xb7e5('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xb7e5('0x9'));var ejs=require(_0xb7e5('0xa'));var fs=require('fs');var fs_extra=require(_0xb7e5('0xb'));var _=require(_0xb7e5('0xc'));var squel=require('squel');var crypto=require(_0xb7e5('0xd'));var jsforce=require(_0xb7e5('0xe'));var deskjs=require(_0xb7e5('0xf'));var toCsv=require(_0xb7e5('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb7e5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7e5('0x11'));var logger=require(_0xb7e5('0x12'))(_0xb7e5('0x13'));var utils=require('../../config/utils');var config=require(_0xb7e5('0x14'));var licenseUtil=require(_0xb7e5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a6719,_0x2ed2df){_0x2ed2df=_0x2ed2df||0xcc;return function(_0x69dd30){if(_0x69dd30){return _0x4a6719[_0xb7e5('0x16')](_0x2ed2df);}return _0x4a6719[_0xb7e5('0x17')](_0x2ed2df)['end']();};}function respondWithResult(_0x22a7dd,_0x7242ee){_0x7242ee=_0x7242ee||0xc8;return function(_0x3b4fdc){if(_0x3b4fdc){return _0x22a7dd[_0xb7e5('0x17')](_0x7242ee)[_0xb7e5('0x18')](_0x3b4fdc);}};}function respondWithFilteredResult(_0x5c9a5b,_0x355539){return function(_0x28940c){if(_0x28940c){var _0x5b9791=typeof _0x355539[_0xb7e5('0x19')]===_0xb7e5('0x1a')&&typeof _0x355539[_0xb7e5('0x1b')]===_0xb7e5('0x1a');var _0x333c6d=_0x28940c['count'];var _0x368ac5=_0x5b9791?0x0:_0x355539['offset'];var _0x728a19=_0x5b9791?_0x28940c[_0xb7e5('0x1c')]:_0x355539[_0xb7e5('0x19')]+_0x355539[_0xb7e5('0x1b')];var _0x1ba06e;if(_0x728a19>=_0x333c6d){_0x728a19=_0x333c6d;_0x1ba06e=0xc8;}else{_0x1ba06e=0xce;}_0x5c9a5b[_0xb7e5('0x17')](_0x1ba06e);return _0x5c9a5b[_0xb7e5('0x1d')](_0xb7e5('0x1e'),_0x368ac5+'-'+_0x728a19+'/'+_0x333c6d)['json'](_0x28940c);}return null;};}function patchUpdates(_0x18b55d){return function(_0x130a2e){try{jsonpatch[_0xb7e5('0x1f')](_0x130a2e,_0x18b55d,!![]);}catch(_0x473d4d){return BPromise[_0xb7e5('0x20')](_0x473d4d);}return _0x130a2e['save']();};}function saveUpdates(_0x5147fd,_0x713bac){return function(_0x2c833b){if(_0x2c833b){return _0x2c833b[_0xb7e5('0x21')](_0x5147fd)[_0xb7e5('0x22')](function(_0x7b82bc){return _0x7b82bc;});}return null;};}function removeEntity(_0x1fc1bb,_0x101899){return function(_0x4b1d17){if(_0x4b1d17){return _0x4b1d17[_0xb7e5('0x23')]()[_0xb7e5('0x22')](function(){_0x1fc1bb[_0xb7e5('0x17')](0xcc)[_0xb7e5('0x24')]();});}};}function handleEntityNotFound(_0x4400e4,_0x5cadcb){return function(_0x4367ce){if(!_0x4367ce){_0x4400e4[_0xb7e5('0x16')](0x194);}return _0x4367ce;};}function handleError(_0x3224ac,_0x4d3cd1){_0x4d3cd1=_0x4d3cd1||0x1f4;return function(_0x36f251){logger['error'](_0x36f251[_0xb7e5('0x25')]);if(_0x36f251['name']){delete _0x36f251[_0xb7e5('0x26')];}_0x3224ac['status'](_0x4d3cd1)[_0xb7e5('0x27')](_0x36f251);};}exports[_0xb7e5('0x28')]=function(_0x1b0df2,_0x257628){var _0x508121={},_0x4b91b={},_0x620123={'count':0x0,'rows':[]};var _0x5c88f7=_[_0xb7e5('0x29')](db[_0xb7e5('0x2a')]['rawAttributes'],function(_0x432489){return{'name':_0x432489[_0xb7e5('0x2b')],'type':_0x432489[_0xb7e5('0x2c')][_0xb7e5('0x2d')]};});_0x4b91b['model']=_[_0xb7e5('0x29')](_0x5c88f7,_0xb7e5('0x26'));_0x4b91b['query']=_[_0xb7e5('0x2e')](_0x1b0df2[_0xb7e5('0x2f')]);_0x4b91b[_0xb7e5('0x30')]=_['intersection'](_0x4b91b[_0xb7e5('0x31')],_0x4b91b[_0xb7e5('0x2f')]);_0x508121[_0xb7e5('0x32')]=_[_0xb7e5('0x33')](_0x4b91b[_0xb7e5('0x31')],qs[_0xb7e5('0x34')](_0x1b0df2[_0xb7e5('0x2f')]['fields']));_0x508121['attributes']=_0x508121[_0xb7e5('0x32')][_0xb7e5('0x35')]?_0x508121[_0xb7e5('0x32')]:_0x4b91b[_0xb7e5('0x31')];if(!_0x1b0df2[_0xb7e5('0x2f')][_0xb7e5('0x36')](_0xb7e5('0x37'))){_0x508121['limit']=qs[_0xb7e5('0x1b')](_0x1b0df2[_0xb7e5('0x2f')][_0xb7e5('0x1b')]);_0x508121['offset']=qs[_0xb7e5('0x19')](_0x1b0df2[_0xb7e5('0x2f')]['offset']);}_0x508121['order']=qs[_0xb7e5('0x38')](_0x1b0df2[_0xb7e5('0x2f')][_0xb7e5('0x38')]);_0x508121[_0xb7e5('0x39')]=qs[_0xb7e5('0x30')](_['pick'](_0x1b0df2['query'],_0x4b91b['filters']),_0x5c88f7);if(_0x1b0df2['query'][_0xb7e5('0x3a')]){_0x508121['where']=_[_0xb7e5('0x3b')](_0x508121[_0xb7e5('0x39')],{'$or':_['map'](_0x5c88f7,function(_0x493d3c){if(_0x493d3c[_0xb7e5('0x2c')]!==_0xb7e5('0x3c')){var _0x538f00={};_0x538f00[_0x493d3c['name']]={'$like':'%'+_0x1b0df2[_0xb7e5('0x2f')][_0xb7e5('0x3a')]+'%'};return _0x538f00;}})});}_0x508121=_['merge']({},_0x508121,_0x1b0df2[_0xb7e5('0x3d')]);var _0x56eee7={'where':_0x508121[_0xb7e5('0x39')]};return db['DeskField']['count'](_0x56eee7)[_0xb7e5('0x22')](function(_0x64677f){_0x620123['count']=_0x64677f;if(_0x1b0df2['query'][_0xb7e5('0x3e')]){_0x508121[_0xb7e5('0x3f')]=[{'all':!![]}];}return db[_0xb7e5('0x2a')][_0xb7e5('0x40')](_0x508121);})[_0xb7e5('0x22')](function(_0x28c20a){_0x620123[_0xb7e5('0x41')]=_0x28c20a;return _0x620123;})[_0xb7e5('0x22')](respondWithFilteredResult(_0x257628,_0x508121))[_0xb7e5('0x42')](handleError(_0x257628,null));};exports[_0xb7e5('0x43')]=function(_0x2ba9a3,_0x499d75){var _0x57293c={'raw':!![],'where':{'id':_0x2ba9a3[_0xb7e5('0x44')]['id']}},_0x164bc1={};_0x164bc1[_0xb7e5('0x31')]=_[_0xb7e5('0x2e')](db[_0xb7e5('0x2a')][_0xb7e5('0x45')]);_0x164bc1[_0xb7e5('0x2f')]=_[_0xb7e5('0x2e')](_0x2ba9a3['query']);_0x164bc1['filters']=_[_0xb7e5('0x33')](_0x164bc1['model'],_0x164bc1['query']);_0x57293c['attributes']=_[_0xb7e5('0x33')](_0x164bc1[_0xb7e5('0x31')],qs[_0xb7e5('0x34')](_0x2ba9a3[_0xb7e5('0x2f')]['fields']));_0x57293c['attributes']=_0x57293c['attributes'][_0xb7e5('0x35')]?_0x57293c['attributes']:_0x164bc1[_0xb7e5('0x31')];if(_0x2ba9a3['query'][_0xb7e5('0x3e')]){_0x57293c['include']=[{'all':!![]}];}_0x57293c=_['merge']({},_0x57293c,_0x2ba9a3['options']);return db[_0xb7e5('0x2a')][_0xb7e5('0x46')](_0x57293c)[_0xb7e5('0x22')](handleEntityNotFound(_0x499d75,null))[_0xb7e5('0x22')](respondWithResult(_0x499d75,null))[_0xb7e5('0x42')](handleError(_0x499d75,null));};exports[_0xb7e5('0x47')]=function(_0x5e20ce,_0x44ebbb){return db[_0xb7e5('0x2a')][_0xb7e5('0x47')](_0x5e20ce[_0xb7e5('0x48')],{})['then'](respondWithResult(_0x44ebbb,0xc9))['catch'](handleError(_0x44ebbb,null));};exports[_0xb7e5('0x21')]=function(_0x5dd8ad,_0x578abd){if(_0x5dd8ad[_0xb7e5('0x48')]['id']){delete _0x5dd8ad[_0xb7e5('0x48')]['id'];}return db[_0xb7e5('0x2a')][_0xb7e5('0x46')]({'where':{'id':_0x5dd8ad[_0xb7e5('0x44')]['id']}})[_0xb7e5('0x22')](handleEntityNotFound(_0x578abd,null))[_0xb7e5('0x22')](saveUpdates(_0x5dd8ad[_0xb7e5('0x48')],null))[_0xb7e5('0x22')](respondWithResult(_0x578abd,null))[_0xb7e5('0x42')](handleError(_0x578abd,null));};exports[_0xb7e5('0x23')]=function(_0x5eb00b,_0x85cd0d){return db[_0xb7e5('0x2a')][_0xb7e5('0x46')]({'where':{'id':_0x5eb00b[_0xb7e5('0x44')]['id']}})[_0xb7e5('0x22')](handleEntityNotFound(_0x85cd0d,null))[_0xb7e5('0x22')](removeEntity(_0x85cd0d,null))[_0xb7e5('0x42')](handleError(_0x85cd0d,null));}; \ No newline at end of file +var _0x02b6=['stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error'];(function(_0x4ebe91,_0x5ca737){var _0x24d4c9=function(_0x1703ae){while(--_0x1703ae){_0x4ebe91['push'](_0x4ebe91['shift']());}};_0x24d4c9(++_0x5ca737);}(_0x02b6,0xfe));var _0x602b=function(_0xfcfc54,_0x24f09c){_0xfcfc54=_0xfcfc54-0x0;var _0x4b437d=_0x02b6[_0xfcfc54];return _0x4b437d;};'use strict';var emlformat=require(_0x602b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x602b('0x1'));var jsonpatch=require(_0x602b('0x2'));var rp=require(_0x602b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x602b('0x4'));var util=require(_0x602b('0x5'));var path=require(_0x602b('0x6'));var sox=require(_0x602b('0x7'));var csv=require('to-csv');var ejs=require(_0x602b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x602b('0x9'));var squel=require(_0x602b('0xa'));var crypto=require(_0x602b('0xb'));var jsforce=require(_0x602b('0xc'));var deskjs=require(_0x602b('0xd'));var toCsv=require(_0x602b('0xe'));var querystring=require(_0x602b('0xf'));var Papa=require(_0x602b('0x10'));var Redis=require(_0x602b('0x11'));var authService=require(_0x602b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x602b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x602b('0x14'));var utils=require('../../config/utils');var config=require(_0x602b('0x15'));var licenseUtil=require(_0x602b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e7882,_0x41cd15){_0x41cd15=_0x41cd15||0xcc;return function(_0x135847){if(_0x135847){return _0x1e7882['sendStatus'](_0x41cd15);}return _0x1e7882[_0x602b('0x17')](_0x41cd15)[_0x602b('0x18')]();};}function respondWithResult(_0x2c7f9a,_0x3742f1){_0x3742f1=_0x3742f1||0xc8;return function(_0x27eb0a){if(_0x27eb0a){return _0x2c7f9a[_0x602b('0x17')](_0x3742f1)[_0x602b('0x19')](_0x27eb0a);}};}function respondWithFilteredResult(_0x5035b6,_0x505efc){return function(_0xc4711d){if(_0xc4711d){var _0x41f957=typeof _0x505efc[_0x602b('0x1a')]===_0x602b('0x1b')&&typeof _0x505efc[_0x602b('0x1c')]===_0x602b('0x1b');var _0x416f64=_0xc4711d[_0x602b('0x1d')];var _0x46758d=_0x41f957?0x0:_0x505efc['offset'];var _0x48d992=_0x41f957?_0xc4711d[_0x602b('0x1d')]:_0x505efc[_0x602b('0x1a')]+_0x505efc['limit'];var _0x3c991c;if(_0x48d992>=_0x416f64){_0x48d992=_0x416f64;_0x3c991c=0xc8;}else{_0x3c991c=0xce;}_0x5035b6['status'](_0x3c991c);return _0x5035b6['set'](_0x602b('0x1e'),_0x46758d+'-'+_0x48d992+'/'+_0x416f64)['json'](_0xc4711d);}return null;};}function patchUpdates(_0x28eadf){return function(_0x5e0d15){try{jsonpatch[_0x602b('0x1f')](_0x5e0d15,_0x28eadf,!![]);}catch(_0x36cd1b){return BPromise[_0x602b('0x20')](_0x36cd1b);}return _0x5e0d15['save']();};}function saveUpdates(_0x258e11,_0x1264c8){return function(_0x580b66){if(_0x580b66){return _0x580b66[_0x602b('0x21')](_0x258e11)[_0x602b('0x22')](function(_0x2c59f3){return _0x2c59f3;});}return null;};}function removeEntity(_0x1943a0,_0x8510cf){return function(_0xb3beff){if(_0xb3beff){return _0xb3beff[_0x602b('0x23')]()[_0x602b('0x22')](function(){_0x1943a0[_0x602b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43acc3,_0x427bf1){return function(_0x5ce51b){if(!_0x5ce51b){_0x43acc3[_0x602b('0x24')](0x194);}return _0x5ce51b;};}function handleError(_0x469bd9,_0x50e64e){_0x50e64e=_0x50e64e||0x1f4;return function(_0x11dfd5){logger[_0x602b('0x25')](_0x11dfd5[_0x602b('0x26')]);if(_0x11dfd5[_0x602b('0x27')]){delete _0x11dfd5[_0x602b('0x27')];}_0x469bd9[_0x602b('0x17')](_0x50e64e)[_0x602b('0x28')](_0x11dfd5);};}exports[_0x602b('0x29')]=function(_0x3e82bc,_0x1fc94f){var _0x433ad0={},_0x529fa8={},_0x23a7f4={'count':0x0,'rows':[]};var _0x582ccc=_[_0x602b('0x2a')](db[_0x602b('0x2b')][_0x602b('0x2c')],function(_0x3b951b){return{'name':_0x3b951b[_0x602b('0x2d')],'type':_0x3b951b[_0x602b('0x2e')][_0x602b('0x2f')]};});_0x529fa8[_0x602b('0x30')]=_[_0x602b('0x2a')](_0x582ccc,_0x602b('0x27'));_0x529fa8[_0x602b('0x31')]=_['keys'](_0x3e82bc['query']);_0x529fa8[_0x602b('0x32')]=_[_0x602b('0x33')](_0x529fa8[_0x602b('0x30')],_0x529fa8[_0x602b('0x31')]);_0x433ad0['attributes']=_[_0x602b('0x33')](_0x529fa8[_0x602b('0x30')],qs[_0x602b('0x34')](_0x3e82bc['query'][_0x602b('0x34')]));_0x433ad0[_0x602b('0x35')]=_0x433ad0[_0x602b('0x35')][_0x602b('0x36')]?_0x433ad0['attributes']:_0x529fa8[_0x602b('0x30')];if(!_0x3e82bc['query'][_0x602b('0x37')](_0x602b('0x38'))){_0x433ad0[_0x602b('0x1c')]=qs[_0x602b('0x1c')](_0x3e82bc[_0x602b('0x31')][_0x602b('0x1c')]);_0x433ad0['offset']=qs[_0x602b('0x1a')](_0x3e82bc[_0x602b('0x31')][_0x602b('0x1a')]);}_0x433ad0['order']=qs[_0x602b('0x39')](_0x3e82bc['query'][_0x602b('0x39')]);_0x433ad0[_0x602b('0x3a')]=qs['filters'](_['pick'](_0x3e82bc['query'],_0x529fa8[_0x602b('0x32')]),_0x582ccc);if(_0x3e82bc[_0x602b('0x31')][_0x602b('0x3b')]){_0x433ad0[_0x602b('0x3a')]=_[_0x602b('0x3c')](_0x433ad0[_0x602b('0x3a')],{'$or':_[_0x602b('0x2a')](_0x582ccc,function(_0x1ca1e5){if(_0x1ca1e5[_0x602b('0x2e')]!=='VIRTUAL'){var _0x31bb71={};_0x31bb71[_0x1ca1e5[_0x602b('0x27')]]={'$like':'%'+_0x3e82bc[_0x602b('0x31')]['filter']+'%'};return _0x31bb71;}})});}_0x433ad0=_[_0x602b('0x3c')]({},_0x433ad0,_0x3e82bc[_0x602b('0x3d')]);var _0x10529a={'where':_0x433ad0['where']};return db[_0x602b('0x2b')][_0x602b('0x1d')](_0x10529a)[_0x602b('0x22')](function(_0x19376a){_0x23a7f4[_0x602b('0x1d')]=_0x19376a;if(_0x3e82bc['query'][_0x602b('0x3e')]){_0x433ad0[_0x602b('0x3f')]=[{'all':!![]}];}return db['DeskField'][_0x602b('0x40')](_0x433ad0);})[_0x602b('0x22')](function(_0x3888f6){_0x23a7f4[_0x602b('0x41')]=_0x3888f6;return _0x23a7f4;})['then'](respondWithFilteredResult(_0x1fc94f,_0x433ad0))['catch'](handleError(_0x1fc94f,null));};exports[_0x602b('0x42')]=function(_0x521cfd,_0x4a68d4){var _0x2ab1cf={'raw':!![],'where':{'id':_0x521cfd[_0x602b('0x43')]['id']}},_0x4bc46a={};_0x4bc46a[_0x602b('0x30')]=_[_0x602b('0x44')](db['DeskField'][_0x602b('0x2c')]);_0x4bc46a['query']=_['keys'](_0x521cfd[_0x602b('0x31')]);_0x4bc46a[_0x602b('0x32')]=_[_0x602b('0x33')](_0x4bc46a[_0x602b('0x30')],_0x4bc46a[_0x602b('0x31')]);_0x2ab1cf[_0x602b('0x35')]=_[_0x602b('0x33')](_0x4bc46a[_0x602b('0x30')],qs[_0x602b('0x34')](_0x521cfd[_0x602b('0x31')][_0x602b('0x34')]));_0x2ab1cf['attributes']=_0x2ab1cf[_0x602b('0x35')][_0x602b('0x36')]?_0x2ab1cf[_0x602b('0x35')]:_0x4bc46a['model'];if(_0x521cfd[_0x602b('0x31')][_0x602b('0x3e')]){_0x2ab1cf['include']=[{'all':!![]}];}_0x2ab1cf=_[_0x602b('0x3c')]({},_0x2ab1cf,_0x521cfd['options']);return db[_0x602b('0x2b')][_0x602b('0x45')](_0x2ab1cf)[_0x602b('0x22')](handleEntityNotFound(_0x4a68d4,null))[_0x602b('0x22')](respondWithResult(_0x4a68d4,null))[_0x602b('0x46')](handleError(_0x4a68d4,null));};exports[_0x602b('0x47')]=function(_0xec0931,_0x2fb9ad){return db[_0x602b('0x2b')][_0x602b('0x47')](_0xec0931[_0x602b('0x48')],{})[_0x602b('0x22')](respondWithResult(_0x2fb9ad,0xc9))['catch'](handleError(_0x2fb9ad,null));};exports['update']=function(_0x528837,_0x33b838){if(_0x528837[_0x602b('0x48')]['id']){delete _0x528837[_0x602b('0x48')]['id'];}return db[_0x602b('0x2b')][_0x602b('0x45')]({'where':{'id':_0x528837[_0x602b('0x43')]['id']}})[_0x602b('0x22')](handleEntityNotFound(_0x33b838,null))[_0x602b('0x22')](saveUpdates(_0x528837['body'],null))[_0x602b('0x22')](respondWithResult(_0x33b838,null))['catch'](handleError(_0x33b838,null));};exports[_0x602b('0x23')]=function(_0x1f72b0,_0x52677b){return db[_0x602b('0x2b')]['find']({'where':{'id':_0x1f72b0[_0x602b('0x43')]['id']}})[_0x602b('0x22')](handleEntityNotFound(_0x52677b,null))[_0x602b('0x22')](removeEntity(_0x52677b,null))[_0x602b('0x46')](handleError(_0x52677b,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index da9971c..4210332 100644 --- a/server/api/intDeskField/intDeskField.model.js +++ b/server/api/intDeskField/intDeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfec8=['exports','DeskField','int_desk_fields','desk_unique_index','idField','util','moment','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0x257b00,_0x3658be){var _0x247e16=function(_0x4cf5e8){while(--_0x4cf5e8){_0x257b00['push'](_0x257b00['shift']());}};_0x247e16(++_0x3658be);}(_0xfec8,0x10d));var _0x8fec=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0xfec8[_0x37a79c];return _0x561d89;};'use strict';var _=require('lodash');var util=require(_0x8fec('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8fec('0x1'));var BPromise=require(_0x8fec('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fec('0x3'));var rimraf=require(_0x8fec('0x4'));var config=require(_0x8fec('0x5'));var attributes=require(_0x8fec('0x6'));module[_0x8fec('0x7')]=function(_0x35f400,_0x4308b7){return _0x35f400['define'](_0x8fec('0x8'),attributes,{'tableName':_0x8fec('0x9'),'paranoid':![],'indexes':[{'name':_0x8fec('0xa'),'fields':[_0x8fec('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b94=['api','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','idField','FieldId','lodash','util'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x2b94,0x140));var _0x42b9=function(_0x54c174,_0x1e2d7b){_0x54c174=_0x54c174-0x0;var _0x671ed=_0x2b94[_0x54c174];return _0x671ed;};'use strict';var _=require(_0x42b9('0x0'));var util=require(_0x42b9('0x1'));var logger=require('../../config/logger')(_0x42b9('0x2'));var moment=require('moment');var BPromise=require(_0x42b9('0x3'));var rp=require(_0x42b9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42b9('0x5'));var config=require(_0x42b9('0x6'));var attributes=require(_0x42b9('0x7'));module[_0x42b9('0x8')]=function(_0x257e34,_0xdf5a6){return _0x257e34[_0x42b9('0x9')](_0x42b9('0xa'),attributes,{'tableName':_0x42b9('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x42b9('0xc'),_0x42b9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index ef98e4a..6a59465 100644 --- a/server/api/intDeskField/intDeskField.rpc.js +++ b/server/api/intDeskField/intDeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x916e=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x1badc7,_0x5681a2){var _0x120ca5=function(_0x27c9a7){while(--_0x27c9a7){_0x1badc7['push'](_0x1badc7['shift']());}};_0x120ca5(++_0x5681a2);}(_0x916e,0xe7));var _0xe916=function(_0x341c6c,_0x2f0648){_0x341c6c=_0x341c6c-0x0;var _0x3fb5a8=_0x916e[_0x341c6c];return _0x3fb5a8;};'use strict';var _=require(_0xe916('0x0'));var util=require(_0xe916('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe916('0x2'));var fs=require('fs');var Redis=require(_0xe916('0x3'));var db=require(_0xe916('0x4'))['db'];var utils=require(_0xe916('0x5'));var logger=require(_0xe916('0x6'))(_0xe916('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe916('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168b0f,_0x22507d,_0x2e582f){return new BPromise(function(_0x4cbf47,_0x3f8f0f){return client['request'](_0x168b0f,_0x2e582f)[_0xe916('0x9')](function(_0x5ba872){logger[_0xe916('0xa')](_0xe916('0xb'),_0x22507d,_0xe916('0xc'));logger[_0xe916('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x22507d,_0xe916('0xc'),JSON['stringify'](_0x5ba872));if(_0x5ba872['error']){if(_0x5ba872[_0xe916('0xe')][_0xe916('0xf')]===0x1f4){logger['error'](_0xe916('0xb'),_0x22507d,_0x5ba872[_0xe916('0xe')][_0xe916('0x10')]);return _0x3f8f0f(_0x5ba872[_0xe916('0xe')][_0xe916('0x10')]);}logger[_0xe916('0xe')](_0xe916('0xb'),_0x22507d,_0x5ba872[_0xe916('0xe')][_0xe916('0x10')]);return _0x4cbf47(_0x5ba872[_0xe916('0xe')][_0xe916('0x10')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x22507d,_0xe916('0xc'));_0x4cbf47(_0x5ba872[_0xe916('0x11')][_0xe916('0x10')]);}})[_0xe916('0x12')](function(_0x2b1a34){logger[_0xe916('0xe')](_0xe916('0xb'),_0x22507d,_0x2b1a34);_0x3f8f0f(_0x2b1a34);});});} \ No newline at end of file +var _0x3134=['then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x5df9c5,_0x3b41d3){var _0x1a4029=function(_0x5e475b){while(--_0x5e475b){_0x5df9c5['push'](_0x5df9c5['shift']());}};_0x1a4029(++_0x3b41d3);}(_0x3134,0x8f));var _0x4313=function(_0x1eb4c4,_0xb7bafc){_0x1eb4c4=_0x1eb4c4-0x0;var _0xdcd99a=_0x3134[_0x1eb4c4];return _0xdcd99a;};'use strict';var _=require('lodash');var util=require(_0x4313('0x0'));var moment=require('moment');var BPromise=require(_0x4313('0x1'));var rs=require(_0x4313('0x2'));var fs=require('fs');var Redis=require(_0x4313('0x3'));var db=require(_0x4313('0x4'))['db'];var utils=require(_0x4313('0x5'));var logger=require('../../config/logger')(_0x4313('0x6'));var config=require('../../config/environment');var jayson=require(_0x4313('0x7'));var client=jayson[_0x4313('0x8')][_0x4313('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55eabc,_0x45b9a9,_0x4eca6c){return new BPromise(function(_0x30e7d4,_0x3473e3){return client[_0x4313('0xa')](_0x55eabc,_0x4eca6c)[_0x4313('0xb')](function(_0xd3a3f4){logger[_0x4313('0xc')](_0x4313('0xd'),_0x45b9a9,_0x4313('0xe'));logger[_0x4313('0xf')](_0x4313('0x10'),_0x45b9a9,_0x4313('0xe'),JSON[_0x4313('0x11')](_0xd3a3f4));if(_0xd3a3f4[_0x4313('0x12')]){if(_0xd3a3f4[_0x4313('0x12')]['code']===0x1f4){logger[_0x4313('0x12')](_0x4313('0xd'),_0x45b9a9,_0xd3a3f4['error'][_0x4313('0x13')]);return _0x3473e3(_0xd3a3f4['error'][_0x4313('0x13')]);}logger[_0x4313('0x12')](_0x4313('0xd'),_0x45b9a9,_0xd3a3f4[_0x4313('0x12')][_0x4313('0x13')]);return _0x30e7d4(_0xd3a3f4[_0x4313('0x12')][_0x4313('0x13')]);}else{logger['info'](_0x4313('0xd'),_0x45b9a9,_0x4313('0xe'));_0x30e7d4(_0xd3a3f4[_0x4313('0x14')][_0x4313('0x13')]);}})[_0x4313('0x15')](function(_0xf60000){logger[_0x4313('0x12')](_0x4313('0xd'),_0x45b9a9,_0xf60000);_0x3473e3(_0xf60000);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index d41fc55..89c1b20 100644 --- a/server/api/intDynamics365Account/index.js +++ b/server/api/intDynamics365Account/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6070=['./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','getConfigurations','getFields','post','create','addConfiguration','put','update','destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6070,0x9a));var _0x0607=function(_0x6baaae,_0x1b9ce3){_0x6baaae=_0x6baaae-0x0;var _0x167e15=_0x6070[_0x6baaae];return _0x167e15;};'use strict';var multer=require('multer');var util=require(_0x0607('0x0'));var path=require(_0x0607('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0607('0x2'));var auth=require(_0x0607('0x3'));var interaction=require(_0x0607('0x4'));var config=require(_0x0607('0x5'));var controller=require(_0x0607('0x6'));router['get']('/',auth[_0x0607('0x7')](),controller[_0x0607('0x8')]);router[_0x0607('0x9')](_0x0607('0xa'),auth[_0x0607('0x7')](),controller[_0x0607('0xb')]);router[_0x0607('0x9')]('/:id/configurations',auth[_0x0607('0x7')](),controller[_0x0607('0xc')]);router[_0x0607('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x0607('0xd')]);router[_0x0607('0xe')]('/',auth[_0x0607('0x7')](),controller[_0x0607('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x0607('0x10')]);router[_0x0607('0x11')](_0x0607('0xa'),auth[_0x0607('0x7')](),controller[_0x0607('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0607('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5a5b=['multer','path','express','fs-extra','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports'];(function(_0x5d1514,_0x2c6dbc){var _0x55b13f=function(_0x2ba2cd){while(--_0x2ba2cd){_0x5d1514['push'](_0x5d1514['shift']());}};_0x55b13f(++_0x2c6dbc);}(_0x5a5b,0x1db));var _0xb5a5=function(_0x3e7328,_0x122482){_0x3e7328=_0x3e7328-0x0;var _0x1db031=_0x5a5b[_0x3e7328];return _0x1db031;};'use strict';var multer=require(_0xb5a5('0x0'));var util=require('util');var path=require(_0xb5a5('0x1'));var timeout=require('connect-timeout');var express=require(_0xb5a5('0x2'));var router=express['Router']();var fs_extra=require(_0xb5a5('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xb5a5('0x4')]('/',auth[_0xb5a5('0x5')](),controller[_0xb5a5('0x6')]);router['get'](_0xb5a5('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xb5a5('0x4')](_0xb5a5('0x8'),auth[_0xb5a5('0x5')](),controller[_0xb5a5('0x9')]);router[_0xb5a5('0x4')](_0xb5a5('0xa'),auth[_0xb5a5('0x5')](),controller[_0xb5a5('0xb')]);router[_0xb5a5('0xc')]('/',auth[_0xb5a5('0x5')](),controller[_0xb5a5('0xd')]);router[_0xb5a5('0xc')](_0xb5a5('0x8'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xb5a5('0xe')](_0xb5a5('0x7'),auth[_0xb5a5('0x5')](),controller[_0xb5a5('0xf')]);router[_0xb5a5('0x10')](_0xb5a5('0x7'),auth[_0xb5a5('0x5')](),controller[_0xb5a5('0x11')]);module[_0xb5a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index f81320a..fbb3c05 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js +++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a2a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x56d1b5,_0x289333){var _0x4ad91e=function(_0x15f467){while(--_0x15f467){_0x56d1b5['push'](_0x56d1b5['shift']());}};_0x4ad91e(++_0x289333);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x1eb78e,_0x86f1fe){_0x1eb78e=_0x1eb78e-0x0;var _0x4a4876=_0x5a2a[_0x1eb78e];return _0x4a4876;};'use strict';var Sequelize=require(_0xa5a2('0x0'));module[_0xa5a2('0x1')]={'name':{'type':Sequelize[_0xa5a2('0x2')]},'username':{'type':Sequelize[_0xa5a2('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xa5a2('0x2')]},'clientSecret':{'type':Sequelize[_0xa5a2('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa5a2('0x2')]},'modernAuthentication':{'type':Sequelize[_0xa5a2('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xde81=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2181fc,_0x7283aa){var _0x315da1=function(_0x1df7ca){while(--_0x1df7ca){_0x2181fc['push'](_0x2181fc['shift']());}};_0x315da1(++_0x7283aa);}(_0xde81,0x109));var _0x1de8=function(_0x557023,_0xe2ecfd){_0x557023=_0x557023-0x0;var _0x16c4f7=_0xde81[_0x557023];return _0x16c4f7;};'use strict';var Sequelize=require(_0x1de8('0x0'));module[_0x1de8('0x1')]={'name':{'type':Sequelize[_0x1de8('0x2')]},'username':{'type':Sequelize[_0x1de8('0x2')]},'password':{'type':Sequelize[_0x1de8('0x2')]},'remoteUri':{'type':Sequelize[_0x1de8('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1de8('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1de8('0x2')]},'modernAuthentication':{'type':Sequelize[_0x1de8('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index a7c207c..69c2f02 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.controller.js +++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fec=['createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridtype','owneridyominame','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','clientId','clientSecret','CloudProvider','data7','modernAuthentication','access_token','data5','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','LogicalName','forEach','@odata.type','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','api','../../components/integrations/configuration','json','offset','undefined','limit','status','set','Content-Range','destroy','end','sendStatus','error','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','count','then','include','findAll','rows','catch','show','keys','fields','includeAll','find','create','body','update','params','getConfigurations','Dynamics365Configuration','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','Incident','PhoneCall','title','description','customerid','ownerid','subject','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x0fec,0x1ca));var _0xc0fe=function(_0x257fb9,_0x1770d3){_0x257fb9=_0x257fb9-0x0;var _0x96e875=_0x0fec[_0x257fb9];return _0x96e875;};'use strict';var rp=require(_0xc0fe('0x0'));var util=require(_0xc0fe('0x1'));var _=require(_0xc0fe('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc0fe('0x3'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc0fe('0x4'));function respondWithResult(_0x28af46,_0x4d1088){_0x4d1088=_0x4d1088||0xc8;return function(_0x168055){if(_0x168055){return _0x28af46['status'](_0x4d1088)[_0xc0fe('0x5')](_0x168055);}};}function respondWithFilteredResult(_0x1073f0,_0x4cc359){return function(_0x53e410){if(_0x53e410){var _0x5b3f5a=typeof _0x4cc359[_0xc0fe('0x6')]===_0xc0fe('0x7')&&typeof _0x4cc359[_0xc0fe('0x8')]==='undefined';var _0x5e33c4=_0x53e410['count'];var _0x19d5dd=_0x5b3f5a?0x0:_0x4cc359['offset'];var _0x3844d8=_0x5b3f5a?_0x53e410['count']:_0x4cc359[_0xc0fe('0x6')]+_0x4cc359[_0xc0fe('0x8')];var _0x27d433;if(_0x3844d8>=_0x5e33c4){_0x3844d8=_0x5e33c4;_0x27d433=0xc8;}else{_0x27d433=0xce;}_0x1073f0[_0xc0fe('0x9')](_0x27d433);return _0x1073f0[_0xc0fe('0xa')](_0xc0fe('0xb'),_0x19d5dd+'-'+_0x3844d8+'/'+_0x5e33c4)['json'](_0x53e410);}return null;};}function saveUpdates(_0x350a6d){return function(_0x2cd4bb){if(_0x2cd4bb){return _0x2cd4bb['update'](_0x350a6d)['then'](function(_0x512541){return _0x512541;});}return null;};}function removeEntity(_0x35ff2c){return function(_0x2a4dad){if(_0x2a4dad){return _0x2a4dad[_0xc0fe('0xc')]()['then'](function(){_0x35ff2c[_0xc0fe('0x9')](0xcc)[_0xc0fe('0xd')]();});}};}function handleEntityNotFound(_0x5ae053){return function(_0x4afe19){if(!_0x4afe19){_0x5ae053[_0xc0fe('0xe')](0x194);}return _0x4afe19;};}function handleError(_0x1a2c08,_0x11d7ed){_0x11d7ed=_0x11d7ed||0x1f4;return function(_0x1dd571){logger[_0xc0fe('0xf')](_0x1dd571[_0xc0fe('0x10')]);if(_0x1dd571[_0xc0fe('0x11')]){delete _0x1dd571[_0xc0fe('0x11')];}_0x1a2c08['status'](_0x11d7ed)[_0xc0fe('0x12')](_0x1dd571);};}exports[_0xc0fe('0x13')]=function(_0x18f483,_0x2e5bf3){var _0x17504f={},_0x17c214={},_0x2ae2a9={'count':0x0,'rows':[]};var _0x402127=_['map'](db[_0xc0fe('0x14')][_0xc0fe('0x15')],function(_0x3ef97c){return{'name':_0x3ef97c[_0xc0fe('0x16')],'type':_0x3ef97c[_0xc0fe('0x17')][_0xc0fe('0x18')]};});_0x17c214[_0xc0fe('0x19')]=_[_0xc0fe('0x1a')](_0x402127,_0xc0fe('0x11'));_0x17c214['query']=_['keys'](_0x18f483[_0xc0fe('0x1b')]);_0x17c214[_0xc0fe('0x1c')]=_[_0xc0fe('0x1d')](_0x17c214['model'],_0x17c214[_0xc0fe('0x1b')]);_0x17504f['attributes']=_[_0xc0fe('0x1d')](_0x17c214[_0xc0fe('0x19')],qs['fields'](_0x18f483[_0xc0fe('0x1b')]['fields']));_0x17504f[_0xc0fe('0x1e')]=_0x17504f[_0xc0fe('0x1e')][_0xc0fe('0x1f')]?_0x17504f['attributes']:_0x17c214[_0xc0fe('0x19')];if(!_0x18f483['query'][_0xc0fe('0x20')](_0xc0fe('0x21'))){_0x17504f[_0xc0fe('0x8')]=qs[_0xc0fe('0x8')](_0x18f483['query'][_0xc0fe('0x8')]);_0x17504f[_0xc0fe('0x6')]=qs[_0xc0fe('0x6')](_0x18f483['query']['offset']);}_0x17504f['order']=qs[_0xc0fe('0x22')](_0x18f483['query'][_0xc0fe('0x22')]);_0x17504f[_0xc0fe('0x23')]=qs['filters'](_[_0xc0fe('0x24')](_0x18f483['query'],_0x17c214[_0xc0fe('0x1c')]),_0x402127);if(_0x18f483[_0xc0fe('0x1b')]['filter']){_0x17504f[_0xc0fe('0x23')]=_[_0xc0fe('0x25')](_0x17504f[_0xc0fe('0x23')],{'$or':_[_0xc0fe('0x1a')](_0x402127,function(_0x7921a8){if(_0x7921a8[_0xc0fe('0x17')]!=='VIRTUAL'){var _0x497530={};_0x497530[_0x7921a8[_0xc0fe('0x11')]]={'$like':'%'+_0x18f483[_0xc0fe('0x1b')][_0xc0fe('0x26')]+'%'};return _0x497530;}})});}_0x17504f=_[_0xc0fe('0x25')]({},_0x17504f,_0x18f483[_0xc0fe('0x27')]);var _0x22c9d1={'where':_0x17504f['where']};return db['Dynamics365Account'][_0xc0fe('0x28')](_0x22c9d1)[_0xc0fe('0x29')](function(_0x5db240){_0x2ae2a9[_0xc0fe('0x28')]=_0x5db240;if(_0x18f483[_0xc0fe('0x1b')]['includeAll']){_0x17504f[_0xc0fe('0x2a')]=[{'all':!![]}];}return db[_0xc0fe('0x14')][_0xc0fe('0x2b')](_0x17504f);})[_0xc0fe('0x29')](function(_0x549b22){_0x2ae2a9[_0xc0fe('0x2c')]=_0x549b22;return _0x2ae2a9;})[_0xc0fe('0x29')](respondWithFilteredResult(_0x2e5bf3,_0x17504f))[_0xc0fe('0x2d')](handleError(_0x2e5bf3,null));};exports[_0xc0fe('0x2e')]=function(_0x1b09e8,_0x3d44a1){var _0x32a943={'raw':![],'where':{'id':_0x1b09e8['params']['id']}},_0x254919={};_0x254919[_0xc0fe('0x19')]=_[_0xc0fe('0x2f')](db[_0xc0fe('0x14')]['rawAttributes']);_0x254919[_0xc0fe('0x1b')]=_[_0xc0fe('0x2f')](_0x1b09e8[_0xc0fe('0x1b')]);_0x254919[_0xc0fe('0x1c')]=_[_0xc0fe('0x1d')](_0x254919[_0xc0fe('0x19')],_0x254919[_0xc0fe('0x1b')]);_0x32a943[_0xc0fe('0x1e')]=_[_0xc0fe('0x1d')](_0x254919[_0xc0fe('0x19')],qs[_0xc0fe('0x30')](_0x1b09e8[_0xc0fe('0x1b')][_0xc0fe('0x30')]));_0x32a943['attributes']=_0x32a943['attributes']['length']?_0x32a943['attributes']:_0x254919['model'];if(_0x1b09e8[_0xc0fe('0x1b')][_0xc0fe('0x31')]){_0x32a943[_0xc0fe('0x2a')]=[{'all':!![]}];}_0x32a943=_['merge']({},_0x32a943,_0x1b09e8[_0xc0fe('0x27')]);return db[_0xc0fe('0x14')][_0xc0fe('0x32')](_0x32a943)[_0xc0fe('0x29')](handleEntityNotFound(_0x3d44a1,null))[_0xc0fe('0x29')](respondWithResult(_0x3d44a1,null))['catch'](handleError(_0x3d44a1,null));};exports[_0xc0fe('0x33')]=function(_0x2658e2,_0x348f2a){return db['Dynamics365Account']['create'](_0x2658e2[_0xc0fe('0x34')],{})[_0xc0fe('0x29')](respondWithResult(_0x348f2a,0xc9))[_0xc0fe('0x2d')](handleError(_0x348f2a,null));};exports[_0xc0fe('0x35')]=function(_0x32f008,_0xf25ff5){if(_0x32f008['body']['id']){delete _0x32f008[_0xc0fe('0x34')]['id'];}return db[_0xc0fe('0x14')][_0xc0fe('0x32')]({'where':{'id':_0x32f008[_0xc0fe('0x36')]['id']}})[_0xc0fe('0x29')](handleEntityNotFound(_0xf25ff5,null))[_0xc0fe('0x29')](saveUpdates(_0x32f008[_0xc0fe('0x34')],null))[_0xc0fe('0x29')](respondWithResult(_0xf25ff5,null))[_0xc0fe('0x2d')](handleError(_0xf25ff5,null));};exports[_0xc0fe('0xc')]=function(_0x3d4841,_0x3f6d8f){return db[_0xc0fe('0x14')][_0xc0fe('0x32')]({'where':{'id':_0x3d4841['params']['id']}})[_0xc0fe('0x29')](handleEntityNotFound(_0x3f6d8f,null))[_0xc0fe('0x29')](removeEntity(_0x3f6d8f,null))[_0xc0fe('0x2d')](handleError(_0x3f6d8f,null));};exports[_0xc0fe('0x37')]=function(_0x4a7468,_0xaaa2a8){var _0x579306={};var _0x276fe8={};var _0x514919;var _0x337b52;return db[_0xc0fe('0x14')]['findOne']({'where':{'id':_0x4a7468[_0xc0fe('0x36')]['id']}})[_0xc0fe('0x29')](handleEntityNotFound(_0xaaa2a8,null))['then'](function(_0x3378a1){if(_0x3378a1){_0x514919=_0x3378a1;_0x276fe8['model']=_[_0xc0fe('0x2f')](db[_0xc0fe('0x38')]['rawAttributes']);_0x276fe8[_0xc0fe('0x1b')]=_['keys'](_0x4a7468[_0xc0fe('0x1b')]);_0x276fe8[_0xc0fe('0x1c')]=_['intersection'](_0x276fe8[_0xc0fe('0x19')],_0x276fe8['query']);_0x579306[_0xc0fe('0x1e')]=_[_0xc0fe('0x1d')](_0x276fe8[_0xc0fe('0x19')],qs['fields'](_0x4a7468['query']['fields']));_0x579306[_0xc0fe('0x1e')]=_0x579306[_0xc0fe('0x1e')][_0xc0fe('0x1f')]?_0x579306[_0xc0fe('0x1e')]:_0x276fe8[_0xc0fe('0x19')];_0x579306[_0xc0fe('0x39')]=qs[_0xc0fe('0x22')](_0x4a7468['query'][_0xc0fe('0x22')]);_0x579306['where']=qs[_0xc0fe('0x1c')](_[_0xc0fe('0x24')](_0x4a7468[_0xc0fe('0x1b')],_0x276fe8[_0xc0fe('0x1c')]));if(_0x4a7468[_0xc0fe('0x1b')][_0xc0fe('0x26')]){_0x579306[_0xc0fe('0x23')]=_[_0xc0fe('0x25')](_0x579306['where'],{'$or':_[_0xc0fe('0x1a')](_0x579306[_0xc0fe('0x1e')],function(_0x5a0a6d){var _0x25c4d8={};_0x25c4d8[_0x5a0a6d]={'$like':'%'+_0x4a7468[_0xc0fe('0x1b')][_0xc0fe('0x26')]+'%'};return _0x25c4d8;})});}_0x579306=_[_0xc0fe('0x25')]({},_0x579306,_0x4a7468[_0xc0fe('0x27')]);return _0x514919[_0xc0fe('0x37')](_0x579306);}})[_0xc0fe('0x29')](function(_0x5bc29e){if(_0x5bc29e){_0x337b52=_0x5bc29e[_0xc0fe('0x1f')];if(!_0x4a7468['query'][_0xc0fe('0x20')](_0xc0fe('0x21'))){_0x579306[_0xc0fe('0x8')]=qs['limit'](_0x4a7468['query']['limit']);_0x579306[_0xc0fe('0x6')]=qs[_0xc0fe('0x6')](_0x4a7468[_0xc0fe('0x1b')]['offset']);}return _0x514919[_0xc0fe('0x37')](_0x579306);}})[_0xc0fe('0x29')](function(_0x284316){if(_0x284316){return _0x284316?{'count':_0x337b52,'rows':_0x284316}:null;}})[_0xc0fe('0x29')](respondWithResult(_0xaaa2a8,null))['catch'](handleError(_0xaaa2a8,null));};exports[_0xc0fe('0x3a')]=function(_0x4a8c1e,_0x2d82be){if(_0x4a8c1e['body']['id']){delete _0x4a8c1e[_0xc0fe('0x34')]['id'];}return db[_0xc0fe('0x14')][_0xc0fe('0x3b')]({'where':{'id':_0x4a8c1e[_0xc0fe('0x36')]['id']}})[_0xc0fe('0x29')](handleEntityNotFound(_0x2d82be,null))[_0xc0fe('0x29')](function(_0x48164d){if(_0x48164d){_0x4a8c1e[_0xc0fe('0x34')][_0xc0fe('0x3c')]=_0x48164d['id'];_0x4a8c1e[_0xc0fe('0x34')][_0xc0fe('0x3d')]=integrations[_0xc0fe('0x3e')](_0x4a8c1e[_0xc0fe('0x34')][_0xc0fe('0x3f')],_0x4a8c1e[_0xc0fe('0x34')][_0xc0fe('0x17')]);_0x4a8c1e[_0xc0fe('0x34')][_0xc0fe('0x40')]=integrations[_0xc0fe('0x41')](_0x4a8c1e[_0xc0fe('0x34')][_0xc0fe('0x3f')],_0x4a8c1e[_0xc0fe('0x34')][_0xc0fe('0x17')]);return db['Dynamics365Configuration']['create'](_0x4a8c1e[_0xc0fe('0x34')],{'include':[{'model':db[_0xc0fe('0x42')],'as':_0xc0fe('0x3d')},{'model':db[_0xc0fe('0x42')],'as':'Descriptions'}]});}return null;})[_0xc0fe('0x29')](respondWithResult(_0x2d82be,null))[_0xc0fe('0x2d')](handleError(_0x2d82be,null));};function sanitizeRemoteUri(_0x5a1cdb){var _0x37e4b8=_0x5a1cdb[_0xc0fe('0x43')](-0x1);if(_0x37e4b8==='/')return _0x5a1cdb[_0xc0fe('0x44')](0x0,_0x5a1cdb[_0xc0fe('0x45')](_0x37e4b8));return _0x5a1cdb;}function getWebApiUrl(_0x4f5f40){return util[_0xc0fe('0x46')](_0xc0fe('0x47'),_0x4f5f40);}exports['getFields']=function(_0xab5955,_0x3ea2e4){var _0x3dc436=_0xab5955[_0xc0fe('0x1b')][_0xc0fe('0x48')];var _0x301f10=_0x3dc436==='incident'?_0xc0fe('0x49'):_0xc0fe('0x4a');var _0x1e8c00='';var _0x34ac33='';var _0x57323b='';var _0x39bca8='';var _0x5e62ce='';var _0x1ea5c5='';var _0x285b81='';var _0x4ef8e6='';var _0x503d95=[_0xc0fe('0x4b'),_0xc0fe('0x4c'),_0xc0fe('0x4d'),_0xc0fe('0x4e'),'caseorigincode',_0xc0fe('0x4f'),'phonenumber',_0xc0fe('0x50'),_0xc0fe('0x51'),'phonecall_activity_parties'];var _0x1147ad=[_0xc0fe('0x52'),'accountidyominame',_0xc0fe('0x53'),_0xc0fe('0x54'),_0xc0fe('0x55'),_0xc0fe('0x56'),'contractdetailidname',_0xc0fe('0x57'),'createdbyexternalpartyname',_0xc0fe('0x58'),_0xc0fe('0x59'),_0xc0fe('0x5a'),'createdon',_0xc0fe('0x5b'),'createdonbehalfbyyominame',_0xc0fe('0x5c'),_0xc0fe('0x5d'),_0xc0fe('0x5e'),_0xc0fe('0x5f'),_0xc0fe('0x60'),'entityimage_timestamp',_0xc0fe('0x61'),'escalatedon',_0xc0fe('0x62'),_0xc0fe('0x63'),_0xc0fe('0x64'),_0xc0fe('0x65'),'influencescore',_0xc0fe('0x66'),'lastonholdtime',_0xc0fe('0x67'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0xc0fe('0x68'),_0xc0fe('0x69'),_0xc0fe('0x6a'),_0xc0fe('0x6b'),_0xc0fe('0x6c'),'msdyn_incidenttypename',_0xc0fe('0x6d'),_0xc0fe('0x6e'),_0xc0fe('0x6f'),'overriddencreatedon','owneridname',_0xc0fe('0x70'),_0xc0fe('0x71'),'parentcaseidname',_0xc0fe('0x72'),'primarycontactidyominame',_0xc0fe('0x73'),_0xc0fe('0x74'),_0xc0fe('0x75'),_0xc0fe('0x76'),_0xc0fe('0x77'),'responseby',_0xc0fe('0x78'),_0xc0fe('0x79'),_0xc0fe('0x7a'),_0xc0fe('0x7b'),_0xc0fe('0x7c'),_0xc0fe('0x7d'),'statecode',_0xc0fe('0x7e'),_0xc0fe('0x7f'),_0xc0fe('0x80'),_0xc0fe('0x81'),'transactioncurrencyidname',_0xc0fe('0x82'),_0xc0fe('0x83'),_0xc0fe('0x84')];var _0xabca0a=_0x503d95['concat'](_0x1147ad);return db[_0xc0fe('0x14')]['findOne']({'where':{'id':_0xab5955[_0xc0fe('0x36')]['id']},'attributes':['id',_0xc0fe('0x85'),_0xc0fe('0x86'),_0xc0fe('0x87'),'tenantId',_0xc0fe('0x88'),_0xc0fe('0x89'),'modernAuthentication'],'include':[{'model':db[_0xc0fe('0x8a')],'as':_0xc0fe('0x8a'),'attributes':['id','data5',_0xc0fe('0x8b')]}]})[_0xc0fe('0x29')](handleEntityNotFound(_0x3ea2e4,null))[_0xc0fe('0x29')](function(_0x305e90){if(_0x305e90){if(_0x305e90[_0xc0fe('0x8c')]){_0x305e90[_0xc0fe('0x8d')]=_0x305e90[_0xc0fe('0x8a')][_0xc0fe('0x8e')];_0x4ef8e6=sanitizeRemoteUri(_0x305e90[_0xc0fe('0x8a')][_0xc0fe('0x8b')]);_0x285b81=getWebApiUrl(_0x4ef8e6);return _0x305e90;}_0x4ef8e6=sanitizeRemoteUri(_0x305e90['remoteUri']);_0x285b81=getWebApiUrl(_0x4ef8e6);var _0x4c83be={'method':'POST','uri':_0xc0fe('0x8f')+_0x305e90['tenantId']+_0xc0fe('0x90'),'form':{'client_id':_0x305e90[_0xc0fe('0x88')],'resource':_0x4ef8e6,'username':_0x305e90[_0xc0fe('0x85')],'password':_0x305e90[_0xc0fe('0x86')],'grant_type':_0xc0fe('0x86'),'client_secret':_0x305e90['clientSecret']},'json':!![]};return rp(_0x4c83be);}})['then'](function(_0x1d0e39){_0x1ea5c5=_0x1d0e39[_0xc0fe('0x8d')];var _0x220568={'method':_0xc0fe('0x91'),'uri':encodeURI(_0x285b81+_0xc0fe('0x92')+_0x301f10+'\x27'),'headers':{'Authorization':_0xc0fe('0x93')+_0x1ea5c5,'If-None-Match':null,'OData-Version':_0xc0fe('0x94')},'json':!![]};return rp(_0x220568);})[_0xc0fe('0x29')](function(_0x345132){var _0x581640=_0x345132['value'][0x0];var _0x5e10b0=_0x581640[_0xc0fe('0x95')];var _0x4e3dcf={'method':'GET','uri':_0x285b81+_0xc0fe('0x96')+_0x5e10b0+_0xc0fe('0x97'),'headers':{'Authorization':_0xc0fe('0x93')+_0x1ea5c5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4e3dcf);})['then'](function(_0x2b603a){_0x1e8c00=_0x2b603a;_0x34ac33=_0x1e8c00['Attributes'];_0x34ac33=_[_0xc0fe('0x98')](_0x34ac33,function(_0x3c176b){return!_0xabca0a['includes'](_0x3c176b[_0xc0fe('0x99')]);});var _0x3ba834=[];var _0x32fc41=[];_0x34ac33[_0xc0fe('0x9a')](function(_0x2c65ae){if(_0x2c65ae[_0xc0fe('0x9b')]){var _0x4ef828=_0x2c65ae[_0xc0fe('0x9b')][_0xc0fe('0x44')](_0x2c65ae[_0xc0fe('0x9b')][_0xc0fe('0x45')]('.')+0x1);if(_0x4ef828==='PicklistAttributeMetadata'){_0x3ba834['push'](getSelectList(_0x285b81,_0x3dc436,_0x32fc41,_0x1e8c00[_0xc0fe('0x95')],_0x2c65ae[_0xc0fe('0x95')],_0x1ea5c5));}}});return Promise[_0xc0fe('0x9c')](_0x3ba834);})[_0xc0fe('0x29')](function(_0x1bde49){_0x57323b=_0x1bde49[0x0];var _0x461b80=[];var _0x4ea57e=[];_0x34ac33[_0xc0fe('0x9a')](function(_0x2694cb){if(!_[_0xc0fe('0x9d')](_0x2694cb[_0xc0fe('0x9b')])){var _0x43d02f=_0x2694cb[_0xc0fe('0x9b')][_0xc0fe('0x44')](_0x2694cb[_0xc0fe('0x9b')][_0xc0fe('0x45')]('.')+0x1);if(_0x43d02f===_0xc0fe('0x9e')){_0x461b80[_0xc0fe('0x9f')](getBooleanList(_0x285b81,_0x3dc436,_0x4ea57e,_0x1e8c00['MetadataId'],_0x2694cb[_0xc0fe('0x95')],_0x1ea5c5));}}});return Promise[_0xc0fe('0x9c')](_0x461b80);})['then'](function(_0xcc8562){_0x39bca8=_0xcc8562[0x0];var _0x43cf24=[];var _0x593152=[];_0x34ac33[_0xc0fe('0x9a')](function(_0x40845a){if(_0x40845a[_0xc0fe('0x9b')]){var _0x3f64ea=_0x40845a['@odata.type']['substring'](_0x40845a[_0xc0fe('0x9b')][_0xc0fe('0x45')]('.')+0x1);if(_0x3f64ea===_0xc0fe('0xa0')||_0x3f64ea===_0xc0fe('0xa1')||_0x3f64ea===_0xc0fe('0xa2')||_0x3f64ea===_0xc0fe('0xa3')||_0x3f64ea==='MemoAttributeMetadata'||_0x3f64ea===_0xc0fe('0xa4')||_0x3f64ea===_0xc0fe('0xa5')||_0x3f64ea===_0xc0fe('0xa6')||_0x3f64ea===_0xc0fe('0xa7')||_0x3f64ea==='DecimalAttributeMetadata'){_0x43cf24['push'](getInputList(_0x285b81,_0x3dc436,_0x3f64ea,_0x593152,_0x1e8c00[_0xc0fe('0x95')],_0x40845a[_0xc0fe('0x95')],_0x1ea5c5));}}});return Promise['all'](_0x43cf24);})['then'](function(_0x124e7f){_0x5e62ce=_0x124e7f[0x0];var _0x241232=_0x57323b['concat'](_0x39bca8)['concat'](_0x5e62ce);var _0x22c487={'count':_0x241232[_0xc0fe('0x1f')],'rows':_0x241232};return _0x22c487;})['then'](respondWithResult(_0x3ea2e4,null))['catch'](function(_0x3e78ae){var _0x50133d=_0xab5955[_0xc0fe('0x1b')][_0xc0fe('0xa8')]?0x1f4:_0x3e78ae['statusCode']||0x1f4;logger['error'](_0x3e78ae['stack']);delete _0x3e78ae[_0xc0fe('0x11')];if(_0x50133d===0x191){_0x50133d=0x190;}_0x3ea2e4[_0xc0fe('0x9')](_0x50133d)[_0xc0fe('0x12')](_0xab5955[_0xc0fe('0x1b')][_0xc0fe('0xa8')]?{'message':_0xc0fe('0xa9'),'statusCode':_0x3e78ae['statusCode']}:_0x3e78ae);});};function getSelectList(_0x5bffd5,_0x3ccdae,_0x4a2dc4,_0x455551,_0x29190c,_0x1e9c9f){var _0x3ea72b={'method':_0xc0fe('0x91'),'uri':_0x5bffd5+_0xc0fe('0x96')+_0x455551+_0xc0fe('0xaa')+_0x29190c+_0xc0fe('0xab')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xc0fe('0x93')+_0x1e9c9f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3ea72b)['then'](function(_0x1477c9){var _0x2f95b3=[];var _0x5aef8f=_0x1477c9[_0xc0fe('0xac')][_0xc0fe('0xad')];_0x5aef8f[_0xc0fe('0x9a')](function(_0x5559a0){_0x2f95b3['push']({'name':_0x5559a0[_0xc0fe('0xae')][_0xc0fe('0xaf')][_0xc0fe('0xae')],'value':String(_0x5559a0[_0xc0fe('0xb0')])});});var _0xb47c94={'id':_0x3ccdae+'_'+_0x1477c9[_0xc0fe('0x99')],'name':_0x1477c9[_0xc0fe('0xb1')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x2f95b3};_0x4a2dc4[_0xc0fe('0x9f')](_0xb47c94);return _0x4a2dc4;});}function getBooleanList(_0x4d98ec,_0x1d904d,_0x9d4f70,_0x2095d5,_0x4c787c,_0x3f3abb){var _0x37d3b1={'method':_0xc0fe('0x91'),'uri':_0x4d98ec+_0xc0fe('0x96')+_0x2095d5+_0xc0fe('0xaa')+_0x4c787c+_0xc0fe('0xb2'),'headers':{'Authorization':_0xc0fe('0x93')+_0x3f3abb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x37d3b1)[_0xc0fe('0x29')](function(_0x3938ad){var _0x144404=[];_0x144404['push']({'name':_0x3938ad['OptionSet']['TrueOption'][_0xc0fe('0xae')]['UserLocalizedLabel'][_0xc0fe('0xae')],'value':_0xc0fe('0xb3')},{'name':_0x3938ad[_0xc0fe('0xac')][_0xc0fe('0xb4')][_0xc0fe('0xae')][_0xc0fe('0xaf')]['Label'],'value':'false'});var _0x56a476={'id':_0x1d904d+'_'+_0x3938ad[_0xc0fe('0x99')],'name':_0x3938ad[_0xc0fe('0xb1')]['UserLocalizedLabel'][_0xc0fe('0xae')],'custom':![],'options':_0x144404};_0x9d4f70[_0xc0fe('0x9f')](_0x56a476);return _0x9d4f70;});}function getInputList(_0xa128fd,_0x43f29e,_0x3c40e4,_0x1b2012,_0x5c5172,_0x46b501,_0x2be92e){var _0x44a648={'method':_0xc0fe('0x91'),'uri':_0xa128fd+_0xc0fe('0x96')+_0x5c5172+')/Attributes('+_0x46b501+_0xc0fe('0xb5')+_0x3c40e4+_0xc0fe('0xb6'),'headers':{'Authorization':'Bearer\x20'+_0x2be92e,'If-None-Match':null,'OData-Version':_0xc0fe('0x94')},'json':!![]};return rp(_0x44a648)[_0xc0fe('0x29')](function(_0x484c06){var _0x4f0197={'id':_0x43f29e+'_'+_0x484c06[_0xc0fe('0x99')],'name':_0x484c06[_0xc0fe('0xb1')]['UserLocalizedLabel']?_0x484c06[_0xc0fe('0xb1')][_0xc0fe('0xaf')][_0xc0fe('0xae')]:_0x484c06[_0xc0fe('0x99')],'custom':![],'options':[]};_0x1b2012[_0xc0fe('0x9f')](_0x4f0197);return _0x1b2012;});} \ No newline at end of file +var _0xdb56=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','includeAll','create','body','find','params','findOne','getConfigurations','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','substring','lastIndexOf','format','%s/api/data/v9.0/','incident','Incident','PhoneCall','customerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x41594a,_0x521176){var _0x707409=function(_0x1acba4){while(--_0x1acba4){_0x41594a['push'](_0x41594a['shift']());}};_0x707409(++_0x521176);}(_0xdb56,0x95));var _0x6db5=function(_0x3772b5,_0x1c71cf){_0x3772b5=_0x3772b5-0x0;var _0x565d5d=_0xdb56[_0x3772b5];return _0x565d5d;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x6db5('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x6db5('0x1'))(_0x6db5('0x2'));var db=require(_0x6db5('0x3'))['db'];var integrations=require(_0x6db5('0x4'));function respondWithResult(_0x1b3180,_0x1e5668){_0x1e5668=_0x1e5668||0xc8;return function(_0xdf8381){if(_0xdf8381){return _0x1b3180[_0x6db5('0x5')](_0x1e5668)[_0x6db5('0x6')](_0xdf8381);}};}function respondWithFilteredResult(_0x3b5ba9,_0x2f2690){return function(_0x12687b){if(_0x12687b){var _0x15bd01=typeof _0x2f2690[_0x6db5('0x7')]===_0x6db5('0x8')&&typeof _0x2f2690[_0x6db5('0x9')]===_0x6db5('0x8');var _0x280911=_0x12687b[_0x6db5('0xa')];var _0x46816b=_0x15bd01?0x0:_0x2f2690[_0x6db5('0x7')];var _0x4f117a=_0x15bd01?_0x12687b['count']:_0x2f2690[_0x6db5('0x7')]+_0x2f2690[_0x6db5('0x9')];var _0x4eabac;if(_0x4f117a>=_0x280911){_0x4f117a=_0x280911;_0x4eabac=0xc8;}else{_0x4eabac=0xce;}_0x3b5ba9[_0x6db5('0x5')](_0x4eabac);return _0x3b5ba9[_0x6db5('0xb')](_0x6db5('0xc'),_0x46816b+'-'+_0x4f117a+'/'+_0x280911)[_0x6db5('0x6')](_0x12687b);}return null;};}function saveUpdates(_0x589887){return function(_0xfdaf11){if(_0xfdaf11){return _0xfdaf11[_0x6db5('0xd')](_0x589887)[_0x6db5('0xe')](function(_0xb622a6){return _0xb622a6;});}return null;};}function removeEntity(_0xb1ea50){return function(_0x34b1df){if(_0x34b1df){return _0x34b1df[_0x6db5('0xf')]()[_0x6db5('0xe')](function(){_0xb1ea50[_0x6db5('0x5')](0xcc)[_0x6db5('0x10')]();});}};}function handleEntityNotFound(_0x14b0f8){return function(_0x30c119){if(!_0x30c119){_0x14b0f8[_0x6db5('0x11')](0x194);}return _0x30c119;};}function handleError(_0x3798ba,_0x39bc94){_0x39bc94=_0x39bc94||0x1f4;return function(_0x31ed45){logger[_0x6db5('0x12')](_0x31ed45[_0x6db5('0x13')]);if(_0x31ed45['name']){delete _0x31ed45[_0x6db5('0x14')];}_0x3798ba[_0x6db5('0x5')](_0x39bc94)[_0x6db5('0x15')](_0x31ed45);};}exports[_0x6db5('0x16')]=function(_0x2dfd45,_0x5baf99){var _0x526b53={},_0x1a410c={},_0x3897b8={'count':0x0,'rows':[]};var _0x3b9b53=_[_0x6db5('0x17')](db[_0x6db5('0x18')][_0x6db5('0x19')],function(_0x52dad1){return{'name':_0x52dad1[_0x6db5('0x1a')],'type':_0x52dad1[_0x6db5('0x1b')][_0x6db5('0x1c')]};});_0x1a410c[_0x6db5('0x1d')]=_[_0x6db5('0x17')](_0x3b9b53,_0x6db5('0x14'));_0x1a410c[_0x6db5('0x1e')]=_[_0x6db5('0x1f')](_0x2dfd45[_0x6db5('0x1e')]);_0x1a410c[_0x6db5('0x20')]=_[_0x6db5('0x21')](_0x1a410c['model'],_0x1a410c['query']);_0x526b53[_0x6db5('0x22')]=_[_0x6db5('0x21')](_0x1a410c['model'],qs[_0x6db5('0x23')](_0x2dfd45[_0x6db5('0x1e')]['fields']));_0x526b53[_0x6db5('0x22')]=_0x526b53[_0x6db5('0x22')][_0x6db5('0x24')]?_0x526b53[_0x6db5('0x22')]:_0x1a410c['model'];if(!_0x2dfd45[_0x6db5('0x1e')][_0x6db5('0x25')](_0x6db5('0x26'))){_0x526b53[_0x6db5('0x9')]=qs[_0x6db5('0x9')](_0x2dfd45[_0x6db5('0x1e')][_0x6db5('0x9')]);_0x526b53[_0x6db5('0x7')]=qs['offset'](_0x2dfd45[_0x6db5('0x1e')]['offset']);}_0x526b53[_0x6db5('0x27')]=qs[_0x6db5('0x28')](_0x2dfd45[_0x6db5('0x1e')][_0x6db5('0x28')]);_0x526b53[_0x6db5('0x29')]=qs['filters'](_['pick'](_0x2dfd45[_0x6db5('0x1e')],_0x1a410c[_0x6db5('0x20')]),_0x3b9b53);if(_0x2dfd45[_0x6db5('0x1e')][_0x6db5('0x2a')]){_0x526b53['where']=_[_0x6db5('0x2b')](_0x526b53['where'],{'$or':_[_0x6db5('0x17')](_0x3b9b53,function(_0x288c18){if(_0x288c18[_0x6db5('0x1b')]!==_0x6db5('0x2c')){var _0x9b25c1={};_0x9b25c1[_0x288c18[_0x6db5('0x14')]]={'$like':'%'+_0x2dfd45[_0x6db5('0x1e')]['filter']+'%'};return _0x9b25c1;}})});}_0x526b53=_[_0x6db5('0x2b')]({},_0x526b53,_0x2dfd45[_0x6db5('0x2d')]);var _0x30bbac={'where':_0x526b53[_0x6db5('0x29')]};return db[_0x6db5('0x18')][_0x6db5('0xa')](_0x30bbac)[_0x6db5('0xe')](function(_0x3f3653){_0x3897b8[_0x6db5('0xa')]=_0x3f3653;if(_0x2dfd45[_0x6db5('0x1e')]['includeAll']){_0x526b53[_0x6db5('0x2e')]=[{'all':!![]}];}return db[_0x6db5('0x18')]['findAll'](_0x526b53);})[_0x6db5('0xe')](function(_0x567fd9){_0x3897b8[_0x6db5('0x2f')]=_0x567fd9;return _0x3897b8;})[_0x6db5('0xe')](respondWithFilteredResult(_0x5baf99,_0x526b53))[_0x6db5('0x30')](handleError(_0x5baf99,null));};exports['show']=function(_0x50cb6f,_0x2a114f){var _0x2264f6={'raw':![],'where':{'id':_0x50cb6f['params']['id']}},_0x5e574d={};_0x5e574d[_0x6db5('0x1d')]=_[_0x6db5('0x1f')](db[_0x6db5('0x18')]['rawAttributes']);_0x5e574d[_0x6db5('0x1e')]=_[_0x6db5('0x1f')](_0x50cb6f[_0x6db5('0x1e')]);_0x5e574d['filters']=_[_0x6db5('0x21')](_0x5e574d[_0x6db5('0x1d')],_0x5e574d[_0x6db5('0x1e')]);_0x2264f6[_0x6db5('0x22')]=_[_0x6db5('0x21')](_0x5e574d[_0x6db5('0x1d')],qs[_0x6db5('0x23')](_0x50cb6f['query'][_0x6db5('0x23')]));_0x2264f6[_0x6db5('0x22')]=_0x2264f6['attributes'][_0x6db5('0x24')]?_0x2264f6[_0x6db5('0x22')]:_0x5e574d[_0x6db5('0x1d')];if(_0x50cb6f[_0x6db5('0x1e')][_0x6db5('0x31')]){_0x2264f6[_0x6db5('0x2e')]=[{'all':!![]}];}_0x2264f6=_[_0x6db5('0x2b')]({},_0x2264f6,_0x50cb6f[_0x6db5('0x2d')]);return db[_0x6db5('0x18')]['find'](_0x2264f6)[_0x6db5('0xe')](handleEntityNotFound(_0x2a114f,null))[_0x6db5('0xe')](respondWithResult(_0x2a114f,null))['catch'](handleError(_0x2a114f,null));};exports[_0x6db5('0x32')]=function(_0x1659f7,_0x3f785){return db[_0x6db5('0x18')][_0x6db5('0x32')](_0x1659f7[_0x6db5('0x33')],{})['then'](respondWithResult(_0x3f785,0xc9))[_0x6db5('0x30')](handleError(_0x3f785,null));};exports['update']=function(_0x1bfaaf,_0xbc72cc){if(_0x1bfaaf[_0x6db5('0x33')]['id']){delete _0x1bfaaf['body']['id'];}return db['Dynamics365Account'][_0x6db5('0x34')]({'where':{'id':_0x1bfaaf[_0x6db5('0x35')]['id']}})[_0x6db5('0xe')](handleEntityNotFound(_0xbc72cc,null))['then'](saveUpdates(_0x1bfaaf[_0x6db5('0x33')],null))['then'](respondWithResult(_0xbc72cc,null))[_0x6db5('0x30')](handleError(_0xbc72cc,null));};exports[_0x6db5('0xf')]=function(_0x370037,_0x188f3a){return db['Dynamics365Account'][_0x6db5('0x34')]({'where':{'id':_0x370037[_0x6db5('0x35')]['id']}})[_0x6db5('0xe')](handleEntityNotFound(_0x188f3a,null))[_0x6db5('0xe')](removeEntity(_0x188f3a,null))['catch'](handleError(_0x188f3a,null));};exports['getConfigurations']=function(_0x308abc,_0x44f14e){var _0x295ea3={};var _0x3fb6e0={};var _0x539d22;var _0x389b4b;return db['Dynamics365Account'][_0x6db5('0x36')]({'where':{'id':_0x308abc['params']['id']}})[_0x6db5('0xe')](handleEntityNotFound(_0x44f14e,null))[_0x6db5('0xe')](function(_0x24cbcd){if(_0x24cbcd){_0x539d22=_0x24cbcd;_0x3fb6e0[_0x6db5('0x1d')]=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x3fb6e0[_0x6db5('0x1e')]=_['keys'](_0x308abc[_0x6db5('0x1e')]);_0x3fb6e0[_0x6db5('0x20')]=_[_0x6db5('0x21')](_0x3fb6e0[_0x6db5('0x1d')],_0x3fb6e0[_0x6db5('0x1e')]);_0x295ea3[_0x6db5('0x22')]=_['intersection'](_0x3fb6e0[_0x6db5('0x1d')],qs[_0x6db5('0x23')](_0x308abc[_0x6db5('0x1e')][_0x6db5('0x23')]));_0x295ea3[_0x6db5('0x22')]=_0x295ea3[_0x6db5('0x22')][_0x6db5('0x24')]?_0x295ea3[_0x6db5('0x22')]:_0x3fb6e0[_0x6db5('0x1d')];_0x295ea3[_0x6db5('0x27')]=qs[_0x6db5('0x28')](_0x308abc['query'][_0x6db5('0x28')]);_0x295ea3[_0x6db5('0x29')]=qs[_0x6db5('0x20')](_['pick'](_0x308abc[_0x6db5('0x1e')],_0x3fb6e0[_0x6db5('0x20')]));if(_0x308abc['query']['filter']){_0x295ea3[_0x6db5('0x29')]=_[_0x6db5('0x2b')](_0x295ea3['where'],{'$or':_['map'](_0x295ea3['attributes'],function(_0x3a6b53){var _0xc9db1c={};_0xc9db1c[_0x3a6b53]={'$like':'%'+_0x308abc[_0x6db5('0x1e')]['filter']+'%'};return _0xc9db1c;})});}_0x295ea3=_[_0x6db5('0x2b')]({},_0x295ea3,_0x308abc['options']);return _0x539d22[_0x6db5('0x37')](_0x295ea3);}})['then'](function(_0x4d8230){if(_0x4d8230){_0x389b4b=_0x4d8230['length'];if(!_0x308abc[_0x6db5('0x1e')]['hasOwnProperty']('nolimit')){_0x295ea3[_0x6db5('0x9')]=qs[_0x6db5('0x9')](_0x308abc['query'][_0x6db5('0x9')]);_0x295ea3[_0x6db5('0x7')]=qs[_0x6db5('0x7')](_0x308abc[_0x6db5('0x1e')][_0x6db5('0x7')]);}return _0x539d22[_0x6db5('0x37')](_0x295ea3);}})['then'](function(_0x54ef03){if(_0x54ef03){return _0x54ef03?{'count':_0x389b4b,'rows':_0x54ef03}:null;}})[_0x6db5('0xe')](respondWithResult(_0x44f14e,null))['catch'](handleError(_0x44f14e,null));};exports[_0x6db5('0x38')]=function(_0x3486f2,_0x2a4ef3){if(_0x3486f2[_0x6db5('0x33')]['id']){delete _0x3486f2['body']['id'];}return db[_0x6db5('0x18')][_0x6db5('0x36')]({'where':{'id':_0x3486f2[_0x6db5('0x35')]['id']}})['then'](handleEntityNotFound(_0x2a4ef3,null))['then'](function(_0x37f4e5){if(_0x37f4e5){_0x3486f2[_0x6db5('0x33')]['AccountId']=_0x37f4e5['id'];_0x3486f2[_0x6db5('0x33')][_0x6db5('0x39')]=integrations[_0x6db5('0x3a')](_0x3486f2[_0x6db5('0x33')][_0x6db5('0x3b')],_0x3486f2[_0x6db5('0x33')][_0x6db5('0x1b')]);_0x3486f2[_0x6db5('0x33')]['Descriptions']=integrations[_0x6db5('0x3c')](_0x3486f2[_0x6db5('0x33')][_0x6db5('0x3b')],_0x3486f2[_0x6db5('0x33')]['type']);return db['Dynamics365Configuration'][_0x6db5('0x32')](_0x3486f2[_0x6db5('0x33')],{'include':[{'model':db[_0x6db5('0x3d')],'as':_0x6db5('0x39')},{'model':db[_0x6db5('0x3d')],'as':_0x6db5('0x3e')}]});}return null;})['then'](respondWithResult(_0x2a4ef3,null))[_0x6db5('0x30')](handleError(_0x2a4ef3,null));};function sanitizeRemoteUri(_0x427dcb){var _0x4f3ada=_0x427dcb['slice'](-0x1);if(_0x4f3ada==='/')return _0x427dcb[_0x6db5('0x3f')](0x0,_0x427dcb[_0x6db5('0x40')](_0x4f3ada));return _0x427dcb;}function getWebApiUrl(_0x40e0bb){return util[_0x6db5('0x41')](_0x6db5('0x42'),_0x40e0bb);}exports['getFields']=function(_0x13720d,_0x3df77e){var _0x20acf4=_0x13720d[_0x6db5('0x1e')]['ticketType'];var _0x4bdb38=_0x20acf4===_0x6db5('0x43')?_0x6db5('0x44'):_0x6db5('0x45');var _0x4605bc='';var _0x464daf='';var _0x34718e='';var _0x4ae8b5='';var _0x51f12f='';var _0x5cf620='';var _0x29e5f2='';var _0xdfc3b6='';var _0x13deda=['title','description',_0x6db5('0x46'),'ownerid',_0x6db5('0x47'),_0x6db5('0x48'),_0x6db5('0x49'),_0x6db5('0x4a'),'directioncode',_0x6db5('0x4b')];var _0x32339d=[_0x6db5('0x4c'),_0x6db5('0x4d'),_0x6db5('0x4e'),_0x6db5('0x4f'),_0x6db5('0x50'),'contactidyominame',_0x6db5('0x51'),_0x6db5('0x52'),_0x6db5('0x53'),_0x6db5('0x54'),_0x6db5('0x55'),_0x6db5('0x56'),_0x6db5('0x57'),_0x6db5('0x58'),_0x6db5('0x59'),_0x6db5('0x5a'),_0x6db5('0x5b'),_0x6db5('0x5c'),_0x6db5('0x5d'),_0x6db5('0x5e'),_0x6db5('0x5f'),_0x6db5('0x60'),_0x6db5('0x61'),_0x6db5('0x62'),'firstresponsebykpiidname',_0x6db5('0x63'),_0x6db5('0x64'),_0x6db5('0x65'),_0x6db5('0x66'),_0x6db5('0x67'),'masteridname',_0x6db5('0x68'),_0x6db5('0x69'),_0x6db5('0x6a'),_0x6db5('0x6b'),_0x6db5('0x6c'),'modifiedonbehalfbyname',_0x6db5('0x6d'),_0x6db5('0x6e'),_0x6db5('0x6f'),'numberofchildincidents',_0x6db5('0x70'),'overriddencreatedon','owneridname',_0x6db5('0x71'),_0x6db5('0x72'),'parentcaseidname',_0x6db5('0x73'),_0x6db5('0x74'),_0x6db5('0x75'),'productidname',_0x6db5('0x76'),_0x6db5('0x77'),_0x6db5('0x78'),_0x6db5('0x79'),_0x6db5('0x7a'),_0x6db5('0x7b'),'sentimentvalue',_0x6db5('0x7c'),_0x6db5('0x7d'),'socialprofileidname',_0x6db5('0x7e'),_0x6db5('0x7f'),_0x6db5('0x80'),'ticketnumber',_0x6db5('0x81'),_0x6db5('0x82'),_0x6db5('0x83'),_0x6db5('0x84'),_0x6db5('0x85')];var _0x288570=_0x13deda[_0x6db5('0x86')](_0x32339d);return db[_0x6db5('0x18')][_0x6db5('0x36')]({'where':{'id':_0x13720d[_0x6db5('0x35')]['id']},'attributes':['id','username',_0x6db5('0x87'),_0x6db5('0x88'),_0x6db5('0x89'),_0x6db5('0x8a'),_0x6db5('0x8b'),_0x6db5('0x8c')],'include':[{'model':db[_0x6db5('0x8d')],'as':_0x6db5('0x8d'),'attributes':['id',_0x6db5('0x8e'),_0x6db5('0x8f')]}]})[_0x6db5('0xe')](handleEntityNotFound(_0x3df77e,null))['then'](function(_0x419a67){if(_0x419a67){if(_0x419a67[_0x6db5('0x8c')]){_0x419a67[_0x6db5('0x90')]=_0x419a67[_0x6db5('0x8d')]['data5'];_0xdfc3b6=sanitizeRemoteUri(_0x419a67[_0x6db5('0x8d')]['data7']);_0x29e5f2=getWebApiUrl(_0xdfc3b6);return _0x419a67;}_0xdfc3b6=sanitizeRemoteUri(_0x419a67['remoteUri']);_0x29e5f2=getWebApiUrl(_0xdfc3b6);var _0x39e120={'method':_0x6db5('0x91'),'uri':_0x6db5('0x92')+_0x419a67[_0x6db5('0x89')]+_0x6db5('0x93'),'form':{'client_id':_0x419a67[_0x6db5('0x8a')],'resource':_0xdfc3b6,'username':_0x419a67[_0x6db5('0x94')],'password':_0x419a67[_0x6db5('0x87')],'grant_type':_0x6db5('0x87'),'client_secret':_0x419a67['clientSecret']},'json':!![]};return rp(_0x39e120);}})[_0x6db5('0xe')](function(_0x589eeb){_0x5cf620=_0x589eeb[_0x6db5('0x90')];var _0x29257f={'method':_0x6db5('0x95'),'uri':encodeURI(_0x29e5f2+_0x6db5('0x96')+_0x4bdb38+'\x27'),'headers':{'Authorization':_0x6db5('0x97')+_0x5cf620,'If-None-Match':null,'OData-Version':_0x6db5('0x98')},'json':!![]};return rp(_0x29257f);})[_0x6db5('0xe')](function(_0x7113f6){var _0x4ecbe6=_0x7113f6['value'][0x0];var _0x17c49b=_0x4ecbe6[_0x6db5('0x99')];var _0x53dbb6={'method':_0x6db5('0x95'),'uri':_0x29e5f2+_0x6db5('0x9a')+_0x17c49b+_0x6db5('0x9b'),'headers':{'Authorization':_0x6db5('0x97')+_0x5cf620,'If-None-Match':null,'OData-Version':_0x6db5('0x98')},'json':!![]};return rp(_0x53dbb6);})[_0x6db5('0xe')](function(_0x5a4472){_0x4605bc=_0x5a4472;_0x464daf=_0x4605bc['Attributes'];_0x464daf=_[_0x6db5('0x9c')](_0x464daf,function(_0x346121){return!_0x288570[_0x6db5('0x9d')](_0x346121[_0x6db5('0x9e')]);});var _0x211198=[];var _0x3887b7=[];_0x464daf[_0x6db5('0x9f')](function(_0x1c01b1){if(_0x1c01b1[_0x6db5('0xa0')]){var _0x5aa3e6=_0x1c01b1['@odata.type']['substring'](_0x1c01b1[_0x6db5('0xa0')]['lastIndexOf']('.')+0x1);if(_0x5aa3e6===_0x6db5('0xa1')){_0x211198[_0x6db5('0xa2')](getSelectList(_0x29e5f2,_0x20acf4,_0x3887b7,_0x4605bc['MetadataId'],_0x1c01b1[_0x6db5('0x99')],_0x5cf620));}}});return Promise[_0x6db5('0xa3')](_0x211198);})[_0x6db5('0xe')](function(_0x434ea5){_0x34718e=_0x434ea5[0x0];var _0x344799=[];var _0x2b1262=[];_0x464daf[_0x6db5('0x9f')](function(_0x1e2f23){if(!_['isNil'](_0x1e2f23[_0x6db5('0xa0')])){var _0x581c61=_0x1e2f23[_0x6db5('0xa0')][_0x6db5('0x3f')](_0x1e2f23[_0x6db5('0xa0')][_0x6db5('0x40')]('.')+0x1);if(_0x581c61==='BooleanAttributeMetadata'){_0x344799['push'](getBooleanList(_0x29e5f2,_0x20acf4,_0x2b1262,_0x4605bc[_0x6db5('0x99')],_0x1e2f23[_0x6db5('0x99')],_0x5cf620));}}});return Promise[_0x6db5('0xa3')](_0x344799);})[_0x6db5('0xe')](function(_0x10ccb2){_0x4ae8b5=_0x10ccb2[0x0];var _0x40332a=[];var _0x58a5fe=[];_0x464daf[_0x6db5('0x9f')](function(_0x52bb49){if(_0x52bb49[_0x6db5('0xa0')]){var _0x44bc0f=_0x52bb49[_0x6db5('0xa0')][_0x6db5('0x3f')](_0x52bb49[_0x6db5('0xa0')][_0x6db5('0x40')]('.')+0x1);if(_0x44bc0f==='StringAttributeMetadata'||_0x44bc0f==='DoubleAttributeMetadata'||_0x44bc0f===_0x6db5('0xa4')||_0x44bc0f==='IntegerAttributeMetadata'||_0x44bc0f==='MemoAttributeMetadata'||_0x44bc0f===_0x6db5('0xa5')||_0x44bc0f===_0x6db5('0xa6')||_0x44bc0f===_0x6db5('0xa7')||_0x44bc0f===_0x6db5('0xa8')||_0x44bc0f===_0x6db5('0xa9')){_0x40332a[_0x6db5('0xa2')](getInputList(_0x29e5f2,_0x20acf4,_0x44bc0f,_0x58a5fe,_0x4605bc[_0x6db5('0x99')],_0x52bb49['MetadataId'],_0x5cf620));}}});return Promise[_0x6db5('0xa3')](_0x40332a);})[_0x6db5('0xe')](function(_0xe7defa){_0x51f12f=_0xe7defa[0x0];var _0x22893f=_0x34718e[_0x6db5('0x86')](_0x4ae8b5)['concat'](_0x51f12f);var _0x1e2540={'count':_0x22893f['length'],'rows':_0x22893f};return _0x1e2540;})[_0x6db5('0xe')](respondWithResult(_0x3df77e,null))[_0x6db5('0x30')](function(_0x363deb){var _0x2f6425=_0x13720d[_0x6db5('0x1e')][_0x6db5('0xaa')]?0x1f4:_0x363deb[_0x6db5('0xab')]||0x1f4;logger['error'](_0x363deb[_0x6db5('0x13')]);delete _0x363deb['name'];if(_0x2f6425===0x191){_0x2f6425=0x190;}_0x3df77e[_0x6db5('0x5')](_0x2f6425)[_0x6db5('0x15')](_0x13720d[_0x6db5('0x1e')][_0x6db5('0xaa')]?{'message':_0x6db5('0xac'),'statusCode':_0x363deb[_0x6db5('0xab')]}:_0x363deb);});};function getSelectList(_0xb321db,_0x63dcc9,_0x1cc87f,_0x2701c9,_0x277d5f,_0x4e40a0){var _0x4391a7={'method':_0x6db5('0x95'),'uri':_0xb321db+_0x6db5('0x9a')+_0x2701c9+_0x6db5('0xad')+_0x277d5f+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x6db5('0xae'),'headers':{'Authorization':'Bearer\x20'+_0x4e40a0,'If-None-Match':null,'OData-Version':_0x6db5('0x98')},'json':!![]};return rp(_0x4391a7)['then'](function(_0x29f4ac){var _0x44b6b0=[];var _0x541094=_0x29f4ac['OptionSet'][_0x6db5('0xaf')];_0x541094[_0x6db5('0x9f')](function(_0x5dd450){_0x44b6b0[_0x6db5('0xa2')]({'name':_0x5dd450[_0x6db5('0xb0')]['UserLocalizedLabel']['Label'],'value':String(_0x5dd450['Value'])});});var _0x488eeb={'id':_0x63dcc9+'_'+_0x29f4ac[_0x6db5('0x9e')],'name':_0x29f4ac[_0x6db5('0xb1')][_0x6db5('0xb2')][_0x6db5('0xb0')],'custom':![],'options':_0x44b6b0};_0x1cc87f[_0x6db5('0xa2')](_0x488eeb);return _0x1cc87f;});}function getBooleanList(_0x3c28ce,_0x3c2c75,_0x3bf38e,_0x4b1cde,_0xe7349d,_0x5e5c5a){var _0x58949e={'method':'GET','uri':_0x3c28ce+'EntityDefinitions('+_0x4b1cde+_0x6db5('0xad')+_0xe7349d+_0x6db5('0xb3'),'headers':{'Authorization':_0x6db5('0x97')+_0x5e5c5a,'If-None-Match':null,'OData-Version':_0x6db5('0x98')},'json':!![]};return rp(_0x58949e)[_0x6db5('0xe')](function(_0x22f562){var _0x307f06=[];_0x307f06[_0x6db5('0xa2')]({'name':_0x22f562[_0x6db5('0xb4')][_0x6db5('0xb5')][_0x6db5('0xb0')][_0x6db5('0xb2')]['Label'],'value':_0x6db5('0xb6')},{'name':_0x22f562[_0x6db5('0xb4')][_0x6db5('0xb7')][_0x6db5('0xb0')]['UserLocalizedLabel'][_0x6db5('0xb0')],'value':_0x6db5('0xb8')});var _0x2518f4={'id':_0x3c2c75+'_'+_0x22f562[_0x6db5('0x9e')],'name':_0x22f562[_0x6db5('0xb1')][_0x6db5('0xb2')]['Label'],'custom':![],'options':_0x307f06};_0x3bf38e[_0x6db5('0xa2')](_0x2518f4);return _0x3bf38e;});}function getInputList(_0x154224,_0x16d367,_0x151271,_0x5390fa,_0x4b3957,_0x49d1b8,_0x220905){var _0x4e1989={'method':_0x6db5('0x95'),'uri':_0x154224+_0x6db5('0x9a')+_0x4b3957+_0x6db5('0xad')+_0x49d1b8+')/Microsoft.Dynamics.CRM.'+_0x151271+_0x6db5('0xb9'),'headers':{'Authorization':'Bearer\x20'+_0x220905,'If-None-Match':null,'OData-Version':_0x6db5('0x98')},'json':!![]};return rp(_0x4e1989)[_0x6db5('0xe')](function(_0x5346b5){var _0xf42cbf={'id':_0x16d367+'_'+_0x5346b5[_0x6db5('0x9e')],'name':_0x5346b5[_0x6db5('0xb1')][_0x6db5('0xb2')]?_0x5346b5[_0x6db5('0xb1')]['UserLocalizedLabel'][_0x6db5('0xb0')]:_0x5346b5['LogicalName'],'custom':![],'options':[]};_0x5390fa[_0x6db5('0xa2')](_0xf42cbf);return _0x5390fa;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 3ef92c8..f5b163a 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x379ea5,_0x256e44){var _0x33971c=function(_0x3871b8){while(--_0x3871b8){_0x379ea5['push'](_0x379ea5['shift']());}};_0x33971c(++_0x256e44);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x16fad3,_0x561e36){var _0x556122=function(_0x24bb10){while(--_0x24bb10){_0x16fad3['push'](_0x16fad3['shift']());}};_0x556122(++_0x561e36);}(_0x757a,0xde));var _0xa757=function(_0x1ed6d5,_0x57cbd3){_0x1ed6d5=_0x1ed6d5-0x0;var _0x17cd78=_0x757a[_0x1ed6d5];return _0x17cd78;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 04df37c..dd911d1 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js +++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d3f=['then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','request\x20sent','result','catch','Dynamics365Account','options','raw','attributes','limit','include','map','model','GetDynamics365Account','find','ShowDynamics365Account','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x230d3f,_0x1b74e6){var _0x36fcc7=function(_0x44ad44){while(--_0x44ad44){_0x230d3f['push'](_0x230d3f['shift']());}};_0x36fcc7(++_0x1b74e6);}(_0x3d3f,0x9b));var _0xf3d3=function(_0x5b8e9f,_0x20def9){_0x5b8e9f=_0x5b8e9f-0x0;var _0x367af0=_0x3d3f[_0x5b8e9f];return _0x367af0;};'use strict';var _=require(_0xf3d3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf3d3('0x1'));var fs=require('fs');var Redis=require(_0xf3d3('0x2'));var db=require(_0xf3d3('0x3'))['db'];var utils=require(_0xf3d3('0x4'));var logger=require('../../config/logger')(_0xf3d3('0x5'));var config=require('../../config/environment');var jayson=require(_0xf3d3('0x6'));var client=jayson[_0xf3d3('0x7')][_0xf3d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18d8f8,_0x5d4786,_0x34280c){return new BPromise(function(_0x23e89,_0x16eea8){return client[_0xf3d3('0x9')](_0x18d8f8,_0x34280c)[_0xf3d3('0xa')](function(_0xda916c){logger[_0xf3d3('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x5d4786,'request\x20sent');logger[_0xf3d3('0xc')](_0xf3d3('0xd'),_0x5d4786,'request\x20sent',JSON[_0xf3d3('0xe')](_0xda916c));if(_0xda916c[_0xf3d3('0xf')]){if(_0xda916c[_0xf3d3('0xf')][_0xf3d3('0x10')]===0x1f4){logger[_0xf3d3('0xf')](_0xf3d3('0x11'),_0x5d4786,_0xda916c[_0xf3d3('0xf')][_0xf3d3('0x12')]);return _0x16eea8(_0xda916c['error'][_0xf3d3('0x12')]);}logger[_0xf3d3('0xf')](_0xf3d3('0x11'),_0x5d4786,_0xda916c[_0xf3d3('0xf')][_0xf3d3('0x12')]);return _0x23e89(_0xda916c[_0xf3d3('0xf')][_0xf3d3('0x12')]);}else{logger[_0xf3d3('0xb')](_0xf3d3('0x11'),_0x5d4786,_0xf3d3('0x13'));_0x23e89(_0xda916c[_0xf3d3('0x14')][_0xf3d3('0x12')]);}})[_0xf3d3('0x15')](function(_0x221d88){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5d4786,_0x221d88);_0x16eea8(_0x221d88);});});}exports['GetDynamics365Account']=function(_0x36c66f){var _0x2d4c6a=this;return new Promise(function(_0x34d584,_0x5d5fc2){return db[_0xf3d3('0x16')]['findAll']({'raw':_0x36c66f[_0xf3d3('0x17')]?_0x36c66f[_0xf3d3('0x17')][_0xf3d3('0x18')]===undefined?!![]:![]:!![],'where':_0x36c66f[_0xf3d3('0x17')]?_0x36c66f['options']['where']||null:null,'attributes':_0x36c66f[_0xf3d3('0x17')]?_0x36c66f['options'][_0xf3d3('0x19')]||null:null,'limit':_0x36c66f[_0xf3d3('0x17')]?_0x36c66f[_0xf3d3('0x17')][_0xf3d3('0x1a')]||null:null,'include':_0x36c66f[_0xf3d3('0x17')]?_0x36c66f[_0xf3d3('0x17')][_0xf3d3('0x1b')]?_[_0xf3d3('0x1c')](_0x36c66f[_0xf3d3('0x17')]['include'],function(_0x4daa2d){return{'model':db[_0x4daa2d[_0xf3d3('0x1d')]],'as':_0x4daa2d['as'],'attributes':_0x4daa2d[_0xf3d3('0x19')],'include':_0x4daa2d[_0xf3d3('0x1b')]?_[_0xf3d3('0x1c')](_0x4daa2d['include'],function(_0x2192b2){return{'model':db[_0x2192b2[_0xf3d3('0x1d')]],'as':_0x2192b2['as'],'attributes':_0x2192b2[_0xf3d3('0x19')],'include':_0x2192b2[_0xf3d3('0x1b')]?_[_0xf3d3('0x1c')](_0x2192b2[_0xf3d3('0x1b')],function(_0x25483b){return{'model':db[_0x25483b['model']],'as':_0x25483b['as'],'attributes':_0x25483b[_0xf3d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf3d3('0xa')](function(_0x1814de){logger[_0xf3d3('0xb')](_0xf3d3('0x1e'),_0x36c66f);logger[_0xf3d3('0xc')]('GetDynamics365Account',_0x36c66f,JSON[_0xf3d3('0xe')](_0x1814de));_0x34d584(_0x1814de);})[_0xf3d3('0x15')](function(_0xe4449f){logger['error'](_0xf3d3('0x1e'),_0xe4449f[_0xf3d3('0x12')],_0x36c66f);_0x5d5fc2(_0x2d4c6a['error'](0x1f4,_0xe4449f[_0xf3d3('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x5a3b30){var _0x235524=this;return new Promise(function(_0x3910dc,_0x427518){return db[_0xf3d3('0x16')][_0xf3d3('0x1f')]({'raw':_0x5a3b30[_0xf3d3('0x17')]?_0x5a3b30[_0xf3d3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5a3b30[_0xf3d3('0x17')]?_0x5a3b30[_0xf3d3('0x17')]['where']||null:null,'attributes':_0x5a3b30[_0xf3d3('0x17')]?_0x5a3b30[_0xf3d3('0x17')]['attributes']||null:null,'include':_0x5a3b30[_0xf3d3('0x17')]?_0x5a3b30[_0xf3d3('0x17')][_0xf3d3('0x1b')]?_[_0xf3d3('0x1c')](_0x5a3b30[_0xf3d3('0x17')][_0xf3d3('0x1b')],function(_0x4a9c02){return{'model':db[_0x4a9c02[_0xf3d3('0x1d')]],'as':_0x4a9c02['as'],'attributes':_0x4a9c02['attributes'],'include':_0x4a9c02['include']?_['map'](_0x4a9c02[_0xf3d3('0x1b')],function(_0x3e3004){return{'model':db[_0x3e3004[_0xf3d3('0x1d')]],'as':_0x3e3004['as'],'attributes':_0x3e3004[_0xf3d3('0x19')],'include':_0x3e3004['include']?_[_0xf3d3('0x1c')](_0x3e3004[_0xf3d3('0x1b')],function(_0xf09a54){return{'model':db[_0xf09a54[_0xf3d3('0x1d')]],'as':_0xf09a54['as'],'attributes':_0xf09a54['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a7451){logger[_0xf3d3('0xb')]('ShowDynamics365Account',_0x5a3b30);logger[_0xf3d3('0xc')](_0xf3d3('0x20'),_0x5a3b30,JSON[_0xf3d3('0xe')](_0x3a7451));_0x3910dc(_0x3a7451);})[_0xf3d3('0x15')](function(_0x2bc543){logger[_0xf3d3('0xf')]('ShowDynamics365Account',_0x2bc543[_0xf3d3('0x12')],_0x5a3b30);_0x427518(_0x235524[_0xf3d3('0xf')](0x1f4,_0x2bc543[_0xf3d3('0x12')]));});});}; \ No newline at end of file +var _0x4b86=['options','raw','where','attributes','limit','map','include','model','ShowDynamics365Account','find','then','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','request','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0x4b86,0x1e7));var _0x64b8=function(_0x3e6898,_0x25681e){_0x3e6898=_0x3e6898-0x0;var _0x419360=_0x4b86[_0x3e6898];return _0x419360;};'use strict';var _=require(_0x64b8('0x0'));var util=require('util');var moment=require(_0x64b8('0x1'));var BPromise=require(_0x64b8('0x2'));var rs=require(_0x64b8('0x3'));var fs=require('fs');var Redis=require(_0x64b8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x64b8('0x5'))('rpc');var config=require(_0x64b8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x64b8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x739f10,_0x1e0031,_0x472018){return new BPromise(function(_0x4e253d,_0x1bacbd){return client[_0x64b8('0x8')](_0x739f10,_0x472018)['then'](function(_0x475bce){logger[_0x64b8('0x9')](_0x64b8('0xa'),_0x1e0031,'request\x20sent');logger[_0x64b8('0xb')](_0x64b8('0xc'),_0x1e0031,_0x64b8('0xd'),JSON[_0x64b8('0xe')](_0x475bce));if(_0x475bce[_0x64b8('0xf')]){if(_0x475bce[_0x64b8('0xf')][_0x64b8('0x10')]===0x1f4){logger[_0x64b8('0xf')](_0x64b8('0xa'),_0x1e0031,_0x475bce[_0x64b8('0xf')]['message']);return _0x1bacbd(_0x475bce[_0x64b8('0xf')]['message']);}logger['error'](_0x64b8('0xa'),_0x1e0031,_0x475bce[_0x64b8('0xf')][_0x64b8('0x11')]);return _0x4e253d(_0x475bce['error']['message']);}else{logger[_0x64b8('0x9')](_0x64b8('0xa'),_0x1e0031,'request\x20sent');_0x4e253d(_0x475bce[_0x64b8('0x12')]['message']);}})[_0x64b8('0x13')](function(_0x2ad2fa){logger[_0x64b8('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x1e0031,_0x2ad2fa);_0x1bacbd(_0x2ad2fa);});});}exports[_0x64b8('0x14')]=function(_0x2e562e){var _0x6e8aa3=this;return new Promise(function(_0x179721,_0x3ca102){return db[_0x64b8('0x15')][_0x64b8('0x16')]({'raw':_0x2e562e[_0x64b8('0x17')]?_0x2e562e[_0x64b8('0x17')][_0x64b8('0x18')]===undefined?!![]:![]:!![],'where':_0x2e562e[_0x64b8('0x17')]?_0x2e562e['options'][_0x64b8('0x19')]||null:null,'attributes':_0x2e562e['options']?_0x2e562e['options'][_0x64b8('0x1a')]||null:null,'limit':_0x2e562e[_0x64b8('0x17')]?_0x2e562e[_0x64b8('0x17')][_0x64b8('0x1b')]||null:null,'include':_0x2e562e[_0x64b8('0x17')]?_0x2e562e['options']['include']?_[_0x64b8('0x1c')](_0x2e562e[_0x64b8('0x17')][_0x64b8('0x1d')],function(_0x475dc3){return{'model':db[_0x475dc3[_0x64b8('0x1e')]],'as':_0x475dc3['as'],'attributes':_0x475dc3[_0x64b8('0x1a')],'include':_0x475dc3['include']?_[_0x64b8('0x1c')](_0x475dc3[_0x64b8('0x1d')],function(_0x272c08){return{'model':db[_0x272c08[_0x64b8('0x1e')]],'as':_0x272c08['as'],'attributes':_0x272c08[_0x64b8('0x1a')],'include':_0x272c08[_0x64b8('0x1d')]?_[_0x64b8('0x1c')](_0x272c08['include'],function(_0xa715aa){return{'model':db[_0xa715aa[_0x64b8('0x1e')]],'as':_0xa715aa['as'],'attributes':_0xa715aa[_0x64b8('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x579875){logger[_0x64b8('0x9')](_0x64b8('0x14'),_0x2e562e);logger['debug'](_0x64b8('0x14'),_0x2e562e,JSON[_0x64b8('0xe')](_0x579875));_0x179721(_0x579875);})[_0x64b8('0x13')](function(_0x77759c){logger['error'](_0x64b8('0x14'),_0x77759c[_0x64b8('0x11')],_0x2e562e);_0x3ca102(_0x6e8aa3[_0x64b8('0xf')](0x1f4,_0x77759c['message']));});});};exports[_0x64b8('0x1f')]=function(_0x3572b5){var _0x34c222=this;return new Promise(function(_0x23f943,_0x27de2b){return db[_0x64b8('0x15')][_0x64b8('0x20')]({'raw':_0x3572b5['options']?_0x3572b5[_0x64b8('0x17')][_0x64b8('0x18')]===undefined?!![]:![]:!![],'where':_0x3572b5['options']?_0x3572b5[_0x64b8('0x17')]['where']||null:null,'attributes':_0x3572b5[_0x64b8('0x17')]?_0x3572b5[_0x64b8('0x17')][_0x64b8('0x1a')]||null:null,'include':_0x3572b5[_0x64b8('0x17')]?_0x3572b5[_0x64b8('0x17')][_0x64b8('0x1d')]?_[_0x64b8('0x1c')](_0x3572b5['options']['include'],function(_0x51744a){return{'model':db[_0x51744a[_0x64b8('0x1e')]],'as':_0x51744a['as'],'attributes':_0x51744a[_0x64b8('0x1a')],'include':_0x51744a[_0x64b8('0x1d')]?_[_0x64b8('0x1c')](_0x51744a[_0x64b8('0x1d')],function(_0x52bdae){return{'model':db[_0x52bdae[_0x64b8('0x1e')]],'as':_0x52bdae['as'],'attributes':_0x52bdae[_0x64b8('0x1a')],'include':_0x52bdae[_0x64b8('0x1d')]?_[_0x64b8('0x1c')](_0x52bdae[_0x64b8('0x1d')],function(_0x43fb21){return{'model':db[_0x43fb21['model']],'as':_0x43fb21['as'],'attributes':_0x43fb21[_0x64b8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x64b8('0x21')](function(_0x40494b){logger[_0x64b8('0x9')]('ShowDynamics365Account',_0x3572b5);logger[_0x64b8('0xb')](_0x64b8('0x1f'),_0x3572b5,JSON[_0x64b8('0xe')](_0x40494b));_0x23f943(_0x40494b);})[_0x64b8('0x13')](function(_0x4cdc86){logger[_0x64b8('0xf')]('ShowDynamics365Account',_0x4cdc86[_0x64b8('0x11')],_0x3572b5);_0x27de2b(_0x34c222[_0x64b8('0xf')](0x1f4,_0x4cdc86[_0x64b8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index d89a1aa..406c058 100644 --- a/server/api/intDynamics365Configuration/index.js +++ b/server/api/intDynamics365Configuration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcf1=['/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x39cf10,_0x5a1eab){var _0x1c9969=function(_0x285fc2){while(--_0x285fc2){_0x39cf10['push'](_0x39cf10['shift']());}};_0x1c9969(++_0x5a1eab);}(_0xbcf1,0x97));var _0x1bcf=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0xbcf1[_0x2390bd];return _0x3a969d;};'use strict';var multer=require(_0x1bcf('0x0'));var util=require('util');var path=require(_0x1bcf('0x1'));var timeout=require(_0x1bcf('0x2'));var express=require(_0x1bcf('0x3'));var router=express[_0x1bcf('0x4')]();var fs_extra=require(_0x1bcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1bcf('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0x1bcf('0x7')]('/',auth[_0x1bcf('0x8')](),controller[_0x1bcf('0x9')]);router[_0x1bcf('0x7')](_0x1bcf('0xa'),auth[_0x1bcf('0x8')](),controller[_0x1bcf('0xb')]);router['get'](_0x1bcf('0xc'),auth['isAuthenticated'](),controller[_0x1bcf('0xd')]);router[_0x1bcf('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x1bcf('0x7')](_0x1bcf('0xe'),auth[_0x1bcf('0x8')](),controller[_0x1bcf('0xf')]);router[_0x1bcf('0x10')]('/',auth[_0x1bcf('0x8')](),controller[_0x1bcf('0x11')]);router[_0x1bcf('0x12')](_0x1bcf('0xa'),auth[_0x1bcf('0x8')](),controller[_0x1bcf('0x13')]);router[_0x1bcf('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1bcf('0x15')]);module[_0x1bcf('0x16')]=router; \ No newline at end of file +var _0x33d0=['exports','multer','path','Router','fs-extra','../../config/environment','./intDynamics365Configuration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','update','delete','destroy'];(function(_0x50b8b2,_0xd7ad89){var _0x2b7810=function(_0x51bcfd){while(--_0x51bcfd){_0x50b8b2['push'](_0x50b8b2['shift']());}};_0x2b7810(++_0xd7ad89);}(_0x33d0,0x99));var _0x033d=function(_0x39b30a,_0x12715f){_0x39b30a=_0x39b30a-0x0;var _0x9d98a=_0x33d0[_0x39b30a];return _0x9d98a;};'use strict';var multer=require(_0x033d('0x0'));var util=require('util');var path=require(_0x033d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x033d('0x2')]();var fs_extra=require(_0x033d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x033d('0x4'));var controller=require(_0x033d('0x5'));router[_0x033d('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x033d('0x6')](_0x033d('0x7'),auth[_0x033d('0x8')](),controller[_0x033d('0x9')]);router[_0x033d('0x6')](_0x033d('0xa'),auth[_0x033d('0x8')](),controller[_0x033d('0xb')]);router[_0x033d('0x6')](_0x033d('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x033d('0xd'),auth[_0x033d('0x8')](),controller[_0x033d('0xe')]);router['post']('/',auth[_0x033d('0x8')](),controller['create']);router['put']('/:id',auth[_0x033d('0x8')](),controller[_0x033d('0xf')]);router[_0x033d('0x10')](_0x033d('0x7'),auth['isAuthenticated'](),controller[_0x033d('0x11')]);module[_0x033d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index d5cba93..87719d4 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65fa=['nothing','BOOLEAN','sequelize','STRING','ENUM','incident','phonecall','contact'];(function(_0x5e72a2,_0x4faa18){var _0x1d406a=function(_0x2bb971){while(--_0x2bb971){_0x5e72a2['push'](_0x5e72a2['shift']());}};_0x1d406a(++_0x4faa18);}(_0x65fa,0x82));var _0xa65f=function(_0x3ab763,_0x8ea605){_0x3ab763=_0x3ab763-0x0;var _0x58e772=_0x65fa[_0x3ab763];return _0x58e772;};'use strict';var Sequelize=require(_0xa65f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa65f('0x1')]},'description':{'type':Sequelize[_0xa65f('0x1')]},'ticketType':{'type':Sequelize[_0xa65f('0x2')](_0xa65f('0x3'),_0xa65f('0x4')),'defaultValue':_0xa65f('0x3')},'moduleCreate':{'type':Sequelize[_0xa65f('0x2')](_0xa65f('0x5'),_0xa65f('0x6')),'defaultValue':_0xa65f('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xa65f('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xa65f('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3544=['contact','BOOLEAN','sequelize','exports','STRING','ENUM','incident'];(function(_0x2bcc6d,_0x5347ac){var _0x337411=function(_0x4593c3){while(--_0x4593c3){_0x2bcc6d['push'](_0x2bcc6d['shift']());}};_0x337411(++_0x5347ac);}(_0x3544,0x72));var _0x4354=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x3544[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require(_0x4354('0x0'));module[_0x4354('0x1')]={'name':{'type':Sequelize[_0x4354('0x2')]},'description':{'type':Sequelize[_0x4354('0x2')]},'ticketType':{'type':Sequelize[_0x4354('0x3')](_0x4354('0x4'),'phonecall'),'defaultValue':_0x4354('0x4')},'moduleCreate':{'type':Sequelize[_0x4354('0x3')]('contact','nothing'),'defaultValue':_0x4354('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x4354('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x4354('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 336a1ae..bbb6d6b 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea51=['fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','then','catch','show','params','length','find','create','body','destroy','Dynamics365Field','getFields','getSubjects','findOne','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x16c9c5,_0x403b16){var _0x378a9c=function(_0x2b3dbc){while(--_0x2b3dbc){_0x16c9c5['push'](_0x16c9c5['shift']());}};_0x378a9c(++_0x403b16);}(_0xea51,0x1b7));var _0x1ea5=function(_0xbedaaf,_0x4b3f68){_0xbedaaf=_0xbedaaf-0x0;var _0x322867=_0xea51[_0xbedaaf];return _0x322867;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ea5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ea5('0x1'));var rp=require(_0x1ea5('0x2'));var moment=require(_0x1ea5('0x3'));var BPromise=require(_0x1ea5('0x4'));var Mustache=require(_0x1ea5('0x5'));var util=require('util');var path=require(_0x1ea5('0x6'));var sox=require(_0x1ea5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ea5('0x8'));var _=require('lodash');var squel=require(_0x1ea5('0x9'));var crypto=require(_0x1ea5('0xa'));var jsforce=require(_0x1ea5('0xb'));var deskjs=require(_0x1ea5('0xc'));var toCsv=require(_0x1ea5('0xd'));var querystring=require(_0x1ea5('0xe'));var Papa=require(_0x1ea5('0xf'));var Redis=require(_0x1ea5('0x10'));var authService=require(_0x1ea5('0x11'));var qs=require(_0x1ea5('0x12'));var as=require(_0x1ea5('0x13'));var hardwareService=require(_0x1ea5('0x14'));var logger=require(_0x1ea5('0x15'))(_0x1ea5('0x16'));var utils=require(_0x1ea5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ea5('0x18'));var db=require(_0x1ea5('0x19'))['db'];function respondWithStatusCode(_0x155dfc,_0x2ca9f3){_0x2ca9f3=_0x2ca9f3||0xcc;return function(_0x150b76){if(_0x150b76){return _0x155dfc[_0x1ea5('0x1a')](_0x2ca9f3);}return _0x155dfc[_0x1ea5('0x1b')](_0x2ca9f3)[_0x1ea5('0x1c')]();};}function respondWithResult(_0x5117d1,_0x5c0fe0){_0x5c0fe0=_0x5c0fe0||0xc8;return function(_0x290eb9){if(_0x290eb9){return _0x5117d1['status'](_0x5c0fe0)[_0x1ea5('0x1d')](_0x290eb9);}};}function respondWithFilteredResult(_0x1c6c01,_0x10bdae){return function(_0x4c0bcb){if(_0x4c0bcb){var _0x572cde=typeof _0x10bdae[_0x1ea5('0x1e')]===_0x1ea5('0x1f')&&typeof _0x10bdae[_0x1ea5('0x20')]===_0x1ea5('0x1f');var _0x3588ca=_0x4c0bcb[_0x1ea5('0x21')];var _0x8e90bb=_0x572cde?0x0:_0x10bdae[_0x1ea5('0x1e')];var _0x3f7746=_0x572cde?_0x4c0bcb[_0x1ea5('0x21')]:_0x10bdae['offset']+_0x10bdae['limit'];var _0x3f2ae8;if(_0x3f7746>=_0x3588ca){_0x3f7746=_0x3588ca;_0x3f2ae8=0xc8;}else{_0x3f2ae8=0xce;}_0x1c6c01[_0x1ea5('0x1b')](_0x3f2ae8);return _0x1c6c01['set'](_0x1ea5('0x22'),_0x8e90bb+'-'+_0x3f7746+'/'+_0x3588ca)[_0x1ea5('0x1d')](_0x4c0bcb);}return null;};}function patchUpdates(_0x9cf270){return function(_0x322db7){try{jsonpatch['apply'](_0x322db7,_0x9cf270,!![]);}catch(_0x48b95d){return BPromise[_0x1ea5('0x23')](_0x48b95d);}return _0x322db7[_0x1ea5('0x24')]();};}function saveUpdates(_0x298fe6,_0x10390b){return function(_0x528423){if(_0x528423){return _0x528423[_0x1ea5('0x25')](_0x298fe6)['then'](function(_0x8c6cae){return _0x8c6cae;});}return null;};}function removeEntity(_0x3398d5,_0x5d61db){return function(_0x30f575){if(_0x30f575){return _0x30f575['destroy']()['then'](function(){_0x3398d5['status'](0xcc)[_0x1ea5('0x1c')]();});}};}function handleEntityNotFound(_0x22b0bd,_0x5778b9){return function(_0x41444c){if(!_0x41444c){_0x22b0bd[_0x1ea5('0x1a')](0x194);}return _0x41444c;};}function handleError(_0x541073,_0x2d4c5a){_0x2d4c5a=_0x2d4c5a||0x1f4;return function(_0x13987c){logger[_0x1ea5('0x26')](_0x13987c[_0x1ea5('0x27')]);if(_0x13987c[_0x1ea5('0x28')]){delete _0x13987c[_0x1ea5('0x28')];}_0x541073['status'](_0x2d4c5a)[_0x1ea5('0x29')](_0x13987c);};}exports['index']=function(_0x343644,_0x4ee1f5){var _0x36059a={},_0x3aac14={},_0x42dfd4={'count':0x0,'rows':[]};var _0x4cf866=_[_0x1ea5('0x2a')](db[_0x1ea5('0x2b')][_0x1ea5('0x2c')],function(_0xdeccec){return{'name':_0xdeccec[_0x1ea5('0x2d')],'type':_0xdeccec[_0x1ea5('0x2e')][_0x1ea5('0x2f')]};});_0x3aac14[_0x1ea5('0x30')]=_[_0x1ea5('0x2a')](_0x4cf866,_0x1ea5('0x28'));_0x3aac14[_0x1ea5('0x31')]=_[_0x1ea5('0x32')](_0x343644[_0x1ea5('0x31')]);_0x3aac14['filters']=_[_0x1ea5('0x33')](_0x3aac14['model'],_0x3aac14[_0x1ea5('0x31')]);_0x36059a[_0x1ea5('0x34')]=_[_0x1ea5('0x33')](_0x3aac14[_0x1ea5('0x30')],qs['fields'](_0x343644[_0x1ea5('0x31')][_0x1ea5('0x35')]));_0x36059a[_0x1ea5('0x34')]=_0x36059a[_0x1ea5('0x34')]['length']?_0x36059a[_0x1ea5('0x34')]:_0x3aac14[_0x1ea5('0x30')];if(!_0x343644[_0x1ea5('0x31')][_0x1ea5('0x36')](_0x1ea5('0x37'))){_0x36059a[_0x1ea5('0x20')]=qs['limit'](_0x343644['query'][_0x1ea5('0x20')]);_0x36059a[_0x1ea5('0x1e')]=qs[_0x1ea5('0x1e')](_0x343644['query'][_0x1ea5('0x1e')]);}_0x36059a[_0x1ea5('0x38')]=qs[_0x1ea5('0x39')](_0x343644[_0x1ea5('0x31')]['sort']);_0x36059a['where']=qs[_0x1ea5('0x3a')](_[_0x1ea5('0x3b')](_0x343644[_0x1ea5('0x31')],_0x3aac14[_0x1ea5('0x3a')]),_0x4cf866);if(_0x343644['query'][_0x1ea5('0x3c')]){_0x36059a[_0x1ea5('0x3d')]=_[_0x1ea5('0x3e')](_0x36059a[_0x1ea5('0x3d')],{'$or':_[_0x1ea5('0x2a')](_0x4cf866,function(_0xd32c71){if(_0xd32c71['type']!==_0x1ea5('0x3f')){var _0x39ef0c={};_0x39ef0c[_0xd32c71[_0x1ea5('0x28')]]={'$like':'%'+_0x343644[_0x1ea5('0x31')]['filter']+'%'};return _0x39ef0c;}})});}_0x36059a=_[_0x1ea5('0x3e')]({},_0x36059a,_0x343644[_0x1ea5('0x40')]);var _0x6aa6c5={'where':_0x36059a[_0x1ea5('0x3d')]};return db[_0x1ea5('0x2b')][_0x1ea5('0x21')](_0x6aa6c5)['then'](function(_0x197e8e){_0x42dfd4['count']=_0x197e8e;if(_0x343644[_0x1ea5('0x31')][_0x1ea5('0x41')]){_0x36059a[_0x1ea5('0x42')]=[{'all':!![]}];}return db[_0x1ea5('0x2b')][_0x1ea5('0x43')](_0x36059a);})[_0x1ea5('0x44')](function(_0x8c25ab){_0x42dfd4['rows']=_0x8c25ab;return _0x42dfd4;})[_0x1ea5('0x44')](respondWithFilteredResult(_0x4ee1f5,_0x36059a))[_0x1ea5('0x45')](handleError(_0x4ee1f5,null));};exports[_0x1ea5('0x46')]=function(_0xf91799,_0x5f3021){var _0x1f67e4={'raw':![],'where':{'id':_0xf91799[_0x1ea5('0x47')]['id']}},_0x18e852={};_0x18e852['model']=_[_0x1ea5('0x32')](db[_0x1ea5('0x2b')][_0x1ea5('0x2c')]);_0x18e852[_0x1ea5('0x31')]=_[_0x1ea5('0x32')](_0xf91799[_0x1ea5('0x31')]);_0x18e852[_0x1ea5('0x3a')]=_[_0x1ea5('0x33')](_0x18e852[_0x1ea5('0x30')],_0x18e852[_0x1ea5('0x31')]);_0x1f67e4['attributes']=_['intersection'](_0x18e852[_0x1ea5('0x30')],qs['fields'](_0xf91799['query'][_0x1ea5('0x35')]));_0x1f67e4[_0x1ea5('0x34')]=_0x1f67e4[_0x1ea5('0x34')][_0x1ea5('0x48')]?_0x1f67e4[_0x1ea5('0x34')]:_0x18e852[_0x1ea5('0x30')];if(_0xf91799[_0x1ea5('0x31')][_0x1ea5('0x41')]){_0x1f67e4[_0x1ea5('0x42')]=[{'all':!![]}];}_0x1f67e4=_[_0x1ea5('0x3e')]({},_0x1f67e4,_0xf91799[_0x1ea5('0x40')]);return db[_0x1ea5('0x2b')][_0x1ea5('0x49')](_0x1f67e4)[_0x1ea5('0x44')](handleEntityNotFound(_0x5f3021,null))[_0x1ea5('0x44')](respondWithResult(_0x5f3021,null))['catch'](handleError(_0x5f3021,null));};exports[_0x1ea5('0x4a')]=function(_0x5bb5ee,_0x494b50){return db[_0x1ea5('0x2b')][_0x1ea5('0x4a')](_0x5bb5ee['body'],{})[_0x1ea5('0x44')](respondWithResult(_0x494b50,0xc9))[_0x1ea5('0x45')](handleError(_0x494b50,null));};exports[_0x1ea5('0x25')]=function(_0x5818b3,_0x4f453e){if(_0x5818b3[_0x1ea5('0x4b')]['id']){delete _0x5818b3['body']['id'];}return db[_0x1ea5('0x2b')]['find']({'where':{'id':_0x5818b3[_0x1ea5('0x47')]['id']}})[_0x1ea5('0x44')](handleEntityNotFound(_0x4f453e,null))[_0x1ea5('0x44')](saveUpdates(_0x5818b3[_0x1ea5('0x4b')],null))['then'](respondWithResult(_0x4f453e,null))['catch'](handleError(_0x4f453e,null));};exports[_0x1ea5('0x4c')]=function(_0x174d9d,_0x49e0b1){return db[_0x1ea5('0x2b')][_0x1ea5('0x49')]({'where':{'id':_0x174d9d[_0x1ea5('0x47')]['id']}})[_0x1ea5('0x44')](handleEntityNotFound(_0x49e0b1,null))[_0x1ea5('0x44')](removeEntity(_0x49e0b1,null))[_0x1ea5('0x45')](handleError(_0x49e0b1,null));};exports['getFields']=function(_0x185f12,_0x2a9220,_0x5328ec){var _0x124f6b={};var _0x24d1ef={};var _0x1942db;var _0xbcaba6;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x185f12[_0x1ea5('0x47')]['id']}})[_0x1ea5('0x44')](handleEntityNotFound(_0x2a9220,null))[_0x1ea5('0x44')](function(_0x2fe3e1){if(_0x2fe3e1){_0x1942db=_0x2fe3e1;_0x24d1ef[_0x1ea5('0x30')]=_[_0x1ea5('0x32')](db[_0x1ea5('0x4d')][_0x1ea5('0x2c')]);_0x24d1ef[_0x1ea5('0x31')]=_[_0x1ea5('0x32')](_0x185f12[_0x1ea5('0x31')]);_0x24d1ef[_0x1ea5('0x3a')]=_[_0x1ea5('0x33')](_0x24d1ef['model'],_0x24d1ef[_0x1ea5('0x31')]);_0x124f6b[_0x1ea5('0x34')]=_[_0x1ea5('0x33')](_0x24d1ef[_0x1ea5('0x30')],qs['fields'](_0x185f12[_0x1ea5('0x31')][_0x1ea5('0x35')]));_0x124f6b[_0x1ea5('0x34')]=_0x124f6b[_0x1ea5('0x34')][_0x1ea5('0x48')]?_0x124f6b[_0x1ea5('0x34')]:_0x24d1ef['model'];_0x124f6b[_0x1ea5('0x38')]=qs[_0x1ea5('0x39')](_0x185f12['query'][_0x1ea5('0x39')]);_0x124f6b[_0x1ea5('0x3d')]=qs[_0x1ea5('0x3a')](_[_0x1ea5('0x3b')](_0x185f12[_0x1ea5('0x31')],_0x24d1ef[_0x1ea5('0x3a')]));if(_0x185f12[_0x1ea5('0x31')]['filter']){_0x124f6b[_0x1ea5('0x3d')]=_['merge'](_0x124f6b[_0x1ea5('0x3d')],{'$or':_[_0x1ea5('0x2a')](_0x124f6b[_0x1ea5('0x34')],function(_0x69d42c){var _0x5b6744={};_0x5b6744[_0x69d42c]={'$like':'%'+_0x185f12[_0x1ea5('0x31')][_0x1ea5('0x3c')]+'%'};return _0x5b6744;})});}_0x124f6b=_[_0x1ea5('0x3e')]({},_0x124f6b,_0x185f12[_0x1ea5('0x40')]);return _0x1942db[_0x1ea5('0x4e')](_0x124f6b);}})[_0x1ea5('0x44')](function(_0x12cea7){if(_0x12cea7){_0xbcaba6=_0x12cea7[_0x1ea5('0x48')];if(!_0x185f12[_0x1ea5('0x31')]['hasOwnProperty']('nolimit')){_0x124f6b[_0x1ea5('0x20')]=qs['limit'](_0x185f12[_0x1ea5('0x31')][_0x1ea5('0x20')]);_0x124f6b['offset']=qs[_0x1ea5('0x1e')](_0x185f12[_0x1ea5('0x31')][_0x1ea5('0x1e')]);}return _0x1942db[_0x1ea5('0x4e')](_0x124f6b);}})[_0x1ea5('0x44')](function(_0x25335d){if(_0x25335d){return _0x25335d?{'count':_0xbcaba6,'rows':_0x25335d}:null;}})[_0x1ea5('0x44')](respondWithResult(_0x2a9220,null))['catch'](handleError(_0x2a9220,null));};exports[_0x1ea5('0x4f')]=function(_0x3e2b99,_0x786fba,_0xe0fe1c){var _0xb028c8={};var _0x462b7c={};var _0xfd1ec5;var _0x3fda51;return db[_0x1ea5('0x2b')]['findOne']({'where':{'id':_0x3e2b99[_0x1ea5('0x47')]['id']}})[_0x1ea5('0x44')](handleEntityNotFound(_0x786fba,null))[_0x1ea5('0x44')](function(_0x325fda){if(_0x325fda){_0xfd1ec5=_0x325fda;_0x462b7c[_0x1ea5('0x30')]=_['keys'](db[_0x1ea5('0x4d')][_0x1ea5('0x2c')]);_0x462b7c[_0x1ea5('0x31')]=_['keys'](_0x3e2b99[_0x1ea5('0x31')]);_0x462b7c[_0x1ea5('0x3a')]=_['intersection'](_0x462b7c[_0x1ea5('0x30')],_0x462b7c[_0x1ea5('0x31')]);_0xb028c8[_0x1ea5('0x34')]=_[_0x1ea5('0x33')](_0x462b7c[_0x1ea5('0x30')],qs['fields'](_0x3e2b99[_0x1ea5('0x31')][_0x1ea5('0x35')]));_0xb028c8[_0x1ea5('0x34')]=_0xb028c8[_0x1ea5('0x34')][_0x1ea5('0x48')]?_0xb028c8[_0x1ea5('0x34')]:_0x462b7c[_0x1ea5('0x30')];_0xb028c8[_0x1ea5('0x38')]=qs[_0x1ea5('0x39')](_0x3e2b99['query']['sort']);_0xb028c8[_0x1ea5('0x3d')]=qs[_0x1ea5('0x3a')](_[_0x1ea5('0x3b')](_0x3e2b99[_0x1ea5('0x31')],_0x462b7c[_0x1ea5('0x3a')]));if(_0x3e2b99[_0x1ea5('0x31')][_0x1ea5('0x3c')]){_0xb028c8['where']=_[_0x1ea5('0x3e')](_0xb028c8['where'],{'$or':_['map'](_0xb028c8['attributes'],function(_0x25a9f1){var _0x5299f2={};_0x5299f2[_0x25a9f1]={'$like':'%'+_0x3e2b99['query'][_0x1ea5('0x3c')]+'%'};return _0x5299f2;})});}_0xb028c8=_[_0x1ea5('0x3e')]({},_0xb028c8,_0x3e2b99[_0x1ea5('0x40')]);return _0xfd1ec5[_0x1ea5('0x4f')](_0xb028c8);}})[_0x1ea5('0x44')](function(_0x5a1201){if(_0x5a1201){_0x3fda51=_0x5a1201[_0x1ea5('0x48')];if(!_0x3e2b99[_0x1ea5('0x31')][_0x1ea5('0x36')](_0x1ea5('0x37'))){_0xb028c8['limit']=qs[_0x1ea5('0x20')](_0x3e2b99[_0x1ea5('0x31')]['limit']);_0xb028c8[_0x1ea5('0x1e')]=qs[_0x1ea5('0x1e')](_0x3e2b99[_0x1ea5('0x31')][_0x1ea5('0x1e')]);}return _0xfd1ec5[_0x1ea5('0x4f')](_0xb028c8);}})[_0x1ea5('0x44')](function(_0x33f7de){if(_0x33f7de){return _0x33f7de?{'count':_0x3fda51,'rows':_0x33f7de}:null;}})['then'](respondWithResult(_0x786fba,null))[_0x1ea5('0x45')](handleError(_0x786fba,null));};exports['getDescriptions']=function(_0x2790d6,_0x2a792f,_0x5adf4c){var _0xbb591f={};var _0x424928={};var _0x49bf72;var _0x21a657;return db[_0x1ea5('0x2b')][_0x1ea5('0x50')]({'where':{'id':_0x2790d6[_0x1ea5('0x47')]['id']}})[_0x1ea5('0x44')](handleEntityNotFound(_0x2a792f,null))[_0x1ea5('0x44')](function(_0x52ac9d){if(_0x52ac9d){_0x49bf72=_0x52ac9d;_0x424928[_0x1ea5('0x30')]=_[_0x1ea5('0x32')](db[_0x1ea5('0x4d')]['rawAttributes']);_0x424928[_0x1ea5('0x31')]=_[_0x1ea5('0x32')](_0x2790d6[_0x1ea5('0x31')]);_0x424928[_0x1ea5('0x3a')]=_[_0x1ea5('0x33')](_0x424928[_0x1ea5('0x30')],_0x424928[_0x1ea5('0x31')]);_0xbb591f[_0x1ea5('0x34')]=_['intersection'](_0x424928['model'],qs[_0x1ea5('0x35')](_0x2790d6[_0x1ea5('0x31')][_0x1ea5('0x35')]));_0xbb591f[_0x1ea5('0x34')]=_0xbb591f[_0x1ea5('0x34')]['length']?_0xbb591f[_0x1ea5('0x34')]:_0x424928[_0x1ea5('0x30')];_0xbb591f[_0x1ea5('0x38')]=qs[_0x1ea5('0x39')](_0x2790d6[_0x1ea5('0x31')]['sort']);_0xbb591f[_0x1ea5('0x3d')]=qs['filters'](_[_0x1ea5('0x3b')](_0x2790d6[_0x1ea5('0x31')],_0x424928[_0x1ea5('0x3a')]));if(_0x2790d6[_0x1ea5('0x31')][_0x1ea5('0x3c')]){_0xbb591f[_0x1ea5('0x3d')]=_[_0x1ea5('0x3e')](_0xbb591f[_0x1ea5('0x3d')],{'$or':_[_0x1ea5('0x2a')](_0xbb591f['attributes'],function(_0x5d7e37){var _0x3635ab={};_0x3635ab[_0x5d7e37]={'$like':'%'+_0x2790d6[_0x1ea5('0x31')][_0x1ea5('0x3c')]+'%'};return _0x3635ab;})});}_0xbb591f=_[_0x1ea5('0x3e')]({},_0xbb591f,_0x2790d6['options']);return _0x49bf72[_0x1ea5('0x51')](_0xbb591f);}})['then'](function(_0x10eb6a){if(_0x10eb6a){_0x21a657=_0x10eb6a[_0x1ea5('0x48')];if(!_0x2790d6[_0x1ea5('0x31')][_0x1ea5('0x36')](_0x1ea5('0x37'))){_0xbb591f[_0x1ea5('0x20')]=qs[_0x1ea5('0x20')](_0x2790d6['query']['limit']);_0xbb591f[_0x1ea5('0x1e')]=qs[_0x1ea5('0x1e')](_0x2790d6[_0x1ea5('0x31')][_0x1ea5('0x1e')]);}return _0x49bf72[_0x1ea5('0x51')](_0xbb591f);}})['then'](function(_0x376044){if(_0x376044){return _0x376044?{'count':_0x21a657,'rows':_0x376044}:null;}})[_0x1ea5('0x44')](respondWithResult(_0x2a792f,null))[_0x1ea5('0x45')](handleError(_0x2a792f,null));}; \ No newline at end of file +var _0x1a4a=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','includeAll','create','body','find','params','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','keys','filters','intersection'];(function(_0xbc5799,_0x604d8b){var _0x17febd=function(_0x33ad68){while(--_0x33ad68){_0xbc5799['push'](_0xbc5799['shift']());}};_0x17febd(++_0x604d8b);}(_0x1a4a,0x6d));var _0xa1a4=function(_0x576297,_0x1ba6b6){_0x576297=_0x576297-0x0;var _0x5daa55=_0x1a4a[_0x576297];return _0x5daa55;};'use strict';var emlformat=require(_0xa1a4('0x0'));var rimraf=require(_0xa1a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1a4('0x2'));var rp=require(_0xa1a4('0x3'));var moment=require(_0xa1a4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa1a4('0x5'));var util=require(_0xa1a4('0x6'));var path=require(_0xa1a4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa1a4('0x8'));var fs=require('fs');var fs_extra=require(_0xa1a4('0x9'));var _=require(_0xa1a4('0xa'));var squel=require(_0xa1a4('0xb'));var crypto=require(_0xa1a4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa1a4('0xd'));var querystring=require(_0xa1a4('0xe'));var Papa=require(_0xa1a4('0xf'));var Redis=require(_0xa1a4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1a4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa1a4('0x12'));var utils=require(_0xa1a4('0x13'));var config=require(_0xa1a4('0x14'));var licenseUtil=require(_0xa1a4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x158901,_0x139144){_0x139144=_0x139144||0xcc;return function(_0x22823d){if(_0x22823d){return _0x158901[_0xa1a4('0x16')](_0x139144);}return _0x158901[_0xa1a4('0x17')](_0x139144)[_0xa1a4('0x18')]();};}function respondWithResult(_0x5663a5,_0x4e6714){_0x4e6714=_0x4e6714||0xc8;return function(_0x52bb6d){if(_0x52bb6d){return _0x5663a5['status'](_0x4e6714)['json'](_0x52bb6d);}};}function respondWithFilteredResult(_0x2fcf40,_0x21f608){return function(_0x26a2a4){if(_0x26a2a4){var _0x3ee86f=typeof _0x21f608['offset']===_0xa1a4('0x19')&&typeof _0x21f608[_0xa1a4('0x1a')]===_0xa1a4('0x19');var _0x37166c=_0x26a2a4['count'];var _0x327781=_0x3ee86f?0x0:_0x21f608[_0xa1a4('0x1b')];var _0x331ec8=_0x3ee86f?_0x26a2a4['count']:_0x21f608['offset']+_0x21f608['limit'];var _0x2e2d71;if(_0x331ec8>=_0x37166c){_0x331ec8=_0x37166c;_0x2e2d71=0xc8;}else{_0x2e2d71=0xce;}_0x2fcf40[_0xa1a4('0x17')](_0x2e2d71);return _0x2fcf40[_0xa1a4('0x1c')](_0xa1a4('0x1d'),_0x327781+'-'+_0x331ec8+'/'+_0x37166c)['json'](_0x26a2a4);}return null;};}function patchUpdates(_0x367293){return function(_0x1df806){try{jsonpatch['apply'](_0x1df806,_0x367293,!![]);}catch(_0x3688a3){return BPromise[_0xa1a4('0x1e')](_0x3688a3);}return _0x1df806[_0xa1a4('0x1f')]();};}function saveUpdates(_0x2b9099,_0x787d81){return function(_0x1f0063){if(_0x1f0063){return _0x1f0063[_0xa1a4('0x20')](_0x2b9099)[_0xa1a4('0x21')](function(_0x4d631c){return _0x4d631c;});}return null;};}function removeEntity(_0x15804e,_0x24b55f){return function(_0x2d6dec){if(_0x2d6dec){return _0x2d6dec[_0xa1a4('0x22')]()['then'](function(){_0x15804e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f46d7,_0x5430fb){return function(_0x423274){if(!_0x423274){_0x1f46d7[_0xa1a4('0x16')](0x194);}return _0x423274;};}function handleError(_0xdc7a04,_0x4e4e23){_0x4e4e23=_0x4e4e23||0x1f4;return function(_0x5c6a65){logger['error'](_0x5c6a65[_0xa1a4('0x23')]);if(_0x5c6a65[_0xa1a4('0x24')]){delete _0x5c6a65['name'];}_0xdc7a04[_0xa1a4('0x17')](_0x4e4e23)[_0xa1a4('0x25')](_0x5c6a65);};}exports[_0xa1a4('0x26')]=function(_0x4b9227,_0x528e09){var _0xfdad6e={},_0x587921={},_0xe5e184={'count':0x0,'rows':[]};var _0x170db6=_[_0xa1a4('0x27')](db[_0xa1a4('0x28')][_0xa1a4('0x29')],function(_0x2abe02){return{'name':_0x2abe02[_0xa1a4('0x2a')],'type':_0x2abe02[_0xa1a4('0x2b')][_0xa1a4('0x2c')]};});_0x587921['model']=_[_0xa1a4('0x27')](_0x170db6,_0xa1a4('0x24'));_0x587921[_0xa1a4('0x2d')]=_[_0xa1a4('0x2e')](_0x4b9227[_0xa1a4('0x2d')]);_0x587921[_0xa1a4('0x2f')]=_[_0xa1a4('0x30')](_0x587921[_0xa1a4('0x31')],_0x587921['query']);_0xfdad6e[_0xa1a4('0x32')]=_['intersection'](_0x587921[_0xa1a4('0x31')],qs[_0xa1a4('0x33')](_0x4b9227[_0xa1a4('0x2d')]['fields']));_0xfdad6e['attributes']=_0xfdad6e[_0xa1a4('0x32')][_0xa1a4('0x34')]?_0xfdad6e[_0xa1a4('0x32')]:_0x587921[_0xa1a4('0x31')];if(!_0x4b9227[_0xa1a4('0x2d')][_0xa1a4('0x35')](_0xa1a4('0x36'))){_0xfdad6e[_0xa1a4('0x1a')]=qs['limit'](_0x4b9227[_0xa1a4('0x2d')]['limit']);_0xfdad6e[_0xa1a4('0x1b')]=qs[_0xa1a4('0x1b')](_0x4b9227[_0xa1a4('0x2d')][_0xa1a4('0x1b')]);}_0xfdad6e[_0xa1a4('0x37')]=qs[_0xa1a4('0x38')](_0x4b9227[_0xa1a4('0x2d')]['sort']);_0xfdad6e[_0xa1a4('0x39')]=qs[_0xa1a4('0x2f')](_[_0xa1a4('0x3a')](_0x4b9227[_0xa1a4('0x2d')],_0x587921[_0xa1a4('0x2f')]),_0x170db6);if(_0x4b9227[_0xa1a4('0x2d')][_0xa1a4('0x3b')]){_0xfdad6e[_0xa1a4('0x39')]=_[_0xa1a4('0x3c')](_0xfdad6e[_0xa1a4('0x39')],{'$or':_['map'](_0x170db6,function(_0x5aa9eb){if(_0x5aa9eb[_0xa1a4('0x2b')]!==_0xa1a4('0x3d')){var _0x3d05b5={};_0x3d05b5[_0x5aa9eb['name']]={'$like':'%'+_0x4b9227[_0xa1a4('0x2d')][_0xa1a4('0x3b')]+'%'};return _0x3d05b5;}})});}_0xfdad6e=_[_0xa1a4('0x3c')]({},_0xfdad6e,_0x4b9227[_0xa1a4('0x3e')]);var _0x151a47={'where':_0xfdad6e['where']};return db[_0xa1a4('0x28')][_0xa1a4('0x3f')](_0x151a47)[_0xa1a4('0x21')](function(_0x579e99){_0xe5e184[_0xa1a4('0x3f')]=_0x579e99;if(_0x4b9227['query']['includeAll']){_0xfdad6e[_0xa1a4('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xa1a4('0x41')](_0xfdad6e);})['then'](function(_0x342571){_0xe5e184[_0xa1a4('0x42')]=_0x342571;return _0xe5e184;})[_0xa1a4('0x21')](respondWithFilteredResult(_0x528e09,_0xfdad6e))[_0xa1a4('0x43')](handleError(_0x528e09,null));};exports[_0xa1a4('0x44')]=function(_0x5da524,_0x284b2d){var _0xae4d34={'raw':![],'where':{'id':_0x5da524['params']['id']}},_0x3358e0={};_0x3358e0[_0xa1a4('0x31')]=_[_0xa1a4('0x2e')](db['Dynamics365Configuration'][_0xa1a4('0x29')]);_0x3358e0[_0xa1a4('0x2d')]=_[_0xa1a4('0x2e')](_0x5da524[_0xa1a4('0x2d')]);_0x3358e0[_0xa1a4('0x2f')]=_[_0xa1a4('0x30')](_0x3358e0['model'],_0x3358e0[_0xa1a4('0x2d')]);_0xae4d34[_0xa1a4('0x32')]=_[_0xa1a4('0x30')](_0x3358e0['model'],qs[_0xa1a4('0x33')](_0x5da524['query'][_0xa1a4('0x33')]));_0xae4d34[_0xa1a4('0x32')]=_0xae4d34[_0xa1a4('0x32')][_0xa1a4('0x34')]?_0xae4d34['attributes']:_0x3358e0[_0xa1a4('0x31')];if(_0x5da524['query'][_0xa1a4('0x45')]){_0xae4d34[_0xa1a4('0x40')]=[{'all':!![]}];}_0xae4d34=_[_0xa1a4('0x3c')]({},_0xae4d34,_0x5da524[_0xa1a4('0x3e')]);return db[_0xa1a4('0x28')]['find'](_0xae4d34)[_0xa1a4('0x21')](handleEntityNotFound(_0x284b2d,null))[_0xa1a4('0x21')](respondWithResult(_0x284b2d,null))[_0xa1a4('0x43')](handleError(_0x284b2d,null));};exports['create']=function(_0x275645,_0x2b6e47){return db[_0xa1a4('0x28')][_0xa1a4('0x46')](_0x275645['body'],{})[_0xa1a4('0x21')](respondWithResult(_0x2b6e47,0xc9))[_0xa1a4('0x43')](handleError(_0x2b6e47,null));};exports[_0xa1a4('0x20')]=function(_0x567829,_0x49a1ce){if(_0x567829[_0xa1a4('0x47')]['id']){delete _0x567829[_0xa1a4('0x47')]['id'];}return db['Dynamics365Configuration'][_0xa1a4('0x48')]({'where':{'id':_0x567829['params']['id']}})['then'](handleEntityNotFound(_0x49a1ce,null))[_0xa1a4('0x21')](saveUpdates(_0x567829[_0xa1a4('0x47')],null))[_0xa1a4('0x21')](respondWithResult(_0x49a1ce,null))[_0xa1a4('0x43')](handleError(_0x49a1ce,null));};exports[_0xa1a4('0x22')]=function(_0x3abcf5,_0x34c18b){return db[_0xa1a4('0x28')][_0xa1a4('0x48')]({'where':{'id':_0x3abcf5[_0xa1a4('0x49')]['id']}})[_0xa1a4('0x21')](handleEntityNotFound(_0x34c18b,null))[_0xa1a4('0x21')](removeEntity(_0x34c18b,null))[_0xa1a4('0x43')](handleError(_0x34c18b,null));};exports['getFields']=function(_0x3a92be,_0x335ae1,_0x7572f2){var _0x920c67={};var _0x3373af={};var _0x729b4d;var _0xb4bd2;return db[_0xa1a4('0x28')][_0xa1a4('0x4a')]({'where':{'id':_0x3a92be[_0xa1a4('0x49')]['id']}})['then'](handleEntityNotFound(_0x335ae1,null))['then'](function(_0x399d5f){if(_0x399d5f){_0x729b4d=_0x399d5f;_0x3373af[_0xa1a4('0x31')]=_['keys'](db[_0xa1a4('0x4b')][_0xa1a4('0x29')]);_0x3373af[_0xa1a4('0x2d')]=_[_0xa1a4('0x2e')](_0x3a92be[_0xa1a4('0x2d')]);_0x3373af['filters']=_[_0xa1a4('0x30')](_0x3373af['model'],_0x3373af[_0xa1a4('0x2d')]);_0x920c67[_0xa1a4('0x32')]=_[_0xa1a4('0x30')](_0x3373af['model'],qs[_0xa1a4('0x33')](_0x3a92be[_0xa1a4('0x2d')][_0xa1a4('0x33')]));_0x920c67['attributes']=_0x920c67[_0xa1a4('0x32')]['length']?_0x920c67['attributes']:_0x3373af[_0xa1a4('0x31')];_0x920c67['order']=qs[_0xa1a4('0x38')](_0x3a92be[_0xa1a4('0x2d')][_0xa1a4('0x38')]);_0x920c67[_0xa1a4('0x39')]=qs[_0xa1a4('0x2f')](_['pick'](_0x3a92be['query'],_0x3373af['filters']));if(_0x3a92be[_0xa1a4('0x2d')][_0xa1a4('0x3b')]){_0x920c67['where']=_[_0xa1a4('0x3c')](_0x920c67[_0xa1a4('0x39')],{'$or':_[_0xa1a4('0x27')](_0x920c67[_0xa1a4('0x32')],function(_0xd438a1){var _0x53b790={};_0x53b790[_0xd438a1]={'$like':'%'+_0x3a92be[_0xa1a4('0x2d')][_0xa1a4('0x3b')]+'%'};return _0x53b790;})});}_0x920c67=_[_0xa1a4('0x3c')]({},_0x920c67,_0x3a92be['options']);return _0x729b4d[_0xa1a4('0x4c')](_0x920c67);}})['then'](function(_0x3e6f04){if(_0x3e6f04){_0xb4bd2=_0x3e6f04['length'];if(!_0x3a92be[_0xa1a4('0x2d')]['hasOwnProperty']('nolimit')){_0x920c67[_0xa1a4('0x1a')]=qs[_0xa1a4('0x1a')](_0x3a92be[_0xa1a4('0x2d')][_0xa1a4('0x1a')]);_0x920c67[_0xa1a4('0x1b')]=qs['offset'](_0x3a92be['query'][_0xa1a4('0x1b')]);}return _0x729b4d[_0xa1a4('0x4c')](_0x920c67);}})[_0xa1a4('0x21')](function(_0x2b008b){if(_0x2b008b){return _0x2b008b?{'count':_0xb4bd2,'rows':_0x2b008b}:null;}})[_0xa1a4('0x21')](respondWithResult(_0x335ae1,null))[_0xa1a4('0x43')](handleError(_0x335ae1,null));};exports['getSubjects']=function(_0x4dcf44,_0x3624c7,_0x35b355){var _0xb1b2e8={};var _0x373a1f={};var _0x532eca;var _0x169511;return db['Dynamics365Configuration'][_0xa1a4('0x4a')]({'where':{'id':_0x4dcf44[_0xa1a4('0x49')]['id']}})[_0xa1a4('0x21')](handleEntityNotFound(_0x3624c7,null))['then'](function(_0x5595cc){if(_0x5595cc){_0x532eca=_0x5595cc;_0x373a1f[_0xa1a4('0x31')]=_['keys'](db[_0xa1a4('0x4b')][_0xa1a4('0x29')]);_0x373a1f[_0xa1a4('0x2d')]=_[_0xa1a4('0x2e')](_0x4dcf44[_0xa1a4('0x2d')]);_0x373a1f[_0xa1a4('0x2f')]=_[_0xa1a4('0x30')](_0x373a1f[_0xa1a4('0x31')],_0x373a1f[_0xa1a4('0x2d')]);_0xb1b2e8[_0xa1a4('0x32')]=_[_0xa1a4('0x30')](_0x373a1f[_0xa1a4('0x31')],qs[_0xa1a4('0x33')](_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x33')]));_0xb1b2e8['attributes']=_0xb1b2e8[_0xa1a4('0x32')][_0xa1a4('0x34')]?_0xb1b2e8[_0xa1a4('0x32')]:_0x373a1f[_0xa1a4('0x31')];_0xb1b2e8[_0xa1a4('0x37')]=qs[_0xa1a4('0x38')](_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x38')]);_0xb1b2e8[_0xa1a4('0x39')]=qs[_0xa1a4('0x2f')](_[_0xa1a4('0x3a')](_0x4dcf44['query'],_0x373a1f['filters']));if(_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x3b')]){_0xb1b2e8['where']=_[_0xa1a4('0x3c')](_0xb1b2e8[_0xa1a4('0x39')],{'$or':_['map'](_0xb1b2e8['attributes'],function(_0x25d2ea){var _0x126e79={};_0x126e79[_0x25d2ea]={'$like':'%'+_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x3b')]+'%'};return _0x126e79;})});}_0xb1b2e8=_[_0xa1a4('0x3c')]({},_0xb1b2e8,_0x4dcf44[_0xa1a4('0x3e')]);return _0x532eca[_0xa1a4('0x4d')](_0xb1b2e8);}})[_0xa1a4('0x21')](function(_0x122b6e){if(_0x122b6e){_0x169511=_0x122b6e[_0xa1a4('0x34')];if(!_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x35')](_0xa1a4('0x36'))){_0xb1b2e8['limit']=qs[_0xa1a4('0x1a')](_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x1a')]);_0xb1b2e8['offset']=qs[_0xa1a4('0x1b')](_0x4dcf44[_0xa1a4('0x2d')]['offset']);}return _0x532eca[_0xa1a4('0x4d')](_0xb1b2e8);}})[_0xa1a4('0x21')](function(_0x2a16ee){if(_0x2a16ee){return _0x2a16ee?{'count':_0x169511,'rows':_0x2a16ee}:null;}})['then'](respondWithResult(_0x3624c7,null))[_0xa1a4('0x43')](handleError(_0x3624c7,null));};exports[_0xa1a4('0x4e')]=function(_0x912f4b,_0x2e5e08,_0x488707){var _0x4c49ec={};var _0x1d130c={};var _0x5ba712;var _0x41fa12;return db[_0xa1a4('0x28')][_0xa1a4('0x4a')]({'where':{'id':_0x912f4b[_0xa1a4('0x49')]['id']}})[_0xa1a4('0x21')](handleEntityNotFound(_0x2e5e08,null))[_0xa1a4('0x21')](function(_0x327e38){if(_0x327e38){_0x5ba712=_0x327e38;_0x1d130c[_0xa1a4('0x31')]=_[_0xa1a4('0x2e')](db[_0xa1a4('0x4b')]['rawAttributes']);_0x1d130c['query']=_[_0xa1a4('0x2e')](_0x912f4b['query']);_0x1d130c[_0xa1a4('0x2f')]=_[_0xa1a4('0x30')](_0x1d130c[_0xa1a4('0x31')],_0x1d130c[_0xa1a4('0x2d')]);_0x4c49ec[_0xa1a4('0x32')]=_[_0xa1a4('0x30')](_0x1d130c[_0xa1a4('0x31')],qs[_0xa1a4('0x33')](_0x912f4b[_0xa1a4('0x2d')][_0xa1a4('0x33')]));_0x4c49ec[_0xa1a4('0x32')]=_0x4c49ec['attributes']['length']?_0x4c49ec[_0xa1a4('0x32')]:_0x1d130c['model'];_0x4c49ec[_0xa1a4('0x37')]=qs[_0xa1a4('0x38')](_0x912f4b[_0xa1a4('0x2d')][_0xa1a4('0x38')]);_0x4c49ec[_0xa1a4('0x39')]=qs[_0xa1a4('0x2f')](_['pick'](_0x912f4b[_0xa1a4('0x2d')],_0x1d130c[_0xa1a4('0x2f')]));if(_0x912f4b['query'][_0xa1a4('0x3b')]){_0x4c49ec[_0xa1a4('0x39')]=_[_0xa1a4('0x3c')](_0x4c49ec['where'],{'$or':_[_0xa1a4('0x27')](_0x4c49ec[_0xa1a4('0x32')],function(_0x89c2f9){var _0x194bf4={};_0x194bf4[_0x89c2f9]={'$like':'%'+_0x912f4b[_0xa1a4('0x2d')][_0xa1a4('0x3b')]+'%'};return _0x194bf4;})});}_0x4c49ec=_[_0xa1a4('0x3c')]({},_0x4c49ec,_0x912f4b[_0xa1a4('0x3e')]);return _0x5ba712[_0xa1a4('0x4e')](_0x4c49ec);}})['then'](function(_0x26193a){if(_0x26193a){_0x41fa12=_0x26193a['length'];if(!_0x912f4b[_0xa1a4('0x2d')][_0xa1a4('0x35')](_0xa1a4('0x36'))){_0x4c49ec[_0xa1a4('0x1a')]=qs['limit'](_0x912f4b['query'][_0xa1a4('0x1a')]);_0x4c49ec['offset']=qs['offset'](_0x912f4b[_0xa1a4('0x2d')][_0xa1a4('0x1b')]);}return _0x5ba712[_0xa1a4('0x4e')](_0x4c49ec);}})[_0xa1a4('0x21')](function(_0x39ca77){if(_0x39ca77){return _0x39ca77?{'count':_0x41fa12,'rows':_0x39ca77}:null;}})[_0xa1a4('0x21')](respondWithResult(_0x2e5e08,null))[_0xa1a4('0x43')](handleError(_0x2e5e08,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index bb20790..3a2e47f 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','api','bluebird'];(function(_0x1549ad,_0x7d29f9){var _0x205908=function(_0x495877){while(--_0x495877){_0x1549ad['push'](_0x1549ad['shift']());}};_0x205908(++_0x7d29f9);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4517d9,_0x2b255b){_0x4517d9=_0x4517d9-0x0;var _0x3b54a3=_0x9bde[_0x4517d9];return _0x3b54a3;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x153846,_0x1227ad){var _0x3ee557=function(_0x514e76){while(--_0x514e76){_0x153846['push'](_0x153846['shift']());}};_0x3ee557(++_0x1227ad);}(_0x3e74,0x175));var _0x43e7=function(_0x2b16d2,_0x690c33){_0x2b16d2=_0x2b16d2-0x0;var _0x5bef14=_0x3e74[_0x2b16d2];return _0x5bef14;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index b2cbdb8..df53198 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35c5=['../../config/utils','rpc','../../config/environment','jayson/promise','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x40862b,_0x34a6da){var _0x2ad067=function(_0x32e218){while(--_0x32e218){_0x40862b['push'](_0x40862b['shift']());}};_0x2ad067(++_0x34a6da);}(_0x35c5,0x120));var _0x535c=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x35c5[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x535c('0x0'));var util=require(_0x535c('0x1'));var moment=require(_0x535c('0x2'));var BPromise=require(_0x535c('0x3'));var rs=require(_0x535c('0x4'));var fs=require('fs');var Redis=require(_0x535c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x535c('0x6'));var logger=require('../../config/logger')(_0x535c('0x7'));var config=require(_0x535c('0x8'));var jayson=require(_0x535c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2eac63,_0x44182d,_0x128091){return new BPromise(function(_0x3e52e7,_0x5d130f){return client[_0x535c('0xa')](_0x2eac63,_0x128091)['then'](function(_0x24f852){logger['info'](_0x535c('0xb'),_0x44182d,_0x535c('0xc'));logger[_0x535c('0xd')](_0x535c('0xe'),_0x44182d,_0x535c('0xc'),JSON['stringify'](_0x24f852));if(_0x24f852[_0x535c('0xf')]){if(_0x24f852[_0x535c('0xf')][_0x535c('0x10')]===0x1f4){logger[_0x535c('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x44182d,_0x24f852['error']['message']);return _0x5d130f(_0x24f852[_0x535c('0xf')][_0x535c('0x11')]);}logger['error'](_0x535c('0xb'),_0x44182d,_0x24f852[_0x535c('0xf')][_0x535c('0x11')]);return _0x3e52e7(_0x24f852[_0x535c('0xf')]['message']);}else{logger[_0x535c('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x44182d,'request\x20sent');_0x3e52e7(_0x24f852[_0x535c('0x13')]['message']);}})[_0x535c('0x14')](function(_0x1f91a2){logger[_0x535c('0xf')](_0x535c('0xb'),_0x44182d,_0x1f91a2);_0x5d130f(_0x1f91a2);});});} \ No newline at end of file +var _0x1bc9=['request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x559e8a,_0x332fc2){var _0x387115=function(_0x4aa950){while(--_0x4aa950){_0x559e8a['push'](_0x559e8a['shift']());}};_0x387115(++_0x332fc2);}(_0x1bc9,0xc8));var _0x91bc=function(_0x30f93e,_0x384d05){_0x30f93e=_0x30f93e-0x0;var _0x5ee3d0=_0x1bc9[_0x30f93e];return _0x5ee3d0;};'use strict';var _=require(_0x91bc('0x0'));var util=require(_0x91bc('0x1'));var moment=require('moment');var BPromise=require(_0x91bc('0x2'));var rs=require(_0x91bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91bc('0x4'))['db'];var utils=require(_0x91bc('0x5'));var logger=require(_0x91bc('0x6'))(_0x91bc('0x7'));var config=require('../../config/environment');var jayson=require(_0x91bc('0x8'));var client=jayson[_0x91bc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf64712,_0x4203d8,_0x1be1f0){return new BPromise(function(_0x398a9b,_0x3791f7){return client[_0x91bc('0xa')](_0xf64712,_0x1be1f0)[_0x91bc('0xb')](function(_0x429943){logger[_0x91bc('0xc')](_0x91bc('0xd'),_0x4203d8,'request\x20sent');logger[_0x91bc('0xe')](_0x91bc('0xf'),_0x4203d8,_0x91bc('0x10'),JSON['stringify'](_0x429943));if(_0x429943[_0x91bc('0x11')]){if(_0x429943[_0x91bc('0x11')]['code']===0x1f4){logger[_0x91bc('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4203d8,_0x429943[_0x91bc('0x11')][_0x91bc('0x12')]);return _0x3791f7(_0x429943[_0x91bc('0x11')][_0x91bc('0x12')]);}logger[_0x91bc('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4203d8,_0x429943[_0x91bc('0x11')][_0x91bc('0x12')]);return _0x398a9b(_0x429943[_0x91bc('0x11')]['message']);}else{logger[_0x91bc('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4203d8,_0x91bc('0x10'));_0x398a9b(_0x429943[_0x91bc('0x13')][_0x91bc('0x12')]);}})[_0x91bc('0x14')](function(_0x528ccc){logger[_0x91bc('0x11')](_0x91bc('0xd'),_0x4203d8,_0x528ccc);_0x3791f7(_0x528ccc);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 704806c..ec89b09 100644 --- a/server/api/intDynamics365Field/index.js +++ b/server/api/intDynamics365Field/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd96=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xdd96,0x1b0));var _0x6dd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd96[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6dd9('0x0'));var path=require(_0x6dd9('0x1'));var timeout=require('connect-timeout');var express=require(_0x6dd9('0x2'));var router=express[_0x6dd9('0x3')]();var fs_extra=require(_0x6dd9('0x4'));var auth=require(_0x6dd9('0x5'));var interaction=require(_0x6dd9('0x6'));var config=require('../../config/environment');var controller=require(_0x6dd9('0x7'));router[_0x6dd9('0x8')]('/',auth[_0x6dd9('0x9')](),controller[_0x6dd9('0xa')]);router[_0x6dd9('0x8')](_0x6dd9('0xb'),auth[_0x6dd9('0x9')](),controller[_0x6dd9('0xc')]);router[_0x6dd9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6dd9('0xe')](_0x6dd9('0xb'),auth[_0x6dd9('0x9')](),controller[_0x6dd9('0xf')]);router[_0x6dd9('0x10')](_0x6dd9('0xb'),auth[_0x6dd9('0x9')](),controller['destroy']);module[_0x6dd9('0x11')]=router; \ No newline at end of file +var _0x1971=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x126e5a,_0x4fddbc){var _0x2cc0e8=function(_0x14ed96){while(--_0x14ed96){_0x126e5a['push'](_0x126e5a['shift']());}};_0x2cc0e8(++_0x4fddbc);}(_0x1971,0x161));var _0x1197=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x1971[_0x166d93];return _0xba708;};'use strict';var multer=require(_0x1197('0x0'));var util=require(_0x1197('0x1'));var path=require(_0x1197('0x2'));var timeout=require(_0x1197('0x3'));var express=require(_0x1197('0x4'));var router=express[_0x1197('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1197('0x6'));var interaction=require(_0x1197('0x7'));var config=require(_0x1197('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x1197('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1197('0x9')](_0x1197('0xa'),auth[_0x1197('0xb')](),controller['show']);router[_0x1197('0xc')]('/',auth['isAuthenticated'](),controller[_0x1197('0xd')]);router[_0x1197('0xe')](_0x1197('0xa'),auth['isAuthenticated'](),controller[_0x1197('0xf')]);router[_0x1197('0x10')](_0x1197('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1197('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 4df0e52..d205043 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js +++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38b0=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5815fc,_0x3c9e63){var _0x12d257=function(_0x57264d){while(--_0x57264d){_0x5815fc['push'](_0x5815fc['shift']());}};_0x12d257(++_0x3c9e63);}(_0x38b0,0xfe));var _0x038b=function(_0x3c97e3,_0x321677){_0x3c97e3=_0x3c97e3-0x0;var _0x9bb0ed=_0x38b0[_0x3c97e3];return _0x9bb0ed;};'use strict';var Sequelize=require(_0x038b('0x0'));module[_0x038b('0x1')]={'type':{'type':Sequelize[_0x038b('0x2')](_0x038b('0x3'),_0x038b('0x4'),_0x038b('0x5'),_0x038b('0x6'),'picklist'),'defaultValue':_0x038b('0x3')},'content':{'type':Sequelize[_0x038b('0x7')]},'key':{'type':Sequelize[_0x038b('0x7')]},'keyType':{'type':Sequelize[_0x038b('0x2')]('string','variable',_0x038b('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x038b('0x7')]},'nameField':{'type':Sequelize[_0x038b('0x7')]},'customField':{'type':Sequelize[_0x038b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x038b('0x7')]}}; \ No newline at end of file +var _0x7e24=['picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','customVariable'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7e24,0x1b4));var _0x47e2=function(_0x2e9f56,_0x54cf4b){_0x2e9f56=_0x2e9f56-0x0;var _0x5577a4=_0x7e24[_0x2e9f56];return _0x5577a4;};'use strict';var Sequelize=require(_0x47e2('0x0'));module[_0x47e2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x47e2('0x2'),'variable',_0x47e2('0x3'),'keyValue',_0x47e2('0x4')),'defaultValue':_0x47e2('0x2')},'content':{'type':Sequelize[_0x47e2('0x5')]},'key':{'type':Sequelize[_0x47e2('0x5')]},'keyType':{'type':Sequelize[_0x47e2('0x6')](_0x47e2('0x2'),'variable',_0x47e2('0x3'))},'keyContent':{'type':Sequelize[_0x47e2('0x5')]},'idField':{'type':Sequelize[_0x47e2('0x5')]},'nameField':{'type':Sequelize[_0x47e2('0x5')]},'customField':{'type':Sequelize[_0x47e2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x47e2('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 38ac747..11494bf 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.controller.js +++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c31=['fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','eml-format','zip-dir','fast-json-patch','moment','path','sox','to-csv','lodash','squel','crypto','desk.js','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','Dynamics365Field','rawAttributes'];(function(_0x280007,_0x30e066){var _0x28b8b5=function(_0x344d3e){while(--_0x344d3e){_0x280007['push'](_0x280007['shift']());}};_0x28b8b5(++_0x30e066);}(_0x0c31,0x15a));var _0x10c3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0c31[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x10c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x10c3('0x1'));var jsonpatch=require(_0x10c3('0x2'));var rp=require('request-promise');var moment=require(_0x10c3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x10c3('0x4'));var sox=require(_0x10c3('0x5'));var csv=require(_0x10c3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x10c3('0x7'));var squel=require(_0x10c3('0x8'));var crypto=require(_0x10c3('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x10c3('0xa'));var toCsv=require(_0x10c3('0x6'));var querystring=require('querystring');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(_0x10c3('0xb'));var logger=require(_0x10c3('0xc'))(_0x10c3('0xd'));var utils=require(_0x10c3('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0x10c3('0xf'));var db=require(_0x10c3('0x10'))['db'];function respondWithStatusCode(_0x267c6c,_0x5a99c2){_0x5a99c2=_0x5a99c2||0xcc;return function(_0x4e942e){if(_0x4e942e){return _0x267c6c[_0x10c3('0x11')](_0x5a99c2);}return _0x267c6c[_0x10c3('0x12')](_0x5a99c2)[_0x10c3('0x13')]();};}function respondWithResult(_0x1f4270,_0x2eea80){_0x2eea80=_0x2eea80||0xc8;return function(_0x46125c){if(_0x46125c){return _0x1f4270[_0x10c3('0x12')](_0x2eea80)[_0x10c3('0x14')](_0x46125c);}};}function respondWithFilteredResult(_0x32e530,_0x281edb){return function(_0x501422){if(_0x501422){var _0x2f486e=typeof _0x281edb['offset']===_0x10c3('0x15')&&typeof _0x281edb[_0x10c3('0x16')]===_0x10c3('0x15');var _0x5265ae=_0x501422[_0x10c3('0x17')];var _0x5c7783=_0x2f486e?0x0:_0x281edb[_0x10c3('0x18')];var _0x2a1f1a=_0x2f486e?_0x501422['count']:_0x281edb['offset']+_0x281edb['limit'];var _0x231234;if(_0x2a1f1a>=_0x5265ae){_0x2a1f1a=_0x5265ae;_0x231234=0xc8;}else{_0x231234=0xce;}_0x32e530['status'](_0x231234);return _0x32e530[_0x10c3('0x19')](_0x10c3('0x1a'),_0x5c7783+'-'+_0x2a1f1a+'/'+_0x5265ae)[_0x10c3('0x14')](_0x501422);}return null;};}function patchUpdates(_0x38cb00){return function(_0x264b77){try{jsonpatch[_0x10c3('0x1b')](_0x264b77,_0x38cb00,!![]);}catch(_0xe561e9){return BPromise['reject'](_0xe561e9);}return _0x264b77[_0x10c3('0x1c')]();};}function saveUpdates(_0x5337c2,_0x5466e1){return function(_0x8ea3aa){if(_0x8ea3aa){return _0x8ea3aa[_0x10c3('0x1d')](_0x5337c2)[_0x10c3('0x1e')](function(_0x449c20){return _0x449c20;});}return null;};}function removeEntity(_0x8ff03e,_0x33d4ba){return function(_0x5a5f9b){if(_0x5a5f9b){return _0x5a5f9b[_0x10c3('0x1f')]()[_0x10c3('0x1e')](function(){_0x8ff03e[_0x10c3('0x12')](0xcc)[_0x10c3('0x13')]();});}};}function handleEntityNotFound(_0x4e8738,_0x338364){return function(_0x15fc30){if(!_0x15fc30){_0x4e8738[_0x10c3('0x11')](0x194);}return _0x15fc30;};}function handleError(_0x2aee94,_0x5f0eea){_0x5f0eea=_0x5f0eea||0x1f4;return function(_0x45e44b){logger['error'](_0x45e44b[_0x10c3('0x20')]);if(_0x45e44b[_0x10c3('0x21')]){delete _0x45e44b['name'];}_0x2aee94[_0x10c3('0x12')](_0x5f0eea)[_0x10c3('0x22')](_0x45e44b);};}exports['index']=function(_0x5ea2bb,_0x238399){var _0x3dc568={},_0x14da5c={},_0x36ab0b={'count':0x0,'rows':[]};var _0x127f04=_[_0x10c3('0x23')](db[_0x10c3('0x24')][_0x10c3('0x25')],function(_0x3005af){return{'name':_0x3005af[_0x10c3('0x26')],'type':_0x3005af[_0x10c3('0x27')][_0x10c3('0x28')]};});_0x14da5c['model']=_['map'](_0x127f04,'name');_0x14da5c[_0x10c3('0x29')]=_[_0x10c3('0x2a')](_0x5ea2bb[_0x10c3('0x29')]);_0x14da5c[_0x10c3('0x2b')]=_[_0x10c3('0x2c')](_0x14da5c[_0x10c3('0x2d')],_0x14da5c[_0x10c3('0x29')]);_0x3dc568[_0x10c3('0x2e')]=_[_0x10c3('0x2c')](_0x14da5c[_0x10c3('0x2d')],qs[_0x10c3('0x2f')](_0x5ea2bb[_0x10c3('0x29')][_0x10c3('0x2f')]));_0x3dc568[_0x10c3('0x2e')]=_0x3dc568[_0x10c3('0x2e')]['length']?_0x3dc568[_0x10c3('0x2e')]:_0x14da5c[_0x10c3('0x2d')];if(!_0x5ea2bb['query']['hasOwnProperty']('nolimit')){_0x3dc568[_0x10c3('0x16')]=qs[_0x10c3('0x16')](_0x5ea2bb[_0x10c3('0x29')][_0x10c3('0x16')]);_0x3dc568[_0x10c3('0x18')]=qs['offset'](_0x5ea2bb['query'][_0x10c3('0x18')]);}_0x3dc568[_0x10c3('0x30')]=qs[_0x10c3('0x31')](_0x5ea2bb[_0x10c3('0x29')][_0x10c3('0x31')]);_0x3dc568[_0x10c3('0x32')]=qs[_0x10c3('0x2b')](_[_0x10c3('0x33')](_0x5ea2bb[_0x10c3('0x29')],_0x14da5c[_0x10c3('0x2b')]),_0x127f04);if(_0x5ea2bb[_0x10c3('0x29')][_0x10c3('0x34')]){_0x3dc568[_0x10c3('0x32')]=_[_0x10c3('0x35')](_0x3dc568[_0x10c3('0x32')],{'$or':_[_0x10c3('0x23')](_0x127f04,function(_0xec5e40){if(_0xec5e40[_0x10c3('0x27')]!=='VIRTUAL'){var _0x624a35={};_0x624a35[_0xec5e40['name']]={'$like':'%'+_0x5ea2bb[_0x10c3('0x29')][_0x10c3('0x34')]+'%'};return _0x624a35;}})});}_0x3dc568=_[_0x10c3('0x35')]({},_0x3dc568,_0x5ea2bb[_0x10c3('0x36')]);var _0x218d9c={'where':_0x3dc568['where']};return db[_0x10c3('0x24')][_0x10c3('0x17')](_0x218d9c)[_0x10c3('0x1e')](function(_0x419fa4){_0x36ab0b['count']=_0x419fa4;if(_0x5ea2bb[_0x10c3('0x29')]['includeAll']){_0x3dc568[_0x10c3('0x37')]=[{'all':!![]}];}return db[_0x10c3('0x24')][_0x10c3('0x38')](_0x3dc568);})['then'](function(_0xbf9d7a){_0x36ab0b[_0x10c3('0x39')]=_0xbf9d7a;return _0x36ab0b;})[_0x10c3('0x1e')](respondWithFilteredResult(_0x238399,_0x3dc568))[_0x10c3('0x3a')](handleError(_0x238399,null));};exports[_0x10c3('0x3b')]=function(_0x5428ac,_0x4ff98a){var _0x1d7a47={'raw':!![],'where':{'id':_0x5428ac[_0x10c3('0x3c')]['id']}},_0x3fac8e={};_0x3fac8e['model']=_['keys'](db[_0x10c3('0x24')][_0x10c3('0x25')]);_0x3fac8e[_0x10c3('0x29')]=_['keys'](_0x5428ac[_0x10c3('0x29')]);_0x3fac8e['filters']=_[_0x10c3('0x2c')](_0x3fac8e['model'],_0x3fac8e[_0x10c3('0x29')]);_0x1d7a47[_0x10c3('0x2e')]=_[_0x10c3('0x2c')](_0x3fac8e['model'],qs['fields'](_0x5428ac[_0x10c3('0x29')][_0x10c3('0x2f')]));_0x1d7a47[_0x10c3('0x2e')]=_0x1d7a47['attributes']['length']?_0x1d7a47[_0x10c3('0x2e')]:_0x3fac8e[_0x10c3('0x2d')];if(_0x5428ac[_0x10c3('0x29')][_0x10c3('0x3d')]){_0x1d7a47[_0x10c3('0x37')]=[{'all':!![]}];}_0x1d7a47=_[_0x10c3('0x35')]({},_0x1d7a47,_0x5428ac[_0x10c3('0x36')]);return db[_0x10c3('0x24')][_0x10c3('0x3e')](_0x1d7a47)[_0x10c3('0x1e')](handleEntityNotFound(_0x4ff98a,null))[_0x10c3('0x1e')](respondWithResult(_0x4ff98a,null))[_0x10c3('0x3a')](handleError(_0x4ff98a,null));};exports['create']=function(_0x1f5a70,_0x2b2605){return db[_0x10c3('0x24')]['create'](_0x1f5a70['body'],{})['then'](respondWithResult(_0x2b2605,0xc9))[_0x10c3('0x3a')](handleError(_0x2b2605,null));};exports[_0x10c3('0x1d')]=function(_0xecb501,_0x46e011){if(_0xecb501[_0x10c3('0x3f')]['id']){delete _0xecb501[_0x10c3('0x3f')]['id'];}return db[_0x10c3('0x24')][_0x10c3('0x3e')]({'where':{'id':_0xecb501[_0x10c3('0x3c')]['id']}})[_0x10c3('0x1e')](handleEntityNotFound(_0x46e011,null))[_0x10c3('0x1e')](saveUpdates(_0xecb501[_0x10c3('0x3f')],null))[_0x10c3('0x1e')](respondWithResult(_0x46e011,null))[_0x10c3('0x3a')](handleError(_0x46e011,null));};exports['destroy']=function(_0x37d5ca,_0x3f94a3){return db[_0x10c3('0x24')][_0x10c3('0x3e')]({'where':{'id':_0x37d5ca[_0x10c3('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3f94a3,null))['then'](removeEntity(_0x3f94a3,null))[_0x10c3('0x3a')](handleError(_0x3f94a3,null));}; \ No newline at end of file +var _0x7c2e=['limit','count','set','Content-Range','json','apply','save','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','update','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x8d695e,_0x394999){var _0x3d156e=function(_0x38cf6f){while(--_0x38cf6f){_0x8d695e['push'](_0x8d695e['shift']());}};_0x3d156e(++_0x394999);}(_0x7c2e,0x16c));var _0xe7c2=function(_0x38f0c4,_0x4fea65){_0x38f0c4=_0x38f0c4-0x0;var _0x2be4fd=_0x7c2e[_0x38f0c4];return _0x2be4fd;};'use strict';var emlformat=require(_0xe7c2('0x0'));var rimraf=require(_0xe7c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7c2('0x2'));var rp=require(_0xe7c2('0x3'));var moment=require(_0xe7c2('0x4'));var BPromise=require(_0xe7c2('0x5'));var Mustache=require(_0xe7c2('0x6'));var util=require(_0xe7c2('0x7'));var path=require('path');var sox=require(_0xe7c2('0x8'));var csv=require(_0xe7c2('0x9'));var ejs=require(_0xe7c2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe7c2('0xb'));var crypto=require('crypto');var jsforce=require(_0xe7c2('0xc'));var deskjs=require(_0xe7c2('0xd'));var toCsv=require(_0xe7c2('0x9'));var querystring=require('querystring');var Papa=require(_0xe7c2('0xe'));var Redis=require(_0xe7c2('0xf'));var authService=require(_0xe7c2('0x10'));var qs=require(_0xe7c2('0x11'));var as=require(_0xe7c2('0x12'));var hardwareService=require(_0xe7c2('0x13'));var logger=require(_0xe7c2('0x14'))(_0xe7c2('0x15'));var utils=require(_0xe7c2('0x16'));var config=require(_0xe7c2('0x17'));var licenseUtil=require(_0xe7c2('0x18'));var db=require(_0xe7c2('0x19'))['db'];function respondWithStatusCode(_0x17ba2,_0x41cd17){_0x41cd17=_0x41cd17||0xcc;return function(_0x4f124b){if(_0x4f124b){return _0x17ba2[_0xe7c2('0x1a')](_0x41cd17);}return _0x17ba2[_0xe7c2('0x1b')](_0x41cd17)[_0xe7c2('0x1c')]();};}function respondWithResult(_0x555601,_0x5e00e4){_0x5e00e4=_0x5e00e4||0xc8;return function(_0x17020f){if(_0x17020f){return _0x555601['status'](_0x5e00e4)['json'](_0x17020f);}};}function respondWithFilteredResult(_0x34f6e8,_0x339dc0){return function(_0x567925){if(_0x567925){var _0x204353=typeof _0x339dc0[_0xe7c2('0x1d')]===_0xe7c2('0x1e')&&typeof _0x339dc0[_0xe7c2('0x1f')]===_0xe7c2('0x1e');var _0x10263c=_0x567925[_0xe7c2('0x20')];var _0x8e413=_0x204353?0x0:_0x339dc0[_0xe7c2('0x1d')];var _0x3e328e=_0x204353?_0x567925[_0xe7c2('0x20')]:_0x339dc0['offset']+_0x339dc0[_0xe7c2('0x1f')];var _0x16c5a2;if(_0x3e328e>=_0x10263c){_0x3e328e=_0x10263c;_0x16c5a2=0xc8;}else{_0x16c5a2=0xce;}_0x34f6e8[_0xe7c2('0x1b')](_0x16c5a2);return _0x34f6e8[_0xe7c2('0x21')](_0xe7c2('0x22'),_0x8e413+'-'+_0x3e328e+'/'+_0x10263c)[_0xe7c2('0x23')](_0x567925);}return null;};}function patchUpdates(_0x3d35d4){return function(_0x32b6e2){try{jsonpatch[_0xe7c2('0x24')](_0x32b6e2,_0x3d35d4,!![]);}catch(_0x2cca1e){return BPromise['reject'](_0x2cca1e);}return _0x32b6e2[_0xe7c2('0x25')]();};}function saveUpdates(_0x4486d1,_0x3c4f3b){return function(_0x47c5fe){if(_0x47c5fe){return _0x47c5fe['update'](_0x4486d1)[_0xe7c2('0x26')](function(_0x292e10){return _0x292e10;});}return null;};}function removeEntity(_0x2032d8,_0x26a821){return function(_0x5ce659){if(_0x5ce659){return _0x5ce659['destroy']()[_0xe7c2('0x26')](function(){_0x2032d8['status'](0xcc)[_0xe7c2('0x1c')]();});}};}function handleEntityNotFound(_0x204398,_0x99f955){return function(_0x111d24){if(!_0x111d24){_0x204398[_0xe7c2('0x1a')](0x194);}return _0x111d24;};}function handleError(_0x5841b0,_0x10d840){_0x10d840=_0x10d840||0x1f4;return function(_0x13639f){logger[_0xe7c2('0x27')](_0x13639f[_0xe7c2('0x28')]);if(_0x13639f['name']){delete _0x13639f[_0xe7c2('0x29')];}_0x5841b0['status'](_0x10d840)[_0xe7c2('0x2a')](_0x13639f);};}exports[_0xe7c2('0x2b')]=function(_0x29fb3a,_0x4301f9){var _0x508ce9={},_0x1e89f8={},_0x2282b3={'count':0x0,'rows':[]};var _0x304b7f=_[_0xe7c2('0x2c')](db[_0xe7c2('0x2d')][_0xe7c2('0x2e')],function(_0x97ecc3){return{'name':_0x97ecc3[_0xe7c2('0x2f')],'type':_0x97ecc3[_0xe7c2('0x30')][_0xe7c2('0x31')]};});_0x1e89f8[_0xe7c2('0x32')]=_['map'](_0x304b7f,_0xe7c2('0x29'));_0x1e89f8[_0xe7c2('0x33')]=_['keys'](_0x29fb3a[_0xe7c2('0x33')]);_0x1e89f8['filters']=_[_0xe7c2('0x34')](_0x1e89f8[_0xe7c2('0x32')],_0x1e89f8[_0xe7c2('0x33')]);_0x508ce9['attributes']=_['intersection'](_0x1e89f8[_0xe7c2('0x32')],qs[_0xe7c2('0x35')](_0x29fb3a[_0xe7c2('0x33')]['fields']));_0x508ce9[_0xe7c2('0x36')]=_0x508ce9[_0xe7c2('0x36')][_0xe7c2('0x37')]?_0x508ce9[_0xe7c2('0x36')]:_0x1e89f8[_0xe7c2('0x32')];if(!_0x29fb3a['query'][_0xe7c2('0x38')](_0xe7c2('0x39'))){_0x508ce9[_0xe7c2('0x1f')]=qs['limit'](_0x29fb3a[_0xe7c2('0x33')][_0xe7c2('0x1f')]);_0x508ce9['offset']=qs['offset'](_0x29fb3a['query'][_0xe7c2('0x1d')]);}_0x508ce9[_0xe7c2('0x3a')]=qs[_0xe7c2('0x3b')](_0x29fb3a[_0xe7c2('0x33')][_0xe7c2('0x3b')]);_0x508ce9[_0xe7c2('0x3c')]=qs[_0xe7c2('0x3d')](_[_0xe7c2('0x3e')](_0x29fb3a[_0xe7c2('0x33')],_0x1e89f8[_0xe7c2('0x3d')]),_0x304b7f);if(_0x29fb3a[_0xe7c2('0x33')][_0xe7c2('0x3f')]){_0x508ce9['where']=_[_0xe7c2('0x40')](_0x508ce9['where'],{'$or':_[_0xe7c2('0x2c')](_0x304b7f,function(_0x52396c){if(_0x52396c[_0xe7c2('0x30')]!==_0xe7c2('0x41')){var _0x255761={};_0x255761[_0x52396c[_0xe7c2('0x29')]]={'$like':'%'+_0x29fb3a[_0xe7c2('0x33')]['filter']+'%'};return _0x255761;}})});}_0x508ce9=_[_0xe7c2('0x40')]({},_0x508ce9,_0x29fb3a[_0xe7c2('0x42')]);var _0x300ef4={'where':_0x508ce9[_0xe7c2('0x3c')]};return db[_0xe7c2('0x2d')][_0xe7c2('0x20')](_0x300ef4)[_0xe7c2('0x26')](function(_0x2335cd){_0x2282b3[_0xe7c2('0x20')]=_0x2335cd;if(_0x29fb3a[_0xe7c2('0x33')][_0xe7c2('0x43')]){_0x508ce9[_0xe7c2('0x44')]=[{'all':!![]}];}return db[_0xe7c2('0x2d')][_0xe7c2('0x45')](_0x508ce9);})[_0xe7c2('0x26')](function(_0x192b7d){_0x2282b3['rows']=_0x192b7d;return _0x2282b3;})['then'](respondWithFilteredResult(_0x4301f9,_0x508ce9))[_0xe7c2('0x46')](handleError(_0x4301f9,null));};exports[_0xe7c2('0x47')]=function(_0x33996e,_0xd201d){var _0x215761={'raw':!![],'where':{'id':_0x33996e[_0xe7c2('0x48')]['id']}},_0x142518={};_0x142518[_0xe7c2('0x32')]=_[_0xe7c2('0x49')](db[_0xe7c2('0x2d')][_0xe7c2('0x2e')]);_0x142518[_0xe7c2('0x33')]=_[_0xe7c2('0x49')](_0x33996e[_0xe7c2('0x33')]);_0x142518['filters']=_['intersection'](_0x142518[_0xe7c2('0x32')],_0x142518[_0xe7c2('0x33')]);_0x215761[_0xe7c2('0x36')]=_[_0xe7c2('0x34')](_0x142518[_0xe7c2('0x32')],qs['fields'](_0x33996e['query'][_0xe7c2('0x35')]));_0x215761[_0xe7c2('0x36')]=_0x215761[_0xe7c2('0x36')][_0xe7c2('0x37')]?_0x215761[_0xe7c2('0x36')]:_0x142518[_0xe7c2('0x32')];if(_0x33996e[_0xe7c2('0x33')][_0xe7c2('0x43')]){_0x215761[_0xe7c2('0x44')]=[{'all':!![]}];}_0x215761=_[_0xe7c2('0x40')]({},_0x215761,_0x33996e[_0xe7c2('0x42')]);return db[_0xe7c2('0x2d')]['find'](_0x215761)['then'](handleEntityNotFound(_0xd201d,null))[_0xe7c2('0x26')](respondWithResult(_0xd201d,null))['catch'](handleError(_0xd201d,null));};exports[_0xe7c2('0x4a')]=function(_0x4871f3,_0x5024e6){return db[_0xe7c2('0x2d')][_0xe7c2('0x4a')](_0x4871f3[_0xe7c2('0x4b')],{})[_0xe7c2('0x26')](respondWithResult(_0x5024e6,0xc9))['catch'](handleError(_0x5024e6,null));};exports[_0xe7c2('0x4c')]=function(_0x5a1188,_0x224d05){if(_0x5a1188[_0xe7c2('0x4b')]['id']){delete _0x5a1188[_0xe7c2('0x4b')]['id'];}return db[_0xe7c2('0x2d')][_0xe7c2('0x4d')]({'where':{'id':_0x5a1188[_0xe7c2('0x48')]['id']}})[_0xe7c2('0x26')](handleEntityNotFound(_0x224d05,null))[_0xe7c2('0x26')](saveUpdates(_0x5a1188['body'],null))[_0xe7c2('0x26')](respondWithResult(_0x224d05,null))[_0xe7c2('0x46')](handleError(_0x224d05,null));};exports[_0xe7c2('0x4e')]=function(_0x4eaba7,_0x1f5b39){return db[_0xe7c2('0x2d')][_0xe7c2('0x4d')]({'where':{'id':_0x4eaba7['params']['id']}})[_0xe7c2('0x26')](handleEntityNotFound(_0x1f5b39,null))[_0xe7c2('0x26')](removeEntity(_0x1f5b39,null))[_0xe7c2('0x46')](handleError(_0x1f5b39,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 145a558..af6c2da 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.model.js +++ b/server/api/intDynamics365Field/intDynamics365Field.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x463d=['../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','idField','FieldId','util','../../config/logger','moment','bluebird','path'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x463d,0x19f));var _0xd463=function(_0x401f2e,_0x119d0d){_0x401f2e=_0x401f2e-0x0;var _0x4ef876=_0x463d[_0x401f2e];return _0x4ef876;};'use strict';var _=require('lodash');var util=require(_0xd463('0x0'));var logger=require(_0xd463('0x1'))('api');var moment=require(_0xd463('0x2'));var BPromise=require(_0xd463('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd463('0x4'));var rimraf=require('rimraf');var config=require(_0xd463('0x5'));var attributes=require(_0xd463('0x6'));module[_0xd463('0x7')]=function(_0x38834f,_0x5b33dd){return _0x38834f['define'](_0xd463('0x8'),attributes,{'tableName':_0xd463('0x9'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xd463('0xa'),_0xd463('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x73a4=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x1c32ec,_0x54e5f3){var _0x4ef7cc=function(_0xa163f3){while(--_0xa163f3){_0x1c32ec['push'](_0x1c32ec['shift']());}};_0x4ef7cc(++_0x54e5f3);}(_0x73a4,0x1ef));var _0x473a=function(_0x48a46a,_0x360d95){_0x48a46a=_0x48a46a-0x0;var _0x3c9260=_0x73a4[_0x48a46a];return _0x3c9260;};'use strict';var _=require(_0x473a('0x0'));var util=require(_0x473a('0x1'));var logger=require(_0x473a('0x2'))(_0x473a('0x3'));var moment=require(_0x473a('0x4'));var BPromise=require('bluebird');var rp=require(_0x473a('0x5'));var fs=require('fs');var path=require(_0x473a('0x6'));var rimraf=require(_0x473a('0x7'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x2f78fb,_0x1a93f3){return _0x2f78fb[_0x473a('0x8')](_0x473a('0x9'),attributes,{'tableName':_0x473a('0xa'),'paranoid':![],'indexes':[{'name':_0x473a('0xb'),'fields':['idField',_0x473a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 7387327..1281991 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js +++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcfb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis'];(function(_0x3a9a09,_0x1a8c8b){var _0x238261=function(_0x373552){while(--_0x373552){_0x3a9a09['push'](_0x3a9a09['shift']());}};_0x238261(++_0x1a8c8b);}(_0xbcfb,0x1b5));var _0xbbcf=function(_0x1fa760,_0x1bf063){_0x1fa760=_0x1fa760-0x0;var _0xd8eda1=_0xbcfb[_0x1fa760];return _0xd8eda1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xbbcf('0x0'));var rs=require(_0xbbcf('0x1'));var fs=require('fs');var Redis=require(_0xbbcf('0x2'));var db=require(_0xbbcf('0x3'))['db'];var utils=require(_0xbbcf('0x4'));var logger=require(_0xbbcf('0x5'))(_0xbbcf('0x6'));var config=require(_0xbbcf('0x7'));var jayson=require(_0xbbcf('0x8'));var client=jayson[_0xbbcf('0x9')][_0xbbcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33ff85,_0x265247,_0x5570d4){return new BPromise(function(_0x2d0e14,_0x206e33){return client[_0xbbcf('0xb')](_0x33ff85,_0x5570d4)[_0xbbcf('0xc')](function(_0x12612e){logger['info'](_0xbbcf('0xd'),_0x265247,_0xbbcf('0xe'));logger[_0xbbcf('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x265247,_0xbbcf('0xe'),JSON[_0xbbcf('0x10')](_0x12612e));if(_0x12612e[_0xbbcf('0x11')]){if(_0x12612e[_0xbbcf('0x11')][_0xbbcf('0x12')]===0x1f4){logger[_0xbbcf('0x11')](_0xbbcf('0xd'),_0x265247,_0x12612e['error'][_0xbbcf('0x13')]);return _0x206e33(_0x12612e[_0xbbcf('0x11')][_0xbbcf('0x13')]);}logger[_0xbbcf('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x265247,_0x12612e[_0xbbcf('0x11')][_0xbbcf('0x13')]);return _0x2d0e14(_0x12612e['error'][_0xbbcf('0x13')]);}else{logger['info'](_0xbbcf('0xd'),_0x265247,_0xbbcf('0xe'));_0x2d0e14(_0x12612e[_0xbbcf('0x14')]['message']);}})[_0xbbcf('0x15')](function(_0x4cb11a){logger[_0xbbcf('0x11')](_0xbbcf('0xd'),_0x265247,_0x4cb11a);_0x206e33(_0x4cb11a);});});} \ No newline at end of file +var _0x2bbd=['Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x502d3c,_0x5f2fa9){var _0x12261a=function(_0x6b3ca3){while(--_0x6b3ca3){_0x502d3c['push'](_0x502d3c['shift']());}};_0x12261a(++_0x5f2fa9);}(_0x2bbd,0x13c));var _0xd2bb=function(_0x42d451,_0x2436ce){_0x42d451=_0x42d451-0x0;var _0x2ebac0=_0x2bbd[_0x42d451];return _0x2ebac0;};'use strict';var _=require(_0xd2bb('0x0'));var util=require(_0xd2bb('0x1'));var moment=require('moment');var BPromise=require(_0xd2bb('0x2'));var rs=require(_0xd2bb('0x3'));var fs=require('fs');var Redis=require(_0xd2bb('0x4'));var db=require(_0xd2bb('0x5'))['db'];var utils=require(_0xd2bb('0x6'));var logger=require(_0xd2bb('0x7'))(_0xd2bb('0x8'));var config=require(_0xd2bb('0x9'));var jayson=require(_0xd2bb('0xa'));var client=jayson[_0xd2bb('0xb')][_0xd2bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29267b,_0x5b28c7,_0x1a2f43){return new BPromise(function(_0x382735,_0xea37b3){return client[_0xd2bb('0xd')](_0x29267b,_0x1a2f43)[_0xd2bb('0xe')](function(_0x12b1df){logger[_0xd2bb('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x5b28c7,'request\x20sent');logger[_0xd2bb('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x5b28c7,_0xd2bb('0x11'),JSON[_0xd2bb('0x12')](_0x12b1df));if(_0x12b1df['error']){if(_0x12b1df[_0xd2bb('0x13')]['code']===0x1f4){logger['error'](_0xd2bb('0x14'),_0x5b28c7,_0x12b1df[_0xd2bb('0x13')]['message']);return _0xea37b3(_0x12b1df[_0xd2bb('0x13')][_0xd2bb('0x15')]);}logger['error'](_0xd2bb('0x14'),_0x5b28c7,_0x12b1df[_0xd2bb('0x13')]['message']);return _0x382735(_0x12b1df[_0xd2bb('0x13')]['message']);}else{logger[_0xd2bb('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x5b28c7,_0xd2bb('0x11'));_0x382735(_0x12b1df[_0xd2bb('0x16')][_0xd2bb('0x15')]);}})[_0xd2bb('0x17')](function(_0xf31793){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x5b28c7,_0xf31793);_0xea37b3(_0xf31793);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index a71eb7d..c1ffdd6 100644 --- a/server/api/intFreshdeskAccount/index.js +++ b/server/api/intFreshdeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e58=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x54d4fa,_0x48ecfd){var _0x52b7e4=function(_0x23b321){while(--_0x23b321){_0x54d4fa['push'](_0x54d4fa['shift']());}};_0x52b7e4(++_0x48ecfd);}(_0x8e58,0x183));var _0x88e5=function(_0x1b3b3b,_0x18a3f6){_0x1b3b3b=_0x1b3b3b-0x0;var _0x3ce36a=_0x8e58[_0x1b3b3b];return _0x3ce36a;};'use strict';var multer=require(_0x88e5('0x0'));var util=require(_0x88e5('0x1'));var path=require(_0x88e5('0x2'));var timeout=require(_0x88e5('0x3'));var express=require(_0x88e5('0x4'));var router=express['Router']();var fs_extra=require(_0x88e5('0x5'));var auth=require(_0x88e5('0x6'));var interaction=require(_0x88e5('0x7'));var config=require(_0x88e5('0x8'));var controller=require(_0x88e5('0x9'));router[_0x88e5('0xa')]('/',auth[_0x88e5('0xb')](),controller['index']);router[_0x88e5('0xa')]('/:id',auth[_0x88e5('0xb')](),controller[_0x88e5('0xc')]);router[_0x88e5('0xa')](_0x88e5('0xd'),auth['isAuthenticated'](),controller[_0x88e5('0xe')]);router[_0x88e5('0xa')](_0x88e5('0xf'),auth['isAuthenticated'](),controller[_0x88e5('0x10')]);router[_0x88e5('0x11')]('/',auth['isAuthenticated'](),controller[_0x88e5('0x12')]);router['post']('/:id/configurations',auth[_0x88e5('0xb')](),controller[_0x88e5('0x13')]);router[_0x88e5('0x14')](_0x88e5('0x15'),auth['isAuthenticated'](),controller[_0x88e5('0x16')]);router[_0x88e5('0x17')](_0x88e5('0x15'),auth[_0x88e5('0xb')](),controller[_0x88e5('0x18')]);module[_0x88e5('0x19')]=router; \ No newline at end of file +var _0xcf13=['../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x5e5275,_0x893b69){var _0x18fb88=function(_0x44bfbb){while(--_0x44bfbb){_0x5e5275['push'](_0x5e5275['shift']());}};_0x18fb88(++_0x893b69);}(_0xcf13,0xea));var _0x3cf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf13[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3cf1('0x0'));var util=require(_0x3cf1('0x1'));var path=require(_0x3cf1('0x2'));var timeout=require('connect-timeout');var express=require(_0x3cf1('0x3'));var router=express[_0x3cf1('0x4')]();var fs_extra=require(_0x3cf1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3cf1('0x6'));var config=require(_0x3cf1('0x7'));var controller=require(_0x3cf1('0x8'));router[_0x3cf1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3cf1('0x9')]('/:id',auth[_0x3cf1('0xa')](),controller[_0x3cf1('0xb')]);router[_0x3cf1('0x9')]('/:id/configurations',auth[_0x3cf1('0xa')](),controller[_0x3cf1('0xc')]);router['get'](_0x3cf1('0xd'),auth[_0x3cf1('0xa')](),controller[_0x3cf1('0xe')]);router[_0x3cf1('0xf')]('/',auth[_0x3cf1('0xa')](),controller[_0x3cf1('0x10')]);router[_0x3cf1('0xf')](_0x3cf1('0x11'),auth['isAuthenticated'](),controller[_0x3cf1('0x12')]);router[_0x3cf1('0x13')]('/:id',auth[_0x3cf1('0xa')](),controller[_0x3cf1('0x14')]);router[_0x3cf1('0x15')](_0x3cf1('0x16'),auth[_0x3cf1('0xa')](),controller[_0x3cf1('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 4f21644..3c38b45 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa456=['STRING','username','sequelize','exports'];(function(_0x54d63c,_0x488ece){var _0x123f71=function(_0x595695){while(--_0x595695){_0x54d63c['push'](_0x54d63c['shift']());}};_0x123f71(++_0x488ece);}(_0xa456,0x142));var _0x6a45=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xa456[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0x6a45('0x0'));module[_0x6a45('0x1')]={'name':{'type':Sequelize[_0x6a45('0x2')]},'description':{'type':Sequelize[_0x6a45('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6a45('0x3')},'apiKey':{'type':Sequelize[_0x6a45('0x2')]},'remoteUri':{'type':Sequelize[_0x6a45('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6a45('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5464=['remoteUri','sequelize','exports','STRING'];(function(_0x2c14a6,_0x1f9a92){var _0x35bb6a=function(_0x163f5e){while(--_0x163f5e){_0x2c14a6['push'](_0x2c14a6['shift']());}};_0x35bb6a(++_0x1f9a92);}(_0x5464,0x15d));var _0x4546=function(_0x504041,_0xadb865){_0x504041=_0x504041-0x0;var _0x2808ee=_0x5464[_0x504041];return _0x2808ee;};'use strict';var Sequelize=require(_0x4546('0x0'));module[_0x4546('0x1')]={'name':{'type':Sequelize[_0x4546('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4546('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x4546('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4546('0x3')},'serverUrl':{'type':Sequelize[_0x4546('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index bed30a0..e30cf2a 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd20=['moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshdeskAccount','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','count','includeAll','findAll','catch','params','rawAttributes','include','options','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','Subjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','apiKey','remoteUri','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','subject','agent','description','priority','group','source','ticket_type','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise'];(function(_0x1a2388,_0x112e49){var _0x320102=function(_0x48620b){while(--_0x48620b){_0x1a2388['push'](_0x1a2388['shift']());}};_0x320102(++_0x112e49);}(_0xbd20,0x14a));var _0x0bd2=function(_0x31aaeb,_0x6194ef){_0x31aaeb=_0x31aaeb-0x0;var _0x2e97da=_0xbd20[_0x31aaeb];return _0x2e97da;};'use strict';var emlformat=require(_0x0bd2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0bd2('0x1'));var rp=require(_0x0bd2('0x2'));var moment=require(_0x0bd2('0x3'));var BPromise=require(_0x0bd2('0x4'));var Mustache=require(_0x0bd2('0x5'));var util=require('util');var path=require(_0x0bd2('0x6'));var sox=require(_0x0bd2('0x7'));var csv=require(_0x0bd2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bd2('0x9'));var _=require(_0x0bd2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0bd2('0xb'));var deskjs=require(_0x0bd2('0xc'));var toCsv=require(_0x0bd2('0x8'));var querystring=require(_0x0bd2('0xd'));var Papa=require(_0x0bd2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0bd2('0xf'));var as=require(_0x0bd2('0x10'));var hardwareService=require(_0x0bd2('0x11'));var logger=require(_0x0bd2('0x12'))(_0x0bd2('0x13'));var utils=require('../../config/utils');var config=require(_0x0bd2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bd2('0x15'))['db'];var integrations=require(_0x0bd2('0x16'));function respondWithStatusCode(_0x4c6b99,_0x5f0205){_0x5f0205=_0x5f0205||0xcc;return function(_0x2ca03f){if(_0x2ca03f){return _0x4c6b99[_0x0bd2('0x17')](_0x5f0205);}return _0x4c6b99[_0x0bd2('0x18')](_0x5f0205)[_0x0bd2('0x19')]();};}function respondWithResult(_0x2abcc8,_0x561b0f){_0x561b0f=_0x561b0f||0xc8;return function(_0x5009b4){if(_0x5009b4){return _0x2abcc8[_0x0bd2('0x18')](_0x561b0f)[_0x0bd2('0x1a')](_0x5009b4);}};}function respondWithFilteredResult(_0x5255ec,_0x283f31){return function(_0xd988bb){if(_0xd988bb){var _0x26dbe1=typeof _0x283f31[_0x0bd2('0x1b')]===_0x0bd2('0x1c')&&typeof _0x283f31[_0x0bd2('0x1d')]===_0x0bd2('0x1c');var _0x51d4d6=_0xd988bb['count'];var _0x21aedf=_0x26dbe1?0x0:_0x283f31[_0x0bd2('0x1b')];var _0x452a9b=_0x26dbe1?_0xd988bb['count']:_0x283f31[_0x0bd2('0x1b')]+_0x283f31['limit'];var _0x34a093;if(_0x452a9b>=_0x51d4d6){_0x452a9b=_0x51d4d6;_0x34a093=0xc8;}else{_0x34a093=0xce;}_0x5255ec['status'](_0x34a093);return _0x5255ec[_0x0bd2('0x1e')](_0x0bd2('0x1f'),_0x21aedf+'-'+_0x452a9b+'/'+_0x51d4d6)[_0x0bd2('0x1a')](_0xd988bb);}return null;};}function patchUpdates(_0x4b1a3e){return function(_0x21206b){try{jsonpatch[_0x0bd2('0x20')](_0x21206b,_0x4b1a3e,!![]);}catch(_0x18336d){return BPromise[_0x0bd2('0x21')](_0x18336d);}return _0x21206b[_0x0bd2('0x22')]();};}function saveUpdates(_0x5cdac7,_0x36b3c4){return function(_0x318b7d){if(_0x318b7d){return _0x318b7d[_0x0bd2('0x23')](_0x5cdac7)[_0x0bd2('0x24')](function(_0x277ae9){return _0x277ae9;});}return null;};}function removeEntity(_0x343a99,_0xe47fb){return function(_0x2cd160){if(_0x2cd160){return _0x2cd160[_0x0bd2('0x25')]()[_0x0bd2('0x24')](function(){_0x343a99[_0x0bd2('0x18')](0xcc)[_0x0bd2('0x19')]();});}};}function handleEntityNotFound(_0x3760a4,_0x3a3eff){return function(_0x1b4c9e){if(!_0x1b4c9e){_0x3760a4[_0x0bd2('0x17')](0x194);}return _0x1b4c9e;};}function handleError(_0x3d63f2,_0x5f0514){_0x5f0514=_0x5f0514||0x1f4;return function(_0x5b8061){logger[_0x0bd2('0x26')](_0x5b8061[_0x0bd2('0x27')]);if(_0x5b8061[_0x0bd2('0x28')]){delete _0x5b8061[_0x0bd2('0x28')];}_0x3d63f2[_0x0bd2('0x18')](_0x5f0514)[_0x0bd2('0x29')](_0x5b8061);};}exports['index']=function(_0x459bd6,_0x507a1e){var _0x37e5a4={},_0x492035={},_0x94a33b={'count':0x0,'rows':[]};var _0x4a4e46=_[_0x0bd2('0x2a')](db[_0x0bd2('0x2b')]['rawAttributes'],function(_0x28d658){return{'name':_0x28d658['fieldName'],'type':_0x28d658['type'][_0x0bd2('0x2c')]};});_0x492035[_0x0bd2('0x2d')]=_[_0x0bd2('0x2a')](_0x4a4e46,'name');_0x492035[_0x0bd2('0x2e')]=_[_0x0bd2('0x2f')](_0x459bd6['query']);_0x492035[_0x0bd2('0x30')]=_[_0x0bd2('0x31')](_0x492035[_0x0bd2('0x2d')],_0x492035['query']);_0x37e5a4[_0x0bd2('0x32')]=_[_0x0bd2('0x31')](_0x492035[_0x0bd2('0x2d')],qs[_0x0bd2('0x33')](_0x459bd6[_0x0bd2('0x2e')]['fields']));_0x37e5a4[_0x0bd2('0x32')]=_0x37e5a4['attributes'][_0x0bd2('0x34')]?_0x37e5a4[_0x0bd2('0x32')]:_0x492035[_0x0bd2('0x2d')];if(!_0x459bd6[_0x0bd2('0x2e')][_0x0bd2('0x35')](_0x0bd2('0x36'))){_0x37e5a4['limit']=qs[_0x0bd2('0x1d')](_0x459bd6[_0x0bd2('0x2e')][_0x0bd2('0x1d')]);_0x37e5a4['offset']=qs['offset'](_0x459bd6[_0x0bd2('0x2e')][_0x0bd2('0x1b')]);}_0x37e5a4[_0x0bd2('0x37')]=qs[_0x0bd2('0x38')](_0x459bd6['query']['sort']);_0x37e5a4[_0x0bd2('0x39')]=qs[_0x0bd2('0x30')](_['pick'](_0x459bd6[_0x0bd2('0x2e')],_0x492035[_0x0bd2('0x30')]),_0x4a4e46);if(_0x459bd6[_0x0bd2('0x2e')][_0x0bd2('0x3a')]){_0x37e5a4[_0x0bd2('0x39')]=_[_0x0bd2('0x3b')](_0x37e5a4['where'],{'$or':_[_0x0bd2('0x2a')](_0x4a4e46,function(_0x41a99f){if(_0x41a99f[_0x0bd2('0x3c')]!==_0x0bd2('0x3d')){var _0x17d925={};_0x17d925[_0x41a99f[_0x0bd2('0x28')]]={'$like':'%'+_0x459bd6[_0x0bd2('0x2e')][_0x0bd2('0x3a')]+'%'};return _0x17d925;}})});}_0x37e5a4=_[_0x0bd2('0x3b')]({},_0x37e5a4,_0x459bd6['options']);var _0x44a7e9={'where':_0x37e5a4[_0x0bd2('0x39')]};return db[_0x0bd2('0x2b')]['count'](_0x44a7e9)[_0x0bd2('0x24')](function(_0x39fb7a){_0x94a33b[_0x0bd2('0x3e')]=_0x39fb7a;if(_0x459bd6['query'][_0x0bd2('0x3f')]){_0x37e5a4['include']=[{'all':!![]}];}return db[_0x0bd2('0x2b')][_0x0bd2('0x40')](_0x37e5a4);})[_0x0bd2('0x24')](function(_0x5450a8){_0x94a33b['rows']=_0x5450a8;return _0x94a33b;})['then'](respondWithFilteredResult(_0x507a1e,_0x37e5a4))[_0x0bd2('0x41')](handleError(_0x507a1e,null));};exports['show']=function(_0x450718,_0x31d7f6){var _0x385dec={'raw':![],'where':{'id':_0x450718[_0x0bd2('0x42')]['id']}},_0x27c0d6={};_0x27c0d6[_0x0bd2('0x2d')]=_[_0x0bd2('0x2f')](db[_0x0bd2('0x2b')][_0x0bd2('0x43')]);_0x27c0d6[_0x0bd2('0x2e')]=_[_0x0bd2('0x2f')](_0x450718[_0x0bd2('0x2e')]);_0x27c0d6[_0x0bd2('0x30')]=_[_0x0bd2('0x31')](_0x27c0d6[_0x0bd2('0x2d')],_0x27c0d6[_0x0bd2('0x2e')]);_0x385dec[_0x0bd2('0x32')]=_[_0x0bd2('0x31')](_0x27c0d6[_0x0bd2('0x2d')],qs[_0x0bd2('0x33')](_0x450718['query'][_0x0bd2('0x33')]));_0x385dec[_0x0bd2('0x32')]=_0x385dec['attributes']['length']?_0x385dec['attributes']:_0x27c0d6[_0x0bd2('0x2d')];if(_0x450718[_0x0bd2('0x2e')][_0x0bd2('0x3f')]){_0x385dec[_0x0bd2('0x44')]=[{'all':!![]}];}_0x385dec=_[_0x0bd2('0x3b')]({},_0x385dec,_0x450718[_0x0bd2('0x45')]);return db['FreshdeskAccount'][_0x0bd2('0x46')](_0x385dec)[_0x0bd2('0x24')](handleEntityNotFound(_0x31d7f6,null))[_0x0bd2('0x24')](respondWithResult(_0x31d7f6,null))[_0x0bd2('0x41')](handleError(_0x31d7f6,null));};exports['create']=function(_0x4e9082,_0xe1cd70){return db[_0x0bd2('0x2b')][_0x0bd2('0x47')](_0x4e9082['body'],{})[_0x0bd2('0x24')](respondWithResult(_0xe1cd70,0xc9))[_0x0bd2('0x41')](handleError(_0xe1cd70,null));};exports[_0x0bd2('0x23')]=function(_0x59bbfb,_0x3bd3d2){if(_0x59bbfb[_0x0bd2('0x48')]['id']){delete _0x59bbfb[_0x0bd2('0x48')]['id'];}return db[_0x0bd2('0x2b')]['find']({'where':{'id':_0x59bbfb['params']['id']}})[_0x0bd2('0x24')](handleEntityNotFound(_0x3bd3d2,null))[_0x0bd2('0x24')](saveUpdates(_0x59bbfb['body'],null))['then'](respondWithResult(_0x3bd3d2,null))[_0x0bd2('0x41')](handleError(_0x3bd3d2,null));};exports['destroy']=function(_0x4dbf8e,_0xd9c3e3){return db[_0x0bd2('0x2b')][_0x0bd2('0x46')]({'where':{'id':_0x4dbf8e[_0x0bd2('0x42')]['id']}})[_0x0bd2('0x24')](handleEntityNotFound(_0xd9c3e3,null))['then'](removeEntity(_0xd9c3e3,null))[_0x0bd2('0x41')](handleError(_0xd9c3e3,null));};exports[_0x0bd2('0x49')]=function(_0x4b8a8e,_0x334d64,_0x11fed8){var _0x392e39={};var _0x1a1733={};var _0x10ec95;var _0x30f9c9;return db['FreshdeskAccount'][_0x0bd2('0x4a')]({'where':{'id':_0x4b8a8e[_0x0bd2('0x42')]['id']}})[_0x0bd2('0x24')](handleEntityNotFound(_0x334d64,null))['then'](function(_0x3ca4f1){if(_0x3ca4f1){_0x10ec95=_0x3ca4f1;_0x1a1733['model']=_[_0x0bd2('0x2f')](db[_0x0bd2('0x4b')]['rawAttributes']);_0x1a1733[_0x0bd2('0x2e')]=_[_0x0bd2('0x2f')](_0x4b8a8e['query']);_0x1a1733[_0x0bd2('0x30')]=_[_0x0bd2('0x31')](_0x1a1733['model'],_0x1a1733[_0x0bd2('0x2e')]);_0x392e39['attributes']=_[_0x0bd2('0x31')](_0x1a1733[_0x0bd2('0x2d')],qs[_0x0bd2('0x33')](_0x4b8a8e[_0x0bd2('0x2e')][_0x0bd2('0x33')]));_0x392e39['attributes']=_0x392e39['attributes'][_0x0bd2('0x34')]?_0x392e39[_0x0bd2('0x32')]:_0x1a1733[_0x0bd2('0x2d')];_0x392e39['order']=qs[_0x0bd2('0x38')](_0x4b8a8e['query'][_0x0bd2('0x38')]);_0x392e39['where']=qs[_0x0bd2('0x30')](_['pick'](_0x4b8a8e[_0x0bd2('0x2e')],_0x1a1733[_0x0bd2('0x30')]));if(_0x4b8a8e[_0x0bd2('0x2e')][_0x0bd2('0x3a')]){_0x392e39[_0x0bd2('0x39')]=_[_0x0bd2('0x3b')](_0x392e39[_0x0bd2('0x39')],{'$or':_[_0x0bd2('0x2a')](_0x392e39[_0x0bd2('0x32')],function(_0x35d4cf){var _0xb3a6f5={};_0xb3a6f5[_0x35d4cf]={'$like':'%'+_0x4b8a8e['query'][_0x0bd2('0x3a')]+'%'};return _0xb3a6f5;})});}_0x392e39=_['merge']({},_0x392e39,_0x4b8a8e['options']);return _0x10ec95[_0x0bd2('0x49')](_0x392e39);}})[_0x0bd2('0x24')](function(_0x474b19){if(_0x474b19){_0x30f9c9=_0x474b19['length'];if(!_0x4b8a8e[_0x0bd2('0x2e')]['hasOwnProperty'](_0x0bd2('0x36'))){_0x392e39['limit']=qs[_0x0bd2('0x1d')](_0x4b8a8e[_0x0bd2('0x2e')][_0x0bd2('0x1d')]);_0x392e39[_0x0bd2('0x1b')]=qs[_0x0bd2('0x1b')](_0x4b8a8e[_0x0bd2('0x2e')][_0x0bd2('0x1b')]);}return _0x10ec95[_0x0bd2('0x49')](_0x392e39);}})[_0x0bd2('0x24')](function(_0x384ec1){if(_0x384ec1){return _0x384ec1?{'count':_0x30f9c9,'rows':_0x384ec1}:null;}})[_0x0bd2('0x24')](respondWithResult(_0x334d64,null))[_0x0bd2('0x41')](handleError(_0x334d64,null));};exports['addConfiguration']=function(_0x261e1c,_0x26061f,_0x361fd8){if(_0x261e1c[_0x0bd2('0x48')]['id']){delete _0x261e1c[_0x0bd2('0x48')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x261e1c[_0x0bd2('0x42')]['id']}})[_0x0bd2('0x24')](handleEntityNotFound(_0x26061f,null))['then'](function(_0x4bd43e){if(_0x4bd43e){_0x261e1c['body']['AccountId']=_0x4bd43e['id'];_0x261e1c[_0x0bd2('0x48')][_0x0bd2('0x4c')]=integrations['getSubjects'](_0x261e1c[_0x0bd2('0x48')][_0x0bd2('0x4d')],_0x261e1c[_0x0bd2('0x48')][_0x0bd2('0x3c')]);_0x261e1c[_0x0bd2('0x48')]['Descriptions']=integrations[_0x0bd2('0x4e')](_0x261e1c[_0x0bd2('0x48')][_0x0bd2('0x4d')],_0x261e1c[_0x0bd2('0x48')]['type']);return db['FreshdeskConfiguration'][_0x0bd2('0x47')](_0x261e1c['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x0bd2('0x4c')},{'model':db[_0x0bd2('0x4f')],'as':_0x0bd2('0x50')}]});}return null;})[_0x0bd2('0x24')](respondWithResult(_0x26061f,null))['catch'](handleError(_0x26061f,null));};exports[_0x0bd2('0x51')]=function(_0x223c0a,_0xe12967,_0x391be9){var _0x307064='';return db['FreshdeskAccount'][_0x0bd2('0x4a')]({'where':{'id':_0x223c0a[_0x0bd2('0x42')]['id']},'attributes':['id','remoteUri',_0x0bd2('0x52')]})[_0x0bd2('0x24')](handleEntityNotFound(_0xe12967,null))['then'](function(_0x33e6e9){if(_0x33e6e9){_0x307064=_0x33e6e9[_0x0bd2('0x53')];var _0x1fbe95=_0x307064[_0x0bd2('0x54')](-0x1);if(_0x1fbe95==='/'){_0x307064=_0x307064[_0x0bd2('0x55')](0x0,_0x307064['lastIndexOf'](_0x1fbe95));}return rp({'method':_0x0bd2('0x56'),'uri':util[_0x0bd2('0x57')](_0x0bd2('0x58'),_0x307064,_0x0bd2('0x59')),'headers':{'Authorization':util[_0x0bd2('0x57')](_0x0bd2('0x5a'),new Buffer(util['format'](_0x0bd2('0x5b'),_0x33e6e9[_0x0bd2('0x52')]))[_0x0bd2('0x5c')]('base64'))},'json':!![]});}})[_0x0bd2('0x24')](function(_0x3532d3){if(_0x3532d3){var _0x4ac5fa=[_0x0bd2('0x5d'),_0x0bd2('0x5e'),_0x0bd2('0x5f'),_0x0bd2('0x60'),'status',_0x0bd2('0x61'),_0x0bd2('0x62'),_0x0bd2('0x63'),_0x0bd2('0x64'),_0x0bd2('0x62'),'company'];_['remove'](_0x3532d3,function(_0x455979){return _0x4ac5fa['includes'](_0x455979[_0x0bd2('0x28')])||!_0x455979[_0x0bd2('0x65')]&&_0x455979['type']!==_0x0bd2('0x66')&&_0x455979[_0x0bd2('0x3c')]!==_0x0bd2('0x67');});return{'count':_0x3532d3[_0x0bd2('0x34')],'rows':_[_0x0bd2('0x2a')](_0x3532d3,function(_0x46d71d){return{'id':_0x46d71d[_0x0bd2('0x28')],'name':_0x46d71d['label'],'custom':!_0x46d71d[_0x0bd2('0x65')],'options':_0x46d71d[_0x0bd2('0x68')]?_[_0x0bd2('0x2a')](_0x46d71d[_0x0bd2('0x68')],function(_0xf3c829){return{'name':_[_0x0bd2('0x69')](_0xf3c829),'value':_0xf3c829};}):[]};})};}})[_0x0bd2('0x24')](respondWithResult(_0xe12967,null))[_0x0bd2('0x41')](function(_0x415fb2){var _0x2753a3=_0x223c0a[_0x0bd2('0x2e')][_0x0bd2('0x6a')]?0x1f4:_0x415fb2[_0x0bd2('0x6b')]||0x1f4;logger['error'](_0x0bd2('0x6c'),_0x0bd2('0x51'),_0x2753a3,JSON[_0x0bd2('0x6d')](_0x415fb2));delete _0x415fb2[_0x0bd2('0x28')];if(_0x2753a3===0x191){_0x2753a3=0x190;}_0xe12967[_0x0bd2('0x18')](_0x2753a3)['send'](_0x223c0a[_0x0bd2('0x2e')][_0x0bd2('0x6a')]?{'message':_0x0bd2('0x6e'),'statusCode':_0x415fb2[_0x0bd2('0x6b')]}:_0x415fb2);});}; \ No newline at end of file +var _0x710e=['FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','body','find','destroy','findOne','FreshdeskConfiguration','order','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','FreshdeskField','getFields','remoteUri','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','apiKey','toString','base64','requester','description','group','ticket_type','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map'];(function(_0x4d8637,_0x2a9b29){var _0x4cdbfc=function(_0x27893a){while(--_0x27893a){_0x4d8637['push'](_0x4d8637['shift']());}};_0x4cdbfc(++_0x2a9b29);}(_0x710e,0xb6));var _0xe710=function(_0xf79660,_0x987d94){_0xf79660=_0xf79660-0x0;var _0x53223b=_0x710e[_0xf79660];return _0x53223b;};'use strict';var emlformat=require(_0xe710('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe710('0x1'));var rp=require(_0xe710('0x2'));var moment=require(_0xe710('0x3'));var BPromise=require(_0xe710('0x4'));var Mustache=require(_0xe710('0x5'));var util=require('util');var path=require(_0xe710('0x6'));var sox=require(_0xe710('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe710('0x8'));var _=require(_0xe710('0x9'));var squel=require(_0xe710('0xa'));var crypto=require(_0xe710('0xb'));var jsforce=require(_0xe710('0xc'));var deskjs=require(_0xe710('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe710('0xe'));var authService=require(_0xe710('0xf'));var qs=require(_0xe710('0x10'));var as=require(_0xe710('0x11'));var hardwareService=require(_0xe710('0x12'));var logger=require(_0xe710('0x13'))(_0xe710('0x14'));var utils=require(_0xe710('0x15'));var config=require(_0xe710('0x16'));var licenseUtil=require(_0xe710('0x17'));var db=require(_0xe710('0x18'))['db'];var integrations=require(_0xe710('0x19'));function respondWithStatusCode(_0x2061a1,_0x546c5a){_0x546c5a=_0x546c5a||0xcc;return function(_0x4c4aad){if(_0x4c4aad){return _0x2061a1[_0xe710('0x1a')](_0x546c5a);}return _0x2061a1[_0xe710('0x1b')](_0x546c5a)[_0xe710('0x1c')]();};}function respondWithResult(_0x183334,_0x422a84){_0x422a84=_0x422a84||0xc8;return function(_0x19114b){if(_0x19114b){return _0x183334['status'](_0x422a84)[_0xe710('0x1d')](_0x19114b);}};}function respondWithFilteredResult(_0xac5508,_0x329590){return function(_0x145312){if(_0x145312){var _0x21681b=typeof _0x329590[_0xe710('0x1e')]===_0xe710('0x1f')&&typeof _0x329590[_0xe710('0x20')]===_0xe710('0x1f');var _0x43d73a=_0x145312[_0xe710('0x21')];var _0x32870d=_0x21681b?0x0:_0x329590[_0xe710('0x1e')];var _0x5f28a4=_0x21681b?_0x145312[_0xe710('0x21')]:_0x329590['offset']+_0x329590['limit'];var _0x5dbfa5;if(_0x5f28a4>=_0x43d73a){_0x5f28a4=_0x43d73a;_0x5dbfa5=0xc8;}else{_0x5dbfa5=0xce;}_0xac5508['status'](_0x5dbfa5);return _0xac5508['set'](_0xe710('0x22'),_0x32870d+'-'+_0x5f28a4+'/'+_0x43d73a)[_0xe710('0x1d')](_0x145312);}return null;};}function patchUpdates(_0x1c3d82){return function(_0x4d43ba){try{jsonpatch[_0xe710('0x23')](_0x4d43ba,_0x1c3d82,!![]);}catch(_0x59165e){return BPromise[_0xe710('0x24')](_0x59165e);}return _0x4d43ba[_0xe710('0x25')]();};}function saveUpdates(_0x2568e9,_0x21b6b9){return function(_0x193441){if(_0x193441){return _0x193441[_0xe710('0x26')](_0x2568e9)[_0xe710('0x27')](function(_0x4de0fa){return _0x4de0fa;});}return null;};}function removeEntity(_0x54084a,_0x2401ac){return function(_0x1297c9){if(_0x1297c9){return _0x1297c9['destroy']()[_0xe710('0x27')](function(){_0x54084a[_0xe710('0x1b')](0xcc)[_0xe710('0x1c')]();});}};}function handleEntityNotFound(_0x3ce2ec,_0x538063){return function(_0x2664bc){if(!_0x2664bc){_0x3ce2ec[_0xe710('0x1a')](0x194);}return _0x2664bc;};}function handleError(_0x3a6f1b,_0x3e9998){_0x3e9998=_0x3e9998||0x1f4;return function(_0x420725){logger[_0xe710('0x28')](_0x420725[_0xe710('0x29')]);if(_0x420725[_0xe710('0x2a')]){delete _0x420725[_0xe710('0x2a')];}_0x3a6f1b[_0xe710('0x1b')](_0x3e9998)[_0xe710('0x2b')](_0x420725);};}exports[_0xe710('0x2c')]=function(_0x5df3fe,_0x20cf73){var _0x2a620c={},_0xd4864a={},_0x469f7b={'count':0x0,'rows':[]};var _0x395c7f=_[_0xe710('0x2d')](db[_0xe710('0x2e')][_0xe710('0x2f')],function(_0x4076d8){return{'name':_0x4076d8[_0xe710('0x30')],'type':_0x4076d8[_0xe710('0x31')][_0xe710('0x32')]};});_0xd4864a[_0xe710('0x33')]=_['map'](_0x395c7f,_0xe710('0x2a'));_0xd4864a['query']=_['keys'](_0x5df3fe[_0xe710('0x34')]);_0xd4864a[_0xe710('0x35')]=_['intersection'](_0xd4864a[_0xe710('0x33')],_0xd4864a[_0xe710('0x34')]);_0x2a620c[_0xe710('0x36')]=_[_0xe710('0x37')](_0xd4864a[_0xe710('0x33')],qs[_0xe710('0x38')](_0x5df3fe[_0xe710('0x34')][_0xe710('0x38')]));_0x2a620c['attributes']=_0x2a620c['attributes'][_0xe710('0x39')]?_0x2a620c[_0xe710('0x36')]:_0xd4864a['model'];if(!_0x5df3fe[_0xe710('0x34')][_0xe710('0x3a')](_0xe710('0x3b'))){_0x2a620c[_0xe710('0x20')]=qs[_0xe710('0x20')](_0x5df3fe['query'][_0xe710('0x20')]);_0x2a620c[_0xe710('0x1e')]=qs[_0xe710('0x1e')](_0x5df3fe[_0xe710('0x34')][_0xe710('0x1e')]);}_0x2a620c['order']=qs[_0xe710('0x3c')](_0x5df3fe[_0xe710('0x34')][_0xe710('0x3c')]);_0x2a620c[_0xe710('0x3d')]=qs[_0xe710('0x35')](_['pick'](_0x5df3fe[_0xe710('0x34')],_0xd4864a[_0xe710('0x35')]),_0x395c7f);if(_0x5df3fe['query'][_0xe710('0x3e')]){_0x2a620c[_0xe710('0x3d')]=_[_0xe710('0x3f')](_0x2a620c[_0xe710('0x3d')],{'$or':_[_0xe710('0x2d')](_0x395c7f,function(_0x1a0787){if(_0x1a0787[_0xe710('0x31')]!==_0xe710('0x40')){var _0x435202={};_0x435202[_0x1a0787[_0xe710('0x2a')]]={'$like':'%'+_0x5df3fe[_0xe710('0x34')][_0xe710('0x3e')]+'%'};return _0x435202;}})});}_0x2a620c=_[_0xe710('0x3f')]({},_0x2a620c,_0x5df3fe[_0xe710('0x41')]);var _0x446c90={'where':_0x2a620c[_0xe710('0x3d')]};return db[_0xe710('0x2e')][_0xe710('0x21')](_0x446c90)[_0xe710('0x27')](function(_0x40e874){_0x469f7b[_0xe710('0x21')]=_0x40e874;if(_0x5df3fe['query'][_0xe710('0x42')]){_0x2a620c[_0xe710('0x43')]=[{'all':!![]}];}return db[_0xe710('0x2e')][_0xe710('0x44')](_0x2a620c);})[_0xe710('0x27')](function(_0x157a28){_0x469f7b[_0xe710('0x45')]=_0x157a28;return _0x469f7b;})[_0xe710('0x27')](respondWithFilteredResult(_0x20cf73,_0x2a620c))[_0xe710('0x46')](handleError(_0x20cf73,null));};exports[_0xe710('0x47')]=function(_0x1455eb,_0x5dcf48){var _0x3d6f00={'raw':![],'where':{'id':_0x1455eb[_0xe710('0x48')]['id']}},_0x5d674a={};_0x5d674a[_0xe710('0x33')]=_['keys'](db[_0xe710('0x2e')]['rawAttributes']);_0x5d674a[_0xe710('0x34')]=_[_0xe710('0x49')](_0x1455eb[_0xe710('0x34')]);_0x5d674a[_0xe710('0x35')]=_['intersection'](_0x5d674a[_0xe710('0x33')],_0x5d674a[_0xe710('0x34')]);_0x3d6f00[_0xe710('0x36')]=_[_0xe710('0x37')](_0x5d674a[_0xe710('0x33')],qs[_0xe710('0x38')](_0x1455eb[_0xe710('0x34')]['fields']));_0x3d6f00[_0xe710('0x36')]=_0x3d6f00[_0xe710('0x36')][_0xe710('0x39')]?_0x3d6f00[_0xe710('0x36')]:_0x5d674a[_0xe710('0x33')];if(_0x1455eb[_0xe710('0x34')][_0xe710('0x42')]){_0x3d6f00['include']=[{'all':!![]}];}_0x3d6f00=_[_0xe710('0x3f')]({},_0x3d6f00,_0x1455eb[_0xe710('0x41')]);return db[_0xe710('0x2e')]['find'](_0x3d6f00)['then'](handleEntityNotFound(_0x5dcf48,null))[_0xe710('0x27')](respondWithResult(_0x5dcf48,null))['catch'](handleError(_0x5dcf48,null));};exports['create']=function(_0x31b39c,_0x161bed){return db['FreshdeskAccount']['create'](_0x31b39c[_0xe710('0x4a')],{})[_0xe710('0x27')](respondWithResult(_0x161bed,0xc9))['catch'](handleError(_0x161bed,null));};exports[_0xe710('0x26')]=function(_0x6a906b,_0x5306e9){if(_0x6a906b[_0xe710('0x4a')]['id']){delete _0x6a906b[_0xe710('0x4a')]['id'];}return db[_0xe710('0x2e')][_0xe710('0x4b')]({'where':{'id':_0x6a906b[_0xe710('0x48')]['id']}})[_0xe710('0x27')](handleEntityNotFound(_0x5306e9,null))[_0xe710('0x27')](saveUpdates(_0x6a906b[_0xe710('0x4a')],null))['then'](respondWithResult(_0x5306e9,null))['catch'](handleError(_0x5306e9,null));};exports[_0xe710('0x4c')]=function(_0x2f87f9,_0x54e3f9){return db[_0xe710('0x2e')][_0xe710('0x4b')]({'where':{'id':_0x2f87f9['params']['id']}})['then'](handleEntityNotFound(_0x54e3f9,null))[_0xe710('0x27')](removeEntity(_0x54e3f9,null))[_0xe710('0x46')](handleError(_0x54e3f9,null));};exports['getConfigurations']=function(_0x115419,_0x5f263b,_0xed7d76){var _0x5a994c={};var _0x3a8018={};var _0x1af8f4;var _0x3c187f;return db[_0xe710('0x2e')][_0xe710('0x4d')]({'where':{'id':_0x115419[_0xe710('0x48')]['id']}})['then'](handleEntityNotFound(_0x5f263b,null))[_0xe710('0x27')](function(_0x441f67){if(_0x441f67){_0x1af8f4=_0x441f67;_0x3a8018[_0xe710('0x33')]=_['keys'](db[_0xe710('0x4e')][_0xe710('0x2f')]);_0x3a8018['query']=_[_0xe710('0x49')](_0x115419['query']);_0x3a8018[_0xe710('0x35')]=_[_0xe710('0x37')](_0x3a8018[_0xe710('0x33')],_0x3a8018[_0xe710('0x34')]);_0x5a994c[_0xe710('0x36')]=_['intersection'](_0x3a8018[_0xe710('0x33')],qs[_0xe710('0x38')](_0x115419['query'][_0xe710('0x38')]));_0x5a994c[_0xe710('0x36')]=_0x5a994c[_0xe710('0x36')]['length']?_0x5a994c[_0xe710('0x36')]:_0x3a8018['model'];_0x5a994c[_0xe710('0x4f')]=qs[_0xe710('0x3c')](_0x115419[_0xe710('0x34')][_0xe710('0x3c')]);_0x5a994c[_0xe710('0x3d')]=qs[_0xe710('0x35')](_[_0xe710('0x50')](_0x115419['query'],_0x3a8018[_0xe710('0x35')]));if(_0x115419['query'][_0xe710('0x3e')]){_0x5a994c[_0xe710('0x3d')]=_[_0xe710('0x3f')](_0x5a994c[_0xe710('0x3d')],{'$or':_[_0xe710('0x2d')](_0x5a994c[_0xe710('0x36')],function(_0x21c6fc){var _0x292297={};_0x292297[_0x21c6fc]={'$like':'%'+_0x115419[_0xe710('0x34')][_0xe710('0x3e')]+'%'};return _0x292297;})});}_0x5a994c=_[_0xe710('0x3f')]({},_0x5a994c,_0x115419[_0xe710('0x41')]);return _0x1af8f4['getConfigurations'](_0x5a994c);}})[_0xe710('0x27')](function(_0x1ac9f7){if(_0x1ac9f7){_0x3c187f=_0x1ac9f7['length'];if(!_0x115419[_0xe710('0x34')]['hasOwnProperty'](_0xe710('0x3b'))){_0x5a994c[_0xe710('0x20')]=qs[_0xe710('0x20')](_0x115419[_0xe710('0x34')]['limit']);_0x5a994c['offset']=qs[_0xe710('0x1e')](_0x115419[_0xe710('0x34')][_0xe710('0x1e')]);}return _0x1af8f4['getConfigurations'](_0x5a994c);}})[_0xe710('0x27')](function(_0x5c86ff){if(_0x5c86ff){return _0x5c86ff?{'count':_0x3c187f,'rows':_0x5c86ff}:null;}})[_0xe710('0x27')](respondWithResult(_0x5f263b,null))['catch'](handleError(_0x5f263b,null));};exports['addConfiguration']=function(_0x375783,_0x498a58,_0x5e79fd){if(_0x375783[_0xe710('0x4a')]['id']){delete _0x375783[_0xe710('0x4a')]['id'];}return db['FreshdeskAccount'][_0xe710('0x4d')]({'where':{'id':_0x375783[_0xe710('0x48')]['id']}})[_0xe710('0x27')](handleEntityNotFound(_0x498a58,null))['then'](function(_0x177a96){if(_0x177a96){_0x375783['body'][_0xe710('0x51')]=_0x177a96['id'];_0x375783[_0xe710('0x4a')][_0xe710('0x52')]=integrations[_0xe710('0x53')](_0x375783[_0xe710('0x4a')][_0xe710('0x54')],_0x375783[_0xe710('0x4a')]['type']);_0x375783['body'][_0xe710('0x55')]=integrations[_0xe710('0x56')](_0x375783[_0xe710('0x4a')]['channel'],_0x375783[_0xe710('0x4a')][_0xe710('0x31')]);return db[_0xe710('0x4e')][_0xe710('0x57')](_0x375783['body'],{'include':[{'model':db[_0xe710('0x58')],'as':_0xe710('0x52')},{'model':db[_0xe710('0x58')],'as':_0xe710('0x55')}]});}return null;})[_0xe710('0x27')](respondWithResult(_0x498a58,null))[_0xe710('0x46')](handleError(_0x498a58,null));};exports[_0xe710('0x59')]=function(_0x13703a,_0x9a8415,_0x12fe79){var _0xe3b166='';return db[_0xe710('0x2e')]['findOne']({'where':{'id':_0x13703a[_0xe710('0x48')]['id']},'attributes':['id',_0xe710('0x5a'),'apiKey']})[_0xe710('0x27')](handleEntityNotFound(_0x9a8415,null))[_0xe710('0x27')](function(_0x5d875f){if(_0x5d875f){_0xe3b166=_0x5d875f[_0xe710('0x5a')];var _0x2a8b56=_0xe3b166['slice'](-0x1);if(_0x2a8b56==='/'){_0xe3b166=_0xe3b166[_0xe710('0x5b')](0x0,_0xe3b166[_0xe710('0x5c')](_0x2a8b56));}return rp({'method':'GET','uri':util[_0xe710('0x5d')](_0xe710('0x5e'),_0xe3b166,_0xe710('0x5f')),'headers':{'Authorization':util[_0xe710('0x5d')](_0xe710('0x60'),new Buffer(util['format']('%s:X',_0x5d875f[_0xe710('0x61')]))[_0xe710('0x62')](_0xe710('0x63')))},'json':!![]});}})[_0xe710('0x27')](function(_0xbd9313){if(_0xbd9313){var _0x3408eb=[_0xe710('0x64'),'subject','agent',_0xe710('0x65'),'status','priority',_0xe710('0x66'),'source',_0xe710('0x67'),_0xe710('0x66'),'company'];_['remove'](_0xbd9313,function(_0x36f152){return _0x3408eb['includes'](_0x36f152['name'])||!_0x36f152[_0xe710('0x68')]&&_0x36f152[_0xe710('0x31')]!==_0xe710('0x69')&&_0x36f152[_0xe710('0x31')]!==_0xe710('0x6a');});return{'count':_0xbd9313[_0xe710('0x39')],'rows':_[_0xe710('0x2d')](_0xbd9313,function(_0x18572e){return{'id':_0x18572e[_0xe710('0x2a')],'name':_0x18572e[_0xe710('0x6b')],'custom':!_0x18572e[_0xe710('0x68')],'options':_0x18572e[_0xe710('0x6c')]?_['map'](_0x18572e[_0xe710('0x6c')],function(_0x377fe5){return{'name':_['capitalize'](_0x377fe5),'value':_0x377fe5};}):[]};})};}})['then'](respondWithResult(_0x9a8415,null))[_0xe710('0x46')](function(_0x5364c9){var _0x70d3a=_0x13703a[_0xe710('0x34')][_0xe710('0x6d')]?0x1f4:_0x5364c9[_0xe710('0x6e')]||0x1f4;logger['error'](_0xe710('0x6f'),_0xe710('0x59'),_0x70d3a,JSON[_0xe710('0x70')](_0x5364c9));delete _0x5364c9['name'];if(_0x70d3a===0x191){_0x70d3a=0x190;}_0x9a8415[_0xe710('0x1b')](_0x70d3a)[_0xe710('0x2b')](_0x13703a[_0xe710('0x34')][_0xe710('0x6d')]?{'message':_0xe710('0x71'),'statusCode':_0x5364c9[_0xe710('0x6e')]}:_0x5364c9);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 62f88f1..04e4e2d 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x883a=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x1b7d82,_0x1b351f){var _0x2467d7=function(_0x6d792a){while(--_0x6d792a){_0x1b7d82['push'](_0x1b7d82['shift']());}};_0x2467d7(++_0x1b351f);}(_0x883a,0x96));var _0xa883=function(_0x568352,_0x2621d1){_0x568352=_0x568352-0x0;var _0x18f7b8=_0x883a[_0x568352];return _0x18f7b8;};'use strict';var _=require(_0xa883('0x0'));var util=require(_0xa883('0x1'));var logger=require(_0xa883('0x2'))('api');var moment=require(_0xa883('0x3'));var BPromise=require(_0xa883('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa883('0x5'));var rimraf=require(_0xa883('0x6'));var config=require(_0xa883('0x7'));var attributes=require(_0xa883('0x8'));var integrations=require(_0xa883('0x9'));module[_0xa883('0xa')]=function(_0x2eb29a,_0x590874){return _0x2eb29a[_0xa883('0xb')]('FreshdeskAccount',attributes,{'tableName':_0xa883('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x146a=['request-promise','rimraf','../../config/environment','exports','define','FreshdeskAccount','int_freshdesk_accounts','api','moment','bluebird'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x146a,0x1c9));var _0xa146=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x146a[_0x5c351c];return _0x26f3b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa146('0x0'));var moment=require(_0xa146('0x1'));var BPromise=require(_0xa146('0x2'));var rp=require(_0xa146('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa146('0x4'));var config=require(_0xa146('0x5'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xa146('0x6')]=function(_0x221bf6,_0x7087a4){return _0x221bf6[_0xa146('0x7')](_0xa146('0x8'),attributes,{'tableName':_0xa146('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 2b4c369..6a37f5a 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6902=['error','code','message','result','catch','findAll','options','where','limit','include','model','attributes','map','GetFreshdeskAccount','find','ShowFreshdeskAccount','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6902,0x13a));var _0x2690=function(_0x16c6d1,_0x51acad){_0x16c6d1=_0x16c6d1-0x0;var _0x253b70=_0x6902[_0x16c6d1];return _0x253b70;};'use strict';var _=require(_0x2690('0x0'));var util=require('util');var moment=require(_0x2690('0x1'));var BPromise=require(_0x2690('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2690('0x3'))['db'];var utils=require(_0x2690('0x4'));var logger=require('../../config/logger')(_0x2690('0x5'));var config=require(_0x2690('0x6'));var jayson=require(_0x2690('0x7'));var client=jayson['client'][_0x2690('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2805a0,_0xd0e04d,_0x290744){return new BPromise(function(_0x3d3f5a,_0x451e6c){return client[_0x2690('0x9')](_0x2805a0,_0x290744)[_0x2690('0xa')](function(_0x361f92){logger[_0x2690('0xb')](_0x2690('0xc'),_0xd0e04d,'request\x20sent');logger['debug'](_0x2690('0xd'),_0xd0e04d,_0x2690('0xe'),JSON[_0x2690('0xf')](_0x361f92));if(_0x361f92[_0x2690('0x10')]){if(_0x361f92[_0x2690('0x10')][_0x2690('0x11')]===0x1f4){logger[_0x2690('0x10')](_0x2690('0xc'),_0xd0e04d,_0x361f92[_0x2690('0x10')][_0x2690('0x12')]);return _0x451e6c(_0x361f92[_0x2690('0x10')]['message']);}logger['error'](_0x2690('0xc'),_0xd0e04d,_0x361f92[_0x2690('0x10')]['message']);return _0x3d3f5a(_0x361f92[_0x2690('0x10')][_0x2690('0x12')]);}else{logger['info'](_0x2690('0xc'),_0xd0e04d,_0x2690('0xe'));_0x3d3f5a(_0x361f92[_0x2690('0x13')][_0x2690('0x12')]);}})[_0x2690('0x14')](function(_0x193f7d){logger[_0x2690('0x10')](_0x2690('0xc'),_0xd0e04d,_0x193f7d);_0x451e6c(_0x193f7d);});});}exports['GetFreshdeskAccount']=function(_0x558037){var _0x176277=this;return new Promise(function(_0x3df458,_0x5f2b0f){return db['FreshdeskAccount'][_0x2690('0x15')]({'raw':_0x558037[_0x2690('0x16')]?_0x558037[_0x2690('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x558037[_0x2690('0x16')]?_0x558037[_0x2690('0x16')][_0x2690('0x17')]||null:null,'attributes':_0x558037['options']?_0x558037['options']['attributes']||null:null,'limit':_0x558037[_0x2690('0x16')]?_0x558037[_0x2690('0x16')][_0x2690('0x18')]||null:null,'include':_0x558037['options']?_0x558037[_0x2690('0x16')][_0x2690('0x19')]?_['map'](_0x558037['options'][_0x2690('0x19')],function(_0x55bd1c){return{'model':db[_0x55bd1c[_0x2690('0x1a')]],'as':_0x55bd1c['as'],'attributes':_0x55bd1c[_0x2690('0x1b')],'include':_0x55bd1c[_0x2690('0x19')]?_[_0x2690('0x1c')](_0x55bd1c[_0x2690('0x19')],function(_0x100e9a){return{'model':db[_0x100e9a['model']],'as':_0x100e9a['as'],'attributes':_0x100e9a[_0x2690('0x1b')],'include':_0x100e9a[_0x2690('0x19')]?_[_0x2690('0x1c')](_0x100e9a[_0x2690('0x19')],function(_0x4f6329){return{'model':db[_0x4f6329[_0x2690('0x1a')]],'as':_0x4f6329['as'],'attributes':_0x4f6329[_0x2690('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2690('0xa')](function(_0x6b5275){logger[_0x2690('0xb')](_0x2690('0x1d'),_0x558037);logger['debug'](_0x2690('0x1d'),_0x558037,JSON[_0x2690('0xf')](_0x6b5275));_0x3df458(_0x6b5275);})['catch'](function(_0x215985){logger[_0x2690('0x10')](_0x2690('0x1d'),_0x215985[_0x2690('0x12')],_0x558037);_0x5f2b0f(_0x176277[_0x2690('0x10')](0x1f4,_0x215985[_0x2690('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x1a7af0){var _0x242b64=this;return new Promise(function(_0x1149d6,_0x139f6e){return db['FreshdeskAccount'][_0x2690('0x1e')]({'raw':_0x1a7af0[_0x2690('0x16')]?_0x1a7af0[_0x2690('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1a7af0['options']?_0x1a7af0['options'][_0x2690('0x17')]||null:null,'attributes':_0x1a7af0[_0x2690('0x16')]?_0x1a7af0[_0x2690('0x16')][_0x2690('0x1b')]||null:null,'include':_0x1a7af0['options']?_0x1a7af0[_0x2690('0x16')][_0x2690('0x19')]?_[_0x2690('0x1c')](_0x1a7af0[_0x2690('0x16')][_0x2690('0x19')],function(_0x1108b2){return{'model':db[_0x1108b2[_0x2690('0x1a')]],'as':_0x1108b2['as'],'attributes':_0x1108b2['attributes'],'include':_0x1108b2[_0x2690('0x19')]?_[_0x2690('0x1c')](_0x1108b2['include'],function(_0x610d99){return{'model':db[_0x610d99[_0x2690('0x1a')]],'as':_0x610d99['as'],'attributes':_0x610d99[_0x2690('0x1b')],'include':_0x610d99[_0x2690('0x19')]?_[_0x2690('0x1c')](_0x610d99[_0x2690('0x19')],function(_0x243d9e){return{'model':db[_0x243d9e[_0x2690('0x1a')]],'as':_0x243d9e['as'],'attributes':_0x243d9e[_0x2690('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bd74b){logger[_0x2690('0xb')](_0x2690('0x1f'),_0x1a7af0);logger[_0x2690('0x20')](_0x2690('0x1f'),_0x1a7af0,JSON['stringify'](_0x4bd74b));_0x1149d6(_0x4bd74b);})[_0x2690('0x14')](function(_0x1bf451){logger[_0x2690('0x10')](_0x2690('0x1f'),_0x1bf451[_0x2690('0x12')],_0x1a7af0);_0x139f6e(_0x242b64[_0x2690('0x10')](0x1f4,_0x1bf451[_0x2690('0x12')]));});});}; \ No newline at end of file +var _0xabe5=['error','code','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','include','model','map','GetFreshdeskAccount','find','ShowFreshdeskAccount','lodash','moment','bluebird','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x16b1e3,_0x2f1cd9){var _0x14d565=function(_0x58b810){while(--_0x58b810){_0x16b1e3['push'](_0x16b1e3['shift']());}};_0x14d565(++_0x2f1cd9);}(_0xabe5,0x1c3));var _0x5abe=function(_0x25a386,_0x2266dc){_0x25a386=_0x25a386-0x0;var _0x4ff877=_0xabe5[_0x25a386];return _0x4ff877;};'use strict';var _=require(_0x5abe('0x0'));var util=require('util');var moment=require(_0x5abe('0x1'));var BPromise=require(_0x5abe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5abe('0x3'));var jayson=require(_0x5abe('0x4'));var client=jayson[_0x5abe('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x447035,_0x4a3cb7,_0x17960f){return new BPromise(function(_0x5cedea,_0x3ebfa7){return client[_0x5abe('0x6')](_0x447035,_0x17960f)[_0x5abe('0x7')](function(_0x30faf2){logger[_0x5abe('0x8')](_0x5abe('0x9'),_0x4a3cb7,_0x5abe('0xa'));logger[_0x5abe('0xb')](_0x5abe('0xc'),_0x4a3cb7,_0x5abe('0xa'),JSON[_0x5abe('0xd')](_0x30faf2));if(_0x30faf2[_0x5abe('0xe')]){if(_0x30faf2[_0x5abe('0xe')][_0x5abe('0xf')]===0x1f4){logger[_0x5abe('0xe')](_0x5abe('0x9'),_0x4a3cb7,_0x30faf2[_0x5abe('0xe')][_0x5abe('0x10')]);return _0x3ebfa7(_0x30faf2[_0x5abe('0xe')][_0x5abe('0x10')]);}logger['error'](_0x5abe('0x9'),_0x4a3cb7,_0x30faf2['error']['message']);return _0x5cedea(_0x30faf2[_0x5abe('0xe')][_0x5abe('0x10')]);}else{logger[_0x5abe('0x8')]('FreshdeskAccount,\x20%s,\x20%s',_0x4a3cb7,_0x5abe('0xa'));_0x5cedea(_0x30faf2[_0x5abe('0x11')][_0x5abe('0x10')]);}})[_0x5abe('0x12')](function(_0x1237e3){logger[_0x5abe('0xe')](_0x5abe('0x9'),_0x4a3cb7,_0x1237e3);_0x3ebfa7(_0x1237e3);});});}exports['GetFreshdeskAccount']=function(_0x3ea97c){var _0x14b8e3=this;return new Promise(function(_0x2f2b4a,_0x28a38a){return db[_0x5abe('0x13')][_0x5abe('0x14')]({'raw':_0x3ea97c[_0x5abe('0x15')]?_0x3ea97c[_0x5abe('0x15')][_0x5abe('0x16')]===undefined?!![]:![]:!![],'where':_0x3ea97c[_0x5abe('0x15')]?_0x3ea97c['options'][_0x5abe('0x17')]||null:null,'attributes':_0x3ea97c[_0x5abe('0x15')]?_0x3ea97c[_0x5abe('0x15')][_0x5abe('0x18')]||null:null,'limit':_0x3ea97c[_0x5abe('0x15')]?_0x3ea97c[_0x5abe('0x15')]['limit']||null:null,'include':_0x3ea97c['options']?_0x3ea97c[_0x5abe('0x15')]['include']?_['map'](_0x3ea97c[_0x5abe('0x15')][_0x5abe('0x19')],function(_0x3c821b){return{'model':db[_0x3c821b[_0x5abe('0x1a')]],'as':_0x3c821b['as'],'attributes':_0x3c821b[_0x5abe('0x18')],'include':_0x3c821b[_0x5abe('0x19')]?_[_0x5abe('0x1b')](_0x3c821b[_0x5abe('0x19')],function(_0x3a48b0){return{'model':db[_0x3a48b0['model']],'as':_0x3a48b0['as'],'attributes':_0x3a48b0[_0x5abe('0x18')],'include':_0x3a48b0['include']?_[_0x5abe('0x1b')](_0x3a48b0[_0x5abe('0x19')],function(_0x1b82ed){return{'model':db[_0x1b82ed[_0x5abe('0x1a')]],'as':_0x1b82ed['as'],'attributes':_0x1b82ed[_0x5abe('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5abe('0x7')](function(_0x4841c4){logger[_0x5abe('0x8')](_0x5abe('0x1c'),_0x3ea97c);logger[_0x5abe('0xb')]('GetFreshdeskAccount',_0x3ea97c,JSON[_0x5abe('0xd')](_0x4841c4));_0x2f2b4a(_0x4841c4);})['catch'](function(_0x41f35f){logger[_0x5abe('0xe')](_0x5abe('0x1c'),_0x41f35f[_0x5abe('0x10')],_0x3ea97c);_0x28a38a(_0x14b8e3['error'](0x1f4,_0x41f35f['message']));});});};exports['ShowFreshdeskAccount']=function(_0x55dede){var _0x329875=this;return new Promise(function(_0x428025,_0x300dfb){return db['FreshdeskAccount'][_0x5abe('0x1d')]({'raw':_0x55dede['options']?_0x55dede[_0x5abe('0x15')][_0x5abe('0x16')]===undefined?!![]:![]:!![],'where':_0x55dede[_0x5abe('0x15')]?_0x55dede[_0x5abe('0x15')][_0x5abe('0x17')]||null:null,'attributes':_0x55dede[_0x5abe('0x15')]?_0x55dede['options'][_0x5abe('0x18')]||null:null,'include':_0x55dede[_0x5abe('0x15')]?_0x55dede[_0x5abe('0x15')]['include']?_[_0x5abe('0x1b')](_0x55dede[_0x5abe('0x15')][_0x5abe('0x19')],function(_0x3d457e){return{'model':db[_0x3d457e[_0x5abe('0x1a')]],'as':_0x3d457e['as'],'attributes':_0x3d457e['attributes'],'include':_0x3d457e[_0x5abe('0x19')]?_['map'](_0x3d457e[_0x5abe('0x19')],function(_0x57ee69){return{'model':db[_0x57ee69[_0x5abe('0x1a')]],'as':_0x57ee69['as'],'attributes':_0x57ee69[_0x5abe('0x18')],'include':_0x57ee69['include']?_[_0x5abe('0x1b')](_0x57ee69['include'],function(_0x54d7ee){return{'model':db[_0x54d7ee['model']],'as':_0x54d7ee['as'],'attributes':_0x54d7ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x5abe('0x7')](function(_0x8f8e9){logger[_0x5abe('0x8')](_0x5abe('0x1e'),_0x55dede);logger['debug'](_0x5abe('0x1e'),_0x55dede,JSON[_0x5abe('0xd')](_0x8f8e9));_0x428025(_0x8f8e9);})[_0x5abe('0x12')](function(_0x53cb0f){logger['error'](_0x5abe('0x1e'),_0x53cb0f[_0x5abe('0x10')],_0x55dede);_0x300dfb(_0x329875[_0x5abe('0xe')](0x1f4,_0x53cb0f[_0x5abe('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index eb3ed84..d2d18db 100644 --- a/server/api/intFreshdeskConfiguration/index.js +++ b/server/api/intFreshdeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b30=['put','update','delete','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','setTags'];(function(_0x361a0d,_0x3bf393){var _0x3d7066=function(_0x425793){while(--_0x425793){_0x361a0d['push'](_0x361a0d['shift']());}};_0x3d7066(++_0x3bf393);}(_0x9b30,0x12f));var _0x09b3=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x9b30[_0x179b53];return _0x38a146;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x09b3('0x0'));var express=require(_0x09b3('0x1'));var router=express[_0x09b3('0x2')]();var fs_extra=require(_0x09b3('0x3'));var auth=require(_0x09b3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x09b3('0x5'));var controller=require(_0x09b3('0x6'));router[_0x09b3('0x7')]('/',auth[_0x09b3('0x8')](),controller[_0x09b3('0x9')]);router[_0x09b3('0x7')](_0x09b3('0xa'),auth[_0x09b3('0x8')](),controller['show']);router[_0x09b3('0x7')]('/:id/fields',auth[_0x09b3('0x8')](),controller[_0x09b3('0xb')]);router[_0x09b3('0x7')](_0x09b3('0xc'),auth[_0x09b3('0x8')](),controller[_0x09b3('0xd')]);router[_0x09b3('0x7')](_0x09b3('0xe'),auth[_0x09b3('0x8')](),controller[_0x09b3('0xf')]);router[_0x09b3('0x7')]('/:id/tags',auth[_0x09b3('0x8')](),controller[_0x09b3('0x10')]);router[_0x09b3('0x11')]('/',auth[_0x09b3('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0x09b3('0x8')](),controller[_0x09b3('0x12')]);router[_0x09b3('0x13')](_0x09b3('0xa'),auth[_0x09b3('0x8')](),controller[_0x09b3('0x14')]);router[_0x09b3('0x15')](_0x09b3('0xa'),auth[_0x09b3('0x8')](),controller['destroy']);module[_0x09b3('0x16')]=router; \ No newline at end of file +var _0xdb02=['Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','setTags','delete','destroy','exports','path','connect-timeout'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xdb02,0xad));var _0x2db0=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0xdb02[_0x233cb1];return _0x29ee7e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2db0('0x0'));var timeout=require(_0x2db0('0x1'));var express=require('express');var router=express[_0x2db0('0x2')]();var fs_extra=require(_0x2db0('0x3'));var auth=require(_0x2db0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2db0('0x5'));var controller=require(_0x2db0('0x6'));router['get']('/',auth[_0x2db0('0x7')](),controller[_0x2db0('0x8')]);router['get'](_0x2db0('0x9'),auth[_0x2db0('0x7')](),controller[_0x2db0('0xa')]);router[_0x2db0('0xb')](_0x2db0('0xc'),auth['isAuthenticated'](),controller[_0x2db0('0xd')]);router['get'](_0x2db0('0xe'),auth[_0x2db0('0x7')](),controller[_0x2db0('0xf')]);router[_0x2db0('0xb')](_0x2db0('0x10'),auth[_0x2db0('0x7')](),controller[_0x2db0('0x11')]);router[_0x2db0('0xb')](_0x2db0('0x12'),auth[_0x2db0('0x7')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x2db0('0x13')]);router[_0x2db0('0x14')](_0x2db0('0x12'),auth[_0x2db0('0x7')](),controller[_0x2db0('0x15')]);router['put'](_0x2db0('0x9'),auth[_0x2db0('0x7')](),controller['update']);router[_0x2db0('0x16')](_0x2db0('0x9'),auth[_0x2db0('0x7')](),controller[_0x2db0('0x17')]);module[_0x2db0('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 8e652f4..4b158f6 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a7a=['exports','STRING'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0x8a7a,0xe0));var _0xa8a7=function(_0x55fe79,_0x305b5a){_0x55fe79=_0x55fe79-0x0;var _0x7626a1=_0x8a7a[_0x55fe79];return _0x7626a1;};'use strict';var Sequelize=require('sequelize');module[_0xa8a7('0x0')]={'name':{'type':Sequelize[_0xa8a7('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3a59=['exports','sequelize'];(function(_0x44364d,_0x333a9d){var _0x71e785=function(_0x53df6f){while(--_0x53df6f){_0x44364d['push'](_0x44364d['shift']());}};_0x71e785(++_0x333a9d);}(_0x3a59,0x199));var _0x93a5=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0x3a59[_0x5dfc2a];return _0x3f1a71;};'use strict';var Sequelize=require(_0x93a5('0x0'));module[_0x93a5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index da7104c..f40895e 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe493=['../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','map','FreshdeskConfiguration','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','length','options','find','create','body','findOne','FreshdeskField','order','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/license/hardware'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe493,0x8e));var _0x3e49=function(_0x513f7b,_0x5c35fb){_0x513f7b=_0x513f7b-0x0;var _0x1941c8=_0xe493[_0x513f7b];return _0x1941c8;};'use strict';var emlformat=require(_0x3e49('0x0'));var rimraf=require(_0x3e49('0x1'));var zipdir=require(_0x3e49('0x2'));var jsonpatch=require(_0x3e49('0x3'));var rp=require('request-promise');var moment=require(_0x3e49('0x4'));var BPromise=require(_0x3e49('0x5'));var Mustache=require(_0x3e49('0x6'));var util=require(_0x3e49('0x7'));var path=require(_0x3e49('0x8'));var sox=require(_0x3e49('0x9'));var csv=require(_0x3e49('0xa'));var ejs=require(_0x3e49('0xb'));var fs=require('fs');var fs_extra=require(_0x3e49('0xc'));var _=require(_0x3e49('0xd'));var squel=require(_0x3e49('0xe'));var crypto=require('crypto');var jsforce=require(_0x3e49('0xf'));var deskjs=require(_0x3e49('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3e49('0x11'));var Papa=require('papaparse');var Redis=require(_0x3e49('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e49('0x13'));var logger=require(_0x3e49('0x14'))(_0x3e49('0x15'));var utils=require('../../config/utils');var config=require(_0x3e49('0x16'));var licenseUtil=require(_0x3e49('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x174456,_0x3c9be1){_0x3c9be1=_0x3c9be1||0xcc;return function(_0x456ad2){if(_0x456ad2){return _0x174456[_0x3e49('0x18')](_0x3c9be1);}return _0x174456[_0x3e49('0x19')](_0x3c9be1)[_0x3e49('0x1a')]();};}function respondWithResult(_0x2c4185,_0x3239e6){_0x3239e6=_0x3239e6||0xc8;return function(_0x2cff88){if(_0x2cff88){return _0x2c4185[_0x3e49('0x19')](_0x3239e6)[_0x3e49('0x1b')](_0x2cff88);}};}function respondWithFilteredResult(_0x40a5d1,_0x1c1746){return function(_0x253e3f){if(_0x253e3f){var _0x2b0982=typeof _0x1c1746[_0x3e49('0x1c')]===_0x3e49('0x1d')&&typeof _0x1c1746[_0x3e49('0x1e')]===_0x3e49('0x1d');var _0x220778=_0x253e3f[_0x3e49('0x1f')];var _0x1ddbf7=_0x2b0982?0x0:_0x1c1746[_0x3e49('0x1c')];var _0x141daf=_0x2b0982?_0x253e3f['count']:_0x1c1746[_0x3e49('0x1c')]+_0x1c1746['limit'];var _0x560f38;if(_0x141daf>=_0x220778){_0x141daf=_0x220778;_0x560f38=0xc8;}else{_0x560f38=0xce;}_0x40a5d1[_0x3e49('0x19')](_0x560f38);return _0x40a5d1[_0x3e49('0x20')](_0x3e49('0x21'),_0x1ddbf7+'-'+_0x141daf+'/'+_0x220778)[_0x3e49('0x1b')](_0x253e3f);}return null;};}function patchUpdates(_0x46fa0b){return function(_0x1235f0){try{jsonpatch['apply'](_0x1235f0,_0x46fa0b,!![]);}catch(_0x5323cf){return BPromise['reject'](_0x5323cf);}return _0x1235f0[_0x3e49('0x22')]();};}function saveUpdates(_0x10a4c0,_0x3f5e41){return function(_0x79820a){if(_0x79820a){return _0x79820a[_0x3e49('0x23')](_0x10a4c0)[_0x3e49('0x24')](function(_0x1c5329){return _0x1c5329;});}return null;};}function removeEntity(_0x54717e,_0x4d73b1){return function(_0x283138){if(_0x283138){return _0x283138[_0x3e49('0x25')]()[_0x3e49('0x24')](function(){_0x54717e[_0x3e49('0x19')](0xcc)[_0x3e49('0x1a')]();});}};}function handleEntityNotFound(_0x1e9ecb,_0x5dd7aa){return function(_0x3049d1){if(!_0x3049d1){_0x1e9ecb[_0x3e49('0x18')](0x194);}return _0x3049d1;};}function handleError(_0x267b87,_0x45292a){_0x45292a=_0x45292a||0x1f4;return function(_0x517bd4){logger[_0x3e49('0x26')](_0x517bd4[_0x3e49('0x27')]);if(_0x517bd4['name']){delete _0x517bd4[_0x3e49('0x28')];}_0x267b87[_0x3e49('0x19')](_0x45292a)['send'](_0x517bd4);};}exports['index']=function(_0x298c3b,_0x58d9b8){var _0x22228c={},_0x312282={},_0x50545a={'count':0x0,'rows':[]};var _0x252154=_[_0x3e49('0x29')](db[_0x3e49('0x2a')][_0x3e49('0x2b')],function(_0xed19a5){return{'name':_0xed19a5[_0x3e49('0x2c')],'type':_0xed19a5[_0x3e49('0x2d')]['key']};});_0x312282[_0x3e49('0x2e')]=_[_0x3e49('0x29')](_0x252154,_0x3e49('0x28'));_0x312282[_0x3e49('0x2f')]=_['keys'](_0x298c3b[_0x3e49('0x2f')]);_0x312282['filters']=_[_0x3e49('0x30')](_0x312282[_0x3e49('0x2e')],_0x312282[_0x3e49('0x2f')]);_0x22228c[_0x3e49('0x31')]=_['intersection'](_0x312282[_0x3e49('0x2e')],qs[_0x3e49('0x32')](_0x298c3b[_0x3e49('0x2f')]['fields']));_0x22228c['attributes']=_0x22228c['attributes']['length']?_0x22228c[_0x3e49('0x31')]:_0x312282['model'];if(!_0x298c3b['query'][_0x3e49('0x33')](_0x3e49('0x34'))){_0x22228c['limit']=qs[_0x3e49('0x1e')](_0x298c3b['query'][_0x3e49('0x1e')]);_0x22228c['offset']=qs[_0x3e49('0x1c')](_0x298c3b['query'][_0x3e49('0x1c')]);}_0x22228c['order']=qs[_0x3e49('0x35')](_0x298c3b[_0x3e49('0x2f')][_0x3e49('0x35')]);_0x22228c[_0x3e49('0x36')]=qs[_0x3e49('0x37')](_[_0x3e49('0x38')](_0x298c3b['query'],_0x312282['filters']),_0x252154);if(_0x298c3b['query'][_0x3e49('0x39')]){_0x22228c['where']=_[_0x3e49('0x3a')](_0x22228c[_0x3e49('0x36')],{'$or':_['map'](_0x252154,function(_0x50f36d){if(_0x50f36d['type']!==_0x3e49('0x3b')){var _0x1c5074={};_0x1c5074[_0x50f36d[_0x3e49('0x28')]]={'$like':'%'+_0x298c3b['query'][_0x3e49('0x39')]+'%'};return _0x1c5074;}})});}_0x22228c=_['merge']({},_0x22228c,_0x298c3b['options']);var _0x23057f={'where':_0x22228c[_0x3e49('0x36')]};return db[_0x3e49('0x2a')]['count'](_0x23057f)[_0x3e49('0x24')](function(_0x505e6b){_0x50545a[_0x3e49('0x1f')]=_0x505e6b;if(_0x298c3b[_0x3e49('0x2f')][_0x3e49('0x3c')]){_0x22228c[_0x3e49('0x3d')]=[{'all':!![]}];}return db[_0x3e49('0x2a')]['findAll'](_0x22228c);})[_0x3e49('0x24')](function(_0x597d4e){_0x50545a[_0x3e49('0x3e')]=_0x597d4e;return _0x50545a;})[_0x3e49('0x24')](respondWithFilteredResult(_0x58d9b8,_0x22228c))[_0x3e49('0x3f')](handleError(_0x58d9b8,null));};exports[_0x3e49('0x40')]=function(_0x299da7,_0x55e86b){var _0x4d427f={'raw':![],'where':{'id':_0x299da7[_0x3e49('0x41')]['id']}},_0x15db1e={};_0x15db1e[_0x3e49('0x2e')]=_[_0x3e49('0x42')](db[_0x3e49('0x2a')][_0x3e49('0x2b')]);_0x15db1e['query']=_[_0x3e49('0x42')](_0x299da7['query']);_0x15db1e['filters']=_[_0x3e49('0x30')](_0x15db1e[_0x3e49('0x2e')],_0x15db1e[_0x3e49('0x2f')]);_0x4d427f['attributes']=_[_0x3e49('0x30')](_0x15db1e[_0x3e49('0x2e')],qs[_0x3e49('0x32')](_0x299da7[_0x3e49('0x2f')][_0x3e49('0x32')]));_0x4d427f[_0x3e49('0x31')]=_0x4d427f[_0x3e49('0x31')][_0x3e49('0x43')]?_0x4d427f['attributes']:_0x15db1e[_0x3e49('0x2e')];if(_0x299da7['query'][_0x3e49('0x3c')]){_0x4d427f[_0x3e49('0x3d')]=[{'all':!![]}];}_0x4d427f=_['merge']({},_0x4d427f,_0x299da7[_0x3e49('0x44')]);return db[_0x3e49('0x2a')][_0x3e49('0x45')](_0x4d427f)['then'](handleEntityNotFound(_0x55e86b,null))[_0x3e49('0x24')](respondWithResult(_0x55e86b,null))[_0x3e49('0x3f')](handleError(_0x55e86b,null));};exports['create']=function(_0x5795c0,_0x2c3e48){return db[_0x3e49('0x2a')][_0x3e49('0x46')](_0x5795c0[_0x3e49('0x47')],{})[_0x3e49('0x24')](respondWithResult(_0x2c3e48,0xc9))[_0x3e49('0x3f')](handleError(_0x2c3e48,null));};exports['update']=function(_0x17ff67,_0x1b3549){if(_0x17ff67[_0x3e49('0x47')]['id']){delete _0x17ff67[_0x3e49('0x47')]['id'];}return db[_0x3e49('0x2a')][_0x3e49('0x45')]({'where':{'id':_0x17ff67[_0x3e49('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b3549,null))[_0x3e49('0x24')](saveUpdates(_0x17ff67[_0x3e49('0x47')],null))[_0x3e49('0x24')](respondWithResult(_0x1b3549,null))[_0x3e49('0x3f')](handleError(_0x1b3549,null));};exports[_0x3e49('0x25')]=function(_0x11c657,_0x4e05cc){return db['FreshdeskConfiguration'][_0x3e49('0x45')]({'where':{'id':_0x11c657[_0x3e49('0x41')]['id']}})[_0x3e49('0x24')](handleEntityNotFound(_0x4e05cc,null))[_0x3e49('0x24')](removeEntity(_0x4e05cc,null))[_0x3e49('0x3f')](handleError(_0x4e05cc,null));};exports['getFields']=function(_0x521bb0,_0x218bd0,_0x37a98d){var _0x412281={};var _0x5744f4={};var _0x5ee617;var _0x4b062b;return db[_0x3e49('0x2a')][_0x3e49('0x48')]({'where':{'id':_0x521bb0['params']['id']}})['then'](handleEntityNotFound(_0x218bd0,null))['then'](function(_0x1ba49c){if(_0x1ba49c){_0x5ee617=_0x1ba49c;_0x5744f4[_0x3e49('0x2e')]=_[_0x3e49('0x42')](db[_0x3e49('0x49')][_0x3e49('0x2b')]);_0x5744f4[_0x3e49('0x2f')]=_['keys'](_0x521bb0[_0x3e49('0x2f')]);_0x5744f4['filters']=_[_0x3e49('0x30')](_0x5744f4[_0x3e49('0x2e')],_0x5744f4[_0x3e49('0x2f')]);_0x412281['attributes']=_['intersection'](_0x5744f4[_0x3e49('0x2e')],qs[_0x3e49('0x32')](_0x521bb0[_0x3e49('0x2f')]['fields']));_0x412281[_0x3e49('0x31')]=_0x412281[_0x3e49('0x31')]['length']?_0x412281['attributes']:_0x5744f4[_0x3e49('0x2e')];_0x412281[_0x3e49('0x4a')]=qs[_0x3e49('0x35')](_0x521bb0[_0x3e49('0x2f')][_0x3e49('0x35')]);_0x412281[_0x3e49('0x36')]=qs[_0x3e49('0x37')](_[_0x3e49('0x38')](_0x521bb0[_0x3e49('0x2f')],_0x5744f4[_0x3e49('0x37')]));if(_0x521bb0['query'][_0x3e49('0x39')]){_0x412281['where']=_['merge'](_0x412281[_0x3e49('0x36')],{'$or':_[_0x3e49('0x29')](_0x412281['attributes'],function(_0x1290b1){var _0x52451b={};_0x52451b[_0x1290b1]={'$like':'%'+_0x521bb0[_0x3e49('0x2f')][_0x3e49('0x39')]+'%'};return _0x52451b;})});}_0x412281=_[_0x3e49('0x3a')]({},_0x412281,_0x521bb0[_0x3e49('0x44')]);return _0x5ee617[_0x3e49('0x4b')](_0x412281);}})['then'](function(_0x5cdde4){if(_0x5cdde4){_0x4b062b=_0x5cdde4[_0x3e49('0x43')];if(!_0x521bb0['query'][_0x3e49('0x33')](_0x3e49('0x34'))){_0x412281[_0x3e49('0x1e')]=qs[_0x3e49('0x1e')](_0x521bb0['query']['limit']);_0x412281[_0x3e49('0x1c')]=qs[_0x3e49('0x1c')](_0x521bb0['query'][_0x3e49('0x1c')]);}return _0x5ee617[_0x3e49('0x4b')](_0x412281);}})[_0x3e49('0x24')](function(_0xdb0e40){if(_0xdb0e40){return _0xdb0e40?{'count':_0x4b062b,'rows':_0xdb0e40}:null;}})['then'](respondWithResult(_0x218bd0,null))[_0x3e49('0x3f')](handleError(_0x218bd0,null));};exports[_0x3e49('0x4c')]=function(_0xc0f20a,_0x46e13d,_0x2ecc16){var _0x3904c2={};var _0x4cb2cf={};var _0x1b43ad;var _0x4cd16b;return db[_0x3e49('0x2a')]['findOne']({'where':{'id':_0xc0f20a[_0x3e49('0x41')]['id']}})[_0x3e49('0x24')](handleEntityNotFound(_0x46e13d,null))[_0x3e49('0x24')](function(_0x4beafd){if(_0x4beafd){_0x1b43ad=_0x4beafd;_0x4cb2cf[_0x3e49('0x2e')]=_[_0x3e49('0x42')](db[_0x3e49('0x49')]['rawAttributes']);_0x4cb2cf['query']=_['keys'](_0xc0f20a[_0x3e49('0x2f')]);_0x4cb2cf[_0x3e49('0x37')]=_[_0x3e49('0x30')](_0x4cb2cf[_0x3e49('0x2e')],_0x4cb2cf['query']);_0x3904c2[_0x3e49('0x31')]=_[_0x3e49('0x30')](_0x4cb2cf[_0x3e49('0x2e')],qs['fields'](_0xc0f20a[_0x3e49('0x2f')]['fields']));_0x3904c2[_0x3e49('0x31')]=_0x3904c2[_0x3e49('0x31')][_0x3e49('0x43')]?_0x3904c2[_0x3e49('0x31')]:_0x4cb2cf['model'];_0x3904c2[_0x3e49('0x4a')]=qs[_0x3e49('0x35')](_0xc0f20a[_0x3e49('0x2f')][_0x3e49('0x35')]);_0x3904c2[_0x3e49('0x36')]=qs[_0x3e49('0x37')](_[_0x3e49('0x38')](_0xc0f20a[_0x3e49('0x2f')],_0x4cb2cf[_0x3e49('0x37')]));if(_0xc0f20a[_0x3e49('0x2f')][_0x3e49('0x39')]){_0x3904c2['where']=_[_0x3e49('0x3a')](_0x3904c2[_0x3e49('0x36')],{'$or':_[_0x3e49('0x29')](_0x3904c2['attributes'],function(_0x2694f8){var _0xe72e54={};_0xe72e54[_0x2694f8]={'$like':'%'+_0xc0f20a[_0x3e49('0x2f')][_0x3e49('0x39')]+'%'};return _0xe72e54;})});}_0x3904c2=_['merge']({},_0x3904c2,_0xc0f20a['options']);return _0x1b43ad[_0x3e49('0x4c')](_0x3904c2);}})['then'](function(_0x8516c0){if(_0x8516c0){_0x4cd16b=_0x8516c0[_0x3e49('0x43')];if(!_0xc0f20a[_0x3e49('0x2f')]['hasOwnProperty']('nolimit')){_0x3904c2['limit']=qs[_0x3e49('0x1e')](_0xc0f20a[_0x3e49('0x2f')]['limit']);_0x3904c2[_0x3e49('0x1c')]=qs[_0x3e49('0x1c')](_0xc0f20a['query'][_0x3e49('0x1c')]);}return _0x1b43ad[_0x3e49('0x4c')](_0x3904c2);}})['then'](function(_0x51b196){if(_0x51b196){return _0x51b196?{'count':_0x4cd16b,'rows':_0x51b196}:null;}})[_0x3e49('0x24')](respondWithResult(_0x46e13d,null))[_0x3e49('0x3f')](handleError(_0x46e13d,null));};exports['getDescriptions']=function(_0x5ec2b9,_0x12ac62,_0x156770){var _0x4925c6={};var _0x1c06de={};var _0x1b3f7b;var _0x25d60a;return db[_0x3e49('0x2a')][_0x3e49('0x48')]({'where':{'id':_0x5ec2b9[_0x3e49('0x41')]['id']}})[_0x3e49('0x24')](handleEntityNotFound(_0x12ac62,null))[_0x3e49('0x24')](function(_0x3fc62){if(_0x3fc62){_0x1b3f7b=_0x3fc62;_0x1c06de['model']=_[_0x3e49('0x42')](db[_0x3e49('0x49')][_0x3e49('0x2b')]);_0x1c06de[_0x3e49('0x2f')]=_[_0x3e49('0x42')](_0x5ec2b9[_0x3e49('0x2f')]);_0x1c06de['filters']=_[_0x3e49('0x30')](_0x1c06de[_0x3e49('0x2e')],_0x1c06de[_0x3e49('0x2f')]);_0x4925c6['attributes']=_[_0x3e49('0x30')](_0x1c06de[_0x3e49('0x2e')],qs[_0x3e49('0x32')](_0x5ec2b9[_0x3e49('0x2f')][_0x3e49('0x32')]));_0x4925c6['attributes']=_0x4925c6[_0x3e49('0x31')]['length']?_0x4925c6['attributes']:_0x1c06de['model'];_0x4925c6[_0x3e49('0x4a')]=qs[_0x3e49('0x35')](_0x5ec2b9[_0x3e49('0x2f')][_0x3e49('0x35')]);_0x4925c6['where']=qs[_0x3e49('0x37')](_['pick'](_0x5ec2b9[_0x3e49('0x2f')],_0x1c06de[_0x3e49('0x37')]));if(_0x5ec2b9[_0x3e49('0x2f')][_0x3e49('0x39')]){_0x4925c6[_0x3e49('0x36')]=_[_0x3e49('0x3a')](_0x4925c6[_0x3e49('0x36')],{'$or':_[_0x3e49('0x29')](_0x4925c6[_0x3e49('0x31')],function(_0x48c076){var _0x2bdf7e={};_0x2bdf7e[_0x48c076]={'$like':'%'+_0x5ec2b9[_0x3e49('0x2f')]['filter']+'%'};return _0x2bdf7e;})});}_0x4925c6=_[_0x3e49('0x3a')]({},_0x4925c6,_0x5ec2b9[_0x3e49('0x44')]);return _0x1b3f7b[_0x3e49('0x4d')](_0x4925c6);}})[_0x3e49('0x24')](function(_0x54d8cc){if(_0x54d8cc){_0x25d60a=_0x54d8cc[_0x3e49('0x43')];if(!_0x5ec2b9['query'][_0x3e49('0x33')](_0x3e49('0x34'))){_0x4925c6[_0x3e49('0x1e')]=qs[_0x3e49('0x1e')](_0x5ec2b9[_0x3e49('0x2f')]['limit']);_0x4925c6[_0x3e49('0x1c')]=qs[_0x3e49('0x1c')](_0x5ec2b9['query'][_0x3e49('0x1c')]);}return _0x1b3f7b['getDescriptions'](_0x4925c6);}})[_0x3e49('0x24')](function(_0x3dfb0d){if(_0x3dfb0d){return _0x3dfb0d?{'count':_0x25d60a,'rows':_0x3dfb0d}:null;}})[_0x3e49('0x24')](respondWithResult(_0x12ac62,null))[_0x3e49('0x3f')](handleError(_0x12ac62,null));};exports[_0x3e49('0x4e')]=function(_0x591182,_0x14412c,_0x5f224a){var _0x1c5d7e={};var _0xd9ee80={};var _0x3cb290;var _0x240141;return db[_0x3e49('0x2a')][_0x3e49('0x48')]({'where':{'id':_0x591182[_0x3e49('0x41')]['id']}})['then'](handleEntityNotFound(_0x14412c,null))[_0x3e49('0x24')](function(_0x886283){if(_0x886283){_0x3cb290=_0x886283;_0xd9ee80[_0x3e49('0x2e')]=_[_0x3e49('0x42')](db[_0x3e49('0x4f')][_0x3e49('0x2b')]);_0xd9ee80[_0x3e49('0x2f')]=_[_0x3e49('0x42')](_0x591182[_0x3e49('0x2f')]);_0xd9ee80[_0x3e49('0x37')]=_[_0x3e49('0x30')](_0xd9ee80[_0x3e49('0x2e')],_0xd9ee80[_0x3e49('0x2f')]);_0x1c5d7e[_0x3e49('0x31')]=_['intersection'](_0xd9ee80[_0x3e49('0x2e')],qs[_0x3e49('0x32')](_0x591182[_0x3e49('0x2f')][_0x3e49('0x32')]));_0x1c5d7e[_0x3e49('0x31')]=_0x1c5d7e[_0x3e49('0x31')][_0x3e49('0x43')]?_0x1c5d7e[_0x3e49('0x31')]:_0xd9ee80['model'];_0x1c5d7e['order']=qs[_0x3e49('0x35')](_0x591182[_0x3e49('0x2f')][_0x3e49('0x35')]);_0x1c5d7e[_0x3e49('0x36')]=qs[_0x3e49('0x37')](_[_0x3e49('0x38')](_0x591182[_0x3e49('0x2f')],_0xd9ee80['filters']));if(_0x591182[_0x3e49('0x2f')][_0x3e49('0x39')]){_0x1c5d7e[_0x3e49('0x36')]=_[_0x3e49('0x3a')](_0x1c5d7e['where'],{'$or':_[_0x3e49('0x29')](_0x1c5d7e[_0x3e49('0x31')],function(_0x54f90a){var _0x4b1c30={};_0x4b1c30[_0x54f90a]={'$like':'%'+_0x591182[_0x3e49('0x2f')][_0x3e49('0x39')]+'%'};return _0x4b1c30;})});}_0x1c5d7e=_[_0x3e49('0x3a')]({},_0x1c5d7e,_0x591182[_0x3e49('0x44')]);return _0x3cb290[_0x3e49('0x4e')](_0x1c5d7e);}})[_0x3e49('0x24')](function(_0x5b57e9){if(_0x5b57e9){_0x240141=_0x5b57e9['length'];if(!_0x591182['query']['hasOwnProperty'](_0x3e49('0x34'))){_0x1c5d7e['limit']=qs['limit'](_0x591182[_0x3e49('0x2f')][_0x3e49('0x1e')]);_0x1c5d7e['offset']=qs['offset'](_0x591182[_0x3e49('0x2f')][_0x3e49('0x1c')]);}return _0x3cb290[_0x3e49('0x4e')](_0x1c5d7e);}})['then'](function(_0x994339){if(_0x994339){return _0x994339?{'count':_0x240141,'rows':_0x994339}:null;}})[_0x3e49('0x24')](respondWithResult(_0x14412c,null))[_0x3e49('0x3f')](handleError(_0x14412c,null));};exports[_0x3e49('0x50')]=function(_0x578ce5,_0x5f1b28,_0x40aa68){if(_0x578ce5[_0x3e49('0x47')]['id']){delete _0x578ce5['body']['id'];}return db['FreshdeskConfiguration'][_0x3e49('0x48')]({'where':{'id':_0x578ce5[_0x3e49('0x41')]['id']}})['then'](handleEntityNotFound(_0x5f1b28,null))[_0x3e49('0x24')](function(_0x4da8d2){if(_0x4da8d2){return _0x4da8d2[_0x3e49('0x50')](_0x578ce5['body']['ids']||[]);}return null;})[_0x3e49('0x24')](respondWithResult(_0x5f1b28,null))[_0x3e49('0x3f')](handleError(_0x5f1b28,null));}; \ No newline at end of file +var _0x3e10=['getFields','findOne','FreshdeskField','fields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','FreshdeskConfiguration','include','findAll','rows','params','model','includeAll','catch','create','body'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x3e10,0x159));var _0x03e1=function(_0x585ab9,_0x599828){_0x585ab9=_0x585ab9-0x0;var _0x544b7d=_0x3e10[_0x585ab9];return _0x544b7d;};'use strict';var emlformat=require(_0x03e1('0x0'));var rimraf=require(_0x03e1('0x1'));var zipdir=require(_0x03e1('0x2'));var jsonpatch=require(_0x03e1('0x3'));var rp=require(_0x03e1('0x4'));var moment=require(_0x03e1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x03e1('0x6'));var util=require(_0x03e1('0x7'));var path=require(_0x03e1('0x8'));var sox=require('sox');var csv=require(_0x03e1('0x9'));var ejs=require(_0x03e1('0xa'));var fs=require('fs');var fs_extra=require(_0x03e1('0xb'));var _=require(_0x03e1('0xc'));var squel=require('squel');var crypto=require(_0x03e1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x03e1('0xe'));var toCsv=require(_0x03e1('0x9'));var querystring=require(_0x03e1('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x03e1('0x10'));var qs=require(_0x03e1('0x11'));var as=require(_0x03e1('0x12'));var hardwareService=require(_0x03e1('0x13'));var logger=require(_0x03e1('0x14'))(_0x03e1('0x15'));var utils=require(_0x03e1('0x16'));var config=require(_0x03e1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x03e1('0x18'))['db'];function respondWithStatusCode(_0x5ef2f0,_0x2a1caf){_0x2a1caf=_0x2a1caf||0xcc;return function(_0x20835e){if(_0x20835e){return _0x5ef2f0[_0x03e1('0x19')](_0x2a1caf);}return _0x5ef2f0['status'](_0x2a1caf)[_0x03e1('0x1a')]();};}function respondWithResult(_0x50bc8f,_0x857b93){_0x857b93=_0x857b93||0xc8;return function(_0xf06e8d){if(_0xf06e8d){return _0x50bc8f[_0x03e1('0x1b')](_0x857b93)['json'](_0xf06e8d);}};}function respondWithFilteredResult(_0x3b6653,_0x1bcc6d){return function(_0x2a21c3){if(_0x2a21c3){var _0x51d93d=typeof _0x1bcc6d[_0x03e1('0x1c')]===_0x03e1('0x1d')&&typeof _0x1bcc6d[_0x03e1('0x1e')]===_0x03e1('0x1d');var _0x268d97=_0x2a21c3[_0x03e1('0x1f')];var _0x5f4862=_0x51d93d?0x0:_0x1bcc6d[_0x03e1('0x1c')];var _0x1e8ee7=_0x51d93d?_0x2a21c3[_0x03e1('0x1f')]:_0x1bcc6d[_0x03e1('0x1c')]+_0x1bcc6d['limit'];var _0x589b69;if(_0x1e8ee7>=_0x268d97){_0x1e8ee7=_0x268d97;_0x589b69=0xc8;}else{_0x589b69=0xce;}_0x3b6653[_0x03e1('0x1b')](_0x589b69);return _0x3b6653['set'](_0x03e1('0x20'),_0x5f4862+'-'+_0x1e8ee7+'/'+_0x268d97)[_0x03e1('0x21')](_0x2a21c3);}return null;};}function patchUpdates(_0x34f3fe){return function(_0x2ef11b){try{jsonpatch[_0x03e1('0x22')](_0x2ef11b,_0x34f3fe,!![]);}catch(_0x14527b){return BPromise[_0x03e1('0x23')](_0x14527b);}return _0x2ef11b[_0x03e1('0x24')]();};}function saveUpdates(_0x924f78,_0x48a0cd){return function(_0x4bd7fb){if(_0x4bd7fb){return _0x4bd7fb[_0x03e1('0x25')](_0x924f78)[_0x03e1('0x26')](function(_0x4f4586){return _0x4f4586;});}return null;};}function removeEntity(_0xeee466,_0x4856be){return function(_0x44f4be){if(_0x44f4be){return _0x44f4be['destroy']()['then'](function(){_0xeee466[_0x03e1('0x1b')](0xcc)[_0x03e1('0x1a')]();});}};}function handleEntityNotFound(_0x20ad8e,_0xb32caa){return function(_0x173822){if(!_0x173822){_0x20ad8e[_0x03e1('0x19')](0x194);}return _0x173822;};}function handleError(_0x4eb3b0,_0x4f3e20){_0x4f3e20=_0x4f3e20||0x1f4;return function(_0x5df724){logger[_0x03e1('0x27')](_0x5df724[_0x03e1('0x28')]);if(_0x5df724[_0x03e1('0x29')]){delete _0x5df724[_0x03e1('0x29')];}_0x4eb3b0[_0x03e1('0x1b')](_0x4f3e20)[_0x03e1('0x2a')](_0x5df724);};}exports[_0x03e1('0x2b')]=function(_0x43d150,_0x39fcc5){var _0x27e250={},_0xaf137e={},_0x48c744={'count':0x0,'rows':[]};var _0x2fd3e4=_[_0x03e1('0x2c')](db['FreshdeskConfiguration'][_0x03e1('0x2d')],function(_0x37d7f1){return{'name':_0x37d7f1[_0x03e1('0x2e')],'type':_0x37d7f1[_0x03e1('0x2f')][_0x03e1('0x30')]};});_0xaf137e['model']=_[_0x03e1('0x2c')](_0x2fd3e4,_0x03e1('0x29'));_0xaf137e[_0x03e1('0x31')]=_[_0x03e1('0x32')](_0x43d150[_0x03e1('0x31')]);_0xaf137e[_0x03e1('0x33')]=_['intersection'](_0xaf137e['model'],_0xaf137e['query']);_0x27e250[_0x03e1('0x34')]=_[_0x03e1('0x35')](_0xaf137e['model'],qs['fields'](_0x43d150['query']['fields']));_0x27e250[_0x03e1('0x34')]=_0x27e250['attributes'][_0x03e1('0x36')]?_0x27e250[_0x03e1('0x34')]:_0xaf137e['model'];if(!_0x43d150[_0x03e1('0x31')][_0x03e1('0x37')](_0x03e1('0x38'))){_0x27e250['limit']=qs['limit'](_0x43d150['query'][_0x03e1('0x1e')]);_0x27e250[_0x03e1('0x1c')]=qs[_0x03e1('0x1c')](_0x43d150[_0x03e1('0x31')]['offset']);}_0x27e250[_0x03e1('0x39')]=qs[_0x03e1('0x3a')](_0x43d150[_0x03e1('0x31')][_0x03e1('0x3a')]);_0x27e250['where']=qs['filters'](_[_0x03e1('0x3b')](_0x43d150[_0x03e1('0x31')],_0xaf137e[_0x03e1('0x33')]),_0x2fd3e4);if(_0x43d150[_0x03e1('0x31')][_0x03e1('0x3c')]){_0x27e250[_0x03e1('0x3d')]=_[_0x03e1('0x3e')](_0x27e250[_0x03e1('0x3d')],{'$or':_['map'](_0x2fd3e4,function(_0x4c3d7b){if(_0x4c3d7b[_0x03e1('0x2f')]!==_0x03e1('0x3f')){var _0x682f7={};_0x682f7[_0x4c3d7b[_0x03e1('0x29')]]={'$like':'%'+_0x43d150[_0x03e1('0x31')][_0x03e1('0x3c')]+'%'};return _0x682f7;}})});}_0x27e250=_[_0x03e1('0x3e')]({},_0x27e250,_0x43d150[_0x03e1('0x40')]);var _0x484348={'where':_0x27e250[_0x03e1('0x3d')]};return db[_0x03e1('0x41')][_0x03e1('0x1f')](_0x484348)[_0x03e1('0x26')](function(_0x3ca026){_0x48c744[_0x03e1('0x1f')]=_0x3ca026;if(_0x43d150[_0x03e1('0x31')]['includeAll']){_0x27e250[_0x03e1('0x42')]=[{'all':!![]}];}return db[_0x03e1('0x41')][_0x03e1('0x43')](_0x27e250);})[_0x03e1('0x26')](function(_0x1f4565){_0x48c744[_0x03e1('0x44')]=_0x1f4565;return _0x48c744;})[_0x03e1('0x26')](respondWithFilteredResult(_0x39fcc5,_0x27e250))['catch'](handleError(_0x39fcc5,null));};exports['show']=function(_0x206855,_0x191958){var _0x5aaf6f={'raw':![],'where':{'id':_0x206855[_0x03e1('0x45')]['id']}},_0x21a859={};_0x21a859['model']=_[_0x03e1('0x32')](db[_0x03e1('0x41')]['rawAttributes']);_0x21a859[_0x03e1('0x31')]=_['keys'](_0x206855[_0x03e1('0x31')]);_0x21a859[_0x03e1('0x33')]=_['intersection'](_0x21a859['model'],_0x21a859[_0x03e1('0x31')]);_0x5aaf6f[_0x03e1('0x34')]=_[_0x03e1('0x35')](_0x21a859['model'],qs['fields'](_0x206855[_0x03e1('0x31')]['fields']));_0x5aaf6f['attributes']=_0x5aaf6f[_0x03e1('0x34')][_0x03e1('0x36')]?_0x5aaf6f['attributes']:_0x21a859[_0x03e1('0x46')];if(_0x206855[_0x03e1('0x31')][_0x03e1('0x47')]){_0x5aaf6f['include']=[{'all':!![]}];}_0x5aaf6f=_[_0x03e1('0x3e')]({},_0x5aaf6f,_0x206855[_0x03e1('0x40')]);return db[_0x03e1('0x41')]['find'](_0x5aaf6f)[_0x03e1('0x26')](handleEntityNotFound(_0x191958,null))['then'](respondWithResult(_0x191958,null))[_0x03e1('0x48')](handleError(_0x191958,null));};exports[_0x03e1('0x49')]=function(_0xdae597,_0x1fdc23){return db[_0x03e1('0x41')][_0x03e1('0x49')](_0xdae597[_0x03e1('0x4a')],{})[_0x03e1('0x26')](respondWithResult(_0x1fdc23,0xc9))[_0x03e1('0x48')](handleError(_0x1fdc23,null));};exports[_0x03e1('0x25')]=function(_0x231fdf,_0x2191da){if(_0x231fdf[_0x03e1('0x4a')]['id']){delete _0x231fdf['body']['id'];}return db[_0x03e1('0x41')]['find']({'where':{'id':_0x231fdf[_0x03e1('0x45')]['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0x2191da,null))[_0x03e1('0x26')](saveUpdates(_0x231fdf['body'],null))[_0x03e1('0x26')](respondWithResult(_0x2191da,null))[_0x03e1('0x48')](handleError(_0x2191da,null));};exports['destroy']=function(_0x4050cf,_0x3ec4db){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x4050cf['params']['id']}})['then'](handleEntityNotFound(_0x3ec4db,null))['then'](removeEntity(_0x3ec4db,null))[_0x03e1('0x48')](handleError(_0x3ec4db,null));};exports[_0x03e1('0x4b')]=function(_0x3f8ae4,_0x2ead3f,_0x1e0ce3){var _0x5b369c={};var _0x529a8a={};var _0x1c04fa;var _0x31a681;return db[_0x03e1('0x41')][_0x03e1('0x4c')]({'where':{'id':_0x3f8ae4[_0x03e1('0x45')]['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0x2ead3f,null))['then'](function(_0x497175){if(_0x497175){_0x1c04fa=_0x497175;_0x529a8a[_0x03e1('0x46')]=_['keys'](db[_0x03e1('0x4d')][_0x03e1('0x2d')]);_0x529a8a[_0x03e1('0x31')]=_['keys'](_0x3f8ae4['query']);_0x529a8a[_0x03e1('0x33')]=_[_0x03e1('0x35')](_0x529a8a[_0x03e1('0x46')],_0x529a8a[_0x03e1('0x31')]);_0x5b369c[_0x03e1('0x34')]=_[_0x03e1('0x35')](_0x529a8a[_0x03e1('0x46')],qs[_0x03e1('0x4e')](_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x4e')]));_0x5b369c[_0x03e1('0x34')]=_0x5b369c[_0x03e1('0x34')][_0x03e1('0x36')]?_0x5b369c['attributes']:_0x529a8a[_0x03e1('0x46')];_0x5b369c['order']=qs[_0x03e1('0x3a')](_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x3a')]);_0x5b369c['where']=qs['filters'](_[_0x03e1('0x3b')](_0x3f8ae4['query'],_0x529a8a[_0x03e1('0x33')]));if(_0x3f8ae4['query'][_0x03e1('0x3c')]){_0x5b369c[_0x03e1('0x3d')]=_[_0x03e1('0x3e')](_0x5b369c[_0x03e1('0x3d')],{'$or':_[_0x03e1('0x2c')](_0x5b369c[_0x03e1('0x34')],function(_0x29d003){var _0x244510={};_0x244510[_0x29d003]={'$like':'%'+_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x3c')]+'%'};return _0x244510;})});}_0x5b369c=_[_0x03e1('0x3e')]({},_0x5b369c,_0x3f8ae4[_0x03e1('0x40')]);return _0x1c04fa[_0x03e1('0x4b')](_0x5b369c);}})[_0x03e1('0x26')](function(_0x39a538){if(_0x39a538){_0x31a681=_0x39a538[_0x03e1('0x36')];if(!_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x37')](_0x03e1('0x38'))){_0x5b369c[_0x03e1('0x1e')]=qs[_0x03e1('0x1e')](_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x1e')]);_0x5b369c[_0x03e1('0x1c')]=qs[_0x03e1('0x1c')](_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x1c')]);}return _0x1c04fa[_0x03e1('0x4b')](_0x5b369c);}})[_0x03e1('0x26')](function(_0x2e66b6){if(_0x2e66b6){return _0x2e66b6?{'count':_0x31a681,'rows':_0x2e66b6}:null;}})[_0x03e1('0x26')](respondWithResult(_0x2ead3f,null))['catch'](handleError(_0x2ead3f,null));};exports[_0x03e1('0x4f')]=function(_0xa4e26f,_0x26a8bd,_0x649301){var _0x2d9b56={};var _0x553f40={};var _0x175856;var _0x4e24af;return db[_0x03e1('0x41')][_0x03e1('0x4c')]({'where':{'id':_0xa4e26f['params']['id']}})['then'](handleEntityNotFound(_0x26a8bd,null))[_0x03e1('0x26')](function(_0x44a398){if(_0x44a398){_0x175856=_0x44a398;_0x553f40['model']=_['keys'](db[_0x03e1('0x4d')]['rawAttributes']);_0x553f40[_0x03e1('0x31')]=_[_0x03e1('0x32')](_0xa4e26f['query']);_0x553f40[_0x03e1('0x33')]=_[_0x03e1('0x35')](_0x553f40[_0x03e1('0x46')],_0x553f40[_0x03e1('0x31')]);_0x2d9b56[_0x03e1('0x34')]=_['intersection'](_0x553f40[_0x03e1('0x46')],qs['fields'](_0xa4e26f['query'][_0x03e1('0x4e')]));_0x2d9b56[_0x03e1('0x34')]=_0x2d9b56[_0x03e1('0x34')]['length']?_0x2d9b56[_0x03e1('0x34')]:_0x553f40[_0x03e1('0x46')];_0x2d9b56[_0x03e1('0x39')]=qs[_0x03e1('0x3a')](_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x3a')]);_0x2d9b56[_0x03e1('0x3d')]=qs[_0x03e1('0x33')](_['pick'](_0xa4e26f['query'],_0x553f40[_0x03e1('0x33')]));if(_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x3c')]){_0x2d9b56['where']=_[_0x03e1('0x3e')](_0x2d9b56['where'],{'$or':_[_0x03e1('0x2c')](_0x2d9b56[_0x03e1('0x34')],function(_0x497e91){var _0x2863a9={};_0x2863a9[_0x497e91]={'$like':'%'+_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x3c')]+'%'};return _0x2863a9;})});}_0x2d9b56=_[_0x03e1('0x3e')]({},_0x2d9b56,_0xa4e26f[_0x03e1('0x40')]);return _0x175856['getSubjects'](_0x2d9b56);}})[_0x03e1('0x26')](function(_0x3d39f8){if(_0x3d39f8){_0x4e24af=_0x3d39f8[_0x03e1('0x36')];if(!_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x37')](_0x03e1('0x38'))){_0x2d9b56['limit']=qs[_0x03e1('0x1e')](_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x1e')]);_0x2d9b56[_0x03e1('0x1c')]=qs[_0x03e1('0x1c')](_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x1c')]);}return _0x175856[_0x03e1('0x4f')](_0x2d9b56);}})[_0x03e1('0x26')](function(_0x4971c4){if(_0x4971c4){return _0x4971c4?{'count':_0x4e24af,'rows':_0x4971c4}:null;}})[_0x03e1('0x26')](respondWithResult(_0x26a8bd,null))['catch'](handleError(_0x26a8bd,null));};exports[_0x03e1('0x50')]=function(_0x116be5,_0x34d8e8,_0x7b6df3){var _0x4ce57b={};var _0x5af0c8={};var _0xb24c55;var _0x46a965;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x116be5[_0x03e1('0x45')]['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0x34d8e8,null))[_0x03e1('0x26')](function(_0x550c6a){if(_0x550c6a){_0xb24c55=_0x550c6a;_0x5af0c8[_0x03e1('0x46')]=_[_0x03e1('0x32')](db[_0x03e1('0x4d')]['rawAttributes']);_0x5af0c8[_0x03e1('0x31')]=_[_0x03e1('0x32')](_0x116be5[_0x03e1('0x31')]);_0x5af0c8[_0x03e1('0x33')]=_[_0x03e1('0x35')](_0x5af0c8[_0x03e1('0x46')],_0x5af0c8[_0x03e1('0x31')]);_0x4ce57b[_0x03e1('0x34')]=_[_0x03e1('0x35')](_0x5af0c8[_0x03e1('0x46')],qs[_0x03e1('0x4e')](_0x116be5[_0x03e1('0x31')][_0x03e1('0x4e')]));_0x4ce57b[_0x03e1('0x34')]=_0x4ce57b[_0x03e1('0x34')][_0x03e1('0x36')]?_0x4ce57b['attributes']:_0x5af0c8[_0x03e1('0x46')];_0x4ce57b[_0x03e1('0x39')]=qs['sort'](_0x116be5[_0x03e1('0x31')]['sort']);_0x4ce57b[_0x03e1('0x3d')]=qs['filters'](_[_0x03e1('0x3b')](_0x116be5['query'],_0x5af0c8[_0x03e1('0x33')]));if(_0x116be5[_0x03e1('0x31')][_0x03e1('0x3c')]){_0x4ce57b[_0x03e1('0x3d')]=_[_0x03e1('0x3e')](_0x4ce57b['where'],{'$or':_[_0x03e1('0x2c')](_0x4ce57b[_0x03e1('0x34')],function(_0x4cc26d){var _0x188af0={};_0x188af0[_0x4cc26d]={'$like':'%'+_0x116be5[_0x03e1('0x31')][_0x03e1('0x3c')]+'%'};return _0x188af0;})});}_0x4ce57b=_['merge']({},_0x4ce57b,_0x116be5[_0x03e1('0x40')]);return _0xb24c55['getDescriptions'](_0x4ce57b);}})['then'](function(_0x593d8f){if(_0x593d8f){_0x46a965=_0x593d8f[_0x03e1('0x36')];if(!_0x116be5[_0x03e1('0x31')][_0x03e1('0x37')]('nolimit')){_0x4ce57b['limit']=qs[_0x03e1('0x1e')](_0x116be5[_0x03e1('0x31')]['limit']);_0x4ce57b['offset']=qs['offset'](_0x116be5['query'][_0x03e1('0x1c')]);}return _0xb24c55['getDescriptions'](_0x4ce57b);}})[_0x03e1('0x26')](function(_0xa90dbe){if(_0xa90dbe){return _0xa90dbe?{'count':_0x46a965,'rows':_0xa90dbe}:null;}})[_0x03e1('0x26')](respondWithResult(_0x34d8e8,null))[_0x03e1('0x48')](handleError(_0x34d8e8,null));};exports[_0x03e1('0x51')]=function(_0x25a1a3,_0x317f1f,_0x4e1f3f){var _0x59d055={};var _0x55707c={};var _0x1bc21e;var _0x198ba3;return db[_0x03e1('0x41')][_0x03e1('0x4c')]({'where':{'id':_0x25a1a3[_0x03e1('0x45')]['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0x317f1f,null))[_0x03e1('0x26')](function(_0x232449){if(_0x232449){_0x1bc21e=_0x232449;_0x55707c[_0x03e1('0x46')]=_['keys'](db[_0x03e1('0x52')]['rawAttributes']);_0x55707c['query']=_[_0x03e1('0x32')](_0x25a1a3[_0x03e1('0x31')]);_0x55707c['filters']=_['intersection'](_0x55707c[_0x03e1('0x46')],_0x55707c[_0x03e1('0x31')]);_0x59d055[_0x03e1('0x34')]=_['intersection'](_0x55707c[_0x03e1('0x46')],qs[_0x03e1('0x4e')](_0x25a1a3['query'][_0x03e1('0x4e')]));_0x59d055['attributes']=_0x59d055[_0x03e1('0x34')]['length']?_0x59d055[_0x03e1('0x34')]:_0x55707c['model'];_0x59d055[_0x03e1('0x39')]=qs['sort'](_0x25a1a3[_0x03e1('0x31')]['sort']);_0x59d055[_0x03e1('0x3d')]=qs[_0x03e1('0x33')](_['pick'](_0x25a1a3[_0x03e1('0x31')],_0x55707c[_0x03e1('0x33')]));if(_0x25a1a3[_0x03e1('0x31')]['filter']){_0x59d055[_0x03e1('0x3d')]=_[_0x03e1('0x3e')](_0x59d055[_0x03e1('0x3d')],{'$or':_[_0x03e1('0x2c')](_0x59d055[_0x03e1('0x34')],function(_0x301ed4){var _0x19e211={};_0x19e211[_0x301ed4]={'$like':'%'+_0x25a1a3['query'][_0x03e1('0x3c')]+'%'};return _0x19e211;})});}_0x59d055=_['merge']({},_0x59d055,_0x25a1a3[_0x03e1('0x40')]);return _0x1bc21e[_0x03e1('0x51')](_0x59d055);}})[_0x03e1('0x26')](function(_0x51be8b){if(_0x51be8b){_0x198ba3=_0x51be8b[_0x03e1('0x36')];if(!_0x25a1a3[_0x03e1('0x31')][_0x03e1('0x37')]('nolimit')){_0x59d055[_0x03e1('0x1e')]=qs[_0x03e1('0x1e')](_0x25a1a3[_0x03e1('0x31')][_0x03e1('0x1e')]);_0x59d055[_0x03e1('0x1c')]=qs['offset'](_0x25a1a3[_0x03e1('0x31')][_0x03e1('0x1c')]);}return _0x1bc21e[_0x03e1('0x51')](_0x59d055);}})[_0x03e1('0x26')](function(_0x5aa479){if(_0x5aa479){return _0x5aa479?{'count':_0x198ba3,'rows':_0x5aa479}:null;}})[_0x03e1('0x26')](respondWithResult(_0x317f1f,null))[_0x03e1('0x48')](handleError(_0x317f1f,null));};exports[_0x03e1('0x53')]=function(_0x26ad1b,_0x10cd71,_0x41fec1){if(_0x26ad1b[_0x03e1('0x4a')]['id']){delete _0x26ad1b[_0x03e1('0x4a')]['id'];}return db[_0x03e1('0x41')]['findOne']({'where':{'id':_0x26ad1b[_0x03e1('0x45')]['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0x10cd71,null))[_0x03e1('0x26')](function(_0x2a8aed){if(_0x2a8aed){return _0x2a8aed['setTags'](_0x26ad1b[_0x03e1('0x4a')]['ids']||[]);}return null;})[_0x03e1('0x26')](respondWithResult(_0x10cd71,null))['catch'](handleError(_0x10cd71,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 122ebf9..21c4d25 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbdd=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','request-promise','rimraf','./intFreshdeskConfiguration.attributes'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xbbdd,0x1e3));var _0xdbbd=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xbbdd[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xdbbd('0x0'));var util=require(_0xdbbd('0x1'));var logger=require('../../config/logger')(_0xdbbd('0x2'));var moment=require(_0xdbbd('0x3'));var BPromise=require('bluebird');var rp=require(_0xdbbd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdbbd('0x5'));var config=require('../../config/environment');var attributes=require(_0xdbbd('0x6'));module['exports']=function(_0x241f34,_0x4d9498){return _0x241f34[_0xdbbd('0x7')](_0xdbbd('0x8'),attributes,{'tableName':_0xdbbd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0c3=['./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0c3,0x9e));var _0x3c0c=function(_0x5f47ca,_0x1fc7bf){_0x5f47ca=_0x5f47ca-0x0;var _0x1ed62a=_0xc0c3[_0x5f47ca];return _0x1ed62a;};'use strict';var _=require(_0x3c0c('0x0'));var util=require(_0x3c0c('0x1'));var logger=require(_0x3c0c('0x2'))(_0x3c0c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c0c('0x4'));var rimraf=require(_0x3c0c('0x5'));var config=require(_0x3c0c('0x6'));var attributes=require(_0x3c0c('0x7'));module['exports']=function(_0x3bca1f,_0x1db120){return _0x3bca1f[_0x3c0c('0x8')](_0x3c0c('0x9'),attributes,{'tableName':_0x3c0c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 75a95d3..0b624cc 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a35=['info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','error','FreshdeskConfiguration,\x20%s,\x20%s','message'];(function(_0x46518d,_0x446bb8){var _0x3661c0=function(_0x5dd980){while(--_0x5dd980){_0x46518d['push'](_0x46518d['shift']());}};_0x3661c0(++_0x446bb8);}(_0x9a35,0x10b));var _0x59a3=function(_0x2840c9,_0xd6f959){_0x2840c9=_0x2840c9-0x0;var _0x88f2c4=_0x9a35[_0x2840c9];return _0x88f2c4;};'use strict';var _=require('lodash');var util=require(_0x59a3('0x0'));var moment=require(_0x59a3('0x1'));var BPromise=require(_0x59a3('0x2'));var rs=require(_0x59a3('0x3'));var fs=require('fs');var Redis=require(_0x59a3('0x4'));var db=require(_0x59a3('0x5'))['db'];var utils=require(_0x59a3('0x6'));var logger=require('../../config/logger')(_0x59a3('0x7'));var config=require(_0x59a3('0x8'));var jayson=require(_0x59a3('0x9'));var client=jayson[_0x59a3('0xa')][_0x59a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c07ef,_0x34f01e,_0xc569e9){return new BPromise(function(_0x195769,_0x3b09f0){return client['request'](_0x3c07ef,_0xc569e9)[_0x59a3('0xc')](function(_0x4f92e3){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x34f01e,_0x59a3('0xd'));logger[_0x59a3('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x34f01e,_0x59a3('0xd'),JSON['stringify'](_0x4f92e3));if(_0x4f92e3['error']){if(_0x4f92e3[_0x59a3('0xf')]['code']===0x1f4){logger[_0x59a3('0xf')](_0x59a3('0x10'),_0x34f01e,_0x4f92e3['error'][_0x59a3('0x11')]);return _0x3b09f0(_0x4f92e3[_0x59a3('0xf')][_0x59a3('0x11')]);}logger[_0x59a3('0xf')](_0x59a3('0x10'),_0x34f01e,_0x4f92e3[_0x59a3('0xf')][_0x59a3('0x11')]);return _0x195769(_0x4f92e3[_0x59a3('0xf')][_0x59a3('0x11')]);}else{logger[_0x59a3('0x12')](_0x59a3('0x10'),_0x34f01e,'request\x20sent');_0x195769(_0x4f92e3['result'][_0x59a3('0x11')]);}})['catch'](function(_0x7816c8){logger[_0x59a3('0xf')](_0x59a3('0x10'),_0x34f01e,_0x7816c8);_0x3b09f0(_0x7816c8);});});} \ No newline at end of file +var _0x46ad=['result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x22e396,_0x202d65){var _0x2a3149=function(_0x147447){while(--_0x147447){_0x22e396['push'](_0x22e396['shift']());}};_0x2a3149(++_0x202d65);}(_0x46ad,0x162));var _0xd46a=function(_0x47d501,_0x1b9cf1){_0x47d501=_0x47d501-0x0;var _0x36c1a9=_0x46ad[_0x47d501];return _0x36c1a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd46a('0x0'));var BPromise=require(_0xd46a('0x1'));var rs=require(_0xd46a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd46a('0x3'))['db'];var utils=require(_0xd46a('0x4'));var logger=require(_0xd46a('0x5'))(_0xd46a('0x6'));var config=require(_0xd46a('0x7'));var jayson=require(_0xd46a('0x8'));var client=jayson['client'][_0xd46a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x425a10,_0x2b20af,_0xaa4763){return new BPromise(function(_0x582c83,_0xab59dd){return client[_0xd46a('0xa')](_0x425a10,_0xaa4763)[_0xd46a('0xb')](function(_0x432cb6){logger[_0xd46a('0xc')](_0xd46a('0xd'),_0x2b20af,'request\x20sent');logger[_0xd46a('0xe')](_0xd46a('0xf'),_0x2b20af,'request\x20sent',JSON[_0xd46a('0x10')](_0x432cb6));if(_0x432cb6[_0xd46a('0x11')]){if(_0x432cb6['error'][_0xd46a('0x12')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b20af,_0x432cb6[_0xd46a('0x11')][_0xd46a('0x13')]);return _0xab59dd(_0x432cb6['error'][_0xd46a('0x13')]);}logger[_0xd46a('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b20af,_0x432cb6[_0xd46a('0x11')][_0xd46a('0x13')]);return _0x582c83(_0x432cb6[_0xd46a('0x11')]['message']);}else{logger['info'](_0xd46a('0xd'),_0x2b20af,'request\x20sent');_0x582c83(_0x432cb6[_0xd46a('0x14')][_0xd46a('0x13')]);}})[_0xd46a('0x15')](function(_0x5e93eb){logger['error'](_0xd46a('0xd'),_0x2b20af,_0x5e93eb);_0xab59dd(_0x5e93eb);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index c25a900..5ccc18f 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2160=['post','create','put','update','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x36565d,_0x37395c){var _0x2032ed=function(_0x52a9d3){while(--_0x52a9d3){_0x36565d['push'](_0x36565d['shift']());}};_0x2032ed(++_0x37395c);}(_0x2160,0x15c));var _0x0216=function(_0x36667c,_0x479b74){_0x36667c=_0x36667c-0x0;var _0x521dfe=_0x2160[_0x36667c];return _0x521dfe;};'use strict';var multer=require('multer');var util=require(_0x0216('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0216('0x1'));var router=express[_0x0216('0x2')]();var fs_extra=require(_0x0216('0x3'));var auth=require(_0x0216('0x4'));var interaction=require(_0x0216('0x5'));var config=require(_0x0216('0x6'));var controller=require(_0x0216('0x7'));router[_0x0216('0x8')]('/',auth[_0x0216('0x9')](),controller[_0x0216('0xa')]);router[_0x0216('0x8')](_0x0216('0xb'),auth[_0x0216('0x9')](),controller['show']);router[_0x0216('0xc')]('/',auth['isAuthenticated'](),controller[_0x0216('0xd')]);router[_0x0216('0xe')](_0x0216('0xb'),auth[_0x0216('0x9')](),controller[_0x0216('0xf')]);router[_0x0216('0x10')](_0x0216('0xb'),auth[_0x0216('0x9')](),controller['destroy']);module[_0x0216('0x11')]=router; \ No newline at end of file +var _0x0902=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x563242,_0xd8efda){var _0x5d0488=function(_0x2fe493){while(--_0x2fe493){_0x563242['push'](_0x563242['shift']());}};_0x5d0488(++_0xd8efda);}(_0x0902,0xe4));var _0x2090=function(_0x5c16e1,_0x12ea72){_0x5c16e1=_0x5c16e1-0x0;var _0x4f59d0=_0x0902[_0x5c16e1];return _0x4f59d0;};'use strict';var multer=require(_0x2090('0x0'));var util=require(_0x2090('0x1'));var path=require(_0x2090('0x2'));var timeout=require(_0x2090('0x3'));var express=require(_0x2090('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2090('0x5'));var interaction=require(_0x2090('0x6'));var config=require(_0x2090('0x7'));var controller=require(_0x2090('0x8'));router[_0x2090('0x9')]('/',auth[_0x2090('0xa')](),controller[_0x2090('0xb')]);router['get'](_0x2090('0xc'),auth[_0x2090('0xa')](),controller[_0x2090('0xd')]);router[_0x2090('0xe')]('/',auth['isAuthenticated'](),controller[_0x2090('0xf')]);router['put'](_0x2090('0xc'),auth[_0x2090('0xa')](),controller['update']);router[_0x2090('0x10')]('/:id',auth[_0x2090('0xa')](),controller[_0x2090('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 1fe50e6..00cc769 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js +++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18af=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x5afd90,_0x2ecf29){var _0x3c100b=function(_0x2c730c){while(--_0x2c730c){_0x5afd90['push'](_0x5afd90['shift']());}};_0x3c100b(++_0x2ecf29);}(_0x18af,0x76));var _0xf18a=function(_0x101e79,_0x460a18){_0x101e79=_0x101e79-0x0;var _0x5e8238=_0x18af[_0x101e79];return _0x5e8238;};'use strict';var Sequelize=require(_0xf18a('0x0'));module[_0xf18a('0x1')]={'type':{'type':Sequelize[_0xf18a('0x2')](_0xf18a('0x3'),_0xf18a('0x4'),_0xf18a('0x5'),_0xf18a('0x6'),_0xf18a('0x7')),'defaultValue':_0xf18a('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf18a('0x2')]('string',_0xf18a('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xf18a('0x8')]},'idField':{'type':Sequelize[_0xf18a('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf18a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x50b5=['picklist','STRING','variable','sequelize','ENUM','string','customVariable','keyValue'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x50b5,0x163));var _0x550b=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x50b5[_0x1992f1];return _0x413dfe;};'use strict';var Sequelize=require(_0x550b('0x0'));module['exports']={'type':{'type':Sequelize[_0x550b('0x1')](_0x550b('0x2'),'variable',_0x550b('0x3'),_0x550b('0x4'),_0x550b('0x5')),'defaultValue':_0x550b('0x2')},'content':{'type':Sequelize[_0x550b('0x6')]},'key':{'type':Sequelize[_0x550b('0x6')]},'keyType':{'type':Sequelize[_0x550b('0x1')]('string',_0x550b('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x550b('0x6')]},'idField':{'type':Sequelize[_0x550b('0x6')]},'nameField':{'type':Sequelize[_0x550b('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index bb3afde..88a53cd 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.controller.js +++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5fa=['sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','FreshdeskField','includeAll','rows','catch','show','params','fields','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3072a3,_0x12fcb7){var _0x3b4971=function(_0x347b79){while(--_0x347b79){_0x3072a3['push'](_0x3072a3['shift']());}};_0x3b4971(++_0x12fcb7);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x4d8744,_0x203345){_0x4d8744=_0x4d8744-0x0;var _0x17fb37=_0xa5fa[_0x4d8744];return _0x17fb37;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa5f('0x0'));var zipdir=require(_0xaa5f('0x1'));var jsonpatch=require(_0xaa5f('0x2'));var rp=require(_0xaa5f('0x3'));var moment=require('moment');var BPromise=require(_0xaa5f('0x4'));var Mustache=require(_0xaa5f('0x5'));var util=require('util');var path=require(_0xaa5f('0x6'));var sox=require(_0xaa5f('0x7'));var csv=require(_0xaa5f('0x8'));var ejs=require(_0xaa5f('0x9'));var fs=require('fs');var fs_extra=require(_0xaa5f('0xa'));var _=require(_0xaa5f('0xb'));var squel=require(_0xaa5f('0xc'));var crypto=require(_0xaa5f('0xd'));var jsforce=require(_0xaa5f('0xe'));var deskjs=require(_0xaa5f('0xf'));var toCsv=require(_0xaa5f('0x8'));var querystring=require('querystring');var Papa=require(_0xaa5f('0x10'));var Redis=require(_0xaa5f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa5f('0x13'));var utils=require('../../config/utils');var config=require(_0xaa5f('0x14'));var licenseUtil=require(_0xaa5f('0x15'));var db=require(_0xaa5f('0x16'))['db'];function respondWithStatusCode(_0x9aeae9,_0x252ae0){_0x252ae0=_0x252ae0||0xcc;return function(_0x48d1d3){if(_0x48d1d3){return _0x9aeae9[_0xaa5f('0x17')](_0x252ae0);}return _0x9aeae9['status'](_0x252ae0)[_0xaa5f('0x18')]();};}function respondWithResult(_0x23f872,_0x31eabc){_0x31eabc=_0x31eabc||0xc8;return function(_0x19aa27){if(_0x19aa27){return _0x23f872[_0xaa5f('0x19')](_0x31eabc)['json'](_0x19aa27);}};}function respondWithFilteredResult(_0x4fc828,_0x1f37fb){return function(_0x291042){if(_0x291042){var _0xb0bfb6=typeof _0x1f37fb[_0xaa5f('0x1a')]===_0xaa5f('0x1b')&&typeof _0x1f37fb[_0xaa5f('0x1c')]===_0xaa5f('0x1b');var _0x28407c=_0x291042[_0xaa5f('0x1d')];var _0x3d874f=_0xb0bfb6?0x0:_0x1f37fb[_0xaa5f('0x1a')];var _0x1019e8=_0xb0bfb6?_0x291042['count']:_0x1f37fb[_0xaa5f('0x1a')]+_0x1f37fb[_0xaa5f('0x1c')];var _0x1cbab5;if(_0x1019e8>=_0x28407c){_0x1019e8=_0x28407c;_0x1cbab5=0xc8;}else{_0x1cbab5=0xce;}_0x4fc828[_0xaa5f('0x19')](_0x1cbab5);return _0x4fc828[_0xaa5f('0x1e')](_0xaa5f('0x1f'),_0x3d874f+'-'+_0x1019e8+'/'+_0x28407c)[_0xaa5f('0x20')](_0x291042);}return null;};}function patchUpdates(_0x194691){return function(_0x2d8fc3){try{jsonpatch[_0xaa5f('0x21')](_0x2d8fc3,_0x194691,!![]);}catch(_0x40c223){return BPromise[_0xaa5f('0x22')](_0x40c223);}return _0x2d8fc3[_0xaa5f('0x23')]();};}function saveUpdates(_0x5238a8,_0x1e917d){return function(_0x57082c){if(_0x57082c){return _0x57082c[_0xaa5f('0x24')](_0x5238a8)[_0xaa5f('0x25')](function(_0x561381){return _0x561381;});}return null;};}function removeEntity(_0x1baa2e,_0x1032ce){return function(_0x5b9f0b){if(_0x5b9f0b){return _0x5b9f0b[_0xaa5f('0x26')]()[_0xaa5f('0x25')](function(){_0x1baa2e[_0xaa5f('0x19')](0xcc)[_0xaa5f('0x18')]();});}};}function handleEntityNotFound(_0x1f66c0,_0xacbded){return function(_0x3d7bca){if(!_0x3d7bca){_0x1f66c0[_0xaa5f('0x17')](0x194);}return _0x3d7bca;};}function handleError(_0x51eb55,_0x2445a6){_0x2445a6=_0x2445a6||0x1f4;return function(_0x3a66e8){logger[_0xaa5f('0x27')](_0x3a66e8['stack']);if(_0x3a66e8[_0xaa5f('0x28')]){delete _0x3a66e8[_0xaa5f('0x28')];}_0x51eb55[_0xaa5f('0x19')](_0x2445a6)['send'](_0x3a66e8);};}exports[_0xaa5f('0x29')]=function(_0x479f29,_0x5990d2){var _0x27d1a4={},_0x50998f={},_0x1bffec={'count':0x0,'rows':[]};var _0x4e0ec9=_['map'](db['FreshdeskField'][_0xaa5f('0x2a')],function(_0x4ddebd){return{'name':_0x4ddebd[_0xaa5f('0x2b')],'type':_0x4ddebd[_0xaa5f('0x2c')]['key']};});_0x50998f['model']=_[_0xaa5f('0x2d')](_0x4e0ec9,'name');_0x50998f[_0xaa5f('0x2e')]=_[_0xaa5f('0x2f')](_0x479f29['query']);_0x50998f[_0xaa5f('0x30')]=_[_0xaa5f('0x31')](_0x50998f[_0xaa5f('0x32')],_0x50998f['query']);_0x27d1a4[_0xaa5f('0x33')]=_[_0xaa5f('0x31')](_0x50998f['model'],qs['fields'](_0x479f29['query']['fields']));_0x27d1a4[_0xaa5f('0x33')]=_0x27d1a4[_0xaa5f('0x33')][_0xaa5f('0x34')]?_0x27d1a4[_0xaa5f('0x33')]:_0x50998f[_0xaa5f('0x32')];if(!_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x35')]('nolimit')){_0x27d1a4[_0xaa5f('0x1c')]=qs[_0xaa5f('0x1c')](_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x1c')]);_0x27d1a4[_0xaa5f('0x1a')]=qs[_0xaa5f('0x1a')](_0x479f29['query'][_0xaa5f('0x1a')]);}_0x27d1a4[_0xaa5f('0x36')]=qs[_0xaa5f('0x37')](_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x37')]);_0x27d1a4['where']=qs['filters'](_[_0xaa5f('0x38')](_0x479f29[_0xaa5f('0x2e')],_0x50998f[_0xaa5f('0x30')]),_0x4e0ec9);if(_0x479f29[_0xaa5f('0x2e')]['filter']){_0x27d1a4[_0xaa5f('0x39')]=_[_0xaa5f('0x3a')](_0x27d1a4[_0xaa5f('0x39')],{'$or':_[_0xaa5f('0x2d')](_0x4e0ec9,function(_0x37db88){if(_0x37db88[_0xaa5f('0x2c')]!==_0xaa5f('0x3b')){var _0x2c4d29={};_0x2c4d29[_0x37db88[_0xaa5f('0x28')]]={'$like':'%'+_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x3c')]+'%'};return _0x2c4d29;}})});}_0x27d1a4=_['merge']({},_0x27d1a4,_0x479f29[_0xaa5f('0x3d')]);var _0x2562ce={'where':_0x27d1a4[_0xaa5f('0x39')]};return db[_0xaa5f('0x3e')][_0xaa5f('0x1d')](_0x2562ce)[_0xaa5f('0x25')](function(_0x1fb572){_0x1bffec[_0xaa5f('0x1d')]=_0x1fb572;if(_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x3f')]){_0x27d1a4['include']=[{'all':!![]}];}return db[_0xaa5f('0x3e')]['findAll'](_0x27d1a4);})[_0xaa5f('0x25')](function(_0x21f4bc){_0x1bffec[_0xaa5f('0x40')]=_0x21f4bc;return _0x1bffec;})['then'](respondWithFilteredResult(_0x5990d2,_0x27d1a4))[_0xaa5f('0x41')](handleError(_0x5990d2,null));};exports[_0xaa5f('0x42')]=function(_0xe49f8,_0x528b08){var _0x12a8e4={'raw':!![],'where':{'id':_0xe49f8[_0xaa5f('0x43')]['id']}},_0x179be8={};_0x179be8[_0xaa5f('0x32')]=_['keys'](db[_0xaa5f('0x3e')][_0xaa5f('0x2a')]);_0x179be8[_0xaa5f('0x2e')]=_[_0xaa5f('0x2f')](_0xe49f8[_0xaa5f('0x2e')]);_0x179be8[_0xaa5f('0x30')]=_[_0xaa5f('0x31')](_0x179be8[_0xaa5f('0x32')],_0x179be8['query']);_0x12a8e4[_0xaa5f('0x33')]=_['intersection'](_0x179be8[_0xaa5f('0x32')],qs['fields'](_0xe49f8[_0xaa5f('0x2e')][_0xaa5f('0x44')]));_0x12a8e4['attributes']=_0x12a8e4[_0xaa5f('0x33')][_0xaa5f('0x34')]?_0x12a8e4[_0xaa5f('0x33')]:_0x179be8['model'];if(_0xe49f8['query']['includeAll']){_0x12a8e4[_0xaa5f('0x45')]=[{'all':!![]}];}_0x12a8e4=_['merge']({},_0x12a8e4,_0xe49f8[_0xaa5f('0x3d')]);return db[_0xaa5f('0x3e')][_0xaa5f('0x46')](_0x12a8e4)[_0xaa5f('0x25')](handleEntityNotFound(_0x528b08,null))['then'](respondWithResult(_0x528b08,null))[_0xaa5f('0x41')](handleError(_0x528b08,null));};exports[_0xaa5f('0x47')]=function(_0x3c6a17,_0x231ad1){return db[_0xaa5f('0x3e')][_0xaa5f('0x47')](_0x3c6a17[_0xaa5f('0x48')],{})[_0xaa5f('0x25')](respondWithResult(_0x231ad1,0xc9))[_0xaa5f('0x41')](handleError(_0x231ad1,null));};exports[_0xaa5f('0x24')]=function(_0x3ea553,_0x2de737){if(_0x3ea553[_0xaa5f('0x48')]['id']){delete _0x3ea553[_0xaa5f('0x48')]['id'];}return db[_0xaa5f('0x3e')][_0xaa5f('0x46')]({'where':{'id':_0x3ea553['params']['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x2de737,null))[_0xaa5f('0x25')](saveUpdates(_0x3ea553[_0xaa5f('0x48')],null))[_0xaa5f('0x25')](respondWithResult(_0x2de737,null))[_0xaa5f('0x41')](handleError(_0x2de737,null));};exports[_0xaa5f('0x26')]=function(_0x32bbed,_0x4aa556){return db[_0xaa5f('0x3e')][_0xaa5f('0x46')]({'where':{'id':_0x32bbed[_0xaa5f('0x43')]['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x4aa556,null))['then'](removeEntity(_0x4aa556,null))[_0xaa5f('0x41')](handleError(_0x4aa556,null));}; \ No newline at end of file +var _0x6324=['merge','where','type','VIRTUAL','filter','options','FreshdeskField','includeAll','rows','show','keys','intersection','include','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','model','name','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick'];(function(_0x9eacf,_0x1c42ea){var _0x1d5d5a=function(_0x545160){while(--_0x545160){_0x9eacf['push'](_0x9eacf['shift']());}};_0x1d5d5a(++_0x1c42ea);}(_0x6324,0x142));var _0x4632=function(_0x312484,_0x2605e6){_0x312484=_0x312484-0x0;var _0x5035e8=_0x6324[_0x312484];return _0x5035e8;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3f0f,_0x499d88){_0x499d88=_0x499d88||0xcc;return function(_0x4719f7){if(_0x4719f7){return _0x2b3f0f[_0x4632('0x18')](_0x499d88);}return _0x2b3f0f[_0x4632('0x19')](_0x499d88)[_0x4632('0x1a')]();};}function respondWithResult(_0x51ee37,_0x3ba361){_0x3ba361=_0x3ba361||0xc8;return function(_0x255882){if(_0x255882){return _0x51ee37[_0x4632('0x19')](_0x3ba361)[_0x4632('0x1b')](_0x255882);}};}function respondWithFilteredResult(_0x1c1be0,_0x5438ab){return function(_0x47b349){if(_0x47b349){var _0x2fd7ae=typeof _0x5438ab[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x5438ab[_0x4632('0x1e')]==='undefined';var _0x158831=_0x47b349[_0x4632('0x1f')];var _0x1a94c0=_0x2fd7ae?0x0:_0x5438ab['offset'];var _0x3cddfa=_0x2fd7ae?_0x47b349[_0x4632('0x1f')]:_0x5438ab['offset']+_0x5438ab['limit'];var _0x1c0523;if(_0x3cddfa>=_0x158831){_0x3cddfa=_0x158831;_0x1c0523=0xc8;}else{_0x1c0523=0xce;}_0x1c1be0[_0x4632('0x19')](_0x1c0523);return _0x1c1be0[_0x4632('0x20')](_0x4632('0x21'),_0x1a94c0+'-'+_0x3cddfa+'/'+_0x158831)[_0x4632('0x1b')](_0x47b349);}return null;};}function patchUpdates(_0x3d2d23){return function(_0x9ab826){try{jsonpatch[_0x4632('0x22')](_0x9ab826,_0x3d2d23,!![]);}catch(_0x29f875){return BPromise[_0x4632('0x23')](_0x29f875);}return _0x9ab826[_0x4632('0x24')]();};}function saveUpdates(_0x2d656a,_0x2ca6a5){return function(_0x263907){if(_0x263907){return _0x263907[_0x4632('0x25')](_0x2d656a)[_0x4632('0x26')](function(_0x4264d5){return _0x4264d5;});}return null;};}function removeEntity(_0x3537ed,_0x380a9f){return function(_0x1e1b86){if(_0x1e1b86){return _0x1e1b86[_0x4632('0x27')]()[_0x4632('0x26')](function(){_0x3537ed[_0x4632('0x19')](0xcc)[_0x4632('0x1a')]();});}};}function handleEntityNotFound(_0xb074d,_0x1b8de0){return function(_0x4af026){if(!_0x4af026){_0xb074d[_0x4632('0x18')](0x194);}return _0x4af026;};}function handleError(_0x21118c,_0x372679){_0x372679=_0x372679||0x1f4;return function(_0x22d0f5){logger[_0x4632('0x28')](_0x22d0f5[_0x4632('0x29')]);if(_0x22d0f5['name']){delete _0x22d0f5['name'];}_0x21118c[_0x4632('0x19')](_0x372679)[_0x4632('0x2a')](_0x22d0f5);};}exports[_0x4632('0x2b')]=function(_0x35a533,_0x34079f){var _0x119d1b={},_0x3570b2={},_0x5e2ee4={'count':0x0,'rows':[]};var _0x42d505=_[_0x4632('0x2c')](db['FreshdeskField'][_0x4632('0x2d')],function(_0x5316f7){return{'name':_0x5316f7[_0x4632('0x2e')],'type':_0x5316f7['type']['key']};});_0x3570b2[_0x4632('0x2f')]=_[_0x4632('0x2c')](_0x42d505,_0x4632('0x30'));_0x3570b2['query']=_['keys'](_0x35a533[_0x4632('0x31')]);_0x3570b2[_0x4632('0x32')]=_['intersection'](_0x3570b2['model'],_0x3570b2[_0x4632('0x31')]);_0x119d1b[_0x4632('0x33')]=_['intersection'](_0x3570b2[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x35a533[_0x4632('0x31')][_0x4632('0x34')]));_0x119d1b[_0x4632('0x33')]=_0x119d1b['attributes'][_0x4632('0x35')]?_0x119d1b[_0x4632('0x33')]:_0x3570b2['model'];if(!_0x35a533['query'][_0x4632('0x36')]('nolimit')){_0x119d1b['limit']=qs[_0x4632('0x1e')](_0x35a533['query'][_0x4632('0x1e')]);_0x119d1b[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x35a533['query'][_0x4632('0x1c')]);}_0x119d1b[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x35a533[_0x4632('0x31')][_0x4632('0x38')]);_0x119d1b['where']=qs['filters'](_[_0x4632('0x39')](_0x35a533[_0x4632('0x31')],_0x3570b2[_0x4632('0x32')]),_0x42d505);if(_0x35a533['query']['filter']){_0x119d1b['where']=_[_0x4632('0x3a')](_0x119d1b[_0x4632('0x3b')],{'$or':_['map'](_0x42d505,function(_0x3809aa){if(_0x3809aa[_0x4632('0x3c')]!==_0x4632('0x3d')){var _0x3adf41={};_0x3adf41[_0x3809aa[_0x4632('0x30')]]={'$like':'%'+_0x35a533[_0x4632('0x31')][_0x4632('0x3e')]+'%'};return _0x3adf41;}})});}_0x119d1b=_[_0x4632('0x3a')]({},_0x119d1b,_0x35a533[_0x4632('0x3f')]);var _0x2c04a8={'where':_0x119d1b[_0x4632('0x3b')]};return db[_0x4632('0x40')]['count'](_0x2c04a8)[_0x4632('0x26')](function(_0x45bff6){_0x5e2ee4['count']=_0x45bff6;if(_0x35a533[_0x4632('0x31')][_0x4632('0x41')]){_0x119d1b['include']=[{'all':!![]}];}return db[_0x4632('0x40')]['findAll'](_0x119d1b);})[_0x4632('0x26')](function(_0x28df3b){_0x5e2ee4[_0x4632('0x42')]=_0x28df3b;return _0x5e2ee4;})[_0x4632('0x26')](respondWithFilteredResult(_0x34079f,_0x119d1b))['catch'](handleError(_0x34079f,null));};exports[_0x4632('0x43')]=function(_0x29381a,_0x23ef38){var _0x279298={'raw':!![],'where':{'id':_0x29381a['params']['id']}},_0x5cc716={};_0x5cc716[_0x4632('0x2f')]=_[_0x4632('0x44')](db[_0x4632('0x40')]['rawAttributes']);_0x5cc716[_0x4632('0x31')]=_[_0x4632('0x44')](_0x29381a[_0x4632('0x31')]);_0x5cc716[_0x4632('0x32')]=_[_0x4632('0x45')](_0x5cc716[_0x4632('0x2f')],_0x5cc716[_0x4632('0x31')]);_0x279298['attributes']=_[_0x4632('0x45')](_0x5cc716[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x29381a[_0x4632('0x31')][_0x4632('0x34')]));_0x279298['attributes']=_0x279298['attributes'][_0x4632('0x35')]?_0x279298[_0x4632('0x33')]:_0x5cc716[_0x4632('0x2f')];if(_0x29381a[_0x4632('0x31')]['includeAll']){_0x279298[_0x4632('0x46')]=[{'all':!![]}];}_0x279298=_[_0x4632('0x3a')]({},_0x279298,_0x29381a[_0x4632('0x3f')]);return db[_0x4632('0x40')][_0x4632('0x47')](_0x279298)['then'](handleEntityNotFound(_0x23ef38,null))[_0x4632('0x26')](respondWithResult(_0x23ef38,null))[_0x4632('0x48')](handleError(_0x23ef38,null));};exports[_0x4632('0x49')]=function(_0xcce5db,_0x3676fa){return db[_0x4632('0x40')][_0x4632('0x49')](_0xcce5db[_0x4632('0x4a')],{})[_0x4632('0x26')](respondWithResult(_0x3676fa,0xc9))[_0x4632('0x48')](handleError(_0x3676fa,null));};exports[_0x4632('0x25')]=function(_0x517584,_0xc3ffd0){if(_0x517584[_0x4632('0x4a')]['id']){delete _0x517584[_0x4632('0x4a')]['id'];}return db['FreshdeskField'][_0x4632('0x47')]({'where':{'id':_0x517584[_0x4632('0x4b')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0xc3ffd0,null))[_0x4632('0x26')](saveUpdates(_0x517584[_0x4632('0x4a')],null))[_0x4632('0x26')](respondWithResult(_0xc3ffd0,null))[_0x4632('0x48')](handleError(_0xc3ffd0,null));};exports[_0x4632('0x27')]=function(_0x1f43b6,_0x1aa831){return db['FreshdeskField'][_0x4632('0x47')]({'where':{'id':_0x1f43b6[_0x4632('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1aa831,null))[_0x4632('0x26')](removeEntity(_0x1aa831,null))[_0x4632('0x48')](handleError(_0x1aa831,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index ebb5e86..29abc35 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.model.js +++ b/server/api/intFreshdeskField/intFreshdeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12f1=['moment','bluebird','request-promise','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0x12f1,0xf4));var _0x112f=function(_0x165430,_0x45cce0){_0x165430=_0x165430-0x0;var _0x7fc920=_0x12f1[_0x165430];return _0x7fc920;};'use strict';var _=require(_0x112f('0x0'));var util=require('util');var logger=require(_0x112f('0x1'))(_0x112f('0x2'));var moment=require(_0x112f('0x3'));var BPromise=require(_0x112f('0x4'));var rp=require(_0x112f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x112f('0x6'));module['exports']=function(_0x21cccd,_0x2044f2){return _0x21cccd[_0x112f('0x7')](_0x112f('0x8'),attributes,{'tableName':_0x112f('0x9'),'paranoid':![],'indexes':[{'name':_0x112f('0xa'),'fields':[_0x112f('0xb'),_0x112f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ec0=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2ec0,0x69));var _0x02ec=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x2ec0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x02ec('0x0'));var util=require(_0x02ec('0x1'));var logger=require(_0x02ec('0x2'))(_0x02ec('0x3'));var moment=require('moment');var BPromise=require(_0x02ec('0x4'));var rp=require(_0x02ec('0x5'));var fs=require('fs');var path=require(_0x02ec('0x6'));var rimraf=require(_0x02ec('0x7'));var config=require(_0x02ec('0x8'));var attributes=require(_0x02ec('0x9'));module[_0x02ec('0xa')]=function(_0x170e0d,_0x4df2ac){return _0x170e0d[_0x02ec('0xb')](_0x02ec('0xc'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x02ec('0xd'),'fields':[_0x02ec('0xe'),_0x02ec('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 9c72b81..ebc6585 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9cb=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x37466b,_0x1b11bf){var _0x274ece=function(_0x484c88){while(--_0x484c88){_0x37466b['push'](_0x37466b['shift']());}};_0x274ece(++_0x1b11bf);}(_0xb9cb,0x19d));var _0xbb9c=function(_0x596284,_0x1cd02b){_0x596284=_0x596284-0x0;var _0x5313c6=_0xb9cb[_0x596284];return _0x5313c6;};'use strict';var _=require(_0xbb9c('0x0'));var util=require('util');var moment=require(_0xbb9c('0x1'));var BPromise=require(_0xbb9c('0x2'));var rs=require(_0xbb9c('0x3'));var fs=require('fs');var Redis=require(_0xbb9c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb9c('0x5'));var logger=require(_0xbb9c('0x6'))(_0xbb9c('0x7'));var config=require(_0xbb9c('0x8'));var jayson=require(_0xbb9c('0x9'));var client=jayson['client'][_0xbb9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdb39d1,_0x23d8d1,_0x41c904){return new BPromise(function(_0x15eae9,_0x3393d4){return client['request'](_0xdb39d1,_0x41c904)[_0xbb9c('0xb')](function(_0x15fe6a){logger[_0xbb9c('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x23d8d1,_0xbb9c('0xd'));logger[_0xbb9c('0xe')](_0xbb9c('0xf'),_0x23d8d1,'request\x20sent',JSON[_0xbb9c('0x10')](_0x15fe6a));if(_0x15fe6a[_0xbb9c('0x11')]){if(_0x15fe6a[_0xbb9c('0x11')][_0xbb9c('0x12')]===0x1f4){logger[_0xbb9c('0x11')](_0xbb9c('0x13'),_0x23d8d1,_0x15fe6a['error'][_0xbb9c('0x14')]);return _0x3393d4(_0x15fe6a[_0xbb9c('0x11')][_0xbb9c('0x14')]);}logger[_0xbb9c('0x11')](_0xbb9c('0x13'),_0x23d8d1,_0x15fe6a[_0xbb9c('0x11')][_0xbb9c('0x14')]);return _0x15eae9(_0x15fe6a[_0xbb9c('0x11')][_0xbb9c('0x14')]);}else{logger['info'](_0xbb9c('0x13'),_0x23d8d1,'request\x20sent');_0x15eae9(_0x15fe6a[_0xbb9c('0x15')][_0xbb9c('0x14')]);}})[_0xbb9c('0x16')](function(_0x575b2b){logger[_0xbb9c('0x11')](_0xbb9c('0x13'),_0x23d8d1,_0x575b2b);_0x3393d4(_0x575b2b);});});} \ No newline at end of file +var _0xe37e=['request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x404c35,_0xedfe89){var _0x28c900=function(_0x2dc0ab){while(--_0x2dc0ab){_0x404c35['push'](_0x404c35['shift']());}};_0x28c900(++_0xedfe89);}(_0xe37e,0x14d));var _0xee37=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xe37e[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0xee37('0x0'));var util=require(_0xee37('0x1'));var moment=require(_0xee37('0x2'));var BPromise=require(_0xee37('0x3'));var rs=require(_0xee37('0x4'));var fs=require('fs');var Redis=require(_0xee37('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xee37('0x6'));var logger=require(_0xee37('0x7'))(_0xee37('0x8'));var config=require(_0xee37('0x9'));var jayson=require(_0xee37('0xa'));var client=jayson['client'][_0xee37('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x503718,_0x5c3c7c,_0x4eeb52){return new BPromise(function(_0x34d4e2,_0x114729){return client[_0xee37('0xc')](_0x503718,_0x4eeb52)[_0xee37('0xd')](function(_0x16dbd3){logger[_0xee37('0xe')](_0xee37('0xf'),_0x5c3c7c,_0xee37('0x10'));logger['debug'](_0xee37('0x11'),_0x5c3c7c,_0xee37('0x10'),JSON[_0xee37('0x12')](_0x16dbd3));if(_0x16dbd3['error']){if(_0x16dbd3[_0xee37('0x13')]['code']===0x1f4){logger[_0xee37('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x5c3c7c,_0x16dbd3[_0xee37('0x13')][_0xee37('0x14')]);return _0x114729(_0x16dbd3[_0xee37('0x13')][_0xee37('0x14')]);}logger[_0xee37('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x5c3c7c,_0x16dbd3[_0xee37('0x13')]['message']);return _0x34d4e2(_0x16dbd3['error']['message']);}else{logger[_0xee37('0xe')](_0xee37('0xf'),_0x5c3c7c,_0xee37('0x10'));_0x34d4e2(_0x16dbd3[_0xee37('0x15')][_0xee37('0x14')]);}})[_0xee37('0x16')](function(_0x308114){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x5c3c7c,_0x308114);_0x114729(_0x308114);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 1f46f6f..0c1f8c4 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb58b=['Router','fs-extra','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x1731ca,_0x24ead1){var _0x55e402=function(_0xab8e6){while(--_0xab8e6){_0x1731ca['push'](_0x1731ca['shift']());}};_0x55e402(++_0x24ead1);}(_0xb58b,0x1f1));var _0xbb58=function(_0x54e213,_0x2be24e){_0x54e213=_0x54e213-0x0;var _0x39b5b2=_0xb58b[_0x54e213];return _0x39b5b2;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require('../../config/environment');var controller=require(_0xbb58('0x6'));router[_0xbb58('0x7')]('/',auth[_0xbb58('0x8')](),controller['index']);router[_0xbb58('0x7')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x7')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);router[_0xbb58('0x7')](_0xbb58('0xd'),auth[_0xbb58('0x8')](),controller['getFields']);router[_0xbb58('0xe')]('/',auth['isAuthenticated'](),controller[_0xbb58('0xf')]);router[_0xbb58('0xe')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller['addConfiguration']);router[_0xbb58('0x10')](_0xbb58('0x9'),auth['isAuthenticated'](),controller[_0xbb58('0x11')]);router[_0xbb58('0x12')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0fd9=['../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x25cb87,_0xc2d352){var _0x3a7537=function(_0x53516a){while(--_0x53516a){_0x25cb87['push'](_0x25cb87['shift']());}};_0x3a7537(++_0xc2d352);}(_0x0fd9,0xa3));var _0x90fd=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0x0fd9[_0x80f51a];return _0x327148;};'use strict';var multer=require('multer');var util=require(_0x90fd('0x0'));var path=require(_0x90fd('0x1'));var timeout=require(_0x90fd('0x2'));var express=require(_0x90fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90fd('0x4'));var interaction=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var controller=require(_0x90fd('0x7'));router[_0x90fd('0x8')]('/',auth[_0x90fd('0x9')](),controller['index']);router['get'](_0x90fd('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x90fd('0x8')](_0x90fd('0xb'),auth['isAuthenticated'](),controller[_0x90fd('0xc')]);router[_0x90fd('0x8')](_0x90fd('0xd'),auth[_0x90fd('0x9')](),controller[_0x90fd('0xe')]);router[_0x90fd('0xf')]('/',auth[_0x90fd('0x9')](),controller[_0x90fd('0x10')]);router[_0x90fd('0xf')]('/:id/configurations',auth[_0x90fd('0x9')](),controller[_0x90fd('0x11')]);router['put'](_0x90fd('0xa'),auth[_0x90fd('0x9')](),controller[_0x90fd('0x12')]);router['delete'](_0x90fd('0xa'),auth['isAuthenticated'](),controller[_0x90fd('0x13')]);module[_0x90fd('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index d2f1003..8814634 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe820=['sequelize','STRING','username'];(function(_0x39c564,_0x128713){var _0x4ddf1f=function(_0x44df8b){while(--_0x44df8b){_0x39c564['push'](_0x39c564['shift']());}};_0x4ddf1f(++_0x128713);}(_0xe820,0xd2));var _0x0e82=function(_0x2ea74e,_0x12a67c){_0x2ea74e=_0x2ea74e-0x0;var _0x1a909a=_0xe820[_0x2ea74e];return _0x1a909a;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0e82('0x2')},'apiKey':{'type':Sequelize[_0x0e82('0x1')]},'remoteUri':{'type':Sequelize[_0x0e82('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x3266=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1e2c73,_0x12cd55){var _0x46f8d5=function(_0xe5a2fd){while(--_0xe5a2fd){_0x1e2c73['push'](_0x1e2c73['shift']());}};_0x46f8d5(++_0x12cd55);}(_0x3266,0x6a));var _0x6326=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x3266[_0x11a220];return _0x20d8fe;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'name':{'type':Sequelize[_0x6326('0x2')]},'description':{'type':Sequelize[_0x6326('0x2')]},'username':{'type':Sequelize[_0x6326('0x2')],'unique':_0x6326('0x3')},'apiKey':{'type':Sequelize[_0x6326('0x2')]},'remoteUri':{'type':Sequelize[_0x6326('0x2')],'unique':_0x6326('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 6a9a592..3113f73 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x445a=['keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','filter','merge','options','include','rows','catch','show','params','includeAll','create','body','update','find','getConfigurations','findOne','FreshsalesConfiguration','order','addConfiguration','AccountId','channel','type','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','%s%s','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','name','send','index','map','FreshsalesAccount','rawAttributes','key','model','query'];(function(_0x5a64eb,_0x286782){var _0x3ad930=function(_0x36a52f){while(--_0x36a52f){_0x5a64eb['push'](_0x5a64eb['shift']());}};_0x3ad930(++_0x286782);}(_0x445a,0x16a));var _0xa445=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x445a[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xa445('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa445('0x1'));var jsonpatch=require(_0xa445('0x2'));var rp=require(_0xa445('0x3'));var moment=require(_0xa445('0x4'));var BPromise=require(_0xa445('0x5'));var Mustache=require(_0xa445('0x6'));var util=require(_0xa445('0x7'));var path=require(_0xa445('0x8'));var sox=require(_0xa445('0x9'));var csv=require(_0xa445('0xa'));var ejs=require(_0xa445('0xb'));var fs=require('fs');var fs_extra=require(_0xa445('0xc'));var _=require('lodash');var squel=require(_0xa445('0xd'));var crypto=require('crypto');var jsforce=require(_0xa445('0xe'));var deskjs=require(_0xa445('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa445('0x10'));var Redis=require(_0xa445('0x11'));var authService=require(_0xa445('0x12'));var qs=require(_0xa445('0x13'));var as=require(_0xa445('0x14'));var hardwareService=require(_0xa445('0x15'));var logger=require(_0xa445('0x16'))('api');var utils=require(_0xa445('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa445('0x18'));var db=require(_0xa445('0x19'))['db'];var integrations=require(_0xa445('0x1a'));function respondWithStatusCode(_0x4edf34,_0xdfeb01){_0xdfeb01=_0xdfeb01||0xcc;return function(_0x56200a){if(_0x56200a){return _0x4edf34[_0xa445('0x1b')](_0xdfeb01);}return _0x4edf34[_0xa445('0x1c')](_0xdfeb01)['end']();};}function respondWithResult(_0xd597d6,_0x2aa852){_0x2aa852=_0x2aa852||0xc8;return function(_0x37077b){if(_0x37077b){return _0xd597d6['status'](_0x2aa852)[_0xa445('0x1d')](_0x37077b);}};}function respondWithFilteredResult(_0x4749c3,_0x7e4954){return function(_0x5da2d6){if(_0x5da2d6){var _0x39292f=typeof _0x7e4954[_0xa445('0x1e')]===_0xa445('0x1f')&&typeof _0x7e4954[_0xa445('0x20')]==='undefined';var _0x2bef52=_0x5da2d6['count'];var _0x796182=_0x39292f?0x0:_0x7e4954[_0xa445('0x1e')];var _0x1e12a3=_0x39292f?_0x5da2d6[_0xa445('0x21')]:_0x7e4954[_0xa445('0x1e')]+_0x7e4954[_0xa445('0x20')];var _0xf3a318;if(_0x1e12a3>=_0x2bef52){_0x1e12a3=_0x2bef52;_0xf3a318=0xc8;}else{_0xf3a318=0xce;}_0x4749c3[_0xa445('0x1c')](_0xf3a318);return _0x4749c3[_0xa445('0x22')](_0xa445('0x23'),_0x796182+'-'+_0x1e12a3+'/'+_0x2bef52)[_0xa445('0x1d')](_0x5da2d6);}return null;};}function patchUpdates(_0x5ccaf3){return function(_0x56732a){try{jsonpatch[_0xa445('0x24')](_0x56732a,_0x5ccaf3,!![]);}catch(_0x53efdb){return BPromise[_0xa445('0x25')](_0x53efdb);}return _0x56732a[_0xa445('0x26')]();};}function saveUpdates(_0x49515c,_0x289146){return function(_0x4f753d){if(_0x4f753d){return _0x4f753d['update'](_0x49515c)[_0xa445('0x27')](function(_0x1e1938){return _0x1e1938;});}return null;};}function removeEntity(_0x4d02aa,_0x26438c){return function(_0x4296f2){if(_0x4296f2){return _0x4296f2['destroy']()[_0xa445('0x27')](function(){_0x4d02aa[_0xa445('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c77d9,_0x1a0fa4){return function(_0x108712){if(!_0x108712){_0x4c77d9[_0xa445('0x1b')](0x194);}return _0x108712;};}function handleError(_0x439859,_0x3c9b99){_0x3c9b99=_0x3c9b99||0x1f4;return function(_0x1ecf1e){logger[_0xa445('0x28')](_0x1ecf1e['stack']);if(_0x1ecf1e[_0xa445('0x29')]){delete _0x1ecf1e['name'];}_0x439859[_0xa445('0x1c')](_0x3c9b99)[_0xa445('0x2a')](_0x1ecf1e);};}exports[_0xa445('0x2b')]=function(_0x9c7e5c,_0x468369){var _0xa1f438={},_0xe1e164={},_0x25f0a6={'count':0x0,'rows':[]};var _0x5465c5=_[_0xa445('0x2c')](db[_0xa445('0x2d')][_0xa445('0x2e')],function(_0x59409d){return{'name':_0x59409d['fieldName'],'type':_0x59409d['type'][_0xa445('0x2f')]};});_0xe1e164[_0xa445('0x30')]=_[_0xa445('0x2c')](_0x5465c5,'name');_0xe1e164[_0xa445('0x31')]=_[_0xa445('0x32')](_0x9c7e5c['query']);_0xe1e164['filters']=_[_0xa445('0x33')](_0xe1e164[_0xa445('0x30')],_0xe1e164['query']);_0xa1f438['attributes']=_['intersection'](_0xe1e164[_0xa445('0x30')],qs['fields'](_0x9c7e5c[_0xa445('0x31')][_0xa445('0x34')]));_0xa1f438[_0xa445('0x35')]=_0xa1f438[_0xa445('0x35')][_0xa445('0x36')]?_0xa1f438[_0xa445('0x35')]:_0xe1e164[_0xa445('0x30')];if(!_0x9c7e5c['query'][_0xa445('0x37')](_0xa445('0x38'))){_0xa1f438[_0xa445('0x20')]=qs[_0xa445('0x20')](_0x9c7e5c[_0xa445('0x31')]['limit']);_0xa1f438[_0xa445('0x1e')]=qs[_0xa445('0x1e')](_0x9c7e5c[_0xa445('0x31')]['offset']);}_0xa1f438['order']=qs[_0xa445('0x39')](_0x9c7e5c['query'][_0xa445('0x39')]);_0xa1f438['where']=qs[_0xa445('0x3a')](_[_0xa445('0x3b')](_0x9c7e5c['query'],_0xe1e164[_0xa445('0x3a')]),_0x5465c5);if(_0x9c7e5c['query']['filter']){_0xa1f438[_0xa445('0x3c')]=_['merge'](_0xa1f438[_0xa445('0x3c')],{'$or':_['map'](_0x5465c5,function(_0x5820cf){if(_0x5820cf['type']!=='VIRTUAL'){var _0x2683ba={};_0x2683ba[_0x5820cf['name']]={'$like':'%'+_0x9c7e5c[_0xa445('0x31')][_0xa445('0x3d')]+'%'};return _0x2683ba;}})});}_0xa1f438=_[_0xa445('0x3e')]({},_0xa1f438,_0x9c7e5c[_0xa445('0x3f')]);var _0x4bea0e={'where':_0xa1f438[_0xa445('0x3c')]};return db[_0xa445('0x2d')][_0xa445('0x21')](_0x4bea0e)['then'](function(_0x42f0ee){_0x25f0a6[_0xa445('0x21')]=_0x42f0ee;if(_0x9c7e5c['query']['includeAll']){_0xa1f438[_0xa445('0x40')]=[{'all':!![]}];}return db[_0xa445('0x2d')]['findAll'](_0xa1f438);})[_0xa445('0x27')](function(_0x4e8859){_0x25f0a6[_0xa445('0x41')]=_0x4e8859;return _0x25f0a6;})[_0xa445('0x27')](respondWithFilteredResult(_0x468369,_0xa1f438))[_0xa445('0x42')](handleError(_0x468369,null));};exports[_0xa445('0x43')]=function(_0x5de61a,_0xdaeacc){var _0x3ec310={'raw':![],'where':{'id':_0x5de61a[_0xa445('0x44')]['id']}},_0x287732={};_0x287732[_0xa445('0x30')]=_['keys'](db[_0xa445('0x2d')][_0xa445('0x2e')]);_0x287732[_0xa445('0x31')]=_[_0xa445('0x32')](_0x5de61a[_0xa445('0x31')]);_0x287732['filters']=_[_0xa445('0x33')](_0x287732[_0xa445('0x30')],_0x287732[_0xa445('0x31')]);_0x3ec310[_0xa445('0x35')]=_[_0xa445('0x33')](_0x287732['model'],qs[_0xa445('0x34')](_0x5de61a[_0xa445('0x31')]['fields']));_0x3ec310[_0xa445('0x35')]=_0x3ec310[_0xa445('0x35')][_0xa445('0x36')]?_0x3ec310[_0xa445('0x35')]:_0x287732[_0xa445('0x30')];if(_0x5de61a[_0xa445('0x31')][_0xa445('0x45')]){_0x3ec310[_0xa445('0x40')]=[{'all':!![]}];}_0x3ec310=_['merge']({},_0x3ec310,_0x5de61a['options']);return db[_0xa445('0x2d')]['find'](_0x3ec310)['then'](handleEntityNotFound(_0xdaeacc,null))[_0xa445('0x27')](respondWithResult(_0xdaeacc,null))['catch'](handleError(_0xdaeacc,null));};exports[_0xa445('0x46')]=function(_0x2c8ae3,_0x1bf419){return db[_0xa445('0x2d')]['create'](_0x2c8ae3[_0xa445('0x47')],{})[_0xa445('0x27')](respondWithResult(_0x1bf419,0xc9))[_0xa445('0x42')](handleError(_0x1bf419,null));};exports[_0xa445('0x48')]=function(_0x4662c8,_0x1522de){if(_0x4662c8[_0xa445('0x47')]['id']){delete _0x4662c8[_0xa445('0x47')]['id'];}return db[_0xa445('0x2d')]['find']({'where':{'id':_0x4662c8[_0xa445('0x44')]['id']}})['then'](handleEntityNotFound(_0x1522de,null))[_0xa445('0x27')](saveUpdates(_0x4662c8['body'],null))[_0xa445('0x27')](respondWithResult(_0x1522de,null))['catch'](handleError(_0x1522de,null));};exports['destroy']=function(_0x35c0fb,_0x573696){return db[_0xa445('0x2d')][_0xa445('0x49')]({'where':{'id':_0x35c0fb[_0xa445('0x44')]['id']}})[_0xa445('0x27')](handleEntityNotFound(_0x573696,null))['then'](removeEntity(_0x573696,null))[_0xa445('0x42')](handleError(_0x573696,null));};exports[_0xa445('0x4a')]=function(_0x3b596c,_0x3a10e7,_0x1b6aac){var _0x45f18e={};var _0x2fda7f={};var _0x3e0a12;var _0x5d416f;return db[_0xa445('0x2d')][_0xa445('0x4b')]({'where':{'id':_0x3b596c[_0xa445('0x44')]['id']}})[_0xa445('0x27')](handleEntityNotFound(_0x3a10e7,null))[_0xa445('0x27')](function(_0x29195b){if(_0x29195b){_0x3e0a12=_0x29195b;_0x2fda7f[_0xa445('0x30')]=_[_0xa445('0x32')](db[_0xa445('0x4c')][_0xa445('0x2e')]);_0x2fda7f[_0xa445('0x31')]=_[_0xa445('0x32')](_0x3b596c['query']);_0x2fda7f['filters']=_[_0xa445('0x33')](_0x2fda7f[_0xa445('0x30')],_0x2fda7f[_0xa445('0x31')]);_0x45f18e[_0xa445('0x35')]=_[_0xa445('0x33')](_0x2fda7f['model'],qs[_0xa445('0x34')](_0x3b596c[_0xa445('0x31')][_0xa445('0x34')]));_0x45f18e['attributes']=_0x45f18e[_0xa445('0x35')][_0xa445('0x36')]?_0x45f18e[_0xa445('0x35')]:_0x2fda7f['model'];_0x45f18e[_0xa445('0x4d')]=qs[_0xa445('0x39')](_0x3b596c[_0xa445('0x31')][_0xa445('0x39')]);_0x45f18e[_0xa445('0x3c')]=qs[_0xa445('0x3a')](_['pick'](_0x3b596c[_0xa445('0x31')],_0x2fda7f['filters']));if(_0x3b596c['query'][_0xa445('0x3d')]){_0x45f18e[_0xa445('0x3c')]=_[_0xa445('0x3e')](_0x45f18e['where'],{'$or':_[_0xa445('0x2c')](_0x45f18e[_0xa445('0x35')],function(_0x3f814b){var _0x5cfc9e={};_0x5cfc9e[_0x3f814b]={'$like':'%'+_0x3b596c['query'][_0xa445('0x3d')]+'%'};return _0x5cfc9e;})});}_0x45f18e=_[_0xa445('0x3e')]({},_0x45f18e,_0x3b596c[_0xa445('0x3f')]);return _0x3e0a12[_0xa445('0x4a')](_0x45f18e);}})['then'](function(_0x347a33){if(_0x347a33){_0x5d416f=_0x347a33[_0xa445('0x36')];if(!_0x3b596c[_0xa445('0x31')]['hasOwnProperty'](_0xa445('0x38'))){_0x45f18e[_0xa445('0x20')]=qs['limit'](_0x3b596c[_0xa445('0x31')][_0xa445('0x20')]);_0x45f18e[_0xa445('0x1e')]=qs[_0xa445('0x1e')](_0x3b596c[_0xa445('0x31')]['offset']);}return _0x3e0a12['getConfigurations'](_0x45f18e);}})[_0xa445('0x27')](function(_0x2af192){if(_0x2af192){return _0x2af192?{'count':_0x5d416f,'rows':_0x2af192}:null;}})[_0xa445('0x27')](respondWithResult(_0x3a10e7,null))[_0xa445('0x42')](handleError(_0x3a10e7,null));};exports[_0xa445('0x4e')]=function(_0x51c8ca,_0x1bc628,_0x574336){if(_0x51c8ca[_0xa445('0x47')]['id']){delete _0x51c8ca[_0xa445('0x47')]['id'];}return db[_0xa445('0x2d')][_0xa445('0x4b')]({'where':{'id':_0x51c8ca[_0xa445('0x44')]['id']}})[_0xa445('0x27')](handleEntityNotFound(_0x1bc628,null))[_0xa445('0x27')](function(_0x3983a8){if(_0x3983a8){_0x51c8ca[_0xa445('0x47')][_0xa445('0x4f')]=_0x3983a8['id'];_0x51c8ca[_0xa445('0x47')]['Subjects']=integrations['getSubjects'](_0x51c8ca[_0xa445('0x47')][_0xa445('0x50')],_0x51c8ca['body'][_0xa445('0x51')]);_0x51c8ca[_0xa445('0x47')]['Descriptions']=integrations[_0xa445('0x52')](_0x51c8ca[_0xa445('0x47')][_0xa445('0x50')],_0x51c8ca[_0xa445('0x47')][_0xa445('0x51')]);return db[_0xa445('0x4c')][_0xa445('0x46')](_0x51c8ca[_0xa445('0x47')],{'include':[{'model':db[_0xa445('0x53')],'as':_0xa445('0x54')},{'model':db[_0xa445('0x53')],'as':'Descriptions'}]});}return null;})[_0xa445('0x27')](respondWithResult(_0x1bc628,null))[_0xa445('0x42')](handleError(_0x1bc628,null));};exports[_0xa445('0x55')]=function(_0x38c47b,_0x57551d,_0x32cb52){var _0x15fab5='';var _0x3000ab='';return db[_0xa445('0x2d')][_0xa445('0x4b')]({'where':{'id':_0x38c47b[_0xa445('0x44')]['id']},'attributes':['id',_0xa445('0x56'),_0xa445('0x57'),'apiKey']})[_0xa445('0x27')](handleEntityNotFound(_0x57551d,null))[_0xa445('0x27')](function(_0x2e3e9e){if(_0x2e3e9e){_0x3000ab=_0x2e3e9e[_0xa445('0x56')];_0x15fab5=_0x2e3e9e[_0xa445('0x57')];var _0x4e5c1d=_0x2e3e9e[_0xa445('0x57')][_0xa445('0x58')](-0x1);if(_0x4e5c1d==='/'){_0x15fab5=_0x15fab5[_0xa445('0x59')](0x0,_0x15fab5[_0xa445('0x5a')](_0x4e5c1d));}return rp({'method':_0xa445('0x5b'),'uri':util['format'](_0xa445('0x5c'),_0x15fab5,'/api/selector/owners'),'headers':{'Authorization':_0xa445('0x5d')+_0x2e3e9e[_0xa445('0x5e')]},'json':!![]});}})['then'](function(_0x13e717){if(_0x13e717){var _0x207765=_0x13e717[_0xa445('0x5f')];var _0x35e235=![];var _0x2825c1=null;for(_0x2825c1=0x0;_0x2825c1<_0x207765[_0xa445('0x36')];_0x2825c1++){if(_0x207765[_0x2825c1][_0xa445('0x60')]===_0x3000ab){_0x35e235=!![];}}if(_0x35e235){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa445('0x61')});}}})[_0xa445('0x27')](respondWithResult(_0x57551d,null))[_0xa445('0x42')](function(_0x26e6b3){var _0x5c5662=_0x38c47b[_0xa445('0x31')][_0xa445('0x62')]?0x1f4:_0x26e6b3[_0xa445('0x63')]||0x1f4;logger[_0xa445('0x28')](_0xa445('0x64'),_0xa445('0x55'),_0x5c5662,JSON[_0xa445('0x65')](_0x26e6b3));delete _0x26e6b3['name'];if(_0x5c5662===0x191){_0x5c5662=0x190;}_0x57551d['status'](_0x5c5662)[_0xa445('0x2a')](_0x38c47b[_0xa445('0x31')]['test']?{'message':_0xa445('0x66'),'statusCode':_0x26e6b3['statusCode']}:_0x26e6b3);});}; \ No newline at end of file +var _0x3f2d=['find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Descriptions','getDescriptions','channel','FreshsalesField','Subjects','getFields','remoteUri','apiKey','slice','GET','format','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','FreshsalesAccount','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','catch','show','params','keys','rawAttributes'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x3f2d,0x13d));var _0xd3f2=function(_0x51491a,_0x8858df){_0x51491a=_0x51491a-0x0;var _0x3f2b9d=_0x3f2d[_0x51491a];return _0x3f2b9d;};'use strict';var emlformat=require(_0xd3f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3f2('0x1'));var jsonpatch=require(_0xd3f2('0x2'));var rp=require(_0xd3f2('0x3'));var moment=require(_0xd3f2('0x4'));var BPromise=require(_0xd3f2('0x5'));var Mustache=require(_0xd3f2('0x6'));var util=require('util');var path=require(_0xd3f2('0x7'));var sox=require(_0xd3f2('0x8'));var csv=require(_0xd3f2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd3f2('0xa'));var squel=require(_0xd3f2('0xb'));var crypto=require('crypto');var jsforce=require(_0xd3f2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd3f2('0x9'));var querystring=require('querystring');var Papa=require(_0xd3f2('0xd'));var Redis=require(_0xd3f2('0xe'));var authService=require(_0xd3f2('0xf'));var qs=require(_0xd3f2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd3f2('0x11'));var logger=require(_0xd3f2('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd3f2('0x13'));var licenseUtil=require(_0xd3f2('0x14'));var db=require(_0xd3f2('0x15'))['db'];var integrations=require(_0xd3f2('0x16'));function respondWithStatusCode(_0x23d7b5,_0xd43697){_0xd43697=_0xd43697||0xcc;return function(_0x36702c){if(_0x36702c){return _0x23d7b5['sendStatus'](_0xd43697);}return _0x23d7b5[_0xd3f2('0x17')](_0xd43697)[_0xd3f2('0x18')]();};}function respondWithResult(_0x2d2152,_0x545676){_0x545676=_0x545676||0xc8;return function(_0xfa0405){if(_0xfa0405){return _0x2d2152['status'](_0x545676)['json'](_0xfa0405);}};}function respondWithFilteredResult(_0x55743c,_0x32bc26){return function(_0x4d5913){if(_0x4d5913){var _0x1eb58f=typeof _0x32bc26['offset']===_0xd3f2('0x19')&&typeof _0x32bc26['limit']===_0xd3f2('0x19');var _0x12bd79=_0x4d5913[_0xd3f2('0x1a')];var _0x580018=_0x1eb58f?0x0:_0x32bc26[_0xd3f2('0x1b')];var _0x5e7c6f=_0x1eb58f?_0x4d5913[_0xd3f2('0x1a')]:_0x32bc26[_0xd3f2('0x1b')]+_0x32bc26[_0xd3f2('0x1c')];var _0x587ec3;if(_0x5e7c6f>=_0x12bd79){_0x5e7c6f=_0x12bd79;_0x587ec3=0xc8;}else{_0x587ec3=0xce;}_0x55743c[_0xd3f2('0x17')](_0x587ec3);return _0x55743c[_0xd3f2('0x1d')]('Content-Range',_0x580018+'-'+_0x5e7c6f+'/'+_0x12bd79)['json'](_0x4d5913);}return null;};}function patchUpdates(_0x30a284){return function(_0x486807){try{jsonpatch[_0xd3f2('0x1e')](_0x486807,_0x30a284,!![]);}catch(_0x38a267){return BPromise[_0xd3f2('0x1f')](_0x38a267);}return _0x486807[_0xd3f2('0x20')]();};}function saveUpdates(_0x59c016,_0x1add23){return function(_0x216456){if(_0x216456){return _0x216456[_0xd3f2('0x21')](_0x59c016)[_0xd3f2('0x22')](function(_0x3d8166){return _0x3d8166;});}return null;};}function removeEntity(_0x3b2a22,_0x1e08d4){return function(_0x5402c2){if(_0x5402c2){return _0x5402c2[_0xd3f2('0x23')]()[_0xd3f2('0x22')](function(){_0x3b2a22['status'](0xcc)[_0xd3f2('0x18')]();});}};}function handleEntityNotFound(_0x350cf2,_0xb964b3){return function(_0x4aef17){if(!_0x4aef17){_0x350cf2[_0xd3f2('0x24')](0x194);}return _0x4aef17;};}function handleError(_0x42350f,_0x2d5e22){_0x2d5e22=_0x2d5e22||0x1f4;return function(_0x13ad5e){logger[_0xd3f2('0x25')](_0x13ad5e['stack']);if(_0x13ad5e[_0xd3f2('0x26')]){delete _0x13ad5e['name'];}_0x42350f[_0xd3f2('0x17')](_0x2d5e22)['send'](_0x13ad5e);};}exports[_0xd3f2('0x27')]=function(_0x42d945,_0x4cedfc){var _0x54ecbf={},_0x2659f7={},_0x320745={'count':0x0,'rows':[]};var _0x116380=_[_0xd3f2('0x28')](db[_0xd3f2('0x29')]['rawAttributes'],function(_0x75d0dc){return{'name':_0x75d0dc['fieldName'],'type':_0x75d0dc[_0xd3f2('0x2a')][_0xd3f2('0x2b')]};});_0x2659f7['model']=_['map'](_0x116380,'name');_0x2659f7[_0xd3f2('0x2c')]=_['keys'](_0x42d945[_0xd3f2('0x2c')]);_0x2659f7['filters']=_[_0xd3f2('0x2d')](_0x2659f7[_0xd3f2('0x2e')],_0x2659f7[_0xd3f2('0x2c')]);_0x54ecbf['attributes']=_['intersection'](_0x2659f7[_0xd3f2('0x2e')],qs[_0xd3f2('0x2f')](_0x42d945['query'][_0xd3f2('0x2f')]));_0x54ecbf[_0xd3f2('0x30')]=_0x54ecbf[_0xd3f2('0x30')][_0xd3f2('0x31')]?_0x54ecbf[_0xd3f2('0x30')]:_0x2659f7[_0xd3f2('0x2e')];if(!_0x42d945[_0xd3f2('0x2c')][_0xd3f2('0x32')](_0xd3f2('0x33'))){_0x54ecbf['limit']=qs[_0xd3f2('0x1c')](_0x42d945[_0xd3f2('0x2c')][_0xd3f2('0x1c')]);_0x54ecbf[_0xd3f2('0x1b')]=qs[_0xd3f2('0x1b')](_0x42d945[_0xd3f2('0x2c')][_0xd3f2('0x1b')]);}_0x54ecbf[_0xd3f2('0x34')]=qs[_0xd3f2('0x35')](_0x42d945['query'][_0xd3f2('0x35')]);_0x54ecbf[_0xd3f2('0x36')]=qs['filters'](_[_0xd3f2('0x37')](_0x42d945[_0xd3f2('0x2c')],_0x2659f7[_0xd3f2('0x38')]),_0x116380);if(_0x42d945['query'][_0xd3f2('0x39')]){_0x54ecbf[_0xd3f2('0x36')]=_[_0xd3f2('0x3a')](_0x54ecbf[_0xd3f2('0x36')],{'$or':_[_0xd3f2('0x28')](_0x116380,function(_0x437dcb){if(_0x437dcb[_0xd3f2('0x2a')]!=='VIRTUAL'){var _0x5803b2={};_0x5803b2[_0x437dcb[_0xd3f2('0x26')]]={'$like':'%'+_0x42d945[_0xd3f2('0x2c')][_0xd3f2('0x39')]+'%'};return _0x5803b2;}})});}_0x54ecbf=_[_0xd3f2('0x3a')]({},_0x54ecbf,_0x42d945[_0xd3f2('0x3b')]);var _0x4d14d9={'where':_0x54ecbf['where']};return db[_0xd3f2('0x29')][_0xd3f2('0x1a')](_0x4d14d9)['then'](function(_0x4bc92a){_0x320745[_0xd3f2('0x1a')]=_0x4bc92a;if(_0x42d945['query'][_0xd3f2('0x3c')]){_0x54ecbf[_0xd3f2('0x3d')]=[{'all':!![]}];}return db[_0xd3f2('0x29')]['findAll'](_0x54ecbf);})[_0xd3f2('0x22')](function(_0x235cc4){_0x320745['rows']=_0x235cc4;return _0x320745;})[_0xd3f2('0x22')](respondWithFilteredResult(_0x4cedfc,_0x54ecbf))[_0xd3f2('0x3e')](handleError(_0x4cedfc,null));};exports[_0xd3f2('0x3f')]=function(_0x2abd83,_0xe56a6){var _0x31f91e={'raw':![],'where':{'id':_0x2abd83[_0xd3f2('0x40')]['id']}},_0x55a0ab={};_0x55a0ab[_0xd3f2('0x2e')]=_[_0xd3f2('0x41')](db[_0xd3f2('0x29')][_0xd3f2('0x42')]);_0x55a0ab[_0xd3f2('0x2c')]=_[_0xd3f2('0x41')](_0x2abd83[_0xd3f2('0x2c')]);_0x55a0ab[_0xd3f2('0x38')]=_[_0xd3f2('0x2d')](_0x55a0ab[_0xd3f2('0x2e')],_0x55a0ab[_0xd3f2('0x2c')]);_0x31f91e[_0xd3f2('0x30')]=_['intersection'](_0x55a0ab[_0xd3f2('0x2e')],qs['fields'](_0x2abd83[_0xd3f2('0x2c')][_0xd3f2('0x2f')]));_0x31f91e['attributes']=_0x31f91e[_0xd3f2('0x30')]['length']?_0x31f91e[_0xd3f2('0x30')]:_0x55a0ab['model'];if(_0x2abd83[_0xd3f2('0x2c')][_0xd3f2('0x3c')]){_0x31f91e[_0xd3f2('0x3d')]=[{'all':!![]}];}_0x31f91e=_[_0xd3f2('0x3a')]({},_0x31f91e,_0x2abd83[_0xd3f2('0x3b')]);return db[_0xd3f2('0x29')][_0xd3f2('0x43')](_0x31f91e)['then'](handleEntityNotFound(_0xe56a6,null))[_0xd3f2('0x22')](respondWithResult(_0xe56a6,null))[_0xd3f2('0x3e')](handleError(_0xe56a6,null));};exports[_0xd3f2('0x44')]=function(_0x286ccd,_0x378efb){return db['FreshsalesAccount'][_0xd3f2('0x44')](_0x286ccd[_0xd3f2('0x45')],{})[_0xd3f2('0x22')](respondWithResult(_0x378efb,0xc9))[_0xd3f2('0x3e')](handleError(_0x378efb,null));};exports[_0xd3f2('0x21')]=function(_0x484473,_0x41af6a){if(_0x484473[_0xd3f2('0x45')]['id']){delete _0x484473['body']['id'];}return db['FreshsalesAccount'][_0xd3f2('0x43')]({'where':{'id':_0x484473[_0xd3f2('0x40')]['id']}})['then'](handleEntityNotFound(_0x41af6a,null))['then'](saveUpdates(_0x484473[_0xd3f2('0x45')],null))[_0xd3f2('0x22')](respondWithResult(_0x41af6a,null))[_0xd3f2('0x3e')](handleError(_0x41af6a,null));};exports['destroy']=function(_0x52e09e,_0x5f3b81){return db[_0xd3f2('0x29')][_0xd3f2('0x43')]({'where':{'id':_0x52e09e[_0xd3f2('0x40')]['id']}})['then'](handleEntityNotFound(_0x5f3b81,null))[_0xd3f2('0x22')](removeEntity(_0x5f3b81,null))['catch'](handleError(_0x5f3b81,null));};exports[_0xd3f2('0x46')]=function(_0x5ad446,_0xc20544,_0x59e9be){var _0x52f5f7={};var _0x5d498f={};var _0x481b53;var _0x184f79;return db[_0xd3f2('0x29')][_0xd3f2('0x47')]({'where':{'id':_0x5ad446[_0xd3f2('0x40')]['id']}})[_0xd3f2('0x22')](handleEntityNotFound(_0xc20544,null))[_0xd3f2('0x22')](function(_0x1a4b8c){if(_0x1a4b8c){_0x481b53=_0x1a4b8c;_0x5d498f[_0xd3f2('0x2e')]=_[_0xd3f2('0x41')](db[_0xd3f2('0x48')]['rawAttributes']);_0x5d498f['query']=_[_0xd3f2('0x41')](_0x5ad446[_0xd3f2('0x2c')]);_0x5d498f[_0xd3f2('0x38')]=_[_0xd3f2('0x2d')](_0x5d498f[_0xd3f2('0x2e')],_0x5d498f['query']);_0x52f5f7[_0xd3f2('0x30')]=_[_0xd3f2('0x2d')](_0x5d498f[_0xd3f2('0x2e')],qs[_0xd3f2('0x2f')](_0x5ad446[_0xd3f2('0x2c')][_0xd3f2('0x2f')]));_0x52f5f7[_0xd3f2('0x30')]=_0x52f5f7[_0xd3f2('0x30')][_0xd3f2('0x31')]?_0x52f5f7[_0xd3f2('0x30')]:_0x5d498f[_0xd3f2('0x2e')];_0x52f5f7[_0xd3f2('0x34')]=qs[_0xd3f2('0x35')](_0x5ad446[_0xd3f2('0x2c')][_0xd3f2('0x35')]);_0x52f5f7['where']=qs[_0xd3f2('0x38')](_['pick'](_0x5ad446[_0xd3f2('0x2c')],_0x5d498f[_0xd3f2('0x38')]));if(_0x5ad446['query'][_0xd3f2('0x39')]){_0x52f5f7[_0xd3f2('0x36')]=_[_0xd3f2('0x3a')](_0x52f5f7[_0xd3f2('0x36')],{'$or':_[_0xd3f2('0x28')](_0x52f5f7['attributes'],function(_0x4ec354){var _0x1def61={};_0x1def61[_0x4ec354]={'$like':'%'+_0x5ad446[_0xd3f2('0x2c')][_0xd3f2('0x39')]+'%'};return _0x1def61;})});}_0x52f5f7=_['merge']({},_0x52f5f7,_0x5ad446[_0xd3f2('0x3b')]);return _0x481b53[_0xd3f2('0x46')](_0x52f5f7);}})['then'](function(_0x18e49a){if(_0x18e49a){_0x184f79=_0x18e49a[_0xd3f2('0x31')];if(!_0x5ad446[_0xd3f2('0x2c')]['hasOwnProperty'](_0xd3f2('0x33'))){_0x52f5f7[_0xd3f2('0x1c')]=qs[_0xd3f2('0x1c')](_0x5ad446[_0xd3f2('0x2c')][_0xd3f2('0x1c')]);_0x52f5f7[_0xd3f2('0x1b')]=qs[_0xd3f2('0x1b')](_0x5ad446[_0xd3f2('0x2c')][_0xd3f2('0x1b')]);}return _0x481b53[_0xd3f2('0x46')](_0x52f5f7);}})['then'](function(_0x2a8482){if(_0x2a8482){return _0x2a8482?{'count':_0x184f79,'rows':_0x2a8482}:null;}})['then'](respondWithResult(_0xc20544,null))[_0xd3f2('0x3e')](handleError(_0xc20544,null));};exports[_0xd3f2('0x49')]=function(_0xaace16,_0x17918a,_0x577093){if(_0xaace16[_0xd3f2('0x45')]['id']){delete _0xaace16[_0xd3f2('0x45')]['id'];}return db[_0xd3f2('0x29')][_0xd3f2('0x47')]({'where':{'id':_0xaace16[_0xd3f2('0x40')]['id']}})[_0xd3f2('0x22')](handleEntityNotFound(_0x17918a,null))[_0xd3f2('0x22')](function(_0x44a308){if(_0x44a308){_0xaace16[_0xd3f2('0x45')][_0xd3f2('0x4a')]=_0x44a308['id'];_0xaace16[_0xd3f2('0x45')]['Subjects']=integrations['getSubjects'](_0xaace16[_0xd3f2('0x45')]['channel'],_0xaace16[_0xd3f2('0x45')]['type']);_0xaace16[_0xd3f2('0x45')][_0xd3f2('0x4b')]=integrations[_0xd3f2('0x4c')](_0xaace16[_0xd3f2('0x45')][_0xd3f2('0x4d')],_0xaace16[_0xd3f2('0x45')][_0xd3f2('0x2a')]);return db[_0xd3f2('0x48')]['create'](_0xaace16['body'],{'include':[{'model':db[_0xd3f2('0x4e')],'as':_0xd3f2('0x4f')},{'model':db[_0xd3f2('0x4e')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x17918a,null))['catch'](handleError(_0x17918a,null));};exports[_0xd3f2('0x50')]=function(_0x39f1f0,_0x1b7d47,_0x591468){var _0x5a6ec8='';var _0x3037c2='';return db[_0xd3f2('0x29')][_0xd3f2('0x47')]({'where':{'id':_0x39f1f0[_0xd3f2('0x40')]['id']},'attributes':['id','username',_0xd3f2('0x51'),_0xd3f2('0x52')]})['then'](handleEntityNotFound(_0x1b7d47,null))['then'](function(_0x104004){if(_0x104004){_0x3037c2=_0x104004['username'];_0x5a6ec8=_0x104004['remoteUri'];var _0x47120d=_0x104004[_0xd3f2('0x51')][_0xd3f2('0x53')](-0x1);if(_0x47120d==='/'){_0x5a6ec8=_0x5a6ec8['substring'](0x0,_0x5a6ec8['lastIndexOf'](_0x47120d));}return rp({'method':_0xd3f2('0x54'),'uri':util[_0xd3f2('0x55')](_0xd3f2('0x56'),_0x5a6ec8,_0xd3f2('0x57')),'headers':{'Authorization':_0xd3f2('0x58')+_0x104004[_0xd3f2('0x52')]},'json':!![]});}})[_0xd3f2('0x22')](function(_0x275ae8){if(_0x275ae8){var _0x1802d7=_0x275ae8['users'];var _0x4fd6b2=![];var _0xc7c82d=null;for(_0xc7c82d=0x0;_0xc7c82d<_0x1802d7['length'];_0xc7c82d++){if(_0x1802d7[_0xc7c82d][_0xd3f2('0x59')]===_0x3037c2){_0x4fd6b2=!![];}}if(_0x4fd6b2){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd3f2('0x5a')});}}})[_0xd3f2('0x22')](respondWithResult(_0x1b7d47,null))[_0xd3f2('0x3e')](function(_0x2ee742){var _0x6e2ed1=_0x39f1f0['query'][_0xd3f2('0x5b')]?0x1f4:_0x2ee742[_0xd3f2('0x5c')]||0x1f4;logger[_0xd3f2('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x6e2ed1,JSON[_0xd3f2('0x5d')](_0x2ee742));delete _0x2ee742['name'];if(_0x6e2ed1===0x191){_0x6e2ed1=0x190;}_0x1b7d47[_0xd3f2('0x17')](_0x6e2ed1)[_0xd3f2('0x5e')](_0x39f1f0[_0xd3f2('0x2c')][_0xd3f2('0x5b')]?{'message':_0xd3f2('0x5f'),'statusCode':_0x2ee742[_0xd3f2('0x5c')]}:_0x2ee742);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 8e4af87..f113a47 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71ab=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','bluebird','request-promise'];(function(_0x59372a,_0x23e75b){var _0x17fce9=function(_0x5e2e32){while(--_0x5e2e32){_0x59372a['push'](_0x59372a['shift']());}};_0x17fce9(++_0x23e75b);}(_0x71ab,0x64));var _0xb71a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x71ab[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6b0=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x26b3a4,_0x5204f3){var _0x5065e3=function(_0x4752f5){while(--_0x4752f5){_0x26b3a4['push'](_0x26b3a4['shift']());}};_0x5065e3(++_0x5204f3);}(_0xa6b0,0xaf));var _0x0a6b=function(_0xec6943,_0x114150){_0xec6943=_0xec6943-0x0;var _0x549ad9=_0xa6b0[_0xec6943];return _0x549ad9;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));var integrations=require(_0x0a6b('0x8'));module[_0x0a6b('0x9')]=function(_0x3b6967,_0x1b5fb5){return _0x3b6967[_0x0a6b('0xa')](_0x0a6b('0xb'),attributes,{'tableName':_0x0a6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 051b4f0..30cb7ff 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FreshsalesAccount,\x20%s,\x20%s','message','catch','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFreshsalesAccount','debug','stringify','ShowFreshsalesAccount','find','lodash'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x66fa,0x117));var _0xa66f=function(_0x520028,_0x32374d){_0x520028=_0x520028-0x0;var _0x1a1bfa=_0x66fa[_0x520028];return _0x1a1bfa;};'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')]('FreshsalesAccount,\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')]('FreshsalesAccount,\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);});});}exports['GetFreshsalesAccount']=function(_0x1cbe64){var _0x55b59d=this;return new Promise(function(_0x4a28d4,_0x2f9da2){return db[_0xa66f('0x14')][_0xa66f('0x15')]({'raw':_0x1cbe64[_0xa66f('0x16')]?_0x1cbe64[_0xa66f('0x16')][_0xa66f('0x17')]===undefined?!![]:![]:!![],'where':_0x1cbe64[_0xa66f('0x16')]?_0x1cbe64[_0xa66f('0x16')][_0xa66f('0x18')]||null:null,'attributes':_0x1cbe64[_0xa66f('0x16')]?_0x1cbe64[_0xa66f('0x16')][_0xa66f('0x19')]||null:null,'limit':_0x1cbe64[_0xa66f('0x16')]?_0x1cbe64[_0xa66f('0x16')][_0xa66f('0x1a')]||null:null,'include':_0x1cbe64['options']?_0x1cbe64[_0xa66f('0x16')][_0xa66f('0x1b')]?_[_0xa66f('0x1c')](_0x1cbe64[_0xa66f('0x16')]['include'],function(_0x337602){return{'model':db[_0x337602[_0xa66f('0x1d')]],'as':_0x337602['as'],'attributes':_0x337602[_0xa66f('0x19')],'include':_0x337602[_0xa66f('0x1b')]?_['map'](_0x337602['include'],function(_0xed98b9){return{'model':db[_0xed98b9['model']],'as':_0xed98b9['as'],'attributes':_0xed98b9[_0xa66f('0x19')],'include':_0xed98b9[_0xa66f('0x1b')]?_[_0xa66f('0x1c')](_0xed98b9['include'],function(_0x4683c7){return{'model':db[_0x4683c7[_0xa66f('0x1d')]],'as':_0x4683c7['as'],'attributes':_0x4683c7[_0xa66f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa66f('0xb')](function(_0x17c103){logger[_0xa66f('0xc')](_0xa66f('0x1e'),_0x1cbe64);logger[_0xa66f('0x1f')](_0xa66f('0x1e'),_0x1cbe64,JSON[_0xa66f('0x20')](_0x17c103));_0x4a28d4(_0x17c103);})[_0xa66f('0x13')](function(_0x63650b){logger[_0xa66f('0xf')](_0xa66f('0x1e'),_0x63650b['message'],_0x1cbe64);_0x2f9da2(_0x55b59d['error'](0x1f4,_0x63650b[_0xa66f('0x12')]));});});};exports[_0xa66f('0x21')]=function(_0x55f309){var _0x44c79a=this;return new Promise(function(_0x2de5f3,_0x4cd7f2){return db[_0xa66f('0x14')][_0xa66f('0x22')]({'raw':_0x55f309[_0xa66f('0x16')]?_0x55f309[_0xa66f('0x16')][_0xa66f('0x17')]===undefined?!![]:![]:!![],'where':_0x55f309['options']?_0x55f309[_0xa66f('0x16')]['where']||null:null,'attributes':_0x55f309[_0xa66f('0x16')]?_0x55f309[_0xa66f('0x16')][_0xa66f('0x19')]||null:null,'include':_0x55f309['options']?_0x55f309[_0xa66f('0x16')][_0xa66f('0x1b')]?_['map'](_0x55f309[_0xa66f('0x16')][_0xa66f('0x1b')],function(_0xba9457){return{'model':db[_0xba9457[_0xa66f('0x1d')]],'as':_0xba9457['as'],'attributes':_0xba9457[_0xa66f('0x19')],'include':_0xba9457[_0xa66f('0x1b')]?_[_0xa66f('0x1c')](_0xba9457[_0xa66f('0x1b')],function(_0x35ef27){return{'model':db[_0x35ef27[_0xa66f('0x1d')]],'as':_0x35ef27['as'],'attributes':_0x35ef27['attributes'],'include':_0x35ef27[_0xa66f('0x1b')]?_['map'](_0x35ef27[_0xa66f('0x1b')],function(_0x46f6cc){return{'model':db[_0x46f6cc[_0xa66f('0x1d')]],'as':_0x46f6cc['as'],'attributes':_0x46f6cc[_0xa66f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa66f('0xb')](function(_0x201432){logger[_0xa66f('0xc')](_0xa66f('0x21'),_0x55f309);logger['debug'](_0xa66f('0x21'),_0x55f309,JSON['stringify'](_0x201432));_0x2de5f3(_0x201432);})[_0xa66f('0x13')](function(_0x45eeb8){logger[_0xa66f('0xf')]('ShowFreshsalesAccount',_0x45eeb8['message'],_0x55f309);_0x4cd7f2(_0x44c79a[_0xa66f('0xf')](0x1f4,_0x45eeb8[_0xa66f('0x12')]));});});}; \ No newline at end of file +var _0x77e6=['result','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include','model','map','GetFreshsalesAccount','ShowFreshsalesAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message'];(function(_0xf1dbd8,_0x1cb2e1){var _0x5ee4be=function(_0x2b8af1){while(--_0x2b8af1){_0xf1dbd8['push'](_0xf1dbd8['shift']());}};_0x5ee4be(++_0x1cb2e1);}(_0x77e6,0x1a6));var _0x677e=function(_0x522bf5,_0x547d2c){_0x522bf5=_0x522bf5-0x0;var _0x42a7b6=_0x77e6[_0x522bf5];return _0x42a7b6;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});}exports['GetFreshsalesAccount']=function(_0x1c5124){var _0x2ef2bf=this;return new Promise(function(_0x385b06,_0x221b6d){return db[_0x677e('0x18')][_0x677e('0x19')]({'raw':_0x1c5124['options']?_0x1c5124[_0x677e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1b')]||null:null,'attributes':_0x1c5124['options']?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1c')]||null:null,'limit':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1d')]||null:null,'include':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')]['include']?_['map'](_0x1c5124['options'][_0x677e('0x1e')],function(_0x154fce){return{'model':db[_0x154fce[_0x677e('0x1f')]],'as':_0x154fce['as'],'attributes':_0x154fce[_0x677e('0x1c')],'include':_0x154fce[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x154fce[_0x677e('0x1e')],function(_0x42f2b8){return{'model':db[_0x42f2b8[_0x677e('0x1f')]],'as':_0x42f2b8['as'],'attributes':_0x42f2b8[_0x677e('0x1c')],'include':_0x42f2b8['include']?_['map'](_0x42f2b8[_0x677e('0x1e')],function(_0x184f68){return{'model':db[_0x184f68['model']],'as':_0x184f68['as'],'attributes':_0x184f68[_0x677e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x677e('0xc')](function(_0xf6b3ad){logger[_0x677e('0xd')](_0x677e('0x21'),_0x1c5124);logger[_0x677e('0xf')]('GetFreshsalesAccount',_0x1c5124,JSON[_0x677e('0x11')](_0xf6b3ad));_0x385b06(_0xf6b3ad);})[_0x677e('0x17')](function(_0xeca8e2){logger[_0x677e('0x12')](_0x677e('0x21'),_0xeca8e2[_0x677e('0x15')],_0x1c5124);_0x221b6d(_0x2ef2bf[_0x677e('0x12')](0x1f4,_0xeca8e2[_0x677e('0x15')]));});});};exports[_0x677e('0x22')]=function(_0x4c5113){var _0x22ccfb=this;return new Promise(function(_0x3cac19,_0x2fb815){return db[_0x677e('0x18')][_0x677e('0x23')]({'raw':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x24')]===undefined?!![]:![]:!![],'where':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')]['where']||null:null,'attributes':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x1c')]||null:null,'include':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x1e')]?_['map'](_0x4c5113[_0x677e('0x1a')][_0x677e('0x1e')],function(_0x2d0bc0){return{'model':db[_0x2d0bc0['model']],'as':_0x2d0bc0['as'],'attributes':_0x2d0bc0[_0x677e('0x1c')],'include':_0x2d0bc0[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x2d0bc0[_0x677e('0x1e')],function(_0x35c945){return{'model':db[_0x35c945['model']],'as':_0x35c945['as'],'attributes':_0x35c945[_0x677e('0x1c')],'include':_0x35c945[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x35c945[_0x677e('0x1e')],function(_0x548b22){return{'model':db[_0x548b22[_0x677e('0x1f')]],'as':_0x548b22['as'],'attributes':_0x548b22[_0x677e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x677e('0xc')](function(_0x576443){logger['info'](_0x677e('0x22'),_0x4c5113);logger[_0x677e('0xf')]('ShowFreshsalesAccount',_0x4c5113,JSON[_0x677e('0x11')](_0x576443));_0x3cac19(_0x576443);})[_0x677e('0x17')](function(_0x497dca){logger['error'](_0x677e('0x22'),_0x497dca[_0x677e('0x15')],_0x4c5113);_0x2fb815(_0x22ccfb['error'](0x1f4,_0x497dca['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index ca1e129..b6e25fb 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf291=['/:id/fields','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','index','get','/:id','/:id/subjects','isAuthenticated','getSubjects','getDescriptions'];(function(_0x3bb6da,_0x4cce40){var _0x50ae77=function(_0x19716f){while(--_0x19716f){_0x3bb6da['push'](_0x3bb6da['shift']());}};_0x50ae77(++_0x4cce40);}(_0xf291,0x139));var _0x1f29=function(_0x1c41a8,_0xb0f0c){_0x1c41a8=_0x1c41a8-0x0;var _0x27e854=_0xf291[_0x1c41a8];return _0x27e854;};'use strict';var multer=require(_0x1f29('0x0'));var util=require(_0x1f29('0x1'));var path=require(_0x1f29('0x2'));var timeout=require(_0x1f29('0x3'));var express=require(_0x1f29('0x4'));var router=express[_0x1f29('0x5')]();var fs_extra=require(_0x1f29('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1f29('0x7'));var config=require(_0x1f29('0x8'));var controller=require(_0x1f29('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1f29('0xa')]);router[_0x1f29('0xb')](_0x1f29('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1f29('0xb')](_0x1f29('0xd'),auth[_0x1f29('0xe')](),controller[_0x1f29('0xf')]);router[_0x1f29('0xb')]('/:id/descriptions',auth[_0x1f29('0xe')](),controller[_0x1f29('0x10')]);router[_0x1f29('0xb')](_0x1f29('0x11'),auth[_0x1f29('0xe')](),controller['getFields']);router['post']('/',auth[_0x1f29('0xe')](),controller[_0x1f29('0x12')]);router[_0x1f29('0x13')](_0x1f29('0xc'),auth[_0x1f29('0xe')](),controller['update']);router[_0x1f29('0x14')](_0x1f29('0xc'),auth[_0x1f29('0xe')](),controller['destroy']);module[_0x1f29('0x15')]=router; \ No newline at end of file +var _0xafe8=['post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/descriptions','getDescriptions','/:id/fields'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xafe8,0x1ea));var _0x8afe=function(_0x22d655,_0x3941dd){_0x22d655=_0x22d655-0x0;var _0x257739=_0xafe8[_0x22d655];return _0x257739;};'use strict';var multer=require(_0x8afe('0x0'));var util=require('util');var path=require(_0x8afe('0x1'));var timeout=require(_0x8afe('0x2'));var express=require(_0x8afe('0x3'));var router=express[_0x8afe('0x4')]();var fs_extra=require(_0x8afe('0x5'));var auth=require(_0x8afe('0x6'));var interaction=require(_0x8afe('0x7'));var config=require(_0x8afe('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x8afe('0x9')]('/',auth[_0x8afe('0xa')](),controller[_0x8afe('0xb')]);router[_0x8afe('0x9')](_0x8afe('0xc'),auth[_0x8afe('0xa')](),controller['show']);router['get']('/:id/subjects',auth[_0x8afe('0xa')](),controller['getSubjects']);router['get'](_0x8afe('0xd'),auth[_0x8afe('0xa')](),controller[_0x8afe('0xe')]);router['get'](_0x8afe('0xf'),auth[_0x8afe('0xa')](),controller['getFields']);router[_0x8afe('0x10')]('/',auth[_0x8afe('0xa')](),controller[_0x8afe('0x11')]);router[_0x8afe('0x12')](_0x8afe('0xc'),auth['isAuthenticated'](),controller[_0x8afe('0x13')]);router['delete'](_0x8afe('0xc'),auth[_0x8afe('0xa')](),controller[_0x8afe('0x14')]);module[_0x8afe('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 1bf2614..485c55f 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0337=['sequelize','exports','STRING'];(function(_0x48e1a2,_0x3a5001){var _0x3f24c6=function(_0x2fb653){while(--_0x2fb653){_0x48e1a2['push'](_0x48e1a2['shift']());}};_0x3f24c6(++_0x3a5001);}(_0x0337,0x111));var _0x7033=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x0337[_0x5756f8];return _0x3bb749;};'use strict';var Sequelize=require(_0x7033('0x0'));module[_0x7033('0x1')]={'name':{'type':Sequelize[_0x7033('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2273=['exports','STRING'];(function(_0xd1f014,_0x31a6dd){var _0x25afd1=function(_0x374671){while(--_0x374671){_0xd1f014['push'](_0xd1f014['shift']());}};_0x25afd1(++_0x31a6dd);}(_0x2273,0x19c));var _0x3227=function(_0x27cb88,_0x171b12){_0x27cb88=_0x27cb88-0x0;var _0x46b4ce=_0x2273[_0x27cb88];return _0x46b4ce;};'use strict';var Sequelize=require('sequelize');module[_0x3227('0x0')]={'name':{'type':Sequelize[_0x3227('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 34e3b17..7506c2f 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdea5=['then','destroy','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','getSubjects','FreshsalesField','pick','getDescriptions','findOne','getFields','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update'];(function(_0x3c2b2b,_0x5250d9){var _0x1484f5=function(_0x6c9957){while(--_0x6c9957){_0x3c2b2b['push'](_0x3c2b2b['shift']());}};_0x1484f5(++_0x5250d9);}(_0xdea5,0x1b6));var _0x5dea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdea5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dea('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5dea('0x1'));var rp=require(_0x5dea('0x2'));var moment=require(_0x5dea('0x3'));var BPromise=require(_0x5dea('0x4'));var Mustache=require('mustache');var util=require(_0x5dea('0x5'));var path=require('path');var sox=require(_0x5dea('0x6'));var csv=require(_0x5dea('0x7'));var ejs=require(_0x5dea('0x8'));var fs=require('fs');var fs_extra=require(_0x5dea('0x9'));var _=require(_0x5dea('0xa'));var squel=require(_0x5dea('0xb'));var crypto=require(_0x5dea('0xc'));var jsforce=require(_0x5dea('0xd'));var deskjs=require(_0x5dea('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dea('0xf'));var Papa=require('papaparse');var Redis=require(_0x5dea('0x10'));var authService=require(_0x5dea('0x11'));var qs=require(_0x5dea('0x12'));var as=require(_0x5dea('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5dea('0x14'))(_0x5dea('0x15'));var utils=require('../../config/utils');var config=require(_0x5dea('0x16'));var licenseUtil=require(_0x5dea('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa9bb9,_0x31ae2b){_0x31ae2b=_0x31ae2b||0xcc;return function(_0x203816){if(_0x203816){return _0xa9bb9[_0x5dea('0x18')](_0x31ae2b);}return _0xa9bb9[_0x5dea('0x19')](_0x31ae2b)[_0x5dea('0x1a')]();};}function respondWithResult(_0x405e23,_0x399423){_0x399423=_0x399423||0xc8;return function(_0x45ba5c){if(_0x45ba5c){return _0x405e23['status'](_0x399423)['json'](_0x45ba5c);}};}function respondWithFilteredResult(_0x553506,_0x5e325e){return function(_0x559b36){if(_0x559b36){var _0x9c053f=typeof _0x5e325e['offset']===_0x5dea('0x1b')&&typeof _0x5e325e[_0x5dea('0x1c')]===_0x5dea('0x1b');var _0x51a9cc=_0x559b36[_0x5dea('0x1d')];var _0x339864=_0x9c053f?0x0:_0x5e325e['offset'];var _0xf41083=_0x9c053f?_0x559b36[_0x5dea('0x1d')]:_0x5e325e[_0x5dea('0x1e')]+_0x5e325e['limit'];var _0x2bc163;if(_0xf41083>=_0x51a9cc){_0xf41083=_0x51a9cc;_0x2bc163=0xc8;}else{_0x2bc163=0xce;}_0x553506[_0x5dea('0x19')](_0x2bc163);return _0x553506['set'](_0x5dea('0x1f'),_0x339864+'-'+_0xf41083+'/'+_0x51a9cc)[_0x5dea('0x20')](_0x559b36);}return null;};}function patchUpdates(_0xff1c58){return function(_0x5cb9ab){try{jsonpatch['apply'](_0x5cb9ab,_0xff1c58,!![]);}catch(_0x2e440d){return BPromise[_0x5dea('0x21')](_0x2e440d);}return _0x5cb9ab[_0x5dea('0x22')]();};}function saveUpdates(_0x181328,_0x4edd28){return function(_0x5064f8){if(_0x5064f8){return _0x5064f8[_0x5dea('0x23')](_0x181328)[_0x5dea('0x24')](function(_0x5d1a9d){return _0x5d1a9d;});}return null;};}function removeEntity(_0x78758b,_0x4db6dd){return function(_0x27e31d){if(_0x27e31d){return _0x27e31d[_0x5dea('0x25')]()[_0x5dea('0x24')](function(){_0x78758b[_0x5dea('0x19')](0xcc)[_0x5dea('0x1a')]();});}};}function handleEntityNotFound(_0x3a3cd0,_0x2dfcc7){return function(_0x2fa1cc){if(!_0x2fa1cc){_0x3a3cd0[_0x5dea('0x18')](0x194);}return _0x2fa1cc;};}function handleError(_0x3507d0,_0x516feb){_0x516feb=_0x516feb||0x1f4;return function(_0x5314bc){logger['error'](_0x5314bc[_0x5dea('0x26')]);if(_0x5314bc['name']){delete _0x5314bc[_0x5dea('0x27')];}_0x3507d0[_0x5dea('0x19')](_0x516feb)['send'](_0x5314bc);};}exports[_0x5dea('0x28')]=function(_0x13c328,_0x2bd3c0){var _0x209fac={},_0x145bd1={},_0x5e5fa0={'count':0x0,'rows':[]};var _0x6ab3d=_[_0x5dea('0x29')](db[_0x5dea('0x2a')][_0x5dea('0x2b')],function(_0x61b5dd){return{'name':_0x61b5dd[_0x5dea('0x2c')],'type':_0x61b5dd[_0x5dea('0x2d')]['key']};});_0x145bd1[_0x5dea('0x2e')]=_[_0x5dea('0x29')](_0x6ab3d,'name');_0x145bd1[_0x5dea('0x2f')]=_[_0x5dea('0x30')](_0x13c328[_0x5dea('0x2f')]);_0x145bd1[_0x5dea('0x31')]=_[_0x5dea('0x32')](_0x145bd1[_0x5dea('0x2e')],_0x145bd1[_0x5dea('0x2f')]);_0x209fac['attributes']=_[_0x5dea('0x32')](_0x145bd1['model'],qs[_0x5dea('0x33')](_0x13c328[_0x5dea('0x2f')][_0x5dea('0x33')]));_0x209fac[_0x5dea('0x34')]=_0x209fac[_0x5dea('0x34')][_0x5dea('0x35')]?_0x209fac['attributes']:_0x145bd1[_0x5dea('0x2e')];if(!_0x13c328[_0x5dea('0x2f')][_0x5dea('0x36')](_0x5dea('0x37'))){_0x209fac[_0x5dea('0x1c')]=qs[_0x5dea('0x1c')](_0x13c328['query']['limit']);_0x209fac['offset']=qs['offset'](_0x13c328[_0x5dea('0x2f')][_0x5dea('0x1e')]);}_0x209fac[_0x5dea('0x38')]=qs[_0x5dea('0x39')](_0x13c328[_0x5dea('0x2f')]['sort']);_0x209fac[_0x5dea('0x3a')]=qs['filters'](_['pick'](_0x13c328[_0x5dea('0x2f')],_0x145bd1[_0x5dea('0x31')]),_0x6ab3d);if(_0x13c328[_0x5dea('0x2f')][_0x5dea('0x3b')]){_0x209fac['where']=_[_0x5dea('0x3c')](_0x209fac['where'],{'$or':_['map'](_0x6ab3d,function(_0x4f1393){if(_0x4f1393[_0x5dea('0x2d')]!==_0x5dea('0x3d')){var _0x1473ea={};_0x1473ea[_0x4f1393[_0x5dea('0x27')]]={'$like':'%'+_0x13c328[_0x5dea('0x2f')]['filter']+'%'};return _0x1473ea;}})});}_0x209fac=_[_0x5dea('0x3c')]({},_0x209fac,_0x13c328[_0x5dea('0x3e')]);var _0x51fff6={'where':_0x209fac['where']};return db[_0x5dea('0x2a')][_0x5dea('0x1d')](_0x51fff6)[_0x5dea('0x24')](function(_0x732006){_0x5e5fa0[_0x5dea('0x1d')]=_0x732006;if(_0x13c328[_0x5dea('0x2f')][_0x5dea('0x3f')]){_0x209fac[_0x5dea('0x40')]=[{'all':!![]}];}return db[_0x5dea('0x2a')][_0x5dea('0x41')](_0x209fac);})[_0x5dea('0x24')](function(_0x2bf531){_0x5e5fa0[_0x5dea('0x42')]=_0x2bf531;return _0x5e5fa0;})['then'](respondWithFilteredResult(_0x2bd3c0,_0x209fac))[_0x5dea('0x43')](handleError(_0x2bd3c0,null));};exports[_0x5dea('0x44')]=function(_0x326c54,_0x111eb0){var _0x174079={'raw':![],'where':{'id':_0x326c54[_0x5dea('0x45')]['id']}},_0x5c6549={};_0x5c6549[_0x5dea('0x2e')]=_[_0x5dea('0x30')](db['FreshsalesConfiguration'][_0x5dea('0x2b')]);_0x5c6549['query']=_[_0x5dea('0x30')](_0x326c54['query']);_0x5c6549[_0x5dea('0x31')]=_[_0x5dea('0x32')](_0x5c6549[_0x5dea('0x2e')],_0x5c6549[_0x5dea('0x2f')]);_0x174079[_0x5dea('0x34')]=_['intersection'](_0x5c6549['model'],qs[_0x5dea('0x33')](_0x326c54[_0x5dea('0x2f')][_0x5dea('0x33')]));_0x174079['attributes']=_0x174079[_0x5dea('0x34')]['length']?_0x174079[_0x5dea('0x34')]:_0x5c6549['model'];if(_0x326c54[_0x5dea('0x2f')][_0x5dea('0x3f')]){_0x174079[_0x5dea('0x40')]=[{'all':!![]}];}_0x174079=_[_0x5dea('0x3c')]({},_0x174079,_0x326c54['options']);return db['FreshsalesConfiguration']['find'](_0x174079)[_0x5dea('0x24')](handleEntityNotFound(_0x111eb0,null))['then'](respondWithResult(_0x111eb0,null))[_0x5dea('0x43')](handleError(_0x111eb0,null));};exports[_0x5dea('0x46')]=function(_0x338bb7,_0x4fbfb0){return db[_0x5dea('0x2a')][_0x5dea('0x46')](_0x338bb7[_0x5dea('0x47')],{})[_0x5dea('0x24')](respondWithResult(_0x4fbfb0,0xc9))[_0x5dea('0x43')](handleError(_0x4fbfb0,null));};exports[_0x5dea('0x23')]=function(_0x3d10cb,_0x259798){if(_0x3d10cb[_0x5dea('0x47')]['id']){delete _0x3d10cb[_0x5dea('0x47')]['id'];}return db[_0x5dea('0x2a')][_0x5dea('0x48')]({'where':{'id':_0x3d10cb[_0x5dea('0x45')]['id']}})[_0x5dea('0x24')](handleEntityNotFound(_0x259798,null))['then'](saveUpdates(_0x3d10cb[_0x5dea('0x47')],null))[_0x5dea('0x24')](respondWithResult(_0x259798,null))[_0x5dea('0x43')](handleError(_0x259798,null));};exports['destroy']=function(_0x6658d9,_0x4eed3c){return db[_0x5dea('0x2a')]['find']({'where':{'id':_0x6658d9['params']['id']}})[_0x5dea('0x24')](handleEntityNotFound(_0x4eed3c,null))[_0x5dea('0x24')](removeEntity(_0x4eed3c,null))['catch'](handleError(_0x4eed3c,null));};exports[_0x5dea('0x49')]=function(_0xe08d02,_0x543a9c,_0x97b3b2){var _0x2bbe68={};var _0x2837b8={};var _0x5c618f;var _0x257606;return db[_0x5dea('0x2a')]['findOne']({'where':{'id':_0xe08d02['params']['id']}})[_0x5dea('0x24')](handleEntityNotFound(_0x543a9c,null))[_0x5dea('0x24')](function(_0x45ea39){if(_0x45ea39){_0x5c618f=_0x45ea39;_0x2837b8['model']=_[_0x5dea('0x30')](db[_0x5dea('0x4a')][_0x5dea('0x2b')]);_0x2837b8[_0x5dea('0x2f')]=_['keys'](_0xe08d02[_0x5dea('0x2f')]);_0x2837b8[_0x5dea('0x31')]=_[_0x5dea('0x32')](_0x2837b8[_0x5dea('0x2e')],_0x2837b8[_0x5dea('0x2f')]);_0x2bbe68[_0x5dea('0x34')]=_[_0x5dea('0x32')](_0x2837b8[_0x5dea('0x2e')],qs[_0x5dea('0x33')](_0xe08d02[_0x5dea('0x2f')]['fields']));_0x2bbe68[_0x5dea('0x34')]=_0x2bbe68['attributes'][_0x5dea('0x35')]?_0x2bbe68[_0x5dea('0x34')]:_0x2837b8[_0x5dea('0x2e')];_0x2bbe68['order']=qs[_0x5dea('0x39')](_0xe08d02[_0x5dea('0x2f')][_0x5dea('0x39')]);_0x2bbe68[_0x5dea('0x3a')]=qs[_0x5dea('0x31')](_[_0x5dea('0x4b')](_0xe08d02[_0x5dea('0x2f')],_0x2837b8['filters']));if(_0xe08d02[_0x5dea('0x2f')][_0x5dea('0x3b')]){_0x2bbe68['where']=_[_0x5dea('0x3c')](_0x2bbe68[_0x5dea('0x3a')],{'$or':_[_0x5dea('0x29')](_0x2bbe68[_0x5dea('0x34')],function(_0x322ba1){var _0x15435a={};_0x15435a[_0x322ba1]={'$like':'%'+_0xe08d02['query'][_0x5dea('0x3b')]+'%'};return _0x15435a;})});}_0x2bbe68=_[_0x5dea('0x3c')]({},_0x2bbe68,_0xe08d02[_0x5dea('0x3e')]);return _0x5c618f[_0x5dea('0x49')](_0x2bbe68);}})['then'](function(_0x8e8b8d){if(_0x8e8b8d){_0x257606=_0x8e8b8d[_0x5dea('0x35')];if(!_0xe08d02[_0x5dea('0x2f')][_0x5dea('0x36')](_0x5dea('0x37'))){_0x2bbe68[_0x5dea('0x1c')]=qs[_0x5dea('0x1c')](_0xe08d02[_0x5dea('0x2f')]['limit']);_0x2bbe68['offset']=qs[_0x5dea('0x1e')](_0xe08d02[_0x5dea('0x2f')][_0x5dea('0x1e')]);}return _0x5c618f[_0x5dea('0x49')](_0x2bbe68);}})[_0x5dea('0x24')](function(_0x3c6356){if(_0x3c6356){return _0x3c6356?{'count':_0x257606,'rows':_0x3c6356}:null;}})[_0x5dea('0x24')](respondWithResult(_0x543a9c,null))[_0x5dea('0x43')](handleError(_0x543a9c,null));};exports[_0x5dea('0x4c')]=function(_0x1574c1,_0x5d4dcc,_0x3933a9){var _0x4b6b70={};var _0x5c3647={};var _0x3f54e3;var _0x24eba4;return db[_0x5dea('0x2a')][_0x5dea('0x4d')]({'where':{'id':_0x1574c1[_0x5dea('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d4dcc,null))[_0x5dea('0x24')](function(_0x2c25fc){if(_0x2c25fc){_0x3f54e3=_0x2c25fc;_0x5c3647['model']=_['keys'](db[_0x5dea('0x4a')][_0x5dea('0x2b')]);_0x5c3647['query']=_[_0x5dea('0x30')](_0x1574c1[_0x5dea('0x2f')]);_0x5c3647[_0x5dea('0x31')]=_[_0x5dea('0x32')](_0x5c3647[_0x5dea('0x2e')],_0x5c3647[_0x5dea('0x2f')]);_0x4b6b70['attributes']=_[_0x5dea('0x32')](_0x5c3647[_0x5dea('0x2e')],qs['fields'](_0x1574c1[_0x5dea('0x2f')][_0x5dea('0x33')]));_0x4b6b70[_0x5dea('0x34')]=_0x4b6b70['attributes'][_0x5dea('0x35')]?_0x4b6b70[_0x5dea('0x34')]:_0x5c3647[_0x5dea('0x2e')];_0x4b6b70[_0x5dea('0x38')]=qs[_0x5dea('0x39')](_0x1574c1['query'][_0x5dea('0x39')]);_0x4b6b70[_0x5dea('0x3a')]=qs[_0x5dea('0x31')](_[_0x5dea('0x4b')](_0x1574c1[_0x5dea('0x2f')],_0x5c3647[_0x5dea('0x31')]));if(_0x1574c1[_0x5dea('0x2f')][_0x5dea('0x3b')]){_0x4b6b70['where']=_[_0x5dea('0x3c')](_0x4b6b70[_0x5dea('0x3a')],{'$or':_['map'](_0x4b6b70[_0x5dea('0x34')],function(_0x1c2a26){var _0x153983={};_0x153983[_0x1c2a26]={'$like':'%'+_0x1574c1[_0x5dea('0x2f')][_0x5dea('0x3b')]+'%'};return _0x153983;})});}_0x4b6b70=_[_0x5dea('0x3c')]({},_0x4b6b70,_0x1574c1[_0x5dea('0x3e')]);return _0x3f54e3['getDescriptions'](_0x4b6b70);}})['then'](function(_0x934633){if(_0x934633){_0x24eba4=_0x934633['length'];if(!_0x1574c1[_0x5dea('0x2f')][_0x5dea('0x36')](_0x5dea('0x37'))){_0x4b6b70[_0x5dea('0x1c')]=qs[_0x5dea('0x1c')](_0x1574c1['query'][_0x5dea('0x1c')]);_0x4b6b70[_0x5dea('0x1e')]=qs[_0x5dea('0x1e')](_0x1574c1[_0x5dea('0x2f')][_0x5dea('0x1e')]);}return _0x3f54e3[_0x5dea('0x4c')](_0x4b6b70);}})['then'](function(_0x35d434){if(_0x35d434){return _0x35d434?{'count':_0x24eba4,'rows':_0x35d434}:null;}})[_0x5dea('0x24')](respondWithResult(_0x5d4dcc,null))[_0x5dea('0x43')](handleError(_0x5d4dcc,null));};exports[_0x5dea('0x4e')]=function(_0x7f3def,_0x3598e2,_0x5387da){var _0x5f4bee={};var _0x264105={};var _0x87602b;var _0x26c070;return db[_0x5dea('0x2a')][_0x5dea('0x4d')]({'where':{'id':_0x7f3def[_0x5dea('0x45')]['id']}})[_0x5dea('0x24')](handleEntityNotFound(_0x3598e2,null))[_0x5dea('0x24')](function(_0x17581f){if(_0x17581f){_0x87602b=_0x17581f;_0x264105[_0x5dea('0x2e')]=_['keys'](db[_0x5dea('0x4a')]['rawAttributes']);_0x264105[_0x5dea('0x2f')]=_[_0x5dea('0x30')](_0x7f3def[_0x5dea('0x2f')]);_0x264105[_0x5dea('0x31')]=_[_0x5dea('0x32')](_0x264105[_0x5dea('0x2e')],_0x264105[_0x5dea('0x2f')]);_0x5f4bee['attributes']=_[_0x5dea('0x32')](_0x264105[_0x5dea('0x2e')],qs['fields'](_0x7f3def[_0x5dea('0x2f')][_0x5dea('0x33')]));_0x5f4bee[_0x5dea('0x34')]=_0x5f4bee['attributes']['length']?_0x5f4bee[_0x5dea('0x34')]:_0x264105[_0x5dea('0x2e')];_0x5f4bee[_0x5dea('0x38')]=qs[_0x5dea('0x39')](_0x7f3def[_0x5dea('0x2f')]['sort']);_0x5f4bee['where']=qs[_0x5dea('0x31')](_['pick'](_0x7f3def['query'],_0x264105[_0x5dea('0x31')]));if(_0x7f3def['query']['filter']){_0x5f4bee[_0x5dea('0x3a')]=_[_0x5dea('0x3c')](_0x5f4bee['where'],{'$or':_[_0x5dea('0x29')](_0x5f4bee[_0x5dea('0x34')],function(_0x236a20){var _0x44836d={};_0x44836d[_0x236a20]={'$like':'%'+_0x7f3def[_0x5dea('0x2f')][_0x5dea('0x3b')]+'%'};return _0x44836d;})});}_0x5f4bee=_[_0x5dea('0x3c')]({},_0x5f4bee,_0x7f3def['options']);return _0x87602b[_0x5dea('0x4e')](_0x5f4bee);}})[_0x5dea('0x24')](function(_0x7e2069){if(_0x7e2069){_0x26c070=_0x7e2069[_0x5dea('0x35')];if(!_0x7f3def['query']['hasOwnProperty']('nolimit')){_0x5f4bee['limit']=qs[_0x5dea('0x1c')](_0x7f3def[_0x5dea('0x2f')][_0x5dea('0x1c')]);_0x5f4bee[_0x5dea('0x1e')]=qs['offset'](_0x7f3def[_0x5dea('0x2f')][_0x5dea('0x1e')]);}return _0x87602b[_0x5dea('0x4e')](_0x5f4bee);}})[_0x5dea('0x24')](function(_0x57f2a6){if(_0x57f2a6){return _0x57f2a6?{'count':_0x26c070,'rows':_0x57f2a6}:null;}})[_0x5dea('0x24')](respondWithResult(_0x3598e2,null))['catch'](handleError(_0x3598e2,null));}; \ No newline at end of file +var _0xee70=['destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','keys','create','body','find','getSubjects','findOne','order','pick','filter','getDescriptions','options','getFields','FreshsalesField','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then'];(function(_0x1bc10e,_0x3edf55){var _0x3e7aa8=function(_0x3e079c){while(--_0x3e079c){_0x1bc10e['push'](_0x1bc10e['shift']());}};_0x3e7aa8(++_0x3edf55);}(_0xee70,0x11f));var _0x0ee7=function(_0x355a02,_0x57a3cf){_0x355a02=_0x355a02-0x0;var _0x2eb928=_0xee70[_0x355a02];return _0x2eb928;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ee7('0x0'));var zipdir=require(_0x0ee7('0x1'));var jsonpatch=require(_0x0ee7('0x2'));var rp=require(_0x0ee7('0x3'));var moment=require(_0x0ee7('0x4'));var BPromise=require(_0x0ee7('0x5'));var Mustache=require(_0x0ee7('0x6'));var util=require(_0x0ee7('0x7'));var path=require('path');var sox=require(_0x0ee7('0x8'));var csv=require(_0x0ee7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ee7('0xa'));var _=require(_0x0ee7('0xb'));var squel=require(_0x0ee7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ee7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ee7('0xe'));var Redis=require(_0x0ee7('0xf'));var authService=require(_0x0ee7('0x10'));var qs=require(_0x0ee7('0x11'));var as=require(_0x0ee7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee7('0x13'))('api');var utils=require(_0x0ee7('0x14'));var config=require(_0x0ee7('0x15'));var licenseUtil=require(_0x0ee7('0x16'));var db=require(_0x0ee7('0x17'))['db'];function respondWithStatusCode(_0x91e1a9,_0x513ced){_0x513ced=_0x513ced||0xcc;return function(_0x4df865){if(_0x4df865){return _0x91e1a9[_0x0ee7('0x18')](_0x513ced);}return _0x91e1a9[_0x0ee7('0x19')](_0x513ced)[_0x0ee7('0x1a')]();};}function respondWithResult(_0x374bfe,_0x127f8a){_0x127f8a=_0x127f8a||0xc8;return function(_0xe0d6a0){if(_0xe0d6a0){return _0x374bfe[_0x0ee7('0x19')](_0x127f8a)[_0x0ee7('0x1b')](_0xe0d6a0);}};}function respondWithFilteredResult(_0x4ebd01,_0xa19f04){return function(_0x22a5d4){if(_0x22a5d4){var _0xf56822=typeof _0xa19f04[_0x0ee7('0x1c')]===_0x0ee7('0x1d')&&typeof _0xa19f04[_0x0ee7('0x1e')]==='undefined';var _0x4d624a=_0x22a5d4[_0x0ee7('0x1f')];var _0x4ffe57=_0xf56822?0x0:_0xa19f04[_0x0ee7('0x1c')];var _0x359c78=_0xf56822?_0x22a5d4[_0x0ee7('0x1f')]:_0xa19f04[_0x0ee7('0x1c')]+_0xa19f04[_0x0ee7('0x1e')];var _0x27938d;if(_0x359c78>=_0x4d624a){_0x359c78=_0x4d624a;_0x27938d=0xc8;}else{_0x27938d=0xce;}_0x4ebd01[_0x0ee7('0x19')](_0x27938d);return _0x4ebd01['set'](_0x0ee7('0x20'),_0x4ffe57+'-'+_0x359c78+'/'+_0x4d624a)[_0x0ee7('0x1b')](_0x22a5d4);}return null;};}function patchUpdates(_0x360f05){return function(_0x14d1a0){try{jsonpatch['apply'](_0x14d1a0,_0x360f05,!![]);}catch(_0x5c051a){return BPromise[_0x0ee7('0x21')](_0x5c051a);}return _0x14d1a0[_0x0ee7('0x22')]();};}function saveUpdates(_0x1925c7,_0xcf73f6){return function(_0x194d01){if(_0x194d01){return _0x194d01[_0x0ee7('0x23')](_0x1925c7)[_0x0ee7('0x24')](function(_0x5e6734){return _0x5e6734;});}return null;};}function removeEntity(_0x34f22e,_0x2ce36e){return function(_0x1712d9){if(_0x1712d9){return _0x1712d9[_0x0ee7('0x25')]()[_0x0ee7('0x24')](function(){_0x34f22e[_0x0ee7('0x19')](0xcc)[_0x0ee7('0x1a')]();});}};}function handleEntityNotFound(_0x26f45c,_0x2c3e4a){return function(_0x1281d4){if(!_0x1281d4){_0x26f45c[_0x0ee7('0x18')](0x194);}return _0x1281d4;};}function handleError(_0x25bb00,_0x296822){_0x296822=_0x296822||0x1f4;return function(_0x176584){logger[_0x0ee7('0x26')](_0x176584[_0x0ee7('0x27')]);if(_0x176584[_0x0ee7('0x28')]){delete _0x176584[_0x0ee7('0x28')];}_0x25bb00['status'](_0x296822)[_0x0ee7('0x29')](_0x176584);};}exports[_0x0ee7('0x2a')]=function(_0x243b2c,_0x9a7a9a){var _0x178f98={},_0x338464={},_0x6eff0a={'count':0x0,'rows':[]};var _0x30784e=_['map'](db[_0x0ee7('0x2b')][_0x0ee7('0x2c')],function(_0x41814d){return{'name':_0x41814d[_0x0ee7('0x2d')],'type':_0x41814d[_0x0ee7('0x2e')][_0x0ee7('0x2f')]};});_0x338464[_0x0ee7('0x30')]=_[_0x0ee7('0x31')](_0x30784e,'name');_0x338464['query']=_['keys'](_0x243b2c[_0x0ee7('0x32')]);_0x338464[_0x0ee7('0x33')]=_[_0x0ee7('0x34')](_0x338464[_0x0ee7('0x30')],_0x338464[_0x0ee7('0x32')]);_0x178f98[_0x0ee7('0x35')]=_['intersection'](_0x338464[_0x0ee7('0x30')],qs[_0x0ee7('0x36')](_0x243b2c[_0x0ee7('0x32')][_0x0ee7('0x36')]));_0x178f98['attributes']=_0x178f98['attributes'][_0x0ee7('0x37')]?_0x178f98[_0x0ee7('0x35')]:_0x338464[_0x0ee7('0x30')];if(!_0x243b2c[_0x0ee7('0x32')][_0x0ee7('0x38')](_0x0ee7('0x39'))){_0x178f98[_0x0ee7('0x1e')]=qs[_0x0ee7('0x1e')](_0x243b2c[_0x0ee7('0x32')][_0x0ee7('0x1e')]);_0x178f98[_0x0ee7('0x1c')]=qs[_0x0ee7('0x1c')](_0x243b2c[_0x0ee7('0x32')][_0x0ee7('0x1c')]);}_0x178f98['order']=qs[_0x0ee7('0x3a')](_0x243b2c['query'][_0x0ee7('0x3a')]);_0x178f98[_0x0ee7('0x3b')]=qs[_0x0ee7('0x33')](_['pick'](_0x243b2c[_0x0ee7('0x32')],_0x338464[_0x0ee7('0x33')]),_0x30784e);if(_0x243b2c[_0x0ee7('0x32')]['filter']){_0x178f98['where']=_['merge'](_0x178f98['where'],{'$or':_[_0x0ee7('0x31')](_0x30784e,function(_0x2936bb){if(_0x2936bb['type']!==_0x0ee7('0x3c')){var _0x31d2df={};_0x31d2df[_0x2936bb[_0x0ee7('0x28')]]={'$like':'%'+_0x243b2c['query']['filter']+'%'};return _0x31d2df;}})});}_0x178f98=_[_0x0ee7('0x3d')]({},_0x178f98,_0x243b2c['options']);var _0x4b0a85={'where':_0x178f98['where']};return db[_0x0ee7('0x2b')][_0x0ee7('0x1f')](_0x4b0a85)[_0x0ee7('0x24')](function(_0x47c058){_0x6eff0a[_0x0ee7('0x1f')]=_0x47c058;if(_0x243b2c[_0x0ee7('0x32')][_0x0ee7('0x3e')]){_0x178f98[_0x0ee7('0x3f')]=[{'all':!![]}];}return db[_0x0ee7('0x2b')][_0x0ee7('0x40')](_0x178f98);})[_0x0ee7('0x24')](function(_0x46c225){_0x6eff0a[_0x0ee7('0x41')]=_0x46c225;return _0x6eff0a;})[_0x0ee7('0x24')](respondWithFilteredResult(_0x9a7a9a,_0x178f98))[_0x0ee7('0x42')](handleError(_0x9a7a9a,null));};exports['show']=function(_0xa4db68,_0x6b1634){var _0xa406c1={'raw':![],'where':{'id':_0xa4db68[_0x0ee7('0x43')]['id']}},_0x426b3a={};_0x426b3a[_0x0ee7('0x30')]=_[_0x0ee7('0x44')](db[_0x0ee7('0x2b')]['rawAttributes']);_0x426b3a[_0x0ee7('0x32')]=_[_0x0ee7('0x44')](_0xa4db68['query']);_0x426b3a['filters']=_[_0x0ee7('0x34')](_0x426b3a[_0x0ee7('0x30')],_0x426b3a['query']);_0xa406c1[_0x0ee7('0x35')]=_['intersection'](_0x426b3a['model'],qs[_0x0ee7('0x36')](_0xa4db68[_0x0ee7('0x32')]['fields']));_0xa406c1[_0x0ee7('0x35')]=_0xa406c1[_0x0ee7('0x35')][_0x0ee7('0x37')]?_0xa406c1['attributes']:_0x426b3a[_0x0ee7('0x30')];if(_0xa4db68[_0x0ee7('0x32')][_0x0ee7('0x3e')]){_0xa406c1[_0x0ee7('0x3f')]=[{'all':!![]}];}_0xa406c1=_[_0x0ee7('0x3d')]({},_0xa406c1,_0xa4db68['options']);return db[_0x0ee7('0x2b')]['find'](_0xa406c1)[_0x0ee7('0x24')](handleEntityNotFound(_0x6b1634,null))['then'](respondWithResult(_0x6b1634,null))[_0x0ee7('0x42')](handleError(_0x6b1634,null));};exports[_0x0ee7('0x45')]=function(_0x36a0fc,_0x4ef5fd){return db['FreshsalesConfiguration'][_0x0ee7('0x45')](_0x36a0fc['body'],{})['then'](respondWithResult(_0x4ef5fd,0xc9))[_0x0ee7('0x42')](handleError(_0x4ef5fd,null));};exports[_0x0ee7('0x23')]=function(_0x50baef,_0x52fbe8){if(_0x50baef[_0x0ee7('0x46')]['id']){delete _0x50baef[_0x0ee7('0x46')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x50baef[_0x0ee7('0x43')]['id']}})[_0x0ee7('0x24')](handleEntityNotFound(_0x52fbe8,null))['then'](saveUpdates(_0x50baef['body'],null))['then'](respondWithResult(_0x52fbe8,null))[_0x0ee7('0x42')](handleError(_0x52fbe8,null));};exports[_0x0ee7('0x25')]=function(_0x5a3211,_0x28377b){return db['FreshsalesConfiguration'][_0x0ee7('0x47')]({'where':{'id':_0x5a3211['params']['id']}})[_0x0ee7('0x24')](handleEntityNotFound(_0x28377b,null))[_0x0ee7('0x24')](removeEntity(_0x28377b,null))['catch'](handleError(_0x28377b,null));};exports[_0x0ee7('0x48')]=function(_0x29c52e,_0x20ede7,_0x51c7b3){var _0x1e33ae={};var _0x4de289={};var _0x162612;var _0x387e00;return db['FreshsalesConfiguration'][_0x0ee7('0x49')]({'where':{'id':_0x29c52e[_0x0ee7('0x43')]['id']}})[_0x0ee7('0x24')](handleEntityNotFound(_0x20ede7,null))[_0x0ee7('0x24')](function(_0x39cf15){if(_0x39cf15){_0x162612=_0x39cf15;_0x4de289[_0x0ee7('0x30')]=_[_0x0ee7('0x44')](db['FreshsalesField']['rawAttributes']);_0x4de289[_0x0ee7('0x32')]=_[_0x0ee7('0x44')](_0x29c52e[_0x0ee7('0x32')]);_0x4de289[_0x0ee7('0x33')]=_['intersection'](_0x4de289[_0x0ee7('0x30')],_0x4de289['query']);_0x1e33ae[_0x0ee7('0x35')]=_[_0x0ee7('0x34')](_0x4de289[_0x0ee7('0x30')],qs[_0x0ee7('0x36')](_0x29c52e[_0x0ee7('0x32')][_0x0ee7('0x36')]));_0x1e33ae[_0x0ee7('0x35')]=_0x1e33ae[_0x0ee7('0x35')][_0x0ee7('0x37')]?_0x1e33ae[_0x0ee7('0x35')]:_0x4de289['model'];_0x1e33ae[_0x0ee7('0x4a')]=qs['sort'](_0x29c52e[_0x0ee7('0x32')][_0x0ee7('0x3a')]);_0x1e33ae[_0x0ee7('0x3b')]=qs['filters'](_[_0x0ee7('0x4b')](_0x29c52e['query'],_0x4de289[_0x0ee7('0x33')]));if(_0x29c52e[_0x0ee7('0x32')][_0x0ee7('0x4c')]){_0x1e33ae[_0x0ee7('0x3b')]=_[_0x0ee7('0x3d')](_0x1e33ae[_0x0ee7('0x3b')],{'$or':_['map'](_0x1e33ae['attributes'],function(_0x38ab5a){var _0x2f917b={};_0x2f917b[_0x38ab5a]={'$like':'%'+_0x29c52e[_0x0ee7('0x32')]['filter']+'%'};return _0x2f917b;})});}_0x1e33ae=_[_0x0ee7('0x3d')]({},_0x1e33ae,_0x29c52e['options']);return _0x162612[_0x0ee7('0x48')](_0x1e33ae);}})[_0x0ee7('0x24')](function(_0x40ba7e){if(_0x40ba7e){_0x387e00=_0x40ba7e[_0x0ee7('0x37')];if(!_0x29c52e[_0x0ee7('0x32')][_0x0ee7('0x38')](_0x0ee7('0x39'))){_0x1e33ae[_0x0ee7('0x1e')]=qs[_0x0ee7('0x1e')](_0x29c52e[_0x0ee7('0x32')][_0x0ee7('0x1e')]);_0x1e33ae['offset']=qs[_0x0ee7('0x1c')](_0x29c52e['query'][_0x0ee7('0x1c')]);}return _0x162612[_0x0ee7('0x48')](_0x1e33ae);}})[_0x0ee7('0x24')](function(_0x3d9ce2){if(_0x3d9ce2){return _0x3d9ce2?{'count':_0x387e00,'rows':_0x3d9ce2}:null;}})[_0x0ee7('0x24')](respondWithResult(_0x20ede7,null))[_0x0ee7('0x42')](handleError(_0x20ede7,null));};exports[_0x0ee7('0x4d')]=function(_0x49245d,_0x50f7e4,_0x1f3477){var _0x58616e={};var _0xfb1939={};var _0x35a07a;var _0x1ea076;return db[_0x0ee7('0x2b')]['findOne']({'where':{'id':_0x49245d[_0x0ee7('0x43')]['id']}})[_0x0ee7('0x24')](handleEntityNotFound(_0x50f7e4,null))[_0x0ee7('0x24')](function(_0x371e3a){if(_0x371e3a){_0x35a07a=_0x371e3a;_0xfb1939[_0x0ee7('0x30')]=_[_0x0ee7('0x44')](db['FreshsalesField'][_0x0ee7('0x2c')]);_0xfb1939[_0x0ee7('0x32')]=_['keys'](_0x49245d[_0x0ee7('0x32')]);_0xfb1939['filters']=_[_0x0ee7('0x34')](_0xfb1939[_0x0ee7('0x30')],_0xfb1939[_0x0ee7('0x32')]);_0x58616e[_0x0ee7('0x35')]=_[_0x0ee7('0x34')](_0xfb1939[_0x0ee7('0x30')],qs['fields'](_0x49245d[_0x0ee7('0x32')]['fields']));_0x58616e[_0x0ee7('0x35')]=_0x58616e[_0x0ee7('0x35')][_0x0ee7('0x37')]?_0x58616e['attributes']:_0xfb1939['model'];_0x58616e['order']=qs[_0x0ee7('0x3a')](_0x49245d[_0x0ee7('0x32')][_0x0ee7('0x3a')]);_0x58616e[_0x0ee7('0x3b')]=qs[_0x0ee7('0x33')](_[_0x0ee7('0x4b')](_0x49245d['query'],_0xfb1939['filters']));if(_0x49245d[_0x0ee7('0x32')][_0x0ee7('0x4c')]){_0x58616e['where']=_['merge'](_0x58616e['where'],{'$or':_[_0x0ee7('0x31')](_0x58616e[_0x0ee7('0x35')],function(_0x2c6094){var _0x3b0fb8={};_0x3b0fb8[_0x2c6094]={'$like':'%'+_0x49245d[_0x0ee7('0x32')][_0x0ee7('0x4c')]+'%'};return _0x3b0fb8;})});}_0x58616e=_[_0x0ee7('0x3d')]({},_0x58616e,_0x49245d[_0x0ee7('0x4e')]);return _0x35a07a[_0x0ee7('0x4d')](_0x58616e);}})[_0x0ee7('0x24')](function(_0x2afe3b){if(_0x2afe3b){_0x1ea076=_0x2afe3b[_0x0ee7('0x37')];if(!_0x49245d[_0x0ee7('0x32')][_0x0ee7('0x38')](_0x0ee7('0x39'))){_0x58616e[_0x0ee7('0x1e')]=qs[_0x0ee7('0x1e')](_0x49245d[_0x0ee7('0x32')]['limit']);_0x58616e['offset']=qs[_0x0ee7('0x1c')](_0x49245d[_0x0ee7('0x32')][_0x0ee7('0x1c')]);}return _0x35a07a[_0x0ee7('0x4d')](_0x58616e);}})[_0x0ee7('0x24')](function(_0x11ac12){if(_0x11ac12){return _0x11ac12?{'count':_0x1ea076,'rows':_0x11ac12}:null;}})[_0x0ee7('0x24')](respondWithResult(_0x50f7e4,null))[_0x0ee7('0x42')](handleError(_0x50f7e4,null));};exports[_0x0ee7('0x4f')]=function(_0x57bf90,_0x34a0bf,_0x45c103){var _0x1e1786={};var _0x445d3a={};var _0x15aceb;var _0x32c344;return db[_0x0ee7('0x2b')][_0x0ee7('0x49')]({'where':{'id':_0x57bf90[_0x0ee7('0x43')]['id']}})[_0x0ee7('0x24')](handleEntityNotFound(_0x34a0bf,null))['then'](function(_0x2a645b){if(_0x2a645b){_0x15aceb=_0x2a645b;_0x445d3a[_0x0ee7('0x30')]=_[_0x0ee7('0x44')](db[_0x0ee7('0x50')]['rawAttributes']);_0x445d3a[_0x0ee7('0x32')]=_[_0x0ee7('0x44')](_0x57bf90[_0x0ee7('0x32')]);_0x445d3a['filters']=_['intersection'](_0x445d3a[_0x0ee7('0x30')],_0x445d3a[_0x0ee7('0x32')]);_0x1e1786[_0x0ee7('0x35')]=_[_0x0ee7('0x34')](_0x445d3a[_0x0ee7('0x30')],qs[_0x0ee7('0x36')](_0x57bf90[_0x0ee7('0x32')]['fields']));_0x1e1786[_0x0ee7('0x35')]=_0x1e1786[_0x0ee7('0x35')][_0x0ee7('0x37')]?_0x1e1786[_0x0ee7('0x35')]:_0x445d3a['model'];_0x1e1786[_0x0ee7('0x4a')]=qs[_0x0ee7('0x3a')](_0x57bf90[_0x0ee7('0x32')]['sort']);_0x1e1786[_0x0ee7('0x3b')]=qs['filters'](_[_0x0ee7('0x4b')](_0x57bf90['query'],_0x445d3a[_0x0ee7('0x33')]));if(_0x57bf90[_0x0ee7('0x32')][_0x0ee7('0x4c')]){_0x1e1786['where']=_[_0x0ee7('0x3d')](_0x1e1786[_0x0ee7('0x3b')],{'$or':_['map'](_0x1e1786[_0x0ee7('0x35')],function(_0x1112fa){var _0x1ab146={};_0x1ab146[_0x1112fa]={'$like':'%'+_0x57bf90[_0x0ee7('0x32')]['filter']+'%'};return _0x1ab146;})});}_0x1e1786=_[_0x0ee7('0x3d')]({},_0x1e1786,_0x57bf90[_0x0ee7('0x4e')]);return _0x15aceb[_0x0ee7('0x4f')](_0x1e1786);}})[_0x0ee7('0x24')](function(_0x1b8e21){if(_0x1b8e21){_0x32c344=_0x1b8e21['length'];if(!_0x57bf90[_0x0ee7('0x32')][_0x0ee7('0x38')](_0x0ee7('0x39'))){_0x1e1786[_0x0ee7('0x1e')]=qs['limit'](_0x57bf90[_0x0ee7('0x32')][_0x0ee7('0x1e')]);_0x1e1786[_0x0ee7('0x1c')]=qs[_0x0ee7('0x1c')](_0x57bf90[_0x0ee7('0x32')][_0x0ee7('0x1c')]);}return _0x15aceb[_0x0ee7('0x4f')](_0x1e1786);}})['then'](function(_0x39d1ae){if(_0x39d1ae){return _0x39d1ae?{'count':_0x32c344,'rows':_0x39d1ae}:null;}})['then'](respondWithResult(_0x34a0bf,null))['catch'](handleError(_0x34a0bf,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index e756afa..9dce79d 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2a2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash'];(function(_0x3e9df8,_0xce65d6){var _0x43ea8e=function(_0x59699b){while(--_0x59699b){_0x3e9df8['push'](_0x3e9df8['shift']());}};_0x43ea8e(++_0xce65d6);}(_0xb2a2,0x11f));var _0x2b2a=function(_0x2e36fc,_0x333b56){_0x2e36fc=_0x2e36fc-0x0;var _0x3b1eef=_0xb2a2[_0x2e36fc];return _0x3b1eef;};'use strict';var _=require(_0x2b2a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2b2a('0x1'));var moment=require(_0x2b2a('0x2'));var BPromise=require(_0x2b2a('0x3'));var rp=require(_0x2b2a('0x4'));var fs=require('fs');var path=require(_0x2b2a('0x5'));var rimraf=require(_0x2b2a('0x6'));var config=require(_0x2b2a('0x7'));var attributes=require(_0x2b2a('0x8'));module[_0x2b2a('0x9')]=function(_0x277d09,_0x214547){return _0x277d09['define'](_0x2b2a('0xa'),attributes,{'tableName':_0x2b2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e70=['moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','api'];(function(_0xf1fc14,_0x44fbf4){var _0x15ea3c=function(_0x54e375){while(--_0x54e375){_0xf1fc14['push'](_0xf1fc14['shift']());}};_0x15ea3c(++_0x44fbf4);}(_0x1e70,0x1cc));var _0x01e7=function(_0x510b26,_0x5d979c){_0x510b26=_0x510b26-0x0;var _0x5764cb=_0x1e70[_0x510b26];return _0x5764cb;};'use strict';var _=require(_0x01e7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x01e7('0x1'));var moment=require(_0x01e7('0x2'));var BPromise=require(_0x01e7('0x3'));var rp=require(_0x01e7('0x4'));var fs=require('fs');var path=require(_0x01e7('0x5'));var rimraf=require(_0x01e7('0x6'));var config=require('../../config/environment');var attributes=require(_0x01e7('0x7'));module[_0x01e7('0x8')]=function(_0x951c8b,_0x199ec1){return _0x951c8b[_0x01e7('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x01e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 04220cf..4a36330 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5377=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4c49e6,_0x331830){var _0x39108d=function(_0x2f91e0){while(--_0x2f91e0){_0x4c49e6['push'](_0x4c49e6['shift']());}};_0x39108d(++_0x331830);}(_0x5377,0xa8));var _0x7537=function(_0x1a98fc,_0x5576ec){_0x1a98fc=_0x1a98fc-0x0;var _0x4ecdda=_0x5377[_0x1a98fc];return _0x4ecdda;};'use strict';var _=require('lodash');var util=require(_0x7537('0x0'));var moment=require(_0x7537('0x1'));var BPromise=require(_0x7537('0x2'));var rs=require(_0x7537('0x3'));var fs=require('fs');var Redis=require(_0x7537('0x4'));var db=require(_0x7537('0x5'))['db'];var utils=require(_0x7537('0x6'));var logger=require(_0x7537('0x7'))(_0x7537('0x8'));var config=require(_0x7537('0x9'));var jayson=require(_0x7537('0xa'));var client=jayson[_0x7537('0xb')][_0x7537('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29f638,_0x82572c,_0x1d345b){return new BPromise(function(_0x37980b,_0xfccf37){return client[_0x7537('0xd')](_0x29f638,_0x1d345b)[_0x7537('0xe')](function(_0x179e4e){logger[_0x7537('0xf')](_0x7537('0x10'),_0x82572c,_0x7537('0x11'));logger[_0x7537('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x82572c,_0x7537('0x11'),JSON['stringify'](_0x179e4e));if(_0x179e4e[_0x7537('0x13')]){if(_0x179e4e[_0x7537('0x13')][_0x7537('0x14')]===0x1f4){logger[_0x7537('0x13')](_0x7537('0x10'),_0x82572c,_0x179e4e[_0x7537('0x13')]['message']);return _0xfccf37(_0x179e4e['error'][_0x7537('0x15')]);}logger[_0x7537('0x13')](_0x7537('0x10'),_0x82572c,_0x179e4e['error'][_0x7537('0x15')]);return _0x37980b(_0x179e4e[_0x7537('0x13')][_0x7537('0x15')]);}else{logger[_0x7537('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x82572c,_0x7537('0x11'));_0x37980b(_0x179e4e[_0x7537('0x16')][_0x7537('0x15')]);}})['catch'](function(_0x172bdb){logger[_0x7537('0x13')](_0x7537('0x10'),_0x82572c,_0x172bdb);_0xfccf37(_0x172bdb);});});} \ No newline at end of file +var _0x28f5=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x28f5,0x19e));var _0x528f=function(_0x2480bd,_0xef1afe){_0x2480bd=_0x2480bd-0x0;var _0x810335=_0x28f5[_0x2480bd];return _0x810335;};'use strict';var _=require('lodash');var util=require(_0x528f('0x0'));var moment=require(_0x528f('0x1'));var BPromise=require(_0x528f('0x2'));var rs=require(_0x528f('0x3'));var fs=require('fs');var Redis=require(_0x528f('0x4'));var db=require(_0x528f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x528f('0x6'))(_0x528f('0x7'));var config=require(_0x528f('0x8'));var jayson=require(_0x528f('0x9'));var client=jayson[_0x528f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d02db,_0x13c423,_0x4705b4){return new BPromise(function(_0xb0aeac,_0x3e9fbf){return client[_0x528f('0xb')](_0x1d02db,_0x4705b4)[_0x528f('0xc')](function(_0x590526){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x13c423,'request\x20sent');logger[_0x528f('0xd')](_0x528f('0xe'),_0x13c423,'request\x20sent',JSON[_0x528f('0xf')](_0x590526));if(_0x590526[_0x528f('0x10')]){if(_0x590526[_0x528f('0x10')][_0x528f('0x11')]===0x1f4){logger[_0x528f('0x10')](_0x528f('0x12'),_0x13c423,_0x590526['error'][_0x528f('0x13')]);return _0x3e9fbf(_0x590526['error'][_0x528f('0x13')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x13c423,_0x590526[_0x528f('0x10')][_0x528f('0x13')]);return _0xb0aeac(_0x590526['error']['message']);}else{logger['info'](_0x528f('0x12'),_0x13c423,_0x528f('0x14'));_0xb0aeac(_0x590526[_0x528f('0x15')]['message']);}})[_0x528f('0x16')](function(_0x462bd9){logger[_0x528f('0x10')](_0x528f('0x12'),_0x13c423,_0x462bd9);_0x3e9fbf(_0x462bd9);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 19a9c55..e324b71 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0506=['exports','multer','util','path','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy'];(function(_0x5d1822,_0x5eed62){var _0x9b2fee=function(_0x352c14){while(--_0x352c14){_0x5d1822['push'](_0x5d1822['shift']());}};_0x9b2fee(++_0x5eed62);}(_0x0506,0x1d1));var _0x6050=function(_0x5bff1c,_0x3ae1f4){_0x5bff1c=_0x5bff1c-0x0;var _0x2e7b91=_0x0506[_0x5bff1c];return _0x2e7b91;};'use strict';var multer=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var path=require(_0x6050('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6050('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6050('0x4'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x6050('0x5')](),controller[_0x6050('0x6')]);router[_0x6050('0x7')](_0x6050('0x8'),auth[_0x6050('0x5')](),controller[_0x6050('0x9')]);router[_0x6050('0xa')]('/',auth[_0x6050('0x5')](),controller['create']);router[_0x6050('0xb')]('/:id',auth[_0x6050('0x5')](),controller[_0x6050('0xc')]);router[_0x6050('0xd')](_0x6050('0x8'),auth[_0x6050('0x5')](),controller[_0x6050('0xe')]);module[_0x6050('0xf')]=router; \ No newline at end of file +var _0x84ab=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','/:id','show','post','create','isAuthenticated','update','destroy','exports','multer','util','path'];(function(_0x12c0ef,_0x1331cd){var _0x4c0a22=function(_0x5736a6){while(--_0x5736a6){_0x12c0ef['push'](_0x12c0ef['shift']());}};_0x4c0a22(++_0x1331cd);}(_0x84ab,0x12f));var _0xb84a=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0x84ab[_0x3207aa];return _0x51758f;};'use strict';var multer=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var path=require(_0xb84a('0x2'));var timeout=require(_0xb84a('0x3'));var express=require(_0xb84a('0x4'));var router=express['Router']();var fs_extra=require(_0xb84a('0x5'));var auth=require(_0xb84a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb84a('0x7'));var controller=require(_0xb84a('0x8'));router[_0xb84a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb84a('0xa'),auth['isAuthenticated'](),controller[_0xb84a('0xb')]);router[_0xb84a('0xc')]('/',auth['isAuthenticated'](),controller[_0xb84a('0xd')]);router['put'](_0xb84a('0xa'),auth[_0xb84a('0xe')](),controller[_0xb84a('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb84a('0x10')]);module[_0xb84a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 86c9eac..763bae8 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f6c=['BOOLEAN','exports','ENUM','string','variable','picklist','STRING','customVariable'];(function(_0x54b13d,_0x1b64ce){var _0x39dee4=function(_0x2caf68){while(--_0x2caf68){_0x54b13d['push'](_0x54b13d['shift']());}};_0x39dee4(++_0x1b64ce);}(_0x3f6c,0xd1));var _0xc3f6=function(_0x25feae,_0x739aa3){_0x25feae=_0x25feae-0x0;var _0x26d855=_0x3f6c[_0x25feae];return _0x26d855;};'use strict';var Sequelize=require('sequelize');module[_0xc3f6('0x0')]={'type':{'type':Sequelize[_0xc3f6('0x1')](_0xc3f6('0x2'),_0xc3f6('0x3'),'customVariable','keyValue',_0xc3f6('0x4')),'defaultValue':_0xc3f6('0x2')},'content':{'type':Sequelize[_0xc3f6('0x5')]},'key':{'type':Sequelize[_0xc3f6('0x5')]},'keyType':{'type':Sequelize[_0xc3f6('0x1')](_0xc3f6('0x2'),_0xc3f6('0x3'),_0xc3f6('0x6'))},'keyContent':{'type':Sequelize[_0xc3f6('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc3f6('0x5')]},'customField':{'type':Sequelize[_0xc3f6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc3f6('0x5')]}}; \ No newline at end of file +var _0xa2f8=['ENUM','variable','customVariable','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x1ef7d8,_0x4324a3){var _0x922e0=function(_0x4772a5){while(--_0x4772a5){_0x1ef7d8['push'](_0x1ef7d8['shift']());}};_0x922e0(++_0x4324a3);}(_0xa2f8,0x11e));var _0x8a2f=function(_0x44b2f2,_0x5cfe50){_0x44b2f2=_0x44b2f2-0x0;var _0xb1f1c4=_0xa2f8[_0x44b2f2];return _0xb1f1c4;};'use strict';var Sequelize=require(_0x8a2f('0x0'));module[_0x8a2f('0x1')]={'type':{'type':Sequelize[_0x8a2f('0x2')]('string',_0x8a2f('0x3'),_0x8a2f('0x4'),'keyValue','picklist'),'defaultValue':_0x8a2f('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8a2f('0x6')]},'keyType':{'type':Sequelize[_0x8a2f('0x2')](_0x8a2f('0x5'),_0x8a2f('0x3'),_0x8a2f('0x4'))},'keyContent':{'type':Sequelize[_0x8a2f('0x6')]},'idField':{'type':Sequelize[_0x8a2f('0x6')]},'nameField':{'type':Sequelize[_0x8a2f('0x6')]},'customField':{'type':Sequelize[_0x8a2f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a2f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 2f767c8..89f0305 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1655=['then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','options','FreshsalesField','include','rows','catch','show','includeAll','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save'];(function(_0x2ccbaf,_0x4a1c53){var _0x53a810=function(_0x589c07){while(--_0x589c07){_0x2ccbaf['push'](_0x2ccbaf['shift']());}};_0x53a810(++_0x4a1c53);}(_0x1655,0x1e2));var _0x5165=function(_0x3bcc61,_0x18e003){_0x3bcc61=_0x3bcc61-0x0;var _0x156cd8=_0x1655[_0x3bcc61];return _0x156cd8;};'use strict';var emlformat=require(_0x5165('0x0'));var rimraf=require(_0x5165('0x1'));var zipdir=require(_0x5165('0x2'));var jsonpatch=require(_0x5165('0x3'));var rp=require(_0x5165('0x4'));var moment=require(_0x5165('0x5'));var BPromise=require(_0x5165('0x6'));var Mustache=require(_0x5165('0x7'));var util=require(_0x5165('0x8'));var path=require('path');var sox=require(_0x5165('0x9'));var csv=require(_0x5165('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5165('0xb'));var _=require(_0x5165('0xc'));var squel=require(_0x5165('0xd'));var crypto=require(_0x5165('0xe'));var jsforce=require(_0x5165('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5165('0xa'));var querystring=require(_0x5165('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5165('0x11'));var qs=require(_0x5165('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5165('0x13'));var logger=require(_0x5165('0x14'))('api');var utils=require(_0x5165('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5165('0x16'));var db=require(_0x5165('0x17'))['db'];function respondWithStatusCode(_0xe78bd9,_0x1893c9){_0x1893c9=_0x1893c9||0xcc;return function(_0x5a400c){if(_0x5a400c){return _0xe78bd9[_0x5165('0x18')](_0x1893c9);}return _0xe78bd9[_0x5165('0x19')](_0x1893c9)[_0x5165('0x1a')]();};}function respondWithResult(_0x355c31,_0xef9385){_0xef9385=_0xef9385||0xc8;return function(_0x3326a4){if(_0x3326a4){return _0x355c31['status'](_0xef9385)['json'](_0x3326a4);}};}function respondWithFilteredResult(_0x34cc04,_0x38717e){return function(_0x1c5864){if(_0x1c5864){var _0x5f4638=typeof _0x38717e['offset']===_0x5165('0x1b')&&typeof _0x38717e['limit']===_0x5165('0x1b');var _0x172cb7=_0x1c5864[_0x5165('0x1c')];var _0x178061=_0x5f4638?0x0:_0x38717e[_0x5165('0x1d')];var _0x8f4e86=_0x5f4638?_0x1c5864['count']:_0x38717e[_0x5165('0x1d')]+_0x38717e[_0x5165('0x1e')];var _0x1b20f3;if(_0x8f4e86>=_0x172cb7){_0x8f4e86=_0x172cb7;_0x1b20f3=0xc8;}else{_0x1b20f3=0xce;}_0x34cc04['status'](_0x1b20f3);return _0x34cc04[_0x5165('0x1f')](_0x5165('0x20'),_0x178061+'-'+_0x8f4e86+'/'+_0x172cb7)[_0x5165('0x21')](_0x1c5864);}return null;};}function patchUpdates(_0x518ae9){return function(_0x463592){try{jsonpatch[_0x5165('0x22')](_0x463592,_0x518ae9,!![]);}catch(_0x228981){return BPromise['reject'](_0x228981);}return _0x463592[_0x5165('0x23')]();};}function saveUpdates(_0x4b3a79,_0x1bc1fd){return function(_0xd0204b){if(_0xd0204b){return _0xd0204b['update'](_0x4b3a79)[_0x5165('0x24')](function(_0x251afc){return _0x251afc;});}return null;};}function removeEntity(_0x206b3d,_0x3e594d){return function(_0x4af632){if(_0x4af632){return _0x4af632[_0x5165('0x25')]()[_0x5165('0x24')](function(){_0x206b3d[_0x5165('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x249ed9,_0x47a178){return function(_0x5334b1){if(!_0x5334b1){_0x249ed9[_0x5165('0x18')](0x194);}return _0x5334b1;};}function handleError(_0x1cb369,_0x1fdd30){_0x1fdd30=_0x1fdd30||0x1f4;return function(_0x1d1eec){logger[_0x5165('0x26')](_0x1d1eec[_0x5165('0x27')]);if(_0x1d1eec[_0x5165('0x28')]){delete _0x1d1eec[_0x5165('0x28')];}_0x1cb369[_0x5165('0x19')](_0x1fdd30)[_0x5165('0x29')](_0x1d1eec);};}exports[_0x5165('0x2a')]=function(_0x1e4c7a,_0x5eb1c5){var _0x17d9ca={},_0x46e5a0={},_0x42d415={'count':0x0,'rows':[]};var _0x2f5cda=_[_0x5165('0x2b')](db['FreshsalesField'][_0x5165('0x2c')],function(_0x45ca7b){return{'name':_0x45ca7b[_0x5165('0x2d')],'type':_0x45ca7b[_0x5165('0x2e')][_0x5165('0x2f')]};});_0x46e5a0[_0x5165('0x30')]=_[_0x5165('0x2b')](_0x2f5cda,'name');_0x46e5a0[_0x5165('0x31')]=_[_0x5165('0x32')](_0x1e4c7a['query']);_0x46e5a0[_0x5165('0x33')]=_[_0x5165('0x34')](_0x46e5a0[_0x5165('0x30')],_0x46e5a0['query']);_0x17d9ca[_0x5165('0x35')]=_[_0x5165('0x34')](_0x46e5a0[_0x5165('0x30')],qs[_0x5165('0x36')](_0x1e4c7a[_0x5165('0x31')][_0x5165('0x36')]));_0x17d9ca['attributes']=_0x17d9ca[_0x5165('0x35')][_0x5165('0x37')]?_0x17d9ca[_0x5165('0x35')]:_0x46e5a0['model'];if(!_0x1e4c7a[_0x5165('0x31')]['hasOwnProperty']('nolimit')){_0x17d9ca[_0x5165('0x1e')]=qs['limit'](_0x1e4c7a[_0x5165('0x31')][_0x5165('0x1e')]);_0x17d9ca[_0x5165('0x1d')]=qs[_0x5165('0x1d')](_0x1e4c7a[_0x5165('0x31')][_0x5165('0x1d')]);}_0x17d9ca[_0x5165('0x38')]=qs[_0x5165('0x39')](_0x1e4c7a[_0x5165('0x31')][_0x5165('0x39')]);_0x17d9ca['where']=qs[_0x5165('0x33')](_['pick'](_0x1e4c7a[_0x5165('0x31')],_0x46e5a0[_0x5165('0x33')]),_0x2f5cda);if(_0x1e4c7a[_0x5165('0x31')][_0x5165('0x3a')]){_0x17d9ca[_0x5165('0x3b')]=_[_0x5165('0x3c')](_0x17d9ca[_0x5165('0x3b')],{'$or':_[_0x5165('0x2b')](_0x2f5cda,function(_0x58f77f){if(_0x58f77f[_0x5165('0x2e')]!==_0x5165('0x3d')){var _0xb8186b={};_0xb8186b[_0x58f77f['name']]={'$like':'%'+_0x1e4c7a[_0x5165('0x31')][_0x5165('0x3a')]+'%'};return _0xb8186b;}})});}_0x17d9ca=_[_0x5165('0x3c')]({},_0x17d9ca,_0x1e4c7a[_0x5165('0x3e')]);var _0x43d661={'where':_0x17d9ca[_0x5165('0x3b')]};return db[_0x5165('0x3f')][_0x5165('0x1c')](_0x43d661)[_0x5165('0x24')](function(_0xdb0979){_0x42d415[_0x5165('0x1c')]=_0xdb0979;if(_0x1e4c7a[_0x5165('0x31')]['includeAll']){_0x17d9ca[_0x5165('0x40')]=[{'all':!![]}];}return db[_0x5165('0x3f')]['findAll'](_0x17d9ca);})[_0x5165('0x24')](function(_0x5b30fd){_0x42d415[_0x5165('0x41')]=_0x5b30fd;return _0x42d415;})[_0x5165('0x24')](respondWithFilteredResult(_0x5eb1c5,_0x17d9ca))[_0x5165('0x42')](handleError(_0x5eb1c5,null));};exports[_0x5165('0x43')]=function(_0x2aedec,_0x50c9de){var _0x6a2cae={'raw':!![],'where':{'id':_0x2aedec['params']['id']}},_0x3bd33b={};_0x3bd33b[_0x5165('0x30')]=_[_0x5165('0x32')](db[_0x5165('0x3f')]['rawAttributes']);_0x3bd33b[_0x5165('0x31')]=_[_0x5165('0x32')](_0x2aedec[_0x5165('0x31')]);_0x3bd33b[_0x5165('0x33')]=_[_0x5165('0x34')](_0x3bd33b[_0x5165('0x30')],_0x3bd33b[_0x5165('0x31')]);_0x6a2cae['attributes']=_[_0x5165('0x34')](_0x3bd33b['model'],qs[_0x5165('0x36')](_0x2aedec[_0x5165('0x31')][_0x5165('0x36')]));_0x6a2cae[_0x5165('0x35')]=_0x6a2cae[_0x5165('0x35')][_0x5165('0x37')]?_0x6a2cae[_0x5165('0x35')]:_0x3bd33b['model'];if(_0x2aedec['query'][_0x5165('0x44')]){_0x6a2cae[_0x5165('0x40')]=[{'all':!![]}];}_0x6a2cae=_[_0x5165('0x3c')]({},_0x6a2cae,_0x2aedec[_0x5165('0x3e')]);return db[_0x5165('0x3f')][_0x5165('0x45')](_0x6a2cae)[_0x5165('0x24')](handleEntityNotFound(_0x50c9de,null))[_0x5165('0x24')](respondWithResult(_0x50c9de,null))['catch'](handleError(_0x50c9de,null));};exports[_0x5165('0x46')]=function(_0x45bb00,_0x4e77ae){return db[_0x5165('0x3f')][_0x5165('0x46')](_0x45bb00[_0x5165('0x47')],{})[_0x5165('0x24')](respondWithResult(_0x4e77ae,0xc9))['catch'](handleError(_0x4e77ae,null));};exports[_0x5165('0x48')]=function(_0x162c54,_0x59afa5){if(_0x162c54[_0x5165('0x47')]['id']){delete _0x162c54[_0x5165('0x47')]['id'];}return db[_0x5165('0x3f')][_0x5165('0x45')]({'where':{'id':_0x162c54[_0x5165('0x49')]['id']}})[_0x5165('0x24')](handleEntityNotFound(_0x59afa5,null))[_0x5165('0x24')](saveUpdates(_0x162c54[_0x5165('0x47')],null))['then'](respondWithResult(_0x59afa5,null))[_0x5165('0x42')](handleError(_0x59afa5,null));};exports[_0x5165('0x25')]=function(_0x341304,_0x8eb28e){return db['FreshsalesField'][_0x5165('0x45')]({'where':{'id':_0x341304[_0x5165('0x49')]['id']}})[_0x5165('0x24')](handleEntityNotFound(_0x8eb28e,null))[_0x5165('0x24')](removeEntity(_0x8eb28e,null))[_0x5165('0x42')](handleError(_0x8eb28e,null));}; \ No newline at end of file +var _0xd5c7=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd5c7,0x1c2));var _0x7d5c=function(_0x587e00,_0x59c8f3){_0x587e00=_0x587e00-0x0;var _0x27e587=_0xd5c7[_0x587e00];return _0x27e587;};'use strict';var emlformat=require(_0x7d5c('0x0'));var rimraf=require(_0x7d5c('0x1'));var zipdir=require(_0x7d5c('0x2'));var jsonpatch=require(_0x7d5c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7d5c('0x4'));var util=require(_0x7d5c('0x5'));var path=require('path');var sox=require(_0x7d5c('0x6'));var csv=require(_0x7d5c('0x7'));var ejs=require(_0x7d5c('0x8'));var fs=require('fs');var fs_extra=require(_0x7d5c('0x9'));var _=require(_0x7d5c('0xa'));var squel=require('squel');var crypto=require(_0x7d5c('0xb'));var jsforce=require(_0x7d5c('0xc'));var deskjs=require(_0x7d5c('0xd'));var toCsv=require(_0x7d5c('0x7'));var querystring=require(_0x7d5c('0xe'));var Papa=require(_0x7d5c('0xf'));var Redis=require(_0x7d5c('0x10'));var authService=require(_0x7d5c('0x11'));var qs=require(_0x7d5c('0x12'));var as=require(_0x7d5c('0x13'));var hardwareService=require(_0x7d5c('0x14'));var logger=require(_0x7d5c('0x15'))(_0x7d5c('0x16'));var utils=require(_0x7d5c('0x17'));var config=require(_0x7d5c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d5c('0x19'))['db'];function respondWithStatusCode(_0x447ca9,_0x5249b0){_0x5249b0=_0x5249b0||0xcc;return function(_0x13ee45){if(_0x13ee45){return _0x447ca9[_0x7d5c('0x1a')](_0x5249b0);}return _0x447ca9[_0x7d5c('0x1b')](_0x5249b0)[_0x7d5c('0x1c')]();};}function respondWithResult(_0x471a8d,_0x40e863){_0x40e863=_0x40e863||0xc8;return function(_0x354953){if(_0x354953){return _0x471a8d[_0x7d5c('0x1b')](_0x40e863)[_0x7d5c('0x1d')](_0x354953);}};}function respondWithFilteredResult(_0x43d5e0,_0x2507eb){return function(_0x2c79d0){if(_0x2c79d0){var _0x5da8fd=typeof _0x2507eb[_0x7d5c('0x1e')]===_0x7d5c('0x1f')&&typeof _0x2507eb[_0x7d5c('0x20')]===_0x7d5c('0x1f');var _0x16d836=_0x2c79d0[_0x7d5c('0x21')];var _0x10e896=_0x5da8fd?0x0:_0x2507eb['offset'];var _0x1100b4=_0x5da8fd?_0x2c79d0[_0x7d5c('0x21')]:_0x2507eb[_0x7d5c('0x1e')]+_0x2507eb[_0x7d5c('0x20')];var _0x2069e6;if(_0x1100b4>=_0x16d836){_0x1100b4=_0x16d836;_0x2069e6=0xc8;}else{_0x2069e6=0xce;}_0x43d5e0['status'](_0x2069e6);return _0x43d5e0[_0x7d5c('0x22')](_0x7d5c('0x23'),_0x10e896+'-'+_0x1100b4+'/'+_0x16d836)[_0x7d5c('0x1d')](_0x2c79d0);}return null;};}function patchUpdates(_0x5e1756){return function(_0x123a1e){try{jsonpatch[_0x7d5c('0x24')](_0x123a1e,_0x5e1756,!![]);}catch(_0xc6952){return BPromise[_0x7d5c('0x25')](_0xc6952);}return _0x123a1e[_0x7d5c('0x26')]();};}function saveUpdates(_0x4fd14a,_0xe26ea3){return function(_0x47f6ad){if(_0x47f6ad){return _0x47f6ad[_0x7d5c('0x27')](_0x4fd14a)[_0x7d5c('0x28')](function(_0x7517cd){return _0x7517cd;});}return null;};}function removeEntity(_0xc86d78,_0x8a8461){return function(_0x1a8aff){if(_0x1a8aff){return _0x1a8aff[_0x7d5c('0x29')]()[_0x7d5c('0x28')](function(){_0xc86d78['status'](0xcc)[_0x7d5c('0x1c')]();});}};}function handleEntityNotFound(_0x9cf6bf,_0x57338c){return function(_0x37c855){if(!_0x37c855){_0x9cf6bf[_0x7d5c('0x1a')](0x194);}return _0x37c855;};}function handleError(_0x5476a3,_0xe13f6a){_0xe13f6a=_0xe13f6a||0x1f4;return function(_0x5dc259){logger[_0x7d5c('0x2a')](_0x5dc259['stack']);if(_0x5dc259[_0x7d5c('0x2b')]){delete _0x5dc259['name'];}_0x5476a3[_0x7d5c('0x1b')](_0xe13f6a)['send'](_0x5dc259);};}exports[_0x7d5c('0x2c')]=function(_0xcd4217,_0xbd3b43){var _0x545176={},_0x4b6b74={},_0x799d72={'count':0x0,'rows':[]};var _0xfc3a50=_[_0x7d5c('0x2d')](db[_0x7d5c('0x2e')][_0x7d5c('0x2f')],function(_0x21549e){return{'name':_0x21549e[_0x7d5c('0x30')],'type':_0x21549e[_0x7d5c('0x31')][_0x7d5c('0x32')]};});_0x4b6b74[_0x7d5c('0x33')]=_[_0x7d5c('0x2d')](_0xfc3a50,'name');_0x4b6b74[_0x7d5c('0x34')]=_['keys'](_0xcd4217[_0x7d5c('0x34')]);_0x4b6b74[_0x7d5c('0x35')]=_[_0x7d5c('0x36')](_0x4b6b74['model'],_0x4b6b74['query']);_0x545176[_0x7d5c('0x37')]=_['intersection'](_0x4b6b74[_0x7d5c('0x33')],qs[_0x7d5c('0x38')](_0xcd4217['query'][_0x7d5c('0x38')]));_0x545176['attributes']=_0x545176[_0x7d5c('0x37')][_0x7d5c('0x39')]?_0x545176['attributes']:_0x4b6b74['model'];if(!_0xcd4217[_0x7d5c('0x34')]['hasOwnProperty'](_0x7d5c('0x3a'))){_0x545176[_0x7d5c('0x20')]=qs[_0x7d5c('0x20')](_0xcd4217[_0x7d5c('0x34')][_0x7d5c('0x20')]);_0x545176[_0x7d5c('0x1e')]=qs[_0x7d5c('0x1e')](_0xcd4217[_0x7d5c('0x34')][_0x7d5c('0x1e')]);}_0x545176[_0x7d5c('0x3b')]=qs[_0x7d5c('0x3c')](_0xcd4217[_0x7d5c('0x34')]['sort']);_0x545176[_0x7d5c('0x3d')]=qs[_0x7d5c('0x35')](_[_0x7d5c('0x3e')](_0xcd4217[_0x7d5c('0x34')],_0x4b6b74[_0x7d5c('0x35')]),_0xfc3a50);if(_0xcd4217[_0x7d5c('0x34')][_0x7d5c('0x3f')]){_0x545176[_0x7d5c('0x3d')]=_[_0x7d5c('0x40')](_0x545176['where'],{'$or':_['map'](_0xfc3a50,function(_0x2991f5){if(_0x2991f5[_0x7d5c('0x31')]!==_0x7d5c('0x41')){var _0x533736={};_0x533736[_0x2991f5[_0x7d5c('0x2b')]]={'$like':'%'+_0xcd4217[_0x7d5c('0x34')][_0x7d5c('0x3f')]+'%'};return _0x533736;}})});}_0x545176=_[_0x7d5c('0x40')]({},_0x545176,_0xcd4217['options']);var _0x178c3d={'where':_0x545176[_0x7d5c('0x3d')]};return db[_0x7d5c('0x2e')]['count'](_0x178c3d)[_0x7d5c('0x28')](function(_0xe7c751){_0x799d72[_0x7d5c('0x21')]=_0xe7c751;if(_0xcd4217[_0x7d5c('0x34')][_0x7d5c('0x42')]){_0x545176[_0x7d5c('0x43')]=[{'all':!![]}];}return db[_0x7d5c('0x2e')][_0x7d5c('0x44')](_0x545176);})[_0x7d5c('0x28')](function(_0x14854c){_0x799d72[_0x7d5c('0x45')]=_0x14854c;return _0x799d72;})[_0x7d5c('0x28')](respondWithFilteredResult(_0xbd3b43,_0x545176))[_0x7d5c('0x46')](handleError(_0xbd3b43,null));};exports[_0x7d5c('0x47')]=function(_0x307de2,_0x125c86){var _0x2d3b8c={'raw':!![],'where':{'id':_0x307de2[_0x7d5c('0x48')]['id']}},_0x4bbc99={};_0x4bbc99[_0x7d5c('0x33')]=_[_0x7d5c('0x49')](db[_0x7d5c('0x2e')][_0x7d5c('0x2f')]);_0x4bbc99[_0x7d5c('0x34')]=_[_0x7d5c('0x49')](_0x307de2[_0x7d5c('0x34')]);_0x4bbc99[_0x7d5c('0x35')]=_[_0x7d5c('0x36')](_0x4bbc99['model'],_0x4bbc99[_0x7d5c('0x34')]);_0x2d3b8c[_0x7d5c('0x37')]=_[_0x7d5c('0x36')](_0x4bbc99['model'],qs[_0x7d5c('0x38')](_0x307de2[_0x7d5c('0x34')]['fields']));_0x2d3b8c['attributes']=_0x2d3b8c[_0x7d5c('0x37')][_0x7d5c('0x39')]?_0x2d3b8c[_0x7d5c('0x37')]:_0x4bbc99[_0x7d5c('0x33')];if(_0x307de2['query'][_0x7d5c('0x42')]){_0x2d3b8c[_0x7d5c('0x43')]=[{'all':!![]}];}_0x2d3b8c=_['merge']({},_0x2d3b8c,_0x307de2[_0x7d5c('0x4a')]);return db[_0x7d5c('0x2e')][_0x7d5c('0x4b')](_0x2d3b8c)[_0x7d5c('0x28')](handleEntityNotFound(_0x125c86,null))[_0x7d5c('0x28')](respondWithResult(_0x125c86,null))[_0x7d5c('0x46')](handleError(_0x125c86,null));};exports['create']=function(_0x236a50,_0x1953be){return db[_0x7d5c('0x2e')][_0x7d5c('0x4c')](_0x236a50[_0x7d5c('0x4d')],{})['then'](respondWithResult(_0x1953be,0xc9))['catch'](handleError(_0x1953be,null));};exports[_0x7d5c('0x27')]=function(_0x23cfa3,_0xc61dbe){if(_0x23cfa3[_0x7d5c('0x4d')]['id']){delete _0x23cfa3[_0x7d5c('0x4d')]['id'];}return db['FreshsalesField'][_0x7d5c('0x4b')]({'where':{'id':_0x23cfa3[_0x7d5c('0x48')]['id']}})['then'](handleEntityNotFound(_0xc61dbe,null))[_0x7d5c('0x28')](saveUpdates(_0x23cfa3[_0x7d5c('0x4d')],null))[_0x7d5c('0x28')](respondWithResult(_0xc61dbe,null))[_0x7d5c('0x46')](handleError(_0xc61dbe,null));};exports[_0x7d5c('0x29')]=function(_0x5d59ab,_0x5ee5b9){return db[_0x7d5c('0x2e')]['find']({'where':{'id':_0x5d59ab[_0x7d5c('0x48')]['id']}})[_0x7d5c('0x28')](handleEntityNotFound(_0x5ee5b9,null))['then'](removeEntity(_0x5ee5b9,null))[_0x7d5c('0x46')](handleError(_0x5ee5b9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 5d50ac2..5803e44 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4024=['moment','request-promise','rimraf','../../config/environment','define','int_freshsales_fields','FieldId','lodash','util','api'];(function(_0x3b1d82,_0x4c95b1){var _0x23bde6=function(_0x3868a3){while(--_0x3868a3){_0x3b1d82['push'](_0x3b1d82['shift']());}};_0x23bde6(++_0x4c95b1);}(_0x4024,0x89));var _0x4402=function(_0x26aa47,_0x4b60da){_0x26aa47=_0x26aa47-0x0;var _0xb4d7eb=_0x4024[_0x26aa47];return _0xb4d7eb;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var logger=require('../../config/logger')(_0x4402('0x2'));var moment=require(_0x4402('0x3'));var BPromise=require('bluebird');var rp=require(_0x4402('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x17699b,_0x346ddc){return _0x17699b[_0x4402('0x7')]('FreshsalesField',attributes,{'tableName':_0x4402('0x8'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0x4402('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x390a=['exports','define','FreshsalesField','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x390a,0xc9));var _0xa390=function(_0x5d6b96,_0x40cd35){_0x5d6b96=_0x5d6b96-0x0;var _0x5826b2=_0x390a[_0x5d6b96];return _0x5826b2;};'use strict';var _=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var logger=require(_0xa390('0x2'))(_0xa390('0x3'));var moment=require('moment');var BPromise=require(_0xa390('0x4'));var rp=require(_0xa390('0x5'));var fs=require('fs');var path=require(_0xa390('0x6'));var rimraf=require(_0xa390('0x7'));var config=require('../../config/environment');var attributes=require(_0xa390('0x8'));module[_0xa390('0x9')]=function(_0x3d7cd7,_0x4ac9f5){return _0x3d7cd7[_0xa390('0xa')](_0xa390('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xa390('0xc'),_0xa390('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 3e12355..1a40133 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d58=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x123d3d,_0x114ea5){var _0x5707bf=function(_0x9e1a39){while(--_0x9e1a39){_0x123d3d['push'](_0x123d3d['shift']());}};_0x5707bf(++_0x114ea5);}(_0x5d58,0x187));var _0x85d5=function(_0x154ee4,_0x344e79){_0x154ee4=_0x154ee4-0x0;var _0x50b682=_0x5d58[_0x154ee4];return _0x50b682;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46e7b4,_0x5f47ec,_0x98c963){return new BPromise(function(_0x3fecca,_0x4ca293){return client[_0x85d5('0x7')](_0x46e7b4,_0x98c963)['then'](function(_0x1098be){logger[_0x85d5('0x8')](_0x85d5('0x9'),_0x5f47ec,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x5f47ec,_0x85d5('0xa'),JSON[_0x85d5('0xb')](_0x1098be));if(_0x1098be[_0x85d5('0xc')]){if(_0x1098be[_0x85d5('0xc')][_0x85d5('0xd')]===0x1f4){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be['error']['message']);return _0x4ca293(_0x1098be['error'][_0x85d5('0xe')]);}logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);return _0x3fecca(_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);}else{logger['info'](_0x85d5('0x9'),_0x5f47ec,_0x85d5('0xa'));_0x3fecca(_0x1098be[_0x85d5('0xf')][_0x85d5('0xe')]);}})[_0x85d5('0x10')](function(_0x3dc83c){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x3dc83c);_0x4ca293(_0x3dc83c);});});} \ No newline at end of file +var _0x5d58=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x5d58,0x187));var _0x85d5=function(_0x5c174b,_0x1689c8){_0x5c174b=_0x5c174b-0x0;var _0x5318a3=_0x5d58[_0x5c174b];return _0x5318a3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46e7b4,_0x5f47ec,_0x98c963){return new BPromise(function(_0x3fecca,_0x4ca293){return client[_0x85d5('0x7')](_0x46e7b4,_0x98c963)['then'](function(_0x1098be){logger[_0x85d5('0x8')](_0x85d5('0x9'),_0x5f47ec,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x5f47ec,_0x85d5('0xa'),JSON[_0x85d5('0xb')](_0x1098be));if(_0x1098be[_0x85d5('0xc')]){if(_0x1098be[_0x85d5('0xc')][_0x85d5('0xd')]===0x1f4){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be['error']['message']);return _0x4ca293(_0x1098be['error'][_0x85d5('0xe')]);}logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);return _0x3fecca(_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);}else{logger['info'](_0x85d5('0x9'),_0x5f47ec,_0x85d5('0xa'));_0x3fecca(_0x1098be[_0x85d5('0xf')][_0x85d5('0xe')]);}})[_0x85d5('0x10')](function(_0x3dc83c){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x3dc83c);_0x4ca293(_0x3dc83c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index b5335e5..c53c63b 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2a342a,_0x315e2e){var _0x2d1e99=function(_0x58499a){while(--_0x58499a){_0x2a342a['push'](_0x2a342a['shift']());}};_0x2d1e99(++_0x315e2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x35a067,_0x26155a){var _0x553a46=function(_0x51f770){while(--_0x51f770){_0x35a067['push'](_0x35a067['shift']());}};_0x553a46(++_0x26155a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 2b69f5f..dcdb8bd 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f3c=['sequelize','exports','STRING','integrationTab','newTab'];(function(_0x1d6914,_0x2f6a85){var _0x511d10=function(_0x470e70){while(--_0x470e70){_0x1d6914['push'](_0x1d6914['shift']());}};_0x511d10(++_0x2f6a85);}(_0x1f3c,0xd7));var _0xc1f3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x1f3c[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0xc1f3('0x0'));module[_0xc1f3('0x1')]={'name':{'type':Sequelize[_0xc1f3('0x2')]},'description':{'type':Sequelize[_0xc1f3('0x2')]},'username':{'type':Sequelize[_0xc1f3('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xc1f3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc1f3('0x3'),_0xc1f3('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x7d37=['sequelize','exports','STRING','username','integrationTab'];(function(_0x27d150,_0xacfba9){var _0x166eda=function(_0x3af888){while(--_0x3af888){_0x27d150['push'](_0x27d150['shift']());}};_0x166eda(++_0xacfba9);}(_0x7d37,0x1db));var _0x77d3=function(_0x56b2c6,_0x19d463){_0x56b2c6=_0x56b2c6-0x0;var _0x32b133=_0x7d37[_0x56b2c6];return _0x32b133;};'use strict';var Sequelize=require(_0x77d3('0x0'));module[_0x77d3('0x1')]={'name':{'type':Sequelize[_0x77d3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x77d3('0x2')],'unique':_0x77d3('0x3')},'remoteUri':{'type':Sequelize[_0x77d3('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x77d3('0x2')]},'clientSecret':{'type':Sequelize[_0x77d3('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x77d3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x77d3('0x4'),'newTab'),'defaultValue':_0x77d3('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index ac14365..f50bc02 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xead0=['body','update','findOne','options','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceConfiguration','SalesforceField','getFields','remoteUri','clientId','username','securityToken','slice','substring','Connection','clientSecret','password','concat','isNil','ticketType','describe','OwnerId','IsRecurrence','Subject','Description','string','int','picklist','email','textarea','phone','remove','includes','custom','picklistValues','value','boolean','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','SalesforceAccount','fieldName','type','model','keys','filters','intersection','attributes','fields','query','nolimit','order','sort','where','pick','filter','merge','include','rows','catch','show','params','rawAttributes','length','includeAll','find','create'];(function(_0x28edc8,_0x24d55a){var _0x3796a8=function(_0x5eba5f){while(--_0x5eba5f){_0x28edc8['push'](_0x28edc8['shift']());}};_0x3796a8(++_0x24d55a);}(_0xead0,0x123));var _0x0ead=function(_0x29bb0a,_0x4a49e6){_0x29bb0a=_0x29bb0a-0x0;var _0x1725e4=_0xead0[_0x29bb0a];return _0x1725e4;};'use strict';var emlformat=require(_0x0ead('0x0'));var rimraf=require(_0x0ead('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ead('0x2'));var rp=require('request-promise');var moment=require(_0x0ead('0x3'));var BPromise=require(_0x0ead('0x4'));var Mustache=require('mustache');var util=require(_0x0ead('0x5'));var path=require(_0x0ead('0x6'));var sox=require(_0x0ead('0x7'));var csv=require(_0x0ead('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ead('0x9'));var _=require(_0x0ead('0xa'));var squel=require('squel');var crypto=require(_0x0ead('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0ead('0xc'));var toCsv=require(_0x0ead('0x8'));var querystring=require(_0x0ead('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0ead('0xe'));var qs=require(_0x0ead('0xf'));var as=require(_0x0ead('0x10'));var hardwareService=require(_0x0ead('0x11'));var logger=require(_0x0ead('0x12'))(_0x0ead('0x13'));var utils=require(_0x0ead('0x14'));var config=require(_0x0ead('0x15'));var licenseUtil=require(_0x0ead('0x16'));var db=require(_0x0ead('0x17'))['db'];var integrations=require(_0x0ead('0x18'));function respondWithStatusCode(_0x512a56,_0x189d0f){_0x189d0f=_0x189d0f||0xcc;return function(_0x5f3db8){if(_0x5f3db8){return _0x512a56[_0x0ead('0x19')](_0x189d0f);}return _0x512a56[_0x0ead('0x1a')](_0x189d0f)[_0x0ead('0x1b')]();};}function respondWithResult(_0x4f54c1,_0x215e28){_0x215e28=_0x215e28||0xc8;return function(_0x577f3e){if(_0x577f3e){return _0x4f54c1[_0x0ead('0x1a')](_0x215e28)['json'](_0x577f3e);}};}function respondWithFilteredResult(_0xf9edd9,_0x30dd83){return function(_0x1a65a6){if(_0x1a65a6){var _0x18970a=typeof _0x30dd83['offset']===_0x0ead('0x1c')&&typeof _0x30dd83['limit']===_0x0ead('0x1c');var _0x2584c8=_0x1a65a6[_0x0ead('0x1d')];var _0x1af496=_0x18970a?0x0:_0x30dd83['offset'];var _0x3b197b=_0x18970a?_0x1a65a6[_0x0ead('0x1d')]:_0x30dd83[_0x0ead('0x1e')]+_0x30dd83[_0x0ead('0x1f')];var _0xaf93c5;if(_0x3b197b>=_0x2584c8){_0x3b197b=_0x2584c8;_0xaf93c5=0xc8;}else{_0xaf93c5=0xce;}_0xf9edd9['status'](_0xaf93c5);return _0xf9edd9[_0x0ead('0x20')](_0x0ead('0x21'),_0x1af496+'-'+_0x3b197b+'/'+_0x2584c8)[_0x0ead('0x22')](_0x1a65a6);}return null;};}function patchUpdates(_0x38ce58){return function(_0x57a4cc){try{jsonpatch[_0x0ead('0x23')](_0x57a4cc,_0x38ce58,!![]);}catch(_0x4fbce4){return BPromise[_0x0ead('0x24')](_0x4fbce4);}return _0x57a4cc[_0x0ead('0x25')]();};}function saveUpdates(_0x567885,_0x4b4d35){return function(_0x117f59){if(_0x117f59){return _0x117f59['update'](_0x567885)[_0x0ead('0x26')](function(_0x2c8f09){return _0x2c8f09;});}return null;};}function removeEntity(_0x5e9b59,_0x28e527){return function(_0x3017e8){if(_0x3017e8){return _0x3017e8[_0x0ead('0x27')]()['then'](function(){_0x5e9b59[_0x0ead('0x1a')](0xcc)[_0x0ead('0x1b')]();});}};}function handleEntityNotFound(_0x4b2d26,_0xfe4c84){return function(_0x4009df){if(!_0x4009df){_0x4b2d26[_0x0ead('0x19')](0x194);}return _0x4009df;};}function handleError(_0x46657d,_0x134012){_0x134012=_0x134012||0x1f4;return function(_0xff80a5){logger[_0x0ead('0x28')](_0xff80a5[_0x0ead('0x29')]);if(_0xff80a5['name']){delete _0xff80a5[_0x0ead('0x2a')];}_0x46657d[_0x0ead('0x1a')](_0x134012)[_0x0ead('0x2b')](_0xff80a5);};}exports['index']=function(_0x5963e3,_0x5c7d13){var _0xcf351e={},_0x27bd6f={},_0x4120be={'count':0x0,'rows':[]};var _0x121bd1=_[_0x0ead('0x2c')](db[_0x0ead('0x2d')]['rawAttributes'],function(_0x3a383d){return{'name':_0x3a383d[_0x0ead('0x2e')],'type':_0x3a383d[_0x0ead('0x2f')]['key']};});_0x27bd6f[_0x0ead('0x30')]=_[_0x0ead('0x2c')](_0x121bd1,_0x0ead('0x2a'));_0x27bd6f['query']=_[_0x0ead('0x31')](_0x5963e3['query']);_0x27bd6f[_0x0ead('0x32')]=_[_0x0ead('0x33')](_0x27bd6f[_0x0ead('0x30')],_0x27bd6f['query']);_0xcf351e[_0x0ead('0x34')]=_['intersection'](_0x27bd6f['model'],qs[_0x0ead('0x35')](_0x5963e3['query'][_0x0ead('0x35')]));_0xcf351e['attributes']=_0xcf351e[_0x0ead('0x34')]['length']?_0xcf351e['attributes']:_0x27bd6f['model'];if(!_0x5963e3[_0x0ead('0x36')]['hasOwnProperty'](_0x0ead('0x37'))){_0xcf351e[_0x0ead('0x1f')]=qs['limit'](_0x5963e3[_0x0ead('0x36')][_0x0ead('0x1f')]);_0xcf351e['offset']=qs[_0x0ead('0x1e')](_0x5963e3[_0x0ead('0x36')][_0x0ead('0x1e')]);}_0xcf351e[_0x0ead('0x38')]=qs[_0x0ead('0x39')](_0x5963e3[_0x0ead('0x36')][_0x0ead('0x39')]);_0xcf351e[_0x0ead('0x3a')]=qs[_0x0ead('0x32')](_[_0x0ead('0x3b')](_0x5963e3[_0x0ead('0x36')],_0x27bd6f[_0x0ead('0x32')]),_0x121bd1);if(_0x5963e3['query'][_0x0ead('0x3c')]){_0xcf351e['where']=_[_0x0ead('0x3d')](_0xcf351e[_0x0ead('0x3a')],{'$or':_[_0x0ead('0x2c')](_0x121bd1,function(_0x248f68){if(_0x248f68[_0x0ead('0x2f')]!=='VIRTUAL'){var _0x1171c7={};_0x1171c7[_0x248f68[_0x0ead('0x2a')]]={'$like':'%'+_0x5963e3[_0x0ead('0x36')][_0x0ead('0x3c')]+'%'};return _0x1171c7;}})});}_0xcf351e=_[_0x0ead('0x3d')]({},_0xcf351e,_0x5963e3['options']);var _0x2d5d8d={'where':_0xcf351e[_0x0ead('0x3a')]};return db[_0x0ead('0x2d')][_0x0ead('0x1d')](_0x2d5d8d)['then'](function(_0x4f5f6f){_0x4120be[_0x0ead('0x1d')]=_0x4f5f6f;if(_0x5963e3[_0x0ead('0x36')]['includeAll']){_0xcf351e[_0x0ead('0x3e')]=[{'all':!![]}];}return db[_0x0ead('0x2d')]['findAll'](_0xcf351e);})[_0x0ead('0x26')](function(_0x41e1dc){_0x4120be[_0x0ead('0x3f')]=_0x41e1dc;return _0x4120be;})[_0x0ead('0x26')](respondWithFilteredResult(_0x5c7d13,_0xcf351e))[_0x0ead('0x40')](handleError(_0x5c7d13,null));};exports[_0x0ead('0x41')]=function(_0x4ef1a3,_0x1abb68){var _0x35afad={'raw':![],'where':{'id':_0x4ef1a3[_0x0ead('0x42')]['id']}},_0x5229d1={};_0x5229d1[_0x0ead('0x30')]=_['keys'](db[_0x0ead('0x2d')][_0x0ead('0x43')]);_0x5229d1[_0x0ead('0x36')]=_['keys'](_0x4ef1a3[_0x0ead('0x36')]);_0x5229d1['filters']=_[_0x0ead('0x33')](_0x5229d1[_0x0ead('0x30')],_0x5229d1[_0x0ead('0x36')]);_0x35afad['attributes']=_[_0x0ead('0x33')](_0x5229d1[_0x0ead('0x30')],qs['fields'](_0x4ef1a3[_0x0ead('0x36')][_0x0ead('0x35')]));_0x35afad[_0x0ead('0x34')]=_0x35afad[_0x0ead('0x34')][_0x0ead('0x44')]?_0x35afad['attributes']:_0x5229d1['model'];if(_0x4ef1a3[_0x0ead('0x36')][_0x0ead('0x45')]){_0x35afad['include']=[{'all':!![]}];}_0x35afad=_[_0x0ead('0x3d')]({},_0x35afad,_0x4ef1a3['options']);return db[_0x0ead('0x2d')][_0x0ead('0x46')](_0x35afad)['then'](handleEntityNotFound(_0x1abb68,null))[_0x0ead('0x26')](respondWithResult(_0x1abb68,null))[_0x0ead('0x40')](handleError(_0x1abb68,null));};exports[_0x0ead('0x47')]=function(_0x58477b,_0x2a5bff){return db[_0x0ead('0x2d')][_0x0ead('0x47')](_0x58477b[_0x0ead('0x48')],{})['then'](respondWithResult(_0x2a5bff,0xc9))[_0x0ead('0x40')](handleError(_0x2a5bff,null));};exports[_0x0ead('0x49')]=function(_0x497e26,_0x5f4f3c){if(_0x497e26[_0x0ead('0x48')]['id']){delete _0x497e26[_0x0ead('0x48')]['id'];}return db[_0x0ead('0x2d')][_0x0ead('0x46')]({'where':{'id':_0x497e26['params']['id']}})[_0x0ead('0x26')](handleEntityNotFound(_0x5f4f3c,null))[_0x0ead('0x26')](saveUpdates(_0x497e26['body'],null))[_0x0ead('0x26')](respondWithResult(_0x5f4f3c,null))[_0x0ead('0x40')](handleError(_0x5f4f3c,null));};exports[_0x0ead('0x27')]=function(_0x2524b4,_0x3afced){return db['SalesforceAccount'][_0x0ead('0x46')]({'where':{'id':_0x2524b4['params']['id']}})[_0x0ead('0x26')](handleEntityNotFound(_0x3afced,null))[_0x0ead('0x26')](removeEntity(_0x3afced,null))[_0x0ead('0x40')](handleError(_0x3afced,null));};exports['getConfigurations']=function(_0x1d157e,_0x237ec4,_0x125b7f){var _0x45c70a={};var _0x532a34={};var _0x161466;var _0x231a9e;return db[_0x0ead('0x2d')][_0x0ead('0x4a')]({'where':{'id':_0x1d157e[_0x0ead('0x42')]['id']}})[_0x0ead('0x26')](handleEntityNotFound(_0x237ec4,null))[_0x0ead('0x26')](function(_0x23a336){if(_0x23a336){_0x161466=_0x23a336;_0x532a34['model']=_[_0x0ead('0x31')](db['SalesforceConfiguration']['rawAttributes']);_0x532a34[_0x0ead('0x36')]=_[_0x0ead('0x31')](_0x1d157e['query']);_0x532a34['filters']=_[_0x0ead('0x33')](_0x532a34[_0x0ead('0x30')],_0x532a34['query']);_0x45c70a[_0x0ead('0x34')]=_[_0x0ead('0x33')](_0x532a34[_0x0ead('0x30')],qs['fields'](_0x1d157e[_0x0ead('0x36')][_0x0ead('0x35')]));_0x45c70a[_0x0ead('0x34')]=_0x45c70a[_0x0ead('0x34')][_0x0ead('0x44')]?_0x45c70a[_0x0ead('0x34')]:_0x532a34[_0x0ead('0x30')];_0x45c70a[_0x0ead('0x38')]=qs[_0x0ead('0x39')](_0x1d157e[_0x0ead('0x36')]['sort']);_0x45c70a[_0x0ead('0x3a')]=qs[_0x0ead('0x32')](_['pick'](_0x1d157e[_0x0ead('0x36')],_0x532a34[_0x0ead('0x32')]));if(_0x1d157e['query'][_0x0ead('0x3c')]){_0x45c70a[_0x0ead('0x3a')]=_['merge'](_0x45c70a[_0x0ead('0x3a')],{'$or':_[_0x0ead('0x2c')](_0x45c70a[_0x0ead('0x34')],function(_0x56d261){var _0x17a979={};_0x17a979[_0x56d261]={'$like':'%'+_0x1d157e['query']['filter']+'%'};return _0x17a979;})});}_0x45c70a=_[_0x0ead('0x3d')]({},_0x45c70a,_0x1d157e[_0x0ead('0x4b')]);return _0x161466[_0x0ead('0x4c')](_0x45c70a);}})[_0x0ead('0x26')](function(_0x110c1f){if(_0x110c1f){_0x231a9e=_0x110c1f['length'];if(!_0x1d157e[_0x0ead('0x36')][_0x0ead('0x4d')](_0x0ead('0x37'))){_0x45c70a[_0x0ead('0x1f')]=qs[_0x0ead('0x1f')](_0x1d157e['query'][_0x0ead('0x1f')]);_0x45c70a[_0x0ead('0x1e')]=qs[_0x0ead('0x1e')](_0x1d157e[_0x0ead('0x36')][_0x0ead('0x1e')]);}return _0x161466[_0x0ead('0x4c')](_0x45c70a);}})[_0x0ead('0x26')](function(_0x23c8b3){if(_0x23c8b3){return _0x23c8b3?{'count':_0x231a9e,'rows':_0x23c8b3}:null;}})[_0x0ead('0x26')](respondWithResult(_0x237ec4,null))[_0x0ead('0x40')](handleError(_0x237ec4,null));};exports['addConfiguration']=function(_0x4a3046,_0x1b5658,_0x2b61f4){if(_0x4a3046[_0x0ead('0x48')]['id']){delete _0x4a3046[_0x0ead('0x48')]['id'];}return db[_0x0ead('0x2d')]['findOne']({'where':{'id':_0x4a3046[_0x0ead('0x42')]['id']}})[_0x0ead('0x26')](handleEntityNotFound(_0x1b5658,null))[_0x0ead('0x26')](function(_0x357ff2){if(_0x357ff2){_0x4a3046[_0x0ead('0x48')][_0x0ead('0x4e')]=_0x357ff2['id'];_0x4a3046[_0x0ead('0x48')][_0x0ead('0x4f')]=integrations[_0x0ead('0x50')](_0x4a3046[_0x0ead('0x48')][_0x0ead('0x51')],_0x4a3046[_0x0ead('0x48')][_0x0ead('0x2f')]);_0x4a3046['body'][_0x0ead('0x52')]=integrations['getDescriptions'](_0x4a3046['body'][_0x0ead('0x51')],_0x4a3046[_0x0ead('0x48')][_0x0ead('0x2f')]);return db[_0x0ead('0x53')][_0x0ead('0x47')](_0x4a3046['body'],{'include':[{'model':db['SalesforceField'],'as':_0x0ead('0x4f')},{'model':db[_0x0ead('0x54')],'as':_0x0ead('0x52')}]});}return null;})['then'](respondWithResult(_0x1b5658,null))[_0x0ead('0x40')](handleError(_0x1b5658,null));};exports[_0x0ead('0x55')]=function(_0x4467cb,_0x5df1fc,_0x2640fa){var _0x135887;var _0x57b08d='';var _0x51148f='Task';return db[_0x0ead('0x2d')][_0x0ead('0x4a')]({'where':{'id':_0x4467cb[_0x0ead('0x42')]['id']},'attributes':['id',_0x0ead('0x56'),_0x0ead('0x57'),'clientSecret',_0x0ead('0x58'),'password',_0x0ead('0x59')]})['then'](handleEntityNotFound(_0x5df1fc,null))[_0x0ead('0x26')](function(_0x3ed341){if(_0x3ed341){_0x57b08d=_0x3ed341[_0x0ead('0x56')];var _0x1e2ffb=_0x57b08d[_0x0ead('0x5a')](-0x1);if(_0x1e2ffb==='/'){_0x57b08d=_0x57b08d[_0x0ead('0x5b')](0x0,_0x57b08d['lastIndexOf'](_0x1e2ffb));}_0x135887=new jsforce[(_0x0ead('0x5c'))]({'oauth2':{'loginUrl':_0x57b08d,'clientId':_0x3ed341[_0x0ead('0x57')],'clientSecret':_0x3ed341[_0x0ead('0x5d')]}});return _0x135887['login'](_0x3ed341['username'],_0x3ed341[_0x0ead('0x5e')][_0x0ead('0x5f')](_0x3ed341['securityToken']));}})[_0x0ead('0x26')](function(_0x311fb2){if(_0x311fb2){if(!_[_0x0ead('0x60')](_0x4467cb[_0x0ead('0x36')][_0x0ead('0x61')])){_0x51148f=_0x4467cb[_0x0ead('0x36')][_0x0ead('0x61')];}return _0x135887['sobject'](_0x51148f)[_0x0ead('0x62')]();}})[_0x0ead('0x26')](function(_0x406835){var _0x494cba=[_0x0ead('0x63'),'ActivityDate','IsReminderSet',_0x0ead('0x64'),_0x0ead('0x65'),_0x0ead('0x66')];var _0x2aefa0=[_0x0ead('0x67'),_0x0ead('0x68'),_0x0ead('0x69'),'boolean',_0x0ead('0x6a'),_0x0ead('0x6b'),_0x0ead('0x6c')];if(_0x406835){_[_0x0ead('0x6d')](_0x406835[_0x0ead('0x35')],function(_0x14d4c1){return _0x494cba[_0x0ead('0x6e')](_0x14d4c1[_0x0ead('0x2a')])||!_0x2aefa0[_0x0ead('0x6e')](_0x14d4c1['type']);});return{'count':_0x406835['fields'][_0x0ead('0x44')],'rows':_[_0x0ead('0x2c')](_0x406835[_0x0ead('0x35')],function(_0x5c6dbb){return{'id':_0x5c6dbb['name'],'name':_0x5c6dbb['label'],'custom':_0x5c6dbb[_0x0ead('0x6f')],'options':_0x5c6dbb['picklistValues'][_0x0ead('0x44')]>0x0?_[_0x0ead('0x2c')](_0x5c6dbb[_0x0ead('0x70')],function(_0x3f88ee){return{'name':_0x3f88ee['label'],'value':_0x3f88ee[_0x0ead('0x71')]};}):_0x5c6dbb[_0x0ead('0x2f')]==_0x0ead('0x72')?[{'name':'True','value':'true'},{'name':'False','value':_0x0ead('0x73')}]:[]};})};}})[_0x0ead('0x26')](respondWithResult(_0x5df1fc,null))[_0x0ead('0x40')](function(_0x294b76){var _0x3eedeb=_0x4467cb[_0x0ead('0x36')][_0x0ead('0x74')]?0x1f4:_0x294b76[_0x0ead('0x75')]||0x1f4;logger[_0x0ead('0x28')](_0x0ead('0x76'),_0x0ead('0x55'),_0x3eedeb,JSON[_0x0ead('0x77')](_0x294b76));delete _0x294b76[_0x0ead('0x2a')];if(_0x3eedeb===0x191){_0x3eedeb=0x190;}_0x5df1fc[_0x0ead('0x1a')](_0x3eedeb)[_0x0ead('0x2b')](_0x4467cb['query'][_0x0ead('0x74')]?{'message':_0x0ead('0x78'),'statusCode':_0x294b76['statusCode']}:_0x294b76);});}; \ No newline at end of file +var _0x6ecb=['SalesforceConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','login','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','Description','string','int','email','textarea','phone','label','custom','picklistValues','value','boolean','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','end','sendStatus','error','stack','name','send','type','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','SalesforceAccount','findAll','catch','params','keys','rawAttributes','include','create','body','find','getConfigurations'];(function(_0x4500a6,_0x5a2569){var _0x18980a=function(_0x258a19){while(--_0x258a19){_0x4500a6['push'](_0x4500a6['shift']());}};_0x18980a(++_0x5a2569);}(_0x6ecb,0x19c));var _0xb6ec=function(_0x11dcf0,_0x4eb137){_0x11dcf0=_0x11dcf0-0x0;var _0x4f9831=_0x6ecb[_0x11dcf0];return _0x4f9831;};'use strict';var emlformat=require(_0xb6ec('0x0'));var rimraf=require(_0xb6ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb6ec('0x2'));var moment=require(_0xb6ec('0x3'));var BPromise=require(_0xb6ec('0x4'));var Mustache=require('mustache');var util=require(_0xb6ec('0x5'));var path=require(_0xb6ec('0x6'));var sox=require(_0xb6ec('0x7'));var csv=require(_0xb6ec('0x8'));var ejs=require(_0xb6ec('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb6ec('0xa'));var crypto=require(_0xb6ec('0xb'));var jsforce=require(_0xb6ec('0xc'));var deskjs=require(_0xb6ec('0xd'));var toCsv=require(_0xb6ec('0x8'));var querystring=require(_0xb6ec('0xe'));var Papa=require(_0xb6ec('0xf'));var Redis=require(_0xb6ec('0x10'));var authService=require(_0xb6ec('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb6ec('0x12'));var utils=require(_0xb6ec('0x13'));var config=require(_0xb6ec('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xb6ec('0x15'));function respondWithStatusCode(_0x411aac,_0x4523a2){_0x4523a2=_0x4523a2||0xcc;return function(_0x5d6e5d){if(_0x5d6e5d){return _0x411aac['sendStatus'](_0x4523a2);}return _0x411aac[_0xb6ec('0x16')](_0x4523a2)['end']();};}function respondWithResult(_0x36023d,_0x53ce1b){_0x53ce1b=_0x53ce1b||0xc8;return function(_0xc75d95){if(_0xc75d95){return _0x36023d['status'](_0x53ce1b)[_0xb6ec('0x17')](_0xc75d95);}};}function respondWithFilteredResult(_0x48b85a,_0x4fcb7f){return function(_0x26df5a){if(_0x26df5a){var _0x20f057=typeof _0x4fcb7f['offset']===_0xb6ec('0x18')&&typeof _0x4fcb7f[_0xb6ec('0x19')]===_0xb6ec('0x18');var _0x4504f2=_0x26df5a[_0xb6ec('0x1a')];var _0x4b3b89=_0x20f057?0x0:_0x4fcb7f[_0xb6ec('0x1b')];var _0x40e5fc=_0x20f057?_0x26df5a[_0xb6ec('0x1a')]:_0x4fcb7f[_0xb6ec('0x1b')]+_0x4fcb7f['limit'];var _0x317b84;if(_0x40e5fc>=_0x4504f2){_0x40e5fc=_0x4504f2;_0x317b84=0xc8;}else{_0x317b84=0xce;}_0x48b85a[_0xb6ec('0x16')](_0x317b84);return _0x48b85a[_0xb6ec('0x1c')](_0xb6ec('0x1d'),_0x4b3b89+'-'+_0x40e5fc+'/'+_0x4504f2)[_0xb6ec('0x17')](_0x26df5a);}return null;};}function patchUpdates(_0x341dbf){return function(_0x5f0aaa){try{jsonpatch[_0xb6ec('0x1e')](_0x5f0aaa,_0x341dbf,!![]);}catch(_0x3c5ea6){return BPromise[_0xb6ec('0x1f')](_0x3c5ea6);}return _0x5f0aaa['save']();};}function saveUpdates(_0x45c163,_0x471649){return function(_0x464bfb){if(_0x464bfb){return _0x464bfb[_0xb6ec('0x20')](_0x45c163)['then'](function(_0x472ade){return _0x472ade;});}return null;};}function removeEntity(_0x5ccf7d,_0x22c3e4){return function(_0x289017){if(_0x289017){return _0x289017[_0xb6ec('0x21')]()[_0xb6ec('0x22')](function(){_0x5ccf7d['status'](0xcc)[_0xb6ec('0x23')]();});}};}function handleEntityNotFound(_0x24253d,_0x1d1420){return function(_0x36fdf4){if(!_0x36fdf4){_0x24253d[_0xb6ec('0x24')](0x194);}return _0x36fdf4;};}function handleError(_0x4516b0,_0x152149){_0x152149=_0x152149||0x1f4;return function(_0x9fecc){logger[_0xb6ec('0x25')](_0x9fecc[_0xb6ec('0x26')]);if(_0x9fecc[_0xb6ec('0x27')]){delete _0x9fecc[_0xb6ec('0x27')];}_0x4516b0[_0xb6ec('0x16')](_0x152149)[_0xb6ec('0x28')](_0x9fecc);};}exports['index']=function(_0xf12b8e,_0x2a2493){var _0x287483={},_0x3ac0fa={},_0xf569fb={'count':0x0,'rows':[]};var _0x56a5cd=_['map'](db['SalesforceAccount']['rawAttributes'],function(_0x4b563d){return{'name':_0x4b563d['fieldName'],'type':_0x4b563d[_0xb6ec('0x29')]['key']};});_0x3ac0fa[_0xb6ec('0x2a')]=_[_0xb6ec('0x2b')](_0x56a5cd,_0xb6ec('0x27'));_0x3ac0fa['query']=_['keys'](_0xf12b8e['query']);_0x3ac0fa[_0xb6ec('0x2c')]=_[_0xb6ec('0x2d')](_0x3ac0fa[_0xb6ec('0x2a')],_0x3ac0fa[_0xb6ec('0x2e')]);_0x287483[_0xb6ec('0x2f')]=_['intersection'](_0x3ac0fa[_0xb6ec('0x2a')],qs['fields'](_0xf12b8e['query'][_0xb6ec('0x30')]));_0x287483[_0xb6ec('0x2f')]=_0x287483[_0xb6ec('0x2f')][_0xb6ec('0x31')]?_0x287483[_0xb6ec('0x2f')]:_0x3ac0fa['model'];if(!_0xf12b8e[_0xb6ec('0x2e')][_0xb6ec('0x32')](_0xb6ec('0x33'))){_0x287483['limit']=qs[_0xb6ec('0x19')](_0xf12b8e['query'][_0xb6ec('0x19')]);_0x287483['offset']=qs[_0xb6ec('0x1b')](_0xf12b8e[_0xb6ec('0x2e')][_0xb6ec('0x1b')]);}_0x287483[_0xb6ec('0x34')]=qs[_0xb6ec('0x35')](_0xf12b8e['query'][_0xb6ec('0x35')]);_0x287483[_0xb6ec('0x36')]=qs[_0xb6ec('0x2c')](_[_0xb6ec('0x37')](_0xf12b8e[_0xb6ec('0x2e')],_0x3ac0fa[_0xb6ec('0x2c')]),_0x56a5cd);if(_0xf12b8e[_0xb6ec('0x2e')][_0xb6ec('0x38')]){_0x287483[_0xb6ec('0x36')]=_['merge'](_0x287483[_0xb6ec('0x36')],{'$or':_[_0xb6ec('0x2b')](_0x56a5cd,function(_0x2a1c8d){if(_0x2a1c8d[_0xb6ec('0x29')]!==_0xb6ec('0x39')){var _0x176ac7={};_0x176ac7[_0x2a1c8d[_0xb6ec('0x27')]]={'$like':'%'+_0xf12b8e['query'][_0xb6ec('0x38')]+'%'};return _0x176ac7;}})});}_0x287483=_[_0xb6ec('0x3a')]({},_0x287483,_0xf12b8e[_0xb6ec('0x3b')]);var _0x211653={'where':_0x287483[_0xb6ec('0x36')]};return db['SalesforceAccount']['count'](_0x211653)['then'](function(_0x2c7698){_0xf569fb['count']=_0x2c7698;if(_0xf12b8e[_0xb6ec('0x2e')][_0xb6ec('0x3c')]){_0x287483['include']=[{'all':!![]}];}return db[_0xb6ec('0x3d')][_0xb6ec('0x3e')](_0x287483);})[_0xb6ec('0x22')](function(_0x19618b){_0xf569fb['rows']=_0x19618b;return _0xf569fb;})[_0xb6ec('0x22')](respondWithFilteredResult(_0x2a2493,_0x287483))[_0xb6ec('0x3f')](handleError(_0x2a2493,null));};exports['show']=function(_0xe3316b,_0x2839be){var _0x5d5288={'raw':![],'where':{'id':_0xe3316b[_0xb6ec('0x40')]['id']}},_0x2b0ea4={};_0x2b0ea4[_0xb6ec('0x2a')]=_[_0xb6ec('0x41')](db[_0xb6ec('0x3d')][_0xb6ec('0x42')]);_0x2b0ea4[_0xb6ec('0x2e')]=_[_0xb6ec('0x41')](_0xe3316b[_0xb6ec('0x2e')]);_0x2b0ea4[_0xb6ec('0x2c')]=_['intersection'](_0x2b0ea4['model'],_0x2b0ea4[_0xb6ec('0x2e')]);_0x5d5288['attributes']=_[_0xb6ec('0x2d')](_0x2b0ea4['model'],qs[_0xb6ec('0x30')](_0xe3316b[_0xb6ec('0x2e')][_0xb6ec('0x30')]));_0x5d5288[_0xb6ec('0x2f')]=_0x5d5288[_0xb6ec('0x2f')][_0xb6ec('0x31')]?_0x5d5288[_0xb6ec('0x2f')]:_0x2b0ea4[_0xb6ec('0x2a')];if(_0xe3316b['query'][_0xb6ec('0x3c')]){_0x5d5288[_0xb6ec('0x43')]=[{'all':!![]}];}_0x5d5288=_['merge']({},_0x5d5288,_0xe3316b[_0xb6ec('0x3b')]);return db[_0xb6ec('0x3d')]['find'](_0x5d5288)[_0xb6ec('0x22')](handleEntityNotFound(_0x2839be,null))['then'](respondWithResult(_0x2839be,null))[_0xb6ec('0x3f')](handleError(_0x2839be,null));};exports['create']=function(_0x2300a8,_0x1fe864){return db[_0xb6ec('0x3d')][_0xb6ec('0x44')](_0x2300a8[_0xb6ec('0x45')],{})['then'](respondWithResult(_0x1fe864,0xc9))[_0xb6ec('0x3f')](handleError(_0x1fe864,null));};exports[_0xb6ec('0x20')]=function(_0x377a9e,_0x4143ee){if(_0x377a9e[_0xb6ec('0x45')]['id']){delete _0x377a9e[_0xb6ec('0x45')]['id'];}return db[_0xb6ec('0x3d')][_0xb6ec('0x46')]({'where':{'id':_0x377a9e[_0xb6ec('0x40')]['id']}})['then'](handleEntityNotFound(_0x4143ee,null))[_0xb6ec('0x22')](saveUpdates(_0x377a9e['body'],null))[_0xb6ec('0x22')](respondWithResult(_0x4143ee,null))['catch'](handleError(_0x4143ee,null));};exports[_0xb6ec('0x21')]=function(_0x1f2b87,_0x1e25e5){return db[_0xb6ec('0x3d')][_0xb6ec('0x46')]({'where':{'id':_0x1f2b87['params']['id']}})[_0xb6ec('0x22')](handleEntityNotFound(_0x1e25e5,null))[_0xb6ec('0x22')](removeEntity(_0x1e25e5,null))[_0xb6ec('0x3f')](handleError(_0x1e25e5,null));};exports[_0xb6ec('0x47')]=function(_0x97387a,_0xccf2d2,_0x5731bb){var _0x7af41a={};var _0x4bd50b={};var _0x3ce7d3;var _0x300a26;return db[_0xb6ec('0x3d')]['findOne']({'where':{'id':_0x97387a[_0xb6ec('0x40')]['id']}})[_0xb6ec('0x22')](handleEntityNotFound(_0xccf2d2,null))[_0xb6ec('0x22')](function(_0x3a2d8e){if(_0x3a2d8e){_0x3ce7d3=_0x3a2d8e;_0x4bd50b[_0xb6ec('0x2a')]=_[_0xb6ec('0x41')](db[_0xb6ec('0x48')][_0xb6ec('0x42')]);_0x4bd50b['query']=_['keys'](_0x97387a[_0xb6ec('0x2e')]);_0x4bd50b[_0xb6ec('0x2c')]=_['intersection'](_0x4bd50b[_0xb6ec('0x2a')],_0x4bd50b[_0xb6ec('0x2e')]);_0x7af41a[_0xb6ec('0x2f')]=_[_0xb6ec('0x2d')](_0x4bd50b[_0xb6ec('0x2a')],qs[_0xb6ec('0x30')](_0x97387a[_0xb6ec('0x2e')]['fields']));_0x7af41a['attributes']=_0x7af41a['attributes'][_0xb6ec('0x31')]?_0x7af41a[_0xb6ec('0x2f')]:_0x4bd50b[_0xb6ec('0x2a')];_0x7af41a[_0xb6ec('0x34')]=qs['sort'](_0x97387a['query'][_0xb6ec('0x35')]);_0x7af41a['where']=qs['filters'](_[_0xb6ec('0x37')](_0x97387a[_0xb6ec('0x2e')],_0x4bd50b[_0xb6ec('0x2c')]));if(_0x97387a['query'][_0xb6ec('0x38')]){_0x7af41a['where']=_[_0xb6ec('0x3a')](_0x7af41a[_0xb6ec('0x36')],{'$or':_[_0xb6ec('0x2b')](_0x7af41a[_0xb6ec('0x2f')],function(_0x341672){var _0x460a38={};_0x460a38[_0x341672]={'$like':'%'+_0x97387a[_0xb6ec('0x2e')][_0xb6ec('0x38')]+'%'};return _0x460a38;})});}_0x7af41a=_[_0xb6ec('0x3a')]({},_0x7af41a,_0x97387a[_0xb6ec('0x3b')]);return _0x3ce7d3[_0xb6ec('0x47')](_0x7af41a);}})['then'](function(_0x2897ac){if(_0x2897ac){_0x300a26=_0x2897ac[_0xb6ec('0x31')];if(!_0x97387a['query'][_0xb6ec('0x32')](_0xb6ec('0x33'))){_0x7af41a[_0xb6ec('0x19')]=qs[_0xb6ec('0x19')](_0x97387a[_0xb6ec('0x2e')][_0xb6ec('0x19')]);_0x7af41a[_0xb6ec('0x1b')]=qs[_0xb6ec('0x1b')](_0x97387a[_0xb6ec('0x2e')]['offset']);}return _0x3ce7d3[_0xb6ec('0x47')](_0x7af41a);}})[_0xb6ec('0x22')](function(_0x2a9d5a){if(_0x2a9d5a){return _0x2a9d5a?{'count':_0x300a26,'rows':_0x2a9d5a}:null;}})[_0xb6ec('0x22')](respondWithResult(_0xccf2d2,null))[_0xb6ec('0x3f')](handleError(_0xccf2d2,null));};exports['addConfiguration']=function(_0x36741e,_0xefb687,_0x49cfc7){if(_0x36741e[_0xb6ec('0x45')]['id']){delete _0x36741e[_0xb6ec('0x45')]['id'];}return db[_0xb6ec('0x3d')][_0xb6ec('0x49')]({'where':{'id':_0x36741e[_0xb6ec('0x40')]['id']}})['then'](handleEntityNotFound(_0xefb687,null))['then'](function(_0x1cd4b5){if(_0x1cd4b5){_0x36741e['body'][_0xb6ec('0x4a')]=_0x1cd4b5['id'];_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x4b')]=integrations[_0xb6ec('0x4c')](_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x4d')],_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x29')]);_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x4e')]=integrations[_0xb6ec('0x4f')](_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x4d')],_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x29')]);return db['SalesforceConfiguration'][_0xb6ec('0x44')](_0x36741e[_0xb6ec('0x45')],{'include':[{'model':db[_0xb6ec('0x50')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0xb6ec('0x4e')}]});}return null;})[_0xb6ec('0x22')](respondWithResult(_0xefb687,null))[_0xb6ec('0x3f')](handleError(_0xefb687,null));};exports[_0xb6ec('0x51')]=function(_0x5e1da3,_0xef45c9,_0x433b46){var _0x3190eb;var _0xd6e6d6='';var _0x435f95=_0xb6ec('0x52');return db['SalesforceAccount']['findOne']({'where':{'id':_0x5e1da3[_0xb6ec('0x40')]['id']},'attributes':['id',_0xb6ec('0x53'),_0xb6ec('0x54'),_0xb6ec('0x55'),_0xb6ec('0x56'),_0xb6ec('0x57'),'securityToken']})[_0xb6ec('0x22')](handleEntityNotFound(_0xef45c9,null))[_0xb6ec('0x22')](function(_0x4b7bf6){if(_0x4b7bf6){_0xd6e6d6=_0x4b7bf6['remoteUri'];var _0x256e16=_0xd6e6d6[_0xb6ec('0x58')](-0x1);if(_0x256e16==='/'){_0xd6e6d6=_0xd6e6d6[_0xb6ec('0x59')](0x0,_0xd6e6d6['lastIndexOf'](_0x256e16));}_0x3190eb=new jsforce['Connection']({'oauth2':{'loginUrl':_0xd6e6d6,'clientId':_0x4b7bf6[_0xb6ec('0x54')],'clientSecret':_0x4b7bf6[_0xb6ec('0x55')]}});return _0x3190eb[_0xb6ec('0x5a')](_0x4b7bf6[_0xb6ec('0x56')],_0x4b7bf6['password'][_0xb6ec('0x5b')](_0x4b7bf6[_0xb6ec('0x5c')]));}})[_0xb6ec('0x22')](function(_0x4778fc){if(_0x4778fc){if(!_[_0xb6ec('0x5d')](_0x5e1da3[_0xb6ec('0x2e')]['ticketType'])){_0x435f95=_0x5e1da3[_0xb6ec('0x2e')][_0xb6ec('0x5e')];}return _0x3190eb[_0xb6ec('0x5f')](_0x435f95)[_0xb6ec('0x60')]();}})[_0xb6ec('0x22')](function(_0x3cddf4){var _0x5b18f0=[_0xb6ec('0x61'),_0xb6ec('0x62'),_0xb6ec('0x63'),'IsRecurrence',_0xb6ec('0x64'),_0xb6ec('0x65')];var _0x2f3e05=[_0xb6ec('0x66'),_0xb6ec('0x67'),'picklist','boolean',_0xb6ec('0x68'),_0xb6ec('0x69'),_0xb6ec('0x6a')];if(_0x3cddf4){_['remove'](_0x3cddf4[_0xb6ec('0x30')],function(_0x3e3844){return _0x5b18f0['includes'](_0x3e3844['name'])||!_0x2f3e05['includes'](_0x3e3844[_0xb6ec('0x29')]);});return{'count':_0x3cddf4[_0xb6ec('0x30')][_0xb6ec('0x31')],'rows':_[_0xb6ec('0x2b')](_0x3cddf4[_0xb6ec('0x30')],function(_0x12c7a2){return{'id':_0x12c7a2[_0xb6ec('0x27')],'name':_0x12c7a2[_0xb6ec('0x6b')],'custom':_0x12c7a2[_0xb6ec('0x6c')],'options':_0x12c7a2[_0xb6ec('0x6d')][_0xb6ec('0x31')]>0x0?_[_0xb6ec('0x2b')](_0x12c7a2[_0xb6ec('0x6d')],function(_0x1a8bd5){return{'name':_0x1a8bd5[_0xb6ec('0x6b')],'value':_0x1a8bd5[_0xb6ec('0x6e')]};}):_0x12c7a2[_0xb6ec('0x29')]==_0xb6ec('0x6f')?[{'name':_0xb6ec('0x70'),'value':_0xb6ec('0x71')},{'name':_0xb6ec('0x72'),'value':_0xb6ec('0x73')}]:[]};})};}})[_0xb6ec('0x22')](respondWithResult(_0xef45c9,null))['catch'](function(_0x14521f){var _0x57c4da=_0x5e1da3[_0xb6ec('0x2e')][_0xb6ec('0x74')]?0x1f4:_0x14521f[_0xb6ec('0x75')]||0x1f4;logger[_0xb6ec('0x25')](_0xb6ec('0x76'),_0xb6ec('0x51'),_0x57c4da,JSON[_0xb6ec('0x77')](_0x14521f));delete _0x14521f[_0xb6ec('0x27')];if(_0x57c4da===0x191){_0x57c4da=0x190;}_0xef45c9['status'](_0x57c4da)[_0xb6ec('0x28')](_0x5e1da3[_0xb6ec('0x2e')][_0xb6ec('0x74')]?{'message':_0xb6ec('0x78'),'statusCode':_0x14521f['statusCode']}:_0x14521f);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b32a046..5bbd926 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98f3=['int_salesforce_accounts','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x98f3,0x1a1));var _0x398f=function(_0x25bd2a,_0xc8fe7a){_0x25bd2a=_0x25bd2a-0x0;var _0xb6b479=_0x98f3[_0x25bd2a];return _0xb6b479;};'use strict';var _=require(_0x398f('0x0'));var util=require('util');var logger=require(_0x398f('0x1'))(_0x398f('0x2'));var moment=require(_0x398f('0x3'));var BPromise=require(_0x398f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x398f('0x5'));var rimraf=require('rimraf');var config=require(_0x398f('0x6'));var attributes=require(_0x398f('0x7'));var integrations=require(_0x398f('0x8'));module[_0x398f('0x9')]=function(_0x55137d,_0x748ab0){return _0x55137d[_0x398f('0xa')](_0x398f('0xb'),attributes,{'tableName':_0x398f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce56=['int_salesforce_accounts','lodash','util','../../config/logger','api','bluebird','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xce56,0x173));var _0x6ce5=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xce56[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x6ce5('0x0'));var util=require(_0x6ce5('0x1'));var logger=require(_0x6ce5('0x2'))(_0x6ce5('0x3'));var moment=require('moment');var BPromise=require(_0x6ce5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ce5('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x6ce5('0x6'));module[_0x6ce5('0x7')]=function(_0x4f1fbd,_0xa19152){return _0x4f1fbd[_0x6ce5('0x8')]('SalesforceAccount',attributes,{'tableName':_0x6ce5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 13ce809..b51d149 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x359e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','catch','ShowSalesforceAccount','find','where','lodash','moment','bluebird','randomstring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x359e,0xda));var _0xe359=function(_0x2b35c1,_0x124359){_0x2b35c1=_0x2b35c1-0x0;var _0x8c4929=_0x359e[_0x2b35c1];return _0x8c4929;};'use strict';var _=require(_0xe359('0x0'));var util=require('util');var moment=require(_0xe359('0x1'));var BPromise=require(_0xe359('0x2'));var rs=require(_0xe359('0x3'));var fs=require('fs');var Redis=require(_0xe359('0x4'));var db=require(_0xe359('0x5'))['db'];var utils=require(_0xe359('0x6'));var logger=require(_0xe359('0x7'))(_0xe359('0x8'));var config=require('../../config/environment');var jayson=require(_0xe359('0x9'));var client=jayson['client'][_0xe359('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a4fe0,_0x1d8678,_0x152ac7){return new BPromise(function(_0x16d685,_0x2aa290){return client[_0xe359('0xb')](_0x3a4fe0,_0x152ac7)[_0xe359('0xc')](function(_0xe204e6){logger[_0xe359('0xd')](_0xe359('0xe'),_0x1d8678,_0xe359('0xf'));logger['debug'](_0xe359('0x10'),_0x1d8678,_0xe359('0xf'),JSON['stringify'](_0xe204e6));if(_0xe204e6['error']){if(_0xe204e6[_0xe359('0x11')][_0xe359('0x12')]===0x1f4){logger[_0xe359('0x11')](_0xe359('0xe'),_0x1d8678,_0xe204e6[_0xe359('0x11')]['message']);return _0x2aa290(_0xe204e6[_0xe359('0x11')]['message']);}logger[_0xe359('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x1d8678,_0xe204e6['error'][_0xe359('0x13')]);return _0x16d685(_0xe204e6[_0xe359('0x11')]['message']);}else{logger[_0xe359('0xd')](_0xe359('0xe'),_0x1d8678,_0xe359('0xf'));_0x16d685(_0xe204e6[_0xe359('0x14')][_0xe359('0x13')]);}})['catch'](function(_0x4ddbd3){logger[_0xe359('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x1d8678,_0x4ddbd3);_0x2aa290(_0x4ddbd3);});});}exports[_0xe359('0x15')]=function(_0xd04158){var _0x2a8570=this;return new Promise(function(_0x5abae7,_0xe28807){return db[_0xe359('0x16')][_0xe359('0x17')]({'raw':_0xd04158[_0xe359('0x18')]?_0xd04158[_0xe359('0x18')][_0xe359('0x19')]===undefined?!![]:![]:!![],'where':_0xd04158[_0xe359('0x18')]?_0xd04158[_0xe359('0x18')]['where']||null:null,'attributes':_0xd04158[_0xe359('0x18')]?_0xd04158['options'][_0xe359('0x1a')]||null:null,'limit':_0xd04158[_0xe359('0x18')]?_0xd04158[_0xe359('0x18')][_0xe359('0x1b')]||null:null,'include':_0xd04158[_0xe359('0x18')]?_0xd04158['options'][_0xe359('0x1c')]?_[_0xe359('0x1d')](_0xd04158['options'][_0xe359('0x1c')],function(_0x369fff){return{'model':db[_0x369fff[_0xe359('0x1e')]],'as':_0x369fff['as'],'attributes':_0x369fff['attributes'],'include':_0x369fff[_0xe359('0x1c')]?_['map'](_0x369fff[_0xe359('0x1c')],function(_0x3baf04){return{'model':db[_0x3baf04[_0xe359('0x1e')]],'as':_0x3baf04['as'],'attributes':_0x3baf04[_0xe359('0x1a')],'include':_0x3baf04[_0xe359('0x1c')]?_[_0xe359('0x1d')](_0x3baf04[_0xe359('0x1c')],function(_0x2cbf68){return{'model':db[_0x2cbf68[_0xe359('0x1e')]],'as':_0x2cbf68['as'],'attributes':_0x2cbf68[_0xe359('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe359('0xc')](function(_0xacaea3){logger[_0xe359('0xd')](_0xe359('0x15'),_0xd04158);logger[_0xe359('0x1f')](_0xe359('0x15'),_0xd04158,JSON[_0xe359('0x20')](_0xacaea3));_0x5abae7(_0xacaea3);})[_0xe359('0x21')](function(_0x2d6487){logger['error'](_0xe359('0x15'),_0x2d6487[_0xe359('0x13')],_0xd04158);_0xe28807(_0x2a8570[_0xe359('0x11')](0x1f4,_0x2d6487[_0xe359('0x13')]));});});};exports[_0xe359('0x22')]=function(_0x5b3222){var _0xd46df1=this;return new Promise(function(_0x545e0d,_0x3c9e4d){return db[_0xe359('0x16')][_0xe359('0x23')]({'raw':_0x5b3222['options']?_0x5b3222[_0xe359('0x18')][_0xe359('0x19')]===undefined?!![]:![]:!![],'where':_0x5b3222[_0xe359('0x18')]?_0x5b3222[_0xe359('0x18')][_0xe359('0x24')]||null:null,'attributes':_0x5b3222[_0xe359('0x18')]?_0x5b3222[_0xe359('0x18')][_0xe359('0x1a')]||null:null,'include':_0x5b3222['options']?_0x5b3222['options'][_0xe359('0x1c')]?_[_0xe359('0x1d')](_0x5b3222[_0xe359('0x18')][_0xe359('0x1c')],function(_0x471d1a){return{'model':db[_0x471d1a[_0xe359('0x1e')]],'as':_0x471d1a['as'],'attributes':_0x471d1a['attributes'],'include':_0x471d1a['include']?_[_0xe359('0x1d')](_0x471d1a[_0xe359('0x1c')],function(_0x35eb3d){return{'model':db[_0x35eb3d['model']],'as':_0x35eb3d['as'],'attributes':_0x35eb3d[_0xe359('0x1a')],'include':_0x35eb3d['include']?_[_0xe359('0x1d')](_0x35eb3d['include'],function(_0x1c04ad){return{'model':db[_0x1c04ad[_0xe359('0x1e')]],'as':_0x1c04ad['as'],'attributes':_0x1c04ad[_0xe359('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe359('0xc')](function(_0x4c77cd){logger[_0xe359('0xd')](_0xe359('0x22'),_0x5b3222);logger[_0xe359('0x1f')](_0xe359('0x22'),_0x5b3222,JSON[_0xe359('0x20')](_0x4c77cd));_0x545e0d(_0x4c77cd);})[_0xe359('0x21')](function(_0x357559){logger[_0xe359('0x11')](_0xe359('0x22'),_0x357559[_0xe359('0x13')],_0x5b3222);_0x3c9e4d(_0xd46df1[_0xe359('0x11')](0x1f4,_0x357559[_0xe359('0x13')]));});});}; \ No newline at end of file +var _0x6ddc=['raw','debug','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','limit','include','attributes','model','map','ShowSalesforceAccount','find'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x6ddc,0xac));var _0xc6dd=function(_0x4a7da5,_0x4d3827){_0x4a7da5=_0x4a7da5-0x0;var _0x258771=_0x6ddc[_0x4a7da5];return _0x258771;};'use strict';var _=require('lodash');var util=require(_0xc6dd('0x0'));var moment=require(_0xc6dd('0x1'));var BPromise=require(_0xc6dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6dd('0x3'))['db'];var utils=require(_0xc6dd('0x4'));var logger=require(_0xc6dd('0x5'))(_0xc6dd('0x6'));var config=require(_0xc6dd('0x7'));var jayson=require(_0xc6dd('0x8'));var client=jayson[_0xc6dd('0x9')][_0xc6dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422b03,_0x4de295,_0x582f09){return new BPromise(function(_0x90abbd,_0x2c43b5){return client['request'](_0x422b03,_0x582f09)[_0xc6dd('0xb')](function(_0x6e96b3){logger[_0xc6dd('0xc')](_0xc6dd('0xd'),_0x4de295,'request\x20sent');logger['debug'](_0xc6dd('0xe'),_0x4de295,'request\x20sent',JSON[_0xc6dd('0xf')](_0x6e96b3));if(_0x6e96b3['error']){if(_0x6e96b3[_0xc6dd('0x10')]['code']===0x1f4){logger[_0xc6dd('0x10')](_0xc6dd('0xd'),_0x4de295,_0x6e96b3[_0xc6dd('0x10')][_0xc6dd('0x11')]);return _0x2c43b5(_0x6e96b3[_0xc6dd('0x10')][_0xc6dd('0x11')]);}logger[_0xc6dd('0x10')](_0xc6dd('0xd'),_0x4de295,_0x6e96b3[_0xc6dd('0x10')][_0xc6dd('0x11')]);return _0x90abbd(_0x6e96b3['error'][_0xc6dd('0x11')]);}else{logger[_0xc6dd('0xc')](_0xc6dd('0xd'),_0x4de295,_0xc6dd('0x12'));_0x90abbd(_0x6e96b3[_0xc6dd('0x13')][_0xc6dd('0x11')]);}})[_0xc6dd('0x14')](function(_0x382ac1){logger[_0xc6dd('0x10')](_0xc6dd('0xd'),_0x4de295,_0x382ac1);_0x2c43b5(_0x382ac1);});});}exports[_0xc6dd('0x15')]=function(_0x52aa40){var _0x17e5fd=this;return new Promise(function(_0x511cce,_0x30622d){return db[_0xc6dd('0x16')][_0xc6dd('0x17')]({'raw':_0x52aa40[_0xc6dd('0x18')]?_0x52aa40[_0xc6dd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x52aa40['options']?_0x52aa40['options']['where']||null:null,'attributes':_0x52aa40[_0xc6dd('0x18')]?_0x52aa40[_0xc6dd('0x18')]['attributes']||null:null,'limit':_0x52aa40[_0xc6dd('0x18')]?_0x52aa40[_0xc6dd('0x18')][_0xc6dd('0x19')]||null:null,'include':_0x52aa40[_0xc6dd('0x18')]?_0x52aa40['options'][_0xc6dd('0x1a')]?_['map'](_0x52aa40[_0xc6dd('0x18')][_0xc6dd('0x1a')],function(_0x50b07a){return{'model':db[_0x50b07a['model']],'as':_0x50b07a['as'],'attributes':_0x50b07a[_0xc6dd('0x1b')],'include':_0x50b07a[_0xc6dd('0x1a')]?_['map'](_0x50b07a[_0xc6dd('0x1a')],function(_0x10597c){return{'model':db[_0x10597c[_0xc6dd('0x1c')]],'as':_0x10597c['as'],'attributes':_0x10597c[_0xc6dd('0x1b')],'include':_0x10597c[_0xc6dd('0x1a')]?_[_0xc6dd('0x1d')](_0x10597c[_0xc6dd('0x1a')],function(_0x5b9b6e){return{'model':db[_0x5b9b6e['model']],'as':_0x5b9b6e['as'],'attributes':_0x5b9b6e[_0xc6dd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc6dd('0xb')](function(_0x19e20b){logger[_0xc6dd('0xc')](_0xc6dd('0x15'),_0x52aa40);logger['debug'](_0xc6dd('0x15'),_0x52aa40,JSON['stringify'](_0x19e20b));_0x511cce(_0x19e20b);})[_0xc6dd('0x14')](function(_0x1a155a){logger[_0xc6dd('0x10')]('GetSalesforceAccount',_0x1a155a[_0xc6dd('0x11')],_0x52aa40);_0x30622d(_0x17e5fd[_0xc6dd('0x10')](0x1f4,_0x1a155a['message']));});});};exports[_0xc6dd('0x1e')]=function(_0x81a3ee){var _0x28fcbd=this;return new Promise(function(_0x6d7471,_0x5d2232){return db[_0xc6dd('0x16')][_0xc6dd('0x1f')]({'raw':_0x81a3ee[_0xc6dd('0x18')]?_0x81a3ee[_0xc6dd('0x18')][_0xc6dd('0x20')]===undefined?!![]:![]:!![],'where':_0x81a3ee[_0xc6dd('0x18')]?_0x81a3ee[_0xc6dd('0x18')]['where']||null:null,'attributes':_0x81a3ee[_0xc6dd('0x18')]?_0x81a3ee[_0xc6dd('0x18')][_0xc6dd('0x1b')]||null:null,'include':_0x81a3ee[_0xc6dd('0x18')]?_0x81a3ee['options'][_0xc6dd('0x1a')]?_[_0xc6dd('0x1d')](_0x81a3ee[_0xc6dd('0x18')][_0xc6dd('0x1a')],function(_0x5052db){return{'model':db[_0x5052db[_0xc6dd('0x1c')]],'as':_0x5052db['as'],'attributes':_0x5052db['attributes'],'include':_0x5052db[_0xc6dd('0x1a')]?_[_0xc6dd('0x1d')](_0x5052db['include'],function(_0x4bd4e2){return{'model':db[_0x4bd4e2[_0xc6dd('0x1c')]],'as':_0x4bd4e2['as'],'attributes':_0x4bd4e2['attributes'],'include':_0x4bd4e2[_0xc6dd('0x1a')]?_[_0xc6dd('0x1d')](_0x4bd4e2[_0xc6dd('0x1a')],function(_0x508f64){return{'model':db[_0x508f64[_0xc6dd('0x1c')]],'as':_0x508f64['as'],'attributes':_0x508f64[_0xc6dd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc6dd('0xb')](function(_0x47c83d){logger[_0xc6dd('0xc')](_0xc6dd('0x1e'),_0x81a3ee);logger[_0xc6dd('0x21')](_0xc6dd('0x1e'),_0x81a3ee,JSON[_0xc6dd('0xf')](_0x47c83d));_0x6d7471(_0x47c83d);})[_0xc6dd('0x14')](function(_0x5ca2a7){logger[_0xc6dd('0x10')](_0xc6dd('0x1e'),_0x5ca2a7[_0xc6dd('0x11')],_0x81a3ee);_0x5d2232(_0x28fcbd[_0xc6dd('0x10')](0x1f4,_0x5ca2a7[_0xc6dd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 2e373b1..7e9a345 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x0b0e[_0x337748];return _0x3bb03f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x1d709f,_0x2ab2ec){var _0x322763=function(_0x3114a9){while(--_0x3114a9){_0x1d709f['push'](_0x1d709f['shift']());}};_0x322763(++_0x2ab2ec);}(_0x7a54,0x106));var _0x47a5=function(_0xdeec93,_0x40e01d){_0xdeec93=_0xdeec93-0x0;var _0x54ecb3=_0x7a54[_0xdeec93];return _0x54ecb3;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 9c0a985..3ef0374 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c32=['nothing','contact','sequelize','exports','STRING','Case','Task','ENUM','contact_lead','lead','account'];(function(_0x1b959e,_0x5b2d5f){var _0xa5ecea=function(_0x447b07){while(--_0x447b07){_0x1b959e['push'](_0x1b959e['shift']());}};_0xa5ecea(++_0x5b2d5f);}(_0x5c32,0xd3));var _0x25c3=function(_0x2e78b2,_0x45aa73){_0x2e78b2=_0x2e78b2-0x0;var _0x38d0d6=_0x5c32[_0x2e78b2];return _0x38d0d6;};'use strict';var Sequelize=require(_0x25c3('0x0'));module[_0x25c3('0x1')]={'name':{'type':Sequelize[_0x25c3('0x2')]},'description':{'type':Sequelize[_0x25c3('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x25c3('0x3')),'defaultValue':_0x25c3('0x4')},'moduleSearch':{'type':Sequelize[_0x25c3('0x5')](_0x25c3('0x6'),'contact',_0x25c3('0x7'),'account_contact_lead',_0x25c3('0x8')),'defaultValue':_0x25c3('0x6')},'moduleCreate':{'type':Sequelize[_0x25c3('0x5')](_0x25c3('0x9'),_0x25c3('0xa'),'lead','account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x25c3('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x25c3('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x25c3('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x25c3('0x2')]}}; \ No newline at end of file +var _0xe128=['exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize'];(function(_0x4bf4d5,_0x3ed68c){var _0x56e39b=function(_0x2fe16b){while(--_0x2fe16b){_0x4bf4d5['push'](_0x4bf4d5['shift']());}};_0x56e39b(++_0x3ed68c);}(_0xe128,0x1a3));var _0x8e12=function(_0x4801a0,_0x252c24){_0x4801a0=_0x4801a0-0x0;var _0x338e26=_0xe128[_0x4801a0];return _0x338e26;};'use strict';var Sequelize=require(_0x8e12('0x0'));module[_0x8e12('0x1')]={'name':{'type':Sequelize[_0x8e12('0x2')]},'description':{'type':Sequelize[_0x8e12('0x2')]},'ticketType':{'type':Sequelize[_0x8e12('0x3')](_0x8e12('0x4'),_0x8e12('0x5')),'defaultValue':_0x8e12('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x8e12('0x6'),_0x8e12('0x7'),_0x8e12('0x8'),_0x8e12('0x9'),_0x8e12('0xa')),'defaultValue':_0x8e12('0x6')},'moduleCreate':{'type':Sequelize[_0x8e12('0x3')](_0x8e12('0xb'),_0x8e12('0x7'),_0x8e12('0x8'),_0x8e12('0xa')),'defaultValue':_0x8e12('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x8e12('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 17743a7..9db3a89 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7df=['params','filters','length','find','create','update','body','findOne','SalesforceField','order','getFields','pick','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','SalesforceConfiguration','includeAll','include','rows','catch','show'];(function(_0x1c3bed,_0x1736f9){var _0x1302b9=function(_0x110833){while(--_0x110833){_0x1c3bed['push'](_0x1c3bed['shift']());}};_0x1302b9(++_0x1736f9);}(_0xc7df,0x149));var _0xfc7d=function(_0x187096,_0x1d5150){_0x187096=_0x187096-0x0;var _0x215af8=_0xc7df[_0x187096];return _0x215af8;};'use strict';var emlformat=require(_0xfc7d('0x0'));var rimraf=require(_0xfc7d('0x1'));var zipdir=require(_0xfc7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc7d('0x3'));var moment=require(_0xfc7d('0x4'));var BPromise=require(_0xfc7d('0x5'));var Mustache=require(_0xfc7d('0x6'));var util=require(_0xfc7d('0x7'));var path=require(_0xfc7d('0x8'));var sox=require(_0xfc7d('0x9'));var csv=require(_0xfc7d('0xa'));var ejs=require(_0xfc7d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc7d('0xc'));var squel=require(_0xfc7d('0xd'));var crypto=require(_0xfc7d('0xe'));var jsforce=require(_0xfc7d('0xf'));var deskjs=require(_0xfc7d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfc7d('0x11'));var Papa=require(_0xfc7d('0x12'));var Redis=require(_0xfc7d('0x13'));var authService=require(_0xfc7d('0x14'));var qs=require(_0xfc7d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc7d('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc7d('0x17'));var db=require(_0xfc7d('0x18'))['db'];function respondWithStatusCode(_0x5a3cce,_0x11062a){_0x11062a=_0x11062a||0xcc;return function(_0x17ed52){if(_0x17ed52){return _0x5a3cce[_0xfc7d('0x19')](_0x11062a);}return _0x5a3cce[_0xfc7d('0x1a')](_0x11062a)[_0xfc7d('0x1b')]();};}function respondWithResult(_0x3f44f7,_0x3259f4){_0x3259f4=_0x3259f4||0xc8;return function(_0x24bad5){if(_0x24bad5){return _0x3f44f7[_0xfc7d('0x1a')](_0x3259f4)['json'](_0x24bad5);}};}function respondWithFilteredResult(_0x19544e,_0x35f663){return function(_0x567a54){if(_0x567a54){var _0x43a37d=typeof _0x35f663[_0xfc7d('0x1c')]===_0xfc7d('0x1d')&&typeof _0x35f663[_0xfc7d('0x1e')]===_0xfc7d('0x1d');var _0x1f76bb=_0x567a54[_0xfc7d('0x1f')];var _0x3c45ab=_0x43a37d?0x0:_0x35f663[_0xfc7d('0x1c')];var _0x124441=_0x43a37d?_0x567a54['count']:_0x35f663[_0xfc7d('0x1c')]+_0x35f663[_0xfc7d('0x1e')];var _0x399586;if(_0x124441>=_0x1f76bb){_0x124441=_0x1f76bb;_0x399586=0xc8;}else{_0x399586=0xce;}_0x19544e['status'](_0x399586);return _0x19544e[_0xfc7d('0x20')]('Content-Range',_0x3c45ab+'-'+_0x124441+'/'+_0x1f76bb)[_0xfc7d('0x21')](_0x567a54);}return null;};}function patchUpdates(_0x1d1650){return function(_0x502ba1){try{jsonpatch['apply'](_0x502ba1,_0x1d1650,!![]);}catch(_0x36289a){return BPromise[_0xfc7d('0x22')](_0x36289a);}return _0x502ba1[_0xfc7d('0x23')]();};}function saveUpdates(_0x550356,_0x1af7df){return function(_0x3180cb){if(_0x3180cb){return _0x3180cb['update'](_0x550356)['then'](function(_0x3b86a5){return _0x3b86a5;});}return null;};}function removeEntity(_0x3d3022,_0x3dfe94){return function(_0x15fc74){if(_0x15fc74){return _0x15fc74[_0xfc7d('0x24')]()[_0xfc7d('0x25')](function(){_0x3d3022[_0xfc7d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37ac05,_0x33158f){return function(_0x3f289f){if(!_0x3f289f){_0x37ac05[_0xfc7d('0x19')](0x194);}return _0x3f289f;};}function handleError(_0xe4a971,_0x2e663e){_0x2e663e=_0x2e663e||0x1f4;return function(_0x2abfc3){logger['error'](_0x2abfc3[_0xfc7d('0x26')]);if(_0x2abfc3['name']){delete _0x2abfc3[_0xfc7d('0x27')];}_0xe4a971[_0xfc7d('0x1a')](_0x2e663e)[_0xfc7d('0x28')](_0x2abfc3);};}exports[_0xfc7d('0x29')]=function(_0x1cb0d1,_0x2c3450){var _0x4b6b25={},_0x429965={},_0x564326={'count':0x0,'rows':[]};var _0x4f27e1=_[_0xfc7d('0x2a')](db['SalesforceConfiguration'][_0xfc7d('0x2b')],function(_0x24ab58){return{'name':_0x24ab58[_0xfc7d('0x2c')],'type':_0x24ab58[_0xfc7d('0x2d')]['key']};});_0x429965[_0xfc7d('0x2e')]=_[_0xfc7d('0x2a')](_0x4f27e1,'name');_0x429965['query']=_[_0xfc7d('0x2f')](_0x1cb0d1[_0xfc7d('0x30')]);_0x429965['filters']=_[_0xfc7d('0x31')](_0x429965[_0xfc7d('0x2e')],_0x429965[_0xfc7d('0x30')]);_0x4b6b25['attributes']=_[_0xfc7d('0x31')](_0x429965[_0xfc7d('0x2e')],qs[_0xfc7d('0x32')](_0x1cb0d1['query']['fields']));_0x4b6b25[_0xfc7d('0x33')]=_0x4b6b25[_0xfc7d('0x33')]['length']?_0x4b6b25[_0xfc7d('0x33')]:_0x429965['model'];if(!_0x1cb0d1[_0xfc7d('0x30')][_0xfc7d('0x34')](_0xfc7d('0x35'))){_0x4b6b25[_0xfc7d('0x1e')]=qs[_0xfc7d('0x1e')](_0x1cb0d1[_0xfc7d('0x30')][_0xfc7d('0x1e')]);_0x4b6b25['offset']=qs[_0xfc7d('0x1c')](_0x1cb0d1[_0xfc7d('0x30')]['offset']);}_0x4b6b25['order']=qs['sort'](_0x1cb0d1[_0xfc7d('0x30')][_0xfc7d('0x36')]);_0x4b6b25[_0xfc7d('0x37')]=qs['filters'](_['pick'](_0x1cb0d1[_0xfc7d('0x30')],_0x429965['filters']),_0x4f27e1);if(_0x1cb0d1[_0xfc7d('0x30')][_0xfc7d('0x38')]){_0x4b6b25[_0xfc7d('0x37')]=_['merge'](_0x4b6b25[_0xfc7d('0x37')],{'$or':_['map'](_0x4f27e1,function(_0x3d4b75){if(_0x3d4b75[_0xfc7d('0x2d')]!==_0xfc7d('0x39')){var _0x87bdd8={};_0x87bdd8[_0x3d4b75[_0xfc7d('0x27')]]={'$like':'%'+_0x1cb0d1['query'][_0xfc7d('0x38')]+'%'};return _0x87bdd8;}})});}_0x4b6b25=_[_0xfc7d('0x3a')]({},_0x4b6b25,_0x1cb0d1[_0xfc7d('0x3b')]);var _0x4291a1={'where':_0x4b6b25[_0xfc7d('0x37')]};return db[_0xfc7d('0x3c')][_0xfc7d('0x1f')](_0x4291a1)['then'](function(_0x5a6e23){_0x564326[_0xfc7d('0x1f')]=_0x5a6e23;if(_0x1cb0d1[_0xfc7d('0x30')][_0xfc7d('0x3d')]){_0x4b6b25[_0xfc7d('0x3e')]=[{'all':!![]}];}return db[_0xfc7d('0x3c')]['findAll'](_0x4b6b25);})[_0xfc7d('0x25')](function(_0x1b5792){_0x564326[_0xfc7d('0x3f')]=_0x1b5792;return _0x564326;})[_0xfc7d('0x25')](respondWithFilteredResult(_0x2c3450,_0x4b6b25))[_0xfc7d('0x40')](handleError(_0x2c3450,null));};exports[_0xfc7d('0x41')]=function(_0x5ecf85,_0x44b834){var _0x2610f0={'raw':![],'where':{'id':_0x5ecf85[_0xfc7d('0x42')]['id']}},_0x2804a7={};_0x2804a7['model']=_['keys'](db[_0xfc7d('0x3c')][_0xfc7d('0x2b')]);_0x2804a7[_0xfc7d('0x30')]=_[_0xfc7d('0x2f')](_0x5ecf85[_0xfc7d('0x30')]);_0x2804a7[_0xfc7d('0x43')]=_[_0xfc7d('0x31')](_0x2804a7[_0xfc7d('0x2e')],_0x2804a7['query']);_0x2610f0[_0xfc7d('0x33')]=_['intersection'](_0x2804a7[_0xfc7d('0x2e')],qs['fields'](_0x5ecf85['query']['fields']));_0x2610f0[_0xfc7d('0x33')]=_0x2610f0['attributes'][_0xfc7d('0x44')]?_0x2610f0['attributes']:_0x2804a7[_0xfc7d('0x2e')];if(_0x5ecf85[_0xfc7d('0x30')][_0xfc7d('0x3d')]){_0x2610f0[_0xfc7d('0x3e')]=[{'all':!![]}];}_0x2610f0=_['merge']({},_0x2610f0,_0x5ecf85[_0xfc7d('0x3b')]);return db[_0xfc7d('0x3c')][_0xfc7d('0x45')](_0x2610f0)[_0xfc7d('0x25')](handleEntityNotFound(_0x44b834,null))[_0xfc7d('0x25')](respondWithResult(_0x44b834,null))[_0xfc7d('0x40')](handleError(_0x44b834,null));};exports['create']=function(_0x5a7b8d,_0x1a40b5){return db['SalesforceConfiguration'][_0xfc7d('0x46')](_0x5a7b8d['body'],{})[_0xfc7d('0x25')](respondWithResult(_0x1a40b5,0xc9))['catch'](handleError(_0x1a40b5,null));};exports[_0xfc7d('0x47')]=function(_0x26f255,_0x5e7f6f){if(_0x26f255[_0xfc7d('0x48')]['id']){delete _0x26f255[_0xfc7d('0x48')]['id'];}return db[_0xfc7d('0x3c')][_0xfc7d('0x45')]({'where':{'id':_0x26f255['params']['id']}})['then'](handleEntityNotFound(_0x5e7f6f,null))[_0xfc7d('0x25')](saveUpdates(_0x26f255[_0xfc7d('0x48')],null))[_0xfc7d('0x25')](respondWithResult(_0x5e7f6f,null))[_0xfc7d('0x40')](handleError(_0x5e7f6f,null));};exports[_0xfc7d('0x24')]=function(_0x117b1c,_0x3e4c01){return db[_0xfc7d('0x3c')][_0xfc7d('0x45')]({'where':{'id':_0x117b1c[_0xfc7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e4c01,null))[_0xfc7d('0x25')](removeEntity(_0x3e4c01,null))[_0xfc7d('0x40')](handleError(_0x3e4c01,null));};exports['getFields']=function(_0x1e451b,_0x5a8391,_0x723159){var _0x1ead44={};var _0x443d87={};var _0x187756;var _0x2bd5d5;return db[_0xfc7d('0x3c')][_0xfc7d('0x49')]({'where':{'id':_0x1e451b[_0xfc7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x5a8391,null))[_0xfc7d('0x25')](function(_0x8b367e){if(_0x8b367e){_0x187756=_0x8b367e;_0x443d87['model']=_[_0xfc7d('0x2f')](db[_0xfc7d('0x4a')][_0xfc7d('0x2b')]);_0x443d87[_0xfc7d('0x30')]=_[_0xfc7d('0x2f')](_0x1e451b[_0xfc7d('0x30')]);_0x443d87[_0xfc7d('0x43')]=_[_0xfc7d('0x31')](_0x443d87['model'],_0x443d87[_0xfc7d('0x30')]);_0x1ead44[_0xfc7d('0x33')]=_[_0xfc7d('0x31')](_0x443d87[_0xfc7d('0x2e')],qs[_0xfc7d('0x32')](_0x1e451b[_0xfc7d('0x30')][_0xfc7d('0x32')]));_0x1ead44['attributes']=_0x1ead44['attributes'][_0xfc7d('0x44')]?_0x1ead44['attributes']:_0x443d87[_0xfc7d('0x2e')];_0x1ead44[_0xfc7d('0x4b')]=qs[_0xfc7d('0x36')](_0x1e451b['query'][_0xfc7d('0x36')]);_0x1ead44[_0xfc7d('0x37')]=qs[_0xfc7d('0x43')](_['pick'](_0x1e451b[_0xfc7d('0x30')],_0x443d87[_0xfc7d('0x43')]));if(_0x1e451b[_0xfc7d('0x30')]['filter']){_0x1ead44[_0xfc7d('0x37')]=_[_0xfc7d('0x3a')](_0x1ead44[_0xfc7d('0x37')],{'$or':_[_0xfc7d('0x2a')](_0x1ead44[_0xfc7d('0x33')],function(_0x4eed6a){var _0x1b9d1d={};_0x1b9d1d[_0x4eed6a]={'$like':'%'+_0x1e451b[_0xfc7d('0x30')][_0xfc7d('0x38')]+'%'};return _0x1b9d1d;})});}_0x1ead44=_[_0xfc7d('0x3a')]({},_0x1ead44,_0x1e451b['options']);return _0x187756[_0xfc7d('0x4c')](_0x1ead44);}})[_0xfc7d('0x25')](function(_0x3cd908){if(_0x3cd908){_0x2bd5d5=_0x3cd908[_0xfc7d('0x44')];if(!_0x1e451b[_0xfc7d('0x30')]['hasOwnProperty'](_0xfc7d('0x35'))){_0x1ead44[_0xfc7d('0x1e')]=qs[_0xfc7d('0x1e')](_0x1e451b[_0xfc7d('0x30')][_0xfc7d('0x1e')]);_0x1ead44['offset']=qs[_0xfc7d('0x1c')](_0x1e451b[_0xfc7d('0x30')][_0xfc7d('0x1c')]);}return _0x187756['getFields'](_0x1ead44);}})[_0xfc7d('0x25')](function(_0x3fba01){if(_0x3fba01){return _0x3fba01?{'count':_0x2bd5d5,'rows':_0x3fba01}:null;}})[_0xfc7d('0x25')](respondWithResult(_0x5a8391,null))[_0xfc7d('0x40')](handleError(_0x5a8391,null));};exports['getSubjects']=function(_0x2e5ab6,_0x3412b3,_0x8035b3){var _0x38c111={};var _0x4812df={};var _0x2ef7f0;var _0x3d6793;return db[_0xfc7d('0x3c')][_0xfc7d('0x49')]({'where':{'id':_0x2e5ab6[_0xfc7d('0x42')]['id']}})[_0xfc7d('0x25')](handleEntityNotFound(_0x3412b3,null))['then'](function(_0x5ba2f7){if(_0x5ba2f7){_0x2ef7f0=_0x5ba2f7;_0x4812df[_0xfc7d('0x2e')]=_[_0xfc7d('0x2f')](db[_0xfc7d('0x4a')]['rawAttributes']);_0x4812df[_0xfc7d('0x30')]=_['keys'](_0x2e5ab6[_0xfc7d('0x30')]);_0x4812df['filters']=_['intersection'](_0x4812df['model'],_0x4812df[_0xfc7d('0x30')]);_0x38c111[_0xfc7d('0x33')]=_['intersection'](_0x4812df['model'],qs[_0xfc7d('0x32')](_0x2e5ab6[_0xfc7d('0x30')][_0xfc7d('0x32')]));_0x38c111[_0xfc7d('0x33')]=_0x38c111[_0xfc7d('0x33')][_0xfc7d('0x44')]?_0x38c111[_0xfc7d('0x33')]:_0x4812df['model'];_0x38c111['order']=qs[_0xfc7d('0x36')](_0x2e5ab6[_0xfc7d('0x30')]['sort']);_0x38c111[_0xfc7d('0x37')]=qs[_0xfc7d('0x43')](_[_0xfc7d('0x4d')](_0x2e5ab6[_0xfc7d('0x30')],_0x4812df[_0xfc7d('0x43')]));if(_0x2e5ab6[_0xfc7d('0x30')][_0xfc7d('0x38')]){_0x38c111['where']=_['merge'](_0x38c111[_0xfc7d('0x37')],{'$or':_[_0xfc7d('0x2a')](_0x38c111[_0xfc7d('0x33')],function(_0x3f01c5){var _0x7d1a4d={};_0x7d1a4d[_0x3f01c5]={'$like':'%'+_0x2e5ab6[_0xfc7d('0x30')]['filter']+'%'};return _0x7d1a4d;})});}_0x38c111=_['merge']({},_0x38c111,_0x2e5ab6[_0xfc7d('0x3b')]);return _0x2ef7f0['getSubjects'](_0x38c111);}})[_0xfc7d('0x25')](function(_0x2cea16){if(_0x2cea16){_0x3d6793=_0x2cea16[_0xfc7d('0x44')];if(!_0x2e5ab6[_0xfc7d('0x30')]['hasOwnProperty'](_0xfc7d('0x35'))){_0x38c111[_0xfc7d('0x1e')]=qs[_0xfc7d('0x1e')](_0x2e5ab6[_0xfc7d('0x30')]['limit']);_0x38c111['offset']=qs['offset'](_0x2e5ab6[_0xfc7d('0x30')][_0xfc7d('0x1c')]);}return _0x2ef7f0['getSubjects'](_0x38c111);}})['then'](function(_0x222d3){if(_0x222d3){return _0x222d3?{'count':_0x3d6793,'rows':_0x222d3}:null;}})[_0xfc7d('0x25')](respondWithResult(_0x3412b3,null))['catch'](handleError(_0x3412b3,null));};exports[_0xfc7d('0x4e')]=function(_0x2cd98b,_0x37609b,_0xd35b8a){var _0x148758={};var _0x5efdc9={};var _0x50127b;var _0x51195b;return db[_0xfc7d('0x3c')][_0xfc7d('0x49')]({'where':{'id':_0x2cd98b[_0xfc7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x37609b,null))['then'](function(_0x23cd00){if(_0x23cd00){_0x50127b=_0x23cd00;_0x5efdc9[_0xfc7d('0x2e')]=_[_0xfc7d('0x2f')](db[_0xfc7d('0x4a')][_0xfc7d('0x2b')]);_0x5efdc9[_0xfc7d('0x30')]=_[_0xfc7d('0x2f')](_0x2cd98b[_0xfc7d('0x30')]);_0x5efdc9[_0xfc7d('0x43')]=_[_0xfc7d('0x31')](_0x5efdc9[_0xfc7d('0x2e')],_0x5efdc9[_0xfc7d('0x30')]);_0x148758['attributes']=_[_0xfc7d('0x31')](_0x5efdc9[_0xfc7d('0x2e')],qs[_0xfc7d('0x32')](_0x2cd98b[_0xfc7d('0x30')][_0xfc7d('0x32')]));_0x148758[_0xfc7d('0x33')]=_0x148758[_0xfc7d('0x33')][_0xfc7d('0x44')]?_0x148758[_0xfc7d('0x33')]:_0x5efdc9[_0xfc7d('0x2e')];_0x148758[_0xfc7d('0x4b')]=qs[_0xfc7d('0x36')](_0x2cd98b[_0xfc7d('0x30')][_0xfc7d('0x36')]);_0x148758[_0xfc7d('0x37')]=qs['filters'](_[_0xfc7d('0x4d')](_0x2cd98b[_0xfc7d('0x30')],_0x5efdc9['filters']));if(_0x2cd98b[_0xfc7d('0x30')][_0xfc7d('0x38')]){_0x148758[_0xfc7d('0x37')]=_[_0xfc7d('0x3a')](_0x148758[_0xfc7d('0x37')],{'$or':_[_0xfc7d('0x2a')](_0x148758[_0xfc7d('0x33')],function(_0x440a29){var _0x3d0759={};_0x3d0759[_0x440a29]={'$like':'%'+_0x2cd98b['query'][_0xfc7d('0x38')]+'%'};return _0x3d0759;})});}_0x148758=_[_0xfc7d('0x3a')]({},_0x148758,_0x2cd98b[_0xfc7d('0x3b')]);return _0x50127b[_0xfc7d('0x4e')](_0x148758);}})['then'](function(_0x885c87){if(_0x885c87){_0x51195b=_0x885c87[_0xfc7d('0x44')];if(!_0x2cd98b[_0xfc7d('0x30')][_0xfc7d('0x34')](_0xfc7d('0x35'))){_0x148758[_0xfc7d('0x1e')]=qs[_0xfc7d('0x1e')](_0x2cd98b[_0xfc7d('0x30')][_0xfc7d('0x1e')]);_0x148758['offset']=qs[_0xfc7d('0x1c')](_0x2cd98b[_0xfc7d('0x30')][_0xfc7d('0x1c')]);}return _0x50127b[_0xfc7d('0x4e')](_0x148758);}})[_0xfc7d('0x25')](function(_0x3aeffb){if(_0x3aeffb){return _0x3aeffb?{'count':_0x51195b,'rows':_0x3aeffb}:null;}})['then'](respondWithResult(_0x37609b,null))[_0xfc7d('0x40')](handleError(_0x37609b,null));}; \ No newline at end of file +var _0x3916=['params','intersection','find','create','body','findOne','order','hasOwnProperty','nolimit','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes','length','sort','where','pick','filter','merge','options','includeAll','include','rows','catch'];(function(_0x57c0b5,_0x2eb95b){var _0x4b7bec=function(_0x14fb2a){while(--_0x14fb2a){_0x57c0b5['push'](_0x57c0b5['shift']());}};_0x4b7bec(++_0x2eb95b);}(_0x3916,0x18d));var _0x6391=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0x3916[_0x385c76];return _0x5c8367;};'use strict';var emlformat=require(_0x6391('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6391('0x1'));var jsonpatch=require(_0x6391('0x2'));var rp=require('request-promise');var moment=require(_0x6391('0x3'));var BPromise=require(_0x6391('0x4'));var Mustache=require(_0x6391('0x5'));var util=require('util');var path=require(_0x6391('0x6'));var sox=require(_0x6391('0x7'));var csv=require('to-csv');var ejs=require(_0x6391('0x8'));var fs=require('fs');var fs_extra=require(_0x6391('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6391('0xa'));var jsforce=require(_0x6391('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6391('0xc'));var querystring=require(_0x6391('0xd'));var Papa=require(_0x6391('0xe'));var Redis=require(_0x6391('0xf'));var authService=require(_0x6391('0x10'));var qs=require(_0x6391('0x11'));var as=require(_0x6391('0x12'));var hardwareService=require(_0x6391('0x13'));var logger=require(_0x6391('0x14'))('api');var utils=require(_0x6391('0x15'));var config=require(_0x6391('0x16'));var licenseUtil=require(_0x6391('0x17'));var db=require(_0x6391('0x18'))['db'];function respondWithStatusCode(_0x5b3248,_0x4e425b){_0x4e425b=_0x4e425b||0xcc;return function(_0x45255b){if(_0x45255b){return _0x5b3248[_0x6391('0x19')](_0x4e425b);}return _0x5b3248[_0x6391('0x1a')](_0x4e425b)[_0x6391('0x1b')]();};}function respondWithResult(_0x26c6d2,_0x399f71){_0x399f71=_0x399f71||0xc8;return function(_0x136a8b){if(_0x136a8b){return _0x26c6d2[_0x6391('0x1a')](_0x399f71)['json'](_0x136a8b);}};}function respondWithFilteredResult(_0x2702b5,_0x190594){return function(_0x4bcfae){if(_0x4bcfae){var _0x26aee3=typeof _0x190594[_0x6391('0x1c')]===_0x6391('0x1d')&&typeof _0x190594[_0x6391('0x1e')]===_0x6391('0x1d');var _0x474988=_0x4bcfae[_0x6391('0x1f')];var _0x489ba0=_0x26aee3?0x0:_0x190594[_0x6391('0x1c')];var _0x6b1613=_0x26aee3?_0x4bcfae[_0x6391('0x1f')]:_0x190594['offset']+_0x190594[_0x6391('0x1e')];var _0x907230;if(_0x6b1613>=_0x474988){_0x6b1613=_0x474988;_0x907230=0xc8;}else{_0x907230=0xce;}_0x2702b5[_0x6391('0x1a')](_0x907230);return _0x2702b5[_0x6391('0x20')]('Content-Range',_0x489ba0+'-'+_0x6b1613+'/'+_0x474988)[_0x6391('0x21')](_0x4bcfae);}return null;};}function patchUpdates(_0x3d58f8){return function(_0x696f8){try{jsonpatch['apply'](_0x696f8,_0x3d58f8,!![]);}catch(_0x1796f8){return BPromise[_0x6391('0x22')](_0x1796f8);}return _0x696f8[_0x6391('0x23')]();};}function saveUpdates(_0x1c96f4,_0x44f4d1){return function(_0x1d57e5){if(_0x1d57e5){return _0x1d57e5[_0x6391('0x24')](_0x1c96f4)[_0x6391('0x25')](function(_0x412b49){return _0x412b49;});}return null;};}function removeEntity(_0x446f80,_0x275ab0){return function(_0x819478){if(_0x819478){return _0x819478[_0x6391('0x26')]()[_0x6391('0x25')](function(){_0x446f80[_0x6391('0x1a')](0xcc)[_0x6391('0x1b')]();});}};}function handleEntityNotFound(_0x4dbe5c,_0x4dc9b5){return function(_0x2d4abd){if(!_0x2d4abd){_0x4dbe5c['sendStatus'](0x194);}return _0x2d4abd;};}function handleError(_0x3bf7b7,_0x5e50e9){_0x5e50e9=_0x5e50e9||0x1f4;return function(_0x536d69){logger[_0x6391('0x27')](_0x536d69[_0x6391('0x28')]);if(_0x536d69[_0x6391('0x29')]){delete _0x536d69['name'];}_0x3bf7b7[_0x6391('0x1a')](_0x5e50e9)['send'](_0x536d69);};}exports[_0x6391('0x2a')]=function(_0x408fd1,_0x2e61d7){var _0x23989f={},_0x263125={},_0x5cc050={'count':0x0,'rows':[]};var _0x31263a=_[_0x6391('0x2b')](db[_0x6391('0x2c')][_0x6391('0x2d')],function(_0x504d25){return{'name':_0x504d25[_0x6391('0x2e')],'type':_0x504d25[_0x6391('0x2f')]['key']};});_0x263125[_0x6391('0x30')]=_['map'](_0x31263a,_0x6391('0x29'));_0x263125[_0x6391('0x31')]=_[_0x6391('0x32')](_0x408fd1['query']);_0x263125[_0x6391('0x33')]=_['intersection'](_0x263125['model'],_0x263125[_0x6391('0x31')]);_0x23989f['attributes']=_['intersection'](_0x263125[_0x6391('0x30')],qs[_0x6391('0x34')](_0x408fd1[_0x6391('0x31')][_0x6391('0x34')]));_0x23989f['attributes']=_0x23989f[_0x6391('0x35')][_0x6391('0x36')]?_0x23989f[_0x6391('0x35')]:_0x263125[_0x6391('0x30')];if(!_0x408fd1[_0x6391('0x31')]['hasOwnProperty']('nolimit')){_0x23989f[_0x6391('0x1e')]=qs[_0x6391('0x1e')](_0x408fd1[_0x6391('0x31')][_0x6391('0x1e')]);_0x23989f[_0x6391('0x1c')]=qs[_0x6391('0x1c')](_0x408fd1[_0x6391('0x31')]['offset']);}_0x23989f['order']=qs[_0x6391('0x37')](_0x408fd1['query'][_0x6391('0x37')]);_0x23989f[_0x6391('0x38')]=qs[_0x6391('0x33')](_[_0x6391('0x39')](_0x408fd1['query'],_0x263125[_0x6391('0x33')]),_0x31263a);if(_0x408fd1[_0x6391('0x31')][_0x6391('0x3a')]){_0x23989f['where']=_[_0x6391('0x3b')](_0x23989f[_0x6391('0x38')],{'$or':_['map'](_0x31263a,function(_0x1025f3){if(_0x1025f3[_0x6391('0x2f')]!=='VIRTUAL'){var _0x562d15={};_0x562d15[_0x1025f3[_0x6391('0x29')]]={'$like':'%'+_0x408fd1[_0x6391('0x31')][_0x6391('0x3a')]+'%'};return _0x562d15;}})});}_0x23989f=_['merge']({},_0x23989f,_0x408fd1[_0x6391('0x3c')]);var _0x1dd3cc={'where':_0x23989f['where']};return db['SalesforceConfiguration'][_0x6391('0x1f')](_0x1dd3cc)[_0x6391('0x25')](function(_0x42af10){_0x5cc050['count']=_0x42af10;if(_0x408fd1[_0x6391('0x31')][_0x6391('0x3d')]){_0x23989f[_0x6391('0x3e')]=[{'all':!![]}];}return db[_0x6391('0x2c')]['findAll'](_0x23989f);})['then'](function(_0x43d0b4){_0x5cc050[_0x6391('0x3f')]=_0x43d0b4;return _0x5cc050;})['then'](respondWithFilteredResult(_0x2e61d7,_0x23989f))[_0x6391('0x40')](handleError(_0x2e61d7,null));};exports['show']=function(_0x2b44f5,_0x287f7d){var _0x9455fa={'raw':![],'where':{'id':_0x2b44f5[_0x6391('0x41')]['id']}},_0x359bbd={};_0x359bbd[_0x6391('0x30')]=_[_0x6391('0x32')](db[_0x6391('0x2c')]['rawAttributes']);_0x359bbd[_0x6391('0x31')]=_[_0x6391('0x32')](_0x2b44f5[_0x6391('0x31')]);_0x359bbd[_0x6391('0x33')]=_['intersection'](_0x359bbd['model'],_0x359bbd['query']);_0x9455fa[_0x6391('0x35')]=_[_0x6391('0x42')](_0x359bbd[_0x6391('0x30')],qs[_0x6391('0x34')](_0x2b44f5[_0x6391('0x31')][_0x6391('0x34')]));_0x9455fa[_0x6391('0x35')]=_0x9455fa['attributes'][_0x6391('0x36')]?_0x9455fa[_0x6391('0x35')]:_0x359bbd[_0x6391('0x30')];if(_0x2b44f5[_0x6391('0x31')][_0x6391('0x3d')]){_0x9455fa[_0x6391('0x3e')]=[{'all':!![]}];}_0x9455fa=_['merge']({},_0x9455fa,_0x2b44f5['options']);return db[_0x6391('0x2c')][_0x6391('0x43')](_0x9455fa)[_0x6391('0x25')](handleEntityNotFound(_0x287f7d,null))['then'](respondWithResult(_0x287f7d,null))[_0x6391('0x40')](handleError(_0x287f7d,null));};exports[_0x6391('0x44')]=function(_0x24920d,_0x23a699){return db[_0x6391('0x2c')]['create'](_0x24920d[_0x6391('0x45')],{})['then'](respondWithResult(_0x23a699,0xc9))[_0x6391('0x40')](handleError(_0x23a699,null));};exports['update']=function(_0x114a88,_0x2c21a5){if(_0x114a88['body']['id']){delete _0x114a88['body']['id'];}return db[_0x6391('0x2c')]['find']({'where':{'id':_0x114a88[_0x6391('0x41')]['id']}})[_0x6391('0x25')](handleEntityNotFound(_0x2c21a5,null))[_0x6391('0x25')](saveUpdates(_0x114a88[_0x6391('0x45')],null))[_0x6391('0x25')](respondWithResult(_0x2c21a5,null))[_0x6391('0x40')](handleError(_0x2c21a5,null));};exports[_0x6391('0x26')]=function(_0x99ddb0,_0x5917d1){return db[_0x6391('0x2c')][_0x6391('0x43')]({'where':{'id':_0x99ddb0['params']['id']}})[_0x6391('0x25')](handleEntityNotFound(_0x5917d1,null))['then'](removeEntity(_0x5917d1,null))[_0x6391('0x40')](handleError(_0x5917d1,null));};exports['getFields']=function(_0x347eb9,_0x2b26b5,_0x1da26c){var _0x24ad34={};var _0x4f5d8f={};var _0xf45606;var _0x29ffb9;return db[_0x6391('0x2c')][_0x6391('0x46')]({'where':{'id':_0x347eb9[_0x6391('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b26b5,null))['then'](function(_0x494554){if(_0x494554){_0xf45606=_0x494554;_0x4f5d8f['model']=_[_0x6391('0x32')](db['SalesforceField'][_0x6391('0x2d')]);_0x4f5d8f[_0x6391('0x31')]=_[_0x6391('0x32')](_0x347eb9['query']);_0x4f5d8f['filters']=_['intersection'](_0x4f5d8f[_0x6391('0x30')],_0x4f5d8f[_0x6391('0x31')]);_0x24ad34[_0x6391('0x35')]=_[_0x6391('0x42')](_0x4f5d8f[_0x6391('0x30')],qs[_0x6391('0x34')](_0x347eb9['query'][_0x6391('0x34')]));_0x24ad34[_0x6391('0x35')]=_0x24ad34['attributes'][_0x6391('0x36')]?_0x24ad34[_0x6391('0x35')]:_0x4f5d8f[_0x6391('0x30')];_0x24ad34[_0x6391('0x47')]=qs[_0x6391('0x37')](_0x347eb9['query'][_0x6391('0x37')]);_0x24ad34[_0x6391('0x38')]=qs['filters'](_['pick'](_0x347eb9[_0x6391('0x31')],_0x4f5d8f[_0x6391('0x33')]));if(_0x347eb9[_0x6391('0x31')][_0x6391('0x3a')]){_0x24ad34['where']=_[_0x6391('0x3b')](_0x24ad34[_0x6391('0x38')],{'$or':_[_0x6391('0x2b')](_0x24ad34[_0x6391('0x35')],function(_0x2525ed){var _0x53da9e={};_0x53da9e[_0x2525ed]={'$like':'%'+_0x347eb9[_0x6391('0x31')]['filter']+'%'};return _0x53da9e;})});}_0x24ad34=_[_0x6391('0x3b')]({},_0x24ad34,_0x347eb9[_0x6391('0x3c')]);return _0xf45606['getFields'](_0x24ad34);}})[_0x6391('0x25')](function(_0x6e5b73){if(_0x6e5b73){_0x29ffb9=_0x6e5b73[_0x6391('0x36')];if(!_0x347eb9['query'][_0x6391('0x48')](_0x6391('0x49'))){_0x24ad34[_0x6391('0x1e')]=qs[_0x6391('0x1e')](_0x347eb9[_0x6391('0x31')]['limit']);_0x24ad34[_0x6391('0x1c')]=qs[_0x6391('0x1c')](_0x347eb9[_0x6391('0x31')][_0x6391('0x1c')]);}return _0xf45606[_0x6391('0x4a')](_0x24ad34);}})['then'](function(_0x512014){if(_0x512014){return _0x512014?{'count':_0x29ffb9,'rows':_0x512014}:null;}})[_0x6391('0x25')](respondWithResult(_0x2b26b5,null))[_0x6391('0x40')](handleError(_0x2b26b5,null));};exports['getSubjects']=function(_0x3ecd4c,_0x5be6ac,_0x4788f6){var _0x5b223d={};var _0x34a865={};var _0x150bef;var _0x10ee7b;return db[_0x6391('0x2c')]['findOne']({'where':{'id':_0x3ecd4c['params']['id']}})[_0x6391('0x25')](handleEntityNotFound(_0x5be6ac,null))[_0x6391('0x25')](function(_0x28db20){if(_0x28db20){_0x150bef=_0x28db20;_0x34a865[_0x6391('0x30')]=_['keys'](db['SalesforceField'][_0x6391('0x2d')]);_0x34a865['query']=_['keys'](_0x3ecd4c[_0x6391('0x31')]);_0x34a865[_0x6391('0x33')]=_[_0x6391('0x42')](_0x34a865[_0x6391('0x30')],_0x34a865[_0x6391('0x31')]);_0x5b223d[_0x6391('0x35')]=_[_0x6391('0x42')](_0x34a865['model'],qs[_0x6391('0x34')](_0x3ecd4c[_0x6391('0x31')][_0x6391('0x34')]));_0x5b223d[_0x6391('0x35')]=_0x5b223d['attributes'][_0x6391('0x36')]?_0x5b223d['attributes']:_0x34a865[_0x6391('0x30')];_0x5b223d[_0x6391('0x47')]=qs['sort'](_0x3ecd4c[_0x6391('0x31')][_0x6391('0x37')]);_0x5b223d[_0x6391('0x38')]=qs[_0x6391('0x33')](_['pick'](_0x3ecd4c[_0x6391('0x31')],_0x34a865[_0x6391('0x33')]));if(_0x3ecd4c['query'][_0x6391('0x3a')]){_0x5b223d[_0x6391('0x38')]=_['merge'](_0x5b223d[_0x6391('0x38')],{'$or':_[_0x6391('0x2b')](_0x5b223d['attributes'],function(_0x2965f0){var _0x2a641d={};_0x2a641d[_0x2965f0]={'$like':'%'+_0x3ecd4c[_0x6391('0x31')][_0x6391('0x3a')]+'%'};return _0x2a641d;})});}_0x5b223d=_['merge']({},_0x5b223d,_0x3ecd4c[_0x6391('0x3c')]);return _0x150bef['getSubjects'](_0x5b223d);}})[_0x6391('0x25')](function(_0x458f7f){if(_0x458f7f){_0x10ee7b=_0x458f7f['length'];if(!_0x3ecd4c['query']['hasOwnProperty'](_0x6391('0x49'))){_0x5b223d[_0x6391('0x1e')]=qs['limit'](_0x3ecd4c['query'][_0x6391('0x1e')]);_0x5b223d[_0x6391('0x1c')]=qs[_0x6391('0x1c')](_0x3ecd4c[_0x6391('0x31')][_0x6391('0x1c')]);}return _0x150bef[_0x6391('0x4b')](_0x5b223d);}})[_0x6391('0x25')](function(_0x39d612){if(_0x39d612){return _0x39d612?{'count':_0x10ee7b,'rows':_0x39d612}:null;}})[_0x6391('0x25')](respondWithResult(_0x5be6ac,null))[_0x6391('0x40')](handleError(_0x5be6ac,null));};exports[_0x6391('0x4c')]=function(_0x120ca7,_0x59f6d0,_0x20236f){var _0x34b6ee={};var _0x282351={};var _0x327272;var _0x33d5da;return db['SalesforceConfiguration'][_0x6391('0x46')]({'where':{'id':_0x120ca7[_0x6391('0x41')]['id']}})[_0x6391('0x25')](handleEntityNotFound(_0x59f6d0,null))[_0x6391('0x25')](function(_0x12c468){if(_0x12c468){_0x327272=_0x12c468;_0x282351[_0x6391('0x30')]=_[_0x6391('0x32')](db['SalesforceField']['rawAttributes']);_0x282351[_0x6391('0x31')]=_[_0x6391('0x32')](_0x120ca7[_0x6391('0x31')]);_0x282351[_0x6391('0x33')]=_['intersection'](_0x282351['model'],_0x282351['query']);_0x34b6ee[_0x6391('0x35')]=_['intersection'](_0x282351[_0x6391('0x30')],qs[_0x6391('0x34')](_0x120ca7[_0x6391('0x31')][_0x6391('0x34')]));_0x34b6ee['attributes']=_0x34b6ee[_0x6391('0x35')][_0x6391('0x36')]?_0x34b6ee['attributes']:_0x282351['model'];_0x34b6ee[_0x6391('0x47')]=qs[_0x6391('0x37')](_0x120ca7[_0x6391('0x31')]['sort']);_0x34b6ee[_0x6391('0x38')]=qs[_0x6391('0x33')](_[_0x6391('0x39')](_0x120ca7[_0x6391('0x31')],_0x282351['filters']));if(_0x120ca7['query'][_0x6391('0x3a')]){_0x34b6ee[_0x6391('0x38')]=_['merge'](_0x34b6ee[_0x6391('0x38')],{'$or':_[_0x6391('0x2b')](_0x34b6ee[_0x6391('0x35')],function(_0x4c26bb){var _0x1a3a35={};_0x1a3a35[_0x4c26bb]={'$like':'%'+_0x120ca7[_0x6391('0x31')][_0x6391('0x3a')]+'%'};return _0x1a3a35;})});}_0x34b6ee=_[_0x6391('0x3b')]({},_0x34b6ee,_0x120ca7[_0x6391('0x3c')]);return _0x327272[_0x6391('0x4c')](_0x34b6ee);}})[_0x6391('0x25')](function(_0x12ac15){if(_0x12ac15){_0x33d5da=_0x12ac15[_0x6391('0x36')];if(!_0x120ca7[_0x6391('0x31')][_0x6391('0x48')](_0x6391('0x49'))){_0x34b6ee[_0x6391('0x1e')]=qs['limit'](_0x120ca7[_0x6391('0x31')][_0x6391('0x1e')]);_0x34b6ee['offset']=qs[_0x6391('0x1c')](_0x120ca7['query'][_0x6391('0x1c')]);}return _0x327272[_0x6391('0x4c')](_0x34b6ee);}})['then'](function(_0x389834){if(_0x389834){return _0x389834?{'count':_0x33d5da,'rows':_0x389834}:null;}})[_0x6391('0x25')](respondWithResult(_0x59f6d0,null))['catch'](handleError(_0x59f6d0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 54a32ac..5decf03 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cce=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cce,0xfb));var _0xe6cc=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x6cce[_0x5f3f88];return _0xd08119;};'use strict';var _=require('lodash');var util=require(_0xe6cc('0x0'));var logger=require(_0xe6cc('0x1'))(_0xe6cc('0x2'));var moment=require(_0xe6cc('0x3'));var BPromise=require(_0xe6cc('0x4'));var rp=require(_0xe6cc('0x5'));var fs=require('fs');var path=require(_0xe6cc('0x6'));var rimraf=require('rimraf');var config=require(_0xe6cc('0x7'));var attributes=require(_0xe6cc('0x8'));module[_0xe6cc('0x9')]=function(_0x558405,_0x21b32d){return _0x558405[_0xe6cc('0xa')](_0xe6cc('0xb'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56a4=['SalesforceConfiguration','int_salesforce_configurations','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x4975c5,_0x1ca463){var _0x5ebf72=function(_0x3dfd32){while(--_0x3dfd32){_0x4975c5['push'](_0x4975c5['shift']());}};_0x5ebf72(++_0x1ca463);}(_0x56a4,0x158));var _0x456a=function(_0x3eb211,_0x4a2e7f){_0x3eb211=_0x3eb211-0x0;var _0xb32a15=_0x56a4[_0x3eb211];return _0xb32a15;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x456a('0x0'));var moment=require(_0x456a('0x1'));var BPromise=require('bluebird');var rp=require(_0x456a('0x2'));var fs=require('fs');var path=require(_0x456a('0x3'));var rimraf=require(_0x456a('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x456a('0x5')]=function(_0x11a27b,_0x2919c5){return _0x11a27b[_0x456a('0x6')](_0x456a('0x7'),attributes,{'tableName':_0x456a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 43b3b30..3f3f046 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf460=['code','message','info','catch','lodash','util','moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x124eea,_0x48fe8b){var _0x23ecbb=function(_0x12abac){while(--_0x12abac){_0x124eea['push'](_0x124eea['shift']());}};_0x23ecbb(++_0x48fe8b);}(_0xf460,0x76));var _0x0f46=function(_0x2ec61c,_0x42e01f){_0x2ec61c=_0x2ec61c-0x0;var _0x18ec57=_0xf460[_0x2ec61c];return _0x18ec57;};'use strict';var _=require(_0x0f46('0x0'));var util=require(_0x0f46('0x1'));var moment=require(_0x0f46('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(_0x0f46('0x3'));var logger=require(_0x0f46('0x4'))('rpc');var config=require(_0x0f46('0x5'));var jayson=require(_0x0f46('0x6'));var client=jayson[_0x0f46('0x7')][_0x0f46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25787a,_0x4c0890,_0x494c02){return new BPromise(function(_0x48f938,_0x5aa355){return client[_0x0f46('0x9')](_0x25787a,_0x494c02)['then'](function(_0x1066a6){logger['info'](_0x0f46('0xa'),_0x4c0890,_0x0f46('0xb'));logger[_0x0f46('0xc')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4c0890,'request\x20sent',JSON[_0x0f46('0xd')](_0x1066a6));if(_0x1066a6['error']){if(_0x1066a6[_0x0f46('0xe')][_0x0f46('0xf')]===0x1f4){logger[_0x0f46('0xe')](_0x0f46('0xa'),_0x4c0890,_0x1066a6['error'][_0x0f46('0x10')]);return _0x5aa355(_0x1066a6[_0x0f46('0xe')][_0x0f46('0x10')]);}logger[_0x0f46('0xe')](_0x0f46('0xa'),_0x4c0890,_0x1066a6[_0x0f46('0xe')][_0x0f46('0x10')]);return _0x48f938(_0x1066a6['error'][_0x0f46('0x10')]);}else{logger[_0x0f46('0x11')](_0x0f46('0xa'),_0x4c0890,_0x0f46('0xb'));_0x48f938(_0x1066a6['result'][_0x0f46('0x10')]);}})[_0x0f46('0x12')](function(_0x1c89c1){logger[_0x0f46('0xe')](_0x0f46('0xa'),_0x4c0890,_0x1c89c1);_0x5aa355(_0x1c89c1);});});} \ No newline at end of file +var _0x7681=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x7681,0x15a));var _0x1768=function(_0x7da7eb,_0xa6ba2a){_0x7da7eb=_0x7da7eb-0x0;var _0x3fb06e=_0x7681[_0x7da7eb];return _0x3fb06e;};'use strict';var _=require(_0x1768('0x0'));var util=require(_0x1768('0x1'));var moment=require(_0x1768('0x2'));var BPromise=require('bluebird');var rs=require(_0x1768('0x3'));var fs=require('fs');var Redis=require(_0x1768('0x4'));var db=require(_0x1768('0x5'))['db'];var utils=require(_0x1768('0x6'));var logger=require(_0x1768('0x7'))(_0x1768('0x8'));var config=require(_0x1768('0x9'));var jayson=require(_0x1768('0xa'));var client=jayson[_0x1768('0xb')][_0x1768('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ec624,_0x736089,_0x20bf9c){return new BPromise(function(_0xfa5bc2,_0x32e1bb){return client[_0x1768('0xd')](_0x5ec624,_0x20bf9c)[_0x1768('0xe')](function(_0x87d4fa){logger['info'](_0x1768('0xf'),_0x736089,_0x1768('0x10'));logger['debug'](_0x1768('0x11'),_0x736089,_0x1768('0x10'),JSON[_0x1768('0x12')](_0x87d4fa));if(_0x87d4fa[_0x1768('0x13')]){if(_0x87d4fa[_0x1768('0x13')][_0x1768('0x14')]===0x1f4){logger['error'](_0x1768('0xf'),_0x736089,_0x87d4fa[_0x1768('0x13')]['message']);return _0x32e1bb(_0x87d4fa[_0x1768('0x13')]['message']);}logger[_0x1768('0x13')](_0x1768('0xf'),_0x736089,_0x87d4fa[_0x1768('0x13')]['message']);return _0xfa5bc2(_0x87d4fa['error'][_0x1768('0x15')]);}else{logger[_0x1768('0x16')]('SalesforceConfiguration,\x20%s,\x20%s',_0x736089,_0x1768('0x10'));_0xfa5bc2(_0x87d4fa[_0x1768('0x17')][_0x1768('0x15')]);}})[_0x1768('0x18')](function(_0x2f2360){logger[_0x1768('0x13')](_0x1768('0xf'),_0x736089,_0x2f2360);_0x32e1bb(_0x2f2360);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index e62feb5..f3d59a3 100644 --- a/server/api/intSalesforceField/index.js +++ b/server/api/intSalesforceField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf479=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','path'];(function(_0x280c03,_0x5ba994){var _0x5e271e=function(_0x2fbc31){while(--_0x2fbc31){_0x280c03['push'](_0x280c03['shift']());}};_0x5e271e(++_0x5ba994);}(_0xf479,0x1eb));var _0x9f47=function(_0x43644b,_0xeee395){_0x43644b=_0x43644b-0x0;var _0x46627c=_0xf479[_0x43644b];return _0x46627c;};'use strict';var multer=require(_0x9f47('0x0'));var util=require('util');var path=require(_0x9f47('0x1'));var timeout=require('connect-timeout');var express=require(_0x9f47('0x2'));var router=express['Router']();var fs_extra=require(_0x9f47('0x3'));var auth=require(_0x9f47('0x4'));var interaction=require(_0x9f47('0x5'));var config=require(_0x9f47('0x6'));var controller=require(_0x9f47('0x7'));router[_0x9f47('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9f47('0x8')](_0x9f47('0x9'),auth[_0x9f47('0xa')](),controller[_0x9f47('0xb')]);router[_0x9f47('0xc')]('/',auth[_0x9f47('0xa')](),controller[_0x9f47('0xd')]);router['put'](_0x9f47('0x9'),auth[_0x9f47('0xa')](),controller['update']);router[_0x9f47('0xe')](_0x9f47('0x9'),auth[_0x9f47('0xa')](),controller[_0x9f47('0xf')]);module[_0x9f47('0x10')]=router; \ No newline at end of file +var _0x33e6=['util','express','../../components/auth/service','./intSalesforceField.controller','get','index','show','post','isAuthenticated','create','put','/:id','delete','destroy','exports','multer'];(function(_0x17c64b,_0x38ae9c){var _0x5ca37f=function(_0x5c32d1){while(--_0x5c32d1){_0x17c64b['push'](_0x17c64b['shift']());}};_0x5ca37f(++_0x38ae9c);}(_0x33e6,0x1cf));var _0x633e=function(_0x328212,_0x837c7c){_0x328212=_0x328212-0x0;var _0x18d90d=_0x33e6[_0x328212];return _0x18d90d;};'use strict';var multer=require(_0x633e('0x0'));var util=require(_0x633e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x633e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x633e('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x633e('0x4'));router[_0x633e('0x5')]('/',auth['isAuthenticated'](),controller[_0x633e('0x6')]);router[_0x633e('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x633e('0x7')]);router[_0x633e('0x8')]('/',auth[_0x633e('0x9')](),controller[_0x633e('0xa')]);router[_0x633e('0xb')](_0x633e('0xc'),auth[_0x633e('0x9')](),controller['update']);router[_0x633e('0xd')](_0x633e('0xc'),auth['isAuthenticated'](),controller[_0x633e('0xe')]);module[_0x633e('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index cbed5cf..f11b190 100644 --- a/server/api/intSalesforceField/intSalesforceField.attributes.js +++ b/server/api/intSalesforceField/intSalesforceField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x217b=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','sequelize','exports'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x217b,0xc4));var _0xb217=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x217b[_0x3430aa];return _0x2ac5c;};'use strict';var Sequelize=require(_0xb217('0x0'));module[_0xb217('0x1')]={'type':{'type':Sequelize[_0xb217('0x2')](_0xb217('0x3'),'variable',_0xb217('0x4'),_0xb217('0x5'),_0xb217('0x6')),'defaultValue':_0xb217('0x3')},'content':{'type':Sequelize[_0xb217('0x7')]},'key':{'type':Sequelize[_0xb217('0x7')]},'keyType':{'type':Sequelize[_0xb217('0x2')](_0xb217('0x3'),_0xb217('0x8'),_0xb217('0x4'))},'keyContent':{'type':Sequelize[_0xb217('0x7')]},'idField':{'type':Sequelize[_0xb217('0x7')]},'variableName':{'type':Sequelize[_0xb217('0x7')]}}; \ No newline at end of file +var _0xf0c8=['string','STRING','variable','exports','ENUM','customVariable','picklist'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf0c8,0x88));var _0x8f0c=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0xf0c8[_0x172ed7];return _0xfa8f61;};'use strict';var Sequelize=require('sequelize');module[_0x8f0c('0x0')]={'type':{'type':Sequelize[_0x8f0c('0x1')]('string','variable',_0x8f0c('0x2'),'keyValue',_0x8f0c('0x3')),'defaultValue':_0x8f0c('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8f0c('0x5')]},'keyType':{'type':Sequelize[_0x8f0c('0x1')](_0x8f0c('0x4'),_0x8f0c('0x6'),_0x8f0c('0x2'))},'keyContent':{'type':Sequelize[_0x8f0c('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 2de0b89..a97b6ce 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x613a=['key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','fields','options','find','create','body','catch','update','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','sendStatus','stack','name','send','map','SalesforceField','rawAttributes','type'];(function(_0x3e0934,_0x4dcffd){var _0x5b025f=function(_0x1f896d){while(--_0x1f896d){_0x3e0934['push'](_0x3e0934['shift']());}};_0x5b025f(++_0x4dcffd);}(_0x613a,0xaf));var _0xa613=function(_0x3dc55a,_0xcb1cfc){_0x3dc55a=_0x3dc55a-0x0;var _0x435941=_0x613a[_0x3dc55a];return _0x435941;};'use strict';var emlformat=require(_0xa613('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa613('0x1'));var rp=require(_0xa613('0x2'));var moment=require(_0xa613('0x3'));var BPromise=require(_0xa613('0x4'));var Mustache=require(_0xa613('0x5'));var util=require(_0xa613('0x6'));var path=require(_0xa613('0x7'));var sox=require(_0xa613('0x8'));var csv=require('to-csv');var ejs=require(_0xa613('0x9'));var fs=require('fs');var fs_extra=require(_0xa613('0xa'));var _=require('lodash');var squel=require(_0xa613('0xb'));var crypto=require(_0xa613('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa613('0xd'));var toCsv=require(_0xa613('0xe'));var querystring=require(_0xa613('0xf'));var Papa=require(_0xa613('0x10'));var Redis=require(_0xa613('0x11'));var authService=require(_0xa613('0x12'));var qs=require(_0xa613('0x13'));var as=require(_0xa613('0x14'));var hardwareService=require(_0xa613('0x15'));var logger=require('../../config/logger')(_0xa613('0x16'));var utils=require('../../config/utils');var config=require(_0xa613('0x17'));var licenseUtil=require(_0xa613('0x18'));var db=require(_0xa613('0x19'))['db'];function respondWithStatusCode(_0x3a725d,_0x2d7adc){_0x2d7adc=_0x2d7adc||0xcc;return function(_0x3bada8){if(_0x3bada8){return _0x3a725d['sendStatus'](_0x2d7adc);}return _0x3a725d[_0xa613('0x1a')](_0x2d7adc)[_0xa613('0x1b')]();};}function respondWithResult(_0x173ff0,_0x15907e){_0x15907e=_0x15907e||0xc8;return function(_0xe7a3c6){if(_0xe7a3c6){return _0x173ff0[_0xa613('0x1a')](_0x15907e)[_0xa613('0x1c')](_0xe7a3c6);}};}function respondWithFilteredResult(_0x443064,_0x218dda){return function(_0x4e1d97){if(_0x4e1d97){var _0x4fa6e1=typeof _0x218dda[_0xa613('0x1d')]===_0xa613('0x1e')&&typeof _0x218dda['limit']===_0xa613('0x1e');var _0x57a974=_0x4e1d97[_0xa613('0x1f')];var _0x245888=_0x4fa6e1?0x0:_0x218dda[_0xa613('0x1d')];var _0x159b6a=_0x4fa6e1?_0x4e1d97['count']:_0x218dda[_0xa613('0x1d')]+_0x218dda[_0xa613('0x20')];var _0x39e2dd;if(_0x159b6a>=_0x57a974){_0x159b6a=_0x57a974;_0x39e2dd=0xc8;}else{_0x39e2dd=0xce;}_0x443064['status'](_0x39e2dd);return _0x443064[_0xa613('0x21')](_0xa613('0x22'),_0x245888+'-'+_0x159b6a+'/'+_0x57a974)[_0xa613('0x1c')](_0x4e1d97);}return null;};}function patchUpdates(_0x2b4e11){return function(_0x2ef559){try{jsonpatch['apply'](_0x2ef559,_0x2b4e11,!![]);}catch(_0x564bf7){return BPromise[_0xa613('0x23')](_0x564bf7);}return _0x2ef559[_0xa613('0x24')]();};}function saveUpdates(_0x5f13cc,_0x31b2bb){return function(_0x210378){if(_0x210378){return _0x210378['update'](_0x5f13cc)[_0xa613('0x25')](function(_0x29382a){return _0x29382a;});}return null;};}function removeEntity(_0x3cae10,_0x26814f){return function(_0x71c848){if(_0x71c848){return _0x71c848[_0xa613('0x26')]()[_0xa613('0x25')](function(){_0x3cae10['status'](0xcc)[_0xa613('0x1b')]();});}};}function handleEntityNotFound(_0x43cb4f,_0x32bf67){return function(_0x1627c2){if(!_0x1627c2){_0x43cb4f[_0xa613('0x27')](0x194);}return _0x1627c2;};}function handleError(_0x100c65,_0x519901){_0x519901=_0x519901||0x1f4;return function(_0x4917b0){logger['error'](_0x4917b0[_0xa613('0x28')]);if(_0x4917b0[_0xa613('0x29')]){delete _0x4917b0['name'];}_0x100c65['status'](_0x519901)[_0xa613('0x2a')](_0x4917b0);};}exports['index']=function(_0x36b897,_0x1cfbf1){var _0x4686f2={},_0x3d11c1={},_0x1beba9={'count':0x0,'rows':[]};var _0x1dae20=_[_0xa613('0x2b')](db[_0xa613('0x2c')][_0xa613('0x2d')],function(_0x90a1d6){return{'name':_0x90a1d6['fieldName'],'type':_0x90a1d6[_0xa613('0x2e')][_0xa613('0x2f')]};});_0x3d11c1[_0xa613('0x30')]=_[_0xa613('0x2b')](_0x1dae20,_0xa613('0x29'));_0x3d11c1[_0xa613('0x31')]=_[_0xa613('0x32')](_0x36b897[_0xa613('0x31')]);_0x3d11c1[_0xa613('0x33')]=_[_0xa613('0x34')](_0x3d11c1[_0xa613('0x30')],_0x3d11c1[_0xa613('0x31')]);_0x4686f2['attributes']=_['intersection'](_0x3d11c1['model'],qs['fields'](_0x36b897['query']['fields']));_0x4686f2['attributes']=_0x4686f2[_0xa613('0x35')][_0xa613('0x36')]?_0x4686f2['attributes']:_0x3d11c1[_0xa613('0x30')];if(!_0x36b897[_0xa613('0x31')]['hasOwnProperty'](_0xa613('0x37'))){_0x4686f2[_0xa613('0x20')]=qs[_0xa613('0x20')](_0x36b897[_0xa613('0x31')][_0xa613('0x20')]);_0x4686f2['offset']=qs[_0xa613('0x1d')](_0x36b897[_0xa613('0x31')]['offset']);}_0x4686f2[_0xa613('0x38')]=qs[_0xa613('0x39')](_0x36b897['query']['sort']);_0x4686f2[_0xa613('0x3a')]=qs[_0xa613('0x33')](_['pick'](_0x36b897[_0xa613('0x31')],_0x3d11c1[_0xa613('0x33')]),_0x1dae20);if(_0x36b897[_0xa613('0x31')][_0xa613('0x3b')]){_0x4686f2['where']=_[_0xa613('0x3c')](_0x4686f2['where'],{'$or':_['map'](_0x1dae20,function(_0x51a0a1){if(_0x51a0a1[_0xa613('0x2e')]!==_0xa613('0x3d')){var _0x375edc={};_0x375edc[_0x51a0a1[_0xa613('0x29')]]={'$like':'%'+_0x36b897[_0xa613('0x31')][_0xa613('0x3b')]+'%'};return _0x375edc;}})});}_0x4686f2=_[_0xa613('0x3c')]({},_0x4686f2,_0x36b897['options']);var _0x2f5c3b={'where':_0x4686f2[_0xa613('0x3a')]};return db[_0xa613('0x2c')]['count'](_0x2f5c3b)[_0xa613('0x25')](function(_0x2d2c40){_0x1beba9[_0xa613('0x1f')]=_0x2d2c40;if(_0x36b897[_0xa613('0x31')][_0xa613('0x3e')]){_0x4686f2[_0xa613('0x3f')]=[{'all':!![]}];}return db[_0xa613('0x2c')][_0xa613('0x40')](_0x4686f2);})['then'](function(_0xd9654e){_0x1beba9['rows']=_0xd9654e;return _0x1beba9;})[_0xa613('0x25')](respondWithFilteredResult(_0x1cfbf1,_0x4686f2))['catch'](handleError(_0x1cfbf1,null));};exports[_0xa613('0x41')]=function(_0x5107e2,_0x3fa52e){var _0x5cc585={'raw':!![],'where':{'id':_0x5107e2[_0xa613('0x42')]['id']}},_0x5e1e72={};_0x5e1e72[_0xa613('0x30')]=_['keys'](db[_0xa613('0x2c')][_0xa613('0x2d')]);_0x5e1e72[_0xa613('0x31')]=_[_0xa613('0x32')](_0x5107e2[_0xa613('0x31')]);_0x5e1e72[_0xa613('0x33')]=_[_0xa613('0x34')](_0x5e1e72['model'],_0x5e1e72[_0xa613('0x31')]);_0x5cc585[_0xa613('0x35')]=_[_0xa613('0x34')](_0x5e1e72[_0xa613('0x30')],qs[_0xa613('0x43')](_0x5107e2[_0xa613('0x31')][_0xa613('0x43')]));_0x5cc585['attributes']=_0x5cc585[_0xa613('0x35')][_0xa613('0x36')]?_0x5cc585[_0xa613('0x35')]:_0x5e1e72[_0xa613('0x30')];if(_0x5107e2[_0xa613('0x31')][_0xa613('0x3e')]){_0x5cc585[_0xa613('0x3f')]=[{'all':!![]}];}_0x5cc585=_[_0xa613('0x3c')]({},_0x5cc585,_0x5107e2[_0xa613('0x44')]);return db['SalesforceField'][_0xa613('0x45')](_0x5cc585)[_0xa613('0x25')](handleEntityNotFound(_0x3fa52e,null))['then'](respondWithResult(_0x3fa52e,null))['catch'](handleError(_0x3fa52e,null));};exports[_0xa613('0x46')]=function(_0x46709e,_0x365bee){return db['SalesforceField'][_0xa613('0x46')](_0x46709e[_0xa613('0x47')],{})[_0xa613('0x25')](respondWithResult(_0x365bee,0xc9))[_0xa613('0x48')](handleError(_0x365bee,null));};exports[_0xa613('0x49')]=function(_0x4ce984,_0x32dbde){if(_0x4ce984[_0xa613('0x47')]['id']){delete _0x4ce984[_0xa613('0x47')]['id'];}return db['SalesforceField'][_0xa613('0x45')]({'where':{'id':_0x4ce984['params']['id']}})['then'](handleEntityNotFound(_0x32dbde,null))[_0xa613('0x25')](saveUpdates(_0x4ce984[_0xa613('0x47')],null))[_0xa613('0x25')](respondWithResult(_0x32dbde,null))[_0xa613('0x48')](handleError(_0x32dbde,null));};exports[_0xa613('0x26')]=function(_0x574ce3,_0x29c644){return db[_0xa613('0x2c')][_0xa613('0x45')]({'where':{'id':_0x574ce3[_0xa613('0x42')]['id']}})[_0xa613('0x25')](handleEntityNotFound(_0x29c644,null))['then'](removeEntity(_0x29c644,null))['catch'](handleError(_0x29c644,null));}; \ No newline at end of file +var _0xb945=['params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','undefined','limit','offset','count','status','set','Content-Range','json','reject','save','update','destroy','then','sendStatus','name','map','SalesforceField','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body'];(function(_0x47b174,_0x521a9f){var _0x5cce74=function(_0x42da0e){while(--_0x42da0e){_0x47b174['push'](_0x47b174['shift']());}};_0x5cce74(++_0x521a9f);}(_0xb945,0xd6));var _0x5b94=function(_0x9a85bb,_0xc905f){_0x9a85bb=_0x9a85bb-0x0;var _0x512ab1=_0xb945[_0x9a85bb];return _0x512ab1;};'use strict';var emlformat=require(_0x5b94('0x0'));var rimraf=require(_0x5b94('0x1'));var zipdir=require(_0x5b94('0x2'));var jsonpatch=require(_0x5b94('0x3'));var rp=require(_0x5b94('0x4'));var moment=require(_0x5b94('0x5'));var BPromise=require(_0x5b94('0x6'));var Mustache=require(_0x5b94('0x7'));var util=require(_0x5b94('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b94('0x9'));var _=require(_0x5b94('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5b94('0xb'));var deskjs=require(_0x5b94('0xc'));var toCsv=require(_0x5b94('0xd'));var querystring=require(_0x5b94('0xe'));var Papa=require(_0x5b94('0xf'));var Redis=require(_0x5b94('0x10'));var authService=require(_0x5b94('0x11'));var qs=require(_0x5b94('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b94('0x13'));var logger=require('../../config/logger')(_0x5b94('0x14'));var utils=require(_0x5b94('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5b94('0x16'))['db'];function respondWithStatusCode(_0x285efc,_0x15de5b){_0x15de5b=_0x15de5b||0xcc;return function(_0x4bec1c){if(_0x4bec1c){return _0x285efc['sendStatus'](_0x15de5b);}return _0x285efc['status'](_0x15de5b)[_0x5b94('0x17')]();};}function respondWithResult(_0x3b0a9c,_0x32a4cb){_0x32a4cb=_0x32a4cb||0xc8;return function(_0x36a94a){if(_0x36a94a){return _0x3b0a9c['status'](_0x32a4cb)['json'](_0x36a94a);}};}function respondWithFilteredResult(_0x4c4c20,_0x298f72){return function(_0x20b0aa){if(_0x20b0aa){var _0x4898a1=typeof _0x298f72['offset']===_0x5b94('0x18')&&typeof _0x298f72[_0x5b94('0x19')]===_0x5b94('0x18');var _0x4df571=_0x20b0aa['count'];var _0xf6aa58=_0x4898a1?0x0:_0x298f72[_0x5b94('0x1a')];var _0x3a87f4=_0x4898a1?_0x20b0aa[_0x5b94('0x1b')]:_0x298f72[_0x5b94('0x1a')]+_0x298f72[_0x5b94('0x19')];var _0x4a3270;if(_0x3a87f4>=_0x4df571){_0x3a87f4=_0x4df571;_0x4a3270=0xc8;}else{_0x4a3270=0xce;}_0x4c4c20[_0x5b94('0x1c')](_0x4a3270);return _0x4c4c20[_0x5b94('0x1d')](_0x5b94('0x1e'),_0xf6aa58+'-'+_0x3a87f4+'/'+_0x4df571)[_0x5b94('0x1f')](_0x20b0aa);}return null;};}function patchUpdates(_0x4f0b78){return function(_0x4eaadc){try{jsonpatch['apply'](_0x4eaadc,_0x4f0b78,!![]);}catch(_0x23f39a){return BPromise[_0x5b94('0x20')](_0x23f39a);}return _0x4eaadc[_0x5b94('0x21')]();};}function saveUpdates(_0x366d45,_0x3fbcd0){return function(_0x2960a2){if(_0x2960a2){return _0x2960a2[_0x5b94('0x22')](_0x366d45)['then'](function(_0xda332d){return _0xda332d;});}return null;};}function removeEntity(_0x339753,_0x1874db){return function(_0x21a267){if(_0x21a267){return _0x21a267[_0x5b94('0x23')]()[_0x5b94('0x24')](function(){_0x339753[_0x5b94('0x1c')](0xcc)[_0x5b94('0x17')]();});}};}function handleEntityNotFound(_0x3f6fbe,_0x2a5ef3){return function(_0x1bb7f3){if(!_0x1bb7f3){_0x3f6fbe[_0x5b94('0x25')](0x194);}return _0x1bb7f3;};}function handleError(_0xf02b2c,_0x2dd943){_0x2dd943=_0x2dd943||0x1f4;return function(_0x3abfc4){logger['error'](_0x3abfc4['stack']);if(_0x3abfc4[_0x5b94('0x26')]){delete _0x3abfc4[_0x5b94('0x26')];}_0xf02b2c['status'](_0x2dd943)['send'](_0x3abfc4);};}exports['index']=function(_0x171c36,_0x3cea62){var _0x1e1fae={},_0x169fc6={},_0x52b8c5={'count':0x0,'rows':[]};var _0x51ee16=_[_0x5b94('0x27')](db[_0x5b94('0x28')]['rawAttributes'],function(_0x1b8f37){return{'name':_0x1b8f37[_0x5b94('0x29')],'type':_0x1b8f37[_0x5b94('0x2a')][_0x5b94('0x2b')]};});_0x169fc6['model']=_['map'](_0x51ee16,_0x5b94('0x26'));_0x169fc6[_0x5b94('0x2c')]=_[_0x5b94('0x2d')](_0x171c36['query']);_0x169fc6[_0x5b94('0x2e')]=_[_0x5b94('0x2f')](_0x169fc6[_0x5b94('0x30')],_0x169fc6[_0x5b94('0x2c')]);_0x1e1fae[_0x5b94('0x31')]=_[_0x5b94('0x2f')](_0x169fc6[_0x5b94('0x30')],qs[_0x5b94('0x32')](_0x171c36[_0x5b94('0x2c')]['fields']));_0x1e1fae['attributes']=_0x1e1fae[_0x5b94('0x31')]['length']?_0x1e1fae['attributes']:_0x169fc6[_0x5b94('0x30')];if(!_0x171c36[_0x5b94('0x2c')][_0x5b94('0x33')]('nolimit')){_0x1e1fae['limit']=qs[_0x5b94('0x19')](_0x171c36[_0x5b94('0x2c')][_0x5b94('0x19')]);_0x1e1fae['offset']=qs[_0x5b94('0x1a')](_0x171c36[_0x5b94('0x2c')][_0x5b94('0x1a')]);}_0x1e1fae[_0x5b94('0x34')]=qs[_0x5b94('0x35')](_0x171c36[_0x5b94('0x2c')][_0x5b94('0x35')]);_0x1e1fae['where']=qs[_0x5b94('0x2e')](_['pick'](_0x171c36[_0x5b94('0x2c')],_0x169fc6['filters']),_0x51ee16);if(_0x171c36[_0x5b94('0x2c')][_0x5b94('0x36')]){_0x1e1fae[_0x5b94('0x37')]=_[_0x5b94('0x38')](_0x1e1fae[_0x5b94('0x37')],{'$or':_[_0x5b94('0x27')](_0x51ee16,function(_0x4faa93){if(_0x4faa93[_0x5b94('0x2a')]!==_0x5b94('0x39')){var _0x5bd36d={};_0x5bd36d[_0x4faa93[_0x5b94('0x26')]]={'$like':'%'+_0x171c36[_0x5b94('0x2c')][_0x5b94('0x36')]+'%'};return _0x5bd36d;}})});}_0x1e1fae=_[_0x5b94('0x38')]({},_0x1e1fae,_0x171c36[_0x5b94('0x3a')]);var _0x5f412f={'where':_0x1e1fae[_0x5b94('0x37')]};return db['SalesforceField'][_0x5b94('0x1b')](_0x5f412f)[_0x5b94('0x24')](function(_0xb21b01){_0x52b8c5['count']=_0xb21b01;if(_0x171c36[_0x5b94('0x2c')][_0x5b94('0x3b')]){_0x1e1fae[_0x5b94('0x3c')]=[{'all':!![]}];}return db['SalesforceField'][_0x5b94('0x3d')](_0x1e1fae);})[_0x5b94('0x24')](function(_0x16a157){_0x52b8c5[_0x5b94('0x3e')]=_0x16a157;return _0x52b8c5;})[_0x5b94('0x24')](respondWithFilteredResult(_0x3cea62,_0x1e1fae))[_0x5b94('0x3f')](handleError(_0x3cea62,null));};exports[_0x5b94('0x40')]=function(_0x4766df,_0x34f12f){var _0x1f8866={'raw':!![],'where':{'id':_0x4766df['params']['id']}},_0x35723a={};_0x35723a[_0x5b94('0x30')]=_[_0x5b94('0x2d')](db['SalesforceField'][_0x5b94('0x41')]);_0x35723a[_0x5b94('0x2c')]=_[_0x5b94('0x2d')](_0x4766df['query']);_0x35723a['filters']=_[_0x5b94('0x2f')](_0x35723a['model'],_0x35723a['query']);_0x1f8866['attributes']=_[_0x5b94('0x2f')](_0x35723a[_0x5b94('0x30')],qs[_0x5b94('0x32')](_0x4766df[_0x5b94('0x2c')]['fields']));_0x1f8866['attributes']=_0x1f8866['attributes'][_0x5b94('0x42')]?_0x1f8866['attributes']:_0x35723a[_0x5b94('0x30')];if(_0x4766df[_0x5b94('0x2c')][_0x5b94('0x3b')]){_0x1f8866[_0x5b94('0x3c')]=[{'all':!![]}];}_0x1f8866=_[_0x5b94('0x38')]({},_0x1f8866,_0x4766df[_0x5b94('0x3a')]);return db[_0x5b94('0x28')][_0x5b94('0x43')](_0x1f8866)['then'](handleEntityNotFound(_0x34f12f,null))[_0x5b94('0x24')](respondWithResult(_0x34f12f,null))['catch'](handleError(_0x34f12f,null));};exports[_0x5b94('0x44')]=function(_0x219507,_0x1122ae){return db['SalesforceField'][_0x5b94('0x44')](_0x219507[_0x5b94('0x45')],{})[_0x5b94('0x24')](respondWithResult(_0x1122ae,0xc9))[_0x5b94('0x3f')](handleError(_0x1122ae,null));};exports[_0x5b94('0x22')]=function(_0x2737f4,_0x599fbd){if(_0x2737f4[_0x5b94('0x45')]['id']){delete _0x2737f4[_0x5b94('0x45')]['id'];}return db['SalesforceField'][_0x5b94('0x43')]({'where':{'id':_0x2737f4[_0x5b94('0x46')]['id']}})['then'](handleEntityNotFound(_0x599fbd,null))[_0x5b94('0x24')](saveUpdates(_0x2737f4[_0x5b94('0x45')],null))[_0x5b94('0x24')](respondWithResult(_0x599fbd,null))['catch'](handleError(_0x599fbd,null));};exports[_0x5b94('0x23')]=function(_0x17c3ba,_0x37d4eb){return db[_0x5b94('0x28')][_0x5b94('0x43')]({'where':{'id':_0x17c3ba[_0x5b94('0x46')]['id']}})['then'](handleEntityNotFound(_0x37d4eb,null))[_0x5b94('0x24')](removeEntity(_0x37d4eb,null))[_0x5b94('0x3f')](handleError(_0x37d4eb,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 86e56af..2527b32 100644 --- a/server/api/intSalesforceField/intSalesforceField.model.js +++ b/server/api/intSalesforceField/intSalesforceField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59a2=['moment','bluebird','path','rimraf','exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x59a2,0x1d8));var _0x259a=function(_0x2a0204,_0x1f0547){_0x2a0204=_0x2a0204-0x0;var _0x38f822=_0x59a2[_0x2a0204];return _0x38f822;};'use strict';var _=require(_0x259a('0x0'));var util=require(_0x259a('0x1'));var logger=require(_0x259a('0x2'))(_0x259a('0x3'));var moment=require(_0x259a('0x4'));var BPromise=require(_0x259a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x259a('0x6'));var rimraf=require(_0x259a('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x259a('0x8')]=function(_0x48d95d,_0x361ee1){return _0x48d95d[_0x259a('0x9')]('SalesforceField',attributes,{'tableName':_0x259a('0xa'),'paranoid':![],'indexes':[{'name':_0x259a('0xb'),'fields':[_0x259a('0xc'),_0x259a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4788=['./intSalesforceField.attributes','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','../../config/environment'];(function(_0x1cbc3a,_0xdec7fa){var _0x113b3b=function(_0x112822){while(--_0x112822){_0x1cbc3a['push'](_0x1cbc3a['shift']());}};_0x113b3b(++_0xdec7fa);}(_0x4788,0xa2));var _0x8478=function(_0x58b646,_0x1d6f74){_0x58b646=_0x58b646-0x0;var _0x2c7d90=_0x4788[_0x58b646];return _0x2c7d90;};'use strict';var _=require(_0x8478('0x0'));var util=require(_0x8478('0x1'));var logger=require(_0x8478('0x2'))(_0x8478('0x3'));var moment=require('moment');var BPromise=require(_0x8478('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8478('0x5'));var attributes=require(_0x8478('0x6'));module['exports']=function(_0x3411de,_0x3da44d){return _0x3411de['define'](_0x8478('0x7'),attributes,{'tableName':_0x8478('0x8'),'paranoid':![],'indexes':[{'name':_0x8478('0x9'),'fields':[_0x8478('0xa'),_0x8478('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index de12e2a..e47fc0e 100644 --- a/server/api/intSalesforceField/intSalesforceField.rpc.js +++ b/server/api/intSalesforceField/intSalesforceField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1eb1=['message','SalesforceField,\x20%s,\x20%s','result','catch','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1ec127,_0xb74c7e){var _0x36b6bd=function(_0x4b1e28){while(--_0x4b1e28){_0x1ec127['push'](_0x1ec127['shift']());}};_0x36b6bd(++_0xb74c7e);}(_0x1eb1,0x1c6));var _0x11eb=function(_0x318a02,_0x2cfbbe){_0x318a02=_0x318a02-0x0;var _0x47547d=_0x1eb1[_0x318a02];return _0x47547d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x11eb('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11eb('0x1'));var db=require(_0x11eb('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x11eb('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x11eb('0x4'));var client=jayson[_0x11eb('0x5')][_0x11eb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5b8f70,_0x3adf43,_0x1dcf9c){return new BPromise(function(_0x925b2,_0x32ca22){return client[_0x11eb('0x7')](_0x5b8f70,_0x1dcf9c)[_0x11eb('0x8')](function(_0x5545eb){logger[_0x11eb('0x9')]('SalesforceField,\x20%s,\x20%s',_0x3adf43,_0x11eb('0xa'));logger['debug'](_0x11eb('0xb'),_0x3adf43,'request\x20sent',JSON['stringify'](_0x5545eb));if(_0x5545eb[_0x11eb('0xc')]){if(_0x5545eb[_0x11eb('0xc')][_0x11eb('0xd')]===0x1f4){logger[_0x11eb('0xc')]('SalesforceField,\x20%s,\x20%s',_0x3adf43,_0x5545eb['error'][_0x11eb('0xe')]);return _0x32ca22(_0x5545eb[_0x11eb('0xc')][_0x11eb('0xe')]);}logger[_0x11eb('0xc')](_0x11eb('0xf'),_0x3adf43,_0x5545eb['error'][_0x11eb('0xe')]);return _0x925b2(_0x5545eb[_0x11eb('0xc')][_0x11eb('0xe')]);}else{logger[_0x11eb('0x9')](_0x11eb('0xf'),_0x3adf43,_0x11eb('0xa'));_0x925b2(_0x5545eb[_0x11eb('0x10')][_0x11eb('0xe')]);}})[_0x11eb('0x11')](function(_0x4906af){logger[_0x11eb('0xc')](_0x11eb('0xf'),_0x3adf43,_0x4906af);_0x32ca22(_0x4906af);});});} \ No newline at end of file +var _0x8869=['request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x1ed58f,_0x136fea){var _0x4730f7=function(_0x55502c){while(--_0x55502c){_0x1ed58f['push'](_0x1ed58f['shift']());}};_0x4730f7(++_0x136fea);}(_0x8869,0x9d));var _0x9886=function(_0x4f1ac3,_0x102349){_0x4f1ac3=_0x4f1ac3-0x0;var _0x419730=_0x8869[_0x4f1ac3];return _0x419730;};'use strict';var _=require(_0x9886('0x0'));var util=require(_0x9886('0x1'));var moment=require(_0x9886('0x2'));var BPromise=require(_0x9886('0x3'));var rs=require(_0x9886('0x4'));var fs=require('fs');var Redis=require(_0x9886('0x5'));var db=require(_0x9886('0x6'))['db'];var utils=require(_0x9886('0x7'));var logger=require('../../config/logger')(_0x9886('0x8'));var config=require(_0x9886('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9886('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11617b,_0x35415c,_0x2eeec8){return new BPromise(function(_0x3d7de4,_0x414d48){return client[_0x9886('0xb')](_0x11617b,_0x2eeec8)[_0x9886('0xc')](function(_0x1fa50c){logger[_0x9886('0xd')](_0x9886('0xe'),_0x35415c,_0x9886('0xf'));logger[_0x9886('0x10')](_0x9886('0x11'),_0x35415c,_0x9886('0xf'),JSON[_0x9886('0x12')](_0x1fa50c));if(_0x1fa50c[_0x9886('0x13')]){if(_0x1fa50c['error'][_0x9886('0x14')]===0x1f4){logger['error'](_0x9886('0xe'),_0x35415c,_0x1fa50c[_0x9886('0x13')]['message']);return _0x414d48(_0x1fa50c[_0x9886('0x13')][_0x9886('0x15')]);}logger[_0x9886('0x13')]('SalesforceField,\x20%s,\x20%s',_0x35415c,_0x1fa50c[_0x9886('0x13')][_0x9886('0x15')]);return _0x3d7de4(_0x1fa50c[_0x9886('0x13')][_0x9886('0x15')]);}else{logger[_0x9886('0xd')](_0x9886('0xe'),_0x35415c,_0x9886('0xf'));_0x3d7de4(_0x1fa50c[_0x9886('0x16')][_0x9886('0x15')]);}})[_0x9886('0x17')](function(_0x10ce2b){logger['error'](_0x9886('0xe'),_0x35415c,_0x10ce2b);_0x414d48(_0x10ce2b);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 7dbf1ad..8d4a49c 100644 --- a/server/api/intServicenowAccount/index.js +++ b/server/api/intServicenowAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d57=['update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id'];(function(_0x245235,_0x426001){var _0xa887d0=function(_0x1b0a90){while(--_0x1b0a90){_0x245235['push'](_0x245235['shift']());}};_0xa887d0(++_0x426001);}(_0x1d57,0x123));var _0x71d5=function(_0x5d92d2,_0x399d73){_0x5d92d2=_0x5d92d2-0x0;var _0x5e6d11=_0x1d57[_0x5d92d2];return _0x5e6d11;};'use strict';var multer=require('multer');var util=require(_0x71d5('0x0'));var path=require(_0x71d5('0x1'));var timeout=require(_0x71d5('0x2'));var express=require('express');var router=express[_0x71d5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x71d5('0x4'));var interaction=require(_0x71d5('0x5'));var config=require(_0x71d5('0x6'));var controller=require(_0x71d5('0x7'));router[_0x71d5('0x8')]('/',auth['isAuthenticated'](),controller[_0x71d5('0x9')]);router[_0x71d5('0x8')]('/:id',auth[_0x71d5('0xa')](),controller[_0x71d5('0xb')]);router['get'](_0x71d5('0xc'),auth[_0x71d5('0xa')](),controller[_0x71d5('0xd')]);router[_0x71d5('0x8')](_0x71d5('0xe'),auth['isAuthenticated'](),controller[_0x71d5('0xf')]);router[_0x71d5('0x10')]('/',auth[_0x71d5('0xa')](),controller[_0x71d5('0x11')]);router[_0x71d5('0x10')]('/:id/configurations',auth[_0x71d5('0xa')](),controller[_0x71d5('0x12')]);router[_0x71d5('0x13')](_0x71d5('0x14'),auth[_0x71d5('0xa')](),controller[_0x71d5('0x15')]);router['delete']('/:id',auth[_0x71d5('0xa')](),controller[_0x71d5('0x16')]);module[_0x71d5('0x17')]=router; \ No newline at end of file +var _0xb545=['/:id/fields','getFields','create','post','addConfiguration','put','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x52adc8,_0x4528ba){var _0x278c8c=function(_0x3fc2d3){while(--_0x3fc2d3){_0x52adc8['push'](_0x52adc8['shift']());}};_0x278c8c(++_0x4528ba);}(_0xb545,0xcf));var _0x5b54=function(_0x3f821b,_0x4296a7){_0x3f821b=_0x3f821b-0x0;var _0x56f5ce=_0xb545[_0x3f821b];return _0x56f5ce;};'use strict';var multer=require('multer');var util=require(_0x5b54('0x0'));var path=require('path');var timeout=require(_0x5b54('0x1'));var express=require(_0x5b54('0x2'));var router=express[_0x5b54('0x3')]();var fs_extra=require(_0x5b54('0x4'));var auth=require(_0x5b54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b54('0x6'));var controller=require(_0x5b54('0x7'));router[_0x5b54('0x8')]('/',auth[_0x5b54('0x9')](),controller['index']);router['get'](_0x5b54('0xa'),auth[_0x5b54('0x9')](),controller[_0x5b54('0xb')]);router[_0x5b54('0x8')](_0x5b54('0xc'),auth[_0x5b54('0x9')](),controller['getConfigurations']);router[_0x5b54('0x8')](_0x5b54('0xd'),auth['isAuthenticated'](),controller[_0x5b54('0xe')]);router['post']('/',auth[_0x5b54('0x9')](),controller[_0x5b54('0xf')]);router[_0x5b54('0x10')](_0x5b54('0xc'),auth[_0x5b54('0x9')](),controller[_0x5b54('0x11')]);router[_0x5b54('0x12')](_0x5b54('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x5b54('0xa'),auth[_0x5b54('0x9')](),controller[_0x5b54('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index df76038..33f2c73 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js +++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde86=['username','remoteUri','exports','STRING'];(function(_0x1e3e8b,_0x40c5bd){var _0x536941=function(_0x1d85c7){while(--_0x1d85c7){_0x1e3e8b['push'](_0x1e3e8b['shift']());}};_0x536941(++_0x40c5bd);}(_0xde86,0x1a6));var _0x6de8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde86[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6de8('0x0')]={'name':{'type':Sequelize[_0x6de8('0x1')]},'description':{'type':Sequelize[_0x6de8('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6de8('0x2')},'password':{'type':Sequelize[_0x6de8('0x1')]},'email':{'type':Sequelize[_0x6de8('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x6de8('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1278=['username','remoteUri','sequelize','exports','STRING'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x1278,0x165));var _0x8127=function(_0x4c4a8b,_0x402020){_0x4c4a8b=_0x4c4a8b-0x0;var _0x20fa14=_0x1278[_0x4c4a8b];return _0x20fa14;};'use strict';var Sequelize=require(_0x8127('0x0'));module[_0x8127('0x1')]={'name':{'type':Sequelize[_0x8127('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8127('0x2')],'unique':_0x8127('0x3')},'password':{'type':Sequelize[_0x8127('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8127('0x4')},'serverUrl':{'type':Sequelize[_0x8127('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 0b93fca..bd4bb61 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.controller.js +++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe2c=['lastIndexOf','format','%s/api/now/doc/table/schema/','username','GET','result','remove','includes','label','push','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','all','concat','log','ServiceNow\x20error:\x20','statusCode','stack','Wrong\x20credentials','boolean','True','False','false','inactive','value','eml-format','zip-dir','fast-json-patch','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','channel','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','incident_state','severity','category','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','sys_domain_path','rfc','time_worked','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','password','email','remoteUri','slice','substring'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xfe2c,0x188));var _0xcfe2=function(_0x3a07d1,_0x379d5e){_0x3a07d1=_0x3a07d1-0x0;var _0x3add40=_0xfe2c[_0x3a07d1];return _0x3add40;};'use strict';var emlformat=require(_0xcfe2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfe2('0x1'));var jsonpatch=require(_0xcfe2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcfe2('0x3'));var path=require('path');var sox=require(_0xcfe2('0x4'));var csv=require(_0xcfe2('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfe2('0x6'));var _=require(_0xcfe2('0x7'));var squel=require(_0xcfe2('0x8'));var crypto=require(_0xcfe2('0x9'));var jsforce=require(_0xcfe2('0xa'));var deskjs=require(_0xcfe2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcfe2('0xc'));var Redis=require(_0xcfe2('0xd'));var authService=require(_0xcfe2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcfe2('0xf'));var hardwareService=require(_0xcfe2('0x10'));var logger=require(_0xcfe2('0x11'))(_0xcfe2('0x12'));var utils=require(_0xcfe2('0x13'));var config=require(_0xcfe2('0x14'));var licenseUtil=require(_0xcfe2('0x15'));var db=require(_0xcfe2('0x16'))['db'];var integrations=require(_0xcfe2('0x17'));function respondWithStatusCode(_0x5dc868,_0xc6c4f8){_0xc6c4f8=_0xc6c4f8||0xcc;return function(_0x49f82a){if(_0x49f82a){return _0x5dc868[_0xcfe2('0x18')](_0xc6c4f8);}return _0x5dc868[_0xcfe2('0x19')](_0xc6c4f8)[_0xcfe2('0x1a')]();};}function respondWithResult(_0xc20ccf,_0x55162f){_0x55162f=_0x55162f||0xc8;return function(_0x515181){if(_0x515181){return _0xc20ccf['status'](_0x55162f)[_0xcfe2('0x1b')](_0x515181);}};}function respondWithFilteredResult(_0x395c59,_0x465063){return function(_0x599d7b){if(_0x599d7b){var _0xfd2ea4=typeof _0x465063['offset']===_0xcfe2('0x1c')&&typeof _0x465063['limit']==='undefined';var _0x9dffb2=_0x599d7b[_0xcfe2('0x1d')];var _0x49626d=_0xfd2ea4?0x0:_0x465063[_0xcfe2('0x1e')];var _0x29bc28=_0xfd2ea4?_0x599d7b['count']:_0x465063[_0xcfe2('0x1e')]+_0x465063['limit'];var _0x3ccfa5;if(_0x29bc28>=_0x9dffb2){_0x29bc28=_0x9dffb2;_0x3ccfa5=0xc8;}else{_0x3ccfa5=0xce;}_0x395c59[_0xcfe2('0x19')](_0x3ccfa5);return _0x395c59[_0xcfe2('0x1f')]('Content-Range',_0x49626d+'-'+_0x29bc28+'/'+_0x9dffb2)[_0xcfe2('0x1b')](_0x599d7b);}return null;};}function patchUpdates(_0x3fcd92){return function(_0x11d0d8){try{jsonpatch[_0xcfe2('0x20')](_0x11d0d8,_0x3fcd92,!![]);}catch(_0x2e9701){return BPromise[_0xcfe2('0x21')](_0x2e9701);}return _0x11d0d8[_0xcfe2('0x22')]();};}function saveUpdates(_0x2be8c9,_0x4c43cf){return function(_0x185741){if(_0x185741){return _0x185741[_0xcfe2('0x23')](_0x2be8c9)[_0xcfe2('0x24')](function(_0x5b4222){return _0x5b4222;});}return null;};}function removeEntity(_0x412de0,_0x25eefc){return function(_0x3a650b){if(_0x3a650b){return _0x3a650b[_0xcfe2('0x25')]()[_0xcfe2('0x24')](function(){_0x412de0[_0xcfe2('0x19')](0xcc)[_0xcfe2('0x1a')]();});}};}function handleEntityNotFound(_0x4d8088,_0x382eff){return function(_0x259b6c){if(!_0x259b6c){_0x4d8088[_0xcfe2('0x18')](0x194);}return _0x259b6c;};}function handleError(_0x5b6bce,_0x46e846){_0x46e846=_0x46e846||0x1f4;return function(_0x4f9eca){logger[_0xcfe2('0x26')](_0x4f9eca['stack']);if(_0x4f9eca['name']){delete _0x4f9eca[_0xcfe2('0x27')];}_0x5b6bce[_0xcfe2('0x19')](_0x46e846)[_0xcfe2('0x28')](_0x4f9eca);};}exports[_0xcfe2('0x29')]=function(_0x50c894,_0x570e9c){var _0x2e276d={},_0x20b6a4={},_0x560f72={'count':0x0,'rows':[]};var _0x127c4f=_[_0xcfe2('0x2a')](db[_0xcfe2('0x2b')][_0xcfe2('0x2c')],function(_0x48429c){return{'name':_0x48429c[_0xcfe2('0x2d')],'type':_0x48429c[_0xcfe2('0x2e')]['key']};});_0x20b6a4[_0xcfe2('0x2f')]=_[_0xcfe2('0x2a')](_0x127c4f,_0xcfe2('0x27'));_0x20b6a4[_0xcfe2('0x30')]=_[_0xcfe2('0x31')](_0x50c894[_0xcfe2('0x30')]);_0x20b6a4['filters']=_[_0xcfe2('0x32')](_0x20b6a4['model'],_0x20b6a4['query']);_0x2e276d[_0xcfe2('0x33')]=_['intersection'](_0x20b6a4[_0xcfe2('0x2f')],qs[_0xcfe2('0x34')](_0x50c894[_0xcfe2('0x30')]['fields']));_0x2e276d['attributes']=_0x2e276d['attributes'][_0xcfe2('0x35')]?_0x2e276d['attributes']:_0x20b6a4[_0xcfe2('0x2f')];if(!_0x50c894[_0xcfe2('0x30')][_0xcfe2('0x36')](_0xcfe2('0x37'))){_0x2e276d[_0xcfe2('0x38')]=qs[_0xcfe2('0x38')](_0x50c894['query'][_0xcfe2('0x38')]);_0x2e276d[_0xcfe2('0x1e')]=qs[_0xcfe2('0x1e')](_0x50c894[_0xcfe2('0x30')][_0xcfe2('0x1e')]);}_0x2e276d[_0xcfe2('0x39')]=qs[_0xcfe2('0x3a')](_0x50c894['query']['sort']);_0x2e276d['where']=qs[_0xcfe2('0x3b')](_[_0xcfe2('0x3c')](_0x50c894[_0xcfe2('0x30')],_0x20b6a4[_0xcfe2('0x3b')]),_0x127c4f);if(_0x50c894[_0xcfe2('0x30')][_0xcfe2('0x3d')]){_0x2e276d[_0xcfe2('0x3e')]=_['merge'](_0x2e276d[_0xcfe2('0x3e')],{'$or':_[_0xcfe2('0x2a')](_0x127c4f,function(_0x22cf0e){if(_0x22cf0e['type']!==_0xcfe2('0x3f')){var _0x5ba253={};_0x5ba253[_0x22cf0e[_0xcfe2('0x27')]]={'$like':'%'+_0x50c894[_0xcfe2('0x30')][_0xcfe2('0x3d')]+'%'};return _0x5ba253;}})});}_0x2e276d=_['merge']({},_0x2e276d,_0x50c894[_0xcfe2('0x40')]);var _0x309860={'where':_0x2e276d[_0xcfe2('0x3e')]};return db['ServicenowAccount']['count'](_0x309860)[_0xcfe2('0x24')](function(_0x55a664){_0x560f72[_0xcfe2('0x1d')]=_0x55a664;if(_0x50c894[_0xcfe2('0x30')][_0xcfe2('0x41')]){_0x2e276d[_0xcfe2('0x42')]=[{'all':!![]}];}return db[_0xcfe2('0x2b')][_0xcfe2('0x43')](_0x2e276d);})[_0xcfe2('0x24')](function(_0x336dda){_0x560f72[_0xcfe2('0x44')]=_0x336dda;return _0x560f72;})[_0xcfe2('0x24')](respondWithFilteredResult(_0x570e9c,_0x2e276d))['catch'](handleError(_0x570e9c,null));};exports[_0xcfe2('0x45')]=function(_0x189e14,_0x15a30d){var _0x27b1b0={'raw':![],'where':{'id':_0x189e14[_0xcfe2('0x46')]['id']}},_0x5f01bb={};_0x5f01bb[_0xcfe2('0x2f')]=_[_0xcfe2('0x31')](db[_0xcfe2('0x2b')][_0xcfe2('0x2c')]);_0x5f01bb[_0xcfe2('0x30')]=_['keys'](_0x189e14[_0xcfe2('0x30')]);_0x5f01bb[_0xcfe2('0x3b')]=_[_0xcfe2('0x32')](_0x5f01bb[_0xcfe2('0x2f')],_0x5f01bb[_0xcfe2('0x30')]);_0x27b1b0[_0xcfe2('0x33')]=_[_0xcfe2('0x32')](_0x5f01bb[_0xcfe2('0x2f')],qs[_0xcfe2('0x34')](_0x189e14[_0xcfe2('0x30')][_0xcfe2('0x34')]));_0x27b1b0[_0xcfe2('0x33')]=_0x27b1b0[_0xcfe2('0x33')][_0xcfe2('0x35')]?_0x27b1b0[_0xcfe2('0x33')]:_0x5f01bb[_0xcfe2('0x2f')];if(_0x189e14[_0xcfe2('0x30')][_0xcfe2('0x41')]){_0x27b1b0[_0xcfe2('0x42')]=[{'all':!![]}];}_0x27b1b0=_[_0xcfe2('0x47')]({},_0x27b1b0,_0x189e14['options']);return db['ServicenowAccount'][_0xcfe2('0x48')](_0x27b1b0)[_0xcfe2('0x24')](handleEntityNotFound(_0x15a30d,null))[_0xcfe2('0x24')](respondWithResult(_0x15a30d,null))[_0xcfe2('0x49')](handleError(_0x15a30d,null));};exports[_0xcfe2('0x4a')]=function(_0x852d32,_0x423ace){return db[_0xcfe2('0x2b')]['create'](_0x852d32[_0xcfe2('0x4b')],{})[_0xcfe2('0x24')](respondWithResult(_0x423ace,0xc9))[_0xcfe2('0x49')](handleError(_0x423ace,null));};exports[_0xcfe2('0x23')]=function(_0x13ff2d,_0x2e3a8e){if(_0x13ff2d['body']['id']){delete _0x13ff2d[_0xcfe2('0x4b')]['id'];}return db[_0xcfe2('0x2b')][_0xcfe2('0x48')]({'where':{'id':_0x13ff2d['params']['id']}})[_0xcfe2('0x24')](handleEntityNotFound(_0x2e3a8e,null))[_0xcfe2('0x24')](saveUpdates(_0x13ff2d[_0xcfe2('0x4b')],null))['then'](respondWithResult(_0x2e3a8e,null))[_0xcfe2('0x49')](handleError(_0x2e3a8e,null));};exports[_0xcfe2('0x25')]=function(_0x1e0f62,_0xda6913){return db[_0xcfe2('0x2b')][_0xcfe2('0x48')]({'where':{'id':_0x1e0f62[_0xcfe2('0x46')]['id']}})[_0xcfe2('0x24')](handleEntityNotFound(_0xda6913,null))[_0xcfe2('0x24')](removeEntity(_0xda6913,null))[_0xcfe2('0x49')](handleError(_0xda6913,null));};exports['getConfigurations']=function(_0x446031,_0x16e3b3,_0x507f7c){var _0xb291c4={};var _0x426f97={};var _0x311fb1;var _0x503725;return db[_0xcfe2('0x2b')][_0xcfe2('0x4c')]({'where':{'id':_0x446031[_0xcfe2('0x46')]['id']}})[_0xcfe2('0x24')](handleEntityNotFound(_0x16e3b3,null))[_0xcfe2('0x24')](function(_0x54162f){if(_0x54162f){_0x311fb1=_0x54162f;_0x426f97[_0xcfe2('0x2f')]=_[_0xcfe2('0x31')](db[_0xcfe2('0x4d')][_0xcfe2('0x2c')]);_0x426f97['query']=_[_0xcfe2('0x31')](_0x446031[_0xcfe2('0x30')]);_0x426f97[_0xcfe2('0x3b')]=_[_0xcfe2('0x32')](_0x426f97[_0xcfe2('0x2f')],_0x426f97[_0xcfe2('0x30')]);_0xb291c4[_0xcfe2('0x33')]=_[_0xcfe2('0x32')](_0x426f97[_0xcfe2('0x2f')],qs[_0xcfe2('0x34')](_0x446031[_0xcfe2('0x30')]['fields']));_0xb291c4['attributes']=_0xb291c4[_0xcfe2('0x33')][_0xcfe2('0x35')]?_0xb291c4['attributes']:_0x426f97[_0xcfe2('0x2f')];_0xb291c4['order']=qs[_0xcfe2('0x3a')](_0x446031[_0xcfe2('0x30')][_0xcfe2('0x3a')]);_0xb291c4['where']=qs['filters'](_[_0xcfe2('0x3c')](_0x446031[_0xcfe2('0x30')],_0x426f97[_0xcfe2('0x3b')]));if(_0x446031[_0xcfe2('0x30')]['filter']){_0xb291c4['where']=_['merge'](_0xb291c4[_0xcfe2('0x3e')],{'$or':_['map'](_0xb291c4[_0xcfe2('0x33')],function(_0x545dd3){var _0x31c86e={};_0x31c86e[_0x545dd3]={'$like':'%'+_0x446031['query'][_0xcfe2('0x3d')]+'%'};return _0x31c86e;})});}_0xb291c4=_[_0xcfe2('0x47')]({},_0xb291c4,_0x446031['options']);return _0x311fb1['getConfigurations'](_0xb291c4);}})['then'](function(_0x29ed87){if(_0x29ed87){_0x503725=_0x29ed87[_0xcfe2('0x35')];if(!_0x446031[_0xcfe2('0x30')]['hasOwnProperty']('nolimit')){_0xb291c4[_0xcfe2('0x38')]=qs[_0xcfe2('0x38')](_0x446031[_0xcfe2('0x30')][_0xcfe2('0x38')]);_0xb291c4[_0xcfe2('0x1e')]=qs[_0xcfe2('0x1e')](_0x446031[_0xcfe2('0x30')][_0xcfe2('0x1e')]);}return _0x311fb1[_0xcfe2('0x4e')](_0xb291c4);}})[_0xcfe2('0x24')](function(_0x19df98){if(_0x19df98){return _0x19df98?{'count':_0x503725,'rows':_0x19df98}:null;}})[_0xcfe2('0x24')](respondWithResult(_0x16e3b3,null))['catch'](handleError(_0x16e3b3,null));};exports[_0xcfe2('0x4f')]=function(_0x242366,_0x19e269,_0x25f8ed){if(_0x242366[_0xcfe2('0x4b')]['id']){delete _0x242366[_0xcfe2('0x4b')]['id'];}return db[_0xcfe2('0x2b')][_0xcfe2('0x4c')]({'where':{'id':_0x242366['params']['id']}})['then'](handleEntityNotFound(_0x19e269,null))[_0xcfe2('0x24')](function(_0x35fd2c){if(_0x35fd2c){_0x242366[_0xcfe2('0x4b')][_0xcfe2('0x50')]=_0x35fd2c['id'];_0x242366[_0xcfe2('0x4b')]['Subjects']=integrations['getSubjects'](_0x242366[_0xcfe2('0x4b')][_0xcfe2('0x51')],_0x242366[_0xcfe2('0x4b')][_0xcfe2('0x2e')]);_0x242366[_0xcfe2('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x242366[_0xcfe2('0x4b')]['channel'],_0x242366[_0xcfe2('0x4b')][_0xcfe2('0x2e')]);return db['ServicenowConfiguration'][_0xcfe2('0x4a')](_0x242366[_0xcfe2('0x4b')],{'include':[{'model':db[_0xcfe2('0x52')],'as':_0xcfe2('0x53')},{'model':db[_0xcfe2('0x52')],'as':'Descriptions'}]});}return null;})[_0xcfe2('0x24')](respondWithResult(_0x19e269,null))[_0xcfe2('0x49')](handleError(_0x19e269,null));};exports[_0xcfe2('0x54')]=function(_0x104cf3,_0x5ddfb9,_0x42cfa5){var _0x3cf0be=[_0xcfe2('0x55'),_0xcfe2('0x56'),_0xcfe2('0x57'),_0xcfe2('0x58'),'close_code','notify',_0xcfe2('0x59'),_0xcfe2('0x5a'),_0xcfe2('0x5b')];var _0x53d63f=['parent',_0xcfe2('0x55'),_0xcfe2('0x5c'),'watch_list',_0xcfe2('0x5d'),_0xcfe2('0x5e'),_0xcfe2('0x5f'),_0xcfe2('0x56'),_0xcfe2('0x60'),_0xcfe2('0x61'),_0xcfe2('0x62'),_0xcfe2('0x63'),'opened_by',_0xcfe2('0x64'),_0xcfe2('0x65'),_0xcfe2('0x66'),_0xcfe2('0x67'),_0xcfe2('0x68'),_0xcfe2('0x57'),_0xcfe2('0x39'),_0xcfe2('0x69'),_0xcfe2('0x6a'),_0xcfe2('0x6b'),_0xcfe2('0x6c'),_0xcfe2('0x6d'),_0xcfe2('0x6e'),_0xcfe2('0x6f'),'business_service','priority',_0xcfe2('0x70'),_0xcfe2('0x71'),_0xcfe2('0x72'),'expected_start','opened_at',_0xcfe2('0x73'),_0xcfe2('0x74'),_0xcfe2('0x75'),'reopened_time',_0xcfe2('0x76'),_0xcfe2('0x77'),_0xcfe2('0x78'),_0xcfe2('0x58'),_0xcfe2('0x79'),'short_description',_0xcfe2('0x7a'),_0xcfe2('0x7b'),_0xcfe2('0x7c'),_0xcfe2('0x7d'),_0xcfe2('0x7e'),_0xcfe2('0x7f'),'additional_assignee_list',_0xcfe2('0x80'),_0xcfe2('0x81'),'notify',_0xcfe2('0x82'),_0xcfe2('0x83'),_0xcfe2('0x84'),_0xcfe2('0x85'),'parent_incident',_0xcfe2('0x86'),_0xcfe2('0x87'),_0xcfe2('0x88'),'incident_state',_0xcfe2('0x89'),'problem_id',_0xcfe2('0x8a'),_0xcfe2('0x8b'),_0xcfe2('0x8c'),_0xcfe2('0x8d'),'severity',_0xcfe2('0x8e'),'sla_due','approval','comments_and_work_notes','due_date',_0xcfe2('0x8f'),_0xcfe2('0x90'),_0xcfe2('0x91'),_0xcfe2('0x92'),'upon_approval',_0xcfe2('0x93'),_0xcfe2('0x94'),'category'];var _0x177370='';var _0x20c76a='';var _0x4149a6=[];var _0x2e123f='';var _0x5d4798='';var _0x41943a=[];var _0x2b5e4a='';var _0x2fa653='';var _0x4e9eee={};var _0x3fe407='';return db[_0xcfe2('0x2b')]['findOne']({'where':{'id':_0x104cf3[_0xcfe2('0x46')]['id']},'attributes':['id','username',_0xcfe2('0x95'),_0xcfe2('0x96'),_0xcfe2('0x97'),'serverUrl']})[_0xcfe2('0x24')](handleEntityNotFound(_0x5ddfb9,null))[_0xcfe2('0x24')](function(_0x156955){if(_0x156955){_0x3fe407=_0x156955[_0xcfe2('0x97')];var _0x37da88=_0x3fe407[_0xcfe2('0x98')](-0x1);if(_0x37da88==='/'){_0x3fe407=_0x3fe407[_0xcfe2('0x99')](0x0,_0x3fe407[_0xcfe2('0x9a')](_0x37da88));}_0x2fa653=util[_0xcfe2('0x9b')](_0xcfe2('0x9c'),_0x3fe407);_0x2b5e4a=util[_0xcfe2('0x9b')]('%s/api/now/table/',_0x3fe407);_0x4e9eee={'user':_0x156955[_0xcfe2('0x9d')],'pass':_0x156955[_0xcfe2('0x95')]};var _0x56853a={'method':_0xcfe2('0x9e'),'uri':_0x2fa653+'incident?sysparm_display_value=all','auth':_0x4e9eee,'json':!![]};return rp(_0x56853a);}})[_0xcfe2('0x24')](function(_0x2e6cce){if(_0x2e6cce[_0xcfe2('0x9f')][_0xcfe2('0x35')]>0x0){_0x177370=_0x2e6cce[_0xcfe2('0x9f')];}console['log']('incident\x20table\x20objects',_0x177370);_0x41943a=[];_0x20c76a=Object['assign']([],_0x177370);_[_0xcfe2('0xa0')](_0x20c76a,function(_0x4e665b){return!_0x3cf0be[_0xcfe2('0xa1')](_0x4e665b[_0xcfe2('0x27')]);});_0x20c76a['forEach'](function(_0x2c8791){var _0x485105=createFieldObject(_0x2b5e4a,_0x4e9eee,_0x2c8791['internalType'],_0x2c8791[_0xcfe2('0x27')],_0x2c8791[_0xcfe2('0xa2')],![]);_0x41943a[_0xcfe2('0xa3')](_0x485105);});return Promise['all'](_0x41943a);})[_0xcfe2('0x24')](function(_0x242adb){_0x4149a6=_0x242adb;_0x2e123f=Object[_0xcfe2('0xa4')]([],_0x177370);console['log'](_0xcfe2('0xa5'),_0x177370);_['remove'](_0x2e123f,function(_0x4995eb){return _0x53d63f[_0xcfe2('0xa1')](_0x4995eb[_0xcfe2('0x27')]);});console['log'](_0xcfe2('0xa6'),_0x2e123f);_0x41943a=[];_0x2e123f[_0xcfe2('0xa7')](function(_0x525bd8){var _0x889ab8=createFieldObject(_0x2b5e4a,_0x4e9eee,_0x525bd8[_0xcfe2('0xa8')],_0x525bd8[_0xcfe2('0x27')],_0x525bd8['label'],!![]);_0x41943a['push'](_0x889ab8);});return Promise[_0xcfe2('0xa9')](_0x41943a);})[_0xcfe2('0x24')](function(_0x5af64e){_0x5d4798=_0x5af64e;var _0x58ce62=_0x4149a6[_0xcfe2('0xaa')](_0x5d4798);return{'count':_0x58ce62['length'],'rows':_0x58ce62};})[_0xcfe2('0x24')](respondWithResult(_0x5ddfb9,null))[_0xcfe2('0x49')](function(_0x462beb){console[_0xcfe2('0xab')](_0xcfe2('0xac')+_0x462beb);var _0x4373f4=_0x104cf3[_0xcfe2('0x30')]['test']?0x1f4:_0x462beb[_0xcfe2('0xad')]||0x1f4;logger[_0xcfe2('0x26')](_0x462beb[_0xcfe2('0xae')]);delete _0x462beb[_0xcfe2('0x27')];if(_0x4373f4===0x191){_0x4373f4=0x190;}_0x5ddfb9[_0xcfe2('0x19')](_0x4373f4)['send'](_0x104cf3[_0xcfe2('0x30')]['test']?{'message':_0xcfe2('0xaf'),'statusCode':_0x462beb['statusCode']}:_0x462beb);});};function createFieldObject(_0x31008d,_0x1f2996,_0x29121a,_0x8d9b25,_0x2f6055,_0x5c9521){return new Promise(function(_0x5a4812,_0x1d3e69){var _0x1860a4={'id':_0x8d9b25,'name':_0x2f6055,'custom':_0x5c9521};if(_0x29121a===_0xcfe2('0xb0')){_0x1860a4['options']=[{'name':_0xcfe2('0xb1'),'value':'true'},{'name':_0xcfe2('0xb2'),'value':_0xcfe2('0xb3')}];_0x5a4812(_0x1860a4);}else{var _0x2db7f8={'method':_0xcfe2('0x9e'),'uri':_0x31008d+'sys_choice?sysparm_query=name=incident^element='+_0x8d9b25,'auth':_0x1f2996,'json':!![]};return rp(_0x2db7f8)[_0xcfe2('0x24')](function(_0x5c8e30){var _0xa05376=[];if(_0x5c8e30[_0xcfe2('0x9f')][_0xcfe2('0x35')]>0x0){_0x5c8e30[_0xcfe2('0x9f')][_0xcfe2('0xa7')](function(_0x319af1){if(_0x319af1[_0xcfe2('0xb4')]===_0xcfe2('0xb3')){var _0x14be33={'name':_0x319af1[_0xcfe2('0xa2')],'value':_0x319af1[_0xcfe2('0xb5')]};_0xa05376[_0xcfe2('0xa3')](_0x14be33);}});}_0x1860a4[_0xcfe2('0x40')]=_0xa05376;if(_0x1860a4['options'][_0xcfe2('0x35')]>0x0){_0x5a4812(_0x1860a4);}else{if(_0x5c9521==![]){_0x5a4812();}else{_0x5a4812(_0x1860a4);}}});}});} \ No newline at end of file +var _0xcf65=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','params','include','find','create','body','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','subcategory','notify','incident_state','category','parent','made_sla','caused_by','upon_reject','sys_updated_on','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','impact','active','business_service','priority','rfc','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','email','serverUrl','slice','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','desk.js','papaparse'];(function(_0x24d138,_0x2b1203){var _0x151c7a=function(_0x54a8f6){while(--_0x54a8f6){_0x24d138['push'](_0x24d138['shift']());}};_0x151c7a(++_0x2b1203);}(_0xcf65,0xa6));var _0x5cf6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcf65[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x5cf6('0x0'));var rimraf=require(_0x5cf6('0x1'));var zipdir=require(_0x5cf6('0x2'));var jsonpatch=require(_0x5cf6('0x3'));var rp=require(_0x5cf6('0x4'));var moment=require(_0x5cf6('0x5'));var BPromise=require(_0x5cf6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5cf6('0x7'));var sox=require(_0x5cf6('0x8'));var csv=require(_0x5cf6('0x9'));var ejs=require(_0x5cf6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5cf6('0xb'));var toCsv=require(_0x5cf6('0x9'));var querystring=require('querystring');var Papa=require(_0x5cf6('0xc'));var Redis=require(_0x5cf6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5cf6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5cf6('0xf'));var logger=require(_0x5cf6('0x10'))(_0x5cf6('0x11'));var utils=require(_0x5cf6('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5cf6('0x13'));var db=require(_0x5cf6('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x143060,_0x2ac459){_0x2ac459=_0x2ac459||0xcc;return function(_0x347483){if(_0x347483){return _0x143060[_0x5cf6('0x15')](_0x2ac459);}return _0x143060[_0x5cf6('0x16')](_0x2ac459)[_0x5cf6('0x17')]();};}function respondWithResult(_0x3e7375,_0x133eac){_0x133eac=_0x133eac||0xc8;return function(_0x5da779){if(_0x5da779){return _0x3e7375[_0x5cf6('0x16')](_0x133eac)[_0x5cf6('0x18')](_0x5da779);}};}function respondWithFilteredResult(_0x40bd33,_0x438022){return function(_0x594e9b){if(_0x594e9b){var _0x4d1d9f=typeof _0x438022[_0x5cf6('0x19')]===_0x5cf6('0x1a')&&typeof _0x438022[_0x5cf6('0x1b')]==='undefined';var _0x974158=_0x594e9b[_0x5cf6('0x1c')];var _0x550b12=_0x4d1d9f?0x0:_0x438022[_0x5cf6('0x19')];var _0x45848d=_0x4d1d9f?_0x594e9b[_0x5cf6('0x1c')]:_0x438022[_0x5cf6('0x19')]+_0x438022[_0x5cf6('0x1b')];var _0x1f6dbc;if(_0x45848d>=_0x974158){_0x45848d=_0x974158;_0x1f6dbc=0xc8;}else{_0x1f6dbc=0xce;}_0x40bd33[_0x5cf6('0x16')](_0x1f6dbc);return _0x40bd33[_0x5cf6('0x1d')](_0x5cf6('0x1e'),_0x550b12+'-'+_0x45848d+'/'+_0x974158)[_0x5cf6('0x18')](_0x594e9b);}return null;};}function patchUpdates(_0x594fb3){return function(_0x10c8e8){try{jsonpatch['apply'](_0x10c8e8,_0x594fb3,!![]);}catch(_0x18d52a){return BPromise['reject'](_0x18d52a);}return _0x10c8e8['save']();};}function saveUpdates(_0x128ab3,_0x12a78c){return function(_0x3d3dc5){if(_0x3d3dc5){return _0x3d3dc5[_0x5cf6('0x1f')](_0x128ab3)[_0x5cf6('0x20')](function(_0x5d63b6){return _0x5d63b6;});}return null;};}function removeEntity(_0x1925f5,_0x9e18ac){return function(_0x2a6ed5){if(_0x2a6ed5){return _0x2a6ed5[_0x5cf6('0x21')]()[_0x5cf6('0x20')](function(){_0x1925f5[_0x5cf6('0x16')](0xcc)[_0x5cf6('0x17')]();});}};}function handleEntityNotFound(_0x2164b2,_0x2d4e87){return function(_0x56dc5f){if(!_0x56dc5f){_0x2164b2[_0x5cf6('0x15')](0x194);}return _0x56dc5f;};}function handleError(_0x5f14f5,_0xae0b93){_0xae0b93=_0xae0b93||0x1f4;return function(_0x3471d2){logger['error'](_0x3471d2[_0x5cf6('0x22')]);if(_0x3471d2[_0x5cf6('0x23')]){delete _0x3471d2[_0x5cf6('0x23')];}_0x5f14f5[_0x5cf6('0x16')](_0xae0b93)[_0x5cf6('0x24')](_0x3471d2);};}exports[_0x5cf6('0x25')]=function(_0x161dac,_0x1255f5){var _0x5c2ba3={},_0x2a5336={},_0x4891f4={'count':0x0,'rows':[]};var _0x266c4d=_['map'](db[_0x5cf6('0x26')][_0x5cf6('0x27')],function(_0x32b0af){return{'name':_0x32b0af[_0x5cf6('0x28')],'type':_0x32b0af[_0x5cf6('0x29')][_0x5cf6('0x2a')]};});_0x2a5336[_0x5cf6('0x2b')]=_[_0x5cf6('0x2c')](_0x266c4d,'name');_0x2a5336[_0x5cf6('0x2d')]=_[_0x5cf6('0x2e')](_0x161dac[_0x5cf6('0x2d')]);_0x2a5336['filters']=_['intersection'](_0x2a5336[_0x5cf6('0x2b')],_0x2a5336['query']);_0x5c2ba3[_0x5cf6('0x2f')]=_[_0x5cf6('0x30')](_0x2a5336[_0x5cf6('0x2b')],qs[_0x5cf6('0x31')](_0x161dac[_0x5cf6('0x2d')]['fields']));_0x5c2ba3[_0x5cf6('0x2f')]=_0x5c2ba3[_0x5cf6('0x2f')][_0x5cf6('0x32')]?_0x5c2ba3[_0x5cf6('0x2f')]:_0x2a5336[_0x5cf6('0x2b')];if(!_0x161dac['query'][_0x5cf6('0x33')](_0x5cf6('0x34'))){_0x5c2ba3[_0x5cf6('0x1b')]=qs[_0x5cf6('0x1b')](_0x161dac[_0x5cf6('0x2d')]['limit']);_0x5c2ba3[_0x5cf6('0x19')]=qs[_0x5cf6('0x19')](_0x161dac[_0x5cf6('0x2d')]['offset']);}_0x5c2ba3[_0x5cf6('0x35')]=qs[_0x5cf6('0x36')](_0x161dac[_0x5cf6('0x2d')][_0x5cf6('0x36')]);_0x5c2ba3[_0x5cf6('0x37')]=qs[_0x5cf6('0x38')](_[_0x5cf6('0x39')](_0x161dac[_0x5cf6('0x2d')],_0x2a5336[_0x5cf6('0x38')]),_0x266c4d);if(_0x161dac[_0x5cf6('0x2d')]['filter']){_0x5c2ba3[_0x5cf6('0x37')]=_['merge'](_0x5c2ba3[_0x5cf6('0x37')],{'$or':_['map'](_0x266c4d,function(_0x1aeae9){if(_0x1aeae9[_0x5cf6('0x29')]!==_0x5cf6('0x3a')){var _0x147487={};_0x147487[_0x1aeae9['name']]={'$like':'%'+_0x161dac[_0x5cf6('0x2d')][_0x5cf6('0x3b')]+'%'};return _0x147487;}})});}_0x5c2ba3=_[_0x5cf6('0x3c')]({},_0x5c2ba3,_0x161dac[_0x5cf6('0x3d')]);var _0x1dcb47={'where':_0x5c2ba3[_0x5cf6('0x37')]};return db[_0x5cf6('0x26')][_0x5cf6('0x1c')](_0x1dcb47)[_0x5cf6('0x20')](function(_0x4a8f9e){_0x4891f4[_0x5cf6('0x1c')]=_0x4a8f9e;if(_0x161dac[_0x5cf6('0x2d')][_0x5cf6('0x3e')]){_0x5c2ba3['include']=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x5c2ba3);})[_0x5cf6('0x20')](function(_0x1c3013){_0x4891f4[_0x5cf6('0x3f')]=_0x1c3013;return _0x4891f4;})['then'](respondWithFilteredResult(_0x1255f5,_0x5c2ba3))[_0x5cf6('0x40')](handleError(_0x1255f5,null));};exports[_0x5cf6('0x41')]=function(_0x228032,_0x269006){var _0x8a3b4a={'raw':![],'where':{'id':_0x228032[_0x5cf6('0x42')]['id']}},_0x35eb9a={};_0x35eb9a['model']=_[_0x5cf6('0x2e')](db[_0x5cf6('0x26')][_0x5cf6('0x27')]);_0x35eb9a[_0x5cf6('0x2d')]=_[_0x5cf6('0x2e')](_0x228032['query']);_0x35eb9a[_0x5cf6('0x38')]=_['intersection'](_0x35eb9a['model'],_0x35eb9a[_0x5cf6('0x2d')]);_0x8a3b4a[_0x5cf6('0x2f')]=_[_0x5cf6('0x30')](_0x35eb9a[_0x5cf6('0x2b')],qs['fields'](_0x228032[_0x5cf6('0x2d')][_0x5cf6('0x31')]));_0x8a3b4a['attributes']=_0x8a3b4a[_0x5cf6('0x2f')][_0x5cf6('0x32')]?_0x8a3b4a['attributes']:_0x35eb9a[_0x5cf6('0x2b')];if(_0x228032[_0x5cf6('0x2d')][_0x5cf6('0x3e')]){_0x8a3b4a[_0x5cf6('0x43')]=[{'all':!![]}];}_0x8a3b4a=_[_0x5cf6('0x3c')]({},_0x8a3b4a,_0x228032[_0x5cf6('0x3d')]);return db['ServicenowAccount'][_0x5cf6('0x44')](_0x8a3b4a)[_0x5cf6('0x20')](handleEntityNotFound(_0x269006,null))['then'](respondWithResult(_0x269006,null))[_0x5cf6('0x40')](handleError(_0x269006,null));};exports['create']=function(_0x2653b7,_0x35de9b){return db['ServicenowAccount'][_0x5cf6('0x45')](_0x2653b7[_0x5cf6('0x46')],{})[_0x5cf6('0x20')](respondWithResult(_0x35de9b,0xc9))[_0x5cf6('0x40')](handleError(_0x35de9b,null));};exports[_0x5cf6('0x1f')]=function(_0x5b531f,_0x33be11){if(_0x5b531f[_0x5cf6('0x46')]['id']){delete _0x5b531f[_0x5cf6('0x46')]['id'];}return db[_0x5cf6('0x26')][_0x5cf6('0x44')]({'where':{'id':_0x5b531f['params']['id']}})[_0x5cf6('0x20')](handleEntityNotFound(_0x33be11,null))[_0x5cf6('0x20')](saveUpdates(_0x5b531f['body'],null))[_0x5cf6('0x20')](respondWithResult(_0x33be11,null))['catch'](handleError(_0x33be11,null));};exports['destroy']=function(_0x27648d,_0x1ee076){return db['ServicenowAccount'][_0x5cf6('0x44')]({'where':{'id':_0x27648d[_0x5cf6('0x42')]['id']}})[_0x5cf6('0x20')](handleEntityNotFound(_0x1ee076,null))[_0x5cf6('0x20')](removeEntity(_0x1ee076,null))['catch'](handleError(_0x1ee076,null));};exports['getConfigurations']=function(_0x561dff,_0x4ccf4d,_0x18ec1b){var _0x39ee9c={};var _0x21aa84={};var _0x41aaae;var _0x2334b3;return db[_0x5cf6('0x26')][_0x5cf6('0x47')]({'where':{'id':_0x561dff[_0x5cf6('0x42')]['id']}})[_0x5cf6('0x20')](handleEntityNotFound(_0x4ccf4d,null))[_0x5cf6('0x20')](function(_0x3689a4){if(_0x3689a4){_0x41aaae=_0x3689a4;_0x21aa84[_0x5cf6('0x2b')]=_[_0x5cf6('0x2e')](db[_0x5cf6('0x48')][_0x5cf6('0x27')]);_0x21aa84[_0x5cf6('0x2d')]=_[_0x5cf6('0x2e')](_0x561dff[_0x5cf6('0x2d')]);_0x21aa84[_0x5cf6('0x38')]=_[_0x5cf6('0x30')](_0x21aa84[_0x5cf6('0x2b')],_0x21aa84[_0x5cf6('0x2d')]);_0x39ee9c[_0x5cf6('0x2f')]=_[_0x5cf6('0x30')](_0x21aa84[_0x5cf6('0x2b')],qs[_0x5cf6('0x31')](_0x561dff[_0x5cf6('0x2d')][_0x5cf6('0x31')]));_0x39ee9c[_0x5cf6('0x2f')]=_0x39ee9c[_0x5cf6('0x2f')]['length']?_0x39ee9c[_0x5cf6('0x2f')]:_0x21aa84[_0x5cf6('0x2b')];_0x39ee9c[_0x5cf6('0x35')]=qs[_0x5cf6('0x36')](_0x561dff[_0x5cf6('0x2d')][_0x5cf6('0x36')]);_0x39ee9c[_0x5cf6('0x37')]=qs[_0x5cf6('0x38')](_[_0x5cf6('0x39')](_0x561dff[_0x5cf6('0x2d')],_0x21aa84[_0x5cf6('0x38')]));if(_0x561dff[_0x5cf6('0x2d')][_0x5cf6('0x3b')]){_0x39ee9c[_0x5cf6('0x37')]=_['merge'](_0x39ee9c[_0x5cf6('0x37')],{'$or':_[_0x5cf6('0x2c')](_0x39ee9c[_0x5cf6('0x2f')],function(_0x26ded1){var _0x4d5888={};_0x4d5888[_0x26ded1]={'$like':'%'+_0x561dff['query'][_0x5cf6('0x3b')]+'%'};return _0x4d5888;})});}_0x39ee9c=_[_0x5cf6('0x3c')]({},_0x39ee9c,_0x561dff[_0x5cf6('0x3d')]);return _0x41aaae[_0x5cf6('0x49')](_0x39ee9c);}})[_0x5cf6('0x20')](function(_0x4f59fd){if(_0x4f59fd){_0x2334b3=_0x4f59fd[_0x5cf6('0x32')];if(!_0x561dff[_0x5cf6('0x2d')][_0x5cf6('0x33')](_0x5cf6('0x34'))){_0x39ee9c[_0x5cf6('0x1b')]=qs[_0x5cf6('0x1b')](_0x561dff[_0x5cf6('0x2d')]['limit']);_0x39ee9c[_0x5cf6('0x19')]=qs[_0x5cf6('0x19')](_0x561dff[_0x5cf6('0x2d')]['offset']);}return _0x41aaae[_0x5cf6('0x49')](_0x39ee9c);}})[_0x5cf6('0x20')](function(_0x4b1b91){if(_0x4b1b91){return _0x4b1b91?{'count':_0x2334b3,'rows':_0x4b1b91}:null;}})[_0x5cf6('0x20')](respondWithResult(_0x4ccf4d,null))[_0x5cf6('0x40')](handleError(_0x4ccf4d,null));};exports[_0x5cf6('0x4a')]=function(_0x50a724,_0x5d7af2,_0xec5dbc){if(_0x50a724[_0x5cf6('0x46')]['id']){delete _0x50a724[_0x5cf6('0x46')]['id'];}return db[_0x5cf6('0x26')][_0x5cf6('0x47')]({'where':{'id':_0x50a724[_0x5cf6('0x42')]['id']}})[_0x5cf6('0x20')](handleEntityNotFound(_0x5d7af2,null))[_0x5cf6('0x20')](function(_0x4e16a2){if(_0x4e16a2){_0x50a724[_0x5cf6('0x46')][_0x5cf6('0x4b')]=_0x4e16a2['id'];_0x50a724[_0x5cf6('0x46')][_0x5cf6('0x4c')]=integrations[_0x5cf6('0x4d')](_0x50a724[_0x5cf6('0x46')][_0x5cf6('0x4e')],_0x50a724[_0x5cf6('0x46')]['type']);_0x50a724[_0x5cf6('0x46')][_0x5cf6('0x4f')]=integrations[_0x5cf6('0x50')](_0x50a724[_0x5cf6('0x46')][_0x5cf6('0x4e')],_0x50a724['body']['type']);return db['ServicenowConfiguration'][_0x5cf6('0x45')](_0x50a724[_0x5cf6('0x46')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0x5cf6('0x51')],'as':_0x5cf6('0x4f')}]});}return null;})[_0x5cf6('0x20')](respondWithResult(_0x5d7af2,null))[_0x5cf6('0x40')](handleError(_0x5d7af2,null));};exports[_0x5cf6('0x52')]=function(_0x1e456c,_0x558ae6,_0x48dd24){var _0x57c015=['made_sla',_0x5cf6('0x53'),_0x5cf6('0x54'),_0x5cf6('0x55'),'close_code',_0x5cf6('0x56'),_0x5cf6('0x57'),'severity',_0x5cf6('0x58')];var _0x275375=[_0x5cf6('0x59'),_0x5cf6('0x5a'),_0x5cf6('0x5b'),'watch_list',_0x5cf6('0x5c'),_0x5cf6('0x5d'),'child_incidents','hold_reason','approval_history','number',_0x5cf6('0x5e'),'sys_updated_by',_0x5cf6('0x5f'),_0x5cf6('0x60'),_0x5cf6('0x61'),_0x5cf6('0x62'),_0x5cf6('0x63'),_0x5cf6('0x64'),_0x5cf6('0x54'),'order',_0x5cf6('0x65'),_0x5cf6('0x66'),'cmdb_ci','delivery_plan',_0x5cf6('0x67'),_0x5cf6('0x68'),'work_notes_list',_0x5cf6('0x69'),_0x5cf6('0x6a'),'sys_domain_path',_0x5cf6('0x6b'),'time_worked','expected_start',_0x5cf6('0x6c'),'business_duration',_0x5cf6('0x6d'),_0x5cf6('0x6e'),_0x5cf6('0x6f'),_0x5cf6('0x70'),_0x5cf6('0x71'),'approval_set','subcategory',_0x5cf6('0x72'),_0x5cf6('0x73'),'close_code',_0x5cf6('0x74'),_0x5cf6('0x75'),_0x5cf6('0x76'),_0x5cf6('0x77'),'business_stc',_0x5cf6('0x78'),_0x5cf6('0x79'),_0x5cf6('0x7a'),_0x5cf6('0x56'),'sys_class_name','close_notes','closed_by',_0x5cf6('0x7b'),_0x5cf6('0x7c'),_0x5cf6('0x7d'),_0x5cf6('0x7e'),_0x5cf6('0x7f'),_0x5cf6('0x57'),_0x5cf6('0x80'),'problem_id',_0x5cf6('0x81'),_0x5cf6('0x82'),_0x5cf6('0x83'),'assigned_to',_0x5cf6('0x84'),_0x5cf6('0x85'),'sla_due',_0x5cf6('0x86'),_0x5cf6('0x87'),_0x5cf6('0x88'),_0x5cf6('0x89'),_0x5cf6('0x8a'),_0x5cf6('0x8b'),_0x5cf6('0x8c'),_0x5cf6('0x8d'),_0x5cf6('0x8e'),_0x5cf6('0x8f'),_0x5cf6('0x58')];var _0x1dfaec='';var _0x20cdad='';var _0x26c3d7=[];var _0x5a0e35='';var _0x4a2144='';var _0x39d5e=[];var _0x54a3ae='';var _0x5a1b2d='';var _0xa78083={};var _0x3219cc='';return db[_0x5cf6('0x26')]['findOne']({'where':{'id':_0x1e456c['params']['id']},'attributes':['id','username','password',_0x5cf6('0x90'),'remoteUri',_0x5cf6('0x91')]})[_0x5cf6('0x20')](handleEntityNotFound(_0x558ae6,null))[_0x5cf6('0x20')](function(_0x4278d7){if(_0x4278d7){_0x3219cc=_0x4278d7['remoteUri'];var _0x4bc375=_0x3219cc[_0x5cf6('0x92')](-0x1);if(_0x4bc375==='/'){_0x3219cc=_0x3219cc['substring'](0x0,_0x3219cc[_0x5cf6('0x93')](_0x4bc375));}_0x5a1b2d=util['format'](_0x5cf6('0x94'),_0x3219cc);_0x54a3ae=util[_0x5cf6('0x95')](_0x5cf6('0x96'),_0x3219cc);_0xa78083={'user':_0x4278d7[_0x5cf6('0x97')],'pass':_0x4278d7['password']};var _0x59d84d={'method':_0x5cf6('0x98'),'uri':_0x5a1b2d+_0x5cf6('0x99'),'auth':_0xa78083,'json':!![]};return rp(_0x59d84d);}})['then'](function(_0x190958){if(_0x190958[_0x5cf6('0x9a')][_0x5cf6('0x32')]>0x0){_0x1dfaec=_0x190958[_0x5cf6('0x9a')];}console[_0x5cf6('0x9b')](_0x5cf6('0x9c'),_0x1dfaec);_0x39d5e=[];_0x20cdad=Object[_0x5cf6('0x9d')]([],_0x1dfaec);_['remove'](_0x20cdad,function(_0x552c56){return!_0x57c015[_0x5cf6('0x9e')](_0x552c56['name']);});_0x20cdad[_0x5cf6('0x9f')](function(_0x3e5df8){var _0x51f341=createFieldObject(_0x54a3ae,_0xa78083,_0x3e5df8[_0x5cf6('0xa0')],_0x3e5df8[_0x5cf6('0x23')],_0x3e5df8[_0x5cf6('0xa1')],![]);_0x39d5e[_0x5cf6('0xa2')](_0x51f341);});return Promise[_0x5cf6('0xa3')](_0x39d5e);})[_0x5cf6('0x20')](function(_0x303dd2){_0x26c3d7=_0x303dd2;_0x5a0e35=Object[_0x5cf6('0x9d')]([],_0x1dfaec);console[_0x5cf6('0x9b')](_0x5cf6('0xa4'),_0x1dfaec);_['remove'](_0x5a0e35,function(_0x3fce4f){return _0x275375[_0x5cf6('0x9e')](_0x3fce4f[_0x5cf6('0x23')]);});console[_0x5cf6('0x9b')](_0x5cf6('0xa5'),_0x5a0e35);_0x39d5e=[];_0x5a0e35[_0x5cf6('0x9f')](function(_0x4f5c03){var _0x10d772=createFieldObject(_0x54a3ae,_0xa78083,_0x4f5c03['internalType'],_0x4f5c03[_0x5cf6('0x23')],_0x4f5c03[_0x5cf6('0xa1')],!![]);_0x39d5e[_0x5cf6('0xa2')](_0x10d772);});return Promise[_0x5cf6('0xa3')](_0x39d5e);})['then'](function(_0x3e6e74){_0x4a2144=_0x3e6e74;var _0x5da3bd=_0x26c3d7[_0x5cf6('0xa6')](_0x4a2144);return{'count':_0x5da3bd[_0x5cf6('0x32')],'rows':_0x5da3bd};})[_0x5cf6('0x20')](respondWithResult(_0x558ae6,null))[_0x5cf6('0x40')](function(_0x2e0c9f){console[_0x5cf6('0x9b')](_0x5cf6('0xa7')+_0x2e0c9f);var _0x11d64a=_0x1e456c['query'][_0x5cf6('0xa8')]?0x1f4:_0x2e0c9f[_0x5cf6('0xa9')]||0x1f4;logger['error'](_0x2e0c9f['stack']);delete _0x2e0c9f[_0x5cf6('0x23')];if(_0x11d64a===0x191){_0x11d64a=0x190;}_0x558ae6[_0x5cf6('0x16')](_0x11d64a)[_0x5cf6('0x24')](_0x1e456c['query'][_0x5cf6('0xa8')]?{'message':_0x5cf6('0xaa'),'statusCode':_0x2e0c9f[_0x5cf6('0xa9')]}:_0x2e0c9f);});};function createFieldObject(_0x1990e5,_0x19e637,_0x5af028,_0x157cd4,_0x591a1d,_0x9a7cb0){return new Promise(function(_0x302b93,_0x1eecd2){var _0x427593={'id':_0x157cd4,'name':_0x591a1d,'custom':_0x9a7cb0};if(_0x5af028===_0x5cf6('0xab')){_0x427593['options']=[{'name':_0x5cf6('0xac'),'value':_0x5cf6('0xad')},{'name':_0x5cf6('0xae'),'value':_0x5cf6('0xaf')}];_0x302b93(_0x427593);}else{var _0x1438c1={'method':'GET','uri':_0x1990e5+_0x5cf6('0xb0')+_0x157cd4,'auth':_0x19e637,'json':!![]};return rp(_0x1438c1)[_0x5cf6('0x20')](function(_0x1ed2f9){var _0x7bf34f=[];if(_0x1ed2f9['result'][_0x5cf6('0x32')]>0x0){_0x1ed2f9[_0x5cf6('0x9a')][_0x5cf6('0x9f')](function(_0x156cc4){if(_0x156cc4[_0x5cf6('0xb1')]===_0x5cf6('0xaf')){var _0x2bf691={'name':_0x156cc4[_0x5cf6('0xa1')],'value':_0x156cc4[_0x5cf6('0xb2')]};_0x7bf34f[_0x5cf6('0xa2')](_0x2bf691);}});}_0x427593[_0x5cf6('0x3d')]=_0x7bf34f;if(_0x427593[_0x5cf6('0x3d')]['length']>0x0){_0x302b93(_0x427593);}else{if(_0x9a7cb0==![]){_0x302b93();}else{_0x302b93(_0x427593);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index dcf625a..d1c67a4 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['api','moment','bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x361e5d,_0x15e1a4){var _0x4c303d=function(_0x504f9f){while(--_0x504f9f){_0x361e5d['push'](_0x361e5d['shift']());}};_0x4c303d(++_0x15e1a4);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2dcaa2,_0x17bfe3){_0x2dcaa2=_0x2dcaa2-0x0;var _0x58b124=_0x1cb9[_0x2dcaa2];return _0x58b124;};'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'));var integrations=require(_0x91cb('0x8'));module[_0x91cb('0x9')]=function(_0x28543e,_0x3b9d98){return _0x28543e[_0x91cb('0xa')]('ServicenowAccount',attributes,{'tableName':_0x91cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7da7=['../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da7,0x10d));var _0x77da=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x7da7[_0x64aff8];return _0x5488a3;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x77da('0x7'));module[_0x77da('0x8')]=function(_0x47da81,_0x30afe0){return _0x47da81['define'](_0x77da('0x9'),attributes,{'tableName':_0x77da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index ad0bbd0..cc3626b 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js +++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe24=['stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','limit','include','map','attributes','model','then','ShowServicenowAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s'];(function(_0x28a54a,_0x4b5999){var _0x2cfc12=function(_0x1396f6){while(--_0x1396f6){_0x28a54a['push'](_0x28a54a['shift']());}};_0x2cfc12(++_0x4b5999);}(_0xfe24,0xdf));var _0x4fe2=function(_0x29a703,_0x557fb7){_0x29a703=_0x29a703-0x0;var _0x40a94f=_0xfe24[_0x29a703];return _0x40a94f;};'use strict';var _=require(_0x4fe2('0x0'));var util=require(_0x4fe2('0x1'));var moment=require('moment');var BPromise=require(_0x4fe2('0x2'));var rs=require(_0x4fe2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4fe2('0x4'))['db'];var utils=require(_0x4fe2('0x5'));var logger=require(_0x4fe2('0x6'))(_0x4fe2('0x7'));var config=require('../../config/environment');var jayson=require(_0x4fe2('0x8'));var client=jayson['client'][_0x4fe2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9a0395,_0x52a31b,_0x4c6c77){return new BPromise(function(_0x277e4a,_0x33bfb3){return client[_0x4fe2('0xa')](_0x9a0395,_0x4c6c77)['then'](function(_0x3dff3a){logger[_0x4fe2('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0x52a31b,_0x4fe2('0xc'));logger[_0x4fe2('0xd')](_0x4fe2('0xe'),_0x52a31b,'request\x20sent',JSON[_0x4fe2('0xf')](_0x3dff3a));if(_0x3dff3a[_0x4fe2('0x10')]){if(_0x3dff3a[_0x4fe2('0x10')][_0x4fe2('0x11')]===0x1f4){logger[_0x4fe2('0x10')](_0x4fe2('0x12'),_0x52a31b,_0x3dff3a['error'][_0x4fe2('0x13')]);return _0x33bfb3(_0x3dff3a[_0x4fe2('0x10')][_0x4fe2('0x13')]);}logger['error'](_0x4fe2('0x12'),_0x52a31b,_0x3dff3a[_0x4fe2('0x10')][_0x4fe2('0x13')]);return _0x277e4a(_0x3dff3a[_0x4fe2('0x10')]['message']);}else{logger[_0x4fe2('0xb')](_0x4fe2('0x12'),_0x52a31b,'request\x20sent');_0x277e4a(_0x3dff3a[_0x4fe2('0x14')]['message']);}})[_0x4fe2('0x15')](function(_0x443224){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x52a31b,_0x443224);_0x33bfb3(_0x443224);});});}exports[_0x4fe2('0x16')]=function(_0x11ed28){var _0x5e64a4=this;return new Promise(function(_0x30508f,_0x207a5e){return db[_0x4fe2('0x17')]['findAll']({'raw':_0x11ed28[_0x4fe2('0x18')]?_0x11ed28['options'][_0x4fe2('0x19')]===undefined?!![]:![]:!![],'where':_0x11ed28[_0x4fe2('0x18')]?_0x11ed28[_0x4fe2('0x18')][_0x4fe2('0x1a')]||null:null,'attributes':_0x11ed28[_0x4fe2('0x18')]?_0x11ed28[_0x4fe2('0x18')]['attributes']||null:null,'limit':_0x11ed28[_0x4fe2('0x18')]?_0x11ed28['options'][_0x4fe2('0x1b')]||null:null,'include':_0x11ed28[_0x4fe2('0x18')]?_0x11ed28['options'][_0x4fe2('0x1c')]?_[_0x4fe2('0x1d')](_0x11ed28['options'][_0x4fe2('0x1c')],function(_0x529c8e){return{'model':db[_0x529c8e['model']],'as':_0x529c8e['as'],'attributes':_0x529c8e[_0x4fe2('0x1e')],'include':_0x529c8e[_0x4fe2('0x1c')]?_[_0x4fe2('0x1d')](_0x529c8e[_0x4fe2('0x1c')],function(_0x358021){return{'model':db[_0x358021[_0x4fe2('0x1f')]],'as':_0x358021['as'],'attributes':_0x358021[_0x4fe2('0x1e')],'include':_0x358021['include']?_[_0x4fe2('0x1d')](_0x358021[_0x4fe2('0x1c')],function(_0x9564df){return{'model':db[_0x9564df['model']],'as':_0x9564df['as'],'attributes':_0x9564df['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fe2('0x20')](function(_0x454a40){logger[_0x4fe2('0xb')]('GetServicenowAccount',_0x11ed28);logger['debug'](_0x4fe2('0x16'),_0x11ed28,JSON[_0x4fe2('0xf')](_0x454a40));_0x30508f(_0x454a40);})[_0x4fe2('0x15')](function(_0x36ecb6){logger[_0x4fe2('0x10')](_0x4fe2('0x16'),_0x36ecb6[_0x4fe2('0x13')],_0x11ed28);_0x207a5e(_0x5e64a4['error'](0x1f4,_0x36ecb6[_0x4fe2('0x13')]));});});};exports[_0x4fe2('0x21')]=function(_0x4c7b48){var _0x1e2901=this;return new Promise(function(_0x3e39a0,_0x529e05){return db[_0x4fe2('0x17')]['find']({'raw':_0x4c7b48[_0x4fe2('0x18')]?_0x4c7b48[_0x4fe2('0x18')][_0x4fe2('0x19')]===undefined?!![]:![]:!![],'where':_0x4c7b48['options']?_0x4c7b48[_0x4fe2('0x18')][_0x4fe2('0x1a')]||null:null,'attributes':_0x4c7b48[_0x4fe2('0x18')]?_0x4c7b48['options'][_0x4fe2('0x1e')]||null:null,'include':_0x4c7b48[_0x4fe2('0x18')]?_0x4c7b48['options'][_0x4fe2('0x1c')]?_[_0x4fe2('0x1d')](_0x4c7b48[_0x4fe2('0x18')][_0x4fe2('0x1c')],function(_0x138ca4){return{'model':db[_0x138ca4['model']],'as':_0x138ca4['as'],'attributes':_0x138ca4[_0x4fe2('0x1e')],'include':_0x138ca4[_0x4fe2('0x1c')]?_['map'](_0x138ca4['include'],function(_0xa023ae){return{'model':db[_0xa023ae[_0x4fe2('0x1f')]],'as':_0xa023ae['as'],'attributes':_0xa023ae[_0x4fe2('0x1e')],'include':_0xa023ae[_0x4fe2('0x1c')]?_[_0x4fe2('0x1d')](_0xa023ae[_0x4fe2('0x1c')],function(_0x36eb74){return{'model':db[_0x36eb74[_0x4fe2('0x1f')]],'as':_0x36eb74['as'],'attributes':_0x36eb74[_0x4fe2('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x152103){logger[_0x4fe2('0xb')](_0x4fe2('0x21'),_0x4c7b48);logger[_0x4fe2('0xd')]('ShowServicenowAccount',_0x4c7b48,JSON[_0x4fe2('0xf')](_0x152103));_0x3e39a0(_0x152103);})[_0x4fe2('0x15')](function(_0x5a8e94){logger[_0x4fe2('0x10')](_0x4fe2('0x21'),_0x5a8e94['message'],_0x4c7b48);_0x529e05(_0x1e2901['error'](0x1f4,_0x5a8e94[_0x4fe2('0x13')]));});});}; \ No newline at end of file +var _0x328f=['include','map','model','stringify','ServicenowAccount','raw','where','ShowServicenowAccount','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','findAll','options','attributes','limit'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x328f,0xd4));var _0xf328=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x328f[_0x2132a3];return _0x21890c;};'use strict';var _=require(_0xf328('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf328('0x1'));var rs=require(_0xf328('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf328('0x3'))['db'];var utils=require(_0xf328('0x4'));var logger=require(_0xf328('0x5'))(_0xf328('0x6'));var config=require('../../config/environment');var jayson=require(_0xf328('0x7'));var client=jayson['client'][_0xf328('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2733b9,_0x5763ac,_0x5bf986){return new BPromise(function(_0x56bbca,_0x2340be){return client[_0xf328('0x9')](_0x2733b9,_0x5bf986)[_0xf328('0xa')](function(_0xea7c79){logger[_0xf328('0xb')](_0xf328('0xc'),_0x5763ac,_0xf328('0xd'));logger[_0xf328('0xe')](_0xf328('0xf'),_0x5763ac,_0xf328('0xd'),JSON['stringify'](_0xea7c79));if(_0xea7c79['error']){if(_0xea7c79[_0xf328('0x10')][_0xf328('0x11')]===0x1f4){logger[_0xf328('0x10')](_0xf328('0xc'),_0x5763ac,_0xea7c79[_0xf328('0x10')]['message']);return _0x2340be(_0xea7c79[_0xf328('0x10')][_0xf328('0x12')]);}logger[_0xf328('0x10')](_0xf328('0xc'),_0x5763ac,_0xea7c79[_0xf328('0x10')][_0xf328('0x12')]);return _0x56bbca(_0xea7c79[_0xf328('0x10')]['message']);}else{logger[_0xf328('0xb')](_0xf328('0xc'),_0x5763ac,_0xf328('0xd'));_0x56bbca(_0xea7c79[_0xf328('0x13')]['message']);}})[_0xf328('0x14')](function(_0x100559){logger[_0xf328('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x5763ac,_0x100559);_0x2340be(_0x100559);});});}exports[_0xf328('0x15')]=function(_0x2946d6){var _0x10bd9d=this;return new Promise(function(_0x15b9c3,_0x109158){return db['ServicenowAccount'][_0xf328('0x16')]({'raw':_0x2946d6['options']?_0x2946d6['options']['raw']===undefined?!![]:![]:!![],'where':_0x2946d6[_0xf328('0x17')]?_0x2946d6[_0xf328('0x17')]['where']||null:null,'attributes':_0x2946d6[_0xf328('0x17')]?_0x2946d6[_0xf328('0x17')][_0xf328('0x18')]||null:null,'limit':_0x2946d6[_0xf328('0x17')]?_0x2946d6[_0xf328('0x17')][_0xf328('0x19')]||null:null,'include':_0x2946d6[_0xf328('0x17')]?_0x2946d6[_0xf328('0x17')][_0xf328('0x1a')]?_[_0xf328('0x1b')](_0x2946d6[_0xf328('0x17')]['include'],function(_0x5edaa8){return{'model':db[_0x5edaa8[_0xf328('0x1c')]],'as':_0x5edaa8['as'],'attributes':_0x5edaa8[_0xf328('0x18')],'include':_0x5edaa8[_0xf328('0x1a')]?_['map'](_0x5edaa8[_0xf328('0x1a')],function(_0x106a65){return{'model':db[_0x106a65['model']],'as':_0x106a65['as'],'attributes':_0x106a65[_0xf328('0x18')],'include':_0x106a65[_0xf328('0x1a')]?_[_0xf328('0x1b')](_0x106a65['include'],function(_0x1e7a28){return{'model':db[_0x1e7a28['model']],'as':_0x1e7a28['as'],'attributes':_0x1e7a28[_0xf328('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf328('0xa')](function(_0x288b60){logger[_0xf328('0xb')]('GetServicenowAccount',_0x2946d6);logger['debug'](_0xf328('0x15'),_0x2946d6,JSON[_0xf328('0x1d')](_0x288b60));_0x15b9c3(_0x288b60);})[_0xf328('0x14')](function(_0x33d1be){logger[_0xf328('0x10')](_0xf328('0x15'),_0x33d1be['message'],_0x2946d6);_0x109158(_0x10bd9d[_0xf328('0x10')](0x1f4,_0x33d1be['message']));});});};exports['ShowServicenowAccount']=function(_0x52e41e){var _0x16c371=this;return new Promise(function(_0x1389be,_0x1d8753){return db[_0xf328('0x1e')]['find']({'raw':_0x52e41e[_0xf328('0x17')]?_0x52e41e[_0xf328('0x17')][_0xf328('0x1f')]===undefined?!![]:![]:!![],'where':_0x52e41e['options']?_0x52e41e[_0xf328('0x17')][_0xf328('0x20')]||null:null,'attributes':_0x52e41e[_0xf328('0x17')]?_0x52e41e[_0xf328('0x17')][_0xf328('0x18')]||null:null,'include':_0x52e41e['options']?_0x52e41e[_0xf328('0x17')]['include']?_[_0xf328('0x1b')](_0x52e41e[_0xf328('0x17')][_0xf328('0x1a')],function(_0x655c97){return{'model':db[_0x655c97[_0xf328('0x1c')]],'as':_0x655c97['as'],'attributes':_0x655c97[_0xf328('0x18')],'include':_0x655c97['include']?_[_0xf328('0x1b')](_0x655c97[_0xf328('0x1a')],function(_0x4d761b){return{'model':db[_0x4d761b[_0xf328('0x1c')]],'as':_0x4d761b['as'],'attributes':_0x4d761b[_0xf328('0x18')],'include':_0x4d761b[_0xf328('0x1a')]?_[_0xf328('0x1b')](_0x4d761b[_0xf328('0x1a')],function(_0x500025){return{'model':db[_0x500025[_0xf328('0x1c')]],'as':_0x500025['as'],'attributes':_0x500025['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x161fbf){logger[_0xf328('0xb')](_0xf328('0x21'),_0x52e41e);logger[_0xf328('0xe')](_0xf328('0x21'),_0x52e41e,JSON[_0xf328('0x1d')](_0x161fbf));_0x1389be(_0x161fbf);})[_0xf328('0x14')](function(_0x206b32){logger[_0xf328('0x10')](_0xf328('0x21'),_0x206b32[_0xf328('0x12')],_0x52e41e);_0x1d8753(_0x16c371['error'](0x1f4,_0x206b32[_0xf328('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 56a97e4..d9215a8 100644 --- a/server/api/intServicenowConfiguration/index.js +++ b/server/api/intServicenowConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f50=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','index','get','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','isAuthenticated','getDescriptions','post','create','delete','destroy'];(function(_0x12145c,_0x52dda9){var _0x476d7d=function(_0x233d10){while(--_0x233d10){_0x12145c['push'](_0x12145c['shift']());}};_0x476d7d(++_0x52dda9);}(_0x2f50,0x199));var _0x02f5=function(_0x56190b,_0x5bfe19){_0x56190b=_0x56190b-0x0;var _0x3aad58=_0x2f50[_0x56190b];return _0x3aad58;};'use strict';var multer=require(_0x02f5('0x0'));var util=require(_0x02f5('0x1'));var path=require(_0x02f5('0x2'));var timeout=require('connect-timeout');var express=require(_0x02f5('0x3'));var router=express[_0x02f5('0x4')]();var fs_extra=require(_0x02f5('0x5'));var auth=require(_0x02f5('0x6'));var interaction=require(_0x02f5('0x7'));var config=require(_0x02f5('0x8'));var controller=require(_0x02f5('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x02f5('0xa')]);router[_0x02f5('0xb')](_0x02f5('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x02f5('0xd'),auth['isAuthenticated'](),controller[_0x02f5('0xe')]);router[_0x02f5('0xb')](_0x02f5('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x02f5('0xb')](_0x02f5('0x10'),auth[_0x02f5('0x11')](),controller[_0x02f5('0x12')]);router[_0x02f5('0x13')]('/',auth[_0x02f5('0x11')](),controller[_0x02f5('0x14')]);router['put'](_0x02f5('0xc'),auth[_0x02f5('0x11')](),controller['update']);router[_0x02f5('0x15')](_0x02f5('0xc'),auth['isAuthenticated'](),controller[_0x02f5('0x16')]);module[_0x02f5('0x17')]=router; \ No newline at end of file +var _0x3c2c=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3ee493,_0x590554){var _0x43e84a=function(_0x1326d2){while(--_0x1326d2){_0x3ee493['push'](_0x3ee493['shift']());}};_0x43e84a(++_0x590554);}(_0x3c2c,0xe5));var _0xc3c2=function(_0x25e7a0,_0x11b8fb){_0x25e7a0=_0x25e7a0-0x0;var _0x3d2c9a=_0x3c2c[_0x25e7a0];return _0x3d2c9a;};'use strict';var multer=require(_0xc3c2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc3c2('0x1'));var router=express[_0xc3c2('0x2')]();var fs_extra=require(_0xc3c2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc3c2('0x4'));var config=require(_0xc3c2('0x5'));var controller=require(_0xc3c2('0x6'));router['get']('/',auth[_0xc3c2('0x7')](),controller[_0xc3c2('0x8')]);router[_0xc3c2('0x9')](_0xc3c2('0xa'),auth[_0xc3c2('0x7')](),controller[_0xc3c2('0xb')]);router[_0xc3c2('0x9')](_0xc3c2('0xc'),auth['isAuthenticated'](),controller[_0xc3c2('0xd')]);router['get'](_0xc3c2('0xe'),auth[_0xc3c2('0x7')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xc3c2('0x7')](),controller[_0xc3c2('0xf')]);router[_0xc3c2('0x10')]('/',auth[_0xc3c2('0x7')](),controller[_0xc3c2('0x11')]);router[_0xc3c2('0x12')](_0xc3c2('0xa'),auth['isAuthenticated'](),controller[_0xc3c2('0x13')]);router[_0xc3c2('0x14')]('/:id',auth[_0xc3c2('0x7')](),controller[_0xc3c2('0x15')]);module[_0xc3c2('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 21c11cb..0d1395e 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9de=['sequelize','exports','STRING'];(function(_0x4133a8,_0x49e5ac){var _0x1d5bbe=function(_0x1fe016){while(--_0x1fe016){_0x4133a8['push'](_0x4133a8['shift']());}};_0x1d5bbe(++_0x49e5ac);}(_0xb9de,0x165));var _0xeb9d=function(_0x38cabe,_0x27361d){_0x38cabe=_0x38cabe-0x0;var _0x1990da=_0xb9de[_0x38cabe];return _0x1990da;};'use strict';var Sequelize=require(_0xeb9d('0x0'));module[_0xeb9d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeb9d('0x2')]}}; \ No newline at end of file +var _0x5332=['STRING','exports'];(function(_0x34ff00,_0x43ea29){var _0x19d141=function(_0x1f5d37){while(--_0x1f5d37){_0x34ff00['push'](_0x34ff00['shift']());}};_0x19d141(++_0x43ea29);}(_0x5332,0x10b));var _0x2533=function(_0x1e3f21,_0x35663a){_0x1e3f21=_0x1e3f21-0x0;var _0x412afe=_0x5332[_0x1e3f21];return _0x412afe;};'use strict';var Sequelize=require('sequelize');module[_0x2533('0x0')]={'name':{'type':Sequelize[_0x2533('0x1')]},'description':{'type':Sequelize[_0x2533('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 7d37ed1..3ed511d 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8612=['create','body','getFields','findOne','keys','ServicenowField','getSubjects','getDescriptions','eml-format','fast-json-patch','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','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','include','findAll','rows','params','find','catch'];(function(_0x49f20c,_0x2c2240){var _0x4736b8=function(_0x1e4c74){while(--_0x1e4c74){_0x49f20c['push'](_0x49f20c['shift']());}};_0x4736b8(++_0x2c2240);}(_0x8612,0x1a7));var _0x2861=function(_0x567685,_0x5b683c){_0x567685=_0x567685-0x0;var _0x41a5a8=_0x8612[_0x567685];return _0x41a5a8;};'use strict';var emlformat=require(_0x2861('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2861('0x1'));var rp=require(_0x2861('0x2'));var moment=require(_0x2861('0x3'));var BPromise=require(_0x2861('0x4'));var Mustache=require(_0x2861('0x5'));var util=require(_0x2861('0x6'));var path=require(_0x2861('0x7'));var sox=require(_0x2861('0x8'));var csv=require('to-csv');var ejs=require(_0x2861('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2861('0xa'));var crypto=require(_0x2861('0xb'));var jsforce=require(_0x2861('0xc'));var deskjs=require(_0x2861('0xd'));var toCsv=require(_0x2861('0xe'));var querystring=require(_0x2861('0xf'));var Papa=require(_0x2861('0x10'));var Redis=require(_0x2861('0x11'));var authService=require(_0x2861('0x12'));var qs=require(_0x2861('0x13'));var as=require(_0x2861('0x14'));var hardwareService=require(_0x2861('0x15'));var logger=require(_0x2861('0x16'))(_0x2861('0x17'));var utils=require(_0x2861('0x18'));var config=require(_0x2861('0x19'));var licenseUtil=require(_0x2861('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e6ede,_0x271b1d){_0x271b1d=_0x271b1d||0xcc;return function(_0x4635ec){if(_0x4635ec){return _0x2e6ede[_0x2861('0x1b')](_0x271b1d);}return _0x2e6ede[_0x2861('0x1c')](_0x271b1d)[_0x2861('0x1d')]();};}function respondWithResult(_0x53fe51,_0x5cee77){_0x5cee77=_0x5cee77||0xc8;return function(_0x585514){if(_0x585514){return _0x53fe51[_0x2861('0x1c')](_0x5cee77)[_0x2861('0x1e')](_0x585514);}};}function respondWithFilteredResult(_0x54193e,_0x11a69a){return function(_0x1777d6){if(_0x1777d6){var _0x3a2577=typeof _0x11a69a[_0x2861('0x1f')]===_0x2861('0x20')&&typeof _0x11a69a[_0x2861('0x21')]===_0x2861('0x20');var _0xf968f3=_0x1777d6['count'];var _0x129ec5=_0x3a2577?0x0:_0x11a69a['offset'];var _0x7a7081=_0x3a2577?_0x1777d6[_0x2861('0x22')]:_0x11a69a[_0x2861('0x1f')]+_0x11a69a[_0x2861('0x21')];var _0x217e7d;if(_0x7a7081>=_0xf968f3){_0x7a7081=_0xf968f3;_0x217e7d=0xc8;}else{_0x217e7d=0xce;}_0x54193e[_0x2861('0x1c')](_0x217e7d);return _0x54193e[_0x2861('0x23')](_0x2861('0x24'),_0x129ec5+'-'+_0x7a7081+'/'+_0xf968f3)[_0x2861('0x1e')](_0x1777d6);}return null;};}function patchUpdates(_0x30fa1e){return function(_0x181d3f){try{jsonpatch[_0x2861('0x25')](_0x181d3f,_0x30fa1e,!![]);}catch(_0x1e80ae){return BPromise[_0x2861('0x26')](_0x1e80ae);}return _0x181d3f[_0x2861('0x27')]();};}function saveUpdates(_0x5a7aa2,_0x3c4c5e){return function(_0x44909a){if(_0x44909a){return _0x44909a[_0x2861('0x28')](_0x5a7aa2)[_0x2861('0x29')](function(_0x14fbad){return _0x14fbad;});}return null;};}function removeEntity(_0x19681a,_0x4f705d){return function(_0x419adf){if(_0x419adf){return _0x419adf[_0x2861('0x2a')]()[_0x2861('0x29')](function(){_0x19681a['status'](0xcc)[_0x2861('0x1d')]();});}};}function handleEntityNotFound(_0xce59a,_0x51da45){return function(_0x3662bf){if(!_0x3662bf){_0xce59a[_0x2861('0x1b')](0x194);}return _0x3662bf;};}function handleError(_0x75b938,_0x4fa8f4){_0x4fa8f4=_0x4fa8f4||0x1f4;return function(_0x1160c6){logger['error'](_0x1160c6['stack']);if(_0x1160c6[_0x2861('0x2b')]){delete _0x1160c6[_0x2861('0x2b')];}_0x75b938[_0x2861('0x1c')](_0x4fa8f4)[_0x2861('0x2c')](_0x1160c6);};}exports[_0x2861('0x2d')]=function(_0x30c73e,_0x19e7a1){var _0x881abf={},_0x83da4b={},_0x5a733a={'count':0x0,'rows':[]};var _0xc90b68=_[_0x2861('0x2e')](db['ServicenowConfiguration'][_0x2861('0x2f')],function(_0xb7fbf){return{'name':_0xb7fbf[_0x2861('0x30')],'type':_0xb7fbf[_0x2861('0x31')]['key']};});_0x83da4b[_0x2861('0x32')]=_[_0x2861('0x2e')](_0xc90b68,'name');_0x83da4b['query']=_['keys'](_0x30c73e['query']);_0x83da4b[_0x2861('0x33')]=_[_0x2861('0x34')](_0x83da4b[_0x2861('0x32')],_0x83da4b[_0x2861('0x35')]);_0x881abf[_0x2861('0x36')]=_[_0x2861('0x34')](_0x83da4b[_0x2861('0x32')],qs[_0x2861('0x37')](_0x30c73e[_0x2861('0x35')][_0x2861('0x37')]));_0x881abf['attributes']=_0x881abf['attributes'][_0x2861('0x38')]?_0x881abf[_0x2861('0x36')]:_0x83da4b[_0x2861('0x32')];if(!_0x30c73e[_0x2861('0x35')][_0x2861('0x39')](_0x2861('0x3a'))){_0x881abf[_0x2861('0x21')]=qs[_0x2861('0x21')](_0x30c73e[_0x2861('0x35')][_0x2861('0x21')]);_0x881abf[_0x2861('0x1f')]=qs[_0x2861('0x1f')](_0x30c73e['query']['offset']);}_0x881abf[_0x2861('0x3b')]=qs[_0x2861('0x3c')](_0x30c73e['query'][_0x2861('0x3c')]);_0x881abf[_0x2861('0x3d')]=qs[_0x2861('0x33')](_[_0x2861('0x3e')](_0x30c73e['query'],_0x83da4b[_0x2861('0x33')]),_0xc90b68);if(_0x30c73e[_0x2861('0x35')][_0x2861('0x3f')]){_0x881abf[_0x2861('0x3d')]=_[_0x2861('0x40')](_0x881abf[_0x2861('0x3d')],{'$or':_[_0x2861('0x2e')](_0xc90b68,function(_0x3d7af4){if(_0x3d7af4[_0x2861('0x31')]!==_0x2861('0x41')){var _0x25fece={};_0x25fece[_0x3d7af4[_0x2861('0x2b')]]={'$like':'%'+_0x30c73e[_0x2861('0x35')][_0x2861('0x3f')]+'%'};return _0x25fece;}})});}_0x881abf=_[_0x2861('0x40')]({},_0x881abf,_0x30c73e[_0x2861('0x42')]);var _0x5bc026={'where':_0x881abf[_0x2861('0x3d')]};return db[_0x2861('0x43')][_0x2861('0x22')](_0x5bc026)[_0x2861('0x29')](function(_0x5af956){_0x5a733a[_0x2861('0x22')]=_0x5af956;if(_0x30c73e[_0x2861('0x35')][_0x2861('0x44')]){_0x881abf[_0x2861('0x45')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x2861('0x46')](_0x881abf);})[_0x2861('0x29')](function(_0x11854e){_0x5a733a[_0x2861('0x47')]=_0x11854e;return _0x5a733a;})[_0x2861('0x29')](respondWithFilteredResult(_0x19e7a1,_0x881abf))['catch'](handleError(_0x19e7a1,null));};exports['show']=function(_0xbffbdd,_0x91fb67){var _0x5a2879={'raw':![],'where':{'id':_0xbffbdd[_0x2861('0x48')]['id']}},_0x30e44e={};_0x30e44e['model']=_['keys'](db['ServicenowConfiguration'][_0x2861('0x2f')]);_0x30e44e[_0x2861('0x35')]=_['keys'](_0xbffbdd[_0x2861('0x35')]);_0x30e44e[_0x2861('0x33')]=_[_0x2861('0x34')](_0x30e44e['model'],_0x30e44e['query']);_0x5a2879[_0x2861('0x36')]=_[_0x2861('0x34')](_0x30e44e[_0x2861('0x32')],qs['fields'](_0xbffbdd[_0x2861('0x35')][_0x2861('0x37')]));_0x5a2879[_0x2861('0x36')]=_0x5a2879[_0x2861('0x36')][_0x2861('0x38')]?_0x5a2879[_0x2861('0x36')]:_0x30e44e[_0x2861('0x32')];if(_0xbffbdd[_0x2861('0x35')][_0x2861('0x44')]){_0x5a2879[_0x2861('0x45')]=[{'all':!![]}];}_0x5a2879=_[_0x2861('0x40')]({},_0x5a2879,_0xbffbdd[_0x2861('0x42')]);return db[_0x2861('0x43')][_0x2861('0x49')](_0x5a2879)['then'](handleEntityNotFound(_0x91fb67,null))[_0x2861('0x29')](respondWithResult(_0x91fb67,null))[_0x2861('0x4a')](handleError(_0x91fb67,null));};exports[_0x2861('0x4b')]=function(_0x4f412e,_0x273b45){return db['ServicenowConfiguration'][_0x2861('0x4b')](_0x4f412e[_0x2861('0x4c')],{})[_0x2861('0x29')](respondWithResult(_0x273b45,0xc9))[_0x2861('0x4a')](handleError(_0x273b45,null));};exports[_0x2861('0x28')]=function(_0x23f603,_0x3267c1){if(_0x23f603[_0x2861('0x4c')]['id']){delete _0x23f603[_0x2861('0x4c')]['id'];}return db['ServicenowConfiguration'][_0x2861('0x49')]({'where':{'id':_0x23f603[_0x2861('0x48')]['id']}})[_0x2861('0x29')](handleEntityNotFound(_0x3267c1,null))[_0x2861('0x29')](saveUpdates(_0x23f603[_0x2861('0x4c')],null))[_0x2861('0x29')](respondWithResult(_0x3267c1,null))[_0x2861('0x4a')](handleError(_0x3267c1,null));};exports[_0x2861('0x2a')]=function(_0x1d203e,_0x1c75e0){return db[_0x2861('0x43')]['find']({'where':{'id':_0x1d203e[_0x2861('0x48')]['id']}})[_0x2861('0x29')](handleEntityNotFound(_0x1c75e0,null))['then'](removeEntity(_0x1c75e0,null))[_0x2861('0x4a')](handleError(_0x1c75e0,null));};exports[_0x2861('0x4d')]=function(_0x3561f1,_0x60fcbf,_0x5e483a){var _0x488048={};var _0x6df3b1={};var _0x32989f;var _0x3c7a41;return db['ServicenowConfiguration'][_0x2861('0x4e')]({'where':{'id':_0x3561f1[_0x2861('0x48')]['id']}})[_0x2861('0x29')](handleEntityNotFound(_0x60fcbf,null))[_0x2861('0x29')](function(_0x186aea){if(_0x186aea){_0x32989f=_0x186aea;_0x6df3b1[_0x2861('0x32')]=_[_0x2861('0x4f')](db[_0x2861('0x50')][_0x2861('0x2f')]);_0x6df3b1['query']=_[_0x2861('0x4f')](_0x3561f1['query']);_0x6df3b1[_0x2861('0x33')]=_['intersection'](_0x6df3b1[_0x2861('0x32')],_0x6df3b1[_0x2861('0x35')]);_0x488048[_0x2861('0x36')]=_['intersection'](_0x6df3b1[_0x2861('0x32')],qs[_0x2861('0x37')](_0x3561f1['query'][_0x2861('0x37')]));_0x488048[_0x2861('0x36')]=_0x488048['attributes'][_0x2861('0x38')]?_0x488048[_0x2861('0x36')]:_0x6df3b1['model'];_0x488048['order']=qs['sort'](_0x3561f1['query'][_0x2861('0x3c')]);_0x488048[_0x2861('0x3d')]=qs['filters'](_[_0x2861('0x3e')](_0x3561f1['query'],_0x6df3b1['filters']));if(_0x3561f1[_0x2861('0x35')][_0x2861('0x3f')]){_0x488048[_0x2861('0x3d')]=_[_0x2861('0x40')](_0x488048[_0x2861('0x3d')],{'$or':_[_0x2861('0x2e')](_0x488048[_0x2861('0x36')],function(_0x8a497d){var _0x411327={};_0x411327[_0x8a497d]={'$like':'%'+_0x3561f1[_0x2861('0x35')][_0x2861('0x3f')]+'%'};return _0x411327;})});}_0x488048=_[_0x2861('0x40')]({},_0x488048,_0x3561f1['options']);return _0x32989f[_0x2861('0x4d')](_0x488048);}})['then'](function(_0x24b543){if(_0x24b543){_0x3c7a41=_0x24b543[_0x2861('0x38')];if(!_0x3561f1[_0x2861('0x35')][_0x2861('0x39')](_0x2861('0x3a'))){_0x488048[_0x2861('0x21')]=qs[_0x2861('0x21')](_0x3561f1[_0x2861('0x35')]['limit']);_0x488048[_0x2861('0x1f')]=qs['offset'](_0x3561f1[_0x2861('0x35')][_0x2861('0x1f')]);}return _0x32989f[_0x2861('0x4d')](_0x488048);}})[_0x2861('0x29')](function(_0x4733ac){if(_0x4733ac){return _0x4733ac?{'count':_0x3c7a41,'rows':_0x4733ac}:null;}})[_0x2861('0x29')](respondWithResult(_0x60fcbf,null))[_0x2861('0x4a')](handleError(_0x60fcbf,null));};exports[_0x2861('0x51')]=function(_0x332651,_0x223c32,_0x50a1b4){var _0x20ac73={};var _0x59d0a3={};var _0x85eee8;var _0x1a9074;return db['ServicenowConfiguration'][_0x2861('0x4e')]({'where':{'id':_0x332651[_0x2861('0x48')]['id']}})['then'](handleEntityNotFound(_0x223c32,null))['then'](function(_0x332202){if(_0x332202){_0x85eee8=_0x332202;_0x59d0a3[_0x2861('0x32')]=_[_0x2861('0x4f')](db[_0x2861('0x50')][_0x2861('0x2f')]);_0x59d0a3[_0x2861('0x35')]=_['keys'](_0x332651['query']);_0x59d0a3[_0x2861('0x33')]=_[_0x2861('0x34')](_0x59d0a3[_0x2861('0x32')],_0x59d0a3[_0x2861('0x35')]);_0x20ac73[_0x2861('0x36')]=_[_0x2861('0x34')](_0x59d0a3[_0x2861('0x32')],qs[_0x2861('0x37')](_0x332651['query'][_0x2861('0x37')]));_0x20ac73[_0x2861('0x36')]=_0x20ac73[_0x2861('0x36')][_0x2861('0x38')]?_0x20ac73['attributes']:_0x59d0a3[_0x2861('0x32')];_0x20ac73[_0x2861('0x3b')]=qs[_0x2861('0x3c')](_0x332651[_0x2861('0x35')][_0x2861('0x3c')]);_0x20ac73[_0x2861('0x3d')]=qs['filters'](_[_0x2861('0x3e')](_0x332651['query'],_0x59d0a3['filters']));if(_0x332651[_0x2861('0x35')][_0x2861('0x3f')]){_0x20ac73[_0x2861('0x3d')]=_[_0x2861('0x40')](_0x20ac73['where'],{'$or':_[_0x2861('0x2e')](_0x20ac73[_0x2861('0x36')],function(_0x373776){var _0x2e7694={};_0x2e7694[_0x373776]={'$like':'%'+_0x332651['query'][_0x2861('0x3f')]+'%'};return _0x2e7694;})});}_0x20ac73=_[_0x2861('0x40')]({},_0x20ac73,_0x332651['options']);return _0x85eee8[_0x2861('0x51')](_0x20ac73);}})['then'](function(_0x59caa3){if(_0x59caa3){_0x1a9074=_0x59caa3[_0x2861('0x38')];if(!_0x332651[_0x2861('0x35')]['hasOwnProperty'](_0x2861('0x3a'))){_0x20ac73['limit']=qs[_0x2861('0x21')](_0x332651[_0x2861('0x35')][_0x2861('0x21')]);_0x20ac73['offset']=qs['offset'](_0x332651[_0x2861('0x35')][_0x2861('0x1f')]);}return _0x85eee8[_0x2861('0x51')](_0x20ac73);}})['then'](function(_0x10c774){if(_0x10c774){return _0x10c774?{'count':_0x1a9074,'rows':_0x10c774}:null;}})[_0x2861('0x29')](respondWithResult(_0x223c32,null))['catch'](handleError(_0x223c32,null));};exports['getDescriptions']=function(_0x3b97e4,_0x305de2,_0x4aacfa){var _0x141d59={};var _0x2af060={};var _0x1f4086;var _0x5b222a;return db['ServicenowConfiguration'][_0x2861('0x4e')]({'where':{'id':_0x3b97e4[_0x2861('0x48')]['id']}})['then'](handleEntityNotFound(_0x305de2,null))[_0x2861('0x29')](function(_0x811d95){if(_0x811d95){_0x1f4086=_0x811d95;_0x2af060[_0x2861('0x32')]=_[_0x2861('0x4f')](db[_0x2861('0x50')][_0x2861('0x2f')]);_0x2af060[_0x2861('0x35')]=_[_0x2861('0x4f')](_0x3b97e4[_0x2861('0x35')]);_0x2af060[_0x2861('0x33')]=_[_0x2861('0x34')](_0x2af060[_0x2861('0x32')],_0x2af060[_0x2861('0x35')]);_0x141d59[_0x2861('0x36')]=_['intersection'](_0x2af060['model'],qs[_0x2861('0x37')](_0x3b97e4[_0x2861('0x35')]['fields']));_0x141d59[_0x2861('0x36')]=_0x141d59[_0x2861('0x36')][_0x2861('0x38')]?_0x141d59['attributes']:_0x2af060['model'];_0x141d59[_0x2861('0x3b')]=qs['sort'](_0x3b97e4['query'][_0x2861('0x3c')]);_0x141d59['where']=qs[_0x2861('0x33')](_['pick'](_0x3b97e4['query'],_0x2af060[_0x2861('0x33')]));if(_0x3b97e4[_0x2861('0x35')][_0x2861('0x3f')]){_0x141d59[_0x2861('0x3d')]=_[_0x2861('0x40')](_0x141d59[_0x2861('0x3d')],{'$or':_[_0x2861('0x2e')](_0x141d59['attributes'],function(_0x44c51b){var _0x69234={};_0x69234[_0x44c51b]={'$like':'%'+_0x3b97e4[_0x2861('0x35')][_0x2861('0x3f')]+'%'};return _0x69234;})});}_0x141d59=_[_0x2861('0x40')]({},_0x141d59,_0x3b97e4[_0x2861('0x42')]);return _0x1f4086['getDescriptions'](_0x141d59);}})[_0x2861('0x29')](function(_0x3767b3){if(_0x3767b3){_0x5b222a=_0x3767b3[_0x2861('0x38')];if(!_0x3b97e4[_0x2861('0x35')][_0x2861('0x39')]('nolimit')){_0x141d59[_0x2861('0x21')]=qs['limit'](_0x3b97e4[_0x2861('0x35')][_0x2861('0x21')]);_0x141d59[_0x2861('0x1f')]=qs[_0x2861('0x1f')](_0x3b97e4[_0x2861('0x35')][_0x2861('0x1f')]);}return _0x1f4086[_0x2861('0x52')](_0x141d59);}})[_0x2861('0x29')](function(_0x537ef0){if(_0x537ef0){return _0x537ef0?{'count':_0x5b222a,'rows':_0x537ef0}:null;}})[_0x2861('0x29')](respondWithResult(_0x305de2,null))['catch'](handleError(_0x305de2,null));}; \ No newline at end of file +var _0xe9f5=['index','ServicenowConfiguration','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','params','rawAttributes','length','find','catch','create','body','destroy','getFields','findOne','ServicenowField','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x51e959,_0xab1417){var _0x4a77bd=function(_0x16049a){while(--_0x16049a){_0x51e959['push'](_0x51e959['shift']());}};_0x4a77bd(++_0xab1417);}(_0xe9f5,0x1b5));var _0x5e9f=function(_0x43c760,_0x5a0bf4){_0x43c760=_0x43c760-0x0;var _0x16a911=_0xe9f5[_0x43c760];return _0x16a911;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e9f('0x0'));var zipdir=require(_0x5e9f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e9f('0x2'));var moment=require(_0x5e9f('0x3'));var BPromise=require(_0x5e9f('0x4'));var Mustache=require(_0x5e9f('0x5'));var util=require(_0x5e9f('0x6'));var path=require('path');var sox=require(_0x5e9f('0x7'));var csv=require('to-csv');var ejs=require(_0x5e9f('0x8'));var fs=require('fs');var fs_extra=require(_0x5e9f('0x9'));var _=require('lodash');var squel=require(_0x5e9f('0xa'));var crypto=require(_0x5e9f('0xb'));var jsforce=require(_0x5e9f('0xc'));var deskjs=require(_0x5e9f('0xd'));var toCsv=require(_0x5e9f('0xe'));var querystring=require(_0x5e9f('0xf'));var Papa=require('papaparse');var Redis=require(_0x5e9f('0x10'));var authService=require(_0x5e9f('0x11'));var qs=require(_0x5e9f('0x12'));var as=require(_0x5e9f('0x13'));var hardwareService=require(_0x5e9f('0x14'));var logger=require(_0x5e9f('0x15'))(_0x5e9f('0x16'));var utils=require('../../config/utils');var config=require(_0x5e9f('0x17'));var licenseUtil=require(_0x5e9f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554fde,_0x179563){_0x179563=_0x179563||0xcc;return function(_0x388ae8){if(_0x388ae8){return _0x554fde[_0x5e9f('0x19')](_0x179563);}return _0x554fde[_0x5e9f('0x1a')](_0x179563)[_0x5e9f('0x1b')]();};}function respondWithResult(_0x212169,_0x47d516){_0x47d516=_0x47d516||0xc8;return function(_0x2ec75c){if(_0x2ec75c){return _0x212169[_0x5e9f('0x1a')](_0x47d516)[_0x5e9f('0x1c')](_0x2ec75c);}};}function respondWithFilteredResult(_0x1a328a,_0x4ac801){return function(_0x4dbb3d){if(_0x4dbb3d){var _0x19cb5a=typeof _0x4ac801['offset']==='undefined'&&typeof _0x4ac801[_0x5e9f('0x1d')]===_0x5e9f('0x1e');var _0x151637=_0x4dbb3d[_0x5e9f('0x1f')];var _0x1df6d8=_0x19cb5a?0x0:_0x4ac801[_0x5e9f('0x20')];var _0x490671=_0x19cb5a?_0x4dbb3d[_0x5e9f('0x1f')]:_0x4ac801[_0x5e9f('0x20')]+_0x4ac801[_0x5e9f('0x1d')];var _0x3891e0;if(_0x490671>=_0x151637){_0x490671=_0x151637;_0x3891e0=0xc8;}else{_0x3891e0=0xce;}_0x1a328a[_0x5e9f('0x1a')](_0x3891e0);return _0x1a328a[_0x5e9f('0x21')](_0x5e9f('0x22'),_0x1df6d8+'-'+_0x490671+'/'+_0x151637)[_0x5e9f('0x1c')](_0x4dbb3d);}return null;};}function patchUpdates(_0x392f70){return function(_0x10d7d5){try{jsonpatch[_0x5e9f('0x23')](_0x10d7d5,_0x392f70,!![]);}catch(_0xb0d59f){return BPromise[_0x5e9f('0x24')](_0xb0d59f);}return _0x10d7d5[_0x5e9f('0x25')]();};}function saveUpdates(_0x20c8db,_0x44a5ae){return function(_0x3410cd){if(_0x3410cd){return _0x3410cd[_0x5e9f('0x26')](_0x20c8db)[_0x5e9f('0x27')](function(_0x40cc48){return _0x40cc48;});}return null;};}function removeEntity(_0x466a1a,_0x1b44e1){return function(_0x300187){if(_0x300187){return _0x300187['destroy']()[_0x5e9f('0x27')](function(){_0x466a1a[_0x5e9f('0x1a')](0xcc)[_0x5e9f('0x1b')]();});}};}function handleEntityNotFound(_0xe210aa,_0x3f0b09){return function(_0x5dabed){if(!_0x5dabed){_0xe210aa['sendStatus'](0x194);}return _0x5dabed;};}function handleError(_0x22eebf,_0x1c699b){_0x1c699b=_0x1c699b||0x1f4;return function(_0x481dae){logger[_0x5e9f('0x28')](_0x481dae['stack']);if(_0x481dae['name']){delete _0x481dae[_0x5e9f('0x29')];}_0x22eebf[_0x5e9f('0x1a')](_0x1c699b)[_0x5e9f('0x2a')](_0x481dae);};}exports[_0x5e9f('0x2b')]=function(_0x5937dc,_0x55776f){var _0x4dad30={},_0x447826={},_0x475b93={'count':0x0,'rows':[]};var _0x42eadc=_['map'](db[_0x5e9f('0x2c')]['rawAttributes'],function(_0x199f77){return{'name':_0x199f77[_0x5e9f('0x2d')],'type':_0x199f77[_0x5e9f('0x2e')]['key']};});_0x447826[_0x5e9f('0x2f')]=_[_0x5e9f('0x30')](_0x42eadc,_0x5e9f('0x29'));_0x447826['query']=_[_0x5e9f('0x31')](_0x5937dc[_0x5e9f('0x32')]);_0x447826[_0x5e9f('0x33')]=_[_0x5e9f('0x34')](_0x447826[_0x5e9f('0x2f')],_0x447826[_0x5e9f('0x32')]);_0x4dad30[_0x5e9f('0x35')]=_[_0x5e9f('0x34')](_0x447826['model'],qs['fields'](_0x5937dc[_0x5e9f('0x32')][_0x5e9f('0x36')]));_0x4dad30['attributes']=_0x4dad30[_0x5e9f('0x35')]['length']?_0x4dad30[_0x5e9f('0x35')]:_0x447826[_0x5e9f('0x2f')];if(!_0x5937dc[_0x5e9f('0x32')][_0x5e9f('0x37')](_0x5e9f('0x38'))){_0x4dad30[_0x5e9f('0x1d')]=qs[_0x5e9f('0x1d')](_0x5937dc[_0x5e9f('0x32')]['limit']);_0x4dad30[_0x5e9f('0x20')]=qs[_0x5e9f('0x20')](_0x5937dc['query'][_0x5e9f('0x20')]);}_0x4dad30[_0x5e9f('0x39')]=qs[_0x5e9f('0x3a')](_0x5937dc[_0x5e9f('0x32')][_0x5e9f('0x3a')]);_0x4dad30['where']=qs[_0x5e9f('0x33')](_[_0x5e9f('0x3b')](_0x5937dc['query'],_0x447826[_0x5e9f('0x33')]),_0x42eadc);if(_0x5937dc['query'][_0x5e9f('0x3c')]){_0x4dad30[_0x5e9f('0x3d')]=_[_0x5e9f('0x3e')](_0x4dad30[_0x5e9f('0x3d')],{'$or':_['map'](_0x42eadc,function(_0x209f4c){if(_0x209f4c['type']!=='VIRTUAL'){var _0x1bdb94={};_0x1bdb94[_0x209f4c[_0x5e9f('0x29')]]={'$like':'%'+_0x5937dc['query'][_0x5e9f('0x3c')]+'%'};return _0x1bdb94;}})});}_0x4dad30=_['merge']({},_0x4dad30,_0x5937dc[_0x5e9f('0x3f')]);var _0x4f1e92={'where':_0x4dad30[_0x5e9f('0x3d')]};return db[_0x5e9f('0x2c')][_0x5e9f('0x1f')](_0x4f1e92)['then'](function(_0x5c4e75){_0x475b93[_0x5e9f('0x1f')]=_0x5c4e75;if(_0x5937dc[_0x5e9f('0x32')][_0x5e9f('0x40')]){_0x4dad30['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x5e9f('0x41')](_0x4dad30);})[_0x5e9f('0x27')](function(_0x319a34){_0x475b93[_0x5e9f('0x42')]=_0x319a34;return _0x475b93;})[_0x5e9f('0x27')](respondWithFilteredResult(_0x55776f,_0x4dad30))['catch'](handleError(_0x55776f,null));};exports['show']=function(_0x3aea31,_0x3c55c1){var _0x10ccb4={'raw':![],'where':{'id':_0x3aea31[_0x5e9f('0x43')]['id']}},_0x5a0747={};_0x5a0747[_0x5e9f('0x2f')]=_['keys'](db[_0x5e9f('0x2c')][_0x5e9f('0x44')]);_0x5a0747[_0x5e9f('0x32')]=_[_0x5e9f('0x31')](_0x3aea31[_0x5e9f('0x32')]);_0x5a0747['filters']=_['intersection'](_0x5a0747[_0x5e9f('0x2f')],_0x5a0747[_0x5e9f('0x32')]);_0x10ccb4['attributes']=_['intersection'](_0x5a0747[_0x5e9f('0x2f')],qs[_0x5e9f('0x36')](_0x3aea31[_0x5e9f('0x32')][_0x5e9f('0x36')]));_0x10ccb4[_0x5e9f('0x35')]=_0x10ccb4[_0x5e9f('0x35')][_0x5e9f('0x45')]?_0x10ccb4[_0x5e9f('0x35')]:_0x5a0747[_0x5e9f('0x2f')];if(_0x3aea31[_0x5e9f('0x32')][_0x5e9f('0x40')]){_0x10ccb4['include']=[{'all':!![]}];}_0x10ccb4=_[_0x5e9f('0x3e')]({},_0x10ccb4,_0x3aea31[_0x5e9f('0x3f')]);return db[_0x5e9f('0x2c')][_0x5e9f('0x46')](_0x10ccb4)[_0x5e9f('0x27')](handleEntityNotFound(_0x3c55c1,null))[_0x5e9f('0x27')](respondWithResult(_0x3c55c1,null))[_0x5e9f('0x47')](handleError(_0x3c55c1,null));};exports['create']=function(_0x3754f4,_0x3cd43e){return db[_0x5e9f('0x2c')][_0x5e9f('0x48')](_0x3754f4[_0x5e9f('0x49')],{})[_0x5e9f('0x27')](respondWithResult(_0x3cd43e,0xc9))[_0x5e9f('0x47')](handleError(_0x3cd43e,null));};exports[_0x5e9f('0x26')]=function(_0x4235b7,_0x808955){if(_0x4235b7[_0x5e9f('0x49')]['id']){delete _0x4235b7[_0x5e9f('0x49')]['id'];}return db[_0x5e9f('0x2c')][_0x5e9f('0x46')]({'where':{'id':_0x4235b7[_0x5e9f('0x43')]['id']}})[_0x5e9f('0x27')](handleEntityNotFound(_0x808955,null))[_0x5e9f('0x27')](saveUpdates(_0x4235b7['body'],null))[_0x5e9f('0x27')](respondWithResult(_0x808955,null))[_0x5e9f('0x47')](handleError(_0x808955,null));};exports[_0x5e9f('0x4a')]=function(_0x1dd22b,_0x2407c9){return db[_0x5e9f('0x2c')][_0x5e9f('0x46')]({'where':{'id':_0x1dd22b[_0x5e9f('0x43')]['id']}})[_0x5e9f('0x27')](handleEntityNotFound(_0x2407c9,null))[_0x5e9f('0x27')](removeEntity(_0x2407c9,null))[_0x5e9f('0x47')](handleError(_0x2407c9,null));};exports[_0x5e9f('0x4b')]=function(_0x48204b,_0x6a2dfb,_0x44c509){var _0x1520a1={};var _0x3a7934={};var _0x152e53;var _0x1902ca;return db[_0x5e9f('0x2c')][_0x5e9f('0x4c')]({'where':{'id':_0x48204b['params']['id']}})[_0x5e9f('0x27')](handleEntityNotFound(_0x6a2dfb,null))[_0x5e9f('0x27')](function(_0x5927ae){if(_0x5927ae){_0x152e53=_0x5927ae;_0x3a7934[_0x5e9f('0x2f')]=_[_0x5e9f('0x31')](db[_0x5e9f('0x4d')][_0x5e9f('0x44')]);_0x3a7934['query']=_[_0x5e9f('0x31')](_0x48204b[_0x5e9f('0x32')]);_0x3a7934[_0x5e9f('0x33')]=_[_0x5e9f('0x34')](_0x3a7934[_0x5e9f('0x2f')],_0x3a7934[_0x5e9f('0x32')]);_0x1520a1[_0x5e9f('0x35')]=_[_0x5e9f('0x34')](_0x3a7934[_0x5e9f('0x2f')],qs['fields'](_0x48204b['query'][_0x5e9f('0x36')]));_0x1520a1[_0x5e9f('0x35')]=_0x1520a1[_0x5e9f('0x35')][_0x5e9f('0x45')]?_0x1520a1[_0x5e9f('0x35')]:_0x3a7934['model'];_0x1520a1[_0x5e9f('0x39')]=qs['sort'](_0x48204b[_0x5e9f('0x32')][_0x5e9f('0x3a')]);_0x1520a1[_0x5e9f('0x3d')]=qs['filters'](_['pick'](_0x48204b[_0x5e9f('0x32')],_0x3a7934[_0x5e9f('0x33')]));if(_0x48204b[_0x5e9f('0x32')][_0x5e9f('0x3c')]){_0x1520a1[_0x5e9f('0x3d')]=_[_0x5e9f('0x3e')](_0x1520a1['where'],{'$or':_[_0x5e9f('0x30')](_0x1520a1[_0x5e9f('0x35')],function(_0x9d5fb6){var _0x2e067b={};_0x2e067b[_0x9d5fb6]={'$like':'%'+_0x48204b[_0x5e9f('0x32')]['filter']+'%'};return _0x2e067b;})});}_0x1520a1=_[_0x5e9f('0x3e')]({},_0x1520a1,_0x48204b[_0x5e9f('0x3f')]);return _0x152e53[_0x5e9f('0x4b')](_0x1520a1);}})[_0x5e9f('0x27')](function(_0x12096d){if(_0x12096d){_0x1902ca=_0x12096d['length'];if(!_0x48204b[_0x5e9f('0x32')][_0x5e9f('0x37')](_0x5e9f('0x38'))){_0x1520a1['limit']=qs['limit'](_0x48204b['query']['limit']);_0x1520a1[_0x5e9f('0x20')]=qs[_0x5e9f('0x20')](_0x48204b[_0x5e9f('0x32')][_0x5e9f('0x20')]);}return _0x152e53['getFields'](_0x1520a1);}})['then'](function(_0x3b2c6a){if(_0x3b2c6a){return _0x3b2c6a?{'count':_0x1902ca,'rows':_0x3b2c6a}:null;}})[_0x5e9f('0x27')](respondWithResult(_0x6a2dfb,null))[_0x5e9f('0x47')](handleError(_0x6a2dfb,null));};exports['getSubjects']=function(_0x4f5fe1,_0x5cfef1,_0x3fa4e8){var _0x3e28d6={};var _0x4419f0={};var _0x4c1c1f;var _0x3a1de9;return db['ServicenowConfiguration'][_0x5e9f('0x4c')]({'where':{'id':_0x4f5fe1[_0x5e9f('0x43')]['id']}})[_0x5e9f('0x27')](handleEntityNotFound(_0x5cfef1,null))[_0x5e9f('0x27')](function(_0x2ea1d7){if(_0x2ea1d7){_0x4c1c1f=_0x2ea1d7;_0x4419f0['model']=_[_0x5e9f('0x31')](db[_0x5e9f('0x4d')][_0x5e9f('0x44')]);_0x4419f0[_0x5e9f('0x32')]=_[_0x5e9f('0x31')](_0x4f5fe1[_0x5e9f('0x32')]);_0x4419f0['filters']=_['intersection'](_0x4419f0[_0x5e9f('0x2f')],_0x4419f0[_0x5e9f('0x32')]);_0x3e28d6[_0x5e9f('0x35')]=_['intersection'](_0x4419f0['model'],qs['fields'](_0x4f5fe1[_0x5e9f('0x32')]['fields']));_0x3e28d6['attributes']=_0x3e28d6[_0x5e9f('0x35')]['length']?_0x3e28d6['attributes']:_0x4419f0[_0x5e9f('0x2f')];_0x3e28d6[_0x5e9f('0x39')]=qs[_0x5e9f('0x3a')](_0x4f5fe1[_0x5e9f('0x32')][_0x5e9f('0x3a')]);_0x3e28d6[_0x5e9f('0x3d')]=qs[_0x5e9f('0x33')](_[_0x5e9f('0x3b')](_0x4f5fe1[_0x5e9f('0x32')],_0x4419f0['filters']));if(_0x4f5fe1[_0x5e9f('0x32')][_0x5e9f('0x3c')]){_0x3e28d6[_0x5e9f('0x3d')]=_[_0x5e9f('0x3e')](_0x3e28d6[_0x5e9f('0x3d')],{'$or':_['map'](_0x3e28d6[_0x5e9f('0x35')],function(_0x396d88){var _0x47abd7={};_0x47abd7[_0x396d88]={'$like':'%'+_0x4f5fe1[_0x5e9f('0x32')]['filter']+'%'};return _0x47abd7;})});}_0x3e28d6=_[_0x5e9f('0x3e')]({},_0x3e28d6,_0x4f5fe1[_0x5e9f('0x3f')]);return _0x4c1c1f['getSubjects'](_0x3e28d6);}})[_0x5e9f('0x27')](function(_0x3e9571){if(_0x3e9571){_0x3a1de9=_0x3e9571[_0x5e9f('0x45')];if(!_0x4f5fe1['query'][_0x5e9f('0x37')](_0x5e9f('0x38'))){_0x3e28d6[_0x5e9f('0x1d')]=qs[_0x5e9f('0x1d')](_0x4f5fe1[_0x5e9f('0x32')][_0x5e9f('0x1d')]);_0x3e28d6[_0x5e9f('0x20')]=qs['offset'](_0x4f5fe1['query'][_0x5e9f('0x20')]);}return _0x4c1c1f[_0x5e9f('0x4e')](_0x3e28d6);}})[_0x5e9f('0x27')](function(_0x30d57c){if(_0x30d57c){return _0x30d57c?{'count':_0x3a1de9,'rows':_0x30d57c}:null;}})[_0x5e9f('0x27')](respondWithResult(_0x5cfef1,null))[_0x5e9f('0x47')](handleError(_0x5cfef1,null));};exports[_0x5e9f('0x4f')]=function(_0x372e87,_0x30024f,_0x32f7e4){var _0x598844={};var _0x417bc0={};var _0x18134b;var _0x321b79;return db[_0x5e9f('0x2c')]['findOne']({'where':{'id':_0x372e87['params']['id']}})[_0x5e9f('0x27')](handleEntityNotFound(_0x30024f,null))[_0x5e9f('0x27')](function(_0x1c6a4d){if(_0x1c6a4d){_0x18134b=_0x1c6a4d;_0x417bc0['model']=_['keys'](db[_0x5e9f('0x4d')][_0x5e9f('0x44')]);_0x417bc0[_0x5e9f('0x32')]=_[_0x5e9f('0x31')](_0x372e87[_0x5e9f('0x32')]);_0x417bc0[_0x5e9f('0x33')]=_[_0x5e9f('0x34')](_0x417bc0['model'],_0x417bc0[_0x5e9f('0x32')]);_0x598844[_0x5e9f('0x35')]=_[_0x5e9f('0x34')](_0x417bc0[_0x5e9f('0x2f')],qs[_0x5e9f('0x36')](_0x372e87[_0x5e9f('0x32')][_0x5e9f('0x36')]));_0x598844[_0x5e9f('0x35')]=_0x598844[_0x5e9f('0x35')][_0x5e9f('0x45')]?_0x598844[_0x5e9f('0x35')]:_0x417bc0['model'];_0x598844['order']=qs['sort'](_0x372e87[_0x5e9f('0x32')]['sort']);_0x598844[_0x5e9f('0x3d')]=qs[_0x5e9f('0x33')](_[_0x5e9f('0x3b')](_0x372e87[_0x5e9f('0x32')],_0x417bc0[_0x5e9f('0x33')]));if(_0x372e87[_0x5e9f('0x32')][_0x5e9f('0x3c')]){_0x598844[_0x5e9f('0x3d')]=_[_0x5e9f('0x3e')](_0x598844[_0x5e9f('0x3d')],{'$or':_[_0x5e9f('0x30')](_0x598844['attributes'],function(_0x2118ab){var _0x50a5ec={};_0x50a5ec[_0x2118ab]={'$like':'%'+_0x372e87['query'][_0x5e9f('0x3c')]+'%'};return _0x50a5ec;})});}_0x598844=_[_0x5e9f('0x3e')]({},_0x598844,_0x372e87[_0x5e9f('0x3f')]);return _0x18134b[_0x5e9f('0x4f')](_0x598844);}})[_0x5e9f('0x27')](function(_0x241371){if(_0x241371){_0x321b79=_0x241371['length'];if(!_0x372e87[_0x5e9f('0x32')][_0x5e9f('0x37')]('nolimit')){_0x598844[_0x5e9f('0x1d')]=qs[_0x5e9f('0x1d')](_0x372e87[_0x5e9f('0x32')][_0x5e9f('0x1d')]);_0x598844[_0x5e9f('0x20')]=qs[_0x5e9f('0x20')](_0x372e87[_0x5e9f('0x32')]['offset']);}return _0x18134b['getDescriptions'](_0x598844);}})[_0x5e9f('0x27')](function(_0x122315){if(_0x122315){return _0x122315?{'count':_0x321b79,'rows':_0x122315}:null;}})[_0x5e9f('0x27')](respondWithResult(_0x30024f,null))[_0x5e9f('0x47')](handleError(_0x30024f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index c0d6692..4ddbe04 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x087b=['../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','moment','request-promise','path','rimraf'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x087b,0x11a));var _0xb087=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x087b[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb087('0x2'));var BPromise=require('bluebird');var rp=require(_0xb087('0x3'));var fs=require('fs');var path=require(_0xb087('0x4'));var rimraf=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var attributes=require(_0xb087('0x7'));module[_0xb087('0x8')]=function(_0x40156d,_0x17d6e8){return _0x40156d[_0xb087('0x9')](_0xb087('0xa'),attributes,{'tableName':_0xb087('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ca7=['exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','rimraf','./intServicenowConfiguration.attributes'];(function(_0x59336c,_0x256068){var _0x8204ca=function(_0x583f02){while(--_0x583f02){_0x59336c['push'](_0x59336c['shift']());}};_0x8204ca(++_0x256068);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x4f16ab,_0xd03883){_0x4f16ab=_0x4f16ab-0x0;var _0xd338d6=_0x4ca7[_0x4f16ab];return _0xd338d6;};'use strict';var _=require(_0x74ca('0x0'));var util=require(_0x74ca('0x1'));var logger=require(_0x74ca('0x2'))('api');var moment=require(_0x74ca('0x3'));var BPromise=require(_0x74ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x74ca('0x5'));var config=require('../../config/environment');var attributes=require(_0x74ca('0x6'));module[_0x74ca('0x7')]=function(_0x4bccc5,_0x352e08){return _0x4bccc5['define'](_0x74ca('0x8'),attributes,{'tableName':_0x74ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 10af0c8..caab75b 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d43=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','debug','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0x6d43,0xe8));var _0x36d4=function(_0x5e58b4,_0x84cca0){_0x5e58b4=_0x5e58b4-0x0;var _0x5a52f5=_0x6d43[_0x5e58b4];return _0x5a52f5;};'use strict';var _=require(_0x36d4('0x0'));var util=require(_0x36d4('0x1'));var moment=require(_0x36d4('0x2'));var BPromise=require(_0x36d4('0x3'));var rs=require(_0x36d4('0x4'));var fs=require('fs');var Redis=require(_0x36d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x36d4('0x6'));var logger=require(_0x36d4('0x7'))(_0x36d4('0x8'));var config=require(_0x36d4('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x36d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cddf4,_0x46ce01,_0x90b740){return new BPromise(function(_0x58c485,_0x2d3479){return client[_0x36d4('0xb')](_0x5cddf4,_0x90b740)[_0x36d4('0xc')](function(_0x2b8507){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x46ce01,'request\x20sent');logger[_0x36d4('0xd')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x46ce01,'request\x20sent',JSON[_0x36d4('0xe')](_0x2b8507));if(_0x2b8507[_0x36d4('0xf')]){if(_0x2b8507[_0x36d4('0xf')]['code']===0x1f4){logger[_0x36d4('0xf')](_0x36d4('0x10'),_0x46ce01,_0x2b8507[_0x36d4('0xf')][_0x36d4('0x11')]);return _0x2d3479(_0x2b8507[_0x36d4('0xf')][_0x36d4('0x11')]);}logger[_0x36d4('0xf')](_0x36d4('0x10'),_0x46ce01,_0x2b8507[_0x36d4('0xf')]['message']);return _0x58c485(_0x2b8507['error'][_0x36d4('0x11')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x46ce01,_0x36d4('0x12'));_0x58c485(_0x2b8507[_0x36d4('0x13')][_0x36d4('0x11')]);}})[_0x36d4('0x14')](function(_0x4ebebb){logger[_0x36d4('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x46ce01,_0x4ebebb);_0x2d3479(_0x4ebebb);});});} \ No newline at end of file +var _0x2a8e=['debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x2245c7,_0x47951d){var _0x267daa=function(_0x21db85){while(--_0x21db85){_0x2245c7['push'](_0x2245c7['shift']());}};_0x267daa(++_0x47951d);}(_0x2a8e,0x132));var _0xe2a8=function(_0x556082,_0x52e510){_0x556082=_0x556082-0x0;var _0x9db1ae=_0x2a8e[_0x556082];return _0x9db1ae;};'use strict';var _=require(_0xe2a8('0x0'));var util=require('util');var moment=require(_0xe2a8('0x1'));var BPromise=require(_0xe2a8('0x2'));var rs=require(_0xe2a8('0x3'));var fs=require('fs');var Redis=require(_0xe2a8('0x4'));var db=require(_0xe2a8('0x5'))['db'];var utils=require(_0xe2a8('0x6'));var logger=require(_0xe2a8('0x7'))(_0xe2a8('0x8'));var config=require(_0xe2a8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe2a8('0xa')][_0xe2a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36c030,_0x1365b1,_0x92ce3c){return new BPromise(function(_0x125f11,_0x3e7346){return client[_0xe2a8('0xc')](_0x36c030,_0x92ce3c)['then'](function(_0x413f48){logger[_0xe2a8('0xd')](_0xe2a8('0xe'),_0x1365b1,_0xe2a8('0xf'));logger[_0xe2a8('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x1365b1,_0xe2a8('0xf'),JSON[_0xe2a8('0x11')](_0x413f48));if(_0x413f48[_0xe2a8('0x12')]){if(_0x413f48[_0xe2a8('0x12')][_0xe2a8('0x13')]===0x1f4){logger[_0xe2a8('0x12')](_0xe2a8('0xe'),_0x1365b1,_0x413f48['error'][_0xe2a8('0x14')]);return _0x3e7346(_0x413f48[_0xe2a8('0x12')][_0xe2a8('0x14')]);}logger[_0xe2a8('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1365b1,_0x413f48[_0xe2a8('0x12')]['message']);return _0x125f11(_0x413f48[_0xe2a8('0x12')][_0xe2a8('0x14')]);}else{logger[_0xe2a8('0xd')](_0xe2a8('0xe'),_0x1365b1,_0xe2a8('0xf'));_0x125f11(_0x413f48[_0xe2a8('0x15')]['message']);}})[_0xe2a8('0x16')](function(_0x32e336){logger['error'](_0xe2a8('0xe'),_0x1365b1,_0x32e336);_0x3e7346(_0x32e336);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index c6f106f..4118612 100644 --- a/server/api/intServicenowField/index.js +++ b/server/api/intServicenowField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f4e=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x49f509,_0x5c7395){var _0x1250d2=function(_0x3d5cec){while(--_0x3d5cec){_0x49f509['push'](_0x49f509['shift']());}};_0x1250d2(++_0x5c7395);}(_0x1f4e,0x19b));var _0xe1f4=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0x1f4e[_0x3ef45e];return _0x69e7c;};'use strict';var multer=require(_0xe1f4('0x0'));var util=require(_0xe1f4('0x1'));var path=require('path');var timeout=require(_0xe1f4('0x2'));var express=require(_0xe1f4('0x3'));var router=express[_0xe1f4('0x4')]();var fs_extra=require(_0xe1f4('0x5'));var auth=require(_0xe1f4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe1f4('0x7'));var controller=require('./intServicenowField.controller');router[_0xe1f4('0x8')]('/',auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xa')]);router[_0xe1f4('0x8')]('/:id',auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xb')]);router['post']('/',auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xc')]);router[_0xe1f4('0xd')](_0xe1f4('0xe'),auth[_0xe1f4('0x9')](),controller['update']);router[_0xe1f4('0xf')]('/:id',auth[_0xe1f4('0x9')](),controller[_0xe1f4('0x10')]);module[_0xe1f4('0x11')]=router; \ No newline at end of file +var _0x10f0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x10f0,0xff));var _0x010f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x10f0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x010f('0x0'));var util=require(_0x010f('0x1'));var path=require('path');var timeout=require(_0x010f('0x2'));var express=require(_0x010f('0x3'));var router=express[_0x010f('0x4')]();var fs_extra=require(_0x010f('0x5'));var auth=require(_0x010f('0x6'));var interaction=require(_0x010f('0x7'));var config=require(_0x010f('0x8'));var controller=require(_0x010f('0x9'));router[_0x010f('0xa')]('/',auth[_0x010f('0xb')](),controller[_0x010f('0xc')]);router[_0x010f('0xa')](_0x010f('0xd'),auth['isAuthenticated'](),controller[_0x010f('0xe')]);router[_0x010f('0xf')]('/',auth[_0x010f('0xb')](),controller['create']);router[_0x010f('0x10')](_0x010f('0xd'),auth[_0x010f('0xb')](),controller[_0x010f('0x11')]);router[_0x010f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x010f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 4ffbbb2..1b2adff 100644 --- a/server/api/intServicenowField/intServicenowField.attributes.js +++ b/server/api/intServicenowField/intServicenowField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf7c=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x4ee2ae,_0x33f2e0){var _0x7272e0=function(_0x2135b1){while(--_0x2135b1){_0x4ee2ae['push'](_0x4ee2ae['shift']());}};_0x7272e0(++_0x33f2e0);}(_0xcf7c,0x11a));var _0xccf7=function(_0x1fec1e,_0xce18d2){_0x1fec1e=_0x1fec1e-0x0;var _0x31f9ec=_0xcf7c[_0x1fec1e];return _0x31f9ec;};'use strict';var Sequelize=require(_0xccf7('0x0'));module[_0xccf7('0x1')]={'type':{'type':Sequelize[_0xccf7('0x2')](_0xccf7('0x3'),_0xccf7('0x4'),'customVariable',_0xccf7('0x5'),_0xccf7('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xccf7('0x7')]},'keyType':{'type':Sequelize[_0xccf7('0x2')](_0xccf7('0x3'),_0xccf7('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xccf7('0x7')]},'idField':{'type':Sequelize[_0xccf7('0x7')]},'nameField':{'type':Sequelize[_0xccf7('0x7')]},'customField':{'type':Sequelize[_0xccf7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xccf7('0x7')]}}; \ No newline at end of file +var _0x40e7=['customVariable','STRING','ENUM','BOOLEAN','exports','string'];(function(_0x4b5fc1,_0x22970c){var _0xedd64a=function(_0x46c3d8){while(--_0x46c3d8){_0x4b5fc1['push'](_0x4b5fc1['shift']());}};_0xedd64a(++_0x22970c);}(_0x40e7,0x1d8));var _0x740e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x40e7[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require('sequelize');module[_0x740e('0x0')]={'type':{'type':Sequelize['ENUM'](_0x740e('0x1'),'variable',_0x740e('0x2'),'keyValue','picklist'),'defaultValue':_0x740e('0x1')},'content':{'type':Sequelize[_0x740e('0x3')]},'key':{'type':Sequelize[_0x740e('0x3')]},'keyType':{'type':Sequelize[_0x740e('0x4')](_0x740e('0x1'),'variable',_0x740e('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x740e('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x740e('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index ab65cfb..946da1f 100644 --- a/server/api/intServicenowField/intServicenowField.controller.js +++ b/server/api/intServicenowField/intServicenowField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7607=['model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key'];(function(_0x45a42e,_0xdef11){var _0x413299=function(_0x5d7b5d){while(--_0x5d7b5d){_0x45a42e['push'](_0x45a42e['shift']());}};_0x413299(++_0xdef11);}(_0x7607,0x198));var _0x7760=function(_0x3b17bd,_0x3de1d0){_0x3b17bd=_0x3b17bd-0x0;var _0x3537d6=_0x7607[_0x3b17bd];return _0x3537d6;};'use strict';var emlformat=require(_0x7760('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7760('0x1'));var jsonpatch=require(_0x7760('0x2'));var rp=require(_0x7760('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7760('0x4'));var util=require(_0x7760('0x5'));var path=require(_0x7760('0x6'));var sox=require(_0x7760('0x7'));var csv=require(_0x7760('0x8'));var ejs=require(_0x7760('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7760('0xa'));var squel=require(_0x7760('0xb'));var crypto=require(_0x7760('0xc'));var jsforce=require(_0x7760('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7760('0x8'));var querystring=require(_0x7760('0xe'));var Papa=require('papaparse');var Redis=require(_0x7760('0xf'));var authService=require(_0x7760('0x10'));var qs=require(_0x7760('0x11'));var as=require(_0x7760('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7760('0x13'))(_0x7760('0x14'));var utils=require(_0x7760('0x15'));var config=require(_0x7760('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7760('0x17'))['db'];function respondWithStatusCode(_0x542832,_0x2cbaaf){_0x2cbaaf=_0x2cbaaf||0xcc;return function(_0x5b46f4){if(_0x5b46f4){return _0x542832[_0x7760('0x18')](_0x2cbaaf);}return _0x542832[_0x7760('0x19')](_0x2cbaaf)[_0x7760('0x1a')]();};}function respondWithResult(_0x5a9a9b,_0x23bd25){_0x23bd25=_0x23bd25||0xc8;return function(_0x14f8c7){if(_0x14f8c7){return _0x5a9a9b[_0x7760('0x19')](_0x23bd25)[_0x7760('0x1b')](_0x14f8c7);}};}function respondWithFilteredResult(_0x2f9c83,_0x1597b9){return function(_0x499f4d){if(_0x499f4d){var _0x53aac9=typeof _0x1597b9[_0x7760('0x1c')]===_0x7760('0x1d')&&typeof _0x1597b9['limit']===_0x7760('0x1d');var _0x4ebc67=_0x499f4d[_0x7760('0x1e')];var _0x3668a5=_0x53aac9?0x0:_0x1597b9[_0x7760('0x1c')];var _0x182c4b=_0x53aac9?_0x499f4d[_0x7760('0x1e')]:_0x1597b9[_0x7760('0x1c')]+_0x1597b9['limit'];var _0x1fed9a;if(_0x182c4b>=_0x4ebc67){_0x182c4b=_0x4ebc67;_0x1fed9a=0xc8;}else{_0x1fed9a=0xce;}_0x2f9c83[_0x7760('0x19')](_0x1fed9a);return _0x2f9c83[_0x7760('0x1f')]('Content-Range',_0x3668a5+'-'+_0x182c4b+'/'+_0x4ebc67)[_0x7760('0x1b')](_0x499f4d);}return null;};}function patchUpdates(_0x30db55){return function(_0x27aeb4){try{jsonpatch[_0x7760('0x20')](_0x27aeb4,_0x30db55,!![]);}catch(_0x288aa8){return BPromise[_0x7760('0x21')](_0x288aa8);}return _0x27aeb4['save']();};}function saveUpdates(_0x3b3b30,_0x419a22){return function(_0x5322e0){if(_0x5322e0){return _0x5322e0[_0x7760('0x22')](_0x3b3b30)[_0x7760('0x23')](function(_0x3971f9){return _0x3971f9;});}return null;};}function removeEntity(_0x185ab3,_0x1bf1a5){return function(_0x2ce4b7){if(_0x2ce4b7){return _0x2ce4b7[_0x7760('0x24')]()[_0x7760('0x23')](function(){_0x185ab3[_0x7760('0x19')](0xcc)[_0x7760('0x1a')]();});}};}function handleEntityNotFound(_0x362ee4,_0x499f8f){return function(_0x5cc2e3){if(!_0x5cc2e3){_0x362ee4['sendStatus'](0x194);}return _0x5cc2e3;};}function handleError(_0x16d01d,_0x4ba058){_0x4ba058=_0x4ba058||0x1f4;return function(_0x3f7491){logger[_0x7760('0x25')](_0x3f7491[_0x7760('0x26')]);if(_0x3f7491[_0x7760('0x27')]){delete _0x3f7491[_0x7760('0x27')];}_0x16d01d[_0x7760('0x19')](_0x4ba058)[_0x7760('0x28')](_0x3f7491);};}exports[_0x7760('0x29')]=function(_0x4df5cb,_0x2cfbc1){var _0x534089={},_0x2769fa={},_0x3e410d={'count':0x0,'rows':[]};var _0x3cbdfc=_[_0x7760('0x2a')](db[_0x7760('0x2b')][_0x7760('0x2c')],function(_0x3da7d1){return{'name':_0x3da7d1[_0x7760('0x2d')],'type':_0x3da7d1[_0x7760('0x2e')][_0x7760('0x2f')]};});_0x2769fa[_0x7760('0x30')]=_[_0x7760('0x2a')](_0x3cbdfc,_0x7760('0x27'));_0x2769fa[_0x7760('0x31')]=_['keys'](_0x4df5cb[_0x7760('0x31')]);_0x2769fa[_0x7760('0x32')]=_[_0x7760('0x33')](_0x2769fa[_0x7760('0x30')],_0x2769fa['query']);_0x534089[_0x7760('0x34')]=_['intersection'](_0x2769fa[_0x7760('0x30')],qs[_0x7760('0x35')](_0x4df5cb[_0x7760('0x31')]['fields']));_0x534089['attributes']=_0x534089[_0x7760('0x34')]['length']?_0x534089[_0x7760('0x34')]:_0x2769fa['model'];if(!_0x4df5cb['query'][_0x7760('0x36')](_0x7760('0x37'))){_0x534089[_0x7760('0x38')]=qs[_0x7760('0x38')](_0x4df5cb[_0x7760('0x31')][_0x7760('0x38')]);_0x534089[_0x7760('0x1c')]=qs[_0x7760('0x1c')](_0x4df5cb['query']['offset']);}_0x534089[_0x7760('0x39')]=qs[_0x7760('0x3a')](_0x4df5cb[_0x7760('0x31')][_0x7760('0x3a')]);_0x534089[_0x7760('0x3b')]=qs[_0x7760('0x32')](_[_0x7760('0x3c')](_0x4df5cb['query'],_0x2769fa[_0x7760('0x32')]),_0x3cbdfc);if(_0x4df5cb[_0x7760('0x31')][_0x7760('0x3d')]){_0x534089[_0x7760('0x3b')]=_[_0x7760('0x3e')](_0x534089[_0x7760('0x3b')],{'$or':_[_0x7760('0x2a')](_0x3cbdfc,function(_0x6da07){if(_0x6da07[_0x7760('0x2e')]!==_0x7760('0x3f')){var _0x4e1718={};_0x4e1718[_0x6da07[_0x7760('0x27')]]={'$like':'%'+_0x4df5cb['query'][_0x7760('0x3d')]+'%'};return _0x4e1718;}})});}_0x534089=_[_0x7760('0x3e')]({},_0x534089,_0x4df5cb[_0x7760('0x40')]);var _0x5ea084={'where':_0x534089[_0x7760('0x3b')]};return db[_0x7760('0x2b')][_0x7760('0x1e')](_0x5ea084)[_0x7760('0x23')](function(_0x323803){_0x3e410d[_0x7760('0x1e')]=_0x323803;if(_0x4df5cb[_0x7760('0x31')][_0x7760('0x41')]){_0x534089[_0x7760('0x42')]=[{'all':!![]}];}return db[_0x7760('0x2b')][_0x7760('0x43')](_0x534089);})[_0x7760('0x23')](function(_0xd0889c){_0x3e410d['rows']=_0xd0889c;return _0x3e410d;})['then'](respondWithFilteredResult(_0x2cfbc1,_0x534089))[_0x7760('0x44')](handleError(_0x2cfbc1,null));};exports[_0x7760('0x45')]=function(_0x361377,_0x291eea){var _0x579e2a={'raw':!![],'where':{'id':_0x361377[_0x7760('0x46')]['id']}},_0x1cc9bc={};_0x1cc9bc[_0x7760('0x30')]=_[_0x7760('0x47')](db[_0x7760('0x2b')][_0x7760('0x2c')]);_0x1cc9bc[_0x7760('0x31')]=_[_0x7760('0x47')](_0x361377[_0x7760('0x31')]);_0x1cc9bc[_0x7760('0x32')]=_[_0x7760('0x33')](_0x1cc9bc[_0x7760('0x30')],_0x1cc9bc[_0x7760('0x31')]);_0x579e2a[_0x7760('0x34')]=_[_0x7760('0x33')](_0x1cc9bc['model'],qs[_0x7760('0x35')](_0x361377[_0x7760('0x31')]['fields']));_0x579e2a[_0x7760('0x34')]=_0x579e2a[_0x7760('0x34')][_0x7760('0x48')]?_0x579e2a[_0x7760('0x34')]:_0x1cc9bc[_0x7760('0x30')];if(_0x361377['query'][_0x7760('0x41')]){_0x579e2a['include']=[{'all':!![]}];}_0x579e2a=_[_0x7760('0x3e')]({},_0x579e2a,_0x361377[_0x7760('0x40')]);return db[_0x7760('0x2b')][_0x7760('0x49')](_0x579e2a)[_0x7760('0x23')](handleEntityNotFound(_0x291eea,null))['then'](respondWithResult(_0x291eea,null))[_0x7760('0x44')](handleError(_0x291eea,null));};exports['create']=function(_0xc5ab33,_0x59f8a0){return db[_0x7760('0x2b')][_0x7760('0x4a')](_0xc5ab33['body'],{})[_0x7760('0x23')](respondWithResult(_0x59f8a0,0xc9))[_0x7760('0x44')](handleError(_0x59f8a0,null));};exports[_0x7760('0x22')]=function(_0x3fadd5,_0x368086){if(_0x3fadd5['body']['id']){delete _0x3fadd5['body']['id'];}return db['ServicenowField'][_0x7760('0x49')]({'where':{'id':_0x3fadd5[_0x7760('0x46')]['id']}})['then'](handleEntityNotFound(_0x368086,null))[_0x7760('0x23')](saveUpdates(_0x3fadd5[_0x7760('0x4b')],null))['then'](respondWithResult(_0x368086,null))[_0x7760('0x44')](handleError(_0x368086,null));};exports[_0x7760('0x24')]=function(_0x176438,_0x4e6858){return db[_0x7760('0x2b')][_0x7760('0x49')]({'where':{'id':_0x176438['params']['id']}})['then'](handleEntityNotFound(_0x4e6858,null))[_0x7760('0x23')](removeEntity(_0x4e6858,null))[_0x7760('0x44')](handleError(_0x4e6858,null));}; \ No newline at end of file +var _0x9d18=['find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','ServicenowField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params'];(function(_0x10d25d,_0x3deecb){var _0x456218=function(_0x1e392c){while(--_0x1e392c){_0x10d25d['push'](_0x10d25d['shift']());}};_0x456218(++_0x3deecb);}(_0x9d18,0xe0));var _0x89d1=function(_0x2c13c9,_0x2d45b5){_0x2c13c9=_0x2c13c9-0x0;var _0x16280e=_0x9d18[_0x2c13c9];return _0x16280e;};'use strict';var emlformat=require(_0x89d1('0x0'));var rimraf=require(_0x89d1('0x1'));var zipdir=require(_0x89d1('0x2'));var jsonpatch=require(_0x89d1('0x3'));var rp=require(_0x89d1('0x4'));var moment=require(_0x89d1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x89d1('0x6'));var util=require('util');var path=require(_0x89d1('0x7'));var sox=require(_0x89d1('0x8'));var csv=require(_0x89d1('0x9'));var ejs=require(_0x89d1('0xa'));var fs=require('fs');var fs_extra=require(_0x89d1('0xb'));var _=require(_0x89d1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x89d1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x89d1('0x9'));var querystring=require(_0x89d1('0xe'));var Papa=require(_0x89d1('0xf'));var Redis=require(_0x89d1('0x10'));var authService=require(_0x89d1('0x11'));var qs=require(_0x89d1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89d1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x89d1('0x14'));var config=require(_0x89d1('0x15'));var licenseUtil=require(_0x89d1('0x16'));var db=require(_0x89d1('0x17'))['db'];function respondWithStatusCode(_0x27beed,_0x20ca04){_0x20ca04=_0x20ca04||0xcc;return function(_0x48a7c8){if(_0x48a7c8){return _0x27beed[_0x89d1('0x18')](_0x20ca04);}return _0x27beed[_0x89d1('0x19')](_0x20ca04)[_0x89d1('0x1a')]();};}function respondWithResult(_0x4040c2,_0x1ab632){_0x1ab632=_0x1ab632||0xc8;return function(_0x5932cc){if(_0x5932cc){return _0x4040c2['status'](_0x1ab632)[_0x89d1('0x1b')](_0x5932cc);}};}function respondWithFilteredResult(_0x23823b,_0x5d85ea){return function(_0x5e455c){if(_0x5e455c){var _0x5e4e43=typeof _0x5d85ea[_0x89d1('0x1c')]===_0x89d1('0x1d')&&typeof _0x5d85ea[_0x89d1('0x1e')]===_0x89d1('0x1d');var _0x28f095=_0x5e455c[_0x89d1('0x1f')];var _0x198b67=_0x5e4e43?0x0:_0x5d85ea[_0x89d1('0x1c')];var _0x4e5ce7=_0x5e4e43?_0x5e455c[_0x89d1('0x1f')]:_0x5d85ea['offset']+_0x5d85ea[_0x89d1('0x1e')];var _0xfffb40;if(_0x4e5ce7>=_0x28f095){_0x4e5ce7=_0x28f095;_0xfffb40=0xc8;}else{_0xfffb40=0xce;}_0x23823b[_0x89d1('0x19')](_0xfffb40);return _0x23823b[_0x89d1('0x20')](_0x89d1('0x21'),_0x198b67+'-'+_0x4e5ce7+'/'+_0x28f095)[_0x89d1('0x1b')](_0x5e455c);}return null;};}function patchUpdates(_0x5afacb){return function(_0x1b62c1){try{jsonpatch['apply'](_0x1b62c1,_0x5afacb,!![]);}catch(_0x4e5d8e){return BPromise[_0x89d1('0x22')](_0x4e5d8e);}return _0x1b62c1[_0x89d1('0x23')]();};}function saveUpdates(_0x14b972,_0x3c4d35){return function(_0x1e83be){if(_0x1e83be){return _0x1e83be[_0x89d1('0x24')](_0x14b972)[_0x89d1('0x25')](function(_0xb9c524){return _0xb9c524;});}return null;};}function removeEntity(_0x2864c9,_0x57b2a2){return function(_0x25b229){if(_0x25b229){return _0x25b229[_0x89d1('0x26')]()[_0x89d1('0x25')](function(){_0x2864c9[_0x89d1('0x19')](0xcc)[_0x89d1('0x1a')]();});}};}function handleEntityNotFound(_0x1c80e8,_0x1495f1){return function(_0x53c1de){if(!_0x53c1de){_0x1c80e8[_0x89d1('0x18')](0x194);}return _0x53c1de;};}function handleError(_0x14ac39,_0x5418dd){_0x5418dd=_0x5418dd||0x1f4;return function(_0x6bd2f9){logger['error'](_0x6bd2f9[_0x89d1('0x27')]);if(_0x6bd2f9[_0x89d1('0x28')]){delete _0x6bd2f9[_0x89d1('0x28')];}_0x14ac39[_0x89d1('0x19')](_0x5418dd)[_0x89d1('0x29')](_0x6bd2f9);};}exports[_0x89d1('0x2a')]=function(_0x1b24fd,_0x225d89){var _0x1b77df={},_0x5b6a99={},_0x10ab87={'count':0x0,'rows':[]};var _0x1adb3c=_['map'](db[_0x89d1('0x2b')][_0x89d1('0x2c')],function(_0x27ec7a){return{'name':_0x27ec7a[_0x89d1('0x2d')],'type':_0x27ec7a['type'][_0x89d1('0x2e')]};});_0x5b6a99[_0x89d1('0x2f')]=_[_0x89d1('0x30')](_0x1adb3c,_0x89d1('0x28'));_0x5b6a99[_0x89d1('0x31')]=_[_0x89d1('0x32')](_0x1b24fd[_0x89d1('0x31')]);_0x5b6a99[_0x89d1('0x33')]=_['intersection'](_0x5b6a99['model'],_0x5b6a99[_0x89d1('0x31')]);_0x1b77df[_0x89d1('0x34')]=_[_0x89d1('0x35')](_0x5b6a99['model'],qs['fields'](_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x36')]));_0x1b77df[_0x89d1('0x34')]=_0x1b77df[_0x89d1('0x34')][_0x89d1('0x37')]?_0x1b77df[_0x89d1('0x34')]:_0x5b6a99[_0x89d1('0x2f')];if(!_0x1b24fd['query']['hasOwnProperty'](_0x89d1('0x38'))){_0x1b77df['limit']=qs[_0x89d1('0x1e')](_0x1b24fd['query']['limit']);_0x1b77df[_0x89d1('0x1c')]=qs[_0x89d1('0x1c')](_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x1c')]);}_0x1b77df[_0x89d1('0x39')]=qs[_0x89d1('0x3a')](_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x3a')]);_0x1b77df[_0x89d1('0x3b')]=qs['filters'](_[_0x89d1('0x3c')](_0x1b24fd[_0x89d1('0x31')],_0x5b6a99['filters']),_0x1adb3c);if(_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x3d')]){_0x1b77df[_0x89d1('0x3b')]=_[_0x89d1('0x3e')](_0x1b77df[_0x89d1('0x3b')],{'$or':_[_0x89d1('0x30')](_0x1adb3c,function(_0x33af59){if(_0x33af59[_0x89d1('0x3f')]!==_0x89d1('0x40')){var _0x2b2c8a={};_0x2b2c8a[_0x33af59[_0x89d1('0x28')]]={'$like':'%'+_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x3d')]+'%'};return _0x2b2c8a;}})});}_0x1b77df=_['merge']({},_0x1b77df,_0x1b24fd[_0x89d1('0x41')]);var _0x22a149={'where':_0x1b77df[_0x89d1('0x3b')]};return db[_0x89d1('0x2b')][_0x89d1('0x1f')](_0x22a149)[_0x89d1('0x25')](function(_0x57d948){_0x10ab87[_0x89d1('0x1f')]=_0x57d948;if(_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x42')]){_0x1b77df[_0x89d1('0x43')]=[{'all':!![]}];}return db[_0x89d1('0x2b')][_0x89d1('0x44')](_0x1b77df);})[_0x89d1('0x25')](function(_0x5de712){_0x10ab87[_0x89d1('0x45')]=_0x5de712;return _0x10ab87;})[_0x89d1('0x25')](respondWithFilteredResult(_0x225d89,_0x1b77df))[_0x89d1('0x46')](handleError(_0x225d89,null));};exports['show']=function(_0xf3e3e8,_0x50ce05){var _0xd58e61={'raw':!![],'where':{'id':_0xf3e3e8[_0x89d1('0x47')]['id']}},_0x514063={};_0x514063[_0x89d1('0x2f')]=_[_0x89d1('0x32')](db[_0x89d1('0x2b')][_0x89d1('0x2c')]);_0x514063[_0x89d1('0x31')]=_['keys'](_0xf3e3e8[_0x89d1('0x31')]);_0x514063[_0x89d1('0x33')]=_[_0x89d1('0x35')](_0x514063[_0x89d1('0x2f')],_0x514063['query']);_0xd58e61['attributes']=_['intersection'](_0x514063[_0x89d1('0x2f')],qs[_0x89d1('0x36')](_0xf3e3e8[_0x89d1('0x31')][_0x89d1('0x36')]));_0xd58e61[_0x89d1('0x34')]=_0xd58e61[_0x89d1('0x34')][_0x89d1('0x37')]?_0xd58e61[_0x89d1('0x34')]:_0x514063['model'];if(_0xf3e3e8[_0x89d1('0x31')]['includeAll']){_0xd58e61[_0x89d1('0x43')]=[{'all':!![]}];}_0xd58e61=_[_0x89d1('0x3e')]({},_0xd58e61,_0xf3e3e8[_0x89d1('0x41')]);return db[_0x89d1('0x2b')][_0x89d1('0x48')](_0xd58e61)[_0x89d1('0x25')](handleEntityNotFound(_0x50ce05,null))[_0x89d1('0x25')](respondWithResult(_0x50ce05,null))[_0x89d1('0x46')](handleError(_0x50ce05,null));};exports['create']=function(_0x1f809f,_0x3c3c53){return db[_0x89d1('0x2b')]['create'](_0x1f809f[_0x89d1('0x49')],{})[_0x89d1('0x25')](respondWithResult(_0x3c3c53,0xc9))[_0x89d1('0x46')](handleError(_0x3c3c53,null));};exports[_0x89d1('0x24')]=function(_0x49376b,_0x2311d1){if(_0x49376b[_0x89d1('0x49')]['id']){delete _0x49376b[_0x89d1('0x49')]['id'];}return db[_0x89d1('0x2b')][_0x89d1('0x48')]({'where':{'id':_0x49376b[_0x89d1('0x47')]['id']}})[_0x89d1('0x25')](handleEntityNotFound(_0x2311d1,null))[_0x89d1('0x25')](saveUpdates(_0x49376b['body'],null))[_0x89d1('0x25')](respondWithResult(_0x2311d1,null))['catch'](handleError(_0x2311d1,null));};exports[_0x89d1('0x26')]=function(_0x598f8d,_0x3d9ce){return db[_0x89d1('0x2b')][_0x89d1('0x48')]({'where':{'id':_0x598f8d['params']['id']}})[_0x89d1('0x25')](handleEntityNotFound(_0x3d9ce,null))[_0x89d1('0x25')](removeEntity(_0x3d9ce,null))[_0x89d1('0x46')](handleError(_0x3d9ce,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index c274cef..5127bd1 100644 --- a/server/api/intServicenowField/intServicenowField.model.js +++ b/server/api/intServicenowField/intServicenowField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbce=['../../config/logger','api','moment','bluebird','request-promise','path','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xbbce,0x98));var _0xebbc=function(_0x413af5,_0x36e84e){_0x413af5=_0x413af5-0x0;var _0x1d1fc3=_0xbbce[_0x413af5];return _0x1d1fc3;};'use strict';var _=require(_0xebbc('0x0'));var util=require(_0xebbc('0x1'));var logger=require(_0xebbc('0x2'))(_0xebbc('0x3'));var moment=require(_0xebbc('0x4'));var BPromise=require(_0xebbc('0x5'));var rp=require(_0xebbc('0x6'));var fs=require('fs');var path=require(_0xebbc('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xebbc('0x8'));module[_0xebbc('0x9')]=function(_0x40d0f1,_0x1fc8a8){return _0x40d0f1[_0xebbc('0xa')]('ServicenowField',attributes,{'tableName':_0xebbc('0xb'),'paranoid':![],'indexes':[{'name':_0xebbc('0xc'),'fields':['idField',_0xebbc('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2985=['api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowField.attributes','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2985,0x15e));var _0x5298=function(_0x5ce6eb,_0x29a90b){_0x5ce6eb=_0x5ce6eb-0x0;var _0x33c3cd=_0x2985[_0x5ce6eb];return _0x33c3cd;};'use strict';var _=require('lodash');var util=require(_0x5298('0x0'));var logger=require('../../config/logger')(_0x5298('0x1'));var moment=require(_0x5298('0x2'));var BPromise=require(_0x5298('0x3'));var rp=require(_0x5298('0x4'));var fs=require('fs');var path=require(_0x5298('0x5'));var rimraf=require('rimraf');var config=require(_0x5298('0x6'));var attributes=require(_0x5298('0x7'));module['exports']=function(_0x54d0,_0x1b86ee){return _0x54d0[_0x5298('0x8')]('ServicenowField',attributes,{'tableName':_0x5298('0x9'),'paranoid':![],'indexes':[{'name':_0x5298('0xa'),'fields':[_0x5298('0xb'),_0x5298('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index f02e947..b2d459c 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xf1d50,_0x4cd491){var _0x5cb8a5=function(_0x416458){while(--_0x416458){_0xf1d50['push'](_0xf1d50['shift']());}};_0x5cb8a5(++_0x4cd491);}(_0x70e0,0x17b));var _0x070e=function(_0x5730ef,_0x29d62b){_0x5730ef=_0x5730ef-0x0;var _0x5d7bc9=_0x70e0[_0x5730ef];return _0x5d7bc9;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x52acf5,_0x4267d3){var _0x4e06f6=function(_0x260ddc){while(--_0x260ddc){_0x52acf5['push'](_0x52acf5['shift']());}};_0x4e06f6(++_0x4267d3);}(_0x9bde,0xe1));var _0xe9bd=function(_0x137602,_0xb977a6){_0x137602=_0x137602-0x0;var _0x4ac814=_0x9bde[_0x137602];return _0x4ac814;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 6ab406b..8849b6c 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x81289b,_0x6be661){var _0x1a482e=function(_0x424971){while(--_0x424971){_0x81289b['push'](_0x81289b['shift']());}};_0x1a482e(++_0x6be661);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1df5ab,_0x5aa9a7){var _0x265009=function(_0x2796d3){while(--_0x2796d3){_0x1df5ab['push'](_0x1df5ab['shift']());}};_0x265009(++_0x5aa9a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 01fdd76..7588644 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4e0056,_0x5f770a){var _0x44738e=function(_0xc11b19){while(--_0xc11b19){_0x4e0056['push'](_0x4e0056['shift']());}};_0x44738e(++_0x5f770a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3becd9,_0x113b4a){var _0x33ad62=function(_0x31633c){while(--_0x31633c){_0x3becd9['push'](_0x3becd9['shift']());}};_0x33ad62(++_0x113b4a);}(_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')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index c4b40eb..2596f64 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5859=['sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','index','SugarcrmAccount','type','key','map','query','keys','filters','intersection','attributes','model','length','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','fields','find','create','body','catch','update','getConfigurations','SugarcrmConfiguration','rawAttributes','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','assigned_user_id','created_by','duration_hours','duration_minutes','parent_id','direction','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','JSON','module_fields','remove','includes','label','endsWith','values','value','test','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x5da0be,_0xc249e7){var _0x39b2aa=function(_0x3e1dd2){while(--_0x3e1dd2){_0x5da0be['push'](_0x5da0be['shift']());}};_0x39b2aa(++_0xc249e7);}(_0x5859,0xe8));var _0x9585=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x5859[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require(_0x9585('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9585('0x1'));var jsonpatch=require(_0x9585('0x2'));var rp=require(_0x9585('0x3'));var moment=require('moment');var BPromise=require(_0x9585('0x4'));var Mustache=require(_0x9585('0x5'));var util=require(_0x9585('0x6'));var path=require(_0x9585('0x7'));var sox=require(_0x9585('0x8'));var csv=require(_0x9585('0x9'));var ejs=require(_0x9585('0xa'));var fs=require('fs');var fs_extra=require(_0x9585('0xb'));var _=require('lodash');var squel=require(_0x9585('0xc'));var crypto=require(_0x9585('0xd'));var jsforce=require(_0x9585('0xe'));var deskjs=require(_0x9585('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9585('0x10'));var Papa=require(_0x9585('0x11'));var Redis=require(_0x9585('0x12'));var authService=require(_0x9585('0x13'));var qs=require(_0x9585('0x14'));var as=require(_0x9585('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9585('0x16'));var utils=require(_0x9585('0x17'));var config=require(_0x9585('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x9585('0x19'));function respondWithStatusCode(_0x11f22d,_0x1de20b){_0x1de20b=_0x1de20b||0xcc;return function(_0x2834f3){if(_0x2834f3){return _0x11f22d[_0x9585('0x1a')](_0x1de20b);}return _0x11f22d[_0x9585('0x1b')](_0x1de20b)[_0x9585('0x1c')]();};}function respondWithResult(_0x46826a,_0x31ae56){_0x31ae56=_0x31ae56||0xc8;return function(_0x28bdc4){if(_0x28bdc4){return _0x46826a[_0x9585('0x1b')](_0x31ae56)[_0x9585('0x1d')](_0x28bdc4);}};}function respondWithFilteredResult(_0x3ab662,_0x32fcf6){return function(_0x546b86){if(_0x546b86){var _0x4c7764=typeof _0x32fcf6['offset']===_0x9585('0x1e')&&typeof _0x32fcf6['limit']===_0x9585('0x1e');var _0x5e7be5=_0x546b86[_0x9585('0x1f')];var _0x109790=_0x4c7764?0x0:_0x32fcf6[_0x9585('0x20')];var _0x518b35=_0x4c7764?_0x546b86[_0x9585('0x1f')]:_0x32fcf6[_0x9585('0x20')]+_0x32fcf6['limit'];var _0x2129cf;if(_0x518b35>=_0x5e7be5){_0x518b35=_0x5e7be5;_0x2129cf=0xc8;}else{_0x2129cf=0xce;}_0x3ab662[_0x9585('0x1b')](_0x2129cf);return _0x3ab662[_0x9585('0x21')]('Content-Range',_0x109790+'-'+_0x518b35+'/'+_0x5e7be5)[_0x9585('0x1d')](_0x546b86);}return null;};}function patchUpdates(_0x53983d){return function(_0x3be1af){try{jsonpatch[_0x9585('0x22')](_0x3be1af,_0x53983d,!![]);}catch(_0x4c00a7){return BPromise[_0x9585('0x23')](_0x4c00a7);}return _0x3be1af[_0x9585('0x24')]();};}function saveUpdates(_0x4d10dd,_0x2da8db){return function(_0x4e4e36){if(_0x4e4e36){return _0x4e4e36['update'](_0x4d10dd)[_0x9585('0x25')](function(_0x11395c){return _0x11395c;});}return null;};}function removeEntity(_0x2bea15,_0x75b07a){return function(_0x176bc4){if(_0x176bc4){return _0x176bc4[_0x9585('0x26')]()[_0x9585('0x25')](function(){_0x2bea15['status'](0xcc)[_0x9585('0x1c')]();});}};}function handleEntityNotFound(_0x1e8902,_0x1deebb){return function(_0x46c8e4){if(!_0x46c8e4){_0x1e8902['sendStatus'](0x194);}return _0x46c8e4;};}function handleError(_0x395ecf,_0x14da53){_0x14da53=_0x14da53||0x1f4;return function(_0x53b4ac){logger[_0x9585('0x27')](_0x53b4ac[_0x9585('0x28')]);if(_0x53b4ac[_0x9585('0x29')]){delete _0x53b4ac[_0x9585('0x29')];}_0x395ecf[_0x9585('0x1b')](_0x14da53)[_0x9585('0x2a')](_0x53b4ac);};}exports[_0x9585('0x2b')]=function(_0x1b74b4,_0x314daf){var _0x9dabc={},_0x1939cd={},_0x544e70={'count':0x0,'rows':[]};var _0x1e3bd2=_['map'](db[_0x9585('0x2c')]['rawAttributes'],function(_0x55b256){return{'name':_0x55b256['fieldName'],'type':_0x55b256[_0x9585('0x2d')][_0x9585('0x2e')]};});_0x1939cd['model']=_[_0x9585('0x2f')](_0x1e3bd2,_0x9585('0x29'));_0x1939cd[_0x9585('0x30')]=_[_0x9585('0x31')](_0x1b74b4[_0x9585('0x30')]);_0x1939cd[_0x9585('0x32')]=_[_0x9585('0x33')](_0x1939cd['model'],_0x1939cd[_0x9585('0x30')]);_0x9dabc[_0x9585('0x34')]=_[_0x9585('0x33')](_0x1939cd[_0x9585('0x35')],qs['fields'](_0x1b74b4[_0x9585('0x30')]['fields']));_0x9dabc[_0x9585('0x34')]=_0x9dabc['attributes'][_0x9585('0x36')]?_0x9dabc['attributes']:_0x1939cd[_0x9585('0x35')];if(!_0x1b74b4[_0x9585('0x30')]['hasOwnProperty'](_0x9585('0x37'))){_0x9dabc[_0x9585('0x38')]=qs[_0x9585('0x38')](_0x1b74b4[_0x9585('0x30')][_0x9585('0x38')]);_0x9dabc['offset']=qs[_0x9585('0x20')](_0x1b74b4['query'][_0x9585('0x20')]);}_0x9dabc['order']=qs[_0x9585('0x39')](_0x1b74b4['query'][_0x9585('0x39')]);_0x9dabc['where']=qs['filters'](_[_0x9585('0x3a')](_0x1b74b4[_0x9585('0x30')],_0x1939cd[_0x9585('0x32')]),_0x1e3bd2);if(_0x1b74b4[_0x9585('0x30')]['filter']){_0x9dabc[_0x9585('0x3b')]=_[_0x9585('0x3c')](_0x9dabc[_0x9585('0x3b')],{'$or':_[_0x9585('0x2f')](_0x1e3bd2,function(_0x31b301){if(_0x31b301[_0x9585('0x2d')]!==_0x9585('0x3d')){var _0xbf527c={};_0xbf527c[_0x31b301['name']]={'$like':'%'+_0x1b74b4['query'][_0x9585('0x3e')]+'%'};return _0xbf527c;}})});}_0x9dabc=_['merge']({},_0x9dabc,_0x1b74b4[_0x9585('0x3f')]);var _0x46a194={'where':_0x9dabc[_0x9585('0x3b')]};return db['SugarcrmAccount']['count'](_0x46a194)[_0x9585('0x25')](function(_0x4a7cfd){_0x544e70['count']=_0x4a7cfd;if(_0x1b74b4[_0x9585('0x30')][_0x9585('0x40')]){_0x9dabc[_0x9585('0x41')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x9585('0x42')](_0x9dabc);})['then'](function(_0x5b838d){_0x544e70[_0x9585('0x43')]=_0x5b838d;return _0x544e70;})['then'](respondWithFilteredResult(_0x314daf,_0x9dabc))['catch'](handleError(_0x314daf,null));};exports[_0x9585('0x44')]=function(_0x26c374,_0x5c0a1a){var _0x6f6474={'raw':![],'where':{'id':_0x26c374[_0x9585('0x45')]['id']}},_0x3302f0={};_0x3302f0[_0x9585('0x35')]=_[_0x9585('0x31')](db[_0x9585('0x2c')]['rawAttributes']);_0x3302f0[_0x9585('0x30')]=_[_0x9585('0x31')](_0x26c374[_0x9585('0x30')]);_0x3302f0[_0x9585('0x32')]=_['intersection'](_0x3302f0[_0x9585('0x35')],_0x3302f0['query']);_0x6f6474[_0x9585('0x34')]=_[_0x9585('0x33')](_0x3302f0['model'],qs[_0x9585('0x46')](_0x26c374[_0x9585('0x30')][_0x9585('0x46')]));_0x6f6474[_0x9585('0x34')]=_0x6f6474[_0x9585('0x34')][_0x9585('0x36')]?_0x6f6474[_0x9585('0x34')]:_0x3302f0[_0x9585('0x35')];if(_0x26c374['query']['includeAll']){_0x6f6474[_0x9585('0x41')]=[{'all':!![]}];}_0x6f6474=_['merge']({},_0x6f6474,_0x26c374[_0x9585('0x3f')]);return db[_0x9585('0x2c')][_0x9585('0x47')](_0x6f6474)[_0x9585('0x25')](handleEntityNotFound(_0x5c0a1a,null))[_0x9585('0x25')](respondWithResult(_0x5c0a1a,null))['catch'](handleError(_0x5c0a1a,null));};exports[_0x9585('0x48')]=function(_0x5df9c6,_0x46ad7b){return db['SugarcrmAccount']['create'](_0x5df9c6[_0x9585('0x49')],{})[_0x9585('0x25')](respondWithResult(_0x46ad7b,0xc9))[_0x9585('0x4a')](handleError(_0x46ad7b,null));};exports[_0x9585('0x4b')]=function(_0x49020d,_0x3059e8){if(_0x49020d[_0x9585('0x49')]['id']){delete _0x49020d['body']['id'];}return db[_0x9585('0x2c')][_0x9585('0x47')]({'where':{'id':_0x49020d[_0x9585('0x45')]['id']}})['then'](handleEntityNotFound(_0x3059e8,null))[_0x9585('0x25')](saveUpdates(_0x49020d['body'],null))[_0x9585('0x25')](respondWithResult(_0x3059e8,null))[_0x9585('0x4a')](handleError(_0x3059e8,null));};exports[_0x9585('0x26')]=function(_0x40f30f,_0xfe3abe){return db[_0x9585('0x2c')]['find']({'where':{'id':_0x40f30f['params']['id']}})['then'](handleEntityNotFound(_0xfe3abe,null))['then'](removeEntity(_0xfe3abe,null))[_0x9585('0x4a')](handleError(_0xfe3abe,null));};exports[_0x9585('0x4c')]=function(_0x256977,_0xea64e1,_0x268ca1){var _0x12d797={};var _0x5fe35a={};var _0x321286;var _0x4d9e52;return db[_0x9585('0x2c')]['findOne']({'where':{'id':_0x256977[_0x9585('0x45')]['id']}})[_0x9585('0x25')](handleEntityNotFound(_0xea64e1,null))['then'](function(_0x27f213){if(_0x27f213){_0x321286=_0x27f213;_0x5fe35a[_0x9585('0x35')]=_[_0x9585('0x31')](db[_0x9585('0x4d')][_0x9585('0x4e')]);_0x5fe35a['query']=_['keys'](_0x256977[_0x9585('0x30')]);_0x5fe35a[_0x9585('0x32')]=_[_0x9585('0x33')](_0x5fe35a[_0x9585('0x35')],_0x5fe35a[_0x9585('0x30')]);_0x12d797[_0x9585('0x34')]=_[_0x9585('0x33')](_0x5fe35a[_0x9585('0x35')],qs[_0x9585('0x46')](_0x256977[_0x9585('0x30')]['fields']));_0x12d797[_0x9585('0x34')]=_0x12d797[_0x9585('0x34')]['length']?_0x12d797[_0x9585('0x34')]:_0x5fe35a[_0x9585('0x35')];_0x12d797['order']=qs[_0x9585('0x39')](_0x256977['query'][_0x9585('0x39')]);_0x12d797['where']=qs[_0x9585('0x32')](_[_0x9585('0x3a')](_0x256977[_0x9585('0x30')],_0x5fe35a[_0x9585('0x32')]));if(_0x256977['query'][_0x9585('0x3e')]){_0x12d797[_0x9585('0x3b')]=_['merge'](_0x12d797[_0x9585('0x3b')],{'$or':_[_0x9585('0x2f')](_0x12d797[_0x9585('0x34')],function(_0x385208){var _0x1a403a={};_0x1a403a[_0x385208]={'$like':'%'+_0x256977['query'][_0x9585('0x3e')]+'%'};return _0x1a403a;})});}_0x12d797=_['merge']({},_0x12d797,_0x256977['options']);return _0x321286[_0x9585('0x4c')](_0x12d797);}})[_0x9585('0x25')](function(_0x5e8fa9){if(_0x5e8fa9){_0x4d9e52=_0x5e8fa9[_0x9585('0x36')];if(!_0x256977['query']['hasOwnProperty']('nolimit')){_0x12d797[_0x9585('0x38')]=qs[_0x9585('0x38')](_0x256977['query']['limit']);_0x12d797[_0x9585('0x20')]=qs[_0x9585('0x20')](_0x256977[_0x9585('0x30')][_0x9585('0x20')]);}return _0x321286[_0x9585('0x4c')](_0x12d797);}})[_0x9585('0x25')](function(_0x2c3bec){if(_0x2c3bec){return _0x2c3bec?{'count':_0x4d9e52,'rows':_0x2c3bec}:null;}})[_0x9585('0x25')](respondWithResult(_0xea64e1,null))[_0x9585('0x4a')](handleError(_0xea64e1,null));};exports[_0x9585('0x4f')]=function(_0x26a500,_0x35e8aa,_0x565a3b){if(_0x26a500[_0x9585('0x49')]['id']){delete _0x26a500[_0x9585('0x49')]['id'];}return db[_0x9585('0x2c')][_0x9585('0x50')]({'where':{'id':_0x26a500[_0x9585('0x45')]['id']}})[_0x9585('0x25')](handleEntityNotFound(_0x35e8aa,null))[_0x9585('0x25')](function(_0x37b747){if(_0x37b747){_0x26a500['body'][_0x9585('0x51')]=_0x37b747['id'];_0x26a500[_0x9585('0x49')][_0x9585('0x52')]=integrations[_0x9585('0x53')](_0x26a500[_0x9585('0x49')][_0x9585('0x54')],_0x26a500['body'][_0x9585('0x2d')]);_0x26a500[_0x9585('0x49')]['Descriptions']=integrations[_0x9585('0x55')](_0x26a500[_0x9585('0x49')][_0x9585('0x54')],_0x26a500['body'][_0x9585('0x2d')]);return db[_0x9585('0x4d')][_0x9585('0x48')](_0x26a500[_0x9585('0x49')],{'include':[{'model':db[_0x9585('0x56')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x9585('0x57')}]});}return null;})[_0x9585('0x25')](respondWithResult(_0x35e8aa,null))[_0x9585('0x4a')](handleError(_0x35e8aa,null));};exports['getFields']=function(_0x1207c0,_0x15c45a,_0x22b29e){var _0x460879='';var _0x593c25=['id','name',_0x9585('0x58'),_0x9585('0x59'),'description','date_start',_0x9585('0x5a'),_0x9585('0x5b'),_0x9585('0x5c'),'parent_type','parent_name',_0x9585('0x5d')];return db[_0x9585('0x2c')][_0x9585('0x50')]({'where':{'id':_0x1207c0[_0x9585('0x45')]['id']},'attributes':['id','username','password',_0x9585('0x5e')]})[_0x9585('0x25')](handleEntityNotFound(_0x15c45a,null))[_0x9585('0x25')](function(_0x3081e3){if(_0x3081e3){_0x460879=_0x3081e3[_0x9585('0x5e')];var _0x18a4a7=_0x460879[_0x9585('0x5f')](-0x1);if(_0x18a4a7==='/'){_0x460879=_0x460879[_0x9585('0x60')](0x0,_0x460879[_0x9585('0x61')](_0x18a4a7));}return rp({'method':_0x9585('0x62'),'uri':util[_0x9585('0x63')](_0x9585('0x64'),_0x460879,_0x9585('0x65')),'json':!![],'form':{'method':_0x9585('0x66'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x9585('0x67')]({'user_auth':{'user_name':_0x3081e3['username'],'password':_0x3081e3['password'],'encryption':_0x9585('0x68')},'application':_0x9585('0x69')})}});}})[_0x9585('0x25')](function(_0x38a14f){if(_0x38a14f&&_0x38a14f[_0x9585('0x29')]!==_0x9585('0x6a')&&_0x38a14f[_0x9585('0x29')]!==_0x9585('0x6b')){return rp({'method':'POST','uri':util['format'](_0x9585('0x64'),_0x460879,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x9585('0x6c'),'input_type':'JSON','response_type':_0x9585('0x6d'),'rest_data':JSON[_0x9585('0x67')]({'session':_0x38a14f['id'],'module_name':'Calls'})}})[_0x9585('0x25')](function(_0x54dbb4){if(_0x54dbb4){var _0x3a7bfe=_['values'](_0x54dbb4[_0x9585('0x6e')]);_[_0x9585('0x6f')](_0x3a7bfe,function(_0x40c534){return _0x593c25[_0x9585('0x70')](_0x40c534[_0x9585('0x29')]);});return{'count':_0x3a7bfe[_0x9585('0x36')],'rows':_[_0x9585('0x2f')](_0x3a7bfe,function(_0x2223f6){return{'id':_0x2223f6[_0x9585('0x29')],'name':_0x2223f6[_0x9585('0x71')],'custom':_[_0x9585('0x72')](_0x2223f6[_0x9585('0x29')],'_c')?!![]:![],'options':_0x2223f6[_0x9585('0x3f')]?_[_0x9585('0x2f')](_[_0x9585('0x73')](_0x2223f6[_0x9585('0x3f')]),function(_0x16e178){return{'name':_0x16e178[_0x9585('0x74')],'value':_0x16e178[_0x9585('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x15c45a,null))[_0x9585('0x4a')](function(_0x20eca6){var _0x4fc1b8=_0x1207c0['query'][_0x9585('0x75')]?0x1f4:_0x20eca6['statusCode']||0x1f4;logger['error'](_0x9585('0x76'),_0x9585('0x77'),_0x4fc1b8,JSON[_0x9585('0x67')](_0x20eca6));delete _0x20eca6['name'];if(_0x4fc1b8===0x191){_0x4fc1b8=0x190;}_0x15c45a[_0x9585('0x1b')](_0x4fc1b8)['send'](_0x1207c0[_0x9585('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x20eca6['statusCode']}:_0x20eca6);});}else{var _0x4a271e=0x1f4;_0x15c45a[_0x9585('0x1b')](_0x4a271e)[_0x9585('0x2a')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x05d0=['json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','filter','options','SugarcrmAccount','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','hasOwnProperty','channel','getDescriptions','Subjects','SugarcrmField','Descriptions','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','/service/v4_1/rest.php','login','JSON','stringify','password','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','format','%s%s','get_module_fields','Calls','values','module_fields','includes','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x299784,_0xb0918f){var _0x5ab008=function(_0x49c1f5){while(--_0x49c1f5){_0x299784['push'](_0x299784['shift']());}};_0x5ab008(++_0xb0918f);}(_0x05d0,0xcc));var _0x005d=function(_0x1f22b1,_0x1f40e0){_0x1f22b1=_0x1f22b1-0x0;var _0x55a497=_0x05d0[_0x1f22b1];return _0x55a497;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x005d('0x0'));var zipdir=require(_0x005d('0x1'));var jsonpatch=require(_0x005d('0x2'));var rp=require(_0x005d('0x3'));var moment=require('moment');var BPromise=require(_0x005d('0x4'));var Mustache=require(_0x005d('0x5'));var util=require(_0x005d('0x6'));var path=require(_0x005d('0x7'));var sox=require(_0x005d('0x8'));var csv=require(_0x005d('0x9'));var ejs=require(_0x005d('0xa'));var fs=require('fs');var fs_extra=require(_0x005d('0xb'));var _=require(_0x005d('0xc'));var squel=require(_0x005d('0xd'));var crypto=require(_0x005d('0xe'));var jsforce=require(_0x005d('0xf'));var deskjs=require(_0x005d('0x10'));var toCsv=require(_0x005d('0x9'));var querystring=require(_0x005d('0x11'));var Papa=require(_0x005d('0x12'));var Redis=require('ioredis');var authService=require(_0x005d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x005d('0x14'));var logger=require(_0x005d('0x15'))('api');var utils=require(_0x005d('0x16'));var config=require(_0x005d('0x17'));var licenseUtil=require(_0x005d('0x18'));var db=require(_0x005d('0x19'))['db'];var integrations=require(_0x005d('0x1a'));function respondWithStatusCode(_0x4411bf,_0x1c9608){_0x1c9608=_0x1c9608||0xcc;return function(_0x4b93db){if(_0x4b93db){return _0x4411bf[_0x005d('0x1b')](_0x1c9608);}return _0x4411bf[_0x005d('0x1c')](_0x1c9608)[_0x005d('0x1d')]();};}function respondWithResult(_0x5c8a82,_0x20147d){_0x20147d=_0x20147d||0xc8;return function(_0x408287){if(_0x408287){return _0x5c8a82[_0x005d('0x1c')](_0x20147d)['json'](_0x408287);}};}function respondWithFilteredResult(_0x2af86c,_0x3683d9){return function(_0x3f0968){if(_0x3f0968){var _0x43cfe1=typeof _0x3683d9[_0x005d('0x1e')]===_0x005d('0x1f')&&typeof _0x3683d9[_0x005d('0x20')]===_0x005d('0x1f');var _0x13493a=_0x3f0968[_0x005d('0x21')];var _0x48d5cd=_0x43cfe1?0x0:_0x3683d9[_0x005d('0x1e')];var _0x40ffa7=_0x43cfe1?_0x3f0968[_0x005d('0x21')]:_0x3683d9[_0x005d('0x1e')]+_0x3683d9[_0x005d('0x20')];var _0x2d3505;if(_0x40ffa7>=_0x13493a){_0x40ffa7=_0x13493a;_0x2d3505=0xc8;}else{_0x2d3505=0xce;}_0x2af86c['status'](_0x2d3505);return _0x2af86c[_0x005d('0x22')](_0x005d('0x23'),_0x48d5cd+'-'+_0x40ffa7+'/'+_0x13493a)[_0x005d('0x24')](_0x3f0968);}return null;};}function patchUpdates(_0x3aef3c){return function(_0x5aa04c){try{jsonpatch[_0x005d('0x25')](_0x5aa04c,_0x3aef3c,!![]);}catch(_0x3e82cc){return BPromise[_0x005d('0x26')](_0x3e82cc);}return _0x5aa04c[_0x005d('0x27')]();};}function saveUpdates(_0x5a9869,_0x130f97){return function(_0x4996ae){if(_0x4996ae){return _0x4996ae[_0x005d('0x28')](_0x5a9869)[_0x005d('0x29')](function(_0x3f99ca){return _0x3f99ca;});}return null;};}function removeEntity(_0x34f58b,_0x2a7e1b){return function(_0x5d8a70){if(_0x5d8a70){return _0x5d8a70[_0x005d('0x2a')]()[_0x005d('0x29')](function(){_0x34f58b[_0x005d('0x1c')](0xcc)[_0x005d('0x1d')]();});}};}function handleEntityNotFound(_0x28cf28,_0x3a25ea){return function(_0x1ab0fc){if(!_0x1ab0fc){_0x28cf28['sendStatus'](0x194);}return _0x1ab0fc;};}function handleError(_0x53ded2,_0x10a896){_0x10a896=_0x10a896||0x1f4;return function(_0xe3dea6){logger[_0x005d('0x2b')](_0xe3dea6[_0x005d('0x2c')]);if(_0xe3dea6[_0x005d('0x2d')]){delete _0xe3dea6[_0x005d('0x2d')];}_0x53ded2[_0x005d('0x1c')](_0x10a896)[_0x005d('0x2e')](_0xe3dea6);};}exports[_0x005d('0x2f')]=function(_0x304fde,_0x4a44bc){var _0x51b50f={},_0x5b744f={},_0x354137={'count':0x0,'rows':[]};var _0x2c0b03=_[_0x005d('0x30')](db['SugarcrmAccount']['rawAttributes'],function(_0x20d04a){return{'name':_0x20d04a[_0x005d('0x31')],'type':_0x20d04a[_0x005d('0x32')]['key']};});_0x5b744f[_0x005d('0x33')]=_[_0x005d('0x30')](_0x2c0b03,_0x005d('0x2d'));_0x5b744f[_0x005d('0x34')]=_[_0x005d('0x35')](_0x304fde['query']);_0x5b744f[_0x005d('0x36')]=_[_0x005d('0x37')](_0x5b744f[_0x005d('0x33')],_0x5b744f[_0x005d('0x34')]);_0x51b50f[_0x005d('0x38')]=_[_0x005d('0x37')](_0x5b744f[_0x005d('0x33')],qs[_0x005d('0x39')](_0x304fde[_0x005d('0x34')][_0x005d('0x39')]));_0x51b50f[_0x005d('0x38')]=_0x51b50f[_0x005d('0x38')][_0x005d('0x3a')]?_0x51b50f['attributes']:_0x5b744f[_0x005d('0x33')];if(!_0x304fde[_0x005d('0x34')]['hasOwnProperty'](_0x005d('0x3b'))){_0x51b50f[_0x005d('0x20')]=qs[_0x005d('0x20')](_0x304fde[_0x005d('0x34')][_0x005d('0x20')]);_0x51b50f[_0x005d('0x1e')]=qs['offset'](_0x304fde['query'][_0x005d('0x1e')]);}_0x51b50f['order']=qs[_0x005d('0x3c')](_0x304fde['query']['sort']);_0x51b50f[_0x005d('0x3d')]=qs[_0x005d('0x36')](_[_0x005d('0x3e')](_0x304fde['query'],_0x5b744f[_0x005d('0x36')]),_0x2c0b03);if(_0x304fde[_0x005d('0x34')]['filter']){_0x51b50f[_0x005d('0x3d')]=_[_0x005d('0x3f')](_0x51b50f[_0x005d('0x3d')],{'$or':_[_0x005d('0x30')](_0x2c0b03,function(_0x3dbc83){if(_0x3dbc83[_0x005d('0x32')]!=='VIRTUAL'){var _0xf599fe={};_0xf599fe[_0x3dbc83[_0x005d('0x2d')]]={'$like':'%'+_0x304fde['query'][_0x005d('0x40')]+'%'};return _0xf599fe;}})});}_0x51b50f=_['merge']({},_0x51b50f,_0x304fde[_0x005d('0x41')]);var _0x3a04b9={'where':_0x51b50f[_0x005d('0x3d')]};return db['SugarcrmAccount']['count'](_0x3a04b9)[_0x005d('0x29')](function(_0x29726f){_0x354137[_0x005d('0x21')]=_0x29726f;if(_0x304fde[_0x005d('0x34')]['includeAll']){_0x51b50f['include']=[{'all':!![]}];}return db[_0x005d('0x42')]['findAll'](_0x51b50f);})[_0x005d('0x29')](function(_0x31b418){_0x354137[_0x005d('0x43')]=_0x31b418;return _0x354137;})['then'](respondWithFilteredResult(_0x4a44bc,_0x51b50f))[_0x005d('0x44')](handleError(_0x4a44bc,null));};exports[_0x005d('0x45')]=function(_0x455221,_0x1a2f52){var _0x4c55fa={'raw':![],'where':{'id':_0x455221[_0x005d('0x46')]['id']}},_0xe3d219={};_0xe3d219[_0x005d('0x33')]=_[_0x005d('0x35')](db[_0x005d('0x42')][_0x005d('0x47')]);_0xe3d219[_0x005d('0x34')]=_[_0x005d('0x35')](_0x455221[_0x005d('0x34')]);_0xe3d219[_0x005d('0x36')]=_['intersection'](_0xe3d219['model'],_0xe3d219[_0x005d('0x34')]);_0x4c55fa[_0x005d('0x38')]=_['intersection'](_0xe3d219[_0x005d('0x33')],qs[_0x005d('0x39')](_0x455221[_0x005d('0x34')][_0x005d('0x39')]));_0x4c55fa[_0x005d('0x38')]=_0x4c55fa[_0x005d('0x38')]['length']?_0x4c55fa[_0x005d('0x38')]:_0xe3d219[_0x005d('0x33')];if(_0x455221[_0x005d('0x34')][_0x005d('0x48')]){_0x4c55fa['include']=[{'all':!![]}];}_0x4c55fa=_['merge']({},_0x4c55fa,_0x455221[_0x005d('0x41')]);return db['SugarcrmAccount'][_0x005d('0x49')](_0x4c55fa)['then'](handleEntityNotFound(_0x1a2f52,null))[_0x005d('0x29')](respondWithResult(_0x1a2f52,null))[_0x005d('0x44')](handleError(_0x1a2f52,null));};exports['create']=function(_0x22f87b,_0x1f2529){return db['SugarcrmAccount'][_0x005d('0x4a')](_0x22f87b['body'],{})[_0x005d('0x29')](respondWithResult(_0x1f2529,0xc9))[_0x005d('0x44')](handleError(_0x1f2529,null));};exports[_0x005d('0x28')]=function(_0x36e626,_0x542421){if(_0x36e626[_0x005d('0x4b')]['id']){delete _0x36e626[_0x005d('0x4b')]['id'];}return db[_0x005d('0x42')]['find']({'where':{'id':_0x36e626[_0x005d('0x46')]['id']}})[_0x005d('0x29')](handleEntityNotFound(_0x542421,null))[_0x005d('0x29')](saveUpdates(_0x36e626[_0x005d('0x4b')],null))[_0x005d('0x29')](respondWithResult(_0x542421,null))['catch'](handleError(_0x542421,null));};exports['destroy']=function(_0x56a2b7,_0x127c51){return db[_0x005d('0x42')]['find']({'where':{'id':_0x56a2b7[_0x005d('0x46')]['id']}})['then'](handleEntityNotFound(_0x127c51,null))[_0x005d('0x29')](removeEntity(_0x127c51,null))[_0x005d('0x44')](handleError(_0x127c51,null));};exports[_0x005d('0x4c')]=function(_0x39576c,_0x11a41a,_0x4a7d49){var _0x4c5742={};var _0x3e4798={};var _0x5ba89;var _0x2e2b04;return db[_0x005d('0x42')][_0x005d('0x4d')]({'where':{'id':_0x39576c[_0x005d('0x46')]['id']}})[_0x005d('0x29')](handleEntityNotFound(_0x11a41a,null))[_0x005d('0x29')](function(_0x1a9955){if(_0x1a9955){_0x5ba89=_0x1a9955;_0x3e4798[_0x005d('0x33')]=_[_0x005d('0x35')](db[_0x005d('0x4e')][_0x005d('0x47')]);_0x3e4798[_0x005d('0x34')]=_['keys'](_0x39576c[_0x005d('0x34')]);_0x3e4798[_0x005d('0x36')]=_[_0x005d('0x37')](_0x3e4798[_0x005d('0x33')],_0x3e4798['query']);_0x4c5742['attributes']=_[_0x005d('0x37')](_0x3e4798[_0x005d('0x33')],qs[_0x005d('0x39')](_0x39576c[_0x005d('0x34')][_0x005d('0x39')]));_0x4c5742[_0x005d('0x38')]=_0x4c5742[_0x005d('0x38')][_0x005d('0x3a')]?_0x4c5742[_0x005d('0x38')]:_0x3e4798[_0x005d('0x33')];_0x4c5742[_0x005d('0x4f')]=qs[_0x005d('0x3c')](_0x39576c['query'][_0x005d('0x3c')]);_0x4c5742[_0x005d('0x3d')]=qs['filters'](_['pick'](_0x39576c[_0x005d('0x34')],_0x3e4798['filters']));if(_0x39576c['query'][_0x005d('0x40')]){_0x4c5742[_0x005d('0x3d')]=_['merge'](_0x4c5742[_0x005d('0x3d')],{'$or':_['map'](_0x4c5742[_0x005d('0x38')],function(_0x4d128a){var _0x4c659b={};_0x4c659b[_0x4d128a]={'$like':'%'+_0x39576c[_0x005d('0x34')][_0x005d('0x40')]+'%'};return _0x4c659b;})});}_0x4c5742=_[_0x005d('0x3f')]({},_0x4c5742,_0x39576c[_0x005d('0x41')]);return _0x5ba89['getConfigurations'](_0x4c5742);}})[_0x005d('0x29')](function(_0xb73bef){if(_0xb73bef){_0x2e2b04=_0xb73bef[_0x005d('0x3a')];if(!_0x39576c[_0x005d('0x34')][_0x005d('0x50')](_0x005d('0x3b'))){_0x4c5742['limit']=qs[_0x005d('0x20')](_0x39576c['query'][_0x005d('0x20')]);_0x4c5742[_0x005d('0x1e')]=qs[_0x005d('0x1e')](_0x39576c[_0x005d('0x34')][_0x005d('0x1e')]);}return _0x5ba89['getConfigurations'](_0x4c5742);}})[_0x005d('0x29')](function(_0x19d904){if(_0x19d904){return _0x19d904?{'count':_0x2e2b04,'rows':_0x19d904}:null;}})['then'](respondWithResult(_0x11a41a,null))[_0x005d('0x44')](handleError(_0x11a41a,null));};exports['addConfiguration']=function(_0x2a63cf,_0x3c5903,_0x1d5ff0){if(_0x2a63cf[_0x005d('0x4b')]['id']){delete _0x2a63cf[_0x005d('0x4b')]['id'];}return db[_0x005d('0x42')][_0x005d('0x4d')]({'where':{'id':_0x2a63cf[_0x005d('0x46')]['id']}})[_0x005d('0x29')](handleEntityNotFound(_0x3c5903,null))[_0x005d('0x29')](function(_0x494fb5){if(_0x494fb5){_0x2a63cf['body']['AccountId']=_0x494fb5['id'];_0x2a63cf['body']['Subjects']=integrations['getSubjects'](_0x2a63cf['body'][_0x005d('0x51')],_0x2a63cf[_0x005d('0x4b')]['type']);_0x2a63cf[_0x005d('0x4b')]['Descriptions']=integrations[_0x005d('0x52')](_0x2a63cf[_0x005d('0x4b')][_0x005d('0x51')],_0x2a63cf[_0x005d('0x4b')]['type']);return db[_0x005d('0x4e')][_0x005d('0x4a')](_0x2a63cf[_0x005d('0x4b')],{'include':[{'model':db['SugarcrmField'],'as':_0x005d('0x53')},{'model':db[_0x005d('0x54')],'as':_0x005d('0x55')}]});}return null;})[_0x005d('0x29')](respondWithResult(_0x3c5903,null))[_0x005d('0x44')](handleError(_0x3c5903,null));};exports[_0x005d('0x56')]=function(_0x4c3f1d,_0x23adc4,_0x12400c){var _0x4d29e4='';var _0x4a86b2=['id','name',_0x005d('0x57'),'created_by',_0x005d('0x58'),'date_start',_0x005d('0x59'),_0x005d('0x5a'),_0x005d('0x5b'),_0x005d('0x5c'),_0x005d('0x5d'),_0x005d('0x5e')];return db['SugarcrmAccount'][_0x005d('0x4d')]({'where':{'id':_0x4c3f1d[_0x005d('0x46')]['id']},'attributes':['id',_0x005d('0x5f'),'password',_0x005d('0x60')]})['then'](handleEntityNotFound(_0x23adc4,null))[_0x005d('0x29')](function(_0x16a830){if(_0x16a830){_0x4d29e4=_0x16a830[_0x005d('0x60')];var _0x50e188=_0x4d29e4[_0x005d('0x61')](-0x1);if(_0x50e188==='/'){_0x4d29e4=_0x4d29e4[_0x005d('0x62')](0x0,_0x4d29e4[_0x005d('0x63')](_0x50e188));}return rp({'method':'POST','uri':util['format']('%s%s',_0x4d29e4,_0x005d('0x64')),'json':!![],'form':{'method':_0x005d('0x65'),'input_type':'JSON','response_type':_0x005d('0x66'),'rest_data':JSON[_0x005d('0x67')]({'user_auth':{'user_name':_0x16a830[_0x005d('0x5f')],'password':_0x16a830[_0x005d('0x68')],'encryption':'PLAIN'},'application':_0x005d('0x69')})}});}})[_0x005d('0x29')](function(_0x150ff7){if(_0x150ff7&&_0x150ff7[_0x005d('0x2d')]!=='Invalid\x20Login'&&_0x150ff7['name']!==_0x005d('0x6a')){return rp({'method':_0x005d('0x6b'),'uri':util[_0x005d('0x6c')](_0x005d('0x6d'),_0x4d29e4,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x005d('0x6e'),'input_type':'JSON','response_type':_0x005d('0x66'),'rest_data':JSON[_0x005d('0x67')]({'session':_0x150ff7['id'],'module_name':_0x005d('0x6f')})}})[_0x005d('0x29')](function(_0x30174c){if(_0x30174c){var _0x3435a9=_[_0x005d('0x70')](_0x30174c[_0x005d('0x71')]);_['remove'](_0x3435a9,function(_0x329e58){return _0x4a86b2[_0x005d('0x72')](_0x329e58['name']);});return{'count':_0x3435a9[_0x005d('0x3a')],'rows':_[_0x005d('0x30')](_0x3435a9,function(_0x53dbcc){return{'id':_0x53dbcc[_0x005d('0x2d')],'name':_0x53dbcc['label'],'custom':_[_0x005d('0x73')](_0x53dbcc[_0x005d('0x2d')],'_c')?!![]:![],'options':_0x53dbcc['options']?_[_0x005d('0x30')](_[_0x005d('0x70')](_0x53dbcc[_0x005d('0x41')]),function(_0x5ec475){return{'name':_0x5ec475['value'],'value':_0x5ec475[_0x005d('0x2d')]};}):[]};})};}})[_0x005d('0x29')](respondWithResult(_0x23adc4,null))[_0x005d('0x44')](function(_0x171c0b){var _0x17a861=_0x4c3f1d[_0x005d('0x34')][_0x005d('0x74')]?0x1f4:_0x171c0b[_0x005d('0x75')]||0x1f4;logger['error'](_0x005d('0x76'),'getFields',_0x17a861,JSON['stringify'](_0x171c0b));delete _0x171c0b[_0x005d('0x2d')];if(_0x17a861===0x191){_0x17a861=0x190;}_0x23adc4[_0x005d('0x1c')](_0x17a861)[_0x005d('0x2e')](_0x4c3f1d['query']['test']?{'message':_0x005d('0x77'),'statusCode':_0x171c0b['statusCode']}:_0x171c0b);});}else{var _0x453254=0x1f4;_0x23adc4[_0x005d('0x1c')](_0x453254)[_0x005d('0x2e')]({'message':_0x005d('0x77'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 177fe3a..1d8b080 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe201=['exports','define','SugarcrmAccount','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0x153e1b,_0xae0db6){var _0x3a9a0a=function(_0x4d1916){while(--_0x4d1916){_0x153e1b['push'](_0x153e1b['shift']());}};_0x3a9a0a(++_0xae0db6);}(_0xe201,0x1f1));var _0x1e20=function(_0x47d0b3,_0x577628){_0x47d0b3=_0x47d0b3-0x0;var _0x4f3aa3=_0xe201[_0x47d0b3];return _0x4f3aa3;};'use strict';var _=require(_0x1e20('0x0'));var util=require(_0x1e20('0x1'));var logger=require(_0x1e20('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1e20('0x3'));var rp=require(_0x1e20('0x4'));var fs=require('fs');var path=require(_0x1e20('0x5'));var rimraf=require(_0x1e20('0x6'));var config=require(_0x1e20('0x7'));var attributes=require(_0x1e20('0x8'));var integrations=require(_0x1e20('0x9'));module[_0x1e20('0xa')]=function(_0x2c2563,_0x3a0348){return _0x2c2563[_0x1e20('0xb')](_0x1e20('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb995=['request-promise','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0xb995,0xe4));var _0x5b99=function(_0x2ab12e,_0x24270d){_0x2ab12e=_0x2ab12e-0x0;var _0x44500c=_0xb995[_0x2ab12e];return _0x44500c;};'use strict';var _=require('lodash');var util=require(_0x5b99('0x0'));var logger=require(_0x5b99('0x1'))(_0x5b99('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5b99('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5b99('0x4'));var attributes=require(_0x5b99('0x5'));var integrations=require(_0x5b99('0x6'));module[_0x5b99('0x7')]=function(_0x500ffe,_0x495115){return _0x500ffe[_0x5b99('0x8')](_0x5b99('0x9'),attributes,{'tableName':_0x5b99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index dd1d640..6f6e19b 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b69=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','SugarcrmAccount','findAll','options','where','map','include','attributes','model','GetSugarcrmAccount','catch','ShowSugarcrmAccount','find','raw'];(function(_0xf7828b,_0x570412){var _0x5e8a6f=function(_0x3629be){while(--_0x3629be){_0xf7828b['push'](_0xf7828b['shift']());}};_0x5e8a6f(++_0x570412);}(_0x9b69,0x1ef));var _0x99b6=function(_0x14fcdd,_0x5430a1){_0x14fcdd=_0x14fcdd-0x0;var _0x17e63a=_0x9b69[_0x14fcdd];return _0x17e63a;};'use strict';var _=require('lodash');var util=require(_0x99b6('0x0'));var moment=require(_0x99b6('0x1'));var BPromise=require('bluebird');var rs=require(_0x99b6('0x2'));var fs=require('fs');var Redis=require(_0x99b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x99b6('0x4'));var logger=require(_0x99b6('0x5'))(_0x99b6('0x6'));var config=require(_0x99b6('0x7'));var jayson=require(_0x99b6('0x8'));var client=jayson['client'][_0x99b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42de58,_0x50889e,_0x5607f7){return new BPromise(function(_0x340f2f,_0x415398){return client['request'](_0x42de58,_0x5607f7)[_0x99b6('0xa')](function(_0x287aed){logger[_0x99b6('0xb')](_0x99b6('0xc'),_0x50889e,'request\x20sent');logger[_0x99b6('0xd')](_0x99b6('0xe'),_0x50889e,_0x99b6('0xf'),JSON[_0x99b6('0x10')](_0x287aed));if(_0x287aed[_0x99b6('0x11')]){if(_0x287aed[_0x99b6('0x11')]['code']===0x1f4){logger[_0x99b6('0x11')](_0x99b6('0xc'),_0x50889e,_0x287aed['error'][_0x99b6('0x12')]);return _0x415398(_0x287aed['error'][_0x99b6('0x12')]);}logger['error'](_0x99b6('0xc'),_0x50889e,_0x287aed[_0x99b6('0x11')][_0x99b6('0x12')]);return _0x340f2f(_0x287aed[_0x99b6('0x11')][_0x99b6('0x12')]);}else{logger[_0x99b6('0xb')](_0x99b6('0xc'),_0x50889e,_0x99b6('0xf'));_0x340f2f(_0x287aed[_0x99b6('0x13')][_0x99b6('0x12')]);}})['catch'](function(_0xaceda5){logger[_0x99b6('0x11')](_0x99b6('0xc'),_0x50889e,_0xaceda5);_0x415398(_0xaceda5);});});}exports['GetSugarcrmAccount']=function(_0x1c3433){var _0x3d41e4=this;return new Promise(function(_0x1cc49b,_0x2bd3aa){return db[_0x99b6('0x14')][_0x99b6('0x15')]({'raw':_0x1c3433[_0x99b6('0x16')]?_0x1c3433[_0x99b6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1c3433[_0x99b6('0x16')]?_0x1c3433['options'][_0x99b6('0x17')]||null:null,'attributes':_0x1c3433[_0x99b6('0x16')]?_0x1c3433[_0x99b6('0x16')]['attributes']||null:null,'limit':_0x1c3433['options']?_0x1c3433[_0x99b6('0x16')]['limit']||null:null,'include':_0x1c3433[_0x99b6('0x16')]?_0x1c3433[_0x99b6('0x16')]['include']?_[_0x99b6('0x18')](_0x1c3433[_0x99b6('0x16')][_0x99b6('0x19')],function(_0x1599a0){return{'model':db[_0x1599a0['model']],'as':_0x1599a0['as'],'attributes':_0x1599a0[_0x99b6('0x1a')],'include':_0x1599a0[_0x99b6('0x19')]?_[_0x99b6('0x18')](_0x1599a0[_0x99b6('0x19')],function(_0x2b52cd){return{'model':db[_0x2b52cd[_0x99b6('0x1b')]],'as':_0x2b52cd['as'],'attributes':_0x2b52cd[_0x99b6('0x1a')],'include':_0x2b52cd['include']?_[_0x99b6('0x18')](_0x2b52cd[_0x99b6('0x19')],function(_0x174ea5){return{'model':db[_0x174ea5[_0x99b6('0x1b')]],'as':_0x174ea5['as'],'attributes':_0x174ea5['attributes']};}):[]};}):[]};}):[]:[]})[_0x99b6('0xa')](function(_0xeae363){logger['info'](_0x99b6('0x1c'),_0x1c3433);logger[_0x99b6('0xd')](_0x99b6('0x1c'),_0x1c3433,JSON[_0x99b6('0x10')](_0xeae363));_0x1cc49b(_0xeae363);})[_0x99b6('0x1d')](function(_0x2dc98e){logger[_0x99b6('0x11')](_0x99b6('0x1c'),_0x2dc98e[_0x99b6('0x12')],_0x1c3433);_0x2bd3aa(_0x3d41e4[_0x99b6('0x11')](0x1f4,_0x2dc98e[_0x99b6('0x12')]));});});};exports[_0x99b6('0x1e')]=function(_0x2499a9){var _0x58f9e8=this;return new Promise(function(_0xdef83e,_0x2b006b){return db[_0x99b6('0x14')][_0x99b6('0x1f')]({'raw':_0x2499a9['options']?_0x2499a9[_0x99b6('0x16')][_0x99b6('0x20')]===undefined?!![]:![]:!![],'where':_0x2499a9[_0x99b6('0x16')]?_0x2499a9[_0x99b6('0x16')][_0x99b6('0x17')]||null:null,'attributes':_0x2499a9[_0x99b6('0x16')]?_0x2499a9['options']['attributes']||null:null,'include':_0x2499a9['options']?_0x2499a9['options'][_0x99b6('0x19')]?_[_0x99b6('0x18')](_0x2499a9[_0x99b6('0x16')]['include'],function(_0x3f6054){return{'model':db[_0x3f6054[_0x99b6('0x1b')]],'as':_0x3f6054['as'],'attributes':_0x3f6054[_0x99b6('0x1a')],'include':_0x3f6054[_0x99b6('0x19')]?_['map'](_0x3f6054['include'],function(_0xb8735e){return{'model':db[_0xb8735e[_0x99b6('0x1b')]],'as':_0xb8735e['as'],'attributes':_0xb8735e[_0x99b6('0x1a')],'include':_0xb8735e[_0x99b6('0x19')]?_[_0x99b6('0x18')](_0xb8735e[_0x99b6('0x19')],function(_0x4ecf07){return{'model':db[_0x4ecf07['model']],'as':_0x4ecf07['as'],'attributes':_0x4ecf07[_0x99b6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c9424){logger[_0x99b6('0xb')]('ShowSugarcrmAccount',_0x2499a9);logger[_0x99b6('0xd')](_0x99b6('0x1e'),_0x2499a9,JSON[_0x99b6('0x10')](_0x1c9424));_0xdef83e(_0x1c9424);})[_0x99b6('0x1d')](function(_0x38384d){logger[_0x99b6('0x11')](_0x99b6('0x1e'),_0x38384d[_0x99b6('0x12')],_0x2499a9);_0x2b006b(_0x58f9e8[_0x99b6('0x11')](0x1f4,_0x38384d['message']));});});}; \ No newline at end of file +var _0x4a27=['stringify','catch','ShowSugarcrmAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','include','map','model','attributes'];(function(_0x1d3d57,_0x213f3a){var _0x7d9691=function(_0x2b7f3f){while(--_0x2b7f3f){_0x1d3d57['push'](_0x1d3d57['shift']());}};_0x7d9691(++_0x213f3a);}(_0x4a27,0x1f2));var _0x74a2=function(_0x5d27c3,_0x5ac158){_0x5d27c3=_0x5d27c3-0x0;var _0xed73f8=_0x4a27[_0x5d27c3];return _0xed73f8;};'use strict';var _=require('lodash');var util=require(_0x74a2('0x0'));var moment=require(_0x74a2('0x1'));var BPromise=require(_0x74a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74a2('0x3'));var db=require(_0x74a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x74a2('0x5'))('rpc');var config=require(_0x74a2('0x6'));var jayson=require(_0x74a2('0x7'));var client=jayson[_0x74a2('0x8')][_0x74a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10e8d9,_0x37bd27,_0x50bb7c){return new BPromise(function(_0x585607,_0x4a469f){return client[_0x74a2('0xa')](_0x10e8d9,_0x50bb7c)[_0x74a2('0xb')](function(_0x4f601d){logger[_0x74a2('0xc')](_0x74a2('0xd'),_0x37bd27,_0x74a2('0xe'));logger[_0x74a2('0xf')](_0x74a2('0x10'),_0x37bd27,_0x74a2('0xe'),JSON['stringify'](_0x4f601d));if(_0x4f601d[_0x74a2('0x11')]){if(_0x4f601d[_0x74a2('0x11')]['code']===0x1f4){logger[_0x74a2('0x11')](_0x74a2('0xd'),_0x37bd27,_0x4f601d['error'][_0x74a2('0x12')]);return _0x4a469f(_0x4f601d[_0x74a2('0x11')][_0x74a2('0x12')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x37bd27,_0x4f601d[_0x74a2('0x11')][_0x74a2('0x12')]);return _0x585607(_0x4f601d[_0x74a2('0x11')][_0x74a2('0x12')]);}else{logger[_0x74a2('0xc')](_0x74a2('0xd'),_0x37bd27,_0x74a2('0xe'));_0x585607(_0x4f601d[_0x74a2('0x13')][_0x74a2('0x12')]);}})['catch'](function(_0x1e3d83){logger[_0x74a2('0x11')](_0x74a2('0xd'),_0x37bd27,_0x1e3d83);_0x4a469f(_0x1e3d83);});});}exports[_0x74a2('0x14')]=function(_0x3cfe92){var _0x4912df=this;return new Promise(function(_0x2a790f,_0x3fccd0){return db[_0x74a2('0x15')][_0x74a2('0x16')]({'raw':_0x3cfe92[_0x74a2('0x17')]?_0x3cfe92[_0x74a2('0x17')][_0x74a2('0x18')]===undefined?!![]:![]:!![],'where':_0x3cfe92[_0x74a2('0x17')]?_0x3cfe92[_0x74a2('0x17')][_0x74a2('0x19')]||null:null,'attributes':_0x3cfe92[_0x74a2('0x17')]?_0x3cfe92[_0x74a2('0x17')]['attributes']||null:null,'limit':_0x3cfe92['options']?_0x3cfe92[_0x74a2('0x17')]['limit']||null:null,'include':_0x3cfe92['options']?_0x3cfe92[_0x74a2('0x17')][_0x74a2('0x1a')]?_[_0x74a2('0x1b')](_0x3cfe92[_0x74a2('0x17')][_0x74a2('0x1a')],function(_0x2536fb){return{'model':db[_0x2536fb[_0x74a2('0x1c')]],'as':_0x2536fb['as'],'attributes':_0x2536fb['attributes'],'include':_0x2536fb[_0x74a2('0x1a')]?_[_0x74a2('0x1b')](_0x2536fb['include'],function(_0x5a8aa4){return{'model':db[_0x5a8aa4['model']],'as':_0x5a8aa4['as'],'attributes':_0x5a8aa4['attributes'],'include':_0x5a8aa4[_0x74a2('0x1a')]?_[_0x74a2('0x1b')](_0x5a8aa4[_0x74a2('0x1a')],function(_0x19ccfb){return{'model':db[_0x19ccfb[_0x74a2('0x1c')]],'as':_0x19ccfb['as'],'attributes':_0x19ccfb[_0x74a2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x74a2('0xb')](function(_0x3ce0b0){logger['info']('GetSugarcrmAccount',_0x3cfe92);logger['debug'](_0x74a2('0x14'),_0x3cfe92,JSON[_0x74a2('0x1e')](_0x3ce0b0));_0x2a790f(_0x3ce0b0);})[_0x74a2('0x1f')](function(_0x1c4f66){logger[_0x74a2('0x11')](_0x74a2('0x14'),_0x1c4f66['message'],_0x3cfe92);_0x3fccd0(_0x4912df[_0x74a2('0x11')](0x1f4,_0x1c4f66['message']));});});};exports[_0x74a2('0x20')]=function(_0x144070){var _0x39fe00=this;return new Promise(function(_0x35140c,_0x52a254){return db[_0x74a2('0x15')]['find']({'raw':_0x144070[_0x74a2('0x17')]?_0x144070[_0x74a2('0x17')][_0x74a2('0x18')]===undefined?!![]:![]:!![],'where':_0x144070[_0x74a2('0x17')]?_0x144070[_0x74a2('0x17')][_0x74a2('0x19')]||null:null,'attributes':_0x144070[_0x74a2('0x17')]?_0x144070['options'][_0x74a2('0x1d')]||null:null,'include':_0x144070[_0x74a2('0x17')]?_0x144070[_0x74a2('0x17')][_0x74a2('0x1a')]?_[_0x74a2('0x1b')](_0x144070[_0x74a2('0x17')]['include'],function(_0xd7a811){return{'model':db[_0xd7a811['model']],'as':_0xd7a811['as'],'attributes':_0xd7a811['attributes'],'include':_0xd7a811[_0x74a2('0x1a')]?_['map'](_0xd7a811[_0x74a2('0x1a')],function(_0x3b8e1b){return{'model':db[_0x3b8e1b['model']],'as':_0x3b8e1b['as'],'attributes':_0x3b8e1b[_0x74a2('0x1d')],'include':_0x3b8e1b[_0x74a2('0x1a')]?_[_0x74a2('0x1b')](_0x3b8e1b[_0x74a2('0x1a')],function(_0xca7a){return{'model':db[_0xca7a['model']],'as':_0xca7a['as'],'attributes':_0xca7a['attributes']};}):[]};}):[]};}):[]:[]})[_0x74a2('0xb')](function(_0x113ce7){logger[_0x74a2('0xc')](_0x74a2('0x20'),_0x144070);logger[_0x74a2('0xf')]('ShowSugarcrmAccount',_0x144070,JSON['stringify'](_0x113ce7));_0x35140c(_0x113ce7);})[_0x74a2('0x1f')](function(_0x5340e7){logger[_0x74a2('0x11')](_0x74a2('0x20'),_0x5340e7[_0x74a2('0x12')],_0x144070);_0x52a254(_0x39fe00['error'](0x1f4,_0x5340e7[_0x74a2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 25319ac..28f6e3e 100644 --- a/server/api/intSugarcrmConfiguration/index.js +++ b/server/api/intSugarcrmConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e46=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9e46,0x123));var _0x69e4=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9e46[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x69e4('0x0'));var util=require(_0x69e4('0x1'));var path=require(_0x69e4('0x2'));var timeout=require(_0x69e4('0x3'));var express=require(_0x69e4('0x4'));var router=express[_0x69e4('0x5')]();var fs_extra=require(_0x69e4('0x6'));var auth=require(_0x69e4('0x7'));var interaction=require(_0x69e4('0x8'));var config=require(_0x69e4('0x9'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x69e4('0xa')]('/',auth[_0x69e4('0xb')](),controller[_0x69e4('0xc')]);router['get'](_0x69e4('0xd'),auth[_0x69e4('0xb')](),controller[_0x69e4('0xe')]);router['get'](_0x69e4('0xf'),auth[_0x69e4('0xb')](),controller[_0x69e4('0x10')]);router[_0x69e4('0xa')](_0x69e4('0x11'),auth[_0x69e4('0xb')](),controller['getSubjects']);router[_0x69e4('0xa')](_0x69e4('0x12'),auth[_0x69e4('0xb')](),controller['getDescriptions']);router['post']('/',auth[_0x69e4('0xb')](),controller[_0x69e4('0x13')]);router[_0x69e4('0x14')](_0x69e4('0xd'),auth[_0x69e4('0xb')](),controller[_0x69e4('0x15')]);router[_0x69e4('0x16')]('/:id',auth[_0x69e4('0xb')](),controller[_0x69e4('0x17')]);module[_0x69e4('0x18')]=router; \ No newline at end of file +var _0x1d68=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get'];(function(_0xe9b536,_0x261eec){var _0x351e80=function(_0x4b204a){while(--_0x4b204a){_0xe9b536['push'](_0xe9b536['shift']());}};_0x351e80(++_0x261eec);}(_0x1d68,0x144));var _0x81d6=function(_0x4ba105,_0xf97073){_0x4ba105=_0x4ba105-0x0;var _0x5eee7b=_0x1d68[_0x4ba105];return _0x5eee7b;};'use strict';var multer=require(_0x81d6('0x0'));var util=require(_0x81d6('0x1'));var path=require(_0x81d6('0x2'));var timeout=require(_0x81d6('0x3'));var express=require(_0x81d6('0x4'));var router=express[_0x81d6('0x5')]();var fs_extra=require(_0x81d6('0x6'));var auth=require(_0x81d6('0x7'));var interaction=require(_0x81d6('0x8'));var config=require(_0x81d6('0x9'));var controller=require(_0x81d6('0xa'));router['get']('/',auth[_0x81d6('0xb')](),controller[_0x81d6('0xc')]);router[_0x81d6('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x81d6('0xe')]);router[_0x81d6('0xd')](_0x81d6('0xf'),auth[_0x81d6('0xb')](),controller[_0x81d6('0x10')]);router[_0x81d6('0xd')](_0x81d6('0x11'),auth[_0x81d6('0xb')](),controller[_0x81d6('0x12')]);router[_0x81d6('0xd')](_0x81d6('0x13'),auth['isAuthenticated'](),controller[_0x81d6('0x14')]);router[_0x81d6('0x15')]('/',auth[_0x81d6('0xb')](),controller[_0x81d6('0x16')]);router['put'](_0x81d6('0x17'),auth[_0x81d6('0xb')](),controller['update']);router[_0x81d6('0x18')](_0x81d6('0x17'),auth[_0x81d6('0xb')](),controller[_0x81d6('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index af1810b..8eb4cec 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x898c=['STRING'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x898c,0x16f));var _0xc898=function(_0x113bc1,_0x200ad4){_0x113bc1=_0x113bc1-0x0;var _0x39abbe=_0x898c[_0x113bc1];return _0x39abbe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc898('0x0')]},'description':{'type':Sequelize[_0xc898('0x0')]}}; \ No newline at end of file +var _0x9640=['exports','STRING','sequelize'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x9640,0x1e8));var _0x0964=function(_0x11188d,_0x20035b){_0x11188d=_0x11188d-0x0;var _0x22666e=_0x9640[_0x11188d];return _0x22666e;};'use strict';var Sequelize=require(_0x0964('0x0'));module[_0x0964('0x1')]={'name':{'type':Sequelize[_0x0964('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 4d3a907..e0f3781 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cc5=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','findOne','SugarcrmField','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x4ffafb,_0x20171a){var _0x4ab472=function(_0x1afc75){while(--_0x1afc75){_0x4ffafb['push'](_0x4ffafb['shift']());}};_0x4ab472(++_0x20171a);}(_0x3cc5,0x1c1));var _0x53cc=function(_0x4cff77,_0xc9220e){_0x4cff77=_0x4cff77-0x0;var _0x1b2d88=_0x3cc5[_0x4cff77];return _0x1b2d88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53cc('0x0'));var zipdir=require(_0x53cc('0x1'));var jsonpatch=require(_0x53cc('0x2'));var rp=require(_0x53cc('0x3'));var moment=require(_0x53cc('0x4'));var BPromise=require(_0x53cc('0x5'));var Mustache=require('mustache');var util=require(_0x53cc('0x6'));var path=require(_0x53cc('0x7'));var sox=require('sox');var csv=require(_0x53cc('0x8'));var ejs=require(_0x53cc('0x9'));var fs=require('fs');var fs_extra=require(_0x53cc('0xa'));var _=require(_0x53cc('0xb'));var squel=require(_0x53cc('0xc'));var crypto=require(_0x53cc('0xd'));var jsforce=require(_0x53cc('0xe'));var deskjs=require(_0x53cc('0xf'));var toCsv=require(_0x53cc('0x8'));var querystring=require(_0x53cc('0x10'));var Papa=require(_0x53cc('0x11'));var Redis=require('ioredis');var authService=require(_0x53cc('0x12'));var qs=require(_0x53cc('0x13'));var as=require(_0x53cc('0x14'));var hardwareService=require(_0x53cc('0x15'));var logger=require(_0x53cc('0x16'))('api');var utils=require(_0x53cc('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x53cc('0x18'))['db'];function respondWithStatusCode(_0xf62478,_0x5a7ae3){_0x5a7ae3=_0x5a7ae3||0xcc;return function(_0x332e33){if(_0x332e33){return _0xf62478[_0x53cc('0x19')](_0x5a7ae3);}return _0xf62478[_0x53cc('0x1a')](_0x5a7ae3)[_0x53cc('0x1b')]();};}function respondWithResult(_0x21d971,_0x4533e9){_0x4533e9=_0x4533e9||0xc8;return function(_0x184a64){if(_0x184a64){return _0x21d971[_0x53cc('0x1a')](_0x4533e9)['json'](_0x184a64);}};}function respondWithFilteredResult(_0x267a61,_0x51d752){return function(_0x47c1cd){if(_0x47c1cd){var _0x3dc583=typeof _0x51d752[_0x53cc('0x1c')]===_0x53cc('0x1d')&&typeof _0x51d752[_0x53cc('0x1e')]===_0x53cc('0x1d');var _0x2c7afe=_0x47c1cd[_0x53cc('0x1f')];var _0x178a2e=_0x3dc583?0x0:_0x51d752['offset'];var _0x150196=_0x3dc583?_0x47c1cd['count']:_0x51d752['offset']+_0x51d752[_0x53cc('0x1e')];var _0x4ba0c4;if(_0x150196>=_0x2c7afe){_0x150196=_0x2c7afe;_0x4ba0c4=0xc8;}else{_0x4ba0c4=0xce;}_0x267a61['status'](_0x4ba0c4);return _0x267a61[_0x53cc('0x20')]('Content-Range',_0x178a2e+'-'+_0x150196+'/'+_0x2c7afe)[_0x53cc('0x21')](_0x47c1cd);}return null;};}function patchUpdates(_0x44f16d){return function(_0x37b541){try{jsonpatch[_0x53cc('0x22')](_0x37b541,_0x44f16d,!![]);}catch(_0x2b394f){return BPromise[_0x53cc('0x23')](_0x2b394f);}return _0x37b541[_0x53cc('0x24')]();};}function saveUpdates(_0x149c39,_0x31cdf0){return function(_0x5680c8){if(_0x5680c8){return _0x5680c8['update'](_0x149c39)['then'](function(_0x2c156a){return _0x2c156a;});}return null;};}function removeEntity(_0x405457,_0x2b9836){return function(_0x19aaf7){if(_0x19aaf7){return _0x19aaf7[_0x53cc('0x25')]()[_0x53cc('0x26')](function(){_0x405457[_0x53cc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eaf36,_0x1ba8b7){return function(_0x4cc729){if(!_0x4cc729){_0x4eaf36[_0x53cc('0x19')](0x194);}return _0x4cc729;};}function handleError(_0x23b4c0,_0x44e3a2){_0x44e3a2=_0x44e3a2||0x1f4;return function(_0x137dc2){logger[_0x53cc('0x27')](_0x137dc2[_0x53cc('0x28')]);if(_0x137dc2[_0x53cc('0x29')]){delete _0x137dc2[_0x53cc('0x29')];}_0x23b4c0[_0x53cc('0x1a')](_0x44e3a2)[_0x53cc('0x2a')](_0x137dc2);};}exports[_0x53cc('0x2b')]=function(_0x48b5d3,_0xc01967){var _0x5dcfe5={},_0x39591e={},_0x1b029a={'count':0x0,'rows':[]};var _0x3749f1=_[_0x53cc('0x2c')](db[_0x53cc('0x2d')][_0x53cc('0x2e')],function(_0x3f6c19){return{'name':_0x3f6c19[_0x53cc('0x2f')],'type':_0x3f6c19[_0x53cc('0x30')][_0x53cc('0x31')]};});_0x39591e[_0x53cc('0x32')]=_[_0x53cc('0x2c')](_0x3749f1,_0x53cc('0x29'));_0x39591e[_0x53cc('0x33')]=_[_0x53cc('0x34')](_0x48b5d3['query']);_0x39591e[_0x53cc('0x35')]=_[_0x53cc('0x36')](_0x39591e['model'],_0x39591e[_0x53cc('0x33')]);_0x5dcfe5[_0x53cc('0x37')]=_[_0x53cc('0x36')](_0x39591e['model'],qs[_0x53cc('0x38')](_0x48b5d3[_0x53cc('0x33')][_0x53cc('0x38')]));_0x5dcfe5['attributes']=_0x5dcfe5[_0x53cc('0x37')][_0x53cc('0x39')]?_0x5dcfe5['attributes']:_0x39591e[_0x53cc('0x32')];if(!_0x48b5d3[_0x53cc('0x33')][_0x53cc('0x3a')](_0x53cc('0x3b'))){_0x5dcfe5[_0x53cc('0x1e')]=qs[_0x53cc('0x1e')](_0x48b5d3[_0x53cc('0x33')][_0x53cc('0x1e')]);_0x5dcfe5[_0x53cc('0x1c')]=qs['offset'](_0x48b5d3['query'][_0x53cc('0x1c')]);}_0x5dcfe5[_0x53cc('0x3c')]=qs[_0x53cc('0x3d')](_0x48b5d3['query'][_0x53cc('0x3d')]);_0x5dcfe5[_0x53cc('0x3e')]=qs['filters'](_[_0x53cc('0x3f')](_0x48b5d3[_0x53cc('0x33')],_0x39591e[_0x53cc('0x35')]),_0x3749f1);if(_0x48b5d3['query'][_0x53cc('0x40')]){_0x5dcfe5[_0x53cc('0x3e')]=_['merge'](_0x5dcfe5['where'],{'$or':_['map'](_0x3749f1,function(_0x26f85e){if(_0x26f85e[_0x53cc('0x30')]!==_0x53cc('0x41')){var _0x26ae62={};_0x26ae62[_0x26f85e[_0x53cc('0x29')]]={'$like':'%'+_0x48b5d3['query']['filter']+'%'};return _0x26ae62;}})});}_0x5dcfe5=_[_0x53cc('0x42')]({},_0x5dcfe5,_0x48b5d3[_0x53cc('0x43')]);var _0x660bfc={'where':_0x5dcfe5['where']};return db['SugarcrmConfiguration'][_0x53cc('0x1f')](_0x660bfc)[_0x53cc('0x26')](function(_0x126e98){_0x1b029a[_0x53cc('0x1f')]=_0x126e98;if(_0x48b5d3[_0x53cc('0x33')][_0x53cc('0x44')]){_0x5dcfe5[_0x53cc('0x45')]=[{'all':!![]}];}return db[_0x53cc('0x2d')][_0x53cc('0x46')](_0x5dcfe5);})[_0x53cc('0x26')](function(_0x44496f){_0x1b029a[_0x53cc('0x47')]=_0x44496f;return _0x1b029a;})[_0x53cc('0x26')](respondWithFilteredResult(_0xc01967,_0x5dcfe5))['catch'](handleError(_0xc01967,null));};exports[_0x53cc('0x48')]=function(_0x46b090,_0x50dac4){var _0x2cebea={'raw':![],'where':{'id':_0x46b090['params']['id']}},_0x460477={};_0x460477[_0x53cc('0x32')]=_[_0x53cc('0x34')](db[_0x53cc('0x2d')][_0x53cc('0x2e')]);_0x460477[_0x53cc('0x33')]=_[_0x53cc('0x34')](_0x46b090['query']);_0x460477['filters']=_['intersection'](_0x460477['model'],_0x460477[_0x53cc('0x33')]);_0x2cebea[_0x53cc('0x37')]=_[_0x53cc('0x36')](_0x460477[_0x53cc('0x32')],qs[_0x53cc('0x38')](_0x46b090[_0x53cc('0x33')][_0x53cc('0x38')]));_0x2cebea[_0x53cc('0x37')]=_0x2cebea[_0x53cc('0x37')][_0x53cc('0x39')]?_0x2cebea['attributes']:_0x460477[_0x53cc('0x32')];if(_0x46b090[_0x53cc('0x33')]['includeAll']){_0x2cebea['include']=[{'all':!![]}];}_0x2cebea=_[_0x53cc('0x42')]({},_0x2cebea,_0x46b090[_0x53cc('0x43')]);return db[_0x53cc('0x2d')][_0x53cc('0x49')](_0x2cebea)[_0x53cc('0x26')](handleEntityNotFound(_0x50dac4,null))[_0x53cc('0x26')](respondWithResult(_0x50dac4,null))[_0x53cc('0x4a')](handleError(_0x50dac4,null));};exports['create']=function(_0x483243,_0x47c114){return db[_0x53cc('0x2d')][_0x53cc('0x4b')](_0x483243[_0x53cc('0x4c')],{})[_0x53cc('0x26')](respondWithResult(_0x47c114,0xc9))[_0x53cc('0x4a')](handleError(_0x47c114,null));};exports[_0x53cc('0x4d')]=function(_0x2debf6,_0x119b16){if(_0x2debf6[_0x53cc('0x4c')]['id']){delete _0x2debf6[_0x53cc('0x4c')]['id'];}return db[_0x53cc('0x2d')][_0x53cc('0x49')]({'where':{'id':_0x2debf6[_0x53cc('0x4e')]['id']}})[_0x53cc('0x26')](handleEntityNotFound(_0x119b16,null))[_0x53cc('0x26')](saveUpdates(_0x2debf6[_0x53cc('0x4c')],null))[_0x53cc('0x26')](respondWithResult(_0x119b16,null))[_0x53cc('0x4a')](handleError(_0x119b16,null));};exports['destroy']=function(_0x3ec3e3,_0x18247a){return db[_0x53cc('0x2d')][_0x53cc('0x49')]({'where':{'id':_0x3ec3e3[_0x53cc('0x4e')]['id']}})[_0x53cc('0x26')](handleEntityNotFound(_0x18247a,null))['then'](removeEntity(_0x18247a,null))[_0x53cc('0x4a')](handleError(_0x18247a,null));};exports['getFields']=function(_0x419ef5,_0x48ad02,_0x1c323b){var _0x59f16d={};var _0x391a06={};var _0x34b07b;var _0x84ad79;return db[_0x53cc('0x2d')][_0x53cc('0x4f')]({'where':{'id':_0x419ef5[_0x53cc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x48ad02,null))[_0x53cc('0x26')](function(_0x578b72){if(_0x578b72){_0x34b07b=_0x578b72;_0x391a06['model']=_[_0x53cc('0x34')](db[_0x53cc('0x50')][_0x53cc('0x2e')]);_0x391a06[_0x53cc('0x33')]=_[_0x53cc('0x34')](_0x419ef5['query']);_0x391a06[_0x53cc('0x35')]=_[_0x53cc('0x36')](_0x391a06[_0x53cc('0x32')],_0x391a06['query']);_0x59f16d['attributes']=_[_0x53cc('0x36')](_0x391a06[_0x53cc('0x32')],qs[_0x53cc('0x38')](_0x419ef5['query'][_0x53cc('0x38')]));_0x59f16d['attributes']=_0x59f16d['attributes']['length']?_0x59f16d[_0x53cc('0x37')]:_0x391a06[_0x53cc('0x32')];_0x59f16d[_0x53cc('0x3c')]=qs[_0x53cc('0x3d')](_0x419ef5[_0x53cc('0x33')][_0x53cc('0x3d')]);_0x59f16d[_0x53cc('0x3e')]=qs[_0x53cc('0x35')](_['pick'](_0x419ef5[_0x53cc('0x33')],_0x391a06[_0x53cc('0x35')]));if(_0x419ef5['query'][_0x53cc('0x40')]){_0x59f16d[_0x53cc('0x3e')]=_[_0x53cc('0x42')](_0x59f16d[_0x53cc('0x3e')],{'$or':_[_0x53cc('0x2c')](_0x59f16d[_0x53cc('0x37')],function(_0x5c6a90){var _0x241aef={};_0x241aef[_0x5c6a90]={'$like':'%'+_0x419ef5[_0x53cc('0x33')][_0x53cc('0x40')]+'%'};return _0x241aef;})});}_0x59f16d=_['merge']({},_0x59f16d,_0x419ef5['options']);return _0x34b07b[_0x53cc('0x51')](_0x59f16d);}})[_0x53cc('0x26')](function(_0x390e88){if(_0x390e88){_0x84ad79=_0x390e88[_0x53cc('0x39')];if(!_0x419ef5['query'][_0x53cc('0x3a')](_0x53cc('0x3b'))){_0x59f16d[_0x53cc('0x1e')]=qs[_0x53cc('0x1e')](_0x419ef5[_0x53cc('0x33')]['limit']);_0x59f16d[_0x53cc('0x1c')]=qs[_0x53cc('0x1c')](_0x419ef5[_0x53cc('0x33')]['offset']);}return _0x34b07b[_0x53cc('0x51')](_0x59f16d);}})[_0x53cc('0x26')](function(_0x100cc2){if(_0x100cc2){return _0x100cc2?{'count':_0x84ad79,'rows':_0x100cc2}:null;}})['then'](respondWithResult(_0x48ad02,null))[_0x53cc('0x4a')](handleError(_0x48ad02,null));};exports[_0x53cc('0x52')]=function(_0x2d76ec,_0x1c0c36,_0x3f4d75){var _0x343c6d={};var _0x4fdd45={};var _0x318075;var _0x1354c0;return db[_0x53cc('0x2d')]['findOne']({'where':{'id':_0x2d76ec['params']['id']}})[_0x53cc('0x26')](handleEntityNotFound(_0x1c0c36,null))['then'](function(_0x49b669){if(_0x49b669){_0x318075=_0x49b669;_0x4fdd45[_0x53cc('0x32')]=_[_0x53cc('0x34')](db['SugarcrmField'][_0x53cc('0x2e')]);_0x4fdd45[_0x53cc('0x33')]=_[_0x53cc('0x34')](_0x2d76ec['query']);_0x4fdd45[_0x53cc('0x35')]=_['intersection'](_0x4fdd45[_0x53cc('0x32')],_0x4fdd45['query']);_0x343c6d[_0x53cc('0x37')]=_[_0x53cc('0x36')](_0x4fdd45[_0x53cc('0x32')],qs[_0x53cc('0x38')](_0x2d76ec['query'][_0x53cc('0x38')]));_0x343c6d[_0x53cc('0x37')]=_0x343c6d[_0x53cc('0x37')]['length']?_0x343c6d[_0x53cc('0x37')]:_0x4fdd45[_0x53cc('0x32')];_0x343c6d['order']=qs[_0x53cc('0x3d')](_0x2d76ec[_0x53cc('0x33')]['sort']);_0x343c6d['where']=qs[_0x53cc('0x35')](_[_0x53cc('0x3f')](_0x2d76ec['query'],_0x4fdd45[_0x53cc('0x35')]));if(_0x2d76ec[_0x53cc('0x33')][_0x53cc('0x40')]){_0x343c6d[_0x53cc('0x3e')]=_['merge'](_0x343c6d['where'],{'$or':_[_0x53cc('0x2c')](_0x343c6d[_0x53cc('0x37')],function(_0x276ab1){var _0x3b6f74={};_0x3b6f74[_0x276ab1]={'$like':'%'+_0x2d76ec[_0x53cc('0x33')][_0x53cc('0x40')]+'%'};return _0x3b6f74;})});}_0x343c6d=_[_0x53cc('0x42')]({},_0x343c6d,_0x2d76ec[_0x53cc('0x43')]);return _0x318075[_0x53cc('0x52')](_0x343c6d);}})[_0x53cc('0x26')](function(_0x2674ba){if(_0x2674ba){_0x1354c0=_0x2674ba[_0x53cc('0x39')];if(!_0x2d76ec[_0x53cc('0x33')][_0x53cc('0x3a')]('nolimit')){_0x343c6d[_0x53cc('0x1e')]=qs['limit'](_0x2d76ec['query'][_0x53cc('0x1e')]);_0x343c6d['offset']=qs['offset'](_0x2d76ec[_0x53cc('0x33')][_0x53cc('0x1c')]);}return _0x318075[_0x53cc('0x52')](_0x343c6d);}})[_0x53cc('0x26')](function(_0x18e3c4){if(_0x18e3c4){return _0x18e3c4?{'count':_0x1354c0,'rows':_0x18e3c4}:null;}})[_0x53cc('0x26')](respondWithResult(_0x1c0c36,null))['catch'](handleError(_0x1c0c36,null));};exports['getDescriptions']=function(_0x4ba59d,_0x3bfb7f,_0x52bcc0){var _0x312b6={};var _0x4eb5fc={};var _0x4f8717;var _0x246918;return db[_0x53cc('0x2d')][_0x53cc('0x4f')]({'where':{'id':_0x4ba59d[_0x53cc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3bfb7f,null))[_0x53cc('0x26')](function(_0x4c78d2){if(_0x4c78d2){_0x4f8717=_0x4c78d2;_0x4eb5fc['model']=_[_0x53cc('0x34')](db['SugarcrmField'][_0x53cc('0x2e')]);_0x4eb5fc[_0x53cc('0x33')]=_[_0x53cc('0x34')](_0x4ba59d[_0x53cc('0x33')]);_0x4eb5fc['filters']=_[_0x53cc('0x36')](_0x4eb5fc[_0x53cc('0x32')],_0x4eb5fc['query']);_0x312b6[_0x53cc('0x37')]=_['intersection'](_0x4eb5fc[_0x53cc('0x32')],qs[_0x53cc('0x38')](_0x4ba59d[_0x53cc('0x33')][_0x53cc('0x38')]));_0x312b6[_0x53cc('0x37')]=_0x312b6[_0x53cc('0x37')][_0x53cc('0x39')]?_0x312b6[_0x53cc('0x37')]:_0x4eb5fc[_0x53cc('0x32')];_0x312b6['order']=qs[_0x53cc('0x3d')](_0x4ba59d[_0x53cc('0x33')][_0x53cc('0x3d')]);_0x312b6[_0x53cc('0x3e')]=qs[_0x53cc('0x35')](_[_0x53cc('0x3f')](_0x4ba59d['query'],_0x4eb5fc[_0x53cc('0x35')]));if(_0x4ba59d[_0x53cc('0x33')][_0x53cc('0x40')]){_0x312b6[_0x53cc('0x3e')]=_[_0x53cc('0x42')](_0x312b6[_0x53cc('0x3e')],{'$or':_[_0x53cc('0x2c')](_0x312b6[_0x53cc('0x37')],function(_0x2b59d0){var _0xc2eb54={};_0xc2eb54[_0x2b59d0]={'$like':'%'+_0x4ba59d[_0x53cc('0x33')][_0x53cc('0x40')]+'%'};return _0xc2eb54;})});}_0x312b6=_['merge']({},_0x312b6,_0x4ba59d[_0x53cc('0x43')]);return _0x4f8717['getDescriptions'](_0x312b6);}})[_0x53cc('0x26')](function(_0x531088){if(_0x531088){_0x246918=_0x531088[_0x53cc('0x39')];if(!_0x4ba59d[_0x53cc('0x33')][_0x53cc('0x3a')]('nolimit')){_0x312b6[_0x53cc('0x1e')]=qs['limit'](_0x4ba59d['query']['limit']);_0x312b6[_0x53cc('0x1c')]=qs[_0x53cc('0x1c')](_0x4ba59d[_0x53cc('0x33')]['offset']);}return _0x4f8717[_0x53cc('0x53')](_0x312b6);}})[_0x53cc('0x26')](function(_0x1f28f7){if(_0x1f28f7){return _0x1f28f7?{'count':_0x246918,'rows':_0x1f28f7}:null;}})['then'](respondWithResult(_0x3bfb7f,null))[_0x53cc('0x4a')](handleError(_0x3bfb7f,null));}; \ No newline at end of file +var _0x276a=['type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','create','body','find','getFields','findOne','SugarcrmField','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','sendStatus','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName'];(function(_0x4ce577,_0x41192a){var _0x50c69=function(_0x27ab54){while(--_0x27ab54){_0x4ce577['push'](_0x4ce577['shift']());}};_0x50c69(++_0x41192a);}(_0x276a,0x70));var _0xa276=function(_0x2fa066,_0x8f4f14){_0x2fa066=_0x2fa066-0x0;var _0x1f5382=_0x276a[_0x2fa066];return _0x1f5382;};'use strict';var emlformat=require(_0xa276('0x0'));var rimraf=require(_0xa276('0x1'));var zipdir=require(_0xa276('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa276('0x3'));var moment=require(_0xa276('0x4'));var BPromise=require(_0xa276('0x5'));var Mustache=require(_0xa276('0x6'));var util=require('util');var path=require(_0xa276('0x7'));var sox=require(_0xa276('0x8'));var csv=require(_0xa276('0x9'));var ejs=require(_0xa276('0xa'));var fs=require('fs');var fs_extra=require(_0xa276('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa276('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa276('0x9'));var querystring=require(_0xa276('0xd'));var Papa=require(_0xa276('0xe'));var Redis=require(_0xa276('0xf'));var authService=require(_0xa276('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa276('0x11'));var logger=require(_0xa276('0x12'))(_0xa276('0x13'));var utils=require(_0xa276('0x14'));var config=require(_0xa276('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa276('0x16'))['db'];function respondWithStatusCode(_0x1a8098,_0x11c2bd){_0x11c2bd=_0x11c2bd||0xcc;return function(_0x1b3cac){if(_0x1b3cac){return _0x1a8098['sendStatus'](_0x11c2bd);}return _0x1a8098['status'](_0x11c2bd)[_0xa276('0x17')]();};}function respondWithResult(_0x19a6fc,_0x1b4390){_0x1b4390=_0x1b4390||0xc8;return function(_0x15dad0){if(_0x15dad0){return _0x19a6fc[_0xa276('0x18')](_0x1b4390)[_0xa276('0x19')](_0x15dad0);}};}function respondWithFilteredResult(_0x3ee567,_0x5e1e55){return function(_0x136263){if(_0x136263){var _0x36548d=typeof _0x5e1e55[_0xa276('0x1a')]===_0xa276('0x1b')&&typeof _0x5e1e55['limit']===_0xa276('0x1b');var _0x28923e=_0x136263[_0xa276('0x1c')];var _0x11efde=_0x36548d?0x0:_0x5e1e55[_0xa276('0x1a')];var _0x229c78=_0x36548d?_0x136263[_0xa276('0x1c')]:_0x5e1e55[_0xa276('0x1a')]+_0x5e1e55[_0xa276('0x1d')];var _0x2d3721;if(_0x229c78>=_0x28923e){_0x229c78=_0x28923e;_0x2d3721=0xc8;}else{_0x2d3721=0xce;}_0x3ee567[_0xa276('0x18')](_0x2d3721);return _0x3ee567[_0xa276('0x1e')]('Content-Range',_0x11efde+'-'+_0x229c78+'/'+_0x28923e)['json'](_0x136263);}return null;};}function patchUpdates(_0x503cf6){return function(_0xc04b19){try{jsonpatch[_0xa276('0x1f')](_0xc04b19,_0x503cf6,!![]);}catch(_0x3004d7){return BPromise['reject'](_0x3004d7);}return _0xc04b19[_0xa276('0x20')]();};}function saveUpdates(_0x1b446a,_0x52f4cb){return function(_0x52337f){if(_0x52337f){return _0x52337f[_0xa276('0x21')](_0x1b446a)[_0xa276('0x22')](function(_0x1aab04){return _0x1aab04;});}return null;};}function removeEntity(_0x4ea966,_0x32e161){return function(_0x5ce681){if(_0x5ce681){return _0x5ce681[_0xa276('0x23')]()[_0xa276('0x22')](function(){_0x4ea966['status'](0xcc)[_0xa276('0x17')]();});}};}function handleEntityNotFound(_0xd042f6,_0x4c100d){return function(_0x48697f){if(!_0x48697f){_0xd042f6[_0xa276('0x24')](0x194);}return _0x48697f;};}function handleError(_0x1edf3d,_0x45c8e8){_0x45c8e8=_0x45c8e8||0x1f4;return function(_0x1c8fa4){logger['error'](_0x1c8fa4['stack']);if(_0x1c8fa4[_0xa276('0x25')]){delete _0x1c8fa4['name'];}_0x1edf3d['status'](_0x45c8e8)[_0xa276('0x26')](_0x1c8fa4);};}exports[_0xa276('0x27')]=function(_0x38cecc,_0x288bbc){var _0x354028={},_0x9c9ea9={},_0x54ab9a={'count':0x0,'rows':[]};var _0x3bb538=_[_0xa276('0x28')](db[_0xa276('0x29')][_0xa276('0x2a')],function(_0x3cd189){return{'name':_0x3cd189[_0xa276('0x2b')],'type':_0x3cd189[_0xa276('0x2c')][_0xa276('0x2d')]};});_0x9c9ea9[_0xa276('0x2e')]=_['map'](_0x3bb538,_0xa276('0x25'));_0x9c9ea9[_0xa276('0x2f')]=_[_0xa276('0x30')](_0x38cecc[_0xa276('0x2f')]);_0x9c9ea9[_0xa276('0x31')]=_[_0xa276('0x32')](_0x9c9ea9[_0xa276('0x2e')],_0x9c9ea9[_0xa276('0x2f')]);_0x354028[_0xa276('0x33')]=_[_0xa276('0x32')](_0x9c9ea9['model'],qs[_0xa276('0x34')](_0x38cecc['query']['fields']));_0x354028[_0xa276('0x33')]=_0x354028[_0xa276('0x33')][_0xa276('0x35')]?_0x354028[_0xa276('0x33')]:_0x9c9ea9[_0xa276('0x2e')];if(!_0x38cecc[_0xa276('0x2f')]['hasOwnProperty'](_0xa276('0x36'))){_0x354028[_0xa276('0x1d')]=qs[_0xa276('0x1d')](_0x38cecc[_0xa276('0x2f')]['limit']);_0x354028[_0xa276('0x1a')]=qs['offset'](_0x38cecc[_0xa276('0x2f')][_0xa276('0x1a')]);}_0x354028[_0xa276('0x37')]=qs['sort'](_0x38cecc[_0xa276('0x2f')][_0xa276('0x38')]);_0x354028[_0xa276('0x39')]=qs[_0xa276('0x31')](_['pick'](_0x38cecc[_0xa276('0x2f')],_0x9c9ea9['filters']),_0x3bb538);if(_0x38cecc['query'][_0xa276('0x3a')]){_0x354028[_0xa276('0x39')]=_['merge'](_0x354028[_0xa276('0x39')],{'$or':_[_0xa276('0x28')](_0x3bb538,function(_0x5ea738){if(_0x5ea738[_0xa276('0x2c')]!==_0xa276('0x3b')){var _0xdf236d={};_0xdf236d[_0x5ea738[_0xa276('0x25')]]={'$like':'%'+_0x38cecc[_0xa276('0x2f')][_0xa276('0x3a')]+'%'};return _0xdf236d;}})});}_0x354028=_[_0xa276('0x3c')]({},_0x354028,_0x38cecc[_0xa276('0x3d')]);var _0xf80664={'where':_0x354028[_0xa276('0x39')]};return db[_0xa276('0x29')][_0xa276('0x1c')](_0xf80664)[_0xa276('0x22')](function(_0x173435){_0x54ab9a['count']=_0x173435;if(_0x38cecc[_0xa276('0x2f')][_0xa276('0x3e')]){_0x354028['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xa276('0x3f')](_0x354028);})['then'](function(_0x2e17c0){_0x54ab9a[_0xa276('0x40')]=_0x2e17c0;return _0x54ab9a;})[_0xa276('0x22')](respondWithFilteredResult(_0x288bbc,_0x354028))[_0xa276('0x41')](handleError(_0x288bbc,null));};exports[_0xa276('0x42')]=function(_0x4f5ef6,_0x11e99d){var _0xddd07={'raw':![],'where':{'id':_0x4f5ef6[_0xa276('0x43')]['id']}},_0x59787e={};_0x59787e[_0xa276('0x2e')]=_[_0xa276('0x30')](db[_0xa276('0x29')][_0xa276('0x2a')]);_0x59787e[_0xa276('0x2f')]=_['keys'](_0x4f5ef6['query']);_0x59787e[_0xa276('0x31')]=_[_0xa276('0x32')](_0x59787e['model'],_0x59787e[_0xa276('0x2f')]);_0xddd07[_0xa276('0x33')]=_['intersection'](_0x59787e[_0xa276('0x2e')],qs[_0xa276('0x34')](_0x4f5ef6[_0xa276('0x2f')]['fields']));_0xddd07[_0xa276('0x33')]=_0xddd07[_0xa276('0x33')][_0xa276('0x35')]?_0xddd07[_0xa276('0x33')]:_0x59787e[_0xa276('0x2e')];if(_0x4f5ef6[_0xa276('0x2f')][_0xa276('0x3e')]){_0xddd07['include']=[{'all':!![]}];}_0xddd07=_[_0xa276('0x3c')]({},_0xddd07,_0x4f5ef6[_0xa276('0x3d')]);return db[_0xa276('0x29')]['find'](_0xddd07)[_0xa276('0x22')](handleEntityNotFound(_0x11e99d,null))['then'](respondWithResult(_0x11e99d,null))['catch'](handleError(_0x11e99d,null));};exports[_0xa276('0x44')]=function(_0x495090,_0x45356f){return db[_0xa276('0x29')][_0xa276('0x44')](_0x495090[_0xa276('0x45')],{})[_0xa276('0x22')](respondWithResult(_0x45356f,0xc9))[_0xa276('0x41')](handleError(_0x45356f,null));};exports[_0xa276('0x21')]=function(_0x2c34e8,_0x19f4de){if(_0x2c34e8[_0xa276('0x45')]['id']){delete _0x2c34e8['body']['id'];}return db['SugarcrmConfiguration'][_0xa276('0x46')]({'where':{'id':_0x2c34e8['params']['id']}})[_0xa276('0x22')](handleEntityNotFound(_0x19f4de,null))[_0xa276('0x22')](saveUpdates(_0x2c34e8[_0xa276('0x45')],null))[_0xa276('0x22')](respondWithResult(_0x19f4de,null))[_0xa276('0x41')](handleError(_0x19f4de,null));};exports['destroy']=function(_0x3597fe,_0x3f7f61){return db[_0xa276('0x29')][_0xa276('0x46')]({'where':{'id':_0x3597fe[_0xa276('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f7f61,null))[_0xa276('0x22')](removeEntity(_0x3f7f61,null))[_0xa276('0x41')](handleError(_0x3f7f61,null));};exports[_0xa276('0x47')]=function(_0x287f49,_0x28f103,_0x53117e){var _0x5e6c46={};var _0xa9ac50={};var _0x39574f;var _0x300985;return db['SugarcrmConfiguration'][_0xa276('0x48')]({'where':{'id':_0x287f49[_0xa276('0x43')]['id']}})[_0xa276('0x22')](handleEntityNotFound(_0x28f103,null))[_0xa276('0x22')](function(_0xe0df9b){if(_0xe0df9b){_0x39574f=_0xe0df9b;_0xa9ac50[_0xa276('0x2e')]=_[_0xa276('0x30')](db[_0xa276('0x49')]['rawAttributes']);_0xa9ac50[_0xa276('0x2f')]=_['keys'](_0x287f49[_0xa276('0x2f')]);_0xa9ac50[_0xa276('0x31')]=_[_0xa276('0x32')](_0xa9ac50[_0xa276('0x2e')],_0xa9ac50[_0xa276('0x2f')]);_0x5e6c46[_0xa276('0x33')]=_['intersection'](_0xa9ac50[_0xa276('0x2e')],qs['fields'](_0x287f49[_0xa276('0x2f')]['fields']));_0x5e6c46[_0xa276('0x33')]=_0x5e6c46[_0xa276('0x33')][_0xa276('0x35')]?_0x5e6c46[_0xa276('0x33')]:_0xa9ac50['model'];_0x5e6c46[_0xa276('0x37')]=qs['sort'](_0x287f49['query']['sort']);_0x5e6c46['where']=qs[_0xa276('0x31')](_[_0xa276('0x4a')](_0x287f49['query'],_0xa9ac50[_0xa276('0x31')]));if(_0x287f49[_0xa276('0x2f')][_0xa276('0x3a')]){_0x5e6c46[_0xa276('0x39')]=_[_0xa276('0x3c')](_0x5e6c46['where'],{'$or':_[_0xa276('0x28')](_0x5e6c46[_0xa276('0x33')],function(_0x2a43b8){var _0x29ffa2={};_0x29ffa2[_0x2a43b8]={'$like':'%'+_0x287f49[_0xa276('0x2f')][_0xa276('0x3a')]+'%'};return _0x29ffa2;})});}_0x5e6c46=_['merge']({},_0x5e6c46,_0x287f49[_0xa276('0x3d')]);return _0x39574f[_0xa276('0x47')](_0x5e6c46);}})['then'](function(_0x9f5df4){if(_0x9f5df4){_0x300985=_0x9f5df4[_0xa276('0x35')];if(!_0x287f49['query'][_0xa276('0x4b')](_0xa276('0x36'))){_0x5e6c46[_0xa276('0x1d')]=qs[_0xa276('0x1d')](_0x287f49[_0xa276('0x2f')][_0xa276('0x1d')]);_0x5e6c46[_0xa276('0x1a')]=qs[_0xa276('0x1a')](_0x287f49['query']['offset']);}return _0x39574f[_0xa276('0x47')](_0x5e6c46);}})[_0xa276('0x22')](function(_0x462b42){if(_0x462b42){return _0x462b42?{'count':_0x300985,'rows':_0x462b42}:null;}})['then'](respondWithResult(_0x28f103,null))['catch'](handleError(_0x28f103,null));};exports[_0xa276('0x4c')]=function(_0x3d0db7,_0x297131,_0x511c8d){var _0x4089af={};var _0x58f03d={};var _0x42d36e;var _0x61400e;return db[_0xa276('0x29')][_0xa276('0x48')]({'where':{'id':_0x3d0db7[_0xa276('0x43')]['id']}})[_0xa276('0x22')](handleEntityNotFound(_0x297131,null))['then'](function(_0x51502e){if(_0x51502e){_0x42d36e=_0x51502e;_0x58f03d[_0xa276('0x2e')]=_[_0xa276('0x30')](db[_0xa276('0x49')]['rawAttributes']);_0x58f03d[_0xa276('0x2f')]=_[_0xa276('0x30')](_0x3d0db7[_0xa276('0x2f')]);_0x58f03d[_0xa276('0x31')]=_['intersection'](_0x58f03d['model'],_0x58f03d[_0xa276('0x2f')]);_0x4089af[_0xa276('0x33')]=_[_0xa276('0x32')](_0x58f03d[_0xa276('0x2e')],qs[_0xa276('0x34')](_0x3d0db7[_0xa276('0x2f')][_0xa276('0x34')]));_0x4089af[_0xa276('0x33')]=_0x4089af[_0xa276('0x33')]['length']?_0x4089af[_0xa276('0x33')]:_0x58f03d[_0xa276('0x2e')];_0x4089af[_0xa276('0x37')]=qs[_0xa276('0x38')](_0x3d0db7[_0xa276('0x2f')][_0xa276('0x38')]);_0x4089af[_0xa276('0x39')]=qs[_0xa276('0x31')](_[_0xa276('0x4a')](_0x3d0db7['query'],_0x58f03d['filters']));if(_0x3d0db7[_0xa276('0x2f')][_0xa276('0x3a')]){_0x4089af[_0xa276('0x39')]=_['merge'](_0x4089af[_0xa276('0x39')],{'$or':_[_0xa276('0x28')](_0x4089af['attributes'],function(_0x1929ec){var _0x42482f={};_0x42482f[_0x1929ec]={'$like':'%'+_0x3d0db7[_0xa276('0x2f')][_0xa276('0x3a')]+'%'};return _0x42482f;})});}_0x4089af=_[_0xa276('0x3c')]({},_0x4089af,_0x3d0db7[_0xa276('0x3d')]);return _0x42d36e[_0xa276('0x4c')](_0x4089af);}})[_0xa276('0x22')](function(_0x2d2732){if(_0x2d2732){_0x61400e=_0x2d2732[_0xa276('0x35')];if(!_0x3d0db7[_0xa276('0x2f')][_0xa276('0x4b')]('nolimit')){_0x4089af[_0xa276('0x1d')]=qs[_0xa276('0x1d')](_0x3d0db7[_0xa276('0x2f')][_0xa276('0x1d')]);_0x4089af[_0xa276('0x1a')]=qs[_0xa276('0x1a')](_0x3d0db7[_0xa276('0x2f')][_0xa276('0x1a')]);}return _0x42d36e[_0xa276('0x4c')](_0x4089af);}})['then'](function(_0x2132b8){if(_0x2132b8){return _0x2132b8?{'count':_0x61400e,'rows':_0x2132b8}:null;}})[_0xa276('0x22')](respondWithResult(_0x297131,null))[_0xa276('0x41')](handleError(_0x297131,null));};exports[_0xa276('0x4d')]=function(_0x4d87f7,_0x35cdd5,_0x143422){var _0x66b8a2={};var _0x34a052={};var _0xacdbed;var _0x3ef519;return db['SugarcrmConfiguration'][_0xa276('0x48')]({'where':{'id':_0x4d87f7[_0xa276('0x43')]['id']}})['then'](handleEntityNotFound(_0x35cdd5,null))[_0xa276('0x22')](function(_0x37ec70){if(_0x37ec70){_0xacdbed=_0x37ec70;_0x34a052[_0xa276('0x2e')]=_['keys'](db[_0xa276('0x49')][_0xa276('0x2a')]);_0x34a052[_0xa276('0x2f')]=_[_0xa276('0x30')](_0x4d87f7[_0xa276('0x2f')]);_0x34a052[_0xa276('0x31')]=_[_0xa276('0x32')](_0x34a052[_0xa276('0x2e')],_0x34a052['query']);_0x66b8a2[_0xa276('0x33')]=_[_0xa276('0x32')](_0x34a052['model'],qs[_0xa276('0x34')](_0x4d87f7[_0xa276('0x2f')][_0xa276('0x34')]));_0x66b8a2['attributes']=_0x66b8a2[_0xa276('0x33')][_0xa276('0x35')]?_0x66b8a2[_0xa276('0x33')]:_0x34a052[_0xa276('0x2e')];_0x66b8a2[_0xa276('0x37')]=qs[_0xa276('0x38')](_0x4d87f7['query']['sort']);_0x66b8a2[_0xa276('0x39')]=qs[_0xa276('0x31')](_['pick'](_0x4d87f7['query'],_0x34a052[_0xa276('0x31')]));if(_0x4d87f7[_0xa276('0x2f')][_0xa276('0x3a')]){_0x66b8a2[_0xa276('0x39')]=_['merge'](_0x66b8a2['where'],{'$or':_[_0xa276('0x28')](_0x66b8a2[_0xa276('0x33')],function(_0x15b475){var _0x3d52d0={};_0x3d52d0[_0x15b475]={'$like':'%'+_0x4d87f7[_0xa276('0x2f')]['filter']+'%'};return _0x3d52d0;})});}_0x66b8a2=_[_0xa276('0x3c')]({},_0x66b8a2,_0x4d87f7[_0xa276('0x3d')]);return _0xacdbed[_0xa276('0x4d')](_0x66b8a2);}})['then'](function(_0x500755){if(_0x500755){_0x3ef519=_0x500755[_0xa276('0x35')];if(!_0x4d87f7[_0xa276('0x2f')][_0xa276('0x4b')](_0xa276('0x36'))){_0x66b8a2[_0xa276('0x1d')]=qs[_0xa276('0x1d')](_0x4d87f7[_0xa276('0x2f')][_0xa276('0x1d')]);_0x66b8a2[_0xa276('0x1a')]=qs[_0xa276('0x1a')](_0x4d87f7[_0xa276('0x2f')][_0xa276('0x1a')]);}return _0xacdbed[_0xa276('0x4d')](_0x66b8a2);}})[_0xa276('0x22')](function(_0x3a8473){if(_0x3a8473){return _0x3a8473?{'count':_0x3ef519,'rows':_0x3a8473}:null;}})['then'](respondWithResult(_0x35cdd5,null))[_0xa276('0x41')](handleError(_0x35cdd5,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 5dc2b3e..93672f4 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1341=['path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x13787a,_0xbcebc8){var _0xd5ea62=function(_0x4d2ff7){while(--_0x4d2ff7){_0x13787a['push'](_0x13787a['shift']());}};_0xd5ea62(++_0xbcebc8);}(_0x1341,0x7d));var _0x1134=function(_0xc0f978,_0x476dd7){_0xc0f978=_0xc0f978-0x0;var _0x13feb6=_0x1341[_0xc0f978];return _0x13feb6;};'use strict';var _=require(_0x1134('0x0'));var util=require(_0x1134('0x1'));var logger=require(_0x1134('0x2'))(_0x1134('0x3'));var moment=require(_0x1134('0x4'));var BPromise=require(_0x1134('0x5'));var rp=require(_0x1134('0x6'));var fs=require('fs');var path=require(_0x1134('0x7'));var rimraf=require(_0x1134('0x8'));var config=require(_0x1134('0x9'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x1134('0xa')]=function(_0x57ca7e,_0x45a510){return _0x57ca7e[_0x1134('0xb')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25ef=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x5efdc0,_0x2f7a64){var _0x377ab5=function(_0x3aa1ec){while(--_0x3aa1ec){_0x5efdc0['push'](_0x5efdc0['shift']());}};_0x377ab5(++_0x2f7a64);}(_0x25ef,0xaa));var _0xf25e=function(_0x29c019,_0x19fd01){_0x29c019=_0x29c019-0x0;var _0x11e171=_0x25ef[_0x29c019];return _0x11e171;};'use strict';var _=require(_0xf25e('0x0'));var util=require(_0xf25e('0x1'));var logger=require(_0xf25e('0x2'))(_0xf25e('0x3'));var moment=require(_0xf25e('0x4'));var BPromise=require(_0xf25e('0x5'));var rp=require(_0xf25e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf25e('0x7'));var config=require('../../config/environment');var attributes=require(_0xf25e('0x8'));module[_0xf25e('0x9')]=function(_0x5bf029,_0x5715e9){return _0x5bf029[_0xf25e('0xa')](_0xf25e('0xb'),attributes,{'tableName':_0xf25e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 85c80be..6e9f19b 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7827=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x7827,0x9f));var _0x7782=function(_0x44e00a,_0x248bbc){_0x44e00a=_0x44e00a-0x0;var _0x2bdfba=_0x7827[_0x44e00a];return _0x2bdfba;};'use strict';var _=require(_0x7782('0x0'));var util=require(_0x7782('0x1'));var moment=require(_0x7782('0x2'));var BPromise=require(_0x7782('0x3'));var rs=require(_0x7782('0x4'));var fs=require('fs');var Redis=require(_0x7782('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7782('0x6'));var logger=require(_0x7782('0x7'))(_0x7782('0x8'));var config=require(_0x7782('0x9'));var jayson=require(_0x7782('0xa'));var client=jayson[_0x7782('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54581f,_0x56fd72,_0x30bea4){return new BPromise(function(_0x175d14,_0x4e9b1c){return client[_0x7782('0xc')](_0x54581f,_0x30bea4)[_0x7782('0xd')](function(_0x404b3c){logger[_0x7782('0xe')](_0x7782('0xf'),_0x56fd72,_0x7782('0x10'));logger[_0x7782('0x11')](_0x7782('0x12'),_0x56fd72,'request\x20sent',JSON['stringify'](_0x404b3c));if(_0x404b3c[_0x7782('0x13')]){if(_0x404b3c[_0x7782('0x13')][_0x7782('0x14')]===0x1f4){logger[_0x7782('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x56fd72,_0x404b3c[_0x7782('0x13')][_0x7782('0x15')]);return _0x4e9b1c(_0x404b3c[_0x7782('0x13')]['message']);}logger[_0x7782('0x13')](_0x7782('0xf'),_0x56fd72,_0x404b3c[_0x7782('0x13')]['message']);return _0x175d14(_0x404b3c[_0x7782('0x13')][_0x7782('0x15')]);}else{logger[_0x7782('0xe')](_0x7782('0xf'),_0x56fd72,_0x7782('0x10'));_0x175d14(_0x404b3c['result'][_0x7782('0x15')]);}})[_0x7782('0x16')](function(_0x5ec9b6){logger['error'](_0x7782('0xf'),_0x56fd72,_0x5ec9b6);_0x4e9b1c(_0x5ec9b6);});});} \ No newline at end of file +var _0x4380=['request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x3acccc,_0x3a7a65){var _0x1649fe=function(_0x7f3484){while(--_0x7f3484){_0x3acccc['push'](_0x3acccc['shift']());}};_0x1649fe(++_0x3a7a65);}(_0x4380,0xa2));var _0x0438=function(_0x5cd9e2,_0x2048e5){_0x5cd9e2=_0x5cd9e2-0x0;var _0x244127=_0x4380[_0x5cd9e2];return _0x244127;};'use strict';var _=require('lodash');var util=require(_0x0438('0x0'));var moment=require(_0x0438('0x1'));var BPromise=require(_0x0438('0x2'));var rs=require(_0x0438('0x3'));var fs=require('fs');var Redis=require(_0x0438('0x4'));var db=require(_0x0438('0x5'))['db'];var utils=require(_0x0438('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0438('0x7'));var jayson=require(_0x0438('0x8'));var client=jayson[_0x0438('0x9')][_0x0438('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x516453,_0x257559,_0x554742){return new BPromise(function(_0x57937f,_0x545219){return client[_0x0438('0xb')](_0x516453,_0x554742)[_0x0438('0xc')](function(_0xfaf19b){logger['info'](_0x0438('0xd'),_0x257559,_0x0438('0xe'));logger[_0x0438('0xf')](_0x0438('0x10'),_0x257559,'request\x20sent',JSON[_0x0438('0x11')](_0xfaf19b));if(_0xfaf19b[_0x0438('0x12')]){if(_0xfaf19b[_0x0438('0x12')][_0x0438('0x13')]===0x1f4){logger[_0x0438('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x257559,_0xfaf19b[_0x0438('0x12')][_0x0438('0x14')]);return _0x545219(_0xfaf19b[_0x0438('0x12')][_0x0438('0x14')]);}logger[_0x0438('0x12')](_0x0438('0xd'),_0x257559,_0xfaf19b[_0x0438('0x12')][_0x0438('0x14')]);return _0x57937f(_0xfaf19b[_0x0438('0x12')]['message']);}else{logger['info'](_0x0438('0xd'),_0x257559,_0x0438('0xe'));_0x57937f(_0xfaf19b['result'][_0x0438('0x14')]);}})[_0x0438('0x15')](function(_0x22a68f){logger['error'](_0x0438('0xd'),_0x257559,_0x22a68f);_0x545219(_0x22a68f);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index e44503a..3ae217d 100644 --- a/server/api/intSugarcrmField/index.js +++ b/server/api/intSugarcrmField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ec0=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','delete'];(function(_0x2885cb,_0x3401f6){var _0x4cdc82=function(_0x28505d){while(--_0x28505d){_0x2885cb['push'](_0x2885cb['shift']());}};_0x4cdc82(++_0x3401f6);}(_0x8ec0,0x6e));var _0x08ec=function(_0x3eb9f6,_0x5cb755){_0x3eb9f6=_0x3eb9f6-0x0;var _0x198c83=_0x8ec0[_0x3eb9f6];return _0x198c83;};'use strict';var multer=require(_0x08ec('0x0'));var util=require(_0x08ec('0x1'));var path=require('path');var timeout=require(_0x08ec('0x2'));var express=require(_0x08ec('0x3'));var router=express['Router']();var fs_extra=require(_0x08ec('0x4'));var auth=require(_0x08ec('0x5'));var interaction=require(_0x08ec('0x6'));var config=require(_0x08ec('0x7'));var controller=require('./intSugarcrmField.controller');router[_0x08ec('0x8')]('/',auth[_0x08ec('0x9')](),controller[_0x08ec('0xa')]);router[_0x08ec('0x8')]('/:id',auth[_0x08ec('0x9')](),controller[_0x08ec('0xb')]);router[_0x08ec('0xc')]('/',auth[_0x08ec('0x9')](),controller[_0x08ec('0xd')]);router[_0x08ec('0xe')]('/:id',auth[_0x08ec('0x9')](),controller['update']);router[_0x08ec('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x08ec('0x10')]);module[_0x08ec('0x11')]=router; \ No newline at end of file +var _0xa0ca=['isAuthenticated','post','create','/:id','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intSugarcrmField.controller','index','get'];(function(_0x4a60a3,_0xb8539c){var _0x348c8d=function(_0x2be68d){while(--_0x2be68d){_0x4a60a3['push'](_0x4a60a3['shift']());}};_0x348c8d(++_0xb8539c);}(_0xa0ca,0x156));var _0xaa0c=function(_0x27d7a9,_0x5a6c33){_0x27d7a9=_0x27d7a9-0x0;var _0x114c9f=_0xa0ca[_0x27d7a9];return _0x114c9f;};'use strict';var multer=require(_0xaa0c('0x0'));var util=require(_0xaa0c('0x1'));var path=require(_0xaa0c('0x2'));var timeout=require(_0xaa0c('0x3'));var express=require(_0xaa0c('0x4'));var router=express['Router']();var fs_extra=require(_0xaa0c('0x5'));var auth=require(_0xaa0c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaa0c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xaa0c('0x8')]);router[_0xaa0c('0x9')]('/:id',auth[_0xaa0c('0xa')](),controller['show']);router[_0xaa0c('0xb')]('/',auth[_0xaa0c('0xa')](),controller[_0xaa0c('0xc')]);router['put'](_0xaa0c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaa0c('0xe')](_0xaa0c('0xd'),auth[_0xaa0c('0xa')](),controller[_0xaa0c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 94735bf..9750b47 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js +++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd73c=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0xa3bf68,_0x551e70){var _0x1a9502=function(_0x4fa5f5){while(--_0x4fa5f5){_0xa3bf68['push'](_0xa3bf68['shift']());}};_0x1a9502(++_0x551e70);}(_0xd73c,0x74));var _0xcd73=function(_0x3972d7,_0x1f4b4f){_0x3972d7=_0x3972d7-0x0;var _0x2f9202=_0xd73c[_0x3972d7];return _0x2f9202;};'use strict';var Sequelize=require(_0xcd73('0x0'));module[_0xcd73('0x1')]={'type':{'type':Sequelize[_0xcd73('0x2')](_0xcd73('0x3'),_0xcd73('0x4'),_0xcd73('0x5'),_0xcd73('0x6'),_0xcd73('0x7')),'defaultValue':_0xcd73('0x3')},'content':{'type':Sequelize[_0xcd73('0x8')]},'key':{'type':Sequelize[_0xcd73('0x8')]},'keyType':{'type':Sequelize[_0xcd73('0x2')](_0xcd73('0x3'),'variable',_0xcd73('0x5'))},'keyContent':{'type':Sequelize[_0xcd73('0x8')]},'idField':{'type':Sequelize[_0xcd73('0x8')]},'nameField':{'type':Sequelize[_0xcd73('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcd73('0x8')]}}; \ No newline at end of file +var _0x8dc1=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x36072d,_0x24f414){var _0x32a52c=function(_0x19834c){while(--_0x19834c){_0x36072d['push'](_0x36072d['shift']());}};_0x32a52c(++_0x24f414);}(_0x8dc1,0x164));var _0x18dc=function(_0x17f52e,_0x4da384){_0x17f52e=_0x17f52e-0x0;var _0x27b3a9=_0x8dc1[_0x17f52e];return _0x27b3a9;};'use strict';var Sequelize=require(_0x18dc('0x0'));module[_0x18dc('0x1')]={'type':{'type':Sequelize[_0x18dc('0x2')](_0x18dc('0x3'),_0x18dc('0x4'),_0x18dc('0x5'),_0x18dc('0x6'),_0x18dc('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x18dc('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x18dc('0x3'),_0x18dc('0x4'),_0x18dc('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x18dc('0x8')]},'nameField':{'type':Sequelize[_0x18dc('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x18dc('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 48c7034..802a0eb 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.controller.js +++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd927=['destroy','end','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','update','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd927,0x164));var _0x7d92=function(_0x40a8d9,_0x210d98){_0x40a8d9=_0x40a8d9-0x0;var _0x34eba6=_0xd927[_0x40a8d9];return _0x34eba6;};'use strict';var emlformat=require(_0x7d92('0x0'));var rimraf=require(_0x7d92('0x1'));var zipdir=require(_0x7d92('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d92('0x3'));var moment=require('moment');var BPromise=require(_0x7d92('0x4'));var Mustache=require(_0x7d92('0x5'));var util=require(_0x7d92('0x6'));var path=require(_0x7d92('0x7'));var sox=require(_0x7d92('0x8'));var csv=require(_0x7d92('0x9'));var ejs=require(_0x7d92('0xa'));var fs=require('fs');var fs_extra=require(_0x7d92('0xb'));var _=require(_0x7d92('0xc'));var squel=require(_0x7d92('0xd'));var crypto=require(_0x7d92('0xe'));var jsforce=require(_0x7d92('0xf'));var deskjs=require(_0x7d92('0x10'));var toCsv=require(_0x7d92('0x9'));var querystring=require(_0x7d92('0x11'));var Papa=require(_0x7d92('0x12'));var Redis=require(_0x7d92('0x13'));var authService=require(_0x7d92('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d92('0x15'));var hardwareService=require(_0x7d92('0x16'));var logger=require(_0x7d92('0x17'))(_0x7d92('0x18'));var utils=require(_0x7d92('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7d92('0x1a'));var db=require(_0x7d92('0x1b'))['db'];function respondWithStatusCode(_0x462e27,_0x4f85f0){_0x4f85f0=_0x4f85f0||0xcc;return function(_0x39ffe2){if(_0x39ffe2){return _0x462e27[_0x7d92('0x1c')](_0x4f85f0);}return _0x462e27['status'](_0x4f85f0)['end']();};}function respondWithResult(_0x17b643,_0x1a19df){_0x1a19df=_0x1a19df||0xc8;return function(_0x5ef4ef){if(_0x5ef4ef){return _0x17b643[_0x7d92('0x1d')](_0x1a19df)[_0x7d92('0x1e')](_0x5ef4ef);}};}function respondWithFilteredResult(_0x3406fb,_0x583d5e){return function(_0x1fe5f4){if(_0x1fe5f4){var _0x543461=typeof _0x583d5e[_0x7d92('0x1f')]===_0x7d92('0x20')&&typeof _0x583d5e['limit']===_0x7d92('0x20');var _0x5855a3=_0x1fe5f4['count'];var _0x386820=_0x543461?0x0:_0x583d5e['offset'];var _0x19fa88=_0x543461?_0x1fe5f4[_0x7d92('0x21')]:_0x583d5e[_0x7d92('0x1f')]+_0x583d5e['limit'];var _0x1c68e8;if(_0x19fa88>=_0x5855a3){_0x19fa88=_0x5855a3;_0x1c68e8=0xc8;}else{_0x1c68e8=0xce;}_0x3406fb[_0x7d92('0x1d')](_0x1c68e8);return _0x3406fb['set'](_0x7d92('0x22'),_0x386820+'-'+_0x19fa88+'/'+_0x5855a3)[_0x7d92('0x1e')](_0x1fe5f4);}return null;};}function patchUpdates(_0x3788b7){return function(_0x56ad31){try{jsonpatch[_0x7d92('0x23')](_0x56ad31,_0x3788b7,!![]);}catch(_0xaacf3d){return BPromise[_0x7d92('0x24')](_0xaacf3d);}return _0x56ad31['save']();};}function saveUpdates(_0x270554,_0x1f733d){return function(_0x5e5e4c){if(_0x5e5e4c){return _0x5e5e4c[_0x7d92('0x25')](_0x270554)[_0x7d92('0x26')](function(_0x4f04ea){return _0x4f04ea;});}return null;};}function removeEntity(_0x42699c,_0x245743){return function(_0x5344a9){if(_0x5344a9){return _0x5344a9[_0x7d92('0x27')]()['then'](function(){_0x42699c['status'](0xcc)[_0x7d92('0x28')]();});}};}function handleEntityNotFound(_0x1b2a8a,_0x2f5c94){return function(_0x2eba92){if(!_0x2eba92){_0x1b2a8a['sendStatus'](0x194);}return _0x2eba92;};}function handleError(_0x37fe81,_0x5a7ea6){_0x5a7ea6=_0x5a7ea6||0x1f4;return function(_0x4d7f9a){logger[_0x7d92('0x29')](_0x4d7f9a[_0x7d92('0x2a')]);if(_0x4d7f9a[_0x7d92('0x2b')]){delete _0x4d7f9a['name'];}_0x37fe81['status'](_0x5a7ea6)[_0x7d92('0x2c')](_0x4d7f9a);};}exports[_0x7d92('0x2d')]=function(_0x4fa4d0,_0x343a10){var _0x1eacc7={},_0x3d09f2={},_0x306467={'count':0x0,'rows':[]};var _0x927ee5=_[_0x7d92('0x2e')](db[_0x7d92('0x2f')]['rawAttributes'],function(_0x515ced){return{'name':_0x515ced[_0x7d92('0x30')],'type':_0x515ced[_0x7d92('0x31')][_0x7d92('0x32')]};});_0x3d09f2[_0x7d92('0x33')]=_[_0x7d92('0x2e')](_0x927ee5,_0x7d92('0x2b'));_0x3d09f2[_0x7d92('0x34')]=_[_0x7d92('0x35')](_0x4fa4d0[_0x7d92('0x34')]);_0x3d09f2['filters']=_[_0x7d92('0x36')](_0x3d09f2[_0x7d92('0x33')],_0x3d09f2[_0x7d92('0x34')]);_0x1eacc7[_0x7d92('0x37')]=_['intersection'](_0x3d09f2['model'],qs['fields'](_0x4fa4d0[_0x7d92('0x34')][_0x7d92('0x38')]));_0x1eacc7[_0x7d92('0x37')]=_0x1eacc7[_0x7d92('0x37')]['length']?_0x1eacc7[_0x7d92('0x37')]:_0x3d09f2[_0x7d92('0x33')];if(!_0x4fa4d0[_0x7d92('0x34')]['hasOwnProperty'](_0x7d92('0x39'))){_0x1eacc7[_0x7d92('0x3a')]=qs[_0x7d92('0x3a')](_0x4fa4d0[_0x7d92('0x34')]['limit']);_0x1eacc7['offset']=qs[_0x7d92('0x1f')](_0x4fa4d0['query']['offset']);}_0x1eacc7[_0x7d92('0x3b')]=qs[_0x7d92('0x3c')](_0x4fa4d0[_0x7d92('0x34')]['sort']);_0x1eacc7[_0x7d92('0x3d')]=qs[_0x7d92('0x3e')](_[_0x7d92('0x3f')](_0x4fa4d0[_0x7d92('0x34')],_0x3d09f2['filters']),_0x927ee5);if(_0x4fa4d0[_0x7d92('0x34')][_0x7d92('0x40')]){_0x1eacc7[_0x7d92('0x3d')]=_[_0x7d92('0x41')](_0x1eacc7[_0x7d92('0x3d')],{'$or':_[_0x7d92('0x2e')](_0x927ee5,function(_0x3386e7){if(_0x3386e7[_0x7d92('0x31')]!==_0x7d92('0x42')){var _0x372f0f={};_0x372f0f[_0x3386e7[_0x7d92('0x2b')]]={'$like':'%'+_0x4fa4d0[_0x7d92('0x34')]['filter']+'%'};return _0x372f0f;}})});}_0x1eacc7=_[_0x7d92('0x41')]({},_0x1eacc7,_0x4fa4d0[_0x7d92('0x43')]);var _0x1e98d9={'where':_0x1eacc7[_0x7d92('0x3d')]};return db[_0x7d92('0x2f')][_0x7d92('0x21')](_0x1e98d9)[_0x7d92('0x26')](function(_0x1a14a8){_0x306467['count']=_0x1a14a8;if(_0x4fa4d0[_0x7d92('0x34')][_0x7d92('0x44')]){_0x1eacc7[_0x7d92('0x45')]=[{'all':!![]}];}return db['SugarcrmField'][_0x7d92('0x46')](_0x1eacc7);})[_0x7d92('0x26')](function(_0x1e7027){_0x306467[_0x7d92('0x47')]=_0x1e7027;return _0x306467;})[_0x7d92('0x26')](respondWithFilteredResult(_0x343a10,_0x1eacc7))[_0x7d92('0x48')](handleError(_0x343a10,null));};exports[_0x7d92('0x49')]=function(_0x2e121c,_0x5daeef){var _0x4fa505={'raw':!![],'where':{'id':_0x2e121c[_0x7d92('0x4a')]['id']}},_0x3bfee4={};_0x3bfee4[_0x7d92('0x33')]=_[_0x7d92('0x35')](db[_0x7d92('0x2f')]['rawAttributes']);_0x3bfee4['query']=_[_0x7d92('0x35')](_0x2e121c[_0x7d92('0x34')]);_0x3bfee4[_0x7d92('0x3e')]=_[_0x7d92('0x36')](_0x3bfee4[_0x7d92('0x33')],_0x3bfee4[_0x7d92('0x34')]);_0x4fa505[_0x7d92('0x37')]=_[_0x7d92('0x36')](_0x3bfee4['model'],qs['fields'](_0x2e121c[_0x7d92('0x34')][_0x7d92('0x38')]));_0x4fa505[_0x7d92('0x37')]=_0x4fa505[_0x7d92('0x37')][_0x7d92('0x4b')]?_0x4fa505[_0x7d92('0x37')]:_0x3bfee4[_0x7d92('0x33')];if(_0x2e121c['query'][_0x7d92('0x44')]){_0x4fa505['include']=[{'all':!![]}];}_0x4fa505=_[_0x7d92('0x41')]({},_0x4fa505,_0x2e121c[_0x7d92('0x43')]);return db[_0x7d92('0x2f')][_0x7d92('0x4c')](_0x4fa505)[_0x7d92('0x26')](handleEntityNotFound(_0x5daeef,null))[_0x7d92('0x26')](respondWithResult(_0x5daeef,null))[_0x7d92('0x48')](handleError(_0x5daeef,null));};exports['create']=function(_0x3de3b0,_0x3bb062){return db[_0x7d92('0x2f')][_0x7d92('0x4d')](_0x3de3b0['body'],{})[_0x7d92('0x26')](respondWithResult(_0x3bb062,0xc9))['catch'](handleError(_0x3bb062,null));};exports[_0x7d92('0x25')]=function(_0x429269,_0x30b9c1){if(_0x429269[_0x7d92('0x4e')]['id']){delete _0x429269[_0x7d92('0x4e')]['id'];}return db[_0x7d92('0x2f')]['find']({'where':{'id':_0x429269['params']['id']}})['then'](handleEntityNotFound(_0x30b9c1,null))[_0x7d92('0x26')](saveUpdates(_0x429269[_0x7d92('0x4e')],null))[_0x7d92('0x26')](respondWithResult(_0x30b9c1,null))[_0x7d92('0x48')](handleError(_0x30b9c1,null));};exports['destroy']=function(_0x82753d,_0x3f7b22){return db[_0x7d92('0x2f')][_0x7d92('0x4c')]({'where':{'id':_0x82753d[_0x7d92('0x4a')]['id']}})[_0x7d92('0x26')](handleEntityNotFound(_0x3f7b22,null))[_0x7d92('0x26')](removeEntity(_0x3f7b22,null))['catch'](handleError(_0x3f7b22,null));}; \ No newline at end of file +var _0x597d=['save','update','then','error','stack','name','send','map','SugarcrmField','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply'];(function(_0x30b189,_0xd873f1){var _0x5983c7=function(_0x1c0872){while(--_0x1c0872){_0x30b189['push'](_0x30b189['shift']());}};_0x5983c7(++_0xd873f1);}(_0x597d,0x10f));var _0xd597=function(_0x3b3643,_0x3f4a58){_0x3b3643=_0x3b3643-0x0;var _0xd093dd=_0x597d[_0x3b3643];return _0xd093dd;};'use strict';var emlformat=require(_0xd597('0x0'));var rimraf=require(_0xd597('0x1'));var zipdir=require(_0xd597('0x2'));var jsonpatch=require(_0xd597('0x3'));var rp=require('request-promise');var moment=require(_0xd597('0x4'));var BPromise=require(_0xd597('0x5'));var Mustache=require(_0xd597('0x6'));var util=require(_0xd597('0x7'));var path=require(_0xd597('0x8'));var sox=require(_0xd597('0x9'));var csv=require(_0xd597('0xa'));var ejs=require(_0xd597('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd597('0xc'));var squel=require('squel');var crypto=require(_0xd597('0xd'));var jsforce=require(_0xd597('0xe'));var deskjs=require(_0xd597('0xf'));var toCsv=require(_0xd597('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd597('0x10'));var authService=require(_0xd597('0x11'));var qs=require(_0xd597('0x12'));var as=require(_0xd597('0x13'));var hardwareService=require(_0xd597('0x14'));var logger=require(_0xd597('0x15'))(_0xd597('0x16'));var utils=require(_0xd597('0x17'));var config=require(_0xd597('0x18'));var licenseUtil=require(_0xd597('0x19'));var db=require(_0xd597('0x1a'))['db'];function respondWithStatusCode(_0x3a4a05,_0x35c556){_0x35c556=_0x35c556||0xcc;return function(_0x53541b){if(_0x53541b){return _0x3a4a05[_0xd597('0x1b')](_0x35c556);}return _0x3a4a05[_0xd597('0x1c')](_0x35c556)[_0xd597('0x1d')]();};}function respondWithResult(_0x2520cb,_0xa5e71f){_0xa5e71f=_0xa5e71f||0xc8;return function(_0x4ce769){if(_0x4ce769){return _0x2520cb[_0xd597('0x1c')](_0xa5e71f)[_0xd597('0x1e')](_0x4ce769);}};}function respondWithFilteredResult(_0xd10808,_0x47afa6){return function(_0xa57aee){if(_0xa57aee){var _0x229f5e=typeof _0x47afa6['offset']===_0xd597('0x1f')&&typeof _0x47afa6[_0xd597('0x20')]===_0xd597('0x1f');var _0x3c59fc=_0xa57aee[_0xd597('0x21')];var _0x2ea31c=_0x229f5e?0x0:_0x47afa6['offset'];var _0x558a03=_0x229f5e?_0xa57aee[_0xd597('0x21')]:_0x47afa6['offset']+_0x47afa6['limit'];var _0x1e3dd5;if(_0x558a03>=_0x3c59fc){_0x558a03=_0x3c59fc;_0x1e3dd5=0xc8;}else{_0x1e3dd5=0xce;}_0xd10808['status'](_0x1e3dd5);return _0xd10808[_0xd597('0x22')](_0xd597('0x23'),_0x2ea31c+'-'+_0x558a03+'/'+_0x3c59fc)[_0xd597('0x1e')](_0xa57aee);}return null;};}function patchUpdates(_0x49c0a8){return function(_0x363f67){try{jsonpatch[_0xd597('0x24')](_0x363f67,_0x49c0a8,!![]);}catch(_0x1b6d09){return BPromise['reject'](_0x1b6d09);}return _0x363f67[_0xd597('0x25')]();};}function saveUpdates(_0x1786da,_0x4c8217){return function(_0x1b1f6f){if(_0x1b1f6f){return _0x1b1f6f[_0xd597('0x26')](_0x1786da)[_0xd597('0x27')](function(_0x2d7ad6){return _0x2d7ad6;});}return null;};}function removeEntity(_0x2caf98,_0x52826e){return function(_0x435d21){if(_0x435d21){return _0x435d21['destroy']()[_0xd597('0x27')](function(){_0x2caf98[_0xd597('0x1c')](0xcc)[_0xd597('0x1d')]();});}};}function handleEntityNotFound(_0x32716b,_0x5da105){return function(_0x5bc70f){if(!_0x5bc70f){_0x32716b['sendStatus'](0x194);}return _0x5bc70f;};}function handleError(_0x598fe5,_0x1befa3){_0x1befa3=_0x1befa3||0x1f4;return function(_0x2815e0){logger[_0xd597('0x28')](_0x2815e0[_0xd597('0x29')]);if(_0x2815e0[_0xd597('0x2a')]){delete _0x2815e0[_0xd597('0x2a')];}_0x598fe5[_0xd597('0x1c')](_0x1befa3)[_0xd597('0x2b')](_0x2815e0);};}exports['index']=function(_0x22908d,_0x1ac2ab){var _0x1dec4e={},_0x2b749e={},_0x43e321={'count':0x0,'rows':[]};var _0x201dbc=_[_0xd597('0x2c')](db[_0xd597('0x2d')]['rawAttributes'],function(_0x34bdf7){return{'name':_0x34bdf7[_0xd597('0x2e')],'type':_0x34bdf7[_0xd597('0x2f')][_0xd597('0x30')]};});_0x2b749e[_0xd597('0x31')]=_[_0xd597('0x2c')](_0x201dbc,_0xd597('0x2a'));_0x2b749e[_0xd597('0x32')]=_['keys'](_0x22908d[_0xd597('0x32')]);_0x2b749e[_0xd597('0x33')]=_['intersection'](_0x2b749e[_0xd597('0x31')],_0x2b749e[_0xd597('0x32')]);_0x1dec4e['attributes']=_[_0xd597('0x34')](_0x2b749e[_0xd597('0x31')],qs[_0xd597('0x35')](_0x22908d[_0xd597('0x32')]['fields']));_0x1dec4e[_0xd597('0x36')]=_0x1dec4e[_0xd597('0x36')][_0xd597('0x37')]?_0x1dec4e[_0xd597('0x36')]:_0x2b749e[_0xd597('0x31')];if(!_0x22908d['query'][_0xd597('0x38')](_0xd597('0x39'))){_0x1dec4e[_0xd597('0x20')]=qs[_0xd597('0x20')](_0x22908d[_0xd597('0x32')][_0xd597('0x20')]);_0x1dec4e['offset']=qs[_0xd597('0x3a')](_0x22908d[_0xd597('0x32')][_0xd597('0x3a')]);}_0x1dec4e[_0xd597('0x3b')]=qs[_0xd597('0x3c')](_0x22908d['query'][_0xd597('0x3c')]);_0x1dec4e[_0xd597('0x3d')]=qs[_0xd597('0x33')](_[_0xd597('0x3e')](_0x22908d[_0xd597('0x32')],_0x2b749e[_0xd597('0x33')]),_0x201dbc);if(_0x22908d['query'][_0xd597('0x3f')]){_0x1dec4e[_0xd597('0x3d')]=_['merge'](_0x1dec4e[_0xd597('0x3d')],{'$or':_[_0xd597('0x2c')](_0x201dbc,function(_0x568e5b){if(_0x568e5b['type']!=='VIRTUAL'){var _0x53902f={};_0x53902f[_0x568e5b[_0xd597('0x2a')]]={'$like':'%'+_0x22908d[_0xd597('0x32')][_0xd597('0x3f')]+'%'};return _0x53902f;}})});}_0x1dec4e=_[_0xd597('0x40')]({},_0x1dec4e,_0x22908d[_0xd597('0x41')]);var _0x2e127b={'where':_0x1dec4e[_0xd597('0x3d')]};return db[_0xd597('0x2d')][_0xd597('0x21')](_0x2e127b)['then'](function(_0x1ccc17){_0x43e321[_0xd597('0x21')]=_0x1ccc17;if(_0x22908d['query'][_0xd597('0x42')]){_0x1dec4e['include']=[{'all':!![]}];}return db[_0xd597('0x2d')][_0xd597('0x43')](_0x1dec4e);})[_0xd597('0x27')](function(_0x115a53){_0x43e321['rows']=_0x115a53;return _0x43e321;})['then'](respondWithFilteredResult(_0x1ac2ab,_0x1dec4e))[_0xd597('0x44')](handleError(_0x1ac2ab,null));};exports[_0xd597('0x45')]=function(_0x386428,_0x35c0f5){var _0x103d5d={'raw':!![],'where':{'id':_0x386428[_0xd597('0x46')]['id']}},_0x3eac2f={};_0x3eac2f[_0xd597('0x31')]=_['keys'](db[_0xd597('0x2d')][_0xd597('0x47')]);_0x3eac2f['query']=_[_0xd597('0x48')](_0x386428[_0xd597('0x32')]);_0x3eac2f['filters']=_[_0xd597('0x34')](_0x3eac2f[_0xd597('0x31')],_0x3eac2f[_0xd597('0x32')]);_0x103d5d[_0xd597('0x36')]=_[_0xd597('0x34')](_0x3eac2f['model'],qs[_0xd597('0x35')](_0x386428[_0xd597('0x32')]['fields']));_0x103d5d[_0xd597('0x36')]=_0x103d5d[_0xd597('0x36')][_0xd597('0x37')]?_0x103d5d[_0xd597('0x36')]:_0x3eac2f[_0xd597('0x31')];if(_0x386428[_0xd597('0x32')]['includeAll']){_0x103d5d['include']=[{'all':!![]}];}_0x103d5d=_[_0xd597('0x40')]({},_0x103d5d,_0x386428[_0xd597('0x41')]);return db[_0xd597('0x2d')][_0xd597('0x49')](_0x103d5d)[_0xd597('0x27')](handleEntityNotFound(_0x35c0f5,null))[_0xd597('0x27')](respondWithResult(_0x35c0f5,null))[_0xd597('0x44')](handleError(_0x35c0f5,null));};exports[_0xd597('0x4a')]=function(_0x2afba8,_0x2c886b){return db['SugarcrmField'][_0xd597('0x4a')](_0x2afba8['body'],{})[_0xd597('0x27')](respondWithResult(_0x2c886b,0xc9))[_0xd597('0x44')](handleError(_0x2c886b,null));};exports[_0xd597('0x26')]=function(_0x45329f,_0x4d23e1){if(_0x45329f['body']['id']){delete _0x45329f['body']['id'];}return db['SugarcrmField'][_0xd597('0x49')]({'where':{'id':_0x45329f[_0xd597('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d23e1,null))[_0xd597('0x27')](saveUpdates(_0x45329f[_0xd597('0x4b')],null))[_0xd597('0x27')](respondWithResult(_0x4d23e1,null))[_0xd597('0x44')](handleError(_0x4d23e1,null));};exports[_0xd597('0x4c')]=function(_0x45018f,_0x4f16c0){return db[_0xd597('0x2d')][_0xd597('0x49')]({'where':{'id':_0x45018f[_0xd597('0x46')]['id']}})[_0xd597('0x27')](handleEntityNotFound(_0x4f16c0,null))[_0xd597('0x27')](removeEntity(_0x4f16c0,null))[_0xd597('0x44')](handleError(_0x4f16c0,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index ee8b174..5f33767 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.model.js +++ b/server/api/intSugarcrmField/intSugarcrmField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0cb=['bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','idField','FieldId','util','api','moment'];(function(_0x89a3e2,_0x153e84){var _0x42d184=function(_0x4d3ada){while(--_0x4d3ada){_0x89a3e2['push'](_0x89a3e2['shift']());}};_0x42d184(++_0x153e84);}(_0xa0cb,0x99));var _0xba0c=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xa0cb[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require(_0xba0c('0x0'));var logger=require('../../config/logger')(_0xba0c('0x1'));var moment=require(_0xba0c('0x2'));var BPromise=require(_0xba0c('0x3'));var rp=require(_0xba0c('0x4'));var fs=require('fs');var path=require(_0xba0c('0x5'));var rimraf=require('rimraf');var config=require(_0xba0c('0x6'));var attributes=require(_0xba0c('0x7'));module[_0xba0c('0x8')]=function(_0x16ab99,_0x3ab92d){return _0x16ab99[_0xba0c('0x9')]('SugarcrmField',attributes,{'tableName':_0xba0c('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xba0c('0xb'),_0xba0c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f5d=['exports','define','SugarcrmField','int_sugarcrm_fields','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x3a269a,_0x13d26a){var _0x4ff681=function(_0xcdd5a6){while(--_0xcdd5a6){_0x3a269a['push'](_0x3a269a['shift']());}};_0x4ff681(++_0x13d26a);}(_0x2f5d,0x83));var _0xd2f5=function(_0x3fd491,_0x2ef1da){_0x3fd491=_0x3fd491-0x0;var _0x4ea0c7=_0x2f5d[_0x3fd491];return _0x4ea0c7;};'use strict';var _=require('lodash');var util=require(_0xd2f5('0x0'));var logger=require(_0xd2f5('0x1'))(_0xd2f5('0x2'));var moment=require(_0xd2f5('0x3'));var BPromise=require(_0xd2f5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2f5('0x5'));var rimraf=require(_0xd2f5('0x6'));var config=require(_0xd2f5('0x7'));var attributes=require(_0xd2f5('0x8'));module[_0xd2f5('0x9')]=function(_0x298e80,_0x29c6ea){return _0x298e80[_0xd2f5('0xa')](_0xd2f5('0xb'),attributes,{'tableName':_0xd2f5('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xd2f5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index b3fb210..ab2684d 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js +++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c98=['message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5aa04a,_0x30597b){var _0x19a5b3=function(_0x5f27aa){while(--_0x5f27aa){_0x5aa04a['push'](_0x5aa04a['shift']());}};_0x19a5b3(++_0x30597b);}(_0x6c98,0xff));var _0x86c9=function(_0x3b9976,_0x18a59e){_0x3b9976=_0x3b9976-0x0;var _0x55059c=_0x6c98[_0x3b9976];return _0x55059c;};'use strict';var _=require(_0x86c9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86c9('0x1'));var db=require(_0x86c9('0x2'))['db'];var utils=require(_0x86c9('0x3'));var logger=require(_0x86c9('0x4'))(_0x86c9('0x5'));var config=require('../../config/environment');var jayson=require(_0x86c9('0x6'));var client=jayson[_0x86c9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f6a89,_0x420fbc,_0x1c7eae){return new BPromise(function(_0x3b15e9,_0x5b8408){return client['request'](_0x2f6a89,_0x1c7eae)[_0x86c9('0x8')](function(_0x405bbc){logger[_0x86c9('0x9')](_0x86c9('0xa'),_0x420fbc,_0x86c9('0xb'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x420fbc,_0x86c9('0xb'),JSON[_0x86c9('0xc')](_0x405bbc));if(_0x405bbc[_0x86c9('0xd')]){if(_0x405bbc[_0x86c9('0xd')][_0x86c9('0xe')]===0x1f4){logger['error'](_0x86c9('0xa'),_0x420fbc,_0x405bbc[_0x86c9('0xd')][_0x86c9('0xf')]);return _0x5b8408(_0x405bbc['error'][_0x86c9('0xf')]);}logger[_0x86c9('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x420fbc,_0x405bbc[_0x86c9('0xd')]['message']);return _0x3b15e9(_0x405bbc[_0x86c9('0xd')][_0x86c9('0xf')]);}else{logger[_0x86c9('0x9')]('SugarcrmField,\x20%s,\x20%s',_0x420fbc,_0x86c9('0xb'));_0x3b15e9(_0x405bbc[_0x86c9('0x10')]['message']);}})[_0x86c9('0x11')](function(_0x31c8f1){logger[_0x86c9('0xd')](_0x86c9('0xa'),_0x420fbc,_0x31c8f1);_0x5b8408(_0x31c8f1);});});} \ No newline at end of file +var _0x7be0=['info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x1425f0,_0x4ca1a9){var _0x61e616=function(_0x106d97){while(--_0x106d97){_0x1425f0['push'](_0x1425f0['shift']());}};_0x61e616(++_0x4ca1a9);}(_0x7be0,0x1d8));var _0x07be=function(_0x537935,_0x52f63a){_0x537935=_0x537935-0x0;var _0x10a471=_0x7be0[_0x537935];return _0x10a471;};'use strict';var _=require(_0x07be('0x0'));var util=require(_0x07be('0x1'));var moment=require(_0x07be('0x2'));var BPromise=require(_0x07be('0x3'));var rs=require(_0x07be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x07be('0x5'));var logger=require(_0x07be('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x07be('0x7')][_0x07be('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e9096,_0x46e63a,_0x52f235){return new BPromise(function(_0x51ab29,_0x972624){return client[_0x07be('0x9')](_0x1e9096,_0x52f235)[_0x07be('0xa')](function(_0x14041c){logger[_0x07be('0xb')](_0x07be('0xc'),_0x46e63a,_0x07be('0xd'));logger[_0x07be('0xe')](_0x07be('0xf'),_0x46e63a,'request\x20sent',JSON[_0x07be('0x10')](_0x14041c));if(_0x14041c[_0x07be('0x11')]){if(_0x14041c[_0x07be('0x11')][_0x07be('0x12')]===0x1f4){logger[_0x07be('0x11')](_0x07be('0xc'),_0x46e63a,_0x14041c[_0x07be('0x11')][_0x07be('0x13')]);return _0x972624(_0x14041c[_0x07be('0x11')][_0x07be('0x13')]);}logger[_0x07be('0x11')](_0x07be('0xc'),_0x46e63a,_0x14041c[_0x07be('0x11')]['message']);return _0x51ab29(_0x14041c[_0x07be('0x11')][_0x07be('0x13')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x46e63a,'request\x20sent');_0x51ab29(_0x14041c['result']['message']);}})[_0x07be('0x14')](function(_0x25484c){logger[_0x07be('0x11')](_0x07be('0xc'),_0x46e63a,_0x25484c);_0x972624(_0x25484c);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 1f7dc63..3e31d88 100644 --- a/server/api/intVtigerAccount/index.js +++ b/server/api/intVtigerAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x083e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','getFields','post','create','/:id/configurations','update','delete','destroy','exports','multer','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x083e,0x140));var _0xe083=function(_0x2cc594,_0x4d727b){_0x2cc594=_0x2cc594-0x0;var _0x4abff7=_0x083e[_0x2cc594];return _0x4abff7;};'use strict';var multer=require(_0xe083('0x0'));var util=require(_0xe083('0x1'));var path=require('path');var timeout=require(_0xe083('0x2'));var express=require('express');var router=express[_0xe083('0x3')]();var fs_extra=require(_0xe083('0x4'));var auth=require(_0xe083('0x5'));var interaction=require(_0xe083('0x6'));var config=require(_0xe083('0x7'));var controller=require(_0xe083('0x8'));router[_0xe083('0x9')]('/',auth['isAuthenticated'](),controller[_0xe083('0xa')]);router[_0xe083('0x9')](_0xe083('0xb'),auth[_0xe083('0xc')](),controller[_0xe083('0xd')]);router[_0xe083('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe083('0xe')]);router[_0xe083('0x9')]('/:id/fields',auth[_0xe083('0xc')](),controller[_0xe083('0xf')]);router[_0xe083('0x10')]('/',auth[_0xe083('0xc')](),controller[_0xe083('0x11')]);router[_0xe083('0x10')](_0xe083('0x12'),auth[_0xe083('0xc')](),controller['addConfiguration']);router['put']('/:id',auth[_0xe083('0xc')](),controller[_0xe083('0x13')]);router[_0xe083('0x14')](_0xe083('0xb'),auth['isAuthenticated'](),controller[_0xe083('0x15')]);module[_0xe083('0x16')]=router; \ No newline at end of file +var _0xce9b=['./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xf638eb,_0x342d34){var _0x5419a9=function(_0x1a09e7){while(--_0x1a09e7){_0xf638eb['push'](_0xf638eb['shift']());}};_0x5419a9(++_0x342d34);}(_0xce9b,0xc6));var _0xbce9=function(_0x44725e,_0x25f88b){_0x44725e=_0x44725e-0x0;var _0x2ec06b=_0xce9b[_0x44725e];return _0x2ec06b;};'use strict';var multer=require(_0xbce9('0x0'));var util=require(_0xbce9('0x1'));var path=require(_0xbce9('0x2'));var timeout=require(_0xbce9('0x3'));var express=require(_0xbce9('0x4'));var router=express[_0xbce9('0x5')]();var fs_extra=require(_0xbce9('0x6'));var auth=require(_0xbce9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbce9('0x8'));var controller=require(_0xbce9('0x9'));router[_0xbce9('0xa')]('/',auth[_0xbce9('0xb')](),controller[_0xbce9('0xc')]);router[_0xbce9('0xa')](_0xbce9('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xbce9('0xa')](_0xbce9('0xe'),auth['isAuthenticated'](),controller[_0xbce9('0xf')]);router[_0xbce9('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xbce9('0x10')]);router[_0xbce9('0x11')]('/',auth[_0xbce9('0xb')](),controller['create']);router['post'](_0xbce9('0xe'),auth[_0xbce9('0xb')](),controller[_0xbce9('0x12')]);router[_0xbce9('0x13')](_0xbce9('0xd'),auth[_0xbce9('0xb')](),controller[_0xbce9('0x14')]);router[_0xbce9('0x15')](_0xbce9('0xd'),auth[_0xbce9('0xb')](),controller['destroy']);module[_0xbce9('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 1fc0c92..b20f195 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js +++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x019d=['exports','STRING','sequelize'];(function(_0x560589,_0x3889f0){var _0x386054=function(_0x3cba96){while(--_0x3cba96){_0x560589['push'](_0x560589['shift']());}};_0x386054(++_0x3889f0);}(_0x019d,0x16d));var _0xd019=function(_0x25e501,_0x317546){_0x25e501=_0x25e501-0x0;var _0xec8cf1=_0x019d[_0x25e501];return _0xec8cf1;};'use strict';var Sequelize=require(_0xd019('0x0'));module[_0xd019('0x1')]={'name':{'type':Sequelize[_0xd019('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd019('0x2')]},'username':{'type':Sequelize[_0xd019('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd019('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xd019('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xd019('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x786f=['STRING','HelpDesk','sequelize','exports'];(function(_0x19b26d,_0x147e71){var _0x502f37=function(_0x3d6faf){while(--_0x3d6faf){_0x19b26d['push'](_0x19b26d['shift']());}};_0x502f37(++_0x147e71);}(_0x786f,0x1ae));var _0xf786=function(_0x210b46,_0x52a05f){_0x210b46=_0x210b46-0x0;var _0x203df2=_0x786f[_0x210b46];return _0x203df2;};'use strict';var Sequelize=require(_0xf786('0x0'));module[_0xf786('0x1')]={'name':{'type':Sequelize[_0xf786('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf786('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf786('0x3')},'remoteUri':{'type':Sequelize[_0xf786('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf786('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 56713ea..905d516 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.controller.js +++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4dad=['vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','limit','offset','count','Content-Range','apply','save','then','end','error','stack','name','send','index','map','VtigerAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','update','destroy','getConfigurations','findOne','VtigerConfiguration','pick','AccountId','getSubjects','VtigerField','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','result','token','describe','sessionName','autogenerated','owner','remove','editable','false','label','cf_','picklist','picklistValues','value','log'];(function(_0x315003,_0x22db8d){var _0x7c4b0e=function(_0x8f9dd0){while(--_0x8f9dd0){_0x315003['push'](_0x315003['shift']());}};_0x7c4b0e(++_0x22db8d);}(_0x4dad,0x1dd));var _0xd4da=function(_0x3a86de,_0x4c792b){_0x3a86de=_0x3a86de-0x0;var _0x3c6d7b=_0x4dad[_0x3a86de];return _0x3c6d7b;};'use strict';var emlformat=require(_0xd4da('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd4da('0x1'));var rp=require(_0xd4da('0x2'));var moment=require('moment');var BPromise=require(_0xd4da('0x3'));var Mustache=require(_0xd4da('0x4'));var util=require(_0xd4da('0x5'));var path=require(_0xd4da('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd4da('0x7'));var fs=require('fs');var fs_extra=require(_0xd4da('0x8'));var _=require(_0xd4da('0x9'));var squel=require(_0xd4da('0xa'));var crypto=require(_0xd4da('0xb'));var jsforce=require(_0xd4da('0xc'));var deskjs=require(_0xd4da('0xd'));var toCsv=require(_0xd4da('0xe'));var querystring=require(_0xd4da('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd4da('0x10'));var qs=require(_0xd4da('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4da('0x12'));var logger=require(_0xd4da('0x13'))(_0xd4da('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd4da('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd4da('0x16'));function respondWithStatusCode(_0xb466e6,_0x28674a){_0x28674a=_0x28674a||0xcc;return function(_0x4038e2){if(_0x4038e2){return _0xb466e6[_0xd4da('0x17')](_0x28674a);}return _0xb466e6[_0xd4da('0x18')](_0x28674a)['end']();};}function respondWithResult(_0x4ab84a,_0x267924){_0x267924=_0x267924||0xc8;return function(_0xa561de){if(_0xa561de){return _0x4ab84a['status'](_0x267924)[_0xd4da('0x19')](_0xa561de);}};}function respondWithFilteredResult(_0x223de0,_0x1172fa){return function(_0x51391c){if(_0x51391c){var _0x2c043b=typeof _0x1172fa['offset']==='undefined'&&typeof _0x1172fa[_0xd4da('0x1a')]==='undefined';var _0x2baa8d=_0x51391c['count'];var _0x549ad0=_0x2c043b?0x0:_0x1172fa[_0xd4da('0x1b')];var _0x284bd0=_0x2c043b?_0x51391c[_0xd4da('0x1c')]:_0x1172fa[_0xd4da('0x1b')]+_0x1172fa[_0xd4da('0x1a')];var _0x25ad2d;if(_0x284bd0>=_0x2baa8d){_0x284bd0=_0x2baa8d;_0x25ad2d=0xc8;}else{_0x25ad2d=0xce;}_0x223de0[_0xd4da('0x18')](_0x25ad2d);return _0x223de0['set'](_0xd4da('0x1d'),_0x549ad0+'-'+_0x284bd0+'/'+_0x2baa8d)[_0xd4da('0x19')](_0x51391c);}return null;};}function patchUpdates(_0x44bf5c){return function(_0xb0459c){try{jsonpatch[_0xd4da('0x1e')](_0xb0459c,_0x44bf5c,!![]);}catch(_0xdd5dd3){return BPromise['reject'](_0xdd5dd3);}return _0xb0459c[_0xd4da('0x1f')]();};}function saveUpdates(_0x5b9a01,_0x5e973b){return function(_0x110bf2){if(_0x110bf2){return _0x110bf2['update'](_0x5b9a01)[_0xd4da('0x20')](function(_0x39a1a3){return _0x39a1a3;});}return null;};}function removeEntity(_0x45dba3,_0x5518fd){return function(_0x136331){if(_0x136331){return _0x136331['destroy']()[_0xd4da('0x20')](function(){_0x45dba3[_0xd4da('0x18')](0xcc)[_0xd4da('0x21')]();});}};}function handleEntityNotFound(_0x2eec3d,_0x57a0c0){return function(_0x14a81d){if(!_0x14a81d){_0x2eec3d[_0xd4da('0x17')](0x194);}return _0x14a81d;};}function handleError(_0x1eb7ef,_0x4d7225){_0x4d7225=_0x4d7225||0x1f4;return function(_0x1a16d7){logger[_0xd4da('0x22')](_0x1a16d7[_0xd4da('0x23')]);if(_0x1a16d7[_0xd4da('0x24')]){delete _0x1a16d7[_0xd4da('0x24')];}_0x1eb7ef[_0xd4da('0x18')](_0x4d7225)[_0xd4da('0x25')](_0x1a16d7);};}exports[_0xd4da('0x26')]=function(_0xfad5b8,_0x241abe){var _0xaac90={},_0x433484={},_0x108720={'count':0x0,'rows':[]};var _0x5c00d6=_[_0xd4da('0x27')](db[_0xd4da('0x28')]['rawAttributes'],function(_0x399654){return{'name':_0x399654[_0xd4da('0x29')],'type':_0x399654[_0xd4da('0x2a')][_0xd4da('0x2b')]};});_0x433484[_0xd4da('0x2c')]=_[_0xd4da('0x27')](_0x5c00d6,'name');_0x433484[_0xd4da('0x2d')]=_[_0xd4da('0x2e')](_0xfad5b8[_0xd4da('0x2d')]);_0x433484[_0xd4da('0x2f')]=_[_0xd4da('0x30')](_0x433484[_0xd4da('0x2c')],_0x433484[_0xd4da('0x2d')]);_0xaac90['attributes']=_[_0xd4da('0x30')](_0x433484[_0xd4da('0x2c')],qs['fields'](_0xfad5b8[_0xd4da('0x2d')]['fields']));_0xaac90['attributes']=_0xaac90[_0xd4da('0x31')][_0xd4da('0x32')]?_0xaac90[_0xd4da('0x31')]:_0x433484['model'];if(!_0xfad5b8['query'][_0xd4da('0x33')](_0xd4da('0x34'))){_0xaac90[_0xd4da('0x1a')]=qs['limit'](_0xfad5b8[_0xd4da('0x2d')][_0xd4da('0x1a')]);_0xaac90[_0xd4da('0x1b')]=qs[_0xd4da('0x1b')](_0xfad5b8[_0xd4da('0x2d')][_0xd4da('0x1b')]);}_0xaac90[_0xd4da('0x35')]=qs[_0xd4da('0x36')](_0xfad5b8[_0xd4da('0x2d')]['sort']);_0xaac90[_0xd4da('0x37')]=qs['filters'](_['pick'](_0xfad5b8['query'],_0x433484[_0xd4da('0x2f')]),_0x5c00d6);if(_0xfad5b8[_0xd4da('0x2d')][_0xd4da('0x38')]){_0xaac90['where']=_[_0xd4da('0x39')](_0xaac90[_0xd4da('0x37')],{'$or':_['map'](_0x5c00d6,function(_0x1d6ff8){if(_0x1d6ff8['type']!==_0xd4da('0x3a')){var _0x2ee52d={};_0x2ee52d[_0x1d6ff8[_0xd4da('0x24')]]={'$like':'%'+_0xfad5b8[_0xd4da('0x2d')][_0xd4da('0x38')]+'%'};return _0x2ee52d;}})});}_0xaac90=_[_0xd4da('0x39')]({},_0xaac90,_0xfad5b8[_0xd4da('0x3b')]);var _0x4d5b27={'where':_0xaac90[_0xd4da('0x37')]};return db[_0xd4da('0x28')]['count'](_0x4d5b27)[_0xd4da('0x20')](function(_0x47a664){_0x108720['count']=_0x47a664;if(_0xfad5b8[_0xd4da('0x2d')][_0xd4da('0x3c')]){_0xaac90[_0xd4da('0x3d')]=[{'all':!![]}];}return db[_0xd4da('0x28')][_0xd4da('0x3e')](_0xaac90);})[_0xd4da('0x20')](function(_0x1190bf){_0x108720[_0xd4da('0x3f')]=_0x1190bf;return _0x108720;})['then'](respondWithFilteredResult(_0x241abe,_0xaac90))[_0xd4da('0x40')](handleError(_0x241abe,null));};exports[_0xd4da('0x41')]=function(_0xa2d9ba,_0x341dda){var _0x1042f8={'raw':![],'where':{'id':_0xa2d9ba[_0xd4da('0x42')]['id']}},_0xd91ebe={};_0xd91ebe['model']=_['keys'](db[_0xd4da('0x28')][_0xd4da('0x43')]);_0xd91ebe[_0xd4da('0x2d')]=_['keys'](_0xa2d9ba[_0xd4da('0x2d')]);_0xd91ebe[_0xd4da('0x2f')]=_['intersection'](_0xd91ebe[_0xd4da('0x2c')],_0xd91ebe[_0xd4da('0x2d')]);_0x1042f8[_0xd4da('0x31')]=_['intersection'](_0xd91ebe[_0xd4da('0x2c')],qs[_0xd4da('0x44')](_0xa2d9ba[_0xd4da('0x2d')][_0xd4da('0x44')]));_0x1042f8[_0xd4da('0x31')]=_0x1042f8['attributes'][_0xd4da('0x32')]?_0x1042f8[_0xd4da('0x31')]:_0xd91ebe['model'];if(_0xa2d9ba[_0xd4da('0x2d')][_0xd4da('0x3c')]){_0x1042f8[_0xd4da('0x3d')]=[{'all':!![]}];}_0x1042f8=_['merge']({},_0x1042f8,_0xa2d9ba[_0xd4da('0x3b')]);return db['VtigerAccount'][_0xd4da('0x45')](_0x1042f8)[_0xd4da('0x20')](handleEntityNotFound(_0x341dda,null))[_0xd4da('0x20')](respondWithResult(_0x341dda,null))[_0xd4da('0x40')](handleError(_0x341dda,null));};exports[_0xd4da('0x46')]=function(_0xef8ffb,_0x11f0ba){return db[_0xd4da('0x28')][_0xd4da('0x46')](_0xef8ffb[_0xd4da('0x47')],{})[_0xd4da('0x20')](respondWithResult(_0x11f0ba,0xc9))[_0xd4da('0x40')](handleError(_0x11f0ba,null));};exports[_0xd4da('0x48')]=function(_0x50b0d9,_0x6d9108){if(_0x50b0d9[_0xd4da('0x47')]['id']){delete _0x50b0d9[_0xd4da('0x47')]['id'];}return db[_0xd4da('0x28')][_0xd4da('0x45')]({'where':{'id':_0x50b0d9[_0xd4da('0x42')]['id']}})[_0xd4da('0x20')](handleEntityNotFound(_0x6d9108,null))[_0xd4da('0x20')](saveUpdates(_0x50b0d9['body'],null))[_0xd4da('0x20')](respondWithResult(_0x6d9108,null))[_0xd4da('0x40')](handleError(_0x6d9108,null));};exports[_0xd4da('0x49')]=function(_0x4049d0,_0x696e9c){return db[_0xd4da('0x28')][_0xd4da('0x45')]({'where':{'id':_0x4049d0[_0xd4da('0x42')]['id']}})[_0xd4da('0x20')](handleEntityNotFound(_0x696e9c,null))[_0xd4da('0x20')](removeEntity(_0x696e9c,null))[_0xd4da('0x40')](handleError(_0x696e9c,null));};exports[_0xd4da('0x4a')]=function(_0x4887ac,_0x56dcba,_0x22d5f4){var _0x375136={};var _0x5e9ecc={};var _0x394cad;var _0x5461f0;return db[_0xd4da('0x28')][_0xd4da('0x4b')]({'where':{'id':_0x4887ac[_0xd4da('0x42')]['id']}})[_0xd4da('0x20')](handleEntityNotFound(_0x56dcba,null))[_0xd4da('0x20')](function(_0x4d4dcd){if(_0x4d4dcd){_0x394cad=_0x4d4dcd;_0x5e9ecc[_0xd4da('0x2c')]=_[_0xd4da('0x2e')](db[_0xd4da('0x4c')][_0xd4da('0x43')]);_0x5e9ecc[_0xd4da('0x2d')]=_[_0xd4da('0x2e')](_0x4887ac[_0xd4da('0x2d')]);_0x5e9ecc['filters']=_[_0xd4da('0x30')](_0x5e9ecc['model'],_0x5e9ecc[_0xd4da('0x2d')]);_0x375136[_0xd4da('0x31')]=_[_0xd4da('0x30')](_0x5e9ecc[_0xd4da('0x2c')],qs[_0xd4da('0x44')](_0x4887ac[_0xd4da('0x2d')]['fields']));_0x375136[_0xd4da('0x31')]=_0x375136[_0xd4da('0x31')]['length']?_0x375136[_0xd4da('0x31')]:_0x5e9ecc[_0xd4da('0x2c')];_0x375136[_0xd4da('0x35')]=qs['sort'](_0x4887ac[_0xd4da('0x2d')][_0xd4da('0x36')]);_0x375136[_0xd4da('0x37')]=qs['filters'](_[_0xd4da('0x4d')](_0x4887ac[_0xd4da('0x2d')],_0x5e9ecc[_0xd4da('0x2f')]));if(_0x4887ac[_0xd4da('0x2d')][_0xd4da('0x38')]){_0x375136[_0xd4da('0x37')]=_[_0xd4da('0x39')](_0x375136[_0xd4da('0x37')],{'$or':_['map'](_0x375136[_0xd4da('0x31')],function(_0x506bd7){var _0x4d3d3b={};_0x4d3d3b[_0x506bd7]={'$like':'%'+_0x4887ac[_0xd4da('0x2d')]['filter']+'%'};return _0x4d3d3b;})});}_0x375136=_[_0xd4da('0x39')]({},_0x375136,_0x4887ac[_0xd4da('0x3b')]);return _0x394cad[_0xd4da('0x4a')](_0x375136);}})['then'](function(_0x3117c4){if(_0x3117c4){_0x5461f0=_0x3117c4[_0xd4da('0x32')];if(!_0x4887ac[_0xd4da('0x2d')][_0xd4da('0x33')](_0xd4da('0x34'))){_0x375136[_0xd4da('0x1a')]=qs[_0xd4da('0x1a')](_0x4887ac[_0xd4da('0x2d')][_0xd4da('0x1a')]);_0x375136[_0xd4da('0x1b')]=qs[_0xd4da('0x1b')](_0x4887ac['query'][_0xd4da('0x1b')]);}return _0x394cad[_0xd4da('0x4a')](_0x375136);}})['then'](function(_0x517f78){if(_0x517f78){return _0x517f78?{'count':_0x5461f0,'rows':_0x517f78}:null;}})[_0xd4da('0x20')](respondWithResult(_0x56dcba,null))[_0xd4da('0x40')](handleError(_0x56dcba,null));};exports['addConfiguration']=function(_0xb6676,_0x225a1b,_0x2cd5bc){if(_0xb6676[_0xd4da('0x47')]['id']){delete _0xb6676[_0xd4da('0x47')]['id'];}return db[_0xd4da('0x28')][_0xd4da('0x4b')]({'where':{'id':_0xb6676[_0xd4da('0x42')]['id']}})[_0xd4da('0x20')](handleEntityNotFound(_0x225a1b,null))['then'](function(_0x6906a){if(_0x6906a){_0xb6676[_0xd4da('0x47')][_0xd4da('0x4e')]=_0x6906a['id'];_0xb6676[_0xd4da('0x47')]['Subjects']=integrations[_0xd4da('0x4f')](_0xb6676[_0xd4da('0x47')]['channel'],_0xb6676[_0xd4da('0x47')]['type']);_0xb6676[_0xd4da('0x47')]['Descriptions']=integrations['getDescriptions'](_0xb6676[_0xd4da('0x47')]['channel'],_0xb6676['body'][_0xd4da('0x2a')]);return db[_0xd4da('0x4c')]['create'](_0xb6676[_0xd4da('0x47')],{'include':[{'model':db[_0xd4da('0x50')],'as':'Subjects'},{'model':db[_0xd4da('0x50')],'as':_0xd4da('0x51')}]});}return null;})[_0xd4da('0x20')](respondWithResult(_0x225a1b,null))[_0xd4da('0x40')](handleError(_0x225a1b,null));};var md5=require(_0xd4da('0x52'));exports[_0xd4da('0x53')]=function(_0x2a6512,_0x3e4bbb,_0x355dcd){var _0x48aed9=null;var _0x52c479=null;var _0x1c3387=null;var _0x286d4a=null;var _0x5c97f5='';return db['VtigerAccount'][_0xd4da('0x4b')]({'where':{'id':_0x2a6512[_0xd4da('0x42')]['id']},'attributes':['id',_0xd4da('0x24'),_0xd4da('0x54'),_0xd4da('0x55'),_0xd4da('0x56'),_0xd4da('0x57'),_0xd4da('0x58'),_0xd4da('0x59')]})[_0xd4da('0x20')](handleEntityNotFound(_0x3e4bbb,null))[_0xd4da('0x20')](function(_0x44215c){if(_0x44215c){_0x48aed9=_0x44215c[_0xd4da('0x54')];_0x52c479=_0x44215c[_0xd4da('0x59')];_0x1c3387=_0x44215c['moduleName'];_0x5c97f5=_0x44215c[_0xd4da('0x57')];var _0x4013e2=_0x5c97f5[_0xd4da('0x5a')](-0x1);if(_0x4013e2==='/'){_0x5c97f5=_0x5c97f5['substring'](0x0,_0x5c97f5[_0xd4da('0x5b')](_0x4013e2));}_0x286d4a=util[_0xd4da('0x5c')](_0xd4da('0x5d'),_0x5c97f5);var _0x40d217={'method':_0xd4da('0x5e'),'uri':_0x286d4a,'qs':{'operation':_0xd4da('0x5f'),'username':_0x44215c[_0xd4da('0x54')]},'json':!![]};return rp(_0x40d217);}})[_0xd4da('0x20')](function(_0xcf8171){if(_0xcf8171[_0xd4da('0x60')]){var _0x1743f3={'method':_0xd4da('0x61'),'uri':_0x286d4a,'form':{'operation':'login','username':_0x48aed9,'accessKey':md5(_0xcf8171[_0xd4da('0x62')][_0xd4da('0x63')]+_0x52c479)},'json':!![]};return rp(_0x1743f3);}})[_0xd4da('0x20')](function(_0xf5225){if(_0xf5225[_0xd4da('0x60')]){var _0x5f52b2={'method':_0xd4da('0x5e'),'uri':_0x286d4a,'qs':{'operation':_0xd4da('0x64'),'username':_0x48aed9,'sessionName':_0xf5225[_0xd4da('0x62')][_0xd4da('0x65')],'elementType':_0x1c3387},'json':!![]};return rp(_0x5f52b2);}})[_0xd4da('0x20')](function(_0x51dfa8){if(_0x51dfa8[_0xd4da('0x60')]){var _0x3e5f7f=[_0xd4da('0x66'),'reference',_0xd4da('0x67')];_[_0xd4da('0x68')](_0x51dfa8[_0xd4da('0x62')][_0xd4da('0x44')],function(_0x953950){return _0x3e5f7f['includes'](_0x953950[_0xd4da('0x2a')][_0xd4da('0x24')]);});_[_0xd4da('0x68')](_0x51dfa8[_0xd4da('0x62')][_0xd4da('0x44')],function(_0x383854){return _0x383854[_0xd4da('0x69')]===_0xd4da('0x6a');});return{'count':_0x51dfa8[_0xd4da('0x62')][_0xd4da('0x44')]['length'],'rows':_[_0xd4da('0x27')](_0x51dfa8['result'][_0xd4da('0x44')],function(_0x4e0f62){return{'id':_0x4e0f62[_0xd4da('0x24')],'name':_0x4e0f62[_0xd4da('0x6b')],'custom':_['startsWith'](_0x4e0f62['name'],_0xd4da('0x6c'))?!![]:![],'options':_0x4e0f62[_0xd4da('0x2a')]['name']===_0xd4da('0x6d')&&_0x4e0f62[_0xd4da('0x2a')][_0xd4da('0x6e')][_0xd4da('0x32')]>0x0?_[_0xd4da('0x27')](_0x4e0f62[_0xd4da('0x2a')][_0xd4da('0x6e')],function(_0x50dd7c){return{'name':_0x50dd7c[_0xd4da('0x6b')],'value':_0x50dd7c[_0xd4da('0x6f')]};}):[]};})};}})[_0xd4da('0x20')](respondWithResult(_0x3e4bbb,null))['catch'](function(_0x326ee3){console[_0xd4da('0x70')](_0xd4da('0x71')+_0x326ee3);var _0x50b773=_0x2a6512[_0xd4da('0x2d')]['test']?0x1f4:_0x326ee3[_0xd4da('0x72')]||0x1f4;logger['error'](_0xd4da('0x73'),_0xd4da('0x53'),_0x50b773,JSON[_0xd4da('0x74')](_0x326ee3));delete _0x326ee3['name'];if(_0x50b773===0x191){_0x50b773=0x190;}_0x3e4bbb[_0xd4da('0x18')](_0x50b773)['send'](_0x2a6512[_0xd4da('0x2d')][_0xd4da('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x326ee3['statusCode']}:_0x326ee3);});}; \ No newline at end of file +var _0x0023=['substring','lastIndexOf','format','GET','getchallenge','POST','login','result','token','success','describe','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','includeAll','findAll','keys','length','include','catch','create','body','find','params','getConfigurations','VtigerConfiguration','filter','addConfiguration','findOne','AccountId','Subjects','getDescriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','accessKey'];(function(_0x179118,_0x5ad20f){var _0x18b819=function(_0x56d91a){while(--_0x56d91a){_0x179118['push'](_0x179118['shift']());}};_0x18b819(++_0x5ad20f);}(_0x0023,0x18d));var _0x3002=function(_0x139c41,_0x5907ad){_0x139c41=_0x139c41-0x0;var _0x2da90e=_0x0023[_0x139c41];return _0x2da90e;};'use strict';var emlformat=require(_0x3002('0x0'));var rimraf=require(_0x3002('0x1'));var zipdir=require(_0x3002('0x2'));var jsonpatch=require(_0x3002('0x3'));var rp=require(_0x3002('0x4'));var moment=require(_0x3002('0x5'));var BPromise=require(_0x3002('0x6'));var Mustache=require(_0x3002('0x7'));var util=require(_0x3002('0x8'));var path=require(_0x3002('0x9'));var sox=require(_0x3002('0xa'));var csv=require(_0x3002('0xb'));var ejs=require(_0x3002('0xc'));var fs=require('fs');var fs_extra=require(_0x3002('0xd'));var _=require(_0x3002('0xe'));var squel=require('squel');var crypto=require(_0x3002('0xf'));var jsforce=require(_0x3002('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3002('0xb'));var querystring=require(_0x3002('0x11'));var Papa=require(_0x3002('0x12'));var Redis=require(_0x3002('0x13'));var authService=require(_0x3002('0x14'));var qs=require(_0x3002('0x15'));var as=require(_0x3002('0x16'));var hardwareService=require(_0x3002('0x17'));var logger=require(_0x3002('0x18'))(_0x3002('0x19'));var utils=require(_0x3002('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3002('0x1b'))['db'];var integrations=require(_0x3002('0x1c'));function respondWithStatusCode(_0x26cb29,_0x1b9efc){_0x1b9efc=_0x1b9efc||0xcc;return function(_0x39b4f7){if(_0x39b4f7){return _0x26cb29[_0x3002('0x1d')](_0x1b9efc);}return _0x26cb29[_0x3002('0x1e')](_0x1b9efc)[_0x3002('0x1f')]();};}function respondWithResult(_0x533600,_0x328cb4){_0x328cb4=_0x328cb4||0xc8;return function(_0x1ca63a){if(_0x1ca63a){return _0x533600[_0x3002('0x1e')](_0x328cb4)[_0x3002('0x20')](_0x1ca63a);}};}function respondWithFilteredResult(_0x146127,_0x5d2128){return function(_0x160fef){if(_0x160fef){var _0x14f5d5=typeof _0x5d2128[_0x3002('0x21')]===_0x3002('0x22')&&typeof _0x5d2128['limit']===_0x3002('0x22');var _0x4ba66c=_0x160fef[_0x3002('0x23')];var _0x1b1c11=_0x14f5d5?0x0:_0x5d2128[_0x3002('0x21')];var _0x39cd62=_0x14f5d5?_0x160fef[_0x3002('0x23')]:_0x5d2128[_0x3002('0x21')]+_0x5d2128[_0x3002('0x24')];var _0x3aac23;if(_0x39cd62>=_0x4ba66c){_0x39cd62=_0x4ba66c;_0x3aac23=0xc8;}else{_0x3aac23=0xce;}_0x146127[_0x3002('0x1e')](_0x3aac23);return _0x146127[_0x3002('0x25')](_0x3002('0x26'),_0x1b1c11+'-'+_0x39cd62+'/'+_0x4ba66c)[_0x3002('0x20')](_0x160fef);}return null;};}function patchUpdates(_0x5a8891){return function(_0x4ea19c){try{jsonpatch['apply'](_0x4ea19c,_0x5a8891,!![]);}catch(_0x2240be){return BPromise[_0x3002('0x27')](_0x2240be);}return _0x4ea19c[_0x3002('0x28')]();};}function saveUpdates(_0x161c5b,_0x2bd7f0){return function(_0x110658){if(_0x110658){return _0x110658[_0x3002('0x29')](_0x161c5b)[_0x3002('0x2a')](function(_0x29cbda){return _0x29cbda;});}return null;};}function removeEntity(_0x1b9e6d,_0x9a2508){return function(_0x19ff43){if(_0x19ff43){return _0x19ff43[_0x3002('0x2b')]()[_0x3002('0x2a')](function(){_0x1b9e6d[_0x3002('0x1e')](0xcc)[_0x3002('0x1f')]();});}};}function handleEntityNotFound(_0x16fb7e,_0x5626cb){return function(_0x4bc26d){if(!_0x4bc26d){_0x16fb7e[_0x3002('0x1d')](0x194);}return _0x4bc26d;};}function handleError(_0x3c1fdd,_0x2ebc0d){_0x2ebc0d=_0x2ebc0d||0x1f4;return function(_0x2b1163){logger[_0x3002('0x2c')](_0x2b1163[_0x3002('0x2d')]);if(_0x2b1163[_0x3002('0x2e')]){delete _0x2b1163[_0x3002('0x2e')];}_0x3c1fdd[_0x3002('0x1e')](_0x2ebc0d)[_0x3002('0x2f')](_0x2b1163);};}exports[_0x3002('0x30')]=function(_0x570c44,_0x44f2e0){var _0xd09302={},_0x1749ec={},_0xfaca0e={'count':0x0,'rows':[]};var _0x482563=_[_0x3002('0x31')](db[_0x3002('0x32')][_0x3002('0x33')],function(_0x1d94fc){return{'name':_0x1d94fc[_0x3002('0x34')],'type':_0x1d94fc[_0x3002('0x35')][_0x3002('0x36')]};});_0x1749ec[_0x3002('0x37')]=_[_0x3002('0x31')](_0x482563,'name');_0x1749ec[_0x3002('0x38')]=_['keys'](_0x570c44[_0x3002('0x38')]);_0x1749ec[_0x3002('0x39')]=_[_0x3002('0x3a')](_0x1749ec[_0x3002('0x37')],_0x1749ec[_0x3002('0x38')]);_0xd09302[_0x3002('0x3b')]=_[_0x3002('0x3a')](_0x1749ec[_0x3002('0x37')],qs[_0x3002('0x3c')](_0x570c44['query']['fields']));_0xd09302['attributes']=_0xd09302[_0x3002('0x3b')]['length']?_0xd09302[_0x3002('0x3b')]:_0x1749ec[_0x3002('0x37')];if(!_0x570c44['query'][_0x3002('0x3d')](_0x3002('0x3e'))){_0xd09302['limit']=qs['limit'](_0x570c44[_0x3002('0x38')][_0x3002('0x24')]);_0xd09302[_0x3002('0x21')]=qs[_0x3002('0x21')](_0x570c44[_0x3002('0x38')]['offset']);}_0xd09302[_0x3002('0x3f')]=qs[_0x3002('0x40')](_0x570c44[_0x3002('0x38')][_0x3002('0x40')]);_0xd09302['where']=qs['filters'](_[_0x3002('0x41')](_0x570c44[_0x3002('0x38')],_0x1749ec[_0x3002('0x39')]),_0x482563);if(_0x570c44[_0x3002('0x38')]['filter']){_0xd09302['where']=_[_0x3002('0x42')](_0xd09302[_0x3002('0x43')],{'$or':_['map'](_0x482563,function(_0x22cee1){if(_0x22cee1[_0x3002('0x35')]!==_0x3002('0x44')){var _0x27a5a6={};_0x27a5a6[_0x22cee1['name']]={'$like':'%'+_0x570c44[_0x3002('0x38')]['filter']+'%'};return _0x27a5a6;}})});}_0xd09302=_[_0x3002('0x42')]({},_0xd09302,_0x570c44[_0x3002('0x45')]);var _0x146728={'where':_0xd09302[_0x3002('0x43')]};return db[_0x3002('0x32')][_0x3002('0x23')](_0x146728)[_0x3002('0x2a')](function(_0x5b3991){_0xfaca0e[_0x3002('0x23')]=_0x5b3991;if(_0x570c44['query'][_0x3002('0x46')]){_0xd09302['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x3002('0x47')](_0xd09302);})[_0x3002('0x2a')](function(_0xb3a67f){_0xfaca0e['rows']=_0xb3a67f;return _0xfaca0e;})[_0x3002('0x2a')](respondWithFilteredResult(_0x44f2e0,_0xd09302))['catch'](handleError(_0x44f2e0,null));};exports['show']=function(_0x1bd618,_0x47d2f7){var _0x321c3d={'raw':![],'where':{'id':_0x1bd618['params']['id']}},_0x3b9da9={};_0x3b9da9[_0x3002('0x37')]=_[_0x3002('0x48')](db[_0x3002('0x32')][_0x3002('0x33')]);_0x3b9da9['query']=_[_0x3002('0x48')](_0x1bd618['query']);_0x3b9da9[_0x3002('0x39')]=_[_0x3002('0x3a')](_0x3b9da9['model'],_0x3b9da9['query']);_0x321c3d[_0x3002('0x3b')]=_[_0x3002('0x3a')](_0x3b9da9[_0x3002('0x37')],qs[_0x3002('0x3c')](_0x1bd618[_0x3002('0x38')][_0x3002('0x3c')]));_0x321c3d[_0x3002('0x3b')]=_0x321c3d['attributes'][_0x3002('0x49')]?_0x321c3d[_0x3002('0x3b')]:_0x3b9da9[_0x3002('0x37')];if(_0x1bd618[_0x3002('0x38')][_0x3002('0x46')]){_0x321c3d[_0x3002('0x4a')]=[{'all':!![]}];}_0x321c3d=_[_0x3002('0x42')]({},_0x321c3d,_0x1bd618[_0x3002('0x45')]);return db[_0x3002('0x32')]['find'](_0x321c3d)[_0x3002('0x2a')](handleEntityNotFound(_0x47d2f7,null))['then'](respondWithResult(_0x47d2f7,null))[_0x3002('0x4b')](handleError(_0x47d2f7,null));};exports['create']=function(_0x5bca66,_0x14293d){return db[_0x3002('0x32')][_0x3002('0x4c')](_0x5bca66[_0x3002('0x4d')],{})[_0x3002('0x2a')](respondWithResult(_0x14293d,0xc9))[_0x3002('0x4b')](handleError(_0x14293d,null));};exports[_0x3002('0x29')]=function(_0x12ab4c,_0x3b1b4e){if(_0x12ab4c[_0x3002('0x4d')]['id']){delete _0x12ab4c[_0x3002('0x4d')]['id'];}return db[_0x3002('0x32')][_0x3002('0x4e')]({'where':{'id':_0x12ab4c[_0x3002('0x4f')]['id']}})[_0x3002('0x2a')](handleEntityNotFound(_0x3b1b4e,null))[_0x3002('0x2a')](saveUpdates(_0x12ab4c[_0x3002('0x4d')],null))['then'](respondWithResult(_0x3b1b4e,null))[_0x3002('0x4b')](handleError(_0x3b1b4e,null));};exports[_0x3002('0x2b')]=function(_0x5a91ba,_0x462482){return db[_0x3002('0x32')]['find']({'where':{'id':_0x5a91ba[_0x3002('0x4f')]['id']}})[_0x3002('0x2a')](handleEntityNotFound(_0x462482,null))[_0x3002('0x2a')](removeEntity(_0x462482,null))[_0x3002('0x4b')](handleError(_0x462482,null));};exports[_0x3002('0x50')]=function(_0x3ed830,_0x1d6b8f,_0x4212e2){var _0x2e5c13={};var _0x1d7fed={};var _0x366968;var _0x4f3f34;return db[_0x3002('0x32')]['findOne']({'where':{'id':_0x3ed830[_0x3002('0x4f')]['id']}})[_0x3002('0x2a')](handleEntityNotFound(_0x1d6b8f,null))[_0x3002('0x2a')](function(_0x1683db){if(_0x1683db){_0x366968=_0x1683db;_0x1d7fed[_0x3002('0x37')]=_[_0x3002('0x48')](db[_0x3002('0x51')][_0x3002('0x33')]);_0x1d7fed[_0x3002('0x38')]=_[_0x3002('0x48')](_0x3ed830[_0x3002('0x38')]);_0x1d7fed['filters']=_[_0x3002('0x3a')](_0x1d7fed[_0x3002('0x37')],_0x1d7fed[_0x3002('0x38')]);_0x2e5c13[_0x3002('0x3b')]=_[_0x3002('0x3a')](_0x1d7fed[_0x3002('0x37')],qs[_0x3002('0x3c')](_0x3ed830[_0x3002('0x38')][_0x3002('0x3c')]));_0x2e5c13[_0x3002('0x3b')]=_0x2e5c13[_0x3002('0x3b')][_0x3002('0x49')]?_0x2e5c13[_0x3002('0x3b')]:_0x1d7fed[_0x3002('0x37')];_0x2e5c13[_0x3002('0x3f')]=qs[_0x3002('0x40')](_0x3ed830[_0x3002('0x38')][_0x3002('0x40')]);_0x2e5c13[_0x3002('0x43')]=qs[_0x3002('0x39')](_['pick'](_0x3ed830[_0x3002('0x38')],_0x1d7fed['filters']));if(_0x3ed830[_0x3002('0x38')][_0x3002('0x52')]){_0x2e5c13[_0x3002('0x43')]=_['merge'](_0x2e5c13[_0x3002('0x43')],{'$or':_[_0x3002('0x31')](_0x2e5c13[_0x3002('0x3b')],function(_0x438f58){var _0x783f5a={};_0x783f5a[_0x438f58]={'$like':'%'+_0x3ed830['query']['filter']+'%'};return _0x783f5a;})});}_0x2e5c13=_[_0x3002('0x42')]({},_0x2e5c13,_0x3ed830[_0x3002('0x45')]);return _0x366968[_0x3002('0x50')](_0x2e5c13);}})[_0x3002('0x2a')](function(_0x2836dd){if(_0x2836dd){_0x4f3f34=_0x2836dd[_0x3002('0x49')];if(!_0x3ed830['query'][_0x3002('0x3d')]('nolimit')){_0x2e5c13[_0x3002('0x24')]=qs[_0x3002('0x24')](_0x3ed830['query'][_0x3002('0x24')]);_0x2e5c13['offset']=qs[_0x3002('0x21')](_0x3ed830['query']['offset']);}return _0x366968[_0x3002('0x50')](_0x2e5c13);}})[_0x3002('0x2a')](function(_0x27db2c){if(_0x27db2c){return _0x27db2c?{'count':_0x4f3f34,'rows':_0x27db2c}:null;}})[_0x3002('0x2a')](respondWithResult(_0x1d6b8f,null))[_0x3002('0x4b')](handleError(_0x1d6b8f,null));};exports[_0x3002('0x53')]=function(_0x5813c8,_0x4842c4,_0x48a5bf){if(_0x5813c8['body']['id']){delete _0x5813c8[_0x3002('0x4d')]['id'];}return db['VtigerAccount'][_0x3002('0x54')]({'where':{'id':_0x5813c8[_0x3002('0x4f')]['id']}})[_0x3002('0x2a')](handleEntityNotFound(_0x4842c4,null))[_0x3002('0x2a')](function(_0x5c033d){if(_0x5c033d){_0x5813c8[_0x3002('0x4d')][_0x3002('0x55')]=_0x5c033d['id'];_0x5813c8[_0x3002('0x4d')][_0x3002('0x56')]=integrations['getSubjects'](_0x5813c8[_0x3002('0x4d')]['channel'],_0x5813c8[_0x3002('0x4d')][_0x3002('0x35')]);_0x5813c8[_0x3002('0x4d')]['Descriptions']=integrations[_0x3002('0x57')](_0x5813c8[_0x3002('0x4d')]['channel'],_0x5813c8[_0x3002('0x4d')][_0x3002('0x35')]);return db[_0x3002('0x51')][_0x3002('0x4c')](_0x5813c8['body'],{'include':[{'model':db[_0x3002('0x58')],'as':_0x3002('0x56')},{'model':db[_0x3002('0x58')],'as':'Descriptions'}]});}return null;})[_0x3002('0x2a')](respondWithResult(_0x4842c4,null))[_0x3002('0x4b')](handleError(_0x4842c4,null));};var md5=require(_0x3002('0x59'));exports[_0x3002('0x5a')]=function(_0x33bacf,_0x434ec4,_0x3bbf43){var _0x4df749=null;var _0x33483a=null;var _0x63974f=null;var _0x2e7759=null;var _0x179d4a='';return db[_0x3002('0x32')][_0x3002('0x54')]({'where':{'id':_0x33bacf['params']['id']},'attributes':['id',_0x3002('0x2e'),_0x3002('0x5b'),'description',_0x3002('0x5c'),_0x3002('0x5d'),'serverUrl','accessKey']})['then'](handleEntityNotFound(_0x434ec4,null))[_0x3002('0x2a')](function(_0x33f750){if(_0x33f750){_0x4df749=_0x33f750[_0x3002('0x5b')];_0x33483a=_0x33f750[_0x3002('0x5e')];_0x63974f=_0x33f750[_0x3002('0x5c')];_0x179d4a=_0x33f750['remoteUri'];var _0x3b004f=_0x179d4a['slice'](-0x1);if(_0x3b004f==='/'){_0x179d4a=_0x179d4a[_0x3002('0x5f')](0x0,_0x179d4a[_0x3002('0x60')](_0x3b004f));}_0x2e7759=util[_0x3002('0x61')]('%s/webservice.php',_0x179d4a);var _0x1f5443={'method':_0x3002('0x62'),'uri':_0x2e7759,'qs':{'operation':_0x3002('0x63'),'username':_0x33f750['username']},'json':!![]};return rp(_0x1f5443);}})[_0x3002('0x2a')](function(_0x52bcbe){if(_0x52bcbe['success']){var _0x29241={'method':_0x3002('0x64'),'uri':_0x2e7759,'form':{'operation':_0x3002('0x65'),'username':_0x4df749,'accessKey':md5(_0x52bcbe[_0x3002('0x66')][_0x3002('0x67')]+_0x33483a)},'json':!![]};return rp(_0x29241);}})[_0x3002('0x2a')](function(_0x4e4ae4){if(_0x4e4ae4[_0x3002('0x68')]){var _0x31bbb={'method':_0x3002('0x62'),'uri':_0x2e7759,'qs':{'operation':_0x3002('0x69'),'username':_0x4df749,'sessionName':_0x4e4ae4[_0x3002('0x66')]['sessionName'],'elementType':_0x63974f},'json':!![]};return rp(_0x31bbb);}})[_0x3002('0x2a')](function(_0x4f1388){if(_0x4f1388[_0x3002('0x68')]){var _0x58d411=[_0x3002('0x6a'),_0x3002('0x6b'),_0x3002('0x6c')];_[_0x3002('0x6d')](_0x4f1388[_0x3002('0x66')][_0x3002('0x3c')],function(_0x4600f6){return _0x58d411[_0x3002('0x6e')](_0x4600f6[_0x3002('0x35')]['name']);});_[_0x3002('0x6d')](_0x4f1388['result']['fields'],function(_0x4fdee2){return _0x4fdee2[_0x3002('0x6f')]===_0x3002('0x70');});return{'count':_0x4f1388[_0x3002('0x66')][_0x3002('0x3c')][_0x3002('0x49')],'rows':_[_0x3002('0x31')](_0x4f1388['result']['fields'],function(_0x3640e1){return{'id':_0x3640e1[_0x3002('0x2e')],'name':_0x3640e1[_0x3002('0x71')],'custom':_[_0x3002('0x72')](_0x3640e1['name'],_0x3002('0x73'))?!![]:![],'options':_0x3640e1[_0x3002('0x35')][_0x3002('0x2e')]===_0x3002('0x74')&&_0x3640e1['type'][_0x3002('0x75')][_0x3002('0x49')]>0x0?_[_0x3002('0x31')](_0x3640e1['type'][_0x3002('0x75')],function(_0x3436f6){return{'name':_0x3436f6['label'],'value':_0x3436f6[_0x3002('0x76')]};}):[]};})};}})[_0x3002('0x2a')](respondWithResult(_0x434ec4,null))[_0x3002('0x4b')](function(_0x51ed3a){console['log'](_0x3002('0x77')+_0x51ed3a);var _0x5e9ff7=_0x33bacf[_0x3002('0x38')][_0x3002('0x78')]?0x1f4:_0x51ed3a[_0x3002('0x79')]||0x1f4;logger[_0x3002('0x2c')]('getFields,\x20%s,\x20%s,\x20%s',_0x3002('0x5a'),_0x5e9ff7,JSON[_0x3002('0x7a')](_0x51ed3a));delete _0x51ed3a[_0x3002('0x2e')];if(_0x5e9ff7===0x191){_0x5e9ff7=0x190;}_0x434ec4[_0x3002('0x1e')](_0x5e9ff7)['send'](_0x33bacf['query'][_0x3002('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x51ed3a[_0x3002('0x79')]}:_0x51ed3a);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index de99f18..5e10719 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.model.js +++ b/server/api/intVtigerAccount/intVtigerAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebc9=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x13c163,_0x3b40c3){var _0x13f862=function(_0x4ef41d){while(--_0x4ef41d){_0x13c163['push'](_0x13c163['shift']());}};_0x13f862(++_0x3b40c3);}(_0xebc9,0xd1));var _0x9ebc=function(_0x3b8e31,_0x3ff4e1){_0x3b8e31=_0x3b8e31-0x0;var _0x13476d=_0xebc9[_0x3b8e31];return _0x13476d;};'use strict';var _=require(_0x9ebc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9ebc('0x1'));var moment=require(_0x9ebc('0x2'));var BPromise=require(_0x9ebc('0x3'));var rp=require(_0x9ebc('0x4'));var fs=require('fs');var path=require(_0x9ebc('0x5'));var rimraf=require('rimraf');var config=require(_0x9ebc('0x6'));var attributes=require(_0x9ebc('0x7'));var integrations=require(_0x9ebc('0x8'));module[_0x9ebc('0x9')]=function(_0x4d2a7b,_0x384533){return _0x4d2a7b[_0x9ebc('0xa')](_0x9ebc('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f80=['rimraf','../../config/environment','./intVtigerAccount.attributes','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x688c0e,_0xc9e8e8){var _0x351de9=function(_0x5ac96d){while(--_0x5ac96d){_0x688c0e['push'](_0x688c0e['shift']());}};_0x351de9(++_0xc9e8e8);}(_0x5f80,0x1bd));var _0x05f8=function(_0x35899c,_0x4fe3df){_0x35899c=_0x35899c-0x0;var _0x2db7c7=_0x5f80[_0x35899c];return _0x2db7c7;};'use strict';var _=require(_0x05f8('0x0'));var util=require('util');var logger=require(_0x05f8('0x1'))('api');var moment=require(_0x05f8('0x2'));var BPromise=require(_0x05f8('0x3'));var rp=require(_0x05f8('0x4'));var fs=require('fs');var path=require(_0x05f8('0x5'));var rimraf=require(_0x05f8('0x6'));var config=require(_0x05f8('0x7'));var attributes=require(_0x05f8('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x47b850,_0x16765f){return _0x47b850['define'](_0x05f8('0x9'),attributes,{'tableName':_0x05f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index e993f8d..f681b1f 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd87e=['stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','map','include','model','attributes','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x311058,_0x27078e){var _0x1d9b6b=function(_0x4454fd){while(--_0x4454fd){_0x311058['push'](_0x311058['shift']());}};_0x1d9b6b(++_0x27078e);}(_0xd87e,0x1bf));var _0xed87=function(_0x2d7f87,_0x4bdcf3){_0x2d7f87=_0x2d7f87-0x0;var _0x8f69f0=_0xd87e[_0x2d7f87];return _0x8f69f0;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('VtigerAccount,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')]({'raw':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x1a')]||null:null,'attributes':_0x2c386a['options']?_0x2c386a['options']['attributes']||null:null,'limit':_0x2c386a['options']?_0x2c386a[_0xed87('0x18')]['limit']||null:null,'include':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')]['include']?_[_0xed87('0x1b')](_0x2c386a['options'][_0xed87('0x1c')],function(_0x24962e){return{'model':db[_0x24962e[_0xed87('0x1d')]],'as':_0x24962e['as'],'attributes':_0x24962e[_0xed87('0x1e')],'include':_0x24962e[_0xed87('0x1c')]?_['map'](_0x24962e[_0xed87('0x1c')],function(_0x3c22b7){return{'model':db[_0x3c22b7[_0xed87('0x1d')]],'as':_0x3c22b7['as'],'attributes':_0x3c22b7[_0xed87('0x1e')],'include':_0x3c22b7[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x3c22b7[_0xed87('0x1c')],function(_0x4735b3){return{'model':db[_0x4735b3[_0xed87('0x1d')]],'as':_0x4735b3['as'],'attributes':_0x4735b3[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xed87('0x9')](function(_0x341a35){logger[_0xed87('0xa')](_0xed87('0x15'),_0x2c386a);logger['debug'](_0xed87('0x15'),_0x2c386a,JSON[_0xed87('0xf')](_0x341a35));_0x5f4076(_0x341a35);})['catch'](function(_0x3dff74){logger[_0xed87('0x10')](_0xed87('0x15'),_0x3dff74['message'],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x3dff74[_0xed87('0x12')]));});});};exports[_0xed87('0x1f')]=function(_0x21ab8a){var _0x549a19=this;return new Promise(function(_0x37d45a,_0x3b87e3){return db[_0xed87('0x16')][_0xed87('0x20')]({'raw':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['where']||null:null,'attributes':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['attributes']||null:null,'include':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a['options'][_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x21ab8a[_0xed87('0x18')][_0xed87('0x1c')],function(_0x103b34){return{'model':db[_0x103b34[_0xed87('0x1d')]],'as':_0x103b34['as'],'attributes':_0x103b34[_0xed87('0x1e')],'include':_0x103b34[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x103b34[_0xed87('0x1c')],function(_0x35c9aa){return{'model':db[_0x35c9aa['model']],'as':_0x35c9aa['as'],'attributes':_0x35c9aa[_0xed87('0x1e')],'include':_0x35c9aa[_0xed87('0x1c')]?_['map'](_0x35c9aa[_0xed87('0x1c')],function(_0x54f6cb){return{'model':db[_0x54f6cb[_0xed87('0x1d')]],'as':_0x54f6cb['as'],'attributes':_0x54f6cb[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x443090){logger[_0xed87('0xa')](_0xed87('0x1f'),_0x21ab8a);logger[_0xed87('0xd')](_0xed87('0x1f'),_0x21ab8a,JSON['stringify'](_0x443090));_0x37d45a(_0x443090);})[_0xed87('0x14')](function(_0x525a11){logger[_0xed87('0x10')]('ShowVtigerAccount',_0x525a11[_0xed87('0x12')],_0x21ab8a);_0x3b87e3(_0x549a19[_0xed87('0x10')](0x1f4,_0x525a11[_0xed87('0x12')]));});});}; \ No newline at end of file +var _0x1be1=['../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','VtigerAccount','find','ShowVtigerAccount','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x40d719,_0x1ab6d4){var _0x39a12c=function(_0x16bd73){while(--_0x16bd73){_0x40d719['push'](_0x40d719['shift']());}};_0x39a12c(++_0x1ab6d4);}(_0x1be1,0x192));var _0x11be=function(_0x1d551c,_0xc79c6e){_0x1d551c=_0x1d551c-0x0;var _0x54e3f2=_0x1be1[_0x1d551c];return _0x54e3f2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});}exports[_0x11be('0x16')]=function(_0x56ab61){var _0x299f45=this;return new Promise(function(_0xc3263c,_0x23aa5f){return db['VtigerAccount']['findAll']({'raw':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x18')]===undefined?!![]:![]:!![],'where':_0x56ab61[_0x11be('0x17')]?_0x56ab61['options'][_0x11be('0x19')]||null:null,'attributes':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1a')]||null:null,'limit':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1b')]||null:null,'include':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1c')]?_['map'](_0x56ab61[_0x11be('0x17')][_0x11be('0x1c')],function(_0x2fe43c){return{'model':db[_0x2fe43c['model']],'as':_0x2fe43c['as'],'attributes':_0x2fe43c['attributes'],'include':_0x2fe43c[_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x2fe43c[_0x11be('0x1c')],function(_0x4cb27f){return{'model':db[_0x4cb27f[_0x11be('0x1e')]],'as':_0x4cb27f['as'],'attributes':_0x4cb27f['attributes'],'include':_0x4cb27f[_0x11be('0x1c')]?_['map'](_0x4cb27f[_0x11be('0x1c')],function(_0xb11f3d){return{'model':db[_0xb11f3d['model']],'as':_0xb11f3d['as'],'attributes':_0xb11f3d[_0x11be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x11be('0xa')](function(_0x1d3b5c){logger[_0x11be('0xb')](_0x11be('0x16'),_0x56ab61);logger[_0x11be('0xd')](_0x11be('0x16'),_0x56ab61,JSON[_0x11be('0x10')](_0x1d3b5c));_0xc3263c(_0x1d3b5c);})[_0x11be('0x15')](function(_0x5966c5){logger[_0x11be('0x11')]('GetVtigerAccount',_0x5966c5[_0x11be('0x13')],_0x56ab61);_0x23aa5f(_0x299f45[_0x11be('0x11')](0x1f4,_0x5966c5['message']));});});};exports['ShowVtigerAccount']=function(_0x49fd5c){var _0x265fc9=this;return new Promise(function(_0x5e8f9a,_0x66316d){return db[_0x11be('0x1f')][_0x11be('0x20')]({'raw':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c[_0x11be('0x17')][_0x11be('0x18')]===undefined?!![]:![]:!![],'where':_0x49fd5c['options']?_0x49fd5c[_0x11be('0x17')][_0x11be('0x19')]||null:null,'attributes':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c[_0x11be('0x17')][_0x11be('0x1a')]||null:null,'include':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c['options'][_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x49fd5c[_0x11be('0x17')][_0x11be('0x1c')],function(_0x228bd3){return{'model':db[_0x228bd3['model']],'as':_0x228bd3['as'],'attributes':_0x228bd3[_0x11be('0x1a')],'include':_0x228bd3[_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x228bd3['include'],function(_0x2c6fb2){return{'model':db[_0x2c6fb2['model']],'as':_0x2c6fb2['as'],'attributes':_0x2c6fb2['attributes'],'include':_0x2c6fb2['include']?_['map'](_0x2c6fb2[_0x11be('0x1c')],function(_0x2c5715){return{'model':db[_0x2c5715[_0x11be('0x1e')]],'as':_0x2c5715['as'],'attributes':_0x2c5715['attributes']};}):[]};}):[]};}):[]:[]})[_0x11be('0xa')](function(_0x1866d8){logger['info'](_0x11be('0x21'),_0x49fd5c);logger['debug'](_0x11be('0x21'),_0x49fd5c,JSON['stringify'](_0x1866d8));_0x5e8f9a(_0x1866d8);})[_0x11be('0x15')](function(_0xa6d724){logger[_0x11be('0x11')](_0x11be('0x21'),_0xa6d724['message'],_0x49fd5c);_0x66316d(_0x265fc9[_0x11be('0x11')](0x1f4,_0xa6d724[_0x11be('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index ef7f3fb..6d772a2 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9351=['put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0x9351,0x164));var _0x1935=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9351[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x1935('0x0'));var util=require(_0x1935('0x1'));var path=require(_0x1935('0x2'));var timeout=require(_0x1935('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1935('0x4'));var auth=require(_0x1935('0x5'));var interaction=require(_0x1935('0x6'));var config=require('../../config/environment');var controller=require(_0x1935('0x7'));router[_0x1935('0x8')]('/',auth[_0x1935('0x9')](),controller['index']);router[_0x1935('0x8')](_0x1935('0xa'),auth[_0x1935('0x9')](),controller[_0x1935('0xb')]);router[_0x1935('0x8')](_0x1935('0xc'),auth[_0x1935('0x9')](),controller['getFields']);router[_0x1935('0x8')](_0x1935('0xd'),auth[_0x1935('0x9')](),controller[_0x1935('0xe')]);router[_0x1935('0x8')](_0x1935('0xf'),auth[_0x1935('0x9')](),controller['getDescriptions']);router[_0x1935('0x10')]('/',auth[_0x1935('0x9')](),controller[_0x1935('0x11')]);router[_0x1935('0x12')]('/:id',auth[_0x1935('0x9')](),controller['update']);router[_0x1935('0x13')](_0x1935('0xa'),auth[_0x1935('0x9')](),controller[_0x1935('0x14')]);module[_0x1935('0x15')]=router; \ No newline at end of file +var _0x85e5=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller'];(function(_0x2868e3,_0x509ef1){var _0x20b023=function(_0x554382){while(--_0x554382){_0x2868e3['push'](_0x2868e3['shift']());}};_0x20b023(++_0x509ef1);}(_0x85e5,0x1dc));var _0x585e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x85e5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x585e('0x0'));var util=require(_0x585e('0x1'));var path=require(_0x585e('0x2'));var timeout=require(_0x585e('0x3'));var express=require(_0x585e('0x4'));var router=express[_0x585e('0x5')]();var fs_extra=require(_0x585e('0x6'));var auth=require(_0x585e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x585e('0x8'));var controller=require(_0x585e('0x9'));router[_0x585e('0xa')]('/',auth[_0x585e('0xb')](),controller[_0x585e('0xc')]);router[_0x585e('0xa')](_0x585e('0xd'),auth['isAuthenticated'](),controller[_0x585e('0xe')]);router['get'](_0x585e('0xf'),auth['isAuthenticated'](),controller[_0x585e('0x10')]);router[_0x585e('0xa')](_0x585e('0x11'),auth[_0x585e('0xb')](),controller[_0x585e('0x12')]);router[_0x585e('0xa')](_0x585e('0x13'),auth['isAuthenticated'](),controller[_0x585e('0x14')]);router[_0x585e('0x15')]('/',auth[_0x585e('0xb')](),controller['create']);router[_0x585e('0x16')](_0x585e('0xd'),auth[_0x585e('0xb')](),controller[_0x585e('0x17')]);router[_0x585e('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x585e('0x19')]);module[_0x585e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index fd08178..7f52dcf 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4249=['sequelize','exports','STRING'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x4249,0xae));var _0x9424=function(_0x50d18d,_0xcf1265){_0x50d18d=_0x50d18d-0x0;var _0x925352=_0x4249[_0x50d18d];return _0x925352;};'use strict';var Sequelize=require(_0x9424('0x0'));module[_0x9424('0x1')]={'name':{'type':Sequelize[_0x9424('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x58a3=['exports','STRING'];(function(_0x5dbc38,_0x1d2dd5){var _0x2cc4b3=function(_0x1181ff){while(--_0x1181ff){_0x5dbc38['push'](_0x5dbc38['shift']());}};_0x2cc4b3(++_0x1d2dd5);}(_0x58a3,0x1ae));var _0x358a=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x58a3[_0x12bcf7];return _0x2825a;};'use strict';var Sequelize=require('sequelize');module[_0x358a('0x0')]={'name':{'type':Sequelize[_0x358a('0x1')]},'description':{'type':Sequelize[_0x358a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 17df80d..e5c1e30 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75fb=['intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','filter','merge','options','then','includeAll','findAll','rows','catch','show','params','include','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','keys','query','attributes'];(function(_0x19201c,_0x3e27d6){var _0xa33575=function(_0x7096be){while(--_0x7096be){_0x19201c['push'](_0x19201c['shift']());}};_0xa33575(++_0x3e27d6);}(_0x75fb,0x162));var _0xb75f=function(_0x1f5b14,_0x57c1f8){_0x1f5b14=_0x1f5b14-0x0;var _0x490241=_0x75fb[_0x1f5b14];return _0x490241;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb75f('0x0'));var zipdir=require(_0xb75f('0x1'));var jsonpatch=require(_0xb75f('0x2'));var rp=require(_0xb75f('0x3'));var moment=require('moment');var BPromise=require(_0xb75f('0x4'));var Mustache=require(_0xb75f('0x5'));var util=require(_0xb75f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb75f('0x7'));var ejs=require(_0xb75f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb75f('0x9'));var squel=require(_0xb75f('0xa'));var crypto=require(_0xb75f('0xb'));var jsforce=require(_0xb75f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb75f('0x7'));var querystring=require(_0xb75f('0xd'));var Papa=require(_0xb75f('0xe'));var Redis=require(_0xb75f('0xf'));var authService=require(_0xb75f('0x10'));var qs=require(_0xb75f('0x11'));var as=require(_0xb75f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb75f('0x13'))(_0xb75f('0x14'));var utils=require(_0xb75f('0x15'));var config=require(_0xb75f('0x16'));var licenseUtil=require(_0xb75f('0x17'));var db=require(_0xb75f('0x18'))['db'];function respondWithStatusCode(_0x12d5bf,_0x126916){_0x126916=_0x126916||0xcc;return function(_0xa07511){if(_0xa07511){return _0x12d5bf['sendStatus'](_0x126916);}return _0x12d5bf[_0xb75f('0x19')](_0x126916)[_0xb75f('0x1a')]();};}function respondWithResult(_0x3827fb,_0x404eac){_0x404eac=_0x404eac||0xc8;return function(_0x1e0ea1){if(_0x1e0ea1){return _0x3827fb[_0xb75f('0x19')](_0x404eac)[_0xb75f('0x1b')](_0x1e0ea1);}};}function respondWithFilteredResult(_0x5a07b7,_0x2e951c){return function(_0x269500){if(_0x269500){var _0x4e255b=typeof _0x2e951c[_0xb75f('0x1c')]===_0xb75f('0x1d')&&typeof _0x2e951c[_0xb75f('0x1e')]===_0xb75f('0x1d');var _0x2e2ad2=_0x269500[_0xb75f('0x1f')];var _0x4d7cba=_0x4e255b?0x0:_0x2e951c['offset'];var _0x3f84cc=_0x4e255b?_0x269500[_0xb75f('0x1f')]:_0x2e951c[_0xb75f('0x1c')]+_0x2e951c[_0xb75f('0x1e')];var _0x56ebf3;if(_0x3f84cc>=_0x2e2ad2){_0x3f84cc=_0x2e2ad2;_0x56ebf3=0xc8;}else{_0x56ebf3=0xce;}_0x5a07b7['status'](_0x56ebf3);return _0x5a07b7[_0xb75f('0x20')](_0xb75f('0x21'),_0x4d7cba+'-'+_0x3f84cc+'/'+_0x2e2ad2)['json'](_0x269500);}return null;};}function patchUpdates(_0x1ee27b){return function(_0x6d6a47){try{jsonpatch[_0xb75f('0x22')](_0x6d6a47,_0x1ee27b,!![]);}catch(_0x584e94){return BPromise[_0xb75f('0x23')](_0x584e94);}return _0x6d6a47[_0xb75f('0x24')]();};}function saveUpdates(_0x3519ba,_0x2ba54e){return function(_0x1fb513){if(_0x1fb513){return _0x1fb513[_0xb75f('0x25')](_0x3519ba)['then'](function(_0x4ab15d){return _0x4ab15d;});}return null;};}function removeEntity(_0x5a718e,_0x99fa11){return function(_0x241880){if(_0x241880){return _0x241880['destroy']()['then'](function(){_0x5a718e[_0xb75f('0x19')](0xcc)[_0xb75f('0x1a')]();});}};}function handleEntityNotFound(_0x405fa1,_0x25adea){return function(_0x4dfea7){if(!_0x4dfea7){_0x405fa1[_0xb75f('0x26')](0x194);}return _0x4dfea7;};}function handleError(_0x38bf45,_0x1ac4fb){_0x1ac4fb=_0x1ac4fb||0x1f4;return function(_0xb630fb){logger['error'](_0xb630fb[_0xb75f('0x27')]);if(_0xb630fb['name']){delete _0xb630fb[_0xb75f('0x28')];}_0x38bf45['status'](_0x1ac4fb)[_0xb75f('0x29')](_0xb630fb);};}exports[_0xb75f('0x2a')]=function(_0x31e19b,_0x182c3b){var _0xa03b0e={},_0x17ab32={},_0xf243a3={'count':0x0,'rows':[]};var _0x24d14c=_[_0xb75f('0x2b')](db[_0xb75f('0x2c')][_0xb75f('0x2d')],function(_0x44d246){return{'name':_0x44d246[_0xb75f('0x2e')],'type':_0x44d246[_0xb75f('0x2f')]['key']};});_0x17ab32['model']=_['map'](_0x24d14c,_0xb75f('0x28'));_0x17ab32['query']=_[_0xb75f('0x30')](_0x31e19b['query']);_0x17ab32['filters']=_['intersection'](_0x17ab32['model'],_0x17ab32[_0xb75f('0x31')]);_0xa03b0e[_0xb75f('0x32')]=_[_0xb75f('0x33')](_0x17ab32[_0xb75f('0x34')],qs[_0xb75f('0x35')](_0x31e19b[_0xb75f('0x31')][_0xb75f('0x35')]));_0xa03b0e[_0xb75f('0x32')]=_0xa03b0e[_0xb75f('0x32')][_0xb75f('0x36')]?_0xa03b0e[_0xb75f('0x32')]:_0x17ab32['model'];if(!_0x31e19b[_0xb75f('0x31')][_0xb75f('0x37')](_0xb75f('0x38'))){_0xa03b0e[_0xb75f('0x1e')]=qs[_0xb75f('0x1e')](_0x31e19b['query'][_0xb75f('0x1e')]);_0xa03b0e[_0xb75f('0x1c')]=qs[_0xb75f('0x1c')](_0x31e19b[_0xb75f('0x31')][_0xb75f('0x1c')]);}_0xa03b0e[_0xb75f('0x39')]=qs[_0xb75f('0x3a')](_0x31e19b['query'][_0xb75f('0x3a')]);_0xa03b0e['where']=qs[_0xb75f('0x3b')](_[_0xb75f('0x3c')](_0x31e19b['query'],_0x17ab32[_0xb75f('0x3b')]),_0x24d14c);if(_0x31e19b[_0xb75f('0x31')]['filter']){_0xa03b0e[_0xb75f('0x3d')]=_['merge'](_0xa03b0e[_0xb75f('0x3d')],{'$or':_[_0xb75f('0x2b')](_0x24d14c,function(_0x5597fb){if(_0x5597fb[_0xb75f('0x2f')]!=='VIRTUAL'){var _0x3cac4e={};_0x3cac4e[_0x5597fb[_0xb75f('0x28')]]={'$like':'%'+_0x31e19b[_0xb75f('0x31')][_0xb75f('0x3e')]+'%'};return _0x3cac4e;}})});}_0xa03b0e=_[_0xb75f('0x3f')]({},_0xa03b0e,_0x31e19b[_0xb75f('0x40')]);var _0x5471d6={'where':_0xa03b0e[_0xb75f('0x3d')]};return db[_0xb75f('0x2c')]['count'](_0x5471d6)[_0xb75f('0x41')](function(_0x1798a4){_0xf243a3[_0xb75f('0x1f')]=_0x1798a4;if(_0x31e19b[_0xb75f('0x31')][_0xb75f('0x42')]){_0xa03b0e['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0xb75f('0x43')](_0xa03b0e);})[_0xb75f('0x41')](function(_0x48bbbc){_0xf243a3[_0xb75f('0x44')]=_0x48bbbc;return _0xf243a3;})['then'](respondWithFilteredResult(_0x182c3b,_0xa03b0e))[_0xb75f('0x45')](handleError(_0x182c3b,null));};exports[_0xb75f('0x46')]=function(_0x37d912,_0x2bf9b2){var _0x34221e={'raw':![],'where':{'id':_0x37d912[_0xb75f('0x47')]['id']}},_0x63fb7c={};_0x63fb7c[_0xb75f('0x34')]=_[_0xb75f('0x30')](db[_0xb75f('0x2c')][_0xb75f('0x2d')]);_0x63fb7c[_0xb75f('0x31')]=_[_0xb75f('0x30')](_0x37d912[_0xb75f('0x31')]);_0x63fb7c['filters']=_[_0xb75f('0x33')](_0x63fb7c['model'],_0x63fb7c[_0xb75f('0x31')]);_0x34221e[_0xb75f('0x32')]=_[_0xb75f('0x33')](_0x63fb7c[_0xb75f('0x34')],qs[_0xb75f('0x35')](_0x37d912[_0xb75f('0x31')][_0xb75f('0x35')]));_0x34221e['attributes']=_0x34221e['attributes']['length']?_0x34221e['attributes']:_0x63fb7c[_0xb75f('0x34')];if(_0x37d912[_0xb75f('0x31')]['includeAll']){_0x34221e[_0xb75f('0x48')]=[{'all':!![]}];}_0x34221e=_[_0xb75f('0x3f')]({},_0x34221e,_0x37d912[_0xb75f('0x40')]);return db[_0xb75f('0x2c')][_0xb75f('0x49')](_0x34221e)[_0xb75f('0x41')](handleEntityNotFound(_0x2bf9b2,null))[_0xb75f('0x41')](respondWithResult(_0x2bf9b2,null))[_0xb75f('0x45')](handleError(_0x2bf9b2,null));};exports[_0xb75f('0x4a')]=function(_0x21ab06,_0x12a8fb){return db['VtigerConfiguration'][_0xb75f('0x4a')](_0x21ab06[_0xb75f('0x4b')],{})[_0xb75f('0x41')](respondWithResult(_0x12a8fb,0xc9))[_0xb75f('0x45')](handleError(_0x12a8fb,null));};exports['update']=function(_0x188e0d,_0x5d28fd){if(_0x188e0d[_0xb75f('0x4b')]['id']){delete _0x188e0d[_0xb75f('0x4b')]['id'];}return db[_0xb75f('0x2c')]['find']({'where':{'id':_0x188e0d['params']['id']}})[_0xb75f('0x41')](handleEntityNotFound(_0x5d28fd,null))[_0xb75f('0x41')](saveUpdates(_0x188e0d[_0xb75f('0x4b')],null))[_0xb75f('0x41')](respondWithResult(_0x5d28fd,null))[_0xb75f('0x45')](handleError(_0x5d28fd,null));};exports['destroy']=function(_0x4d277a,_0x32f02c){return db[_0xb75f('0x2c')][_0xb75f('0x49')]({'where':{'id':_0x4d277a['params']['id']}})[_0xb75f('0x41')](handleEntityNotFound(_0x32f02c,null))['then'](removeEntity(_0x32f02c,null))[_0xb75f('0x45')](handleError(_0x32f02c,null));};exports[_0xb75f('0x4c')]=function(_0x3333b4,_0x1e7cbf,_0x3e4a69){var _0x401522={};var _0x283ac3={};var _0x330768;var _0x29aea0;return db['VtigerConfiguration'][_0xb75f('0x4d')]({'where':{'id':_0x3333b4[_0xb75f('0x47')]['id']}})[_0xb75f('0x41')](handleEntityNotFound(_0x1e7cbf,null))[_0xb75f('0x41')](function(_0xdc85db){if(_0xdc85db){_0x330768=_0xdc85db;_0x283ac3[_0xb75f('0x34')]=_[_0xb75f('0x30')](db[_0xb75f('0x4e')][_0xb75f('0x2d')]);_0x283ac3['query']=_[_0xb75f('0x30')](_0x3333b4[_0xb75f('0x31')]);_0x283ac3[_0xb75f('0x3b')]=_[_0xb75f('0x33')](_0x283ac3[_0xb75f('0x34')],_0x283ac3[_0xb75f('0x31')]);_0x401522['attributes']=_[_0xb75f('0x33')](_0x283ac3['model'],qs[_0xb75f('0x35')](_0x3333b4[_0xb75f('0x31')][_0xb75f('0x35')]));_0x401522[_0xb75f('0x32')]=_0x401522[_0xb75f('0x32')]['length']?_0x401522[_0xb75f('0x32')]:_0x283ac3['model'];_0x401522['order']=qs[_0xb75f('0x3a')](_0x3333b4[_0xb75f('0x31')][_0xb75f('0x3a')]);_0x401522['where']=qs[_0xb75f('0x3b')](_[_0xb75f('0x3c')](_0x3333b4['query'],_0x283ac3[_0xb75f('0x3b')]));if(_0x3333b4['query']['filter']){_0x401522[_0xb75f('0x3d')]=_[_0xb75f('0x3f')](_0x401522[_0xb75f('0x3d')],{'$or':_[_0xb75f('0x2b')](_0x401522[_0xb75f('0x32')],function(_0x15c4f5){var _0xe077b9={};_0xe077b9[_0x15c4f5]={'$like':'%'+_0x3333b4[_0xb75f('0x31')][_0xb75f('0x3e')]+'%'};return _0xe077b9;})});}_0x401522=_['merge']({},_0x401522,_0x3333b4[_0xb75f('0x40')]);return _0x330768[_0xb75f('0x4c')](_0x401522);}})[_0xb75f('0x41')](function(_0x184491){if(_0x184491){_0x29aea0=_0x184491[_0xb75f('0x36')];if(!_0x3333b4[_0xb75f('0x31')][_0xb75f('0x37')](_0xb75f('0x38'))){_0x401522[_0xb75f('0x1e')]=qs[_0xb75f('0x1e')](_0x3333b4['query']['limit']);_0x401522[_0xb75f('0x1c')]=qs['offset'](_0x3333b4[_0xb75f('0x31')][_0xb75f('0x1c')]);}return _0x330768['getFields'](_0x401522);}})[_0xb75f('0x41')](function(_0x22ce90){if(_0x22ce90){return _0x22ce90?{'count':_0x29aea0,'rows':_0x22ce90}:null;}})[_0xb75f('0x41')](respondWithResult(_0x1e7cbf,null))[_0xb75f('0x45')](handleError(_0x1e7cbf,null));};exports[_0xb75f('0x4f')]=function(_0x454415,_0xd88ef4,_0x511358){var _0x5b4a7a={};var _0x3ebaf6={};var _0xb6f29b;var _0x1979e1;return db['VtigerConfiguration'][_0xb75f('0x4d')]({'where':{'id':_0x454415[_0xb75f('0x47')]['id']}})[_0xb75f('0x41')](handleEntityNotFound(_0xd88ef4,null))[_0xb75f('0x41')](function(_0x38ac11){if(_0x38ac11){_0xb6f29b=_0x38ac11;_0x3ebaf6[_0xb75f('0x34')]=_[_0xb75f('0x30')](db[_0xb75f('0x4e')]['rawAttributes']);_0x3ebaf6['query']=_[_0xb75f('0x30')](_0x454415[_0xb75f('0x31')]);_0x3ebaf6[_0xb75f('0x3b')]=_[_0xb75f('0x33')](_0x3ebaf6[_0xb75f('0x34')],_0x3ebaf6['query']);_0x5b4a7a[_0xb75f('0x32')]=_[_0xb75f('0x33')](_0x3ebaf6['model'],qs['fields'](_0x454415['query'][_0xb75f('0x35')]));_0x5b4a7a[_0xb75f('0x32')]=_0x5b4a7a[_0xb75f('0x32')]['length']?_0x5b4a7a[_0xb75f('0x32')]:_0x3ebaf6[_0xb75f('0x34')];_0x5b4a7a[_0xb75f('0x39')]=qs[_0xb75f('0x3a')](_0x454415[_0xb75f('0x31')][_0xb75f('0x3a')]);_0x5b4a7a[_0xb75f('0x3d')]=qs[_0xb75f('0x3b')](_[_0xb75f('0x3c')](_0x454415[_0xb75f('0x31')],_0x3ebaf6[_0xb75f('0x3b')]));if(_0x454415[_0xb75f('0x31')][_0xb75f('0x3e')]){_0x5b4a7a[_0xb75f('0x3d')]=_[_0xb75f('0x3f')](_0x5b4a7a[_0xb75f('0x3d')],{'$or':_[_0xb75f('0x2b')](_0x5b4a7a[_0xb75f('0x32')],function(_0x41996b){var _0x5a29a9={};_0x5a29a9[_0x41996b]={'$like':'%'+_0x454415[_0xb75f('0x31')][_0xb75f('0x3e')]+'%'};return _0x5a29a9;})});}_0x5b4a7a=_['merge']({},_0x5b4a7a,_0x454415[_0xb75f('0x40')]);return _0xb6f29b['getSubjects'](_0x5b4a7a);}})['then'](function(_0x349d67){if(_0x349d67){_0x1979e1=_0x349d67[_0xb75f('0x36')];if(!_0x454415[_0xb75f('0x31')][_0xb75f('0x37')](_0xb75f('0x38'))){_0x5b4a7a[_0xb75f('0x1e')]=qs['limit'](_0x454415[_0xb75f('0x31')][_0xb75f('0x1e')]);_0x5b4a7a[_0xb75f('0x1c')]=qs[_0xb75f('0x1c')](_0x454415['query'][_0xb75f('0x1c')]);}return _0xb6f29b[_0xb75f('0x4f')](_0x5b4a7a);}})[_0xb75f('0x41')](function(_0x449463){if(_0x449463){return _0x449463?{'count':_0x1979e1,'rows':_0x449463}:null;}})[_0xb75f('0x41')](respondWithResult(_0xd88ef4,null))[_0xb75f('0x45')](handleError(_0xd88ef4,null));};exports[_0xb75f('0x50')]=function(_0x3c7f87,_0x4cbade,_0x378974){var _0x30bfff={};var _0x1b7e08={};var _0x4ad62e;var _0x56beed;return db[_0xb75f('0x2c')][_0xb75f('0x4d')]({'where':{'id':_0x3c7f87[_0xb75f('0x47')]['id']}})[_0xb75f('0x41')](handleEntityNotFound(_0x4cbade,null))[_0xb75f('0x41')](function(_0x55b157){if(_0x55b157){_0x4ad62e=_0x55b157;_0x1b7e08[_0xb75f('0x34')]=_['keys'](db[_0xb75f('0x4e')]['rawAttributes']);_0x1b7e08['query']=_['keys'](_0x3c7f87[_0xb75f('0x31')]);_0x1b7e08[_0xb75f('0x3b')]=_['intersection'](_0x1b7e08[_0xb75f('0x34')],_0x1b7e08[_0xb75f('0x31')]);_0x30bfff['attributes']=_[_0xb75f('0x33')](_0x1b7e08[_0xb75f('0x34')],qs[_0xb75f('0x35')](_0x3c7f87[_0xb75f('0x31')][_0xb75f('0x35')]));_0x30bfff['attributes']=_0x30bfff['attributes'][_0xb75f('0x36')]?_0x30bfff[_0xb75f('0x32')]:_0x1b7e08['model'];_0x30bfff[_0xb75f('0x39')]=qs[_0xb75f('0x3a')](_0x3c7f87[_0xb75f('0x31')][_0xb75f('0x3a')]);_0x30bfff[_0xb75f('0x3d')]=qs[_0xb75f('0x3b')](_[_0xb75f('0x3c')](_0x3c7f87['query'],_0x1b7e08[_0xb75f('0x3b')]));if(_0x3c7f87[_0xb75f('0x31')][_0xb75f('0x3e')]){_0x30bfff[_0xb75f('0x3d')]=_[_0xb75f('0x3f')](_0x30bfff[_0xb75f('0x3d')],{'$or':_[_0xb75f('0x2b')](_0x30bfff['attributes'],function(_0x3c52d1){var _0x5d80a8={};_0x5d80a8[_0x3c52d1]={'$like':'%'+_0x3c7f87[_0xb75f('0x31')][_0xb75f('0x3e')]+'%'};return _0x5d80a8;})});}_0x30bfff=_['merge']({},_0x30bfff,_0x3c7f87[_0xb75f('0x40')]);return _0x4ad62e[_0xb75f('0x50')](_0x30bfff);}})['then'](function(_0x193f8d){if(_0x193f8d){_0x56beed=_0x193f8d['length'];if(!_0x3c7f87[_0xb75f('0x31')]['hasOwnProperty']('nolimit')){_0x30bfff[_0xb75f('0x1e')]=qs[_0xb75f('0x1e')](_0x3c7f87['query']['limit']);_0x30bfff[_0xb75f('0x1c')]=qs[_0xb75f('0x1c')](_0x3c7f87[_0xb75f('0x31')][_0xb75f('0x1c')]);}return _0x4ad62e['getDescriptions'](_0x30bfff);}})[_0xb75f('0x41')](function(_0x214d86){if(_0x214d86){return _0x214d86?{'count':_0x56beed,'rows':_0x214d86}:null;}})[_0xb75f('0x41')](respondWithResult(_0x4cbade,null))[_0xb75f('0x45')](handleError(_0x4cbade,null));}; \ No newline at end of file +var _0x24ef=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','VIRTUAL','merge','options','where','then','include','findAll','rows','catch','includeAll','find','create','body','params','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2e0cd1,_0x149caa){var _0x4b0159=function(_0x246fe8){while(--_0x246fe8){_0x2e0cd1['push'](_0x2e0cd1['shift']());}};_0x4b0159(++_0x149caa);}(_0x24ef,0xdf));var _0xf24e=function(_0x479c21,_0x6c38dc){_0x479c21=_0x479c21-0x0;var _0x4ba3c0=_0x24ef[_0x479c21];return _0x4ba3c0;};'use strict';var emlformat=require(_0xf24e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf24e('0x1'));var jsonpatch=require(_0xf24e('0x2'));var rp=require('request-promise');var moment=require(_0xf24e('0x3'));var BPromise=require(_0xf24e('0x4'));var Mustache=require(_0xf24e('0x5'));var util=require(_0xf24e('0x6'));var path=require(_0xf24e('0x7'));var sox=require(_0xf24e('0x8'));var csv=require(_0xf24e('0x9'));var ejs=require(_0xf24e('0xa'));var fs=require('fs');var fs_extra=require(_0xf24e('0xb'));var _=require(_0xf24e('0xc'));var squel=require(_0xf24e('0xd'));var crypto=require('crypto');var jsforce=require(_0xf24e('0xe'));var deskjs=require(_0xf24e('0xf'));var toCsv=require(_0xf24e('0x9'));var querystring=require(_0xf24e('0x10'));var Papa=require(_0xf24e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf24e('0x12'));var hardwareService=require(_0xf24e('0x13'));var logger=require(_0xf24e('0x14'))(_0xf24e('0x15'));var utils=require(_0xf24e('0x16'));var config=require(_0xf24e('0x17'));var licenseUtil=require(_0xf24e('0x18'));var db=require(_0xf24e('0x19'))['db'];function respondWithStatusCode(_0x509ed0,_0x5dd61e){_0x5dd61e=_0x5dd61e||0xcc;return function(_0x258c82){if(_0x258c82){return _0x509ed0[_0xf24e('0x1a')](_0x5dd61e);}return _0x509ed0[_0xf24e('0x1b')](_0x5dd61e)['end']();};}function respondWithResult(_0x3503d9,_0x4e05e8){_0x4e05e8=_0x4e05e8||0xc8;return function(_0x20f1c9){if(_0x20f1c9){return _0x3503d9['status'](_0x4e05e8)[_0xf24e('0x1c')](_0x20f1c9);}};}function respondWithFilteredResult(_0x50db4e,_0x3b80ab){return function(_0x257484){if(_0x257484){var _0x3d16d6=typeof _0x3b80ab['offset']===_0xf24e('0x1d')&&typeof _0x3b80ab[_0xf24e('0x1e')]===_0xf24e('0x1d');var _0x5d05dc=_0x257484[_0xf24e('0x1f')];var _0x22fcfa=_0x3d16d6?0x0:_0x3b80ab[_0xf24e('0x20')];var _0x1050c5=_0x3d16d6?_0x257484[_0xf24e('0x1f')]:_0x3b80ab[_0xf24e('0x20')]+_0x3b80ab[_0xf24e('0x1e')];var _0x177ddf;if(_0x1050c5>=_0x5d05dc){_0x1050c5=_0x5d05dc;_0x177ddf=0xc8;}else{_0x177ddf=0xce;}_0x50db4e[_0xf24e('0x1b')](_0x177ddf);return _0x50db4e['set'](_0xf24e('0x21'),_0x22fcfa+'-'+_0x1050c5+'/'+_0x5d05dc)[_0xf24e('0x1c')](_0x257484);}return null;};}function patchUpdates(_0x46dcbb){return function(_0x15281a){try{jsonpatch[_0xf24e('0x22')](_0x15281a,_0x46dcbb,!![]);}catch(_0x3fcaa1){return BPromise[_0xf24e('0x23')](_0x3fcaa1);}return _0x15281a[_0xf24e('0x24')]();};}function saveUpdates(_0x472c94,_0x52745d){return function(_0x2cedce){if(_0x2cedce){return _0x2cedce[_0xf24e('0x25')](_0x472c94)['then'](function(_0xc781cb){return _0xc781cb;});}return null;};}function removeEntity(_0xb2c8b8,_0x17385a){return function(_0x27491f){if(_0x27491f){return _0x27491f[_0xf24e('0x26')]()['then'](function(){_0xb2c8b8[_0xf24e('0x1b')](0xcc)[_0xf24e('0x27')]();});}};}function handleEntityNotFound(_0x12aa7a,_0x1607f2){return function(_0x3ca5c6){if(!_0x3ca5c6){_0x12aa7a[_0xf24e('0x1a')](0x194);}return _0x3ca5c6;};}function handleError(_0x22b400,_0x42c346){_0x42c346=_0x42c346||0x1f4;return function(_0x22dd81){logger['error'](_0x22dd81[_0xf24e('0x28')]);if(_0x22dd81[_0xf24e('0x29')]){delete _0x22dd81[_0xf24e('0x29')];}_0x22b400['status'](_0x42c346)[_0xf24e('0x2a')](_0x22dd81);};}exports[_0xf24e('0x2b')]=function(_0x1190ab,_0x24a3cf){var _0x248f2f={},_0x3fd772={},_0x5361e7={'count':0x0,'rows':[]};var _0x13a79c=_[_0xf24e('0x2c')](db[_0xf24e('0x2d')][_0xf24e('0x2e')],function(_0x828340){return{'name':_0x828340['fieldName'],'type':_0x828340[_0xf24e('0x2f')][_0xf24e('0x30')]};});_0x3fd772[_0xf24e('0x31')]=_['map'](_0x13a79c,_0xf24e('0x29'));_0x3fd772[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x1190ab[_0xf24e('0x32')]);_0x3fd772['filters']=_[_0xf24e('0x34')](_0x3fd772[_0xf24e('0x31')],_0x3fd772['query']);_0x248f2f[_0xf24e('0x35')]=_[_0xf24e('0x34')](_0x3fd772['model'],qs['fields'](_0x1190ab[_0xf24e('0x32')][_0xf24e('0x36')]));_0x248f2f[_0xf24e('0x35')]=_0x248f2f[_0xf24e('0x35')][_0xf24e('0x37')]?_0x248f2f[_0xf24e('0x35')]:_0x3fd772[_0xf24e('0x31')];if(!_0x1190ab[_0xf24e('0x32')][_0xf24e('0x38')](_0xf24e('0x39'))){_0x248f2f[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x1190ab[_0xf24e('0x32')][_0xf24e('0x1e')]);_0x248f2f[_0xf24e('0x20')]=qs['offset'](_0x1190ab[_0xf24e('0x32')][_0xf24e('0x20')]);}_0x248f2f[_0xf24e('0x3a')]=qs[_0xf24e('0x3b')](_0x1190ab[_0xf24e('0x32')][_0xf24e('0x3b')]);_0x248f2f['where']=qs[_0xf24e('0x3c')](_[_0xf24e('0x3d')](_0x1190ab['query'],_0x3fd772[_0xf24e('0x3c')]),_0x13a79c);if(_0x1190ab['query'][_0xf24e('0x3e')]){_0x248f2f['where']=_['merge'](_0x248f2f['where'],{'$or':_[_0xf24e('0x2c')](_0x13a79c,function(_0x171abf){if(_0x171abf['type']!==_0xf24e('0x3f')){var _0x173176={};_0x173176[_0x171abf[_0xf24e('0x29')]]={'$like':'%'+_0x1190ab['query'][_0xf24e('0x3e')]+'%'};return _0x173176;}})});}_0x248f2f=_[_0xf24e('0x40')]({},_0x248f2f,_0x1190ab[_0xf24e('0x41')]);var _0x4116aa={'where':_0x248f2f[_0xf24e('0x42')]};return db[_0xf24e('0x2d')][_0xf24e('0x1f')](_0x4116aa)[_0xf24e('0x43')](function(_0x427dbd){_0x5361e7['count']=_0x427dbd;if(_0x1190ab[_0xf24e('0x32')]['includeAll']){_0x248f2f[_0xf24e('0x44')]=[{'all':!![]}];}return db[_0xf24e('0x2d')][_0xf24e('0x45')](_0x248f2f);})[_0xf24e('0x43')](function(_0x2b3ded){_0x5361e7[_0xf24e('0x46')]=_0x2b3ded;return _0x5361e7;})[_0xf24e('0x43')](respondWithFilteredResult(_0x24a3cf,_0x248f2f))[_0xf24e('0x47')](handleError(_0x24a3cf,null));};exports['show']=function(_0x1ec608,_0x1fa7d1){var _0x2fc9c7={'raw':![],'where':{'id':_0x1ec608['params']['id']}},_0x3c6ee2={};_0x3c6ee2[_0xf24e('0x31')]=_[_0xf24e('0x33')](db['VtigerConfiguration'][_0xf24e('0x2e')]);_0x3c6ee2[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x1ec608['query']);_0x3c6ee2[_0xf24e('0x3c')]=_[_0xf24e('0x34')](_0x3c6ee2[_0xf24e('0x31')],_0x3c6ee2[_0xf24e('0x32')]);_0x2fc9c7['attributes']=_[_0xf24e('0x34')](_0x3c6ee2[_0xf24e('0x31')],qs[_0xf24e('0x36')](_0x1ec608[_0xf24e('0x32')][_0xf24e('0x36')]));_0x2fc9c7['attributes']=_0x2fc9c7[_0xf24e('0x35')][_0xf24e('0x37')]?_0x2fc9c7[_0xf24e('0x35')]:_0x3c6ee2[_0xf24e('0x31')];if(_0x1ec608[_0xf24e('0x32')][_0xf24e('0x48')]){_0x2fc9c7[_0xf24e('0x44')]=[{'all':!![]}];}_0x2fc9c7=_[_0xf24e('0x40')]({},_0x2fc9c7,_0x1ec608[_0xf24e('0x41')]);return db['VtigerConfiguration'][_0xf24e('0x49')](_0x2fc9c7)[_0xf24e('0x43')](handleEntityNotFound(_0x1fa7d1,null))[_0xf24e('0x43')](respondWithResult(_0x1fa7d1,null))[_0xf24e('0x47')](handleError(_0x1fa7d1,null));};exports[_0xf24e('0x4a')]=function(_0x3ac32d,_0x4a1f6b){return db['VtigerConfiguration'][_0xf24e('0x4a')](_0x3ac32d[_0xf24e('0x4b')],{})[_0xf24e('0x43')](respondWithResult(_0x4a1f6b,0xc9))['catch'](handleError(_0x4a1f6b,null));};exports[_0xf24e('0x25')]=function(_0x452bde,_0x5bc032){if(_0x452bde['body']['id']){delete _0x452bde[_0xf24e('0x4b')]['id'];}return db[_0xf24e('0x2d')]['find']({'where':{'id':_0x452bde[_0xf24e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5bc032,null))[_0xf24e('0x43')](saveUpdates(_0x452bde[_0xf24e('0x4b')],null))['then'](respondWithResult(_0x5bc032,null))['catch'](handleError(_0x5bc032,null));};exports[_0xf24e('0x26')]=function(_0xe5a329,_0x13d1bb){return db[_0xf24e('0x2d')][_0xf24e('0x49')]({'where':{'id':_0xe5a329[_0xf24e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x13d1bb,null))[_0xf24e('0x43')](removeEntity(_0x13d1bb,null))[_0xf24e('0x47')](handleError(_0x13d1bb,null));};exports[_0xf24e('0x4d')]=function(_0x4aeae4,_0x47ac47,_0x46caf9){var _0xeaa054={};var _0x27301a={};var _0x17108e;var _0x1807c5;return db[_0xf24e('0x2d')][_0xf24e('0x4e')]({'where':{'id':_0x4aeae4[_0xf24e('0x4c')]['id']}})[_0xf24e('0x43')](handleEntityNotFound(_0x47ac47,null))[_0xf24e('0x43')](function(_0x350e47){if(_0x350e47){_0x17108e=_0x350e47;_0x27301a[_0xf24e('0x31')]=_[_0xf24e('0x33')](db[_0xf24e('0x4f')][_0xf24e('0x2e')]);_0x27301a[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x4aeae4['query']);_0x27301a['filters']=_[_0xf24e('0x34')](_0x27301a['model'],_0x27301a[_0xf24e('0x32')]);_0xeaa054['attributes']=_[_0xf24e('0x34')](_0x27301a['model'],qs[_0xf24e('0x36')](_0x4aeae4[_0xf24e('0x32')][_0xf24e('0x36')]));_0xeaa054[_0xf24e('0x35')]=_0xeaa054['attributes'][_0xf24e('0x37')]?_0xeaa054[_0xf24e('0x35')]:_0x27301a[_0xf24e('0x31')];_0xeaa054['order']=qs[_0xf24e('0x3b')](_0x4aeae4['query'][_0xf24e('0x3b')]);_0xeaa054[_0xf24e('0x42')]=qs['filters'](_[_0xf24e('0x3d')](_0x4aeae4[_0xf24e('0x32')],_0x27301a['filters']));if(_0x4aeae4['query'][_0xf24e('0x3e')]){_0xeaa054[_0xf24e('0x42')]=_[_0xf24e('0x40')](_0xeaa054[_0xf24e('0x42')],{'$or':_['map'](_0xeaa054[_0xf24e('0x35')],function(_0x5bb28e){var _0xecfe47={};_0xecfe47[_0x5bb28e]={'$like':'%'+_0x4aeae4['query'][_0xf24e('0x3e')]+'%'};return _0xecfe47;})});}_0xeaa054=_['merge']({},_0xeaa054,_0x4aeae4[_0xf24e('0x41')]);return _0x17108e[_0xf24e('0x4d')](_0xeaa054);}})[_0xf24e('0x43')](function(_0x3285ec){if(_0x3285ec){_0x1807c5=_0x3285ec['length'];if(!_0x4aeae4['query']['hasOwnProperty'](_0xf24e('0x39'))){_0xeaa054[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x4aeae4['query'][_0xf24e('0x1e')]);_0xeaa054['offset']=qs[_0xf24e('0x20')](_0x4aeae4[_0xf24e('0x32')][_0xf24e('0x20')]);}return _0x17108e[_0xf24e('0x4d')](_0xeaa054);}})[_0xf24e('0x43')](function(_0x1aa801){if(_0x1aa801){return _0x1aa801?{'count':_0x1807c5,'rows':_0x1aa801}:null;}})[_0xf24e('0x43')](respondWithResult(_0x47ac47,null))[_0xf24e('0x47')](handleError(_0x47ac47,null));};exports[_0xf24e('0x50')]=function(_0x415c27,_0x7c0523,_0x186b32){var _0x304866={};var _0x163e4b={};var _0x18498f;var _0x4d405d;return db[_0xf24e('0x2d')][_0xf24e('0x4e')]({'where':{'id':_0x415c27[_0xf24e('0x4c')]['id']}})[_0xf24e('0x43')](handleEntityNotFound(_0x7c0523,null))[_0xf24e('0x43')](function(_0x2ba155){if(_0x2ba155){_0x18498f=_0x2ba155;_0x163e4b[_0xf24e('0x31')]=_['keys'](db['VtigerField'][_0xf24e('0x2e')]);_0x163e4b[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x415c27[_0xf24e('0x32')]);_0x163e4b[_0xf24e('0x3c')]=_[_0xf24e('0x34')](_0x163e4b['model'],_0x163e4b[_0xf24e('0x32')]);_0x304866[_0xf24e('0x35')]=_['intersection'](_0x163e4b[_0xf24e('0x31')],qs[_0xf24e('0x36')](_0x415c27['query']['fields']));_0x304866['attributes']=_0x304866[_0xf24e('0x35')]['length']?_0x304866[_0xf24e('0x35')]:_0x163e4b[_0xf24e('0x31')];_0x304866[_0xf24e('0x3a')]=qs['sort'](_0x415c27[_0xf24e('0x32')][_0xf24e('0x3b')]);_0x304866[_0xf24e('0x42')]=qs['filters'](_['pick'](_0x415c27['query'],_0x163e4b[_0xf24e('0x3c')]));if(_0x415c27['query'][_0xf24e('0x3e')]){_0x304866[_0xf24e('0x42')]=_['merge'](_0x304866['where'],{'$or':_[_0xf24e('0x2c')](_0x304866[_0xf24e('0x35')],function(_0x55b257){var _0x17f12e={};_0x17f12e[_0x55b257]={'$like':'%'+_0x415c27['query']['filter']+'%'};return _0x17f12e;})});}_0x304866=_[_0xf24e('0x40')]({},_0x304866,_0x415c27[_0xf24e('0x41')]);return _0x18498f[_0xf24e('0x50')](_0x304866);}})[_0xf24e('0x43')](function(_0x3bfe99){if(_0x3bfe99){_0x4d405d=_0x3bfe99[_0xf24e('0x37')];if(!_0x415c27[_0xf24e('0x32')][_0xf24e('0x38')](_0xf24e('0x39'))){_0x304866[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x415c27['query'][_0xf24e('0x1e')]);_0x304866[_0xf24e('0x20')]=qs[_0xf24e('0x20')](_0x415c27[_0xf24e('0x32')]['offset']);}return _0x18498f[_0xf24e('0x50')](_0x304866);}})[_0xf24e('0x43')](function(_0x21e46d){if(_0x21e46d){return _0x21e46d?{'count':_0x4d405d,'rows':_0x21e46d}:null;}})['then'](respondWithResult(_0x7c0523,null))['catch'](handleError(_0x7c0523,null));};exports[_0xf24e('0x51')]=function(_0x189072,_0x518835,_0x3759bc){var _0x5a7a23={};var _0x5304d2={};var _0x71c448;var _0xb0066d;return db[_0xf24e('0x2d')]['findOne']({'where':{'id':_0x189072[_0xf24e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x518835,null))[_0xf24e('0x43')](function(_0x4e85f7){if(_0x4e85f7){_0x71c448=_0x4e85f7;_0x5304d2['model']=_['keys'](db[_0xf24e('0x4f')]['rawAttributes']);_0x5304d2[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x189072[_0xf24e('0x32')]);_0x5304d2[_0xf24e('0x3c')]=_[_0xf24e('0x34')](_0x5304d2['model'],_0x5304d2['query']);_0x5a7a23['attributes']=_[_0xf24e('0x34')](_0x5304d2['model'],qs[_0xf24e('0x36')](_0x189072[_0xf24e('0x32')][_0xf24e('0x36')]));_0x5a7a23['attributes']=_0x5a7a23[_0xf24e('0x35')][_0xf24e('0x37')]?_0x5a7a23[_0xf24e('0x35')]:_0x5304d2[_0xf24e('0x31')];_0x5a7a23[_0xf24e('0x3a')]=qs[_0xf24e('0x3b')](_0x189072[_0xf24e('0x32')][_0xf24e('0x3b')]);_0x5a7a23['where']=qs[_0xf24e('0x3c')](_[_0xf24e('0x3d')](_0x189072[_0xf24e('0x32')],_0x5304d2[_0xf24e('0x3c')]));if(_0x189072[_0xf24e('0x32')][_0xf24e('0x3e')]){_0x5a7a23[_0xf24e('0x42')]=_[_0xf24e('0x40')](_0x5a7a23['where'],{'$or':_['map'](_0x5a7a23[_0xf24e('0x35')],function(_0x347e6d){var _0x2277a8={};_0x2277a8[_0x347e6d]={'$like':'%'+_0x189072[_0xf24e('0x32')][_0xf24e('0x3e')]+'%'};return _0x2277a8;})});}_0x5a7a23=_[_0xf24e('0x40')]({},_0x5a7a23,_0x189072[_0xf24e('0x41')]);return _0x71c448['getDescriptions'](_0x5a7a23);}})[_0xf24e('0x43')](function(_0x4cb1e6){if(_0x4cb1e6){_0xb0066d=_0x4cb1e6[_0xf24e('0x37')];if(!_0x189072[_0xf24e('0x32')][_0xf24e('0x38')](_0xf24e('0x39'))){_0x5a7a23[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x189072[_0xf24e('0x32')][_0xf24e('0x1e')]);_0x5a7a23[_0xf24e('0x20')]=qs[_0xf24e('0x20')](_0x189072[_0xf24e('0x32')][_0xf24e('0x20')]);}return _0x71c448[_0xf24e('0x51')](_0x5a7a23);}})[_0xf24e('0x43')](function(_0x54680a){if(_0x54680a){return _0x54680a?{'count':_0xb0066d,'rows':_0x54680a}:null;}})[_0xf24e('0x43')](respondWithResult(_0x518835,null))[_0xf24e('0x47')](handleError(_0x518835,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 234d999..eec7a47 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd34e=['int_vtiger_configurations','lodash','util','api','moment','path','rimraf','../../config/environment','exports','define','VtigerConfiguration'];(function(_0x571c2b,_0x222591){var _0x1163b5=function(_0x43db40){while(--_0x43db40){_0x571c2b['push'](_0x571c2b['shift']());}};_0x1163b5(++_0x222591);}(_0xd34e,0xa6));var _0xed34=function(_0x3ae033,_0x2cb9e2){_0x3ae033=_0x3ae033-0x0;var _0x238a12=_0xd34e[_0x3ae033];return _0x238a12;};'use strict';var _=require(_0xed34('0x0'));var util=require(_0xed34('0x1'));var logger=require('../../config/logger')(_0xed34('0x2'));var moment=require(_0xed34('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xed34('0x4'));var rimraf=require(_0xed34('0x5'));var config=require(_0xed34('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xed34('0x7')]=function(_0x5ca089,_0x3297c2){return _0x5ca089[_0xed34('0x8')](_0xed34('0x9'),attributes,{'tableName':_0xed34('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb948=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x8da055,_0x45250b){var _0x4dd0f7=function(_0xd157ff){while(--_0xd157ff){_0x8da055['push'](_0x8da055['shift']());}};_0x4dd0f7(++_0x45250b);}(_0xb948,0x1c1));var _0x8b94=function(_0x3340c8,_0x3d67d7){_0x3340c8=_0x3340c8-0x0;var _0x30ca8a=_0xb948[_0x3340c8];return _0x30ca8a;};'use strict';var _=require(_0x8b94('0x0'));var util=require(_0x8b94('0x1'));var logger=require(_0x8b94('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b94('0x3'));var rp=require(_0x8b94('0x4'));var fs=require('fs');var path=require(_0x8b94('0x5'));var rimraf=require('rimraf');var config=require(_0x8b94('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x538b4b,_0x23d005){return _0x538b4b[_0x8b94('0x7')](_0x8b94('0x8'),attributes,{'tableName':_0x8b94('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 1ddbd35..70ef14c 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8629=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','VtigerConfiguration,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x564f49,_0x28e7a9){var _0x217dfa=function(_0x18dff3){while(--_0x18dff3){_0x564f49['push'](_0x564f49['shift']());}};_0x217dfa(++_0x28e7a9);}(_0x8629,0x180));var _0x9862=function(_0x22123d,_0x45ae06){_0x22123d=_0x22123d-0x0;var _0xeabce1=_0x8629[_0x22123d];return _0xeabce1;};'use strict';var _=require(_0x9862('0x0'));var util=require(_0x9862('0x1'));var moment=require('moment');var BPromise=require(_0x9862('0x2'));var rs=require(_0x9862('0x3'));var fs=require('fs');var Redis=require(_0x9862('0x4'));var db=require(_0x9862('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9862('0x6'))('rpc');var config=require(_0x9862('0x7'));var jayson=require(_0x9862('0x8'));var client=jayson[_0x9862('0x9')][_0x9862('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dc3b9,_0x220859,_0x863857){return new BPromise(function(_0x2eec25,_0x21e186){return client[_0x9862('0xb')](_0x2dc3b9,_0x863857)[_0x9862('0xc')](function(_0x391bc7){logger[_0x9862('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x220859,_0x9862('0xe'));logger['debug'](_0x9862('0xf'),_0x220859,_0x9862('0xe'),JSON[_0x9862('0x10')](_0x391bc7));if(_0x391bc7[_0x9862('0x11')]){if(_0x391bc7[_0x9862('0x11')]['code']===0x1f4){logger[_0x9862('0x11')](_0x9862('0x12'),_0x220859,_0x391bc7[_0x9862('0x11')]['message']);return _0x21e186(_0x391bc7[_0x9862('0x11')]['message']);}logger[_0x9862('0x11')](_0x9862('0x12'),_0x220859,_0x391bc7[_0x9862('0x11')]['message']);return _0x2eec25(_0x391bc7[_0x9862('0x11')][_0x9862('0x13')]);}else{logger['info'](_0x9862('0x12'),_0x220859,'request\x20sent');_0x2eec25(_0x391bc7[_0x9862('0x14')][_0x9862('0x13')]);}})['catch'](function(_0x1691b1){logger[_0x9862('0x11')](_0x9862('0x12'),_0x220859,_0x1691b1);_0x21e186(_0x1691b1);});});} \ No newline at end of file +var _0x0daa=['../../config/environment','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x0daa,0xe9));var _0xa0da=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0daa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa0da('0x0'));var util=require(_0xa0da('0x1'));var moment=require(_0xa0da('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0da('0x3'));var fs=require('fs');var Redis=require(_0xa0da('0x4'));var db=require(_0xa0da('0x5'))['db'];var utils=require(_0xa0da('0x6'));var logger=require(_0xa0da('0x7'))(_0xa0da('0x8'));var config=require(_0xa0da('0x9'));var jayson=require(_0xa0da('0xa'));var client=jayson[_0xa0da('0xb')][_0xa0da('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b56f2,_0x13706c,_0x7a82db){return new BPromise(function(_0x407a39,_0xcab8e5){return client[_0xa0da('0xd')](_0x5b56f2,_0x7a82db)['then'](function(_0x1f001c){logger[_0xa0da('0xe')](_0xa0da('0xf'),_0x13706c,_0xa0da('0x10'));logger[_0xa0da('0x11')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x13706c,_0xa0da('0x10'),JSON[_0xa0da('0x12')](_0x1f001c));if(_0x1f001c[_0xa0da('0x13')]){if(_0x1f001c[_0xa0da('0x13')]['code']===0x1f4){logger['error'](_0xa0da('0xf'),_0x13706c,_0x1f001c[_0xa0da('0x13')][_0xa0da('0x14')]);return _0xcab8e5(_0x1f001c[_0xa0da('0x13')][_0xa0da('0x14')]);}logger[_0xa0da('0x13')](_0xa0da('0xf'),_0x13706c,_0x1f001c[_0xa0da('0x13')][_0xa0da('0x14')]);return _0x407a39(_0x1f001c[_0xa0da('0x13')]['message']);}else{logger[_0xa0da('0xe')](_0xa0da('0xf'),_0x13706c,'request\x20sent');_0x407a39(_0x1f001c[_0xa0da('0x15')][_0xa0da('0x14')]);}})['catch'](function(_0x5b37db){logger[_0xa0da('0x13')](_0xa0da('0xf'),_0x13706c,_0x5b37db);_0xcab8e5(_0x5b37db);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 0bf65ca..1a34ba4 100644 --- a/server/api/intVtigerField/index.js +++ b/server/api/intVtigerField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13c7=['delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','isAuthenticated','post','put','update'];(function(_0x464e36,_0x5d29ad){var _0x3a0d82=function(_0x488b57){while(--_0x488b57){_0x464e36['push'](_0x464e36['shift']());}};_0x3a0d82(++_0x5d29ad);}(_0x13c7,0x17d));var _0x713c=function(_0x197fee,_0x43c5ca){_0x197fee=_0x197fee-0x0;var _0x2e28ed=_0x13c7[_0x197fee];return _0x2e28ed;};'use strict';var multer=require(_0x713c('0x0'));var util=require(_0x713c('0x1'));var path=require(_0x713c('0x2'));var timeout=require(_0x713c('0x3'));var express=require(_0x713c('0x4'));var router=express[_0x713c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x713c('0x6'));var config=require(_0x713c('0x7'));var controller=require(_0x713c('0x8'));router[_0x713c('0x9')]('/',auth['isAuthenticated'](),controller[_0x713c('0xa')]);router[_0x713c('0x9')]('/:id',auth[_0x713c('0xb')](),controller['show']);router[_0x713c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x713c('0xd')]('/:id',auth[_0x713c('0xb')](),controller[_0x713c('0xe')]);router[_0x713c('0xf')](_0x713c('0x10'),auth[_0x713c('0xb')](),controller[_0x713c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1e99=['express','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','isAuthenticated','get','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout'];(function(_0x1d6a4b,_0x573df9){var _0x1778a8=function(_0x313e46){while(--_0x313e46){_0x1d6a4b['push'](_0x1d6a4b['shift']());}};_0x1778a8(++_0x573df9);}(_0x1e99,0xfd));var _0x91e9=function(_0x28bed3,_0x120696){_0x28bed3=_0x28bed3-0x0;var _0x2c8f67=_0x1e99[_0x28bed3];return _0x2c8f67;};'use strict';var multer=require(_0x91e9('0x0'));var util=require(_0x91e9('0x1'));var path=require('path');var timeout=require(_0x91e9('0x2'));var express=require(_0x91e9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x91e9('0x4'));var interaction=require(_0x91e9('0x5'));var config=require('../../config/environment');var controller=require(_0x91e9('0x6'));router['get']('/',auth[_0x91e9('0x7')](),controller['index']);router[_0x91e9('0x8')]('/:id',auth[_0x91e9('0x7')](),controller['show']);router[_0x91e9('0x9')]('/',auth[_0x91e9('0x7')](),controller[_0x91e9('0xa')]);router[_0x91e9('0xb')](_0x91e9('0xc'),auth[_0x91e9('0x7')](),controller[_0x91e9('0xd')]);router[_0x91e9('0xe')](_0x91e9('0xc'),auth['isAuthenticated'](),controller[_0x91e9('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 8b29d8c..5e905c9 100644 --- a/server/api/intVtigerField/intVtigerField.attributes.js +++ b/server/api/intVtigerField/intVtigerField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c12=['picklist','STRING','variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x7c12,0xdc));var _0x27c1=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x7c12[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require('sequelize');module[_0x27c1('0x0')]={'type':{'type':Sequelize[_0x27c1('0x1')](_0x27c1('0x2'),'variable',_0x27c1('0x3'),_0x27c1('0x4'),_0x27c1('0x5')),'defaultValue':_0x27c1('0x2')},'content':{'type':Sequelize[_0x27c1('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x27c1('0x1')]('string',_0x27c1('0x7'),_0x27c1('0x3'))},'keyContent':{'type':Sequelize[_0x27c1('0x6')]},'idField':{'type':Sequelize[_0x27c1('0x6')]},'nameField':{'type':Sequelize[_0x27c1('0x6')]},'customField':{'type':Sequelize[_0x27c1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x27c1('0x6')]}}; \ No newline at end of file +var _0x5669=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','ENUM','string'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0x5669,0x186));var _0x9566=function(_0x2d8a23,_0x522080){_0x2d8a23=_0x2d8a23-0x0;var _0xd7bce1=_0x5669[_0x2d8a23];return _0xd7bce1;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9566('0x0')](_0x9566('0x1'),_0x9566('0x2'),_0x9566('0x3'),_0x9566('0x4'),_0x9566('0x5')),'defaultValue':_0x9566('0x1')},'content':{'type':Sequelize[_0x9566('0x6')]},'key':{'type':Sequelize[_0x9566('0x6')]},'keyType':{'type':Sequelize[_0x9566('0x0')](_0x9566('0x1'),_0x9566('0x2'),_0x9566('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9566('0x6')]},'customField':{'type':Sequelize[_0x9566('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9566('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index e826067..fc4fb32 100644 --- a/server/api/intVtigerField/intVtigerField.controller.js +++ b/server/api/intVtigerField/intVtigerField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4a8=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x363974,_0x34a5ef){var _0x524fdc=function(_0x6477af){while(--_0x6477af){_0x363974['push'](_0x363974['shift']());}};_0x524fdc(++_0x34a5ef);}(_0xd4a8,0x1c9));var _0x8d4a=function(_0x19717b,_0x20931a){_0x19717b=_0x19717b-0x0;var _0x26ee47=_0xd4a8[_0x19717b];return _0x26ee47;};'use strict';var emlformat=require(_0x8d4a('0x0'));var rimraf=require(_0x8d4a('0x1'));var zipdir=require(_0x8d4a('0x2'));var jsonpatch=require(_0x8d4a('0x3'));var rp=require(_0x8d4a('0x4'));var moment=require('moment');var BPromise=require(_0x8d4a('0x5'));var Mustache=require(_0x8d4a('0x6'));var util=require(_0x8d4a('0x7'));var path=require(_0x8d4a('0x8'));var sox=require(_0x8d4a('0x9'));var csv=require(_0x8d4a('0xa'));var ejs=require(_0x8d4a('0xb'));var fs=require('fs');var fs_extra=require(_0x8d4a('0xc'));var _=require(_0x8d4a('0xd'));var squel=require(_0x8d4a('0xe'));var crypto=require('crypto');var jsforce=require(_0x8d4a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8d4a('0xa'));var querystring=require(_0x8d4a('0x10'));var Papa=require('papaparse');var Redis=require(_0x8d4a('0x11'));var authService=require(_0x8d4a('0x12'));var qs=require(_0x8d4a('0x13'));var as=require(_0x8d4a('0x14'));var hardwareService=require(_0x8d4a('0x15'));var logger=require(_0x8d4a('0x16'))('api');var utils=require(_0x8d4a('0x17'));var config=require(_0x8d4a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5257fd,_0xf189c2){_0xf189c2=_0xf189c2||0xcc;return function(_0x12f799){if(_0x12f799){return _0x5257fd[_0x8d4a('0x19')](_0xf189c2);}return _0x5257fd['status'](_0xf189c2)[_0x8d4a('0x1a')]();};}function respondWithResult(_0x198262,_0x197946){_0x197946=_0x197946||0xc8;return function(_0x29f88f){if(_0x29f88f){return _0x198262[_0x8d4a('0x1b')](_0x197946)[_0x8d4a('0x1c')](_0x29f88f);}};}function respondWithFilteredResult(_0x2719c5,_0x5cbc02){return function(_0x4dbb9e){if(_0x4dbb9e){var _0x1a27f0=typeof _0x5cbc02[_0x8d4a('0x1d')]===_0x8d4a('0x1e')&&typeof _0x5cbc02['limit']===_0x8d4a('0x1e');var _0x12948a=_0x4dbb9e[_0x8d4a('0x1f')];var _0x2c65e8=_0x1a27f0?0x0:_0x5cbc02[_0x8d4a('0x1d')];var _0x4e1705=_0x1a27f0?_0x4dbb9e[_0x8d4a('0x1f')]:_0x5cbc02['offset']+_0x5cbc02[_0x8d4a('0x20')];var _0x45944b;if(_0x4e1705>=_0x12948a){_0x4e1705=_0x12948a;_0x45944b=0xc8;}else{_0x45944b=0xce;}_0x2719c5[_0x8d4a('0x1b')](_0x45944b);return _0x2719c5[_0x8d4a('0x21')](_0x8d4a('0x22'),_0x2c65e8+'-'+_0x4e1705+'/'+_0x12948a)['json'](_0x4dbb9e);}return null;};}function patchUpdates(_0x11840b){return function(_0x25698c){try{jsonpatch[_0x8d4a('0x23')](_0x25698c,_0x11840b,!![]);}catch(_0x5a7f40){return BPromise[_0x8d4a('0x24')](_0x5a7f40);}return _0x25698c[_0x8d4a('0x25')]();};}function saveUpdates(_0x22eb62,_0x19dcb1){return function(_0x426c5c){if(_0x426c5c){return _0x426c5c[_0x8d4a('0x26')](_0x22eb62)[_0x8d4a('0x27')](function(_0x3e73a2){return _0x3e73a2;});}return null;};}function removeEntity(_0x46b4e5,_0x2b90d8){return function(_0x5b2112){if(_0x5b2112){return _0x5b2112[_0x8d4a('0x28')]()[_0x8d4a('0x27')](function(){_0x46b4e5[_0x8d4a('0x1b')](0xcc)[_0x8d4a('0x1a')]();});}};}function handleEntityNotFound(_0x20eb53,_0x28e6d4){return function(_0x1843e4){if(!_0x1843e4){_0x20eb53[_0x8d4a('0x19')](0x194);}return _0x1843e4;};}function handleError(_0x270d59,_0x1f77f1){_0x1f77f1=_0x1f77f1||0x1f4;return function(_0x1306e2){logger['error'](_0x1306e2[_0x8d4a('0x29')]);if(_0x1306e2[_0x8d4a('0x2a')]){delete _0x1306e2[_0x8d4a('0x2a')];}_0x270d59[_0x8d4a('0x1b')](_0x1f77f1)[_0x8d4a('0x2b')](_0x1306e2);};}exports[_0x8d4a('0x2c')]=function(_0x2d3120,_0x5cf39d){var _0x4cd5b9={},_0x2c59d3={},_0x301c5e={'count':0x0,'rows':[]};var _0xea58e3=_[_0x8d4a('0x2d')](db[_0x8d4a('0x2e')][_0x8d4a('0x2f')],function(_0x4eeed5){return{'name':_0x4eeed5[_0x8d4a('0x30')],'type':_0x4eeed5['type'][_0x8d4a('0x31')]};});_0x2c59d3[_0x8d4a('0x32')]=_['map'](_0xea58e3,_0x8d4a('0x2a'));_0x2c59d3[_0x8d4a('0x33')]=_['keys'](_0x2d3120[_0x8d4a('0x33')]);_0x2c59d3[_0x8d4a('0x34')]=_[_0x8d4a('0x35')](_0x2c59d3[_0x8d4a('0x32')],_0x2c59d3[_0x8d4a('0x33')]);_0x4cd5b9[_0x8d4a('0x36')]=_[_0x8d4a('0x35')](_0x2c59d3[_0x8d4a('0x32')],qs[_0x8d4a('0x37')](_0x2d3120[_0x8d4a('0x33')][_0x8d4a('0x37')]));_0x4cd5b9['attributes']=_0x4cd5b9['attributes']['length']?_0x4cd5b9[_0x8d4a('0x36')]:_0x2c59d3[_0x8d4a('0x32')];if(!_0x2d3120['query']['hasOwnProperty'](_0x8d4a('0x38'))){_0x4cd5b9[_0x8d4a('0x20')]=qs['limit'](_0x2d3120[_0x8d4a('0x33')][_0x8d4a('0x20')]);_0x4cd5b9['offset']=qs['offset'](_0x2d3120[_0x8d4a('0x33')][_0x8d4a('0x1d')]);}_0x4cd5b9['order']=qs[_0x8d4a('0x39')](_0x2d3120[_0x8d4a('0x33')]['sort']);_0x4cd5b9[_0x8d4a('0x3a')]=qs[_0x8d4a('0x34')](_[_0x8d4a('0x3b')](_0x2d3120[_0x8d4a('0x33')],_0x2c59d3[_0x8d4a('0x34')]),_0xea58e3);if(_0x2d3120['query'][_0x8d4a('0x3c')]){_0x4cd5b9[_0x8d4a('0x3a')]=_[_0x8d4a('0x3d')](_0x4cd5b9[_0x8d4a('0x3a')],{'$or':_[_0x8d4a('0x2d')](_0xea58e3,function(_0x302937){if(_0x302937[_0x8d4a('0x3e')]!==_0x8d4a('0x3f')){var _0x32f9b4={};_0x32f9b4[_0x302937[_0x8d4a('0x2a')]]={'$like':'%'+_0x2d3120[_0x8d4a('0x33')]['filter']+'%'};return _0x32f9b4;}})});}_0x4cd5b9=_[_0x8d4a('0x3d')]({},_0x4cd5b9,_0x2d3120[_0x8d4a('0x40')]);var _0x2c2b88={'where':_0x4cd5b9[_0x8d4a('0x3a')]};return db[_0x8d4a('0x2e')][_0x8d4a('0x1f')](_0x2c2b88)[_0x8d4a('0x27')](function(_0x113f12){_0x301c5e[_0x8d4a('0x1f')]=_0x113f12;if(_0x2d3120[_0x8d4a('0x33')][_0x8d4a('0x41')]){_0x4cd5b9[_0x8d4a('0x42')]=[{'all':!![]}];}return db[_0x8d4a('0x2e')][_0x8d4a('0x43')](_0x4cd5b9);})[_0x8d4a('0x27')](function(_0x312737){_0x301c5e[_0x8d4a('0x44')]=_0x312737;return _0x301c5e;})[_0x8d4a('0x27')](respondWithFilteredResult(_0x5cf39d,_0x4cd5b9))[_0x8d4a('0x45')](handleError(_0x5cf39d,null));};exports[_0x8d4a('0x46')]=function(_0x1170e8,_0x3507f3){var _0x1ba939={'raw':!![],'where':{'id':_0x1170e8[_0x8d4a('0x47')]['id']}},_0x280bb6={};_0x280bb6[_0x8d4a('0x32')]=_['keys'](db[_0x8d4a('0x2e')][_0x8d4a('0x2f')]);_0x280bb6[_0x8d4a('0x33')]=_[_0x8d4a('0x48')](_0x1170e8['query']);_0x280bb6['filters']=_[_0x8d4a('0x35')](_0x280bb6[_0x8d4a('0x32')],_0x280bb6[_0x8d4a('0x33')]);_0x1ba939[_0x8d4a('0x36')]=_[_0x8d4a('0x35')](_0x280bb6[_0x8d4a('0x32')],qs['fields'](_0x1170e8['query']['fields']));_0x1ba939[_0x8d4a('0x36')]=_0x1ba939[_0x8d4a('0x36')][_0x8d4a('0x49')]?_0x1ba939[_0x8d4a('0x36')]:_0x280bb6[_0x8d4a('0x32')];if(_0x1170e8[_0x8d4a('0x33')][_0x8d4a('0x41')]){_0x1ba939['include']=[{'all':!![]}];}_0x1ba939=_[_0x8d4a('0x3d')]({},_0x1ba939,_0x1170e8[_0x8d4a('0x40')]);return db[_0x8d4a('0x2e')][_0x8d4a('0x4a')](_0x1ba939)[_0x8d4a('0x27')](handleEntityNotFound(_0x3507f3,null))['then'](respondWithResult(_0x3507f3,null))[_0x8d4a('0x45')](handleError(_0x3507f3,null));};exports[_0x8d4a('0x4b')]=function(_0x188108,_0x520fe7){return db[_0x8d4a('0x2e')][_0x8d4a('0x4b')](_0x188108[_0x8d4a('0x4c')],{})[_0x8d4a('0x27')](respondWithResult(_0x520fe7,0xc9))[_0x8d4a('0x45')](handleError(_0x520fe7,null));};exports['update']=function(_0x314864,_0x4a0ffa){if(_0x314864[_0x8d4a('0x4c')]['id']){delete _0x314864[_0x8d4a('0x4c')]['id'];}return db[_0x8d4a('0x2e')]['find']({'where':{'id':_0x314864[_0x8d4a('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a0ffa,null))[_0x8d4a('0x27')](saveUpdates(_0x314864['body'],null))[_0x8d4a('0x27')](respondWithResult(_0x4a0ffa,null))[_0x8d4a('0x45')](handleError(_0x4a0ffa,null));};exports['destroy']=function(_0x267dc7,_0x3060b5){return db[_0x8d4a('0x2e')]['find']({'where':{'id':_0x267dc7[_0x8d4a('0x47')]['id']}})[_0x8d4a('0x27')](handleEntityNotFound(_0x3060b5,null))['then'](removeEntity(_0x3060b5,null))['catch'](handleError(_0x3060b5,null));}; \ No newline at end of file +var _0x2414=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','VtigerField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','options','find','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x2fec7f,_0x4c8a85){var _0x489a95=function(_0x2b3afe){while(--_0x2b3afe){_0x2fec7f['push'](_0x2fec7f['shift']());}};_0x489a95(++_0x4c8a85);}(_0x2414,0x1b5));var _0x4241=function(_0x714d5c,_0x1c2f50){_0x714d5c=_0x714d5c-0x0;var _0x1a26f9=_0x2414[_0x714d5c];return _0x1a26f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4241('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4241('0x1'));var rp=require(_0x4241('0x2'));var moment=require(_0x4241('0x3'));var BPromise=require(_0x4241('0x4'));var Mustache=require('mustache');var util=require(_0x4241('0x5'));var path=require(_0x4241('0x6'));var sox=require(_0x4241('0x7'));var csv=require(_0x4241('0x8'));var ejs=require(_0x4241('0x9'));var fs=require('fs');var fs_extra=require(_0x4241('0xa'));var _=require(_0x4241('0xb'));var squel=require(_0x4241('0xc'));var crypto=require('crypto');var jsforce=require(_0x4241('0xd'));var deskjs=require(_0x4241('0xe'));var toCsv=require(_0x4241('0x8'));var querystring=require(_0x4241('0xf'));var Papa=require(_0x4241('0x10'));var Redis=require('ioredis');var authService=require(_0x4241('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4241('0x12'))(_0x4241('0x13'));var utils=require(_0x4241('0x14'));var config=require(_0x4241('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4241('0x16'))['db'];function respondWithStatusCode(_0x5f1c07,_0x3d1717){_0x3d1717=_0x3d1717||0xcc;return function(_0x4e760d){if(_0x4e760d){return _0x5f1c07[_0x4241('0x17')](_0x3d1717);}return _0x5f1c07['status'](_0x3d1717)['end']();};}function respondWithResult(_0x2e54f6,_0x153533){_0x153533=_0x153533||0xc8;return function(_0x56f538){if(_0x56f538){return _0x2e54f6[_0x4241('0x18')](_0x153533)[_0x4241('0x19')](_0x56f538);}};}function respondWithFilteredResult(_0x31608f,_0x360404){return function(_0x41d9de){if(_0x41d9de){var _0x4ac6c6=typeof _0x360404['offset']===_0x4241('0x1a')&&typeof _0x360404[_0x4241('0x1b')]===_0x4241('0x1a');var _0x4aeb55=_0x41d9de[_0x4241('0x1c')];var _0x5d0159=_0x4ac6c6?0x0:_0x360404[_0x4241('0x1d')];var _0x2220dc=_0x4ac6c6?_0x41d9de[_0x4241('0x1c')]:_0x360404[_0x4241('0x1d')]+_0x360404[_0x4241('0x1b')];var _0x573ad8;if(_0x2220dc>=_0x4aeb55){_0x2220dc=_0x4aeb55;_0x573ad8=0xc8;}else{_0x573ad8=0xce;}_0x31608f['status'](_0x573ad8);return _0x31608f['set'](_0x4241('0x1e'),_0x5d0159+'-'+_0x2220dc+'/'+_0x4aeb55)[_0x4241('0x19')](_0x41d9de);}return null;};}function patchUpdates(_0x221439){return function(_0x35a159){try{jsonpatch[_0x4241('0x1f')](_0x35a159,_0x221439,!![]);}catch(_0x160b7c){return BPromise[_0x4241('0x20')](_0x160b7c);}return _0x35a159['save']();};}function saveUpdates(_0x35b403,_0x410c41){return function(_0x1cb93c){if(_0x1cb93c){return _0x1cb93c[_0x4241('0x21')](_0x35b403)[_0x4241('0x22')](function(_0x1daa60){return _0x1daa60;});}return null;};}function removeEntity(_0x31da2b,_0x481920){return function(_0x1c1760){if(_0x1c1760){return _0x1c1760[_0x4241('0x23')]()[_0x4241('0x22')](function(){_0x31da2b['status'](0xcc)[_0x4241('0x24')]();});}};}function handleEntityNotFound(_0x23e6fc,_0x3a63d7){return function(_0x303367){if(!_0x303367){_0x23e6fc['sendStatus'](0x194);}return _0x303367;};}function handleError(_0x1b61fd,_0x40104f){_0x40104f=_0x40104f||0x1f4;return function(_0x16e0bb){logger[_0x4241('0x25')](_0x16e0bb[_0x4241('0x26')]);if(_0x16e0bb[_0x4241('0x27')]){delete _0x16e0bb['name'];}_0x1b61fd[_0x4241('0x18')](_0x40104f)[_0x4241('0x28')](_0x16e0bb);};}exports[_0x4241('0x29')]=function(_0x50ab6a,_0x3b6404){var _0x26cace={},_0x1e773c={},_0x9c077f={'count':0x0,'rows':[]};var _0x1c884e=_[_0x4241('0x2a')](db[_0x4241('0x2b')]['rawAttributes'],function(_0x48f24d){return{'name':_0x48f24d[_0x4241('0x2c')],'type':_0x48f24d[_0x4241('0x2d')][_0x4241('0x2e')]};});_0x1e773c[_0x4241('0x2f')]=_['map'](_0x1c884e,'name');_0x1e773c[_0x4241('0x30')]=_[_0x4241('0x31')](_0x50ab6a[_0x4241('0x30')]);_0x1e773c[_0x4241('0x32')]=_[_0x4241('0x33')](_0x1e773c[_0x4241('0x2f')],_0x1e773c['query']);_0x26cace['attributes']=_['intersection'](_0x1e773c[_0x4241('0x2f')],qs[_0x4241('0x34')](_0x50ab6a[_0x4241('0x30')]['fields']));_0x26cace[_0x4241('0x35')]=_0x26cace['attributes'][_0x4241('0x36')]?_0x26cace[_0x4241('0x35')]:_0x1e773c[_0x4241('0x2f')];if(!_0x50ab6a[_0x4241('0x30')][_0x4241('0x37')]('nolimit')){_0x26cace['limit']=qs[_0x4241('0x1b')](_0x50ab6a[_0x4241('0x30')][_0x4241('0x1b')]);_0x26cace[_0x4241('0x1d')]=qs[_0x4241('0x1d')](_0x50ab6a['query'][_0x4241('0x1d')]);}_0x26cace[_0x4241('0x38')]=qs[_0x4241('0x39')](_0x50ab6a[_0x4241('0x30')]['sort']);_0x26cace['where']=qs[_0x4241('0x32')](_[_0x4241('0x3a')](_0x50ab6a[_0x4241('0x30')],_0x1e773c[_0x4241('0x32')]),_0x1c884e);if(_0x50ab6a[_0x4241('0x30')]['filter']){_0x26cace[_0x4241('0x3b')]=_[_0x4241('0x3c')](_0x26cace[_0x4241('0x3b')],{'$or':_['map'](_0x1c884e,function(_0x1fc1d2){if(_0x1fc1d2['type']!==_0x4241('0x3d')){var _0x52c8c5={};_0x52c8c5[_0x1fc1d2[_0x4241('0x27')]]={'$like':'%'+_0x50ab6a['query'][_0x4241('0x3e')]+'%'};return _0x52c8c5;}})});}_0x26cace=_[_0x4241('0x3c')]({},_0x26cace,_0x50ab6a['options']);var _0x4eb7a3={'where':_0x26cace[_0x4241('0x3b')]};return db[_0x4241('0x2b')]['count'](_0x4eb7a3)[_0x4241('0x22')](function(_0x25bb88){_0x9c077f['count']=_0x25bb88;if(_0x50ab6a[_0x4241('0x30')][_0x4241('0x3f')]){_0x26cace[_0x4241('0x40')]=[{'all':!![]}];}return db[_0x4241('0x2b')]['findAll'](_0x26cace);})[_0x4241('0x22')](function(_0x1f4a08){_0x9c077f[_0x4241('0x41')]=_0x1f4a08;return _0x9c077f;})['then'](respondWithFilteredResult(_0x3b6404,_0x26cace))[_0x4241('0x42')](handleError(_0x3b6404,null));};exports[_0x4241('0x43')]=function(_0x4db60a,_0x1f7e9b){var _0x3c23d8={'raw':!![],'where':{'id':_0x4db60a['params']['id']}},_0x4dece2={};_0x4dece2['model']=_[_0x4241('0x31')](db[_0x4241('0x2b')][_0x4241('0x44')]);_0x4dece2[_0x4241('0x30')]=_[_0x4241('0x31')](_0x4db60a[_0x4241('0x30')]);_0x4dece2[_0x4241('0x32')]=_[_0x4241('0x33')](_0x4dece2[_0x4241('0x2f')],_0x4dece2[_0x4241('0x30')]);_0x3c23d8[_0x4241('0x35')]=_[_0x4241('0x33')](_0x4dece2[_0x4241('0x2f')],qs[_0x4241('0x34')](_0x4db60a[_0x4241('0x30')][_0x4241('0x34')]));_0x3c23d8[_0x4241('0x35')]=_0x3c23d8[_0x4241('0x35')][_0x4241('0x36')]?_0x3c23d8['attributes']:_0x4dece2[_0x4241('0x2f')];if(_0x4db60a['query'][_0x4241('0x3f')]){_0x3c23d8['include']=[{'all':!![]}];}_0x3c23d8=_['merge']({},_0x3c23d8,_0x4db60a[_0x4241('0x45')]);return db['VtigerField'][_0x4241('0x46')](_0x3c23d8)[_0x4241('0x22')](handleEntityNotFound(_0x1f7e9b,null))[_0x4241('0x22')](respondWithResult(_0x1f7e9b,null))[_0x4241('0x42')](handleError(_0x1f7e9b,null));};exports['create']=function(_0x5828ea,_0x3411bf){return db[_0x4241('0x2b')][_0x4241('0x47')](_0x5828ea['body'],{})['then'](respondWithResult(_0x3411bf,0xc9))['catch'](handleError(_0x3411bf,null));};exports[_0x4241('0x21')]=function(_0x369591,_0x181716){if(_0x369591[_0x4241('0x48')]['id']){delete _0x369591[_0x4241('0x48')]['id'];}return db['VtigerField'][_0x4241('0x46')]({'where':{'id':_0x369591[_0x4241('0x49')]['id']}})[_0x4241('0x22')](handleEntityNotFound(_0x181716,null))[_0x4241('0x22')](saveUpdates(_0x369591['body'],null))[_0x4241('0x22')](respondWithResult(_0x181716,null))[_0x4241('0x42')](handleError(_0x181716,null));};exports[_0x4241('0x23')]=function(_0x59c48e,_0x2b1e30){return db[_0x4241('0x2b')]['find']({'where':{'id':_0x59c48e[_0x4241('0x49')]['id']}})[_0x4241('0x22')](handleEntityNotFound(_0x2b1e30,null))[_0x4241('0x22')](removeEntity(_0x2b1e30,null))[_0x4241('0x42')](handleError(_0x2b1e30,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 0fb67d4..a5b17d8 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed27=['moment','path','rimraf','../../config/environment','exports','define','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x3811f3,_0x1040b3){var _0xeb0205=function(_0x459883){while(--_0x459883){_0x3811f3['push'](_0x3811f3['shift']());}};_0xeb0205(++_0x1040b3);}(_0xed27,0x127));var _0x7ed2=function(_0x232781,_0xdb14aa){_0x232781=_0x232781-0x0;var _0x47c183=_0xed27[_0x232781];return _0x47c183;};'use strict';var _=require(_0x7ed2('0x0'));var util=require(_0x7ed2('0x1'));var logger=require(_0x7ed2('0x2'))(_0x7ed2('0x3'));var moment=require(_0x7ed2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ed2('0x5'));var rimraf=require(_0x7ed2('0x6'));var config=require(_0x7ed2('0x7'));var attributes=require('./intVtigerField.attributes');module[_0x7ed2('0x8')]=function(_0x544d07,_0x95a3f4){return _0x544d07[_0x7ed2('0x9')]('VtigerField',attributes,{'tableName':_0x7ed2('0xa'),'paranoid':![],'indexes':[{'name':_0x7ed2('0xb'),'fields':[_0x7ed2('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b9f=['lodash','util','api','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0b9f,0xb6));var _0xf0b9=function(_0x4c4c9f,_0x3f5603){_0x4c4c9f=_0x4c4c9f-0x0;var _0x578758=_0x0b9f[_0x4c4c9f];return _0x578758;};'use strict';var _=require(_0xf0b9('0x0'));var util=require(_0xf0b9('0x1'));var logger=require('../../config/logger')(_0xf0b9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0b9('0x3'));var rimraf=require(_0xf0b9('0x4'));var config=require(_0xf0b9('0x5'));var attributes=require(_0xf0b9('0x6'));module[_0xf0b9('0x7')]=function(_0x13f603,_0x2398f7){return _0x13f603[_0xf0b9('0x8')](_0xf0b9('0x9'),attributes,{'tableName':_0xf0b9('0xa'),'paranoid':![],'indexes':[{'name':_0xf0b9('0xb'),'fields':[_0xf0b9('0xc'),_0xf0b9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index cc43e66..e35f703 100644 --- a/server/api/intVtigerField/intVtigerField.rpc.js +++ b/server/api/intVtigerField/intVtigerField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x165c=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x52cea4,_0x294d15){var _0x177821=function(_0x11e1ec){while(--_0x11e1ec){_0x52cea4['push'](_0x52cea4['shift']());}};_0x177821(++_0x294d15);}(_0x165c,0x1f0));var _0xc165=function(_0x4f22e8,_0x2f9f54){_0x4f22e8=_0x4f22e8-0x0;var _0x2d54d6=_0x165c[_0x4f22e8];return _0x2d54d6;};'use strict';var _=require(_0xc165('0x0'));var util=require('util');var moment=require(_0xc165('0x1'));var BPromise=require(_0xc165('0x2'));var rs=require(_0xc165('0x3'));var fs=require('fs');var Redis=require(_0xc165('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc165('0x5'));var logger=require('../../config/logger')(_0xc165('0x6'));var config=require(_0xc165('0x7'));var jayson=require(_0xc165('0x8'));var client=jayson['client'][_0xc165('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x111c83,_0xb1f41d,_0x1237e4){return new BPromise(function(_0x5488aa,_0x249985){return client['request'](_0x111c83,_0x1237e4)[_0xc165('0xa')](function(_0x1e9780){logger[_0xc165('0xb')](_0xc165('0xc'),_0xb1f41d,_0xc165('0xd'));logger[_0xc165('0xe')](_0xc165('0xf'),_0xb1f41d,_0xc165('0xd'),JSON[_0xc165('0x10')](_0x1e9780));if(_0x1e9780[_0xc165('0x11')]){if(_0x1e9780[_0xc165('0x11')]['code']===0x1f4){logger[_0xc165('0x11')](_0xc165('0xc'),_0xb1f41d,_0x1e9780[_0xc165('0x11')][_0xc165('0x12')]);return _0x249985(_0x1e9780[_0xc165('0x11')][_0xc165('0x12')]);}logger['error'](_0xc165('0xc'),_0xb1f41d,_0x1e9780['error'][_0xc165('0x12')]);return _0x5488aa(_0x1e9780['error']['message']);}else{logger[_0xc165('0xb')](_0xc165('0xc'),_0xb1f41d,_0xc165('0xd'));_0x5488aa(_0x1e9780['result']['message']);}})[_0xc165('0x13')](function(_0x28353c){logger[_0xc165('0x11')]('VtigerField,\x20%s,\x20%s',_0xb1f41d,_0x28353c);_0x249985(_0x28353c);});});} \ No newline at end of file +var _0x01dc=['http','then','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../config/environment','jayson/promise'];(function(_0x362ee2,_0x106f5c){var _0x371ad7=function(_0x6b20eb){while(--_0x6b20eb){_0x362ee2['push'](_0x362ee2['shift']());}};_0x371ad7(++_0x106f5c);}(_0x01dc,0xf7));var _0xc01d=function(_0x1c8a44,_0x1206ab){_0x1c8a44=_0x1c8a44-0x0;var _0x2658bd=_0x01dc[_0x1c8a44];return _0x2658bd;};'use strict';var _=require(_0xc01d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc01d('0x1'));var rs=require(_0xc01d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc01d('0x3'));var jayson=require(_0xc01d('0x4'));var client=jayson['client'][_0xc01d('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x239c37,_0x51e57b,_0x1c04ba){return new BPromise(function(_0x142c58,_0x41b4f8){return client['request'](_0x239c37,_0x1c04ba)[_0xc01d('0x6')](function(_0x125919){logger['info']('VtigerField,\x20%s,\x20%s',_0x51e57b,_0xc01d('0x7'));logger['debug'](_0xc01d('0x8'),_0x51e57b,'request\x20sent',JSON['stringify'](_0x125919));if(_0x125919[_0xc01d('0x9')]){if(_0x125919['error']['code']===0x1f4){logger[_0xc01d('0x9')](_0xc01d('0xa'),_0x51e57b,_0x125919['error'][_0xc01d('0xb')]);return _0x41b4f8(_0x125919[_0xc01d('0x9')]['message']);}logger['error']('VtigerField,\x20%s,\x20%s',_0x51e57b,_0x125919[_0xc01d('0x9')][_0xc01d('0xb')]);return _0x142c58(_0x125919[_0xc01d('0x9')][_0xc01d('0xb')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x51e57b,'request\x20sent');_0x142c58(_0x125919[_0xc01d('0xc')][_0xc01d('0xb')]);}})[_0xc01d('0xd')](function(_0x5b6620){logger['error'](_0xc01d('0xa'),_0x51e57b,_0x5b6620);_0x41b4f8(_0x5b6620);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 7954c52..426f7ca 100644 --- a/server/api/intZendeskAccount/index.js +++ b/server/api/intZendeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3713=['get','isAuthenticated','show','/:id/configurations','getConfigurations','post','create','addConfiguration','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','index'];(function(_0x207ebd,_0x6b6036){var _0x29f563=function(_0x5a7a45){while(--_0x5a7a45){_0x207ebd['push'](_0x207ebd['shift']());}};_0x29f563(++_0x6b6036);}(_0x3713,0x64));var _0x3371=function(_0x286386,_0x1293a2){_0x286386=_0x286386-0x0;var _0x1d7821=_0x3713[_0x286386];return _0x1d7821;};'use strict';var multer=require(_0x3371('0x0'));var util=require('util');var path=require(_0x3371('0x1'));var timeout=require(_0x3371('0x2'));var express=require(_0x3371('0x3'));var router=express[_0x3371('0x4')]();var fs_extra=require(_0x3371('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3371('0x6'));var config=require(_0x3371('0x7'));var controller=require(_0x3371('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3371('0x9')]);router[_0x3371('0xa')]('/:id',auth[_0x3371('0xb')](),controller[_0x3371('0xc')]);router[_0x3371('0xa')](_0x3371('0xd'),auth[_0x3371('0xb')](),controller[_0x3371('0xe')]);router[_0x3371('0xa')]('/:id/fields',auth[_0x3371('0xb')](),controller['getFields']);router[_0x3371('0xf')]('/',auth['isAuthenticated'](),controller[_0x3371('0x10')]);router[_0x3371('0xf')](_0x3371('0xd'),auth[_0x3371('0xb')](),controller[_0x3371('0x11')]);router['put'](_0x3371('0x12'),auth[_0x3371('0xb')](),controller[_0x3371('0x13')]);router[_0x3371('0x14')](_0x3371('0x12'),auth[_0x3371('0xb')](),controller[_0x3371('0x15')]);module['exports']=router; \ No newline at end of file +var _0x2738=['get','isAuthenticated','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0x1cb5dc,_0x517ece){var _0x42d964=function(_0x43fca3){while(--_0x43fca3){_0x1cb5dc['push'](_0x1cb5dc['shift']());}};_0x42d964(++_0x517ece);}(_0x2738,0x1db));var _0x8273=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x2738[_0x1da527];return _0x40fc7c;};'use strict';var multer=require(_0x8273('0x0'));var util=require(_0x8273('0x1'));var path=require('path');var timeout=require(_0x8273('0x2'));var express=require('express');var router=express[_0x8273('0x3')]();var fs_extra=require(_0x8273('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8273('0x5'));var config=require(_0x8273('0x6'));var controller=require(_0x8273('0x7'));router[_0x8273('0x8')]('/',auth[_0x8273('0x9')](),controller['index']);router[_0x8273('0x8')](_0x8273('0xa'),auth[_0x8273('0x9')](),controller[_0x8273('0xb')]);router[_0x8273('0x8')]('/:id/configurations',auth[_0x8273('0x9')](),controller[_0x8273('0xc')]);router['get']('/:id/fields',auth[_0x8273('0x9')](),controller[_0x8273('0xd')]);router[_0x8273('0xe')]('/',auth[_0x8273('0x9')](),controller[_0x8273('0xf')]);router[_0x8273('0xe')](_0x8273('0x10'),auth[_0x8273('0x9')](),controller[_0x8273('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8273('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8273('0x13')]);module[_0x8273('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 0d3283b..b9ef308 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js +++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf61e=['remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x17e771,_0x55fd17){var _0x1f3a6d=function(_0x346ee3){while(--_0x346ee3){_0x17e771['push'](_0x17e771['shift']());}};_0x1f3a6d(++_0x55fd17);}(_0xf61e,0x191));var _0xef61=function(_0x310134,_0x5af593){_0x310134=_0x310134-0x0;var _0x128049=_0xf61e[_0x310134];return _0x128049;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'name':{'type':Sequelize[_0xef61('0x2')]},'description':{'type':Sequelize[_0xef61('0x2')]},'username':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x3')},'password':{'type':Sequelize[_0xef61('0x2')]},'token':{'type':Sequelize[_0xef61('0x2')]},'remoteUri':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x4')},'authType':{'type':Sequelize[_0xef61('0x5')](_0xef61('0x6'),'token'),'defaultValue':_0xef61('0x6')},'serverUrl':{'type':Sequelize[_0xef61('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xef61('0x7'),_0xef61('0x8')),'defaultValue':_0xef61('0x7')}}; \ No newline at end of file +var _0xd991=['remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x49d1b9,_0x31f251){var _0x275259=function(_0x3577a8){while(--_0x3577a8){_0x49d1b9['push'](_0x49d1b9['shift']());}};_0x275259(++_0x31f251);}(_0xd991,0x115));var _0x1d99=function(_0x37d5a5,_0x3db8c6){_0x37d5a5=_0x37d5a5-0x0;var _0x3c58b3=_0xd991[_0x37d5a5];return _0x3c58b3;};'use strict';var Sequelize=require(_0x1d99('0x0'));module[_0x1d99('0x1')]={'name':{'type':Sequelize[_0x1d99('0x2')]},'description':{'type':Sequelize[_0x1d99('0x2')]},'username':{'type':Sequelize[_0x1d99('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x1d99('0x2')]},'token':{'type':Sequelize[_0x1d99('0x2')]},'remoteUri':{'type':Sequelize[_0x1d99('0x2')],'unique':_0x1d99('0x3')},'authType':{'type':Sequelize[_0x1d99('0x4')](_0x1d99('0x5'),'token'),'defaultValue':_0x1d99('0x5')},'serverUrl':{'type':Sequelize[_0x1d99('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1d99('0x6'),_0x1d99('0x7')),'defaultValue':_0x1d99('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 046b0a2..a29639f 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc900=['query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','intersection','includeAll','find','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','password','token','authType','remoteUri','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','toString','base64','ValidationError','Unknown\x20authentication\x20type','subject','group','remove','includes','title','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZendeskAccount','fieldName','type','model'];(function(_0x5235a7,_0x3a065b){var _0x463bbf=function(_0x5934bc){while(--_0x5934bc){_0x5235a7['push'](_0x5235a7['shift']());}};_0x463bbf(++_0x3a065b);}(_0xc900,0xb3));var _0x0c90=function(_0x6d672a,_0x5eed97){_0x6d672a=_0x6d672a-0x0;var _0x178494=_0xc900[_0x6d672a];return _0x178494;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x459cdb,_0x26fc46){_0x26fc46=_0x26fc46||0xcc;return function(_0x4535a2){if(_0x4535a2){return _0x459cdb[_0x0c90('0x19')](_0x26fc46);}return _0x459cdb[_0x0c90('0x1a')](_0x26fc46)['end']();};}function respondWithResult(_0x467b32,_0x4451e0){_0x4451e0=_0x4451e0||0xc8;return function(_0x4f35f4){if(_0x4f35f4){return _0x467b32[_0x0c90('0x1a')](_0x4451e0)[_0x0c90('0x1b')](_0x4f35f4);}};}function respondWithFilteredResult(_0x3bd5e8,_0x5bef7d){return function(_0x5daeb7){if(_0x5daeb7){var _0x412635=typeof _0x5bef7d[_0x0c90('0x1c')]===_0x0c90('0x1d')&&typeof _0x5bef7d[_0x0c90('0x1e')]===_0x0c90('0x1d');var _0x2cab22=_0x5daeb7[_0x0c90('0x1f')];var _0x57b9a6=_0x412635?0x0:_0x5bef7d[_0x0c90('0x1c')];var _0x38becc=_0x412635?_0x5daeb7[_0x0c90('0x1f')]:_0x5bef7d[_0x0c90('0x1c')]+_0x5bef7d['limit'];var _0x10a775;if(_0x38becc>=_0x2cab22){_0x38becc=_0x2cab22;_0x10a775=0xc8;}else{_0x10a775=0xce;}_0x3bd5e8[_0x0c90('0x1a')](_0x10a775);return _0x3bd5e8[_0x0c90('0x20')](_0x0c90('0x21'),_0x57b9a6+'-'+_0x38becc+'/'+_0x2cab22)[_0x0c90('0x1b')](_0x5daeb7);}return null;};}function patchUpdates(_0xc08f54){return function(_0x4cc940){try{jsonpatch[_0x0c90('0x22')](_0x4cc940,_0xc08f54,!![]);}catch(_0x4d629f){return BPromise[_0x0c90('0x23')](_0x4d629f);}return _0x4cc940[_0x0c90('0x24')]();};}function saveUpdates(_0x47b13c,_0x2a053a){return function(_0x43ddc3){if(_0x43ddc3){return _0x43ddc3[_0x0c90('0x25')](_0x47b13c)[_0x0c90('0x26')](function(_0x212164){return _0x212164;});}return null;};}function removeEntity(_0x3b287c,_0x4dfbc3){return function(_0x26f0a3){if(_0x26f0a3){return _0x26f0a3[_0x0c90('0x27')]()['then'](function(){_0x3b287c['status'](0xcc)[_0x0c90('0x28')]();});}};}function handleEntityNotFound(_0x3ea861,_0x35c243){return function(_0x109a5f){if(!_0x109a5f){_0x3ea861['sendStatus'](0x194);}return _0x109a5f;};}function handleError(_0x2dfa14,_0x438652){_0x438652=_0x438652||0x1f4;return function(_0xeb7f58){logger[_0x0c90('0x29')](_0xeb7f58[_0x0c90('0x2a')]);if(_0xeb7f58[_0x0c90('0x2b')]){delete _0xeb7f58['name'];}_0x2dfa14[_0x0c90('0x1a')](_0x438652)[_0x0c90('0x2c')](_0xeb7f58);};}exports[_0x0c90('0x2d')]=function(_0x13b377,_0x52d28d){var _0x4c8603={},_0x1f27f1={},_0x25da6e={'count':0x0,'rows':[]};var _0x3bff04=_[_0x0c90('0x2e')](db[_0x0c90('0x2f')]['rawAttributes'],function(_0x120136){return{'name':_0x120136[_0x0c90('0x30')],'type':_0x120136[_0x0c90('0x31')]['key']};});_0x1f27f1[_0x0c90('0x32')]=_['map'](_0x3bff04,'name');_0x1f27f1[_0x0c90('0x33')]=_[_0x0c90('0x34')](_0x13b377[_0x0c90('0x33')]);_0x1f27f1[_0x0c90('0x35')]=_['intersection'](_0x1f27f1[_0x0c90('0x32')],_0x1f27f1['query']);_0x4c8603[_0x0c90('0x36')]=_['intersection'](_0x1f27f1[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x13b377['query'][_0x0c90('0x37')]));_0x4c8603[_0x0c90('0x36')]=_0x4c8603[_0x0c90('0x36')][_0x0c90('0x38')]?_0x4c8603[_0x0c90('0x36')]:_0x1f27f1[_0x0c90('0x32')];if(!_0x13b377[_0x0c90('0x33')][_0x0c90('0x39')]('nolimit')){_0x4c8603[_0x0c90('0x1e')]=qs[_0x0c90('0x1e')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x1e')]);_0x4c8603['offset']=qs[_0x0c90('0x1c')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x1c')]);}_0x4c8603[_0x0c90('0x3a')]=qs[_0x0c90('0x3b')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x3b')]);_0x4c8603[_0x0c90('0x3c')]=qs['filters'](_[_0x0c90('0x3d')](_0x13b377[_0x0c90('0x33')],_0x1f27f1['filters']),_0x3bff04);if(_0x13b377[_0x0c90('0x33')][_0x0c90('0x3e')]){_0x4c8603[_0x0c90('0x3c')]=_[_0x0c90('0x3f')](_0x4c8603[_0x0c90('0x3c')],{'$or':_['map'](_0x3bff04,function(_0x2f1d95){if(_0x2f1d95[_0x0c90('0x31')]!==_0x0c90('0x40')){var _0x2bca69={};_0x2bca69[_0x2f1d95[_0x0c90('0x2b')]]={'$like':'%'+_0x13b377[_0x0c90('0x33')][_0x0c90('0x3e')]+'%'};return _0x2bca69;}})});}_0x4c8603=_[_0x0c90('0x3f')]({},_0x4c8603,_0x13b377[_0x0c90('0x41')]);var _0x4f0227={'where':_0x4c8603[_0x0c90('0x3c')]};return db['ZendeskAccount'][_0x0c90('0x1f')](_0x4f0227)['then'](function(_0xb126ef){_0x25da6e[_0x0c90('0x1f')]=_0xb126ef;if(_0x13b377['query']['includeAll']){_0x4c8603[_0x0c90('0x42')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x0c90('0x43')](_0x4c8603);})[_0x0c90('0x26')](function(_0x373f9f){_0x25da6e['rows']=_0x373f9f;return _0x25da6e;})[_0x0c90('0x26')](respondWithFilteredResult(_0x52d28d,_0x4c8603))[_0x0c90('0x44')](handleError(_0x52d28d,null));};exports[_0x0c90('0x45')]=function(_0x3e5137,_0x2139c3){var _0x1184c4={'raw':![],'where':{'id':_0x3e5137[_0x0c90('0x46')]['id']}},_0x565b10={};_0x565b10[_0x0c90('0x32')]=_[_0x0c90('0x34')](db[_0x0c90('0x2f')][_0x0c90('0x47')]);_0x565b10[_0x0c90('0x33')]=_[_0x0c90('0x34')](_0x3e5137['query']);_0x565b10[_0x0c90('0x35')]=_['intersection'](_0x565b10[_0x0c90('0x32')],_0x565b10[_0x0c90('0x33')]);_0x1184c4[_0x0c90('0x36')]=_[_0x0c90('0x48')](_0x565b10[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x3e5137[_0x0c90('0x33')][_0x0c90('0x37')]));_0x1184c4[_0x0c90('0x36')]=_0x1184c4[_0x0c90('0x36')][_0x0c90('0x38')]?_0x1184c4[_0x0c90('0x36')]:_0x565b10[_0x0c90('0x32')];if(_0x3e5137[_0x0c90('0x33')][_0x0c90('0x49')]){_0x1184c4['include']=[{'all':!![]}];}_0x1184c4=_[_0x0c90('0x3f')]({},_0x1184c4,_0x3e5137[_0x0c90('0x41')]);return db[_0x0c90('0x2f')][_0x0c90('0x4a')](_0x1184c4)[_0x0c90('0x26')](handleEntityNotFound(_0x2139c3,null))[_0x0c90('0x26')](respondWithResult(_0x2139c3,null))[_0x0c90('0x44')](handleError(_0x2139c3,null));};exports[_0x0c90('0x4b')]=function(_0x3bb138,_0x3af64f){return db[_0x0c90('0x2f')][_0x0c90('0x4b')](_0x3bb138[_0x0c90('0x4c')],{})[_0x0c90('0x26')](respondWithResult(_0x3af64f,0xc9))['catch'](handleError(_0x3af64f,null));};exports[_0x0c90('0x25')]=function(_0x38f492,_0x553fea){if(_0x38f492['body']['id']){delete _0x38f492['body']['id'];}return db[_0x0c90('0x2f')][_0x0c90('0x4a')]({'where':{'id':_0x38f492[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x553fea,null))[_0x0c90('0x26')](saveUpdates(_0x38f492['body'],null))[_0x0c90('0x26')](respondWithResult(_0x553fea,null))[_0x0c90('0x44')](handleError(_0x553fea,null));};exports[_0x0c90('0x27')]=function(_0x549c78,_0x119776){return db[_0x0c90('0x2f')][_0x0c90('0x4a')]({'where':{'id':_0x549c78[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x119776,null))[_0x0c90('0x26')](removeEntity(_0x119776,null))[_0x0c90('0x44')](handleError(_0x119776,null));};exports[_0x0c90('0x4d')]=function(_0x1daeed,_0xeeee3b,_0x5e288e){var _0xac80b2={};var _0x4ba9e7={};var _0xda4331;var _0x67539d;return db[_0x0c90('0x2f')][_0x0c90('0x4e')]({'where':{'id':_0x1daeed[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0xeeee3b,null))['then'](function(_0x4930fc){if(_0x4930fc){_0xda4331=_0x4930fc;_0x4ba9e7['model']=_['keys'](db[_0x0c90('0x4f')][_0x0c90('0x47')]);_0x4ba9e7[_0x0c90('0x33')]=_['keys'](_0x1daeed[_0x0c90('0x33')]);_0x4ba9e7[_0x0c90('0x35')]=_['intersection'](_0x4ba9e7[_0x0c90('0x32')],_0x4ba9e7['query']);_0xac80b2[_0x0c90('0x36')]=_[_0x0c90('0x48')](_0x4ba9e7[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x1daeed['query'][_0x0c90('0x37')]));_0xac80b2['attributes']=_0xac80b2[_0x0c90('0x36')][_0x0c90('0x38')]?_0xac80b2['attributes']:_0x4ba9e7['model'];_0xac80b2['order']=qs[_0x0c90('0x3b')](_0x1daeed[_0x0c90('0x33')][_0x0c90('0x3b')]);_0xac80b2[_0x0c90('0x3c')]=qs[_0x0c90('0x35')](_['pick'](_0x1daeed[_0x0c90('0x33')],_0x4ba9e7[_0x0c90('0x35')]));if(_0x1daeed['query'][_0x0c90('0x3e')]){_0xac80b2['where']=_[_0x0c90('0x3f')](_0xac80b2[_0x0c90('0x3c')],{'$or':_['map'](_0xac80b2[_0x0c90('0x36')],function(_0x5baf85){var _0x4de11a={};_0x4de11a[_0x5baf85]={'$like':'%'+_0x1daeed['query'][_0x0c90('0x3e')]+'%'};return _0x4de11a;})});}_0xac80b2=_[_0x0c90('0x3f')]({},_0xac80b2,_0x1daeed[_0x0c90('0x41')]);return _0xda4331[_0x0c90('0x4d')](_0xac80b2);}})['then'](function(_0x5b385b){if(_0x5b385b){_0x67539d=_0x5b385b[_0x0c90('0x38')];if(!_0x1daeed[_0x0c90('0x33')][_0x0c90('0x39')]('nolimit')){_0xac80b2[_0x0c90('0x1e')]=qs[_0x0c90('0x1e')](_0x1daeed[_0x0c90('0x33')]['limit']);_0xac80b2[_0x0c90('0x1c')]=qs[_0x0c90('0x1c')](_0x1daeed[_0x0c90('0x33')]['offset']);}return _0xda4331[_0x0c90('0x4d')](_0xac80b2);}})[_0x0c90('0x26')](function(_0x1a198b){if(_0x1a198b){return _0x1a198b?{'count':_0x67539d,'rows':_0x1a198b}:null;}})[_0x0c90('0x26')](respondWithResult(_0xeeee3b,null))[_0x0c90('0x44')](handleError(_0xeeee3b,null));};exports[_0x0c90('0x50')]=function(_0x19f4ac,_0x143e0d,_0x181fe3){if(_0x19f4ac['body']['id']){delete _0x19f4ac['body']['id'];}return db[_0x0c90('0x2f')][_0x0c90('0x4e')]({'where':{'id':_0x19f4ac[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x143e0d,null))[_0x0c90('0x26')](function(_0x2dad30){if(_0x2dad30){_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x51')]=_0x2dad30['id'];_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x52')]=integrations[_0x0c90('0x53')](_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x54')],_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x31')]);_0x19f4ac['body'][_0x0c90('0x55')]=integrations[_0x0c90('0x56')](_0x19f4ac[_0x0c90('0x4c')]['channel'],_0x19f4ac['body'][_0x0c90('0x31')]);return db['ZendeskConfiguration'][_0x0c90('0x4b')](_0x19f4ac[_0x0c90('0x4c')],{'include':[{'model':db['ZendeskField'],'as':_0x0c90('0x52')},{'model':db[_0x0c90('0x57')],'as':_0x0c90('0x55')}]});}return null;})[_0x0c90('0x26')](respondWithResult(_0x143e0d,null))['catch'](handleError(_0x143e0d,null));};exports['getFields']=function(_0x5f32d6,_0x16b38a,_0x2d3287){var _0x3bc90d='';return db[_0x0c90('0x2f')]['findOne']({'where':{'id':_0x5f32d6[_0x0c90('0x46')]['id']},'attributes':['id','username',_0x0c90('0x58'),_0x0c90('0x59'),_0x0c90('0x5a'),'remoteUri']})[_0x0c90('0x26')](handleEntityNotFound(_0x16b38a,null))[_0x0c90('0x26')](function(_0x2da9f9){if(_0x2da9f9){_0x3bc90d=_0x2da9f9[_0x0c90('0x5b')];var _0x57c3b3=_0x3bc90d['slice'](-0x1);if(_0x57c3b3==='/'){_0x3bc90d=_0x3bc90d[_0x0c90('0x5c')](0x0,_0x3bc90d['lastIndexOf'](_0x57c3b3));}var _0x3254c0={'method':_0x0c90('0x5d'),'uri':util[_0x0c90('0x5e')](_0x0c90('0x5f'),_0x3bc90d,_0x0c90('0x60')),'json':!![]};switch(_0x2da9f9[_0x0c90('0x5a')]){case _0x0c90('0x58'):_0x3254c0[_0x0c90('0x61')]={'Authorization':util[_0x0c90('0x5e')](_0x0c90('0x62'),new Buffer(util['format'](_0x0c90('0x63'),_0x2da9f9[_0x0c90('0x64')],_0x2da9f9[_0x0c90('0x58')]))[_0x0c90('0x65')](_0x0c90('0x66')))};break;case _0x0c90('0x59'):_0x3254c0[_0x0c90('0x61')]={'Authorization':util[_0x0c90('0x5e')](_0x0c90('0x62'),new Buffer(util[_0x0c90('0x5e')]('%s/token:%s',_0x2da9f9[_0x0c90('0x64')],_0x2da9f9[_0x0c90('0x59')]))[_0x0c90('0x65')](_0x0c90('0x66')))};break;default:throw new db['Sequelize'][(_0x0c90('0x67'))](_0x0c90('0x68'));}return rp(_0x3254c0);}})[_0x0c90('0x26')](function(_0x48a32f){if(_0x48a32f){var _0x40866c=[_0x0c90('0x69'),'description',_0x0c90('0x6a'),'assignee'];_[_0x0c90('0x6b')](_0x48a32f['ticket_fields'],function(_0x5633a4){return _0x40866c[_0x0c90('0x6c')](_0x5633a4[_0x0c90('0x31')]);});return{'count':_0x48a32f['ticket_fields']['length'],'rows':_[_0x0c90('0x2e')](_0x48a32f[_0x0c90('0x60')],function(_0x5d80b9){return{'id':_0x5d80b9['id'],'name':_0x5d80b9['position']>0x7?_0x5d80b9[_0x0c90('0x6d')]:_0x5d80b9['type'],'custom':_0x5d80b9[_0x0c90('0x6e')]>0x7?!![]:![],'options':_0x5d80b9[_0x0c90('0x6f')]?_0x5d80b9[_0x0c90('0x6f')]:_0x5d80b9[_0x0c90('0x70')]?_0x5d80b9[_0x0c90('0x70')]:[]};})};}})['then'](respondWithResult(_0x16b38a,null))[_0x0c90('0x44')](function(_0x142268){var _0x3aed3c=_0x5f32d6['query']['test']?0x1f4:_0x142268[_0x0c90('0x71')]||0x1f4;logger[_0x0c90('0x29')](_0x0c90('0x72'),'getFields',_0x3aed3c,JSON['stringify'](_0x142268));delete _0x142268['name'];if(_0x3aed3c===0x191){_0x3aed3c=0x190;}_0x16b38a[_0x0c90('0x1a')](_0x3aed3c)['send'](_0x5f32d6['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x142268[_0x0c90('0x71')]}:_0x142268);});}; \ No newline at end of file +var _0xc788=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','format','authType','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','title','position','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','model','keys'];(function(_0x213fdc,_0x5228fd){var _0x107e7a=function(_0x5b53da){while(--_0x5b53da){_0x213fdc['push'](_0x213fdc['shift']());}};_0x107e7a(++_0x5228fd);}(_0xc788,0xc4));var _0x8c78=function(_0x271697,_0x6897d6){_0x271697=_0x271697-0x0;var _0x426093=_0xc788[_0x271697];return _0x426093;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56a802,_0x349dfa){_0x349dfa=_0x349dfa||0xcc;return function(_0x1b1d0e){if(_0x1b1d0e){return _0x56a802[_0x8c78('0x18')](_0x349dfa);}return _0x56a802[_0x8c78('0x19')](_0x349dfa)[_0x8c78('0x1a')]();};}function respondWithResult(_0x3d1306,_0xe5f8ae){_0xe5f8ae=_0xe5f8ae||0xc8;return function(_0x930233){if(_0x930233){return _0x3d1306[_0x8c78('0x19')](_0xe5f8ae)[_0x8c78('0x1b')](_0x930233);}};}function respondWithFilteredResult(_0x4ff4b0,_0x1fa78e){return function(_0x293cfe){if(_0x293cfe){var _0x57ad11=typeof _0x1fa78e[_0x8c78('0x1c')]===_0x8c78('0x1d')&&typeof _0x1fa78e[_0x8c78('0x1e')]===_0x8c78('0x1d');var _0x2a982c=_0x293cfe[_0x8c78('0x1f')];var _0x54eafa=_0x57ad11?0x0:_0x1fa78e['offset'];var _0x339d04=_0x57ad11?_0x293cfe['count']:_0x1fa78e['offset']+_0x1fa78e[_0x8c78('0x1e')];var _0x56c191;if(_0x339d04>=_0x2a982c){_0x339d04=_0x2a982c;_0x56c191=0xc8;}else{_0x56c191=0xce;}_0x4ff4b0[_0x8c78('0x19')](_0x56c191);return _0x4ff4b0[_0x8c78('0x20')]('Content-Range',_0x54eafa+'-'+_0x339d04+'/'+_0x2a982c)[_0x8c78('0x1b')](_0x293cfe);}return null;};}function patchUpdates(_0x5b111b){return function(_0x2dba52){try{jsonpatch[_0x8c78('0x21')](_0x2dba52,_0x5b111b,!![]);}catch(_0x5a254d){return BPromise[_0x8c78('0x22')](_0x5a254d);}return _0x2dba52[_0x8c78('0x23')]();};}function saveUpdates(_0x499603,_0x2bc595){return function(_0x28ed3a){if(_0x28ed3a){return _0x28ed3a[_0x8c78('0x24')](_0x499603)[_0x8c78('0x25')](function(_0x215940){return _0x215940;});}return null;};}function removeEntity(_0x20f483,_0xbfdf6f){return function(_0x1958f1){if(_0x1958f1){return _0x1958f1[_0x8c78('0x26')]()['then'](function(){_0x20f483[_0x8c78('0x19')](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x1d1cef,_0x49cccb){return function(_0x331bfe){if(!_0x331bfe){_0x1d1cef['sendStatus'](0x194);}return _0x331bfe;};}function handleError(_0xe85d05,_0x24f9a7){_0x24f9a7=_0x24f9a7||0x1f4;return function(_0x8d9ff9){logger['error'](_0x8d9ff9[_0x8c78('0x27')]);if(_0x8d9ff9[_0x8c78('0x28')]){delete _0x8d9ff9['name'];}_0xe85d05[_0x8c78('0x19')](_0x24f9a7)[_0x8c78('0x29')](_0x8d9ff9);};}exports[_0x8c78('0x2a')]=function(_0x36e8e5,_0x253776){var _0x2ab5cc={},_0x5ba7d4={},_0x1c3039={'count':0x0,'rows':[]};var _0x51add6=_[_0x8c78('0x2b')](db[_0x8c78('0x2c')][_0x8c78('0x2d')],function(_0x4e764f){return{'name':_0x4e764f[_0x8c78('0x2e')],'type':_0x4e764f[_0x8c78('0x2f')]['key']};});_0x5ba7d4[_0x8c78('0x30')]=_[_0x8c78('0x2b')](_0x51add6,_0x8c78('0x28'));_0x5ba7d4['query']=_[_0x8c78('0x31')](_0x36e8e5[_0x8c78('0x32')]);_0x5ba7d4[_0x8c78('0x33')]=_['intersection'](_0x5ba7d4[_0x8c78('0x30')],_0x5ba7d4[_0x8c78('0x32')]);_0x2ab5cc['attributes']=_[_0x8c78('0x34')](_0x5ba7d4[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x35')]));_0x2ab5cc[_0x8c78('0x36')]=_0x2ab5cc[_0x8c78('0x36')][_0x8c78('0x37')]?_0x2ab5cc[_0x8c78('0x36')]:_0x5ba7d4[_0x8c78('0x30')];if(!_0x36e8e5['query'][_0x8c78('0x38')](_0x8c78('0x39'))){_0x2ab5cc[_0x8c78('0x1e')]=qs[_0x8c78('0x1e')](_0x36e8e5[_0x8c78('0x32')]['limit']);_0x2ab5cc[_0x8c78('0x1c')]=qs[_0x8c78('0x1c')](_0x36e8e5[_0x8c78('0x32')]['offset']);}_0x2ab5cc[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x36e8e5['query'][_0x8c78('0x3b')]);_0x2ab5cc['where']=qs[_0x8c78('0x33')](_[_0x8c78('0x3c')](_0x36e8e5[_0x8c78('0x32')],_0x5ba7d4[_0x8c78('0x33')]),_0x51add6);if(_0x36e8e5['query'][_0x8c78('0x3d')]){_0x2ab5cc['where']=_[_0x8c78('0x3e')](_0x2ab5cc[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x51add6,function(_0x5ae2aa){if(_0x5ae2aa['type']!==_0x8c78('0x40')){var _0x25d143={};_0x25d143[_0x5ae2aa[_0x8c78('0x28')]]={'$like':'%'+_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x25d143;}})});}_0x2ab5cc=_[_0x8c78('0x3e')]({},_0x2ab5cc,_0x36e8e5[_0x8c78('0x41')]);var _0x314679={'where':_0x2ab5cc[_0x8c78('0x3f')]};return db[_0x8c78('0x2c')][_0x8c78('0x1f')](_0x314679)[_0x8c78('0x25')](function(_0x234d0e){_0x1c3039['count']=_0x234d0e;if(_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x42')]){_0x2ab5cc['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x8c78('0x43')](_0x2ab5cc);})[_0x8c78('0x25')](function(_0x5c9af3){_0x1c3039[_0x8c78('0x44')]=_0x5c9af3;return _0x1c3039;})[_0x8c78('0x25')](respondWithFilteredResult(_0x253776,_0x2ab5cc))['catch'](handleError(_0x253776,null));};exports[_0x8c78('0x45')]=function(_0x27603f,_0x57e2c7){var _0x10d521={'raw':![],'where':{'id':_0x27603f[_0x8c78('0x46')]['id']}},_0x24a8ea={};_0x24a8ea[_0x8c78('0x30')]=_[_0x8c78('0x31')](db['ZendeskAccount']['rawAttributes']);_0x24a8ea[_0x8c78('0x32')]=_[_0x8c78('0x31')](_0x27603f[_0x8c78('0x32')]);_0x24a8ea[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],_0x24a8ea[_0x8c78('0x32')]);_0x10d521[_0x8c78('0x36')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x27603f['query'][_0x8c78('0x35')]));_0x10d521[_0x8c78('0x36')]=_0x10d521[_0x8c78('0x36')][_0x8c78('0x37')]?_0x10d521[_0x8c78('0x36')]:_0x24a8ea['model'];if(_0x27603f[_0x8c78('0x32')][_0x8c78('0x42')]){_0x10d521[_0x8c78('0x47')]=[{'all':!![]}];}_0x10d521=_[_0x8c78('0x3e')]({},_0x10d521,_0x27603f[_0x8c78('0x41')]);return db['ZendeskAccount'][_0x8c78('0x48')](_0x10d521)['then'](handleEntityNotFound(_0x57e2c7,null))['then'](respondWithResult(_0x57e2c7,null))[_0x8c78('0x49')](handleError(_0x57e2c7,null));};exports[_0x8c78('0x4a')]=function(_0x61e20,_0x5a5f3b){return db[_0x8c78('0x2c')][_0x8c78('0x4a')](_0x61e20[_0x8c78('0x4b')],{})[_0x8c78('0x25')](respondWithResult(_0x5a5f3b,0xc9))[_0x8c78('0x49')](handleError(_0x5a5f3b,null));};exports[_0x8c78('0x24')]=function(_0x26103c,_0x1f5cdb){if(_0x26103c[_0x8c78('0x4b')]['id']){delete _0x26103c['body']['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x26103c[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x1f5cdb,null))['then'](saveUpdates(_0x26103c[_0x8c78('0x4b')],null))[_0x8c78('0x25')](respondWithResult(_0x1f5cdb,null))[_0x8c78('0x49')](handleError(_0x1f5cdb,null));};exports[_0x8c78('0x26')]=function(_0x53e75c,_0x336b95){return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x53e75c['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x336b95,null))['then'](removeEntity(_0x336b95,null))[_0x8c78('0x49')](handleError(_0x336b95,null));};exports[_0x8c78('0x4c')]=function(_0x402faa,_0xa87aba,_0x349b87){var _0x462b89={};var _0xf68e0={};var _0x38fec1;var _0x19d807;return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x402faa[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0xa87aba,null))[_0x8c78('0x25')](function(_0x54b40d){if(_0x54b40d){_0x38fec1=_0x54b40d;_0xf68e0[_0x8c78('0x30')]=_[_0x8c78('0x31')](db[_0x8c78('0x4e')][_0x8c78('0x2d')]);_0xf68e0['query']=_[_0x8c78('0x31')](_0x402faa[_0x8c78('0x32')]);_0xf68e0[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],_0xf68e0[_0x8c78('0x32')]);_0x462b89['attributes']=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],qs['fields'](_0x402faa[_0x8c78('0x32')]['fields']));_0x462b89[_0x8c78('0x36')]=_0x462b89[_0x8c78('0x36')][_0x8c78('0x37')]?_0x462b89[_0x8c78('0x36')]:_0xf68e0[_0x8c78('0x30')];_0x462b89[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x402faa['query'][_0x8c78('0x3b')]);_0x462b89[_0x8c78('0x3f')]=qs['filters'](_[_0x8c78('0x3c')](_0x402faa[_0x8c78('0x32')],_0xf68e0['filters']));if(_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]){_0x462b89[_0x8c78('0x3f')]=_[_0x8c78('0x3e')](_0x462b89[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x462b89[_0x8c78('0x36')],function(_0x445630){var _0x20a0d9={};_0x20a0d9[_0x445630]={'$like':'%'+_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x20a0d9;})});}_0x462b89=_[_0x8c78('0x3e')]({},_0x462b89,_0x402faa[_0x8c78('0x41')]);return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x3897ea){if(_0x3897ea){_0x19d807=_0x3897ea['length'];if(!_0x402faa[_0x8c78('0x32')]['hasOwnProperty']('nolimit')){_0x462b89['limit']=qs[_0x8c78('0x1e')](_0x402faa['query']['limit']);_0x462b89['offset']=qs[_0x8c78('0x1c')](_0x402faa[_0x8c78('0x32')][_0x8c78('0x1c')]);}return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x333272){if(_0x333272){return _0x333272?{'count':_0x19d807,'rows':_0x333272}:null;}})[_0x8c78('0x25')](respondWithResult(_0xa87aba,null))[_0x8c78('0x49')](handleError(_0xa87aba,null));};exports[_0x8c78('0x4f')]=function(_0x334d0a,_0x3c3332,_0x3990c2){if(_0x334d0a[_0x8c78('0x4b')]['id']){delete _0x334d0a[_0x8c78('0x4b')]['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x334d0a[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x3c3332,null))[_0x8c78('0x25')](function(_0x4bdb7e){if(_0x4bdb7e){_0x334d0a[_0x8c78('0x4b')]['AccountId']=_0x4bdb7e['id'];_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x50')]=integrations[_0x8c78('0x51')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);_0x334d0a['body'][_0x8c78('0x53')]=integrations[_0x8c78('0x54')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);return db['ZendeskConfiguration'][_0x8c78('0x4a')](_0x334d0a[_0x8c78('0x4b')],{'include':[{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x50')},{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x53')}]});}return null;})[_0x8c78('0x25')](respondWithResult(_0x3c3332,null))[_0x8c78('0x49')](handleError(_0x3c3332,null));};exports[_0x8c78('0x56')]=function(_0x5646ff,_0x1f2b8f,_0x21b400){var _0x3c6886='';return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x5646ff[_0x8c78('0x46')]['id']},'attributes':['id',_0x8c78('0x57'),_0x8c78('0x58'),_0x8c78('0x59'),'authType',_0x8c78('0x5a')]})[_0x8c78('0x25')](handleEntityNotFound(_0x1f2b8f,null))['then'](function(_0x5e6a23){if(_0x5e6a23){_0x3c6886=_0x5e6a23[_0x8c78('0x5a')];var _0x4dbb47=_0x3c6886[_0x8c78('0x5b')](-0x1);if(_0x4dbb47==='/'){_0x3c6886=_0x3c6886[_0x8c78('0x5c')](0x0,_0x3c6886[_0x8c78('0x5d')](_0x4dbb47));}var _0x476835={'method':_0x8c78('0x5e'),'uri':util[_0x8c78('0x5f')]('%s/%s',_0x3c6886,'ticket_fields'),'json':!![]};switch(_0x5e6a23[_0x8c78('0x60')]){case _0x8c78('0x58'):_0x476835[_0x8c78('0x61')]={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x63'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x58')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;case _0x8c78('0x59'):_0x476835['headers']={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x66'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x59')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;default:throw new db[(_0x8c78('0x67'))][(_0x8c78('0x68'))](_0x8c78('0x69'));}return rp(_0x476835);}})[_0x8c78('0x25')](function(_0x402cff){if(_0x402cff){var _0x280a8b=[_0x8c78('0x6a'),_0x8c78('0x6b'),_0x8c78('0x6c'),_0x8c78('0x6d')];_[_0x8c78('0x6e')](_0x402cff[_0x8c78('0x6f')],function(_0x4c6cc5){return _0x280a8b[_0x8c78('0x70')](_0x4c6cc5['type']);});return{'count':_0x402cff['ticket_fields'][_0x8c78('0x37')],'rows':_[_0x8c78('0x2b')](_0x402cff[_0x8c78('0x6f')],function(_0x3b3c51){return{'id':_0x3b3c51['id'],'name':_0x3b3c51['position']>0x7?_0x3b3c51[_0x8c78('0x71')]:_0x3b3c51[_0x8c78('0x2f')],'custom':_0x3b3c51[_0x8c78('0x72')]>0x7?!![]:![],'options':_0x3b3c51['system_field_options']?_0x3b3c51[_0x8c78('0x73')]:_0x3b3c51[_0x8c78('0x74')]?_0x3b3c51[_0x8c78('0x74')]:[]};})};}})[_0x8c78('0x25')](respondWithResult(_0x1f2b8f,null))['catch'](function(_0xfff9a5){var _0x837c68=_0x5646ff['query']['test']?0x1f4:_0xfff9a5['statusCode']||0x1f4;logger[_0x8c78('0x75')](_0x8c78('0x76'),_0x8c78('0x56'),_0x837c68,JSON[_0x8c78('0x77')](_0xfff9a5));delete _0xfff9a5['name'];if(_0x837c68===0x191){_0x837c68=0x190;}_0x1f2b8f[_0x8c78('0x19')](_0x837c68)['send'](_0x5646ff[_0x8c78('0x32')][_0x8c78('0x78')]?{'message':_0x8c78('0x79'),'statusCode':_0xfff9a5[_0x8c78('0x7a')]}:_0xfff9a5);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index bfa831c..56155c7 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.model.js +++ b/server/api/intZendeskAccount/intZendeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6d0=['rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2dada7,_0x5623c0){var _0x5917b1=function(_0xf67dea){while(--_0xf67dea){_0x2dada7['push'](_0x2dada7['shift']());}};_0x5917b1(++_0x5623c0);}(_0xa6d0,0x158));var _0x0a6d=function(_0x2ac43d,_0x3fb12b){_0x2ac43d=_0x2ac43d-0x0;var _0x6ec6d7=_0xa6d0[_0x2ac43d];return _0x6ec6d7;};'use strict';var _=require(_0x0a6d('0x0'));var util=require('util');var logger=require(_0x0a6d('0x1'))(_0x0a6d('0x2'));var moment=require(_0x0a6d('0x3'));var BPromise=require(_0x0a6d('0x4'));var rp=require(_0x0a6d('0x5'));var fs=require('fs');var path=require(_0x0a6d('0x6'));var rimraf=require(_0x0a6d('0x7'));var config=require(_0x0a6d('0x8'));var attributes=require(_0x0a6d('0x9'));var integrations=require(_0x0a6d('0xa'));module[_0x0a6d('0xb')]=function(_0x357d34,_0x2c0f35){return _0x357d34[_0x0a6d('0xc')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0460=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0x0460,0x96));var _0x0046=function(_0x508e2a,_0x392ea1){_0x508e2a=_0x508e2a-0x0;var _0x18f170=_0x0460[_0x508e2a];return _0x18f170;};'use strict';var _=require('lodash');var util=require(_0x0046('0x0'));var logger=require(_0x0046('0x1'))(_0x0046('0x2'));var moment=require(_0x0046('0x3'));var BPromise=require(_0x0046('0x4'));var rp=require(_0x0046('0x5'));var fs=require('fs');var path=require(_0x0046('0x6'));var rimraf=require(_0x0046('0x7'));var config=require(_0x0046('0x8'));var attributes=require(_0x0046('0x9'));var integrations=require(_0x0046('0xa'));module[_0x0046('0xb')]=function(_0x1bdf0d,_0x4c7449){return _0x1bdf0d['define']('ZendeskAccount',attributes,{'tableName':_0x0046('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index f91372c..1218baf 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js +++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1b5=['http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','map','attributes','model','catch','find','ShowZendeskAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0xd1b5,0x67));var _0x5d1b=function(_0x213c88,_0x5e0930){_0x213c88=_0x213c88-0x0;var _0x401544=_0xd1b5[_0x213c88];return _0x401544;};'use strict';var _=require(_0x5d1b('0x0'));var util=require(_0x5d1b('0x1'));var moment=require('moment');var BPromise=require(_0x5d1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d1b('0x3'));var db=require(_0x5d1b('0x4'))['db'];var utils=require(_0x5d1b('0x5'));var logger=require(_0x5d1b('0x6'))(_0x5d1b('0x7'));var config=require(_0x5d1b('0x8'));var jayson=require(_0x5d1b('0x9'));var client=jayson[_0x5d1b('0xa')][_0x5d1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x526909,_0x36909f,_0x105da9){return new BPromise(function(_0xa629b1,_0x51809f){return client[_0x5d1b('0xc')](_0x526909,_0x105da9)[_0x5d1b('0xd')](function(_0x2ed678){logger[_0x5d1b('0xe')](_0x5d1b('0xf'),_0x36909f,_0x5d1b('0x10'));logger[_0x5d1b('0x11')](_0x5d1b('0x12'),_0x36909f,_0x5d1b('0x10'),JSON[_0x5d1b('0x13')](_0x2ed678));if(_0x2ed678['error']){if(_0x2ed678[_0x5d1b('0x14')][_0x5d1b('0x15')]===0x1f4){logger[_0x5d1b('0x14')](_0x5d1b('0xf'),_0x36909f,_0x2ed678['error'][_0x5d1b('0x16')]);return _0x51809f(_0x2ed678[_0x5d1b('0x14')][_0x5d1b('0x16')]);}logger[_0x5d1b('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0x36909f,_0x2ed678[_0x5d1b('0x14')][_0x5d1b('0x16')]);return _0xa629b1(_0x2ed678['error']['message']);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x36909f,_0x5d1b('0x10'));_0xa629b1(_0x2ed678[_0x5d1b('0x17')][_0x5d1b('0x16')]);}})['catch'](function(_0x128c0a){logger[_0x5d1b('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0x36909f,_0x128c0a);_0x51809f(_0x128c0a);});});}exports[_0x5d1b('0x18')]=function(_0x565d58){var _0x4120fa=this;return new Promise(function(_0x4aef24,_0x422368){return db[_0x5d1b('0x19')][_0x5d1b('0x1a')]({'raw':_0x565d58[_0x5d1b('0x1b')]?_0x565d58['options'][_0x5d1b('0x1c')]===undefined?!![]:![]:!![],'where':_0x565d58['options']?_0x565d58[_0x5d1b('0x1b')][_0x5d1b('0x1d')]||null:null,'attributes':_0x565d58[_0x5d1b('0x1b')]?_0x565d58[_0x5d1b('0x1b')]['attributes']||null:null,'limit':_0x565d58[_0x5d1b('0x1b')]?_0x565d58['options'][_0x5d1b('0x1e')]||null:null,'include':_0x565d58[_0x5d1b('0x1b')]?_0x565d58[_0x5d1b('0x1b')][_0x5d1b('0x1f')]?_[_0x5d1b('0x20')](_0x565d58[_0x5d1b('0x1b')][_0x5d1b('0x1f')],function(_0x2229be){return{'model':db[_0x2229be['model']],'as':_0x2229be['as'],'attributes':_0x2229be[_0x5d1b('0x21')],'include':_0x2229be[_0x5d1b('0x1f')]?_[_0x5d1b('0x20')](_0x2229be[_0x5d1b('0x1f')],function(_0x17a7d9){return{'model':db[_0x17a7d9[_0x5d1b('0x22')]],'as':_0x17a7d9['as'],'attributes':_0x17a7d9[_0x5d1b('0x21')],'include':_0x17a7d9['include']?_[_0x5d1b('0x20')](_0x17a7d9[_0x5d1b('0x1f')],function(_0x118542){return{'model':db[_0x118542[_0x5d1b('0x22')]],'as':_0x118542['as'],'attributes':_0x118542[_0x5d1b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5d1b('0xd')](function(_0x1690c9){logger['info'](_0x5d1b('0x18'),_0x565d58);logger[_0x5d1b('0x11')](_0x5d1b('0x18'),_0x565d58,JSON[_0x5d1b('0x13')](_0x1690c9));_0x4aef24(_0x1690c9);})[_0x5d1b('0x23')](function(_0x350981){logger[_0x5d1b('0x14')]('GetZendeskAccount',_0x350981[_0x5d1b('0x16')],_0x565d58);_0x422368(_0x4120fa[_0x5d1b('0x14')](0x1f4,_0x350981[_0x5d1b('0x16')]));});});};exports['ShowZendeskAccount']=function(_0xa02e1e){var _0x46412e=this;return new Promise(function(_0x582fb1,_0x1bb11b){return db[_0x5d1b('0x19')][_0x5d1b('0x24')]({'raw':_0xa02e1e['options']?_0xa02e1e[_0x5d1b('0x1b')][_0x5d1b('0x1c')]===undefined?!![]:![]:!![],'where':_0xa02e1e['options']?_0xa02e1e[_0x5d1b('0x1b')][_0x5d1b('0x1d')]||null:null,'attributes':_0xa02e1e['options']?_0xa02e1e['options']['attributes']||null:null,'include':_0xa02e1e[_0x5d1b('0x1b')]?_0xa02e1e[_0x5d1b('0x1b')][_0x5d1b('0x1f')]?_[_0x5d1b('0x20')](_0xa02e1e['options'][_0x5d1b('0x1f')],function(_0x4eb7f6){return{'model':db[_0x4eb7f6[_0x5d1b('0x22')]],'as':_0x4eb7f6['as'],'attributes':_0x4eb7f6[_0x5d1b('0x21')],'include':_0x4eb7f6[_0x5d1b('0x1f')]?_['map'](_0x4eb7f6[_0x5d1b('0x1f')],function(_0x39c388){return{'model':db[_0x39c388['model']],'as':_0x39c388['as'],'attributes':_0x39c388[_0x5d1b('0x21')],'include':_0x39c388[_0x5d1b('0x1f')]?_[_0x5d1b('0x20')](_0x39c388[_0x5d1b('0x1f')],function(_0x17aee6){return{'model':db[_0x17aee6[_0x5d1b('0x22')]],'as':_0x17aee6['as'],'attributes':_0x17aee6[_0x5d1b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5d1b('0xd')](function(_0xa3d4ee){logger[_0x5d1b('0xe')](_0x5d1b('0x25'),_0xa02e1e);logger['debug'](_0x5d1b('0x25'),_0xa02e1e,JSON['stringify'](_0xa3d4ee));_0x582fb1(_0xa3d4ee);})[_0x5d1b('0x23')](function(_0x507f5a){logger[_0x5d1b('0x14')](_0x5d1b('0x25'),_0x507f5a[_0x5d1b('0x16')],_0xa02e1e);_0x1bb11b(_0x46412e[_0x5d1b('0x14')](0x1f4,_0x507f5a[_0x5d1b('0x16')]));});});}; \ No newline at end of file +var _0xcbda=['jayson/promise','request','then','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','map','include','model','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x157af2,_0x402b3a){var _0x23356a=function(_0xb0721a){while(--_0xb0721a){_0x157af2['push'](_0x157af2['shift']());}};_0x23356a(++_0x402b3a);}(_0xcbda,0x1a6));var _0xacbd=function(_0x1a6374,_0xa3df9d){_0x1a6374=_0x1a6374-0x0;var _0x258b67=_0xcbda[_0x1a6374];return _0x258b67;};'use strict';var _=require(_0xacbd('0x0'));var util=require(_0xacbd('0x1'));var moment=require(_0xacbd('0x2'));var BPromise=require(_0xacbd('0x3'));var rs=require(_0xacbd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacbd('0x5'))['db'];var utils=require(_0xacbd('0x6'));var logger=require(_0xacbd('0x7'))(_0xacbd('0x8'));var config=require(_0xacbd('0x9'));var jayson=require(_0xacbd('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c28c0,_0x382d12,_0x5b2f32){return new BPromise(function(_0x1b63be,_0x5cef26){return client[_0xacbd('0xb')](_0x2c28c0,_0x5b2f32)[_0xacbd('0xc')](function(_0x1b782e){logger['info'](_0xacbd('0xd'),_0x382d12,'request\x20sent');logger[_0xacbd('0xe')](_0xacbd('0xf'),_0x382d12,_0xacbd('0x10'),JSON[_0xacbd('0x11')](_0x1b782e));if(_0x1b782e[_0xacbd('0x12')]){if(_0x1b782e['error'][_0xacbd('0x13')]===0x1f4){logger['error'](_0xacbd('0xd'),_0x382d12,_0x1b782e[_0xacbd('0x12')][_0xacbd('0x14')]);return _0x5cef26(_0x1b782e[_0xacbd('0x12')][_0xacbd('0x14')]);}logger[_0xacbd('0x12')](_0xacbd('0xd'),_0x382d12,_0x1b782e[_0xacbd('0x12')][_0xacbd('0x14')]);return _0x1b63be(_0x1b782e[_0xacbd('0x12')][_0xacbd('0x14')]);}else{logger[_0xacbd('0x15')](_0xacbd('0xd'),_0x382d12,'request\x20sent');_0x1b63be(_0x1b782e[_0xacbd('0x16')][_0xacbd('0x14')]);}})[_0xacbd('0x17')](function(_0x447fe4){logger['error'](_0xacbd('0xd'),_0x382d12,_0x447fe4);_0x5cef26(_0x447fe4);});});}exports[_0xacbd('0x18')]=function(_0x5c2d4b){var _0x2e8a2a=this;return new Promise(function(_0x936b54,_0x42708f){return db[_0xacbd('0x19')][_0xacbd('0x1a')]({'raw':_0x5c2d4b['options']?_0x5c2d4b[_0xacbd('0x1b')][_0xacbd('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c2d4b[_0xacbd('0x1b')]?_0x5c2d4b[_0xacbd('0x1b')]['where']||null:null,'attributes':_0x5c2d4b[_0xacbd('0x1b')]?_0x5c2d4b['options'][_0xacbd('0x1d')]||null:null,'limit':_0x5c2d4b[_0xacbd('0x1b')]?_0x5c2d4b[_0xacbd('0x1b')][_0xacbd('0x1e')]||null:null,'include':_0x5c2d4b['options']?_0x5c2d4b[_0xacbd('0x1b')]['include']?_[_0xacbd('0x1f')](_0x5c2d4b[_0xacbd('0x1b')][_0xacbd('0x20')],function(_0x9d209f){return{'model':db[_0x9d209f['model']],'as':_0x9d209f['as'],'attributes':_0x9d209f[_0xacbd('0x1d')],'include':_0x9d209f[_0xacbd('0x20')]?_['map'](_0x9d209f['include'],function(_0x39e38c){return{'model':db[_0x39e38c[_0xacbd('0x21')]],'as':_0x39e38c['as'],'attributes':_0x39e38c[_0xacbd('0x1d')],'include':_0x39e38c[_0xacbd('0x20')]?_[_0xacbd('0x1f')](_0x39e38c[_0xacbd('0x20')],function(_0x565358){return{'model':db[_0x565358[_0xacbd('0x21')]],'as':_0x565358['as'],'attributes':_0x565358[_0xacbd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xacbd('0xc')](function(_0x48e678){logger[_0xacbd('0x15')]('GetZendeskAccount',_0x5c2d4b);logger['debug']('GetZendeskAccount',_0x5c2d4b,JSON[_0xacbd('0x11')](_0x48e678));_0x936b54(_0x48e678);})[_0xacbd('0x17')](function(_0x141418){logger[_0xacbd('0x12')]('GetZendeskAccount',_0x141418[_0xacbd('0x14')],_0x5c2d4b);_0x42708f(_0x2e8a2a[_0xacbd('0x12')](0x1f4,_0x141418[_0xacbd('0x14')]));});});};exports[_0xacbd('0x22')]=function(_0x2f97ad){var _0x4bd56a=this;return new Promise(function(_0x2277b7,_0x2040f5){return db[_0xacbd('0x19')][_0xacbd('0x23')]({'raw':_0x2f97ad[_0xacbd('0x1b')]?_0x2f97ad[_0xacbd('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2f97ad['options']?_0x2f97ad[_0xacbd('0x1b')]['where']||null:null,'attributes':_0x2f97ad[_0xacbd('0x1b')]?_0x2f97ad[_0xacbd('0x1b')][_0xacbd('0x1d')]||null:null,'include':_0x2f97ad[_0xacbd('0x1b')]?_0x2f97ad[_0xacbd('0x1b')][_0xacbd('0x20')]?_[_0xacbd('0x1f')](_0x2f97ad[_0xacbd('0x1b')][_0xacbd('0x20')],function(_0xb148e7){return{'model':db[_0xb148e7[_0xacbd('0x21')]],'as':_0xb148e7['as'],'attributes':_0xb148e7['attributes'],'include':_0xb148e7[_0xacbd('0x20')]?_[_0xacbd('0x1f')](_0xb148e7[_0xacbd('0x20')],function(_0x287818){return{'model':db[_0x287818[_0xacbd('0x21')]],'as':_0x287818['as'],'attributes':_0x287818['attributes'],'include':_0x287818[_0xacbd('0x20')]?_[_0xacbd('0x1f')](_0x287818['include'],function(_0x5d1553){return{'model':db[_0x5d1553[_0xacbd('0x21')]],'as':_0x5d1553['as'],'attributes':_0x5d1553['attributes']};}):[]};}):[]};}):[]:[]})[_0xacbd('0xc')](function(_0x174d34){logger['info'](_0xacbd('0x22'),_0x2f97ad);logger[_0xacbd('0xe')](_0xacbd('0x22'),_0x2f97ad,JSON[_0xacbd('0x11')](_0x174d34));_0x2277b7(_0x174d34);})[_0xacbd('0x17')](function(_0x13da49){logger[_0xacbd('0x12')](_0xacbd('0x22'),_0x13da49[_0xacbd('0x14')],_0x2f97ad);_0x2040f5(_0x4bd56a[_0xacbd('0x12')](0x1f4,_0x13da49[_0xacbd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c7d5399..e8c610d 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0x689041,_0x47527c){var _0x220508=function(_0x2cca52){while(--_0x2cca52){_0x689041['push'](_0x689041['shift']());}};_0x220508(++_0x47527c);}(_0x750a,0x140));var _0xa750=function(_0x42e033,_0x471f16){_0x42e033=_0x42e033-0x0;var _0x29b970=_0x750a[_0x42e033];return _0x29b970;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('0x17')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x5f0396,_0x36e2fd){var _0x2cb6a0=function(_0x16b66a){while(--_0x16b66a){_0x5f0396['push'](_0x5f0396['shift']());}};_0x2cb6a0(++_0x36e2fd);}(_0xda3f,0xec));var _0xfda3=function(_0xdd12b9,_0x5bc048){_0xdd12b9=_0xdd12b9-0x0;var _0x102d1d=_0xda3f[_0xdd12b9];return _0x102d1d;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index a5e29fd..5e1ed5f 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x23e2=['STRING','exports'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x23e2,0x14f));var _0x223e=function(_0x4385ba,_0x21bb05){_0x4385ba=_0x4385ba-0x0;var _0xf089b1=_0x23e2[_0x4385ba];return _0xf089b1;};'use strict';var Sequelize=require('sequelize');module[_0x223e('0x0')]={'name':{'type':Sequelize[_0x223e('0x1')]},'description':{'type':Sequelize[_0x223e('0x1')]}}; \ No newline at end of file +var _0x0c98=['STRING','exports'];(function(_0x4b6d72,_0x15a92a){var _0x28eeed=function(_0x359f67){while(--_0x359f67){_0x4b6d72['push'](_0x4b6d72['shift']());}};_0x28eeed(++_0x15a92a);}(_0x0c98,0x1e3));var _0x80c9=function(_0x4fb52e,_0x5c9020){_0x4fb52e=_0x4fb52e-0x0;var _0x155b17=_0x0c98[_0x4fb52e];return _0x155b17;};'use strict';var Sequelize=require('sequelize');module[_0x80c9('0x0')]={'name':{'type':Sequelize[_0x80c9('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index af6e958..3ad8297 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1309=['filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','catch','create','body','getFields','ZendeskField','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x501652,_0x31033e){var _0x12394e=function(_0x58b456){while(--_0x58b456){_0x501652['push'](_0x501652['shift']());}};_0x12394e(++_0x31033e);}(_0x1309,0x10e));var _0x9130=function(_0x10eafb,_0x103eb6){_0x10eafb=_0x10eafb-0x0;var _0x3ed3f2=_0x1309[_0x10eafb];return _0x3ed3f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9130('0x0'));var jsonpatch=require(_0x9130('0x1'));var rp=require(_0x9130('0x2'));var moment=require(_0x9130('0x3'));var BPromise=require(_0x9130('0x4'));var Mustache=require(_0x9130('0x5'));var util=require(_0x9130('0x6'));var path=require(_0x9130('0x7'));var sox=require(_0x9130('0x8'));var csv=require(_0x9130('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9130('0xa'));var _=require(_0x9130('0xb'));var squel=require(_0x9130('0xc'));var crypto=require(_0x9130('0xd'));var jsforce=require(_0x9130('0xe'));var deskjs=require(_0x9130('0xf'));var toCsv=require(_0x9130('0x9'));var querystring=require(_0x9130('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9130('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9130('0x12'));var logger=require(_0x9130('0x13'))(_0x9130('0x14'));var utils=require(_0x9130('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9130('0x16'));var db=require(_0x9130('0x17'))['db'];function respondWithStatusCode(_0x9f7686,_0x1a736b){_0x1a736b=_0x1a736b||0xcc;return function(_0x225076){if(_0x225076){return _0x9f7686[_0x9130('0x18')](_0x1a736b);}return _0x9f7686[_0x9130('0x19')](_0x1a736b)[_0x9130('0x1a')]();};}function respondWithResult(_0x28a0b,_0x25e072){_0x25e072=_0x25e072||0xc8;return function(_0x21e45a){if(_0x21e45a){return _0x28a0b[_0x9130('0x19')](_0x25e072)['json'](_0x21e45a);}};}function respondWithFilteredResult(_0x541988,_0x536ab3){return function(_0x164b0a){if(_0x164b0a){var _0x4431de=typeof _0x536ab3[_0x9130('0x1b')]==='undefined'&&typeof _0x536ab3[_0x9130('0x1c')]===_0x9130('0x1d');var _0x548d15=_0x164b0a['count'];var _0x83e81=_0x4431de?0x0:_0x536ab3['offset'];var _0x50ede9=_0x4431de?_0x164b0a[_0x9130('0x1e')]:_0x536ab3[_0x9130('0x1b')]+_0x536ab3[_0x9130('0x1c')];var _0x296c86;if(_0x50ede9>=_0x548d15){_0x50ede9=_0x548d15;_0x296c86=0xc8;}else{_0x296c86=0xce;}_0x541988[_0x9130('0x19')](_0x296c86);return _0x541988[_0x9130('0x1f')]('Content-Range',_0x83e81+'-'+_0x50ede9+'/'+_0x548d15)['json'](_0x164b0a);}return null;};}function patchUpdates(_0x552ec7){return function(_0x9dfeb1){try{jsonpatch[_0x9130('0x20')](_0x9dfeb1,_0x552ec7,!![]);}catch(_0x2995ed){return BPromise[_0x9130('0x21')](_0x2995ed);}return _0x9dfeb1[_0x9130('0x22')]();};}function saveUpdates(_0x5439df,_0x28ea1a){return function(_0x2d9dcc){if(_0x2d9dcc){return _0x2d9dcc[_0x9130('0x23')](_0x5439df)['then'](function(_0x5f11d4){return _0x5f11d4;});}return null;};}function removeEntity(_0x5d2ce5,_0x524864){return function(_0x380aa8){if(_0x380aa8){return _0x380aa8[_0x9130('0x24')]()[_0x9130('0x25')](function(){_0x5d2ce5[_0x9130('0x19')](0xcc)[_0x9130('0x1a')]();});}};}function handleEntityNotFound(_0x2f3c7b,_0x4fe78d){return function(_0x4b9438){if(!_0x4b9438){_0x2f3c7b[_0x9130('0x18')](0x194);}return _0x4b9438;};}function handleError(_0x354500,_0x1a8acc){_0x1a8acc=_0x1a8acc||0x1f4;return function(_0x3b9f99){logger[_0x9130('0x26')](_0x3b9f99['stack']);if(_0x3b9f99[_0x9130('0x27')]){delete _0x3b9f99[_0x9130('0x27')];}_0x354500['status'](_0x1a8acc)[_0x9130('0x28')](_0x3b9f99);};}exports[_0x9130('0x29')]=function(_0x550f9b,_0x545810){var _0x3d23d7={},_0x5387e4={},_0x96fb11={'count':0x0,'rows':[]};var _0x21e93e=_[_0x9130('0x2a')](db[_0x9130('0x2b')][_0x9130('0x2c')],function(_0x3bc1da){return{'name':_0x3bc1da[_0x9130('0x2d')],'type':_0x3bc1da[_0x9130('0x2e')][_0x9130('0x2f')]};});_0x5387e4[_0x9130('0x30')]=_[_0x9130('0x2a')](_0x21e93e,'name');_0x5387e4[_0x9130('0x31')]=_[_0x9130('0x32')](_0x550f9b['query']);_0x5387e4['filters']=_[_0x9130('0x33')](_0x5387e4[_0x9130('0x30')],_0x5387e4[_0x9130('0x31')]);_0x3d23d7[_0x9130('0x34')]=_[_0x9130('0x33')](_0x5387e4[_0x9130('0x30')],qs[_0x9130('0x35')](_0x550f9b[_0x9130('0x31')][_0x9130('0x35')]));_0x3d23d7[_0x9130('0x34')]=_0x3d23d7['attributes'][_0x9130('0x36')]?_0x3d23d7['attributes']:_0x5387e4['model'];if(!_0x550f9b[_0x9130('0x31')][_0x9130('0x37')](_0x9130('0x38'))){_0x3d23d7['limit']=qs['limit'](_0x550f9b[_0x9130('0x31')][_0x9130('0x1c')]);_0x3d23d7[_0x9130('0x1b')]=qs['offset'](_0x550f9b[_0x9130('0x31')][_0x9130('0x1b')]);}_0x3d23d7[_0x9130('0x39')]=qs[_0x9130('0x3a')](_0x550f9b[_0x9130('0x31')]['sort']);_0x3d23d7[_0x9130('0x3b')]=qs[_0x9130('0x3c')](_[_0x9130('0x3d')](_0x550f9b[_0x9130('0x31')],_0x5387e4[_0x9130('0x3c')]),_0x21e93e);if(_0x550f9b[_0x9130('0x31')][_0x9130('0x3e')]){_0x3d23d7[_0x9130('0x3b')]=_[_0x9130('0x3f')](_0x3d23d7['where'],{'$or':_['map'](_0x21e93e,function(_0x4c0418){if(_0x4c0418[_0x9130('0x2e')]!==_0x9130('0x40')){var _0x1549fa={};_0x1549fa[_0x4c0418['name']]={'$like':'%'+_0x550f9b[_0x9130('0x31')][_0x9130('0x3e')]+'%'};return _0x1549fa;}})});}_0x3d23d7=_[_0x9130('0x3f')]({},_0x3d23d7,_0x550f9b[_0x9130('0x41')]);var _0x229650={'where':_0x3d23d7[_0x9130('0x3b')]};return db[_0x9130('0x2b')][_0x9130('0x1e')](_0x229650)['then'](function(_0x3d90d7){_0x96fb11[_0x9130('0x1e')]=_0x3d90d7;if(_0x550f9b['query'][_0x9130('0x42')]){_0x3d23d7['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x9130('0x43')](_0x3d23d7);})[_0x9130('0x25')](function(_0x234386){_0x96fb11[_0x9130('0x44')]=_0x234386;return _0x96fb11;})[_0x9130('0x25')](respondWithFilteredResult(_0x545810,_0x3d23d7))['catch'](handleError(_0x545810,null));};exports[_0x9130('0x45')]=function(_0x78321b,_0xdbc17f){var _0x67b436={'raw':![],'where':{'id':_0x78321b[_0x9130('0x46')]['id']}},_0xdb85d0={};_0xdb85d0['model']=_[_0x9130('0x32')](db[_0x9130('0x2b')]['rawAttributes']);_0xdb85d0['query']=_['keys'](_0x78321b['query']);_0xdb85d0['filters']=_[_0x9130('0x33')](_0xdb85d0['model'],_0xdb85d0['query']);_0x67b436[_0x9130('0x34')]=_['intersection'](_0xdb85d0['model'],qs['fields'](_0x78321b['query']['fields']));_0x67b436['attributes']=_0x67b436[_0x9130('0x34')][_0x9130('0x36')]?_0x67b436[_0x9130('0x34')]:_0xdb85d0[_0x9130('0x30')];if(_0x78321b[_0x9130('0x31')][_0x9130('0x42')]){_0x67b436['include']=[{'all':!![]}];}_0x67b436=_[_0x9130('0x3f')]({},_0x67b436,_0x78321b['options']);return db[_0x9130('0x2b')][_0x9130('0x47')](_0x67b436)[_0x9130('0x25')](handleEntityNotFound(_0xdbc17f,null))[_0x9130('0x25')](respondWithResult(_0xdbc17f,null))[_0x9130('0x48')](handleError(_0xdbc17f,null));};exports['create']=function(_0x13e1e2,_0x683624){return db[_0x9130('0x2b')][_0x9130('0x49')](_0x13e1e2[_0x9130('0x4a')],{})[_0x9130('0x25')](respondWithResult(_0x683624,0xc9))[_0x9130('0x48')](handleError(_0x683624,null));};exports[_0x9130('0x23')]=function(_0x227914,_0x5072d7){if(_0x227914['body']['id']){delete _0x227914[_0x9130('0x4a')]['id'];}return db[_0x9130('0x2b')][_0x9130('0x47')]({'where':{'id':_0x227914[_0x9130('0x46')]['id']}})[_0x9130('0x25')](handleEntityNotFound(_0x5072d7,null))['then'](saveUpdates(_0x227914[_0x9130('0x4a')],null))[_0x9130('0x25')](respondWithResult(_0x5072d7,null))[_0x9130('0x48')](handleError(_0x5072d7,null));};exports['destroy']=function(_0x55bd69,_0x2efa31){return db[_0x9130('0x2b')][_0x9130('0x47')]({'where':{'id':_0x55bd69[_0x9130('0x46')]['id']}})[_0x9130('0x25')](handleEntityNotFound(_0x2efa31,null))[_0x9130('0x25')](removeEntity(_0x2efa31,null))[_0x9130('0x48')](handleError(_0x2efa31,null));};exports[_0x9130('0x4b')]=function(_0x24dd38,_0x1bfa2c,_0x342b55){var _0x3a5816={};var _0x37babf={};var _0xa60177;var _0x529497;return db[_0x9130('0x2b')]['findOne']({'where':{'id':_0x24dd38[_0x9130('0x46')]['id']}})[_0x9130('0x25')](handleEntityNotFound(_0x1bfa2c,null))[_0x9130('0x25')](function(_0x1e2e87){if(_0x1e2e87){_0xa60177=_0x1e2e87;_0x37babf[_0x9130('0x30')]=_[_0x9130('0x32')](db[_0x9130('0x4c')][_0x9130('0x2c')]);_0x37babf[_0x9130('0x31')]=_[_0x9130('0x32')](_0x24dd38[_0x9130('0x31')]);_0x37babf[_0x9130('0x3c')]=_[_0x9130('0x33')](_0x37babf['model'],_0x37babf[_0x9130('0x31')]);_0x3a5816[_0x9130('0x34')]=_['intersection'](_0x37babf['model'],qs['fields'](_0x24dd38[_0x9130('0x31')][_0x9130('0x35')]));_0x3a5816[_0x9130('0x34')]=_0x3a5816[_0x9130('0x34')][_0x9130('0x36')]?_0x3a5816['attributes']:_0x37babf[_0x9130('0x30')];_0x3a5816[_0x9130('0x39')]=qs[_0x9130('0x3a')](_0x24dd38[_0x9130('0x31')][_0x9130('0x3a')]);_0x3a5816[_0x9130('0x3b')]=qs[_0x9130('0x3c')](_[_0x9130('0x3d')](_0x24dd38[_0x9130('0x31')],_0x37babf['filters']));if(_0x24dd38['query'][_0x9130('0x3e')]){_0x3a5816[_0x9130('0x3b')]=_[_0x9130('0x3f')](_0x3a5816['where'],{'$or':_[_0x9130('0x2a')](_0x3a5816[_0x9130('0x34')],function(_0x3b5fdd){var _0x1542f2={};_0x1542f2[_0x3b5fdd]={'$like':'%'+_0x24dd38['query'][_0x9130('0x3e')]+'%'};return _0x1542f2;})});}_0x3a5816=_['merge']({},_0x3a5816,_0x24dd38[_0x9130('0x41')]);return _0xa60177[_0x9130('0x4b')](_0x3a5816);}})[_0x9130('0x25')](function(_0x1aefaa){if(_0x1aefaa){_0x529497=_0x1aefaa['length'];if(!_0x24dd38['query']['hasOwnProperty'](_0x9130('0x38'))){_0x3a5816[_0x9130('0x1c')]=qs['limit'](_0x24dd38[_0x9130('0x31')][_0x9130('0x1c')]);_0x3a5816[_0x9130('0x1b')]=qs['offset'](_0x24dd38[_0x9130('0x31')][_0x9130('0x1b')]);}return _0xa60177[_0x9130('0x4b')](_0x3a5816);}})[_0x9130('0x25')](function(_0x206217){if(_0x206217){return _0x206217?{'count':_0x529497,'rows':_0x206217}:null;}})[_0x9130('0x25')](respondWithResult(_0x1bfa2c,null))['catch'](handleError(_0x1bfa2c,null));};exports[_0x9130('0x4d')]=function(_0x18d26c,_0xdc791c,_0x158f6d){var _0x237a75={};var _0x2d8f9c={};var _0x4cd77e;var _0x2d3dd8;return db[_0x9130('0x2b')][_0x9130('0x4e')]({'where':{'id':_0x18d26c[_0x9130('0x46')]['id']}})['then'](handleEntityNotFound(_0xdc791c,null))['then'](function(_0x22bdc2){if(_0x22bdc2){_0x4cd77e=_0x22bdc2;_0x2d8f9c[_0x9130('0x30')]=_[_0x9130('0x32')](db[_0x9130('0x4c')]['rawAttributes']);_0x2d8f9c['query']=_['keys'](_0x18d26c[_0x9130('0x31')]);_0x2d8f9c['filters']=_[_0x9130('0x33')](_0x2d8f9c[_0x9130('0x30')],_0x2d8f9c[_0x9130('0x31')]);_0x237a75['attributes']=_['intersection'](_0x2d8f9c[_0x9130('0x30')],qs[_0x9130('0x35')](_0x18d26c[_0x9130('0x31')][_0x9130('0x35')]));_0x237a75[_0x9130('0x34')]=_0x237a75[_0x9130('0x34')][_0x9130('0x36')]?_0x237a75['attributes']:_0x2d8f9c[_0x9130('0x30')];_0x237a75['order']=qs[_0x9130('0x3a')](_0x18d26c['query'][_0x9130('0x3a')]);_0x237a75[_0x9130('0x3b')]=qs[_0x9130('0x3c')](_[_0x9130('0x3d')](_0x18d26c[_0x9130('0x31')],_0x2d8f9c[_0x9130('0x3c')]));if(_0x18d26c['query'][_0x9130('0x3e')]){_0x237a75[_0x9130('0x3b')]=_['merge'](_0x237a75[_0x9130('0x3b')],{'$or':_[_0x9130('0x2a')](_0x237a75[_0x9130('0x34')],function(_0x5938f7){var _0x1a2340={};_0x1a2340[_0x5938f7]={'$like':'%'+_0x18d26c[_0x9130('0x31')]['filter']+'%'};return _0x1a2340;})});}_0x237a75=_['merge']({},_0x237a75,_0x18d26c['options']);return _0x4cd77e['getSubjects'](_0x237a75);}})[_0x9130('0x25')](function(_0x5e7b7b){if(_0x5e7b7b){_0x2d3dd8=_0x5e7b7b[_0x9130('0x36')];if(!_0x18d26c[_0x9130('0x31')][_0x9130('0x37')](_0x9130('0x38'))){_0x237a75[_0x9130('0x1c')]=qs[_0x9130('0x1c')](_0x18d26c[_0x9130('0x31')][_0x9130('0x1c')]);_0x237a75[_0x9130('0x1b')]=qs[_0x9130('0x1b')](_0x18d26c[_0x9130('0x31')]['offset']);}return _0x4cd77e[_0x9130('0x4d')](_0x237a75);}})[_0x9130('0x25')](function(_0x58e778){if(_0x58e778){return _0x58e778?{'count':_0x2d3dd8,'rows':_0x58e778}:null;}})[_0x9130('0x25')](respondWithResult(_0xdc791c,null))['catch'](handleError(_0xdc791c,null));};exports[_0x9130('0x4f')]=function(_0x5cc4dc,_0x42d588,_0x600662){var _0x14eae7={};var _0x6335d1={};var _0x2bbcbd;var _0x1c179d;return db[_0x9130('0x2b')]['findOne']({'where':{'id':_0x5cc4dc[_0x9130('0x46')]['id']}})[_0x9130('0x25')](handleEntityNotFound(_0x42d588,null))[_0x9130('0x25')](function(_0x5c2412){if(_0x5c2412){_0x2bbcbd=_0x5c2412;_0x6335d1[_0x9130('0x30')]=_['keys'](db[_0x9130('0x4c')][_0x9130('0x2c')]);_0x6335d1['query']=_[_0x9130('0x32')](_0x5cc4dc[_0x9130('0x31')]);_0x6335d1['filters']=_[_0x9130('0x33')](_0x6335d1[_0x9130('0x30')],_0x6335d1[_0x9130('0x31')]);_0x14eae7[_0x9130('0x34')]=_['intersection'](_0x6335d1['model'],qs['fields'](_0x5cc4dc['query'][_0x9130('0x35')]));_0x14eae7[_0x9130('0x34')]=_0x14eae7[_0x9130('0x34')]['length']?_0x14eae7[_0x9130('0x34')]:_0x6335d1['model'];_0x14eae7[_0x9130('0x39')]=qs[_0x9130('0x3a')](_0x5cc4dc[_0x9130('0x31')]['sort']);_0x14eae7[_0x9130('0x3b')]=qs['filters'](_[_0x9130('0x3d')](_0x5cc4dc['query'],_0x6335d1[_0x9130('0x3c')]));if(_0x5cc4dc['query'][_0x9130('0x3e')]){_0x14eae7[_0x9130('0x3b')]=_[_0x9130('0x3f')](_0x14eae7[_0x9130('0x3b')],{'$or':_[_0x9130('0x2a')](_0x14eae7[_0x9130('0x34')],function(_0x4cf357){var _0x33a7ab={};_0x33a7ab[_0x4cf357]={'$like':'%'+_0x5cc4dc['query']['filter']+'%'};return _0x33a7ab;})});}_0x14eae7=_[_0x9130('0x3f')]({},_0x14eae7,_0x5cc4dc[_0x9130('0x41')]);return _0x2bbcbd[_0x9130('0x4f')](_0x14eae7);}})[_0x9130('0x25')](function(_0x932ff9){if(_0x932ff9){_0x1c179d=_0x932ff9['length'];if(!_0x5cc4dc[_0x9130('0x31')]['hasOwnProperty'](_0x9130('0x38'))){_0x14eae7[_0x9130('0x1c')]=qs[_0x9130('0x1c')](_0x5cc4dc[_0x9130('0x31')][_0x9130('0x1c')]);_0x14eae7[_0x9130('0x1b')]=qs[_0x9130('0x1b')](_0x5cc4dc[_0x9130('0x31')][_0x9130('0x1b')]);}return _0x2bbcbd['getDescriptions'](_0x14eae7);}})[_0x9130('0x25')](function(_0x517cdb){if(_0x517cdb){return _0x517cdb?{'count':_0x1c179d,'rows':_0x517cdb}:null;}})[_0x9130('0x25')](respondWithResult(_0x42d588,null))[_0x9130('0x48')](handleError(_0x42d588,null));};exports[_0x9130('0x50')]=function(_0x19d7dc,_0x31787a,_0xaa740e){var _0x30910e={};var _0x13635d={};var _0x74a669;var _0x10a774;return db[_0x9130('0x2b')][_0x9130('0x4e')]({'where':{'id':_0x19d7dc['params']['id']}})[_0x9130('0x25')](handleEntityNotFound(_0x31787a,null))[_0x9130('0x25')](function(_0x3b367f){if(_0x3b367f){_0x74a669=_0x3b367f;_0x13635d[_0x9130('0x30')]=_[_0x9130('0x32')](db[_0x9130('0x51')][_0x9130('0x2c')]);_0x13635d['query']=_[_0x9130('0x32')](_0x19d7dc[_0x9130('0x31')]);_0x13635d['filters']=_['intersection'](_0x13635d[_0x9130('0x30')],_0x13635d[_0x9130('0x31')]);_0x30910e[_0x9130('0x34')]=_[_0x9130('0x33')](_0x13635d[_0x9130('0x30')],qs[_0x9130('0x35')](_0x19d7dc['query']['fields']));_0x30910e[_0x9130('0x34')]=_0x30910e[_0x9130('0x34')][_0x9130('0x36')]?_0x30910e[_0x9130('0x34')]:_0x13635d[_0x9130('0x30')];_0x30910e[_0x9130('0x39')]=qs[_0x9130('0x3a')](_0x19d7dc[_0x9130('0x31')][_0x9130('0x3a')]);_0x30910e[_0x9130('0x3b')]=qs['filters'](_[_0x9130('0x3d')](_0x19d7dc[_0x9130('0x31')],_0x13635d[_0x9130('0x3c')]));if(_0x19d7dc['query'][_0x9130('0x3e')]){_0x30910e['where']=_[_0x9130('0x3f')](_0x30910e['where'],{'$or':_[_0x9130('0x2a')](_0x30910e[_0x9130('0x34')],function(_0x316ef7){var _0x2973e2={};_0x2973e2[_0x316ef7]={'$like':'%'+_0x19d7dc[_0x9130('0x31')]['filter']+'%'};return _0x2973e2;})});}_0x30910e=_[_0x9130('0x3f')]({},_0x30910e,_0x19d7dc[_0x9130('0x41')]);return _0x74a669[_0x9130('0x50')](_0x30910e);}})[_0x9130('0x25')](function(_0x346add){if(_0x346add){_0x10a774=_0x346add[_0x9130('0x36')];if(!_0x19d7dc[_0x9130('0x31')]['hasOwnProperty'](_0x9130('0x38'))){_0x30910e[_0x9130('0x1c')]=qs['limit'](_0x19d7dc[_0x9130('0x31')][_0x9130('0x1c')]);_0x30910e[_0x9130('0x1b')]=qs[_0x9130('0x1b')](_0x19d7dc[_0x9130('0x31')]['offset']);}return _0x74a669[_0x9130('0x50')](_0x30910e);}})['then'](function(_0x5b547e){if(_0x5b547e){return _0x5b547e?{'count':_0x10a774,'rows':_0x5b547e}:null;}})[_0x9130('0x25')](respondWithResult(_0x31787a,null))[_0x9130('0x48')](handleError(_0x31787a,null));};exports['setTags']=function(_0x3c98ac,_0x42be25,_0x20de21){if(_0x3c98ac[_0x9130('0x4a')]['id']){delete _0x3c98ac[_0x9130('0x4a')]['id'];}return db[_0x9130('0x2b')]['findOne']({'where':{'id':_0x3c98ac['params']['id']}})[_0x9130('0x25')](handleEntityNotFound(_0x42be25,null))[_0x9130('0x25')](function(_0x535c48){if(_0x535c48){return _0x535c48[_0x9130('0x52')](_0x3c98ac[_0x9130('0x4a')]['ids']||[]);}return null;})[_0x9130('0x25')](respondWithResult(_0x42be25,null))[_0x9130('0x48')](handleError(_0x42be25,null));}; \ No newline at end of file +var _0x9767=['filter','merge','includeAll','rows','catch','rawAttributes','include','options','find','create','body','params','getFields','findOne','ZendeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','name','send','index','map','ZendeskConfiguration','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL'];(function(_0x5b1598,_0x2d9007){var _0xa5eb8f=function(_0x34cbd0){while(--_0x34cbd0){_0x5b1598['push'](_0x5b1598['shift']());}};_0xa5eb8f(++_0x2d9007);}(_0x9767,0xb9));var _0x7976=function(_0xfbf4ac,_0x24b52c){_0xfbf4ac=_0xfbf4ac-0x0;var _0x2635a5=_0x9767[_0xfbf4ac];return _0x2635a5;};'use strict';var emlformat=require(_0x7976('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7976('0x1'));var rp=require(_0x7976('0x2'));var moment=require(_0x7976('0x3'));var BPromise=require(_0x7976('0x4'));var Mustache=require(_0x7976('0x5'));var util=require(_0x7976('0x6'));var path=require(_0x7976('0x7'));var sox=require(_0x7976('0x8'));var csv=require('to-csv');var ejs=require(_0x7976('0x9'));var fs=require('fs');var fs_extra=require(_0x7976('0xa'));var _=require(_0x7976('0xb'));var squel=require(_0x7976('0xc'));var crypto=require(_0x7976('0xd'));var jsforce=require(_0x7976('0xe'));var deskjs=require(_0x7976('0xf'));var toCsv=require(_0x7976('0x10'));var querystring=require('querystring');var Papa=require(_0x7976('0x11'));var Redis=require(_0x7976('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7976('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7976('0x14'));var logger=require(_0x7976('0x15'))(_0x7976('0x16'));var utils=require(_0x7976('0x17'));var config=require(_0x7976('0x18'));var licenseUtil=require(_0x7976('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x83c530,_0x10e72d){_0x10e72d=_0x10e72d||0xcc;return function(_0x424ab3){if(_0x424ab3){return _0x83c530[_0x7976('0x1a')](_0x10e72d);}return _0x83c530[_0x7976('0x1b')](_0x10e72d)[_0x7976('0x1c')]();};}function respondWithResult(_0x3eb70f,_0x263c39){_0x263c39=_0x263c39||0xc8;return function(_0x46a766){if(_0x46a766){return _0x3eb70f[_0x7976('0x1b')](_0x263c39)[_0x7976('0x1d')](_0x46a766);}};}function respondWithFilteredResult(_0x3ecf85,_0xe8412b){return function(_0x45447a){if(_0x45447a){var _0x3f35b0=typeof _0xe8412b['offset']===_0x7976('0x1e')&&typeof _0xe8412b[_0x7976('0x1f')]===_0x7976('0x1e');var _0x48ea9e=_0x45447a[_0x7976('0x20')];var _0x452ffd=_0x3f35b0?0x0:_0xe8412b[_0x7976('0x21')];var _0xc8bd1e=_0x3f35b0?_0x45447a[_0x7976('0x20')]:_0xe8412b['offset']+_0xe8412b['limit'];var _0x4a2023;if(_0xc8bd1e>=_0x48ea9e){_0xc8bd1e=_0x48ea9e;_0x4a2023=0xc8;}else{_0x4a2023=0xce;}_0x3ecf85[_0x7976('0x1b')](_0x4a2023);return _0x3ecf85[_0x7976('0x22')]('Content-Range',_0x452ffd+'-'+_0xc8bd1e+'/'+_0x48ea9e)[_0x7976('0x1d')](_0x45447a);}return null;};}function patchUpdates(_0x6d808f){return function(_0x5d5745){try{jsonpatch['apply'](_0x5d5745,_0x6d808f,!![]);}catch(_0x194815){return BPromise[_0x7976('0x23')](_0x194815);}return _0x5d5745[_0x7976('0x24')]();};}function saveUpdates(_0x772a40,_0x51055b){return function(_0x24d2eb){if(_0x24d2eb){return _0x24d2eb[_0x7976('0x25')](_0x772a40)[_0x7976('0x26')](function(_0x12a1ec){return _0x12a1ec;});}return null;};}function removeEntity(_0x7a2e18,_0x51fd90){return function(_0x12cf8f){if(_0x12cf8f){return _0x12cf8f[_0x7976('0x27')]()['then'](function(){_0x7a2e18[_0x7976('0x1b')](0xcc)[_0x7976('0x1c')]();});}};}function handleEntityNotFound(_0x38cc2d,_0x54dd43){return function(_0x475eab){if(!_0x475eab){_0x38cc2d['sendStatus'](0x194);}return _0x475eab;};}function handleError(_0x57abc2,_0xe4dcf3){_0xe4dcf3=_0xe4dcf3||0x1f4;return function(_0x475d57){logger['error'](_0x475d57['stack']);if(_0x475d57[_0x7976('0x28')]){delete _0x475d57[_0x7976('0x28')];}_0x57abc2[_0x7976('0x1b')](_0xe4dcf3)[_0x7976('0x29')](_0x475d57);};}exports[_0x7976('0x2a')]=function(_0x3a30e3,_0xcbc419){var _0x4fb1b5={},_0x1a095f={},_0x397742={'count':0x0,'rows':[]};var _0x477306=_[_0x7976('0x2b')](db[_0x7976('0x2c')]['rawAttributes'],function(_0x18a947){return{'name':_0x18a947['fieldName'],'type':_0x18a947[_0x7976('0x2d')]['key']};});_0x1a095f['model']=_[_0x7976('0x2b')](_0x477306,'name');_0x1a095f[_0x7976('0x2e')]=_[_0x7976('0x2f')](_0x3a30e3[_0x7976('0x2e')]);_0x1a095f[_0x7976('0x30')]=_[_0x7976('0x31')](_0x1a095f[_0x7976('0x32')],_0x1a095f[_0x7976('0x2e')]);_0x4fb1b5[_0x7976('0x33')]=_[_0x7976('0x31')](_0x1a095f['model'],qs[_0x7976('0x34')](_0x3a30e3[_0x7976('0x2e')][_0x7976('0x34')]));_0x4fb1b5[_0x7976('0x33')]=_0x4fb1b5[_0x7976('0x33')][_0x7976('0x35')]?_0x4fb1b5[_0x7976('0x33')]:_0x1a095f[_0x7976('0x32')];if(!_0x3a30e3[_0x7976('0x2e')][_0x7976('0x36')](_0x7976('0x37'))){_0x4fb1b5['limit']=qs['limit'](_0x3a30e3['query']['limit']);_0x4fb1b5[_0x7976('0x21')]=qs[_0x7976('0x21')](_0x3a30e3[_0x7976('0x2e')][_0x7976('0x21')]);}_0x4fb1b5[_0x7976('0x38')]=qs[_0x7976('0x39')](_0x3a30e3[_0x7976('0x2e')][_0x7976('0x39')]);_0x4fb1b5[_0x7976('0x3a')]=qs[_0x7976('0x30')](_[_0x7976('0x3b')](_0x3a30e3[_0x7976('0x2e')],_0x1a095f['filters']),_0x477306);if(_0x3a30e3[_0x7976('0x2e')]['filter']){_0x4fb1b5['where']=_['merge'](_0x4fb1b5[_0x7976('0x3a')],{'$or':_[_0x7976('0x2b')](_0x477306,function(_0x29a5f1){if(_0x29a5f1[_0x7976('0x2d')]!==_0x7976('0x3c')){var _0x4ae8ba={};_0x4ae8ba[_0x29a5f1[_0x7976('0x28')]]={'$like':'%'+_0x3a30e3[_0x7976('0x2e')][_0x7976('0x3d')]+'%'};return _0x4ae8ba;}})});}_0x4fb1b5=_[_0x7976('0x3e')]({},_0x4fb1b5,_0x3a30e3['options']);var _0x108199={'where':_0x4fb1b5[_0x7976('0x3a')]};return db[_0x7976('0x2c')]['count'](_0x108199)[_0x7976('0x26')](function(_0x44f084){_0x397742['count']=_0x44f084;if(_0x3a30e3[_0x7976('0x2e')][_0x7976('0x3f')]){_0x4fb1b5['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x4fb1b5);})[_0x7976('0x26')](function(_0x58de77){_0x397742[_0x7976('0x40')]=_0x58de77;return _0x397742;})[_0x7976('0x26')](respondWithFilteredResult(_0xcbc419,_0x4fb1b5))[_0x7976('0x41')](handleError(_0xcbc419,null));};exports['show']=function(_0x18ebd4,_0x3eca58){var _0x2f4196={'raw':![],'where':{'id':_0x18ebd4['params']['id']}},_0x16e705={};_0x16e705[_0x7976('0x32')]=_[_0x7976('0x2f')](db[_0x7976('0x2c')][_0x7976('0x42')]);_0x16e705['query']=_[_0x7976('0x2f')](_0x18ebd4[_0x7976('0x2e')]);_0x16e705[_0x7976('0x30')]=_[_0x7976('0x31')](_0x16e705[_0x7976('0x32')],_0x16e705[_0x7976('0x2e')]);_0x2f4196[_0x7976('0x33')]=_[_0x7976('0x31')](_0x16e705[_0x7976('0x32')],qs[_0x7976('0x34')](_0x18ebd4[_0x7976('0x2e')][_0x7976('0x34')]));_0x2f4196[_0x7976('0x33')]=_0x2f4196[_0x7976('0x33')][_0x7976('0x35')]?_0x2f4196['attributes']:_0x16e705[_0x7976('0x32')];if(_0x18ebd4[_0x7976('0x2e')][_0x7976('0x3f')]){_0x2f4196[_0x7976('0x43')]=[{'all':!![]}];}_0x2f4196=_[_0x7976('0x3e')]({},_0x2f4196,_0x18ebd4[_0x7976('0x44')]);return db['ZendeskConfiguration'][_0x7976('0x45')](_0x2f4196)['then'](handleEntityNotFound(_0x3eca58,null))['then'](respondWithResult(_0x3eca58,null))[_0x7976('0x41')](handleError(_0x3eca58,null));};exports[_0x7976('0x46')]=function(_0x4a34df,_0xdcc7cc){return db['ZendeskConfiguration'][_0x7976('0x46')](_0x4a34df[_0x7976('0x47')],{})[_0x7976('0x26')](respondWithResult(_0xdcc7cc,0xc9))[_0x7976('0x41')](handleError(_0xdcc7cc,null));};exports[_0x7976('0x25')]=function(_0x18bf19,_0x103653){if(_0x18bf19[_0x7976('0x47')]['id']){delete _0x18bf19[_0x7976('0x47')]['id'];}return db[_0x7976('0x2c')][_0x7976('0x45')]({'where':{'id':_0x18bf19[_0x7976('0x48')]['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x103653,null))[_0x7976('0x26')](saveUpdates(_0x18bf19[_0x7976('0x47')],null))[_0x7976('0x26')](respondWithResult(_0x103653,null))['catch'](handleError(_0x103653,null));};exports[_0x7976('0x27')]=function(_0x1115e2,_0x47db88){return db[_0x7976('0x2c')][_0x7976('0x45')]({'where':{'id':_0x1115e2[_0x7976('0x48')]['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x47db88,null))[_0x7976('0x26')](removeEntity(_0x47db88,null))[_0x7976('0x41')](handleError(_0x47db88,null));};exports[_0x7976('0x49')]=function(_0xf82c01,_0x564e1f,_0x1ad1e6){var _0x1cd873={};var _0x312f6a={};var _0x1e5bd9;var _0x2b5809;return db['ZendeskConfiguration'][_0x7976('0x4a')]({'where':{'id':_0xf82c01[_0x7976('0x48')]['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x564e1f,null))[_0x7976('0x26')](function(_0x5a0e92){if(_0x5a0e92){_0x1e5bd9=_0x5a0e92;_0x312f6a[_0x7976('0x32')]=_['keys'](db[_0x7976('0x4b')][_0x7976('0x42')]);_0x312f6a[_0x7976('0x2e')]=_[_0x7976('0x2f')](_0xf82c01[_0x7976('0x2e')]);_0x312f6a['filters']=_['intersection'](_0x312f6a[_0x7976('0x32')],_0x312f6a['query']);_0x1cd873[_0x7976('0x33')]=_['intersection'](_0x312f6a[_0x7976('0x32')],qs[_0x7976('0x34')](_0xf82c01[_0x7976('0x2e')]['fields']));_0x1cd873['attributes']=_0x1cd873['attributes']['length']?_0x1cd873[_0x7976('0x33')]:_0x312f6a[_0x7976('0x32')];_0x1cd873['order']=qs[_0x7976('0x39')](_0xf82c01[_0x7976('0x2e')][_0x7976('0x39')]);_0x1cd873[_0x7976('0x3a')]=qs[_0x7976('0x30')](_[_0x7976('0x3b')](_0xf82c01[_0x7976('0x2e')],_0x312f6a['filters']));if(_0xf82c01['query'][_0x7976('0x3d')]){_0x1cd873['where']=_[_0x7976('0x3e')](_0x1cd873[_0x7976('0x3a')],{'$or':_[_0x7976('0x2b')](_0x1cd873[_0x7976('0x33')],function(_0x423c64){var _0x33f322={};_0x33f322[_0x423c64]={'$like':'%'+_0xf82c01[_0x7976('0x2e')][_0x7976('0x3d')]+'%'};return _0x33f322;})});}_0x1cd873=_['merge']({},_0x1cd873,_0xf82c01[_0x7976('0x44')]);return _0x1e5bd9['getFields'](_0x1cd873);}})[_0x7976('0x26')](function(_0xfcb69a){if(_0xfcb69a){_0x2b5809=_0xfcb69a[_0x7976('0x35')];if(!_0xf82c01['query'][_0x7976('0x36')](_0x7976('0x37'))){_0x1cd873[_0x7976('0x1f')]=qs[_0x7976('0x1f')](_0xf82c01[_0x7976('0x2e')][_0x7976('0x1f')]);_0x1cd873['offset']=qs[_0x7976('0x21')](_0xf82c01[_0x7976('0x2e')][_0x7976('0x21')]);}return _0x1e5bd9[_0x7976('0x49')](_0x1cd873);}})[_0x7976('0x26')](function(_0x50feb9){if(_0x50feb9){return _0x50feb9?{'count':_0x2b5809,'rows':_0x50feb9}:null;}})['then'](respondWithResult(_0x564e1f,null))[_0x7976('0x41')](handleError(_0x564e1f,null));};exports[_0x7976('0x4c')]=function(_0x4811c2,_0x39ab0b,_0x3589c0){var _0x377a46={};var _0x2fa4a0={};var _0x5435b3;var _0xdbe26d;return db['ZendeskConfiguration'][_0x7976('0x4a')]({'where':{'id':_0x4811c2[_0x7976('0x48')]['id']}})['then'](handleEntityNotFound(_0x39ab0b,null))[_0x7976('0x26')](function(_0x2a57ea){if(_0x2a57ea){_0x5435b3=_0x2a57ea;_0x2fa4a0[_0x7976('0x32')]=_[_0x7976('0x2f')](db[_0x7976('0x4b')][_0x7976('0x42')]);_0x2fa4a0['query']=_[_0x7976('0x2f')](_0x4811c2['query']);_0x2fa4a0[_0x7976('0x30')]=_[_0x7976('0x31')](_0x2fa4a0[_0x7976('0x32')],_0x2fa4a0['query']);_0x377a46['attributes']=_[_0x7976('0x31')](_0x2fa4a0[_0x7976('0x32')],qs[_0x7976('0x34')](_0x4811c2['query'][_0x7976('0x34')]));_0x377a46['attributes']=_0x377a46[_0x7976('0x33')][_0x7976('0x35')]?_0x377a46['attributes']:_0x2fa4a0[_0x7976('0x32')];_0x377a46[_0x7976('0x38')]=qs[_0x7976('0x39')](_0x4811c2[_0x7976('0x2e')][_0x7976('0x39')]);_0x377a46[_0x7976('0x3a')]=qs['filters'](_['pick'](_0x4811c2[_0x7976('0x2e')],_0x2fa4a0[_0x7976('0x30')]));if(_0x4811c2[_0x7976('0x2e')][_0x7976('0x3d')]){_0x377a46[_0x7976('0x3a')]=_[_0x7976('0x3e')](_0x377a46[_0x7976('0x3a')],{'$or':_[_0x7976('0x2b')](_0x377a46['attributes'],function(_0x2c523d){var _0xe7468f={};_0xe7468f[_0x2c523d]={'$like':'%'+_0x4811c2[_0x7976('0x2e')][_0x7976('0x3d')]+'%'};return _0xe7468f;})});}_0x377a46=_['merge']({},_0x377a46,_0x4811c2[_0x7976('0x44')]);return _0x5435b3[_0x7976('0x4c')](_0x377a46);}})[_0x7976('0x26')](function(_0x2c41d7){if(_0x2c41d7){_0xdbe26d=_0x2c41d7[_0x7976('0x35')];if(!_0x4811c2[_0x7976('0x2e')][_0x7976('0x36')](_0x7976('0x37'))){_0x377a46[_0x7976('0x1f')]=qs['limit'](_0x4811c2[_0x7976('0x2e')][_0x7976('0x1f')]);_0x377a46[_0x7976('0x21')]=qs[_0x7976('0x21')](_0x4811c2['query'][_0x7976('0x21')]);}return _0x5435b3['getSubjects'](_0x377a46);}})[_0x7976('0x26')](function(_0x3d6421){if(_0x3d6421){return _0x3d6421?{'count':_0xdbe26d,'rows':_0x3d6421}:null;}})[_0x7976('0x26')](respondWithResult(_0x39ab0b,null))[_0x7976('0x41')](handleError(_0x39ab0b,null));};exports['getDescriptions']=function(_0xee8fda,_0x56d5bb,_0x5add9d){var _0x207ae8={};var _0x5b6043={};var _0x42f900;var _0x2e671e;return db[_0x7976('0x2c')]['findOne']({'where':{'id':_0xee8fda['params']['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x56d5bb,null))[_0x7976('0x26')](function(_0x2a6d68){if(_0x2a6d68){_0x42f900=_0x2a6d68;_0x5b6043['model']=_['keys'](db['ZendeskField'][_0x7976('0x42')]);_0x5b6043[_0x7976('0x2e')]=_[_0x7976('0x2f')](_0xee8fda[_0x7976('0x2e')]);_0x5b6043[_0x7976('0x30')]=_[_0x7976('0x31')](_0x5b6043[_0x7976('0x32')],_0x5b6043[_0x7976('0x2e')]);_0x207ae8['attributes']=_[_0x7976('0x31')](_0x5b6043['model'],qs['fields'](_0xee8fda[_0x7976('0x2e')][_0x7976('0x34')]));_0x207ae8['attributes']=_0x207ae8[_0x7976('0x33')][_0x7976('0x35')]?_0x207ae8[_0x7976('0x33')]:_0x5b6043[_0x7976('0x32')];_0x207ae8[_0x7976('0x38')]=qs[_0x7976('0x39')](_0xee8fda[_0x7976('0x2e')][_0x7976('0x39')]);_0x207ae8[_0x7976('0x3a')]=qs['filters'](_[_0x7976('0x3b')](_0xee8fda['query'],_0x5b6043['filters']));if(_0xee8fda[_0x7976('0x2e')][_0x7976('0x3d')]){_0x207ae8['where']=_['merge'](_0x207ae8[_0x7976('0x3a')],{'$or':_['map'](_0x207ae8[_0x7976('0x33')],function(_0x1c448f){var _0x3b3f99={};_0x3b3f99[_0x1c448f]={'$like':'%'+_0xee8fda[_0x7976('0x2e')]['filter']+'%'};return _0x3b3f99;})});}_0x207ae8=_[_0x7976('0x3e')]({},_0x207ae8,_0xee8fda[_0x7976('0x44')]);return _0x42f900[_0x7976('0x4d')](_0x207ae8);}})[_0x7976('0x26')](function(_0x462858){if(_0x462858){_0x2e671e=_0x462858[_0x7976('0x35')];if(!_0xee8fda[_0x7976('0x2e')][_0x7976('0x36')](_0x7976('0x37'))){_0x207ae8['limit']=qs[_0x7976('0x1f')](_0xee8fda[_0x7976('0x2e')][_0x7976('0x1f')]);_0x207ae8[_0x7976('0x21')]=qs['offset'](_0xee8fda[_0x7976('0x2e')][_0x7976('0x21')]);}return _0x42f900[_0x7976('0x4d')](_0x207ae8);}})[_0x7976('0x26')](function(_0x47291c){if(_0x47291c){return _0x47291c?{'count':_0x2e671e,'rows':_0x47291c}:null;}})[_0x7976('0x26')](respondWithResult(_0x56d5bb,null))['catch'](handleError(_0x56d5bb,null));};exports['getTags']=function(_0x3281ff,_0x2ab568,_0x3a5c57){var _0x3acb5e={};var _0x53593f={};var _0x136808;var _0x2d3907;return db['ZendeskConfiguration'][_0x7976('0x4a')]({'where':{'id':_0x3281ff[_0x7976('0x48')]['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x2ab568,null))['then'](function(_0x371462){if(_0x371462){_0x136808=_0x371462;_0x53593f[_0x7976('0x32')]=_[_0x7976('0x2f')](db[_0x7976('0x4e')][_0x7976('0x42')]);_0x53593f[_0x7976('0x2e')]=_[_0x7976('0x2f')](_0x3281ff[_0x7976('0x2e')]);_0x53593f[_0x7976('0x30')]=_[_0x7976('0x31')](_0x53593f[_0x7976('0x32')],_0x53593f['query']);_0x3acb5e[_0x7976('0x33')]=_['intersection'](_0x53593f[_0x7976('0x32')],qs[_0x7976('0x34')](_0x3281ff[_0x7976('0x2e')][_0x7976('0x34')]));_0x3acb5e[_0x7976('0x33')]=_0x3acb5e[_0x7976('0x33')][_0x7976('0x35')]?_0x3acb5e[_0x7976('0x33')]:_0x53593f[_0x7976('0x32')];_0x3acb5e['order']=qs[_0x7976('0x39')](_0x3281ff[_0x7976('0x2e')]['sort']);_0x3acb5e['where']=qs['filters'](_[_0x7976('0x3b')](_0x3281ff[_0x7976('0x2e')],_0x53593f[_0x7976('0x30')]));if(_0x3281ff[_0x7976('0x2e')]['filter']){_0x3acb5e[_0x7976('0x3a')]=_[_0x7976('0x3e')](_0x3acb5e[_0x7976('0x3a')],{'$or':_[_0x7976('0x2b')](_0x3acb5e['attributes'],function(_0xd0e3fe){var _0x423f2b={};_0x423f2b[_0xd0e3fe]={'$like':'%'+_0x3281ff[_0x7976('0x2e')][_0x7976('0x3d')]+'%'};return _0x423f2b;})});}_0x3acb5e=_[_0x7976('0x3e')]({},_0x3acb5e,_0x3281ff['options']);return _0x136808[_0x7976('0x4f')](_0x3acb5e);}})['then'](function(_0x5c410f){if(_0x5c410f){_0x2d3907=_0x5c410f[_0x7976('0x35')];if(!_0x3281ff[_0x7976('0x2e')][_0x7976('0x36')](_0x7976('0x37'))){_0x3acb5e[_0x7976('0x1f')]=qs[_0x7976('0x1f')](_0x3281ff[_0x7976('0x2e')][_0x7976('0x1f')]);_0x3acb5e[_0x7976('0x21')]=qs[_0x7976('0x21')](_0x3281ff[_0x7976('0x2e')][_0x7976('0x21')]);}return _0x136808[_0x7976('0x4f')](_0x3acb5e);}})[_0x7976('0x26')](function(_0x6866){if(_0x6866){return _0x6866?{'count':_0x2d3907,'rows':_0x6866}:null;}})[_0x7976('0x26')](respondWithResult(_0x2ab568,null))[_0x7976('0x41')](handleError(_0x2ab568,null));};exports['setTags']=function(_0x343d5d,_0x112f76,_0x4a4914){if(_0x343d5d[_0x7976('0x47')]['id']){delete _0x343d5d[_0x7976('0x47')]['id'];}return db['ZendeskConfiguration'][_0x7976('0x4a')]({'where':{'id':_0x343d5d[_0x7976('0x48')]['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x112f76,null))[_0x7976('0x26')](function(_0x4f0a49){if(_0x4f0a49){return _0x4f0a49[_0x7976('0x50')](_0x343d5d[_0x7976('0x47')][_0x7976('0x51')]||[]);}return null;})[_0x7976('0x26')](respondWithResult(_0x112f76,null))[_0x7976('0x41')](handleError(_0x112f76,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 96258d4..ea90c4b 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7b4=['path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','api','moment'];(function(_0x3ea18f,_0x115a7f){var _0x4c23da=function(_0x2048e9){while(--_0x2048e9){_0x3ea18f['push'](_0x3ea18f['shift']());}};_0x4c23da(++_0x115a7f);}(_0xf7b4,0x152));var _0x4f7b=function(_0x3f77ab,_0x2f8f33){_0x3f77ab=_0x3f77ab-0x0;var _0x55f51e=_0xf7b4[_0x3f77ab];return _0x55f51e;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x3'));var rimraf=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var attributes=require(_0x4f7b('0x6'));module[_0x4f7b('0x7')]=function(_0x2637f0,_0x427f8b){return _0x2637f0[_0x4f7b('0x8')](_0x4f7b('0x9'),attributes,{'tableName':_0x4f7b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e81=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x4e81,0x1bc));var _0x14e8=function(_0x29f80e,_0x9027ff){_0x29f80e=_0x29f80e-0x0;var _0x5c7eaa=_0x4e81[_0x29f80e];return _0x5c7eaa;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var logger=require(_0x14e8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x14e8('0x3'));var fs=require('fs');var path=require(_0x14e8('0x4'));var rimraf=require(_0x14e8('0x5'));var config=require(_0x14e8('0x6'));var attributes=require(_0x14e8('0x7'));module[_0x14e8('0x8')]=function(_0x56a266,_0x57c79b){return _0x56a266[_0x14e8('0x9')](_0x14e8('0xa'),attributes,{'tableName':_0x14e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 7b56c4b..9c74bfd 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa18=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x1acb9d,_0x2c3834){var _0x3b9c0d=function(_0x4e1acd){while(--_0x4e1acd){_0x1acb9d['push'](_0x1acb9d['shift']());}};_0x3b9c0d(++_0x2c3834);}(_0xfa18,0x64));var _0x8fa1=function(_0x560f41,_0x482d12){_0x560f41=_0x560f41-0x0;var _0x3632d8=_0xfa18[_0x560f41];return _0x3632d8;};'use strict';var _=require(_0x8fa1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8fa1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8fa1('0x2'));var db=require(_0x8fa1('0x3'))['db'];var utils=require(_0x8fa1('0x4'));var logger=require(_0x8fa1('0x5'))('rpc');var config=require(_0x8fa1('0x6'));var jayson=require(_0x8fa1('0x7'));var client=jayson['client'][_0x8fa1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4519de,_0x2ef1d5,_0xecb3ce){return new BPromise(function(_0xb35f4d,_0xd0163a){return client[_0x8fa1('0x9')](_0x4519de,_0xecb3ce)[_0x8fa1('0xa')](function(_0x32d6fd){logger[_0x8fa1('0xb')](_0x8fa1('0xc'),_0x2ef1d5,_0x8fa1('0xd'));logger[_0x8fa1('0xe')](_0x8fa1('0xf'),_0x2ef1d5,'request\x20sent',JSON[_0x8fa1('0x10')](_0x32d6fd));if(_0x32d6fd[_0x8fa1('0x11')]){if(_0x32d6fd['error']['code']===0x1f4){logger['error'](_0x8fa1('0xc'),_0x2ef1d5,_0x32d6fd[_0x8fa1('0x11')][_0x8fa1('0x12')]);return _0xd0163a(_0x32d6fd[_0x8fa1('0x11')][_0x8fa1('0x12')]);}logger[_0x8fa1('0x11')](_0x8fa1('0xc'),_0x2ef1d5,_0x32d6fd[_0x8fa1('0x11')][_0x8fa1('0x12')]);return _0xb35f4d(_0x32d6fd['error']['message']);}else{logger[_0x8fa1('0xb')](_0x8fa1('0xc'),_0x2ef1d5,'request\x20sent');_0xb35f4d(_0x32d6fd[_0x8fa1('0x13')][_0x8fa1('0x12')]);}})['catch'](function(_0x54aa3c){logger[_0x8fa1('0x11')](_0x8fa1('0xc'),_0x2ef1d5,_0x54aa3c);_0xd0163a(_0x54aa3c);});});} \ No newline at end of file +var _0x3465=['randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','ZendeskConfiguration,\x20%s,\x20%s','message','lodash','util','bluebird'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0x3465,0x1c8));var _0x5346=function(_0x40d8ee,_0x122e21){_0x40d8ee=_0x40d8ee-0x0;var _0x5c9d0d=_0x3465[_0x40d8ee];return _0x5c9d0d;};'use strict';var _=require(_0x5346('0x0'));var util=require(_0x5346('0x1'));var moment=require('moment');var BPromise=require(_0x5346('0x2'));var rs=require(_0x5346('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5346('0x4'));var config=require(_0x5346('0x5'));var jayson=require(_0x5346('0x6'));var client=jayson[_0x5346('0x7')][_0x5346('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19fda6,_0x3eb548,_0x3676a7){return new BPromise(function(_0xe92c89,_0xda3c3){return client[_0x5346('0x9')](_0x19fda6,_0x3676a7)[_0x5346('0xa')](function(_0x46c1b1){logger[_0x5346('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3eb548,_0x5346('0xc'));logger['debug'](_0x5346('0xd'),_0x3eb548,_0x5346('0xc'),JSON['stringify'](_0x46c1b1));if(_0x46c1b1[_0x5346('0xe')]){if(_0x46c1b1[_0x5346('0xe')]['code']===0x1f4){logger[_0x5346('0xe')](_0x5346('0xf'),_0x3eb548,_0x46c1b1['error'][_0x5346('0x10')]);return _0xda3c3(_0x46c1b1['error']['message']);}logger[_0x5346('0xe')](_0x5346('0xf'),_0x3eb548,_0x46c1b1[_0x5346('0xe')]['message']);return _0xe92c89(_0x46c1b1['error'][_0x5346('0x10')]);}else{logger[_0x5346('0xb')](_0x5346('0xf'),_0x3eb548,_0x5346('0xc'));_0xe92c89(_0x46c1b1['result']['message']);}})['catch'](function(_0x1ba992){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x3eb548,_0x1ba992);_0xda3c3(_0x1ba992);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 7571a98..0c29948 100644 --- a/server/api/intZendeskField/index.js +++ b/server/api/intZendeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19cf=['exports','util','express','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x19cf,0x1cc));var _0xf19c=function(_0x2d629b,_0x495ac8){_0x2d629b=_0x2d629b-0x0;var _0x1434a0=_0x19cf[_0x2d629b];return _0x1434a0;};'use strict';var multer=require('multer');var util=require(_0xf19c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf19c('0x1'));var router=express['Router']();var fs_extra=require(_0xf19c('0x2'));var auth=require(_0xf19c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf19c('0x4'));var controller=require(_0xf19c('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xf19c('0x6')]);router['get'](_0xf19c('0x7'),auth[_0xf19c('0x8')](),controller[_0xf19c('0x9')]);router[_0xf19c('0xa')]('/',auth[_0xf19c('0x8')](),controller[_0xf19c('0xb')]);router[_0xf19c('0xc')](_0xf19c('0x7'),auth[_0xf19c('0x8')](),controller[_0xf19c('0xd')]);router[_0xf19c('0xe')]('/:id',auth[_0xf19c('0x8')](),controller[_0xf19c('0xf')]);module[_0xf19c('0x10')]=router; \ No newline at end of file +var _0x20a2=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x894b26,_0xed3fa9){var _0x2dd9b4=function(_0x29c8ec){while(--_0x29c8ec){_0x894b26['push'](_0x894b26['shift']());}};_0x2dd9b4(++_0xed3fa9);}(_0x20a2,0x150));var _0x220a=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x20a2[_0x289891];return _0x31cf2e;};'use strict';var multer=require(_0x220a('0x0'));var util=require(_0x220a('0x1'));var path=require(_0x220a('0x2'));var timeout=require('connect-timeout');var express=require(_0x220a('0x3'));var router=express['Router']();var fs_extra=require(_0x220a('0x4'));var auth=require(_0x220a('0x5'));var interaction=require(_0x220a('0x6'));var config=require(_0x220a('0x7'));var controller=require(_0x220a('0x8'));router[_0x220a('0x9')]('/',auth['isAuthenticated'](),controller[_0x220a('0xa')]);router[_0x220a('0x9')](_0x220a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x220a('0xc')]('/',auth[_0x220a('0xd')](),controller[_0x220a('0xe')]);router[_0x220a('0xf')](_0x220a('0xb'),auth[_0x220a('0xd')](),controller[_0x220a('0x10')]);router[_0x220a('0x11')](_0x220a('0xb'),auth['isAuthenticated'](),controller[_0x220a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 7c064a1..1d19f78 100644 --- a/server/api/intZendeskField/intZendeskField.attributes.js +++ b/server/api/intZendeskField/intZendeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4509=['exports','ENUM','string','variable','customVariable','picklist','STRING','sequelize'];(function(_0x516ffb,_0x5b5b42){var _0x319667=function(_0x250098){while(--_0x250098){_0x516ffb['push'](_0x516ffb['shift']());}};_0x319667(++_0x5b5b42);}(_0x4509,0x15f));var _0x9450=function(_0x1063df,_0x1a2627){_0x1063df=_0x1063df-0x0;var _0x469162=_0x4509[_0x1063df];return _0x469162;};'use strict';var Sequelize=require(_0x9450('0x0'));module[_0x9450('0x1')]={'type':{'type':Sequelize[_0x9450('0x2')](_0x9450('0x3'),_0x9450('0x4'),_0x9450('0x5'),'keyValue',_0x9450('0x6')),'defaultValue':_0x9450('0x3')},'content':{'type':Sequelize[_0x9450('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x9450('0x3'),_0x9450('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x9450('0x7')]},'idField':{'type':Sequelize[_0x9450('0x7')]},'nameField':{'type':Sequelize[_0x9450('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9450('0x7')]}}; \ No newline at end of file +var _0x983f=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x1e79fd,_0x24434d){var _0x38766e=function(_0x46a0f4){while(--_0x46a0f4){_0x1e79fd['push'](_0x1e79fd['shift']());}};_0x38766e(++_0x24434d);}(_0x983f,0xff));var _0xf983=function(_0x3f24ae,_0x2122b6){_0x3f24ae=_0x3f24ae-0x0;var _0x13e8b6=_0x983f[_0x3f24ae];return _0x13e8b6;};'use strict';var Sequelize=require(_0xf983('0x0'));module['exports']={'type':{'type':Sequelize[_0xf983('0x1')](_0xf983('0x2'),_0xf983('0x3'),_0xf983('0x4'),_0xf983('0x5'),_0xf983('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf983('0x7')]},'keyType':{'type':Sequelize[_0xf983('0x1')](_0xf983('0x2'),_0xf983('0x3'),_0xf983('0x4'))},'keyContent':{'type':Sequelize[_0xf983('0x7')]},'idField':{'type':Sequelize[_0xf983('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf983('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 87d2d92..4676bea 100644 --- a/server/api/intZendeskField/intZendeskField.controller.js +++ b/server/api/intZendeskField/intZendeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00a6=['../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','save','update','then','destroy','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x00a6,0x1a5));var _0x600a=function(_0x4ee98a,_0x3b458f){_0x4ee98a=_0x4ee98a-0x0;var _0xdd6ea9=_0x00a6[_0x4ee98a];return _0xdd6ea9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x600a('0x0'));var zipdir=require(_0x600a('0x1'));var jsonpatch=require(_0x600a('0x2'));var rp=require(_0x600a('0x3'));var moment=require('moment');var BPromise=require(_0x600a('0x4'));var Mustache=require('mustache');var util=require(_0x600a('0x5'));var path=require(_0x600a('0x6'));var sox=require(_0x600a('0x7'));var csv=require('to-csv');var ejs=require(_0x600a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x600a('0x9'));var squel=require('squel');var crypto=require(_0x600a('0xa'));var jsforce=require(_0x600a('0xb'));var deskjs=require(_0x600a('0xc'));var toCsv=require(_0x600a('0xd'));var querystring=require(_0x600a('0xe'));var Papa=require(_0x600a('0xf'));var Redis=require(_0x600a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x600a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x600a('0x12'))(_0x600a('0x13'));var utils=require(_0x600a('0x14'));var config=require(_0x600a('0x15'));var licenseUtil=require(_0x600a('0x16'));var db=require(_0x600a('0x17'))['db'];function respondWithStatusCode(_0x27abe0,_0x1d6148){_0x1d6148=_0x1d6148||0xcc;return function(_0x38aaef){if(_0x38aaef){return _0x27abe0[_0x600a('0x18')](_0x1d6148);}return _0x27abe0['status'](_0x1d6148)[_0x600a('0x19')]();};}function respondWithResult(_0x584e1b,_0x2ae31a){_0x2ae31a=_0x2ae31a||0xc8;return function(_0x2b3e88){if(_0x2b3e88){return _0x584e1b[_0x600a('0x1a')](_0x2ae31a)[_0x600a('0x1b')](_0x2b3e88);}};}function respondWithFilteredResult(_0x546682,_0x3c77cc){return function(_0x34d3ce){if(_0x34d3ce){var _0x41fc04=typeof _0x3c77cc[_0x600a('0x1c')]==='undefined'&&typeof _0x3c77cc[_0x600a('0x1d')]===_0x600a('0x1e');var _0x49184c=_0x34d3ce[_0x600a('0x1f')];var _0x289673=_0x41fc04?0x0:_0x3c77cc[_0x600a('0x1c')];var _0x411cb9=_0x41fc04?_0x34d3ce[_0x600a('0x1f')]:_0x3c77cc['offset']+_0x3c77cc['limit'];var _0x111b70;if(_0x411cb9>=_0x49184c){_0x411cb9=_0x49184c;_0x111b70=0xc8;}else{_0x111b70=0xce;}_0x546682[_0x600a('0x1a')](_0x111b70);return _0x546682['set'](_0x600a('0x20'),_0x289673+'-'+_0x411cb9+'/'+_0x49184c)[_0x600a('0x1b')](_0x34d3ce);}return null;};}function patchUpdates(_0x49b6c3){return function(_0x6f669){try{jsonpatch['apply'](_0x6f669,_0x49b6c3,!![]);}catch(_0x2c2af){return BPromise['reject'](_0x2c2af);}return _0x6f669[_0x600a('0x21')]();};}function saveUpdates(_0x3bff75,_0x3ebeff){return function(_0x7c28fe){if(_0x7c28fe){return _0x7c28fe[_0x600a('0x22')](_0x3bff75)[_0x600a('0x23')](function(_0x47b31b){return _0x47b31b;});}return null;};}function removeEntity(_0x3bb957,_0x2d78de){return function(_0x567a8d){if(_0x567a8d){return _0x567a8d[_0x600a('0x24')]()[_0x600a('0x23')](function(){_0x3bb957['status'](0xcc)[_0x600a('0x19')]();});}};}function handleEntityNotFound(_0x598559,_0x76c48f){return function(_0x3ee899){if(!_0x3ee899){_0x598559['sendStatus'](0x194);}return _0x3ee899;};}function handleError(_0x48b2bf,_0x35ad30){_0x35ad30=_0x35ad30||0x1f4;return function(_0x21a7f9){logger[_0x600a('0x25')](_0x21a7f9[_0x600a('0x26')]);if(_0x21a7f9['name']){delete _0x21a7f9[_0x600a('0x27')];}_0x48b2bf[_0x600a('0x1a')](_0x35ad30)[_0x600a('0x28')](_0x21a7f9);};}exports['index']=function(_0x39c417,_0x3f8dd4){var _0x2f742e={},_0xfc2a84={},_0x3bb81c={'count':0x0,'rows':[]};var _0x458a82=_[_0x600a('0x29')](db[_0x600a('0x2a')][_0x600a('0x2b')],function(_0x28932e){return{'name':_0x28932e[_0x600a('0x2c')],'type':_0x28932e[_0x600a('0x2d')][_0x600a('0x2e')]};});_0xfc2a84['model']=_[_0x600a('0x29')](_0x458a82,_0x600a('0x27'));_0xfc2a84[_0x600a('0x2f')]=_[_0x600a('0x30')](_0x39c417[_0x600a('0x2f')]);_0xfc2a84[_0x600a('0x31')]=_[_0x600a('0x32')](_0xfc2a84[_0x600a('0x33')],_0xfc2a84[_0x600a('0x2f')]);_0x2f742e[_0x600a('0x34')]=_[_0x600a('0x32')](_0xfc2a84[_0x600a('0x33')],qs[_0x600a('0x35')](_0x39c417[_0x600a('0x2f')][_0x600a('0x35')]));_0x2f742e[_0x600a('0x34')]=_0x2f742e[_0x600a('0x34')]['length']?_0x2f742e[_0x600a('0x34')]:_0xfc2a84[_0x600a('0x33')];if(!_0x39c417[_0x600a('0x2f')][_0x600a('0x36')](_0x600a('0x37'))){_0x2f742e[_0x600a('0x1d')]=qs[_0x600a('0x1d')](_0x39c417[_0x600a('0x2f')]['limit']);_0x2f742e[_0x600a('0x1c')]=qs[_0x600a('0x1c')](_0x39c417[_0x600a('0x2f')][_0x600a('0x1c')]);}_0x2f742e[_0x600a('0x38')]=qs['sort'](_0x39c417['query'][_0x600a('0x39')]);_0x2f742e[_0x600a('0x3a')]=qs[_0x600a('0x31')](_[_0x600a('0x3b')](_0x39c417['query'],_0xfc2a84[_0x600a('0x31')]),_0x458a82);if(_0x39c417['query'][_0x600a('0x3c')]){_0x2f742e['where']=_[_0x600a('0x3d')](_0x2f742e['where'],{'$or':_[_0x600a('0x29')](_0x458a82,function(_0x2516d9){if(_0x2516d9[_0x600a('0x2d')]!==_0x600a('0x3e')){var _0x196744={};_0x196744[_0x2516d9['name']]={'$like':'%'+_0x39c417[_0x600a('0x2f')][_0x600a('0x3c')]+'%'};return _0x196744;}})});}_0x2f742e=_[_0x600a('0x3d')]({},_0x2f742e,_0x39c417[_0x600a('0x3f')]);var _0x315a5f={'where':_0x2f742e[_0x600a('0x3a')]};return db['ZendeskField']['count'](_0x315a5f)[_0x600a('0x23')](function(_0x3182c2){_0x3bb81c[_0x600a('0x1f')]=_0x3182c2;if(_0x39c417[_0x600a('0x2f')][_0x600a('0x40')]){_0x2f742e[_0x600a('0x41')]=[{'all':!![]}];}return db[_0x600a('0x2a')]['findAll'](_0x2f742e);})['then'](function(_0x1ab8f5){_0x3bb81c[_0x600a('0x42')]=_0x1ab8f5;return _0x3bb81c;})[_0x600a('0x23')](respondWithFilteredResult(_0x3f8dd4,_0x2f742e))[_0x600a('0x43')](handleError(_0x3f8dd4,null));};exports[_0x600a('0x44')]=function(_0x330c9e,_0x3b63cc){var _0x10327b={'raw':!![],'where':{'id':_0x330c9e[_0x600a('0x45')]['id']}},_0x5f13c3={};_0x5f13c3[_0x600a('0x33')]=_[_0x600a('0x30')](db[_0x600a('0x2a')][_0x600a('0x2b')]);_0x5f13c3[_0x600a('0x2f')]=_[_0x600a('0x30')](_0x330c9e[_0x600a('0x2f')]);_0x5f13c3[_0x600a('0x31')]=_[_0x600a('0x32')](_0x5f13c3[_0x600a('0x33')],_0x5f13c3[_0x600a('0x2f')]);_0x10327b[_0x600a('0x34')]=_[_0x600a('0x32')](_0x5f13c3['model'],qs[_0x600a('0x35')](_0x330c9e[_0x600a('0x2f')][_0x600a('0x35')]));_0x10327b[_0x600a('0x34')]=_0x10327b[_0x600a('0x34')][_0x600a('0x46')]?_0x10327b['attributes']:_0x5f13c3[_0x600a('0x33')];if(_0x330c9e['query'][_0x600a('0x40')]){_0x10327b[_0x600a('0x41')]=[{'all':!![]}];}_0x10327b=_[_0x600a('0x3d')]({},_0x10327b,_0x330c9e[_0x600a('0x3f')]);return db[_0x600a('0x2a')][_0x600a('0x47')](_0x10327b)[_0x600a('0x23')](handleEntityNotFound(_0x3b63cc,null))[_0x600a('0x23')](respondWithResult(_0x3b63cc,null))[_0x600a('0x43')](handleError(_0x3b63cc,null));};exports['create']=function(_0xa346b,_0x3b4470){return db[_0x600a('0x2a')][_0x600a('0x48')](_0xa346b[_0x600a('0x49')],{})[_0x600a('0x23')](respondWithResult(_0x3b4470,0xc9))[_0x600a('0x43')](handleError(_0x3b4470,null));};exports[_0x600a('0x22')]=function(_0x5c7259,_0x57d94b){if(_0x5c7259[_0x600a('0x49')]['id']){delete _0x5c7259['body']['id'];}return db[_0x600a('0x2a')][_0x600a('0x47')]({'where':{'id':_0x5c7259[_0x600a('0x45')]['id']}})['then'](handleEntityNotFound(_0x57d94b,null))[_0x600a('0x23')](saveUpdates(_0x5c7259['body'],null))[_0x600a('0x23')](respondWithResult(_0x57d94b,null))[_0x600a('0x43')](handleError(_0x57d94b,null));};exports[_0x600a('0x24')]=function(_0x6fe0a9,_0x7c0ca1){return db['ZendeskField'][_0x600a('0x47')]({'where':{'id':_0x6fe0a9[_0x600a('0x45')]['id']}})[_0x600a('0x23')](handleEntityNotFound(_0x7c0ca1,null))[_0x600a('0x23')](removeEntity(_0x7c0ca1,null))[_0x600a('0x43')](handleError(_0x7c0ca1,null));}; \ No newline at end of file +var _0x5e61=['includeAll','rows','catch','show','params','rawAttributes','keys','length','options','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','stack','name','send','index','map','ZendeskField','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','then'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5e61,0xe2));var _0x15e6=function(_0x5a8be1,_0x4ec251){_0x5a8be1=_0x5a8be1-0x0;var _0xbcd0b0=_0x5e61[_0x5a8be1];return _0xbcd0b0;};'use strict';var emlformat=require(_0x15e6('0x0'));var rimraf=require(_0x15e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15e6('0x2'));var rp=require(_0x15e6('0x3'));var moment=require(_0x15e6('0x4'));var BPromise=require(_0x15e6('0x5'));var Mustache=require(_0x15e6('0x6'));var util=require(_0x15e6('0x7'));var path=require(_0x15e6('0x8'));var sox=require(_0x15e6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15e6('0xa'));var _=require(_0x15e6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x15e6('0xc'));var toCsv=require(_0x15e6('0xd'));var querystring=require(_0x15e6('0xe'));var Papa=require(_0x15e6('0xf'));var Redis=require('ioredis');var authService=require(_0x15e6('0x10'));var qs=require(_0x15e6('0x11'));var as=require(_0x15e6('0x12'));var hardwareService=require(_0x15e6('0x13'));var logger=require(_0x15e6('0x14'))(_0x15e6('0x15'));var utils=require(_0x15e6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x15e6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5938a9,_0x4c5914){_0x4c5914=_0x4c5914||0xcc;return function(_0x499d5c){if(_0x499d5c){return _0x5938a9[_0x15e6('0x18')](_0x4c5914);}return _0x5938a9[_0x15e6('0x19')](_0x4c5914)[_0x15e6('0x1a')]();};}function respondWithResult(_0xcd82d7,_0x718ed4){_0x718ed4=_0x718ed4||0xc8;return function(_0x58b04a){if(_0x58b04a){return _0xcd82d7[_0x15e6('0x19')](_0x718ed4)[_0x15e6('0x1b')](_0x58b04a);}};}function respondWithFilteredResult(_0xfaebc0,_0x45a718){return function(_0x2364de){if(_0x2364de){var _0x142ae0=typeof _0x45a718[_0x15e6('0x1c')]===_0x15e6('0x1d')&&typeof _0x45a718[_0x15e6('0x1e')]===_0x15e6('0x1d');var _0x340bc7=_0x2364de[_0x15e6('0x1f')];var _0x3eebc8=_0x142ae0?0x0:_0x45a718[_0x15e6('0x1c')];var _0x3315d3=_0x142ae0?_0x2364de[_0x15e6('0x1f')]:_0x45a718[_0x15e6('0x1c')]+_0x45a718[_0x15e6('0x1e')];var _0x3a7936;if(_0x3315d3>=_0x340bc7){_0x3315d3=_0x340bc7;_0x3a7936=0xc8;}else{_0x3a7936=0xce;}_0xfaebc0[_0x15e6('0x19')](_0x3a7936);return _0xfaebc0['set']('Content-Range',_0x3eebc8+'-'+_0x3315d3+'/'+_0x340bc7)[_0x15e6('0x1b')](_0x2364de);}return null;};}function patchUpdates(_0x472efc){return function(_0x5a5ce9){try{jsonpatch[_0x15e6('0x20')](_0x5a5ce9,_0x472efc,!![]);}catch(_0x369a4b){return BPromise['reject'](_0x369a4b);}return _0x5a5ce9[_0x15e6('0x21')]();};}function saveUpdates(_0x5926a2,_0x251723){return function(_0x309c7f){if(_0x309c7f){return _0x309c7f['update'](_0x5926a2)['then'](function(_0x1c9687){return _0x1c9687;});}return null;};}function removeEntity(_0x32aa46,_0x4af0d1){return function(_0x252de0){if(_0x252de0){return _0x252de0['destroy']()['then'](function(){_0x32aa46[_0x15e6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4602e3,_0x155918){return function(_0x392317){if(!_0x392317){_0x4602e3['sendStatus'](0x194);}return _0x392317;};}function handleError(_0x475e74,_0x1658c1){_0x1658c1=_0x1658c1||0x1f4;return function(_0x20a891){logger['error'](_0x20a891[_0x15e6('0x22')]);if(_0x20a891[_0x15e6('0x23')]){delete _0x20a891[_0x15e6('0x23')];}_0x475e74['status'](_0x1658c1)[_0x15e6('0x24')](_0x20a891);};}exports[_0x15e6('0x25')]=function(_0x50ccef,_0x17d1b3){var _0x4cf324={},_0x380ff3={},_0x47b86f={'count':0x0,'rows':[]};var _0x5d8589=_[_0x15e6('0x26')](db[_0x15e6('0x27')]['rawAttributes'],function(_0x347f12){return{'name':_0x347f12[_0x15e6('0x28')],'type':_0x347f12[_0x15e6('0x29')][_0x15e6('0x2a')]};});_0x380ff3[_0x15e6('0x2b')]=_['map'](_0x5d8589,_0x15e6('0x23'));_0x380ff3['query']=_['keys'](_0x50ccef[_0x15e6('0x2c')]);_0x380ff3['filters']=_[_0x15e6('0x2d')](_0x380ff3['model'],_0x380ff3[_0x15e6('0x2c')]);_0x4cf324[_0x15e6('0x2e')]=_[_0x15e6('0x2d')](_0x380ff3['model'],qs[_0x15e6('0x2f')](_0x50ccef[_0x15e6('0x2c')]['fields']));_0x4cf324[_0x15e6('0x2e')]=_0x4cf324[_0x15e6('0x2e')]['length']?_0x4cf324[_0x15e6('0x2e')]:_0x380ff3[_0x15e6('0x2b')];if(!_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x30')]('nolimit')){_0x4cf324['limit']=qs[_0x15e6('0x1e')](_0x50ccef['query'][_0x15e6('0x1e')]);_0x4cf324['offset']=qs[_0x15e6('0x1c')](_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x1c')]);}_0x4cf324[_0x15e6('0x31')]=qs[_0x15e6('0x32')](_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x32')]);_0x4cf324[_0x15e6('0x33')]=qs[_0x15e6('0x34')](_[_0x15e6('0x35')](_0x50ccef[_0x15e6('0x2c')],_0x380ff3[_0x15e6('0x34')]),_0x5d8589);if(_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x36')]){_0x4cf324[_0x15e6('0x33')]=_[_0x15e6('0x37')](_0x4cf324[_0x15e6('0x33')],{'$or':_[_0x15e6('0x26')](_0x5d8589,function(_0x35bfc0){if(_0x35bfc0[_0x15e6('0x29')]!==_0x15e6('0x38')){var _0x5eefa9={};_0x5eefa9[_0x35bfc0[_0x15e6('0x23')]]={'$like':'%'+_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x36')]+'%'};return _0x5eefa9;}})});}_0x4cf324=_[_0x15e6('0x37')]({},_0x4cf324,_0x50ccef['options']);var _0x2a7887={'where':_0x4cf324[_0x15e6('0x33')]};return db[_0x15e6('0x27')]['count'](_0x2a7887)[_0x15e6('0x39')](function(_0x5d8b8f){_0x47b86f[_0x15e6('0x1f')]=_0x5d8b8f;if(_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x3a')]){_0x4cf324['include']=[{'all':!![]}];}return db[_0x15e6('0x27')]['findAll'](_0x4cf324);})[_0x15e6('0x39')](function(_0xde2486){_0x47b86f[_0x15e6('0x3b')]=_0xde2486;return _0x47b86f;})[_0x15e6('0x39')](respondWithFilteredResult(_0x17d1b3,_0x4cf324))[_0x15e6('0x3c')](handleError(_0x17d1b3,null));};exports[_0x15e6('0x3d')]=function(_0x23c14c,_0x29f4d2){var _0x50135a={'raw':!![],'where':{'id':_0x23c14c[_0x15e6('0x3e')]['id']}},_0x35e309={};_0x35e309[_0x15e6('0x2b')]=_['keys'](db[_0x15e6('0x27')][_0x15e6('0x3f')]);_0x35e309['query']=_[_0x15e6('0x40')](_0x23c14c['query']);_0x35e309[_0x15e6('0x34')]=_[_0x15e6('0x2d')](_0x35e309[_0x15e6('0x2b')],_0x35e309[_0x15e6('0x2c')]);_0x50135a[_0x15e6('0x2e')]=_[_0x15e6('0x2d')](_0x35e309[_0x15e6('0x2b')],qs['fields'](_0x23c14c['query'][_0x15e6('0x2f')]));_0x50135a[_0x15e6('0x2e')]=_0x50135a[_0x15e6('0x2e')][_0x15e6('0x41')]?_0x50135a[_0x15e6('0x2e')]:_0x35e309[_0x15e6('0x2b')];if(_0x23c14c[_0x15e6('0x2c')]['includeAll']){_0x50135a['include']=[{'all':!![]}];}_0x50135a=_[_0x15e6('0x37')]({},_0x50135a,_0x23c14c[_0x15e6('0x42')]);return db[_0x15e6('0x27')][_0x15e6('0x43')](_0x50135a)['then'](handleEntityNotFound(_0x29f4d2,null))[_0x15e6('0x39')](respondWithResult(_0x29f4d2,null))[_0x15e6('0x3c')](handleError(_0x29f4d2,null));};exports['create']=function(_0x324c96,_0x2654a8){return db[_0x15e6('0x27')][_0x15e6('0x44')](_0x324c96[_0x15e6('0x45')],{})[_0x15e6('0x39')](respondWithResult(_0x2654a8,0xc9))[_0x15e6('0x3c')](handleError(_0x2654a8,null));};exports[_0x15e6('0x46')]=function(_0xfc39c2,_0x24d5de){if(_0xfc39c2['body']['id']){delete _0xfc39c2[_0x15e6('0x45')]['id'];}return db[_0x15e6('0x27')]['find']({'where':{'id':_0xfc39c2[_0x15e6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x24d5de,null))[_0x15e6('0x39')](saveUpdates(_0xfc39c2[_0x15e6('0x45')],null))['then'](respondWithResult(_0x24d5de,null))[_0x15e6('0x3c')](handleError(_0x24d5de,null));};exports['destroy']=function(_0x1dfb8d,_0x19c5a3){return db['ZendeskField'][_0x15e6('0x43')]({'where':{'id':_0x1dfb8d[_0x15e6('0x3e')]['id']}})[_0x15e6('0x39')](handleEntityNotFound(_0x19c5a3,null))[_0x15e6('0x39')](removeEntity(_0x19c5a3,null))[_0x15e6('0x3c')](handleError(_0x19c5a3,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 8ce233d..a6fc86c 100644 --- a/server/api/intZendeskField/intZendeskField.model.js +++ b/server/api/intZendeskField/intZendeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a59=['idField','FieldId','util','../../config/logger','bluebird','path','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index'];(function(_0x2a57fa,_0x313220){var _0x20b3c2=function(_0x29cff4){while(--_0x29cff4){_0x2a57fa['push'](_0x2a57fa['shift']());}};_0x20b3c2(++_0x313220);}(_0x0a59,0x182));var _0x90a5=function(_0x13b7ed,_0x30d77e){_0x13b7ed=_0x13b7ed-0x0;var _0x187bea=_0x0a59[_0x13b7ed];return _0x187bea;};'use strict';var _=require('lodash');var util=require(_0x90a5('0x0'));var logger=require(_0x90a5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x90a5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90a5('0x3'));var rimraf=require('rimraf');var config=require(_0x90a5('0x4'));var attributes=require(_0x90a5('0x5'));module[_0x90a5('0x6')]=function(_0xe09bdf,_0x54acc7){return _0xe09bdf[_0x90a5('0x7')]('ZendeskField',attributes,{'tableName':_0x90a5('0x8'),'paranoid':![],'indexes':[{'name':_0x90a5('0x9'),'fields':[_0x90a5('0xa'),_0x90a5('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x039e=['ZendeskField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x039e,0xb8));var _0xe039=function(_0x2df3b3,_0x3e720){_0x2df3b3=_0x2df3b3-0x0;var _0xe19bee=_0x039e[_0x2df3b3];return _0xe19bee;};'use strict';var _=require(_0xe039('0x0'));var util=require('util');var logger=require(_0xe039('0x1'))(_0xe039('0x2'));var moment=require(_0xe039('0x3'));var BPromise=require(_0xe039('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe039('0x5'));var rimraf=require(_0xe039('0x6'));var config=require(_0xe039('0x7'));var attributes=require(_0xe039('0x8'));module[_0xe039('0x9')]=function(_0x853e63,_0x4591a2){return _0x853e63[_0xe039('0xa')](_0xe039('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0xe039('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 98e90df..986bbe8 100644 --- a/server/api/intZendeskField/intZendeskField.rpc.js +++ b/server/api/intZendeskField/intZendeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x029a=['rpc','jayson/promise','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5c2106,_0x579139){var _0x50a56a=function(_0x1cebae){while(--_0x1cebae){_0x5c2106['push'](_0x5c2106['shift']());}};_0x50a56a(++_0x579139);}(_0x029a,0x19c));var _0xa029=function(_0x47bf01,_0x176e4f){_0x47bf01=_0x47bf01-0x0;var _0x26bb85=_0x029a[_0x47bf01];return _0x26bb85;};'use strict';var _=require('lodash');var util=require(_0xa029('0x0'));var moment=require(_0xa029('0x1'));var BPromise=require('bluebird');var rs=require(_0xa029('0x2'));var fs=require('fs');var Redis=require(_0xa029('0x3'));var db=require(_0xa029('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa029('0x5'))(_0xa029('0x6'));var config=require('../../config/environment');var jayson=require(_0xa029('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6f9749,_0x12acaa,_0x3b802f){return new BPromise(function(_0x12e600,_0x5b70dd){return client[_0xa029('0x8')](_0x6f9749,_0x3b802f)[_0xa029('0x9')](function(_0x533ed5){logger[_0xa029('0xa')](_0xa029('0xb'),_0x12acaa,_0xa029('0xc'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x12acaa,_0xa029('0xc'),JSON[_0xa029('0xd')](_0x533ed5));if(_0x533ed5['error']){if(_0x533ed5[_0xa029('0xe')][_0xa029('0xf')]===0x1f4){logger[_0xa029('0xe')](_0xa029('0xb'),_0x12acaa,_0x533ed5[_0xa029('0xe')]['message']);return _0x5b70dd(_0x533ed5[_0xa029('0xe')][_0xa029('0x10')]);}logger[_0xa029('0xe')](_0xa029('0xb'),_0x12acaa,_0x533ed5[_0xa029('0xe')][_0xa029('0x10')]);return _0x12e600(_0x533ed5[_0xa029('0xe')][_0xa029('0x10')]);}else{logger[_0xa029('0xa')]('ZendeskField,\x20%s,\x20%s',_0x12acaa,_0xa029('0xc'));_0x12e600(_0x533ed5[_0xa029('0x11')]['message']);}})[_0xa029('0x12')](function(_0x1f9ffb){logger[_0xa029('0xe')](_0xa029('0xb'),_0x12acaa,_0x1f9ffb);_0x5b70dd(_0x1f9ffb);});});} \ No newline at end of file +var _0x1a08=['http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a08,0x1a5));var _0x81a0=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x1a08[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x81a0('0x0'));var util=require(_0x81a0('0x1'));var moment=require(_0x81a0('0x2'));var BPromise=require(_0x81a0('0x3'));var rs=require(_0x81a0('0x4'));var fs=require('fs');var Redis=require(_0x81a0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x81a0('0x6'));var logger=require(_0x81a0('0x7'))(_0x81a0('0x8'));var config=require(_0x81a0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x81a0('0xa')][_0x81a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1afecc,_0x30943a,_0x12ddac){return new BPromise(function(_0x3193ef,_0x5b3aca){return client[_0x81a0('0xc')](_0x1afecc,_0x12ddac)['then'](function(_0x2ad4ae){logger[_0x81a0('0xd')](_0x81a0('0xe'),_0x30943a,_0x81a0('0xf'));logger[_0x81a0('0x10')](_0x81a0('0x11'),_0x30943a,'request\x20sent',JSON[_0x81a0('0x12')](_0x2ad4ae));if(_0x2ad4ae[_0x81a0('0x13')]){if(_0x2ad4ae[_0x81a0('0x13')][_0x81a0('0x14')]===0x1f4){logger[_0x81a0('0x13')]('ZendeskField,\x20%s,\x20%s',_0x30943a,_0x2ad4ae[_0x81a0('0x13')][_0x81a0('0x15')]);return _0x5b3aca(_0x2ad4ae[_0x81a0('0x13')][_0x81a0('0x15')]);}logger[_0x81a0('0x13')](_0x81a0('0xe'),_0x30943a,_0x2ad4ae[_0x81a0('0x13')]['message']);return _0x3193ef(_0x2ad4ae[_0x81a0('0x13')][_0x81a0('0x15')]);}else{logger[_0x81a0('0xd')](_0x81a0('0xe'),_0x30943a,_0x81a0('0xf'));_0x3193ef(_0x2ad4ae[_0x81a0('0x16')][_0x81a0('0x15')]);}})[_0x81a0('0x17')](function(_0x36f476){logger[_0x81a0('0x13')](_0x81a0('0xe'),_0x30943a,_0x36f476);_0x5b3aca(_0x36f476);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index de71123..9a0358b 100644 --- a/server/api/intZohoAccount/index.js +++ b/server/api/intZohoAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa04e=['Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x146907,_0x541dcb){var _0x47e370=function(_0x1b7984){while(--_0x1b7984){_0x146907['push'](_0x146907['shift']());}};_0x47e370(++_0x541dcb);}(_0xa04e,0x95));var _0xea04=function(_0x450b38,_0x47ed9e){_0x450b38=_0x450b38-0x0;var _0x3d9820=_0xa04e[_0x450b38];return _0x3d9820;};'use strict';var multer=require(_0xea04('0x0'));var util=require(_0xea04('0x1'));var path=require(_0xea04('0x2'));var timeout=require(_0xea04('0x3'));var express=require(_0xea04('0x4'));var router=express[_0xea04('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xea04('0x6'));var interaction=require(_0xea04('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xea04('0x8')](),controller[_0xea04('0x9')]);router[_0xea04('0xa')](_0xea04('0xb'),auth[_0xea04('0x8')](),controller[_0xea04('0xc')]);router[_0xea04('0xa')]('/:id/configurations',auth[_0xea04('0x8')](),controller[_0xea04('0xd')]);router[_0xea04('0xa')](_0xea04('0xe'),auth[_0xea04('0x8')](),controller[_0xea04('0xf')]);router[_0xea04('0x10')]('/',auth[_0xea04('0x8')](),controller[_0xea04('0x11')]);router[_0xea04('0x10')]('/:id/configurations',auth[_0xea04('0x8')](),controller[_0xea04('0x12')]);router[_0xea04('0x13')](_0xea04('0xb'),auth[_0xea04('0x8')](),controller[_0xea04('0x14')]);router['delete'](_0xea04('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xea04('0x15')]=router; \ No newline at end of file +var _0x3037=['/:id','/:id/configurations','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x5b7c79,_0x6c5ada){var _0x2c69a4=function(_0xb4a2dd){while(--_0xb4a2dd){_0x5b7c79['push'](_0x5b7c79['shift']());}};_0x2c69a4(++_0x6c5ada);}(_0x3037,0x126));var _0x7303=function(_0x117f75,_0x524507){_0x117f75=_0x117f75-0x0;var _0x4f7186=_0x3037[_0x117f75];return _0x4f7186;};'use strict';var multer=require(_0x7303('0x0'));var util=require(_0x7303('0x1'));var path=require(_0x7303('0x2'));var timeout=require(_0x7303('0x3'));var express=require('express');var router=express[_0x7303('0x4')]();var fs_extra=require(_0x7303('0x5'));var auth=require(_0x7303('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7303('0x7'));router[_0x7303('0x8')]('/',auth[_0x7303('0x9')](),controller['index']);router[_0x7303('0x8')](_0x7303('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7303('0x8')](_0x7303('0xb'),auth[_0x7303('0x9')](),controller['getConfigurations']);router[_0x7303('0x8')]('/:id/fields',auth[_0x7303('0x9')](),controller[_0x7303('0xc')]);router[_0x7303('0xd')]('/',auth[_0x7303('0x9')](),controller[_0x7303('0xe')]);router['post'](_0x7303('0xb'),auth[_0x7303('0x9')](),controller[_0x7303('0xf')]);router[_0x7303('0x10')](_0x7303('0xa'),auth[_0x7303('0x9')](),controller['update']);router[_0x7303('0x11')](_0x7303('0xa'),auth[_0x7303('0x9')](),controller[_0x7303('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index f6e68ca..303440a 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb903=['exports','STRING','sequelize'];(function(_0x5ed5e4,_0x15d7fc){var _0xcc956a=function(_0x53130a){while(--_0x53130a){_0x5ed5e4['push'](_0x5ed5e4['shift']());}};_0xcc956a(++_0x15d7fc);}(_0xb903,0x185));var _0x3b90=function(_0x2d74b0,_0x18a541){_0x2d74b0=_0x2d74b0-0x0;var _0x559153=_0xb903[_0x2d74b0];return _0x559153;};'use strict';var Sequelize=require(_0x3b90('0x0'));module[_0x3b90('0x1')]={'name':{'type':Sequelize[_0x3b90('0x2')]},'description':{'type':Sequelize[_0x3b90('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x3b90('0x2')]},'clientId':{'type':Sequelize[_0x3b90('0x2')]},'clientSecret':{'type':Sequelize[_0x3b90('0x2')]},'serverUrl':{'type':Sequelize[_0x3b90('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x3b90('0x2')]},'refreshToken':{'type':Sequelize[_0x3b90('0x2')]}}; \ No newline at end of file +var _0x008c=['exports','STRING','sequelize'];(function(_0x20c512,_0x36c198){var _0x25236e=function(_0x418ec3){while(--_0x418ec3){_0x20c512['push'](_0x20c512['shift']());}};_0x25236e(++_0x36c198);}(_0x008c,0x188));var _0xc008=function(_0x5b8155,_0x51c636){_0x5b8155=_0x5b8155-0x0;var _0x1d6f07=_0x008c[_0x5b8155];return _0x1d6f07;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')]},'description':{'type':Sequelize[_0xc008('0x2')]},'host':{'type':Sequelize[_0xc008('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc008('0x2')]},'clientSecret':{'type':Sequelize[_0xc008('0x2')]},'serverUrl':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xc008('0x2')]},'refreshToken':{'type':Sequelize[_0xc008('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6306d2b..22d4fef 100644 --- a/server/api/intZohoAccount/intZohoAccount.controller.js +++ b/server/api/intZohoAccount/intZohoAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5603=['bluebird','util','to-csv','ejs','lodash','squel','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','end','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','length','find','create','body','findOne','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','Call_Duration','Call_Result','Call_Start_Time','api_name','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4de9f3,_0x36fb2c){var _0x2185c2=function(_0x61d004){while(--_0x61d004){_0x4de9f3['push'](_0x4de9f3['shift']());}};_0x2185c2(++_0x36fb2c);}(_0x5603,0xf0));var _0x3560=function(_0x5346ff,_0x3e2ce0){_0x5346ff=_0x5346ff-0x0;var _0x1120d5=_0x5603[_0x5346ff];return _0x1120d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3560('0x0'));var zipdir=require(_0x3560('0x1'));var jsonpatch=require(_0x3560('0x2'));var rp=require(_0x3560('0x3'));var moment=require('moment');var BPromise=require(_0x3560('0x4'));var Mustache=require('mustache');var util=require(_0x3560('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x3560('0x6'));var ejs=require(_0x3560('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3560('0x8'));var squel=require(_0x3560('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3560('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3560('0xb'));var as=require(_0x3560('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3560('0xd'))(_0x3560('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3560('0xf'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3560('0x10'));function respondWithStatusCode(_0x17c5ac,_0xa59143){_0xa59143=_0xa59143||0xcc;return function(_0x5121a9){if(_0x5121a9){return _0x17c5ac['sendStatus'](_0xa59143);}return _0x17c5ac[_0x3560('0x11')](_0xa59143)['end']();};}function respondWithResult(_0x1733d9,_0x2109d6){_0x2109d6=_0x2109d6||0xc8;return function(_0x22e18e){if(_0x22e18e){return _0x1733d9[_0x3560('0x11')](_0x2109d6)[_0x3560('0x12')](_0x22e18e);}};}function respondWithFilteredResult(_0x444b5e,_0xe8994d){return function(_0x45a630){if(_0x45a630){var _0x91dc66=typeof _0xe8994d[_0x3560('0x13')]===_0x3560('0x14')&&typeof _0xe8994d[_0x3560('0x15')]===_0x3560('0x14');var _0x34ec07=_0x45a630[_0x3560('0x16')];var _0x23537d=_0x91dc66?0x0:_0xe8994d['offset'];var _0xc30a7d=_0x91dc66?_0x45a630[_0x3560('0x16')]:_0xe8994d['offset']+_0xe8994d[_0x3560('0x15')];var _0x46190a;if(_0xc30a7d>=_0x34ec07){_0xc30a7d=_0x34ec07;_0x46190a=0xc8;}else{_0x46190a=0xce;}_0x444b5e[_0x3560('0x11')](_0x46190a);return _0x444b5e[_0x3560('0x17')]('Content-Range',_0x23537d+'-'+_0xc30a7d+'/'+_0x34ec07)[_0x3560('0x12')](_0x45a630);}return null;};}function patchUpdates(_0x363f7e){return function(_0x492345){try{jsonpatch[_0x3560('0x18')](_0x492345,_0x363f7e,!![]);}catch(_0xa67c61){return BPromise[_0x3560('0x19')](_0xa67c61);}return _0x492345['save']();};}function saveUpdates(_0x31fb5b,_0x19284c){return function(_0x2f9145){if(_0x2f9145){return _0x2f9145[_0x3560('0x1a')](_0x31fb5b)['then'](function(_0x17f02f){return _0x17f02f;});}return null;};}function removeEntity(_0x215fd9,_0x33dc04){return function(_0x2d39d2){if(_0x2d39d2){return _0x2d39d2[_0x3560('0x1b')]()[_0x3560('0x1c')](function(){_0x215fd9['status'](0xcc)[_0x3560('0x1d')]();});}};}function handleEntityNotFound(_0x16913a,_0x5a9693){return function(_0x2b202d){if(!_0x2b202d){_0x16913a['sendStatus'](0x194);}return _0x2b202d;};}function handleError(_0x13220e,_0x448a1c){_0x448a1c=_0x448a1c||0x1f4;return function(_0xbda4a0){logger[_0x3560('0x1e')](_0xbda4a0[_0x3560('0x1f')]);if(_0xbda4a0['name']){delete _0xbda4a0[_0x3560('0x20')];}_0x13220e[_0x3560('0x11')](_0x448a1c)[_0x3560('0x21')](_0xbda4a0);};}exports[_0x3560('0x22')]=function(_0x101387,_0x4bbb31){var _0x181494={},_0x158c46={},_0x47940d={'count':0x0,'rows':[]};var _0x48826e=_['map'](db[_0x3560('0x23')][_0x3560('0x24')],function(_0x311024){return{'name':_0x311024[_0x3560('0x25')],'type':_0x311024[_0x3560('0x26')][_0x3560('0x27')]};});_0x158c46['model']=_['map'](_0x48826e,_0x3560('0x20'));_0x158c46[_0x3560('0x28')]=_[_0x3560('0x29')](_0x101387[_0x3560('0x28')]);_0x158c46[_0x3560('0x2a')]=_[_0x3560('0x2b')](_0x158c46['model'],_0x158c46[_0x3560('0x28')]);_0x181494[_0x3560('0x2c')]=_[_0x3560('0x2b')](_0x158c46[_0x3560('0x2d')],qs[_0x3560('0x2e')](_0x101387[_0x3560('0x28')][_0x3560('0x2e')]));_0x181494['attributes']=_0x181494[_0x3560('0x2c')]['length']?_0x181494[_0x3560('0x2c')]:_0x158c46[_0x3560('0x2d')];if(!_0x101387['query'][_0x3560('0x2f')](_0x3560('0x30'))){_0x181494[_0x3560('0x15')]=qs[_0x3560('0x15')](_0x101387[_0x3560('0x28')]['limit']);_0x181494['offset']=qs[_0x3560('0x13')](_0x101387[_0x3560('0x28')][_0x3560('0x13')]);}_0x181494[_0x3560('0x31')]=qs['sort'](_0x101387[_0x3560('0x28')][_0x3560('0x32')]);_0x181494[_0x3560('0x33')]=qs[_0x3560('0x2a')](_[_0x3560('0x34')](_0x101387['query'],_0x158c46[_0x3560('0x2a')]),_0x48826e);if(_0x101387[_0x3560('0x28')][_0x3560('0x35')]){_0x181494[_0x3560('0x33')]=_['merge'](_0x181494['where'],{'$or':_[_0x3560('0x36')](_0x48826e,function(_0x206af1){if(_0x206af1[_0x3560('0x26')]!==_0x3560('0x37')){var _0x45d440={};_0x45d440[_0x206af1['name']]={'$like':'%'+_0x101387['query'][_0x3560('0x35')]+'%'};return _0x45d440;}})});}_0x181494=_[_0x3560('0x38')]({},_0x181494,_0x101387[_0x3560('0x39')]);var _0x254fb7={'where':_0x181494[_0x3560('0x33')]};return db[_0x3560('0x23')][_0x3560('0x16')](_0x254fb7)[_0x3560('0x1c')](function(_0x4ce63b){_0x47940d[_0x3560('0x16')]=_0x4ce63b;if(_0x101387[_0x3560('0x28')][_0x3560('0x3a')]){_0x181494[_0x3560('0x3b')]=[{'all':!![]}];}return db[_0x3560('0x23')][_0x3560('0x3c')](_0x181494);})[_0x3560('0x1c')](function(_0x5b8ed2){_0x47940d['rows']=_0x5b8ed2;return _0x47940d;})[_0x3560('0x1c')](respondWithFilteredResult(_0x4bbb31,_0x181494))[_0x3560('0x3d')](handleError(_0x4bbb31,null));};exports['show']=function(_0x340a41,_0x5ba253){var _0x3d357f={'raw':![],'where':{'id':_0x340a41[_0x3560('0x3e')]['id']}},_0xec5c04={};_0xec5c04[_0x3560('0x2d')]=_[_0x3560('0x29')](db[_0x3560('0x23')][_0x3560('0x24')]);_0xec5c04[_0x3560('0x28')]=_['keys'](_0x340a41[_0x3560('0x28')]);_0xec5c04[_0x3560('0x2a')]=_[_0x3560('0x2b')](_0xec5c04['model'],_0xec5c04[_0x3560('0x28')]);_0x3d357f[_0x3560('0x2c')]=_['intersection'](_0xec5c04[_0x3560('0x2d')],qs[_0x3560('0x2e')](_0x340a41['query'][_0x3560('0x2e')]));_0x3d357f[_0x3560('0x2c')]=_0x3d357f[_0x3560('0x2c')][_0x3560('0x3f')]?_0x3d357f[_0x3560('0x2c')]:_0xec5c04[_0x3560('0x2d')];if(_0x340a41[_0x3560('0x28')]['includeAll']){_0x3d357f[_0x3560('0x3b')]=[{'all':!![]}];}_0x3d357f=_[_0x3560('0x38')]({},_0x3d357f,_0x340a41[_0x3560('0x39')]);return db[_0x3560('0x23')][_0x3560('0x40')](_0x3d357f)[_0x3560('0x1c')](handleEntityNotFound(_0x5ba253,null))[_0x3560('0x1c')](respondWithResult(_0x5ba253,null))[_0x3560('0x3d')](handleError(_0x5ba253,null));};exports[_0x3560('0x41')]=function(_0x5046d1,_0x480c78){return db[_0x3560('0x23')][_0x3560('0x41')](_0x5046d1[_0x3560('0x42')],{})['then'](respondWithResult(_0x480c78,0xc9))[_0x3560('0x3d')](handleError(_0x480c78,null));};exports[_0x3560('0x1a')]=function(_0x4f600c,_0x2a72a6){if(_0x4f600c[_0x3560('0x42')]['id']){delete _0x4f600c[_0x3560('0x42')]['id'];}return db['ZohoAccount'][_0x3560('0x40')]({'where':{'id':_0x4f600c['params']['id']}})['then'](handleEntityNotFound(_0x2a72a6,null))[_0x3560('0x1c')](saveUpdates(_0x4f600c['body'],null))['then'](respondWithResult(_0x2a72a6,null))['catch'](handleError(_0x2a72a6,null));};exports[_0x3560('0x1b')]=function(_0x1fc93b,_0x445f15){return db[_0x3560('0x23')][_0x3560('0x40')]({'where':{'id':_0x1fc93b['params']['id']}})[_0x3560('0x1c')](handleEntityNotFound(_0x445f15,null))[_0x3560('0x1c')](removeEntity(_0x445f15,null))['catch'](handleError(_0x445f15,null));};exports['getConfigurations']=function(_0x2b9a16,_0x1ea617,_0x1d0539){var _0x5af30d={};var _0x55a2c7={};var _0x15b396;var _0x152d88;return db[_0x3560('0x23')][_0x3560('0x43')]({'where':{'id':_0x2b9a16['params']['id']}})['then'](handleEntityNotFound(_0x1ea617,null))[_0x3560('0x1c')](function(_0x2ac911){if(_0x2ac911){_0x15b396=_0x2ac911;_0x55a2c7[_0x3560('0x2d')]=_[_0x3560('0x29')](db[_0x3560('0x44')]['rawAttributes']);_0x55a2c7[_0x3560('0x28')]=_['keys'](_0x2b9a16[_0x3560('0x28')]);_0x55a2c7[_0x3560('0x2a')]=_[_0x3560('0x2b')](_0x55a2c7['model'],_0x55a2c7[_0x3560('0x28')]);_0x5af30d[_0x3560('0x2c')]=_[_0x3560('0x2b')](_0x55a2c7[_0x3560('0x2d')],qs[_0x3560('0x2e')](_0x2b9a16['query'][_0x3560('0x2e')]));_0x5af30d[_0x3560('0x2c')]=_0x5af30d[_0x3560('0x2c')][_0x3560('0x3f')]?_0x5af30d[_0x3560('0x2c')]:_0x55a2c7['model'];_0x5af30d[_0x3560('0x31')]=qs[_0x3560('0x32')](_0x2b9a16[_0x3560('0x28')][_0x3560('0x32')]);_0x5af30d[_0x3560('0x33')]=qs[_0x3560('0x2a')](_['pick'](_0x2b9a16[_0x3560('0x28')],_0x55a2c7['filters']));if(_0x2b9a16[_0x3560('0x28')][_0x3560('0x35')]){_0x5af30d[_0x3560('0x33')]=_['merge'](_0x5af30d[_0x3560('0x33')],{'$or':_[_0x3560('0x36')](_0x5af30d[_0x3560('0x2c')],function(_0x17ea15){var _0x2321da={};_0x2321da[_0x17ea15]={'$like':'%'+_0x2b9a16[_0x3560('0x28')]['filter']+'%'};return _0x2321da;})});}_0x5af30d=_['merge']({},_0x5af30d,_0x2b9a16['options']);return _0x15b396['getConfigurations'](_0x5af30d);}})['then'](function(_0x1333c2){if(_0x1333c2){_0x152d88=_0x1333c2['length'];if(!_0x2b9a16[_0x3560('0x28')][_0x3560('0x2f')]('nolimit')){_0x5af30d['limit']=qs[_0x3560('0x15')](_0x2b9a16[_0x3560('0x28')][_0x3560('0x15')]);_0x5af30d[_0x3560('0x13')]=qs['offset'](_0x2b9a16['query']['offset']);}return _0x15b396[_0x3560('0x45')](_0x5af30d);}})[_0x3560('0x1c')](function(_0x495720){if(_0x495720){return _0x495720?{'count':_0x152d88,'rows':_0x495720}:null;}})[_0x3560('0x1c')](respondWithResult(_0x1ea617,null))[_0x3560('0x3d')](handleError(_0x1ea617,null));};exports[_0x3560('0x46')]=function(_0x56a8c0,_0x3009cd,_0x27275a){if(_0x56a8c0[_0x3560('0x42')]['id']){delete _0x56a8c0[_0x3560('0x42')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x56a8c0[_0x3560('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3009cd,null))[_0x3560('0x1c')](function(_0x41ae46){if(_0x41ae46){_0x56a8c0[_0x3560('0x42')][_0x3560('0x47')]=_0x41ae46['id'];_0x56a8c0['body']['Subjects']=integrations[_0x3560('0x48')](_0x56a8c0[_0x3560('0x42')][_0x3560('0x49')],_0x56a8c0[_0x3560('0x42')][_0x3560('0x26')]);_0x56a8c0['body'][_0x3560('0x4a')]=integrations[_0x3560('0x4b')](_0x56a8c0[_0x3560('0x42')]['channel'],_0x56a8c0[_0x3560('0x42')][_0x3560('0x26')]);return db['ZohoConfiguration'][_0x3560('0x41')](_0x56a8c0[_0x3560('0x42')],{'include':[{'model':db[_0x3560('0x4c')],'as':_0x3560('0x4d')},{'model':db[_0x3560('0x4c')],'as':'Descriptions'}]});}return null;})[_0x3560('0x1c')](respondWithResult(_0x3009cd,null))[_0x3560('0x3d')](handleError(_0x3009cd,null));};function getAccessToken(_0xd8f5fa){return new Promise(function(_0x3422dc,_0x2262ac){var _0x1d9cca;switch(_0xd8f5fa[_0x3560('0x4e')]){case'US':_0x1d9cca=_0x3560('0x4f');break;case'AU':_0x1d9cca=_0x3560('0x50');break;case'EU':_0x1d9cca=_0x3560('0x51');break;case'IN':_0x1d9cca=_0x3560('0x52');break;case'CN':_0x1d9cca=_0x3560('0x53');break;default:_0x1d9cca=_0x3560('0x51');break;}var _0x4a86d9={'method':_0x3560('0x54'),'uri':_0x1d9cca+'/oauth/v2/token','qs':{'refresh_token':_0xd8f5fa[_0x3560('0x55')],'client_id':_0xd8f5fa[_0x3560('0x56')],'client_secret':_0xd8f5fa[_0x3560('0x57')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4a86d9)['then'](function(_0x2075d0){if(_0x2075d0[_0x3560('0x58')]){_0x3422dc(_0x2075d0[_0x3560('0x58')]);}else{_0x2262ac(_0x3560('0x59'));}})[_0x3560('0x3d')](function(_0x3ee70){_0x2262ac(_0x3ee70);});});}exports[_0x3560('0x5a')]=function(_0x1f5bed,_0x55bdd7,_0x369b56){var _0x13606d,_0x432fbb,_0x35ba93,_0x4a4950,_0xf458c7;return db[_0x3560('0x23')]['findOne']({'where':{'id':_0x1f5bed[_0x3560('0x3e')]['id']},'attributes':['id',_0x3560('0x5b'),_0x3560('0x4e'),_0x3560('0x56'),_0x3560('0x57'),_0x3560('0x5c'),'code',_0x3560('0x55')]})['then'](handleEntityNotFound(_0x55bdd7,null))[_0x3560('0x1c')](function(_0x55889f){_0xf458c7=_0x55889f;_0x13606d=_0xf458c7['host'];_0x432fbb=_0x13606d===_0x3560('0x5d')?'eu':_0x3560('0x5e');_0x35ba93=_0xf458c7[_0x3560('0x5c')];var _0x364a5e=_0x35ba93[_0x3560('0x5f')](-0x1);if(_0x364a5e==='/'||_0x364a5e==='\x5c'||_0x364a5e===':'){_0x35ba93=_0x35ba93[_0x3560('0x60')](0x0,_0x35ba93[_0x3560('0x61')](_0x364a5e));}if(!_0xf458c7[_0x3560('0x55')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0xf458c7);})[_0x3560('0x1c')](function(_0x26e1de){if(_0x26e1de){return rp({'method':_0x3560('0x62'),'uri':util[_0x3560('0x63')](_0x3560('0x64'),_0x432fbb),'qs':{'module':_0x3560('0x65')},'headers':{'Authorization':_0x3560('0x66')+_0x26e1de},'json':!![]});}})[_0x3560('0x1c')](function(_0x382cc1){if(_0x382cc1){if(_0x382cc1['response']&&_0x382cc1['response'][_0x3560('0x1e')]){throw new Error(_0x382cc1[_0x3560('0x67')][_0x3560('0x1e')][_0x3560('0x68')]);}var _0x142490=[];var _0x2e414a=[];var _0xc380d1=[_0x3560('0x69'),'Subject',_0x3560('0x6a'),'WhoId',_0x3560('0x6b'),_0x3560('0x6c'),_0x3560('0x6d'),'Call_Type'];_0x2e414a=_['remove'](_0x382cc1[_0x3560('0x2e')],function(_0x2d2046){return _0xc380d1['includes'](_0x2d2046[_0x3560('0x6e')]);});for(var _0x4b000c=0x0;_0x4b000c<_0x2e414a['length'];_0x4b000c++){if(_0x2e414a[_0x4b000c][_0x3560('0x6f')]===![]){_0x142490[_0x3560('0x70')]({'id':_0x2e414a[_0x4b000c]['id'],'name':_0x2e414a[_0x4b000c][_0x3560('0x71')],'custom':_0x2e414a[_0x4b000c][_0x3560('0x72')],'options':_0x2e414a[_0x4b000c]['data_type']===_0x3560('0x73')&&_0x2e414a[_0x4b000c]['pick_list_values'][_0x3560('0x3f')]>-0x1?_[_0x3560('0x36')](_0x2e414a[_0x4b000c][_0x3560('0x74')],function(_0x55ca64){return{'name':_0x55ca64,'value':_0x55ca64};}):[]});}}return{'count':_0x142490['length'],'rows':_0x142490};}else{return{'count':0x0,'rows':[]};}})[_0x3560('0x1c')](respondWithResult(_0x55bdd7,null))[_0x3560('0x3d')](function(_0x2ecb56){var _0x4690e5=_0x1f5bed['query']['test']?0x1f4:_0x2ecb56[_0x3560('0x75')]||0x1f4;logger[_0x3560('0x1e')](_0x3560('0x76'),_0x3560('0x5a'),_0x4690e5,JSON[_0x3560('0x77')](_0x2ecb56));delete _0x2ecb56['name'];if(_0x4690e5===0x191){_0x4690e5=0x190;}_0x55bdd7[_0x3560('0x11')](_0x4690e5)[_0x3560('0x21')](_0x1f5bed[_0x3560('0x28')][_0x3560('0x78')]?{'message':_0x3560('0x79'),'statusCode':_0x2ecb56[_0x3560('0x75')]}:_0x2ecb56);});}; \ No newline at end of file +var _0x915f=['response','Owner','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','status','send','index','map','ZohoAccount','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','include','rows','show','params','intersection','includeAll','find','create','body','catch','getConfigurations','findOne','ZohoConfiguration','options','hasOwnProperty','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','refreshToken','zoho.eu','serverUrl','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20'];(function(_0x9a8abd,_0x3b8f22){var _0x269eac=function(_0x346a65){while(--_0x346a65){_0x9a8abd['push'](_0x9a8abd['shift']());}};_0x269eac(++_0x3b8f22);}(_0x915f,0x10e));var _0xf915=function(_0x390118,_0x33ee7d){_0x390118=_0x390118-0x0;var _0x3285b3=_0x915f[_0x390118];return _0x3285b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf915('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf915('0x1'));var Mustache=require(_0xf915('0x2'));var util=require(_0xf915('0x3'));var path=require(_0xf915('0x4'));var sox=require(_0xf915('0x5'));var csv=require(_0xf915('0x6'));var ejs=require(_0xf915('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf915('0x8'));var squel=require(_0xf915('0x9'));var crypto=require('crypto');var jsforce=require(_0xf915('0xa'));var deskjs=require(_0xf915('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf915('0xc'));var Redis=require(_0xf915('0xd'));var authService=require(_0xf915('0xe'));var qs=require(_0xf915('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf915('0x10'));var logger=require(_0xf915('0x11'))(_0xf915('0x12'));var utils=require(_0xf915('0x13'));var config=require(_0xf915('0x14'));var licenseUtil=require(_0xf915('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x25f32c,_0x2b04e2){_0x2b04e2=_0x2b04e2||0xcc;return function(_0x591a1e){if(_0x591a1e){return _0x25f32c[_0xf915('0x16')](_0x2b04e2);}return _0x25f32c['status'](_0x2b04e2)[_0xf915('0x17')]();};}function respondWithResult(_0x285525,_0x318c15){_0x318c15=_0x318c15||0xc8;return function(_0x3ab65a){if(_0x3ab65a){return _0x285525['status'](_0x318c15)['json'](_0x3ab65a);}};}function respondWithFilteredResult(_0x68863c,_0x20c620){return function(_0x1331fa){if(_0x1331fa){var _0x56020b=typeof _0x20c620[_0xf915('0x18')]==='undefined'&&typeof _0x20c620['limit']==='undefined';var _0x49164c=_0x1331fa[_0xf915('0x19')];var _0x4e3c5b=_0x56020b?0x0:_0x20c620[_0xf915('0x18')];var _0x38d36a=_0x56020b?_0x1331fa['count']:_0x20c620['offset']+_0x20c620['limit'];var _0xe0c8e3;if(_0x38d36a>=_0x49164c){_0x38d36a=_0x49164c;_0xe0c8e3=0xc8;}else{_0xe0c8e3=0xce;}_0x68863c['status'](_0xe0c8e3);return _0x68863c[_0xf915('0x1a')](_0xf915('0x1b'),_0x4e3c5b+'-'+_0x38d36a+'/'+_0x49164c)[_0xf915('0x1c')](_0x1331fa);}return null;};}function patchUpdates(_0x229fa4){return function(_0x5924ec){try{jsonpatch[_0xf915('0x1d')](_0x5924ec,_0x229fa4,!![]);}catch(_0x1993e2){return BPromise[_0xf915('0x1e')](_0x1993e2);}return _0x5924ec[_0xf915('0x1f')]();};}function saveUpdates(_0x296030,_0x112112){return function(_0x1461ee){if(_0x1461ee){return _0x1461ee[_0xf915('0x20')](_0x296030)[_0xf915('0x21')](function(_0x30dbaf){return _0x30dbaf;});}return null;};}function removeEntity(_0x1a5c2d,_0x436753){return function(_0x36da89){if(_0x36da89){return _0x36da89[_0xf915('0x22')]()[_0xf915('0x21')](function(){_0x1a5c2d['status'](0xcc)[_0xf915('0x17')]();});}};}function handleEntityNotFound(_0x4b8955,_0x17951b){return function(_0xc128bd){if(!_0xc128bd){_0x4b8955['sendStatus'](0x194);}return _0xc128bd;};}function handleError(_0x255bcd,_0x3e3386){_0x3e3386=_0x3e3386||0x1f4;return function(_0xcded7c){logger[_0xf915('0x23')](_0xcded7c['stack']);if(_0xcded7c[_0xf915('0x24')]){delete _0xcded7c['name'];}_0x255bcd[_0xf915('0x25')](_0x3e3386)[_0xf915('0x26')](_0xcded7c);};}exports[_0xf915('0x27')]=function(_0x3175d9,_0x1658af){var _0x5bb9b3={},_0x24cc04={},_0x4d3568={'count':0x0,'rows':[]};var _0x24aa80=_[_0xf915('0x28')](db[_0xf915('0x29')][_0xf915('0x2a')],function(_0x275c3f){return{'name':_0x275c3f[_0xf915('0x2b')],'type':_0x275c3f['type']['key']};});_0x24cc04[_0xf915('0x2c')]=_[_0xf915('0x28')](_0x24aa80,_0xf915('0x24'));_0x24cc04[_0xf915('0x2d')]=_[_0xf915('0x2e')](_0x3175d9['query']);_0x24cc04[_0xf915('0x2f')]=_['intersection'](_0x24cc04[_0xf915('0x2c')],_0x24cc04['query']);_0x5bb9b3[_0xf915('0x30')]=_['intersection'](_0x24cc04['model'],qs[_0xf915('0x31')](_0x3175d9['query'][_0xf915('0x31')]));_0x5bb9b3['attributes']=_0x5bb9b3['attributes'][_0xf915('0x32')]?_0x5bb9b3['attributes']:_0x24cc04[_0xf915('0x2c')];if(!_0x3175d9['query']['hasOwnProperty'](_0xf915('0x33'))){_0x5bb9b3[_0xf915('0x34')]=qs[_0xf915('0x34')](_0x3175d9['query'][_0xf915('0x34')]);_0x5bb9b3['offset']=qs[_0xf915('0x18')](_0x3175d9['query'][_0xf915('0x18')]);}_0x5bb9b3[_0xf915('0x35')]=qs['sort'](_0x3175d9['query'][_0xf915('0x36')]);_0x5bb9b3[_0xf915('0x37')]=qs[_0xf915('0x2f')](_[_0xf915('0x38')](_0x3175d9[_0xf915('0x2d')],_0x24cc04[_0xf915('0x2f')]),_0x24aa80);if(_0x3175d9[_0xf915('0x2d')][_0xf915('0x39')]){_0x5bb9b3[_0xf915('0x37')]=_[_0xf915('0x3a')](_0x5bb9b3[_0xf915('0x37')],{'$or':_['map'](_0x24aa80,function(_0x3452ed){if(_0x3452ed[_0xf915('0x3b')]!=='VIRTUAL'){var _0x5dace2={};_0x5dace2[_0x3452ed[_0xf915('0x24')]]={'$like':'%'+_0x3175d9[_0xf915('0x2d')][_0xf915('0x39')]+'%'};return _0x5dace2;}})});}_0x5bb9b3=_['merge']({},_0x5bb9b3,_0x3175d9['options']);var _0x1fa2d2={'where':_0x5bb9b3['where']};return db[_0xf915('0x29')]['count'](_0x1fa2d2)[_0xf915('0x21')](function(_0x19b67e){_0x4d3568['count']=_0x19b67e;if(_0x3175d9[_0xf915('0x2d')]['includeAll']){_0x5bb9b3[_0xf915('0x3c')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x5bb9b3);})[_0xf915('0x21')](function(_0x5aa8fe){_0x4d3568[_0xf915('0x3d')]=_0x5aa8fe;return _0x4d3568;})[_0xf915('0x21')](respondWithFilteredResult(_0x1658af,_0x5bb9b3))['catch'](handleError(_0x1658af,null));};exports[_0xf915('0x3e')]=function(_0x146232,_0x3a918d){var _0x13999c={'raw':![],'where':{'id':_0x146232[_0xf915('0x3f')]['id']}},_0x5e4260={};_0x5e4260[_0xf915('0x2c')]=_['keys'](db['ZohoAccount'][_0xf915('0x2a')]);_0x5e4260[_0xf915('0x2d')]=_[_0xf915('0x2e')](_0x146232[_0xf915('0x2d')]);_0x5e4260[_0xf915('0x2f')]=_[_0xf915('0x40')](_0x5e4260['model'],_0x5e4260[_0xf915('0x2d')]);_0x13999c[_0xf915('0x30')]=_[_0xf915('0x40')](_0x5e4260['model'],qs[_0xf915('0x31')](_0x146232[_0xf915('0x2d')][_0xf915('0x31')]));_0x13999c[_0xf915('0x30')]=_0x13999c['attributes']['length']?_0x13999c[_0xf915('0x30')]:_0x5e4260[_0xf915('0x2c')];if(_0x146232[_0xf915('0x2d')][_0xf915('0x41')]){_0x13999c['include']=[{'all':!![]}];}_0x13999c=_['merge']({},_0x13999c,_0x146232['options']);return db[_0xf915('0x29')][_0xf915('0x42')](_0x13999c)[_0xf915('0x21')](handleEntityNotFound(_0x3a918d,null))[_0xf915('0x21')](respondWithResult(_0x3a918d,null))['catch'](handleError(_0x3a918d,null));};exports[_0xf915('0x43')]=function(_0x10d279,_0x3454e0){return db['ZohoAccount'][_0xf915('0x43')](_0x10d279[_0xf915('0x44')],{})[_0xf915('0x21')](respondWithResult(_0x3454e0,0xc9))[_0xf915('0x45')](handleError(_0x3454e0,null));};exports[_0xf915('0x20')]=function(_0x5a72f2,_0x5f5791){if(_0x5a72f2[_0xf915('0x44')]['id']){delete _0x5a72f2['body']['id'];}return db[_0xf915('0x29')][_0xf915('0x42')]({'where':{'id':_0x5a72f2[_0xf915('0x3f')]['id']}})[_0xf915('0x21')](handleEntityNotFound(_0x5f5791,null))['then'](saveUpdates(_0x5a72f2[_0xf915('0x44')],null))[_0xf915('0x21')](respondWithResult(_0x5f5791,null))[_0xf915('0x45')](handleError(_0x5f5791,null));};exports['destroy']=function(_0x154701,_0x958a1b){return db[_0xf915('0x29')][_0xf915('0x42')]({'where':{'id':_0x154701['params']['id']}})[_0xf915('0x21')](handleEntityNotFound(_0x958a1b,null))[_0xf915('0x21')](removeEntity(_0x958a1b,null))['catch'](handleError(_0x958a1b,null));};exports[_0xf915('0x46')]=function(_0x4e14a8,_0x503223,_0x7a5ac6){var _0x413b94={};var _0x4b6014={};var _0x579f66;var _0x51f18;return db['ZohoAccount'][_0xf915('0x47')]({'where':{'id':_0x4e14a8[_0xf915('0x3f')]['id']}})[_0xf915('0x21')](handleEntityNotFound(_0x503223,null))[_0xf915('0x21')](function(_0x4170ce){if(_0x4170ce){_0x579f66=_0x4170ce;_0x4b6014[_0xf915('0x2c')]=_[_0xf915('0x2e')](db[_0xf915('0x48')][_0xf915('0x2a')]);_0x4b6014['query']=_[_0xf915('0x2e')](_0x4e14a8[_0xf915('0x2d')]);_0x4b6014[_0xf915('0x2f')]=_[_0xf915('0x40')](_0x4b6014[_0xf915('0x2c')],_0x4b6014['query']);_0x413b94[_0xf915('0x30')]=_[_0xf915('0x40')](_0x4b6014['model'],qs[_0xf915('0x31')](_0x4e14a8['query'][_0xf915('0x31')]));_0x413b94[_0xf915('0x30')]=_0x413b94[_0xf915('0x30')][_0xf915('0x32')]?_0x413b94[_0xf915('0x30')]:_0x4b6014['model'];_0x413b94[_0xf915('0x35')]=qs[_0xf915('0x36')](_0x4e14a8['query']['sort']);_0x413b94[_0xf915('0x37')]=qs[_0xf915('0x2f')](_[_0xf915('0x38')](_0x4e14a8[_0xf915('0x2d')],_0x4b6014[_0xf915('0x2f')]));if(_0x4e14a8[_0xf915('0x2d')]['filter']){_0x413b94[_0xf915('0x37')]=_['merge'](_0x413b94['where'],{'$or':_[_0xf915('0x28')](_0x413b94['attributes'],function(_0x40bdb6){var _0x279120={};_0x279120[_0x40bdb6]={'$like':'%'+_0x4e14a8[_0xf915('0x2d')][_0xf915('0x39')]+'%'};return _0x279120;})});}_0x413b94=_[_0xf915('0x3a')]({},_0x413b94,_0x4e14a8[_0xf915('0x49')]);return _0x579f66[_0xf915('0x46')](_0x413b94);}})[_0xf915('0x21')](function(_0xc486e4){if(_0xc486e4){_0x51f18=_0xc486e4[_0xf915('0x32')];if(!_0x4e14a8[_0xf915('0x2d')][_0xf915('0x4a')](_0xf915('0x33'))){_0x413b94[_0xf915('0x34')]=qs[_0xf915('0x34')](_0x4e14a8[_0xf915('0x2d')][_0xf915('0x34')]);_0x413b94[_0xf915('0x18')]=qs['offset'](_0x4e14a8[_0xf915('0x2d')][_0xf915('0x18')]);}return _0x579f66[_0xf915('0x46')](_0x413b94);}})[_0xf915('0x21')](function(_0x5edeae){if(_0x5edeae){return _0x5edeae?{'count':_0x51f18,'rows':_0x5edeae}:null;}})[_0xf915('0x21')](respondWithResult(_0x503223,null))[_0xf915('0x45')](handleError(_0x503223,null));};exports['addConfiguration']=function(_0xa47954,_0x21f181,_0x1afad8){if(_0xa47954[_0xf915('0x44')]['id']){delete _0xa47954[_0xf915('0x44')]['id'];}return db[_0xf915('0x29')][_0xf915('0x47')]({'where':{'id':_0xa47954[_0xf915('0x3f')]['id']}})[_0xf915('0x21')](handleEntityNotFound(_0x21f181,null))[_0xf915('0x21')](function(_0x4bf4f9){if(_0x4bf4f9){_0xa47954[_0xf915('0x44')]['AccountId']=_0x4bf4f9['id'];_0xa47954[_0xf915('0x44')][_0xf915('0x4b')]=integrations[_0xf915('0x4c')](_0xa47954[_0xf915('0x44')]['channel'],_0xa47954[_0xf915('0x44')]['type']);_0xa47954['body'][_0xf915('0x4d')]=integrations[_0xf915('0x4e')](_0xa47954[_0xf915('0x44')][_0xf915('0x4f')],_0xa47954['body'][_0xf915('0x3b')]);return db[_0xf915('0x48')]['create'](_0xa47954[_0xf915('0x44')],{'include':[{'model':db[_0xf915('0x50')],'as':_0xf915('0x4b')},{'model':db['ZohoField'],'as':_0xf915('0x4d')}]});}return null;})['then'](respondWithResult(_0x21f181,null))[_0xf915('0x45')](handleError(_0x21f181,null));};function getAccessToken(_0x58e0de){return new Promise(function(_0xf1deaa,_0x45d2f6){var _0x571a7a;switch(_0x58e0de[_0xf915('0x51')]){case'US':_0x571a7a=_0xf915('0x52');break;case'AU':_0x571a7a=_0xf915('0x53');break;case'EU':_0x571a7a=_0xf915('0x54');break;case'IN':_0x571a7a=_0xf915('0x55');break;case'CN':_0x571a7a=_0xf915('0x56');break;default:_0x571a7a=_0xf915('0x54');break;}var _0x3a0cb4={'method':_0xf915('0x57'),'uri':_0x571a7a+'/oauth/v2/token','qs':{'refresh_token':_0x58e0de['refreshToken'],'client_id':_0x58e0de[_0xf915('0x58')],'client_secret':_0x58e0de['clientSecret'],'grant_type':_0xf915('0x59')},'json':!![]};return rp(_0x3a0cb4)['then'](function(_0x2fccfa){if(_0x2fccfa[_0xf915('0x5a')]){_0xf1deaa(_0x2fccfa[_0xf915('0x5a')]);}else{_0x45d2f6(_0xf915('0x5b'));}})[_0xf915('0x45')](function(_0x1b2b57){_0x45d2f6(_0x1b2b57);});});}exports[_0xf915('0x5c')]=function(_0x14f109,_0x41e6b5,_0xa87bc2){var _0x479271,_0x52dbc9,_0xae99dc,_0x1a9391,_0x23ea59;return db[_0xf915('0x29')][_0xf915('0x47')]({'where':{'id':_0x14f109[_0xf915('0x3f')]['id']},'attributes':['id',_0xf915('0x5d'),_0xf915('0x51'),_0xf915('0x58'),_0xf915('0x5e'),'serverUrl','code',_0xf915('0x5f')]})[_0xf915('0x21')](handleEntityNotFound(_0x41e6b5,null))[_0xf915('0x21')](function(_0x15da0b){_0x23ea59=_0x15da0b;_0x479271=_0x23ea59[_0xf915('0x5d')];_0x52dbc9=_0x479271===_0xf915('0x60')?'eu':'com';_0xae99dc=_0x23ea59[_0xf915('0x61')];var _0x53c2e5=_0xae99dc[_0xf915('0x62')](-0x1);if(_0x53c2e5==='/'||_0x53c2e5==='\x5c'||_0x53c2e5===':'){_0xae99dc=_0xae99dc['substring'](0x0,_0xae99dc['lastIndexOf'](_0x53c2e5));}if(!_0x23ea59[_0xf915('0x5f')]){throw new Error(_0xf915('0x63'));}return getAccessToken(_0x23ea59);})[_0xf915('0x21')](function(_0x21ea85){if(_0x21ea85){return rp({'method':_0xf915('0x64'),'uri':util[_0xf915('0x65')](_0xf915('0x66'),_0x52dbc9),'qs':{'module':_0xf915('0x67')},'headers':{'Authorization':_0xf915('0x68')+_0x21ea85},'json':!![]});}})[_0xf915('0x21')](function(_0x4e676a){if(_0x4e676a){if(_0x4e676a[_0xf915('0x69')]&&_0x4e676a[_0xf915('0x69')][_0xf915('0x23')]){throw new Error(_0x4e676a[_0xf915('0x69')]['error']['message']);}var _0x128aed=[];var _0x3ad8ee=[];var _0x1017f7=[_0xf915('0x6a'),'Subject',_0xf915('0x6b'),_0xf915('0x6c'),_0xf915('0x6d'),'Call_Result',_0xf915('0x6e'),_0xf915('0x6f')];_0x3ad8ee=_[_0xf915('0x70')](_0x4e676a[_0xf915('0x31')],function(_0x42a809){return _0x1017f7[_0xf915('0x71')](_0x42a809['api_name']);});for(var _0x5bd56d=0x0;_0x5bd56d<_0x3ad8ee[_0xf915('0x32')];_0x5bd56d++){if(_0x3ad8ee[_0x5bd56d][_0xf915('0x72')]===![]){_0x128aed[_0xf915('0x73')]({'id':_0x3ad8ee[_0x5bd56d]['id'],'name':_0x3ad8ee[_0x5bd56d][_0xf915('0x74')],'custom':_0x3ad8ee[_0x5bd56d][_0xf915('0x75')],'options':_0x3ad8ee[_0x5bd56d][_0xf915('0x76')]===_0xf915('0x77')&&_0x3ad8ee[_0x5bd56d]['pick_list_values'][_0xf915('0x32')]>-0x1?_[_0xf915('0x28')](_0x3ad8ee[_0x5bd56d][_0xf915('0x78')],function(_0x1c7862){return{'name':_0x1c7862,'value':_0x1c7862};}):[]});}}return{'count':_0x128aed['length'],'rows':_0x128aed};}else{return{'count':0x0,'rows':[]};}})[_0xf915('0x21')](respondWithResult(_0x41e6b5,null))['catch'](function(_0x199079){var _0x3d74c2=_0x14f109['query'][_0xf915('0x79')]?0x1f4:_0x199079['statusCode']||0x1f4;logger[_0xf915('0x23')](_0xf915('0x7a'),_0xf915('0x5c'),_0x3d74c2,JSON[_0xf915('0x7b')](_0x199079));delete _0x199079[_0xf915('0x24')];if(_0x3d74c2===0x191){_0x3d74c2=0x190;}_0x41e6b5[_0xf915('0x25')](_0x3d74c2)['send'](_0x14f109[_0xf915('0x2d')][_0xf915('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x199079[_0xf915('0x7c')]}:_0x199079);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 0d60d9b..0f7a82a 100644 --- a/server/api/intZohoAccount/intZohoAccount.model.js +++ b/server/api/intZohoAccount/intZohoAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ce7=['substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','parse','refreshToken','refresh_token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','https://accounts.zoho.eu','then','catch','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','exports','define','ZohoAccount','changed','zone','serverUrl','clientSecret','code','host','slice'];(function(_0xcf0d77,_0x2195aa){var _0x13b05f=function(_0x2e798b){while(--_0x2e798b){_0xcf0d77['push'](_0xcf0d77['shift']());}};_0x13b05f(++_0x2195aa);}(_0x8ce7,0x10c));var _0x78ce=function(_0x4800c4,_0x13b31e){_0x4800c4=_0x4800c4-0x0;var _0x5bd103=_0x8ce7[_0x4800c4];return _0x5bd103;};'use strict';var _=require(_0x78ce('0x0'));var util=require('util');var logger=require(_0x78ce('0x1'))(_0x78ce('0x2'));var moment=require(_0x78ce('0x3'));var BPromise=require(_0x78ce('0x4'));var rp=require(_0x78ce('0x5'));var fs=require('fs');var path=require(_0x78ce('0x6'));var rimraf=require(_0x78ce('0x7'));var config=require('../../config/environment');var attributes=require(_0x78ce('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x78ce('0x9')]=function(_0x4d8ae2,_0x5e605c){return _0x4d8ae2[_0x78ce('0xa')](_0x78ce('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x22d3e7,_0x4ba8ac,_0xd3610){if(_0x22d3e7[_0x78ce('0xc')](_0x78ce('0xd'))||_0x22d3e7[_0x78ce('0xc')](_0x78ce('0xe'))||_0x22d3e7[_0x78ce('0xc')]('clientId')||_0x22d3e7[_0x78ce('0xc')](_0x78ce('0xf'))||_0x22d3e7[_0x78ce('0xc')](_0x78ce('0x10'))||_0x22d3e7[_0x78ce('0xc')](_0x78ce('0x11'))){var _0x5a3633,_0x2a6324;_0x5a3633=_0x22d3e7[_0x78ce('0xe')];var _0x294727=_0x5a3633[_0x78ce('0x12')](-0x1);if(_0x294727==='/'||_0x294727==='\x5c'||_0x294727===':'){_0x5a3633=_0x5a3633[_0x78ce('0x13')](0x0,_0x5a3633['lastIndexOf'](_0x294727));}switch(_0x22d3e7['zone']){case'US':_0x2a6324=_0x78ce('0x14');break;case'AU':_0x2a6324=_0x78ce('0x15');break;case'IN':_0x2a6324=_0x78ce('0x16');break;case'CN':_0x2a6324=_0x78ce('0x17');break;default:_0x2a6324='https://accounts.zoho.eu';break;}var _0x4ba194={'method':_0x78ce('0x18'),'uri':_0x2a6324+_0x78ce('0x19'),'form':{'grant_type':_0x78ce('0x1a'),'client_id':_0x22d3e7[_0x78ce('0x1b')],'client_secret':_0x22d3e7['clientSecret'],'redirect_uri':_0x22d3e7[_0x78ce('0xe')],'code':_0x22d3e7[_0x78ce('0x10')]},'headers':{'Content-Type':_0x78ce('0x1c')}};return rp(_0x4ba194)['then'](function(_0x5ed69c){var _0x4281c3=JSON[_0x78ce('0x1d')](_0x5ed69c);if(_0x4281c3['refresh_token']){_0x22d3e7[_0x78ce('0x1e')]=_0x4281c3[_0x78ce('0x1f')];logger['info'](util['format'](_0x78ce('0x20'),_0x22d3e7[_0x78ce('0x21')],_0x22d3e7['id']));}else{logger[_0x78ce('0x22')](util[_0x78ce('0x23')](_0x78ce('0x24'),_0x22d3e7['name'],_0x22d3e7['id']),util['inspect'](_0x4281c3,{'showHidden':![],'depth':null}));}return _0xd3610(null,_0x4ba8ac);})['catch'](function(_0x22c92b){logger[_0x78ce('0x22')](util[_0x78ce('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x22d3e7[_0x78ce('0x21')],_0x22d3e7['id']),util[_0x78ce('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0xd3610(_0x22c92b);});}else{return _0xd3610(null,_0x4ba8ac);}},'beforeUpdate':function(_0x448027,_0x278f4b,_0x30ce5e){if(_0x448027[_0x78ce('0xc')](_0x78ce('0xd'))||_0x448027['changed'](_0x78ce('0xe'))||_0x448027[_0x78ce('0xc')]('clientId')||_0x448027[_0x78ce('0xc')]('clientSecret')||_0x448027[_0x78ce('0xc')](_0x78ce('0x10'))||_0x448027[_0x78ce('0xc')]('host')){var _0x4340e1,_0x4b6679;_0x4340e1=_0x448027[_0x78ce('0xe')];var _0x140f5d=_0x4340e1[_0x78ce('0x12')](-0x1);if(_0x140f5d==='/'||_0x140f5d==='\x5c'||_0x140f5d===':'){_0x4340e1=_0x4340e1[_0x78ce('0x13')](0x0,_0x4340e1['lastIndexOf'](_0x140f5d));}switch(_0x448027[_0x78ce('0xd')]){case'US':_0x4b6679=_0x78ce('0x14');break;case'AU':_0x4b6679=_0x78ce('0x15');break;case'IN':_0x4b6679='https://accounts.zoho.in';break;case'CN':_0x4b6679=_0x78ce('0x17');break;default:_0x4b6679=_0x78ce('0x26');break;}var _0x2f94bd={'method':_0x78ce('0x18'),'uri':_0x4b6679+_0x78ce('0x19'),'form':{'grant_type':_0x78ce('0x1a'),'client_id':_0x448027[_0x78ce('0x1b')],'client_secret':_0x448027['clientSecret'],'redirect_uri':_0x448027[_0x78ce('0xe')],'code':_0x448027[_0x78ce('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2f94bd)[_0x78ce('0x27')](function(_0xbb6872){var _0x307920=JSON[_0x78ce('0x1d')](_0xbb6872);if(_0x307920[_0x78ce('0x1f')]){_0x448027[_0x78ce('0x1e')]=_0x307920[_0x78ce('0x1f')];logger['info'](util[_0x78ce('0x23')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x448027[_0x78ce('0x21')],_0x448027['id']));}else{logger[_0x78ce('0x22')](util[_0x78ce('0x23')](_0x78ce('0x24'),_0x448027['name'],_0x448027['id']),util[_0x78ce('0x25')](_0x307920,{'showHidden':![],'depth':null}));}return _0x30ce5e(null,_0x278f4b);})[_0x78ce('0x28')](function(_0x4b3934){logger[_0x78ce('0x22')](util[_0x78ce('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x448027['name'],_0x448027['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x30ce5e(_0x4b3934);});}else{return _0x30ce5e(null,_0x278f4b);}}}});}; \ No newline at end of file +var _0x4e67=['slice','substring','https://accounts.zoho.in','then','refreshToken','error','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect'];(function(_0x524b27,_0x45dbdf){var _0x24e32c=function(_0x13856a){while(--_0x13856a){_0x524b27['push'](_0x524b27['shift']());}};_0x24e32c(++_0x45dbdf);}(_0x4e67,0x133));var _0x74e6=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x4e67[_0x3e69ae];return _0x3d7f42;};'use strict';var _=require(_0x74e6('0x0'));var util=require('util');var logger=require(_0x74e6('0x1'))(_0x74e6('0x2'));var moment=require('moment');var BPromise=require(_0x74e6('0x3'));var rp=require(_0x74e6('0x4'));var fs=require('fs');var path=require(_0x74e6('0x5'));var rimraf=require(_0x74e6('0x6'));var config=require('../../config/environment');var attributes=require(_0x74e6('0x7'));var integrations=require(_0x74e6('0x8'));module[_0x74e6('0x9')]=function(_0x4ecc6e,_0x26d92b){return _0x4ecc6e[_0x74e6('0xa')](_0x74e6('0xb'),attributes,{'tableName':_0x74e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3b952b,_0x2c95df,_0x3c41b2){if(_0x3b952b[_0x74e6('0xd')](_0x74e6('0xe'))||_0x3b952b['changed'](_0x74e6('0xf'))||_0x3b952b[_0x74e6('0xd')](_0x74e6('0x10'))||_0x3b952b['changed']('clientSecret')||_0x3b952b['changed'](_0x74e6('0x11'))||_0x3b952b[_0x74e6('0xd')](_0x74e6('0x12'))){var _0x1eae0f,_0x3a67ef;_0x1eae0f=_0x3b952b[_0x74e6('0xf')];var _0x5464d8=_0x1eae0f['slice'](-0x1);if(_0x5464d8==='/'||_0x5464d8==='\x5c'||_0x5464d8===':'){_0x1eae0f=_0x1eae0f['substring'](0x0,_0x1eae0f[_0x74e6('0x13')](_0x5464d8));}switch(_0x3b952b[_0x74e6('0xe')]){case'US':_0x3a67ef=_0x74e6('0x14');break;case'AU':_0x3a67ef=_0x74e6('0x15');break;case'IN':_0x3a67ef='https://accounts.zoho.in';break;case'CN':_0x3a67ef=_0x74e6('0x16');break;default:_0x3a67ef='https://accounts.zoho.eu';break;}var _0x305082={'method':_0x74e6('0x17'),'uri':_0x3a67ef+_0x74e6('0x18'),'form':{'grant_type':_0x74e6('0x19'),'client_id':_0x3b952b[_0x74e6('0x10')],'client_secret':_0x3b952b[_0x74e6('0x1a')],'redirect_uri':_0x3b952b[_0x74e6('0xf')],'code':_0x3b952b[_0x74e6('0x11')]},'headers':{'Content-Type':_0x74e6('0x1b')}};return rp(_0x305082)['then'](function(_0x243187){var _0x51128b=JSON[_0x74e6('0x1c')](_0x243187);if(_0x51128b[_0x74e6('0x1d')]){_0x3b952b['refreshToken']=_0x51128b[_0x74e6('0x1d')];logger[_0x74e6('0x1e')](util[_0x74e6('0x1f')](_0x74e6('0x20'),_0x3b952b[_0x74e6('0x21')],_0x3b952b['id']));}else{logger['error'](util[_0x74e6('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3b952b[_0x74e6('0x21')],_0x3b952b['id']),util['inspect'](_0x51128b,{'showHidden':![],'depth':null}));}return _0x3c41b2(null,_0x2c95df);})[_0x74e6('0x22')](function(_0x490ffa){logger['error'](util[_0x74e6('0x1f')](_0x74e6('0x23'),_0x3b952b[_0x74e6('0x21')],_0x3b952b['id']),util[_0x74e6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3c41b2(_0x490ffa);});}else{return _0x3c41b2(null,_0x2c95df);}},'beforeUpdate':function(_0x503a42,_0x50a7bd,_0xb4faf4){if(_0x503a42['changed'](_0x74e6('0xe'))||_0x503a42[_0x74e6('0xd')](_0x74e6('0xf'))||_0x503a42['changed'](_0x74e6('0x10'))||_0x503a42[_0x74e6('0xd')](_0x74e6('0x1a'))||_0x503a42[_0x74e6('0xd')]('code')||_0x503a42['changed'](_0x74e6('0x12'))){var _0x7a18c6,_0x431a2a;_0x7a18c6=_0x503a42[_0x74e6('0xf')];var _0x23082c=_0x7a18c6[_0x74e6('0x25')](-0x1);if(_0x23082c==='/'||_0x23082c==='\x5c'||_0x23082c===':'){_0x7a18c6=_0x7a18c6[_0x74e6('0x26')](0x0,_0x7a18c6[_0x74e6('0x13')](_0x23082c));}switch(_0x503a42[_0x74e6('0xe')]){case'US':_0x431a2a=_0x74e6('0x14');break;case'AU':_0x431a2a=_0x74e6('0x15');break;case'IN':_0x431a2a=_0x74e6('0x27');break;case'CN':_0x431a2a=_0x74e6('0x16');break;default:_0x431a2a='https://accounts.zoho.eu';break;}var _0x3203d4={'method':_0x74e6('0x17'),'uri':_0x431a2a+_0x74e6('0x18'),'form':{'grant_type':_0x74e6('0x19'),'client_id':_0x503a42['clientId'],'client_secret':_0x503a42[_0x74e6('0x1a')],'redirect_uri':_0x503a42[_0x74e6('0xf')],'code':_0x503a42['code']},'headers':{'Content-Type':_0x74e6('0x1b')}};return rp(_0x3203d4)[_0x74e6('0x28')](function(_0x2fe197){var _0x1d4e2e=JSON[_0x74e6('0x1c')](_0x2fe197);if(_0x1d4e2e[_0x74e6('0x1d')]){_0x503a42[_0x74e6('0x29')]=_0x1d4e2e[_0x74e6('0x1d')];logger[_0x74e6('0x1e')](util[_0x74e6('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x503a42[_0x74e6('0x21')],_0x503a42['id']));}else{logger[_0x74e6('0x2a')](util[_0x74e6('0x1f')](_0x74e6('0x23'),_0x503a42[_0x74e6('0x21')],_0x503a42['id']),util[_0x74e6('0x24')](_0x1d4e2e,{'showHidden':![],'depth':null}));}return _0xb4faf4(null,_0x50a7bd);})[_0x74e6('0x22')](function(_0x574120){logger[_0x74e6('0x2a')](util[_0x74e6('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x503a42[_0x74e6('0x21')],_0x503a42['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0xb4faf4(_0x574120);});}else{return _0xb4faf4(null,_0x50a7bd);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index a59f241..25bec42 100644 --- a/server/api/intZohoAccount/intZohoAccount.rpc.js +++ b/server/api/intZohoAccount/intZohoAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5b6=['info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowZohoAccount','find','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x163ba1,_0x3827ab){_0x163ba1=_0x163ba1-0x0;var _0x57c81e=_0xf5b6[_0x163ba1];return _0x57c81e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6f5b('0x0'));var BPromise=require(_0x6f5b('0x1'));var rs=require(_0x6f5b('0x2'));var fs=require('fs');var Redis=require(_0x6f5b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f5b('0x4'));var logger=require(_0x6f5b('0x5'))(_0x6f5b('0x6'));var config=require(_0x6f5b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f5b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cf395,_0x58899e,_0x4a8fe8){return new BPromise(function(_0x437f27,_0x5b97a4){return client[_0x6f5b('0x9')](_0x5cf395,_0x4a8fe8)[_0x6f5b('0xa')](function(_0x17692b){logger['info'](_0x6f5b('0xb'),_0x58899e,'request\x20sent');logger[_0x6f5b('0xc')](_0x6f5b('0xd'),_0x58899e,_0x6f5b('0xe'),JSON[_0x6f5b('0xf')](_0x17692b));if(_0x17692b[_0x6f5b('0x10')]){if(_0x17692b['error'][_0x6f5b('0x11')]===0x1f4){logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x17692b['error']['message']);return _0x5b97a4(_0x17692b[_0x6f5b('0x10')][_0x6f5b('0x12')]);}logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x17692b[_0x6f5b('0x10')][_0x6f5b('0x12')]);return _0x437f27(_0x17692b[_0x6f5b('0x10')]['message']);}else{logger[_0x6f5b('0x13')](_0x6f5b('0xb'),_0x58899e,'request\x20sent');_0x437f27(_0x17692b[_0x6f5b('0x14')][_0x6f5b('0x12')]);}})[_0x6f5b('0x15')](function(_0x344cf6){logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x344cf6);_0x5b97a4(_0x344cf6);});});}exports[_0x6f5b('0x16')]=function(_0x1d3452){var _0x2cbd40=this;return new Promise(function(_0x377c79,_0x2eab78){return db[_0x6f5b('0x17')][_0x6f5b('0x18')]({'raw':_0x1d3452[_0x6f5b('0x19')]?_0x1d3452['options'][_0x6f5b('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d3452[_0x6f5b('0x19')]?_0x1d3452[_0x6f5b('0x19')][_0x6f5b('0x1b')]||null:null,'attributes':_0x1d3452['options']?_0x1d3452[_0x6f5b('0x19')][_0x6f5b('0x1c')]||null:null,'limit':_0x1d3452['options']?_0x1d3452[_0x6f5b('0x19')][_0x6f5b('0x1d')]||null:null,'include':_0x1d3452[_0x6f5b('0x19')]?_0x1d3452[_0x6f5b('0x19')]['include']?_[_0x6f5b('0x1e')](_0x1d3452[_0x6f5b('0x19')][_0x6f5b('0x1f')],function(_0x1144a2){return{'model':db[_0x1144a2[_0x6f5b('0x20')]],'as':_0x1144a2['as'],'attributes':_0x1144a2[_0x6f5b('0x1c')],'include':_0x1144a2['include']?_['map'](_0x1144a2['include'],function(_0x5932d1){return{'model':db[_0x5932d1['model']],'as':_0x5932d1['as'],'attributes':_0x5932d1['attributes'],'include':_0x5932d1[_0x6f5b('0x1f')]?_['map'](_0x5932d1[_0x6f5b('0x1f')],function(_0x379348){return{'model':db[_0x379348[_0x6f5b('0x20')]],'as':_0x379348['as'],'attributes':_0x379348['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f5b('0xa')](function(_0x13cd9d){logger['info'](_0x6f5b('0x16'),_0x1d3452);logger[_0x6f5b('0xc')]('GetZohoAccount',_0x1d3452,JSON[_0x6f5b('0xf')](_0x13cd9d));_0x377c79(_0x13cd9d);})[_0x6f5b('0x15')](function(_0x56807b){logger['error'](_0x6f5b('0x16'),_0x56807b[_0x6f5b('0x12')],_0x1d3452);_0x2eab78(_0x2cbd40[_0x6f5b('0x10')](0x1f4,_0x56807b[_0x6f5b('0x12')]));});});};exports[_0x6f5b('0x21')]=function(_0x1bd27d){var _0x40aef8=this;return new Promise(function(_0x51d605,_0x16bfde){return db[_0x6f5b('0x17')][_0x6f5b('0x22')]({'raw':_0x1bd27d[_0x6f5b('0x19')]?_0x1bd27d[_0x6f5b('0x19')][_0x6f5b('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bd27d['options']?_0x1bd27d['options'][_0x6f5b('0x1b')]||null:null,'attributes':_0x1bd27d[_0x6f5b('0x19')]?_0x1bd27d[_0x6f5b('0x19')]['attributes']||null:null,'include':_0x1bd27d[_0x6f5b('0x19')]?_0x1bd27d[_0x6f5b('0x19')][_0x6f5b('0x1f')]?_[_0x6f5b('0x1e')](_0x1bd27d[_0x6f5b('0x19')][_0x6f5b('0x1f')],function(_0x5e2d2f){return{'model':db[_0x5e2d2f[_0x6f5b('0x20')]],'as':_0x5e2d2f['as'],'attributes':_0x5e2d2f[_0x6f5b('0x1c')],'include':_0x5e2d2f[_0x6f5b('0x1f')]?_[_0x6f5b('0x1e')](_0x5e2d2f[_0x6f5b('0x1f')],function(_0x4be7b5){return{'model':db[_0x4be7b5[_0x6f5b('0x20')]],'as':_0x4be7b5['as'],'attributes':_0x4be7b5['attributes'],'include':_0x4be7b5[_0x6f5b('0x1f')]?_['map'](_0x4be7b5['include'],function(_0x18025e){return{'model':db[_0x18025e['model']],'as':_0x18025e['as'],'attributes':_0x18025e[_0x6f5b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6f5b('0xa')](function(_0x548903){logger[_0x6f5b('0x13')](_0x6f5b('0x21'),_0x1bd27d);logger[_0x6f5b('0xc')]('ShowZohoAccount',_0x1bd27d,JSON['stringify'](_0x548903));_0x51d605(_0x548903);})[_0x6f5b('0x15')](function(_0x58b207){logger[_0x6f5b('0x10')]('ShowZohoAccount',_0x58b207[_0x6f5b('0x12')],_0x1bd27d);_0x16bfde(_0x40aef8[_0x6f5b('0x10')](0x1f4,_0x58b207[_0x6f5b('0x12')]));});});}; \ No newline at end of file +var _0xd5a2=['error','code','message','catch','ZohoAccount','findAll','options','where','attributes','include','map','model','GetZohoAccount','ShowZohoAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x463697,_0xccfdc4){var _0x33cfe1=function(_0x5c74ec){while(--_0x5c74ec){_0x463697['push'](_0x463697['shift']());}};_0x33cfe1(++_0xccfdc4);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x29ed08,_0x3e673c){_0x29ed08=_0x29ed08-0x0;var _0x4027ad=_0xd5a2[_0x29ed08];return _0x4027ad;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var moment=require(_0x2d5a('0x1'));var BPromise=require(_0x2d5a('0x2'));var rs=require(_0x2d5a('0x3'));var fs=require('fs');var Redis=require(_0x2d5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d5a('0x5'));var logger=require(_0x2d5a('0x6'))(_0x2d5a('0x7'));var config=require(_0x2d5a('0x8'));var jayson=require(_0x2d5a('0x9'));var client=jayson[_0x2d5a('0xa')][_0x2d5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ae103,_0x1cdfc4,_0x7eb4c3){return new BPromise(function(_0x79898c,_0x4d5c52){return client['request'](_0x1ae103,_0x7eb4c3)[_0x2d5a('0xc')](function(_0x562b6a){logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,'request\x20sent');logger[_0x2d5a('0xf')](_0x2d5a('0x10'),_0x1cdfc4,_0x2d5a('0x11'),JSON[_0x2d5a('0x12')](_0x562b6a));if(_0x562b6a[_0x2d5a('0x13')]){if(_0x562b6a['error'][_0x2d5a('0x14')]===0x1f4){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x4d5c52(_0x562b6a['error'][_0x2d5a('0x15')]);}logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x79898c(_0x562b6a[_0x2d5a('0x13')][_0x2d5a('0x15')]);}else{logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,_0x2d5a('0x11'));_0x79898c(_0x562b6a['result'][_0x2d5a('0x15')]);}})[_0x2d5a('0x16')](function(_0x38de62){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x38de62);_0x4d5c52(_0x38de62);});});}exports['GetZohoAccount']=function(_0x454c53){var _0x50f723=this;return new Promise(function(_0x34ae77,_0x29692e){return db[_0x2d5a('0x17')][_0x2d5a('0x18')]({'raw':_0x454c53['options']?_0x454c53['options']['raw']===undefined?!![]:![]:!![],'where':_0x454c53['options']?_0x454c53[_0x2d5a('0x19')][_0x2d5a('0x1a')]||null:null,'attributes':_0x454c53['options']?_0x454c53[_0x2d5a('0x19')][_0x2d5a('0x1b')]||null:null,'limit':_0x454c53[_0x2d5a('0x19')]?_0x454c53[_0x2d5a('0x19')]['limit']||null:null,'include':_0x454c53[_0x2d5a('0x19')]?_0x454c53['options'][_0x2d5a('0x1c')]?_[_0x2d5a('0x1d')](_0x454c53[_0x2d5a('0x19')][_0x2d5a('0x1c')],function(_0x5f1c75){return{'model':db[_0x5f1c75['model']],'as':_0x5f1c75['as'],'attributes':_0x5f1c75['attributes'],'include':_0x5f1c75[_0x2d5a('0x1c')]?_[_0x2d5a('0x1d')](_0x5f1c75[_0x2d5a('0x1c')],function(_0x304b9a){return{'model':db[_0x304b9a[_0x2d5a('0x1e')]],'as':_0x304b9a['as'],'attributes':_0x304b9a[_0x2d5a('0x1b')],'include':_0x304b9a['include']?_[_0x2d5a('0x1d')](_0x304b9a[_0x2d5a('0x1c')],function(_0x24f733){return{'model':db[_0x24f733[_0x2d5a('0x1e')]],'as':_0x24f733['as'],'attributes':_0x24f733[_0x2d5a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2d5a('0xc')](function(_0x4fb606){logger['info'](_0x2d5a('0x1f'),_0x454c53);logger[_0x2d5a('0xf')]('GetZohoAccount',_0x454c53,JSON[_0x2d5a('0x12')](_0x4fb606));_0x34ae77(_0x4fb606);})[_0x2d5a('0x16')](function(_0x199686){logger[_0x2d5a('0x13')](_0x2d5a('0x1f'),_0x199686[_0x2d5a('0x15')],_0x454c53);_0x29692e(_0x50f723[_0x2d5a('0x13')](0x1f4,_0x199686[_0x2d5a('0x15')]));});});};exports[_0x2d5a('0x20')]=function(_0x3e8fda){var _0xf62d6e=this;return new Promise(function(_0x3a55ff,_0x598b61){return db[_0x2d5a('0x17')][_0x2d5a('0x21')]({'raw':_0x3e8fda['options']?_0x3e8fda[_0x2d5a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3e8fda['options']?_0x3e8fda['options']['where']||null:null,'attributes':_0x3e8fda[_0x2d5a('0x19')]?_0x3e8fda['options'][_0x2d5a('0x1b')]||null:null,'include':_0x3e8fda[_0x2d5a('0x19')]?_0x3e8fda['options'][_0x2d5a('0x1c')]?_['map'](_0x3e8fda[_0x2d5a('0x19')][_0x2d5a('0x1c')],function(_0x69f4f){return{'model':db[_0x69f4f['model']],'as':_0x69f4f['as'],'attributes':_0x69f4f[_0x2d5a('0x1b')],'include':_0x69f4f[_0x2d5a('0x1c')]?_['map'](_0x69f4f[_0x2d5a('0x1c')],function(_0x4f0792){return{'model':db[_0x4f0792[_0x2d5a('0x1e')]],'as':_0x4f0792['as'],'attributes':_0x4f0792[_0x2d5a('0x1b')],'include':_0x4f0792[_0x2d5a('0x1c')]?_[_0x2d5a('0x1d')](_0x4f0792[_0x2d5a('0x1c')],function(_0x3e166f){return{'model':db[_0x3e166f[_0x2d5a('0x1e')]],'as':_0x3e166f['as'],'attributes':_0x3e166f[_0x2d5a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2d5a('0xc')](function(_0x31955b){logger[_0x2d5a('0xd')]('ShowZohoAccount',_0x3e8fda);logger[_0x2d5a('0xf')]('ShowZohoAccount',_0x3e8fda,JSON['stringify'](_0x31955b));_0x3a55ff(_0x31955b);})[_0x2d5a('0x16')](function(_0x33c16e){logger[_0x2d5a('0x13')](_0x2d5a('0x20'),_0x33c16e[_0x2d5a('0x15')],_0x3e8fda);_0x598b61(_0xf62d6e[_0x2d5a('0x13')](0x1f4,_0x33c16e['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 2a2150b..23e64a5 100644 --- a/server/api/intZohoConfiguration/index.js +++ b/server/api/intZohoConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c99=['isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c99,0x77));var _0x91c9=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x1c99[_0x313df3];return _0x241d59;};'use strict';var multer=require('multer');var util=require(_0x91c9('0x0'));var path=require(_0x91c9('0x1'));var timeout=require(_0x91c9('0x2'));var express=require(_0x91c9('0x3'));var router=express['Router']();var fs_extra=require(_0x91c9('0x4'));var auth=require(_0x91c9('0x5'));var interaction=require(_0x91c9('0x6'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0x91c9('0x7')](),controller[_0x91c9('0x8')]);router[_0x91c9('0x9')](_0x91c9('0xa'),auth[_0x91c9('0x7')](),controller[_0x91c9('0xb')]);router['get'](_0x91c9('0xc'),auth[_0x91c9('0x7')](),controller[_0x91c9('0xd')]);router[_0x91c9('0x9')]('/:id/subjects',auth[_0x91c9('0x7')](),controller[_0x91c9('0xe')]);router['get'](_0x91c9('0xf'),auth[_0x91c9('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x91c9('0x7')](),controller[_0x91c9('0x10')]);router['put'](_0x91c9('0xa'),auth['isAuthenticated'](),controller[_0x91c9('0x11')]);router[_0x91c9('0x12')](_0x91c9('0xa'),auth[_0x91c9('0x7')](),controller[_0x91c9('0x13')]);module[_0x91c9('0x14')]=router; \ No newline at end of file +var _0x5523=['/:id','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x5a1460,_0x1eadf1){var _0x272674=function(_0x42cbda){while(--_0x42cbda){_0x5a1460['push'](_0x5a1460['shift']());}};_0x272674(++_0x1eadf1);}(_0x5523,0x8f));var _0x3552=function(_0x2b2dac,_0x19b9c9){_0x2b2dac=_0x2b2dac-0x0;var _0x5537c2=_0x5523[_0x2b2dac];return _0x5537c2;};'use strict';var multer=require('multer');var util=require(_0x3552('0x0'));var path=require('path');var timeout=require(_0x3552('0x1'));var express=require(_0x3552('0x2'));var router=express['Router']();var fs_extra=require(_0x3552('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3552('0x4'));var config=require(_0x3552('0x5'));var controller=require(_0x3552('0x6'));router['get']('/',auth[_0x3552('0x7')](),controller[_0x3552('0x8')]);router[_0x3552('0x9')]('/:id',auth[_0x3552('0x7')](),controller['show']);router[_0x3552('0x9')]('/:id/fields',auth[_0x3552('0x7')](),controller[_0x3552('0xa')]);router[_0x3552('0x9')](_0x3552('0xb'),auth[_0x3552('0x7')](),controller[_0x3552('0xc')]);router['get'](_0x3552('0xd'),auth[_0x3552('0x7')](),controller[_0x3552('0xe')]);router[_0x3552('0xf')]('/',auth[_0x3552('0x7')](),controller['create']);router[_0x3552('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3552('0x11'),auth[_0x3552('0x7')](),controller[_0x3552('0x12')]);module[_0x3552('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 07ed814..795e03d 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67d3=['exports','STRING','ENUM','lead','contact','nothing','contact_lead','sequelize'];(function(_0x55b1d5,_0x3e9faa){var _0x701591=function(_0x406036){while(--_0x406036){_0x55b1d5['push'](_0x55b1d5['shift']());}};_0x701591(++_0x3e9faa);}(_0x67d3,0x15f));var _0x367d=function(_0x208cf3,_0x4ffec2){_0x208cf3=_0x208cf3-0x0;var _0x231ae3=_0x67d3[_0x208cf3];return _0x231ae3;};'use strict';var Sequelize=require(_0x367d('0x0'));module[_0x367d('0x1')]={'name':{'type':Sequelize[_0x367d('0x2')]},'moduleCreate':{'type':Sequelize[_0x367d('0x3')](_0x367d('0x4'),_0x367d('0x5'),_0x367d('0x6')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x367d('0x3')](_0x367d('0x7'),_0x367d('0x5'),_0x367d('0x4')),'defaultValue':_0x367d('0x7')},'description':{'type':Sequelize[_0x367d('0x2')]}}; \ No newline at end of file +var _0xec07=['sequelize','exports','ENUM','lead','contact','contact_lead'];(function(_0x676f9b,_0x4ee26d){var _0x42b6fb=function(_0x299c65){while(--_0x299c65){_0x676f9b['push'](_0x676f9b['shift']());}};_0x42b6fb(++_0x4ee26d);}(_0xec07,0x150));var _0x7ec0=function(_0x3a8583,_0x226959){_0x3a8583=_0x3a8583-0x0;var _0x52945b=_0xec07[_0x3a8583];return _0x52945b;};'use strict';var Sequelize=require(_0x7ec0('0x0'));module[_0x7ec0('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x7ec0('0x2')](_0x7ec0('0x3'),_0x7ec0('0x4'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x7ec0('0x2')](_0x7ec0('0x5'),'contact',_0x7ec0('0x3')),'defaultValue':_0x7ec0('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 2207469..1901cd3 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc441=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','ZohoConfiguration','fieldName','type','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','rawAttributes','intersection','include','find','create','body','destroy','params','getFields','findOne','pick','getSubjects','ZohoField','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xc441,0xdf));var _0x1c44=function(_0x29ad4b,_0x4a9a85){_0x29ad4b=_0x29ad4b-0x0;var _0x150652=_0xc441[_0x29ad4b];return _0x150652;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c44('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c44('0x1'));var rp=require(_0x1c44('0x2'));var moment=require(_0x1c44('0x3'));var BPromise=require(_0x1c44('0x4'));var Mustache=require(_0x1c44('0x5'));var util=require(_0x1c44('0x6'));var path=require(_0x1c44('0x7'));var sox=require(_0x1c44('0x8'));var csv=require(_0x1c44('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c44('0xa'));var _=require(_0x1c44('0xb'));var squel=require('squel');var crypto=require(_0x1c44('0xc'));var jsforce=require(_0x1c44('0xd'));var deskjs=require(_0x1c44('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1c44('0xf'));var Papa=require(_0x1c44('0x10'));var Redis=require('ioredis');var authService=require(_0x1c44('0x11'));var qs=require(_0x1c44('0x12'));var as=require(_0x1c44('0x13'));var hardwareService=require(_0x1c44('0x14'));var logger=require(_0x1c44('0x15'))(_0x1c44('0x16'));var utils=require('../../config/utils');var config=require(_0x1c44('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1c44('0x18'))['db'];function respondWithStatusCode(_0xc59b40,_0x1b0e24){_0x1b0e24=_0x1b0e24||0xcc;return function(_0x546d35){if(_0x546d35){return _0xc59b40[_0x1c44('0x19')](_0x1b0e24);}return _0xc59b40['status'](_0x1b0e24)[_0x1c44('0x1a')]();};}function respondWithResult(_0x2a0dd3,_0x117690){_0x117690=_0x117690||0xc8;return function(_0x30e75b){if(_0x30e75b){return _0x2a0dd3[_0x1c44('0x1b')](_0x117690)[_0x1c44('0x1c')](_0x30e75b);}};}function respondWithFilteredResult(_0x1d2a5e,_0xc3b067){return function(_0x54a78b){if(_0x54a78b){var _0x56378e=typeof _0xc3b067['offset']==='undefined'&&typeof _0xc3b067[_0x1c44('0x1d')]===_0x1c44('0x1e');var _0x45555b=_0x54a78b['count'];var _0x2ad5cf=_0x56378e?0x0:_0xc3b067[_0x1c44('0x1f')];var _0x15a0ec=_0x56378e?_0x54a78b[_0x1c44('0x20')]:_0xc3b067['offset']+_0xc3b067['limit'];var _0x20580a;if(_0x15a0ec>=_0x45555b){_0x15a0ec=_0x45555b;_0x20580a=0xc8;}else{_0x20580a=0xce;}_0x1d2a5e[_0x1c44('0x1b')](_0x20580a);return _0x1d2a5e[_0x1c44('0x21')](_0x1c44('0x22'),_0x2ad5cf+'-'+_0x15a0ec+'/'+_0x45555b)['json'](_0x54a78b);}return null;};}function patchUpdates(_0x4b6b37){return function(_0x479949){try{jsonpatch[_0x1c44('0x23')](_0x479949,_0x4b6b37,!![]);}catch(_0x31770d){return BPromise[_0x1c44('0x24')](_0x31770d);}return _0x479949[_0x1c44('0x25')]();};}function saveUpdates(_0x46ff2c,_0x195609){return function(_0x1f3a37){if(_0x1f3a37){return _0x1f3a37[_0x1c44('0x26')](_0x46ff2c)[_0x1c44('0x27')](function(_0xe8f4ed){return _0xe8f4ed;});}return null;};}function removeEntity(_0x10c184,_0x4ec832){return function(_0x577282){if(_0x577282){return _0x577282['destroy']()[_0x1c44('0x27')](function(){_0x10c184[_0x1c44('0x1b')](0xcc)[_0x1c44('0x1a')]();});}};}function handleEntityNotFound(_0x1fec54,_0x10069f){return function(_0x92f972){if(!_0x92f972){_0x1fec54[_0x1c44('0x19')](0x194);}return _0x92f972;};}function handleError(_0x140dfa,_0x8d74bd){_0x8d74bd=_0x8d74bd||0x1f4;return function(_0x5d871b){logger[_0x1c44('0x28')](_0x5d871b[_0x1c44('0x29')]);if(_0x5d871b[_0x1c44('0x2a')]){delete _0x5d871b[_0x1c44('0x2a')];}_0x140dfa[_0x1c44('0x1b')](_0x8d74bd)[_0x1c44('0x2b')](_0x5d871b);};}exports['index']=function(_0xd7a499,_0x4b772b){var _0x1453e3={},_0x569dc0={},_0x441cdb={'count':0x0,'rows':[]};var _0x117298=_[_0x1c44('0x2c')](db[_0x1c44('0x2d')]['rawAttributes'],function(_0xfe262b){return{'name':_0xfe262b[_0x1c44('0x2e')],'type':_0xfe262b[_0x1c44('0x2f')]['key']};});_0x569dc0['model']=_[_0x1c44('0x2c')](_0x117298,_0x1c44('0x2a'));_0x569dc0['query']=_[_0x1c44('0x30')](_0xd7a499[_0x1c44('0x31')]);_0x569dc0[_0x1c44('0x32')]=_['intersection'](_0x569dc0[_0x1c44('0x33')],_0x569dc0[_0x1c44('0x31')]);_0x1453e3[_0x1c44('0x34')]=_['intersection'](_0x569dc0['model'],qs[_0x1c44('0x35')](_0xd7a499[_0x1c44('0x31')][_0x1c44('0x35')]));_0x1453e3['attributes']=_0x1453e3[_0x1c44('0x34')][_0x1c44('0x36')]?_0x1453e3[_0x1c44('0x34')]:_0x569dc0['model'];if(!_0xd7a499[_0x1c44('0x31')][_0x1c44('0x37')](_0x1c44('0x38'))){_0x1453e3['limit']=qs[_0x1c44('0x1d')](_0xd7a499[_0x1c44('0x31')]['limit']);_0x1453e3['offset']=qs[_0x1c44('0x1f')](_0xd7a499[_0x1c44('0x31')][_0x1c44('0x1f')]);}_0x1453e3[_0x1c44('0x39')]=qs['sort'](_0xd7a499[_0x1c44('0x31')][_0x1c44('0x3a')]);_0x1453e3['where']=qs[_0x1c44('0x32')](_['pick'](_0xd7a499[_0x1c44('0x31')],_0x569dc0[_0x1c44('0x32')]),_0x117298);if(_0xd7a499[_0x1c44('0x31')][_0x1c44('0x3b')]){_0x1453e3[_0x1c44('0x3c')]=_[_0x1c44('0x3d')](_0x1453e3[_0x1c44('0x3c')],{'$or':_[_0x1c44('0x2c')](_0x117298,function(_0x16e8fe){if(_0x16e8fe[_0x1c44('0x2f')]!==_0x1c44('0x3e')){var _0x3ac8e9={};_0x3ac8e9[_0x16e8fe[_0x1c44('0x2a')]]={'$like':'%'+_0xd7a499['query']['filter']+'%'};return _0x3ac8e9;}})});}_0x1453e3=_[_0x1c44('0x3d')]({},_0x1453e3,_0xd7a499[_0x1c44('0x3f')]);var _0x1fec46={'where':_0x1453e3[_0x1c44('0x3c')]};return db[_0x1c44('0x2d')][_0x1c44('0x20')](_0x1fec46)['then'](function(_0x160751){_0x441cdb['count']=_0x160751;if(_0xd7a499[_0x1c44('0x31')][_0x1c44('0x40')]){_0x1453e3['include']=[{'all':!![]}];}return db[_0x1c44('0x2d')]['findAll'](_0x1453e3);})[_0x1c44('0x27')](function(_0x54a2c5){_0x441cdb[_0x1c44('0x41')]=_0x54a2c5;return _0x441cdb;})[_0x1c44('0x27')](respondWithFilteredResult(_0x4b772b,_0x1453e3))[_0x1c44('0x42')](handleError(_0x4b772b,null));};exports['show']=function(_0x16e662,_0x3026fb){var _0xe922e0={'raw':![],'where':{'id':_0x16e662['params']['id']}},_0x2ec5ea={};_0x2ec5ea[_0x1c44('0x33')]=_[_0x1c44('0x30')](db[_0x1c44('0x2d')][_0x1c44('0x43')]);_0x2ec5ea[_0x1c44('0x31')]=_['keys'](_0x16e662[_0x1c44('0x31')]);_0x2ec5ea[_0x1c44('0x32')]=_[_0x1c44('0x44')](_0x2ec5ea['model'],_0x2ec5ea[_0x1c44('0x31')]);_0xe922e0['attributes']=_['intersection'](_0x2ec5ea['model'],qs['fields'](_0x16e662['query']['fields']));_0xe922e0['attributes']=_0xe922e0[_0x1c44('0x34')][_0x1c44('0x36')]?_0xe922e0['attributes']:_0x2ec5ea[_0x1c44('0x33')];if(_0x16e662[_0x1c44('0x31')][_0x1c44('0x40')]){_0xe922e0[_0x1c44('0x45')]=[{'all':!![]}];}_0xe922e0=_[_0x1c44('0x3d')]({},_0xe922e0,_0x16e662[_0x1c44('0x3f')]);return db['ZohoConfiguration'][_0x1c44('0x46')](_0xe922e0)[_0x1c44('0x27')](handleEntityNotFound(_0x3026fb,null))[_0x1c44('0x27')](respondWithResult(_0x3026fb,null))[_0x1c44('0x42')](handleError(_0x3026fb,null));};exports[_0x1c44('0x47')]=function(_0x9517f8,_0xce669a){return db[_0x1c44('0x2d')][_0x1c44('0x47')](_0x9517f8[_0x1c44('0x48')],{})[_0x1c44('0x27')](respondWithResult(_0xce669a,0xc9))[_0x1c44('0x42')](handleError(_0xce669a,null));};exports[_0x1c44('0x26')]=function(_0x1741cb,_0xc86fe3){if(_0x1741cb['body']['id']){delete _0x1741cb[_0x1c44('0x48')]['id'];}return db[_0x1c44('0x2d')]['find']({'where':{'id':_0x1741cb['params']['id']}})['then'](handleEntityNotFound(_0xc86fe3,null))[_0x1c44('0x27')](saveUpdates(_0x1741cb[_0x1c44('0x48')],null))[_0x1c44('0x27')](respondWithResult(_0xc86fe3,null))[_0x1c44('0x42')](handleError(_0xc86fe3,null));};exports[_0x1c44('0x49')]=function(_0x5afc89,_0xbfa812){return db[_0x1c44('0x2d')][_0x1c44('0x46')]({'where':{'id':_0x5afc89[_0x1c44('0x4a')]['id']}})[_0x1c44('0x27')](handleEntityNotFound(_0xbfa812,null))[_0x1c44('0x27')](removeEntity(_0xbfa812,null))[_0x1c44('0x42')](handleError(_0xbfa812,null));};exports[_0x1c44('0x4b')]=function(_0x1524dc,_0x191e6c,_0x4e3412){var _0x4e5c80={};var _0x16b870={};var _0x357a86;var _0x330251;return db['ZohoConfiguration'][_0x1c44('0x4c')]({'where':{'id':_0x1524dc[_0x1c44('0x4a')]['id']}})[_0x1c44('0x27')](handleEntityNotFound(_0x191e6c,null))[_0x1c44('0x27')](function(_0x1c3efd){if(_0x1c3efd){_0x357a86=_0x1c3efd;_0x16b870[_0x1c44('0x33')]=_['keys'](db['ZohoField'][_0x1c44('0x43')]);_0x16b870['query']=_[_0x1c44('0x30')](_0x1524dc['query']);_0x16b870[_0x1c44('0x32')]=_[_0x1c44('0x44')](_0x16b870[_0x1c44('0x33')],_0x16b870[_0x1c44('0x31')]);_0x4e5c80[_0x1c44('0x34')]=_[_0x1c44('0x44')](_0x16b870[_0x1c44('0x33')],qs[_0x1c44('0x35')](_0x1524dc[_0x1c44('0x31')]['fields']));_0x4e5c80[_0x1c44('0x34')]=_0x4e5c80[_0x1c44('0x34')][_0x1c44('0x36')]?_0x4e5c80['attributes']:_0x16b870[_0x1c44('0x33')];_0x4e5c80['order']=qs[_0x1c44('0x3a')](_0x1524dc[_0x1c44('0x31')]['sort']);_0x4e5c80[_0x1c44('0x3c')]=qs[_0x1c44('0x32')](_[_0x1c44('0x4d')](_0x1524dc[_0x1c44('0x31')],_0x16b870[_0x1c44('0x32')]));if(_0x1524dc[_0x1c44('0x31')][_0x1c44('0x3b')]){_0x4e5c80['where']=_[_0x1c44('0x3d')](_0x4e5c80[_0x1c44('0x3c')],{'$or':_[_0x1c44('0x2c')](_0x4e5c80[_0x1c44('0x34')],function(_0x4d88d0){var _0x3ba33b={};_0x3ba33b[_0x4d88d0]={'$like':'%'+_0x1524dc['query'][_0x1c44('0x3b')]+'%'};return _0x3ba33b;})});}_0x4e5c80=_['merge']({},_0x4e5c80,_0x1524dc[_0x1c44('0x3f')]);return _0x357a86['getFields'](_0x4e5c80);}})[_0x1c44('0x27')](function(_0x38bac2){if(_0x38bac2){_0x330251=_0x38bac2[_0x1c44('0x36')];if(!_0x1524dc[_0x1c44('0x31')][_0x1c44('0x37')](_0x1c44('0x38'))){_0x4e5c80['limit']=qs['limit'](_0x1524dc[_0x1c44('0x31')][_0x1c44('0x1d')]);_0x4e5c80[_0x1c44('0x1f')]=qs[_0x1c44('0x1f')](_0x1524dc[_0x1c44('0x31')][_0x1c44('0x1f')]);}return _0x357a86['getFields'](_0x4e5c80);}})[_0x1c44('0x27')](function(_0x21b29b){if(_0x21b29b){return _0x21b29b?{'count':_0x330251,'rows':_0x21b29b}:null;}})[_0x1c44('0x27')](respondWithResult(_0x191e6c,null))['catch'](handleError(_0x191e6c,null));};exports[_0x1c44('0x4e')]=function(_0x1db699,_0x492176,_0x43f3e0){var _0x2f022f={};var _0x31b397={};var _0x5e5612;var _0x7ba6a4;return db[_0x1c44('0x2d')][_0x1c44('0x4c')]({'where':{'id':_0x1db699['params']['id']}})[_0x1c44('0x27')](handleEntityNotFound(_0x492176,null))[_0x1c44('0x27')](function(_0x367e1e){if(_0x367e1e){_0x5e5612=_0x367e1e;_0x31b397[_0x1c44('0x33')]=_[_0x1c44('0x30')](db[_0x1c44('0x4f')][_0x1c44('0x43')]);_0x31b397[_0x1c44('0x31')]=_[_0x1c44('0x30')](_0x1db699[_0x1c44('0x31')]);_0x31b397[_0x1c44('0x32')]=_[_0x1c44('0x44')](_0x31b397['model'],_0x31b397[_0x1c44('0x31')]);_0x2f022f[_0x1c44('0x34')]=_[_0x1c44('0x44')](_0x31b397[_0x1c44('0x33')],qs[_0x1c44('0x35')](_0x1db699['query'][_0x1c44('0x35')]));_0x2f022f[_0x1c44('0x34')]=_0x2f022f[_0x1c44('0x34')][_0x1c44('0x36')]?_0x2f022f[_0x1c44('0x34')]:_0x31b397[_0x1c44('0x33')];_0x2f022f[_0x1c44('0x39')]=qs[_0x1c44('0x3a')](_0x1db699[_0x1c44('0x31')][_0x1c44('0x3a')]);_0x2f022f[_0x1c44('0x3c')]=qs[_0x1c44('0x32')](_[_0x1c44('0x4d')](_0x1db699[_0x1c44('0x31')],_0x31b397[_0x1c44('0x32')]));if(_0x1db699[_0x1c44('0x31')][_0x1c44('0x3b')]){_0x2f022f[_0x1c44('0x3c')]=_[_0x1c44('0x3d')](_0x2f022f[_0x1c44('0x3c')],{'$or':_['map'](_0x2f022f['attributes'],function(_0x3a1deb){var _0x2999fe={};_0x2999fe[_0x3a1deb]={'$like':'%'+_0x1db699[_0x1c44('0x31')][_0x1c44('0x3b')]+'%'};return _0x2999fe;})});}_0x2f022f=_[_0x1c44('0x3d')]({},_0x2f022f,_0x1db699[_0x1c44('0x3f')]);return _0x5e5612[_0x1c44('0x4e')](_0x2f022f);}})[_0x1c44('0x27')](function(_0x1a8043){if(_0x1a8043){_0x7ba6a4=_0x1a8043['length'];if(!_0x1db699['query'][_0x1c44('0x37')]('nolimit')){_0x2f022f[_0x1c44('0x1d')]=qs['limit'](_0x1db699[_0x1c44('0x31')][_0x1c44('0x1d')]);_0x2f022f[_0x1c44('0x1f')]=qs[_0x1c44('0x1f')](_0x1db699[_0x1c44('0x31')][_0x1c44('0x1f')]);}return _0x5e5612['getSubjects'](_0x2f022f);}})[_0x1c44('0x27')](function(_0x428dff){if(_0x428dff){return _0x428dff?{'count':_0x7ba6a4,'rows':_0x428dff}:null;}})[_0x1c44('0x27')](respondWithResult(_0x492176,null))[_0x1c44('0x42')](handleError(_0x492176,null));};exports[_0x1c44('0x50')]=function(_0xd6f4f3,_0x5b0bb0,_0x47ce2b){var _0x5d230f={};var _0x1202e5={};var _0x28201f;var _0x163457;return db[_0x1c44('0x2d')][_0x1c44('0x4c')]({'where':{'id':_0xd6f4f3['params']['id']}})['then'](handleEntityNotFound(_0x5b0bb0,null))[_0x1c44('0x27')](function(_0x3d48eb){if(_0x3d48eb){_0x28201f=_0x3d48eb;_0x1202e5['model']=_['keys'](db['ZohoField']['rawAttributes']);_0x1202e5[_0x1c44('0x31')]=_[_0x1c44('0x30')](_0xd6f4f3[_0x1c44('0x31')]);_0x1202e5[_0x1c44('0x32')]=_[_0x1c44('0x44')](_0x1202e5[_0x1c44('0x33')],_0x1202e5[_0x1c44('0x31')]);_0x5d230f['attributes']=_['intersection'](_0x1202e5[_0x1c44('0x33')],qs[_0x1c44('0x35')](_0xd6f4f3[_0x1c44('0x31')][_0x1c44('0x35')]));_0x5d230f[_0x1c44('0x34')]=_0x5d230f[_0x1c44('0x34')][_0x1c44('0x36')]?_0x5d230f[_0x1c44('0x34')]:_0x1202e5[_0x1c44('0x33')];_0x5d230f['order']=qs['sort'](_0xd6f4f3[_0x1c44('0x31')][_0x1c44('0x3a')]);_0x5d230f['where']=qs['filters'](_['pick'](_0xd6f4f3[_0x1c44('0x31')],_0x1202e5[_0x1c44('0x32')]));if(_0xd6f4f3['query']['filter']){_0x5d230f['where']=_['merge'](_0x5d230f[_0x1c44('0x3c')],{'$or':_[_0x1c44('0x2c')](_0x5d230f[_0x1c44('0x34')],function(_0x42aa58){var _0x14e370={};_0x14e370[_0x42aa58]={'$like':'%'+_0xd6f4f3['query']['filter']+'%'};return _0x14e370;})});}_0x5d230f=_['merge']({},_0x5d230f,_0xd6f4f3[_0x1c44('0x3f')]);return _0x28201f[_0x1c44('0x50')](_0x5d230f);}})['then'](function(_0x1d4b53){if(_0x1d4b53){_0x163457=_0x1d4b53[_0x1c44('0x36')];if(!_0xd6f4f3['query'][_0x1c44('0x37')](_0x1c44('0x38'))){_0x5d230f['limit']=qs[_0x1c44('0x1d')](_0xd6f4f3[_0x1c44('0x31')]['limit']);_0x5d230f[_0x1c44('0x1f')]=qs[_0x1c44('0x1f')](_0xd6f4f3[_0x1c44('0x31')][_0x1c44('0x1f')]);}return _0x28201f[_0x1c44('0x50')](_0x5d230f);}})[_0x1c44('0x27')](function(_0x24cc4c){if(_0x24cc4c){return _0x24cc4c?{'count':_0x163457,'rows':_0x24cc4c}:null;}})[_0x1c44('0x27')](respondWithResult(_0x5b0bb0,null))[_0x1c44('0x42')](handleError(_0x5b0bb0,null));}; \ No newline at end of file +var _0x5f89=['jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','send','map','ZohoConfiguration','rawAttributes','fieldName','type','model','name','keys','query','intersection','fields','attributes','hasOwnProperty','sort','where','filters','merge','VIRTUAL','includeAll','include','rows','catch','show','params','length','options','find','body','destroy','findOne','ZohoField','filter','getFields','nolimit','getSubjects','order','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto'];(function(_0x5d7f7e,_0x33cc3f){var _0x162544=function(_0x50fdd2){while(--_0x50fdd2){_0x5d7f7e['push'](_0x5d7f7e['shift']());}};_0x162544(++_0x33cc3f);}(_0x5f89,0x1cc));var _0x95f8=function(_0x1a165d,_0x4083c6){_0x1a165d=_0x1a165d-0x0;var _0x302744=_0x5f89[_0x1a165d];return _0x302744;};'use strict';var emlformat=require(_0x95f8('0x0'));var rimraf=require(_0x95f8('0x1'));var zipdir=require(_0x95f8('0x2'));var jsonpatch=require(_0x95f8('0x3'));var rp=require(_0x95f8('0x4'));var moment=require(_0x95f8('0x5'));var BPromise=require(_0x95f8('0x6'));var Mustache=require(_0x95f8('0x7'));var util=require('util');var path=require(_0x95f8('0x8'));var sox=require(_0x95f8('0x9'));var csv=require(_0x95f8('0xa'));var ejs=require(_0x95f8('0xb'));var fs=require('fs');var fs_extra=require(_0x95f8('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x95f8('0xd'));var jsforce=require(_0x95f8('0xe'));var deskjs=require(_0x95f8('0xf'));var toCsv=require(_0x95f8('0xa'));var querystring=require(_0x95f8('0x10'));var Papa=require(_0x95f8('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x95f8('0x12'));var hardwareService=require(_0x95f8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x95f8('0x14'));var config=require(_0x95f8('0x15'));var licenseUtil=require(_0x95f8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47a706,_0x427cab){_0x427cab=_0x427cab||0xcc;return function(_0x1bb682){if(_0x1bb682){return _0x47a706['sendStatus'](_0x427cab);}return _0x47a706['status'](_0x427cab)[_0x95f8('0x17')]();};}function respondWithResult(_0x3cd40f,_0x12e7fd){_0x12e7fd=_0x12e7fd||0xc8;return function(_0x3be73a){if(_0x3be73a){return _0x3cd40f['status'](_0x12e7fd)[_0x95f8('0x18')](_0x3be73a);}};}function respondWithFilteredResult(_0x1b8a41,_0x382264){return function(_0x238eb8){if(_0x238eb8){var _0x5ae19f=typeof _0x382264[_0x95f8('0x19')]===_0x95f8('0x1a')&&typeof _0x382264[_0x95f8('0x1b')]===_0x95f8('0x1a');var _0x5b5e8d=_0x238eb8[_0x95f8('0x1c')];var _0x21420f=_0x5ae19f?0x0:_0x382264[_0x95f8('0x19')];var _0x4b7cff=_0x5ae19f?_0x238eb8['count']:_0x382264[_0x95f8('0x19')]+_0x382264[_0x95f8('0x1b')];var _0x45707c;if(_0x4b7cff>=_0x5b5e8d){_0x4b7cff=_0x5b5e8d;_0x45707c=0xc8;}else{_0x45707c=0xce;}_0x1b8a41[_0x95f8('0x1d')](_0x45707c);return _0x1b8a41[_0x95f8('0x1e')](_0x95f8('0x1f'),_0x21420f+'-'+_0x4b7cff+'/'+_0x5b5e8d)['json'](_0x238eb8);}return null;};}function patchUpdates(_0x15107e){return function(_0x38b8ea){try{jsonpatch[_0x95f8('0x20')](_0x38b8ea,_0x15107e,!![]);}catch(_0x49bb3e){return BPromise[_0x95f8('0x21')](_0x49bb3e);}return _0x38b8ea[_0x95f8('0x22')]();};}function saveUpdates(_0x348c68,_0x3c5ad7){return function(_0x2ed749){if(_0x2ed749){return _0x2ed749[_0x95f8('0x23')](_0x348c68)[_0x95f8('0x24')](function(_0x25cb6e){return _0x25cb6e;});}return null;};}function removeEntity(_0x4dddf1,_0x3d7332){return function(_0x163cd1){if(_0x163cd1){return _0x163cd1['destroy']()[_0x95f8('0x24')](function(){_0x4dddf1[_0x95f8('0x1d')](0xcc)[_0x95f8('0x17')]();});}};}function handleEntityNotFound(_0x2f26d9,_0x45fbc7){return function(_0x5ea7e5){if(!_0x5ea7e5){_0x2f26d9[_0x95f8('0x25')](0x194);}return _0x5ea7e5;};}function handleError(_0x16f712,_0x3b57f4){_0x3b57f4=_0x3b57f4||0x1f4;return function(_0x398a4e){logger[_0x95f8('0x26')](_0x398a4e[_0x95f8('0x27')]);if(_0x398a4e['name']){delete _0x398a4e['name'];}_0x16f712['status'](_0x3b57f4)[_0x95f8('0x28')](_0x398a4e);};}exports['index']=function(_0x1674ec,_0x52855d){var _0x19d40b={},_0x2678bb={},_0x6d9d60={'count':0x0,'rows':[]};var _0x28e854=_[_0x95f8('0x29')](db[_0x95f8('0x2a')][_0x95f8('0x2b')],function(_0x486142){return{'name':_0x486142[_0x95f8('0x2c')],'type':_0x486142[_0x95f8('0x2d')]['key']};});_0x2678bb[_0x95f8('0x2e')]=_[_0x95f8('0x29')](_0x28e854,_0x95f8('0x2f'));_0x2678bb['query']=_[_0x95f8('0x30')](_0x1674ec[_0x95f8('0x31')]);_0x2678bb['filters']=_[_0x95f8('0x32')](_0x2678bb[_0x95f8('0x2e')],_0x2678bb['query']);_0x19d40b['attributes']=_['intersection'](_0x2678bb[_0x95f8('0x2e')],qs[_0x95f8('0x33')](_0x1674ec['query'][_0x95f8('0x33')]));_0x19d40b[_0x95f8('0x34')]=_0x19d40b[_0x95f8('0x34')]['length']?_0x19d40b[_0x95f8('0x34')]:_0x2678bb[_0x95f8('0x2e')];if(!_0x1674ec[_0x95f8('0x31')][_0x95f8('0x35')]('nolimit')){_0x19d40b[_0x95f8('0x1b')]=qs[_0x95f8('0x1b')](_0x1674ec['query'][_0x95f8('0x1b')]);_0x19d40b[_0x95f8('0x19')]=qs[_0x95f8('0x19')](_0x1674ec[_0x95f8('0x31')][_0x95f8('0x19')]);}_0x19d40b['order']=qs[_0x95f8('0x36')](_0x1674ec[_0x95f8('0x31')][_0x95f8('0x36')]);_0x19d40b[_0x95f8('0x37')]=qs[_0x95f8('0x38')](_['pick'](_0x1674ec['query'],_0x2678bb[_0x95f8('0x38')]),_0x28e854);if(_0x1674ec[_0x95f8('0x31')]['filter']){_0x19d40b[_0x95f8('0x37')]=_[_0x95f8('0x39')](_0x19d40b[_0x95f8('0x37')],{'$or':_[_0x95f8('0x29')](_0x28e854,function(_0x2eb763){if(_0x2eb763[_0x95f8('0x2d')]!==_0x95f8('0x3a')){var _0x186ec0={};_0x186ec0[_0x2eb763[_0x95f8('0x2f')]]={'$like':'%'+_0x1674ec[_0x95f8('0x31')]['filter']+'%'};return _0x186ec0;}})});}_0x19d40b=_['merge']({},_0x19d40b,_0x1674ec['options']);var _0xe90b66={'where':_0x19d40b[_0x95f8('0x37')]};return db['ZohoConfiguration'][_0x95f8('0x1c')](_0xe90b66)[_0x95f8('0x24')](function(_0x198df4){_0x6d9d60[_0x95f8('0x1c')]=_0x198df4;if(_0x1674ec['query'][_0x95f8('0x3b')]){_0x19d40b[_0x95f8('0x3c')]=[{'all':!![]}];}return db[_0x95f8('0x2a')]['findAll'](_0x19d40b);})[_0x95f8('0x24')](function(_0x3c4045){_0x6d9d60[_0x95f8('0x3d')]=_0x3c4045;return _0x6d9d60;})['then'](respondWithFilteredResult(_0x52855d,_0x19d40b))[_0x95f8('0x3e')](handleError(_0x52855d,null));};exports[_0x95f8('0x3f')]=function(_0x22b39,_0x1eea98){var _0x550cd8={'raw':![],'where':{'id':_0x22b39[_0x95f8('0x40')]['id']}},_0x1abe20={};_0x1abe20[_0x95f8('0x2e')]=_[_0x95f8('0x30')](db[_0x95f8('0x2a')][_0x95f8('0x2b')]);_0x1abe20[_0x95f8('0x31')]=_[_0x95f8('0x30')](_0x22b39['query']);_0x1abe20[_0x95f8('0x38')]=_[_0x95f8('0x32')](_0x1abe20['model'],_0x1abe20[_0x95f8('0x31')]);_0x550cd8[_0x95f8('0x34')]=_[_0x95f8('0x32')](_0x1abe20[_0x95f8('0x2e')],qs[_0x95f8('0x33')](_0x22b39[_0x95f8('0x31')][_0x95f8('0x33')]));_0x550cd8[_0x95f8('0x34')]=_0x550cd8['attributes'][_0x95f8('0x41')]?_0x550cd8['attributes']:_0x1abe20[_0x95f8('0x2e')];if(_0x22b39[_0x95f8('0x31')]['includeAll']){_0x550cd8[_0x95f8('0x3c')]=[{'all':!![]}];}_0x550cd8=_[_0x95f8('0x39')]({},_0x550cd8,_0x22b39[_0x95f8('0x42')]);return db[_0x95f8('0x2a')][_0x95f8('0x43')](_0x550cd8)['then'](handleEntityNotFound(_0x1eea98,null))[_0x95f8('0x24')](respondWithResult(_0x1eea98,null))[_0x95f8('0x3e')](handleError(_0x1eea98,null));};exports['create']=function(_0x5e14bd,_0x2de295){return db[_0x95f8('0x2a')]['create'](_0x5e14bd[_0x95f8('0x44')],{})['then'](respondWithResult(_0x2de295,0xc9))['catch'](handleError(_0x2de295,null));};exports[_0x95f8('0x23')]=function(_0x6bcf74,_0x3c8e8){if(_0x6bcf74[_0x95f8('0x44')]['id']){delete _0x6bcf74[_0x95f8('0x44')]['id'];}return db[_0x95f8('0x2a')][_0x95f8('0x43')]({'where':{'id':_0x6bcf74[_0x95f8('0x40')]['id']}})[_0x95f8('0x24')](handleEntityNotFound(_0x3c8e8,null))[_0x95f8('0x24')](saveUpdates(_0x6bcf74['body'],null))[_0x95f8('0x24')](respondWithResult(_0x3c8e8,null))[_0x95f8('0x3e')](handleError(_0x3c8e8,null));};exports[_0x95f8('0x45')]=function(_0x23a880,_0x15ad33){return db[_0x95f8('0x2a')]['find']({'where':{'id':_0x23a880[_0x95f8('0x40')]['id']}})[_0x95f8('0x24')](handleEntityNotFound(_0x15ad33,null))[_0x95f8('0x24')](removeEntity(_0x15ad33,null))[_0x95f8('0x3e')](handleError(_0x15ad33,null));};exports['getFields']=function(_0x31cc84,_0x6acf7a,_0x33ef6f){var _0x429ece={};var _0x34a9da={};var _0x4ca250;var _0x2563ac;return db[_0x95f8('0x2a')][_0x95f8('0x46')]({'where':{'id':_0x31cc84[_0x95f8('0x40')]['id']}})[_0x95f8('0x24')](handleEntityNotFound(_0x6acf7a,null))[_0x95f8('0x24')](function(_0x4d473d){if(_0x4d473d){_0x4ca250=_0x4d473d;_0x34a9da['model']=_[_0x95f8('0x30')](db[_0x95f8('0x47')][_0x95f8('0x2b')]);_0x34a9da['query']=_['keys'](_0x31cc84[_0x95f8('0x31')]);_0x34a9da['filters']=_[_0x95f8('0x32')](_0x34a9da[_0x95f8('0x2e')],_0x34a9da[_0x95f8('0x31')]);_0x429ece['attributes']=_['intersection'](_0x34a9da[_0x95f8('0x2e')],qs[_0x95f8('0x33')](_0x31cc84[_0x95f8('0x31')][_0x95f8('0x33')]));_0x429ece[_0x95f8('0x34')]=_0x429ece[_0x95f8('0x34')][_0x95f8('0x41')]?_0x429ece[_0x95f8('0x34')]:_0x34a9da[_0x95f8('0x2e')];_0x429ece['order']=qs[_0x95f8('0x36')](_0x31cc84[_0x95f8('0x31')]['sort']);_0x429ece['where']=qs['filters'](_['pick'](_0x31cc84[_0x95f8('0x31')],_0x34a9da[_0x95f8('0x38')]));if(_0x31cc84[_0x95f8('0x31')][_0x95f8('0x48')]){_0x429ece['where']=_[_0x95f8('0x39')](_0x429ece['where'],{'$or':_[_0x95f8('0x29')](_0x429ece['attributes'],function(_0xd89d5a){var _0x108073={};_0x108073[_0xd89d5a]={'$like':'%'+_0x31cc84[_0x95f8('0x31')][_0x95f8('0x48')]+'%'};return _0x108073;})});}_0x429ece=_[_0x95f8('0x39')]({},_0x429ece,_0x31cc84[_0x95f8('0x42')]);return _0x4ca250[_0x95f8('0x49')](_0x429ece);}})['then'](function(_0x1ac096){if(_0x1ac096){_0x2563ac=_0x1ac096['length'];if(!_0x31cc84[_0x95f8('0x31')][_0x95f8('0x35')](_0x95f8('0x4a'))){_0x429ece[_0x95f8('0x1b')]=qs['limit'](_0x31cc84[_0x95f8('0x31')]['limit']);_0x429ece[_0x95f8('0x19')]=qs[_0x95f8('0x19')](_0x31cc84[_0x95f8('0x31')][_0x95f8('0x19')]);}return _0x4ca250[_0x95f8('0x49')](_0x429ece);}})[_0x95f8('0x24')](function(_0x2045b7){if(_0x2045b7){return _0x2045b7?{'count':_0x2563ac,'rows':_0x2045b7}:null;}})[_0x95f8('0x24')](respondWithResult(_0x6acf7a,null))[_0x95f8('0x3e')](handleError(_0x6acf7a,null));};exports[_0x95f8('0x4b')]=function(_0x858c64,_0xe70281,_0x38b1e0){var _0x3839f0={};var _0x34c03a={};var _0x2ffeca;var _0x22ca05;return db[_0x95f8('0x2a')]['findOne']({'where':{'id':_0x858c64[_0x95f8('0x40')]['id']}})[_0x95f8('0x24')](handleEntityNotFound(_0xe70281,null))[_0x95f8('0x24')](function(_0x2d4d61){if(_0x2d4d61){_0x2ffeca=_0x2d4d61;_0x34c03a[_0x95f8('0x2e')]=_[_0x95f8('0x30')](db[_0x95f8('0x47')][_0x95f8('0x2b')]);_0x34c03a[_0x95f8('0x31')]=_[_0x95f8('0x30')](_0x858c64[_0x95f8('0x31')]);_0x34c03a[_0x95f8('0x38')]=_[_0x95f8('0x32')](_0x34c03a[_0x95f8('0x2e')],_0x34c03a[_0x95f8('0x31')]);_0x3839f0[_0x95f8('0x34')]=_['intersection'](_0x34c03a[_0x95f8('0x2e')],qs[_0x95f8('0x33')](_0x858c64['query'][_0x95f8('0x33')]));_0x3839f0['attributes']=_0x3839f0[_0x95f8('0x34')]['length']?_0x3839f0[_0x95f8('0x34')]:_0x34c03a[_0x95f8('0x2e')];_0x3839f0[_0x95f8('0x4c')]=qs[_0x95f8('0x36')](_0x858c64[_0x95f8('0x31')][_0x95f8('0x36')]);_0x3839f0[_0x95f8('0x37')]=qs[_0x95f8('0x38')](_[_0x95f8('0x4d')](_0x858c64[_0x95f8('0x31')],_0x34c03a[_0x95f8('0x38')]));if(_0x858c64[_0x95f8('0x31')][_0x95f8('0x48')]){_0x3839f0['where']=_[_0x95f8('0x39')](_0x3839f0[_0x95f8('0x37')],{'$or':_['map'](_0x3839f0[_0x95f8('0x34')],function(_0x4f9269){var _0x1e3961={};_0x1e3961[_0x4f9269]={'$like':'%'+_0x858c64[_0x95f8('0x31')][_0x95f8('0x48')]+'%'};return _0x1e3961;})});}_0x3839f0=_[_0x95f8('0x39')]({},_0x3839f0,_0x858c64[_0x95f8('0x42')]);return _0x2ffeca[_0x95f8('0x4b')](_0x3839f0);}})['then'](function(_0x52e2d9){if(_0x52e2d9){_0x22ca05=_0x52e2d9[_0x95f8('0x41')];if(!_0x858c64['query']['hasOwnProperty'](_0x95f8('0x4a'))){_0x3839f0[_0x95f8('0x1b')]=qs[_0x95f8('0x1b')](_0x858c64[_0x95f8('0x31')][_0x95f8('0x1b')]);_0x3839f0[_0x95f8('0x19')]=qs['offset'](_0x858c64[_0x95f8('0x31')][_0x95f8('0x19')]);}return _0x2ffeca[_0x95f8('0x4b')](_0x3839f0);}})[_0x95f8('0x24')](function(_0x25d05c){if(_0x25d05c){return _0x25d05c?{'count':_0x22ca05,'rows':_0x25d05c}:null;}})[_0x95f8('0x24')](respondWithResult(_0xe70281,null))[_0x95f8('0x3e')](handleError(_0xe70281,null));};exports[_0x95f8('0x4e')]=function(_0xb18c9,_0x1f96e8,_0x30127a){var _0x399298={};var _0xc5df63={};var _0xbb0ced;var _0x55f7be;return db[_0x95f8('0x2a')][_0x95f8('0x46')]({'where':{'id':_0xb18c9[_0x95f8('0x40')]['id']}})[_0x95f8('0x24')](handleEntityNotFound(_0x1f96e8,null))[_0x95f8('0x24')](function(_0xf6e70b){if(_0xf6e70b){_0xbb0ced=_0xf6e70b;_0xc5df63[_0x95f8('0x2e')]=_['keys'](db[_0x95f8('0x47')][_0x95f8('0x2b')]);_0xc5df63[_0x95f8('0x31')]=_[_0x95f8('0x30')](_0xb18c9[_0x95f8('0x31')]);_0xc5df63[_0x95f8('0x38')]=_['intersection'](_0xc5df63[_0x95f8('0x2e')],_0xc5df63['query']);_0x399298[_0x95f8('0x34')]=_[_0x95f8('0x32')](_0xc5df63['model'],qs[_0x95f8('0x33')](_0xb18c9[_0x95f8('0x31')][_0x95f8('0x33')]));_0x399298[_0x95f8('0x34')]=_0x399298[_0x95f8('0x34')][_0x95f8('0x41')]?_0x399298['attributes']:_0xc5df63[_0x95f8('0x2e')];_0x399298[_0x95f8('0x4c')]=qs[_0x95f8('0x36')](_0xb18c9['query']['sort']);_0x399298[_0x95f8('0x37')]=qs[_0x95f8('0x38')](_[_0x95f8('0x4d')](_0xb18c9[_0x95f8('0x31')],_0xc5df63[_0x95f8('0x38')]));if(_0xb18c9[_0x95f8('0x31')][_0x95f8('0x48')]){_0x399298[_0x95f8('0x37')]=_[_0x95f8('0x39')](_0x399298[_0x95f8('0x37')],{'$or':_[_0x95f8('0x29')](_0x399298[_0x95f8('0x34')],function(_0x226ccb){var _0x25c5a4={};_0x25c5a4[_0x226ccb]={'$like':'%'+_0xb18c9[_0x95f8('0x31')][_0x95f8('0x48')]+'%'};return _0x25c5a4;})});}_0x399298=_[_0x95f8('0x39')]({},_0x399298,_0xb18c9[_0x95f8('0x42')]);return _0xbb0ced['getDescriptions'](_0x399298);}})[_0x95f8('0x24')](function(_0x1d29be){if(_0x1d29be){_0x55f7be=_0x1d29be[_0x95f8('0x41')];if(!_0xb18c9[_0x95f8('0x31')][_0x95f8('0x35')](_0x95f8('0x4a'))){_0x399298[_0x95f8('0x1b')]=qs[_0x95f8('0x1b')](_0xb18c9[_0x95f8('0x31')][_0x95f8('0x1b')]);_0x399298['offset']=qs['offset'](_0xb18c9[_0x95f8('0x31')][_0x95f8('0x19')]);}return _0xbb0ced[_0x95f8('0x4e')](_0x399298);}})[_0x95f8('0x24')](function(_0x488bcd){if(_0x488bcd){return _0x488bcd?{'count':_0x55f7be,'rows':_0x488bcd}:null;}})[_0x95f8('0x24')](respondWithResult(_0x1f96e8,null))['catch'](handleError(_0x1f96e8,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index e4ee787..a7fdb81 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf25=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x147656,_0x2480fc){var _0x43df2f=function(_0x525c28){while(--_0x525c28){_0x147656['push'](_0x147656['shift']());}};_0x43df2f(++_0x2480fc);}(_0xaf25,0x1b5));var _0x5af2=function(_0x1942ae,_0x421326){_0x1942ae=_0x1942ae-0x0;var _0x3b06bc=_0xaf25[_0x1942ae];return _0x3b06bc;};'use strict';var _=require(_0x5af2('0x0'));var util=require(_0x5af2('0x1'));var logger=require(_0x5af2('0x2'))(_0x5af2('0x3'));var moment=require('moment');var BPromise=require(_0x5af2('0x4'));var rp=require(_0x5af2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5af2('0x6'));var config=require('../../config/environment');var attributes=require(_0x5af2('0x7'));module[_0x5af2('0x8')]=function(_0x288175,_0x3aa0f2){return _0x288175[_0x5af2('0x9')](_0x5af2('0xa'),attributes,{'tableName':_0x5af2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7b1=['define','ZohoConfiguration','int_zoho_configurations','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports'];(function(_0x566bfb,_0x427ebf){var _0x114452=function(_0x5375bc){while(--_0x5375bc){_0x566bfb['push'](_0x566bfb['shift']());}};_0x114452(++_0x427ebf);}(_0xc7b1,0xc9));var _0x1c7b=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0xc7b1[_0x257495];return _0x3849aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1c7b('0x0'));var rp=require(_0x1c7b('0x1'));var fs=require('fs');var path=require(_0x1c7b('0x2'));var rimraf=require(_0x1c7b('0x3'));var config=require('../../config/environment');var attributes=require(_0x1c7b('0x4'));module[_0x1c7b('0x5')]=function(_0x51d757,_0xe999af){return _0x51d757[_0x1c7b('0x6')](_0x1c7b('0x7'),attributes,{'tableName':_0x1c7b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index b9dc057..dadb2b8 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadaa=['http','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x7e27c6,_0x16811a){var _0x4efe01=function(_0x466a72){while(--_0x466a72){_0x7e27c6['push'](_0x7e27c6['shift']());}};_0x4efe01(++_0x16811a);}(_0xadaa,0x107));var _0xaada=function(_0x372ce1,_0x274d3e){_0x372ce1=_0x372ce1-0x0;var _0xd44624=_0xadaa[_0x372ce1];return _0xd44624;};'use strict';var _=require(_0xaada('0x0'));var util=require(_0xaada('0x1'));var moment=require(_0xaada('0x2'));var BPromise=require(_0xaada('0x3'));var rs=require(_0xaada('0x4'));var fs=require('fs');var Redis=require(_0xaada('0x5'));var db=require(_0xaada('0x6'))['db'];var utils=require(_0xaada('0x7'));var logger=require(_0xaada('0x8'))(_0xaada('0x9'));var config=require(_0xaada('0xa'));var jayson=require(_0xaada('0xb'));var client=jayson['client'][_0xaada('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f67d3,_0x2d84b2,_0x55c84e){return new BPromise(function(_0x484942,_0x52576a){return client[_0xaada('0xd')](_0x1f67d3,_0x55c84e)[_0xaada('0xe')](function(_0x49c957){logger[_0xaada('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x2d84b2,'request\x20sent');logger[_0xaada('0x10')](_0xaada('0x11'),_0x2d84b2,_0xaada('0x12'),JSON[_0xaada('0x13')](_0x49c957));if(_0x49c957[_0xaada('0x14')]){if(_0x49c957[_0xaada('0x14')][_0xaada('0x15')]===0x1f4){logger[_0xaada('0x14')](_0xaada('0x16'),_0x2d84b2,_0x49c957['error']['message']);return _0x52576a(_0x49c957['error'][_0xaada('0x17')]);}logger[_0xaada('0x14')](_0xaada('0x16'),_0x2d84b2,_0x49c957[_0xaada('0x14')]['message']);return _0x484942(_0x49c957[_0xaada('0x14')][_0xaada('0x17')]);}else{logger[_0xaada('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x2d84b2,_0xaada('0x12'));_0x484942(_0x49c957[_0xaada('0x18')]['message']);}})['catch'](function(_0x551a6f){logger[_0xaada('0x14')](_0xaada('0x16'),_0x2d84b2,_0x551a6f);_0x52576a(_0x551a6f);});});} \ No newline at end of file +var _0x966a=['../../config/logger','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','lodash','bluebird','randomstring','../../config/utils'];(function(_0x3f1623,_0x504d4d){var _0x407757=function(_0x5db9f8){while(--_0x5db9f8){_0x3f1623['push'](_0x3f1623['shift']());}};_0x407757(++_0x504d4d);}(_0x966a,0x152));var _0xa966=function(_0x4ce3ca,_0xd314a){_0x4ce3ca=_0x4ce3ca-0x0;var _0x1c6be6=_0x966a[_0x4ce3ca];return _0x1c6be6;};'use strict';var _=require(_0xa966('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa966('0x1'));var rs=require(_0xa966('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa966('0x3'));var logger=require(_0xa966('0x4'))('rpc');var config=require(_0xa966('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa966('0x6')][_0xa966('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x35375d,_0x296774,_0x50deb0){return new BPromise(function(_0x43208f,_0x1c786f){return client[_0xa966('0x8')](_0x35375d,_0x50deb0)[_0xa966('0x9')](function(_0x45bb97){logger[_0xa966('0xa')](_0xa966('0xb'),_0x296774,'request\x20sent');logger[_0xa966('0xc')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x296774,_0xa966('0xd'),JSON[_0xa966('0xe')](_0x45bb97));if(_0x45bb97[_0xa966('0xf')]){if(_0x45bb97['error']['code']===0x1f4){logger['error'](_0xa966('0xb'),_0x296774,_0x45bb97[_0xa966('0xf')]['message']);return _0x1c786f(_0x45bb97[_0xa966('0xf')][_0xa966('0x10')]);}logger['error'](_0xa966('0xb'),_0x296774,_0x45bb97[_0xa966('0xf')][_0xa966('0x10')]);return _0x43208f(_0x45bb97[_0xa966('0xf')][_0xa966('0x10')]);}else{logger[_0xa966('0xa')](_0xa966('0xb'),_0x296774,'request\x20sent');_0x43208f(_0x45bb97['result'][_0xa966('0x10')]);}})[_0xa966('0x11')](function(_0x20c8ba){logger[_0xa966('0xf')](_0xa966('0xb'),_0x296774,_0x20c8ba);_0x1c786f(_0x20c8ba);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index e5f67be..f8d750d 100644 --- a/server/api/intZohoField/index.js +++ b/server/api/intZohoField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98b2=['get','/:id','show','post','create','destroy','exports','multer','express','Router','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index'];(function(_0x5f0fe7,_0x4542a4){var _0x4ce9d4=function(_0x227e96){while(--_0x227e96){_0x5f0fe7['push'](_0x5f0fe7['shift']());}};_0x4ce9d4(++_0x4542a4);}(_0x98b2,0x18d));var _0x298b=function(_0x69bfa1,_0x1eb3c4){_0x69bfa1=_0x69bfa1-0x0;var _0x1ee26c=_0x98b2[_0x69bfa1];return _0x1ee26c;};'use strict';var multer=require(_0x298b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x298b('0x1'));var router=express[_0x298b('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x298b('0x3'));var config=require(_0x298b('0x4'));var controller=require(_0x298b('0x5'));router['get']('/',auth[_0x298b('0x6')](),controller[_0x298b('0x7')]);router[_0x298b('0x8')](_0x298b('0x9'),auth[_0x298b('0x6')](),controller[_0x298b('0xa')]);router[_0x298b('0xb')]('/',auth['isAuthenticated'](),controller[_0x298b('0xc')]);router['put'](_0x298b('0x9'),auth[_0x298b('0x6')](),controller['update']);router['delete'](_0x298b('0x9'),auth[_0x298b('0x6')](),controller[_0x298b('0xd')]);module[_0x298b('0xe')]=router; \ No newline at end of file +var _0x82ee=['isAuthenticated','index','get','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x130729,_0x149c2d){var _0x3e9526=function(_0x54d293){while(--_0x54d293){_0x130729['push'](_0x130729['shift']());}};_0x3e9526(++_0x149c2d);}(_0x82ee,0x8e));var _0xe82e=function(_0x65f8aa,_0x873a29){_0x65f8aa=_0x65f8aa-0x0;var _0x1100dd=_0x82ee[_0x65f8aa];return _0x1100dd;};'use strict';var multer=require(_0xe82e('0x0'));var util=require(_0xe82e('0x1'));var path=require(_0xe82e('0x2'));var timeout=require(_0xe82e('0x3'));var express=require(_0xe82e('0x4'));var router=express[_0xe82e('0x5')]();var fs_extra=require(_0xe82e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe82e('0x7'));var config=require(_0xe82e('0x8'));var controller=require(_0xe82e('0x9'));router['get']('/',auth[_0xe82e('0xa')](),controller[_0xe82e('0xb')]);router[_0xe82e('0xc')](_0xe82e('0xd'),auth['isAuthenticated'](),controller[_0xe82e('0xe')]);router['post']('/',auth[_0xe82e('0xa')](),controller[_0xe82e('0xf')]);router['put'](_0xe82e('0xd'),auth[_0xe82e('0xa')](),controller[_0xe82e('0x10')]);router['delete'](_0xe82e('0xd'),auth[_0xe82e('0xa')](),controller[_0xe82e('0x11')]);module[_0xe82e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 8a91d5e..0f4cb2d 100644 --- a/server/api/intZohoField/intZohoField.attributes.js +++ b/server/api/intZohoField/intZohoField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4b4=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x2e69a6,_0x41a350){var _0x277cf6=function(_0x111d7a){while(--_0x111d7a){_0x2e69a6['push'](_0x2e69a6['shift']());}};_0x277cf6(++_0x41a350);}(_0xe4b4,0x164));var _0x4e4b=function(_0x44ca27,_0x81f0da){_0x44ca27=_0x44ca27-0x0;var _0x38bc17=_0xe4b4[_0x44ca27];return _0x38bc17;};'use strict';var Sequelize=require(_0x4e4b('0x0'));module[_0x4e4b('0x1')]={'type':{'type':Sequelize[_0x4e4b('0x2')](_0x4e4b('0x3'),_0x4e4b('0x4'),_0x4e4b('0x5'),_0x4e4b('0x6'),_0x4e4b('0x7')),'defaultValue':_0x4e4b('0x3')},'content':{'type':Sequelize[_0x4e4b('0x8')]},'key':{'type':Sequelize[_0x4e4b('0x8')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x4e4b('0x5'))},'keyContent':{'type':Sequelize[_0x4e4b('0x8')]},'idField':{'type':Sequelize[_0x4e4b('0x8')]},'nameField':{'type':Sequelize[_0x4e4b('0x8')]},'customField':{'type':Sequelize[_0x4e4b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4e4b('0x8')]}}; \ No newline at end of file +var _0xefc6=['STRING','customVariable','BOOLEAN','sequelize','ENUM','variable','keyValue','string'];(function(_0x4d8a83,_0x2e2968){var _0x350411=function(_0x306a67){while(--_0x306a67){_0x4d8a83['push'](_0x4d8a83['shift']());}};_0x350411(++_0x2e2968);}(_0xefc6,0x163));var _0x6efc=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xefc6[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x6efc('0x0'));module['exports']={'type':{'type':Sequelize[_0x6efc('0x1')]('string',_0x6efc('0x2'),'customVariable',_0x6efc('0x3'),'picklist'),'defaultValue':_0x6efc('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6efc('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x6efc('0x4'),_0x6efc('0x2'),_0x6efc('0x6'))},'keyContent':{'type':Sequelize[_0x6efc('0x5')]},'idField':{'type':Sequelize[_0x6efc('0x5')]},'nameField':{'type':Sequelize[_0x6efc('0x5')]},'customField':{'type':Sequelize[_0x6efc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6efc('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 0223037..21312b0 100644 --- a/server/api/intZohoField/intZohoField.controller.js +++ b/server/api/intZohoField/intZohoField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2540=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','name','send','index','ZohoField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x255aad,_0x53a7f){var _0x2ef92a=function(_0x412bcf){while(--_0x412bcf){_0x255aad['push'](_0x255aad['shift']());}};_0x2ef92a(++_0x53a7f);}(_0x2540,0x110));var _0x0254=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x2540[_0x462999];return _0x4b1366;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0254('0x0'));var zipdir=require(_0x0254('0x1'));var jsonpatch=require(_0x0254('0x2'));var rp=require(_0x0254('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0254('0x4'));var util=require(_0x0254('0x5'));var path=require(_0x0254('0x6'));var sox=require('sox');var csv=require(_0x0254('0x7'));var ejs=require(_0x0254('0x8'));var fs=require('fs');var fs_extra=require(_0x0254('0x9'));var _=require(_0x0254('0xa'));var squel=require('squel');var crypto=require(_0x0254('0xb'));var jsforce=require(_0x0254('0xc'));var deskjs=require(_0x0254('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0254('0xe'));var Redis=require(_0x0254('0xf'));var authService=require(_0x0254('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0254('0x11'));var hardwareService=require(_0x0254('0x12'));var logger=require(_0x0254('0x13'))(_0x0254('0x14'));var utils=require('../../config/utils');var config=require(_0x0254('0x15'));var licenseUtil=require(_0x0254('0x16'));var db=require(_0x0254('0x17'))['db'];function respondWithStatusCode(_0x37ce8f,_0x5a8a4d){_0x5a8a4d=_0x5a8a4d||0xcc;return function(_0x38c332){if(_0x38c332){return _0x37ce8f['sendStatus'](_0x5a8a4d);}return _0x37ce8f[_0x0254('0x18')](_0x5a8a4d)[_0x0254('0x19')]();};}function respondWithResult(_0x187e75,_0x118bbc){_0x118bbc=_0x118bbc||0xc8;return function(_0x2252e4){if(_0x2252e4){return _0x187e75['status'](_0x118bbc)[_0x0254('0x1a')](_0x2252e4);}};}function respondWithFilteredResult(_0x1dbcbe,_0x4115f1){return function(_0x1acee5){if(_0x1acee5){var _0x562f98=typeof _0x4115f1['offset']==='undefined'&&typeof _0x4115f1['limit']===_0x0254('0x1b');var _0x45d5bc=_0x1acee5[_0x0254('0x1c')];var _0x4455ff=_0x562f98?0x0:_0x4115f1['offset'];var _0x443e74=_0x562f98?_0x1acee5['count']:_0x4115f1['offset']+_0x4115f1[_0x0254('0x1d')];var _0x45c0d0;if(_0x443e74>=_0x45d5bc){_0x443e74=_0x45d5bc;_0x45c0d0=0xc8;}else{_0x45c0d0=0xce;}_0x1dbcbe['status'](_0x45c0d0);return _0x1dbcbe[_0x0254('0x1e')](_0x0254('0x1f'),_0x4455ff+'-'+_0x443e74+'/'+_0x45d5bc)[_0x0254('0x1a')](_0x1acee5);}return null;};}function patchUpdates(_0x20ecb9){return function(_0x2c6fdb){try{jsonpatch[_0x0254('0x20')](_0x2c6fdb,_0x20ecb9,!![]);}catch(_0x4a533f){return BPromise[_0x0254('0x21')](_0x4a533f);}return _0x2c6fdb['save']();};}function saveUpdates(_0xd20ead,_0x2de241){return function(_0x55e0eb){if(_0x55e0eb){return _0x55e0eb[_0x0254('0x22')](_0xd20ead)[_0x0254('0x23')](function(_0x313713){return _0x313713;});}return null;};}function removeEntity(_0x3716cb,_0x2114fa){return function(_0x295406){if(_0x295406){return _0x295406[_0x0254('0x24')]()[_0x0254('0x23')](function(){_0x3716cb[_0x0254('0x18')](0xcc)[_0x0254('0x19')]();});}};}function handleEntityNotFound(_0x13333b,_0xeab53b){return function(_0x3d3dd6){if(!_0x3d3dd6){_0x13333b[_0x0254('0x25')](0x194);}return _0x3d3dd6;};}function handleError(_0x35b892,_0x3b0bd0){_0x3b0bd0=_0x3b0bd0||0x1f4;return function(_0x19ce14){logger['error'](_0x19ce14['stack']);if(_0x19ce14[_0x0254('0x26')]){delete _0x19ce14[_0x0254('0x26')];}_0x35b892['status'](_0x3b0bd0)[_0x0254('0x27')](_0x19ce14);};}exports[_0x0254('0x28')]=function(_0x126a58,_0x387093){var _0x2284af={},_0x21faea={},_0x5a1d97={'count':0x0,'rows':[]};var _0x1126f2=_['map'](db[_0x0254('0x29')][_0x0254('0x2a')],function(_0x28773f){return{'name':_0x28773f[_0x0254('0x2b')],'type':_0x28773f[_0x0254('0x2c')]['key']};});_0x21faea[_0x0254('0x2d')]=_['map'](_0x1126f2,_0x0254('0x26'));_0x21faea[_0x0254('0x2e')]=_[_0x0254('0x2f')](_0x126a58['query']);_0x21faea[_0x0254('0x30')]=_[_0x0254('0x31')](_0x21faea[_0x0254('0x2d')],_0x21faea[_0x0254('0x2e')]);_0x2284af[_0x0254('0x32')]=_[_0x0254('0x31')](_0x21faea[_0x0254('0x2d')],qs[_0x0254('0x33')](_0x126a58[_0x0254('0x2e')]['fields']));_0x2284af[_0x0254('0x32')]=_0x2284af[_0x0254('0x32')][_0x0254('0x34')]?_0x2284af[_0x0254('0x32')]:_0x21faea['model'];if(!_0x126a58[_0x0254('0x2e')][_0x0254('0x35')](_0x0254('0x36'))){_0x2284af['limit']=qs[_0x0254('0x1d')](_0x126a58['query'][_0x0254('0x1d')]);_0x2284af[_0x0254('0x37')]=qs[_0x0254('0x37')](_0x126a58['query']['offset']);}_0x2284af[_0x0254('0x38')]=qs['sort'](_0x126a58['query'][_0x0254('0x39')]);_0x2284af['where']=qs['filters'](_[_0x0254('0x3a')](_0x126a58[_0x0254('0x2e')],_0x21faea['filters']),_0x1126f2);if(_0x126a58[_0x0254('0x2e')]['filter']){_0x2284af[_0x0254('0x3b')]=_['merge'](_0x2284af['where'],{'$or':_['map'](_0x1126f2,function(_0x4a5e8f){if(_0x4a5e8f[_0x0254('0x2c')]!=='VIRTUAL'){var _0x51bb9f={};_0x51bb9f[_0x4a5e8f[_0x0254('0x26')]]={'$like':'%'+_0x126a58['query'][_0x0254('0x3c')]+'%'};return _0x51bb9f;}})});}_0x2284af=_[_0x0254('0x3d')]({},_0x2284af,_0x126a58[_0x0254('0x3e')]);var _0x1dc328={'where':_0x2284af[_0x0254('0x3b')]};return db['ZohoField'][_0x0254('0x1c')](_0x1dc328)['then'](function(_0x4143a5){_0x5a1d97[_0x0254('0x1c')]=_0x4143a5;if(_0x126a58[_0x0254('0x2e')][_0x0254('0x3f')]){_0x2284af[_0x0254('0x40')]=[{'all':!![]}];}return db[_0x0254('0x29')][_0x0254('0x41')](_0x2284af);})['then'](function(_0x453eb5){_0x5a1d97[_0x0254('0x42')]=_0x453eb5;return _0x5a1d97;})[_0x0254('0x23')](respondWithFilteredResult(_0x387093,_0x2284af))[_0x0254('0x43')](handleError(_0x387093,null));};exports['show']=function(_0x3c3c7b,_0x457743){var _0xa95237={'raw':!![],'where':{'id':_0x3c3c7b[_0x0254('0x44')]['id']}},_0x261383={};_0x261383[_0x0254('0x2d')]=_[_0x0254('0x2f')](db[_0x0254('0x29')][_0x0254('0x2a')]);_0x261383['query']=_[_0x0254('0x2f')](_0x3c3c7b[_0x0254('0x2e')]);_0x261383[_0x0254('0x30')]=_[_0x0254('0x31')](_0x261383[_0x0254('0x2d')],_0x261383[_0x0254('0x2e')]);_0xa95237['attributes']=_[_0x0254('0x31')](_0x261383[_0x0254('0x2d')],qs[_0x0254('0x33')](_0x3c3c7b[_0x0254('0x2e')]['fields']));_0xa95237['attributes']=_0xa95237[_0x0254('0x32')]['length']?_0xa95237[_0x0254('0x32')]:_0x261383[_0x0254('0x2d')];if(_0x3c3c7b['query'][_0x0254('0x3f')]){_0xa95237['include']=[{'all':!![]}];}_0xa95237=_[_0x0254('0x3d')]({},_0xa95237,_0x3c3c7b[_0x0254('0x3e')]);return db['ZohoField'][_0x0254('0x45')](_0xa95237)['then'](handleEntityNotFound(_0x457743,null))[_0x0254('0x23')](respondWithResult(_0x457743,null))[_0x0254('0x43')](handleError(_0x457743,null));};exports[_0x0254('0x46')]=function(_0x17c38c,_0x159067){return db[_0x0254('0x29')][_0x0254('0x46')](_0x17c38c[_0x0254('0x47')],{})[_0x0254('0x23')](respondWithResult(_0x159067,0xc9))[_0x0254('0x43')](handleError(_0x159067,null));};exports[_0x0254('0x22')]=function(_0x5202c,_0x4a2963){if(_0x5202c[_0x0254('0x47')]['id']){delete _0x5202c['body']['id'];}return db['ZohoField'][_0x0254('0x45')]({'where':{'id':_0x5202c['params']['id']}})[_0x0254('0x23')](handleEntityNotFound(_0x4a2963,null))[_0x0254('0x23')](saveUpdates(_0x5202c['body'],null))[_0x0254('0x23')](respondWithResult(_0x4a2963,null))[_0x0254('0x43')](handleError(_0x4a2963,null));};exports[_0x0254('0x24')]=function(_0xbbe592,_0x1de5ad){return db['ZohoField'][_0x0254('0x45')]({'where':{'id':_0xbbe592[_0x0254('0x44')]['id']}})[_0x0254('0x23')](handleEntityNotFound(_0x1de5ad,null))[_0x0254('0x23')](removeEntity(_0x1de5ad,null))['catch'](handleError(_0x1de5ad,null));}; \ No newline at end of file +var _0x31c4=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','catch','show','rawAttributes','find','create','body','params','destroy','eml-format'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x31c4,0x113));var _0x431c=function(_0x1f6aa4,_0x425cf9){_0x1f6aa4=_0x1f6aa4-0x0;var _0x5807aa=_0x31c4[_0x1f6aa4];return _0x5807aa;};'use strict';var emlformat=require(_0x431c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x431c('0x1'));var jsonpatch=require(_0x431c('0x2'));var rp=require(_0x431c('0x3'));var moment=require(_0x431c('0x4'));var BPromise=require(_0x431c('0x5'));var Mustache=require(_0x431c('0x6'));var util=require(_0x431c('0x7'));var path=require('path');var sox=require(_0x431c('0x8'));var csv=require(_0x431c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x431c('0xa'));var _=require(_0x431c('0xb'));var squel=require(_0x431c('0xc'));var crypto=require(_0x431c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x431c('0x9'));var querystring=require('querystring');var Papa=require(_0x431c('0xe'));var Redis=require(_0x431c('0xf'));var authService=require(_0x431c('0x10'));var qs=require(_0x431c('0x11'));var as=require(_0x431c('0x12'));var hardwareService=require(_0x431c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x431c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x431c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36567d,_0x50ec94){_0x50ec94=_0x50ec94||0xcc;return function(_0x214677){if(_0x214677){return _0x36567d[_0x431c('0x16')](_0x50ec94);}return _0x36567d[_0x431c('0x17')](_0x50ec94)[_0x431c('0x18')]();};}function respondWithResult(_0x294159,_0x14dd16){_0x14dd16=_0x14dd16||0xc8;return function(_0x491c8a){if(_0x491c8a){return _0x294159[_0x431c('0x17')](_0x14dd16)[_0x431c('0x19')](_0x491c8a);}};}function respondWithFilteredResult(_0xa0b9a1,_0x36c5ce){return function(_0x492622){if(_0x492622){var _0x25f061=typeof _0x36c5ce[_0x431c('0x1a')]===_0x431c('0x1b')&&typeof _0x36c5ce[_0x431c('0x1c')]==='undefined';var _0x461e5d=_0x492622[_0x431c('0x1d')];var _0x22cecd=_0x25f061?0x0:_0x36c5ce[_0x431c('0x1a')];var _0x3071ca=_0x25f061?_0x492622[_0x431c('0x1d')]:_0x36c5ce[_0x431c('0x1a')]+_0x36c5ce['limit'];var _0x1c14c2;if(_0x3071ca>=_0x461e5d){_0x3071ca=_0x461e5d;_0x1c14c2=0xc8;}else{_0x1c14c2=0xce;}_0xa0b9a1['status'](_0x1c14c2);return _0xa0b9a1['set']('Content-Range',_0x22cecd+'-'+_0x3071ca+'/'+_0x461e5d)[_0x431c('0x19')](_0x492622);}return null;};}function patchUpdates(_0x5b2dc2){return function(_0x52413b){try{jsonpatch[_0x431c('0x1e')](_0x52413b,_0x5b2dc2,!![]);}catch(_0x568900){return BPromise[_0x431c('0x1f')](_0x568900);}return _0x52413b[_0x431c('0x20')]();};}function saveUpdates(_0x374890,_0x2279c7){return function(_0x51d5d9){if(_0x51d5d9){return _0x51d5d9[_0x431c('0x21')](_0x374890)[_0x431c('0x22')](function(_0x2c5ce4){return _0x2c5ce4;});}return null;};}function removeEntity(_0x49f49c,_0x883dc0){return function(_0xcdff9a){if(_0xcdff9a){return _0xcdff9a['destroy']()[_0x431c('0x22')](function(){_0x49f49c['status'](0xcc)[_0x431c('0x18')]();});}};}function handleEntityNotFound(_0x2393b8,_0x4868ff){return function(_0x345a9b){if(!_0x345a9b){_0x2393b8['sendStatus'](0x194);}return _0x345a9b;};}function handleError(_0x29f8bd,_0x1c42ea){_0x1c42ea=_0x1c42ea||0x1f4;return function(_0x896c47){logger[_0x431c('0x23')](_0x896c47[_0x431c('0x24')]);if(_0x896c47['name']){delete _0x896c47[_0x431c('0x25')];}_0x29f8bd[_0x431c('0x17')](_0x1c42ea)['send'](_0x896c47);};}exports['index']=function(_0x58fbf8,_0x157f73){var _0x46ca04={},_0x2948f3={},_0x27ec0e={'count':0x0,'rows':[]};var _0x2da389=_[_0x431c('0x26')](db['ZohoField']['rawAttributes'],function(_0x5308c3){return{'name':_0x5308c3['fieldName'],'type':_0x5308c3[_0x431c('0x27')][_0x431c('0x28')]};});_0x2948f3['model']=_[_0x431c('0x26')](_0x2da389,_0x431c('0x25'));_0x2948f3[_0x431c('0x29')]=_[_0x431c('0x2a')](_0x58fbf8[_0x431c('0x29')]);_0x2948f3[_0x431c('0x2b')]=_[_0x431c('0x2c')](_0x2948f3[_0x431c('0x2d')],_0x2948f3[_0x431c('0x29')]);_0x46ca04[_0x431c('0x2e')]=_[_0x431c('0x2c')](_0x2948f3[_0x431c('0x2d')],qs['fields'](_0x58fbf8[_0x431c('0x29')][_0x431c('0x2f')]));_0x46ca04[_0x431c('0x2e')]=_0x46ca04['attributes'][_0x431c('0x30')]?_0x46ca04[_0x431c('0x2e')]:_0x2948f3[_0x431c('0x2d')];if(!_0x58fbf8[_0x431c('0x29')][_0x431c('0x31')](_0x431c('0x32'))){_0x46ca04[_0x431c('0x1c')]=qs['limit'](_0x58fbf8[_0x431c('0x29')][_0x431c('0x1c')]);_0x46ca04['offset']=qs[_0x431c('0x1a')](_0x58fbf8[_0x431c('0x29')]['offset']);}_0x46ca04[_0x431c('0x33')]=qs[_0x431c('0x34')](_0x58fbf8[_0x431c('0x29')][_0x431c('0x34')]);_0x46ca04[_0x431c('0x35')]=qs['filters'](_['pick'](_0x58fbf8[_0x431c('0x29')],_0x2948f3[_0x431c('0x2b')]),_0x2da389);if(_0x58fbf8[_0x431c('0x29')][_0x431c('0x36')]){_0x46ca04[_0x431c('0x35')]=_[_0x431c('0x37')](_0x46ca04['where'],{'$or':_[_0x431c('0x26')](_0x2da389,function(_0x175de5){if(_0x175de5[_0x431c('0x27')]!==_0x431c('0x38')){var _0x143fd0={};_0x143fd0[_0x175de5[_0x431c('0x25')]]={'$like':'%'+_0x58fbf8['query'][_0x431c('0x36')]+'%'};return _0x143fd0;}})});}_0x46ca04=_[_0x431c('0x37')]({},_0x46ca04,_0x58fbf8[_0x431c('0x39')]);var _0x2ef554={'where':_0x46ca04[_0x431c('0x35')]};return db[_0x431c('0x3a')][_0x431c('0x1d')](_0x2ef554)['then'](function(_0x5980a1){_0x27ec0e[_0x431c('0x1d')]=_0x5980a1;if(_0x58fbf8[_0x431c('0x29')][_0x431c('0x3b')]){_0x46ca04[_0x431c('0x3c')]=[{'all':!![]}];}return db[_0x431c('0x3a')]['findAll'](_0x46ca04);})[_0x431c('0x22')](function(_0x1dc9b9){_0x27ec0e['rows']=_0x1dc9b9;return _0x27ec0e;})[_0x431c('0x22')](respondWithFilteredResult(_0x157f73,_0x46ca04))[_0x431c('0x3d')](handleError(_0x157f73,null));};exports[_0x431c('0x3e')]=function(_0x5279e2,_0x249055){var _0x23a209={'raw':!![],'where':{'id':_0x5279e2['params']['id']}},_0x56dc6e={};_0x56dc6e[_0x431c('0x2d')]=_['keys'](db[_0x431c('0x3a')][_0x431c('0x3f')]);_0x56dc6e[_0x431c('0x29')]=_[_0x431c('0x2a')](_0x5279e2['query']);_0x56dc6e[_0x431c('0x2b')]=_[_0x431c('0x2c')](_0x56dc6e[_0x431c('0x2d')],_0x56dc6e[_0x431c('0x29')]);_0x23a209[_0x431c('0x2e')]=_[_0x431c('0x2c')](_0x56dc6e['model'],qs['fields'](_0x5279e2[_0x431c('0x29')]['fields']));_0x23a209['attributes']=_0x23a209[_0x431c('0x2e')][_0x431c('0x30')]?_0x23a209['attributes']:_0x56dc6e[_0x431c('0x2d')];if(_0x5279e2[_0x431c('0x29')][_0x431c('0x3b')]){_0x23a209[_0x431c('0x3c')]=[{'all':!![]}];}_0x23a209=_[_0x431c('0x37')]({},_0x23a209,_0x5279e2['options']);return db[_0x431c('0x3a')][_0x431c('0x40')](_0x23a209)[_0x431c('0x22')](handleEntityNotFound(_0x249055,null))[_0x431c('0x22')](respondWithResult(_0x249055,null))['catch'](handleError(_0x249055,null));};exports[_0x431c('0x41')]=function(_0x4b19bb,_0x27a866){return db[_0x431c('0x3a')][_0x431c('0x41')](_0x4b19bb['body'],{})[_0x431c('0x22')](respondWithResult(_0x27a866,0xc9))['catch'](handleError(_0x27a866,null));};exports[_0x431c('0x21')]=function(_0x34f9c5,_0x36be20){if(_0x34f9c5[_0x431c('0x42')]['id']){delete _0x34f9c5[_0x431c('0x42')]['id'];}return db[_0x431c('0x3a')]['find']({'where':{'id':_0x34f9c5[_0x431c('0x43')]['id']}})[_0x431c('0x22')](handleEntityNotFound(_0x36be20,null))['then'](saveUpdates(_0x34f9c5[_0x431c('0x42')],null))[_0x431c('0x22')](respondWithResult(_0x36be20,null))['catch'](handleError(_0x36be20,null));};exports[_0x431c('0x44')]=function(_0x179345,_0x499373){return db[_0x431c('0x3a')][_0x431c('0x40')]({'where':{'id':_0x179345[_0x431c('0x43')]['id']}})['then'](handleEntityNotFound(_0x499373,null))[_0x431c('0x22')](removeEntity(_0x499373,null))[_0x431c('0x3d')](handleError(_0x499373,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 154a871..1afee76 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x5cc6ab,_0x1259b0){var _0x240078=function(_0xd3c48b){while(--_0xd3c48b){_0x5cc6ab['push'](_0x5cc6ab['shift']());}};_0x240078(++_0x1259b0);}(_0xd117,0x182));var _0x7d11=function(_0x7ad661,_0x1e4efa){_0x7ad661=_0x7ad661-0x0;var _0x363e14=_0xd117[_0x7ad661];return _0x363e14;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x7d11('0xe'),'fields':[_0x7d11('0xf'),_0x7d11('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c3c=['path','rimraf','../../config/environment','./intZohoField.attributes','exports','zoho_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x53595f,_0x227110){var _0x18abe8=function(_0x486a90){while(--_0x486a90){_0x53595f['push'](_0x53595f['shift']());}};_0x18abe8(++_0x227110);}(_0x5c3c,0x132));var _0xc5c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5c3c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 529373f..3ff200f 100644 --- a/server/api/intZohoField/intZohoField.rpc.js +++ b/server/api/intZohoField/intZohoField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e07=['../../config/environment','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2e07,0x1e8));var _0x72e0=function(_0x1c2020,_0x5467c4){_0x1c2020=_0x1c2020-0x0;var _0x5b67b3=_0x2e07[_0x1c2020];return _0x5b67b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x72e0('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72e0('0x1'))['db'];var utils=require(_0x72e0('0x2'));var logger=require(_0x72e0('0x3'))(_0x72e0('0x4'));var config=require(_0x72e0('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x72e0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x55e200,_0x57637d,_0x30a15b){return new BPromise(function(_0x3811b2,_0x53f6ba){return client[_0x72e0('0x7')](_0x55e200,_0x30a15b)[_0x72e0('0x8')](function(_0x84d0b0){logger['info'](_0x72e0('0x9'),_0x57637d,_0x72e0('0xa'));logger[_0x72e0('0xb')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x57637d,_0x72e0('0xa'),JSON[_0x72e0('0xc')](_0x84d0b0));if(_0x84d0b0[_0x72e0('0xd')]){if(_0x84d0b0[_0x72e0('0xd')]['code']===0x1f4){logger[_0x72e0('0xd')](_0x72e0('0x9'),_0x57637d,_0x84d0b0[_0x72e0('0xd')][_0x72e0('0xe')]);return _0x53f6ba(_0x84d0b0[_0x72e0('0xd')][_0x72e0('0xe')]);}logger[_0x72e0('0xd')](_0x72e0('0x9'),_0x57637d,_0x84d0b0[_0x72e0('0xd')][_0x72e0('0xe')]);return _0x3811b2(_0x84d0b0[_0x72e0('0xd')]['message']);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x57637d,_0x72e0('0xa'));_0x3811b2(_0x84d0b0[_0x72e0('0xf')][_0x72e0('0xe')]);}})[_0x72e0('0x10')](function(_0x417dbf){logger[_0x72e0('0xd')](_0x72e0('0x9'),_0x57637d,_0x417dbf);_0x53f6ba(_0x417dbf);});});} \ No newline at end of file +var _0x9bef=['request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x1c88f9,_0x211646){var _0x1779f7=function(_0x1dc48e){while(--_0x1dc48e){_0x1c88f9['push'](_0x1c88f9['shift']());}};_0x1779f7(++_0x211646);}(_0x9bef,0x14e));var _0xf9be=function(_0x2a7aba,_0x5e1b9d){_0x2a7aba=_0x2a7aba-0x0;var _0x127dfc=_0x9bef[_0x2a7aba];return _0x127dfc;};'use strict';var _=require(_0xf9be('0x0'));var util=require('util');var moment=require(_0xf9be('0x1'));var BPromise=require(_0xf9be('0x2'));var rs=require(_0xf9be('0x3'));var fs=require('fs');var Redis=require(_0xf9be('0x4'));var db=require(_0xf9be('0x5'))['db'];var utils=require(_0xf9be('0x6'));var logger=require(_0xf9be('0x7'))(_0xf9be('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf9be('0x9')][_0xf9be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b70e5,_0x3a3747,_0x3350bb){return new BPromise(function(_0x47895c,_0x48b669){return client[_0xf9be('0xb')](_0x1b70e5,_0x3350bb)[_0xf9be('0xc')](function(_0x4a8455){logger[_0xf9be('0xd')](_0xf9be('0xe'),_0x3a3747,_0xf9be('0xf'));logger[_0xf9be('0x10')](_0xf9be('0x11'),_0x3a3747,_0xf9be('0xf'),JSON['stringify'](_0x4a8455));if(_0x4a8455[_0xf9be('0x12')]){if(_0x4a8455[_0xf9be('0x12')][_0xf9be('0x13')]===0x1f4){logger[_0xf9be('0x12')](_0xf9be('0xe'),_0x3a3747,_0x4a8455[_0xf9be('0x12')][_0xf9be('0x14')]);return _0x48b669(_0x4a8455['error'][_0xf9be('0x14')]);}logger[_0xf9be('0x12')]('ZohoField,\x20%s,\x20%s',_0x3a3747,_0x4a8455[_0xf9be('0x12')][_0xf9be('0x14')]);return _0x47895c(_0x4a8455[_0xf9be('0x12')][_0xf9be('0x14')]);}else{logger[_0xf9be('0xd')](_0xf9be('0xe'),_0x3a3747,_0xf9be('0xf'));_0x47895c(_0x4a8455[_0xf9be('0x15')][_0xf9be('0x14')]);}})[_0xf9be('0x16')](function(_0x29c039){logger['error'](_0xf9be('0xe'),_0x3a3747,_0x29c039);_0x48b669(_0x29c039);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 774c845..b5e019a 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x10986d,_0x267275){var _0x21e3d1=function(_0x4a9f83){while(--_0x4a9f83){_0x10986d['push'](_0x10986d['shift']());}};_0x21e3d1(++_0x267275);}(_0xe706,0xa3));var _0x6e70=function(_0x1f9744,_0x54a947){_0x1f9744=_0x1f9744-0x0;var _0x5aba67=_0xe706[_0x1f9744];return _0x5aba67;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x9bf804,_0xa8a88){var _0x216c68=function(_0x16614d){while(--_0x16614d){_0x9bf804['push'](_0x9bf804['shift']());}};_0x216c68(++_0xa8a88);}(_0x70e0,0x17b));var _0x070e=function(_0x33de3e,_0x57e9e3){_0x33de3e=_0x33de3e-0x0;var _0x4238a0=_0x70e0[_0x33de3e];return _0x4238a0;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 8e6d552..b24ad17 100644 --- a/server/api/integration/integration.attributes.js +++ b/server/api/integration/integration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40a3=['STRING','app.js','INTEGER','BOOLEAN','sequelize'];(function(_0x4b9806,_0x1517c0){var _0x12f4d4=function(_0x2f0984){while(--_0x2f0984){_0x4b9806['push'](_0x4b9806['shift']());}};_0x12f4d4(++_0x1517c0);}(_0x40a3,0x153));var _0x340a=function(_0x5e696b,_0x423207){_0x5e696b=_0x5e696b-0x0;var _0xf70fb5=_0x40a3[_0x5e696b];return _0xf70fb5;};'use strict';var Sequelize=require(_0x340a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x340a('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x340a('0x1')],'defaultValue':_0x340a('0x2')},'filename':{'type':Sequelize[_0x340a('0x1')]},'path':{'type':Sequelize[_0x340a('0x1')]},'type':{'type':Sequelize[_0x340a('0x1')]},'size':{'type':Sequelize[_0x340a('0x3')]},'active':{'type':Sequelize[_0x340a('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x340a('0x1')]},'state':{'type':Sequelize[_0x340a('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x340a('0x1')]},'title':{'type':Sequelize[_0x340a('0x1')]},'remoteUri':{'type':Sequelize[_0x340a('0x1')]},'link':{'type':Sequelize[_0x340a('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xbfa1=['BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js'];(function(_0x24cdbd,_0x4723c3){var _0x445184=function(_0x11ee56){while(--_0x11ee56){_0x24cdbd['push'](_0x24cdbd['shift']());}};_0x445184(++_0x4723c3);}(_0xbfa1,0x140));var _0x1bfa=function(_0x4d6b45,_0x325413){_0x4d6b45=_0x4d6b45-0x0;var _0x15a013=_0xbfa1[_0x4d6b45];return _0x15a013;};'use strict';var Sequelize=require(_0x1bfa('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bfa('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1bfa('0x2')},'main':{'type':Sequelize[_0x1bfa('0x1')],'defaultValue':_0x1bfa('0x3')},'filename':{'type':Sequelize[_0x1bfa('0x1')]},'path':{'type':Sequelize[_0x1bfa('0x1')]},'type':{'type':Sequelize[_0x1bfa('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x1bfa('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x1bfa('0x1')]},'logo':{'type':Sequelize[_0x1bfa('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x1bfa('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x1bfa('0x1')]},'remoteUri':{'type':Sequelize[_0x1bfa('0x1')]},'link':{'type':Sequelize[_0x1bfa('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index ab436c0..10d7ea4 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9582=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0x9582,0x95));var _0x2958=function(_0x5e7626,_0x5311be){_0x5e7626=_0x5e7626-0x0;var _0xd4acb6=_0x9582[_0x5e7626];return _0xd4acb6;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));}; \ No newline at end of file +var _0x5c3c=['VIRTUAL','options','Integration','includeAll','include','findAll','rows','params','merge','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type'];(function(_0x3318c2,_0x2a0910){var _0x5f0d23=function(_0x4c1e3b){while(--_0x4c1e3b){_0x3318c2['push'](_0x3318c2['shift']());}};_0x5f0d23(++_0x2a0910);}(_0x5c3c,0x132));var _0xc5c3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x5c3c[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['Integration'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['Integration'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['Integration'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['Integration'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 87fb406..f18a135 100644 --- a/server/api/integration/integration.model.js +++ b/server/api/integration/integration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e3=['Integration','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb7e3,0x1de));var _0x3b7e=function(_0x157298,_0x2f1dd2){_0x157298=_0x157298-0x0;var _0x43368c=_0xb7e3[_0x157298];return _0x43368c;};'use strict';var _=require(_0x3b7e('0x0'));var util=require(_0x3b7e('0x1'));var logger=require(_0x3b7e('0x2'))(_0x3b7e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3b7e('0x4'));var fs=require('fs');var path=require(_0x3b7e('0x5'));var rimraf=require('rimraf');var config=require(_0x3b7e('0x6'));var attributes=require('./integration.attributes');module[_0x3b7e('0x7')]=function(_0x33872a,_0x3b9e52){return _0x33872a['define'](_0x3b7e('0x8'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10c7=['util','moment','bluebird','rimraf','../../config/environment','./integration.attributes','exports','lodash'];(function(_0x5b99d4,_0x55f667){var _0x49255f=function(_0x3a0f3c){while(--_0x3a0f3c){_0x5b99d4['push'](_0x5b99d4['shift']());}};_0x49255f(++_0x55f667);}(_0x10c7,0x16f));var _0x710c=function(_0x3c24e7,_0x2031f6){_0x3c24e7=_0x3c24e7-0x0;var _0x41cbe9=_0x10c7[_0x3c24e7];return _0x41cbe9;};'use strict';var _=require(_0x710c('0x0'));var util=require(_0x710c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x710c('0x2'));var BPromise=require(_0x710c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x710c('0x4'));var config=require(_0x710c('0x5'));var attributes=require(_0x710c('0x6'));module[_0x710c('0x7')]=function(_0x43dc80,_0x396f44){return _0x43dc80['define']('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 4536fa9..e71c656 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x4975,0x86));var _0x5497=function(_0x41c697,_0x45200e){_0x41c697=_0x41c697-0x0;var _0x32a3c8=_0x4975[_0x41c697];return _0x32a3c8;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4e14a5,_0x2c85ab){var _0x5767d1=function(_0x47dc67){while(--_0x47dc67){_0x4e14a5['push'](_0x4e14a5['shift']());}};_0x5767d1(++_0x2c85ab);}(_0x0295,0x1f0));var _0x5029=function(_0x43cf80,_0x669560){_0x43cf80=_0x43cf80-0x0;var _0x91e948=_0x0295[_0x43cf80];return _0x91e948;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('Integration,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 74d8cf4..0024567 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x326099,_0x3f4393){var _0x2c8b55=function(_0x31a97b){while(--_0x31a97b){_0x326099['push'](_0x326099['shift']());}};_0x2c8b55(++_0x3f4393);}(_0x2542,0x169));var _0x2254=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0x2542[_0x589f71];return _0x5763bd;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./integrationReport.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 708686f..336fb92 100644 --- a/server/api/integrationReport/integrationReport.attributes.js +++ b/server/api/integrationReport/integrationReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc437=['sequelize','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENDING','RECEIVED'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc437,0x1dd));var _0x7c43=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc437[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7c43('0x0'));module['exports']={'integration':{'type':Sequelize[_0x7c43('0x1')]},'eventChannel':{'type':Sequelize[_0x7c43('0x1')]},'exitStatus':{'type':Sequelize[_0x7c43('0x1')]},'ticketId':{'type':Sequelize[_0x7c43('0x1')]},'integrationId':{'type':Sequelize[_0x7c43('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7c43('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x7c43('0x1')]},'interface':{'type':Sequelize[_0x7c43('0x1')]},'membername':{'type':Sequelize[_0x7c43('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x7c43('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7c43('0x4')]},'talktime':{'type':Sequelize[_0x7c43('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7c43('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x7c43('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7c43('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7c43('0x4')]},'lastevent':{'type':Sequelize[_0x7c43('0x1')]},'channel':{'type':Sequelize[_0x7c43('0x1')]},'channelstate':{'type':Sequelize[_0x7c43('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x7c43('0x1')]},'connectedlinename':{'type':Sequelize[_0x7c43('0x1')]},'language':{'type':Sequelize[_0x7c43('0x1')]},'accountcode':{'type':Sequelize[_0x7c43('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7c43('0x1')]},'priority':{'type':Sequelize[_0x7c43('0x1')]},'destchannel':{'type':Sequelize[_0x7c43('0x1')]},'destchannelstate':{'type':Sequelize[_0x7c43('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7c43('0x1')]},'destcalleridname':{'type':Sequelize[_0x7c43('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x7c43('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x7c43('0x1')]},'destlanguage':{'type':Sequelize[_0x7c43('0x1')]},'destaccountcode':{'type':Sequelize[_0x7c43('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x7c43('0x1')]},'destpriority':{'type':Sequelize[_0x7c43('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x7c43('0x1')]},'inReplyTo':{'type':Sequelize[_0x7c43('0x1')]},'subject':{'type':Sequelize[_0x7c43('0x1')]},'from':{'type':Sequelize[_0x7c43('0x1')]},'to':{'type':Sequelize[_0x7c43('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x7c43('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x7c43('0x6')]('SENT',_0x7c43('0x7'),_0x7c43('0x8'),'FAILED')},'url':{'type':Sequelize[_0x7c43('0x1')]},'app':{'type':Sequelize[_0x7c43('0x1')]},'appdata':{'type':Sequelize[_0x7c43('0x1')]},'projectId':{'type':Sequelize[_0x7c43('0x2')]}}; \ No newline at end of file +var _0x25a4=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','exports','STRING'];(function(_0x2db315,_0x58d720){var _0x12f9a2=function(_0x1f146e){while(--_0x1f146e){_0x2db315['push'](_0x2db315['shift']());}};_0x12f9a2(++_0x58d720);}(_0x25a4,0xae));var _0x425a=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0x25a4[_0x5c7e53];return _0x1c9af9;};'use strict';var Sequelize=require('sequelize');module[_0x425a('0x0')]={'integration':{'type':Sequelize[_0x425a('0x1')]},'eventChannel':{'type':Sequelize[_0x425a('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x425a('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x425a('0x1')]},'queue':{'type':Sequelize[_0x425a('0x1')]},'interface':{'type':Sequelize[_0x425a('0x1')]},'membername':{'type':Sequelize[_0x425a('0x1')]},'agentcalledAt':{'type':Sequelize[_0x425a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x425a('0x3')]},'holdtime':{'type':Sequelize[_0x425a('0x2')]},'agentcomplete':{'type':Sequelize[_0x425a('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x425a('0x3')]},'talktime':{'type':Sequelize[_0x425a('0x2')]},'agentacw':{'type':Sequelize[_0x425a('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x425a('0x2')]},'reason':{'type':Sequelize[_0x425a('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x425a('0x3')]},'agentdump':{'type':Sequelize[_0x425a('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x425a('0x3')]},'lastevent':{'type':Sequelize[_0x425a('0x1')]},'channel':{'type':Sequelize[_0x425a('0x1')]},'channelstate':{'type':Sequelize[_0x425a('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x425a('0x1')]},'connectedlinename':{'type':Sequelize[_0x425a('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x425a('0x1')]},'context':{'type':Sequelize[_0x425a('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x425a('0x1')]},'destchannel':{'type':Sequelize[_0x425a('0x1')]},'destchannelstate':{'type':Sequelize[_0x425a('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x425a('0x1')]},'destcalleridnum':{'type':Sequelize[_0x425a('0x1')]},'destcalleridname':{'type':Sequelize[_0x425a('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x425a('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x425a('0x1')]},'destlanguage':{'type':Sequelize[_0x425a('0x1')]},'destaccountcode':{'type':Sequelize[_0x425a('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x425a('0x1')]},'destpriority':{'type':Sequelize[_0x425a('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x425a('0x1')]},'subject':{'type':Sequelize[_0x425a('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x425a('0x1')]},'cc':{'type':Sequelize[_0x425a('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x425a('0x5')]},'text':{'type':Sequelize[_0x425a('0x5')]},'status':{'type':Sequelize[_0x425a('0x6')](_0x425a('0x7'),'SENDING','RECEIVED','FAILED')},'url':{'type':Sequelize[_0x425a('0x1')]},'app':{'type':Sequelize[_0x425a('0x1')]},'appdata':{'type':Sequelize[_0x425a('0x1')]},'projectId':{'type':Sequelize[_0x425a('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 073a4c0..49262be 100644 --- a/server/api/integrationReport/integrationReport.controller.js +++ b/server/api/integrationReport/integrationReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83a6=['order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','update','body','find','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','name','send','index','IntegrationReport','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x83a6,0x18b));var _0x683a=function(_0x26236a,_0x2e35c3){_0x26236a=_0x26236a-0x0;var _0x53e09e=_0x83a6[_0x26236a];return _0x53e09e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x683a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x683a('0x1'));var rp=require(_0x683a('0x2'));var moment=require('moment');var BPromise=require(_0x683a('0x3'));var Mustache=require(_0x683a('0x4'));var util=require(_0x683a('0x5'));var path=require(_0x683a('0x6'));var sox=require(_0x683a('0x7'));var csv=require(_0x683a('0x8'));var ejs=require(_0x683a('0x9'));var fs=require('fs');var fs_extra=require(_0x683a('0xa'));var _=require('lodash');var squel=require(_0x683a('0xb'));var crypto=require(_0x683a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x683a('0x8'));var querystring=require(_0x683a('0xd'));var Papa=require(_0x683a('0xe'));var Redis=require('ioredis');var authService=require(_0x683a('0xf'));var qs=require(_0x683a('0x10'));var as=require(_0x683a('0x11'));var hardwareService=require(_0x683a('0x12'));var logger=require(_0x683a('0x13'))(_0x683a('0x14'));var utils=require(_0x683a('0x15'));var config=require(_0x683a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x683a('0x17'))['db'];function respondWithStatusCode(_0x56789b,_0x236ae9){_0x236ae9=_0x236ae9||0xcc;return function(_0x3beba2){if(_0x3beba2){return _0x56789b['sendStatus'](_0x236ae9);}return _0x56789b[_0x683a('0x18')](_0x236ae9)[_0x683a('0x19')]();};}function respondWithResult(_0x552566,_0x912812){_0x912812=_0x912812||0xc8;return function(_0x34d325){if(_0x34d325){return _0x552566['status'](_0x912812)[_0x683a('0x1a')](_0x34d325);}};}function respondWithFilteredResult(_0x422388,_0x11e91e){return function(_0x2e72d3){if(_0x2e72d3){var _0x23ce96=typeof _0x11e91e[_0x683a('0x1b')]===_0x683a('0x1c')&&typeof _0x11e91e[_0x683a('0x1d')]==='undefined';var _0x50a636=_0x2e72d3[_0x683a('0x1e')];var _0x1c2631=_0x23ce96?0x0:_0x11e91e[_0x683a('0x1b')];var _0x3cfe3b=_0x23ce96?_0x2e72d3[_0x683a('0x1e')]:_0x11e91e[_0x683a('0x1b')]+_0x11e91e[_0x683a('0x1d')];var _0x1d02de;if(_0x3cfe3b>=_0x50a636){_0x3cfe3b=_0x50a636;_0x1d02de=0xc8;}else{_0x1d02de=0xce;}_0x422388['status'](_0x1d02de);return _0x422388[_0x683a('0x1f')](_0x683a('0x20'),_0x1c2631+'-'+_0x3cfe3b+'/'+_0x50a636)[_0x683a('0x1a')](_0x2e72d3);}return null;};}function patchUpdates(_0xd85bbd){return function(_0x39a145){try{jsonpatch[_0x683a('0x21')](_0x39a145,_0xd85bbd,!![]);}catch(_0x5daf1e){return BPromise[_0x683a('0x22')](_0x5daf1e);}return _0x39a145['save']();};}function saveUpdates(_0x1ba92c,_0x1b23d1){return function(_0x2ab03a){if(_0x2ab03a){return _0x2ab03a['update'](_0x1ba92c)[_0x683a('0x23')](function(_0x48bec4){return _0x48bec4;});}return null;};}function removeEntity(_0x176876,_0x78ad6){return function(_0x184b83){if(_0x184b83){return _0x184b83[_0x683a('0x24')]()[_0x683a('0x23')](function(){_0x176876[_0x683a('0x18')](0xcc)[_0x683a('0x19')]();});}};}function handleEntityNotFound(_0x119715,_0x21a3d1){return function(_0x2dd028){if(!_0x2dd028){_0x119715[_0x683a('0x25')](0x194);}return _0x2dd028;};}function handleError(_0x47b419,_0x1fa408){_0x1fa408=_0x1fa408||0x1f4;return function(_0x28ca7e){logger[_0x683a('0x26')](_0x28ca7e['stack']);if(_0x28ca7e[_0x683a('0x27')]){delete _0x28ca7e[_0x683a('0x27')];}_0x47b419['status'](_0x1fa408)[_0x683a('0x28')](_0x28ca7e);};}exports[_0x683a('0x29')]=function(_0x306b44,_0xc5ca0){var _0x41eb47={},_0x25cfb6={},_0x26bd18={'count':0x0,'rows':[]};var _0x45492a=_['map'](db[_0x683a('0x2a')]['rawAttributes'],function(_0x54f268){return{'name':_0x54f268[_0x683a('0x2b')],'type':_0x54f268['type'][_0x683a('0x2c')]};});_0x25cfb6[_0x683a('0x2d')]=_[_0x683a('0x2e')](_0x45492a,_0x683a('0x27'));_0x25cfb6['query']=_[_0x683a('0x2f')](_0x306b44['query']);_0x25cfb6[_0x683a('0x30')]=_[_0x683a('0x31')](_0x25cfb6[_0x683a('0x2d')],_0x25cfb6[_0x683a('0x32')]);_0x41eb47[_0x683a('0x33')]=_['intersection'](_0x25cfb6[_0x683a('0x2d')],qs[_0x683a('0x34')](_0x306b44[_0x683a('0x32')]['fields']));_0x41eb47[_0x683a('0x33')]=_0x41eb47[_0x683a('0x33')][_0x683a('0x35')]?_0x41eb47['attributes']:_0x25cfb6['model'];if(!_0x306b44[_0x683a('0x32')][_0x683a('0x36')]('nolimit')){_0x41eb47[_0x683a('0x1d')]=qs['limit'](_0x306b44[_0x683a('0x32')][_0x683a('0x1d')]);_0x41eb47['offset']=qs['offset'](_0x306b44[_0x683a('0x32')][_0x683a('0x1b')]);}_0x41eb47[_0x683a('0x37')]=qs['sort'](_0x306b44[_0x683a('0x32')][_0x683a('0x38')]);_0x41eb47[_0x683a('0x39')]=qs[_0x683a('0x30')](_[_0x683a('0x3a')](_0x306b44[_0x683a('0x32')],_0x25cfb6[_0x683a('0x30')]),_0x45492a);if(_0x306b44['query'][_0x683a('0x3b')]){_0x41eb47['where']=_[_0x683a('0x3c')](_0x41eb47[_0x683a('0x39')],{'$or':_[_0x683a('0x2e')](_0x45492a,function(_0x3d06ac){if(_0x3d06ac[_0x683a('0x3d')]!==_0x683a('0x3e')){var _0x50972e={};_0x50972e[_0x3d06ac[_0x683a('0x27')]]={'$like':'%'+_0x306b44['query']['filter']+'%'};return _0x50972e;}})});}_0x41eb47=_[_0x683a('0x3c')]({},_0x41eb47,_0x306b44[_0x683a('0x3f')]);var _0x182fca={'where':_0x41eb47[_0x683a('0x39')]};return db['IntegrationReport'][_0x683a('0x1e')](_0x182fca)[_0x683a('0x23')](function(_0xc8b89a){_0x26bd18[_0x683a('0x1e')]=_0xc8b89a;if(_0x306b44[_0x683a('0x32')][_0x683a('0x40')]){_0x41eb47['include']=[{'all':!![]}];}return db[_0x683a('0x2a')][_0x683a('0x41')](_0x41eb47);})[_0x683a('0x23')](function(_0x55f500){_0x26bd18[_0x683a('0x42')]=_0x55f500;return _0x26bd18;})[_0x683a('0x23')](respondWithFilteredResult(_0xc5ca0,_0x41eb47))[_0x683a('0x43')](handleError(_0xc5ca0,null));};exports[_0x683a('0x44')]=function(_0x5e3746,_0x2c0769){var _0x43c98a={'raw':![],'where':{'id':_0x5e3746[_0x683a('0x45')]['id']}},_0xf38539={};_0xf38539[_0x683a('0x2d')]=_[_0x683a('0x2f')](db['IntegrationReport']['rawAttributes']);_0xf38539[_0x683a('0x32')]=_[_0x683a('0x2f')](_0x5e3746[_0x683a('0x32')]);_0xf38539[_0x683a('0x30')]=_[_0x683a('0x31')](_0xf38539[_0x683a('0x2d')],_0xf38539[_0x683a('0x32')]);_0x43c98a[_0x683a('0x33')]=_['intersection'](_0xf38539[_0x683a('0x2d')],qs[_0x683a('0x34')](_0x5e3746['query'][_0x683a('0x34')]));_0x43c98a[_0x683a('0x33')]=_0x43c98a['attributes']['length']?_0x43c98a[_0x683a('0x33')]:_0xf38539[_0x683a('0x2d')];if(_0x5e3746[_0x683a('0x32')]['includeAll']){_0x43c98a['include']=[{'all':!![]}];}_0x43c98a=_[_0x683a('0x3c')]({},_0x43c98a,_0x5e3746[_0x683a('0x3f')]);return db[_0x683a('0x2a')]['find'](_0x43c98a)[_0x683a('0x23')](handleEntityNotFound(_0x2c0769,null))[_0x683a('0x23')](respondWithResult(_0x2c0769,null))[_0x683a('0x43')](handleError(_0x2c0769,null));};exports['create']=function(_0x55e0f0,_0x3d8742){return db[_0x683a('0x2a')][_0x683a('0x46')](_0x55e0f0['body'],{})['then'](respondWithResult(_0x3d8742,0xc9))[_0x683a('0x43')](handleError(_0x3d8742,null));};exports[_0x683a('0x47')]=function(_0x30a4b4,_0x4168a8){if(_0x30a4b4['body']['id']){delete _0x30a4b4[_0x683a('0x48')]['id'];}return db[_0x683a('0x2a')][_0x683a('0x49')]({'where':{'id':_0x30a4b4[_0x683a('0x45')]['id']}})[_0x683a('0x23')](handleEntityNotFound(_0x4168a8,null))['then'](saveUpdates(_0x30a4b4[_0x683a('0x48')],null))[_0x683a('0x23')](respondWithResult(_0x4168a8,null))['catch'](handleError(_0x4168a8,null));};exports[_0x683a('0x24')]=function(_0x218f96,_0x335d45){return db[_0x683a('0x2a')][_0x683a('0x49')]({'where':{'id':_0x218f96[_0x683a('0x45')]['id']}})[_0x683a('0x23')](handleEntityNotFound(_0x335d45,null))[_0x683a('0x23')](removeEntity(_0x335d45,null))['catch'](handleError(_0x335d45,null));};exports[_0x683a('0x4a')]=function(_0x30a700,_0x35feb5){return db[_0x683a('0x2a')][_0x683a('0x4a')]()[_0x683a('0x23')](respondWithResult(_0x35feb5,null))['catch'](handleError(_0x35feb5,null));}; \ No newline at end of file +var _0x0906=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','show','params','filters','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0xc9b65d,_0x191674){var _0x159dcf=function(_0x108c2f){while(--_0x108c2f){_0xc9b65d['push'](_0xc9b65d['shift']());}};_0x159dcf(++_0x191674);}(_0x0906,0x128));var _0x6090=function(_0x37e305,_0x6a0cff){_0x37e305=_0x37e305-0x0;var _0x5e2bbb=_0x0906[_0x37e305];return _0x5e2bbb;};'use strict';var emlformat=require(_0x6090('0x0'));var rimraf=require(_0x6090('0x1'));var zipdir=require(_0x6090('0x2'));var jsonpatch=require(_0x6090('0x3'));var rp=require(_0x6090('0x4'));var moment=require(_0x6090('0x5'));var BPromise=require(_0x6090('0x6'));var Mustache=require('mustache');var util=require(_0x6090('0x7'));var path=require(_0x6090('0x8'));var sox=require(_0x6090('0x9'));var csv=require(_0x6090('0xa'));var ejs=require(_0x6090('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6090('0xc'));var squel=require(_0x6090('0xd'));var crypto=require(_0x6090('0xe'));var jsforce=require(_0x6090('0xf'));var deskjs=require(_0x6090('0x10'));var toCsv=require(_0x6090('0xa'));var querystring=require(_0x6090('0x11'));var Papa=require(_0x6090('0x12'));var Redis=require('ioredis');var authService=require(_0x6090('0x13'));var qs=require(_0x6090('0x14'));var as=require(_0x6090('0x15'));var hardwareService=require(_0x6090('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6090('0x17'));var db=require(_0x6090('0x18'))['db'];function respondWithStatusCode(_0x39c5ed,_0x4bfa5c){_0x4bfa5c=_0x4bfa5c||0xcc;return function(_0x2622d4){if(_0x2622d4){return _0x39c5ed[_0x6090('0x19')](_0x4bfa5c);}return _0x39c5ed['status'](_0x4bfa5c)[_0x6090('0x1a')]();};}function respondWithResult(_0x1ae613,_0x24d702){_0x24d702=_0x24d702||0xc8;return function(_0x2de67f){if(_0x2de67f){return _0x1ae613['status'](_0x24d702)[_0x6090('0x1b')](_0x2de67f);}};}function respondWithFilteredResult(_0x436c21,_0x419708){return function(_0x30d0d2){if(_0x30d0d2){var _0x25c83a=typeof _0x419708[_0x6090('0x1c')]===_0x6090('0x1d')&&typeof _0x419708[_0x6090('0x1e')]===_0x6090('0x1d');var _0x25bea6=_0x30d0d2[_0x6090('0x1f')];var _0x582728=_0x25c83a?0x0:_0x419708[_0x6090('0x1c')];var _0x1ab9e0=_0x25c83a?_0x30d0d2['count']:_0x419708[_0x6090('0x1c')]+_0x419708[_0x6090('0x1e')];var _0x328eff;if(_0x1ab9e0>=_0x25bea6){_0x1ab9e0=_0x25bea6;_0x328eff=0xc8;}else{_0x328eff=0xce;}_0x436c21[_0x6090('0x20')](_0x328eff);return _0x436c21[_0x6090('0x21')](_0x6090('0x22'),_0x582728+'-'+_0x1ab9e0+'/'+_0x25bea6)['json'](_0x30d0d2);}return null;};}function patchUpdates(_0x103a76){return function(_0x4802d2){try{jsonpatch[_0x6090('0x23')](_0x4802d2,_0x103a76,!![]);}catch(_0x39f075){return BPromise[_0x6090('0x24')](_0x39f075);}return _0x4802d2[_0x6090('0x25')]();};}function saveUpdates(_0x397787,_0x399123){return function(_0x3c852c){if(_0x3c852c){return _0x3c852c[_0x6090('0x26')](_0x397787)['then'](function(_0x11b6db){return _0x11b6db;});}return null;};}function removeEntity(_0x196283,_0x175a12){return function(_0x4a54c7){if(_0x4a54c7){return _0x4a54c7['destroy']()[_0x6090('0x27')](function(){_0x196283[_0x6090('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17a21d,_0x454391){return function(_0x7c1930){if(!_0x7c1930){_0x17a21d['sendStatus'](0x194);}return _0x7c1930;};}function handleError(_0x5b9380,_0x4fe168){_0x4fe168=_0x4fe168||0x1f4;return function(_0x311d5a){logger[_0x6090('0x28')](_0x311d5a['stack']);if(_0x311d5a['name']){delete _0x311d5a[_0x6090('0x29')];}_0x5b9380['status'](_0x4fe168)[_0x6090('0x2a')](_0x311d5a);};}exports[_0x6090('0x2b')]=function(_0xaf9093,_0x40e75d){var _0x221b17={},_0x44ca60={},_0x3666f1={'count':0x0,'rows':[]};var _0xdd2cfb=_[_0x6090('0x2c')](db[_0x6090('0x2d')][_0x6090('0x2e')],function(_0x42c8fd){return{'name':_0x42c8fd[_0x6090('0x2f')],'type':_0x42c8fd[_0x6090('0x30')][_0x6090('0x31')]};});_0x44ca60['model']=_[_0x6090('0x2c')](_0xdd2cfb,_0x6090('0x29'));_0x44ca60[_0x6090('0x32')]=_[_0x6090('0x33')](_0xaf9093[_0x6090('0x32')]);_0x44ca60['filters']=_[_0x6090('0x34')](_0x44ca60[_0x6090('0x35')],_0x44ca60[_0x6090('0x32')]);_0x221b17[_0x6090('0x36')]=_['intersection'](_0x44ca60[_0x6090('0x35')],qs['fields'](_0xaf9093['query'][_0x6090('0x37')]));_0x221b17[_0x6090('0x36')]=_0x221b17[_0x6090('0x36')][_0x6090('0x38')]?_0x221b17[_0x6090('0x36')]:_0x44ca60[_0x6090('0x35')];if(!_0xaf9093[_0x6090('0x32')][_0x6090('0x39')](_0x6090('0x3a'))){_0x221b17[_0x6090('0x1e')]=qs[_0x6090('0x1e')](_0xaf9093[_0x6090('0x32')][_0x6090('0x1e')]);_0x221b17['offset']=qs['offset'](_0xaf9093['query'][_0x6090('0x1c')]);}_0x221b17[_0x6090('0x3b')]=qs[_0x6090('0x3c')](_0xaf9093['query']['sort']);_0x221b17[_0x6090('0x3d')]=qs['filters'](_[_0x6090('0x3e')](_0xaf9093[_0x6090('0x32')],_0x44ca60['filters']),_0xdd2cfb);if(_0xaf9093[_0x6090('0x32')]['filter']){_0x221b17[_0x6090('0x3d')]=_[_0x6090('0x3f')](_0x221b17[_0x6090('0x3d')],{'$or':_[_0x6090('0x2c')](_0xdd2cfb,function(_0x184a6e){if(_0x184a6e[_0x6090('0x30')]!=='VIRTUAL'){var _0x527083={};_0x527083[_0x184a6e[_0x6090('0x29')]]={'$like':'%'+_0xaf9093[_0x6090('0x32')][_0x6090('0x40')]+'%'};return _0x527083;}})});}_0x221b17=_[_0x6090('0x3f')]({},_0x221b17,_0xaf9093[_0x6090('0x41')]);var _0xc852e9={'where':_0x221b17[_0x6090('0x3d')]};return db[_0x6090('0x2d')]['count'](_0xc852e9)[_0x6090('0x27')](function(_0x592378){_0x3666f1[_0x6090('0x1f')]=_0x592378;if(_0xaf9093[_0x6090('0x32')][_0x6090('0x42')]){_0x221b17[_0x6090('0x43')]=[{'all':!![]}];}return db[_0x6090('0x2d')][_0x6090('0x44')](_0x221b17);})[_0x6090('0x27')](function(_0x512a2e){_0x3666f1['rows']=_0x512a2e;return _0x3666f1;})[_0x6090('0x27')](respondWithFilteredResult(_0x40e75d,_0x221b17))['catch'](handleError(_0x40e75d,null));};exports[_0x6090('0x45')]=function(_0x3d262f,_0x44b3cb){var _0x17b101={'raw':![],'where':{'id':_0x3d262f[_0x6090('0x46')]['id']}},_0x552073={};_0x552073[_0x6090('0x35')]=_[_0x6090('0x33')](db[_0x6090('0x2d')][_0x6090('0x2e')]);_0x552073['query']=_[_0x6090('0x33')](_0x3d262f[_0x6090('0x32')]);_0x552073[_0x6090('0x47')]=_[_0x6090('0x34')](_0x552073[_0x6090('0x35')],_0x552073[_0x6090('0x32')]);_0x17b101[_0x6090('0x36')]=_[_0x6090('0x34')](_0x552073[_0x6090('0x35')],qs[_0x6090('0x37')](_0x3d262f[_0x6090('0x32')]['fields']));_0x17b101[_0x6090('0x36')]=_0x17b101[_0x6090('0x36')][_0x6090('0x38')]?_0x17b101[_0x6090('0x36')]:_0x552073[_0x6090('0x35')];if(_0x3d262f[_0x6090('0x32')][_0x6090('0x42')]){_0x17b101[_0x6090('0x43')]=[{'all':!![]}];}_0x17b101=_[_0x6090('0x3f')]({},_0x17b101,_0x3d262f['options']);return db[_0x6090('0x2d')][_0x6090('0x48')](_0x17b101)['then'](handleEntityNotFound(_0x44b3cb,null))['then'](respondWithResult(_0x44b3cb,null))[_0x6090('0x49')](handleError(_0x44b3cb,null));};exports['create']=function(_0x435770,_0x4abbb7){return db[_0x6090('0x2d')][_0x6090('0x4a')](_0x435770[_0x6090('0x4b')],{})['then'](respondWithResult(_0x4abbb7,0xc9))[_0x6090('0x49')](handleError(_0x4abbb7,null));};exports[_0x6090('0x26')]=function(_0x4bbab5,_0x3a18b5){if(_0x4bbab5[_0x6090('0x4b')]['id']){delete _0x4bbab5['body']['id'];}return db[_0x6090('0x2d')]['find']({'where':{'id':_0x4bbab5['params']['id']}})[_0x6090('0x27')](handleEntityNotFound(_0x3a18b5,null))[_0x6090('0x27')](saveUpdates(_0x4bbab5[_0x6090('0x4b')],null))['then'](respondWithResult(_0x3a18b5,null))[_0x6090('0x49')](handleError(_0x3a18b5,null));};exports['destroy']=function(_0x3e2c2a,_0x5dcb4b){return db[_0x6090('0x2d')][_0x6090('0x48')]({'where':{'id':_0x3e2c2a['params']['id']}})[_0x6090('0x27')](handleEntityNotFound(_0x5dcb4b,null))[_0x6090('0x27')](removeEntity(_0x5dcb4b,null))[_0x6090('0x49')](handleError(_0x5dcb4b,null));};exports[_0x6090('0x4c')]=function(_0x1b8a85,_0x4d1839){return db['IntegrationReport']['describe']()[_0x6090('0x27')](respondWithResult(_0x4d1839,null))[_0x6090('0x49')](handleError(_0x4d1839,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index f6fdc36..4194a69 100644 --- a/server/api/integrationReport/integrationReport.model.js +++ b/server/api/integrationReport/integrationReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10e6=['moment','request-promise','path','rimraf','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','../../config/logger'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x10e6,0x10c));var _0x610e=function(_0x5ee3d3,_0x537c30){_0x5ee3d3=_0x5ee3d3-0x0;var _0x4b272f=_0x10e6[_0x5ee3d3];return _0x4b272f;};'use strict';var _=require(_0x610e('0x0'));var util=require('util');var logger=require(_0x610e('0x1'))('api');var moment=require(_0x610e('0x2'));var BPromise=require('bluebird');var rp=require(_0x610e('0x3'));var fs=require('fs');var path=require(_0x610e('0x4'));var rimraf=require(_0x610e('0x5'));var config=require('../../config/environment');var attributes=require(_0x610e('0x6'));module['exports']=function(_0x25b3a3,_0x464502){return _0x25b3a3[_0x610e('0x7')](_0x610e('0x8'),attributes,{'tableName':_0x610e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d03=['../../config/environment','./integrationReport.attributes','exports','IntegrationReport','report_integration','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x7d03,0x71));var _0x37d0=function(_0x5c055a,_0x40487f){_0x5c055a=_0x5c055a-0x0;var _0x49c069=_0x7d03[_0x5c055a];return _0x49c069;};'use strict';var _=require(_0x37d0('0x0'));var util=require('util');var logger=require(_0x37d0('0x1'))(_0x37d0('0x2'));var moment=require('moment');var BPromise=require(_0x37d0('0x3'));var rp=require(_0x37d0('0x4'));var fs=require('fs');var path=require(_0x37d0('0x5'));var rimraf=require(_0x37d0('0x6'));var config=require(_0x37d0('0x7'));var attributes=require(_0x37d0('0x8'));module[_0x37d0('0x9')]=function(_0xf9fa72,_0x425d11){return _0xf9fa72['define'](_0x37d0('0xa'),attributes,{'tableName':_0x37d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 8c52d18..647e312 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3cb21e,_0x11849a){var _0xeacd6a=function(_0xef5a2e){while(--_0xef5a2e){_0x3cb21e['push'](_0x3cb21e['shift']());}};_0xeacd6a(++_0x11849a);}(_0xadb5,0xad));var _0x5adb=function(_0x313326,_0x30805b){_0x313326=_0x313326-0x0;var _0x457219=_0xadb5[_0x313326];return _0x457219;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x7992e2,_0x4f22c1){var _0x49a0b2=function(_0x110a16){while(--_0x110a16){_0x7992e2['push'](_0x7992e2['shift']());}};_0x49a0b2(++_0x4f22c1);}(_0x1261,0x144));var _0x1126=function(_0x491b60,_0x4dcc2c){_0x491b60=_0x491b60-0x0;var _0x461a23=_0x1261[_0x491b60];return _0x461a23;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index c1b11ae..b5698b4 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x734f=['delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x734f,0x71));var _0xf734=function(_0x58b62a,_0x1205a6){_0x58b62a=_0x58b62a-0x0;var _0x5c86be=_0x734f[_0x58b62a];return _0x5c86be;};'use strict';var multer=require(_0xf734('0x0'));var util=require(_0xf734('0x1'));var path=require('path');var timeout=require(_0xf734('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf734('0x3'));var auth=require(_0xf734('0x4'));var interaction=require(_0xf734('0x5'));var config=require(_0xf734('0x6'));var controller=require('./interval.controller');router[_0xf734('0x7')]('/',auth[_0xf734('0x8')](),controller[_0xf734('0x9')]);router[_0xf734('0x7')](_0xf734('0xa'),auth[_0xf734('0x8')](),controller[_0xf734('0xb')]);router['get'](_0xf734('0xc'),auth[_0xf734('0x8')](),controller['getIntervals']);router[_0xf734('0xd')]('/',auth[_0xf734('0x8')](),controller[_0xf734('0xe')]);router[_0xf734('0xd')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0xf734('0xf')]);router[_0xf734('0xd')](_0xf734('0x10'),auth['isAuthenticated'](),controller[_0xf734('0x11')]);router[_0xf734('0x12')](_0xf734('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xf734('0x13')](_0xf734('0xa'),auth[_0xf734('0x8')](),controller[_0xf734('0x14')]);module[_0xf734('0x15')]=router; \ No newline at end of file +var _0x980e=['../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','put','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0x4c45c9,_0x3fcb80){var _0x6ee1e7=function(_0x347202){while(--_0x347202){_0x4c45c9['push'](_0x4c45c9['shift']());}};_0x6ee1e7(++_0x3fcb80);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe980('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe980('0x1'));var express=require('express');var router=express[_0xe980('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe980('0x3'));var interaction=require(_0xe980('0x4'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0xe980('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe980('0x5')](_0xe980('0x6'),auth[_0xe980('0x7')](),controller[_0xe980('0x8')]);router[_0xe980('0x5')](_0xe980('0x9'),auth['isAuthenticated'](),controller[_0xe980('0xa')]);router[_0xe980('0xb')]('/',auth[_0xe980('0x7')](),controller['create']);router[_0xe980('0xb')](_0xe980('0x9'),auth[_0xe980('0x7')](),controller[_0xe980('0xc')]);router[_0xe980('0xb')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller['addIntervals']);router[_0xe980('0xd')](_0xe980('0x6'),auth['isAuthenticated'](),controller['update']);router[_0xe980('0xe')](_0xe980('0x6'),auth[_0xe980('0x7')](),controller[_0xe980('0xf')]);module[_0xe980('0x10')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 8f4b42f..4ccb663 100644 --- a/server/api/interval/interval.attributes.js +++ b/server/api/interval/interval.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d90=['sequelize','exports','STRING'];(function(_0x282f4b,_0x4be939){var _0x3d4794=function(_0x3d7477){while(--_0x3d7477){_0x282f4b['push'](_0x282f4b['shift']());}};_0x3d4794(++_0x4be939);}(_0x9d90,0x198));var _0x09d9=function(_0x56bb97,_0x10957d){_0x56bb97=_0x56bb97-0x0;var _0x1b26f4=_0x9d90[_0x56bb97];return _0x1b26f4;};'use strict';var Sequelize=require(_0x09d9('0x0'));module[_0x09d9('0x1')]={'name':{'type':Sequelize[_0x09d9('0x2')]},'description':{'type':Sequelize[_0x09d9('0x2')]},'interval':{'type':Sequelize[_0x09d9('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2568=['STRING','exports'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x2568,0x89));var _0x8256=function(_0x211bba,_0x4d6c40){_0x211bba=_0x211bba-0x0;var _0x5d1886=_0x2568[_0x211bba];return _0x5d1886;};'use strict';var Sequelize=require('sequelize');module[_0x8256('0x0')]={'name':{'type':Sequelize[_0x8256('0x1')]},'description':{'type':Sequelize[_0x8256('0x1')]},'interval':{'type':Sequelize[_0x8256('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index d6003ae..e052a7d 100644 --- a/server/api/interval/interval.controller.js +++ b/server/api/interval/interval.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc587=['Interval','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Intervals','UserProfileResource','error','name','send','index','map'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0xc587,0x8d));var _0x7c58=function(_0x1dc7c7,_0xabfebe){_0x1dc7c7=_0x1dc7c7-0x0;var _0x217cf3=_0xc587[_0x1dc7c7];return _0x217cf3;};'use strict';var emlformat=require(_0x7c58('0x0'));var rimraf=require(_0x7c58('0x1'));var zipdir=require(_0x7c58('0x2'));var jsonpatch=require(_0x7c58('0x3'));var rp=require('request-promise');var moment=require(_0x7c58('0x4'));var BPromise=require(_0x7c58('0x5'));var Mustache=require(_0x7c58('0x6'));var util=require(_0x7c58('0x7'));var path=require(_0x7c58('0x8'));var sox=require(_0x7c58('0x9'));var csv=require(_0x7c58('0xa'));var ejs=require(_0x7c58('0xb'));var fs=require('fs');var fs_extra=require(_0x7c58('0xc'));var _=require(_0x7c58('0xd'));var squel=require(_0x7c58('0xe'));var crypto=require('crypto');var jsforce=require(_0x7c58('0xf'));var deskjs=require(_0x7c58('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7c58('0x11'));var Papa=require(_0x7c58('0x12'));var Redis=require('ioredis');var authService=require(_0x7c58('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c58('0x14'));var logger=require(_0x7c58('0x15'))(_0x7c58('0x16'));var utils=require(_0x7c58('0x17'));var config=require(_0x7c58('0x18'));var licenseUtil=require(_0x7c58('0x19'));var db=require(_0x7c58('0x1a'))['db'];var extensions=require(_0x7c58('0x1b'));function respondWithStatusCode(_0x28ba7e,_0x28b580){_0x28b580=_0x28b580||0xcc;return function(_0x36d805){if(_0x36d805){return _0x28ba7e[_0x7c58('0x1c')](_0x28b580);}return _0x28ba7e[_0x7c58('0x1d')](_0x28b580)[_0x7c58('0x1e')]();};}function respondWithResult(_0x512939,_0x12b4fc){_0x12b4fc=_0x12b4fc||0xc8;return function(_0x2341be){if(_0x2341be){return _0x512939[_0x7c58('0x1d')](_0x12b4fc)['json'](_0x2341be);}};}function respondWithFilteredResult(_0x5027a4,_0x22900d){return function(_0x4a56e3){if(_0x4a56e3){var _0x4b1b9f=typeof _0x22900d[_0x7c58('0x1f')]===_0x7c58('0x20')&&typeof _0x22900d[_0x7c58('0x21')]==='undefined';var _0x16d305=_0x4a56e3[_0x7c58('0x22')];var _0x77d684=_0x4b1b9f?0x0:_0x22900d[_0x7c58('0x1f')];var _0x57fd6d=_0x4b1b9f?_0x4a56e3[_0x7c58('0x22')]:_0x22900d[_0x7c58('0x1f')]+_0x22900d[_0x7c58('0x21')];var _0x2eb310;if(_0x57fd6d>=_0x16d305){_0x57fd6d=_0x16d305;_0x2eb310=0xc8;}else{_0x2eb310=0xce;}_0x5027a4['status'](_0x2eb310);return _0x5027a4[_0x7c58('0x23')](_0x7c58('0x24'),_0x77d684+'-'+_0x57fd6d+'/'+_0x16d305)[_0x7c58('0x25')](_0x4a56e3);}return null;};}function patchUpdates(_0x4cb95b){return function(_0x41d2e8){try{jsonpatch[_0x7c58('0x26')](_0x41d2e8,_0x4cb95b,!![]);}catch(_0x22f02f){return BPromise[_0x7c58('0x27')](_0x22f02f);}return _0x41d2e8['save']();};}function saveUpdates(_0x26179c,_0x2474ab){return function(_0x3a8826){if(_0x3a8826){return _0x3a8826[_0x7c58('0x28')](_0x26179c)[_0x7c58('0x29')](function(_0xec15dd){return _0xec15dd;});}return null;};}function removeEntity(_0x1f71fd,_0x4048cf){return function(_0x1db5a3){if(_0x1db5a3){return _0x1db5a3[_0x7c58('0x2a')]()[_0x7c58('0x29')](function(){var _0x4fe7aa=_0x1db5a3[_0x7c58('0x2b')]({'plain':!![]});var _0xbbe513=_0x7c58('0x2c');return db[_0x7c58('0x2d')][_0x7c58('0x2a')]({'where':{'type':_0xbbe513,'resourceId':_0x4fe7aa['id']}})['then'](function(){return _0x1db5a3;});})['then'](function(){_0x1f71fd[_0x7c58('0x1d')](0xcc)[_0x7c58('0x1e')]();});}};}function handleEntityNotFound(_0x1f6d02,_0x4e2c87){return function(_0x3491ac){if(!_0x3491ac){_0x1f6d02[_0x7c58('0x1c')](0x194);}return _0x3491ac;};}function handleError(_0x4e35de,_0x52205b){_0x52205b=_0x52205b||0x1f4;return function(_0x8bb676){logger[_0x7c58('0x2e')](_0x8bb676['stack']);if(_0x8bb676['name']){delete _0x8bb676[_0x7c58('0x2f')];}_0x4e35de['status'](_0x52205b)[_0x7c58('0x30')](_0x8bb676);};}exports[_0x7c58('0x31')]=function(_0x1cc6fa,_0x24f939){var _0x434370={},_0x2acfb8={},_0x46a5dd={'count':0x0,'rows':[]};var _0x1677d8=_[_0x7c58('0x32')](db[_0x7c58('0x33')][_0x7c58('0x34')],function(_0xfad415){return{'name':_0xfad415[_0x7c58('0x35')],'type':_0xfad415[_0x7c58('0x36')][_0x7c58('0x37')]};});_0x2acfb8['model']=_['map'](_0x1677d8,_0x7c58('0x2f'));_0x2acfb8['query']=_[_0x7c58('0x38')](_0x1cc6fa[_0x7c58('0x39')]);_0x2acfb8[_0x7c58('0x3a')]=_[_0x7c58('0x3b')](_0x2acfb8[_0x7c58('0x3c')],_0x2acfb8[_0x7c58('0x39')]);_0x434370[_0x7c58('0x3d')]=_[_0x7c58('0x3b')](_0x2acfb8['model'],qs[_0x7c58('0x3e')](_0x1cc6fa[_0x7c58('0x39')][_0x7c58('0x3e')]));_0x434370[_0x7c58('0x3d')]=_0x434370[_0x7c58('0x3d')]['length']?_0x434370['attributes']:_0x2acfb8['model'];if(!_0x1cc6fa[_0x7c58('0x39')][_0x7c58('0x3f')](_0x7c58('0x40'))){_0x434370[_0x7c58('0x21')]=qs[_0x7c58('0x21')](_0x1cc6fa['query'][_0x7c58('0x21')]);_0x434370[_0x7c58('0x1f')]=qs[_0x7c58('0x1f')](_0x1cc6fa['query']['offset']);}_0x434370[_0x7c58('0x41')]=qs[_0x7c58('0x42')](_0x1cc6fa[_0x7c58('0x39')][_0x7c58('0x42')]);_0x434370['where']=qs[_0x7c58('0x3a')](_[_0x7c58('0x43')](_0x1cc6fa[_0x7c58('0x39')],_0x2acfb8[_0x7c58('0x3a')]),_0x1677d8);if(_0x1cc6fa[_0x7c58('0x39')][_0x7c58('0x44')]){_0x434370[_0x7c58('0x45')]=_[_0x7c58('0x46')](_0x434370['where'],{'$or':_['map'](_0x1677d8,function(_0x4a8606){if(_0x4a8606[_0x7c58('0x36')]!==_0x7c58('0x47')){var _0x2b9b4e={};_0x2b9b4e[_0x4a8606[_0x7c58('0x2f')]]={'$like':'%'+_0x1cc6fa[_0x7c58('0x39')]['filter']+'%'};return _0x2b9b4e;}})});}_0x434370=_[_0x7c58('0x46')]({},_0x434370,_0x1cc6fa[_0x7c58('0x48')]);var _0x16ee8d={'where':_0x434370[_0x7c58('0x45')]};return db[_0x7c58('0x33')][_0x7c58('0x22')](_0x16ee8d)[_0x7c58('0x29')](function(_0x517887){_0x46a5dd[_0x7c58('0x22')]=_0x517887;if(_0x1cc6fa[_0x7c58('0x39')][_0x7c58('0x49')]){_0x434370[_0x7c58('0x4a')]=[{'all':!![]}];}return db[_0x7c58('0x33')][_0x7c58('0x4b')](_0x434370);})[_0x7c58('0x29')](function(_0x68bbb6){_0x46a5dd[_0x7c58('0x4c')]=_0x68bbb6;return _0x46a5dd;})[_0x7c58('0x29')](respondWithFilteredResult(_0x24f939,_0x434370))[_0x7c58('0x4d')](handleError(_0x24f939,null));};exports['show']=function(_0x202e47,_0x142688){var _0x18d252={'raw':!![],'where':{'id':_0x202e47[_0x7c58('0x4e')]['id']}},_0x347d88={};_0x347d88['model']=_[_0x7c58('0x38')](db[_0x7c58('0x33')][_0x7c58('0x34')]);_0x347d88[_0x7c58('0x39')]=_[_0x7c58('0x38')](_0x202e47[_0x7c58('0x39')]);_0x347d88[_0x7c58('0x3a')]=_['intersection'](_0x347d88[_0x7c58('0x3c')],_0x347d88['query']);_0x18d252['attributes']=_[_0x7c58('0x3b')](_0x347d88[_0x7c58('0x3c')],qs[_0x7c58('0x3e')](_0x202e47[_0x7c58('0x39')][_0x7c58('0x3e')]));_0x18d252['attributes']=_0x18d252['attributes'][_0x7c58('0x4f')]?_0x18d252['attributes']:_0x347d88[_0x7c58('0x3c')];if(_0x202e47['query'][_0x7c58('0x49')]){_0x18d252[_0x7c58('0x4a')]=[{'all':!![]}];}_0x18d252=_[_0x7c58('0x46')]({},_0x18d252,_0x202e47['options']);return db[_0x7c58('0x33')][_0x7c58('0x50')](_0x18d252)[_0x7c58('0x29')](handleEntityNotFound(_0x142688,null))['then'](respondWithResult(_0x142688,null))[_0x7c58('0x4d')](handleError(_0x142688,null));};exports[_0x7c58('0x51')]=function(_0x470d2d,_0x2f1f37){return db[_0x7c58('0x33')][_0x7c58('0x51')](_0x470d2d[_0x7c58('0x52')],{})[_0x7c58('0x29')](function(_0x1e1c99){var _0x1cfd6b=_0x470d2d[_0x7c58('0x53')]['get']({'plain':!![]});if(!_0x1cfd6b)throw new Error(_0x7c58('0x54'));if(_0x1cfd6b['role']===_0x7c58('0x53')){var _0x43eb98=_0x1e1c99[_0x7c58('0x2b')]({'plain':!![]});var _0x2fabc8=_0x7c58('0x2c');return db[_0x7c58('0x55')][_0x7c58('0x50')]({'where':{'name':_0x2fabc8,'userProfileId':_0x1cfd6b[_0x7c58('0x56')]},'raw':!![]})[_0x7c58('0x29')](function(_0x2c8f6f){if(_0x2c8f6f&&_0x2c8f6f[_0x7c58('0x57')]===0x0){return db['UserProfileResource'][_0x7c58('0x51')]({'name':_0x43eb98[_0x7c58('0x2f')],'resourceId':_0x43eb98['id'],'type':_0x2c8f6f[_0x7c58('0x2f')],'sectionId':_0x2c8f6f['id']},{})[_0x7c58('0x29')](function(){return _0x1e1c99;});}else{return _0x1e1c99;}})[_0x7c58('0x4d')](function(_0xa5c4b5){logger[_0x7c58('0x2e')](_0x7c58('0x58'),_0xa5c4b5);throw _0xa5c4b5;});}return _0x1e1c99;})['then'](respondWithResult(_0x2f1f37,0xc9))[_0x7c58('0x4d')](handleError(_0x2f1f37,null));};exports[_0x7c58('0x28')]=function(_0x11e4a9,_0x2e3b6a){if(_0x11e4a9[_0x7c58('0x52')]['id']){delete _0x11e4a9[_0x7c58('0x52')]['id'];}return db[_0x7c58('0x33')][_0x7c58('0x50')]({'where':{'id':_0x11e4a9[_0x7c58('0x4e')]['id']}})[_0x7c58('0x29')](handleEntityNotFound(_0x2e3b6a,null))[_0x7c58('0x29')](saveUpdates(_0x11e4a9[_0x7c58('0x52')],null))[_0x7c58('0x29')](respondWithResult(_0x2e3b6a,null))[_0x7c58('0x4d')](handleError(_0x2e3b6a,null));};exports['destroy']=function(_0x314fa2,_0xb4628f){return db[_0x7c58('0x33')]['find']({'where':{'id':_0x314fa2[_0x7c58('0x4e')]['id']}})[_0x7c58('0x29')](handleEntityNotFound(_0xb4628f,null))[_0x7c58('0x29')](removeEntity(_0xb4628f,null))[_0x7c58('0x4d')](handleError(_0xb4628f,null));};exports[_0x7c58('0x59')]=function(_0x2a19de,_0x123cfb,_0x34790d){if(_0x2a19de['body']['id']){delete _0x2a19de[_0x7c58('0x52')]['id'];}return db['Interval'][_0x7c58('0x50')]({'where':{'id':_0x2a19de[_0x7c58('0x4e')]['id']}})[_0x7c58('0x29')](handleEntityNotFound(_0x123cfb,null))[_0x7c58('0x29')](function(_0x5aa508){if(_0x5aa508){_0x2a19de[_0x7c58('0x52')][_0x7c58('0x5a')]=_0x5aa508['id'];return db[_0x7c58('0x33')][_0x7c58('0x51')](_0x2a19de[_0x7c58('0x52')]);}})['then'](respondWithResult(_0x123cfb,null))[_0x7c58('0x4d')](handleError(_0x123cfb,null));};exports[_0x7c58('0x5b')]=function(_0x37c7a3,_0x64aff5,_0x246a6a){var _0x176aa7={};var _0x4597f9={};var _0x44024c;var _0x2b7020;return db[_0x7c58('0x33')]['findOne']({'where':{'id':_0x37c7a3[_0x7c58('0x4e')]['id']}})[_0x7c58('0x29')](handleEntityNotFound(_0x64aff5,null))[_0x7c58('0x29')](function(_0x3751d5){if(_0x3751d5){_0x44024c=_0x3751d5;_0x4597f9['model']=_[_0x7c58('0x38')](db[_0x7c58('0x33')][_0x7c58('0x34')]);_0x4597f9[_0x7c58('0x39')]=_[_0x7c58('0x38')](_0x37c7a3[_0x7c58('0x39')]);_0x4597f9[_0x7c58('0x3a')]=_['intersection'](_0x4597f9[_0x7c58('0x3c')],_0x4597f9[_0x7c58('0x39')]);_0x176aa7[_0x7c58('0x3d')]=_['intersection'](_0x4597f9[_0x7c58('0x3c')],qs[_0x7c58('0x3e')](_0x37c7a3['query'][_0x7c58('0x3e')]));_0x176aa7[_0x7c58('0x3d')]=_0x176aa7[_0x7c58('0x3d')][_0x7c58('0x4f')]?_0x176aa7[_0x7c58('0x3d')]:_0x4597f9[_0x7c58('0x3c')];_0x176aa7[_0x7c58('0x41')]=qs[_0x7c58('0x42')](_0x37c7a3[_0x7c58('0x39')]['sort']);_0x176aa7[_0x7c58('0x45')]=qs['filters'](_[_0x7c58('0x43')](_0x37c7a3[_0x7c58('0x39')],_0x4597f9[_0x7c58('0x3a')]));if(_0x37c7a3[_0x7c58('0x39')][_0x7c58('0x44')]){_0x176aa7[_0x7c58('0x45')]=_[_0x7c58('0x46')](_0x176aa7[_0x7c58('0x45')],{'$or':_[_0x7c58('0x32')](_0x176aa7[_0x7c58('0x3d')],function(_0x4f0bcb){var _0xa8afd0={};_0xa8afd0[_0x4f0bcb]={'$like':'%'+_0x37c7a3[_0x7c58('0x39')]['filter']+'%'};return _0xa8afd0;})});}_0x176aa7=_[_0x7c58('0x46')]({},_0x176aa7,_0x37c7a3['options']);return _0x44024c[_0x7c58('0x5b')](_0x176aa7);}})[_0x7c58('0x29')](function(_0xa5122b){if(_0xa5122b){_0x2b7020=_0xa5122b['length'];if(!_0x37c7a3[_0x7c58('0x39')][_0x7c58('0x3f')](_0x7c58('0x40'))){_0x176aa7[_0x7c58('0x21')]=qs[_0x7c58('0x21')](_0x37c7a3[_0x7c58('0x39')]['limit']);_0x176aa7['offset']=qs[_0x7c58('0x1f')](_0x37c7a3[_0x7c58('0x39')]['offset']);}return _0x44024c[_0x7c58('0x5b')](_0x176aa7);}})[_0x7c58('0x29')](function(_0x5b75cb){if(_0x5b75cb){return _0x5b75cb?{'count':_0x2b7020,'rows':_0x5b75cb}:null;}})[_0x7c58('0x29')](respondWithResult(_0x64aff5,null))['catch'](handleError(_0x64aff5,null));};exports['addIntervals']=function(_0x657930,_0x553fb1,_0x368512){return db[_0x7c58('0x33')][_0x7c58('0x5c')]({'where':{'id':_0x657930['params']['id']}})[_0x7c58('0x29')](handleEntityNotFound(_0x553fb1,null))[_0x7c58('0x29')](function(_0x3470c1){if(_0x3470c1){return db[_0x7c58('0x5d')][_0x7c58('0x5e')](function(_0x3e78d9){return db['Interval']['destroy']({'where':{'IntervalId':_0x657930[_0x7c58('0x4e')]['id']},'transaction':_0x3e78d9})[_0x7c58('0x29')](function(_0x3d842d){var _0x275f74=_[_0x7c58('0x32')](_0x657930[_0x7c58('0x52')],function(_0x5ad991){delete _0x5ad991['id'];_0x5ad991['IntervalId']=_0x657930[_0x7c58('0x4e')]['id'];return _0x5ad991;});return db[_0x7c58('0x33')][_0x7c58('0x5f')](_0x275f74,{'transaction':_0x3e78d9});});})[_0x7c58('0x29')](function(){return db[_0x7c58('0x33')]['findAll']({'where':{'IntervalId':_0x657930[_0x7c58('0x4e')]['id']}});});}})[_0x7c58('0x29')](respondWithResult(_0x553fb1,null))[_0x7c58('0x4d')](handleError(_0x553fb1,null));}; \ No newline at end of file +var _0xdfda=['count','set','Content-Range','json','apply','reject','save','update','then','get','Intervals','UserProfileResource','destroy','status','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','Interval','length','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','offset'];(function(_0x44d117,_0x5919fe){var _0x27e936=function(_0x112829){while(--_0x112829){_0x44d117['push'](_0x44d117['shift']());}};_0x27e936(++_0x5919fe);}(_0xdfda,0xa1));var _0xadfd=function(_0x30359a,_0x3e2edd){_0x30359a=_0x30359a-0x0;var _0x46d0e5=_0xdfda[_0x30359a];return _0x46d0e5;};'use strict';var emlformat=require(_0xadfd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xadfd('0x1'));var jsonpatch=require(_0xadfd('0x2'));var rp=require(_0xadfd('0x3'));var moment=require('moment');var BPromise=require(_0xadfd('0x4'));var Mustache=require('mustache');var util=require(_0xadfd('0x5'));var path=require('path');var sox=require(_0xadfd('0x6'));var csv=require('to-csv');var ejs=require(_0xadfd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadfd('0x8'));var squel=require(_0xadfd('0x9'));var crypto=require(_0xadfd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xadfd('0xb'));var toCsv=require(_0xadfd('0xc'));var querystring=require(_0xadfd('0xd'));var Papa=require(_0xadfd('0xe'));var Redis=require(_0xadfd('0xf'));var authService=require(_0xadfd('0x10'));var qs=require(_0xadfd('0x11'));var as=require(_0xadfd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xadfd('0x13'));var utils=require(_0xadfd('0x14'));var config=require(_0xadfd('0x15'));var licenseUtil=require(_0xadfd('0x16'));var db=require(_0xadfd('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x45e30d,_0x1a9c0a){_0x1a9c0a=_0x1a9c0a||0xcc;return function(_0x546834){if(_0x546834){return _0x45e30d[_0xadfd('0x18')](_0x1a9c0a);}return _0x45e30d['status'](_0x1a9c0a)[_0xadfd('0x19')]();};}function respondWithResult(_0x431f57,_0x5d360f){_0x5d360f=_0x5d360f||0xc8;return function(_0x143df5){if(_0x143df5){return _0x431f57['status'](_0x5d360f)['json'](_0x143df5);}};}function respondWithFilteredResult(_0x417d46,_0x201af9){return function(_0x4772b1){if(_0x4772b1){var _0xf9cf4d=typeof _0x201af9['offset']===_0xadfd('0x1a')&&typeof _0x201af9[_0xadfd('0x1b')]==='undefined';var _0x53808e=_0x4772b1['count'];var _0x1db44d=_0xf9cf4d?0x0:_0x201af9[_0xadfd('0x1c')];var _0x5b1186=_0xf9cf4d?_0x4772b1[_0xadfd('0x1d')]:_0x201af9['offset']+_0x201af9['limit'];var _0x1bb056;if(_0x5b1186>=_0x53808e){_0x5b1186=_0x53808e;_0x1bb056=0xc8;}else{_0x1bb056=0xce;}_0x417d46['status'](_0x1bb056);return _0x417d46[_0xadfd('0x1e')](_0xadfd('0x1f'),_0x1db44d+'-'+_0x5b1186+'/'+_0x53808e)[_0xadfd('0x20')](_0x4772b1);}return null;};}function patchUpdates(_0x3221c2){return function(_0x26e3ba){try{jsonpatch[_0xadfd('0x21')](_0x26e3ba,_0x3221c2,!![]);}catch(_0x21f26a){return BPromise[_0xadfd('0x22')](_0x21f26a);}return _0x26e3ba[_0xadfd('0x23')]();};}function saveUpdates(_0x5d9229,_0x184122){return function(_0x252741){if(_0x252741){return _0x252741[_0xadfd('0x24')](_0x5d9229)[_0xadfd('0x25')](function(_0x2c478d){return _0x2c478d;});}return null;};}function removeEntity(_0x112a99,_0x3c3c7a){return function(_0x48c4d1){if(_0x48c4d1){return _0x48c4d1['destroy']()[_0xadfd('0x25')](function(){var _0x5470ad=_0x48c4d1[_0xadfd('0x26')]({'plain':!![]});var _0x3d6917=_0xadfd('0x27');return db[_0xadfd('0x28')][_0xadfd('0x29')]({'where':{'type':_0x3d6917,'resourceId':_0x5470ad['id']}})[_0xadfd('0x25')](function(){return _0x48c4d1;});})['then'](function(){_0x112a99[_0xadfd('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x345c09,_0x306d0d){return function(_0xa66f12){if(!_0xa66f12){_0x345c09[_0xadfd('0x18')](0x194);}return _0xa66f12;};}function handleError(_0x26a00d,_0x3f1816){_0x3f1816=_0x3f1816||0x1f4;return function(_0x2033a8){logger['error'](_0x2033a8[_0xadfd('0x2b')]);if(_0x2033a8[_0xadfd('0x2c')]){delete _0x2033a8['name'];}_0x26a00d[_0xadfd('0x2a')](_0x3f1816)[_0xadfd('0x2d')](_0x2033a8);};}exports[_0xadfd('0x2e')]=function(_0x1a497a,_0x3f48a3){var _0x2de381={},_0x3579ab={},_0x584ae2={'count':0x0,'rows':[]};var _0x379e0d=_['map'](db['Interval'][_0xadfd('0x2f')],function(_0x2391c7){return{'name':_0x2391c7[_0xadfd('0x30')],'type':_0x2391c7['type'][_0xadfd('0x31')]};});_0x3579ab[_0xadfd('0x32')]=_[_0xadfd('0x33')](_0x379e0d,_0xadfd('0x2c'));_0x3579ab[_0xadfd('0x34')]=_[_0xadfd('0x35')](_0x1a497a['query']);_0x3579ab[_0xadfd('0x36')]=_[_0xadfd('0x37')](_0x3579ab[_0xadfd('0x32')],_0x3579ab[_0xadfd('0x34')]);_0x2de381[_0xadfd('0x38')]=_[_0xadfd('0x37')](_0x3579ab[_0xadfd('0x32')],qs[_0xadfd('0x39')](_0x1a497a[_0xadfd('0x34')][_0xadfd('0x39')]));_0x2de381['attributes']=_0x2de381[_0xadfd('0x38')]['length']?_0x2de381[_0xadfd('0x38')]:_0x3579ab[_0xadfd('0x32')];if(!_0x1a497a[_0xadfd('0x34')][_0xadfd('0x3a')](_0xadfd('0x3b'))){_0x2de381['limit']=qs[_0xadfd('0x1b')](_0x1a497a[_0xadfd('0x34')][_0xadfd('0x1b')]);_0x2de381[_0xadfd('0x1c')]=qs[_0xadfd('0x1c')](_0x1a497a['query']['offset']);}_0x2de381[_0xadfd('0x3c')]=qs['sort'](_0x1a497a[_0xadfd('0x34')][_0xadfd('0x3d')]);_0x2de381['where']=qs[_0xadfd('0x36')](_[_0xadfd('0x3e')](_0x1a497a[_0xadfd('0x34')],_0x3579ab[_0xadfd('0x36')]),_0x379e0d);if(_0x1a497a['query'][_0xadfd('0x3f')]){_0x2de381[_0xadfd('0x40')]=_[_0xadfd('0x41')](_0x2de381[_0xadfd('0x40')],{'$or':_['map'](_0x379e0d,function(_0x246884){if(_0x246884[_0xadfd('0x42')]!=='VIRTUAL'){var _0x3a4d57={};_0x3a4d57[_0x246884[_0xadfd('0x2c')]]={'$like':'%'+_0x1a497a[_0xadfd('0x34')][_0xadfd('0x3f')]+'%'};return _0x3a4d57;}})});}_0x2de381=_['merge']({},_0x2de381,_0x1a497a[_0xadfd('0x43')]);var _0x2fa532={'where':_0x2de381[_0xadfd('0x40')]};return db['Interval'][_0xadfd('0x1d')](_0x2fa532)[_0xadfd('0x25')](function(_0x5e1fbc){_0x584ae2['count']=_0x5e1fbc;if(_0x1a497a[_0xadfd('0x34')][_0xadfd('0x44')]){_0x2de381[_0xadfd('0x45')]=[{'all':!![]}];}return db['Interval'][_0xadfd('0x46')](_0x2de381);})[_0xadfd('0x25')](function(_0x43937b){_0x584ae2[_0xadfd('0x47')]=_0x43937b;return _0x584ae2;})[_0xadfd('0x25')](respondWithFilteredResult(_0x3f48a3,_0x2de381))['catch'](handleError(_0x3f48a3,null));};exports['show']=function(_0x3a0967,_0xb1d0de){var _0x2cd53d={'raw':!![],'where':{'id':_0x3a0967['params']['id']}},_0x183b2f={};_0x183b2f[_0xadfd('0x32')]=_['keys'](db[_0xadfd('0x48')][_0xadfd('0x2f')]);_0x183b2f[_0xadfd('0x34')]=_['keys'](_0x3a0967['query']);_0x183b2f[_0xadfd('0x36')]=_[_0xadfd('0x37')](_0x183b2f['model'],_0x183b2f[_0xadfd('0x34')]);_0x2cd53d[_0xadfd('0x38')]=_[_0xadfd('0x37')](_0x183b2f[_0xadfd('0x32')],qs[_0xadfd('0x39')](_0x3a0967['query'][_0xadfd('0x39')]));_0x2cd53d[_0xadfd('0x38')]=_0x2cd53d[_0xadfd('0x38')][_0xadfd('0x49')]?_0x2cd53d[_0xadfd('0x38')]:_0x183b2f['model'];if(_0x3a0967[_0xadfd('0x34')][_0xadfd('0x44')]){_0x2cd53d[_0xadfd('0x45')]=[{'all':!![]}];}_0x2cd53d=_['merge']({},_0x2cd53d,_0x3a0967[_0xadfd('0x43')]);return db[_0xadfd('0x48')]['find'](_0x2cd53d)['then'](handleEntityNotFound(_0xb1d0de,null))[_0xadfd('0x25')](respondWithResult(_0xb1d0de,null))[_0xadfd('0x4a')](handleError(_0xb1d0de,null));};exports[_0xadfd('0x4b')]=function(_0x59f03a,_0x55fac0){return db['Interval'][_0xadfd('0x4b')](_0x59f03a['body'],{})[_0xadfd('0x25')](function(_0x1019bf){var _0x39984e=_0x59f03a[_0xadfd('0x4c')][_0xadfd('0x26')]({'plain':!![]});if(!_0x39984e)throw new Error(_0xadfd('0x4d'));if(_0x39984e[_0xadfd('0x4e')]===_0xadfd('0x4c')){var _0x95352e=_0x1019bf[_0xadfd('0x26')]({'plain':!![]});var _0x23aec7='Intervals';return db[_0xadfd('0x4f')][_0xadfd('0x50')]({'where':{'name':_0x23aec7,'userProfileId':_0x39984e[_0xadfd('0x51')]},'raw':!![]})[_0xadfd('0x25')](function(_0x707d24){if(_0x707d24&&_0x707d24[_0xadfd('0x52')]===0x0){return db[_0xadfd('0x28')][_0xadfd('0x4b')]({'name':_0x95352e[_0xadfd('0x2c')],'resourceId':_0x95352e['id'],'type':_0x707d24[_0xadfd('0x2c')],'sectionId':_0x707d24['id']},{})[_0xadfd('0x25')](function(){return _0x1019bf;});}else{return _0x1019bf;}})[_0xadfd('0x4a')](function(_0x5c1da4){logger[_0xadfd('0x53')](_0xadfd('0x54'),_0x5c1da4);throw _0x5c1da4;});}return _0x1019bf;})['then'](respondWithResult(_0x55fac0,0xc9))[_0xadfd('0x4a')](handleError(_0x55fac0,null));};exports[_0xadfd('0x24')]=function(_0x5aa5b7,_0x30db31){if(_0x5aa5b7['body']['id']){delete _0x5aa5b7[_0xadfd('0x55')]['id'];}return db[_0xadfd('0x48')][_0xadfd('0x50')]({'where':{'id':_0x5aa5b7[_0xadfd('0x56')]['id']}})[_0xadfd('0x25')](handleEntityNotFound(_0x30db31,null))['then'](saveUpdates(_0x5aa5b7['body'],null))['then'](respondWithResult(_0x30db31,null))['catch'](handleError(_0x30db31,null));};exports[_0xadfd('0x29')]=function(_0x4822ab,_0x3843a4){return db['Interval'][_0xadfd('0x50')]({'where':{'id':_0x4822ab['params']['id']}})[_0xadfd('0x25')](handleEntityNotFound(_0x3843a4,null))[_0xadfd('0x25')](removeEntity(_0x3843a4,null))[_0xadfd('0x4a')](handleError(_0x3843a4,null));};exports[_0xadfd('0x57')]=function(_0x33c38b,_0x88e42b,_0x32f0a0){if(_0x33c38b[_0xadfd('0x55')]['id']){delete _0x33c38b[_0xadfd('0x55')]['id'];}return db[_0xadfd('0x48')][_0xadfd('0x50')]({'where':{'id':_0x33c38b[_0xadfd('0x56')]['id']}})['then'](handleEntityNotFound(_0x88e42b,null))['then'](function(_0x4ab444){if(_0x4ab444){_0x33c38b[_0xadfd('0x55')][_0xadfd('0x58')]=_0x4ab444['id'];return db['Interval']['create'](_0x33c38b[_0xadfd('0x55')]);}})[_0xadfd('0x25')](respondWithResult(_0x88e42b,null))[_0xadfd('0x4a')](handleError(_0x88e42b,null));};exports[_0xadfd('0x59')]=function(_0x4da2a7,_0x533afe,_0x86e938){var _0x3e7b06={};var _0x1efd3b={};var _0xb2e522;var _0x1f4474;return db[_0xadfd('0x48')][_0xadfd('0x5a')]({'where':{'id':_0x4da2a7[_0xadfd('0x56')]['id']}})['then'](handleEntityNotFound(_0x533afe,null))['then'](function(_0x31d80b){if(_0x31d80b){_0xb2e522=_0x31d80b;_0x1efd3b['model']=_['keys'](db[_0xadfd('0x48')][_0xadfd('0x2f')]);_0x1efd3b[_0xadfd('0x34')]=_[_0xadfd('0x35')](_0x4da2a7[_0xadfd('0x34')]);_0x1efd3b['filters']=_[_0xadfd('0x37')](_0x1efd3b[_0xadfd('0x32')],_0x1efd3b[_0xadfd('0x34')]);_0x3e7b06[_0xadfd('0x38')]=_[_0xadfd('0x37')](_0x1efd3b[_0xadfd('0x32')],qs[_0xadfd('0x39')](_0x4da2a7[_0xadfd('0x34')][_0xadfd('0x39')]));_0x3e7b06[_0xadfd('0x38')]=_0x3e7b06[_0xadfd('0x38')][_0xadfd('0x49')]?_0x3e7b06['attributes']:_0x1efd3b[_0xadfd('0x32')];_0x3e7b06['order']=qs[_0xadfd('0x3d')](_0x4da2a7['query']['sort']);_0x3e7b06['where']=qs[_0xadfd('0x36')](_[_0xadfd('0x3e')](_0x4da2a7[_0xadfd('0x34')],_0x1efd3b['filters']));if(_0x4da2a7[_0xadfd('0x34')]['filter']){_0x3e7b06[_0xadfd('0x40')]=_[_0xadfd('0x41')](_0x3e7b06[_0xadfd('0x40')],{'$or':_['map'](_0x3e7b06['attributes'],function(_0x2eb488){var _0x581e6a={};_0x581e6a[_0x2eb488]={'$like':'%'+_0x4da2a7[_0xadfd('0x34')][_0xadfd('0x3f')]+'%'};return _0x581e6a;})});}_0x3e7b06=_[_0xadfd('0x41')]({},_0x3e7b06,_0x4da2a7[_0xadfd('0x43')]);return _0xb2e522['getIntervals'](_0x3e7b06);}})['then'](function(_0x2a2a3a){if(_0x2a2a3a){_0x1f4474=_0x2a2a3a[_0xadfd('0x49')];if(!_0x4da2a7[_0xadfd('0x34')]['hasOwnProperty'](_0xadfd('0x3b'))){_0x3e7b06[_0xadfd('0x1b')]=qs[_0xadfd('0x1b')](_0x4da2a7[_0xadfd('0x34')][_0xadfd('0x1b')]);_0x3e7b06[_0xadfd('0x1c')]=qs[_0xadfd('0x1c')](_0x4da2a7[_0xadfd('0x34')][_0xadfd('0x1c')]);}return _0xb2e522[_0xadfd('0x59')](_0x3e7b06);}})['then'](function(_0x485b51){if(_0x485b51){return _0x485b51?{'count':_0x1f4474,'rows':_0x485b51}:null;}})[_0xadfd('0x25')](respondWithResult(_0x533afe,null))[_0xadfd('0x4a')](handleError(_0x533afe,null));};exports[_0xadfd('0x5b')]=function(_0x4099cb,_0x5933cd,_0x7c62e1){return db['Interval'][_0xadfd('0x5a')]({'where':{'id':_0x4099cb[_0xadfd('0x56')]['id']}})['then'](handleEntityNotFound(_0x5933cd,null))[_0xadfd('0x25')](function(_0x2af02e){if(_0x2af02e){return db[_0xadfd('0x5c')][_0xadfd('0x5d')](function(_0x3b6637){return db[_0xadfd('0x48')]['destroy']({'where':{'IntervalId':_0x4099cb[_0xadfd('0x56')]['id']},'transaction':_0x3b6637})[_0xadfd('0x25')](function(_0x2d5091){var _0x1fa83b=_[_0xadfd('0x33')](_0x4099cb[_0xadfd('0x55')],function(_0x3c992a){delete _0x3c992a['id'];_0x3c992a[_0xadfd('0x58')]=_0x4099cb['params']['id'];return _0x3c992a;});return db[_0xadfd('0x48')][_0xadfd('0x5e')](_0x1fa83b,{'transaction':_0x3b6637});});})[_0xadfd('0x25')](function(){return db[_0xadfd('0x48')][_0xadfd('0x46')]({'where':{'IntervalId':_0x4099cb[_0xadfd('0x56')]['id']}});});}})[_0xadfd('0x25')](respondWithResult(_0x5933cd,null))[_0xadfd('0x4a')](handleError(_0x5933cd,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 3f53a9a..830851c 100644 --- a/server/api/interval/interval.model.js +++ b/server/api/interval/interval.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcffb=['reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','define','Interval','rewrite','interval','getIntervals','then','all','map','ifTime'];(function(_0x1e3f16,_0x48fa5c){var _0x3e7abf=function(_0x500fd){while(--_0x500fd){_0x1e3f16['push'](_0x1e3f16['shift']());}};_0x3e7abf(++_0x48fa5c);}(_0xcffb,0x83));var _0xbcff=function(_0x1040fb,_0x37af74){_0x1040fb=_0x1040fb-0x0;var _0x5e9de4=_0xcffb[_0x1040fb];return _0x5e9de4;};'use strict';var attributes=require(_0xbcff('0x0'));var extensions=require(_0xbcff('0x1'));var iftime=require(_0xbcff('0x2'))['iftime'];module['exports']=function(_0x3a4828){return _0x3a4828[_0xbcff('0x3')](_0xbcff('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e028b){extensions[_0xbcff('0x5')](_0x3a4828,_0x4e028b);},'afterBulkCreate':function(_0x388527,_0x3368eb,_0x2f193d){_0x2f193d();extensions[_0xbcff('0x5')](_0x3a4828,_0x388527[0x0]);},'afterUpdate':function(_0x5b1b5e){extensions[_0xbcff('0x5')](_0x3a4828,_0x5b1b5e);},'afterDestroy':function(_0x51b8b9){extensions[_0xbcff('0x5')](_0x3a4828,_0x51b8b9);}},'instanceMethods':{'ifTime':function(_0x4ed333=undefined,_0x1e1e30=new Date()){if(typeof this[_0xbcff('0x6')]==='string'){return iftime(this['interval'],_0x4ed333,_0x1e1e30);}else{return this[_0xbcff('0x7')]()[_0xbcff('0x8')](function(_0x5712e5){return Promise[_0xbcff('0x9')](_0x5712e5[_0xbcff('0xa')](function(_0xb4b0ea){return _0xb4b0ea[_0xbcff('0xb')](_0x4ed333,_0x1e1e30);}));})['then'](function(_0x52cc1c){return _0x52cc1c[_0xbcff('0xc')](function(_0x296f96,_0xb7cd7a){return _0x296f96||_0xb7cd7a;},![]);});}}}});}; \ No newline at end of file +var _0x81ec=['getIntervals','all','map','then','./interval.attributes','../../components/extensions/rewrite','iftime','exports','define','Interval','tools_intervals','rewrite','interval','string'];(function(_0x5de3b8,_0x4ad2a5){var _0x581e7f=function(_0x3a90c7){while(--_0x3a90c7){_0x5de3b8['push'](_0x5de3b8['shift']());}};_0x581e7f(++_0x4ad2a5);}(_0x81ec,0xba));var _0xc81e=function(_0x3d90f1,_0xf25e08){_0x3d90f1=_0x3d90f1-0x0;var _0x3af913=_0x81ec[_0x3d90f1];return _0x3af913;};'use strict';var attributes=require(_0xc81e('0x0'));var extensions=require(_0xc81e('0x1'));var iftime=require('../../utils/iftime')[_0xc81e('0x2')];module[_0xc81e('0x3')]=function(_0x16b238){return _0x16b238[_0xc81e('0x4')](_0xc81e('0x5'),attributes,{'tableName':_0xc81e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x56ca1b){extensions['rewrite'](_0x16b238,_0x56ca1b);},'afterBulkCreate':function(_0x5d7cbf,_0x320f46,_0x45309b){_0x45309b();extensions[_0xc81e('0x7')](_0x16b238,_0x5d7cbf[0x0]);},'afterUpdate':function(_0x4947a3){extensions['rewrite'](_0x16b238,_0x4947a3);},'afterDestroy':function(_0x3e19f0){extensions['rewrite'](_0x16b238,_0x3e19f0);}},'instanceMethods':{'ifTime':function(_0x34c6fa=undefined,_0x432116=new Date()){if(typeof this[_0xc81e('0x8')]===_0xc81e('0x9')){return iftime(this[_0xc81e('0x8')],_0x34c6fa,_0x432116);}else{return this[_0xc81e('0xa')]()['then'](function(_0x17e1cb){return Promise[_0xc81e('0xb')](_0x17e1cb[_0xc81e('0xc')](function(_0x599393){return _0x599393['ifTime'](_0x34c6fa,_0x432116);}));})[_0xc81e('0xd')](function(_0x3cc21e){return _0x3cc21e['reduce'](function(_0x58bda6,_0x2b1465){return _0x58bda6||_0x2b1465;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 3e60143..eb355bb 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf25a=['isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','lodash','util','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','attributes','limit','include','map','model','then','info','debug','catch','error','message','ShowInterval','find','raw','stringify','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','IntervalIftime'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xf25a,0xdc));var _0xaf25=function(_0x2fad9e,_0x3b4b60){_0x2fad9e=_0x2fad9e-0x0;var _0x45db5c=_0xf25a[_0x2fad9e];return _0x45db5c;};'use strict';var _=require(_0xaf25('0x0'));var util=require(_0xaf25('0x1'));var db=require('../../mysqldb')['db'];var iftime=require('../../utils/iftime')[_0xaf25('0x2')];var logger=require(_0xaf25('0x3'))(_0xaf25('0x4'));exports[_0xaf25('0x5')]=function(_0x5074be){var _0x2e0b03=this;return new Promise(function(_0x1dbb27,_0x5eb8a7){return db[_0xaf25('0x6')][_0xaf25('0x7')]({'raw':_0x5074be[_0xaf25('0x8')]?_0x5074be[_0xaf25('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5074be[_0xaf25('0x8')]?_0x5074be['options']['where']||null:null,'attributes':_0x5074be[_0xaf25('0x8')]?_0x5074be[_0xaf25('0x8')][_0xaf25('0x9')]||null:null,'limit':_0x5074be[_0xaf25('0x8')]?_0x5074be[_0xaf25('0x8')][_0xaf25('0xa')]||null:null,'include':_0x5074be[_0xaf25('0x8')]?_0x5074be[_0xaf25('0x8')][_0xaf25('0xb')]?_[_0xaf25('0xc')](_0x5074be[_0xaf25('0x8')]['include'],function(_0x336d84){return{'model':db[_0x336d84[_0xaf25('0xd')]],'as':_0x336d84['as'],'attributes':_0x336d84[_0xaf25('0x9')],'include':_0x336d84[_0xaf25('0xb')]?_[_0xaf25('0xc')](_0x336d84[_0xaf25('0xb')],function(_0xba725d){return{'model':db[_0xba725d['model']],'as':_0xba725d['as'],'attributes':_0xba725d[_0xaf25('0x9')],'include':_0xba725d[_0xaf25('0xb')]?_[_0xaf25('0xc')](_0xba725d[_0xaf25('0xb')],function(_0x22611a){return{'model':db[_0x22611a[_0xaf25('0xd')]],'as':_0x22611a['as'],'attributes':_0x22611a[_0xaf25('0x9')]};}):[]};}):[]};}):[]:[]})[_0xaf25('0xe')](function(_0x1d314f){logger[_0xaf25('0xf')](_0xaf25('0x5'),_0x5074be);logger[_0xaf25('0x10')](_0xaf25('0x5'),_0x5074be,JSON['stringify'](_0x1d314f));_0x1dbb27(_0x1d314f);})[_0xaf25('0x11')](function(_0x41c4e3){logger[_0xaf25('0x12')]('GetInterval',_0x41c4e3['message'],_0x5074be);_0x5eb8a7(_0x2e0b03[_0xaf25('0x12')](0x1f4,_0x41c4e3[_0xaf25('0x13')]));});});};exports[_0xaf25('0x14')]=function(_0x2d473e){var _0x3fcaf9=this;return new Promise(function(_0x1ce5df,_0x5b2459){return db[_0xaf25('0x6')][_0xaf25('0x15')]({'raw':_0x2d473e['options']?_0x2d473e['options'][_0xaf25('0x16')]===undefined?!![]:![]:!![],'where':_0x2d473e[_0xaf25('0x8')]?_0x2d473e[_0xaf25('0x8')]['where']||null:null,'attributes':_0x2d473e[_0xaf25('0x8')]?_0x2d473e['options'][_0xaf25('0x9')]||null:null,'include':_0x2d473e[_0xaf25('0x8')]?_0x2d473e[_0xaf25('0x8')]['include']?_['map'](_0x2d473e[_0xaf25('0x8')][_0xaf25('0xb')],function(_0x3db179){return{'model':db[_0x3db179['model']],'as':_0x3db179['as'],'attributes':_0x3db179['attributes'],'include':_0x3db179[_0xaf25('0xb')]?_[_0xaf25('0xc')](_0x3db179[_0xaf25('0xb')],function(_0x550b74){return{'model':db[_0x550b74['model']],'as':_0x550b74['as'],'attributes':_0x550b74[_0xaf25('0x9')],'include':_0x550b74['include']?_[_0xaf25('0xc')](_0x550b74[_0xaf25('0xb')],function(_0x4cb424){return{'model':db[_0x4cb424[_0xaf25('0xd')]],'as':_0x4cb424['as'],'attributes':_0x4cb424[_0xaf25('0x9')]};}):[]};}):[]};}):[]:[]})[_0xaf25('0xe')](function(_0x443f20){logger[_0xaf25('0xf')]('ShowInterval',_0x2d473e);logger['debug'](_0xaf25('0x14'),_0x2d473e,JSON[_0xaf25('0x17')](_0x443f20));_0x1ce5df(_0x443f20);})[_0xaf25('0x11')](function(_0x12f85c){logger[_0xaf25('0x12')](_0xaf25('0x14'),_0x12f85c[_0xaf25('0x13')],_0x2d473e);_0x5b2459(_0x3fcaf9['error'](0x1f4,_0x12f85c[_0xaf25('0x13')]));});});};function checkArrayOfIntervals(_0x16a2f7,_0x459f29){var _0x3e5155=[];return db[_0xaf25('0x6')][_0xaf25('0x7')]({'where':{'id':_0x16a2f7}})[_0xaf25('0xe')](function(_0x53975e){_0x3e5155=_0x53975e;return Promise['all'](_0x3e5155[_0xaf25('0xc')](function(_0x1b6f9a){return _0x1b6f9a[_0xaf25('0x18')](_0x459f29);}));})[_0xaf25('0xe')](function(_0x3bf027){var _0x59ca8e=_0x3bf027[_0xaf25('0x19')](function(_0x2f72d9,_0x5f2c2f){return _0x2f72d9||_0x5f2c2f;},![]);logger[_0xaf25('0xf')](util[_0xaf25('0x1a')](_0xaf25('0x1b'),_0x3e5155[_0xaf25('0xc')](function(_0x2ac7f1){return _0x2ac7f1['name'];})[_0xaf25('0x1c')](',\x20'),_0x3e5155[_0xaf25('0xc')](function(_0x21cb43){return _0x21cb43['id'];})['join'](',\x20')));return _0x59ca8e;});}function checkSingleInterval(_0x41d647,_0x3847db){return db[_0xaf25('0x6')]['findById'](_0x41d647)['then'](function(_0x8d35fa){if(_0x8d35fa){logger[_0xaf25('0xf')](util['format'](_0xaf25('0x1d'),_0x8d35fa[_0xaf25('0x1e')],_0x8d35fa['id']));return _0x8d35fa[_0xaf25('0x18')](_0x3847db);}});}exports[_0xaf25('0x1f')]=function(_0x40f42f){var _0x23aea6=_0x40f42f['intervalIds'];var _0x2f57fd=Array[_0xaf25('0x20')](_0x40f42f[_0xaf25('0x21')])?_0x40f42f['intervals']:typeof _0x40f42f[_0xaf25('0x21')]===_0xaf25('0x22')?[_0x40f42f[_0xaf25('0x21')]]:[];var _0x32ce80=_0x40f42f[_0xaf25('0x23')]||undefined;var _0x41dadb=![];if(_0x2f57fd[_0xaf25('0x24')]){logger[_0xaf25('0xf')](util['format'](_0xaf25('0x25'),_0x2f57fd[_0xaf25('0x1c')](';\x20')));}if(_0x32ce80){logger[_0xaf25('0xf')](util[_0xaf25('0x1a')](_0xaf25('0x26'),_0x32ce80));}logger[_0xaf25('0x10')](_0xaf25('0x27'),_0x41dadb);logger[_0xaf25('0x28')](_0xaf25('0x1f'),_0x40f42f);return Promise[_0xaf25('0x29')]()['then'](function(){if(Array[_0xaf25('0x20')](_0x23aea6)){return checkArrayOfIntervals(_0x23aea6,_0x32ce80);}else if(_0x23aea6){return checkSingleInterval(_0x23aea6,_0x32ce80);}})[_0xaf25('0xe')](function(_0xd8c564){var _0x4e8b53=_0x2f57fd[_0xaf25('0x19')](function(_0xa81722,_0x35e4f3){return _0xa81722||iftime(_0x35e4f3,_0x32ce80);},![]);_0x41dadb=_0xd8c564||_0x4e8b53;return _0x41dadb;})[_0xaf25('0x11')](function(_0x1a0844){logger[_0xaf25('0x12')](_0xaf25('0x1f'),_0x40f42f,_0x1a0844);throw this['error'](0x1f4,_0x1a0844['message']);});}; \ No newline at end of file +var _0x7142=['findAll','options','where','attributes','include','map','model','then','GetInterval','stringify','catch','error','message','ShowInterval','find','raw','info','debug','all','ifTime','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','resolve','reduce','../../mysqldb','../../utils/iftime','iftime','../../config/logger','Interval'];(function(_0x25bbd6,_0x18f6d3){var _0x3a4c78=function(_0x277579){while(--_0x277579){_0x25bbd6['push'](_0x25bbd6['shift']());}};_0x3a4c78(++_0x18f6d3);}(_0x7142,0x14b));var _0x2714=function(_0x55d768,_0xb506c0){_0x55d768=_0x55d768-0x0;var _0x5522c5=_0x7142[_0x55d768];return _0x5522c5;};'use strict';var _=require('lodash');var util=require('util');var db=require(_0x2714('0x0'))['db'];var iftime=require(_0x2714('0x1'))[_0x2714('0x2')];var logger=require(_0x2714('0x3'))('rpc');exports['GetInterval']=function(_0x42da95){var _0x428150=this;return new Promise(function(_0x28efe2,_0x13ab33){return db[_0x2714('0x4')][_0x2714('0x5')]({'raw':_0x42da95[_0x2714('0x6')]?_0x42da95[_0x2714('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x42da95['options']?_0x42da95[_0x2714('0x6')][_0x2714('0x7')]||null:null,'attributes':_0x42da95[_0x2714('0x6')]?_0x42da95['options'][_0x2714('0x8')]||null:null,'limit':_0x42da95[_0x2714('0x6')]?_0x42da95[_0x2714('0x6')]['limit']||null:null,'include':_0x42da95[_0x2714('0x6')]?_0x42da95[_0x2714('0x6')][_0x2714('0x9')]?_[_0x2714('0xa')](_0x42da95[_0x2714('0x6')]['include'],function(_0x9980fa){return{'model':db[_0x9980fa[_0x2714('0xb')]],'as':_0x9980fa['as'],'attributes':_0x9980fa[_0x2714('0x8')],'include':_0x9980fa[_0x2714('0x9')]?_[_0x2714('0xa')](_0x9980fa[_0x2714('0x9')],function(_0x3ec367){return{'model':db[_0x3ec367[_0x2714('0xb')]],'as':_0x3ec367['as'],'attributes':_0x3ec367[_0x2714('0x8')],'include':_0x3ec367[_0x2714('0x9')]?_['map'](_0x3ec367[_0x2714('0x9')],function(_0xa127e9){return{'model':db[_0xa127e9['model']],'as':_0xa127e9['as'],'attributes':_0xa127e9[_0x2714('0x8')]};}):[]};}):[]};}):[]:[]})[_0x2714('0xc')](function(_0x4c2aa0){logger['info'](_0x2714('0xd'),_0x42da95);logger['debug'](_0x2714('0xd'),_0x42da95,JSON[_0x2714('0xe')](_0x4c2aa0));_0x28efe2(_0x4c2aa0);})[_0x2714('0xf')](function(_0x5b68db){logger[_0x2714('0x10')]('GetInterval',_0x5b68db[_0x2714('0x11')],_0x42da95);_0x13ab33(_0x428150['error'](0x1f4,_0x5b68db[_0x2714('0x11')]));});});};exports[_0x2714('0x12')]=function(_0x24041b){var _0x59fc69=this;return new Promise(function(_0x54c942,_0xbc5ed1){return db[_0x2714('0x4')][_0x2714('0x13')]({'raw':_0x24041b[_0x2714('0x6')]?_0x24041b[_0x2714('0x6')][_0x2714('0x14')]===undefined?!![]:![]:!![],'where':_0x24041b[_0x2714('0x6')]?_0x24041b[_0x2714('0x6')]['where']||null:null,'attributes':_0x24041b['options']?_0x24041b['options'][_0x2714('0x8')]||null:null,'include':_0x24041b[_0x2714('0x6')]?_0x24041b['options']['include']?_['map'](_0x24041b[_0x2714('0x6')][_0x2714('0x9')],function(_0x3ab4c8){return{'model':db[_0x3ab4c8[_0x2714('0xb')]],'as':_0x3ab4c8['as'],'attributes':_0x3ab4c8[_0x2714('0x8')],'include':_0x3ab4c8[_0x2714('0x9')]?_[_0x2714('0xa')](_0x3ab4c8[_0x2714('0x9')],function(_0x545908){return{'model':db[_0x545908[_0x2714('0xb')]],'as':_0x545908['as'],'attributes':_0x545908[_0x2714('0x8')],'include':_0x545908[_0x2714('0x9')]?_['map'](_0x545908[_0x2714('0x9')],function(_0x400f7c){return{'model':db[_0x400f7c['model']],'as':_0x400f7c['as'],'attributes':_0x400f7c[_0x2714('0x8')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e4cee){logger[_0x2714('0x15')](_0x2714('0x12'),_0x24041b);logger[_0x2714('0x16')](_0x2714('0x12'),_0x24041b,JSON[_0x2714('0xe')](_0x5e4cee));_0x54c942(_0x5e4cee);})[_0x2714('0xf')](function(_0x1bca2f){logger['error']('ShowInterval',_0x1bca2f[_0x2714('0x11')],_0x24041b);_0xbc5ed1(_0x59fc69[_0x2714('0x10')](0x1f4,_0x1bca2f['message']));});});};function checkArrayOfIntervals(_0x2315a7,_0x5c9b13){var _0x48c146=[];return db[_0x2714('0x4')][_0x2714('0x5')]({'where':{'id':_0x2315a7}})['then'](function(_0x14e7cb){_0x48c146=_0x14e7cb;return Promise[_0x2714('0x17')](_0x48c146['map'](function(_0x4756f8){return _0x4756f8[_0x2714('0x18')](_0x5c9b13);}));})[_0x2714('0xc')](function(_0x4347c5){var _0x30beff=_0x4347c5['reduce'](function(_0x52353e,_0x26610f){return _0x52353e||_0x26610f;},![]);logger[_0x2714('0x15')](util[_0x2714('0x19')](_0x2714('0x1a'),_0x48c146[_0x2714('0xa')](function(_0x1fb579){return _0x1fb579[_0x2714('0x1b')];})[_0x2714('0x1c')](',\x20'),_0x48c146[_0x2714('0xa')](function(_0x1c9956){return _0x1c9956['id'];})[_0x2714('0x1c')](',\x20')));return _0x30beff;});}function checkSingleInterval(_0x45706d,_0x5c863b){return db[_0x2714('0x4')][_0x2714('0x1d')](_0x45706d)['then'](function(_0x561f07){if(_0x561f07){logger[_0x2714('0x15')](util['format'](_0x2714('0x1e'),_0x561f07[_0x2714('0x1b')],_0x561f07['id']));return _0x561f07[_0x2714('0x18')](_0x5c863b);}});}exports[_0x2714('0x1f')]=function(_0x3f483e){var _0x4e5771=_0x3f483e[_0x2714('0x20')];var _0x585ce5=Array[_0x2714('0x21')](_0x3f483e['intervals'])?_0x3f483e[_0x2714('0x22')]:typeof _0x3f483e[_0x2714('0x22')]===_0x2714('0x23')?[_0x3f483e[_0x2714('0x22')]]:[];var _0x32cbd7=_0x3f483e[_0x2714('0x24')]||undefined;var _0x191784=![];if(_0x585ce5['length']){logger[_0x2714('0x15')](util[_0x2714('0x19')](_0x2714('0x25'),_0x585ce5['join'](';\x20')));}if(_0x32cbd7){logger['info'](util[_0x2714('0x19')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x32cbd7));}logger['debug'](_0x2714('0x26'),_0x191784);logger[_0x2714('0x27')](_0x2714('0x1f'),_0x3f483e);return Promise[_0x2714('0x28')]()['then'](function(){if(Array[_0x2714('0x21')](_0x4e5771)){return checkArrayOfIntervals(_0x4e5771,_0x32cbd7);}else if(_0x4e5771){return checkSingleInterval(_0x4e5771,_0x32cbd7);}})[_0x2714('0xc')](function(_0x319fa2){var _0x454631=_0x585ce5[_0x2714('0x29')](function(_0x35f4e9,_0x41c1fd){return _0x35f4e9||iftime(_0x41c1fd,_0x32cbd7);},![]);_0x191784=_0x319fa2||_0x454631;return _0x191784;})['catch'](function(_0x404d97){logger[_0x2714('0x10')](_0x2714('0x1f'),_0x3f483e,_0x404d97);throw this[_0x2714('0x10')](0x1f4,_0x404d97[_0x2714('0x11')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index fc45a0b..d0063d3 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x351ef3,_0x5a7fa1){var _0x3e3bad=function(_0x13e4d6){while(--_0x13e4d6){_0x351ef3['push'](_0x351ef3['shift']());}};_0x3e3bad(++_0x5a7fa1);}(_0xadb5,0xad));var _0x5adb=function(_0x43ef22,_0x138aef){_0x43ef22=_0x43ef22-0x0;var _0x3a1923=_0xadb5[_0x43ef22];return _0x3a1923;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x15e61d,_0x2e7788){var _0x28c224=function(_0x2a84df){while(--_0x2a84df){_0x15e61d['push'](_0x15e61d['shift']());}};_0x28c224(++_0x2e7788);}(_0xdb28,0x106));var _0x8db2=function(_0x2cc8b0,_0x31eb15){_0x2cc8b0=_0x2cc8b0-0x0;var _0x32b7b1=_0xdb28[_0x2cc8b0];return _0x32b7b1;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index bab442f..ff19168 100644 --- a/server/api/jira/jira.controller.js +++ b/server/api/jira/jira.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x825f=['support','key','summary','Report','\x20from\x20','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','reason','customfield_10102','/rest/api/2/issue','POST','Basic\x20','base64','request','setEncoding','data','end','statusCode','json','parse','error','status','api.jira','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api'];(function(_0x1342ea,_0x1533d4){var _0x34d11c=function(_0x2fc35d){while(--_0x2fc35d){_0x1342ea['push'](_0x1342ea['shift']());}};_0x34d11c(++_0x1533d4);}(_0x825f,0xa5));var _0xf825=function(_0x5b584c,_0x42cc55){_0x5b584c=_0x5b584c-0x0;var _0x4fef97=_0x825f[_0x5b584c];return _0x4fef97;};'use strict';var BPromise=require('bluebird');var https=require(_0xf825('0x0'));var logger=require(_0xf825('0x1'))(_0xf825('0x2'));var USERNAME=_0xf825('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x1eb2a5,_0xe6c21f){var _0x29eee5={'fields':{'project':{'key':_0x1eb2a5[_0xf825('0x4')]||'MOTGUI'},'summary':(_0x1eb2a5[_0xf825('0x5')]||_0xf825('0x6'))+_0xf825('0x7')+_0x1eb2a5['ip'],'description':_0x1eb2a5['description']||JSON[_0xf825('0x8')](_0x1eb2a5),'issuetype':{'name':_0x1eb2a5[_0xf825('0x9')]||_0xf825('0xa')}}};_0x29eee5[_0xf825('0xb')][_0xf825('0xc')]=_0x1eb2a5[_0xf825('0xd')];_0x29eee5['fields'][_0xf825('0xe')]=_0x1eb2a5[_0xf825('0xf')];_0x29eee5[_0xf825('0xb')][_0xf825('0x10')]=_0x1eb2a5['newToken'];_0x29eee5[_0xf825('0xb')][_0xf825('0x11')]=_0x1eb2a5['name'];_0x29eee5['fields']['customfield_11504']=_0x1eb2a5[_0xf825('0x12')];_0x29eee5[_0xf825('0xb')][_0xf825('0x13')]=_0x1eb2a5['ip'];var _0x4acd60={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xf825('0x14'),'method':_0xf825('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xf825('0x16')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xf825('0x17'))}};var _0x1ee969=JSON[_0xf825('0x8')](_0x29eee5);var _0x26e501=https[_0xf825('0x18')](_0x4acd60,function(_0x42c906){_0x42c906[_0xf825('0x19')]('utf8');var _0x49884f='';_0x42c906['on'](_0xf825('0x1a'),function(_0x4a7b44){_0x49884f+=_0x4a7b44;});_0x42c906['on'](_0xf825('0x1b'),function(){if(_0xe6c21f){return _0xe6c21f['status'](_0x42c906[_0xf825('0x1c')])[_0xf825('0x1d')](JSON[_0xf825('0x1e')](_0x49884f));}});});_0x26e501['on'](_0xf825('0x1f'),function(_0x141278){if(_0xe6c21f){return _0xe6c21f[_0xf825('0x20')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xf825('0x21')}]});}});_0x26e501['write'](_0x1ee969);_0x26e501[_0xf825('0x1b')]();}exports[_0xf825('0x22')]=openIssue;exports[_0xf825('0x23')]=function(_0x208dac,_0x388db3){_0x208dac[_0xf825('0x24')]['ip']=_0x208dac[_0xf825('0x25')][_0xf825('0x26')]||_0x208dac[_0xf825('0x27')][_0xf825('0x28')]||_0x208dac[_0xf825('0x29')][_0xf825('0x28')]||_0x208dac['connection'][_0xf825('0x29')][_0xf825('0x28')];return openIssue(_0x208dac[_0xf825('0x24')],_0x388db3);}; \ No newline at end of file +var _0x72b8=['/rest/api/2/issue','POST','application/json','toString','base64','setEncoding','utf8','data','end','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','api','support','3eAmWpBVP0','key','MOTGUI','Report','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com'];(function(_0x1ac82a,_0xb838ba){var _0x399467=function(_0x1871d0){while(--_0x1871d0){_0x1ac82a['push'](_0x1ac82a['shift']());}};_0x399467(++_0xb838ba);}(_0x72b8,0x1f0));var _0x872b=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x72b8[_0x53ccf2];return _0x5a2964;};'use strict';var BPromise=require(_0x872b('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x872b('0x1'));var USERNAME=_0x872b('0x2');var PASSWORD=_0x872b('0x3');function openIssue(_0x406f5b,_0x5967f5){var _0x588e34={'fields':{'project':{'key':_0x406f5b[_0x872b('0x4')]||_0x872b('0x5')},'summary':(_0x406f5b['summary']||_0x872b('0x6'))+'\x20from\x20'+_0x406f5b['ip'],'description':_0x406f5b['description']||JSON[_0x872b('0x7')](_0x406f5b),'issuetype':{'name':_0x406f5b[_0x872b('0x8')]||_0x872b('0x9')}}};_0x588e34[_0x872b('0xa')]['customfield_11500']=_0x406f5b[_0x872b('0xb')];_0x588e34['fields'][_0x872b('0xc')]=_0x406f5b[_0x872b('0xd')];_0x588e34[_0x872b('0xa')][_0x872b('0xe')]=_0x406f5b['newToken'];_0x588e34['fields'][_0x872b('0xf')]=_0x406f5b[_0x872b('0x10')];_0x588e34[_0x872b('0xa')][_0x872b('0x11')]=_0x406f5b[_0x872b('0x12')];_0x588e34[_0x872b('0xa')]['customfield_10102']=_0x406f5b['ip'];var _0x505415={'host':_0x872b('0x13'),'port':0x1bb,'path':_0x872b('0x14'),'method':_0x872b('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x872b('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x872b('0x17')](_0x872b('0x18'))}};var _0x5f1029=JSON[_0x872b('0x7')](_0x588e34);var _0x4d8bb2=https['request'](_0x505415,function(_0x108077){_0x108077[_0x872b('0x19')](_0x872b('0x1a'));var _0x305f88='';_0x108077['on'](_0x872b('0x1b'),function(_0x258182){_0x305f88+=_0x258182;});_0x108077['on'](_0x872b('0x1c'),function(){if(_0x5967f5){return _0x5967f5['status'](_0x108077[_0x872b('0x1d')])[_0x872b('0x1e')](JSON[_0x872b('0x1f')](_0x305f88));}});});_0x4d8bb2['on'](_0x872b('0x20'),function(_0x5f31a1){if(_0x5967f5){return _0x5967f5[_0x872b('0x21')](0x1f4)[_0x872b('0x1e')]({'errors':[{'message':_0x872b('0x22'),'type':'api.jira'}]});}});_0x4d8bb2[_0x872b('0x23')](_0x5f1029);_0x4d8bb2[_0x872b('0x1c')]();}exports[_0x872b('0x24')]=openIssue;exports[_0x872b('0x25')]=function(_0x3e7f91,_0x478c60){_0x3e7f91[_0x872b('0x26')]['ip']=_0x3e7f91[_0x872b('0x27')]['x-forwarded-for']||_0x3e7f91[_0x872b('0x28')]['remoteAddress']||_0x3e7f91['socket'][_0x872b('0x29')]||_0x3e7f91[_0x872b('0x28')][_0x872b('0x2a')][_0x872b('0x29')];return openIssue(_0x3e7f91[_0x872b('0x26')],_0x478c60);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 0461961..331a010 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec56=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x1a794d,_0xbd9a41){var _0x1b3887=function(_0x2133f5){while(--_0x2133f5){_0x1a794d['push'](_0x1a794d['shift']());}};_0x1b3887(++_0xbd9a41);}(_0xec56,0x1bd));var _0x6ec5=function(_0x50d991,_0x1d1ae9){_0x50d991=_0x50d991-0x0;var _0x36977e=_0xec56[_0x50d991];return _0x36977e;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['post']('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);router[_0x6ec5('0x11')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x12')]);router[_0x6ec5('0x13')]('/:id',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x14')]);module[_0x6ec5('0x15')]=router; \ No newline at end of file +var _0xbec5=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated'];(function(_0x3edc9d,_0x2911aa){var _0x387318=function(_0x319d61){while(--_0x319d61){_0x3edc9d['push'](_0x3edc9d['shift']());}};_0x387318(++_0x2911aa);}(_0xbec5,0xe5));var _0x5bec=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0xbec5[_0x35fb56];return _0x2fd52c;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0x9')](_0x5bec('0xe'),auth[_0x5bec('0xc')](),controller['show']);router[_0x5bec('0xf')]('/',auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);router[_0x5bec('0x13')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x14')]);module[_0x5bec('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 41324b5..19e94f0 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0xce0cfe,_0x1b5d9f){_0xce0cfe=_0xce0cfe-0x0;var _0xd85145=_0x7a54[_0xce0cfe];return _0xd85145;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x8d6ef,_0x28c556){_0x8d6ef=_0x8d6ef-0x0;var _0x4b3ffd=_0x7a54[_0x8d6ef];return _0x4b3ffd;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index da5d6b5..96a0a3b 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6379=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','sendStatus','error','stack','name','JscriptyAnswerReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','filter','options','then','includeAll','include','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis'];(function(_0x4d2ccb,_0x23e43d){var _0x15c40d=function(_0x2f5b8f){while(--_0x2f5b8f){_0x4d2ccb['push'](_0x4d2ccb['shift']());}};_0x15c40d(++_0x23e43d);}(_0x6379,0x84));var _0x9637=function(_0x4b9c7c,_0x441e1a){_0x4b9c7c=_0x4b9c7c-0x0;var _0x4e854b=_0x6379[_0x4b9c7c];return _0x4e854b;};'use strict';var emlformat=require(_0x9637('0x0'));var rimraf=require(_0x9637('0x1'));var zipdir=require(_0x9637('0x2'));var jsonpatch=require(_0x9637('0x3'));var rp=require(_0x9637('0x4'));var moment=require('moment');var BPromise=require(_0x9637('0x5'));var Mustache=require(_0x9637('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9637('0x7'));var csv=require(_0x9637('0x8'));var ejs=require(_0x9637('0x9'));var fs=require('fs');var fs_extra=require(_0x9637('0xa'));var _=require(_0x9637('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9637('0xc'));var deskjs=require(_0x9637('0xd'));var toCsv=require(_0x9637('0x8'));var querystring=require(_0x9637('0xe'));var Papa=require('papaparse');var Redis=require(_0x9637('0xf'));var authService=require(_0x9637('0x10'));var qs=require(_0x9637('0x11'));var as=require(_0x9637('0x12'));var hardwareService=require(_0x9637('0x13'));var logger=require(_0x9637('0x14'))(_0x9637('0x15'));var utils=require(_0x9637('0x16'));var config=require(_0x9637('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9637('0x18'))['db'];function respondWithStatusCode(_0x4f6167,_0x9c4e8c){_0x9c4e8c=_0x9c4e8c||0xcc;return function(_0x2bd4ae){if(_0x2bd4ae){return _0x4f6167['sendStatus'](_0x9c4e8c);}return _0x4f6167[_0x9637('0x19')](_0x9c4e8c)[_0x9637('0x1a')]();};}function respondWithResult(_0x2bbd4b,_0x46b419){_0x46b419=_0x46b419||0xc8;return function(_0x5ecb8a){if(_0x5ecb8a){return _0x2bbd4b[_0x9637('0x19')](_0x46b419)[_0x9637('0x1b')](_0x5ecb8a);}};}function respondWithFilteredResult(_0x2d5ea1,_0x316d3f){return function(_0x95d855){if(_0x95d855){var _0x59d035=typeof _0x316d3f[_0x9637('0x1c')]===_0x9637('0x1d')&&typeof _0x316d3f[_0x9637('0x1e')]===_0x9637('0x1d');var _0x10daf0=_0x95d855[_0x9637('0x1f')];var _0x465ac6=_0x59d035?0x0:_0x316d3f[_0x9637('0x1c')];var _0x27c7fd=_0x59d035?_0x95d855[_0x9637('0x1f')]:_0x316d3f['offset']+_0x316d3f['limit'];var _0x2b47b5;if(_0x27c7fd>=_0x10daf0){_0x27c7fd=_0x10daf0;_0x2b47b5=0xc8;}else{_0x2b47b5=0xce;}_0x2d5ea1[_0x9637('0x19')](_0x2b47b5);return _0x2d5ea1[_0x9637('0x20')](_0x9637('0x21'),_0x465ac6+'-'+_0x27c7fd+'/'+_0x10daf0)['json'](_0x95d855);}return null;};}function patchUpdates(_0x5935f1){return function(_0x5ad1b3){try{jsonpatch[_0x9637('0x22')](_0x5ad1b3,_0x5935f1,!![]);}catch(_0x34601a){return BPromise[_0x9637('0x23')](_0x34601a);}return _0x5ad1b3[_0x9637('0x24')]();};}function saveUpdates(_0x3121da,_0x578a20){return function(_0x4859a8){if(_0x4859a8){return _0x4859a8['update'](_0x3121da)['then'](function(_0x23b3bf){return _0x23b3bf;});}return null;};}function removeEntity(_0x1af78d,_0x3968ae){return function(_0x55319f){if(_0x55319f){return _0x55319f[_0x9637('0x25')]()['then'](function(){_0x1af78d[_0x9637('0x19')](0xcc)[_0x9637('0x1a')]();});}};}function handleEntityNotFound(_0xd73547,_0x4d70cf){return function(_0x2d1c68){if(!_0x2d1c68){_0xd73547[_0x9637('0x26')](0x194);}return _0x2d1c68;};}function handleError(_0x1820e5,_0x1f3440){_0x1f3440=_0x1f3440||0x1f4;return function(_0x96fa5a){logger[_0x9637('0x27')](_0x96fa5a[_0x9637('0x28')]);if(_0x96fa5a[_0x9637('0x29')]){delete _0x96fa5a[_0x9637('0x29')];}_0x1820e5[_0x9637('0x19')](_0x1f3440)['send'](_0x96fa5a);};}exports['index']=function(_0x314f30,_0x300193){var _0xdab284={},_0x404813={},_0x8fef8b={'count':0x0,'rows':[]};var _0x1029ff=_['map'](db[_0x9637('0x2a')][_0x9637('0x2b')],function(_0x1c4d3a){return{'name':_0x1c4d3a[_0x9637('0x2c')],'type':_0x1c4d3a[_0x9637('0x2d')][_0x9637('0x2e')]};});_0x404813['model']=_['map'](_0x1029ff,_0x9637('0x29'));_0x404813['query']=_[_0x9637('0x2f')](_0x314f30[_0x9637('0x30')]);_0x404813[_0x9637('0x31')]=_[_0x9637('0x32')](_0x404813[_0x9637('0x33')],_0x404813['query']);_0xdab284[_0x9637('0x34')]=_[_0x9637('0x32')](_0x404813[_0x9637('0x33')],qs[_0x9637('0x35')](_0x314f30[_0x9637('0x30')][_0x9637('0x35')]));_0xdab284[_0x9637('0x34')]=_0xdab284[_0x9637('0x34')][_0x9637('0x36')]?_0xdab284[_0x9637('0x34')]:_0x404813['model'];if(!_0x314f30[_0x9637('0x30')]['hasOwnProperty'](_0x9637('0x37'))){_0xdab284[_0x9637('0x1e')]=qs[_0x9637('0x1e')](_0x314f30[_0x9637('0x30')][_0x9637('0x1e')]);_0xdab284['offset']=qs[_0x9637('0x1c')](_0x314f30[_0x9637('0x30')][_0x9637('0x1c')]);}_0xdab284[_0x9637('0x38')]=qs['sort'](_0x314f30[_0x9637('0x30')][_0x9637('0x39')]);_0xdab284[_0x9637('0x3a')]=qs[_0x9637('0x31')](_[_0x9637('0x3b')](_0x314f30[_0x9637('0x30')],_0x404813[_0x9637('0x31')]),_0x1029ff);if(_0x314f30[_0x9637('0x30')]['filter']){_0xdab284[_0x9637('0x3a')]=_[_0x9637('0x3c')](_0xdab284[_0x9637('0x3a')],{'$or':_[_0x9637('0x3d')](_0x1029ff,function(_0x19fdb8){if(_0x19fdb8[_0x9637('0x2d')]!=='VIRTUAL'){var _0x5de3f4={};_0x5de3f4[_0x19fdb8['name']]={'$like':'%'+_0x314f30[_0x9637('0x30')][_0x9637('0x3e')]+'%'};return _0x5de3f4;}})});}_0xdab284=_[_0x9637('0x3c')]({},_0xdab284,_0x314f30[_0x9637('0x3f')]);var _0x5f3151={'where':_0xdab284[_0x9637('0x3a')]};return db[_0x9637('0x2a')][_0x9637('0x1f')](_0x5f3151)[_0x9637('0x40')](function(_0x5c0c52){_0x8fef8b['count']=_0x5c0c52;if(_0x314f30[_0x9637('0x30')][_0x9637('0x41')]){_0xdab284[_0x9637('0x42')]=[{'all':!![]}];}return db[_0x9637('0x2a')]['findAll'](_0xdab284);})['then'](function(_0x14c9d4){_0x8fef8b['rows']=_0x14c9d4;return _0x8fef8b;})[_0x9637('0x40')](respondWithFilteredResult(_0x300193,_0xdab284))['catch'](handleError(_0x300193,null));};exports[_0x9637('0x43')]=function(_0x5a468a,_0x24a24c){var _0x25932a={'raw':!![],'where':{'id':_0x5a468a[_0x9637('0x44')]['id']}},_0x3b63ba={};_0x3b63ba[_0x9637('0x33')]=_[_0x9637('0x2f')](db['JscriptyAnswerReport'][_0x9637('0x2b')]);_0x3b63ba[_0x9637('0x30')]=_['keys'](_0x5a468a[_0x9637('0x30')]);_0x3b63ba[_0x9637('0x31')]=_['intersection'](_0x3b63ba[_0x9637('0x33')],_0x3b63ba[_0x9637('0x30')]);_0x25932a['attributes']=_[_0x9637('0x32')](_0x3b63ba[_0x9637('0x33')],qs[_0x9637('0x35')](_0x5a468a['query'][_0x9637('0x35')]));_0x25932a[_0x9637('0x34')]=_0x25932a[_0x9637('0x34')][_0x9637('0x36')]?_0x25932a[_0x9637('0x34')]:_0x3b63ba[_0x9637('0x33')];if(_0x5a468a[_0x9637('0x30')][_0x9637('0x41')]){_0x25932a['include']=[{'all':!![]}];}_0x25932a=_[_0x9637('0x3c')]({},_0x25932a,_0x5a468a['options']);return db[_0x9637('0x2a')]['find'](_0x25932a)[_0x9637('0x40')](handleEntityNotFound(_0x24a24c,null))['then'](respondWithResult(_0x24a24c,null))[_0x9637('0x45')](handleError(_0x24a24c,null));};exports['create']=function(_0x5697e8,_0x270a61){return db['JscriptyAnswerReport'][_0x9637('0x46')](_0x5697e8[_0x9637('0x47')],{})[_0x9637('0x40')](respondWithResult(_0x270a61,0xc9))['catch'](handleError(_0x270a61,null));};exports['update']=function(_0x2505f7,_0x46edfb){if(_0x2505f7[_0x9637('0x47')]['id']){delete _0x2505f7[_0x9637('0x47')]['id'];}return db[_0x9637('0x2a')]['find']({'where':{'id':_0x2505f7[_0x9637('0x44')]['id']}})['then'](handleEntityNotFound(_0x46edfb,null))[_0x9637('0x40')](saveUpdates(_0x2505f7[_0x9637('0x47')],null))[_0x9637('0x40')](respondWithResult(_0x46edfb,null))[_0x9637('0x45')](handleError(_0x46edfb,null));};exports[_0x9637('0x25')]=function(_0x11c4b1,_0x52b9a4){return db[_0x9637('0x2a')][_0x9637('0x48')]({'where':{'id':_0x11c4b1[_0x9637('0x44')]['id']}})[_0x9637('0x40')](handleEntityNotFound(_0x52b9a4,null))[_0x9637('0x40')](removeEntity(_0x52b9a4,null))[_0x9637('0x45')](handleError(_0x52b9a4,null));};exports[_0x9637('0x49')]=function(_0xf1d8e4,_0x4fef78){return db[_0x9637('0x2a')][_0x9637('0x49')]()[_0x9637('0x40')](respondWithResult(_0x4fef78,null))['catch'](handleError(_0x4fef78,null));}; \ No newline at end of file +var _0xe574=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','JscriptyAnswerReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length'];(function(_0x261562,_0x25d001){var _0x5a5563=function(_0x2e7168){while(--_0x2e7168){_0x261562['push'](_0x261562['shift']());}};_0x5a5563(++_0x25d001);}(_0xe574,0x100));var _0x4e57=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe574[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x4e57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e57('0x1'));var jsonpatch=require(_0x4e57('0x2'));var rp=require(_0x4e57('0x3'));var moment=require(_0x4e57('0x4'));var BPromise=require(_0x4e57('0x5'));var Mustache=require(_0x4e57('0x6'));var util=require(_0x4e57('0x7'));var path=require(_0x4e57('0x8'));var sox=require(_0x4e57('0x9'));var csv=require(_0x4e57('0xa'));var ejs=require(_0x4e57('0xb'));var fs=require('fs');var fs_extra=require(_0x4e57('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4e57('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e57('0xa'));var querystring=require(_0x4e57('0xe'));var Papa=require(_0x4e57('0xf'));var Redis=require(_0x4e57('0x10'));var authService=require(_0x4e57('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4e57('0x12'));var hardwareService=require(_0x4e57('0x13'));var logger=require(_0x4e57('0x14'))(_0x4e57('0x15'));var utils=require(_0x4e57('0x16'));var config=require(_0x4e57('0x17'));var licenseUtil=require(_0x4e57('0x18'));var db=require(_0x4e57('0x19'))['db'];function respondWithStatusCode(_0xed8cbc,_0x40c8c8){_0x40c8c8=_0x40c8c8||0xcc;return function(_0x330868){if(_0x330868){return _0xed8cbc[_0x4e57('0x1a')](_0x40c8c8);}return _0xed8cbc[_0x4e57('0x1b')](_0x40c8c8)[_0x4e57('0x1c')]();};}function respondWithResult(_0x28f876,_0x2e9fa8){_0x2e9fa8=_0x2e9fa8||0xc8;return function(_0x4f088a){if(_0x4f088a){return _0x28f876[_0x4e57('0x1b')](_0x2e9fa8)['json'](_0x4f088a);}};}function respondWithFilteredResult(_0x254285,_0x4af0a6){return function(_0x3401c4){if(_0x3401c4){var _0x214957=typeof _0x4af0a6['offset']===_0x4e57('0x1d')&&typeof _0x4af0a6[_0x4e57('0x1e')]===_0x4e57('0x1d');var _0xb06d8=_0x3401c4['count'];var _0x2ed980=_0x214957?0x0:_0x4af0a6[_0x4e57('0x1f')];var _0x3c2978=_0x214957?_0x3401c4[_0x4e57('0x20')]:_0x4af0a6[_0x4e57('0x1f')]+_0x4af0a6['limit'];var _0x182286;if(_0x3c2978>=_0xb06d8){_0x3c2978=_0xb06d8;_0x182286=0xc8;}else{_0x182286=0xce;}_0x254285[_0x4e57('0x1b')](_0x182286);return _0x254285[_0x4e57('0x21')](_0x4e57('0x22'),_0x2ed980+'-'+_0x3c2978+'/'+_0xb06d8)['json'](_0x3401c4);}return null;};}function patchUpdates(_0x372295){return function(_0x59df7a){try{jsonpatch[_0x4e57('0x23')](_0x59df7a,_0x372295,!![]);}catch(_0x5b6127){return BPromise[_0x4e57('0x24')](_0x5b6127);}return _0x59df7a[_0x4e57('0x25')]();};}function saveUpdates(_0x427c6b,_0x43c9a7){return function(_0x45f9cd){if(_0x45f9cd){return _0x45f9cd['update'](_0x427c6b)['then'](function(_0x17e309){return _0x17e309;});}return null;};}function removeEntity(_0x58d6ea,_0x315f7c){return function(_0x4cfa0e){if(_0x4cfa0e){return _0x4cfa0e[_0x4e57('0x26')]()[_0x4e57('0x27')](function(){_0x58d6ea[_0x4e57('0x1b')](0xcc)[_0x4e57('0x1c')]();});}};}function handleEntityNotFound(_0x29df93,_0xc75cb3){return function(_0x4fb5db){if(!_0x4fb5db){_0x29df93[_0x4e57('0x1a')](0x194);}return _0x4fb5db;};}function handleError(_0x316988,_0x503eaa){_0x503eaa=_0x503eaa||0x1f4;return function(_0x36b415){logger[_0x4e57('0x28')](_0x36b415[_0x4e57('0x29')]);if(_0x36b415[_0x4e57('0x2a')]){delete _0x36b415[_0x4e57('0x2a')];}_0x316988[_0x4e57('0x1b')](_0x503eaa)[_0x4e57('0x2b')](_0x36b415);};}exports['index']=function(_0x1a26f6,_0x431794){var _0x1da085={},_0x197bc1={},_0x27a22f={'count':0x0,'rows':[]};var _0x5d55b9=_['map'](db[_0x4e57('0x2c')][_0x4e57('0x2d')],function(_0x3ce391){return{'name':_0x3ce391[_0x4e57('0x2e')],'type':_0x3ce391['type'][_0x4e57('0x2f')]};});_0x197bc1[_0x4e57('0x30')]=_[_0x4e57('0x31')](_0x5d55b9,_0x4e57('0x2a'));_0x197bc1[_0x4e57('0x32')]=_['keys'](_0x1a26f6[_0x4e57('0x32')]);_0x197bc1[_0x4e57('0x33')]=_['intersection'](_0x197bc1[_0x4e57('0x30')],_0x197bc1['query']);_0x1da085['attributes']=_[_0x4e57('0x34')](_0x197bc1[_0x4e57('0x30')],qs[_0x4e57('0x35')](_0x1a26f6['query'][_0x4e57('0x35')]));_0x1da085['attributes']=_0x1da085[_0x4e57('0x36')][_0x4e57('0x37')]?_0x1da085[_0x4e57('0x36')]:_0x197bc1['model'];if(!_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x38')](_0x4e57('0x39'))){_0x1da085[_0x4e57('0x1e')]=qs[_0x4e57('0x1e')](_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x1e')]);_0x1da085[_0x4e57('0x1f')]=qs[_0x4e57('0x1f')](_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x1f')]);}_0x1da085['order']=qs[_0x4e57('0x3a')](_0x1a26f6['query'][_0x4e57('0x3a')]);_0x1da085[_0x4e57('0x3b')]=qs[_0x4e57('0x33')](_[_0x4e57('0x3c')](_0x1a26f6['query'],_0x197bc1['filters']),_0x5d55b9);if(_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x3d')]){_0x1da085[_0x4e57('0x3b')]=_[_0x4e57('0x3e')](_0x1da085[_0x4e57('0x3b')],{'$or':_[_0x4e57('0x31')](_0x5d55b9,function(_0x1ab62){if(_0x1ab62[_0x4e57('0x3f')]!==_0x4e57('0x40')){var _0x4ac448={};_0x4ac448[_0x1ab62[_0x4e57('0x2a')]]={'$like':'%'+_0x1a26f6['query'][_0x4e57('0x3d')]+'%'};return _0x4ac448;}})});}_0x1da085=_[_0x4e57('0x3e')]({},_0x1da085,_0x1a26f6['options']);var _0x1ff9e7={'where':_0x1da085[_0x4e57('0x3b')]};return db[_0x4e57('0x2c')][_0x4e57('0x20')](_0x1ff9e7)[_0x4e57('0x27')](function(_0x386d3a){_0x27a22f[_0x4e57('0x20')]=_0x386d3a;if(_0x1a26f6['query'][_0x4e57('0x41')]){_0x1da085[_0x4e57('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4e57('0x43')](_0x1da085);})[_0x4e57('0x27')](function(_0x2ef995){_0x27a22f[_0x4e57('0x44')]=_0x2ef995;return _0x27a22f;})[_0x4e57('0x27')](respondWithFilteredResult(_0x431794,_0x1da085))[_0x4e57('0x45')](handleError(_0x431794,null));};exports['show']=function(_0x2e5e62,_0x3fd1b0){var _0x271551={'raw':!![],'where':{'id':_0x2e5e62[_0x4e57('0x46')]['id']}},_0x330da6={};_0x330da6[_0x4e57('0x30')]=_[_0x4e57('0x47')](db['JscriptyAnswerReport'][_0x4e57('0x2d')]);_0x330da6[_0x4e57('0x32')]=_[_0x4e57('0x47')](_0x2e5e62[_0x4e57('0x32')]);_0x330da6[_0x4e57('0x33')]=_['intersection'](_0x330da6[_0x4e57('0x30')],_0x330da6[_0x4e57('0x32')]);_0x271551[_0x4e57('0x36')]=_[_0x4e57('0x34')](_0x330da6[_0x4e57('0x30')],qs[_0x4e57('0x35')](_0x2e5e62[_0x4e57('0x32')][_0x4e57('0x35')]));_0x271551[_0x4e57('0x36')]=_0x271551[_0x4e57('0x36')]['length']?_0x271551['attributes']:_0x330da6['model'];if(_0x2e5e62[_0x4e57('0x32')][_0x4e57('0x41')]){_0x271551[_0x4e57('0x42')]=[{'all':!![]}];}_0x271551=_[_0x4e57('0x3e')]({},_0x271551,_0x2e5e62[_0x4e57('0x48')]);return db[_0x4e57('0x2c')][_0x4e57('0x49')](_0x271551)[_0x4e57('0x27')](handleEntityNotFound(_0x3fd1b0,null))[_0x4e57('0x27')](respondWithResult(_0x3fd1b0,null))[_0x4e57('0x45')](handleError(_0x3fd1b0,null));};exports[_0x4e57('0x4a')]=function(_0xe5c591,_0x423986){return db['JscriptyAnswerReport'][_0x4e57('0x4a')](_0xe5c591[_0x4e57('0x4b')],{})[_0x4e57('0x27')](respondWithResult(_0x423986,0xc9))[_0x4e57('0x45')](handleError(_0x423986,null));};exports[_0x4e57('0x4c')]=function(_0x41d476,_0x48869d){if(_0x41d476[_0x4e57('0x4b')]['id']){delete _0x41d476[_0x4e57('0x4b')]['id'];}return db[_0x4e57('0x2c')][_0x4e57('0x49')]({'where':{'id':_0x41d476[_0x4e57('0x46')]['id']}})[_0x4e57('0x27')](handleEntityNotFound(_0x48869d,null))[_0x4e57('0x27')](saveUpdates(_0x41d476[_0x4e57('0x4b')],null))['then'](respondWithResult(_0x48869d,null))[_0x4e57('0x45')](handleError(_0x48869d,null));};exports['destroy']=function(_0x3deb47,_0x328c2c){return db[_0x4e57('0x2c')]['find']({'where':{'id':_0x3deb47[_0x4e57('0x46')]['id']}})['then'](handleEntityNotFound(_0x328c2c,null))[_0x4e57('0x27')](removeEntity(_0x328c2c,null))[_0x4e57('0x45')](handleError(_0x328c2c,null));};exports[_0x4e57('0x4d')]=function(_0x139891,_0x12e2df){return db[_0x4e57('0x2c')][_0x4e57('0x4d')]()['then'](respondWithResult(_0x12e2df,null))['catch'](handleError(_0x12e2df,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 8eb05ff..b501f6c 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6bc=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x5bfaf0,_0x4170d1){var _0x111aed=function(_0x258065){while(--_0x258065){_0x5bfaf0['push'](_0x5bfaf0['shift']());}};_0x111aed(++_0x4170d1);}(_0xc6bc,0xd1));var _0xcc6b=function(_0x1c526f,_0xad84c7){_0x1c526f=_0x1c526f-0x0;var _0x14f246=_0xc6bc[_0x1c526f];return _0x14f246;};'use strict';var _=require(_0xcc6b('0x0'));var util=require(_0xcc6b('0x1'));var logger=require(_0xcc6b('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcc6b('0x3'));var rp=require(_0xcc6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc6b('0x5'));var config=require(_0xcc6b('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xcc6b('0x7')]=function(_0xf49c4d,_0x13aecf){return _0xf49c4d[_0xcc6b('0x8')](_0xcc6b('0x9'),attributes,{'tableName':_0xcc6b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3dff=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x3dff,0x1bc));var _0xf3df=function(_0x4d7d37,_0x58896e){_0x4d7d37=_0x4d7d37-0x0;var _0xa20252=_0x3dff[_0x4d7d37];return _0xa20252;};'use strict';var _=require(_0xf3df('0x0'));var util=require(_0xf3df('0x1'));var logger=require(_0xf3df('0x2'))(_0xf3df('0x3'));var moment=require('moment');var BPromise=require(_0xf3df('0x4'));var rp=require(_0xf3df('0x5'));var fs=require('fs');var path=require(_0xf3df('0x6'));var rimraf=require('rimraf');var config=require(_0xf3df('0x7'));var attributes=require(_0xf3df('0x8'));module[_0xf3df('0x9')]=function(_0x28785c,_0x4aee74){return _0x28785c[_0xf3df('0xa')](_0xf3df('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index b3f08d1..ba7f0f9 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb26=['catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x51d166,_0x1a4142){var _0xcafeb6=function(_0x3648db){while(--_0x3648db){_0x51d166['push'](_0x51d166['shift']());}};_0xcafeb6(++_0x1a4142);}(_0xdb26,0x155));var _0x6db2=function(_0x415992,_0x5ddb1b){_0x415992=_0x415992-0x0;var _0x479b29=_0xdb26[_0x415992];return _0x479b29;};'use strict';var _=require(_0x6db2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6db2('0x1'));var rs=require(_0x6db2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6db2('0x3'))['db'];var utils=require(_0x6db2('0x4'));var logger=require(_0x6db2('0x5'))(_0x6db2('0x6'));var config=require(_0x6db2('0x7'));var jayson=require(_0x6db2('0x8'));var client=jayson['client'][_0x6db2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x335be0,_0x43fdf9,_0x17c955){return new BPromise(function(_0x18c2f3,_0xd89557){return client['request'](_0x335be0,_0x17c955)[_0x6db2('0xa')](function(_0x4a3551){logger[_0x6db2('0xb')](_0x6db2('0xc'),_0x43fdf9,_0x6db2('0xd'));logger['debug'](_0x6db2('0xe'),_0x43fdf9,_0x6db2('0xd'),JSON[_0x6db2('0xf')](_0x4a3551));if(_0x4a3551[_0x6db2('0x10')]){if(_0x4a3551[_0x6db2('0x10')]['code']===0x1f4){logger['error'](_0x6db2('0xc'),_0x43fdf9,_0x4a3551['error']['message']);return _0xd89557(_0x4a3551[_0x6db2('0x10')][_0x6db2('0x11')]);}logger[_0x6db2('0x10')](_0x6db2('0xc'),_0x43fdf9,_0x4a3551['error'][_0x6db2('0x11')]);return _0x18c2f3(_0x4a3551[_0x6db2('0x10')][_0x6db2('0x11')]);}else{logger[_0x6db2('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x43fdf9,_0x6db2('0xd'));_0x18c2f3(_0x4a3551[_0x6db2('0x12')][_0x6db2('0x11')]);}})[_0x6db2('0x13')](function(_0x22cf00){logger[_0x6db2('0x10')](_0x6db2('0xc'),_0x43fdf9,_0x22cf00);_0xd89557(_0x22cf00);});});} \ No newline at end of file +var _0x8141=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','error','code','message','JscriptyAnswerReport,\x20%s,\x20%s','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1c4720,_0x58ca5a){var _0x3d1ba9=function(_0x105802){while(--_0x105802){_0x1c4720['push'](_0x1c4720['shift']());}};_0x3d1ba9(++_0x58ca5a);}(_0x8141,0x175));var _0x1814=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8141[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1814('0x0'));var util=require(_0x1814('0x1'));var moment=require('moment');var BPromise=require(_0x1814('0x2'));var rs=require(_0x1814('0x3'));var fs=require('fs');var Redis=require(_0x1814('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1814('0x5'));var logger=require(_0x1814('0x6'))('rpc');var config=require(_0x1814('0x7'));var jayson=require(_0x1814('0x8'));var client=jayson[_0x1814('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11392b,_0x3881ed,_0x50b9b5){return new BPromise(function(_0x158b6d,_0x282360){return client[_0x1814('0xa')](_0x11392b,_0x50b9b5)[_0x1814('0xb')](function(_0x2fc157){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3881ed,_0x1814('0xc'));logger[_0x1814('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3881ed,_0x1814('0xc'),JSON['stringify'](_0x2fc157));if(_0x2fc157[_0x1814('0xe')]){if(_0x2fc157['error'][_0x1814('0xf')]===0x1f4){logger[_0x1814('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3881ed,_0x2fc157[_0x1814('0xe')][_0x1814('0x10')]);return _0x282360(_0x2fc157['error'][_0x1814('0x10')]);}logger[_0x1814('0xe')](_0x1814('0x11'),_0x3881ed,_0x2fc157[_0x1814('0xe')]['message']);return _0x158b6d(_0x2fc157[_0x1814('0xe')][_0x1814('0x10')]);}else{logger[_0x1814('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3881ed,_0x1814('0xc'));_0x158b6d(_0x2fc157['result'][_0x1814('0x10')]);}})[_0x1814('0x13')](function(_0x1778d7){logger[_0x1814('0xe')](_0x1814('0x11'),_0x3881ed,_0x1778d7);_0x282360(_0x1778d7);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index c575b8a..11de131 100644 --- a/server/api/jscriptyProject/index.js +++ b/server/api/jscriptyProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9777=['/:id','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','show','/:id/answers','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone'];(function(_0x4a9d87,_0x2cc20f){var _0x1ad978=function(_0x37673c){while(--_0x37673c){_0x4a9d87['push'](_0x4a9d87['shift']());}};_0x1ad978(++_0x2cc20f);}(_0x9777,0x123));var _0x7977=function(_0x2d7870,_0x2271f0){_0x2d7870=_0x2d7870-0x0;var _0xe08d5b=_0x9777[_0x2d7870];return _0xe08d5b;};'use strict';var multer=require(_0x7977('0x0'));var util=require(_0x7977('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7977('0x2'));var router=express[_0x7977('0x3')]();var fs_extra=require(_0x7977('0x4'));var auth=require(_0x7977('0x5'));var interaction=require(_0x7977('0x6'));var config=require(_0x7977('0x7'));var controller=require(_0x7977('0x8'));router[_0x7977('0x9')]('/',auth[_0x7977('0xa')](),controller[_0x7977('0xb')]);router[_0x7977('0x9')]('/:id',auth[_0x7977('0xa')](),controller[_0x7977('0xc')]);router['get']('/:id/sessions',auth[_0x7977('0xa')](),controller['getSessions']);router[_0x7977('0x9')](_0x7977('0xd'),auth[_0x7977('0xa')](),controller[_0x7977('0xe')]);router[_0x7977('0x9')](_0x7977('0xf'),auth[_0x7977('0xa')](),timeout('30s'),controller[_0x7977('0x10')]);router[_0x7977('0x11')]('/',auth[_0x7977('0xa')](),controller[_0x7977('0x12')]);router[_0x7977('0x11')](_0x7977('0x13'),auth[_0x7977('0xa')](),controller[_0x7977('0x14')]);router['put'](_0x7977('0x15'),auth[_0x7977('0xa')](),controller['update']);router[_0x7977('0x16')](_0x7977('0x15'),auth[_0x7977('0xa')](),controller[_0x7977('0x17')]);module['exports']=router; \ No newline at end of file +var _0x23da=['index','get','/:id','show','/:id/answers','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x224c8d,_0x10ca3c){var _0x277ab5=function(_0x30327c){while(--_0x30327c){_0x224c8d['push'](_0x224c8d['shift']());}};_0x277ab5(++_0x10ca3c);}(_0x23da,0x187));var _0xa23d=function(_0x5afe67,_0x2d726c){_0x5afe67=_0x5afe67-0x0;var _0x5996a4=_0x23da[_0x5afe67];return _0x5996a4;};'use strict';var multer=require(_0xa23d('0x0'));var util=require('util');var path=require(_0xa23d('0x1'));var timeout=require(_0xa23d('0x2'));var express=require(_0xa23d('0x3'));var router=express[_0xa23d('0x4')]();var fs_extra=require(_0xa23d('0x5'));var auth=require(_0xa23d('0x6'));var interaction=require(_0xa23d('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0xa23d('0x8')](),controller[_0xa23d('0x9')]);router[_0xa23d('0xa')](_0xa23d('0xb'),auth[_0xa23d('0x8')](),controller[_0xa23d('0xc')]);router[_0xa23d('0xa')]('/:id/sessions',auth[_0xa23d('0x8')](),controller['getSessions']);router[_0xa23d('0xa')](_0xa23d('0xd'),auth[_0xa23d('0x8')](),controller['getAnswers']);router['get']('/:id/summary',auth[_0xa23d('0x8')](),timeout(_0xa23d('0xe')),controller[_0xa23d('0xf')]);router[_0xa23d('0x10')]('/',auth[_0xa23d('0x8')](),controller[_0xa23d('0x11')]);router['post'](_0xa23d('0x12'),auth['isAuthenticated'](),controller[_0xa23d('0x13')]);router[_0xa23d('0x14')](_0xa23d('0xb'),auth['isAuthenticated'](),controller[_0xa23d('0x15')]);router[_0xa23d('0x16')](_0xa23d('0xb'),auth[_0xa23d('0x8')](),controller[_0xa23d('0x17')]);module[_0xa23d('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 87a45f3..9f85f78 100644 --- a/server/api/jscriptyProject/jscriptyProject.attributes.js +++ b/server/api/jscriptyProject/jscriptyProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc31a=['util','exports','STRING','name','long','isString','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','sequelize'];(function(_0x537f03,_0xad254c){var _0x10cefd=function(_0x18df43){while(--_0x18df43){_0x537f03['push'](_0x537f03['shift']());}};_0x10cefd(++_0xad254c);}(_0xc31a,0x1d3));var _0xac31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc31a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xac31('0x0'));var _=require('lodash');var util=require(_0xac31('0x1'));module[_0xac31('0x2')]={'name':{'type':Sequelize[_0xac31('0x3')],'unique':_0xac31('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xac31('0x5')),'set':function(_0x1eaf45){if(_['isObjectLike'](_0x1eaf45)){this['setDataValue']('formData',JSON['stringify'](_0x1eaf45));}else if(_[_0xac31('0x6')](_0x1eaf45)){this[_0xac31('0x7')](_0xac31('0x8'),_0x1eaf45);}else{this['setDataValue']('formData',util[_0xac31('0x9')](_0xac31('0xa'),this[_0xac31('0xb')](_0xac31('0x4'))||'',this['getDataValue'](_0xac31('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x96ff=['isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x96ff,0x6c));var _0xf96f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x96ff[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xf96f('0x0'));var _=require(_0xf96f('0x1'));var util=require(_0xf96f('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf96f('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x4a651a){if(_[_0xf96f('0x4')](_0x4a651a)){this['setDataValue'](_0xf96f('0x5'),JSON[_0xf96f('0x6')](_0x4a651a));}else if(_[_0xf96f('0x7')](_0x4a651a)){this[_0xf96f('0x8')](_0xf96f('0x5'),_0x4a651a);}else{this['setDataValue']('formData',util[_0xf96f('0x9')](_0xf96f('0xa'),this[_0xf96f('0xb')](_0xf96f('0x3'))||'',this[_0xf96f('0xb')](_0xf96f('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf96f('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf96f('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e095a10..1c45b5b 100644 --- a/server/api/jscriptyProject/jscriptyProject.controller.js +++ b/server/api/jscriptyProject/jscriptyProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7ab=['download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','error','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','include','findAll','catch','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','length','includeAll','omit','updatedAt','body','createdAt','userProfileId','update','getSessions','findOne','JscriptySessionReport','rows','JscriptyAnswerReport','fromCharCode','indexOf','toString','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd7ab,0x14e));var _0xbd7a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd7ab[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xbd7a('0x0'));var rimraf=require(_0xbd7a('0x1'));var zipdir=require(_0xbd7a('0x2'));var jsonpatch=require(_0xbd7a('0x3'));var rp=require(_0xbd7a('0x4'));var moment=require(_0xbd7a('0x5'));var BPromise=require(_0xbd7a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbd7a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd7a('0x8'));var _=require(_0xbd7a('0x9'));var squel=require(_0xbd7a('0xa'));var crypto=require('crypto');var jsforce=require(_0xbd7a('0xb'));var deskjs=require(_0xbd7a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbd7a('0xd'));var Papa=require('papaparse');var Redis=require(_0xbd7a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbd7a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbd7a('0x10'));var utils=require(_0xbd7a('0x11'));var config=require(_0xbd7a('0x12'));var licenseUtil=require(_0xbd7a('0x13'));var db=require(_0xbd7a('0x14'))['db'];function respondWithStatusCode(_0x5aaa2d,_0x2133eb){_0x2133eb=_0x2133eb||0xcc;return function(_0x5393ee){if(_0x5393ee){return _0x5aaa2d[_0xbd7a('0x15')](_0x2133eb);}return _0x5aaa2d[_0xbd7a('0x16')](_0x2133eb)[_0xbd7a('0x17')]();};}function respondWithResult(_0x354119,_0x2b3731){_0x2b3731=_0x2b3731||0xc8;return function(_0x427a93){if(_0x427a93){return _0x354119['status'](_0x2b3731)[_0xbd7a('0x18')](_0x427a93);}};}function respondWithFilteredResult(_0x59dd24,_0x301b95){return function(_0x520d5a){if(_0x520d5a){var _0x3fb8f4=typeof _0x301b95[_0xbd7a('0x19')]===_0xbd7a('0x1a')&&typeof _0x301b95[_0xbd7a('0x1b')]===_0xbd7a('0x1a');var _0x123be5=_0x520d5a[_0xbd7a('0x1c')];var _0x5b063a=_0x3fb8f4?0x0:_0x301b95['offset'];var _0x5a71eb=_0x3fb8f4?_0x520d5a[_0xbd7a('0x1c')]:_0x301b95[_0xbd7a('0x19')]+_0x301b95['limit'];var _0x340229;if(_0x5a71eb>=_0x123be5){_0x5a71eb=_0x123be5;_0x340229=0xc8;}else{_0x340229=0xce;}_0x59dd24[_0xbd7a('0x16')](_0x340229);return _0x59dd24[_0xbd7a('0x1d')](_0xbd7a('0x1e'),_0x5b063a+'-'+_0x5a71eb+'/'+_0x123be5)[_0xbd7a('0x18')](_0x520d5a);}return null;};}function patchUpdates(_0x2d6e2f){return function(_0x16bbb5){try{jsonpatch[_0xbd7a('0x1f')](_0x16bbb5,_0x2d6e2f,!![]);}catch(_0x3fbe95){return BPromise['reject'](_0x3fbe95);}return _0x16bbb5[_0xbd7a('0x20')]();};}function saveUpdates(_0x5ad9c6,_0x4b2842){return function(_0x5d5918){if(_0x5d5918){return _0x5d5918['update'](_0x5ad9c6)[_0xbd7a('0x21')](function(_0x1d53b0){return _0x1d53b0;});}return null;};}function removeEntity(_0x2650a0,_0x3b2e24){return function(_0x16a97b){if(_0x16a97b){return _0x16a97b[_0xbd7a('0x22')]()['then'](function(){var _0x1e5ad6=_0x16a97b[_0xbd7a('0x23')]({'plain':!![]});var _0x1a15c='Projects';return db[_0xbd7a('0x24')]['destroy']({'where':{'type':_0x1a15c,'resourceId':_0x1e5ad6['id']}})[_0xbd7a('0x21')](function(){return _0x16a97b;});})['then'](function(){_0x2650a0[_0xbd7a('0x16')](0xcc)[_0xbd7a('0x17')]();});}};}function handleEntityNotFound(_0x5d4558,_0x2eb44c){return function(_0x8ce570){if(!_0x8ce570){_0x5d4558[_0xbd7a('0x15')](0x194);}return _0x8ce570;};}function handleError(_0x4e551d,_0x335520){_0x335520=_0x335520||0x1f4;return function(_0x33f0b7){logger[_0xbd7a('0x25')](_0x33f0b7['stack']);if(_0x33f0b7[_0xbd7a('0x26')]){delete _0x33f0b7[_0xbd7a('0x26')];}_0x4e551d['status'](_0x335520)[_0xbd7a('0x27')](_0x33f0b7);};}exports[_0xbd7a('0x28')]=function(_0x269c15,_0x449266){var _0x2a5d2={},_0x1d89d6={},_0x31ae4e={'count':0x0,'rows':[]};var _0x42bcf9=_[_0xbd7a('0x29')](db[_0xbd7a('0x2a')][_0xbd7a('0x2b')],function(_0x4443bd){return{'name':_0x4443bd[_0xbd7a('0x2c')],'type':_0x4443bd[_0xbd7a('0x2d')][_0xbd7a('0x2e')]};});_0x1d89d6[_0xbd7a('0x2f')]=_[_0xbd7a('0x29')](_0x42bcf9,'name');_0x1d89d6[_0xbd7a('0x30')]=_[_0xbd7a('0x31')](_0x269c15[_0xbd7a('0x30')]);_0x1d89d6[_0xbd7a('0x32')]=_[_0xbd7a('0x33')](_0x1d89d6['model'],_0x1d89d6[_0xbd7a('0x30')]);_0x2a5d2[_0xbd7a('0x34')]=_[_0xbd7a('0x33')](_0x1d89d6['model'],qs[_0xbd7a('0x35')](_0x269c15['query'][_0xbd7a('0x35')]));_0x2a5d2[_0xbd7a('0x34')]=_0x2a5d2[_0xbd7a('0x34')]['length']?_0x2a5d2['attributes']:_0x1d89d6[_0xbd7a('0x2f')];if(!_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x36')](_0xbd7a('0x37'))){_0x2a5d2[_0xbd7a('0x1b')]=qs[_0xbd7a('0x1b')](_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x1b')]);_0x2a5d2[_0xbd7a('0x19')]=qs[_0xbd7a('0x19')](_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x19')]);}_0x2a5d2[_0xbd7a('0x38')]=qs[_0xbd7a('0x39')](_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x39')]);_0x2a5d2['where']=qs[_0xbd7a('0x32')](_[_0xbd7a('0x3a')](_0x269c15[_0xbd7a('0x30')],_0x1d89d6['filters']),_0x42bcf9);if(_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x3b')]){_0x2a5d2['where']=_[_0xbd7a('0x3c')](_0x2a5d2[_0xbd7a('0x3d')],{'$or':_[_0xbd7a('0x29')](_0x42bcf9,function(_0x5cb8ca){if(_0x5cb8ca[_0xbd7a('0x2d')]!=='VIRTUAL'){var _0x2576ed={};_0x2576ed[_0x5cb8ca[_0xbd7a('0x26')]]={'$like':'%'+_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x3b')]+'%'};return _0x2576ed;}})});}_0x2a5d2=_[_0xbd7a('0x3c')]({},_0x2a5d2,_0x269c15['options']);var _0x162dd8={'where':_0x2a5d2[_0xbd7a('0x3d')]};return db[_0xbd7a('0x2a')]['count'](_0x162dd8)['then'](function(_0x4a65d5){_0x31ae4e[_0xbd7a('0x1c')]=_0x4a65d5;if(_0x269c15[_0xbd7a('0x30')]['includeAll']){_0x2a5d2[_0xbd7a('0x3e')]=[{'all':!![]}];}return db[_0xbd7a('0x2a')][_0xbd7a('0x3f')](_0x2a5d2);})[_0xbd7a('0x21')](function(_0x4748d1){_0x31ae4e['rows']=_0x4748d1;return _0x31ae4e;})[_0xbd7a('0x21')](respondWithFilteredResult(_0x449266,_0x2a5d2))[_0xbd7a('0x40')](handleError(_0x449266,null));};exports['show']=function(_0x12467f,_0x9394e5){var _0x17617c={'raw':![],'where':{'id':_0x12467f['params']['id']}},_0x42ba39={};_0x42ba39[_0xbd7a('0x2f')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x42ba39[_0xbd7a('0x30')]=_[_0xbd7a('0x31')](_0x12467f['query']);_0x42ba39[_0xbd7a('0x32')]=_['intersection'](_0x42ba39[_0xbd7a('0x2f')],_0x42ba39[_0xbd7a('0x30')]);_0x17617c[_0xbd7a('0x34')]=_[_0xbd7a('0x33')](_0x42ba39[_0xbd7a('0x2f')],qs[_0xbd7a('0x35')](_0x12467f[_0xbd7a('0x30')][_0xbd7a('0x35')]));_0x17617c[_0xbd7a('0x34')]=_0x17617c[_0xbd7a('0x34')]['length']?_0x17617c[_0xbd7a('0x34')]:_0x42ba39[_0xbd7a('0x2f')];if(_0x12467f['query']['includeAll']){_0x17617c[_0xbd7a('0x3e')]=[{'all':!![]}];}_0x17617c=_[_0xbd7a('0x3c')]({},_0x17617c,_0x12467f[_0xbd7a('0x41')]);return db[_0xbd7a('0x2a')][_0xbd7a('0x42')](_0x17617c)[_0xbd7a('0x21')](handleEntityNotFound(_0x9394e5,null))[_0xbd7a('0x21')](respondWithResult(_0x9394e5,null))[_0xbd7a('0x40')](handleError(_0x9394e5,null));};exports[_0xbd7a('0x43')]=function(_0x526ce5,_0x2a08a1){return db['JscriptyProject']['create'](_0x526ce5['body'],{})[_0xbd7a('0x21')](function(_0x4d9fee){var _0x1b3a57=_0x526ce5[_0xbd7a('0x44')]['get']({'plain':!![]});if(!_0x1b3a57)throw new Error(_0xbd7a('0x45'));if(_0x1b3a57[_0xbd7a('0x46')]==='user'){var _0x455acc=_0x4d9fee[_0xbd7a('0x23')]({'plain':!![]});var _0x4de29b='Projects';return db[_0xbd7a('0x47')]['find']({'where':{'name':_0x4de29b,'userProfileId':_0x1b3a57['userProfileId']},'raw':!![]})[_0xbd7a('0x21')](function(_0x186e3f){if(_0x186e3f&&_0x186e3f[_0xbd7a('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x455acc['name'],'resourceId':_0x455acc['id'],'type':_0x186e3f[_0xbd7a('0x26')],'sectionId':_0x186e3f['id']},{})['then'](function(){return _0x4d9fee;});}else{return _0x4d9fee;}})[_0xbd7a('0x40')](function(_0x2af4cd){logger[_0xbd7a('0x25')](_0xbd7a('0x49'),_0x2af4cd);throw _0x2af4cd;});}return _0x4d9fee;})[_0xbd7a('0x21')](respondWithResult(_0x2a08a1,0xc9))[_0xbd7a('0x40')](handleError(_0x2a08a1,null));};exports[_0xbd7a('0x4a')]=function(_0x4c0b50,_0x4f5c1f){var _0x5509f7={'where':{'id':_0x4c0b50[_0xbd7a('0x4b')]['id']}},_0x301c56={};_0x301c56['model']=_[_0xbd7a('0x31')](db['JscriptyProject']['rawAttributes']);_0x5509f7['attributes']=_['intersection'](_0x301c56[_0xbd7a('0x2f')],qs[_0xbd7a('0x35')](_0x4c0b50[_0xbd7a('0x30')][_0xbd7a('0x35')]));_0x5509f7[_0xbd7a('0x34')]=_0x5509f7['attributes'][_0xbd7a('0x4c')]?_0x5509f7['attributes']:_0x301c56[_0xbd7a('0x2f')];if(_0x4c0b50[_0xbd7a('0x30')][_0xbd7a('0x4d')]){_0x5509f7[_0xbd7a('0x3e')]=[{'all':!![]}];}_0x5509f7=_[_0xbd7a('0x3c')]({},_0x5509f7,_0x4c0b50[_0xbd7a('0x41')]);return db['JscriptyProject'][_0xbd7a('0x42')](_0x5509f7)[_0xbd7a('0x21')](handleEntityNotFound(_0x4f5c1f,null))[_0xbd7a('0x21')](function(_0x560548){if(_0x560548){var _0x11616d=_0x560548[_0xbd7a('0x23')]({'plain':!![]});_0x11616d=qs[_0xbd7a('0x4e')](_0x11616d,['id','createdAt',_0xbd7a('0x4f')]);_0x4c0b50['body']=_[_0xbd7a('0x4e')](_0x4c0b50[_0xbd7a('0x50')],['id',_0xbd7a('0x51'),_0xbd7a('0x4f')]);return db['JscriptyProject'][_0xbd7a('0x43')](_['merge'](_0x11616d,_0x4c0b50[_0xbd7a('0x50')]),{'include':_0x4c0b50['query'][_0xbd7a('0x4d')]?[{'all':!![]}]:undefined})[_0xbd7a('0x21')](function(_0x390143){var _0x416bb0=_0x4c0b50[_0xbd7a('0x44')][_0xbd7a('0x23')]({'plain':!![]});if(!_0x416bb0)throw new Error(_0xbd7a('0x45'));if(_0x416bb0['role']===_0xbd7a('0x44')){var _0x9d764e=_0x390143[_0xbd7a('0x23')]({'plain':!![]});var _0x24d507='Projects';return db['UserProfileSection'][_0xbd7a('0x42')]({'where':{'name':_0x24d507,'userProfileId':_0x416bb0[_0xbd7a('0x52')]},'raw':!![]})[_0xbd7a('0x21')](function(_0x3d497c){if(_0x3d497c&&_0x3d497c[_0xbd7a('0x48')]===0x0){return db[_0xbd7a('0x24')][_0xbd7a('0x43')]({'name':_0x9d764e['name'],'resourceId':_0x9d764e['id'],'type':_0x3d497c['name'],'sectionId':_0x3d497c['id']},{})[_0xbd7a('0x21')](function(){return _0x390143;});}else{return _0x390143;}})[_0xbd7a('0x40')](function(_0x5ea401){logger[_0xbd7a('0x25')](_0xbd7a('0x49'),_0x5ea401);throw _0x5ea401;});}return _0x390143;});}})[_0xbd7a('0x21')](respondWithResult(_0x4f5c1f,0xc9))['catch'](handleError(_0x4f5c1f,null));};exports[_0xbd7a('0x53')]=function(_0x23ec5b,_0x273b18){if(_0x23ec5b[_0xbd7a('0x50')]['id']){delete _0x23ec5b[_0xbd7a('0x50')]['id'];}return db['JscriptyProject'][_0xbd7a('0x42')]({'where':{'id':_0x23ec5b[_0xbd7a('0x4b')]['id']}})[_0xbd7a('0x21')](handleEntityNotFound(_0x273b18,null))['then'](saveUpdates(_0x23ec5b['body'],null))['then'](respondWithResult(_0x273b18,null))[_0xbd7a('0x40')](handleError(_0x273b18,null));};exports[_0xbd7a('0x22')]=function(_0x2a2b88,_0xfa0419){return db['JscriptyProject']['find']({'where':{'id':_0x2a2b88[_0xbd7a('0x4b')]['id']}})[_0xbd7a('0x21')](handleEntityNotFound(_0xfa0419,null))['then'](removeEntity(_0xfa0419,null))[_0xbd7a('0x40')](handleError(_0xfa0419,null));};exports[_0xbd7a('0x54')]=function(_0x8dc915,_0x296984,_0x38621a){var _0x448505={'raw':!![],'where':{}};var _0x39c2d1={};var _0x2c323d={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xbd7a('0x55')]({'where':{'id':_0x8dc915[_0xbd7a('0x4b')]['id']}})[_0xbd7a('0x21')](handleEntityNotFound(_0x296984,null))[_0xbd7a('0x21')](function(_0x21c38b){if(_0x21c38b){_0x39c2d1[_0xbd7a('0x2f')]=_[_0xbd7a('0x31')](db[_0xbd7a('0x56')]['rawAttributes']);_0x39c2d1['query']=_['keys'](_0x8dc915[_0xbd7a('0x30')]);_0x39c2d1['filters']=_[_0xbd7a('0x33')](_0x39c2d1[_0xbd7a('0x2f')],_0x39c2d1[_0xbd7a('0x30')]);_0x448505['attributes']=_[_0xbd7a('0x33')](_0x39c2d1[_0xbd7a('0x2f')],qs[_0xbd7a('0x35')](_0x8dc915[_0xbd7a('0x30')]['fields']));_0x448505['attributes']=_0x448505[_0xbd7a('0x34')][_0xbd7a('0x4c')]?_0x448505[_0xbd7a('0x34')]:_0x39c2d1['model'];if(!_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x36')]('nolimit')){_0x448505[_0xbd7a('0x1b')]=qs['limit'](_0x8dc915[_0xbd7a('0x30')]['limit']);_0x448505[_0xbd7a('0x19')]=qs[_0xbd7a('0x19')](_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x19')]);}_0x448505['order']=qs[_0xbd7a('0x39')](_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x39')]);_0x448505[_0xbd7a('0x3d')]=qs[_0xbd7a('0x32')](_[_0xbd7a('0x3a')](_0x8dc915['query'],_0x39c2d1[_0xbd7a('0x32')]));_0x448505[_0xbd7a('0x3d')]['ProjectId']=_0x21c38b['id'];if(_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x3b')]){_0x448505[_0xbd7a('0x3d')]=_[_0xbd7a('0x3c')](_0x448505['where'],{'$or':_[_0xbd7a('0x29')](_0x448505[_0xbd7a('0x34')],function(_0x26baa4){var _0x51d94d={};_0x51d94d[_0x26baa4]={'$like':'%'+_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x3b')]+'%'};return _0x51d94d;})});}_0x448505=_[_0xbd7a('0x3c')]({},_0x448505,_0x8dc915[_0xbd7a('0x41')]);return db[_0xbd7a('0x56')]['count']({'where':_0x448505[_0xbd7a('0x3d')]})[_0xbd7a('0x21')](function(_0x56d93b){_0x2c323d[_0xbd7a('0x1c')]=_0x56d93b;if(_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x4d')]){_0x448505[_0xbd7a('0x3e')]=[{'all':!![]}];}return db[_0xbd7a('0x56')][_0xbd7a('0x3f')](_0x448505);})[_0xbd7a('0x21')](function(_0xecba26){_0x2c323d[_0xbd7a('0x57')]=_0xecba26;return _0x2c323d;});}})['then'](respondWithFilteredResult(_0x296984,_0x448505))[_0xbd7a('0x40')](handleError(_0x296984,null));};exports['getAnswers']=function(_0x5a7bd7,_0x143670,_0x17bd00){var _0x3fd69a={'raw':!![],'where':{}};var _0x101d25={};var _0x62ddbc={'count':0x0,'rows':[]};return db[_0xbd7a('0x2a')][_0xbd7a('0x55')]({'where':{'id':_0x5a7bd7['params']['id']}})[_0xbd7a('0x21')](handleEntityNotFound(_0x143670,null))[_0xbd7a('0x21')](function(_0x25e52f){if(_0x25e52f){_0x101d25['model']=_['keys'](db[_0xbd7a('0x58')]['rawAttributes']);_0x101d25[_0xbd7a('0x30')]=_['keys'](_0x5a7bd7['query']);_0x101d25[_0xbd7a('0x32')]=_[_0xbd7a('0x33')](_0x101d25[_0xbd7a('0x2f')],_0x101d25[_0xbd7a('0x30')]);_0x3fd69a[_0xbd7a('0x34')]=_[_0xbd7a('0x33')](_0x101d25[_0xbd7a('0x2f')],qs[_0xbd7a('0x35')](_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x35')]));_0x3fd69a[_0xbd7a('0x34')]=_0x3fd69a[_0xbd7a('0x34')]['length']?_0x3fd69a[_0xbd7a('0x34')]:_0x101d25[_0xbd7a('0x2f')];if(!_0x5a7bd7['query'][_0xbd7a('0x36')](_0xbd7a('0x37'))){_0x3fd69a[_0xbd7a('0x1b')]=qs[_0xbd7a('0x1b')](_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x1b')]);_0x3fd69a[_0xbd7a('0x19')]=qs[_0xbd7a('0x19')](_0x5a7bd7['query'][_0xbd7a('0x19')]);}_0x3fd69a['order']=qs[_0xbd7a('0x39')](_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x39')]);_0x3fd69a[_0xbd7a('0x3d')]=qs[_0xbd7a('0x32')](_[_0xbd7a('0x3a')](_0x5a7bd7[_0xbd7a('0x30')],_0x101d25[_0xbd7a('0x32')]));_0x3fd69a[_0xbd7a('0x3d')]['ProjectId']=_0x25e52f['id'];if(_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x3b')]){_0x3fd69a[_0xbd7a('0x3d')]=_[_0xbd7a('0x3c')](_0x3fd69a[_0xbd7a('0x3d')],{'$or':_[_0xbd7a('0x29')](_0x3fd69a['attributes'],function(_0x5114c3){var _0x1bf2f4={};_0x1bf2f4[_0x5114c3]={'$like':'%'+_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x3b')]+'%'};return _0x1bf2f4;})});}_0x3fd69a=_[_0xbd7a('0x3c')]({},_0x3fd69a,_0x5a7bd7['options']);return db[_0xbd7a('0x58')]['count']({'where':_0x3fd69a[_0xbd7a('0x3d')]})[_0xbd7a('0x21')](function(_0x51ab35){_0x62ddbc['count']=_0x51ab35;if(_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x4d')]){_0x3fd69a[_0xbd7a('0x3e')]=[{'all':!![]}];}return db[_0xbd7a('0x58')]['findAll'](_0x3fd69a);})[_0xbd7a('0x21')](function(_0x4e6ab4){_0x62ddbc['rows']=_0x4e6ab4;return _0x62ddbc;});}})[_0xbd7a('0x21')](respondWithFilteredResult(_0x143670,_0x3fd69a))[_0xbd7a('0x40')](handleError(_0x143670,null));};function char(_0x550591){return'number'===typeof _0x550591?String[_0xbd7a('0x59')][_0xbd7a('0x1f')](null,arguments):_0x550591;}function needsEncapsulation(_0x931195){return!!_0x931195&&(_0x931195['toString']()[_0xbd7a('0x5a')](char(0xd))>=0x0||_0x931195['toString']()[_0xbd7a('0x5a')](char(0xa))>=0x0||_0x931195[_0xbd7a('0x5b')]()[_0xbd7a('0x5a')](char(0x2c))>=0x0||_0x931195['toString']()[_0xbd7a('0x5a')](char(0x22))>=0x0);}function encapsulate(_0x38e874){var _0x58d740=char(0x22),_0x302967='\x5c'+char(0x22),_0x1b311f=_0x38e874['toString']()[_0xbd7a('0x5c')](new RegExp(_0x58d740,'g'),_0x302967);return _0x58d740+_0x1b311f+_0x58d740;}exports['getSummary']=function(_0x2a54bf,_0x1ba94b,_0x1b9690){var _0x28fc6f,_0x4379c6;var _0x3443a3={'where':{'ProjectId':_0x2a54bf[_0xbd7a('0x4b')]['id']}};if(_0x2a54bf[_0xbd7a('0x30')][_0xbd7a('0x5d')]){_0x3443a3[_0xbd7a('0x3d')][_0xbd7a('0x5e')]=JSON[_0xbd7a('0x5f')](_0x2a54bf[_0xbd7a('0x30')]['startTime']);}return db[_0xbd7a('0x56')][_0xbd7a('0x3f')](_0x3443a3)['then'](handleEntityNotFound(_0x1ba94b,null))['then'](function(_0x1e5822){if(_0x1e5822){_0x28fc6f=_0x1e5822;return db[_0xbd7a('0x60')][_0xbd7a('0x3f')]({'where':{'SessionId':{'$in':_[_0xbd7a('0x29')](_0x28fc6f,'id')},'ProjectId':_0x2a54bf[_0xbd7a('0x4b')]['id']},'order':_0xbd7a('0x61')});}})['then'](handleEntityNotFound(_0x1ba94b,null))[_0xbd7a('0x21')](function(_0x9379db){if(_0x9379db){_0x4379c6=_0x9379db;var _0x40b862={};for(var _0x2383dd=0x0,_0x3e0f27=_0x4379c6[_0xbd7a('0x4c')];_0x2383dd<_0x3e0f27;_0x2383dd++){if(!_0x40b862['hasOwnProperty'](_0x4379c6[_0x2383dd][_0xbd7a('0x62')])){_0x40b862[_0x4379c6[_0x2383dd][_0xbd7a('0x62')]]=needsEncapsulation(_0x4379c6[_0x2383dd][_0xbd7a('0x63')])?encapsulate(_0x4379c6[_0x2383dd][_0xbd7a('0x63')]):_0x4379c6[_0x2383dd][_0xbd7a('0x63')];}}var _0x157518=[],_0x4f0c41={};for(var _0x231383=0x0,_0x2ca152=_0x28fc6f[_0xbd7a('0x4c')];_0x231383<_0x2ca152;_0x231383++){_0x4f0c41={'ProjectId':_0x2a54bf['params']['id'],'SessionId':_0x28fc6f[_0x231383]['id'],'StartTime':moment(_0x28fc6f[_0x231383][_0xbd7a('0x5e')])[_0xbd7a('0x64')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x405a87=0x0,_0x3fc863=_0x4379c6[_0xbd7a('0x4c')];_0x405a87<_0x3fc863;_0x405a87++){if(_0x4379c6[_0x405a87][_0xbd7a('0x65')]==_0x28fc6f[_0x231383]['id']&&_0x40b862[_0xbd7a('0x36')](_0x4379c6[_0x405a87]['questionId'])){_0x4f0c41[_0x40b862[_0x4379c6[_0x405a87][_0xbd7a('0x62')]]]=_0x4379c6[_0x405a87]['answer'];}}for(var _0x3dfc0a in _0x40b862){if(!_0x4f0c41[_0xbd7a('0x36')](_0x40b862[_0x3dfc0a])){_0x4f0c41[_0x40b862[_0x3dfc0a]]=null;}}_0x157518[_0xbd7a('0x66')](_0x4f0c41);}return _0x157518;}})[_0xbd7a('0x21')](function(_0x41001c){if(!_[_0xbd7a('0x67')](_0x41001c)){var _0x7eb94a=toCsv(_0x41001c);var _0xcae4ee=Date[_0xbd7a('0x68')]();fs['writeFileSync'](util['format'](_0xbd7a('0x69'),_0x2a54bf[_0xbd7a('0x4b')]['id'],_0xcae4ee),_0x7eb94a);_0x1ba94b[_0xbd7a('0x6a')]('Content-disposition',_0xbd7a('0x6b')+util[_0xbd7a('0x64')]('Jscripty_Project_%d_Summary_%s.csv',_0x2a54bf['params']['id'],_0xcae4ee));_0x1ba94b[_0xbd7a('0x6a')](_0xbd7a('0x6c'),_0xbd7a('0x6d'));return _0x1ba94b[_0xbd7a('0x6e')](util[_0xbd7a('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2a54bf['params']['id'],_0xcae4ee));}else{return _0x1ba94b[_0xbd7a('0x15')](0xcc);}})[_0xbd7a('0x40')](handleError(_0x1ba94b,null));}; \ No newline at end of file +var _0x9091=['YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','zip-dir','request-promise','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','index','JscriptyProject','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','length','include','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','create','clone','createdAt','updatedAt','omit','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','ProjectId','JscriptySessionReport','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','questionId','question','starttime','format'];(function(_0x42babc,_0x1287c0){var _0x3b240a=function(_0xd07e1f){while(--_0xd07e1f){_0x42babc['push'](_0x42babc['shift']());}};_0x3b240a(++_0x1287c0);}(_0x9091,0x1ed));var _0x1909=function(_0x2f5edd,_0x365552){_0x2f5edd=_0x2f5edd-0x0;var _0x13b74c=_0x9091[_0x2f5edd];return _0x13b74c;};'use strict';var emlformat=require(_0x1909('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1909('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1909('0x2'));var moment=require('moment');var BPromise=require(_0x1909('0x3'));var Mustache=require(_0x1909('0x4'));var util=require(_0x1909('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1909('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1909('0x7'));var squel=require(_0x1909('0x8'));var crypto=require(_0x1909('0x9'));var jsforce=require(_0x1909('0xa'));var deskjs=require(_0x1909('0xb'));var toCsv=require(_0x1909('0xc'));var querystring=require('querystring');var Papa=require(_0x1909('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1909('0xe'));var as=require(_0x1909('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1909('0x10'))(_0x1909('0x11'));var utils=require('../../config/utils');var config=require(_0x1909('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x1909('0x13'))['db'];function respondWithStatusCode(_0x989590,_0x52a882){_0x52a882=_0x52a882||0xcc;return function(_0x5e6a49){if(_0x5e6a49){return _0x989590[_0x1909('0x14')](_0x52a882);}return _0x989590[_0x1909('0x15')](_0x52a882)[_0x1909('0x16')]();};}function respondWithResult(_0x4b1572,_0x35222e){_0x35222e=_0x35222e||0xc8;return function(_0xa04392){if(_0xa04392){return _0x4b1572[_0x1909('0x15')](_0x35222e)[_0x1909('0x17')](_0xa04392);}};}function respondWithFilteredResult(_0x2a2cc7,_0x5c828a){return function(_0x3d3e89){if(_0x3d3e89){var _0x6297fa=typeof _0x5c828a[_0x1909('0x18')]===_0x1909('0x19')&&typeof _0x5c828a[_0x1909('0x1a')]==='undefined';var _0x2723b3=_0x3d3e89[_0x1909('0x1b')];var _0x5f4c3a=_0x6297fa?0x0:_0x5c828a[_0x1909('0x18')];var _0x5e7cc5=_0x6297fa?_0x3d3e89[_0x1909('0x1b')]:_0x5c828a[_0x1909('0x18')]+_0x5c828a[_0x1909('0x1a')];var _0xb39d7a;if(_0x5e7cc5>=_0x2723b3){_0x5e7cc5=_0x2723b3;_0xb39d7a=0xc8;}else{_0xb39d7a=0xce;}_0x2a2cc7[_0x1909('0x15')](_0xb39d7a);return _0x2a2cc7[_0x1909('0x1c')](_0x1909('0x1d'),_0x5f4c3a+'-'+_0x5e7cc5+'/'+_0x2723b3)[_0x1909('0x17')](_0x3d3e89);}return null;};}function patchUpdates(_0x3ec176){return function(_0x2c0c27){try{jsonpatch[_0x1909('0x1e')](_0x2c0c27,_0x3ec176,!![]);}catch(_0x6ee440){return BPromise[_0x1909('0x1f')](_0x6ee440);}return _0x2c0c27[_0x1909('0x20')]();};}function saveUpdates(_0x586114,_0x57d69a){return function(_0x3697a7){if(_0x3697a7){return _0x3697a7[_0x1909('0x21')](_0x586114)[_0x1909('0x22')](function(_0x20747f){return _0x20747f;});}return null;};}function removeEntity(_0x2ae7ed,_0x31f215){return function(_0x4c8eab){if(_0x4c8eab){return _0x4c8eab[_0x1909('0x23')]()[_0x1909('0x22')](function(){var _0x2b6cff=_0x4c8eab['get']({'plain':!![]});var _0x578c5f=_0x1909('0x24');return db[_0x1909('0x25')]['destroy']({'where':{'type':_0x578c5f,'resourceId':_0x2b6cff['id']}})['then'](function(){return _0x4c8eab;});})[_0x1909('0x22')](function(){_0x2ae7ed[_0x1909('0x15')](0xcc)[_0x1909('0x16')]();});}};}function handleEntityNotFound(_0x46fce6,_0x10b697){return function(_0x4e05d5){if(!_0x4e05d5){_0x46fce6['sendStatus'](0x194);}return _0x4e05d5;};}function handleError(_0x309ea8,_0x173b14){_0x173b14=_0x173b14||0x1f4;return function(_0x2c5277){logger[_0x1909('0x26')](_0x2c5277[_0x1909('0x27')]);if(_0x2c5277[_0x1909('0x28')]){delete _0x2c5277[_0x1909('0x28')];}_0x309ea8['status'](_0x173b14)['send'](_0x2c5277);};}exports[_0x1909('0x29')]=function(_0x51cdbd,_0x307229){var _0xa9db8e={},_0x190ce5={},_0x42b85e={'count':0x0,'rows':[]};var _0x7585d1=_['map'](db[_0x1909('0x2a')]['rawAttributes'],function(_0x36553e){return{'name':_0x36553e[_0x1909('0x2b')],'type':_0x36553e[_0x1909('0x2c')][_0x1909('0x2d')]};});_0x190ce5[_0x1909('0x2e')]=_[_0x1909('0x2f')](_0x7585d1,_0x1909('0x28'));_0x190ce5[_0x1909('0x30')]=_[_0x1909('0x31')](_0x51cdbd[_0x1909('0x30')]);_0x190ce5[_0x1909('0x32')]=_[_0x1909('0x33')](_0x190ce5[_0x1909('0x2e')],_0x190ce5[_0x1909('0x30')]);_0xa9db8e[_0x1909('0x34')]=_['intersection'](_0x190ce5['model'],qs[_0x1909('0x35')](_0x51cdbd[_0x1909('0x30')][_0x1909('0x35')]));_0xa9db8e[_0x1909('0x34')]=_0xa9db8e[_0x1909('0x34')]['length']?_0xa9db8e['attributes']:_0x190ce5[_0x1909('0x2e')];if(!_0x51cdbd[_0x1909('0x30')][_0x1909('0x36')](_0x1909('0x37'))){_0xa9db8e[_0x1909('0x1a')]=qs[_0x1909('0x1a')](_0x51cdbd[_0x1909('0x30')]['limit']);_0xa9db8e[_0x1909('0x18')]=qs[_0x1909('0x18')](_0x51cdbd['query'][_0x1909('0x18')]);}_0xa9db8e[_0x1909('0x38')]=qs[_0x1909('0x39')](_0x51cdbd[_0x1909('0x30')][_0x1909('0x39')]);_0xa9db8e['where']=qs['filters'](_[_0x1909('0x3a')](_0x51cdbd['query'],_0x190ce5['filters']),_0x7585d1);if(_0x51cdbd[_0x1909('0x30')][_0x1909('0x3b')]){_0xa9db8e[_0x1909('0x3c')]=_[_0x1909('0x3d')](_0xa9db8e[_0x1909('0x3c')],{'$or':_[_0x1909('0x2f')](_0x7585d1,function(_0x275b5f){if(_0x275b5f[_0x1909('0x2c')]!==_0x1909('0x3e')){var _0x1234cf={};_0x1234cf[_0x275b5f[_0x1909('0x28')]]={'$like':'%'+_0x51cdbd['query'][_0x1909('0x3b')]+'%'};return _0x1234cf;}})});}_0xa9db8e=_[_0x1909('0x3d')]({},_0xa9db8e,_0x51cdbd[_0x1909('0x3f')]);var _0x2b9244={'where':_0xa9db8e[_0x1909('0x3c')]};return db[_0x1909('0x2a')][_0x1909('0x1b')](_0x2b9244)[_0x1909('0x22')](function(_0x12b1c0){_0x42b85e[_0x1909('0x1b')]=_0x12b1c0;if(_0x51cdbd['query'][_0x1909('0x40')]){_0xa9db8e['include']=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0xa9db8e);})[_0x1909('0x22')](function(_0x5dd7bc){_0x42b85e[_0x1909('0x41')]=_0x5dd7bc;return _0x42b85e;})['then'](respondWithFilteredResult(_0x307229,_0xa9db8e))['catch'](handleError(_0x307229,null));};exports[_0x1909('0x42')]=function(_0x5a6fc4,_0x1fc58b){var _0xb9e085={'raw':![],'where':{'id':_0x5a6fc4[_0x1909('0x43')]['id']}},_0x1c85d4={};_0x1c85d4[_0x1909('0x2e')]=_['keys'](db[_0x1909('0x2a')][_0x1909('0x44')]);_0x1c85d4[_0x1909('0x30')]=_['keys'](_0x5a6fc4['query']);_0x1c85d4[_0x1909('0x32')]=_[_0x1909('0x33')](_0x1c85d4['model'],_0x1c85d4[_0x1909('0x30')]);_0xb9e085[_0x1909('0x34')]=_[_0x1909('0x33')](_0x1c85d4[_0x1909('0x2e')],qs[_0x1909('0x35')](_0x5a6fc4[_0x1909('0x30')][_0x1909('0x35')]));_0xb9e085[_0x1909('0x34')]=_0xb9e085['attributes'][_0x1909('0x45')]?_0xb9e085[_0x1909('0x34')]:_0x1c85d4[_0x1909('0x2e')];if(_0x5a6fc4[_0x1909('0x30')][_0x1909('0x40')]){_0xb9e085[_0x1909('0x46')]=[{'all':!![]}];}_0xb9e085=_[_0x1909('0x3d')]({},_0xb9e085,_0x5a6fc4['options']);return db[_0x1909('0x2a')]['find'](_0xb9e085)['then'](handleEntityNotFound(_0x1fc58b,null))[_0x1909('0x22')](respondWithResult(_0x1fc58b,null))[_0x1909('0x47')](handleError(_0x1fc58b,null));};exports['create']=function(_0x50e373,_0x23dd24){return db['JscriptyProject']['create'](_0x50e373[_0x1909('0x48')],{})['then'](function(_0x4d38fc){var _0x1c6e78=_0x50e373['user']['get']({'plain':!![]});if(!_0x1c6e78)throw new Error(_0x1909('0x49'));if(_0x1c6e78[_0x1909('0x4a')]===_0x1909('0x4b')){var _0x44a796=_0x4d38fc[_0x1909('0x4c')]({'plain':!![]});var _0xa9095a='Projects';return db[_0x1909('0x4d')]['find']({'where':{'name':_0xa9095a,'userProfileId':_0x1c6e78[_0x1909('0x4e')]},'raw':!![]})[_0x1909('0x22')](function(_0x396cb0){if(_0x396cb0&&_0x396cb0['autoAssociation']===0x0){return db['UserProfileResource'][_0x1909('0x4f')]({'name':_0x44a796[_0x1909('0x28')],'resourceId':_0x44a796['id'],'type':_0x396cb0['name'],'sectionId':_0x396cb0['id']},{})['then'](function(){return _0x4d38fc;});}else{return _0x4d38fc;}})[_0x1909('0x47')](function(_0x1b7ea4){logger[_0x1909('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b7ea4);throw _0x1b7ea4;});}return _0x4d38fc;})['then'](respondWithResult(_0x23dd24,0xc9))[_0x1909('0x47')](handleError(_0x23dd24,null));};exports[_0x1909('0x50')]=function(_0x28b67f,_0x485e62){var _0x24ad12={'where':{'id':_0x28b67f[_0x1909('0x43')]['id']}},_0xca174d={};_0xca174d[_0x1909('0x2e')]=_[_0x1909('0x31')](db[_0x1909('0x2a')][_0x1909('0x44')]);_0x24ad12[_0x1909('0x34')]=_[_0x1909('0x33')](_0xca174d[_0x1909('0x2e')],qs[_0x1909('0x35')](_0x28b67f['query'][_0x1909('0x35')]));_0x24ad12[_0x1909('0x34')]=_0x24ad12[_0x1909('0x34')][_0x1909('0x45')]?_0x24ad12[_0x1909('0x34')]:_0xca174d['model'];if(_0x28b67f[_0x1909('0x30')][_0x1909('0x40')]){_0x24ad12[_0x1909('0x46')]=[{'all':!![]}];}_0x24ad12=_[_0x1909('0x3d')]({},_0x24ad12,_0x28b67f['options']);return db[_0x1909('0x2a')]['find'](_0x24ad12)[_0x1909('0x22')](handleEntityNotFound(_0x485e62,null))['then'](function(_0x57ecdc){if(_0x57ecdc){var _0x33c9f2=_0x57ecdc[_0x1909('0x4c')]({'plain':!![]});_0x33c9f2=qs['omit'](_0x33c9f2,['id',_0x1909('0x51'),_0x1909('0x52')]);_0x28b67f[_0x1909('0x48')]=_[_0x1909('0x53')](_0x28b67f[_0x1909('0x48')],['id','createdAt',_0x1909('0x52')]);return db[_0x1909('0x2a')][_0x1909('0x4f')](_[_0x1909('0x3d')](_0x33c9f2,_0x28b67f[_0x1909('0x48')]),{'include':_0x28b67f[_0x1909('0x30')][_0x1909('0x40')]?[{'all':!![]}]:undefined})[_0x1909('0x22')](function(_0x224caa){var _0x47efbf=_0x28b67f['user'][_0x1909('0x4c')]({'plain':!![]});if(!_0x47efbf)throw new Error(_0x1909('0x49'));if(_0x47efbf[_0x1909('0x4a')]===_0x1909('0x4b')){var _0x495c4d=_0x224caa['get']({'plain':!![]});var _0x1f713b=_0x1909('0x24');return db[_0x1909('0x4d')][_0x1909('0x54')]({'where':{'name':_0x1f713b,'userProfileId':_0x47efbf[_0x1909('0x4e')]},'raw':!![]})[_0x1909('0x22')](function(_0xefef8d){if(_0xefef8d&&_0xefef8d[_0x1909('0x55')]===0x0){return db[_0x1909('0x25')][_0x1909('0x4f')]({'name':_0x495c4d['name'],'resourceId':_0x495c4d['id'],'type':_0xefef8d['name'],'sectionId':_0xefef8d['id']},{})['then'](function(){return _0x224caa;});}else{return _0x224caa;}})[_0x1909('0x47')](function(_0x1d03ed){logger[_0x1909('0x26')](_0x1909('0x56'),_0x1d03ed);throw _0x1d03ed;});}return _0x224caa;});}})[_0x1909('0x22')](respondWithResult(_0x485e62,0xc9))['catch'](handleError(_0x485e62,null));};exports[_0x1909('0x21')]=function(_0x2f5e83,_0x12dd5a){if(_0x2f5e83[_0x1909('0x48')]['id']){delete _0x2f5e83[_0x1909('0x48')]['id'];}return db[_0x1909('0x2a')][_0x1909('0x54')]({'where':{'id':_0x2f5e83[_0x1909('0x43')]['id']}})[_0x1909('0x22')](handleEntityNotFound(_0x12dd5a,null))[_0x1909('0x22')](saveUpdates(_0x2f5e83[_0x1909('0x48')],null))[_0x1909('0x22')](respondWithResult(_0x12dd5a,null))['catch'](handleError(_0x12dd5a,null));};exports['destroy']=function(_0x1622a8,_0xd9840e){return db['JscriptyProject'][_0x1909('0x54')]({'where':{'id':_0x1622a8[_0x1909('0x43')]['id']}})['then'](handleEntityNotFound(_0xd9840e,null))[_0x1909('0x22')](removeEntity(_0xd9840e,null))[_0x1909('0x47')](handleError(_0xd9840e,null));};exports[_0x1909('0x57')]=function(_0x3e464a,_0xe7aa2e,_0x46c69b){var _0x541a78={'raw':!![],'where':{}};var _0x10bd30={};var _0x34ef06={'count':0x0,'rows':[]};return db[_0x1909('0x2a')][_0x1909('0x58')]({'where':{'id':_0x3e464a[_0x1909('0x43')]['id']}})[_0x1909('0x22')](handleEntityNotFound(_0xe7aa2e,null))['then'](function(_0x37604d){if(_0x37604d){_0x10bd30[_0x1909('0x2e')]=_[_0x1909('0x31')](db['JscriptySessionReport'][_0x1909('0x44')]);_0x10bd30[_0x1909('0x30')]=_[_0x1909('0x31')](_0x3e464a[_0x1909('0x30')]);_0x10bd30[_0x1909('0x32')]=_[_0x1909('0x33')](_0x10bd30['model'],_0x10bd30[_0x1909('0x30')]);_0x541a78[_0x1909('0x34')]=_[_0x1909('0x33')](_0x10bd30[_0x1909('0x2e')],qs['fields'](_0x3e464a[_0x1909('0x30')]['fields']));_0x541a78['attributes']=_0x541a78[_0x1909('0x34')]['length']?_0x541a78['attributes']:_0x10bd30[_0x1909('0x2e')];if(!_0x3e464a['query'][_0x1909('0x36')](_0x1909('0x37'))){_0x541a78[_0x1909('0x1a')]=qs['limit'](_0x3e464a['query'][_0x1909('0x1a')]);_0x541a78[_0x1909('0x18')]=qs[_0x1909('0x18')](_0x3e464a['query'][_0x1909('0x18')]);}_0x541a78[_0x1909('0x38')]=qs['sort'](_0x3e464a[_0x1909('0x30')][_0x1909('0x39')]);_0x541a78[_0x1909('0x3c')]=qs[_0x1909('0x32')](_['pick'](_0x3e464a[_0x1909('0x30')],_0x10bd30[_0x1909('0x32')]));_0x541a78[_0x1909('0x3c')][_0x1909('0x59')]=_0x37604d['id'];if(_0x3e464a[_0x1909('0x30')][_0x1909('0x3b')]){_0x541a78[_0x1909('0x3c')]=_[_0x1909('0x3d')](_0x541a78[_0x1909('0x3c')],{'$or':_[_0x1909('0x2f')](_0x541a78['attributes'],function(_0x51be55){var _0x5452ab={};_0x5452ab[_0x51be55]={'$like':'%'+_0x3e464a[_0x1909('0x30')][_0x1909('0x3b')]+'%'};return _0x5452ab;})});}_0x541a78=_[_0x1909('0x3d')]({},_0x541a78,_0x3e464a['options']);return db[_0x1909('0x5a')][_0x1909('0x1b')]({'where':_0x541a78['where']})[_0x1909('0x22')](function(_0x2a8335){_0x34ef06[_0x1909('0x1b')]=_0x2a8335;if(_0x3e464a[_0x1909('0x30')][_0x1909('0x40')]){_0x541a78[_0x1909('0x46')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x1909('0x5b')](_0x541a78);})[_0x1909('0x22')](function(_0x5a88ab){_0x34ef06[_0x1909('0x41')]=_0x5a88ab;return _0x34ef06;});}})['then'](respondWithFilteredResult(_0xe7aa2e,_0x541a78))[_0x1909('0x47')](handleError(_0xe7aa2e,null));};exports[_0x1909('0x5c')]=function(_0x534fcd,_0x3001ac,_0x2929e4){var _0x3b9aa1={'raw':!![],'where':{}};var _0x3101a4={};var _0xc3b8e3={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x1909('0x58')]({'where':{'id':_0x534fcd[_0x1909('0x43')]['id']}})[_0x1909('0x22')](handleEntityNotFound(_0x3001ac,null))[_0x1909('0x22')](function(_0x10f037){if(_0x10f037){_0x3101a4['model']=_[_0x1909('0x31')](db['JscriptyAnswerReport'][_0x1909('0x44')]);_0x3101a4[_0x1909('0x30')]=_[_0x1909('0x31')](_0x534fcd[_0x1909('0x30')]);_0x3101a4[_0x1909('0x32')]=_[_0x1909('0x33')](_0x3101a4[_0x1909('0x2e')],_0x3101a4[_0x1909('0x30')]);_0x3b9aa1[_0x1909('0x34')]=_['intersection'](_0x3101a4[_0x1909('0x2e')],qs[_0x1909('0x35')](_0x534fcd[_0x1909('0x30')]['fields']));_0x3b9aa1[_0x1909('0x34')]=_0x3b9aa1[_0x1909('0x34')][_0x1909('0x45')]?_0x3b9aa1[_0x1909('0x34')]:_0x3101a4[_0x1909('0x2e')];if(!_0x534fcd[_0x1909('0x30')][_0x1909('0x36')]('nolimit')){_0x3b9aa1[_0x1909('0x1a')]=qs[_0x1909('0x1a')](_0x534fcd[_0x1909('0x30')]['limit']);_0x3b9aa1[_0x1909('0x18')]=qs[_0x1909('0x18')](_0x534fcd[_0x1909('0x30')][_0x1909('0x18')]);}_0x3b9aa1[_0x1909('0x38')]=qs[_0x1909('0x39')](_0x534fcd[_0x1909('0x30')][_0x1909('0x39')]);_0x3b9aa1[_0x1909('0x3c')]=qs[_0x1909('0x32')](_['pick'](_0x534fcd[_0x1909('0x30')],_0x3101a4[_0x1909('0x32')]));_0x3b9aa1[_0x1909('0x3c')][_0x1909('0x59')]=_0x10f037['id'];if(_0x534fcd[_0x1909('0x30')]['filter']){_0x3b9aa1[_0x1909('0x3c')]=_['merge'](_0x3b9aa1[_0x1909('0x3c')],{'$or':_[_0x1909('0x2f')](_0x3b9aa1[_0x1909('0x34')],function(_0x4e5f27){var _0x541190={};_0x541190[_0x4e5f27]={'$like':'%'+_0x534fcd[_0x1909('0x30')][_0x1909('0x3b')]+'%'};return _0x541190;})});}_0x3b9aa1=_[_0x1909('0x3d')]({},_0x3b9aa1,_0x534fcd[_0x1909('0x3f')]);return db[_0x1909('0x5d')][_0x1909('0x1b')]({'where':_0x3b9aa1[_0x1909('0x3c')]})[_0x1909('0x22')](function(_0x54f62d){_0xc3b8e3[_0x1909('0x1b')]=_0x54f62d;if(_0x534fcd[_0x1909('0x30')][_0x1909('0x40')]){_0x3b9aa1['include']=[{'all':!![]}];}return db[_0x1909('0x5d')][_0x1909('0x5b')](_0x3b9aa1);})[_0x1909('0x22')](function(_0x29ec7f){_0xc3b8e3['rows']=_0x29ec7f;return _0xc3b8e3;});}})[_0x1909('0x22')](respondWithFilteredResult(_0x3001ac,_0x3b9aa1))[_0x1909('0x47')](handleError(_0x3001ac,null));};function char(_0x293654){return _0x1909('0x5e')===typeof _0x293654?String[_0x1909('0x5f')][_0x1909('0x1e')](null,arguments):_0x293654;}function needsEncapsulation(_0x106166){return!!_0x106166&&(_0x106166[_0x1909('0x60')]()[_0x1909('0x61')](char(0xd))>=0x0||_0x106166[_0x1909('0x60')]()['indexOf'](char(0xa))>=0x0||_0x106166[_0x1909('0x60')]()['indexOf'](char(0x2c))>=0x0||_0x106166[_0x1909('0x60')]()[_0x1909('0x61')](char(0x22))>=0x0);}function encapsulate(_0x486ee1){var _0x41aa36=char(0x22),_0x428d8b='\x5c'+char(0x22),_0x15a3cd=_0x486ee1[_0x1909('0x60')]()[_0x1909('0x62')](new RegExp(_0x41aa36,'g'),_0x428d8b);return _0x41aa36+_0x15a3cd+_0x41aa36;}exports[_0x1909('0x63')]=function(_0x505ced,_0x4373b6,_0x46222c){var _0x5c5afe,_0x1f4b91;var _0x64578b={'where':{'ProjectId':_0x505ced[_0x1909('0x43')]['id']}};if(_0x505ced[_0x1909('0x30')][_0x1909('0x64')]){_0x64578b[_0x1909('0x3c')]['starttime']=JSON[_0x1909('0x65')](_0x505ced[_0x1909('0x30')][_0x1909('0x64')]);}return db[_0x1909('0x5a')][_0x1909('0x5b')](_0x64578b)[_0x1909('0x22')](handleEntityNotFound(_0x4373b6,null))[_0x1909('0x22')](function(_0x4fe7df){if(_0x4fe7df){_0x5c5afe=_0x4fe7df;return db[_0x1909('0x66')][_0x1909('0x5b')]({'where':{'SessionId':{'$in':_[_0x1909('0x2f')](_0x5c5afe,'id')},'ProjectId':_0x505ced[_0x1909('0x43')]['id']},'order':'-createdAt'});}})[_0x1909('0x22')](handleEntityNotFound(_0x4373b6,null))[_0x1909('0x22')](function(_0x98b424){if(_0x98b424){_0x1f4b91=_0x98b424;var _0x3f3de8={};for(var _0x3521eb=0x0,_0x2c8ee2=_0x1f4b91[_0x1909('0x45')];_0x3521eb<_0x2c8ee2;_0x3521eb++){if(!_0x3f3de8[_0x1909('0x36')](_0x1f4b91[_0x3521eb][_0x1909('0x67')])){_0x3f3de8[_0x1f4b91[_0x3521eb][_0x1909('0x67')]]=needsEncapsulation(_0x1f4b91[_0x3521eb][_0x1909('0x68')])?encapsulate(_0x1f4b91[_0x3521eb][_0x1909('0x68')]):_0x1f4b91[_0x3521eb][_0x1909('0x68')];}}var _0x1ed8f2=[],_0x19267b={};for(var _0x4b32bb=0x0,_0x35d054=_0x5c5afe[_0x1909('0x45')];_0x4b32bb<_0x35d054;_0x4b32bb++){_0x19267b={'ProjectId':_0x505ced[_0x1909('0x43')]['id'],'SessionId':_0x5c5afe[_0x4b32bb]['id'],'StartTime':moment(_0x5c5afe[_0x4b32bb][_0x1909('0x69')])[_0x1909('0x6a')](_0x1909('0x6b'))};for(var _0x5c9043=0x0,_0x33e9a6=_0x1f4b91[_0x1909('0x45')];_0x5c9043<_0x33e9a6;_0x5c9043++){if(_0x1f4b91[_0x5c9043][_0x1909('0x6c')]==_0x5c5afe[_0x4b32bb]['id']&&_0x3f3de8[_0x1909('0x36')](_0x1f4b91[_0x5c9043][_0x1909('0x67')])){_0x19267b[_0x3f3de8[_0x1f4b91[_0x5c9043]['questionId']]]=_0x1f4b91[_0x5c9043][_0x1909('0x6d')];}}for(var _0x305ac9 in _0x3f3de8){if(!_0x19267b[_0x1909('0x36')](_0x3f3de8[_0x305ac9])){_0x19267b[_0x3f3de8[_0x305ac9]]=null;}}_0x1ed8f2[_0x1909('0x6e')](_0x19267b);}return _0x1ed8f2;}})[_0x1909('0x22')](function(_0x546b49){if(!_[_0x1909('0x6f')](_0x546b49)){var _0xcf0776=toCsv(_0x546b49);var _0x1cb0e8=Date['now']();fs[_0x1909('0x70')](util['format'](_0x1909('0x71'),_0x505ced['params']['id'],_0x1cb0e8),_0xcf0776);_0x4373b6[_0x1909('0x72')](_0x1909('0x73'),_0x1909('0x74')+util[_0x1909('0x6a')](_0x1909('0x75'),_0x505ced[_0x1909('0x43')]['id'],_0x1cb0e8));_0x4373b6['setHeader']('Content-type',_0x1909('0x76'));return _0x4373b6[_0x1909('0x77')](util[_0x1909('0x6a')](_0x1909('0x71'),_0x505ced[_0x1909('0x43')]['id'],_0x1cb0e8));}else{return _0x4373b6['sendStatus'](0xcc);}})[_0x1909('0x47')](handleError(_0x4373b6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e84760e..d9aaff6 100644 --- a/server/api/jscriptyProject/jscriptyProject.model.js +++ b/server/api/jscriptyProject/jscriptyProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcba=['util','api','moment','bluebird','request-promise','path','rimraf','exports','JscriptyProject','jscripty_projects','lodash'];(function(_0x38d218,_0xd2f4be){var _0x3329e5=function(_0x27b8f4){while(--_0x27b8f4){_0x38d218['push'](_0x38d218['shift']());}};_0x3329e5(++_0xd2f4be);}(_0xbcba,0x6d));var _0xabcb=function(_0x3709ec,_0x51124a){_0x3709ec=_0x3709ec-0x0;var _0x41787a=_0xbcba[_0x3709ec];return _0x41787a;};'use strict';var _=require(_0xabcb('0x0'));var util=require(_0xabcb('0x1'));var logger=require('../../config/logger')(_0xabcb('0x2'));var moment=require(_0xabcb('0x3'));var BPromise=require(_0xabcb('0x4'));var rp=require(_0xabcb('0x5'));var fs=require('fs');var path=require(_0xabcb('0x6'));var rimraf=require(_0xabcb('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0xabcb('0x8')]=function(_0x1290b2,_0x5c706e){return _0x1290b2['define'](_0xabcb('0x9'),attributes,{'tableName':_0xabcb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb41=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash'];(function(_0x207696,_0x1cf674){var _0x4060f3=function(_0x3677dc){while(--_0x3677dc){_0x207696['push'](_0x207696['shift']());}};_0x4060f3(++_0x1cf674);}(_0xcb41,0x1df));var _0x1cb4=function(_0x4b479e,_0x5b1736){_0x4b479e=_0x4b479e-0x0;var _0x3064ad=_0xcb41[_0x4b479e];return _0x3064ad;};'use strict';var _=require(_0x1cb4('0x0'));var util=require(_0x1cb4('0x1'));var logger=require(_0x1cb4('0x2'))(_0x1cb4('0x3'));var moment=require('moment');var BPromise=require(_0x1cb4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb4('0x5'));var rimraf=require(_0x1cb4('0x6'));var config=require(_0x1cb4('0x7'));var attributes=require(_0x1cb4('0x8'));module[_0x1cb4('0x9')]=function(_0x547f4,_0x2eaeb4){return _0x547f4[_0x1cb4('0xa')]('JscriptyProject',attributes,{'tableName':_0x1cb4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 81237c3..000f638 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x195894,_0x44b728){var _0x50d94a=function(_0x551f79){while(--_0x551f79){_0x195894['push'](_0x195894['shift']());}};_0x50d94a(++_0x44b728);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xcb91[_0x377a6e];return _0x37f751;};'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')]('JscriptyProject,\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 _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x183c8a,_0x3317e7){var _0x85385a=function(_0x3366da){while(--_0x3366da){_0x183c8a['push'](_0x183c8a['shift']());}};_0x85385a(++_0x3317e7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 3fe6cd0..d6c2ebb 100644 --- a/server/api/jscriptyQuestionReport/index.js +++ b/server/api/jscriptyQuestionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9646=['../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x47a12a,_0x70f591){var _0x30cd40=function(_0x46b68f){while(--_0x46b68f){_0x47a12a['push'](_0x47a12a['shift']());}};_0x30cd40(++_0x70f591);}(_0x9646,0x1d6));var _0x6964=function(_0x5e7b6c,_0x4916d0){_0x5e7b6c=_0x5e7b6c-0x0;var _0x3afdbd=_0x9646[_0x5e7b6c];return _0x3afdbd;};'use strict';var multer=require('multer');var util=require(_0x6964('0x0'));var path=require('path');var timeout=require(_0x6964('0x1'));var express=require(_0x6964('0x2'));var router=express[_0x6964('0x3')]();var fs_extra=require(_0x6964('0x4'));var auth=require(_0x6964('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6964('0x6'));var controller=require(_0x6964('0x7'));router[_0x6964('0x8')]('/',auth['isAuthenticated'](),controller[_0x6964('0x9')]);router[_0x6964('0x8')](_0x6964('0xa'),auth[_0x6964('0xb')](),controller[_0x6964('0xc')]);router[_0x6964('0x8')](_0x6964('0xd'),auth['isAuthenticated'](),controller[_0x6964('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6964('0xf')]('/:id',auth[_0x6964('0xb')](),controller['update']);router['delete']('/:id',auth[_0x6964('0xb')](),controller[_0x6964('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9b20=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0x9b20,0xcc));var _0x09b2=function(_0x2ac42c,_0x400eff){_0x2ac42c=_0x2ac42c-0x0;var _0x29b7f3=_0x9b20[_0x2ac42c];return _0x29b7f3;};'use strict';var multer=require(_0x09b2('0x0'));var util=require('util');var path=require(_0x09b2('0x1'));var timeout=require(_0x09b2('0x2'));var express=require(_0x09b2('0x3'));var router=express[_0x09b2('0x4')]();var fs_extra=require(_0x09b2('0x5'));var auth=require(_0x09b2('0x6'));var interaction=require(_0x09b2('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x09b2('0x8')]('/',auth[_0x09b2('0x9')](),controller[_0x09b2('0xa')]);router[_0x09b2('0x8')](_0x09b2('0xb'),auth[_0x09b2('0x9')](),controller[_0x09b2('0xc')]);router[_0x09b2('0x8')](_0x09b2('0xd'),auth[_0x09b2('0x9')](),controller[_0x09b2('0xe')]);router[_0x09b2('0xf')]('/',auth[_0x09b2('0x9')](),controller[_0x09b2('0x10')]);router[_0x09b2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x09b2('0x12')]);router['delete'](_0x09b2('0xd'),auth[_0x09b2('0x9')](),controller[_0x09b2('0x13')]);module[_0x09b2('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 74951a8..cde02d2 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x4db275,_0x313591){_0x4db275=_0x4db275-0x0;var _0x5b4a19=_0x7a54[_0x4db275];return _0x5b4a19;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x304e3b,_0x4003bd){_0x304e3b=_0x304e3b-0x0;var _0x5a59a5=_0x7a54[_0x304e3b];return _0x5a59a5;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 9280884..f44bffc 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8e3=['rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','JscriptyQuestionReport'];(function(_0xf20f7d,_0x2c5c9d){var _0xa6888=function(_0x3a9adf){while(--_0x3a9adf){_0xf20f7d['push'](_0xf20f7d['shift']());}};_0xa6888(++_0x2c5c9d);}(_0xa8e3,0x101));var _0x3a8e=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0xa8e3[_0x10dfdf];return _0x4d857d;};'use strict';var emlformat=require(_0x3a8e('0x0'));var rimraf=require(_0x3a8e('0x1'));var zipdir=require(_0x3a8e('0x2'));var jsonpatch=require(_0x3a8e('0x3'));var rp=require('request-promise');var moment=require(_0x3a8e('0x4'));var BPromise=require(_0x3a8e('0x5'));var Mustache=require(_0x3a8e('0x6'));var util=require(_0x3a8e('0x7'));var path=require(_0x3a8e('0x8'));var sox=require('sox');var csv=require(_0x3a8e('0x9'));var ejs=require(_0x3a8e('0xa'));var fs=require('fs');var fs_extra=require(_0x3a8e('0xb'));var _=require(_0x3a8e('0xc'));var squel=require(_0x3a8e('0xd'));var crypto=require(_0x3a8e('0xe'));var jsforce=require(_0x3a8e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3a8e('0x9'));var querystring=require('querystring');var Papa=require(_0x3a8e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3a8e('0x11'));var as=require(_0x3a8e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a8e('0x13'))('api');var utils=require(_0x3a8e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3a8e('0x15'))['db'];function respondWithStatusCode(_0x44afd2,_0xd59d7f){_0xd59d7f=_0xd59d7f||0xcc;return function(_0x44388b){if(_0x44388b){return _0x44afd2[_0x3a8e('0x16')](_0xd59d7f);}return _0x44afd2[_0x3a8e('0x17')](_0xd59d7f)[_0x3a8e('0x18')]();};}function respondWithResult(_0x33c4db,_0x3eec8c){_0x3eec8c=_0x3eec8c||0xc8;return function(_0x53281c){if(_0x53281c){return _0x33c4db[_0x3a8e('0x17')](_0x3eec8c)[_0x3a8e('0x19')](_0x53281c);}};}function respondWithFilteredResult(_0x467766,_0x470005){return function(_0x4553f8){if(_0x4553f8){var _0x16cbd6=typeof _0x470005[_0x3a8e('0x1a')]===_0x3a8e('0x1b')&&typeof _0x470005['limit']===_0x3a8e('0x1b');var _0x681af2=_0x4553f8[_0x3a8e('0x1c')];var _0x1ba979=_0x16cbd6?0x0:_0x470005['offset'];var _0x216bb8=_0x16cbd6?_0x4553f8[_0x3a8e('0x1c')]:_0x470005[_0x3a8e('0x1a')]+_0x470005[_0x3a8e('0x1d')];var _0x39aa29;if(_0x216bb8>=_0x681af2){_0x216bb8=_0x681af2;_0x39aa29=0xc8;}else{_0x39aa29=0xce;}_0x467766[_0x3a8e('0x17')](_0x39aa29);return _0x467766[_0x3a8e('0x1e')](_0x3a8e('0x1f'),_0x1ba979+'-'+_0x216bb8+'/'+_0x681af2)[_0x3a8e('0x19')](_0x4553f8);}return null;};}function patchUpdates(_0x5c1057){return function(_0x1eec45){try{jsonpatch[_0x3a8e('0x20')](_0x1eec45,_0x5c1057,!![]);}catch(_0x19dc26){return BPromise[_0x3a8e('0x21')](_0x19dc26);}return _0x1eec45[_0x3a8e('0x22')]();};}function saveUpdates(_0x461e3c,_0x447f06){return function(_0x233fb0){if(_0x233fb0){return _0x233fb0[_0x3a8e('0x23')](_0x461e3c)['then'](function(_0x16cb13){return _0x16cb13;});}return null;};}function removeEntity(_0xf0069e,_0x26856c){return function(_0x44d252){if(_0x44d252){return _0x44d252[_0x3a8e('0x24')]()[_0x3a8e('0x25')](function(){_0xf0069e['status'](0xcc)[_0x3a8e('0x18')]();});}};}function handleEntityNotFound(_0x4535d5,_0x51c292){return function(_0x48d2b3){if(!_0x48d2b3){_0x4535d5[_0x3a8e('0x16')](0x194);}return _0x48d2b3;};}function handleError(_0x50b928,_0x1c695f){_0x1c695f=_0x1c695f||0x1f4;return function(_0x3ee2b0){logger['error'](_0x3ee2b0[_0x3a8e('0x26')]);if(_0x3ee2b0[_0x3a8e('0x27')]){delete _0x3ee2b0[_0x3a8e('0x27')];}_0x50b928[_0x3a8e('0x17')](_0x1c695f)[_0x3a8e('0x28')](_0x3ee2b0);};}exports[_0x3a8e('0x29')]=function(_0x8a53cf,_0x4d9f0b){var _0x252a15={},_0x469030={},_0x21e379={'count':0x0,'rows':[]};var _0x143968=_['map'](db[_0x3a8e('0x2a')][_0x3a8e('0x2b')],function(_0x19a116){return{'name':_0x19a116[_0x3a8e('0x2c')],'type':_0x19a116[_0x3a8e('0x2d')]['key']};});_0x469030['model']=_[_0x3a8e('0x2e')](_0x143968,_0x3a8e('0x27'));_0x469030[_0x3a8e('0x2f')]=_[_0x3a8e('0x30')](_0x8a53cf[_0x3a8e('0x2f')]);_0x469030[_0x3a8e('0x31')]=_[_0x3a8e('0x32')](_0x469030[_0x3a8e('0x33')],_0x469030[_0x3a8e('0x2f')]);_0x252a15['attributes']=_[_0x3a8e('0x32')](_0x469030[_0x3a8e('0x33')],qs[_0x3a8e('0x34')](_0x8a53cf[_0x3a8e('0x2f')]['fields']));_0x252a15[_0x3a8e('0x35')]=_0x252a15[_0x3a8e('0x35')][_0x3a8e('0x36')]?_0x252a15['attributes']:_0x469030[_0x3a8e('0x33')];if(!_0x8a53cf[_0x3a8e('0x2f')][_0x3a8e('0x37')](_0x3a8e('0x38'))){_0x252a15['limit']=qs[_0x3a8e('0x1d')](_0x8a53cf['query']['limit']);_0x252a15['offset']=qs[_0x3a8e('0x1a')](_0x8a53cf[_0x3a8e('0x2f')][_0x3a8e('0x1a')]);}_0x252a15[_0x3a8e('0x39')]=qs[_0x3a8e('0x3a')](_0x8a53cf[_0x3a8e('0x2f')]['sort']);_0x252a15[_0x3a8e('0x3b')]=qs['filters'](_['pick'](_0x8a53cf['query'],_0x469030[_0x3a8e('0x31')]),_0x143968);if(_0x8a53cf[_0x3a8e('0x2f')][_0x3a8e('0x3c')]){_0x252a15[_0x3a8e('0x3b')]=_['merge'](_0x252a15['where'],{'$or':_[_0x3a8e('0x2e')](_0x143968,function(_0x3c1125){if(_0x3c1125['type']!==_0x3a8e('0x3d')){var _0x5067da={};_0x5067da[_0x3c1125[_0x3a8e('0x27')]]={'$like':'%'+_0x8a53cf[_0x3a8e('0x2f')][_0x3a8e('0x3c')]+'%'};return _0x5067da;}})});}_0x252a15=_[_0x3a8e('0x3e')]({},_0x252a15,_0x8a53cf[_0x3a8e('0x3f')]);var _0x2e39c2={'where':_0x252a15[_0x3a8e('0x3b')]};return db['JscriptyQuestionReport'][_0x3a8e('0x1c')](_0x2e39c2)['then'](function(_0x405fe1){_0x21e379['count']=_0x405fe1;if(_0x8a53cf[_0x3a8e('0x2f')]['includeAll']){_0x252a15[_0x3a8e('0x40')]=[{'all':!![]}];}return db[_0x3a8e('0x2a')][_0x3a8e('0x41')](_0x252a15);})[_0x3a8e('0x25')](function(_0x3bca67){_0x21e379[_0x3a8e('0x42')]=_0x3bca67;return _0x21e379;})['then'](respondWithFilteredResult(_0x4d9f0b,_0x252a15))['catch'](handleError(_0x4d9f0b,null));};exports[_0x3a8e('0x43')]=function(_0x3ab605,_0x3f621d){var _0x31a307={'raw':!![],'where':{'id':_0x3ab605[_0x3a8e('0x44')]['id']}},_0x1c30cc={};_0x1c30cc['model']=_[_0x3a8e('0x30')](db[_0x3a8e('0x2a')][_0x3a8e('0x2b')]);_0x1c30cc['query']=_[_0x3a8e('0x30')](_0x3ab605[_0x3a8e('0x2f')]);_0x1c30cc[_0x3a8e('0x31')]=_[_0x3a8e('0x32')](_0x1c30cc[_0x3a8e('0x33')],_0x1c30cc['query']);_0x31a307[_0x3a8e('0x35')]=_[_0x3a8e('0x32')](_0x1c30cc[_0x3a8e('0x33')],qs['fields'](_0x3ab605[_0x3a8e('0x2f')]['fields']));_0x31a307[_0x3a8e('0x35')]=_0x31a307[_0x3a8e('0x35')]['length']?_0x31a307[_0x3a8e('0x35')]:_0x1c30cc['model'];if(_0x3ab605[_0x3a8e('0x2f')][_0x3a8e('0x45')]){_0x31a307[_0x3a8e('0x40')]=[{'all':!![]}];}_0x31a307=_[_0x3a8e('0x3e')]({},_0x31a307,_0x3ab605['options']);return db[_0x3a8e('0x2a')][_0x3a8e('0x46')](_0x31a307)[_0x3a8e('0x25')](handleEntityNotFound(_0x3f621d,null))[_0x3a8e('0x25')](respondWithResult(_0x3f621d,null))['catch'](handleError(_0x3f621d,null));};exports['create']=function(_0x1e8a56,_0x38e200){return db[_0x3a8e('0x2a')][_0x3a8e('0x47')](_0x1e8a56[_0x3a8e('0x48')],{})[_0x3a8e('0x25')](respondWithResult(_0x38e200,0xc9))['catch'](handleError(_0x38e200,null));};exports['update']=function(_0x15cb84,_0x57258c){if(_0x15cb84[_0x3a8e('0x48')]['id']){delete _0x15cb84['body']['id'];}return db[_0x3a8e('0x2a')][_0x3a8e('0x46')]({'where':{'id':_0x15cb84['params']['id']}})[_0x3a8e('0x25')](handleEntityNotFound(_0x57258c,null))[_0x3a8e('0x25')](saveUpdates(_0x15cb84['body'],null))[_0x3a8e('0x25')](respondWithResult(_0x57258c,null))[_0x3a8e('0x49')](handleError(_0x57258c,null));};exports[_0x3a8e('0x24')]=function(_0xe05b45,_0x825087){return db[_0x3a8e('0x2a')][_0x3a8e('0x46')]({'where':{'id':_0xe05b45['params']['id']}})[_0x3a8e('0x25')](handleEntityNotFound(_0x825087,null))[_0x3a8e('0x25')](removeEntity(_0x825087,null))[_0x3a8e('0x49')](handleError(_0x825087,null));};exports['describe']=function(_0xcb908d,_0xff51d3){return db[_0x3a8e('0x2a')][_0x3a8e('0x4a')]()[_0x3a8e('0x25')](respondWithResult(_0xff51d3,null))[_0x3a8e('0x49')](handleError(_0xff51d3,null));}; \ No newline at end of file +var _0xea88=['sendStatus','status','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x55f98b,_0xeee6f7){var _0x5e70dc=function(_0x3b14c8){while(--_0x3b14c8){_0x55f98b['push'](_0x55f98b['shift']());}};_0x5e70dc(++_0xeee6f7);}(_0xea88,0xcc));var _0x8ea8=function(_0x18a078,_0x59c95e){_0x18a078=_0x18a078-0x0;var _0x370003=_0xea88[_0x18a078];return _0x370003;};'use strict';var emlformat=require(_0x8ea8('0x0'));var rimraf=require(_0x8ea8('0x1'));var zipdir=require(_0x8ea8('0x2'));var jsonpatch=require(_0x8ea8('0x3'));var rp=require(_0x8ea8('0x4'));var moment=require(_0x8ea8('0x5'));var BPromise=require(_0x8ea8('0x6'));var Mustache=require(_0x8ea8('0x7'));var util=require('util');var path=require(_0x8ea8('0x8'));var sox=require(_0x8ea8('0x9'));var csv=require('to-csv');var ejs=require(_0x8ea8('0xa'));var fs=require('fs');var fs_extra=require(_0x8ea8('0xb'));var _=require(_0x8ea8('0xc'));var squel=require(_0x8ea8('0xd'));var crypto=require('crypto');var jsforce=require(_0x8ea8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8ea8('0xf'));var querystring=require('querystring');var Papa=require(_0x8ea8('0x10'));var Redis=require(_0x8ea8('0x11'));var authService=require(_0x8ea8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ea8('0x13'))(_0x8ea8('0x14'));var utils=require('../../config/utils');var config=require(_0x8ea8('0x15'));var licenseUtil=require(_0x8ea8('0x16'));var db=require(_0x8ea8('0x17'))['db'];function respondWithStatusCode(_0x304f27,_0x16564b){_0x16564b=_0x16564b||0xcc;return function(_0x12debc){if(_0x12debc){return _0x304f27[_0x8ea8('0x18')](_0x16564b);}return _0x304f27[_0x8ea8('0x19')](_0x16564b)['end']();};}function respondWithResult(_0x21ccf8,_0x426564){_0x426564=_0x426564||0xc8;return function(_0xa35ac2){if(_0xa35ac2){return _0x21ccf8[_0x8ea8('0x19')](_0x426564)['json'](_0xa35ac2);}};}function respondWithFilteredResult(_0x4a136a,_0x4449b9){return function(_0x5098f3){if(_0x5098f3){var _0xf4d377=typeof _0x4449b9[_0x8ea8('0x1a')]===_0x8ea8('0x1b')&&typeof _0x4449b9['limit']===_0x8ea8('0x1b');var _0x1d9938=_0x5098f3[_0x8ea8('0x1c')];var _0x29de8b=_0xf4d377?0x0:_0x4449b9[_0x8ea8('0x1a')];var _0x2bce5d=_0xf4d377?_0x5098f3['count']:_0x4449b9[_0x8ea8('0x1a')]+_0x4449b9[_0x8ea8('0x1d')];var _0x539fec;if(_0x2bce5d>=_0x1d9938){_0x2bce5d=_0x1d9938;_0x539fec=0xc8;}else{_0x539fec=0xce;}_0x4a136a[_0x8ea8('0x19')](_0x539fec);return _0x4a136a[_0x8ea8('0x1e')]('Content-Range',_0x29de8b+'-'+_0x2bce5d+'/'+_0x1d9938)['json'](_0x5098f3);}return null;};}function patchUpdates(_0xc83f0b){return function(_0x2d20ae){try{jsonpatch[_0x8ea8('0x1f')](_0x2d20ae,_0xc83f0b,!![]);}catch(_0x5d4411){return BPromise[_0x8ea8('0x20')](_0x5d4411);}return _0x2d20ae[_0x8ea8('0x21')]();};}function saveUpdates(_0x2d1ec0,_0x13d617){return function(_0x3b56f1){if(_0x3b56f1){return _0x3b56f1[_0x8ea8('0x22')](_0x2d1ec0)[_0x8ea8('0x23')](function(_0x482669){return _0x482669;});}return null;};}function removeEntity(_0x5ec889,_0x3d422c){return function(_0x2aceec){if(_0x2aceec){return _0x2aceec[_0x8ea8('0x24')]()[_0x8ea8('0x23')](function(){_0x5ec889['status'](0xcc)[_0x8ea8('0x25')]();});}};}function handleEntityNotFound(_0x534529,_0x39f87b){return function(_0x2d1b2d){if(!_0x2d1b2d){_0x534529[_0x8ea8('0x18')](0x194);}return _0x2d1b2d;};}function handleError(_0xdbada7,_0x2fed6d){_0x2fed6d=_0x2fed6d||0x1f4;return function(_0x68c2d2){logger[_0x8ea8('0x26')](_0x68c2d2[_0x8ea8('0x27')]);if(_0x68c2d2['name']){delete _0x68c2d2[_0x8ea8('0x28')];}_0xdbada7[_0x8ea8('0x19')](_0x2fed6d)[_0x8ea8('0x29')](_0x68c2d2);};}exports[_0x8ea8('0x2a')]=function(_0x743616,_0x374df7){var _0x308a5e={},_0x277a4a={},_0x4b3ee7={'count':0x0,'rows':[]};var _0x407ef5=_[_0x8ea8('0x2b')](db[_0x8ea8('0x2c')]['rawAttributes'],function(_0x36aa78){return{'name':_0x36aa78[_0x8ea8('0x2d')],'type':_0x36aa78[_0x8ea8('0x2e')][_0x8ea8('0x2f')]};});_0x277a4a['model']=_[_0x8ea8('0x2b')](_0x407ef5,_0x8ea8('0x28'));_0x277a4a[_0x8ea8('0x30')]=_[_0x8ea8('0x31')](_0x743616['query']);_0x277a4a['filters']=_[_0x8ea8('0x32')](_0x277a4a['model'],_0x277a4a[_0x8ea8('0x30')]);_0x308a5e[_0x8ea8('0x33')]=_[_0x8ea8('0x32')](_0x277a4a[_0x8ea8('0x34')],qs[_0x8ea8('0x35')](_0x743616['query'][_0x8ea8('0x35')]));_0x308a5e[_0x8ea8('0x33')]=_0x308a5e[_0x8ea8('0x33')][_0x8ea8('0x36')]?_0x308a5e[_0x8ea8('0x33')]:_0x277a4a['model'];if(!_0x743616[_0x8ea8('0x30')]['hasOwnProperty'](_0x8ea8('0x37'))){_0x308a5e['limit']=qs[_0x8ea8('0x1d')](_0x743616['query'][_0x8ea8('0x1d')]);_0x308a5e[_0x8ea8('0x1a')]=qs['offset'](_0x743616[_0x8ea8('0x30')][_0x8ea8('0x1a')]);}_0x308a5e[_0x8ea8('0x38')]=qs['sort'](_0x743616['query'][_0x8ea8('0x39')]);_0x308a5e[_0x8ea8('0x3a')]=qs[_0x8ea8('0x3b')](_['pick'](_0x743616['query'],_0x277a4a[_0x8ea8('0x3b')]),_0x407ef5);if(_0x743616[_0x8ea8('0x30')][_0x8ea8('0x3c')]){_0x308a5e[_0x8ea8('0x3a')]=_[_0x8ea8('0x3d')](_0x308a5e[_0x8ea8('0x3a')],{'$or':_[_0x8ea8('0x2b')](_0x407ef5,function(_0x3f6700){if(_0x3f6700[_0x8ea8('0x2e')]!==_0x8ea8('0x3e')){var _0x139d38={};_0x139d38[_0x3f6700[_0x8ea8('0x28')]]={'$like':'%'+_0x743616[_0x8ea8('0x30')][_0x8ea8('0x3c')]+'%'};return _0x139d38;}})});}_0x308a5e=_[_0x8ea8('0x3d')]({},_0x308a5e,_0x743616[_0x8ea8('0x3f')]);var _0x4a0b7a={'where':_0x308a5e[_0x8ea8('0x3a')]};return db['JscriptyQuestionReport']['count'](_0x4a0b7a)['then'](function(_0x5e2447){_0x4b3ee7['count']=_0x5e2447;if(_0x743616[_0x8ea8('0x30')][_0x8ea8('0x40')]){_0x308a5e[_0x8ea8('0x41')]=[{'all':!![]}];}return db[_0x8ea8('0x2c')][_0x8ea8('0x42')](_0x308a5e);})[_0x8ea8('0x23')](function(_0x49fa31){_0x4b3ee7[_0x8ea8('0x43')]=_0x49fa31;return _0x4b3ee7;})[_0x8ea8('0x23')](respondWithFilteredResult(_0x374df7,_0x308a5e))[_0x8ea8('0x44')](handleError(_0x374df7,null));};exports[_0x8ea8('0x45')]=function(_0x5253ce,_0x55d713){var _0x58ee44={'raw':!![],'where':{'id':_0x5253ce[_0x8ea8('0x46')]['id']}},_0x3a7125={};_0x3a7125['model']=_[_0x8ea8('0x31')](db[_0x8ea8('0x2c')][_0x8ea8('0x47')]);_0x3a7125['query']=_[_0x8ea8('0x31')](_0x5253ce[_0x8ea8('0x30')]);_0x3a7125[_0x8ea8('0x3b')]=_[_0x8ea8('0x32')](_0x3a7125[_0x8ea8('0x34')],_0x3a7125[_0x8ea8('0x30')]);_0x58ee44[_0x8ea8('0x33')]=_['intersection'](_0x3a7125[_0x8ea8('0x34')],qs[_0x8ea8('0x35')](_0x5253ce[_0x8ea8('0x30')][_0x8ea8('0x35')]));_0x58ee44[_0x8ea8('0x33')]=_0x58ee44[_0x8ea8('0x33')][_0x8ea8('0x36')]?_0x58ee44['attributes']:_0x3a7125[_0x8ea8('0x34')];if(_0x5253ce['query'][_0x8ea8('0x40')]){_0x58ee44[_0x8ea8('0x41')]=[{'all':!![]}];}_0x58ee44=_[_0x8ea8('0x3d')]({},_0x58ee44,_0x5253ce[_0x8ea8('0x3f')]);return db[_0x8ea8('0x2c')][_0x8ea8('0x48')](_0x58ee44)[_0x8ea8('0x23')](handleEntityNotFound(_0x55d713,null))[_0x8ea8('0x23')](respondWithResult(_0x55d713,null))['catch'](handleError(_0x55d713,null));};exports['create']=function(_0x3a761,_0x543ec4){return db[_0x8ea8('0x2c')][_0x8ea8('0x49')](_0x3a761[_0x8ea8('0x4a')],{})[_0x8ea8('0x23')](respondWithResult(_0x543ec4,0xc9))[_0x8ea8('0x44')](handleError(_0x543ec4,null));};exports['update']=function(_0x1adc79,_0x24a0da){if(_0x1adc79[_0x8ea8('0x4a')]['id']){delete _0x1adc79[_0x8ea8('0x4a')]['id'];}return db[_0x8ea8('0x2c')]['find']({'where':{'id':_0x1adc79[_0x8ea8('0x46')]['id']}})[_0x8ea8('0x23')](handleEntityNotFound(_0x24a0da,null))[_0x8ea8('0x23')](saveUpdates(_0x1adc79[_0x8ea8('0x4a')],null))[_0x8ea8('0x23')](respondWithResult(_0x24a0da,null))[_0x8ea8('0x44')](handleError(_0x24a0da,null));};exports[_0x8ea8('0x24')]=function(_0xfc54d2,_0x3994a0){return db[_0x8ea8('0x2c')][_0x8ea8('0x48')]({'where':{'id':_0xfc54d2[_0x8ea8('0x46')]['id']}})[_0x8ea8('0x23')](handleEntityNotFound(_0x3994a0,null))['then'](removeEntity(_0x3994a0,null))['catch'](handleError(_0x3994a0,null));};exports[_0x8ea8('0x4b')]=function(_0x4e4da1,_0x78dc56){return db[_0x8ea8('0x2c')]['describe']()[_0x8ea8('0x23')](respondWithResult(_0x78dc56,null))[_0x8ea8('0x44')](handleError(_0x78dc56,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 839c9b9..f910f7c 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae9b=['define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xae9b,0x19b));var _0xbae9=function(_0x2cde7a,_0x19fd16){_0x2cde7a=_0x2cde7a-0x0;var _0x408f85=_0xae9b[_0x2cde7a];return _0x408f85;};'use strict';var _=require('lodash');var util=require(_0xbae9('0x0'));var logger=require(_0xbae9('0x1'))('api');var moment=require(_0xbae9('0x2'));var BPromise=require(_0xbae9('0x3'));var rp=require(_0xbae9('0x4'));var fs=require('fs');var path=require(_0xbae9('0x5'));var rimraf=require('rimraf');var config=require(_0xbae9('0x6'));var attributes=require(_0xbae9('0x7'));module[_0xbae9('0x8')]=function(_0x51c7c4,_0x4129d){return _0x51c7c4[_0xbae9('0x9')](_0xbae9('0xa'),attributes,{'tableName':_0xbae9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ecb=['api','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0x6ecb,0x82));var _0xb6ec=function(_0x2afb44,_0x249a57){_0x2afb44=_0x2afb44-0x0;var _0x15ccc2=_0x6ecb[_0x2afb44];return _0x15ccc2;};'use strict';var _=require('lodash');var util=require(_0xb6ec('0x0'));var logger=require(_0xb6ec('0x1'))(_0xb6ec('0x2'));var moment=require('moment');var BPromise=require(_0xb6ec('0x3'));var rp=require(_0xb6ec('0x4'));var fs=require('fs');var path=require(_0xb6ec('0x5'));var rimraf=require('rimraf');var config=require(_0xb6ec('0x6'));var attributes=require(_0xb6ec('0x7'));module[_0xb6ec('0x8')]=function(_0xd5d8a,_0x1160e2){return _0xd5d8a[_0xb6ec('0x9')](_0xb6ec('0xa'),attributes,{'tableName':_0xb6ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 9314814..e19ba64 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58bf=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x58bf,0x8b));var _0xf58b=function(_0x30070e,_0x548410){_0x30070e=_0x30070e-0x0;var _0x459153=_0x58bf[_0x30070e];return _0x459153;};'use strict';var _=require('lodash');var util=require(_0xf58b('0x0'));var moment=require(_0xf58b('0x1'));var BPromise=require(_0xf58b('0x2'));var rs=require(_0xf58b('0x3'));var fs=require('fs');var Redis=require(_0xf58b('0x4'));var db=require(_0xf58b('0x5'))['db'];var utils=require(_0xf58b('0x6'));var logger=require(_0xf58b('0x7'))(_0xf58b('0x8'));var config=require(_0xf58b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf58b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25e86d,_0x987117,_0xa84164){return new BPromise(function(_0x334a55,_0x2b8363){return client['request'](_0x25e86d,_0xa84164)[_0xf58b('0xb')](function(_0x453965){logger[_0xf58b('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x987117,_0xf58b('0xd'));logger[_0xf58b('0xe')](_0xf58b('0xf'),_0x987117,'request\x20sent',JSON[_0xf58b('0x10')](_0x453965));if(_0x453965[_0xf58b('0x11')]){if(_0x453965[_0xf58b('0x11')][_0xf58b('0x12')]===0x1f4){logger['error'](_0xf58b('0x13'),_0x987117,_0x453965['error'][_0xf58b('0x14')]);return _0x2b8363(_0x453965['error'][_0xf58b('0x14')]);}logger[_0xf58b('0x11')](_0xf58b('0x13'),_0x987117,_0x453965[_0xf58b('0x11')][_0xf58b('0x14')]);return _0x334a55(_0x453965['error'][_0xf58b('0x14')]);}else{logger['info'](_0xf58b('0x13'),_0x987117,_0xf58b('0xd'));_0x334a55(_0x453965[_0xf58b('0x15')]['message']);}})[_0xf58b('0x16')](function(_0x3db506){logger[_0xf58b('0x11')](_0xf58b('0x13'),_0x987117,_0x3db506);_0x2b8363(_0x3db506);});});} \ No newline at end of file +var _0x156f=['code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x38ab87,_0x48bb6e){var _0x45db56=function(_0x1f9e35){while(--_0x1f9e35){_0x38ab87['push'](_0x38ab87['shift']());}};_0x45db56(++_0x48bb6e);}(_0x156f,0x1a6));var _0xf156=function(_0x495935,_0x295e5b){_0x495935=_0x495935-0x0;var _0x6172ae=_0x156f[_0x495935];return _0x6172ae;};'use strict';var _=require(_0xf156('0x0'));var util=require('util');var moment=require(_0xf156('0x1'));var BPromise=require(_0xf156('0x2'));var rs=require(_0xf156('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf156('0x4'));var logger=require(_0xf156('0x5'))(_0xf156('0x6'));var config=require('../../config/environment');var jayson=require(_0xf156('0x7'));var client=jayson[_0xf156('0x8')][_0xf156('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x407bb7,_0x48df71,_0x3cf24b){return new BPromise(function(_0x31d778,_0x3f15aa){return client[_0xf156('0xa')](_0x407bb7,_0x3cf24b)['then'](function(_0x58224e){logger[_0xf156('0xb')](_0xf156('0xc'),_0x48df71,_0xf156('0xd'));logger[_0xf156('0xe')](_0xf156('0xf'),_0x48df71,_0xf156('0xd'),JSON[_0xf156('0x10')](_0x58224e));if(_0x58224e[_0xf156('0x11')]){if(_0x58224e['error'][_0xf156('0x12')]===0x1f4){logger[_0xf156('0x11')](_0xf156('0xc'),_0x48df71,_0x58224e[_0xf156('0x11')][_0xf156('0x13')]);return _0x3f15aa(_0x58224e[_0xf156('0x11')][_0xf156('0x13')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x48df71,_0x58224e[_0xf156('0x11')][_0xf156('0x13')]);return _0x31d778(_0x58224e[_0xf156('0x11')][_0xf156('0x13')]);}else{logger['info'](_0xf156('0xc'),_0x48df71,_0xf156('0xd'));_0x31d778(_0x58224e[_0xf156('0x14')][_0xf156('0x13')]);}})[_0xf156('0x15')](function(_0x405385){logger[_0xf156('0x11')](_0xf156('0xc'),_0x48df71,_0x405385);_0x3f15aa(_0x405385);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 2a3e74f..4f1273e 100644 --- a/server/api/jscriptySessionReport/index.js +++ b/server/api/jscriptySessionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9acb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xc3b5ef,_0x300f79){var _0x3d13bc=function(_0xcd7632){while(--_0xcd7632){_0xc3b5ef['push'](_0xc3b5ef['shift']());}};_0x3d13bc(++_0x300f79);}(_0x9acb,0xdb));var _0xb9ac=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x9acb[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0xb9ac('0x0'));var util=require(_0xb9ac('0x1'));var path=require(_0xb9ac('0x2'));var timeout=require(_0xb9ac('0x3'));var express=require(_0xb9ac('0x4'));var router=express[_0xb9ac('0x5')]();var fs_extra=require(_0xb9ac('0x6'));var auth=require(_0xb9ac('0x7'));var interaction=require(_0xb9ac('0x8'));var config=require(_0xb9ac('0x9'));var controller=require(_0xb9ac('0xa'));router[_0xb9ac('0xb')]('/',auth[_0xb9ac('0xc')](),controller[_0xb9ac('0xd')]);router['get'](_0xb9ac('0xe'),auth[_0xb9ac('0xc')](),controller[_0xb9ac('0xf')]);router['get'](_0xb9ac('0x10'),auth[_0xb9ac('0xc')](),controller[_0xb9ac('0x11')]);router[_0xb9ac('0xb')](_0xb9ac('0x12'),auth[_0xb9ac('0xc')](),controller['getQuestions']);router[_0xb9ac('0x13')]('/',auth['isAuthenticated'](),controller[_0xb9ac('0x14')]);router[_0xb9ac('0x15')](_0xb9ac('0x10'),auth[_0xb9ac('0xc')](),controller[_0xb9ac('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb9ac('0x17')]);module[_0xb9ac('0x18')]=router; \ No newline at end of file +var _0xf25d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/questions','getQuestions','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xf25d,0x6c));var _0xdf25=function(_0x9aca96,_0x497a2a){_0x9aca96=_0x9aca96-0x0;var _0x2d64a5=_0xf25d[_0x9aca96];return _0x2d64a5;};'use strict';var multer=require(_0xdf25('0x0'));var util=require(_0xdf25('0x1'));var path=require(_0xdf25('0x2'));var timeout=require(_0xdf25('0x3'));var express=require(_0xdf25('0x4'));var router=express[_0xdf25('0x5')]();var fs_extra=require(_0xdf25('0x6'));var auth=require(_0xdf25('0x7'));var interaction=require(_0xdf25('0x8'));var config=require(_0xdf25('0x9'));var controller=require(_0xdf25('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xdf25('0xb')]);router[_0xdf25('0xc')](_0xdf25('0xd'),auth[_0xdf25('0xe')](),controller[_0xdf25('0xf')]);router[_0xdf25('0xc')](_0xdf25('0x10'),auth['isAuthenticated'](),controller[_0xdf25('0x11')]);router['get'](_0xdf25('0x12'),auth['isAuthenticated'](),controller[_0xdf25('0x13')]);router['post']('/',auth[_0xdf25('0xe')](),controller[_0xdf25('0x14')]);router[_0xdf25('0x15')](_0xdf25('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xdf25('0xe')](),controller[_0xdf25('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d58db72..d57b5d8 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba0e=['STRING','BOOLEAN','moment','exports','DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2a6153,_0x1ac255){var _0x3ca986=function(_0x415818){while(--_0x415818){_0x2a6153['push'](_0x2a6153['shift']());}};_0x3ca986(++_0x1ac255);}(_0xba0e,0x1b2));var _0xeba0=function(_0x303aad,_0x564d03){_0x303aad=_0x303aad-0x0;var _0x9a7037=_0xba0e[_0x303aad];return _0x9a7037;};'use strict';var moment=require(_0xeba0('0x0'));var Sequelize=require('sequelize');module[_0xeba0('0x1')]={'starttime':{'type':Sequelize[_0xeba0('0x2')],'set':function(_0x37fad0){this[_0xeba0('0x3')](_0xeba0('0x4'),_0x37fad0);this[_0xeba0('0x3')](_0xeba0('0x5'),moment()['format'](_0xeba0('0x6')));}},'endtime':{'type':Sequelize[_0xeba0('0x2')]},'membername':{'type':Sequelize[_0xeba0('0x7')]},'projectname':{'type':Sequelize[_0xeba0('0x7')]},'queue':{'type':Sequelize[_0xeba0('0x7')]},'uniqueid':{'type':Sequelize[_0xeba0('0x7')]},'calleridname':{'type':Sequelize[_0xeba0('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xeba0('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xe48e=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','setDataValue','starttime'];(function(_0x51f5f7,_0x4e1492){var _0x6afaa=function(_0x298234){while(--_0x298234){_0x51f5f7['push'](_0x51f5f7['shift']());}};_0x6afaa(++_0x4e1492);}(_0xe48e,0x109));var _0xee48=function(_0x148fe2,_0x14bab4){_0x148fe2=_0x148fe2-0x0;var _0x321d8e=_0xe48e[_0x148fe2];return _0x321d8e;};'use strict';var moment=require(_0xee48('0x0'));var Sequelize=require('sequelize');module[_0xee48('0x1')]={'starttime':{'type':Sequelize[_0xee48('0x2')],'set':function(_0x209af7){this[_0xee48('0x3')](_0xee48('0x4'),_0x209af7);this[_0xee48('0x3')](_0xee48('0x5'),moment()[_0xee48('0x6')](_0xee48('0x7')));}},'endtime':{'type':Sequelize[_0xee48('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xee48('0x8')]},'queue':{'type':Sequelize[_0xee48('0x8')]},'uniqueid':{'type':Sequelize[_0xee48('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xee48('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 5c7ce9a..432c320 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fa8=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','index','map','JscriptySessionReport','type','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','include','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x4b090c,_0x2afda0){var _0x312b68=function(_0x376be1){while(--_0x376be1){_0x4b090c['push'](_0x4b090c['shift']());}};_0x312b68(++_0x2afda0);}(_0x6fa8,0x166));var _0x86fa=function(_0xb58bc2,_0x3fff5f){_0xb58bc2=_0xb58bc2-0x0;var _0x3902d6=_0x6fa8[_0xb58bc2];return _0x3902d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86fa('0x0'));var zipdir=require(_0x86fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86fa('0x2'));var moment=require(_0x86fa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x86fa('0x4'));var util=require(_0x86fa('0x5'));var path=require(_0x86fa('0x6'));var sox=require(_0x86fa('0x7'));var csv=require(_0x86fa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86fa('0x9'));var _=require('lodash');var squel=require(_0x86fa('0xa'));var crypto=require(_0x86fa('0xb'));var jsforce=require(_0x86fa('0xc'));var deskjs=require(_0x86fa('0xd'));var toCsv=require(_0x86fa('0x8'));var querystring=require('querystring');var Papa=require(_0x86fa('0xe'));var Redis=require(_0x86fa('0xf'));var authService=require(_0x86fa('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x86fa('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x86fa('0x12'));var config=require(_0x86fa('0x13'));var licenseUtil=require(_0x86fa('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d51f2,_0x534b76){_0x534b76=_0x534b76||0xcc;return function(_0x46f43c){if(_0x46f43c){return _0x1d51f2[_0x86fa('0x15')](_0x534b76);}return _0x1d51f2[_0x86fa('0x16')](_0x534b76)[_0x86fa('0x17')]();};}function respondWithResult(_0x2a475a,_0x58ba18){_0x58ba18=_0x58ba18||0xc8;return function(_0x3f57d5){if(_0x3f57d5){return _0x2a475a[_0x86fa('0x16')](_0x58ba18)[_0x86fa('0x18')](_0x3f57d5);}};}function respondWithFilteredResult(_0x2d6caa,_0x2a8830){return function(_0x27f1ea){if(_0x27f1ea){var _0x645702=typeof _0x2a8830[_0x86fa('0x19')]===_0x86fa('0x1a')&&typeof _0x2a8830[_0x86fa('0x1b')]===_0x86fa('0x1a');var _0x49c5a5=_0x27f1ea[_0x86fa('0x1c')];var _0x4cca65=_0x645702?0x0:_0x2a8830[_0x86fa('0x19')];var _0x2352bd=_0x645702?_0x27f1ea['count']:_0x2a8830[_0x86fa('0x19')]+_0x2a8830[_0x86fa('0x1b')];var _0x5134d8;if(_0x2352bd>=_0x49c5a5){_0x2352bd=_0x49c5a5;_0x5134d8=0xc8;}else{_0x5134d8=0xce;}_0x2d6caa[_0x86fa('0x16')](_0x5134d8);return _0x2d6caa[_0x86fa('0x1d')](_0x86fa('0x1e'),_0x4cca65+'-'+_0x2352bd+'/'+_0x49c5a5)['json'](_0x27f1ea);}return null;};}function patchUpdates(_0x314f4e){return function(_0x1e3e7c){try{jsonpatch['apply'](_0x1e3e7c,_0x314f4e,!![]);}catch(_0xbe2a4f){return BPromise[_0x86fa('0x1f')](_0xbe2a4f);}return _0x1e3e7c['save']();};}function saveUpdates(_0xd1288b,_0x2cd672){return function(_0x1c8c28){if(_0x1c8c28){return _0x1c8c28[_0x86fa('0x20')](_0xd1288b)[_0x86fa('0x21')](function(_0x37f5ad){return _0x37f5ad;});}return null;};}function removeEntity(_0x15fac5,_0x2abad0){return function(_0x124d52){if(_0x124d52){return _0x124d52[_0x86fa('0x22')]()['then'](function(){_0x15fac5['status'](0xcc)[_0x86fa('0x17')]();});}};}function handleEntityNotFound(_0x1c2ec6,_0x4215cd){return function(_0x32ca24){if(!_0x32ca24){_0x1c2ec6[_0x86fa('0x15')](0x194);}return _0x32ca24;};}function handleError(_0x535952,_0xf5160c){_0xf5160c=_0xf5160c||0x1f4;return function(_0x241752){logger[_0x86fa('0x23')](_0x241752['stack']);if(_0x241752[_0x86fa('0x24')]){delete _0x241752[_0x86fa('0x24')];}_0x535952[_0x86fa('0x16')](_0xf5160c)['send'](_0x241752);};}exports[_0x86fa('0x25')]=function(_0x3e686a,_0x2aa92c){var _0x1397e8={},_0xcf7945={},_0x258ef9={'count':0x0,'rows':[]};var _0x5a2ecf=_[_0x86fa('0x26')](db[_0x86fa('0x27')]['rawAttributes'],function(_0x175bb6){return{'name':_0x175bb6['fieldName'],'type':_0x175bb6[_0x86fa('0x28')][_0x86fa('0x29')]};});_0xcf7945['model']=_[_0x86fa('0x26')](_0x5a2ecf,_0x86fa('0x24'));_0xcf7945[_0x86fa('0x2a')]=_['keys'](_0x3e686a[_0x86fa('0x2a')]);_0xcf7945[_0x86fa('0x2b')]=_['intersection'](_0xcf7945['model'],_0xcf7945[_0x86fa('0x2a')]);_0x1397e8[_0x86fa('0x2c')]=_[_0x86fa('0x2d')](_0xcf7945[_0x86fa('0x2e')],qs[_0x86fa('0x2f')](_0x3e686a[_0x86fa('0x2a')][_0x86fa('0x2f')]));_0x1397e8[_0x86fa('0x2c')]=_0x1397e8['attributes'][_0x86fa('0x30')]?_0x1397e8[_0x86fa('0x2c')]:_0xcf7945[_0x86fa('0x2e')];if(!_0x3e686a[_0x86fa('0x2a')][_0x86fa('0x31')](_0x86fa('0x32'))){_0x1397e8[_0x86fa('0x1b')]=qs[_0x86fa('0x1b')](_0x3e686a['query']['limit']);_0x1397e8[_0x86fa('0x19')]=qs[_0x86fa('0x19')](_0x3e686a[_0x86fa('0x2a')][_0x86fa('0x19')]);}_0x1397e8[_0x86fa('0x33')]=qs[_0x86fa('0x34')](_0x3e686a['query'][_0x86fa('0x34')]);_0x1397e8[_0x86fa('0x35')]=qs[_0x86fa('0x2b')](_[_0x86fa('0x36')](_0x3e686a[_0x86fa('0x2a')],_0xcf7945[_0x86fa('0x2b')]),_0x5a2ecf);if(_0x3e686a[_0x86fa('0x2a')]['filter']){_0x1397e8[_0x86fa('0x35')]=_[_0x86fa('0x37')](_0x1397e8[_0x86fa('0x35')],{'$or':_[_0x86fa('0x26')](_0x5a2ecf,function(_0x30ba0b){if(_0x30ba0b['type']!==_0x86fa('0x38')){var _0x8a894c={};_0x8a894c[_0x30ba0b[_0x86fa('0x24')]]={'$like':'%'+_0x3e686a['query'][_0x86fa('0x39')]+'%'};return _0x8a894c;}})});}_0x1397e8=_[_0x86fa('0x37')]({},_0x1397e8,_0x3e686a['options']);var _0x47ff2c={'where':_0x1397e8[_0x86fa('0x35')]};return db[_0x86fa('0x27')][_0x86fa('0x1c')](_0x47ff2c)[_0x86fa('0x21')](function(_0x127295){_0x258ef9[_0x86fa('0x1c')]=_0x127295;if(_0x3e686a['query']['includeAll']){_0x1397e8['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x86fa('0x3a')](_0x1397e8);})[_0x86fa('0x21')](function(_0x35ba03){_0x258ef9[_0x86fa('0x3b')]=_0x35ba03;return _0x258ef9;})[_0x86fa('0x21')](respondWithFilteredResult(_0x2aa92c,_0x1397e8))[_0x86fa('0x3c')](handleError(_0x2aa92c,null));};exports[_0x86fa('0x3d')]=function(_0x176c40,_0x227c4a){var _0x3e9a4d={'raw':!![],'where':{'id':_0x176c40[_0x86fa('0x3e')]['id']}},_0x49335c={};_0x49335c[_0x86fa('0x2e')]=_[_0x86fa('0x3f')](db[_0x86fa('0x27')][_0x86fa('0x40')]);_0x49335c['query']=_[_0x86fa('0x3f')](_0x176c40[_0x86fa('0x2a')]);_0x49335c['filters']=_['intersection'](_0x49335c['model'],_0x49335c['query']);_0x3e9a4d[_0x86fa('0x2c')]=_[_0x86fa('0x2d')](_0x49335c[_0x86fa('0x2e')],qs[_0x86fa('0x2f')](_0x176c40['query']['fields']));_0x3e9a4d['attributes']=_0x3e9a4d[_0x86fa('0x2c')][_0x86fa('0x30')]?_0x3e9a4d['attributes']:_0x49335c[_0x86fa('0x2e')];if(_0x176c40[_0x86fa('0x2a')][_0x86fa('0x41')]){_0x3e9a4d[_0x86fa('0x42')]=[{'all':!![]}];}_0x3e9a4d=_[_0x86fa('0x37')]({},_0x3e9a4d,_0x176c40[_0x86fa('0x43')]);return db[_0x86fa('0x27')][_0x86fa('0x44')](_0x3e9a4d)[_0x86fa('0x21')](handleEntityNotFound(_0x227c4a,null))[_0x86fa('0x21')](respondWithResult(_0x227c4a,null))['catch'](handleError(_0x227c4a,null));};exports[_0x86fa('0x45')]=function(_0x219d3d,_0x3eafa2){return db[_0x86fa('0x27')][_0x86fa('0x45')](_0x219d3d[_0x86fa('0x46')],{})[_0x86fa('0x21')](respondWithResult(_0x3eafa2,0xc9))[_0x86fa('0x3c')](handleError(_0x3eafa2,null));};exports['update']=function(_0xd43f13,_0x1ffb70){if(_0xd43f13[_0x86fa('0x46')]['id']){delete _0xd43f13[_0x86fa('0x46')]['id'];}return db[_0x86fa('0x27')][_0x86fa('0x44')]({'where':{'id':_0xd43f13[_0x86fa('0x3e')]['id']}})[_0x86fa('0x21')](handleEntityNotFound(_0x1ffb70,null))[_0x86fa('0x21')](saveUpdates(_0xd43f13[_0x86fa('0x46')],null))[_0x86fa('0x21')](respondWithResult(_0x1ffb70,null))[_0x86fa('0x3c')](handleError(_0x1ffb70,null));};exports[_0x86fa('0x22')]=function(_0x160e31,_0x55d5ee){return db[_0x86fa('0x27')]['find']({'where':{'id':_0x160e31['params']['id']}})[_0x86fa('0x21')](handleEntityNotFound(_0x55d5ee,null))[_0x86fa('0x21')](removeEntity(_0x55d5ee,null))[_0x86fa('0x3c')](handleError(_0x55d5ee,null));};exports[_0x86fa('0x47')]=function(_0x25861f,_0x157ec5){return db[_0x86fa('0x27')][_0x86fa('0x47')]()[_0x86fa('0x21')](respondWithResult(_0x157ec5,null))[_0x86fa('0x3c')](handleError(_0x157ec5,null));};exports[_0x86fa('0x48')]=function(_0xf0c4d7,_0x38cc9c,_0x161975){var _0x4cd788={'raw':!![],'where':{}};var _0x55201={};var _0x43821={'count':0x0,'rows':[]};return db[_0x86fa('0x27')][_0x86fa('0x49')]({'where':{'id':_0xf0c4d7[_0x86fa('0x3e')]['id']}})[_0x86fa('0x21')](handleEntityNotFound(_0x38cc9c,null))[_0x86fa('0x21')](function(_0x6fb48){if(_0x6fb48){_0x55201[_0x86fa('0x2e')]=_[_0x86fa('0x3f')](db[_0x86fa('0x4a')]['rawAttributes']);_0x55201[_0x86fa('0x2a')]=_['keys'](_0xf0c4d7[_0x86fa('0x2a')]);_0x55201['filters']=_[_0x86fa('0x2d')](_0x55201[_0x86fa('0x2e')],_0x55201[_0x86fa('0x2a')]);_0x4cd788[_0x86fa('0x2c')]=_[_0x86fa('0x2d')](_0x55201[_0x86fa('0x2e')],qs[_0x86fa('0x2f')](_0xf0c4d7[_0x86fa('0x2a')]['fields']));_0x4cd788[_0x86fa('0x2c')]=_0x4cd788['attributes'][_0x86fa('0x30')]?_0x4cd788['attributes']:_0x55201[_0x86fa('0x2e')];if(!_0xf0c4d7[_0x86fa('0x2a')][_0x86fa('0x31')](_0x86fa('0x32'))){_0x4cd788['limit']=qs[_0x86fa('0x1b')](_0xf0c4d7['query'][_0x86fa('0x1b')]);_0x4cd788[_0x86fa('0x19')]=qs[_0x86fa('0x19')](_0xf0c4d7[_0x86fa('0x2a')][_0x86fa('0x19')]);}_0x4cd788[_0x86fa('0x33')]=qs[_0x86fa('0x34')](_0xf0c4d7[_0x86fa('0x2a')][_0x86fa('0x34')]);_0x4cd788[_0x86fa('0x35')]=qs[_0x86fa('0x2b')](_[_0x86fa('0x36')](_0xf0c4d7[_0x86fa('0x2a')],_0x55201[_0x86fa('0x2b')]));_0x4cd788[_0x86fa('0x35')][_0x86fa('0x4b')]=_0x6fb48['id'];if(_0xf0c4d7['query']['filter']){_0x4cd788[_0x86fa('0x35')]=_['merge'](_0x4cd788['where'],{'$or':_[_0x86fa('0x26')](_0x4cd788[_0x86fa('0x2c')],function(_0x8f2dda){var _0x50c9d5={};_0x50c9d5[_0x8f2dda]={'$like':'%'+_0xf0c4d7[_0x86fa('0x2a')][_0x86fa('0x39')]+'%'};return _0x50c9d5;})});}_0x4cd788=_[_0x86fa('0x37')]({},_0x4cd788,_0xf0c4d7[_0x86fa('0x43')]);return db[_0x86fa('0x4a')]['count']({'where':_0x4cd788[_0x86fa('0x35')]})['then'](function(_0x30df96){_0x43821['count']=_0x30df96;if(_0xf0c4d7[_0x86fa('0x2a')]['includeAll']){_0x4cd788['include']=[{'all':!![]}];}return db[_0x86fa('0x4a')][_0x86fa('0x3a')](_0x4cd788);})[_0x86fa('0x21')](function(_0x2c668e){_0x43821[_0x86fa('0x3b')]=_0x2c668e;return _0x43821;});}})[_0x86fa('0x21')](respondWithFilteredResult(_0x38cc9c,_0x4cd788))[_0x86fa('0x3c')](handleError(_0x38cc9c,null));}; \ No newline at end of file +var _0x96f3=['options','include','rows','catch','show','includeAll','find','create','body','update','params','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','SessionId','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','then','destroy','error','stack','name','index','map','JscriptySessionReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x96f3,0x152));var _0x396f=function(_0x5d7444,_0x5331f1){_0x5d7444=_0x5d7444-0x0;var _0x34a7ae=_0x96f3[_0x5d7444];return _0x34a7ae;};'use strict';var emlformat=require(_0x396f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x396f('0x1'));var jsonpatch=require(_0x396f('0x2'));var rp=require(_0x396f('0x3'));var moment=require(_0x396f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x396f('0x5'));var util=require(_0x396f('0x6'));var path=require(_0x396f('0x7'));var sox=require(_0x396f('0x8'));var csv=require(_0x396f('0x9'));var ejs=require(_0x396f('0xa'));var fs=require('fs');var fs_extra=require(_0x396f('0xb'));var _=require('lodash');var squel=require(_0x396f('0xc'));var crypto=require(_0x396f('0xd'));var jsforce=require(_0x396f('0xe'));var deskjs=require(_0x396f('0xf'));var toCsv=require(_0x396f('0x9'));var querystring=require(_0x396f('0x10'));var Papa=require(_0x396f('0x11'));var Redis=require('ioredis');var authService=require(_0x396f('0x12'));var qs=require(_0x396f('0x13'));var as=require(_0x396f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x396f('0x15'))(_0x396f('0x16'));var utils=require(_0x396f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x396f('0x18'));var db=require(_0x396f('0x19'))['db'];function respondWithStatusCode(_0x1e0c1a,_0x58a79d){_0x58a79d=_0x58a79d||0xcc;return function(_0x20ccca){if(_0x20ccca){return _0x1e0c1a[_0x396f('0x1a')](_0x58a79d);}return _0x1e0c1a[_0x396f('0x1b')](_0x58a79d)[_0x396f('0x1c')]();};}function respondWithResult(_0x1db5f5,_0x293e47){_0x293e47=_0x293e47||0xc8;return function(_0x47cfb7){if(_0x47cfb7){return _0x1db5f5['status'](_0x293e47)[_0x396f('0x1d')](_0x47cfb7);}};}function respondWithFilteredResult(_0x34f20c,_0xc39fd){return function(_0x54382a){if(_0x54382a){var _0x195dce=typeof _0xc39fd[_0x396f('0x1e')]==='undefined'&&typeof _0xc39fd[_0x396f('0x1f')]==='undefined';var _0x59b7f5=_0x54382a[_0x396f('0x20')];var _0x5826ca=_0x195dce?0x0:_0xc39fd[_0x396f('0x1e')];var _0x22446a=_0x195dce?_0x54382a[_0x396f('0x20')]:_0xc39fd[_0x396f('0x1e')]+_0xc39fd['limit'];var _0x417196;if(_0x22446a>=_0x59b7f5){_0x22446a=_0x59b7f5;_0x417196=0xc8;}else{_0x417196=0xce;}_0x34f20c[_0x396f('0x1b')](_0x417196);return _0x34f20c[_0x396f('0x21')](_0x396f('0x22'),_0x5826ca+'-'+_0x22446a+'/'+_0x59b7f5)[_0x396f('0x1d')](_0x54382a);}return null;};}function patchUpdates(_0x1d7cdd){return function(_0x58ae76){try{jsonpatch['apply'](_0x58ae76,_0x1d7cdd,!![]);}catch(_0x1dac99){return BPromise[_0x396f('0x23')](_0x1dac99);}return _0x58ae76['save']();};}function saveUpdates(_0x1d7490,_0x9ee0e3){return function(_0x2da835){if(_0x2da835){return _0x2da835['update'](_0x1d7490)[_0x396f('0x24')](function(_0x5b7221){return _0x5b7221;});}return null;};}function removeEntity(_0x566af8,_0x1fc1f2){return function(_0x2db610){if(_0x2db610){return _0x2db610[_0x396f('0x25')]()[_0x396f('0x24')](function(){_0x566af8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4642e9,_0x40cb6d){return function(_0x2fe193){if(!_0x2fe193){_0x4642e9[_0x396f('0x1a')](0x194);}return _0x2fe193;};}function handleError(_0x1fbd5b,_0x3bc702){_0x3bc702=_0x3bc702||0x1f4;return function(_0x548589){logger[_0x396f('0x26')](_0x548589[_0x396f('0x27')]);if(_0x548589['name']){delete _0x548589[_0x396f('0x28')];}_0x1fbd5b[_0x396f('0x1b')](_0x3bc702)['send'](_0x548589);};}exports[_0x396f('0x29')]=function(_0x490fb8,_0x8fef4b){var _0x156719={},_0x23b520={},_0x475fbf={'count':0x0,'rows':[]};var _0x23f454=_[_0x396f('0x2a')](db[_0x396f('0x2b')]['rawAttributes'],function(_0x581a8b){return{'name':_0x581a8b['fieldName'],'type':_0x581a8b[_0x396f('0x2c')][_0x396f('0x2d')]};});_0x23b520[_0x396f('0x2e')]=_['map'](_0x23f454,_0x396f('0x28'));_0x23b520[_0x396f('0x2f')]=_[_0x396f('0x30')](_0x490fb8[_0x396f('0x2f')]);_0x23b520[_0x396f('0x31')]=_[_0x396f('0x32')](_0x23b520[_0x396f('0x2e')],_0x23b520[_0x396f('0x2f')]);_0x156719[_0x396f('0x33')]=_[_0x396f('0x32')](_0x23b520[_0x396f('0x2e')],qs[_0x396f('0x34')](_0x490fb8[_0x396f('0x2f')][_0x396f('0x34')]));_0x156719[_0x396f('0x33')]=_0x156719[_0x396f('0x33')][_0x396f('0x35')]?_0x156719['attributes']:_0x23b520[_0x396f('0x2e')];if(!_0x490fb8[_0x396f('0x2f')][_0x396f('0x36')](_0x396f('0x37'))){_0x156719[_0x396f('0x1f')]=qs[_0x396f('0x1f')](_0x490fb8[_0x396f('0x2f')][_0x396f('0x1f')]);_0x156719['offset']=qs[_0x396f('0x1e')](_0x490fb8['query']['offset']);}_0x156719[_0x396f('0x38')]=qs['sort'](_0x490fb8[_0x396f('0x2f')][_0x396f('0x39')]);_0x156719[_0x396f('0x3a')]=qs[_0x396f('0x31')](_['pick'](_0x490fb8[_0x396f('0x2f')],_0x23b520[_0x396f('0x31')]),_0x23f454);if(_0x490fb8[_0x396f('0x2f')][_0x396f('0x3b')]){_0x156719['where']=_[_0x396f('0x3c')](_0x156719[_0x396f('0x3a')],{'$or':_[_0x396f('0x2a')](_0x23f454,function(_0x900d59){if(_0x900d59['type']!==_0x396f('0x3d')){var _0x45bcd3={};_0x45bcd3[_0x900d59[_0x396f('0x28')]]={'$like':'%'+_0x490fb8[_0x396f('0x2f')][_0x396f('0x3b')]+'%'};return _0x45bcd3;}})});}_0x156719=_[_0x396f('0x3c')]({},_0x156719,_0x490fb8[_0x396f('0x3e')]);var _0x46fb35={'where':_0x156719[_0x396f('0x3a')]};return db[_0x396f('0x2b')][_0x396f('0x20')](_0x46fb35)['then'](function(_0x3a521a){_0x475fbf['count']=_0x3a521a;if(_0x490fb8[_0x396f('0x2f')]['includeAll']){_0x156719[_0x396f('0x3f')]=[{'all':!![]}];}return db[_0x396f('0x2b')]['findAll'](_0x156719);})[_0x396f('0x24')](function(_0x22548a){_0x475fbf[_0x396f('0x40')]=_0x22548a;return _0x475fbf;})['then'](respondWithFilteredResult(_0x8fef4b,_0x156719))[_0x396f('0x41')](handleError(_0x8fef4b,null));};exports[_0x396f('0x42')]=function(_0x31ab98,_0x56e3dc){var _0x259e32={'raw':!![],'where':{'id':_0x31ab98['params']['id']}},_0x5a8ee4={};_0x5a8ee4[_0x396f('0x2e')]=_[_0x396f('0x30')](db[_0x396f('0x2b')]['rawAttributes']);_0x5a8ee4['query']=_[_0x396f('0x30')](_0x31ab98[_0x396f('0x2f')]);_0x5a8ee4[_0x396f('0x31')]=_[_0x396f('0x32')](_0x5a8ee4[_0x396f('0x2e')],_0x5a8ee4[_0x396f('0x2f')]);_0x259e32['attributes']=_['intersection'](_0x5a8ee4[_0x396f('0x2e')],qs['fields'](_0x31ab98[_0x396f('0x2f')][_0x396f('0x34')]));_0x259e32[_0x396f('0x33')]=_0x259e32[_0x396f('0x33')]['length']?_0x259e32[_0x396f('0x33')]:_0x5a8ee4[_0x396f('0x2e')];if(_0x31ab98[_0x396f('0x2f')][_0x396f('0x43')]){_0x259e32[_0x396f('0x3f')]=[{'all':!![]}];}_0x259e32=_[_0x396f('0x3c')]({},_0x259e32,_0x31ab98[_0x396f('0x3e')]);return db[_0x396f('0x2b')][_0x396f('0x44')](_0x259e32)['then'](handleEntityNotFound(_0x56e3dc,null))[_0x396f('0x24')](respondWithResult(_0x56e3dc,null))['catch'](handleError(_0x56e3dc,null));};exports['create']=function(_0x2d4422,_0x2900e2){return db[_0x396f('0x2b')][_0x396f('0x45')](_0x2d4422[_0x396f('0x46')],{})[_0x396f('0x24')](respondWithResult(_0x2900e2,0xc9))[_0x396f('0x41')](handleError(_0x2900e2,null));};exports[_0x396f('0x47')]=function(_0x637f73,_0x5dc3b5){if(_0x637f73[_0x396f('0x46')]['id']){delete _0x637f73['body']['id'];}return db[_0x396f('0x2b')][_0x396f('0x44')]({'where':{'id':_0x637f73[_0x396f('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dc3b5,null))[_0x396f('0x24')](saveUpdates(_0x637f73['body'],null))[_0x396f('0x24')](respondWithResult(_0x5dc3b5,null))[_0x396f('0x41')](handleError(_0x5dc3b5,null));};exports[_0x396f('0x25')]=function(_0x4e5d14,_0x442e0d){return db[_0x396f('0x2b')]['find']({'where':{'id':_0x4e5d14[_0x396f('0x48')]['id']}})[_0x396f('0x24')](handleEntityNotFound(_0x442e0d,null))['then'](removeEntity(_0x442e0d,null))[_0x396f('0x41')](handleError(_0x442e0d,null));};exports[_0x396f('0x49')]=function(_0x484632,_0x452995){return db[_0x396f('0x2b')][_0x396f('0x49')]()[_0x396f('0x24')](respondWithResult(_0x452995,null))['catch'](handleError(_0x452995,null));};exports[_0x396f('0x4a')]=function(_0x9c168b,_0x716cff,_0x33d4ac){var _0x4bc0a7={'raw':!![],'where':{}};var _0x16d898={};var _0x1ae29f={'count':0x0,'rows':[]};return db[_0x396f('0x2b')][_0x396f('0x4b')]({'where':{'id':_0x9c168b[_0x396f('0x48')]['id']}})['then'](handleEntityNotFound(_0x716cff,null))['then'](function(_0x2a8c21){if(_0x2a8c21){_0x16d898[_0x396f('0x2e')]=_[_0x396f('0x30')](db[_0x396f('0x4c')][_0x396f('0x4d')]);_0x16d898[_0x396f('0x2f')]=_[_0x396f('0x30')](_0x9c168b[_0x396f('0x2f')]);_0x16d898[_0x396f('0x31')]=_['intersection'](_0x16d898['model'],_0x16d898[_0x396f('0x2f')]);_0x4bc0a7[_0x396f('0x33')]=_[_0x396f('0x32')](_0x16d898['model'],qs['fields'](_0x9c168b[_0x396f('0x2f')][_0x396f('0x34')]));_0x4bc0a7[_0x396f('0x33')]=_0x4bc0a7[_0x396f('0x33')][_0x396f('0x35')]?_0x4bc0a7[_0x396f('0x33')]:_0x16d898[_0x396f('0x2e')];if(!_0x9c168b['query'][_0x396f('0x36')](_0x396f('0x37'))){_0x4bc0a7['limit']=qs[_0x396f('0x1f')](_0x9c168b[_0x396f('0x2f')][_0x396f('0x1f')]);_0x4bc0a7['offset']=qs[_0x396f('0x1e')](_0x9c168b[_0x396f('0x2f')]['offset']);}_0x4bc0a7[_0x396f('0x38')]=qs[_0x396f('0x39')](_0x9c168b['query'][_0x396f('0x39')]);_0x4bc0a7['where']=qs[_0x396f('0x31')](_['pick'](_0x9c168b[_0x396f('0x2f')],_0x16d898['filters']));_0x4bc0a7[_0x396f('0x3a')][_0x396f('0x4e')]=_0x2a8c21['id'];if(_0x9c168b['query'][_0x396f('0x3b')]){_0x4bc0a7[_0x396f('0x3a')]=_[_0x396f('0x3c')](_0x4bc0a7['where'],{'$or':_[_0x396f('0x2a')](_0x4bc0a7['attributes'],function(_0x42abfa){var _0x4a5f2d={};_0x4a5f2d[_0x42abfa]={'$like':'%'+_0x9c168b[_0x396f('0x2f')][_0x396f('0x3b')]+'%'};return _0x4a5f2d;})});}_0x4bc0a7=_[_0x396f('0x3c')]({},_0x4bc0a7,_0x9c168b[_0x396f('0x3e')]);return db[_0x396f('0x4c')][_0x396f('0x20')]({'where':_0x4bc0a7['where']})[_0x396f('0x24')](function(_0x6c225f){_0x1ae29f[_0x396f('0x20')]=_0x6c225f;if(_0x9c168b['query'][_0x396f('0x43')]){_0x4bc0a7[_0x396f('0x3f')]=[{'all':!![]}];}return db[_0x396f('0x4c')][_0x396f('0x4f')](_0x4bc0a7);})[_0x396f('0x24')](function(_0x4b3af1){_0x1ae29f[_0x396f('0x40')]=_0x4b3af1;return _0x1ae29f;});}})[_0x396f('0x24')](respondWithFilteredResult(_0x716cff,_0x4bc0a7))[_0x396f('0x41')](handleError(_0x716cff,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 411f30c..21f8c22 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fd4=['rimraf','exports','define','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fd4,0x16c));var _0x49fd=function(_0x525ef9,_0x12b1c2){_0x525ef9=_0x525ef9-0x0;var _0x5561fb=_0x9fd4[_0x525ef9];return _0x5561fb;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var logger=require(_0x49fd('0x2'))(_0x49fd('0x3'));var moment=require(_0x49fd('0x4'));var BPromise=require(_0x49fd('0x5'));var rp=require(_0x49fd('0x6'));var fs=require('fs');var path=require(_0x49fd('0x7'));var rimraf=require(_0x49fd('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x49fd('0x9')]=function(_0x42fdc7,_0x1bc16e){return _0x42fdc7[_0x49fd('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x49fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82c4=['JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptySessionReport.attributes','define'];(function(_0x5e0915,_0x30d202){var _0x459a69=function(_0x2102a8){while(--_0x2102a8){_0x5e0915['push'](_0x5e0915['shift']());}};_0x459a69(++_0x30d202);}(_0x82c4,0x1ca));var _0x482c=function(_0x32a94c,_0x29f028){_0x32a94c=_0x32a94c-0x0;var _0x1841ae=_0x82c4[_0x32a94c];return _0x1841ae;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index effc9aa..2d81d07 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a6b=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','randomstring'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x40889c,_0x73e154){_0x40889c=_0x40889c-0x0;var _0x1e69a3=_0x0a6b[_0x40889c];return _0x1e69a3;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0a6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0a6('0x2'))['db'];var utils=require(_0xb0a6('0x3'));var logger=require(_0xb0a6('0x4'))('rpc');var config=require(_0xb0a6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0a6('0x6')][_0xb0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d2d,_0x11cd5b,_0x24515c){return new BPromise(function(_0x2a8516,_0x530c05){return client['request'](_0x5e2d2d,_0x24515c)['then'](function(_0x2ded05){logger[_0xb0a6('0x8')](_0xb0a6('0x9'),_0x11cd5b,_0xb0a6('0xa'));logger['debug'](_0xb0a6('0xb'),_0x11cd5b,_0xb0a6('0xa'),JSON['stringify'](_0x2ded05));if(_0x2ded05[_0xb0a6('0xc')]){if(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xd')]===0x1f4){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);return _0x530c05(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);}logger[_0xb0a6('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x11cd5b,_0x2ded05[_0xb0a6('0xc')]['message']);return _0x2a8516(_0x2ded05[_0xb0a6('0xc')]['message']);}else{logger[_0xb0a6('0x8')]('JscriptySessionReport,\x20%s,\x20%s',_0x11cd5b,_0xb0a6('0xa'));_0x2a8516(_0x2ded05[_0xb0a6('0xf')][_0xb0a6('0xe')]);}})['catch'](function(_0x56b594){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x56b594);_0x530c05(_0x56b594);});});} \ No newline at end of file +var _0x627e=['request','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x5bf8c3,_0x17cff7){var _0x4b7576=function(_0x39ded1){while(--_0x39ded1){_0x5bf8c3['push'](_0x5bf8c3['shift']());}};_0x4b7576(++_0x17cff7);}(_0x627e,0x14a));var _0xe627=function(_0xf141eb,_0x3b1653){_0xf141eb=_0xf141eb-0x0;var _0x32d1b3=_0x627e[_0xf141eb];return _0x32d1b3;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 3376034..fae6811 100644 --- a/server/api/license/index.js +++ b/server/api/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf150=['/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','isAuthenticated','update'];(function(_0xae0c01,_0x449c99){var _0x913e86=function(_0x421e87){while(--_0x421e87){_0xae0c01['push'](_0xae0c01['shift']());}};_0x913e86(++_0x449c99);}(_0xf150,0x69));var _0x0f15=function(_0x1598d9,_0x90ca63){_0x1598d9=_0x1598d9-0x0;var _0x1ea965=_0xf150[_0x1598d9];return _0x1ea965;};'use strict';var multer=require(_0x0f15('0x0'));var util=require(_0x0f15('0x1'));var path=require(_0x0f15('0x2'));var timeout=require(_0x0f15('0x3'));var express=require('express');var router=express[_0x0f15('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0f15('0x5'));var interaction=require(_0x0f15('0x6'));var config=require(_0x0f15('0x7'));var controller=require(_0x0f15('0x8'));router[_0x0f15('0x9')]('/',controller[_0x0f15('0xa')]);router[_0x0f15('0xb')]('/:id',auth[_0x0f15('0xc')](),controller[_0x0f15('0xd')]);router[_0x0f15('0x9')](_0x0f15('0xe'),auth['isAuthenticated'](),controller[_0x0f15('0xf')]);module[_0x0f15('0x10')]=router; \ No newline at end of file +var _0xec50=['exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xec50,0xcd));var _0x0ec5=function(_0x541e4f,_0x48d7fa){_0x541e4f=_0x541e4f-0x0;var _0x5c1711=_0xec50[_0x541e4f];return _0x5c1711;};'use strict';var multer=require(_0x0ec5('0x0'));var util=require(_0x0ec5('0x1'));var path=require('path');var timeout=require(_0x0ec5('0x2'));var express=require(_0x0ec5('0x3'));var router=express['Router']();var fs_extra=require(_0x0ec5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0ec5('0x5'));var config=require(_0x0ec5('0x6'));var controller=require(_0x0ec5('0x7'));router[_0x0ec5('0x8')]('/',controller[_0x0ec5('0x9')]);router[_0x0ec5('0xa')](_0x0ec5('0xb'),auth[_0x0ec5('0xc')](),controller[_0x0ec5('0xd')]);router[_0x0ec5('0x8')](_0x0ec5('0xe'),auth[_0x0ec5('0xc')](),controller[_0x0ec5('0xf')]);module[_0x0ec5('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 75e92eb..f3ab6f2 100644 --- a/server/api/license/license.attributes.js +++ b/server/api/license/license.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d33=['STRING','sequelize','TEXT'];(function(_0x1a70a6,_0x11d8f8){var _0x7fdc2f=function(_0x328ff0){while(--_0x328ff0){_0x1a70a6['push'](_0x1a70a6['shift']());}};_0x7fdc2f(++_0x11d8f8);}(_0x1d33,0xf4));var _0x31d3=function(_0x5aa527,_0x4bef1b){_0x5aa527=_0x5aa527-0x0;var _0x1ae4b1=_0x1d33[_0x5aa527];return _0x1ae4b1;};'use strict';var Sequelize=require(_0x31d3('0x0'));module['exports']={'license':{'type':Sequelize[_0x31d3('0x1')]},'data1':{'type':Sequelize[_0x31d3('0x2')]},'data2':{'type':Sequelize[_0x31d3('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x10a4=['TEXT','STRING','sequelize','exports'];(function(_0x2c0689,_0x357667){var _0x25762b=function(_0x224bdd){while(--_0x224bdd){_0x2c0689['push'](_0x2c0689['shift']());}};_0x25762b(++_0x357667);}(_0x10a4,0xba));var _0x410a=function(_0x296e0e,_0x342fa4){_0x296e0e=_0x296e0e-0x0;var _0x101c03=_0x10a4[_0x296e0e];return _0x101c03;};'use strict';var Sequelize=require(_0x410a('0x0'));module[_0x410a('0x1')]={'license':{'type':Sequelize[_0x410a('0x2')]},'data1':{'type':Sequelize[_0x410a('0x3')]},'data2':{'type':Sequelize[_0x410a('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 9b54954..f2e34a4 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa55a=['key','demo','catch','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','Content-Type','text/plain','download','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','name','send','../../config/license/util','index','model','keys','License','query','filters','attributes','intersection','fields','merge','options','getLicense','body','find','params','checkLicense'];(function(_0x409cf7,_0x33f614){var _0x22fc4f=function(_0x4693e0){while(--_0x4693e0){_0x409cf7['push'](_0x409cf7['shift']());}};_0x22fc4f(++_0x33f614);}(_0xa55a,0xe5));var _0xaa55=function(_0x52af23,_0x1f818f){_0x52af23=_0x52af23-0x0;var _0x5b2709=_0xa55a[_0x52af23];return _0x5b2709;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa55('0x0'));var BPromise=require(_0xaa55('0x1'));var Mustache=require(_0xaa55('0x2'));var util=require('util');var path=require(_0xaa55('0x3'));var sox=require(_0xaa55('0x4'));var csv=require(_0xaa55('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa55('0x6'));var _=require(_0xaa55('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaa55('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xaa55('0x5'));var querystring=require(_0xaa55('0x9'));var Papa=require(_0xaa55('0xa'));var Redis=require(_0xaa55('0xb'));var authService=require(_0xaa55('0xc'));var qs=require(_0xaa55('0xd'));var as=require(_0xaa55('0xe'));var hardwareService=require(_0xaa55('0xf'));var logger=require('../../config/logger')(_0xaa55('0x10'));var utils=require(_0xaa55('0x11'));var config=require(_0xaa55('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa55('0x13'))['db'];function respondWithStatusCode(_0x5d5e52,_0x3e8119){_0x3e8119=_0x3e8119||0xcc;return function(_0x3477aa){if(_0x3477aa){return _0x5d5e52[_0xaa55('0x14')](_0x3e8119);}return _0x5d5e52[_0xaa55('0x15')](_0x3e8119)[_0xaa55('0x16')]();};}function respondWithResult(_0x8ed32c,_0x2d4611){_0x2d4611=_0x2d4611||0xc8;return function(_0x45e1bb){if(_0x45e1bb){return _0x8ed32c[_0xaa55('0x15')](_0x2d4611)[_0xaa55('0x17')](_0x45e1bb);}};}function respondWithFilteredResult(_0x29195f,_0x4a4130){return function(_0x329c24){if(_0x329c24){var _0x45df61=typeof _0x4a4130[_0xaa55('0x18')]===_0xaa55('0x19')&&typeof _0x4a4130[_0xaa55('0x1a')]===_0xaa55('0x19');var _0x4f3a60=_0x329c24['count'];var _0x34b941=_0x45df61?0x0:_0x4a4130[_0xaa55('0x18')];var _0x199ae5=_0x45df61?_0x329c24[_0xaa55('0x1b')]:_0x4a4130['offset']+_0x4a4130[_0xaa55('0x1a')];var _0x597385;if(_0x199ae5>=_0x4f3a60){_0x199ae5=_0x4f3a60;_0x597385=0xc8;}else{_0x597385=0xce;}_0x29195f[_0xaa55('0x15')](_0x597385);return _0x29195f['set'](_0xaa55('0x1c'),_0x34b941+'-'+_0x199ae5+'/'+_0x4f3a60)[_0xaa55('0x17')](_0x329c24);}return null;};}function patchUpdates(_0x50c829){return function(_0x35faa9){try{jsonpatch[_0xaa55('0x1d')](_0x35faa9,_0x50c829,!![]);}catch(_0x3aba27){return BPromise[_0xaa55('0x1e')](_0x3aba27);}return _0x35faa9[_0xaa55('0x1f')]();};}function saveUpdates(_0x5066bb,_0x485043){return function(_0x305e42){if(_0x305e42){return _0x305e42[_0xaa55('0x20')](_0x5066bb)['then'](function(_0x4c705e){return _0x4c705e;});}return null;};}function removeEntity(_0x5c3c68,_0x325315){return function(_0x2bf558){if(_0x2bf558){return _0x2bf558[_0xaa55('0x21')]()[_0xaa55('0x22')](function(){_0x5c3c68[_0xaa55('0x15')](0xcc)[_0xaa55('0x16')]();});}};}function handleEntityNotFound(_0x1aa1be,_0x578dd2){return function(_0x6c9169){if(!_0x6c9169){_0x1aa1be[_0xaa55('0x14')](0x194);}return _0x6c9169;};}function handleError(_0x394f0b,_0x85bdbd){_0x85bdbd=_0x85bdbd||0x1f4;return function(_0xb1d84e){logger[_0xaa55('0x23')](_0xb1d84e['stack']);if(_0xb1d84e[_0xaa55('0x24')]){delete _0xb1d84e[_0xaa55('0x24')];}_0x394f0b['status'](_0x85bdbd)[_0xaa55('0x25')](_0xb1d84e);};}var utilLicense=require(_0xaa55('0x26'));exports[_0xaa55('0x27')]=function(_0x109520,_0x4c8ad2){var _0xd6fc09={'raw':!![],'where':{'id':0x1}},_0x465eb0={};_0x465eb0[_0xaa55('0x28')]=_[_0xaa55('0x29')](db[_0xaa55('0x2a')]['rawAttributes']);_0x465eb0[_0xaa55('0x2b')]=_[_0xaa55('0x29')](_0x109520[_0xaa55('0x2b')]);_0x465eb0[_0xaa55('0x2c')]=_['intersection'](_0x465eb0['model'],_0x465eb0[_0xaa55('0x2b')]);_0xd6fc09[_0xaa55('0x2d')]=_[_0xaa55('0x2e')](_0x465eb0['model'],qs['fields'](_0x109520[_0xaa55('0x2b')][_0xaa55('0x2f')]));_0xd6fc09[_0xaa55('0x2d')]=_0xd6fc09[_0xaa55('0x2d')]['length']?_0xd6fc09[_0xaa55('0x2d')]:_0x465eb0['model'];_0xd6fc09=_[_0xaa55('0x30')]({},_0xd6fc09,_0x109520[_0xaa55('0x31')]);return utilLicense[_0xaa55('0x32')](_0xd6fc09)['then'](respondWithResult(_0x4c8ad2,null))['catch'](handleError(_0x4c8ad2,null));};exports['update']=function(_0x3fb211,_0x3b1af7){if(_0x3fb211[_0xaa55('0x33')]['id']){delete _0x3fb211[_0xaa55('0x33')]['id'];}return db[_0xaa55('0x2a')][_0xaa55('0x34')]({'where':{'id':_0x3fb211[_0xaa55('0x35')]['id']}})['then'](handleEntityNotFound(_0x3b1af7,null))['then'](function(_0x30f1f3){var _0x10b639=_0x30f1f3['get']({'plain':!![]});return utilLicense[_0xaa55('0x36')](_0x10b639,_0x3fb211[_0xaa55('0x33')][_0xaa55('0x37')]);})[_0xaa55('0x22')](function(_0x23a799){if(!_0x23a799[_0xaa55('0x38')]){return saveUpdates(_0x3fb211[_0xaa55('0x33')],null);}return _0x23a799;})[_0xaa55('0x22')](respondWithResult(_0x3b1af7,null))[_0xaa55('0x39')](handleError(_0x3b1af7,null));};exports[_0xaa55('0x3a')]=function(_0x2a5c38,_0x2e6dba){var _0x5a2116=_0xaa55('0x3b');var _0x110f37=path[_0xaa55('0x3c')](_0xaa55('0x3d'),_0xaa55('0x3e'),_0xaa55('0x3f'),_0x5a2116);_0x2e6dba[_0xaa55('0x40')](_0xaa55('0x41'),_0xaa55('0x42')+_0x5a2116);_0x2e6dba[_0xaa55('0x43')](_0xaa55('0x44'),_0xaa55('0x45'));_0x2e6dba[_0xaa55('0x46')](_0x110f37);}; \ No newline at end of file +var _0x02c1=['to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','keys','License','query','filters','intersection','model','attributes','fields','length','merge','catch','body','find','params','get','key','downloadLogFile','license-info.log','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x02c1,0x1a1));var _0x102c=function(_0x5a9fb8,_0x5b5240){_0x5a9fb8=_0x5a9fb8-0x0;var _0x7b78a6=_0x02c1[_0x5a9fb8];return _0x7b78a6;};'use strict';var emlformat=require(_0x102c('0x0'));var rimraf=require(_0x102c('0x1'));var zipdir=require(_0x102c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x102c('0x3'));var moment=require(_0x102c('0x4'));var BPromise=require(_0x102c('0x5'));var Mustache=require(_0x102c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x102c('0x7'));var csv=require('to-csv');var ejs=require(_0x102c('0x8'));var fs=require('fs');var fs_extra=require(_0x102c('0x9'));var _=require(_0x102c('0xa'));var squel=require(_0x102c('0xb'));var crypto=require(_0x102c('0xc'));var jsforce=require(_0x102c('0xd'));var deskjs=require(_0x102c('0xe'));var toCsv=require(_0x102c('0xf'));var querystring=require('querystring');var Papa=require(_0x102c('0x10'));var Redis=require(_0x102c('0x11'));var authService=require(_0x102c('0x12'));var qs=require(_0x102c('0x13'));var as=require(_0x102c('0x14'));var hardwareService=require(_0x102c('0x15'));var logger=require(_0x102c('0x16'))(_0x102c('0x17'));var utils=require(_0x102c('0x18'));var config=require(_0x102c('0x19'));var licenseUtil=require(_0x102c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x483a19,_0x1e48fc){_0x1e48fc=_0x1e48fc||0xcc;return function(_0x573453){if(_0x573453){return _0x483a19[_0x102c('0x1b')](_0x1e48fc);}return _0x483a19[_0x102c('0x1c')](_0x1e48fc)[_0x102c('0x1d')]();};}function respondWithResult(_0x151b88,_0x1bd222){_0x1bd222=_0x1bd222||0xc8;return function(_0xfa873){if(_0xfa873){return _0x151b88[_0x102c('0x1c')](_0x1bd222)['json'](_0xfa873);}};}function respondWithFilteredResult(_0x11fc4f,_0x45d90e){return function(_0x562fad){if(_0x562fad){var _0x503ebd=typeof _0x45d90e[_0x102c('0x1e')]==='undefined'&&typeof _0x45d90e[_0x102c('0x1f')]==='undefined';var _0x2c9563=_0x562fad[_0x102c('0x20')];var _0x583490=_0x503ebd?0x0:_0x45d90e[_0x102c('0x1e')];var _0x1bddd1=_0x503ebd?_0x562fad[_0x102c('0x20')]:_0x45d90e['offset']+_0x45d90e[_0x102c('0x1f')];var _0x4a09ef;if(_0x1bddd1>=_0x2c9563){_0x1bddd1=_0x2c9563;_0x4a09ef=0xc8;}else{_0x4a09ef=0xce;}_0x11fc4f['status'](_0x4a09ef);return _0x11fc4f[_0x102c('0x21')](_0x102c('0x22'),_0x583490+'-'+_0x1bddd1+'/'+_0x2c9563)['json'](_0x562fad);}return null;};}function patchUpdates(_0x214d86){return function(_0x4576e1){try{jsonpatch[_0x102c('0x23')](_0x4576e1,_0x214d86,!![]);}catch(_0x258e1d){return BPromise[_0x102c('0x24')](_0x258e1d);}return _0x4576e1[_0x102c('0x25')]();};}function saveUpdates(_0x2304ba,_0x2e31df){return function(_0x1a2fe2){if(_0x1a2fe2){return _0x1a2fe2[_0x102c('0x26')](_0x2304ba)[_0x102c('0x27')](function(_0x1a38b0){return _0x1a38b0;});}return null;};}function removeEntity(_0x1cb066,_0x298672){return function(_0x1d6a7e){if(_0x1d6a7e){return _0x1d6a7e[_0x102c('0x28')]()['then'](function(){_0x1cb066['status'](0xcc)[_0x102c('0x1d')]();});}};}function handleEntityNotFound(_0x431227,_0x51c73b){return function(_0x155916){if(!_0x155916){_0x431227['sendStatus'](0x194);}return _0x155916;};}function handleError(_0x240f30,_0x410473){_0x410473=_0x410473||0x1f4;return function(_0x400392){logger[_0x102c('0x29')](_0x400392[_0x102c('0x2a')]);if(_0x400392[_0x102c('0x2b')]){delete _0x400392[_0x102c('0x2b')];}_0x240f30[_0x102c('0x1c')](_0x410473)[_0x102c('0x2c')](_0x400392);};}var utilLicense=require(_0x102c('0x1a'));exports['index']=function(_0x312689,_0x14058b){var _0x39cb80={'raw':!![],'where':{'id':0x1}},_0xe25f1d={};_0xe25f1d['model']=_[_0x102c('0x2d')](db[_0x102c('0x2e')]['rawAttributes']);_0xe25f1d[_0x102c('0x2f')]=_[_0x102c('0x2d')](_0x312689[_0x102c('0x2f')]);_0xe25f1d[_0x102c('0x30')]=_[_0x102c('0x31')](_0xe25f1d[_0x102c('0x32')],_0xe25f1d[_0x102c('0x2f')]);_0x39cb80[_0x102c('0x33')]=_[_0x102c('0x31')](_0xe25f1d['model'],qs[_0x102c('0x34')](_0x312689[_0x102c('0x2f')]['fields']));_0x39cb80[_0x102c('0x33')]=_0x39cb80['attributes'][_0x102c('0x35')]?_0x39cb80['attributes']:_0xe25f1d[_0x102c('0x32')];_0x39cb80=_[_0x102c('0x36')]({},_0x39cb80,_0x312689['options']);return utilLicense['getLicense'](_0x39cb80)[_0x102c('0x27')](respondWithResult(_0x14058b,null))[_0x102c('0x37')](handleError(_0x14058b,null));};exports['update']=function(_0x3e9c92,_0x12c165){if(_0x3e9c92[_0x102c('0x38')]['id']){delete _0x3e9c92[_0x102c('0x38')]['id'];}return db['License'][_0x102c('0x39')]({'where':{'id':_0x3e9c92[_0x102c('0x3a')]['id']}})[_0x102c('0x27')](handleEntityNotFound(_0x12c165,null))['then'](function(_0x1ec743){var _0x1f5ded=_0x1ec743[_0x102c('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x1f5ded,_0x3e9c92[_0x102c('0x38')][_0x102c('0x3c')]);})['then'](function(_0x4cb842){if(!_0x4cb842['demo']){return saveUpdates(_0x3e9c92[_0x102c('0x38')],null);}return _0x4cb842;})['then'](respondWithResult(_0x12c165,null))[_0x102c('0x37')](handleError(_0x12c165,null));};exports[_0x102c('0x3d')]=function(_0x71db68,_0x2f07f5){var _0x21e345=_0x102c('0x3e');var _0x28802e=path[_0x102c('0x3f')](_0x102c('0x40'),_0x102c('0x41'),'xcally',_0x21e345);_0x2f07f5[_0x102c('0x42')](_0x102c('0x43'),_0x102c('0x44')+_0x21e345);_0x2f07f5['set'](_0x102c('0x45'),_0x102c('0x46'));_0x2f07f5[_0x102c('0x47')](_0x28802e);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index dd69d76..569ab56 100644 --- a/server/api/license/license.model.js +++ b/server/api/license/license.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ada=['../../config/environment','./license.attributes','define','License','license','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3179f2,_0x5b3ff7){var _0x12f576=function(_0x21ae06){while(--_0x21ae06){_0x3179f2['push'](_0x3179f2['shift']());}};_0x12f576(++_0x5b3ff7);}(_0x0ada,0x101));var _0xa0ad=function(_0x5c5590,_0x29d800){_0x5c5590=_0x5c5590-0x0;var _0x110470=_0x0ada[_0x5c5590];return _0x110470;};'use strict';var _=require(_0xa0ad('0x0'));var util=require('util');var logger=require(_0xa0ad('0x1'))(_0xa0ad('0x2'));var moment=require(_0xa0ad('0x3'));var BPromise=require(_0xa0ad('0x4'));var rp=require(_0xa0ad('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0ad('0x6'));var config=require(_0xa0ad('0x7'));var attributes=require(_0xa0ad('0x8'));module['exports']=function(_0x3bbd8d,_0x127d08){return _0x3bbd8d[_0xa0ad('0x9')](_0xa0ad('0xa'),attributes,{'tableName':_0xa0ad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa937=['rimraf','../../config/environment','exports','define','License','license','util','api','moment','bluebird','request-promise','path'];(function(_0x4fe5b6,_0x733bc2){var _0x466581=function(_0x1eaffd){while(--_0x1eaffd){_0x4fe5b6['push'](_0x4fe5b6['shift']());}};_0x466581(++_0x733bc2);}(_0xa937,0x66));var _0x7a93=function(_0x2f3ab7,_0x1199dd){_0x2f3ab7=_0x2f3ab7-0x0;var _0xa790b1=_0xa937[_0x2f3ab7];return _0xa790b1;};'use strict';var _=require('lodash');var util=require(_0x7a93('0x0'));var logger=require('../../config/logger')(_0x7a93('0x1'));var moment=require(_0x7a93('0x2'));var BPromise=require(_0x7a93('0x3'));var rp=require(_0x7a93('0x4'));var fs=require('fs');var path=require(_0x7a93('0x5'));var rimraf=require(_0x7a93('0x6'));var config=require(_0x7a93('0x7'));var attributes=require('./license.attributes');module[_0x7a93('0x8')]=function(_0x27bd3a,_0x2b50b7){return _0x27bd3a[_0x7a93('0x9')](_0x7a93('0xa'),attributes,{'tableName':_0x7a93('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 79d06dc..8e25506 100644 --- a/server/api/license/license.rpc.js +++ b/server/api/license/license.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4af7=['message','result','catch','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','error'];(function(_0x16c258,_0x179814){var _0x5bb20b=function(_0x20c4dc){while(--_0x20c4dc){_0x16c258['push'](_0x16c258['shift']());}};_0x5bb20b(++_0x179814);}(_0x4af7,0x157));var _0x74af=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0x4af7[_0x383dbb];return _0x6e8bde;};'use strict';var _=require('lodash');var util=require(_0x74af('0x0'));var moment=require('moment');var BPromise=require(_0x74af('0x1'));var rs=require(_0x74af('0x2'));var fs=require('fs');var Redis=require(_0x74af('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x74af('0x4'))('rpc');var config=require(_0x74af('0x5'));var jayson=require(_0x74af('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ca76c,_0x2979ed,_0xf3f994){return new BPromise(function(_0x501ab9,_0x286e48){return client[_0x74af('0x7')](_0x2ca76c,_0xf3f994)[_0x74af('0x8')](function(_0x1953da){logger[_0x74af('0x9')](_0x74af('0xa'),_0x2979ed,_0x74af('0xb'));logger['debug'](_0x74af('0xc'),_0x2979ed,_0x74af('0xb'),JSON['stringify'](_0x1953da));if(_0x1953da[_0x74af('0xd')]){if(_0x1953da[_0x74af('0xd')]['code']===0x1f4){logger[_0x74af('0xd')](_0x74af('0xa'),_0x2979ed,_0x1953da[_0x74af('0xd')][_0x74af('0xe')]);return _0x286e48(_0x1953da[_0x74af('0xd')][_0x74af('0xe')]);}logger[_0x74af('0xd')](_0x74af('0xa'),_0x2979ed,_0x1953da['error']['message']);return _0x501ab9(_0x1953da[_0x74af('0xd')][_0x74af('0xe')]);}else{logger[_0x74af('0x9')](_0x74af('0xa'),_0x2979ed,_0x74af('0xb'));_0x501ab9(_0x1953da[_0x74af('0xf')]['message']);}})[_0x74af('0x10')](function(_0x1b644e){logger[_0x74af('0xd')](_0x74af('0xa'),_0x2979ed,_0x1b644e);_0x286e48(_0x1b644e);});});} \ No newline at end of file +var _0xf2d8=['moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf2d8,0x18d));var _0x8f2d=function(_0x31300c,_0x2823e1){_0x31300c=_0x31300c-0x0;var _0x462408=_0xf2d8[_0x31300c];return _0x462408;};'use strict';var _=require(_0x8f2d('0x0'));var util=require(_0x8f2d('0x1'));var moment=require(_0x8f2d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f2d('0x3'));var db=require(_0x8f2d('0x4'))['db'];var utils=require(_0x8f2d('0x5'));var logger=require('../../config/logger')(_0x8f2d('0x6'));var config=require('../../config/environment');var jayson=require(_0x8f2d('0x7'));var client=jayson[_0x8f2d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4052ba,_0x4909b4,_0x45025e){return new BPromise(function(_0x19cd52,_0x11e957){return client['request'](_0x4052ba,_0x45025e)[_0x8f2d('0x9')](function(_0x4eec06){logger[_0x8f2d('0xa')]('License,\x20%s,\x20%s',_0x4909b4,_0x8f2d('0xb'));logger[_0x8f2d('0xc')](_0x8f2d('0xd'),_0x4909b4,_0x8f2d('0xb'),JSON[_0x8f2d('0xe')](_0x4eec06));if(_0x4eec06[_0x8f2d('0xf')]){if(_0x4eec06[_0x8f2d('0xf')][_0x8f2d('0x10')]===0x1f4){logger[_0x8f2d('0xf')](_0x8f2d('0x11'),_0x4909b4,_0x4eec06[_0x8f2d('0xf')][_0x8f2d('0x12')]);return _0x11e957(_0x4eec06[_0x8f2d('0xf')]['message']);}logger['error'](_0x8f2d('0x11'),_0x4909b4,_0x4eec06['error'][_0x8f2d('0x12')]);return _0x19cd52(_0x4eec06[_0x8f2d('0xf')][_0x8f2d('0x12')]);}else{logger[_0x8f2d('0xa')]('License,\x20%s,\x20%s',_0x4909b4,_0x8f2d('0xb'));_0x19cd52(_0x4eec06[_0x8f2d('0x13')][_0x8f2d('0x12')]);}})[_0x8f2d('0x14')](function(_0x4aebd7){logger['error'](_0x8f2d('0x11'),_0x4909b4,_0x4aebd7);_0x11e957(_0x4aebd7);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 2849804..2d01b36 100644 --- a/server/api/mailAccount/index.js +++ b/server/api/mailAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1287=['fs-extra','../../config/environment','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addSmtp','/:id/interactions','addInteraction','addApplications','send','addAgents','put','/:id','update','removeDispositions','/:id/canned_answers','removeAnswers','delete','removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1b728a,_0x48d827){var _0x22cc9c=function(_0x1d7c9e){while(--_0x1d7c9e){_0x1b728a['push'](_0x1b728a['shift']());}};_0x22cc9c(++_0x48d827);}(_0x1287,0x143));var _0x7128=function(_0x214d1c,_0x3f7ade){_0x214d1c=_0x214d1c-0x0;var _0x40383d=_0x1287[_0x214d1c];return _0x40383d;};'use strict';var multer=require(_0x7128('0x0'));var util=require(_0x7128('0x1'));var path=require(_0x7128('0x2'));var timeout=require(_0x7128('0x3'));var express=require(_0x7128('0x4'));var router=express[_0x7128('0x5')]();var fs_extra=require(_0x7128('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7128('0x7'));var controller=require('./mailAccount.controller');router[_0x7128('0x8')]('/',auth[_0x7128('0x9')](),controller[_0x7128('0xa')]);router['get']('/describe',auth[_0x7128('0x9')](),controller[_0x7128('0xb')]);router[_0x7128('0x8')]('/:id',auth[_0x7128('0x9')](),controller[_0x7128('0xc')]);router[_0x7128('0x8')](_0x7128('0xd'),auth[_0x7128('0x9')](),controller[_0x7128('0xe')]);router[_0x7128('0x8')]('/:id/canned_answers',auth[_0x7128('0x9')](),controller['getAnswers']);router[_0x7128('0x8')]('/:id/in_servers',auth[_0x7128('0x9')](),controller[_0x7128('0xf')]);router[_0x7128('0x8')](_0x7128('0x10'),auth[_0x7128('0x9')](),controller[_0x7128('0x11')]);router[_0x7128('0x8')]('/:id/interactions',auth[_0x7128('0x9')](),controller[_0x7128('0x12')]);router['get'](_0x7128('0x13'),auth[_0x7128('0x9')](),controller['getApplications']);router[_0x7128('0x8')](_0x7128('0x14'),auth[_0x7128('0x9')](),controller[_0x7128('0x15')]);router[_0x7128('0x8')](_0x7128('0x16'),auth['isAuthenticated'](),controller[_0x7128('0x17')]);router['get'](_0x7128('0x18'),auth[_0x7128('0x9')](),controller[_0x7128('0x19')]);router[_0x7128('0x1a')](_0x7128('0xd'),auth[_0x7128('0x9')](),controller[_0x7128('0x1b')]);router[_0x7128('0x1a')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7128('0x1c')]);router[_0x7128('0x1a')]('/',auth['isAuthenticated'](),controller[_0x7128('0x1d')]);router[_0x7128('0x1a')](_0x7128('0x1e'),auth[_0x7128('0x9')](),controller['addImap']);router[_0x7128('0x1a')](_0x7128('0x10'),auth[_0x7128('0x9')](),controller[_0x7128('0x1f')]);router['post'](_0x7128('0x20'),auth[_0x7128('0x9')](),controller[_0x7128('0x21')]);router['post'](_0x7128('0x13'),auth[_0x7128('0x9')](),controller[_0x7128('0x22')]);router[_0x7128('0x1a')]('/:id/send',auth[_0x7128('0x9')](),controller[_0x7128('0x23')]);router['post'](_0x7128('0x18'),auth['isAuthenticated'](),controller[_0x7128('0x24')]);router[_0x7128('0x25')](_0x7128('0x26'),auth['isAuthenticated'](),controller[_0x7128('0x27')]);router['delete'](_0x7128('0xd'),auth[_0x7128('0x9')](),controller[_0x7128('0x28')]);router['delete'](_0x7128('0x29'),auth[_0x7128('0x9')](),controller[_0x7128('0x2a')]);router[_0x7128('0x2b')](_0x7128('0x1e'),auth[_0x7128('0x9')](),controller['removeImap']);router[_0x7128('0x2b')](_0x7128('0x10'),auth['isAuthenticated'](),controller[_0x7128('0x2c')]);router['delete'](_0x7128('0x26'),auth[_0x7128('0x9')](),controller['destroy']);router[_0x7128('0x2b')](_0x7128('0x18'),auth[_0x7128('0x9')](),controller[_0x7128('0x2d')]);module[_0x7128('0x2e')]=router; \ No newline at end of file +var _0x20b0=['/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','/:id/dispositions','addDisposition','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeImap','removeSmtp','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe'];(function(_0x1afada,_0x3877e5){var _0x596776=function(_0x52c153){while(--_0x52c153){_0x1afada['push'](_0x1afada['shift']());}};_0x596776(++_0x3877e5);}(_0x20b0,0xdd));var _0x020b=function(_0x2aac5f,_0x3393b6){_0x2aac5f=_0x2aac5f-0x0;var _0x3b746c=_0x20b0[_0x2aac5f];return _0x3b746c;};'use strict';var multer=require(_0x020b('0x0'));var util=require(_0x020b('0x1'));var path=require(_0x020b('0x2'));var timeout=require(_0x020b('0x3'));var express=require(_0x020b('0x4'));var router=express['Router']();var fs_extra=require(_0x020b('0x5'));var auth=require(_0x020b('0x6'));var interaction=require(_0x020b('0x7'));var config=require(_0x020b('0x8'));var controller=require(_0x020b('0x9'));router[_0x020b('0xa')]('/',auth[_0x020b('0xb')](),controller[_0x020b('0xc')]);router[_0x020b('0xa')](_0x020b('0xd'),auth[_0x020b('0xb')](),controller['describe']);router[_0x020b('0xa')](_0x020b('0xe'),auth[_0x020b('0xb')](),controller[_0x020b('0xf')]);router[_0x020b('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x020b('0x10')]);router[_0x020b('0xa')](_0x020b('0x11'),auth['isAuthenticated'](),controller[_0x020b('0x12')]);router[_0x020b('0xa')](_0x020b('0x13'),auth[_0x020b('0xb')](),controller[_0x020b('0x14')]);router['get'](_0x020b('0x15'),auth[_0x020b('0xb')](),controller['getSmtp']);router[_0x020b('0xa')]('/:id/interactions',auth[_0x020b('0xb')](),controller[_0x020b('0x16')]);router[_0x020b('0xa')](_0x020b('0x17'),auth[_0x020b('0xb')](),controller[_0x020b('0x18')]);router[_0x020b('0xa')](_0x020b('0x19'),auth[_0x020b('0xb')](),controller[_0x020b('0x1a')]);router[_0x020b('0xa')](_0x020b('0x1b'),auth['isAuthenticated'](),controller[_0x020b('0x1c')]);router['get'](_0x020b('0x1d'),auth['isAuthenticated'](),controller['getAgents']);router[_0x020b('0x1e')](_0x020b('0x1f'),auth['isAuthenticated'](),controller[_0x020b('0x20')]);router['post']('/:id/canned_answers',auth[_0x020b('0xb')](),controller['addAnswer']);router[_0x020b('0x1e')]('/',auth[_0x020b('0xb')](),controller['create']);router['post'](_0x020b('0x13'),auth[_0x020b('0xb')](),controller['addImap']);router[_0x020b('0x1e')]('/:id/out_servers',auth[_0x020b('0xb')](),controller[_0x020b('0x21')]);router['post'](_0x020b('0x22'),auth[_0x020b('0xb')](),controller[_0x020b('0x23')]);router[_0x020b('0x1e')](_0x020b('0x17'),auth[_0x020b('0xb')](),controller[_0x020b('0x24')]);router[_0x020b('0x1e')](_0x020b('0x25'),auth[_0x020b('0xb')](),controller[_0x020b('0x26')]);router['post'](_0x020b('0x1d'),auth['isAuthenticated'](),controller[_0x020b('0x27')]);router[_0x020b('0x28')](_0x020b('0xe'),auth['isAuthenticated'](),controller[_0x020b('0x29')]);router[_0x020b('0x2a')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x020b('0x2a')](_0x020b('0x11'),auth[_0x020b('0xb')](),controller['removeAnswers']);router[_0x020b('0x2a')]('/:id/in_servers',auth[_0x020b('0xb')](),controller[_0x020b('0x2b')]);router['delete']('/:id/out_servers',auth[_0x020b('0xb')](),controller[_0x020b('0x2c')]);router[_0x020b('0x2a')]('/:id',auth[_0x020b('0xb')](),controller[_0x020b('0x2d')]);router[_0x020b('0x2a')](_0x020b('0x1d'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x020b('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index f48825d..3ca41b6 100644 --- a/server/api/mailAccount/mailAccount.attributes.js +++ b/server/api/mailAccount/mailAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08cb=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','gmail','yahoo','outlook365','getDataValue','provider','custom','exports'];(function(_0x3ae7ff,_0x36362c){var _0x1af06c=function(_0xfd33b8){while(--_0xfd33b8){_0x3ae7ff['push'](_0x3ae7ff['shift']());}};_0x1af06c(++_0x36362c);}(_0x08cb,0x8b));var _0xb08c=function(_0x252db7,_0x3efd31){_0x252db7=_0x252db7-0x0;var _0x993120=_0x08cb[_0x252db7];return _0x993120;};'use strict';var Sequelize=require('sequelize');module[_0xb08c('0x0')]={'description':{'type':Sequelize[_0xb08c('0x1')]},'name':{'type':Sequelize[_0xb08c('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xb08c('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xb08c('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb08c('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xb08c('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xb08c('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb08c('0x1')],'allowNull':![],'defaultValue':_0xb08c('0x4')},'fontSize':{'type':Sequelize[_0xb08c('0x5')](0x2)[_0xb08c('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb08c('0x7');}},'notificationSound':{'type':Sequelize[_0xb08c('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb08c('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb08c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb08c('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb08c('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb08c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb08c('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xb08c('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb08c('0x9'),'set':function(_0x59a647){if(!_0x59a647)this['setDataValue'](_0xb08c('0xa'),null);this[_0xb08c('0xb')](_0xb08c('0xc'),_0x59a647);}},'provider':{'type':Sequelize[_0xb08c('0xd')](_0xb08c('0xe'),'hotmail',_0xb08c('0xf'),_0xb08c('0x10')),'defaultValue':null,'get':function(){if(!this[_0xb08c('0x11')](_0xb08c('0x12')))return'custom';return this[_0xb08c('0x11')](_0xb08c('0x12'));},'set':function(_0x58fbfb){if(_0x58fbfb===_0xb08c('0x13'))_0x58fbfb=null;return this[_0xb08c('0xb')](_0xb08c('0x12'),_0x58fbfb);}}}; \ No newline at end of file +var _0xfdce=['mandatoryDispositionPauseId','setDataValue','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x436436,_0x556682){var _0x369bbe=function(_0x10f28e){while(--_0x10f28e){_0x436436['push'](_0x436436['shift']());}};_0x369bbe(++_0x556682);}(_0xfdce,0x17f));var _0xefdc=function(_0x21fe98,_0x55db4c){_0x21fe98=_0x21fe98-0x0;var _0x19dde3=_0xfdce[_0x21fe98];return _0x19dde3;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xefdc('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xefdc('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0xefdc('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0xefdc('0x2')]},'markAsUnread':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xefdc('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xefdc('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xefdc('0x5');}},'notificationSound':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xefdc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xefdc('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3a9241){if(!_0x3a9241)this['setDataValue'](_0xefdc('0x8'),null);this[_0xefdc('0x9')]('mandatoryDisposition',_0x3a9241);}},'provider':{'type':Sequelize[_0xefdc('0xa')](_0xefdc('0xb'),_0xefdc('0xc'),_0xefdc('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0xefdc('0xe')](_0xefdc('0xf')))return _0xefdc('0x10');return this[_0xefdc('0xe')](_0xefdc('0xf'));},'set':function(_0x3b97ee){if(_0x3b97ee===_0xefdc('0x10'))_0x3b97ee=null;return this['setDataValue'](_0xefdc('0xf'),_0x3b97ee);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 7422f6c..3746d1f 100644 --- a/server/api/mailAccount/mailAccount.controller.js +++ b/server/api/mailAccount/mailAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b25=['password','pass','modernAuthentication','CloudProviderId','host','port','secure','authentication','Imap','Smtp','index','MailServerIn','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','rows','show','MailServerOut','find','body','provider','custom','params','Mail\x20Account\x20not\x20found','service','update','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','pick','options','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','ListId','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','fullname','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','destroy','bulkCreate','findAndCountAll','priority','getApplications','hasOwnProperty','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','SendMail','sendMail','defaults','subject','out','messageId','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./mailAccount.socket','register','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','MailAccounts','end','sendStatus','stack','name','send','gmail','imap.gmail.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username'];(function(_0x439af5,_0x38879f){var _0x203bac=function(_0x38afef){while(--_0x38afef){_0x439af5['push'](_0x439af5['shift']());}};_0x203bac(++_0x38879f);}(_0x1b25,0x8f));var _0x51b2=function(_0xe53e44,_0x172df){_0xe53e44=_0xe53e44-0x0;var _0x1bae8e=_0x1b25[_0xe53e44];return _0x1bae8e;};'use strict';var moment=require(_0x51b2('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x51b2('0x1'));var _=require(_0x51b2('0x2'));var juice=require(_0x51b2('0x3'));var Redis=require(_0x51b2('0x4'));var qs=require(_0x51b2('0x5'));var logger=require(_0x51b2('0x6'))('api');var config=require(_0x51b2('0x7'));var db=require(_0x51b2('0x8'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x51b2('0x9'),'port':0x18eb});var socket=require(_0x51b2('0xa'))(new Redis(config['redis']));require(_0x51b2('0xb'))[_0x51b2('0xc')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x51b2('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x2ea7e7,_0x531a97,_0x13ee23,_0x333ecf){return new BPromise(function(_0xfc05ee,_0x363a77){var _0x3de025=_0x333ecf||client;return _0x3de025[_0x51b2('0xe')](_0x2ea7e7,_0x13ee23)[_0x51b2('0xf')](function(_0x3fd56e){logger[_0x51b2('0x10')](_0x51b2('0x11'),_0x531a97,'request\x20sent');logger[_0x51b2('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x531a97,_0x51b2('0x13'),JSON[_0x51b2('0x14')](_0x3fd56e));if(_0x3fd56e[_0x51b2('0x15')]){if(_0x3fd56e[_0x51b2('0x15')][_0x51b2('0x16')]===0x1f4){logger[_0x51b2('0x15')](_0x51b2('0x11'),_0x531a97,_0x3fd56e['error'][_0x51b2('0x17')]);return _0x363a77(_0x3fd56e[_0x51b2('0x15')][_0x51b2('0x17')]);}logger[_0x51b2('0x15')]('MailAccount,\x20%s,\x20%s',_0x531a97,_0x3fd56e[_0x51b2('0x15')][_0x51b2('0x17')]);return _0xfc05ee(_0x3fd56e[_0x51b2('0x15')][_0x51b2('0x17')]);}else{logger[_0x51b2('0x10')](_0x51b2('0x11'),_0x531a97,_0x51b2('0x13'));_0xfc05ee(_0x3fd56e[_0x51b2('0x18')][_0x51b2('0x17')]);}})[_0x51b2('0x19')](function(_0x18707e){logger[_0x51b2('0x15')]('MailAccount,\x20%s,\x20%s',_0x531a97,_0x18707e);_0x363a77(_0x18707e);});});}function respondWithStatusCode(_0x54bf6a,_0x209d90){_0x209d90=_0x209d90||0xcc;return function(_0x4445da){if(_0x4445da){return _0x54bf6a['sendStatus'](_0x209d90);}return _0x54bf6a['status'](_0x209d90)['end']();};}function respondWithResult(_0x4147e3,_0xab8898){_0xab8898=_0xab8898||0xc8;return function(_0x494d36){if(_0x494d36){return _0x4147e3[_0x51b2('0x1a')](_0xab8898)[_0x51b2('0x1b')](_0x494d36);}};}function respondWithFilteredResult(_0x375bb0,_0x145266){return function(_0x26daae){if(_0x26daae){var _0x3d4583=typeof _0x145266[_0x51b2('0x1c')]===_0x51b2('0x1d')&&typeof _0x145266[_0x51b2('0x1e')]===_0x51b2('0x1d');var _0x44585c=_0x26daae[_0x51b2('0x1f')];var _0x2a36b7=_0x3d4583?0x0:_0x145266[_0x51b2('0x1c')];var _0x46cb3a=_0x3d4583?_0x26daae[_0x51b2('0x1f')]:_0x145266['offset']+_0x145266[_0x51b2('0x1e')];var _0x506c11;if(_0x46cb3a>=_0x44585c){_0x46cb3a=_0x44585c;_0x506c11=0xc8;}else{_0x506c11=0xce;}_0x375bb0[_0x51b2('0x1a')](_0x506c11);return _0x375bb0[_0x51b2('0x20')](_0x51b2('0x21'),_0x2a36b7+'-'+_0x46cb3a+'/'+_0x44585c)[_0x51b2('0x1b')](_0x26daae);}return null;};}function saveUpdates(_0x2c3873){return function(_0x279f0b){if(_0x279f0b){return _0x279f0b['update'](_0x2c3873)[_0x51b2('0xf')](function(_0x4534fa){return _0x4534fa;});}return null;};}function removeEntity(_0x36ca48){return function(_0xcf21c7){if(_0xcf21c7){return _0xcf21c7['destroy']()[_0x51b2('0xf')](function(){var _0x5db3da=_0xcf21c7['get']({'plain':!![]});var _0x56d71c=_0x51b2('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x56d71c,'resourceId':_0x5db3da['id']}})[_0x51b2('0xf')](function(){return _0xcf21c7;});})['then'](function(){_0x36ca48['status'](0xcc)[_0x51b2('0x23')]();});}};}function handleEntityNotFound(_0x626e1d){return function(_0x28f072){if(!_0x28f072){_0x626e1d[_0x51b2('0x24')](0x194);}return _0x28f072;};}function handleError(_0x1fad13,_0x198dde){_0x198dde=_0x198dde||0x1f4;return function(_0x415c56){logger[_0x51b2('0x15')](_0x415c56[_0x51b2('0x25')]);if(_0x415c56[_0x51b2('0x26')]){delete _0x415c56[_0x51b2('0x26')];}_0x1fad13[_0x51b2('0x1a')](_0x198dde)[_0x51b2('0x27')](_0x415c56);};}function getImapHost(_0x252477){switch(_0x252477){case _0x51b2('0x28'):return _0x51b2('0x29');case'yahoo':return'imap.mail.yahoo.com';case _0x51b2('0x2a'):return'imap-mail.outlook.com';case _0x51b2('0x2b'):return _0x51b2('0x2c');}throw new Error(_0x51b2('0x2d'),_0x252477);}function getSmtpHost(_0x3f1852){switch(_0x3f1852){case _0x51b2('0x28'):return _0x51b2('0x2e');case _0x51b2('0x2f'):return _0x51b2('0x30');case'hotmail':return _0x51b2('0x31');case _0x51b2('0x2b'):return'smtp.office365.com';}throw new Error(_0x51b2('0x2d'),_0x3f1852);}function getAuthenticationOptions(_0x559a4e,_0x54adf1){var _0x6b017d={};var _0x21c4fa={};if(_0x559a4e){_0x6b017d['user']=_0x21c4fa[_0x51b2('0x32')]=_0x54adf1[_0x51b2('0x33')];_0x6b017d[_0x51b2('0x34')]=_0x21c4fa[_0x51b2('0x35')]=_0x54adf1[_0x51b2('0x34')];if(_0x54adf1['modernAuthentication']){_0x6b017d[_0x51b2('0x36')]=_0x21c4fa['modernAuthentication']=!![];_0x6b017d['CloudProviderId']=_0x21c4fa[_0x51b2('0x37')]=_0x54adf1[_0x51b2('0x37')];_0x6b017d[_0x51b2('0x34')]=_0x21c4fa[_0x51b2('0x35')]=null;}else{_0x6b017d['CloudProviderId']=_0x21c4fa['CloudProviderId']=null;}_0x6b017d[_0x51b2('0x38')]=getImapHost(_0x559a4e);_0x6b017d['port']=0x3e1;_0x21c4fa[_0x51b2('0x38')]=getSmtpHost(_0x559a4e);_0x21c4fa[_0x51b2('0x39')]=0x24b;_0x21c4fa[_0x51b2('0x3a')]=![];_0x6b017d['service']=_0x21c4fa['service']=null;}else{if(_0x54adf1[_0x51b2('0x3b')]){_0x6b017d[_0x51b2('0x32')]=_0x21c4fa[_0x51b2('0x32')]=_0x54adf1[_0x51b2('0x33')];_0x6b017d['password']=_0x21c4fa[_0x51b2('0x35')]=_0x54adf1[_0x51b2('0x34')];}else{_0x6b017d[_0x51b2('0x3b')]=_0x21c4fa[_0x51b2('0x3b')]=![];_0x6b017d[_0x51b2('0x32')]=_0x21c4fa['user']=null;_0x6b017d['password']=_0x21c4fa[_0x51b2('0x35')]=null;}_0x6b017d[_0x51b2('0x38')]=_0x54adf1[_0x51b2('0x3c')][_0x51b2('0x38')];_0x6b017d['port']=_0x54adf1[_0x51b2('0x3c')][_0x51b2('0x39')];_0x21c4fa[_0x51b2('0x38')]=_0x54adf1[_0x51b2('0x3d')][_0x51b2('0x38')];_0x21c4fa[_0x51b2('0x39')]=_0x54adf1[_0x51b2('0x3d')][_0x51b2('0x39')];}return{'Imap':_0x6b017d,'Smtp':_0x21c4fa};}exports[_0x51b2('0x3e')]=function(_0x21ad58,_0x2a5c41){var _0x451059={'include':[{'model':db[_0x51b2('0x3f')],'as':_0x51b2('0x3c')},{'model':db['MailServerOut'],'as':_0x51b2('0x3d')},{'model':db[_0x51b2('0x40')],'as':_0x51b2('0x41')}]},_0x3948ff={},_0x24ee07={'count':0x0,'rows':[]};var _0x53e113=_[_0x51b2('0x42')](db[_0x51b2('0x43')][_0x51b2('0x44')],function(_0x23e289){return{'name':_0x23e289[_0x51b2('0x45')],'type':_0x23e289[_0x51b2('0x46')][_0x51b2('0x47')]};});_0x3948ff[_0x51b2('0x48')]=_[_0x51b2('0x42')](_0x53e113,_0x51b2('0x26'));_0x3948ff[_0x51b2('0x49')]=_[_0x51b2('0x4a')](_0x21ad58[_0x51b2('0x49')]);_0x3948ff['filters']=_['intersection'](_0x3948ff[_0x51b2('0x48')],_0x3948ff[_0x51b2('0x49')]);_0x451059[_0x51b2('0x4b')]=_[_0x51b2('0x4c')](_0x3948ff[_0x51b2('0x48')],qs[_0x51b2('0x4d')](_0x21ad58[_0x51b2('0x49')][_0x51b2('0x4d')]));_0x451059['attributes']=_0x451059[_0x51b2('0x4b')][_0x51b2('0x4e')]?_0x451059[_0x51b2('0x4b')]:_0x3948ff[_0x51b2('0x48')];if(!_0x21ad58[_0x51b2('0x49')]['hasOwnProperty'](_0x51b2('0x4f'))){_0x451059[_0x51b2('0x1e')]=qs['limit'](_0x21ad58[_0x51b2('0x49')]['limit']);_0x451059['offset']=qs[_0x51b2('0x1c')](_0x21ad58[_0x51b2('0x49')][_0x51b2('0x1c')]);}_0x451059[_0x51b2('0x50')]=qs[_0x51b2('0x51')](_0x21ad58['query'][_0x51b2('0x51')]);_0x451059[_0x51b2('0x52')]=qs[_0x51b2('0x53')](_['pick'](_0x21ad58[_0x51b2('0x49')],_0x3948ff['filters']),_0x53e113);if(_0x21ad58['query']['filter']){_0x451059['where']=_[_0x51b2('0x54')](_0x451059[_0x51b2('0x52')],{'$or':_[_0x51b2('0x42')](_0x53e113,function(_0x47e016){if(_0x47e016[_0x51b2('0x46')]!==_0x51b2('0x55')){var _0x3ca639={};_0x3ca639[_0x47e016[_0x51b2('0x26')]]={'$like':'%'+_0x21ad58['query'][_0x51b2('0x56')]+'%'};return _0x3ca639;}})});}_0x451059=_[_0x51b2('0x54')]({},_0x451059,_0x21ad58['options']);var _0x531097={'where':_0x451059[_0x51b2('0x52')]};return db[_0x51b2('0x43')][_0x51b2('0x1f')](_0x531097)[_0x51b2('0xf')](function(_0x1cf4f4){_0x24ee07['count']=_0x1cf4f4;if(_0x21ad58[_0x51b2('0x49')][_0x51b2('0x57')]){_0x451059[_0x51b2('0x58')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x451059);})[_0x51b2('0xf')](function(_0x18afed){_0x24ee07[_0x51b2('0x59')]=_0x18afed;return _0x24ee07;})[_0x51b2('0xf')](respondWithFilteredResult(_0x2a5c41,_0x451059))['catch'](handleError(_0x2a5c41,null));};exports[_0x51b2('0x5a')]=function(_0x33c766,_0x52803d){var _0xabcb20={'raw':![],'where':{'id':_0x33c766['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x51b2('0x3c')},{'model':db[_0x51b2('0x5b')],'as':_0x51b2('0x3d')},{'model':db[_0x51b2('0x40')],'as':'mandatoryDispositionPause'}]},_0x2253e1={};_0x2253e1[_0x51b2('0x48')]=_[_0x51b2('0x4a')](db[_0x51b2('0x43')][_0x51b2('0x44')]);_0x2253e1[_0x51b2('0x49')]=_[_0x51b2('0x4a')](_0x33c766[_0x51b2('0x49')]);_0x2253e1[_0x51b2('0x53')]=_[_0x51b2('0x4c')](_0x2253e1[_0x51b2('0x48')],_0x2253e1[_0x51b2('0x49')]);_0xabcb20[_0x51b2('0x4b')]=_['intersection'](_0x2253e1[_0x51b2('0x48')],qs[_0x51b2('0x4d')](_0x33c766[_0x51b2('0x49')][_0x51b2('0x4d')]));_0xabcb20['attributes']=_0xabcb20[_0x51b2('0x4b')]['length']?_0xabcb20['attributes']:_0x2253e1[_0x51b2('0x48')];if(_0x33c766[_0x51b2('0x49')]['includeAll']){_0xabcb20[_0x51b2('0x58')]=[{'all':!![]}];}_0xabcb20=_[_0x51b2('0x54')]({},_0xabcb20,_0x33c766['options']);return db['MailAccount'][_0x51b2('0x5c')](_0xabcb20)[_0x51b2('0xf')](handleEntityNotFound(_0x52803d,null))[_0x51b2('0xf')](respondWithResult(_0x52803d,null))[_0x51b2('0x19')](handleError(_0x52803d,null));};exports['update']=function(_0x26084e,_0xe6706f){if(_0x26084e[_0x51b2('0x5d')]['id']){delete _0x26084e['body']['id'];}var _0x18651d=_0x26084e['body'][_0x51b2('0x5e')]===_0x51b2('0x5f')?null:_0x26084e[_0x51b2('0x5d')][_0x51b2('0x5e')];var _0x2e37f8=_0x26084e[_0x51b2('0x5d')][_0x51b2('0x3c')]||{};var _0x319432=_0x26084e[_0x51b2('0x5d')][_0x51b2('0x3d')]||{};if(_0x18651d){_0x2e37f8[_0x51b2('0x38')]=getImapHost(_0x18651d);_0x2e37f8[_0x51b2('0x39')]=0x3e1;_0x319432['host']=getSmtpHost(_0x18651d);_0x319432[_0x51b2('0x39')]=0x24b;_0x319432[_0x51b2('0x3a')]=![];}if(_0x319432[_0x51b2('0x36')]){_0x319432[_0x51b2('0x3a')]=![];}else{_0x319432[_0x51b2('0x37')]=null;}if(!_0x2e37f8['modernAuthentication'])_0x2e37f8['CloudProviderId']=null;_0x26084e[_0x51b2('0x5d')]['Imap']=_0x2e37f8;_0x26084e[_0x51b2('0x5d')]['Smtp']=_0x319432;return db['MailAccount'][_0x51b2('0x5c')]({'where':{'id':_0x26084e[_0x51b2('0x60')]['id']},'include':[{'model':db[_0x51b2('0x3f')],'as':'Imap'},{'model':db[_0x51b2('0x5b')],'as':_0x51b2('0x3d')},{'model':db[_0x51b2('0x40')],'as':_0x51b2('0x41')}]})[_0x51b2('0xf')](handleEntityNotFound(_0xe6706f,null))[_0x51b2('0xf')](function(_0x1c4ed0){if(!_0x1c4ed0)throw new Error(_0x51b2('0x61'));if(_0x1c4ed0[_0x51b2('0x62')])delete _0x26084e[_0x51b2('0x5d')][_0x51b2('0x3c')];return _0x1c4ed0;})[_0x51b2('0xf')](saveUpdates(_0x26084e[_0x51b2('0x5d')],null))[_0x51b2('0xf')](function(_0x13a49c){if(!_0x26084e[_0x51b2('0x5d')][_0x51b2('0x3c')])return _0x13a49c;return db['MailServerIn'][_0x51b2('0x63')](_0x26084e['body'][_0x51b2('0x3c')],{'where':{'MailAccountId':_0x13a49c['id']}})[_0x51b2('0xf')](function(){return _0x13a49c;});})['then'](function(_0x4a6975){if(!_0x26084e[_0x51b2('0x5d')][_0x51b2('0x3d')])return _0x4a6975;return db[_0x51b2('0x5b')]['update'](_0x26084e[_0x51b2('0x5d')][_0x51b2('0x3d')],{'where':{'MailAccountId':_0x4a6975['id']}})[_0x51b2('0xf')](function(){return _0x4a6975;});})[_0x51b2('0xf')](respondWithResult(_0xe6706f,null))[_0x51b2('0x19')](handleError(_0xe6706f,null));};exports[_0x51b2('0x64')]=function(_0x18072a,_0x39a12c){return db['MailAccount'][_0x51b2('0x64')]()[_0x51b2('0xf')](respondWithResult(_0x39a12c,null))[_0x51b2('0x19')](handleError(_0x39a12c,null));};exports[_0x51b2('0x65')]=function(_0x19029b,_0x352bf5){if(_0x19029b[_0x51b2('0x5d')]['id']){delete _0x19029b[_0x51b2('0x5d')]['id'];}return db[_0x51b2('0x43')][_0x51b2('0x5c')]({'where':{'id':_0x19029b[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x352bf5,null))[_0x51b2('0xf')](function(_0x140ae2){if(_0x140ae2){_0x19029b[_0x51b2('0x5d')][_0x51b2('0x66')]=_0x140ae2['id'];return db[_0x51b2('0x67')][_0x51b2('0x68')](_0x19029b[_0x51b2('0x5d')]);}})[_0x51b2('0xf')](respondWithResult(_0x352bf5,null))[_0x51b2('0x19')](handleError(_0x352bf5,null));};exports[_0x51b2('0x69')]=function(_0x2a9ab8,_0x1a91d6){var _0x1b7e42={'raw':![],'where':{}};var _0x2355e5={};var _0x4b3f25={'count':0x0,'rows':[]};return db['MailAccount'][_0x51b2('0x6a')]({'where':{'id':_0x2a9ab8[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x1a91d6,null))['then'](function(_0x30b87e){if(_0x30b87e){_0x2355e5['model']=_['keys'](db[_0x51b2('0x67')][_0x51b2('0x44')]);_0x2355e5[_0x51b2('0x49')]=_[_0x51b2('0x4a')](_0x2a9ab8[_0x51b2('0x49')]);_0x2355e5[_0x51b2('0x53')]=_['intersection'](_0x2355e5[_0x51b2('0x48')],_0x2355e5[_0x51b2('0x49')]);_0x1b7e42[_0x51b2('0x4b')]=_['intersection'](_0x2355e5[_0x51b2('0x48')],qs['fields'](_0x2a9ab8['query']['fields']));_0x1b7e42['attributes']=_0x1b7e42['attributes'][_0x51b2('0x4e')]?_0x1b7e42[_0x51b2('0x4b')]:_0x2355e5[_0x51b2('0x48')];if(!_0x2a9ab8[_0x51b2('0x49')]['hasOwnProperty'](_0x51b2('0x4f'))){_0x1b7e42[_0x51b2('0x1e')]=qs[_0x51b2('0x1e')](_0x2a9ab8['query'][_0x51b2('0x1e')]);_0x1b7e42[_0x51b2('0x1c')]=qs[_0x51b2('0x1c')](_0x2a9ab8[_0x51b2('0x49')][_0x51b2('0x1c')]);}_0x1b7e42[_0x51b2('0x50')]=qs[_0x51b2('0x51')](_0x2a9ab8[_0x51b2('0x49')][_0x51b2('0x51')]);_0x1b7e42['where']=qs['filters'](_[_0x51b2('0x6b')](_0x2a9ab8['query'],_0x2355e5['filters']));_0x1b7e42[_0x51b2('0x52')][_0x51b2('0x66')]=_0x30b87e['id'];if(_0x2a9ab8[_0x51b2('0x49')][_0x51b2('0x56')]){_0x1b7e42[_0x51b2('0x52')]=_[_0x51b2('0x54')](_0x1b7e42[_0x51b2('0x52')],{'$or':_[_0x51b2('0x42')](_0x1b7e42[_0x51b2('0x4b')],function(_0x3ec0d6){var _0x1bd6bf={};_0x1bd6bf[_0x3ec0d6]={'$like':'%'+_0x2a9ab8[_0x51b2('0x49')]['filter']+'%'};return _0x1bd6bf;})});}_0x1b7e42=_[_0x51b2('0x54')]({},_0x1b7e42,_0x2a9ab8[_0x51b2('0x6c')]);return db[_0x51b2('0x67')][_0x51b2('0x1f')]({'where':_0x1b7e42[_0x51b2('0x52')]})['then'](function(_0x142c6e){_0x4b3f25[_0x51b2('0x1f')]=_0x142c6e;if(_0x2a9ab8[_0x51b2('0x49')][_0x51b2('0x57')]){_0x1b7e42[_0x51b2('0x58')]=[{'all':!![]}];}return db[_0x51b2('0x67')][_0x51b2('0x6d')](_0x1b7e42);})['then'](function(_0x4b94ca){_0x4b3f25['rows']=_0x4b94ca;return _0x4b3f25;});}})['then'](respondWithFilteredResult(_0x1a91d6,_0x1b7e42))[_0x51b2('0x19')](handleError(_0x1a91d6,null));};exports['removeDispositions']=function(_0x3349ee,_0x1e2d5c){return db[_0x51b2('0x43')][_0x51b2('0x5c')]({'where':{'id':_0x3349ee[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x1e2d5c,null))[_0x51b2('0xf')](function(_0x7f3312){if(_0x7f3312){return _0x7f3312[_0x51b2('0x6e')](_0x3349ee[_0x51b2('0x49')]['ids']);}})[_0x51b2('0xf')](respondWithStatusCode(_0x1e2d5c,null))['catch'](handleError(_0x1e2d5c,null));};exports[_0x51b2('0x6f')]=function(_0x2931c8,_0x47a598){if(_0x2931c8[_0x51b2('0x5d')]['id']){delete _0x2931c8[_0x51b2('0x5d')]['id'];}return db[_0x51b2('0x43')][_0x51b2('0x5c')]({'where':{'id':_0x2931c8[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x47a598,null))['then'](function(_0x11a7f2){if(_0x11a7f2){_0x2931c8[_0x51b2('0x5d')][_0x51b2('0x66')]=_0x11a7f2['id'];return db[_0x51b2('0x70')]['create'](_0x2931c8[_0x51b2('0x5d')]);}})['then'](respondWithResult(_0x47a598,null))[_0x51b2('0x19')](handleError(_0x47a598,null));};exports[_0x51b2('0x71')]=function(_0x123489,_0xf793e9){var _0x51ad08={'raw':![],'where':{}};var _0x6622e2={};var _0x5791a1={'count':0x0,'rows':[]};return db[_0x51b2('0x43')][_0x51b2('0x6a')]({'where':{'id':_0x123489[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0xf793e9,null))[_0x51b2('0xf')](function(_0x5bee2e){if(_0x5bee2e){_0x6622e2[_0x51b2('0x48')]=_['keys'](db[_0x51b2('0x70')][_0x51b2('0x44')]);_0x6622e2[_0x51b2('0x49')]=_['keys'](_0x123489[_0x51b2('0x49')]);_0x6622e2['filters']=_[_0x51b2('0x4c')](_0x6622e2[_0x51b2('0x48')],_0x6622e2[_0x51b2('0x49')]);_0x51ad08[_0x51b2('0x4b')]=_['intersection'](_0x6622e2[_0x51b2('0x48')],qs[_0x51b2('0x4d')](_0x123489[_0x51b2('0x49')][_0x51b2('0x4d')]));_0x51ad08[_0x51b2('0x4b')]=_0x51ad08['attributes']['length']?_0x51ad08['attributes']:_0x6622e2[_0x51b2('0x48')];if(!_0x123489[_0x51b2('0x49')]['hasOwnProperty']('nolimit')){_0x51ad08['limit']=qs[_0x51b2('0x1e')](_0x123489['query'][_0x51b2('0x1e')]);_0x51ad08[_0x51b2('0x1c')]=qs[_0x51b2('0x1c')](_0x123489['query']['offset']);}_0x51ad08[_0x51b2('0x50')]=qs[_0x51b2('0x51')](_0x123489['query'][_0x51b2('0x51')]);_0x51ad08[_0x51b2('0x52')]=qs[_0x51b2('0x53')](_['pick'](_0x123489[_0x51b2('0x49')],_0x6622e2[_0x51b2('0x53')]));_0x51ad08[_0x51b2('0x52')][_0x51b2('0x66')]=_0x5bee2e['id'];if(_0x123489[_0x51b2('0x49')]['filter']){_0x51ad08[_0x51b2('0x52')]=_[_0x51b2('0x54')](_0x51ad08[_0x51b2('0x52')],{'$or':_[_0x51b2('0x42')](_0x51ad08['attributes'],function(_0x39f6a1){var _0x4a3433={};_0x4a3433[_0x39f6a1]={'$like':'%'+_0x123489['query'][_0x51b2('0x56')]+'%'};return _0x4a3433;})});}_0x51ad08=_[_0x51b2('0x54')]({},_0x51ad08,_0x123489[_0x51b2('0x6c')]);return db[_0x51b2('0x70')][_0x51b2('0x1f')]({'where':_0x51ad08[_0x51b2('0x52')]})[_0x51b2('0xf')](function(_0x473fb8){_0x5791a1['count']=_0x473fb8;if(_0x123489['query'][_0x51b2('0x57')]){_0x51ad08['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x51b2('0x6d')](_0x51ad08);})[_0x51b2('0xf')](function(_0x1f3f8b){_0x5791a1[_0x51b2('0x59')]=_0x1f3f8b;return _0x5791a1;});}})[_0x51b2('0xf')](respondWithFilteredResult(_0xf793e9,_0x51ad08))['catch'](handleError(_0xf793e9,null));};exports[_0x51b2('0x72')]=function(_0x5f3fcd,_0x50e48e){return db[_0x51b2('0x43')]['find']({'where':{'id':_0x5f3fcd['params']['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x50e48e,null))['then'](function(_0xfa348f){if(_0xfa348f){return _0xfa348f[_0x51b2('0x72')](_0x5f3fcd[_0x51b2('0x49')][_0x51b2('0x73')]);}})[_0x51b2('0xf')](respondWithStatusCode(_0x50e48e,null))[_0x51b2('0x19')](handleError(_0x50e48e,null));};exports['create']=function(_0x412067,_0x1d179f){var _0xee9623={'name':_0x412067[_0x51b2('0x5d')][_0x51b2('0x26')],'key':_0x412067[_0x51b2('0x5d')][_0x51b2('0x47')],'provider':_0x412067[_0x51b2('0x5d')][_0x51b2('0x5e')]===_0x51b2('0x5f')?null:_0x412067[_0x51b2('0x5d')][_0x51b2('0x5e')],'email':_0x412067[_0x51b2('0x5d')]['email'],'ListId':_0x412067[_0x51b2('0x5d')][_0x51b2('0x74')],'active':!_['isNil'](_0x412067[_0x51b2('0x5d')]['active'])?_0x412067['body'][_0x51b2('0x75')]:!![],'description':_0x412067[_0x51b2('0x5d')]['description']||null};var _0x11a168=getAuthenticationOptions(_0xee9623[_0x51b2('0x5e')],_0x412067[_0x51b2('0x5d')]);_0xee9623[_0x51b2('0x3c')]=_0x11a168[_0x51b2('0x3c')];_0xee9623[_0x51b2('0x3d')]=_0x11a168[_0x51b2('0x3d')];return db[_0x51b2('0x43')][_0x51b2('0x68')](_0xee9623,{'include':[{'model':db[_0x51b2('0x5b')],'as':'Smtp'},{'model':db[_0x51b2('0x3f')],'as':'Imap'}]})['then'](function(_0x5f22ca){var _0x4b673e=_0x412067[_0x51b2('0x32')]['get']({'plain':!![]});if(!_0x4b673e)throw new Error(_0x51b2('0x76'));if(_0x4b673e['role']==='user'){var _0x2d5e95=_0x5f22ca[_0x51b2('0x77')]({'plain':!![]});return db[_0x51b2('0x78')][_0x51b2('0x5c')]({'where':{'name':_0x51b2('0x22'),'userProfileId':_0x4b673e[_0x51b2('0x79')]},'raw':!![]})['then'](function(_0x503a58){if(_0x503a58&&_0x503a58[_0x51b2('0x7a')]===0x0){return db['UserProfileResource'][_0x51b2('0x68')]({'name':_0x2d5e95[_0x51b2('0x26')],'resourceId':_0x2d5e95['id'],'type':_0x503a58['name'],'sectionId':_0x503a58['id']},{})['then'](function(){return _0x5f22ca;});}else{return _0x5f22ca;}})['catch'](function(_0xdd420a){logger[_0x51b2('0x15')](_0x51b2('0x7b'),_0xdd420a);throw _0xdd420a;});}return _0x5f22ca;})['then'](respondWithResult(_0x1d179f,0xc9))[_0x51b2('0x19')](handleError(_0x1d179f,null));};exports[_0x51b2('0x7c')]=function(_0x34c4d9,_0xc68c1b){return db[_0x51b2('0x43')]['findOne']({'where':{'id':_0x34c4d9[_0x51b2('0x60')]['id']}})['then'](handleEntityNotFound(_0xc68c1b,null))[_0x51b2('0xf')](function(_0x1bd44d){if(_0x1bd44d){return _0x1bd44d[_0x51b2('0x7c')]();}return null;})[_0x51b2('0xf')](respondWithResult(_0xc68c1b,null))[_0x51b2('0x19')](handleError(_0xc68c1b,null));};exports[_0x51b2('0x7d')]=function(_0x2a24c5,_0x49e02d){if(_0x2a24c5[_0x51b2('0x5d')]['id']){delete _0x2a24c5[_0x51b2('0x5d')]['id'];}return db['MailAccount'][_0x51b2('0x5c')]({'where':{'id':_0x2a24c5[_0x51b2('0x60')]['id']}})['then'](handleEntityNotFound(_0x49e02d,null))[_0x51b2('0xf')](function(_0x32f3f7){if(_0x32f3f7){_0x2a24c5[_0x51b2('0x5d')][_0x51b2('0x66')]=_0x32f3f7['id'];return db['MailServerIn'][_0x51b2('0x68')](_0x2a24c5[_0x51b2('0x5d')]);}})[_0x51b2('0xf')](respondWithResult(_0x49e02d,null))['catch'](handleError(_0x49e02d,null));};exports[_0x51b2('0x7e')]=function(_0x3527d9,_0x56430c){return db[_0x51b2('0x43')][_0x51b2('0x6a')]({'where':{'id':_0x3527d9['params']['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x56430c,null))['then'](function(_0x5cdce9){if(_0x5cdce9){return _0x5cdce9[_0x51b2('0x7f')](null);}return null;})[_0x51b2('0xf')](respondWithStatusCode(_0x56430c,null))[_0x51b2('0x19')](handleError(_0x56430c,null));};exports['getSmtp']=function(_0x5703ac,_0x2414b5){return db[_0x51b2('0x43')][_0x51b2('0x6a')]({'where':{'id':_0x5703ac['params']['id']}})['then'](handleEntityNotFound(_0x2414b5,null))[_0x51b2('0xf')](function(_0x3dfeac){if(_0x3dfeac){return _0x3dfeac[_0x51b2('0x80')]();}return null;})[_0x51b2('0xf')](respondWithResult(_0x2414b5,null))[_0x51b2('0x19')](handleError(_0x2414b5,null));};exports[_0x51b2('0x81')]=function(_0x587585,_0x43bd61){if(_0x587585[_0x51b2('0x5d')]['id']){delete _0x587585['body']['id'];}return db[_0x51b2('0x43')][_0x51b2('0x5c')]({'where':{'id':_0x587585[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x43bd61,null))[_0x51b2('0xf')](function(_0x5c0c5e){if(_0x5c0c5e){_0x587585[_0x51b2('0x5d')][_0x51b2('0x66')]=_0x5c0c5e['id'];return db[_0x51b2('0x5b')][_0x51b2('0x68')](_0x587585['body']);}})[_0x51b2('0xf')](respondWithResult(_0x43bd61,null))[_0x51b2('0x19')](handleError(_0x43bd61,null));};exports[_0x51b2('0x82')]=function(_0x2834f3,_0x269d8e){return db['MailAccount']['findOne']({'where':{'id':_0x2834f3[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x269d8e,null))['then'](function(_0x9917dc){if(_0x9917dc){return _0x9917dc['setSmtp'](null);}return null;})[_0x51b2('0xf')](respondWithStatusCode(_0x269d8e,null))[_0x51b2('0x19')](handleError(_0x269d8e,null));};exports[_0x51b2('0x83')]=function(_0x2d5640,_0x4cffc5){return db[_0x51b2('0x84')][_0x51b2('0x5c')]({'where':{'id':_0x2d5640['params']['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x4cffc5,null))[_0x51b2('0xf')](function(_0x156f12){if(_0x156f12){return _0x156f12[_0x51b2('0x83')](_0x2d5640['body'][_0x51b2('0x73')],_[_0x51b2('0x85')](_0x2d5640[_0x51b2('0x5d')],['ids','id'])||{});}})[_0x51b2('0xf')](respondWithResult(_0x4cffc5,null))[_0x51b2('0x19')](handleError(_0x4cffc5,null));};exports[_0x51b2('0x86')]=function(_0x4c4227,_0x5aafc2){var _0x4efb13={'raw':![],'where':{}};var _0x5b007b={};var _0xeb5ce={'count':0x0,'rows':[]};return db[_0x51b2('0x43')]['findOne']({'where':{'id':_0x4c4227[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x5aafc2,null))[_0x51b2('0xf')](function(_0x1503c0){if(_0x1503c0){_0x5b007b[_0x51b2('0x48')]=_[_0x51b2('0x4a')](db[_0x51b2('0x84')]['rawAttributes']);_0x5b007b[_0x51b2('0x49')]=_[_0x51b2('0x4a')](_0x4c4227[_0x51b2('0x49')]);_0x5b007b['filters']=_[_0x51b2('0x4c')](_0x5b007b[_0x51b2('0x48')],_0x5b007b[_0x51b2('0x49')]);_0x4efb13[_0x51b2('0x4b')]=_['intersection'](_0x5b007b[_0x51b2('0x48')],qs[_0x51b2('0x4d')](_0x4c4227['query'][_0x51b2('0x4d')]));_0x4efb13[_0x51b2('0x4b')]=_0x4efb13[_0x51b2('0x4b')][_0x51b2('0x4e')]?_0x4efb13[_0x51b2('0x4b')]:_0x5b007b[_0x51b2('0x48')];if(!_0x4c4227['query']['hasOwnProperty'](_0x51b2('0x4f'))){_0x4efb13[_0x51b2('0x1e')]=qs[_0x51b2('0x1e')](_0x4c4227[_0x51b2('0x49')][_0x51b2('0x1e')]);_0x4efb13[_0x51b2('0x1c')]=qs[_0x51b2('0x1c')](_0x4c4227[_0x51b2('0x49')][_0x51b2('0x1c')]);}_0x4efb13[_0x51b2('0x50')]=qs[_0x51b2('0x51')](_0x4c4227['query'][_0x51b2('0x51')]);_0x4efb13[_0x51b2('0x52')]=qs[_0x51b2('0x53')](_['pick'](_0x4c4227[_0x51b2('0x49')],_0x5b007b[_0x51b2('0x53')]));_0x4efb13[_0x51b2('0x52')]['MailAccountId']=_0x1503c0['id'];if(_0x4c4227[_0x51b2('0x49')]['filter']){_0x4efb13['where']=_[_0x51b2('0x54')](_0x4efb13[_0x51b2('0x52')],{'$or':_['map'](_0x4efb13[_0x51b2('0x4b')],function(_0x500c89){var _0x4468fc={};_0x4468fc[_0x500c89]={'$like':'%'+_0x4c4227[_0x51b2('0x49')][_0x51b2('0x56')]+'%'};return _0x4468fc;})});}_0x4efb13=_[_0x51b2('0x54')]({},_0x4efb13,_0x4c4227[_0x51b2('0x6c')]);return db['MailInteraction']['count']({'where':_0x4efb13[_0x51b2('0x52')]})[_0x51b2('0xf')](function(_0x139918){_0xeb5ce[_0x51b2('0x1f')]=_0x139918;if(_0x4c4227[_0x51b2('0x49')][_0x51b2('0x57')]){_0x4efb13[_0x51b2('0x58')]=[{'model':db[_0x51b2('0x87')],'as':_0x51b2('0x88'),'required':![]},{'model':db[_0x51b2('0x89')],'as':'Owner','attributes':['name',_0x51b2('0x8a'),'internal'],'required':![]},{'model':db[_0x51b2('0x8b')],'as':_0x51b2('0x8c'),'attributes':['id',_0x51b2('0x26'),'color'],'where':_0x4c4227[_0x51b2('0x49')][_0x51b2('0x8d')]?{'id':_0x4c4227[_0x51b2('0x49')][_0x51b2('0x8d')]}:undefined,'required':_0x4c4227[_0x51b2('0x49')]['tag']?!![]:![]}];}return db[_0x51b2('0x84')][_0x51b2('0x6d')](_0x4efb13);})['then'](function(_0x28a764){_0xeb5ce[_0x51b2('0x59')]=_0x28a764;return _0xeb5ce;});}})[_0x51b2('0xf')](respondWithFilteredResult(_0x5aafc2,_0x4efb13))['catch'](handleError(_0x5aafc2,null));};exports[_0x51b2('0x8e')]=function addApplications(_0xc5e513,_0x14d4f8){var _0x5e6dd3=_0xc5e513[_0x51b2('0x60')]['id'];var _0x1dcce9=_0xc5e513[_0x51b2('0x5d')];var _0x178dc8=0xc8;var _0x463ff4=null;return db[_0x51b2('0x8f')][_0x51b2('0x90')]({'isolationLevel':db[_0x51b2('0x8f')][_0x51b2('0x91')]['ISOLATION_LEVELS'][_0x51b2('0x92')]},function(_0x4ed630){return db['MailAccount'][_0x51b2('0x6a')]({'where':{'id':_0x5e6dd3},'transaction':_0x4ed630})[_0x51b2('0xf')](function(_0x27ebec){if(_0x27ebec){return db[_0x51b2('0x93')][_0x51b2('0x94')]({'where':{'MailAccountId':_0x5e6dd3},'transaction':_0x4ed630})[_0x51b2('0xf')](function(){var _0x2c50d8=_[_0x51b2('0x42')](_0x1dcce9,function(_0x5b9e08){_0x5b9e08['MailAccountId']=_0x5e6dd3;return _0x5b9e08;});return db['MailApplication'][_0x51b2('0x95')](_0x2c50d8,{'transaction':_0x4ed630});});}else{_0x178dc8=0x194;_0x463ff4=[];}});})[_0x51b2('0xf')](function(){if(_0x178dc8!==0x194){return db['MailApplication'][_0x51b2('0x96')]({'where':{'MailAccountId':_0x5e6dd3},'order':_0x51b2('0x97')})[_0x51b2('0xf')](function(_0x3b2602){_0x463ff4=_0x3b2602;});}})[_0x51b2('0x19')](function(_0x140979){_0x178dc8=0x1f4;logger[_0x51b2('0x15')](_0x140979['stack']);if(_0x140979[_0x51b2('0x26')]){delete _0x140979[_0x51b2('0x26')];}_0x463ff4=_0x140979;})['finally'](function(){if(_0x463ff4===null){_0x14d4f8[_0x51b2('0x24')](_0x178dc8);}else{if(_0x178dc8===0x1f4){_0x14d4f8[_0x51b2('0x1a')](_0x178dc8)['send'](_0x463ff4);}else{_0x14d4f8['status'](_0x178dc8)['json'](_0x463ff4);}}});};exports[_0x51b2('0x98')]=function(_0x526dd1,_0x4f9bdf){var _0x1cafdd={};var _0xa40a19={};var _0x226258;var _0xb5b4bc;return db[_0x51b2('0x43')][_0x51b2('0x6a')]({'where':{'id':_0x526dd1['params']['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x4f9bdf,null))['then'](function(_0x38ddca){if(_0x38ddca){_0x226258=_0x38ddca;_0xa40a19[_0x51b2('0x48')]=_[_0x51b2('0x4a')](db[_0x51b2('0x93')][_0x51b2('0x44')]);_0xa40a19['query']=_[_0x51b2('0x4a')](_0x526dd1[_0x51b2('0x49')]);_0xa40a19[_0x51b2('0x53')]=_[_0x51b2('0x4c')](_0xa40a19[_0x51b2('0x48')],_0xa40a19[_0x51b2('0x49')]);_0x1cafdd[_0x51b2('0x4b')]=_[_0x51b2('0x4c')](_0xa40a19[_0x51b2('0x48')],qs['fields'](_0x526dd1['query'][_0x51b2('0x4d')]));_0x1cafdd[_0x51b2('0x4b')]=_0x1cafdd['attributes'][_0x51b2('0x4e')]?_0x1cafdd[_0x51b2('0x4b')]:_0xa40a19['model'];_0x1cafdd['order']=qs['sort'](_0x526dd1[_0x51b2('0x49')]['sort']);_0x1cafdd['where']=qs[_0x51b2('0x53')](_['pick'](_0x526dd1[_0x51b2('0x49')],_0xa40a19[_0x51b2('0x53')]));if(_0x526dd1[_0x51b2('0x49')]['filter']){_0x1cafdd[_0x51b2('0x52')]=_[_0x51b2('0x54')](_0x1cafdd[_0x51b2('0x52')],{'$or':_[_0x51b2('0x42')](_0x1cafdd[_0x51b2('0x4b')],function(_0x1b9b34){var _0x48914c={};_0x48914c[_0x1b9b34]={'$like':'%'+_0x526dd1[_0x51b2('0x49')][_0x51b2('0x56')]+'%'};return _0x48914c;})});}_0x1cafdd=_[_0x51b2('0x54')]({},_0x1cafdd,_0x526dd1[_0x51b2('0x6c')]);return _0x226258[_0x51b2('0x98')](_0x1cafdd);}})['then'](function(_0x4b94a2){if(_0x4b94a2){_0xb5b4bc=_0x4b94a2['length'];if(!_0x526dd1[_0x51b2('0x49')][_0x51b2('0x99')](_0x51b2('0x4f'))){_0x1cafdd[_0x51b2('0x1e')]=qs[_0x51b2('0x1e')](_0x526dd1[_0x51b2('0x49')]['limit']);_0x1cafdd[_0x51b2('0x1c')]=qs[_0x51b2('0x1c')](_0x526dd1[_0x51b2('0x49')][_0x51b2('0x1c')]);}return _0x226258[_0x51b2('0x98')](_0x1cafdd);}})[_0x51b2('0xf')](function(_0x16634a){if(_0x16634a){return _0x16634a?{'count':_0xb5b4bc,'rows':_0x16634a}:null;}})[_0x51b2('0xf')](respondWithResult(_0x4f9bdf,null))[_0x51b2('0x19')](handleError(_0x4f9bdf,null));};exports['getMessages']=function(_0x336abf,_0x70f593){var _0xf136d={'raw':!![],'where':{}};var _0x9fa62f={};var _0x4cca68={'count':0x0,'rows':[]};return db[_0x51b2('0x43')][_0x51b2('0x6a')]({'where':{'id':_0x336abf[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x70f593,null))[_0x51b2('0xf')](function(_0x271a26){if(_0x271a26){_0x9fa62f[_0x51b2('0x48')]=_[_0x51b2('0x4a')](db[_0x51b2('0x9a')][_0x51b2('0x44')]);_0x9fa62f[_0x51b2('0x49')]=_[_0x51b2('0x4a')](_0x336abf['query']);_0x9fa62f[_0x51b2('0x53')]=_[_0x51b2('0x4c')](_0x9fa62f[_0x51b2('0x48')],_0x9fa62f[_0x51b2('0x49')]);_0xf136d[_0x51b2('0x4b')]=_[_0x51b2('0x4c')](_0x9fa62f[_0x51b2('0x48')],qs[_0x51b2('0x4d')](_0x336abf[_0x51b2('0x49')][_0x51b2('0x4d')]));_0xf136d[_0x51b2('0x4b')]=_0xf136d[_0x51b2('0x4b')][_0x51b2('0x4e')]?_0xf136d['attributes']:_0x9fa62f[_0x51b2('0x48')];if(!_0x336abf[_0x51b2('0x49')][_0x51b2('0x99')]('nolimit')){_0xf136d[_0x51b2('0x1e')]=qs[_0x51b2('0x1e')](_0x336abf['query']['limit']);_0xf136d[_0x51b2('0x1c')]=qs['offset'](_0x336abf[_0x51b2('0x49')][_0x51b2('0x1c')]);}_0xf136d['order']=qs[_0x51b2('0x51')](_0x336abf[_0x51b2('0x49')][_0x51b2('0x51')]);_0xf136d[_0x51b2('0x52')]=qs[_0x51b2('0x53')](_[_0x51b2('0x6b')](_0x336abf[_0x51b2('0x49')],_0x9fa62f[_0x51b2('0x53')]));_0xf136d[_0x51b2('0x52')][_0x51b2('0x66')]=_0x271a26['id'];if(_0x336abf['query'][_0x51b2('0x56')]){_0xf136d[_0x51b2('0x52')]=_[_0x51b2('0x54')](_0xf136d[_0x51b2('0x52')],{'$or':_['map'](_0xf136d['attributes'],function(_0x2b7247){var _0x1d9c68={};_0x1d9c68[_0x2b7247]={'$like':'%'+_0x336abf[_0x51b2('0x49')][_0x51b2('0x56')]+'%'};return _0x1d9c68;})});}if(_0x336abf[_0x51b2('0x49')][_0x51b2('0x9b')]){var _0x66a0f1=_0x336abf[_0x51b2('0x49')][_0x51b2('0x9b')][_0x51b2('0x9c')](',');var _0x2e00cf={};_0x2e00cf[_0x66a0f1[0x0]]={'$gte':moment(_0x66a0f1[0x1])[_0x51b2('0x9d')](_0x51b2('0x9e'))};_0xf136d['where']=_['merge'](_0xf136d[_0x51b2('0x52')],_0x2e00cf);}_0xf136d=_['merge']({},_0xf136d,_0x336abf[_0x51b2('0x6c')]);return db[_0x51b2('0x9a')][_0x51b2('0x1f')]({'where':_0xf136d[_0x51b2('0x52')]})[_0x51b2('0xf')](function(_0x3baa9d){_0x4cca68[_0x51b2('0x1f')]=_0x3baa9d;if(_0x336abf['query'][_0x51b2('0x57')]){_0xf136d[_0x51b2('0x58')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0xf136d);})[_0x51b2('0xf')](function(_0x14d938){if(_0x336abf['query'][_0x51b2('0x9f')]===_0x51b2('0xa0')){for(var _0x1dd13a=0x0;_0x1dd13a<_0x14d938[_0x51b2('0x4e')];_0x1dd13a++){_0x14d938[_0x1dd13a][_0x51b2('0x5d')]=juice(_0x14d938[_0x1dd13a][_0x51b2('0x5d')]);}}_0x4cca68[_0x51b2('0x59')]=_0x14d938;return _0x4cca68;});}})[_0x51b2('0xf')](respondWithFilteredResult(_0x70f593,_0xf136d))['catch'](handleError(_0x70f593,null));};exports[_0x51b2('0x27')]=function(_0xaeb9e3,_0x4d5ad1){var _0x4774ad,_0x25791f={},_0x27c0eb;if(_0xaeb9e3['body']['to']){_0x27c0eb=_0xaeb9e3['body']['to'][_0x51b2('0x9c')](',')[0x0];}return db[_0x51b2('0x43')][_0x51b2('0x5c')]({'where':{'id':_0xaeb9e3[_0x51b2('0x60')]['id']},'include':[{'model':db[_0x51b2('0xa1')],'as':_0x51b2('0xa2'),'include':[{'model':db[_0x51b2('0x87')],'as':_0x51b2('0xa3'),'where':{'email':_0x27c0eb},'limit':0x1,'order':[[_0x51b2('0xa4'),_0x51b2('0xa5')]]}]},{'model':db[_0x51b2('0x5b')],'as':_0x51b2('0x3d'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x51b2('0xa6'),'raw':!![]}]}]})[_0x51b2('0xf')](handleEntityNotFound(_0x4d5ad1,null))[_0x51b2('0xf')](function(_0x55430f){if(!_0x55430f)return;_0x4774ad=_0x55430f;if(!_0x55430f['Smtp'])throw new Error(_0x51b2('0xa7'));if(_['isNil'](_0xaeb9e3[_0x51b2('0x5d')][_0x51b2('0xa8')])){_0xaeb9e3['body'][_0x51b2('0xa8')]=util[_0x51b2('0x9d')](_0x51b2('0xa9'),_0x55430f['name'],_0x55430f[_0x51b2('0xaa')]||_0x55430f[_0x51b2('0x3d')][_0x51b2('0x32')]);}if(_0xaeb9e3['body'][_0x51b2('0xab')]&&_0xaeb9e3['body'][_0x51b2('0xab')]['length']){for(var _0x56fce3=0x0;_0x56fce3<_0xaeb9e3[_0x51b2('0x5d')][_0x51b2('0xab')][_0x51b2('0x4e')];_0x56fce3+=0x1){_0xaeb9e3['body'][_0x51b2('0xab')][_0x56fce3]={'filename':_0xaeb9e3[_0x51b2('0x5d')][_0x51b2('0xab')][_0x56fce3][_0x51b2('0x26')],'path':path['join'](config[_0x51b2('0xac')],_0x51b2('0xad'),_0xaeb9e3['body']['attachments'][_0x56fce3][_0x51b2('0xae')])};}}var _0x14f9f1=_0x55430f['getSmtpOptions']();return respondWithRpcPromise(_0x51b2('0xaf'),_0x51b2('0xb0'),{'account':_0x14f9f1,'message':_0xaeb9e3[_0x51b2('0x5d')]});})[_0x51b2('0xf')](function(_0x5a534c){if(!_0x5a534c)return;_0x25791f=_0x5a534c;if(!_0x4774ad[_0x51b2('0xa2')])throw new Error('List\x20not\x20found');if(_0x4774ad[_0x51b2('0xa2')][_0x51b2('0xa3')][_0x51b2('0x4e')])return _0x4774ad[_0x51b2('0xa2')][_0x51b2('0xa3')][0x0];return db[_0x51b2('0x87')][_0x51b2('0x68')](_[_0x51b2('0xb1')](_0xaeb9e3['body'],{'firstName':_0xaeb9e3[_0x51b2('0x5d')]['to'],'email':_0xaeb9e3['body']['to'],'phone':_0xaeb9e3['body']['to'],'ListId':_0x4774ad['ListId']}));})[_0x51b2('0xf')](function(_0x190f62){if(!_0x190f62)return;var _0x5007ff={'UserId':_0xaeb9e3['user']['id'],'ContactId':_0x190f62['id'],'MailAccountId':_0x4774ad['id'],'inReplyTo':_0x25791f['messageId'],'to':_0xaeb9e3[_0x51b2('0x5d')][_0x51b2('0xa8')],'cc':_0xaeb9e3['body']['cc'],'subject':_0xaeb9e3['body'][_0x51b2('0xb2')],'attach':_0xaeb9e3[_0x51b2('0x5d')]['attach'],'firstMsgDirection':_0x51b2('0xb3'),'lastMsgAt':moment()[_0x51b2('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x51b2('0xb3'),'Messages':[_[_0x51b2('0x54')](_0xaeb9e3[_0x51b2('0x5d')],{'messageId':_0x25791f[_0x51b2('0xb4')],'sentAt':moment()[_0x51b2('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x4774ad['id'],'UserId':_0xaeb9e3[_0x51b2('0x32')]['id'],'ContactId':_0x190f62['id']})]};if(_0xaeb9e3['body'][_0x51b2('0xb5')]){_0x5007ff=_[_0x51b2('0x54')](_0x5007ff,_0xaeb9e3[_0x51b2('0x5d')][_0x51b2('0xb5')]);}return db[_0x51b2('0x84')][_0x51b2('0x68')](_0x5007ff,{'include':[{'model':db['MailMessage'],'as':_0x51b2('0xb6')}]});})['then'](respondWithResult(_0x4d5ad1,null))[_0x51b2('0x19')](handleError(_0x4d5ad1,null));};exports[_0x51b2('0xb7')]=function(_0x31995e,_0x41ebe0){return db[_0x51b2('0x43')][_0x51b2('0x5c')]({'where':{'id':_0x31995e[_0x51b2('0x60')]['id']},'include':[{'model':db[_0x51b2('0x5b')],'as':_0x51b2('0x3d'),'raw':!![],'include':[{'model':db[_0x51b2('0xa6')],'as':'CloudProvider','raw':!![]}]}]})[_0x51b2('0xf')](handleEntityNotFound(_0x41ebe0,null))[_0x51b2('0xf')](function(_0x211ed5){if(!_0x211ed5['Smtp'])return;var _0x5c8b2e=_0x211ed5[_0x51b2('0xb8')]();return respondWithRpcPromise(_0x51b2('0xb9'),'verifySmtp',{'account':_0x5c8b2e});})[_0x51b2('0xf')](respondWithResult(_0x41ebe0,null))['catch'](handleError(_0x41ebe0,null));};exports[_0x51b2('0x94')]=function(_0x13fcec,_0x20df3c){return db['MailAccount']['find']({'where':{'id':_0x13fcec[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x20df3c,null))[_0x51b2('0xf')](function(_0x802d3b){if(_0x802d3b&&_0x802d3b[_0x51b2('0x62')]){throw new db['Sequelize'][(_0x51b2('0xba'))](_0x51b2('0xbb'));}return _0x802d3b;})[_0x51b2('0xf')](removeEntity(_0x20df3c,null))[_0x51b2('0x19')](handleError(_0x20df3c,null));};exports[_0x51b2('0xbc')]=function(_0x3007e1,_0x47d742){return db[_0x51b2('0x43')]['find']({'where':{'id':_0x3007e1[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x47d742,null))[_0x51b2('0xf')](function(_0x4e363a){if(_0x4e363a){return _0x4e363a['addAgents'](_0x3007e1[_0x51b2('0x5d')][_0x51b2('0x73')],_[_0x51b2('0x85')](_0x3007e1[_0x51b2('0x5d')],[_0x51b2('0x73'),'id'])||{})[_0x51b2('0xbd')](function(_0x274b68){for(var _0x488059=0x0;_0x488059<_0x3007e1['body'][_0x51b2('0x73')]['length'];_0x488059+=0x1){socket[_0x51b2('0xbe')]('userMailAccount:save',{'UserId':Number(_0x3007e1[_0x51b2('0x5d')][_0x51b2('0x73')][_0x488059]),'MailAccountId':Number(_0x3007e1['params']['id'])});}return _0x274b68;});}})['then'](respondWithResult(_0x47d742,null))[_0x51b2('0x19')](handleError(_0x47d742,null));};exports[_0x51b2('0xbf')]=function(_0xc3dc85,_0x577b2d){return db['MailAccount'][_0x51b2('0x5c')]({'where':{'id':_0xc3dc85['params']['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x577b2d,null))[_0x51b2('0xf')](function(_0x295e0d){if(_0x295e0d){return _0x295e0d[_0x51b2('0xbf')](_0xc3dc85['query'][_0x51b2('0x73')])[_0x51b2('0xf')](function(){if(_[_0x51b2('0xc0')](_0xc3dc85['query']['ids'])){for(var _0x1b22df=0x0;_0x1b22df<_0xc3dc85[_0x51b2('0x49')][_0x51b2('0x73')][_0x51b2('0x4e')];_0x1b22df+=0x1){socket[_0x51b2('0xbe')]('userMailAccount:remove',{'UserId':Number(_0xc3dc85[_0x51b2('0x49')][_0x51b2('0x73')][_0x1b22df]),'MailAccountId':Number(_0xc3dc85[_0x51b2('0x60')]['id'])});}}else{socket['emit'](_0x51b2('0xc1'),{'UserId':Number(_0xc3dc85[_0x51b2('0x49')][_0x51b2('0x73')]),'MailAccountId':Number(_0xc3dc85[_0x51b2('0x60')]['id'])});}});}})[_0x51b2('0xf')](respondWithStatusCode(_0x577b2d,null))[_0x51b2('0x19')](handleError(_0x577b2d,null));};exports[_0x51b2('0xc2')]=function(_0x25e3b7,_0x23f97b){var _0x25ffd7={};var _0x2cf238={};var _0x3a7ac8;var _0x20fd62;return db[_0x51b2('0x43')]['findOne']({'where':{'id':_0x25e3b7[_0x51b2('0x60')]['id']}})[_0x51b2('0xf')](handleEntityNotFound(_0x23f97b,null))[_0x51b2('0xf')](function(_0x19c530){if(_0x19c530){_0x3a7ac8=_0x19c530;_0x2cf238[_0x51b2('0x48')]=_[_0x51b2('0x4a')](db[_0x51b2('0x89')]['rawAttributes']);_0x2cf238[_0x51b2('0x49')]=_['keys'](_0x25e3b7[_0x51b2('0x49')]);_0x2cf238[_0x51b2('0x53')]=_[_0x51b2('0x4c')](_0x2cf238[_0x51b2('0x48')],_0x2cf238[_0x51b2('0x49')]);_0x25ffd7[_0x51b2('0x4b')]=_['intersection'](_0x2cf238['model'],qs[_0x51b2('0x4d')](_0x25e3b7[_0x51b2('0x49')]['fields']));_0x25ffd7[_0x51b2('0x4b')]=_0x25ffd7[_0x51b2('0x4b')]['length']?_0x25ffd7['attributes']:_0x2cf238['model'];_0x25ffd7[_0x51b2('0x50')]=qs[_0x51b2('0x51')](_0x25e3b7[_0x51b2('0x49')][_0x51b2('0x51')]);_0x25ffd7[_0x51b2('0x52')]=qs[_0x51b2('0x53')](_[_0x51b2('0x6b')](_0x25e3b7[_0x51b2('0x49')],_0x2cf238[_0x51b2('0x53')]));if(_0x25e3b7[_0x51b2('0x49')][_0x51b2('0x56')]){_0x25ffd7['where']=_[_0x51b2('0x54')](_0x25ffd7[_0x51b2('0x52')],{'$or':_['map'](_0x25ffd7[_0x51b2('0x4b')],function(_0x2308e5){var _0x4f3a7e={};_0x4f3a7e[_0x2308e5]={'$like':'%'+_0x25e3b7[_0x51b2('0x49')]['filter']+'%'};return _0x4f3a7e;})});}_0x25ffd7=_[_0x51b2('0x54')]({},_0x25ffd7,_0x25e3b7[_0x51b2('0x6c')]);return _0x3a7ac8[_0x51b2('0xc2')](_0x25ffd7);}})['then'](function(_0x1e99de){if(_0x1e99de){_0x20fd62=_0x1e99de[_0x51b2('0x4e')];if(!_0x25e3b7[_0x51b2('0x49')][_0x51b2('0x99')](_0x51b2('0x4f'))){_0x25ffd7[_0x51b2('0x1e')]=qs[_0x51b2('0x1e')](_0x25e3b7[_0x51b2('0x49')]['limit']);_0x25ffd7[_0x51b2('0x1c')]=qs[_0x51b2('0x1c')](_0x25e3b7[_0x51b2('0x49')]['offset']);}return _0x3a7ac8['getAgents'](_0x25ffd7);}})[_0x51b2('0xf')](function(_0x543d15){if(_0x543d15){return _0x543d15?{'count':_0x20fd62,'rows':_0x543d15}:null;}})[_0x51b2('0xf')](respondWithResult(_0x23f97b,null))[_0x51b2('0x19')](handleError(_0x23f97b,null));}; \ No newline at end of file +var _0x5bbf=['userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','update','MailAccounts','destroy','stack','name','send','gmail','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','options','findAll','rows','params','rawAttributes','body','provider','custom','secure','MailServerIn','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','merge','includeAll','include','removeDispositions','find','getAnswers','CannedAnswer','hasOwnProperty','removeAnswers','create','email','ListId','isNil','active','description','get','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','ids','omit','getInteractions','CmContact','User','Owner','fullname','internal','Tag','color','tag','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','finally','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','format','%s\x20<%s>','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','List','messageId','from','subject','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents'];(function(_0xe616ea,_0x4acffb){var _0x186020=function(_0x43c9db){while(--_0x43c9db){_0xe616ea['push'](_0xe616ea['shift']());}};_0x186020(++_0x4acffb);}(_0x5bbf,0x18a));var _0xf5bb=function(_0x19dc2d,_0x2b4a8b){_0x19dc2d=_0x19dc2d-0x0;var _0x145a78=_0x5bbf[_0x19dc2d];return _0x145a78;};'use strict';var moment=require(_0xf5bb('0x0'));var BPromise=require(_0xf5bb('0x1'));var util=require(_0xf5bb('0x2'));var path=require(_0xf5bb('0x3'));var _=require(_0xf5bb('0x4'));var juice=require(_0xf5bb('0x5'));var Redis=require(_0xf5bb('0x6'));var qs=require(_0xf5bb('0x7'));var logger=require(_0xf5bb('0x8'))(_0xf5bb('0x9'));var config=require(_0xf5bb('0xa'));var db=require(_0xf5bb('0xb'))['db'];config[_0xf5bb('0xc')]=_[_0xf5bb('0xd')](config[_0xf5bb('0xc')],{'host':_0xf5bb('0xe'),'port':0x18eb});var socket=require(_0xf5bb('0xf'))(new Redis(config[_0xf5bb('0xc')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xf5bb('0x10'));var client=jayson[_0xf5bb('0x11')]['http']({'port':0x232b});function respondWithRpcPromise(_0x3bc0db,_0x1230a6,_0xd5f276,_0xc95250){return new BPromise(function(_0x38c3cd,_0x439dd5){var _0x380c40=_0xc95250||client;return _0x380c40[_0xf5bb('0x12')](_0x3bc0db,_0xd5f276)[_0xf5bb('0x13')](function(_0x18437c){logger[_0xf5bb('0x14')](_0xf5bb('0x15'),_0x1230a6,_0xf5bb('0x16'));logger[_0xf5bb('0x17')](_0xf5bb('0x18'),_0x1230a6,_0xf5bb('0x16'),JSON[_0xf5bb('0x19')](_0x18437c));if(_0x18437c[_0xf5bb('0x1a')]){if(_0x18437c[_0xf5bb('0x1a')][_0xf5bb('0x1b')]===0x1f4){logger[_0xf5bb('0x1a')]('MailAccount,\x20%s,\x20%s',_0x1230a6,_0x18437c[_0xf5bb('0x1a')][_0xf5bb('0x1c')]);return _0x439dd5(_0x18437c[_0xf5bb('0x1a')]['message']);}logger[_0xf5bb('0x1a')]('MailAccount,\x20%s,\x20%s',_0x1230a6,_0x18437c[_0xf5bb('0x1a')]['message']);return _0x38c3cd(_0x18437c[_0xf5bb('0x1a')]['message']);}else{logger[_0xf5bb('0x14')]('MailAccount,\x20%s,\x20%s',_0x1230a6,_0xf5bb('0x16'));_0x38c3cd(_0x18437c['result'][_0xf5bb('0x1c')]);}})[_0xf5bb('0x1d')](function(_0x123749){logger['error'](_0xf5bb('0x15'),_0x1230a6,_0x123749);_0x439dd5(_0x123749);});});}function respondWithStatusCode(_0x29a5af,_0x9ae04a){_0x9ae04a=_0x9ae04a||0xcc;return function(_0x857037){if(_0x857037){return _0x29a5af[_0xf5bb('0x1e')](_0x9ae04a);}return _0x29a5af[_0xf5bb('0x1f')](_0x9ae04a)[_0xf5bb('0x20')]();};}function respondWithResult(_0x547bb2,_0x2bad91){_0x2bad91=_0x2bad91||0xc8;return function(_0x451e9a){if(_0x451e9a){return _0x547bb2[_0xf5bb('0x1f')](_0x2bad91)[_0xf5bb('0x21')](_0x451e9a);}};}function respondWithFilteredResult(_0x28289c,_0x36d7bf){return function(_0x5c4be0){if(_0x5c4be0){var _0xebf6be=typeof _0x36d7bf[_0xf5bb('0x22')]===_0xf5bb('0x23')&&typeof _0x36d7bf['limit']===_0xf5bb('0x23');var _0x243ebd=_0x5c4be0[_0xf5bb('0x24')];var _0x54ff20=_0xebf6be?0x0:_0x36d7bf[_0xf5bb('0x22')];var _0x644bf3=_0xebf6be?_0x5c4be0['count']:_0x36d7bf[_0xf5bb('0x22')]+_0x36d7bf[_0xf5bb('0x25')];var _0x3aff44;if(_0x644bf3>=_0x243ebd){_0x644bf3=_0x243ebd;_0x3aff44=0xc8;}else{_0x3aff44=0xce;}_0x28289c['status'](_0x3aff44);return _0x28289c[_0xf5bb('0x26')]('Content-Range',_0x54ff20+'-'+_0x644bf3+'/'+_0x243ebd)[_0xf5bb('0x21')](_0x5c4be0);}return null;};}function saveUpdates(_0x3e9ec8){return function(_0x3e57e0){if(_0x3e57e0){return _0x3e57e0[_0xf5bb('0x27')](_0x3e9ec8)[_0xf5bb('0x13')](function(_0xf3fe88){return _0xf3fe88;});}return null;};}function removeEntity(_0x555ec8){return function(_0x3a0383){if(_0x3a0383){return _0x3a0383['destroy']()['then'](function(){var _0x5cffff=_0x3a0383['get']({'plain':!![]});var _0x2462d7=_0xf5bb('0x28');return db['UserProfileResource'][_0xf5bb('0x29')]({'where':{'type':_0x2462d7,'resourceId':_0x5cffff['id']}})[_0xf5bb('0x13')](function(){return _0x3a0383;});})[_0xf5bb('0x13')](function(){_0x555ec8[_0xf5bb('0x1f')](0xcc)[_0xf5bb('0x20')]();});}};}function handleEntityNotFound(_0x45977f){return function(_0x46db84){if(!_0x46db84){_0x45977f[_0xf5bb('0x1e')](0x194);}return _0x46db84;};}function handleError(_0x5d66d5,_0x56558e){_0x56558e=_0x56558e||0x1f4;return function(_0x20dc40){logger['error'](_0x20dc40[_0xf5bb('0x2a')]);if(_0x20dc40[_0xf5bb('0x2b')]){delete _0x20dc40[_0xf5bb('0x2b')];}_0x5d66d5[_0xf5bb('0x1f')](_0x56558e)[_0xf5bb('0x2c')](_0x20dc40);};}function getImapHost(_0xd509b5){switch(_0xd509b5){case _0xf5bb('0x2d'):return'imap.gmail.com';case _0xf5bb('0x2e'):return'imap.mail.yahoo.com';case _0xf5bb('0x2f'):return _0xf5bb('0x30');case _0xf5bb('0x31'):return _0xf5bb('0x32');}throw new Error(_0xf5bb('0x33'),_0xd509b5);}function getSmtpHost(_0x8e976d){switch(_0x8e976d){case _0xf5bb('0x2d'):return'smtp.gmail.com';case _0xf5bb('0x2e'):return _0xf5bb('0x34');case'hotmail':return _0xf5bb('0x35');case _0xf5bb('0x31'):return _0xf5bb('0x36');}throw new Error(_0xf5bb('0x33'),_0x8e976d);}function getAuthenticationOptions(_0x393f9e,_0x51e8c3){var _0x2f1ef0={};var _0x1d4a2a={};if(_0x393f9e){_0x2f1ef0['user']=_0x1d4a2a[_0xf5bb('0x37')]=_0x51e8c3[_0xf5bb('0x38')];_0x2f1ef0[_0xf5bb('0x39')]=_0x1d4a2a[_0xf5bb('0x3a')]=_0x51e8c3[_0xf5bb('0x39')];if(_0x51e8c3[_0xf5bb('0x3b')]){_0x2f1ef0[_0xf5bb('0x3b')]=_0x1d4a2a[_0xf5bb('0x3b')]=!![];_0x2f1ef0[_0xf5bb('0x3c')]=_0x1d4a2a[_0xf5bb('0x3c')]=_0x51e8c3['CloudProviderId'];_0x2f1ef0['password']=_0x1d4a2a[_0xf5bb('0x3a')]=null;}else{_0x2f1ef0[_0xf5bb('0x3c')]=_0x1d4a2a[_0xf5bb('0x3c')]=null;}_0x2f1ef0['host']=getImapHost(_0x393f9e);_0x2f1ef0[_0xf5bb('0x3d')]=0x3e1;_0x1d4a2a[_0xf5bb('0x3e')]=getSmtpHost(_0x393f9e);_0x1d4a2a[_0xf5bb('0x3d')]=0x24b;_0x1d4a2a['secure']=![];_0x2f1ef0[_0xf5bb('0x3f')]=_0x1d4a2a['service']=null;}else{if(_0x51e8c3[_0xf5bb('0x40')]){_0x2f1ef0[_0xf5bb('0x37')]=_0x1d4a2a[_0xf5bb('0x37')]=_0x51e8c3[_0xf5bb('0x38')];_0x2f1ef0[_0xf5bb('0x39')]=_0x1d4a2a['pass']=_0x51e8c3['password'];}else{_0x2f1ef0[_0xf5bb('0x40')]=_0x1d4a2a[_0xf5bb('0x40')]=![];_0x2f1ef0[_0xf5bb('0x37')]=_0x1d4a2a['user']=null;_0x2f1ef0[_0xf5bb('0x39')]=_0x1d4a2a['pass']=null;}_0x2f1ef0['host']=_0x51e8c3['Imap'][_0xf5bb('0x3e')];_0x2f1ef0[_0xf5bb('0x3d')]=_0x51e8c3[_0xf5bb('0x41')][_0xf5bb('0x3d')];_0x1d4a2a[_0xf5bb('0x3e')]=_0x51e8c3['Smtp'][_0xf5bb('0x3e')];_0x1d4a2a[_0xf5bb('0x3d')]=_0x51e8c3[_0xf5bb('0x42')][_0xf5bb('0x3d')];}return{'Imap':_0x2f1ef0,'Smtp':_0x1d4a2a};}exports[_0xf5bb('0x43')]=function(_0x56d352,_0x213020){var _0x283c44={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xf5bb('0x44')],'as':_0xf5bb('0x42')},{'model':db[_0xf5bb('0x45')],'as':_0xf5bb('0x46')}]},_0x5eddc7={},_0x8366fc={'count':0x0,'rows':[]};var _0x574e11=_[_0xf5bb('0x47')](db[_0xf5bb('0x48')]['rawAttributes'],function(_0xf562db){return{'name':_0xf562db['fieldName'],'type':_0xf562db[_0xf5bb('0x49')]['key']};});_0x5eddc7[_0xf5bb('0x4a')]=_[_0xf5bb('0x47')](_0x574e11,_0xf5bb('0x2b'));_0x5eddc7[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x56d352[_0xf5bb('0x4b')]);_0x5eddc7[_0xf5bb('0x4d')]=_['intersection'](_0x5eddc7['model'],_0x5eddc7[_0xf5bb('0x4b')]);_0x283c44[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x5eddc7[_0xf5bb('0x4a')],qs['fields'](_0x56d352[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x283c44[_0xf5bb('0x4e')]=_0x283c44['attributes'][_0xf5bb('0x51')]?_0x283c44[_0xf5bb('0x4e')]:_0x5eddc7[_0xf5bb('0x4a')];if(!_0x56d352[_0xf5bb('0x4b')]['hasOwnProperty'](_0xf5bb('0x52'))){_0x283c44[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x56d352[_0xf5bb('0x4b')]['limit']);_0x283c44[_0xf5bb('0x22')]=qs[_0xf5bb('0x22')](_0x56d352[_0xf5bb('0x4b')][_0xf5bb('0x22')]);}_0x283c44[_0xf5bb('0x53')]=qs[_0xf5bb('0x54')](_0x56d352[_0xf5bb('0x4b')][_0xf5bb('0x54')]);_0x283c44['where']=qs[_0xf5bb('0x4d')](_[_0xf5bb('0x55')](_0x56d352[_0xf5bb('0x4b')],_0x5eddc7[_0xf5bb('0x4d')]),_0x574e11);if(_0x56d352[_0xf5bb('0x4b')][_0xf5bb('0x56')]){_0x283c44[_0xf5bb('0x57')]=_['merge'](_0x283c44[_0xf5bb('0x57')],{'$or':_[_0xf5bb('0x47')](_0x574e11,function(_0x1a6980){if(_0x1a6980[_0xf5bb('0x49')]!==_0xf5bb('0x58')){var _0x38ed66={};_0x38ed66[_0x1a6980[_0xf5bb('0x2b')]]={'$like':'%'+_0x56d352[_0xf5bb('0x4b')][_0xf5bb('0x56')]+'%'};return _0x38ed66;}})});}_0x283c44=_['merge']({},_0x283c44,_0x56d352[_0xf5bb('0x59')]);var _0x4e30b5={'where':_0x283c44[_0xf5bb('0x57')]};return db[_0xf5bb('0x48')][_0xf5bb('0x24')](_0x4e30b5)[_0xf5bb('0x13')](function(_0x240243){_0x8366fc[_0xf5bb('0x24')]=_0x240243;if(_0x56d352[_0xf5bb('0x4b')]['includeAll']){_0x283c44['include']=[{'all':!![]}];}return db[_0xf5bb('0x48')][_0xf5bb('0x5a')](_0x283c44);})[_0xf5bb('0x13')](function(_0x470afc){_0x8366fc[_0xf5bb('0x5b')]=_0x470afc;return _0x8366fc;})[_0xf5bb('0x13')](respondWithFilteredResult(_0x213020,_0x283c44))[_0xf5bb('0x1d')](handleError(_0x213020,null));};exports['show']=function(_0x1dc800,_0x50e227){var _0x57705b={'raw':![],'where':{'id':_0x1dc800[_0xf5bb('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xf5bb('0x41')},{'model':db[_0xf5bb('0x44')],'as':_0xf5bb('0x42')},{'model':db[_0xf5bb('0x45')],'as':_0xf5bb('0x46')}]},_0x18db95={};_0x18db95[_0xf5bb('0x4a')]=_['keys'](db[_0xf5bb('0x48')][_0xf5bb('0x5d')]);_0x18db95[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x1dc800[_0xf5bb('0x4b')]);_0x18db95[_0xf5bb('0x4d')]=_[_0xf5bb('0x4f')](_0x18db95['model'],_0x18db95[_0xf5bb('0x4b')]);_0x57705b['attributes']=_[_0xf5bb('0x4f')](_0x18db95[_0xf5bb('0x4a')],qs[_0xf5bb('0x50')](_0x1dc800[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x57705b[_0xf5bb('0x4e')]=_0x57705b[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0x57705b['attributes']:_0x18db95[_0xf5bb('0x4a')];if(_0x1dc800[_0xf5bb('0x4b')]['includeAll']){_0x57705b['include']=[{'all':!![]}];}_0x57705b=_['merge']({},_0x57705b,_0x1dc800[_0xf5bb('0x59')]);return db[_0xf5bb('0x48')]['find'](_0x57705b)[_0xf5bb('0x13')](handleEntityNotFound(_0x50e227,null))[_0xf5bb('0x13')](respondWithResult(_0x50e227,null))[_0xf5bb('0x1d')](handleError(_0x50e227,null));};exports['update']=function(_0x83175f,_0x9433b3){if(_0x83175f[_0xf5bb('0x5e')]['id']){delete _0x83175f['body']['id'];}var _0x179dfc=_0x83175f['body'][_0xf5bb('0x5f')]===_0xf5bb('0x60')?null:_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x5f')];var _0x2b861d=_0x83175f['body'][_0xf5bb('0x41')]||{};var _0xdc02a5=_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x42')]||{};if(_0x179dfc){_0x2b861d[_0xf5bb('0x3e')]=getImapHost(_0x179dfc);_0x2b861d[_0xf5bb('0x3d')]=0x3e1;_0xdc02a5[_0xf5bb('0x3e')]=getSmtpHost(_0x179dfc);_0xdc02a5[_0xf5bb('0x3d')]=0x24b;_0xdc02a5[_0xf5bb('0x61')]=![];}if(_0xdc02a5[_0xf5bb('0x3b')]){_0xdc02a5[_0xf5bb('0x61')]=![];}else{_0xdc02a5[_0xf5bb('0x3c')]=null;}if(!_0x2b861d[_0xf5bb('0x3b')])_0x2b861d[_0xf5bb('0x3c')]=null;_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x41')]=_0x2b861d;_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x42')]=_0xdc02a5;return db[_0xf5bb('0x48')]['find']({'where':{'id':_0x83175f[_0xf5bb('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xf5bb('0x41')},{'model':db[_0xf5bb('0x44')],'as':_0xf5bb('0x42')},{'model':db['Pause'],'as':_0xf5bb('0x46')}]})[_0xf5bb('0x13')](handleEntityNotFound(_0x9433b3,null))[_0xf5bb('0x13')](function(_0x4a63ad){if(!_0x4a63ad)throw new Error('Mail\x20Account\x20not\x20found');if(_0x4a63ad[_0xf5bb('0x3f')])delete _0x83175f[_0xf5bb('0x5e')]['Imap'];return _0x4a63ad;})['then'](saveUpdates(_0x83175f[_0xf5bb('0x5e')],null))['then'](function(_0x2d365d){if(!_0x83175f['body'][_0xf5bb('0x41')])return _0x2d365d;return db[_0xf5bb('0x62')][_0xf5bb('0x27')](_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x41')],{'where':{'MailAccountId':_0x2d365d['id']}})[_0xf5bb('0x13')](function(){return _0x2d365d;});})[_0xf5bb('0x13')](function(_0x442f6e){if(!_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x42')])return _0x442f6e;return db[_0xf5bb('0x44')][_0xf5bb('0x27')](_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x42')],{'where':{'MailAccountId':_0x442f6e['id']}})[_0xf5bb('0x13')](function(){return _0x442f6e;});})[_0xf5bb('0x13')](respondWithResult(_0x9433b3,null))['catch'](handleError(_0x9433b3,null));};exports[_0xf5bb('0x63')]=function(_0x578afe,_0x24608c){return db[_0xf5bb('0x48')][_0xf5bb('0x63')]()[_0xf5bb('0x13')](respondWithResult(_0x24608c,null))[_0xf5bb('0x1d')](handleError(_0x24608c,null));};exports[_0xf5bb('0x64')]=function(_0x33adcc,_0x2b6d3e){if(_0x33adcc['body']['id']){delete _0x33adcc['body']['id'];}return db[_0xf5bb('0x48')]['find']({'where':{'id':_0x33adcc[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2b6d3e,null))[_0xf5bb('0x13')](function(_0x315495){if(_0x315495){_0x33adcc[_0xf5bb('0x5e')][_0xf5bb('0x65')]=_0x315495['id'];return db[_0xf5bb('0x66')]['create'](_0x33adcc[_0xf5bb('0x5e')]);}})[_0xf5bb('0x13')](respondWithResult(_0x2b6d3e,null))[_0xf5bb('0x1d')](handleError(_0x2b6d3e,null));};exports[_0xf5bb('0x67')]=function(_0x1e2f44,_0x282a9f){var _0x57873b={'raw':![],'where':{}};var _0x31da7e={};var _0x4dda35={'count':0x0,'rows':[]};return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x1e2f44[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x282a9f,null))[_0xf5bb('0x13')](function(_0xe5b309){if(_0xe5b309){_0x31da7e[_0xf5bb('0x4a')]=_[_0xf5bb('0x4c')](db[_0xf5bb('0x66')][_0xf5bb('0x5d')]);_0x31da7e[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x1e2f44[_0xf5bb('0x4b')]);_0x31da7e['filters']=_['intersection'](_0x31da7e[_0xf5bb('0x4a')],_0x31da7e[_0xf5bb('0x4b')]);_0x57873b[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x31da7e['model'],qs['fields'](_0x1e2f44[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x57873b[_0xf5bb('0x4e')]=_0x57873b[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0x57873b[_0xf5bb('0x4e')]:_0x31da7e[_0xf5bb('0x4a')];if(!_0x1e2f44['query']['hasOwnProperty'](_0xf5bb('0x52'))){_0x57873b[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x1e2f44[_0xf5bb('0x4b')][_0xf5bb('0x25')]);_0x57873b[_0xf5bb('0x22')]=qs[_0xf5bb('0x22')](_0x1e2f44['query'][_0xf5bb('0x22')]);}_0x57873b[_0xf5bb('0x53')]=qs[_0xf5bb('0x54')](_0x1e2f44[_0xf5bb('0x4b')][_0xf5bb('0x54')]);_0x57873b[_0xf5bb('0x57')]=qs['filters'](_[_0xf5bb('0x55')](_0x1e2f44['query'],_0x31da7e[_0xf5bb('0x4d')]));_0x57873b[_0xf5bb('0x57')][_0xf5bb('0x65')]=_0xe5b309['id'];if(_0x1e2f44[_0xf5bb('0x4b')][_0xf5bb('0x56')]){_0x57873b[_0xf5bb('0x57')]=_[_0xf5bb('0x69')](_0x57873b[_0xf5bb('0x57')],{'$or':_['map'](_0x57873b[_0xf5bb('0x4e')],function(_0x5b7da9){var _0x3f3ac8={};_0x3f3ac8[_0x5b7da9]={'$like':'%'+_0x1e2f44[_0xf5bb('0x4b')]['filter']+'%'};return _0x3f3ac8;})});}_0x57873b=_['merge']({},_0x57873b,_0x1e2f44['options']);return db[_0xf5bb('0x66')][_0xf5bb('0x24')]({'where':_0x57873b[_0xf5bb('0x57')]})[_0xf5bb('0x13')](function(_0x4097f4){_0x4dda35['count']=_0x4097f4;if(_0x1e2f44[_0xf5bb('0x4b')][_0xf5bb('0x6a')]){_0x57873b[_0xf5bb('0x6b')]=[{'all':!![]}];}return db['Disposition'][_0xf5bb('0x5a')](_0x57873b);})[_0xf5bb('0x13')](function(_0x809cef){_0x4dda35['rows']=_0x809cef;return _0x4dda35;});}})[_0xf5bb('0x13')](respondWithFilteredResult(_0x282a9f,_0x57873b))[_0xf5bb('0x1d')](handleError(_0x282a9f,null));};exports[_0xf5bb('0x6c')]=function(_0x3241be,_0x52a06f){return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x3241be[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x52a06f,null))[_0xf5bb('0x13')](function(_0x5cd2eb){if(_0x5cd2eb){return _0x5cd2eb[_0xf5bb('0x6c')](_0x3241be[_0xf5bb('0x4b')]['ids']);}})[_0xf5bb('0x13')](respondWithStatusCode(_0x52a06f,null))[_0xf5bb('0x1d')](handleError(_0x52a06f,null));};exports['addAnswer']=function(_0x4181b8,_0x5810e7){if(_0x4181b8['body']['id']){delete _0x4181b8['body']['id'];}return db['MailAccount'][_0xf5bb('0x6d')]({'where':{'id':_0x4181b8[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5810e7,null))[_0xf5bb('0x13')](function(_0x169dd9){if(_0x169dd9){_0x4181b8[_0xf5bb('0x5e')]['MailAccountId']=_0x169dd9['id'];return db['CannedAnswer']['create'](_0x4181b8[_0xf5bb('0x5e')]);}})['then'](respondWithResult(_0x5810e7,null))[_0xf5bb('0x1d')](handleError(_0x5810e7,null));};exports[_0xf5bb('0x6e')]=function(_0x3c90d8,_0x1aa882){var _0x1942af={'raw':![],'where':{}};var _0x37a5c0={};var _0x166b3f={'count':0x0,'rows':[]};return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x3c90d8[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x1aa882,null))['then'](function(_0x491184){if(_0x491184){_0x37a5c0[_0xf5bb('0x4a')]=_[_0xf5bb('0x4c')](db[_0xf5bb('0x6f')][_0xf5bb('0x5d')]);_0x37a5c0[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x3c90d8[_0xf5bb('0x4b')]);_0x37a5c0['filters']=_['intersection'](_0x37a5c0[_0xf5bb('0x4a')],_0x37a5c0[_0xf5bb('0x4b')]);_0x1942af['attributes']=_[_0xf5bb('0x4f')](_0x37a5c0[_0xf5bb('0x4a')],qs[_0xf5bb('0x50')](_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x1942af['attributes']=_0x1942af[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0x1942af['attributes']:_0x37a5c0[_0xf5bb('0x4a')];if(!_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x70')](_0xf5bb('0x52'))){_0x1942af[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x25')]);_0x1942af[_0xf5bb('0x22')]=qs[_0xf5bb('0x22')](_0x3c90d8['query']['offset']);}_0x1942af['order']=qs[_0xf5bb('0x54')](_0x3c90d8[_0xf5bb('0x4b')]['sort']);_0x1942af['where']=qs['filters'](_[_0xf5bb('0x55')](_0x3c90d8[_0xf5bb('0x4b')],_0x37a5c0[_0xf5bb('0x4d')]));_0x1942af[_0xf5bb('0x57')]['MailAccountId']=_0x491184['id'];if(_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x56')]){_0x1942af['where']=_['merge'](_0x1942af['where'],{'$or':_[_0xf5bb('0x47')](_0x1942af[_0xf5bb('0x4e')],function(_0x5c288d){var _0x2c2515={};_0x2c2515[_0x5c288d]={'$like':'%'+_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x56')]+'%'};return _0x2c2515;})});}_0x1942af=_[_0xf5bb('0x69')]({},_0x1942af,_0x3c90d8[_0xf5bb('0x59')]);return db['CannedAnswer'][_0xf5bb('0x24')]({'where':_0x1942af[_0xf5bb('0x57')]})[_0xf5bb('0x13')](function(_0x1dce0f){_0x166b3f[_0xf5bb('0x24')]=_0x1dce0f;if(_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x6a')]){_0x1942af[_0xf5bb('0x6b')]=[{'all':!![]}];}return db[_0xf5bb('0x6f')][_0xf5bb('0x5a')](_0x1942af);})[_0xf5bb('0x13')](function(_0x15bd3a){_0x166b3f[_0xf5bb('0x5b')]=_0x15bd3a;return _0x166b3f;});}})['then'](respondWithFilteredResult(_0x1aa882,_0x1942af))['catch'](handleError(_0x1aa882,null));};exports[_0xf5bb('0x71')]=function(_0x46f803,_0x2a3812){return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x46f803[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x2a3812,null))['then'](function(_0x4bde89){if(_0x4bde89){return _0x4bde89[_0xf5bb('0x71')](_0x46f803[_0xf5bb('0x4b')]['ids']);}})['then'](respondWithStatusCode(_0x2a3812,null))[_0xf5bb('0x1d')](handleError(_0x2a3812,null));};exports[_0xf5bb('0x72')]=function(_0x21b5d7,_0x5901c9){var _0x1f64e6={'name':_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x2b')],'key':_0x21b5d7[_0xf5bb('0x5e')]['key'],'provider':_0x21b5d7[_0xf5bb('0x5e')]['provider']===_0xf5bb('0x60')?null:_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x5f')],'email':_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x73')],'ListId':_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x74')],'active':!_[_0xf5bb('0x75')](_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x76')])?_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x76')]:!![],'description':_0x21b5d7['body'][_0xf5bb('0x77')]||null};var _0x2065b9=getAuthenticationOptions(_0x1f64e6[_0xf5bb('0x5f')],_0x21b5d7[_0xf5bb('0x5e')]);_0x1f64e6[_0xf5bb('0x41')]=_0x2065b9[_0xf5bb('0x41')];_0x1f64e6[_0xf5bb('0x42')]=_0x2065b9['Smtp'];return db[_0xf5bb('0x48')]['create'](_0x1f64e6,{'include':[{'model':db[_0xf5bb('0x44')],'as':_0xf5bb('0x42')},{'model':db[_0xf5bb('0x62')],'as':_0xf5bb('0x41')}]})['then'](function(_0x123b2e){var _0x502e10=_0x21b5d7[_0xf5bb('0x37')][_0xf5bb('0x78')]({'plain':!![]});if(!_0x502e10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x502e10['role']===_0xf5bb('0x37')){var _0x445d2d=_0x123b2e[_0xf5bb('0x78')]({'plain':!![]});return db[_0xf5bb('0x79')][_0xf5bb('0x6d')]({'where':{'name':_0xf5bb('0x28'),'userProfileId':_0x502e10['userProfileId']},'raw':!![]})['then'](function(_0x22073b){if(_0x22073b&&_0x22073b['autoAssociation']===0x0){return db[_0xf5bb('0x7a')]['create']({'name':_0x445d2d[_0xf5bb('0x2b')],'resourceId':_0x445d2d['id'],'type':_0x22073b[_0xf5bb('0x2b')],'sectionId':_0x22073b['id']},{})['then'](function(){return _0x123b2e;});}else{return _0x123b2e;}})[_0xf5bb('0x1d')](function(_0x451b94){logger['error'](_0xf5bb('0x7b'),_0x451b94);throw _0x451b94;});}return _0x123b2e;})[_0xf5bb('0x13')](respondWithResult(_0x5901c9,0xc9))['catch'](handleError(_0x5901c9,null));};exports[_0xf5bb('0x7c')]=function(_0x38dc04,_0x531290){return db[_0xf5bb('0x48')]['findOne']({'where':{'id':_0x38dc04[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x531290,null))[_0xf5bb('0x13')](function(_0x968b98){if(_0x968b98){return _0x968b98['getImap']();}return null;})[_0xf5bb('0x13')](respondWithResult(_0x531290,null))[_0xf5bb('0x1d')](handleError(_0x531290,null));};exports[_0xf5bb('0x7d')]=function(_0x594edb,_0x516570){if(_0x594edb[_0xf5bb('0x5e')]['id']){delete _0x594edb[_0xf5bb('0x5e')]['id'];}return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x594edb['params']['id']}})['then'](handleEntityNotFound(_0x516570,null))[_0xf5bb('0x13')](function(_0x331017){if(_0x331017){_0x594edb[_0xf5bb('0x5e')][_0xf5bb('0x65')]=_0x331017['id'];return db['MailServerIn'][_0xf5bb('0x72')](_0x594edb[_0xf5bb('0x5e')]);}})['then'](respondWithResult(_0x516570,null))[_0xf5bb('0x1d')](handleError(_0x516570,null));};exports[_0xf5bb('0x7e')]=function(_0x1a25f1,_0x1878b8){return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x1a25f1[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x1878b8,null))[_0xf5bb('0x13')](function(_0xa8d9f3){if(_0xa8d9f3){return _0xa8d9f3[_0xf5bb('0x7f')](null);}return null;})[_0xf5bb('0x13')](respondWithStatusCode(_0x1878b8,null))['catch'](handleError(_0x1878b8,null));};exports['getSmtp']=function(_0x580337,_0x2a67e5){return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x580337[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x2a67e5,null))['then'](function(_0x1e256a){if(_0x1e256a){return _0x1e256a[_0xf5bb('0x80')]();}return null;})[_0xf5bb('0x13')](respondWithResult(_0x2a67e5,null))[_0xf5bb('0x1d')](handleError(_0x2a67e5,null));};exports['addSmtp']=function(_0x1fd0df,_0x1b205f){if(_0x1fd0df[_0xf5bb('0x5e')]['id']){delete _0x1fd0df[_0xf5bb('0x5e')]['id'];}return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x1fd0df[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1b205f,null))['then'](function(_0x1e984f){if(_0x1e984f){_0x1fd0df['body']['MailAccountId']=_0x1e984f['id'];return db[_0xf5bb('0x44')][_0xf5bb('0x72')](_0x1fd0df[_0xf5bb('0x5e')]);}})[_0xf5bb('0x13')](respondWithResult(_0x1b205f,null))[_0xf5bb('0x1d')](handleError(_0x1b205f,null));};exports[_0xf5bb('0x81')]=function(_0x428c10,_0x28bb28){return db[_0xf5bb('0x48')]['findOne']({'where':{'id':_0x428c10[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x28bb28,null))['then'](function(_0x1aec27){if(_0x1aec27){return _0x1aec27[_0xf5bb('0x82')](null);}return null;})[_0xf5bb('0x13')](respondWithStatusCode(_0x28bb28,null))[_0xf5bb('0x1d')](handleError(_0x28bb28,null));};exports[_0xf5bb('0x83')]=function(_0x2673ec,_0x4e6ebd){return db[_0xf5bb('0x84')]['find']({'where':{'id':_0x2673ec[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4e6ebd,null))[_0xf5bb('0x13')](function(_0x2a69aa){if(_0x2a69aa){return _0x2a69aa[_0xf5bb('0x83')](_0x2673ec['body'][_0xf5bb('0x85')],_[_0xf5bb('0x86')](_0x2673ec['body'],['ids','id'])||{});}})[_0xf5bb('0x13')](respondWithResult(_0x4e6ebd,null))[_0xf5bb('0x1d')](handleError(_0x4e6ebd,null));};exports[_0xf5bb('0x87')]=function(_0x31cea5,_0x381205){var _0x244f69={'raw':![],'where':{}};var _0x1f4792={};var _0x428179={'count':0x0,'rows':[]};return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x31cea5[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x381205,null))['then'](function(_0x20aa49){if(_0x20aa49){_0x1f4792[_0xf5bb('0x4a')]=_[_0xf5bb('0x4c')](db[_0xf5bb('0x84')]['rawAttributes']);_0x1f4792[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x31cea5[_0xf5bb('0x4b')]);_0x1f4792[_0xf5bb('0x4d')]=_[_0xf5bb('0x4f')](_0x1f4792[_0xf5bb('0x4a')],_0x1f4792['query']);_0x244f69[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x1f4792[_0xf5bb('0x4a')],qs[_0xf5bb('0x50')](_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x244f69[_0xf5bb('0x4e')]=_0x244f69[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0x244f69['attributes']:_0x1f4792['model'];if(!_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x70')](_0xf5bb('0x52'))){_0x244f69[_0xf5bb('0x25')]=qs['limit'](_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x25')]);_0x244f69[_0xf5bb('0x22')]=qs['offset'](_0x31cea5['query'][_0xf5bb('0x22')]);}_0x244f69[_0xf5bb('0x53')]=qs['sort'](_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x54')]);_0x244f69['where']=qs[_0xf5bb('0x4d')](_['pick'](_0x31cea5[_0xf5bb('0x4b')],_0x1f4792[_0xf5bb('0x4d')]));_0x244f69['where'][_0xf5bb('0x65')]=_0x20aa49['id'];if(_0x31cea5['query']['filter']){_0x244f69['where']=_[_0xf5bb('0x69')](_0x244f69['where'],{'$or':_['map'](_0x244f69[_0xf5bb('0x4e')],function(_0x4eb4cc){var _0x49fb2f={};_0x49fb2f[_0x4eb4cc]={'$like':'%'+_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x56')]+'%'};return _0x49fb2f;})});}_0x244f69=_[_0xf5bb('0x69')]({},_0x244f69,_0x31cea5['options']);return db[_0xf5bb('0x84')][_0xf5bb('0x24')]({'where':_0x244f69[_0xf5bb('0x57')]})[_0xf5bb('0x13')](function(_0x2da3e6){_0x428179[_0xf5bb('0x24')]=_0x2da3e6;if(_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x6a')]){_0x244f69[_0xf5bb('0x6b')]=[{'model':db[_0xf5bb('0x88')],'as':'Contact','required':![]},{'model':db[_0xf5bb('0x89')],'as':_0xf5bb('0x8a'),'attributes':[_0xf5bb('0x2b'),_0xf5bb('0x8b'),_0xf5bb('0x8c')],'required':![]},{'model':db[_0xf5bb('0x8d')],'as':'Tags','attributes':['id',_0xf5bb('0x2b'),_0xf5bb('0x8e')],'where':_0x31cea5['query'][_0xf5bb('0x8f')]?{'id':_0x31cea5['query']['tag']}:undefined,'required':_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x8f')]?!![]:![]}];}return db[_0xf5bb('0x84')][_0xf5bb('0x5a')](_0x244f69);})[_0xf5bb('0x13')](function(_0xaa66d6){_0x428179[_0xf5bb('0x5b')]=_0xaa66d6;return _0x428179;});}})[_0xf5bb('0x13')](respondWithFilteredResult(_0x381205,_0x244f69))[_0xf5bb('0x1d')](handleError(_0x381205,null));};exports['addApplications']=function addApplications(_0x525816,_0x51f6ba){var _0x2ea542=_0x525816[_0xf5bb('0x5c')]['id'];var _0x3de3e3=_0x525816['body'];var _0x5d2059=0xc8;var _0x25fa02=null;return db['sequelize'][_0xf5bb('0x90')]({'isolationLevel':db[_0xf5bb('0x91')][_0xf5bb('0x92')][_0xf5bb('0x93')][_0xf5bb('0x94')]},function(_0x1fe095){return db[_0xf5bb('0x48')]['findOne']({'where':{'id':_0x2ea542},'transaction':_0x1fe095})['then'](function(_0x2dc4bb){if(_0x2dc4bb){return db[_0xf5bb('0x95')][_0xf5bb('0x29')]({'where':{'MailAccountId':_0x2ea542},'transaction':_0x1fe095})['then'](function(){var _0x3953b8=_[_0xf5bb('0x47')](_0x3de3e3,function(_0x50d7f6){_0x50d7f6[_0xf5bb('0x65')]=_0x2ea542;return _0x50d7f6;});return db['MailApplication'][_0xf5bb('0x96')](_0x3953b8,{'transaction':_0x1fe095});});}else{_0x5d2059=0x194;_0x25fa02=[];}});})[_0xf5bb('0x13')](function(){if(_0x5d2059!==0x194){return db[_0xf5bb('0x95')]['findAndCountAll']({'where':{'MailAccountId':_0x2ea542},'order':_0xf5bb('0x97')})['then'](function(_0x1bfe62){_0x25fa02=_0x1bfe62;});}})['catch'](function(_0x4d698e){_0x5d2059=0x1f4;logger[_0xf5bb('0x1a')](_0x4d698e['stack']);if(_0x4d698e[_0xf5bb('0x2b')]){delete _0x4d698e[_0xf5bb('0x2b')];}_0x25fa02=_0x4d698e;})[_0xf5bb('0x98')](function(){if(_0x25fa02===null){_0x51f6ba[_0xf5bb('0x1e')](_0x5d2059);}else{if(_0x5d2059===0x1f4){_0x51f6ba[_0xf5bb('0x1f')](_0x5d2059)[_0xf5bb('0x2c')](_0x25fa02);}else{_0x51f6ba[_0xf5bb('0x1f')](_0x5d2059)[_0xf5bb('0x21')](_0x25fa02);}}});};exports['getApplications']=function(_0x30d77c,_0x1036cb){var _0x1d9916={};var _0x251a9b={};var _0xd93024;var _0x3d0f41;return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x30d77c[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x1036cb,null))[_0xf5bb('0x13')](function(_0x516020){if(_0x516020){_0xd93024=_0x516020;_0x251a9b[_0xf5bb('0x4a')]=_['keys'](db[_0xf5bb('0x95')][_0xf5bb('0x5d')]);_0x251a9b[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x30d77c[_0xf5bb('0x4b')]);_0x251a9b[_0xf5bb('0x4d')]=_['intersection'](_0x251a9b['model'],_0x251a9b['query']);_0x1d9916[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x251a9b['model'],qs[_0xf5bb('0x50')](_0x30d77c[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x1d9916[_0xf5bb('0x4e')]=_0x1d9916[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0x1d9916[_0xf5bb('0x4e')]:_0x251a9b[_0xf5bb('0x4a')];_0x1d9916['order']=qs['sort'](_0x30d77c[_0xf5bb('0x4b')][_0xf5bb('0x54')]);_0x1d9916[_0xf5bb('0x57')]=qs[_0xf5bb('0x4d')](_['pick'](_0x30d77c[_0xf5bb('0x4b')],_0x251a9b[_0xf5bb('0x4d')]));if(_0x30d77c[_0xf5bb('0x4b')]['filter']){_0x1d9916[_0xf5bb('0x57')]=_[_0xf5bb('0x69')](_0x1d9916[_0xf5bb('0x57')],{'$or':_[_0xf5bb('0x47')](_0x1d9916[_0xf5bb('0x4e')],function(_0x360d7a){var _0x173aa9={};_0x173aa9[_0x360d7a]={'$like':'%'+_0x30d77c[_0xf5bb('0x4b')]['filter']+'%'};return _0x173aa9;})});}_0x1d9916=_[_0xf5bb('0x69')]({},_0x1d9916,_0x30d77c[_0xf5bb('0x59')]);return _0xd93024['getApplications'](_0x1d9916);}})['then'](function(_0x2f2527){if(_0x2f2527){_0x3d0f41=_0x2f2527['length'];if(!_0x30d77c[_0xf5bb('0x4b')][_0xf5bb('0x70')](_0xf5bb('0x52'))){_0x1d9916[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x30d77c[_0xf5bb('0x4b')][_0xf5bb('0x25')]);_0x1d9916['offset']=qs['offset'](_0x30d77c['query'][_0xf5bb('0x22')]);}return _0xd93024[_0xf5bb('0x99')](_0x1d9916);}})['then'](function(_0x54e95){if(_0x54e95){return _0x54e95?{'count':_0x3d0f41,'rows':_0x54e95}:null;}})[_0xf5bb('0x13')](respondWithResult(_0x1036cb,null))[_0xf5bb('0x1d')](handleError(_0x1036cb,null));};exports[_0xf5bb('0x9a')]=function(_0x30b649,_0x3adea4){var _0xd06798={'raw':!![],'where':{}};var _0x501e8b={};var _0x33f211={'count':0x0,'rows':[]};return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x30b649[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x3adea4,null))[_0xf5bb('0x13')](function(_0xbad438){if(_0xbad438){_0x501e8b[_0xf5bb('0x4a')]=_[_0xf5bb('0x4c')](db[_0xf5bb('0x9b')][_0xf5bb('0x5d')]);_0x501e8b[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x30b649['query']);_0x501e8b[_0xf5bb('0x4d')]=_[_0xf5bb('0x4f')](_0x501e8b[_0xf5bb('0x4a')],_0x501e8b[_0xf5bb('0x4b')]);_0xd06798[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x501e8b[_0xf5bb('0x4a')],qs['fields'](_0x30b649[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0xd06798['attributes']=_0xd06798[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0xd06798[_0xf5bb('0x4e')]:_0x501e8b[_0xf5bb('0x4a')];if(!_0x30b649[_0xf5bb('0x4b')]['hasOwnProperty'](_0xf5bb('0x52'))){_0xd06798[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x30b649[_0xf5bb('0x4b')]['limit']);_0xd06798[_0xf5bb('0x22')]=qs['offset'](_0x30b649['query'][_0xf5bb('0x22')]);}_0xd06798[_0xf5bb('0x53')]=qs[_0xf5bb('0x54')](_0x30b649[_0xf5bb('0x4b')]['sort']);_0xd06798[_0xf5bb('0x57')]=qs['filters'](_[_0xf5bb('0x55')](_0x30b649['query'],_0x501e8b[_0xf5bb('0x4d')]));_0xd06798[_0xf5bb('0x57')][_0xf5bb('0x65')]=_0xbad438['id'];if(_0x30b649[_0xf5bb('0x4b')][_0xf5bb('0x56')]){_0xd06798['where']=_['merge'](_0xd06798[_0xf5bb('0x57')],{'$or':_[_0xf5bb('0x47')](_0xd06798['attributes'],function(_0x9a39a1){var _0x4f6205={};_0x4f6205[_0x9a39a1]={'$like':'%'+_0x30b649[_0xf5bb('0x4b')]['filter']+'%'};return _0x4f6205;})});}if(_0x30b649['query'][_0xf5bb('0x9c')]){var _0x5a4bfa=_0x30b649[_0xf5bb('0x4b')][_0xf5bb('0x9c')][_0xf5bb('0x9d')](',');var _0x1e6c4d={};_0x1e6c4d[_0x5a4bfa[0x0]]={'$gte':moment(_0x5a4bfa[0x1])['format'](_0xf5bb('0x9e'))};_0xd06798[_0xf5bb('0x57')]=_[_0xf5bb('0x69')](_0xd06798['where'],_0x1e6c4d);}_0xd06798=_['merge']({},_0xd06798,_0x30b649[_0xf5bb('0x59')]);return db[_0xf5bb('0x9b')][_0xf5bb('0x24')]({'where':_0xd06798['where']})[_0xf5bb('0x13')](function(_0x2ee0fa){_0x33f211[_0xf5bb('0x24')]=_0x2ee0fa;if(_0x30b649[_0xf5bb('0x4b')][_0xf5bb('0x6a')]){_0xd06798[_0xf5bb('0x6b')]=[{'all':!![]}];}return db[_0xf5bb('0x9b')][_0xf5bb('0x5a')](_0xd06798);})[_0xf5bb('0x13')](function(_0x4316d4){if(_0x30b649['query'][_0xf5bb('0x9f')]===_0xf5bb('0xa0')){for(var _0x2056f7=0x0;_0x2056f7<_0x4316d4[_0xf5bb('0x51')];_0x2056f7++){_0x4316d4[_0x2056f7]['body']=juice(_0x4316d4[_0x2056f7][_0xf5bb('0x5e')]);}}_0x33f211[_0xf5bb('0x5b')]=_0x4316d4;return _0x33f211;});}})[_0xf5bb('0x13')](respondWithFilteredResult(_0x3adea4,_0xd06798))[_0xf5bb('0x1d')](handleError(_0x3adea4,null));};exports[_0xf5bb('0x2c')]=function(_0x434769,_0x44bf30){var _0x15343a,_0x19980c={},_0x57d7b9;if(_0x434769['body']['to']){_0x57d7b9=_0x434769[_0xf5bb('0x5e')]['to']['split'](',')[0x0];}return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x434769[_0xf5bb('0x5c')]['id']},'include':[{'model':db[_0xf5bb('0xa1')],'as':'List','include':[{'model':db[_0xf5bb('0x88')],'as':'Contacts','where':{'email':_0x57d7b9},'limit':0x1,'order':[[_0xf5bb('0xa2'),_0xf5bb('0xa3')]]}]},{'model':db['MailServerOut'],'as':_0xf5bb('0x42'),'raw':!![],'include':[{'model':db[_0xf5bb('0xa4')],'as':_0xf5bb('0xa4'),'raw':!![]}]}]})[_0xf5bb('0x13')](handleEntityNotFound(_0x44bf30,null))[_0xf5bb('0x13')](function(_0x158685){if(!_0x158685)return;_0x15343a=_0x158685;if(!_0x158685['Smtp'])throw new Error(_0xf5bb('0xa5'));if(_['isNil'](_0x434769[_0xf5bb('0x5e')]['from'])){_0x434769['body']['from']=util[_0xf5bb('0xa6')](_0xf5bb('0xa7'),_0x158685[_0xf5bb('0x2b')],_0x158685['email']||_0x158685[_0xf5bb('0x42')][_0xf5bb('0x37')]);}if(_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xa8')]&&_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xa8')][_0xf5bb('0x51')]){for(var _0x4fb8fe=0x0;_0x4fb8fe<_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xa8')][_0xf5bb('0x51')];_0x4fb8fe+=0x1){_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xa8')][_0x4fb8fe]={'filename':_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xa8')][_0x4fb8fe][_0xf5bb('0x2b')],'path':path[_0xf5bb('0xa9')](config[_0xf5bb('0xaa')],_0xf5bb('0xab'),_0x434769[_0xf5bb('0x5e')]['attachments'][_0x4fb8fe]['basename'])};}}var _0x102204=_0x158685[_0xf5bb('0xac')]();return respondWithRpcPromise(_0xf5bb('0xad'),_0xf5bb('0xae'),{'account':_0x102204,'message':_0x434769[_0xf5bb('0x5e')]});})[_0xf5bb('0x13')](function(_0x3dfe77){if(!_0x3dfe77)return;_0x19980c=_0x3dfe77;if(!_0x15343a['List'])throw new Error(_0xf5bb('0xaf'));if(_0x15343a['List'][_0xf5bb('0xb0')][_0xf5bb('0x51')])return _0x15343a[_0xf5bb('0xb1')][_0xf5bb('0xb0')][0x0];return db['CmContact'][_0xf5bb('0x72')](_[_0xf5bb('0xd')](_0x434769[_0xf5bb('0x5e')],{'firstName':_0x434769[_0xf5bb('0x5e')]['to'],'email':_0x434769['body']['to'],'phone':_0x434769[_0xf5bb('0x5e')]['to'],'ListId':_0x15343a[_0xf5bb('0x74')]}));})[_0xf5bb('0x13')](function(_0xb9d032){if(!_0xb9d032)return;var _0x4a54d5={'UserId':_0x434769[_0xf5bb('0x37')]['id'],'ContactId':_0xb9d032['id'],'MailAccountId':_0x15343a['id'],'inReplyTo':_0x19980c[_0xf5bb('0xb2')],'to':_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xb3')],'cc':_0x434769[_0xf5bb('0x5e')]['cc'],'subject':_0x434769['body'][_0xf5bb('0xb4')],'attach':_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xb5')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xf5bb('0xa6')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xf5bb('0xb6'),'Messages':[_['merge'](_0x434769[_0xf5bb('0x5e')],{'messageId':_0x19980c['messageId'],'sentAt':moment()['format'](_0xf5bb('0x9e')),'read':!![],'MailAccountId':_0x15343a['id'],'UserId':_0x434769[_0xf5bb('0x37')]['id'],'ContactId':_0xb9d032['id']})]};if(_0x434769['body']['Interaction']){_0x4a54d5=_['merge'](_0x4a54d5,_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xb7')]);}return db[_0xf5bb('0x84')][_0xf5bb('0x72')](_0x4a54d5,{'include':[{'model':db['MailMessage'],'as':_0xf5bb('0xb8')}]});})[_0xf5bb('0x13')](respondWithResult(_0x44bf30,null))[_0xf5bb('0x1d')](handleError(_0x44bf30,null));};exports['verifySmtp']=function(_0x291267,_0x4bcaeb){return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x291267[_0xf5bb('0x5c')]['id']},'include':[{'model':db[_0xf5bb('0x44')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf5bb('0xa4')],'as':_0xf5bb('0xa4'),'raw':!![]}]}]})[_0xf5bb('0x13')](handleEntityNotFound(_0x4bcaeb,null))[_0xf5bb('0x13')](function(_0x23b04d){if(!_0x23b04d[_0xf5bb('0x42')])return;var _0x597403=_0x23b04d[_0xf5bb('0xac')]();return respondWithRpcPromise(_0xf5bb('0xb9'),_0xf5bb('0xba'),{'account':_0x597403});})['then'](respondWithResult(_0x4bcaeb,null))[_0xf5bb('0x1d')](handleError(_0x4bcaeb,null));};exports[_0xf5bb('0x29')]=function(_0x4c7673,_0x1026cb){return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x4c7673[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x1026cb,null))[_0xf5bb('0x13')](function(_0x47b7b2){if(_0x47b7b2&&_0x47b7b2[_0xf5bb('0x3f')]){throw new db[(_0xf5bb('0xbb'))]['ValidationError'](_0xf5bb('0xbc'));}return _0x47b7b2;})[_0xf5bb('0x13')](removeEntity(_0x1026cb,null))[_0xf5bb('0x1d')](handleError(_0x1026cb,null));};exports[_0xf5bb('0xbd')]=function(_0x2277fb,_0xc8c134){return db[_0xf5bb('0x48')]['find']({'where':{'id':_0x2277fb['params']['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0xc8c134,null))[_0xf5bb('0x13')](function(_0x41757b){if(_0x41757b){return _0x41757b[_0xf5bb('0xbd')](_0x2277fb['body'][_0xf5bb('0x85')],_['omit'](_0x2277fb[_0xf5bb('0x5e')],[_0xf5bb('0x85'),'id'])||{})[_0xf5bb('0xbe')](function(_0x4ecb0a){for(var _0x455731=0x0;_0x455731<_0x2277fb[_0xf5bb('0x5e')][_0xf5bb('0x85')][_0xf5bb('0x51')];_0x455731+=0x1){socket[_0xf5bb('0xbf')](_0xf5bb('0xc0'),{'UserId':Number(_0x2277fb[_0xf5bb('0x5e')]['ids'][_0x455731]),'MailAccountId':Number(_0x2277fb[_0xf5bb('0x5c')]['id'])});}return _0x4ecb0a;});}})[_0xf5bb('0x13')](respondWithResult(_0xc8c134,null))['catch'](handleError(_0xc8c134,null));};exports[_0xf5bb('0xc1')]=function(_0x56718b,_0x1da3eb){return db['MailAccount'][_0xf5bb('0x6d')]({'where':{'id':_0x56718b[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x1da3eb,null))[_0xf5bb('0x13')](function(_0x4c5099){if(_0x4c5099){return _0x4c5099[_0xf5bb('0xc1')](_0x56718b['query'][_0xf5bb('0x85')])[_0xf5bb('0x13')](function(){if(_['isArray'](_0x56718b['query']['ids'])){for(var _0xa7ddfb=0x0;_0xa7ddfb<_0x56718b[_0xf5bb('0x4b')][_0xf5bb('0x85')][_0xf5bb('0x51')];_0xa7ddfb+=0x1){socket[_0xf5bb('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x56718b[_0xf5bb('0x4b')]['ids'][_0xa7ddfb]),'MailAccountId':Number(_0x56718b['params']['id'])});}}else{socket[_0xf5bb('0xbf')](_0xf5bb('0xc2'),{'UserId':Number(_0x56718b[_0xf5bb('0x4b')][_0xf5bb('0x85')]),'MailAccountId':Number(_0x56718b[_0xf5bb('0x5c')]['id'])});}});}})[_0xf5bb('0x13')](respondWithStatusCode(_0x1da3eb,null))[_0xf5bb('0x1d')](handleError(_0x1da3eb,null));};exports[_0xf5bb('0xc3')]=function(_0x519b7e,_0x342491){var _0x5e716a={};var _0x17e7e4={};var _0x5b8f0b;var _0x574231;return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x519b7e[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x342491,null))[_0xf5bb('0x13')](function(_0xae7793){if(_0xae7793){_0x5b8f0b=_0xae7793;_0x17e7e4['model']=_[_0xf5bb('0x4c')](db[_0xf5bb('0x89')]['rawAttributes']);_0x17e7e4[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x519b7e[_0xf5bb('0x4b')]);_0x17e7e4[_0xf5bb('0x4d')]=_[_0xf5bb('0x4f')](_0x17e7e4[_0xf5bb('0x4a')],_0x17e7e4[_0xf5bb('0x4b')]);_0x5e716a[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x17e7e4[_0xf5bb('0x4a')],qs['fields'](_0x519b7e[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x5e716a[_0xf5bb('0x4e')]=_0x5e716a['attributes'][_0xf5bb('0x51')]?_0x5e716a[_0xf5bb('0x4e')]:_0x17e7e4[_0xf5bb('0x4a')];_0x5e716a[_0xf5bb('0x53')]=qs['sort'](_0x519b7e['query'][_0xf5bb('0x54')]);_0x5e716a[_0xf5bb('0x57')]=qs['filters'](_['pick'](_0x519b7e[_0xf5bb('0x4b')],_0x17e7e4[_0xf5bb('0x4d')]));if(_0x519b7e[_0xf5bb('0x4b')][_0xf5bb('0x56')]){_0x5e716a[_0xf5bb('0x57')]=_[_0xf5bb('0x69')](_0x5e716a['where'],{'$or':_[_0xf5bb('0x47')](_0x5e716a[_0xf5bb('0x4e')],function(_0x3ab3da){var _0x25ff0f={};_0x25ff0f[_0x3ab3da]={'$like':'%'+_0x519b7e[_0xf5bb('0x4b')][_0xf5bb('0x56')]+'%'};return _0x25ff0f;})});}_0x5e716a=_[_0xf5bb('0x69')]({},_0x5e716a,_0x519b7e[_0xf5bb('0x59')]);return _0x5b8f0b[_0xf5bb('0xc3')](_0x5e716a);}})[_0xf5bb('0x13')](function(_0xc0c35){if(_0xc0c35){_0x574231=_0xc0c35[_0xf5bb('0x51')];if(!_0x519b7e[_0xf5bb('0x4b')][_0xf5bb('0x70')](_0xf5bb('0x52'))){_0x5e716a[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x519b7e[_0xf5bb('0x4b')]['limit']);_0x5e716a[_0xf5bb('0x22')]=qs['offset'](_0x519b7e[_0xf5bb('0x4b')]['offset']);}return _0x5b8f0b[_0xf5bb('0xc3')](_0x5e716a);}})[_0xf5bb('0x13')](function(_0x4f617b){if(_0x4f617b){return _0x4f617b?{'count':_0x574231,'rows':_0x4f617b}:null;}})['then'](respondWithResult(_0x342491,null))[_0xf5bb('0x1d')](handleError(_0x342491,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 452184f..94afc0c 100644 --- a/server/api/mailAccount/mailAccount.events.js +++ b/server/api/mailAccount/mailAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2e3=['remove','emit','hasOwnProperty','hook','exports','events','MailAccount','setMaxListeners','save','update'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xf2e3[_0x5f3f88];return _0xd08119;};'use strict';var EventEmitter=require(_0x3f2e('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x3f2e('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3f2e('0x2')](0x0);var events={'afterCreate':_0x3f2e('0x3'),'afterUpdate':_0x3f2e('0x4'),'afterDestroy':_0x3f2e('0x5')};function emitEvent(_0x1634cd){return function(_0x3938e2,_0xabcf5c,_0x216b26){MailAccountEvents['emit'](_0x1634cd+':'+_0x3938e2['id'],_0x3938e2);MailAccountEvents[_0x3f2e('0x6')](_0x1634cd,_0x3938e2);_0x216b26(null);};}for(var e in events){if(events[_0x3f2e('0x7')](e)){var event=events[e];MailAccount[_0x3f2e('0x8')](e,emitEvent(event));}}module[_0x3f2e('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x273b=['../../mysqldb','MailAccount','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x32c78a,_0x13f562){var _0x112393=function(_0xa5be3a){while(--_0xa5be3a){_0x32c78a['push'](_0x32c78a['shift']());}};_0x112393(++_0x13f562);}(_0x273b,0xb8));var _0xb273=function(_0x42e8c4,_0x54233d){_0x42e8c4=_0x42e8c4-0x0;var _0x4d23e7=_0x273b[_0x42e8c4];return _0x4d23e7;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xb273('0x0'))['db'][_0xb273('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xb273('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb273('0x3'),'afterDestroy':'remove'};function emitEvent(_0x45ed16){return function(_0x205c79,_0x59ab96,_0x479103){MailAccountEvents[_0xb273('0x4')](_0x45ed16+':'+_0x205c79['id'],_0x205c79);MailAccountEvents[_0xb273('0x4')](_0x45ed16,_0x205c79);_0x479103(null);};}for(var e in events){if(events[_0xb273('0x5')](e)){var event=events[e];MailAccount[_0xb273('0x6')](e,emitEvent(event));}}module[_0xb273('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 290cd72..fbf2f59 100644 --- a/server/api/mailAccount/mailAccount.model.js +++ b/server/api/mailAccount/mailAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x236a=['CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','./mailAccount.attributes','exports','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','modernAuthentication'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x236a,0x16e));var _0xa236=function(_0x46ecfc,_0x16b78c){_0x46ecfc=_0x46ecfc-0x0;var _0x558779=_0x236a[_0x46ecfc];return _0x558779;};'use strict';var attributes=require(_0xa236('0x0'));module[_0xa236('0x1')]=function(_0x552aff){return _0x552aff['define'](_0xa236('0x2'),attributes,{'tableName':_0xa236('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x571b32=this;var _0x9a1513={'id':_0x571b32['id'],'tls':{'rejectUnauthorized':![]}};if(_0x571b32[_0xa236('0x4')]!==_0xa236('0x5')){_0x9a1513[_0xa236('0x6')]=_0x571b32[_0xa236('0x4')];}else{_0x9a1513[_0xa236('0x7')]=_0x571b32[_0xa236('0x8')][_0xa236('0x7')];_0x9a1513['port']=_0x571b32['Smtp'][_0xa236('0x9')];_0x9a1513['secure']=_0x571b32[_0xa236('0x8')][_0xa236('0xa')];}if(_0x571b32[_0xa236('0x8')]['authentication']){if(_0x571b32[_0xa236('0x8')][_0xa236('0xb')]){if(!_0x571b32['Smtp'][_0xa236('0xc')])throw new Error(_0xa236('0xd'));_0x9a1513[_0xa236('0xe')]={'type':_0xa236('0xf'),'user':_0x571b32[_0xa236('0x8')][_0xa236('0x10')],'accessToken':_0x571b32[_0xa236('0x8')][_0xa236('0xc')]['data5']};}else{_0x9a1513['auth']={'user':_0x571b32[_0xa236('0x8')][_0xa236('0x10')],'pass':_0x571b32[_0xa236('0x8')][_0xa236('0x11')]};}}return _0x9a1513;}}});}; \ No newline at end of file +var _0x2c44=['port','secure','modernAuthentication','CloudProvider','auth','user','data5','pass','define','MailAccount','provider','custom','service','host','Smtp'];(function(_0xf2ee83,_0x24c2c4){var _0x3263b7=function(_0x239eaf){while(--_0x239eaf){_0xf2ee83['push'](_0xf2ee83['shift']());}};_0x3263b7(++_0x24c2c4);}(_0x2c44,0xf8));var _0x42c4=function(_0x46eb62,_0x57f1a3){_0x46eb62=_0x46eb62-0x0;var _0x4446aa=_0x2c44[_0x46eb62];return _0x4446aa;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x353287){return _0x353287[_0x42c4('0x0')](_0x42c4('0x1'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x29c17b=this;var _0x85b88a={'id':_0x29c17b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x29c17b[_0x42c4('0x2')]!==_0x42c4('0x3')){_0x85b88a[_0x42c4('0x4')]=_0x29c17b[_0x42c4('0x2')];}else{_0x85b88a[_0x42c4('0x5')]=_0x29c17b[_0x42c4('0x6')][_0x42c4('0x5')];_0x85b88a['port']=_0x29c17b['Smtp'][_0x42c4('0x7')];_0x85b88a[_0x42c4('0x8')]=_0x29c17b[_0x42c4('0x6')][_0x42c4('0x8')];}if(_0x29c17b[_0x42c4('0x6')]['authentication']){if(_0x29c17b[_0x42c4('0x6')][_0x42c4('0x9')]){if(!_0x29c17b[_0x42c4('0x6')][_0x42c4('0xa')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x85b88a[_0x42c4('0xb')]={'type':'OAuth2','user':_0x29c17b[_0x42c4('0x6')][_0x42c4('0xc')],'accessToken':_0x29c17b[_0x42c4('0x6')][_0x42c4('0xa')][_0x42c4('0xd')]};}else{_0x85b88a[_0x42c4('0xb')]={'user':_0x29c17b['Smtp'][_0x42c4('0xc')],'pass':_0x29c17b[_0x42c4('0x6')][_0x42c4('0xe')]};}}return _0x85b88a;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index e302200..4231d22 100644 --- a/server/api/mailAccount/mailAccount.rpc.js +++ b/server/api/mailAccount/mailAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','debug','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','options','raw','where','limit','include','map','model','attributes','stringify','find','smtp','smtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','CloudProvider','get','omit','getSmtpOptions','list','applications','orderBy','priority','autoclose','push','close','defaults','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','YYYY-MM-DD\x20HH:mm:ss','interaction','MailMessage','create','attachments','originTo','originCc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','UserId','name','unshift','agent','*,*,*,*','startRouting','Start','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var BPromise=require('bluebird');var rs=require(_0x65f6('0x1'));var Redis=require(_0x65f6('0x2'));var db=require(_0x65f6('0x3'))['db'];var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x6'));var client=jayson['client'][_0x65f6('0x7')]({'port':0x232c});config[_0x65f6('0x8')]=_['defaults'](config['redis'],{'host':_0x65f6('0x9'),'port':0x18eb});var socket=require(_0x65f6('0xa'))(new Redis(config[_0x65f6('0x8')]));require(_0x65f6('0xb'))[_0x65f6('0xc')](socket);function respondWithRpcPromise(_0x14f4c7,_0x48d85c,_0x5123ee){return new BPromise(function(_0x18fea1,_0x2f6d5b){return client[_0x65f6('0xd')](_0x14f4c7,_0x5123ee)[_0x65f6('0xe')](function(_0x50d26d){logger[_0x65f6('0xf')]('MailAccount,\x20%s,\x20%s',_0x48d85c,'request\x20sent');logger[_0x65f6('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x48d85c,_0x65f6('0x11'),JSON['stringify'](_0x50d26d));if(_0x50d26d[_0x65f6('0x12')]){if(_0x50d26d[_0x65f6('0x12')][_0x65f6('0x13')]===0x1f4){logger[_0x65f6('0x12')](_0x65f6('0x14'),_0x48d85c,_0x50d26d[_0x65f6('0x12')][_0x65f6('0x15')]);return _0x2f6d5b(_0x50d26d[_0x65f6('0x12')][_0x65f6('0x15')]);}logger[_0x65f6('0x12')]('MailAccount,\x20%s,\x20%s',_0x48d85c,_0x50d26d[_0x65f6('0x12')]['message']);return _0x18fea1(_0x50d26d['error'][_0x65f6('0x15')]);}else{logger[_0x65f6('0xf')](_0x65f6('0x14'),_0x48d85c,_0x65f6('0x11'));_0x18fea1(_0x50d26d[_0x65f6('0x16')][_0x65f6('0x15')]);}})[_0x65f6('0x17')](function(_0x18380e){logger['error']('MailAccount,\x20%s,\x20%s',_0x48d85c,_0x18380e);_0x2f6d5b(_0x18380e);});});}exports[_0x65f6('0x18')]=function(_0x5b4055){var _0x4c81f3=this;return new Promise(function(_0x5c5b91,_0x365159){return db[_0x65f6('0x19')]['findAll']({'raw':_0x5b4055[_0x65f6('0x1a')]?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b4055[_0x65f6('0x1a')]?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1c')]||null:null,'attributes':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')]['attributes']||null:null,'limit':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1d')]||null:null,'include':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x5b4055[_0x65f6('0x1a')]['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x20')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x21')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x20')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes'],'include':_0x29abdb[_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x29abdb['include'],function(_0x325cb4){return{'model':db[_0x325cb4[_0x65f6('0x20')]],'as':_0x325cb4['as'],'attributes':_0x325cb4[_0x65f6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ac04b){logger['info'](_0x65f6('0x18'),_0x5b4055);logger[_0x65f6('0x10')](_0x65f6('0x18'),_0x5b4055,JSON[_0x65f6('0x22')](_0x4ac04b));_0x5c5b91(_0x4ac04b);})[_0x65f6('0x17')](function(_0x14a387){logger[_0x65f6('0x12')]('GetMailAccount',_0x14a387['message'],_0x5b4055);_0x365159(_0x4c81f3[_0x65f6('0x12')](0x1f4,_0x14a387[_0x65f6('0x15')]));});});};exports['ShowMailAccount']=function(_0x4e50c0){var _0x10b368=this;return new Promise(function(_0x1ce43c,_0x11fe3b){return db[_0x65f6('0x19')][_0x65f6('0x23')]({'raw':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0['options'][_0x65f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')]['where']||null:null,'attributes':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x21')]||null:null,'include':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x1e')]?_['map'](_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x1e')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x20')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1e')]?_['map'](_0x4f3e22[_0x65f6('0x1e')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x21')],'include':_0x24f7fd[_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x24f7fd['include'],function(_0x582c7e){return{'model':db[_0x582c7e[_0x65f6('0x20')]],'as':_0x582c7e['as'],'attributes':_0x582c7e['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xe')](function(_0x4e6653){if(_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x24')]===!![])_0x4e6653['setDataValue'](_0x65f6('0x25'),_0x4e6653['getSmtpOptions']());logger['info'](_0x65f6('0x26'),_0x4e50c0);logger[_0x65f6('0x10')](_0x65f6('0x26'),_0x4e50c0,JSON[_0x65f6('0x22')](_0x4e6653));_0x1ce43c(_0x4e6653);})[_0x65f6('0x17')](function(_0x28845a){logger[_0x65f6('0x12')](_0x65f6('0x26'),_0x28845a['message'],_0x4e50c0);_0x11fe3b(_0x10b368[_0x65f6('0x12')](0x1f4,_0x28845a['message']));});});};exports[_0x65f6('0x27')]=function(_0xa4394a){var _0x4ba7db=this;return new Promise(function(_0x2ea7f7,_0x5ef5c2){var _0x32148f={'body':_0xa4394a[_0x65f6('0x28')],'channel':_0x65f6('0x29')};var _0x3fb1c6=_[_0x65f6('0x2a')](_[_0x65f6('0x2b')](db[_0x65f6('0x2c')][_0x65f6('0x2d')]),[_0x65f6('0x2e'),'updatedAt',_0x65f6('0x2f'),_0x65f6('0x30')]);var _0x377ae5=![];if(_0xa4394a[_0x65f6('0x28')]['id']){delete _0xa4394a[_0x65f6('0x28')]['id'];}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')])){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,_0x65f6('0x33')));}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')])||_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')]===''){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')])){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fb1c6));}if(!_[_0x65f6('0x35')](_0x3fb1c6,_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')])){return _0x5ef5c2(_0x4ba7db['error'](0x1f4,_0x65f6('0x36')+_0x3fb1c6));}var _0x3386a2={};_0x3386a2[_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')]]=_0xa4394a['body'][_0x65f6('0x32')];return db['MailAccount'][_0x65f6('0x23')]({'where':{'id':_0xa4394a[_0x65f6('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0x65f6('0x38'),'include':[{'model':db['CmContact'],'as':_0x65f6('0x39'),'where':_0x3386a2,'limit':0x1,'order':[[_0x65f6('0x3a'),_0x65f6('0x3b')]]}]},{'model':db[_0x65f6('0x3c')],'as':_0x65f6('0x3d')},{'model':db[_0x65f6('0x3e')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x65f6('0x3f')}]}]})[_0x65f6('0xe')](function(_0x3b647a){if(_0x3b647a&&_0x3b647a[_0x65f6('0x38')]){var _0x3b907c=_0x3b647a[_0x65f6('0x40')]({'plain':!![]});_0x32148f[_0x65f6('0x37')]=_[_0x65f6('0x41')](_0x3b907c,[_0x65f6('0x3d'),'List']);_0x32148f[_0x65f6('0x37')][_0x65f6('0x25')]=_0x3b647a[_0x65f6('0x42')]();_0x32148f['applications']=_0x3b907c[_0x65f6('0x3d')];_0x32148f[_0x65f6('0x43')]=_0x3b907c['List'];_0x32148f[_0x65f6('0x44')]=_[_0x65f6('0x45')](_0x32148f['applications'],[_0x65f6('0x46')],['asc']);if(_0x32148f[_0x65f6('0x37')]&&_0x32148f[_0x65f6('0x37')][_0x65f6('0x47')]){_0x32148f['applications'][_0x65f6('0x48')]({'id':0x0,'priority':_0x32148f[_0x65f6('0x44')]['length']+0x1,'app':_0x65f6('0x49'),'appdata':_0x65f6('0x47'),'interval':'*,*,*,*'});}if(_0x32148f[_0x65f6('0x37')][_0x65f6('0x3d')]){delete _0x32148f[_0x65f6('0x37')][_0x65f6('0x3d')];}if(_0x32148f[_0x65f6('0x37')][_0x65f6('0x38')]){delete _0x32148f[_0x65f6('0x37')][_0x65f6('0x38')];}if(_0x3b907c['List']['Contacts']['length']){return _0x3b907c[_0x65f6('0x38')][_0x65f6('0x39')][0x0];}var _0x111a8a=_[_0x65f6('0x4a')](_0xa4394a['body'],{'firstName':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')],'ListId':_0x3b907c[_0x65f6('0x30')]});_0x111a8a[_0xa4394a['body'][_0x65f6('0x34')]]=_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')];return db['CmContact']['create'](_0x111a8a);}else{throw new Error(_0x65f6('0x4b'));}})[_0x65f6('0xe')](function(_0x4125cb){_0x32148f[_0x65f6('0x4c')]=_0x4125cb;if(_0x4125cb){if(!_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')]){_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')]=rs[_0x65f6('0x4e')]()+'\x20'+_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')];}var _0x5ba9c6={'ContactId':_0x4125cb['id'],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id'],'inReplyTo':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['messageId'],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')],'cc':_0xa4394a[_0x65f6('0x28')]['message']['cc'],'subject':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4f')],'attach':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x50')],'lastMsgAt':moment()[_0x65f6('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x65f6('0x52')][_0x65f6('0x23')]({'where':{'closed':![],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id']},'include':[{'model':db['MailMessage'],'as':_0x65f6('0x53'),'attributes':[_0x65f6('0x4d')],'where':{'messageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x54')]}}]})[_0x65f6('0xe')](function(_0x5e4759){if(_0x5e4759){return[_0x5e4759,![]];}return db['MailInteraction']['create'](_0x5ba9c6)[_0x65f6('0xe')](function(_0x367d95){return[_0x367d95,!![]];});});}else{throw new Error(_0x65f6('0x55'));}})[_0x65f6('0x56')](function(_0xab6f0,_0x304cf9){if(_0xab6f0){_0x377ae5=_0x304cf9;if(!_0x304cf9){return _0xab6f0['update']({'inReplyTo':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['messageId'],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')],'cc':_0xa4394a['body'][_0x65f6('0x15')]['cc'],'subject':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x4f')],'attach':_0xab6f0[_0x65f6('0x50')]?_0xab6f0[_0x65f6('0x50')]:_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x50')],'substatus':null,'substatusAt':moment()[_0x65f6('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x65f6('0x57')),'lastMsgDirection':'in'});}else{return _0xab6f0;}}})[_0x65f6('0xe')](function(_0x4a9524){_0x32148f[_0x65f6('0x58')]=_0x4a9524['get']({'plain':!![]});_0x32148f[_0x65f6('0x58')]['created']=_0x377ae5;return db[_0x65f6('0x59')][_0x65f6('0x5a')]({'body':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id'],'MailInteractionId':_0x4a9524['id'],'direction':'in','ContactId':_0x32148f[_0x65f6('0x4c')]['id'],'messageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')],'from':_0xa4394a['body']['message'][_0x65f6('0x32')],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['to'],'cc':_0xa4394a['body']['message']['cc'],'subject':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4f')],'attach':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x50')],'Attachments':_0xa4394a['body']['message'][_0x65f6('0x5b')],'originTo':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x5c')],'originCc':_0xa4394a['body'][_0x65f6('0x15')][_0x65f6('0x5d')],'bcc':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['bcc'],'ChatWebsiteId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x5e')]||null,'originChannel':_0xa4394a['body']['message'][_0x65f6('0x5f')]||'Email','ChatOfflineMessageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x60')]||null},{'include':[{'model':db[_0x65f6('0x61')],'as':'Attachments'}]});})['then'](function(_0x56f7f1){_0x32148f[_0x65f6('0x15')]=_0x56f7f1;if(_0x32148f[_0x65f6('0x58')][_0x65f6('0x62')]){return db['User'][_0x65f6('0x23')]({'attributes':['id',_0x65f6('0x63')],'where':{'id':_0x32148f[_0x65f6('0x58')]['UserId']}})[_0x65f6('0xe')](function(_0x15809e){if(_0x15809e){_0x32148f['applications'][_0x65f6('0x64')]({'id':0x0,'priority':0x0,'app':_0x65f6('0x65'),'appdata':_0x15809e['name']+','+(_0x32148f[_0x65f6('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0x65f6('0x66')});}return respondWithRpcPromise('Start',_0x65f6('0x67'),_0x32148f);});}return respondWithRpcPromise(_0x65f6('0x68'),'startRouting',_0x32148f);})[_0x65f6('0xe')](function(_0x442e25){_0x2ea7f7(_0x442e25);})[_0x65f6('0x17')](function(_0x299b85){_0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,_0x299b85[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0x6d38=['result','catch','findAll','options','raw','attributes','limit','map','include','model','then','GetMailAccount','debug','ShowMailAccount','find','smtp','setDataValue','smtpOptions','body','mail','difference','rawAttributes','CompanyId','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','CmList','List','Contacts','updatedAt','DESC','MailApplication','Applications','Smtp','CloudProvider','get','account','omit','getSmtpOptions','list','applications','orderBy','autoclose','push','length','close','create','List\x20not\x20found','messageId','generate','subject','attach','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','MailMessage','contact','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailAccount.socket','register','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var moment=require(_0x86d3('0x0'));var BPromise=require(_0x86d3('0x1'));var rs=require(_0x86d3('0x2'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x86d3('0x3'))('rpc');var config=require(_0x86d3('0x4'));var jayson=require(_0x86d3('0x5'));var client=jayson[_0x86d3('0x6')]['http']({'port':0x232c});config[_0x86d3('0x7')]=_[_0x86d3('0x8')](config[_0x86d3('0x7')],{'host':_0x86d3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x86d3('0xa'))[_0x86d3('0xb')](socket);function respondWithRpcPromise(_0xf273f5,_0x499640,_0x4a277e){return new BPromise(function(_0x3ed317,_0x555e6d){return client['request'](_0xf273f5,_0x4a277e)['then'](function(_0x4300e2){logger[_0x86d3('0xc')]('MailAccount,\x20%s,\x20%s',_0x499640,_0x86d3('0xd'));logger['debug'](_0x86d3('0xe'),_0x499640,_0x86d3('0xd'),JSON[_0x86d3('0xf')](_0x4300e2));if(_0x4300e2[_0x86d3('0x10')]){if(_0x4300e2[_0x86d3('0x10')][_0x86d3('0x11')]===0x1f4){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x4300e2['error'][_0x86d3('0x13')]);return _0x555e6d(_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]);}logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]);return _0x3ed317(_0x4300e2[_0x86d3('0x10')]['message']);}else{logger[_0x86d3('0xc')](_0x86d3('0x12'),_0x499640,_0x86d3('0xd'));_0x3ed317(_0x4300e2[_0x86d3('0x14')][_0x86d3('0x13')]);}})[_0x86d3('0x15')](function(_0x33e459){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x33e459);_0x555e6d(_0x33e459);});});}exports['GetMailAccount']=function(_0x191ba5){var _0x57c340=this;return new Promise(function(_0x6ced9e,_0x5c4d55){return db['MailAccount'][_0x86d3('0x16')]({'raw':_0x191ba5[_0x86d3('0x17')]?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x18')]===undefined?!![]:![]:!![],'where':_0x191ba5['options']?_0x191ba5[_0x86d3('0x17')]['where']||null:null,'attributes':_0x191ba5[_0x86d3('0x17')]?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x19')]||null:null,'limit':_0x191ba5['options']?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x1a')]||null:null,'include':_0x191ba5[_0x86d3('0x17')]?_0x191ba5['options']['include']?_[_0x86d3('0x1b')](_0x191ba5['options'][_0x86d3('0x1c')],function(_0x1bea5e){return{'model':db[_0x1bea5e[_0x86d3('0x1d')]],'as':_0x1bea5e['as'],'attributes':_0x1bea5e[_0x86d3('0x19')],'include':_0x1bea5e['include']?_['map'](_0x1bea5e[_0x86d3('0x1c')],function(_0x611764){return{'model':db[_0x611764['model']],'as':_0x611764['as'],'attributes':_0x611764[_0x86d3('0x19')],'include':_0x611764['include']?_[_0x86d3('0x1b')](_0x611764[_0x86d3('0x1c')],function(_0x287b96){return{'model':db[_0x287b96[_0x86d3('0x1d')]],'as':_0x287b96['as'],'attributes':_0x287b96[_0x86d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0x1e')](function(_0x1f203e){logger[_0x86d3('0xc')](_0x86d3('0x1f'),_0x191ba5);logger[_0x86d3('0x20')](_0x86d3('0x1f'),_0x191ba5,JSON[_0x86d3('0xf')](_0x1f203e));_0x6ced9e(_0x1f203e);})[_0x86d3('0x15')](function(_0x28c25e){logger['error'](_0x86d3('0x1f'),_0x28c25e[_0x86d3('0x13')],_0x191ba5);_0x5c4d55(_0x57c340[_0x86d3('0x10')](0x1f4,_0x28c25e[_0x86d3('0x13')]));});});};exports[_0x86d3('0x21')]=function(_0x245e39){var _0x4a5ff0=this;return new Promise(function(_0xba2f49,_0x5c71df){return db['MailAccount'][_0x86d3('0x22')]({'raw':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')]['where']||null:null,'attributes':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')][_0x86d3('0x19')]||null:null,'include':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')][_0x86d3('0x1c')]?_[_0x86d3('0x1b')](_0x245e39[_0x86d3('0x17')]['include'],function(_0x4cdf45){return{'model':db[_0x4cdf45['model']],'as':_0x4cdf45['as'],'attributes':_0x4cdf45[_0x86d3('0x19')],'include':_0x4cdf45['include']?_[_0x86d3('0x1b')](_0x4cdf45['include'],function(_0x366943){return{'model':db[_0x366943[_0x86d3('0x1d')]],'as':_0x366943['as'],'attributes':_0x366943[_0x86d3('0x19')],'include':_0x366943[_0x86d3('0x1c')]?_[_0x86d3('0x1b')](_0x366943[_0x86d3('0x1c')],function(_0x2d15b9){return{'model':db[_0x2d15b9['model']],'as':_0x2d15b9['as'],'attributes':_0x2d15b9[_0x86d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0x1e')](function(_0x5e2519){if(_0x245e39[_0x86d3('0x17')][_0x86d3('0x23')]===!![])_0x5e2519[_0x86d3('0x24')](_0x86d3('0x25'),_0x5e2519['getSmtpOptions']());logger[_0x86d3('0xc')](_0x86d3('0x21'),_0x245e39);logger[_0x86d3('0x20')]('ShowMailAccount',_0x245e39,JSON[_0x86d3('0xf')](_0x5e2519));_0xba2f49(_0x5e2519);})[_0x86d3('0x15')](function(_0x1a1c06){logger[_0x86d3('0x10')](_0x86d3('0x21'),_0x1a1c06[_0x86d3('0x13')],_0x245e39);_0x5c71df(_0x4a5ff0[_0x86d3('0x10')](0x1f4,_0x1a1c06[_0x86d3('0x13')]));});});};exports['NotifyMailAccount']=function(_0x22bc98){var _0x470978=this;return new Promise(function(_0x2bdc67,_0x461052){var _0x5ebb4d={'body':_0x22bc98[_0x86d3('0x26')],'channel':_0x86d3('0x27')};var _0x6f72be=_[_0x86d3('0x28')](_['keys'](db['CmContact'][_0x86d3('0x29')]),['createdAt','updatedAt',_0x86d3('0x2a'),_0x86d3('0x2b')]);var _0x43490a=![];if(_0x22bc98[_0x86d3('0x26')]['id']){delete _0x22bc98[_0x86d3('0x26')]['id'];}if(_['isNil'](_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x86d3('0x2d')](_0x22bc98[_0x86d3('0x26')]['body'])||_0x22bc98[_0x86d3('0x26')][_0x86d3('0x26')]===''){return _0x461052(_0x470978['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2e')])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x86d3('0x2f')+_0x6f72be));}if(!_[_0x86d3('0x30')](_0x6f72be,_0x22bc98[_0x86d3('0x26')]['mapKey'])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x86d3('0x31')+_0x6f72be));}var _0x5d9dad={};_0x5d9dad[_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2e')]]=_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')];return db[_0x86d3('0x32')][_0x86d3('0x22')]({'where':{'id':_0x22bc98['account']['id']},'include':[{'model':db[_0x86d3('0x33')],'as':_0x86d3('0x34'),'include':[{'model':db['CmContact'],'as':_0x86d3('0x35'),'where':_0x5d9dad,'limit':0x1,'order':[[_0x86d3('0x36'),_0x86d3('0x37')]]}]},{'model':db[_0x86d3('0x38')],'as':_0x86d3('0x39')},{'model':db['MailServerOut'],'as':_0x86d3('0x3a'),'include':[{'model':db[_0x86d3('0x3b')],'as':_0x86d3('0x3b')}]}]})[_0x86d3('0x1e')](function(_0x369b75){if(_0x369b75&&_0x369b75[_0x86d3('0x34')]){var _0x1a4345=_0x369b75[_0x86d3('0x3c')]({'plain':!![]});_0x5ebb4d[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x1a4345,[_0x86d3('0x39'),_0x86d3('0x34')]);_0x5ebb4d['account'][_0x86d3('0x25')]=_0x369b75[_0x86d3('0x3f')]();_0x5ebb4d['applications']=_0x1a4345[_0x86d3('0x39')];_0x5ebb4d[_0x86d3('0x40')]=_0x1a4345[_0x86d3('0x34')];_0x5ebb4d[_0x86d3('0x41')]=_[_0x86d3('0x42')](_0x5ebb4d[_0x86d3('0x41')],['priority'],['asc']);if(_0x5ebb4d['account']&&_0x5ebb4d['account'][_0x86d3('0x43')]){_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x44')]({'id':0x0,'priority':_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x45')]+0x1,'app':_0x86d3('0x46'),'appdata':_0x86d3('0x43'),'interval':'*,*,*,*'});}if(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x39')]){delete _0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x39')];}if(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x34')]){delete _0x5ebb4d[_0x86d3('0x3d')]['List'];}if(_0x1a4345[_0x86d3('0x34')]['Contacts'][_0x86d3('0x45')]){return _0x1a4345[_0x86d3('0x34')][_0x86d3('0x35')][0x0];}var _0x3ffd22=_[_0x86d3('0x8')](_0x22bc98['body'],{'firstName':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')],'ListId':_0x1a4345[_0x86d3('0x2b')]});_0x3ffd22[_0x22bc98['body']['mapKey']]=_0x22bc98['body'][_0x86d3('0x2c')];return db['CmContact'][_0x86d3('0x47')](_0x3ffd22);}else{throw new Error(_0x86d3('0x48'));}})[_0x86d3('0x1e')](function(_0x319ea0){_0x5ebb4d['contact']=_0x319ea0;if(_0x319ea0){if(!_0x22bc98['body']['message'][_0x86d3('0x49')]){_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x49')]=rs[_0x86d3('0x4a')]()+'\x20'+_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')];}var _0x5123fd={'ContactId':_0x319ea0['id'],'MailAccountId':_0x22bc98[_0x86d3('0x3d')]['id'],'inReplyTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x49')],'to':_0x22bc98['body'][_0x86d3('0x13')][_0x86d3('0x2c')],'cc':_0x22bc98['body'][_0x86d3('0x13')]['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4c')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x86d3('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x22bc98['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x86d3('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x4f')]}}]})[_0x86d3('0x1e')](function(_0xa48003){if(_0xa48003){return[_0xa48003,![]];}return db['MailInteraction']['create'](_0x5123fd)[_0x86d3('0x1e')](function(_0xf2c179){return[_0xf2c179,!![]];});});}else{throw new Error(_0x86d3('0x50'));}})[_0x86d3('0x51')](function(_0x22d8eb,_0x1952af){if(_0x22d8eb){_0x43490a=_0x1952af;if(!_0x1952af){return _0x22d8eb[_0x86d3('0x52')]({'inReplyTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x49')],'to':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')],'cc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22d8eb['attach']?_0x22d8eb[_0x86d3('0x4c')]:_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attach'],'substatus':null,'substatusAt':moment()[_0x86d3('0x53')](_0x86d3('0x54')),'lastMsgAt':moment()[_0x86d3('0x53')](_0x86d3('0x54')),'lastMsgDirection':'in'});}else{return _0x22d8eb;}}})['then'](function(_0x41d448){_0x5ebb4d['interaction']=_0x41d448[_0x86d3('0x3c')]({'plain':!![]});_0x5ebb4d[_0x86d3('0x55')][_0x86d3('0x56')]=_0x43490a;return db[_0x86d3('0x57')][_0x86d3('0x47')]({'body':_0x22bc98['body'][_0x86d3('0x26')],'MailAccountId':_0x22bc98['account']['id'],'MailInteractionId':_0x41d448['id'],'direction':'in','ContactId':_0x5ebb4d[_0x86d3('0x58')]['id'],'messageId':_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x49')],'from':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')],'to':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['to'],'cc':_0x22bc98[_0x86d3('0x26')]['message']['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attach'],'Attachments':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attachments'],'originTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x59')],'originCc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5a')],'bcc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5b')],'ChatWebsiteId':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5c')]||null,'originChannel':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['originChannel']||_0x86d3('0x5d'),'ChatOfflineMessageId':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x86d3('0x5f')}]});})[_0x86d3('0x1e')](function(_0x1a97f3){_0x5ebb4d[_0x86d3('0x13')]=_0x1a97f3;if(_0x5ebb4d['interaction']['UserId']){return db[_0x86d3('0x60')]['find']({'attributes':['id',_0x86d3('0x61')],'where':{'id':_0x5ebb4d['interaction']['UserId']}})[_0x86d3('0x1e')](function(_0x28bd40){if(_0x28bd40){_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x62')]({'id':0x0,'priority':0x0,'app':_0x86d3('0x63'),'appdata':_0x28bd40['name']+','+(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x86d3('0x65'),_0x86d3('0x66'),_0x5ebb4d);});}return respondWithRpcPromise('Start',_0x86d3('0x66'),_0x5ebb4d);})['then'](function(_0x1867fc){_0x2bdc67(_0x1867fc);})['catch'](function(_0x5bb2e5){_0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x5bb2e5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 9fd6dc2..5452108 100644 --- a/server/api/mailAccount/mailAccount.socket.js +++ b/server/api/mailAccount/mailAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a1e=['emit','register','length','mailAccount:','save','update'];(function(_0x42c6be,_0x4f7eb1){var _0x25a632=function(_0x4c7dda){while(--_0x4c7dda){_0x42c6be['push'](_0x42c6be['shift']());}};_0x25a632(++_0x4f7eb1);}(_0x4a1e,0xd0));var _0xe4a1=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x4a1e[_0x175e89];return _0x2ed996;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xe4a1('0x0'),'remove',_0xe4a1('0x1')];function createListener(_0x2f16c8,_0x41ff30){return function(_0x3fe241){_0x41ff30[_0xe4a1('0x2')](_0x2f16c8,_0x3fe241);};}function removeListener(_0x4b1ca4,_0x41d483){return function(){MailAccountEvents['removeListener'](_0x4b1ca4,_0x41d483);};}exports[_0xe4a1('0x3')]=function(_0x2d6900){for(var _0x12f216=0x0,_0x192cff=events[_0xe4a1('0x4')];_0x12f216<_0x192cff;_0x12f216++){var _0x23f7ef=events[_0x12f216];var _0x36e134=createListener(_0xe4a1('0x5')+_0x23f7ef,_0x2d6900);MailAccountEvents['on'](_0x23f7ef,_0x36e134);}}; \ No newline at end of file +var _0x57e6=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x4b6f81,_0x57fd87){var _0x2de203=function(_0x1162bb){while(--_0x1162bb){_0x4b6f81['push'](_0x4b6f81['shift']());}};_0x2de203(++_0x57fd87);}(_0x57e6,0x177));var _0x657e=function(_0xa8f24a,_0x48d7d3){_0xa8f24a=_0xa8f24a-0x0;var _0x3a1471=_0x57e6[_0xa8f24a];return _0x3a1471;};'use strict';var MailAccountEvents=require(_0x657e('0x0'));var events=[_0x657e('0x1'),_0x657e('0x2'),_0x657e('0x3')];function createListener(_0x520ec0,_0x7980e0){return function(_0x48a582){_0x7980e0[_0x657e('0x4')](_0x520ec0,_0x48a582);};}function removeListener(_0x773dd8,_0x3324d3){return function(){MailAccountEvents[_0x657e('0x5')](_0x773dd8,_0x3324d3);};}exports[_0x657e('0x6')]=function(_0x24708a){for(var _0x3521b1=0x0,_0x4358f1=events[_0x657e('0x7')];_0x3521b1<_0x4358f1;_0x3521b1++){var _0x440667=events[_0x3521b1];var _0x12807d=createListener(_0x657e('0x8')+_0x440667,_0x24708a);MailAccountEvents['on'](_0x440667,_0x12807d);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 968497a..bd7a8b8 100644 --- a/server/api/mailApplication/index.js +++ b/server/api/mailApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9dd=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','delete','destroy','exports','multer','util'];(function(_0x25b562,_0x1ff8f8){var _0x56553b=function(_0x125af9){while(--_0x125af9){_0x25b562['push'](_0x25b562['shift']());}};_0x56553b(++_0x1ff8f8);}(_0xe9dd,0x1de));var _0xde9d=function(_0x321553,_0x5c0cb5){_0x321553=_0x321553-0x0;var _0x2c770b=_0xe9dd[_0x321553];return _0x2c770b;};'use strict';var multer=require(_0xde9d('0x0'));var util=require(_0xde9d('0x1'));var path=require(_0xde9d('0x2'));var timeout=require(_0xde9d('0x3'));var express=require(_0xde9d('0x4'));var router=express[_0xde9d('0x5')]();var fs_extra=require(_0xde9d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xde9d('0x7'));var controller=require(_0xde9d('0x8'));router[_0xde9d('0x9')](_0xde9d('0xa'),auth[_0xde9d('0xb')](),controller['show']);router[_0xde9d('0xc')](_0xde9d('0xa'),auth[_0xde9d('0xb')](),controller['update']);router[_0xde9d('0xd')](_0xde9d('0xa'),auth['isAuthenticated'](),controller[_0xde9d('0xe')]);module[_0xde9d('0xf')]=router; \ No newline at end of file +var _0x5931=['get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','../../components/auth/service','../../config/environment','./mailApplication.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5931,0x158));var _0x1593=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x5931[_0x35da42];return _0x370035;};'use strict';var multer=require(_0x1593('0x0'));var util=require(_0x1593('0x1'));var path=require(_0x1593('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1593('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1593('0x4'));var controller=require(_0x1593('0x5'));router[_0x1593('0x6')](_0x1593('0x7'),auth[_0x1593('0x8')](),controller[_0x1593('0x9')]);router[_0x1593('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1593('0xb')]);router[_0x1593('0xc')](_0x1593('0x7'),auth[_0x1593('0x8')](),controller[_0x1593('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a69c77a..f48cf9e 100644 --- a/server/api/mailApplication/mailApplication.attributes.js +++ b/server/api/mailApplication/mailApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcec1=['TEXT','STRING','exports','INTEGER','noop'];(function(_0x23ca62,_0x5c5f7f){var _0x569323=function(_0x244ea1){while(--_0x244ea1){_0x23ca62['push'](_0x23ca62['shift']());}};_0x569323(++_0x5c5f7f);}(_0xcec1,0xb1));var _0x1cec=function(_0x419b4c,_0xc124c4){_0x419b4c=_0x419b4c-0x0;var _0x130e35=_0xcec1[_0x419b4c];return _0x130e35;};'use strict';var Sequelize=require('sequelize');module[_0x1cec('0x0')]={'priority':{'type':Sequelize[_0x1cec('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cec('0x2')},'appdata':{'type':Sequelize[_0x1cec('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1cec('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xbfac=['TEXT','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x5cf09e,_0x266304){var _0x8d326e=function(_0x1eb3bd){while(--_0x1eb3bd){_0x5cf09e['push'](_0x5cf09e['shift']());}};_0x8d326e(++_0x266304);}(_0xbfac,0x122));var _0xcbfa=function(_0x4aabc6,_0x348818){_0x4aabc6=_0x4aabc6-0x0;var _0xf26471=_0xbfac[_0x4aabc6];return _0xf26471;};'use strict';var Sequelize=require(_0xcbfa('0x0'));module[_0xcbfa('0x1')]={'priority':{'type':Sequelize[_0xcbfa('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcbfa('0x3')},'appdata':{'type':Sequelize[_0xcbfa('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcbfa('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 85a5ce1..a2364ab 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x4ae2fb,_0x1c1c67){var _0x4f5268=function(_0x11236b){while(--_0x11236b){_0x4ae2fb['push'](_0x4ae2fb['shift']());}};_0x4f5268(++_0x1c1c67);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file +var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x24c9d0,_0x4967b6){var _0x58c87f=function(_0x380793){while(--_0x380793){_0x24c9d0['push'](_0x24c9d0['shift']());}};_0x58c87f(++_0x4967b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index f8ca436..928265b 100644 --- a/server/api/mailApplication/mailApplication.model.js +++ b/server/api/mailApplication/mailApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbfa1=['rimraf','../../config/environment','./mailApplication.attributes','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3e186f,_0x2eb7be){var _0x3595bf=function(_0x5cb578){while(--_0x5cb578){_0x3e186f['push'](_0x3e186f['shift']());}};_0x3595bf(++_0x2eb7be);}(_0xbfa1,0xf7));var _0x1bfa=function(_0x42308e,_0xa8f435){_0x42308e=_0x42308e-0x0;var _0x22d255=_0xbfa1[_0x42308e];return _0x22d255;};'use strict';var _=require(_0x1bfa('0x0'));var util=require(_0x1bfa('0x1'));var logger=require(_0x1bfa('0x2'))(_0x1bfa('0x3'));var moment=require(_0x1bfa('0x4'));var BPromise=require(_0x1bfa('0x5'));var rp=require(_0x1bfa('0x6'));var fs=require('fs');var path=require(_0x1bfa('0x7'));var rimraf=require(_0x1bfa('0x8'));var config=require(_0x1bfa('0x9'));var attributes=require(_0x1bfa('0xa'));module['exports']=function(_0x44b978,_0x15ff2a){return _0x44b978[_0x1bfa('0xb')]('MailApplication',attributes,{'tableName':_0x1bfa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1bfa('0xd'),'collate':_0x1bfa('0xe')});}; \ No newline at end of file +var _0x33c5=['./mailApplication.attributes','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x33c5,0x141));var _0x533c=function(_0x282999,_0x4df660){_0x282999=_0x282999-0x0;var _0x30681f=_0x33c5[_0x282999];return _0x30681f;};'use strict';var _=require(_0x533c('0x0'));var util=require(_0x533c('0x1'));var logger=require(_0x533c('0x2'))(_0x533c('0x3'));var moment=require(_0x533c('0x4'));var BPromise=require(_0x533c('0x5'));var rp=require(_0x533c('0x6'));var fs=require('fs');var path=require(_0x533c('0x7'));var rimraf=require(_0x533c('0x8'));var config=require('../../config/environment');var attributes=require(_0x533c('0x9'));module[_0x533c('0xa')]=function(_0x2b366d,_0x4eab4e){return _0x2b366d[_0x533c('0xb')](_0x533c('0xc'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x533c('0xd'),'collate':_0x533c('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index b625e8a..57012be 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5edf=['stringify','error','code','message','info','request\x20sent','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s'];(function(_0x12b830,_0xd66540){var _0x261dc4=function(_0x57037a){while(--_0x57037a){_0x12b830['push'](_0x12b830['shift']());}};_0x261dc4(++_0xd66540);}(_0x5edf,0x127));var _0xf5ed=function(_0x4594b3,_0x2e60e8){_0x4594b3=_0x4594b3-0x0;var _0x5da75a=_0x5edf[_0x4594b3];return _0x5da75a;};'use strict';var _=require('lodash');var util=require(_0xf5ed('0x0'));var moment=require(_0xf5ed('0x1'));var BPromise=require(_0xf5ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5ed('0x3'));var db=require(_0xf5ed('0x4'))['db'];var utils=require(_0xf5ed('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5ed('0x6'));var jayson=require(_0xf5ed('0x7'));var client=jayson[_0xf5ed('0x8')][_0xf5ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb1cdc2,_0x4fc86d,_0x6874ef){return new BPromise(function(_0x2c695b,_0x8c699e){return client[_0xf5ed('0xa')](_0xb1cdc2,_0x6874ef)[_0xf5ed('0xb')](function(_0x5f4589){logger['info'](_0xf5ed('0xc'),_0x4fc86d,'request\x20sent');logger[_0xf5ed('0xd')](_0xf5ed('0xe'),_0x4fc86d,'request\x20sent',JSON[_0xf5ed('0xf')](_0x5f4589));if(_0x5f4589['error']){if(_0x5f4589[_0xf5ed('0x10')][_0xf5ed('0x11')]===0x1f4){logger[_0xf5ed('0x10')](_0xf5ed('0xc'),_0x4fc86d,_0x5f4589['error'][_0xf5ed('0x12')]);return _0x8c699e(_0x5f4589['error'][_0xf5ed('0x12')]);}logger[_0xf5ed('0x10')]('MailApplication,\x20%s,\x20%s',_0x4fc86d,_0x5f4589[_0xf5ed('0x10')]['message']);return _0x2c695b(_0x5f4589['error']['message']);}else{logger[_0xf5ed('0x13')]('MailApplication,\x20%s,\x20%s',_0x4fc86d,_0xf5ed('0x14'));_0x2c695b(_0x5f4589[_0xf5ed('0x15')][_0xf5ed('0x12')]);}})[_0xf5ed('0x16')](function(_0x5d2f91){logger[_0xf5ed('0x10')](_0xf5ed('0xc'),_0x4fc86d,_0x5d2f91);_0x8c699e(_0x5d2f91);});});}exports[_0xf5ed('0x17')]=function(_0x330724){var _0x340c36=this;return new Promise(function(_0x3007d9,_0x391ba5){return db[_0xf5ed('0x18')][_0xf5ed('0x19')](_0x330724[_0xf5ed('0x1a')],{'raw':_0x330724[_0xf5ed('0x1b')]?_0x330724[_0xf5ed('0x1b')][_0xf5ed('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x330724['options']?_0x330724[_0xf5ed('0x1b')][_0xf5ed('0x1d')]||null:null,'attributes':_0x330724[_0xf5ed('0x1b')]?_0x330724[_0xf5ed('0x1b')][_0xf5ed('0x1e')]||null:null,'limit':_0x330724[_0xf5ed('0x1b')]?_0x330724['options']['limit']||null:null})[_0xf5ed('0xb')](function(_0x161b95){logger['info']('UpdateMailApplication',_0x330724);logger['debug'](_0xf5ed('0x17'),_0x330724,JSON[_0xf5ed('0xf')](_0x161b95));_0x3007d9(_0x161b95);})[_0xf5ed('0x16')](function(_0x50360e){logger[_0xf5ed('0x10')](_0xf5ed('0x17'),_0x50360e[_0xf5ed('0x12')],_0x330724);_0x391ba5(_0x340c36[_0xf5ed('0x10')](0x1f4,_0x50360e[_0xf5ed('0x12')]));});});}; \ No newline at end of file +var _0xf019=['jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailApplication','body','options','raw','where','attributes','limit','then','catch','UpdateMailApplication','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf019,0x1f4));var _0x9f01=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf019[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x9f01('0x0'));var moment=require(_0x9f01('0x1'));var BPromise=require(_0x9f01('0x2'));var rs=require(_0x9f01('0x3'));var fs=require('fs');var Redis=require(_0x9f01('0x4'));var db=require(_0x9f01('0x5'))['db'];var utils=require(_0x9f01('0x6'));var logger=require(_0x9f01('0x7'))(_0x9f01('0x8'));var config=require(_0x9f01('0x9'));var jayson=require(_0x9f01('0xa'));var client=jayson[_0x9f01('0xb')][_0x9f01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c79d4,_0x3157fa,_0x39bec9){return new BPromise(function(_0x2baff5,_0x4248af){return client[_0x9f01('0xd')](_0x2c79d4,_0x39bec9)['then'](function(_0x343337){logger[_0x9f01('0xe')](_0x9f01('0xf'),_0x3157fa,_0x9f01('0x10'));logger[_0x9f01('0x11')](_0x9f01('0x12'),_0x3157fa,'request\x20sent',JSON[_0x9f01('0x13')](_0x343337));if(_0x343337['error']){if(_0x343337[_0x9f01('0x14')][_0x9f01('0x15')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x3157fa,_0x343337[_0x9f01('0x14')][_0x9f01('0x16')]);return _0x4248af(_0x343337['error'][_0x9f01('0x16')]);}logger[_0x9f01('0x14')](_0x9f01('0xf'),_0x3157fa,_0x343337[_0x9f01('0x14')][_0x9f01('0x16')]);return _0x2baff5(_0x343337[_0x9f01('0x14')][_0x9f01('0x16')]);}else{logger[_0x9f01('0xe')](_0x9f01('0xf'),_0x3157fa,_0x9f01('0x10'));_0x2baff5(_0x343337[_0x9f01('0x17')][_0x9f01('0x16')]);}})['catch'](function(_0x5c23e4){logger[_0x9f01('0x14')](_0x9f01('0xf'),_0x3157fa,_0x5c23e4);_0x4248af(_0x5c23e4);});});}exports['UpdateMailApplication']=function(_0x24721e){var _0x2981a4=this;return new Promise(function(_0x35b593,_0x58e951){return db[_0x9f01('0x18')]['update'](_0x24721e[_0x9f01('0x19')],{'raw':_0x24721e[_0x9f01('0x1a')]?_0x24721e[_0x9f01('0x1a')][_0x9f01('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24721e[_0x9f01('0x1a')]?_0x24721e['options'][_0x9f01('0x1c')]||null:null,'attributes':_0x24721e['options']?_0x24721e[_0x9f01('0x1a')][_0x9f01('0x1d')]||null:null,'limit':_0x24721e[_0x9f01('0x1a')]?_0x24721e[_0x9f01('0x1a')][_0x9f01('0x1e')]||null:null})[_0x9f01('0x1f')](function(_0x39516c){logger[_0x9f01('0xe')]('UpdateMailApplication',_0x24721e);logger[_0x9f01('0x11')]('UpdateMailApplication',_0x24721e,JSON['stringify'](_0x39516c));_0x35b593(_0x39516c);})[_0x9f01('0x20')](function(_0x3eccb2){logger[_0x9f01('0x14')](_0x9f01('0x21'),_0x3eccb2[_0x9f01('0x16')],_0x24721e);_0x58e951(_0x2981a4[_0x9f01('0x14')](0x1f4,_0x3eccb2[_0x9f01('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 6843cbe..732782e 100644 --- a/server/api/mailInteraction/index.js +++ b/server/api/mailInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e0c=['post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','delete','mailinteraction:destroy','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','download','create'];(function(_0x40df7c,_0x263a21){var _0x1ec6aa=function(_0x28bb1f){while(--_0x28bb1f){_0x40df7c['push'](_0x40df7c['shift']());}};_0x1ec6aa(++_0x263a21);}(_0x4e0c,0x16a));var _0xc4e0=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x4e0c[_0x209ec9];return _0x129b1b;};'use strict';var express=require(_0xc4e0('0x0'));var router=express[_0xc4e0('0x1')]();var auth=require(_0xc4e0('0x2'));var interaction=require(_0xc4e0('0x3'));var controller=require(_0xc4e0('0x4'));router['get']('/',auth[_0xc4e0('0x5')](),controller[_0xc4e0('0x6')]);router[_0xc4e0('0x7')](_0xc4e0('0x8'),auth[_0xc4e0('0x5')](),controller[_0xc4e0('0x9')]);router[_0xc4e0('0x7')](_0xc4e0('0xa'),auth[_0xc4e0('0x5')](),controller[_0xc4e0('0xb')]);router['get'](_0xc4e0('0xc'),auth[_0xc4e0('0x5')](),controller[_0xc4e0('0xd')]);router[_0xc4e0('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xc4e0('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc4e0('0xf')]);router[_0xc4e0('0x10')](_0xc4e0('0xc'),auth['isAuthenticated'](),controller[_0xc4e0('0x11')]);router[_0xc4e0('0x10')](_0xc4e0('0x12'),auth[_0xc4e0('0x5')](),interaction[_0xc4e0('0x13')](_0xc4e0('0x14'),_0xc4e0('0x15')),controller['addTags']);router[_0xc4e0('0x16')](_0xc4e0('0xa'),auth['isAuthenticated'](),interaction[_0xc4e0('0x13')]('mail',_0xc4e0('0x17')),controller['update']);router[_0xc4e0('0x18')]('/:id',auth[_0xc4e0('0x5')](),interaction['tracked'](_0xc4e0('0x14'),_0xc4e0('0x19')),controller['destroy']);router['delete'](_0xc4e0('0x12'),auth[_0xc4e0('0x5')](),controller[_0xc4e0('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x25df=['destroy','exports','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','/:id','mailinteraction:update','delete','mailinteraction:destroy'];(function(_0x35e552,_0x107286){var _0x340707=function(_0x45d150){while(--_0x45d150){_0x35e552['push'](_0x35e552['shift']());}};_0x340707(++_0x107286);}(_0x25df,0x144));var _0xf25d=function(_0x52a1a9,_0x17632d){_0x52a1a9=_0x52a1a9-0x0;var _0x27fa73=_0x25df[_0x52a1a9];return _0x27fa73;};'use strict';var express=require(_0xf25d('0x0'));var router=express['Router']();var auth=require(_0xf25d('0x1'));var interaction=require(_0xf25d('0x2'));var controller=require('./mailInteraction.controller');router[_0xf25d('0x3')]('/',auth[_0xf25d('0x4')](),controller[_0xf25d('0x5')]);router[_0xf25d('0x3')](_0xf25d('0x6'),auth[_0xf25d('0x4')](),controller[_0xf25d('0x7')]);router[_0xf25d('0x3')]('/:id',auth[_0xf25d('0x4')](),controller[_0xf25d('0x8')]);router[_0xf25d('0x3')](_0xf25d('0x9'),auth[_0xf25d('0x4')](),controller[_0xf25d('0xa')]);router[_0xf25d('0x3')]('/:id/download',auth[_0xf25d('0x4')](),controller['download']);router[_0xf25d('0xb')]('/',auth[_0xf25d('0x4')](),controller['create']);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xf25d('0xc')]);router[_0xf25d('0xb')](_0xf25d('0xd'),auth[_0xf25d('0x4')](),interaction[_0xf25d('0xe')](_0xf25d('0xf'),_0xf25d('0x10')),controller['addTags']);router['put'](_0xf25d('0x11'),auth['isAuthenticated'](),interaction['tracked']('mail',_0xf25d('0x12')),controller['update']);router[_0xf25d('0x13')](_0xf25d('0x11'),auth[_0xf25d('0x4')](),interaction[_0xf25d('0xe')](_0xf25d('0xf'),_0xf25d('0x14')),controller[_0xf25d('0x15')]);router[_0xf25d('0x13')](_0xf25d('0xd'),auth[_0xf25d('0x4')](),controller['removeTags']);module[_0xf25d('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4acb31d..9974025 100644 --- a/server/api/mailInteraction/mailInteraction.attributes.js +++ b/server/api/mailInteraction/mailInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd230=['TEXT','long','BOOLEAN','DATE','ENUM','sequelize','iconv','STRING'];(function(_0x35f901,_0x4dd58a){var _0x497a0a=function(_0xfdfa0b){while(--_0xfdfa0b){_0x35f901['push'](_0x35f901['shift']());}};_0x497a0a(++_0x4dd58a);}(_0xd230,0xd5));var _0x0d23=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xd230[_0x934425];return _0x31d596;};'use strict';var Sequelize=require(_0x0d23('0x0'));var iconv=require(_0x0d23('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d23('0x2')]},'secondDisposition':{'type':Sequelize[_0x0d23('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0d23('0x2')]},'note':{'type':Sequelize[_0x0d23('0x2')]},'inReplyTo':{'type':Sequelize[_0x0d23('0x2')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x0d23('0x3')](_0x0d23('0x4'))},'subject':{'type':Sequelize[_0x0d23('0x3')]()},'attach':{'type':Sequelize[_0x0d23('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0d23('0x6')]},'substatus':{'type':Sequelize[_0x0d23('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x0d23('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x0d23('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0d23('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x0d23('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0d23('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x677f=['STRING','TEXT','long','ENUM','out','sequelize','iconv','BOOLEAN','DATE'];(function(_0x3d568b,_0x1430ae){var _0x194fed=function(_0x3849be){while(--_0x3849be){_0x3d568b['push'](_0x3d568b['shift']());}};_0x194fed(++_0x1430ae);}(_0x677f,0xf8));var _0xf677=function(_0x30adea,_0x18c1ec){_0x30adea=_0x30adea-0x0;var _0x1e5137=_0x677f[_0x30adea];return _0x1e5137;};'use strict';var Sequelize=require(_0xf677('0x0'));var iconv=require(_0xf677('0x1'));module['exports']={'closed':{'type':Sequelize[_0xf677('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf677('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf677('0x4')]},'note':{'type':Sequelize[_0xf677('0x4')]},'inReplyTo':{'type':Sequelize[_0xf677('0x4')](0x1fe)},'to':{'type':Sequelize[_0xf677('0x4')]},'cc':{'type':Sequelize[_0xf677('0x5')](_0xf677('0x6'))},'subject':{'type':Sequelize[_0xf677('0x5')]()},'attach':{'type':Sequelize[_0xf677('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xf677('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xf677('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf677('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf677('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf677('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 8f0accf..9ccb16b 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x121c=['hasOwnProperty','nolimit','sort','where','MailInteractionId','filter','map','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','rows','omit','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','headers','bcc','Bcc','basename','existsSync','readFileSync','build','eml-format','rimraf','moment','util','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','index','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','query','catch','show','params','model','keys','filters','intersection','fields','attributes','length','merge','options','create','body','find','describe','addMessage','MailMessage','ids','getMessages'];(function(_0x20aa7b,_0x29aa7b){var _0x103b5a=function(_0x3c59f1){while(--_0x3c59f1){_0x20aa7b['push'](_0x20aa7b['shift']());}};_0x103b5a(++_0x29aa7b);}(_0x121c,0x17a));var _0xc121=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x121c[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require(_0xc121('0x0'));var rimraf=require(_0xc121('0x1'));var zipdir=require('zip-dir');var moment=require(_0xc121('0x2'));var BPromise=require('bluebird');var util=require(_0xc121('0x3'));var path=require('path');var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0xc121('0x4'));var interaction=require(_0xc121('0x5'));var qs=require(_0xc121('0x6'));var logger=require(_0xc121('0x7'))('api');var config=require('../../config/environment');var db=require(_0xc121('0x8'))['db'];var htmlEntities=require(_0xc121('0x9'));config['redis']=_[_0xc121('0xa')](config[_0xc121('0xb')],{'host':_0xc121('0xc'),'port':0x18eb});var socket=require(_0xc121('0xd'))(new Redis(config[_0xc121('0xb')]));require(_0xc121('0xe'))[_0xc121('0xf')](socket);function respondWithStatusCode(_0x34d159,_0x2654b1){_0x2654b1=_0x2654b1||0xcc;return function(_0x529bab){if(_0x529bab){return _0x34d159['sendStatus'](_0x2654b1);}return _0x34d159[_0xc121('0x10')](_0x2654b1)['end']();};}function respondWithResult(_0x516b48,_0x1fa1e0){_0x1fa1e0=_0x1fa1e0||0xc8;return function(_0x4a7188){if(_0x4a7188){return _0x516b48[_0xc121('0x10')](_0x1fa1e0)[_0xc121('0x11')](_0x4a7188);}};}function respondWithFilteredResult(_0x5878f2,_0x1ffdbd){return function(_0x14fcbd){if(_0x14fcbd){var _0x5a42ca=typeof _0x1ffdbd[_0xc121('0x12')]==='undefined'&&typeof _0x1ffdbd['limit']===_0xc121('0x13');var _0x3dad48=_0x14fcbd[_0xc121('0x14')];var _0x27b9f0=_0x5a42ca?0x0:_0x1ffdbd[_0xc121('0x12')];var _0x1d4205=_0x5a42ca?_0x14fcbd[_0xc121('0x14')]:_0x1ffdbd[_0xc121('0x12')]+_0x1ffdbd[_0xc121('0x15')];var _0x1247a6;if(_0x1d4205>=_0x3dad48){_0x1d4205=_0x3dad48;_0x1247a6=0xc8;}else{_0x1247a6=0xce;}_0x5878f2[_0xc121('0x10')](_0x1247a6);return _0x5878f2[_0xc121('0x16')](_0xc121('0x17'),_0x27b9f0+'-'+_0x1d4205+'/'+_0x3dad48)['json'](_0x14fcbd);}return null;};}function saveUpdates(_0x333459){return function(_0xe5fb58){if(_0xe5fb58){return _0xe5fb58[_0xc121('0x18')](_0x333459)[_0xc121('0x19')](function(_0x53cbdb){return _0x53cbdb;});}return null;};}function removeEntity(_0x3e76aa){return function(_0x28f7bb){if(_0x28f7bb){return _0x28f7bb[_0xc121('0x1a')]()[_0xc121('0x19')](function(){_0x3e76aa[_0xc121('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x350ff5){return function(_0x1b783e){if(!_0x1b783e){_0x350ff5[_0xc121('0x1b')](0x194);}return _0x1b783e;};}function handleError(_0xa0d27,_0x677225){_0x677225=_0x677225||0x1f4;return function(_0x54df75){logger[_0xc121('0x1c')](_0x54df75[_0xc121('0x1d')]);if(_0x54df75['name']){delete _0x54df75[_0xc121('0x1e')];}_0xa0d27[_0xc121('0x10')](_0x677225)[_0xc121('0x1f')](_0x54df75);};}exports[_0xc121('0x20')]=function(_0xe6e910,_0x4139b8){var _0x14175c={};var _0x5ef162=_['map'](db[_0xc121('0x21')][_0xc121('0x22')],function(_0x55d393){return{'name':_0x55d393[_0xc121('0x23')],'type':_0x55d393[_0xc121('0x24')][_0xc121('0x25')]};});_0x14175c=qs[_0xc121('0x26')](_0x5ef162,_0xe6e910);return interaction[_0xc121('0x27')](_0xc121('0x28'),_0xe6e910[_0xc121('0x29')],_0xe6e910['user'],_0x14175c,_0x5ef162)['then'](respondWithFilteredResult(_0x4139b8,_0x14175c))[_0xc121('0x2a')](handleError(_0x4139b8,null));};exports[_0xc121('0x2b')]=function(_0x49668f,_0x3816c2){var _0x681c1f={'raw':![],'where':{'id':_0x49668f[_0xc121('0x2c')]['id']}},_0x530b64={};_0x530b64[_0xc121('0x2d')]=_[_0xc121('0x2e')](db[_0xc121('0x21')][_0xc121('0x22')]);_0x530b64[_0xc121('0x29')]=_['keys'](_0x49668f[_0xc121('0x29')]);_0x530b64[_0xc121('0x2f')]=_[_0xc121('0x30')](_0x530b64[_0xc121('0x2d')],_0x530b64['query']);_0x681c1f['attributes']=_[_0xc121('0x30')](_0x530b64[_0xc121('0x2d')],qs[_0xc121('0x31')](_0x49668f['query'][_0xc121('0x31')]));_0x681c1f[_0xc121('0x32')]=_0x681c1f[_0xc121('0x32')][_0xc121('0x33')]?_0x681c1f['attributes']:_0x530b64[_0xc121('0x2d')];if(_0x49668f['query']['includeAll']){_0x681c1f['include']=[{'all':!![]}];}_0x681c1f=_[_0xc121('0x34')]({},_0x681c1f,_0x49668f[_0xc121('0x35')]);return db[_0xc121('0x21')]['find'](_0x681c1f)['then'](handleEntityNotFound(_0x3816c2,null))[_0xc121('0x19')](respondWithResult(_0x3816c2,null))[_0xc121('0x2a')](handleError(_0x3816c2,null));};exports['create']=function(_0x492e0f,_0x15d36d){return db[_0xc121('0x21')][_0xc121('0x36')](_0x492e0f[_0xc121('0x37')],{})[_0xc121('0x19')](respondWithResult(_0x15d36d,0xc9))[_0xc121('0x2a')](handleError(_0x15d36d,null));};exports[_0xc121('0x18')]=function(_0xf2bc2e,_0x50dca4){if(_0xf2bc2e['body']['id']){delete _0xf2bc2e[_0xc121('0x37')]['id'];}return db[_0xc121('0x21')][_0xc121('0x38')]({'where':{'id':_0xf2bc2e[_0xc121('0x2c')]['id']}})[_0xc121('0x19')](handleEntityNotFound(_0x50dca4,null))[_0xc121('0x19')](saveUpdates(_0xf2bc2e['body'],null))[_0xc121('0x19')](respondWithResult(_0x50dca4,null))[_0xc121('0x2a')](handleError(_0x50dca4,null));};exports[_0xc121('0x1a')]=function(_0x177283,_0x2e71c4){return db['MailInteraction'][_0xc121('0x38')]({'where':{'id':_0x177283[_0xc121('0x2c')]['id']}})[_0xc121('0x19')](handleEntityNotFound(_0x2e71c4,null))[_0xc121('0x19')](removeEntity(_0x2e71c4,null))[_0xc121('0x2a')](handleError(_0x2e71c4,null));};exports['describe']=function(_0x474f17,_0x67e759){return db[_0xc121('0x21')][_0xc121('0x39')]()[_0xc121('0x19')](respondWithResult(_0x67e759,null))[_0xc121('0x2a')](handleError(_0x67e759,null));};exports[_0xc121('0x3a')]=function(_0x30d5c9,_0x5ab80a){return db[_0xc121('0x3b')][_0xc121('0x38')]({'where':{'id':_0x30d5c9['params']['id']}})['then'](handleEntityNotFound(_0x5ab80a,null))[_0xc121('0x19')](function(_0x36653f){if(_0x36653f){return _0x36653f[_0xc121('0x3a')](_0x30d5c9['body'][_0xc121('0x3c')],_['omit'](_0x30d5c9['body'],[_0xc121('0x3c'),'id'])||{});}})[_0xc121('0x19')](respondWithResult(_0x5ab80a,null))[_0xc121('0x2a')](handleError(_0x5ab80a,null));};exports[_0xc121('0x3d')]=function(_0x8da276,_0x5d9c3b){var _0x90d09={'raw':![],'where':{}};var _0x449ee7={};var _0x1f903d={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x8da276[_0xc121('0x2c')]['id']}})[_0xc121('0x19')](handleEntityNotFound(_0x5d9c3b,null))[_0xc121('0x19')](function(_0x319a53){if(_0x319a53){_0x449ee7[_0xc121('0x2d')]=_['keys'](db[_0xc121('0x3b')][_0xc121('0x22')]);_0x449ee7['query']=_['keys'](_0x8da276['query']);_0x449ee7[_0xc121('0x2f')]=_[_0xc121('0x30')](_0x449ee7[_0xc121('0x2d')],_0x449ee7['query']);_0x90d09['attributes']=_[_0xc121('0x30')](_0x449ee7[_0xc121('0x2d')],qs[_0xc121('0x31')](_0x8da276[_0xc121('0x29')]['fields']));_0x90d09[_0xc121('0x32')]=_0x90d09['attributes']['length']?_0x90d09[_0xc121('0x32')]:_0x449ee7[_0xc121('0x2d')];if(!_0x8da276['query'][_0xc121('0x3e')](_0xc121('0x3f'))){_0x90d09[_0xc121('0x15')]=qs[_0xc121('0x15')](_0x8da276[_0xc121('0x29')][_0xc121('0x15')]);_0x90d09['offset']=qs[_0xc121('0x12')](_0x8da276['query'][_0xc121('0x12')]);}_0x90d09['order']=qs[_0xc121('0x40')](_0x8da276[_0xc121('0x29')][_0xc121('0x40')]);_0x90d09[_0xc121('0x41')]=qs['filters'](_['pick'](_0x8da276['query'],_0x449ee7[_0xc121('0x2f')]));_0x90d09[_0xc121('0x41')][_0xc121('0x42')]=_0x319a53['id'];if(_0x8da276[_0xc121('0x29')][_0xc121('0x43')]){_0x90d09[_0xc121('0x41')]=_[_0xc121('0x34')](_0x90d09[_0xc121('0x41')],{'$or':_[_0xc121('0x44')](_0x90d09[_0xc121('0x32')],function(_0x220eec){var _0x545dde={};_0x545dde[_0x220eec]={'$like':'%'+_0x8da276[_0xc121('0x29')]['filter']+'%'};return _0x545dde;})});}if(_0x8da276['query'][_0xc121('0x45')]){var _0x4a0794=_0x8da276['query'][_0xc121('0x45')]['split'](',');var _0x71a83b={};_0x71a83b[_0x4a0794[0x0]]={'$gte':moment(_0x4a0794[0x1])['format'](_0xc121('0x46'))};_0x90d09[_0xc121('0x41')]=_[_0xc121('0x34')](_0x90d09[_0xc121('0x41')],_0x71a83b);}_0x90d09=_[_0xc121('0x34')]({},_0x90d09,_0x8da276[_0xc121('0x35')]);return db['MailMessage'][_0xc121('0x14')]({'where':_0x90d09['where']})[_0xc121('0x19')](function(_0x3ba492){_0x1f903d['count']=_0x3ba492;if(_0x8da276[_0xc121('0x29')][_0xc121('0x47')]){_0x90d09['include']=[{'all':!![]}];}return db[_0xc121('0x3b')][_0xc121('0x27')](_0x90d09);})[_0xc121('0x19')](function(_0x567ce0){if(_0x8da276['query'][_0xc121('0x48')]===_0xc121('0x49')){for(var _0x1cce9b=0x0;_0x1cce9b<_0x567ce0[_0xc121('0x33')];_0x1cce9b++){_0x567ce0[_0x1cce9b][_0xc121('0x37')]=juice(_0x567ce0[_0x1cce9b][_0xc121('0x37')]);}}_0x1f903d[_0xc121('0x4a')]=_0x567ce0;return _0x1f903d;});}})[_0xc121('0x19')](respondWithFilteredResult(_0x5d9c3b,_0x90d09))['catch'](handleError(_0x5d9c3b,null));};exports['addTags']=function(_0x58ea04,_0x1aed20){return db[_0xc121('0x21')]['find']({'where':{'id':_0x58ea04[_0xc121('0x2c')]['id']}})[_0xc121('0x19')](handleEntityNotFound(_0x1aed20,null))[_0xc121('0x19')](function(_0x4786c2){if(_0x4786c2){return _0x4786c2['setTags'](_0x58ea04[_0xc121('0x37')][_0xc121('0x3c')],_[_0xc121('0x4b')](_0x58ea04[_0xc121('0x37')],['ids','id'])||{})['spread'](function(){return db[_0xc121('0x4c')][_0xc121('0x27')]({'attributes':['id','name',_0xc121('0x4d')],'where':{'id':_0x58ea04['body'][_0xc121('0x3c')]}});})[_0xc121('0x19')](function(_0x5ad426){socket[_0xc121('0x4e')](_0xc121('0x4f'),{'id':Number(_0x58ea04[_0xc121('0x2c')]['id']),'tags':_0x5ad426||[]});return{'id':Number(_0x58ea04['params']['id']),'tags':_0x5ad426||[]};});}})[_0xc121('0x19')](respondWithResult(_0x1aed20,null))[_0xc121('0x2a')](handleError(_0x1aed20,null));};exports[_0xc121('0x50')]=function(_0x23c58b,_0x211772){return db['MailInteraction'][_0xc121('0x38')]({'where':{'id':_0x23c58b['params']['id']}})[_0xc121('0x19')](handleEntityNotFound(_0x211772,null))['then'](function(_0x453bbb){if(_0x453bbb){return _0x453bbb[_0xc121('0x50')](_0x23c58b[_0xc121('0x29')][_0xc121('0x3c')]);}})['then'](respondWithStatusCode(_0x211772,null))['catch'](handleError(_0x211772,null));};exports[_0xc121('0x51')]=function(_0x3514f3,_0x41e2d9){var _0xaf0b24=moment()[_0xc121('0x52')]()[_0xc121('0x53')]();var _0x3e1609=path['join'](config[_0xc121('0x54')],_0xc121('0x55'),_0xc121('0x56'),_0xc121('0x57'));var _0x459cf1=path[_0xc121('0x58')](config[_0xc121('0x54')],_0xc121('0x55'),_0xc121('0x56'),_0xc121('0x59'));var _0x8e0619=path[_0xc121('0x58')](_0x3e1609,_0xaf0b24);var _0x2ecb5a=util[_0xc121('0x5a')](_0xc121('0x5b'),_0x3514f3[_0xc121('0x2c')]['id'],_0xaf0b24);var _0x14d03f=path[_0xc121('0x58')](_0x3e1609,_0x2ecb5a);var _0x3fd4e3=[];if(_0x3514f3[_0xc121('0x29')]['attachments']){_0x3fd4e3[_0xc121('0x5c')]({'model':db[_0xc121('0x5d')],'as':_0xc121('0x5e'),'raw':!![]});}var _0x45a19e=[{'model':db[_0xc121('0x3b')],'as':_0xc121('0x5f'),'attributes':['id',_0xc121('0x37'),'from','to','cc','bcc',_0xc121('0x60'),_0xc121('0x61')],'where':{'secret':![]},'order':qs[_0xc121('0x40')]('id'),'include':_0x3fd4e3}];return db[_0xc121('0x21')][_0xc121('0x38')]({'where':{'id':_0x3514f3['params']['id']},'include':_0x45a19e})[_0xc121('0x19')](handleEntityNotFound(_0x41e2d9,null))['then'](function(_0x169c52){if(_0x169c52&&_0x169c52['Messages']){var _0x472aeb=_0x169c52[_0xc121('0x62')]({'plain':!![]});fs[_0xc121('0x63')](_0x8e0619);return BPromise[_0xc121('0x64')](_0x472aeb['Messages'],function(_0x5ce043,_0x189d72){var _0x1db515={'from':_0x5ce043['from'],'to':_0x5ce043['to']||_0xc121('0x65'),'subject':_0x5ce043[_0xc121('0x60')],'html':htmlEntities[_0xc121('0x66')](_0x5ce043['body']),'headers':{'Date':moment(_0x5ce043[_0xc121('0x61')])[_0xc121('0x5a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5ce043['cc']){_0x1db515[_0xc121('0x67')]['Cc']=_0x5ce043['cc'];}if(_0x5ce043[_0xc121('0x68')]){_0x1db515[_0xc121('0x67')][_0xc121('0x69')]=_0x5ce043['bcc'];}return new BPromise(function(_0x291749,_0x221c99){if(_0x5ce043['Attachments']){for(var _0x335b69=0x0;_0x335b69<_0x5ce043[_0xc121('0x5e')][_0xc121('0x33')];_0x335b69++){var _0x46a026=_0x5ce043['Attachments'][_0x335b69];var _0x537721=path[_0xc121('0x58')](_0x459cf1,_0x46a026[_0xc121('0x6a')]);if(fs[_0xc121('0x6b')](_0x537721)){_0x1db515[_0xc121('0x59')][_0xc121('0x5c')]({'name':_0x46a026['name'],'contentType':_0x46a026['type'],'data':fs[_0xc121('0x6c')](_0x537721)});}}}emlformat[_0xc121('0x6d')](_0x1db515,function(_0x3aebdc,_0x47f6aa){if(_0x3aebdc)return _0x221c99(_0x3aebdc);fs['writeFileSync'](path[_0xc121('0x58')](_0x8e0619,util['format']('message%d.eml',_0x189d72)),_0x47f6aa);return _0x291749(_0x47f6aa);});});})[_0xc121('0x19')](function(){return new BPromise(function(_0x7c1559,_0x50367d){zipdir(_0x8e0619,{'saveTo':_0x14d03f},function(_0x272762,_0x1a32eb){if(_0x272762)return _0x50367d(_0x272762);return _0x7c1559(_0x1a32eb);});})['then'](function(){return new BPromise(function(_0x23f03a,_0x3b2bf9){rimraf(_0x8e0619,function(_0xf0047e){if(_0xf0047e)_0x3b2bf9(_0xf0047e);return _0x23f03a();});});})[_0xc121('0x19')](function(){return _0x41e2d9[_0xc121('0x51')](_0x14d03f,_0x2ecb5a,function(_0x4a4189){if(!_0x4a4189)fs['unlinkSync'](_0x14d03f);});});});}else{return _0x41e2d9[_0xc121('0x1b')](0xc8);}})[_0xc121('0x2a')](handleError(_0x41e2d9,null));}; \ No newline at end of file +var _0xba44=['rawAttributes','filters','intersection','attributes','fields','length','includeAll','options','find','catch','create','body','describe','MailMessage','addMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','Tag','removeTags','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','from','bcc','subject','createdAt','mkdirSync','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','push','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','path','juice','../../config/logger','api','../../config/environment','html-entities','redis','defaults','localhost','./mailInteraction.socket','sendStatus','status','end','json','offset','limit','count','then','destroy','error','stack','name','send','index','map','fieldName','type','key','getOptions','mail','query','user','params','model','keys','MailInteraction'];(function(_0x51f8f9,_0x318840){var _0x4879a9=function(_0x561b65){while(--_0x561b65){_0x51f8f9['push'](_0x51f8f9['shift']());}};_0x4879a9(++_0x318840);}(_0xba44,0x109));var _0x4ba4=function(_0x26c63c,_0x5e92c8){_0x26c63c=_0x26c63c-0x0;var _0x462227=_0xba44[_0x26c63c];return _0x462227;};'use strict';var emlformat=require(_0x4ba4('0x0'));var rimraf=require(_0x4ba4('0x1'));var zipdir=require(_0x4ba4('0x2'));var moment=require(_0x4ba4('0x3'));var BPromise=require(_0x4ba4('0x4'));var util=require('util');var path=require(_0x4ba4('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0x4ba4('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x4ba4('0x7'))(_0x4ba4('0x8'));var config=require(_0x4ba4('0x9'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x4ba4('0xa'));config[_0x4ba4('0xb')]=_[_0x4ba4('0xc')](config[_0x4ba4('0xb')],{'host':_0x4ba4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4ba4('0xe'))['register'](socket);function respondWithStatusCode(_0x3b2c5e,_0x3657df){_0x3657df=_0x3657df||0xcc;return function(_0x329efb){if(_0x329efb){return _0x3b2c5e[_0x4ba4('0xf')](_0x3657df);}return _0x3b2c5e[_0x4ba4('0x10')](_0x3657df)[_0x4ba4('0x11')]();};}function respondWithResult(_0x2ada4b,_0x54d33c){_0x54d33c=_0x54d33c||0xc8;return function(_0x2a91f1){if(_0x2a91f1){return _0x2ada4b[_0x4ba4('0x10')](_0x54d33c)[_0x4ba4('0x12')](_0x2a91f1);}};}function respondWithFilteredResult(_0x82990b,_0x169f75){return function(_0xf92a7d){if(_0xf92a7d){var _0x314cdc=typeof _0x169f75[_0x4ba4('0x13')]==='undefined'&&typeof _0x169f75[_0x4ba4('0x14')]==='undefined';var _0xc5f93e=_0xf92a7d[_0x4ba4('0x15')];var _0x39f7d3=_0x314cdc?0x0:_0x169f75[_0x4ba4('0x13')];var _0x251b5a=_0x314cdc?_0xf92a7d[_0x4ba4('0x15')]:_0x169f75[_0x4ba4('0x13')]+_0x169f75['limit'];var _0x3bf3c8;if(_0x251b5a>=_0xc5f93e){_0x251b5a=_0xc5f93e;_0x3bf3c8=0xc8;}else{_0x3bf3c8=0xce;}_0x82990b[_0x4ba4('0x10')](_0x3bf3c8);return _0x82990b['set']('Content-Range',_0x39f7d3+'-'+_0x251b5a+'/'+_0xc5f93e)[_0x4ba4('0x12')](_0xf92a7d);}return null;};}function saveUpdates(_0x1dd502){return function(_0x27da1c){if(_0x27da1c){return _0x27da1c['update'](_0x1dd502)[_0x4ba4('0x16')](function(_0x26a349){return _0x26a349;});}return null;};}function removeEntity(_0x3ed670){return function(_0x891187){if(_0x891187){return _0x891187[_0x4ba4('0x17')]()['then'](function(){_0x3ed670[_0x4ba4('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58180a){return function(_0x2947fe){if(!_0x2947fe){_0x58180a[_0x4ba4('0xf')](0x194);}return _0x2947fe;};}function handleError(_0xdd8c7c,_0x4901ac){_0x4901ac=_0x4901ac||0x1f4;return function(_0x5745b9){logger[_0x4ba4('0x18')](_0x5745b9[_0x4ba4('0x19')]);if(_0x5745b9['name']){delete _0x5745b9[_0x4ba4('0x1a')];}_0xdd8c7c[_0x4ba4('0x10')](_0x4901ac)[_0x4ba4('0x1b')](_0x5745b9);};}exports[_0x4ba4('0x1c')]=function(_0x30ac95,_0x4ce8c9){var _0xdec2dd={};var _0x15deeb=_[_0x4ba4('0x1d')](db['MailInteraction']['rawAttributes'],function(_0x4962cb){return{'name':_0x4962cb[_0x4ba4('0x1e')],'type':_0x4962cb[_0x4ba4('0x1f')][_0x4ba4('0x20')]};});_0xdec2dd=qs[_0x4ba4('0x21')](_0x15deeb,_0x30ac95);return interaction['findAll'](_0x4ba4('0x22'),_0x30ac95[_0x4ba4('0x23')],_0x30ac95[_0x4ba4('0x24')],_0xdec2dd,_0x15deeb)[_0x4ba4('0x16')](respondWithFilteredResult(_0x4ce8c9,_0xdec2dd))['catch'](handleError(_0x4ce8c9,null));};exports['show']=function(_0x14d06a,_0x300da7){var _0x41aa68={'raw':![],'where':{'id':_0x14d06a[_0x4ba4('0x25')]['id']}},_0x52450b={};_0x52450b[_0x4ba4('0x26')]=_[_0x4ba4('0x27')](db[_0x4ba4('0x28')][_0x4ba4('0x29')]);_0x52450b[_0x4ba4('0x23')]=_['keys'](_0x14d06a[_0x4ba4('0x23')]);_0x52450b[_0x4ba4('0x2a')]=_[_0x4ba4('0x2b')](_0x52450b[_0x4ba4('0x26')],_0x52450b[_0x4ba4('0x23')]);_0x41aa68[_0x4ba4('0x2c')]=_['intersection'](_0x52450b['model'],qs[_0x4ba4('0x2d')](_0x14d06a[_0x4ba4('0x23')][_0x4ba4('0x2d')]));_0x41aa68[_0x4ba4('0x2c')]=_0x41aa68['attributes'][_0x4ba4('0x2e')]?_0x41aa68[_0x4ba4('0x2c')]:_0x52450b['model'];if(_0x14d06a[_0x4ba4('0x23')][_0x4ba4('0x2f')]){_0x41aa68['include']=[{'all':!![]}];}_0x41aa68=_['merge']({},_0x41aa68,_0x14d06a[_0x4ba4('0x30')]);return db[_0x4ba4('0x28')][_0x4ba4('0x31')](_0x41aa68)[_0x4ba4('0x16')](handleEntityNotFound(_0x300da7,null))[_0x4ba4('0x16')](respondWithResult(_0x300da7,null))[_0x4ba4('0x32')](handleError(_0x300da7,null));};exports[_0x4ba4('0x33')]=function(_0x574f9d,_0x31cdfd){return db['MailInteraction'][_0x4ba4('0x33')](_0x574f9d['body'],{})[_0x4ba4('0x16')](respondWithResult(_0x31cdfd,0xc9))[_0x4ba4('0x32')](handleError(_0x31cdfd,null));};exports['update']=function(_0x38d079,_0x2a68ab){if(_0x38d079[_0x4ba4('0x34')]['id']){delete _0x38d079[_0x4ba4('0x34')]['id'];}return db[_0x4ba4('0x28')]['find']({'where':{'id':_0x38d079[_0x4ba4('0x25')]['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x2a68ab,null))[_0x4ba4('0x16')](saveUpdates(_0x38d079[_0x4ba4('0x34')],null))['then'](respondWithResult(_0x2a68ab,null))[_0x4ba4('0x32')](handleError(_0x2a68ab,null));};exports[_0x4ba4('0x17')]=function(_0xb4d7ea,_0x44eff8){return db[_0x4ba4('0x28')]['find']({'where':{'id':_0xb4d7ea[_0x4ba4('0x25')]['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x44eff8,null))['then'](removeEntity(_0x44eff8,null))[_0x4ba4('0x32')](handleError(_0x44eff8,null));};exports[_0x4ba4('0x35')]=function(_0x37ae0d,_0x195520){return db[_0x4ba4('0x28')][_0x4ba4('0x35')]()[_0x4ba4('0x16')](respondWithResult(_0x195520,null))[_0x4ba4('0x32')](handleError(_0x195520,null));};exports['addMessage']=function(_0x416c09,_0x1a9c63){return db[_0x4ba4('0x36')]['find']({'where':{'id':_0x416c09[_0x4ba4('0x25')]['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x1a9c63,null))[_0x4ba4('0x16')](function(_0x22963d){if(_0x22963d){return _0x22963d[_0x4ba4('0x37')](_0x416c09[_0x4ba4('0x34')][_0x4ba4('0x38')],_[_0x4ba4('0x39')](_0x416c09[_0x4ba4('0x34')],['ids','id'])||{});}})[_0x4ba4('0x16')](respondWithResult(_0x1a9c63,null))['catch'](handleError(_0x1a9c63,null));};exports['getMessages']=function(_0x1dc505,_0x457c59){var _0x5f5573={'raw':![],'where':{}};var _0xdf152e={};var _0x51e08e={'count':0x0,'rows':[]};return db[_0x4ba4('0x28')]['findOne']({'where':{'id':_0x1dc505[_0x4ba4('0x25')]['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x457c59,null))[_0x4ba4('0x16')](function(_0x391f04){if(_0x391f04){_0xdf152e[_0x4ba4('0x26')]=_[_0x4ba4('0x27')](db[_0x4ba4('0x36')][_0x4ba4('0x29')]);_0xdf152e['query']=_[_0x4ba4('0x27')](_0x1dc505[_0x4ba4('0x23')]);_0xdf152e[_0x4ba4('0x2a')]=_['intersection'](_0xdf152e[_0x4ba4('0x26')],_0xdf152e[_0x4ba4('0x23')]);_0x5f5573[_0x4ba4('0x2c')]=_[_0x4ba4('0x2b')](_0xdf152e['model'],qs[_0x4ba4('0x2d')](_0x1dc505[_0x4ba4('0x23')]['fields']));_0x5f5573[_0x4ba4('0x2c')]=_0x5f5573[_0x4ba4('0x2c')][_0x4ba4('0x2e')]?_0x5f5573[_0x4ba4('0x2c')]:_0xdf152e[_0x4ba4('0x26')];if(!_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x3a')](_0x4ba4('0x3b'))){_0x5f5573[_0x4ba4('0x14')]=qs[_0x4ba4('0x14')](_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x14')]);_0x5f5573[_0x4ba4('0x13')]=qs['offset'](_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x13')]);}_0x5f5573[_0x4ba4('0x3c')]=qs[_0x4ba4('0x3d')](_0x1dc505['query'][_0x4ba4('0x3d')]);_0x5f5573[_0x4ba4('0x3e')]=qs['filters'](_['pick'](_0x1dc505['query'],_0xdf152e[_0x4ba4('0x2a')]));_0x5f5573['where']['MailInteractionId']=_0x391f04['id'];if(_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x3f')]){_0x5f5573['where']=_[_0x4ba4('0x40')](_0x5f5573[_0x4ba4('0x3e')],{'$or':_['map'](_0x5f5573[_0x4ba4('0x2c')],function(_0x9e0177){var _0x1eba39={};_0x1eba39[_0x9e0177]={'$like':'%'+_0x1dc505[_0x4ba4('0x23')]['filter']+'%'};return _0x1eba39;})});}if(_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x41')]){var _0x4dfea8=_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x41')][_0x4ba4('0x42')](',');var _0xd40b50={};_0xd40b50[_0x4dfea8[0x0]]={'$gte':moment(_0x4dfea8[0x1])[_0x4ba4('0x43')](_0x4ba4('0x44'))};_0x5f5573[_0x4ba4('0x3e')]=_[_0x4ba4('0x40')](_0x5f5573[_0x4ba4('0x3e')],_0xd40b50);}_0x5f5573=_[_0x4ba4('0x40')]({},_0x5f5573,_0x1dc505[_0x4ba4('0x30')]);return db[_0x4ba4('0x36')][_0x4ba4('0x15')]({'where':_0x5f5573[_0x4ba4('0x3e')]})[_0x4ba4('0x16')](function(_0x2b5ecf){_0x51e08e[_0x4ba4('0x15')]=_0x2b5ecf;if(_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x2f')]){_0x5f5573['include']=[{'all':!![]}];}return db[_0x4ba4('0x36')][_0x4ba4('0x45')](_0x5f5573);})[_0x4ba4('0x16')](function(_0x8d5f86){if(_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x46')]===_0x4ba4('0x47')){for(var _0x4fddfa=0x0;_0x4fddfa<_0x8d5f86[_0x4ba4('0x2e')];_0x4fddfa++){_0x8d5f86[_0x4fddfa]['body']=juice(_0x8d5f86[_0x4fddfa]['body']);}}_0x51e08e[_0x4ba4('0x48')]=_0x8d5f86;return _0x51e08e;});}})['then'](respondWithFilteredResult(_0x457c59,_0x5f5573))[_0x4ba4('0x32')](handleError(_0x457c59,null));};exports['addTags']=function(_0x29b08a,_0x58d66a){return db['MailInteraction'][_0x4ba4('0x31')]({'where':{'id':_0x29b08a['params']['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x58d66a,null))[_0x4ba4('0x16')](function(_0x14e589){if(_0x14e589){return _0x14e589['setTags'](_0x29b08a[_0x4ba4('0x34')][_0x4ba4('0x38')],_[_0x4ba4('0x39')](_0x29b08a[_0x4ba4('0x34')],['ids','id'])||{})['spread'](function(){return db[_0x4ba4('0x49')][_0x4ba4('0x45')]({'attributes':['id','name','color'],'where':{'id':_0x29b08a['body'][_0x4ba4('0x38')]}});})[_0x4ba4('0x16')](function(_0x422567){socket['emit']('mailInteractionTags:save',{'id':Number(_0x29b08a['params']['id']),'tags':_0x422567||[]});return{'id':Number(_0x29b08a[_0x4ba4('0x25')]['id']),'tags':_0x422567||[]};});}})[_0x4ba4('0x16')](respondWithResult(_0x58d66a,null))[_0x4ba4('0x32')](handleError(_0x58d66a,null));};exports[_0x4ba4('0x4a')]=function(_0x364a2f,_0x51bdcd){return db[_0x4ba4('0x28')][_0x4ba4('0x31')]({'where':{'id':_0x364a2f[_0x4ba4('0x25')]['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x51bdcd,null))[_0x4ba4('0x16')](function(_0x20346f){if(_0x20346f){return _0x20346f[_0x4ba4('0x4a')](_0x364a2f[_0x4ba4('0x23')][_0x4ba4('0x38')]);}})[_0x4ba4('0x16')](respondWithStatusCode(_0x51bdcd,null))[_0x4ba4('0x32')](handleError(_0x51bdcd,null));};exports[_0x4ba4('0x4b')]=function(_0x498c1d,_0x17e7c1){var _0x3a6f75=moment()['unix']()[_0x4ba4('0x4c')]();var _0x179803=path[_0x4ba4('0x4d')](config[_0x4ba4('0x4e')],_0x4ba4('0x4f'),_0x4ba4('0x50'),_0x4ba4('0x51'));var _0x108238=path[_0x4ba4('0x4d')](config[_0x4ba4('0x4e')],_0x4ba4('0x4f'),'files',_0x4ba4('0x52'));var _0x1b291c=path[_0x4ba4('0x4d')](_0x179803,_0x3a6f75);var _0x39d94a=util[_0x4ba4('0x43')](_0x4ba4('0x53'),_0x498c1d['params']['id'],_0x3a6f75);var _0x5df72c=path['join'](_0x179803,_0x39d94a);var _0x4f086d=[];if(_0x498c1d['query']['attachments']){_0x4f086d['push']({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x3b8429=[{'model':db[_0x4ba4('0x36')],'as':_0x4ba4('0x54'),'attributes':['id',_0x4ba4('0x34'),_0x4ba4('0x55'),'to','cc',_0x4ba4('0x56'),_0x4ba4('0x57'),_0x4ba4('0x58')],'where':{'secret':![]},'order':qs[_0x4ba4('0x3d')]('id'),'include':_0x4f086d}];return db[_0x4ba4('0x28')]['find']({'where':{'id':_0x498c1d['params']['id']},'include':_0x3b8429})[_0x4ba4('0x16')](handleEntityNotFound(_0x17e7c1,null))[_0x4ba4('0x16')](function(_0xf775a9){if(_0xf775a9&&_0xf775a9[_0x4ba4('0x54')]){var _0xfa54e1=_0xf775a9['get']({'plain':!![]});fs[_0x4ba4('0x59')](_0x1b291c);return BPromise[_0x4ba4('0x5a')](_0xfa54e1[_0x4ba4('0x54')],function(_0x1a1f60,_0x4ebc94){var _0x50908={'from':_0x1a1f60['from'],'to':_0x1a1f60['to']||_0x4ba4('0x5b'),'subject':_0x1a1f60['subject'],'html':htmlEntities[_0x4ba4('0x5c')](_0x1a1f60[_0x4ba4('0x34')]),'headers':{'Date':moment(_0x1a1f60[_0x4ba4('0x58')])[_0x4ba4('0x43')](_0x4ba4('0x5d'))},'attachments':[]};if(_0x1a1f60['cc']){_0x50908['headers']['Cc']=_0x1a1f60['cc'];}if(_0x1a1f60['bcc']){_0x50908[_0x4ba4('0x5e')]['Bcc']=_0x1a1f60[_0x4ba4('0x56')];}return new BPromise(function(_0x43d56d,_0x3f7f61){if(_0x1a1f60['Attachments']){for(var _0x4e4ac0=0x0;_0x4e4ac0<_0x1a1f60[_0x4ba4('0x5f')][_0x4ba4('0x2e')];_0x4e4ac0++){var _0x383e1e=_0x1a1f60[_0x4ba4('0x5f')][_0x4e4ac0];var _0x17c00d=path[_0x4ba4('0x4d')](_0x108238,_0x383e1e['basename']);if(fs[_0x4ba4('0x60')](_0x17c00d)){_0x50908[_0x4ba4('0x52')][_0x4ba4('0x61')]({'name':_0x383e1e[_0x4ba4('0x1a')],'contentType':_0x383e1e[_0x4ba4('0x1f')],'data':fs[_0x4ba4('0x62')](_0x17c00d)});}}}emlformat['build'](_0x50908,function(_0xa5d07d,_0x364f21){if(_0xa5d07d)return _0x3f7f61(_0xa5d07d);fs[_0x4ba4('0x63')](path['join'](_0x1b291c,util[_0x4ba4('0x43')](_0x4ba4('0x64'),_0x4ebc94)),_0x364f21);return _0x43d56d(_0x364f21);});});})[_0x4ba4('0x16')](function(){return new BPromise(function(_0x327c61,_0x6dcd87){zipdir(_0x1b291c,{'saveTo':_0x5df72c},function(_0x384216,_0x4c9f40){if(_0x384216)return _0x6dcd87(_0x384216);return _0x327c61(_0x4c9f40);});})[_0x4ba4('0x16')](function(){return new BPromise(function(_0x29883f,_0x4181ec){rimraf(_0x1b291c,function(_0x2176df){if(_0x2176df)_0x4181ec(_0x2176df);return _0x29883f();});});})[_0x4ba4('0x16')](function(){return _0x17e7c1[_0x4ba4('0x4b')](_0x5df72c,_0x39d94a,function(_0x3f401f){if(!_0x3f401f)fs[_0x4ba4('0x65')](_0x5df72c);});});});}else{return _0x17e7c1[_0x4ba4('0xf')](0xc8);}})[_0x4ba4('0x32')](handleError(_0x17e7c1,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 882285d..22510a9 100644 --- a/server/api/mailInteraction/mailInteraction.events.js +++ b/server/api/mailInteraction/mailInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1a1=['MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb'];(function(_0xc462d4,_0x247560){var _0x3235f1=function(_0x2e2513){while(--_0x2e2513){_0xc462d4['push'](_0xc462d4['shift']());}};_0x3235f1(++_0x247560);}(_0xb1a1,0x1c6));var _0x1b1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1a1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x1b1a('0x0'));var MailInteraction=require(_0x1b1a('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x1b1a('0x1'))['db'][_0x1b1a('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1b1a('0x3')](0x0);var events={'afterCreate':_0x1b1a('0x4'),'afterUpdate':_0x1b1a('0x5'),'afterDestroy':_0x1b1a('0x6')};function emitEvent(_0xdf7c81){return function(_0x16cdfd,_0x2afc4f,_0x7908d8){_0x16cdfd[_0x1b1a('0x7')]({'attributes':['id'],'raw':!![]})[_0x1b1a('0x8')](function(_0x40bd30){_0x16cdfd[_0x1b1a('0x9')](_0x1b1a('0xa'),_0x40bd30[_0x1b1a('0xb')](function(_0x26e482){return{'id':_0x26e482['id']};}));return MailMessage[_0x1b1a('0xc')]({'where':{'MailInteractionId':_0x16cdfd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1b1a('0x8')](function(_0x222b95){_0x16cdfd[_0x1b1a('0x9')](_0x1b1a('0xd'),_0x222b95[_0x1b1a('0xe')]);MailInteractionEvents[_0x1b1a('0xf')](_0xdf7c81+':'+_0x16cdfd['id'],_0x16cdfd);MailInteractionEvents[_0x1b1a('0xf')](_0xdf7c81,_0x16cdfd);_0x7908d8(null);})[_0x1b1a('0x10')](_0x7908d8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x1b1a('0x11')](e,emitEvent(event));}}module[_0x1b1a('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0x310b=['save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hook','../../mysqldb','MailInteraction','MailMessage'];(function(_0x545b65,_0x314672){var _0x4cd3b0=function(_0x796de6){while(--_0x796de6){_0x545b65['push'](_0x545b65['shift']());}};_0x4cd3b0(++_0x314672);}(_0x310b,0x1ec));var _0xb310=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x310b[_0x5a79e2];return _0x266c45;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xb310('0x0'))['db'][_0xb310('0x1')];var MailMessage=require(_0xb310('0x0'))['db'][_0xb310('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb310('0x3'),'afterUpdate':_0xb310('0x4'),'afterDestroy':_0xb310('0x5')};function emitEvent(_0x4fb25a){return function(_0xcca054,_0x70c9ec,_0x39d004){_0xcca054[_0xb310('0x6')]({'attributes':['id'],'raw':!![]})[_0xb310('0x7')](function(_0x1cf0d7){_0xcca054[_0xb310('0x8')](_0xb310('0x9'),_0x1cf0d7['map'](function(_0x3b9abe){return{'id':_0x3b9abe['id']};}));return MailMessage[_0xb310('0xa')]({'where':{'MailInteractionId':_0xcca054['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb310('0x7')](function(_0x229ef0){_0xcca054[_0xb310('0x8')](_0xb310('0xb'),_0x229ef0[_0xb310('0xc')]);MailInteractionEvents[_0xb310('0xd')](_0x4fb25a+':'+_0xcca054['id'],_0xcca054);MailInteractionEvents[_0xb310('0xd')](_0x4fb25a,_0xcca054);_0x39d004(null);})['catch'](_0x39d004(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xb310('0xe')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index f247540..1082e68 100644 --- a/server/api/mailInteraction/mailInteraction.model.js +++ b/server/api/mailInteraction/mailInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa73d=['substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','models','get','closed','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus'];(function(_0x4ea62c,_0x57c4c4){var _0x3743d5=function(_0x407ca1){while(--_0x407ca1){_0x4ea62c['push'](_0x4ea62c['shift']());}};_0x3743d5(++_0x57c4c4);}(_0xa73d,0x158));var _0xda73=function(_0x39ab15,_0x3a5849){_0x39ab15=_0x39ab15-0x0;var _0x275d20=_0xa73d[_0x39ab15];return _0x275d20;};'use strict';var _=require('lodash');var util=require(_0xda73('0x0'));var logger=require(_0xda73('0x1'))(_0xda73('0x2'));var moment=require('moment');var BPromise=require(_0xda73('0x3'));var rp=require(_0xda73('0x4'));var fs=require('fs');var path=require(_0xda73('0x5'));var rimraf=require(_0xda73('0x6'));var config=require(_0xda73('0x7'));var attributes=require(_0xda73('0x8'));module[_0xda73('0x9')]=function(_0x1f865b,_0x3c7e8a){return _0x1f865b[_0xda73('0xa')](_0xda73('0xb'),attributes,{'tableName':_0xda73('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xda73('0xd'),'to'],'type':_0xda73('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x26108f,_0x497294,_0x3b1097){if(_0x26108f[_0xda73('0xf')]){_0x26108f[_0xda73('0x10')]=moment()[_0xda73('0x11')](_0xda73('0x12'));}if(_0x26108f['closed']){_0x26108f[_0xda73('0x13')]=moment()['format'](_0xda73('0x12'));}_0x3b1097(null,_0x497294);},'beforeUpdate':function(_0x56d583,_0x35502d,_0x57bbb9){if(_0x56d583['changed'](_0xda73('0xf'))){_0x56d583[_0xda73('0x10')]=_0x56d583[_0xda73('0xf')]?moment()[_0xda73('0x11')](_0xda73('0x12')):null;}if(_0x56d583[_0xda73('0x14')]('closed')){_0x56d583[_0xda73('0x13')]=moment()[_0xda73('0x11')](_0xda73('0x12'));_0x56d583['substatus']=null;_0x56d583[_0xda73('0x10')]=null;}_0x57bbb9(null,_0x56d583);},'afterUpdate':function(_0x3ff2a8,_0x154e94,_0x2bad51){var _0x287811=_0x1f865b[_0xda73('0x15')];var _0xdbb4a0=_0x3ff2a8[_0xda73('0x16')]({'plain':!![]});if(_0xdbb4a0[_0xda73('0x17')]){return _0x287811[_0xda73('0x18')][_0xda73('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0xdbb4a0['id']}})[_0xda73('0x1a')](function(){_0x2bad51();})[_0xda73('0x1b')](function(_0x17f8ba){_0x2bad51(_0x17f8ba);});}else{_0x2bad51();}}},'charset':_0xda73('0x1c'),'collate':_0xda73('0x1d')});}; \ No newline at end of file +var _0xb0d1=['closedAt','changed','get','update','then','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x5a52dc,_0x489162){var _0x220d23=function(_0x564fb4){while(--_0x564fb4){_0x5a52dc['push'](_0x5a52dc['shift']());}};_0x220d23(++_0x489162);}(_0xb0d1,0x19f));var _0x1b0d=function(_0x53f8a2,_0xae896f){_0x53f8a2=_0x53f8a2-0x0;var _0x808873=_0xb0d1[_0x53f8a2];return _0x808873;};'use strict';var _=require('lodash');var util=require(_0x1b0d('0x0'));var logger=require(_0x1b0d('0x1'))(_0x1b0d('0x2'));var moment=require('moment');var BPromise=require(_0x1b0d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b0d('0x4'));var rimraf=require(_0x1b0d('0x5'));var config=require(_0x1b0d('0x6'));var attributes=require(_0x1b0d('0x7'));module['exports']=function(_0x27ee67,_0x3c275c){return _0x27ee67[_0x1b0d('0x8')](_0x1b0d('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x1b0d('0xa'),'to'],'type':_0x1b0d('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3f1e0f,_0x242956,_0x4a90e4){if(_0x3f1e0f[_0x1b0d('0xc')]){_0x3f1e0f[_0x1b0d('0xd')]=moment()[_0x1b0d('0xe')](_0x1b0d('0xf'));}if(_0x3f1e0f[_0x1b0d('0x10')]){_0x3f1e0f[_0x1b0d('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4a90e4(null,_0x242956);},'beforeUpdate':function(_0x3101cd,_0xd74a31,_0x1f9079){if(_0x3101cd[_0x1b0d('0x12')](_0x1b0d('0xc'))){_0x3101cd[_0x1b0d('0xd')]=_0x3101cd[_0x1b0d('0xc')]?moment()['format'](_0x1b0d('0xf')):null;}if(_0x3101cd[_0x1b0d('0x12')]('closed')){_0x3101cd[_0x1b0d('0x11')]=moment()[_0x1b0d('0xe')](_0x1b0d('0xf'));_0x3101cd['substatus']=null;_0x3101cd[_0x1b0d('0xd')]=null;}_0x1f9079(null,_0x3101cd);},'afterUpdate':function(_0x30eec4,_0x1f3c06,_0x5b1c4e){var _0x4aae42=_0x27ee67['models'];var _0x2d4bd0=_0x30eec4[_0x1b0d('0x13')]({'plain':!![]});if(_0x2d4bd0[_0x1b0d('0x10')]){return _0x4aae42['MailMessage'][_0x1b0d('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x2d4bd0['id']}})[_0x1b0d('0x15')](function(){_0x5b1c4e();})['catch'](function(_0x140b92){_0x5b1c4e(_0x140b92);});}else{_0x5b1c4e();}}},'charset':_0x1b0d('0x16'),'collate':_0x1b0d('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 69dc229..960daad 100644 --- a/server/api/mailInteraction/mailInteraction.rpc.js +++ b/server/api/mailInteraction/mailInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x394d=['limit','stringify','AddTagsToMailInteraction','MailInteraction','where','addTags','ids','spread','info','AddTags','lodash','randomstring','ioredis','../../config/utils','rpc','client','redis','socket.io-emitter','./mailInteraction.socket','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','UpdateMailInteraction','body','options','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x394d,0x12a));var _0xd394=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x394d[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xd394('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd394('0x1'));var fs=require('fs');var Redis=require(_0xd394('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd394('0x3'));var logger=require('../../config/logger')(_0xd394('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd394('0x5')]['http']({'port':0x232a});config[_0xd394('0x6')]=_['defaults'](config[_0xd394('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xd394('0x7'))(new Redis(config['redis']));require(_0xd394('0x8'))['register'](socket);function respondWithRpcPromise(_0x5c4190,_0x319b66,_0x4f2b7f){return new BPromise(function(_0x400034,_0x2ad11e){return client[_0xd394('0x9')](_0x5c4190,_0x4f2b7f)[_0xd394('0xa')](function(_0x3ab37d){logger['info'](_0xd394('0xb'),_0x319b66,_0xd394('0xc'));logger[_0xd394('0xd')](_0xd394('0xe'),_0x319b66,_0xd394('0xc'),JSON['stringify'](_0x3ab37d));if(_0x3ab37d[_0xd394('0xf')]){if(_0x3ab37d[_0xd394('0xf')]['code']===0x1f4){logger['error'](_0xd394('0xb'),_0x319b66,_0x3ab37d[_0xd394('0xf')][_0xd394('0x10')]);return _0x2ad11e(_0x3ab37d[_0xd394('0xf')][_0xd394('0x10')]);}logger[_0xd394('0xf')](_0xd394('0xb'),_0x319b66,_0x3ab37d[_0xd394('0xf')]['message']);return _0x400034(_0x3ab37d[_0xd394('0xf')][_0xd394('0x10')]);}else{logger['info'](_0xd394('0xb'),_0x319b66,'request\x20sent');_0x400034(_0x3ab37d['result'][_0xd394('0x10')]);}})[_0xd394('0x11')](function(_0x43a525){logger[_0xd394('0xf')](_0xd394('0xb'),_0x319b66,_0x43a525);_0x2ad11e(_0x43a525);});});}exports[_0xd394('0x12')]=function(_0x44b8e5){var _0x1be1ff=this;return new Promise(function(_0x149a31,_0xfa7b12){return db['MailInteraction']['update'](_0x44b8e5[_0xd394('0x13')],{'raw':_0x44b8e5[_0xd394('0x14')]?_0x44b8e5[_0xd394('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44b8e5[_0xd394('0x14')]?_0x44b8e5[_0xd394('0x14')]['where']||null:null,'attributes':_0x44b8e5[_0xd394('0x14')]?_0x44b8e5[_0xd394('0x14')][_0xd394('0x15')]||null:null,'limit':_0x44b8e5[_0xd394('0x14')]?_0x44b8e5['options'][_0xd394('0x16')]||null:null})[_0xd394('0xa')](function(_0x4f1a40){logger['info'](_0xd394('0x12'),_0x44b8e5);logger[_0xd394('0xd')](_0xd394('0x12'),_0x44b8e5,JSON[_0xd394('0x17')](_0x4f1a40));_0x149a31(_0x4f1a40);})[_0xd394('0x11')](function(_0x566db8){logger[_0xd394('0xf')](_0xd394('0x12'),_0x566db8[_0xd394('0x10')],_0x44b8e5);_0xfa7b12(_0x1be1ff['error'](0x1f4,_0x566db8[_0xd394('0x10')]));});});};exports[_0xd394('0x18')]=function(_0x5658da){return new Promise(function(_0x4b0df9,_0x9c5153){return db[_0xd394('0x19')]['find']({'where':_0x5658da[_0xd394('0x14')]?_0x5658da[_0xd394('0x14')][_0xd394('0x1a')]||null:null})[_0xd394('0xa')](function(_0x58e4ee){if(_0x58e4ee){return _0x58e4ee[_0xd394('0x1b')](_0x5658da[_0xd394('0x13')]['ids'],_['omit'](_0x5658da[_0xd394('0x13')],[_0xd394('0x1c'),'id'])||{});}})[_0xd394('0x1d')](function(_0x523baf){logger[_0xd394('0x1e')](_0xd394('0x1f'),_0x5658da);logger[_0xd394('0xd')](_0xd394('0x1f'),_0x5658da,JSON['stringify'](_0x523baf));_0x4b0df9(_0x523baf);})[_0xd394('0x11')](function(_0x155f53){logger[_0xd394('0xf')](_0xd394('0x1f'),_0x155f53['message'],_0x5658da);_0x9c5153(_this[_0xd394('0xf')](0x1f4,_0x155f53[_0xd394('0x10')]));});});}; \ No newline at end of file +var _0x9134=['request\x20sent','stringify','error','code','message','MailInteraction','body','options','raw','where','limit','info','UpdateMailInteraction','catch','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','request','then','MailInteraction,\x20%s,\x20%s','debug'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x9134,0x87));var _0x4913=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9134[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x4913('0x0'));var moment=require(_0x4913('0x1'));var BPromise=require(_0x4913('0x2'));var rs=require(_0x4913('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4913('0x4'));var logger=require(_0x4913('0x5'))(_0x4913('0x6'));var config=require(_0x4913('0x7'));var jayson=require(_0x4913('0x8'));var client=jayson[_0x4913('0x9')]['http']({'port':0x232a});config[_0x4913('0xa')]=_[_0x4913('0xb')](config[_0x4913('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4913('0xc'))(new Redis(config[_0x4913('0xa')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4d9eb2,_0xae5842,_0x57260f){return new BPromise(function(_0x28f919,_0x1c08ac){return client[_0x4913('0xd')](_0x4d9eb2,_0x57260f)[_0x4913('0xe')](function(_0x3c3272){logger['info'](_0x4913('0xf'),_0xae5842,'request\x20sent');logger[_0x4913('0x10')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0xae5842,_0x4913('0x11'),JSON[_0x4913('0x12')](_0x3c3272));if(_0x3c3272[_0x4913('0x13')]){if(_0x3c3272['error'][_0x4913('0x14')]===0x1f4){logger[_0x4913('0x13')]('MailInteraction,\x20%s,\x20%s',_0xae5842,_0x3c3272['error'][_0x4913('0x15')]);return _0x1c08ac(_0x3c3272[_0x4913('0x13')][_0x4913('0x15')]);}logger[_0x4913('0x13')]('MailInteraction,\x20%s,\x20%s',_0xae5842,_0x3c3272[_0x4913('0x13')][_0x4913('0x15')]);return _0x28f919(_0x3c3272['error'][_0x4913('0x15')]);}else{logger['info'](_0x4913('0xf'),_0xae5842,_0x4913('0x11'));_0x28f919(_0x3c3272['result'][_0x4913('0x15')]);}})['catch'](function(_0x50584a){logger[_0x4913('0x13')](_0x4913('0xf'),_0xae5842,_0x50584a);_0x1c08ac(_0x50584a);});});}exports['UpdateMailInteraction']=function(_0x52fe67){var _0x13cb5b=this;return new Promise(function(_0x50b0ef,_0xcb1c7a){return db[_0x4913('0x16')]['update'](_0x52fe67[_0x4913('0x17')],{'raw':_0x52fe67[_0x4913('0x18')]?_0x52fe67[_0x4913('0x18')][_0x4913('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52fe67[_0x4913('0x18')]?_0x52fe67[_0x4913('0x18')][_0x4913('0x1a')]||null:null,'attributes':_0x52fe67['options']?_0x52fe67[_0x4913('0x18')]['attributes']||null:null,'limit':_0x52fe67[_0x4913('0x18')]?_0x52fe67[_0x4913('0x18')][_0x4913('0x1b')]||null:null})[_0x4913('0xe')](function(_0x458139){logger[_0x4913('0x1c')](_0x4913('0x1d'),_0x52fe67);logger[_0x4913('0x10')](_0x4913('0x1d'),_0x52fe67,JSON[_0x4913('0x12')](_0x458139));_0x50b0ef(_0x458139);})[_0x4913('0x1e')](function(_0x38a4a2){logger['error'](_0x4913('0x1d'),_0x38a4a2[_0x4913('0x15')],_0x52fe67);_0xcb1c7a(_0x13cb5b['error'](0x1f4,_0x38a4a2[_0x4913('0x15')]));});});};exports[_0x4913('0x1f')]=function(_0x592e1d){return new Promise(function(_0x4e656a,_0x115f54){return db[_0x4913('0x16')][_0x4913('0x20')]({'where':_0x592e1d['options']?_0x592e1d[_0x4913('0x18')][_0x4913('0x1a')]||null:null})[_0x4913('0xe')](function(_0x20fc86){if(_0x20fc86){return _0x20fc86[_0x4913('0x21')](_0x592e1d[_0x4913('0x17')][_0x4913('0x22')],_[_0x4913('0x23')](_0x592e1d[_0x4913('0x17')],[_0x4913('0x22'),'id'])||{});}})[_0x4913('0x24')](function(_0x3ab627){logger[_0x4913('0x1c')](_0x4913('0x25'),_0x592e1d);logger['debug'](_0x4913('0x25'),_0x592e1d,JSON['stringify'](_0x3ab627));_0x4e656a(_0x3ab627);})['catch'](function(_0x2aca59){logger[_0x4913('0x13')](_0x4913('0x25'),_0x2aca59[_0x4913('0x15')],_0x592e1d);_0x115f54(_this[_0x4913('0x13')](0x1f4,_0x2aca59[_0x4913('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 0225730..485b26c 100644 --- a/server/api/mailInteraction/mailInteraction.socket.js +++ b/server/api/mailInteraction/mailInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c76=['save','update','emit','register','mailInteraction:','./mailInteraction.events'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0x2c76,0x185));var _0x62c7=function(_0x2430e5,_0x45fbd4){_0x2430e5=_0x2430e5-0x0;var _0x4bfbe9=_0x2c76[_0x2430e5];return _0x4bfbe9;};'use strict';var MailInteractionEvents=require(_0x62c7('0x0'));var events=[_0x62c7('0x1'),'remove',_0x62c7('0x2')];function createListener(_0x532f82,_0x2e7d6a){return function(_0x231d01){_0x2e7d6a[_0x62c7('0x3')](_0x532f82,_0x231d01);};}function removeListener(_0x400ffa,_0x11f46f){return function(){MailInteractionEvents['removeListener'](_0x400ffa,_0x11f46f);};}exports[_0x62c7('0x4')]=function(_0x3fe628){for(var _0xe7cf7d=0x0,_0x2b6093=events['length'];_0xe7cf7d<_0x2b6093;_0xe7cf7d++){var _0x62d241=events[_0xe7cf7d];var _0x187a2c=createListener(_0x62c7('0x5')+_0x62d241,_0x3fe628);MailInteractionEvents['on'](_0x62d241,_0x187a2c);}}; \ No newline at end of file +var _0xb42f=['./mailInteraction.events','save','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x45b47d,_0x38c6f6){var _0x4d4165=function(_0x1affd3){while(--_0x1affd3){_0x45b47d['push'](_0x45b47d['shift']());}};_0x4d4165(++_0x38c6f6);}(_0xb42f,0x129));var _0xfb42=function(_0x5adb4e,_0x4120ee){_0x5adb4e=_0x5adb4e-0x0;var _0x48a4c8=_0xb42f[_0x5adb4e];return _0x48a4c8;};'use strict';var MailInteractionEvents=require(_0xfb42('0x0'));var events=[_0xfb42('0x1'),_0xfb42('0x2'),_0xfb42('0x3')];function createListener(_0x3b33fe,_0x2b2f6f){return function(_0x4a3acb){_0x2b2f6f[_0xfb42('0x4')](_0x3b33fe,_0x4a3acb);};}function removeListener(_0x3c593e,_0x30be08){return function(){MailInteractionEvents[_0xfb42('0x5')](_0x3c593e,_0x30be08);};}exports[_0xfb42('0x6')]=function(_0x353d19){for(var _0x63a7a0=0x0,_0x241187=events[_0xfb42('0x7')];_0x63a7a0<_0x241187;_0x63a7a0++){var _0xdd2975=events[_0x63a7a0];var _0x5ca011=createListener(_0xfb42('0x8')+_0xdd2975,_0x353d19);MailInteractionEvents['on'](_0xdd2975,_0x5ca011);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 267fbec..0075fc4 100644 --- a/server/api/mailMessage/index.js +++ b/server/api/mailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49aa=['mail','mailmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','tracked'];(function(_0x103ac2,_0x445df5){var _0x1d38d7=function(_0x13f4fe){while(--_0x13f4fe){_0x103ac2['push'](_0x103ac2['shift']());}};_0x1d38d7(++_0x445df5);}(_0x49aa,0x173));var _0xa49a=function(_0x3ac409,_0x2b0449){_0x3ac409=_0x3ac409-0x0;var _0x552557=_0x49aa[_0x3ac409];return _0x552557;};'use strict';var multer=require(_0xa49a('0x0'));var util=require(_0xa49a('0x1'));var path=require(_0xa49a('0x2'));var timeout=require('connect-timeout');var express=require(_0xa49a('0x3'));var router=express[_0xa49a('0x4')]();var fs_extra=require(_0xa49a('0x5'));var auth=require(_0xa49a('0x6'));var interaction=require(_0xa49a('0x7'));var config=require(_0xa49a('0x8'));var controller=require('./mailMessage.controller');router[_0xa49a('0x9')]('/',auth[_0xa49a('0xa')](),controller[_0xa49a('0xb')]);router[_0xa49a('0x9')](_0xa49a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xa49a('0x9')](_0xa49a('0xd'),auth[_0xa49a('0xa')](),controller[_0xa49a('0xe')]);router[_0xa49a('0x9')](_0xa49a('0xf'),auth['isAuthenticated'](),controller[_0xa49a('0x10')]);router[_0xa49a('0x11')]('/',auth[_0xa49a('0xa')](),interaction[_0xa49a('0x12')](_0xa49a('0x13'),_0xa49a('0x14')),controller[_0xa49a('0x15')]);router['put'](_0xa49a('0xd'),auth[_0xa49a('0xa')](),controller[_0xa49a('0x16')]);router[_0xa49a('0x17')](_0xa49a('0x18'),auth[_0xa49a('0xa')](),controller[_0xa49a('0x19')]);router['put'](_0xa49a('0x1a'),auth[_0xa49a('0xa')](),controller[_0xa49a('0x1b')]);router[_0xa49a('0x1c')]('/:id',auth[_0xa49a('0xa')](),controller[_0xa49a('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x5525=['create','put','/:id','update','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','mail','mailmessage:create'];(function(_0x351684,_0x38b00a){var _0x5f8772=function(_0x7da17a){while(--_0x7da17a){_0x351684['push'](_0x351684['shift']());}};_0x5f8772(++_0x38b00a);}(_0x5525,0xd1));var _0x5552=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5525[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5552('0x0'));var util=require(_0x5552('0x1'));var path=require(_0x5552('0x2'));var timeout=require(_0x5552('0x3'));var express=require(_0x5552('0x4'));var router=express[_0x5552('0x5')]();var fs_extra=require(_0x5552('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5552('0x7'));var config=require(_0x5552('0x8'));var controller=require('./mailMessage.controller');router[_0x5552('0x9')]('/',auth[_0x5552('0xa')](),controller[_0x5552('0xb')]);router[_0x5552('0x9')](_0x5552('0xc'),auth[_0x5552('0xa')](),controller[_0x5552('0xd')]);router[_0x5552('0x9')]('/:id',auth[_0x5552('0xa')](),controller['show']);router[_0x5552('0x9')]('/:id/download',auth[_0x5552('0xa')](),controller['download']);router['post']('/',auth[_0x5552('0xa')](),interaction['tracked'](_0x5552('0xe'),_0x5552('0xf')),controller[_0x5552('0x10')]);router[_0x5552('0x11')](_0x5552('0x12'),auth['isAuthenticated'](),controller[_0x5552('0x13')]);router['put']('/:id/accept',auth[_0x5552('0xa')](),controller[_0x5552('0x14')]);router['put']('/:id/reject',auth[_0x5552('0xa')](),controller[_0x5552('0x15')]);router[_0x5552('0x16')](_0x5552('0x12'),auth[_0x5552('0xa')](),controller[_0x5552('0x17')]);module[_0x5552('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 055fbdf..1420b0d 100644 --- a/server/api/mailMessage/mailMessage.attributes.js +++ b/server/api/mailMessage/mailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc7e=['sequelize','lodash','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','INTEGER','DATE','Chat','Email'];(function(_0x17b1be,_0x1d6541){var _0xbe1284=function(_0x5ba00f){while(--_0x5ba00f){_0x17b1be['push'](_0x17b1be['shift']());}};_0xbe1284(++_0x1d6541);}(_0xfc7e,0x70));var _0xefc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc7e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xefc7('0x0'));var _=require(_0xefc7('0x1'));module[_0xefc7('0x2')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xefc7('0x3')](_0xefc7('0x4'))},'read':{'type':Sequelize[_0xefc7('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xefc7('0x6')]('in','out'),'defaultValue':_0xefc7('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xefc7('0x8')](0x1fe)},'from':{'type':Sequelize[_0xefc7('0x8')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0xefc7('0x3')](_0xefc7('0x9'))},'bcc':{'type':Sequelize[_0xefc7('0x3')]('long')},'subject':{'type':Sequelize[_0xefc7('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xefc7('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xefc7('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xefc7('0xb')]},'originTo':{'type':Sequelize[_0xefc7('0x3')]('long')},'originCc':{'type':Sequelize['TEXT'](_0xefc7('0x9'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0xefc7('0xc')),'defaultValue':_0xefc7('0xd'),'allowNull':![]}}; \ No newline at end of file +var _0xb9ee=['Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb9ee,0x1b4));var _0xeb9e=function(_0x4c00ea,_0x1cf606){_0x4c00ea=_0x4c00ea-0x0;var _0x2754b6=_0xb9ee[_0x4c00ea];return _0x2754b6;};'use strict';var Sequelize=require(_0xeb9e('0x0'));var _=require(_0xeb9e('0x1'));module[_0xeb9e('0x2')]={'body':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x5'))},'read':{'type':Sequelize[_0xeb9e('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeb9e('0x7')]('in',_0xeb9e('0x8')),'defaultValue':_0xeb9e('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0xeb9e('0x9')](0x1fe)},'from':{'type':Sequelize[_0xeb9e('0x9')]},'to':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4'))},'cc':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4'))},'bcc':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4'))},'subject':{'type':Sequelize[_0xeb9e('0x3')]},'sentAt':{'type':Sequelize[_0xeb9e('0xa')]},'attach':{'type':Sequelize[_0xeb9e('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xeb9e('0xa')]},'originTo':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4'))},'originCc':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4'))},'originChannel':{'type':Sequelize[_0xeb9e('0x7')](_0xeb9e('0xc'),_0xeb9e('0xd')),'defaultValue':_0xeb9e('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 00aa3eb..e052a34 100644 --- a/server/api/mailMessage/mailMessage.controller.js +++ b/server/api/mailMessage/mailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb14a=['options','find','catch','body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','Contacts','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','get','MailInteraction','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','SELECT','interface','rejectmessage','download','unix','toString','files','server','message-%s.eml','bcc','subject','Attachment','Attachments','from','headers','Bcc','join','existsSync','readFileSync','build','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','end','sendStatus','stack','name','send','index','MailMessage','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb14a,0x19b));var _0xab14=function(_0x5942c4,_0x2bbd1b){_0x5942c4=_0x5942c4-0x0;var _0x276801=_0xb14a[_0x5942c4];return _0x276801;};'use strict';var emlformat=require(_0xab14('0x0'));var moment=require(_0xab14('0x1'));var BPromise=require(_0xab14('0x2'));var util=require('util');var path=require(_0xab14('0x3'));var fs=require('fs');var _=require(_0xab14('0x4'));var Redis=require(_0xab14('0x5'));var htmlToText=require(_0xab14('0x6'));var qs=require(_0xab14('0x7'));var logger=require(_0xab14('0x8'))('api');var interaction_log=require(_0xab14('0x8'))(_0xab14('0x9'));var config=require(_0xab14('0xa'));var db=require(_0xab14('0xb'))['db'];config[_0xab14('0xc')]=_[_0xab14('0xd')](config[_0xab14('0xc')],{'host':_0xab14('0xe'),'port':0x18eb});var socket=require(_0xab14('0xf'))(new Redis(config[_0xab14('0xc')]));var htmlEntities=require(_0xab14('0x10'));require(_0xab14('0x11'))[_0xab14('0x12')](socket);var jayson=require(_0xab14('0x13'));var client=jayson[_0xab14('0x14')][_0xab14('0x15')]({'port':0x232c});var client9003=jayson['client'][_0xab14('0x15')]({'port':0x232b});var client9002=jayson[_0xab14('0x14')][_0xab14('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x1e4f9d,_0x292e5d,_0x210ed6,_0x1543b3){return new BPromise(function(_0x18e187,_0x5b67be){var _0x245bee=_0x1543b3||client;return _0x245bee['request'](_0x1e4f9d,_0x210ed6)['then'](function(_0x5ae3d2){logger[_0xab14('0x16')](_0xab14('0x17'),_0x292e5d,_0xab14('0x18'));logger[_0xab14('0x19')](_0xab14('0x1a'),_0x292e5d,_0xab14('0x18'),JSON[_0xab14('0x1b')](_0x5ae3d2));if(_0x5ae3d2[_0xab14('0x1c')]){if(_0x5ae3d2[_0xab14('0x1c')][_0xab14('0x1d')]===0x1f4){logger[_0xab14('0x1c')](_0xab14('0x17'),_0x292e5d,_0x5ae3d2[_0xab14('0x1c')][_0xab14('0x1e')]);return _0x5b67be(_0x5ae3d2[_0xab14('0x1c')][_0xab14('0x1e')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x292e5d,_0x5ae3d2[_0xab14('0x1c')][_0xab14('0x1e')]);return _0x18e187(_0x5ae3d2[_0xab14('0x1c')][_0xab14('0x1e')]);}else{logger[_0xab14('0x16')](_0xab14('0x17'),_0x292e5d,_0xab14('0x18'));_0x18e187(_0x5ae3d2[_0xab14('0x1f')][_0xab14('0x1e')]);}})['catch'](function(_0x4f1064){logger[_0xab14('0x1c')]('MailMessage,\x20%s,\x20%s',_0x292e5d,_0x4f1064);_0x5b67be(_0x4f1064);});});}function respondWithResult(_0x36e1ba,_0x411cbf){_0x411cbf=_0x411cbf||0xc8;return function(_0x375863){if(_0x375863){return _0x36e1ba[_0xab14('0x20')](_0x411cbf)[_0xab14('0x21')](_0x375863);}};}function respondWithFilteredResult(_0x2b0557,_0x354f6b){return function(_0x44d539){if(_0x44d539){var _0x251f7=typeof _0x354f6b[_0xab14('0x22')]===_0xab14('0x23')&&typeof _0x354f6b[_0xab14('0x24')]==='undefined';var _0x31f668=_0x44d539[_0xab14('0x25')];var _0x409eb2=_0x251f7?0x0:_0x354f6b['offset'];var _0x10870c=_0x251f7?_0x44d539[_0xab14('0x25')]:_0x354f6b[_0xab14('0x22')]+_0x354f6b[_0xab14('0x24')];var _0x498f19;if(_0x10870c>=_0x31f668){_0x10870c=_0x31f668;_0x498f19=0xc8;}else{_0x498f19=0xce;}_0x2b0557[_0xab14('0x20')](_0x498f19);return _0x2b0557['set'](_0xab14('0x26'),_0x409eb2+'-'+_0x10870c+'/'+_0x31f668)[_0xab14('0x21')](_0x44d539);}return null;};}function saveUpdates(_0x11d387){return function(_0x19af9a){if(_0x19af9a){return _0x19af9a[_0xab14('0x27')](_0x11d387)[_0xab14('0x28')](function(_0x3350ac){return _0x3350ac;});}return null;};}function removeEntity(_0x4100c8){return function(_0x117808){if(_0x117808){return _0x117808[_0xab14('0x29')]()[_0xab14('0x28')](function(){_0x4100c8[_0xab14('0x20')](0xcc)[_0xab14('0x2a')]();});}};}function handleEntityNotFound(_0x5cb498){return function(_0x5bb205){if(!_0x5bb205){_0x5cb498[_0xab14('0x2b')](0x194);}return _0x5bb205;};}function handleError(_0x35323a,_0x4b3f64){_0x4b3f64=_0x4b3f64||0x1f4;return function(_0xf62b71){logger[_0xab14('0x1c')](_0xf62b71[_0xab14('0x2c')]);if(_0xf62b71[_0xab14('0x2d')]){delete _0xf62b71[_0xab14('0x2d')];}_0x35323a[_0xab14('0x20')](_0x4b3f64)[_0xab14('0x2e')](_0xf62b71);};}exports[_0xab14('0x2f')]=function(_0x526822,_0x37f5c1){var _0x28fb51={},_0x5bc61d={},_0x36dd18={'count':0x0,'rows':[]};var _0x9c5682=_['map'](db[_0xab14('0x30')][_0xab14('0x31')],function(_0x42743b){return{'name':_0x42743b['fieldName'],'type':_0x42743b[_0xab14('0x32')][_0xab14('0x33')]};});_0x5bc61d[_0xab14('0x34')]=_[_0xab14('0x35')](_0x9c5682,'name');_0x5bc61d[_0xab14('0x36')]=_[_0xab14('0x37')](_0x526822[_0xab14('0x36')]);_0x5bc61d[_0xab14('0x38')]=_['intersection'](_0x5bc61d['model'],_0x5bc61d[_0xab14('0x36')]);_0x28fb51[_0xab14('0x39')]=_[_0xab14('0x3a')](_0x5bc61d['model'],qs[_0xab14('0x3b')](_0x526822['query'][_0xab14('0x3b')]));_0x28fb51['attributes']=_0x28fb51['attributes'][_0xab14('0x3c')]?_0x28fb51[_0xab14('0x39')]:_0x5bc61d[_0xab14('0x34')];if(!_0x526822[_0xab14('0x36')][_0xab14('0x3d')](_0xab14('0x3e'))){_0x28fb51[_0xab14('0x24')]=qs[_0xab14('0x24')](_0x526822[_0xab14('0x36')][_0xab14('0x24')]);_0x28fb51[_0xab14('0x22')]=qs[_0xab14('0x22')](_0x526822[_0xab14('0x36')][_0xab14('0x22')]);}_0x28fb51['order']=qs[_0xab14('0x3f')](_0x526822[_0xab14('0x36')]['sort']);_0x28fb51['where']=qs['filters'](_[_0xab14('0x40')](_0x526822['query'],_0x5bc61d[_0xab14('0x38')]),_0x9c5682);if(_0x526822[_0xab14('0x36')][_0xab14('0x41')]){_0x28fb51[_0xab14('0x42')]=_[_0xab14('0x43')](_0x28fb51[_0xab14('0x42')],{'$or':_[_0xab14('0x35')](_0x9c5682,function(_0x4bb13d){if(_0x4bb13d['type']!==_0xab14('0x44')){var _0x584b47={};_0x584b47[_0x4bb13d['name']]={'$like':'%'+_0x526822[_0xab14('0x36')][_0xab14('0x41')]+'%'};return _0x584b47;}})});}_0x28fb51=_[_0xab14('0x43')]({},_0x28fb51,_0x526822['options']);var _0x2cc8af={'where':_0x28fb51[_0xab14('0x42')]};return db[_0xab14('0x30')][_0xab14('0x25')](_0x2cc8af)[_0xab14('0x28')](function(_0x4b5938){_0x36dd18[_0xab14('0x25')]=_0x4b5938;if(_0x526822['query'][_0xab14('0x45')]){_0x28fb51[_0xab14('0x46')]=[{'all':!![]}];}return db[_0xab14('0x30')][_0xab14('0x47')](_0x28fb51);})[_0xab14('0x28')](function(_0x12ddbf){_0x36dd18[_0xab14('0x48')]=_0x12ddbf;return _0x36dd18;})[_0xab14('0x28')](respondWithFilteredResult(_0x37f5c1,_0x28fb51))['catch'](handleError(_0x37f5c1,null));};exports[_0xab14('0x49')]=function(_0x2f982f,_0x401b5a){var _0x60814a={'raw':!![],'where':{'id':_0x2f982f[_0xab14('0x4a')]['id']}},_0x3e5579={};_0x3e5579[_0xab14('0x34')]=_['keys'](db[_0xab14('0x30')]['rawAttributes']);_0x3e5579[_0xab14('0x36')]=_[_0xab14('0x37')](_0x2f982f['query']);_0x3e5579[_0xab14('0x38')]=_[_0xab14('0x3a')](_0x3e5579['model'],_0x3e5579['query']);_0x60814a[_0xab14('0x39')]=_['intersection'](_0x3e5579[_0xab14('0x34')],qs[_0xab14('0x3b')](_0x2f982f[_0xab14('0x36')][_0xab14('0x3b')]));_0x60814a[_0xab14('0x39')]=_0x60814a[_0xab14('0x39')]['length']?_0x60814a[_0xab14('0x39')]:_0x3e5579['model'];if(_0x2f982f[_0xab14('0x36')][_0xab14('0x45')]){_0x60814a['include']=[{'all':!![]}];}_0x60814a=_[_0xab14('0x43')]({},_0x60814a,_0x2f982f[_0xab14('0x4b')]);return db['MailMessage'][_0xab14('0x4c')](_0x60814a)[_0xab14('0x28')](handleEntityNotFound(_0x401b5a,null))[_0xab14('0x28')](respondWithResult(_0x401b5a,null))[_0xab14('0x4d')](handleError(_0x401b5a,null));};exports[_0xab14('0x27')]=function(_0x1ace9d,_0x2cc0a2){if(_0x1ace9d[_0xab14('0x4e')]['id']){delete _0x1ace9d[_0xab14('0x4e')]['id'];}return db['MailMessage'][_0xab14('0x4c')]({'where':{'id':_0x1ace9d[_0xab14('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2cc0a2,null))[_0xab14('0x28')](saveUpdates(_0x1ace9d['body'],null))[_0xab14('0x28')](respondWithResult(_0x2cc0a2,null))['catch'](handleError(_0x2cc0a2,null));};exports['destroy']=function(_0x449c19,_0x4a708a){return db['MailMessage'][_0xab14('0x4c')]({'where':{'id':_0x449c19['params']['id']}})[_0xab14('0x28')](handleEntityNotFound(_0x4a708a,null))['then'](removeEntity(_0x4a708a,null))[_0xab14('0x4d')](handleError(_0x4a708a,null));};exports[_0xab14('0x4f')]=function(_0x182370,_0x4fbb2f){return db[_0xab14('0x30')]['describe']()[_0xab14('0x28')](respondWithResult(_0x4fbb2f,null))[_0xab14('0x4d')](handleError(_0x4fbb2f,null));};exports[_0xab14('0x50')]=function(_0x573672,_0x561828){return db[_0xab14('0x30')][_0xab14('0x50')](_0x573672[_0xab14('0x4e')])[_0xab14('0x28')](function(_0x5218b4){if(_0x5218b4){if(_0x5218b4[_0xab14('0x51')]===_0xab14('0x52')&&!_0x5218b4[_0xab14('0x53')]){var _0x36c728,_0x4a5768,_0xd26391;if(_0x573672['body']['to']){_0x4a5768=_0x573672[_0xab14('0x4e')]['to']['split'](',')[0x0];}return db[_0xab14('0x54')][_0xab14('0x55')]({'where':{'id':_0x5218b4[_0xab14('0x56')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xab14('0x57'),'where':{'email':_0x4a5768},'limit':0x1,'order':[[_0xab14('0x58'),_0xab14('0x59')]]}]},{'model':db['MailServerOut'],'as':_0xab14('0x5a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xab14('0x5b'),'raw':!![]}]}]})['then'](function(_0x4beecd){_0x36c728=_0x4beecd;if(!_0x36c728||!_0x36c728[_0xab14('0x5a')])return;var _0x1d2360=_0x36c728[_0xab14('0x5c')]();if(_0x573672[_0xab14('0x4e')]['attachments']&&_0x573672[_0xab14('0x4e')][_0xab14('0x5d')][_0xab14('0x3c')]){for(var _0x1dcb88=0x0;_0x1dcb88<_0x573672[_0xab14('0x4e')][_0xab14('0x5d')][_0xab14('0x3c')];_0x1dcb88+=0x1){_0x573672[_0xab14('0x4e')][_0xab14('0x5d')][_0x1dcb88]={'filename':_0x573672[_0xab14('0x4e')][_0xab14('0x5d')][_0x1dcb88][_0xab14('0x2d')],'path':path['join'](config[_0xab14('0x5e')],_0xab14('0x5f'),_0x573672['body'][_0xab14('0x5d')][_0x1dcb88]['basename'])};}}_0xd26391={'account':_0x1d2360,'message':_0x573672[_0xab14('0x4e')]};return;})[_0xab14('0x28')](function(){if(_0x36c728[_0xab14('0x60')]){if(_0x36c728[_0xab14('0x60')]['Contacts'][_0xab14('0x3c')]){return _0x36c728[_0xab14('0x60')][_0xab14('0x57')][0x0];}else{return db['CmContact'][_0xab14('0x50')](_['defaults'](_0x573672[_0xab14('0x4e')],{'firstName':_0x573672[_0xab14('0x4e')]['to'],'email':_0x573672[_0xab14('0x4e')]['to'],'phone':_0x573672['body']['to'],'ListId':_0x36c728[_0xab14('0x61')]}));}}else{throw new Error(_0xab14('0x62'));}})[_0xab14('0x28')](function(){if(_0xd26391){return respondWithRpcPromise(_0xab14('0x63'),_0xab14('0x64'),_0xd26391,client9003)['then'](function(_0x28d701){return _0x5218b4[_0xab14('0x27')]({'read':!![],'messageId':_0x28d701[_0xab14('0x65')],'sentAt':moment()[_0xab14('0x66')](_0xab14('0x67'))});})[_0xab14('0x4d')](function(_0x3c8fef){logger[_0xab14('0x1c')]('%s',JSON[_0xab14('0x1b')](_0x3c8fef));return _0x5218b4;});}return _0x5218b4;});}return _0x5218b4;}})['then'](respondWithResult(_0x561828,0xc9))['catch'](handleError(_0x561828,null));};exports[_0xab14('0x68')]=function(_0x50a9ea,_0x50bd31){var _0x586f64={'agent':{},'channel':_0xab14('0x69')};if(_0x50a9ea[_0xab14('0x4e')]['id']){delete _0x50a9ea[_0xab14('0x4e')]['id'];}_0x50a9ea['body'][_0xab14('0x6a')]=!![];_0x50a9ea[_0xab14('0x4e')][_0xab14('0x6b')]=moment()[_0xab14('0x66')](_0xab14('0x67'));_0x50a9ea[_0xab14('0x4e')][_0xab14('0x6c')]=_0x50a9ea[_0xab14('0x4e')][_0xab14('0x6c')]||_0x50a9ea[_0xab14('0x6d')]['id'];_0x586f64['agent']['id']=_0x50a9ea[_0xab14('0x4e')][_0xab14('0x6c')];return db['MailMessage'][_0xab14('0x4c')]({'where':{'id':_0x50a9ea[_0xab14('0x4a')]['id'],'UserId':null}})[_0xab14('0x28')](handleEntityNotFound(_0x50bd31,null))[_0xab14('0x28')](saveUpdates(_0x50a9ea['body'],null))['then'](function(_0x20ff8b){if(_0x20ff8b){_0x586f64['message']=_0x20ff8b[_0xab14('0x6e')]({'plain':!![]});return db[_0xab14('0x6f')][_0xab14('0x4c')]({'where':{'id':_0x20ff8b[_0xab14('0x70')]}});}return null;})[_0xab14('0x28')](handleEntityNotFound(_0x50bd31,null))[_0xab14('0x28')](function(_0x10a968){if(_0x10a968){return _0x10a968[_0xab14('0x27')]({'UserId':_0x50a9ea[_0xab14('0x4e')][_0xab14('0x6c')],'read1stAt':_[_0xab14('0x71')](_0x10a968['read1stAt'])?moment()[_0xab14('0x66')](_0xab14('0x67')):undefined});}return null;})['then'](function(_0x1dd86c){if(_0x1dd86c){_0x586f64[_0xab14('0x72')]=_0x1dd86c[_0xab14('0x6e')]({'plain':!![]});interaction_log[_0xab14('0x16')](_0xab14('0x73'),_0x50a9ea[_0xab14('0x6d')]['id'],_0x50a9ea[_0xab14('0x6d')]['name'],_0x50a9ea[_0xab14('0x6d')][_0xab14('0x74')],_0x586f64[_0xab14('0x72')]['id'],_0x50a9ea[_0xab14('0x4e')]?JSON[_0xab14('0x1b')](_0x50a9ea[_0xab14('0x4e')]):_0xab14('0x75'));return respondWithRpcPromise(_0xab14('0x76'),'acceptMessage',_0x586f64);}return null;})[_0xab14('0x28')](function(_0x2d458d){var _0x5daab0=_0xab14('0x77')+_0x2d458d[_0xab14('0x1e')][_0xab14('0x78')];return db[_0xab14('0x79')][_0xab14('0x36')](_0x5daab0,{'type':db[_0xab14('0x7a')][_0xab14('0x7b')]['SELECT'],'raw':!![]})[_0xab14('0x28')](function(_0x1c8ad8){return _0x1c8ad8;});})[_0xab14('0x28')](function(_0x204c69){if(_0x204c69){_0x586f64['message'][_0xab14('0x7c')]=_0x204c69[0x0];if(!_0x50a9ea[_0xab14('0x4e')]['UserId'])return;return db[_0xab14('0x7d')][_0xab14('0x4c')]({'where':{'id':_0x50a9ea[_0xab14('0x4e')][_0xab14('0x6c')],'role':_0xab14('0x7e')},'attributes':['id','name',_0xab14('0x7f'),_0xab14('0x80'),_0xab14('0x81')],'raw':!![]});}return null;})[_0xab14('0x28')](function(_0x4580f9){if(!_0x4580f9)return null;_0x586f64[_0xab14('0x1e')]['agent']=_0x4580f9;return _0x586f64;})['then'](function(_0x53a650){if(_0x53a650){if(_0x50a9ea[_0xab14('0x4e')][_0xab14('0x82')]){_0x586f64[_0xab14('0x1e')]['interface']=util[_0xab14('0x66')](_0xab14('0x83'),_0x50a9ea['user']['name']);_0x586f64[_0xab14('0x1e')][_0xab14('0x84')]=_0x586f64[_0xab14('0x84')];_0x586f64[_0xab14('0x1e')][_0xab14('0x85')]=_0x586f64[_0xab14('0x84')];_0x586f64[_0xab14('0x1e')][_0xab14('0x86')]=_0xab14('0x68');_0x586f64[_0xab14('0x1e')][_0xab14('0x4e')]=htmlToText[_0xab14('0x87')](_0x586f64['message']['body']);return respondWithRpcPromise(_0xab14('0x88'),_0xab14('0x88'),{'event':_0xab14('0x89'),'message':_0x586f64[_0xab14('0x1e')]},client9002)['then'](function(){return _0x586f64;});}return _0x586f64;}return null;})[_0xab14('0x28')](respondWithResult(_0x50bd31,null))[_0xab14('0x4d')](handleError(_0x50bd31,null));};exports[_0xab14('0x8a')]=function(_0x5e4a4c,_0x4ef746){var _0x429038={'agent':{},'channel':_0xab14('0x69')};if(_0x5e4a4c[_0xab14('0x4e')]['id']){delete _0x5e4a4c[_0xab14('0x4e')]['id'];}_0x5e4a4c['body'][_0xab14('0x6c')]=_0x5e4a4c[_0xab14('0x4e')][_0xab14('0x6c')]||_0x5e4a4c[_0xab14('0x6d')]['id'];_0x429038[_0xab14('0x7e')]['id']=_0x5e4a4c[_0xab14('0x4e')]['UserId'];return db[_0xab14('0x30')][_0xab14('0x4c')]({'where':{'id':_0x5e4a4c[_0xab14('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4ef746,null))['then'](function(_0x2678d2){if(_0x2678d2){_0x429038['message']=_0x2678d2[_0xab14('0x6e')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x2678d2[_0xab14('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x4ef746,null))[_0xab14('0x28')](function(_0x176b3c){if(_0x176b3c){_0x429038[_0xab14('0x72')]=_0x176b3c[_0xab14('0x6e')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e4a4c[_0xab14('0x6d')]['id'],_0x5e4a4c[_0xab14('0x6d')][_0xab14('0x2d')],_0x5e4a4c['user'][_0xab14('0x74')],_0x429038['interaction']['id'],_0x5e4a4c[_0xab14('0x4e')]?JSON['stringify'](_0x5e4a4c[_0xab14('0x4e')]):_0xab14('0x75'));return respondWithRpcPromise(_0xab14('0x8b'),_0xab14('0x8c'),_0x429038);}return null;})[_0xab14('0x28')](function(_0x5521e3){var _0x11d890='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5521e3[_0xab14('0x1e')][_0xab14('0x78')];return db[_0xab14('0x79')]['query'](_0x11d890,{'type':db['Sequelize'][_0xab14('0x7b')][_0xab14('0x8d')],'raw':!![]})[_0xab14('0x28')](function(_0x4258ae){return _0x4258ae;});})['then'](function(_0x2a1a5e){if(_0x2a1a5e){_0x429038['message'][_0xab14('0x7c')]=_0x2a1a5e[0x0];if(!_0x5e4a4c[_0xab14('0x4e')]['UserId'])return;return db[_0xab14('0x7d')]['find']({'where':{'id':_0x5e4a4c[_0xab14('0x4e')][_0xab14('0x6c')],'role':'agent'},'attributes':['id',_0xab14('0x2d'),_0xab14('0x7f'),_0xab14('0x80'),_0xab14('0x81')],'raw':!![]});}return null;})[_0xab14('0x28')](function(_0x2ed637){if(!_0x2ed637)return null;_0x429038[_0xab14('0x1e')]['agent']=_0x2ed637;return _0x429038;})[_0xab14('0x28')](function(_0x1528ba){if(_0x1528ba){_0x1528ba[_0xab14('0x1e')][_0xab14('0x8e')]=util[_0xab14('0x66')](_0xab14('0x83'),_0x5e4a4c['user'][_0xab14('0x2d')]);_0x1528ba['message'][_0xab14('0x84')]=_0x429038[_0xab14('0x84')];_0x1528ba[_0xab14('0x1e')][_0xab14('0x85')]=_0x429038[_0xab14('0x84')];_0x1528ba[_0xab14('0x1e')]['event']=_0xab14('0x8a');_0x1528ba[_0xab14('0x1e')][_0xab14('0x4e')]=htmlToText[_0xab14('0x87')](_0x429038[_0xab14('0x1e')]['body']);respondWithRpcPromise(_0xab14('0x88'),_0xab14('0x88'),{'event':_0xab14('0x8f'),'message':_0x1528ba[_0xab14('0x1e')]},client9002);return _0x429038;}return null;})[_0xab14('0x28')](respondWithResult(_0x4ef746,null))[_0xab14('0x4d')](handleError(_0x4ef746,null));};exports[_0xab14('0x90')]=function(_0xe20bff,_0x5e39e0){var _0x5c5a06=moment()[_0xab14('0x91')]()[_0xab14('0x92')]();var _0x1797a9=path['join'](config[_0xab14('0x5e')],'server',_0xab14('0x93'),'tmp');var _0x5bfef6=path['join'](config[_0xab14('0x5e')],_0xab14('0x94'),'files',_0xab14('0x5d'));var _0x46481e=util['format'](_0xab14('0x95'),_0x5c5a06);return db[_0xab14('0x30')]['find']({'where':{'id':_0xe20bff[_0xab14('0x4a')]['id']},'attributes':['id','body','from','to','cc',_0xab14('0x96'),_0xab14('0x97'),'createdAt'],'include':_0xe20bff[_0xab14('0x36')][_0xab14('0x5d')]?[{'model':db[_0xab14('0x98')],'as':_0xab14('0x99')}]:undefined})[_0xab14('0x28')](handleEntityNotFound(_0x5e39e0,null))[_0xab14('0x28')](function(_0x4bba47){if(_0x4bba47){var _0x465b6e=_0x4bba47;var _0x118fbb={'from':_0x465b6e[_0xab14('0x9a')],'to':_0x465b6e['to'],'subject':_0x465b6e[_0xab14('0x97')],'html':htmlEntities['decode'](_0x465b6e[_0xab14('0x4e')]),'headers':{'Date':moment(_0x465b6e['createdAt'])[_0xab14('0x66')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4bba47['cc']){_0x118fbb['headers']['Cc']=_0x4bba47['cc'];}if(_0x4bba47['bcc']){_0x118fbb[_0xab14('0x9b')][_0xab14('0x9c')]=_0x4bba47[_0xab14('0x96')];}return new BPromise(function(_0x5a6e4c,_0x4efc98){if(_0x4bba47[_0xab14('0x99')]){for(var _0x1dc7de=0x0;_0x1dc7de<_0x4bba47[_0xab14('0x99')][_0xab14('0x3c')];_0x1dc7de++){var _0x5b39a7=_0x4bba47[_0xab14('0x99')][_0x1dc7de];var _0x1ca75e=path[_0xab14('0x9d')](_0x5bfef6,_0x5b39a7['basename']);if(fs[_0xab14('0x9e')](_0x1ca75e)){_0x118fbb[_0xab14('0x5d')]['push']({'name':_0x5b39a7[_0xab14('0x2d')],'contentType':_0x5b39a7[_0xab14('0x32')],'data':fs[_0xab14('0x9f')](_0x1ca75e)});}}}emlformat[_0xab14('0xa0')](_0x118fbb,function(_0x206c02,_0x35a8c8){if(_0x206c02)return _0x4efc98(_0x206c02);fs['writeFileSync'](path[_0xab14('0x9d')](_0x1797a9,_0x46481e),_0x35a8c8);return _0x5a6e4c(_0x35a8c8);});});}})['then'](function(_0x45a729){if(_0x45a729){return _0x5e39e0['download'](path[_0xab14('0x9d')](_0x1797a9,_0x46481e),_0x46481e,function(_0x19f158){if(!_0x19f158)fs[_0xab14('0xa1')](path[_0xab14('0x9d')](_0x1797a9,_0x46481e));});}})['catch'](handleError(_0x5e39e0,null));}; \ No newline at end of file +var _0xa293=['[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','User','fullname','email','interface','download','unix','toString','root','files','tmp','server','message-%s.eml','from','createdAt','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','Attachments','basename','existsSync','push','readFileSync','build','writeFileSync','join','unlinkSync','eml-format','moment','bluebird','util','path','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','status','json','offset','undefined','count','set','Content-Range','then','destroy','end','sendStatus','stack','name','index','MailMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','update','body','find','params','describe','create','out','secret','split','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','attachments','server/files/attachments','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','MailInteraction','MailInteractionId','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','internal','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xa293,0xc0));var _0x3a29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa293[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x3a29('0x0'));var moment=require(_0x3a29('0x1'));var BPromise=require(_0x3a29('0x2'));var util=require(_0x3a29('0x3'));var path=require(_0x3a29('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x3a29('0x5'));var htmlToText=require(_0x3a29('0x6'));var qs=require(_0x3a29('0x7'));var logger=require('../../config/logger')(_0x3a29('0x8'));var interaction_log=require(_0x3a29('0x9'))(_0x3a29('0xa'));var config=require(_0x3a29('0xb'));var db=require('../../mysqldb')['db'];config[_0x3a29('0xc')]=_[_0x3a29('0xd')](config[_0x3a29('0xc')],{'host':_0x3a29('0xe'),'port':0x18eb});var socket=require(_0x3a29('0xf'))(new Redis(config[_0x3a29('0xc')]));var htmlEntities=require(_0x3a29('0x10'));require(_0x3a29('0x11'))[_0x3a29('0x12')](socket);var jayson=require(_0x3a29('0x13'));var client=jayson[_0x3a29('0x14')][_0x3a29('0x15')]({'port':0x232c});var client9003=jayson[_0x3a29('0x14')][_0x3a29('0x15')]({'port':0x232b});var client9002=jayson['client'][_0x3a29('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x4b5393,_0x574002,_0x1f6952,_0x30e7a0){return new BPromise(function(_0x51cd1f,_0x2b2962){var _0x22f707=_0x30e7a0||client;return _0x22f707['request'](_0x4b5393,_0x1f6952)['then'](function(_0x2aaa28){logger[_0x3a29('0x16')]('MailMessage,\x20%s,\x20%s',_0x574002,_0x3a29('0x17'));logger[_0x3a29('0x18')](_0x3a29('0x19'),_0x574002,_0x3a29('0x17'),JSON[_0x3a29('0x1a')](_0x2aaa28));if(_0x2aaa28['error']){if(_0x2aaa28[_0x3a29('0x1b')][_0x3a29('0x1c')]===0x1f4){logger[_0x3a29('0x1b')](_0x3a29('0x1d'),_0x574002,_0x2aaa28['error'][_0x3a29('0x1e')]);return _0x2b2962(_0x2aaa28[_0x3a29('0x1b')][_0x3a29('0x1e')]);}logger[_0x3a29('0x1b')]('MailMessage,\x20%s,\x20%s',_0x574002,_0x2aaa28[_0x3a29('0x1b')][_0x3a29('0x1e')]);return _0x51cd1f(_0x2aaa28[_0x3a29('0x1b')][_0x3a29('0x1e')]);}else{logger[_0x3a29('0x16')]('MailMessage,\x20%s,\x20%s',_0x574002,_0x3a29('0x17'));_0x51cd1f(_0x2aaa28['result'][_0x3a29('0x1e')]);}})[_0x3a29('0x1f')](function(_0x417dbc){logger[_0x3a29('0x1b')]('MailMessage,\x20%s,\x20%s',_0x574002,_0x417dbc);_0x2b2962(_0x417dbc);});});}function respondWithResult(_0x2d335a,_0x2b6c69){_0x2b6c69=_0x2b6c69||0xc8;return function(_0x450154){if(_0x450154){return _0x2d335a[_0x3a29('0x20')](_0x2b6c69)[_0x3a29('0x21')](_0x450154);}};}function respondWithFilteredResult(_0x26d8c2,_0x30bd2f){return function(_0x565a0a){if(_0x565a0a){var _0x2faadb=typeof _0x30bd2f[_0x3a29('0x22')]===_0x3a29('0x23')&&typeof _0x30bd2f['limit']===_0x3a29('0x23');var _0x41939c=_0x565a0a[_0x3a29('0x24')];var _0x323b1e=_0x2faadb?0x0:_0x30bd2f['offset'];var _0x576350=_0x2faadb?_0x565a0a['count']:_0x30bd2f[_0x3a29('0x22')]+_0x30bd2f['limit'];var _0x597cf4;if(_0x576350>=_0x41939c){_0x576350=_0x41939c;_0x597cf4=0xc8;}else{_0x597cf4=0xce;}_0x26d8c2[_0x3a29('0x20')](_0x597cf4);return _0x26d8c2[_0x3a29('0x25')](_0x3a29('0x26'),_0x323b1e+'-'+_0x576350+'/'+_0x41939c)[_0x3a29('0x21')](_0x565a0a);}return null;};}function saveUpdates(_0x121647){return function(_0x3c23af){if(_0x3c23af){return _0x3c23af['update'](_0x121647)[_0x3a29('0x27')](function(_0x4ce86f){return _0x4ce86f;});}return null;};}function removeEntity(_0x242452){return function(_0x2a99b1){if(_0x2a99b1){return _0x2a99b1[_0x3a29('0x28')]()[_0x3a29('0x27')](function(){_0x242452[_0x3a29('0x20')](0xcc)[_0x3a29('0x29')]();});}};}function handleEntityNotFound(_0x5da448){return function(_0xebdde2){if(!_0xebdde2){_0x5da448[_0x3a29('0x2a')](0x194);}return _0xebdde2;};}function handleError(_0x8547a,_0x4df6dc){_0x4df6dc=_0x4df6dc||0x1f4;return function(_0x145fa5){logger[_0x3a29('0x1b')](_0x145fa5[_0x3a29('0x2b')]);if(_0x145fa5[_0x3a29('0x2c')]){delete _0x145fa5[_0x3a29('0x2c')];}_0x8547a['status'](_0x4df6dc)['send'](_0x145fa5);};}exports[_0x3a29('0x2d')]=function(_0x2fe8c8,_0x51651e){var _0x4d5e5e={},_0xff42b0={},_0x3c5411={'count':0x0,'rows':[]};var _0x56cf15=_['map'](db[_0x3a29('0x2e')][_0x3a29('0x2f')],function(_0x3bf90b){return{'name':_0x3bf90b[_0x3a29('0x30')],'type':_0x3bf90b[_0x3a29('0x31')]['key']};});_0xff42b0[_0x3a29('0x32')]=_['map'](_0x56cf15,'name');_0xff42b0[_0x3a29('0x33')]=_[_0x3a29('0x34')](_0x2fe8c8[_0x3a29('0x33')]);_0xff42b0[_0x3a29('0x35')]=_[_0x3a29('0x36')](_0xff42b0[_0x3a29('0x32')],_0xff42b0[_0x3a29('0x33')]);_0x4d5e5e['attributes']=_[_0x3a29('0x36')](_0xff42b0[_0x3a29('0x32')],qs[_0x3a29('0x37')](_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x37')]));_0x4d5e5e[_0x3a29('0x38')]=_0x4d5e5e[_0x3a29('0x38')][_0x3a29('0x39')]?_0x4d5e5e[_0x3a29('0x38')]:_0xff42b0[_0x3a29('0x32')];if(!_0x2fe8c8['query'][_0x3a29('0x3a')](_0x3a29('0x3b'))){_0x4d5e5e[_0x3a29('0x3c')]=qs[_0x3a29('0x3c')](_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x3c')]);_0x4d5e5e[_0x3a29('0x22')]=qs['offset'](_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x22')]);}_0x4d5e5e[_0x3a29('0x3d')]=qs['sort'](_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x3e')]);_0x4d5e5e['where']=qs[_0x3a29('0x35')](_['pick'](_0x2fe8c8[_0x3a29('0x33')],_0xff42b0[_0x3a29('0x35')]),_0x56cf15);if(_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x3f')]){_0x4d5e5e[_0x3a29('0x40')]=_[_0x3a29('0x41')](_0x4d5e5e[_0x3a29('0x40')],{'$or':_[_0x3a29('0x42')](_0x56cf15,function(_0x15b15d){if(_0x15b15d[_0x3a29('0x31')]!==_0x3a29('0x43')){var _0x2a93d6={};_0x2a93d6[_0x15b15d[_0x3a29('0x2c')]]={'$like':'%'+_0x2fe8c8['query'][_0x3a29('0x3f')]+'%'};return _0x2a93d6;}})});}_0x4d5e5e=_['merge']({},_0x4d5e5e,_0x2fe8c8[_0x3a29('0x44')]);var _0x232c50={'where':_0x4d5e5e['where']};return db[_0x3a29('0x2e')][_0x3a29('0x24')](_0x232c50)[_0x3a29('0x27')](function(_0x266a5b){_0x3c5411[_0x3a29('0x24')]=_0x266a5b;if(_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x45')]){_0x4d5e5e[_0x3a29('0x46')]=[{'all':!![]}];}return db[_0x3a29('0x2e')][_0x3a29('0x47')](_0x4d5e5e);})[_0x3a29('0x27')](function(_0x46befd){_0x3c5411[_0x3a29('0x48')]=_0x46befd;return _0x3c5411;})[_0x3a29('0x27')](respondWithFilteredResult(_0x51651e,_0x4d5e5e))[_0x3a29('0x1f')](handleError(_0x51651e,null));};exports['show']=function(_0x8b3fad,_0x1e3315){var _0x31ed9d={'raw':!![],'where':{'id':_0x8b3fad['params']['id']}},_0xd255b0={};_0xd255b0[_0x3a29('0x32')]=_['keys'](db['MailMessage'][_0x3a29('0x2f')]);_0xd255b0['query']=_['keys'](_0x8b3fad[_0x3a29('0x33')]);_0xd255b0[_0x3a29('0x35')]=_[_0x3a29('0x36')](_0xd255b0[_0x3a29('0x32')],_0xd255b0[_0x3a29('0x33')]);_0x31ed9d[_0x3a29('0x38')]=_[_0x3a29('0x36')](_0xd255b0[_0x3a29('0x32')],qs[_0x3a29('0x37')](_0x8b3fad['query'][_0x3a29('0x37')]));_0x31ed9d[_0x3a29('0x38')]=_0x31ed9d[_0x3a29('0x38')][_0x3a29('0x39')]?_0x31ed9d['attributes']:_0xd255b0[_0x3a29('0x32')];if(_0x8b3fad[_0x3a29('0x33')]['includeAll']){_0x31ed9d['include']=[{'all':!![]}];}_0x31ed9d=_[_0x3a29('0x41')]({},_0x31ed9d,_0x8b3fad[_0x3a29('0x44')]);return db[_0x3a29('0x2e')]['find'](_0x31ed9d)[_0x3a29('0x27')](handleEntityNotFound(_0x1e3315,null))['then'](respondWithResult(_0x1e3315,null))[_0x3a29('0x1f')](handleError(_0x1e3315,null));};exports[_0x3a29('0x49')]=function(_0xb6bce3,_0x22d116){if(_0xb6bce3[_0x3a29('0x4a')]['id']){delete _0xb6bce3[_0x3a29('0x4a')]['id'];}return db['MailMessage'][_0x3a29('0x4b')]({'where':{'id':_0xb6bce3[_0x3a29('0x4c')]['id']}})[_0x3a29('0x27')](handleEntityNotFound(_0x22d116,null))[_0x3a29('0x27')](saveUpdates(_0xb6bce3[_0x3a29('0x4a')],null))['then'](respondWithResult(_0x22d116,null))['catch'](handleError(_0x22d116,null));};exports['destroy']=function(_0x1697c3,_0x50783d){return db['MailMessage'][_0x3a29('0x4b')]({'where':{'id':_0x1697c3['params']['id']}})[_0x3a29('0x27')](handleEntityNotFound(_0x50783d,null))[_0x3a29('0x27')](removeEntity(_0x50783d,null))['catch'](handleError(_0x50783d,null));};exports[_0x3a29('0x4d')]=function(_0x5682e2,_0x418e92){return db[_0x3a29('0x2e')][_0x3a29('0x4d')]()[_0x3a29('0x27')](respondWithResult(_0x418e92,null))[_0x3a29('0x1f')](handleError(_0x418e92,null));};exports[_0x3a29('0x4e')]=function(_0x3237e9,_0x216c5e){return db['MailMessage']['create'](_0x3237e9[_0x3a29('0x4a')])[_0x3a29('0x27')](function(_0x55652d){if(_0x55652d){if(_0x55652d['direction']===_0x3a29('0x4f')&&!_0x55652d[_0x3a29('0x50')]){var _0x2bff3a,_0xf80d04,_0x4650f1;if(_0x3237e9[_0x3a29('0x4a')]['to']){_0xf80d04=_0x3237e9[_0x3a29('0x4a')]['to'][_0x3a29('0x51')](',')[0x0];}return db['MailAccount'][_0x3a29('0x52')]({'where':{'id':_0x55652d[_0x3a29('0x53')]},'include':[{'model':db[_0x3a29('0x54')],'as':'List','include':[{'model':db[_0x3a29('0x55')],'as':_0x3a29('0x56'),'where':{'email':_0xf80d04},'limit':0x1,'order':[[_0x3a29('0x57'),_0x3a29('0x58')]]}]},{'model':db[_0x3a29('0x59')],'as':_0x3a29('0x5a'),'raw':!![],'include':[{'model':db[_0x3a29('0x5b')],'as':_0x3a29('0x5b'),'raw':!![]}]}]})[_0x3a29('0x27')](function(_0x107a88){_0x2bff3a=_0x107a88;if(!_0x2bff3a||!_0x2bff3a[_0x3a29('0x5a')])return;var _0x207f8c=_0x2bff3a['getSmtpOptions']();if(_0x3237e9['body'][_0x3a29('0x5c')]&&_0x3237e9[_0x3a29('0x4a')][_0x3a29('0x5c')][_0x3a29('0x39')]){for(var _0x549c41=0x0;_0x549c41<_0x3237e9[_0x3a29('0x4a')][_0x3a29('0x5c')][_0x3a29('0x39')];_0x549c41+=0x1){_0x3237e9[_0x3a29('0x4a')][_0x3a29('0x5c')][_0x549c41]={'filename':_0x3237e9[_0x3a29('0x4a')][_0x3a29('0x5c')][_0x549c41][_0x3a29('0x2c')],'path':path['join'](config['root'],_0x3a29('0x5d'),_0x3237e9[_0x3a29('0x4a')][_0x3a29('0x5c')][_0x549c41]['basename'])};}}_0x4650f1={'account':_0x207f8c,'message':_0x3237e9[_0x3a29('0x4a')]};return;})[_0x3a29('0x27')](function(){if(_0x2bff3a[_0x3a29('0x5e')]){if(_0x2bff3a[_0x3a29('0x5e')][_0x3a29('0x56')][_0x3a29('0x39')]){return _0x2bff3a[_0x3a29('0x5e')][_0x3a29('0x56')][0x0];}else{return db[_0x3a29('0x55')][_0x3a29('0x4e')](_[_0x3a29('0xd')](_0x3237e9[_0x3a29('0x4a')],{'firstName':_0x3237e9[_0x3a29('0x4a')]['to'],'email':_0x3237e9[_0x3a29('0x4a')]['to'],'phone':_0x3237e9[_0x3a29('0x4a')]['to'],'ListId':_0x2bff3a[_0x3a29('0x5f')]}));}}else{throw new Error(_0x3a29('0x60'));}})[_0x3a29('0x27')](function(){if(_0x4650f1){return respondWithRpcPromise(_0x3a29('0x61'),_0x3a29('0x62'),_0x4650f1,client9003)[_0x3a29('0x27')](function(_0x4358d2){return _0x55652d['update']({'read':!![],'messageId':_0x4358d2[_0x3a29('0x63')],'sentAt':moment()[_0x3a29('0x64')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x2c54f3){logger[_0x3a29('0x1b')]('%s',JSON['stringify'](_0x2c54f3));return _0x55652d;});}return _0x55652d;});}return _0x55652d;}})['then'](respondWithResult(_0x216c5e,0xc9))[_0x3a29('0x1f')](handleError(_0x216c5e,null));};exports[_0x3a29('0x65')]=function(_0x2b9e01,_0x2b09da){var _0x40bd54={'agent':{},'channel':'mail'};if(_0x2b9e01[_0x3a29('0x4a')]['id']){delete _0x2b9e01[_0x3a29('0x4a')]['id'];}_0x2b9e01[_0x3a29('0x4a')]['read']=!![];_0x2b9e01['body']['readAt']=moment()[_0x3a29('0x64')](_0x3a29('0x66'));_0x2b9e01['body'][_0x3a29('0x67')]=_0x2b9e01[_0x3a29('0x4a')]['UserId']||_0x2b9e01[_0x3a29('0x68')]['id'];_0x40bd54[_0x3a29('0x69')]['id']=_0x2b9e01[_0x3a29('0x4a')][_0x3a29('0x67')];return db[_0x3a29('0x2e')][_0x3a29('0x4b')]({'where':{'id':_0x2b9e01[_0x3a29('0x4c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b09da,null))[_0x3a29('0x27')](saveUpdates(_0x2b9e01[_0x3a29('0x4a')],null))['then'](function(_0x26a5b6){if(_0x26a5b6){_0x40bd54[_0x3a29('0x1e')]=_0x26a5b6['get']({'plain':!![]});return db[_0x3a29('0x6a')][_0x3a29('0x4b')]({'where':{'id':_0x26a5b6[_0x3a29('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x2b09da,null))[_0x3a29('0x27')](function(_0x2f2f4b){if(_0x2f2f4b){return _0x2f2f4b[_0x3a29('0x49')]({'UserId':_0x2b9e01[_0x3a29('0x4a')]['UserId'],'read1stAt':_['isNil'](_0x2f2f4b['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3a29('0x27')](function(_0x2e77ac){if(_0x2e77ac){_0x40bd54[_0x3a29('0x6c')]=_0x2e77ac[_0x3a29('0x6d')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b9e01[_0x3a29('0x68')]['id'],_0x2b9e01[_0x3a29('0x68')][_0x3a29('0x2c')],_0x2b9e01['user'][_0x3a29('0x6e')],_0x40bd54['interaction']['id'],_0x2b9e01[_0x3a29('0x4a')]?JSON[_0x3a29('0x1a')](_0x2b9e01['body']):_0x3a29('0x6f'));return respondWithRpcPromise(_0x3a29('0x70'),_0x3a29('0x71'),_0x40bd54);}return null;})[_0x3a29('0x27')](function(_0x23867f){var _0x496188=_0x3a29('0x72')+_0x23867f[_0x3a29('0x1e')][_0x3a29('0x73')];return db['sequelize'][_0x3a29('0x33')](_0x496188,{'type':db[_0x3a29('0x74')][_0x3a29('0x75')]['SELECT'],'raw':!![]})[_0x3a29('0x27')](function(_0x132529){return _0x132529;});})[_0x3a29('0x27')](function(_0x31014d){if(_0x31014d){_0x40bd54[_0x3a29('0x1e')][_0x3a29('0x76')]=_0x31014d[0x0];if(!_0x2b9e01[_0x3a29('0x4a')][_0x3a29('0x67')])return;return db['User'][_0x3a29('0x4b')]({'where':{'id':_0x2b9e01[_0x3a29('0x4a')][_0x3a29('0x67')],'role':'agent'},'attributes':['id','name','fullname','email',_0x3a29('0x77')],'raw':!![]});}return null;})[_0x3a29('0x27')](function(_0x91fa4b){if(!_0x91fa4b)return null;_0x40bd54[_0x3a29('0x1e')][_0x3a29('0x69')]=_0x91fa4b;return _0x40bd54;})[_0x3a29('0x27')](function(_0xef14db){if(_0xef14db){if(_0x2b9e01[_0x3a29('0x4a')][_0x3a29('0x78')]){_0x40bd54['message']['interface']=util[_0x3a29('0x64')](_0x3a29('0x79'),_0x2b9e01[_0x3a29('0x68')][_0x3a29('0x2c')]);_0x40bd54[_0x3a29('0x1e')][_0x3a29('0x7a')]=_0x40bd54[_0x3a29('0x7a')];_0x40bd54[_0x3a29('0x1e')][_0x3a29('0x7b')]=_0x40bd54[_0x3a29('0x7a')];_0x40bd54[_0x3a29('0x1e')][_0x3a29('0x7c')]=_0x3a29('0x65');_0x40bd54['message'][_0x3a29('0x4a')]=htmlToText[_0x3a29('0x7d')](_0x40bd54[_0x3a29('0x1e')]['body']);return respondWithRpcPromise(_0x3a29('0x7e'),_0x3a29('0x7e'),{'event':'acceptmessage','message':_0x40bd54[_0x3a29('0x1e')]},client9002)[_0x3a29('0x27')](function(){return _0x40bd54;});}return _0x40bd54;}return null;})[_0x3a29('0x27')](respondWithResult(_0x2b09da,null))['catch'](handleError(_0x2b09da,null));};exports[_0x3a29('0x7f')]=function(_0x4fba39,_0x53862c){var _0x4314f7={'agent':{},'channel':'mail'};if(_0x4fba39[_0x3a29('0x4a')]['id']){delete _0x4fba39[_0x3a29('0x4a')]['id'];}_0x4fba39[_0x3a29('0x4a')]['UserId']=_0x4fba39[_0x3a29('0x4a')][_0x3a29('0x67')]||_0x4fba39[_0x3a29('0x68')]['id'];_0x4314f7[_0x3a29('0x69')]['id']=_0x4fba39[_0x3a29('0x4a')]['UserId'];return db[_0x3a29('0x2e')][_0x3a29('0x4b')]({'where':{'id':_0x4fba39['params']['id'],'UserId':null}})[_0x3a29('0x27')](handleEntityNotFound(_0x53862c,null))[_0x3a29('0x27')](function(_0x4fa937){if(_0x4fa937){_0x4314f7[_0x3a29('0x1e')]=_0x4fa937[_0x3a29('0x6d')]({'plain':!![]});return db[_0x3a29('0x6a')][_0x3a29('0x4b')]({'where':{'id':_0x4fa937[_0x3a29('0x6b')]}});}return null;})[_0x3a29('0x27')](handleEntityNotFound(_0x53862c,null))[_0x3a29('0x27')](function(_0x1ddcb0){if(_0x1ddcb0){_0x4314f7[_0x3a29('0x6c')]=_0x1ddcb0['get']({'plain':!![]});interaction_log['info'](_0x3a29('0x80'),_0x4fba39[_0x3a29('0x68')]['id'],_0x4fba39[_0x3a29('0x68')]['name'],_0x4fba39[_0x3a29('0x68')]['role'],_0x4314f7[_0x3a29('0x6c')]['id'],_0x4fba39[_0x3a29('0x4a')]?JSON[_0x3a29('0x1a')](_0x4fba39[_0x3a29('0x4a')]):'null');return respondWithRpcPromise(_0x3a29('0x81'),_0x3a29('0x82'),_0x4314f7);}return null;})[_0x3a29('0x27')](function(_0x536383){var _0x1c9431='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x536383[_0x3a29('0x1e')][_0x3a29('0x73')];return db['sequelize']['query'](_0x1c9431,{'type':db['Sequelize'][_0x3a29('0x75')][_0x3a29('0x83')],'raw':!![]})[_0x3a29('0x27')](function(_0xe7ea18){return _0xe7ea18;});})[_0x3a29('0x27')](function(_0x55e202){if(_0x55e202){_0x4314f7['message'][_0x3a29('0x76')]=_0x55e202[0x0];if(!_0x4fba39[_0x3a29('0x4a')]['UserId'])return;return db[_0x3a29('0x84')][_0x3a29('0x4b')]({'where':{'id':_0x4fba39[_0x3a29('0x4a')][_0x3a29('0x67')],'role':_0x3a29('0x69')},'attributes':['id',_0x3a29('0x2c'),_0x3a29('0x85'),_0x3a29('0x86'),'internal'],'raw':!![]});}return null;})['then'](function(_0xf5d6a0){if(!_0xf5d6a0)return null;_0x4314f7[_0x3a29('0x1e')][_0x3a29('0x69')]=_0xf5d6a0;return _0x4314f7;})[_0x3a29('0x27')](function(_0x2f18f8){if(_0x2f18f8){_0x2f18f8[_0x3a29('0x1e')][_0x3a29('0x87')]=util[_0x3a29('0x64')](_0x3a29('0x79'),_0x4fba39[_0x3a29('0x68')]['name']);_0x2f18f8['message'][_0x3a29('0x7a')]=_0x4314f7[_0x3a29('0x7a')];_0x2f18f8[_0x3a29('0x1e')][_0x3a29('0x7b')]=_0x4314f7[_0x3a29('0x7a')];_0x2f18f8[_0x3a29('0x1e')][_0x3a29('0x7c')]=_0x3a29('0x7f');_0x2f18f8['message']['body']=htmlToText[_0x3a29('0x7d')](_0x4314f7[_0x3a29('0x1e')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x2f18f8[_0x3a29('0x1e')]},client9002);return _0x4314f7;}return null;})[_0x3a29('0x27')](respondWithResult(_0x53862c,null))[_0x3a29('0x1f')](handleError(_0x53862c,null));};exports[_0x3a29('0x88')]=function(_0x5e2cf1,_0x15a8ec){var _0x426d9d=moment()[_0x3a29('0x89')]()[_0x3a29('0x8a')]();var _0x11e635=path['join'](config[_0x3a29('0x8b')],'server',_0x3a29('0x8c'),_0x3a29('0x8d'));var _0x2a4df2=path['join'](config[_0x3a29('0x8b')],_0x3a29('0x8e'),_0x3a29('0x8c'),_0x3a29('0x5c'));var _0x15fedd=util['format'](_0x3a29('0x8f'),_0x426d9d);return db[_0x3a29('0x2e')][_0x3a29('0x4b')]({'where':{'id':_0x5e2cf1[_0x3a29('0x4c')]['id']},'attributes':['id',_0x3a29('0x4a'),_0x3a29('0x90'),'to','cc','bcc','subject',_0x3a29('0x91')],'include':_0x5e2cf1['query'][_0x3a29('0x5c')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x15a8ec,null))[_0x3a29('0x27')](function(_0x270df6){if(_0x270df6){var _0x5029ff=_0x270df6;var _0x582afc={'from':_0x5029ff[_0x3a29('0x90')],'to':_0x5029ff['to'],'subject':_0x5029ff['subject'],'html':htmlEntities[_0x3a29('0x92')](_0x5029ff[_0x3a29('0x4a')]),'headers':{'Date':moment(_0x5029ff[_0x3a29('0x91')])['format'](_0x3a29('0x93'))},'attachments':[]};if(_0x270df6['cc']){_0x582afc[_0x3a29('0x94')]['Cc']=_0x270df6['cc'];}if(_0x270df6[_0x3a29('0x95')]){_0x582afc[_0x3a29('0x94')][_0x3a29('0x96')]=_0x270df6[_0x3a29('0x95')];}return new BPromise(function(_0x1f3753,_0x11b0e9){if(_0x270df6['Attachments']){for(var _0x52f665=0x0;_0x52f665<_0x270df6['Attachments'][_0x3a29('0x39')];_0x52f665++){var _0x398ef4=_0x270df6[_0x3a29('0x97')][_0x52f665];var _0x339480=path['join'](_0x2a4df2,_0x398ef4[_0x3a29('0x98')]);if(fs[_0x3a29('0x99')](_0x339480)){_0x582afc[_0x3a29('0x5c')][_0x3a29('0x9a')]({'name':_0x398ef4['name'],'contentType':_0x398ef4[_0x3a29('0x31')],'data':fs[_0x3a29('0x9b')](_0x339480)});}}}emlformat[_0x3a29('0x9c')](_0x582afc,function(_0x2c07ab,_0x41d2a7){if(_0x2c07ab)return _0x11b0e9(_0x2c07ab);fs[_0x3a29('0x9d')](path[_0x3a29('0x9e')](_0x11e635,_0x15fedd),_0x41d2a7);return _0x1f3753(_0x41d2a7);});});}})['then'](function(_0x9fa70d){if(_0x9fa70d){return _0x15a8ec[_0x3a29('0x88')](path[_0x3a29('0x9e')](_0x11e635,_0x15fedd),_0x15fedd,function(_0x2c2ab6){if(!_0x2c2ab6)fs[_0x3a29('0x9f')](path[_0x3a29('0x9e')](_0x11e635,_0x15fedd));});}})[_0x3a29('0x1f')](handleError(_0x15a8ec,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 040bb53..98cb7cd 100644 --- a/server/api/mailMessage/mailMessage.events.js +++ b/server/api/mailMessage/mailMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9bd=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x48cb66,_0x151379){var _0xbca8e8=function(_0x7bed2){while(--_0x7bed2){_0x48cb66['push'](_0x48cb66['shift']());}};_0xbca8e8(++_0x151379);}(_0xd9bd,0x138));var _0xdd9b=function(_0x2a1a2c,_0x12d1e2){_0x2a1a2c=_0x2a1a2c-0x0;var _0x435e08=_0xd9bd[_0x2a1a2c];return _0x435e08;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xdd9b('0x0'))['db'][_0xdd9b('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xdd9b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdd9b('0x3'),'afterDestroy':_0xdd9b('0x4')};function emitEvent(_0x3aa1be){return function(_0x148606,_0x47375b,_0x18af68){MailMessageEvents[_0xdd9b('0x5')](_0x3aa1be+':'+_0x148606['id'],_0x148606);MailMessageEvents[_0xdd9b('0x5')](_0x3aa1be,_0x148606);_0x18af68(null);};}for(var e in events){if(events[_0xdd9b('0x6')](e)){var event=events[e];MailMessage[_0xdd9b('0x7')](e,emitEvent(event));}}module[_0xdd9b('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x9f5d=['hasOwnProperty','hook','events','../../mysqldb','MailMessage','save','update','remove','emit'];(function(_0x24f743,_0x1df1e0){var _0x310b01=function(_0x18f69d){while(--_0x18f69d){_0x24f743['push'](_0x24f743['shift']());}};_0x310b01(++_0x1df1e0);}(_0x9f5d,0x1d6));var _0xd9f5=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x9f5d[_0x397cfb];return _0x15fed9;};'use strict';var EventEmitter=require(_0xd9f5('0x0'));var MailMessage=require(_0xd9f5('0x1'))['db'][_0xd9f5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9f5('0x3'),'afterUpdate':_0xd9f5('0x4'),'afterDestroy':_0xd9f5('0x5')};function emitEvent(_0x1e3a51){return function(_0x3dc9e2,_0x355d77,_0x1ac8ef){MailMessageEvents[_0xd9f5('0x6')](_0x1e3a51+':'+_0x3dc9e2['id'],_0x3dc9e2);MailMessageEvents['emit'](_0x1e3a51,_0x3dc9e2);_0x1ac8ef(null);};}for(var e in events){if(events[_0xd9f5('0x7')](e)){var event=events[e];MailMessage[_0xd9f5('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index aa08a1e..57ccaad 100644 --- a/server/api/mailMessage/mailMessage.model.js +++ b/server/api/mailMessage/mailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd304=['MailMessage','mail_messages','messageId','subject','FULLTEXT','body','plainBody','fromString','models','toLowerCase','direction','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','catch','error','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xd304,0x18b));var _0x4d30=function(_0x337524,_0x177af8){_0x337524=_0x337524-0x0;var _0x2ded96=_0xd304[_0x337524];return _0x2ded96;};'use strict';var _=require(_0x4d30('0x0'));var util=require(_0x4d30('0x1'));var logger=require(_0x4d30('0x2'))(_0x4d30('0x3'));var moment=require(_0x4d30('0x4'));var BPromise=require(_0x4d30('0x5'));var rp=require(_0x4d30('0x6'));var htmlToText=require(_0x4d30('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d30('0x8'));var config=require(_0x4d30('0x9'));var attributes=require(_0x4d30('0xa'));module[_0x4d30('0xb')]=function(_0x29fcf0,_0x31982c){return _0x29fcf0[_0x4d30('0xc')](_0x4d30('0xd'),attributes,{'tableName':_0x4d30('0xe'),'paranoid':![],'indexes':[{'name':_0x4d30('0xf'),'fields':[_0x4d30('0xf')]},{'name':'fti_mail_messages','fields':['plainBody',_0x4d30('0x10')],'type':_0x4d30('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x548d8d,_0x28a6e7,_0x145b53){if(_0x548d8d[_0x4d30('0x12')]){_0x548d8d[_0x4d30('0x13')]=htmlToText[_0x4d30('0x14')](_0x548d8d['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x145b53(null,_0x28a6e7);},'afterCreate':function(_0x443e63,_0x134135,_0x18a21e){var _0xa54e98=_0x29fcf0[_0x4d30('0x15')];var _0x4ca280=_0x443e63['get']({'plain':!![]});if(_0x4ca280['direction'][_0x4d30('0x16')]()==='in'||_0x4ca280[_0x4d30('0x17')]['toLowerCase']()==='out'&&!_0x4ca280[_0x4d30('0x18')]&&!_[_0x4d30('0x19')](_0x4ca280[_0x4d30('0x1a')])){_0xa54e98[_0x4d30('0x1b')][_0x4d30('0x1c')]({'where':{'id':_0x4ca280[_0x4d30('0x1d')]}})[_0x4d30('0x1e')](function(_0x3fc6e4){if(_0x3fc6e4){_0x3fc6e4[_0x4d30('0x1f')]({'lastMsgAt':_0x4ca280['createdAt'],'lastMsgDirection':_0x4ca280['direction']['toLowerCase']()});}})[_0x4d30('0x20')](function(_0x3bb53d){console[_0x4d30('0x21')](_0x3bb53d);});}_0x18a21e();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8ead=['then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','MailInteractionId'];(function(_0x2f7bcf,_0x189c1e){var _0x52d257=function(_0x1671c9){while(--_0x1671c9){_0x2f7bcf['push'](_0x2f7bcf['shift']());}};_0x52d257(++_0x189c1e);}(_0x8ead,0x19e));var _0xd8ea=function(_0x3d10b7,_0x128e5f){_0x3d10b7=_0x3d10b7-0x0;var _0x4ecafe=_0x8ead[_0x3d10b7];return _0x4ecafe;};'use strict';var _=require(_0xd8ea('0x0'));var util=require('util');var logger=require(_0xd8ea('0x1'))('api');var moment=require(_0xd8ea('0x2'));var BPromise=require(_0xd8ea('0x3'));var rp=require(_0xd8ea('0x4'));var htmlToText=require(_0xd8ea('0x5'));var fs=require('fs');var path=require(_0xd8ea('0x6'));var rimraf=require('rimraf');var config=require(_0xd8ea('0x7'));var attributes=require(_0xd8ea('0x8'));module[_0xd8ea('0x9')]=function(_0x331690,_0x4a30ff){return _0x331690[_0xd8ea('0xa')](_0xd8ea('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xd8ea('0xc'),'fields':[_0xd8ea('0xc')]},{'name':'fti_mail_messages','fields':[_0xd8ea('0xd'),_0xd8ea('0xe')],'type':_0xd8ea('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36143c,_0x5773bb,_0x2ea88a){if(_0x36143c[_0xd8ea('0x10')]){_0x36143c[_0xd8ea('0xd')]=htmlToText[_0xd8ea('0x11')](_0x36143c[_0xd8ea('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2ea88a(null,_0x5773bb);},'afterCreate':function(_0x36560b,_0x16c7f6,_0x51198b){var _0x42ddec=_0x331690[_0xd8ea('0x12')];var _0x4dc9a6=_0x36560b[_0xd8ea('0x13')]({'plain':!![]});if(_0x4dc9a6['direction'][_0xd8ea('0x14')]()==='in'||_0x4dc9a6[_0xd8ea('0x15')][_0xd8ea('0x14')]()===_0xd8ea('0x16')&&!_0x4dc9a6[_0xd8ea('0x17')]&&!_[_0xd8ea('0x18')](_0x4dc9a6[_0xd8ea('0x19')])){_0x42ddec['MailInteraction'][_0xd8ea('0x1a')]({'where':{'id':_0x4dc9a6[_0xd8ea('0x1b')]}})[_0xd8ea('0x1c')](function(_0xe8b7a7){if(_0xe8b7a7){_0xe8b7a7[_0xd8ea('0x1d')]({'lastMsgAt':_0x4dc9a6[_0xd8ea('0x1e')],'lastMsgDirection':_0x4dc9a6[_0xd8ea('0x15')][_0xd8ea('0x14')]()});}})[_0xd8ea('0x1f')](function(_0x57c0ce){console[_0xd8ea('0x20')](_0x57c0ce);});}_0x51198b();}},'charset':'utf8mb4','collate':_0xd8ea('0x21')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 284ad7c..cf11dd3 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e2e=['socket.io-emitter','./mailMessage.socket','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x246c35,_0x50c114){_0x246c35=_0x246c35-0x0;var _0x3b265f=_0x4e2e[_0x246c35];return _0x3b265f;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});config[_0xe4e2('0xb')]=_[_0xe4e2('0xc')](config[_0xe4e2('0xb')],{'host':_0xe4e2('0xd'),'port':0x18eb});var socket=require(_0xe4e2('0xe'))(new Redis(config[_0xe4e2('0xb')]));require(_0xe4e2('0xf'))['register'](socket);function respondWithRpcPromise(_0xd81011,_0x14fe0d,_0xa4df88){return new BPromise(function(_0x5b7889,_0x1954f8){return client[_0xe4e2('0x10')](_0xd81011,_0xa4df88)[_0xe4e2('0x11')](function(_0x107816){logger[_0xe4e2('0x12')]('MailMessage,\x20%s,\x20%s',_0x14fe0d,_0xe4e2('0x13'));logger[_0xe4e2('0x14')](_0xe4e2('0x15'),_0x14fe0d,_0xe4e2('0x13'),JSON['stringify'](_0x107816));if(_0x107816[_0xe4e2('0x16')]){if(_0x107816[_0xe4e2('0x16')][_0xe4e2('0x17')]===0x1f4){logger[_0xe4e2('0x16')](_0xe4e2('0x18'),_0x14fe0d,_0x107816['error']['message']);return _0x1954f8(_0x107816[_0xe4e2('0x16')][_0xe4e2('0x19')]);}logger[_0xe4e2('0x16')](_0xe4e2('0x18'),_0x14fe0d,_0x107816[_0xe4e2('0x16')]['message']);return _0x5b7889(_0x107816[_0xe4e2('0x16')][_0xe4e2('0x19')]);}else{logger[_0xe4e2('0x12')]('MailMessage,\x20%s,\x20%s',_0x14fe0d,_0xe4e2('0x13'));_0x5b7889(_0x107816['result'][_0xe4e2('0x19')]);}})[_0xe4e2('0x1a')](function(_0x7a47c3){logger[_0xe4e2('0x16')](_0xe4e2('0x18'),_0x14fe0d,_0x7a47c3);_0x1954f8(_0x7a47c3);});});}exports[_0xe4e2('0x1b')]=function(_0x339d00){var _0x3c4e90=this;return new Promise(function(_0x4769dd,_0x362741){return db['MailMessage'][_0xe4e2('0x1c')](_0x339d00[_0xe4e2('0x1d')],{'raw':_0x339d00[_0xe4e2('0x1e')]?_0x339d00[_0xe4e2('0x1e')][_0xe4e2('0x1f')]===undefined?!![]:![]:!![]})[_0xe4e2('0x11')](function(_0x16f14b){logger['info'](_0xe4e2('0x1b'),_0x339d00);logger[_0xe4e2('0x14')](_0xe4e2('0x1b'),_0x339d00,JSON['stringify'](_0x16f14b));_0x4769dd(_0x16f14b);})[_0xe4e2('0x1a')](function(_0x12ad33){logger['error'](_0xe4e2('0x1b'),_0x12ad33[_0xe4e2('0x19')],_0x339d00);_0x362741(_0x3c4e90[_0xe4e2('0x16')](0x1f4,_0x12ad33[_0xe4e2('0x19')]));});});}; \ No newline at end of file +var _0xda2d=['body','options','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0xda2d,0x102));var _0xdda2=function(_0x2d85cf,_0x3a492d){_0x2d85cf=_0x2d85cf-0x0;var _0x346589=_0xda2d[_0x2d85cf];return _0x346589;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});config[_0xdda2('0xa')]=_[_0xdda2('0xb')](config[_0xdda2('0xa')],{'host':_0xdda2('0xc'),'port':0x18eb});var socket=require(_0xdda2('0xd'))(new Redis(config['redis']));require(_0xdda2('0xe'))[_0xdda2('0xf')](socket);function respondWithRpcPromise(_0x4df6b8,_0x1c11b2,_0x2f3454){return new BPromise(function(_0x42d990,_0x346119){return client[_0xdda2('0x10')](_0x4df6b8,_0x2f3454)[_0xdda2('0x11')](function(_0x26fe81){logger[_0xdda2('0x12')]('MailMessage,\x20%s,\x20%s',_0x1c11b2,'request\x20sent');logger['debug'](_0xdda2('0x13'),_0x1c11b2,_0xdda2('0x14'),JSON[_0xdda2('0x15')](_0x26fe81));if(_0x26fe81[_0xdda2('0x16')]){if(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x17')]===0x1f4){logger[_0xdda2('0x16')]('MailMessage,\x20%s,\x20%s',_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x346119(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x18')]);}logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x42d990(_0x26fe81['error'][_0xdda2('0x18')]);}else{logger['info'](_0xdda2('0x19'),_0x1c11b2,_0xdda2('0x14'));_0x42d990(_0x26fe81[_0xdda2('0x1a')][_0xdda2('0x18')]);}})[_0xdda2('0x1b')](function(_0x17015f){logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x17015f);_0x346119(_0x17015f);});});}exports[_0xdda2('0x1c')]=function(_0x337b0b){var _0x312ef1=this;return new Promise(function(_0x6fdede,_0x4eed30){return db[_0xdda2('0x1d')]['create'](_0x337b0b[_0xdda2('0x1e')],{'raw':_0x337b0b[_0xdda2('0x1f')]?_0x337b0b[_0xdda2('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xdda2('0x11')](function(_0x5a9bb8){logger[_0xdda2('0x12')](_0xdda2('0x1c'),_0x337b0b);logger['debug'](_0xdda2('0x1c'),_0x337b0b,JSON[_0xdda2('0x15')](_0x5a9bb8));_0x6fdede(_0x5a9bb8);})[_0xdda2('0x1b')](function(_0x13b0f3){logger[_0xdda2('0x16')]('CreateMailMessage',_0x13b0f3[_0xdda2('0x18')],_0x337b0b);_0x4eed30(_0x312ef1[_0xdda2('0x16')](0x1f4,_0x13b0f3[_0xdda2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 11535f3..f811e8e 100644 --- a/server/api/mailMessage/mailMessage.socket.js +++ b/server/api/mailMessage/mailMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bae=['update','emit','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x9bae,0x7c));var _0xe9ba=function(_0x200a1d,_0x1f95e5){_0x200a1d=_0x200a1d-0x0;var _0x559b16=_0x9bae[_0x200a1d];return _0x559b16;};'use strict';var MailMessageEvents=require(_0xe9ba('0x0'));var events=[_0xe9ba('0x1'),'remove',_0xe9ba('0x2')];function createListener(_0x1e7ad3,_0x6dedb1){return function(_0x563439){_0x6dedb1[_0xe9ba('0x3')](_0x1e7ad3,_0x563439);};}function removeListener(_0x848937,_0x1ec855){return function(){MailMessageEvents['removeListener'](_0x848937,_0x1ec855);};}exports[_0xe9ba('0x4')]=function(_0xa2ea31){for(var _0x19bc82=0x0,_0x25030e=events[_0xe9ba('0x5')];_0x19bc82<_0x25030e;_0x19bc82++){var _0x44e60a=events[_0x19bc82];var _0x4b2e38=createListener(_0xe9ba('0x6')+_0x44e60a,_0xa2ea31);MailMessageEvents['on'](_0x44e60a,_0x4b2e38);}}; \ No newline at end of file +var _0xb0c5=['removeListener','register','length','mailMessage:','./mailMessage.events','emit'];(function(_0x211fb5,_0x52efb0){var _0x221845=function(_0x3a29a0){while(--_0x3a29a0){_0x211fb5['push'](_0x211fb5['shift']());}};_0x221845(++_0x52efb0);}(_0xb0c5,0xfa));var _0x5b0c=function(_0x3280a3,_0x5b7451){_0x3280a3=_0x3280a3-0x0;var _0x490ee1=_0xb0c5[_0x3280a3];return _0x490ee1;};'use strict';var MailMessageEvents=require(_0x5b0c('0x0'));var events=['save','remove','update'];function createListener(_0x40049f,_0x40b292){return function(_0x113902){_0x40b292[_0x5b0c('0x1')](_0x40049f,_0x113902);};}function removeListener(_0x1c4de1,_0x425015){return function(){MailMessageEvents[_0x5b0c('0x2')](_0x1c4de1,_0x425015);};}exports[_0x5b0c('0x3')]=function(_0x48ad35){for(var _0x4ea937=0x0,_0x5b84a2=events[_0x5b0c('0x4')];_0x4ea937<_0x5b84a2;_0x4ea937++){var _0x28ea40=events[_0x4ea937];var _0x5162f8=createListener(_0x5b0c('0x5')+_0x28ea40,_0x48ad35);MailMessageEvents['on'](_0x28ea40,_0x5162f8);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index bce6334..e470f84 100644 --- a/server/api/mailQueue/index.js +++ b/server/api/mailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac64=['delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','update'];(function(_0x1937a2,_0x1bbffd){var _0x3347c7=function(_0x2021c3){while(--_0x2021c3){_0x1937a2['push'](_0x1937a2['shift']());}};_0x3347c7(++_0x1bbffd);}(_0xac64,0x1a9));var _0x4ac6=function(_0x5ded61,_0x14a8f2){_0x5ded61=_0x5ded61-0x0;var _0x451aa7=_0xac64[_0x5ded61];return _0x451aa7;};'use strict';var multer=require(_0x4ac6('0x0'));var util=require(_0x4ac6('0x1'));var path=require(_0x4ac6('0x2'));var timeout=require(_0x4ac6('0x3'));var express=require(_0x4ac6('0x4'));var router=express[_0x4ac6('0x5')]();var fs_extra=require(_0x4ac6('0x6'));var auth=require(_0x4ac6('0x7'));var interaction=require(_0x4ac6('0x8'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x4ac6('0x9')]('/',auth[_0x4ac6('0xa')](),controller['index']);router['get'](_0x4ac6('0xb'),auth[_0x4ac6('0xa')](),controller[_0x4ac6('0xc')]);router[_0x4ac6('0x9')](_0x4ac6('0xd'),auth[_0x4ac6('0xa')](),controller[_0x4ac6('0xe')]);router[_0x4ac6('0x9')]('/:id/members',auth[_0x4ac6('0xa')](),controller[_0x4ac6('0xf')]);router[_0x4ac6('0x9')]('/:id/teams',auth[_0x4ac6('0xa')](),controller[_0x4ac6('0x10')]);router[_0x4ac6('0x9')](_0x4ac6('0x11'),auth[_0x4ac6('0xa')](),controller[_0x4ac6('0x12')]);router[_0x4ac6('0x13')]('/',auth[_0x4ac6('0xa')](),controller[_0x4ac6('0x14')]);router[_0x4ac6('0x13')](_0x4ac6('0x15'),auth[_0x4ac6('0xa')](),controller[_0x4ac6('0x16')]);router[_0x4ac6('0x13')](_0x4ac6('0x11'),auth[_0x4ac6('0xa')](),controller[_0x4ac6('0x17')]);router['put'](_0x4ac6('0xd'),auth[_0x4ac6('0xa')](),controller[_0x4ac6('0x18')]);router[_0x4ac6('0x19')](_0x4ac6('0xd'),auth[_0x4ac6('0xa')](),controller[_0x4ac6('0x1a')]);router[_0x4ac6('0x19')](_0x4ac6('0x15'),auth[_0x4ac6('0xa')](),controller[_0x4ac6('0x1b')]);router['delete']('/:id/users',auth[_0x4ac6('0xa')](),controller[_0x4ac6('0x1c')]);module[_0x4ac6('0x1d')]=router; \ No newline at end of file +var _0x2fae=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x2fae,0x191));var _0xe2fa=function(_0x3a8e52,_0x4554f9){_0x3a8e52=_0x3a8e52-0x0;var _0x3baea5=_0x2fae[_0x3a8e52];return _0x3baea5;};'use strict';var multer=require(_0xe2fa('0x0'));var util=require(_0xe2fa('0x1'));var path=require(_0xe2fa('0x2'));var timeout=require(_0xe2fa('0x3'));var express=require('express');var router=express[_0xe2fa('0x4')]();var fs_extra=require(_0xe2fa('0x5'));var auth=require(_0xe2fa('0x6'));var interaction=require(_0xe2fa('0x7'));var config=require(_0xe2fa('0x8'));var controller=require('./mailQueue.controller');router[_0xe2fa('0x9')]('/',auth[_0xe2fa('0xa')](),controller[_0xe2fa('0xb')]);router[_0xe2fa('0x9')](_0xe2fa('0xc'),auth['isAuthenticated'](),controller[_0xe2fa('0xd')]);router[_0xe2fa('0x9')](_0xe2fa('0xe'),auth[_0xe2fa('0xa')](),controller['show']);router[_0xe2fa('0x9')](_0xe2fa('0xf'),auth['isAuthenticated'](),controller[_0xe2fa('0x10')]);router[_0xe2fa('0x9')](_0xe2fa('0x11'),auth[_0xe2fa('0xa')](),controller[_0xe2fa('0x12')]);router[_0xe2fa('0x9')](_0xe2fa('0x13'),auth[_0xe2fa('0xa')](),controller[_0xe2fa('0x14')]);router[_0xe2fa('0x15')]('/',auth['isAuthenticated'](),controller[_0xe2fa('0x16')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0xe2fa('0x17')]);router[_0xe2fa('0x15')](_0xe2fa('0x13'),auth[_0xe2fa('0xa')](),controller[_0xe2fa('0x18')]);router[_0xe2fa('0x19')](_0xe2fa('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe2fa('0xe'),auth['isAuthenticated'](),controller[_0xe2fa('0x1a')]);router[_0xe2fa('0x1b')](_0xe2fa('0x11'),auth['isAuthenticated'](),controller[_0xe2fa('0x1c')]);router['delete'](_0xe2fa('0x13'),auth[_0xe2fa('0xa')](),controller[_0xe2fa('0x1d')]);module[_0xe2fa('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 08902a0..ba0072d 100644 --- a/server/api/mailQueue/mailQueue.attributes.js +++ b/server/api/mailQueue/mailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34ca=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0xfe80bd,_0x1babfa){var _0x182c8d=function(_0x5bb804){while(--_0x5bb804){_0xfe80bd['push'](_0xfe80bd['shift']());}};_0x182c8d(++_0x1babfa);}(_0x34ca,0x128));var _0xa34c=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x34ca[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0xa34c('0x0'));module[_0xa34c('0x1')]={'name':{'type':Sequelize[_0xa34c('0x2')],'unique':_0xa34c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa34c('0x2')]},'timeout':{'type':Sequelize[_0xa34c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa34c('0x5')](_0xa34c('0x6'),'beepall',_0xa34c('0x7'))}}; \ No newline at end of file +var _0xc51a=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x4cd3f6,_0x1aa7f3){var _0x59aca9=function(_0x98eca){while(--_0x98eca){_0x4cd3f6['push'](_0x4cd3f6['shift']());}};_0x59aca9(++_0x1aa7f3);}(_0xc51a,0x1a5));var _0xac51=function(_0x208eb2,_0x8026d8){_0x208eb2=_0x208eb2-0x0;var _0x5e620f=_0xc51a[_0x208eb2];return _0x5e620f;};'use strict';var Sequelize=require(_0xac51('0x0'));module[_0xac51('0x1')]={'name':{'type':Sequelize[_0xac51('0x2')],'unique':_0xac51('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xac51('0x2')]},'timeout':{'type':Sequelize[_0xac51('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xac51('0x5')](_0xac51('0x6'),_0xac51('0x7'),_0xac51('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 552c127..e26a95d 100644 --- a/server/api/mailQueue/mailQueue.controller.js +++ b/server/api/mailQueue/mailQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ba0=['stack','name','status','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','include','MailQueue','rows','catch','show','params','options','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','nolimit','MailQueueId','findAll','User','UserId','agent','createdAt','%s/%s','SIP','mailPause','updatedAt','Team','getTeams','ids','Agents','online','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','isEmpty','addAgents','omit','spread','removeAgents','userMailQueue:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','error'];(function(_0x34d275,_0x5d84ee){var _0x1379cc=function(_0x320fbe){while(--_0x320fbe){_0x34d275['push'](_0x34d275['shift']());}};_0x1379cc(++_0x5d84ee);}(_0x4ba0,0xe0));var _0x04ba=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x4ba0[_0x17406a];return _0x1501ff;};'use strict';var emlformat=require(_0x04ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04ba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x04ba('0x2'));var moment=require(_0x04ba('0x3'));var BPromise=require(_0x04ba('0x4'));var Mustache=require(_0x04ba('0x5'));var util=require('util');var path=require(_0x04ba('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x04ba('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04ba('0x8'));var squel=require(_0x04ba('0x9'));var crypto=require(_0x04ba('0xa'));var jsforce=require(_0x04ba('0xb'));var deskjs=require(_0x04ba('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x04ba('0xd'));var Redis=require('ioredis');var authService=require(_0x04ba('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x04ba('0xf'));var hardwareService=require(_0x04ba('0x10'));var logger=require('../../config/logger')(_0x04ba('0x11'));var utils=require(_0x04ba('0x12'));var config=require(_0x04ba('0x13'));var licenseUtil=require(_0x04ba('0x14'));var db=require(_0x04ba('0x15'))['db'];config[_0x04ba('0x16')]=_[_0x04ba('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04ba('0x16')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x398b0d,_0x329b5b){_0x329b5b=_0x329b5b||0xcc;return function(_0x5a681e){if(_0x5a681e){return _0x398b0d['sendStatus'](_0x329b5b);}return _0x398b0d['status'](_0x329b5b)[_0x04ba('0x18')]();};}function respondWithResult(_0x5040f1,_0x1b5eef){_0x1b5eef=_0x1b5eef||0xc8;return function(_0x7918a7){if(_0x7918a7){return _0x5040f1['status'](_0x1b5eef)['json'](_0x7918a7);}};}function respondWithFilteredResult(_0x4aa1e0,_0x4db0fc){return function(_0x33212a){if(_0x33212a){var _0x53c397=typeof _0x4db0fc['offset']===_0x04ba('0x19')&&typeof _0x4db0fc[_0x04ba('0x1a')]===_0x04ba('0x19');var _0x11ce15=_0x33212a[_0x04ba('0x1b')];var _0x3ea1a3=_0x53c397?0x0:_0x4db0fc[_0x04ba('0x1c')];var _0x4e4dee=_0x53c397?_0x33212a['count']:_0x4db0fc['offset']+_0x4db0fc['limit'];var _0x152589;if(_0x4e4dee>=_0x11ce15){_0x4e4dee=_0x11ce15;_0x152589=0xc8;}else{_0x152589=0xce;}_0x4aa1e0['status'](_0x152589);return _0x4aa1e0['set'](_0x04ba('0x1d'),_0x3ea1a3+'-'+_0x4e4dee+'/'+_0x11ce15)[_0x04ba('0x1e')](_0x33212a);}return null;};}function patchUpdates(_0x347a66){return function(_0x26584e){try{jsonpatch['apply'](_0x26584e,_0x347a66,!![]);}catch(_0x2ec67d){return BPromise[_0x04ba('0x1f')](_0x2ec67d);}return _0x26584e[_0x04ba('0x20')]();};}function saveUpdates(_0x374bdd,_0x3fd7ff){return function(_0x9790bd){if(_0x9790bd){return _0x9790bd[_0x04ba('0x21')](_0x374bdd)[_0x04ba('0x22')](function(_0x41c7e5){return _0x41c7e5;});}return null;};}function removeEntity(_0x2bed63,_0x2309e2){return function(_0x46d3c7){if(_0x46d3c7){return _0x46d3c7[_0x04ba('0x23')]()[_0x04ba('0x22')](function(){var _0x51eb34=_0x46d3c7['get']({'plain':!![]});var _0x4ef24a='MailQueues';return db[_0x04ba('0x24')]['destroy']({'where':{'type':_0x4ef24a,'resourceId':_0x51eb34['id']}})['then'](function(){return _0x46d3c7;});})['then'](function(){_0x2bed63['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51cdbd,_0x1cacd2){return function(_0x4d046d){if(!_0x4d046d){_0x51cdbd['sendStatus'](0x194);}return _0x4d046d;};}function handleError(_0x22dff6,_0x7a9212){_0x7a9212=_0x7a9212||0x1f4;return function(_0xb5363b){logger[_0x04ba('0x25')](_0xb5363b[_0x04ba('0x26')]);if(_0xb5363b[_0x04ba('0x27')]){delete _0xb5363b['name'];}_0x22dff6[_0x04ba('0x28')](_0x7a9212)[_0x04ba('0x29')](_0xb5363b);};}exports[_0x04ba('0x2a')]=function(_0x244a83,_0x208193){var _0x4b846d={},_0x47b835={},_0x5332bc={'count':0x0,'rows':[]};var _0x20c995=_[_0x04ba('0x2b')](db['MailQueue'][_0x04ba('0x2c')],function(_0x15a07e){return{'name':_0x15a07e[_0x04ba('0x2d')],'type':_0x15a07e['type'][_0x04ba('0x2e')]};});_0x47b835[_0x04ba('0x2f')]=_[_0x04ba('0x2b')](_0x20c995,_0x04ba('0x27'));_0x47b835[_0x04ba('0x30')]=_[_0x04ba('0x31')](_0x244a83['query']);_0x47b835[_0x04ba('0x32')]=_[_0x04ba('0x33')](_0x47b835[_0x04ba('0x2f')],_0x47b835['query']);_0x4b846d[_0x04ba('0x34')]=_['intersection'](_0x47b835[_0x04ba('0x2f')],qs[_0x04ba('0x35')](_0x244a83[_0x04ba('0x30')][_0x04ba('0x35')]));_0x4b846d[_0x04ba('0x34')]=_0x4b846d[_0x04ba('0x34')][_0x04ba('0x36')]?_0x4b846d[_0x04ba('0x34')]:_0x47b835[_0x04ba('0x2f')];if(!_0x244a83[_0x04ba('0x30')][_0x04ba('0x37')]('nolimit')){_0x4b846d['limit']=qs[_0x04ba('0x1a')](_0x244a83[_0x04ba('0x30')][_0x04ba('0x1a')]);_0x4b846d['offset']=qs[_0x04ba('0x1c')](_0x244a83[_0x04ba('0x30')]['offset']);}_0x4b846d[_0x04ba('0x38')]=qs[_0x04ba('0x39')](_0x244a83['query'][_0x04ba('0x39')]);_0x4b846d['where']=qs['filters'](_[_0x04ba('0x3a')](_0x244a83[_0x04ba('0x30')],_0x47b835[_0x04ba('0x32')]),_0x20c995);if(_0x244a83[_0x04ba('0x30')][_0x04ba('0x3b')]){_0x4b846d[_0x04ba('0x3c')]=_[_0x04ba('0x3d')](_0x4b846d[_0x04ba('0x3c')],{'$or':_[_0x04ba('0x2b')](_0x20c995,function(_0x2abf0c){if(_0x2abf0c[_0x04ba('0x3e')]!=='VIRTUAL'){var _0x62edc0={};_0x62edc0[_0x2abf0c['name']]={'$like':'%'+_0x244a83[_0x04ba('0x30')][_0x04ba('0x3b')]+'%'};return _0x62edc0;}})});}_0x4b846d=_['merge']({},_0x4b846d,_0x244a83['options']);var _0x333aec={'where':_0x4b846d['where']};return db['MailQueue'][_0x04ba('0x1b')](_0x333aec)[_0x04ba('0x22')](function(_0x5e6c9e){_0x5332bc['count']=_0x5e6c9e;if(_0x244a83[_0x04ba('0x30')]['includeAll']){_0x4b846d[_0x04ba('0x3f')]=[{'all':!![]}];}return db[_0x04ba('0x40')]['findAll'](_0x4b846d);})[_0x04ba('0x22')](function(_0x1ab46f){_0x5332bc[_0x04ba('0x41')]=_0x1ab46f;return _0x5332bc;})[_0x04ba('0x22')](respondWithFilteredResult(_0x208193,_0x4b846d))[_0x04ba('0x42')](handleError(_0x208193,null));};exports[_0x04ba('0x43')]=function(_0x286381,_0xf17f42){var _0x84b52f={'raw':!![],'where':{'id':_0x286381[_0x04ba('0x44')]['id']}},_0x3162fd={};_0x3162fd['model']=_[_0x04ba('0x31')](db[_0x04ba('0x40')]['rawAttributes']);_0x3162fd[_0x04ba('0x30')]=_['keys'](_0x286381['query']);_0x3162fd['filters']=_[_0x04ba('0x33')](_0x3162fd[_0x04ba('0x2f')],_0x3162fd[_0x04ba('0x30')]);_0x84b52f[_0x04ba('0x34')]=_[_0x04ba('0x33')](_0x3162fd[_0x04ba('0x2f')],qs[_0x04ba('0x35')](_0x286381[_0x04ba('0x30')][_0x04ba('0x35')]));_0x84b52f['attributes']=_0x84b52f['attributes']['length']?_0x84b52f[_0x04ba('0x34')]:_0x3162fd[_0x04ba('0x2f')];if(_0x286381[_0x04ba('0x30')]['includeAll']){_0x84b52f[_0x04ba('0x3f')]=[{'all':!![]}];}_0x84b52f=_[_0x04ba('0x3d')]({},_0x84b52f,_0x286381[_0x04ba('0x45')]);return db[_0x04ba('0x40')][_0x04ba('0x46')](_0x84b52f)[_0x04ba('0x22')](handleEntityNotFound(_0xf17f42,null))[_0x04ba('0x22')](respondWithResult(_0xf17f42,null))['catch'](handleError(_0xf17f42,null));};exports['create']=function(_0x24aae3,_0x25a1bf){return db[_0x04ba('0x40')]['create'](_0x24aae3[_0x04ba('0x47')],{})[_0x04ba('0x22')](function(_0x1e0241){var _0x3b64ec=_0x24aae3[_0x04ba('0x48')][_0x04ba('0x49')]({'plain':!![]});if(!_0x3b64ec)throw new Error(_0x04ba('0x4a'));if(_0x3b64ec[_0x04ba('0x4b')]===_0x04ba('0x48')){var _0x1eb70b=_0x1e0241[_0x04ba('0x49')]({'plain':!![]});var _0x30374e=_0x04ba('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x30374e,'userProfileId':_0x3b64ec[_0x04ba('0x4d')]},'raw':!![]})[_0x04ba('0x22')](function(_0x5d8bd7){if(_0x5d8bd7&&_0x5d8bd7[_0x04ba('0x4e')]===0x0){return db[_0x04ba('0x24')][_0x04ba('0x4f')]({'name':_0x1eb70b['name'],'resourceId':_0x1eb70b['id'],'type':_0x5d8bd7[_0x04ba('0x27')],'sectionId':_0x5d8bd7['id']},{})[_0x04ba('0x22')](function(){return _0x1e0241;});}else{return _0x1e0241;}})[_0x04ba('0x42')](function(_0x29a67f){logger[_0x04ba('0x25')](_0x04ba('0x50'),_0x29a67f);throw _0x29a67f;});}return _0x1e0241;})[_0x04ba('0x22')](respondWithResult(_0x25a1bf,0xc9))[_0x04ba('0x42')](handleError(_0x25a1bf,null));};exports[_0x04ba('0x21')]=function(_0xdafd61,_0x218b5b){if(_0xdafd61[_0x04ba('0x47')]['id']){delete _0xdafd61[_0x04ba('0x47')]['id'];}return db['MailQueue'][_0x04ba('0x46')]({'where':{'id':_0xdafd61[_0x04ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x218b5b,null))['then'](saveUpdates(_0xdafd61[_0x04ba('0x47')],null))[_0x04ba('0x22')](respondWithResult(_0x218b5b,null))[_0x04ba('0x42')](handleError(_0x218b5b,null));};exports[_0x04ba('0x23')]=function(_0x154630,_0x4808c5){return db['MailQueue'][_0x04ba('0x46')]({'where':{'id':_0x154630[_0x04ba('0x44')]['id']}})[_0x04ba('0x22')](handleEntityNotFound(_0x4808c5,null))[_0x04ba('0x22')](removeEntity(_0x4808c5,null))[_0x04ba('0x42')](handleError(_0x4808c5,null));};exports['describe']=function(_0x3ef062,_0x41c730){return db[_0x04ba('0x40')][_0x04ba('0x51')]()[_0x04ba('0x22')](respondWithResult(_0x41c730,null))[_0x04ba('0x42')](handleError(_0x41c730,null));};exports['getMembers']=function(_0x4c688b,_0x5f2446,_0xd82439){var _0x7f9e7b={'raw':!![],'where':{}},_0x142365={},_0x19c709;return db[_0x04ba('0x40')][_0x04ba('0x52')]({'where':{'id':_0x4c688b['params']['id']}})[_0x04ba('0x22')](handleEntityNotFound(_0x5f2446,null))[_0x04ba('0x22')](function(_0x124eaa){if(_0x124eaa){_0x19c709=_0x124eaa[_0x04ba('0x49')]({'plain':!![]});_0x142365[_0x04ba('0x2f')]=_['keys'](db[_0x04ba('0x53')]['rawAttributes']);_0x142365[_0x04ba('0x30')]=_['keys'](_0x4c688b[_0x04ba('0x30')]);_0x142365[_0x04ba('0x32')]=_['intersection'](_0x142365['model'],_0x142365[_0x04ba('0x30')]);_0x7f9e7b[_0x04ba('0x34')]=_['intersection'](_0x142365[_0x04ba('0x2f')],qs[_0x04ba('0x35')](_0x4c688b['query']['fields']));_0x7f9e7b[_0x04ba('0x34')]=_0x7f9e7b['attributes']['length']?_0x7f9e7b[_0x04ba('0x34')]:_0x142365['model'];if(!_0x4c688b[_0x04ba('0x30')][_0x04ba('0x37')](_0x04ba('0x54'))){_0x7f9e7b[_0x04ba('0x1a')]=qs['limit'](_0x4c688b[_0x04ba('0x30')][_0x04ba('0x1a')]);_0x7f9e7b[_0x04ba('0x1c')]=qs[_0x04ba('0x1c')](_0x4c688b[_0x04ba('0x30')]['offset']);}_0x7f9e7b['order']=qs['sort'](_0x4c688b['query'][_0x04ba('0x39')]);_0x7f9e7b['where']=qs['filters'](_[_0x04ba('0x3a')](_0x4c688b['query'],_0x142365[_0x04ba('0x32')]));_0x7f9e7b[_0x04ba('0x3c')][_0x04ba('0x55')]=_0x124eaa['id'];if(_0x4c688b[_0x04ba('0x30')][_0x04ba('0x3b')]){_0x7f9e7b[_0x04ba('0x3c')]=_['merge'](_0x7f9e7b[_0x04ba('0x3c')],{'$or':_[_0x04ba('0x2b')](_0x7f9e7b[_0x04ba('0x34')],function(_0x5c0505){var _0x65e9dc={};_0x65e9dc[_0x5c0505]={'$like':'%'+_0x4c688b[_0x04ba('0x30')][_0x04ba('0x3b')]+'%'};return _0x65e9dc;})});}_0x7f9e7b=_[_0x04ba('0x3d')]({},_0x7f9e7b,_0x4c688b[_0x04ba('0x45')]);return db[_0x04ba('0x53')][_0x04ba('0x56')](_0x7f9e7b);}})['then'](function(_0x12657c){if(_0x12657c){return db[_0x04ba('0x57')]['findAndCountAll']({'where':{'id':_[_0x04ba('0x2b')](_0x12657c,_0x04ba('0x58')),'role':_0x04ba('0x59')},'attributes':['id','name','mailPause','updatedAt',_0x04ba('0x5a')]});}})[_0x04ba('0x22')](function(_0x353961){if(_0x353961){return{'count':_0x353961['count'],'rows':_['map'](_0x353961[_0x04ba('0x41')],function(_0x4bc7b2){return{'membername':_0x4bc7b2[_0x04ba('0x27')],'UserId':_0x4bc7b2['id'],'queue_name':_0x19c709[_0x04ba('0x27')],'MailQueueId':_0x19c709['id'],'interface':util['format'](_0x04ba('0x5b'),_0x04ba('0x5c'),_0x4bc7b2['name']),'penalty':0x0,'paused':_0x4bc7b2[_0x04ba('0x5d')],'createdAt':_0x4bc7b2[_0x04ba('0x5a')],'updatedAt':_0x4bc7b2[_0x04ba('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x04ba('0x22')](respondWithFilteredResult(_0x5f2446,_0x7f9e7b))[_0x04ba('0x42')](handleError(_0x5f2446,null));};exports['getTeams']=function(_0x3d18f9,_0x43cf9c,_0x5d6c78){var _0x326105={};var _0x4b2c7f={};var _0x496f9d;var _0xed4169;return db['MailQueue'][_0x04ba('0x52')]({'where':{'id':_0x3d18f9['params']['id']}})[_0x04ba('0x22')](handleEntityNotFound(_0x43cf9c,null))[_0x04ba('0x22')](function(_0x27f71e){if(_0x27f71e){_0x496f9d=_0x27f71e;_0x4b2c7f[_0x04ba('0x2f')]=_['keys'](db[_0x04ba('0x5f')][_0x04ba('0x2c')]);_0x4b2c7f['query']=_[_0x04ba('0x31')](_0x3d18f9[_0x04ba('0x30')]);_0x4b2c7f[_0x04ba('0x32')]=_['intersection'](_0x4b2c7f[_0x04ba('0x2f')],_0x4b2c7f[_0x04ba('0x30')]);_0x326105[_0x04ba('0x34')]=_[_0x04ba('0x33')](_0x4b2c7f[_0x04ba('0x2f')],qs['fields'](_0x3d18f9[_0x04ba('0x30')][_0x04ba('0x35')]));_0x326105[_0x04ba('0x34')]=_0x326105[_0x04ba('0x34')][_0x04ba('0x36')]?_0x326105[_0x04ba('0x34')]:_0x4b2c7f[_0x04ba('0x2f')];_0x326105[_0x04ba('0x38')]=qs[_0x04ba('0x39')](_0x3d18f9[_0x04ba('0x30')][_0x04ba('0x39')]);_0x326105[_0x04ba('0x3c')]=qs[_0x04ba('0x32')](_[_0x04ba('0x3a')](_0x3d18f9[_0x04ba('0x30')],_0x4b2c7f[_0x04ba('0x32')]));if(_0x3d18f9[_0x04ba('0x30')]['filter']){_0x326105[_0x04ba('0x3c')]=_['merge'](_0x326105['where'],{'$or':_[_0x04ba('0x2b')](_0x326105['attributes'],function(_0x7f7de6){var _0x1ddf5c={};_0x1ddf5c[_0x7f7de6]={'$like':'%'+_0x3d18f9['query'][_0x04ba('0x3b')]+'%'};return _0x1ddf5c;})});}_0x326105=_['merge']({},_0x326105,_0x3d18f9[_0x04ba('0x45')]);return _0x496f9d[_0x04ba('0x60')](_0x326105);}})[_0x04ba('0x22')](function(_0x54f919){if(_0x54f919){_0xed4169=_0x54f919['length'];if(!_0x3d18f9[_0x04ba('0x30')][_0x04ba('0x37')](_0x04ba('0x54'))){_0x326105['limit']=qs[_0x04ba('0x1a')](_0x3d18f9[_0x04ba('0x30')]['limit']);_0x326105[_0x04ba('0x1c')]=qs[_0x04ba('0x1c')](_0x3d18f9[_0x04ba('0x30')][_0x04ba('0x1c')]);}return _0x496f9d[_0x04ba('0x60')](_0x326105);}})[_0x04ba('0x22')](function(_0x1a5563){if(_0x1a5563){return _0x1a5563?{'count':_0xed4169,'rows':_0x1a5563}:null;}})['then'](respondWithResult(_0x43cf9c,null))[_0x04ba('0x42')](handleError(_0x43cf9c,null));};exports['addTeams']=function(_0x33ea91,_0x5d3fee,_0x53fe68){var _0x192ef1=_0x33ea91[_0x04ba('0x47')][_0x04ba('0x61')];return db[_0x04ba('0x5f')][_0x04ba('0x56')]({'where':{'id':_0x192ef1},'attributes':['id'],'include':[{'model':db[_0x04ba('0x57')],'as':_0x04ba('0x62'),'attributes':['id','name',_0x04ba('0x63'),'voicePause',_0x04ba('0x64')],'raw':!![]}]})[_0x04ba('0x22')](function(_0x3d03ab){if(_0x3d03ab){var _0x171a55=_['flatMap'](_0x3d03ab,function(_0x3400e8){var _0x23cac8=_0x3400e8[_0x04ba('0x49')]({'plain':!![]});return _0x23cac8[_0x04ba('0x62')];});return db['MailQueue'][_0x04ba('0x46')]({'where':{'id':_0x33ea91[_0x04ba('0x44')]['id']}})['then'](function(_0x3a07c2){return db[_0x04ba('0x65')][_0x04ba('0x66')](function(_0x557f38){return _0x3a07c2[_0x04ba('0x67')](_0x192ef1,{'transaction':_0x557f38})['then'](function(){return BPromise[_0x04ba('0x68')](_0x171a55,function(_0x583953){return db[_0x04ba('0x53')][_0x04ba('0x69')]({'where':{'UserId':_0x583953['id'],'MailQueueId':_0x33ea91['params']['id']},'transaction':_0x557f38});});})[_0x04ba('0x22')](function(){_0x171a55[_0x04ba('0x6a')](function(_0x1ff6b4){socket[_0x04ba('0x6b')](_0x04ba('0x6c'),{'UserId':_0x1ff6b4['id'],'MailQueueId':_0x3a07c2['id']});});});});});}})[_0x04ba('0x22')](respondWithStatusCode(_0x5d3fee,null))['catch'](handleError(_0x5d3fee,null));};exports[_0x04ba('0x6d')]=function(_0x44ee84,_0x19e870,_0x3078b0){return db['Team'][_0x04ba('0x56')]({'where':{'id':_0x44ee84['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x04ba('0x57')],'as':_0x04ba('0x62'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x19e870,null))[_0x04ba('0x22')](function(_0x24b7c1){var _0x5e3498=_['map'](_0x24b7c1,'id');var _0x2dc0e1=[];var _0x34dd31=[];var _0x2e8af7=squel[_0x04ba('0x6e')]();_0x2e8af7['field']('tq.TeamId')['from'](_0x04ba('0x6f'),'tq')['join'](_0x04ba('0x70'),'ut',_0x04ba('0x71'))['where']('MailQueueId\x20=\x20?',_0x44ee84['params']['id']);for(var _0x44da39=0x0;_0x44da39<_0x24b7c1['length'];_0x44da39+=0x1){let _0xe1d46d=_0x24b7c1[_0x44da39];for(var _0x5ef966=0x0;_0x5ef966<_0xe1d46d[_0x04ba('0x62')][_0x04ba('0x36')];_0x5ef966+=0x1){let _0x44bab8=_0xe1d46d[_0x04ba('0x62')][_0x5ef966];var _0x26073e=_0x2e8af7['clone']();_0x26073e[_0x04ba('0x3c')](_0x04ba('0x72'),_0x44bab8['id']);_0x34dd31[_0x04ba('0x73')](db[_0x04ba('0x65')]['query'](_0x26073e[_0x04ba('0x74')](),{'type':db[_0x04ba('0x65')][_0x04ba('0x75')][_0x04ba('0x76')]})[_0x04ba('0x22')](function(_0x199c92){if(_0x199c92[_0x04ba('0x36')]===0x1){return _0x44bab8['id'];}else{var _0x89b19=_[_0x04ba('0x77')](_['map'](_0x199c92,_0x04ba('0x78')),function(_0x487037){return _[_0x04ba('0x79')](_0x5e3498,_0x487037);});if(_0x89b19){return _0x44bab8['id'];}}}));}}return BPromise[_0x04ba('0x7a')](_0x34dd31)['then'](function(_0x193e97){_0x2dc0e1=_(_0x2dc0e1)['union'](_0x193e97)[_0x04ba('0x7b')]()['value']();return db[_0x04ba('0x40')]['find']({'where':{'id':_0x44ee84['params']['id']}})[_0x04ba('0x22')](function(_0x49e3da){return db[_0x04ba('0x65')][_0x04ba('0x66')](function(_0x1cba85){return _0x49e3da[_0x04ba('0x6d')](_0x44ee84[_0x04ba('0x30')]['ids'],{'transaction':_0x1cba85})[_0x04ba('0x22')](function(){if(!_[_0x04ba('0x7c')](_0x2dc0e1)){return _0x49e3da['removeAgents'](_0x2dc0e1,{'transaction':_0x1cba85});}})[_0x04ba('0x22')](function(){_0x2dc0e1[_0x04ba('0x6a')](function(_0x23b1f4){socket[_0x04ba('0x6b')]('userMailQueue:remove',{'UserId':_0x23b1f4,'MailQueueId':_0x49e3da['id']});});});});});});})[_0x04ba('0x22')](respondWithStatusCode(_0x19e870,null))[_0x04ba('0x42')](handleError(_0x19e870,null));};exports['addAgents']=function(_0x31dbab,_0x50b856,_0x1ba338){return db[_0x04ba('0x40')][_0x04ba('0x46')]({'where':{'id':_0x31dbab[_0x04ba('0x44')]['id']}})[_0x04ba('0x22')](handleEntityNotFound(_0x50b856,null))['then'](function(_0x27e004){if(_0x27e004){return _0x27e004[_0x04ba('0x7d')](_0x31dbab[_0x04ba('0x47')][_0x04ba('0x61')],_[_0x04ba('0x7e')](_0x31dbab['body'],['ids','id'])||{})[_0x04ba('0x7f')](function(_0x4bbe2a){for(var _0xd0caad=0x0;_0xd0caad<_0x31dbab[_0x04ba('0x47')][_0x04ba('0x61')][_0x04ba('0x36')];_0xd0caad+=0x1){socket[_0x04ba('0x6b')]('userMailQueue:save',{'UserId':Number(_0x31dbab[_0x04ba('0x47')][_0x04ba('0x61')][_0xd0caad]),'MailQueueId':Number(_0x31dbab[_0x04ba('0x44')]['id'])});}return _0x4bbe2a;});}})[_0x04ba('0x22')](respondWithResult(_0x50b856,null))[_0x04ba('0x42')](handleError(_0x50b856,null));};exports[_0x04ba('0x80')]=function(_0x485a03,_0x31e87c,_0x3e1e1c){return db[_0x04ba('0x40')]['find']({'where':{'id':_0x485a03[_0x04ba('0x44')]['id']}})[_0x04ba('0x22')](handleEntityNotFound(_0x31e87c,null))[_0x04ba('0x22')](function(_0x3c5aaf){if(_0x3c5aaf){return _0x3c5aaf['removeAgents'](_0x485a03['query']['ids'])[_0x04ba('0x22')](function(){if(_['isArray'](_0x485a03[_0x04ba('0x30')][_0x04ba('0x61')])){for(var _0x1ac1b8=0x0;_0x1ac1b8<_0x485a03[_0x04ba('0x30')][_0x04ba('0x61')][_0x04ba('0x36')];_0x1ac1b8+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x485a03[_0x04ba('0x30')][_0x04ba('0x61')][_0x1ac1b8]),'MailQueueId':Number(_0x485a03['params']['id'])});}}else{socket[_0x04ba('0x6b')](_0x04ba('0x81'),{'UserId':Number(_0x485a03['query'][_0x04ba('0x61')]),'MailQueueId':Number(_0x485a03['params']['id'])});}});}})[_0x04ba('0x22')](respondWithStatusCode(_0x31e87c,null))[_0x04ba('0x42')](handleError(_0x31e87c,null));};exports[_0x04ba('0x82')]=function(_0x245cc5,_0x539f51,_0xfa4011){var _0x3d9f98={};var _0x32518e={};var _0x7e07fc;var _0x1a758a;return db[_0x04ba('0x40')][_0x04ba('0x52')]({'where':{'id':_0x245cc5[_0x04ba('0x44')]['id']}})[_0x04ba('0x22')](handleEntityNotFound(_0x539f51,null))[_0x04ba('0x22')](function(_0x54e73c){if(_0x54e73c){_0x7e07fc=_0x54e73c;_0x32518e[_0x04ba('0x2f')]=_[_0x04ba('0x31')](db[_0x04ba('0x57')]['rawAttributes']);_0x32518e[_0x04ba('0x30')]=_[_0x04ba('0x31')](_0x245cc5[_0x04ba('0x30')]);_0x32518e['filters']=_['intersection'](_0x32518e['model'],_0x32518e[_0x04ba('0x30')]);_0x3d9f98[_0x04ba('0x34')]=_[_0x04ba('0x33')](_0x32518e[_0x04ba('0x2f')],qs[_0x04ba('0x35')](_0x245cc5[_0x04ba('0x30')][_0x04ba('0x35')]));_0x3d9f98['attributes']=_0x3d9f98['attributes'][_0x04ba('0x36')]?_0x3d9f98[_0x04ba('0x34')]:_0x32518e['model'];_0x3d9f98[_0x04ba('0x38')]=qs['sort'](_0x245cc5[_0x04ba('0x30')]['sort']);_0x3d9f98[_0x04ba('0x3c')]=qs[_0x04ba('0x32')](_[_0x04ba('0x3a')](_0x245cc5[_0x04ba('0x30')],_0x32518e[_0x04ba('0x32')]));if(_0x245cc5[_0x04ba('0x30')]['filter']){_0x3d9f98['where']=_[_0x04ba('0x3d')](_0x3d9f98[_0x04ba('0x3c')],{'$or':_[_0x04ba('0x2b')](_0x3d9f98[_0x04ba('0x34')],function(_0xa71149){var _0x381ba1={};_0x381ba1[_0xa71149]={'$like':'%'+_0x245cc5[_0x04ba('0x30')][_0x04ba('0x3b')]+'%'};return _0x381ba1;})});}_0x3d9f98=_['merge']({},_0x3d9f98,_0x245cc5[_0x04ba('0x45')]);return _0x7e07fc[_0x04ba('0x82')](_0x3d9f98);}})['then'](function(_0x4baea8){if(_0x4baea8){_0x1a758a=_0x4baea8[_0x04ba('0x36')];if(!_0x245cc5[_0x04ba('0x30')][_0x04ba('0x37')](_0x04ba('0x54'))){_0x3d9f98[_0x04ba('0x1a')]=qs['limit'](_0x245cc5[_0x04ba('0x30')][_0x04ba('0x1a')]);_0x3d9f98[_0x04ba('0x1c')]=qs[_0x04ba('0x1c')](_0x245cc5[_0x04ba('0x30')][_0x04ba('0x1c')]);}return _0x7e07fc[_0x04ba('0x82')](_0x3d9f98);}})[_0x04ba('0x22')](function(_0x4583b9){if(_0x4583b9){return _0x4583b9?{'count':_0x1a758a,'rows':_0x4583b9}:null;}})['then'](respondWithResult(_0x539f51,null))[_0x04ba('0x42')](handleError(_0x539f51,null));}; \ No newline at end of file +var _0xb9f0=['updatedAt','createdAt','format','%s/%s','SIP','mailPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','emit','userMailQueue:save','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','compact','value','removeTeams','isEmpty','userMailQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','index','map','MailQueue','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','MailQueueId','options','UserMailQueue','User','UserId'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xb9f0,0x13f));var _0x0b9f=function(_0x1b6158,_0x1b7c2f){_0x1b6158=_0x1b6158-0x0;var _0x5c6338=_0xb9f0[_0x1b6158];return _0x5c6338;};'use strict';var emlformat=require(_0x0b9f('0x0'));var rimraf=require(_0x0b9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b9f('0x2'));var rp=require(_0x0b9f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0b9f('0x4'));var util=require(_0x0b9f('0x5'));var path=require(_0x0b9f('0x6'));var sox=require(_0x0b9f('0x7'));var csv=require(_0x0b9f('0x8'));var ejs=require(_0x0b9f('0x9'));var fs=require('fs');var fs_extra=require(_0x0b9f('0xa'));var _=require(_0x0b9f('0xb'));var squel=require(_0x0b9f('0xc'));var crypto=require('crypto');var jsforce=require(_0x0b9f('0xd'));var deskjs=require(_0x0b9f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0b9f('0xf'));var Papa=require(_0x0b9f('0x10'));var Redis=require(_0x0b9f('0x11'));var authService=require(_0x0b9f('0x12'));var qs=require(_0x0b9f('0x13'));var as=require(_0x0b9f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b9f('0x15'))(_0x0b9f('0x16'));var utils=require(_0x0b9f('0x17'));var config=require(_0x0b9f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b9f('0x19'))['db'];config[_0x0b9f('0x1a')]=_[_0x0b9f('0x1b')](config[_0x0b9f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b9f('0x1c'))(new Redis(config[_0x0b9f('0x1a')]));require(_0x0b9f('0x1d'))[_0x0b9f('0x1e')](socket);function respondWithStatusCode(_0x535d0f,_0x29175b){_0x29175b=_0x29175b||0xcc;return function(_0x2185c2){if(_0x2185c2){return _0x535d0f[_0x0b9f('0x1f')](_0x29175b);}return _0x535d0f[_0x0b9f('0x20')](_0x29175b)['end']();};}function respondWithResult(_0x56137d,_0x29a911){_0x29a911=_0x29a911||0xc8;return function(_0x237672){if(_0x237672){return _0x56137d[_0x0b9f('0x20')](_0x29a911)['json'](_0x237672);}};}function respondWithFilteredResult(_0x401e37,_0x559670){return function(_0x2cee44){if(_0x2cee44){var _0x2563bd=typeof _0x559670[_0x0b9f('0x21')]==='undefined'&&typeof _0x559670[_0x0b9f('0x22')]==='undefined';var _0x214076=_0x2cee44[_0x0b9f('0x23')];var _0x2bbfc0=_0x2563bd?0x0:_0x559670[_0x0b9f('0x21')];var _0x4fb7bc=_0x2563bd?_0x2cee44[_0x0b9f('0x23')]:_0x559670[_0x0b9f('0x21')]+_0x559670[_0x0b9f('0x22')];var _0x30f5cc;if(_0x4fb7bc>=_0x214076){_0x4fb7bc=_0x214076;_0x30f5cc=0xc8;}else{_0x30f5cc=0xce;}_0x401e37[_0x0b9f('0x20')](_0x30f5cc);return _0x401e37[_0x0b9f('0x24')](_0x0b9f('0x25'),_0x2bbfc0+'-'+_0x4fb7bc+'/'+_0x214076)[_0x0b9f('0x26')](_0x2cee44);}return null;};}function patchUpdates(_0x317be5){return function(_0x29bba9){try{jsonpatch[_0x0b9f('0x27')](_0x29bba9,_0x317be5,!![]);}catch(_0x5b4af6){return BPromise[_0x0b9f('0x28')](_0x5b4af6);}return _0x29bba9[_0x0b9f('0x29')]();};}function saveUpdates(_0x452b75,_0x3dba4a){return function(_0x33d922){if(_0x33d922){return _0x33d922[_0x0b9f('0x2a')](_0x452b75)[_0x0b9f('0x2b')](function(_0xa0bdb0){return _0xa0bdb0;});}return null;};}function removeEntity(_0x145a08,_0x15fd8c){return function(_0x531749){if(_0x531749){return _0x531749[_0x0b9f('0x2c')]()[_0x0b9f('0x2b')](function(){var _0x5822d2=_0x531749['get']({'plain':!![]});var _0x143f4e=_0x0b9f('0x2d');return db[_0x0b9f('0x2e')]['destroy']({'where':{'type':_0x143f4e,'resourceId':_0x5822d2['id']}})[_0x0b9f('0x2b')](function(){return _0x531749;});})['then'](function(){_0x145a08[_0x0b9f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31ae3d,_0x337663){return function(_0x14c138){if(!_0x14c138){_0x31ae3d[_0x0b9f('0x1f')](0x194);}return _0x14c138;};}function handleError(_0x2022ee,_0x593a12){_0x593a12=_0x593a12||0x1f4;return function(_0x16f0da){logger[_0x0b9f('0x2f')](_0x16f0da[_0x0b9f('0x30')]);if(_0x16f0da[_0x0b9f('0x31')]){delete _0x16f0da['name'];}_0x2022ee[_0x0b9f('0x20')](_0x593a12)['send'](_0x16f0da);};}exports[_0x0b9f('0x32')]=function(_0x2b8f53,_0x235062){var _0x52db62={},_0xde0edb={},_0x18805c={'count':0x0,'rows':[]};var _0x300633=_[_0x0b9f('0x33')](db[_0x0b9f('0x34')][_0x0b9f('0x35')],function(_0x223900){return{'name':_0x223900['fieldName'],'type':_0x223900['type']['key']};});_0xde0edb['model']=_[_0x0b9f('0x33')](_0x300633,'name');_0xde0edb[_0x0b9f('0x36')]=_[_0x0b9f('0x37')](_0x2b8f53[_0x0b9f('0x36')]);_0xde0edb[_0x0b9f('0x38')]=_[_0x0b9f('0x39')](_0xde0edb[_0x0b9f('0x3a')],_0xde0edb[_0x0b9f('0x36')]);_0x52db62[_0x0b9f('0x3b')]=_[_0x0b9f('0x39')](_0xde0edb[_0x0b9f('0x3a')],qs[_0x0b9f('0x3c')](_0x2b8f53[_0x0b9f('0x36')]['fields']));_0x52db62[_0x0b9f('0x3b')]=_0x52db62['attributes'][_0x0b9f('0x3d')]?_0x52db62[_0x0b9f('0x3b')]:_0xde0edb[_0x0b9f('0x3a')];if(!_0x2b8f53['query'][_0x0b9f('0x3e')]('nolimit')){_0x52db62[_0x0b9f('0x22')]=qs[_0x0b9f('0x22')](_0x2b8f53[_0x0b9f('0x36')][_0x0b9f('0x22')]);_0x52db62[_0x0b9f('0x21')]=qs[_0x0b9f('0x21')](_0x2b8f53[_0x0b9f('0x36')][_0x0b9f('0x21')]);}_0x52db62[_0x0b9f('0x3f')]=qs[_0x0b9f('0x40')](_0x2b8f53[_0x0b9f('0x36')][_0x0b9f('0x40')]);_0x52db62['where']=qs[_0x0b9f('0x38')](_[_0x0b9f('0x41')](_0x2b8f53[_0x0b9f('0x36')],_0xde0edb[_0x0b9f('0x38')]),_0x300633);if(_0x2b8f53['query'][_0x0b9f('0x42')]){_0x52db62['where']=_[_0x0b9f('0x43')](_0x52db62[_0x0b9f('0x44')],{'$or':_[_0x0b9f('0x33')](_0x300633,function(_0x4d5f6e){if(_0x4d5f6e['type']!==_0x0b9f('0x45')){var _0x34faa3={};_0x34faa3[_0x4d5f6e[_0x0b9f('0x31')]]={'$like':'%'+_0x2b8f53[_0x0b9f('0x36')]['filter']+'%'};return _0x34faa3;}})});}_0x52db62=_[_0x0b9f('0x43')]({},_0x52db62,_0x2b8f53['options']);var _0x573f6a={'where':_0x52db62[_0x0b9f('0x44')]};return db[_0x0b9f('0x34')]['count'](_0x573f6a)['then'](function(_0x4148ee){_0x18805c[_0x0b9f('0x23')]=_0x4148ee;if(_0x2b8f53[_0x0b9f('0x36')]['includeAll']){_0x52db62[_0x0b9f('0x46')]=[{'all':!![]}];}return db[_0x0b9f('0x34')][_0x0b9f('0x47')](_0x52db62);})[_0x0b9f('0x2b')](function(_0x699c34){_0x18805c[_0x0b9f('0x48')]=_0x699c34;return _0x18805c;})[_0x0b9f('0x2b')](respondWithFilteredResult(_0x235062,_0x52db62))[_0x0b9f('0x49')](handleError(_0x235062,null));};exports[_0x0b9f('0x4a')]=function(_0xbd6ca3,_0x167e9c){var _0x4f1087={'raw':!![],'where':{'id':_0xbd6ca3[_0x0b9f('0x4b')]['id']}},_0x206ff6={};_0x206ff6['model']=_[_0x0b9f('0x37')](db[_0x0b9f('0x34')][_0x0b9f('0x35')]);_0x206ff6['query']=_[_0x0b9f('0x37')](_0xbd6ca3[_0x0b9f('0x36')]);_0x206ff6['filters']=_['intersection'](_0x206ff6['model'],_0x206ff6[_0x0b9f('0x36')]);_0x4f1087[_0x0b9f('0x3b')]=_[_0x0b9f('0x39')](_0x206ff6[_0x0b9f('0x3a')],qs[_0x0b9f('0x3c')](_0xbd6ca3[_0x0b9f('0x36')][_0x0b9f('0x3c')]));_0x4f1087[_0x0b9f('0x3b')]=_0x4f1087[_0x0b9f('0x3b')]['length']?_0x4f1087[_0x0b9f('0x3b')]:_0x206ff6[_0x0b9f('0x3a')];if(_0xbd6ca3[_0x0b9f('0x36')][_0x0b9f('0x4c')]){_0x4f1087[_0x0b9f('0x46')]=[{'all':!![]}];}_0x4f1087=_[_0x0b9f('0x43')]({},_0x4f1087,_0xbd6ca3['options']);return db[_0x0b9f('0x34')][_0x0b9f('0x4d')](_0x4f1087)[_0x0b9f('0x2b')](handleEntityNotFound(_0x167e9c,null))[_0x0b9f('0x2b')](respondWithResult(_0x167e9c,null))[_0x0b9f('0x49')](handleError(_0x167e9c,null));};exports['create']=function(_0x258a75,_0x2a7b16){return db['MailQueue'][_0x0b9f('0x4e')](_0x258a75[_0x0b9f('0x4f')],{})['then'](function(_0x9d60e7){var _0x493889=_0x258a75[_0x0b9f('0x50')][_0x0b9f('0x51')]({'plain':!![]});if(!_0x493889)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x493889[_0x0b9f('0x52')]===_0x0b9f('0x50')){var _0x1e8826=_0x9d60e7[_0x0b9f('0x51')]({'plain':!![]});var _0x550b53='MailQueues';return db['UserProfileSection'][_0x0b9f('0x4d')]({'where':{'name':_0x550b53,'userProfileId':_0x493889[_0x0b9f('0x53')]},'raw':!![]})[_0x0b9f('0x2b')](function(_0x200abd){if(_0x200abd&&_0x200abd[_0x0b9f('0x54')]===0x0){return db[_0x0b9f('0x2e')][_0x0b9f('0x4e')]({'name':_0x1e8826[_0x0b9f('0x31')],'resourceId':_0x1e8826['id'],'type':_0x200abd[_0x0b9f('0x31')],'sectionId':_0x200abd['id']},{})['then'](function(){return _0x9d60e7;});}else{return _0x9d60e7;}})[_0x0b9f('0x49')](function(_0x1be8ed){logger['error'](_0x0b9f('0x55'),_0x1be8ed);throw _0x1be8ed;});}return _0x9d60e7;})[_0x0b9f('0x2b')](respondWithResult(_0x2a7b16,0xc9))[_0x0b9f('0x49')](handleError(_0x2a7b16,null));};exports['update']=function(_0x118f11,_0x18d894){if(_0x118f11[_0x0b9f('0x4f')]['id']){delete _0x118f11[_0x0b9f('0x4f')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x118f11[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x18d894,null))['then'](saveUpdates(_0x118f11[_0x0b9f('0x4f')],null))[_0x0b9f('0x2b')](respondWithResult(_0x18d894,null))[_0x0b9f('0x49')](handleError(_0x18d894,null));};exports[_0x0b9f('0x2c')]=function(_0xe99121,_0x4e5363){return db[_0x0b9f('0x34')][_0x0b9f('0x4d')]({'where':{'id':_0xe99121[_0x0b9f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e5363,null))[_0x0b9f('0x2b')](removeEntity(_0x4e5363,null))[_0x0b9f('0x49')](handleError(_0x4e5363,null));};exports[_0x0b9f('0x56')]=function(_0x5a08e6,_0x746947){return db[_0x0b9f('0x34')]['describe']()['then'](respondWithResult(_0x746947,null))['catch'](handleError(_0x746947,null));};exports[_0x0b9f('0x57')]=function(_0x39679e,_0x4107e7,_0x755f9){var _0x4cefa7={'raw':!![],'where':{}},_0x19cdce={},_0x17869e;return db[_0x0b9f('0x34')][_0x0b9f('0x58')]({'where':{'id':_0x39679e[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x4107e7,null))[_0x0b9f('0x2b')](function(_0x56dd7e){if(_0x56dd7e){_0x17869e=_0x56dd7e['get']({'plain':!![]});_0x19cdce[_0x0b9f('0x3a')]=_[_0x0b9f('0x37')](db['UserMailQueue'][_0x0b9f('0x35')]);_0x19cdce['query']=_['keys'](_0x39679e[_0x0b9f('0x36')]);_0x19cdce[_0x0b9f('0x38')]=_[_0x0b9f('0x39')](_0x19cdce[_0x0b9f('0x3a')],_0x19cdce['query']);_0x4cefa7['attributes']=_['intersection'](_0x19cdce[_0x0b9f('0x3a')],qs[_0x0b9f('0x3c')](_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x3c')]));_0x4cefa7[_0x0b9f('0x3b')]=_0x4cefa7[_0x0b9f('0x3b')][_0x0b9f('0x3d')]?_0x4cefa7[_0x0b9f('0x3b')]:_0x19cdce['model'];if(!_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x3e')](_0x0b9f('0x59'))){_0x4cefa7[_0x0b9f('0x22')]=qs['limit'](_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x22')]);_0x4cefa7[_0x0b9f('0x21')]=qs[_0x0b9f('0x21')](_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x21')]);}_0x4cefa7[_0x0b9f('0x3f')]=qs[_0x0b9f('0x40')](_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x40')]);_0x4cefa7[_0x0b9f('0x44')]=qs[_0x0b9f('0x38')](_[_0x0b9f('0x41')](_0x39679e[_0x0b9f('0x36')],_0x19cdce[_0x0b9f('0x38')]));_0x4cefa7[_0x0b9f('0x44')][_0x0b9f('0x5a')]=_0x56dd7e['id'];if(_0x39679e[_0x0b9f('0x36')]['filter']){_0x4cefa7['where']=_[_0x0b9f('0x43')](_0x4cefa7[_0x0b9f('0x44')],{'$or':_['map'](_0x4cefa7[_0x0b9f('0x3b')],function(_0x5800e3){var _0x36cc36={};_0x36cc36[_0x5800e3]={'$like':'%'+_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x42')]+'%'};return _0x36cc36;})});}_0x4cefa7=_[_0x0b9f('0x43')]({},_0x4cefa7,_0x39679e[_0x0b9f('0x5b')]);return db[_0x0b9f('0x5c')][_0x0b9f('0x47')](_0x4cefa7);}})[_0x0b9f('0x2b')](function(_0x1bac68){if(_0x1bac68){return db[_0x0b9f('0x5d')]['findAndCountAll']({'where':{'id':_[_0x0b9f('0x33')](_0x1bac68,_0x0b9f('0x5e')),'role':'agent'},'attributes':['id',_0x0b9f('0x31'),'mailPause',_0x0b9f('0x5f'),_0x0b9f('0x60')]});}})[_0x0b9f('0x2b')](function(_0x281111){if(_0x281111){return{'count':_0x281111[_0x0b9f('0x23')],'rows':_['map'](_0x281111[_0x0b9f('0x48')],function(_0x2fae47){return{'membername':_0x2fae47[_0x0b9f('0x31')],'UserId':_0x2fae47['id'],'queue_name':_0x17869e[_0x0b9f('0x31')],'MailQueueId':_0x17869e['id'],'interface':util[_0x0b9f('0x61')](_0x0b9f('0x62'),_0x0b9f('0x63'),_0x2fae47[_0x0b9f('0x31')]),'penalty':0x0,'paused':_0x2fae47[_0x0b9f('0x64')],'createdAt':_0x2fae47['createdAt'],'updatedAt':_0x2fae47[_0x0b9f('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0b9f('0x2b')](respondWithFilteredResult(_0x4107e7,_0x4cefa7))[_0x0b9f('0x49')](handleError(_0x4107e7,null));};exports[_0x0b9f('0x65')]=function(_0x3091a4,_0x352e40,_0x3cb920){var _0x30fd6a={};var _0x521627={};var _0x213ba9;var _0x28bdc6;return db['MailQueue']['findOne']({'where':{'id':_0x3091a4[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x352e40,null))[_0x0b9f('0x2b')](function(_0x413fbf){if(_0x413fbf){_0x213ba9=_0x413fbf;_0x521627[_0x0b9f('0x3a')]=_[_0x0b9f('0x37')](db[_0x0b9f('0x66')][_0x0b9f('0x35')]);_0x521627['query']=_[_0x0b9f('0x37')](_0x3091a4[_0x0b9f('0x36')]);_0x521627[_0x0b9f('0x38')]=_[_0x0b9f('0x39')](_0x521627[_0x0b9f('0x3a')],_0x521627[_0x0b9f('0x36')]);_0x30fd6a[_0x0b9f('0x3b')]=_[_0x0b9f('0x39')](_0x521627[_0x0b9f('0x3a')],qs[_0x0b9f('0x3c')](_0x3091a4[_0x0b9f('0x36')][_0x0b9f('0x3c')]));_0x30fd6a[_0x0b9f('0x3b')]=_0x30fd6a[_0x0b9f('0x3b')][_0x0b9f('0x3d')]?_0x30fd6a['attributes']:_0x521627[_0x0b9f('0x3a')];_0x30fd6a[_0x0b9f('0x3f')]=qs['sort'](_0x3091a4[_0x0b9f('0x36')][_0x0b9f('0x40')]);_0x30fd6a[_0x0b9f('0x44')]=qs[_0x0b9f('0x38')](_['pick'](_0x3091a4['query'],_0x521627[_0x0b9f('0x38')]));if(_0x3091a4[_0x0b9f('0x36')][_0x0b9f('0x42')]){_0x30fd6a[_0x0b9f('0x44')]=_[_0x0b9f('0x43')](_0x30fd6a[_0x0b9f('0x44')],{'$or':_[_0x0b9f('0x33')](_0x30fd6a[_0x0b9f('0x3b')],function(_0x4131a4){var _0x3da730={};_0x3da730[_0x4131a4]={'$like':'%'+_0x3091a4['query'][_0x0b9f('0x42')]+'%'};return _0x3da730;})});}_0x30fd6a=_[_0x0b9f('0x43')]({},_0x30fd6a,_0x3091a4[_0x0b9f('0x5b')]);return _0x213ba9[_0x0b9f('0x65')](_0x30fd6a);}})[_0x0b9f('0x2b')](function(_0xbf2056){if(_0xbf2056){_0x28bdc6=_0xbf2056[_0x0b9f('0x3d')];if(!_0x3091a4[_0x0b9f('0x36')][_0x0b9f('0x3e')](_0x0b9f('0x59'))){_0x30fd6a[_0x0b9f('0x22')]=qs[_0x0b9f('0x22')](_0x3091a4[_0x0b9f('0x36')][_0x0b9f('0x22')]);_0x30fd6a[_0x0b9f('0x21')]=qs[_0x0b9f('0x21')](_0x3091a4[_0x0b9f('0x36')]['offset']);}return _0x213ba9[_0x0b9f('0x65')](_0x30fd6a);}})[_0x0b9f('0x2b')](function(_0x5d7ee2){if(_0x5d7ee2){return _0x5d7ee2?{'count':_0x28bdc6,'rows':_0x5d7ee2}:null;}})[_0x0b9f('0x2b')](respondWithResult(_0x352e40,null))[_0x0b9f('0x49')](handleError(_0x352e40,null));};exports[_0x0b9f('0x67')]=function(_0x1e7f18,_0x437b36,_0xa85640){var _0x17afb6=_0x1e7f18[_0x0b9f('0x4f')][_0x0b9f('0x68')];return db['Team'][_0x0b9f('0x47')]({'where':{'id':_0x17afb6},'attributes':['id'],'include':[{'model':db[_0x0b9f('0x5d')],'as':_0x0b9f('0x69'),'attributes':['id',_0x0b9f('0x31'),_0x0b9f('0x6a'),_0x0b9f('0x6b'),_0x0b9f('0x6c')],'raw':!![]}]})[_0x0b9f('0x2b')](function(_0x12c3a7){if(_0x12c3a7){var _0x1bd3af=_[_0x0b9f('0x6d')](_0x12c3a7,function(_0x27f5d6){var _0x41a09f=_0x27f5d6['get']({'plain':!![]});return _0x41a09f[_0x0b9f('0x69')];});return db[_0x0b9f('0x34')][_0x0b9f('0x4d')]({'where':{'id':_0x1e7f18[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](function(_0x5a3b02){return db[_0x0b9f('0x6e')]['transaction'](function(_0x3c16e3){return _0x5a3b02[_0x0b9f('0x67')](_0x17afb6,{'transaction':_0x3c16e3})['then'](function(){return BPromise[_0x0b9f('0x6f')](_0x1bd3af,function(_0x358319){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x358319['id'],'MailQueueId':_0x1e7f18[_0x0b9f('0x4b')]['id']},'transaction':_0x3c16e3});});})['then'](function(){_0x1bd3af['forEach'](function(_0x351aeb){socket[_0x0b9f('0x70')](_0x0b9f('0x71'),{'UserId':_0x351aeb['id'],'MailQueueId':_0x5a3b02['id']});});});});});}})[_0x0b9f('0x2b')](respondWithStatusCode(_0x437b36,null))['catch'](handleError(_0x437b36,null));};exports['removeTeams']=function(_0x48cb05,_0x222b32,_0x2589a7){return db[_0x0b9f('0x66')][_0x0b9f('0x47')]({'where':{'id':_0x48cb05[_0x0b9f('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0b9f('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x222b32,null))[_0x0b9f('0x2b')](function(_0x434f9c){var _0x50513e=_[_0x0b9f('0x33')](_0x434f9c,'id');var _0x4355cd=[];var _0x3eed2f=[];var _0x4c2c60=squel[_0x0b9f('0x72')]();_0x4c2c60[_0x0b9f('0x73')](_0x0b9f('0x74'))['from']('team_has_mail_queues','tq')[_0x0b9f('0x75')]('user_has_teams','ut',_0x0b9f('0x76'))[_0x0b9f('0x44')](_0x0b9f('0x77'),_0x48cb05[_0x0b9f('0x4b')]['id']);for(var _0x103b25=0x0;_0x103b25<_0x434f9c[_0x0b9f('0x3d')];_0x103b25+=0x1){let _0x219d9c=_0x434f9c[_0x103b25];for(var _0x91c626=0x0;_0x91c626<_0x219d9c[_0x0b9f('0x69')]['length'];_0x91c626+=0x1){let _0x263f3b=_0x219d9c[_0x0b9f('0x69')][_0x91c626];var _0x4a5288=_0x4c2c60[_0x0b9f('0x78')]();_0x4a5288['where'](_0x0b9f('0x79'),_0x263f3b['id']);_0x3eed2f[_0x0b9f('0x7a')](db['sequelize'][_0x0b9f('0x36')](_0x4a5288[_0x0b9f('0x7b')](),{'type':db['sequelize'][_0x0b9f('0x7c')][_0x0b9f('0x7d')]})[_0x0b9f('0x2b')](function(_0x293e5c){if(_0x293e5c['length']===0x1){return _0x263f3b['id'];}else{var _0x374404=_['every'](_[_0x0b9f('0x33')](_0x293e5c,_0x0b9f('0x7e')),function(_0x304456){return _[_0x0b9f('0x7f')](_0x50513e,_0x304456);});if(_0x374404){return _0x263f3b['id'];}}}));}}return BPromise[_0x0b9f('0x80')](_0x3eed2f)[_0x0b9f('0x2b')](function(_0x7951b9){_0x4355cd=_(_0x4355cd)['union'](_0x7951b9)[_0x0b9f('0x81')]()[_0x0b9f('0x82')]();return db[_0x0b9f('0x34')][_0x0b9f('0x4d')]({'where':{'id':_0x48cb05[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](function(_0x3b9b67){return db[_0x0b9f('0x6e')]['transaction'](function(_0x28fb66){return _0x3b9b67[_0x0b9f('0x83')](_0x48cb05[_0x0b9f('0x36')][_0x0b9f('0x68')],{'transaction':_0x28fb66})[_0x0b9f('0x2b')](function(){if(!_[_0x0b9f('0x84')](_0x4355cd)){return _0x3b9b67['removeAgents'](_0x4355cd,{'transaction':_0x28fb66});}})[_0x0b9f('0x2b')](function(){_0x4355cd['forEach'](function(_0x3c3d9e){socket[_0x0b9f('0x70')](_0x0b9f('0x85'),{'UserId':_0x3c3d9e,'MailQueueId':_0x3b9b67['id']});});});});});});})['then'](respondWithStatusCode(_0x222b32,null))['catch'](handleError(_0x222b32,null));};exports['addAgents']=function(_0x2af6cb,_0x297c5b,_0x2566ad){return db['MailQueue']['find']({'where':{'id':_0x2af6cb[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x297c5b,null))[_0x0b9f('0x2b')](function(_0x184a0a){if(_0x184a0a){return _0x184a0a[_0x0b9f('0x86')](_0x2af6cb['body'][_0x0b9f('0x68')],_['omit'](_0x2af6cb[_0x0b9f('0x4f')],[_0x0b9f('0x68'),'id'])||{})['spread'](function(_0x14b3d9){for(var _0x47220a=0x0;_0x47220a<_0x2af6cb['body'][_0x0b9f('0x68')][_0x0b9f('0x3d')];_0x47220a+=0x1){socket[_0x0b9f('0x70')](_0x0b9f('0x71'),{'UserId':Number(_0x2af6cb[_0x0b9f('0x4f')][_0x0b9f('0x68')][_0x47220a]),'MailQueueId':Number(_0x2af6cb[_0x0b9f('0x4b')]['id'])});}return _0x14b3d9;});}})[_0x0b9f('0x2b')](respondWithResult(_0x297c5b,null))[_0x0b9f('0x49')](handleError(_0x297c5b,null));};exports['removeAgents']=function(_0x2ef1f3,_0x18157a,_0x19264c){return db[_0x0b9f('0x34')][_0x0b9f('0x4d')]({'where':{'id':_0x2ef1f3[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x18157a,null))[_0x0b9f('0x2b')](function(_0x2ebbdb){if(_0x2ebbdb){return _0x2ebbdb[_0x0b9f('0x87')](_0x2ef1f3['query']['ids'])[_0x0b9f('0x2b')](function(){if(_[_0x0b9f('0x88')](_0x2ef1f3[_0x0b9f('0x36')]['ids'])){for(var _0x2f155a=0x0;_0x2f155a<_0x2ef1f3[_0x0b9f('0x36')]['ids'][_0x0b9f('0x3d')];_0x2f155a+=0x1){socket[_0x0b9f('0x70')]('userMailQueue:remove',{'UserId':Number(_0x2ef1f3[_0x0b9f('0x36')][_0x0b9f('0x68')][_0x2f155a]),'MailQueueId':Number(_0x2ef1f3[_0x0b9f('0x4b')]['id'])});}}else{socket[_0x0b9f('0x70')]('userMailQueue:remove',{'UserId':Number(_0x2ef1f3[_0x0b9f('0x36')]['ids']),'MailQueueId':Number(_0x2ef1f3['params']['id'])});}});}})[_0x0b9f('0x2b')](respondWithStatusCode(_0x18157a,null))[_0x0b9f('0x49')](handleError(_0x18157a,null));};exports[_0x0b9f('0x89')]=function(_0x29974e,_0x367d1b,_0x42661d){var _0x1eef00={};var _0x1e7ca2={};var _0x206602;var _0x26a3d2;return db[_0x0b9f('0x34')][_0x0b9f('0x58')]({'where':{'id':_0x29974e[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x367d1b,null))['then'](function(_0x11b121){if(_0x11b121){_0x206602=_0x11b121;_0x1e7ca2[_0x0b9f('0x3a')]=_[_0x0b9f('0x37')](db[_0x0b9f('0x5d')]['rawAttributes']);_0x1e7ca2['query']=_[_0x0b9f('0x37')](_0x29974e[_0x0b9f('0x36')]);_0x1e7ca2[_0x0b9f('0x38')]=_['intersection'](_0x1e7ca2[_0x0b9f('0x3a')],_0x1e7ca2[_0x0b9f('0x36')]);_0x1eef00[_0x0b9f('0x3b')]=_[_0x0b9f('0x39')](_0x1e7ca2['model'],qs[_0x0b9f('0x3c')](_0x29974e[_0x0b9f('0x36')]['fields']));_0x1eef00['attributes']=_0x1eef00['attributes'][_0x0b9f('0x3d')]?_0x1eef00[_0x0b9f('0x3b')]:_0x1e7ca2[_0x0b9f('0x3a')];_0x1eef00[_0x0b9f('0x3f')]=qs['sort'](_0x29974e[_0x0b9f('0x36')][_0x0b9f('0x40')]);_0x1eef00[_0x0b9f('0x44')]=qs[_0x0b9f('0x38')](_[_0x0b9f('0x41')](_0x29974e['query'],_0x1e7ca2[_0x0b9f('0x38')]));if(_0x29974e[_0x0b9f('0x36')][_0x0b9f('0x42')]){_0x1eef00[_0x0b9f('0x44')]=_[_0x0b9f('0x43')](_0x1eef00[_0x0b9f('0x44')],{'$or':_[_0x0b9f('0x33')](_0x1eef00['attributes'],function(_0x45f2ae){var _0x569af9={};_0x569af9[_0x45f2ae]={'$like':'%'+_0x29974e[_0x0b9f('0x36')][_0x0b9f('0x42')]+'%'};return _0x569af9;})});}_0x1eef00=_[_0x0b9f('0x43')]({},_0x1eef00,_0x29974e['options']);return _0x206602[_0x0b9f('0x89')](_0x1eef00);}})[_0x0b9f('0x2b')](function(_0x2bb0d8){if(_0x2bb0d8){_0x26a3d2=_0x2bb0d8['length'];if(!_0x29974e['query']['hasOwnProperty'](_0x0b9f('0x59'))){_0x1eef00[_0x0b9f('0x22')]=qs[_0x0b9f('0x22')](_0x29974e[_0x0b9f('0x36')][_0x0b9f('0x22')]);_0x1eef00['offset']=qs[_0x0b9f('0x21')](_0x29974e['query']['offset']);}return _0x206602[_0x0b9f('0x89')](_0x1eef00);}})[_0x0b9f('0x2b')](function(_0x29fda8){if(_0x29fda8){return _0x29fda8?{'count':_0x26a3d2,'rows':_0x29fda8}:null;}})[_0x0b9f('0x2b')](respondWithResult(_0x367d1b,null))[_0x0b9f('0x49')](handleError(_0x367d1b,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 310e37d..0cb030a 100644 --- a/server/api/mailQueue/mailQueue.events.js +++ b/server/api/mailQueue/mailQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc84e=['MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x22d96a,_0xc41557){var _0x1a7a2b=function(_0x265893){while(--_0x265893){_0x22d96a['push'](_0x22d96a['shift']());}};_0x1a7a2b(++_0xc41557);}(_0xc84e,0x15e));var _0xec84=function(_0x2ed5a9,_0x105fc3){_0x2ed5a9=_0x2ed5a9-0x0;var _0x3869f6=_0xc84e[_0x2ed5a9];return _0x3869f6;};'use strict';var EventEmitter=require(_0xec84('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xec84('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xec84('0x2')](0x0);var events={'afterCreate':_0xec84('0x3'),'afterUpdate':_0xec84('0x4'),'afterDestroy':_0xec84('0x5')};function emitEvent(_0x50d1a0){return function(_0x5e6d9e,_0xab48e1,_0x564498){MailQueueEvents[_0xec84('0x6')](_0x50d1a0+':'+_0x5e6d9e['id'],_0x5e6d9e);MailQueueEvents[_0xec84('0x6')](_0x50d1a0,_0x5e6d9e);_0x564498(null);};}for(var e in events){if(events[_0xec84('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xec84('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x4b4a=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x2d7836,_0x5a5412){var _0x491179=function(_0xaafd3){while(--_0xaafd3){_0x2d7836['push'](_0x2d7836['shift']());}};_0x491179(++_0x5a5412);}(_0x4b4a,0xef));var _0xa4b4=function(_0x783834,_0x38c810){_0x783834=_0x783834-0x0;var _0x22055f=_0x4b4a[_0x783834];return _0x22055f;};'use strict';var EventEmitter=require(_0xa4b4('0x0'));var MailQueue=require(_0xa4b4('0x1'))['db'][_0xa4b4('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa4b4('0x3')](0x0);var events={'afterCreate':_0xa4b4('0x4'),'afterUpdate':_0xa4b4('0x5'),'afterDestroy':_0xa4b4('0x6')};function emitEvent(_0x5749be){return function(_0x592e86,_0x288137,_0x12dc5b){MailQueueEvents[_0xa4b4('0x7')](_0x5749be+':'+_0x592e86['id'],_0x592e86);MailQueueEvents[_0xa4b4('0x7')](_0x5749be,_0x592e86);_0x12dc5b(null);};}for(var e in events){if(events[_0xa4b4('0x8')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xa4b4('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 7aa6fb4..f74bf6d 100644 --- a/server/api/mailQueue/mailQueue.model.js +++ b/server/api/mailQueue/mailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8baf=['mail_queues','lodash','api','moment','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x8baf,0xfb));var _0xf8ba=function(_0x16f7ef,_0x3b786d){_0x16f7ef=_0x16f7ef-0x0;var _0x37218f=_0x8baf[_0x16f7ef];return _0x37218f;};'use strict';var _=require(_0xf8ba('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf8ba('0x1'));var moment=require(_0xf8ba('0x2'));var BPromise=require('bluebird');var rp=require(_0xf8ba('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8ba('0x4'));var config=require(_0xf8ba('0x5'));var attributes=require(_0xf8ba('0x6'));module[_0xf8ba('0x7')]=function(_0x4dbdd4,_0x2619ef){return _0x4dbdd4['define'](_0xf8ba('0x8'),attributes,{'tableName':_0xf8ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e7e=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2e84ac,_0x3b7a03){var _0x20153f=function(_0x1a78a3){while(--_0x1a78a3){_0x2e84ac['push'](_0x2e84ac['shift']());}};_0x20153f(++_0x3b7a03);}(_0x3e7e,0x125));var _0xe3e7=function(_0x7260da,_0x4566e1){_0x7260da=_0x7260da-0x0;var _0x3d2eaf=_0x3e7e[_0x7260da];return _0x3d2eaf;};'use strict';var _=require(_0xe3e7('0x0'));var util=require(_0xe3e7('0x1'));var logger=require(_0xe3e7('0x2'))(_0xe3e7('0x3'));var moment=require(_0xe3e7('0x4'));var BPromise=require(_0xe3e7('0x5'));var rp=require(_0xe3e7('0x6'));var fs=require('fs');var path=require(_0xe3e7('0x7'));var rimraf=require(_0xe3e7('0x8'));var config=require(_0xe3e7('0x9'));var attributes=require(_0xe3e7('0xa'));module[_0xe3e7('0xb')]=function(_0x491a97,_0x589e8e){return _0x491a97['define'](_0xe3e7('0xc'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 445202e..8bc3195 100644 --- a/server/api/mailQueue/mailQueue.rpc.js +++ b/server/api/mailQueue/mailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62f8=['localhost','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','include','map','model','stringify','ShowMailQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x62f8,0x13a));var _0x862f=function(_0xea79e7,_0x3d4b99){_0xea79e7=_0xea79e7-0x0;var _0x78930e=_0x62f8[_0xea79e7];return _0x78930e;};'use strict';var _=require('lodash');var util=require(_0x862f('0x0'));var moment=require(_0x862f('0x1'));var BPromise=require(_0x862f('0x2'));var rs=require(_0x862f('0x3'));var fs=require('fs');var Redis=require(_0x862f('0x4'));var db=require(_0x862f('0x5'))['db'];var utils=require(_0x862f('0x6'));var logger=require(_0x862f('0x7'))(_0x862f('0x8'));var config=require(_0x862f('0x9'));var jayson=require(_0x862f('0xa'));var client=jayson['client'][_0x862f('0xb')]({'port':0x232a});config[_0x862f('0xc')]=_[_0x862f('0xd')](config[_0x862f('0xc')],{'host':_0x862f('0xe'),'port':0x18eb});var socket=require(_0x862f('0xf'))(new Redis(config[_0x862f('0xc')]));require('./mailQueue.socket')[_0x862f('0x10')](socket);function respondWithRpcPromise(_0x44e9cd,_0x3e06f6,_0x414e6c){return new BPromise(function(_0x57511c,_0x135cfb){return client[_0x862f('0x11')](_0x44e9cd,_0x414e6c)[_0x862f('0x12')](function(_0x571d31){logger[_0x862f('0x13')](_0x862f('0x14'),_0x3e06f6,_0x862f('0x15'));logger[_0x862f('0x16')](_0x862f('0x17'),_0x3e06f6,_0x862f('0x15'),JSON['stringify'](_0x571d31));if(_0x571d31[_0x862f('0x18')]){if(_0x571d31[_0x862f('0x18')][_0x862f('0x19')]===0x1f4){logger[_0x862f('0x18')](_0x862f('0x14'),_0x3e06f6,_0x571d31[_0x862f('0x18')]['message']);return _0x135cfb(_0x571d31[_0x862f('0x18')][_0x862f('0x1a')]);}logger['error'](_0x862f('0x14'),_0x3e06f6,_0x571d31[_0x862f('0x18')]['message']);return _0x57511c(_0x571d31[_0x862f('0x18')][_0x862f('0x1a')]);}else{logger[_0x862f('0x13')](_0x862f('0x14'),_0x3e06f6,'request\x20sent');_0x57511c(_0x571d31[_0x862f('0x1b')][_0x862f('0x1a')]);}})[_0x862f('0x1c')](function(_0x3f02c7){logger[_0x862f('0x18')]('MailQueue,\x20%s,\x20%s',_0x3e06f6,_0x3f02c7);_0x135cfb(_0x3f02c7);});});}exports[_0x862f('0x1d')]=function(_0x548c47){var _0x39e8cc=this;return new Promise(function(_0xffa968,_0x1e453c){return db[_0x862f('0x1e')]['findAll']({'raw':_0x548c47[_0x862f('0x1f')]?_0x548c47[_0x862f('0x1f')][_0x862f('0x20')]===undefined?!![]:![]:!![],'where':_0x548c47[_0x862f('0x1f')]?_0x548c47['options'][_0x862f('0x21')]||null:null,'attributes':_0x548c47['options']?_0x548c47[_0x862f('0x1f')][_0x862f('0x22')]||null:null,'limit':_0x548c47['options']?_0x548c47[_0x862f('0x1f')]['limit']||null:null,'include':_0x548c47[_0x862f('0x1f')]?_0x548c47[_0x862f('0x1f')][_0x862f('0x23')]?_[_0x862f('0x24')](_0x548c47['options'][_0x862f('0x23')],function(_0x4dd606){return{'model':db[_0x4dd606['model']],'as':_0x4dd606['as'],'attributes':_0x4dd606['attributes'],'include':_0x4dd606[_0x862f('0x23')]?_[_0x862f('0x24')](_0x4dd606[_0x862f('0x23')],function(_0x524544){return{'model':db[_0x524544[_0x862f('0x25')]],'as':_0x524544['as'],'attributes':_0x524544[_0x862f('0x22')],'include':_0x524544['include']?_['map'](_0x524544[_0x862f('0x23')],function(_0x33c51f){return{'model':db[_0x33c51f['model']],'as':_0x33c51f['as'],'attributes':_0x33c51f[_0x862f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x862f('0x12')](function(_0x45a9ee){logger[_0x862f('0x13')](_0x862f('0x1d'),_0x548c47);logger[_0x862f('0x16')](_0x862f('0x1d'),_0x548c47,JSON[_0x862f('0x26')](_0x45a9ee));_0xffa968(_0x45a9ee);})[_0x862f('0x1c')](function(_0x441681){logger[_0x862f('0x18')](_0x862f('0x1d'),_0x441681[_0x862f('0x1a')],_0x548c47);_0x1e453c(_0x39e8cc[_0x862f('0x18')](0x1f4,_0x441681[_0x862f('0x1a')]));});});};exports[_0x862f('0x27')]=function(_0x21c21e){var _0x31e1c2=this;return new Promise(function(_0x9b156c,_0x59c6d3){return db[_0x862f('0x1e')][_0x862f('0x28')]({'raw':_0x21c21e[_0x862f('0x1f')]?_0x21c21e['options'][_0x862f('0x20')]===undefined?!![]:![]:!![],'where':_0x21c21e['options']?_0x21c21e['options']['where']||null:null,'attributes':_0x21c21e[_0x862f('0x1f')]?_0x21c21e['options'][_0x862f('0x22')]||null:null,'include':_0x21c21e[_0x862f('0x1f')]?_0x21c21e[_0x862f('0x1f')]['include']?_[_0x862f('0x24')](_0x21c21e['options'][_0x862f('0x23')],function(_0x592f36){return{'model':db[_0x592f36[_0x862f('0x25')]],'as':_0x592f36['as'],'attributes':_0x592f36['attributes'],'include':_0x592f36[_0x862f('0x23')]?_[_0x862f('0x24')](_0x592f36[_0x862f('0x23')],function(_0x3f0b80){return{'model':db[_0x3f0b80[_0x862f('0x25')]],'as':_0x3f0b80['as'],'attributes':_0x3f0b80['attributes'],'include':_0x3f0b80[_0x862f('0x23')]?_['map'](_0x3f0b80[_0x862f('0x23')],function(_0x2d89c7){return{'model':db[_0x2d89c7[_0x862f('0x25')]],'as':_0x2d89c7['as'],'attributes':_0x2d89c7[_0x862f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x862f('0x12')](function(_0xdf1677){logger[_0x862f('0x13')](_0x862f('0x27'),_0x21c21e);logger[_0x862f('0x16')](_0x862f('0x27'),_0x21c21e,JSON[_0x862f('0x26')](_0xdf1677));_0x9b156c(_0xdf1677);})[_0x862f('0x1c')](function(_0x5b19df){logger[_0x862f('0x18')](_0x862f('0x27'),_0x5b19df['message'],_0x21c21e);_0x59c6d3(_0x31e1c2[_0x862f('0x18')](0x1f4,_0x5b19df[_0x862f('0x1a')]));});});}; \ No newline at end of file +var _0x043d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailQueue.socket','register','request','then','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','model','map','info','debug','catch','ShowMailQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x043d,0x1ba));var _0xd043=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x043d[_0x4c2f30];return _0xb8854d;};'use strict';var _=require(_0xd043('0x0'));var util=require(_0xd043('0x1'));var moment=require(_0xd043('0x2'));var BPromise=require(_0xd043('0x3'));var rs=require(_0xd043('0x4'));var fs=require('fs');var Redis=require(_0xd043('0x5'));var db=require(_0xd043('0x6'))['db'];var utils=require(_0xd043('0x7'));var logger=require(_0xd043('0x8'))(_0xd043('0x9'));var config=require(_0xd043('0xa'));var jayson=require(_0xd043('0xb'));var client=jayson[_0xd043('0xc')][_0xd043('0xd')]({'port':0x232a});config['redis']=_[_0xd043('0xe')](config[_0xd043('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xd043('0x10'))(new Redis(config['redis']));require(_0xd043('0x11'))[_0xd043('0x12')](socket);function respondWithRpcPromise(_0x23540a,_0x57b902,_0x447851){return new BPromise(function(_0x1c6fe8,_0x43973e){return client[_0xd043('0x13')](_0x23540a,_0x447851)[_0xd043('0x14')](function(_0x3d15fa){logger['info']('MailQueue,\x20%s,\x20%s',_0x57b902,_0xd043('0x15'));logger['debug'](_0xd043('0x16'),_0x57b902,_0xd043('0x15'),JSON[_0xd043('0x17')](_0x3d15fa));if(_0x3d15fa[_0xd043('0x18')]){if(_0x3d15fa[_0xd043('0x18')][_0xd043('0x19')]===0x1f4){logger[_0xd043('0x18')](_0xd043('0x1a'),_0x57b902,_0x3d15fa[_0xd043('0x18')][_0xd043('0x1b')]);return _0x43973e(_0x3d15fa[_0xd043('0x18')][_0xd043('0x1b')]);}logger[_0xd043('0x18')](_0xd043('0x1a'),_0x57b902,_0x3d15fa[_0xd043('0x18')][_0xd043('0x1b')]);return _0x1c6fe8(_0x3d15fa[_0xd043('0x18')][_0xd043('0x1b')]);}else{logger['info'](_0xd043('0x1a'),_0x57b902,_0xd043('0x15'));_0x1c6fe8(_0x3d15fa[_0xd043('0x1c')][_0xd043('0x1b')]);}})['catch'](function(_0x24cb8e){logger[_0xd043('0x18')](_0xd043('0x1a'),_0x57b902,_0x24cb8e);_0x43973e(_0x24cb8e);});});}exports[_0xd043('0x1d')]=function(_0x57bcd1){var _0x24a37a=this;return new Promise(function(_0x2681b9,_0x2d7758){return db[_0xd043('0x1e')][_0xd043('0x1f')]({'raw':_0x57bcd1['options']?_0x57bcd1[_0xd043('0x20')][_0xd043('0x21')]===undefined?!![]:![]:!![],'where':_0x57bcd1[_0xd043('0x20')]?_0x57bcd1['options']['where']||null:null,'attributes':_0x57bcd1[_0xd043('0x20')]?_0x57bcd1[_0xd043('0x20')][_0xd043('0x22')]||null:null,'limit':_0x57bcd1[_0xd043('0x20')]?_0x57bcd1[_0xd043('0x20')][_0xd043('0x23')]||null:null,'include':_0x57bcd1[_0xd043('0x20')]?_0x57bcd1[_0xd043('0x20')][_0xd043('0x24')]?_['map'](_0x57bcd1[_0xd043('0x20')][_0xd043('0x24')],function(_0x5b7f50){return{'model':db[_0x5b7f50[_0xd043('0x25')]],'as':_0x5b7f50['as'],'attributes':_0x5b7f50[_0xd043('0x22')],'include':_0x5b7f50[_0xd043('0x24')]?_[_0xd043('0x26')](_0x5b7f50[_0xd043('0x24')],function(_0x5a004e){return{'model':db[_0x5a004e[_0xd043('0x25')]],'as':_0x5a004e['as'],'attributes':_0x5a004e[_0xd043('0x22')],'include':_0x5a004e['include']?_['map'](_0x5a004e['include'],function(_0x35cdfd){return{'model':db[_0x35cdfd[_0xd043('0x25')]],'as':_0x35cdfd['as'],'attributes':_0x35cdfd[_0xd043('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd043('0x14')](function(_0x583d5c){logger[_0xd043('0x27')](_0xd043('0x1d'),_0x57bcd1);logger[_0xd043('0x28')](_0xd043('0x1d'),_0x57bcd1,JSON[_0xd043('0x17')](_0x583d5c));_0x2681b9(_0x583d5c);})[_0xd043('0x29')](function(_0x4a6e7c){logger[_0xd043('0x18')](_0xd043('0x1d'),_0x4a6e7c[_0xd043('0x1b')],_0x57bcd1);_0x2d7758(_0x24a37a[_0xd043('0x18')](0x1f4,_0x4a6e7c['message']));});});};exports[_0xd043('0x2a')]=function(_0x566550){var _0x1f7bce=this;return new Promise(function(_0xb714a8,_0x3de8b1){return db['MailQueue'][_0xd043('0x2b')]({'raw':_0x566550[_0xd043('0x20')]?_0x566550['options'][_0xd043('0x21')]===undefined?!![]:![]:!![],'where':_0x566550[_0xd043('0x20')]?_0x566550[_0xd043('0x20')][_0xd043('0x2c')]||null:null,'attributes':_0x566550['options']?_0x566550[_0xd043('0x20')][_0xd043('0x22')]||null:null,'include':_0x566550[_0xd043('0x20')]?_0x566550[_0xd043('0x20')]['include']?_[_0xd043('0x26')](_0x566550[_0xd043('0x20')]['include'],function(_0x5ad3f3){return{'model':db[_0x5ad3f3[_0xd043('0x25')]],'as':_0x5ad3f3['as'],'attributes':_0x5ad3f3['attributes'],'include':_0x5ad3f3[_0xd043('0x24')]?_['map'](_0x5ad3f3[_0xd043('0x24')],function(_0x52a69d){return{'model':db[_0x52a69d[_0xd043('0x25')]],'as':_0x52a69d['as'],'attributes':_0x52a69d[_0xd043('0x22')],'include':_0x52a69d[_0xd043('0x24')]?_[_0xd043('0x26')](_0x52a69d[_0xd043('0x24')],function(_0x482397){return{'model':db[_0x482397[_0xd043('0x25')]],'as':_0x482397['as'],'attributes':_0x482397[_0xd043('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x413cb0){logger[_0xd043('0x27')](_0xd043('0x2a'),_0x566550);logger[_0xd043('0x28')](_0xd043('0x2a'),_0x566550,JSON[_0xd043('0x17')](_0x413cb0));_0xb714a8(_0x413cb0);})[_0xd043('0x29')](function(_0x259391){logger[_0xd043('0x18')](_0xd043('0x2a'),_0x259391[_0xd043('0x1b')],_0x566550);_0x3de8b1(_0x1f7bce[_0xd043('0x18')](0x1f4,_0x259391[_0xd043('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index c2e1f27..f403de1 100644 --- a/server/api/mailQueue/mailQueue.socket.js +++ b/server/api/mailQueue/mailQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9931=['mailQueue:','./mailQueue.events','save','remove','update','removeListener','register','length'];(function(_0x2f4069,_0x74eb6c){var _0x4e5d90=function(_0x56fedf){while(--_0x56fedf){_0x2f4069['push'](_0x2f4069['shift']());}};_0x4e5d90(++_0x74eb6c);}(_0x9931,0xb1));var _0x1993=function(_0xd6d15b,_0x13b8ea){_0xd6d15b=_0xd6d15b-0x0;var _0x59796b=_0x9931[_0xd6d15b];return _0x59796b;};'use strict';var MailQueueEvents=require(_0x1993('0x0'));var events=[_0x1993('0x1'),_0x1993('0x2'),_0x1993('0x3')];function createListener(_0x5b2bbf,_0x34aa94){return function(_0x12f68c){_0x34aa94['emit'](_0x5b2bbf,_0x12f68c);};}function removeListener(_0x49af9e,_0x425f94){return function(){MailQueueEvents[_0x1993('0x4')](_0x49af9e,_0x425f94);};}exports[_0x1993('0x5')]=function(_0x286006){for(var _0x5281c2=0x0,_0x1e1538=events[_0x1993('0x6')];_0x5281c2<_0x1e1538;_0x5281c2++){var _0x105f47=events[_0x5281c2];var _0x1fdd12=createListener(_0x1993('0x7')+_0x105f47,_0x286006);MailQueueEvents['on'](_0x105f47,_0x1fdd12);}}; \ No newline at end of file +var _0xc3d4=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3d4,0xd3));var _0x4c3d=function(_0x4976eb,_0x4b09d1){_0x4976eb=_0x4976eb-0x0;var _0x5dd7b2=_0xc3d4[_0x4976eb];return _0x5dd7b2;};'use strict';var MailQueueEvents=require(_0x4c3d('0x0'));var events=[_0x4c3d('0x1'),_0x4c3d('0x2'),_0x4c3d('0x3')];function createListener(_0x5b44ce,_0x20e0e6){return function(_0x2c63ee){_0x20e0e6[_0x4c3d('0x4')](_0x5b44ce,_0x2c63ee);};}function removeListener(_0x2d0e45,_0x57cc95){return function(){MailQueueEvents[_0x4c3d('0x5')](_0x2d0e45,_0x57cc95);};}exports[_0x4c3d('0x6')]=function(_0x3e42c5){for(var _0x2cd7c4=0x0,_0x403fef=events[_0x4c3d('0x7')];_0x2cd7c4<_0x403fef;_0x2cd7c4++){var _0x1f7686=events[_0x2cd7c4];var _0x4ed3e7=createListener(_0x4c3d('0x8')+_0x1f7686,_0x3e42c5);MailQueueEvents['on'](_0x1f7686,_0x4ed3e7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 9d9fd62..9505a3a 100644 --- a/server/api/mailQueueReport/index.js +++ b/server/api/mailQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe054=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe054,0x11c));var _0x4e05=function(_0x1cdcff,_0x4ddcdf){_0x1cdcff=_0x1cdcff-0x0;var _0x461573=_0xe054[_0x1cdcff];return _0x461573;};'use strict';var multer=require(_0x4e05('0x0'));var util=require('util');var path=require(_0x4e05('0x1'));var timeout=require(_0x4e05('0x2'));var express=require(_0x4e05('0x3'));var router=express['Router']();var fs_extra=require(_0x4e05('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4e05('0x5'));var config=require(_0x4e05('0x6'));var controller=require(_0x4e05('0x7'));router[_0x4e05('0x8')]('/',auth[_0x4e05('0x9')](),controller[_0x4e05('0xa')]);router[_0x4e05('0x8')]('/describe',auth[_0x4e05('0x9')](),controller['describe']);router[_0x4e05('0x8')](_0x4e05('0xb'),auth[_0x4e05('0x9')](),controller[_0x4e05('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4e05('0xd')]);router[_0x4e05('0xe')]('/:id',auth[_0x4e05('0x9')](),controller[_0x4e05('0xf')]);router[_0x4e05('0x10')]('/:id',auth[_0x4e05('0x9')](),controller[_0x4e05('0x11')]);module[_0x4e05('0x12')]=router; \ No newline at end of file +var _0x0e81=['../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x17492f,_0x42650d){var _0x504e00=function(_0x24c221){while(--_0x24c221){_0x17492f['push'](_0x17492f['shift']());}};_0x504e00(++_0x42650d);}(_0x0e81,0x1f2));var _0x10e8=function(_0xc1fac2,_0x725358){_0xc1fac2=_0xc1fac2-0x0;var _0x1a31f8=_0x0e81[_0xc1fac2];return _0x1a31f8;};'use strict';var multer=require(_0x10e8('0x0'));var util=require(_0x10e8('0x1'));var path=require(_0x10e8('0x2'));var timeout=require(_0x10e8('0x3'));var express=require(_0x10e8('0x4'));var router=express['Router']();var fs_extra=require(_0x10e8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x10e8('0x6'));var config=require(_0x10e8('0x7'));var controller=require(_0x10e8('0x8'));router[_0x10e8('0x9')]('/',auth[_0x10e8('0xa')](),controller[_0x10e8('0xb')]);router['get'](_0x10e8('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x10e8('0xd'),auth[_0x10e8('0xa')](),controller[_0x10e8('0xe')]);router['post']('/',auth[_0x10e8('0xa')](),controller['create']);router[_0x10e8('0xf')](_0x10e8('0xd'),auth[_0x10e8('0xa')](),controller[_0x10e8('0x10')]);router['delete'](_0x10e8('0xd'),auth[_0x10e8('0xa')](),controller[_0x10e8('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 21a100a..d2e5932 100644 --- a/server/api/mailQueueReport/mailQueueReport.attributes.js +++ b/server/api/mailQueueReport/mailQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6255=['sequelize','exports','STRING','DATE','moment'];(function(_0x41e088,_0x3bc5c4){var _0x1d6f8a=function(_0x26d96c){while(--_0x26d96c){_0x41e088['push'](_0x41e088['shift']());}};_0x1d6f8a(++_0x3bc5c4);}(_0x6255,0x1da));var _0x5625=function(_0x3e3f8b,_0x98ea26){_0x3e3f8b=_0x3e3f8b-0x0;var _0x354e47=_0x6255[_0x3e3f8b];return _0x354e47;};'use strict';var moment=require(_0x5625('0x0'));var Sequelize=require(_0x5625('0x1'));module[_0x5625('0x2')]={'uniqueid':{'type':Sequelize[_0x5625('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5625('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5625('0x4')]},'acceptAt':{'type':Sequelize[_0x5625('0x4')]},'exitAt':{'type':Sequelize[_0x5625('0x4')]},'reason':{'type':Sequelize[_0x5625('0x3')]}}; \ No newline at end of file +var _0xc130=['sequelize','exports','STRING','DATE','moment'];(function(_0x1fa237,_0x1f7bad){var _0x1694a8=function(_0xdacacc){while(--_0xdacacc){_0x1fa237['push'](_0x1fa237['shift']());}};_0x1694a8(++_0x1f7bad);}(_0xc130,0x7c));var _0x0c13=function(_0x4b8cff,_0x3465b1){_0x4b8cff=_0x4b8cff-0x0;var _0x5c0eb2=_0xc130[_0x4b8cff];return _0x5c0eb2;};'use strict';var moment=require(_0x0c13('0x0'));var Sequelize=require(_0x0c13('0x1'));module[_0x0c13('0x2')]={'uniqueid':{'type':Sequelize[_0x0c13('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0c13('0x3')]},'joinAt':{'type':Sequelize[_0x0c13('0x4')]},'leaveAt':{'type':Sequelize[_0x0c13('0x4')]},'acceptAt':{'type':Sequelize[_0x0c13('0x4')]},'exitAt':{'type':Sequelize[_0x0c13('0x4')]},'reason':{'type':Sequelize[_0x0c13('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index b8fc63b..1094c3b 100644 --- a/server/api/mailQueueReport/mailQueueReport.controller.js +++ b/server/api/mailQueueReport/mailQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e24=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','name','send','index','map','MailQueueReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','update','describe','eml-format'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x3e24,0x167));var _0x43e2=function(_0x3744c4,_0x4bdca9){_0x3744c4=_0x3744c4-0x0;var _0x167b7f=_0x3e24[_0x3744c4];return _0x167b7f;};'use strict';var emlformat=require(_0x43e2('0x0'));var rimraf=require(_0x43e2('0x1'));var zipdir=require(_0x43e2('0x2'));var jsonpatch=require(_0x43e2('0x3'));var rp=require(_0x43e2('0x4'));var moment=require('moment');var BPromise=require(_0x43e2('0x5'));var Mustache=require(_0x43e2('0x6'));var util=require('util');var path=require(_0x43e2('0x7'));var sox=require(_0x43e2('0x8'));var csv=require(_0x43e2('0x9'));var ejs=require(_0x43e2('0xa'));var fs=require('fs');var fs_extra=require(_0x43e2('0xb'));var _=require(_0x43e2('0xc'));var squel=require(_0x43e2('0xd'));var crypto=require('crypto');var jsforce=require(_0x43e2('0xe'));var deskjs=require(_0x43e2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x43e2('0x10'));var Papa=require(_0x43e2('0x11'));var Redis=require('ioredis');var authService=require(_0x43e2('0x12'));var qs=require(_0x43e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43e2('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x43e2('0x15'));var licenseUtil=require(_0x43e2('0x16'));var db=require(_0x43e2('0x17'))['db'];function respondWithStatusCode(_0x44781a,_0x43ba14){_0x43ba14=_0x43ba14||0xcc;return function(_0x68e82d){if(_0x68e82d){return _0x44781a[_0x43e2('0x18')](_0x43ba14);}return _0x44781a[_0x43e2('0x19')](_0x43ba14)[_0x43e2('0x1a')]();};}function respondWithResult(_0x218ae7,_0x377097){_0x377097=_0x377097||0xc8;return function(_0x3ccccd){if(_0x3ccccd){return _0x218ae7['status'](_0x377097)[_0x43e2('0x1b')](_0x3ccccd);}};}function respondWithFilteredResult(_0x40fb7b,_0xb929b5){return function(_0x2a0fb0){if(_0x2a0fb0){var _0x5cea01=typeof _0xb929b5['offset']===_0x43e2('0x1c')&&typeof _0xb929b5[_0x43e2('0x1d')]===_0x43e2('0x1c');var _0x3a27eb=_0x2a0fb0[_0x43e2('0x1e')];var _0x1b7cde=_0x5cea01?0x0:_0xb929b5[_0x43e2('0x1f')];var _0x15ecb5=_0x5cea01?_0x2a0fb0[_0x43e2('0x1e')]:_0xb929b5[_0x43e2('0x1f')]+_0xb929b5['limit'];var _0x3ee34c;if(_0x15ecb5>=_0x3a27eb){_0x15ecb5=_0x3a27eb;_0x3ee34c=0xc8;}else{_0x3ee34c=0xce;}_0x40fb7b[_0x43e2('0x19')](_0x3ee34c);return _0x40fb7b['set'](_0x43e2('0x20'),_0x1b7cde+'-'+_0x15ecb5+'/'+_0x3a27eb)['json'](_0x2a0fb0);}return null;};}function patchUpdates(_0x3bc2ce){return function(_0x13610f){try{jsonpatch[_0x43e2('0x21')](_0x13610f,_0x3bc2ce,!![]);}catch(_0x23825c){return BPromise[_0x43e2('0x22')](_0x23825c);}return _0x13610f['save']();};}function saveUpdates(_0x3b0357,_0x12d842){return function(_0x272934){if(_0x272934){return _0x272934['update'](_0x3b0357)[_0x43e2('0x23')](function(_0x32f048){return _0x32f048;});}return null;};}function removeEntity(_0x43078f,_0x11b285){return function(_0x4f20e6){if(_0x4f20e6){return _0x4f20e6[_0x43e2('0x24')]()[_0x43e2('0x23')](function(){_0x43078f[_0x43e2('0x19')](0xcc)[_0x43e2('0x1a')]();});}};}function handleEntityNotFound(_0x178223,_0x2a593e){return function(_0x3ca16b){if(!_0x3ca16b){_0x178223[_0x43e2('0x18')](0x194);}return _0x3ca16b;};}function handleError(_0xd29b7b,_0x1ec68e){_0x1ec68e=_0x1ec68e||0x1f4;return function(_0x1ea844){logger[_0x43e2('0x25')](_0x1ea844['stack']);if(_0x1ea844[_0x43e2('0x26')]){delete _0x1ea844[_0x43e2('0x26')];}_0xd29b7b['status'](_0x1ec68e)[_0x43e2('0x27')](_0x1ea844);};}exports[_0x43e2('0x28')]=function(_0x2dffa2,_0x404483){var _0x3fd232={},_0x5a896b={},_0x42f495={'count':0x0,'rows':[]};var _0xd1b43a=_[_0x43e2('0x29')](db[_0x43e2('0x2a')][_0x43e2('0x2b')],function(_0x30bdcb){return{'name':_0x30bdcb['fieldName'],'type':_0x30bdcb['type'][_0x43e2('0x2c')]};});_0x5a896b[_0x43e2('0x2d')]=_[_0x43e2('0x29')](_0xd1b43a,_0x43e2('0x26'));_0x5a896b[_0x43e2('0x2e')]=_['keys'](_0x2dffa2[_0x43e2('0x2e')]);_0x5a896b[_0x43e2('0x2f')]=_[_0x43e2('0x30')](_0x5a896b[_0x43e2('0x2d')],_0x5a896b[_0x43e2('0x2e')]);_0x3fd232[_0x43e2('0x31')]=_[_0x43e2('0x30')](_0x5a896b['model'],qs['fields'](_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x32')]));_0x3fd232['attributes']=_0x3fd232[_0x43e2('0x31')][_0x43e2('0x33')]?_0x3fd232['attributes']:_0x5a896b[_0x43e2('0x2d')];if(!_0x2dffa2['query']['hasOwnProperty']('nolimit')){_0x3fd232[_0x43e2('0x1d')]=qs['limit'](_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x1d')]);_0x3fd232[_0x43e2('0x1f')]=qs[_0x43e2('0x1f')](_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x1f')]);}_0x3fd232[_0x43e2('0x34')]=qs[_0x43e2('0x35')](_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x35')]);_0x3fd232[_0x43e2('0x36')]=qs[_0x43e2('0x2f')](_[_0x43e2('0x37')](_0x2dffa2[_0x43e2('0x2e')],_0x5a896b[_0x43e2('0x2f')]),_0xd1b43a);if(_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x38')]){_0x3fd232['where']=_['merge'](_0x3fd232['where'],{'$or':_[_0x43e2('0x29')](_0xd1b43a,function(_0x13af7f){if(_0x13af7f['type']!=='VIRTUAL'){var _0x2b5fce={};_0x2b5fce[_0x13af7f[_0x43e2('0x26')]]={'$like':'%'+_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x38')]+'%'};return _0x2b5fce;}})});}_0x3fd232=_[_0x43e2('0x39')]({},_0x3fd232,_0x2dffa2[_0x43e2('0x3a')]);var _0x2afcdd={'where':_0x3fd232[_0x43e2('0x36')]};return db[_0x43e2('0x2a')][_0x43e2('0x1e')](_0x2afcdd)[_0x43e2('0x23')](function(_0x257de9){_0x42f495[_0x43e2('0x1e')]=_0x257de9;if(_0x2dffa2[_0x43e2('0x2e')]['includeAll']){_0x3fd232[_0x43e2('0x3b')]=[{'all':!![]}];}return db['MailQueueReport'][_0x43e2('0x3c')](_0x3fd232);})['then'](function(_0x19ce1b){_0x42f495[_0x43e2('0x3d')]=_0x19ce1b;return _0x42f495;})[_0x43e2('0x23')](respondWithFilteredResult(_0x404483,_0x3fd232))['catch'](handleError(_0x404483,null));};exports[_0x43e2('0x3e')]=function(_0x5ca5d0,_0x1ba4cf){var _0x36f94a={'raw':!![],'where':{'id':_0x5ca5d0[_0x43e2('0x3f')]['id']}},_0x34f2b5={};_0x34f2b5['model']=_['keys'](db[_0x43e2('0x2a')][_0x43e2('0x2b')]);_0x34f2b5[_0x43e2('0x2e')]=_[_0x43e2('0x40')](_0x5ca5d0['query']);_0x34f2b5[_0x43e2('0x2f')]=_[_0x43e2('0x30')](_0x34f2b5[_0x43e2('0x2d')],_0x34f2b5[_0x43e2('0x2e')]);_0x36f94a[_0x43e2('0x31')]=_['intersection'](_0x34f2b5[_0x43e2('0x2d')],qs['fields'](_0x5ca5d0[_0x43e2('0x2e')][_0x43e2('0x32')]));_0x36f94a['attributes']=_0x36f94a[_0x43e2('0x31')]['length']?_0x36f94a['attributes']:_0x34f2b5[_0x43e2('0x2d')];if(_0x5ca5d0[_0x43e2('0x2e')][_0x43e2('0x41')]){_0x36f94a[_0x43e2('0x3b')]=[{'all':!![]}];}_0x36f94a=_[_0x43e2('0x39')]({},_0x36f94a,_0x5ca5d0['options']);return db[_0x43e2('0x2a')][_0x43e2('0x42')](_0x36f94a)[_0x43e2('0x23')](handleEntityNotFound(_0x1ba4cf,null))[_0x43e2('0x23')](respondWithResult(_0x1ba4cf,null))[_0x43e2('0x43')](handleError(_0x1ba4cf,null));};exports[_0x43e2('0x44')]=function(_0x29a9ef,_0x2462db){return db['MailQueueReport'][_0x43e2('0x44')](_0x29a9ef[_0x43e2('0x45')],{})['then'](respondWithResult(_0x2462db,0xc9))[_0x43e2('0x43')](handleError(_0x2462db,null));};exports[_0x43e2('0x46')]=function(_0x466f65,_0x8bc721){if(_0x466f65['body']['id']){delete _0x466f65[_0x43e2('0x45')]['id'];}return db[_0x43e2('0x2a')][_0x43e2('0x42')]({'where':{'id':_0x466f65[_0x43e2('0x3f')]['id']}})[_0x43e2('0x23')](handleEntityNotFound(_0x8bc721,null))['then'](saveUpdates(_0x466f65['body'],null))[_0x43e2('0x23')](respondWithResult(_0x8bc721,null))[_0x43e2('0x43')](handleError(_0x8bc721,null));};exports['destroy']=function(_0x2a40a5,_0x28a101){return db[_0x43e2('0x2a')]['find']({'where':{'id':_0x2a40a5['params']['id']}})[_0x43e2('0x23')](handleEntityNotFound(_0x28a101,null))[_0x43e2('0x23')](removeEntity(_0x28a101,null))[_0x43e2('0x43')](handleError(_0x28a101,null));};exports[_0x43e2('0x47')]=function(_0x1a9283,_0x278730){return db[_0x43e2('0x2a')][_0x43e2('0x47')]()[_0x43e2('0x23')](respondWithResult(_0x278730,null))['catch'](handleError(_0x278730,null));}; \ No newline at end of file +var _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','MailQueueReport','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x896e,0x1e9));var _0xe896=function(_0x2db139,_0x5bdc11){_0x2db139=_0x2db139-0x0;var _0x4f415e=_0x896e[_0x2db139];return _0x4f415e;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['MailQueueReport'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':!![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['MailQueueReport'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 1d8b6bb..79e9fa7 100644 --- a/server/api/mailQueueReport/mailQueueReport.model.js +++ b/server/api/mailQueueReport/mailQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8bb=['rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','path'];(function(_0x44a1a9,_0x14d200){var _0x5b8bc1=function(_0x4e2142){while(--_0x4e2142){_0x44a1a9['push'](_0x44a1a9['shift']());}};_0x5b8bc1(++_0x14d200);}(_0xe8bb,0xfe));var _0xbe8b=function(_0x246195,_0x555987){_0x246195=_0x246195-0x0;var _0x20f1d5=_0xe8bb[_0x246195];return _0x20f1d5;};'use strict';var _=require(_0xbe8b('0x0'));var util=require(_0xbe8b('0x1'));var logger=require(_0xbe8b('0x2'))(_0xbe8b('0x3'));var moment=require(_0xbe8b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe8b('0x5'));var rimraf=require(_0xbe8b('0x6'));var config=require(_0xbe8b('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0xbe8b('0x8')]=function(_0x1aec40,_0x583fe3){return _0x1aec40[_0xbe8b('0x9')](_0xbe8b('0xa'),attributes,{'tableName':_0xbe8b('0xb'),'paranoid':![],'indexes':[{'name':_0xbe8b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x06cf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0xc375fe,_0x2a52bf){var _0x1b3f0a=function(_0x87380){while(--_0x87380){_0xc375fe['push'](_0xc375fe['shift']());}};_0x1b3f0a(++_0x2a52bf);}(_0x06cf,0xce));var _0xf06c=function(_0x37a1b8,_0xa6ce9){_0x37a1b8=_0x37a1b8-0x0;var _0x275aa8=_0x06cf[_0x37a1b8];return _0x275aa8;};'use strict';var _=require(_0xf06c('0x0'));var util=require(_0xf06c('0x1'));var logger=require(_0xf06c('0x2'))(_0xf06c('0x3'));var moment=require(_0xf06c('0x4'));var BPromise=require(_0xf06c('0x5'));var rp=require(_0xf06c('0x6'));var fs=require('fs');var path=require(_0xf06c('0x7'));var rimraf=require(_0xf06c('0x8'));var config=require(_0xf06c('0x9'));var attributes=require('./mailQueueReport.attributes');module[_0xf06c('0xa')]=function(_0x4ccdc6,_0x43ac80){return _0x4ccdc6[_0xf06c('0xb')](_0xf06c('0xc'),attributes,{'tableName':_0xf06c('0xd'),'paranoid':![],'indexes':[{'name':_0xf06c('0xe'),'fields':[_0xf06c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index f7669c4..8dfb5a5 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x13fa53,_0x4dc021){var _0x43daf2=function(_0x2f6930){while(--_0x2f6930){_0x13fa53['push'](_0x13fa53['shift']());}};_0x43daf2(++_0x4dc021);}(_0x1261,0x144));var _0x1126=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x1261[_0x7ad123];return _0x37d073;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x9c80f0,_0x59cc94){var _0x3baef5=function(_0x4ea254){while(--_0x4ea254){_0x9c80f0['push'](_0x9c80f0['shift']());}};_0x3baef5(++_0x59cc94);}(_0xadb5,0xad));var _0x5adb=function(_0xc9c04e,_0x202685){_0xc9c04e=_0xc9c04e-0x0;var _0x47aae4=_0xadb5[_0xc9c04e];return _0x47aae4;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 559c4f7..b8c0ff8 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x244706,_0x225097){var _0x286e3e=function(_0x3f06b5){while(--_0x3f06b5){_0x244706['push'](_0x244706['shift']());}};_0x286e3e(++_0x225097);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1fbe9e,_0x4bffbe){var _0x1b7bc7=function(_0x5347ce){while(--_0x5347ce){_0x1fbe9e['push'](_0x1fbe9e['shift']());}};_0x1b7bc7(++_0x4bffbe);}(_0xe706,0xa3));var _0x6e70=function(_0x3154a3,_0x45d16d){_0x3154a3=_0x3154a3-0x0;var _0x553af5=_0xe706[_0x3154a3];return _0x553af5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index d3256ce..03ec8d9 100644 --- a/server/api/mailServerIn/mailServerIn.attributes.js +++ b/server/api/mailServerIn/mailServerIn.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd54a=['exports','STRING','INTEGER','BOOLEAN','INBOX','sequelize'];(function(_0x3517f1,_0x41b82b){var _0x1a1f8d=function(_0x2612bc){while(--_0x2612bc){_0x3517f1['push'](_0x3517f1['shift']());}};_0x1a1f8d(++_0x41b82b);}(_0xd54a,0xbf));var _0xad54=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd54a[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xad54('0x0'));module[_0xad54('0x1')]={'description':{'type':Sequelize[_0xad54('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xad54('0x2')]},'password':{'type':Sequelize[_0xad54('0x2')]},'port':{'type':Sequelize[_0xad54('0x3')]},'tls':{'type':Sequelize[_0xad54('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xad54('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xad54('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xad54('0x2')]},'modernAuthentication':{'type':Sequelize[_0xad54('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xf9e9=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0xf9e9,0xe7));var _0x9f9e=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xf9e9[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0x9f9e('0x0'));module[_0x9f9e('0x1')]={'description':{'type':Sequelize[_0x9f9e('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9f9e('0x2')]},'port':{'type':Sequelize[_0x9f9e('0x3')]},'tls':{'type':Sequelize[_0x9f9e('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x9f9e('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9f9e('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x9f9e('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 1b5de8f..1dc660b 100644 --- a/server/api/mailServerIn/mailServerIn.model.js +++ b/server/api/mailServerIn/mailServerIn.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf852=['api','moment','bluebird','request-promise','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger'];(function(_0x5da70e,_0x191f69){var _0x440784=function(_0x4b7970){while(--_0x4b7970){_0x5da70e['push'](_0x5da70e['shift']());}};_0x440784(++_0x191f69);}(_0xf852,0x196));var _0x2f85=function(_0x1b7259,_0x49b4d6){_0x1b7259=_0x1b7259-0x0;var _0x44800c=_0xf852[_0x1b7259];return _0x44800c;};'use strict';var _=require(_0x2f85('0x0'));var util=require('util');var logger=require(_0x2f85('0x1'))(_0x2f85('0x2'));var moment=require(_0x2f85('0x3'));var BPromise=require(_0x2f85('0x4'));var rp=require(_0x2f85('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f85('0x6'));var config=require('../../config/environment');var attributes=require(_0x2f85('0x7'));module[_0x2f85('0x8')]=function(_0x1e5d1e,_0x183e9d){return _0x1e5d1e[_0x2f85('0x9')](_0x2f85('0xa'),attributes,{'tableName':_0x2f85('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb025=['moment','bluebird','request-promise','path','../../config/environment','exports','mail_servers_in','lodash','util','../../config/logger'];(function(_0x734df,_0x179dc8){var _0xc93759=function(_0xb11b9e){while(--_0xb11b9e){_0x734df['push'](_0x734df['shift']());}};_0xc93759(++_0x179dc8);}(_0xb025,0x7f));var _0x5b02=function(_0x18f729,_0x55e088){_0x18f729=_0x18f729-0x0;var _0x2f71e4=_0xb025[_0x18f729];return _0x2f71e4;};'use strict';var _=require(_0x5b02('0x0'));var util=require(_0x5b02('0x1'));var logger=require(_0x5b02('0x2'))('api');var moment=require(_0x5b02('0x3'));var BPromise=require(_0x5b02('0x4'));var rp=require(_0x5b02('0x5'));var fs=require('fs');var path=require(_0x5b02('0x6'));var rimraf=require('rimraf');var config=require(_0x5b02('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x5b02('0x8')]=function(_0x80597b,_0x1a6e0e){return _0x80597b['define']('MailServerIn',attributes,{'tableName':_0x5b02('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 9596aad..ae17e9a 100644 --- a/server/api/mailServerIn/mailServerIn.rpc.js +++ b/server/api/mailServerIn/mailServerIn.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd31=['raw','where','attributes','limit','include','map','model','GetMailServerIn','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailServerIn','findAll','options'];(function(_0x50d637,_0xf8c443){var _0x5b57dc=function(_0x5bf141){while(--_0x5bf141){_0x50d637['push'](_0x50d637['shift']());}};_0x5b57dc(++_0xf8c443);}(_0xcd31,0x15d));var _0x1cd3=function(_0x1a891d,_0x21ca61){_0x1a891d=_0x1a891d-0x0;var _0x52d263=_0xcd31[_0x1a891d];return _0x52d263;};'use strict';var _=require('lodash');var util=require(_0x1cd3('0x0'));var moment=require(_0x1cd3('0x1'));var BPromise=require(_0x1cd3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cd3('0x3'));var db=require(_0x1cd3('0x4'))['db'];var utils=require(_0x1cd3('0x5'));var logger=require(_0x1cd3('0x6'))(_0x1cd3('0x7'));var config=require(_0x1cd3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1cd3('0x9')][_0x1cd3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xedb6d1,_0x49d849,_0x45cc24){return new BPromise(function(_0x11b139,_0x124659){return client['request'](_0xedb6d1,_0x45cc24)[_0x1cd3('0xb')](function(_0x3953d3){logger[_0x1cd3('0xc')](_0x1cd3('0xd'),_0x49d849,_0x1cd3('0xe'));logger[_0x1cd3('0xf')](_0x1cd3('0x10'),_0x49d849,'request\x20sent',JSON[_0x1cd3('0x11')](_0x3953d3));if(_0x3953d3[_0x1cd3('0x12')]){if(_0x3953d3[_0x1cd3('0x12')][_0x1cd3('0x13')]===0x1f4){logger['error'](_0x1cd3('0xd'),_0x49d849,_0x3953d3['error'][_0x1cd3('0x14')]);return _0x124659(_0x3953d3[_0x1cd3('0x12')][_0x1cd3('0x14')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x49d849,_0x3953d3[_0x1cd3('0x12')][_0x1cd3('0x14')]);return _0x11b139(_0x3953d3[_0x1cd3('0x12')]['message']);}else{logger[_0x1cd3('0xc')](_0x1cd3('0xd'),_0x49d849,_0x1cd3('0xe'));_0x11b139(_0x3953d3[_0x1cd3('0x15')]['message']);}})['catch'](function(_0x5531c5){logger['error']('MailServerIn,\x20%s,\x20%s',_0x49d849,_0x5531c5);_0x124659(_0x5531c5);});});}exports['GetMailServerIn']=function(_0x14c491){var _0x40a85e=this;return new Promise(function(_0xf82a46,_0xc3f461){return db[_0x1cd3('0x16')][_0x1cd3('0x17')]({'raw':_0x14c491[_0x1cd3('0x18')]?_0x14c491[_0x1cd3('0x18')][_0x1cd3('0x19')]===undefined?!![]:![]:!![],'where':_0x14c491[_0x1cd3('0x18')]?_0x14c491['options'][_0x1cd3('0x1a')]||null:null,'attributes':_0x14c491[_0x1cd3('0x18')]?_0x14c491['options'][_0x1cd3('0x1b')]||null:null,'limit':_0x14c491[_0x1cd3('0x18')]?_0x14c491['options'][_0x1cd3('0x1c')]||null:null,'include':_0x14c491[_0x1cd3('0x18')]?_0x14c491[_0x1cd3('0x18')][_0x1cd3('0x1d')]?_['map'](_0x14c491['options'][_0x1cd3('0x1d')],function(_0x1a6dad){return{'model':db[_0x1a6dad['model']],'as':_0x1a6dad['as'],'attributes':_0x1a6dad['attributes'],'include':_0x1a6dad[_0x1cd3('0x1d')]?_[_0x1cd3('0x1e')](_0x1a6dad['include'],function(_0x55aa9c){return{'model':db[_0x55aa9c[_0x1cd3('0x1f')]],'as':_0x55aa9c['as'],'attributes':_0x55aa9c[_0x1cd3('0x1b')],'include':_0x55aa9c['include']?_['map'](_0x55aa9c[_0x1cd3('0x1d')],function(_0xc311a9){return{'model':db[_0xc311a9[_0x1cd3('0x1f')]],'as':_0xc311a9['as'],'attributes':_0xc311a9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x334ce2){logger['info'](_0x1cd3('0x20'),_0x14c491);logger[_0x1cd3('0xf')](_0x1cd3('0x20'),_0x14c491,JSON['stringify'](_0x334ce2));_0xf82a46(_0x334ce2);})[_0x1cd3('0x21')](function(_0x53979a){logger[_0x1cd3('0x12')](_0x1cd3('0x20'),_0x53979a[_0x1cd3('0x14')],_0x14c491);_0xc3f461(_0x40a85e['error'](0x1f4,_0x53979a[_0x1cd3('0x14')]));});});}; \ No newline at end of file +var _0x6652=['raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options'];(function(_0x56e70d,_0x3c3504){var _0x41a615=function(_0x5db9cd){while(--_0x5db9cd){_0x56e70d['push'](_0x56e70d['shift']());}};_0x41a615(++_0x3c3504);}(_0x6652,0xf3));var _0x2665=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6652[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x2665('0x0'));var util=require(_0x2665('0x1'));var moment=require(_0x2665('0x2'));var BPromise=require(_0x2665('0x3'));var rs=require(_0x2665('0x4'));var fs=require('fs');var Redis=require(_0x2665('0x5'));var db=require(_0x2665('0x6'))['db'];var utils=require(_0x2665('0x7'));var logger=require(_0x2665('0x8'))('rpc');var config=require(_0x2665('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2665('0xa')][_0x2665('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb5be6,_0x20a2c5,_0xf51be5){return new BPromise(function(_0x540a5c,_0x5bc4d9){return client[_0x2665('0xc')](_0xb5be6,_0xf51be5)[_0x2665('0xd')](function(_0x3164e0){logger[_0x2665('0xe')](_0x2665('0xf'),_0x20a2c5,_0x2665('0x10'));logger[_0x2665('0x11')](_0x2665('0x12'),_0x20a2c5,_0x2665('0x10'),JSON[_0x2665('0x13')](_0x3164e0));if(_0x3164e0[_0x2665('0x14')]){if(_0x3164e0[_0x2665('0x14')][_0x2665('0x15')]===0x1f4){logger[_0x2665('0x14')](_0x2665('0xf'),_0x20a2c5,_0x3164e0[_0x2665('0x14')][_0x2665('0x16')]);return _0x5bc4d9(_0x3164e0[_0x2665('0x14')][_0x2665('0x16')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x20a2c5,_0x3164e0[_0x2665('0x14')]['message']);return _0x540a5c(_0x3164e0[_0x2665('0x14')]['message']);}else{logger[_0x2665('0xe')]('MailServerIn,\x20%s,\x20%s',_0x20a2c5,'request\x20sent');_0x540a5c(_0x3164e0[_0x2665('0x17')][_0x2665('0x16')]);}})[_0x2665('0x18')](function(_0x42db54){logger[_0x2665('0x14')](_0x2665('0xf'),_0x20a2c5,_0x42db54);_0x5bc4d9(_0x42db54);});});}exports[_0x2665('0x19')]=function(_0x42fd74){var _0x5ac806=this;return new Promise(function(_0x4e56c9,_0x1b5190){return db[_0x2665('0x1a')][_0x2665('0x1b')]({'raw':_0x42fd74[_0x2665('0x1c')]?_0x42fd74['options'][_0x2665('0x1d')]===undefined?!![]:![]:!![],'where':_0x42fd74[_0x2665('0x1c')]?_0x42fd74['options']['where']||null:null,'attributes':_0x42fd74[_0x2665('0x1c')]?_0x42fd74[_0x2665('0x1c')][_0x2665('0x1e')]||null:null,'limit':_0x42fd74[_0x2665('0x1c')]?_0x42fd74[_0x2665('0x1c')]['limit']||null:null,'include':_0x42fd74[_0x2665('0x1c')]?_0x42fd74['options'][_0x2665('0x1f')]?_[_0x2665('0x20')](_0x42fd74[_0x2665('0x1c')][_0x2665('0x1f')],function(_0x59470b){return{'model':db[_0x59470b[_0x2665('0x21')]],'as':_0x59470b['as'],'attributes':_0x59470b[_0x2665('0x1e')],'include':_0x59470b[_0x2665('0x1f')]?_['map'](_0x59470b[_0x2665('0x1f')],function(_0x3eabd8){return{'model':db[_0x3eabd8['model']],'as':_0x3eabd8['as'],'attributes':_0x3eabd8[_0x2665('0x1e')],'include':_0x3eabd8['include']?_[_0x2665('0x20')](_0x3eabd8[_0x2665('0x1f')],function(_0x32eb3b){return{'model':db[_0x32eb3b[_0x2665('0x21')]],'as':_0x32eb3b['as'],'attributes':_0x32eb3b[_0x2665('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2665('0xd')](function(_0x2c9d1a){logger['info'](_0x2665('0x19'),_0x42fd74);logger[_0x2665('0x11')](_0x2665('0x19'),_0x42fd74,JSON[_0x2665('0x13')](_0x2c9d1a));_0x4e56c9(_0x2c9d1a);})[_0x2665('0x18')](function(_0x748b7b){logger['error']('GetMailServerIn',_0x748b7b[_0x2665('0x16')],_0x42fd74);_0x1b5190(_0x5ac806[_0x2665('0x14')](0x1f4,_0x748b7b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 5a252bd..df94f18 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x15e7e8,_0x762335){_0x15e7e8=_0x15e7e8-0x0;var _0x15b3b4=_0x7a54[_0x15e7e8];return _0x15b3b4;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x327372,_0x581e63){_0x327372=_0x327372-0x0;var _0x2cb6bb=_0x7a54[_0x327372];return _0x2cb6bb;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 3eb0657..aad146e 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc788=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x205c8a,_0x2c685b){var _0x336fd6=function(_0x17672a){while(--_0x17672a){_0x205c8a['push'](_0x205c8a['shift']());}};_0x336fd6(++_0x2c685b);}(_0xc788,0xc4));var _0x8c78=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0xc788[_0x1e393b];return _0x3d0bfe;};'use strict';var Sequelize=require(_0x8c78('0x0'));module[_0x8c78('0x1')]={'description':{'type':Sequelize[_0x8c78('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x8c78('0x2')]},'port':{'type':Sequelize[_0x8c78('0x3')]},'secure':{'type':Sequelize[_0x8c78('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x8c78('0x2')]},'authentication':{'type':Sequelize[_0x8c78('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xfff0=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x50ca3a,_0x4a4e3a){var _0x2a3c6d=function(_0x15e7e7){while(--_0x15e7e7){_0x50ca3a['push'](_0x50ca3a['shift']());}};_0x2a3c6d(++_0x4a4e3a);}(_0xfff0,0x139));var _0x0fff=function(_0x52353b,_0x185d83){_0x52353b=_0x52353b-0x0;var _0x24de47=_0xfff0[_0x52353b];return _0x24de47;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'description':{'type':Sequelize[_0x0fff('0x1')]},'host':{'type':Sequelize[_0x0fff('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x0fff('0x1')]},'port':{'type':Sequelize[_0x0fff('0x2')]},'secure':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index c58e5d2..9d1081d 100644 --- a/server/api/mailServerOut/mailServerOut.controller.js +++ b/server/api/mailServerOut/mailServerOut.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ac5=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','save','update','destroy','then','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x24b373,_0xaeee2b){var _0x4a5780=function(_0x47cff5){while(--_0x47cff5){_0x24b373['push'](_0x24b373['shift']());}};_0x4a5780(++_0xaeee2b);}(_0x2ac5,0x1d8));var _0x52ac=function(_0x4e7af4,_0x758572){_0x4e7af4=_0x4e7af4-0x0;var _0x2548f1=_0x2ac5[_0x4e7af4];return _0x2548f1;};'use strict';var emlformat=require(_0x52ac('0x0'));var rimraf=require(_0x52ac('0x1'));var zipdir=require(_0x52ac('0x2'));var jsonpatch=require(_0x52ac('0x3'));var rp=require(_0x52ac('0x4'));var moment=require(_0x52ac('0x5'));var BPromise=require(_0x52ac('0x6'));var Mustache=require(_0x52ac('0x7'));var util=require(_0x52ac('0x8'));var path=require(_0x52ac('0x9'));var sox=require(_0x52ac('0xa'));var csv=require(_0x52ac('0xb'));var ejs=require(_0x52ac('0xc'));var fs=require('fs');var fs_extra=require(_0x52ac('0xd'));var _=require('lodash');var squel=require(_0x52ac('0xe'));var crypto=require(_0x52ac('0xf'));var jsforce=require(_0x52ac('0x10'));var deskjs=require(_0x52ac('0x11'));var toCsv=require('to-csv');var querystring=require(_0x52ac('0x12'));var Papa=require(_0x52ac('0x13'));var Redis=require('ioredis');var authService=require(_0x52ac('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x52ac('0x15'));var hardwareService=require(_0x52ac('0x16'));var logger=require(_0x52ac('0x17'))(_0x52ac('0x18'));var utils=require(_0x52ac('0x19'));var config=require(_0x52ac('0x1a'));var licenseUtil=require(_0x52ac('0x1b'));var db=require(_0x52ac('0x1c'))['db'];function respondWithStatusCode(_0x2a2830,_0x1412e6){_0x1412e6=_0x1412e6||0xcc;return function(_0x254bcc){if(_0x254bcc){return _0x2a2830[_0x52ac('0x1d')](_0x1412e6);}return _0x2a2830['status'](_0x1412e6)[_0x52ac('0x1e')]();};}function respondWithResult(_0xe11cc4,_0x347743){_0x347743=_0x347743||0xc8;return function(_0x291c8d){if(_0x291c8d){return _0xe11cc4[_0x52ac('0x1f')](_0x347743)['json'](_0x291c8d);}};}function respondWithFilteredResult(_0x2c9356,_0x18049b){return function(_0x31bc1e){if(_0x31bc1e){var _0x124f14=typeof _0x18049b[_0x52ac('0x20')]===_0x52ac('0x21')&&typeof _0x18049b['limit']===_0x52ac('0x21');var _0x326722=_0x31bc1e[_0x52ac('0x22')];var _0x1bc3b2=_0x124f14?0x0:_0x18049b[_0x52ac('0x20')];var _0xf06cdb=_0x124f14?_0x31bc1e[_0x52ac('0x22')]:_0x18049b[_0x52ac('0x20')]+_0x18049b['limit'];var _0x2faadb;if(_0xf06cdb>=_0x326722){_0xf06cdb=_0x326722;_0x2faadb=0xc8;}else{_0x2faadb=0xce;}_0x2c9356[_0x52ac('0x1f')](_0x2faadb);return _0x2c9356[_0x52ac('0x23')](_0x52ac('0x24'),_0x1bc3b2+'-'+_0xf06cdb+'/'+_0x326722)[_0x52ac('0x25')](_0x31bc1e);}return null;};}function patchUpdates(_0x1fe929){return function(_0x50ecaa){try{jsonpatch['apply'](_0x50ecaa,_0x1fe929,!![]);}catch(_0x2bf0a2){return BPromise['reject'](_0x2bf0a2);}return _0x50ecaa[_0x52ac('0x26')]();};}function saveUpdates(_0x36760c,_0x39cb9c){return function(_0x51e5d9){if(_0x51e5d9){return _0x51e5d9[_0x52ac('0x27')](_0x36760c)['then'](function(_0x46e408){return _0x46e408;});}return null;};}function removeEntity(_0x56e7b3,_0x1bcab6){return function(_0x74b5d2){if(_0x74b5d2){return _0x74b5d2[_0x52ac('0x28')]()[_0x52ac('0x29')](function(){_0x56e7b3[_0x52ac('0x1f')](0xcc)[_0x52ac('0x1e')]();});}};}function handleEntityNotFound(_0x4b9387,_0x14b9fb){return function(_0x444abc){if(!_0x444abc){_0x4b9387['sendStatus'](0x194);}return _0x444abc;};}function handleError(_0x13ed31,_0x684145){_0x684145=_0x684145||0x1f4;return function(_0x3cab55){logger[_0x52ac('0x2a')](_0x3cab55[_0x52ac('0x2b')]);if(_0x3cab55['name']){delete _0x3cab55[_0x52ac('0x2c')];}_0x13ed31[_0x52ac('0x1f')](_0x684145)[_0x52ac('0x2d')](_0x3cab55);};}exports[_0x52ac('0x2e')]=function(_0x499a9e,_0x3af70a){var _0x10a41d={},_0x28ea44={},_0x4683ee={'count':0x0,'rows':[]};var _0x1645eb=_[_0x52ac('0x2f')](db[_0x52ac('0x30')][_0x52ac('0x31')],function(_0x501534){return{'name':_0x501534[_0x52ac('0x32')],'type':_0x501534['type']['key']};});_0x28ea44[_0x52ac('0x33')]=_[_0x52ac('0x2f')](_0x1645eb,_0x52ac('0x2c'));_0x28ea44['query']=_[_0x52ac('0x34')](_0x499a9e['query']);_0x28ea44[_0x52ac('0x35')]=_['intersection'](_0x28ea44[_0x52ac('0x33')],_0x28ea44[_0x52ac('0x36')]);_0x10a41d['attributes']=_[_0x52ac('0x37')](_0x28ea44[_0x52ac('0x33')],qs[_0x52ac('0x38')](_0x499a9e[_0x52ac('0x36')][_0x52ac('0x38')]));_0x10a41d[_0x52ac('0x39')]=_0x10a41d[_0x52ac('0x39')][_0x52ac('0x3a')]?_0x10a41d[_0x52ac('0x39')]:_0x28ea44[_0x52ac('0x33')];if(!_0x499a9e[_0x52ac('0x36')][_0x52ac('0x3b')](_0x52ac('0x3c'))){_0x10a41d[_0x52ac('0x3d')]=qs['limit'](_0x499a9e[_0x52ac('0x36')]['limit']);_0x10a41d['offset']=qs['offset'](_0x499a9e['query'][_0x52ac('0x20')]);}_0x10a41d[_0x52ac('0x3e')]=qs[_0x52ac('0x3f')](_0x499a9e['query'][_0x52ac('0x3f')]);_0x10a41d[_0x52ac('0x40')]=qs[_0x52ac('0x35')](_[_0x52ac('0x41')](_0x499a9e['query'],_0x28ea44[_0x52ac('0x35')]),_0x1645eb);if(_0x499a9e['query'][_0x52ac('0x42')]){_0x10a41d[_0x52ac('0x40')]=_[_0x52ac('0x43')](_0x10a41d[_0x52ac('0x40')],{'$or':_[_0x52ac('0x2f')](_0x1645eb,function(_0x3fbffd){if(_0x3fbffd[_0x52ac('0x44')]!==_0x52ac('0x45')){var _0x4f7376={};_0x4f7376[_0x3fbffd[_0x52ac('0x2c')]]={'$like':'%'+_0x499a9e[_0x52ac('0x36')]['filter']+'%'};return _0x4f7376;}})});}_0x10a41d=_[_0x52ac('0x43')]({},_0x10a41d,_0x499a9e[_0x52ac('0x46')]);var _0xfd89d5={'where':_0x10a41d[_0x52ac('0x40')]};return db[_0x52ac('0x30')][_0x52ac('0x22')](_0xfd89d5)[_0x52ac('0x29')](function(_0x556b6d){_0x4683ee['count']=_0x556b6d;if(_0x499a9e['query'][_0x52ac('0x47')]){_0x10a41d[_0x52ac('0x48')]=[{'all':!![]}];}return db[_0x52ac('0x30')][_0x52ac('0x49')](_0x10a41d);})[_0x52ac('0x29')](function(_0x2e9c38){_0x4683ee[_0x52ac('0x4a')]=_0x2e9c38;return _0x4683ee;})['then'](respondWithFilteredResult(_0x3af70a,_0x10a41d))['catch'](handleError(_0x3af70a,null));};exports[_0x52ac('0x4b')]=function(_0x3f6ab1,_0x35448f){var _0x3510fb={'raw':!![],'where':{'id':_0x3f6ab1[_0x52ac('0x4c')]['id']}},_0x52ee7e={};_0x52ee7e[_0x52ac('0x33')]=_[_0x52ac('0x34')](db[_0x52ac('0x30')]['rawAttributes']);_0x52ee7e[_0x52ac('0x36')]=_['keys'](_0x3f6ab1[_0x52ac('0x36')]);_0x52ee7e[_0x52ac('0x35')]=_[_0x52ac('0x37')](_0x52ee7e[_0x52ac('0x33')],_0x52ee7e[_0x52ac('0x36')]);_0x3510fb[_0x52ac('0x39')]=_[_0x52ac('0x37')](_0x52ee7e[_0x52ac('0x33')],qs[_0x52ac('0x38')](_0x3f6ab1[_0x52ac('0x36')][_0x52ac('0x38')]));_0x3510fb[_0x52ac('0x39')]=_0x3510fb[_0x52ac('0x39')][_0x52ac('0x3a')]?_0x3510fb[_0x52ac('0x39')]:_0x52ee7e[_0x52ac('0x33')];if(_0x3f6ab1[_0x52ac('0x36')][_0x52ac('0x47')]){_0x3510fb['include']=[{'all':!![]}];}_0x3510fb=_[_0x52ac('0x43')]({},_0x3510fb,_0x3f6ab1['options']);return db[_0x52ac('0x30')][_0x52ac('0x4d')](_0x3510fb)[_0x52ac('0x29')](handleEntityNotFound(_0x35448f,null))[_0x52ac('0x29')](respondWithResult(_0x35448f,null))['catch'](handleError(_0x35448f,null));};exports['create']=function(_0x29cc82,_0x1332d3){return db['MailServerOut']['create'](_0x29cc82[_0x52ac('0x4e')],{})[_0x52ac('0x29')](respondWithResult(_0x1332d3,0xc9))[_0x52ac('0x4f')](handleError(_0x1332d3,null));};exports['update']=function(_0x35fec9,_0x25253d){if(_0x35fec9[_0x52ac('0x4e')]['id']){delete _0x35fec9[_0x52ac('0x4e')]['id'];}return db[_0x52ac('0x30')][_0x52ac('0x4d')]({'where':{'id':_0x35fec9[_0x52ac('0x4c')]['id']}})[_0x52ac('0x29')](handleEntityNotFound(_0x25253d,null))['then'](saveUpdates(_0x35fec9[_0x52ac('0x4e')],null))[_0x52ac('0x29')](respondWithResult(_0x25253d,null))[_0x52ac('0x4f')](handleError(_0x25253d,null));};exports['destroy']=function(_0x326b00,_0x18859c){return db[_0x52ac('0x30')][_0x52ac('0x4d')]({'where':{'id':_0x326b00[_0x52ac('0x4c')]['id']}})['then'](handleEntityNotFound(_0x18859c,null))[_0x52ac('0x29')](removeEntity(_0x18859c,null))[_0x52ac('0x4f')](handleError(_0x18859c,null));}; \ No newline at end of file +var _0xb319=['then','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','type','count','includeAll','include','findAll','rows','catch','show','fields','options','find','body','destroy','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/util','sendStatus','status','end','offset','undefined','set','Content-Range','json','apply','save','update'];(function(_0x2ed594,_0x15dec1){var _0x4f1606=function(_0x44da23){while(--_0x44da23){_0x2ed594['push'](_0x2ed594['shift']());}};_0x4f1606(++_0x15dec1);}(_0xb319,0x1a5));var _0x9b31=function(_0x339e8c,_0x4a839f){_0x339e8c=_0x339e8c-0x0;var _0x4ad2b9=_0xb319[_0x339e8c];return _0x4ad2b9;};'use strict';var emlformat=require(_0x9b31('0x0'));var rimraf=require(_0x9b31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b31('0x2'));var rp=require(_0x9b31('0x3'));var moment=require(_0x9b31('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9b31('0x5'));var util=require(_0x9b31('0x6'));var path=require('path');var sox=require(_0x9b31('0x7'));var csv=require(_0x9b31('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b31('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b31('0x8'));var querystring=require(_0x9b31('0xa'));var Papa=require(_0x9b31('0xb'));var Redis=require(_0x9b31('0xc'));var authService=require(_0x9b31('0xd'));var qs=require(_0x9b31('0xe'));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('../../config/environment');var licenseUtil=require(_0x9b31('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ebc3e,_0x33245c){_0x33245c=_0x33245c||0xcc;return function(_0x4b3a7d){if(_0x4b3a7d){return _0x1ebc3e[_0x9b31('0x10')](_0x33245c);}return _0x1ebc3e[_0x9b31('0x11')](_0x33245c)[_0x9b31('0x12')]();};}function respondWithResult(_0x5f3442,_0x3fd275){_0x3fd275=_0x3fd275||0xc8;return function(_0x1e4e13){if(_0x1e4e13){return _0x5f3442[_0x9b31('0x11')](_0x3fd275)['json'](_0x1e4e13);}};}function respondWithFilteredResult(_0x110248,_0x17660b){return function(_0x169103){if(_0x169103){var _0x4f2d0b=typeof _0x17660b[_0x9b31('0x13')]===_0x9b31('0x14')&&typeof _0x17660b['limit']==='undefined';var _0x216523=_0x169103['count'];var _0xec12a=_0x4f2d0b?0x0:_0x17660b[_0x9b31('0x13')];var _0x1bbfb7=_0x4f2d0b?_0x169103['count']:_0x17660b[_0x9b31('0x13')]+_0x17660b['limit'];var _0x34b205;if(_0x1bbfb7>=_0x216523){_0x1bbfb7=_0x216523;_0x34b205=0xc8;}else{_0x34b205=0xce;}_0x110248['status'](_0x34b205);return _0x110248[_0x9b31('0x15')](_0x9b31('0x16'),_0xec12a+'-'+_0x1bbfb7+'/'+_0x216523)[_0x9b31('0x17')](_0x169103);}return null;};}function patchUpdates(_0x24c8eb){return function(_0x172ce7){try{jsonpatch[_0x9b31('0x18')](_0x172ce7,_0x24c8eb,!![]);}catch(_0x4f82ff){return BPromise['reject'](_0x4f82ff);}return _0x172ce7[_0x9b31('0x19')]();};}function saveUpdates(_0xc0c3ff,_0x5476e2){return function(_0x5c4feb){if(_0x5c4feb){return _0x5c4feb[_0x9b31('0x1a')](_0xc0c3ff)[_0x9b31('0x1b')](function(_0x38912e){return _0x38912e;});}return null;};}function removeEntity(_0x54880d,_0x2c0f82){return function(_0x48a3){if(_0x48a3){return _0x48a3['destroy']()[_0x9b31('0x1b')](function(){_0x54880d['status'](0xcc)[_0x9b31('0x12')]();});}};}function handleEntityNotFound(_0x4d4e5e,_0x15496a){return function(_0x29ecdd){if(!_0x29ecdd){_0x4d4e5e[_0x9b31('0x10')](0x194);}return _0x29ecdd;};}function handleError(_0x5d667,_0xa8db41){_0xa8db41=_0xa8db41||0x1f4;return function(_0x318457){logger[_0x9b31('0x1c')](_0x318457['stack']);if(_0x318457[_0x9b31('0x1d')]){delete _0x318457[_0x9b31('0x1d')];}_0x5d667[_0x9b31('0x11')](_0xa8db41)[_0x9b31('0x1e')](_0x318457);};}exports[_0x9b31('0x1f')]=function(_0x6c7151,_0x3bc916){var _0x543481={},_0x42ef65={},_0x5dbf97={'count':0x0,'rows':[]};var _0x5c2b79=_[_0x9b31('0x20')](db[_0x9b31('0x21')][_0x9b31('0x22')],function(_0x2931a6){return{'name':_0x2931a6[_0x9b31('0x23')],'type':_0x2931a6['type']['key']};});_0x42ef65[_0x9b31('0x24')]=_['map'](_0x5c2b79,_0x9b31('0x1d'));_0x42ef65[_0x9b31('0x25')]=_[_0x9b31('0x26')](_0x6c7151['query']);_0x42ef65[_0x9b31('0x27')]=_[_0x9b31('0x28')](_0x42ef65[_0x9b31('0x24')],_0x42ef65['query']);_0x543481['attributes']=_[_0x9b31('0x28')](_0x42ef65[_0x9b31('0x24')],qs['fields'](_0x6c7151[_0x9b31('0x25')]['fields']));_0x543481[_0x9b31('0x29')]=_0x543481[_0x9b31('0x29')][_0x9b31('0x2a')]?_0x543481[_0x9b31('0x29')]:_0x42ef65['model'];if(!_0x6c7151[_0x9b31('0x25')][_0x9b31('0x2b')]('nolimit')){_0x543481['limit']=qs[_0x9b31('0x2c')](_0x6c7151['query'][_0x9b31('0x2c')]);_0x543481[_0x9b31('0x13')]=qs[_0x9b31('0x13')](_0x6c7151[_0x9b31('0x25')][_0x9b31('0x13')]);}_0x543481[_0x9b31('0x2d')]=qs[_0x9b31('0x2e')](_0x6c7151['query']['sort']);_0x543481[_0x9b31('0x2f')]=qs[_0x9b31('0x27')](_[_0x9b31('0x30')](_0x6c7151['query'],_0x42ef65[_0x9b31('0x27')]),_0x5c2b79);if(_0x6c7151[_0x9b31('0x25')]['filter']){_0x543481[_0x9b31('0x2f')]=_[_0x9b31('0x31')](_0x543481[_0x9b31('0x2f')],{'$or':_[_0x9b31('0x20')](_0x5c2b79,function(_0x599da1){if(_0x599da1[_0x9b31('0x32')]!=='VIRTUAL'){var _0x287d57={};_0x287d57[_0x599da1[_0x9b31('0x1d')]]={'$like':'%'+_0x6c7151[_0x9b31('0x25')]['filter']+'%'};return _0x287d57;}})});}_0x543481=_['merge']({},_0x543481,_0x6c7151['options']);var _0x59d237={'where':_0x543481[_0x9b31('0x2f')]};return db[_0x9b31('0x21')][_0x9b31('0x33')](_0x59d237)[_0x9b31('0x1b')](function(_0x954cdd){_0x5dbf97['count']=_0x954cdd;if(_0x6c7151[_0x9b31('0x25')][_0x9b31('0x34')]){_0x543481[_0x9b31('0x35')]=[{'all':!![]}];}return db[_0x9b31('0x21')][_0x9b31('0x36')](_0x543481);})[_0x9b31('0x1b')](function(_0x3caa1a){_0x5dbf97[_0x9b31('0x37')]=_0x3caa1a;return _0x5dbf97;})[_0x9b31('0x1b')](respondWithFilteredResult(_0x3bc916,_0x543481))[_0x9b31('0x38')](handleError(_0x3bc916,null));};exports[_0x9b31('0x39')]=function(_0x1747ca,_0x41f5b5){var _0x4eb3c5={'raw':!![],'where':{'id':_0x1747ca['params']['id']}},_0x106e7c={};_0x106e7c[_0x9b31('0x24')]=_[_0x9b31('0x26')](db[_0x9b31('0x21')]['rawAttributes']);_0x106e7c[_0x9b31('0x25')]=_[_0x9b31('0x26')](_0x1747ca[_0x9b31('0x25')]);_0x106e7c[_0x9b31('0x27')]=_['intersection'](_0x106e7c[_0x9b31('0x24')],_0x106e7c['query']);_0x4eb3c5['attributes']=_[_0x9b31('0x28')](_0x106e7c[_0x9b31('0x24')],qs['fields'](_0x1747ca[_0x9b31('0x25')][_0x9b31('0x3a')]));_0x4eb3c5[_0x9b31('0x29')]=_0x4eb3c5[_0x9b31('0x29')][_0x9b31('0x2a')]?_0x4eb3c5[_0x9b31('0x29')]:_0x106e7c[_0x9b31('0x24')];if(_0x1747ca[_0x9b31('0x25')][_0x9b31('0x34')]){_0x4eb3c5[_0x9b31('0x35')]=[{'all':!![]}];}_0x4eb3c5=_[_0x9b31('0x31')]({},_0x4eb3c5,_0x1747ca[_0x9b31('0x3b')]);return db[_0x9b31('0x21')][_0x9b31('0x3c')](_0x4eb3c5)[_0x9b31('0x1b')](handleEntityNotFound(_0x41f5b5,null))['then'](respondWithResult(_0x41f5b5,null))[_0x9b31('0x38')](handleError(_0x41f5b5,null));};exports['create']=function(_0x4609b8,_0x506650){return db['MailServerOut']['create'](_0x4609b8[_0x9b31('0x3d')],{})[_0x9b31('0x1b')](respondWithResult(_0x506650,0xc9))[_0x9b31('0x38')](handleError(_0x506650,null));};exports[_0x9b31('0x1a')]=function(_0x45f6a2,_0x44a1e7){if(_0x45f6a2['body']['id']){delete _0x45f6a2[_0x9b31('0x3d')]['id'];}return db['MailServerOut'][_0x9b31('0x3c')]({'where':{'id':_0x45f6a2['params']['id']}})['then'](handleEntityNotFound(_0x44a1e7,null))[_0x9b31('0x1b')](saveUpdates(_0x45f6a2[_0x9b31('0x3d')],null))['then'](respondWithResult(_0x44a1e7,null))[_0x9b31('0x38')](handleError(_0x44a1e7,null));};exports[_0x9b31('0x3e')]=function(_0x5b6f37,_0x3bedd3){return db[_0x9b31('0x21')][_0x9b31('0x3c')]({'where':{'id':_0x5b6f37[_0x9b31('0x3f')]['id']}})[_0x9b31('0x1b')](handleEntityNotFound(_0x3bedd3,null))[_0x9b31('0x1b')](removeEntity(_0x3bedd3,null))[_0x9b31('0x38')](handleError(_0x3bedd3,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 9c2a0be..16fd197 100644 --- a/server/api/mailServerOut/mailServerOut.model.js +++ b/server/api/mailServerOut/mailServerOut.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec0f=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash'];(function(_0x539d7d,_0xf85c86){var _0x48473c=function(_0x273481){while(--_0x273481){_0x539d7d['push'](_0x539d7d['shift']());}};_0x48473c(++_0xf85c86);}(_0xec0f,0x83));var _0xfec0=function(_0x2f86d3,_0x1328a8){_0x2f86d3=_0x2f86d3-0x0;var _0x27cdee=_0xec0f[_0x2f86d3];return _0x27cdee;};'use strict';var _=require(_0xfec0('0x0'));var util=require(_0xfec0('0x1'));var logger=require(_0xfec0('0x2'))('api');var moment=require(_0xfec0('0x3'));var BPromise=require(_0xfec0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfec0('0x5'));var rimraf=require(_0xfec0('0x6'));var config=require(_0xfec0('0x7'));var attributes=require('./mailServerOut.attributes');module[_0xfec0('0x8')]=function(_0x2960fd,_0x3b7dac){return _0x2960fd[_0xfec0('0x9')](_0xfec0('0xa'),attributes,{'tableName':_0xfec0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44dc=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4e7987,_0x2b665b){var _0x153cbe=function(_0x579a4d){while(--_0x579a4d){_0x4e7987['push'](_0x4e7987['shift']());}};_0x153cbe(++_0x2b665b);}(_0x44dc,0xa2));var _0xc44d=function(_0x32a22d,_0x17b134){_0x32a22d=_0x32a22d-0x0;var _0x302d10=_0x44dc[_0x32a22d];return _0x302d10;};'use strict';var _=require(_0xc44d('0x0'));var util=require(_0xc44d('0x1'));var logger=require(_0xc44d('0x2'))(_0xc44d('0x3'));var moment=require(_0xc44d('0x4'));var BPromise=require(_0xc44d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc44d('0x6'));var rimraf=require('rimraf');var config=require(_0xc44d('0x7'));var attributes=require(_0xc44d('0x8'));module[_0xc44d('0x9')]=function(_0x16c544,_0x524e57){return _0x16c544[_0xc44d('0xa')](_0xc44d('0xb'),attributes,{'tableName':_0xc44d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 5e49706..c260866 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4168e9,_0x137419){var _0x4fa5b8=function(_0xb23e35){while(--_0xb23e35){_0x4168e9['push'](_0x4168e9['shift']());}};_0x4fa5b8(++_0x137419);}(_0x2ef3,0xba));var _0x32ef=function(_0x50d408,_0x17fc56){_0x50d408=_0x50d408-0x0;var _0x24819e=_0x2ef3[_0x50d408];return _0x24819e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1c1384,_0x443fdc){var _0x529ed5=function(_0x5d4bb1){while(--_0x5d4bb1){_0x1c1384['push'](_0x1c1384['shift']());}};_0x529ed5(++_0x443fdc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x53deba,_0x5e6969){_0x53deba=_0x53deba-0x0;var _0x337b8e=_0x5f2f[_0x53deba];return _0x337b8e;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index fdb6422..acf1ef3 100644 --- a/server/api/mailSubstatus/index.js +++ b/server/api/mailSubstatus/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdba8=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','get','/describe','describe','/:id','post','put','update','delete','exports','multer'];(function(_0x1397d1,_0x3f12ad){var _0x1a120a=function(_0x49212a){while(--_0x49212a){_0x1397d1['push'](_0x1397d1['shift']());}};_0x1a120a(++_0x3f12ad);}(_0xdba8,0x8b));var _0x8dba=function(_0x4a1f28,_0x189d30){_0x4a1f28=_0x4a1f28-0x0;var _0x3622ee=_0xdba8[_0x4a1f28];return _0x3622ee;};'use strict';var multer=require(_0x8dba('0x0'));var util=require(_0x8dba('0x1'));var path=require(_0x8dba('0x2'));var timeout=require(_0x8dba('0x3'));var express=require(_0x8dba('0x4'));var router=express[_0x8dba('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8dba('0x6'));var interaction=require(_0x8dba('0x7'));var config=require(_0x8dba('0x8'));var controller=require(_0x8dba('0x9'));router['get']('/',auth[_0x8dba('0xa')](),controller['index']);router[_0x8dba('0xb')](_0x8dba('0xc'),auth['isAuthenticated'](),controller[_0x8dba('0xd')]);router[_0x8dba('0xb')](_0x8dba('0xe'),auth[_0x8dba('0xa')](),controller['show']);router[_0x8dba('0xf')]('/',auth[_0x8dba('0xa')](),controller['create']);router[_0x8dba('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x8dba('0x11')]);router[_0x8dba('0x12')]('/:id',auth[_0x8dba('0xa')](),controller['destroy']);module[_0x8dba('0x13')]=router; \ No newline at end of file +var _0x5d0c=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x2688e5,_0x5c410e){var _0x9412f5=function(_0x24feb4){while(--_0x24feb4){_0x2688e5['push'](_0x2688e5['shift']());}};_0x9412f5(++_0x5c410e);}(_0x5d0c,0x17a));var _0xc5d0=function(_0x1720cb,_0x14f6c1){_0x1720cb=_0x1720cb-0x0;var _0x3a41c8=_0x5d0c[_0x1720cb];return _0x3a41c8;};'use strict';var multer=require(_0xc5d0('0x0'));var util=require(_0xc5d0('0x1'));var path=require('path');var timeout=require(_0xc5d0('0x2'));var express=require(_0xc5d0('0x3'));var router=express[_0xc5d0('0x4')]();var fs_extra=require(_0xc5d0('0x5'));var auth=require(_0xc5d0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc5d0('0x7'));router['get']('/',auth[_0xc5d0('0x8')](),controller[_0xc5d0('0x9')]);router[_0xc5d0('0xa')](_0xc5d0('0xb'),auth['isAuthenticated'](),controller[_0xc5d0('0xc')]);router[_0xc5d0('0xa')](_0xc5d0('0xd'),auth[_0xc5d0('0x8')](),controller[_0xc5d0('0xe')]);router[_0xc5d0('0xf')]('/',auth[_0xc5d0('0x8')](),controller[_0xc5d0('0x10')]);router[_0xc5d0('0x11')](_0xc5d0('0xd'),auth[_0xc5d0('0x8')](),controller[_0xc5d0('0x12')]);router[_0xc5d0('0x13')](_0xc5d0('0xd'),auth['isAuthenticated'](),controller[_0xc5d0('0x14')]);module[_0xc5d0('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index d168532..a7e5dd3 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x126e=['exports','STRING','name'];(function(_0x2cac3a,_0x16b7ea){var _0x5cdf90=function(_0x1af1de){while(--_0x1af1de){_0x2cac3a['push'](_0x2cac3a['shift']());}};_0x5cdf90(++_0x16b7ea);}(_0x126e,0x108));var _0xe126=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x126e[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require('sequelize');module[_0xe126('0x0')]={'name':{'type':Sequelize[_0xe126('0x1')],'unique':_0xe126('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe126('0x1')]}}; \ No newline at end of file +var _0x6596=['exports','name','STRING','sequelize'];(function(_0x2a7609,_0xa6a866){var _0x25e456=function(_0x56c1dc){while(--_0x56c1dc){_0x2a7609['push'](_0x2a7609['shift']());}};_0x25e456(++_0xa6a866);}(_0x6596,0x1d3));var _0x6659=function(_0x426dc5,_0x169578){_0x426dc5=_0x426dc5-0x0;var _0x1d6fb7=_0x6596[_0x426dc5];return _0x1d6fb7;};'use strict';var Sequelize=require(_0x6659('0x0'));module[_0x6659('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6659('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6659('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 229e3d9..925f0cc 100644 --- a/server/api/mailSubstatus/mailSubstatus.controller.js +++ b/server/api/mailSubstatus/mailSubstatus.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd3d=['destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','keys','length','include','merge','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then'];(function(_0x5dec4c,_0x5ae5f9){var _0x131fb5=function(_0x58960d){while(--_0x58960d){_0x5dec4c['push'](_0x5dec4c['shift']());}};_0x131fb5(++_0x5ae5f9);}(_0xbd3d,0x78));var _0xdbd3=function(_0x5491e9,_0x5a7ec5){_0x5491e9=_0x5491e9-0x0;var _0x5e2929=_0xbd3d[_0x5491e9];return _0x5e2929;};'use strict';var emlformat=require(_0xdbd3('0x0'));var rimraf=require(_0xdbd3('0x1'));var zipdir=require(_0xdbd3('0x2'));var jsonpatch=require(_0xdbd3('0x3'));var rp=require(_0xdbd3('0x4'));var moment=require(_0xdbd3('0x5'));var BPromise=require(_0xdbd3('0x6'));var Mustache=require(_0xdbd3('0x7'));var util=require(_0xdbd3('0x8'));var path=require(_0xdbd3('0x9'));var sox=require('sox');var csv=require(_0xdbd3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdbd3('0xb'));var squel=require(_0xdbd3('0xc'));var crypto=require(_0xdbd3('0xd'));var jsforce=require(_0xdbd3('0xe'));var deskjs=require(_0xdbd3('0xf'));var toCsv=require(_0xdbd3('0xa'));var querystring=require(_0xdbd3('0x10'));var Papa=require(_0xdbd3('0x11'));var Redis=require(_0xdbd3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdbd3('0x13'));var as=require(_0xdbd3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdbd3('0x15'))(_0xdbd3('0x16'));var utils=require(_0xdbd3('0x17'));var config=require(_0xdbd3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdbd3('0x19'))['db'];function respondWithStatusCode(_0x55f9a7,_0x20bde3){_0x20bde3=_0x20bde3||0xcc;return function(_0x2074c3){if(_0x2074c3){return _0x55f9a7['sendStatus'](_0x20bde3);}return _0x55f9a7['status'](_0x20bde3)[_0xdbd3('0x1a')]();};}function respondWithResult(_0x463d90,_0x2558ac){_0x2558ac=_0x2558ac||0xc8;return function(_0x3fb7a5){if(_0x3fb7a5){return _0x463d90[_0xdbd3('0x1b')](_0x2558ac)[_0xdbd3('0x1c')](_0x3fb7a5);}};}function respondWithFilteredResult(_0x4242ed,_0x4d3c42){return function(_0x559fdc){if(_0x559fdc){var _0x23effa=typeof _0x4d3c42[_0xdbd3('0x1d')]===_0xdbd3('0x1e')&&typeof _0x4d3c42[_0xdbd3('0x1f')]==='undefined';var _0x2b1f03=_0x559fdc[_0xdbd3('0x20')];var _0x5b6e56=_0x23effa?0x0:_0x4d3c42[_0xdbd3('0x1d')];var _0x40cd04=_0x23effa?_0x559fdc[_0xdbd3('0x20')]:_0x4d3c42[_0xdbd3('0x1d')]+_0x4d3c42[_0xdbd3('0x1f')];var _0x1afe45;if(_0x40cd04>=_0x2b1f03){_0x40cd04=_0x2b1f03;_0x1afe45=0xc8;}else{_0x1afe45=0xce;}_0x4242ed[_0xdbd3('0x1b')](_0x1afe45);return _0x4242ed[_0xdbd3('0x21')](_0xdbd3('0x22'),_0x5b6e56+'-'+_0x40cd04+'/'+_0x2b1f03)[_0xdbd3('0x1c')](_0x559fdc);}return null;};}function patchUpdates(_0x3b50d9){return function(_0x188d78){try{jsonpatch['apply'](_0x188d78,_0x3b50d9,!![]);}catch(_0x40c74f){return BPromise[_0xdbd3('0x23')](_0x40c74f);}return _0x188d78['save']();};}function saveUpdates(_0xe72a94,_0x59fe32){return function(_0x5e368){if(_0x5e368){return _0x5e368[_0xdbd3('0x24')](_0xe72a94)[_0xdbd3('0x25')](function(_0x15f0e3){return _0x15f0e3;});}return null;};}function removeEntity(_0x2bd378,_0x1b3ce3){return function(_0x3e4788){if(_0x3e4788){return _0x3e4788[_0xdbd3('0x26')]()[_0xdbd3('0x25')](function(){_0x2bd378['status'](0xcc)[_0xdbd3('0x1a')]();});}};}function handleEntityNotFound(_0x1f7ab8,_0x486981){return function(_0x1ecbe3){if(!_0x1ecbe3){_0x1f7ab8['sendStatus'](0x194);}return _0x1ecbe3;};}function handleError(_0x1d2721,_0x309ab7){_0x309ab7=_0x309ab7||0x1f4;return function(_0x902f05){logger[_0xdbd3('0x27')](_0x902f05[_0xdbd3('0x28')]);if(_0x902f05[_0xdbd3('0x29')]){delete _0x902f05[_0xdbd3('0x29')];}_0x1d2721[_0xdbd3('0x1b')](_0x309ab7)[_0xdbd3('0x2a')](_0x902f05);};}exports[_0xdbd3('0x2b')]=function(_0x11843a,_0x31d329){var _0x8cf9c1={},_0x4c23a5={},_0x2dbba8={'count':0x0,'rows':[]};var _0x2de69a=_[_0xdbd3('0x2c')](db[_0xdbd3('0x2d')][_0xdbd3('0x2e')],function(_0x25ba3a){return{'name':_0x25ba3a[_0xdbd3('0x2f')],'type':_0x25ba3a[_0xdbd3('0x30')][_0xdbd3('0x31')]};});_0x4c23a5[_0xdbd3('0x32')]=_[_0xdbd3('0x2c')](_0x2de69a,_0xdbd3('0x29'));_0x4c23a5[_0xdbd3('0x33')]=_['keys'](_0x11843a[_0xdbd3('0x33')]);_0x4c23a5['filters']=_[_0xdbd3('0x34')](_0x4c23a5[_0xdbd3('0x32')],_0x4c23a5[_0xdbd3('0x33')]);_0x8cf9c1[_0xdbd3('0x35')]=_[_0xdbd3('0x34')](_0x4c23a5[_0xdbd3('0x32')],qs[_0xdbd3('0x36')](_0x11843a[_0xdbd3('0x33')]['fields']));_0x8cf9c1[_0xdbd3('0x35')]=_0x8cf9c1['attributes']['length']?_0x8cf9c1[_0xdbd3('0x35')]:_0x4c23a5[_0xdbd3('0x32')];if(!_0x11843a['query'][_0xdbd3('0x37')](_0xdbd3('0x38'))){_0x8cf9c1[_0xdbd3('0x1f')]=qs[_0xdbd3('0x1f')](_0x11843a['query']['limit']);_0x8cf9c1[_0xdbd3('0x1d')]=qs['offset'](_0x11843a[_0xdbd3('0x33')]['offset']);}_0x8cf9c1[_0xdbd3('0x39')]=qs[_0xdbd3('0x3a')](_0x11843a['query'][_0xdbd3('0x3a')]);_0x8cf9c1['where']=qs[_0xdbd3('0x3b')](_[_0xdbd3('0x3c')](_0x11843a[_0xdbd3('0x33')],_0x4c23a5['filters']),_0x2de69a);if(_0x11843a['query']['filter']){_0x8cf9c1[_0xdbd3('0x3d')]=_['merge'](_0x8cf9c1[_0xdbd3('0x3d')],{'$or':_[_0xdbd3('0x2c')](_0x2de69a,function(_0x58c613){if(_0x58c613[_0xdbd3('0x30')]!==_0xdbd3('0x3e')){var _0x4b8cac={};_0x4b8cac[_0x58c613['name']]={'$like':'%'+_0x11843a[_0xdbd3('0x33')][_0xdbd3('0x3f')]+'%'};return _0x4b8cac;}})});}_0x8cf9c1=_['merge']({},_0x8cf9c1,_0x11843a[_0xdbd3('0x40')]);var _0x207405={'where':_0x8cf9c1['where']};return db[_0xdbd3('0x2d')]['count'](_0x207405)[_0xdbd3('0x25')](function(_0x15cc40){_0x2dbba8[_0xdbd3('0x20')]=_0x15cc40;if(_0x11843a[_0xdbd3('0x33')][_0xdbd3('0x41')]){_0x8cf9c1['include']=[{'all':!![]}];}return db[_0xdbd3('0x2d')][_0xdbd3('0x42')](_0x8cf9c1);})[_0xdbd3('0x25')](function(_0x125622){_0x2dbba8[_0xdbd3('0x43')]=_0x125622;return _0x2dbba8;})[_0xdbd3('0x25')](respondWithFilteredResult(_0x31d329,_0x8cf9c1))['catch'](handleError(_0x31d329,null));};exports[_0xdbd3('0x44')]=function(_0x3eb324,_0x30e90d){var _0x510e96={'raw':!![],'where':{'id':_0x3eb324[_0xdbd3('0x45')]['id']}},_0x36168e={};_0x36168e[_0xdbd3('0x32')]=_['keys'](db[_0xdbd3('0x2d')][_0xdbd3('0x2e')]);_0x36168e[_0xdbd3('0x33')]=_[_0xdbd3('0x46')](_0x3eb324[_0xdbd3('0x33')]);_0x36168e['filters']=_[_0xdbd3('0x34')](_0x36168e[_0xdbd3('0x32')],_0x36168e[_0xdbd3('0x33')]);_0x510e96[_0xdbd3('0x35')]=_[_0xdbd3('0x34')](_0x36168e[_0xdbd3('0x32')],qs[_0xdbd3('0x36')](_0x3eb324[_0xdbd3('0x33')][_0xdbd3('0x36')]));_0x510e96['attributes']=_0x510e96[_0xdbd3('0x35')][_0xdbd3('0x47')]?_0x510e96['attributes']:_0x36168e[_0xdbd3('0x32')];if(_0x3eb324[_0xdbd3('0x33')][_0xdbd3('0x41')]){_0x510e96[_0xdbd3('0x48')]=[{'all':!![]}];}_0x510e96=_[_0xdbd3('0x49')]({},_0x510e96,_0x3eb324[_0xdbd3('0x40')]);return db[_0xdbd3('0x2d')][_0xdbd3('0x4a')](_0x510e96)[_0xdbd3('0x25')](handleEntityNotFound(_0x30e90d,null))['then'](respondWithResult(_0x30e90d,null))['catch'](handleError(_0x30e90d,null));};exports[_0xdbd3('0x4b')]=function(_0x45de8b,_0xf07997){return db['MailSubstatus'][_0xdbd3('0x4b')](_0x45de8b[_0xdbd3('0x4c')],{})[_0xdbd3('0x25')](respondWithResult(_0xf07997,0xc9))[_0xdbd3('0x4d')](handleError(_0xf07997,null));};exports[_0xdbd3('0x24')]=function(_0x1da17d,_0x3d96f5){if(_0x1da17d['body']['id']){delete _0x1da17d['body']['id'];}return db[_0xdbd3('0x2d')]['find']({'where':{'id':_0x1da17d['params']['id']}})[_0xdbd3('0x25')](handleEntityNotFound(_0x3d96f5,null))[_0xdbd3('0x25')](saveUpdates(_0x1da17d[_0xdbd3('0x4c')],null))[_0xdbd3('0x25')](respondWithResult(_0x3d96f5,null))[_0xdbd3('0x4d')](handleError(_0x3d96f5,null));};exports[_0xdbd3('0x26')]=function(_0x19421e,_0x49ea5f){return db[_0xdbd3('0x2d')][_0xdbd3('0x4a')]({'where':{'id':_0x19421e[_0xdbd3('0x45')]['id']}})['then'](handleEntityNotFound(_0x49ea5f,null))[_0xdbd3('0x25')](removeEntity(_0x49ea5f,null))['catch'](handleError(_0x49ea5f,null));};exports[_0xdbd3('0x4e')]=function(_0x2f7c93,_0x5e85af){return db['MailSubstatus'][_0xdbd3('0x4e')]()[_0xdbd3('0x25')](respondWithResult(_0x5e85af,null))['catch'](handleError(_0x5e85af,null));}; \ No newline at end of file +var _0xa79d=['pick','filter','merge','map','VIRTUAL','options','MailSubstatus','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','error','stack','name','index','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where'];(function(_0x2b4135,_0x1097af){var _0x4ee4f1=function(_0x36c907){while(--_0x36c907){_0x2b4135['push'](_0x2b4135['shift']());}};_0x4ee4f1(++_0x1097af);}(_0xa79d,0x1dd));var _0xda79=function(_0x582246,_0xa45179){_0x582246=_0x582246-0x0;var _0x2bcbcd=_0xa79d[_0x582246];return _0x2bcbcd;};'use strict';var emlformat=require(_0xda79('0x0'));var rimraf=require(_0xda79('0x1'));var zipdir=require(_0xda79('0x2'));var jsonpatch=require(_0xda79('0x3'));var rp=require('request-promise');var moment=require(_0xda79('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xda79('0x5'));var path=require(_0xda79('0x6'));var sox=require(_0xda79('0x7'));var csv=require(_0xda79('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda79('0x9'));var _=require(_0xda79('0xa'));var squel=require(_0xda79('0xb'));var crypto=require(_0xda79('0xc'));var jsforce=require(_0xda79('0xd'));var deskjs=require(_0xda79('0xe'));var toCsv=require(_0xda79('0x8'));var querystring=require('querystring');var Papa=require(_0xda79('0xf'));var Redis=require(_0xda79('0x10'));var authService=require(_0xda79('0x11'));var qs=require(_0xda79('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda79('0x13'));var logger=require(_0xda79('0x14'))(_0xda79('0x15'));var utils=require(_0xda79('0x16'));var config=require(_0xda79('0x17'));var licenseUtil=require(_0xda79('0x18'));var db=require(_0xda79('0x19'))['db'];function respondWithStatusCode(_0xeac40e,_0x44ad9f){_0x44ad9f=_0x44ad9f||0xcc;return function(_0x19c6ce){if(_0x19c6ce){return _0xeac40e[_0xda79('0x1a')](_0x44ad9f);}return _0xeac40e[_0xda79('0x1b')](_0x44ad9f)[_0xda79('0x1c')]();};}function respondWithResult(_0x46e21a,_0x20bb28){_0x20bb28=_0x20bb28||0xc8;return function(_0xb3f938){if(_0xb3f938){return _0x46e21a[_0xda79('0x1b')](_0x20bb28)[_0xda79('0x1d')](_0xb3f938);}};}function respondWithFilteredResult(_0x320e4d,_0x363742){return function(_0x5a230d){if(_0x5a230d){var _0x663136=typeof _0x363742[_0xda79('0x1e')]===_0xda79('0x1f')&&typeof _0x363742[_0xda79('0x20')]===_0xda79('0x1f');var _0x2a02a0=_0x5a230d[_0xda79('0x21')];var _0x1771e6=_0x663136?0x0:_0x363742[_0xda79('0x1e')];var _0x4b878b=_0x663136?_0x5a230d[_0xda79('0x21')]:_0x363742['offset']+_0x363742[_0xda79('0x20')];var _0x279e0b;if(_0x4b878b>=_0x2a02a0){_0x4b878b=_0x2a02a0;_0x279e0b=0xc8;}else{_0x279e0b=0xce;}_0x320e4d[_0xda79('0x1b')](_0x279e0b);return _0x320e4d[_0xda79('0x22')]('Content-Range',_0x1771e6+'-'+_0x4b878b+'/'+_0x2a02a0)['json'](_0x5a230d);}return null;};}function patchUpdates(_0x3e9d4d){return function(_0x5a8c3b){try{jsonpatch['apply'](_0x5a8c3b,_0x3e9d4d,!![]);}catch(_0x1c469f){return BPromise[_0xda79('0x23')](_0x1c469f);}return _0x5a8c3b[_0xda79('0x24')]();};}function saveUpdates(_0x5d7e5e,_0x31eb02){return function(_0x5c6f85){if(_0x5c6f85){return _0x5c6f85['update'](_0x5d7e5e)['then'](function(_0x5cf575){return _0x5cf575;});}return null;};}function removeEntity(_0x413b53,_0x1e5d83){return function(_0x2bcd3b){if(_0x2bcd3b){return _0x2bcd3b['destroy']()[_0xda79('0x25')](function(){_0x413b53['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x362543,_0x17564f){return function(_0x35b2f9){if(!_0x35b2f9){_0x362543[_0xda79('0x1a')](0x194);}return _0x35b2f9;};}function handleError(_0x1a6229,_0x1b387f){_0x1b387f=_0x1b387f||0x1f4;return function(_0x4d1e39){logger[_0xda79('0x26')](_0x4d1e39[_0xda79('0x27')]);if(_0x4d1e39['name']){delete _0x4d1e39[_0xda79('0x28')];}_0x1a6229[_0xda79('0x1b')](_0x1b387f)['send'](_0x4d1e39);};}exports[_0xda79('0x29')]=function(_0x1d0175,_0x4d0fab){var _0x17ebc1={},_0x1dde44={},_0x19ec8c={'count':0x0,'rows':[]};var _0x284dc5=_['map'](db['MailSubstatus'][_0xda79('0x2a')],function(_0x1c9343){return{'name':_0x1c9343[_0xda79('0x2b')],'type':_0x1c9343[_0xda79('0x2c')]['key']};});_0x1dde44['model']=_['map'](_0x284dc5,_0xda79('0x28'));_0x1dde44[_0xda79('0x2d')]=_[_0xda79('0x2e')](_0x1d0175[_0xda79('0x2d')]);_0x1dde44[_0xda79('0x2f')]=_[_0xda79('0x30')](_0x1dde44[_0xda79('0x31')],_0x1dde44['query']);_0x17ebc1[_0xda79('0x32')]=_[_0xda79('0x30')](_0x1dde44[_0xda79('0x31')],qs[_0xda79('0x33')](_0x1d0175[_0xda79('0x2d')][_0xda79('0x33')]));_0x17ebc1[_0xda79('0x32')]=_0x17ebc1[_0xda79('0x32')]['length']?_0x17ebc1[_0xda79('0x32')]:_0x1dde44[_0xda79('0x31')];if(!_0x1d0175[_0xda79('0x2d')][_0xda79('0x34')]('nolimit')){_0x17ebc1['limit']=qs[_0xda79('0x20')](_0x1d0175[_0xda79('0x2d')]['limit']);_0x17ebc1[_0xda79('0x1e')]=qs['offset'](_0x1d0175['query'][_0xda79('0x1e')]);}_0x17ebc1['order']=qs['sort'](_0x1d0175[_0xda79('0x2d')][_0xda79('0x35')]);_0x17ebc1[_0xda79('0x36')]=qs['filters'](_[_0xda79('0x37')](_0x1d0175['query'],_0x1dde44['filters']),_0x284dc5);if(_0x1d0175['query'][_0xda79('0x38')]){_0x17ebc1['where']=_[_0xda79('0x39')](_0x17ebc1[_0xda79('0x36')],{'$or':_[_0xda79('0x3a')](_0x284dc5,function(_0x175851){if(_0x175851['type']!==_0xda79('0x3b')){var _0x320552={};_0x320552[_0x175851[_0xda79('0x28')]]={'$like':'%'+_0x1d0175['query']['filter']+'%'};return _0x320552;}})});}_0x17ebc1=_['merge']({},_0x17ebc1,_0x1d0175[_0xda79('0x3c')]);var _0x2864d7={'where':_0x17ebc1[_0xda79('0x36')]};return db[_0xda79('0x3d')][_0xda79('0x21')](_0x2864d7)[_0xda79('0x25')](function(_0x39f1d1){_0x19ec8c[_0xda79('0x21')]=_0x39f1d1;if(_0x1d0175[_0xda79('0x2d')]['includeAll']){_0x17ebc1[_0xda79('0x3e')]=[{'all':!![]}];}return db['MailSubstatus'][_0xda79('0x3f')](_0x17ebc1);})[_0xda79('0x25')](function(_0x189855){_0x19ec8c[_0xda79('0x40')]=_0x189855;return _0x19ec8c;})[_0xda79('0x25')](respondWithFilteredResult(_0x4d0fab,_0x17ebc1))['catch'](handleError(_0x4d0fab,null));};exports[_0xda79('0x41')]=function(_0x368a1d,_0x468778){var _0xbd7ad={'raw':!![],'where':{'id':_0x368a1d[_0xda79('0x42')]['id']}},_0x322f19={};_0x322f19[_0xda79('0x31')]=_[_0xda79('0x2e')](db[_0xda79('0x3d')]['rawAttributes']);_0x322f19[_0xda79('0x2d')]=_[_0xda79('0x2e')](_0x368a1d[_0xda79('0x2d')]);_0x322f19[_0xda79('0x2f')]=_[_0xda79('0x30')](_0x322f19['model'],_0x322f19['query']);_0xbd7ad[_0xda79('0x32')]=_[_0xda79('0x30')](_0x322f19[_0xda79('0x31')],qs['fields'](_0x368a1d['query']['fields']));_0xbd7ad[_0xda79('0x32')]=_0xbd7ad[_0xda79('0x32')][_0xda79('0x43')]?_0xbd7ad[_0xda79('0x32')]:_0x322f19['model'];if(_0x368a1d[_0xda79('0x2d')][_0xda79('0x44')]){_0xbd7ad['include']=[{'all':!![]}];}_0xbd7ad=_[_0xda79('0x39')]({},_0xbd7ad,_0x368a1d['options']);return db[_0xda79('0x3d')][_0xda79('0x45')](_0xbd7ad)[_0xda79('0x25')](handleEntityNotFound(_0x468778,null))[_0xda79('0x25')](respondWithResult(_0x468778,null))[_0xda79('0x46')](handleError(_0x468778,null));};exports['create']=function(_0x3c9aac,_0x3450ab){return db[_0xda79('0x3d')][_0xda79('0x47')](_0x3c9aac[_0xda79('0x48')],{})[_0xda79('0x25')](respondWithResult(_0x3450ab,0xc9))[_0xda79('0x46')](handleError(_0x3450ab,null));};exports[_0xda79('0x49')]=function(_0x5b3939,_0x1dd567){if(_0x5b3939[_0xda79('0x48')]['id']){delete _0x5b3939[_0xda79('0x48')]['id'];}return db['MailSubstatus'][_0xda79('0x45')]({'where':{'id':_0x5b3939[_0xda79('0x42')]['id']}})[_0xda79('0x25')](handleEntityNotFound(_0x1dd567,null))[_0xda79('0x25')](saveUpdates(_0x5b3939[_0xda79('0x48')],null))[_0xda79('0x25')](respondWithResult(_0x1dd567,null))[_0xda79('0x46')](handleError(_0x1dd567,null));};exports[_0xda79('0x4a')]=function(_0x462fa2,_0x9b028a){return db[_0xda79('0x3d')][_0xda79('0x45')]({'where':{'id':_0x462fa2[_0xda79('0x42')]['id']}})['then'](handleEntityNotFound(_0x9b028a,null))['then'](removeEntity(_0x9b028a,null))['catch'](handleError(_0x9b028a,null));};exports[_0xda79('0x4b')]=function(_0x140f24,_0x16d3db){return db['MailSubstatus'][_0xda79('0x4b')]()[_0xda79('0x25')](respondWithResult(_0x16d3db,null))['catch'](handleError(_0x16d3db,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 8708709..ce5a8ab 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b80=['setMaxListeners','update','emit','hook','exports','../../mysqldb','MailSubstatus'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x8b80,0x1e8));var _0x08b8=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x8b80[_0x277af0];return _0x43bd7c;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x08b8('0x0'))['db'][_0x08b8('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x08b8('0x2')](0x0);var events={'afterUpdate':_0x08b8('0x3')};function emitEvent(_0x21f223){return function(_0x2521e6,_0x55a311,_0x26dcd1){MailSubstatusEvents[_0x08b8('0x4')](_0x21f223+':'+_0x2521e6['id'],_0x2521e6);MailSubstatusEvents[_0x08b8('0x4')](_0x21f223,_0x2521e6);_0x26dcd1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x08b8('0x5')](e,emitEvent(event));}}module[_0x08b8('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0x1aff=['setMaxListeners','update','hook','exports','../../mysqldb'];(function(_0x262a91,_0x4d3739){var _0x5dcb6b=function(_0x5df927){while(--_0x5df927){_0x262a91['push'](_0x262a91['shift']());}};_0x5dcb6b(++_0x4d3739);}(_0x1aff,0x10d));var _0xf1af=function(_0x300f55,_0x54072c){_0x300f55=_0x300f55-0x0;var _0x4ebfff=_0x1aff[_0x300f55];return _0x4ebfff;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xf1af('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xf1af('0x1')](0x0);var events={'afterUpdate':_0xf1af('0x2')};function emitEvent(_0x421734){return function(_0x236cc7,_0x36024c,_0x24c68f){MailSubstatusEvents['emit'](_0x421734+':'+_0x236cc7['id'],_0x236cc7);MailSubstatusEvents['emit'](_0x421734,_0x236cc7);_0x24c68f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xf1af('0x3')](e,emitEvent(event));}}module[_0xf1af('0x4')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 9209221..bf46991 100644 --- a/server/api/mailSubstatus/mailSubstatus.model.js +++ b/server/api/mailSubstatus/mailSubstatus.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda65=['./mailSubstatus.attributes','exports','define','MailSubstatus','Condition','update','name','mailSubstatus','_previousDataValues','then','catch'];(function(_0x5ba341,_0xa35b53){var _0x5ecfe5=function(_0x5b240b){while(--_0x5b240b){_0x5ba341['push'](_0x5ba341['shift']());}};_0x5ecfe5(++_0xa35b53);}(_0xda65,0x9a));var _0x5da6=function(_0x3df0b3,_0x415f6a){_0x3df0b3=_0x3df0b3-0x0;var _0x3b436c=_0xda65[_0x3df0b3];return _0x3b436c;};'use strict';var attributes=require(_0x5da6('0x0'));module[_0x5da6('0x1')]=function(_0x35da7c){var _0x57f4b6=_0x35da7c['models'];return _0x35da7c[_0x5da6('0x2')](_0x5da6('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x371477,_0x1c8689,_0x5f2fd4){return _0x57f4b6[_0x5da6('0x4')][_0x5da6('0x5')]({'value':_0x371477[_0x5da6('0x6')]},{'where':{'field':_0x5da6('0x7'),'value':_0x371477[_0x5da6('0x8')][_0x5da6('0x6')]}})[_0x5da6('0x9')](function(){_0x5f2fd4();})[_0x5da6('0xa')](function(_0x13d76a){_0x5f2fd4(_0x13d76a);});}}});}; \ No newline at end of file +var _0x5d8b=['MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues','name','then','catch','models'];(function(_0xb850d3,_0xa43ea6){var _0x53c961=function(_0x121d35){while(--_0x121d35){_0xb850d3['push'](_0xb850d3['shift']());}};_0x53c961(++_0xa43ea6);}(_0x5d8b,0x77));var _0xb5d8=function(_0xda3fbb,_0x40cc49){_0xda3fbb=_0xda3fbb-0x0;var _0x3b6716=_0x5d8b[_0xda3fbb];return _0x3b6716;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x1fe53f){var _0x548fb4=_0x1fe53f[_0xb5d8('0x0')];return _0x1fe53f['define'](_0xb5d8('0x1'),attributes,{'tableName':_0xb5d8('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x12bc09,_0x2e5345,_0x4a27c0){return _0x548fb4[_0xb5d8('0x3')][_0xb5d8('0x4')]({'value':_0x12bc09['name']},{'where':{'field':_0xb5d8('0x5'),'value':_0x12bc09[_0xb5d8('0x6')][_0xb5d8('0x7')]}})[_0xb5d8('0x8')](function(){_0x4a27c0();})[_0xb5d8('0x9')](function(_0x462058){_0x4a27c0(_0x462058);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index e09bd93..e8d28f5 100644 --- a/server/api/mailSubstatus/mailSubstatus.rpc.js +++ b/server/api/mailSubstatus/mailSubstatus.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf900=['code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xf900,0x146));var _0x0f90=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf900[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x0f90('0x0'));var util=require(_0x0f90('0x1'));var moment=require(_0x0f90('0x2'));var BPromise=require(_0x0f90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f90('0x4'))['db'];var utils=require(_0x0f90('0x5'));var logger=require(_0x0f90('0x6'))(_0x0f90('0x7'));var config=require(_0x0f90('0x8'));var jayson=require(_0x0f90('0x9'));var client=jayson['client'][_0x0f90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5263a4,_0x265af4,_0x3eb207){return new BPromise(function(_0x13f17e,_0x59f917){return client[_0x0f90('0xb')](_0x5263a4,_0x3eb207)['then'](function(_0x7577f){logger[_0x0f90('0xc')](_0x0f90('0xd'),_0x265af4,_0x0f90('0xe'));logger[_0x0f90('0xf')](_0x0f90('0x10'),_0x265af4,_0x0f90('0xe'),JSON[_0x0f90('0x11')](_0x7577f));if(_0x7577f['error']){if(_0x7577f[_0x0f90('0x12')][_0x0f90('0x13')]===0x1f4){logger[_0x0f90('0x12')](_0x0f90('0xd'),_0x265af4,_0x7577f[_0x0f90('0x12')][_0x0f90('0x14')]);return _0x59f917(_0x7577f[_0x0f90('0x12')][_0x0f90('0x14')]);}logger[_0x0f90('0x12')](_0x0f90('0xd'),_0x265af4,_0x7577f['error'][_0x0f90('0x14')]);return _0x13f17e(_0x7577f[_0x0f90('0x12')]['message']);}else{logger[_0x0f90('0xc')](_0x0f90('0xd'),_0x265af4,'request\x20sent');_0x13f17e(_0x7577f[_0x0f90('0x15')][_0x0f90('0x14')]);}})[_0x0f90('0x16')](function(_0x2d3b84){logger[_0x0f90('0x12')](_0x0f90('0xd'),_0x265af4,_0x2d3b84);_0x59f917(_0x2d3b84);});});} \ No newline at end of file +var _0x637a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x4364bf,_0x266759){var _0x13b177=function(_0x4e60c3){while(--_0x4e60c3){_0x4364bf['push'](_0x4364bf['shift']());}};_0x13b177(++_0x266759);}(_0x637a,0x132));var _0xa637=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x637a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa637('0x0'));var util=require(_0xa637('0x1'));var moment=require(_0xa637('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa637('0x3'));var db=require(_0xa637('0x4'))['db'];var utils=require(_0xa637('0x5'));var logger=require(_0xa637('0x6'))(_0xa637('0x7'));var config=require(_0xa637('0x8'));var jayson=require(_0xa637('0x9'));var client=jayson[_0xa637('0xa')][_0xa637('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a4288,_0xc43f08,_0x5ab5a2){return new BPromise(function(_0x455bc2,_0x10798d){return client[_0xa637('0xc')](_0x5a4288,_0x5ab5a2)[_0xa637('0xd')](function(_0x4a7df4){logger[_0xa637('0xe')]('MailSubstatus,\x20%s,\x20%s',_0xc43f08,_0xa637('0xf'));logger['debug'](_0xa637('0x10'),_0xc43f08,_0xa637('0xf'),JSON[_0xa637('0x11')](_0x4a7df4));if(_0x4a7df4[_0xa637('0x12')]){if(_0x4a7df4['error'][_0xa637('0x13')]===0x1f4){logger[_0xa637('0x12')](_0xa637('0x14'),_0xc43f08,_0x4a7df4[_0xa637('0x12')][_0xa637('0x15')]);return _0x10798d(_0x4a7df4['error'][_0xa637('0x15')]);}logger[_0xa637('0x12')](_0xa637('0x14'),_0xc43f08,_0x4a7df4[_0xa637('0x12')][_0xa637('0x15')]);return _0x455bc2(_0x4a7df4[_0xa637('0x12')][_0xa637('0x15')]);}else{logger[_0xa637('0xe')]('MailSubstatus,\x20%s,\x20%s',_0xc43f08,'request\x20sent');_0x455bc2(_0x4a7df4[_0xa637('0x16')][_0xa637('0x15')]);}})[_0xa637('0x17')](function(_0x159fb2){logger['error'](_0xa637('0x14'),_0xc43f08,_0x159fb2);_0x10798d(_0x159fb2);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 114c5cd..3340a2f 100644 --- a/server/api/mailTransferReport/index.js +++ b/server/api/mailTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc71e=['delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x50e1c3,_0x88f63c){var _0x31ac77=function(_0x162547){while(--_0x162547){_0x50e1c3['push'](_0x50e1c3['shift']());}};_0x31ac77(++_0x88f63c);}(_0xc71e,0x76));var _0xec71=function(_0x5518ff,_0x1a4afa){_0x5518ff=_0x5518ff-0x0;var _0x5547ee=_0xc71e[_0x5518ff];return _0x5547ee;};'use strict';var multer=require(_0xec71('0x0'));var util=require(_0xec71('0x1'));var path=require(_0xec71('0x2'));var timeout=require(_0xec71('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xec71('0x4'));var auth=require(_0xec71('0x5'));var interaction=require(_0xec71('0x6'));var config=require(_0xec71('0x7'));var controller=require(_0xec71('0x8'));router[_0xec71('0x9')]('/',auth['isAuthenticated'](),controller[_0xec71('0xa')]);router[_0xec71('0x9')](_0xec71('0xb'),auth['isAuthenticated'](),controller[_0xec71('0xc')]);router[_0xec71('0x9')](_0xec71('0xd'),auth[_0xec71('0xe')](),controller[_0xec71('0xf')]);router[_0xec71('0x10')]('/',auth['isAuthenticated'](),controller[_0xec71('0x11')]);router[_0xec71('0x12')](_0xec71('0xd'),auth[_0xec71('0xe')](),controller[_0xec71('0x13')]);router[_0xec71('0x14')](_0xec71('0xd'),auth['isAuthenticated'](),controller[_0xec71('0x15')]);module[_0xec71('0x16')]=router; \ No newline at end of file +var _0x065b=['../../config/environment','get','isAuthenticated','index','describe','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x175a8c,_0x2d9212){var _0x37b0b0=function(_0x20ef5f){while(--_0x20ef5f){_0x175a8c['push'](_0x175a8c['shift']());}};_0x37b0b0(++_0x2d9212);}(_0x065b,0x110));var _0xb065=function(_0x330e77,_0x2dd3c0){_0x330e77=_0x330e77-0x0;var _0xdbadea=_0x065b[_0x330e77];return _0xdbadea;};'use strict';var multer=require(_0xb065('0x0'));var util=require(_0xb065('0x1'));var path=require('path');var timeout=require(_0xb065('0x2'));var express=require(_0xb065('0x3'));var router=express[_0xb065('0x4')]();var fs_extra=require(_0xb065('0x5'));var auth=require(_0xb065('0x6'));var interaction=require(_0xb065('0x7'));var config=require(_0xb065('0x8'));var controller=require('./mailTransferReport.controller');router[_0xb065('0x9')]('/',auth[_0xb065('0xa')](),controller[_0xb065('0xb')]);router[_0xb065('0x9')]('/describe',auth[_0xb065('0xa')](),controller[_0xb065('0xc')]);router[_0xb065('0x9')]('/:id',auth[_0xb065('0xa')](),controller['show']);router[_0xb065('0xd')]('/',auth[_0xb065('0xa')](),controller[_0xb065('0xe')]);router[_0xb065('0xf')](_0xb065('0x10'),auth[_0xb065('0xa')](),controller['update']);router[_0xb065('0x11')](_0xb065('0x10'),auth[_0xb065('0xa')](),controller[_0xb065('0x12')]);module[_0xb065('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index b54f147..05bff8b 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x251bb4,_0x32b278){var _0x49ffc3=function(_0xbf8f69){while(--_0xbf8f69){_0x251bb4['push'](_0x251bb4['shift']());}};_0x49ffc3(++_0x32b278);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xcb91[_0x20589d];return _0x422de9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0x54ef,0x112));var _0xf54e=function(_0x3a5676,_0x1dff02){_0x3a5676=_0x3a5676-0x0;var _0x1c6e62=_0x54ef[_0x3a5676];return _0x1c6e62;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index e31da8a..a2e5e60 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe83=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','then','end','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','length','includeAll','options','find','create','body','update','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash'];(function(_0x56758b,_0x3cc287){var _0xbc862c=function(_0x35b9f6){while(--_0x35b9f6){_0x56758b['push'](_0x56758b['shift']());}};_0xbc862c(++_0x3cc287);}(_0xbe83,0x15e));var _0x3be8=function(_0x31e340,_0x859ae1){_0x31e340=_0x31e340-0x0;var _0x8b0bb7=_0xbe83[_0x31e340];return _0x8b0bb7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3be8('0x0'));var jsonpatch=require(_0x3be8('0x1'));var rp=require(_0x3be8('0x2'));var moment=require(_0x3be8('0x3'));var BPromise=require(_0x3be8('0x4'));var Mustache=require('mustache');var util=require(_0x3be8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x3be8('0x6'));var ejs=require(_0x3be8('0x7'));var fs=require('fs');var fs_extra=require(_0x3be8('0x8'));var _=require(_0x3be8('0x9'));var squel=require(_0x3be8('0xa'));var crypto=require(_0x3be8('0xb'));var jsforce=require(_0x3be8('0xc'));var deskjs=require(_0x3be8('0xd'));var toCsv=require(_0x3be8('0x6'));var querystring=require(_0x3be8('0xe'));var Papa=require(_0x3be8('0xf'));var Redis=require(_0x3be8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3be8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3be8('0x12'));var utils=require('../../config/utils');var config=require(_0x3be8('0x13'));var licenseUtil=require(_0x3be8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1de3eb,_0x3142ce){_0x3142ce=_0x3142ce||0xcc;return function(_0x1d219e){if(_0x1d219e){return _0x1de3eb[_0x3be8('0x15')](_0x3142ce);}return _0x1de3eb[_0x3be8('0x16')](_0x3142ce)['end']();};}function respondWithResult(_0x5c2462,_0x1c1edc){_0x1c1edc=_0x1c1edc||0xc8;return function(_0x49d861){if(_0x49d861){return _0x5c2462[_0x3be8('0x16')](_0x1c1edc)['json'](_0x49d861);}};}function respondWithFilteredResult(_0xb62648,_0x545ff4){return function(_0x4630bf){if(_0x4630bf){var _0x32e04c=typeof _0x545ff4['offset']===_0x3be8('0x17')&&typeof _0x545ff4[_0x3be8('0x18')]===_0x3be8('0x17');var _0x474523=_0x4630bf[_0x3be8('0x19')];var _0x4390c4=_0x32e04c?0x0:_0x545ff4[_0x3be8('0x1a')];var _0x17b4a8=_0x32e04c?_0x4630bf[_0x3be8('0x19')]:_0x545ff4[_0x3be8('0x1a')]+_0x545ff4[_0x3be8('0x18')];var _0x29c0b5;if(_0x17b4a8>=_0x474523){_0x17b4a8=_0x474523;_0x29c0b5=0xc8;}else{_0x29c0b5=0xce;}_0xb62648[_0x3be8('0x16')](_0x29c0b5);return _0xb62648[_0x3be8('0x1b')](_0x3be8('0x1c'),_0x4390c4+'-'+_0x17b4a8+'/'+_0x474523)[_0x3be8('0x1d')](_0x4630bf);}return null;};}function patchUpdates(_0x14b94e){return function(_0x120a1f){try{jsonpatch['apply'](_0x120a1f,_0x14b94e,!![]);}catch(_0x51cfc6){return BPromise[_0x3be8('0x1e')](_0x51cfc6);}return _0x120a1f[_0x3be8('0x1f')]();};}function saveUpdates(_0x14e445,_0x571761){return function(_0x23418e){if(_0x23418e){return _0x23418e['update'](_0x14e445)[_0x3be8('0x20')](function(_0x306949){return _0x306949;});}return null;};}function removeEntity(_0x262b53,_0x22978a){return function(_0x2d3d93){if(_0x2d3d93){return _0x2d3d93['destroy']()[_0x3be8('0x20')](function(){_0x262b53[_0x3be8('0x16')](0xcc)[_0x3be8('0x21')]();});}};}function handleEntityNotFound(_0x4952a6,_0x42d164){return function(_0x1e6c33){if(!_0x1e6c33){_0x4952a6[_0x3be8('0x15')](0x194);}return _0x1e6c33;};}function handleError(_0x1dce42,_0x24edde){_0x24edde=_0x24edde||0x1f4;return function(_0x4c6f19){logger[_0x3be8('0x22')](_0x4c6f19['stack']);if(_0x4c6f19[_0x3be8('0x23')]){delete _0x4c6f19['name'];}_0x1dce42[_0x3be8('0x16')](_0x24edde)[_0x3be8('0x24')](_0x4c6f19);};}exports[_0x3be8('0x25')]=function(_0x3be92e,_0x26621e){var _0x4e31e4={},_0x52943c={},_0x59a778={'count':0x0,'rows':[]};var _0x30d671=_[_0x3be8('0x26')](db[_0x3be8('0x27')][_0x3be8('0x28')],function(_0x228e35){return{'name':_0x228e35[_0x3be8('0x29')],'type':_0x228e35[_0x3be8('0x2a')][_0x3be8('0x2b')]};});_0x52943c[_0x3be8('0x2c')]=_[_0x3be8('0x26')](_0x30d671,_0x3be8('0x23'));_0x52943c[_0x3be8('0x2d')]=_[_0x3be8('0x2e')](_0x3be92e[_0x3be8('0x2d')]);_0x52943c[_0x3be8('0x2f')]=_[_0x3be8('0x30')](_0x52943c[_0x3be8('0x2c')],_0x52943c[_0x3be8('0x2d')]);_0x4e31e4['attributes']=_[_0x3be8('0x30')](_0x52943c[_0x3be8('0x2c')],qs['fields'](_0x3be92e[_0x3be8('0x2d')][_0x3be8('0x31')]));_0x4e31e4[_0x3be8('0x32')]=_0x4e31e4[_0x3be8('0x32')]['length']?_0x4e31e4['attributes']:_0x52943c[_0x3be8('0x2c')];if(!_0x3be92e[_0x3be8('0x2d')][_0x3be8('0x33')]('nolimit')){_0x4e31e4[_0x3be8('0x18')]=qs['limit'](_0x3be92e[_0x3be8('0x2d')]['limit']);_0x4e31e4[_0x3be8('0x1a')]=qs[_0x3be8('0x1a')](_0x3be92e['query'][_0x3be8('0x1a')]);}_0x4e31e4['order']=qs[_0x3be8('0x34')](_0x3be92e[_0x3be8('0x2d')][_0x3be8('0x34')]);_0x4e31e4['where']=qs[_0x3be8('0x2f')](_[_0x3be8('0x35')](_0x3be92e[_0x3be8('0x2d')],_0x52943c['filters']),_0x30d671);if(_0x3be92e[_0x3be8('0x2d')][_0x3be8('0x36')]){_0x4e31e4[_0x3be8('0x37')]=_[_0x3be8('0x38')](_0x4e31e4[_0x3be8('0x37')],{'$or':_[_0x3be8('0x26')](_0x30d671,function(_0x37e58a){if(_0x37e58a[_0x3be8('0x2a')]!==_0x3be8('0x39')){var _0x58f14f={};_0x58f14f[_0x37e58a['name']]={'$like':'%'+_0x3be92e['query'][_0x3be8('0x36')]+'%'};return _0x58f14f;}})});}_0x4e31e4=_[_0x3be8('0x38')]({},_0x4e31e4,_0x3be92e['options']);var _0x4c6564={'where':_0x4e31e4[_0x3be8('0x37')]};return db['MailTransferReport'][_0x3be8('0x19')](_0x4c6564)[_0x3be8('0x20')](function(_0x5830e6){_0x59a778[_0x3be8('0x19')]=_0x5830e6;if(_0x3be92e['query']['includeAll']){_0x4e31e4[_0x3be8('0x3a')]=[{'all':!![]}];}return db[_0x3be8('0x27')][_0x3be8('0x3b')](_0x4e31e4);})[_0x3be8('0x20')](function(_0x509baa){_0x59a778[_0x3be8('0x3c')]=_0x509baa;return _0x59a778;})[_0x3be8('0x20')](respondWithFilteredResult(_0x26621e,_0x4e31e4))[_0x3be8('0x3d')](handleError(_0x26621e,null));};exports[_0x3be8('0x3e')]=function(_0x11aa38,_0x5e721b){var _0x25929d={'raw':!![],'where':{'id':_0x11aa38['params']['id']}},_0x429da5={};_0x429da5[_0x3be8('0x2c')]=_[_0x3be8('0x2e')](db[_0x3be8('0x27')][_0x3be8('0x28')]);_0x429da5['query']=_[_0x3be8('0x2e')](_0x11aa38[_0x3be8('0x2d')]);_0x429da5['filters']=_[_0x3be8('0x30')](_0x429da5[_0x3be8('0x2c')],_0x429da5[_0x3be8('0x2d')]);_0x25929d[_0x3be8('0x32')]=_[_0x3be8('0x30')](_0x429da5[_0x3be8('0x2c')],qs[_0x3be8('0x31')](_0x11aa38['query'][_0x3be8('0x31')]));_0x25929d[_0x3be8('0x32')]=_0x25929d[_0x3be8('0x32')][_0x3be8('0x3f')]?_0x25929d[_0x3be8('0x32')]:_0x429da5[_0x3be8('0x2c')];if(_0x11aa38[_0x3be8('0x2d')][_0x3be8('0x40')]){_0x25929d['include']=[{'all':!![]}];}_0x25929d=_[_0x3be8('0x38')]({},_0x25929d,_0x11aa38[_0x3be8('0x41')]);return db[_0x3be8('0x27')][_0x3be8('0x42')](_0x25929d)[_0x3be8('0x20')](handleEntityNotFound(_0x5e721b,null))[_0x3be8('0x20')](respondWithResult(_0x5e721b,null))['catch'](handleError(_0x5e721b,null));};exports[_0x3be8('0x43')]=function(_0x30764c,_0x361d19){return db[_0x3be8('0x27')]['create'](_0x30764c[_0x3be8('0x44')],{})[_0x3be8('0x20')](respondWithResult(_0x361d19,0xc9))[_0x3be8('0x3d')](handleError(_0x361d19,null));};exports[_0x3be8('0x45')]=function(_0x15a2eb,_0x1d1907){if(_0x15a2eb[_0x3be8('0x44')]['id']){delete _0x15a2eb[_0x3be8('0x44')]['id'];}return db[_0x3be8('0x27')][_0x3be8('0x42')]({'where':{'id':_0x15a2eb[_0x3be8('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d1907,null))[_0x3be8('0x20')](saveUpdates(_0x15a2eb[_0x3be8('0x44')],null))[_0x3be8('0x20')](respondWithResult(_0x1d1907,null))[_0x3be8('0x3d')](handleError(_0x1d1907,null));};exports['destroy']=function(_0x24e2d4,_0x500257){return db[_0x3be8('0x27')]['find']({'where':{'id':_0x24e2d4['params']['id']}})[_0x3be8('0x20')](handleEntityNotFound(_0x500257,null))[_0x3be8('0x20')](removeEntity(_0x500257,null))[_0x3be8('0x3d')](handleError(_0x500257,null));};exports[_0x3be8('0x47')]=function(_0x55d1f7,_0x3af5cc){return db[_0x3be8('0x27')][_0x3be8('0x47')]()[_0x3be8('0x20')](respondWithResult(_0x3af5cc,null))[_0x3be8('0x3d')](handleError(_0x3af5cc,null));}; \ No newline at end of file +var _0xc244=['reject','update','then','destroy','end','stack','name','send','index','map','MailTransferReport','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x12807b,_0x7c0dfb){var _0x5a676e=function(_0x2cb9d9){while(--_0x2cb9d9){_0x12807b['push'](_0x12807b['shift']());}};_0x5a676e(++_0x7c0dfb);}(_0xc244,0x147));var _0x4c24=function(_0x134bad,_0x3af822){_0x134bad=_0x134bad-0x0;var _0x17f6a6=_0xc244[_0x134bad];return _0x17f6a6;};'use strict';var emlformat=require(_0x4c24('0x0'));var rimraf=require(_0x4c24('0x1'));var zipdir=require(_0x4c24('0x2'));var jsonpatch=require(_0x4c24('0x3'));var rp=require(_0x4c24('0x4'));var moment=require('moment');var BPromise=require(_0x4c24('0x5'));var Mustache=require(_0x4c24('0x6'));var util=require('util');var path=require(_0x4c24('0x7'));var sox=require(_0x4c24('0x8'));var csv=require(_0x4c24('0x9'));var ejs=require(_0x4c24('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4c24('0xb'));var crypto=require(_0x4c24('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4c24('0xd'));var Papa=require(_0x4c24('0xe'));var Redis=require(_0x4c24('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4c24('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c24('0x11'));var logger=require(_0x4c24('0x12'))('api');var utils=require(_0x4c24('0x13'));var config=require(_0x4c24('0x14'));var licenseUtil=require(_0x4c24('0x15'));var db=require(_0x4c24('0x16'))['db'];function respondWithStatusCode(_0x5106f3,_0x567878){_0x567878=_0x567878||0xcc;return function(_0xec0283){if(_0xec0283){return _0x5106f3[_0x4c24('0x17')](_0x567878);}return _0x5106f3[_0x4c24('0x18')](_0x567878)['end']();};}function respondWithResult(_0x59801f,_0x1a0f69){_0x1a0f69=_0x1a0f69||0xc8;return function(_0x3ecfa1){if(_0x3ecfa1){return _0x59801f[_0x4c24('0x18')](_0x1a0f69)[_0x4c24('0x19')](_0x3ecfa1);}};}function respondWithFilteredResult(_0x15e8bb,_0x125c0f){return function(_0x48d409){if(_0x48d409){var _0x462546=typeof _0x125c0f[_0x4c24('0x1a')]===_0x4c24('0x1b')&&typeof _0x125c0f['limit']===_0x4c24('0x1b');var _0x4b74d8=_0x48d409[_0x4c24('0x1c')];var _0x2b4565=_0x462546?0x0:_0x125c0f[_0x4c24('0x1a')];var _0x58d496=_0x462546?_0x48d409[_0x4c24('0x1c')]:_0x125c0f['offset']+_0x125c0f[_0x4c24('0x1d')];var _0x2c7c9f;if(_0x58d496>=_0x4b74d8){_0x58d496=_0x4b74d8;_0x2c7c9f=0xc8;}else{_0x2c7c9f=0xce;}_0x15e8bb['status'](_0x2c7c9f);return _0x15e8bb[_0x4c24('0x1e')](_0x4c24('0x1f'),_0x2b4565+'-'+_0x58d496+'/'+_0x4b74d8)[_0x4c24('0x19')](_0x48d409);}return null;};}function patchUpdates(_0x100211){return function(_0x118b6a){try{jsonpatch[_0x4c24('0x20')](_0x118b6a,_0x100211,!![]);}catch(_0x5870b5){return BPromise[_0x4c24('0x21')](_0x5870b5);}return _0x118b6a['save']();};}function saveUpdates(_0x296f61,_0x44644c){return function(_0x1bc4d9){if(_0x1bc4d9){return _0x1bc4d9[_0x4c24('0x22')](_0x296f61)[_0x4c24('0x23')](function(_0x43dbfc){return _0x43dbfc;});}return null;};}function removeEntity(_0x2a4b1e,_0x9d8102){return function(_0x847b61){if(_0x847b61){return _0x847b61[_0x4c24('0x24')]()[_0x4c24('0x23')](function(){_0x2a4b1e['status'](0xcc)[_0x4c24('0x25')]();});}};}function handleEntityNotFound(_0x2e2015,_0x451de4){return function(_0x24edda){if(!_0x24edda){_0x2e2015['sendStatus'](0x194);}return _0x24edda;};}function handleError(_0x1f6a1d,_0x18ef55){_0x18ef55=_0x18ef55||0x1f4;return function(_0x25c69c){logger['error'](_0x25c69c[_0x4c24('0x26')]);if(_0x25c69c[_0x4c24('0x27')]){delete _0x25c69c['name'];}_0x1f6a1d[_0x4c24('0x18')](_0x18ef55)[_0x4c24('0x28')](_0x25c69c);};}exports[_0x4c24('0x29')]=function(_0x2d6d33,_0x2fd724){var _0x3eb5ed={},_0x4400d8={},_0x4fd80f={'count':0x0,'rows':[]};var _0xc7e602=_[_0x4c24('0x2a')](db[_0x4c24('0x2b')][_0x4c24('0x2c')],function(_0x2e48bf){return{'name':_0x2e48bf['fieldName'],'type':_0x2e48bf[_0x4c24('0x2d')]['key']};});_0x4400d8[_0x4c24('0x2e')]=_[_0x4c24('0x2a')](_0xc7e602,_0x4c24('0x27'));_0x4400d8[_0x4c24('0x2f')]=_['keys'](_0x2d6d33[_0x4c24('0x2f')]);_0x4400d8[_0x4c24('0x30')]=_['intersection'](_0x4400d8[_0x4c24('0x2e')],_0x4400d8[_0x4c24('0x2f')]);_0x3eb5ed[_0x4c24('0x31')]=_[_0x4c24('0x32')](_0x4400d8[_0x4c24('0x2e')],qs[_0x4c24('0x33')](_0x2d6d33[_0x4c24('0x2f')][_0x4c24('0x33')]));_0x3eb5ed['attributes']=_0x3eb5ed[_0x4c24('0x31')][_0x4c24('0x34')]?_0x3eb5ed[_0x4c24('0x31')]:_0x4400d8[_0x4c24('0x2e')];if(!_0x2d6d33['query'][_0x4c24('0x35')](_0x4c24('0x36'))){_0x3eb5ed['limit']=qs['limit'](_0x2d6d33[_0x4c24('0x2f')][_0x4c24('0x1d')]);_0x3eb5ed[_0x4c24('0x1a')]=qs[_0x4c24('0x1a')](_0x2d6d33[_0x4c24('0x2f')]['offset']);}_0x3eb5ed['order']=qs[_0x4c24('0x37')](_0x2d6d33['query'][_0x4c24('0x37')]);_0x3eb5ed[_0x4c24('0x38')]=qs[_0x4c24('0x30')](_['pick'](_0x2d6d33[_0x4c24('0x2f')],_0x4400d8['filters']),_0xc7e602);if(_0x2d6d33[_0x4c24('0x2f')][_0x4c24('0x39')]){_0x3eb5ed[_0x4c24('0x38')]=_[_0x4c24('0x3a')](_0x3eb5ed['where'],{'$or':_[_0x4c24('0x2a')](_0xc7e602,function(_0x3d2481){if(_0x3d2481['type']!==_0x4c24('0x3b')){var _0x410d71={};_0x410d71[_0x3d2481[_0x4c24('0x27')]]={'$like':'%'+_0x2d6d33[_0x4c24('0x2f')][_0x4c24('0x39')]+'%'};return _0x410d71;}})});}_0x3eb5ed=_[_0x4c24('0x3a')]({},_0x3eb5ed,_0x2d6d33[_0x4c24('0x3c')]);var _0x54f64b={'where':_0x3eb5ed['where']};return db[_0x4c24('0x2b')][_0x4c24('0x1c')](_0x54f64b)[_0x4c24('0x23')](function(_0x3a4e97){_0x4fd80f[_0x4c24('0x1c')]=_0x3a4e97;if(_0x2d6d33[_0x4c24('0x2f')][_0x4c24('0x3d')]){_0x3eb5ed[_0x4c24('0x3e')]=[{'all':!![]}];}return db[_0x4c24('0x2b')]['findAll'](_0x3eb5ed);})[_0x4c24('0x23')](function(_0x291e73){_0x4fd80f[_0x4c24('0x3f')]=_0x291e73;return _0x4fd80f;})[_0x4c24('0x23')](respondWithFilteredResult(_0x2fd724,_0x3eb5ed))[_0x4c24('0x40')](handleError(_0x2fd724,null));};exports[_0x4c24('0x41')]=function(_0x301ce0,_0xfeca8a){var _0x369525={'raw':!![],'where':{'id':_0x301ce0[_0x4c24('0x42')]['id']}},_0x3f81d3={};_0x3f81d3[_0x4c24('0x2e')]=_['keys'](db[_0x4c24('0x2b')][_0x4c24('0x2c')]);_0x3f81d3[_0x4c24('0x2f')]=_[_0x4c24('0x43')](_0x301ce0[_0x4c24('0x2f')]);_0x3f81d3[_0x4c24('0x30')]=_[_0x4c24('0x32')](_0x3f81d3[_0x4c24('0x2e')],_0x3f81d3[_0x4c24('0x2f')]);_0x369525[_0x4c24('0x31')]=_[_0x4c24('0x32')](_0x3f81d3[_0x4c24('0x2e')],qs[_0x4c24('0x33')](_0x301ce0[_0x4c24('0x2f')]['fields']));_0x369525[_0x4c24('0x31')]=_0x369525[_0x4c24('0x31')][_0x4c24('0x34')]?_0x369525['attributes']:_0x3f81d3[_0x4c24('0x2e')];if(_0x301ce0[_0x4c24('0x2f')][_0x4c24('0x3d')]){_0x369525['include']=[{'all':!![]}];}_0x369525=_[_0x4c24('0x3a')]({},_0x369525,_0x301ce0[_0x4c24('0x3c')]);return db[_0x4c24('0x2b')]['find'](_0x369525)[_0x4c24('0x23')](handleEntityNotFound(_0xfeca8a,null))[_0x4c24('0x23')](respondWithResult(_0xfeca8a,null))[_0x4c24('0x40')](handleError(_0xfeca8a,null));};exports[_0x4c24('0x44')]=function(_0x32cac1,_0x41ae0a){return db[_0x4c24('0x2b')]['create'](_0x32cac1[_0x4c24('0x45')],{})[_0x4c24('0x23')](respondWithResult(_0x41ae0a,0xc9))['catch'](handleError(_0x41ae0a,null));};exports[_0x4c24('0x22')]=function(_0x2bd1fe,_0xa3a82){if(_0x2bd1fe['body']['id']){delete _0x2bd1fe['body']['id'];}return db[_0x4c24('0x2b')][_0x4c24('0x46')]({'where':{'id':_0x2bd1fe[_0x4c24('0x42')]['id']}})['then'](handleEntityNotFound(_0xa3a82,null))[_0x4c24('0x23')](saveUpdates(_0x2bd1fe[_0x4c24('0x45')],null))['then'](respondWithResult(_0xa3a82,null))[_0x4c24('0x40')](handleError(_0xa3a82,null));};exports[_0x4c24('0x24')]=function(_0x2549ef,_0x6b208d){return db['MailTransferReport'][_0x4c24('0x46')]({'where':{'id':_0x2549ef['params']['id']}})[_0x4c24('0x23')](handleEntityNotFound(_0x6b208d,null))[_0x4c24('0x23')](removeEntity(_0x6b208d,null))[_0x4c24('0x40')](handleError(_0x6b208d,null));};exports[_0x4c24('0x47')]=function(_0x354b79,_0x246f99){return db['MailTransferReport'][_0x4c24('0x47')]()[_0x4c24('0x23')](respondWithResult(_0x246f99,null))[_0x4c24('0x40')](handleError(_0x246f99,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 8571e3c..f9f50cd 100644 --- a/server/api/mailTransferReport/mailTransferReport.model.js +++ b/server/api/mailTransferReport/mailTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x102b=['define','MailTransferReport','report_mail_transfer','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x1f00d3,_0x561519){var _0xabf519=function(_0x2e418b){while(--_0x2e418b){_0x1f00d3['push'](_0x1f00d3['shift']());}};_0xabf519(++_0x561519);}(_0x102b,0x1be));var _0xb102=function(_0x2c1d75,_0x2091c0){_0x2c1d75=_0x2c1d75-0x0;var _0x510783=_0x102b[_0x2c1d75];return _0x510783;};'use strict';var _=require('lodash');var util=require(_0xb102('0x0'));var logger=require('../../config/logger')(_0xb102('0x1'));var moment=require(_0xb102('0x2'));var BPromise=require(_0xb102('0x3'));var rp=require(_0xb102('0x4'));var fs=require('fs');var path=require(_0xb102('0x5'));var rimraf=require(_0xb102('0x6'));var config=require(_0xb102('0x7'));var attributes=require(_0xb102('0x8'));module['exports']=function(_0x3325b7,_0x370baa){return _0x3325b7[_0xb102('0x9')](_0xb102('0xa'),attributes,{'tableName':_0xb102('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb102('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa24e=['define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','exports'];(function(_0x30207d,_0x9a4466){var _0x282210=function(_0x3f0b7b){while(--_0x3f0b7b){_0x30207d['push'](_0x30207d['shift']());}};_0x282210(++_0x9a4466);}(_0xa24e,0x137));var _0xea24=function(_0x205ed2,_0x248ed0){_0x205ed2=_0x205ed2-0x0;var _0x540c3b=_0xa24e[_0x205ed2];return _0x540c3b;};'use strict';var _=require(_0xea24('0x0'));var util=require(_0xea24('0x1'));var logger=require(_0xea24('0x2'))(_0xea24('0x3'));var moment=require(_0xea24('0x4'));var BPromise=require(_0xea24('0x5'));var rp=require(_0xea24('0x6'));var fs=require('fs');var path=require(_0xea24('0x7'));var rimraf=require(_0xea24('0x8'));var config=require('../../config/environment');var attributes=require(_0xea24('0x9'));module[_0xea24('0xa')]=function(_0x36b376,_0x2534a6){return _0x36b376[_0xea24('0xb')]('MailTransferReport',attributes,{'tableName':_0xea24('0xc'),'paranoid':![],'indexes':[{'name':_0xea24('0xd'),'fields':[_0xea24('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index a810382..8cea60b 100644 --- a/server/api/mailTransferReport/mailTransferReport.rpc.js +++ b/server/api/mailTransferReport/mailTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc39b=['request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','then','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x5c8c55,_0x4f9ff0){var _0x5981fa=function(_0x20cd71){while(--_0x20cd71){_0x5c8c55['push'](_0x5c8c55['shift']());}};_0x5981fa(++_0x4f9ff0);}(_0xc39b,0x1c0));var _0xbc39=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xc39b[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0xbc39('0x0'));var util=require(_0xbc39('0x1'));var moment=require(_0xbc39('0x2'));var BPromise=require(_0xbc39('0x3'));var rs=require(_0xbc39('0x4'));var fs=require('fs');var Redis=require(_0xbc39('0x5'));var db=require(_0xbc39('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbc39('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc39('0x8')][_0xbc39('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1110e7,_0x292bc6,_0x228374){return new BPromise(function(_0x547a99,_0x2dabc6){return client['request'](_0x1110e7,_0x228374)[_0xbc39('0xa')](function(_0x55695f){logger['info'](_0xbc39('0xb'),_0x292bc6,'request\x20sent');logger[_0xbc39('0xc')](_0xbc39('0xd'),_0x292bc6,_0xbc39('0xe'),JSON[_0xbc39('0xf')](_0x55695f));if(_0x55695f[_0xbc39('0x10')]){if(_0x55695f[_0xbc39('0x10')]['code']===0x1f4){logger[_0xbc39('0x10')](_0xbc39('0xb'),_0x292bc6,_0x55695f['error']['message']);return _0x2dabc6(_0x55695f[_0xbc39('0x10')][_0xbc39('0x11')]);}logger['error'](_0xbc39('0xb'),_0x292bc6,_0x55695f[_0xbc39('0x10')][_0xbc39('0x11')]);return _0x547a99(_0x55695f[_0xbc39('0x10')][_0xbc39('0x11')]);}else{logger[_0xbc39('0x12')](_0xbc39('0xb'),_0x292bc6,'request\x20sent');_0x547a99(_0x55695f[_0xbc39('0x13')][_0xbc39('0x11')]);}})[_0xbc39('0x14')](function(_0x1ab991){logger[_0xbc39('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x292bc6,_0x1ab991);_0x2dabc6(_0x1ab991);});});} \ No newline at end of file +var _0x74c0=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb'];(function(_0x5bf629,_0x3b0336){var _0x3880af=function(_0x2a287a){while(--_0x2a287a){_0x5bf629['push'](_0x5bf629['shift']());}};_0x3880af(++_0x3b0336);}(_0x74c0,0xcb));var _0x074c=function(_0x5e4e74,_0x53b7a5){_0x5e4e74=_0x5e4e74-0x0;var _0x217a4a=_0x74c0[_0x5e4e74];return _0x217a4a;};'use strict';var _=require('lodash');var util=require(_0x074c('0x0'));var moment=require(_0x074c('0x1'));var BPromise=require('bluebird');var rs=require(_0x074c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x074c('0x3'))['db'];var utils=require(_0x074c('0x4'));var logger=require(_0x074c('0x5'))(_0x074c('0x6'));var config=require(_0x074c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x074c('0x8')][_0x074c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f1fb7,_0x4c54e7,_0x25b264){return new BPromise(function(_0x5d7f72,_0xe414b9){return client[_0x074c('0xa')](_0x4f1fb7,_0x25b264)[_0x074c('0xb')](function(_0x56c926){logger[_0x074c('0xc')](_0x074c('0xd'),_0x4c54e7,_0x074c('0xe'));logger[_0x074c('0xf')](_0x074c('0x10'),_0x4c54e7,_0x074c('0xe'),JSON[_0x074c('0x11')](_0x56c926));if(_0x56c926[_0x074c('0x12')]){if(_0x56c926['error'][_0x074c('0x13')]===0x1f4){logger[_0x074c('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x4c54e7,_0x56c926[_0x074c('0x12')][_0x074c('0x14')]);return _0xe414b9(_0x56c926[_0x074c('0x12')][_0x074c('0x14')]);}logger[_0x074c('0x12')](_0x074c('0xd'),_0x4c54e7,_0x56c926[_0x074c('0x12')][_0x074c('0x14')]);return _0x5d7f72(_0x56c926['error']['message']);}else{logger[_0x074c('0xc')](_0x074c('0xd'),_0x4c54e7,'request\x20sent');_0x5d7f72(_0x56c926[_0x074c('0x15')][_0x074c('0x14')]);}})[_0x074c('0x16')](function(_0x38e486){logger[_0x074c('0x12')](_0x074c('0xd'),_0x4c54e7,_0x38e486);_0xe414b9(_0x38e486);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index eae4bab..f270fd4 100644 --- a/server/api/memberReport/index.js +++ b/server/api/memberReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee28=['update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x4ae5b9,_0x4a42d2){var _0x3f94f4=function(_0x324f87){while(--_0x324f87){_0x4ae5b9['push'](_0x4ae5b9['shift']());}};_0x3f94f4(++_0x4a42d2);}(_0xee28,0xf3));var _0x8ee2=function(_0x3deb59,_0x4cdcdf){_0x3deb59=_0x3deb59-0x0;var _0x440fd9=_0xee28[_0x3deb59];return _0x440fd9;};'use strict';var multer=require(_0x8ee2('0x0'));var util=require('util');var path=require(_0x8ee2('0x1'));var timeout=require(_0x8ee2('0x2'));var express=require(_0x8ee2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8ee2('0x4'));var config=require(_0x8ee2('0x5'));var controller=require(_0x8ee2('0x6'));router[_0x8ee2('0x7')]('/',auth[_0x8ee2('0x8')](),controller[_0x8ee2('0x9')]);router['get'](_0x8ee2('0xa'),auth['isAuthenticated'](),controller[_0x8ee2('0xb')]);router[_0x8ee2('0x7')](_0x8ee2('0xc'),auth[_0x8ee2('0x8')](),controller[_0x8ee2('0xd')]);router[_0x8ee2('0xe')]('/',auth['isAuthenticated'](),controller[_0x8ee2('0xf')]);router[_0x8ee2('0x10')](_0x8ee2('0xc'),auth[_0x8ee2('0x8')](),controller[_0x8ee2('0x11')]);router['delete'](_0x8ee2('0xc'),auth['isAuthenticated'](),controller[_0x8ee2('0x12')]);module[_0x8ee2('0x13')]=router; \ No newline at end of file +var _0x6be3=['show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x21b2dd,_0x5118fc){var _0x2b40fa=function(_0x2a7f73){while(--_0x2a7f73){_0x21b2dd['push'](_0x21b2dd['shift']());}};_0x2b40fa(++_0x5118fc);}(_0x6be3,0x1e7));var _0x36be=function(_0x4e18bb,_0x2b28df){_0x4e18bb=_0x4e18bb-0x0;var _0x5ebf1f=_0x6be3[_0x4e18bb];return _0x5ebf1f;};'use strict';var multer=require(_0x36be('0x0'));var util=require(_0x36be('0x1'));var path=require('path');var timeout=require(_0x36be('0x2'));var express=require(_0x36be('0x3'));var router=express[_0x36be('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x36be('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x36be('0x6'));router[_0x36be('0x7')]('/',auth[_0x36be('0x8')](),controller[_0x36be('0x9')]);router['get'](_0x36be('0xa'),auth[_0x36be('0x8')](),controller[_0x36be('0xb')]);router[_0x36be('0x7')](_0x36be('0xc'),auth[_0x36be('0x8')](),controller[_0x36be('0xd')]);router[_0x36be('0xe')]('/',auth[_0x36be('0x8')](),controller[_0x36be('0xf')]);router[_0x36be('0x10')]('/:id',auth[_0x36be('0x8')](),controller[_0x36be('0x11')]);router[_0x36be('0x12')](_0x36be('0xc'),auth[_0x36be('0x8')](),controller['destroy']);module[_0x36be('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 265c314..8535989 100644 --- a/server/api/memberReport/memberReport.attributes.js +++ b/server/api/memberReport/memberReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc95d=['seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x5a6a1f,_0x5ce170){var _0x1a17bd=function(_0x5012da){while(--_0x5012da){_0x5a6a1f['push'](_0x5a6a1f['shift']());}};_0x1a17bd(++_0x5ce170);}(_0xc95d,0x118));var _0xdc95=function(_0x2b569a,_0x3cd1d6){_0x2b569a=_0x2b569a-0x0;var _0x43ca1f=_0xc95d[_0x2b569a];return _0x43ca1f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdc95('0x0'));module[_0xdc95('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xdc95('0x2')]},'interface':{'type':Sequelize[_0xdc95('0x2')]},'type':{'type':Sequelize[_0xdc95('0x2')],'defaultValue':_0xdc95('0x3'),'comment':_0xdc95('0x4')},'duration':{'type':Sequelize[_0xdc95('0x5')]},'enterAt':{'type':Sequelize[_0xdc95('0x6')]},'exitAt':{'type':Sequelize[_0xdc95('0x6')],'set':function(_0x57bef6){var _0x37e418=moment(_0x57bef6);var _0x79d873=moment(this[_0xdc95('0x7')](_0xdc95('0x8')));var _0x7d2eb1=_0x37e418['diff'](_0x79d873,_0xdc95('0x9'));this[_0xdc95('0xa')](_0xdc95('0xb'),_0x57bef6);this[_0xdc95('0xa')](_0xdc95('0xc'),_0x7d2eb1>=0x0?_0x7d2eb1:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xdc95('0xd')},'data2':{'type':Sequelize[_0xdc95('0x2')],'comment':_0xdc95('0xe')},'data3':{'type':Sequelize[_0xdc95('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0xdc95('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0xdc95('0x10')},'role':{'type':Sequelize[_0xdc95('0x2')]},'internal':{'type':Sequelize[_0xdc95('0x5')]},'uniqueid':{'type':Sequelize[_0xdc95('0x2')]}}; \ No newline at end of file +var _0xdbb2=['sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]','talk:[queue]','INTEGER'];(function(_0x422158,_0x4df38c){var _0x5ef9f9=function(_0x55dda0){while(--_0x55dda0){_0x422158['push'](_0x422158['shift']());}};_0x5ef9f9(++_0x4df38c);}(_0xdbb2,0x1c0));var _0x2dbb=function(_0x4f39fd,_0x36d85f){_0x4f39fd=_0x4f39fd-0x0;var _0x4ef809=_0xdbb2[_0x4f39fd];return _0x4ef809;};'use strict';var Sequelize=require(_0x2dbb('0x0'));var moment=require(_0x2dbb('0x1'));module[_0x2dbb('0x2')]={'channel':{'type':Sequelize[_0x2dbb('0x3')]},'membername':{'type':Sequelize[_0x2dbb('0x3')]},'interface':{'type':Sequelize[_0x2dbb('0x3')]},'type':{'type':Sequelize[_0x2dbb('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x2dbb('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x2dbb('0x5')]},'exitAt':{'type':Sequelize[_0x2dbb('0x5')],'set':function(_0x1a5825){var _0x1df8dd=moment(_0x1a5825);var _0x19e106=moment(this['getDataValue'](_0x2dbb('0x6')));var _0x193197=_0x1df8dd[_0x2dbb('0x7')](_0x19e106,_0x2dbb('0x8'));this[_0x2dbb('0x9')](_0x2dbb('0xa'),_0x1a5825);this['setDataValue'](_0x2dbb('0xb'),_0x193197>=0x0?_0x193197:null);}},'data1':{'type':Sequelize[_0x2dbb('0x3')],'comment':_0x2dbb('0xc')},'data2':{'type':Sequelize[_0x2dbb('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x2dbb('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x2dbb('0x3')],'comment':_0x2dbb('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x2dbb('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x2dbb('0xf')]},'uniqueid':{'type':Sequelize[_0x2dbb('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index e83644a..c8c5dcf 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x55ca,0x126));var _0xa55c=function(_0x460f81,_0x553431){_0x460f81=_0x460f81-0x0;var _0x423f0d=_0x55ca[_0x460f81];return _0x423f0d;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0xb87f20,_0x4ae8f5){var _0x5e02bb=function(_0x2611ec){while(--_0x2611ec){_0xb87f20['push'](_0xb87f20['shift']());}};_0x5e02bb(++_0x4ae8f5);}(_0x008c,0x188));var _0xc008=function(_0x2c93a2,_0x1c1e3b){_0x2c93a2=_0x2c93a2-0x0;var _0x5bde6c=_0x008c[_0x2c93a2];return _0x5bde6c;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index d060bd4..5a96a9c 100644 --- a/server/api/memberReport/memberReport.model.js +++ b/server/api/memberReport/memberReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb07=['../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0xbb07,0xf0));var _0x7bb0=function(_0x358047,_0x413080){_0x358047=_0x358047-0x0;var _0x4776f9=_0xbb07[_0x358047];return _0x4776f9;};'use strict';var _=require(_0x7bb0('0x0'));var util=require(_0x7bb0('0x1'));var logger=require(_0x7bb0('0x2'))(_0x7bb0('0x3'));var moment=require(_0x7bb0('0x4'));var BPromise=require(_0x7bb0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7bb0('0x6'));var rimraf=require('rimraf');var config=require(_0x7bb0('0x7'));var attributes=require(_0x7bb0('0x8'));module['exports']=function(_0x5ac6f5,_0x1f1c2c){return _0x5ac6f5[_0x7bb0('0x9')](_0x7bb0('0xa'),attributes,{'tableName':_0x7bb0('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x7bb0('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf935=['../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x1de125,_0x4fe551){var _0x44db47=function(_0xe70d0d){while(--_0xe70d0d){_0x1de125['push'](_0x1de125['shift']());}};_0x44db47(++_0x4fe551);}(_0xf935,0xbc));var _0x5f93=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf935[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5f93('0x0'));var util=require(_0x5f93('0x1'));var logger=require(_0x5f93('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5f93('0x3'));var rp=require(_0x5f93('0x4'));var fs=require('fs');var path=require(_0x5f93('0x5'));var rimraf=require(_0x5f93('0x6'));var config=require(_0x5f93('0x7'));var attributes=require(_0x5f93('0x8'));module[_0x5f93('0x9')]=function(_0x43e179,_0x307412){return _0x43e179['define'](_0x5f93('0xa'),attributes,{'tableName':_0x5f93('0xb'),'paranoid':![],'indexes':[{'name':_0x5f93('0xc'),'fields':[_0x5f93('0xd'),_0x5f93('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 54a0cd9..1c22a0f 100644 --- a/server/api/memberReport/memberReport.rpc.js +++ b/server/api/memberReport/memberReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x195f=['attributes','GetMemberReport','stringify','CreateMemberReport','create','body','raw','UpdateMemberReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','MemberReport','options','where','limit','include','map','model'];(function(_0x21e3d4,_0x1ace2a){var _0x3e403f=function(_0x373aac){while(--_0x373aac){_0x21e3d4['push'](_0x21e3d4['shift']());}};_0x3e403f(++_0x1ace2a);}(_0x195f,0x113));var _0xf195=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0x195f[_0x56e32e];return _0x2a757b;};'use strict';var _=require(_0xf195('0x0'));var util=require(_0xf195('0x1'));var moment=require('moment');var BPromise=require(_0xf195('0x2'));var rs=require(_0xf195('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf195('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf195('0x5'))(_0xf195('0x6'));var config=require(_0xf195('0x7'));var jayson=require(_0xf195('0x8'));var client=jayson[_0xf195('0x9')][_0xf195('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2770db,_0x59d783,_0x5eac33){return new BPromise(function(_0x327cc3,_0x15d465){return client[_0xf195('0xb')](_0x2770db,_0x5eac33)[_0xf195('0xc')](function(_0x7b3e6f){logger[_0xf195('0xd')](_0xf195('0xe'),_0x59d783,'request\x20sent');logger[_0xf195('0xf')](_0xf195('0x10'),_0x59d783,_0xf195('0x11'),JSON['stringify'](_0x7b3e6f));if(_0x7b3e6f[_0xf195('0x12')]){if(_0x7b3e6f[_0xf195('0x12')][_0xf195('0x13')]===0x1f4){logger[_0xf195('0x12')]('MemberReport,\x20%s,\x20%s',_0x59d783,_0x7b3e6f[_0xf195('0x12')][_0xf195('0x14')]);return _0x15d465(_0x7b3e6f['error'][_0xf195('0x14')]);}logger['error'](_0xf195('0xe'),_0x59d783,_0x7b3e6f[_0xf195('0x12')][_0xf195('0x14')]);return _0x327cc3(_0x7b3e6f[_0xf195('0x12')][_0xf195('0x14')]);}else{logger[_0xf195('0xd')](_0xf195('0xe'),_0x59d783,_0xf195('0x11'));_0x327cc3(_0x7b3e6f['result']['message']);}})[_0xf195('0x15')](function(_0x3ad05f){logger[_0xf195('0x12')](_0xf195('0xe'),_0x59d783,_0x3ad05f);_0x15d465(_0x3ad05f);});});}exports['GetMemberReport']=function(_0x374fc6){var _0x1ae33e=this;return new Promise(function(_0x5cf7dc,_0x452931){return db[_0xf195('0x16')]['findAll']({'raw':_0x374fc6[_0xf195('0x17')]?_0x374fc6[_0xf195('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x374fc6[_0xf195('0x17')]?_0x374fc6[_0xf195('0x17')][_0xf195('0x18')]||null:null,'attributes':_0x374fc6[_0xf195('0x17')]?_0x374fc6['options']['attributes']||null:null,'limit':_0x374fc6['options']?_0x374fc6[_0xf195('0x17')][_0xf195('0x19')]||null:null,'include':_0x374fc6[_0xf195('0x17')]?_0x374fc6[_0xf195('0x17')][_0xf195('0x1a')]?_[_0xf195('0x1b')](_0x374fc6[_0xf195('0x17')][_0xf195('0x1a')],function(_0x45cfa4){return{'model':db[_0x45cfa4[_0xf195('0x1c')]],'as':_0x45cfa4['as'],'attributes':_0x45cfa4[_0xf195('0x1d')],'include':_0x45cfa4[_0xf195('0x1a')]?_['map'](_0x45cfa4[_0xf195('0x1a')],function(_0x246750){return{'model':db[_0x246750[_0xf195('0x1c')]],'as':_0x246750['as'],'attributes':_0x246750[_0xf195('0x1d')],'include':_0x246750[_0xf195('0x1a')]?_[_0xf195('0x1b')](_0x246750[_0xf195('0x1a')],function(_0x3c1371){return{'model':db[_0x3c1371['model']],'as':_0x3c1371['as'],'attributes':_0x3c1371['attributes']};}):[]};}):[]};}):[]:[]})[_0xf195('0xc')](function(_0x37d9e9){logger[_0xf195('0xd')](_0xf195('0x1e'),_0x374fc6);logger[_0xf195('0xf')](_0xf195('0x1e'),_0x374fc6,JSON[_0xf195('0x1f')](_0x37d9e9));_0x5cf7dc(_0x37d9e9);})[_0xf195('0x15')](function(_0x5dbca){logger[_0xf195('0x12')](_0xf195('0x1e'),_0x5dbca[_0xf195('0x14')],_0x374fc6);_0x452931(_0x1ae33e[_0xf195('0x12')](0x1f4,_0x5dbca[_0xf195('0x14')]));});});};exports[_0xf195('0x20')]=function(_0x245a06){var _0x20e0e3=this;return new Promise(function(_0x26f511,_0xdd63ec){return db['MemberReport'][_0xf195('0x21')](_0x245a06[_0xf195('0x22')],{'raw':_0x245a06[_0xf195('0x17')]?_0x245a06[_0xf195('0x17')][_0xf195('0x23')]===undefined?!![]:![]:!![]})[_0xf195('0xc')](function(_0x12b169){logger[_0xf195('0xd')](_0xf195('0x20'),_0x245a06);logger[_0xf195('0xf')](_0xf195('0x20'),_0x245a06,JSON[_0xf195('0x1f')](_0x12b169));_0x26f511(_0x12b169);})[_0xf195('0x15')](function(_0x9eff93){logger[_0xf195('0x12')](_0xf195('0x20'),_0x9eff93[_0xf195('0x14')],_0x245a06);_0xdd63ec(_0x20e0e3['error'](0x1f4,_0x9eff93[_0xf195('0x14')]));});});};exports[_0xf195('0x24')]=function(_0x2d0ef1){var _0xc0a617=this;return new Promise(function(_0x32e5ee,_0x58a1a9){return db[_0xf195('0x16')][_0xf195('0x25')](_0x2d0ef1[_0xf195('0x22')],{'raw':_0x2d0ef1['options']?_0x2d0ef1['options'][_0xf195('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d0ef1[_0xf195('0x17')]?_0x2d0ef1[_0xf195('0x17')][_0xf195('0x18')]||null:null,'attributes':_0x2d0ef1[_0xf195('0x17')]?_0x2d0ef1[_0xf195('0x17')][_0xf195('0x1d')]||null:null,'limit':_0x2d0ef1[_0xf195('0x17')]?_0x2d0ef1[_0xf195('0x17')][_0xf195('0x19')]||null:null})['then'](function(_0x4eaa8c){logger[_0xf195('0xd')](_0xf195('0x24'),_0x2d0ef1);logger[_0xf195('0xf')](_0xf195('0x24'),_0x2d0ef1,JSON[_0xf195('0x1f')](_0x4eaa8c));_0x32e5ee(_0x4eaa8c);})[_0xf195('0x15')](function(_0x11958c){logger[_0xf195('0x12')]('UpdateMemberReport',_0x11958c[_0xf195('0x14')],_0x2d0ef1);_0x58a1a9(_0xc0a617['error'](0x1f4,_0x11958c['message']));});});}; \ No newline at end of file +var _0x0eb2=['result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','model','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4fcbec,_0x90e467){var _0x275177=function(_0x1f706b){while(--_0x1f706b){_0x4fcbec['push'](_0x4fcbec['shift']());}};_0x275177(++_0x90e467);}(_0x0eb2,0x11c));var _0x20eb=function(_0x5cb326,_0x51c573){_0x5cb326=_0x5cb326-0x0;var _0x509f3d=_0x0eb2[_0x5cb326];return _0x509f3d;};'use strict';var _=require(_0x20eb('0x0'));var util=require('util');var moment=require(_0x20eb('0x1'));var BPromise=require(_0x20eb('0x2'));var rs=require(_0x20eb('0x3'));var fs=require('fs');var Redis=require(_0x20eb('0x4'));var db=require(_0x20eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x20eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x20eb('0x7')][_0x20eb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19940,_0x4a7e1a,_0x3dfc09){return new BPromise(function(_0x2093eb,_0x4443ea){return client[_0x20eb('0x9')](_0x19940,_0x3dfc09)[_0x20eb('0xa')](function(_0x20a0e0){logger[_0x20eb('0xb')](_0x20eb('0xc'),_0x4a7e1a,_0x20eb('0xd'));logger[_0x20eb('0xe')](_0x20eb('0xf'),_0x4a7e1a,_0x20eb('0xd'),JSON[_0x20eb('0x10')](_0x20a0e0));if(_0x20a0e0[_0x20eb('0x11')]){if(_0x20a0e0['error'][_0x20eb('0x12')]===0x1f4){logger['error'](_0x20eb('0xc'),_0x4a7e1a,_0x20a0e0['error'][_0x20eb('0x13')]);return _0x4443ea(_0x20a0e0[_0x20eb('0x11')][_0x20eb('0x13')]);}logger[_0x20eb('0x11')](_0x20eb('0xc'),_0x4a7e1a,_0x20a0e0[_0x20eb('0x11')][_0x20eb('0x13')]);return _0x2093eb(_0x20a0e0[_0x20eb('0x11')][_0x20eb('0x13')]);}else{logger[_0x20eb('0xb')](_0x20eb('0xc'),_0x4a7e1a,_0x20eb('0xd'));_0x2093eb(_0x20a0e0[_0x20eb('0x14')][_0x20eb('0x13')]);}})[_0x20eb('0x15')](function(_0x5a6d1d){logger[_0x20eb('0x11')]('MemberReport,\x20%s,\x20%s',_0x4a7e1a,_0x5a6d1d);_0x4443ea(_0x5a6d1d);});});}exports[_0x20eb('0x16')]=function(_0x21765e){var _0x28ae67=this;return new Promise(function(_0x3c083a,_0x4144c1){return db[_0x20eb('0x17')][_0x20eb('0x18')]({'raw':_0x21765e['options']?_0x21765e[_0x20eb('0x19')][_0x20eb('0x1a')]===undefined?!![]:![]:!![],'where':_0x21765e['options']?_0x21765e[_0x20eb('0x19')][_0x20eb('0x1b')]||null:null,'attributes':_0x21765e['options']?_0x21765e[_0x20eb('0x19')][_0x20eb('0x1c')]||null:null,'limit':_0x21765e[_0x20eb('0x19')]?_0x21765e['options'][_0x20eb('0x1d')]||null:null,'include':_0x21765e[_0x20eb('0x19')]?_0x21765e[_0x20eb('0x19')]['include']?_[_0x20eb('0x1e')](_0x21765e[_0x20eb('0x19')][_0x20eb('0x1f')],function(_0x5dc978){return{'model':db[_0x5dc978[_0x20eb('0x20')]],'as':_0x5dc978['as'],'attributes':_0x5dc978['attributes'],'include':_0x5dc978[_0x20eb('0x1f')]?_[_0x20eb('0x1e')](_0x5dc978[_0x20eb('0x1f')],function(_0x3b88b3){return{'model':db[_0x3b88b3[_0x20eb('0x20')]],'as':_0x3b88b3['as'],'attributes':_0x3b88b3[_0x20eb('0x1c')],'include':_0x3b88b3[_0x20eb('0x1f')]?_[_0x20eb('0x1e')](_0x3b88b3[_0x20eb('0x1f')],function(_0x58b8c3){return{'model':db[_0x58b8c3[_0x20eb('0x20')]],'as':_0x58b8c3['as'],'attributes':_0x58b8c3[_0x20eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x20eb('0xa')](function(_0x5117c7){logger['info']('GetMemberReport',_0x21765e);logger['debug'](_0x20eb('0x16'),_0x21765e,JSON[_0x20eb('0x10')](_0x5117c7));_0x3c083a(_0x5117c7);})['catch'](function(_0x155752){logger['error'](_0x20eb('0x16'),_0x155752['message'],_0x21765e);_0x4144c1(_0x28ae67['error'](0x1f4,_0x155752[_0x20eb('0x13')]));});});};exports[_0x20eb('0x21')]=function(_0x4fb803){var _0x5abe40=this;return new Promise(function(_0xfa014d,_0x3ae2b0){return db['MemberReport'][_0x20eb('0x22')](_0x4fb803[_0x20eb('0x23')],{'raw':_0x4fb803['options']?_0x4fb803[_0x20eb('0x19')][_0x20eb('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xfd5c6b){logger['info'](_0x20eb('0x21'),_0x4fb803);logger[_0x20eb('0xe')](_0x20eb('0x21'),_0x4fb803,JSON['stringify'](_0xfd5c6b));_0xfa014d(_0xfd5c6b);})[_0x20eb('0x15')](function(_0x6d6920){logger[_0x20eb('0x11')](_0x20eb('0x21'),_0x6d6920['message'],_0x4fb803);_0x3ae2b0(_0x5abe40[_0x20eb('0x11')](0x1f4,_0x6d6920[_0x20eb('0x13')]));});});};exports[_0x20eb('0x24')]=function(_0x4546e8){var _0x20473b=this;return new Promise(function(_0x10cd8f,_0x62c876){return db[_0x20eb('0x17')][_0x20eb('0x25')](_0x4546e8[_0x20eb('0x23')],{'raw':_0x4546e8[_0x20eb('0x19')]?_0x4546e8['options'][_0x20eb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4546e8[_0x20eb('0x19')]?_0x4546e8[_0x20eb('0x19')][_0x20eb('0x1b')]||null:null,'attributes':_0x4546e8['options']?_0x4546e8[_0x20eb('0x19')][_0x20eb('0x1c')]||null:null,'limit':_0x4546e8[_0x20eb('0x19')]?_0x4546e8['options'][_0x20eb('0x1d')]||null:null})[_0x20eb('0xa')](function(_0x185c0c){logger[_0x20eb('0xb')](_0x20eb('0x24'),_0x4546e8);logger[_0x20eb('0xe')](_0x20eb('0x24'),_0x4546e8,JSON[_0x20eb('0x10')](_0x185c0c));_0x10cd8f(_0x185c0c);})[_0x20eb('0x15')](function(_0x193c9c){logger['error'](_0x20eb('0x24'),_0x193c9c['message'],_0x4546e8);_0x62c876(_0x20473b[_0x20eb('0x11')](0x1f4,_0x193c9c[_0x20eb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 3799bd8..2b7a9e2 100644 --- a/server/api/migration/index.js +++ b/server/api/migration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e9=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','exports','multer'];(function(_0x10fe03,_0x1eaa5a){var _0x415274=function(_0x4ed2a3){while(--_0x4ed2a3){_0x10fe03['push'](_0x10fe03['shift']());}};_0x415274(++_0x1eaa5a);}(_0x34e9,0x167));var _0x934e=function(_0x3900df,_0x25cb12){_0x3900df=_0x3900df-0x0;var _0x570ecd=_0x34e9[_0x3900df];return _0x570ecd;};'use strict';var multer=require(_0x934e('0x0'));var util=require(_0x934e('0x1'));var path=require(_0x934e('0x2'));var timeout=require(_0x934e('0x3'));var express=require('express');var router=express[_0x934e('0x4')]();var fs_extra=require(_0x934e('0x5'));var auth=require(_0x934e('0x6'));var interaction=require(_0x934e('0x7'));var config=require(_0x934e('0x8'));var controller=require('./migration.controller');router[_0x934e('0x9')]('/',controller[_0x934e('0xa')]);module[_0x934e('0xb')]=router; \ No newline at end of file +var _0x0aae=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','index','exports','multer','util','path','connect-timeout'];(function(_0x3b934f,_0x59dc45){var _0x136c82=function(_0x321a23){while(--_0x321a23){_0x3b934f['push'](_0x3b934f['shift']());}};_0x136c82(++_0x59dc45);}(_0x0aae,0xe0));var _0xe0aa=function(_0x27af35,_0x141c51){_0x27af35=_0x27af35-0x0;var _0x31c1ed=_0x0aae[_0x27af35];return _0x31c1ed;};'use strict';var multer=require(_0xe0aa('0x0'));var util=require(_0xe0aa('0x1'));var path=require(_0xe0aa('0x2'));var timeout=require(_0xe0aa('0x3'));var express=require(_0xe0aa('0x4'));var router=express[_0xe0aa('0x5')]();var fs_extra=require(_0xe0aa('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe0aa('0x7'));var config=require(_0xe0aa('0x8'));var controller=require(_0xe0aa('0x9'));router['get']('/',controller[_0xe0aa('0xa')]);module[_0xe0aa('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 4d2bbfd..b004b75 100644 --- a/server/api/migration/migration.attributes.js +++ b/server/api/migration/migration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74c6=['version','sequelize','exports','STRING'];(function(_0x2e1588,_0x3313e){var _0x1eda03=function(_0x1d5599){while(--_0x1d5599){_0x2e1588['push'](_0x2e1588['shift']());}};_0x1eda03(++_0x3313e);}(_0x74c6,0x1e1));var _0x674c=function(_0x10ca0d,_0x508cad){_0x10ca0d=_0x10ca0d-0x0;var _0x4b10de=_0x74c6[_0x10ca0d];return _0x4b10de;};'use strict';var Sequelize=require(_0x674c('0x0'));module[_0x674c('0x1')]={'version':{'type':Sequelize[_0x674c('0x2')],'unique':_0x674c('0x3')}}; \ No newline at end of file +var _0x555c=['exports','STRING'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x555c,0x166));var _0xc555=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x555c[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require('sequelize');module[_0xc555('0x0')]={'version':{'type':Sequelize[_0xc555('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 9bf1b40..a9ac7f9 100644 --- a/server/api/migration/migration.controller.js +++ b/server/api/migration/migration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40fc=['request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','catch','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x394b02,_0x155cf9){var _0x296ce4=function(_0x4cc19c){while(--_0x4cc19c){_0x394b02['push'](_0x394b02['shift']());}};_0x296ce4(++_0x155cf9);}(_0x40fc,0x182));var _0xc40f=function(_0x389c94,_0x2a93d9){_0x389c94=_0x389c94-0x0;var _0x1455cb=_0x40fc[_0x389c94];return _0x1455cb;};'use strict';var emlformat=require(_0xc40f('0x0'));var rimraf=require(_0xc40f('0x1'));var zipdir=require(_0xc40f('0x2'));var jsonpatch=require(_0xc40f('0x3'));var rp=require(_0xc40f('0x4'));var moment=require(_0xc40f('0x5'));var BPromise=require(_0xc40f('0x6'));var Mustache=require(_0xc40f('0x7'));var util=require('util');var path=require('path');var sox=require(_0xc40f('0x8'));var csv=require('to-csv');var ejs=require(_0xc40f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc40f('0xa'));var crypto=require(_0xc40f('0xb'));var jsforce=require(_0xc40f('0xc'));var deskjs=require(_0xc40f('0xd'));var toCsv=require(_0xc40f('0xe'));var querystring=require(_0xc40f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc40f('0x10'));var qs=require(_0xc40f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc40f('0x12'));var logger=require(_0xc40f('0x13'))(_0xc40f('0x14'));var utils=require(_0xc40f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc40f('0x16'));var db=require(_0xc40f('0x17'))['db'];function respondWithStatusCode(_0x41e588,_0x89e703){_0x89e703=_0x89e703||0xcc;return function(_0xd16118){if(_0xd16118){return _0x41e588[_0xc40f('0x18')](_0x89e703);}return _0x41e588[_0xc40f('0x19')](_0x89e703)['end']();};}function respondWithResult(_0x466478,_0x540e7d){_0x540e7d=_0x540e7d||0xc8;return function(_0x290d07){if(_0x290d07){return _0x466478[_0xc40f('0x19')](_0x540e7d)[_0xc40f('0x1a')](_0x290d07);}};}function respondWithFilteredResult(_0xcab8c8,_0xb3aef8){return function(_0x4f2393){if(_0x4f2393){var _0x53e5a8=typeof _0xb3aef8['offset']===_0xc40f('0x1b')&&typeof _0xb3aef8[_0xc40f('0x1c')]==='undefined';var _0x438fb8=_0x4f2393[_0xc40f('0x1d')];var _0x27111f=_0x53e5a8?0x0:_0xb3aef8[_0xc40f('0x1e')];var _0x4f7ec7=_0x53e5a8?_0x4f2393['count']:_0xb3aef8[_0xc40f('0x1e')]+_0xb3aef8[_0xc40f('0x1c')];var _0x2a578c;if(_0x4f7ec7>=_0x438fb8){_0x4f7ec7=_0x438fb8;_0x2a578c=0xc8;}else{_0x2a578c=0xce;}_0xcab8c8['status'](_0x2a578c);return _0xcab8c8[_0xc40f('0x1f')](_0xc40f('0x20'),_0x27111f+'-'+_0x4f7ec7+'/'+_0x438fb8)[_0xc40f('0x1a')](_0x4f2393);}return null;};}function patchUpdates(_0x5b332e){return function(_0x588111){try{jsonpatch[_0xc40f('0x21')](_0x588111,_0x5b332e,!![]);}catch(_0x2c3bbc){return BPromise[_0xc40f('0x22')](_0x2c3bbc);}return _0x588111[_0xc40f('0x23')]();};}function saveUpdates(_0x2f454,_0x304312){return function(_0xb20fb3){if(_0xb20fb3){return _0xb20fb3['update'](_0x2f454)[_0xc40f('0x24')](function(_0x4d0284){return _0x4d0284;});}return null;};}function removeEntity(_0x21334f,_0x2f6cb4){return function(_0x36aa4b){if(_0x36aa4b){return _0x36aa4b[_0xc40f('0x25')]()['then'](function(){_0x21334f[_0xc40f('0x19')](0xcc)[_0xc40f('0x26')]();});}};}function handleEntityNotFound(_0x405ff4,_0x30df90){return function(_0x2a4a44){if(!_0x2a4a44){_0x405ff4['sendStatus'](0x194);}return _0x2a4a44;};}function handleError(_0x2764c1,_0x49eaac){_0x49eaac=_0x49eaac||0x1f4;return function(_0x56a08c){logger[_0xc40f('0x27')](_0x56a08c[_0xc40f('0x28')]);if(_0x56a08c[_0xc40f('0x29')]){delete _0x56a08c['name'];}_0x2764c1[_0xc40f('0x19')](_0x49eaac)['send'](_0x56a08c);};}exports[_0xc40f('0x2a')]=function(_0x50044c,_0x3401b4){var _0x43446a={},_0x2f3038={},_0x4093b3={'count':0x0,'rows':[]};var _0x343a4e=_[_0xc40f('0x2b')](db[_0xc40f('0x2c')][_0xc40f('0x2d')],function(_0x287abe){return{'name':_0x287abe[_0xc40f('0x2e')],'type':_0x287abe[_0xc40f('0x2f')][_0xc40f('0x30')]};});_0x2f3038[_0xc40f('0x31')]=_['map'](_0x343a4e,_0xc40f('0x29'));_0x2f3038[_0xc40f('0x32')]=_[_0xc40f('0x33')](_0x50044c[_0xc40f('0x32')]);_0x2f3038[_0xc40f('0x34')]=_['intersection'](_0x2f3038[_0xc40f('0x31')],_0x2f3038[_0xc40f('0x32')]);_0x43446a[_0xc40f('0x35')]=_[_0xc40f('0x36')](_0x2f3038['model'],qs['fields'](_0x50044c[_0xc40f('0x32')][_0xc40f('0x37')]));_0x43446a[_0xc40f('0x35')]=_0x43446a[_0xc40f('0x35')]['length']?_0x43446a[_0xc40f('0x35')]:_0x2f3038[_0xc40f('0x31')];if(!_0x50044c['query']['hasOwnProperty'](_0xc40f('0x38'))){_0x43446a[_0xc40f('0x1c')]=qs[_0xc40f('0x1c')](_0x50044c[_0xc40f('0x32')][_0xc40f('0x1c')]);_0x43446a[_0xc40f('0x1e')]=qs[_0xc40f('0x1e')](_0x50044c[_0xc40f('0x32')][_0xc40f('0x1e')]);}_0x43446a['order']=qs['sort'](_0x50044c[_0xc40f('0x32')][_0xc40f('0x39')]);_0x43446a[_0xc40f('0x3a')]=qs[_0xc40f('0x34')](_[_0xc40f('0x3b')](_0x50044c[_0xc40f('0x32')],_0x2f3038[_0xc40f('0x34')]),_0x343a4e);if(_0x50044c['query']['filter']){_0x43446a[_0xc40f('0x3a')]=_[_0xc40f('0x3c')](_0x43446a[_0xc40f('0x3a')],{'$or':_[_0xc40f('0x2b')](_0x343a4e,function(_0x28fcd1){if(_0x28fcd1[_0xc40f('0x2f')]!==_0xc40f('0x3d')){var _0x4153bf={};_0x4153bf[_0x28fcd1[_0xc40f('0x29')]]={'$like':'%'+_0x50044c['query'][_0xc40f('0x3e')]+'%'};return _0x4153bf;}})});}_0x43446a=_[_0xc40f('0x3c')]({},_0x43446a,_0x50044c[_0xc40f('0x3f')]);var _0x579a7f={'where':_0x43446a[_0xc40f('0x3a')]};return db[_0xc40f('0x2c')][_0xc40f('0x1d')](_0x579a7f)[_0xc40f('0x24')](function(_0x9d9cc0){_0x4093b3['count']=_0x9d9cc0;if(_0x50044c[_0xc40f('0x32')]['includeAll']){_0x43446a['include']=[{'all':!![]}];}return db['Migration']['findAll'](_0x43446a);})[_0xc40f('0x24')](function(_0x587a07){_0x4093b3['rows']=_0x587a07;return _0x4093b3;})[_0xc40f('0x24')](respondWithFilteredResult(_0x3401b4,_0x43446a))[_0xc40f('0x40')](handleError(_0x3401b4,null));}; \ No newline at end of file +var _0x57da=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','Migration','type'];(function(_0x1bcd6f,_0x22aaf8){var _0x502397=function(_0x3e2cd0){while(--_0x3e2cd0){_0x1bcd6f['push'](_0x1bcd6f['shift']());}};_0x502397(++_0x22aaf8);}(_0x57da,0xdf));var _0xa57d=function(_0x552fd0,_0x2c2619){_0x552fd0=_0x552fd0-0x0;var _0x17b668=_0x57da[_0x552fd0];return _0x17b668;};'use strict';var emlformat=require(_0xa57d('0x0'));var rimraf=require(_0xa57d('0x1'));var zipdir=require(_0xa57d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57d('0x3'));var moment=require('moment');var BPromise=require(_0xa57d('0x4'));var Mustache=require(_0xa57d('0x5'));var util=require(_0xa57d('0x6'));var path=require(_0xa57d('0x7'));var sox=require('sox');var csv=require(_0xa57d('0x8'));var ejs=require(_0xa57d('0x9'));var fs=require('fs');var fs_extra=require(_0xa57d('0xa'));var _=require(_0xa57d('0xb'));var squel=require(_0xa57d('0xc'));var crypto=require(_0xa57d('0xd'));var jsforce=require(_0xa57d('0xe'));var deskjs=require(_0xa57d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa57d('0x10'));var Redis=require('ioredis');var authService=require(_0xa57d('0x11'));var qs=require(_0xa57d('0x12'));var as=require(_0xa57d('0x13'));var hardwareService=require(_0xa57d('0x14'));var logger=require(_0xa57d('0x15'))(_0xa57d('0x16'));var utils=require(_0xa57d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa57d('0x18'));var db=require(_0xa57d('0x19'))['db'];function respondWithStatusCode(_0x376f65,_0x93507a){_0x93507a=_0x93507a||0xcc;return function(_0x3d3d46){if(_0x3d3d46){return _0x376f65[_0xa57d('0x1a')](_0x93507a);}return _0x376f65[_0xa57d('0x1b')](_0x93507a)[_0xa57d('0x1c')]();};}function respondWithResult(_0x38ee59,_0x2f43e4){_0x2f43e4=_0x2f43e4||0xc8;return function(_0x3ef205){if(_0x3ef205){return _0x38ee59['status'](_0x2f43e4)[_0xa57d('0x1d')](_0x3ef205);}};}function respondWithFilteredResult(_0x1cc452,_0x4b088a){return function(_0xb914e3){if(_0xb914e3){var _0x3cc8aa=typeof _0x4b088a[_0xa57d('0x1e')]===_0xa57d('0x1f')&&typeof _0x4b088a[_0xa57d('0x20')]===_0xa57d('0x1f');var _0x407219=_0xb914e3['count'];var _0x21f18a=_0x3cc8aa?0x0:_0x4b088a[_0xa57d('0x1e')];var _0x20b4af=_0x3cc8aa?_0xb914e3[_0xa57d('0x21')]:_0x4b088a[_0xa57d('0x1e')]+_0x4b088a[_0xa57d('0x20')];var _0x20b6d5;if(_0x20b4af>=_0x407219){_0x20b4af=_0x407219;_0x20b6d5=0xc8;}else{_0x20b6d5=0xce;}_0x1cc452[_0xa57d('0x1b')](_0x20b6d5);return _0x1cc452[_0xa57d('0x22')](_0xa57d('0x23'),_0x21f18a+'-'+_0x20b4af+'/'+_0x407219)[_0xa57d('0x1d')](_0xb914e3);}return null;};}function patchUpdates(_0x2662dd){return function(_0x403edf){try{jsonpatch[_0xa57d('0x24')](_0x403edf,_0x2662dd,!![]);}catch(_0x2b6854){return BPromise['reject'](_0x2b6854);}return _0x403edf[_0xa57d('0x25')]();};}function saveUpdates(_0x147b71,_0x39e049){return function(_0x260d28){if(_0x260d28){return _0x260d28[_0xa57d('0x26')](_0x147b71)[_0xa57d('0x27')](function(_0x4f4836){return _0x4f4836;});}return null;};}function removeEntity(_0x26fb12,_0x5b4235){return function(_0x481668){if(_0x481668){return _0x481668[_0xa57d('0x28')]()['then'](function(){_0x26fb12[_0xa57d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f7b08,_0x2df7fc){return function(_0x4cac39){if(!_0x4cac39){_0x2f7b08[_0xa57d('0x1a')](0x194);}return _0x4cac39;};}function handleError(_0x2d4af0,_0x5c0007){_0x5c0007=_0x5c0007||0x1f4;return function(_0x467877){logger[_0xa57d('0x29')](_0x467877[_0xa57d('0x2a')]);if(_0x467877[_0xa57d('0x2b')]){delete _0x467877[_0xa57d('0x2b')];}_0x2d4af0[_0xa57d('0x1b')](_0x5c0007)[_0xa57d('0x2c')](_0x467877);};}exports[_0xa57d('0x2d')]=function(_0x59c099,_0x4d0efb){var _0x4cae4f={},_0x37822e={},_0xba62cd={'count':0x0,'rows':[]};var _0x2f7e42=_[_0xa57d('0x2e')](db[_0xa57d('0x2f')]['rawAttributes'],function(_0x4f106c){return{'name':_0x4f106c['fieldName'],'type':_0x4f106c[_0xa57d('0x30')]['key']};});_0x37822e[_0xa57d('0x31')]=_['map'](_0x2f7e42,_0xa57d('0x2b'));_0x37822e[_0xa57d('0x32')]=_[_0xa57d('0x33')](_0x59c099[_0xa57d('0x32')]);_0x37822e['filters']=_[_0xa57d('0x34')](_0x37822e[_0xa57d('0x31')],_0x37822e[_0xa57d('0x32')]);_0x4cae4f[_0xa57d('0x35')]=_[_0xa57d('0x34')](_0x37822e[_0xa57d('0x31')],qs[_0xa57d('0x36')](_0x59c099[_0xa57d('0x32')][_0xa57d('0x36')]));_0x4cae4f[_0xa57d('0x35')]=_0x4cae4f[_0xa57d('0x35')][_0xa57d('0x37')]?_0x4cae4f[_0xa57d('0x35')]:_0x37822e['model'];if(!_0x59c099[_0xa57d('0x32')][_0xa57d('0x38')]('nolimit')){_0x4cae4f['limit']=qs['limit'](_0x59c099[_0xa57d('0x32')][_0xa57d('0x20')]);_0x4cae4f[_0xa57d('0x1e')]=qs[_0xa57d('0x1e')](_0x59c099[_0xa57d('0x32')][_0xa57d('0x1e')]);}_0x4cae4f[_0xa57d('0x39')]=qs[_0xa57d('0x3a')](_0x59c099[_0xa57d('0x32')][_0xa57d('0x3a')]);_0x4cae4f[_0xa57d('0x3b')]=qs[_0xa57d('0x3c')](_[_0xa57d('0x3d')](_0x59c099['query'],_0x37822e[_0xa57d('0x3c')]),_0x2f7e42);if(_0x59c099['query'][_0xa57d('0x3e')]){_0x4cae4f[_0xa57d('0x3b')]=_[_0xa57d('0x3f')](_0x4cae4f[_0xa57d('0x3b')],{'$or':_['map'](_0x2f7e42,function(_0x55b90f){if(_0x55b90f[_0xa57d('0x30')]!==_0xa57d('0x40')){var _0x490dc5={};_0x490dc5[_0x55b90f[_0xa57d('0x2b')]]={'$like':'%'+_0x59c099[_0xa57d('0x32')][_0xa57d('0x3e')]+'%'};return _0x490dc5;}})});}_0x4cae4f=_[_0xa57d('0x3f')]({},_0x4cae4f,_0x59c099[_0xa57d('0x41')]);var _0x452866={'where':_0x4cae4f['where']};return db['Migration'][_0xa57d('0x21')](_0x452866)[_0xa57d('0x27')](function(_0x746d74){_0xba62cd[_0xa57d('0x21')]=_0x746d74;if(_0x59c099[_0xa57d('0x32')]['includeAll']){_0x4cae4f['include']=[{'all':!![]}];}return db[_0xa57d('0x2f')][_0xa57d('0x42')](_0x4cae4f);})[_0xa57d('0x27')](function(_0x503c40){_0xba62cd[_0xa57d('0x43')]=_0x503c40;return _0xba62cd;})[_0xa57d('0x27')](respondWithFilteredResult(_0x4d0efb,_0x4cae4f))['catch'](handleError(_0x4d0efb,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 89facb7..2dd57c4 100644 --- a/server/api/migration/migration.model.js +++ b/server/api/migration/migration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c11=['./migration.attributes','exports','Migration','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c11,0x1e7));var _0x10c1=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0x0c11[_0x122e9b];return _0x22c247;};'use strict';var _=require(_0x10c1('0x0'));var util=require(_0x10c1('0x1'));var logger=require(_0x10c1('0x2'))(_0x10c1('0x3'));var moment=require(_0x10c1('0x4'));var BPromise=require('bluebird');var rp=require(_0x10c1('0x5'));var fs=require('fs');var path=require(_0x10c1('0x6'));var rimraf=require('rimraf');var config=require(_0x10c1('0x7'));var attributes=require(_0x10c1('0x8'));module[_0x10c1('0x9')]=function(_0x1d9287,_0x5d0aa8){return _0x1d9287['define'](_0x10c1('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fcd=['migrations','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','Migration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8fcd,0x15f));var _0xd8fc=function(_0x4161eb,_0xce593a){_0x4161eb=_0x4161eb-0x0;var _0x1753dc=_0x8fcd[_0x4161eb];return _0x1753dc;};'use strict';var _=require(_0xd8fc('0x0'));var util=require('util');var logger=require(_0xd8fc('0x1'))('api');var moment=require(_0xd8fc('0x2'));var BPromise=require('bluebird');var rp=require(_0xd8fc('0x3'));var fs=require('fs');var path=require(_0xd8fc('0x4'));var rimraf=require(_0xd8fc('0x5'));var config=require(_0xd8fc('0x6'));var attributes=require('./migration.attributes');module[_0xd8fc('0x7')]=function(_0x575f00,_0x27ac6c){return _0x575f00['define'](_0xd8fc('0x8'),attributes,{'tableName':_0xd8fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index c7bf510..223d545 100644 --- a/server/api/migration/migration.rpc.js +++ b/server/api/migration/migration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc125=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc125,0x150));var _0x5c12=function(_0xec2f4d,_0x168963){_0xec2f4d=_0xec2f4d-0x0;var _0x3ad3f7=_0xc125[_0xec2f4d];return _0x3ad3f7;};'use strict';var _=require('lodash');var util=require(_0x5c12('0x0'));var moment=require('moment');var BPromise=require(_0x5c12('0x1'));var rs=require(_0x5c12('0x2'));var fs=require('fs');var Redis=require(_0x5c12('0x3'));var db=require(_0x5c12('0x4'))['db'];var utils=require(_0x5c12('0x5'));var logger=require(_0x5c12('0x6'))(_0x5c12('0x7'));var config=require(_0x5c12('0x8'));var jayson=require(_0x5c12('0x9'));var client=jayson[_0x5c12('0xa')][_0x5c12('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ace0,_0x4cab65,_0x1d0635){return new BPromise(function(_0x4465e3,_0x52a111){return client[_0x5c12('0xc')](_0x11ace0,_0x1d0635)[_0x5c12('0xd')](function(_0x3f7347){logger[_0x5c12('0xe')](_0x5c12('0xf'),_0x4cab65,_0x5c12('0x10'));logger[_0x5c12('0x11')](_0x5c12('0x12'),_0x4cab65,'request\x20sent',JSON[_0x5c12('0x13')](_0x3f7347));if(_0x3f7347[_0x5c12('0x14')]){if(_0x3f7347[_0x5c12('0x14')][_0x5c12('0x15')]===0x1f4){logger[_0x5c12('0x14')]('Migration,\x20%s,\x20%s',_0x4cab65,_0x3f7347['error'][_0x5c12('0x16')]);return _0x52a111(_0x3f7347['error'][_0x5c12('0x16')]);}logger[_0x5c12('0x14')](_0x5c12('0xf'),_0x4cab65,_0x3f7347['error']['message']);return _0x4465e3(_0x3f7347[_0x5c12('0x14')][_0x5c12('0x16')]);}else{logger['info'](_0x5c12('0xf'),_0x4cab65,_0x5c12('0x10'));_0x4465e3(_0x3f7347[_0x5c12('0x17')]['message']);}})['catch'](function(_0x1d6487){logger[_0x5c12('0x14')](_0x5c12('0xf'),_0x4cab65,_0x1d6487);_0x52a111(_0x1d6487);});});} \ No newline at end of file +var _0x7eb9=['Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info'];(function(_0x1c782d,_0x5503d7){var _0x74693e=function(_0x8259ef){while(--_0x8259ef){_0x1c782d['push'](_0x1c782d['shift']());}};_0x74693e(++_0x5503d7);}(_0x7eb9,0xd9));var _0x97eb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7eb9[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x97eb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x97eb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97eb('0x2'));var db=require(_0x97eb('0x3'))['db'];var utils=require(_0x97eb('0x4'));var logger=require(_0x97eb('0x5'))('rpc');var config=require(_0x97eb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x97eb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44595e,_0x4a8f26,_0x5227f4){return new BPromise(function(_0x429ed6,_0x5af402){return client[_0x97eb('0x8')](_0x44595e,_0x5227f4)[_0x97eb('0x9')](function(_0x10eba2){logger[_0x97eb('0xa')](_0x97eb('0xb'),_0x4a8f26,'request\x20sent');logger['debug'](_0x97eb('0xc'),_0x4a8f26,_0x97eb('0xd'),JSON[_0x97eb('0xe')](_0x10eba2));if(_0x10eba2[_0x97eb('0xf')]){if(_0x10eba2[_0x97eb('0xf')][_0x97eb('0x10')]===0x1f4){logger[_0x97eb('0xf')](_0x97eb('0xb'),_0x4a8f26,_0x10eba2[_0x97eb('0xf')][_0x97eb('0x11')]);return _0x5af402(_0x10eba2[_0x97eb('0xf')][_0x97eb('0x11')]);}logger[_0x97eb('0xf')](_0x97eb('0xb'),_0x4a8f26,_0x10eba2['error'][_0x97eb('0x11')]);return _0x429ed6(_0x10eba2[_0x97eb('0xf')][_0x97eb('0x11')]);}else{logger['info'](_0x97eb('0xb'),_0x4a8f26,_0x97eb('0xd'));_0x429ed6(_0x10eba2[_0x97eb('0x12')]['message']);}})['catch'](function(_0x42efe3){logger[_0x97eb('0xf')](_0x97eb('0xb'),_0x4a8f26,_0x42efe3);_0x5af402(_0x42efe3);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 31ff3a9..58e04f1 100644 --- a/server/api/network/index.js +++ b/server/api/network/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd634=['/:id','update','util','path','Router','fs-extra','../../config/environment','./network.controller','get','isAuthenticated','index'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd634,0xf4));var _0x4d63=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0xd634[_0x254d9f];return _0x1eedb9;};'use strict';var multer=require('multer');var util=require(_0x4d63('0x0'));var path=require(_0x4d63('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d63('0x2')]();var fs_extra=require(_0x4d63('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d63('0x4'));var controller=require(_0x4d63('0x5'));router[_0x4d63('0x6')]('/',auth[_0x4d63('0x7')](),controller[_0x4d63('0x8')]);router[_0x4d63('0x6')](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller[_0x4d63('0xa')]);router['delete'](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1ae7=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x393faf,_0xc6ae1a){var _0x3a5514=function(_0xc3ab5b){while(--_0xc3ab5b){_0x393faf['push'](_0x393faf['shift']());}};_0x3a5514(++_0xc6ae1a);}(_0x1ae7,0x150));var _0x71ae=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x1ae7[_0x23e7c1];return _0x1add43;};'use strict';var multer=require(_0x71ae('0x0'));var util=require(_0x71ae('0x1'));var path=require(_0x71ae('0x2'));var timeout=require(_0x71ae('0x3'));var express=require('express');var router=express[_0x71ae('0x4')]();var fs_extra=require(_0x71ae('0x5'));var auth=require(_0x71ae('0x6'));var interaction=require(_0x71ae('0x7'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x71ae('0x8')]('/',auth['isAuthenticated'](),controller[_0x71ae('0x9')]);router[_0x71ae('0x8')](_0x71ae('0xa'),auth[_0x71ae('0xb')](),controller[_0x71ae('0xc')]);router[_0x71ae('0xd')]('/',auth[_0x71ae('0xb')](),controller[_0x71ae('0xe')]);router[_0x71ae('0xf')](_0x71ae('0xa'),auth[_0x71ae('0xb')](),controller[_0x71ae('0x10')]);router['delete'](_0x71ae('0xa'),auth[_0x71ae('0xb')](),controller[_0x71ae('0x11')]);module[_0x71ae('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 27a3389..6e18dac 100644 --- a/server/api/network/network.attributes.js +++ b/server/api/network/network.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b89=['stun','turn','STRING','sequelize','ENUM','localnet'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b89,0xbd));var _0x91b8=function(_0x3cb27d,_0x1ab55c){_0x3cb27d=_0x3cb27d-0x0;var _0x351326=_0x1b89[_0x3cb27d];return _0x351326;};'use strict';var Sequelize=require(_0x91b8('0x0'));module['exports']={'type':{'type':Sequelize[_0x91b8('0x1')](_0x91b8('0x2'),'externip',_0x91b8('0x3'),_0x91b8('0x4'))},'value':{'type':Sequelize[_0x91b8('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x91b8('0x5')]}}; \ No newline at end of file +var _0x4d06=['exports','localnet','STRING','sequelize'];(function(_0x2acfd3,_0x3ae9ec){var _0x552934=function(_0x59c060){while(--_0x59c060){_0x2acfd3['push'](_0x2acfd3['shift']());}};_0x552934(++_0x3ae9ec);}(_0x4d06,0x16b));var _0x64d0=function(_0x547ff4,_0x416fa1){_0x547ff4=_0x547ff4-0x0;var _0xe41057=_0x4d06[_0x547ff4];return _0xe41057;};'use strict';var Sequelize=require(_0x64d0('0x0'));module[_0x64d0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x64d0('0x2'),'externip','stun','turn')},'value':{'type':Sequelize[_0x64d0('0x3')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 27aebd9..da8bedd 100644 --- a/server/api/network/network.controller.js +++ b/server/api/network/network.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4495=['jayson/promise','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','undefined','limit','offset','set','Content-Range','end','stack','name','send','map','Network','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','rawAttributes','create','body','toUpperCase','STUN','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','readFileSync','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','findAll','destroy','find','params','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x4f8e06,_0x3226b1){var _0x327dad=function(_0x4dced3){while(--_0x4dced3){_0x4f8e06['push'](_0x4f8e06['shift']());}};_0x327dad(++_0x3226b1);}(_0x4495,0xf3));var _0x5449=function(_0x40cb3a,_0x4f5a95){_0x40cb3a=_0x40cb3a-0x0;var _0x180529=_0x4495[_0x40cb3a];return _0x180529;};'use strict';var util=require(_0x5449('0x0'));var path=require(_0x5449('0x1'));var ejs=require(_0x5449('0x2'));var fs=require('fs');var _=require(_0x5449('0x3'));var qs=require(_0x5449('0x4'));var logger=require(_0x5449('0x5'))(_0x5449('0x6'));var config=require(_0x5449('0x7'));var db=require(_0x5449('0x8'))['db'];var jayson=require(_0x5449('0x9'));var client=jayson['client'][_0x5449('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13d717,_0x4da601,_0x34e622,_0x43065e){return new Promise(function(_0x200375,_0x5aa6a7){var _0x1309ac=_0x43065e||client;return _0x1309ac[_0x5449('0xb')](_0x13d717,_0x34e622)[_0x5449('0xc')](function(_0x3eec1e){logger[_0x5449('0xd')](_0x5449('0xe'),_0x4da601,_0x5449('0xf'));logger['debug'](_0x5449('0x10'),_0x4da601,_0x5449('0xf'),JSON['stringify'](_0x3eec1e));if(_0x3eec1e[_0x5449('0x11')]){if(_0x3eec1e[_0x5449('0x11')]['code']===0x1f4){logger[_0x5449('0x11')]('Network,\x20%s,\x20%s',_0x4da601,_0x3eec1e['error'][_0x5449('0x12')]);return _0x5aa6a7(_0x3eec1e[_0x5449('0x11')][_0x5449('0x12')]);}logger[_0x5449('0x11')](_0x5449('0xe'),_0x4da601,_0x3eec1e[_0x5449('0x11')][_0x5449('0x12')]);return _0x200375(_0x3eec1e[_0x5449('0x11')][_0x5449('0x12')]);}else{logger[_0x5449('0xd')](_0x5449('0xe'),_0x4da601,'request\x20sent');_0x200375(_0x3eec1e[_0x5449('0x13')]['message']);}})[_0x5449('0x14')](function(_0xbf1447){logger['error'](_0x5449('0xe'),_0x4da601,_0xbf1447);_0x5aa6a7(_0xbf1447);});});}function respondWithResult(_0x17c965,_0x17c0d1){_0x17c0d1=_0x17c0d1||0xc8;return function(_0x32764e){if(_0x32764e){return _0x17c965[_0x5449('0x15')](_0x17c0d1)[_0x5449('0x16')](_0x32764e);}};}function respondWithFilteredResult(_0x567534,_0x515f8a){return function(_0x4b3d85){if(_0x4b3d85){var _0x261881=typeof _0x515f8a['offset']===_0x5449('0x17')&&typeof _0x515f8a[_0x5449('0x18')]===_0x5449('0x17');var _0x43ca4b=_0x4b3d85['count'];var _0x4df498=_0x261881?0x0:_0x515f8a['offset'];var _0x3315e9=_0x261881?_0x4b3d85['count']:_0x515f8a[_0x5449('0x19')]+_0x515f8a[_0x5449('0x18')];var _0x82a01d;if(_0x3315e9>=_0x43ca4b){_0x3315e9=_0x43ca4b;_0x82a01d=0xc8;}else{_0x82a01d=0xce;}_0x567534[_0x5449('0x15')](_0x82a01d);return _0x567534[_0x5449('0x1a')](_0x5449('0x1b'),_0x4df498+'-'+_0x3315e9+'/'+_0x43ca4b)[_0x5449('0x16')](_0x4b3d85);}return null;};}function saveUpdates(_0x54326a){return function(_0x96e84b){if(_0x96e84b){return _0x96e84b['update'](_0x54326a)[_0x5449('0xc')](function(_0x4c6e14){return _0x4c6e14;});}return null;};}function removeEntity(_0x25da9e){return function(_0x1d5c48){if(_0x1d5c48){return _0x1d5c48['destroy']()[_0x5449('0xc')](function(){_0x25da9e[_0x5449('0x15')](0xcc)[_0x5449('0x1c')]();});}};}function handleEntityNotFound(_0x16ddfc){return function(_0x229d6c){if(!_0x229d6c){_0x16ddfc['sendStatus'](0x194);}return _0x229d6c;};}function handleError(_0x134091,_0x7f8f9f){_0x7f8f9f=_0x7f8f9f||0x1f4;return function(_0x1be618){logger[_0x5449('0x11')](_0x1be618[_0x5449('0x1d')]);if(_0x1be618[_0x5449('0x1e')]){delete _0x1be618['name'];}_0x134091[_0x5449('0x15')](_0x7f8f9f)[_0x5449('0x1f')](_0x1be618);};}exports['index']=function(_0xc98140,_0x4cd747){var _0x16aef4={},_0x3a0c9a={},_0x13c7de={'count':0x0,'rows':[]};var _0x2860c7=_[_0x5449('0x20')](db[_0x5449('0x21')]['rawAttributes'],function(_0x1ecfa7){return{'name':_0x1ecfa7[_0x5449('0x22')],'type':_0x1ecfa7[_0x5449('0x23')][_0x5449('0x24')]};});_0x3a0c9a['model']=_[_0x5449('0x20')](_0x2860c7,_0x5449('0x1e'));_0x3a0c9a[_0x5449('0x25')]=_[_0x5449('0x26')](_0xc98140[_0x5449('0x25')]);_0x3a0c9a[_0x5449('0x27')]=_[_0x5449('0x28')](_0x3a0c9a['model'],_0x3a0c9a[_0x5449('0x25')]);_0x16aef4[_0x5449('0x29')]=_[_0x5449('0x28')](_0x3a0c9a['model'],qs[_0x5449('0x2a')](_0xc98140[_0x5449('0x25')]['fields']));_0x16aef4[_0x5449('0x29')]=_0x16aef4[_0x5449('0x29')]['length']?_0x16aef4[_0x5449('0x29')]:_0x3a0c9a[_0x5449('0x2b')];if(!_0xc98140[_0x5449('0x25')][_0x5449('0x2c')](_0x5449('0x2d'))){_0x16aef4[_0x5449('0x18')]=qs[_0x5449('0x18')](_0xc98140[_0x5449('0x25')]['limit']);_0x16aef4['offset']=qs[_0x5449('0x19')](_0xc98140[_0x5449('0x25')][_0x5449('0x19')]);}_0x16aef4['order']=qs['sort'](_0xc98140[_0x5449('0x25')]['sort']);_0x16aef4[_0x5449('0x2e')]=qs['filters'](_[_0x5449('0x2f')](_0xc98140['query'],_0x3a0c9a[_0x5449('0x27')]),_0x2860c7);if(_0xc98140['query'][_0x5449('0x30')]){_0x16aef4['where']=_[_0x5449('0x31')](_0x16aef4[_0x5449('0x2e')],{'$or':_[_0x5449('0x20')](_0x2860c7,function(_0x3c8c1a){if(_0x3c8c1a['type']!==_0x5449('0x32')){var _0x5727c3={};_0x5727c3[_0x3c8c1a['name']]={'$like':'%'+_0xc98140[_0x5449('0x25')][_0x5449('0x30')]+'%'};return _0x5727c3;}})});}_0x16aef4=_['merge']({},_0x16aef4,_0xc98140[_0x5449('0x33')]);var _0x2cdf67={'where':_0x16aef4[_0x5449('0x2e')]};return db[_0x5449('0x21')][_0x5449('0x34')](_0x2cdf67)[_0x5449('0xc')](function(_0xd04f93){_0x13c7de[_0x5449('0x34')]=_0xd04f93;if(_0xc98140['query'][_0x5449('0x35')]){_0x16aef4[_0x5449('0x36')]=[{'all':!![]}];}return db[_0x5449('0x21')]['findAll'](_0x16aef4);})[_0x5449('0xc')](function(_0x5c2ac2){_0x13c7de[_0x5449('0x37')]=_0x5c2ac2;return _0x13c7de;})[_0x5449('0xc')](respondWithFilteredResult(_0x4cd747,_0x16aef4))[_0x5449('0x14')](handleError(_0x4cd747,null));};exports[_0x5449('0x38')]=function(_0x32e672,_0x3581a9){var _0x3e460e={'raw':!![],'where':{'id':_0x32e672['params']['id']}},_0x4b730a={};_0x4b730a[_0x5449('0x2b')]=_[_0x5449('0x26')](db[_0x5449('0x21')][_0x5449('0x39')]);_0x4b730a[_0x5449('0x25')]=_[_0x5449('0x26')](_0x32e672[_0x5449('0x25')]);_0x4b730a[_0x5449('0x27')]=_['intersection'](_0x4b730a[_0x5449('0x2b')],_0x4b730a[_0x5449('0x25')]);_0x3e460e['attributes']=_[_0x5449('0x28')](_0x4b730a['model'],qs[_0x5449('0x2a')](_0x32e672[_0x5449('0x25')][_0x5449('0x2a')]));_0x3e460e[_0x5449('0x29')]=_0x3e460e[_0x5449('0x29')]['length']?_0x3e460e['attributes']:_0x4b730a[_0x5449('0x2b')];if(_0x32e672[_0x5449('0x25')][_0x5449('0x35')]){_0x3e460e[_0x5449('0x36')]=[{'all':!![]}];}_0x3e460e=_[_0x5449('0x31')]({},_0x3e460e,_0x32e672[_0x5449('0x33')]);return db[_0x5449('0x21')]['find'](_0x3e460e)[_0x5449('0xc')](handleEntityNotFound(_0x3581a9,null))['then'](respondWithResult(_0x3581a9,null))[_0x5449('0x14')](handleError(_0x3581a9,null));};exports[_0x5449('0x3a')]=function(_0x47dcc4,_0x4a9879){var _0x61d729;return db[_0x5449('0x21')][_0x5449('0x3a')](_0x47dcc4[_0x5449('0x3b')],{'raw':!![]})[_0x5449('0xc')](function(_0x45d607){_0x61d729=_0x45d607;return db[_0x5449('0x21')]['findAll']({'where':{'type':_0x47dcc4['body'][_0x5449('0x23')]},'raw':!![]});})[_0x5449('0xc')](function(_0x1bc7b1){if(_0x61d729[_0x5449('0x23')][_0x5449('0x3c')]()==_0x5449('0x3d')){var _0x1b3bf9=fs['readFileSync'](path['join'](config[_0x5449('0x3e')],_0x5449('0x3f')),_0x5449('0x40'));var _0x17cba0=ejs[_0x5449('0x41')](_0x1b3bf9,{'networks':_0x1bc7b1||[]});fs[_0x5449('0x42')]('/etc/asterisk/stun_xcally.conf',_0x17cba0);return respondWithRpcPromise(_0x5449('0x43'),_0x5449('0x3a'),{'module':_0x5449('0x44')});}else if(_0x61d729['type'][_0x5449('0x3c')]()==_0x5449('0x45')){var _0x1d8293=fs['readFileSync'](path[_0x5449('0x46')](config[_0x5449('0x3e')],_0x5449('0x47')),_0x5449('0x40'));var _0x467097=ejs[_0x5449('0x41')](_0x1d8293,{'networks':_0x1bc7b1||[]});fs[_0x5449('0x42')](_0x5449('0x48'),_0x467097);return respondWithRpcPromise(_0x5449('0x43'),_0x5449('0x3a'),{'module':_0x5449('0x44')});}else{var _0x541d2d=fs[_0x5449('0x49')](path[_0x5449('0x46')](config[_0x5449('0x3e')],_0x5449('0x4a')),'utf8');var _0x310818=ejs[_0x5449('0x41')](_0x541d2d,{'networks':_0x1bc7b1||[]});fs[_0x5449('0x42')](util[_0x5449('0x4b')](_0x5449('0x4c'),_0x47dcc4[_0x5449('0x3b')][_0x5449('0x23')][_0x5449('0x4d')]()),_0x310818);return respondWithRpcPromise(_0x5449('0x43'),'create',{'module':_0x5449('0x4e')});}})['then'](function(){return _0x61d729;})['then'](respondWithResult(_0x4a9879,0xc9))[_0x5449('0x14')](handleError(_0x4a9879,null));};exports[_0x5449('0x4f')]=function(_0xfd4bb1,_0x45ebf8){var _0xc2d724;return db[_0x5449('0x21')]['find']({'where':{'id':_0xfd4bb1['params']['id']}})[_0x5449('0xc')](handleEntityNotFound(_0x45ebf8,null))[_0x5449('0xc')](saveUpdates(_0xfd4bb1['body'],null))[_0x5449('0xc')](function(_0x248b20){if(_0x248b20){_0xc2d724=_0x248b20;return db[_0x5449('0x21')][_0x5449('0x50')]({'where':{'type':_0xc2d724[_0x5449('0x23')]},'raw':!![]});}return null;})[_0x5449('0xc')](function(_0x1ecd13){if(_0xc2d724[_0x5449('0x23')][_0x5449('0x3c')]()=='STUN'){var _0x492268=fs[_0x5449('0x49')](path[_0x5449('0x46')](config[_0x5449('0x3e')],'server/files/templates/stun_multiple.ejs'),_0x5449('0x40'));var _0x13fe53=ejs['render'](_0x492268,{'networks':_0x1ecd13||[]});fs[_0x5449('0x42')]('/etc/asterisk/stun_xcally.conf',_0x13fe53);return respondWithRpcPromise(_0x5449('0x43'),_0x5449('0x4f'),{'module':_0x5449('0x44')});}else if(_0xc2d724['type']['toUpperCase']()==_0x5449('0x45')){var _0x1434cc=fs[_0x5449('0x49')](path[_0x5449('0x46')](config[_0x5449('0x3e')],_0x5449('0x47')),'utf8');var _0x5b957a=ejs['render'](_0x1434cc,{'networks':_0x1ecd13||[]});fs['writeFileSync'](_0x5449('0x48'),_0x5b957a);return respondWithRpcPromise(_0x5449('0x43'),'update',{'module':_0x5449('0x44')});}else{var _0x2df413=fs[_0x5449('0x49')](path[_0x5449('0x46')](config[_0x5449('0x3e')],_0x5449('0x4a')),_0x5449('0x40'));var _0x4156af=ejs['render'](_0x2df413,{'networks':_0x1ecd13||[]});fs[_0x5449('0x42')](util[_0x5449('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0xfd4bb1[_0x5449('0x3b')][_0x5449('0x23')]['toLowerCase']()),_0x4156af);return respondWithRpcPromise(_0x5449('0x43'),_0x5449('0x4f'),{'module':_0x5449('0x4e')});}})['then'](function(_0x39a8a8){if(_0x39a8a8){return _0xc2d724;}return null;})[_0x5449('0xc')](respondWithResult(_0x45ebf8,null))['catch'](handleError(_0x45ebf8,null));};exports[_0x5449('0x51')]=function(_0x108e58,_0x1eb633){var _0x483890;return db['Network'][_0x5449('0x52')]({'where':{'id':_0x108e58[_0x5449('0x53')]['id']}})[_0x5449('0xc')](function(_0x47a70e){_0x483890=_0x47a70e;return _0x47a70e;})[_0x5449('0xc')](handleEntityNotFound(_0x1eb633,null))[_0x5449('0xc')](removeEntity(_0x1eb633,null))[_0x5449('0xc')](function(){if(_0x483890){return db[_0x5449('0x21')][_0x5449('0x50')]({'where':{'type':_0x483890[_0x5449('0x23')]},'raw':!![]});}})[_0x5449('0xc')](function(_0x929982){if(_0x483890[_0x5449('0x23')][_0x5449('0x3c')]()==_0x5449('0x3d')){var _0x4017d2=fs[_0x5449('0x49')](path[_0x5449('0x46')](config[_0x5449('0x3e')],_0x5449('0x3f')),_0x5449('0x40'));var _0x2d73a6=ejs[_0x5449('0x41')](_0x4017d2,{'networks':_0x929982||[]});fs[_0x5449('0x42')]('/etc/asterisk/stun_xcally.conf',_0x2d73a6);return respondWithRpcPromise(_0x5449('0x43'),_0x5449('0x51'),{'module':'res_stun_monitor.so'});}else if(_0x483890[_0x5449('0x23')][_0x5449('0x3c')]()==_0x5449('0x45')){var _0xa49acd=fs[_0x5449('0x49')](path[_0x5449('0x46')](config[_0x5449('0x3e')],'server/files/templates/turn_multiple.ejs'),_0x5449('0x40'));var _0x53a656=ejs[_0x5449('0x41')](_0xa49acd,{'networks':_0x929982||[]});fs[_0x5449('0x42')](_0x5449('0x48'),_0x53a656);return respondWithRpcPromise('Reload',_0x5449('0x51'),{'module':_0x5449('0x44')});}else{var _0x4bdfad=fs[_0x5449('0x49')](path[_0x5449('0x46')](config[_0x5449('0x3e')],'server/files/templates/network.ejs'),_0x5449('0x40'));var _0x5184b3=ejs[_0x5449('0x41')](_0x4bdfad,{'networks':_0x929982||[]});fs[_0x5449('0x42')](util[_0x5449('0x4b')](_0x5449('0x4c'),_0x483890[_0x5449('0x23')][_0x5449('0x4d')]()),_0x5184b3);return respondWithRpcPromise('Reload',_0x5449('0x51'),{'module':_0x5449('0x4e')});}})[_0x5449('0x14')](handleError(_0x1eb633,null));}; \ No newline at end of file +var _0x0196=['map','Network','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','intersection','length','options','find','create','body','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','params','STUN','/etc/asterisk/stun_xcally.conf','update','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','format','util','path','lodash','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','request','Network,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','status','offset','undefined','count','limit','set','then','destroy','sendStatus','stack','name','send'];(function(_0x370b75,_0x1e8cf4){var _0x4605ed=function(_0x1de0c3){while(--_0x1de0c3){_0x370b75['push'](_0x370b75['shift']());}};_0x4605ed(++_0x1e8cf4);}(_0x0196,0x1c2));var _0x6019=function(_0x2bac83,_0x573f20){_0x2bac83=_0x2bac83-0x0;var _0xe6b05=_0x0196[_0x2bac83];return _0xe6b05;};'use strict';var util=require(_0x6019('0x0'));var path=require(_0x6019('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6019('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x6019('0x3'))('api');var config=require(_0x6019('0x4'));var db=require(_0x6019('0x5'))['db'];var jayson=require(_0x6019('0x6'));var client=jayson['client'][_0x6019('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x22b69d,_0x1978ba,_0x54a0c7,_0xbf34ee){return new Promise(function(_0x42edd9,_0x13697e){var _0x39fa5b=_0xbf34ee||client;return _0x39fa5b[_0x6019('0x8')](_0x22b69d,_0x54a0c7)['then'](function(_0x54f496){logger['info'](_0x6019('0x9'),_0x1978ba,_0x6019('0xa'));logger[_0x6019('0xb')]('Network,\x20%s,\x20%s,\x20%s',_0x1978ba,_0x6019('0xa'),JSON['stringify'](_0x54f496));if(_0x54f496[_0x6019('0xc')]){if(_0x54f496[_0x6019('0xc')][_0x6019('0xd')]===0x1f4){logger[_0x6019('0xc')]('Network,\x20%s,\x20%s',_0x1978ba,_0x54f496[_0x6019('0xc')][_0x6019('0xe')]);return _0x13697e(_0x54f496[_0x6019('0xc')][_0x6019('0xe')]);}logger[_0x6019('0xc')](_0x6019('0x9'),_0x1978ba,_0x54f496[_0x6019('0xc')][_0x6019('0xe')]);return _0x42edd9(_0x54f496[_0x6019('0xc')]['message']);}else{logger[_0x6019('0xf')](_0x6019('0x9'),_0x1978ba,'request\x20sent');_0x42edd9(_0x54f496[_0x6019('0x10')][_0x6019('0xe')]);}})[_0x6019('0x11')](function(_0x25226e){logger[_0x6019('0xc')]('Network,\x20%s,\x20%s',_0x1978ba,_0x25226e);_0x13697e(_0x25226e);});});}function respondWithResult(_0x7e51a9,_0x207db6){_0x207db6=_0x207db6||0xc8;return function(_0x541771){if(_0x541771){return _0x7e51a9[_0x6019('0x12')](_0x207db6)['json'](_0x541771);}};}function respondWithFilteredResult(_0x23210b,_0x3d78df){return function(_0x43aebc){if(_0x43aebc){var _0x329562=typeof _0x3d78df[_0x6019('0x13')]===_0x6019('0x14')&&typeof _0x3d78df['limit']===_0x6019('0x14');var _0x365936=_0x43aebc[_0x6019('0x15')];var _0x4bdfde=_0x329562?0x0:_0x3d78df[_0x6019('0x13')];var _0x1a7bcc=_0x329562?_0x43aebc[_0x6019('0x15')]:_0x3d78df[_0x6019('0x13')]+_0x3d78df[_0x6019('0x16')];var _0x29651b;if(_0x1a7bcc>=_0x365936){_0x1a7bcc=_0x365936;_0x29651b=0xc8;}else{_0x29651b=0xce;}_0x23210b[_0x6019('0x12')](_0x29651b);return _0x23210b[_0x6019('0x17')]('Content-Range',_0x4bdfde+'-'+_0x1a7bcc+'/'+_0x365936)['json'](_0x43aebc);}return null;};}function saveUpdates(_0x54efb1){return function(_0x444281){if(_0x444281){return _0x444281['update'](_0x54efb1)[_0x6019('0x18')](function(_0x2767ad){return _0x2767ad;});}return null;};}function removeEntity(_0x471c3b){return function(_0x3399be){if(_0x3399be){return _0x3399be[_0x6019('0x19')]()[_0x6019('0x18')](function(){_0x471c3b[_0x6019('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5961d9){return function(_0x2da78b){if(!_0x2da78b){_0x5961d9[_0x6019('0x1a')](0x194);}return _0x2da78b;};}function handleError(_0x416f3c,_0x1055dc){_0x1055dc=_0x1055dc||0x1f4;return function(_0x145c88){logger[_0x6019('0xc')](_0x145c88[_0x6019('0x1b')]);if(_0x145c88[_0x6019('0x1c')]){delete _0x145c88['name'];}_0x416f3c[_0x6019('0x12')](_0x1055dc)[_0x6019('0x1d')](_0x145c88);};}exports['index']=function(_0x500539,_0x2c8b3c){var _0x385e85={},_0x5894cc={},_0x15e598={'count':0x0,'rows':[]};var _0x127d59=_[_0x6019('0x1e')](db[_0x6019('0x1f')][_0x6019('0x20')],function(_0x337c37){return{'name':_0x337c37[_0x6019('0x21')],'type':_0x337c37[_0x6019('0x22')][_0x6019('0x23')]};});_0x5894cc[_0x6019('0x24')]=_[_0x6019('0x1e')](_0x127d59,'name');_0x5894cc[_0x6019('0x25')]=_[_0x6019('0x26')](_0x500539['query']);_0x5894cc['filters']=_['intersection'](_0x5894cc[_0x6019('0x24')],_0x5894cc['query']);_0x385e85[_0x6019('0x27')]=_['intersection'](_0x5894cc['model'],qs[_0x6019('0x28')](_0x500539[_0x6019('0x25')][_0x6019('0x28')]));_0x385e85[_0x6019('0x27')]=_0x385e85['attributes']['length']?_0x385e85['attributes']:_0x5894cc[_0x6019('0x24')];if(!_0x500539[_0x6019('0x25')]['hasOwnProperty']('nolimit')){_0x385e85['limit']=qs[_0x6019('0x16')](_0x500539[_0x6019('0x25')][_0x6019('0x16')]);_0x385e85[_0x6019('0x13')]=qs[_0x6019('0x13')](_0x500539[_0x6019('0x25')]['offset']);}_0x385e85['order']=qs[_0x6019('0x29')](_0x500539['query'][_0x6019('0x29')]);_0x385e85[_0x6019('0x2a')]=qs[_0x6019('0x2b')](_[_0x6019('0x2c')](_0x500539['query'],_0x5894cc[_0x6019('0x2b')]),_0x127d59);if(_0x500539[_0x6019('0x25')][_0x6019('0x2d')]){_0x385e85[_0x6019('0x2a')]=_['merge'](_0x385e85[_0x6019('0x2a')],{'$or':_[_0x6019('0x1e')](_0x127d59,function(_0x96afec){if(_0x96afec['type']!==_0x6019('0x2e')){var _0x5cc89c={};_0x5cc89c[_0x96afec[_0x6019('0x1c')]]={'$like':'%'+_0x500539[_0x6019('0x25')]['filter']+'%'};return _0x5cc89c;}})});}_0x385e85=_[_0x6019('0x2f')]({},_0x385e85,_0x500539['options']);var _0x5b429c={'where':_0x385e85[_0x6019('0x2a')]};return db[_0x6019('0x1f')][_0x6019('0x15')](_0x5b429c)['then'](function(_0x9bbe66){_0x15e598[_0x6019('0x15')]=_0x9bbe66;if(_0x500539[_0x6019('0x25')][_0x6019('0x30')]){_0x385e85[_0x6019('0x31')]=[{'all':!![]}];}return db[_0x6019('0x1f')][_0x6019('0x32')](_0x385e85);})[_0x6019('0x18')](function(_0x4fa07c){_0x15e598[_0x6019('0x33')]=_0x4fa07c;return _0x15e598;})[_0x6019('0x18')](respondWithFilteredResult(_0x2c8b3c,_0x385e85))[_0x6019('0x11')](handleError(_0x2c8b3c,null));};exports['show']=function(_0x115119,_0x59f765){var _0x56409d={'raw':!![],'where':{'id':_0x115119['params']['id']}},_0x1354c6={};_0x1354c6[_0x6019('0x24')]=_[_0x6019('0x26')](db[_0x6019('0x1f')][_0x6019('0x20')]);_0x1354c6[_0x6019('0x25')]=_[_0x6019('0x26')](_0x115119['query']);_0x1354c6['filters']=_[_0x6019('0x34')](_0x1354c6[_0x6019('0x24')],_0x1354c6[_0x6019('0x25')]);_0x56409d[_0x6019('0x27')]=_[_0x6019('0x34')](_0x1354c6[_0x6019('0x24')],qs[_0x6019('0x28')](_0x115119[_0x6019('0x25')]['fields']));_0x56409d[_0x6019('0x27')]=_0x56409d['attributes'][_0x6019('0x35')]?_0x56409d[_0x6019('0x27')]:_0x1354c6[_0x6019('0x24')];if(_0x115119[_0x6019('0x25')]['includeAll']){_0x56409d[_0x6019('0x31')]=[{'all':!![]}];}_0x56409d=_[_0x6019('0x2f')]({},_0x56409d,_0x115119[_0x6019('0x36')]);return db[_0x6019('0x1f')][_0x6019('0x37')](_0x56409d)[_0x6019('0x18')](handleEntityNotFound(_0x59f765,null))['then'](respondWithResult(_0x59f765,null))[_0x6019('0x11')](handleError(_0x59f765,null));};exports['create']=function(_0x4d2442,_0x3ac0d6){var _0x573e66;return db[_0x6019('0x1f')][_0x6019('0x38')](_0x4d2442[_0x6019('0x39')],{'raw':!![]})['then'](function(_0xd256b4){_0x573e66=_0xd256b4;return db['Network'][_0x6019('0x32')]({'where':{'type':_0x4d2442['body']['type']},'raw':!![]});})[_0x6019('0x18')](function(_0x4671c2){if(_0x573e66[_0x6019('0x22')]['toUpperCase']()=='STUN'){var _0x203e16=fs['readFileSync'](path[_0x6019('0x3a')](config[_0x6019('0x3b')],_0x6019('0x3c')),'utf8');var _0x4d2f7f=ejs[_0x6019('0x3d')](_0x203e16,{'networks':_0x4671c2||[]});fs[_0x6019('0x3e')]('/etc/asterisk/stun_xcally.conf',_0x4d2f7f);return respondWithRpcPromise(_0x6019('0x3f'),'create',{'module':_0x6019('0x40')});}else if(_0x573e66['type'][_0x6019('0x41')]()==_0x6019('0x42')){var _0x33a937=fs[_0x6019('0x43')](path['join'](config[_0x6019('0x3b')],_0x6019('0x44')),_0x6019('0x45'));var _0x15b9b1=ejs[_0x6019('0x3d')](_0x33a937,{'networks':_0x4671c2||[]});fs[_0x6019('0x3e')](_0x6019('0x46'),_0x15b9b1);return respondWithRpcPromise(_0x6019('0x3f'),_0x6019('0x38'),{'module':'res_stun_monitor.so'});}else{var _0xf861d5=fs['readFileSync'](path['join'](config[_0x6019('0x3b')],_0x6019('0x47')),_0x6019('0x45'));var _0x9d7c20=ejs[_0x6019('0x3d')](_0xf861d5,{'networks':_0x4671c2||[]});fs[_0x6019('0x3e')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x4d2442['body']['type']['toLowerCase']()),_0x9d7c20);return respondWithRpcPromise(_0x6019('0x3f'),_0x6019('0x38'),{'module':'chan_sip.so'});}})[_0x6019('0x18')](function(){return _0x573e66;})[_0x6019('0x18')](respondWithResult(_0x3ac0d6,0xc9))[_0x6019('0x11')](handleError(_0x3ac0d6,null));};exports['update']=function(_0x336eab,_0x3018f1){var _0x4aef10;return db['Network'][_0x6019('0x37')]({'where':{'id':_0x336eab[_0x6019('0x48')]['id']}})[_0x6019('0x18')](handleEntityNotFound(_0x3018f1,null))[_0x6019('0x18')](saveUpdates(_0x336eab[_0x6019('0x39')],null))['then'](function(_0x2bb205){if(_0x2bb205){_0x4aef10=_0x2bb205;return db['Network'][_0x6019('0x32')]({'where':{'type':_0x4aef10[_0x6019('0x22')]},'raw':!![]});}return null;})[_0x6019('0x18')](function(_0x2f674c){if(_0x4aef10['type']['toUpperCase']()==_0x6019('0x49')){var _0x5ea9fb=fs[_0x6019('0x43')](path[_0x6019('0x3a')](config['root'],_0x6019('0x3c')),_0x6019('0x45'));var _0x39c9f5=ejs[_0x6019('0x3d')](_0x5ea9fb,{'networks':_0x2f674c||[]});fs[_0x6019('0x3e')](_0x6019('0x4a'),_0x39c9f5);return respondWithRpcPromise(_0x6019('0x3f'),'update',{'module':_0x6019('0x40')});}else if(_0x4aef10[_0x6019('0x22')][_0x6019('0x41')]()==_0x6019('0x42')){var _0x2b4435=fs[_0x6019('0x43')](path[_0x6019('0x3a')](config[_0x6019('0x3b')],_0x6019('0x44')),_0x6019('0x45'));var _0x31a5e3=ejs[_0x6019('0x3d')](_0x2b4435,{'networks':_0x2f674c||[]});fs[_0x6019('0x3e')](_0x6019('0x46'),_0x31a5e3);return respondWithRpcPromise(_0x6019('0x3f'),_0x6019('0x4b'),{'module':'res_stun_monitor.so'});}else{var _0x33491d=fs['readFileSync'](path['join'](config[_0x6019('0x3b')],_0x6019('0x47')),_0x6019('0x45'));var _0x173d9a=ejs['render'](_0x33491d,{'networks':_0x2f674c||[]});fs[_0x6019('0x3e')](util['format'](_0x6019('0x4c'),_0x336eab[_0x6019('0x39')]['type'][_0x6019('0x4d')]()),_0x173d9a);return respondWithRpcPromise('Reload','update',{'module':_0x6019('0x4e')});}})[_0x6019('0x18')](function(_0x55ba6c){if(_0x55ba6c){return _0x4aef10;}return null;})[_0x6019('0x18')](respondWithResult(_0x3018f1,null))['catch'](handleError(_0x3018f1,null));};exports[_0x6019('0x19')]=function(_0x3823bb,_0x450241){var _0x11cbe6;return db[_0x6019('0x1f')][_0x6019('0x37')]({'where':{'id':_0x3823bb['params']['id']}})[_0x6019('0x18')](function(_0x3087b7){_0x11cbe6=_0x3087b7;return _0x3087b7;})[_0x6019('0x18')](handleEntityNotFound(_0x450241,null))[_0x6019('0x18')](removeEntity(_0x450241,null))[_0x6019('0x18')](function(){if(_0x11cbe6){return db[_0x6019('0x1f')][_0x6019('0x32')]({'where':{'type':_0x11cbe6[_0x6019('0x22')]},'raw':!![]});}})[_0x6019('0x18')](function(_0x85acc3){if(_0x11cbe6[_0x6019('0x22')][_0x6019('0x41')]()=='STUN'){var _0x535058=fs[_0x6019('0x43')](path[_0x6019('0x3a')](config[_0x6019('0x3b')],_0x6019('0x3c')),_0x6019('0x45'));var _0x445cae=ejs['render'](_0x535058,{'networks':_0x85acc3||[]});fs['writeFileSync'](_0x6019('0x4a'),_0x445cae);return respondWithRpcPromise(_0x6019('0x3f'),_0x6019('0x19'),{'module':_0x6019('0x40')});}else if(_0x11cbe6[_0x6019('0x22')][_0x6019('0x41')]()==_0x6019('0x42')){var _0x309f45=fs[_0x6019('0x43')](path[_0x6019('0x3a')](config[_0x6019('0x3b')],_0x6019('0x44')),_0x6019('0x45'));var _0xbcd5e9=ejs[_0x6019('0x3d')](_0x309f45,{'networks':_0x85acc3||[]});fs[_0x6019('0x3e')](_0x6019('0x46'),_0xbcd5e9);return respondWithRpcPromise(_0x6019('0x3f'),_0x6019('0x19'),{'module':_0x6019('0x40')});}else{var _0x429fa5=fs[_0x6019('0x43')](path['join'](config[_0x6019('0x3b')],_0x6019('0x47')),_0x6019('0x45'));var _0xc9596b=ejs['render'](_0x429fa5,{'networks':_0x85acc3||[]});fs['writeFileSync'](util[_0x6019('0x4f')](_0x6019('0x4c'),_0x11cbe6['type'][_0x6019('0x4d')]()),_0xc9596b);return respondWithRpcPromise(_0x6019('0x3f'),'destroy',{'module':_0x6019('0x4e')});}})[_0x6019('0x11')](handleError(_0x450241,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 054b78d..8aea07e 100644 --- a/server/api/network/network.model.js +++ b/server/api/network/network.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa699=['Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define'];(function(_0x2f9170,_0x15e46b){var _0x3e3889=function(_0x275a9b){while(--_0x275a9b){_0x2f9170['push'](_0x2f9170['shift']());}};_0x3e3889(++_0x15e46b);}(_0xa699,0x6b));var _0x9a69=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa699[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x9a69('0x0'));var util=require(_0x9a69('0x1'));var logger=require(_0x9a69('0x2'))(_0x9a69('0x3'));var moment=require(_0x9a69('0x4'));var BPromise=require(_0x9a69('0x5'));var rp=require(_0x9a69('0x6'));var fs=require('fs');var path=require(_0x9a69('0x7'));var rimraf=require(_0x9a69('0x8'));var config=require(_0x9a69('0x9'));var attributes=require(_0x9a69('0xa'));module[_0x9a69('0xb')]=function(_0x15f2fc,_0x58eb4d){return _0x15f2fc[_0x9a69('0xc')](_0x9a69('0xd'),attributes,{'tableName':_0x9a69('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0565=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x51d39f,_0x926583){var _0x2f25d2=function(_0x2a40f1){while(--_0x2a40f1){_0x51d39f['push'](_0x51d39f['shift']());}};_0x2f25d2(++_0x926583);}(_0x0565,0xf2));var _0x5056=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x0565[_0x576170];return _0x397c70;};'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('./network.attributes');module[_0x5056('0xa')]=function(_0x105ea8,_0x1143df){return _0x105ea8[_0x5056('0xb')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 1f15136..4e2a263 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x45f27f,_0x410ae4){var _0xb3f1ae=function(_0x502eed){while(--_0x502eed){_0x45f27f['push'](_0x45f27f['shift']());}};_0xb3f1ae(++_0x410ae4);}(_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 moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0xa4097e,_0x2e44fd){_0xa4097e=_0xa4097e-0x0;var _0x50007f=_0x7a54[_0xa4097e];return _0x50007f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 2bcbc5e..2d66d8c 100644 --- a/server/api/openchannelAccount/index.js +++ b/server/api/openchannelAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf32=['notify','/:id/applications','addApplications','addAgents','send','update','delete','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','/:id/dispositions','/:id/notify'];(function(_0x578920,_0x3ddf4b){var _0x390b19=function(_0x7b8306){while(--_0x7b8306){_0x578920['push'](_0x578920['shift']());}};_0x390b19(++_0x3ddf4b);}(_0xdf32,0x143));var _0x2df3=function(_0x9cc7d3,_0x12237d){_0x9cc7d3=_0x9cc7d3-0x0;var _0x300cba=_0xdf32[_0x9cc7d3];return _0x300cba;};'use strict';var multer=require(_0x2df3('0x0'));var util=require(_0x2df3('0x1'));var path=require('path');var timeout=require(_0x2df3('0x2'));var express=require(_0x2df3('0x3'));var router=express[_0x2df3('0x4')]();var fs_extra=require(_0x2df3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2df3('0x6'));var config=require(_0x2df3('0x7'));var controller=require(_0x2df3('0x8'));router[_0x2df3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2df3('0x9')](_0x2df3('0xa'),auth[_0x2df3('0xb')](),controller[_0x2df3('0xc')]);router[_0x2df3('0x9')](_0x2df3('0xd'),auth[_0x2df3('0xb')](),controller[_0x2df3('0xe')]);router['get']('/:id/dispositions',auth[_0x2df3('0xb')](),controller[_0x2df3('0xf')]);router['get'](_0x2df3('0x10'),auth['isAuthenticated'](),controller[_0x2df3('0x11')]);router[_0x2df3('0x9')]('/:id/applications',auth[_0x2df3('0xb')](),controller[_0x2df3('0x12')]);router[_0x2df3('0x9')](_0x2df3('0x13'),auth['isAuthenticated'](),controller[_0x2df3('0x14')]);router['get'](_0x2df3('0x15'),auth[_0x2df3('0xb')](),controller[_0x2df3('0x16')]);router['post']('/',auth[_0x2df3('0xb')](),controller[_0x2df3('0x17')]);router[_0x2df3('0x18')](_0x2df3('0x19'),auth[_0x2df3('0xb')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x2df3('0xb')](),controller['addAnswer']);router[_0x2df3('0x18')](_0x2df3('0x1a'),controller[_0x2df3('0x1b')]);router[_0x2df3('0x18')](_0x2df3('0x1c'),auth[_0x2df3('0xb')](),controller[_0x2df3('0x1d')]);router['post'](_0x2df3('0x15'),auth[_0x2df3('0xb')](),controller[_0x2df3('0x1e')]);router['post']('/:id/send',auth[_0x2df3('0xb')](),controller[_0x2df3('0x1f')]);router['put'](_0x2df3('0xd'),auth[_0x2df3('0xb')](),controller[_0x2df3('0x20')]);router['delete'](_0x2df3('0xd'),auth[_0x2df3('0xb')](),controller['destroy']);router['delete'](_0x2df3('0x19'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x2df3('0x21')](_0x2df3('0x10'),auth[_0x2df3('0xb')](),controller['removeAnswers']);router[_0x2df3('0x21')](_0x2df3('0x15'),auth[_0x2df3('0xb')](),controller[_0x2df3('0x22')]);module['exports']=router; \ No newline at end of file +var _0x1d66=['post','create','/:id/canned_answers','addAnswer','notify','addApplications','/:id/users','addAgents','/:id/send','send','update','delete','destroy','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x1d66,0x148));var _0x61d6=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1d66[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x61d6('0x0'));var util=require('util');var path=require(_0x61d6('0x1'));var timeout=require(_0x61d6('0x2'));var express=require(_0x61d6('0x3'));var router=express['Router']();var fs_extra=require(_0x61d6('0x4'));var auth=require(_0x61d6('0x5'));var interaction=require(_0x61d6('0x6'));var config=require('../../config/environment');var controller=require(_0x61d6('0x7'));router[_0x61d6('0x8')]('/',auth[_0x61d6('0x9')](),controller[_0x61d6('0xa')]);router[_0x61d6('0x8')](_0x61d6('0xb'),auth[_0x61d6('0x9')](),controller[_0x61d6('0xc')]);router[_0x61d6('0x8')](_0x61d6('0xd'),auth[_0x61d6('0x9')](),controller[_0x61d6('0xe')]);router[_0x61d6('0x8')](_0x61d6('0xf'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x10')]);router['get']('/:id/canned_answers',auth[_0x61d6('0x9')](),controller[_0x61d6('0x11')]);router[_0x61d6('0x8')](_0x61d6('0x12'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x13')]);router[_0x61d6('0x8')](_0x61d6('0x14'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x15')]);router[_0x61d6('0x8')]('/:id/users',auth[_0x61d6('0x9')](),controller[_0x61d6('0x16')]);router[_0x61d6('0x17')]('/',auth[_0x61d6('0x9')](),controller[_0x61d6('0x18')]);router[_0x61d6('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x61d6('0x17')](_0x61d6('0x19'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x1a')]);router[_0x61d6('0x17')]('/:id/notify',controller[_0x61d6('0x1b')]);router[_0x61d6('0x17')](_0x61d6('0x12'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x1c')]);router[_0x61d6('0x17')](_0x61d6('0x1d'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x1e')]);router[_0x61d6('0x17')](_0x61d6('0x1f'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x20')]);router['put'](_0x61d6('0xd'),auth['isAuthenticated'](),controller[_0x61d6('0x21')]);router[_0x61d6('0x22')](_0x61d6('0xd'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x23')]);router['delete'](_0x61d6('0xf'),auth[_0x61d6('0x9')](),controller['removeDispositions']);router['delete'](_0x61d6('0x19'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x24')]);router[_0x61d6('0x22')](_0x61d6('0x1d'),auth['isAuthenticated'](),controller[_0x61d6('0x25')]);module[_0x61d6('0x26')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 2ea18a7..439efe1 100644 --- a/server/api/openchannelAccount/openchannelAccount.attributes.js +++ b/server/api/openchannelAccount/openchannelAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x670c=['STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x670c,0xce));var _0xc670=function(_0x2295ce,_0x3d77f2){_0x2295ce=_0x2295ce-0x0;var _0x2897bc=_0x670c[_0x2295ce];return _0x2897bc;};'use strict';var Sequelize=require(_0xc670('0x0'));var rs=require(_0xc670('0x1'));module[_0xc670('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xc670('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc670('0x4')]},'token':{'type':Sequelize[_0xc670('0x4')],'defaultValue':function(){return rs[_0xc670('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc670('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc670('0x6')],'defaultValue':function(){return _0xc670('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc670('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xc670('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc670('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc670('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc670('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc670('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xc670('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc670('0xb'),'set':function(_0xffc251){if(!_0xffc251)this[_0xc670('0xc')](_0xc670('0xd'),null);this[_0xc670('0xc')](_0xc670('0xe'),_0xffc251);}}}; \ No newline at end of file +var _0x9487=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x586c70,_0x5b5294){var _0x1fd79d=function(_0x18a928){while(--_0x18a928){_0x586c70['push'](_0x586c70['shift']());}};_0x1fd79d(++_0x5b5294);}(_0x9487,0x16d));var _0x7948=function(_0x2eabb4,_0x49fd57){_0x2eabb4=_0x2eabb4-0x0;var _0x43b45b=_0x9487[_0x2eabb4];return _0x43b45b;};'use strict';var Sequelize=require(_0x7948('0x0'));var rs=require(_0x7948('0x1'));module[_0x7948('0x2')]={'name':{'type':Sequelize[_0x7948('0x3')],'unique':_0x7948('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x7948('0x3')]},'token':{'type':Sequelize[_0x7948('0x3')],'defaultValue':function(){return rs[_0x7948('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7948('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7948('0x6')],'defaultValue':function(){return _0x7948('0x7');}},'notificationSound':{'type':Sequelize[_0x7948('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7948('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7948('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7948('0x3')]},'queueTransfer':{'type':Sequelize[_0x7948('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7948('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7948('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x7948('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x7948('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x37da09){if(!_0x37da09)this[_0x7948('0xb')]('mandatoryDispositionPauseId',null);this[_0x7948('0xb')](_0x7948('0xc'),_0x37da09);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 7885e78..cb186bb 100644 --- a/server/api/openchannelAccount/openchannelAccount.controller.js +++ b/server/api/openchannelAccount/openchannelAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a62=['addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','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','from','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','threadId','OpenchannelInteraction','externalUrl','spread','contact','lastName','messageId','interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','Pause','intersection','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','OpenchannelAccounts','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe'];(function(_0x243fdb,_0x31adfd){var _0x2e8ecf=function(_0x307ed7){while(--_0x307ed7){_0x243fdb['push'](_0x243fdb['shift']());}};_0x2e8ecf(++_0x31adfd);}(_0x0a62,0x119));var _0x20a6=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0x0a62[_0x42d2af];return _0x1d6d63;};'use strict';var emlformat=require(_0x20a6('0x0'));var rimraf=require(_0x20a6('0x1'));var zipdir=require(_0x20a6('0x2'));var jsonpatch=require(_0x20a6('0x3'));var rp=require(_0x20a6('0x4'));var moment=require(_0x20a6('0x5'));var BPromise=require(_0x20a6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x20a6('0x7'));var sox=require(_0x20a6('0x8'));var csv=require('to-csv');var ejs=require(_0x20a6('0x9'));var fs=require('fs');var fs_extra=require(_0x20a6('0xa'));var _=require(_0x20a6('0xb'));var squel=require(_0x20a6('0xc'));var crypto=require(_0x20a6('0xd'));var jsforce=require(_0x20a6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x20a6('0xf'));var authService=require(_0x20a6('0x10'));var qs=require(_0x20a6('0x11'));var as=require(_0x20a6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20a6('0x13'))(_0x20a6('0x14'));var utils=require(_0x20a6('0x15'));var config=require(_0x20a6('0x16'));var licenseUtil=require(_0x20a6('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x20a6('0x18')](config[_0x20a6('0x19')],{'host':_0x20a6('0x1a'),'port':0x18eb});var socket=require(_0x20a6('0x1b'))(new Redis(config[_0x20a6('0x19')]));require(_0x20a6('0x1c'))[_0x20a6('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x20a6('0x1e')][_0x20a6('0x1f')]({'port':0x232c});var client9002=jayson[_0x20a6('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47966c,_0x167d2c,_0x249e00,_0x2aab0e){return new BPromise(function(_0x56edcb,_0x4bc6bb){var _0x1ec6bb=_0x2aab0e||client;return _0x1ec6bb[_0x20a6('0x20')](_0x47966c,_0x249e00)[_0x20a6('0x21')](function(_0x3ed2f4){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x167d2c,_0x20a6('0x22'));logger[_0x20a6('0x23')](_0x20a6('0x24'),_0x167d2c,_0x20a6('0x22'),JSON[_0x20a6('0x25')](_0x3ed2f4));if(_0x3ed2f4[_0x20a6('0x26')]){if(_0x3ed2f4['error'][_0x20a6('0x27')]===0x1f4){logger[_0x20a6('0x26')](_0x20a6('0x28'),_0x167d2c,_0x3ed2f4[_0x20a6('0x26')][_0x20a6('0x29')]);return _0x4bc6bb(_0x3ed2f4[_0x20a6('0x26')][_0x20a6('0x29')]);}logger[_0x20a6('0x26')](_0x20a6('0x28'),_0x167d2c,_0x3ed2f4[_0x20a6('0x26')][_0x20a6('0x29')]);return _0x56edcb(_0x3ed2f4['error'][_0x20a6('0x29')]);}else{logger[_0x20a6('0x2a')](_0x20a6('0x28'),_0x167d2c,_0x20a6('0x22'));_0x56edcb(_0x3ed2f4[_0x20a6('0x2b')][_0x20a6('0x29')]);}})[_0x20a6('0x2c')](function(_0x5634bd){logger[_0x20a6('0x26')](_0x20a6('0x28'),_0x167d2c,_0x5634bd);_0x4bc6bb(_0x5634bd);});});}function respondWithStatusCode(_0x18cb71,_0x458cc4){_0x458cc4=_0x458cc4||0xcc;return function(_0x56c604){if(_0x56c604){return _0x18cb71[_0x20a6('0x2d')](_0x458cc4);}return _0x18cb71['status'](_0x458cc4)['end']();};}function respondWithResult(_0x2e14e9,_0x20cb53){_0x20cb53=_0x20cb53||0xc8;return function(_0x387df4){if(_0x387df4){return _0x2e14e9[_0x20a6('0x2e')](_0x20cb53)[_0x20a6('0x2f')](_0x387df4);}};}function respondWithFilteredResult(_0x4cb2df,_0x969d03){return function(_0x2fa436){if(_0x2fa436){var _0x174a8e=typeof _0x969d03[_0x20a6('0x30')]===_0x20a6('0x31')&&typeof _0x969d03[_0x20a6('0x32')]===_0x20a6('0x31');var _0x4a6677=_0x2fa436[_0x20a6('0x33')];var _0x46a11d=_0x174a8e?0x0:_0x969d03['offset'];var _0x11bae6=_0x174a8e?_0x2fa436[_0x20a6('0x33')]:_0x969d03['offset']+_0x969d03[_0x20a6('0x32')];var _0x3906b5;if(_0x11bae6>=_0x4a6677){_0x11bae6=_0x4a6677;_0x3906b5=0xc8;}else{_0x3906b5=0xce;}_0x4cb2df[_0x20a6('0x2e')](_0x3906b5);return _0x4cb2df[_0x20a6('0x34')](_0x20a6('0x35'),_0x46a11d+'-'+_0x11bae6+'/'+_0x4a6677)[_0x20a6('0x2f')](_0x2fa436);}return null;};}function patchUpdates(_0x5f0c63){return function(_0x33d95e){try{jsonpatch[_0x20a6('0x36')](_0x33d95e,_0x5f0c63,!![]);}catch(_0x101b4b){return BPromise[_0x20a6('0x37')](_0x101b4b);}return _0x33d95e['save']();};}function saveUpdates(_0x504e95,_0x45d52b){return function(_0x117c75){if(_0x117c75){return _0x117c75[_0x20a6('0x38')](_0x504e95)['then'](function(_0x2796d8){return _0x2796d8;});}return null;};}function removeEntity(_0x20ad21,_0x223f11){return function(_0x3a4185){if(_0x3a4185){return _0x3a4185[_0x20a6('0x39')]()[_0x20a6('0x21')](function(){var _0x1fb57d=_0x3a4185['get']({'plain':!![]});var _0x3b1b96='OpenchannelAccounts';return db['UserProfileResource'][_0x20a6('0x39')]({'where':{'type':_0x3b1b96,'resourceId':_0x1fb57d['id']}})['then'](function(){return _0x3a4185;});})[_0x20a6('0x21')](function(){_0x20ad21[_0x20a6('0x2e')](0xcc)[_0x20a6('0x3a')]();});}};}function handleEntityNotFound(_0xa3e349,_0x34d38a){return function(_0x4604a8){if(!_0x4604a8){_0xa3e349[_0x20a6('0x2d')](0x194);}return _0x4604a8;};}function handleError(_0x13d9ed,_0x3a3f71){_0x3a3f71=_0x3a3f71||0x1f4;return function(_0x509bab){logger[_0x20a6('0x26')](_0x509bab[_0x20a6('0x3b')]);if(_0x509bab[_0x20a6('0x3c')]){delete _0x509bab[_0x20a6('0x3c')];}_0x13d9ed[_0x20a6('0x2e')](_0x3a3f71)[_0x20a6('0x3d')](_0x509bab);};}exports[_0x20a6('0x3e')]=function(_0x1b8714,_0x22e9cb){var _0x3b0522={'include':[{'model':db['Pause'],'as':_0x20a6('0x3f')}]},_0x4ef04a={},_0xd28e8={'count':0x0,'rows':[]};var _0xe62ef3=_[_0x20a6('0x40')](db[_0x20a6('0x41')][_0x20a6('0x42')],function(_0x20370d){return{'name':_0x20370d[_0x20a6('0x43')],'type':_0x20370d[_0x20a6('0x44')][_0x20a6('0x45')]};});_0x4ef04a['model']=_['map'](_0xe62ef3,_0x20a6('0x3c'));_0x4ef04a[_0x20a6('0x46')]=_[_0x20a6('0x47')](_0x1b8714[_0x20a6('0x46')]);_0x4ef04a[_0x20a6('0x48')]=_['intersection'](_0x4ef04a[_0x20a6('0x49')],_0x4ef04a[_0x20a6('0x46')]);_0x3b0522[_0x20a6('0x4a')]=_['intersection'](_0x4ef04a[_0x20a6('0x49')],qs[_0x20a6('0x4b')](_0x1b8714[_0x20a6('0x46')]['fields']));_0x3b0522['attributes']=_0x3b0522['attributes']['length']?_0x3b0522[_0x20a6('0x4a')]:_0x4ef04a[_0x20a6('0x49')];if(!_0x1b8714[_0x20a6('0x46')][_0x20a6('0x4c')]('nolimit')){_0x3b0522[_0x20a6('0x32')]=qs[_0x20a6('0x32')](_0x1b8714['query'][_0x20a6('0x32')]);_0x3b0522['offset']=qs['offset'](_0x1b8714['query'][_0x20a6('0x30')]);}_0x3b0522[_0x20a6('0x4d')]=qs[_0x20a6('0x4e')](_0x1b8714[_0x20a6('0x46')][_0x20a6('0x4e')]);_0x3b0522[_0x20a6('0x4f')]=qs[_0x20a6('0x48')](_[_0x20a6('0x50')](_0x1b8714['query'],_0x4ef04a['filters']),_0xe62ef3);if(_0x1b8714[_0x20a6('0x46')][_0x20a6('0x51')]){_0x3b0522[_0x20a6('0x4f')]=_[_0x20a6('0x52')](_0x3b0522[_0x20a6('0x4f')],{'$or':_[_0x20a6('0x40')](_0xe62ef3,function(_0x25f010){if(_0x25f010[_0x20a6('0x44')]!==_0x20a6('0x53')){var _0x119f80={};_0x119f80[_0x25f010[_0x20a6('0x3c')]]={'$like':'%'+_0x1b8714[_0x20a6('0x46')][_0x20a6('0x51')]+'%'};return _0x119f80;}})});}_0x3b0522=_[_0x20a6('0x52')]({},_0x3b0522,_0x1b8714[_0x20a6('0x54')]);var _0x8b99ec={'where':_0x3b0522[_0x20a6('0x4f')]};return db[_0x20a6('0x41')]['count'](_0x8b99ec)[_0x20a6('0x21')](function(_0x5d904e){_0xd28e8[_0x20a6('0x33')]=_0x5d904e;if(_0x1b8714[_0x20a6('0x46')][_0x20a6('0x55')]){_0x3b0522['include']=[{'all':!![]}];}return db[_0x20a6('0x41')][_0x20a6('0x56')](_0x3b0522);})['then'](function(_0x4565a6){_0xd28e8[_0x20a6('0x57')]=_0x4565a6;return _0xd28e8;})[_0x20a6('0x21')](respondWithFilteredResult(_0x22e9cb,_0x3b0522))[_0x20a6('0x2c')](handleError(_0x22e9cb,null));};exports[_0x20a6('0x58')]=function(_0x379ce4,_0x3f50c9){var _0x173982={'raw':![],'where':{'id':_0x379ce4[_0x20a6('0x59')]['id']},'include':[{'model':db[_0x20a6('0x5a')],'as':'mandatoryDispositionPause'}]},_0x47172f={};_0x47172f[_0x20a6('0x49')]=_[_0x20a6('0x47')](db['OpenchannelAccount'][_0x20a6('0x42')]);_0x47172f['query']=_[_0x20a6('0x47')](_0x379ce4[_0x20a6('0x46')]);_0x47172f['filters']=_[_0x20a6('0x5b')](_0x47172f[_0x20a6('0x49')],_0x47172f[_0x20a6('0x46')]);_0x173982[_0x20a6('0x4a')]=_[_0x20a6('0x5b')](_0x47172f[_0x20a6('0x49')],qs[_0x20a6('0x4b')](_0x379ce4[_0x20a6('0x46')][_0x20a6('0x4b')]));_0x173982['attributes']=_0x173982[_0x20a6('0x4a')][_0x20a6('0x5c')]?_0x173982[_0x20a6('0x4a')]:_0x47172f[_0x20a6('0x49')];if(_0x379ce4[_0x20a6('0x46')]['includeAll']){_0x173982[_0x20a6('0x5d')]=[{'all':!![]}];}_0x173982=_[_0x20a6('0x52')]({},_0x173982,_0x379ce4['options']);return db[_0x20a6('0x41')][_0x20a6('0x5e')](_0x173982)[_0x20a6('0x21')](handleEntityNotFound(_0x3f50c9,null))[_0x20a6('0x21')](respondWithResult(_0x3f50c9,null))[_0x20a6('0x2c')](handleError(_0x3f50c9,null));};exports[_0x20a6('0x5f')]=function(_0x22c03c,_0x44ef3e){return db[_0x20a6('0x41')][_0x20a6('0x5f')](_0x22c03c[_0x20a6('0x60')],{})[_0x20a6('0x21')](function(_0x1e8039){var _0x4d2c05=_0x22c03c[_0x20a6('0x61')]['get']({'plain':!![]});if(!_0x4d2c05)throw new Error(_0x20a6('0x62'));if(_0x4d2c05[_0x20a6('0x63')]===_0x20a6('0x61')){var _0x3962e6=_0x1e8039[_0x20a6('0x64')]({'plain':!![]});var _0x1ba7bf=_0x20a6('0x65');return db[_0x20a6('0x66')][_0x20a6('0x5e')]({'where':{'name':_0x1ba7bf,'userProfileId':_0x4d2c05['userProfileId']},'raw':!![]})['then'](function(_0x4a73ca){if(_0x4a73ca&&_0x4a73ca[_0x20a6('0x67')]===0x0){return db[_0x20a6('0x68')][_0x20a6('0x5f')]({'name':_0x3962e6[_0x20a6('0x3c')],'resourceId':_0x3962e6['id'],'type':_0x4a73ca[_0x20a6('0x3c')],'sectionId':_0x4a73ca['id']},{})[_0x20a6('0x21')](function(){return _0x1e8039;});}else{return _0x1e8039;}})[_0x20a6('0x2c')](function(_0x423700){logger[_0x20a6('0x26')](_0x20a6('0x69'),_0x423700);throw _0x423700;});}return _0x1e8039;})['then'](respondWithResult(_0x44ef3e,0xc9))['catch'](handleError(_0x44ef3e,null));};exports['update']=function(_0x41f372,_0x49db09){if(_0x41f372[_0x20a6('0x60')]['id']){delete _0x41f372[_0x20a6('0x60')]['id'];}return db['OpenchannelAccount'][_0x20a6('0x5e')]({'where':{'id':_0x41f372['params']['id']},'include':[{'model':db[_0x20a6('0x5a')],'as':_0x20a6('0x3f')}]})[_0x20a6('0x21')](handleEntityNotFound(_0x49db09,null))[_0x20a6('0x21')](saveUpdates(_0x41f372['body'],null))['then'](respondWithResult(_0x49db09,null))[_0x20a6('0x2c')](handleError(_0x49db09,null));};exports[_0x20a6('0x39')]=function(_0x5a0dcb,_0x2391d1){return db[_0x20a6('0x41')][_0x20a6('0x5e')]({'where':{'id':_0x5a0dcb['params']['id']}})[_0x20a6('0x21')](handleEntityNotFound(_0x2391d1,null))['then'](removeEntity(_0x2391d1,null))['catch'](handleError(_0x2391d1,null));};exports[_0x20a6('0x6a')]=function(_0x17dfa2,_0x32cdc0){return db['OpenchannelAccount']['describe']()[_0x20a6('0x21')](respondWithResult(_0x32cdc0,null))[_0x20a6('0x2c')](handleError(_0x32cdc0,null));};exports[_0x20a6('0x6b')]=function(_0x44d980,_0x196274,_0x512c8e){if(_0x44d980['body']['id']){delete _0x44d980[_0x20a6('0x60')]['id'];}return db['OpenchannelAccount'][_0x20a6('0x5e')]({'where':{'id':_0x44d980['params']['id']}})[_0x20a6('0x21')](handleEntityNotFound(_0x196274,null))['then'](function(_0x29a902){if(_0x29a902){_0x44d980[_0x20a6('0x60')][_0x20a6('0x6c')]=_0x29a902['id'];return db[_0x20a6('0x6d')][_0x20a6('0x5f')](_0x44d980[_0x20a6('0x60')]);}})[_0x20a6('0x21')](respondWithResult(_0x196274,null))[_0x20a6('0x2c')](handleError(_0x196274,null));};exports[_0x20a6('0x6e')]=function(_0x2e3e93,_0x4e4c9f,_0x46e02f){var _0x2f5e93={'raw':![],'where':{}};var _0x43f4b6={};var _0x2f232d={'count':0x0,'rows':[]};return db[_0x20a6('0x41')][_0x20a6('0x6f')]({'where':{'id':_0x2e3e93[_0x20a6('0x59')]['id']}})['then'](handleEntityNotFound(_0x4e4c9f,null))[_0x20a6('0x21')](function(_0x255748){if(_0x255748){_0x43f4b6[_0x20a6('0x49')]=_['keys'](db[_0x20a6('0x6d')][_0x20a6('0x42')]);_0x43f4b6[_0x20a6('0x46')]=_[_0x20a6('0x47')](_0x2e3e93[_0x20a6('0x46')]);_0x43f4b6[_0x20a6('0x48')]=_[_0x20a6('0x5b')](_0x43f4b6[_0x20a6('0x49')],_0x43f4b6['query']);_0x2f5e93[_0x20a6('0x4a')]=_[_0x20a6('0x5b')](_0x43f4b6[_0x20a6('0x49')],qs[_0x20a6('0x4b')](_0x2e3e93[_0x20a6('0x46')]['fields']));_0x2f5e93[_0x20a6('0x4a')]=_0x2f5e93[_0x20a6('0x4a')]['length']?_0x2f5e93['attributes']:_0x43f4b6['model'];if(!_0x2e3e93[_0x20a6('0x46')][_0x20a6('0x4c')]('nolimit')){_0x2f5e93[_0x20a6('0x32')]=qs['limit'](_0x2e3e93[_0x20a6('0x46')]['limit']);_0x2f5e93['offset']=qs[_0x20a6('0x30')](_0x2e3e93[_0x20a6('0x46')][_0x20a6('0x30')]);}_0x2f5e93[_0x20a6('0x4d')]=qs[_0x20a6('0x4e')](_0x2e3e93['query'][_0x20a6('0x4e')]);_0x2f5e93[_0x20a6('0x4f')]=qs['filters'](_[_0x20a6('0x50')](_0x2e3e93[_0x20a6('0x46')],_0x43f4b6[_0x20a6('0x48')]));_0x2f5e93[_0x20a6('0x4f')]['OpenchannelAccountId']=_0x255748['id'];if(_0x2e3e93[_0x20a6('0x46')][_0x20a6('0x51')]){_0x2f5e93['where']=_[_0x20a6('0x52')](_0x2f5e93[_0x20a6('0x4f')],{'$or':_[_0x20a6('0x40')](_0x2f5e93[_0x20a6('0x4a')],function(_0x10f228){var _0x1b34b5={};_0x1b34b5[_0x10f228]={'$like':'%'+_0x2e3e93[_0x20a6('0x46')]['filter']+'%'};return _0x1b34b5;})});}_0x2f5e93=_[_0x20a6('0x52')]({},_0x2f5e93,_0x2e3e93[_0x20a6('0x54')]);return db[_0x20a6('0x6d')][_0x20a6('0x33')]({'where':_0x2f5e93[_0x20a6('0x4f')]})['then'](function(_0x277382){_0x2f232d[_0x20a6('0x33')]=_0x277382;if(_0x2e3e93[_0x20a6('0x46')][_0x20a6('0x55')]){_0x2f5e93['include']=[{'all':!![]}];}return db[_0x20a6('0x6d')][_0x20a6('0x56')](_0x2f5e93);})['then'](function(_0x5d7e98){_0x2f232d[_0x20a6('0x57')]=_0x5d7e98;return _0x2f232d;});}})['then'](respondWithFilteredResult(_0x4e4c9f,_0x2f5e93))['catch'](handleError(_0x4e4c9f,null));};exports[_0x20a6('0x70')]=function(_0x52c96e,_0x1651e4,_0x3558aa){return db[_0x20a6('0x41')]['find']({'where':{'id':_0x52c96e[_0x20a6('0x59')]['id']}})['then'](handleEntityNotFound(_0x1651e4,null))[_0x20a6('0x21')](function(_0x4d9747){if(_0x4d9747){return _0x4d9747['removeDispositions'](_0x52c96e[_0x20a6('0x46')][_0x20a6('0x71')]);}})[_0x20a6('0x21')](respondWithStatusCode(_0x1651e4,null))[_0x20a6('0x2c')](handleError(_0x1651e4,null));};exports[_0x20a6('0x72')]=function(_0x4f86a1,_0x43219f,_0x191100){if(_0x4f86a1[_0x20a6('0x60')]['id']){delete _0x4f86a1['body']['id'];}return db[_0x20a6('0x41')][_0x20a6('0x5e')]({'where':{'id':_0x4f86a1[_0x20a6('0x59')]['id']}})[_0x20a6('0x21')](handleEntityNotFound(_0x43219f,null))[_0x20a6('0x21')](function(_0x1ff883){if(_0x1ff883){_0x4f86a1[_0x20a6('0x60')][_0x20a6('0x6c')]=_0x1ff883['id'];return db[_0x20a6('0x73')][_0x20a6('0x5f')](_0x4f86a1['body']);}})[_0x20a6('0x21')](respondWithResult(_0x43219f,null))[_0x20a6('0x2c')](handleError(_0x43219f,null));};exports[_0x20a6('0x74')]=function(_0x5df465,_0x4a3a48,_0x303d73){var _0x4cdfdf={'raw':![],'where':{}};var _0x4da244={};var _0x3e564d={'count':0x0,'rows':[]};return db[_0x20a6('0x41')][_0x20a6('0x6f')]({'where':{'id':_0x5df465[_0x20a6('0x59')]['id']}})[_0x20a6('0x21')](handleEntityNotFound(_0x4a3a48,null))[_0x20a6('0x21')](function(_0x267a51){if(_0x267a51){_0x4da244[_0x20a6('0x49')]=_[_0x20a6('0x47')](db[_0x20a6('0x73')][_0x20a6('0x42')]);_0x4da244[_0x20a6('0x46')]=_[_0x20a6('0x47')](_0x5df465['query']);_0x4da244[_0x20a6('0x48')]=_[_0x20a6('0x5b')](_0x4da244[_0x20a6('0x49')],_0x4da244[_0x20a6('0x46')]);_0x4cdfdf[_0x20a6('0x4a')]=_[_0x20a6('0x5b')](_0x4da244[_0x20a6('0x49')],qs['fields'](_0x5df465[_0x20a6('0x46')]['fields']));_0x4cdfdf[_0x20a6('0x4a')]=_0x4cdfdf[_0x20a6('0x4a')]['length']?_0x4cdfdf[_0x20a6('0x4a')]:_0x4da244[_0x20a6('0x49')];if(!_0x5df465[_0x20a6('0x46')][_0x20a6('0x4c')](_0x20a6('0x75'))){_0x4cdfdf[_0x20a6('0x32')]=qs['limit'](_0x5df465['query'][_0x20a6('0x32')]);_0x4cdfdf[_0x20a6('0x30')]=qs[_0x20a6('0x30')](_0x5df465[_0x20a6('0x46')][_0x20a6('0x30')]);}_0x4cdfdf[_0x20a6('0x4d')]=qs[_0x20a6('0x4e')](_0x5df465[_0x20a6('0x46')][_0x20a6('0x4e')]);_0x4cdfdf['where']=qs['filters'](_[_0x20a6('0x50')](_0x5df465[_0x20a6('0x46')],_0x4da244[_0x20a6('0x48')]));_0x4cdfdf[_0x20a6('0x4f')]['OpenchannelAccountId']=_0x267a51['id'];if(_0x5df465['query'][_0x20a6('0x51')]){_0x4cdfdf['where']=_[_0x20a6('0x52')](_0x4cdfdf[_0x20a6('0x4f')],{'$or':_[_0x20a6('0x40')](_0x4cdfdf['attributes'],function(_0x5d5494){var _0x258710={};_0x258710[_0x5d5494]={'$like':'%'+_0x5df465[_0x20a6('0x46')][_0x20a6('0x51')]+'%'};return _0x258710;})});}_0x4cdfdf=_[_0x20a6('0x52')]({},_0x4cdfdf,_0x5df465['options']);return db[_0x20a6('0x73')][_0x20a6('0x33')]({'where':_0x4cdfdf[_0x20a6('0x4f')]})['then'](function(_0x5d1d05){_0x3e564d['count']=_0x5d1d05;if(_0x5df465[_0x20a6('0x46')]['includeAll']){_0x4cdfdf[_0x20a6('0x5d')]=[{'all':!![]}];}return db[_0x20a6('0x73')][_0x20a6('0x56')](_0x4cdfdf);})['then'](function(_0x1cf4f7){_0x3e564d[_0x20a6('0x57')]=_0x1cf4f7;return _0x3e564d;});}})['then'](respondWithFilteredResult(_0x4a3a48,_0x4cdfdf))[_0x20a6('0x2c')](handleError(_0x4a3a48,null));};exports[_0x20a6('0x76')]=function(_0x3625cb,_0xf6f45d,_0x10214d){return db[_0x20a6('0x41')][_0x20a6('0x5e')]({'where':{'id':_0x3625cb['params']['id']}})[_0x20a6('0x21')](handleEntityNotFound(_0xf6f45d,null))['then'](function(_0x4b5e5f){if(_0x4b5e5f){return _0x4b5e5f[_0x20a6('0x76')](_0x3625cb[_0x20a6('0x46')][_0x20a6('0x71')]);}})[_0x20a6('0x21')](respondWithStatusCode(_0xf6f45d,null))[_0x20a6('0x2c')](handleError(_0xf6f45d,null));};exports[_0x20a6('0x77')]=function(_0x155496,_0x141653,_0x58da24){var _0x3bc4f8={'body':_0x155496['body'],'channel':'openchannel'};var _0x2d711e=[];var _0x59ef89=[];var _0x3c7117={};var _0x4abdd2=![];return db[_0x20a6('0x78')][_0x20a6('0x6a')]()[_0x20a6('0x21')](function(_0x10eee9){if(!_0x10eee9){throw new db[(_0x20a6('0x79'))][(_0x20a6('0x7a'))]('no\x20available\x20attributes');}_0x2d711e=_['difference'](_['keys'](_0x10eee9),[_0x20a6('0x7b'),_0x20a6('0x7c')]);_0x59ef89=_[_0x20a6('0x7d')](_[_0x20a6('0x47')](_0x10eee9),[_0x20a6('0x7b'),_0x20a6('0x7c'),_0x20a6('0x7e'),_0x20a6('0x7f')]);if(_0x155496[_0x20a6('0x60')]['id']){delete _0x155496[_0x20a6('0x60')]['id'];}if(_[_0x20a6('0x80')](_0x155496[_0x20a6('0x60')]['from'])){throw new db[(_0x20a6('0x79'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x20a6('0x80')](_0x155496[_0x20a6('0x60')]['body'])||_0x155496[_0x20a6('0x60')]['body']===''){throw new db[(_0x20a6('0x79'))][(_0x20a6('0x7a'))](_0x20a6('0x81'));}if(_[_0x20a6('0x80')](_0x155496[_0x20a6('0x60')][_0x20a6('0x82')])){throw new db[(_0x20a6('0x79'))][(_0x20a6('0x7a'))](_0x20a6('0x83')+_0x59ef89);}if(!_[_0x20a6('0x84')](_0x59ef89,_0x155496[_0x20a6('0x60')][_0x20a6('0x82')])){throw new db['Sequelize'][(_0x20a6('0x7a'))](_0x20a6('0x85')+_0x59ef89);}_0x3c7117[_0x155496[_0x20a6('0x60')][_0x20a6('0x82')]]=_0x155496[_0x20a6('0x60')][_0x20a6('0x86')];})['then'](function(){return db[_0x20a6('0x41')]['find']({'where':{'id':_0x155496[_0x20a6('0x59')]['id']},'include':[{'model':db[_0x20a6('0x87')],'as':_0x20a6('0x88'),'include':[{'model':db[_0x20a6('0x78')],'as':_0x20a6('0x89'),'where':_0x3c7117,'limit':0x1,'order':[[_0x20a6('0x7c'),'DESC']]}]},{'model':db[_0x20a6('0x8a')],'as':_0x20a6('0x8b')}]});})['then'](handleEntityNotFound(_0x141653,null))['then'](function(_0x4a32c4){if(_0x4a32c4&&_0x4a32c4[_0x20a6('0x88')]){_0x3bc4f8[_0x20a6('0x8c')]=_0x4a32c4;_0x3bc4f8['applications']=_0x4a32c4['Applications'];_0x3bc4f8['list']=_0x4a32c4[_0x20a6('0x88')];_0x3bc4f8[_0x20a6('0x8d')]=_[_0x20a6('0x8e')](_0x3bc4f8[_0x20a6('0x8d')],[_0x20a6('0x8f')],[_0x20a6('0x90')]);if(_0x3bc4f8[_0x20a6('0x8c')][_0x20a6('0x8b')]){delete _0x3bc4f8[_0x20a6('0x8c')][_0x20a6('0x8b')];}if(_0x3bc4f8[_0x20a6('0x8c')][_0x20a6('0x88')]&&_0x3bc4f8[_0x20a6('0x8c')][_0x20a6('0x88')][_0x20a6('0x89')][_0x20a6('0x5c')]){return _0x3bc4f8['account']['List'][_0x20a6('0x89')][0x0];}var _0x355a87=_[_0x20a6('0x18')](_0x155496['body'],{'firstName':_0x155496[_0x20a6('0x60')][_0x20a6('0x86')],'ListId':_0x4a32c4[_0x20a6('0x7f')]});_0x355a87[_0x155496['body'][_0x20a6('0x82')]]=_0x155496[_0x20a6('0x60')][_0x20a6('0x86')];return db[_0x20a6('0x78')]['create'](_0x355a87,{'fields':_0x2d711e,'raw':!![]});}})[_0x20a6('0x21')](handleEntityNotFound(_0x141653,null))[_0x20a6('0x21')](function(_0x48808c){_0x3bc4f8['contact']=_0x48808c;if(_0x48808c){var _0x4876e8={'ContactId':_0x48808c['id'],'OpenchannelAccountId':_0x155496[_0x20a6('0x59')]['id'],'from':(_0x48808c['firstName']||'')+'\x20'+(_0x48808c['lastName']||'')};var _0xe83c24={'OpenchannelAccountId':_0x155496['params']['id'],'closed':![]};if(_0x155496[_0x20a6('0x60')][_0x20a6('0x91')]){_0xe83c24[_0x20a6('0x91')]=_0x155496[_0x20a6('0x60')]['threadId'];return db[_0x20a6('0x92')][_0x20a6('0x5e')]({'where':_0xe83c24})[_0x20a6('0x21')](function(_0x236a7e){if(_0x236a7e){return[_0x236a7e,![]];}_0x4876e8[_0x20a6('0x91')]=_0x155496[_0x20a6('0x60')][_0x20a6('0x91')];_0x4876e8[_0x20a6('0x93')]=_0x155496[_0x20a6('0x60')]['externalUrl'];return db[_0x20a6('0x92')][_0x20a6('0x5f')](_0x4876e8)['then'](function(_0x2ff680){return[_0x2ff680,!![]];});});}else{_0xe83c24['threadId']=null;}_0xe83c24['ContactId']=_0x48808c['id'];return db[_0x20a6('0x92')][_0x20a6('0x5e')]({'where':_0xe83c24})[_0x20a6('0x21')](function(_0x390722){if(_0x390722){return[_0x390722,![]];}return db[_0x20a6('0x92')][_0x20a6('0x5f')](_0x4876e8)[_0x20a6('0x21')](function(_0x5bc930){return[_0x5bc930,!![]];});});}})[_0x20a6('0x94')](function(_0x565294,_0x55b13f){if(_0x565294){_0x4abdd2=_0x55b13f;if(!_0x55b13f){var _0x1de5de={'from':(_0x3bc4f8['contact']['firstName']||'')+'\x20'+(_0x3bc4f8[_0x20a6('0x95')][_0x20a6('0x96')]||'')};if(_0x155496['body'][_0x20a6('0x91')]&&_0x155496[_0x20a6('0x60')][_0x20a6('0x97')]&&_0x155496[_0x20a6('0x60')][_0x20a6('0x91')]!=_0x155496[_0x20a6('0x60')][_0x20a6('0x97')]){_0x1de5de[_0x20a6('0x91')]=_0x155496['body']['messageId'];}return _0x565294[_0x20a6('0x38')](_0x1de5de);}else{return _0x565294;}}})[_0x20a6('0x21')](function(_0x2f67fe){_0x3bc4f8[_0x20a6('0x98')]=_0x2f67fe[_0x20a6('0x64')]({'plain':!![]});_0x3bc4f8['interaction']['created']=_0x4abdd2;if(_0x3bc4f8[_0x20a6('0x98')][_0x20a6('0x99')]){if(_0x3bc4f8['account']['autoclose']){_0x3bc4f8[_0x20a6('0x8d')]['push']({'id':0x0,'priority':_0x3bc4f8[_0x20a6('0x8d')][_0x20a6('0x5c')]+0x1,'app':_0x20a6('0x9a'),'appdata':_0x20a6('0x9b'),'interval':_0x20a6('0x9c')});}}return db[_0x20a6('0x9d')]['create']({'body':_0x155496[_0x20a6('0x60')][_0x20a6('0x60')],'OpenchannelAccountId':_0x155496[_0x20a6('0x59')]['id'],'OpenchannelInteractionId':_0x2f67fe['id'],'direction':'in','ContactId':_0x3bc4f8['contact']['id'],'AttachmentId':_0x155496[_0x20a6('0x60')][_0x20a6('0x9e')]});})[_0x20a6('0x21')](function(_0x33a7a9){_0x3bc4f8['message']=_0x33a7a9;if(_0x3bc4f8[_0x20a6('0x98')][_0x20a6('0x9f')]){return db[_0x20a6('0xa0')][_0x20a6('0x5e')]({'attributes':['id',_0x20a6('0x3c')],'where':{'id':_0x3bc4f8['interaction'][_0x20a6('0x9f')]}})[_0x20a6('0x21')](function(_0xfec3e3){if(_0xfec3e3){_0x3bc4f8['applications'][_0x20a6('0xa1')]({'id':0x0,'priority':0x0,'app':_0x20a6('0xa2'),'appdata':_0xfec3e3[_0x20a6('0x3c')]+','+(_0x3bc4f8[_0x20a6('0x8c')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x3bc4f8['forcedOwnership']=![];}return respondWithRpcPromise(_0x20a6('0xa3'),_0x20a6('0xa4'),_0x3bc4f8);});}return respondWithRpcPromise(_0x20a6('0xa3'),_0x20a6('0xa4'),_0x3bc4f8);})[_0x20a6('0x21')](function(_0x4b823f){respondWithRpcPromise('EventManager',_0x20a6('0xa5'),{'event':_0x20a6('0x77'),'message':_0x4b823f},client9002);return _0x4b823f;})['then'](respondWithResult(_0x141653,null))[_0x20a6('0x2c')](handleError(_0x141653,null));};exports[_0x20a6('0xa6')]=function(_0x161232,_0x341a74){var _0x269cc8=_0x161232[_0x20a6('0x59')]['id'];var _0x3280df=_0x161232[_0x20a6('0x60')];var _0x3725ef=0xc8;var _0x108b28=null;return db[_0x20a6('0xa7')][_0x20a6('0xa8')]({'isolationLevel':db[_0x20a6('0xa7')][_0x20a6('0xa9')][_0x20a6('0xaa')][_0x20a6('0xab')]},function(_0x169fed){return db[_0x20a6('0x41')]['findOne']({'where':{'id':_0x269cc8},'transaction':_0x169fed})['then'](function(_0x5ae126){if(_0x5ae126){return db[_0x20a6('0x8a')][_0x20a6('0x39')]({'where':{'OpenchannelAccountId':_0x269cc8},'transaction':_0x169fed})[_0x20a6('0x21')](function(){var _0x1ba008=_['map'](_0x3280df,function(_0x476ec0){_0x476ec0[_0x20a6('0x6c')]=_0x269cc8;return _0x476ec0;});return db['OpenchannelApplication'][_0x20a6('0xac')](_0x1ba008,{'transaction':_0x169fed});});}else{_0x3725ef=0x194;_0x108b28=[];}});})[_0x20a6('0x21')](function(){if(_0x3725ef!==0x194){return db[_0x20a6('0x8a')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x269cc8},'order':_0x20a6('0x8f')})[_0x20a6('0x21')](function(_0x353156){_0x108b28=_0x353156;});}})['catch'](function(_0xf3be7f){_0x3725ef=0x1f4;logger[_0x20a6('0x26')](_0xf3be7f[_0x20a6('0x3b')]);if(_0xf3be7f[_0x20a6('0x3c')]){delete _0xf3be7f[_0x20a6('0x3c')];}_0x108b28=_0xf3be7f;})[_0x20a6('0xad')](function(){if(_0x108b28===null){_0x341a74[_0x20a6('0x2d')](_0x3725ef);}else{if(_0x3725ef===0x1f4){_0x341a74[_0x20a6('0x2e')](_0x3725ef)[_0x20a6('0x3d')](_0x108b28);}else{_0x341a74[_0x20a6('0x2e')](_0x3725ef)[_0x20a6('0x2f')](_0x108b28);}}});};exports[_0x20a6('0xae')]=function(_0x4487de,_0x2cc25f,_0x217e89){var _0x53ade6={};var _0x48d962={};var _0x12ecae;var _0x3446b0;return db[_0x20a6('0x41')][_0x20a6('0x6f')]({'where':{'id':_0x4487de[_0x20a6('0x59')]['id']}})['then'](handleEntityNotFound(_0x2cc25f,null))[_0x20a6('0x21')](function(_0x155708){if(_0x155708){_0x12ecae=_0x155708;_0x48d962['model']=_['keys'](db[_0x20a6('0x8a')][_0x20a6('0x42')]);_0x48d962['query']=_[_0x20a6('0x47')](_0x4487de['query']);_0x48d962[_0x20a6('0x48')]=_[_0x20a6('0x5b')](_0x48d962[_0x20a6('0x49')],_0x48d962[_0x20a6('0x46')]);_0x53ade6[_0x20a6('0x4a')]=_[_0x20a6('0x5b')](_0x48d962['model'],qs['fields'](_0x4487de[_0x20a6('0x46')][_0x20a6('0x4b')]));_0x53ade6[_0x20a6('0x4a')]=_0x53ade6[_0x20a6('0x4a')][_0x20a6('0x5c')]?_0x53ade6[_0x20a6('0x4a')]:_0x48d962[_0x20a6('0x49')];_0x53ade6[_0x20a6('0x4d')]=qs['sort'](_0x4487de[_0x20a6('0x46')][_0x20a6('0x4e')]);_0x53ade6['where']=qs['filters'](_[_0x20a6('0x50')](_0x4487de[_0x20a6('0x46')],_0x48d962[_0x20a6('0x48')]));if(_0x4487de[_0x20a6('0x46')]['filter']){_0x53ade6[_0x20a6('0x4f')]=_[_0x20a6('0x52')](_0x53ade6[_0x20a6('0x4f')],{'$or':_[_0x20a6('0x40')](_0x53ade6[_0x20a6('0x4a')],function(_0x3d6054){var _0x292bbc={};_0x292bbc[_0x3d6054]={'$like':'%'+_0x4487de[_0x20a6('0x46')][_0x20a6('0x51')]+'%'};return _0x292bbc;})});}_0x53ade6=_['merge']({},_0x53ade6,_0x4487de['options']);return _0x12ecae['getApplications'](_0x53ade6);}})[_0x20a6('0x21')](function(_0x4227c2){if(_0x4227c2){_0x3446b0=_0x4227c2['length'];if(!_0x4487de[_0x20a6('0x46')][_0x20a6('0x4c')](_0x20a6('0x75'))){_0x53ade6[_0x20a6('0x32')]=qs[_0x20a6('0x32')](_0x4487de['query']['limit']);_0x53ade6['offset']=qs['offset'](_0x4487de[_0x20a6('0x46')][_0x20a6('0x30')]);}return _0x12ecae[_0x20a6('0xae')](_0x53ade6);}})[_0x20a6('0x21')](function(_0x82d3c0){if(_0x82d3c0){return _0x82d3c0?{'count':_0x3446b0,'rows':_0x82d3c0}:null;}})[_0x20a6('0x21')](respondWithResult(_0x2cc25f,null))[_0x20a6('0x2c')](handleError(_0x2cc25f,null));};exports[_0x20a6('0xaf')]=function(_0x320736,_0x48ccfe,_0x187bb4){var _0x155f40={'raw':![],'where':{}};var _0x54215a={};var _0xa7c1cf={'count':0x0,'rows':[]};return db[_0x20a6('0x41')]['findOne']({'where':{'id':_0x320736['params']['id']}})[_0x20a6('0x21')](handleEntityNotFound(_0x48ccfe,null))[_0x20a6('0x21')](function(_0x3b00e5){if(_0x3b00e5){_0x54215a[_0x20a6('0x49')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x54215a[_0x20a6('0x46')]=_[_0x20a6('0x47')](_0x320736[_0x20a6('0x46')]);_0x54215a[_0x20a6('0x48')]=_[_0x20a6('0x5b')](_0x54215a[_0x20a6('0x49')],_0x54215a[_0x20a6('0x46')]);_0x155f40[_0x20a6('0x4a')]=_[_0x20a6('0x5b')](_0x54215a[_0x20a6('0x49')],qs[_0x20a6('0x4b')](_0x320736[_0x20a6('0x46')][_0x20a6('0x4b')]));_0x155f40[_0x20a6('0x4a')]=_0x155f40[_0x20a6('0x4a')][_0x20a6('0x5c')]?_0x155f40[_0x20a6('0x4a')]:_0x54215a[_0x20a6('0x49')];if(!_0x320736[_0x20a6('0x46')][_0x20a6('0x4c')](_0x20a6('0x75'))){_0x155f40['limit']=qs[_0x20a6('0x32')](_0x320736[_0x20a6('0x46')]['limit']);_0x155f40[_0x20a6('0x30')]=qs[_0x20a6('0x30')](_0x320736[_0x20a6('0x46')][_0x20a6('0x30')]);}_0x155f40[_0x20a6('0x4d')]=qs['sort'](_0x320736[_0x20a6('0x46')][_0x20a6('0x4e')]);_0x155f40[_0x20a6('0x4f')]=qs[_0x20a6('0x48')](_[_0x20a6('0x50')](_0x320736[_0x20a6('0x46')],_0x54215a[_0x20a6('0x48')]));_0x155f40['where']['OpenchannelAccountId']=_0x3b00e5['id'];if(_0x320736[_0x20a6('0x46')][_0x20a6('0x51')]){_0x155f40[_0x20a6('0x4f')]=_[_0x20a6('0x52')](_0x155f40[_0x20a6('0x4f')],{'$or':_[_0x20a6('0x40')](_0x155f40[_0x20a6('0x4a')],function(_0x176899){var _0x4ec067={};_0x4ec067[_0x176899]={'$like':'%'+_0x320736[_0x20a6('0x46')]['filter']+'%'};return _0x4ec067;})});}_0x155f40=_[_0x20a6('0x52')]({},_0x155f40,_0x320736[_0x20a6('0x54')]);return db[_0x20a6('0x92')][_0x20a6('0x33')]({'where':_0x155f40['where']})[_0x20a6('0x21')](function(_0x154e58){_0xa7c1cf['count']=_0x154e58;if(_0x320736['query'][_0x20a6('0x55')]){_0x155f40[_0x20a6('0x5d')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x20a6('0xa0')],'as':_0x20a6('0xb0'),'attributes':[_0x20a6('0x3c'),_0x20a6('0xb1'),_0x20a6('0xb2')],'required':![]},{'model':db[_0x20a6('0xb3')],'as':'Tags','attributes':['id',_0x20a6('0x3c'),_0x20a6('0xb4')],'where':_0x320736['query']['tag']?{'id':_0x320736['query'][_0x20a6('0xb5')]}:undefined,'required':_0x320736['query']['tag']?!![]:![]}];}return db[_0x20a6('0x92')][_0x20a6('0x56')](_0x155f40);})[_0x20a6('0x21')](function(_0x576ccf){_0xa7c1cf['rows']=_0x576ccf;return _0xa7c1cf;});}})[_0x20a6('0x21')](respondWithFilteredResult(_0x48ccfe,_0x155f40))[_0x20a6('0x2c')](handleError(_0x48ccfe,null));};exports[_0x20a6('0xb6')]=function(_0x25fd24,_0x32b4de,_0x4cd5c6){return db[_0x20a6('0x41')][_0x20a6('0x5e')]({'where':{'id':_0x25fd24['params']['id']}})[_0x20a6('0x21')](handleEntityNotFound(_0x32b4de,null))['then'](function(_0x98a32b){if(_0x98a32b){return _0x98a32b[_0x20a6('0xb6')](_0x25fd24[_0x20a6('0x60')][_0x20a6('0x71')],_[_0x20a6('0xb7')](_0x25fd24[_0x20a6('0x60')],[_0x20a6('0x71'),'id'])||{})[_0x20a6('0x94')](function(_0x48615d){for(var _0x113b1e=0x0;_0x113b1e<_0x25fd24['body'][_0x20a6('0x71')][_0x20a6('0x5c')];_0x113b1e+=0x1){socket[_0x20a6('0xb8')]('userOpenchannelAccount:save',{'UserId':Number(_0x25fd24[_0x20a6('0x60')][_0x20a6('0x71')][_0x113b1e]),'OpenchannelAccountId':Number(_0x25fd24[_0x20a6('0x59')]['id'])});}return _0x48615d;});}})['then'](respondWithResult(_0x32b4de,null))[_0x20a6('0x2c')](handleError(_0x32b4de,null));};exports[_0x20a6('0xb9')]=function(_0x4149a6,_0x41159b,_0x5e2a50){return db[_0x20a6('0x41')]['find']({'where':{'id':_0x4149a6[_0x20a6('0x59')]['id']}})[_0x20a6('0x21')](handleEntityNotFound(_0x41159b,null))[_0x20a6('0x21')](function(_0x39703c){if(_0x39703c){return _0x39703c['removeAgents'](_0x4149a6['query'][_0x20a6('0x71')])[_0x20a6('0x21')](function(){if(_[_0x20a6('0xba')](_0x4149a6[_0x20a6('0x46')][_0x20a6('0x71')])){for(var _0x30b1f6=0x0;_0x30b1f6<_0x4149a6[_0x20a6('0x46')][_0x20a6('0x71')][_0x20a6('0x5c')];_0x30b1f6+=0x1){socket[_0x20a6('0xb8')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4149a6[_0x20a6('0x46')]['ids'][_0x30b1f6]),'OpenchannelAccountId':Number(_0x4149a6['params']['id'])});}}else{socket[_0x20a6('0xb8')](_0x20a6('0xbb'),{'UserId':Number(_0x4149a6['query']['ids']),'OpenchannelAccountId':Number(_0x4149a6['params']['id'])});}});}})[_0x20a6('0x21')](respondWithStatusCode(_0x41159b,null))[_0x20a6('0x2c')](handleError(_0x41159b,null));};exports[_0x20a6('0xbc')]=function(_0x59518c,_0x4ec3fb,_0x207c69){var _0x22a0f1={};var _0x43248f={};var _0x38f04b;var _0x3ea3ef;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x59518c[_0x20a6('0x59')]['id']}})[_0x20a6('0x21')](handleEntityNotFound(_0x4ec3fb,null))['then'](function(_0x562bf3){if(_0x562bf3){_0x38f04b=_0x562bf3;_0x43248f[_0x20a6('0x49')]=_[_0x20a6('0x47')](db['User'][_0x20a6('0x42')]);_0x43248f[_0x20a6('0x46')]=_[_0x20a6('0x47')](_0x59518c[_0x20a6('0x46')]);_0x43248f[_0x20a6('0x48')]=_[_0x20a6('0x5b')](_0x43248f['model'],_0x43248f['query']);_0x22a0f1[_0x20a6('0x4a')]=_[_0x20a6('0x5b')](_0x43248f[_0x20a6('0x49')],qs['fields'](_0x59518c[_0x20a6('0x46')][_0x20a6('0x4b')]));_0x22a0f1[_0x20a6('0x4a')]=_0x22a0f1[_0x20a6('0x4a')][_0x20a6('0x5c')]?_0x22a0f1[_0x20a6('0x4a')]:_0x43248f[_0x20a6('0x49')];_0x22a0f1[_0x20a6('0x4d')]=qs['sort'](_0x59518c[_0x20a6('0x46')]['sort']);_0x22a0f1[_0x20a6('0x4f')]=qs[_0x20a6('0x48')](_[_0x20a6('0x50')](_0x59518c['query'],_0x43248f[_0x20a6('0x48')]));if(_0x59518c[_0x20a6('0x46')]['filter']){_0x22a0f1[_0x20a6('0x4f')]=_[_0x20a6('0x52')](_0x22a0f1['where'],{'$or':_[_0x20a6('0x40')](_0x22a0f1[_0x20a6('0x4a')],function(_0x1da470){var _0x470dfa={};_0x470dfa[_0x1da470]={'$like':'%'+_0x59518c[_0x20a6('0x46')][_0x20a6('0x51')]+'%'};return _0x470dfa;})});}_0x22a0f1=_['merge']({},_0x22a0f1,_0x59518c[_0x20a6('0x54')]);return _0x38f04b[_0x20a6('0xbc')](_0x22a0f1);}})[_0x20a6('0x21')](function(_0x3bb2e6){if(_0x3bb2e6){_0x3ea3ef=_0x3bb2e6[_0x20a6('0x5c')];if(!_0x59518c[_0x20a6('0x46')][_0x20a6('0x4c')](_0x20a6('0x75'))){_0x22a0f1[_0x20a6('0x32')]=qs['limit'](_0x59518c[_0x20a6('0x46')][_0x20a6('0x32')]);_0x22a0f1[_0x20a6('0x30')]=qs[_0x20a6('0x30')](_0x59518c[_0x20a6('0x46')][_0x20a6('0x30')]);}return _0x38f04b[_0x20a6('0xbc')](_0x22a0f1);}})[_0x20a6('0x21')](function(_0x1d1d13){if(_0x1d1d13){return _0x1d1d13?{'count':_0x3ea3ef,'rows':_0x1d1d13}:null;}})[_0x20a6('0x21')](respondWithResult(_0x4ec3fb,null))['catch'](handleError(_0x4ec3fb,null));};exports[_0x20a6('0x3d')]=function(_0x20f935,_0x3bb302,_0x7bc08e){var _0x3a40a2,_0x39f84f,_0x177641;if(_['isNil'](_0x20f935[_0x20a6('0x60')][_0x20a6('0x60')])||_0x20f935[_0x20a6('0x60')][_0x20a6('0x60')]===''){throw new db[(_0x20a6('0x79'))]['ValidationError'](_0x20a6('0x81'));}if(_[_0x20a6('0x80')](_0x20f935[_0x20a6('0x60')]['to'])){}_0x3a40a2=_0x20f935['body']['to'];return db[_0x20a6('0x41')][_0x20a6('0x6f')]({'where':{'id':_0x20f935[_0x20a6('0x59')]['id']}})[_0x20a6('0x21')](handleEntityNotFound(_0x3bb302,null))['then'](function(_0xa13266){if(_0xa13266){return db[_0x20a6('0x41')][_0x20a6('0x5e')]({'where':{'id':_0xa13266['id']},'include':[{'model':db[_0x20a6('0x87')],'as':_0x20a6('0x88'),'include':[{'model':db[_0x20a6('0x78')],'as':'Contacts','where':{[_0xa13266[_0x20a6('0x82')]]:_0x3a40a2},'limit':0x1,'order':[[_0x20a6('0x7c'),_0x20a6('0xbd')]]}]}]})[_0x20a6('0x21')](handleEntityNotFound(_0x3bb302,null))['then'](function(_0x31b0e6){if(_0x31b0e6&&_0x31b0e6[_0x20a6('0x88')]){_0x39f84f=_0x31b0e6['get']({'plain':!![]});if(_0x39f84f[_0x20a6('0x88')]&&_0x39f84f[_0x20a6('0x88')][_0x20a6('0x89')][_0x20a6('0x5c')]){return _0x39f84f['List'][_0x20a6('0x89')][0x0];}return db[_0x20a6('0x78')][_0x20a6('0x5f')](_[_0x20a6('0x18')](_0x20f935['body'],{'firstName':_0x3a40a2,[_0x31b0e6[_0x20a6('0x82')]]:_0x3a40a2,'phone':_0x3a40a2,'ListId':_0x39f84f[_0x20a6('0x7f')]}));}})[_0x20a6('0x21')](handleEntityNotFound(_0x3bb302,null))[_0x20a6('0x21')](function(_0x4ef365){if(_0x4ef365){_0x177641=_0x4ef365;return db['OpenchannelInteraction'][_0x20a6('0x5e')]({'where':{'ContactId':_0x177641['id'],'closed':![],'OpenchannelAccountId':_0x39f84f['id']}})[_0x20a6('0x21')](function(_0x20ea60){if(_0x20ea60){return[_0x20ea60,![]];}return db['OpenchannelInteraction'][_0x20a6('0x5f')]({'UserId':_0x20f935[_0x20a6('0x61')]['id'],'ContactId':_0x177641['id'],'OpenchannelAccountId':_0x39f84f['id'],'lastMsgDirection':_0x20a6('0xbe'),'firstMsgDirection':_0x20a6('0xbe'),'Messages':[_[_0x20a6('0x52')](_0x20f935['body'],{'read':![],'body':_0x20f935[_0x20a6('0x60')][_0x20a6('0x60')],'OpenchannelAccountId':_0x39f84f['id'],'UserId':_0x20f935[_0x20a6('0x61')]['id'],'ContactId':_0x177641['id']})]},{'include':[{'model':db[_0x20a6('0x9d')],'as':_0x20a6('0xbf')}]})['then'](function(_0x67dacb){return[_0x67dacb,!![]];});});}})[_0x20a6('0x94')](function(_0x189bf9,_0xe5a76d){if(_0xe5a76d){return _0x189bf9;}return db[_0x20a6('0x9d')]['create'](_[_0x20a6('0x52')](_0x20f935[_0x20a6('0x60')],{'read':![],'body':_0x20f935[_0x20a6('0x60')][_0x20a6('0x60')],'OpenchannelAccountId':_0x39f84f['id'],'OpenchannelInteractionId':_0x189bf9['id'],'UserId':_0x20f935[_0x20a6('0x61')]['id'],'ContactId':_0x177641['id']}))['then'](function(_0x15b44b){_0x189bf9[_0x20a6('0xc0')]['Messages']=[];_0x189bf9[_0x20a6('0xc0')]['Messages'][_0x20a6('0xc1')](_0x15b44b[_0x20a6('0xc0')]);return _0x189bf9;});});}})[_0x20a6('0x21')](respondWithResult(_0x3bb302,null))[_0x20a6('0x2c')](handleError(_0x3bb302,null));}; \ No newline at end of file +var _0x8eeb=['DESC','Messages','dataValues','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','Pause','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','body','describe','addDisposition','Disposition','findOne','pick','OpenchannelAccountId','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','CmContact','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','getAgents'];(function(_0x48580a,_0x363915){var _0x474421=function(_0x2c5b40){while(--_0x2c5b40){_0x48580a['push'](_0x48580a['shift']());}};_0x474421(++_0x363915);}(_0x8eeb,0x183));var _0xb8ee=function(_0x125219,_0x24ea79){_0x125219=_0x125219-0x0;var _0x4d0664=_0x8eeb[_0x125219];return _0x4d0664;};'use strict';var emlformat=require(_0xb8ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb8ee('0x1'));var jsonpatch=require(_0xb8ee('0x2'));var rp=require('request-promise');var moment=require(_0xb8ee('0x3'));var BPromise=require(_0xb8ee('0x4'));var Mustache=require(_0xb8ee('0x5'));var util=require(_0xb8ee('0x6'));var path=require(_0xb8ee('0x7'));var sox=require('sox');var csv=require(_0xb8ee('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8ee('0x9'));var _=require(_0xb8ee('0xa'));var squel=require(_0xb8ee('0xb'));var crypto=require(_0xb8ee('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb8ee('0xd'));var toCsv=require(_0xb8ee('0x8'));var querystring=require(_0xb8ee('0xe'));var Papa=require('papaparse');var Redis=require(_0xb8ee('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb8ee('0x10'));var as=require(_0xb8ee('0x11'));var hardwareService=require(_0xb8ee('0x12'));var logger=require(_0xb8ee('0x13'))(_0xb8ee('0x14'));var utils=require(_0xb8ee('0x15'));var config=require(_0xb8ee('0x16'));var licenseUtil=require(_0xb8ee('0x17'));var db=require('../../mysqldb')['db'];config[_0xb8ee('0x18')]=_[_0xb8ee('0x19')](config[_0xb8ee('0x18')],{'host':_0xb8ee('0x1a'),'port':0x18eb});var socket=require(_0xb8ee('0x1b'))(new Redis(config[_0xb8ee('0x18')]));require('./openchannelAccount.socket')[_0xb8ee('0x1c')](socket);var jayson=require(_0xb8ee('0x1d'));var client=jayson[_0xb8ee('0x1e')][_0xb8ee('0x1f')]({'port':0x232c});var client9002=jayson[_0xb8ee('0x1e')][_0xb8ee('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x22b97b,_0x13b79c,_0x40be2d,_0x5a3f29){return new BPromise(function(_0x135d5d,_0x4e154d){var _0x5d382f=_0x5a3f29||client;return _0x5d382f[_0xb8ee('0x20')](_0x22b97b,_0x40be2d)[_0xb8ee('0x21')](function(_0x4d9a82){logger[_0xb8ee('0x22')](_0xb8ee('0x23'),_0x13b79c,'request\x20sent');logger[_0xb8ee('0x24')](_0xb8ee('0x25'),_0x13b79c,_0xb8ee('0x26'),JSON['stringify'](_0x4d9a82));if(_0x4d9a82[_0xb8ee('0x27')]){if(_0x4d9a82[_0xb8ee('0x27')][_0xb8ee('0x28')]===0x1f4){logger[_0xb8ee('0x27')](_0xb8ee('0x23'),_0x13b79c,_0x4d9a82['error'][_0xb8ee('0x29')]);return _0x4e154d(_0x4d9a82['error'][_0xb8ee('0x29')]);}logger[_0xb8ee('0x27')](_0xb8ee('0x23'),_0x13b79c,_0x4d9a82[_0xb8ee('0x27')][_0xb8ee('0x29')]);return _0x135d5d(_0x4d9a82[_0xb8ee('0x27')][_0xb8ee('0x29')]);}else{logger[_0xb8ee('0x22')](_0xb8ee('0x23'),_0x13b79c,_0xb8ee('0x26'));_0x135d5d(_0x4d9a82['result'][_0xb8ee('0x29')]);}})['catch'](function(_0x5d1218){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x13b79c,_0x5d1218);_0x4e154d(_0x5d1218);});});}function respondWithStatusCode(_0x2c5bd1,_0x47236a){_0x47236a=_0x47236a||0xcc;return function(_0x23ecd3){if(_0x23ecd3){return _0x2c5bd1[_0xb8ee('0x2a')](_0x47236a);}return _0x2c5bd1[_0xb8ee('0x2b')](_0x47236a)[_0xb8ee('0x2c')]();};}function respondWithResult(_0x1ac4e1,_0x295670){_0x295670=_0x295670||0xc8;return function(_0x4c5b3a){if(_0x4c5b3a){return _0x1ac4e1[_0xb8ee('0x2b')](_0x295670)[_0xb8ee('0x2d')](_0x4c5b3a);}};}function respondWithFilteredResult(_0x4500b7,_0x1f58a3){return function(_0x5af703){if(_0x5af703){var _0x35e844=typeof _0x1f58a3[_0xb8ee('0x2e')]==='undefined'&&typeof _0x1f58a3[_0xb8ee('0x2f')]===_0xb8ee('0x30');var _0x47d405=_0x5af703[_0xb8ee('0x31')];var _0x14a320=_0x35e844?0x0:_0x1f58a3[_0xb8ee('0x2e')];var _0x48715d=_0x35e844?_0x5af703[_0xb8ee('0x31')]:_0x1f58a3[_0xb8ee('0x2e')]+_0x1f58a3[_0xb8ee('0x2f')];var _0x57a4e6;if(_0x48715d>=_0x47d405){_0x48715d=_0x47d405;_0x57a4e6=0xc8;}else{_0x57a4e6=0xce;}_0x4500b7['status'](_0x57a4e6);return _0x4500b7[_0xb8ee('0x32')](_0xb8ee('0x33'),_0x14a320+'-'+_0x48715d+'/'+_0x47d405)['json'](_0x5af703);}return null;};}function patchUpdates(_0x22c46c){return function(_0x5589ed){try{jsonpatch[_0xb8ee('0x34')](_0x5589ed,_0x22c46c,!![]);}catch(_0x5da6d9){return BPromise[_0xb8ee('0x35')](_0x5da6d9);}return _0x5589ed[_0xb8ee('0x36')]();};}function saveUpdates(_0xb53334,_0x17b1ff){return function(_0x3d4c9d){if(_0x3d4c9d){return _0x3d4c9d['update'](_0xb53334)['then'](function(_0x3e1c77){return _0x3e1c77;});}return null;};}function removeEntity(_0x29333f,_0x2eadf6){return function(_0x37293b){if(_0x37293b){return _0x37293b[_0xb8ee('0x37')]()[_0xb8ee('0x21')](function(){var _0x46fb4f=_0x37293b[_0xb8ee('0x38')]({'plain':!![]});var _0xff20d2=_0xb8ee('0x39');return db[_0xb8ee('0x3a')][_0xb8ee('0x37')]({'where':{'type':_0xff20d2,'resourceId':_0x46fb4f['id']}})[_0xb8ee('0x21')](function(){return _0x37293b;});})[_0xb8ee('0x21')](function(){_0x29333f[_0xb8ee('0x2b')](0xcc)[_0xb8ee('0x2c')]();});}};}function handleEntityNotFound(_0x22b89a,_0x3c6324){return function(_0x4aaafe){if(!_0x4aaafe){_0x22b89a[_0xb8ee('0x2a')](0x194);}return _0x4aaafe;};}function handleError(_0x22042f,_0x22b68a){_0x22b68a=_0x22b68a||0x1f4;return function(_0x268b49){logger[_0xb8ee('0x27')](_0x268b49[_0xb8ee('0x3b')]);if(_0x268b49['name']){delete _0x268b49[_0xb8ee('0x3c')];}_0x22042f['status'](_0x22b68a)[_0xb8ee('0x3d')](_0x268b49);};}exports[_0xb8ee('0x3e')]=function(_0xe8ae38,_0x168534){var _0x343bb1={'include':[{'model':db['Pause'],'as':_0xb8ee('0x3f')}]},_0x50aeaf={},_0x53a84f={'count':0x0,'rows':[]};var _0x46c3f0=_['map'](db[_0xb8ee('0x40')][_0xb8ee('0x41')],function(_0x5ce2ab){return{'name':_0x5ce2ab[_0xb8ee('0x42')],'type':_0x5ce2ab['type'][_0xb8ee('0x43')]};});_0x50aeaf[_0xb8ee('0x44')]=_[_0xb8ee('0x45')](_0x46c3f0,'name');_0x50aeaf[_0xb8ee('0x46')]=_[_0xb8ee('0x47')](_0xe8ae38[_0xb8ee('0x46')]);_0x50aeaf['filters']=_['intersection'](_0x50aeaf['model'],_0x50aeaf[_0xb8ee('0x46')]);_0x343bb1[_0xb8ee('0x48')]=_['intersection'](_0x50aeaf[_0xb8ee('0x44')],qs[_0xb8ee('0x49')](_0xe8ae38[_0xb8ee('0x46')]['fields']));_0x343bb1[_0xb8ee('0x48')]=_0x343bb1[_0xb8ee('0x48')][_0xb8ee('0x4a')]?_0x343bb1[_0xb8ee('0x48')]:_0x50aeaf[_0xb8ee('0x44')];if(!_0xe8ae38[_0xb8ee('0x46')][_0xb8ee('0x4b')](_0xb8ee('0x4c'))){_0x343bb1[_0xb8ee('0x2f')]=qs[_0xb8ee('0x2f')](_0xe8ae38[_0xb8ee('0x46')][_0xb8ee('0x2f')]);_0x343bb1['offset']=qs[_0xb8ee('0x2e')](_0xe8ae38[_0xb8ee('0x46')][_0xb8ee('0x2e')]);}_0x343bb1[_0xb8ee('0x4d')]=qs[_0xb8ee('0x4e')](_0xe8ae38[_0xb8ee('0x46')]['sort']);_0x343bb1[_0xb8ee('0x4f')]=qs[_0xb8ee('0x50')](_['pick'](_0xe8ae38[_0xb8ee('0x46')],_0x50aeaf['filters']),_0x46c3f0);if(_0xe8ae38[_0xb8ee('0x46')][_0xb8ee('0x51')]){_0x343bb1['where']=_[_0xb8ee('0x52')](_0x343bb1[_0xb8ee('0x4f')],{'$or':_[_0xb8ee('0x45')](_0x46c3f0,function(_0x1f1f9c){if(_0x1f1f9c[_0xb8ee('0x53')]!==_0xb8ee('0x54')){var _0x5946e3={};_0x5946e3[_0x1f1f9c[_0xb8ee('0x3c')]]={'$like':'%'+_0xe8ae38[_0xb8ee('0x46')][_0xb8ee('0x51')]+'%'};return _0x5946e3;}})});}_0x343bb1=_[_0xb8ee('0x52')]({},_0x343bb1,_0xe8ae38[_0xb8ee('0x55')]);var _0x58123d={'where':_0x343bb1[_0xb8ee('0x4f')]};return db[_0xb8ee('0x40')][_0xb8ee('0x31')](_0x58123d)[_0xb8ee('0x21')](function(_0x1e3b4e){_0x53a84f[_0xb8ee('0x31')]=_0x1e3b4e;if(_0xe8ae38[_0xb8ee('0x46')]['includeAll']){_0x343bb1[_0xb8ee('0x56')]=[{'all':!![]}];}return db[_0xb8ee('0x40')][_0xb8ee('0x57')](_0x343bb1);})[_0xb8ee('0x21')](function(_0x315336){_0x53a84f[_0xb8ee('0x58')]=_0x315336;return _0x53a84f;})['then'](respondWithFilteredResult(_0x168534,_0x343bb1))[_0xb8ee('0x59')](handleError(_0x168534,null));};exports[_0xb8ee('0x5a')]=function(_0x2e9803,_0x329358){var _0x30bca7={'raw':![],'where':{'id':_0x2e9803[_0xb8ee('0x5b')]['id']},'include':[{'model':db[_0xb8ee('0x5c')],'as':_0xb8ee('0x3f')}]},_0x39d9c2={};_0x39d9c2['model']=_['keys'](db[_0xb8ee('0x40')]['rawAttributes']);_0x39d9c2['query']=_['keys'](_0x2e9803[_0xb8ee('0x46')]);_0x39d9c2[_0xb8ee('0x50')]=_[_0xb8ee('0x5d')](_0x39d9c2['model'],_0x39d9c2[_0xb8ee('0x46')]);_0x30bca7[_0xb8ee('0x48')]=_[_0xb8ee('0x5d')](_0x39d9c2[_0xb8ee('0x44')],qs['fields'](_0x2e9803[_0xb8ee('0x46')]['fields']));_0x30bca7['attributes']=_0x30bca7[_0xb8ee('0x48')][_0xb8ee('0x4a')]?_0x30bca7[_0xb8ee('0x48')]:_0x39d9c2[_0xb8ee('0x44')];if(_0x2e9803['query']['includeAll']){_0x30bca7[_0xb8ee('0x56')]=[{'all':!![]}];}_0x30bca7=_[_0xb8ee('0x52')]({},_0x30bca7,_0x2e9803[_0xb8ee('0x55')]);return db[_0xb8ee('0x40')][_0xb8ee('0x5e')](_0x30bca7)[_0xb8ee('0x21')](handleEntityNotFound(_0x329358,null))[_0xb8ee('0x21')](respondWithResult(_0x329358,null))[_0xb8ee('0x59')](handleError(_0x329358,null));};exports[_0xb8ee('0x5f')]=function(_0x49a544,_0x529f92){return db['OpenchannelAccount'][_0xb8ee('0x5f')](_0x49a544['body'],{})[_0xb8ee('0x21')](function(_0x4d8173){var _0x163277=_0x49a544[_0xb8ee('0x60')]['get']({'plain':!![]});if(!_0x163277)throw new Error(_0xb8ee('0x61'));if(_0x163277[_0xb8ee('0x62')]===_0xb8ee('0x60')){var _0x3c2a44=_0x4d8173['get']({'plain':!![]});var _0x157cdd=_0xb8ee('0x39');return db['UserProfileSection'][_0xb8ee('0x5e')]({'where':{'name':_0x157cdd,'userProfileId':_0x163277[_0xb8ee('0x63')]},'raw':!![]})[_0xb8ee('0x21')](function(_0xd47a77){if(_0xd47a77&&_0xd47a77[_0xb8ee('0x64')]===0x0){return db['UserProfileResource'][_0xb8ee('0x5f')]({'name':_0x3c2a44['name'],'resourceId':_0x3c2a44['id'],'type':_0xd47a77[_0xb8ee('0x3c')],'sectionId':_0xd47a77['id']},{})[_0xb8ee('0x21')](function(){return _0x4d8173;});}else{return _0x4d8173;}})[_0xb8ee('0x59')](function(_0x455649){logger[_0xb8ee('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x455649);throw _0x455649;});}return _0x4d8173;})[_0xb8ee('0x21')](respondWithResult(_0x529f92,0xc9))[_0xb8ee('0x59')](handleError(_0x529f92,null));};exports[_0xb8ee('0x65')]=function(_0x1d3684,_0xf135ac){if(_0x1d3684['body']['id']){delete _0x1d3684[_0xb8ee('0x66')]['id'];}return db['OpenchannelAccount'][_0xb8ee('0x5e')]({'where':{'id':_0x1d3684[_0xb8ee('0x5b')]['id']},'include':[{'model':db[_0xb8ee('0x5c')],'as':'mandatoryDispositionPause'}]})[_0xb8ee('0x21')](handleEntityNotFound(_0xf135ac,null))['then'](saveUpdates(_0x1d3684[_0xb8ee('0x66')],null))[_0xb8ee('0x21')](respondWithResult(_0xf135ac,null))[_0xb8ee('0x59')](handleError(_0xf135ac,null));};exports[_0xb8ee('0x37')]=function(_0x2eec61,_0x5eeb11){return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x2eec61[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x5eeb11,null))[_0xb8ee('0x21')](removeEntity(_0x5eeb11,null))[_0xb8ee('0x59')](handleError(_0x5eeb11,null));};exports[_0xb8ee('0x67')]=function(_0x3dbb0c,_0x40c1ec){return db['OpenchannelAccount'][_0xb8ee('0x67')]()[_0xb8ee('0x21')](respondWithResult(_0x40c1ec,null))[_0xb8ee('0x59')](handleError(_0x40c1ec,null));};exports[_0xb8ee('0x68')]=function(_0x487e57,_0x5a3c32,_0x5c5331){if(_0x487e57[_0xb8ee('0x66')]['id']){delete _0x487e57[_0xb8ee('0x66')]['id'];}return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x487e57[_0xb8ee('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5a3c32,null))[_0xb8ee('0x21')](function(_0x6995e1){if(_0x6995e1){_0x487e57['body']['OpenchannelAccountId']=_0x6995e1['id'];return db[_0xb8ee('0x69')][_0xb8ee('0x5f')](_0x487e57[_0xb8ee('0x66')]);}})[_0xb8ee('0x21')](respondWithResult(_0x5a3c32,null))[_0xb8ee('0x59')](handleError(_0x5a3c32,null));};exports['getDispositions']=function(_0x2fdc36,_0x48da30,_0x45f939){var _0x188895={'raw':![],'where':{}};var _0x2251ae={};var _0x9d79f1={'count':0x0,'rows':[]};return db[_0xb8ee('0x40')][_0xb8ee('0x6a')]({'where':{'id':_0x2fdc36[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x48da30,null))['then'](function(_0x287724){if(_0x287724){_0x2251ae[_0xb8ee('0x44')]=_[_0xb8ee('0x47')](db[_0xb8ee('0x69')][_0xb8ee('0x41')]);_0x2251ae[_0xb8ee('0x46')]=_[_0xb8ee('0x47')](_0x2fdc36[_0xb8ee('0x46')]);_0x2251ae['filters']=_['intersection'](_0x2251ae[_0xb8ee('0x44')],_0x2251ae['query']);_0x188895[_0xb8ee('0x48')]=_[_0xb8ee('0x5d')](_0x2251ae[_0xb8ee('0x44')],qs[_0xb8ee('0x49')](_0x2fdc36[_0xb8ee('0x46')]['fields']));_0x188895[_0xb8ee('0x48')]=_0x188895[_0xb8ee('0x48')][_0xb8ee('0x4a')]?_0x188895[_0xb8ee('0x48')]:_0x2251ae[_0xb8ee('0x44')];if(!_0x2fdc36[_0xb8ee('0x46')][_0xb8ee('0x4b')](_0xb8ee('0x4c'))){_0x188895[_0xb8ee('0x2f')]=qs[_0xb8ee('0x2f')](_0x2fdc36[_0xb8ee('0x46')]['limit']);_0x188895[_0xb8ee('0x2e')]=qs[_0xb8ee('0x2e')](_0x2fdc36[_0xb8ee('0x46')][_0xb8ee('0x2e')]);}_0x188895[_0xb8ee('0x4d')]=qs[_0xb8ee('0x4e')](_0x2fdc36['query'][_0xb8ee('0x4e')]);_0x188895[_0xb8ee('0x4f')]=qs['filters'](_[_0xb8ee('0x6b')](_0x2fdc36[_0xb8ee('0x46')],_0x2251ae[_0xb8ee('0x50')]));_0x188895['where'][_0xb8ee('0x6c')]=_0x287724['id'];if(_0x2fdc36[_0xb8ee('0x46')][_0xb8ee('0x51')]){_0x188895[_0xb8ee('0x4f')]=_[_0xb8ee('0x52')](_0x188895['where'],{'$or':_[_0xb8ee('0x45')](_0x188895[_0xb8ee('0x48')],function(_0x576351){var _0x6bd8={};_0x6bd8[_0x576351]={'$like':'%'+_0x2fdc36[_0xb8ee('0x46')][_0xb8ee('0x51')]+'%'};return _0x6bd8;})});}_0x188895=_[_0xb8ee('0x52')]({},_0x188895,_0x2fdc36[_0xb8ee('0x55')]);return db[_0xb8ee('0x69')][_0xb8ee('0x31')]({'where':_0x188895[_0xb8ee('0x4f')]})[_0xb8ee('0x21')](function(_0x20a8da){_0x9d79f1['count']=_0x20a8da;if(_0x2fdc36[_0xb8ee('0x46')][_0xb8ee('0x6d')]){_0x188895[_0xb8ee('0x56')]=[{'all':!![]}];}return db[_0xb8ee('0x69')][_0xb8ee('0x57')](_0x188895);})['then'](function(_0x546f8d){_0x9d79f1[_0xb8ee('0x58')]=_0x546f8d;return _0x9d79f1;});}})[_0xb8ee('0x21')](respondWithFilteredResult(_0x48da30,_0x188895))['catch'](handleError(_0x48da30,null));};exports[_0xb8ee('0x6e')]=function(_0x1836b0,_0x3b9ce5,_0x1364fd){return db['OpenchannelAccount'][_0xb8ee('0x5e')]({'where':{'id':_0x1836b0[_0xb8ee('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3b9ce5,null))[_0xb8ee('0x21')](function(_0x938306){if(_0x938306){return _0x938306[_0xb8ee('0x6e')](_0x1836b0['query'][_0xb8ee('0x6f')]);}})[_0xb8ee('0x21')](respondWithStatusCode(_0x3b9ce5,null))[_0xb8ee('0x59')](handleError(_0x3b9ce5,null));};exports[_0xb8ee('0x70')]=function(_0x25ecd5,_0x4637b8,_0x54379e){if(_0x25ecd5['body']['id']){delete _0x25ecd5[_0xb8ee('0x66')]['id'];}return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x25ecd5['params']['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x4637b8,null))[_0xb8ee('0x21')](function(_0x1ad650){if(_0x1ad650){_0x25ecd5[_0xb8ee('0x66')][_0xb8ee('0x6c')]=_0x1ad650['id'];return db[_0xb8ee('0x71')][_0xb8ee('0x5f')](_0x25ecd5[_0xb8ee('0x66')]);}})[_0xb8ee('0x21')](respondWithResult(_0x4637b8,null))[_0xb8ee('0x59')](handleError(_0x4637b8,null));};exports[_0xb8ee('0x72')]=function(_0x34b9cc,_0x4d70e1,_0x16393b){var _0x2fa782={'raw':![],'where':{}};var _0x5d79c3={};var _0x683742={'count':0x0,'rows':[]};return db[_0xb8ee('0x40')][_0xb8ee('0x6a')]({'where':{'id':_0x34b9cc[_0xb8ee('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4d70e1,null))[_0xb8ee('0x21')](function(_0x43fa7d){if(_0x43fa7d){_0x5d79c3[_0xb8ee('0x44')]=_['keys'](db['CannedAnswer'][_0xb8ee('0x41')]);_0x5d79c3[_0xb8ee('0x46')]=_['keys'](_0x34b9cc['query']);_0x5d79c3[_0xb8ee('0x50')]=_['intersection'](_0x5d79c3[_0xb8ee('0x44')],_0x5d79c3[_0xb8ee('0x46')]);_0x2fa782[_0xb8ee('0x48')]=_['intersection'](_0x5d79c3[_0xb8ee('0x44')],qs['fields'](_0x34b9cc[_0xb8ee('0x46')][_0xb8ee('0x49')]));_0x2fa782[_0xb8ee('0x48')]=_0x2fa782[_0xb8ee('0x48')][_0xb8ee('0x4a')]?_0x2fa782[_0xb8ee('0x48')]:_0x5d79c3[_0xb8ee('0x44')];if(!_0x34b9cc['query']['hasOwnProperty'](_0xb8ee('0x4c'))){_0x2fa782[_0xb8ee('0x2f')]=qs[_0xb8ee('0x2f')](_0x34b9cc[_0xb8ee('0x46')][_0xb8ee('0x2f')]);_0x2fa782[_0xb8ee('0x2e')]=qs[_0xb8ee('0x2e')](_0x34b9cc[_0xb8ee('0x46')][_0xb8ee('0x2e')]);}_0x2fa782[_0xb8ee('0x4d')]=qs[_0xb8ee('0x4e')](_0x34b9cc['query'][_0xb8ee('0x4e')]);_0x2fa782[_0xb8ee('0x4f')]=qs[_0xb8ee('0x50')](_[_0xb8ee('0x6b')](_0x34b9cc[_0xb8ee('0x46')],_0x5d79c3['filters']));_0x2fa782['where'][_0xb8ee('0x6c')]=_0x43fa7d['id'];if(_0x34b9cc[_0xb8ee('0x46')][_0xb8ee('0x51')]){_0x2fa782[_0xb8ee('0x4f')]=_[_0xb8ee('0x52')](_0x2fa782[_0xb8ee('0x4f')],{'$or':_[_0xb8ee('0x45')](_0x2fa782['attributes'],function(_0x31cde5){var _0x4185b9={};_0x4185b9[_0x31cde5]={'$like':'%'+_0x34b9cc[_0xb8ee('0x46')]['filter']+'%'};return _0x4185b9;})});}_0x2fa782=_[_0xb8ee('0x52')]({},_0x2fa782,_0x34b9cc[_0xb8ee('0x55')]);return db['CannedAnswer'][_0xb8ee('0x31')]({'where':_0x2fa782[_0xb8ee('0x4f')]})[_0xb8ee('0x21')](function(_0x57e08b){_0x683742[_0xb8ee('0x31')]=_0x57e08b;if(_0x34b9cc[_0xb8ee('0x46')][_0xb8ee('0x6d')]){_0x2fa782[_0xb8ee('0x56')]=[{'all':!![]}];}return db[_0xb8ee('0x71')]['findAll'](_0x2fa782);})[_0xb8ee('0x21')](function(_0x272633){_0x683742[_0xb8ee('0x58')]=_0x272633;return _0x683742;});}})[_0xb8ee('0x21')](respondWithFilteredResult(_0x4d70e1,_0x2fa782))[_0xb8ee('0x59')](handleError(_0x4d70e1,null));};exports[_0xb8ee('0x73')]=function(_0x4c1d84,_0x5d68b5,_0x140181){return db['OpenchannelAccount'][_0xb8ee('0x5e')]({'where':{'id':_0x4c1d84[_0xb8ee('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5d68b5,null))[_0xb8ee('0x21')](function(_0x18653f){if(_0x18653f){return _0x18653f[_0xb8ee('0x73')](_0x4c1d84['query'][_0xb8ee('0x6f')]);}})[_0xb8ee('0x21')](respondWithStatusCode(_0x5d68b5,null))[_0xb8ee('0x59')](handleError(_0x5d68b5,null));};exports['notify']=function(_0x26f2a6,_0x48d5f6,_0x138699){var _0x504d52={'body':_0x26f2a6[_0xb8ee('0x66')],'channel':'openchannel'};var _0x4b62ad=[];var _0x590222=[];var _0x84ea65={};var _0x3e574e=![];return db[_0xb8ee('0x74')][_0xb8ee('0x67')]()[_0xb8ee('0x21')](function(_0x335057){if(!_0x335057){throw new db['Sequelize'][(_0xb8ee('0x75'))](_0xb8ee('0x76'));}_0x4b62ad=_['difference'](_[_0xb8ee('0x47')](_0x335057),[_0xb8ee('0x77'),'updatedAt']);_0x590222=_[_0xb8ee('0x78')](_[_0xb8ee('0x47')](_0x335057),['createdAt',_0xb8ee('0x79'),'CompanyId',_0xb8ee('0x7a')]);if(_0x26f2a6['body']['id']){delete _0x26f2a6['body']['id'];}if(_[_0xb8ee('0x7b')](_0x26f2a6['body'][_0xb8ee('0x7c')])){throw new db['Sequelize'][(_0xb8ee('0x75'))](_0xb8ee('0x7d'));}if(_[_0xb8ee('0x7b')](_0x26f2a6['body'][_0xb8ee('0x66')])||_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x66')]===''){throw new db[(_0xb8ee('0x7e'))][(_0xb8ee('0x75'))](_0xb8ee('0x7f'));}if(_[_0xb8ee('0x7b')](_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x80')])){throw new db[(_0xb8ee('0x7e'))][(_0xb8ee('0x75'))](_0xb8ee('0x81')+_0x590222);}if(!_['includes'](_0x590222,_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x80')])){throw new db['Sequelize'][(_0xb8ee('0x75'))](_0xb8ee('0x82')+_0x590222);}_0x84ea65[_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x80')]]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x7c')];})['then'](function(){return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x26f2a6[_0xb8ee('0x5b')]['id']},'include':[{'model':db[_0xb8ee('0x83')],'as':_0xb8ee('0x84'),'include':[{'model':db[_0xb8ee('0x74')],'as':_0xb8ee('0x85'),'where':_0x84ea65,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xb8ee('0x86')],'as':_0xb8ee('0x87')}]});})['then'](handleEntityNotFound(_0x48d5f6,null))[_0xb8ee('0x21')](function(_0x116170){if(_0x116170&&_0x116170[_0xb8ee('0x84')]){_0x504d52[_0xb8ee('0x88')]=_0x116170;_0x504d52[_0xb8ee('0x89')]=_0x116170[_0xb8ee('0x87')];_0x504d52[_0xb8ee('0x8a')]=_0x116170['List'];_0x504d52['applications']=_[_0xb8ee('0x8b')](_0x504d52[_0xb8ee('0x89')],[_0xb8ee('0x8c')],[_0xb8ee('0x8d')]);if(_0x504d52[_0xb8ee('0x88')][_0xb8ee('0x87')]){delete _0x504d52['account'][_0xb8ee('0x87')];}if(_0x504d52[_0xb8ee('0x88')][_0xb8ee('0x84')]&&_0x504d52['account']['List'][_0xb8ee('0x85')][_0xb8ee('0x4a')]){return _0x504d52[_0xb8ee('0x88')]['List'][_0xb8ee('0x85')][0x0];}var _0x3c0caa=_[_0xb8ee('0x19')](_0x26f2a6['body'],{'firstName':_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x7c')],'ListId':_0x116170[_0xb8ee('0x7a')]});_0x3c0caa[_0x26f2a6[_0xb8ee('0x66')]['mapKey']]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x7c')];return db[_0xb8ee('0x74')]['create'](_0x3c0caa,{'fields':_0x4b62ad,'raw':!![]});}})[_0xb8ee('0x21')](handleEntityNotFound(_0x48d5f6,null))['then'](function(_0x139e67){_0x504d52[_0xb8ee('0x8e')]=_0x139e67;if(_0x139e67){var _0x1431c7={'ContactId':_0x139e67['id'],'OpenchannelAccountId':_0x26f2a6[_0xb8ee('0x5b')]['id'],'from':(_0x139e67[_0xb8ee('0x8f')]||'')+'\x20'+(_0x139e67[_0xb8ee('0x90')]||'')};var _0x20ded6={'OpenchannelAccountId':_0x26f2a6['params']['id'],'closed':![]};if(_0x26f2a6[_0xb8ee('0x66')]['threadId']){_0x20ded6[_0xb8ee('0x91')]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x91')];return db['OpenchannelInteraction']['find']({'where':_0x20ded6})['then'](function(_0x4076f8){if(_0x4076f8){return[_0x4076f8,![]];}_0x1431c7[_0xb8ee('0x91')]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x91')];_0x1431c7[_0xb8ee('0x92')]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x92')];return db[_0xb8ee('0x93')][_0xb8ee('0x5f')](_0x1431c7)[_0xb8ee('0x21')](function(_0x457a25){return[_0x457a25,!![]];});});}else{_0x20ded6['threadId']=null;}_0x20ded6[_0xb8ee('0x94')]=_0x139e67['id'];return db[_0xb8ee('0x93')][_0xb8ee('0x5e')]({'where':_0x20ded6})['then'](function(_0x156a57){if(_0x156a57){return[_0x156a57,![]];}return db[_0xb8ee('0x93')][_0xb8ee('0x5f')](_0x1431c7)[_0xb8ee('0x21')](function(_0x555aeb){return[_0x555aeb,!![]];});});}})[_0xb8ee('0x95')](function(_0xf2a7f6,_0x51295f){if(_0xf2a7f6){_0x3e574e=_0x51295f;if(!_0x51295f){var _0x337191={'from':(_0x504d52[_0xb8ee('0x8e')][_0xb8ee('0x8f')]||'')+'\x20'+(_0x504d52[_0xb8ee('0x8e')][_0xb8ee('0x90')]||'')};if(_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x91')]&&_0x26f2a6['body'][_0xb8ee('0x96')]&&_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x91')]!=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x96')]){_0x337191[_0xb8ee('0x91')]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x96')];}return _0xf2a7f6[_0xb8ee('0x65')](_0x337191);}else{return _0xf2a7f6;}}})['then'](function(_0x5de41a){_0x504d52[_0xb8ee('0x97')]=_0x5de41a[_0xb8ee('0x38')]({'plain':!![]});_0x504d52[_0xb8ee('0x97')][_0xb8ee('0x98')]=_0x3e574e;if(_0x504d52[_0xb8ee('0x97')][_0xb8ee('0x98')]){if(_0x504d52[_0xb8ee('0x88')][_0xb8ee('0x99')]){_0x504d52[_0xb8ee('0x89')][_0xb8ee('0x9a')]({'id':0x0,'priority':_0x504d52[_0xb8ee('0x89')][_0xb8ee('0x4a')]+0x1,'app':'close','appdata':_0xb8ee('0x9b'),'interval':_0xb8ee('0x9c')});}}return db[_0xb8ee('0x9d')]['create']({'body':_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x66')],'OpenchannelAccountId':_0x26f2a6[_0xb8ee('0x5b')]['id'],'OpenchannelInteractionId':_0x5de41a['id'],'direction':'in','ContactId':_0x504d52[_0xb8ee('0x8e')]['id'],'AttachmentId':_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x9e')]});})[_0xb8ee('0x21')](function(_0x2e3233){_0x504d52[_0xb8ee('0x29')]=_0x2e3233;if(_0x504d52[_0xb8ee('0x97')][_0xb8ee('0x9f')]){return db[_0xb8ee('0xa0')][_0xb8ee('0x5e')]({'attributes':['id',_0xb8ee('0x3c')],'where':{'id':_0x504d52[_0xb8ee('0x97')][_0xb8ee('0x9f')]}})[_0xb8ee('0x21')](function(_0x235aa1){if(_0x235aa1){_0x504d52[_0xb8ee('0x89')][_0xb8ee('0xa1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x235aa1[_0xb8ee('0x3c')]+','+(_0x504d52[_0xb8ee('0x88')][_0xb8ee('0xa2')]||0xa),'interval':_0xb8ee('0x9c')});_0x504d52[_0xb8ee('0xa3')]=![];}return respondWithRpcPromise(_0xb8ee('0xa4'),'startRouting',_0x504d52);});}return respondWithRpcPromise(_0xb8ee('0xa4'),_0xb8ee('0xa5'),_0x504d52);})[_0xb8ee('0x21')](function(_0xa1eac6){respondWithRpcPromise(_0xb8ee('0xa6'),'EventManager',{'event':_0xb8ee('0xa7'),'message':_0xa1eac6},client9002);return _0xa1eac6;})[_0xb8ee('0x21')](respondWithResult(_0x48d5f6,null))[_0xb8ee('0x59')](handleError(_0x48d5f6,null));};exports[_0xb8ee('0xa8')]=function(_0x2046dc,_0x58a61b){var _0xf0a12f=_0x2046dc[_0xb8ee('0x5b')]['id'];var _0x118cfb=_0x2046dc['body'];var _0x1f98ef=0xc8;var _0x4a27d0=null;return db[_0xb8ee('0xa9')]['transaction']({'isolationLevel':db[_0xb8ee('0xa9')]['Transaction']['ISOLATION_LEVELS'][_0xb8ee('0xaa')]},function(_0x85eda4){return db[_0xb8ee('0x40')][_0xb8ee('0x6a')]({'where':{'id':_0xf0a12f},'transaction':_0x85eda4})[_0xb8ee('0x21')](function(_0x1b3f55){if(_0x1b3f55){return db[_0xb8ee('0x86')][_0xb8ee('0x37')]({'where':{'OpenchannelAccountId':_0xf0a12f},'transaction':_0x85eda4})[_0xb8ee('0x21')](function(){var _0x344655=_[_0xb8ee('0x45')](_0x118cfb,function(_0x4bfd12){_0x4bfd12[_0xb8ee('0x6c')]=_0xf0a12f;return _0x4bfd12;});return db[_0xb8ee('0x86')][_0xb8ee('0xab')](_0x344655,{'transaction':_0x85eda4});});}else{_0x1f98ef=0x194;_0x4a27d0=[];}});})['then'](function(){if(_0x1f98ef!==0x194){return db[_0xb8ee('0x86')][_0xb8ee('0xac')]({'where':{'OpenchannelAccountId':_0xf0a12f},'order':'priority'})[_0xb8ee('0x21')](function(_0x2af66e){_0x4a27d0=_0x2af66e;});}})[_0xb8ee('0x59')](function(_0x2ea540){_0x1f98ef=0x1f4;logger[_0xb8ee('0x27')](_0x2ea540[_0xb8ee('0x3b')]);if(_0x2ea540[_0xb8ee('0x3c')]){delete _0x2ea540[_0xb8ee('0x3c')];}_0x4a27d0=_0x2ea540;})['finally'](function(){if(_0x4a27d0===null){_0x58a61b[_0xb8ee('0x2a')](_0x1f98ef);}else{if(_0x1f98ef===0x1f4){_0x58a61b[_0xb8ee('0x2b')](_0x1f98ef)['send'](_0x4a27d0);}else{_0x58a61b['status'](_0x1f98ef)[_0xb8ee('0x2d')](_0x4a27d0);}}});};exports[_0xb8ee('0xad')]=function(_0x4cd8ea,_0x5d3a7f,_0x254448){var _0x2d4a21={};var _0x18a05a={};var _0x5c355d;var _0x5d2cd0;return db['OpenchannelAccount'][_0xb8ee('0x6a')]({'where':{'id':_0x4cd8ea[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x5d3a7f,null))[_0xb8ee('0x21')](function(_0x3ad7e2){if(_0x3ad7e2){_0x5c355d=_0x3ad7e2;_0x18a05a['model']=_['keys'](db[_0xb8ee('0x86')]['rawAttributes']);_0x18a05a[_0xb8ee('0x46')]=_[_0xb8ee('0x47')](_0x4cd8ea[_0xb8ee('0x46')]);_0x18a05a[_0xb8ee('0x50')]=_[_0xb8ee('0x5d')](_0x18a05a[_0xb8ee('0x44')],_0x18a05a['query']);_0x2d4a21[_0xb8ee('0x48')]=_['intersection'](_0x18a05a[_0xb8ee('0x44')],qs[_0xb8ee('0x49')](_0x4cd8ea[_0xb8ee('0x46')][_0xb8ee('0x49')]));_0x2d4a21[_0xb8ee('0x48')]=_0x2d4a21['attributes'][_0xb8ee('0x4a')]?_0x2d4a21['attributes']:_0x18a05a[_0xb8ee('0x44')];_0x2d4a21[_0xb8ee('0x4d')]=qs[_0xb8ee('0x4e')](_0x4cd8ea[_0xb8ee('0x46')][_0xb8ee('0x4e')]);_0x2d4a21[_0xb8ee('0x4f')]=qs[_0xb8ee('0x50')](_[_0xb8ee('0x6b')](_0x4cd8ea[_0xb8ee('0x46')],_0x18a05a['filters']));if(_0x4cd8ea['query'][_0xb8ee('0x51')]){_0x2d4a21[_0xb8ee('0x4f')]=_[_0xb8ee('0x52')](_0x2d4a21['where'],{'$or':_[_0xb8ee('0x45')](_0x2d4a21[_0xb8ee('0x48')],function(_0x107131){var _0x3187b0={};_0x3187b0[_0x107131]={'$like':'%'+_0x4cd8ea[_0xb8ee('0x46')]['filter']+'%'};return _0x3187b0;})});}_0x2d4a21=_['merge']({},_0x2d4a21,_0x4cd8ea['options']);return _0x5c355d[_0xb8ee('0xad')](_0x2d4a21);}})['then'](function(_0x9a6ad7){if(_0x9a6ad7){_0x5d2cd0=_0x9a6ad7['length'];if(!_0x4cd8ea[_0xb8ee('0x46')][_0xb8ee('0x4b')](_0xb8ee('0x4c'))){_0x2d4a21[_0xb8ee('0x2f')]=qs['limit'](_0x4cd8ea['query'][_0xb8ee('0x2f')]);_0x2d4a21['offset']=qs['offset'](_0x4cd8ea[_0xb8ee('0x46')]['offset']);}return _0x5c355d[_0xb8ee('0xad')](_0x2d4a21);}})['then'](function(_0x5a361c){if(_0x5a361c){return _0x5a361c?{'count':_0x5d2cd0,'rows':_0x5a361c}:null;}})[_0xb8ee('0x21')](respondWithResult(_0x5d3a7f,null))[_0xb8ee('0x59')](handleError(_0x5d3a7f,null));};exports[_0xb8ee('0xae')]=function(_0x2f2495,_0x3cd28c,_0xf1d352){var _0x141aee={'raw':![],'where':{}};var _0x1e6f6e={};var _0x1a00bc={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xb8ee('0x6a')]({'where':{'id':_0x2f2495[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x3cd28c,null))[_0xb8ee('0x21')](function(_0x177692){if(_0x177692){_0x1e6f6e[_0xb8ee('0x44')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x1e6f6e['query']=_[_0xb8ee('0x47')](_0x2f2495[_0xb8ee('0x46')]);_0x1e6f6e['filters']=_['intersection'](_0x1e6f6e[_0xb8ee('0x44')],_0x1e6f6e['query']);_0x141aee[_0xb8ee('0x48')]=_[_0xb8ee('0x5d')](_0x1e6f6e[_0xb8ee('0x44')],qs[_0xb8ee('0x49')](_0x2f2495[_0xb8ee('0x46')]['fields']));_0x141aee[_0xb8ee('0x48')]=_0x141aee[_0xb8ee('0x48')]['length']?_0x141aee['attributes']:_0x1e6f6e[_0xb8ee('0x44')];if(!_0x2f2495[_0xb8ee('0x46')][_0xb8ee('0x4b')]('nolimit')){_0x141aee[_0xb8ee('0x2f')]=qs[_0xb8ee('0x2f')](_0x2f2495['query'][_0xb8ee('0x2f')]);_0x141aee[_0xb8ee('0x2e')]=qs[_0xb8ee('0x2e')](_0x2f2495[_0xb8ee('0x46')][_0xb8ee('0x2e')]);}_0x141aee[_0xb8ee('0x4d')]=qs['sort'](_0x2f2495[_0xb8ee('0x46')]['sort']);_0x141aee['where']=qs[_0xb8ee('0x50')](_[_0xb8ee('0x6b')](_0x2f2495[_0xb8ee('0x46')],_0x1e6f6e[_0xb8ee('0x50')]));_0x141aee[_0xb8ee('0x4f')][_0xb8ee('0x6c')]=_0x177692['id'];if(_0x2f2495[_0xb8ee('0x46')]['filter']){_0x141aee[_0xb8ee('0x4f')]=_['merge'](_0x141aee[_0xb8ee('0x4f')],{'$or':_['map'](_0x141aee['attributes'],function(_0x75c277){var _0x1db8a6={};_0x1db8a6[_0x75c277]={'$like':'%'+_0x2f2495[_0xb8ee('0x46')]['filter']+'%'};return _0x1db8a6;})});}_0x141aee=_[_0xb8ee('0x52')]({},_0x141aee,_0x2f2495[_0xb8ee('0x55')]);return db['OpenchannelInteraction'][_0xb8ee('0x31')]({'where':_0x141aee[_0xb8ee('0x4f')]})[_0xb8ee('0x21')](function(_0x4914b9){_0x1a00bc[_0xb8ee('0x31')]=_0x4914b9;if(_0x2f2495[_0xb8ee('0x46')][_0xb8ee('0x6d')]){_0x141aee['include']=[{'model':db[_0xb8ee('0x74')],'as':_0xb8ee('0xaf'),'required':![]},{'model':db[_0xb8ee('0xa0')],'as':_0xb8ee('0xb0'),'attributes':[_0xb8ee('0x3c'),_0xb8ee('0xb1'),_0xb8ee('0xb2')],'required':![]},{'model':db['Tag'],'as':_0xb8ee('0xb3'),'attributes':['id','name',_0xb8ee('0xb4')],'where':_0x2f2495[_0xb8ee('0x46')][_0xb8ee('0xb5')]?{'id':_0x2f2495['query']['tag']}:undefined,'required':_0x2f2495[_0xb8ee('0x46')][_0xb8ee('0xb5')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xb8ee('0x57')](_0x141aee);})[_0xb8ee('0x21')](function(_0x59f7b7){_0x1a00bc[_0xb8ee('0x58')]=_0x59f7b7;return _0x1a00bc;});}})[_0xb8ee('0x21')](respondWithFilteredResult(_0x3cd28c,_0x141aee))[_0xb8ee('0x59')](handleError(_0x3cd28c,null));};exports[_0xb8ee('0xb6')]=function(_0x3e67d4,_0x4b7ec4,_0x52d360){return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x3e67d4[_0xb8ee('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4b7ec4,null))[_0xb8ee('0x21')](function(_0x419a57){if(_0x419a57){return _0x419a57['addAgents'](_0x3e67d4[_0xb8ee('0x66')][_0xb8ee('0x6f')],_[_0xb8ee('0xb7')](_0x3e67d4['body'],[_0xb8ee('0x6f'),'id'])||{})[_0xb8ee('0x95')](function(_0x5c8b82){for(var _0x492836=0x0;_0x492836<_0x3e67d4['body'][_0xb8ee('0x6f')]['length'];_0x492836+=0x1){socket[_0xb8ee('0xb8')](_0xb8ee('0xb9'),{'UserId':Number(_0x3e67d4[_0xb8ee('0x66')][_0xb8ee('0x6f')][_0x492836]),'OpenchannelAccountId':Number(_0x3e67d4[_0xb8ee('0x5b')]['id'])});}return _0x5c8b82;});}})[_0xb8ee('0x21')](respondWithResult(_0x4b7ec4,null))[_0xb8ee('0x59')](handleError(_0x4b7ec4,null));};exports[_0xb8ee('0xba')]=function(_0x33e20a,_0x27b1ae,_0x45bcc0){return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x33e20a['params']['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x27b1ae,null))['then'](function(_0x252fcd){if(_0x252fcd){return _0x252fcd['removeAgents'](_0x33e20a[_0xb8ee('0x46')][_0xb8ee('0x6f')])[_0xb8ee('0x21')](function(){if(_[_0xb8ee('0xbb')](_0x33e20a[_0xb8ee('0x46')][_0xb8ee('0x6f')])){for(var _0x50eecb=0x0;_0x50eecb<_0x33e20a[_0xb8ee('0x46')][_0xb8ee('0x6f')][_0xb8ee('0x4a')];_0x50eecb+=0x1){socket[_0xb8ee('0xb8')]('userOpenchannelAccount:remove',{'UserId':Number(_0x33e20a[_0xb8ee('0x46')]['ids'][_0x50eecb]),'OpenchannelAccountId':Number(_0x33e20a[_0xb8ee('0x5b')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x33e20a[_0xb8ee('0x46')][_0xb8ee('0x6f')]),'OpenchannelAccountId':Number(_0x33e20a['params']['id'])});}});}})[_0xb8ee('0x21')](respondWithStatusCode(_0x27b1ae,null))[_0xb8ee('0x59')](handleError(_0x27b1ae,null));};exports[_0xb8ee('0xbc')]=function(_0x57f075,_0x3b576f,_0xd00b9b){var _0x52f711={};var _0x3dce35={};var _0x9ffa1c;var _0x25c90a;return db[_0xb8ee('0x40')][_0xb8ee('0x6a')]({'where':{'id':_0x57f075[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x3b576f,null))[_0xb8ee('0x21')](function(_0x572ad9){if(_0x572ad9){_0x9ffa1c=_0x572ad9;_0x3dce35[_0xb8ee('0x44')]=_['keys'](db[_0xb8ee('0xa0')][_0xb8ee('0x41')]);_0x3dce35['query']=_[_0xb8ee('0x47')](_0x57f075[_0xb8ee('0x46')]);_0x3dce35[_0xb8ee('0x50')]=_[_0xb8ee('0x5d')](_0x3dce35['model'],_0x3dce35[_0xb8ee('0x46')]);_0x52f711['attributes']=_[_0xb8ee('0x5d')](_0x3dce35['model'],qs[_0xb8ee('0x49')](_0x57f075['query'][_0xb8ee('0x49')]));_0x52f711[_0xb8ee('0x48')]=_0x52f711['attributes'][_0xb8ee('0x4a')]?_0x52f711['attributes']:_0x3dce35[_0xb8ee('0x44')];_0x52f711['order']=qs[_0xb8ee('0x4e')](_0x57f075[_0xb8ee('0x46')][_0xb8ee('0x4e')]);_0x52f711['where']=qs[_0xb8ee('0x50')](_[_0xb8ee('0x6b')](_0x57f075[_0xb8ee('0x46')],_0x3dce35[_0xb8ee('0x50')]));if(_0x57f075['query']['filter']){_0x52f711[_0xb8ee('0x4f')]=_[_0xb8ee('0x52')](_0x52f711[_0xb8ee('0x4f')],{'$or':_[_0xb8ee('0x45')](_0x52f711[_0xb8ee('0x48')],function(_0x2a1f43){var _0x2c2207={};_0x2c2207[_0x2a1f43]={'$like':'%'+_0x57f075['query'][_0xb8ee('0x51')]+'%'};return _0x2c2207;})});}_0x52f711=_[_0xb8ee('0x52')]({},_0x52f711,_0x57f075['options']);return _0x9ffa1c[_0xb8ee('0xbc')](_0x52f711);}})[_0xb8ee('0x21')](function(_0x3c6674){if(_0x3c6674){_0x25c90a=_0x3c6674[_0xb8ee('0x4a')];if(!_0x57f075['query'][_0xb8ee('0x4b')](_0xb8ee('0x4c'))){_0x52f711[_0xb8ee('0x2f')]=qs[_0xb8ee('0x2f')](_0x57f075[_0xb8ee('0x46')][_0xb8ee('0x2f')]);_0x52f711[_0xb8ee('0x2e')]=qs['offset'](_0x57f075[_0xb8ee('0x46')]['offset']);}return _0x9ffa1c[_0xb8ee('0xbc')](_0x52f711);}})[_0xb8ee('0x21')](function(_0x450981){if(_0x450981){return _0x450981?{'count':_0x25c90a,'rows':_0x450981}:null;}})[_0xb8ee('0x21')](respondWithResult(_0x3b576f,null))[_0xb8ee('0x59')](handleError(_0x3b576f,null));};exports[_0xb8ee('0x3d')]=function(_0x4a83b0,_0x19f9a1,_0x1ab202){var _0x5a3c1a,_0x12e840,_0x245c09;if(_['isNil'](_0x4a83b0[_0xb8ee('0x66')][_0xb8ee('0x66')])||_0x4a83b0[_0xb8ee('0x66')][_0xb8ee('0x66')]===''){throw new db[(_0xb8ee('0x7e'))]['ValidationError'](_0xb8ee('0x7f'));}if(_['isNil'](_0x4a83b0['body']['to'])){}_0x5a3c1a=_0x4a83b0['body']['to'];return db[_0xb8ee('0x40')]['findOne']({'where':{'id':_0x4a83b0[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x19f9a1,null))['then'](function(_0x230392){if(_0x230392){return db['OpenchannelAccount'][_0xb8ee('0x5e')]({'where':{'id':_0x230392['id']},'include':[{'model':db[_0xb8ee('0x83')],'as':_0xb8ee('0x84'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x230392[_0xb8ee('0x80')]]:_0x5a3c1a},'limit':0x1,'order':[[_0xb8ee('0x79'),_0xb8ee('0xbd')]]}]}]})[_0xb8ee('0x21')](handleEntityNotFound(_0x19f9a1,null))[_0xb8ee('0x21')](function(_0x3989cb){if(_0x3989cb&&_0x3989cb['List']){_0x12e840=_0x3989cb[_0xb8ee('0x38')]({'plain':!![]});if(_0x12e840[_0xb8ee('0x84')]&&_0x12e840[_0xb8ee('0x84')]['Contacts'][_0xb8ee('0x4a')]){return _0x12e840[_0xb8ee('0x84')][_0xb8ee('0x85')][0x0];}return db[_0xb8ee('0x74')]['create'](_['defaults'](_0x4a83b0[_0xb8ee('0x66')],{'firstName':_0x5a3c1a,[_0x3989cb[_0xb8ee('0x80')]]:_0x5a3c1a,'phone':_0x5a3c1a,'ListId':_0x12e840[_0xb8ee('0x7a')]}));}})[_0xb8ee('0x21')](handleEntityNotFound(_0x19f9a1,null))[_0xb8ee('0x21')](function(_0x32048f){if(_0x32048f){_0x245c09=_0x32048f;return db['OpenchannelInteraction'][_0xb8ee('0x5e')]({'where':{'ContactId':_0x245c09['id'],'closed':![],'OpenchannelAccountId':_0x12e840['id']}})[_0xb8ee('0x21')](function(_0x531e6a){if(_0x531e6a){return[_0x531e6a,![]];}return db[_0xb8ee('0x93')][_0xb8ee('0x5f')]({'UserId':_0x4a83b0[_0xb8ee('0x60')]['id'],'ContactId':_0x245c09['id'],'OpenchannelAccountId':_0x12e840['id'],'lastMsgDirection':'out','firstMsgDirection':'out','Messages':[_['merge'](_0x4a83b0[_0xb8ee('0x66')],{'read':![],'body':_0x4a83b0['body'][_0xb8ee('0x66')],'OpenchannelAccountId':_0x12e840['id'],'UserId':_0x4a83b0[_0xb8ee('0x60')]['id'],'ContactId':_0x245c09['id']})]},{'include':[{'model':db[_0xb8ee('0x9d')],'as':'Messages'}]})[_0xb8ee('0x21')](function(_0x4e6181){return[_0x4e6181,!![]];});});}})[_0xb8ee('0x95')](function(_0x2d4b26,_0x552e2e){if(_0x552e2e){return _0x2d4b26;}return db[_0xb8ee('0x9d')]['create'](_[_0xb8ee('0x52')](_0x4a83b0[_0xb8ee('0x66')],{'read':![],'body':_0x4a83b0['body'][_0xb8ee('0x66')],'OpenchannelAccountId':_0x12e840['id'],'OpenchannelInteractionId':_0x2d4b26['id'],'UserId':_0x4a83b0['user']['id'],'ContactId':_0x245c09['id']}))[_0xb8ee('0x21')](function(_0x2f2c9b){_0x2d4b26['dataValues'][_0xb8ee('0xbe')]=[];_0x2d4b26[_0xb8ee('0xbf')]['Messages']['push'](_0x2f2c9b[_0xb8ee('0xbf')]);return _0x2d4b26;});});}})['then'](respondWithResult(_0x19f9a1,null))[_0xb8ee('0x59')](handleError(_0x19f9a1,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 5376912..9c34e90 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd64b=['exports','events','OpenchannelAccount','save','update','remove','hasOwnProperty','hook'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd64b,0xc1));var _0xbd64=function(_0x4edb68,_0x58a318){_0x4edb68=_0x4edb68-0x0;var _0x1449f8=_0xd64b[_0x4edb68];return _0x1449f8;};'use strict';var EventEmitter=require(_0xbd64('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbd64('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd64('0x2'),'afterUpdate':_0xbd64('0x3'),'afterDestroy':_0xbd64('0x4')};function emitEvent(_0x3f1f05){return function(_0x30fe29,_0x5458d8,_0x5446e4){OpenchannelAccountEvents['emit'](_0x3f1f05+':'+_0x30fe29['id'],_0x30fe29);OpenchannelAccountEvents['emit'](_0x3f1f05,_0x30fe29);_0x5446e4(null);};}for(var e in events){if(events[_0xbd64('0x5')](e)){var event=events[e];OpenchannelAccount[_0xbd64('0x6')](e,emitEvent(event));}}module[_0xbd64('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xb4e6=['update','remove','emit','hook','events','OpenchannelAccount','setMaxListeners','save'];(function(_0x567ad7,_0x4f55e0){var _0x338c0e=function(_0x44fd26){while(--_0x44fd26){_0x567ad7['push'](_0x567ad7['shift']());}};_0x338c0e(++_0x4f55e0);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x406696,_0x39f9b1){_0x406696=_0x406696-0x0;var _0x10e35c=_0xb4e6[_0x406696];return _0x10e35c;};'use strict';var EventEmitter=require(_0x6b4e('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x6b4e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6b4e('0x2')](0x0);var events={'afterCreate':_0x6b4e('0x3'),'afterUpdate':_0x6b4e('0x4'),'afterDestroy':_0x6b4e('0x5')};function emitEvent(_0x31e8ad){return function(_0x1929b8,_0x52313b,_0x40da90){OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad+':'+_0x1929b8['id'],_0x1929b8);OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad,_0x1929b8);_0x40da90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x6b4e('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 4a1d21c..a8ef2e6 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2918b1,_0x2612eb){var _0x220029=function(_0x4ad710){while(--_0x4ad710){_0x2918b1['push'](_0x2918b1['shift']());}};_0x220029(++_0x2612eb);}(_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':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x19b5c4,_0x1b3b25){var _0xfe1d55=function(_0x5eddcd){while(--_0x5eddcd){_0x19b5c4['push'](_0x19b5c4['shift']());}};_0xfe1d55(++_0x1b3b25);}(_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 logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 21a3aa3..c171a31 100644 --- a/server/api/openchannelAccount/openchannelAccount.rpc.js +++ b/server/api/openchannelAccount/openchannelAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55f1=['socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost'];(function(_0x5568fc,_0x579078){var _0x8b2704=function(_0x9a08c6){while(--_0x9a08c6){_0x5568fc['push'](_0x5568fc['shift']());}};_0x8b2704(++_0x579078);}(_0x55f1,0x9b));var _0x155f=function(_0x3538d4,_0x26372e){_0x3538d4=_0x3538d4-0x0;var _0x5d9252=_0x55f1[_0x3538d4];return _0x5d9252;};'use strict';var _=require(_0x155f('0x0'));var util=require('util');var moment=require(_0x155f('0x1'));var BPromise=require(_0x155f('0x2'));var rs=require(_0x155f('0x3'));var fs=require('fs');var Redis=require(_0x155f('0x4'));var db=require(_0x155f('0x5'))['db'];var utils=require(_0x155f('0x6'));var logger=require(_0x155f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x155f('0x8'));var client=jayson['client'][_0x155f('0x9')]({'port':0x232a});config[_0x155f('0xa')]=_[_0x155f('0xb')](config[_0x155f('0xa')],{'host':_0x155f('0xc'),'port':0x18eb});var socket=require(_0x155f('0xd'))(new Redis(config[_0x155f('0xa')]));require(_0x155f('0xe'))[_0x155f('0xf')](socket);function respondWithRpcPromise(_0x281c5a,_0x11c946,_0x39d85a){return new BPromise(function(_0x5b9e3b,_0x9fb9a){return client[_0x155f('0x10')](_0x281c5a,_0x39d85a)[_0x155f('0x11')](function(_0x3575d8){logger['info'](_0x155f('0x12'),_0x11c946,_0x155f('0x13'));logger[_0x155f('0x14')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x11c946,'request\x20sent',JSON[_0x155f('0x15')](_0x3575d8));if(_0x3575d8[_0x155f('0x16')]){if(_0x3575d8[_0x155f('0x16')][_0x155f('0x17')]===0x1f4){logger[_0x155f('0x16')](_0x155f('0x12'),_0x11c946,_0x3575d8[_0x155f('0x16')]['message']);return _0x9fb9a(_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);}logger['error'](_0x155f('0x12'),_0x11c946,_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);return _0x5b9e3b(_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);}else{logger[_0x155f('0x19')](_0x155f('0x12'),_0x11c946,_0x155f('0x13'));_0x5b9e3b(_0x3575d8[_0x155f('0x1a')][_0x155f('0x18')]);}})[_0x155f('0x1b')](function(_0x3bdede){logger[_0x155f('0x16')](_0x155f('0x12'),_0x11c946,_0x3bdede);_0x9fb9a(_0x3bdede);});});} \ No newline at end of file +var _0x8580=['http','redis','defaults','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x13a8d6,_0x4e8ec9){var _0x23fed9=function(_0x1e430b){while(--_0x1e430b){_0x13a8d6['push'](_0x13a8d6['shift']());}};_0x23fed9(++_0x4e8ec9);}(_0x8580,0x1c7));var _0x0858=function(_0x44542e,_0x3fae75){_0x44542e=_0x44542e-0x0;var _0x4ff55c=_0x8580[_0x44542e];return _0x4ff55c;};'use strict';var _=require('lodash');var util=require(_0x0858('0x0'));var moment=require('moment');var BPromise=require(_0x0858('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0858('0x2'))['db'];var utils=require(_0x0858('0x3'));var logger=require('../../config/logger')(_0x0858('0x4'));var config=require(_0x0858('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0858('0x6')][_0x0858('0x7')]({'port':0x232a});config[_0x0858('0x8')]=_[_0x0858('0x9')](config['redis'],{'host':_0x0858('0xa'),'port':0x18eb});var socket=require(_0x0858('0xb'))(new Redis(config[_0x0858('0x8')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x470459,_0x4b5072,_0x24996d){return new BPromise(function(_0x1c214c,_0x38371f){return client[_0x0858('0xc')](_0x470459,_0x24996d)[_0x0858('0xd')](function(_0x207cda){logger[_0x0858('0xe')](_0x0858('0xf'),_0x4b5072,'request\x20sent');logger['debug'](_0x0858('0x10'),_0x4b5072,'request\x20sent',JSON['stringify'](_0x207cda));if(_0x207cda['error']){if(_0x207cda[_0x0858('0x11')][_0x0858('0x12')]===0x1f4){logger['error'](_0x0858('0xf'),_0x4b5072,_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);return _0x38371f(_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);}logger[_0x0858('0x11')](_0x0858('0xf'),_0x4b5072,_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);return _0x1c214c(_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);}else{logger[_0x0858('0xe')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b5072,_0x0858('0x14'));_0x1c214c(_0x207cda['result'][_0x0858('0x13')]);}})[_0x0858('0x15')](function(_0x3a2d96){logger[_0x0858('0x11')](_0x0858('0xf'),_0x4b5072,_0x3a2d96);_0x38371f(_0x3a2d96);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 6211c41..cf730b4 100644 --- a/server/api/openchannelAccount/openchannelAccount.socket.js +++ b/server/api/openchannelAccount/openchannelAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9000=['length','./openchannelAccount.events','save','update','emit','removeListener','register'];(function(_0x36e137,_0x39e47d){var _0x528d6d=function(_0x28c983){while(--_0x28c983){_0x36e137['push'](_0x36e137['shift']());}};_0x528d6d(++_0x39e47d);}(_0x9000,0x19e));var _0x0900=function(_0x4582a9,_0x52e47d){_0x4582a9=_0x4582a9-0x0;var _0x49c003=_0x9000[_0x4582a9];return _0x49c003;};'use strict';var OpenchannelAccountEvents=require(_0x0900('0x0'));var events=[_0x0900('0x1'),'remove',_0x0900('0x2')];function createListener(_0x28000f,_0x12afb6){return function(_0x3f1b03){_0x12afb6[_0x0900('0x3')](_0x28000f,_0x3f1b03);};}function removeListener(_0x15d123,_0x31100b){return function(){OpenchannelAccountEvents[_0x0900('0x4')](_0x15d123,_0x31100b);};}exports[_0x0900('0x5')]=function(_0x50b1ad){for(var _0x1c7c0b=0x0,_0x4f6314=events[_0x0900('0x6')];_0x1c7c0b<_0x4f6314;_0x1c7c0b++){var _0x153c20=events[_0x1c7c0b];var _0xedb70a=createListener('openchannelAccount:'+_0x153c20,_0x50b1ad);OpenchannelAccountEvents['on'](_0x153c20,_0xedb70a);}}; \ No newline at end of file +var _0x8f37=['remove','emit','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x430a8f,_0x564bde){var _0x84904=function(_0x181ccf){while(--_0x181ccf){_0x430a8f['push'](_0x430a8f['shift']());}};_0x84904(++_0x564bde);}(_0x8f37,0x190));var _0x78f3=function(_0x1d16ff,_0x29e492){_0x1d16ff=_0x1d16ff-0x0;var _0x16cc62=_0x8f37[_0x1d16ff];return _0x16cc62;};'use strict';var OpenchannelAccountEvents=require(_0x78f3('0x0'));var events=[_0x78f3('0x1'),_0x78f3('0x2'),'update'];function createListener(_0x542bc0,_0x2a7d93){return function(_0x3c1fa6){_0x2a7d93[_0x78f3('0x3')](_0x542bc0,_0x3c1fa6);};}function removeListener(_0x539794,_0x1d59a5){return function(){OpenchannelAccountEvents['removeListener'](_0x539794,_0x1d59a5);};}exports[_0x78f3('0x4')]=function(_0x597b85){for(var _0x11c6ad=0x0,_0x3dc185=events['length'];_0x11c6ad<_0x3dc185;_0x11c6ad++){var _0x58bd73=events[_0x11c6ad];var _0x55e353=createListener(_0x78f3('0x5')+_0x58bd73,_0x597b85);OpenchannelAccountEvents['on'](_0x58bd73,_0x55e353);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 0e30c5f..9d95428 100644 --- a/server/api/openchannelApplication/index.js +++ b/server/api/openchannelApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x594d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x35ce50,_0xa12d0c){var _0x332c17=function(_0x1b8d3f){while(--_0x1b8d3f){_0x35ce50['push'](_0x35ce50['shift']());}};_0x332c17(++_0xa12d0c);}(_0x594d,0x1c9));var _0xd594=function(_0x57994b,_0x5c1f07){_0x57994b=_0x57994b-0x0;var _0x3bf855=_0x594d[_0x57994b];return _0x3bf855;};'use strict';var multer=require(_0xd594('0x0'));var util=require(_0xd594('0x1'));var path=require(_0xd594('0x2'));var timeout=require('connect-timeout');var express=require(_0xd594('0x3'));var router=express[_0xd594('0x4')]();var fs_extra=require(_0xd594('0x5'));var auth=require(_0xd594('0x6'));var interaction=require(_0xd594('0x7'));var config=require(_0xd594('0x8'));var controller=require(_0xd594('0x9'));router[_0xd594('0xa')]('/',auth[_0xd594('0xb')](),controller[_0xd594('0xc')]);router['get'](_0xd594('0xd'),auth[_0xd594('0xb')](),controller['show']);router[_0xd594('0xe')]('/',auth[_0xd594('0xb')](),controller[_0xd594('0xf')]);router[_0xd594('0x10')](_0xd594('0xd'),auth[_0xd594('0xb')](),controller[_0xd594('0x11')]);router[_0xd594('0x12')]('/:id',auth[_0xd594('0xb')](),controller[_0xd594('0x13')]);module[_0xd594('0x14')]=router; \ No newline at end of file +var _0x0739=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x56be10,_0x33e759){var _0x548042=function(_0x16cf00){while(--_0x16cf00){_0x56be10['push'](_0x56be10['shift']());}};_0x548042(++_0x33e759);}(_0x0739,0xc8));var _0x9073=function(_0x1ffebf,_0x826bc3){_0x1ffebf=_0x1ffebf-0x0;var _0x12f424=_0x0739[_0x1ffebf];return _0x12f424;};'use strict';var multer=require(_0x9073('0x0'));var util=require(_0x9073('0x1'));var path=require('path');var timeout=require(_0x9073('0x2'));var express=require(_0x9073('0x3'));var router=express[_0x9073('0x4')]();var fs_extra=require(_0x9073('0x5'));var auth=require(_0x9073('0x6'));var interaction=require(_0x9073('0x7'));var config=require(_0x9073('0x8'));var controller=require(_0x9073('0x9'));router[_0x9073('0xa')]('/',auth[_0x9073('0xb')](),controller['index']);router[_0x9073('0xa')]('/:id',auth[_0x9073('0xb')](),controller[_0x9073('0xc')]);router[_0x9073('0xd')]('/',auth['isAuthenticated'](),controller[_0x9073('0xe')]);router[_0x9073('0xf')](_0x9073('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x9073('0x11')](_0x9073('0x10'),auth[_0x9073('0xb')](),controller[_0x9073('0x12')]);module[_0x9073('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index cfa56c3..0af703d 100644 --- a/server/api/openchannelApplication/openchannelApplication.attributes.js +++ b/server/api/openchannelApplication/openchannelApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x375d=['noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x375d,0x149));var _0xd375=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x375d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd375('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd375('0x1')},'appdata':{'type':Sequelize[_0xd375('0x2')]()},'description':{'type':Sequelize[_0xd375('0x3')]},'interval':{'type':Sequelize[_0xd375('0x3')],'defaultValue':_0xd375('0x4')}}; \ No newline at end of file +var _0x6209=['INTEGER','*,*,*,*','sequelize','exports'];(function(_0x21da4f,_0x2c5cc3){var _0x235284=function(_0x2339ed){while(--_0x2339ed){_0x21da4f['push'](_0x21da4f['shift']());}};_0x235284(++_0x2c5cc3);}(_0x6209,0x10e));var _0x9620=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6209[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x9620('0x0'));module[_0x9620('0x1')]={'priority':{'type':Sequelize[_0x9620('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9620('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 538d0db..b12232e 100644 --- a/server/api/openchannelApplication/openchannelApplication.controller.js +++ b/server/api/openchannelApplication/openchannelApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9643=['intersection','attributes','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','count','include','findAll','rows','params','keys','fields','length','includeAll','catch','create','body','update','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query'];(function(_0xa0277,_0x528a00){var _0x4f95f6=function(_0x381384){while(--_0x381384){_0xa0277['push'](_0xa0277['shift']());}};_0x4f95f6(++_0x528a00);}(_0x9643,0x140));var _0x3964=function(_0x572c36,_0x305252){_0x572c36=_0x572c36-0x0;var _0x4f74f0=_0x9643[_0x572c36];return _0x4f74f0;};'use strict';var emlformat=require(_0x3964('0x0'));var rimraf=require(_0x3964('0x1'));var zipdir=require(_0x3964('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3964('0x3'));var moment=require(_0x3964('0x4'));var BPromise=require(_0x3964('0x5'));var Mustache=require(_0x3964('0x6'));var util=require(_0x3964('0x7'));var path=require(_0x3964('0x8'));var sox=require(_0x3964('0x9'));var csv=require(_0x3964('0xa'));var ejs=require(_0x3964('0xb'));var fs=require('fs');var fs_extra=require(_0x3964('0xc'));var _=require(_0x3964('0xd'));var squel=require(_0x3964('0xe'));var crypto=require(_0x3964('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3964('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3964('0x10'));var authService=require(_0x3964('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3964('0x12'));var hardwareService=require(_0x3964('0x13'));var logger=require('../../config/logger')(_0x3964('0x14'));var utils=require(_0x3964('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3964('0x16'));var db=require(_0x3964('0x17'))['db'];function respondWithStatusCode(_0x2fcdc2,_0x380c67){_0x380c67=_0x380c67||0xcc;return function(_0x3c023d){if(_0x3c023d){return _0x2fcdc2['sendStatus'](_0x380c67);}return _0x2fcdc2[_0x3964('0x18')](_0x380c67)[_0x3964('0x19')]();};}function respondWithResult(_0x53c63b,_0x4f2d15){_0x4f2d15=_0x4f2d15||0xc8;return function(_0x357aca){if(_0x357aca){return _0x53c63b[_0x3964('0x18')](_0x4f2d15)[_0x3964('0x1a')](_0x357aca);}};}function respondWithFilteredResult(_0x270035,_0x1998f9){return function(_0x29e9c9){if(_0x29e9c9){var _0x354285=typeof _0x1998f9[_0x3964('0x1b')]===_0x3964('0x1c')&&typeof _0x1998f9['limit']===_0x3964('0x1c');var _0x3da3d5=_0x29e9c9['count'];var _0x25844c=_0x354285?0x0:_0x1998f9[_0x3964('0x1b')];var _0x1b5759=_0x354285?_0x29e9c9['count']:_0x1998f9[_0x3964('0x1b')]+_0x1998f9[_0x3964('0x1d')];var _0x294608;if(_0x1b5759>=_0x3da3d5){_0x1b5759=_0x3da3d5;_0x294608=0xc8;}else{_0x294608=0xce;}_0x270035[_0x3964('0x18')](_0x294608);return _0x270035[_0x3964('0x1e')](_0x3964('0x1f'),_0x25844c+'-'+_0x1b5759+'/'+_0x3da3d5)[_0x3964('0x1a')](_0x29e9c9);}return null;};}function patchUpdates(_0x182263){return function(_0x38c7eb){try{jsonpatch[_0x3964('0x20')](_0x38c7eb,_0x182263,!![]);}catch(_0x2edfcb){return BPromise[_0x3964('0x21')](_0x2edfcb);}return _0x38c7eb[_0x3964('0x22')]();};}function saveUpdates(_0x24f1cf,_0x4aec74){return function(_0x5a8bec){if(_0x5a8bec){return _0x5a8bec['update'](_0x24f1cf)[_0x3964('0x23')](function(_0x13f66f){return _0x13f66f;});}return null;};}function removeEntity(_0x29e092,_0x55c624){return function(_0xe51139){if(_0xe51139){return _0xe51139[_0x3964('0x24')]()[_0x3964('0x23')](function(){_0x29e092[_0x3964('0x18')](0xcc)[_0x3964('0x19')]();});}};}function handleEntityNotFound(_0x416f45,_0x49274f){return function(_0x1dcee4){if(!_0x1dcee4){_0x416f45[_0x3964('0x25')](0x194);}return _0x1dcee4;};}function handleError(_0x250aa3,_0x1c2071){_0x1c2071=_0x1c2071||0x1f4;return function(_0x384ef4){logger[_0x3964('0x26')](_0x384ef4[_0x3964('0x27')]);if(_0x384ef4[_0x3964('0x28')]){delete _0x384ef4[_0x3964('0x28')];}_0x250aa3['status'](_0x1c2071)['send'](_0x384ef4);};}exports[_0x3964('0x29')]=function(_0x13e543,_0x330068){var _0x1883af={},_0xdafa5={},_0x2db1b3={'count':0x0,'rows':[]};var _0x3b1be2=_[_0x3964('0x2a')](db[_0x3964('0x2b')][_0x3964('0x2c')],function(_0x30bcda){return{'name':_0x30bcda[_0x3964('0x2d')],'type':_0x30bcda[_0x3964('0x2e')][_0x3964('0x2f')]};});_0xdafa5[_0x3964('0x30')]=_[_0x3964('0x2a')](_0x3b1be2,_0x3964('0x28'));_0xdafa5[_0x3964('0x31')]=_['keys'](_0x13e543['query']);_0xdafa5['filters']=_[_0x3964('0x32')](_0xdafa5[_0x3964('0x30')],_0xdafa5[_0x3964('0x31')]);_0x1883af['attributes']=_[_0x3964('0x32')](_0xdafa5['model'],qs['fields'](_0x13e543[_0x3964('0x31')]['fields']));_0x1883af[_0x3964('0x33')]=_0x1883af[_0x3964('0x33')]['length']?_0x1883af[_0x3964('0x33')]:_0xdafa5[_0x3964('0x30')];if(!_0x13e543[_0x3964('0x31')][_0x3964('0x34')](_0x3964('0x35'))){_0x1883af[_0x3964('0x1d')]=qs[_0x3964('0x1d')](_0x13e543[_0x3964('0x31')][_0x3964('0x1d')]);_0x1883af[_0x3964('0x1b')]=qs[_0x3964('0x1b')](_0x13e543[_0x3964('0x31')][_0x3964('0x1b')]);}_0x1883af[_0x3964('0x36')]=qs['sort'](_0x13e543[_0x3964('0x31')]['sort']);_0x1883af[_0x3964('0x37')]=qs[_0x3964('0x38')](_['pick'](_0x13e543[_0x3964('0x31')],_0xdafa5[_0x3964('0x38')]),_0x3b1be2);if(_0x13e543['query'][_0x3964('0x39')]){_0x1883af[_0x3964('0x37')]=_[_0x3964('0x3a')](_0x1883af[_0x3964('0x37')],{'$or':_[_0x3964('0x2a')](_0x3b1be2,function(_0x102353){if(_0x102353[_0x3964('0x2e')]!==_0x3964('0x3b')){var _0x5c8bc6={};_0x5c8bc6[_0x102353[_0x3964('0x28')]]={'$like':'%'+_0x13e543[_0x3964('0x31')][_0x3964('0x39')]+'%'};return _0x5c8bc6;}})});}_0x1883af=_[_0x3964('0x3a')]({},_0x1883af,_0x13e543['options']);var _0x13119c={'where':_0x1883af['where']};return db[_0x3964('0x2b')][_0x3964('0x3c')](_0x13119c)['then'](function(_0x489444){_0x2db1b3[_0x3964('0x3c')]=_0x489444;if(_0x13e543[_0x3964('0x31')]['includeAll']){_0x1883af[_0x3964('0x3d')]=[{'all':!![]}];}return db[_0x3964('0x2b')][_0x3964('0x3e')](_0x1883af);})['then'](function(_0x9d05c8){_0x2db1b3[_0x3964('0x3f')]=_0x9d05c8;return _0x2db1b3;})['then'](respondWithFilteredResult(_0x330068,_0x1883af))['catch'](handleError(_0x330068,null));};exports['show']=function(_0x244761,_0x2b0781){var _0x58edb2={'raw':!![],'where':{'id':_0x244761[_0x3964('0x40')]['id']}},_0x4fa229={};_0x4fa229[_0x3964('0x30')]=_[_0x3964('0x41')](db[_0x3964('0x2b')][_0x3964('0x2c')]);_0x4fa229[_0x3964('0x31')]=_['keys'](_0x244761[_0x3964('0x31')]);_0x4fa229[_0x3964('0x38')]=_[_0x3964('0x32')](_0x4fa229[_0x3964('0x30')],_0x4fa229[_0x3964('0x31')]);_0x58edb2['attributes']=_[_0x3964('0x32')](_0x4fa229['model'],qs[_0x3964('0x42')](_0x244761[_0x3964('0x31')]['fields']));_0x58edb2[_0x3964('0x33')]=_0x58edb2[_0x3964('0x33')][_0x3964('0x43')]?_0x58edb2[_0x3964('0x33')]:_0x4fa229[_0x3964('0x30')];if(_0x244761[_0x3964('0x31')][_0x3964('0x44')]){_0x58edb2[_0x3964('0x3d')]=[{'all':!![]}];}_0x58edb2=_[_0x3964('0x3a')]({},_0x58edb2,_0x244761['options']);return db[_0x3964('0x2b')]['find'](_0x58edb2)[_0x3964('0x23')](handleEntityNotFound(_0x2b0781,null))[_0x3964('0x23')](respondWithResult(_0x2b0781,null))[_0x3964('0x45')](handleError(_0x2b0781,null));};exports[_0x3964('0x46')]=function(_0x4e7b8b,_0x206444){return db[_0x3964('0x2b')][_0x3964('0x46')](_0x4e7b8b[_0x3964('0x47')],{})[_0x3964('0x23')](respondWithResult(_0x206444,0xc9))[_0x3964('0x45')](handleError(_0x206444,null));};exports[_0x3964('0x48')]=function(_0x2b2063,_0x289c47){if(_0x2b2063[_0x3964('0x47')]['id']){delete _0x2b2063['body']['id'];}return db['OpenchannelApplication'][_0x3964('0x49')]({'where':{'id':_0x2b2063[_0x3964('0x40')]['id']}})[_0x3964('0x23')](handleEntityNotFound(_0x289c47,null))['then'](saveUpdates(_0x2b2063[_0x3964('0x47')],null))[_0x3964('0x23')](respondWithResult(_0x289c47,null))['catch'](handleError(_0x289c47,null));};exports[_0x3964('0x24')]=function(_0x475c87,_0x1dcf34){return db[_0x3964('0x2b')][_0x3964('0x49')]({'where':{'id':_0x475c87[_0x3964('0x40')]['id']}})[_0x3964('0x23')](handleEntityNotFound(_0x1dcf34,null))['then'](removeEntity(_0x1dcf34,null))[_0x3964('0x45')](handleError(_0x1dcf34,null));}; \ No newline at end of file +var _0xd69f=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','eml-format'];(function(_0x5c62fc,_0x41431a){var _0x14c817=function(_0x34dd8a){while(--_0x34dd8a){_0x5c62fc['push'](_0x5c62fc['shift']());}};_0x14c817(++_0x41431a);}(_0xd69f,0x123));var _0xfd69=function(_0x294b9e,_0xf77b23){_0x294b9e=_0x294b9e-0x0;var _0x3079b4=_0xd69f[_0x294b9e];return _0x3079b4;};'use strict';var emlformat=require(_0xfd69('0x0'));var rimraf=require(_0xfd69('0x1'));var zipdir=require(_0xfd69('0x2'));var jsonpatch=require(_0xfd69('0x3'));var rp=require(_0xfd69('0x4'));var moment=require('moment');var BPromise=require(_0xfd69('0x5'));var Mustache=require('mustache');var util=require(_0xfd69('0x6'));var path=require(_0xfd69('0x7'));var sox=require(_0xfd69('0x8'));var csv=require(_0xfd69('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd69('0xa'));var _=require(_0xfd69('0xb'));var squel=require('squel');var crypto=require(_0xfd69('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfd69('0x9'));var querystring=require(_0xfd69('0xd'));var Papa=require(_0xfd69('0xe'));var Redis=require('ioredis');var authService=require(_0xfd69('0xf'));var qs=require(_0xfd69('0x10'));var as=require(_0xfd69('0x11'));var hardwareService=require(_0xfd69('0x12'));var logger=require(_0xfd69('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfd69('0x14'));var db=require(_0xfd69('0x15'))['db'];function respondWithStatusCode(_0x40f9f1,_0x221a7d){_0x221a7d=_0x221a7d||0xcc;return function(_0x437332){if(_0x437332){return _0x40f9f1['sendStatus'](_0x221a7d);}return _0x40f9f1['status'](_0x221a7d)[_0xfd69('0x16')]();};}function respondWithResult(_0x6fe277,_0xa88323){_0xa88323=_0xa88323||0xc8;return function(_0x2f3eae){if(_0x2f3eae){return _0x6fe277['status'](_0xa88323)[_0xfd69('0x17')](_0x2f3eae);}};}function respondWithFilteredResult(_0x35d3cb,_0x34300c){return function(_0xb86e77){if(_0xb86e77){var _0x1c9154=typeof _0x34300c[_0xfd69('0x18')]===_0xfd69('0x19')&&typeof _0x34300c['limit']==='undefined';var _0x5dd38c=_0xb86e77[_0xfd69('0x1a')];var _0x29140d=_0x1c9154?0x0:_0x34300c[_0xfd69('0x18')];var _0x5b8e8a=_0x1c9154?_0xb86e77['count']:_0x34300c['offset']+_0x34300c[_0xfd69('0x1b')];var _0x597828;if(_0x5b8e8a>=_0x5dd38c){_0x5b8e8a=_0x5dd38c;_0x597828=0xc8;}else{_0x597828=0xce;}_0x35d3cb[_0xfd69('0x1c')](_0x597828);return _0x35d3cb[_0xfd69('0x1d')](_0xfd69('0x1e'),_0x29140d+'-'+_0x5b8e8a+'/'+_0x5dd38c)[_0xfd69('0x17')](_0xb86e77);}return null;};}function patchUpdates(_0x2a888f){return function(_0x5b58ac){try{jsonpatch[_0xfd69('0x1f')](_0x5b58ac,_0x2a888f,!![]);}catch(_0x57d784){return BPromise[_0xfd69('0x20')](_0x57d784);}return _0x5b58ac[_0xfd69('0x21')]();};}function saveUpdates(_0x2d7c4e,_0xbe5cad){return function(_0x2dbb18){if(_0x2dbb18){return _0x2dbb18[_0xfd69('0x22')](_0x2d7c4e)[_0xfd69('0x23')](function(_0x16d78e){return _0x16d78e;});}return null;};}function removeEntity(_0x76f123,_0x378ada){return function(_0x125eef){if(_0x125eef){return _0x125eef['destroy']()[_0xfd69('0x23')](function(){_0x76f123[_0xfd69('0x1c')](0xcc)[_0xfd69('0x16')]();});}};}function handleEntityNotFound(_0x325e68,_0xa91584){return function(_0x979b35){if(!_0x979b35){_0x325e68[_0xfd69('0x24')](0x194);}return _0x979b35;};}function handleError(_0x1c29a5,_0x2237b7){_0x2237b7=_0x2237b7||0x1f4;return function(_0x429ef7){logger[_0xfd69('0x25')](_0x429ef7[_0xfd69('0x26')]);if(_0x429ef7[_0xfd69('0x27')]){delete _0x429ef7[_0xfd69('0x27')];}_0x1c29a5[_0xfd69('0x1c')](_0x2237b7)[_0xfd69('0x28')](_0x429ef7);};}exports[_0xfd69('0x29')]=function(_0x11de51,_0x5eee0d){var _0x2e6542={},_0x40b974={},_0x1d070d={'count':0x0,'rows':[]};var _0x4bed13=_[_0xfd69('0x2a')](db[_0xfd69('0x2b')][_0xfd69('0x2c')],function(_0x51edf1){return{'name':_0x51edf1['fieldName'],'type':_0x51edf1[_0xfd69('0x2d')][_0xfd69('0x2e')]};});_0x40b974[_0xfd69('0x2f')]=_[_0xfd69('0x2a')](_0x4bed13,_0xfd69('0x27'));_0x40b974[_0xfd69('0x30')]=_[_0xfd69('0x31')](_0x11de51[_0xfd69('0x30')]);_0x40b974[_0xfd69('0x32')]=_[_0xfd69('0x33')](_0x40b974['model'],_0x40b974[_0xfd69('0x30')]);_0x2e6542['attributes']=_['intersection'](_0x40b974[_0xfd69('0x2f')],qs[_0xfd69('0x34')](_0x11de51[_0xfd69('0x30')][_0xfd69('0x34')]));_0x2e6542[_0xfd69('0x35')]=_0x2e6542[_0xfd69('0x35')][_0xfd69('0x36')]?_0x2e6542[_0xfd69('0x35')]:_0x40b974[_0xfd69('0x2f')];if(!_0x11de51['query'][_0xfd69('0x37')]('nolimit')){_0x2e6542[_0xfd69('0x1b')]=qs[_0xfd69('0x1b')](_0x11de51[_0xfd69('0x30')][_0xfd69('0x1b')]);_0x2e6542[_0xfd69('0x18')]=qs[_0xfd69('0x18')](_0x11de51[_0xfd69('0x30')]['offset']);}_0x2e6542['order']=qs[_0xfd69('0x38')](_0x11de51[_0xfd69('0x30')][_0xfd69('0x38')]);_0x2e6542[_0xfd69('0x39')]=qs['filters'](_[_0xfd69('0x3a')](_0x11de51[_0xfd69('0x30')],_0x40b974[_0xfd69('0x32')]),_0x4bed13);if(_0x11de51[_0xfd69('0x30')]['filter']){_0x2e6542[_0xfd69('0x39')]=_[_0xfd69('0x3b')](_0x2e6542['where'],{'$or':_[_0xfd69('0x2a')](_0x4bed13,function(_0x57c14e){if(_0x57c14e[_0xfd69('0x2d')]!==_0xfd69('0x3c')){var _0x256afc={};_0x256afc[_0x57c14e[_0xfd69('0x27')]]={'$like':'%'+_0x11de51[_0xfd69('0x30')][_0xfd69('0x3d')]+'%'};return _0x256afc;}})});}_0x2e6542=_[_0xfd69('0x3b')]({},_0x2e6542,_0x11de51[_0xfd69('0x3e')]);var _0x1fe9e3={'where':_0x2e6542['where']};return db[_0xfd69('0x2b')][_0xfd69('0x1a')](_0x1fe9e3)['then'](function(_0x165f57){_0x1d070d[_0xfd69('0x1a')]=_0x165f57;if(_0x11de51['query'][_0xfd69('0x3f')]){_0x2e6542[_0xfd69('0x40')]=[{'all':!![]}];}return db[_0xfd69('0x2b')][_0xfd69('0x41')](_0x2e6542);})[_0xfd69('0x23')](function(_0x44b980){_0x1d070d[_0xfd69('0x42')]=_0x44b980;return _0x1d070d;})['then'](respondWithFilteredResult(_0x5eee0d,_0x2e6542))[_0xfd69('0x43')](handleError(_0x5eee0d,null));};exports[_0xfd69('0x44')]=function(_0xf6b29c,_0x692df2){var _0x1040da={'raw':!![],'where':{'id':_0xf6b29c[_0xfd69('0x45')]['id']}},_0x1e89d9={};_0x1e89d9['model']=_[_0xfd69('0x31')](db['OpenchannelApplication']['rawAttributes']);_0x1e89d9[_0xfd69('0x30')]=_[_0xfd69('0x31')](_0xf6b29c[_0xfd69('0x30')]);_0x1e89d9[_0xfd69('0x32')]=_['intersection'](_0x1e89d9['model'],_0x1e89d9[_0xfd69('0x30')]);_0x1040da[_0xfd69('0x35')]=_[_0xfd69('0x33')](_0x1e89d9[_0xfd69('0x2f')],qs['fields'](_0xf6b29c[_0xfd69('0x30')]['fields']));_0x1040da['attributes']=_0x1040da[_0xfd69('0x35')][_0xfd69('0x36')]?_0x1040da['attributes']:_0x1e89d9[_0xfd69('0x2f')];if(_0xf6b29c['query'][_0xfd69('0x3f')]){_0x1040da['include']=[{'all':!![]}];}_0x1040da=_[_0xfd69('0x3b')]({},_0x1040da,_0xf6b29c[_0xfd69('0x3e')]);return db['OpenchannelApplication'][_0xfd69('0x46')](_0x1040da)[_0xfd69('0x23')](handleEntityNotFound(_0x692df2,null))[_0xfd69('0x23')](respondWithResult(_0x692df2,null))[_0xfd69('0x43')](handleError(_0x692df2,null));};exports['create']=function(_0x42f67b,_0xe89be9){return db[_0xfd69('0x2b')]['create'](_0x42f67b[_0xfd69('0x47')],{})['then'](respondWithResult(_0xe89be9,0xc9))['catch'](handleError(_0xe89be9,null));};exports[_0xfd69('0x22')]=function(_0x418ecb,_0x164a85){if(_0x418ecb['body']['id']){delete _0x418ecb[_0xfd69('0x47')]['id'];}return db['OpenchannelApplication'][_0xfd69('0x46')]({'where':{'id':_0x418ecb[_0xfd69('0x45')]['id']}})[_0xfd69('0x23')](handleEntityNotFound(_0x164a85,null))[_0xfd69('0x23')](saveUpdates(_0x418ecb[_0xfd69('0x47')],null))[_0xfd69('0x23')](respondWithResult(_0x164a85,null))[_0xfd69('0x43')](handleError(_0x164a85,null));};exports[_0xfd69('0x48')]=function(_0x5bfee0,_0x13a806){return db[_0xfd69('0x2b')][_0xfd69('0x46')]({'where':{'id':_0x5bfee0[_0xfd69('0x45')]['id']}})['then'](handleEntityNotFound(_0x13a806,null))['then'](removeEntity(_0x13a806,null))[_0xfd69('0x43')](handleError(_0x13a806,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 55946f4..a6f0943 100644 --- a/server/api/openchannelApplication/openchannelApplication.model.js +++ b/server/api/openchannelApplication/openchannelApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdac7=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','utf8mb4'];(function(_0x48d4f6,_0x3f3cc4){var _0x401219=function(_0xdeb261){while(--_0xdeb261){_0x48d4f6['push'](_0x48d4f6['shift']());}};_0x401219(++_0x3f3cc4);}(_0xdac7,0xf8));var _0x7dac=function(_0x59d21e,_0x282d6){_0x59d21e=_0x59d21e-0x0;var _0x45ef19=_0xdac7[_0x59d21e];return _0x45ef19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7dac('0x0'))(_0x7dac('0x1'));var moment=require(_0x7dac('0x2'));var BPromise=require(_0x7dac('0x3'));var rp=require(_0x7dac('0x4'));var fs=require('fs');var path=require(_0x7dac('0x5'));var rimraf=require(_0x7dac('0x6'));var config=require(_0x7dac('0x7'));var attributes=require(_0x7dac('0x8'));module[_0x7dac('0x9')]=function(_0x6af76a,_0x4a82f2){return _0x6af76a[_0x7dac('0xa')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7dac('0xb'),'collate':_0x7dac('0xc')});}; \ No newline at end of file +var _0xaad1=['exports','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','./openchannelApplication.attributes'];(function(_0x4c5984,_0x4c3cae){var _0x33df91=function(_0x5b1f06){while(--_0x5b1f06){_0x4c5984['push'](_0x4c5984['shift']());}};_0x33df91(++_0x4c3cae);}(_0xaad1,0x1b2));var _0x1aad=function(_0x3d3b31,_0x567bc0){_0x3d3b31=_0x3d3b31-0x0;var _0x2f4792=_0xaad1[_0x3d3b31];return _0x2f4792;};'use strict';var _=require(_0x1aad('0x0'));var util=require(_0x1aad('0x1'));var logger=require(_0x1aad('0x2'))(_0x1aad('0x3'));var moment=require('moment');var BPromise=require(_0x1aad('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1aad('0x5'));var rimraf=require(_0x1aad('0x6'));var config=require('../../config/environment');var attributes=require(_0x1aad('0x7'));module[_0x1aad('0x8')]=function(_0x42b363,_0x41444f){return _0x42b363[_0x1aad('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x1aad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1aad('0xb'),'collate':_0x1aad('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 7b9eed4..559d9fd 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa115=['request\x20sent','stringify','error','code','message','OpenchannelApplication,\x20%s,\x20%s','result','OpenchannelApplication','update','body','options','where','UpdateOpenchannelApplication','debug','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s,\x20%s'];(function(_0x343168,_0x265708){var _0x34152e=function(_0x13ce1f){while(--_0x13ce1f){_0x343168['push'](_0x343168['shift']());}};_0x34152e(++_0x265708);}(_0xa115,0x1b3));var _0x5a11=function(_0xddd864,_0x2105ef){_0xddd864=_0xddd864-0x0;var _0x6e1b32=_0xa115[_0xddd864];return _0x6e1b32;};'use strict';var _=require(_0x5a11('0x0'));var util=require(_0x5a11('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a11('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a11('0x3'));var logger=require(_0x5a11('0x4'))(_0x5a11('0x5'));var config=require(_0x5a11('0x6'));var jayson=require(_0x5a11('0x7'));var client=jayson[_0x5a11('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34a1b3,_0x3a2390,_0x44a29a){return new BPromise(function(_0x198f5b,_0x12fa0e){return client[_0x5a11('0x9')](_0x34a1b3,_0x44a29a)[_0x5a11('0xa')](function(_0x3e2590){logger[_0x5a11('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x3a2390,'request\x20sent');logger['debug'](_0x5a11('0xc'),_0x3a2390,_0x5a11('0xd'),JSON[_0x5a11('0xe')](_0x3e2590));if(_0x3e2590['error']){if(_0x3e2590[_0x5a11('0xf')][_0x5a11('0x10')]===0x1f4){logger[_0x5a11('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x3a2390,_0x3e2590[_0x5a11('0xf')][_0x5a11('0x11')]);return _0x12fa0e(_0x3e2590[_0x5a11('0xf')]['message']);}logger['error'](_0x5a11('0x12'),_0x3a2390,_0x3e2590[_0x5a11('0xf')][_0x5a11('0x11')]);return _0x198f5b(_0x3e2590[_0x5a11('0xf')][_0x5a11('0x11')]);}else{logger[_0x5a11('0xb')](_0x5a11('0x12'),_0x3a2390,_0x5a11('0xd'));_0x198f5b(_0x3e2590[_0x5a11('0x13')][_0x5a11('0x11')]);}})['catch'](function(_0x3fcccf){logger[_0x5a11('0xf')](_0x5a11('0x12'),_0x3a2390,_0x3fcccf);_0x12fa0e(_0x3fcccf);});});}exports['UpdateOpenchannelApplication']=function(_0x1807e6){var _0x8997a2=this;return new Promise(function(_0x47c9ee,_0x2c3ce2){return db[_0x5a11('0x14')][_0x5a11('0x15')](_0x1807e6[_0x5a11('0x16')],{'raw':_0x1807e6[_0x5a11('0x17')]?_0x1807e6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1807e6[_0x5a11('0x17')]?_0x1807e6[_0x5a11('0x17')][_0x5a11('0x18')]||null:null,'attributes':_0x1807e6[_0x5a11('0x17')]?_0x1807e6[_0x5a11('0x17')]['attributes']||null:null,'limit':_0x1807e6[_0x5a11('0x17')]?_0x1807e6['options']['limit']||null:null})[_0x5a11('0xa')](function(_0x59d1a1){logger['info'](_0x5a11('0x19'),_0x1807e6);logger[_0x5a11('0x1a')](_0x5a11('0x19'),_0x1807e6,JSON[_0x5a11('0xe')](_0x59d1a1));_0x47c9ee(_0x59d1a1);})[_0x5a11('0x1b')](function(_0x4c4ece){logger[_0x5a11('0xf')](_0x5a11('0x19'),_0x4c4ece[_0x5a11('0x11')],_0x1807e6);_0x2c3ce2(_0x8997a2[_0x5a11('0xf')](0x1f4,_0x4c4ece[_0x5a11('0x11')]));});});}; \ No newline at end of file +var _0x9fd2=['raw','where','attributes','limit','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options'];(function(_0x22835e,_0x14ffec){var _0xb85ef9=function(_0x358f09){while(--_0x358f09){_0x22835e['push'](_0x22835e['shift']());}};_0xb85ef9(++_0x14ffec);}(_0x9fd2,0x112));var _0x29fd=function(_0x468afb,_0x577de4){_0x468afb=_0x468afb-0x0;var _0x30e273=_0x9fd2[_0x468afb];return _0x30e273;};'use strict';var _=require(_0x29fd('0x0'));var util=require('util');var moment=require(_0x29fd('0x1'));var BPromise=require('bluebird');var rs=require(_0x29fd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29fd('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x29fd('0x4'));var config=require(_0x29fd('0x5'));var jayson=require(_0x29fd('0x6'));var client=jayson[_0x29fd('0x7')][_0x29fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x65c69a,_0x2ecb44,_0x394ca9){return new BPromise(function(_0x4b1f4d,_0x415332){return client[_0x29fd('0x9')](_0x65c69a,_0x394ca9)[_0x29fd('0xa')](function(_0x5a33df){logger['info'](_0x29fd('0xb'),_0x2ecb44,_0x29fd('0xc'));logger[_0x29fd('0xd')](_0x29fd('0xe'),_0x2ecb44,_0x29fd('0xc'),JSON[_0x29fd('0xf')](_0x5a33df));if(_0x5a33df['error']){if(_0x5a33df[_0x29fd('0x10')][_0x29fd('0x11')]===0x1f4){logger[_0x29fd('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x2ecb44,_0x5a33df[_0x29fd('0x10')][_0x29fd('0x12')]);return _0x415332(_0x5a33df[_0x29fd('0x10')]['message']);}logger[_0x29fd('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x2ecb44,_0x5a33df[_0x29fd('0x10')]['message']);return _0x4b1f4d(_0x5a33df[_0x29fd('0x10')][_0x29fd('0x12')]);}else{logger[_0x29fd('0x13')](_0x29fd('0xb'),_0x2ecb44,'request\x20sent');_0x4b1f4d(_0x5a33df[_0x29fd('0x14')][_0x29fd('0x12')]);}})['catch'](function(_0x4da386){logger[_0x29fd('0x10')](_0x29fd('0xb'),_0x2ecb44,_0x4da386);_0x415332(_0x4da386);});});}exports[_0x29fd('0x15')]=function(_0x1b652a){var _0xe58adf=this;return new Promise(function(_0x12f9d5,_0x5c6bff){return db[_0x29fd('0x16')][_0x29fd('0x17')](_0x1b652a[_0x29fd('0x18')],{'raw':_0x1b652a['options']?_0x1b652a[_0x29fd('0x19')][_0x29fd('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b652a[_0x29fd('0x19')]?_0x1b652a['options'][_0x29fd('0x1b')]||null:null,'attributes':_0x1b652a[_0x29fd('0x19')]?_0x1b652a[_0x29fd('0x19')][_0x29fd('0x1c')]||null:null,'limit':_0x1b652a[_0x29fd('0x19')]?_0x1b652a['options'][_0x29fd('0x1d')]||null:null})[_0x29fd('0xa')](function(_0x2a3f27){logger[_0x29fd('0x13')](_0x29fd('0x15'),_0x1b652a);logger[_0x29fd('0xd')]('UpdateOpenchannelApplication',_0x1b652a,JSON[_0x29fd('0xf')](_0x2a3f27));_0x12f9d5(_0x2a3f27);})['catch'](function(_0x4cb299){logger[_0x29fd('0x10')](_0x29fd('0x15'),_0x4cb299[_0x29fd('0x12')],_0x1b652a);_0x5c6bff(_0xe58adf[_0x29fd('0x10')](0x1f4,_0x4cb299[_0x29fd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index bf76f63..8e5c9d1 100644 --- a/server/api/openchannelInteraction/index.js +++ b/server/api/openchannelInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58ab=['show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','index','describe','/:id','isAuthenticated'];(function(_0x15544c,_0x74230b){var _0x4ab6f1=function(_0x252182){while(--_0x252182){_0x15544c['push'](_0x15544c['shift']());}};_0x4ab6f1(++_0x74230b);}(_0x58ab,0x1e1));var _0xb58a=function(_0x547aa5,_0x2b539c){_0x547aa5=_0x547aa5-0x0;var _0x261ab4=_0x58ab[_0x547aa5];return _0x261ab4;};'use strict';var multer=require('multer');var util=require(_0xb58a('0x0'));var path=require('path');var timeout=require(_0xb58a('0x1'));var express=require(_0xb58a('0x2'));var router=express['Router']();var fs_extra=require(_0xb58a('0x3'));var auth=require(_0xb58a('0x4'));var interaction=require(_0xb58a('0x5'));var config=require('../../config/environment');var controller=require(_0xb58a('0x6'));router[_0xb58a('0x7')]('/',auth['isAuthenticated'](),controller[_0xb58a('0x8')]);router[_0xb58a('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xb58a('0x9')]);router[_0xb58a('0x7')](_0xb58a('0xa'),auth[_0xb58a('0xb')](),controller[_0xb58a('0xc')]);router['get'](_0xb58a('0xd'),auth[_0xb58a('0xb')](),controller[_0xb58a('0xe')]);router['get'](_0xb58a('0xf'),auth['isAuthenticated'](),controller['download']);router[_0xb58a('0x10')]('/',auth[_0xb58a('0xb')](),controller['create']);router[_0xb58a('0x10')](_0xb58a('0xd'),auth['isAuthenticated'](),controller[_0xb58a('0x11')]);router['post'](_0xb58a('0x12'),auth[_0xb58a('0xb')](),interaction[_0xb58a('0x13')](_0xb58a('0x14'),_0xb58a('0x15')),controller['addTags']);router[_0xb58a('0x16')](_0xb58a('0xa'),auth[_0xb58a('0xb')](),interaction[_0xb58a('0x13')]('openchannel',_0xb58a('0x17')),controller[_0xb58a('0x18')]);router[_0xb58a('0x19')](_0xb58a('0xa'),auth['isAuthenticated'](),interaction[_0xb58a('0x13')](_0xb58a('0x14'),_0xb58a('0x1a')),controller[_0xb58a('0x1b')]);router['delete'](_0xb58a('0x12'),auth[_0xb58a('0xb')](),controller[_0xb58a('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x88ba=['addMessage','tracked','put','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','/:id/tags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','post','create','/:id/messages'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x88ba,0x12a));var _0xa88b=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0x88ba[_0x19f9e6];return _0x45c862;};'use strict';var multer=require(_0xa88b('0x0'));var util=require(_0xa88b('0x1'));var path=require('path');var timeout=require(_0xa88b('0x2'));var express=require(_0xa88b('0x3'));var router=express[_0xa88b('0x4')]();var fs_extra=require(_0xa88b('0x5'));var auth=require(_0xa88b('0x6'));var interaction=require(_0xa88b('0x7'));var config=require(_0xa88b('0x8'));var controller=require(_0xa88b('0x9'));router[_0xa88b('0xa')]('/',auth[_0xa88b('0xb')](),controller[_0xa88b('0xc')]);router[_0xa88b('0xa')](_0xa88b('0xd'),auth['isAuthenticated'](),controller[_0xa88b('0xe')]);router[_0xa88b('0xa')](_0xa88b('0xf'),auth[_0xa88b('0xb')](),controller['show']);router[_0xa88b('0xa')]('/:id/messages',auth[_0xa88b('0xb')](),controller[_0xa88b('0x10')]);router['get'](_0xa88b('0x11'),auth[_0xa88b('0xb')](),controller[_0xa88b('0x12')]);router[_0xa88b('0x13')]('/',auth[_0xa88b('0xb')](),controller[_0xa88b('0x14')]);router[_0xa88b('0x13')](_0xa88b('0x15'),auth[_0xa88b('0xb')](),controller[_0xa88b('0x16')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xa88b('0x17')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0xa88b('0x18')](_0xa88b('0xf'),auth[_0xa88b('0xb')](),interaction[_0xa88b('0x17')](_0xa88b('0x19'),_0xa88b('0x1a')),controller[_0xa88b('0x1b')]);router[_0xa88b('0x1c')](_0xa88b('0xf'),auth[_0xa88b('0xb')](),interaction['tracked'](_0xa88b('0x19'),_0xa88b('0x1d')),controller['destroy']);router['delete'](_0xa88b('0x1e'),auth[_0xa88b('0xb')](),controller['removeTags']);module[_0xa88b('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index f522a90..3a198d2 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js +++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb95=['out','sequelize','exports','STRING','DATE','ENUM'];(function(_0x1564b6,_0x19d71e){var _0xb01c25=function(_0x620136){while(--_0x620136){_0x1564b6['push'](_0x1564b6['shift']());}};_0xb01c25(++_0x19d71e);}(_0xbb95,0x7f));var _0x5bb9=function(_0x457acf,_0x3aa6db){_0x457acf=_0x457acf-0x0;var _0x900734=_0xbb95[_0x457acf];return _0x900734;};'use strict';var Sequelize=require(_0x5bb9('0x0'));module[_0x5bb9('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5bb9('0x2')]},'secondDisposition':{'type':Sequelize[_0x5bb9('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5bb9('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x5bb9('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x5bb9('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x5bb9('0x4')]('in',_0x5bb9('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5bb9('0x2')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6ae0=['sequelize','exports','BOOLEAN','DATE','STRING','out'];(function(_0xb42ec7,_0x4a0132){var _0x5824d5=function(_0x3dfd6f){while(--_0x3dfd6f){_0xb42ec7['push'](_0xb42ec7['shift']());}};_0x5824d5(++_0x4a0132);}(_0x6ae0,0x192));var _0x06ae=function(_0x34e4c8,_0x3508e4){_0x34e4c8=_0x34e4c8-0x0;var _0x25ccc3=_0x6ae0[_0x34e4c8];return _0x25ccc3;};'use strict';var Sequelize=require(_0x06ae('0x0'));module[_0x06ae('0x1')]={'closed':{'type':Sequelize[_0x06ae('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x06ae('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x06ae('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x06ae('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x06ae('0x4')]},'lastMsgAt':{'type':Sequelize[_0x06ae('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x06ae('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x06ae('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x06ae('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index b72fdb4..1442127 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.controller.js +++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2105=['OpenchannelInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','addTags','spread','Tag','color','emit','removeTags','download','toString','join','server','files','root','format','transcript-%d-%s.zip','User','fullname','CmContact','Contact','firstName','lastName','push','Attachment','Messages','createdAt','direction','read','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','closed','disposition','Private','basename','createReadStream','pipe','createWriteStream','out','System','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','openchannel','query','user','from','params','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','catch','create','body','find','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x59ccec,_0x44350b){var _0x17cc7f=function(_0x479bb9){while(--_0x479bb9){_0x59ccec['push'](_0x59ccec['shift']());}};_0x17cc7f(++_0x44350b);}(_0x2105,0x1b7));var _0x5210=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2105[_0x3ab51d];return _0x29a04e;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x5210('0x0'));var util=require(_0x5210('0x1'));var path=require(_0x5210('0x2'));var ejs=require(_0x5210('0x3'));var fs=require('fs');var _=require(_0x5210('0x4'));var Redis=require(_0x5210('0x5'));var interaction=require(_0x5210('0x6'));var qs=require(_0x5210('0x7'));var pdf=require(_0x5210('0x8'));var logger=require('../../config/logger')(_0x5210('0x9'));var config=require('../../config/environment');var db=require(_0x5210('0xa'))['db'];config[_0x5210('0xb')]=_['defaults'](config[_0x5210('0xb')],{'host':_0x5210('0xc'),'port':0x18eb});var socket=require(_0x5210('0xd'))(new Redis(config[_0x5210('0xb')]));require('./openchannelInteraction.socket')[_0x5210('0xe')](socket);function respondWithStatusCode(_0x3bcb8e,_0x59d0f1){_0x59d0f1=_0x59d0f1||0xcc;return function(_0x417bfd){if(_0x417bfd){return _0x3bcb8e[_0x5210('0xf')](_0x59d0f1);}return _0x3bcb8e[_0x5210('0x10')](_0x59d0f1)[_0x5210('0x11')]();};}function respondWithResult(_0x4eddec,_0x23c213){_0x23c213=_0x23c213||0xc8;return function(_0x34f34a){if(_0x34f34a){return _0x4eddec[_0x5210('0x10')](_0x23c213)['json'](_0x34f34a);}};}function respondWithFilteredResult(_0x41fc0d,_0x9a94de){return function(_0x598ac2){if(_0x598ac2){var _0x1eca37=typeof _0x9a94de[_0x5210('0x12')]===_0x5210('0x13')&&typeof _0x9a94de['limit']===_0x5210('0x13');var _0x17e282=_0x598ac2[_0x5210('0x14')];var _0x310c5a=_0x1eca37?0x0:_0x9a94de[_0x5210('0x12')];var _0x202e14=_0x1eca37?_0x598ac2[_0x5210('0x14')]:_0x9a94de[_0x5210('0x12')]+_0x9a94de[_0x5210('0x15')];var _0x4bdc88;if(_0x202e14>=_0x17e282){_0x202e14=_0x17e282;_0x4bdc88=0xc8;}else{_0x4bdc88=0xce;}_0x41fc0d[_0x5210('0x10')](_0x4bdc88);return _0x41fc0d[_0x5210('0x16')](_0x5210('0x17'),_0x310c5a+'-'+_0x202e14+'/'+_0x17e282)[_0x5210('0x18')](_0x598ac2);}return null;};}function saveUpdates(_0x229145){return function(_0x4face7){if(_0x4face7){return _0x4face7[_0x5210('0x19')](_0x229145)[_0x5210('0x1a')](function(_0x2685c0){return _0x2685c0;});}return null;};}function removeEntity(_0x4723a8){return function(_0x175323){if(_0x175323){return _0x175323[_0x5210('0x1b')]()[_0x5210('0x1a')](function(){_0x4723a8[_0x5210('0x10')](0xcc)[_0x5210('0x11')]();});}};}function handleEntityNotFound(_0x4c36ff){return function(_0x3a0053){if(!_0x3a0053){_0x4c36ff[_0x5210('0xf')](0x194);}return _0x3a0053;};}function handleError(_0x5c9053,_0x5b059e){_0x5b059e=_0x5b059e||0x1f4;return function(_0xffbbe7){logger[_0x5210('0x1c')](_0xffbbe7[_0x5210('0x1d')]);if(_0xffbbe7[_0x5210('0x1e')]){delete _0xffbbe7[_0x5210('0x1e')];}_0x5c9053[_0x5210('0x10')](_0x5b059e)[_0x5210('0x1f')](_0xffbbe7);};}exports[_0x5210('0x20')]=function(_0x44cead,_0x47d078){var _0x183b30={};var _0x549a68=_[_0x5210('0x21')](db[_0x5210('0x22')][_0x5210('0x23')],function(_0x1d26d4){return{'name':_0x1d26d4[_0x5210('0x24')],'type':_0x1d26d4[_0x5210('0x25')][_0x5210('0x26')]};});_0x183b30=qs[_0x5210('0x27')](_0x549a68,_0x44cead);return interaction['findAll'](_0x5210('0x28'),_0x44cead[_0x5210('0x29')],_0x44cead[_0x5210('0x2a')],_0x183b30,_0x549a68)['then'](respondWithFilteredResult(_0x47d078,_0x183b30))['catch'](handleError(_0x47d078,null));};exports['show']=function(_0x392000,_0x18192e){var _0x493591={};if(_0x392000[_0x5210('0x29')]['type']&&_0x392000[_0x5210('0x29')][_0x5210('0x25')]===_0x5210('0x2b')){_0x493591['from']=_0x392000[_0x5210('0x2c')]['id'];}else{_0x493591['id']=_0x392000[_0x5210('0x2c')]['id'];}var _0x1a5e6e={'raw':![],'where':_0x493591},_0x5902d1={};_0x5902d1[_0x5210('0x2d')]=_[_0x5210('0x2e')](db['OpenchannelInteraction'][_0x5210('0x23')]);_0x5902d1['query']=_[_0x5210('0x2e')](_0x392000[_0x5210('0x29')]);_0x5902d1[_0x5210('0x2f')]=_[_0x5210('0x30')](_0x5902d1[_0x5210('0x2d')],_0x5902d1[_0x5210('0x29')]);_0x1a5e6e['attributes']=_[_0x5210('0x30')](_0x5902d1[_0x5210('0x2d')],qs['fields'](_0x392000[_0x5210('0x29')][_0x5210('0x31')]));_0x1a5e6e[_0x5210('0x32')]=_0x1a5e6e[_0x5210('0x32')][_0x5210('0x33')]?_0x1a5e6e['attributes']:_0x5902d1[_0x5210('0x2d')];if(_0x392000['query'][_0x5210('0x34')]){_0x1a5e6e['include']=[{'all':!![]}];}_0x1a5e6e=_[_0x5210('0x35')]({},_0x1a5e6e,_0x392000['options']);return db[_0x5210('0x22')]['find'](_0x1a5e6e)[_0x5210('0x1a')](handleEntityNotFound(_0x18192e,null))['then'](respondWithResult(_0x18192e,null))[_0x5210('0x36')](handleError(_0x18192e,null));};exports['create']=function(_0x2de992,_0x152ad5){return db[_0x5210('0x22')][_0x5210('0x37')](_0x2de992[_0x5210('0x38')],{})['then'](respondWithResult(_0x152ad5,0xc9))[_0x5210('0x36')](handleError(_0x152ad5,null));};exports['update']=function(_0xb3ba4c,_0x2c6a26){if(_0xb3ba4c[_0x5210('0x38')]['id']){delete _0xb3ba4c['body']['id'];}return db[_0x5210('0x22')][_0x5210('0x39')]({'where':{'id':_0xb3ba4c['params']['id']}})[_0x5210('0x1a')](handleEntityNotFound(_0x2c6a26,null))[_0x5210('0x1a')](saveUpdates(_0xb3ba4c[_0x5210('0x38')],null))['then'](respondWithResult(_0x2c6a26,null))[_0x5210('0x36')](handleError(_0x2c6a26,null));};exports[_0x5210('0x1b')]=function(_0x26036d,_0xf2a446){return db['OpenchannelInteraction'][_0x5210('0x39')]({'where':{'id':_0x26036d[_0x5210('0x2c')]['id']}})[_0x5210('0x1a')](handleEntityNotFound(_0xf2a446,null))['then'](removeEntity(_0xf2a446,null))[_0x5210('0x36')](handleError(_0xf2a446,null));};exports['describe']=function(_0x288821,_0xe1f71d){return db[_0x5210('0x22')][_0x5210('0x3a')]()[_0x5210('0x1a')](respondWithResult(_0xe1f71d,null))[_0x5210('0x36')](handleError(_0xe1f71d,null));};exports[_0x5210('0x3b')]=function(_0x2fe1f7,_0x2e16ed){return db[_0x5210('0x3c')][_0x5210('0x39')]({'where':{'id':_0x2fe1f7[_0x5210('0x2c')]['id']}})[_0x5210('0x1a')](handleEntityNotFound(_0x2e16ed,null))['then'](function(_0x1ac4f8){if(_0x1ac4f8){return _0x1ac4f8[_0x5210('0x3b')](_0x2fe1f7[_0x5210('0x38')][_0x5210('0x3d')],_[_0x5210('0x3e')](_0x2fe1f7[_0x5210('0x38')],[_0x5210('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x2e16ed,null))[_0x5210('0x36')](handleError(_0x2e16ed,null));};exports[_0x5210('0x3f')]=function(_0x13a028,_0x44b8d0){var _0x247f03={'raw':![],'where':{}};var _0x3d4b5a={};var _0x4a7306={'count':0x0,'rows':[]};return db[_0x5210('0x22')]['findOne']({'where':{'id':_0x13a028[_0x5210('0x2c')]['id']}})[_0x5210('0x1a')](handleEntityNotFound(_0x44b8d0,null))[_0x5210('0x1a')](function(_0x2910cc){if(_0x2910cc){_0x3d4b5a['model']=_['keys'](db[_0x5210('0x3c')]['rawAttributes']);_0x3d4b5a[_0x5210('0x29')]=_[_0x5210('0x2e')](_0x13a028['query']);_0x3d4b5a[_0x5210('0x2f')]=_[_0x5210('0x30')](_0x3d4b5a[_0x5210('0x2d')],_0x3d4b5a[_0x5210('0x29')]);_0x247f03['attributes']=_[_0x5210('0x30')](_0x3d4b5a['model'],qs['fields'](_0x13a028['query'][_0x5210('0x31')]));_0x247f03[_0x5210('0x32')]=_0x247f03[_0x5210('0x32')][_0x5210('0x33')]?_0x247f03[_0x5210('0x32')]:_0x3d4b5a[_0x5210('0x2d')];if(!_0x13a028[_0x5210('0x29')][_0x5210('0x40')](_0x5210('0x41'))){_0x247f03[_0x5210('0x15')]=qs[_0x5210('0x15')](_0x13a028['query']['limit']);_0x247f03[_0x5210('0x12')]=qs[_0x5210('0x12')](_0x13a028['query'][_0x5210('0x12')]);}_0x247f03['order']=qs[_0x5210('0x42')](_0x13a028[_0x5210('0x29')][_0x5210('0x42')]);_0x247f03[_0x5210('0x43')]=qs['filters'](_[_0x5210('0x44')](_0x13a028[_0x5210('0x29')],_0x3d4b5a[_0x5210('0x2f')]));_0x247f03[_0x5210('0x43')][_0x5210('0x45')]=_0x2910cc['id'];if(_0x13a028[_0x5210('0x29')]['filter']){_0x247f03[_0x5210('0x43')]=_[_0x5210('0x35')](_0x247f03[_0x5210('0x43')],{'$or':_[_0x5210('0x21')](_0x247f03['attributes'],function(_0x279c38){var _0x5093e6={};_0x5093e6[_0x279c38]={'$like':'%'+_0x13a028[_0x5210('0x29')][_0x5210('0x46')]+'%'};return _0x5093e6;})});}if(_0x13a028[_0x5210('0x29')][_0x5210('0x47')]){var _0x3d8af4=_0x13a028[_0x5210('0x29')][_0x5210('0x47')]['split'](',');var _0x159655={};_0x159655[_0x3d8af4[0x0]]={'$gte':moment(_0x3d8af4[0x1])['format'](_0x5210('0x48'))};_0x247f03['where']=_['merge'](_0x247f03[_0x5210('0x43')],_0x159655);}_0x247f03=_[_0x5210('0x35')]({},_0x247f03,_0x13a028[_0x5210('0x49')]);return db['OpenchannelMessage']['count']({'where':_0x247f03[_0x5210('0x43')]})[_0x5210('0x1a')](function(_0x391400){_0x4a7306['count']=_0x391400;if(_0x13a028[_0x5210('0x29')]['includeAll']){_0x247f03[_0x5210('0x4a')]=[{'all':!![]}];}return db[_0x5210('0x3c')][_0x5210('0x4b')](_0x247f03);})['then'](function(_0x19cd72){_0x4a7306['rows']=_0x19cd72;return _0x4a7306;});}})[_0x5210('0x1a')](respondWithFilteredResult(_0x44b8d0,_0x247f03))[_0x5210('0x36')](handleError(_0x44b8d0,null));};exports[_0x5210('0x4c')]=function(_0xd7a8a4,_0x5effdc){return db['OpenchannelInteraction']['find']({'where':{'id':_0xd7a8a4['params']['id']}})[_0x5210('0x1a')](handleEntityNotFound(_0x5effdc,null))[_0x5210('0x1a')](function(_0x108c00){if(_0x108c00){return _0x108c00['setTags'](_0xd7a8a4['body'][_0x5210('0x3d')],_[_0x5210('0x3e')](_0xd7a8a4[_0x5210('0x38')],['ids','id'])||{})[_0x5210('0x4d')](function(){return db[_0x5210('0x4e')][_0x5210('0x4b')]({'attributes':['id',_0x5210('0x1e'),_0x5210('0x4f')],'where':{'id':_0xd7a8a4[_0x5210('0x38')]['ids']}});})[_0x5210('0x1a')](function(_0x1834a6){socket[_0x5210('0x50')]('openchannelInteractionTags:save',{'id':Number(_0xd7a8a4[_0x5210('0x2c')]['id']),'tags':_0x1834a6||[]});return{'id':Number(_0xd7a8a4['params']['id']),'tags':_0x1834a6||[]};});}})[_0x5210('0x1a')](respondWithResult(_0x5effdc,null))['catch'](handleError(_0x5effdc,null));};exports['removeTags']=function(_0x5641e0,_0x105204){return db['OpenchannelInteraction']['find']({'where':{'id':_0x5641e0[_0x5210('0x2c')]['id']}})['then'](handleEntityNotFound(_0x105204,null))[_0x5210('0x1a')](function(_0x529ae8){if(_0x529ae8){return _0x529ae8[_0x5210('0x51')](_0x5641e0['query'][_0x5210('0x3d')]);}})[_0x5210('0x1a')](respondWithStatusCode(_0x105204,null))[_0x5210('0x36')](handleError(_0x105204,null));};exports[_0x5210('0x52')]=function(_0x2fa469,_0xaea50){var _0x518fed=moment()['unix']()[_0x5210('0x53')]();var _0x145b67=path[_0x5210('0x54')](config['root'],_0x5210('0x55'),_0x5210('0x56'),'tmp');var _0x5a86a9=path[_0x5210('0x54')](config[_0x5210('0x57')],'server',_0x5210('0x56'),'attachments');var _0x58609c=path['join'](_0x145b67,_0x518fed);var _0x5c9ac9=util[_0x5210('0x58')](_0x5210('0x59'),_0x2fa469[_0x5210('0x2c')]['id'],_0x518fed);var _0x4043ae=path[_0x5210('0x54')](_0x145b67,_0x5c9ac9);var _0x4675f5=[];_0x4675f5['push']({'model':db['User'],'as':_0x5210('0x5a'),'attributes':['id',_0x5210('0x5b')],'raw':!![]});_0x4675f5['push']({'model':db[_0x5210('0x5c')],'as':_0x5210('0x5d'),'attributes':['id',_0x5210('0x5e'),_0x5210('0x5f')],'raw':!![]});if(_0x2fa469[_0x5210('0x29')]['attachments']){_0x4675f5[_0x5210('0x60')]({'model':db[_0x5210('0x61')],'as':_0x5210('0x61'),'raw':!![]});}var _0x917a9f=[{'model':db[_0x5210('0x3c')],'as':_0x5210('0x62'),'attributes':['id',_0x5210('0x38'),_0x5210('0x63'),_0x5210('0x64'),'secret',_0x5210('0x65')],'include':_0x4675f5}];_0x917a9f[_0x5210('0x60')]({'model':db[_0x5210('0x66')],'as':'Account','attributes':['id','name']});_0x917a9f[_0x5210('0x60')]({'model':db['User'],'as':_0x5210('0x67'),'attributes':['id','fullname']});return db[_0x5210('0x22')][_0x5210('0x39')]({'where':{'id':_0x2fa469['params']['id']},'include':_0x917a9f})['then'](handleEntityNotFound(_0xaea50,null))[_0x5210('0x1a')](function(_0x52ac97){if(_0x52ac97){var _0x5600d2=_0x52ac97[_0x5210('0x68')]({'plain':!![]});fs[_0x5210('0x69')](_0x58609c);var _0x4dc09b={'channel':_0x5210('0x6a'),'account':_0x5600d2[_0x5210('0x6b')][_0x5210('0x1e')],'agent':_0x5600d2[_0x5210('0x67')]?_0x5600d2[_0x5210('0x67')][_0x5210('0x5b')]:'N.A.','createdAt':moment(_0x5600d2['createdAt'])['format'](_0x5210('0x48'))[_0x5210('0x53')](),'closedAt':_0x5600d2[_0x5210('0x6c')]?moment(_0x5600d2['closedAt'])[_0x5210('0x58')](_0x5210('0x48'))[_0x5210('0x53')]():'','disposition':_0x5600d2[_0x5210('0x6d')],'visibility':_0x5600d2['threadId']?'Public':_0x5210('0x6e'),'messages':_(_0x5600d2[_0x5210('0x62')])[_0x5210('0x46')]({'secret':![]})[_0x5210('0x21')](function(_0x506cf4){if(_0x506cf4[_0x5210('0x61')]){var _0x3b00bd=path[_0x5210('0x54')](_0x5a86a9,_0x506cf4['Attachment'][_0x5210('0x6f')]);if(fs['existsSync'](_0x3b00bd)){fs[_0x5210('0x70')](_0x3b00bd)[_0x5210('0x71')](fs[_0x5210('0x72')](path[_0x5210('0x54')](_0x58609c,_0x506cf4[_0x5210('0x61')][_0x5210('0x6f')])));}}return{'date':moment(_0x506cf4['createdAt'])[_0x5210('0x58')](_0x5210('0x48'))[_0x5210('0x53')](),'sender':_0x506cf4[_0x5210('0x64')]===_0x5210('0x73')?_0x506cf4[_0x5210('0x5a')]?_0x506cf4['User']['fullname']:_0x5210('0x74'):_0x506cf4[_0x5210('0x5d')][_0x5210('0x5e')]+(_0x506cf4[_0x5210('0x5d')][_0x5210('0x5f')]?'\x20'+_0x506cf4[_0x5210('0x5d')][_0x5210('0x5f')]:''),'body':_0x506cf4['Attachment']?_0x506cf4['Attachment'][_0x5210('0x6f')]:_0x506cf4['body'],'direction':_0x506cf4[_0x5210('0x64')]==='out'?'A':'C','secret':_0x506cf4[_0x5210('0x75')],'read':_0x506cf4[_0x5210('0x65')],'attachment':_0x506cf4[_0x5210('0x61')]};})[_0x5210('0x76')]()};return ejs[_0x5210('0x77')](path[_0x5210('0x54')](config['root'],_0x5210('0x55'),_0x5210('0x78'),_0x5210('0x79')),{'interaction':_0x4dc09b})[_0x5210('0x1a')](function(_0x4534a9){var _0x167e9f=path[_0x5210('0x54')](_0x58609c,_0x5210('0x7a')+_0x5600d2['id']+'-'+_0x518fed+_0x5210('0x7b'));var _0x374c4f={'path':_0x167e9f,'channel':'Openchannel','interactionId':_0x5600d2['id']};return pdf[_0x5210('0x7c')](_0x4534a9,_0x374c4f);})[_0x5210('0x1a')](function(){return new Promise(function(_0x31aebf,_0x5c585d){zipdir(_0x58609c,{'saveTo':_0x4043ae},function(_0x4c9b10,_0x4cb020){if(_0x4c9b10)return _0x5c585d(_0x4c9b10);return _0x31aebf(_0x4cb020);});})[_0x5210('0x1a')](function(){return new Promise(function(_0x32f2e7,_0x27c6da){rimraf(_0x58609c,function(_0x3defb0){if(_0x3defb0)_0x27c6da(_0x3defb0);return _0x32f2e7();});});})['then'](function(){return _0xaea50[_0x5210('0x52')](_0x4043ae,_0x5c9ac9,function(_0xe0d9cb){if(_0xe0d9cb){logger['error'](_0x5210('0x7d'),_0xe0d9cb);}else{fs[_0x5210('0x7e')](_0x4043ae);}});});});}else{return _0xaea50[_0x5210('0xf')](0xc8);}})[_0x5210('0x36')](handleError(_0xaea50,null));}; \ No newline at end of file +var _0x5990=['sort','pick','OpenchannelInteractionId','filter','where','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','rows','addTags','setTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','secret','OpenchannelAccount','Account','Owner','fullname','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','existsSync','pipe','createWriteStream','out','System','basename','read','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','zip-dir','path','ejs','ioredis','../../config/logger','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','update','destroy','then','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','getOptions','findAll','openchannel','query','catch','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty'];(function(_0x399363,_0x1214e0){var _0x24c844=function(_0x2618d6){while(--_0x2618d6){_0x399363['push'](_0x399363['shift']());}};_0x24c844(++_0x1214e0);}(_0x5990,0xbc));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x0599('0x0'));var moment=require('moment');var util=require('util');var path=require(_0x0599('0x1'));var ejs=require(_0x0599('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x0599('0x3'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x0599('0x4'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0599('0x5')]=_[_0x0599('0x6')](config[_0x0599('0x5')],{'host':_0x0599('0x7'),'port':0x18eb});var socket=require(_0x0599('0x8'))(new Redis(config[_0x0599('0x5')]));require(_0x0599('0x9'))[_0x0599('0xa')](socket);function respondWithStatusCode(_0xb5063b,_0x47a463){_0x47a463=_0x47a463||0xcc;return function(_0x520af1){if(_0x520af1){return _0xb5063b[_0x0599('0xb')](_0x47a463);}return _0xb5063b['status'](_0x47a463)[_0x0599('0xc')]();};}function respondWithResult(_0x226f2d,_0x4451bf){_0x4451bf=_0x4451bf||0xc8;return function(_0x5788e4){if(_0x5788e4){return _0x226f2d['status'](_0x4451bf)['json'](_0x5788e4);}};}function respondWithFilteredResult(_0x54c0c3,_0x1fa24c){return function(_0x5a7b4f){if(_0x5a7b4f){var _0x13c4e7=typeof _0x1fa24c[_0x0599('0xd')]===_0x0599('0xe')&&typeof _0x1fa24c[_0x0599('0xf')]===_0x0599('0xe');var _0x46df04=_0x5a7b4f[_0x0599('0x10')];var _0xd9acc2=_0x13c4e7?0x0:_0x1fa24c['offset'];var _0x41fd69=_0x13c4e7?_0x5a7b4f[_0x0599('0x10')]:_0x1fa24c['offset']+_0x1fa24c[_0x0599('0xf')];var _0x513e59;if(_0x41fd69>=_0x46df04){_0x41fd69=_0x46df04;_0x513e59=0xc8;}else{_0x513e59=0xce;}_0x54c0c3[_0x0599('0x11')](_0x513e59);return _0x54c0c3[_0x0599('0x12')](_0x0599('0x13'),_0xd9acc2+'-'+_0x41fd69+'/'+_0x46df04)[_0x0599('0x14')](_0x5a7b4f);}return null;};}function saveUpdates(_0x511bc2){return function(_0xabe67b){if(_0xabe67b){return _0xabe67b[_0x0599('0x15')](_0x511bc2)['then'](function(_0x1bd2f8){return _0x1bd2f8;});}return null;};}function removeEntity(_0x58cca0){return function(_0x5f3d57){if(_0x5f3d57){return _0x5f3d57[_0x0599('0x16')]()[_0x0599('0x17')](function(){_0x58cca0['status'](0xcc)[_0x0599('0xc')]();});}};}function handleEntityNotFound(_0x451efd){return function(_0x21a515){if(!_0x21a515){_0x451efd[_0x0599('0xb')](0x194);}return _0x21a515;};}function handleError(_0x2e0f71,_0x29ed83){_0x29ed83=_0x29ed83||0x1f4;return function(_0x28c7ed){logger['error'](_0x28c7ed[_0x0599('0x18')]);if(_0x28c7ed[_0x0599('0x19')]){delete _0x28c7ed[_0x0599('0x19')];}_0x2e0f71[_0x0599('0x11')](_0x29ed83)[_0x0599('0x1a')](_0x28c7ed);};}exports[_0x0599('0x1b')]=function(_0x52d81d,_0x58fd1f){var _0x482652={};var _0x43f345=_[_0x0599('0x1c')](db[_0x0599('0x1d')][_0x0599('0x1e')],function(_0x4bdc57){return{'name':_0x4bdc57[_0x0599('0x1f')],'type':_0x4bdc57[_0x0599('0x20')]['key']};});_0x482652=qs[_0x0599('0x21')](_0x43f345,_0x52d81d);return interaction[_0x0599('0x22')](_0x0599('0x23'),_0x52d81d[_0x0599('0x24')],_0x52d81d['user'],_0x482652,_0x43f345)[_0x0599('0x17')](respondWithFilteredResult(_0x58fd1f,_0x482652))[_0x0599('0x25')](handleError(_0x58fd1f,null));};exports['show']=function(_0x2b6863,_0x52a17c){var _0x25bd0c={};if(_0x2b6863['query']['type']&&_0x2b6863[_0x0599('0x24')][_0x0599('0x20')]===_0x0599('0x26')){_0x25bd0c['from']=_0x2b6863[_0x0599('0x27')]['id'];}else{_0x25bd0c['id']=_0x2b6863[_0x0599('0x27')]['id'];}var _0x1b53eb={'raw':![],'where':_0x25bd0c},_0x4cff55={};_0x4cff55[_0x0599('0x28')]=_[_0x0599('0x29')](db[_0x0599('0x1d')]['rawAttributes']);_0x4cff55[_0x0599('0x24')]=_[_0x0599('0x29')](_0x2b6863[_0x0599('0x24')]);_0x4cff55[_0x0599('0x2a')]=_[_0x0599('0x2b')](_0x4cff55[_0x0599('0x28')],_0x4cff55[_0x0599('0x24')]);_0x1b53eb[_0x0599('0x2c')]=_[_0x0599('0x2b')](_0x4cff55[_0x0599('0x28')],qs[_0x0599('0x2d')](_0x2b6863[_0x0599('0x24')][_0x0599('0x2d')]));_0x1b53eb[_0x0599('0x2c')]=_0x1b53eb[_0x0599('0x2c')][_0x0599('0x2e')]?_0x1b53eb['attributes']:_0x4cff55[_0x0599('0x28')];if(_0x2b6863['query'][_0x0599('0x2f')]){_0x1b53eb[_0x0599('0x30')]=[{'all':!![]}];}_0x1b53eb=_['merge']({},_0x1b53eb,_0x2b6863[_0x0599('0x31')]);return db[_0x0599('0x1d')][_0x0599('0x32')](_0x1b53eb)['then'](handleEntityNotFound(_0x52a17c,null))[_0x0599('0x17')](respondWithResult(_0x52a17c,null))[_0x0599('0x25')](handleError(_0x52a17c,null));};exports[_0x0599('0x33')]=function(_0x317968,_0x354802){return db[_0x0599('0x1d')][_0x0599('0x33')](_0x317968['body'],{})[_0x0599('0x17')](respondWithResult(_0x354802,0xc9))[_0x0599('0x25')](handleError(_0x354802,null));};exports[_0x0599('0x15')]=function(_0x5816b8,_0x2309cc){if(_0x5816b8[_0x0599('0x34')]['id']){delete _0x5816b8[_0x0599('0x34')]['id'];}return db['OpenchannelInteraction'][_0x0599('0x32')]({'where':{'id':_0x5816b8[_0x0599('0x27')]['id']}})[_0x0599('0x17')](handleEntityNotFound(_0x2309cc,null))[_0x0599('0x17')](saveUpdates(_0x5816b8[_0x0599('0x34')],null))[_0x0599('0x17')](respondWithResult(_0x2309cc,null))[_0x0599('0x25')](handleError(_0x2309cc,null));};exports[_0x0599('0x16')]=function(_0x48b4cc,_0x1123a7){return db[_0x0599('0x1d')][_0x0599('0x32')]({'where':{'id':_0x48b4cc['params']['id']}})[_0x0599('0x17')](handleEntityNotFound(_0x1123a7,null))[_0x0599('0x17')](removeEntity(_0x1123a7,null))['catch'](handleError(_0x1123a7,null));};exports['describe']=function(_0x26beeb,_0x271674){return db[_0x0599('0x1d')][_0x0599('0x35')]()[_0x0599('0x17')](respondWithResult(_0x271674,null))[_0x0599('0x25')](handleError(_0x271674,null));};exports[_0x0599('0x36')]=function(_0xcd3e18,_0x1a199f){return db['OpenchannelMessage'][_0x0599('0x32')]({'where':{'id':_0xcd3e18[_0x0599('0x27')]['id']}})[_0x0599('0x17')](handleEntityNotFound(_0x1a199f,null))[_0x0599('0x17')](function(_0x3f5804){if(_0x3f5804){return _0x3f5804[_0x0599('0x36')](_0xcd3e18[_0x0599('0x34')][_0x0599('0x37')],_[_0x0599('0x38')](_0xcd3e18[_0x0599('0x34')],[_0x0599('0x37'),'id'])||{});}})['then'](respondWithResult(_0x1a199f,null))[_0x0599('0x25')](handleError(_0x1a199f,null));};exports[_0x0599('0x39')]=function(_0x728c8d,_0x25b4c1){var _0x2d3a23={'raw':![],'where':{}};var _0x361c5d={};var _0x559c0d={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x0599('0x3a')]({'where':{'id':_0x728c8d[_0x0599('0x27')]['id']}})[_0x0599('0x17')](handleEntityNotFound(_0x25b4c1,null))[_0x0599('0x17')](function(_0x3f670f){if(_0x3f670f){_0x361c5d[_0x0599('0x28')]=_['keys'](db['OpenchannelMessage'][_0x0599('0x1e')]);_0x361c5d['query']=_[_0x0599('0x29')](_0x728c8d[_0x0599('0x24')]);_0x361c5d[_0x0599('0x2a')]=_[_0x0599('0x2b')](_0x361c5d[_0x0599('0x28')],_0x361c5d[_0x0599('0x24')]);_0x2d3a23['attributes']=_[_0x0599('0x2b')](_0x361c5d[_0x0599('0x28')],qs[_0x0599('0x2d')](_0x728c8d[_0x0599('0x24')]['fields']));_0x2d3a23['attributes']=_0x2d3a23['attributes'][_0x0599('0x2e')]?_0x2d3a23['attributes']:_0x361c5d[_0x0599('0x28')];if(!_0x728c8d[_0x0599('0x24')][_0x0599('0x3b')]('nolimit')){_0x2d3a23['limit']=qs['limit'](_0x728c8d[_0x0599('0x24')][_0x0599('0xf')]);_0x2d3a23[_0x0599('0xd')]=qs[_0x0599('0xd')](_0x728c8d['query']['offset']);}_0x2d3a23['order']=qs[_0x0599('0x3c')](_0x728c8d[_0x0599('0x24')][_0x0599('0x3c')]);_0x2d3a23['where']=qs[_0x0599('0x2a')](_[_0x0599('0x3d')](_0x728c8d[_0x0599('0x24')],_0x361c5d[_0x0599('0x2a')]));_0x2d3a23['where'][_0x0599('0x3e')]=_0x3f670f['id'];if(_0x728c8d[_0x0599('0x24')][_0x0599('0x3f')]){_0x2d3a23[_0x0599('0x40')]=_[_0x0599('0x41')](_0x2d3a23['where'],{'$or':_[_0x0599('0x1c')](_0x2d3a23['attributes'],function(_0x1d96ce){var _0x13ddad={};_0x13ddad[_0x1d96ce]={'$like':'%'+_0x728c8d[_0x0599('0x24')][_0x0599('0x3f')]+'%'};return _0x13ddad;})});}if(_0x728c8d['query'][_0x0599('0x42')]){var _0x21fd8f=_0x728c8d[_0x0599('0x24')][_0x0599('0x42')]['split'](',');var _0x511435={};_0x511435[_0x21fd8f[0x0]]={'$gte':moment(_0x21fd8f[0x1])[_0x0599('0x43')](_0x0599('0x44'))};_0x2d3a23[_0x0599('0x40')]=_[_0x0599('0x41')](_0x2d3a23[_0x0599('0x40')],_0x511435);}_0x2d3a23=_[_0x0599('0x41')]({},_0x2d3a23,_0x728c8d[_0x0599('0x31')]);return db[_0x0599('0x45')]['count']({'where':_0x2d3a23['where']})[_0x0599('0x17')](function(_0xc788ee){_0x559c0d[_0x0599('0x10')]=_0xc788ee;if(_0x728c8d['query'][_0x0599('0x2f')]){_0x2d3a23['include']=[{'all':!![]}];}return db[_0x0599('0x45')][_0x0599('0x22')](_0x2d3a23);})['then'](function(_0x58fd1d){_0x559c0d[_0x0599('0x46')]=_0x58fd1d;return _0x559c0d;});}})['then'](respondWithFilteredResult(_0x25b4c1,_0x2d3a23))[_0x0599('0x25')](handleError(_0x25b4c1,null));};exports[_0x0599('0x47')]=function(_0x99b255,_0x341b0c){return db['OpenchannelInteraction'][_0x0599('0x32')]({'where':{'id':_0x99b255[_0x0599('0x27')]['id']}})[_0x0599('0x17')](handleEntityNotFound(_0x341b0c,null))[_0x0599('0x17')](function(_0x1755d8){if(_0x1755d8){return _0x1755d8[_0x0599('0x48')](_0x99b255[_0x0599('0x34')]['ids'],_[_0x0599('0x38')](_0x99b255[_0x0599('0x34')],[_0x0599('0x37'),'id'])||{})['spread'](function(){return db[_0x0599('0x49')]['findAll']({'attributes':['id',_0x0599('0x19'),_0x0599('0x4a')],'where':{'id':_0x99b255[_0x0599('0x34')][_0x0599('0x37')]}});})[_0x0599('0x17')](function(_0x1b47eb){socket[_0x0599('0x4b')](_0x0599('0x4c'),{'id':Number(_0x99b255[_0x0599('0x27')]['id']),'tags':_0x1b47eb||[]});return{'id':Number(_0x99b255[_0x0599('0x27')]['id']),'tags':_0x1b47eb||[]};});}})[_0x0599('0x17')](respondWithResult(_0x341b0c,null))['catch'](handleError(_0x341b0c,null));};exports['removeTags']=function(_0x1f1d86,_0x237714){return db[_0x0599('0x1d')][_0x0599('0x32')]({'where':{'id':_0x1f1d86[_0x0599('0x27')]['id']}})['then'](handleEntityNotFound(_0x237714,null))[_0x0599('0x17')](function(_0xdeda6d){if(_0xdeda6d){return _0xdeda6d[_0x0599('0x4d')](_0x1f1d86[_0x0599('0x24')][_0x0599('0x37')]);}})['then'](respondWithStatusCode(_0x237714,null))[_0x0599('0x25')](handleError(_0x237714,null));};exports[_0x0599('0x4e')]=function(_0xb4b72a,_0x813309){var _0x29f89d=moment()[_0x0599('0x4f')]()[_0x0599('0x50')]();var _0x121950=path[_0x0599('0x51')](config[_0x0599('0x52')],_0x0599('0x53'),_0x0599('0x54'),_0x0599('0x55'));var _0x58e0e9=path[_0x0599('0x51')](config['root'],'server',_0x0599('0x54'),_0x0599('0x56'));var _0x13a5ca=path['join'](_0x121950,_0x29f89d);var _0x487c83=util[_0x0599('0x43')](_0x0599('0x57'),_0xb4b72a[_0x0599('0x27')]['id'],_0x29f89d);var _0x5f4a93=path[_0x0599('0x51')](_0x121950,_0x487c83);var _0x50ca7f=[];_0x50ca7f[_0x0599('0x58')]({'model':db[_0x0599('0x59')],'as':_0x0599('0x59'),'attributes':['id','fullname'],'raw':!![]});_0x50ca7f[_0x0599('0x58')]({'model':db[_0x0599('0x5a')],'as':_0x0599('0x5b'),'attributes':['id',_0x0599('0x5c'),_0x0599('0x5d')],'raw':!![]});if(_0xb4b72a[_0x0599('0x24')]['attachments']){_0x50ca7f[_0x0599('0x58')]({'model':db['Attachment'],'as':_0x0599('0x5e'),'raw':!![]});}var _0x5f23a5=[{'model':db[_0x0599('0x45')],'as':'Messages','attributes':['id',_0x0599('0x34'),_0x0599('0x5f'),_0x0599('0x60'),_0x0599('0x61'),'read'],'include':_0x50ca7f}];_0x5f23a5['push']({'model':db[_0x0599('0x62')],'as':_0x0599('0x63'),'attributes':['id',_0x0599('0x19')]});_0x5f23a5[_0x0599('0x58')]({'model':db[_0x0599('0x59')],'as':_0x0599('0x64'),'attributes':['id',_0x0599('0x65')]});return db['OpenchannelInteraction'][_0x0599('0x32')]({'where':{'id':_0xb4b72a[_0x0599('0x27')]['id']},'include':_0x5f23a5})[_0x0599('0x17')](handleEntityNotFound(_0x813309,null))[_0x0599('0x17')](function(_0x5d52fc){if(_0x5d52fc){var _0x1a4880=_0x5d52fc['get']({'plain':!![]});fs[_0x0599('0x66')](_0x13a5ca);var _0x390a0f={'channel':_0x0599('0x67'),'account':_0x1a4880[_0x0599('0x63')][_0x0599('0x19')],'agent':_0x1a4880[_0x0599('0x64')]?_0x1a4880[_0x0599('0x64')][_0x0599('0x65')]:_0x0599('0x68'),'createdAt':moment(_0x1a4880[_0x0599('0x5f')])[_0x0599('0x43')](_0x0599('0x44'))[_0x0599('0x50')](),'closedAt':_0x1a4880['closed']?moment(_0x1a4880[_0x0599('0x69')])[_0x0599('0x43')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0599('0x50')]():'','disposition':_0x1a4880[_0x0599('0x6a')],'visibility':_0x1a4880[_0x0599('0x6b')]?_0x0599('0x6c'):_0x0599('0x6d'),'messages':_(_0x1a4880['Messages'])['filter']({'secret':![]})[_0x0599('0x1c')](function(_0x5315c7){if(_0x5315c7['Attachment']){var _0x178a8a=path[_0x0599('0x51')](_0x58e0e9,_0x5315c7[_0x0599('0x5e')]['basename']);if(fs[_0x0599('0x6e')](_0x178a8a)){fs['createReadStream'](_0x178a8a)[_0x0599('0x6f')](fs[_0x0599('0x70')](path[_0x0599('0x51')](_0x13a5ca,_0x5315c7[_0x0599('0x5e')]['basename'])));}}return{'date':moment(_0x5315c7[_0x0599('0x5f')])[_0x0599('0x43')](_0x0599('0x44'))[_0x0599('0x50')](),'sender':_0x5315c7[_0x0599('0x60')]===_0x0599('0x71')?_0x5315c7[_0x0599('0x59')]?_0x5315c7['User'][_0x0599('0x65')]:_0x0599('0x72'):_0x5315c7[_0x0599('0x5b')]['firstName']+(_0x5315c7[_0x0599('0x5b')]['lastName']?'\x20'+_0x5315c7[_0x0599('0x5b')][_0x0599('0x5d')]:''),'body':_0x5315c7[_0x0599('0x5e')]?_0x5315c7[_0x0599('0x5e')][_0x0599('0x73')]:_0x5315c7['body'],'direction':_0x5315c7['direction']===_0x0599('0x71')?'A':'C','secret':_0x5315c7[_0x0599('0x61')],'read':_0x5315c7[_0x0599('0x74')],'attachment':_0x5315c7[_0x0599('0x5e')]};})['value']()};return ejs[_0x0599('0x75')](path[_0x0599('0x51')](config[_0x0599('0x52')],_0x0599('0x53'),_0x0599('0x76'),_0x0599('0x77')),{'interaction':_0x390a0f})['then'](function(_0x15d02a){var _0xa56c80=path['join'](_0x13a5ca,_0x0599('0x78')+_0x1a4880['id']+'-'+_0x29f89d+'.pdf');var _0x4b3c68={'path':_0xa56c80,'channel':'Openchannel','interactionId':_0x1a4880['id']};return pdf[_0x0599('0x79')](_0x15d02a,_0x4b3c68);})[_0x0599('0x17')](function(){return new Promise(function(_0x34f1e8,_0x1ab885){zipdir(_0x13a5ca,{'saveTo':_0x5f4a93},function(_0x1b2508,_0x19af0f){if(_0x1b2508)return _0x1ab885(_0x1b2508);return _0x34f1e8(_0x19af0f);});})[_0x0599('0x17')](function(){return new Promise(function(_0x3d38c6,_0x1e7d53){rimraf(_0x13a5ca,function(_0x1dc1f3){if(_0x1dc1f3)_0x1e7d53(_0x1dc1f3);return _0x3d38c6();});});})[_0x0599('0x17')](function(){return _0x813309[_0x0599('0x4e')](_0x5f4a93,_0x487c83,function(_0x5a66cd){if(_0x5a66cd){logger[_0x0599('0x7a')](_0x0599('0x7b'),_0x5a66cd);}else{fs['unlinkSync'](_0x5f4a93);}});});});}else{return _0x813309[_0x0599('0xb')](0xc8);}})['catch'](handleError(_0x813309,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 66a8216..74d4cc2 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.events.js +++ b/server/api/openchannelInteraction/openchannelInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0f8=['setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','then'];(function(_0x330911,_0x70724f){var _0x1b3168=function(_0x432e82){while(--_0x432e82){_0x330911['push'](_0x330911['shift']());}};_0x1b3168(++_0x70724f);}(_0xd0f8,0xb8));var _0x8d0f=function(_0x47e426,_0x591a09){_0x47e426=_0x47e426-0x0;var _0x4e558d=_0xd0f8[_0x47e426];return _0x4e558d;};'use strict';var EventEmitter=require(_0x8d0f('0x0'));var OpenchannelInteraction=require(_0x8d0f('0x1'))['db'][_0x8d0f('0x2')];var OpenchannelMessage=require(_0x8d0f('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x8d0f('0x3')](0x0);var events={'afterCreate':_0x8d0f('0x4'),'afterUpdate':_0x8d0f('0x5'),'afterDestroy':_0x8d0f('0x6')};function emitEvent(_0x168d41){return function(_0x1df2c2,_0x314c23,_0x14c99f){_0x1df2c2['getUsers']({'attributes':['id'],'raw':!![]})[_0x8d0f('0x7')](function(_0x473857){_0x1df2c2[_0x8d0f('0x8')]('Users',_0x473857['map'](function(_0x1467b0){return{'id':_0x1467b0['id']};}));return OpenchannelMessage[_0x8d0f('0x9')]({'where':{'OpenchannelInteractionId':_0x1df2c2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8d0f('0x7')](function(_0x57cb5d){_0x1df2c2['setDataValue'](_0x8d0f('0xa'),_0x57cb5d[_0x8d0f('0xb')]);OpenchannelInteractionEvents[_0x8d0f('0xc')](_0x168d41+':'+_0x1df2c2['id'],_0x1df2c2);OpenchannelInteractionEvents[_0x8d0f('0xc')](_0x168d41,_0x1df2c2);_0x14c99f(null);})[_0x8d0f('0xd')](_0x14c99f(null));};}for(var e in events){if(events[_0x8d0f('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x8d0f('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x2243=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x2faca7,_0x1e11eb){var _0x5db575=function(_0x2caa30){while(--_0x2caa30){_0x2faca7['push'](_0x2faca7['shift']());}};_0x5db575(++_0x1e11eb);}(_0x2243,0x76));var _0x3224=function(_0x2db5f3,_0x5c0630){_0x2db5f3=_0x2db5f3-0x0;var _0x3e6188=_0x2243[_0x2db5f3];return _0x3e6188;};'use strict';var EventEmitter=require(_0x3224('0x0'));var OpenchannelInteraction=require(_0x3224('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x3224('0x1'))['db'][_0x3224('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3224('0x3')](0x0);var events={'afterCreate':_0x3224('0x4'),'afterUpdate':_0x3224('0x5'),'afterDestroy':_0x3224('0x6')};function emitEvent(_0x1eb4dc){return function(_0x59a0b0,_0x36f3ba,_0x161bf7){_0x59a0b0[_0x3224('0x7')]({'attributes':['id'],'raw':!![]})[_0x3224('0x8')](function(_0x4f5bc5){_0x59a0b0[_0x3224('0x9')](_0x3224('0xa'),_0x4f5bc5[_0x3224('0xb')](function(_0x52c68e){return{'id':_0x52c68e['id']};}));return OpenchannelMessage[_0x3224('0xc')]({'where':{'OpenchannelInteractionId':_0x59a0b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3224('0x8')](function(_0x533b01){_0x59a0b0[_0x3224('0x9')](_0x3224('0xd'),_0x533b01[_0x3224('0xe')]);OpenchannelInteractionEvents[_0x3224('0xf')](_0x1eb4dc+':'+_0x59a0b0['id'],_0x59a0b0);OpenchannelInteractionEvents[_0x3224('0xf')](_0x1eb4dc,_0x59a0b0);_0x161bf7(null);})['catch'](_0x161bf7(null));};}for(var e in events){if(events[_0x3224('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x3224('0x11')](e,emitEvent(event));}}module[_0x3224('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 1525fa4..5f52743 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.model.js +++ b/server/api/openchannelInteraction/openchannelInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0605=['moment','request-promise','rimraf','../../config/environment','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x36b863,_0x528d3f){var _0x2ef697=function(_0x5e647a){while(--_0x5e647a){_0x36b863['push'](_0x36b863['shift']());}};_0x2ef697(++_0x528d3f);}(_0x0605,0x1d1));var _0x5060=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x0605[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x5060('0x0'));var util=require(_0x5060('0x1'));var logger=require('../../config/logger')(_0x5060('0x2'));var moment=require(_0x5060('0x3'));var BPromise=require('bluebird');var rp=require(_0x5060('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5060('0x5'));var config=require(_0x5060('0x6'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x3a24f8,_0x4daae6){return _0x3a24f8[_0x5060('0x7')](_0x5060('0x8'),attributes,{'tableName':_0x5060('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5060('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x2cefc2,_0x1ec787,_0x44b752){if(_0x2cefc2['changed']('closed')){_0x2cefc2['closedAt']=moment()[_0x5060('0xb')](_0x5060('0xc'));}_0x44b752(null,_0x2cefc2);}}});}; \ No newline at end of file +var _0xd5a2=['rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x440b53,_0x41f9f7){var _0x5dfbd0=function(_0x366e27){while(--_0x366e27){_0x440b53['push'](_0x440b53['shift']());}};_0x5dfbd0(++_0x41f9f7);}(_0xd5a2,0x93));var _0x2d5a=function(_0x2efd1b,_0x5c384d){_0x2efd1b=_0x2efd1b-0x0;var _0x4444fc=_0xd5a2[_0x2efd1b];return _0x4444fc;};'use strict';var _=require(_0x2d5a('0x0'));var util=require(_0x2d5a('0x1'));var logger=require(_0x2d5a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2d5a('0x3'));var rp=require(_0x2d5a('0x4'));var fs=require('fs');var path=require(_0x2d5a('0x5'));var rimraf=require(_0x2d5a('0x6'));var config=require(_0x2d5a('0x7'));var attributes=require(_0x2d5a('0x8'));module['exports']=function(_0x484ab6,_0x444ec8){return _0x484ab6['define'](_0x2d5a('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d5a('0xa'),'collate':_0x2d5a('0xb'),'hooks':{'beforeUpdate':function(_0x58bfa8,_0x4bbf9e,_0x5bc144){if(_0x58bfa8[_0x2d5a('0xc')](_0x2d5a('0xd'))){_0x58bfa8[_0x2d5a('0xe')]=moment()[_0x2d5a('0xf')](_0x2d5a('0x10'));}_0x5bc144(null,_0x58bfa8);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 1818994..241ab42 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js +++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa87=['client','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','catch','OpenchannelInteraction','find','ids','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x355d4c,_0x4eb2e4){var _0x19df67=function(_0x3052b5){while(--_0x3052b5){_0x355d4c['push'](_0x355d4c['shift']());}};_0x19df67(++_0x4eb2e4);}(_0xfa87,0x1f4));var _0x7fa8=function(_0x47d18a,_0xd53074){_0x47d18a=_0x47d18a-0x0;var _0x130c43=_0xfa87[_0x47d18a];return _0x130c43;};'use strict';var _=require('lodash');var util=require(_0x7fa8('0x0'));var moment=require(_0x7fa8('0x1'));var BPromise=require(_0x7fa8('0x2'));var rs=require(_0x7fa8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fa8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7fa8('0x5'));var jayson=require(_0x7fa8('0x6'));var client=jayson[_0x7fa8('0x7')]['http']({'port':0x232a});config['redis']=_[_0x7fa8('0x8')](config[_0x7fa8('0x9')],{'host':_0x7fa8('0xa'),'port':0x18eb});var socket=require(_0x7fa8('0xb'))(new Redis(config[_0x7fa8('0x9')]));require(_0x7fa8('0xc'))[_0x7fa8('0xd')](socket);function respondWithRpcPromise(_0x290a09,_0x393025,_0x226875){return new BPromise(function(_0x388165,_0x4984c0){return client[_0x7fa8('0xe')](_0x290a09,_0x226875)['then'](function(_0x2cbc3a){logger[_0x7fa8('0xf')](_0x7fa8('0x10'),_0x393025,_0x7fa8('0x11'));logger[_0x7fa8('0x12')](_0x7fa8('0x13'),_0x393025,_0x7fa8('0x11'),JSON[_0x7fa8('0x14')](_0x2cbc3a));if(_0x2cbc3a['error']){if(_0x2cbc3a[_0x7fa8('0x15')][_0x7fa8('0x16')]===0x1f4){logger['error'](_0x7fa8('0x10'),_0x393025,_0x2cbc3a['error'][_0x7fa8('0x17')]);return _0x4984c0(_0x2cbc3a[_0x7fa8('0x15')]['message']);}logger[_0x7fa8('0x15')](_0x7fa8('0x10'),_0x393025,_0x2cbc3a[_0x7fa8('0x15')][_0x7fa8('0x17')]);return _0x388165(_0x2cbc3a[_0x7fa8('0x15')][_0x7fa8('0x17')]);}else{logger[_0x7fa8('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x393025,_0x7fa8('0x11'));_0x388165(_0x2cbc3a['result']['message']);}})['catch'](function(_0x1944f3){logger[_0x7fa8('0x15')](_0x7fa8('0x10'),_0x393025,_0x1944f3);_0x4984c0(_0x1944f3);});});}exports[_0x7fa8('0x18')]=function(_0x4a5267){var _0x14dc2e=this;return new Promise(function(_0x54dc15,_0x6213be){return db['OpenchannelInteraction'][_0x7fa8('0x19')](_0x4a5267[_0x7fa8('0x1a')],{'raw':_0x4a5267[_0x7fa8('0x1b')]?_0x4a5267[_0x7fa8('0x1b')][_0x7fa8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a5267['options']?_0x4a5267[_0x7fa8('0x1b')][_0x7fa8('0x1d')]||null:null,'attributes':_0x4a5267[_0x7fa8('0x1b')]?_0x4a5267[_0x7fa8('0x1b')][_0x7fa8('0x1e')]||null:null,'limit':_0x4a5267[_0x7fa8('0x1b')]?_0x4a5267['options'][_0x7fa8('0x1f')]||null:null})[_0x7fa8('0x20')](function(_0x274310){logger[_0x7fa8('0xf')](_0x7fa8('0x18'),_0x4a5267);logger[_0x7fa8('0x12')](_0x7fa8('0x18'),_0x4a5267,JSON[_0x7fa8('0x14')](_0x274310));_0x54dc15(_0x274310);})[_0x7fa8('0x21')](function(_0x460fcc){logger[_0x7fa8('0x15')](_0x7fa8('0x18'),_0x460fcc[_0x7fa8('0x17')],_0x4a5267);_0x6213be(_0x14dc2e[_0x7fa8('0x15')](0x1f4,_0x460fcc['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x44fffa){return new Promise(function(_0x23591f,_0xa59628){return db[_0x7fa8('0x22')][_0x7fa8('0x23')]({'where':_0x44fffa['options']?_0x44fffa[_0x7fa8('0x1b')][_0x7fa8('0x1d')]||null:null})[_0x7fa8('0x20')](function(_0x9ab3cf){if(_0x9ab3cf){return _0x9ab3cf['addTags'](_0x44fffa[_0x7fa8('0x1a')]['ids'],_['omit'](_0x44fffa[_0x7fa8('0x1a')],[_0x7fa8('0x24'),'id'])||{});}})[_0x7fa8('0x25')](function(_0x581720){logger[_0x7fa8('0xf')]('AddTags',_0x44fffa);logger[_0x7fa8('0x12')](_0x7fa8('0x26'),_0x44fffa,JSON[_0x7fa8('0x14')](_0x581720));_0x23591f(_0x581720);})[_0x7fa8('0x21')](function(_0x2b2281){logger['error'](_0x7fa8('0x26'),_0x2b2281[_0x7fa8('0x17')],_0x44fffa);_0xa59628(_this[_0x7fa8('0x15')](0x1f4,_0x2b2281[_0x7fa8('0x17')]));});});}; \ No newline at end of file +var _0xbd5c=['limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where'];(function(_0x56e063,_0x453233){var _0x766fcf=function(_0x59415a){while(--_0x59415a){_0x56e063['push'](_0x56e063['shift']());}};_0x766fcf(++_0x453233);}(_0xbd5c,0x83));var _0xcbd5=function(_0x463cf9,_0x546da0){_0x463cf9=_0x463cf9-0x0;var _0x1f4bea=_0xbd5c[_0x463cf9];return _0x1f4bea;};'use strict';var _=require('lodash');var util=require(_0xcbd5('0x0'));var moment=require(_0xcbd5('0x1'));var BPromise=require(_0xcbd5('0x2'));var rs=require(_0xcbd5('0x3'));var fs=require('fs');var Redis=require(_0xcbd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbd5('0x5'));var logger=require('../../config/logger')(_0xcbd5('0x6'));var config=require(_0xcbd5('0x7'));var jayson=require(_0xcbd5('0x8'));var client=jayson['client'][_0xcbd5('0x9')]({'port':0x232a});config[_0xcbd5('0xa')]=_[_0xcbd5('0xb')](config[_0xcbd5('0xa')],{'host':_0xcbd5('0xc'),'port':0x18eb});var socket=require(_0xcbd5('0xd'))(new Redis(config[_0xcbd5('0xa')]));require(_0xcbd5('0xe'))['register'](socket);function respondWithRpcPromise(_0x4f9bc6,_0x155505,_0x174a40){return new BPromise(function(_0x35ec04,_0x5320fd){return client[_0xcbd5('0xf')](_0x4f9bc6,_0x174a40)[_0xcbd5('0x10')](function(_0x45622c){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x155505,_0xcbd5('0x11'));logger[_0xcbd5('0x12')](_0xcbd5('0x13'),_0x155505,_0xcbd5('0x11'),JSON[_0xcbd5('0x14')](_0x45622c));if(_0x45622c[_0xcbd5('0x15')]){if(_0x45622c['error']['code']===0x1f4){logger[_0xcbd5('0x15')](_0xcbd5('0x16'),_0x155505,_0x45622c['error'][_0xcbd5('0x17')]);return _0x5320fd(_0x45622c[_0xcbd5('0x15')][_0xcbd5('0x17')]);}logger[_0xcbd5('0x15')](_0xcbd5('0x16'),_0x155505,_0x45622c[_0xcbd5('0x15')]['message']);return _0x35ec04(_0x45622c[_0xcbd5('0x15')][_0xcbd5('0x17')]);}else{logger[_0xcbd5('0x18')](_0xcbd5('0x16'),_0x155505,_0xcbd5('0x11'));_0x35ec04(_0x45622c[_0xcbd5('0x19')][_0xcbd5('0x17')]);}})[_0xcbd5('0x1a')](function(_0x2d3b97){logger[_0xcbd5('0x15')](_0xcbd5('0x16'),_0x155505,_0x2d3b97);_0x5320fd(_0x2d3b97);});});}exports[_0xcbd5('0x1b')]=function(_0x4797a9){var _0x3958ec=this;return new Promise(function(_0x38b3db,_0x4d421f){return db['OpenchannelInteraction'][_0xcbd5('0x1c')](_0x4797a9[_0xcbd5('0x1d')],{'raw':_0x4797a9[_0xcbd5('0x1e')]?_0x4797a9['options'][_0xcbd5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4797a9[_0xcbd5('0x1e')]?_0x4797a9[_0xcbd5('0x1e')][_0xcbd5('0x20')]||null:null,'attributes':_0x4797a9[_0xcbd5('0x1e')]?_0x4797a9['options']['attributes']||null:null,'limit':_0x4797a9[_0xcbd5('0x1e')]?_0x4797a9[_0xcbd5('0x1e')][_0xcbd5('0x21')]||null:null})[_0xcbd5('0x10')](function(_0x201834){logger[_0xcbd5('0x18')](_0xcbd5('0x1b'),_0x4797a9);logger['debug'](_0xcbd5('0x1b'),_0x4797a9,JSON['stringify'](_0x201834));_0x38b3db(_0x201834);})[_0xcbd5('0x1a')](function(_0x2169d4){logger[_0xcbd5('0x15')]('UpdateOpenchannelInteraction',_0x2169d4[_0xcbd5('0x17')],_0x4797a9);_0x4d421f(_0x3958ec['error'](0x1f4,_0x2169d4[_0xcbd5('0x17')]));});});};exports[_0xcbd5('0x22')]=function(_0x313081){return new Promise(function(_0x5a2520,_0x56d217){return db[_0xcbd5('0x23')][_0xcbd5('0x24')]({'where':_0x313081['options']?_0x313081[_0xcbd5('0x1e')][_0xcbd5('0x20')]||null:null})[_0xcbd5('0x10')](function(_0x20f6e0){if(_0x20f6e0){return _0x20f6e0[_0xcbd5('0x25')](_0x313081[_0xcbd5('0x1d')][_0xcbd5('0x26')],_[_0xcbd5('0x27')](_0x313081[_0xcbd5('0x1d')],[_0xcbd5('0x26'),'id'])||{});}})['spread'](function(_0x193ef8){logger[_0xcbd5('0x18')]('AddTags',_0x313081);logger[_0xcbd5('0x12')](_0xcbd5('0x28'),_0x313081,JSON[_0xcbd5('0x14')](_0x193ef8));_0x5a2520(_0x193ef8);})[_0xcbd5('0x1a')](function(_0x533c94){logger[_0xcbd5('0x15')](_0xcbd5('0x28'),_0x533c94[_0xcbd5('0x17')],_0x313081);_0x56d217(_this['error'](0x1f4,_0x533c94[_0xcbd5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 20aa756..5fc5fd4 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.socket.js +++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32a7=['./openchannelInteraction.events','save','remove','update'];(function(_0x156c0c,_0x28fd47){var _0xe2f274=function(_0x1ffa40){while(--_0x1ffa40){_0x156c0c['push'](_0x156c0c['shift']());}};_0xe2f274(++_0x28fd47);}(_0x32a7,0x178));var _0x732a=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x32a7[_0xb0f7c3];return _0x28ea68;};'use strict';var OpenchannelInteractionEvents=require(_0x732a('0x0'));var events=[_0x732a('0x1'),_0x732a('0x2'),_0x732a('0x3')];function createListener(_0x42f62b,_0x45a12a){return function(_0x238d59){_0x45a12a['emit'](_0x42f62b,_0x238d59);};}function removeListener(_0x2d381a,_0x26f52d){return function(){OpenchannelInteractionEvents['removeListener'](_0x2d381a,_0x26f52d);};}exports['register']=function(_0x4c8458){for(var _0x2bc51d=0x0,_0x269e47=events['length'];_0x2bc51d<_0x269e47;_0x2bc51d++){var _0x570a6b=events[_0x2bc51d];var _0x11cb15=createListener('openchannelInteraction:'+_0x570a6b,_0x4c8458);OpenchannelInteractionEvents['on'](_0x570a6b,_0x11cb15);}}; \ No newline at end of file +var _0x8710=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x164e77,_0x37681c){var _0x325b37=function(_0x2b5c19){while(--_0x2b5c19){_0x164e77['push'](_0x164e77['shift']());}};_0x325b37(++_0x37681c);}(_0x8710,0xdc));var _0x0871=function(_0x4b6eca,_0x1af801){_0x4b6eca=_0x4b6eca-0x0;var _0x63734d=_0x8710[_0x4b6eca];return _0x63734d;};'use strict';var OpenchannelInteractionEvents=require(_0x0871('0x0'));var events=[_0x0871('0x1'),_0x0871('0x2'),_0x0871('0x3')];function createListener(_0x56cbd1,_0x14e929){return function(_0x1362be){_0x14e929[_0x0871('0x4')](_0x56cbd1,_0x1362be);};}function removeListener(_0x5ab60a,_0x1ff70d){return function(){OpenchannelInteractionEvents[_0x0871('0x5')](_0x5ab60a,_0x1ff70d);};}exports[_0x0871('0x6')]=function(_0x4949b4){for(var _0x4b2933=0x0,_0xdcd12a=events[_0x0871('0x7')];_0x4b2933<_0xdcd12a;_0x4b2933++){var _0x2e1fe5=events[_0x4b2933];var _0x415419=createListener(_0x0871('0x8')+_0x2e1fe5,_0x4949b4);OpenchannelInteractionEvents['on'](_0x2e1fe5,_0x415419);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index accc58f..6b49ee7 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x90989e,_0x55954e){_0x90989e=_0x90989e-0x0;var _0x15c99b=_0x70e0[_0x90989e];return _0x15c99b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x49f626,_0x3667dd){var _0x109c63=function(_0x27e67e){while(--_0x27e67e){_0x49f626['push'](_0x49f626['shift']());}};_0x109c63(++_0x3667dd);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index b290fd5..88a6eec 100644 --- a/server/api/openchannelMessage/openchannelMessage.attributes.js +++ b/server/api/openchannelMessage/openchannelMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05b6=['ENUM','out','DATE','STRING','sequelize','TEXT','medium','BOOLEAN'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x05b6,0x74));var _0x605b=function(_0x4d1cc6,_0x26bebe){_0x4d1cc6=_0x4d1cc6-0x0;var _0x1a6fee=_0x05b6[_0x4d1cc6];return _0x1a6fee;};'use strict';var Sequelize=require(_0x605b('0x0'));module['exports']={'body':{'type':Sequelize[_0x605b('0x1')](_0x605b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x605b('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x605b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x605b('0x4')]('in',_0x605b('0x5')),'defaultValue':_0x605b('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x605b('0x6')]},'providerName':{'type':Sequelize[_0x605b('0x7')]},'providerResponse':{'type':Sequelize[_0x605b('0x1')]}}; \ No newline at end of file +var _0xd523=['medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x2c881a,_0x20425c){var _0x247014=function(_0x1823a1){while(--_0x1823a1){_0x2c881a['push'](_0x2c881a['shift']());}};_0x247014(++_0x20425c);}(_0xd523,0x153));var _0x3d52=function(_0x583657,_0x3f2b91){_0x583657=_0x583657-0x0;var _0x193b72=_0xd523[_0x583657];return _0x193b72;};'use strict';var Sequelize=require(_0x3d52('0x0'));module[_0x3d52('0x1')]={'body':{'type':Sequelize[_0x3d52('0x2')](_0x3d52('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3d52('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3d52('0x5')]('in',_0x3d52('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3d52('0x7')]},'providerName':{'type':Sequelize[_0x3d52('0x8')]},'providerResponse':{'type':Sequelize[_0x3d52('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index e09c97e..a435a4c 100644 --- a/server/api/openchannelMessage/openchannelMessage.controller.js +++ b/server/api/openchannelMessage/openchannelMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x035c=['pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','params','keys','find','create','body','describe','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','SIP/%s','motionChannel','event','accept','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','internal','channel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','set','json','apply','save','update','then','destroy','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5ea4e2,_0x4d83a7){var _0x4babb4=function(_0x2dcfcc){while(--_0x2dcfcc){_0x5ea4e2['push'](_0x5ea4e2['shift']());}};_0x4babb4(++_0x4d83a7);}(_0x035c,0x13d));var _0xc035=function(_0x163143,_0x2ff7a5){_0x163143=_0x163143-0x0;var _0x2ed02e=_0x035c[_0x163143];return _0x2ed02e;};'use strict';var emlformat=require(_0xc035('0x0'));var rimraf=require(_0xc035('0x1'));var zipdir=require(_0xc035('0x2'));var jsonpatch=require(_0xc035('0x3'));var rp=require(_0xc035('0x4'));var moment=require(_0xc035('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc035('0x6'));var util=require(_0xc035('0x7'));var path=require(_0xc035('0x8'));var sox=require(_0xc035('0x9'));var csv=require(_0xc035('0xa'));var ejs=require(_0xc035('0xb'));var fs=require('fs');var fs_extra=require(_0xc035('0xc'));var _=require(_0xc035('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc035('0xe'));var toCsv=require(_0xc035('0xa'));var querystring=require('querystring');var Papa=require(_0xc035('0xf'));var Redis=require(_0xc035('0x10'));var authService=require(_0xc035('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc035('0x12'))(_0xc035('0x13'));var utils=require('../../config/utils');var config=require(_0xc035('0x14'));var licenseUtil=require(_0xc035('0x15'));var db=require(_0xc035('0x16'))['db'];config[_0xc035('0x17')]=_[_0xc035('0x18')](config['redis'],{'host':_0xc035('0x19'),'port':0x18eb});var socket=require(_0xc035('0x1a'))(new Redis(config[_0xc035('0x17')]));require(_0xc035('0x1b'))[_0xc035('0x1c')](socket);var jayson=require(_0xc035('0x1d'));var client=jayson[_0xc035('0x1e')][_0xc035('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13d6ea,_0x2ff173,_0x4aa721,_0x900bbb){return new BPromise(function(_0x5a8f41,_0x1c9e6e){var _0x34fe08=_0x900bbb||client;return _0x34fe08['request'](_0x13d6ea,_0x4aa721)['then'](function(_0x4da2e2){logger[_0xc035('0x20')](_0xc035('0x21'),_0x2ff173,_0xc035('0x22'));logger[_0xc035('0x23')](_0xc035('0x24'),_0x2ff173,_0xc035('0x22'),JSON[_0xc035('0x25')](_0x4da2e2));if(_0x4da2e2[_0xc035('0x26')]){if(_0x4da2e2[_0xc035('0x26')][_0xc035('0x27')]===0x1f4){logger[_0xc035('0x26')](_0xc035('0x21'),_0x2ff173,_0x4da2e2['error'][_0xc035('0x28')]);return _0x1c9e6e(_0x4da2e2[_0xc035('0x26')]['message']);}logger[_0xc035('0x26')](_0xc035('0x21'),_0x2ff173,_0x4da2e2[_0xc035('0x26')]['message']);return _0x5a8f41(_0x4da2e2[_0xc035('0x26')][_0xc035('0x28')]);}else{logger[_0xc035('0x20')](_0xc035('0x21'),_0x2ff173,_0xc035('0x22'));_0x5a8f41(_0x4da2e2[_0xc035('0x29')][_0xc035('0x28')]);}})[_0xc035('0x2a')](function(_0x36fc01){logger['error'](_0xc035('0x21'),_0x2ff173,_0x36fc01);_0x1c9e6e(_0x36fc01);});});}function respondWithStatusCode(_0xfdd5ce,_0xac3273){_0xac3273=_0xac3273||0xcc;return function(_0x1ce296){if(_0x1ce296){return _0xfdd5ce[_0xc035('0x2b')](_0xac3273);}return _0xfdd5ce[_0xc035('0x2c')](_0xac3273)[_0xc035('0x2d')]();};}function respondWithResult(_0x42be54,_0x39fc3a){_0x39fc3a=_0x39fc3a||0xc8;return function(_0x1b63c2){if(_0x1b63c2){return _0x42be54['status'](_0x39fc3a)['json'](_0x1b63c2);}};}function respondWithFilteredResult(_0x5d2fb1,_0x109a1a){return function(_0x1a5e6a){if(_0x1a5e6a){var _0x297597=typeof _0x109a1a[_0xc035('0x2e')]===_0xc035('0x2f')&&typeof _0x109a1a[_0xc035('0x30')]==='undefined';var _0xc2fc8f=_0x1a5e6a['count'];var _0x44efda=_0x297597?0x0:_0x109a1a[_0xc035('0x2e')];var _0x2c2fa6=_0x297597?_0x1a5e6a['count']:_0x109a1a[_0xc035('0x2e')]+_0x109a1a['limit'];var _0x5bdea9;if(_0x2c2fa6>=_0xc2fc8f){_0x2c2fa6=_0xc2fc8f;_0x5bdea9=0xc8;}else{_0x5bdea9=0xce;}_0x5d2fb1[_0xc035('0x2c')](_0x5bdea9);return _0x5d2fb1[_0xc035('0x31')]('Content-Range',_0x44efda+'-'+_0x2c2fa6+'/'+_0xc2fc8f)[_0xc035('0x32')](_0x1a5e6a);}return null;};}function patchUpdates(_0x403ba8){return function(_0x15d8fa){try{jsonpatch[_0xc035('0x33')](_0x15d8fa,_0x403ba8,!![]);}catch(_0x50c1ab){return BPromise['reject'](_0x50c1ab);}return _0x15d8fa[_0xc035('0x34')]();};}function saveUpdates(_0x163ead,_0x220c28){return function(_0x182cdb){if(_0x182cdb){return _0x182cdb[_0xc035('0x35')](_0x163ead)[_0xc035('0x36')](function(_0x502e0a){return _0x502e0a;});}return null;};}function removeEntity(_0x10b06e,_0x562807){return function(_0x2525a0){if(_0x2525a0){return _0x2525a0[_0xc035('0x37')]()[_0xc035('0x36')](function(){_0x10b06e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d286,_0x3489fe){return function(_0x4c00f8){if(!_0x4c00f8){_0x5d286['sendStatus'](0x194);}return _0x4c00f8;};}function handleError(_0x3af967,_0x5c9772){_0x5c9772=_0x5c9772||0x1f4;return function(_0x52a34f){logger[_0xc035('0x26')](_0x52a34f[_0xc035('0x38')]);if(_0x52a34f[_0xc035('0x39')]){delete _0x52a34f['name'];}_0x3af967[_0xc035('0x2c')](_0x5c9772)['send'](_0x52a34f);};}exports[_0xc035('0x3a')]=function(_0x1257b5,_0x2ef7ff){var _0x53ea66={},_0x922a70={},_0x175fce={'count':0x0,'rows':[]};var _0x23cd0e=_[_0xc035('0x3b')](db[_0xc035('0x3c')][_0xc035('0x3d')],function(_0x29b95c){return{'name':_0x29b95c[_0xc035('0x3e')],'type':_0x29b95c[_0xc035('0x3f')][_0xc035('0x40')]};});_0x922a70[_0xc035('0x41')]=_[_0xc035('0x3b')](_0x23cd0e,'name');_0x922a70[_0xc035('0x42')]=_['keys'](_0x1257b5[_0xc035('0x42')]);_0x922a70[_0xc035('0x43')]=_[_0xc035('0x44')](_0x922a70[_0xc035('0x41')],_0x922a70[_0xc035('0x42')]);_0x53ea66[_0xc035('0x45')]=_[_0xc035('0x44')](_0x922a70[_0xc035('0x41')],qs[_0xc035('0x46')](_0x1257b5[_0xc035('0x42')][_0xc035('0x46')]));_0x53ea66[_0xc035('0x45')]=_0x53ea66[_0xc035('0x45')][_0xc035('0x47')]?_0x53ea66[_0xc035('0x45')]:_0x922a70[_0xc035('0x41')];if(!_0x1257b5['query'][_0xc035('0x48')](_0xc035('0x49'))){_0x53ea66['limit']=qs['limit'](_0x1257b5[_0xc035('0x42')]['limit']);_0x53ea66[_0xc035('0x2e')]=qs[_0xc035('0x2e')](_0x1257b5[_0xc035('0x42')][_0xc035('0x2e')]);}_0x53ea66[_0xc035('0x4a')]=qs[_0xc035('0x4b')](_0x1257b5[_0xc035('0x42')][_0xc035('0x4b')]);_0x53ea66['where']=qs[_0xc035('0x43')](_[_0xc035('0x4c')](_0x1257b5['query'],_0x922a70[_0xc035('0x43')]),_0x23cd0e);if(_0x1257b5[_0xc035('0x42')][_0xc035('0x4d')]){_0x53ea66[_0xc035('0x4e')]=_[_0xc035('0x4f')](_0x53ea66[_0xc035('0x4e')],{'$or':_[_0xc035('0x3b')](_0x23cd0e,function(_0x8a3e81){if(_0x8a3e81['type']!==_0xc035('0x50')){var _0x3e3f41={};_0x3e3f41[_0x8a3e81[_0xc035('0x39')]]={'$like':'%'+_0x1257b5['query'][_0xc035('0x4d')]+'%'};return _0x3e3f41;}})});}_0x53ea66=_[_0xc035('0x4f')]({},_0x53ea66,_0x1257b5[_0xc035('0x51')]);var _0x71e5ac={'where':_0x53ea66[_0xc035('0x4e')]};return db['OpenchannelMessage'][_0xc035('0x52')](_0x71e5ac)[_0xc035('0x36')](function(_0x451fc4){_0x175fce[_0xc035('0x52')]=_0x451fc4;if(_0x1257b5[_0xc035('0x42')][_0xc035('0x53')]){_0x53ea66[_0xc035('0x54')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xc035('0x55')](_0x53ea66);})[_0xc035('0x36')](function(_0xa00aa8){_0x175fce['rows']=_0xa00aa8;return _0x175fce;})[_0xc035('0x36')](respondWithFilteredResult(_0x2ef7ff,_0x53ea66))[_0xc035('0x2a')](handleError(_0x2ef7ff,null));};exports['show']=function(_0x2f9582,_0x49d6f7){var _0x2ef07f={'raw':!![],'where':{'id':_0x2f9582[_0xc035('0x56')]['id']}},_0x114d78={};_0x114d78[_0xc035('0x41')]=_[_0xc035('0x57')](db[_0xc035('0x3c')]['rawAttributes']);_0x114d78[_0xc035('0x42')]=_['keys'](_0x2f9582['query']);_0x114d78['filters']=_['intersection'](_0x114d78[_0xc035('0x41')],_0x114d78[_0xc035('0x42')]);_0x2ef07f[_0xc035('0x45')]=_[_0xc035('0x44')](_0x114d78['model'],qs[_0xc035('0x46')](_0x2f9582[_0xc035('0x42')][_0xc035('0x46')]));_0x2ef07f[_0xc035('0x45')]=_0x2ef07f[_0xc035('0x45')][_0xc035('0x47')]?_0x2ef07f[_0xc035('0x45')]:_0x114d78['model'];if(_0x2f9582[_0xc035('0x42')][_0xc035('0x53')]){_0x2ef07f[_0xc035('0x54')]=[{'all':!![]}];}_0x2ef07f=_[_0xc035('0x4f')]({},_0x2ef07f,_0x2f9582[_0xc035('0x51')]);return db[_0xc035('0x3c')][_0xc035('0x58')](_0x2ef07f)[_0xc035('0x36')](handleEntityNotFound(_0x49d6f7,null))[_0xc035('0x36')](respondWithResult(_0x49d6f7,null))[_0xc035('0x2a')](handleError(_0x49d6f7,null));};exports['create']=function(_0x458814,_0x171b3c){return db['OpenchannelMessage'][_0xc035('0x59')](_0x458814[_0xc035('0x5a')],{})[_0xc035('0x36')](respondWithResult(_0x171b3c,0xc9))[_0xc035('0x2a')](handleError(_0x171b3c,null));};exports[_0xc035('0x35')]=function(_0x377830,_0x1b37dc){if(_0x377830[_0xc035('0x5a')]['id']){delete _0x377830[_0xc035('0x5a')]['id'];}return db['OpenchannelMessage'][_0xc035('0x58')]({'where':{'id':_0x377830[_0xc035('0x56')]['id']}})[_0xc035('0x36')](handleEntityNotFound(_0x1b37dc,null))[_0xc035('0x36')](saveUpdates(_0x377830[_0xc035('0x5a')],null))[_0xc035('0x36')](respondWithResult(_0x1b37dc,null))['catch'](handleError(_0x1b37dc,null));};exports['destroy']=function(_0x191b69,_0x5cb4e6){return db[_0xc035('0x3c')]['find']({'where':{'id':_0x191b69[_0xc035('0x56')]['id']}})[_0xc035('0x36')](handleEntityNotFound(_0x5cb4e6,null))[_0xc035('0x36')](removeEntity(_0x5cb4e6,null))[_0xc035('0x2a')](handleError(_0x5cb4e6,null));};exports[_0xc035('0x5b')]=function(_0x2c40a6,_0x20f3c6){return db[_0xc035('0x3c')][_0xc035('0x5b')]()['then'](respondWithResult(_0x20f3c6,null))[_0xc035('0x2a')](handleError(_0x20f3c6,null));};var interaction_log=require(_0xc035('0x12'))('openchannel-interactions');exports['accept']=function(_0x226ca3,_0x269249,_0x273291){var _0x20e68d={'agent':{},'channel':_0xc035('0x5c')};if(_0x226ca3['body']['id']){delete _0x226ca3['body']['id'];}_0x226ca3[_0xc035('0x5a')][_0xc035('0x5d')]=!![];_0x226ca3[_0xc035('0x5a')]['readAt']=moment()[_0xc035('0x5e')](_0xc035('0x5f'));_0x226ca3[_0xc035('0x5a')][_0xc035('0x60')]=_0x226ca3[_0xc035('0x5a')][_0xc035('0x60')]||_0x226ca3[_0xc035('0x61')]['id'];_0x20e68d[_0xc035('0x62')]['id']=_0x226ca3[_0xc035('0x5a')][_0xc035('0x60')];return db[_0xc035('0x3c')][_0xc035('0x58')]({'where':{'id':_0x226ca3[_0xc035('0x56')]['id'],'UserId':null}})[_0xc035('0x36')](handleEntityNotFound(_0x269249,null))[_0xc035('0x36')](saveUpdates(_0x226ca3[_0xc035('0x5a')],null))['then'](function(_0x2a901e){if(_0x2a901e){_0x20e68d[_0xc035('0x28')]=_0x2a901e[_0xc035('0x63')]({'plain':!![]});return db[_0xc035('0x64')][_0xc035('0x58')]({'where':{'id':_0x2a901e[_0xc035('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x269249,null))['then'](function(_0x3332da){if(_0x3332da){return _0x3332da['update']({'UserId':_0x226ca3['body'][_0xc035('0x60')],'read1stAt':_[_0xc035('0x66')](_0x3332da['read1stAt'])?moment()[_0xc035('0x5e')](_0xc035('0x5f')):undefined});}return null;})[_0xc035('0x36')](function(_0x3df835){if(_0x3df835){_0x20e68d[_0xc035('0x67')]=_0x3df835[_0xc035('0x63')]({'plain':!![]});interaction_log[_0xc035('0x20')](_0xc035('0x68'),_0x226ca3['user']['id'],_0x226ca3['user'][_0xc035('0x39')],_0x226ca3[_0xc035('0x61')]['role'],_0x20e68d['interaction']['id'],_0x226ca3[_0xc035('0x5a')]?JSON[_0xc035('0x25')](_0x226ca3['body']):_0xc035('0x69'));return respondWithRpcPromise(_0xc035('0x6a'),'acceptMessage',_0x20e68d);}return null;})['then'](function(_0x20327b){var _0x409163='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20327b[_0xc035('0x28')][_0xc035('0x6b')];return db[_0xc035('0x6c')]['query'](_0x409163,{'type':db[_0xc035('0x6d')][_0xc035('0x6e')][_0xc035('0x6f')],'raw':!![]})[_0xc035('0x36')](function(_0x435c03){return _0x435c03;});})[_0xc035('0x36')](function(_0x1778e9){if(_0x1778e9){_0x20e68d[_0xc035('0x28')]['contact']=_0x1778e9[0x0];if(!_0x226ca3[_0xc035('0x5a')][_0xc035('0x60')])return;return db[_0xc035('0x70')][_0xc035('0x58')]({'where':{'id':_0x226ca3[_0xc035('0x5a')][_0xc035('0x60')],'role':_0xc035('0x62')},'attributes':['id',_0xc035('0x39'),_0xc035('0x71'),_0xc035('0x72'),'internal'],'raw':!![]});}return null;})[_0xc035('0x36')](function(_0x1bdd8c){if(!_0x1bdd8c)return null;_0x20e68d[_0xc035('0x28')][_0xc035('0x62')]=_0x1bdd8c;return _0x20e68d;})['then'](function(_0x19e3a7){if(_0x19e3a7){if(_0x226ca3[_0xc035('0x5a')][_0xc035('0x73')]){_0x20e68d[_0xc035('0x28')][_0xc035('0x74')]=util[_0xc035('0x5e')](_0xc035('0x75'),_0x226ca3[_0xc035('0x61')][_0xc035('0x39')]);_0x20e68d[_0xc035('0x28')]['channel']=_0x20e68d['channel'];_0x20e68d[_0xc035('0x28')][_0xc035('0x76')]=_0x20e68d['channel'];_0x20e68d[_0xc035('0x28')][_0xc035('0x77')]=_0xc035('0x78');return respondWithRpcPromise(_0xc035('0x79'),'EventManager',{'event':_0xc035('0x7a'),'message':_0x20e68d[_0xc035('0x28')]},client9002)[_0xc035('0x36')](function(){return _0x20e68d;});}return _0x20e68d;}return null;})[_0xc035('0x36')](respondWithResult(_0x269249,null))[_0xc035('0x2a')](handleError(_0x269249,null));};var interaction_log=require(_0xc035('0x12'))('openchannel-interactions');exports[_0xc035('0x7b')]=function(_0x1d655a,_0x567094,_0x25e6d6){var _0x173359={'agent':{},'channel':_0xc035('0x5c')};if(_0x1d655a['body']['id']){delete _0x1d655a[_0xc035('0x5a')]['id'];}_0x1d655a[_0xc035('0x5a')][_0xc035('0x60')]=_0x1d655a[_0xc035('0x5a')][_0xc035('0x60')]||_0x1d655a['user']['id'];_0x173359[_0xc035('0x62')]['id']=_0x1d655a['body'][_0xc035('0x60')];return db[_0xc035('0x3c')][_0xc035('0x58')]({'where':{'id':_0x1d655a['params']['id'],'UserId':null}})[_0xc035('0x36')](handleEntityNotFound(_0x567094,null))[_0xc035('0x36')](function(_0x5481bb){if(_0x5481bb){_0x173359[_0xc035('0x28')]=_0x5481bb['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xc035('0x58')]({'where':{'id':_0x5481bb['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x567094,null))[_0xc035('0x36')](function(_0x3ac254){if(_0x3ac254){_0x173359['interaction']=_0x3ac254[_0xc035('0x63')]({'plain':!![]});interaction_log['info'](_0xc035('0x7c'),_0x1d655a[_0xc035('0x61')]['id'],_0x1d655a[_0xc035('0x61')][_0xc035('0x39')],_0x1d655a[_0xc035('0x61')]['role'],_0x173359['interaction']['id'],_0x1d655a['body']?JSON[_0xc035('0x25')](_0x1d655a[_0xc035('0x5a')]):_0xc035('0x69'));return respondWithRpcPromise(_0xc035('0x7d'),_0xc035('0x7e'),_0x173359);}return null;})['then'](function(_0x25240a){var _0x234f52='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x25240a[_0xc035('0x28')][_0xc035('0x6b')];return db[_0xc035('0x6c')][_0xc035('0x42')](_0x234f52,{'type':db[_0xc035('0x6d')][_0xc035('0x6e')][_0xc035('0x6f')],'raw':!![]})[_0xc035('0x36')](function(_0x14f3db){return _0x14f3db;});})[_0xc035('0x36')](function(_0x4578e8){if(_0x4578e8){_0x173359['message'][_0xc035('0x7f')]=_0x4578e8[0x0];if(!_0x1d655a[_0xc035('0x5a')][_0xc035('0x60')])return;return db[_0xc035('0x70')]['find']({'where':{'id':_0x1d655a[_0xc035('0x5a')][_0xc035('0x60')],'role':_0xc035('0x62')},'attributes':['id',_0xc035('0x39'),'fullname',_0xc035('0x72'),_0xc035('0x80')],'raw':!![]});}return null;})[_0xc035('0x36')](function(_0x24a278){if(!_0x24a278)return null;_0x173359[_0xc035('0x28')][_0xc035('0x62')]=_0x24a278;return _0x173359;})[_0xc035('0x36')](function(_0x525277){if(_0x525277){_0x525277[_0xc035('0x28')]['interface']=util['format'](_0xc035('0x75'),_0x1d655a[_0xc035('0x61')]['name']);_0x525277[_0xc035('0x28')][_0xc035('0x81')]=_0x173359[_0xc035('0x81')];_0x525277['message']['motionChannel']=_0x173359['channel'];_0x525277[_0xc035('0x28')][_0xc035('0x77')]=_0xc035('0x7b');respondWithRpcPromise(_0xc035('0x79'),_0xc035('0x79'),{'event':_0xc035('0x82'),'message':_0x525277['message']},client9002);return _0x173359;}return null;})[_0xc035('0x36')](respondWithResult(_0x567094,null))['catch'](handleError(_0x567094,null));}; \ No newline at end of file +var _0x75a2=['email','internal','manual','interface','channel','motionChannel','event','acceptmessage','get','RejectMessage','rejectMessage','User','EventManager','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','name','index','map','OpenchannelMessage','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','update','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x75a2,0x187));var _0x275a=function(_0x33fa39,_0x158d45){_0x33fa39=_0x33fa39-0x0;var _0x5c10f3=_0x75a2[_0x33fa39];return _0x5c10f3;};'use strict';var emlformat=require(_0x275a('0x0'));var rimraf=require(_0x275a('0x1'));var zipdir=require(_0x275a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x275a('0x3'));var moment=require(_0x275a('0x4'));var BPromise=require(_0x275a('0x5'));var Mustache=require(_0x275a('0x6'));var util=require('util');var path=require(_0x275a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x275a('0x8'));var squel=require(_0x275a('0x9'));var crypto=require(_0x275a('0xa'));var jsforce=require(_0x275a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x275a('0xc'));var Papa=require(_0x275a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x275a('0xe'));var hardwareService=require(_0x275a('0xf'));var logger=require(_0x275a('0x10'))(_0x275a('0x11'));var utils=require(_0x275a('0x12'));var config=require(_0x275a('0x13'));var licenseUtil=require(_0x275a('0x14'));var db=require(_0x275a('0x15'))['db'];config[_0x275a('0x16')]=_[_0x275a('0x17')](config[_0x275a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x275a('0x18'))(new Redis(config[_0x275a('0x16')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x275a('0x19'));var client=jayson[_0x275a('0x1a')][_0x275a('0x1b')]({'port':0x232c});var client9002=jayson[_0x275a('0x1a')][_0x275a('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x125348,_0x283865,_0x2a49c6,_0x222bac){return new BPromise(function(_0x58e54d,_0x538275){var _0x21cf70=_0x222bac||client;return _0x21cf70[_0x275a('0x1c')](_0x125348,_0x2a49c6)['then'](function(_0x127da5){logger['info'](_0x275a('0x1d'),_0x283865,_0x275a('0x1e'));logger['debug'](_0x275a('0x1f'),_0x283865,_0x275a('0x1e'),JSON['stringify'](_0x127da5));if(_0x127da5['error']){if(_0x127da5[_0x275a('0x20')][_0x275a('0x21')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x283865,_0x127da5['error'][_0x275a('0x22')]);return _0x538275(_0x127da5[_0x275a('0x20')][_0x275a('0x22')]);}logger[_0x275a('0x20')](_0x275a('0x1d'),_0x283865,_0x127da5['error'][_0x275a('0x22')]);return _0x58e54d(_0x127da5[_0x275a('0x20')][_0x275a('0x22')]);}else{logger[_0x275a('0x23')](_0x275a('0x1d'),_0x283865,'request\x20sent');_0x58e54d(_0x127da5[_0x275a('0x24')][_0x275a('0x22')]);}})[_0x275a('0x25')](function(_0x1441c3){logger[_0x275a('0x20')](_0x275a('0x1d'),_0x283865,_0x1441c3);_0x538275(_0x1441c3);});});}function respondWithStatusCode(_0x417397,_0x366002){_0x366002=_0x366002||0xcc;return function(_0x204f05){if(_0x204f05){return _0x417397[_0x275a('0x26')](_0x366002);}return _0x417397['status'](_0x366002)[_0x275a('0x27')]();};}function respondWithResult(_0x1e424f,_0x57c10b){_0x57c10b=_0x57c10b||0xc8;return function(_0x257f7e){if(_0x257f7e){return _0x1e424f[_0x275a('0x28')](_0x57c10b)[_0x275a('0x29')](_0x257f7e);}};}function respondWithFilteredResult(_0xa5048b,_0x5be632){return function(_0x265b1f){if(_0x265b1f){var _0x440157=typeof _0x5be632[_0x275a('0x2a')]===_0x275a('0x2b')&&typeof _0x5be632[_0x275a('0x2c')]===_0x275a('0x2b');var _0x3d0fa0=_0x265b1f[_0x275a('0x2d')];var _0xe22b72=_0x440157?0x0:_0x5be632[_0x275a('0x2a')];var _0x50d998=_0x440157?_0x265b1f[_0x275a('0x2d')]:_0x5be632[_0x275a('0x2a')]+_0x5be632['limit'];var _0xad876e;if(_0x50d998>=_0x3d0fa0){_0x50d998=_0x3d0fa0;_0xad876e=0xc8;}else{_0xad876e=0xce;}_0xa5048b[_0x275a('0x28')](_0xad876e);return _0xa5048b[_0x275a('0x2e')](_0x275a('0x2f'),_0xe22b72+'-'+_0x50d998+'/'+_0x3d0fa0)['json'](_0x265b1f);}return null;};}function patchUpdates(_0x281437){return function(_0xae2096){try{jsonpatch[_0x275a('0x30')](_0xae2096,_0x281437,!![]);}catch(_0x9e9180){return BPromise[_0x275a('0x31')](_0x9e9180);}return _0xae2096['save']();};}function saveUpdates(_0xb2e67f,_0x334403){return function(_0x33a166){if(_0x33a166){return _0x33a166['update'](_0xb2e67f)[_0x275a('0x32')](function(_0x4c33a7){return _0x4c33a7;});}return null;};}function removeEntity(_0x382fd3,_0x5a5401){return function(_0x4ea389){if(_0x4ea389){return _0x4ea389[_0x275a('0x33')]()[_0x275a('0x32')](function(){_0x382fd3[_0x275a('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f98d4,_0x117ae6){return function(_0x2514d2){if(!_0x2514d2){_0x2f98d4[_0x275a('0x26')](0x194);}return _0x2514d2;};}function handleError(_0x25586c,_0x2c5f19){_0x2c5f19=_0x2c5f19||0x1f4;return function(_0x232e32){logger[_0x275a('0x20')](_0x232e32['stack']);if(_0x232e32[_0x275a('0x34')]){delete _0x232e32[_0x275a('0x34')];}_0x25586c[_0x275a('0x28')](_0x2c5f19)['send'](_0x232e32);};}exports[_0x275a('0x35')]=function(_0x136d4f,_0x1d068a){var _0x536949={},_0x2de81e={},_0x29a2be={'count':0x0,'rows':[]};var _0x593b3d=_[_0x275a('0x36')](db[_0x275a('0x37')]['rawAttributes'],function(_0x24d26b){return{'name':_0x24d26b['fieldName'],'type':_0x24d26b[_0x275a('0x38')][_0x275a('0x39')]};});_0x2de81e['model']=_['map'](_0x593b3d,_0x275a('0x34'));_0x2de81e[_0x275a('0x3a')]=_[_0x275a('0x3b')](_0x136d4f['query']);_0x2de81e[_0x275a('0x3c')]=_['intersection'](_0x2de81e[_0x275a('0x3d')],_0x2de81e[_0x275a('0x3a')]);_0x536949[_0x275a('0x3e')]=_[_0x275a('0x3f')](_0x2de81e[_0x275a('0x3d')],qs[_0x275a('0x40')](_0x136d4f[_0x275a('0x3a')][_0x275a('0x40')]));_0x536949[_0x275a('0x3e')]=_0x536949[_0x275a('0x3e')][_0x275a('0x41')]?_0x536949['attributes']:_0x2de81e[_0x275a('0x3d')];if(!_0x136d4f[_0x275a('0x3a')][_0x275a('0x42')]('nolimit')){_0x536949[_0x275a('0x2c')]=qs['limit'](_0x136d4f[_0x275a('0x3a')]['limit']);_0x536949[_0x275a('0x2a')]=qs[_0x275a('0x2a')](_0x136d4f[_0x275a('0x3a')][_0x275a('0x2a')]);}_0x536949[_0x275a('0x43')]=qs[_0x275a('0x44')](_0x136d4f[_0x275a('0x3a')][_0x275a('0x44')]);_0x536949[_0x275a('0x45')]=qs['filters'](_[_0x275a('0x46')](_0x136d4f[_0x275a('0x3a')],_0x2de81e[_0x275a('0x3c')]),_0x593b3d);if(_0x136d4f[_0x275a('0x3a')][_0x275a('0x47')]){_0x536949[_0x275a('0x45')]=_[_0x275a('0x48')](_0x536949[_0x275a('0x45')],{'$or':_[_0x275a('0x36')](_0x593b3d,function(_0x1e901e){if(_0x1e901e['type']!==_0x275a('0x49')){var _0xb58795={};_0xb58795[_0x1e901e[_0x275a('0x34')]]={'$like':'%'+_0x136d4f[_0x275a('0x3a')]['filter']+'%'};return _0xb58795;}})});}_0x536949=_['merge']({},_0x536949,_0x136d4f[_0x275a('0x4a')]);var _0x409abd={'where':_0x536949[_0x275a('0x45')]};return db[_0x275a('0x37')][_0x275a('0x2d')](_0x409abd)[_0x275a('0x32')](function(_0x443727){_0x29a2be[_0x275a('0x2d')]=_0x443727;if(_0x136d4f[_0x275a('0x3a')]['includeAll']){_0x536949[_0x275a('0x4b')]=[{'all':!![]}];}return db[_0x275a('0x37')][_0x275a('0x4c')](_0x536949);})['then'](function(_0xc7de2f){_0x29a2be[_0x275a('0x4d')]=_0xc7de2f;return _0x29a2be;})[_0x275a('0x32')](respondWithFilteredResult(_0x1d068a,_0x536949))[_0x275a('0x25')](handleError(_0x1d068a,null));};exports[_0x275a('0x4e')]=function(_0x94bcc3,_0x291c3f){var _0x9f43d1={'raw':!![],'where':{'id':_0x94bcc3[_0x275a('0x4f')]['id']}},_0x19a537={};_0x19a537[_0x275a('0x3d')]=_['keys'](db[_0x275a('0x37')][_0x275a('0x50')]);_0x19a537[_0x275a('0x3a')]=_[_0x275a('0x3b')](_0x94bcc3['query']);_0x19a537[_0x275a('0x3c')]=_[_0x275a('0x3f')](_0x19a537[_0x275a('0x3d')],_0x19a537[_0x275a('0x3a')]);_0x9f43d1['attributes']=_[_0x275a('0x3f')](_0x19a537['model'],qs[_0x275a('0x40')](_0x94bcc3['query'][_0x275a('0x40')]));_0x9f43d1[_0x275a('0x3e')]=_0x9f43d1[_0x275a('0x3e')][_0x275a('0x41')]?_0x9f43d1[_0x275a('0x3e')]:_0x19a537[_0x275a('0x3d')];if(_0x94bcc3[_0x275a('0x3a')][_0x275a('0x51')]){_0x9f43d1[_0x275a('0x4b')]=[{'all':!![]}];}_0x9f43d1=_['merge']({},_0x9f43d1,_0x94bcc3['options']);return db['OpenchannelMessage'][_0x275a('0x52')](_0x9f43d1)['then'](handleEntityNotFound(_0x291c3f,null))[_0x275a('0x32')](respondWithResult(_0x291c3f,null))[_0x275a('0x25')](handleError(_0x291c3f,null));};exports[_0x275a('0x53')]=function(_0x354aee,_0x3ed896){return db[_0x275a('0x37')]['create'](_0x354aee['body'],{})[_0x275a('0x32')](respondWithResult(_0x3ed896,0xc9))[_0x275a('0x25')](handleError(_0x3ed896,null));};exports[_0x275a('0x54')]=function(_0x2dedbd,_0x51599f){if(_0x2dedbd[_0x275a('0x55')]['id']){delete _0x2dedbd[_0x275a('0x55')]['id'];}return db[_0x275a('0x37')][_0x275a('0x52')]({'where':{'id':_0x2dedbd[_0x275a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x51599f,null))['then'](saveUpdates(_0x2dedbd[_0x275a('0x55')],null))['then'](respondWithResult(_0x51599f,null))['catch'](handleError(_0x51599f,null));};exports['destroy']=function(_0x2c2a84,_0x42b5e7){return db[_0x275a('0x37')]['find']({'where':{'id':_0x2c2a84[_0x275a('0x4f')]['id']}})[_0x275a('0x32')](handleEntityNotFound(_0x42b5e7,null))[_0x275a('0x32')](removeEntity(_0x42b5e7,null))[_0x275a('0x25')](handleError(_0x42b5e7,null));};exports[_0x275a('0x56')]=function(_0x360792,_0x52e489){return db[_0x275a('0x37')][_0x275a('0x56')]()['then'](respondWithResult(_0x52e489,null))[_0x275a('0x25')](handleError(_0x52e489,null));};var interaction_log=require(_0x275a('0x10'))(_0x275a('0x57'));exports[_0x275a('0x58')]=function(_0x119ee7,_0x358f1a,_0x4c54f1){var _0xe867de={'agent':{},'channel':_0x275a('0x59')};if(_0x119ee7[_0x275a('0x55')]['id']){delete _0x119ee7[_0x275a('0x55')]['id'];}_0x119ee7[_0x275a('0x55')][_0x275a('0x5a')]=!![];_0x119ee7[_0x275a('0x55')][_0x275a('0x5b')]=moment()[_0x275a('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x119ee7[_0x275a('0x55')][_0x275a('0x5d')]=_0x119ee7[_0x275a('0x55')][_0x275a('0x5d')]||_0x119ee7[_0x275a('0x5e')]['id'];_0xe867de[_0x275a('0x5f')]['id']=_0x119ee7[_0x275a('0x55')][_0x275a('0x5d')];return db['OpenchannelMessage'][_0x275a('0x52')]({'where':{'id':_0x119ee7['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x358f1a,null))[_0x275a('0x32')](saveUpdates(_0x119ee7[_0x275a('0x55')],null))[_0x275a('0x32')](function(_0x558fee){if(_0x558fee){_0xe867de[_0x275a('0x22')]=_0x558fee['get']({'plain':!![]});return db[_0x275a('0x60')][_0x275a('0x52')]({'where':{'id':_0x558fee[_0x275a('0x61')]}});}return null;})[_0x275a('0x32')](handleEntityNotFound(_0x358f1a,null))['then'](function(_0x2dcb13){if(_0x2dcb13){return _0x2dcb13[_0x275a('0x54')]({'UserId':_0x119ee7[_0x275a('0x55')]['UserId'],'read1stAt':_[_0x275a('0x62')](_0x2dcb13[_0x275a('0x63')])?moment()[_0x275a('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x87694e){if(_0x87694e){_0xe867de[_0x275a('0x64')]=_0x87694e['get']({'plain':!![]});interaction_log[_0x275a('0x23')](_0x275a('0x65'),_0x119ee7[_0x275a('0x5e')]['id'],_0x119ee7[_0x275a('0x5e')][_0x275a('0x34')],_0x119ee7[_0x275a('0x5e')][_0x275a('0x66')],_0xe867de['interaction']['id'],_0x119ee7['body']?JSON[_0x275a('0x67')](_0x119ee7[_0x275a('0x55')]):_0x275a('0x68'));return respondWithRpcPromise(_0x275a('0x69'),'acceptMessage',_0xe867de);}return null;})['then'](function(_0x5af874){var _0x3c1897=_0x275a('0x6a')+_0x5af874['message'][_0x275a('0x6b')];return db[_0x275a('0x6c')][_0x275a('0x3a')](_0x3c1897,{'type':db['Sequelize'][_0x275a('0x6d')][_0x275a('0x6e')],'raw':!![]})[_0x275a('0x32')](function(_0x5a25db){return _0x5a25db;});})[_0x275a('0x32')](function(_0x887cbe){if(_0x887cbe){_0xe867de[_0x275a('0x22')][_0x275a('0x6f')]=_0x887cbe[0x0];if(!_0x119ee7['body'][_0x275a('0x5d')])return;return db['User'][_0x275a('0x52')]({'where':{'id':_0x119ee7['body']['UserId'],'role':'agent'},'attributes':['id',_0x275a('0x34'),_0x275a('0x70'),_0x275a('0x71'),_0x275a('0x72')],'raw':!![]});}return null;})[_0x275a('0x32')](function(_0x56d446){if(!_0x56d446)return null;_0xe867de[_0x275a('0x22')]['agent']=_0x56d446;return _0xe867de;})['then'](function(_0x170dd5){if(_0x170dd5){if(_0x119ee7[_0x275a('0x55')][_0x275a('0x73')]){_0xe867de[_0x275a('0x22')][_0x275a('0x74')]=util[_0x275a('0x5c')]('SIP/%s',_0x119ee7[_0x275a('0x5e')][_0x275a('0x34')]);_0xe867de['message'][_0x275a('0x75')]=_0xe867de[_0x275a('0x75')];_0xe867de[_0x275a('0x22')][_0x275a('0x76')]=_0xe867de[_0x275a('0x75')];_0xe867de[_0x275a('0x22')][_0x275a('0x77')]=_0x275a('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x275a('0x78'),'message':_0xe867de[_0x275a('0x22')]},client9002)['then'](function(){return _0xe867de;});}return _0xe867de;}return null;})[_0x275a('0x32')](respondWithResult(_0x358f1a,null))[_0x275a('0x25')](handleError(_0x358f1a,null));};var interaction_log=require(_0x275a('0x10'))(_0x275a('0x57'));exports['reject']=function(_0x38ef10,_0x42b8cb,_0x139ad1){var _0x5e4e22={'agent':{},'channel':'openchannel'};if(_0x38ef10[_0x275a('0x55')]['id']){delete _0x38ef10[_0x275a('0x55')]['id'];}_0x38ef10[_0x275a('0x55')][_0x275a('0x5d')]=_0x38ef10[_0x275a('0x55')][_0x275a('0x5d')]||_0x38ef10[_0x275a('0x5e')]['id'];_0x5e4e22['agent']['id']=_0x38ef10['body'][_0x275a('0x5d')];return db['OpenchannelMessage'][_0x275a('0x52')]({'where':{'id':_0x38ef10[_0x275a('0x4f')]['id'],'UserId':null}})[_0x275a('0x32')](handleEntityNotFound(_0x42b8cb,null))[_0x275a('0x32')](function(_0x2742b8){if(_0x2742b8){_0x5e4e22['message']=_0x2742b8[_0x275a('0x79')]({'plain':!![]});return db[_0x275a('0x60')]['find']({'where':{'id':_0x2742b8[_0x275a('0x61')]}});}return null;})[_0x275a('0x32')](handleEntityNotFound(_0x42b8cb,null))['then'](function(_0x1da7fe){if(_0x1da7fe){_0x5e4e22[_0x275a('0x64')]=_0x1da7fe['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x38ef10[_0x275a('0x5e')]['id'],_0x38ef10[_0x275a('0x5e')][_0x275a('0x34')],_0x38ef10[_0x275a('0x5e')][_0x275a('0x66')],_0x5e4e22[_0x275a('0x64')]['id'],_0x38ef10[_0x275a('0x55')]?JSON[_0x275a('0x67')](_0x38ef10[_0x275a('0x55')]):_0x275a('0x68'));return respondWithRpcPromise(_0x275a('0x7a'),_0x275a('0x7b'),_0x5e4e22);}return null;})[_0x275a('0x32')](function(_0x5943d6){var _0x571fde=_0x275a('0x6a')+_0x5943d6[_0x275a('0x22')][_0x275a('0x6b')];return db[_0x275a('0x6c')][_0x275a('0x3a')](_0x571fde,{'type':db['Sequelize'][_0x275a('0x6d')]['SELECT'],'raw':!![]})[_0x275a('0x32')](function(_0x3d7f2f){return _0x3d7f2f;});})[_0x275a('0x32')](function(_0x3552b4){if(_0x3552b4){_0x5e4e22['message'][_0x275a('0x6f')]=_0x3552b4[0x0];if(!_0x38ef10[_0x275a('0x55')][_0x275a('0x5d')])return;return db[_0x275a('0x7c')]['find']({'where':{'id':_0x38ef10[_0x275a('0x55')][_0x275a('0x5d')],'role':'agent'},'attributes':['id',_0x275a('0x34'),_0x275a('0x70'),_0x275a('0x71'),_0x275a('0x72')],'raw':!![]});}return null;})[_0x275a('0x32')](function(_0x40c169){if(!_0x40c169)return null;_0x5e4e22[_0x275a('0x22')][_0x275a('0x5f')]=_0x40c169;return _0x5e4e22;})[_0x275a('0x32')](function(_0x47299a){if(_0x47299a){_0x47299a[_0x275a('0x22')][_0x275a('0x74')]=util[_0x275a('0x5c')]('SIP/%s',_0x38ef10[_0x275a('0x5e')]['name']);_0x47299a['message'][_0x275a('0x75')]=_0x5e4e22['channel'];_0x47299a[_0x275a('0x22')]['motionChannel']=_0x5e4e22[_0x275a('0x75')];_0x47299a[_0x275a('0x22')]['event']=_0x275a('0x31');respondWithRpcPromise('EventManager',_0x275a('0x7d'),{'event':'rejectmessage','message':_0x47299a[_0x275a('0x22')]},client9002);return _0x5e4e22;}return null;})[_0x275a('0x32')](respondWithResult(_0x42b8cb,null))[_0x275a('0x25')](handleError(_0x42b8cb,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ff208db..7228d82 100644 --- a/server/api/openchannelMessage/openchannelMessage.events.js +++ b/server/api/openchannelMessage/openchannelMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbac4=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x319784,_0x47e6d4){var _0x1917da=function(_0x2cb921){while(--_0x2cb921){_0x319784['push'](_0x319784['shift']());}};_0x1917da(++_0x47e6d4);}(_0xbac4,0x129));var _0x4bac=function(_0x4075af,_0x3f81aa){_0x4075af=_0x4075af-0x0;var _0x21bd67=_0xbac4[_0x4075af];return _0x21bd67;};'use strict';var EventEmitter=require(_0x4bac('0x0'));var OpenchannelMessage=require(_0x4bac('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4bac('0x2')](0x0);var events={'afterCreate':_0x4bac('0x3'),'afterUpdate':_0x4bac('0x4'),'afterDestroy':_0x4bac('0x5')};function emitEvent(_0x354437){return function(_0xe5b3ad,_0x1bc5c1,_0x1cc355){OpenchannelMessageEvents['emit'](_0x354437+':'+_0xe5b3ad['id'],_0xe5b3ad);OpenchannelMessageEvents[_0x4bac('0x6')](_0x354437,_0xe5b3ad);_0x1cc355(null);};}for(var e in events){if(events[_0x4bac('0x7')](e)){var event=events[e];OpenchannelMessage[_0x4bac('0x8')](e,emitEvent(event));}}module[_0x4bac('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x3b77=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3b77,0xe6));var _0x73b7=function(_0x4f8040,_0xe63343){_0x4f8040=_0x4f8040-0x0;var _0x4a6bbb=_0x3b77[_0x4f8040];return _0x4a6bbb;};'use strict';var EventEmitter=require(_0x73b7('0x0'));var OpenchannelMessage=require(_0x73b7('0x1'))['db'][_0x73b7('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x73b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x73b7('0x4'),'afterDestroy':_0x73b7('0x5')};function emitEvent(_0x24c912){return function(_0x2996aa,_0x283c16,_0x1321b8){OpenchannelMessageEvents[_0x73b7('0x6')](_0x24c912+':'+_0x2996aa['id'],_0x2996aa);OpenchannelMessageEvents['emit'](_0x24c912,_0x2996aa);_0x1321b8(null);};}for(var e in events){if(events[_0x73b7('0x7')](e)){var event=events[e];OpenchannelMessage[_0x73b7('0x8')](e,emitEvent(event));}}module[_0x73b7('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 1df3151..2d0250d 100644 --- a/server/api/openchannelMessage/openchannelMessage.model.js +++ b/server/api/openchannelMessage/openchannelMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81fc=['api','moment','bluebird','request-promise','path','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','replyUri','method','body','format','threadId','inspect','utf8mb4','lodash','util','../../config/logger'];(function(_0x30d696,_0x221575){var _0x121953=function(_0x465063){while(--_0x465063){_0x30d696['push'](_0x30d696['shift']());}};_0x121953(++_0x221575);}(_0x81fc,0x96));var _0xc81f=function(_0x4ae455,_0x4762d9){_0x4ae455=_0x4ae455-0x0;var _0x1d2558=_0x81fc[_0x4ae455];return _0x1d2558;};'use strict';var _=require(_0xc81f('0x0'));var util=require(_0xc81f('0x1'));var logger=require(_0xc81f('0x2'))(_0xc81f('0x3'));var moment=require(_0xc81f('0x4'));var BPromise=require(_0xc81f('0x5'));var rp=require(_0xc81f('0x6'));var fs=require('fs');var path=require(_0xc81f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0xc81f('0x8')]=function(_0x708a61,_0x13f52){return _0x708a61[_0xc81f('0x9')](_0xc81f('0xa'),attributes,{'tableName':_0xc81f('0xb'),'paranoid':![],'indexes':[{'name':_0xc81f('0xc'),'fields':['body'],'type':_0xc81f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35697f,_0x4fbee3,_0x480aac){var _0x3c3137=_0x708a61[_0xc81f('0xe')];var _0x5b7004=_0x35697f[_0xc81f('0xf')]({'plain':!![]});if(_0x5b7004[_0xc81f('0x10')][_0xc81f('0x11')]()==='in'||_0x5b7004[_0xc81f('0x10')][_0xc81f('0x11')]()==='out'&&!_0x5b7004[_0xc81f('0x12')]&&!_[_0xc81f('0x13')](_0x5b7004[_0xc81f('0x14')])){_0x3c3137[_0xc81f('0x15')][_0xc81f('0x16')]({'where':{'id':_0x5b7004[_0xc81f('0x17')]}})[_0xc81f('0x18')](function(_0x5022c9){if(_0x5022c9){_0x5022c9[_0xc81f('0x19')]({'lastMsgAt':_0x5b7004[_0xc81f('0x1a')],'lastMsgDirection':_0x5b7004[_0xc81f('0x10')][_0xc81f('0x11')]()});}})[_0xc81f('0x1b')](function(_0x2d43ae){console[_0xc81f('0x1c')](_0x2d43ae);});}if(_0x5b7004[_0xc81f('0x10')]==='out'&&!_0x5b7004['secret']){var _0x2925c7;_0x3c3137[_0xc81f('0x1d')][_0xc81f('0x1e')]()['then'](function(_0x28151a){return _0x3c3137[_0xc81f('0x1f')][_0xc81f('0x20')]({'where':{'id':_0x5b7004['OpenchannelAccountId']},'include':[{'model':_0x3c3137[_0xc81f('0x15')],'as':_0xc81f('0x21'),'where':{'id':_0x5b7004['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x3c3137['CmContact'],'as':_0xc81f('0x22'),'attributes':_[_0xc81f('0x23')](_0x28151a)}]}]});})[_0xc81f('0x18')](function(_0x1621e4){_0x2925c7=_0x1621e4[_0xc81f('0xf')]({'plain':!![]});if(_0x2925c7&&_0x2925c7['replyUri']){logger[_0xc81f('0x24')](_0xc81f('0x25'),_0xc81f('0x26'),util['format'](_0xc81f('0x27'),_0x5b7004['id'],_0x2925c7['replyUri']));if(_0x2925c7['Interactions']&&_0x2925c7[_0xc81f('0x21')][_0xc81f('0x28')]){_0x5b7004[_0xc81f('0x29')]=_[_0xc81f('0x2a')](_0x2925c7[_0xc81f('0x21')][0x0],_0xc81f('0x22'));_0x5b7004[_0xc81f('0x22')]=_0x2925c7[_0xc81f('0x21')][0x0][_0xc81f('0x22')];}var _0x4fbee3={'method':_0xc81f('0x2b'),'uri':encodeURI(_0x2925c7[_0xc81f('0x2c')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4fbee3[_0xc81f('0x2d')]){case'GET':_0x4fbee3['qs']=_0x5b7004;break;case'POST':_0x4fbee3[_0xc81f('0x2e')]=_0x5b7004;break;}return rp(_0x4fbee3)[_0xc81f('0x18')](function(_0x486911){logger[_0xc81f('0x24')](_0xc81f('0x25'),_0xc81f('0x26'),util[_0xc81f('0x2f')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5b7004['id'],_0x2925c7['replyUri']));if(_0x486911['body']['threadId']&&_0x486911['body'][_0xc81f('0x30')]!=_0x5b7004[_0xc81f('0x29')][_0xc81f('0x30')]){return _0x3c3137['OpenchannelInteraction'][_0xc81f('0x19')]({'threadId':_0x486911[_0xc81f('0x2e')]['threadId']},{'where':{'id':_0x5b7004[_0xc81f('0x29')]['id']}});}else{return;}})[_0xc81f('0x18')](function(){return _0x35697f['update']({'read':!![]});})[_0xc81f('0x1b')](function(_0x454483){logger[_0xc81f('0x1c')](_0xc81f('0x25'),_0xc81f('0x26'),util[_0xc81f('0x31')](_0x454483,{'showHidden':![],'depth':null}));_0x480aac();});}else{_0x480aac();}})['finally'](function(){_0x480aac();});}else{_0x480aac();}}},'charset':_0xc81f('0x32'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe9b7=['describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','get','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4_unicode_ci','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact'];(function(_0xa3ff7e,_0x363b20){var _0x180f0b=function(_0x19cbd9){while(--_0x19cbd9){_0xa3ff7e['push'](_0xa3ff7e['shift']());}};_0x180f0b(++_0x363b20);}(_0xe9b7,0xe7));var _0x7e9b=function(_0x27ca80,_0x20a064){_0x27ca80=_0x27ca80-0x0;var _0x176f0a=_0xe9b7[_0x27ca80];return _0x176f0a;};'use strict';var _=require('lodash');var util=require(_0x7e9b('0x0'));var logger=require('../../config/logger')(_0x7e9b('0x1'));var moment=require(_0x7e9b('0x2'));var BPromise=require('bluebird');var rp=require(_0x7e9b('0x3'));var fs=require('fs');var path=require(_0x7e9b('0x4'));var rimraf=require(_0x7e9b('0x5'));var config=require(_0x7e9b('0x6'));var attributes=require('./openchannelMessage.attributes');module[_0x7e9b('0x7')]=function(_0x2f98aa,_0x21dbff){return _0x2f98aa[_0x7e9b('0x8')](_0x7e9b('0x9'),attributes,{'tableName':_0x7e9b('0xa'),'paranoid':![],'indexes':[{'name':_0x7e9b('0xb'),'fields':[_0x7e9b('0xc')],'type':_0x7e9b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x349c50,_0x3367fe,_0x573820){var _0x20ceb5=_0x2f98aa[_0x7e9b('0xe')];var _0xda824b=_0x349c50['get']({'plain':!![]});if(_0xda824b[_0x7e9b('0xf')][_0x7e9b('0x10')]()==='in'||_0xda824b[_0x7e9b('0xf')][_0x7e9b('0x10')]()===_0x7e9b('0x11')&&!_0xda824b[_0x7e9b('0x12')]&&!_[_0x7e9b('0x13')](_0xda824b[_0x7e9b('0x14')])){_0x20ceb5['OpenchannelInteraction'][_0x7e9b('0x15')]({'where':{'id':_0xda824b[_0x7e9b('0x16')]}})[_0x7e9b('0x17')](function(_0x2b2b36){if(_0x2b2b36){_0x2b2b36[_0x7e9b('0x18')]({'lastMsgAt':_0xda824b[_0x7e9b('0x19')],'lastMsgDirection':_0xda824b[_0x7e9b('0xf')][_0x7e9b('0x10')]()});}})[_0x7e9b('0x1a')](function(_0x491756){console[_0x7e9b('0x1b')](_0x491756);});}if(_0xda824b[_0x7e9b('0xf')]==='out'&&!_0xda824b[_0x7e9b('0x12')]){var _0x1fb889;_0x20ceb5[_0x7e9b('0x1c')][_0x7e9b('0x1d')]()['then'](function(_0x494da9){return _0x20ceb5[_0x7e9b('0x1e')][_0x7e9b('0x1f')]({'where':{'id':_0xda824b[_0x7e9b('0x20')]},'include':[{'model':_0x20ceb5[_0x7e9b('0x21')],'as':_0x7e9b('0x22'),'where':{'id':_0xda824b[_0x7e9b('0x16')]},'limit':0x1,'include':[{'model':_0x20ceb5[_0x7e9b('0x1c')],'as':_0x7e9b('0x23'),'attributes':_[_0x7e9b('0x24')](_0x494da9)}]}]});})[_0x7e9b('0x17')](function(_0x123a2f){_0x1fb889=_0x123a2f[_0x7e9b('0x25')]({'plain':!![]});if(_0x1fb889&&_0x1fb889[_0x7e9b('0x26')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x7e9b('0x27'),util[_0x7e9b('0x28')](_0x7e9b('0x29'),_0xda824b['id'],_0x1fb889[_0x7e9b('0x26')]));if(_0x1fb889[_0x7e9b('0x22')]&&_0x1fb889[_0x7e9b('0x22')][_0x7e9b('0x2a')]){_0xda824b['Interaction']=_[_0x7e9b('0x2b')](_0x1fb889['Interactions'][0x0],_0x7e9b('0x23'));_0xda824b[_0x7e9b('0x23')]=_0x1fb889[_0x7e9b('0x22')][0x0][_0x7e9b('0x23')];}var _0x3367fe={'method':_0x7e9b('0x2c'),'uri':encodeURI(_0x1fb889[_0x7e9b('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3367fe[_0x7e9b('0x2d')]){case _0x7e9b('0x2e'):_0x3367fe['qs']=_0xda824b;break;case'POST':_0x3367fe[_0x7e9b('0xc')]=_0xda824b;break;}return rp(_0x3367fe)[_0x7e9b('0x17')](function(_0x328edb){logger['info'](_0x7e9b('0x2f'),_0x7e9b('0x27'),util[_0x7e9b('0x28')](_0x7e9b('0x30'),_0xda824b['id'],_0x1fb889[_0x7e9b('0x26')]));if(_0x328edb['body'][_0x7e9b('0x31')]&&_0x328edb[_0x7e9b('0xc')][_0x7e9b('0x31')]!=_0xda824b['Interaction'][_0x7e9b('0x31')]){return _0x20ceb5[_0x7e9b('0x21')][_0x7e9b('0x18')]({'threadId':_0x328edb[_0x7e9b('0xc')][_0x7e9b('0x31')]},{'where':{'id':_0xda824b[_0x7e9b('0x32')]['id']}});}else{return;}})[_0x7e9b('0x17')](function(){return _0x349c50[_0x7e9b('0x18')]({'read':!![]});})[_0x7e9b('0x1a')](function(_0x3169f2){logger[_0x7e9b('0x1b')](_0x7e9b('0x2f'),_0x7e9b('0x27'),util['inspect'](_0x3169f2,{'showHidden':![],'depth':null}));_0x573820();});}else{_0x573820();}})['finally'](function(){_0x573820();});}else{_0x573820();}}},'charset':'utf8mb4','collate':_0x7e9b('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 050eaff..bc604c1 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0xdb28,0x106));var _0x8db2=function(_0x4e3286,_0xff9507){_0x4e3286=_0x4e3286-0x0;var _0x54c19a=_0xdb28[_0x4e3286];return _0x54c19a;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5315a5,_0x219771){var _0x203e77=function(_0x284c2f){while(--_0x284c2f){_0x5315a5['push'](_0x5315a5['shift']());}};_0x203e77(++_0x219771);}(_0x7a54,0x106));var _0x47a5=function(_0x31931e,_0x59331e){_0x31931e=_0x31931e-0x0;var _0x22d79d=_0x7a54[_0x31931e];return _0x22d79d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index a343532..4dfd62c 100644 --- a/server/api/openchannelMessage/openchannelMessage.socket.js +++ b/server/api/openchannelMessage/openchannelMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb58d=['emit','removeListener','register','./openchannelMessage.events','save','remove'];(function(_0x292423,_0x1759b7){var _0x2801cb=function(_0x23c821){while(--_0x23c821){_0x292423['push'](_0x292423['shift']());}};_0x2801cb(++_0x1759b7);}(_0xb58d,0x141));var _0xdb58=function(_0x3a26b8,_0x43181d){_0x3a26b8=_0x3a26b8-0x0;var _0x43f2e2=_0xb58d[_0x3a26b8];return _0x43f2e2;};'use strict';var OpenchannelMessageEvents=require(_0xdb58('0x0'));var events=[_0xdb58('0x1'),_0xdb58('0x2'),'update'];function createListener(_0x499f4f,_0x1a7434){return function(_0x541803){_0x1a7434[_0xdb58('0x3')](_0x499f4f,_0x541803);};}function removeListener(_0x518590,_0x16bcba){return function(){OpenchannelMessageEvents[_0xdb58('0x4')](_0x518590,_0x16bcba);};}exports[_0xdb58('0x5')]=function(_0x183524){for(var _0x542056=0x0,_0x3e0ce0=events['length'];_0x542056<_0x3e0ce0;_0x542056++){var _0x52a8f0=events[_0x542056];var _0x4f7440=createListener('openchannelMessage:'+_0x52a8f0,_0x183524);OpenchannelMessageEvents['on'](_0x52a8f0,_0x4f7440);}}; \ No newline at end of file +var _0xb3d2=['./openchannelMessage.events','save','remove','update','emit','register','length','openchannelMessage:'];(function(_0x51903d,_0x2d65dd){var _0x2f5ee8=function(_0x302126){while(--_0x302126){_0x51903d['push'](_0x51903d['shift']());}};_0x2f5ee8(++_0x2d65dd);}(_0xb3d2,0x140));var _0x2b3d=function(_0x48ed49,_0x2ca889){_0x48ed49=_0x48ed49-0x0;var _0x859783=_0xb3d2[_0x48ed49];return _0x859783;};'use strict';var OpenchannelMessageEvents=require(_0x2b3d('0x0'));var events=[_0x2b3d('0x1'),_0x2b3d('0x2'),_0x2b3d('0x3')];function createListener(_0x36116d,_0x8763fd){return function(_0x5e1234){_0x8763fd[_0x2b3d('0x4')](_0x36116d,_0x5e1234);};}function removeListener(_0x7bf62c,_0x12797d){return function(){OpenchannelMessageEvents['removeListener'](_0x7bf62c,_0x12797d);};}exports[_0x2b3d('0x5')]=function(_0x3fe05e){for(var _0x560b8a=0x0,_0x1a1a3f=events[_0x2b3d('0x6')];_0x560b8a<_0x1a1a3f;_0x560b8a++){var _0x410e54=events[_0x560b8a];var _0x2ad7f5=createListener(_0x2b3d('0x7')+_0x410e54,_0x3fe05e);OpenchannelMessageEvents['on'](_0x410e54,_0x2ad7f5);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 995f745..b1af329 100644 --- a/server/api/openchannelQueue/index.js +++ b/server/api/openchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x411f=['create','addAgents','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0x411f,0x1e3));var _0xf411=function(_0x514207,_0xe99f87){_0x514207=_0x514207-0x0;var _0x22c3cb=_0x411f[_0x514207];return _0x22c3cb;};'use strict';var multer=require(_0xf411('0x0'));var util=require(_0xf411('0x1'));var path=require(_0xf411('0x2'));var timeout=require(_0xf411('0x3'));var express=require(_0xf411('0x4'));var router=express['Router']();var fs_extra=require(_0xf411('0x5'));var auth=require(_0xf411('0x6'));var interaction=require(_0xf411('0x7'));var config=require(_0xf411('0x8'));var controller=require(_0xf411('0x9'));router[_0xf411('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf411('0xa')](_0xf411('0xb'),auth['isAuthenticated'](),controller[_0xf411('0xc')]);router['get'](_0xf411('0xd'),auth[_0xf411('0xe')](),controller[_0xf411('0xf')]);router[_0xf411('0xa')]('/:id/members',auth[_0xf411('0xe')](),controller['getMembers']);router['get'](_0xf411('0x10'),auth[_0xf411('0xe')](),controller[_0xf411('0x11')]);router[_0xf411('0xa')](_0xf411('0x12'),auth['isAuthenticated'](),controller[_0xf411('0x13')]);router[_0xf411('0x14')]('/',auth[_0xf411('0xe')](),controller[_0xf411('0x15')]);router[_0xf411('0x14')](_0xf411('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0xf411('0x14')](_0xf411('0x12'),auth[_0xf411('0xe')](),controller[_0xf411('0x16')]);router[_0xf411('0x17')]('/:id',auth[_0xf411('0xe')](),controller[_0xf411('0x18')]);router[_0xf411('0x19')](_0xf411('0xd'),auth[_0xf411('0xe')](),controller[_0xf411('0x1a')]);router['delete'](_0xf411('0x10'),auth[_0xf411('0xe')](),controller['removeTeams']);router[_0xf411('0x19')](_0xf411('0x12'),auth[_0xf411('0xe')](),controller['removeAgents']);module[_0xf411('0x1b')]=router; \ No newline at end of file +var _0x2e0a=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/users','getAgents','post','create','/:id/teams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0x462da4,_0x5832ef){var _0x3979eb=function(_0x46c60f){while(--_0x46c60f){_0x462da4['push'](_0x462da4['shift']());}};_0x3979eb(++_0x5832ef);}(_0x2e0a,0x7b));var _0xa2e0=function(_0x21e2f3,_0x1c85c4){_0x21e2f3=_0x21e2f3-0x0;var _0x5827c2=_0x2e0a[_0x21e2f3];return _0x5827c2;};'use strict';var multer=require(_0xa2e0('0x0'));var util=require(_0xa2e0('0x1'));var path=require(_0xa2e0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa2e0('0x3')]();var fs_extra=require(_0xa2e0('0x4'));var auth=require(_0xa2e0('0x5'));var interaction=require(_0xa2e0('0x6'));var config=require('../../config/environment');var controller=require(_0xa2e0('0x7'));router[_0xa2e0('0x8')]('/',auth['isAuthenticated'](),controller[_0xa2e0('0x9')]);router['get']('/describe',auth[_0xa2e0('0xa')](),controller[_0xa2e0('0xb')]);router[_0xa2e0('0x8')](_0xa2e0('0xc'),auth[_0xa2e0('0xa')](),controller[_0xa2e0('0xd')]);router[_0xa2e0('0x8')]('/:id/members',auth[_0xa2e0('0xa')](),controller['getMembers']);router[_0xa2e0('0x8')]('/:id/teams',auth[_0xa2e0('0xa')](),controller['getTeams']);router[_0xa2e0('0x8')](_0xa2e0('0xe'),auth['isAuthenticated'](),controller[_0xa2e0('0xf')]);router[_0xa2e0('0x10')]('/',auth[_0xa2e0('0xa')](),controller[_0xa2e0('0x11')]);router[_0xa2e0('0x10')](_0xa2e0('0x12'),auth[_0xa2e0('0xa')](),controller['addTeams']);router[_0xa2e0('0x10')](_0xa2e0('0xe'),auth[_0xa2e0('0xa')](),controller[_0xa2e0('0x13')]);router[_0xa2e0('0x14')](_0xa2e0('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa2e0('0x15')](_0xa2e0('0xc'),auth[_0xa2e0('0xa')](),controller['destroy']);router[_0xa2e0('0x15')](_0xa2e0('0x12'),auth[_0xa2e0('0xa')](),controller[_0xa2e0('0x16')]);router[_0xa2e0('0x15')]('/:id/users',auth[_0xa2e0('0xa')](),controller[_0xa2e0('0x17')]);module[_0xa2e0('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index f7ba9cf..724d205 100644 --- a/server/api/openchannelQueue/openchannelQueue.attributes.js +++ b/server/api/openchannelQueue/openchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bb3=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x1aad7e,_0x4aa2c9){var _0x543b08=function(_0x5aed99){while(--_0x5aed99){_0x1aad7e['push'](_0x1aad7e['shift']());}};_0x543b08(++_0x4aa2c9);}(_0x9bb3,0x166));var _0x39bb=function(_0x13120c,_0x62965f){_0x13120c=_0x13120c-0x0;var _0x4b4f02=_0x9bb3[_0x13120c];return _0x4b4f02;};'use strict';var Sequelize=require(_0x39bb('0x0'));module['exports']={'name':{'type':Sequelize[_0x39bb('0x1')],'unique':_0x39bb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x39bb('0x1')]},'timeout':{'type':Sequelize[_0x39bb('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x39bb('0x4')](_0x39bb('0x5'),_0x39bb('0x6'),_0x39bb('0x7'))}}; \ No newline at end of file +var _0xf846=['ENUM','beepall','name','STRING'];(function(_0x2306bc,_0x5b04bb){var _0xefab1b=function(_0x2b3556){while(--_0x2b3556){_0x2306bc['push'](_0x2306bc['shift']());}};_0xefab1b(++_0x5b04bb);}(_0xf846,0xfa));var _0x6f84=function(_0x2a7ea1,_0x4c8391){_0x2a7ea1=_0x2a7ea1-0x0;var _0x3abafd=_0xf846[_0x2a7ea1];return _0x3abafd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6f84('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6f84('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6f84('0x2')]('rrmemory',_0x6f84('0x3'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 4de7f0e..8c27263 100644 --- a/server/api/openchannelQueue/openchannelQueue.controller.js +++ b/server/api/openchannelQueue/openchannelQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x272a=['UserOpenchannelQueue','findAndCountAll','agent','updatedAt','createdAt','format','SIP','openchannelPause','getTeams','findOne','Team','addTeams','ids','online','interface','Agents','each','forEach','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','all','value','removeTeams','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','./openchannelQueue.socket','register','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueue','include','findAll','rows','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','catch','describe','getMembers','hasOwnProperty','order','OpenchannelQueueId'];(function(_0x508df7,_0x5922b4){var _0x1d066b=function(_0x8b7cdb){while(--_0x8b7cdb){_0x508df7['push'](_0x508df7['shift']());}};_0x1d066b(++_0x5922b4);}(_0x272a,0xba));var _0xa272=function(_0x1b8f82,_0x383537){_0x1b8f82=_0x1b8f82-0x0;var _0x5a4c8d=_0x272a[_0x1b8f82];return _0x5a4c8d;};'use strict';var emlformat=require(_0xa272('0x0'));var rimraf=require(_0xa272('0x1'));var zipdir=require(_0xa272('0x2'));var jsonpatch=require(_0xa272('0x3'));var rp=require(_0xa272('0x4'));var moment=require('moment');var BPromise=require(_0xa272('0x5'));var Mustache=require(_0xa272('0x6'));var util=require(_0xa272('0x7'));var path=require(_0xa272('0x8'));var sox=require(_0xa272('0x9'));var csv=require('to-csv');var ejs=require(_0xa272('0xa'));var fs=require('fs');var fs_extra=require(_0xa272('0xb'));var _=require(_0xa272('0xc'));var squel=require(_0xa272('0xd'));var crypto=require(_0xa272('0xe'));var jsforce=require(_0xa272('0xf'));var deskjs=require(_0xa272('0x10'));var toCsv=require(_0xa272('0x11'));var querystring=require(_0xa272('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa272('0x13'));var qs=require(_0xa272('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa272('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xa272('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa272('0x17'))['db'];config[_0xa272('0x18')]=_['defaults'](config[_0xa272('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa272('0x19'))[_0xa272('0x1a')](socket);function respondWithStatusCode(_0x4a395e,_0x2087f5){_0x2087f5=_0x2087f5||0xcc;return function(_0xd1acab){if(_0xd1acab){return _0x4a395e[_0xa272('0x1b')](_0x2087f5);}return _0x4a395e['status'](_0x2087f5)[_0xa272('0x1c')]();};}function respondWithResult(_0x403dda,_0x57509d){_0x57509d=_0x57509d||0xc8;return function(_0x498c07){if(_0x498c07){return _0x403dda[_0xa272('0x1d')](_0x57509d)[_0xa272('0x1e')](_0x498c07);}};}function respondWithFilteredResult(_0xb44722,_0x24334b){return function(_0x2acc6b){if(_0x2acc6b){var _0x53b5c7=typeof _0x24334b['offset']==='undefined'&&typeof _0x24334b[_0xa272('0x1f')]==='undefined';var _0x5c248e=_0x2acc6b[_0xa272('0x20')];var _0x1f0987=_0x53b5c7?0x0:_0x24334b[_0xa272('0x21')];var _0x43de07=_0x53b5c7?_0x2acc6b[_0xa272('0x20')]:_0x24334b[_0xa272('0x21')]+_0x24334b[_0xa272('0x1f')];var _0x35af8f;if(_0x43de07>=_0x5c248e){_0x43de07=_0x5c248e;_0x35af8f=0xc8;}else{_0x35af8f=0xce;}_0xb44722[_0xa272('0x1d')](_0x35af8f);return _0xb44722[_0xa272('0x22')](_0xa272('0x23'),_0x1f0987+'-'+_0x43de07+'/'+_0x5c248e)[_0xa272('0x1e')](_0x2acc6b);}return null;};}function patchUpdates(_0x54e41d){return function(_0x5b7658){try{jsonpatch[_0xa272('0x24')](_0x5b7658,_0x54e41d,!![]);}catch(_0x48eab2){return BPromise[_0xa272('0x25')](_0x48eab2);}return _0x5b7658[_0xa272('0x26')]();};}function saveUpdates(_0x5d15cf,_0x12cdc8){return function(_0x2e482f){if(_0x2e482f){return _0x2e482f[_0xa272('0x27')](_0x5d15cf)[_0xa272('0x28')](function(_0x10bd83){return _0x10bd83;});}return null;};}function removeEntity(_0x45a030,_0x52205e){return function(_0x574e6d){if(_0x574e6d){return _0x574e6d[_0xa272('0x29')]()[_0xa272('0x28')](function(){var _0x4a35f9=_0x574e6d[_0xa272('0x2a')]({'plain':!![]});var _0x8f6372=_0xa272('0x2b');return db[_0xa272('0x2c')][_0xa272('0x29')]({'where':{'type':_0x8f6372,'resourceId':_0x4a35f9['id']}})[_0xa272('0x28')](function(){return _0x574e6d;});})['then'](function(){_0x45a030[_0xa272('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e937f,_0xce408f){return function(_0x15d804){if(!_0x15d804){_0x2e937f[_0xa272('0x1b')](0x194);}return _0x15d804;};}function handleError(_0x1fa389,_0x51e593){_0x51e593=_0x51e593||0x1f4;return function(_0x282fbb){logger['error'](_0x282fbb['stack']);if(_0x282fbb['name']){delete _0x282fbb[_0xa272('0x2d')];}_0x1fa389[_0xa272('0x1d')](_0x51e593)['send'](_0x282fbb);};}exports[_0xa272('0x2e')]=function(_0x24b3f9,_0x3d9e0b){var _0x34dc0f={},_0x25c145={},_0x492ee9={'count':0x0,'rows':[]};var _0x3da11f=_[_0xa272('0x2f')](db['OpenchannelQueue'][_0xa272('0x30')],function(_0x377009){return{'name':_0x377009[_0xa272('0x31')],'type':_0x377009[_0xa272('0x32')][_0xa272('0x33')]};});_0x25c145['model']=_[_0xa272('0x2f')](_0x3da11f,'name');_0x25c145['query']=_[_0xa272('0x34')](_0x24b3f9[_0xa272('0x35')]);_0x25c145[_0xa272('0x36')]=_[_0xa272('0x37')](_0x25c145[_0xa272('0x38')],_0x25c145[_0xa272('0x35')]);_0x34dc0f[_0xa272('0x39')]=_[_0xa272('0x37')](_0x25c145[_0xa272('0x38')],qs[_0xa272('0x3a')](_0x24b3f9[_0xa272('0x35')][_0xa272('0x3a')]));_0x34dc0f[_0xa272('0x39')]=_0x34dc0f[_0xa272('0x39')][_0xa272('0x3b')]?_0x34dc0f['attributes']:_0x25c145[_0xa272('0x38')];if(!_0x24b3f9[_0xa272('0x35')]['hasOwnProperty'](_0xa272('0x3c'))){_0x34dc0f[_0xa272('0x1f')]=qs[_0xa272('0x1f')](_0x24b3f9[_0xa272('0x35')][_0xa272('0x1f')]);_0x34dc0f['offset']=qs[_0xa272('0x21')](_0x24b3f9[_0xa272('0x35')][_0xa272('0x21')]);}_0x34dc0f['order']=qs['sort'](_0x24b3f9[_0xa272('0x35')][_0xa272('0x3d')]);_0x34dc0f[_0xa272('0x3e')]=qs[_0xa272('0x36')](_[_0xa272('0x3f')](_0x24b3f9[_0xa272('0x35')],_0x25c145['filters']),_0x3da11f);if(_0x24b3f9['query'][_0xa272('0x40')]){_0x34dc0f[_0xa272('0x3e')]=_[_0xa272('0x41')](_0x34dc0f['where'],{'$or':_[_0xa272('0x2f')](_0x3da11f,function(_0x2a7c9b){if(_0x2a7c9b[_0xa272('0x32')]!==_0xa272('0x42')){var _0x1ca2be={};_0x1ca2be[_0x2a7c9b[_0xa272('0x2d')]]={'$like':'%'+_0x24b3f9['query'][_0xa272('0x40')]+'%'};return _0x1ca2be;}})});}_0x34dc0f=_['merge']({},_0x34dc0f,_0x24b3f9[_0xa272('0x43')]);var _0xcf5d1a={'where':_0x34dc0f['where']};return db[_0xa272('0x44')]['count'](_0xcf5d1a)[_0xa272('0x28')](function(_0x26a3e7){_0x492ee9['count']=_0x26a3e7;if(_0x24b3f9[_0xa272('0x35')]['includeAll']){_0x34dc0f[_0xa272('0x45')]=[{'all':!![]}];}return db[_0xa272('0x44')][_0xa272('0x46')](_0x34dc0f);})['then'](function(_0x1cbd05){_0x492ee9[_0xa272('0x47')]=_0x1cbd05;return _0x492ee9;})[_0xa272('0x28')](respondWithFilteredResult(_0x3d9e0b,_0x34dc0f))['catch'](handleError(_0x3d9e0b,null));};exports['show']=function(_0x4ce779,_0x8f7cad){var _0x23bd4a={'raw':!![],'where':{'id':_0x4ce779[_0xa272('0x48')]['id']}},_0x135ab0={};_0x135ab0[_0xa272('0x38')]=_[_0xa272('0x34')](db[_0xa272('0x44')][_0xa272('0x30')]);_0x135ab0[_0xa272('0x35')]=_[_0xa272('0x34')](_0x4ce779[_0xa272('0x35')]);_0x135ab0[_0xa272('0x36')]=_['intersection'](_0x135ab0[_0xa272('0x38')],_0x135ab0['query']);_0x23bd4a[_0xa272('0x39')]=_[_0xa272('0x37')](_0x135ab0[_0xa272('0x38')],qs[_0xa272('0x3a')](_0x4ce779['query'][_0xa272('0x3a')]));_0x23bd4a[_0xa272('0x39')]=_0x23bd4a[_0xa272('0x39')][_0xa272('0x3b')]?_0x23bd4a[_0xa272('0x39')]:_0x135ab0[_0xa272('0x38')];if(_0x4ce779[_0xa272('0x35')]['includeAll']){_0x23bd4a[_0xa272('0x45')]=[{'all':!![]}];}_0x23bd4a=_[_0xa272('0x41')]({},_0x23bd4a,_0x4ce779[_0xa272('0x43')]);return db[_0xa272('0x44')][_0xa272('0x49')](_0x23bd4a)[_0xa272('0x28')](handleEntityNotFound(_0x8f7cad,null))[_0xa272('0x28')](respondWithResult(_0x8f7cad,null))['catch'](handleError(_0x8f7cad,null));};exports[_0xa272('0x4a')]=function(_0x743f17,_0x1ea9c9){return db[_0xa272('0x44')][_0xa272('0x4a')](_0x743f17['body'],{})[_0xa272('0x28')](function(_0x20b597){var _0x581e4e=_0x743f17[_0xa272('0x4b')][_0xa272('0x2a')]({'plain':!![]});if(!_0x581e4e)throw new Error(_0xa272('0x4c'));if(_0x581e4e['role']===_0xa272('0x4b')){var _0x23b5d4=_0x20b597[_0xa272('0x2a')]({'plain':!![]});var _0x2274d0=_0xa272('0x2b');return db[_0xa272('0x4d')][_0xa272('0x49')]({'where':{'name':_0x2274d0,'userProfileId':_0x581e4e[_0xa272('0x4e')]},'raw':!![]})[_0xa272('0x28')](function(_0x2156a2){if(_0x2156a2&&_0x2156a2['autoAssociation']===0x0){return db[_0xa272('0x2c')]['create']({'name':_0x23b5d4[_0xa272('0x2d')],'resourceId':_0x23b5d4['id'],'type':_0x2156a2[_0xa272('0x2d')],'sectionId':_0x2156a2['id']},{})[_0xa272('0x28')](function(){return _0x20b597;});}else{return _0x20b597;}})['catch'](function(_0x3368bf){logger[_0xa272('0x4f')](_0xa272('0x50'),_0x3368bf);throw _0x3368bf;});}return _0x20b597;})['then'](respondWithResult(_0x1ea9c9,0xc9))['catch'](handleError(_0x1ea9c9,null));};exports[_0xa272('0x27')]=function(_0x2e500e,_0x2b3f05){if(_0x2e500e[_0xa272('0x51')]['id']){delete _0x2e500e['body']['id'];}return db['OpenchannelQueue'][_0xa272('0x49')]({'where':{'id':_0x2e500e['params']['id']}})[_0xa272('0x28')](handleEntityNotFound(_0x2b3f05,null))['then'](saveUpdates(_0x2e500e[_0xa272('0x51')],null))[_0xa272('0x28')](respondWithResult(_0x2b3f05,null))['catch'](handleError(_0x2b3f05,null));};exports[_0xa272('0x29')]=function(_0x5698d1,_0xdf82e){return db[_0xa272('0x44')]['find']({'where':{'id':_0x5698d1[_0xa272('0x48')]['id']}})[_0xa272('0x28')](handleEntityNotFound(_0xdf82e,null))[_0xa272('0x28')](removeEntity(_0xdf82e,null))[_0xa272('0x52')](handleError(_0xdf82e,null));};exports[_0xa272('0x53')]=function(_0x15d047,_0x16e8c3){return db['OpenchannelQueue'][_0xa272('0x53')]()[_0xa272('0x28')](respondWithResult(_0x16e8c3,null))['catch'](handleError(_0x16e8c3,null));};exports[_0xa272('0x54')]=function(_0x1d04f7,_0x18aed6,_0x761da5){var _0x407774={'raw':!![],'where':{}},_0x25fdb3={},_0x224679;return db[_0xa272('0x44')]['findOne']({'where':{'id':_0x1d04f7[_0xa272('0x48')]['id']}})[_0xa272('0x28')](handleEntityNotFound(_0x18aed6,null))[_0xa272('0x28')](function(_0x1ec0d6){if(_0x1ec0d6){_0x224679=_0x1ec0d6[_0xa272('0x2a')]({'plain':!![]});_0x25fdb3['model']=_[_0xa272('0x34')](db['UserOpenchannelQueue'][_0xa272('0x30')]);_0x25fdb3[_0xa272('0x35')]=_[_0xa272('0x34')](_0x1d04f7[_0xa272('0x35')]);_0x25fdb3[_0xa272('0x36')]=_[_0xa272('0x37')](_0x25fdb3[_0xa272('0x38')],_0x25fdb3['query']);_0x407774[_0xa272('0x39')]=_[_0xa272('0x37')](_0x25fdb3['model'],qs['fields'](_0x1d04f7['query'][_0xa272('0x3a')]));_0x407774[_0xa272('0x39')]=_0x407774[_0xa272('0x39')]['length']?_0x407774[_0xa272('0x39')]:_0x25fdb3[_0xa272('0x38')];if(!_0x1d04f7[_0xa272('0x35')][_0xa272('0x55')](_0xa272('0x3c'))){_0x407774[_0xa272('0x1f')]=qs['limit'](_0x1d04f7[_0xa272('0x35')][_0xa272('0x1f')]);_0x407774['offset']=qs[_0xa272('0x21')](_0x1d04f7['query'][_0xa272('0x21')]);}_0x407774[_0xa272('0x56')]=qs[_0xa272('0x3d')](_0x1d04f7['query']['sort']);_0x407774[_0xa272('0x3e')]=qs[_0xa272('0x36')](_[_0xa272('0x3f')](_0x1d04f7[_0xa272('0x35')],_0x25fdb3[_0xa272('0x36')]));_0x407774['where'][_0xa272('0x57')]=_0x1ec0d6['id'];if(_0x1d04f7[_0xa272('0x35')][_0xa272('0x40')]){_0x407774[_0xa272('0x3e')]=_[_0xa272('0x41')](_0x407774['where'],{'$or':_[_0xa272('0x2f')](_0x407774['attributes'],function(_0x461403){var _0xd9dd72={};_0xd9dd72[_0x461403]={'$like':'%'+_0x1d04f7[_0xa272('0x35')][_0xa272('0x40')]+'%'};return _0xd9dd72;})});}_0x407774=_[_0xa272('0x41')]({},_0x407774,_0x1d04f7[_0xa272('0x43')]);return db[_0xa272('0x58')][_0xa272('0x46')](_0x407774);}})[_0xa272('0x28')](function(_0x37bf3b){if(_0x37bf3b){return db['User'][_0xa272('0x59')]({'where':{'id':_[_0xa272('0x2f')](_0x37bf3b,'UserId'),'role':_0xa272('0x5a')},'attributes':['id',_0xa272('0x2d'),'openchannelPause',_0xa272('0x5b'),_0xa272('0x5c')]});}})[_0xa272('0x28')](function(_0x1ca253){if(_0x1ca253){return{'count':_0x1ca253['count'],'rows':_[_0xa272('0x2f')](_0x1ca253[_0xa272('0x47')],function(_0x435658){return{'membername':_0x435658[_0xa272('0x2d')],'UserId':_0x435658['id'],'queue_name':_0x224679[_0xa272('0x2d')],'OpenchannelQueueId':_0x224679['id'],'interface':util[_0xa272('0x5d')]('%s/%s',_0xa272('0x5e'),_0x435658[_0xa272('0x2d')]),'penalty':0x0,'paused':_0x435658[_0xa272('0x5f')],'createdAt':_0x435658[_0xa272('0x5c')],'updatedAt':_0x435658[_0xa272('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x18aed6,_0x407774))[_0xa272('0x52')](handleError(_0x18aed6,null));};exports[_0xa272('0x60')]=function(_0x39e699,_0x2782bc,_0x255472){var _0x4b03b8={};var _0x1ceac2={};var _0x18fab5;var _0x45e17b;return db[_0xa272('0x44')][_0xa272('0x61')]({'where':{'id':_0x39e699[_0xa272('0x48')]['id']}})[_0xa272('0x28')](handleEntityNotFound(_0x2782bc,null))[_0xa272('0x28')](function(_0x53d714){if(_0x53d714){_0x18fab5=_0x53d714;_0x1ceac2[_0xa272('0x38')]=_['keys'](db[_0xa272('0x62')][_0xa272('0x30')]);_0x1ceac2[_0xa272('0x35')]=_['keys'](_0x39e699[_0xa272('0x35')]);_0x1ceac2[_0xa272('0x36')]=_[_0xa272('0x37')](_0x1ceac2[_0xa272('0x38')],_0x1ceac2[_0xa272('0x35')]);_0x4b03b8[_0xa272('0x39')]=_[_0xa272('0x37')](_0x1ceac2[_0xa272('0x38')],qs[_0xa272('0x3a')](_0x39e699[_0xa272('0x35')][_0xa272('0x3a')]));_0x4b03b8[_0xa272('0x39')]=_0x4b03b8['attributes'][_0xa272('0x3b')]?_0x4b03b8[_0xa272('0x39')]:_0x1ceac2[_0xa272('0x38')];_0x4b03b8[_0xa272('0x56')]=qs[_0xa272('0x3d')](_0x39e699[_0xa272('0x35')]['sort']);_0x4b03b8[_0xa272('0x3e')]=qs[_0xa272('0x36')](_['pick'](_0x39e699[_0xa272('0x35')],_0x1ceac2['filters']));if(_0x39e699[_0xa272('0x35')]['filter']){_0x4b03b8[_0xa272('0x3e')]=_[_0xa272('0x41')](_0x4b03b8['where'],{'$or':_[_0xa272('0x2f')](_0x4b03b8[_0xa272('0x39')],function(_0x19bff9){var _0x35c991={};_0x35c991[_0x19bff9]={'$like':'%'+_0x39e699[_0xa272('0x35')][_0xa272('0x40')]+'%'};return _0x35c991;})});}_0x4b03b8=_[_0xa272('0x41')]({},_0x4b03b8,_0x39e699[_0xa272('0x43')]);return _0x18fab5[_0xa272('0x60')](_0x4b03b8);}})[_0xa272('0x28')](function(_0x149508){if(_0x149508){_0x45e17b=_0x149508[_0xa272('0x3b')];if(!_0x39e699[_0xa272('0x35')]['hasOwnProperty'](_0xa272('0x3c'))){_0x4b03b8[_0xa272('0x1f')]=qs[_0xa272('0x1f')](_0x39e699[_0xa272('0x35')][_0xa272('0x1f')]);_0x4b03b8[_0xa272('0x21')]=qs[_0xa272('0x21')](_0x39e699[_0xa272('0x35')][_0xa272('0x21')]);}return _0x18fab5[_0xa272('0x60')](_0x4b03b8);}})[_0xa272('0x28')](function(_0x552075){if(_0x552075){return _0x552075?{'count':_0x45e17b,'rows':_0x552075}:null;}})[_0xa272('0x28')](respondWithResult(_0x2782bc,null))['catch'](handleError(_0x2782bc,null));};exports[_0xa272('0x63')]=function(_0x44ff23,_0x4643e1,_0xd92b2c){var _0x87f4a1=_0x44ff23['body'][_0xa272('0x64')];return db[_0xa272('0x62')][_0xa272('0x46')]({'where':{'id':_0x87f4a1},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa272('0x2d'),_0xa272('0x65'),'voicePause',_0xa272('0x66')],'raw':!![]}]})[_0xa272('0x28')](function(_0x2137b6){if(_0x2137b6){var _0x22a8d8=_['flatMap'](_0x2137b6,function(_0x514d12){var _0x424209=_0x514d12[_0xa272('0x2a')]({'plain':!![]});return _0x424209[_0xa272('0x67')];});return db['OpenchannelQueue'][_0xa272('0x49')]({'where':{'id':_0x44ff23['params']['id']}})[_0xa272('0x28')](function(_0x2d65d6){return db['sequelize']['transaction'](function(_0x117583){return _0x2d65d6[_0xa272('0x63')](_0x87f4a1,{'transaction':_0x117583})['then'](function(){return BPromise[_0xa272('0x68')](_0x22a8d8,function(_0x28e3bf){return db[_0xa272('0x58')]['findOrCreate']({'where':{'UserId':_0x28e3bf['id'],'OpenchannelQueueId':_0x44ff23['params']['id']},'transaction':_0x117583});});})[_0xa272('0x28')](function(){_0x22a8d8[_0xa272('0x69')](function(_0x42410d){socket['emit'](_0xa272('0x6a'),{'UserId':_0x42410d['id'],'OpenchannelQueueId':_0x2d65d6['id']});});});});});}})[_0xa272('0x28')](respondWithStatusCode(_0x4643e1,null))[_0xa272('0x52')](handleError(_0x4643e1,null));};exports['removeTeams']=function(_0x55f272,_0x39f6db,_0x3d69fc){return db[_0xa272('0x62')]['findAll']({'where':{'id':_0x55f272[_0xa272('0x35')][_0xa272('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa272('0x67'),'attributes':['id'],'raw':!![]}]})[_0xa272('0x28')](handleEntityNotFound(_0x39f6db,null))[_0xa272('0x28')](function(_0x15f226){var _0x381e6c=_['map'](_0x15f226,'id');var _0x7c86a5=[];var _0x103bad=[];var _0x5e8f7e=squel[_0xa272('0x6b')]();_0x5e8f7e[_0xa272('0x6c')](_0xa272('0x6d'))[_0xa272('0x6e')](_0xa272('0x6f'),'tq')[_0xa272('0x70')](_0xa272('0x71'),'ut',_0xa272('0x72'))[_0xa272('0x3e')](_0xa272('0x73'),_0x55f272[_0xa272('0x48')]['id']);for(var _0x561e0c=0x0;_0x561e0c<_0x15f226['length'];_0x561e0c+=0x1){let _0x7d5f8=_0x15f226[_0x561e0c];for(var _0x28d4ee=0x0;_0x28d4ee<_0x7d5f8[_0xa272('0x67')][_0xa272('0x3b')];_0x28d4ee+=0x1){let _0x1ad73d=_0x7d5f8[_0xa272('0x67')][_0x28d4ee];var _0x1ed340=_0x5e8f7e[_0xa272('0x74')]();_0x1ed340['where'](_0xa272('0x75'),_0x1ad73d['id']);_0x103bad[_0xa272('0x76')](db['sequelize']['query'](_0x1ed340[_0xa272('0x77')](),{'type':db[_0xa272('0x78')][_0xa272('0x79')][_0xa272('0x7a')]})[_0xa272('0x28')](function(_0x514ee9){if(_0x514ee9[_0xa272('0x3b')]===0x1){return _0x1ad73d['id'];}else{var _0x17465b=_[_0xa272('0x7b')](_[_0xa272('0x2f')](_0x514ee9,_0xa272('0x7c')),function(_0x12a7f3){return _['includes'](_0x381e6c,_0x12a7f3);});if(_0x17465b){return _0x1ad73d['id'];}}}));}}return BPromise[_0xa272('0x7d')](_0x103bad)[_0xa272('0x28')](function(_0x4413b7){_0x7c86a5=_(_0x7c86a5)['union'](_0x4413b7)['compact']()[_0xa272('0x7e')]();return db[_0xa272('0x44')]['find']({'where':{'id':_0x55f272['params']['id']}})[_0xa272('0x28')](function(_0x86d03e){return db[_0xa272('0x78')]['transaction'](function(_0x55fd8d){return _0x86d03e[_0xa272('0x7f')](_0x55f272['query']['ids'],{'transaction':_0x55fd8d})['then'](function(){if(!_[_0xa272('0x80')](_0x7c86a5)){return _0x86d03e[_0xa272('0x81')](_0x7c86a5,{'transaction':_0x55fd8d});}})[_0xa272('0x28')](function(){_0x7c86a5[_0xa272('0x69')](function(_0xe7d85a){socket[_0xa272('0x82')](_0xa272('0x83'),{'UserId':_0xe7d85a,'OpenchannelQueueId':_0x86d03e['id']});});});});});});})['then'](respondWithStatusCode(_0x39f6db,null))[_0xa272('0x52')](handleError(_0x39f6db,null));};exports[_0xa272('0x84')]=function(_0x1444b5,_0x40567e,_0x2d08de){return db['OpenchannelQueue'][_0xa272('0x49')]({'where':{'id':_0x1444b5[_0xa272('0x48')]['id']}})[_0xa272('0x28')](handleEntityNotFound(_0x40567e,null))[_0xa272('0x28')](function(_0x4ef366){if(_0x4ef366){return _0x4ef366[_0xa272('0x84')](_0x1444b5[_0xa272('0x51')][_0xa272('0x64')],_[_0xa272('0x85')](_0x1444b5[_0xa272('0x51')],[_0xa272('0x64'),'id'])||{})[_0xa272('0x86')](function(_0xb0c594){for(var _0x2ff7ce=0x0;_0x2ff7ce<_0x1444b5[_0xa272('0x51')][_0xa272('0x64')][_0xa272('0x3b')];_0x2ff7ce+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x1444b5[_0xa272('0x51')][_0xa272('0x64')][_0x2ff7ce]),'OpenchannelQueueId':Number(_0x1444b5[_0xa272('0x48')]['id'])});}return _0xb0c594;});}})[_0xa272('0x28')](respondWithResult(_0x40567e,null))[_0xa272('0x52')](handleError(_0x40567e,null));};exports[_0xa272('0x81')]=function(_0x3c401b,_0x5a6da8,_0x11166b){return db[_0xa272('0x44')]['find']({'where':{'id':_0x3c401b[_0xa272('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a6da8,null))[_0xa272('0x28')](function(_0x34d362){if(_0x34d362){return _0x34d362[_0xa272('0x81')](_0x3c401b[_0xa272('0x35')][_0xa272('0x64')])['then'](function(){if(_['isArray'](_0x3c401b[_0xa272('0x35')][_0xa272('0x64')])){for(var _0x4b9cf4=0x0;_0x4b9cf4<_0x3c401b[_0xa272('0x35')][_0xa272('0x64')][_0xa272('0x3b')];_0x4b9cf4+=0x1){socket[_0xa272('0x82')](_0xa272('0x83'),{'UserId':Number(_0x3c401b[_0xa272('0x35')][_0xa272('0x64')][_0x4b9cf4]),'OpenchannelQueueId':Number(_0x3c401b[_0xa272('0x48')]['id'])});}}else{socket[_0xa272('0x82')](_0xa272('0x83'),{'UserId':Number(_0x3c401b['query'][_0xa272('0x64')]),'OpenchannelQueueId':Number(_0x3c401b['params']['id'])});}});}})[_0xa272('0x28')](respondWithStatusCode(_0x5a6da8,null))[_0xa272('0x52')](handleError(_0x5a6da8,null));};exports[_0xa272('0x87')]=function(_0x19d662,_0x207666,_0x5f37b7){var _0x5b9e58={};var _0x342431={};var _0x117385;var _0x4e8e23;return db[_0xa272('0x44')][_0xa272('0x61')]({'where':{'id':_0x19d662['params']['id']}})['then'](handleEntityNotFound(_0x207666,null))['then'](function(_0x5619f7){if(_0x5619f7){_0x117385=_0x5619f7;_0x342431[_0xa272('0x38')]=_[_0xa272('0x34')](db[_0xa272('0x88')][_0xa272('0x30')]);_0x342431[_0xa272('0x35')]=_['keys'](_0x19d662[_0xa272('0x35')]);_0x342431[_0xa272('0x36')]=_[_0xa272('0x37')](_0x342431[_0xa272('0x38')],_0x342431[_0xa272('0x35')]);_0x5b9e58[_0xa272('0x39')]=_[_0xa272('0x37')](_0x342431[_0xa272('0x38')],qs[_0xa272('0x3a')](_0x19d662[_0xa272('0x35')][_0xa272('0x3a')]));_0x5b9e58[_0xa272('0x39')]=_0x5b9e58[_0xa272('0x39')][_0xa272('0x3b')]?_0x5b9e58['attributes']:_0x342431[_0xa272('0x38')];_0x5b9e58[_0xa272('0x56')]=qs[_0xa272('0x3d')](_0x19d662[_0xa272('0x35')][_0xa272('0x3d')]);_0x5b9e58['where']=qs[_0xa272('0x36')](_[_0xa272('0x3f')](_0x19d662[_0xa272('0x35')],_0x342431[_0xa272('0x36')]));if(_0x19d662['query'][_0xa272('0x40')]){_0x5b9e58[_0xa272('0x3e')]=_[_0xa272('0x41')](_0x5b9e58[_0xa272('0x3e')],{'$or':_[_0xa272('0x2f')](_0x5b9e58['attributes'],function(_0x12c236){var _0x5426c8={};_0x5426c8[_0x12c236]={'$like':'%'+_0x19d662[_0xa272('0x35')][_0xa272('0x40')]+'%'};return _0x5426c8;})});}_0x5b9e58=_['merge']({},_0x5b9e58,_0x19d662[_0xa272('0x43')]);return _0x117385['getAgents'](_0x5b9e58);}})[_0xa272('0x28')](function(_0x1243c8){if(_0x1243c8){_0x4e8e23=_0x1243c8[_0xa272('0x3b')];if(!_0x19d662['query']['hasOwnProperty'](_0xa272('0x3c'))){_0x5b9e58[_0xa272('0x1f')]=qs['limit'](_0x19d662[_0xa272('0x35')][_0xa272('0x1f')]);_0x5b9e58['offset']=qs['offset'](_0x19d662[_0xa272('0x35')][_0xa272('0x21')]);}return _0x117385['getAgents'](_0x5b9e58);}})['then'](function(_0x1283ca){if(_0x1283ca){return _0x1283ca?{'count':_0x4e8e23,'rows':_0x1283ca}:null;}})[_0xa272('0x28')](respondWithResult(_0x207666,null))[_0xa272('0x52')](handleError(_0x207666,null));}; \ No newline at end of file +var _0xe421=['updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','every','TeamId','includes','union','compact','value','removeAgents','omit','spread','isArray','userOpenchannelQueue:remove','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','send','index','map','OpenchannelQueue','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','agent','openchannelPause'];(function(_0x43606b,_0x2f2292){var _0xbfd21a=function(_0x2f28fa){while(--_0x2f28fa){_0x43606b['push'](_0x43606b['shift']());}};_0xbfd21a(++_0x2f2292);}(_0xe421,0x135));var _0x1e42=function(_0x279af0,_0x46274b){_0x279af0=_0x279af0-0x0;var _0x7ba67f=_0xe421[_0x279af0];return _0x7ba67f;};'use strict';var emlformat=require(_0x1e42('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1e42('0x1'));var moment=require(_0x1e42('0x2'));var BPromise=require(_0x1e42('0x3'));var Mustache=require(_0x1e42('0x4'));var util=require(_0x1e42('0x5'));var path=require('path');var sox=require(_0x1e42('0x6'));var csv=require(_0x1e42('0x7'));var ejs=require(_0x1e42('0x8'));var fs=require('fs');var fs_extra=require(_0x1e42('0x9'));var _=require(_0x1e42('0xa'));var squel=require(_0x1e42('0xb'));var crypto=require(_0x1e42('0xc'));var jsforce=require(_0x1e42('0xd'));var deskjs=require(_0x1e42('0xe'));var toCsv=require(_0x1e42('0x7'));var querystring=require(_0x1e42('0xf'));var Papa=require(_0x1e42('0x10'));var Redis=require(_0x1e42('0x11'));var authService=require(_0x1e42('0x12'));var qs=require(_0x1e42('0x13'));var as=require(_0x1e42('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1e42('0x15'));var config=require(_0x1e42('0x16'));var licenseUtil=require(_0x1e42('0x17'));var db=require(_0x1e42('0x18'))['db'];config[_0x1e42('0x19')]=_['defaults'](config[_0x1e42('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e42('0x1a'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x1e42('0x1b')](socket);function respondWithStatusCode(_0x4e9622,_0x2ec799){_0x2ec799=_0x2ec799||0xcc;return function(_0x3f7ec3){if(_0x3f7ec3){return _0x4e9622[_0x1e42('0x1c')](_0x2ec799);}return _0x4e9622[_0x1e42('0x1d')](_0x2ec799)['end']();};}function respondWithResult(_0x52c9dd,_0x3899d6){_0x3899d6=_0x3899d6||0xc8;return function(_0x26ed36){if(_0x26ed36){return _0x52c9dd['status'](_0x3899d6)['json'](_0x26ed36);}};}function respondWithFilteredResult(_0x270bfe,_0xf04292){return function(_0x4a4b73){if(_0x4a4b73){var _0x4bd075=typeof _0xf04292['offset']===_0x1e42('0x1e')&&typeof _0xf04292[_0x1e42('0x1f')]===_0x1e42('0x1e');var _0x3023c6=_0x4a4b73[_0x1e42('0x20')];var _0x3d68da=_0x4bd075?0x0:_0xf04292[_0x1e42('0x21')];var _0x35aa06=_0x4bd075?_0x4a4b73[_0x1e42('0x20')]:_0xf04292[_0x1e42('0x21')]+_0xf04292[_0x1e42('0x1f')];var _0x26e914;if(_0x35aa06>=_0x3023c6){_0x35aa06=_0x3023c6;_0x26e914=0xc8;}else{_0x26e914=0xce;}_0x270bfe[_0x1e42('0x1d')](_0x26e914);return _0x270bfe[_0x1e42('0x22')](_0x1e42('0x23'),_0x3d68da+'-'+_0x35aa06+'/'+_0x3023c6)[_0x1e42('0x24')](_0x4a4b73);}return null;};}function patchUpdates(_0x56c102){return function(_0x3dd4b4){try{jsonpatch[_0x1e42('0x25')](_0x3dd4b4,_0x56c102,!![]);}catch(_0x5108e7){return BPromise['reject'](_0x5108e7);}return _0x3dd4b4['save']();};}function saveUpdates(_0x23d88a,_0x5602df){return function(_0x2a2872){if(_0x2a2872){return _0x2a2872[_0x1e42('0x26')](_0x23d88a)[_0x1e42('0x27')](function(_0xa88f14){return _0xa88f14;});}return null;};}function removeEntity(_0x34f463,_0x1bb06d){return function(_0xe5c2b3){if(_0xe5c2b3){return _0xe5c2b3[_0x1e42('0x28')]()[_0x1e42('0x27')](function(){var _0x371a4a=_0xe5c2b3[_0x1e42('0x29')]({'plain':!![]});var _0x4b01bb=_0x1e42('0x2a');return db[_0x1e42('0x2b')][_0x1e42('0x28')]({'where':{'type':_0x4b01bb,'resourceId':_0x371a4a['id']}})[_0x1e42('0x27')](function(){return _0xe5c2b3;});})[_0x1e42('0x27')](function(){_0x34f463[_0x1e42('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e4848,_0x4668bb){return function(_0x372044){if(!_0x372044){_0x4e4848[_0x1e42('0x1c')](0x194);}return _0x372044;};}function handleError(_0x38df11,_0x5186f6){_0x5186f6=_0x5186f6||0x1f4;return function(_0xd6d926){logger[_0x1e42('0x2c')](_0xd6d926['stack']);if(_0xd6d926['name']){delete _0xd6d926[_0x1e42('0x2d')];}_0x38df11[_0x1e42('0x1d')](_0x5186f6)[_0x1e42('0x2e')](_0xd6d926);};}exports[_0x1e42('0x2f')]=function(_0x2cd380,_0x475c1d){var _0x250b77={},_0x4c5518={},_0x58741d={'count':0x0,'rows':[]};var _0x577820=_[_0x1e42('0x30')](db[_0x1e42('0x31')][_0x1e42('0x32')],function(_0xd1367b){return{'name':_0xd1367b['fieldName'],'type':_0xd1367b[_0x1e42('0x33')]['key']};});_0x4c5518[_0x1e42('0x34')]=_[_0x1e42('0x30')](_0x577820,_0x1e42('0x2d'));_0x4c5518[_0x1e42('0x35')]=_[_0x1e42('0x36')](_0x2cd380['query']);_0x4c5518['filters']=_[_0x1e42('0x37')](_0x4c5518[_0x1e42('0x34')],_0x4c5518['query']);_0x250b77[_0x1e42('0x38')]=_[_0x1e42('0x37')](_0x4c5518['model'],qs['fields'](_0x2cd380['query'][_0x1e42('0x39')]));_0x250b77[_0x1e42('0x38')]=_0x250b77['attributes'][_0x1e42('0x3a')]?_0x250b77[_0x1e42('0x38')]:_0x4c5518[_0x1e42('0x34')];if(!_0x2cd380[_0x1e42('0x35')][_0x1e42('0x3b')](_0x1e42('0x3c'))){_0x250b77[_0x1e42('0x1f')]=qs[_0x1e42('0x1f')](_0x2cd380[_0x1e42('0x35')][_0x1e42('0x1f')]);_0x250b77['offset']=qs['offset'](_0x2cd380['query']['offset']);}_0x250b77[_0x1e42('0x3d')]=qs[_0x1e42('0x3e')](_0x2cd380[_0x1e42('0x35')][_0x1e42('0x3e')]);_0x250b77[_0x1e42('0x3f')]=qs[_0x1e42('0x40')](_[_0x1e42('0x41')](_0x2cd380[_0x1e42('0x35')],_0x4c5518[_0x1e42('0x40')]),_0x577820);if(_0x2cd380[_0x1e42('0x35')][_0x1e42('0x42')]){_0x250b77[_0x1e42('0x3f')]=_[_0x1e42('0x43')](_0x250b77[_0x1e42('0x3f')],{'$or':_['map'](_0x577820,function(_0xf1b757){if(_0xf1b757[_0x1e42('0x33')]!=='VIRTUAL'){var _0x17bb60={};_0x17bb60[_0xf1b757[_0x1e42('0x2d')]]={'$like':'%'+_0x2cd380[_0x1e42('0x35')][_0x1e42('0x42')]+'%'};return _0x17bb60;}})});}_0x250b77=_[_0x1e42('0x43')]({},_0x250b77,_0x2cd380[_0x1e42('0x44')]);var _0x228e50={'where':_0x250b77[_0x1e42('0x3f')]};return db[_0x1e42('0x31')]['count'](_0x228e50)['then'](function(_0x4db7b6){_0x58741d[_0x1e42('0x20')]=_0x4db7b6;if(_0x2cd380[_0x1e42('0x35')][_0x1e42('0x45')]){_0x250b77[_0x1e42('0x46')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x1e42('0x47')](_0x250b77);})[_0x1e42('0x27')](function(_0x1f3b96){_0x58741d[_0x1e42('0x48')]=_0x1f3b96;return _0x58741d;})['then'](respondWithFilteredResult(_0x475c1d,_0x250b77))[_0x1e42('0x49')](handleError(_0x475c1d,null));};exports[_0x1e42('0x4a')]=function(_0x39ae26,_0x3ddb5d){var _0x4e440f={'raw':!![],'where':{'id':_0x39ae26[_0x1e42('0x4b')]['id']}},_0x163c39={};_0x163c39[_0x1e42('0x34')]=_[_0x1e42('0x36')](db[_0x1e42('0x31')][_0x1e42('0x32')]);_0x163c39[_0x1e42('0x35')]=_[_0x1e42('0x36')](_0x39ae26['query']);_0x163c39[_0x1e42('0x40')]=_[_0x1e42('0x37')](_0x163c39[_0x1e42('0x34')],_0x163c39[_0x1e42('0x35')]);_0x4e440f[_0x1e42('0x38')]=_[_0x1e42('0x37')](_0x163c39[_0x1e42('0x34')],qs['fields'](_0x39ae26[_0x1e42('0x35')][_0x1e42('0x39')]));_0x4e440f[_0x1e42('0x38')]=_0x4e440f[_0x1e42('0x38')][_0x1e42('0x3a')]?_0x4e440f[_0x1e42('0x38')]:_0x163c39[_0x1e42('0x34')];if(_0x39ae26[_0x1e42('0x35')][_0x1e42('0x45')]){_0x4e440f[_0x1e42('0x46')]=[{'all':!![]}];}_0x4e440f=_[_0x1e42('0x43')]({},_0x4e440f,_0x39ae26['options']);return db[_0x1e42('0x31')][_0x1e42('0x4c')](_0x4e440f)[_0x1e42('0x27')](handleEntityNotFound(_0x3ddb5d,null))[_0x1e42('0x27')](respondWithResult(_0x3ddb5d,null))[_0x1e42('0x49')](handleError(_0x3ddb5d,null));};exports[_0x1e42('0x4d')]=function(_0x2aea5a,_0x62b90d){return db[_0x1e42('0x31')][_0x1e42('0x4d')](_0x2aea5a[_0x1e42('0x4e')],{})[_0x1e42('0x27')](function(_0xe0bdda){var _0xd676e9=_0x2aea5a['user'][_0x1e42('0x29')]({'plain':!![]});if(!_0xd676e9)throw new Error(_0x1e42('0x4f'));if(_0xd676e9[_0x1e42('0x50')]===_0x1e42('0x51')){var _0x5f1434=_0xe0bdda[_0x1e42('0x29')]({'plain':!![]});var _0x2b578c=_0x1e42('0x2a');return db[_0x1e42('0x52')][_0x1e42('0x4c')]({'where':{'name':_0x2b578c,'userProfileId':_0xd676e9['userProfileId']},'raw':!![]})[_0x1e42('0x27')](function(_0x2e8ff3){if(_0x2e8ff3&&_0x2e8ff3[_0x1e42('0x53')]===0x0){return db[_0x1e42('0x2b')]['create']({'name':_0x5f1434[_0x1e42('0x2d')],'resourceId':_0x5f1434['id'],'type':_0x2e8ff3[_0x1e42('0x2d')],'sectionId':_0x2e8ff3['id']},{})[_0x1e42('0x27')](function(){return _0xe0bdda;});}else{return _0xe0bdda;}})['catch'](function(_0xeb79bc){logger['error'](_0x1e42('0x54'),_0xeb79bc);throw _0xeb79bc;});}return _0xe0bdda;})['then'](respondWithResult(_0x62b90d,0xc9))['catch'](handleError(_0x62b90d,null));};exports[_0x1e42('0x26')]=function(_0x34a3c5,_0x2b3a4a){if(_0x34a3c5[_0x1e42('0x4e')]['id']){delete _0x34a3c5['body']['id'];}return db[_0x1e42('0x31')][_0x1e42('0x4c')]({'where':{'id':_0x34a3c5[_0x1e42('0x4b')]['id']}})[_0x1e42('0x27')](handleEntityNotFound(_0x2b3a4a,null))[_0x1e42('0x27')](saveUpdates(_0x34a3c5['body'],null))[_0x1e42('0x27')](respondWithResult(_0x2b3a4a,null))[_0x1e42('0x49')](handleError(_0x2b3a4a,null));};exports[_0x1e42('0x28')]=function(_0x233ae5,_0x5bb5cc){return db[_0x1e42('0x31')][_0x1e42('0x4c')]({'where':{'id':_0x233ae5[_0x1e42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5bb5cc,null))[_0x1e42('0x27')](removeEntity(_0x5bb5cc,null))[_0x1e42('0x49')](handleError(_0x5bb5cc,null));};exports[_0x1e42('0x55')]=function(_0xfa7aa7,_0x106ba2){return db[_0x1e42('0x31')][_0x1e42('0x55')]()[_0x1e42('0x27')](respondWithResult(_0x106ba2,null))['catch'](handleError(_0x106ba2,null));};exports['getMembers']=function(_0x30aca7,_0x77c63a,_0x18cdbd){var _0x4e3361={'raw':!![],'where':{}},_0x93bcd8={},_0x242393;return db['OpenchannelQueue'][_0x1e42('0x56')]({'where':{'id':_0x30aca7['params']['id']}})[_0x1e42('0x27')](handleEntityNotFound(_0x77c63a,null))['then'](function(_0x35650){if(_0x35650){_0x242393=_0x35650[_0x1e42('0x29')]({'plain':!![]});_0x93bcd8['model']=_['keys'](db[_0x1e42('0x57')][_0x1e42('0x32')]);_0x93bcd8[_0x1e42('0x35')]=_[_0x1e42('0x36')](_0x30aca7['query']);_0x93bcd8['filters']=_[_0x1e42('0x37')](_0x93bcd8[_0x1e42('0x34')],_0x93bcd8[_0x1e42('0x35')]);_0x4e3361[_0x1e42('0x38')]=_[_0x1e42('0x37')](_0x93bcd8[_0x1e42('0x34')],qs['fields'](_0x30aca7[_0x1e42('0x35')][_0x1e42('0x39')]));_0x4e3361['attributes']=_0x4e3361[_0x1e42('0x38')]['length']?_0x4e3361['attributes']:_0x93bcd8[_0x1e42('0x34')];if(!_0x30aca7[_0x1e42('0x35')][_0x1e42('0x3b')](_0x1e42('0x3c'))){_0x4e3361['limit']=qs[_0x1e42('0x1f')](_0x30aca7[_0x1e42('0x35')]['limit']);_0x4e3361[_0x1e42('0x21')]=qs[_0x1e42('0x21')](_0x30aca7[_0x1e42('0x35')]['offset']);}_0x4e3361['order']=qs[_0x1e42('0x3e')](_0x30aca7[_0x1e42('0x35')][_0x1e42('0x3e')]);_0x4e3361[_0x1e42('0x3f')]=qs[_0x1e42('0x40')](_[_0x1e42('0x41')](_0x30aca7[_0x1e42('0x35')],_0x93bcd8['filters']));_0x4e3361[_0x1e42('0x3f')][_0x1e42('0x58')]=_0x35650['id'];if(_0x30aca7[_0x1e42('0x35')][_0x1e42('0x42')]){_0x4e3361[_0x1e42('0x3f')]=_[_0x1e42('0x43')](_0x4e3361[_0x1e42('0x3f')],{'$or':_['map'](_0x4e3361['attributes'],function(_0x124f1c){var _0x568133={};_0x568133[_0x124f1c]={'$like':'%'+_0x30aca7[_0x1e42('0x35')][_0x1e42('0x42')]+'%'};return _0x568133;})});}_0x4e3361=_[_0x1e42('0x43')]({},_0x4e3361,_0x30aca7[_0x1e42('0x44')]);return db[_0x1e42('0x57')][_0x1e42('0x47')](_0x4e3361);}})[_0x1e42('0x27')](function(_0x655982){if(_0x655982){return db[_0x1e42('0x59')]['findAndCountAll']({'where':{'id':_['map'](_0x655982,_0x1e42('0x5a')),'role':_0x1e42('0x5b')},'attributes':['id',_0x1e42('0x2d'),_0x1e42('0x5c'),_0x1e42('0x5d'),'createdAt']});}})[_0x1e42('0x27')](function(_0x49eb13){if(_0x49eb13){return{'count':_0x49eb13[_0x1e42('0x20')],'rows':_['map'](_0x49eb13[_0x1e42('0x48')],function(_0x4d1c5c){return{'membername':_0x4d1c5c[_0x1e42('0x2d')],'UserId':_0x4d1c5c['id'],'queue_name':_0x242393[_0x1e42('0x2d')],'OpenchannelQueueId':_0x242393['id'],'interface':util[_0x1e42('0x5e')](_0x1e42('0x5f'),_0x1e42('0x60'),_0x4d1c5c[_0x1e42('0x2d')]),'penalty':0x0,'paused':_0x4d1c5c['openchannelPause'],'createdAt':_0x4d1c5c[_0x1e42('0x61')],'updatedAt':_0x4d1c5c[_0x1e42('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1e42('0x27')](respondWithFilteredResult(_0x77c63a,_0x4e3361))[_0x1e42('0x49')](handleError(_0x77c63a,null));};exports[_0x1e42('0x62')]=function(_0x49a2fd,_0x149a77,_0x4395e4){var _0x1a707e={};var _0x2b9eec={};var _0x4c55d5;var _0x1d8fcb;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x49a2fd[_0x1e42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x149a77,null))['then'](function(_0x48b567){if(_0x48b567){_0x4c55d5=_0x48b567;_0x2b9eec[_0x1e42('0x34')]=_[_0x1e42('0x36')](db[_0x1e42('0x63')][_0x1e42('0x32')]);_0x2b9eec[_0x1e42('0x35')]=_['keys'](_0x49a2fd['query']);_0x2b9eec['filters']=_[_0x1e42('0x37')](_0x2b9eec['model'],_0x2b9eec[_0x1e42('0x35')]);_0x1a707e[_0x1e42('0x38')]=_['intersection'](_0x2b9eec[_0x1e42('0x34')],qs[_0x1e42('0x39')](_0x49a2fd[_0x1e42('0x35')][_0x1e42('0x39')]));_0x1a707e[_0x1e42('0x38')]=_0x1a707e['attributes'][_0x1e42('0x3a')]?_0x1a707e[_0x1e42('0x38')]:_0x2b9eec[_0x1e42('0x34')];_0x1a707e[_0x1e42('0x3d')]=qs[_0x1e42('0x3e')](_0x49a2fd['query'][_0x1e42('0x3e')]);_0x1a707e['where']=qs[_0x1e42('0x40')](_[_0x1e42('0x41')](_0x49a2fd[_0x1e42('0x35')],_0x2b9eec[_0x1e42('0x40')]));if(_0x49a2fd[_0x1e42('0x35')]['filter']){_0x1a707e[_0x1e42('0x3f')]=_[_0x1e42('0x43')](_0x1a707e[_0x1e42('0x3f')],{'$or':_[_0x1e42('0x30')](_0x1a707e['attributes'],function(_0x1f5c55){var _0x3f0775={};_0x3f0775[_0x1f5c55]={'$like':'%'+_0x49a2fd[_0x1e42('0x35')]['filter']+'%'};return _0x3f0775;})});}_0x1a707e=_[_0x1e42('0x43')]({},_0x1a707e,_0x49a2fd[_0x1e42('0x44')]);return _0x4c55d5[_0x1e42('0x62')](_0x1a707e);}})['then'](function(_0x16f8f8){if(_0x16f8f8){_0x1d8fcb=_0x16f8f8[_0x1e42('0x3a')];if(!_0x49a2fd[_0x1e42('0x35')]['hasOwnProperty'](_0x1e42('0x3c'))){_0x1a707e[_0x1e42('0x1f')]=qs[_0x1e42('0x1f')](_0x49a2fd['query'][_0x1e42('0x1f')]);_0x1a707e[_0x1e42('0x21')]=qs[_0x1e42('0x21')](_0x49a2fd[_0x1e42('0x35')]['offset']);}return _0x4c55d5['getTeams'](_0x1a707e);}})['then'](function(_0x5d10c2){if(_0x5d10c2){return _0x5d10c2?{'count':_0x1d8fcb,'rows':_0x5d10c2}:null;}})[_0x1e42('0x27')](respondWithResult(_0x149a77,null))[_0x1e42('0x49')](handleError(_0x149a77,null));};exports[_0x1e42('0x64')]=function(_0x3eba74,_0x20ae7f,_0x406ad7){var _0x20833d=_0x3eba74['body'][_0x1e42('0x65')];return db['Team'][_0x1e42('0x47')]({'where':{'id':_0x20833d},'attributes':['id'],'include':[{'model':db[_0x1e42('0x59')],'as':_0x1e42('0x66'),'attributes':['id',_0x1e42('0x2d'),'online',_0x1e42('0x67'),_0x1e42('0x68')],'raw':!![]}]})[_0x1e42('0x27')](function(_0x21c452){if(_0x21c452){var _0x371be7=_[_0x1e42('0x69')](_0x21c452,function(_0x51a9a7){var _0x33296f=_0x51a9a7[_0x1e42('0x29')]({'plain':!![]});return _0x33296f[_0x1e42('0x66')];});return db[_0x1e42('0x31')]['find']({'where':{'id':_0x3eba74[_0x1e42('0x4b')]['id']}})[_0x1e42('0x27')](function(_0x59ac83){return db['sequelize']['transaction'](function(_0x526870){return _0x59ac83[_0x1e42('0x64')](_0x20833d,{'transaction':_0x526870})[_0x1e42('0x27')](function(){return BPromise[_0x1e42('0x6a')](_0x371be7,function(_0x3d2f47){return db[_0x1e42('0x57')][_0x1e42('0x6b')]({'where':{'UserId':_0x3d2f47['id'],'OpenchannelQueueId':_0x3eba74['params']['id']},'transaction':_0x526870});});})[_0x1e42('0x27')](function(){_0x371be7[_0x1e42('0x6c')](function(_0x720d4e){socket[_0x1e42('0x6d')](_0x1e42('0x6e'),{'UserId':_0x720d4e['id'],'OpenchannelQueueId':_0x59ac83['id']});});});});});}})[_0x1e42('0x27')](respondWithStatusCode(_0x20ae7f,null))['catch'](handleError(_0x20ae7f,null));};exports[_0x1e42('0x6f')]=function(_0x1321d6,_0x2d95e6,_0x1102d2){return db['Team'][_0x1e42('0x47')]({'where':{'id':_0x1321d6[_0x1e42('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1e42('0x59')],'as':_0x1e42('0x66'),'attributes':['id'],'raw':!![]}]})[_0x1e42('0x27')](handleEntityNotFound(_0x2d95e6,null))[_0x1e42('0x27')](function(_0x48abc7){var _0x3aa094=_[_0x1e42('0x30')](_0x48abc7,'id');var _0x1588a3=[];var _0x21664d=[];var _0x5b4919=squel[_0x1e42('0x70')]();_0x5b4919['field'](_0x1e42('0x71'))['from'](_0x1e42('0x72'),'tq')[_0x1e42('0x73')](_0x1e42('0x74'),'ut',_0x1e42('0x75'))[_0x1e42('0x3f')]('OpenchannelQueueId\x20=\x20?',_0x1321d6[_0x1e42('0x4b')]['id']);for(var _0x4cf373=0x0;_0x4cf373<_0x48abc7[_0x1e42('0x3a')];_0x4cf373+=0x1){let _0x2bf8ad=_0x48abc7[_0x4cf373];for(var _0x4acb15=0x0;_0x4acb15<_0x2bf8ad['Agents'][_0x1e42('0x3a')];_0x4acb15+=0x1){let _0x321ae0=_0x2bf8ad[_0x1e42('0x66')][_0x4acb15];var _0x44dc77=_0x5b4919[_0x1e42('0x76')]();_0x44dc77[_0x1e42('0x3f')]('ut.UserId\x20=\x20?',_0x321ae0['id']);_0x21664d[_0x1e42('0x77')](db[_0x1e42('0x78')]['query'](_0x44dc77[_0x1e42('0x79')](),{'type':db[_0x1e42('0x78')][_0x1e42('0x7a')]['SELECT']})[_0x1e42('0x27')](function(_0x1d5747){if(_0x1d5747['length']===0x1){return _0x321ae0['id'];}else{var _0x38c2ea=_[_0x1e42('0x7b')](_['map'](_0x1d5747,_0x1e42('0x7c')),function(_0xa5e7f2){return _[_0x1e42('0x7d')](_0x3aa094,_0xa5e7f2);});if(_0x38c2ea){return _0x321ae0['id'];}}}));}}return BPromise['all'](_0x21664d)[_0x1e42('0x27')](function(_0xed91fd){_0x1588a3=_(_0x1588a3)[_0x1e42('0x7e')](_0xed91fd)[_0x1e42('0x7f')]()[_0x1e42('0x80')]();return db[_0x1e42('0x31')][_0x1e42('0x4c')]({'where':{'id':_0x1321d6[_0x1e42('0x4b')]['id']}})['then'](function(_0x4ab047){return db[_0x1e42('0x78')]['transaction'](function(_0x963173){return _0x4ab047['removeTeams'](_0x1321d6['query'][_0x1e42('0x65')],{'transaction':_0x963173})[_0x1e42('0x27')](function(){if(!_['isEmpty'](_0x1588a3)){return _0x4ab047[_0x1e42('0x81')](_0x1588a3,{'transaction':_0x963173});}})[_0x1e42('0x27')](function(){_0x1588a3[_0x1e42('0x6c')](function(_0x458a69){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x458a69,'OpenchannelQueueId':_0x4ab047['id']});});});});});});})[_0x1e42('0x27')](respondWithStatusCode(_0x2d95e6,null))[_0x1e42('0x49')](handleError(_0x2d95e6,null));};exports['addAgents']=function(_0x521f65,_0x17fd2d,_0x1aeb56){return db['OpenchannelQueue'][_0x1e42('0x4c')]({'where':{'id':_0x521f65[_0x1e42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x17fd2d,null))['then'](function(_0x32232d){if(_0x32232d){return _0x32232d['addAgents'](_0x521f65[_0x1e42('0x4e')]['ids'],_[_0x1e42('0x82')](_0x521f65[_0x1e42('0x4e')],[_0x1e42('0x65'),'id'])||{})[_0x1e42('0x83')](function(_0x574de0){for(var _0x1aa649=0x0;_0x1aa649<_0x521f65[_0x1e42('0x4e')]['ids'][_0x1e42('0x3a')];_0x1aa649+=0x1){socket[_0x1e42('0x6d')](_0x1e42('0x6e'),{'UserId':Number(_0x521f65[_0x1e42('0x4e')][_0x1e42('0x65')][_0x1aa649]),'OpenchannelQueueId':Number(_0x521f65[_0x1e42('0x4b')]['id'])});}return _0x574de0;});}})[_0x1e42('0x27')](respondWithResult(_0x17fd2d,null))['catch'](handleError(_0x17fd2d,null));};exports[_0x1e42('0x81')]=function(_0x30967b,_0x2cd3ba,_0x12db84){return db[_0x1e42('0x31')][_0x1e42('0x4c')]({'where':{'id':_0x30967b['params']['id']}})[_0x1e42('0x27')](handleEntityNotFound(_0x2cd3ba,null))[_0x1e42('0x27')](function(_0x9a1c09){if(_0x9a1c09){return _0x9a1c09[_0x1e42('0x81')](_0x30967b[_0x1e42('0x35')][_0x1e42('0x65')])[_0x1e42('0x27')](function(){if(_[_0x1e42('0x84')](_0x30967b[_0x1e42('0x35')][_0x1e42('0x65')])){for(var _0x3780a2=0x0;_0x3780a2<_0x30967b[_0x1e42('0x35')][_0x1e42('0x65')][_0x1e42('0x3a')];_0x3780a2+=0x1){socket['emit'](_0x1e42('0x85'),{'UserId':Number(_0x30967b[_0x1e42('0x35')][_0x1e42('0x65')][_0x3780a2]),'OpenchannelQueueId':Number(_0x30967b[_0x1e42('0x4b')]['id'])});}}else{socket[_0x1e42('0x6d')](_0x1e42('0x85'),{'UserId':Number(_0x30967b['query']['ids']),'OpenchannelQueueId':Number(_0x30967b['params']['id'])});}});}})[_0x1e42('0x27')](respondWithStatusCode(_0x2cd3ba,null))[_0x1e42('0x49')](handleError(_0x2cd3ba,null));};exports['getAgents']=function(_0x37f003,_0x4358f2,_0x59f49a){var _0x4fb251={};var _0x247b57={};var _0x213cd6;var _0x3712b3;return db['OpenchannelQueue'][_0x1e42('0x56')]({'where':{'id':_0x37f003[_0x1e42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4358f2,null))[_0x1e42('0x27')](function(_0x56f5ac){if(_0x56f5ac){_0x213cd6=_0x56f5ac;_0x247b57[_0x1e42('0x34')]=_[_0x1e42('0x36')](db[_0x1e42('0x59')][_0x1e42('0x32')]);_0x247b57[_0x1e42('0x35')]=_[_0x1e42('0x36')](_0x37f003[_0x1e42('0x35')]);_0x247b57[_0x1e42('0x40')]=_[_0x1e42('0x37')](_0x247b57[_0x1e42('0x34')],_0x247b57[_0x1e42('0x35')]);_0x4fb251[_0x1e42('0x38')]=_[_0x1e42('0x37')](_0x247b57[_0x1e42('0x34')],qs['fields'](_0x37f003['query'][_0x1e42('0x39')]));_0x4fb251[_0x1e42('0x38')]=_0x4fb251[_0x1e42('0x38')][_0x1e42('0x3a')]?_0x4fb251[_0x1e42('0x38')]:_0x247b57['model'];_0x4fb251[_0x1e42('0x3d')]=qs[_0x1e42('0x3e')](_0x37f003[_0x1e42('0x35')]['sort']);_0x4fb251[_0x1e42('0x3f')]=qs[_0x1e42('0x40')](_[_0x1e42('0x41')](_0x37f003[_0x1e42('0x35')],_0x247b57['filters']));if(_0x37f003[_0x1e42('0x35')]['filter']){_0x4fb251[_0x1e42('0x3f')]=_[_0x1e42('0x43')](_0x4fb251[_0x1e42('0x3f')],{'$or':_['map'](_0x4fb251[_0x1e42('0x38')],function(_0x2f54e7){var _0x4631e6={};_0x4631e6[_0x2f54e7]={'$like':'%'+_0x37f003[_0x1e42('0x35')]['filter']+'%'};return _0x4631e6;})});}_0x4fb251=_[_0x1e42('0x43')]({},_0x4fb251,_0x37f003[_0x1e42('0x44')]);return _0x213cd6['getAgents'](_0x4fb251);}})[_0x1e42('0x27')](function(_0x12b254){if(_0x12b254){_0x3712b3=_0x12b254[_0x1e42('0x3a')];if(!_0x37f003['query'][_0x1e42('0x3b')]('nolimit')){_0x4fb251['limit']=qs['limit'](_0x37f003[_0x1e42('0x35')][_0x1e42('0x1f')]);_0x4fb251[_0x1e42('0x21')]=qs[_0x1e42('0x21')](_0x37f003['query']['offset']);}return _0x213cd6['getAgents'](_0x4fb251);}})[_0x1e42('0x27')](function(_0x4185ff){if(_0x4185ff){return _0x4185ff?{'count':_0x3712b3,'rows':_0x4185ff}:null;}})[_0x1e42('0x27')](respondWithResult(_0x4358f2,null))['catch'](handleError(_0x4358f2,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 39be51f..01b1df6 100644 --- a/server/api/openchannelQueue/openchannelQueue.events.js +++ b/server/api/openchannelQueue/openchannelQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4d5=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x4ee89a,_0x56d642){var _0x42aca9=function(_0xa1f425){while(--_0xa1f425){_0x4ee89a['push'](_0x4ee89a['shift']());}};_0x42aca9(++_0x56d642);}(_0xd4d5,0x15d));var _0x5d4d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd4d5[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0x5d4d('0x0'));var OpenchannelQueue=require(_0x5d4d('0x1'))['db'][_0x5d4d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5d4d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1863fe){return function(_0x2efb93,_0x49d579,_0x1cd689){OpenchannelQueueEvents['emit'](_0x1863fe+':'+_0x2efb93['id'],_0x2efb93);OpenchannelQueueEvents[_0x5d4d('0x4')](_0x1863fe,_0x2efb93);_0x1cd689(null);};}for(var e in events){if(events[_0x5d4d('0x5')](e)){var event=events[e];OpenchannelQueue[_0x5d4d('0x6')](e,emitEvent(event));}}module[_0x5d4d('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x709a=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit','hook','exports'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x709a,0x90));var _0xa709=function(_0x1c4063,_0x31c873){_0x1c4063=_0x1c4063-0x0;var _0x2cf6aa=_0x709a[_0x1c4063];return _0x2cf6aa;};'use strict';var EventEmitter=require(_0xa709('0x0'));var OpenchannelQueue=require(_0xa709('0x1'))['db'][_0xa709('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa709('0x3')](0x0);var events={'afterCreate':_0xa709('0x4'),'afterUpdate':_0xa709('0x5'),'afterDestroy':'remove'};function emitEvent(_0xc584ff){return function(_0x1b4878,_0x16e5ef,_0xecbc0d){OpenchannelQueueEvents[_0xa709('0x6')](_0xc584ff+':'+_0x1b4878['id'],_0x1b4878);OpenchannelQueueEvents[_0xa709('0x6')](_0xc584ff,_0x1b4878);_0xecbc0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xa709('0x7')](e,emitEvent(event));}}module[_0xa709('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 9f515be..2423261 100644 --- a/server/api/openchannelQueue/openchannelQueue.model.js +++ b/server/api/openchannelQueue/openchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x009c=['exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','moment','request-promise','path','./openchannelQueue.attributes'];(function(_0x373d4f,_0x33e53d){var _0x54054d=function(_0x389988){while(--_0x389988){_0x373d4f['push'](_0x373d4f['shift']());}};_0x54054d(++_0x33e53d);}(_0x009c,0x7d));var _0xc009=function(_0x273b4b,_0x4ce452){_0x273b4b=_0x273b4b-0x0;var _0x53eaae=_0x009c[_0x273b4b];return _0x53eaae;};'use strict';var _=require(_0xc009('0x0'));var util=require(_0xc009('0x1'));var logger=require(_0xc009('0x2'))('api');var moment=require(_0xc009('0x3'));var BPromise=require('bluebird');var rp=require(_0xc009('0x4'));var fs=require('fs');var path=require(_0xc009('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc009('0x6'));module[_0xc009('0x7')]=function(_0x370aea,_0x1e0b92){return _0x370aea[_0xc009('0x8')](_0xc009('0x9'),attributes,{'tableName':_0xc009('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa874=['api','moment','bluebird','request-promise','path','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger'];(function(_0x4ea24b,_0xa3260b){var _0x4b3ae5=function(_0x4071fd){while(--_0x4071fd){_0x4ea24b['push'](_0x4ea24b['shift']());}};_0x4b3ae5(++_0xa3260b);}(_0xa874,0xf4));var _0x4a87=function(_0x49d450,_0x21f810){_0x49d450=_0x49d450-0x0;var _0x4da56f=_0xa874[_0x49d450];return _0x4da56f;};'use strict';var _=require(_0x4a87('0x0'));var util=require(_0x4a87('0x1'));var logger=require(_0x4a87('0x2'))(_0x4a87('0x3'));var moment=require(_0x4a87('0x4'));var BPromise=require(_0x4a87('0x5'));var rp=require(_0x4a87('0x6'));var fs=require('fs');var path=require(_0x4a87('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4a87('0x8'));module[_0x4a87('0x9')]=function(_0x1c3d67,_0x52956d){return _0x1c3d67[_0x4a87('0xa')](_0x4a87('0xb'),attributes,{'tableName':_0x4a87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 8e3a625..eb42c33 100644 --- a/server/api/openchannelQueue/openchannelQueue.rpc.js +++ b/server/api/openchannelQueue/openchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99e4=['then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket'];(function(_0x232d09,_0x30a518){var _0x454385=function(_0x3a5fdd){while(--_0x3a5fdd){_0x232d09['push'](_0x232d09['shift']());}};_0x454385(++_0x30a518);}(_0x99e4,0x13e));var _0x499e=function(_0x494bab,_0x1f0c5f){_0x494bab=_0x494bab-0x0;var _0x3bde9c=_0x99e4[_0x494bab];return _0x3bde9c;};'use strict';var _=require(_0x499e('0x0'));var util=require(_0x499e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x499e('0x2'));var fs=require('fs');var Redis=require(_0x499e('0x3'));var db=require(_0x499e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x499e('0x5'))(_0x499e('0x6'));var config=require(_0x499e('0x7'));var jayson=require(_0x499e('0x8'));var client=jayson[_0x499e('0x9')][_0x499e('0xa')]({'port':0x232a});config[_0x499e('0xb')]=_[_0x499e('0xc')](config[_0x499e('0xb')],{'host':_0x499e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x499e('0xb')]));require(_0x499e('0xe'))['register'](socket);function respondWithRpcPromise(_0x48055a,_0x178906,_0x40e3ee){return new BPromise(function(_0x3f9c69,_0x551b01){return client['request'](_0x48055a,_0x40e3ee)[_0x499e('0xf')](function(_0x22cfdd){logger[_0x499e('0x10')](_0x499e('0x11'),_0x178906,_0x499e('0x12'));logger[_0x499e('0x13')](_0x499e('0x14'),_0x178906,'request\x20sent',JSON[_0x499e('0x15')](_0x22cfdd));if(_0x22cfdd['error']){if(_0x22cfdd[_0x499e('0x16')]['code']===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x178906,_0x22cfdd[_0x499e('0x16')][_0x499e('0x17')]);return _0x551b01(_0x22cfdd[_0x499e('0x16')][_0x499e('0x17')]);}logger[_0x499e('0x16')](_0x499e('0x11'),_0x178906,_0x22cfdd['error']['message']);return _0x3f9c69(_0x22cfdd[_0x499e('0x16')][_0x499e('0x17')]);}else{logger['info'](_0x499e('0x11'),_0x178906,_0x499e('0x12'));_0x3f9c69(_0x22cfdd[_0x499e('0x18')][_0x499e('0x17')]);}})[_0x499e('0x19')](function(_0x23e8fe){logger[_0x499e('0x16')](_0x499e('0x11'),_0x178906,_0x23e8fe);_0x551b01(_0x23e8fe);});});}exports[_0x499e('0x1a')]=function(_0x653665){var _0x3908fb=this;return new Promise(function(_0x578a6c,_0x478ddd){return db['OpenchannelQueue'][_0x499e('0x1b')]({'raw':_0x653665[_0x499e('0x1c')]?_0x653665[_0x499e('0x1c')][_0x499e('0x1d')]===undefined?!![]:![]:!![],'where':_0x653665[_0x499e('0x1c')]?_0x653665[_0x499e('0x1c')][_0x499e('0x1e')]||null:null,'attributes':_0x653665[_0x499e('0x1c')]?_0x653665[_0x499e('0x1c')][_0x499e('0x1f')]||null:null,'limit':_0x653665[_0x499e('0x1c')]?_0x653665['options'][_0x499e('0x20')]||null:null,'include':_0x653665[_0x499e('0x1c')]?_0x653665[_0x499e('0x1c')][_0x499e('0x21')]?_[_0x499e('0x22')](_0x653665[_0x499e('0x1c')][_0x499e('0x21')],function(_0x14fc7e){return{'model':db[_0x14fc7e[_0x499e('0x23')]],'as':_0x14fc7e['as'],'attributes':_0x14fc7e['attributes'],'include':_0x14fc7e['include']?_[_0x499e('0x22')](_0x14fc7e[_0x499e('0x21')],function(_0x145280){return{'model':db[_0x145280['model']],'as':_0x145280['as'],'attributes':_0x145280[_0x499e('0x1f')],'include':_0x145280[_0x499e('0x21')]?_[_0x499e('0x22')](_0x145280[_0x499e('0x21')],function(_0x43a100){return{'model':db[_0x43a100[_0x499e('0x23')]],'as':_0x43a100['as'],'attributes':_0x43a100['attributes']};}):[]};}):[]};}):[]:[]})[_0x499e('0xf')](function(_0x499ebb){logger['info']('GetOpenchannelQueue',_0x653665);logger['debug']('GetOpenchannelQueue',_0x653665,JSON[_0x499e('0x15')](_0x499ebb));_0x578a6c(_0x499ebb);})[_0x499e('0x19')](function(_0x1f7608){logger[_0x499e('0x16')](_0x499e('0x1a'),_0x1f7608['message'],_0x653665);_0x478ddd(_0x3908fb[_0x499e('0x16')](0x1f4,_0x1f7608[_0x499e('0x17')]));});});};exports[_0x499e('0x24')]=function(_0x55c8a4){var _0x4ea133=this;return new Promise(function(_0x5c0ec4,_0x21e485){return db['OpenchannelQueue']['find']({'raw':_0x55c8a4[_0x499e('0x1c')]?_0x55c8a4[_0x499e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x55c8a4[_0x499e('0x1c')]?_0x55c8a4[_0x499e('0x1c')][_0x499e('0x1e')]||null:null,'attributes':_0x55c8a4[_0x499e('0x1c')]?_0x55c8a4[_0x499e('0x1c')][_0x499e('0x1f')]||null:null,'include':_0x55c8a4[_0x499e('0x1c')]?_0x55c8a4[_0x499e('0x1c')]['include']?_['map'](_0x55c8a4['options'][_0x499e('0x21')],function(_0x8c025d){return{'model':db[_0x8c025d['model']],'as':_0x8c025d['as'],'attributes':_0x8c025d[_0x499e('0x1f')],'include':_0x8c025d[_0x499e('0x21')]?_['map'](_0x8c025d['include'],function(_0x24f8b7){return{'model':db[_0x24f8b7[_0x499e('0x23')]],'as':_0x24f8b7['as'],'attributes':_0x24f8b7['attributes'],'include':_0x24f8b7[_0x499e('0x21')]?_[_0x499e('0x22')](_0x24f8b7[_0x499e('0x21')],function(_0x2294a0){return{'model':db[_0x2294a0[_0x499e('0x23')]],'as':_0x2294a0['as'],'attributes':_0x2294a0[_0x499e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x145767){logger[_0x499e('0x10')](_0x499e('0x24'),_0x55c8a4);logger['debug'](_0x499e('0x24'),_0x55c8a4,JSON[_0x499e('0x15')](_0x145767));_0x5c0ec4(_0x145767);})[_0x499e('0x19')](function(_0x382ae1){logger[_0x499e('0x16')](_0x499e('0x24'),_0x382ae1['message'],_0x55c8a4);_0x21e485(_0x4ea133[_0x499e('0x16')](0x1f4,_0x382ae1[_0x499e('0x17')]));});});}; \ No newline at end of file +var _0xf416=['model','attributes','then','GetOpenchannelQueue','ShowOpenchannelQueue','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','OpenchannelQueue','findAll','options','raw','limit','include','map'];(function(_0x14f55c,_0x2adaaf){var _0x513e7a=function(_0x1d8145){while(--_0x1d8145){_0x14f55c['push'](_0x14f55c['shift']());}};_0x513e7a(++_0x2adaaf);}(_0xf416,0xd4));var _0x6f41=function(_0x2ffb28,_0xf36357){_0x2ffb28=_0x2ffb28-0x0;var _0x2cf42e=_0xf416[_0x2ffb28];return _0x2cf42e;};'use strict';var _=require(_0x6f41('0x0'));var util=require('util');var moment=require(_0x6f41('0x1'));var BPromise=require('bluebird');var rs=require(_0x6f41('0x2'));var fs=require('fs');var Redis=require(_0x6f41('0x3'));var db=require(_0x6f41('0x4'))['db'];var utils=require(_0x6f41('0x5'));var logger=require(_0x6f41('0x6'))(_0x6f41('0x7'));var config=require(_0x6f41('0x8'));var jayson=require(_0x6f41('0x9'));var client=jayson[_0x6f41('0xa')][_0x6f41('0xb')]({'port':0x232a});config[_0x6f41('0xc')]=_[_0x6f41('0xd')](config[_0x6f41('0xc')],{'host':_0x6f41('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6f41('0xf'))['register'](socket);function respondWithRpcPromise(_0x194028,_0x191cf4,_0x4b7bbf){return new BPromise(function(_0x38b00b,_0x5bbb58){return client[_0x6f41('0x10')](_0x194028,_0x4b7bbf)['then'](function(_0x38526c){logger[_0x6f41('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x191cf4,_0x6f41('0x12'));logger[_0x6f41('0x13')](_0x6f41('0x14'),_0x191cf4,'request\x20sent',JSON[_0x6f41('0x15')](_0x38526c));if(_0x38526c[_0x6f41('0x16')]){if(_0x38526c['error']['code']===0x1f4){logger['error'](_0x6f41('0x17'),_0x191cf4,_0x38526c[_0x6f41('0x16')][_0x6f41('0x18')]);return _0x5bbb58(_0x38526c[_0x6f41('0x16')]['message']);}logger[_0x6f41('0x16')](_0x6f41('0x17'),_0x191cf4,_0x38526c[_0x6f41('0x16')]['message']);return _0x38b00b(_0x38526c[_0x6f41('0x16')][_0x6f41('0x18')]);}else{logger[_0x6f41('0x11')](_0x6f41('0x17'),_0x191cf4,_0x6f41('0x12'));_0x38b00b(_0x38526c[_0x6f41('0x19')][_0x6f41('0x18')]);}})[_0x6f41('0x1a')](function(_0xad80b3){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x191cf4,_0xad80b3);_0x5bbb58(_0xad80b3);});});}exports['GetOpenchannelQueue']=function(_0x21d02a){var _0x2bae2a=this;return new Promise(function(_0x3fc234,_0x2401c1){return db[_0x6f41('0x1b')][_0x6f41('0x1c')]({'raw':_0x21d02a[_0x6f41('0x1d')]?_0x21d02a[_0x6f41('0x1d')][_0x6f41('0x1e')]===undefined?!![]:![]:!![],'where':_0x21d02a[_0x6f41('0x1d')]?_0x21d02a['options']['where']||null:null,'attributes':_0x21d02a['options']?_0x21d02a[_0x6f41('0x1d')]['attributes']||null:null,'limit':_0x21d02a['options']?_0x21d02a['options'][_0x6f41('0x1f')]||null:null,'include':_0x21d02a[_0x6f41('0x1d')]?_0x21d02a[_0x6f41('0x1d')][_0x6f41('0x20')]?_[_0x6f41('0x21')](_0x21d02a[_0x6f41('0x1d')]['include'],function(_0xf85de8){return{'model':db[_0xf85de8[_0x6f41('0x22')]],'as':_0xf85de8['as'],'attributes':_0xf85de8[_0x6f41('0x23')],'include':_0xf85de8[_0x6f41('0x20')]?_[_0x6f41('0x21')](_0xf85de8['include'],function(_0x2903f4){return{'model':db[_0x2903f4['model']],'as':_0x2903f4['as'],'attributes':_0x2903f4[_0x6f41('0x23')],'include':_0x2903f4[_0x6f41('0x20')]?_[_0x6f41('0x21')](_0x2903f4[_0x6f41('0x20')],function(_0x14bcd6){return{'model':db[_0x14bcd6[_0x6f41('0x22')]],'as':_0x14bcd6['as'],'attributes':_0x14bcd6[_0x6f41('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6f41('0x24')](function(_0x326ffd){logger[_0x6f41('0x11')]('GetOpenchannelQueue',_0x21d02a);logger[_0x6f41('0x13')](_0x6f41('0x25'),_0x21d02a,JSON[_0x6f41('0x15')](_0x326ffd));_0x3fc234(_0x326ffd);})[_0x6f41('0x1a')](function(_0x250025){logger['error'](_0x6f41('0x25'),_0x250025[_0x6f41('0x18')],_0x21d02a);_0x2401c1(_0x2bae2a[_0x6f41('0x16')](0x1f4,_0x250025[_0x6f41('0x18')]));});});};exports[_0x6f41('0x26')]=function(_0x51a0bb){var _0x52aaf6=this;return new Promise(function(_0x56c2dd,_0x4c87ac){return db['OpenchannelQueue'][_0x6f41('0x27')]({'raw':_0x51a0bb[_0x6f41('0x1d')]?_0x51a0bb['options']['raw']===undefined?!![]:![]:!![],'where':_0x51a0bb[_0x6f41('0x1d')]?_0x51a0bb['options'][_0x6f41('0x28')]||null:null,'attributes':_0x51a0bb[_0x6f41('0x1d')]?_0x51a0bb['options'][_0x6f41('0x23')]||null:null,'include':_0x51a0bb['options']?_0x51a0bb[_0x6f41('0x1d')][_0x6f41('0x20')]?_[_0x6f41('0x21')](_0x51a0bb[_0x6f41('0x1d')][_0x6f41('0x20')],function(_0x3e219b){return{'model':db[_0x3e219b[_0x6f41('0x22')]],'as':_0x3e219b['as'],'attributes':_0x3e219b[_0x6f41('0x23')],'include':_0x3e219b[_0x6f41('0x20')]?_['map'](_0x3e219b[_0x6f41('0x20')],function(_0x36278c){return{'model':db[_0x36278c['model']],'as':_0x36278c['as'],'attributes':_0x36278c['attributes'],'include':_0x36278c[_0x6f41('0x20')]?_[_0x6f41('0x21')](_0x36278c[_0x6f41('0x20')],function(_0x2f1a82){return{'model':db[_0x2f1a82[_0x6f41('0x22')]],'as':_0x2f1a82['as'],'attributes':_0x2f1a82['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f41('0x24')](function(_0x30f0d7){logger[_0x6f41('0x11')]('ShowOpenchannelQueue',_0x51a0bb);logger[_0x6f41('0x13')](_0x6f41('0x26'),_0x51a0bb,JSON[_0x6f41('0x15')](_0x30f0d7));_0x56c2dd(_0x30f0d7);})['catch'](function(_0x42c528){logger[_0x6f41('0x16')]('ShowOpenchannelQueue',_0x42c528['message'],_0x51a0bb);_0x4c87ac(_0x52aaf6[_0x6f41('0x16')](0x1f4,_0x42c528[_0x6f41('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index a987f47..951ae77 100644 --- a/server/api/openchannelQueue/openchannelQueue.socket.js +++ b/server/api/openchannelQueue/openchannelQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b50=['length','remove','update','removeListener'];(function(_0x25898d,_0x2f7fb7){var _0x4a3253=function(_0x357552){while(--_0x357552){_0x25898d['push'](_0x25898d['shift']());}};_0x4a3253(++_0x2f7fb7);}(_0x8b50,0x1e5));var _0x08b5=function(_0x17ff46,_0x202fb5){_0x17ff46=_0x17ff46-0x0;var _0x86bb1c=_0x8b50[_0x17ff46];return _0x86bb1c;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x08b5('0x0'),_0x08b5('0x1')];function createListener(_0x17f986,_0x1ef070){return function(_0x2e99cc){_0x1ef070['emit'](_0x17f986,_0x2e99cc);};}function removeListener(_0x17925f,_0x111ed1){return function(){OpenchannelQueueEvents[_0x08b5('0x2')](_0x17925f,_0x111ed1);};}exports['register']=function(_0xc25443){for(var _0x228d66=0x0,_0x5bd38b=events[_0x08b5('0x3')];_0x228d66<_0x5bd38b;_0x228d66++){var _0x14ac36=events[_0x228d66];var _0x284dfc=createListener('openchannelQueue:'+_0x14ac36,_0xc25443);OpenchannelQueueEvents['on'](_0x14ac36,_0x284dfc);}}; \ No newline at end of file +var _0xd030=['length','./openchannelQueue.events','save','remove','update','removeListener','register'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xd030,0x10b));var _0x0d03=function(_0x2d434c,_0x28c61c){_0x2d434c=_0x2d434c-0x0;var _0x1cca11=_0xd030[_0x2d434c];return _0x1cca11;};'use strict';var OpenchannelQueueEvents=require(_0x0d03('0x0'));var events=[_0x0d03('0x1'),_0x0d03('0x2'),_0x0d03('0x3')];function createListener(_0xf754da,_0x10dcd9){return function(_0x1dea15){_0x10dcd9['emit'](_0xf754da,_0x1dea15);};}function removeListener(_0x4580e4,_0x20b743){return function(){OpenchannelQueueEvents[_0x0d03('0x4')](_0x4580e4,_0x20b743);};}exports[_0x0d03('0x5')]=function(_0x10445e){for(var _0x3cda23=0x0,_0x28987e=events[_0x0d03('0x6')];_0x3cda23<_0x28987e;_0x3cda23++){var _0x3537d7=events[_0x3cda23];var _0x1c3f11=createListener('openchannelQueue:'+_0x3537d7,_0x10445e);OpenchannelQueueEvents['on'](_0x3537d7,_0x1c3f11);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 2c7f755..19cdc57 100644 --- a/server/api/openchannelQueueReport/index.js +++ b/server/api/openchannelQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31ad=['./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','show','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c4e66,_0x3ce746){var _0x4a2aef=function(_0x5c4762){while(--_0x5c4762){_0x4c4e66['push'](_0x4c4e66['shift']());}};_0x4a2aef(++_0x3ce746);}(_0x31ad,0xc0));var _0xd31a=function(_0x4188c7,_0x418172){_0x4188c7=_0x4188c7-0x0;var _0x8cfde=_0x31ad[_0x4188c7];return _0x8cfde;};'use strict';var multer=require(_0xd31a('0x0'));var util=require(_0xd31a('0x1'));var path=require(_0xd31a('0x2'));var timeout=require(_0xd31a('0x3'));var express=require(_0xd31a('0x4'));var router=express['Router']();var fs_extra=require(_0xd31a('0x5'));var auth=require(_0xd31a('0x6'));var interaction=require(_0xd31a('0x7'));var config=require('../../config/environment');var controller=require(_0xd31a('0x8'));router[_0xd31a('0x9')]('/',auth['isAuthenticated'](),controller[_0xd31a('0xa')]);router[_0xd31a('0x9')](_0xd31a('0xb'),auth[_0xd31a('0xc')](),controller['describe']);router[_0xd31a('0x9')]('/:id',auth[_0xd31a('0xc')](),controller[_0xd31a('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd31a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xd31a('0xf')]);router[_0xd31a('0x10')](_0xd31a('0x11'),auth[_0xd31a('0xc')](),controller[_0xd31a('0x12')]);module[_0xd31a('0x13')]=router; \ No newline at end of file +var _0xd184=['/describe','/:id','show','create','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index'];(function(_0x5e6e41,_0x370503){var _0x2dba21=function(_0xf67ea6){while(--_0xf67ea6){_0x5e6e41['push'](_0x5e6e41['shift']());}};_0x2dba21(++_0x370503);}(_0xd184,0xa9));var _0x4d18=function(_0x29471c,_0x562bab){_0x29471c=_0x29471c-0x0;var _0x1be3aa=_0xd184[_0x29471c];return _0x1be3aa;};'use strict';var multer=require(_0x4d18('0x0'));var util=require(_0x4d18('0x1'));var path=require('path');var timeout=require(_0x4d18('0x2'));var express=require(_0x4d18('0x3'));var router=express[_0x4d18('0x4')]();var fs_extra=require(_0x4d18('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d18('0x6'));var controller=require(_0x4d18('0x7'));router[_0x4d18('0x8')]('/',auth[_0x4d18('0x9')](),controller[_0x4d18('0xa')]);router[_0x4d18('0x8')](_0x4d18('0xb'),auth[_0x4d18('0x9')](),controller['describe']);router[_0x4d18('0x8')](_0x4d18('0xc'),auth[_0x4d18('0x9')](),controller[_0x4d18('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4d18('0xe')]);router[_0x4d18('0xf')](_0x4d18('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4d18('0x10')](_0x4d18('0xc'),auth['isAuthenticated'](),controller[_0x4d18('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 09bc866..9e64b34 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b17=['STRING','DATE','moment','sequelize','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x2b17,0xca));var _0x72b1=function(_0x348984,_0x4f6521){_0x348984=_0x348984-0x0;var _0x2b44fc=_0x2b17[_0x348984];return _0x2b44fc;};'use strict';var moment=require(_0x72b1('0x0'));var Sequelize=require(_0x72b1('0x1'));module[_0x72b1('0x2')]={'uniqueid':{'type':Sequelize[_0x72b1('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x72b1('0x4')]},'exitAt':{'type':Sequelize[_0x72b1('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x56aa=['STRING','DATE','moment','exports'];(function(_0x377afc,_0x146354){var _0x188857=function(_0x3701e7){while(--_0x3701e7){_0x377afc['push'](_0x377afc['shift']());}};_0x188857(++_0x146354);}(_0x56aa,0x126));var _0xa56a=function(_0x3b0042,_0x8e7550){_0x3b0042=_0x3b0042-0x0;var _0x41bf57=_0x56aa[_0x3b0042];return _0x41bf57;};'use strict';var moment=require(_0xa56a('0x0'));var Sequelize=require('sequelize');module[_0xa56a('0x1')]={'uniqueid':{'type':Sequelize[_0xa56a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa56a('0x2')]},'joinAt':{'type':Sequelize[_0xa56a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa56a('0x3')]},'exitAt':{'type':Sequelize[_0xa56a('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 3ebbd05..91512ee 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4924=['name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','OpenchannelQueueReport','includeAll','rows','catch','params','rawAttributes','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','apply','save','update','then','destroy'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x4924,0x193));var _0x4492=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x4924[_0x18a79d];return _0x4f8848;};'use strict';var emlformat=require(_0x4492('0x0'));var rimraf=require(_0x4492('0x1'));var zipdir=require(_0x4492('0x2'));var jsonpatch=require(_0x4492('0x3'));var rp=require(_0x4492('0x4'));var moment=require(_0x4492('0x5'));var BPromise=require(_0x4492('0x6'));var Mustache=require(_0x4492('0x7'));var util=require(_0x4492('0x8'));var path=require(_0x4492('0x9'));var sox=require('sox');var csv=require(_0x4492('0xa'));var ejs=require(_0x4492('0xb'));var fs=require('fs');var fs_extra=require(_0x4492('0xc'));var _=require(_0x4492('0xd'));var squel=require(_0x4492('0xe'));var crypto=require('crypto');var jsforce=require(_0x4492('0xf'));var deskjs=require(_0x4492('0x10'));var toCsv=require(_0x4492('0xa'));var querystring=require(_0x4492('0x11'));var Papa=require(_0x4492('0x12'));var Redis=require(_0x4492('0x13'));var authService=require(_0x4492('0x14'));var qs=require(_0x4492('0x15'));var as=require(_0x4492('0x16'));var hardwareService=require(_0x4492('0x17'));var logger=require(_0x4492('0x18'))(_0x4492('0x19'));var utils=require(_0x4492('0x1a'));var config=require(_0x4492('0x1b'));var licenseUtil=require(_0x4492('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5efd15,_0xe0dad4){_0xe0dad4=_0xe0dad4||0xcc;return function(_0x42da42){if(_0x42da42){return _0x5efd15['sendStatus'](_0xe0dad4);}return _0x5efd15['status'](_0xe0dad4)[_0x4492('0x1d')]();};}function respondWithResult(_0x164d61,_0x547426){_0x547426=_0x547426||0xc8;return function(_0x53f770){if(_0x53f770){return _0x164d61[_0x4492('0x1e')](_0x547426)[_0x4492('0x1f')](_0x53f770);}};}function respondWithFilteredResult(_0x16b1ca,_0x2483c5){return function(_0x25f70a){if(_0x25f70a){var _0x396351=typeof _0x2483c5[_0x4492('0x20')]==='undefined'&&typeof _0x2483c5[_0x4492('0x21')]===_0x4492('0x22');var _0x2dfc5f=_0x25f70a[_0x4492('0x23')];var _0x45d1b5=_0x396351?0x0:_0x2483c5[_0x4492('0x20')];var _0x5cfc90=_0x396351?_0x25f70a[_0x4492('0x23')]:_0x2483c5[_0x4492('0x20')]+_0x2483c5['limit'];var _0x14ba5b;if(_0x5cfc90>=_0x2dfc5f){_0x5cfc90=_0x2dfc5f;_0x14ba5b=0xc8;}else{_0x14ba5b=0xce;}_0x16b1ca['status'](_0x14ba5b);return _0x16b1ca['set']('Content-Range',_0x45d1b5+'-'+_0x5cfc90+'/'+_0x2dfc5f)[_0x4492('0x1f')](_0x25f70a);}return null;};}function patchUpdates(_0x50915c){return function(_0x10099a){try{jsonpatch[_0x4492('0x24')](_0x10099a,_0x50915c,!![]);}catch(_0x1c6c23){return BPromise['reject'](_0x1c6c23);}return _0x10099a[_0x4492('0x25')]();};}function saveUpdates(_0x1ecb96,_0x3ca573){return function(_0x543e82){if(_0x543e82){return _0x543e82[_0x4492('0x26')](_0x1ecb96)[_0x4492('0x27')](function(_0x17b9b2){return _0x17b9b2;});}return null;};}function removeEntity(_0x3a057b,_0x1ffa79){return function(_0x5dd55a){if(_0x5dd55a){return _0x5dd55a[_0x4492('0x28')]()[_0x4492('0x27')](function(){_0x3a057b[_0x4492('0x1e')](0xcc)[_0x4492('0x1d')]();});}};}function handleEntityNotFound(_0x41b826,_0xc77d2e){return function(_0x140754){if(!_0x140754){_0x41b826['sendStatus'](0x194);}return _0x140754;};}function handleError(_0x270f07,_0x367e38){_0x367e38=_0x367e38||0x1f4;return function(_0x3730e3){logger['error'](_0x3730e3['stack']);if(_0x3730e3[_0x4492('0x29')]){delete _0x3730e3[_0x4492('0x29')];}_0x270f07[_0x4492('0x1e')](_0x367e38)['send'](_0x3730e3);};}exports[_0x4492('0x2a')]=function(_0x1a2844,_0xea5751){var _0x1d69da={},_0x24abe5={},_0x513173={'count':0x0,'rows':[]};var _0x56e5cc=_[_0x4492('0x2b')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x2f3645){return{'name':_0x2f3645[_0x4492('0x2c')],'type':_0x2f3645[_0x4492('0x2d')]['key']};});_0x24abe5[_0x4492('0x2e')]=_['map'](_0x56e5cc,_0x4492('0x29'));_0x24abe5[_0x4492('0x2f')]=_[_0x4492('0x30')](_0x1a2844[_0x4492('0x2f')]);_0x24abe5[_0x4492('0x31')]=_[_0x4492('0x32')](_0x24abe5[_0x4492('0x2e')],_0x24abe5[_0x4492('0x2f')]);_0x1d69da[_0x4492('0x33')]=_[_0x4492('0x32')](_0x24abe5[_0x4492('0x2e')],qs[_0x4492('0x34')](_0x1a2844[_0x4492('0x2f')][_0x4492('0x34')]));_0x1d69da[_0x4492('0x33')]=_0x1d69da[_0x4492('0x33')][_0x4492('0x35')]?_0x1d69da[_0x4492('0x33')]:_0x24abe5[_0x4492('0x2e')];if(!_0x1a2844['query'][_0x4492('0x36')](_0x4492('0x37'))){_0x1d69da[_0x4492('0x21')]=qs[_0x4492('0x21')](_0x1a2844['query'][_0x4492('0x21')]);_0x1d69da['offset']=qs[_0x4492('0x20')](_0x1a2844['query'][_0x4492('0x20')]);}_0x1d69da[_0x4492('0x38')]=qs['sort'](_0x1a2844['query'][_0x4492('0x39')]);_0x1d69da[_0x4492('0x3a')]=qs[_0x4492('0x31')](_[_0x4492('0x3b')](_0x1a2844[_0x4492('0x2f')],_0x24abe5['filters']),_0x56e5cc);if(_0x1a2844[_0x4492('0x2f')]['filter']){_0x1d69da['where']=_[_0x4492('0x3c')](_0x1d69da['where'],{'$or':_[_0x4492('0x2b')](_0x56e5cc,function(_0x48f059){if(_0x48f059[_0x4492('0x2d')]!==_0x4492('0x3d')){var _0x42cc42={};_0x42cc42[_0x48f059[_0x4492('0x29')]]={'$like':'%'+_0x1a2844[_0x4492('0x2f')]['filter']+'%'};return _0x42cc42;}})});}_0x1d69da=_[_0x4492('0x3c')]({},_0x1d69da,_0x1a2844['options']);var _0x2f7a11={'where':_0x1d69da[_0x4492('0x3a')]};return db[_0x4492('0x3e')][_0x4492('0x23')](_0x2f7a11)['then'](function(_0x526ebd){_0x513173[_0x4492('0x23')]=_0x526ebd;if(_0x1a2844['query'][_0x4492('0x3f')]){_0x1d69da['include']=[{'all':!![]}];}return db[_0x4492('0x3e')]['findAll'](_0x1d69da);})[_0x4492('0x27')](function(_0x2ec21e){_0x513173[_0x4492('0x40')]=_0x2ec21e;return _0x513173;})[_0x4492('0x27')](respondWithFilteredResult(_0xea5751,_0x1d69da))[_0x4492('0x41')](handleError(_0xea5751,null));};exports['show']=function(_0xb9e3dc,_0x3b298f){var _0x53798b={'raw':!![],'where':{'id':_0xb9e3dc[_0x4492('0x42')]['id']}},_0x274615={};_0x274615['model']=_[_0x4492('0x30')](db[_0x4492('0x3e')][_0x4492('0x43')]);_0x274615['query']=_[_0x4492('0x30')](_0xb9e3dc[_0x4492('0x2f')]);_0x274615[_0x4492('0x31')]=_[_0x4492('0x32')](_0x274615[_0x4492('0x2e')],_0x274615[_0x4492('0x2f')]);_0x53798b['attributes']=_[_0x4492('0x32')](_0x274615[_0x4492('0x2e')],qs[_0x4492('0x34')](_0xb9e3dc[_0x4492('0x2f')][_0x4492('0x34')]));_0x53798b[_0x4492('0x33')]=_0x53798b[_0x4492('0x33')][_0x4492('0x35')]?_0x53798b[_0x4492('0x33')]:_0x274615[_0x4492('0x2e')];if(_0xb9e3dc[_0x4492('0x2f')][_0x4492('0x3f')]){_0x53798b[_0x4492('0x44')]=[{'all':!![]}];}_0x53798b=_['merge']({},_0x53798b,_0xb9e3dc[_0x4492('0x45')]);return db['OpenchannelQueueReport'][_0x4492('0x46')](_0x53798b)[_0x4492('0x27')](handleEntityNotFound(_0x3b298f,null))[_0x4492('0x27')](respondWithResult(_0x3b298f,null))[_0x4492('0x41')](handleError(_0x3b298f,null));};exports[_0x4492('0x47')]=function(_0x12d949,_0x483ef5){return db[_0x4492('0x3e')]['create'](_0x12d949[_0x4492('0x48')],{})[_0x4492('0x27')](respondWithResult(_0x483ef5,0xc9))[_0x4492('0x41')](handleError(_0x483ef5,null));};exports[_0x4492('0x26')]=function(_0x36a98a,_0x395778){if(_0x36a98a[_0x4492('0x48')]['id']){delete _0x36a98a[_0x4492('0x48')]['id'];}return db[_0x4492('0x3e')]['find']({'where':{'id':_0x36a98a[_0x4492('0x42')]['id']}})[_0x4492('0x27')](handleEntityNotFound(_0x395778,null))['then'](saveUpdates(_0x36a98a[_0x4492('0x48')],null))[_0x4492('0x27')](respondWithResult(_0x395778,null))[_0x4492('0x41')](handleError(_0x395778,null));};exports[_0x4492('0x28')]=function(_0x4b0ff3,_0x35947f){return db[_0x4492('0x3e')][_0x4492('0x46')]({'where':{'id':_0x4b0ff3['params']['id']}})['then'](handleEntityNotFound(_0x35947f,null))[_0x4492('0x27')](removeEntity(_0x35947f,null))[_0x4492('0x41')](handleError(_0x35947f,null));};exports[_0x4492('0x49')]=function(_0x1dc263,_0x5449cd){return db[_0x4492('0x3e')][_0x4492('0x49')]()[_0x4492('0x27')](respondWithResult(_0x5449cd,null))[_0x4492('0x41')](handleError(_0x5449cd,null));}; \ No newline at end of file +var _0xa993=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','stack','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel'];(function(_0x457d61,_0x266a77){var _0x2204c8=function(_0x19b008){while(--_0x19b008){_0x457d61['push'](_0x457d61['shift']());}};_0x2204c8(++_0x266a77);}(_0xa993,0x161));var _0x3a99=function(_0x3b8565,_0x56dbaa){_0x3b8565=_0x3b8565-0x0;var _0x433f97=_0xa993[_0x3b8565];return _0x433f97;};'use strict';var emlformat=require(_0x3a99('0x0'));var rimraf=require(_0x3a99('0x1'));var zipdir=require(_0x3a99('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a99('0x3'));var moment=require('moment');var BPromise=require(_0x3a99('0x4'));var Mustache=require(_0x3a99('0x5'));var util=require('util');var path=require(_0x3a99('0x6'));var sox=require(_0x3a99('0x7'));var csv=require(_0x3a99('0x8'));var ejs=require(_0x3a99('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a99('0xa'));var squel=require(_0x3a99('0xb'));var crypto=require('crypto');var jsforce=require(_0x3a99('0xc'));var deskjs=require(_0x3a99('0xd'));var toCsv=require(_0x3a99('0x8'));var querystring=require('querystring');var Papa=require(_0x3a99('0xe'));var Redis=require('ioredis');var authService=require(_0x3a99('0xf'));var qs=require(_0x3a99('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a99('0x11'));var logger=require(_0x3a99('0x12'))(_0x3a99('0x13'));var utils=require(_0x3a99('0x14'));var config=require(_0x3a99('0x15'));var licenseUtil=require(_0x3a99('0x16'));var db=require(_0x3a99('0x17'))['db'];function respondWithStatusCode(_0x1c8355,_0x407cbf){_0x407cbf=_0x407cbf||0xcc;return function(_0x7a4321){if(_0x7a4321){return _0x1c8355[_0x3a99('0x18')](_0x407cbf);}return _0x1c8355['status'](_0x407cbf)['end']();};}function respondWithResult(_0x15b18a,_0x553d59){_0x553d59=_0x553d59||0xc8;return function(_0x51659b){if(_0x51659b){return _0x15b18a[_0x3a99('0x19')](_0x553d59)[_0x3a99('0x1a')](_0x51659b);}};}function respondWithFilteredResult(_0x2d6e4a,_0x423598){return function(_0x47d21c){if(_0x47d21c){var _0x233060=typeof _0x423598[_0x3a99('0x1b')]==='undefined'&&typeof _0x423598['limit']===_0x3a99('0x1c');var _0x1423a5=_0x47d21c[_0x3a99('0x1d')];var _0x125bb3=_0x233060?0x0:_0x423598['offset'];var _0x596f36=_0x233060?_0x47d21c[_0x3a99('0x1d')]:_0x423598['offset']+_0x423598[_0x3a99('0x1e')];var _0x452042;if(_0x596f36>=_0x1423a5){_0x596f36=_0x1423a5;_0x452042=0xc8;}else{_0x452042=0xce;}_0x2d6e4a[_0x3a99('0x19')](_0x452042);return _0x2d6e4a['set'](_0x3a99('0x1f'),_0x125bb3+'-'+_0x596f36+'/'+_0x1423a5)[_0x3a99('0x1a')](_0x47d21c);}return null;};}function patchUpdates(_0x5ec10f){return function(_0x18b4cc){try{jsonpatch[_0x3a99('0x20')](_0x18b4cc,_0x5ec10f,!![]);}catch(_0x3d628c){return BPromise[_0x3a99('0x21')](_0x3d628c);}return _0x18b4cc[_0x3a99('0x22')]();};}function saveUpdates(_0x180a9f,_0x1ac308){return function(_0x19cfda){if(_0x19cfda){return _0x19cfda['update'](_0x180a9f)[_0x3a99('0x23')](function(_0x598d2e){return _0x598d2e;});}return null;};}function removeEntity(_0x83db3a,_0x50145c){return function(_0x3d5c76){if(_0x3d5c76){return _0x3d5c76['destroy']()[_0x3a99('0x23')](function(){_0x83db3a[_0x3a99('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x195bc0,_0x25fe84){return function(_0x4f1a82){if(!_0x4f1a82){_0x195bc0[_0x3a99('0x18')](0x194);}return _0x4f1a82;};}function handleError(_0x1a7160,_0x18ad24){_0x18ad24=_0x18ad24||0x1f4;return function(_0x5c2033){logger['error'](_0x5c2033[_0x3a99('0x24')]);if(_0x5c2033[_0x3a99('0x25')]){delete _0x5c2033[_0x3a99('0x25')];}_0x1a7160['status'](_0x18ad24)[_0x3a99('0x26')](_0x5c2033);};}exports['index']=function(_0x3c6a52,_0x690687){var _0x405243={},_0x4e1e67={},_0x382c70={'count':0x0,'rows':[]};var _0x2af20a=_[_0x3a99('0x27')](db[_0x3a99('0x28')][_0x3a99('0x29')],function(_0x3920a7){return{'name':_0x3920a7[_0x3a99('0x2a')],'type':_0x3920a7[_0x3a99('0x2b')]['key']};});_0x4e1e67[_0x3a99('0x2c')]=_[_0x3a99('0x27')](_0x2af20a,_0x3a99('0x25'));_0x4e1e67['query']=_[_0x3a99('0x2d')](_0x3c6a52[_0x3a99('0x2e')]);_0x4e1e67['filters']=_['intersection'](_0x4e1e67['model'],_0x4e1e67[_0x3a99('0x2e')]);_0x405243[_0x3a99('0x2f')]=_[_0x3a99('0x30')](_0x4e1e67[_0x3a99('0x2c')],qs['fields'](_0x3c6a52['query'][_0x3a99('0x31')]));_0x405243[_0x3a99('0x2f')]=_0x405243['attributes']['length']?_0x405243[_0x3a99('0x2f')]:_0x4e1e67['model'];if(!_0x3c6a52[_0x3a99('0x2e')][_0x3a99('0x32')]('nolimit')){_0x405243[_0x3a99('0x1e')]=qs[_0x3a99('0x1e')](_0x3c6a52[_0x3a99('0x2e')][_0x3a99('0x1e')]);_0x405243[_0x3a99('0x1b')]=qs[_0x3a99('0x1b')](_0x3c6a52[_0x3a99('0x2e')][_0x3a99('0x1b')]);}_0x405243[_0x3a99('0x33')]=qs[_0x3a99('0x34')](_0x3c6a52[_0x3a99('0x2e')][_0x3a99('0x34')]);_0x405243['where']=qs[_0x3a99('0x35')](_[_0x3a99('0x36')](_0x3c6a52[_0x3a99('0x2e')],_0x4e1e67[_0x3a99('0x35')]),_0x2af20a);if(_0x3c6a52['query'][_0x3a99('0x37')]){_0x405243['where']=_[_0x3a99('0x38')](_0x405243[_0x3a99('0x39')],{'$or':_['map'](_0x2af20a,function(_0x374f2a){if(_0x374f2a[_0x3a99('0x2b')]!==_0x3a99('0x3a')){var _0x51eb35={};_0x51eb35[_0x374f2a[_0x3a99('0x25')]]={'$like':'%'+_0x3c6a52['query'][_0x3a99('0x37')]+'%'};return _0x51eb35;}})});}_0x405243=_[_0x3a99('0x38')]({},_0x405243,_0x3c6a52[_0x3a99('0x3b')]);var _0x5cd996={'where':_0x405243[_0x3a99('0x39')]};return db[_0x3a99('0x28')][_0x3a99('0x1d')](_0x5cd996)['then'](function(_0x5808ab){_0x382c70['count']=_0x5808ab;if(_0x3c6a52[_0x3a99('0x2e')][_0x3a99('0x3c')]){_0x405243[_0x3a99('0x3d')]=[{'all':!![]}];}return db[_0x3a99('0x28')]['findAll'](_0x405243);})['then'](function(_0x5e1d93){_0x382c70[_0x3a99('0x3e')]=_0x5e1d93;return _0x382c70;})['then'](respondWithFilteredResult(_0x690687,_0x405243))[_0x3a99('0x3f')](handleError(_0x690687,null));};exports[_0x3a99('0x40')]=function(_0x517cb2,_0x1addb7){var _0xb5b9f7={'raw':!![],'where':{'id':_0x517cb2[_0x3a99('0x41')]['id']}},_0x4da27f={};_0x4da27f[_0x3a99('0x2c')]=_[_0x3a99('0x2d')](db['OpenchannelQueueReport'][_0x3a99('0x29')]);_0x4da27f['query']=_['keys'](_0x517cb2[_0x3a99('0x2e')]);_0x4da27f['filters']=_['intersection'](_0x4da27f['model'],_0x4da27f[_0x3a99('0x2e')]);_0xb5b9f7[_0x3a99('0x2f')]=_[_0x3a99('0x30')](_0x4da27f[_0x3a99('0x2c')],qs[_0x3a99('0x31')](_0x517cb2[_0x3a99('0x2e')][_0x3a99('0x31')]));_0xb5b9f7[_0x3a99('0x2f')]=_0xb5b9f7[_0x3a99('0x2f')][_0x3a99('0x42')]?_0xb5b9f7['attributes']:_0x4da27f[_0x3a99('0x2c')];if(_0x517cb2['query'][_0x3a99('0x3c')]){_0xb5b9f7[_0x3a99('0x3d')]=[{'all':!![]}];}_0xb5b9f7=_[_0x3a99('0x38')]({},_0xb5b9f7,_0x517cb2[_0x3a99('0x3b')]);return db[_0x3a99('0x28')][_0x3a99('0x43')](_0xb5b9f7)['then'](handleEntityNotFound(_0x1addb7,null))[_0x3a99('0x23')](respondWithResult(_0x1addb7,null))[_0x3a99('0x3f')](handleError(_0x1addb7,null));};exports[_0x3a99('0x44')]=function(_0x45c21b,_0x556b13){return db[_0x3a99('0x28')]['create'](_0x45c21b[_0x3a99('0x45')],{})[_0x3a99('0x23')](respondWithResult(_0x556b13,0xc9))['catch'](handleError(_0x556b13,null));};exports[_0x3a99('0x46')]=function(_0x3c525b,_0x5dcb43){if(_0x3c525b[_0x3a99('0x45')]['id']){delete _0x3c525b[_0x3a99('0x45')]['id'];}return db[_0x3a99('0x28')][_0x3a99('0x43')]({'where':{'id':_0x3c525b[_0x3a99('0x41')]['id']}})[_0x3a99('0x23')](handleEntityNotFound(_0x5dcb43,null))[_0x3a99('0x23')](saveUpdates(_0x3c525b[_0x3a99('0x45')],null))[_0x3a99('0x23')](respondWithResult(_0x5dcb43,null))[_0x3a99('0x3f')](handleError(_0x5dcb43,null));};exports[_0x3a99('0x47')]=function(_0x2aa641,_0x32b020){return db[_0x3a99('0x28')][_0x3a99('0x43')]({'where':{'id':_0x2aa641['params']['id']}})[_0x3a99('0x23')](handleEntityNotFound(_0x32b020,null))[_0x3a99('0x23')](removeEntity(_0x32b020,null))['catch'](handleError(_0x32b020,null));};exports[_0x3a99('0x48')]=function(_0x25a6f5,_0x494dcd){return db[_0x3a99('0x28')][_0x3a99('0x48')]()[_0x3a99('0x23')](respondWithResult(_0x494dcd,null))[_0x3a99('0x3f')](handleError(_0x494dcd,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 02e8a20..ea16bc8 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x52761a,_0x5e3bcf){var _0x63a58f=function(_0x17aad0){while(--_0x17aad0){_0x52761a['push'](_0x52761a['shift']());}};_0x63a58f(++_0x5e3bcf);}(_0xe14b,0x93));var _0xbe14=function(_0x5388cd,_0x5bff13){_0x5388cd=_0x5388cd-0x0;var _0x4878e8=_0xe14b[_0x5388cd];return _0x4878e8;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x1d0c0f,_0xaeaf3b){var _0x55a52a=function(_0x11bd39){while(--_0x11bd39){_0x1d0c0f['push'](_0x1d0c0f['shift']());}};_0x55a52a(++_0xaeaf3b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0x5fc3[_0x4d7116];return _0x4593dc;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 5a890ca..99dd0da 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d5b=['message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','where','limit','info','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31d787,_0x78d799){var _0x4cbdf3=function(_0x417a09){while(--_0x417a09){_0x31d787['push'](_0x31d787['shift']());}};_0x4cbdf3(++_0x78d799);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x564c22,_0x3adb0c){_0x564c22=_0x564c22-0x0;var _0x3f09a1=_0x9d5b[_0x564c22];return _0x3f09a1;};'use strict';var _=require('lodash');var util=require(_0xb9d5('0x0'));var moment=require(_0xb9d5('0x1'));var BPromise=require(_0xb9d5('0x2'));var rs=require(_0xb9d5('0x3'));var fs=require('fs');var Redis=require(_0xb9d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9d5('0x5'));var logger=require('../../config/logger')(_0xb9d5('0x6'));var config=require(_0xb9d5('0x7'));var jayson=require(_0xb9d5('0x8'));var client=jayson[_0xb9d5('0x9')][_0xb9d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5144c7,_0x1ddb78,_0x35cf2){return new BPromise(function(_0x4dc4be,_0x2d3f66){return client[_0xb9d5('0xb')](_0x5144c7,_0x35cf2)[_0xb9d5('0xc')](function(_0x94e766){logger['info'](_0xb9d5('0xd'),_0x1ddb78,_0xb9d5('0xe'));logger['debug'](_0xb9d5('0xf'),_0x1ddb78,_0xb9d5('0xe'),JSON[_0xb9d5('0x10')](_0x94e766));if(_0x94e766[_0xb9d5('0x11')]){if(_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x12')]===0x1f4){logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x13')]);return _0x2d3f66(_0x94e766[_0xb9d5('0x11')]['message']);}logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x94e766['error'][_0xb9d5('0x13')]);return _0x4dc4be(_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x13')]);}else{logger['info'](_0xb9d5('0xd'),_0x1ddb78,_0xb9d5('0xe'));_0x4dc4be(_0x94e766[_0xb9d5('0x14')][_0xb9d5('0x13')]);}})[_0xb9d5('0x15')](function(_0x321a77){logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x321a77);_0x2d3f66(_0x321a77);});});}exports[_0xb9d5('0x16')]=function(_0x436002){var _0x248cb3=this;return new Promise(function(_0xf2c261,_0x2f8df6){return db[_0xb9d5('0x17')]['create'](_0x436002[_0xb9d5('0x18')],{'raw':_0x436002[_0xb9d5('0x19')]?_0x436002[_0xb9d5('0x19')][_0xb9d5('0x1a')]===undefined?!![]:![]:!![]})[_0xb9d5('0xc')](function(_0x457d69){logger['info'](_0xb9d5('0x16'),_0x436002);logger['debug'](_0xb9d5('0x16'),_0x436002,JSON[_0xb9d5('0x10')](_0x457d69));_0xf2c261(_0x457d69);})[_0xb9d5('0x15')](function(_0x13fc35){logger[_0xb9d5('0x11')](_0xb9d5('0x16'),_0x13fc35[_0xb9d5('0x13')],_0x436002);_0x2f8df6(_0x248cb3[_0xb9d5('0x11')](0x1f4,_0x13fc35['message']));});});};exports[_0xb9d5('0x1b')]=function(_0x30b06f){var _0x5508c6=this;return new Promise(function(_0x1c0b89,_0x25ebf2){return db[_0xb9d5('0x17')]['update'](_0x30b06f[_0xb9d5('0x18')],{'raw':_0x30b06f[_0xb9d5('0x19')]?_0x30b06f[_0xb9d5('0x19')][_0xb9d5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30b06f[_0xb9d5('0x19')]?_0x30b06f[_0xb9d5('0x19')][_0xb9d5('0x1c')]||null:null,'attributes':_0x30b06f[_0xb9d5('0x19')]?_0x30b06f[_0xb9d5('0x19')]['attributes']||null:null,'limit':_0x30b06f[_0xb9d5('0x19')]?_0x30b06f['options'][_0xb9d5('0x1d')]||null:null})[_0xb9d5('0xc')](function(_0x1de8e6){logger[_0xb9d5('0x1e')](_0xb9d5('0x1b'),_0x30b06f);logger[_0xb9d5('0x1f')](_0xb9d5('0x1b'),_0x30b06f,JSON[_0xb9d5('0x10')](_0x1de8e6));_0x1c0b89(_0x1de8e6);})[_0xb9d5('0x15')](function(_0x385701){logger[_0xb9d5('0x11')](_0xb9d5('0x1b'),_0x385701[_0xb9d5('0x13')],_0x30b06f);_0x25ebf2(_0x5508c6[_0xb9d5('0x11')](0x1f4,_0x385701[_0xb9d5('0x13')]));});});}; \ No newline at end of file +var _0x253d=['lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','result','OpenchannelQueueReport,\x20%s,\x20%s','CreateOpenchannelQueueReport','create','options','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','body','limit'];(function(_0x2b0307,_0x5718e3){var _0x414b2f=function(_0x594a3c){while(--_0x594a3c){_0x2b0307['push'](_0x2b0307['shift']());}};_0x414b2f(++_0x5718e3);}(_0x253d,0x1b3));var _0xd253=function(_0x37fa02,_0x5bd5e1){_0x37fa02=_0x37fa02-0x0;var _0x318956=_0x253d[_0x37fa02];return _0x318956;};'use strict';var _=require(_0xd253('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd253('0x1'));var db=require(_0xd253('0x2'))['db'];var utils=require(_0xd253('0x3'));var logger=require(_0xd253('0x4'))(_0xd253('0x5'));var config=require('../../config/environment');var jayson=require(_0xd253('0x6'));var client=jayson[_0xd253('0x7')][_0xd253('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17589a,_0xf4b457,_0x487f4e){return new BPromise(function(_0x2c4de4,_0x712c81){return client[_0xd253('0x9')](_0x17589a,_0x487f4e)[_0xd253('0xa')](function(_0x351047){logger[_0xd253('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf4b457,'request\x20sent');logger[_0xd253('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0xf4b457,_0xd253('0xd'),JSON[_0xd253('0xe')](_0x351047));if(_0x351047[_0xd253('0xf')]){if(_0x351047[_0xd253('0xf')][_0xd253('0x10')]===0x1f4){logger[_0xd253('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf4b457,_0x351047['error'][_0xd253('0x11')]);return _0x712c81(_0x351047[_0xd253('0xf')][_0xd253('0x11')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xf4b457,_0x351047[_0xd253('0xf')][_0xd253('0x11')]);return _0x2c4de4(_0x351047[_0xd253('0xf')]['message']);}else{logger[_0xd253('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf4b457,_0xd253('0xd'));_0x2c4de4(_0x351047[_0xd253('0x12')][_0xd253('0x11')]);}})['catch'](function(_0x1b7ed1){logger['error'](_0xd253('0x13'),_0xf4b457,_0x1b7ed1);_0x712c81(_0x1b7ed1);});});}exports[_0xd253('0x14')]=function(_0x5e4051){var _0x2496cb=this;return new Promise(function(_0x2a2adc,_0x5b24ff){return db['OpenchannelQueueReport'][_0xd253('0x15')](_0x5e4051['body'],{'raw':_0x5e4051['options']?_0x5e4051[_0xd253('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xd253('0xa')](function(_0x1e48c3){logger[_0xd253('0xb')](_0xd253('0x14'),_0x5e4051);logger['debug'](_0xd253('0x14'),_0x5e4051,JSON['stringify'](_0x1e48c3));_0x2a2adc(_0x1e48c3);})[_0xd253('0x17')](function(_0x50f8b5){logger[_0xd253('0xf')](_0xd253('0x14'),_0x50f8b5[_0xd253('0x11')],_0x5e4051);_0x5b24ff(_0x2496cb[_0xd253('0xf')](0x1f4,_0x50f8b5['message']));});});};exports[_0xd253('0x18')]=function(_0x34d98d){var _0x585c14=this;return new Promise(function(_0x27b0a1,_0x434be5){return db[_0xd253('0x19')][_0xd253('0x1a')](_0x34d98d[_0xd253('0x1b')],{'raw':_0x34d98d[_0xd253('0x16')]?_0x34d98d[_0xd253('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34d98d[_0xd253('0x16')]?_0x34d98d['options']['where']||null:null,'attributes':_0x34d98d[_0xd253('0x16')]?_0x34d98d[_0xd253('0x16')]['attributes']||null:null,'limit':_0x34d98d['options']?_0x34d98d[_0xd253('0x16')][_0xd253('0x1c')]||null:null})['then'](function(_0x3955a0){logger[_0xd253('0xb')](_0xd253('0x18'),_0x34d98d);logger[_0xd253('0xc')](_0xd253('0x18'),_0x34d98d,JSON['stringify'](_0x3955a0));_0x27b0a1(_0x3955a0);})[_0xd253('0x17')](function(_0x31a217){logger[_0xd253('0xf')]('UpdateOpenchannelQueueReport',_0x31a217[_0xd253('0x11')],_0x34d98d);_0x434be5(_0x585c14['error'](0x1f4,_0x31a217[_0xd253('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 37b75ff..1a52759 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f39=['/describe','describe','/:id','show','post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f39,0xa8));var _0x95f3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5f39[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x95f3('0x0'));var util=require(_0x95f3('0x1'));var path=require(_0x95f3('0x2'));var timeout=require(_0x95f3('0x3'));var express=require(_0x95f3('0x4'));var router=express[_0x95f3('0x5')]();var fs_extra=require(_0x95f3('0x6'));var auth=require(_0x95f3('0x7'));var interaction=require(_0x95f3('0x8'));var config=require('../../config/environment');var controller=require(_0x95f3('0x9'));router[_0x95f3('0xa')]('/',auth[_0x95f3('0xb')](),controller['index']);router[_0x95f3('0xa')](_0x95f3('0xc'),auth[_0x95f3('0xb')](),controller[_0x95f3('0xd')]);router[_0x95f3('0xa')](_0x95f3('0xe'),auth['isAuthenticated'](),controller[_0x95f3('0xf')]);router[_0x95f3('0x10')]('/',auth[_0x95f3('0xb')](),controller['create']);router['put'](_0x95f3('0xe'),auth[_0x95f3('0xb')](),controller[_0x95f3('0x11')]);router[_0x95f3('0x12')]('/:id',auth[_0x95f3('0xb')](),controller[_0x95f3('0x13')]);module['exports']=router; \ No newline at end of file +var _0xaef0=['put','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0xaef0,0x147));var _0x0aef=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xaef0[_0x5c6299];return _0x23b564;};'use strict';var multer=require(_0x0aef('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0aef('0x1'));var express=require(_0x0aef('0x2'));var router=express[_0x0aef('0x3')]();var fs_extra=require(_0x0aef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0aef('0x5'));var config=require(_0x0aef('0x6'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x0aef('0x7')](),controller[_0x0aef('0x8')]);router[_0x0aef('0x9')](_0x0aef('0xa'),auth[_0x0aef('0x7')](),controller[_0x0aef('0xb')]);router[_0x0aef('0x9')](_0x0aef('0xc'),auth['isAuthenticated'](),controller[_0x0aef('0xd')]);router[_0x0aef('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0aef('0xf')](_0x0aef('0xc'),auth[_0x0aef('0x7')](),controller['update']);router[_0x0aef('0x10')](_0x0aef('0xc'),auth['isAuthenticated'](),controller[_0x0aef('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index f05c55d..4c3a65f 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x1602f5,_0x43aa59){var _0x1604b0=function(_0x530d55){while(--_0x530d55){_0x1602f5['push'](_0x1602f5['shift']());}};_0x1604b0(++_0x43aa59);}(_0xedd9,0xfc));var _0x9edd=function(_0x1ce12f,_0x1732e5){_0x1ce12f=_0x1ce12f-0x0;var _0x2e2a64=_0xedd9[_0x1ce12f];return _0x2e2a64;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0xe9c8e4,_0x3aa2f6){var _0x2037fa=function(_0xcb43b1){while(--_0xcb43b1){_0xe9c8e4['push'](_0xe9c8e4['shift']());}};_0x2037fa(++_0x3aa2f6);}(_0x54ef,0x112));var _0xf54e=function(_0x43558b,_0xfe9dd0){_0x43558b=_0x43558b-0x0;var _0x32afe4=_0x54ef[_0x43558b];return _0x32afe4;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index b93e4de..690fcf5 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeae9=['filter','merge','VIRTUAL','includeAll','include','catch','show','params','OpenchannelTransferReport','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeae9,0xea));var _0x9eae=function(_0x2932e5,_0x47e4a3){_0x2932e5=_0x2932e5-0x0;var _0x55bdf8=_0xeae9[_0x2932e5];return _0x55bdf8;};'use strict';var emlformat=require(_0x9eae('0x0'));var rimraf=require(_0x9eae('0x1'));var zipdir=require(_0x9eae('0x2'));var jsonpatch=require(_0x9eae('0x3'));var rp=require(_0x9eae('0x4'));var moment=require('moment');var BPromise=require(_0x9eae('0x5'));var Mustache=require(_0x9eae('0x6'));var util=require(_0x9eae('0x7'));var path=require(_0x9eae('0x8'));var sox=require(_0x9eae('0x9'));var csv=require(_0x9eae('0xa'));var ejs=require(_0x9eae('0xb'));var fs=require('fs');var fs_extra=require(_0x9eae('0xc'));var _=require('lodash');var squel=require(_0x9eae('0xd'));var crypto=require(_0x9eae('0xe'));var jsforce=require(_0x9eae('0xf'));var deskjs=require(_0x9eae('0x10'));var toCsv=require(_0x9eae('0xa'));var querystring=require(_0x9eae('0x11'));var Papa=require(_0x9eae('0x12'));var Redis=require(_0x9eae('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9eae('0x14'));var as=require(_0x9eae('0x15'));var hardwareService=require(_0x9eae('0x16'));var logger=require(_0x9eae('0x17'))(_0x9eae('0x18'));var utils=require(_0x9eae('0x19'));var config=require(_0x9eae('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11d171,_0x2cb12b){_0x2cb12b=_0x2cb12b||0xcc;return function(_0x50cd87){if(_0x50cd87){return _0x11d171[_0x9eae('0x1b')](_0x2cb12b);}return _0x11d171[_0x9eae('0x1c')](_0x2cb12b)[_0x9eae('0x1d')]();};}function respondWithResult(_0x44d053,_0x46e3f9){_0x46e3f9=_0x46e3f9||0xc8;return function(_0x383bd9){if(_0x383bd9){return _0x44d053['status'](_0x46e3f9)['json'](_0x383bd9);}};}function respondWithFilteredResult(_0x3a9fcc,_0x5b3d80){return function(_0x215566){if(_0x215566){var _0x39f220=typeof _0x5b3d80[_0x9eae('0x1e')]===_0x9eae('0x1f')&&typeof _0x5b3d80[_0x9eae('0x20')]===_0x9eae('0x1f');var _0x2968a5=_0x215566[_0x9eae('0x21')];var _0x10ffb0=_0x39f220?0x0:_0x5b3d80['offset'];var _0x368d96=_0x39f220?_0x215566[_0x9eae('0x21')]:_0x5b3d80[_0x9eae('0x1e')]+_0x5b3d80[_0x9eae('0x20')];var _0x4a50b9;if(_0x368d96>=_0x2968a5){_0x368d96=_0x2968a5;_0x4a50b9=0xc8;}else{_0x4a50b9=0xce;}_0x3a9fcc[_0x9eae('0x1c')](_0x4a50b9);return _0x3a9fcc[_0x9eae('0x22')](_0x9eae('0x23'),_0x10ffb0+'-'+_0x368d96+'/'+_0x2968a5)[_0x9eae('0x24')](_0x215566);}return null;};}function patchUpdates(_0x3d3ac6){return function(_0x1658f7){try{jsonpatch['apply'](_0x1658f7,_0x3d3ac6,!![]);}catch(_0x1cc876){return BPromise[_0x9eae('0x25')](_0x1cc876);}return _0x1658f7[_0x9eae('0x26')]();};}function saveUpdates(_0xe8986c,_0x2221d4){return function(_0x4d08c9){if(_0x4d08c9){return _0x4d08c9['update'](_0xe8986c)[_0x9eae('0x27')](function(_0x262e19){return _0x262e19;});}return null;};}function removeEntity(_0x810d52,_0x1a9e62){return function(_0x2c27fc){if(_0x2c27fc){return _0x2c27fc['destroy']()['then'](function(){_0x810d52[_0x9eae('0x1c')](0xcc)[_0x9eae('0x1d')]();});}};}function handleEntityNotFound(_0x1cae1a,_0x26ecd6){return function(_0x5d54c4){if(!_0x5d54c4){_0x1cae1a[_0x9eae('0x1b')](0x194);}return _0x5d54c4;};}function handleError(_0x49c04e,_0x450a25){_0x450a25=_0x450a25||0x1f4;return function(_0x2a6b3b){logger['error'](_0x2a6b3b['stack']);if(_0x2a6b3b[_0x9eae('0x28')]){delete _0x2a6b3b[_0x9eae('0x28')];}_0x49c04e[_0x9eae('0x1c')](_0x450a25)[_0x9eae('0x29')](_0x2a6b3b);};}exports[_0x9eae('0x2a')]=function(_0x59878d,_0x47eeb3){var _0x19cc38={},_0x4fe104={},_0x3b3ce1={'count':0x0,'rows':[]};var _0x41fe3b=_['map'](db['OpenchannelTransferReport'][_0x9eae('0x2b')],function(_0x1e7574){return{'name':_0x1e7574[_0x9eae('0x2c')],'type':_0x1e7574[_0x9eae('0x2d')]['key']};});_0x4fe104[_0x9eae('0x2e')]=_[_0x9eae('0x2f')](_0x41fe3b,_0x9eae('0x28'));_0x4fe104[_0x9eae('0x30')]=_[_0x9eae('0x31')](_0x59878d[_0x9eae('0x30')]);_0x4fe104[_0x9eae('0x32')]=_[_0x9eae('0x33')](_0x4fe104[_0x9eae('0x2e')],_0x4fe104[_0x9eae('0x30')]);_0x19cc38[_0x9eae('0x34')]=_['intersection'](_0x4fe104[_0x9eae('0x2e')],qs[_0x9eae('0x35')](_0x59878d['query'][_0x9eae('0x35')]));_0x19cc38[_0x9eae('0x34')]=_0x19cc38[_0x9eae('0x34')]['length']?_0x19cc38[_0x9eae('0x34')]:_0x4fe104[_0x9eae('0x2e')];if(!_0x59878d[_0x9eae('0x30')][_0x9eae('0x36')](_0x9eae('0x37'))){_0x19cc38['limit']=qs[_0x9eae('0x20')](_0x59878d[_0x9eae('0x30')][_0x9eae('0x20')]);_0x19cc38[_0x9eae('0x1e')]=qs[_0x9eae('0x1e')](_0x59878d['query'][_0x9eae('0x1e')]);}_0x19cc38['order']=qs[_0x9eae('0x38')](_0x59878d['query'][_0x9eae('0x38')]);_0x19cc38[_0x9eae('0x39')]=qs['filters'](_['pick'](_0x59878d[_0x9eae('0x30')],_0x4fe104[_0x9eae('0x32')]),_0x41fe3b);if(_0x59878d['query'][_0x9eae('0x3a')]){_0x19cc38[_0x9eae('0x39')]=_[_0x9eae('0x3b')](_0x19cc38[_0x9eae('0x39')],{'$or':_[_0x9eae('0x2f')](_0x41fe3b,function(_0x81f104){if(_0x81f104[_0x9eae('0x2d')]!==_0x9eae('0x3c')){var _0x9f1062={};_0x9f1062[_0x81f104['name']]={'$like':'%'+_0x59878d[_0x9eae('0x30')][_0x9eae('0x3a')]+'%'};return _0x9f1062;}})});}_0x19cc38=_['merge']({},_0x19cc38,_0x59878d['options']);var _0x5b41d8={'where':_0x19cc38[_0x9eae('0x39')]};return db['OpenchannelTransferReport']['count'](_0x5b41d8)[_0x9eae('0x27')](function(_0x325a0c){_0x3b3ce1['count']=_0x325a0c;if(_0x59878d[_0x9eae('0x30')][_0x9eae('0x3d')]){_0x19cc38[_0x9eae('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x19cc38);})[_0x9eae('0x27')](function(_0x27c45d){_0x3b3ce1['rows']=_0x27c45d;return _0x3b3ce1;})['then'](respondWithFilteredResult(_0x47eeb3,_0x19cc38))[_0x9eae('0x3f')](handleError(_0x47eeb3,null));};exports[_0x9eae('0x40')]=function(_0x5e02f7,_0x29bd32){var _0xd1d9db={'raw':!![],'where':{'id':_0x5e02f7[_0x9eae('0x41')]['id']}},_0x3200f7={};_0x3200f7['model']=_[_0x9eae('0x31')](db[_0x9eae('0x42')]['rawAttributes']);_0x3200f7['query']=_[_0x9eae('0x31')](_0x5e02f7[_0x9eae('0x30')]);_0x3200f7[_0x9eae('0x32')]=_[_0x9eae('0x33')](_0x3200f7[_0x9eae('0x2e')],_0x3200f7[_0x9eae('0x30')]);_0xd1d9db[_0x9eae('0x34')]=_[_0x9eae('0x33')](_0x3200f7[_0x9eae('0x2e')],qs[_0x9eae('0x35')](_0x5e02f7[_0x9eae('0x30')][_0x9eae('0x35')]));_0xd1d9db['attributes']=_0xd1d9db[_0x9eae('0x34')]['length']?_0xd1d9db[_0x9eae('0x34')]:_0x3200f7['model'];if(_0x5e02f7[_0x9eae('0x30')][_0x9eae('0x3d')]){_0xd1d9db[_0x9eae('0x3e')]=[{'all':!![]}];}_0xd1d9db=_[_0x9eae('0x3b')]({},_0xd1d9db,_0x5e02f7[_0x9eae('0x43')]);return db['OpenchannelTransferReport'][_0x9eae('0x44')](_0xd1d9db)[_0x9eae('0x27')](handleEntityNotFound(_0x29bd32,null))[_0x9eae('0x27')](respondWithResult(_0x29bd32,null))[_0x9eae('0x3f')](handleError(_0x29bd32,null));};exports['create']=function(_0x8cb2b9,_0x3ea2f2){return db['OpenchannelTransferReport'][_0x9eae('0x45')](_0x8cb2b9[_0x9eae('0x46')],{})[_0x9eae('0x27')](respondWithResult(_0x3ea2f2,0xc9))[_0x9eae('0x3f')](handleError(_0x3ea2f2,null));};exports[_0x9eae('0x47')]=function(_0x307944,_0x37a15e){if(_0x307944[_0x9eae('0x46')]['id']){delete _0x307944[_0x9eae('0x46')]['id'];}return db[_0x9eae('0x42')][_0x9eae('0x44')]({'where':{'id':_0x307944['params']['id']}})[_0x9eae('0x27')](handleEntityNotFound(_0x37a15e,null))['then'](saveUpdates(_0x307944[_0x9eae('0x46')],null))[_0x9eae('0x27')](respondWithResult(_0x37a15e,null))[_0x9eae('0x3f')](handleError(_0x37a15e,null));};exports['destroy']=function(_0x37288a,_0x3747e6){return db[_0x9eae('0x42')]['find']({'where':{'id':_0x37288a['params']['id']}})[_0x9eae('0x27')](handleEntityNotFound(_0x3747e6,null))[_0x9eae('0x27')](removeEntity(_0x3747e6,null))[_0x9eae('0x3f')](handleError(_0x3747e6,null));};exports[_0x9eae('0x48')]=function(_0x5db32d,_0x5196fb){return db[_0x9eae('0x42')][_0x9eae('0x48')]()[_0x9eae('0x27')](respondWithResult(_0x5196fb,null))[_0x9eae('0x3f')](handleError(_0x5196fb,null));}; \ No newline at end of file +var _0x6137=['eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','count','offset','set','json','apply','reject','update','then','destroy','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','OpenchannelTransferReport','includeAll','include','rows','catch','show','params','options','body','find','describe'];(function(_0x47613c,_0x3c0c75){var _0x2ff301=function(_0x2c1630){while(--_0x2c1630){_0x47613c['push'](_0x47613c['shift']());}};_0x2ff301(++_0x3c0c75);}(_0x6137,0x1d5));var _0x7613=function(_0x3eecdc,_0x136fd1){_0x3eecdc=_0x3eecdc-0x0;var _0x56a550=_0x6137[_0x3eecdc];return _0x56a550;};'use strict';var emlformat=require(_0x7613('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7613('0x1'));var moment=require(_0x7613('0x2'));var BPromise=require(_0x7613('0x3'));var Mustache=require(_0x7613('0x4'));var util=require(_0x7613('0x5'));var path=require(_0x7613('0x6'));var sox=require(_0x7613('0x7'));var csv=require(_0x7613('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7613('0x9'));var _=require(_0x7613('0xa'));var squel=require('squel');var crypto=require(_0x7613('0xb'));var jsforce=require(_0x7613('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7613('0x8'));var querystring=require('querystring');var Papa=require(_0x7613('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7613('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7613('0xf'))(_0x7613('0x10'));var utils=require(_0x7613('0x11'));var config=require(_0x7613('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x7613('0x13'))['db'];function respondWithStatusCode(_0x26bf68,_0x3bd536){_0x3bd536=_0x3bd536||0xcc;return function(_0xcf38ad){if(_0xcf38ad){return _0x26bf68[_0x7613('0x14')](_0x3bd536);}return _0x26bf68['status'](_0x3bd536)[_0x7613('0x15')]();};}function respondWithResult(_0x5da68b,_0x41f112){_0x41f112=_0x41f112||0xc8;return function(_0x3bb32c){if(_0x3bb32c){return _0x5da68b[_0x7613('0x16')](_0x41f112)['json'](_0x3bb32c);}};}function respondWithFilteredResult(_0x9eff65,_0x378992){return function(_0x4d7fc7){if(_0x4d7fc7){var _0x242ca3=typeof _0x378992['offset']==='undefined'&&typeof _0x378992[_0x7613('0x17')]==='undefined';var _0xef896=_0x4d7fc7[_0x7613('0x18')];var _0x379f52=_0x242ca3?0x0:_0x378992[_0x7613('0x19')];var _0xd94104=_0x242ca3?_0x4d7fc7[_0x7613('0x18')]:_0x378992[_0x7613('0x19')]+_0x378992[_0x7613('0x17')];var _0x250a07;if(_0xd94104>=_0xef896){_0xd94104=_0xef896;_0x250a07=0xc8;}else{_0x250a07=0xce;}_0x9eff65[_0x7613('0x16')](_0x250a07);return _0x9eff65[_0x7613('0x1a')]('Content-Range',_0x379f52+'-'+_0xd94104+'/'+_0xef896)[_0x7613('0x1b')](_0x4d7fc7);}return null;};}function patchUpdates(_0xc67e33){return function(_0x3245f2){try{jsonpatch[_0x7613('0x1c')](_0x3245f2,_0xc67e33,!![]);}catch(_0x3cc67f){return BPromise[_0x7613('0x1d')](_0x3cc67f);}return _0x3245f2['save']();};}function saveUpdates(_0x3ac31e,_0x2a41c6){return function(_0x5e04db){if(_0x5e04db){return _0x5e04db[_0x7613('0x1e')](_0x3ac31e)[_0x7613('0x1f')](function(_0xfa1a34){return _0xfa1a34;});}return null;};}function removeEntity(_0x3834c3,_0x56c27d){return function(_0x1b6ad5){if(_0x1b6ad5){return _0x1b6ad5[_0x7613('0x20')]()['then'](function(){_0x3834c3[_0x7613('0x16')](0xcc)[_0x7613('0x15')]();});}};}function handleEntityNotFound(_0x321404,_0x538e12){return function(_0x244c20){if(!_0x244c20){_0x321404[_0x7613('0x14')](0x194);}return _0x244c20;};}function handleError(_0x3f2bba,_0x5ecfd9){_0x5ecfd9=_0x5ecfd9||0x1f4;return function(_0x5f5c3a){logger[_0x7613('0x21')](_0x5f5c3a[_0x7613('0x22')]);if(_0x5f5c3a[_0x7613('0x23')]){delete _0x5f5c3a[_0x7613('0x23')];}_0x3f2bba[_0x7613('0x16')](_0x5ecfd9)[_0x7613('0x24')](_0x5f5c3a);};}exports['index']=function(_0x340191,_0x268586){var _0x348301={},_0x1678b7={},_0x3d33b1={'count':0x0,'rows':[]};var _0x4651c6=_[_0x7613('0x25')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x5cb758){return{'name':_0x5cb758[_0x7613('0x26')],'type':_0x5cb758['type'][_0x7613('0x27')]};});_0x1678b7[_0x7613('0x28')]=_[_0x7613('0x25')](_0x4651c6,_0x7613('0x23'));_0x1678b7[_0x7613('0x29')]=_[_0x7613('0x2a')](_0x340191[_0x7613('0x29')]);_0x1678b7[_0x7613('0x2b')]=_[_0x7613('0x2c')](_0x1678b7[_0x7613('0x28')],_0x1678b7[_0x7613('0x29')]);_0x348301[_0x7613('0x2d')]=_['intersection'](_0x1678b7[_0x7613('0x28')],qs[_0x7613('0x2e')](_0x340191['query'][_0x7613('0x2e')]));_0x348301[_0x7613('0x2d')]=_0x348301['attributes'][_0x7613('0x2f')]?_0x348301[_0x7613('0x2d')]:_0x1678b7['model'];if(!_0x340191[_0x7613('0x29')][_0x7613('0x30')]('nolimit')){_0x348301[_0x7613('0x17')]=qs[_0x7613('0x17')](_0x340191[_0x7613('0x29')]['limit']);_0x348301['offset']=qs['offset'](_0x340191[_0x7613('0x29')][_0x7613('0x19')]);}_0x348301['order']=qs[_0x7613('0x31')](_0x340191[_0x7613('0x29')][_0x7613('0x31')]);_0x348301[_0x7613('0x32')]=qs[_0x7613('0x2b')](_[_0x7613('0x33')](_0x340191[_0x7613('0x29')],_0x1678b7[_0x7613('0x2b')]),_0x4651c6);if(_0x340191[_0x7613('0x29')][_0x7613('0x34')]){_0x348301[_0x7613('0x32')]=_[_0x7613('0x35')](_0x348301[_0x7613('0x32')],{'$or':_[_0x7613('0x25')](_0x4651c6,function(_0x1344f2){if(_0x1344f2[_0x7613('0x36')]!==_0x7613('0x37')){var _0x202a0a={};_0x202a0a[_0x1344f2[_0x7613('0x23')]]={'$like':'%'+_0x340191[_0x7613('0x29')]['filter']+'%'};return _0x202a0a;}})});}_0x348301=_['merge']({},_0x348301,_0x340191['options']);var _0x3d28aa={'where':_0x348301['where']};return db[_0x7613('0x38')]['count'](_0x3d28aa)[_0x7613('0x1f')](function(_0x4897ef){_0x3d33b1[_0x7613('0x18')]=_0x4897ef;if(_0x340191[_0x7613('0x29')][_0x7613('0x39')]){_0x348301[_0x7613('0x3a')]=[{'all':!![]}];}return db[_0x7613('0x38')]['findAll'](_0x348301);})['then'](function(_0x3fe9bd){_0x3d33b1[_0x7613('0x3b')]=_0x3fe9bd;return _0x3d33b1;})['then'](respondWithFilteredResult(_0x268586,_0x348301))[_0x7613('0x3c')](handleError(_0x268586,null));};exports[_0x7613('0x3d')]=function(_0x2ca94d,_0xcdbcde){var _0x14b248={'raw':!![],'where':{'id':_0x2ca94d[_0x7613('0x3e')]['id']}},_0x7faaea={};_0x7faaea[_0x7613('0x28')]=_[_0x7613('0x2a')](db[_0x7613('0x38')]['rawAttributes']);_0x7faaea['query']=_[_0x7613('0x2a')](_0x2ca94d[_0x7613('0x29')]);_0x7faaea['filters']=_[_0x7613('0x2c')](_0x7faaea[_0x7613('0x28')],_0x7faaea['query']);_0x14b248[_0x7613('0x2d')]=_['intersection'](_0x7faaea[_0x7613('0x28')],qs[_0x7613('0x2e')](_0x2ca94d[_0x7613('0x29')]['fields']));_0x14b248[_0x7613('0x2d')]=_0x14b248[_0x7613('0x2d')]['length']?_0x14b248[_0x7613('0x2d')]:_0x7faaea['model'];if(_0x2ca94d['query'][_0x7613('0x39')]){_0x14b248[_0x7613('0x3a')]=[{'all':!![]}];}_0x14b248=_['merge']({},_0x14b248,_0x2ca94d[_0x7613('0x3f')]);return db[_0x7613('0x38')]['find'](_0x14b248)['then'](handleEntityNotFound(_0xcdbcde,null))[_0x7613('0x1f')](respondWithResult(_0xcdbcde,null))[_0x7613('0x3c')](handleError(_0xcdbcde,null));};exports['create']=function(_0xf7f2f1,_0x24517e){return db['OpenchannelTransferReport']['create'](_0xf7f2f1[_0x7613('0x40')],{})[_0x7613('0x1f')](respondWithResult(_0x24517e,0xc9))['catch'](handleError(_0x24517e,null));};exports[_0x7613('0x1e')]=function(_0x202b45,_0x71f37d){if(_0x202b45[_0x7613('0x40')]['id']){delete _0x202b45[_0x7613('0x40')]['id'];}return db[_0x7613('0x38')][_0x7613('0x41')]({'where':{'id':_0x202b45['params']['id']}})[_0x7613('0x1f')](handleEntityNotFound(_0x71f37d,null))[_0x7613('0x1f')](saveUpdates(_0x202b45[_0x7613('0x40')],null))['then'](respondWithResult(_0x71f37d,null))[_0x7613('0x3c')](handleError(_0x71f37d,null));};exports['destroy']=function(_0x2103c6,_0x85edd0){return db[_0x7613('0x38')][_0x7613('0x41')]({'where':{'id':_0x2103c6[_0x7613('0x3e')]['id']}})[_0x7613('0x1f')](handleEntityNotFound(_0x85edd0,null))['then'](removeEntity(_0x85edd0,null))[_0x7613('0x3c')](handleError(_0x85edd0,null));};exports[_0x7613('0x42')]=function(_0x5ae4e9,_0x48452c){return db[_0x7613('0x38')][_0x7613('0x42')]()[_0x7613('0x1f')](respondWithResult(_0x48452c,null))[_0x7613('0x3c')](handleError(_0x48452c,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 0a8451a..aa0a0c5 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5806=['util','../../config/logger','bluebird','request-promise','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x5806,0xe6));var _0x6580=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x5806[_0x1be3b3];return _0x4f8b2d;};'use strict';var _=require(_0x6580('0x0'));var util=require(_0x6580('0x1'));var logger=require(_0x6580('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6580('0x3'));var rp=require(_0x6580('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6580('0x5'));var attributes=require('./openchannelTransferReport.attributes');module[_0x6580('0x6')]=function(_0x5858d9,_0x42b114){return _0x5858d9[_0x6580('0x7')](_0x6580('0x8'),attributes,{'tableName':_0x6580('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6580('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe410=['OpenchannelTransferReport','report_openchannel_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0xe410,0x161));var _0x0e41=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0xe410[_0x4a0e68];return _0x4fb274;};'use strict';var _=require(_0x0e41('0x0'));var util=require(_0x0e41('0x1'));var logger=require(_0x0e41('0x2'))(_0x0e41('0x3'));var moment=require(_0x0e41('0x4'));var BPromise=require(_0x0e41('0x5'));var rp=require(_0x0e41('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0e41('0x7'));var attributes=require(_0x0e41('0x8'));module[_0x0e41('0x9')]=function(_0x3ca398,_0x3d9e02){return _0x3ca398[_0x0e41('0xa')](_0x0e41('0xb'),attributes,{'tableName':_0x0e41('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 38698df..85c9836 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x535f=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x9c173a,_0x461c9c){var _0x88d611=function(_0x4900c7){while(--_0x4900c7){_0x9c173a['push'](_0x9c173a['shift']());}};_0x88d611(++_0x461c9c);}(_0x535f,0x111));var _0xf535=function(_0x46a214,_0x1da7ec){_0x46a214=_0x46a214-0x0;var _0x9f6d43=_0x535f[_0x46a214];return _0x9f6d43;};'use strict';var _=require('lodash');var util=require(_0xf535('0x0'));var moment=require(_0xf535('0x1'));var BPromise=require('bluebird');var rs=require(_0xf535('0x2'));var fs=require('fs');var Redis=require(_0xf535('0x3'));var db=require(_0xf535('0x4'))['db'];var utils=require(_0xf535('0x5'));var logger=require('../../config/logger')(_0xf535('0x6'));var config=require(_0xf535('0x7'));var jayson=require(_0xf535('0x8'));var client=jayson[_0xf535('0x9')][_0xf535('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc74104,_0x580328,_0x510b86){return new BPromise(function(_0x17f72e,_0x156c64){return client[_0xf535('0xb')](_0xc74104,_0x510b86)['then'](function(_0x244189){logger[_0xf535('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x580328,'request\x20sent');logger[_0xf535('0xd')](_0xf535('0xe'),_0x580328,'request\x20sent',JSON['stringify'](_0x244189));if(_0x244189[_0xf535('0xf')]){if(_0x244189[_0xf535('0xf')][_0xf535('0x10')]===0x1f4){logger[_0xf535('0xf')](_0xf535('0x11'),_0x580328,_0x244189['error'][_0xf535('0x12')]);return _0x156c64(_0x244189[_0xf535('0xf')][_0xf535('0x12')]);}logger[_0xf535('0xf')](_0xf535('0x11'),_0x580328,_0x244189[_0xf535('0xf')][_0xf535('0x12')]);return _0x17f72e(_0x244189[_0xf535('0xf')][_0xf535('0x12')]);}else{logger[_0xf535('0xc')](_0xf535('0x11'),_0x580328,'request\x20sent');_0x17f72e(_0x244189[_0xf535('0x13')][_0xf535('0x12')]);}})[_0xf535('0x14')](function(_0x3ffb1b){logger[_0xf535('0xf')](_0xf535('0x11'),_0x580328,_0x3ffb1b);_0x156c64(_0x3ffb1b);});});} \ No newline at end of file +var _0x19da=['error','message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x19da,0x9f));var _0xa19d=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x19da[_0x49d19d];return _0x4ebef1;};'use strict';var _=require('lodash');var util=require(_0xa19d('0x0'));var moment=require('moment');var BPromise=require(_0xa19d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19d('0x2'));var db=require(_0xa19d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa19d('0x4'))(_0xa19d('0x5'));var config=require('../../config/environment');var jayson=require(_0xa19d('0x6'));var client=jayson[_0xa19d('0x7')][_0xa19d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14dc68,_0x32da37,_0x4b4627){return new BPromise(function(_0x197c4e,_0x4e6638){return client[_0xa19d('0x9')](_0x14dc68,_0x4b4627)[_0xa19d('0xa')](function(_0x538dea){logger['info'](_0xa19d('0xb'),_0x32da37,_0xa19d('0xc'));logger[_0xa19d('0xd')](_0xa19d('0xe'),_0x32da37,_0xa19d('0xc'),JSON[_0xa19d('0xf')](_0x538dea));if(_0x538dea['error']){if(_0x538dea['error'][_0xa19d('0x10')]===0x1f4){logger[_0xa19d('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x32da37,_0x538dea['error'][_0xa19d('0x12')]);return _0x4e6638(_0x538dea[_0xa19d('0x11')]['message']);}logger[_0xa19d('0x11')](_0xa19d('0xb'),_0x32da37,_0x538dea[_0xa19d('0x11')]['message']);return _0x197c4e(_0x538dea[_0xa19d('0x11')]['message']);}else{logger[_0xa19d('0x13')](_0xa19d('0xb'),_0x32da37,_0xa19d('0xc'));_0x197c4e(_0x538dea[_0xa19d('0x14')][_0xa19d('0x12')]);}})[_0xa19d('0x15')](function(_0x2f2774){logger[_0xa19d('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x32da37,_0x2f2774);_0x4e6638(_0x2f2774);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index e6ac590..576c0ac 100644 --- a/server/api/pause/index.js +++ b/server/api/pause/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x958f=['create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./pause.controller','get','index','isAuthenticated','post'];(function(_0x1d8005,_0x272160){var _0x237dc6=function(_0x7ef412){while(--_0x7ef412){_0x1d8005['push'](_0x1d8005['shift']());}};_0x237dc6(++_0x272160);}(_0x958f,0x114));var _0xf958=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x958f[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0xf958('0x0'));var util=require(_0xf958('0x1'));var path=require(_0xf958('0x2'));var timeout=require(_0xf958('0x3'));var express=require(_0xf958('0x4'));var router=express['Router']();var fs_extra=require(_0xf958('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf958('0x6'));var config=require('../../config/environment');var controller=require(_0xf958('0x7'));router[_0xf958('0x8')]('/',auth['isAuthenticated'](),controller[_0xf958('0x9')]);router[_0xf958('0x8')]('/:id',auth[_0xf958('0xa')](),controller['show']);router[_0xf958('0xb')]('/',auth[_0xf958('0xa')](),controller[_0xf958('0xc')]);router[_0xf958('0xd')](_0xf958('0xe'),auth[_0xf958('0xa')](),controller['update']);router[_0xf958('0xf')](_0xf958('0xe'),auth[_0xf958('0xa')](),controller[_0xf958('0x10')]);module[_0xf958('0x11')]=router; \ No newline at end of file +var _0xc382=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','index','/:id','isAuthenticated','show','put','delete','destroy','multer','path'];(function(_0x100d09,_0x3f1283){var _0x4626fb=function(_0xc3e63b){while(--_0xc3e63b){_0x100d09['push'](_0x100d09['shift']());}};_0x4626fb(++_0x3f1283);}(_0xc382,0x11b));var _0x2c38=function(_0x2d58e6,_0x55cb14){_0x2d58e6=_0x2d58e6-0x0;var _0x5bcd81=_0xc382[_0x2d58e6];return _0x5bcd81;};'use strict';var multer=require(_0x2c38('0x0'));var util=require('util');var path=require(_0x2c38('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c38('0x2')]();var fs_extra=require(_0x2c38('0x3'));var auth=require(_0x2c38('0x4'));var interaction=require(_0x2c38('0x5'));var config=require(_0x2c38('0x6'));var controller=require(_0x2c38('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2c38('0x8')]);router['get'](_0x2c38('0x9'),auth[_0x2c38('0xa')](),controller[_0x2c38('0xb')]);router['post']('/',auth[_0x2c38('0xa')](),controller['create']);router[_0x2c38('0xc')](_0x2c38('0x9'),auth[_0x2c38('0xa')](),controller['update']);router[_0x2c38('0xd')](_0x2c38('0x9'),auth[_0x2c38('0xa')](),controller[_0x2c38('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 7951605..60c8fe1 100644 --- a/server/api/pause/pause.attributes.js +++ b/server/api/pause/pause.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd768=['STRING','name','sequelize','exports'];(function(_0x4eb502,_0x7ce1bc){var _0x299370=function(_0x12169d){while(--_0x12169d){_0x4eb502['push'](_0x4eb502['shift']());}};_0x299370(++_0x7ce1bc);}(_0xd768,0x13e));var _0x8d76=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0xd768[_0x3cae69];return _0x3128eb;};'use strict';var Sequelize=require(_0x8d76('0x0'));module[_0x8d76('0x1')]={'name':{'type':Sequelize[_0x8d76('0x2')],'unique':_0x8d76('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x689c=['STRING','sequelize','exports'];(function(_0x336081,_0x8bf806){var _0x4aafad=function(_0x351fb5){while(--_0x351fb5){_0x336081['push'](_0x336081['shift']());}};_0x4aafad(++_0x8bf806);}(_0x689c,0x1a5));var _0xc689=function(_0x4661d0,_0x7ab034){_0x4661d0=_0x4661d0-0x0;var _0x45b307=_0x689c[_0x4661d0];return _0x45b307;};'use strict';var Sequelize=require(_0xc689('0x0'));module[_0xc689('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xc689('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 773eb49..ad5220d 100644 --- a/server/api/pause/pause.controller.js +++ b/server/api/pause/pause.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5a2=['create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','update','destroy','get','Pauses','UserProfileResource','then','sendStatus','error','name','send','index','map','Pause','rawAttributes','fieldName','type','key','keys','filters','intersection','query','model','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x4be56f,_0x26f86d){var _0x385fc8=function(_0x2e9bb5){while(--_0x2e9bb5){_0x4be56f['push'](_0x4be56f['shift']());}};_0x385fc8(++_0x26f86d);}(_0xd5a2,0xad));var _0x2d5a=function(_0x368c45,_0x142c99){_0x368c45=_0x368c45-0x0;var _0xd6e02c=_0xd5a2[_0x368c45];return _0xd6e02c;};'use strict';var emlformat=require(_0x2d5a('0x0'));var rimraf=require(_0x2d5a('0x1'));var zipdir=require(_0x2d5a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2d5a('0x3'));var BPromise=require(_0x2d5a('0x4'));var Mustache=require(_0x2d5a('0x5'));var util=require(_0x2d5a('0x6'));var path=require(_0x2d5a('0x7'));var sox=require(_0x2d5a('0x8'));var csv=require('to-csv');var ejs=require(_0x2d5a('0x9'));var fs=require('fs');var fs_extra=require(_0x2d5a('0xa'));var _=require('lodash');var squel=require(_0x2d5a('0xb'));var crypto=require(_0x2d5a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2d5a('0xd'));var querystring=require(_0x2d5a('0xe'));var Papa=require('papaparse');var Redis=require(_0x2d5a('0xf'));var authService=require(_0x2d5a('0x10'));var qs=require(_0x2d5a('0x11'));var as=require(_0x2d5a('0x12'));var hardwareService=require(_0x2d5a('0x13'));var logger=require(_0x2d5a('0x14'))(_0x2d5a('0x15'));var utils=require(_0x2d5a('0x16'));var config=require(_0x2d5a('0x17'));var licenseUtil=require(_0x2d5a('0x18'));var db=require(_0x2d5a('0x19'))['db'];function respondWithStatusCode(_0x1914b2,_0x58f51d){_0x58f51d=_0x58f51d||0xcc;return function(_0x1c7b92){if(_0x1c7b92){return _0x1914b2['sendStatus'](_0x58f51d);}return _0x1914b2[_0x2d5a('0x1a')](_0x58f51d)[_0x2d5a('0x1b')]();};}function respondWithResult(_0x56b2ad,_0x582c4c){_0x582c4c=_0x582c4c||0xc8;return function(_0x2fe5d7){if(_0x2fe5d7){return _0x56b2ad['status'](_0x582c4c)[_0x2d5a('0x1c')](_0x2fe5d7);}};}function respondWithFilteredResult(_0x1118fd,_0x248ca5){return function(_0x55695c){if(_0x55695c){var _0x44a347=typeof _0x248ca5[_0x2d5a('0x1d')]==='undefined'&&typeof _0x248ca5[_0x2d5a('0x1e')]===_0x2d5a('0x1f');var _0x53b558=_0x55695c[_0x2d5a('0x20')];var _0x3ebaf4=_0x44a347?0x0:_0x248ca5[_0x2d5a('0x1d')];var _0x1391bf=_0x44a347?_0x55695c[_0x2d5a('0x20')]:_0x248ca5['offset']+_0x248ca5[_0x2d5a('0x1e')];var _0x389498;if(_0x1391bf>=_0x53b558){_0x1391bf=_0x53b558;_0x389498=0xc8;}else{_0x389498=0xce;}_0x1118fd[_0x2d5a('0x1a')](_0x389498);return _0x1118fd[_0x2d5a('0x21')]('Content-Range',_0x3ebaf4+'-'+_0x1391bf+'/'+_0x53b558)[_0x2d5a('0x1c')](_0x55695c);}return null;};}function patchUpdates(_0x57a605){return function(_0x5e34c6){try{jsonpatch['apply'](_0x5e34c6,_0x57a605,!![]);}catch(_0x29467e){return BPromise['reject'](_0x29467e);}return _0x5e34c6['save']();};}function saveUpdates(_0x4d1e3,_0x4e94af){return function(_0xd07d51){if(_0xd07d51){return _0xd07d51[_0x2d5a('0x22')](_0x4d1e3)['then'](function(_0x495d74){return _0x495d74;});}return null;};}function removeEntity(_0x4773d3,_0x6bc9a0){return function(_0x328e13){if(_0x328e13){return _0x328e13[_0x2d5a('0x23')]()['then'](function(){var _0xde33ea=_0x328e13[_0x2d5a('0x24')]({'plain':!![]});var _0x1cc4ee=_0x2d5a('0x25');return db[_0x2d5a('0x26')][_0x2d5a('0x23')]({'where':{'type':_0x1cc4ee,'resourceId':_0xde33ea['id']}})[_0x2d5a('0x27')](function(){return _0x328e13;});})[_0x2d5a('0x27')](function(){_0x4773d3[_0x2d5a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x346242,_0x377948){return function(_0x3114d9){if(!_0x3114d9){_0x346242[_0x2d5a('0x28')](0x194);}return _0x3114d9;};}function handleError(_0x5c3350,_0x1c5877){_0x1c5877=_0x1c5877||0x1f4;return function(_0x5b1e5b){logger[_0x2d5a('0x29')](_0x5b1e5b['stack']);if(_0x5b1e5b[_0x2d5a('0x2a')]){delete _0x5b1e5b[_0x2d5a('0x2a')];}_0x5c3350['status'](_0x1c5877)[_0x2d5a('0x2b')](_0x5b1e5b);};}exports[_0x2d5a('0x2c')]=function(_0xb1cd68,_0x519eb5){var _0x3b9e84={},_0x42d380={},_0x4053ea={'count':0x0,'rows':[]};var _0x2b9ee9=_[_0x2d5a('0x2d')](db[_0x2d5a('0x2e')][_0x2d5a('0x2f')],function(_0x3bdbe5){return{'name':_0x3bdbe5[_0x2d5a('0x30')],'type':_0x3bdbe5[_0x2d5a('0x31')][_0x2d5a('0x32')]};});_0x42d380['model']=_[_0x2d5a('0x2d')](_0x2b9ee9,_0x2d5a('0x2a'));_0x42d380['query']=_[_0x2d5a('0x33')](_0xb1cd68['query']);_0x42d380[_0x2d5a('0x34')]=_[_0x2d5a('0x35')](_0x42d380['model'],_0x42d380[_0x2d5a('0x36')]);_0x3b9e84['attributes']=_['intersection'](_0x42d380[_0x2d5a('0x37')],qs['fields'](_0xb1cd68[_0x2d5a('0x36')][_0x2d5a('0x38')]));_0x3b9e84[_0x2d5a('0x39')]=_0x3b9e84[_0x2d5a('0x39')][_0x2d5a('0x3a')]?_0x3b9e84[_0x2d5a('0x39')]:_0x42d380['model'];if(!_0xb1cd68[_0x2d5a('0x36')]['hasOwnProperty'](_0x2d5a('0x3b'))){_0x3b9e84[_0x2d5a('0x1e')]=qs[_0x2d5a('0x1e')](_0xb1cd68[_0x2d5a('0x36')][_0x2d5a('0x1e')]);_0x3b9e84[_0x2d5a('0x1d')]=qs['offset'](_0xb1cd68[_0x2d5a('0x36')][_0x2d5a('0x1d')]);}_0x3b9e84[_0x2d5a('0x3c')]=qs['sort'](_0xb1cd68['query'][_0x2d5a('0x3d')]);_0x3b9e84['where']=qs[_0x2d5a('0x34')](_['pick'](_0xb1cd68[_0x2d5a('0x36')],_0x42d380[_0x2d5a('0x34')]),_0x2b9ee9);if(_0xb1cd68[_0x2d5a('0x36')][_0x2d5a('0x3e')]){_0x3b9e84['where']=_['merge'](_0x3b9e84[_0x2d5a('0x3f')],{'$or':_[_0x2d5a('0x2d')](_0x2b9ee9,function(_0x19db1f){if(_0x19db1f[_0x2d5a('0x31')]!=='VIRTUAL'){var _0x20ee56={};_0x20ee56[_0x19db1f[_0x2d5a('0x2a')]]={'$like':'%'+_0xb1cd68[_0x2d5a('0x36')][_0x2d5a('0x3e')]+'%'};return _0x20ee56;}})});}_0x3b9e84=_[_0x2d5a('0x40')]({},_0x3b9e84,_0xb1cd68[_0x2d5a('0x41')]);var _0x2e7813={'where':_0x3b9e84[_0x2d5a('0x3f')]};return db[_0x2d5a('0x2e')][_0x2d5a('0x20')](_0x2e7813)[_0x2d5a('0x27')](function(_0x511642){_0x4053ea[_0x2d5a('0x20')]=_0x511642;if(_0xb1cd68[_0x2d5a('0x36')][_0x2d5a('0x42')]){_0x3b9e84[_0x2d5a('0x43')]=[{'all':!![]}];}return db[_0x2d5a('0x2e')][_0x2d5a('0x44')](_0x3b9e84);})[_0x2d5a('0x27')](function(_0x136dff){_0x4053ea[_0x2d5a('0x45')]=_0x136dff;return _0x4053ea;})['then'](respondWithFilteredResult(_0x519eb5,_0x3b9e84))[_0x2d5a('0x46')](handleError(_0x519eb5,null));};exports[_0x2d5a('0x47')]=function(_0x39d4d8,_0x1d4b5b){var _0x2476d4={'raw':!![],'where':{'id':_0x39d4d8[_0x2d5a('0x48')]['id']}},_0x48602f={};_0x48602f[_0x2d5a('0x37')]=_['keys'](db[_0x2d5a('0x2e')][_0x2d5a('0x2f')]);_0x48602f[_0x2d5a('0x36')]=_[_0x2d5a('0x33')](_0x39d4d8[_0x2d5a('0x36')]);_0x48602f['filters']=_[_0x2d5a('0x35')](_0x48602f[_0x2d5a('0x37')],_0x48602f[_0x2d5a('0x36')]);_0x2476d4['attributes']=_['intersection'](_0x48602f[_0x2d5a('0x37')],qs['fields'](_0x39d4d8[_0x2d5a('0x36')][_0x2d5a('0x38')]));_0x2476d4[_0x2d5a('0x39')]=_0x2476d4['attributes']['length']?_0x2476d4['attributes']:_0x48602f[_0x2d5a('0x37')];if(_0x39d4d8[_0x2d5a('0x36')]['includeAll']){_0x2476d4[_0x2d5a('0x43')]=[{'all':!![]}];}_0x2476d4=_[_0x2d5a('0x40')]({},_0x2476d4,_0x39d4d8['options']);return db[_0x2d5a('0x2e')]['find'](_0x2476d4)[_0x2d5a('0x27')](handleEntityNotFound(_0x1d4b5b,null))[_0x2d5a('0x27')](respondWithResult(_0x1d4b5b,null))[_0x2d5a('0x46')](handleError(_0x1d4b5b,null));};exports[_0x2d5a('0x49')]=function(_0x388ea1,_0x70ebab){return db[_0x2d5a('0x2e')][_0x2d5a('0x49')](_0x388ea1[_0x2d5a('0x4a')],{})['then'](function(_0xbfcaf1){var _0x428392=_0x388ea1[_0x2d5a('0x4b')][_0x2d5a('0x24')]({'plain':!![]});if(!_0x428392)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x428392[_0x2d5a('0x4c')]==='user'){var _0x142558=_0xbfcaf1[_0x2d5a('0x24')]({'plain':!![]});var _0x92b326=_0x2d5a('0x25');return db[_0x2d5a('0x4d')][_0x2d5a('0x4e')]({'where':{'name':_0x92b326,'userProfileId':_0x428392[_0x2d5a('0x4f')]},'raw':!![]})['then'](function(_0xab1d4e){if(_0xab1d4e&&_0xab1d4e[_0x2d5a('0x50')]===0x0){return db[_0x2d5a('0x26')][_0x2d5a('0x49')]({'name':_0x142558['name'],'resourceId':_0x142558['id'],'type':_0xab1d4e['name'],'sectionId':_0xab1d4e['id']},{})[_0x2d5a('0x27')](function(){return _0xbfcaf1;});}else{return _0xbfcaf1;}})[_0x2d5a('0x46')](function(_0x429e5e){logger[_0x2d5a('0x29')](_0x2d5a('0x51'),_0x429e5e);throw _0x429e5e;});}return _0xbfcaf1;})[_0x2d5a('0x27')](respondWithResult(_0x70ebab,0xc9))[_0x2d5a('0x46')](handleError(_0x70ebab,null));};exports[_0x2d5a('0x22')]=function(_0x5701bf,_0x188128){if(_0x5701bf[_0x2d5a('0x4a')]['id']){delete _0x5701bf[_0x2d5a('0x4a')]['id'];}return db['Pause']['find']({'where':{'id':_0x5701bf[_0x2d5a('0x48')]['id']}})['then'](handleEntityNotFound(_0x188128,null))[_0x2d5a('0x27')](saveUpdates(_0x5701bf[_0x2d5a('0x4a')],null))['then'](respondWithResult(_0x188128,null))[_0x2d5a('0x46')](handleError(_0x188128,null));};exports['destroy']=function(_0x462022,_0x1056bf){return db['Pause']['find']({'where':{'id':_0x462022[_0x2d5a('0x48')]['id']}})[_0x2d5a('0x27')](handleEntityNotFound(_0x1056bf,null))[_0x2d5a('0x27')](removeEntity(_0x1056bf,null))[_0x2d5a('0x46')](handleError(_0x1056bf,null));}; \ No newline at end of file +var _0x5c36=['fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','end','undefined','limit','count','json','apply','reject','update','destroy','then','get','Pauses','sendStatus','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c36,0xb7));var _0x65c3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5c36[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x65c3('0x0'));var rimraf=require(_0x65c3('0x1'));var zipdir=require(_0x65c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x65c3('0x3'));var BPromise=require(_0x65c3('0x4'));var Mustache=require('mustache');var util=require(_0x65c3('0x5'));var path=require('path');var sox=require(_0x65c3('0x6'));var csv=require(_0x65c3('0x7'));var ejs=require(_0x65c3('0x8'));var fs=require('fs');var fs_extra=require(_0x65c3('0x9'));var _=require('lodash');var squel=require(_0x65c3('0xa'));var crypto=require(_0x65c3('0xb'));var jsforce=require(_0x65c3('0xc'));var deskjs=require(_0x65c3('0xd'));var toCsv=require(_0x65c3('0x7'));var querystring=require(_0x65c3('0xe'));var Papa=require(_0x65c3('0xf'));var Redis=require('ioredis');var authService=require(_0x65c3('0x10'));var qs=require(_0x65c3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x65c3('0x12'))(_0x65c3('0x13'));var utils=require(_0x65c3('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22a30b,_0x1e8118){_0x1e8118=_0x1e8118||0xcc;return function(_0x567f50){if(_0x567f50){return _0x22a30b['sendStatus'](_0x1e8118);}return _0x22a30b[_0x65c3('0x15')](_0x1e8118)[_0x65c3('0x16')]();};}function respondWithResult(_0x367c1a,_0x34a2a5){_0x34a2a5=_0x34a2a5||0xc8;return function(_0x4a4a5d){if(_0x4a4a5d){return _0x367c1a[_0x65c3('0x15')](_0x34a2a5)['json'](_0x4a4a5d);}};}function respondWithFilteredResult(_0x5da1d9,_0x3bd552){return function(_0x193dd3){if(_0x193dd3){var _0x24af85=typeof _0x3bd552['offset']===_0x65c3('0x17')&&typeof _0x3bd552[_0x65c3('0x18')]===_0x65c3('0x17');var _0x26809d=_0x193dd3[_0x65c3('0x19')];var _0x392aee=_0x24af85?0x0:_0x3bd552['offset'];var _0x5d6eb3=_0x24af85?_0x193dd3['count']:_0x3bd552['offset']+_0x3bd552[_0x65c3('0x18')];var _0x19d1bc;if(_0x5d6eb3>=_0x26809d){_0x5d6eb3=_0x26809d;_0x19d1bc=0xc8;}else{_0x19d1bc=0xce;}_0x5da1d9[_0x65c3('0x15')](_0x19d1bc);return _0x5da1d9['set']('Content-Range',_0x392aee+'-'+_0x5d6eb3+'/'+_0x26809d)[_0x65c3('0x1a')](_0x193dd3);}return null;};}function patchUpdates(_0x5befcb){return function(_0x3ac618){try{jsonpatch[_0x65c3('0x1b')](_0x3ac618,_0x5befcb,!![]);}catch(_0x3e9e1){return BPromise[_0x65c3('0x1c')](_0x3e9e1);}return _0x3ac618['save']();};}function saveUpdates(_0x4e4856,_0x28eb84){return function(_0x5b0fb2){if(_0x5b0fb2){return _0x5b0fb2[_0x65c3('0x1d')](_0x4e4856)['then'](function(_0x1184ac){return _0x1184ac;});}return null;};}function removeEntity(_0x3e17b9,_0x110de1){return function(_0x12f6b6){if(_0x12f6b6){return _0x12f6b6[_0x65c3('0x1e')]()[_0x65c3('0x1f')](function(){var _0xce69cd=_0x12f6b6[_0x65c3('0x20')]({'plain':!![]});var _0x3eeba3=_0x65c3('0x21');return db['UserProfileResource'][_0x65c3('0x1e')]({'where':{'type':_0x3eeba3,'resourceId':_0xce69cd['id']}})[_0x65c3('0x1f')](function(){return _0x12f6b6;});})['then'](function(){_0x3e17b9['status'](0xcc)[_0x65c3('0x16')]();});}};}function handleEntityNotFound(_0x541b10,_0x46cc35){return function(_0x430a6c){if(!_0x430a6c){_0x541b10[_0x65c3('0x22')](0x194);}return _0x430a6c;};}function handleError(_0x1c96df,_0x59f0fb){_0x59f0fb=_0x59f0fb||0x1f4;return function(_0x36b7e3){logger[_0x65c3('0x23')](_0x36b7e3[_0x65c3('0x24')]);if(_0x36b7e3['name']){delete _0x36b7e3[_0x65c3('0x25')];}_0x1c96df[_0x65c3('0x15')](_0x59f0fb)[_0x65c3('0x26')](_0x36b7e3);};}exports[_0x65c3('0x27')]=function(_0x321434,_0x33d2ce){var _0x4aebee={},_0x8599d8={},_0x245c05={'count':0x0,'rows':[]};var _0x5e9a26=_[_0x65c3('0x28')](db[_0x65c3('0x29')][_0x65c3('0x2a')],function(_0x3a48e3){return{'name':_0x3a48e3[_0x65c3('0x2b')],'type':_0x3a48e3[_0x65c3('0x2c')][_0x65c3('0x2d')]};});_0x8599d8[_0x65c3('0x2e')]=_[_0x65c3('0x28')](_0x5e9a26,_0x65c3('0x25'));_0x8599d8[_0x65c3('0x2f')]=_[_0x65c3('0x30')](_0x321434['query']);_0x8599d8[_0x65c3('0x31')]=_[_0x65c3('0x32')](_0x8599d8['model'],_0x8599d8[_0x65c3('0x2f')]);_0x4aebee['attributes']=_['intersection'](_0x8599d8[_0x65c3('0x2e')],qs[_0x65c3('0x33')](_0x321434['query']['fields']));_0x4aebee[_0x65c3('0x34')]=_0x4aebee['attributes'][_0x65c3('0x35')]?_0x4aebee['attributes']:_0x8599d8['model'];if(!_0x321434[_0x65c3('0x2f')][_0x65c3('0x36')](_0x65c3('0x37'))){_0x4aebee[_0x65c3('0x18')]=qs[_0x65c3('0x18')](_0x321434[_0x65c3('0x2f')][_0x65c3('0x18')]);_0x4aebee[_0x65c3('0x38')]=qs[_0x65c3('0x38')](_0x321434[_0x65c3('0x2f')][_0x65c3('0x38')]);}_0x4aebee[_0x65c3('0x39')]=qs[_0x65c3('0x3a')](_0x321434[_0x65c3('0x2f')][_0x65c3('0x3a')]);_0x4aebee[_0x65c3('0x3b')]=qs[_0x65c3('0x31')](_[_0x65c3('0x3c')](_0x321434[_0x65c3('0x2f')],_0x8599d8[_0x65c3('0x31')]),_0x5e9a26);if(_0x321434['query']['filter']){_0x4aebee[_0x65c3('0x3b')]=_['merge'](_0x4aebee[_0x65c3('0x3b')],{'$or':_['map'](_0x5e9a26,function(_0x1eed81){if(_0x1eed81['type']!==_0x65c3('0x3d')){var _0x10f61c={};_0x10f61c[_0x1eed81['name']]={'$like':'%'+_0x321434[_0x65c3('0x2f')][_0x65c3('0x3e')]+'%'};return _0x10f61c;}})});}_0x4aebee=_[_0x65c3('0x3f')]({},_0x4aebee,_0x321434[_0x65c3('0x40')]);var _0x4b5d72={'where':_0x4aebee[_0x65c3('0x3b')]};return db[_0x65c3('0x29')][_0x65c3('0x19')](_0x4b5d72)[_0x65c3('0x1f')](function(_0x46fa6a){_0x245c05[_0x65c3('0x19')]=_0x46fa6a;if(_0x321434['query'][_0x65c3('0x41')]){_0x4aebee[_0x65c3('0x42')]=[{'all':!![]}];}return db[_0x65c3('0x29')][_0x65c3('0x43')](_0x4aebee);})[_0x65c3('0x1f')](function(_0x8e2abb){_0x245c05[_0x65c3('0x44')]=_0x8e2abb;return _0x245c05;})['then'](respondWithFilteredResult(_0x33d2ce,_0x4aebee))[_0x65c3('0x45')](handleError(_0x33d2ce,null));};exports[_0x65c3('0x46')]=function(_0x2d99b7,_0x2dfca8){var _0x174efc={'raw':!![],'where':{'id':_0x2d99b7[_0x65c3('0x47')]['id']}},_0x3207f1={};_0x3207f1[_0x65c3('0x2e')]=_['keys'](db[_0x65c3('0x29')][_0x65c3('0x2a')]);_0x3207f1['query']=_[_0x65c3('0x30')](_0x2d99b7['query']);_0x3207f1[_0x65c3('0x31')]=_[_0x65c3('0x32')](_0x3207f1[_0x65c3('0x2e')],_0x3207f1[_0x65c3('0x2f')]);_0x174efc[_0x65c3('0x34')]=_[_0x65c3('0x32')](_0x3207f1[_0x65c3('0x2e')],qs[_0x65c3('0x33')](_0x2d99b7[_0x65c3('0x2f')][_0x65c3('0x33')]));_0x174efc[_0x65c3('0x34')]=_0x174efc[_0x65c3('0x34')][_0x65c3('0x35')]?_0x174efc['attributes']:_0x3207f1['model'];if(_0x2d99b7[_0x65c3('0x2f')][_0x65c3('0x41')]){_0x174efc[_0x65c3('0x42')]=[{'all':!![]}];}_0x174efc=_[_0x65c3('0x3f')]({},_0x174efc,_0x2d99b7[_0x65c3('0x40')]);return db[_0x65c3('0x29')][_0x65c3('0x48')](_0x174efc)[_0x65c3('0x1f')](handleEntityNotFound(_0x2dfca8,null))[_0x65c3('0x1f')](respondWithResult(_0x2dfca8,null))['catch'](handleError(_0x2dfca8,null));};exports[_0x65c3('0x49')]=function(_0x5a8da3,_0x4d5cdf){return db['Pause'][_0x65c3('0x49')](_0x5a8da3[_0x65c3('0x4a')],{})[_0x65c3('0x1f')](function(_0x351904){var _0x91e863=_0x5a8da3['user']['get']({'plain':!![]});if(!_0x91e863)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x91e863['role']==='user'){var _0x1a1318=_0x351904[_0x65c3('0x20')]({'plain':!![]});var _0x5a21ce=_0x65c3('0x21');return db[_0x65c3('0x4b')]['find']({'where':{'name':_0x5a21ce,'userProfileId':_0x91e863[_0x65c3('0x4c')]},'raw':!![]})[_0x65c3('0x1f')](function(_0x575ea3){if(_0x575ea3&&_0x575ea3[_0x65c3('0x4d')]===0x0){return db['UserProfileResource'][_0x65c3('0x49')]({'name':_0x1a1318[_0x65c3('0x25')],'resourceId':_0x1a1318['id'],'type':_0x575ea3[_0x65c3('0x25')],'sectionId':_0x575ea3['id']},{})['then'](function(){return _0x351904;});}else{return _0x351904;}})[_0x65c3('0x45')](function(_0x3b5b6a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b5b6a);throw _0x3b5b6a;});}return _0x351904;})[_0x65c3('0x1f')](respondWithResult(_0x4d5cdf,0xc9))[_0x65c3('0x45')](handleError(_0x4d5cdf,null));};exports['update']=function(_0x41b319,_0x3070d2){if(_0x41b319['body']['id']){delete _0x41b319['body']['id'];}return db['Pause']['find']({'where':{'id':_0x41b319[_0x65c3('0x47')]['id']}})[_0x65c3('0x1f')](handleEntityNotFound(_0x3070d2,null))[_0x65c3('0x1f')](saveUpdates(_0x41b319[_0x65c3('0x4a')],null))['then'](respondWithResult(_0x3070d2,null))[_0x65c3('0x45')](handleError(_0x3070d2,null));};exports[_0x65c3('0x1e')]=function(_0x21abcc,_0x3b2fb1){return db[_0x65c3('0x29')]['find']({'where':{'id':_0x21abcc['params']['id']}})['then'](handleEntityNotFound(_0x3b2fb1,null))[_0x65c3('0x1f')](removeEntity(_0x3b2fb1,null))[_0x65c3('0x45')](handleError(_0x3b2fb1,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 91213a7..ea87942 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0xcef242,_0x569e9a){var _0x2b9e80=function(_0xa4cb4f){while(--_0xa4cb4f){_0xcef242['push'](_0xcef242['shift']());}};_0x2b9e80(++_0x569e9a);}(_0xabce,0x103));var _0xeabc=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xabce[_0x257642];return _0x3d813b;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4045ff,_0x46cbcd){_0x4045ff=_0x4045ff-0x0;var _0x5797ac=_0x7fbe[_0x4045ff];return _0x5797ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 636f442..85391ae 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x228ee2,_0x38935b){var _0x1159bf=function(_0x20b306){while(--_0x20b306){_0x228ee2['push'](_0x228ee2['shift']());}};_0x1159bf(++_0x38935b);}(_0xb10b,0x12a));var _0xbb10=function(_0x29b2d0,_0x73bf4b){_0x29b2d0=_0x29b2d0-0x0;var _0x4af937=_0xb10b[_0x29b2d0];return _0x4af937;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x1a513b,_0x3322bf){var _0x808c94=function(_0x1dd825){while(--_0x1dd825){_0x1a513b['push'](_0x1a513b['shift']());}};_0x808c94(++_0x3322bf);}(_0x7a54,0x106));var _0x47a5=function(_0x4dc25d,_0x51bd15){_0x4dc25d=_0x4dc25d-0x0;var _0x3437a2=_0x7a54[_0x4dc25d];return _0x3437a2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index d2ca255..8c14ca3 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d9e=['upload','webhookPost','put','delete','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','%s-%s%s','basename','originalname','now','extname','single','file'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x1c2a7d,_0x1d20f9){_0x1c2a7d=_0x1c2a7d-0x0;var _0x39b3c2=_0x4d9e[_0x1c2a7d];return _0x39b3c2;};'use strict';var multer=require(_0xe4d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe4d9('0x1'));var express=require('express');var router=express[_0xe4d9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe4d9('0x3'));var interaction=require(_0xe4d9('0x4'));var config=require('../../config/environment');var controller=require(_0xe4d9('0x5'));router[_0xe4d9('0x6')]('/',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x8')]);router[_0xe4d9('0x6')](_0xe4d9('0x9'),controller['webhookGet']);router[_0xe4d9('0x6')](_0xe4d9('0xa'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xb')]);router[_0xe4d9('0x6')](_0xe4d9('0xc'),auth['isAuthenticated'](),controller[_0xe4d9('0xd')]);var upload=multer({'storage':multer[_0xe4d9('0xe')]({'destination':function(_0x32eb8a,_0x3575ac,_0xddd1fb){_0xddd1fb(null,path[_0xe4d9('0xf')](config[_0xe4d9('0x10')],'server/files/plugins'));},'filename':function(_0x5ee099,_0x580c50,_0x4e0d15){_0x580c50['originalname']=_0x580c50['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4e0d15(null,util['format'](_0xe4d9('0x11'),path[_0xe4d9('0x12')](_0x580c50[_0xe4d9('0x13')],path['extname'](_0x580c50[_0xe4d9('0x13')])),Date[_0xe4d9('0x14')](),path[_0xe4d9('0x15')](_0x580c50[_0xe4d9('0x13')])));}})});router['post']('/',upload[_0xe4d9('0x16')](_0xe4d9('0x17')),controller[_0xe4d9('0x18')]);router['post']('/webhook',controller[_0xe4d9('0x19')]);router[_0xe4d9('0x1a')]('/:id',auth[_0xe4d9('0x7')](),controller['update']);router[_0xe4d9('0x1b')](_0xe4d9('0xa'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xac31=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','single','file','upload','put','update','delete','exports','multer','util'];(function(_0xd90039,_0x37c137){var _0x486dd9=function(_0x502a44){while(--_0x502a44){_0xd90039['push'](_0xd90039['shift']());}};_0x486dd9(++_0x37c137);}(_0xac31,0xca));var _0x1ac3=function(_0x4692be,_0xb9367){_0x4692be=_0x4692be-0x0;var _0x23b278=_0xac31[_0x4692be];return _0x23b278;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var fs_extra=require(_0x1ac3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var controller=require('./plugin.controller');router['get']('/',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0xa')]);router[_0x1ac3('0xb')](_0x1ac3('0xc'),controller[_0x1ac3('0xd')]);router['get'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0xb')](_0x1ac3('0x10'),auth['isAuthenticated'](),controller[_0x1ac3('0x11')]);var upload=multer({'storage':multer[_0x1ac3('0x12')]({'destination':function(_0x3e835b,_0x24f0d2,_0x2a8dc7){_0x2a8dc7(null,path[_0x1ac3('0x13')](config['root'],_0x1ac3('0x14')));},'filename':function(_0x376814,_0x2eeabf,_0x2338b9){_0x2eeabf['originalname']=_0x2eeabf[_0x1ac3('0x15')][_0x1ac3('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2338b9(null,util[_0x1ac3('0x17')](_0x1ac3('0x18'),path['basename'](_0x2eeabf[_0x1ac3('0x15')],path[_0x1ac3('0x19')](_0x2eeabf['originalname'])),Date[_0x1ac3('0x1a')](),path[_0x1ac3('0x19')](_0x2eeabf[_0x1ac3('0x15')])));}})});router['post']('/',upload[_0x1ac3('0x1b')](_0x1ac3('0x1c')),controller[_0x1ac3('0x1d')]);router['post'](_0x1ac3('0xc'),controller['webhookPost']);router[_0x1ac3('0x1e')](_0x1ac3('0xe'),auth[_0x1ac3('0x9')](),controller[_0x1ac3('0x1f')]);router[_0x1ac3('0x20')]('/:id',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0x20')]);module[_0x1ac3('0x21')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3b9370b..0746631 100644 --- a/server/api/plugin/plugin.attributes.js +++ b/server/api/plugin/plugin.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3701=['ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','sequelize','STRING'];(function(_0x34af74,_0x59ab9d){var _0x12d74b=function(_0x51a854){while(--_0x51a854){_0x34af74['push'](_0x34af74['shift']());}};_0x12d74b(++_0x59ab9d);}(_0x3701,0x112));var _0x1370=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3701[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1370('0x0'));module['exports']={'name':{'type':Sequelize[_0x1370('0x1')]},'type':{'type':Sequelize[_0x1370('0x2')](_0x1370('0x3'),_0x1370('0x4'))},'description':{'type':Sequelize[_0x1370('0x5')]},'version':{'type':Sequelize[_0x1370('0x5')]},'path':{'type':Sequelize[_0x1370('0x1')],'comment':_0x1370('0x6')},'active':{'type':Sequelize[_0x1370('0x7')],'defaultValue':0x0,'comment':_0x1370('0x8')},'sidebar':{'type':Sequelize[_0x1370('0x2')](_0x1370('0x9'),'agentOnly',_0x1370('0xa'),_0x1370('0xb')),'defaultValue':_0x1370('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x1370('0x1')]},'agentUrl':{'type':Sequelize[_0x1370('0x1')]},'scriptName':{'type':Sequelize[_0x1370('0x1')]},'scriptPath':{'type':Sequelize[_0x1370('0x1')]}}; \ No newline at end of file +var _0x2754=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly'];(function(_0x20d944,_0x1a4bab){var _0x52c56c=function(_0x16a548){while(--_0x16a548){_0x20d944['push'](_0x20d944['shift']());}};_0x52c56c(++_0x1a4bab);}(_0x2754,0x1e4));var _0x4275=function(_0x548467,_0x5ef1f2){_0x548467=_0x548467-0x0;var _0x53c1b0=_0x2754[_0x548467];return _0x53c1b0;};'use strict';var Sequelize=require(_0x4275('0x0'));module['exports']={'name':{'type':Sequelize[_0x4275('0x1')]},'type':{'type':Sequelize['ENUM']('html',_0x4275('0x2'))},'description':{'type':Sequelize[_0x4275('0x3')]},'version':{'type':Sequelize[_0x4275('0x3')]},'path':{'type':Sequelize[_0x4275('0x1')],'comment':_0x4275('0x4')},'active':{'type':Sequelize[_0x4275('0x5')],'defaultValue':0x0,'comment':_0x4275('0x6')},'sidebar':{'type':Sequelize[_0x4275('0x7')](_0x4275('0x8'),_0x4275('0x9'),_0x4275('0xa'),_0x4275('0xb')),'defaultValue':_0x4275('0xa'),'comment':_0x4275('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x4275('0x1')]},'scriptName':{'type':Sequelize[_0x4275('0x1')]},'scriptPath':{'type':Sequelize[_0x4275('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index a3d3b49..b92bb6e 100644 --- a/server/api/plugin/plugin.controller.js +++ b/server/api/plugin/plugin.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3afb=['Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','update','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','resolve','http://localhost:','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','rimraf','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','Plugin','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','download','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','path','attachments/**/*','finalize','close','existsSync','format','unlinkSync','info','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing'];(function(_0x43553b,_0x296937){var _0x526461=function(_0x3d37cc){while(--_0x3d37cc){_0x43553b['push'](_0x43553b['shift']());}};_0x526461(++_0x296937);}(_0x3afb,0xd6));var _0xb3af=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0x3afb[_0x532d78];return _0x5990c4;};'use strict';var emlformat=require(_0xb3af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3af('0x1'));var jsonpatch=require(_0xb3af('0x2'));var rp=require(_0xb3af('0x3'));var moment=require(_0xb3af('0x4'));var BPromise=require(_0xb3af('0x5'));var Mustache=require('mustache');var util=require(_0xb3af('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb3af('0x7'));var ejs=require(_0xb3af('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb3af('0x9'));var squel=require(_0xb3af('0xa'));var crypto=require('crypto');var jsforce=require(_0xb3af('0xb'));var deskjs=require(_0xb3af('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb3af('0xd'));var extract=require('extract-zip');var rimraf=require(_0xb3af('0xe'));var archiver=require(_0xb3af('0xf'));var Redis=require(_0xb3af('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb3af('0x11'));var as=require(_0xb3af('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb3af('0x13'))(_0xb3af('0x14'));var utils=require(_0xb3af('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb3af('0x16'));var db=require(_0xb3af('0x17'))['db'];config[_0xb3af('0x18')]=_['defaults'](config[_0xb3af('0x18')],{'host':_0xb3af('0x19'),'port':0x18eb});var socket=require(_0xb3af('0x1a'))(new Redis(config[_0xb3af('0x18')]));require(_0xb3af('0x1b'))[_0xb3af('0x1c')](socket);function respondWithStatusCode(_0x20dc5a,_0x403fbd){_0x403fbd=_0x403fbd||0xcc;return function(_0x1a8502){if(_0x1a8502){return _0x20dc5a['sendStatus'](_0x403fbd);}return _0x20dc5a[_0xb3af('0x1d')](_0x403fbd)[_0xb3af('0x1e')]();};}function respondWithResult(_0x2df9ca,_0x4d8d70){_0x4d8d70=_0x4d8d70||0xc8;return function(_0x493213){if(_0x493213){return _0x2df9ca[_0xb3af('0x1d')](_0x4d8d70)['json'](_0x493213);}};}function respondWithFilteredResult(_0x10a510,_0x250ee2){return function(_0x5601fa){if(_0x5601fa){var _0x20d4b4=typeof _0x250ee2['offset']===_0xb3af('0x1f')&&typeof _0x250ee2[_0xb3af('0x20')]===_0xb3af('0x1f');var _0x212fec=_0x5601fa[_0xb3af('0x21')];var _0x4c7a78=_0x20d4b4?0x0:_0x250ee2[_0xb3af('0x22')];var _0xae5d7e=_0x20d4b4?_0x5601fa[_0xb3af('0x21')]:_0x250ee2['offset']+_0x250ee2[_0xb3af('0x20')];var _0x1ad9df;if(_0xae5d7e>=_0x212fec){_0xae5d7e=_0x212fec;_0x1ad9df=0xc8;}else{_0x1ad9df=0xce;}_0x10a510[_0xb3af('0x1d')](_0x1ad9df);return _0x10a510['set'](_0xb3af('0x23'),_0x4c7a78+'-'+_0xae5d7e+'/'+_0x212fec)[_0xb3af('0x24')](_0x5601fa);}return null;};}function patchUpdates(_0x312e91){return function(_0xd3c2c2){try{jsonpatch[_0xb3af('0x25')](_0xd3c2c2,_0x312e91,!![]);}catch(_0x115840){return BPromise[_0xb3af('0x26')](_0x115840);}return _0xd3c2c2[_0xb3af('0x27')]();};}function saveUpdates(_0x155bf1,_0x4ee527){return function(_0x4c24e9){if(_0x4c24e9){return _0x4c24e9['update'](_0x155bf1)[_0xb3af('0x28')](function(_0x3d959f){return _0x3d959f;});}return null;};}function removeEntity(_0x515ad1,_0x1f27c3){return function(_0x2897fd){if(_0x2897fd){return _0x2897fd[_0xb3af('0x29')]()[_0xb3af('0x28')](function(){var _0x5dcaa3=_0x2897fd[_0xb3af('0x2a')]({'plain':!![]});var _0xd56ece=_0xb3af('0x2b');return db[_0xb3af('0x2c')][_0xb3af('0x29')]({'where':{'type':_0xd56ece,'resourceId':_0x5dcaa3['id']}})[_0xb3af('0x28')](function(){return _0x2897fd;});})['then'](function(){_0x515ad1[_0xb3af('0x1d')](0xcc)[_0xb3af('0x1e')]();});}};}function handleEntityNotFound(_0x539b69,_0x29863d){return function(_0x2be50f){if(!_0x2be50f){_0x539b69[_0xb3af('0x2d')](0x194);}return _0x2be50f;};}function handleError(_0x3af2bc,_0xd34286){_0xd34286=_0xd34286||0x1f4;return function(_0x34e150){logger[_0xb3af('0x2e')](_0x34e150[_0xb3af('0x2f')]);if(_0x34e150[_0xb3af('0x30')]){delete _0x34e150[_0xb3af('0x30')];}_0x3af2bc[_0xb3af('0x1d')](_0xd34286)[_0xb3af('0x31')](_0x34e150);};}exports[_0xb3af('0x32')]=function(_0x241d47,_0x3df750){var _0x42f58e={},_0x4a785c={},_0x5b7a02={'count':0x0,'rows':[]};var _0x276268=_['map'](db[_0xb3af('0x33')][_0xb3af('0x34')],function(_0x4442fe){return{'name':_0x4442fe[_0xb3af('0x35')],'type':_0x4442fe['type'][_0xb3af('0x36')]};});_0x4a785c[_0xb3af('0x37')]=_[_0xb3af('0x38')](_0x276268,_0xb3af('0x30'));_0x4a785c[_0xb3af('0x39')]=_[_0xb3af('0x3a')](_0x241d47[_0xb3af('0x39')]);_0x4a785c[_0xb3af('0x3b')]=_[_0xb3af('0x3c')](_0x4a785c[_0xb3af('0x37')],_0x4a785c[_0xb3af('0x39')]);_0x42f58e[_0xb3af('0x3d')]=_[_0xb3af('0x3c')](_0x4a785c[_0xb3af('0x37')],qs[_0xb3af('0x3e')](_0x241d47['query']['fields']));_0x42f58e[_0xb3af('0x3d')]=_0x42f58e['attributes'][_0xb3af('0x3f')]?_0x42f58e[_0xb3af('0x3d')]:_0x4a785c[_0xb3af('0x37')];if(!_0x241d47[_0xb3af('0x39')][_0xb3af('0x40')](_0xb3af('0x41'))){_0x42f58e['limit']=qs['limit'](_0x241d47['query'][_0xb3af('0x20')]);_0x42f58e[_0xb3af('0x22')]=qs['offset'](_0x241d47[_0xb3af('0x39')]['offset']);}_0x42f58e[_0xb3af('0x42')]=qs[_0xb3af('0x43')](_0x241d47['query']['sort']);_0x42f58e[_0xb3af('0x44')]=qs[_0xb3af('0x3b')](_['pick'](_0x241d47[_0xb3af('0x39')],_0x4a785c[_0xb3af('0x3b')]),_0x276268);if(_0x241d47['query'][_0xb3af('0x45')]){_0x42f58e[_0xb3af('0x44')]=_[_0xb3af('0x46')](_0x42f58e['where'],{'$or':_[_0xb3af('0x38')](_0x276268,function(_0x3a8fb6){if(_0x3a8fb6[_0xb3af('0x47')]!=='VIRTUAL'){var _0x2708f5={};_0x2708f5[_0x3a8fb6[_0xb3af('0x30')]]={'$like':'%'+_0x241d47[_0xb3af('0x39')]['filter']+'%'};return _0x2708f5;}})});}_0x42f58e=_[_0xb3af('0x46')]({},_0x42f58e,_0x241d47[_0xb3af('0x48')]);var _0x32bc6a={'where':_0x42f58e[_0xb3af('0x44')]};return db[_0xb3af('0x33')][_0xb3af('0x21')](_0x32bc6a)['then'](function(_0x140b3b){_0x5b7a02[_0xb3af('0x21')]=_0x140b3b;if(_0x241d47[_0xb3af('0x39')][_0xb3af('0x49')]){_0x42f58e[_0xb3af('0x4a')]=[{'all':!![]}];}return db['Plugin'][_0xb3af('0x4b')](_0x42f58e);})['then'](function(_0x535e21){_0x5b7a02[_0xb3af('0x4c')]=_0x535e21;return _0x5b7a02;})[_0xb3af('0x28')](respondWithFilteredResult(_0x3df750,_0x42f58e))[_0xb3af('0x4d')](handleError(_0x3df750,null));};exports[_0xb3af('0x4e')]=function(_0x1bb88f,_0x27136e){var _0x402bf7={'raw':!![],'where':{'id':_0x1bb88f[_0xb3af('0x4f')]['id']}},_0x5d7f65={};_0x5d7f65['model']=_[_0xb3af('0x3a')](db['Plugin'][_0xb3af('0x34')]);_0x5d7f65[_0xb3af('0x39')]=_['keys'](_0x1bb88f[_0xb3af('0x39')]);_0x5d7f65['filters']=_['intersection'](_0x5d7f65[_0xb3af('0x37')],_0x5d7f65[_0xb3af('0x39')]);_0x402bf7[_0xb3af('0x3d')]=_[_0xb3af('0x3c')](_0x5d7f65[_0xb3af('0x37')],qs['fields'](_0x1bb88f[_0xb3af('0x39')][_0xb3af('0x3e')]));_0x402bf7[_0xb3af('0x3d')]=_0x402bf7['attributes']['length']?_0x402bf7['attributes']:_0x5d7f65[_0xb3af('0x37')];if(_0x1bb88f[_0xb3af('0x39')][_0xb3af('0x49')]){_0x402bf7[_0xb3af('0x4a')]=[{'all':!![]}];}_0x402bf7=_['merge']({},_0x402bf7,_0x1bb88f[_0xb3af('0x48')]);return db[_0xb3af('0x33')][_0xb3af('0x50')](_0x402bf7)[_0xb3af('0x28')](handleEntityNotFound(_0x27136e,null))[_0xb3af('0x28')](respondWithResult(_0x27136e,null))[_0xb3af('0x4d')](handleError(_0x27136e,null));};exports[_0xb3af('0x51')]=function(_0xaa2ac0,_0x3030de,_0x247c2d){return db[_0xb3af('0x33')]['find']({'where':{'id':_0xaa2ac0[_0xb3af('0x4f')]['id']},'attributes':['name','path'],'raw':!![]})['then'](handleEntityNotFound(_0x3030de,null))[_0xb3af('0x28')](function(_0x545bd3){if(_0x545bd3){var _0x18b618=path[_0xb3af('0x52')](config[_0xb3af('0x53')],_0xb3af('0x54'),util['format'](_0xb3af('0x55'),path[_0xb3af('0x56')](_0x545bd3['path'])));var _0x3c839d=fs[_0xb3af('0x57')](_0x18b618);var _0x1f3711=archiver(_0xb3af('0x58'),{'zlib':{'level':0x9}});_0x1f3711['on'](_0xb3af('0x59'),function(_0x48b34d){if(_0x48b34d[_0xb3af('0x5a')]===_0xb3af('0x5b')){logger[_0xb3af('0x2e')](_0x48b34d);}else{throw new db[(_0xb3af('0x5c'))][(_0xb3af('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1f3711['on'](_0xb3af('0x2e'),function(_0x5d0034){throw new db[(_0xb3af('0x5c'))][(_0xb3af('0x5d'))](_0xb3af('0x5e'));});_0x1f3711[_0xb3af('0x5f')](_0x3c839d);_0x1f3711[_0xb3af('0x60')](_0xb3af('0x61'),{'cwd':path[_0xb3af('0x52')](config[_0xb3af('0x53')],_0xb3af('0x54'),path['dirname'](_0x545bd3['path'])),'ignore':[path['join'](path[_0xb3af('0x56')](_0x545bd3[_0xb3af('0x62')]),'node_modules/**/*'),path['join'](path[_0xb3af('0x56')](_0x545bd3[_0xb3af('0x62')]),_0xb3af('0x63'))],'nodir':!![]})[_0xb3af('0x64')]();_0x3c839d['on'](_0xb3af('0x65'),function(){if(!fs[_0xb3af('0x66')](_0x18b618)){throw new db[(_0xb3af('0x5c'))]['Error']('Plugin\x20not\x20found');}return _0x3030de[_0xb3af('0x51')](_0x18b618,util[_0xb3af('0x67')]('%s.zip',path['basename'](_0x545bd3[_0xb3af('0x62')])),function(_0x470c24){if(_0x470c24){throw new db['Sequelize'][(_0xb3af('0x5d'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xb3af('0x68')](_0x18b618);logger[_0xb3af('0x69')]('Download\x20completed');logger[_0xb3af('0x69')]('Temporary\x20file\x20removed');});});}return null;})[_0xb3af('0x4d')](handleError(_0x3030de,null));};exports[_0xb3af('0x6a')]=function(_0x8cf670,_0x47ba3a,_0x26b5f3){var _0x1d66e0=path[_0xb3af('0x56')](_0x8cf670['file'][_0xb3af('0x6b')],path[_0xb3af('0x6c')](_0x8cf670[_0xb3af('0x6d')][_0xb3af('0x6b')]));var _0x6047d=path['join'](config['root'],_0xb3af('0x54'),_0x8cf670[_0xb3af('0x6d')][_0xb3af('0x6b')]);var _0x209eec=path[_0xb3af('0x52')](config[_0xb3af('0x53')],_0xb3af('0x54'),_0x1d66e0);logger[_0xb3af('0x69')](_0xb3af('0x6e'),_0x6047d);logger[_0xb3af('0x69')](_0xb3af('0x6f'),_0x209eec);try{fs[_0xb3af('0x70')](_0x6047d,parseInt(_0xb3af('0x71'),0x8));extract(_0x6047d,{'dir':_0x209eec},function(_0x58d1c7){if(_0x58d1c7){logger['error'](_0x58d1c7);handleError(_0x58d1c7,!![]);};var _0x182c24=fs[_0xb3af('0x72')](_0x209eec);if(_0x182c24[_0xb3af('0x3f')]>0x1){removeReferences(_0x6047d,_0x209eec);logger['error'](_0xb3af('0x73'));return _0x26b5f3(new Error('Invalid\x20plugin\x20structure'));}var _0x4a5bf1=fs[_0xb3af('0x74')](path[_0xb3af('0x52')](_0x209eec,_0x182c24[0x0]));if(_0x4a5bf1[_0xb3af('0x75')]()){removeReferences(_0x6047d,_0x209eec);logger[_0xb3af('0x2e')]('Invalid\x20plugin\x20structure');return _0x26b5f3(new Error(_0xb3af('0x73')));}if(_0x4a5bf1[_0xb3af('0x76')]()){var _0x2e9642=fs[_0xb3af('0x72')](path[_0xb3af('0x52')](_0x209eec,_0x182c24[0x0]));if(_0x2e9642[_0xb3af('0x3f')]===0x0){removeReferences(_0x6047d,_0x209eec);logger[_0xb3af('0x2e')](_0xb3af('0x73'));return _0x26b5f3(new Error(_0xb3af('0x73')));}var _0x3b0ea0=_0x2e9642[_0xb3af('0x77')](function(_0x2ca92f){return _0x2ca92f===_0xb3af('0x78');});if(!_0x3b0ea0){return _0x26b5f3(new Error(_0xb3af('0x79')));}var _0x540f73=fs['readFileSync'](path[_0xb3af('0x52')](_0x209eec,_0x182c24[0x0],_0xb3af('0x78')));var _0xf8f434=JSON[_0xb3af('0x7a')](_0x540f73);if(_0xb3af('0x1f')==typeof _0xf8f434[_0xb3af('0x30')]){return _0x26b5f3(new Error(_0xb3af('0x7b')));}if(_0xb3af('0x1f')==typeof _0xf8f434[_0xb3af('0x47')]){return _0x26b5f3(new Error(_0xb3af('0x7c')));}if('undefined'==typeof _0xf8f434[_0xb3af('0x7d')]){return _0x26b5f3(new Error(_0xb3af('0x7e')));}if(_0xb3af('0x1f')==typeof _0xf8f434[_0xb3af('0x7f')]){return _0x26b5f3(new Error(_0xb3af('0x80')));}if(_0xf8f434[_0xb3af('0x47')]==='html'){if(_0xb3af('0x1f')==typeof _0xf8f434['parameters'][_0xb3af('0x81')]){return _0x26b5f3(new Error(_0xb3af('0x82')));}if(_0xb3af('0x1f')==typeof _0xf8f434['parameters']['views'][_0xb3af('0x83')]&&_0xb3af('0x1f')==typeof _0xf8f434[_0xb3af('0x7f')][_0xb3af('0x81')]['agent']){return _0x26b5f3(new Error(_0xb3af('0x84')));}}else if(_0xf8f434['type']===_0xb3af('0x85')){if(_0xb3af('0x1f')==typeof _0xf8f434[_0xb3af('0x7f')][_0xb3af('0x86')]){return _0x26b5f3(new Error(_0xb3af('0x87')));}if(_0xb3af('0x1f')==typeof _0xf8f434[_0xb3af('0x7f')][_0xb3af('0x88')]){return _0x26b5f3(new Error(_0xb3af('0x89')));}}else{return _0x26b5f3(new Error(_0xb3af('0x8a')));}var _0x1ca904=_0xf8f434[_0xb3af('0x30')];var _0x44c08d=_0xf8f434[_0xb3af('0x8b')];var _0x3ac824=_0xf8f434[_0xb3af('0x47')];var _0x5562ff=_0xf8f434[_0xb3af('0x8c')]?_0xf8f434[_0xb3af('0x8c')]:_0xb3af('0x8d');var _0x3d48cd=_0xf8f434['icon']?_0xf8f434[_0xb3af('0x8e')]:_0xb3af('0x8f');var _0x285616='';var _0x470bdb='';var _0x2c0fe1='';var _0x2af71f='';var _0x66b21c=_0xf8f434[_0xb3af('0x7d')];if(_0x3ac824===_0xb3af('0x90')){if(_0xb3af('0x1f')!=typeof _0xf8f434['parameters']['views']['admin']){var _0x59ed07=_0xf8f434['parameters']['views'][_0xb3af('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xb3af('0x91')](_0x59ed07)){_0x285616=path[_0xb3af('0x52')](_0xb3af('0x92'),_0x1d66e0,_0x182c24[0x0],_0x59ed07);}else{_0x285616=_0x59ed07;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0xf8f434['parameters'][_0xb3af('0x81')][_0xb3af('0x93')]){var _0x456607=_0xf8f434[_0xb3af('0x7f')][_0xb3af('0x81')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xb3af('0x91')](_0x456607)){_0x470bdb=path['join'](_0xb3af('0x92'),_0x1d66e0,_0x182c24[0x0],_0x456607);}else{_0x470bdb=_0x456607;}}else{logger[_0xb3af('0x69')](_0xb3af('0x94'));}}else if(_0x3ac824===_0xb3af('0x85')){_0x2c0fe1=_0xf8f434[_0xb3af('0x7f')][_0xb3af('0x86')];_0x2af71f=_0xf8f434[_0xb3af('0x7f')]['scriptPath'];if('undefined'!=typeof _0xf8f434['parameters'][_0xb3af('0x81')]){if('undefined'!=typeof _0xf8f434[_0xb3af('0x7f')]['views']['admin']){var _0x59ed07=_0xf8f434[_0xb3af('0x7f')][_0xb3af('0x81')][_0xb3af('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xb3af('0x91')](_0x59ed07)){_0x285616=path['join']('plugins',_0x1d66e0,_0x182c24[0x0],_0x59ed07);}else{_0x285616=_0x59ed07;}}if(_0xb3af('0x1f')!=typeof _0xf8f434[_0xb3af('0x7f')]['views']['agent']){var _0x456607=_0xf8f434[_0xb3af('0x7f')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x456607)){_0x470bdb=path[_0xb3af('0x52')](_0xb3af('0x92'),_0x1d66e0,_0x182c24[0x0],_0x456607);}else{_0x470bdb=_0x456607;}}}}var _0x1d1c70={'name':_0x1ca904,'description':_0x44c08d,'path':path[_0xb3af('0x52')](_0x1d66e0,_0x182c24[0x0]),'type':_0x3ac824,'sidebar':_0x5562ff,'icon':_0x3d48cd,'adminUrl':_0x285616,'agentUrl':_0x470bdb,'scriptName':_0x2c0fe1,'scriptPath':_0x2af71f,'version':_0x66b21c};removeReferences(_0x6047d,null);return db[_0xb3af('0x33')][_0xb3af('0x95')](_0x1d1c70)[_0xb3af('0x28')](function(_0x5d162f){var _0x7eb87f={'role':_0x8cf670[_0xb3af('0x96')][_0xb3af('0x97')],'userProfileId':_0x8cf670[_0xb3af('0x96')][_0xb3af('0x98')]};if(!_0x7eb87f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7eb87f['role']==='user'){var _0x2e24ed=_0x5d162f[_0xb3af('0x2a')]({'plain':!![]});return db[_0xb3af('0x99')][_0xb3af('0x50')]({'where':{'name':_0xb3af('0x2b'),'userProfileId':_0x7eb87f[_0xb3af('0x98')]},'raw':!![]})[_0xb3af('0x28')](function(_0x1c8aa0){if(_0x1c8aa0&&_0x1c8aa0[_0xb3af('0x9a')]===0x0){return db['UserProfileResource']['create']({'name':_0x2e24ed[_0xb3af('0x30')],'resourceId':_0x2e24ed['id'],'type':_0x1c8aa0[_0xb3af('0x30')],'sectionId':_0x1c8aa0['id']},{})[_0xb3af('0x28')](function(){return _0x5d162f;});}else{return _0x5d162f;}})['catch'](function(_0x25eaea){logger[_0xb3af('0x2e')](_0xb3af('0x9b'),_0x25eaea);throw _0x25eaea;});}return _0x5d162f;})[_0xb3af('0x28')](respondWithResult(_0x47ba3a,null))[_0xb3af('0x4d')](handleError(_0x47ba3a,null));}});}catch(_0x522430){_0x47ba3a[_0xb3af('0x1d')](0x1f4)['send'](_0x522430);}};function removeReferences(_0x246f36,_0x321894){try{if(_0x246f36){fs[_0xb3af('0x68')](_0x246f36);logger[_0xb3af('0x69')](_0xb3af('0x9c'));}if(_0x321894){rimraf(_0x321894,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x20f883){logger[_0xb3af('0x2e')](_0x20f883);}}exports[_0xb3af('0x9d')]=function(_0x3b643e,_0x5042a3,_0x1b13bc){return db[_0xb3af('0x33')]['find']({'where':{'id':_0x3b643e[_0xb3af('0x4f')]['id']}})[_0xb3af('0x28')](handleEntityNotFound(_0x5042a3,null))[_0xb3af('0x28')](saveUpdates(_0x3b643e[_0xb3af('0x96')],null))[_0xb3af('0x28')](respondWithResult(_0x5042a3,null))[_0xb3af('0x4d')](handleError(_0x5042a3,null));};exports['delete']=function(_0x54eb53,_0x524bbb,_0x427398){return db[_0xb3af('0x33')][_0xb3af('0x50')]({'where':{'id':_0x54eb53[_0xb3af('0x4f')]['id']}})[_0xb3af('0x28')](function(_0x56c6a1){if(_0x56c6a1){return _0x56c6a1[_0xb3af('0x29')]();}})['then'](function(_0x485df2){rimraf(path[_0xb3af('0x52')](config[_0xb3af('0x53')],'server/files/plugins',path[_0xb3af('0x9e')](_0x485df2[_0xb3af('0x62')])),function(){});return _0x485df2;})[_0xb3af('0x28')](handleEntityNotFound(_0x524bbb,null))['then'](respondWithStatusCode(_0x524bbb,null))['catch'](handleError(_0x524bbb,null));};exports[_0xb3af('0x9f')]=function(_0x234cdc,_0x3abb82,_0x41253b){return BPromise['resolve']()[_0xb3af('0x28')](function(){if(!_0x234cdc[_0xb3af('0x39')]['path']){throw new Error(_0xb3af('0xa0'));}if(!_0x234cdc[_0xb3af('0x39')]['port']){throw new Error(_0xb3af('0xa1'));}var _0x3de121=_0x234cdc[_0xb3af('0x39')][_0xb3af('0xa2')]?_0x234cdc[_0xb3af('0x39')][_0xb3af('0xa2')]+':'+_0x234cdc[_0xb3af('0x39')][_0xb3af('0xa3')]:'http://localhost:'+_0x234cdc[_0xb3af('0x39')]['port'];var _0x1080a3=_0x234cdc[_0xb3af('0x39')][_0xb3af('0x24')]?_0x234cdc['query'][_0xb3af('0x24')]:!![];var _0x17dc9b=_0x234cdc[_0xb3af('0x39')][_0xb3af('0xa4')]?_0x234cdc[_0xb3af('0x39')][_0xb3af('0xa4')]:null;var _0x4cf4a8={'method':_0x234cdc[_0xb3af('0xa5')],'uri':util[_0xb3af('0x67')](_0xb3af('0xa6'),_0x3de121,_0x234cdc[_0xb3af('0x39')][_0xb3af('0x62')]),'json':_0x1080a3,'resolveWithFullResponse':!![],'encoding':_0x17dc9b,'qs':_0x234cdc[_0xb3af('0x39')]};if(_0x234cdc[_0xb3af('0xa7')]){_0x4cf4a8[_0xb3af('0xa7')]=_0x234cdc['headers'];if(_0x4cf4a8[_0xb3af('0xa7')][_0xb3af('0xa8')]){delete _0x4cf4a8[_0xb3af('0xa7')][_0xb3af('0xa8')];}}if(_0x4cf4a8[_0xb3af('0xa7')][_0xb3af('0xa9')]){delete _0x4cf4a8[_0xb3af('0xa7')][_0xb3af('0xa9')];}return rp(_0x4cf4a8);})['then'](function(_0x5a7779){if(_0x5a7779){_0x3abb82[_0xb3af('0xaa')](_0x5a7779[_0xb3af('0xa7')]);logger['info'](_0x5a7779['body']);if(_[_0xb3af('0xab')](_0x234cdc[_0xb3af('0x39')][_0xb3af('0x62')],_0xb3af('0x51'))&&_0x5a7779[_0xb3af('0xac')]==0x1f4){return _0x3abb82[_0xb3af('0x2d')](_0x5a7779[_0xb3af('0xac')]);}else{return _0x3abb82[_0xb3af('0x1d')](_0x5a7779[_0xb3af('0xac')])[_0xb3af('0x31')](_0x5a7779[_0xb3af('0x96')]);}}else{return _0x3abb82[_0xb3af('0x2d')](0xc8);}})['catch'](handleError(_0x3abb82,null));};exports[_0xb3af('0xad')]=function(_0x3eb5ab,_0x1ad6ff,_0x1673b0){return BPromise[_0xb3af('0xae')]()[_0xb3af('0x28')](function(){if(!_0x3eb5ab[_0xb3af('0x39')][_0xb3af('0x62')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x3eb5ab[_0xb3af('0x39')]['port']){throw new Error(_0xb3af('0xa1'));}var _0x1cc462=_0x3eb5ab[_0xb3af('0x39')][_0xb3af('0xa2')]?_0x3eb5ab[_0xb3af('0x39')]['hostname']+':'+_0x3eb5ab[_0xb3af('0x39')][_0xb3af('0xa3')]:_0xb3af('0xaf')+_0x3eb5ab[_0xb3af('0x39')]['port'];var _0x59af82=_0x3eb5ab['query']['json']?_0x3eb5ab[_0xb3af('0x39')][_0xb3af('0x24')]:!![];var _0x13f43f=_0x3eb5ab[_0xb3af('0x39')][_0xb3af('0xa4')]?_0x3eb5ab[_0xb3af('0x39')][_0xb3af('0xa4')]:null;var _0x283b8e={'method':_0x3eb5ab[_0xb3af('0xa5')],'uri':util[_0xb3af('0x67')](_0xb3af('0xa6'),_0x1cc462,_0x3eb5ab[_0xb3af('0x39')]['path']),'json':_0x59af82,'resolveWithFullResponse':!![],'encoding':_0x13f43f,'body':_0x3eb5ab[_0xb3af('0x96')]};if(_0x3eb5ab[_0xb3af('0xa7')]){_0x283b8e[_0xb3af('0xa7')]=_0x3eb5ab[_0xb3af('0xa7')];if(_0x283b8e[_0xb3af('0xa7')][_0xb3af('0xa8')]){delete _0x283b8e['headers'][_0xb3af('0xa8')];}}if(_0x283b8e['headers']['content-type']){delete _0x283b8e['headers'][_0xb3af('0xa9')];}return rp(_0x283b8e);})[_0xb3af('0x28')](function(_0x39321f){if(_0x39321f){_0x1ad6ff['set'](_0x39321f[_0xb3af('0xa7')]);logger[_0xb3af('0x69')](_0x39321f[_0xb3af('0x96')]);return _0x1ad6ff['status'](_0x39321f[_0xb3af('0xac')])[_0xb3af('0x31')](_0x39321f[_0xb3af('0x96')]);}else{return _0x1ad6ff['sendStatus'](0xc8);}})[_0xb3af('0x4d')](handleError(_0x1ad6ff,null));}; \ No newline at end of file +var _0x7b13=['intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','filters','find','catch','download','join','root','server/files/plugins','%s.zip','basename','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','format','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','autoAssociation','UserProfileResource','create','Zip\x20archive\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','headers','content-length','content-type','endsWith','statusCode','webhookPost','encoding','method','%s%s','set','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','end','offset','limit','undefined','count','apply','reject','save','update','then','get','destroy','status','sendStatus','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','model','query','keys'];(function(_0x3e0d41,_0x1d6589){var _0x1e879a=function(_0x31d49c){while(--_0x31d49c){_0x3e0d41['push'](_0x3e0d41['shift']());}};_0x1e879a(++_0x1d6589);}(_0x7b13,0x71));var _0x37b1=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7b13[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x37b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x37b1('0x1'));var jsonpatch=require(_0x37b1('0x2'));var rp=require(_0x37b1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x37b1('0x4'));var util=require(_0x37b1('0x5'));var path=require(_0x37b1('0x6'));var sox=require(_0x37b1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x37b1('0x8'));var _=require('lodash');var squel=require(_0x37b1('0x9'));var crypto=require('crypto');var jsforce=require(_0x37b1('0xa'));var deskjs=require(_0x37b1('0xb'));var toCsv=require(_0x37b1('0xc'));var querystring=require(_0x37b1('0xd'));var Papa=require(_0x37b1('0xe'));var extract=require(_0x37b1('0xf'));var rimraf=require('rimraf');var archiver=require(_0x37b1('0x10'));var Redis=require(_0x37b1('0x11'));var authService=require(_0x37b1('0x12'));var qs=require(_0x37b1('0x13'));var as=require(_0x37b1('0x14'));var hardwareService=require(_0x37b1('0x15'));var logger=require('../../config/logger')(_0x37b1('0x16'));var utils=require(_0x37b1('0x17'));var config=require(_0x37b1('0x18'));var licenseUtil=require(_0x37b1('0x19'));var db=require(_0x37b1('0x1a'))['db'];config[_0x37b1('0x1b')]=_[_0x37b1('0x1c')](config[_0x37b1('0x1b')],{'host':_0x37b1('0x1d'),'port':0x18eb});var socket=require(_0x37b1('0x1e'))(new Redis(config[_0x37b1('0x1b')]));require(_0x37b1('0x1f'))[_0x37b1('0x20')](socket);function respondWithStatusCode(_0x46c68a,_0x5989f8){_0x5989f8=_0x5989f8||0xcc;return function(_0x3b6bcc){if(_0x3b6bcc){return _0x46c68a['sendStatus'](_0x5989f8);}return _0x46c68a['status'](_0x5989f8)[_0x37b1('0x21')]();};}function respondWithResult(_0x226dc2,_0x2e8971){_0x2e8971=_0x2e8971||0xc8;return function(_0x3d8611){if(_0x3d8611){return _0x226dc2['status'](_0x2e8971)['json'](_0x3d8611);}};}function respondWithFilteredResult(_0x39fa68,_0x1f2e74){return function(_0x304b06){if(_0x304b06){var _0x4135ab=typeof _0x1f2e74[_0x37b1('0x22')]==='undefined'&&typeof _0x1f2e74[_0x37b1('0x23')]===_0x37b1('0x24');var _0x3ee528=_0x304b06[_0x37b1('0x25')];var _0x3d33d4=_0x4135ab?0x0:_0x1f2e74['offset'];var _0x3acc5a=_0x4135ab?_0x304b06[_0x37b1('0x25')]:_0x1f2e74[_0x37b1('0x22')]+_0x1f2e74[_0x37b1('0x23')];var _0x5b1b53;if(_0x3acc5a>=_0x3ee528){_0x3acc5a=_0x3ee528;_0x5b1b53=0xc8;}else{_0x5b1b53=0xce;}_0x39fa68['status'](_0x5b1b53);return _0x39fa68['set']('Content-Range',_0x3d33d4+'-'+_0x3acc5a+'/'+_0x3ee528)['json'](_0x304b06);}return null;};}function patchUpdates(_0x2f5ab4){return function(_0x5ab09a){try{jsonpatch[_0x37b1('0x26')](_0x5ab09a,_0x2f5ab4,!![]);}catch(_0x441264){return BPromise[_0x37b1('0x27')](_0x441264);}return _0x5ab09a[_0x37b1('0x28')]();};}function saveUpdates(_0x19e086,_0x10892c){return function(_0x2b9fd7){if(_0x2b9fd7){return _0x2b9fd7[_0x37b1('0x29')](_0x19e086)[_0x37b1('0x2a')](function(_0xb203fd){return _0xb203fd;});}return null;};}function removeEntity(_0x2969e0,_0x40587c){return function(_0x4e3325){if(_0x4e3325){return _0x4e3325['destroy']()[_0x37b1('0x2a')](function(){var _0x335d56=_0x4e3325[_0x37b1('0x2b')]({'plain':!![]});var _0x414eda='Plugins';return db['UserProfileResource'][_0x37b1('0x2c')]({'where':{'type':_0x414eda,'resourceId':_0x335d56['id']}})['then'](function(){return _0x4e3325;});})[_0x37b1('0x2a')](function(){_0x2969e0[_0x37b1('0x2d')](0xcc)[_0x37b1('0x21')]();});}};}function handleEntityNotFound(_0x34e74f,_0x3fd392){return function(_0x222b9f){if(!_0x222b9f){_0x34e74f[_0x37b1('0x2e')](0x194);}return _0x222b9f;};}function handleError(_0x3b0a4c,_0x276adf){_0x276adf=_0x276adf||0x1f4;return function(_0x4d6cec){logger[_0x37b1('0x2f')](_0x4d6cec[_0x37b1('0x30')]);if(_0x4d6cec[_0x37b1('0x31')]){delete _0x4d6cec[_0x37b1('0x31')];}_0x3b0a4c[_0x37b1('0x2d')](_0x276adf)[_0x37b1('0x32')](_0x4d6cec);};}exports['index']=function(_0x4ea1ce,_0x4ed266){var _0x388abe={},_0x38bbfa={},_0x362a0b={'count':0x0,'rows':[]};var _0x3b03bb=_[_0x37b1('0x33')](db[_0x37b1('0x34')][_0x37b1('0x35')],function(_0x2141bf){return{'name':_0x2141bf[_0x37b1('0x36')],'type':_0x2141bf[_0x37b1('0x37')]['key']};});_0x38bbfa[_0x37b1('0x38')]=_['map'](_0x3b03bb,_0x37b1('0x31'));_0x38bbfa[_0x37b1('0x39')]=_[_0x37b1('0x3a')](_0x4ea1ce[_0x37b1('0x39')]);_0x38bbfa['filters']=_[_0x37b1('0x3b')](_0x38bbfa[_0x37b1('0x38')],_0x38bbfa[_0x37b1('0x39')]);_0x388abe[_0x37b1('0x3c')]=_[_0x37b1('0x3b')](_0x38bbfa[_0x37b1('0x38')],qs[_0x37b1('0x3d')](_0x4ea1ce[_0x37b1('0x39')]['fields']));_0x388abe[_0x37b1('0x3c')]=_0x388abe['attributes'][_0x37b1('0x3e')]?_0x388abe['attributes']:_0x38bbfa[_0x37b1('0x38')];if(!_0x4ea1ce[_0x37b1('0x39')]['hasOwnProperty'](_0x37b1('0x3f'))){_0x388abe[_0x37b1('0x23')]=qs[_0x37b1('0x23')](_0x4ea1ce[_0x37b1('0x39')][_0x37b1('0x23')]);_0x388abe[_0x37b1('0x22')]=qs['offset'](_0x4ea1ce[_0x37b1('0x39')][_0x37b1('0x22')]);}_0x388abe[_0x37b1('0x40')]=qs['sort'](_0x4ea1ce[_0x37b1('0x39')][_0x37b1('0x41')]);_0x388abe[_0x37b1('0x42')]=qs['filters'](_[_0x37b1('0x43')](_0x4ea1ce[_0x37b1('0x39')],_0x38bbfa['filters']),_0x3b03bb);if(_0x4ea1ce['query']['filter']){_0x388abe[_0x37b1('0x42')]=_[_0x37b1('0x44')](_0x388abe[_0x37b1('0x42')],{'$or':_[_0x37b1('0x33')](_0x3b03bb,function(_0x350783){if(_0x350783[_0x37b1('0x37')]!==_0x37b1('0x45')){var _0x49ac25={};_0x49ac25[_0x350783['name']]={'$like':'%'+_0x4ea1ce[_0x37b1('0x39')][_0x37b1('0x46')]+'%'};return _0x49ac25;}})});}_0x388abe=_[_0x37b1('0x44')]({},_0x388abe,_0x4ea1ce[_0x37b1('0x47')]);var _0x118e3e={'where':_0x388abe[_0x37b1('0x42')]};return db[_0x37b1('0x34')][_0x37b1('0x25')](_0x118e3e)[_0x37b1('0x2a')](function(_0x316c2a){_0x362a0b[_0x37b1('0x25')]=_0x316c2a;if(_0x4ea1ce['query'][_0x37b1('0x48')]){_0x388abe[_0x37b1('0x49')]=[{'all':!![]}];}return db['Plugin'][_0x37b1('0x4a')](_0x388abe);})[_0x37b1('0x2a')](function(_0x491e59){_0x362a0b['rows']=_0x491e59;return _0x362a0b;})[_0x37b1('0x2a')](respondWithFilteredResult(_0x4ed266,_0x388abe))['catch'](handleError(_0x4ed266,null));};exports['show']=function(_0xff84f7,_0x82eabc){var _0x290122={'raw':!![],'where':{'id':_0xff84f7[_0x37b1('0x4b')]['id']}},_0x44b1e2={};_0x44b1e2[_0x37b1('0x38')]=_[_0x37b1('0x3a')](db[_0x37b1('0x34')]['rawAttributes']);_0x44b1e2['query']=_[_0x37b1('0x3a')](_0xff84f7[_0x37b1('0x39')]);_0x44b1e2[_0x37b1('0x4c')]=_[_0x37b1('0x3b')](_0x44b1e2['model'],_0x44b1e2[_0x37b1('0x39')]);_0x290122['attributes']=_[_0x37b1('0x3b')](_0x44b1e2[_0x37b1('0x38')],qs[_0x37b1('0x3d')](_0xff84f7[_0x37b1('0x39')][_0x37b1('0x3d')]));_0x290122['attributes']=_0x290122['attributes']['length']?_0x290122['attributes']:_0x44b1e2[_0x37b1('0x38')];if(_0xff84f7[_0x37b1('0x39')]['includeAll']){_0x290122['include']=[{'all':!![]}];}_0x290122=_['merge']({},_0x290122,_0xff84f7[_0x37b1('0x47')]);return db[_0x37b1('0x34')][_0x37b1('0x4d')](_0x290122)[_0x37b1('0x2a')](handleEntityNotFound(_0x82eabc,null))[_0x37b1('0x2a')](respondWithResult(_0x82eabc,null))[_0x37b1('0x4e')](handleError(_0x82eabc,null));};exports[_0x37b1('0x4f')]=function(_0x565650,_0x3ba616,_0x3a8982){return db[_0x37b1('0x34')][_0x37b1('0x4d')]({'where':{'id':_0x565650['params']['id']},'attributes':[_0x37b1('0x31'),'path'],'raw':!![]})[_0x37b1('0x2a')](handleEntityNotFound(_0x3ba616,null))['then'](function(_0x2340c8){if(_0x2340c8){var _0x21f888=path[_0x37b1('0x50')](config[_0x37b1('0x51')],_0x37b1('0x52'),util['format'](_0x37b1('0x53'),path[_0x37b1('0x54')](_0x2340c8[_0x37b1('0x6')])));var _0xbfca55=fs['createWriteStream'](_0x21f888);var _0x7c910=archiver(_0x37b1('0x55'),{'zlib':{'level':0x9}});_0x7c910['on'](_0x37b1('0x56'),function(_0x503758){if(_0x503758[_0x37b1('0x57')]===_0x37b1('0x58')){logger[_0x37b1('0x2f')](_0x503758);}else{throw new db[(_0x37b1('0x59'))][(_0x37b1('0x5a'))](_0x37b1('0x5b'));}});_0x7c910['on'](_0x37b1('0x2f'),function(_0x57e076){throw new db[(_0x37b1('0x59'))][(_0x37b1('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x7c910[_0x37b1('0x5c')](_0xbfca55);_0x7c910[_0x37b1('0x5d')](_0x37b1('0x5e'),{'cwd':path[_0x37b1('0x50')](config[_0x37b1('0x51')],_0x37b1('0x52'),path[_0x37b1('0x5f')](_0x2340c8[_0x37b1('0x6')])),'ignore':[path[_0x37b1('0x50')](path[_0x37b1('0x54')](_0x2340c8['path']),_0x37b1('0x60')),path['join'](path[_0x37b1('0x54')](_0x2340c8['path']),_0x37b1('0x61'))],'nodir':!![]})[_0x37b1('0x62')]();_0xbfca55['on'](_0x37b1('0x63'),function(){if(!fs[_0x37b1('0x64')](_0x21f888)){throw new db['Sequelize'][(_0x37b1('0x5a'))]('Plugin\x20not\x20found');}return _0x3ba616[_0x37b1('0x4f')](_0x21f888,util[_0x37b1('0x65')](_0x37b1('0x53'),path['basename'](_0x2340c8[_0x37b1('0x6')])),function(_0x9b6d4f){if(_0x9b6d4f){throw new db['Sequelize']['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x37b1('0x66')](_0x21f888);logger[_0x37b1('0x67')](_0x37b1('0x68'));logger[_0x37b1('0x67')](_0x37b1('0x69'));});});}return null;})[_0x37b1('0x4e')](handleError(_0x3ba616,null));};exports['upload']=function(_0x5037da,_0x57e4e2,_0x35161c){var _0x264c3a=path[_0x37b1('0x54')](_0x5037da[_0x37b1('0x6a')][_0x37b1('0x6b')],path[_0x37b1('0x6c')](_0x5037da[_0x37b1('0x6a')][_0x37b1('0x6b')]));var _0x51be5e=path[_0x37b1('0x50')](config['root'],_0x37b1('0x52'),_0x5037da['file'][_0x37b1('0x6b')]);var _0x3aea43=path[_0x37b1('0x50')](config['root'],_0x37b1('0x52'),_0x264c3a);logger[_0x37b1('0x67')]('Plugin\x20upload\x20filepath:\x20%s',_0x51be5e);logger[_0x37b1('0x67')](_0x37b1('0x6d'),_0x3aea43);try{fs[_0x37b1('0x6e')](_0x51be5e,parseInt('0777',0x8));extract(_0x51be5e,{'dir':_0x3aea43},function(_0x360846){if(_0x360846){logger[_0x37b1('0x2f')](_0x360846);handleError(_0x360846,!![]);};var _0x2b5e96=fs[_0x37b1('0x6f')](_0x3aea43);if(_0x2b5e96[_0x37b1('0x3e')]>0x1){removeReferences(_0x51be5e,_0x3aea43);logger['error'](_0x37b1('0x70'));return _0x35161c(new Error(_0x37b1('0x70')));}var _0x518b3c=fs[_0x37b1('0x71')](path['join'](_0x3aea43,_0x2b5e96[0x0]));if(_0x518b3c['isFile']()){removeReferences(_0x51be5e,_0x3aea43);logger[_0x37b1('0x2f')](_0x37b1('0x70'));return _0x35161c(new Error(_0x37b1('0x70')));}if(_0x518b3c['isDirectory']()){var _0x50ad32=fs[_0x37b1('0x6f')](path[_0x37b1('0x50')](_0x3aea43,_0x2b5e96[0x0]));if(_0x50ad32[_0x37b1('0x3e')]===0x0){removeReferences(_0x51be5e,_0x3aea43);logger[_0x37b1('0x2f')]('Invalid\x20plugin\x20structure');return _0x35161c(new Error(_0x37b1('0x70')));}var _0x4cf92c=_0x50ad32['some'](function(_0x3d961b){return _0x3d961b===_0x37b1('0x72');});if(!_0x4cf92c){return _0x35161c(new Error(_0x37b1('0x73')));}var _0x582281=fs[_0x37b1('0x74')](path[_0x37b1('0x50')](_0x3aea43,_0x2b5e96[0x0],_0x37b1('0x72')));var _0x3790c0=JSON[_0x37b1('0x75')](_0x582281);if(_0x37b1('0x24')==typeof _0x3790c0['name']){return _0x35161c(new Error(_0x37b1('0x76')));}if(_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x37')]){return _0x35161c(new Error(_0x37b1('0x77')));}if(_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x78')]){return _0x35161c(new Error(_0x37b1('0x79')));}if(_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x7a')]){return _0x35161c(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x3790c0[_0x37b1('0x37')]==='html'){if(_0x37b1('0x24')==typeof _0x3790c0['parameters'][_0x37b1('0x7b')]){return _0x35161c(new Error(_0x37b1('0x7c')));}if(_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7b')][_0x37b1('0x7d')]&&_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7b')][_0x37b1('0x7e')]){return _0x35161c(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x3790c0['type']==='script'){if(_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7f')]){return _0x35161c(new Error(_0x37b1('0x80')));}if('undefined'==typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x81')]){return _0x35161c(new Error(_0x37b1('0x82')));}}else{return _0x35161c(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x3b36aa=_0x3790c0['name'];var _0x204da7=_0x3790c0[_0x37b1('0x83')];var _0x546ada=_0x3790c0['type'];var _0x239a95=_0x3790c0[_0x37b1('0x84')]?_0x3790c0['sidebar']:_0x37b1('0x85');var _0x4f9d1a=_0x3790c0[_0x37b1('0x86')]?_0x3790c0[_0x37b1('0x86')]:_0x37b1('0x87');var _0x3a41a7='';var _0x3e30c1='';var _0x5ed035='';var _0x2b36b1='';var _0x3f7afa=_0x3790c0[_0x37b1('0x78')];if(_0x546ada===_0x37b1('0x88')){if(_0x37b1('0x24')!=typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7b')]['admin']){var _0x42ec10=_0x3790c0[_0x37b1('0x7a')]['views'][_0x37b1('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x37b1('0x89')](_0x42ec10)){_0x3a41a7=path[_0x37b1('0x50')](_0x37b1('0x8a'),_0x264c3a,_0x2b5e96[0x0],_0x42ec10);}else{_0x3a41a7=_0x42ec10;}}else{logger[_0x37b1('0x67')](_0x37b1('0x8b'));}if('undefined'!=typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7b')][_0x37b1('0x7e')]){var _0x31e125=_0x3790c0['parameters'][_0x37b1('0x7b')][_0x37b1('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x37b1('0x89')](_0x31e125)){_0x3e30c1=path['join'](_0x37b1('0x8a'),_0x264c3a,_0x2b5e96[0x0],_0x31e125);}else{_0x3e30c1=_0x31e125;}}else{logger['info'](_0x37b1('0x8c'));}}else if(_0x546ada===_0x37b1('0x8d')){_0x5ed035=_0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7f')];_0x2b36b1=_0x3790c0[_0x37b1('0x7a')]['scriptPath'];if(_0x37b1('0x24')!=typeof _0x3790c0[_0x37b1('0x7a')]['views']){if(_0x37b1('0x24')!=typeof _0x3790c0['parameters'][_0x37b1('0x7b')][_0x37b1('0x7d')]){var _0x42ec10=_0x3790c0['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x37b1('0x89')](_0x42ec10)){_0x3a41a7=path['join'](_0x37b1('0x8a'),_0x264c3a,_0x2b5e96[0x0],_0x42ec10);}else{_0x3a41a7=_0x42ec10;}}if(_0x37b1('0x24')!=typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7b')][_0x37b1('0x7e')]){var _0x31e125=_0x3790c0['parameters'][_0x37b1('0x7b')][_0x37b1('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x37b1('0x89')](_0x31e125)){_0x3e30c1=path[_0x37b1('0x50')]('plugins',_0x264c3a,_0x2b5e96[0x0],_0x31e125);}else{_0x3e30c1=_0x31e125;}}}}var _0x5a8681={'name':_0x3b36aa,'description':_0x204da7,'path':path['join'](_0x264c3a,_0x2b5e96[0x0]),'type':_0x546ada,'sidebar':_0x239a95,'icon':_0x4f9d1a,'adminUrl':_0x3a41a7,'agentUrl':_0x3e30c1,'scriptName':_0x5ed035,'scriptPath':_0x2b36b1,'version':_0x3f7afa};removeReferences(_0x51be5e,null);return db[_0x37b1('0x34')]['create'](_0x5a8681)[_0x37b1('0x2a')](function(_0x3abe08){var _0x5ecebf={'role':_0x5037da[_0x37b1('0x8e')][_0x37b1('0x8f')],'userProfileId':_0x5037da[_0x37b1('0x8e')]['userProfileId']};if(!_0x5ecebf)throw new Error(_0x37b1('0x90'));if(_0x5ecebf[_0x37b1('0x8f')]===_0x37b1('0x91')){var _0x5beca9=_0x3abe08[_0x37b1('0x2b')]({'plain':!![]});return db[_0x37b1('0x92')]['find']({'where':{'name':_0x37b1('0x93'),'userProfileId':_0x5ecebf[_0x37b1('0x94')]},'raw':!![]})[_0x37b1('0x2a')](function(_0x264c92){if(_0x264c92&&_0x264c92[_0x37b1('0x95')]===0x0){return db[_0x37b1('0x96')][_0x37b1('0x97')]({'name':_0x5beca9[_0x37b1('0x31')],'resourceId':_0x5beca9['id'],'type':_0x264c92[_0x37b1('0x31')],'sectionId':_0x264c92['id']},{})[_0x37b1('0x2a')](function(){return _0x3abe08;});}else{return _0x3abe08;}})[_0x37b1('0x4e')](function(_0x1a8930){logger[_0x37b1('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a8930);throw _0x1a8930;});}return _0x3abe08;})['then'](respondWithResult(_0x57e4e2,null))['catch'](handleError(_0x57e4e2,null));}});}catch(_0x28446e){_0x57e4e2[_0x37b1('0x2d')](0x1f4)[_0x37b1('0x32')](_0x28446e);}};function removeReferences(_0x14bad4,_0x153d8e){try{if(_0x14bad4){fs[_0x37b1('0x66')](_0x14bad4);logger['info'](_0x37b1('0x98'));}if(_0x153d8e){rimraf(_0x153d8e,function(){});logger[_0x37b1('0x67')]('Extracted\x20folder\x20removed');}}catch(_0x321a6d){logger[_0x37b1('0x2f')](_0x321a6d);}}exports[_0x37b1('0x29')]=function(_0x57b4f2,_0x5c8b64,_0x147589){return db[_0x37b1('0x34')][_0x37b1('0x4d')]({'where':{'id':_0x57b4f2[_0x37b1('0x4b')]['id']}})[_0x37b1('0x2a')](handleEntityNotFound(_0x5c8b64,null))[_0x37b1('0x2a')](saveUpdates(_0x57b4f2[_0x37b1('0x8e')],null))['then'](respondWithResult(_0x5c8b64,null))[_0x37b1('0x4e')](handleError(_0x5c8b64,null));};exports[_0x37b1('0x99')]=function(_0x150dac,_0x369809,_0x88b4b4){return db['Plugin'][_0x37b1('0x4d')]({'where':{'id':_0x150dac[_0x37b1('0x4b')]['id']}})[_0x37b1('0x2a')](function(_0x28c1aa){if(_0x28c1aa){return _0x28c1aa[_0x37b1('0x2c')]();}})[_0x37b1('0x2a')](function(_0x51d4b1){rimraf(path[_0x37b1('0x50')](config[_0x37b1('0x51')],_0x37b1('0x52'),path[_0x37b1('0x5f')](_0x51d4b1[_0x37b1('0x6')])),function(){});return _0x51d4b1;})[_0x37b1('0x2a')](handleEntityNotFound(_0x369809,null))[_0x37b1('0x2a')](respondWithStatusCode(_0x369809,null))[_0x37b1('0x4e')](handleError(_0x369809,null));};exports[_0x37b1('0x9a')]=function(_0xa5eec0,_0x5c5d15,_0xb94968){return BPromise[_0x37b1('0x9b')]()[_0x37b1('0x2a')](function(){if(!_0xa5eec0[_0x37b1('0x39')]['path']){throw new Error(_0x37b1('0x9c'));}if(!_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x9d')]){throw new Error(_0x37b1('0x9e'));}var _0x47582b=_0xa5eec0[_0x37b1('0x39')]['hostname']?_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x9f')]+':'+_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x9d')]:_0x37b1('0xa0')+_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x9d')];var _0x13ee5c=_0xa5eec0[_0x37b1('0x39')][_0x37b1('0xa1')]?_0xa5eec0[_0x37b1('0x39')][_0x37b1('0xa1')]:!![];var _0x547a9c=_0xa5eec0[_0x37b1('0x39')]['encoding']?_0xa5eec0[_0x37b1('0x39')]['encoding']:null;var _0x1596e9={'method':_0xa5eec0['method'],'uri':util[_0x37b1('0x65')]('%s%s',_0x47582b,_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x6')]),'json':_0x13ee5c,'resolveWithFullResponse':!![],'encoding':_0x547a9c,'qs':_0xa5eec0[_0x37b1('0x39')]};if(_0xa5eec0[_0x37b1('0xa2')]){_0x1596e9[_0x37b1('0xa2')]=_0xa5eec0[_0x37b1('0xa2')];if(_0x1596e9['headers'][_0x37b1('0xa3')]){delete _0x1596e9['headers'][_0x37b1('0xa3')];}}if(_0x1596e9['headers'][_0x37b1('0xa4')]){delete _0x1596e9[_0x37b1('0xa2')][_0x37b1('0xa4')];}return rp(_0x1596e9);})[_0x37b1('0x2a')](function(_0x534fb0){if(_0x534fb0){_0x5c5d15['set'](_0x534fb0['headers']);logger['info'](_0x534fb0[_0x37b1('0x8e')]);if(_[_0x37b1('0xa5')](_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x6')],'download')&&_0x534fb0[_0x37b1('0xa6')]==0x1f4){return _0x5c5d15['sendStatus'](_0x534fb0[_0x37b1('0xa6')]);}else{return _0x5c5d15[_0x37b1('0x2d')](_0x534fb0[_0x37b1('0xa6')])[_0x37b1('0x32')](_0x534fb0[_0x37b1('0x8e')]);}}else{return _0x5c5d15['sendStatus'](0xc8);}})['catch'](handleError(_0x5c5d15,null));};exports[_0x37b1('0xa7')]=function(_0x281ce4,_0x5ada51,_0x403b36){return BPromise['resolve']()[_0x37b1('0x2a')](function(){if(!_0x281ce4[_0x37b1('0x39')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x281ce4[_0x37b1('0x39')][_0x37b1('0x9d')]){throw new Error(_0x37b1('0x9e'));}var _0x28ed4b=_0x281ce4[_0x37b1('0x39')][_0x37b1('0x9f')]?_0x281ce4['query'][_0x37b1('0x9f')]+':'+_0x281ce4[_0x37b1('0x39')][_0x37b1('0x9d')]:_0x37b1('0xa0')+_0x281ce4[_0x37b1('0x39')]['port'];var _0x39a7f5=_0x281ce4['query'][_0x37b1('0xa1')]?_0x281ce4[_0x37b1('0x39')][_0x37b1('0xa1')]:!![];var _0x196ea1=_0x281ce4[_0x37b1('0x39')][_0x37b1('0xa8')]?_0x281ce4[_0x37b1('0x39')]['encoding']:null;var _0x4079f4={'method':_0x281ce4[_0x37b1('0xa9')],'uri':util[_0x37b1('0x65')](_0x37b1('0xaa'),_0x28ed4b,_0x281ce4[_0x37b1('0x39')][_0x37b1('0x6')]),'json':_0x39a7f5,'resolveWithFullResponse':!![],'encoding':_0x196ea1,'body':_0x281ce4[_0x37b1('0x8e')]};if(_0x281ce4[_0x37b1('0xa2')]){_0x4079f4['headers']=_0x281ce4[_0x37b1('0xa2')];if(_0x4079f4[_0x37b1('0xa2')][_0x37b1('0xa3')]){delete _0x4079f4[_0x37b1('0xa2')][_0x37b1('0xa3')];}}if(_0x4079f4[_0x37b1('0xa2')][_0x37b1('0xa4')]){delete _0x4079f4[_0x37b1('0xa2')][_0x37b1('0xa4')];}return rp(_0x4079f4);})[_0x37b1('0x2a')](function(_0x41acc8){if(_0x41acc8){_0x5ada51[_0x37b1('0xab')](_0x41acc8['headers']);logger['info'](_0x41acc8[_0x37b1('0x8e')]);return _0x5ada51[_0x37b1('0x2d')](_0x41acc8[_0x37b1('0xa6')])['send'](_0x41acc8[_0x37b1('0x8e')]);}else{return _0x5ada51[_0x37b1('0x2e')](0xc8);}})[_0x37b1('0x4e')](handleError(_0x5ada51,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index aace9fc..77c3a7a 100644 --- a/server/api/plugin/plugin.events.js +++ b/server/api/plugin/plugin.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x649f=['events','../../mysqldb','Plugin','update','emit','hasOwnProperty','hook'];(function(_0x20ba6d,_0x256177){var _0x338188=function(_0x568977){while(--_0x568977){_0x20ba6d['push'](_0x20ba6d['shift']());}};_0x338188(++_0x256177);}(_0x649f,0x93));var _0xf649=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x649f[_0x256b72];return _0x2183e3;};'use strict';var EventEmitter=require(_0xf649('0x0'));var Plugin=require(_0xf649('0x1'))['db'][_0xf649('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf649('0x3'),'afterDestroy':'remove'};function emitEvent(_0x46cb56){return function(_0x10aab4,_0x2ec1b9,_0x357358){PluginEvents[_0xf649('0x4')](_0x46cb56+':'+_0x10aab4['id'],_0x10aab4);PluginEvents[_0xf649('0x4')](_0x46cb56,_0x10aab4);_0x357358(null);};}for(var e in events){if(events[_0xf649('0x5')](e)){var event=events[e];Plugin[_0xf649('0x6')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x86f4=['Plugin','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(_0x5b8897,_0x223d65){_0x5b8897=_0x5b8897-0x0;var _0x2b7143=_0x86f4[_0x5b8897];return _0x2b7143;};'use strict';var EventEmitter=require(_0x486f('0x0'));var Plugin=require(_0x486f('0x1'))['db'][_0x486f('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x486f('0x3')](0x0);var events={'afterCreate':_0x486f('0x4'),'afterUpdate':_0x486f('0x5'),'afterDestroy':_0x486f('0x6')};function emitEvent(_0x53305d){return function(_0xf8d50f,_0x1539b1,_0x583729){PluginEvents[_0x486f('0x7')](_0x53305d+':'+_0xf8d50f['id'],_0xf8d50f);PluginEvents[_0x486f('0x7')](_0x53305d,_0xf8d50f);_0x583729(null);};}for(var e in events){if(events[_0x486f('0x8')](e)){var event=events[e];Plugin[_0x486f('0x9')](e,emitEvent(event));}}module[_0x486f('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index d2a1405..489c928 100644 --- a/server/api/plugin/plugin.model.js +++ b/server/api/plugin/plugin.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c42=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','define','lodash'];(function(_0x86a5d0,_0x425588){var _0x28550f=function(_0x277cb3){while(--_0x277cb3){_0x86a5d0['push'](_0x86a5d0['shift']());}};_0x28550f(++_0x425588);}(_0x2c42,0x18b));var _0x22c4=function(_0x54acac,_0x5a154c){_0x54acac=_0x54acac-0x0;var _0x13e62e=_0x2c42[_0x54acac];return _0x13e62e;};'use strict';var _=require(_0x22c4('0x0'));var util=require('util');var logger=require(_0x22c4('0x1'))('api');var moment=require(_0x22c4('0x2'));var BPromise=require(_0x22c4('0x3'));var rp=require(_0x22c4('0x4'));var fs=require('fs');var path=require(_0x22c4('0x5'));var rimraf=require('rimraf');var config=require(_0x22c4('0x6'));var attributes=require(_0x22c4('0x7'));module['exports']=function(_0x38d397,_0x3bd8c9){return _0x38d397[_0x22c4('0x8')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5f5=['bluebird','path','rimraf','exports','define','Plugin','plugins','lodash','util','api','moment'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xd5f5,0x1ca));var _0x5d5f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xd5f5[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x5d5f('0x0'));var util=require(_0x5d5f('0x1'));var logger=require('../../config/logger')(_0x5d5f('0x2'));var moment=require(_0x5d5f('0x3'));var BPromise=require(_0x5d5f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d5f('0x5'));var rimraf=require(_0x5d5f('0x6'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x5d5f('0x7')]=function(_0x54f7c9,_0x73f2ac){return _0x54f7c9[_0x5d5f('0x8')](_0x5d5f('0x9'),attributes,{'tableName':_0x5d5f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index c1e66e9..609ba68 100644 --- a/server/api/plugin/plugin.rpc.js +++ b/server/api/plugin/plugin.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69c3=['rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreatePlugin','Plugin','create','options','raw','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x23f33e,_0x23f082){var _0x187b95=function(_0x5d7c8d){while(--_0x5d7c8d){_0x23f33e['push'](_0x23f33e['shift']());}};_0x187b95(++_0x23f082);}(_0x69c3,0xd3));var _0x369c=function(_0x3c328e,_0x133167){_0x3c328e=_0x3c328e-0x0;var _0x46b037=_0x69c3[_0x3c328e];return _0x46b037;};'use strict';var _=require('lodash');var util=require(_0x369c('0x0'));var moment=require(_0x369c('0x1'));var BPromise=require(_0x369c('0x2'));var rs=require(_0x369c('0x3'));var fs=require('fs');var Redis=require(_0x369c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x369c('0x5'));var logger=require('../../config/logger')(_0x369c('0x6'));var config=require(_0x369c('0x7'));var jayson=require(_0x369c('0x8'));var client=jayson[_0x369c('0x9')]['http']({'port':0x232a});config[_0x369c('0xa')]=_['defaults'](config[_0x369c('0xa')],{'host':_0x369c('0xb'),'port':0x18eb});var socket=require(_0x369c('0xc'))(new Redis(config[_0x369c('0xa')]));require(_0x369c('0xd'))[_0x369c('0xe')](socket);function respondWithRpcPromise(_0x528eeb,_0x1befac,_0x1bd916){return new BPromise(function(_0x252144,_0x8dcc8b){return client['request'](_0x528eeb,_0x1bd916)[_0x369c('0xf')](function(_0x20f27f){logger[_0x369c('0x10')](_0x369c('0x11'),_0x1befac,'request\x20sent');logger['debug'](_0x369c('0x12'),_0x1befac,_0x369c('0x13'),JSON[_0x369c('0x14')](_0x20f27f));if(_0x20f27f[_0x369c('0x15')]){if(_0x20f27f[_0x369c('0x15')]['code']===0x1f4){logger[_0x369c('0x15')]('Plugin,\x20%s,\x20%s',_0x1befac,_0x20f27f['error'][_0x369c('0x16')]);return _0x8dcc8b(_0x20f27f['error'][_0x369c('0x16')]);}logger[_0x369c('0x15')](_0x369c('0x11'),_0x1befac,_0x20f27f[_0x369c('0x15')][_0x369c('0x16')]);return _0x252144(_0x20f27f[_0x369c('0x15')][_0x369c('0x16')]);}else{logger[_0x369c('0x10')](_0x369c('0x11'),_0x1befac,'request\x20sent');_0x252144(_0x20f27f[_0x369c('0x17')][_0x369c('0x16')]);}})[_0x369c('0x18')](function(_0x3c9ed3){logger[_0x369c('0x15')](_0x369c('0x11'),_0x1befac,_0x3c9ed3);_0x8dcc8b(_0x3c9ed3);});});}exports[_0x369c('0x19')]=function(_0x1d181a){var _0x560465=this;return new Promise(function(_0x5d660f,_0x4b8699){return db[_0x369c('0x1a')][_0x369c('0x1b')](_0x1d181a['body'],{'raw':_0x1d181a[_0x369c('0x1c')]?_0x1d181a['options'][_0x369c('0x1d')]===undefined?!![]:![]:!![]})[_0x369c('0xf')](function(_0x5eed02){logger['info'](_0x369c('0x19'),_0x1d181a);logger[_0x369c('0x1e')](_0x369c('0x19'),_0x1d181a,JSON[_0x369c('0x14')](_0x5eed02));_0x5d660f(_0x5eed02);})[_0x369c('0x18')](function(_0x15abe0){logger[_0x369c('0x15')](_0x369c('0x19'),_0x15abe0[_0x369c('0x16')],_0x1d181a);_0x4b8699(_0x560465[_0x369c('0x15')](0x1f4,_0x15abe0[_0x369c('0x16')]));});});}; \ No newline at end of file +var _0x9d8c=['body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreatePlugin','create'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x9d8c,0x158));var _0xc9d8=function(_0x1b69d2,_0x5272ba){_0x1b69d2=_0x1b69d2-0x0;var _0x33161e=_0x9d8c[_0x1b69d2];return _0x33161e;};'use strict';var _=require(_0xc9d8('0x0'));var util=require('util');var moment=require(_0xc9d8('0x1'));var BPromise=require(_0xc9d8('0x2'));var rs=require(_0xc9d8('0x3'));var fs=require('fs');var Redis=require(_0xc9d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9d8('0x5'));var logger=require('../../config/logger')(_0xc9d8('0x6'));var config=require(_0xc9d8('0x7'));var jayson=require(_0xc9d8('0x8'));var client=jayson[_0xc9d8('0x9')][_0xc9d8('0xa')]({'port':0x232a});config[_0xc9d8('0xb')]=_['defaults'](config[_0xc9d8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc9d8('0xc'))(new Redis(config[_0xc9d8('0xb')]));require('./plugin.socket')[_0xc9d8('0xd')](socket);function respondWithRpcPromise(_0x193a26,_0x5703fc,_0x5b3b80){return new BPromise(function(_0x51a489,_0x492f6e){return client[_0xc9d8('0xe')](_0x193a26,_0x5b3b80)[_0xc9d8('0xf')](function(_0x2b73fc){logger[_0xc9d8('0x10')](_0xc9d8('0x11'),_0x5703fc,_0xc9d8('0x12'));logger[_0xc9d8('0x13')](_0xc9d8('0x14'),_0x5703fc,_0xc9d8('0x12'),JSON[_0xc9d8('0x15')](_0x2b73fc));if(_0x2b73fc[_0xc9d8('0x16')]){if(_0x2b73fc['error'][_0xc9d8('0x17')]===0x1f4){logger[_0xc9d8('0x16')]('Plugin,\x20%s,\x20%s',_0x5703fc,_0x2b73fc[_0xc9d8('0x16')][_0xc9d8('0x18')]);return _0x492f6e(_0x2b73fc['error'][_0xc9d8('0x18')]);}logger[_0xc9d8('0x16')](_0xc9d8('0x11'),_0x5703fc,_0x2b73fc[_0xc9d8('0x16')][_0xc9d8('0x18')]);return _0x51a489(_0x2b73fc[_0xc9d8('0x16')][_0xc9d8('0x18')]);}else{logger[_0xc9d8('0x10')](_0xc9d8('0x11'),_0x5703fc,_0xc9d8('0x12'));_0x51a489(_0x2b73fc[_0xc9d8('0x19')][_0xc9d8('0x18')]);}})['catch'](function(_0x43cc0a){logger['error']('Plugin,\x20%s,\x20%s',_0x5703fc,_0x43cc0a);_0x492f6e(_0x43cc0a);});});}exports[_0xc9d8('0x1a')]=function(_0x55e404){var _0x292ba5=this;return new Promise(function(_0x44278f,_0x1b7ef2){return db['Plugin'][_0xc9d8('0x1b')](_0x55e404[_0xc9d8('0x1c')],{'raw':_0x55e404[_0xc9d8('0x1d')]?_0x55e404[_0xc9d8('0x1d')][_0xc9d8('0x1e')]===undefined?!![]:![]:!![]})[_0xc9d8('0xf')](function(_0x5b6547){logger['info'](_0xc9d8('0x1a'),_0x55e404);logger[_0xc9d8('0x13')](_0xc9d8('0x1a'),_0x55e404,JSON['stringify'](_0x5b6547));_0x44278f(_0x5b6547);})['catch'](function(_0x25462d){logger[_0xc9d8('0x16')]('CreatePlugin',_0x25462d[_0xc9d8('0x18')],_0x55e404);_0x1b7ef2(_0x292ba5['error'](0x1f4,_0x25462d[_0xc9d8('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 841c553..5937f23 100644 --- a/server/api/plugin/plugin.socket.js +++ b/server/api/plugin/plugin.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b76=['plugin:','./plugin.events','remove','update','emit','register','length'];(function(_0x3d1e9a,_0x29cf81){var _0xab6ac3=function(_0x4e5e41){while(--_0x4e5e41){_0x3d1e9a['push'](_0x3d1e9a['shift']());}};_0xab6ac3(++_0x29cf81);}(_0x7b76,0x120));var _0x67b7=function(_0x244e6b,_0xf444b4){_0x244e6b=_0x244e6b-0x0;var _0x7a0bd6=_0x7b76[_0x244e6b];return _0x7a0bd6;};'use strict';var PluginEvents=require(_0x67b7('0x0'));var events=['save',_0x67b7('0x1'),_0x67b7('0x2')];function createListener(_0x2706de,_0x5c2272){return function(_0x2a8796){_0x5c2272[_0x67b7('0x3')](_0x2706de,_0x2a8796);};}function removeListener(_0x476160,_0x185f59){return function(){PluginEvents['removeListener'](_0x476160,_0x185f59);};}exports[_0x67b7('0x4')]=function(_0x52fe8d){for(var _0x3b7598=0x0,_0x79748a=events[_0x67b7('0x5')];_0x3b7598<_0x79748a;_0x3b7598++){var _0x400b3d=events[_0x3b7598];var _0x4acb84=createListener(_0x67b7('0x6')+_0x400b3d,_0x52fe8d);PluginEvents['on'](_0x400b3d,_0x4acb84);}}; \ No newline at end of file +var _0xa910=['update','length','plugin:','./plugin.events','save'];(function(_0x5785f8,_0x1e9436){var _0x268976=function(_0x3c38b9){while(--_0x3c38b9){_0x5785f8['push'](_0x5785f8['shift']());}};_0x268976(++_0x1e9436);}(_0xa910,0xee));var _0x0a91=function(_0x5e0a43,_0xf13bbc){_0x5e0a43=_0x5e0a43-0x0;var _0x54e061=_0xa910[_0x5e0a43];return _0x54e061;};'use strict';var PluginEvents=require(_0x0a91('0x0'));var events=[_0x0a91('0x1'),'remove',_0x0a91('0x2')];function createListener(_0x3ed1aa,_0x8974e7){return function(_0x1b2b32){_0x8974e7['emit'](_0x3ed1aa,_0x1b2b32);};}function removeListener(_0x5e2479,_0x1ed2c7){return function(){PluginEvents['removeListener'](_0x5e2479,_0x1ed2c7);};}exports['register']=function(_0x6b023c){for(var _0x2c106c=0x0,_0x4aa5c6=events[_0x0a91('0x3')];_0x2c106c<_0x4aa5c6;_0x2c106c++){var _0x5c1a2a=events[_0x2c106c];var _0x476d79=createListener(_0x0a91('0x4')+_0x5c1a2a,_0x6b023c);PluginEvents['on'](_0x5c1a2a,_0x476d79);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index b54a906..55270da 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x381b84,_0x55d045){var _0x5b11dc=function(_0x262e92){while(--_0x262e92){_0x381b84['push'](_0x381b84['shift']());}};_0x5b11dc(++_0x55d045);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x56489a,_0x1323f0){var _0x2b22c9=function(_0x165f67){while(--_0x165f67){_0x56489a['push'](_0x56489a['shift']());}};_0x2b22c9(++_0x1323f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index b9d248e..9b38ce6 100644 --- a/server/api/pm2/pm2.controller.js +++ b/server/api/pm2/pm2.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['describe','create','body','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/logger','api','path','child_process','bluebird','sendStatus','json','name','status','send','npm\x20install','info','list','then','reject','express','length','catch','show'];(function(_0x42cdfc,_0x5475f6){var _0x2c16ca=function(_0x4ee1eb){while(--_0x4ee1eb){_0x42cdfc['push'](_0x42cdfc['shift']());}};_0x2c16ca(++_0x5475f6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcb91[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var path=require(_0x1cb9('0x2'));var exec=require(_0x1cb9('0x3'))['exec'];var BPromise=require(_0x1cb9('0x4'));function handleEntityNotFound(_0x2c17b8,_0x545a34){return function(_0x13d5fd){if(!_0x13d5fd){_0x2c17b8[_0x1cb9('0x5')](0x194);;}return _0x13d5fd;};}function respondWithResult(_0x53ffbd,_0x226b69){_0x226b69=_0x226b69||0xc8;return function(_0x3f7deb){if(_0x3f7deb){return _0x53ffbd['status'](_0x226b69)[_0x1cb9('0x6')](_0x3f7deb);}return null;};}function handleError(_0x12567c,_0x59d1be){_0x59d1be=_0x59d1be||0x1f4;return function(_0x3ae0f1){logger['error'](_0x3ae0f1['stack']);if(_0x3ae0f1[_0x1cb9('0x7')]){delete _0x3ae0f1[_0x1cb9('0x7')];}_0x12567c[_0x1cb9('0x8')](_0x59d1be)[_0x1cb9('0x9')](_0x3ae0f1);};}function execChildProcess(){return new BPromise(function(_0x2fc627,_0x50ce71){exec(_0x1cb9('0xa'),function(_0x44a6b4,_0x3af35f,_0x3fdd83){logger[_0x1cb9('0xb')](_0x3af35f);logger['info'](_0x3fdd83);if(_0x44a6b4){logger['error'](_0x44a6b4);return _0x50ce71(_0x44a6b4);}return _0x2fc627(_0x3af35f);});});}exports['index']=function(_0x358866,_0x282bc6){return pm2[_0x1cb9('0xc')]()[_0x1cb9('0xd')](function(_0x56884d){if(_0x56884d){var _0x397727=_[_0x1cb9('0xe')](_0x56884d,function(_0x1b3cd7){return _0x1b3cd7[_0x1cb9('0x7')]===_0x1cb9('0xf')||_0x1b3cd7['name']==='motion2';});return{'rows':_0x397727,'count':_0x397727[_0x1cb9('0x10')]};}return null;})[_0x1cb9('0xd')](respondWithResult(_0x282bc6,null))[_0x1cb9('0x11')](handleError(_0x282bc6,null));};exports[_0x1cb9('0x12')]=function(_0x3e21e0,_0xf22920){return pm2[_0x1cb9('0x13')](_0x3e21e0['params']['id'])['then'](respondWithResult(_0xf22920,null))[_0x1cb9('0xd')](handleEntityNotFound(_0xf22920,null))[_0x1cb9('0x11')](handleError(_0xf22920,null));};exports[_0x1cb9('0x14')]=function(_0x31481a,_0x280a84){if(_0x31481a[_0x1cb9('0x15')][_0x1cb9('0x7')]&&_0x31481a['body']['script']){var _0x1a5a72=path['join'](__dirname,_0x1cb9('0x16'),_0x31481a[_0x1cb9('0x15')]['script']);var _0x599275=process[_0x1cb9('0x17')]();process[_0x1cb9('0x18')](path[_0x1cb9('0x19')](_0x1a5a72));return execChildProcess()[_0x1cb9('0xd')](function(_0x45b8d3){process[_0x1cb9('0x18')](_0x599275);return pm2['start']({'name':_0x31481a['body'][_0x1cb9('0x7')],'script':_0x1a5a72});})['then'](function(_0x10a419){pm2[_0x1cb9('0x1a')]();return _0x10a419[0x0];})[_0x1cb9('0xd')](respondWithResult(_0x280a84,0xc9))[_0x1cb9('0x11')](handleError(_0x280a84,null));}else{return _0x280a84[_0x1cb9('0x8')](0x1f4)['send']({'message':_0x1cb9('0x1b')});}};exports[_0x1cb9('0x1c')]=function(_0x4c8d76,_0xd6891c){if(_0x4c8d76[_0x1cb9('0x15')]['id']){delete _0x4c8d76[_0x1cb9('0x15')]['id'];}var _0x1804fd={'online':_0x1cb9('0x1d'),'stopped':_0x1cb9('0x1e')};if(_0x1804fd[_0x1cb9('0x1f')](_0x4c8d76[_0x1cb9('0x15')][_0x1cb9('0x8')])){return pm2[_0x1804fd[_0x4c8d76[_0x1cb9('0x15')]['status']]](_0x4c8d76[_0x1cb9('0x20')]['id'])['then'](respondWithResult(_0xd6891c,0xc8))[_0x1cb9('0x11')](handleError(_0xd6891c,null));}else{return _0xd6891c['status'](0x1f4)[_0x1cb9('0x9')]({'message':_0x1cb9('0x21')});}};exports[_0x1cb9('0x22')]=function(_0x2038aa,_0x561d89){if(_0x2038aa[_0x1cb9('0x15')]['id']){delete _0x2038aa['body']['id'];}if(_0x2038aa[_0x1cb9('0x20')]['id']){return pm2[_0x1cb9('0x23')](_0x2038aa[_0x1cb9('0x20')]['id'])['then'](function(_0xae4c7a){pm2['dump']();return _0xae4c7a[0x0];})[_0x1cb9('0xd')](respondWithResult(_0x561d89,null))['catch'](handleError(_0x561d89,null));}else{return _0x561d89[_0x1cb9('0x8')](0x1f4)[_0x1cb9('0x9')]({'message':_0x1cb9('0x24')});}}; \ No newline at end of file +var _0xb43b=['stack','name','send','npm\x20install','info','index','list','express','then','describe','catch','create','body','script','join','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','Unknown\x20id','lodash','../../config/pm2','api','path','child_process','bluebird','status','json'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2614d3,_0x4b1d22){_0x2614d3=_0x2614d3-0x0;var _0x550b25=_0xb43b[_0x2614d3];return _0x550b25;};'use strict';var _=require(_0xbb43('0x0'));var pm2=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var path=require(_0xbb43('0x3'));var exec=require(_0xbb43('0x4'))['exec'];var BPromise=require(_0xbb43('0x5'));function handleEntityNotFound(_0x41aff6,_0x351254){return function(_0x16432a){if(!_0x16432a){_0x41aff6['sendStatus'](0x194);;}return _0x16432a;};}function respondWithResult(_0x491fb9,_0x378df5){_0x378df5=_0x378df5||0xc8;return function(_0x553520){if(_0x553520){return _0x491fb9[_0xbb43('0x6')](_0x378df5)[_0xbb43('0x7')](_0x553520);}return null;};}function handleError(_0x2a2f11,_0x29ae1a){_0x29ae1a=_0x29ae1a||0x1f4;return function(_0x364718){logger['error'](_0x364718[_0xbb43('0x8')]);if(_0x364718[_0xbb43('0x9')]){delete _0x364718['name'];}_0x2a2f11[_0xbb43('0x6')](_0x29ae1a)[_0xbb43('0xa')](_0x364718);};}function execChildProcess(){return new BPromise(function(_0xd37cdf,_0x5e3611){exec(_0xbb43('0xb'),function(_0x2bef86,_0x480cc2,_0x36a473){logger[_0xbb43('0xc')](_0x480cc2);logger['info'](_0x36a473);if(_0x2bef86){logger['error'](_0x2bef86);return _0x5e3611(_0x2bef86);}return _0xd37cdf(_0x480cc2);});});}exports[_0xbb43('0xd')]=function(_0x4a3714,_0x593d0b){return pm2[_0xbb43('0xe')]()['then'](function(_0x68d45d){if(_0x68d45d){var _0x43021d=_['reject'](_0x68d45d,function(_0x4a6e18){return _0x4a6e18['name']===_0xbb43('0xf')||_0x4a6e18[_0xbb43('0x9')]==='motion2';});return{'rows':_0x43021d,'count':_0x43021d['length']};}return null;})[_0xbb43('0x10')](respondWithResult(_0x593d0b,null))['catch'](handleError(_0x593d0b,null));};exports['show']=function(_0x2b0797,_0x8242ab){return pm2[_0xbb43('0x11')](_0x2b0797['params']['id'])[_0xbb43('0x10')](respondWithResult(_0x8242ab,null))['then'](handleEntityNotFound(_0x8242ab,null))[_0xbb43('0x12')](handleError(_0x8242ab,null));};exports[_0xbb43('0x13')]=function(_0x4dfc54,_0x5d765b){if(_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x9')]&&_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x15')]){var _0x5bcce7=path[_0xbb43('0x16')](__dirname,'../../files/plugins',_0x4dfc54[_0xbb43('0x14')]['script']);var _0x2f5e31=process['cwd']();process[_0xbb43('0x17')](path[_0xbb43('0x18')](_0x5bcce7));return execChildProcess()['then'](function(_0x1d0768){process['chdir'](_0x2f5e31);return pm2[_0xbb43('0x19')]({'name':_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x9')],'script':_0x5bcce7});})['then'](function(_0x53f0d5){pm2['dump']();return _0x53f0d5[0x0];})[_0xbb43('0x10')](respondWithResult(_0x5d765b,0xc9))[_0xbb43('0x12')](handleError(_0x5d765b,null));}else{return _0x5d765b['status'](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x1a')});}};exports[_0xbb43('0x1b')]=function(_0x3874fb,_0x4ed43f){if(_0x3874fb['body']['id']){delete _0x3874fb[_0xbb43('0x14')]['id'];}var _0x42800f={'online':_0xbb43('0x1c'),'stopped':_0xbb43('0x1d')};if(_0x42800f[_0xbb43('0x1e')](_0x3874fb[_0xbb43('0x14')][_0xbb43('0x6')])){return pm2[_0x42800f[_0x3874fb[_0xbb43('0x14')]['status']]](_0x3874fb[_0xbb43('0x1f')]['id'])['then'](respondWithResult(_0x4ed43f,0xc8))[_0xbb43('0x12')](handleError(_0x4ed43f,null));}else{return _0x4ed43f[_0xbb43('0x6')](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x20')});}};exports['destroy']=function(_0x157d62,_0x547a6f){if(_0x157d62['body']['id']){delete _0x157d62['body']['id'];}if(_0x157d62[_0xbb43('0x1f')]['id']){return pm2['delete'](_0x157d62[_0xbb43('0x1f')]['id'])[_0xbb43('0x10')](function(_0xc577ac){pm2['dump']();return _0xc577ac[0x0];})[_0xbb43('0x10')](respondWithResult(_0x547a6f,null))[_0xbb43('0x12')](handleError(_0x547a6f,null));}else{return _0x547a6f[_0xbb43('0x6')](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x21')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 195d5ce..50d8608 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52a6=['exports','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','/queues','getQueues'];(function(_0x5ccf9e,_0x17f5b2){var _0x5914ca=function(_0xa1c66f){while(--_0xa1c66f){_0x5ccf9e['push'](_0x5ccf9e['shift']());}};_0x5914ca(++_0x17f5b2);}(_0x52a6,0x88));var _0x652a=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x52a6[_0x95942];return _0x6d7f81;};'use strict';var express=require('express');var router=express[_0x652a('0x0')]();var auth=require(_0x652a('0x1'));var controller=require(_0x652a('0x2'));router[_0x652a('0x3')](_0x652a('0x4'),auth[_0x652a('0x5')](),controller['getAgents']);router[_0x652a('0x3')](_0x652a('0x6'),auth[_0x652a('0x5')](),controller[_0x652a('0x7')]);module[_0x652a('0x8')]=router; \ No newline at end of file +var _0xcfca=['exports','Router','../../components/auth/service','./realtime.controller','/agents','isAuthenticated','getAgents','get','/queues','getQueues'];(function(_0x24f2fc,_0x49769b){var _0x3fbcfa=function(_0x52e3da){while(--_0x52e3da){_0x24f2fc['push'](_0x24f2fc['shift']());}};_0x3fbcfa(++_0x49769b);}(_0xcfca,0x1af));var _0xacfc=function(_0x23a4cc,_0x1b83e7){_0x23a4cc=_0x23a4cc-0x0;var _0x5420cc=_0xcfca[_0x23a4cc];return _0x5420cc;};'use strict';var express=require('express');var router=express[_0xacfc('0x0')]();var auth=require(_0xacfc('0x1'));var controller=require(_0xacfc('0x2'));router['get'](_0xacfc('0x3'),auth[_0xacfc('0x4')](),controller[_0xacfc('0x5')]);router[_0xacfc('0x6')](_0xacfc('0x7'),auth[_0xacfc('0x4')](),controller[_0xacfc('0x8')]);module[_0xacfc('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index c8e779e..e91f06d 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b3f=['user','userProfileId','agent','assign','findAndCountAll','filterAgentAttributes','includes','sortAgentsByStatus','catch','getQueues','isValidChannel','startCase','Queue','type','voice','outbound','join','QueueCampaigns','name','filter','UserProfile','getResources','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../mysqldb','APIBadRequestError','../../errors/api','handleError','offset','undefined','limit','count','Content-Range','json','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','resolve','then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','order','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','key','role','online','sequelize','literal','FIELD(id,','forEach','*pause','push','Pause','where','merge'];(function(_0x351cbd,_0x2cc7fa){var _0x3a3941=function(_0x5db66b){while(--_0x5db66b){_0x351cbd['push'](_0x351cbd['shift']());}};_0x3a3941(++_0x2cc7fa);}(_0x0b3f,0xac));var _0xf0b3=function(_0x20603f,_0x1d847b){_0x20603f=_0x20603f-0x0;var _0x2d2b37=_0x0b3f[_0x20603f];return _0x2d2b37;};'use strict';var _=require(_0xf0b3('0x0'));var util=require(_0xf0b3('0x1'));var rta=require(_0xf0b3('0x2'));var rtq=require(_0xf0b3('0x3'));var qs=require('../../components/parsers/qs');var utils=require('../../config/utils');var db=require(_0xf0b3('0x4'))['db'];var APIBadRequestError=require('../../errors/api')[_0xf0b3('0x5')];var APIHandleError=require(_0xf0b3('0x6'))[_0xf0b3('0x7')];function respondWithFilteredResult(_0x1d4c0b,_0x33910a){return function(_0x568074){if(_0x568074){var _0x1581f2=typeof _0x33910a[_0xf0b3('0x8')]===_0xf0b3('0x9')&&typeof _0x33910a[_0xf0b3('0xa')]===_0xf0b3('0x9');var _0x3a26ee=_0x568074[_0xf0b3('0xb')];var _0x5f466b=_0x1581f2?0x0:_0x33910a[_0xf0b3('0x8')];var _0x437306=_0x1581f2?_0x568074[_0xf0b3('0xb')]:_0x33910a[_0xf0b3('0x8')]+_0x33910a[_0xf0b3('0xa')];var _0x4846ed;if(_0x437306>=_0x3a26ee){_0x437306=_0x3a26ee;_0x4846ed=0xc8;}else{_0x4846ed=0xce;}_0x1d4c0b['status'](_0x4846ed);return _0x1d4c0b['set'](_0xf0b3('0xc'),_0x5f466b+'-'+_0x437306+'/'+_0x3a26ee)[_0xf0b3('0xd')](_0x568074);}return null;};}exports['getAgents']=function(_0x4cff03,_0x128acd){var _0x5e4846={'count':0x0,'rows':[]};var _0x4b0ed5={};var _0x59f8d1;var _0x5974a7=utils[_0xf0b3('0xe')]();var _0x579ba6;var _0x2e63f5;var _0x2c85dc=_0x4cff03[_0xf0b3('0xf')][_0xf0b3('0x10')];var _0x3aecbe=_0x4cff03[_0xf0b3('0xf')][_0xf0b3('0x11')];var _0xf32f2d=_0x4cff03[_0xf0b3('0xf')][_0xf0b3('0x12')];var _0x2c1e54=_0x3aecbe===_0xf0b3('0x13')||_0x3aecbe==='*pause'?!![]:![];var _0x5b3b5d=[];var _0x2f73b4;var _0x2cf2e0;Promise[_0xf0b3('0x14')]()[_0xf0b3('0x15')](function(){if(_0x4cff03['query'][_0xf0b3('0x16')]){if(!utils['isValidChannel'](_0x4cff03[_0xf0b3('0xf')][_0xf0b3('0x16')])){throw new APIBadRequestError(util[_0xf0b3('0x17')](_0xf0b3('0x18'),_0x4cff03[_0xf0b3('0xf')][_0xf0b3('0x16')]));}_0x59f8d1=_0x4cff03['query'][_0xf0b3('0x16')]['toLowerCase']();}if(!_0x4cff03[_0xf0b3('0xf')][_0xf0b3('0x19')]||!_0x4cff03[_0xf0b3('0xf')][_0xf0b3('0x19')]['includes'](_0xf0b3('0x1a'))){_0x4cff03[_0xf0b3('0xf')]['sort']=rta[_0xf0b3('0x1b')](_0x4cff03[_0xf0b3('0xf')][_0xf0b3('0x19')]);return;}var _0xc5179a=rta[_0xf0b3('0x1c')](_0x4cff03[_0xf0b3('0xf')]['sort']);_0x4cff03[_0xf0b3('0xf')][_0xf0b3('0x19')]=_0xc5179a[_0xf0b3('0x1d')]['join'](',');_0x2f73b4=_0xc5179a[_0xf0b3('0x1e')];})[_0xf0b3('0x15')](function(){if(!_0x2c85dc){return[];}return rta['getAgentIdsByQueues'](_0x2c85dc,_0x59f8d1);})[_0xf0b3('0x15')](function(_0x431381){_0x5b3b5d=_0x431381;return rta[_0xf0b3('0x1f')]();})[_0xf0b3('0x15')](function(_0x50db9c){_0x2e63f5=_0x50db9c[_0xf0b3('0x20')];if((!_0x3aecbe||_0x2c1e54)&&!_0x2f73b4){return _0x5b3b5d;}if(_0x2f73b4&&!_0x3aecbe){return rta[_0xf0b3('0x21')](_0x2e63f5,_0x5b3b5d,_0x2f73b4);}else{return rta[_0xf0b3('0x22')](_0x2e63f5,_0x5b3b5d,_0x3aecbe);}})['then'](function(_0x3cc569){_0x5b3b5d=_0x3cc569;var _0x4b5753=![];if(_0x5b3b5d['length']===0x0){if(_0x2c85dc||_0x3aecbe){_0x4b5753=!![];}if(_0x2c1e54){_0x4b5753=![];}}if(_0x4b5753){return _0x5e4846;}var _0x355fc9=_[_0xf0b3('0x23')](db[_0xf0b3('0x24')][_0xf0b3('0x25')],function(_0x1f6c32){return{'name':_0x1f6c32['fieldName'],'type':_0x1f6c32['type'][_0xf0b3('0x26')]};});_0x4cff03['query'][_0xf0b3('0x27')]='agent';_0x4cff03['query'][_0xf0b3('0x28')]=!![];_0x4b0ed5=qs['getOptions'](_0x355fc9,_0x4cff03);_0x4b0ed5['raw']=!![];var _0x2b1cb4=[];if(_0x5b3b5d['length']>0x0){_0x2b1cb4['push']({'id':{'$in':_0x5b3b5d}});if(_0x2f73b4&&!_0x3aecbe){_0x2cf2e0=[db[_0xf0b3('0x29')][_0xf0b3('0x2a')](_0xf0b3('0x2b')+_0x5b3b5d+')')];_0x4b0ed5[_0xf0b3('0x1e')]=_0x2cf2e0;}}if(_0x2c1e54){_0x5974a7[_0xf0b3('0x2c')](function(_0x1eb3bf){var _0x474aa5=!![];if(_0x3aecbe===_0xf0b3('0x2d')&&_0x59f8d1!==_0x1eb3bf){_0x474aa5=![];}_0x2b1cb4[_0xf0b3('0x2e')]({[_0x1eb3bf+_0xf0b3('0x2f')]:_0x474aa5});});if(_0xf32f2d){_0x2b1cb4[_0xf0b3('0x2e')]({'pauseType':_0xf32f2d});}}else if(_0x3aecbe){_0x5974a7[_0xf0b3('0x2c')](function(_0x25ce1c){_0x2b1cb4[_0xf0b3('0x2e')]({[_0x25ce1c+'Pause']:![]});});}_0x4b0ed5[_0xf0b3('0x30')]=_[_0xf0b3('0x31')](_0x4b0ed5[_0xf0b3('0x30')],{'$and':_0x2b1cb4});if(_0x4cff03[_0xf0b3('0x32')][_0xf0b3('0x27')]===_0xf0b3('0x32')){var _0x8c5b3a={'params':{'id':_0x4cff03[_0xf0b3('0x32')][_0xf0b3('0x33')]},'query':{'section':'Agents','role':_0xf0b3('0x34'),'online':!![],'raw':!![],'ids':_0x5b3b5d,'customSorting':_0x2cf2e0}};if(_0x2c1e54){_0x8c5b3a[_0xf0b3('0xf')]['extraQueryConditions']=_0x2b1cb4;}_0x8c5b3a[_0xf0b3('0xf')]=Object[_0xf0b3('0x35')](_0x8c5b3a[_0xf0b3('0xf')],_0x4cff03[_0xf0b3('0xf')]);delete _0x8c5b3a[_0xf0b3('0xf')]['id'];return db['UserProfile']['getResources'](_0x8c5b3a);}return db[_0xf0b3('0x24')][_0xf0b3('0x36')](_0x4b0ed5);})['then'](function(_0x421987){_0x5e4846[_0xf0b3('0xb')]=_0x421987[_0xf0b3('0xb')];_0x579ba6=_0x421987[_0xf0b3('0x20')];return _0x579ba6[_0xf0b3('0x23')](function(_0x269abc){var _0x29ed7f=_['find'](_0x2e63f5,['id',_0x269abc['id']]);if(_0x29ed7f){var _0x247673=rta[_0xf0b3('0x37')](_0x29ed7f);_[_0xf0b3('0x31')](_0x269abc,_0x247673);}_0x269abc[_0xf0b3('0x1a')]=rta['getAgentStatus'](_0x269abc);if(_0x269abc[_0xf0b3('0x1a')][_0xf0b3('0x38')](_0xf0b3('0x13'))){_0x5974a7['forEach'](function(_0x3577aa){if(_0x269abc[_0x3577aa+'Pause']){_0x269abc[_0x3577aa+'Status']=_0xf0b3('0x13');}});}return _0x269abc;});})['then'](function(_0x1c53ee){if(!_0x2f73b4||_0x2cf2e0){return _0x1c53ee;}return rta[_0xf0b3('0x39')](_0x1c53ee,_0x2f73b4);})[_0xf0b3('0x15')](function(_0x393760){var _0x116e79=null;if(_0x4cff03['query'][_0xf0b3('0x1d')]){var _0x2d5d34=_0x4cff03[_0xf0b3('0xf')]['fields']['split'](',');_0x116e79=_0x393760[_0xf0b3('0x23')](function(_0x10afbc){return _['pick'](_0x10afbc,_0x2d5d34);});}_0x5e4846[_0xf0b3('0x20')]=_0x116e79||_0x393760;return _0x5e4846;})['then'](respondWithFilteredResult(_0x128acd,_0x4b0ed5))[_0xf0b3('0x3a')](APIHandleError(_0x128acd));};exports[_0xf0b3('0x3b')]=function(_0x12a1bc,_0xbc1b3a){var _0x55e3c2={'count':0x0,'rows':[]};var _0x4ae8f5={};var _0x30a52f;var _0x51b854;var _0x475c7e;Promise[_0xf0b3('0x14')]()[_0xf0b3('0x15')](function(){if(_0x12a1bc['query'][_0xf0b3('0x16')]){if(!utils[_0xf0b3('0x3c')](_0x12a1bc['query'][_0xf0b3('0x16')])){throw new APIBadRequestError(util[_0xf0b3('0x17')](_0xf0b3('0x18'),_0x12a1bc['query']['channel']));}_0x30a52f=_0x12a1bc[_0xf0b3('0xf')]['channel']['toLowerCase']();}var _0x5d3fd1=_[_0xf0b3('0x3d')](_0x30a52f)+_0xf0b3('0x3e');var _0x47a348=_[_0xf0b3('0x23')](db[_0x5d3fd1][_0xf0b3('0x25')],function(_0x5aa180){return{'name':_0x5aa180['fieldName'],'type':_0x5aa180[_0xf0b3('0x3f')][_0xf0b3('0x26')]};});if(!_0x12a1bc[_0xf0b3('0xf')][_0xf0b3('0x1d')]){var _0x274069=['id','name'];if(_0x30a52f===_0xf0b3('0x40')){_0x274069['push'](_0xf0b3('0x3f'));if(_0x12a1bc['query'][_0xf0b3('0x3f')]===_0xf0b3('0x41')){_0x274069['push'](['dialActive','dialMethod']);}}_0x12a1bc[_0xf0b3('0xf')][_0xf0b3('0x1d')]=_0x274069[_0xf0b3('0x42')](',');}_0x4ae8f5=qs['getOptions'](_0x47a348,_0x12a1bc);if(_0x12a1bc['user'][_0xf0b3('0x27')]===_0xf0b3('0x32')){var _0x168ab3={'params':{'id':_0x12a1bc[_0xf0b3('0x32')][_0xf0b3('0x33')]},'query':{'section':_0x30a52f===_0xf0b3('0x40')&&_0x12a1bc['query'][_0xf0b3('0x3f')]===_0xf0b3('0x41')?_0xf0b3('0x43'):_[_0xf0b3('0x3d')](_0x30a52f)+'Queues','type':_0x12a1bc[_0xf0b3('0xf')][_0xf0b3('0x3f')],'nolimit':!![],'sort':_0xf0b3('0x44'),'filter':_0x12a1bc[_0xf0b3('0xf')][_0xf0b3('0x45')]}};return db[_0xf0b3('0x46')][_0xf0b3('0x47')](_0x168ab3);}return db[_0x5d3fd1]['findAndCountAll'](_0x4ae8f5);})['then'](function(_0x36d82a){_0x55e3c2['count']=_0x36d82a['count'];_0x51b854=_0x36d82a[_0xf0b3('0x20')];return rtq[_0xf0b3('0x48')](_0x12a1bc,_0x30a52f);})['then'](function(_0x4b8075){_0x475c7e=_0x4b8075[_0xf0b3('0x20')];return rtq[_0xf0b3('0x49')](_0x51b854,_0x475c7e,_0x30a52f,_0x12a1bc[_0xf0b3('0xf')]['type']);})[_0xf0b3('0x15')](function(_0x412a6a){_0x55e3c2['rows']=_0x412a6a;return _0x55e3c2;})['then'](respondWithFilteredResult(_0xbc1b3a,_0x4ae8f5))['catch'](APIHandleError(_0xbc1b3a));}; \ No newline at end of file +var _0x0350=['merge','where','role','Agents','extraQueryConditions','UserProfile','findAndCountAll','find','getAgentStatus','Status','sortAgentsByStatus','split','getQueues','resolve','startCase','key','name','outbound','dialActive','dialMethod','join','user','userProfileId','voice','QueueCampaigns','Queues','filter','getResources','getRealtimeQueues','catch','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','handleError','offset','undefined','limit','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','pauseTypeFilter','pause','*pause','then','channel','isValidChannel','format','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','type','agent','online','getOptions','raw','push','literal','FIELD(id,','order','forEach','Pause'];(function(_0x1fe56b,_0x3860ff){var _0x366c40=function(_0x29d3ea){while(--_0x29d3ea){_0x1fe56b['push'](_0x1fe56b['shift']());}};_0x366c40(++_0x3860ff);}(_0x0350,0x114));var _0x0035=function(_0x9c85da,_0x58ca5d){_0x9c85da=_0x9c85da-0x0;var _0x2b124b=_0x0350[_0x9c85da];return _0x2b124b;};'use strict';var _=require('lodash');var util=require(_0x0035('0x0'));var rta=require(_0x0035('0x1'));var rtq=require(_0x0035('0x2'));var qs=require(_0x0035('0x3'));var utils=require(_0x0035('0x4'));var db=require(_0x0035('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0x0035('0x6')];var APIHandleError=require(_0x0035('0x7'))[_0x0035('0x8')];function respondWithFilteredResult(_0x3b9766,_0x28fba1){return function(_0x542321){if(_0x542321){var _0x13f769=typeof _0x28fba1[_0x0035('0x9')]===_0x0035('0xa')&&typeof _0x28fba1[_0x0035('0xb')]==='undefined';var _0x32217b=_0x542321[_0x0035('0xc')];var _0x2e1f59=_0x13f769?0x0:_0x28fba1[_0x0035('0x9')];var _0x5cf021=_0x13f769?_0x542321[_0x0035('0xc')]:_0x28fba1[_0x0035('0x9')]+_0x28fba1[_0x0035('0xb')];var _0x35d497;if(_0x5cf021>=_0x32217b){_0x5cf021=_0x32217b;_0x35d497=0xc8;}else{_0x35d497=0xce;}_0x3b9766[_0x0035('0xd')](_0x35d497);return _0x3b9766[_0x0035('0xe')](_0x0035('0xf'),_0x2e1f59+'-'+_0x5cf021+'/'+_0x32217b)[_0x0035('0x10')](_0x542321);}return null;};}exports[_0x0035('0x11')]=function(_0x35536d,_0x2aec01){var _0x149c37={'count':0x0,'rows':[]};var _0x15ac4f={};var _0x2f184c;var _0x54bfd2=utils[_0x0035('0x12')]();var _0x3cadc5;var _0x1ef20c;var _0x354c3b=_0x35536d[_0x0035('0x13')][_0x0035('0x14')];var _0x288fca=_0x35536d[_0x0035('0x13')]['globalStatusFilter'];var _0x34076b=_0x35536d['query'][_0x0035('0x15')];var _0x41301f=_0x288fca===_0x0035('0x16')||_0x288fca===_0x0035('0x17')?!![]:![];var _0x41d1f6=[];var _0x4c6c6f;var _0x44126f;Promise['resolve']()[_0x0035('0x18')](function(){if(_0x35536d[_0x0035('0x13')][_0x0035('0x19')]){if(!utils[_0x0035('0x1a')](_0x35536d[_0x0035('0x13')][_0x0035('0x19')])){throw new APIBadRequestError(util[_0x0035('0x1b')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x35536d[_0x0035('0x13')]['channel']));}_0x2f184c=_0x35536d[_0x0035('0x13')][_0x0035('0x19')][_0x0035('0x1c')]();}if(!_0x35536d[_0x0035('0x13')][_0x0035('0x1d')]||!_0x35536d[_0x0035('0x13')][_0x0035('0x1d')][_0x0035('0x1e')](_0x0035('0x1f'))){_0x35536d[_0x0035('0x13')][_0x0035('0x1d')]=rta[_0x0035('0x20')](_0x35536d[_0x0035('0x13')][_0x0035('0x1d')]);return;}var _0x198309=rta[_0x0035('0x21')](_0x35536d[_0x0035('0x13')]['sort']);_0x35536d[_0x0035('0x13')][_0x0035('0x1d')]=_0x198309[_0x0035('0x22')]['join'](',');_0x4c6c6f=_0x198309['order'];})[_0x0035('0x18')](function(){if(!_0x354c3b){return[];}return rta['getAgentIdsByQueues'](_0x354c3b,_0x2f184c);})[_0x0035('0x18')](function(_0xc65877){_0x41d1f6=_0xc65877;return rta['getRealtimeAgents']();})[_0x0035('0x18')](function(_0x3743c1){_0x1ef20c=_0x3743c1[_0x0035('0x23')];if((!_0x288fca||_0x41301f)&&!_0x4c6c6f){return _0x41d1f6;}if(_0x4c6c6f&&!_0x288fca){return rta[_0x0035('0x24')](_0x1ef20c,_0x41d1f6,_0x4c6c6f);}else{return rta['getAgentIdsByStatus'](_0x1ef20c,_0x41d1f6,_0x288fca);}})[_0x0035('0x18')](function(_0x1b23f6){_0x41d1f6=_0x1b23f6;var _0x14c3ec=![];if(_0x41d1f6[_0x0035('0x25')]===0x0){if(_0x354c3b||_0x288fca){_0x14c3ec=!![];}if(_0x41301f){_0x14c3ec=![];}}if(_0x14c3ec){return _0x149c37;}var _0x4e9f1d=_[_0x0035('0x26')](db[_0x0035('0x27')][_0x0035('0x28')],function(_0x173437){return{'name':_0x173437['fieldName'],'type':_0x173437[_0x0035('0x29')]['key']};});_0x35536d[_0x0035('0x13')]['role']=_0x0035('0x2a');_0x35536d[_0x0035('0x13')][_0x0035('0x2b')]=!![];_0x15ac4f=qs[_0x0035('0x2c')](_0x4e9f1d,_0x35536d);_0x15ac4f[_0x0035('0x2d')]=!![];var _0x58595e=[];if(_0x41d1f6[_0x0035('0x25')]>0x0){_0x58595e[_0x0035('0x2e')]({'id':{'$in':_0x41d1f6}});if(_0x4c6c6f&&!_0x288fca){_0x44126f=[db['sequelize'][_0x0035('0x2f')](_0x0035('0x30')+_0x41d1f6+')')];_0x15ac4f[_0x0035('0x31')]=_0x44126f;}}if(_0x41301f){_0x54bfd2[_0x0035('0x32')](function(_0x1d946c){var _0x2a87db=!![];if(_0x288fca==='*pause'&&_0x2f184c!==_0x1d946c){_0x2a87db=![];}_0x58595e[_0x0035('0x2e')]({[_0x1d946c+'Pause']:_0x2a87db});});if(_0x34076b){_0x58595e['push']({'pauseType':_0x34076b});}}else if(_0x288fca){_0x54bfd2[_0x0035('0x32')](function(_0x2e2f52){_0x58595e[_0x0035('0x2e')]({[_0x2e2f52+_0x0035('0x33')]:![]});});}_0x15ac4f['where']=_[_0x0035('0x34')](_0x15ac4f[_0x0035('0x35')],{'$and':_0x58595e});if(_0x35536d['user'][_0x0035('0x36')]==='user'){var _0x1b48fc={'params':{'id':_0x35536d['user']['userProfileId']},'query':{'section':_0x0035('0x37'),'role':_0x0035('0x2a'),'online':!![],'raw':!![],'ids':_0x41d1f6,'customSorting':_0x44126f}};if(_0x41301f){_0x1b48fc[_0x0035('0x13')][_0x0035('0x38')]=_0x58595e;}_0x1b48fc[_0x0035('0x13')]=Object['assign'](_0x1b48fc[_0x0035('0x13')],_0x35536d[_0x0035('0x13')]);delete _0x1b48fc[_0x0035('0x13')]['id'];return db[_0x0035('0x39')]['getResources'](_0x1b48fc);}return db[_0x0035('0x27')][_0x0035('0x3a')](_0x15ac4f);})[_0x0035('0x18')](function(_0x2a48cd){_0x149c37[_0x0035('0xc')]=_0x2a48cd[_0x0035('0xc')];_0x3cadc5=_0x2a48cd[_0x0035('0x23')];return _0x3cadc5[_0x0035('0x26')](function(_0x8f184b){var _0x5df449=_[_0x0035('0x3b')](_0x1ef20c,['id',_0x8f184b['id']]);if(_0x5df449){var _0x19781b=rta['filterAgentAttributes'](_0x5df449);_['merge'](_0x8f184b,_0x19781b);}_0x8f184b['globalStatus']=rta[_0x0035('0x3c')](_0x8f184b);if(_0x8f184b['globalStatus'][_0x0035('0x1e')](_0x0035('0x16'))){_0x54bfd2['forEach'](function(_0x3ec0d2){if(_0x8f184b[_0x3ec0d2+_0x0035('0x33')]){_0x8f184b[_0x3ec0d2+_0x0035('0x3d')]=_0x0035('0x16');}});}return _0x8f184b;});})['then'](function(_0x491c57){if(!_0x4c6c6f||_0x44126f){return _0x491c57;}return rta[_0x0035('0x3e')](_0x491c57,_0x4c6c6f);})[_0x0035('0x18')](function(_0x2fb5cc){var _0x3fc8f6=null;if(_0x35536d[_0x0035('0x13')][_0x0035('0x22')]){var _0x588764=_0x35536d[_0x0035('0x13')]['fields'][_0x0035('0x3f')](',');_0x3fc8f6=_0x2fb5cc[_0x0035('0x26')](function(_0x3c4894){return _['pick'](_0x3c4894,_0x588764);});}_0x149c37[_0x0035('0x23')]=_0x3fc8f6||_0x2fb5cc;return _0x149c37;})[_0x0035('0x18')](respondWithFilteredResult(_0x2aec01,_0x15ac4f))['catch'](APIHandleError(_0x2aec01));};exports[_0x0035('0x40')]=function(_0x98a5f3,_0x45882c){var _0xbd9797={'count':0x0,'rows':[]};var _0x2716b5={};var _0x580f75;var _0x3f1530;var _0xf4ed44;Promise[_0x0035('0x41')]()['then'](function(){if(_0x98a5f3[_0x0035('0x13')][_0x0035('0x19')]){if(!utils[_0x0035('0x1a')](_0x98a5f3['query'][_0x0035('0x19')])){throw new APIBadRequestError(util[_0x0035('0x1b')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x98a5f3[_0x0035('0x13')]['channel']));}_0x580f75=_0x98a5f3['query'][_0x0035('0x19')][_0x0035('0x1c')]();}var _0xc9876c=_[_0x0035('0x42')](_0x580f75)+'Queue';var _0x3b1b73=_[_0x0035('0x26')](db[_0xc9876c]['rawAttributes'],function(_0x586bb3){return{'name':_0x586bb3['fieldName'],'type':_0x586bb3[_0x0035('0x29')][_0x0035('0x43')]};});if(!_0x98a5f3[_0x0035('0x13')][_0x0035('0x22')]){var _0x12976f=['id',_0x0035('0x44')];if(_0x580f75==='voice'){_0x12976f['push'](_0x0035('0x29'));if(_0x98a5f3[_0x0035('0x13')]['type']===_0x0035('0x45')){_0x12976f[_0x0035('0x2e')]([_0x0035('0x46'),_0x0035('0x47')]);}}_0x98a5f3[_0x0035('0x13')][_0x0035('0x22')]=_0x12976f[_0x0035('0x48')](',');}_0x2716b5=qs[_0x0035('0x2c')](_0x3b1b73,_0x98a5f3);if(_0x98a5f3['user']['role']===_0x0035('0x49')){var _0x3a2ecc={'params':{'id':_0x98a5f3[_0x0035('0x49')][_0x0035('0x4a')]},'query':{'section':_0x580f75===_0x0035('0x4b')&&_0x98a5f3[_0x0035('0x13')][_0x0035('0x29')]===_0x0035('0x45')?_0x0035('0x4c'):_[_0x0035('0x42')](_0x580f75)+_0x0035('0x4d'),'type':_0x98a5f3[_0x0035('0x13')][_0x0035('0x29')],'nolimit':!![],'sort':'name','filter':_0x98a5f3[_0x0035('0x13')][_0x0035('0x4e')]}};return db['UserProfile'][_0x0035('0x4f')](_0x3a2ecc);}return db[_0xc9876c][_0x0035('0x3a')](_0x2716b5);})[_0x0035('0x18')](function(_0x5a9385){_0xbd9797[_0x0035('0xc')]=_0x5a9385[_0x0035('0xc')];_0x3f1530=_0x5a9385[_0x0035('0x23')];return rtq[_0x0035('0x50')](_0x98a5f3,_0x580f75);})[_0x0035('0x18')](function(_0x576abf){_0xf4ed44=_0x576abf[_0x0035('0x23')];return rtq['initializeQueues'](_0x3f1530,_0xf4ed44,_0x580f75,_0x98a5f3[_0x0035('0x13')][_0x0035('0x29')]);})[_0x0035('0x18')](function(_0xe91194){_0xbd9797[_0x0035('0x23')]=_0xe91194;return _0xbd9797;})['then'](respondWithFilteredResult(_0x45882c,_0x2716b5))[_0x0035('0x51')](APIHandleError(_0x45882c));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 0c07a18..82a1c43 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5db469,_0x545568){var _0x34733b=function(_0x1393c0){while(--_0x1393c0){_0x5db469['push'](_0x5db469['shift']());}};_0x34733b(++_0x545568);}(_0xe706,0xa3));var _0x6e70=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0xe706[_0x6173fc];return _0x965fbe;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x45ebfc,_0x5be1b0){var _0x4aace6=function(_0x5c658e){while(--_0x5c658e){_0x45ebfc['push'](_0x45ebfc['shift']());}};_0x4aace6(++_0x5be1b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index cc3b526..a81c3c6 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js +++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9973=['INTEGER','DATE','STRING','exports'];(function(_0x32a6c6,_0x374b04){var _0x5e35a=function(_0x1b1769){while(--_0x1b1769){_0x32a6c6['push'](_0x32a6c6['shift']());}};_0x5e35a(++_0x374b04);}(_0x9973,0x157));var _0x3997=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9973[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0x3997('0x0')]={'state':{'type':Sequelize[_0x3997('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x3997('0x2')]},'uniqueid':{'type':Sequelize[_0x3997('0x3')]},'starttime':{'type':Sequelize[_0x3997('0x2')]},'responsetime':{'type':Sequelize[_0x3997('0x2')]},'ringtime':{'type':Sequelize[_0x3997('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x3997('0x3')]},'campaigntype':{'type':Sequelize[_0x3997('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4c60=['STRING','sequelize','exports','INTEGER'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x4c60,0xc1));var _0x04c6=function(_0x278fc7,_0xf91f4a){_0x278fc7=_0x278fc7-0x0;var _0x115624=_0x4c60[_0x278fc7];return _0x115624;};'use strict';var Sequelize=require(_0x04c6('0x0'));module[_0x04c6('0x1')]={'state':{'type':Sequelize[_0x04c6('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x04c6('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x04c6('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x04c6('0x3')]},'membername':{'type':Sequelize[_0x04c6('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index b227e2a..b5c271d 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.model.js +++ b/server/api/reportAgentPreview/reportAgentPreview.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0397=['define','ReportAgentPreview','util','../../config/logger','bluebird','rimraf','./reportAgentPreview.attributes','exports'];(function(_0x5991d7,_0x3ca7f8){var _0x5b299d=function(_0x358ddf){while(--_0x358ddf){_0x5991d7['push'](_0x5991d7['shift']());}};_0x5b299d(++_0x3ca7f8);}(_0x0397,0x172));var _0x7039=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x0397[_0x368e09];return _0x14b7df;};'use strict';var _=require('lodash');var util=require(_0x7039('0x0'));var logger=require(_0x7039('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7039('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7039('0x3'));var config=require('../../config/environment');var attributes=require(_0x7039('0x4'));module[_0x7039('0x5')]=function(_0x8c9373,_0x3b6fbe){return _0x8c9373[_0x7039('0x6')](_0x7039('0x7'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7de=['./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x46378d,_0x7ec891){var _0x464c58=function(_0xae6691){while(--_0xae6691){_0x46378d['push'](_0x46378d['shift']());}};_0x464c58(++_0x7ec891);}(_0xb7de,0x1d8));var _0xeb7d=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xb7de[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var logger=require(_0xeb7d('0x2'))(_0xeb7d('0x3'));var moment=require(_0xeb7d('0x4'));var BPromise=require('bluebird');var rp=require(_0xeb7d('0x5'));var fs=require('fs');var path=require(_0xeb7d('0x6'));var rimraf=require(_0xeb7d('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb7d('0x8'));module[_0xeb7d('0x9')]=function(_0x4847ea,_0x429914){return _0x4847ea['define'](_0xeb7d('0xa'),attributes,{'tableName':_0xeb7d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 71a3297..7e5c03e 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js +++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8ff=['then','info','ReportAgentPreview,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','CreateReportAgentPreview','create','body','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xa8ff,0x6f));var _0xfa8f=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xa8ff[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0xfa8f('0x0'));var util=require('util');var moment=require(_0xfa8f('0x1'));var BPromise=require(_0xfa8f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa8f('0x3'));var db=require(_0xfa8f('0x4'))['db'];var utils=require(_0xfa8f('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfa8f('0x6'));var client=jayson[_0xfa8f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3092ff,_0x2e5599,_0x3ec116){return new BPromise(function(_0x2ab892,_0x335b7b){return client[_0xfa8f('0x8')](_0x3092ff,_0x3ec116)[_0xfa8f('0x9')](function(_0x100e2a){logger[_0xfa8f('0xa')](_0xfa8f('0xb'),_0x2e5599,'request\x20sent');logger[_0xfa8f('0xc')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x2e5599,'request\x20sent',JSON[_0xfa8f('0xd')](_0x100e2a));if(_0x100e2a[_0xfa8f('0xe')]){if(_0x100e2a[_0xfa8f('0xe')][_0xfa8f('0xf')]===0x1f4){logger[_0xfa8f('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x2e5599,_0x100e2a[_0xfa8f('0xe')]['message']);return _0x335b7b(_0x100e2a['error'][_0xfa8f('0x10')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x2e5599,_0x100e2a[_0xfa8f('0xe')]['message']);return _0x2ab892(_0x100e2a['error']['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x2e5599,_0xfa8f('0x11'));_0x2ab892(_0x100e2a['result'][_0xfa8f('0x10')]);}})[_0xfa8f('0x12')](function(_0x1a4271){logger[_0xfa8f('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x2e5599,_0x1a4271);_0x335b7b(_0x1a4271);});});}exports[_0xfa8f('0x13')]=function(_0x4a5134){var _0x6c7b7b=this;return new Promise(function(_0xb626d0,_0x2d3755){return db['ReportAgentPreview'][_0xfa8f('0x14')](_0x4a5134[_0xfa8f('0x15')],{'raw':_0x4a5134[_0xfa8f('0x16')]?_0x4a5134['options'][_0xfa8f('0x17')]===undefined?!![]:![]:!![]})[_0xfa8f('0x9')](function(_0x42181c){logger['info'](_0xfa8f('0x13'),_0x4a5134);logger[_0xfa8f('0xc')]('CreateReportAgentPreview',_0x4a5134,JSON[_0xfa8f('0xd')](_0x42181c));_0xb626d0(_0x42181c);})[_0xfa8f('0x12')](function(_0xcbdc77){logger[_0xfa8f('0xe')](_0xfa8f('0x13'),_0xcbdc77[_0xfa8f('0x10')],_0x4a5134);_0x2d3755(_0x6c7b7b[_0xfa8f('0xe')](0x1f4,_0xcbdc77[_0xfa8f('0x10')]));});});}; \ No newline at end of file +var _0x66c7=['body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create'];(function(_0x3cf4e9,_0x4b7e91){var _0x1c6f5b=function(_0x2c8863){while(--_0x2c8863){_0x3cf4e9['push'](_0x3cf4e9['shift']());}};_0x1c6f5b(++_0x4b7e91);}(_0x66c7,0x1b4));var _0x766c=function(_0x5b0485,_0x1b273d){_0x5b0485=_0x5b0485-0x0;var _0x46fcdb=_0x66c7[_0x5b0485];return _0x46fcdb;};'use strict';var _=require(_0x766c('0x0'));var util=require(_0x766c('0x1'));var moment=require(_0x766c('0x2'));var BPromise=require(_0x766c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x766c('0x4'));var db=require(_0x766c('0x5'))['db'];var utils=require(_0x766c('0x6'));var logger=require('../../config/logger')(_0x766c('0x7'));var config=require(_0x766c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x766c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x570881,_0x535e60,_0x428cae){return new BPromise(function(_0x583c84,_0x22133a){return client[_0x766c('0xa')](_0x570881,_0x428cae)[_0x766c('0xb')](function(_0x5db4a6){logger['info'](_0x766c('0xc'),_0x535e60,_0x766c('0xd'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x535e60,_0x766c('0xd'),JSON[_0x766c('0xe')](_0x5db4a6));if(_0x5db4a6[_0x766c('0xf')]){if(_0x5db4a6[_0x766c('0xf')][_0x766c('0x10')]===0x1f4){logger[_0x766c('0xf')](_0x766c('0xc'),_0x535e60,_0x5db4a6[_0x766c('0xf')][_0x766c('0x11')]);return _0x22133a(_0x5db4a6['error'][_0x766c('0x11')]);}logger[_0x766c('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x535e60,_0x5db4a6['error'][_0x766c('0x11')]);return _0x583c84(_0x5db4a6[_0x766c('0xf')]['message']);}else{logger[_0x766c('0x12')](_0x766c('0xc'),_0x535e60,_0x766c('0xd'));_0x583c84(_0x5db4a6[_0x766c('0x13')][_0x766c('0x11')]);}})['catch'](function(_0x2ee3a8){logger['error'](_0x766c('0xc'),_0x535e60,_0x2ee3a8);_0x22133a(_0x2ee3a8);});});}exports[_0x766c('0x14')]=function(_0x293c60){var _0x8a714c=this;return new Promise(function(_0x4fc1b3,_0x428513){return db[_0x766c('0x15')][_0x766c('0x16')](_0x293c60[_0x766c('0x17')],{'raw':_0x293c60[_0x766c('0x18')]?_0x293c60[_0x766c('0x18')][_0x766c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x51c5dc){logger[_0x766c('0x12')](_0x766c('0x14'),_0x293c60);logger['debug'](_0x766c('0x14'),_0x293c60,JSON[_0x766c('0xe')](_0x51c5dc));_0x4fc1b3(_0x51c5dc);})[_0x766c('0x1a')](function(_0x271a08){logger[_0x766c('0xf')](_0x766c('0x14'),_0x271a08[_0x766c('0x11')],_0x293c60);_0x428513(_0x8a714c[_0x766c('0xf')](0x1f4,_0x271a08[_0x766c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index ceea39d..c070fe6 100644 --- a/server/api/rpc/index.js +++ b/server/api/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafc1=['openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify'];(function(_0xae98c,_0x45de17){var _0x2cb54f=function(_0x1ed9fa){while(--_0x1ed9fa){_0xae98c['push'](_0xae98c['shift']());}};_0x2cb54f(++_0x45de17);}(_0xafc1,0xae));var _0x1afc=function(_0x204aa9,_0x4f2aa8){_0x204aa9=_0x204aa9-0x0;var _0x32ecb3=_0xafc1[_0x204aa9];return _0x32ecb3;};'use strict';var multer=require(_0x1afc('0x0'));var util=require('util');var path=require(_0x1afc('0x1'));var express=require(_0x1afc('0x2'));var router=express[_0x1afc('0x3')]();var auth=require(_0x1afc('0x4'));var controller=require(_0x1afc('0x5'));router[_0x1afc('0x6')](_0x1afc('0x7'),auth[_0x1afc('0x8')](),controller['voiceChannels']);router[_0x1afc('0x6')](_0x1afc('0x9'),auth[_0x1afc('0x8')](),controller[_0x1afc('0xa')]);router[_0x1afc('0x6')](_0x1afc('0xb'),auth[_0x1afc('0x8')](),controller[_0x1afc('0xc')]);router[_0x1afc('0x6')](_0x1afc('0xd'),auth[_0x1afc('0x8')](),controller[_0x1afc('0xe')]);router[_0x1afc('0x6')](_0x1afc('0xf'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x10')]);router[_0x1afc('0x6')]('/mail/queues',auth[_0x1afc('0x8')](),controller[_0x1afc('0x11')]);router[_0x1afc('0x6')]('/mail/accounts',auth[_0x1afc('0x8')](),controller[_0x1afc('0x12')]);router[_0x1afc('0x6')](_0x1afc('0x13'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x14')]);router[_0x1afc('0x6')](_0x1afc('0x15'),auth[_0x1afc('0x8')](),controller['smsQueues']);router[_0x1afc('0x6')](_0x1afc('0x16'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x17')]);router['get'](_0x1afc('0x18'),auth[_0x1afc('0x8')](),controller['faxQueues']);router[_0x1afc('0x6')](_0x1afc('0x19'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x1a')]);router['get'](_0x1afc('0x1b'),auth[_0x1afc('0x8')](),controller['voiceQueuesChannels']);router[_0x1afc('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x1afc('0x8')](),controller[_0x1afc('0x1c')]);router[_0x1afc('0x6')](_0x1afc('0x1d'),auth['isAuthenticated'](),controller[_0x1afc('0x1e')]);router[_0x1afc('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x1afc('0x8')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x1afc('0x1f'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x20')]);router[_0x1afc('0x21')](_0x1afc('0x1f'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x22')]);router[_0x1afc('0x6')]('/outbound',auth[_0x1afc('0x8')](),controller[_0x1afc('0x23')]);router['get'](_0x1afc('0x24'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x25')]);router[_0x1afc('0x6')](_0x1afc('0x26'),auth['isAuthenticated'](),controller['agents']);router[_0x1afc('0x21')]('/agents/:id/capacity',auth[_0x1afc('0x8')](),controller['agentCapacity']);router[_0x1afc('0x6')](_0x1afc('0x27'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x28')]);router[_0x1afc('0x6')](_0x1afc('0x29'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x2a')]);router['get'](_0x1afc('0x2b'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x2c')]);router[_0x1afc('0x6')](_0x1afc('0x2d'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x2e')]);router[_0x1afc('0x6')](_0x1afc('0x2f'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x30')]);router[_0x1afc('0x6')](_0x1afc('0x31'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x32')]);router[_0x1afc('0x6')](_0x1afc('0x33'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x34')]);router[_0x1afc('0x6')](_0x1afc('0x35'),auth[_0x1afc('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x1afc('0x6')](_0x1afc('0x36'),auth[_0x1afc('0x8')](),controller['smsQueuesWaitingInteractions']);router[_0x1afc('0x6')](_0x1afc('0x37'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x38')]);router[_0x1afc('0x6')](_0x1afc('0x39'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x3a')]);router[_0x1afc('0x3b')](_0x1afc('0x3c'),auth[_0x1afc('0x8')](),controller['queueNotify'](_0x1afc('0x3d')));router['get'](_0x1afc('0x3e'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x3f')]);router[_0x1afc('0x3b')](_0x1afc('0x40'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x41')]('chat'));router[_0x1afc('0x6')](_0x1afc('0x42'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x1afc('0x3b')](_0x1afc('0x43'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x41')](_0x1afc('0x44')));router[_0x1afc('0x6')](_0x1afc('0x45'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x46')]);router[_0x1afc('0x3b')](_0x1afc('0x47'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x41')](_0x1afc('0x48')));router[_0x1afc('0x6')](_0x1afc('0x49'),auth['isAuthenticated'](),controller[_0x1afc('0x4a')]);router[_0x1afc('0x3b')](_0x1afc('0x4b'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x41')]('sms'));router['post'](_0x1afc('0x4c'),auth['isAuthenticated'](),controller[_0x1afc('0x41')]('whatsapp'));router[_0x1afc('0x6')](_0x1afc('0x4d'),auth[_0x1afc('0x8')](),controller[_0x1afc('0x4e')]);router[_0x1afc('0x6')]('/whatsapp/queues/:id',auth[_0x1afc('0x8')](),controller[_0x1afc('0x4f')]);router[_0x1afc('0x3b')](_0x1afc('0x50'),auth[_0x1afc('0x8')](),controller['agentNotify']);module[_0x1afc('0x51')]=router; \ No newline at end of file +var _0x4850=['voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','put','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','showMailQueues','queueNotify','chat','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','path','express','Router','../../components/auth/service','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup'];(function(_0x589710,_0x14a1c5){var _0x20ff0b=function(_0x5041c7){while(--_0x5041c7){_0x589710['push'](_0x589710['shift']());}};_0x20ff0b(++_0x14a1c5);}(_0x4850,0xd3));var _0x0485=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4850[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x0485('0x0'));var util=require('util');var path=require(_0x0485('0x1'));var express=require(_0x0485('0x2'));var router=express[_0x0485('0x3')]();var auth=require(_0x0485('0x4'));var controller=require('./rpc.controller');router['get'](_0x0485('0x5'),auth[_0x0485('0x6')](),controller['voiceChannels']);router['get'](_0x0485('0x7'),auth[_0x0485('0x6')](),controller[_0x0485('0x8')]);router[_0x0485('0x9')](_0x0485('0xa'),auth['isAuthenticated'](),controller[_0x0485('0xb')]);router[_0x0485('0x9')](_0x0485('0xc'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x0485('0x9')](_0x0485('0xd'),auth['isAuthenticated'](),controller['chatQueues']);router['get'](_0x0485('0xe'),auth[_0x0485('0x6')](),controller[_0x0485('0xf')]);router[_0x0485('0x9')](_0x0485('0x10'),auth[_0x0485('0x6')](),controller[_0x0485('0x11')]);router['get'](_0x0485('0x12'),auth[_0x0485('0x6')](),controller[_0x0485('0x13')]);router['get'](_0x0485('0x14'),auth[_0x0485('0x6')](),controller[_0x0485('0x15')]);router[_0x0485('0x9')](_0x0485('0x16'),auth['isAuthenticated'](),controller[_0x0485('0x17')]);router[_0x0485('0x9')]('/fax/queues',auth[_0x0485('0x6')](),controller[_0x0485('0x18')]);router[_0x0485('0x9')](_0x0485('0x19'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router['get'](_0x0485('0x1a'),auth[_0x0485('0x6')](),controller['voiceQueuesChannels']);router[_0x0485('0x9')](_0x0485('0x1b'),auth[_0x0485('0x6')](),controller['voiceQueuesChannel']);router[_0x0485('0x9')](_0x0485('0x1c'),auth[_0x0485('0x6')](),controller[_0x0485('0x1d')]);router[_0x0485('0x9')](_0x0485('0x1e'),auth[_0x0485('0x6')](),controller[_0x0485('0x1f')]);router[_0x0485('0x9')](_0x0485('0x20'),auth['isAuthenticated'](),controller[_0x0485('0x21')]);router['put'](_0x0485('0x20'),auth[_0x0485('0x6')](),controller[_0x0485('0x22')]);router[_0x0485('0x9')](_0x0485('0x23'),auth[_0x0485('0x6')](),controller[_0x0485('0x24')]);router[_0x0485('0x9')]('/outbound/channels',auth['isAuthenticated'](),controller[_0x0485('0x25')]);router['get'](_0x0485('0x26'),auth[_0x0485('0x6')](),controller[_0x0485('0x27')]);router[_0x0485('0x28')]('/agents/:id/capacity',auth[_0x0485('0x6')](),controller[_0x0485('0x29')]);router[_0x0485('0x9')](_0x0485('0x2a'),auth[_0x0485('0x6')](),controller[_0x0485('0x2b')]);router[_0x0485('0x9')](_0x0485('0x2c'),auth['isAuthenticated'](),controller[_0x0485('0x2d')]);router[_0x0485('0x9')](_0x0485('0x2e'),auth[_0x0485('0x6')](),controller[_0x0485('0x2f')]);router[_0x0485('0x9')](_0x0485('0x30'),auth[_0x0485('0x6')](),controller['faxAccounts']);router[_0x0485('0x9')](_0x0485('0x31'),auth[_0x0485('0x6')](),controller[_0x0485('0x32')]);router[_0x0485('0x9')](_0x0485('0x33'),auth[_0x0485('0x6')](),controller[_0x0485('0x34')]);router['get'](_0x0485('0x35'),auth[_0x0485('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x0485('0x9')](_0x0485('0x36'),auth[_0x0485('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x0485('0x9')](_0x0485('0x37'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x0485('0x9')](_0x0485('0x38'),auth['isAuthenticated'](),controller[_0x0485('0x39')]);router[_0x0485('0x9')](_0x0485('0x3a'),auth[_0x0485('0x6')](),controller[_0x0485('0x3b')]);router[_0x0485('0x3c')](_0x0485('0x3d'),auth['isAuthenticated'](),controller['queueNotify'](_0x0485('0x3e')));router[_0x0485('0x9')]('/mail/queues/:id',auth[_0x0485('0x6')](),controller[_0x0485('0x3f')]);router['post']('/chat/queues/:id/notify',auth[_0x0485('0x6')](),controller[_0x0485('0x40')](_0x0485('0x41')));router['get']('/chat/queues/:id',auth[_0x0485('0x6')](),controller[_0x0485('0x42')]);router[_0x0485('0x3c')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x0485('0x40')](_0x0485('0x43')));router[_0x0485('0x9')](_0x0485('0x44'),auth[_0x0485('0x6')](),controller[_0x0485('0x45')]);router['post'](_0x0485('0x46'),auth[_0x0485('0x6')](),controller[_0x0485('0x40')]('openchannel'));router[_0x0485('0x9')](_0x0485('0x47'),auth[_0x0485('0x6')](),controller[_0x0485('0x48')]);router['post']('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x0485('0x40')]('sms'));router[_0x0485('0x3c')](_0x0485('0x49'),auth[_0x0485('0x6')](),controller[_0x0485('0x40')](_0x0485('0x4a')));router[_0x0485('0x9')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x0485('0x4b')]);router[_0x0485('0x9')](_0x0485('0x4c'),auth['isAuthenticated'](),controller[_0x0485('0x4d')]);router[_0x0485('0x3c')]('/agents/:id/notify',auth[_0x0485('0x6')](),controller[_0x0485('0x4e')]);module[_0x0485('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 45ca51c..e382deb 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eb2=['map','value','indexOf','filter','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','update','queue','MessageId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','channel','InteractionId','Start','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','message','result','status','json','stack','name','isNil','find','rows','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','format','SIP/%s','interface','agent','internal','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type'];(function(_0x4c1eeb,_0x4f12e6){var _0x43c66c=function(_0x3b2416){while(--_0x3b2416){_0x4c1eeb['push'](_0x4c1eeb['shift']());}};_0x43c66c(++_0x4f12e6);}(_0x2eb2,0x19f));var _0x22eb=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x2eb2[_0x521929];return _0x632436;};'use strict';var BPromise=require('bluebird');var moment=require(_0x22eb('0x0'));var _=require(_0x22eb('0x1'));var util=require(_0x22eb('0x2'));var db=require(_0x22eb('0x3'))['db'];var logger=require(_0x22eb('0x4'))(_0x22eb('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x22eb('0x6')]['http']({'port':0x232a});var mailClient=jayson['client'][_0x22eb('0x7')]({'port':0x232b});var routingClient=jayson[_0x22eb('0x6')][_0x22eb('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){var _0x419601=_0x396806?_0x396806:amiClient;return _0x419601[_0x22eb('0x8')](_0x2a9850,_0x4539d0)[_0x22eb('0x9')](function(_0x3008e0){if(_0x3008e0['error']){if(_0x3008e0[_0x22eb('0xa')]['code']===0x1f4){return _0x3375d6(_0x3008e0['error'][_0x22eb('0xb')]);}return _0x33ddef(_0x3008e0['error'][_0x22eb('0xb')]);}else{_0x33ddef(_0x3008e0[_0x22eb('0xc')]);}})['catch'](function(_0x5068ea){_0x3375d6(_0x5068ea);});});}function respondWithResult(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xc8;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0xd')](_0x189f05)[_0x22eb('0xe')](_0x128d43);}return _0x1f286c['sendStatus'](0x194);};}function handleError(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0x1f4;return function(_0x1f5089){logger['error'](_0x1f5089[_0x22eb('0xf')]);if(_0x1f5089[_0x22eb('0x10')]){delete _0x1f5089['name'];}_0x350ade['status'](_0x53f14e)['send'](_0x1f5089);};}function findById(_0x2ed8a7){return function(_0x5245fe){if(!_['isNil'](_0x2ed8a7)&&!_[_0x22eb('0x11')](_0x5245fe)&&!_['isNil'](_0x5245fe['rows'])){return _[_0x22eb('0x12')](_0x5245fe[_0x22eb('0x13')],function(_0x385bcb){return _0x385bcb['id']==_0x2ed8a7;});}return null;};}exports[_0x22eb('0x14')]=function(_0x3b0940,_0x4bc0a2){return respondWithRpcPromise(_0x22eb('0x15'),_0x3b0940[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4bc0a2,null))[_0x22eb('0x17')](handleError(_0x4bc0a2,null));};exports[_0x22eb('0x18')]=function(_0x517313,_0x2eb115){return respondWithRpcPromise(_0x22eb('0x19'),_[_0x22eb('0x1a')](_0x517313['query'],_0x517313['params']))[_0x22eb('0x9')](respondWithResult(_0x2eb115,null))[_0x22eb('0x17')](handleError(_0x2eb115,null));};exports[_0x22eb('0x1b')]=function(_0x44639a,_0x2d95f0){return respondWithRpcPromise(_0x22eb('0x1c'),_[_0x22eb('0x1a')](_0x44639a['query'],_0x44639a[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x2d95f0,null))[_0x22eb('0x17')](handleError(_0x2d95f0,null));};exports[_0x22eb('0x1e')]=function(_0x420d4f,_0x4da252){return respondWithRpcPromise(_0x22eb('0x1f'),_0x420d4f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4da252,null))['catch'](handleError(_0x4da252,null));};exports[_0x22eb('0x20')]=function(_0x259847,_0x4b409a){return respondWithRpcPromise(_0x22eb('0x1f'),_0x259847[_0x22eb('0x16')])[_0x22eb('0x9')](findById(_0x259847[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x4b409a,null))['catch'](handleError(_0x4b409a,null));};exports['updateVoiceQueue']=function(_0x2a950e,_0x25e5bc){return respondWithRpcPromise(_0x22eb('0x21'),_[_0x22eb('0x1a')](_0x2a950e[_0x22eb('0x22')],_0x2a950e[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x25e5bc,null))[_0x22eb('0x17')](handleError(_0x25e5bc,null));};exports[_0x22eb('0x23')]=function(_0x39cec1,_0x24e9dc){return respondWithRpcPromise(_0x22eb('0x24'),_['merge'](_0x39cec1[_0x22eb('0x16')],_0x39cec1['params']))[_0x22eb('0x9')](respondWithResult(_0x24e9dc,null))[_0x22eb('0x17')](handleError(_0x24e9dc,null));};exports[_0x22eb('0x25')]=function(_0x11199f,_0x351ed8){return respondWithRpcPromise(_0x22eb('0x26'),_0x11199f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x351ed8,null))[_0x22eb('0x17')](handleError(_0x351ed8,null));};exports[_0x22eb('0x27')]=function(_0x509bb7,_0x49259f){return respondWithRpcPromise(_0x22eb('0x28'),_['merge'](_0x509bb7['query'],_0x509bb7[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x49259f,null))[_0x22eb('0x17')](handleError(_0x49259f,null));};exports[_0x22eb('0x29')]=function(_0x45c53e,_0x332e9a){return respondWithRpcPromise(_0x22eb('0x2a'),_[_0x22eb('0x1a')](_0x45c53e[_0x22eb('0x16')],_0x45c53e[_0x22eb('0x1d')]))['then'](respondWithResult(_0x332e9a,null))[_0x22eb('0x17')](handleError(_0x332e9a,null));};exports['voiceQueuesChannelRedirect']=function(_0x5c43e7,_0x35a264){return respondWithRpcPromise(_0x22eb('0x2b'),_['merge'](_0x5c43e7[_0x22eb('0x16')],_0x5c43e7[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x35a264,null))[_0x22eb('0x17')](handleError(_0x35a264,null));};exports[_0x22eb('0x2c')]=function(_0x574555,_0x25f140){return respondWithRpcPromise(_0x22eb('0x2d'),_0x574555['query'])[_0x22eb('0x9')](respondWithResult(_0x25f140,null))[_0x22eb('0x17')](handleError(_0x25f140,null));};exports[_0x22eb('0x2e')]=function(_0x2cc77c,_0x9353f1){return respondWithRpcPromise('OutboundChannels',_0x2cc77c['query'])[_0x22eb('0x9')](respondWithResult(_0x9353f1,null))[_0x22eb('0x17')](handleError(_0x9353f1,null));};exports['agents']=function(_0x595d76,_0x2e2a0c){var _0x46c6a1;return respondWithRpcPromise('Agents',_0x595d76[_0x22eb('0x16')])[_0x22eb('0x9')](function(_0x382163){_0x46c6a1=_0x382163;return respondWithRpcPromise(_0x22eb('0x2f'),_0x595d76[_0x22eb('0x16')],routingClient);})[_0x22eb('0x9')](function(_0x513b65){return _[_0x22eb('0x1a')]({},_0x513b65,_0x46c6a1);})[_0x22eb('0x9')](respondWithResult(_0x2e2a0c,null))['catch'](handleError(_0x2e2a0c,null));};exports[_0x22eb('0x30')]=function(_0x44d39f,_0x204092){if(_0x44d39f[_0x22eb('0x22')]&&_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')]&&_0x44d39f[_0x22eb('0x32')]&&_0x44d39f[_0x22eb('0x32')][_0x22eb('0x10')]){for(var _0x82ace8 in _0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')]){if(_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x22eb('0x33')](_0x82ace8)){db[_0x22eb('0x34')][_0x22eb('0x35')]({'where':{'channel':_0x82ace8,'membername':_0x44d39f[_0x22eb('0x32')]['name'],'type':_0x22eb('0x36'),'exitAt':null,'uniqueid':_0x44d39f[_0x22eb('0x22')]['interaction'][_0x82ace8]&&_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8]['length']?{'$notIn':_0x44d39f['body']['interaction'][_0x82ace8]}:{'$ne':null}}})[_0x22eb('0x9')](function(_0x1efc65){var _0x4e4c6d=moment()['format'](_0x22eb('0x37'));for(var _0x43f771=0x0,_0x326b24=_0x1efc65[_0x22eb('0x38')];_0x43f771<_0x326b24;_0x43f771+=0x1){_0x1efc65[_0x43f771][_0x22eb('0x39')]({'exitAt':_0x4e4c6d});}});for(var _0x3b30a3=0x0;_0x3b30a3<_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8]['length'];_0x3b30a3+=0x1){db['MemberReport'][_0x22eb('0x3a')]({'where':{'channel':_0x82ace8,'membername':_0x44d39f['user'][_0x22eb('0x10')],'type':'INTERACTION','uniqueid':_0x44d39f[_0x22eb('0x22')]['interaction'][_0x82ace8][_0x3b30a3],'exitAt':null},'defaults':{'channel':_0x82ace8,'membername':_0x44d39f['user']['name'],'interface':_['isNil'](_0x44d39f[_0x22eb('0x32')]['interface'])?util[_0x22eb('0x3b')](_0x22eb('0x3c'),_0x44d39f['user'][_0x22eb('0x10')]):_0x44d39f['user'][_0x22eb('0x3d')],'type':_0x22eb('0x36'),'enterAt':moment()[_0x22eb('0x3b')](_0x22eb('0x37')),'role':_0x22eb('0x3e'),'internal':_0x44d39f[_0x22eb('0x32')][_0x22eb('0x3f')],'uniqueid':_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8][_0x3b30a3]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x44d39f[_0x22eb('0x1d')]['id'],'capacity':_0x44d39f[_0x22eb('0x22')]['capacity']},routingClient)[_0x22eb('0x9')](respondWithResult(_0x204092,null))[_0x22eb('0x17')](handleError(_0x204092,null));};exports[_0x22eb('0x40')]=function(_0x31216f,_0x4fee5c){return respondWithRpcPromise(_0x22eb('0x41'),_0x31216f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4fee5c,null))[_0x22eb('0x17')](handleError(_0x4fee5c,null));};exports[_0x22eb('0x42')]=function(_0x10393b,_0x5effca){return respondWithRpcPromise(_0x22eb('0x43'),_0x10393b['query'])[_0x22eb('0x9')](respondWithResult(_0x5effca,null))['catch'](handleError(_0x5effca,null));};exports[_0x22eb('0x44')]=function(_0x254b53,_0x4028ef){return respondWithRpcPromise(_0x22eb('0x45'),_0x254b53[_0x22eb('0x16')])['then'](respondWithResult(_0x4028ef,null))['catch'](handleError(_0x4028ef,null));};exports[_0x22eb('0x46')]=function(_0x8e3864,_0x490110){return respondWithRpcPromise(_0x22eb('0x47'),_0x8e3864[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x490110,null))[_0x22eb('0x17')](handleError(_0x490110,null));};exports[_0x22eb('0x48')]=function(_0x27756b,_0x3a8588){return respondWithRpcPromise(_0x22eb('0x47'),_0x27756b[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x27756b[_0x22eb('0x1d')]['id']))['then'](respondWithResult(_0x3a8588,null))[_0x22eb('0x17')](handleError(_0x3a8588,null));};exports[_0x22eb('0x49')]=function(_0x3764d4,_0x2562a1){return respondWithRpcPromise(_0x22eb('0x4a'),_0x3764d4[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x2562a1,null))[_0x22eb('0x17')](handleError(_0x2562a1,null));};exports[_0x22eb('0x4b')]=function(_0x9f8465,_0x3e9ab5){return respondWithRpcPromise(_0x22eb('0x4a'),_0x9f8465[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x9f8465['params']['id']))['then'](respondWithResult(_0x3e9ab5,null))[_0x22eb('0x17')](handleError(_0x3e9ab5,null));};exports[_0x22eb('0x4c')]=function(_0x165e79,_0x38c02f){return respondWithRpcPromise(_0x22eb('0x4d'),_0x165e79['query'],mailClient)[_0x22eb('0x9')](respondWithResult(_0x38c02f,null))[_0x22eb('0x17')](handleError(_0x38c02f,null));};exports['openchannelQueues']=function(_0x485408,_0x341a1c){return respondWithRpcPromise(_0x22eb('0x4e'),_0x485408[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x341a1c,null))[_0x22eb('0x17')](handleError(_0x341a1c,null));};exports[_0x22eb('0x4f')]=function(_0x16099e,_0x22104f){return respondWithRpcPromise(_0x22eb('0x4e'),_0x16099e[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x16099e[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x22104f,null))[_0x22eb('0x17')](handleError(_0x22104f,null));};exports['smsQueues']=function(_0x29dd8b,_0x46ba3b){return respondWithRpcPromise(_0x22eb('0x50'),_0x29dd8b['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x46ba3b,null))['catch'](handleError(_0x46ba3b,null));};exports[_0x22eb('0x51')]=function(_0x5347b4,_0x1919d0){return respondWithRpcPromise(_0x22eb('0x50'),_0x5347b4['query'],routingClient)[_0x22eb('0x9')](findById(_0x5347b4[_0x22eb('0x1d')]['id']))['then'](respondWithResult(_0x1919d0,null))['catch'](handleError(_0x1919d0,null));};exports[_0x22eb('0x52')]=function(_0x3073b1,_0x1984f0){return respondWithRpcPromise(_0x22eb('0x53'),_0x3073b1[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1984f0,null))['catch'](handleError(_0x1984f0,null));};exports[_0x22eb('0x54')]=function(_0x5d035b,_0x5f4ea3){return respondWithRpcPromise(_0x22eb('0x53'),_0x5d035b[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x5d035b[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x5f4ea3,null))[_0x22eb('0x17')](handleError(_0x5f4ea3,null));};exports[_0x22eb('0x55')]=function(_0x109f7f,_0x50d914){return respondWithRpcPromise('FaxQueues',_0x109f7f[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x50d914,null))['catch'](handleError(_0x50d914,null));};exports[_0x22eb('0x56')]=function(_0x3f7405,_0x25f1b2){return respondWithRpcPromise(_0x22eb('0x57'),_0x3f7405[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x3f7405['params']['id']))[_0x22eb('0x9')](respondWithResult(_0x25f1b2,null))[_0x22eb('0x17')](handleError(_0x25f1b2,null));};exports[_0x22eb('0x58')]=function(_0x5e46b0,_0x4fcc2c){return respondWithRpcPromise(_0x22eb('0x59'),_0x5e46b0[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4fcc2c,null))['catch'](handleError(_0x4fcc2c,null));};exports[_0x22eb('0x5a')]=function(_0x4b6cf3,_0x1a305d){return respondWithRpcPromise(_0x22eb('0x5b'),_0x4b6cf3[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1a305d,null))['catch'](handleError(_0x1a305d,null));};exports[_0x22eb('0x5c')]=function(_0x2e35b0,_0x304492){return respondWithRpcPromise(_0x22eb('0x5d'),_0x2e35b0[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x304492,null))[_0x22eb('0x17')](handleError(_0x304492,null));};exports[_0x22eb('0x5e')]=function(_0x47865e,_0x1c5b0b){return respondWithRpcPromise(_0x22eb('0x5f'),_0x47865e['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1c5b0b,null))[_0x22eb('0x17')](handleError(_0x1c5b0b,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5cc383,_0x51d9f4){return respondWithRpcPromise(_0x22eb('0x5f'),_0x5cc383[_0x22eb('0x16')],routingClient)['then'](function(_0x10726f){if(_0x5cc383[_0x22eb('0x16')][_0x22eb('0x60')]!==undefined){var _0x41c50e=_(_0x10726f[_0x22eb('0x13')])['filter']([_0x5cc383['query'][_0x22eb('0x60')],_0x5cc383[_0x22eb('0x1d')]['id']])[_0x22eb('0x61')]('queue_id')['uniq']()[_0x22eb('0x62')]();return _0x10726f['rows']['filter'](function(_0x3568bc){return _0x41c50e[_0x22eb('0x63')](_0x3568bc['queue_id'])>-0x1;});}else{return _0x10726f['rows'][_0x22eb('0x64')](function(_0x2dd41a){return _0x2dd41a['queue_id']===parseInt(_0x5cc383[_0x22eb('0x1d')]['id']);});}})[_0x22eb('0x9')](respondWithResult(_0x51d9f4,null))[_0x22eb('0x17')](handleError(_0x51d9f4,null));};exports['smsQueuesWaitingInteractions']=function(_0x464f4f,_0x26fb52){return respondWithRpcPromise(_0x22eb('0x65'),_0x464f4f[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x26fb52,null))['catch'](handleError(_0x26fb52,null));};exports[_0x22eb('0x66')]=function(_0x2ecc24,_0x3f429b){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2ecc24['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x3f429b,null))[_0x22eb('0x17')](handleError(_0x3f429b,null));};exports[_0x22eb('0x67')]=function(_0x557c03,_0x215472){return respondWithRpcPromise(_0x22eb('0x68'),_0x557c03[_0x22eb('0x16')],routingClient)['then'](respondWithResult(_0x215472,null))[_0x22eb('0x17')](handleError(_0x215472,null));};exports['queueNotify']=function(_0x532a59){return function(_0x222616,_0x1e541f){var _0x1057f2,_0x49f362;var _0x3fc402=_[_0x22eb('0x69')](_0x532a59);var _0x2d422b=_0x532a59===_0x22eb('0x6a')?_0x22eb('0x6b'):'Account';return db[_0x3fc402+_0x22eb('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x222616[_0x22eb('0x1d')]['id']}})[_0x22eb('0x9')](function(_0x37d7c6){if(_['isNil'](_0x37d7c6)){throw new Error(_0x3fc402+_0x22eb('0x6d'));}_0x1057f2=_0x37d7c6;return db[_0x3fc402+_0x22eb('0x6e')][_0x22eb('0x6f')]({'where':{'id':_0x222616[_0x22eb('0x22')][_0x22eb('0x70')]},'include':[{'model':db[_0x3fc402+_0x22eb('0x71')],'as':_0x22eb('0x71')},{'model':db[_0x3fc402+_0x2d422b],'as':_0x22eb('0x72')}]});})[_0x22eb('0x9')](function(_0x42d6fa){if(_[_0x22eb('0x11')](_0x42d6fa)){throw new Error(_0x3fc402+'\x20Message\x20not\x20found');}_0x49f362=_0x42d6fa;return _0x42d6fa[_0x22eb('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x22eb('0x9')](function(){var _0x40999d={'uniqueid':_0x532a59+'.'+_0x49f362['id']+'.'+_0x49f362[_0x22eb('0x71')]['id'],'FromUserId':_0x222616['user']['id'],'type':_0x22eb('0x74')};_0x40999d[_0x3fc402+_0x22eb('0x75')]=_0x49f362['id'];_0x40999d[_0x3fc402+'InteractionId']=_0x49f362[_0x22eb('0x71')]['id'];_0x40999d[_0x22eb('0x76')+_0x3fc402+_0x2d422b+'Id']=_0x49f362[_0x22eb('0x72')]['id'];_0x40999d['To'+_0x3fc402+_0x22eb('0x77')]=_0x1057f2['id'];return db[_0x3fc402+_0x22eb('0x78')][_0x22eb('0x79')](_0x40999d);})[_0x22eb('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x532a59,'interaction':_0x49f362[_0x22eb('0x71')],'message':_0x49f362,'account':_0x49f362[_0x22eb('0x72')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1057f2['name']+','+(_0x49f362[_0x22eb('0x72')][_0x22eb('0x7a')]||0x12c),'interval':_0x22eb('0x7b')}]},routingClient);})[_0x22eb('0x9')](respondWithResult(_0x1e541f,null))[_0x22eb('0x17')](handleError(_0x1e541f,null));};};exports['agentNotify']=function(_0x4e6fa6,_0x41fa99){var _0x18abf4,_0x5cf5e5;if(_[_0x22eb('0x11')](_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x7c')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x448fea=_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x7c')];var _0x402c2c=_[_0x22eb('0x69')](_0x448fea);var _0x195f58=_0x448fea===_0x22eb('0x6a')?_0x22eb('0x6b'):'Account';return db['User']['findOne']({'raw':!![],'where':{'id':_0x4e6fa6[_0x22eb('0x1d')]['id'],'role':'agent'}})['then'](function(_0x4170a5){if(_[_0x22eb('0x11')](_0x4170a5)){throw new Error('Agent\x20not\x20found');}_0x18abf4=_0x4170a5;return db[_0x402c2c+_0x22eb('0x6e')][_0x22eb('0x6f')]({'where':{'id':_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x70')]},'include':[{'model':db[_0x402c2c+'Interaction'],'as':_0x22eb('0x71')},{'model':db[_0x402c2c+_0x195f58],'as':_0x22eb('0x72')}]});})[_0x22eb('0x9')](function(_0x536f29){if(_['isNil'](_0x536f29)){throw new Error(_0x402c2c+'\x20Message\x20not\x20found');}_0x5cf5e5=_0x536f29;return _0x536f29[_0x22eb('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x22eb('0x9')](function(){var _0x48fa11={'uniqueid':_0x448fea+'.'+_0x5cf5e5['id']+'.'+_0x5cf5e5['Interaction']['id'],'FromUserId':_0x4e6fa6[_0x22eb('0x32')]['id'],'type':'queue','ToUserId':_0x18abf4['id']};_0x48fa11[_0x402c2c+'MessageId']=_0x5cf5e5['id'];_0x48fa11[_0x402c2c+_0x22eb('0x7d')]=_0x5cf5e5[_0x22eb('0x71')]['id'];_0x48fa11['From'+_0x402c2c+_0x195f58+'Id']=_0x5cf5e5['Account']['id'];return db[_0x402c2c+_0x22eb('0x78')][_0x22eb('0x79')](_0x48fa11);})[_0x22eb('0x9')](function(){return respondWithRpcPromise(_0x22eb('0x7e'),{'channel':_0x448fea,'interaction':_0x5cf5e5[_0x22eb('0x71')],'message':_0x5cf5e5,'account':_0x5cf5e5['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x18abf4[_0x22eb('0x10')]+','+(_0x5cf5e5[_0x22eb('0x72')][_0x22eb('0x7f')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x22eb('0x9')](respondWithResult(_0x41fa99,null))['catch'](handleError(_0x41fa99,null));}; \ No newline at end of file +var _0x5075=['api','client','http','then','error','message','result','status','json','name','send','isNil','rows','find','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','SIP/%s','interface','agent','internal','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','queue','InteractionId','From','QueueId','TransferReport','create','Start','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Agent\x20not\x20found','MessageId','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','util','../../mysqldb','../../config/logger'];(function(_0x4a9f71,_0x1db1ce){var _0x1134cd=function(_0x3e456d){while(--_0x3e456d){_0x4a9f71['push'](_0x4a9f71['shift']());}};_0x1134cd(++_0x1db1ce);}(_0x5075,0x73));var _0x5507=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0x5075[_0x5ce3c8];return _0xa76867;};'use strict';var BPromise=require(_0x5507('0x0'));var moment=require(_0x5507('0x1'));var _=require(_0x5507('0x2'));var util=require(_0x5507('0x3'));var db=require(_0x5507('0x4'))['db'];var logger=require(_0x5507('0x5'))(_0x5507('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x5507('0x7')][_0x5507('0x8')]({'port':0x232a});var mailClient=jayson[_0x5507('0x7')]['http']({'port':0x232b});var routingClient=jayson['client'][_0x5507('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x773559,_0x4c2d6d,_0x42c232){return new BPromise(function(_0x7cc84c,_0xbf4b50){var _0x504e05=_0x42c232?_0x42c232:amiClient;return _0x504e05['request'](_0x773559,_0x4c2d6d)[_0x5507('0x9')](function(_0x441bdc){if(_0x441bdc[_0x5507('0xa')]){if(_0x441bdc[_0x5507('0xa')]['code']===0x1f4){return _0xbf4b50(_0x441bdc[_0x5507('0xa')][_0x5507('0xb')]);}return _0x7cc84c(_0x441bdc['error'][_0x5507('0xb')]);}else{_0x7cc84c(_0x441bdc[_0x5507('0xc')]);}})['catch'](function(_0x37a1de){_0xbf4b50(_0x37a1de);});});}function respondWithResult(_0x2a2ea0,_0x32c872){_0x32c872=_0x32c872||0xc8;return function(_0x267f27){if(_0x267f27){return _0x2a2ea0[_0x5507('0xd')](_0x32c872)[_0x5507('0xe')](_0x267f27);}return _0x2a2ea0['sendStatus'](0x194);};}function handleError(_0x9cc3f9,_0x2b7c43){_0x2b7c43=_0x2b7c43||0x1f4;return function(_0xc828e5){logger[_0x5507('0xa')](_0xc828e5['stack']);if(_0xc828e5[_0x5507('0xf')]){delete _0xc828e5[_0x5507('0xf')];}_0x9cc3f9[_0x5507('0xd')](_0x2b7c43)[_0x5507('0x10')](_0xc828e5);};}function findById(_0xa6e4b3){return function(_0x2ede34){if(!_[_0x5507('0x11')](_0xa6e4b3)&&!_[_0x5507('0x11')](_0x2ede34)&&!_[_0x5507('0x11')](_0x2ede34[_0x5507('0x12')])){return _[_0x5507('0x13')](_0x2ede34[_0x5507('0x12')],function(_0x3822dd){return _0x3822dd['id']==_0xa6e4b3;});}return null;};}exports['voiceChannels']=function(_0x14dab0,_0x276a81){return respondWithRpcPromise(_0x5507('0x14'),_0x14dab0[_0x5507('0x15')])['then'](respondWithResult(_0x276a81,null))[_0x5507('0x16')](handleError(_0x276a81,null));};exports[_0x5507('0x17')]=function(_0x1a54b0,_0x3ca1f7){return respondWithRpcPromise(_0x5507('0x18'),_[_0x5507('0x19')](_0x1a54b0['query'],_0x1a54b0[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x3ca1f7,null))[_0x5507('0x16')](handleError(_0x3ca1f7,null));};exports[_0x5507('0x1b')]=function(_0x141d22,_0x2de482){return respondWithRpcPromise(_0x5507('0x1c'),_[_0x5507('0x19')](_0x141d22[_0x5507('0x15')],_0x141d22[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x2de482,null))[_0x5507('0x16')](handleError(_0x2de482,null));};exports[_0x5507('0x1d')]=function(_0x2ee6ed,_0x1a2203){return respondWithRpcPromise('VoiceQueues',_0x2ee6ed[_0x5507('0x15')])['then'](respondWithResult(_0x1a2203,null))[_0x5507('0x16')](handleError(_0x1a2203,null));};exports['showVoiceQueues']=function(_0xa66a01,_0x24668b){return respondWithRpcPromise('VoiceQueues',_0xa66a01['query'])[_0x5507('0x9')](findById(_0xa66a01[_0x5507('0x1a')]['id']))['then'](respondWithResult(_0x24668b,null))[_0x5507('0x16')](handleError(_0x24668b,null));};exports[_0x5507('0x1e')]=function(_0x85d383,_0x38f4d9){return respondWithRpcPromise(_0x5507('0x1f'),_[_0x5507('0x19')](_0x85d383['body'],_0x85d383[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x38f4d9,null))[_0x5507('0x16')](handleError(_0x38f4d9,null));};exports[_0x5507('0x20')]=function(_0x29dd58,_0x495bbe){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x5507('0x19')](_0x29dd58[_0x5507('0x15')],_0x29dd58[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x495bbe,null))['catch'](handleError(_0x495bbe,null));};exports[_0x5507('0x21')]=function(_0x13b6e5,_0xab91bc){return respondWithRpcPromise(_0x5507('0x22'),_0x13b6e5[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0xab91bc,null))[_0x5507('0x16')](handleError(_0xab91bc,null));};exports[_0x5507('0x23')]=function(_0x5ede36,_0xf61ba7){return respondWithRpcPromise(_0x5507('0x24'),_[_0x5507('0x19')](_0x5ede36['query'],_0x5ede36['params']))[_0x5507('0x9')](respondWithResult(_0xf61ba7,null))[_0x5507('0x16')](handleError(_0xf61ba7,null));};exports[_0x5507('0x25')]=function(_0x17d01c,_0x143d97){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x17d01c[_0x5507('0x15')],_0x17d01c[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x143d97,null))[_0x5507('0x16')](handleError(_0x143d97,null));};exports['voiceQueuesChannelRedirect']=function(_0x54e4bd,_0x23ea7c){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x5507('0x19')](_0x54e4bd[_0x5507('0x15')],_0x54e4bd[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x23ea7c,null))[_0x5507('0x16')](handleError(_0x23ea7c,null));};exports[_0x5507('0x26')]=function(_0x1c8506,_0x2b962d){return respondWithRpcPromise(_0x5507('0x27'),_0x1c8506[_0x5507('0x15')])['then'](respondWithResult(_0x2b962d,null))['catch'](handleError(_0x2b962d,null));};exports['outboundChannels']=function(_0x570eee,_0x526022){return respondWithRpcPromise(_0x5507('0x28'),_0x570eee[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x526022,null))[_0x5507('0x16')](handleError(_0x526022,null));};exports[_0x5507('0x29')]=function(_0xbef058,_0x101de3){var _0xbc9f93;return respondWithRpcPromise(_0x5507('0x2a'),_0xbef058[_0x5507('0x15')])[_0x5507('0x9')](function(_0x2db0b2){_0xbc9f93=_0x2db0b2;return respondWithRpcPromise(_0x5507('0x2a'),_0xbef058['query'],routingClient);})['then'](function(_0x50eb32){return _[_0x5507('0x19')]({},_0x50eb32,_0xbc9f93);})[_0x5507('0x9')](respondWithResult(_0x101de3,null))[_0x5507('0x16')](handleError(_0x101de3,null));};exports[_0x5507('0x2b')]=function(_0xcd4df5,_0x17d7db){if(_0xcd4df5[_0x5507('0x2c')]&&_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')]&&_0xcd4df5[_0x5507('0x2e')]&&_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')]){for(var _0x24d7b5 in _0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')]){if(_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x5507('0x2f')](_0x24d7b5)){db[_0x5507('0x30')]['findAll']({'where':{'channel':_0x24d7b5,'membername':_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xcd4df5['body'][_0x5507('0x2d')][_0x24d7b5]&&_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x5507('0x31')]?{'$notIn':_0xcd4df5[_0x5507('0x2c')]['interaction'][_0x24d7b5]}:{'$ne':null}}})[_0x5507('0x9')](function(_0x39ac17){var _0x1dfc9c=moment()['format'](_0x5507('0x32'));for(var _0x33022e=0x0,_0xadea4c=_0x39ac17[_0x5507('0x31')];_0x33022e<_0xadea4c;_0x33022e+=0x1){_0x39ac17[_0x33022e][_0x5507('0x33')]({'exitAt':_0x1dfc9c});}});for(var _0x48d72b=0x0;_0x48d72b<_0xcd4df5[_0x5507('0x2c')]['interaction'][_0x24d7b5][_0x5507('0x31')];_0x48d72b+=0x1){db[_0x5507('0x30')][_0x5507('0x34')]({'where':{'channel':_0x24d7b5,'membername':_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')],'type':_0x5507('0x35'),'uniqueid':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x48d72b],'exitAt':null},'defaults':{'channel':_0x24d7b5,'membername':_0xcd4df5['user'][_0x5507('0xf')],'interface':_[_0x5507('0x11')](_0xcd4df5['user']['interface'])?util['format'](_0x5507('0x36'),_0xcd4df5['user'][_0x5507('0xf')]):_0xcd4df5['user'][_0x5507('0x37')],'type':'INTERACTION','enterAt':moment()['format'](_0x5507('0x32')),'role':_0x5507('0x38'),'internal':_0xcd4df5[_0x5507('0x2e')][_0x5507('0x39')],'uniqueid':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x48d72b]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xcd4df5[_0x5507('0x1a')]['id'],'capacity':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x3a')]},routingClient)['then'](respondWithResult(_0x17d7db,null))[_0x5507('0x16')](handleError(_0x17d7db,null));};exports[_0x5507('0x3b')]=function(_0x505e71,_0x2e0cfc){return respondWithRpcPromise(_0x5507('0x3c'),_0x505e71[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x2e0cfc,null))[_0x5507('0x16')](handleError(_0x2e0cfc,null));};exports[_0x5507('0x3d')]=function(_0x245456,_0x1bb575){return respondWithRpcPromise('Trunks',_0x245456['query'])[_0x5507('0x9')](respondWithResult(_0x1bb575,null))[_0x5507('0x16')](handleError(_0x1bb575,null));};exports[_0x5507('0x3e')]=function(_0x1b34c8,_0xce851d){return respondWithRpcPromise(_0x5507('0x3f'),_0x1b34c8[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0xce851d,null))[_0x5507('0x16')](handleError(_0xce851d,null));};exports[_0x5507('0x40')]=function(_0x40cda2,_0x13dc8b){return respondWithRpcPromise(_0x5507('0x41'),_0x40cda2[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x13dc8b,null))[_0x5507('0x16')](handleError(_0x13dc8b,null));};exports['showChatQueues']=function(_0x3f47af,_0x56e0cd){return respondWithRpcPromise('ChatQueues',_0x3f47af[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x3f47af[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x56e0cd,null))['catch'](handleError(_0x56e0cd,null));};exports[_0x5507('0x42')]=function(_0x2f41a9,_0x314d4e){return respondWithRpcPromise(_0x5507('0x43'),_0x2f41a9[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x314d4e,null))['catch'](handleError(_0x314d4e,null));};exports[_0x5507('0x44')]=function(_0x46e589,_0x3a2f9f){return respondWithRpcPromise('MailQueues',_0x46e589['query'],routingClient)[_0x5507('0x9')](findById(_0x46e589['params']['id']))[_0x5507('0x9')](respondWithResult(_0x3a2f9f,null))[_0x5507('0x16')](handleError(_0x3a2f9f,null));};exports['mailAccounts']=function(_0x3e796d,_0x1b622f){return respondWithRpcPromise(_0x5507('0x45'),_0x3e796d[_0x5507('0x15')],mailClient)[_0x5507('0x9')](respondWithResult(_0x1b622f,null))[_0x5507('0x16')](handleError(_0x1b622f,null));};exports[_0x5507('0x46')]=function(_0x2928f2,_0x737d39){return respondWithRpcPromise(_0x5507('0x47'),_0x2928f2[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x737d39,null))['catch'](handleError(_0x737d39,null));};exports[_0x5507('0x48')]=function(_0x2e904b,_0x219e34){return respondWithRpcPromise(_0x5507('0x47'),_0x2e904b[_0x5507('0x15')],routingClient)['then'](findById(_0x2e904b[_0x5507('0x1a')]['id']))['then'](respondWithResult(_0x219e34,null))[_0x5507('0x16')](handleError(_0x219e34,null));};exports[_0x5507('0x49')]=function(_0x241733,_0x54c009){return respondWithRpcPromise(_0x5507('0x4a'),_0x241733[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x54c009,null))['catch'](handleError(_0x54c009,null));};exports[_0x5507('0x4b')]=function(_0x5cfdb0,_0x3dca7d){return respondWithRpcPromise('SmsQueues',_0x5cfdb0['query'],routingClient)[_0x5507('0x9')](findById(_0x5cfdb0[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x3dca7d,null))[_0x5507('0x16')](handleError(_0x3dca7d,null));};exports[_0x5507('0x4c')]=function(_0x31cc0d,_0x4bf567){return respondWithRpcPromise('WhatsappQueues',_0x31cc0d[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x4bf567,null))[_0x5507('0x16')](handleError(_0x4bf567,null));};exports[_0x5507('0x4d')]=function(_0x5e3e73,_0x388faa){return respondWithRpcPromise(_0x5507('0x4e'),_0x5e3e73[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x5e3e73[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x388faa,null))[_0x5507('0x16')](handleError(_0x388faa,null));};exports['faxQueues']=function(_0x3802dd,_0xfdbbe5){return respondWithRpcPromise(_0x5507('0x4f'),_0x3802dd['query'],routingClient)[_0x5507('0x9')](respondWithResult(_0xfdbbe5,null))['catch'](handleError(_0xfdbbe5,null));};exports['showFaxQueues']=function(_0x55c257,_0x1fef49){return respondWithRpcPromise(_0x5507('0x4f'),_0x55c257[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x55c257[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x1fef49,null))[_0x5507('0x16')](handleError(_0x1fef49,null));};exports['faxAccounts']=function(_0x1812d7,_0x48ed80){return respondWithRpcPromise(_0x5507('0x50'),_0x1812d7[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x48ed80,null))[_0x5507('0x16')](handleError(_0x48ed80,null));};exports[_0x5507('0x51')]=function(_0x120108,_0x4423a8){return respondWithRpcPromise(_0x5507('0x52'),_0x120108[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x4423a8,null))[_0x5507('0x16')](handleError(_0x4423a8,null));};exports['mailQueuesWaitingInteractions']=function(_0x94b11c,_0xbb0a62){return respondWithRpcPromise(_0x5507('0x53'),_0x94b11c['query'],routingClient)[_0x5507('0x9')](respondWithResult(_0xbb0a62,null))[_0x5507('0x16')](handleError(_0xbb0a62,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x26e777,_0x5815fb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x26e777[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x5815fb,null))[_0x5507('0x16')](handleError(_0x5815fb,null));};exports[_0x5507('0x54')]=function(_0xfb59be,_0xda51d5){return respondWithRpcPromise(_0x5507('0x55'),_0xfb59be[_0x5507('0x15')],routingClient)['then'](function(_0x43fccf){if(_0xfb59be[_0x5507('0x15')][_0x5507('0x56')]!==undefined){var _0x75aa3c=_(_0x43fccf[_0x5507('0x12')])[_0x5507('0x57')]([_0xfb59be[_0x5507('0x15')][_0x5507('0x56')],_0xfb59be[_0x5507('0x1a')]['id']])[_0x5507('0x58')](_0x5507('0x59'))[_0x5507('0x5a')]()['value']();return _0x43fccf[_0x5507('0x12')][_0x5507('0x57')](function(_0x10f066){return _0x75aa3c[_0x5507('0x5b')](_0x10f066[_0x5507('0x59')])>-0x1;});}else{return _0x43fccf[_0x5507('0x12')]['filter'](function(_0x1dad83){return _0x1dad83['queue_id']===parseInt(_0xfb59be[_0x5507('0x1a')]['id']);});}})['then'](respondWithResult(_0xda51d5,null))['catch'](handleError(_0xda51d5,null));};exports[_0x5507('0x5c')]=function(_0x20274e,_0x2979b1){return respondWithRpcPromise(_0x5507('0x5d'),_0x20274e[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x2979b1,null))[_0x5507('0x16')](handleError(_0x2979b1,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x410c16,_0x471142){return respondWithRpcPromise(_0x5507('0x5e'),_0x410c16[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x471142,null))[_0x5507('0x16')](handleError(_0x471142,null));};exports[_0x5507('0x5f')]=function(_0x42bef4,_0x5a8a1b){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x42bef4[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x5a8a1b,null))[_0x5507('0x16')](handleError(_0x5a8a1b,null));};exports[_0x5507('0x60')]=function(_0x77a772){return function(_0x26f796,_0x3d7e21){var _0x10b62e,_0x18bed6;var _0x27265e=_[_0x5507('0x61')](_0x77a772);var _0x160e54=_0x77a772==='chat'?_0x5507('0x62'):_0x5507('0x63');return db[_0x27265e+_0x5507('0x64')][_0x5507('0x65')]({'raw':!![],'where':{'id':_0x26f796[_0x5507('0x1a')]['id']}})[_0x5507('0x9')](function(_0x33717e){if(_['isNil'](_0x33717e)){throw new Error(_0x27265e+_0x5507('0x66'));}_0x10b62e=_0x33717e;return db[_0x27265e+_0x5507('0x67')][_0x5507('0x65')]({'where':{'id':_0x26f796[_0x5507('0x2c')]['messageId']},'include':[{'model':db[_0x27265e+_0x5507('0x68')],'as':_0x5507('0x68')},{'model':db[_0x27265e+_0x160e54],'as':_0x5507('0x63')}]});})[_0x5507('0x9')](function(_0x1a5d2e){if(_[_0x5507('0x11')](_0x1a5d2e)){throw new Error(_0x27265e+_0x5507('0x69'));}_0x18bed6=_0x1a5d2e;return _0x1a5d2e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5507('0x9')](function(){var _0x38144b={'uniqueid':_0x77a772+'.'+_0x18bed6['id']+'.'+_0x18bed6[_0x5507('0x68')]['id'],'FromUserId':_0x26f796[_0x5507('0x2e')]['id'],'type':_0x5507('0x6a')};_0x38144b[_0x27265e+'MessageId']=_0x18bed6['id'];_0x38144b[_0x27265e+_0x5507('0x6b')]=_0x18bed6[_0x5507('0x68')]['id'];_0x38144b[_0x5507('0x6c')+_0x27265e+_0x160e54+'Id']=_0x18bed6[_0x5507('0x63')]['id'];_0x38144b['To'+_0x27265e+_0x5507('0x6d')]=_0x10b62e['id'];return db[_0x27265e+_0x5507('0x6e')][_0x5507('0x6f')](_0x38144b);})[_0x5507('0x9')](function(){return respondWithRpcPromise(_0x5507('0x70'),{'channel':_0x77a772,'interaction':_0x18bed6[_0x5507('0x68')],'message':_0x18bed6,'account':_0x18bed6[_0x5507('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5507('0x6a'),'appdata':_0x10b62e[_0x5507('0xf')]+','+(_0x18bed6['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x5507('0x9')](respondWithResult(_0x3d7e21,null))[_0x5507('0x16')](handleError(_0x3d7e21,null));};};exports[_0x5507('0x71')]=function(_0x3b04a7,_0x1e913a){var _0x4e1578,_0x2339c7;if(_[_0x5507('0x11')](_0x3b04a7[_0x5507('0x2c')]['channel'])){throw new Error(_0x5507('0x72'));}var _0x5808d9=_0x3b04a7['body'][_0x5507('0x73')];var _0x58b56c=_[_0x5507('0x61')](_0x5808d9);var _0x5c6043=_0x5808d9===_0x5507('0x74')?_0x5507('0x62'):_0x5507('0x63');return db['User']['findOne']({'raw':!![],'where':{'id':_0x3b04a7[_0x5507('0x1a')]['id'],'role':_0x5507('0x38')}})[_0x5507('0x9')](function(_0x51bec0){if(_[_0x5507('0x11')](_0x51bec0)){throw new Error(_0x5507('0x75'));}_0x4e1578=_0x51bec0;return db[_0x58b56c+_0x5507('0x67')][_0x5507('0x65')]({'where':{'id':_0x3b04a7['body']['messageId']},'include':[{'model':db[_0x58b56c+_0x5507('0x68')],'as':_0x5507('0x68')},{'model':db[_0x58b56c+_0x5c6043],'as':'Account'}]});})[_0x5507('0x9')](function(_0x13c0f5){if(_[_0x5507('0x11')](_0x13c0f5)){throw new Error(_0x58b56c+_0x5507('0x69'));}_0x2339c7=_0x13c0f5;return _0x13c0f5['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5507('0x9')](function(){var _0x3a2b0f={'uniqueid':_0x5808d9+'.'+_0x2339c7['id']+'.'+_0x2339c7['Interaction']['id'],'FromUserId':_0x3b04a7[_0x5507('0x2e')]['id'],'type':_0x5507('0x6a'),'ToUserId':_0x4e1578['id']};_0x3a2b0f[_0x58b56c+_0x5507('0x76')]=_0x2339c7['id'];_0x3a2b0f[_0x58b56c+'InteractionId']=_0x2339c7[_0x5507('0x68')]['id'];_0x3a2b0f[_0x5507('0x6c')+_0x58b56c+_0x5c6043+'Id']=_0x2339c7['Account']['id'];return db[_0x58b56c+_0x5507('0x6e')][_0x5507('0x6f')](_0x3a2b0f);})['then'](function(){return respondWithRpcPromise(_0x5507('0x70'),{'channel':_0x5808d9,'interaction':_0x2339c7[_0x5507('0x68')],'message':_0x2339c7,'account':_0x2339c7[_0x5507('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x4e1578[_0x5507('0xf')]+','+(_0x2339c7[_0x5507('0x63')][_0x5507('0x77')]||0x12c),'interval':_0x5507('0x78')}]},routingClient);})[_0x5507('0x9')](respondWithResult(_0x1e913a,null))[_0x5507('0x16')](handleError(_0x1e913a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 33410f5..845c5fe 100644 --- a/server/api/schedule/index.js +++ b/server/api/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cd9=['destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','create','put','update'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x6cd9,0x12e));var _0x96cd=function(_0xc3c15f,_0x120016){_0xc3c15f=_0xc3c15f-0x0;var _0x1bb44d=_0x6cd9[_0xc3c15f];return _0x1bb44d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x96cd('0x0'));var timeout=require(_0x96cd('0x1'));var express=require(_0x96cd('0x2'));var router=express[_0x96cd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x96cd('0x4'));var interaction=require(_0x96cd('0x5'));var config=require(_0x96cd('0x6'));var controller=require(_0x96cd('0x7'));router[_0x96cd('0x8')]('/',auth[_0x96cd('0x9')](),controller[_0x96cd('0xa')]);router[_0x96cd('0x8')](_0x96cd('0xb'),auth['isAuthenticated'](),controller[_0x96cd('0xc')]);router['get'](_0x96cd('0xd'),auth[_0x96cd('0x9')](),controller[_0x96cd('0xe')]);router['post']('/',auth[_0x96cd('0x9')](),controller[_0x96cd('0xf')]);router[_0x96cd('0x10')](_0x96cd('0xb'),auth[_0x96cd('0x9')](),controller[_0x96cd('0x11')]);router['delete'](_0x96cd('0xb'),auth[_0x96cd('0x9')](),controller[_0x96cd('0x12')]);module[_0x96cd('0x13')]=router; \ No newline at end of file +var _0x1fce=['./schedule.controller','index','get','/:id','isAuthenticated','/:id/run','run','post','create','put','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45d50a,_0x448513){var _0x3cef97=function(_0x2f3e43){while(--_0x2f3e43){_0x45d50a['push'](_0x45d50a['shift']());}};_0x3cef97(++_0x448513);}(_0x1fce,0x1ec));var _0xe1fc=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x1fce[_0xabfec4];return _0x7bafa2;};'use strict';var multer=require(_0xe1fc('0x0'));var util=require('util');var path=require(_0xe1fc('0x1'));var timeout=require(_0xe1fc('0x2'));var express=require(_0xe1fc('0x3'));var router=express[_0xe1fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe1fc('0x5'));var interaction=require(_0xe1fc('0x6'));var config=require(_0xe1fc('0x7'));var controller=require(_0xe1fc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe1fc('0x9')]);router[_0xe1fc('0xa')](_0xe1fc('0xb'),auth[_0xe1fc('0xc')](),controller['show']);router[_0xe1fc('0xa')](_0xe1fc('0xd'),auth[_0xe1fc('0xc')](),controller[_0xe1fc('0xe')]);router[_0xe1fc('0xf')]('/',auth[_0xe1fc('0xc')](),controller[_0xe1fc('0x10')]);router[_0xe1fc('0x11')](_0xe1fc('0xb'),auth[_0xe1fc('0xc')](),controller[_0xe1fc('0x12')]);router[_0xe1fc('0x13')](_0xe1fc('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index aad1bc6..d4bf6a4 100644 --- a/server/api/schedule/schedule.attributes.js +++ b/server/api/schedule/schedule.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5894=['years','quarters','days','csv','pdf','xlsx','custom','default','BOOLEAN','TEXT','sequelize','exports','STRING','DATE','ENUM'];(function(_0x21f92f,_0x477dce){var _0x5e28a8=function(_0x2a43ae){while(--_0x2a43ae){_0x21f92f['push'](_0x21f92f['shift']());}};_0x5e28a8(++_0x477dce);}(_0x5894,0xeb));var _0x4589=function(_0x590f2b,_0x2d78ba){_0x590f2b=_0x590f2b-0x0;var _0x3ac6d8=_0x5894[_0x590f2b];return _0x3ac6d8;};'use strict';var Sequelize=require(_0x4589('0x0'));module[_0x4589('0x1')]={'name':{'type':Sequelize[_0x4589('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4589('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x4589('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4589('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4589('0x4')](_0x4589('0x5'),_0x4589('0x6'),'months','weeks',_0x4589('0x7'),'hours','minutes'),'allowNull':![],'defaultValue':_0x4589('0x7')},'output':{'type':Sequelize[_0x4589('0x4')](_0x4589('0x8'),_0x4589('0x9'),_0x4589('0xa')),'allowNull':![],'defaultValue':_0x4589('0x8')},'type':{'type':Sequelize[_0x4589('0x4')](_0x4589('0xb'),_0x4589('0xc')),'allowNull':![],'defaultValue':_0x4589('0xb')},'sendMail':{'type':Sequelize[_0x4589('0xd')],'defaultValue':![]},'email':{'type':Sequelize[_0x4589('0x2')]},'cc':{'type':Sequelize[_0x4589('0xe')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x4589('0xd')],'defaultValue':!![]}}; \ No newline at end of file +var _0xad75=['STRING','BOOLEAN','0\x200\x20*\x20*\x20*','years','months','weeks','days','hours','minutes','ENUM','csv','xlsx','custom','TEXT','sequelize'];(function(_0x17a2f5,_0xca92f9){var _0x59923d=function(_0x28c01e){while(--_0x28c01e){_0x17a2f5['push'](_0x17a2f5['shift']());}};_0x59923d(++_0xca92f9);}(_0xad75,0x1df));var _0x5ad7=function(_0x1e0f88,_0x35c776){_0x1e0f88=_0x1e0f88-0x0;var _0xc15e17=_0xad75[_0x1e0f88];return _0xc15e17;};'use strict';var Sequelize=require(_0x5ad7('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ad7('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5ad7('0x1')]},'active':{'type':Sequelize[_0x5ad7('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5ad7('0x1')],'allowNull':![],'defaultValue':_0x5ad7('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x5ad7('0x4'),'quarters',_0x5ad7('0x5'),_0x5ad7('0x6'),_0x5ad7('0x7'),_0x5ad7('0x8'),_0x5ad7('0x9')),'allowNull':![],'defaultValue':_0x5ad7('0x7')},'output':{'type':Sequelize[_0x5ad7('0xa')](_0x5ad7('0xb'),'pdf',_0x5ad7('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x5ad7('0xa')]('custom','default'),'allowNull':![],'defaultValue':_0x5ad7('0xd')},'sendMail':{'type':Sequelize[_0x5ad7('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x5ad7('0x1')]},'cc':{'type':Sequelize[_0x5ad7('0xe')]},'bcc':{'type':Sequelize[_0x5ad7('0xe')]},'sendIfEmpty':{'type':Sequelize[_0x5ad7('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 2887d58..f6bd15a 100644 --- a/server/api/schedule/schedule.controller.js +++ b/server/api/schedule/schedule.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f01=['run','../../config/schedule','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','Scheduler','error','stack','name','send','index','Schedule','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','where','map','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x43b11e,_0x1614bf){var _0x3ad659=function(_0x5ac3eb){while(--_0x5ac3eb){_0x43b11e['push'](_0x43b11e['shift']());}};_0x3ad659(++_0x1614bf);}(_0x2f01,0x14e));var _0x12f0=function(_0x46fa3f,_0xcb21fe){_0x46fa3f=_0x46fa3f-0x0;var _0x17f8ae=_0x2f01[_0x46fa3f];return _0x17f8ae;};'use strict';var emlformat=require(_0x12f0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x12f0('0x1'));var rp=require(_0x12f0('0x2'));var moment=require(_0x12f0('0x3'));var BPromise=require(_0x12f0('0x4'));var Mustache=require(_0x12f0('0x5'));var util=require('util');var path=require(_0x12f0('0x6'));var sox=require(_0x12f0('0x7'));var csv=require(_0x12f0('0x8'));var ejs=require(_0x12f0('0x9'));var fs=require('fs');var fs_extra=require(_0x12f0('0xa'));var _=require('lodash');var squel=require(_0x12f0('0xb'));var crypto=require(_0x12f0('0xc'));var jsforce=require(_0x12f0('0xd'));var deskjs=require(_0x12f0('0xe'));var toCsv=require(_0x12f0('0x8'));var querystring=require(_0x12f0('0xf'));var Papa=require(_0x12f0('0x10'));var Redis=require(_0x12f0('0x11'));var authService=require(_0x12f0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x12f0('0x13'));var hardwareService=require(_0x12f0('0x14'));var logger=require('../../config/logger')(_0x12f0('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x12f0('0x16'));var db=require(_0x12f0('0x17'))['db'];function respondWithStatusCode(_0x368d92,_0x1b2e83){_0x1b2e83=_0x1b2e83||0xcc;return function(_0x2cc93e){if(_0x2cc93e){return _0x368d92[_0x12f0('0x18')](_0x1b2e83);}return _0x368d92[_0x12f0('0x19')](_0x1b2e83)['end']();};}function respondWithResult(_0x129736,_0x52a2ad){_0x52a2ad=_0x52a2ad||0xc8;return function(_0x5d5d3b){if(_0x5d5d3b){return _0x129736[_0x12f0('0x19')](_0x52a2ad)['json'](_0x5d5d3b);}};}function respondWithFilteredResult(_0x2c3438,_0x4cf3ea){return function(_0x242416){if(_0x242416){var _0x2ba510=typeof _0x4cf3ea['offset']===_0x12f0('0x1a')&&typeof _0x4cf3ea['limit']===_0x12f0('0x1a');var _0x40946b=_0x242416[_0x12f0('0x1b')];var _0x4ca6a2=_0x2ba510?0x0:_0x4cf3ea[_0x12f0('0x1c')];var _0x2933f1=_0x2ba510?_0x242416['count']:_0x4cf3ea['offset']+_0x4cf3ea['limit'];var _0x5da51b;if(_0x2933f1>=_0x40946b){_0x2933f1=_0x40946b;_0x5da51b=0xc8;}else{_0x5da51b=0xce;}_0x2c3438[_0x12f0('0x19')](_0x5da51b);return _0x2c3438[_0x12f0('0x1d')](_0x12f0('0x1e'),_0x4ca6a2+'-'+_0x2933f1+'/'+_0x40946b)['json'](_0x242416);}return null;};}function patchUpdates(_0x1e772e){return function(_0x47c748){try{jsonpatch['apply'](_0x47c748,_0x1e772e,!![]);}catch(_0x53b5c4){return BPromise[_0x12f0('0x1f')](_0x53b5c4);}return _0x47c748[_0x12f0('0x20')]();};}function saveUpdates(_0x3793ec,_0x2006d6){return function(_0x2f0c01){if(_0x2f0c01){return _0x2f0c01[_0x12f0('0x21')](_0x3793ec)[_0x12f0('0x22')](function(_0x15acb8){return _0x15acb8;});}return null;};}function removeEntity(_0x5634cf,_0x3540ea){return function(_0x59d0b2){if(_0x59d0b2){return _0x59d0b2[_0x12f0('0x23')]()[_0x12f0('0x22')](function(){var _0x121eaf=_0x59d0b2['get']({'plain':!![]});var _0x1f5bf5=_0x12f0('0x24');return db['UserProfileResource'][_0x12f0('0x23')]({'where':{'type':_0x1f5bf5,'resourceId':_0x121eaf['id']}})['then'](function(){return _0x59d0b2;});})['then'](function(){_0x5634cf[_0x12f0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e9708,_0x8eb956){return function(_0xdac370){if(!_0xdac370){_0x1e9708[_0x12f0('0x18')](0x194);}return _0xdac370;};}function handleError(_0x2b6f48,_0x2eba5a){_0x2eba5a=_0x2eba5a||0x1f4;return function(_0x5335a3){logger[_0x12f0('0x25')](_0x5335a3[_0x12f0('0x26')]);if(_0x5335a3[_0x12f0('0x27')]){delete _0x5335a3[_0x12f0('0x27')];}_0x2b6f48[_0x12f0('0x19')](_0x2eba5a)[_0x12f0('0x28')](_0x5335a3);};}exports[_0x12f0('0x29')]=function(_0x39aaf2,_0x2c603d){var _0xbc4067={},_0x1a3452={},_0x3c2961={'count':0x0,'rows':[]};var _0x229915=_['map'](db[_0x12f0('0x2a')][_0x12f0('0x2b')],function(_0x35839e){return{'name':_0x35839e[_0x12f0('0x2c')],'type':_0x35839e[_0x12f0('0x2d')]['key']};});_0x1a3452[_0x12f0('0x2e')]=_['map'](_0x229915,'name');_0x1a3452[_0x12f0('0x2f')]=_[_0x12f0('0x30')](_0x39aaf2[_0x12f0('0x2f')]);_0x1a3452[_0x12f0('0x31')]=_[_0x12f0('0x32')](_0x1a3452['model'],_0x1a3452[_0x12f0('0x2f')]);_0xbc4067[_0x12f0('0x33')]=_[_0x12f0('0x32')](_0x1a3452[_0x12f0('0x2e')],qs[_0x12f0('0x34')](_0x39aaf2['query']['fields']));_0xbc4067['attributes']=_0xbc4067[_0x12f0('0x33')]['length']?_0xbc4067['attributes']:_0x1a3452['model'];if(!_0x39aaf2[_0x12f0('0x2f')][_0x12f0('0x35')]('nolimit')){_0xbc4067[_0x12f0('0x36')]=qs['limit'](_0x39aaf2['query']['limit']);_0xbc4067[_0x12f0('0x1c')]=qs['offset'](_0x39aaf2[_0x12f0('0x2f')][_0x12f0('0x1c')]);}_0xbc4067[_0x12f0('0x37')]=qs['sort'](_0x39aaf2['query']['sort']);_0xbc4067[_0x12f0('0x38')]=qs[_0x12f0('0x31')](_['pick'](_0x39aaf2[_0x12f0('0x2f')],_0x1a3452[_0x12f0('0x31')]),_0x229915);if(_0x39aaf2[_0x12f0('0x2f')]['filter']){_0xbc4067[_0x12f0('0x38')]=_['merge'](_0xbc4067[_0x12f0('0x38')],{'$or':_[_0x12f0('0x39')](_0x229915,function(_0x22934c){if(_0x22934c[_0x12f0('0x2d')]!==_0x12f0('0x3a')){var _0x5a6d8a={};_0x5a6d8a[_0x22934c[_0x12f0('0x27')]]={'$like':'%'+_0x39aaf2[_0x12f0('0x2f')][_0x12f0('0x3b')]+'%'};return _0x5a6d8a;}})});}_0xbc4067=_[_0x12f0('0x3c')]({},_0xbc4067,_0x39aaf2[_0x12f0('0x3d')]);var _0x11e82f={'where':_0xbc4067['where']};return db[_0x12f0('0x2a')][_0x12f0('0x1b')](_0x11e82f)[_0x12f0('0x22')](function(_0x3f85ec){_0x3c2961[_0x12f0('0x1b')]=_0x3f85ec;if(_0x39aaf2[_0x12f0('0x2f')][_0x12f0('0x3e')]){_0xbc4067[_0x12f0('0x3f')]=[{'all':!![]}];}return db['Schedule'][_0x12f0('0x40')](_0xbc4067);})['then'](function(_0x58571d){_0x3c2961[_0x12f0('0x41')]=_0x58571d;return _0x3c2961;})[_0x12f0('0x22')](respondWithFilteredResult(_0x2c603d,_0xbc4067))[_0x12f0('0x42')](handleError(_0x2c603d,null));};exports[_0x12f0('0x43')]=function(_0x5c9ff9,_0x43232b){var _0x3a71e0={'raw':![],'where':{'id':_0x5c9ff9[_0x12f0('0x44')]['id']}},_0x343448={};_0x343448[_0x12f0('0x2e')]=_[_0x12f0('0x30')](db[_0x12f0('0x2a')]['rawAttributes']);_0x343448[_0x12f0('0x2f')]=_[_0x12f0('0x30')](_0x5c9ff9[_0x12f0('0x2f')]);_0x343448[_0x12f0('0x31')]=_['intersection'](_0x343448[_0x12f0('0x2e')],_0x343448['query']);_0x3a71e0[_0x12f0('0x33')]=_[_0x12f0('0x32')](_0x343448[_0x12f0('0x2e')],qs[_0x12f0('0x34')](_0x5c9ff9['query'][_0x12f0('0x34')]));_0x3a71e0[_0x12f0('0x33')]=_0x3a71e0[_0x12f0('0x33')][_0x12f0('0x45')]?_0x3a71e0[_0x12f0('0x33')]:_0x343448[_0x12f0('0x2e')];if(_0x5c9ff9[_0x12f0('0x2f')][_0x12f0('0x3e')]){_0x3a71e0[_0x12f0('0x3f')]=[{'all':!![]}];}_0x3a71e0=_[_0x12f0('0x3c')]({},_0x3a71e0,_0x5c9ff9[_0x12f0('0x3d')]);return db[_0x12f0('0x2a')][_0x12f0('0x46')](_0x3a71e0)[_0x12f0('0x22')](handleEntityNotFound(_0x43232b,null))['then'](respondWithResult(_0x43232b,null))['catch'](handleError(_0x43232b,null));};exports[_0x12f0('0x47')]=function(_0x41604c,_0x2b6891){return db[_0x12f0('0x2a')]['create'](_0x41604c[_0x12f0('0x48')],{})[_0x12f0('0x22')](function(_0x1a2e0f){var _0x337194=_0x41604c[_0x12f0('0x49')][_0x12f0('0x4a')]({'plain':!![]});if(!_0x337194)throw new Error(_0x12f0('0x4b'));if(_0x337194[_0x12f0('0x4c')]===_0x12f0('0x49')){var _0x4a3a11=_0x1a2e0f['get']({'plain':!![]});var _0xb12c30=_0x12f0('0x24');return db[_0x12f0('0x4d')][_0x12f0('0x46')]({'where':{'name':_0xb12c30,'userProfileId':_0x337194[_0x12f0('0x4e')]},'raw':!![]})[_0x12f0('0x22')](function(_0x1a0429){if(_0x1a0429&&_0x1a0429[_0x12f0('0x4f')]===0x0){return db[_0x12f0('0x50')][_0x12f0('0x47')]({'name':_0x4a3a11[_0x12f0('0x27')],'resourceId':_0x4a3a11['id'],'type':_0x1a0429[_0x12f0('0x27')],'sectionId':_0x1a0429['id']},{})[_0x12f0('0x22')](function(){return _0x1a2e0f;});}else{return _0x1a2e0f;}})[_0x12f0('0x42')](function(_0x46457c){logger[_0x12f0('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46457c);throw _0x46457c;});}return _0x1a2e0f;})[_0x12f0('0x22')](respondWithResult(_0x2b6891,0xc9))[_0x12f0('0x42')](handleError(_0x2b6891,null));};exports['update']=function(_0x48616c,_0x4455a8){if(_0x48616c[_0x12f0('0x48')]['id']){delete _0x48616c[_0x12f0('0x48')]['id'];}return db[_0x12f0('0x2a')]['find']({'where':{'id':_0x48616c[_0x12f0('0x44')]['id']}})[_0x12f0('0x22')](handleEntityNotFound(_0x4455a8,null))[_0x12f0('0x22')](saveUpdates(_0x48616c[_0x12f0('0x48')],null))[_0x12f0('0x22')](respondWithResult(_0x4455a8,null))[_0x12f0('0x42')](handleError(_0x4455a8,null));};exports[_0x12f0('0x23')]=function(_0x5e78f4,_0x213709){return db[_0x12f0('0x2a')][_0x12f0('0x46')]({'where':{'id':_0x5e78f4['params']['id']}})[_0x12f0('0x22')](handleEntityNotFound(_0x213709,null))[_0x12f0('0x22')](removeEntity(_0x213709,null))[_0x12f0('0x42')](handleError(_0x213709,null));};exports[_0x12f0('0x51')]=function(_0x151156,_0x35bdd5,_0x160d36){var _0x2d66ea=require(_0x12f0('0x52'));return db['Schedule'][_0x12f0('0x46')]({'where':{'id':_0x151156[_0x12f0('0x44')]['id']},'raw':!![]})[_0x12f0('0x22')](handleEntityNotFound(_0x35bdd5,null))[_0x12f0('0x22')](function(){_0x2d66ea[_0x12f0('0x51')](_0x151156[_0x12f0('0x44')]['id']);})[_0x12f0('0x22')](respondWithStatusCode(_0x35bdd5,null))[_0x12f0('0x42')](handleError(_0x35bdd5,null));}; \ No newline at end of file +var _0xfe5a=['limit','undefined','count','set','Content-Range','apply','reject','update','then','Scheduler','UserProfileResource','error','stack','name','index','Schedule','rawAttributes','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','user','get','role','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','run','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x2ffc3b,_0x1e7df6){var _0x52d672=function(_0x1dd727){while(--_0x1dd727){_0x2ffc3b['push'](_0x2ffc3b['shift']());}};_0x52d672(++_0x1e7df6);}(_0xfe5a,0x85));var _0xafe5=function(_0xea7b6a,_0xe01444){_0xea7b6a=_0xea7b6a-0x0;var _0x12849f=_0xfe5a[_0xea7b6a];return _0x12849f;};'use strict';var emlformat=require(_0xafe5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xafe5('0x1'));var jsonpatch=require(_0xafe5('0x2'));var rp=require(_0xafe5('0x3'));var moment=require('moment');var BPromise=require(_0xafe5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xafe5('0x5'));var csv=require(_0xafe5('0x6'));var ejs=require(_0xafe5('0x7'));var fs=require('fs');var fs_extra=require(_0xafe5('0x8'));var _=require(_0xafe5('0x9'));var squel=require(_0xafe5('0xa'));var crypto=require(_0xafe5('0xb'));var jsforce=require(_0xafe5('0xc'));var deskjs=require(_0xafe5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xafe5('0xe'));var Redis=require(_0xafe5('0xf'));var authService=require(_0xafe5('0x10'));var qs=require(_0xafe5('0x11'));var as=require(_0xafe5('0x12'));var hardwareService=require(_0xafe5('0x13'));var logger=require('../../config/logger')(_0xafe5('0x14'));var utils=require(_0xafe5('0x15'));var config=require(_0xafe5('0x16'));var licenseUtil=require(_0xafe5('0x17'));var db=require(_0xafe5('0x18'))['db'];function respondWithStatusCode(_0x3c32ef,_0x22a9bf){_0x22a9bf=_0x22a9bf||0xcc;return function(_0x2a0b48){if(_0x2a0b48){return _0x3c32ef[_0xafe5('0x19')](_0x22a9bf);}return _0x3c32ef[_0xafe5('0x1a')](_0x22a9bf)[_0xafe5('0x1b')]();};}function respondWithResult(_0x202a9b,_0x111397){_0x111397=_0x111397||0xc8;return function(_0x1e31ae){if(_0x1e31ae){return _0x202a9b['status'](_0x111397)['json'](_0x1e31ae);}};}function respondWithFilteredResult(_0xe075bf,_0x47e449){return function(_0x1a1eb0){if(_0x1a1eb0){var _0x4df60a=typeof _0x47e449[_0xafe5('0x1c')]==='undefined'&&typeof _0x47e449[_0xafe5('0x1d')]===_0xafe5('0x1e');var _0x2ea9d0=_0x1a1eb0[_0xafe5('0x1f')];var _0x67e0a8=_0x4df60a?0x0:_0x47e449[_0xafe5('0x1c')];var _0x1336fb=_0x4df60a?_0x1a1eb0[_0xafe5('0x1f')]:_0x47e449[_0xafe5('0x1c')]+_0x47e449[_0xafe5('0x1d')];var _0x3ac175;if(_0x1336fb>=_0x2ea9d0){_0x1336fb=_0x2ea9d0;_0x3ac175=0xc8;}else{_0x3ac175=0xce;}_0xe075bf[_0xafe5('0x1a')](_0x3ac175);return _0xe075bf[_0xafe5('0x20')](_0xafe5('0x21'),_0x67e0a8+'-'+_0x1336fb+'/'+_0x2ea9d0)['json'](_0x1a1eb0);}return null;};}function patchUpdates(_0x54edc8){return function(_0x184d6a){try{jsonpatch[_0xafe5('0x22')](_0x184d6a,_0x54edc8,!![]);}catch(_0x286746){return BPromise[_0xafe5('0x23')](_0x286746);}return _0x184d6a['save']();};}function saveUpdates(_0x2ddc8b,_0x2f8b91){return function(_0x4a50df){if(_0x4a50df){return _0x4a50df[_0xafe5('0x24')](_0x2ddc8b)[_0xafe5('0x25')](function(_0x3f01c5){return _0x3f01c5;});}return null;};}function removeEntity(_0x36893c,_0x1d3570){return function(_0x1b57f7){if(_0x1b57f7){return _0x1b57f7['destroy']()['then'](function(){var _0x21e787=_0x1b57f7['get']({'plain':!![]});var _0x49bd07=_0xafe5('0x26');return db[_0xafe5('0x27')]['destroy']({'where':{'type':_0x49bd07,'resourceId':_0x21e787['id']}})[_0xafe5('0x25')](function(){return _0x1b57f7;});})['then'](function(){_0x36893c['status'](0xcc)[_0xafe5('0x1b')]();});}};}function handleEntityNotFound(_0x26973d,_0x267bbb){return function(_0x211485){if(!_0x211485){_0x26973d[_0xafe5('0x19')](0x194);}return _0x211485;};}function handleError(_0x14b78f,_0x570ef3){_0x570ef3=_0x570ef3||0x1f4;return function(_0x578a6e){logger[_0xafe5('0x28')](_0x578a6e[_0xafe5('0x29')]);if(_0x578a6e['name']){delete _0x578a6e[_0xafe5('0x2a')];}_0x14b78f[_0xafe5('0x1a')](_0x570ef3)['send'](_0x578a6e);};}exports[_0xafe5('0x2b')]=function(_0x3ec154,_0x304d66){var _0x23ea40={},_0x8e45f8={},_0x5ecf83={'count':0x0,'rows':[]};var _0xeb2073=_['map'](db[_0xafe5('0x2c')][_0xafe5('0x2d')],function(_0xee8b56){return{'name':_0xee8b56['fieldName'],'type':_0xee8b56['type'][_0xafe5('0x2e')]};});_0x8e45f8[_0xafe5('0x2f')]=_['map'](_0xeb2073,_0xafe5('0x2a'));_0x8e45f8[_0xafe5('0x30')]=_['keys'](_0x3ec154[_0xafe5('0x30')]);_0x8e45f8['filters']=_[_0xafe5('0x31')](_0x8e45f8[_0xafe5('0x2f')],_0x8e45f8[_0xafe5('0x30')]);_0x23ea40['attributes']=_[_0xafe5('0x31')](_0x8e45f8['model'],qs[_0xafe5('0x32')](_0x3ec154[_0xafe5('0x30')][_0xafe5('0x32')]));_0x23ea40[_0xafe5('0x33')]=_0x23ea40[_0xafe5('0x33')][_0xafe5('0x34')]?_0x23ea40[_0xafe5('0x33')]:_0x8e45f8[_0xafe5('0x2f')];if(!_0x3ec154[_0xafe5('0x30')]['hasOwnProperty'](_0xafe5('0x35'))){_0x23ea40[_0xafe5('0x1d')]=qs[_0xafe5('0x1d')](_0x3ec154[_0xafe5('0x30')][_0xafe5('0x1d')]);_0x23ea40[_0xafe5('0x1c')]=qs[_0xafe5('0x1c')](_0x3ec154[_0xafe5('0x30')]['offset']);}_0x23ea40[_0xafe5('0x36')]=qs[_0xafe5('0x37')](_0x3ec154[_0xafe5('0x30')][_0xafe5('0x37')]);_0x23ea40[_0xafe5('0x38')]=qs['filters'](_[_0xafe5('0x39')](_0x3ec154['query'],_0x8e45f8[_0xafe5('0x3a')]),_0xeb2073);if(_0x3ec154[_0xafe5('0x30')]['filter']){_0x23ea40[_0xafe5('0x38')]=_[_0xafe5('0x3b')](_0x23ea40[_0xafe5('0x38')],{'$or':_[_0xafe5('0x3c')](_0xeb2073,function(_0x102671){if(_0x102671[_0xafe5('0x3d')]!==_0xafe5('0x3e')){var _0x411317={};_0x411317[_0x102671[_0xafe5('0x2a')]]={'$like':'%'+_0x3ec154[_0xafe5('0x30')]['filter']+'%'};return _0x411317;}})});}_0x23ea40=_['merge']({},_0x23ea40,_0x3ec154[_0xafe5('0x3f')]);var _0x4b4846={'where':_0x23ea40[_0xafe5('0x38')]};return db[_0xafe5('0x2c')][_0xafe5('0x1f')](_0x4b4846)['then'](function(_0x52c48c){_0x5ecf83[_0xafe5('0x1f')]=_0x52c48c;if(_0x3ec154['query'][_0xafe5('0x40')]){_0x23ea40[_0xafe5('0x41')]=[{'all':!![]}];}return db[_0xafe5('0x2c')][_0xafe5('0x42')](_0x23ea40);})[_0xafe5('0x25')](function(_0x53dc84){_0x5ecf83[_0xafe5('0x43')]=_0x53dc84;return _0x5ecf83;})[_0xafe5('0x25')](respondWithFilteredResult(_0x304d66,_0x23ea40))['catch'](handleError(_0x304d66,null));};exports[_0xafe5('0x44')]=function(_0x132dc2,_0x1493c2){var _0x3966d4={'raw':![],'where':{'id':_0x132dc2[_0xafe5('0x45')]['id']}},_0x2a0ec5={};_0x2a0ec5[_0xafe5('0x2f')]=_['keys'](db[_0xafe5('0x2c')]['rawAttributes']);_0x2a0ec5[_0xafe5('0x30')]=_['keys'](_0x132dc2[_0xafe5('0x30')]);_0x2a0ec5[_0xafe5('0x3a')]=_[_0xafe5('0x31')](_0x2a0ec5[_0xafe5('0x2f')],_0x2a0ec5[_0xafe5('0x30')]);_0x3966d4[_0xafe5('0x33')]=_[_0xafe5('0x31')](_0x2a0ec5[_0xafe5('0x2f')],qs['fields'](_0x132dc2[_0xafe5('0x30')][_0xafe5('0x32')]));_0x3966d4[_0xafe5('0x33')]=_0x3966d4['attributes'][_0xafe5('0x34')]?_0x3966d4[_0xafe5('0x33')]:_0x2a0ec5[_0xafe5('0x2f')];if(_0x132dc2['query'][_0xafe5('0x40')]){_0x3966d4[_0xafe5('0x41')]=[{'all':!![]}];}_0x3966d4=_['merge']({},_0x3966d4,_0x132dc2[_0xafe5('0x3f')]);return db['Schedule'][_0xafe5('0x46')](_0x3966d4)['then'](handleEntityNotFound(_0x1493c2,null))['then'](respondWithResult(_0x1493c2,null))['catch'](handleError(_0x1493c2,null));};exports['create']=function(_0x4d8c7c,_0x23ee56){return db[_0xafe5('0x2c')][_0xafe5('0x47')](_0x4d8c7c[_0xafe5('0x48')],{})[_0xafe5('0x25')](function(_0x2998fb){var _0x502adf=_0x4d8c7c[_0xafe5('0x49')][_0xafe5('0x4a')]({'plain':!![]});if(!_0x502adf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x502adf[_0xafe5('0x4b')]===_0xafe5('0x49')){var _0x39c46c=_0x2998fb[_0xafe5('0x4a')]({'plain':!![]});var _0x4f79b1=_0xafe5('0x26');return db['UserProfileSection'][_0xafe5('0x46')]({'where':{'name':_0x4f79b1,'userProfileId':_0x502adf[_0xafe5('0x4c')]},'raw':!![]})['then'](function(_0x46083a){if(_0x46083a&&_0x46083a['autoAssociation']===0x0){return db[_0xafe5('0x27')][_0xafe5('0x47')]({'name':_0x39c46c[_0xafe5('0x2a')],'resourceId':_0x39c46c['id'],'type':_0x46083a['name'],'sectionId':_0x46083a['id']},{})[_0xafe5('0x25')](function(){return _0x2998fb;});}else{return _0x2998fb;}})[_0xafe5('0x4d')](function(_0x1690a8){logger[_0xafe5('0x28')](_0xafe5('0x4e'),_0x1690a8);throw _0x1690a8;});}return _0x2998fb;})[_0xafe5('0x25')](respondWithResult(_0x23ee56,0xc9))[_0xafe5('0x4d')](handleError(_0x23ee56,null));};exports[_0xafe5('0x24')]=function(_0x5220a6,_0x1d975c){if(_0x5220a6[_0xafe5('0x48')]['id']){delete _0x5220a6[_0xafe5('0x48')]['id'];}return db[_0xafe5('0x2c')][_0xafe5('0x46')]({'where':{'id':_0x5220a6['params']['id']}})[_0xafe5('0x25')](handleEntityNotFound(_0x1d975c,null))[_0xafe5('0x25')](saveUpdates(_0x5220a6[_0xafe5('0x48')],null))[_0xafe5('0x25')](respondWithResult(_0x1d975c,null))[_0xafe5('0x4d')](handleError(_0x1d975c,null));};exports[_0xafe5('0x4f')]=function(_0xeac95e,_0x5b6c84){return db['Schedule'][_0xafe5('0x46')]({'where':{'id':_0xeac95e['params']['id']}})['then'](handleEntityNotFound(_0x5b6c84,null))['then'](removeEntity(_0x5b6c84,null))['catch'](handleError(_0x5b6c84,null));};exports[_0xafe5('0x50')]=function(_0x2ec1a3,_0x1844ed,_0x328c04){var _0x3871b5=require('../../config/schedule');return db[_0xafe5('0x2c')][_0xafe5('0x46')]({'where':{'id':_0x2ec1a3[_0xafe5('0x45')]['id']},'raw':!![]})[_0xafe5('0x25')](handleEntityNotFound(_0x1844ed,null))[_0xafe5('0x25')](function(){_0x3871b5[_0xafe5('0x50')](_0x2ec1a3['params']['id']);})[_0xafe5('0x25')](respondWithStatusCode(_0x1844ed,null))['catch'](handleError(_0x1844ed,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 9399621..7c19dc9 100644 --- a/server/api/schedule/schedule.model.js +++ b/server/api/schedule/schedule.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b89=['exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x11ee4f,_0x1287b5){var _0x50bd0c=function(_0x2f36f6){while(--_0x2f36f6){_0x11ee4f['push'](_0x11ee4f['shift']());}};_0x50bd0c(++_0x1287b5);}(_0x1b89,0xc7));var _0x91b8=function(_0x4f7bd5,_0x5dc0ad){_0x4f7bd5=_0x4f7bd5-0x0;var _0x4a7c11=_0x1b89[_0x4f7bd5];return _0x4a7c11;};'use strict';var _=require(_0x91b8('0x0'));var util=require(_0x91b8('0x1'));var logger=require(_0x91b8('0x2'))(_0x91b8('0x3'));var moment=require(_0x91b8('0x4'));var BPromise=require(_0x91b8('0x5'));var rp=require(_0x91b8('0x6'));var fs=require('fs');var path=require(_0x91b8('0x7'));var rimraf=require(_0x91b8('0x8'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x91b8('0x9')]=function(_0x5bd283,_0xf3fa83){return _0x5bd283[_0x91b8('0xa')](_0x91b8('0xb'),attributes,{'tableName':_0x91b8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85c8=['../../config/environment','./schedule.attributes','exports','Schedule','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85c8,0x86));var _0x885c=function(_0x45d600,_0x596cfb){_0x45d600=_0x45d600-0x0;var _0x51b3b=_0x85c8[_0x45d600];return _0x51b3b;};'use strict';var _=require(_0x885c('0x0'));var util=require(_0x885c('0x1'));var logger=require(_0x885c('0x2'))(_0x885c('0x3'));var moment=require(_0x885c('0x4'));var BPromise=require(_0x885c('0x5'));var rp=require(_0x885c('0x6'));var fs=require('fs');var path=require(_0x885c('0x7'));var rimraf=require(_0x885c('0x8'));var config=require(_0x885c('0x9'));var attributes=require(_0x885c('0xa'));module[_0x885c('0xb')]=function(_0x181182,_0x577eed){return _0x181182['define'](_0x885c('0xc'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index f721af8..c1af1c9 100644 --- a/server/api/schedule/schedule.rpc.js +++ b/server/api/schedule/schedule.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x852c=['rpc','../../config/environment','client','http','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x18b5c2,_0x3b62c2){var _0x2756b2=function(_0x530396){while(--_0x530396){_0x18b5c2['push'](_0x18b5c2['shift']());}};_0x2756b2(++_0x3b62c2);}(_0x852c,0xb5));var _0xc852=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x852c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc852('0x0'));var moment=require(_0xc852('0x1'));var BPromise=require(_0xc852('0x2'));var rs=require(_0xc852('0x3'));var fs=require('fs');var Redis=require(_0xc852('0x4'));var db=require(_0xc852('0x5'))['db'];var utils=require(_0xc852('0x6'));var logger=require(_0xc852('0x7'))(_0xc852('0x8'));var config=require(_0xc852('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc852('0xa')][_0xc852('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x129365,_0xcb8075,_0x17be45){return new BPromise(function(_0x3154ed,_0x571c1c){return client['request'](_0x129365,_0x17be45)['then'](function(_0x497d8b){logger[_0xc852('0xc')](_0xc852('0xd'),_0xcb8075,_0xc852('0xe'));logger['debug'](_0xc852('0xf'),_0xcb8075,_0xc852('0xe'),JSON[_0xc852('0x10')](_0x497d8b));if(_0x497d8b[_0xc852('0x11')]){if(_0x497d8b[_0xc852('0x11')]['code']===0x1f4){logger[_0xc852('0x11')](_0xc852('0xd'),_0xcb8075,_0x497d8b[_0xc852('0x11')][_0xc852('0x12')]);return _0x571c1c(_0x497d8b[_0xc852('0x11')][_0xc852('0x12')]);}logger[_0xc852('0x11')](_0xc852('0xd'),_0xcb8075,_0x497d8b[_0xc852('0x11')][_0xc852('0x12')]);return _0x3154ed(_0x497d8b[_0xc852('0x11')][_0xc852('0x12')]);}else{logger[_0xc852('0xc')]('Schedule,\x20%s,\x20%s',_0xcb8075,_0xc852('0xe'));_0x3154ed(_0x497d8b[_0xc852('0x13')][_0xc852('0x12')]);}})[_0xc852('0x14')](function(_0x45f1ae){logger['error'](_0xc852('0xd'),_0xcb8075,_0x45f1ae);_0x571c1c(_0x45f1ae);});});} \ No newline at end of file +var _0xb21c=['Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x4a49da,_0x3325be){var _0x41aab2=function(_0x1387de){while(--_0x1387de){_0x4a49da['push'](_0x4a49da['shift']());}};_0x41aab2(++_0x3325be);}(_0xb21c,0x6d));var _0xcb21=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0xb21c[_0x29ce14];return _0x48f289;};'use strict';var _=require(_0xcb21('0x0'));var util=require(_0xcb21('0x1'));var moment=require('moment');var BPromise=require(_0xcb21('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb21('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb21('0x4'));var logger=require(_0xcb21('0x5'))('rpc');var config=require(_0xcb21('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcb21('0x7')][_0xcb21('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x459455,_0x30474c,_0x56bc75){return new BPromise(function(_0x5e6ccf,_0x1305c1){return client[_0xcb21('0x9')](_0x459455,_0x56bc75)[_0xcb21('0xa')](function(_0x564dc2){logger['info'](_0xcb21('0xb'),_0x30474c,_0xcb21('0xc'));logger[_0xcb21('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x30474c,'request\x20sent',JSON[_0xcb21('0xe')](_0x564dc2));if(_0x564dc2['error']){if(_0x564dc2[_0xcb21('0xf')]['code']===0x1f4){logger['error'](_0xcb21('0xb'),_0x30474c,_0x564dc2[_0xcb21('0xf')]['message']);return _0x1305c1(_0x564dc2[_0xcb21('0xf')][_0xcb21('0x10')]);}logger[_0xcb21('0xf')](_0xcb21('0xb'),_0x30474c,_0x564dc2[_0xcb21('0xf')][_0xcb21('0x10')]);return _0x5e6ccf(_0x564dc2[_0xcb21('0xf')][_0xcb21('0x10')]);}else{logger[_0xcb21('0x11')]('Schedule,\x20%s,\x20%s',_0x30474c,_0xcb21('0xc'));_0x5e6ccf(_0x564dc2[_0xcb21('0x12')]['message']);}})[_0xcb21('0x13')](function(_0x48daa8){logger[_0xcb21('0xf')]('Schedule,\x20%s,\x20%s',_0x30474c,_0x48daa8);_0x1305c1(_0x48daa8);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index dd0e776..10313b5 100644 --- a/server/api/screenRecording/index.js +++ b/server/api/screenRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c9f=['/:id/download','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id','show'];(function(_0xcb6a64,_0x1aef4b){var _0x4904fc=function(_0x37d3a7){while(--_0x37d3a7){_0xcb6a64['push'](_0xcb6a64['shift']());}};_0x4904fc(++_0x1aef4b);}(_0x7c9f,0x1eb));var _0xf7c9=function(_0x1ec851,_0x5652f3){_0x1ec851=_0x1ec851-0x0;var _0x2c5f79=_0x7c9f[_0x1ec851];return _0x2c5f79;};'use strict';var multer=require(_0xf7c9('0x0'));var util=require(_0xf7c9('0x1'));var path=require(_0xf7c9('0x2'));var timeout=require(_0xf7c9('0x3'));var express=require(_0xf7c9('0x4'));var router=express[_0xf7c9('0x5')]();var fs_extra=require(_0xf7c9('0x6'));var auth=require(_0xf7c9('0x7'));var interaction=require(_0xf7c9('0x8'));var config=require(_0xf7c9('0x9'));var controller=require('./screenRecording.controller');router[_0xf7c9('0xa')]('/',auth['isAuthenticated'](),controller[_0xf7c9('0xb')]);router[_0xf7c9('0xa')]('/describe',auth[_0xf7c9('0xc')](),controller['describe']);router[_0xf7c9('0xa')](_0xf7c9('0xd'),auth[_0xf7c9('0xc')](),controller[_0xf7c9('0xe')]);router[_0xf7c9('0xa')](_0xf7c9('0xf'),auth[_0xf7c9('0xc')](),controller['download']);router[_0xf7c9('0x10')]('/',auth['isAuthenticated'](),controller[_0xf7c9('0x11')]);router[_0xf7c9('0x12')]('/:id',auth[_0xf7c9('0xc')](),controller[_0xf7c9('0x13')]);router[_0xf7c9('0x14')](_0xf7c9('0xd'),auth[_0xf7c9('0xc')](),controller['destroy']);module[_0xf7c9('0x15')]=router; \ No newline at end of file +var _0x2262=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','post','update','destroy','exports','multer','util','path'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x2262,0x66));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2226('0x0'));var util=require(_0x2226('0x1'));var path=require(_0x2226('0x2'));var timeout=require(_0x2226('0x3'));var express=require('express');var router=express[_0x2226('0x4')]();var fs_extra=require(_0x2226('0x5'));var auth=require(_0x2226('0x6'));var interaction=require(_0x2226('0x7'));var config=require(_0x2226('0x8'));var controller=require(_0x2226('0x9'));router[_0x2226('0xa')]('/',auth['isAuthenticated'](),controller[_0x2226('0xb')]);router[_0x2226('0xa')](_0x2226('0xc'),auth[_0x2226('0xd')](),controller[_0x2226('0xe')]);router[_0x2226('0xa')](_0x2226('0xf'),auth[_0x2226('0xd')](),controller['show']);router[_0x2226('0xa')](_0x2226('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x2226('0x11')]('/',auth[_0x2226('0xd')](),controller['create']);router['put'](_0x2226('0xf'),auth[_0x2226('0xd')](),controller[_0x2226('0x12')]);router['delete'](_0x2226('0xf'),auth[_0x2226('0xd')](),controller[_0x2226('0x13')]);module[_0x2226('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 551617a..3887e67 100644 --- a/server/api/screenRecording/screenRecording.attributes.js +++ b/server/api/screenRecording/screenRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8277=['exports','VIRTUAL','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','getDataValue','format','toString','MM-DD-YYYY\x20HH:mm','createdAt','moment','path'];(function(_0x97db75,_0x3abdb8){var _0x259a53=function(_0x4af802){while(--_0x4af802){_0x97db75['push'](_0x97db75['shift']());}};_0x259a53(++_0x3abdb8);}(_0x8277,0xcf));var _0x7827=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0x8277[_0x164af1];return _0x5d81a2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7827('0x0'));var path=require(_0x7827('0x1'));var config=require('../../config/environment');module[_0x7827('0x2')]={'format':{'type':Sequelize[_0x7827('0x3')],'get':function(){return this['getDataValue'](_0x7827('0x4'))?path[_0x7827('0x5')](this['getDataValue'](_0x7827('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x7827('0x6')]},'channel':{'type':Sequelize[_0x7827('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x2e9e85){var _0xbbc7df=_0x2e9e85[_0x7827('0x7')](/\\/g,'/');this[_0x7827('0x8')](_0x7827('0x4'),_0xbbc7df);}},'rating':{'type':Sequelize[_0x7827('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7827('0x9')],'set':function(_0x3d1158){this[_0x7827('0x8')](_0x7827('0xa'),moment()[_0x7827('0xb')](_0x3d1158,'ms'));this[_0x7827('0x8')](_0x7827('0xc'),moment());this[_0x7827('0x8')]('duration',_0x3d1158);}},'startedAt':{'type':Sequelize[_0x7827('0xd')],'get':function(){return moment(this[_0x7827('0xe')](_0x7827('0xa')))[_0x7827('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x7827('0x10')]();}},'closedAt':{'type':Sequelize[_0x7827('0xd')],'get':function(){return moment(this[_0x7827('0xe')](_0x7827('0xc')))[_0x7827('0xf')](_0x7827('0x11'))[_0x7827('0x10')]();}},'createdAt':{'type':Sequelize[_0x7827('0xd')],'get':function(){return moment(this[_0x7827('0xe')](_0x7827('0x12')))[_0x7827('0xf')](_0x7827('0x11'))[_0x7827('0x10')]();}},'updatedAt':{'type':Sequelize[_0x7827('0xd')],'get':function(){return moment(this[_0x7827('0xe')]('updatedAt'))[_0x7827('0xf')](_0x7827('0x11'))[_0x7827('0x10')]();}}}; \ No newline at end of file +var _0x0760=['path','getDataValue','value','extname','STRING','replace','INTEGER','startedAt','subtract','setDataValue','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','sequelize'];(function(_0x4b1b8c,_0x20557a){var _0x5a6012=function(_0x54cccc){while(--_0x54cccc){_0x4b1b8c['push'](_0x4b1b8c['shift']());}};_0x5a6012(++_0x20557a);}(_0x0760,0xa9));var _0x0076=function(_0x3cb429,_0x31d477){_0x3cb429=_0x3cb429-0x0;var _0x303568=_0x0760[_0x3cb429];return _0x303568;};'use strict';var Sequelize=require(_0x0076('0x0'));var moment=require('moment');var path=require(_0x0076('0x1'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0076('0x2')](_0x0076('0x3'))?path[_0x0076('0x4')](this[_0x0076('0x2')](_0x0076('0x3'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0076('0x5')]},'value':{'type':Sequelize[_0x0076('0x5')],'set':function(_0x1b7f29){var _0x9b8b1a=_0x1b7f29[_0x0076('0x6')](/\\/g,'/');this['setDataValue'](_0x0076('0x3'),_0x9b8b1a);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0076('0x7')],'set':function(_0x31ad28){this['setDataValue'](_0x0076('0x8'),moment()[_0x0076('0x9')](_0x31ad28,'ms'));this[_0x0076('0xa')](_0x0076('0xb'),moment());this[_0x0076('0xa')](_0x0076('0xc'),_0x31ad28);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0076('0x2')](_0x0076('0x8')))[_0x0076('0xd')](_0x0076('0xe'))[_0x0076('0xf')]();}},'closedAt':{'type':Sequelize[_0x0076('0x10')],'get':function(){return moment(this[_0x0076('0x2')](_0x0076('0xb')))[_0x0076('0xd')](_0x0076('0xe'))[_0x0076('0xf')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0076('0x2')]('createdAt'))['format'](_0x0076('0xe'))[_0x0076('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0076('0x2')]('updatedAt'))[_0x0076('0xd')](_0x0076('0xe'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index df35685..b9a5ed4 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ca=['server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','ScreenRecording','include','findAll','rows','catch','show','model','includeAll','find','create','body','duration','createdAt','closedAt','params','describe','download','uniqueid','value','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','join'];(function(_0xb18d76,_0x33a4bb){var _0x58291c=function(_0x286e21){while(--_0x286e21){_0xb18d76['push'](_0xb18d76['shift']());}};_0x58291c(++_0x33a4bb);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0x24ca[_0x4409e7];return _0x24c751;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){_0x346ee8['status'](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc9cb,_0x2365f9){return function(_0x3951ae){if(!_0x3951ae){_0x5cc9cb[_0xa24c('0x29')](0x194);}return _0x3951ae;};}function handleError(_0x51dc3f,_0x1beb55){_0x1beb55=_0x1beb55||0x1f4;return function(_0x31c4d9){logger[_0xa24c('0x2a')](_0x31c4d9[_0xa24c('0x2b')]);if(_0x31c4d9[_0xa24c('0x2c')]){delete _0x31c4d9[_0xa24c('0x2c')];}_0x51dc3f[_0xa24c('0x1b')](_0x1beb55)['send'](_0x31c4d9);};}exports[_0xa24c('0x2d')]=function(_0x28675f,_0x152120){var _0x12dbdc={},_0x5e491e={},_0x21d2a8={'count':0x0,'rows':[]};var _0xc96ce7=_[_0xa24c('0x2e')](db['ScreenRecording'][_0xa24c('0x2f')],function(_0x3dcb1b){return{'name':_0x3dcb1b[_0xa24c('0x30')],'type':_0x3dcb1b['type'][_0xa24c('0x31')]};});_0x5e491e['model']=_[_0xa24c('0x32')](_[_0xa24c('0x2e')](_0xc96ce7,_0xa24c('0x2c')),['format']);_0x5e491e[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x28675f[_0xa24c('0x33')]);_0x5e491e['filters']=_[_0xa24c('0x35')](_0x5e491e['model'],_0x5e491e[_0xa24c('0x33')]);_0x12dbdc[_0xa24c('0x36')]=_['intersection'](_0x5e491e['model'],qs[_0xa24c('0x37')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x37')]));_0x12dbdc[_0xa24c('0x36')]=_0x12dbdc[_0xa24c('0x36')][_0xa24c('0x38')]?_0x12dbdc[_0xa24c('0x36')]:_0x5e491e['model'];if(!_0x28675f[_0xa24c('0x33')][_0xa24c('0x39')](_0xa24c('0x3a'))){_0x12dbdc[_0xa24c('0x1e')]=qs[_0xa24c('0x1e')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x1e')]);_0x12dbdc[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x28675f[_0xa24c('0x33')]['offset']);}_0x12dbdc[_0xa24c('0x3b')]=qs[_0xa24c('0x3c')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x3c')]);_0x12dbdc['where']=qs['filters'](_[_0xa24c('0x3d')](_0x28675f['query'],_0x5e491e[_0xa24c('0x3e')]),_0xc96ce7);if(_0x28675f[_0xa24c('0x33')][_0xa24c('0x3f')]){_0x12dbdc[_0xa24c('0x40')]=_[_0xa24c('0x41')](_0x12dbdc['where'],{'$or':_['map'](_0xc96ce7,function(_0x3121e){if(_0x3121e[_0xa24c('0x42')]!==_0xa24c('0x43')){var _0x213dc3={};_0x213dc3[_0x3121e[_0xa24c('0x2c')]]={'$like':'%'+_0x28675f[_0xa24c('0x33')]['filter']+'%'};return _0x213dc3;}})});}_0x12dbdc=_['merge']({},_0x12dbdc,_0x28675f[_0xa24c('0x44')]);var _0x1ce83e={'where':_0x12dbdc[_0xa24c('0x40')]};return db[_0xa24c('0x45')][_0xa24c('0x20')](_0x1ce83e)['then'](function(_0x171c51){_0x21d2a8[_0xa24c('0x20')]=_0x171c51;if(_0x28675f['query']['includeAll']){_0x12dbdc[_0xa24c('0x46')]=[{'all':!![]}];}return db[_0xa24c('0x45')][_0xa24c('0x47')](_0x12dbdc);})['then'](function(_0x58ac8b){_0x21d2a8[_0xa24c('0x48')]=_0x58ac8b;return _0x21d2a8;})[_0xa24c('0x27')](respondWithFilteredResult(_0x152120,_0x12dbdc))[_0xa24c('0x49')](handleError(_0x152120,null));};exports[_0xa24c('0x4a')]=function(_0x3f640e,_0x1b7faf){var _0x23d1e0={'raw':![],'where':{'id':_0x3f640e['params']['id']}},_0x394d19={};_0x394d19['model']=_[_0xa24c('0x34')](db[_0xa24c('0x45')][_0xa24c('0x2f')]);_0x394d19['query']=_[_0xa24c('0x34')](_0x3f640e[_0xa24c('0x33')]);_0x394d19[_0xa24c('0x3e')]=_[_0xa24c('0x35')](_0x394d19[_0xa24c('0x4b')],_0x394d19[_0xa24c('0x33')]);_0x23d1e0[_0xa24c('0x36')]=_[_0xa24c('0x35')](_0x394d19[_0xa24c('0x4b')],qs[_0xa24c('0x37')](_0x3f640e['query'][_0xa24c('0x37')]));_0x23d1e0[_0xa24c('0x36')]=_0x23d1e0[_0xa24c('0x36')]['length']?_0x23d1e0[_0xa24c('0x36')]:_0x394d19[_0xa24c('0x4b')];if(_0x3f640e[_0xa24c('0x33')][_0xa24c('0x4c')]){_0x23d1e0[_0xa24c('0x46')]=[{'all':!![]}];}_0x23d1e0=_[_0xa24c('0x41')]({},_0x23d1e0,_0x3f640e[_0xa24c('0x44')]);return db[_0xa24c('0x45')][_0xa24c('0x4d')](_0x23d1e0)[_0xa24c('0x27')](handleEntityNotFound(_0x1b7faf,null))[_0xa24c('0x27')](respondWithResult(_0x1b7faf,null))['catch'](handleError(_0x1b7faf,null));};exports[_0xa24c('0x4e')]=function(_0x96b977,_0x42028b){return db[_0xa24c('0x45')][_0xa24c('0x4e')](_0x96b977[_0xa24c('0x4f')],{})[_0xa24c('0x27')](respondWithResult(_0x42028b,0xc9))[_0xa24c('0x49')](handleError(_0x42028b,null));};exports[_0xa24c('0x26')]=function(_0x4f56ae,_0x540da8){if(_0x4f56ae[_0xa24c('0x4f')]['id']){delete _0x4f56ae['body']['id'];}delete _0x4f56ae[_0xa24c('0x4f')][_0xa24c('0x50')];delete _0x4f56ae['body'][_0xa24c('0x51')];delete _0x4f56ae[_0xa24c('0x4f')][_0xa24c('0x52')];delete _0x4f56ae['body']['value'];return db[_0xa24c('0x45')]['find']({'where':{'id':_0x4f56ae[_0xa24c('0x53')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x540da8,null))[_0xa24c('0x27')](saveUpdates(_0x4f56ae[_0xa24c('0x4f')],null))[_0xa24c('0x27')](respondWithResult(_0x540da8,null))[_0xa24c('0x49')](handleError(_0x540da8,null));};exports[_0xa24c('0x54')]=function(_0x286d57,_0x22a0db){return db[_0xa24c('0x45')]['describe']()[_0xa24c('0x27')](respondWithResult(_0x22a0db,null))[_0xa24c('0x49')](handleError(_0x22a0db,null));};exports[_0xa24c('0x55')]=function(_0x513271,_0x5bde94,_0x487cc9){var _0x2da4f0=require('../../components/encryptor');var _0x4757ff=![];var _0x21d0fc={};if(_0x513271['query'][_0xa24c('0x42')]&&_0x513271[_0xa24c('0x33')][_0xa24c('0x42')]===_0xa24c('0x56')){_0x21d0fc[_0xa24c('0x56')]=_0x513271[_0xa24c('0x53')]['id'];}else{_0x21d0fc['id']=_0x513271[_0xa24c('0x53')]['id'];}return db[_0xa24c('0x45')]['find']({'where':_0x21d0fc,'attributes':['id',_0xa24c('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x5bde94,null))['then'](function(_0x565f0a){if(_0x565f0a){var _0x5bd2af=path['join'](config[_0xa24c('0x58')],'server/files/screen_recordings',_0x565f0a[_0xa24c('0x57')]);var _0x3fd3f9=util[_0xa24c('0x59')](_0xa24c('0x5a'),_0x5bd2af);if(fs[_0xa24c('0x5b')](_0x3fd3f9)){_0x4757ff=!![];return _0x2da4f0[_0xa24c('0x5c')](_0x3fd3f9,_0x5bd2af,config[_0xa24c('0x5d')][_0xa24c('0x5e')])[_0xa24c('0x27')](function(){return _0x565f0a;});}return _0x565f0a;}})[_0xa24c('0x27')](function(_0x303b7d){if(_0x303b7d){var _0x37dbbd=path[_0xa24c('0x5f')](config[_0xa24c('0x58')],_0xa24c('0x60'),_0x303b7d['value']);if(!fs[_0xa24c('0x5b')](_0x37dbbd)){throw new db[(_0xa24c('0x61'))]['ValidationError'](_0xa24c('0x62'));}if(_0x303b7d[_0xa24c('0x63')]){return _0x5bde94[_0xa24c('0x55')](_0x37dbbd,_0x303b7d[_0xa24c('0x63')]+path['extname'](_0x37dbbd),function(){if(_0x4757ff){fs['unlink'](_0x37dbbd);}});}else{return _0x5bde94[_0xa24c('0x55')](_0x37dbbd,function(_0x5e9631){if(_0x4757ff){fs['unlink'](_0x37dbbd);}});}}})[_0xa24c('0x49')](function(_0x2515b1){if(_0x2515b1[_0xa24c('0x64')]===_0xa24c('0x62')){_0x5bde94['status'](0x194)['send'](_0xa24c('0x65'));}else{return handleError(_0x5bde94,null);}});};exports['destroy']=function(_0x52a895,_0xfcc193){return db[_0xa24c('0x45')][_0xa24c('0x4d')]({'where':{'id':_0x52a895['params']['id']}})[_0xa24c('0x27')](function(_0x128e5b){if(_['isNil'](_0x128e5b)){throw new ReferenceError(_0xa24c('0x66'));}return _0x128e5b;})[_0xa24c('0x27')](function(_0x3096bf){var _0x4bee5c=path[_0xa24c('0x5f')](config[_0xa24c('0x58')],_0xa24c('0x60'),_0x3096bf[_0xa24c('0x57')]);logger[_0xa24c('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x4bee5c);if(!_[_0xa24c('0x68')](_0x3096bf[_0xa24c('0x57')])&&fs[_0xa24c('0x5b')](_0x4bee5c)){logger[_0xa24c('0x67')](_0xa24c('0x69')+_0x4bee5c+_0xa24c('0x6a'));fs[_0xa24c('0x6b')](_0x4bee5c);}_0x4bee5c=_0x4bee5c+'.cypher';if(!_[_0xa24c('0x68')](_0x3096bf[_0xa24c('0x57')])&&fs['existsSync'](_0x4bee5c)){logger[_0xa24c('0x67')](_0xa24c('0x69')+_0x4bee5c+_0xa24c('0x6a'));fs[_0xa24c('0x6b')](_0x4bee5c);}return _0x3096bf;})[_0xa24c('0x27')](function(_0x3a241a){if(!_0x3a241a)throw new InternalError();return _0x3a241a[_0xa24c('0x28')]();})[_0xa24c('0x27')](function(){_0xfcc193[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();})['catch'](handleError(_0xfcc193,null));}; \ No newline at end of file +var _0xbd50=['unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','update','duration','value','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','ValidationError','filename','extname','download','unlink','message','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x32a5f4,_0x338818){var _0x2200ef=function(_0x1d4e60){while(--_0x1d4e60){_0x32a5f4['push'](_0x32a5f4['shift']());}};_0x2200ef(++_0x338818);}(_0xbd50,0x196));var _0x0bd5=function(_0x23bcd4,_0xd3deb0){_0x23bcd4=_0x23bcd4-0x0;var _0x4cb792=_0xbd50[_0x23bcd4];return _0x4cb792;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7a0c,_0x23982f){_0x23982f=_0x23982f||0xcc;return function(_0x2f9588){if(_0x2f9588){return _0x2f7a0c[_0x0bd5('0x17')](_0x23982f);}return _0x2f7a0c[_0x0bd5('0x18')](_0x23982f)[_0x0bd5('0x19')]();};}function respondWithResult(_0x30765e,_0x1e961d){_0x1e961d=_0x1e961d||0xc8;return function(_0x4f485b){if(_0x4f485b){return _0x30765e[_0x0bd5('0x18')](_0x1e961d)[_0x0bd5('0x1a')](_0x4f485b);}};}function respondWithFilteredResult(_0x574315,_0x31349f){return function(_0x23ef4e){if(_0x23ef4e){var _0x3a34e4=typeof _0x31349f[_0x0bd5('0x1b')]==='undefined'&&typeof _0x31349f[_0x0bd5('0x1c')]===_0x0bd5('0x1d');var _0xa890be=_0x23ef4e[_0x0bd5('0x1e')];var _0x833c14=_0x3a34e4?0x0:_0x31349f[_0x0bd5('0x1b')];var _0xc58e12=_0x3a34e4?_0x23ef4e[_0x0bd5('0x1e')]:_0x31349f[_0x0bd5('0x1b')]+_0x31349f[_0x0bd5('0x1c')];var _0x27bc1e;if(_0xc58e12>=_0xa890be){_0xc58e12=_0xa890be;_0x27bc1e=0xc8;}else{_0x27bc1e=0xce;}_0x574315[_0x0bd5('0x18')](_0x27bc1e);return _0x574315[_0x0bd5('0x1f')](_0x0bd5('0x20'),_0x833c14+'-'+_0xc58e12+'/'+_0xa890be)['json'](_0x23ef4e);}return null;};}function patchUpdates(_0x5ba943){return function(_0x596b6a){try{jsonpatch['apply'](_0x596b6a,_0x5ba943,!![]);}catch(_0x47d74a){return BPromise[_0x0bd5('0x21')](_0x47d74a);}return _0x596b6a[_0x0bd5('0x22')]();};}function saveUpdates(_0x13ce46,_0x4a6910){return function(_0x6ee1a8){if(_0x6ee1a8){return _0x6ee1a8['update'](_0x13ce46)[_0x0bd5('0x23')](function(_0x3b235b){return _0x3b235b;});}return null;};}function removeEntity(_0x38c21d,_0x5a8139){return function(_0x5b6dde){if(_0x5b6dde){return _0x5b6dde['destroy']()['then'](function(){_0x38c21d[_0x0bd5('0x18')](0xcc)[_0x0bd5('0x19')]();});}};}function handleEntityNotFound(_0x184db3,_0x4fde84){return function(_0x42428c){if(!_0x42428c){_0x184db3['sendStatus'](0x194);}return _0x42428c;};}function handleError(_0x456e87,_0x3ffb08){_0x3ffb08=_0x3ffb08||0x1f4;return function(_0x18cec3){logger[_0x0bd5('0x24')](_0x18cec3[_0x0bd5('0x25')]);if(_0x18cec3[_0x0bd5('0x26')]){delete _0x18cec3[_0x0bd5('0x26')];}_0x456e87[_0x0bd5('0x18')](_0x3ffb08)[_0x0bd5('0x27')](_0x18cec3);};}exports[_0x0bd5('0x28')]=function(_0x15561b,_0xcbfc51){var _0x2e10ce={},_0x2704ee={},_0x5e5a33={'count':0x0,'rows':[]};var _0x461ae3=_[_0x0bd5('0x29')](db['ScreenRecording'][_0x0bd5('0x2a')],function(_0x8eccc9){return{'name':_0x8eccc9['fieldName'],'type':_0x8eccc9[_0x0bd5('0x2b')][_0x0bd5('0x2c')]};});_0x2704ee[_0x0bd5('0x2d')]=_[_0x0bd5('0x2e')](_['map'](_0x461ae3,_0x0bd5('0x26')),[_0x0bd5('0x2f')]);_0x2704ee[_0x0bd5('0x30')]=_[_0x0bd5('0x31')](_0x15561b[_0x0bd5('0x30')]);_0x2704ee[_0x0bd5('0x32')]=_['intersection'](_0x2704ee[_0x0bd5('0x2d')],_0x2704ee['query']);_0x2e10ce[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x2704ee[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x35')]));_0x2e10ce[_0x0bd5('0x33')]=_0x2e10ce[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x2e10ce[_0x0bd5('0x33')]:_0x2704ee[_0x0bd5('0x2d')];if(!_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x37')]('nolimit')){_0x2e10ce[_0x0bd5('0x1c')]=qs[_0x0bd5('0x1c')](_0x15561b['query']['limit']);_0x2e10ce[_0x0bd5('0x1b')]=qs[_0x0bd5('0x1b')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x1b')]);}_0x2e10ce[_0x0bd5('0x38')]=qs[_0x0bd5('0x39')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x39')]);_0x2e10ce[_0x0bd5('0x3a')]=qs[_0x0bd5('0x32')](_[_0x0bd5('0x3b')](_0x15561b[_0x0bd5('0x30')],_0x2704ee[_0x0bd5('0x32')]),_0x461ae3);if(_0x15561b['query'][_0x0bd5('0x3c')]){_0x2e10ce['where']=_[_0x0bd5('0x3d')](_0x2e10ce[_0x0bd5('0x3a')],{'$or':_[_0x0bd5('0x29')](_0x461ae3,function(_0x1fcc49){if(_0x1fcc49[_0x0bd5('0x2b')]!==_0x0bd5('0x3e')){var _0x53a682={};_0x53a682[_0x1fcc49[_0x0bd5('0x26')]]={'$like':'%'+_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x3c')]+'%'};return _0x53a682;}})});}_0x2e10ce=_[_0x0bd5('0x3d')]({},_0x2e10ce,_0x15561b[_0x0bd5('0x3f')]);var _0x493089={'where':_0x2e10ce[_0x0bd5('0x3a')]};return db[_0x0bd5('0x40')][_0x0bd5('0x1e')](_0x493089)['then'](function(_0x177aa3){_0x5e5a33['count']=_0x177aa3;if(_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x41')]){_0x2e10ce['include']=[{'all':!![]}];}return db[_0x0bd5('0x40')][_0x0bd5('0x42')](_0x2e10ce);})[_0x0bd5('0x23')](function(_0x3ec4b0){_0x5e5a33[_0x0bd5('0x43')]=_0x3ec4b0;return _0x5e5a33;})[_0x0bd5('0x23')](respondWithFilteredResult(_0xcbfc51,_0x2e10ce))[_0x0bd5('0x44')](handleError(_0xcbfc51,null));};exports['show']=function(_0x4d3ca5,_0x994f24){var _0x545b63={'raw':![],'where':{'id':_0x4d3ca5[_0x0bd5('0x45')]['id']}},_0x5dd42b={};_0x5dd42b[_0x0bd5('0x2d')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x5dd42b[_0x0bd5('0x30')]=_['keys'](_0x4d3ca5['query']);_0x5dd42b[_0x0bd5('0x32')]=_[_0x0bd5('0x34')](_0x5dd42b['model'],_0x5dd42b['query']);_0x545b63[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x5dd42b[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x4d3ca5['query'][_0x0bd5('0x35')]));_0x545b63[_0x0bd5('0x33')]=_0x545b63[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x545b63[_0x0bd5('0x33')]:_0x5dd42b[_0x0bd5('0x2d')];if(_0x4d3ca5['query'][_0x0bd5('0x41')]){_0x545b63[_0x0bd5('0x46')]=[{'all':!![]}];}_0x545b63=_[_0x0bd5('0x3d')]({},_0x545b63,_0x4d3ca5['options']);return db[_0x0bd5('0x40')][_0x0bd5('0x47')](_0x545b63)[_0x0bd5('0x23')](handleEntityNotFound(_0x994f24,null))['then'](respondWithResult(_0x994f24,null))[_0x0bd5('0x44')](handleError(_0x994f24,null));};exports[_0x0bd5('0x48')]=function(_0x54cd78,_0x18c7c7){return db[_0x0bd5('0x40')]['create'](_0x54cd78[_0x0bd5('0x49')],{})[_0x0bd5('0x23')](respondWithResult(_0x18c7c7,0xc9))['catch'](handleError(_0x18c7c7,null));};exports[_0x0bd5('0x4a')]=function(_0x20960a,_0x146bdc){if(_0x20960a[_0x0bd5('0x49')]['id']){delete _0x20960a[_0x0bd5('0x49')]['id'];}delete _0x20960a['body'][_0x0bd5('0x4b')];delete _0x20960a[_0x0bd5('0x49')]['createdAt'];delete _0x20960a[_0x0bd5('0x49')]['closedAt'];delete _0x20960a[_0x0bd5('0x49')][_0x0bd5('0x4c')];return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x20960a['params']['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x146bdc,null))['then'](saveUpdates(_0x20960a['body'],null))[_0x0bd5('0x23')](respondWithResult(_0x146bdc,null))[_0x0bd5('0x44')](handleError(_0x146bdc,null));};exports[_0x0bd5('0x4d')]=function(_0x4c9a79,_0x424187){return db['ScreenRecording'][_0x0bd5('0x4d')]()[_0x0bd5('0x23')](respondWithResult(_0x424187,null))[_0x0bd5('0x44')](handleError(_0x424187,null));};exports['download']=function(_0x512fe3,_0x4f0467,_0x122f84){var _0x21db5d=require(_0x0bd5('0x4e'));var _0x5b06c6=![];var _0x2b174a={};if(_0x512fe3[_0x0bd5('0x30')]['type']&&_0x512fe3[_0x0bd5('0x30')]['type']==='uniqueid'){_0x2b174a[_0x0bd5('0x4f')]=_0x512fe3[_0x0bd5('0x45')]['id'];}else{_0x2b174a['id']=_0x512fe3[_0x0bd5('0x45')]['id'];}return db[_0x0bd5('0x40')]['find']({'where':_0x2b174a,'attributes':['id',_0x0bd5('0x4c')],'raw':!![]})[_0x0bd5('0x23')](handleEntityNotFound(_0x4f0467,null))[_0x0bd5('0x23')](function(_0x5cf2f2){if(_0x5cf2f2){var _0x504e46=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],'server/files/screen_recordings',_0x5cf2f2['value']);var _0x2b11e8=util['format'](_0x0bd5('0x52'),_0x504e46);if(fs[_0x0bd5('0x53')](_0x2b11e8)){_0x5b06c6=!![];return _0x21db5d[_0x0bd5('0x54')](_0x2b11e8,_0x504e46,config['secrets'][_0x0bd5('0x55')])[_0x0bd5('0x23')](function(){return _0x5cf2f2;});}return _0x5cf2f2;}})[_0x0bd5('0x23')](function(_0x38aae5){if(_0x38aae5){var _0x5e93fa=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],_0x0bd5('0x56'),_0x38aae5[_0x0bd5('0x4c')]);if(!fs[_0x0bd5('0x53')](_0x5e93fa)){throw new db['Sequelize'][(_0x0bd5('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x38aae5[_0x0bd5('0x58')]){return _0x4f0467['download'](_0x5e93fa,_0x38aae5['filename']+path[_0x0bd5('0x59')](_0x5e93fa),function(){if(_0x5b06c6){fs['unlink'](_0x5e93fa);}});}else{return _0x4f0467[_0x0bd5('0x5a')](_0x5e93fa,function(_0x3087de){if(_0x5b06c6){fs[_0x0bd5('0x5b')](_0x5e93fa);}});}}})['catch'](function(_0x4f7e86){if(_0x4f7e86[_0x0bd5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x4f0467[_0x0bd5('0x18')](0x194)[_0x0bd5('0x27')]('Not\x20found');}else{return handleError(_0x4f0467,null);}});};exports[_0x0bd5('0x5d')]=function(_0x5a38b1,_0x45ccf5){return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x5a38b1[_0x0bd5('0x45')]['id']}})[_0x0bd5('0x23')](function(_0x467488){if(_[_0x0bd5('0x5e')](_0x467488)){throw new ReferenceError('Entity\x20not\x20found');}return _0x467488;})[_0x0bd5('0x23')](function(_0x1e5e7d){var _0x33c5eb=path['join'](config['root'],_0x0bd5('0x56'),_0x1e5e7d[_0x0bd5('0x4c')]);logger[_0x0bd5('0x5f')](_0x0bd5('0x60'),_0x33c5eb);if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs[_0x0bd5('0x63')](_0x33c5eb);}_0x33c5eb=_0x33c5eb+_0x0bd5('0x64');if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs['unlinkSync'](_0x33c5eb);}return _0x1e5e7d;})[_0x0bd5('0x23')](function(_0x32eaaf){if(!_0x32eaaf)throw new InternalError();return _0x32eaaf['destroy']();})[_0x0bd5('0x23')](function(){_0x45ccf5['status'](0xcc)[_0x0bd5('0x19')]();})[_0x0bd5('0x44')](handleError(_0x45ccf5,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 93537b6..91d44d7 100644 --- a/server/api/screenRecording/screenRecording.model.js +++ b/server/api/screenRecording/screenRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7a3=['ScreenRecording','interactionid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x27785b,_0x375427){var _0xb406e3=function(_0x18f05f){while(--_0x18f05f){_0x27785b['push'](_0x27785b['shift']());}};_0xb406e3(++_0x375427);}(_0xa7a3,0xc6));var _0x3a7a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa7a3[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x3a7a('0x0'));var logger=require(_0x3a7a('0x1'))(_0x3a7a('0x2'));var moment=require(_0x3a7a('0x3'));var BPromise=require(_0x3a7a('0x4'));var rp=require(_0x3a7a('0x5'));var fs=require('fs');var path=require(_0x3a7a('0x6'));var rimraf=require(_0x3a7a('0x7'));var config=require(_0x3a7a('0x8'));var attributes=require(_0x3a7a('0x9'));module[_0x3a7a('0xa')]=function(_0x57e2e5,_0x41ce47){return _0x57e2e5[_0x3a7a('0xb')](_0x3a7a('0xc'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x3a7a('0xd'),'fields':[_0x3a7a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9013=['path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b5199,_0x58a8e5){var _0x2f5736=function(_0x1f35ce){while(--_0x1f35ce){_0x5b5199['push'](_0x5b5199['shift']());}};_0x2f5736(++_0x58a8e5);}(_0x9013,0x1ad));var _0x3901=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9013[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x3901('0x0'));var util=require('util');var logger=require(_0x3901('0x1'))(_0x3901('0x2'));var moment=require(_0x3901('0x3'));var BPromise=require(_0x3901('0x4'));var rp=require(_0x3901('0x5'));var fs=require('fs');var path=require(_0x3901('0x6'));var rimraf=require(_0x3901('0x7'));var config=require(_0x3901('0x8'));var attributes=require(_0x3901('0x9'));module[_0x3901('0xa')]=function(_0x57d250,_0x47b04f){return _0x57d250[_0x3901('0xb')](_0x3901('0xc'),attributes,{'tableName':_0x3901('0xd'),'paranoid':![],'indexes':[{'name':_0x3901('0xe'),'fields':[_0x3901('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 29a2599..4b024b0 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0ed=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x4f7a69,_0x3d7130){var _0x3bc04d=function(_0x190158){while(--_0x190158){_0x4f7a69['push'](_0x4f7a69['shift']());}};_0x3bc04d(++_0x3d7130);}(_0xc0ed,0x1e3));var _0xdc0e=function(_0x38366c,_0x277bcc){_0x38366c=_0x38366c-0x0;var _0x2566b2=_0xc0ed[_0x38366c];return _0x2566b2;};'use strict';var _=require(_0xdc0e('0x0'));var util=require('util');var moment=require(_0xdc0e('0x1'));var BPromise=require(_0xdc0e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc0e('0x3'));var db=require(_0xdc0e('0x4'))['db'];var utils=require(_0xdc0e('0x5'));var logger=require(_0xdc0e('0x6'))(_0xdc0e('0x7'));var config=require(_0xdc0e('0x8'));var jayson=require(_0xdc0e('0x9'));var client=jayson['client'][_0xdc0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x403444,_0x4e5d81,_0x1c703d){return new BPromise(function(_0x2419c9,_0x2e43c2){return client['request'](_0x403444,_0x1c703d)[_0xdc0e('0xb')](function(_0xfa1496){logger[_0xdc0e('0xc')](_0xdc0e('0xd'),_0x4e5d81,_0xdc0e('0xe'));logger[_0xdc0e('0xf')](_0xdc0e('0x10'),_0x4e5d81,_0xdc0e('0xe'),JSON['stringify'](_0xfa1496));if(_0xfa1496[_0xdc0e('0x11')]){if(_0xfa1496[_0xdc0e('0x11')]['code']===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4e5d81,_0xfa1496[_0xdc0e('0x11')]['message']);return _0x2e43c2(_0xfa1496[_0xdc0e('0x11')][_0xdc0e('0x12')]);}logger[_0xdc0e('0x11')](_0xdc0e('0xd'),_0x4e5d81,_0xfa1496[_0xdc0e('0x11')][_0xdc0e('0x12')]);return _0x2419c9(_0xfa1496[_0xdc0e('0x11')][_0xdc0e('0x12')]);}else{logger[_0xdc0e('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x4e5d81,_0xdc0e('0xe'));_0x2419c9(_0xfa1496[_0xdc0e('0x13')]['message']);}})[_0xdc0e('0x14')](function(_0x1fa471){logger[_0xdc0e('0x11')](_0xdc0e('0xd'),_0x4e5d81,_0x1fa471);_0x2e43c2(_0x1fa471);});});} \ No newline at end of file +var _0xcdf6=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0xcdf6,0xe9));var _0x6cdf=function(_0x273e55,_0x3df4b2){_0x273e55=_0x273e55-0x0;var _0x23b8fa=_0xcdf6[_0x273e55];return _0x23b8fa;};'use strict';var _=require(_0x6cdf('0x0'));var util=require(_0x6cdf('0x1'));var moment=require('moment');var BPromise=require(_0x6cdf('0x2'));var rs=require(_0x6cdf('0x3'));var fs=require('fs');var Redis=require(_0x6cdf('0x4'));var db=require(_0x6cdf('0x5'))['db'];var utils=require(_0x6cdf('0x6'));var logger=require(_0x6cdf('0x7'))(_0x6cdf('0x8'));var config=require(_0x6cdf('0x9'));var jayson=require(_0x6cdf('0xa'));var client=jayson[_0x6cdf('0xb')][_0x6cdf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ea7b2,_0xca05ee,_0x59b2fd){return new BPromise(function(_0xa6320,_0xf5d32c){return client[_0x6cdf('0xd')](_0x5ea7b2,_0x59b2fd)['then'](function(_0x2104b3){logger['info'](_0x6cdf('0xe'),_0xca05ee,_0x6cdf('0xf'));logger[_0x6cdf('0x10')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0xca05ee,_0x6cdf('0xf'),JSON[_0x6cdf('0x11')](_0x2104b3));if(_0x2104b3[_0x6cdf('0x12')]){if(_0x2104b3[_0x6cdf('0x12')][_0x6cdf('0x13')]===0x1f4){logger[_0x6cdf('0x12')](_0x6cdf('0xe'),_0xca05ee,_0x2104b3[_0x6cdf('0x12')]['message']);return _0xf5d32c(_0x2104b3['error']['message']);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0xca05ee,_0x2104b3['error']['message']);return _0xa6320(_0x2104b3[_0x6cdf('0x12')][_0x6cdf('0x14')]);}else{logger['info'](_0x6cdf('0xe'),_0xca05ee,_0x6cdf('0xf'));_0xa6320(_0x2104b3[_0x6cdf('0x15')][_0x6cdf('0x14')]);}})[_0x6cdf('0x16')](function(_0xcbbf54){logger[_0x6cdf('0x12')](_0x6cdf('0xe'),_0xca05ee,_0xcbbf54);_0xf5d32c(_0xcbbf54);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index c2096eb..6ee06a7 100644 --- a/server/api/setting/index.js +++ b/server/api/setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc138=['../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','/:id/preferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','extname','post','single','file','logologin','originalname','addLogoLogin','preferred','addPreferred','addFavicon','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x265544,_0x5ea72a){var _0x209885=function(_0x230458){while(--_0x230458){_0x265544['push'](_0x265544['shift']());}};_0x209885(++_0x5ea72a);}(_0xc138,0x1bc));var _0x8c13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc138[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8c13('0x0'));var util=require('util');var path=require(_0x8c13('0x1'));var timeout=require(_0x8c13('0x2'));var express=require(_0x8c13('0x3'));var router=express[_0x8c13('0x4')]();var fs_extra=require(_0x8c13('0x5'));var auth=require(_0x8c13('0x6'));var interaction=require(_0x8c13('0x7'));var config=require(_0x8c13('0x8'));var controller=require(_0x8c13('0x9'));router[_0x8c13('0xa')]('/',auth[_0x8c13('0xb')](),controller[_0x8c13('0xc')]);router[_0x8c13('0xa')]('/now',controller[_0x8c13('0xd')]);router[_0x8c13('0xa')](_0x8c13('0xe'),controller[_0x8c13('0xf')]);router[_0x8c13('0xa')](_0x8c13('0x10'),controller[_0x8c13('0x11')]);router[_0x8c13('0xa')](_0x8c13('0x12'),controller['getLogoLogin']);router[_0x8c13('0xa')](_0x8c13('0x13'),controller['gdpr']);router[_0x8c13('0xa')](_0x8c13('0x14'),controller['getPreferred']);router[_0x8c13('0xa')](_0x8c13('0x15'),controller[_0x8c13('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb4524d,_0x19de39,_0x34c7a1){_0x34c7a1(null,path[_0x8c13('0x17')](config[_0x8c13('0x18')],_0x8c13('0x19')));},'filename':function(_0x599aa5,_0x5a08d4,_0x5027ad){_0x5027ad(null,util[_0x8c13('0x1a')](_0x8c13('0x1b'),'logo',path[_0x8c13('0x1c')](_0x5a08d4['originalname'])));}})});router[_0x8c13('0x1d')](_0x8c13('0x10'),upload[_0x8c13('0x1e')](_0x8c13('0x1f')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5af912,_0x213979,_0x547807){_0x547807(null,path[_0x8c13('0x17')](config[_0x8c13('0x18')],_0x8c13('0x19')));},'filename':function(_0x187f66,_0x3e6b67,_0x5d6974){_0x5d6974(null,util['format'](_0x8c13('0x1b'),_0x8c13('0x20'),path[_0x8c13('0x1c')](_0x3e6b67[_0x8c13('0x21')])));}})});router[_0x8c13('0x1d')](_0x8c13('0x12'),upload[_0x8c13('0x1e')](_0x8c13('0x1f')),controller[_0x8c13('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2cb2cf,_0x4b91c0,_0x1b22c3){_0x1b22c3(null,path[_0x8c13('0x17')](config[_0x8c13('0x18')],_0x8c13('0x19')));},'filename':function(_0x5557fb,_0x52350d,_0x132183){_0x132183(null,util['format'](_0x8c13('0x1b'),_0x8c13('0x23'),path[_0x8c13('0x1c')](_0x52350d[_0x8c13('0x21')])));}})});router[_0x8c13('0x1d')](_0x8c13('0x14'),upload[_0x8c13('0x1e')](_0x8c13('0x1f')),controller[_0x8c13('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b4161,_0x32d952,_0xa91f7){_0xa91f7(null,path[_0x8c13('0x17')](config[_0x8c13('0x18')],_0x8c13('0x19')));},'filename':function(_0x5c4a9a,_0x4a1558,_0x47757a){_0x47757a(null,util[_0x8c13('0x1a')]('%s%s','favicon',path[_0x8c13('0x1c')](_0x4a1558['originalname'])));}})});router[_0x8c13('0x1d')](_0x8c13('0x15'),upload[_0x8c13('0x1e')]('file'),controller[_0x8c13('0x25')]);router[_0x8c13('0x26')](_0x8c13('0xe'),auth['isAuthenticated'](),controller[_0x8c13('0x27')]);module[_0x8c13('0x28')]=router; \ No newline at end of file +var _0x0538=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','%s%s','logo','extname','originalname','post','/:id/logo','single','file','join','server/files/images/logos/','format','logologin','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','exports','util','path','connect-timeout','express'];(function(_0x38f0ae,_0x1234e0){var _0x32b720=function(_0x23e64f){while(--_0x23e64f){_0x38f0ae['push'](_0x38f0ae['shift']());}};_0x32b720(++_0x1234e0);}(_0x0538,0x1aa));var _0x8053=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x0538[_0x4c8a8f];return _0x404500;};'use strict';var multer=require('multer');var util=require(_0x8053('0x0'));var path=require(_0x8053('0x1'));var timeout=require(_0x8053('0x2'));var express=require(_0x8053('0x3'));var router=express[_0x8053('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8053('0x5'));var interaction=require(_0x8053('0x6'));var config=require(_0x8053('0x7'));var controller=require(_0x8053('0x8'));router[_0x8053('0x9')]('/',auth[_0x8053('0xa')](),controller[_0x8053('0xb')]);router[_0x8053('0x9')]('/now',controller['getDate']);router['get'](_0x8053('0xc'),controller[_0x8053('0xd')]);router['get']('/:id/logo',controller[_0x8053('0xe')]);router['get'](_0x8053('0xf'),controller['getLogoLogin']);router[_0x8053('0x9')](_0x8053('0x10'),controller[_0x8053('0x11')]);router[_0x8053('0x9')](_0x8053('0x12'),controller[_0x8053('0x13')]);router['get'](_0x8053('0x14'),controller[_0x8053('0x15')]);var upload=multer({'storage':multer[_0x8053('0x16')]({'destination':function(_0x2cab15,_0x1be7d2,_0x343982){_0x343982(null,path['join'](config[_0x8053('0x17')],'server/files/images/logos/'));},'filename':function(_0x12438c,_0x27f568,_0x2504bb){_0x2504bb(null,util['format'](_0x8053('0x18'),_0x8053('0x19'),path[_0x8053('0x1a')](_0x27f568[_0x8053('0x1b')])));}})});router[_0x8053('0x1c')](_0x8053('0x1d'),upload[_0x8053('0x1e')](_0x8053('0x1f')),controller['addLogo']);var upload=multer({'storage':multer[_0x8053('0x16')]({'destination':function(_0x20d7da,_0xd0cfba,_0x342c2e){_0x342c2e(null,path[_0x8053('0x20')](config[_0x8053('0x17')],_0x8053('0x21')));},'filename':function(_0x4861cf,_0x34fb16,_0xe47f94){_0xe47f94(null,util[_0x8053('0x22')](_0x8053('0x18'),_0x8053('0x23'),path[_0x8053('0x1a')](_0x34fb16['originalname'])));}})});router[_0x8053('0x1c')](_0x8053('0xf'),upload[_0x8053('0x1e')](_0x8053('0x1f')),controller[_0x8053('0x24')]);var upload=multer({'storage':multer[_0x8053('0x16')]({'destination':function(_0x32b328,_0xa4861f,_0x398c49){_0x398c49(null,path[_0x8053('0x20')](config[_0x8053('0x17')],_0x8053('0x21')));},'filename':function(_0x92a55,_0x3d0452,_0x54a8cd){_0x54a8cd(null,util[_0x8053('0x22')](_0x8053('0x18'),_0x8053('0x25'),path[_0x8053('0x1a')](_0x3d0452[_0x8053('0x1b')])));}})});router[_0x8053('0x1c')](_0x8053('0x12'),upload[_0x8053('0x1e')](_0x8053('0x1f')),controller[_0x8053('0x26')]);var upload=multer({'storage':multer[_0x8053('0x16')]({'destination':function(_0x35b9d9,_0x45d6ce,_0x5b1654){_0x5b1654(null,path[_0x8053('0x20')](config[_0x8053('0x17')],'server/files/images/logos/'));},'filename':function(_0x431f7a,_0x312eb4,_0xcf5b2e){_0xcf5b2e(null,util[_0x8053('0x22')](_0x8053('0x18'),_0x8053('0x27'),path[_0x8053('0x1a')](_0x312eb4[_0x8053('0x1b')])));}})});router[_0x8053('0x1c')](_0x8053('0x14'),upload[_0x8053('0x1e')](_0x8053('0x1f')),controller[_0x8053('0x28')]);router[_0x8053('0x29')](_0x8053('0xc'),auth[_0x8053('0xa')](),controller['update']);module[_0x8053('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index b7635a7..dabb75f 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x24d26b,_0x15dfbd){var _0x272ac8=function(_0x409cce){while(--_0x409cce){_0x24d26b['push'](_0x24d26b['shift']());}};_0x272ac8(++_0x15dfbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x407869,_0x2bc3b3){var _0x3047d2=function(_0x11768f){while(--_0x11768f){_0x407869['push'](_0x407869['shift']());}};_0x3047d2(++_0x2bc3b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index e9668d7..ccd322b 100644 --- a/server/api/setting/setting.controller.js +++ b/server/api/setting/setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d4e=['pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','find','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','defaultLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','getLogoLogin','preferred','defaultLoginLogo','defaultFavicon','gdpr','securePassword','getPreferred','favicon','default_preferred.png','\x20not\x20found','download','addFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','jayson/promise','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','update','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x6d4e,0x12e));var _0xe6d4=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x6d4e[_0x16eb11];return _0x3ae7ef;};'use strict';var emlformat=require(_0xe6d4('0x0'));var rimraf=require(_0xe6d4('0x1'));var zipdir=require(_0xe6d4('0x2'));var jsonpatch=require(_0xe6d4('0x3'));var rp=require(_0xe6d4('0x4'));var moment=require(_0xe6d4('0x5'));var BPromise=require(_0xe6d4('0x6'));var Mustache=require(_0xe6d4('0x7'));var util=require(_0xe6d4('0x8'));var path=require(_0xe6d4('0x9'));var sox=require(_0xe6d4('0xa'));var csv=require('to-csv');var ejs=require(_0xe6d4('0xb'));var fs=require('fs');var fs_extra=require(_0xe6d4('0xc'));var _=require('lodash');var squel=require(_0xe6d4('0xd'));var crypto=require(_0xe6d4('0xe'));var jsforce=require(_0xe6d4('0xf'));var deskjs=require(_0xe6d4('0x10'));var toCsv=require(_0xe6d4('0x11'));var querystring=require(_0xe6d4('0x12'));var Papa=require(_0xe6d4('0x13'));var Redis=require(_0xe6d4('0x14'));var authService=require(_0xe6d4('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xe6d4('0x16'));var hardwareService=require(_0xe6d4('0x17'));var logger=require(_0xe6d4('0x18'))(_0xe6d4('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe6d4('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xe6d4('0x1b'));var client=jayson['client'][_0xe6d4('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x37d9f5,_0x64ce7d,_0x3eefc7,_0x45a10e){return new BPromise(function(_0x704b9b,_0x251295){var _0x21348f=_0x45a10e||client;return _0x21348f[_0xe6d4('0x1d')](_0x37d9f5,_0x3eefc7)[_0xe6d4('0x1e')](function(_0x1121da){logger['info'](_0xe6d4('0x1f'),_0x64ce7d,_0xe6d4('0x20'));logger[_0xe6d4('0x21')](_0xe6d4('0x22'),_0x64ce7d,_0xe6d4('0x20'),JSON[_0xe6d4('0x23')](_0x1121da));if(_0x1121da[_0xe6d4('0x24')]){if(_0x1121da[_0xe6d4('0x24')][_0xe6d4('0x25')]===0x1f4){logger[_0xe6d4('0x24')](_0xe6d4('0x1f'),_0x64ce7d,_0x1121da[_0xe6d4('0x24')][_0xe6d4('0x26')]);return _0x251295(_0x1121da[_0xe6d4('0x24')][_0xe6d4('0x26')]);}logger[_0xe6d4('0x24')]('Setting,\x20%s,\x20%s',_0x64ce7d,_0x1121da[_0xe6d4('0x24')][_0xe6d4('0x26')]);return _0x704b9b(_0x1121da['error'][_0xe6d4('0x26')]);}else{logger[_0xe6d4('0x27')](_0xe6d4('0x1f'),_0x64ce7d,_0xe6d4('0x20'));_0x704b9b(_0x1121da[_0xe6d4('0x28')][_0xe6d4('0x26')]);}})[_0xe6d4('0x29')](function(_0x27f293){logger[_0xe6d4('0x24')](_0xe6d4('0x1f'),_0x64ce7d,_0x27f293);_0x251295(_0x27f293);});});}function respondWithStatusCode(_0x30e33e,_0x1b6210){_0x1b6210=_0x1b6210||0xcc;return function(_0x4e4735){if(_0x4e4735){return _0x30e33e[_0xe6d4('0x2a')](_0x1b6210);}return _0x30e33e[_0xe6d4('0x2b')](_0x1b6210)[_0xe6d4('0x2c')]();};}function respondWithResult(_0xad2aaa,_0x2f0022){_0x2f0022=_0x2f0022||0xc8;return function(_0x2a6f84){if(_0x2a6f84){return _0xad2aaa['status'](_0x2f0022)[_0xe6d4('0x2d')](_0x2a6f84);}};}function respondWithFilteredResult(_0xcc23e1,_0x5b8770){return function(_0x1c41cb){if(_0x1c41cb){var _0x221942=typeof _0x5b8770['offset']==='undefined'&&typeof _0x5b8770[_0xe6d4('0x2e')]==='undefined';var _0x499d9b=_0x1c41cb[_0xe6d4('0x2f')];var _0x3899ad=_0x221942?0x0:_0x5b8770[_0xe6d4('0x30')];var _0x4deb93=_0x221942?_0x1c41cb[_0xe6d4('0x2f')]:_0x5b8770['offset']+_0x5b8770[_0xe6d4('0x2e')];var _0x1db4f2;if(_0x4deb93>=_0x499d9b){_0x4deb93=_0x499d9b;_0x1db4f2=0xc8;}else{_0x1db4f2=0xce;}_0xcc23e1['status'](_0x1db4f2);return _0xcc23e1[_0xe6d4('0x31')](_0xe6d4('0x32'),_0x3899ad+'-'+_0x4deb93+'/'+_0x499d9b)['json'](_0x1c41cb);}return null;};}function patchUpdates(_0x348713){return function(_0x444bd1){try{jsonpatch[_0xe6d4('0x33')](_0x444bd1,_0x348713,!![]);}catch(_0x52366e){return BPromise['reject'](_0x52366e);}return _0x444bd1['save']();};}function saveUpdates(_0x919869,_0x197a58){return function(_0x274f6b){if(_0x274f6b){return _0x274f6b[_0xe6d4('0x34')](_0x919869)[_0xe6d4('0x1e')](function(_0x2094b9){return _0x2094b9;});}return null;};}function removeEntity(_0x4749ba,_0x1cd9c9){return function(_0x43896f){if(_0x43896f){return _0x43896f['destroy']()[_0xe6d4('0x1e')](function(){_0x4749ba[_0xe6d4('0x2b')](0xcc)[_0xe6d4('0x2c')]();});}};}function handleEntityNotFound(_0x58e447,_0x14c566){return function(_0x7af90c){if(!_0x7af90c){_0x58e447['sendStatus'](0x194);}return _0x7af90c;};}function handleError(_0x2cb484,_0x34bf8c){_0x34bf8c=_0x34bf8c||0x1f4;return function(_0x4ddd35){logger['error'](_0x4ddd35[_0xe6d4('0x35')]);if(_0x4ddd35[_0xe6d4('0x36')]){delete _0x4ddd35[_0xe6d4('0x36')];}_0x2cb484['status'](_0x34bf8c)[_0xe6d4('0x37')](_0x4ddd35);};}exports[_0xe6d4('0x38')]=function(_0x45b998,_0x2f1229){var _0x1fb010={},_0x1a673a={},_0xad34bb={'count':0x0,'rows':[]};var _0x435167=_[_0xe6d4('0x39')](db[_0xe6d4('0x3a')][_0xe6d4('0x3b')],function(_0x41b1ab){return{'name':_0x41b1ab[_0xe6d4('0x3c')],'type':_0x41b1ab[_0xe6d4('0x3d')][_0xe6d4('0x3e')]};});_0x1a673a[_0xe6d4('0x3f')]=_[_0xe6d4('0x39')](_0x435167,_0xe6d4('0x36'));_0x1a673a[_0xe6d4('0x40')]=_['keys'](_0x45b998[_0xe6d4('0x40')]);_0x1a673a['filters']=_['intersection'](_0x1a673a[_0xe6d4('0x3f')],_0x1a673a[_0xe6d4('0x40')]);_0x1fb010[_0xe6d4('0x41')]=_[_0xe6d4('0x42')](_0x1a673a[_0xe6d4('0x3f')],qs[_0xe6d4('0x43')](_0x45b998['query'][_0xe6d4('0x43')]));_0x1fb010[_0xe6d4('0x41')]=_0x1fb010['attributes']['length']?_0x1fb010[_0xe6d4('0x41')]:_0x1a673a[_0xe6d4('0x3f')];if(!_0x45b998[_0xe6d4('0x40')][_0xe6d4('0x44')](_0xe6d4('0x45'))){_0x1fb010[_0xe6d4('0x2e')]=qs[_0xe6d4('0x2e')](_0x45b998['query'][_0xe6d4('0x2e')]);_0x1fb010[_0xe6d4('0x30')]=qs['offset'](_0x45b998[_0xe6d4('0x40')][_0xe6d4('0x30')]);}_0x1fb010[_0xe6d4('0x46')]=qs[_0xe6d4('0x47')](_0x45b998[_0xe6d4('0x40')][_0xe6d4('0x47')]);_0x1fb010['where']=qs[_0xe6d4('0x48')](_[_0xe6d4('0x49')](_0x45b998[_0xe6d4('0x40')],_0x1a673a[_0xe6d4('0x48')]),_0x435167);if(_0x45b998[_0xe6d4('0x40')][_0xe6d4('0x4a')]){_0x1fb010[_0xe6d4('0x4b')]=_['merge'](_0x1fb010['where'],{'$or':_[_0xe6d4('0x39')](_0x435167,function(_0x2e0713){if(_0x2e0713[_0xe6d4('0x3d')]!==_0xe6d4('0x4c')){var _0x78386={};_0x78386[_0x2e0713[_0xe6d4('0x36')]]={'$like':'%'+_0x45b998[_0xe6d4('0x40')][_0xe6d4('0x4a')]+'%'};return _0x78386;}})});}_0x1fb010=_[_0xe6d4('0x4d')]({},_0x1fb010,_0x45b998[_0xe6d4('0x4e')]);var _0x223477={'where':_0x1fb010[_0xe6d4('0x4b')]};return db[_0xe6d4('0x3a')]['count'](_0x223477)[_0xe6d4('0x1e')](function(_0x415563){_0xad34bb[_0xe6d4('0x2f')]=_0x415563;if(_0x45b998[_0xe6d4('0x40')][_0xe6d4('0x4f')]){_0x1fb010[_0xe6d4('0x50')]=[{'all':!![]}];}return db[_0xe6d4('0x3a')][_0xe6d4('0x51')](_0x1fb010);})[_0xe6d4('0x1e')](function(_0x55089f){_0xad34bb['rows']=_0x55089f;return _0xad34bb;})['then'](respondWithFilteredResult(_0x2f1229,_0x1fb010))[_0xe6d4('0x29')](handleError(_0x2f1229,null));};exports[_0xe6d4('0x52')]=function(_0xb86c60,_0xac6817){var _0xd9f646={'raw':![],'where':{'id':_0xb86c60[_0xe6d4('0x53')]['id']}},_0xd0f584={};_0xd0f584['model']=_[_0xe6d4('0x54')](db['Setting']['rawAttributes']);_0xd0f584['query']=_[_0xe6d4('0x54')](_0xb86c60[_0xe6d4('0x40')]);_0xd0f584[_0xe6d4('0x48')]=_[_0xe6d4('0x42')](_0xd0f584['model'],_0xd0f584[_0xe6d4('0x40')]);_0xd9f646[_0xe6d4('0x41')]=_[_0xe6d4('0x42')](_0xd0f584[_0xe6d4('0x3f')],qs['fields'](_0xb86c60[_0xe6d4('0x40')][_0xe6d4('0x43')]));_0xd9f646[_0xe6d4('0x41')]=_0xd9f646[_0xe6d4('0x41')]['length']?_0xd9f646[_0xe6d4('0x41')]:_0xd0f584[_0xe6d4('0x3f')];if(_0xb86c60[_0xe6d4('0x40')][_0xe6d4('0x4f')]){_0xd9f646['include']=[{'all':!![]}];}_0xd9f646=_[_0xe6d4('0x4d')]({},_0xd9f646,_0xb86c60[_0xe6d4('0x4e')]);return db['Setting'][_0xe6d4('0x55')](_0xd9f646)[_0xe6d4('0x1e')](handleEntityNotFound(_0xac6817,null))['then'](respondWithResult(_0xac6817,null))['catch'](handleError(_0xac6817,null));};exports[_0xe6d4('0x34')]=function(_0x434d71,_0x4707c6){if(_0x434d71[_0xe6d4('0x56')]['id']){delete _0x434d71[_0xe6d4('0x56')]['id'];}return db['Setting']['find']({'where':{'id':_0x434d71[_0xe6d4('0x53')]['id']}})[_0xe6d4('0x1e')](handleEntityNotFound(_0x4707c6,null))[_0xe6d4('0x1e')](saveUpdates(_0x434d71[_0xe6d4('0x56')],null))[_0xe6d4('0x1e')](respondWithResult(_0x4707c6,null))[_0xe6d4('0x29')](handleError(_0x4707c6,null));};exports[_0xe6d4('0x57')]=function(_0x509da9,_0x5d84cb,_0x10e253){if(_0x509da9[_0xe6d4('0x58')]&&_0x509da9[_0xe6d4('0x58')]['filename']){_0x509da9[_0xe6d4('0x56')][_0xe6d4('0x59')]=_0x509da9[_0xe6d4('0x58')][_0xe6d4('0x5a')];}return db['Setting'][_0xe6d4('0x55')]({'where':{'id':_0x509da9['params']['id']}})[_0xe6d4('0x1e')](handleEntityNotFound(_0x5d84cb,null))[_0xe6d4('0x1e')](saveUpdates(_0x509da9[_0xe6d4('0x56')],null))[_0xe6d4('0x1e')](respondWithResult(_0x5d84cb,null))['catch'](handleError(_0x5d84cb,null));};exports[_0xe6d4('0x5b')]=function(_0x27ed64,_0x4492f3,_0x18a2a3){if(_0x27ed64['file']&&_0x27ed64['file'][_0xe6d4('0x5a')]){_0x27ed64['body'][_0xe6d4('0x5c')]=_0x27ed64['file']['filename'];}return db[_0xe6d4('0x3a')][_0xe6d4('0x55')]({'where':{'id':_0x27ed64[_0xe6d4('0x53')]['id']}})[_0xe6d4('0x1e')](handleEntityNotFound(_0x4492f3,null))[_0xe6d4('0x1e')](saveUpdates(_0x27ed64[_0xe6d4('0x56')],null))[_0xe6d4('0x1e')](respondWithResult(_0x4492f3,null))[_0xe6d4('0x29')](handleError(_0x4492f3,null));};var utilLicense=require(_0xe6d4('0x1a'));exports[_0xe6d4('0x5d')]=function(_0x27b54f,_0x2466dc,_0xaaf422){var _0x395793=_0xe6d4('0x5e');var _0x4242ac={'custom':![]};return utilLicense[_0xe6d4('0x5f')]()['then'](function(_0x273dc6){if(_0x273dc6){_0x4242ac=_0x273dc6;}return db[_0xe6d4('0x3a')][_0xe6d4('0x55')]({'where':{'id':_0x27b54f[_0xe6d4('0x53')]['id']},'attributes':[_0xe6d4('0x59'),_0xe6d4('0x5c'),'preferred','favicon',_0xe6d4('0x60'),'defaultLoginLogo',_0xe6d4('0x61'),'defaultFavicon'],'raw':!![]});})[_0xe6d4('0x1e')](handleEntityNotFound(_0x2466dc,null))[_0xe6d4('0x1e')](function(_0x199095){if(_0x199095){var _0x239131=_0x199095[_0xe6d4('0x59')]&&fs[_0xe6d4('0x62')](path[_0xe6d4('0x63')](config[_0xe6d4('0x64')],_0x395793,_[_0xe6d4('0x65')](_0x199095[_0xe6d4('0x59')])))?path[_0xe6d4('0x63')](config['root'],_0x395793,_[_0xe6d4('0x65')](_0x199095[_0xe6d4('0x59')])):path['join'](config[_0xe6d4('0x64')],_0x395793,_[_0xe6d4('0x65')](_0xe6d4('0x66')));var _0xe33b14=_0xe6d4('0x67')+_['upperFirst']('logo');if(_0x199095[_0xe33b14]||!_0x4242ac[_0xe6d4('0x68')]){_0x239131=path[_0xe6d4('0x63')](config['root'],_0x395793,_[_0xe6d4('0x65')]('default_logo.svg'));}if(!fs[_0xe6d4('0x62')](_0x239131)){throw new db[(_0xe6d4('0x69'))][(_0xe6d4('0x6a'))](_[_0xe6d4('0x6b')](_0xe6d4('0x59'))+'\x20not\x20found');}return _0x2466dc['download'](_0x239131);}})['catch'](handleError(_0x2466dc,null));};var utilLicense=require('../../config/license/util');exports[_0xe6d4('0x6c')]=function(_0x2759c7,_0x1aad5a,_0x318196){var _0x549616='server/files/images/logos';var _0x57b7c9={'custom':![]};return utilLicense[_0xe6d4('0x5f')]()['then'](function(_0x10db00){if(_0x10db00){_0x57b7c9=_0x10db00;}return db['Setting'][_0xe6d4('0x55')]({'where':{'id':_0x2759c7[_0xe6d4('0x53')]['id']},'attributes':[_0xe6d4('0x59'),'loginLogo',_0xe6d4('0x6d'),'favicon',_0xe6d4('0x60'),_0xe6d4('0x6e'),_0xe6d4('0x61'),_0xe6d4('0x6f')],'raw':!![]});})[_0xe6d4('0x1e')](handleEntityNotFound(_0x1aad5a,null))[_0xe6d4('0x1e')](function(_0x59b455){if(_0x59b455){var _0x1f8a3c=_0x59b455[_0xe6d4('0x5c')]&&fs['existsSync'](path[_0xe6d4('0x63')](config[_0xe6d4('0x64')],_0x549616,_[_0xe6d4('0x65')](_0x59b455[_0xe6d4('0x5c')])))?path[_0xe6d4('0x63')](config[_0xe6d4('0x64')],_0x549616,_['toLower'](_0x59b455[_0xe6d4('0x5c')])):path[_0xe6d4('0x63')](config[_0xe6d4('0x64')],_0x549616,_['toLower']('default_loginLogo.svg'));var _0x24c7ef='default'+_[_0xe6d4('0x6b')](_0xe6d4('0x5c'));if(_0x59b455[_0x24c7ef]||!_0x57b7c9[_0xe6d4('0x68')]){_0x1f8a3c=path[_0xe6d4('0x63')](config['root'],_0x549616,_[_0xe6d4('0x65')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x1f8a3c)){throw new db[(_0xe6d4('0x69'))][(_0xe6d4('0x6a'))](_['upperFirst'](_0xe6d4('0x5c'))+'\x20not\x20found');}return _0x1aad5a['download'](_0x1f8a3c);}})[_0xe6d4('0x29')](handleError(_0x1aad5a,null));};exports[_0xe6d4('0x70')]=function(_0x13af10,_0x52a036){return db[_0xe6d4('0x3a')][_0xe6d4('0x55')]({'where':{'id':_0x13af10[_0xe6d4('0x53')]['id']},'attributes':[_0xe6d4('0x71')]})[_0xe6d4('0x1e')](respondWithResult(_0x52a036,null))[_0xe6d4('0x29')](handleError(_0x52a036,null));};exports['addPreferred']=function(_0x389788,_0x113893,_0x4b143a){if(_0x389788[_0xe6d4('0x58')]&&_0x389788[_0xe6d4('0x58')][_0xe6d4('0x5a')]){_0x389788[_0xe6d4('0x56')][_0xe6d4('0x6d')]=_0x389788[_0xe6d4('0x58')][_0xe6d4('0x5a')];}return db[_0xe6d4('0x3a')][_0xe6d4('0x55')]({'where':{'id':_0x389788[_0xe6d4('0x53')]['id']}})[_0xe6d4('0x1e')](handleEntityNotFound(_0x113893,null))[_0xe6d4('0x1e')](saveUpdates(_0x389788[_0xe6d4('0x56')],null))[_0xe6d4('0x1e')](respondWithResult(_0x113893,null))[_0xe6d4('0x29')](handleError(_0x113893,null));};var utilLicense=require(_0xe6d4('0x1a'));exports[_0xe6d4('0x72')]=function(_0x1c31f5,_0x59d6e7,_0xffb31b){var _0xd770a=_0xe6d4('0x5e');var _0x59625f={'custom':![]};return utilLicense['getLicense']()[_0xe6d4('0x1e')](function(_0x3f86be){if(_0x3f86be){_0x59625f=_0x3f86be;}return db['Setting']['find']({'where':{'id':_0x1c31f5[_0xe6d4('0x53')]['id']},'attributes':[_0xe6d4('0x59'),_0xe6d4('0x5c'),_0xe6d4('0x6d'),_0xe6d4('0x73'),_0xe6d4('0x60'),_0xe6d4('0x6e'),_0xe6d4('0x61'),_0xe6d4('0x6f')],'raw':!![]});})[_0xe6d4('0x1e')](handleEntityNotFound(_0x59d6e7,null))[_0xe6d4('0x1e')](function(_0x2fedb7){if(_0x2fedb7){var _0xb47c3b=_0x2fedb7[_0xe6d4('0x6d')]&&fs[_0xe6d4('0x62')](path['join'](config[_0xe6d4('0x64')],_0xd770a,_['toLower'](_0x2fedb7['preferred'])))?path[_0xe6d4('0x63')](config['root'],_0xd770a,_[_0xe6d4('0x65')](_0x2fedb7[_0xe6d4('0x6d')])):path['join'](config[_0xe6d4('0x64')],_0xd770a,_[_0xe6d4('0x65')](_0xe6d4('0x74')));var _0x4b3dbe='default'+_[_0xe6d4('0x6b')](_0xe6d4('0x6d'));if(_0x2fedb7[_0x4b3dbe]||!_0x59625f[_0xe6d4('0x68')]||!_0x59625f[_0xe6d4('0x6d')]){_0xb47c3b=path[_0xe6d4('0x63')](config[_0xe6d4('0x64')],_0xd770a,_[_0xe6d4('0x65')](_0xe6d4('0x74')));}if(!fs[_0xe6d4('0x62')](_0xb47c3b)){throw new db[(_0xe6d4('0x69'))][(_0xe6d4('0x6a'))](_['upperFirst']('preferred')+_0xe6d4('0x75'));}return _0x59d6e7[_0xe6d4('0x76')](_0xb47c3b);}})[_0xe6d4('0x29')](handleError(_0x59d6e7,null));};exports[_0xe6d4('0x77')]=function(_0x3430ca,_0x73865d,_0xa7e560){if(_0x3430ca[_0xe6d4('0x58')]&&_0x3430ca[_0xe6d4('0x58')][_0xe6d4('0x5a')]){_0x3430ca['body']['favicon']=_0x3430ca[_0xe6d4('0x58')]['filename'];}return db[_0xe6d4('0x3a')][_0xe6d4('0x55')]({'where':{'id':_0x3430ca['params']['id']}})[_0xe6d4('0x1e')](handleEntityNotFound(_0x73865d,null))[_0xe6d4('0x1e')](saveUpdates(_0x3430ca[_0xe6d4('0x56')],null))['then'](respondWithResult(_0x73865d,null))[_0xe6d4('0x29')](handleError(_0x73865d,null));};var utilLicense=require(_0xe6d4('0x1a'));exports['getFavicon']=function(_0x1e9d48,_0x32c055,_0x1f47f3){var _0x1fb8da=_0xe6d4('0x5e');var _0x48b756={'custom':![]};return utilLicense[_0xe6d4('0x5f')]()[_0xe6d4('0x1e')](function(_0x5336a7){if(_0x5336a7){_0x48b756=_0x5336a7;}return db['Setting']['find']({'where':{'id':_0x1e9d48[_0xe6d4('0x53')]['id']},'attributes':[_0xe6d4('0x59'),_0xe6d4('0x5c'),_0xe6d4('0x6d'),_0xe6d4('0x73'),'defaultLogo',_0xe6d4('0x6e'),_0xe6d4('0x61'),_0xe6d4('0x6f')],'raw':!![]});})[_0xe6d4('0x1e')](handleEntityNotFound(_0x32c055,null))[_0xe6d4('0x1e')](function(_0x3981d6){if(_0x3981d6){var _0x42df6a=_0x3981d6['favicon']&&fs[_0xe6d4('0x62')](path['join'](config[_0xe6d4('0x64')],_0x1fb8da,_[_0xe6d4('0x65')](_0x3981d6[_0xe6d4('0x73')])))?path[_0xe6d4('0x63')](config['root'],_0x1fb8da,_['toLower'](_0x3981d6[_0xe6d4('0x73')])):path[_0xe6d4('0x63')](config['root'],_0x1fb8da,_[_0xe6d4('0x65')](_0xe6d4('0x78')));var _0x5c8429='default'+_[_0xe6d4('0x6b')](_0xe6d4('0x73'));if(_0x3981d6[_0x5c8429]||!_0x48b756['custom']){_0x42df6a=path[_0xe6d4('0x63')](config[_0xe6d4('0x64')],_0x1fb8da,_[_0xe6d4('0x65')]('default_favicon.ico'));}if(!fs[_0xe6d4('0x62')](_0x42df6a)){throw new db[(_0xe6d4('0x69'))][(_0xe6d4('0x6a'))](_[_0xe6d4('0x6b')](_0xe6d4('0x73'))+'\x20not\x20found');}return _0x32c055[_0xe6d4('0x76')](_0x42df6a);}})[_0xe6d4('0x29')](handleError(_0x32c055,null));};exports[_0xe6d4('0x79')]=function(_0xa822f6,_0x29c19c){var _0x198f38={'offset':moment()[_0xe6d4('0x7a')]()};_0x198f38[_0xe6d4('0x7b')]=moment()['utcOffset'](_0x198f38['offset'])['format'](_0xe6d4('0x7c'));return _0x29c19c[_0xe6d4('0x2b')](0xc8)[_0xe6d4('0x37')](_0x198f38);}; \ No newline at end of file +var _0x8daa=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','map','Setting','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','body','file','filename','loginLogo','../../config/license/util','server/files/images/logos','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLicense','default_loginLogo.svg','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x4fb2a2,_0x39c111){var _0x54d389=function(_0x1574d1){while(--_0x1574d1){_0x4fb2a2['push'](_0x4fb2a2['shift']());}};_0x54d389(++_0x39c111);}(_0x8daa,0x67));var _0xa8da=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0x8daa[_0x5b077b];return _0x16faf7;};'use strict';var emlformat=require(_0xa8da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8da('0x1'));var jsonpatch=require(_0xa8da('0x2'));var rp=require(_0xa8da('0x3'));var moment=require(_0xa8da('0x4'));var BPromise=require(_0xa8da('0x5'));var Mustache=require(_0xa8da('0x6'));var util=require('util');var path=require(_0xa8da('0x7'));var sox=require(_0xa8da('0x8'));var csv=require(_0xa8da('0x9'));var ejs=require(_0xa8da('0xa'));var fs=require('fs');var fs_extra=require(_0xa8da('0xb'));var _=require(_0xa8da('0xc'));var squel=require(_0xa8da('0xd'));var crypto=require('crypto');var jsforce=require(_0xa8da('0xe'));var deskjs=require(_0xa8da('0xf'));var toCsv=require(_0xa8da('0x9'));var querystring=require('querystring');var Papa=require(_0xa8da('0x10'));var Redis=require('ioredis');var authService=require(_0xa8da('0x11'));var qs=require(_0xa8da('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8da('0x13'));var logger=require(_0xa8da('0x14'))(_0xa8da('0x15'));var utils=require(_0xa8da('0x16'));var config=require(_0xa8da('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa8da('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xa8da('0x19')][_0xa8da('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x590325,_0x58ab44,_0x3e47a4,_0x33bdbe){return new BPromise(function(_0x5c2e2b,_0x4b06b1){var _0x8d3530=_0x33bdbe||client;return _0x8d3530[_0xa8da('0x1b')](_0x590325,_0x3e47a4)['then'](function(_0x80949e){logger[_0xa8da('0x1c')](_0xa8da('0x1d'),_0x58ab44,_0xa8da('0x1e'));logger['debug'](_0xa8da('0x1f'),_0x58ab44,_0xa8da('0x1e'),JSON[_0xa8da('0x20')](_0x80949e));if(_0x80949e[_0xa8da('0x21')]){if(_0x80949e[_0xa8da('0x21')][_0xa8da('0x22')]===0x1f4){logger[_0xa8da('0x21')](_0xa8da('0x1d'),_0x58ab44,_0x80949e[_0xa8da('0x21')][_0xa8da('0x23')]);return _0x4b06b1(_0x80949e[_0xa8da('0x21')]['message']);}logger[_0xa8da('0x21')](_0xa8da('0x1d'),_0x58ab44,_0x80949e[_0xa8da('0x21')][_0xa8da('0x23')]);return _0x5c2e2b(_0x80949e[_0xa8da('0x21')][_0xa8da('0x23')]);}else{logger[_0xa8da('0x1c')]('Setting,\x20%s,\x20%s',_0x58ab44,_0xa8da('0x1e'));_0x5c2e2b(_0x80949e[_0xa8da('0x24')][_0xa8da('0x23')]);}})['catch'](function(_0xc4a991){logger[_0xa8da('0x21')](_0xa8da('0x1d'),_0x58ab44,_0xc4a991);_0x4b06b1(_0xc4a991);});});}function respondWithStatusCode(_0x364de2,_0x5799ed){_0x5799ed=_0x5799ed||0xcc;return function(_0x5c0793){if(_0x5c0793){return _0x364de2['sendStatus'](_0x5799ed);}return _0x364de2[_0xa8da('0x25')](_0x5799ed)[_0xa8da('0x26')]();};}function respondWithResult(_0xc596f,_0x1935dd){_0x1935dd=_0x1935dd||0xc8;return function(_0x456e7d){if(_0x456e7d){return _0xc596f[_0xa8da('0x25')](_0x1935dd)[_0xa8da('0x27')](_0x456e7d);}};}function respondWithFilteredResult(_0x35dcf6,_0x429a72){return function(_0x37a8ff){if(_0x37a8ff){var _0x5d3aca=typeof _0x429a72['offset']===_0xa8da('0x28')&&typeof _0x429a72['limit']===_0xa8da('0x28');var _0x3cf711=_0x37a8ff[_0xa8da('0x29')];var _0x44d8cb=_0x5d3aca?0x0:_0x429a72[_0xa8da('0x2a')];var _0x29147c=_0x5d3aca?_0x37a8ff['count']:_0x429a72[_0xa8da('0x2a')]+_0x429a72[_0xa8da('0x2b')];var _0x3a4e82;if(_0x29147c>=_0x3cf711){_0x29147c=_0x3cf711;_0x3a4e82=0xc8;}else{_0x3a4e82=0xce;}_0x35dcf6[_0xa8da('0x25')](_0x3a4e82);return _0x35dcf6[_0xa8da('0x2c')](_0xa8da('0x2d'),_0x44d8cb+'-'+_0x29147c+'/'+_0x3cf711)[_0xa8da('0x27')](_0x37a8ff);}return null;};}function patchUpdates(_0x554256){return function(_0x43f888){try{jsonpatch[_0xa8da('0x2e')](_0x43f888,_0x554256,!![]);}catch(_0x1873ee){return BPromise[_0xa8da('0x2f')](_0x1873ee);}return _0x43f888[_0xa8da('0x30')]();};}function saveUpdates(_0x431d37,_0x1d019b){return function(_0x6f1a2c){if(_0x6f1a2c){return _0x6f1a2c[_0xa8da('0x31')](_0x431d37)[_0xa8da('0x32')](function(_0x428269){return _0x428269;});}return null;};}function removeEntity(_0x4e16ad,_0x1cf6e4){return function(_0x29f719){if(_0x29f719){return _0x29f719[_0xa8da('0x33')]()['then'](function(){_0x4e16ad['status'](0xcc)[_0xa8da('0x26')]();});}};}function handleEntityNotFound(_0x1ef411,_0x21a2af){return function(_0x2ee0ba){if(!_0x2ee0ba){_0x1ef411[_0xa8da('0x34')](0x194);}return _0x2ee0ba;};}function handleError(_0x45dd72,_0x20a0a5){_0x20a0a5=_0x20a0a5||0x1f4;return function(_0x305f9d){logger[_0xa8da('0x21')](_0x305f9d[_0xa8da('0x35')]);if(_0x305f9d[_0xa8da('0x36')]){delete _0x305f9d[_0xa8da('0x36')];}_0x45dd72['status'](_0x20a0a5)['send'](_0x305f9d);};}exports['index']=function(_0x52bdae,_0x6cff25){var _0x3b7a71={},_0x25ef1e={},_0x315161={'count':0x0,'rows':[]};var _0x46bad3=_[_0xa8da('0x37')](db[_0xa8da('0x38')]['rawAttributes'],function(_0x20cb47){return{'name':_0x20cb47[_0xa8da('0x39')],'type':_0x20cb47[_0xa8da('0x3a')]['key']};});_0x25ef1e[_0xa8da('0x3b')]=_[_0xa8da('0x37')](_0x46bad3,'name');_0x25ef1e[_0xa8da('0x3c')]=_['keys'](_0x52bdae[_0xa8da('0x3c')]);_0x25ef1e[_0xa8da('0x3d')]=_[_0xa8da('0x3e')](_0x25ef1e[_0xa8da('0x3b')],_0x25ef1e[_0xa8da('0x3c')]);_0x3b7a71[_0xa8da('0x3f')]=_[_0xa8da('0x3e')](_0x25ef1e['model'],qs['fields'](_0x52bdae['query'][_0xa8da('0x40')]));_0x3b7a71[_0xa8da('0x3f')]=_0x3b7a71['attributes'][_0xa8da('0x41')]?_0x3b7a71[_0xa8da('0x3f')]:_0x25ef1e['model'];if(!_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x42')](_0xa8da('0x43'))){_0x3b7a71[_0xa8da('0x2b')]=qs[_0xa8da('0x2b')](_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x2b')]);_0x3b7a71[_0xa8da('0x2a')]=qs[_0xa8da('0x2a')](_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x2a')]);}_0x3b7a71['order']=qs[_0xa8da('0x44')](_0x52bdae['query'][_0xa8da('0x44')]);_0x3b7a71[_0xa8da('0x45')]=qs[_0xa8da('0x3d')](_['pick'](_0x52bdae[_0xa8da('0x3c')],_0x25ef1e[_0xa8da('0x3d')]),_0x46bad3);if(_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x46')]){_0x3b7a71[_0xa8da('0x45')]=_[_0xa8da('0x47')](_0x3b7a71[_0xa8da('0x45')],{'$or':_[_0xa8da('0x37')](_0x46bad3,function(_0x4d5974){if(_0x4d5974[_0xa8da('0x3a')]!=='VIRTUAL'){var _0x28aca4={};_0x28aca4[_0x4d5974[_0xa8da('0x36')]]={'$like':'%'+_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x46')]+'%'};return _0x28aca4;}})});}_0x3b7a71=_[_0xa8da('0x47')]({},_0x3b7a71,_0x52bdae[_0xa8da('0x48')]);var _0x5d956d={'where':_0x3b7a71[_0xa8da('0x45')]};return db[_0xa8da('0x38')]['count'](_0x5d956d)[_0xa8da('0x32')](function(_0x50d684){_0x315161['count']=_0x50d684;if(_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x49')]){_0x3b7a71[_0xa8da('0x4a')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x3b7a71);})['then'](function(_0x28378b){_0x315161[_0xa8da('0x4b')]=_0x28378b;return _0x315161;})[_0xa8da('0x32')](respondWithFilteredResult(_0x6cff25,_0x3b7a71))[_0xa8da('0x4c')](handleError(_0x6cff25,null));};exports[_0xa8da('0x4d')]=function(_0x497e03,_0x3c569c){var _0x4b2c43={'raw':![],'where':{'id':_0x497e03[_0xa8da('0x4e')]['id']}},_0x51801c={};_0x51801c[_0xa8da('0x3b')]=_['keys'](db[_0xa8da('0x38')][_0xa8da('0x4f')]);_0x51801c['query']=_[_0xa8da('0x50')](_0x497e03[_0xa8da('0x3c')]);_0x51801c[_0xa8da('0x3d')]=_[_0xa8da('0x3e')](_0x51801c[_0xa8da('0x3b')],_0x51801c[_0xa8da('0x3c')]);_0x4b2c43[_0xa8da('0x3f')]=_['intersection'](_0x51801c[_0xa8da('0x3b')],qs[_0xa8da('0x40')](_0x497e03['query'][_0xa8da('0x40')]));_0x4b2c43[_0xa8da('0x3f')]=_0x4b2c43['attributes'][_0xa8da('0x41')]?_0x4b2c43[_0xa8da('0x3f')]:_0x51801c[_0xa8da('0x3b')];if(_0x497e03[_0xa8da('0x3c')]['includeAll']){_0x4b2c43['include']=[{'all':!![]}];}_0x4b2c43=_[_0xa8da('0x47')]({},_0x4b2c43,_0x497e03[_0xa8da('0x48')]);return db['Setting'][_0xa8da('0x51')](_0x4b2c43)[_0xa8da('0x32')](handleEntityNotFound(_0x3c569c,null))[_0xa8da('0x32')](respondWithResult(_0x3c569c,null))['catch'](handleError(_0x3c569c,null));};exports['update']=function(_0x3c8fd,_0x19815f){if(_0x3c8fd[_0xa8da('0x52')]['id']){delete _0x3c8fd[_0xa8da('0x52')]['id'];}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x3c8fd[_0xa8da('0x4e')]['id']}})['then'](handleEntityNotFound(_0x19815f,null))[_0xa8da('0x32')](saveUpdates(_0x3c8fd[_0xa8da('0x52')],null))[_0xa8da('0x32')](respondWithResult(_0x19815f,null))[_0xa8da('0x4c')](handleError(_0x19815f,null));};exports['addLogo']=function(_0xe7df16,_0x231261,_0x2c8b34){if(_0xe7df16[_0xa8da('0x53')]&&_0xe7df16[_0xa8da('0x53')][_0xa8da('0x54')]){_0xe7df16['body']['logo']=_0xe7df16[_0xa8da('0x53')][_0xa8da('0x54')];}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0xe7df16[_0xa8da('0x4e')]['id']}})[_0xa8da('0x32')](handleEntityNotFound(_0x231261,null))[_0xa8da('0x32')](saveUpdates(_0xe7df16[_0xa8da('0x52')],null))[_0xa8da('0x32')](respondWithResult(_0x231261,null))[_0xa8da('0x4c')](handleError(_0x231261,null));};exports['addLogoLogin']=function(_0x38fd48,_0x302be4,_0x50c4d7){if(_0x38fd48['file']&&_0x38fd48[_0xa8da('0x53')][_0xa8da('0x54')]){_0x38fd48[_0xa8da('0x52')][_0xa8da('0x55')]=_0x38fd48[_0xa8da('0x53')][_0xa8da('0x54')];}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x38fd48[_0xa8da('0x4e')]['id']}})[_0xa8da('0x32')](handleEntityNotFound(_0x302be4,null))[_0xa8da('0x32')](saveUpdates(_0x38fd48[_0xa8da('0x52')],null))['then'](respondWithResult(_0x302be4,null))[_0xa8da('0x4c')](handleError(_0x302be4,null));};var utilLicense=require(_0xa8da('0x56'));exports['getLogo']=function(_0x46ff16,_0x243298,_0x443e7b){var _0x51e437=_0xa8da('0x57');var _0x2b3adb={'custom':![]};return utilLicense['getLicense']()[_0xa8da('0x32')](function(_0xf3bcd7){if(_0xf3bcd7){_0x2b3adb=_0xf3bcd7;}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x46ff16['params']['id']},'attributes':[_0xa8da('0x58'),_0xa8da('0x55'),_0xa8da('0x59'),_0xa8da('0x5a'),_0xa8da('0x5b'),_0xa8da('0x5c'),_0xa8da('0x5d'),_0xa8da('0x5e')],'raw':!![]});})[_0xa8da('0x32')](handleEntityNotFound(_0x243298,null))[_0xa8da('0x32')](function(_0x5d6bcd){if(_0x5d6bcd){var _0x115262=_0x5d6bcd['logo']&&fs[_0xa8da('0x5f')](path[_0xa8da('0x60')](config['root'],_0x51e437,_[_0xa8da('0x61')](_0x5d6bcd['logo'])))?path['join'](config[_0xa8da('0x62')],_0x51e437,_[_0xa8da('0x61')](_0x5d6bcd['logo'])):path['join'](config[_0xa8da('0x62')],_0x51e437,_[_0xa8da('0x61')]('default_logo.svg'));var _0xee0c6b=_0xa8da('0x63')+_[_0xa8da('0x64')]('logo');if(_0x5d6bcd[_0xee0c6b]||!_0x2b3adb[_0xa8da('0x65')]){_0x115262=path[_0xa8da('0x60')](config['root'],_0x51e437,_['toLower'](_0xa8da('0x66')));}if(!fs[_0xa8da('0x5f')](_0x115262)){throw new db[(_0xa8da('0x67'))][(_0xa8da('0x68'))](_[_0xa8da('0x64')](_0xa8da('0x58'))+_0xa8da('0x69'));}return _0x243298[_0xa8da('0x6a')](_0x115262);}})[_0xa8da('0x4c')](handleError(_0x243298,null));};var utilLicense=require(_0xa8da('0x56'));exports['getLogoLogin']=function(_0x3239c6,_0x33553b,_0x423fae){var _0x4b33e5=_0xa8da('0x57');var _0x103613={'custom':![]};return utilLicense[_0xa8da('0x6b')]()[_0xa8da('0x32')](function(_0x3e1121){if(_0x3e1121){_0x103613=_0x3e1121;}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x3239c6['params']['id']},'attributes':[_0xa8da('0x58'),_0xa8da('0x55'),_0xa8da('0x59'),'favicon','defaultLogo',_0xa8da('0x5c'),'defaultPreferred',_0xa8da('0x5e')],'raw':!![]});})[_0xa8da('0x32')](handleEntityNotFound(_0x33553b,null))['then'](function(_0x40998a){if(_0x40998a){var _0x51a5e6=_0x40998a[_0xa8da('0x55')]&&fs['existsSync'](path[_0xa8da('0x60')](config['root'],_0x4b33e5,_[_0xa8da('0x61')](_0x40998a[_0xa8da('0x55')])))?path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x4b33e5,_[_0xa8da('0x61')](_0x40998a[_0xa8da('0x55')])):path['join'](config[_0xa8da('0x62')],_0x4b33e5,_[_0xa8da('0x61')](_0xa8da('0x6c')));var _0x729f7b=_0xa8da('0x63')+_['upperFirst']('loginLogo');if(_0x40998a[_0x729f7b]||!_0x103613[_0xa8da('0x65')]){_0x51a5e6=path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x4b33e5,_[_0xa8da('0x61')](_0xa8da('0x6c')));}if(!fs['existsSync'](_0x51a5e6)){throw new db['Sequelize']['ValidationError'](_[_0xa8da('0x64')](_0xa8da('0x55'))+'\x20not\x20found');}return _0x33553b['download'](_0x51a5e6);}})['catch'](handleError(_0x33553b,null));};exports[_0xa8da('0x6d')]=function(_0x2e5ecf,_0x40c398){return db[_0xa8da('0x38')]['find']({'where':{'id':_0x2e5ecf['params']['id']},'attributes':[_0xa8da('0x6e')]})['then'](respondWithResult(_0x40c398,null))[_0xa8da('0x4c')](handleError(_0x40c398,null));};exports[_0xa8da('0x6f')]=function(_0x147524,_0x467d5f,_0x5eb30f){if(_0x147524[_0xa8da('0x53')]&&_0x147524['file'][_0xa8da('0x54')]){_0x147524[_0xa8da('0x52')][_0xa8da('0x59')]=_0x147524[_0xa8da('0x53')][_0xa8da('0x54')];}return db['Setting']['find']({'where':{'id':_0x147524[_0xa8da('0x4e')]['id']}})[_0xa8da('0x32')](handleEntityNotFound(_0x467d5f,null))[_0xa8da('0x32')](saveUpdates(_0x147524[_0xa8da('0x52')],null))['then'](respondWithResult(_0x467d5f,null))['catch'](handleError(_0x467d5f,null));};var utilLicense=require(_0xa8da('0x56'));exports['getPreferred']=function(_0x2703de,_0xc86005,_0x3c6089){var _0x2ea730=_0xa8da('0x57');var _0xc65e07={'custom':![]};return utilLicense['getLicense']()[_0xa8da('0x32')](function(_0x2c1b03){if(_0x2c1b03){_0xc65e07=_0x2c1b03;}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x2703de[_0xa8da('0x4e')]['id']},'attributes':[_0xa8da('0x58'),_0xa8da('0x55'),_0xa8da('0x59'),'favicon','defaultLogo',_0xa8da('0x5c'),_0xa8da('0x5d'),_0xa8da('0x5e')],'raw':!![]});})[_0xa8da('0x32')](handleEntityNotFound(_0xc86005,null))[_0xa8da('0x32')](function(_0x3fe1b7){if(_0x3fe1b7){var _0x5bbb3b=_0x3fe1b7[_0xa8da('0x59')]&&fs[_0xa8da('0x5f')](path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x2ea730,_[_0xa8da('0x61')](_0x3fe1b7[_0xa8da('0x59')])))?path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x2ea730,_[_0xa8da('0x61')](_0x3fe1b7[_0xa8da('0x59')])):path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x2ea730,_[_0xa8da('0x61')](_0xa8da('0x70')));var _0x1a1c58=_0xa8da('0x63')+_[_0xa8da('0x64')]('preferred');if(_0x3fe1b7[_0x1a1c58]||!_0xc65e07[_0xa8da('0x65')]||!_0xc65e07[_0xa8da('0x59')]){_0x5bbb3b=path['join'](config[_0xa8da('0x62')],_0x2ea730,_['toLower'](_0xa8da('0x70')));}if(!fs['existsSync'](_0x5bbb3b)){throw new db['Sequelize'][(_0xa8da('0x68'))](_['upperFirst'](_0xa8da('0x59'))+_0xa8da('0x69'));}return _0xc86005[_0xa8da('0x6a')](_0x5bbb3b);}})[_0xa8da('0x4c')](handleError(_0xc86005,null));};exports[_0xa8da('0x71')]=function(_0x3ff567,_0x1c8738,_0x5e3115){if(_0x3ff567[_0xa8da('0x53')]&&_0x3ff567[_0xa8da('0x53')][_0xa8da('0x54')]){_0x3ff567[_0xa8da('0x52')][_0xa8da('0x5a')]=_0x3ff567[_0xa8da('0x53')][_0xa8da('0x54')];}return db[_0xa8da('0x38')]['find']({'where':{'id':_0x3ff567[_0xa8da('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1c8738,null))[_0xa8da('0x32')](saveUpdates(_0x3ff567[_0xa8da('0x52')],null))[_0xa8da('0x32')](respondWithResult(_0x1c8738,null))[_0xa8da('0x4c')](handleError(_0x1c8738,null));};var utilLicense=require(_0xa8da('0x56'));exports[_0xa8da('0x72')]=function(_0x2a00d3,_0x1f5020,_0x29cd5b){var _0x22104f=_0xa8da('0x57');var _0x19601c={'custom':![]};return utilLicense[_0xa8da('0x6b')]()['then'](function(_0x482854){if(_0x482854){_0x19601c=_0x482854;}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x2a00d3[_0xa8da('0x4e')]['id']},'attributes':['logo',_0xa8da('0x55'),_0xa8da('0x59'),_0xa8da('0x5a'),'defaultLogo','defaultLoginLogo',_0xa8da('0x5d'),_0xa8da('0x5e')],'raw':!![]});})[_0xa8da('0x32')](handleEntityNotFound(_0x1f5020,null))[_0xa8da('0x32')](function(_0x39174b){if(_0x39174b){var _0x81248=_0x39174b[_0xa8da('0x5a')]&&fs[_0xa8da('0x5f')](path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x22104f,_[_0xa8da('0x61')](_0x39174b[_0xa8da('0x5a')])))?path[_0xa8da('0x60')](config['root'],_0x22104f,_['toLower'](_0x39174b['favicon'])):path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x22104f,_[_0xa8da('0x61')]('default_favicon.ico'));var _0x154fee=_0xa8da('0x63')+_['upperFirst'](_0xa8da('0x5a'));if(_0x39174b[_0x154fee]||!_0x19601c['custom']){_0x81248=path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x22104f,_[_0xa8da('0x61')](_0xa8da('0x73')));}if(!fs[_0xa8da('0x5f')](_0x81248)){throw new db['Sequelize'][(_0xa8da('0x68'))](_[_0xa8da('0x64')]('favicon')+_0xa8da('0x69'));}return _0x1f5020[_0xa8da('0x6a')](_0x81248);}})[_0xa8da('0x4c')](handleError(_0x1f5020,null));};exports[_0xa8da('0x74')]=function(_0xa56abf,_0x1932b9){var _0x21a23c={'offset':moment()[_0xa8da('0x75')]()};_0x21a23c['now']=moment()[_0xa8da('0x75')](_0x21a23c['offset'])[_0xa8da('0x76')](_0xa8da('0x77'));return _0x1932b9[_0xa8da('0x25')](0xc8)['send'](_0x21a23c);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 23e94f4..2453ff3 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_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':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x7a2be3,_0x225052){var _0x1400b0=function(_0x35ee71){while(--_0x35ee71){_0x7a2be3['push'](_0x7a2be3['shift']());}};_0x1400b0(++_0x225052);}(_0xedd9,0xfc));var _0x9edd=function(_0x43fca9,_0x2c384b){_0x43fca9=_0x43fca9-0x0;var _0x3ba1ba=_0xedd9[_0x43fca9];return _0x3ba1ba;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 94e2fad..a82052e 100644 --- a/server/api/setting/setting.rpc.js +++ b/server/api/setting/setting.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab7f=['client','request','info','request\x20sent','error','Setting,\x20%s,\x20%s','message','result','ShowSetting','Setting','find','options','where','map','include','model','attributes','then','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x171520,_0x1cee8c){var _0x3cc729=function(_0x201c4a){while(--_0x201c4a){_0x171520['push'](_0x171520['shift']());}};_0x3cc729(++_0x1cee8c);}(_0xab7f,0x169));var _0xfab7=function(_0x15be9c,_0x6dc8bc){_0x15be9c=_0x15be9c-0x0;var _0x1dd5f7=_0xab7f[_0x15be9c];return _0x1dd5f7;};'use strict';var _=require(_0xfab7('0x0'));var util=require(_0xfab7('0x1'));var moment=require(_0xfab7('0x2'));var BPromise=require(_0xfab7('0x3'));var rs=require(_0xfab7('0x4'));var fs=require('fs');var Redis=require(_0xfab7('0x5'));var db=require(_0xfab7('0x6'))['db'];var utils=require(_0xfab7('0x7'));var logger=require('../../config/logger')(_0xfab7('0x8'));var config=require(_0xfab7('0x9'));var jayson=require(_0xfab7('0xa'));var client=jayson[_0xfab7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcd04aa,_0x501276,_0x710a7b){return new BPromise(function(_0x31b6d3,_0xbee6d8){return client[_0xfab7('0xc')](_0xcd04aa,_0x710a7b)['then'](function(_0x53835f){logger[_0xfab7('0xd')]('Setting,\x20%s,\x20%s',_0x501276,'request\x20sent');logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x501276,_0xfab7('0xe'),JSON['stringify'](_0x53835f));if(_0x53835f[_0xfab7('0xf')]){if(_0x53835f[_0xfab7('0xf')]['code']===0x1f4){logger[_0xfab7('0xf')](_0xfab7('0x10'),_0x501276,_0x53835f['error']['message']);return _0xbee6d8(_0x53835f[_0xfab7('0xf')][_0xfab7('0x11')]);}logger[_0xfab7('0xf')](_0xfab7('0x10'),_0x501276,_0x53835f[_0xfab7('0xf')][_0xfab7('0x11')]);return _0x31b6d3(_0x53835f[_0xfab7('0xf')][_0xfab7('0x11')]);}else{logger[_0xfab7('0xd')](_0xfab7('0x10'),_0x501276,'request\x20sent');_0x31b6d3(_0x53835f[_0xfab7('0x12')]['message']);}})['catch'](function(_0x175520){logger[_0xfab7('0xf')](_0xfab7('0x10'),_0x501276,_0x175520);_0xbee6d8(_0x175520);});});}exports[_0xfab7('0x13')]=function(_0x506dba){var _0x57faeb=this;return new Promise(function(_0x51cbd4,_0x4b61f8){return db[_0xfab7('0x14')][_0xfab7('0x15')]({'raw':_0x506dba[_0xfab7('0x16')]?_0x506dba[_0xfab7('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x506dba['options']?_0x506dba[_0xfab7('0x16')][_0xfab7('0x17')]||null:null,'attributes':_0x506dba[_0xfab7('0x16')]?_0x506dba[_0xfab7('0x16')]['attributes']||null:null,'include':_0x506dba['options']?_0x506dba[_0xfab7('0x16')]['include']?_[_0xfab7('0x18')](_0x506dba[_0xfab7('0x16')][_0xfab7('0x19')],function(_0x2845e9){return{'model':db[_0x2845e9[_0xfab7('0x1a')]],'as':_0x2845e9['as'],'attributes':_0x2845e9[_0xfab7('0x1b')],'include':_0x2845e9[_0xfab7('0x19')]?_[_0xfab7('0x18')](_0x2845e9[_0xfab7('0x19')],function(_0x4a9a87){return{'model':db[_0x4a9a87[_0xfab7('0x1a')]],'as':_0x4a9a87['as'],'attributes':_0x4a9a87[_0xfab7('0x1b')],'include':_0x4a9a87[_0xfab7('0x19')]?_[_0xfab7('0x18')](_0x4a9a87[_0xfab7('0x19')],function(_0x134bf7){return{'model':db[_0x134bf7[_0xfab7('0x1a')]],'as':_0x134bf7['as'],'attributes':_0x134bf7[_0xfab7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfab7('0x1c')](function(_0x2b482e){logger[_0xfab7('0xd')](_0xfab7('0x13'),_0x506dba);logger['debug'](_0xfab7('0x13'),_0x506dba,JSON[_0xfab7('0x1d')](_0x2b482e));_0x51cbd4(_0x2b482e);})[_0xfab7('0x1e')](function(_0x195570){logger[_0xfab7('0xf')](_0xfab7('0x13'),_0x195570[_0xfab7('0x11')],_0x506dba);_0x4b61f8(_0x57faeb[_0xfab7('0xf')](0x1f4,_0x195570[_0xfab7('0x11')]));});});}; \ No newline at end of file +var _0x489b=['Setting','find','options','raw','where','attributes','include','map','model','lodash','util','moment','../../mysqldb','../../config/logger','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ShowSetting'];(function(_0xa38778,_0x109a31){var _0x452f64=function(_0x1cb914){while(--_0x1cb914){_0xa38778['push'](_0xa38778['shift']());}};_0x452f64(++_0x109a31);}(_0x489b,0xb7));var _0xb489=function(_0x10608d,_0x2a85aa){_0x10608d=_0x10608d-0x0;var _0xba3d23=_0x489b[_0x10608d];return _0xba3d23;};'use strict';var _=require(_0xb489('0x0'));var util=require(_0xb489('0x1'));var moment=require(_0xb489('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb489('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb489('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb489('0x5'));var client=jayson[_0xb489('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x414d06,_0x8b3871,_0x5d83f9){return new BPromise(function(_0x3e1aa3,_0xc2a57f){return client['request'](_0x414d06,_0x5d83f9)[_0xb489('0x7')](function(_0xd3108d){logger[_0xb489('0x8')](_0xb489('0x9'),_0x8b3871,'request\x20sent');logger[_0xb489('0xa')](_0xb489('0xb'),_0x8b3871,'request\x20sent',JSON[_0xb489('0xc')](_0xd3108d));if(_0xd3108d[_0xb489('0xd')]){if(_0xd3108d[_0xb489('0xd')][_0xb489('0xe')]===0x1f4){logger[_0xb489('0xd')]('Setting,\x20%s,\x20%s',_0x8b3871,_0xd3108d['error']['message']);return _0xc2a57f(_0xd3108d['error'][_0xb489('0xf')]);}logger[_0xb489('0xd')](_0xb489('0x9'),_0x8b3871,_0xd3108d[_0xb489('0xd')][_0xb489('0xf')]);return _0x3e1aa3(_0xd3108d[_0xb489('0xd')]['message']);}else{logger[_0xb489('0x8')](_0xb489('0x9'),_0x8b3871,_0xb489('0x10'));_0x3e1aa3(_0xd3108d[_0xb489('0x11')]['message']);}})[_0xb489('0x12')](function(_0x250beb){logger[_0xb489('0xd')](_0xb489('0x9'),_0x8b3871,_0x250beb);_0xc2a57f(_0x250beb);});});}exports[_0xb489('0x13')]=function(_0x5ac908){var _0x3d650a=this;return new Promise(function(_0x212dd9,_0x27291b){return db[_0xb489('0x14')][_0xb489('0x15')]({'raw':_0x5ac908[_0xb489('0x16')]?_0x5ac908[_0xb489('0x16')][_0xb489('0x17')]===undefined?!![]:![]:!![],'where':_0x5ac908[_0xb489('0x16')]?_0x5ac908[_0xb489('0x16')][_0xb489('0x18')]||null:null,'attributes':_0x5ac908['options']?_0x5ac908[_0xb489('0x16')][_0xb489('0x19')]||null:null,'include':_0x5ac908[_0xb489('0x16')]?_0x5ac908['options'][_0xb489('0x1a')]?_[_0xb489('0x1b')](_0x5ac908[_0xb489('0x16')][_0xb489('0x1a')],function(_0x4fac3d){return{'model':db[_0x4fac3d['model']],'as':_0x4fac3d['as'],'attributes':_0x4fac3d['attributes'],'include':_0x4fac3d['include']?_['map'](_0x4fac3d[_0xb489('0x1a')],function(_0x39af77){return{'model':db[_0x39af77['model']],'as':_0x39af77['as'],'attributes':_0x39af77['attributes'],'include':_0x39af77[_0xb489('0x1a')]?_[_0xb489('0x1b')](_0x39af77[_0xb489('0x1a')],function(_0x5c3262){return{'model':db[_0x5c3262[_0xb489('0x1c')]],'as':_0x5c3262['as'],'attributes':_0x5c3262[_0xb489('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb489('0x7')](function(_0x461cc4){logger[_0xb489('0x8')](_0xb489('0x13'),_0x5ac908);logger[_0xb489('0xa')]('ShowSetting',_0x5ac908,JSON[_0xb489('0xc')](_0x461cc4));_0x212dd9(_0x461cc4);})[_0xb489('0x12')](function(_0x5450b7){logger['error']('ShowSetting',_0x5450b7[_0xb489('0xf')],_0x5ac908);_0x27291b(_0x3d650a[_0xb489('0xd')](0x1f4,_0x5450b7[_0xb489('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 521cd0d..4271bd0 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb9,0x14e));var _0x91cb=function(_0x39a93b,_0x1c952a){_0x39a93b=_0x39a93b-0x0;var _0x8fc59d=_0x1cb9[_0x39a93b];return _0x8fc59d;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file +var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x598e9c,_0x184844){var _0x5201a1=function(_0x4cf09c){while(--_0x4cf09c){_0x598e9c['push'](_0x598e9c['shift']());}};_0x5201a1(++_0x184844);}(_0x8ef6,0xf2));var _0x68ef=function(_0x493c86,_0x2496ea){_0x493c86=_0x493c86-0x0;var _0x2a9df8=_0x8ef6[_0x493c86];return _0x2a9df8;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index c2aa131..e572c3a 100644 --- a/server/api/smsAccount/smsAccount.attributes.js +++ b/server/api/smsAccount/smsAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x863b=['skebby','connectel','clicksend','bandwidth','csc','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','twilio'];(function(_0x5c431c,_0x3f1b8c){var _0x3ce6fb=function(_0xdc78c1){while(--_0xdc78c1){_0x5c431c['push'](_0x5c431c['shift']());}};_0x3ce6fb(++_0x3f1b8c);}(_0x863b,0x173));var _0xb863=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x863b[_0xc77819];return _0x1c9434;};'use strict';var Sequelize=require(_0xb863('0x0'));var rs=require(_0xb863('0x1'));module[_0xb863('0x2')]={'name':{'type':Sequelize[_0xb863('0x3')],'unique':_0xb863('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xb863('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xb863('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xb863('0x3')],'defaultValue':function(){return rs[_0xb863('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xb863('0x6'),_0xb863('0x7'),_0xb863('0x8'),_0xb863('0x9'),'plivo','clickatell',_0xb863('0xa'),_0xb863('0xb'),'infobip',_0xb863('0xc'))},'accountSid':{'type':Sequelize[_0xb863('0x3')]},'authId':{'type':Sequelize[_0xb863('0x3')]},'authToken':{'type':Sequelize[_0xb863('0x3')]},'smsMethod':{'type':Sequelize[_0xb863('0xd')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb863('0x3')]},'apiKey':{'type':Sequelize[_0xb863('0x3')]},'applicationId':{'type':Sequelize[_0xb863('0x3')]},'accountId':{'type':Sequelize[_0xb863('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xb863('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xb863('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb863('0xf')],'defaultValue':function(){return _0xb863('0x10');}},'notificationSound':{'type':Sequelize[_0xb863('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb863('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb863('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb863('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb863('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb863('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb863('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb863('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb863('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb863('0xe')],'defaultValue':![],'comment':_0xb863('0x12'),'set':function(_0x5edbdc){if(!_0x5edbdc)this[_0xb863('0x13')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xb863('0x14'),_0x5edbdc);}}}; \ No newline at end of file +var _0x67f2=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','name','ENUM','skebby','clickatell','bandwidth','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x163639,_0x43541e){var _0x26cd25=function(_0x5e46f1){while(--_0x5e46f1){_0x163639['push'](_0x163639['shift']());}};_0x26cd25(++_0x43541e);}(_0x67f2,0x6c));var _0x267f=function(_0x1b1ae5,_0x5b75a6){_0x1b1ae5=_0x1b1ae5-0x0;var _0x413fc5=_0x67f2[_0x1b1ae5];return _0x413fc5;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x267f('0x0')],'unique':_0x267f('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x267f('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0x267f('0x0')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x267f('0x0')]},'type':{'type':Sequelize[_0x267f('0x2')]('twilio',_0x267f('0x3'),'connectel','clicksend','plivo',_0x267f('0x4'),_0x267f('0x5'),_0x267f('0x6'),'infobip',_0x267f('0x7'))},'accountSid':{'type':Sequelize[_0x267f('0x0')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x267f('0x0')]},'smsMethod':{'type':Sequelize[_0x267f('0x2')]('SI','TI','GP')},'username':{'type':Sequelize[_0x267f('0x0')]},'password':{'type':Sequelize[_0x267f('0x0')]},'apiKey':{'type':Sequelize[_0x267f('0x0')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x267f('0x0')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x267f('0x8')],'defaultValue':![]},'description':{'type':Sequelize[_0x267f('0x0')]},'notificationTemplate':{'type':Sequelize[_0x267f('0x9')],'defaultValue':function(){return _0x267f('0xa');}},'notificationSound':{'type':Sequelize[_0x267f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x267f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x267f('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x267f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x267f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x267f('0x0')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x267f('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x267f('0x8')],'defaultValue':![],'comment':_0x267f('0xd'),'set':function(_0x23c3ea){if(!_0x23c3ea)this[_0x267f('0xe')](_0x267f('0xf'),null);this[_0x267f('0xe')](_0x267f('0x10'),_0x23c3ea);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index ab74b71..a6282e0 100644 --- a/server/api/smsAccount/smsAccount.controller.js +++ b/server/api/smsAccount/smsAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bd0=['filter','merge','map','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','getDispositions','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','notify','sms','SmsApplication','applications','orderBy','priority','asc','account','Applications','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','twilio','from','From','messageId','MessageSid','skebby','sender','text','clicksend','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','refid','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','updatedAt','list','omit','contact','SmsInteraction','interaction','created','autoclose','push','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','List','DESC','out','Messages','spread','dataValues','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','intelepeer','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','register','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick'];(function(_0x200094,_0x3c4e87){var _0x22ee63=function(_0xb27f10){while(--_0xb27f10){_0x200094['push'](_0x200094['shift']());}};_0x22ee63(++_0x3c4e87);}(_0x0bd0,0x184));var _0x00bd=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x0bd0[_0x29e2af];return _0x1ea06a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x00bd('0x0'));var jsonpatch=require(_0x00bd('0x1'));var rp=require(_0x00bd('0x2'));var moment=require(_0x00bd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x00bd('0x4'));var util=require(_0x00bd('0x5'));var path=require(_0x00bd('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x00bd('0x7'));var fs=require('fs');var fs_extra=require(_0x00bd('0x8'));var _=require(_0x00bd('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x00bd('0xa'));var toCsv=require('to-csv');var querystring=require(_0x00bd('0xb'));var Papa=require(_0x00bd('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x00bd('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00bd('0xe'));var logger=require(_0x00bd('0xf'))(_0x00bd('0x10'));var utils=require(_0x00bd('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x00bd('0x12'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x00bd('0x13')](config[_0x00bd('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')[_0x00bd('0x15')](socket);var jayson=require(_0x00bd('0x16'));var client=jayson[_0x00bd('0x17')][_0x00bd('0x18')]({'port':0x232c});function respondWithRpcPromise(_0xb7d11a,_0x452e33,_0x27aeca,_0x1cde1c){return new BPromise(function(_0x6d18f5,_0x3eed89){var _0x20029a=_0x1cde1c||client;return _0x20029a[_0x00bd('0x19')](_0xb7d11a,_0x27aeca)['then'](function(_0x1afac0){logger[_0x00bd('0x1a')](_0x00bd('0x1b'),_0x452e33,_0x00bd('0x1c'));logger[_0x00bd('0x1d')](_0x00bd('0x1e'),_0x452e33,_0x00bd('0x1c'),JSON[_0x00bd('0x1f')](_0x1afac0));if(_0x1afac0[_0x00bd('0x20')]){if(_0x1afac0[_0x00bd('0x20')][_0x00bd('0x21')]===0x1f4){logger[_0x00bd('0x20')](_0x00bd('0x1b'),_0x452e33,_0x1afac0[_0x00bd('0x20')][_0x00bd('0x22')]);return _0x3eed89(_0x1afac0['error'][_0x00bd('0x22')]);}logger['error'](_0x00bd('0x1b'),_0x452e33,_0x1afac0[_0x00bd('0x20')][_0x00bd('0x22')]);return _0x6d18f5(_0x1afac0[_0x00bd('0x20')]['message']);}else{logger[_0x00bd('0x1a')]('SmsAccount,\x20%s,\x20%s',_0x452e33,_0x00bd('0x1c'));_0x6d18f5(_0x1afac0[_0x00bd('0x23')][_0x00bd('0x22')]);}})['catch'](function(_0xd79a7f){logger[_0x00bd('0x20')](_0x00bd('0x1b'),_0x452e33,_0xd79a7f);_0x3eed89(_0xd79a7f);});});}function respondWithStatusCode(_0x307f30,_0x21720a){_0x21720a=_0x21720a||0xcc;return function(_0x451271){if(_0x451271){return _0x307f30[_0x00bd('0x24')](_0x21720a);}return _0x307f30[_0x00bd('0x25')](_0x21720a)['end']();};}function respondWithResult(_0x381767,_0x49311e){_0x49311e=_0x49311e||0xc8;return function(_0x292613){if(_0x292613){return _0x381767[_0x00bd('0x25')](_0x49311e)[_0x00bd('0x26')](_0x292613);}};}function respondWithFilteredResult(_0x31d333,_0x3932ef){return function(_0x58c5ce){if(_0x58c5ce){var _0x5046b4=typeof _0x3932ef[_0x00bd('0x27')]===_0x00bd('0x28')&&typeof _0x3932ef[_0x00bd('0x29')]==='undefined';var _0x3f3b12=_0x58c5ce[_0x00bd('0x2a')];var _0x3194b7=_0x5046b4?0x0:_0x3932ef[_0x00bd('0x27')];var _0x330d63=_0x5046b4?_0x58c5ce[_0x00bd('0x2a')]:_0x3932ef['offset']+_0x3932ef['limit'];var _0x16ace1;if(_0x330d63>=_0x3f3b12){_0x330d63=_0x3f3b12;_0x16ace1=0xc8;}else{_0x16ace1=0xce;}_0x31d333[_0x00bd('0x25')](_0x16ace1);return _0x31d333[_0x00bd('0x2b')](_0x00bd('0x2c'),_0x3194b7+'-'+_0x330d63+'/'+_0x3f3b12)[_0x00bd('0x26')](_0x58c5ce);}return null;};}function patchUpdates(_0xb8796f){return function(_0x24df3d){try{jsonpatch['apply'](_0x24df3d,_0xb8796f,!![]);}catch(_0x673199){return BPromise[_0x00bd('0x2d')](_0x673199);}return _0x24df3d['save']();};}function saveUpdates(_0x47ff1d,_0x5c7aeb){return function(_0x3ea4bb){if(_0x3ea4bb){return _0x3ea4bb[_0x00bd('0x2e')](_0x47ff1d)[_0x00bd('0x2f')](function(_0x32a7d1){return _0x32a7d1;});}return null;};}function removeEntity(_0xffec7c,_0x2757ce){return function(_0x1db29d){if(_0x1db29d){return _0x1db29d[_0x00bd('0x30')]()[_0x00bd('0x2f')](function(){var _0x4fcca2=_0x1db29d[_0x00bd('0x31')]({'plain':!![]});var _0xb822f='SmsAccounts';return db[_0x00bd('0x32')]['destroy']({'where':{'type':_0xb822f,'resourceId':_0x4fcca2['id']}})['then'](function(){return _0x1db29d;});})[_0x00bd('0x2f')](function(){_0xffec7c[_0x00bd('0x25')](0xcc)[_0x00bd('0x33')]();});}};}function handleEntityNotFound(_0xf494d1,_0x4d1434){return function(_0x3526a6){if(!_0x3526a6){_0xf494d1[_0x00bd('0x24')](0x194);}return _0x3526a6;};}function handleError(_0x4d17c3,_0x23cb1c){_0x23cb1c=_0x23cb1c||0x1f4;return function(_0x45d14d){logger[_0x00bd('0x20')](_0x45d14d[_0x00bd('0x34')]);if(_0x45d14d[_0x00bd('0x35')]){delete _0x45d14d[_0x00bd('0x35')];}_0x4d17c3[_0x00bd('0x25')](_0x23cb1c)[_0x00bd('0x36')](_0x45d14d);};}exports['index']=function(_0x57e5ad,_0x4258db){var _0x405311={'include':[{'model':db[_0x00bd('0x37')],'as':_0x00bd('0x38')}]},_0x1ff8fb={},_0x4fc954={'count':0x0,'rows':[]};var _0x254360=_['map'](db[_0x00bd('0x39')][_0x00bd('0x3a')],function(_0x4946af){return{'name':_0x4946af[_0x00bd('0x3b')],'type':_0x4946af[_0x00bd('0x3c')][_0x00bd('0x3d')]};});_0x1ff8fb['model']=_['map'](_0x254360,_0x00bd('0x35'));_0x1ff8fb[_0x00bd('0x3e')]=_[_0x00bd('0x3f')](_0x57e5ad['query']);_0x1ff8fb[_0x00bd('0x40')]=_[_0x00bd('0x41')](_0x1ff8fb[_0x00bd('0x42')],_0x1ff8fb[_0x00bd('0x3e')]);_0x405311[_0x00bd('0x43')]=_[_0x00bd('0x41')](_0x1ff8fb['model'],qs['fields'](_0x57e5ad[_0x00bd('0x3e')]['fields']));_0x405311[_0x00bd('0x43')]=_0x405311[_0x00bd('0x43')][_0x00bd('0x44')]?_0x405311[_0x00bd('0x43')]:_0x1ff8fb['model'];if(!_0x57e5ad[_0x00bd('0x3e')]['hasOwnProperty'](_0x00bd('0x45'))){_0x405311['limit']=qs[_0x00bd('0x29')](_0x57e5ad['query'][_0x00bd('0x29')]);_0x405311['offset']=qs[_0x00bd('0x27')](_0x57e5ad['query'][_0x00bd('0x27')]);}_0x405311[_0x00bd('0x46')]=qs[_0x00bd('0x47')](_0x57e5ad[_0x00bd('0x3e')][_0x00bd('0x47')]);_0x405311[_0x00bd('0x48')]=qs['filters'](_[_0x00bd('0x49')](_0x57e5ad[_0x00bd('0x3e')],_0x1ff8fb[_0x00bd('0x40')]),_0x254360);if(_0x57e5ad[_0x00bd('0x3e')][_0x00bd('0x4a')]){_0x405311['where']=_[_0x00bd('0x4b')](_0x405311[_0x00bd('0x48')],{'$or':_[_0x00bd('0x4c')](_0x254360,function(_0x222a14){if(_0x222a14[_0x00bd('0x3c')]!=='VIRTUAL'){var _0x95b30d={};_0x95b30d[_0x222a14[_0x00bd('0x35')]]={'$like':'%'+_0x57e5ad[_0x00bd('0x3e')]['filter']+'%'};return _0x95b30d;}})});}_0x405311=_[_0x00bd('0x4b')]({},_0x405311,_0x57e5ad['options']);var _0x1dd27f={'where':_0x405311[_0x00bd('0x48')]};return db[_0x00bd('0x39')][_0x00bd('0x2a')](_0x1dd27f)[_0x00bd('0x2f')](function(_0x255f54){_0x4fc954[_0x00bd('0x2a')]=_0x255f54;if(_0x57e5ad[_0x00bd('0x3e')][_0x00bd('0x4d')]){_0x405311[_0x00bd('0x4e')]=[{'all':!![]}];}return db[_0x00bd('0x39')][_0x00bd('0x4f')](_0x405311);})[_0x00bd('0x2f')](function(_0x1973a3){_0x4fc954[_0x00bd('0x50')]=_0x1973a3;return _0x4fc954;})[_0x00bd('0x2f')](respondWithFilteredResult(_0x4258db,_0x405311))[_0x00bd('0x51')](handleError(_0x4258db,null));};exports[_0x00bd('0x52')]=function(_0x2658ae,_0x275315){var _0x15d0ab={'raw':![],'where':{'id':_0x2658ae[_0x00bd('0x53')]['id']},'include':[{'model':db[_0x00bd('0x37')],'as':_0x00bd('0x38')}]},_0x924ad1={};_0x924ad1[_0x00bd('0x42')]=_[_0x00bd('0x3f')](db[_0x00bd('0x39')][_0x00bd('0x3a')]);_0x924ad1[_0x00bd('0x3e')]=_[_0x00bd('0x3f')](_0x2658ae['query']);_0x924ad1['filters']=_[_0x00bd('0x41')](_0x924ad1[_0x00bd('0x42')],_0x924ad1[_0x00bd('0x3e')]);_0x15d0ab['attributes']=_[_0x00bd('0x41')](_0x924ad1[_0x00bd('0x42')],qs[_0x00bd('0x54')](_0x2658ae[_0x00bd('0x3e')]['fields']));_0x15d0ab['attributes']=_0x15d0ab[_0x00bd('0x43')]['length']?_0x15d0ab[_0x00bd('0x43')]:_0x924ad1[_0x00bd('0x42')];if(_0x2658ae[_0x00bd('0x3e')][_0x00bd('0x4d')]){_0x15d0ab[_0x00bd('0x4e')]=[{'all':!![]}];}_0x15d0ab=_[_0x00bd('0x4b')]({},_0x15d0ab,_0x2658ae[_0x00bd('0x55')]);return db[_0x00bd('0x39')][_0x00bd('0x56')](_0x15d0ab)['then'](handleEntityNotFound(_0x275315,null))[_0x00bd('0x2f')](respondWithResult(_0x275315,null))[_0x00bd('0x51')](handleError(_0x275315,null));};exports[_0x00bd('0x57')]=function(_0x516a20,_0x28bbd5){return db['SmsAccount']['create'](_0x516a20[_0x00bd('0x58')],{})[_0x00bd('0x2f')](function(_0x232b14){var _0xcb7f61=_0x516a20[_0x00bd('0x59')]['get']({'plain':!![]});if(!_0xcb7f61)throw new Error(_0x00bd('0x5a'));if(_0xcb7f61[_0x00bd('0x5b')]===_0x00bd('0x59')){var _0x3250b1=_0x232b14[_0x00bd('0x31')]({'plain':!![]});var _0x14af84=_0x00bd('0x5c');return db[_0x00bd('0x5d')][_0x00bd('0x56')]({'where':{'name':_0x14af84,'userProfileId':_0xcb7f61['userProfileId']},'raw':!![]})['then'](function(_0x1ac091){if(_0x1ac091&&_0x1ac091[_0x00bd('0x5e')]===0x0){return db[_0x00bd('0x32')][_0x00bd('0x57')]({'name':_0x3250b1[_0x00bd('0x35')],'resourceId':_0x3250b1['id'],'type':_0x1ac091[_0x00bd('0x35')],'sectionId':_0x1ac091['id']},{})[_0x00bd('0x2f')](function(){return _0x232b14;});}else{return _0x232b14;}})[_0x00bd('0x51')](function(_0x43aeee){logger['error'](_0x00bd('0x5f'),_0x43aeee);throw _0x43aeee;});}return _0x232b14;})['then'](respondWithResult(_0x28bbd5,0xc9))[_0x00bd('0x51')](handleError(_0x28bbd5,null));};exports[_0x00bd('0x2e')]=function(_0x2a2374,_0x4b15f7){if(_0x2a2374['body']['id']){delete _0x2a2374[_0x00bd('0x58')]['id'];}return db[_0x00bd('0x39')][_0x00bd('0x56')]({'where':{'id':_0x2a2374[_0x00bd('0x53')]['id']},'include':[{'model':db[_0x00bd('0x37')],'as':_0x00bd('0x38')}]})[_0x00bd('0x2f')](handleEntityNotFound(_0x4b15f7,null))[_0x00bd('0x2f')](saveUpdates(_0x2a2374[_0x00bd('0x58')],null))[_0x00bd('0x2f')](respondWithResult(_0x4b15f7,null))['catch'](handleError(_0x4b15f7,null));};exports[_0x00bd('0x30')]=function(_0x26acde,_0x1d8f67){return db['SmsAccount'][_0x00bd('0x56')]({'where':{'id':_0x26acde['params']['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x1d8f67,null))[_0x00bd('0x2f')](removeEntity(_0x1d8f67,null))[_0x00bd('0x51')](handleError(_0x1d8f67,null));};exports['describe']=function(_0x214b6f,_0x464da0){return db['SmsAccount'][_0x00bd('0x60')]()[_0x00bd('0x2f')](respondWithResult(_0x464da0,null))['catch'](handleError(_0x464da0,null));};exports[_0x00bd('0x61')]=function(_0x573316,_0x145c8a,_0x523e6f){if(_0x573316[_0x00bd('0x58')]['id']){delete _0x573316['body']['id'];}return db[_0x00bd('0x39')][_0x00bd('0x56')]({'where':{'id':_0x573316[_0x00bd('0x53')]['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x145c8a,null))[_0x00bd('0x2f')](function(_0x5b3924){if(_0x5b3924){_0x573316['body'][_0x00bd('0x62')]=_0x5b3924['id'];return db['Disposition']['create'](_0x573316[_0x00bd('0x58')]);}})[_0x00bd('0x2f')](respondWithResult(_0x145c8a,null))[_0x00bd('0x51')](handleError(_0x145c8a,null));};exports[_0x00bd('0x63')]=function(_0x39a1f8,_0x2ff1ac,_0xe174b){var _0x141301={'raw':![],'where':{}};var _0x201c6e={};var _0x4379e8={'count':0x0,'rows':[]};return db[_0x00bd('0x39')]['findOne']({'where':{'id':_0x39a1f8[_0x00bd('0x53')]['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x2ff1ac,null))[_0x00bd('0x2f')](function(_0x52d78c){if(_0x52d78c){_0x201c6e[_0x00bd('0x42')]=_[_0x00bd('0x3f')](db[_0x00bd('0x64')]['rawAttributes']);_0x201c6e[_0x00bd('0x3e')]=_['keys'](_0x39a1f8['query']);_0x201c6e[_0x00bd('0x40')]=_[_0x00bd('0x41')](_0x201c6e[_0x00bd('0x42')],_0x201c6e[_0x00bd('0x3e')]);_0x141301[_0x00bd('0x43')]=_[_0x00bd('0x41')](_0x201c6e[_0x00bd('0x42')],qs['fields'](_0x39a1f8['query']['fields']));_0x141301[_0x00bd('0x43')]=_0x141301[_0x00bd('0x43')][_0x00bd('0x44')]?_0x141301['attributes']:_0x201c6e[_0x00bd('0x42')];if(!_0x39a1f8['query'][_0x00bd('0x65')](_0x00bd('0x45'))){_0x141301[_0x00bd('0x29')]=qs[_0x00bd('0x29')](_0x39a1f8['query'][_0x00bd('0x29')]);_0x141301[_0x00bd('0x27')]=qs[_0x00bd('0x27')](_0x39a1f8['query'][_0x00bd('0x27')]);}_0x141301['order']=qs[_0x00bd('0x47')](_0x39a1f8['query'][_0x00bd('0x47')]);_0x141301['where']=qs['filters'](_[_0x00bd('0x49')](_0x39a1f8[_0x00bd('0x3e')],_0x201c6e['filters']));_0x141301[_0x00bd('0x48')][_0x00bd('0x62')]=_0x52d78c['id'];if(_0x39a1f8[_0x00bd('0x3e')][_0x00bd('0x4a')]){_0x141301['where']=_[_0x00bd('0x4b')](_0x141301[_0x00bd('0x48')],{'$or':_['map'](_0x141301[_0x00bd('0x43')],function(_0xdc1603){var _0x57f5cc={};_0x57f5cc[_0xdc1603]={'$like':'%'+_0x39a1f8[_0x00bd('0x3e')][_0x00bd('0x4a')]+'%'};return _0x57f5cc;})});}_0x141301=_[_0x00bd('0x4b')]({},_0x141301,_0x39a1f8['options']);return db[_0x00bd('0x64')][_0x00bd('0x2a')]({'where':_0x141301[_0x00bd('0x48')]})[_0x00bd('0x2f')](function(_0x448517){_0x4379e8[_0x00bd('0x2a')]=_0x448517;if(_0x39a1f8[_0x00bd('0x3e')][_0x00bd('0x4d')]){_0x141301[_0x00bd('0x4e')]=[{'all':!![]}];}return db[_0x00bd('0x64')][_0x00bd('0x4f')](_0x141301);})['then'](function(_0x31123f){_0x4379e8[_0x00bd('0x50')]=_0x31123f;return _0x4379e8;});}})[_0x00bd('0x2f')](respondWithFilteredResult(_0x2ff1ac,_0x141301))['catch'](handleError(_0x2ff1ac,null));};exports[_0x00bd('0x66')]=function(_0x6e3bd9,_0x7e0905,_0x2ca375){return db['SmsAccount'][_0x00bd('0x56')]({'where':{'id':_0x6e3bd9['params']['id']}})['then'](handleEntityNotFound(_0x7e0905,null))['then'](function(_0x24a32d){if(_0x24a32d){return _0x24a32d[_0x00bd('0x66')](_0x6e3bd9[_0x00bd('0x3e')][_0x00bd('0x67')]);}})[_0x00bd('0x2f')](respondWithStatusCode(_0x7e0905,null))['catch'](handleError(_0x7e0905,null));};exports[_0x00bd('0x68')]=function(_0x37e55c,_0x581e59,_0x37be19){if(_0x37e55c['body']['id']){delete _0x37e55c[_0x00bd('0x58')]['id'];}return db[_0x00bd('0x39')]['find']({'where':{'id':_0x37e55c[_0x00bd('0x53')]['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x581e59,null))[_0x00bd('0x2f')](function(_0x304758){if(_0x304758){_0x37e55c[_0x00bd('0x58')][_0x00bd('0x62')]=_0x304758['id'];return db['CannedAnswer'][_0x00bd('0x57')](_0x37e55c[_0x00bd('0x58')]);}})[_0x00bd('0x2f')](respondWithResult(_0x581e59,null))[_0x00bd('0x51')](handleError(_0x581e59,null));};exports[_0x00bd('0x69')]=function(_0x2d9591,_0x49fca6,_0x38a912){var _0x193b58={'raw':![],'where':{}};var _0x3724c3={};var _0x345c8d={'count':0x0,'rows':[]};return db[_0x00bd('0x39')][_0x00bd('0x6a')]({'where':{'id':_0x2d9591['params']['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x49fca6,null))['then'](function(_0xb4efcf){if(_0xb4efcf){_0x3724c3[_0x00bd('0x42')]=_[_0x00bd('0x3f')](db['CannedAnswer']['rawAttributes']);_0x3724c3['query']=_[_0x00bd('0x3f')](_0x2d9591[_0x00bd('0x3e')]);_0x3724c3['filters']=_[_0x00bd('0x41')](_0x3724c3['model'],_0x3724c3[_0x00bd('0x3e')]);_0x193b58['attributes']=_[_0x00bd('0x41')](_0x3724c3[_0x00bd('0x42')],qs[_0x00bd('0x54')](_0x2d9591[_0x00bd('0x3e')]['fields']));_0x193b58[_0x00bd('0x43')]=_0x193b58['attributes']['length']?_0x193b58[_0x00bd('0x43')]:_0x3724c3[_0x00bd('0x42')];if(!_0x2d9591[_0x00bd('0x3e')][_0x00bd('0x65')](_0x00bd('0x45'))){_0x193b58[_0x00bd('0x29')]=qs[_0x00bd('0x29')](_0x2d9591[_0x00bd('0x3e')]['limit']);_0x193b58['offset']=qs[_0x00bd('0x27')](_0x2d9591[_0x00bd('0x3e')][_0x00bd('0x27')]);}_0x193b58[_0x00bd('0x46')]=qs[_0x00bd('0x47')](_0x2d9591[_0x00bd('0x3e')][_0x00bd('0x47')]);_0x193b58['where']=qs[_0x00bd('0x40')](_['pick'](_0x2d9591[_0x00bd('0x3e')],_0x3724c3[_0x00bd('0x40')]));_0x193b58[_0x00bd('0x48')]['SmsAccountId']=_0xb4efcf['id'];if(_0x2d9591['query'][_0x00bd('0x4a')]){_0x193b58[_0x00bd('0x48')]=_[_0x00bd('0x4b')](_0x193b58[_0x00bd('0x48')],{'$or':_[_0x00bd('0x4c')](_0x193b58[_0x00bd('0x43')],function(_0x1dfa40){var _0x4dc35e={};_0x4dc35e[_0x1dfa40]={'$like':'%'+_0x2d9591[_0x00bd('0x3e')][_0x00bd('0x4a')]+'%'};return _0x4dc35e;})});}_0x193b58=_[_0x00bd('0x4b')]({},_0x193b58,_0x2d9591[_0x00bd('0x55')]);return db[_0x00bd('0x6b')][_0x00bd('0x2a')]({'where':_0x193b58[_0x00bd('0x48')]})['then'](function(_0x2d7a6e){_0x345c8d[_0x00bd('0x2a')]=_0x2d7a6e;if(_0x2d9591['query'][_0x00bd('0x4d')]){_0x193b58['include']=[{'all':!![]}];}return db[_0x00bd('0x6b')][_0x00bd('0x4f')](_0x193b58);})[_0x00bd('0x2f')](function(_0x157112){_0x345c8d[_0x00bd('0x50')]=_0x157112;return _0x345c8d;});}})['then'](respondWithFilteredResult(_0x49fca6,_0x193b58))['catch'](handleError(_0x49fca6,null));};exports[_0x00bd('0x6c')]=function(_0x1a3e4d,_0x3638cd,_0x4f8ee2){return db[_0x00bd('0x39')][_0x00bd('0x56')]({'where':{'id':_0x1a3e4d[_0x00bd('0x53')]['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x3638cd,null))['then'](function(_0x4eb85c){if(_0x4eb85c){return _0x4eb85c['removeAnswers'](_0x1a3e4d[_0x00bd('0x3e')]['ids']);}})[_0x00bd('0x2f')](respondWithStatusCode(_0x3638cd,null))[_0x00bd('0x51')](handleError(_0x3638cd,null));};exports[_0x00bd('0x6d')]=function(_0x574005,_0x6f9837,_0x5783f6){var _0x4bfd3a={'channel':_0x00bd('0x6e')};var _0x4bba95=[];var _0x383b54=[];var _0x5b3ac2={};return db[_0x00bd('0x39')]['find']({'where':{'id':_0x574005[_0x00bd('0x53')]['id']},'include':[{'model':db[_0x00bd('0x6f')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x6f9837,null))[_0x00bd('0x2f')](function(_0x13234b){_0x4bfd3a['account']=_0x13234b;_0x4bfd3a[_0x00bd('0x70')]=_[_0x00bd('0x71')](_0x13234b['Applications'],[_0x00bd('0x72')],[_0x00bd('0x73')]);if(_0x4bfd3a[_0x00bd('0x74')][_0x00bd('0x75')]){delete _0x4bfd3a[_0x00bd('0x74')]['Applications'];}return db[_0x00bd('0x76')]['describe']();})[_0x00bd('0x2f')](function(_0x4fc8d8){if(!_0x4fc8d8){throw new db[(_0x00bd('0x77'))]['ValidationError'](_0x00bd('0x78'));}_0x4bba95=_[_0x00bd('0x79')](_[_0x00bd('0x3f')](_0x4fc8d8),[_0x00bd('0x7a'),'updatedAt']);_0x383b54=_[_0x00bd('0x79')](_[_0x00bd('0x3f')](_0x4fc8d8),['createdAt','updatedAt',_0x00bd('0x7b'),_0x00bd('0x7c')]);_0x4bfd3a[_0x00bd('0x58')]={'mapKey':'mobile'};if(_0x4bfd3a[_0x00bd('0x74')][_0x00bd('0x3c')]){switch(_0x4bfd3a['account'][_0x00bd('0x3c')]){case _0x00bd('0x7d'):_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x7f')];_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x58')]=_0x574005[_0x00bd('0x58')]['Body'];_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x80')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x81')];break;case _0x00bd('0x82'):_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')]='+'+_0x574005[_0x00bd('0x58')][_0x00bd('0x83')];_0x4bfd3a['body'][_0x00bd('0x58')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x84')];break;case'connectel':_0x4bfd3a['body'][_0x00bd('0x7e')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x7e')];_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x58')]=_0x574005[_0x00bd('0x58')]['message'];break;case _0x00bd('0x85'):_0x4bfd3a[_0x00bd('0x58')]['from']=_0x574005['body']['from'];_0x4bfd3a[_0x00bd('0x58')]['body']=_0x574005['body'][_0x00bd('0x58')];_0x4bfd3a[_0x00bd('0x58')]['messageId']=_0x574005['body'][_0x00bd('0x86')];break;case'plivo':_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')]=_0x574005['body'][_0x00bd('0x7f')];_0x4bfd3a['body'][_0x00bd('0x58')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x87')];_0x4bfd3a['body'][_0x00bd('0x80')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x88')];break;case _0x00bd('0x89'):_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')]='+'+_0x574005['body'][_0x00bd('0x8a')][0x0]['from'];_0x4bfd3a['body'][_0x00bd('0x58')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x8a')][0x0][_0x00bd('0x84')];_0x4bfd3a['body'][_0x00bd('0x80')]=_0x574005[_0x00bd('0x58')]['results'][0x0][_0x00bd('0x80')];break;case _0x00bd('0x8b'):_0x4bfd3a[_0x00bd('0x58')]['from']=_0x574005[_0x00bd('0x58')][_0x00bd('0x8c')];_0x4bfd3a['body'][_0x00bd('0x58')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x8d')][_0x00bd('0x22')];break;case'clickatell':_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')]=_0x574005['body'][_0x00bd('0x8e')];_0x4bfd3a[_0x00bd('0x58')]['body']=_0x574005[_0x00bd('0x58')][_0x00bd('0x84')];_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x80')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x8f')];break;case _0x00bd('0x90'):_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x80')]=_0x574005[_0x00bd('0x58')][0x0][_0x00bd('0x22')]['id'];_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')]=_0x574005[_0x00bd('0x58')][0x0][_0x00bd('0x22')][_0x00bd('0x7e')];_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x58')]=_0x574005['body'][0x0][_0x00bd('0x22')]['text'];break;case'intelepeer':_0x4bfd3a['body'][_0x00bd('0x7e')]=_0x574005[_0x00bd('0x58')]['from'];_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x58')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x22')];_0x4bfd3a['body'][_0x00bd('0x80')]=_0x574005[_0x00bd('0x58')][_0x00bd('0x91')];break;}}if(_0x4bfd3a[_0x00bd('0x58')]['id']){delete _0x4bfd3a[_0x00bd('0x58')]['id'];}if(_['isNil'](_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')])){throw new db[(_0x00bd('0x77'))][(_0x00bd('0x92'))](_0x00bd('0x93'));}if(_[_0x00bd('0x94')](_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x58')])||_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x58')]===''){throw new db[(_0x00bd('0x77'))][(_0x00bd('0x92'))](_0x00bd('0x95'));}if(_[_0x00bd('0x94')](_0x4bfd3a[_0x00bd('0x58')]['mapKey'])){throw new db[(_0x00bd('0x77'))]['ValidationError'](_0x00bd('0x96')+_0x383b54);}if(!_['includes'](_0x383b54,_0x4bfd3a[_0x00bd('0x58')]['mapKey'])){throw new db[(_0x00bd('0x77'))]['ValidationError'](_0x00bd('0x97')+_0x383b54);}_0x5b3ac2[_0x4bfd3a['body'][_0x00bd('0x98')]]=_0x4bfd3a['body'][_0x00bd('0x7e')];return db[_0x00bd('0x99')]['find']({'where':{'id':_0x4bfd3a[_0x00bd('0x74')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x00bd('0x9a'),'where':_0x5b3ac2,'limit':0x1,'order':[[_0x00bd('0x9b'),'DESC']]}]});})[_0x00bd('0x2f')](handleEntityNotFound(_0x6f9837,null))[_0x00bd('0x2f')](function(_0x541c8b){if(_0x541c8b){_0x4bfd3a[_0x00bd('0x9c')]=_[_0x00bd('0x9d')](_0x541c8b,[_0x00bd('0x9a')]);if(_0x541c8b[_0x00bd('0x9a')]['length']){return _0x541c8b[_0x00bd('0x9a')][0x0];}var _0x50f55c=_['defaults'](_0x4bfd3a['body'],{'firstName':_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')],'ListId':_0x541c8b['id']});_0x50f55c[_0x4bfd3a['body'][_0x00bd('0x98')]]=_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')];return db['CmContact'][_0x00bd('0x57')](_0x50f55c,{'fields':_0x4bba95,'raw':!![]});}})[_0x00bd('0x2f')](handleEntityNotFound(_0x6f9837,null))[_0x00bd('0x2f')](function(_0x4738c0){if(_0x4738c0){_0x4bfd3a[_0x00bd('0x9e')]=_0x4738c0;var _0x14c24c={'ContactId':_0x4738c0['id'],'phone':_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')],'SmsAccountId':_0x574005[_0x00bd('0x53')]['id']};var _0xa2a817={'ContactId':_0x4738c0['id'],'SmsAccountId':_0x574005['params']['id'],'closed':![]};return db['SmsInteraction'][_0x00bd('0x56')]({'where':_0xa2a817})[_0x00bd('0x2f')](function(_0x14f362){if(_0x14f362){return[_0x14f362,![]];}return db[_0x00bd('0x9f')][_0x00bd('0x57')](_0x14c24c)['then'](function(_0x54568e){return[_0x54568e,!![]];});});}})['spread'](function(_0x35040a,_0x2e7f97){_0x4bfd3a[_0x00bd('0xa0')]=_0x35040a['get']({'plain':!![]});_0x4bfd3a[_0x00bd('0xa0')][_0x00bd('0xa1')]=![];if(_0x2e7f97){if(_0x4bfd3a[_0x00bd('0x74')][_0x00bd('0xa2')]){_0x4bfd3a['applications'][_0x00bd('0xa3')]({'id':0x0,'priority':_0x4bfd3a[_0x00bd('0x70')][_0x00bd('0x44')]+0x1,'app':'close','appdata':_0x00bd('0xa4'),'interval':_0x00bd('0xa5')});}_0x4bfd3a[_0x00bd('0xa0')]['created']=!![];}return db[_0x00bd('0xa6')][_0x00bd('0x57')]({'phone':_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x7e')],'messageId':_0x4bfd3a['body'][_0x00bd('0x80')],'body':_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0x58')],'SmsAccountId':_0x574005[_0x00bd('0x53')]['id'],'SmsInteractionId':_0x35040a['id'],'direction':'in','ContactId':_0x35040a[_0x00bd('0xa7')],'AttachmentId':_0x4bfd3a[_0x00bd('0x58')][_0x00bd('0xa8')]});})[_0x00bd('0x2f')](function(_0x3b4a92){_0x4bfd3a[_0x00bd('0x22')]=_0x3b4a92;if(_0x4bfd3a[_0x00bd('0xa0')][_0x00bd('0xa9')]){return db[_0x00bd('0xaa')][_0x00bd('0x56')]({'attributes':['id',_0x00bd('0x35')],'where':{'id':_0x4bfd3a[_0x00bd('0xa0')][_0x00bd('0xa9')]}})[_0x00bd('0x2f')](function(_0x2765bc){if(_0x2765bc){_0x4bfd3a[_0x00bd('0x70')]['unshift']({'id':0x0,'priority':0x0,'app':_0x00bd('0xab'),'appdata':_0x2765bc[_0x00bd('0x35')]+','+(_0x4bfd3a['account'][_0x00bd('0xac')]||0xa),'interval':_0x00bd('0xa5')});}return respondWithRpcPromise('Start','startRouting',_0x4bfd3a);});}return respondWithRpcPromise(_0x00bd('0xad'),_0x00bd('0xae'),_0x4bfd3a);})['then'](function(_0x1a0af6){if(_0x1a0af6){var _0x5b3295=0xc8;var _0x5b3b7b=_0x00bd('0xaf');logger[_0x00bd('0x1a')](_0x00bd('0x1e'),_0x5b3b7b,_0x5b3295,_0x00bd('0xb0'));logger[_0x00bd('0x1d')](_0x00bd('0xb1'),_0x5b3b7b,_0x5b3295,'entity\x20found',JSON[_0x00bd('0x1f')](_0x1a0af6));if(_0x4bfd3a[_0x00bd('0x74')][_0x00bd('0x3c')]===_0x00bd('0x7d')){return _0x6f9837[_0x00bd('0x25')](_0x5b3295)[_0x00bd('0x2b')](_0x00bd('0xb2'),_0x00bd('0xb3'))['send'](_0x00bd('0xb4'));}else{return _0x6f9837[_0x00bd('0x25')](_0x5b3295)[_0x00bd('0x26')](_0x1a0af6);}}})[_0x00bd('0x51')](handleError(_0x6f9837,null));};exports[_0x00bd('0xb5')]=function(_0x66b63b,_0x577308){var _0xbd3bad=_0x66b63b[_0x00bd('0x53')]['id'];var _0x5033d5=_0x66b63b['body'];var _0x44a524=0xc8;var _0x149f3c=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x00bd('0xb6')][_0x00bd('0xb7')][_0x00bd('0xb8')][_0x00bd('0xb9')]},function(_0x478e94){return db['SmsAccount']['findOne']({'where':{'id':_0xbd3bad},'transaction':_0x478e94})[_0x00bd('0x2f')](function(_0x3f9a3d){if(_0x3f9a3d){return db['SmsApplication'][_0x00bd('0x30')]({'where':{'SmsAccountId':_0xbd3bad},'transaction':_0x478e94})[_0x00bd('0x2f')](function(){var _0xe32908=_[_0x00bd('0x4c')](_0x5033d5,function(_0x5a6283){_0x5a6283[_0x00bd('0x62')]=_0xbd3bad;return _0x5a6283;});return db[_0x00bd('0x6f')][_0x00bd('0xba')](_0xe32908,{'transaction':_0x478e94});});}else{_0x44a524=0x194;_0x149f3c=[];}});})[_0x00bd('0x2f')](function(){if(_0x44a524!==0x194){return db[_0x00bd('0x6f')][_0x00bd('0xbb')]({'where':{'SmsAccountId':_0xbd3bad},'order':_0x00bd('0x72')})[_0x00bd('0x2f')](function(_0x237ea1){_0x149f3c=_0x237ea1;});}})['catch'](function(_0x2682d3){_0x44a524=0x1f4;logger[_0x00bd('0x20')](_0x2682d3[_0x00bd('0x34')]);if(_0x2682d3[_0x00bd('0x35')]){delete _0x2682d3[_0x00bd('0x35')];}_0x149f3c=_0x2682d3;})[_0x00bd('0xbc')](function(){if(_0x149f3c===null){_0x577308[_0x00bd('0x24')](_0x44a524);}else{if(_0x44a524===0x1f4){_0x577308['status'](_0x44a524)[_0x00bd('0x36')](_0x149f3c);}else{_0x577308[_0x00bd('0x25')](_0x44a524)[_0x00bd('0x26')](_0x149f3c);}}});};exports[_0x00bd('0xbd')]=function(_0x323a80,_0x88587,_0x40cb0d){var _0x5295aa={};var _0x35686b={};var _0x5467e2;var _0x3ddcc2;return db[_0x00bd('0x39')][_0x00bd('0x6a')]({'where':{'id':_0x323a80[_0x00bd('0x53')]['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x88587,null))[_0x00bd('0x2f')](function(_0x9ee4cf){if(_0x9ee4cf){_0x5467e2=_0x9ee4cf;_0x35686b[_0x00bd('0x42')]=_[_0x00bd('0x3f')](db[_0x00bd('0x6f')][_0x00bd('0x3a')]);_0x35686b[_0x00bd('0x3e')]=_['keys'](_0x323a80['query']);_0x35686b['filters']=_[_0x00bd('0x41')](_0x35686b[_0x00bd('0x42')],_0x35686b[_0x00bd('0x3e')]);_0x5295aa[_0x00bd('0x43')]=_[_0x00bd('0x41')](_0x35686b[_0x00bd('0x42')],qs[_0x00bd('0x54')](_0x323a80[_0x00bd('0x3e')][_0x00bd('0x54')]));_0x5295aa[_0x00bd('0x43')]=_0x5295aa[_0x00bd('0x43')]['length']?_0x5295aa[_0x00bd('0x43')]:_0x35686b[_0x00bd('0x42')];_0x5295aa[_0x00bd('0x46')]=qs[_0x00bd('0x47')](_0x323a80[_0x00bd('0x3e')]['sort']);_0x5295aa[_0x00bd('0x48')]=qs[_0x00bd('0x40')](_[_0x00bd('0x49')](_0x323a80['query'],_0x35686b[_0x00bd('0x40')]));if(_0x323a80[_0x00bd('0x3e')][_0x00bd('0x4a')]){_0x5295aa[_0x00bd('0x48')]=_['merge'](_0x5295aa[_0x00bd('0x48')],{'$or':_[_0x00bd('0x4c')](_0x5295aa[_0x00bd('0x43')],function(_0x326890){var _0x44b77f={};_0x44b77f[_0x326890]={'$like':'%'+_0x323a80[_0x00bd('0x3e')][_0x00bd('0x4a')]+'%'};return _0x44b77f;})});}_0x5295aa=_[_0x00bd('0x4b')]({},_0x5295aa,_0x323a80[_0x00bd('0x55')]);return _0x5467e2[_0x00bd('0xbd')](_0x5295aa);}})['then'](function(_0x26b863){if(_0x26b863){_0x3ddcc2=_0x26b863[_0x00bd('0x44')];if(!_0x323a80['query'][_0x00bd('0x65')](_0x00bd('0x45'))){_0x5295aa[_0x00bd('0x29')]=qs['limit'](_0x323a80['query'][_0x00bd('0x29')]);_0x5295aa['offset']=qs[_0x00bd('0x27')](_0x323a80['query'][_0x00bd('0x27')]);}return _0x5467e2['getApplications'](_0x5295aa);}})['then'](function(_0x16f878){if(_0x16f878){return _0x16f878?{'count':_0x3ddcc2,'rows':_0x16f878}:null;}})['then'](respondWithResult(_0x88587,null))[_0x00bd('0x51')](handleError(_0x88587,null));};exports[_0x00bd('0xbe')]=function(_0x4a140f,_0x5fa84e,_0x56718a){var _0x4ca29a={'raw':![],'where':{}};var _0x567ee6={};var _0x54c1ff={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4a140f[_0x00bd('0x53')]['id']}})['then'](handleEntityNotFound(_0x5fa84e,null))[_0x00bd('0x2f')](function(_0x414a0f){if(_0x414a0f){_0x567ee6['model']=_[_0x00bd('0x3f')](db['SmsInteraction'][_0x00bd('0x3a')]);_0x567ee6[_0x00bd('0x3e')]=_['keys'](_0x4a140f[_0x00bd('0x3e')]);_0x567ee6['filters']=_['intersection'](_0x567ee6[_0x00bd('0x42')],_0x567ee6['query']);_0x4ca29a['attributes']=_[_0x00bd('0x41')](_0x567ee6[_0x00bd('0x42')],qs[_0x00bd('0x54')](_0x4a140f[_0x00bd('0x3e')][_0x00bd('0x54')]));_0x4ca29a[_0x00bd('0x43')]=_0x4ca29a[_0x00bd('0x43')]['length']?_0x4ca29a[_0x00bd('0x43')]:_0x567ee6[_0x00bd('0x42')];if(!_0x4a140f[_0x00bd('0x3e')][_0x00bd('0x65')](_0x00bd('0x45'))){_0x4ca29a[_0x00bd('0x29')]=qs['limit'](_0x4a140f['query'][_0x00bd('0x29')]);_0x4ca29a['offset']=qs[_0x00bd('0x27')](_0x4a140f[_0x00bd('0x3e')][_0x00bd('0x27')]);}_0x4ca29a[_0x00bd('0x46')]=qs[_0x00bd('0x47')](_0x4a140f['query'][_0x00bd('0x47')]);_0x4ca29a[_0x00bd('0x48')]=qs[_0x00bd('0x40')](_[_0x00bd('0x49')](_0x4a140f['query'],_0x567ee6[_0x00bd('0x40')]));_0x4ca29a[_0x00bd('0x48')][_0x00bd('0x62')]=_0x414a0f['id'];if(_0x4a140f[_0x00bd('0x3e')]['filter']){_0x4ca29a['where']=_[_0x00bd('0x4b')](_0x4ca29a[_0x00bd('0x48')],{'$or':_[_0x00bd('0x4c')](_0x4ca29a['attributes'],function(_0x10be03){var _0x1b9628={};_0x1b9628[_0x10be03]={'$like':'%'+_0x4a140f['query'][_0x00bd('0x4a')]+'%'};return _0x1b9628;})});}_0x4ca29a=_[_0x00bd('0x4b')]({},_0x4ca29a,_0x4a140f['options']);return db['SmsInteraction'][_0x00bd('0x2a')]({'where':_0x4ca29a[_0x00bd('0x48')]})[_0x00bd('0x2f')](function(_0x37407f){_0x54c1ff[_0x00bd('0x2a')]=_0x37407f;if(_0x4a140f[_0x00bd('0x3e')][_0x00bd('0x4d')]){_0x4ca29a['include']=[{'model':db['CmContact'],'as':_0x00bd('0xbf'),'required':![]},{'model':db[_0x00bd('0xaa')],'as':_0x00bd('0xc0'),'attributes':[_0x00bd('0x35'),_0x00bd('0xc1'),_0x00bd('0xc2')],'required':![]},{'model':db[_0x00bd('0xc3')],'as':'Tags','attributes':['id',_0x00bd('0x35'),_0x00bd('0xc4')],'where':_0x4a140f[_0x00bd('0x3e')]['tag']?{'id':_0x4a140f[_0x00bd('0x3e')][_0x00bd('0xc5')]}:undefined,'required':_0x4a140f['query'][_0x00bd('0xc5')]?!![]:![]}];}return db[_0x00bd('0x9f')][_0x00bd('0x4f')](_0x4ca29a);})['then'](function(_0x5befc5){_0x54c1ff[_0x00bd('0x50')]=_0x5befc5;return _0x54c1ff;});}})['then'](respondWithFilteredResult(_0x5fa84e,_0x4ca29a))[_0x00bd('0x51')](handleError(_0x5fa84e,null));};exports[_0x00bd('0x36')]=function(_0x15d8ec,_0x2fb435,_0x5ac61f){var _0x385959,_0x2ab13e,_0x31b859;if(_['isNil'](_0x15d8ec['body'][_0x00bd('0x58')])||_0x15d8ec[_0x00bd('0x58')][_0x00bd('0x58')]===''){throw new db[(_0x00bd('0x77'))][(_0x00bd('0x92'))](_0x00bd('0x95'));}if(_[_0x00bd('0x94')](_0x15d8ec[_0x00bd('0x58')]['to'])){throw new db[(_0x00bd('0x77'))][(_0x00bd('0x92'))]('to\x20is\x20mandatory');}_0x385959=_0x15d8ec[_0x00bd('0x58')]['to'];return db[_0x00bd('0x39')][_0x00bd('0x56')]({'where':{'id':_0x15d8ec['params']['id']},'include':[{'model':db[_0x00bd('0x99')],'as':_0x00bd('0xc6'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x385959},'limit':0x1,'order':[[_0x00bd('0x9b'),_0x00bd('0xc7')]]}]}]})[_0x00bd('0x2f')](handleEntityNotFound(_0x2fb435,null))[_0x00bd('0x2f')](function(_0x23a131){if(_0x23a131&&_0x23a131[_0x00bd('0xc6')]){_0x2ab13e=_0x23a131['get']({'plain':!![]});if(_0x2ab13e['List']&&_0x2ab13e[_0x00bd('0xc6')][_0x00bd('0x9a')][_0x00bd('0x44')]){return _0x2ab13e[_0x00bd('0xc6')][_0x00bd('0x9a')][0x0];}return db[_0x00bd('0x76')]['create'](_[_0x00bd('0x13')](_0x15d8ec['body'],{'firstName':_0x385959,'mobile':_0x385959,'phone':_0x385959,'ListId':_0x2ab13e[_0x00bd('0x7c')]}));}})[_0x00bd('0x2f')](handleEntityNotFound(_0x2fb435,null))['then'](function(_0x10e665){if(_0x10e665){_0x31b859=_0x10e665;return db[_0x00bd('0x9f')][_0x00bd('0x56')]({'where':{'ContactId':_0x31b859['id'],'closed':![],'SmsAccountId':_0x2ab13e['id']}})['then'](function(_0x19b811){if(_0x19b811){return[_0x19b811,![]];}return db[_0x00bd('0x9f')]['create']({'UserId':_0x15d8ec[_0x00bd('0x59')]['id'],'ContactId':_0x31b859['id'],'SmsAccountId':_0x2ab13e['id'],'phone':_0x385959,'firstMsgDirection':_0x00bd('0xc8'),'Messages':[_[_0x00bd('0x4b')](_0x15d8ec[_0x00bd('0x58')],{'read':![],'body':_0x15d8ec['body'][_0x00bd('0x58')],'phone':_0x385959,'SmsAccountId':_0x2ab13e['id'],'UserId':_0x15d8ec['user']['id'],'ContactId':_0x31b859['id']})]},{'include':[{'model':db[_0x00bd('0xa6')],'as':_0x00bd('0xc9')}]})[_0x00bd('0x2f')](function(_0x2ffbb3){return[_0x2ffbb3,!![]];});});}})[_0x00bd('0xca')](function(_0x5ae9c3,_0x1e9194){if(_0x1e9194){return _0x5ae9c3;}return db[_0x00bd('0xa6')]['create'](_[_0x00bd('0x4b')](_0x15d8ec[_0x00bd('0x58')],{'read':![],'body':_0x15d8ec[_0x00bd('0x58')][_0x00bd('0x58')],'phone':_0x385959,'SmsAccountId':_0x2ab13e['id'],'SmsInteractionId':_0x5ae9c3['id'],'UserId':_0x15d8ec[_0x00bd('0x59')]['id'],'ContactId':_0x31b859['id']}))[_0x00bd('0x2f')](function(_0x3b04e0){_0x5ae9c3[_0x00bd('0xcb')]['Messages']=[];_0x5ae9c3[_0x00bd('0xcb')][_0x00bd('0xc9')][_0x00bd('0xa3')](_0x3b04e0[_0x00bd('0xcb')]);return _0x5ae9c3;});})[_0x00bd('0x2f')](respondWithResult(_0x2fb435,null))['catch'](handleError(_0x2fb435,null));};exports[_0x00bd('0x25')]=function(_0x30bf00,_0x50e143,_0x5acd2d){if(_0x30bf00[_0x00bd('0x58')]['id']){delete _0x30bf00[_0x00bd('0x58')]['id'];}var _0xa76c40,_0x3a78b3,_0x58abcc;return db[_0x00bd('0x39')][_0x00bd('0x56')]({'where':{'id':_0x30bf00['params']['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x50e143,null))[_0x00bd('0x2f')](function(_0x5bea77){if(_0x5bea77){_0x58abcc=_0x5bea77;logger[_0x00bd('0x1d')](_0x00bd('0x1e'),_0x00bd('0x25'),'received\x20delivery\x20report\x20from',_0x5bea77[_0x00bd('0x3c')],util['inspect'](_0x30bf00[_0x00bd('0x58')],{'showHidden':![],'depth':null}));switch(_0x5bea77[_0x00bd('0x3c')]){case _0x00bd('0x82'):if(_0x30bf00['body'][_0x00bd('0xcc')]&&_0x30bf00['body'][_0x00bd('0x25')]){_0x3a78b3=_0x30bf00[_0x00bd('0x58')][_0x00bd('0x25')];return db[_0x00bd('0xa6')][_0x00bd('0x56')]({'where':{'messageId':_0x30bf00[_0x00bd('0x58')]['skebby_dispatch_id']}});}break;case _0x00bd('0xcd'):if(_0x30bf00[_0x00bd('0x58')][_0x00bd('0xce')]&&_0x30bf00[_0x00bd('0x58')][_0x00bd('0xcf')]){_0x3a78b3=_0x30bf00[_0x00bd('0x58')][_0x00bd('0xcf')];return db['SmsMessage'][_0x00bd('0x56')]({'where':{'messageId':_0x30bf00[_0x00bd('0x58')][_0x00bd('0xce')]}});}break;case _0x00bd('0x85'):if(_0x30bf00['body'][_0x00bd('0x86')]&&_0x30bf00['body'][_0x00bd('0xd0')]){_0x3a78b3=_0x30bf00[_0x00bd('0x58')]['status_code'];return db['SmsMessage'][_0x00bd('0x56')]({'where':{'messageId':_0x30bf00[_0x00bd('0x58')][_0x00bd('0x86')]}});}break;case _0x00bd('0x89'):var _0x222e96=_0x30bf00['body'][_0x00bd('0x8a')][0x0];if(_0x222e96['messageId']&&_0x222e96[_0x00bd('0x25')][_0x00bd('0xd1')]===_0x00bd('0xd2')){_0x3a78b3=_0x222e96[_0x00bd('0x25')][_0x00bd('0xd1')];return db[_0x00bd('0xa6')][_0x00bd('0x56')]({'where':{'messageId':_0x222e96[_0x00bd('0x80')]}});}break;case _0x00bd('0xd3'):if(_0x30bf00[_0x00bd('0x58')][_0x00bd('0x80')]&&_0x30bf00[_0x00bd('0x58')][_0x00bd('0x25')]){_0x3a78b3=_0x30bf00['body']['status'];return db[_0x00bd('0xa6')][_0x00bd('0x56')]({'where':{'messageId':_0x30bf00[_0x00bd('0x58')][_0x00bd('0x80')]}});}break;case _0x00bd('0x90'):if(_0x30bf00[_0x00bd('0x58')][0x0][_0x00bd('0x22')]['id']){_0x3a78b3=_0x30bf00[_0x00bd('0x58')][0x0]['type'];return db['SmsMessage'][_0x00bd('0x56')]({'where':{'messageId':_0x30bf00[_0x00bd('0x58')][0x0][_0x00bd('0x22')]['id']}});}break;case _0x00bd('0xd4'):if(_0x30bf00[_0x00bd('0x58')][_0x00bd('0xd5')]&&_0x30bf00[_0x00bd('0x58')][_0x00bd('0x25')]){_0x3a78b3=_0x30bf00[_0x00bd('0x58')][_0x00bd('0x25')];return db[_0x00bd('0xa6')][_0x00bd('0x56')]({'where':{'messageId':_0x30bf00[_0x00bd('0x58')][_0x00bd('0xd5')]}});}break;}}})[_0x00bd('0x2f')](handleEntityNotFound(_0x50e143,null))[_0x00bd('0x2f')](function(_0x359f67){if(_0x359f67){_0xa76c40=_0x359f67;switch(_0x58abcc['type']){case _0x00bd('0x82'):if(_0x3a78b3==='DELIVERED'){return _0xa76c40[_0x00bd('0x2e')]({'read':!![]});}else{logger[_0x00bd('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x00bd('0x25'),_0x00bd('0x82'),util[_0x00bd('0xd6')](_0x30bf00[_0x00bd('0x58')],{'showHidden':![],'depth':null}));}break;case _0x00bd('0xcd'):if(_0x3a78b3==='1'){return _0xa76c40[_0x00bd('0x2e')]({'read':!![]});}else{logger['error'](_0x00bd('0x1e'),'status','skebby',util[_0x00bd('0xd6')](_0x30bf00[_0x00bd('0x58')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x30bf00[_0x00bd('0x58')][_0x00bd('0xd7')]&&_0x3a78b3>=0xc8&&_0x3a78b3<=0xce){return _0xa76c40[_0x00bd('0x2e')]({'read':!![]});}else{logger[_0x00bd('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x00bd('0x85'),util[_0x00bd('0xd6')](_0x30bf00[_0x00bd('0x58')],{'showHidden':![],'depth':null}));}break;case _0x00bd('0x89'):var _0x1f0a5d=_0x30bf00[_0x00bd('0x58')][_0x00bd('0x8a')][0x0];if(_0x1f0a5d['status']['groupName']===_0x00bd('0xd2')){return _0xa76c40[_0x00bd('0x2e')]({'read':!![]});}else{logger['error'](_0x00bd('0x1e'),_0x00bd('0x25'),_0x00bd('0x89'),util[_0x00bd('0xd6')](_0x30bf00[_0x00bd('0x58')],{'showHidden':![],'depth':null}));}break;case _0x00bd('0xd3'):if(_0x3a78b3==_0x00bd('0xd8')||_0x3a78b3==_0x00bd('0xd9')){return _0xa76c40['update']({'read':!![]});}else{logger[_0x00bd('0x20')](_0x00bd('0x1e'),'status',_0x00bd('0xd3'),util[_0x00bd('0xd6')](_0x30bf00['body'],{'showHidden':![],'depth':null}));}break;case _0x00bd('0x90'):if(_0x3a78b3==_0x00bd('0xda')){return _0xa76c40[_0x00bd('0x2e')]({'read':!![]});}else{logger[_0x00bd('0x20')](_0x00bd('0x1e'),'status',_0x00bd('0x90'),util[_0x00bd('0xd6')](_0x30bf00[_0x00bd('0x58')],{'showHidden':![],'depth':null}));}break;case _0x00bd('0xd4'):if(_0x3a78b3===_0x00bd('0xdb')||_0x3a78b3===_0x00bd('0xdc')){return _0xa76c40[_0x00bd('0x2e')]({'read':!![]});}else{logger[_0x00bd('0x20')](_0x00bd('0x1e'),'status',_0x00bd('0xd4'),util[_0x00bd('0xd6')](_0x30bf00['body'],{'showHidden':![],'depth':null}));}break;}return _0xa76c40;}})['then'](respondWithResult(_0x50e143,null))[_0x00bd('0x51')](handleError(_0x50e143,null));};exports[_0x00bd('0xdd')]=function(_0x2c5c8a,_0x3bfac9,_0x474438){var _0x85c7e8,_0x4eca62,_0x5e9876;return db[_0x00bd('0x39')][_0x00bd('0x56')]({'where':{'id':_0x2c5c8a[_0x00bd('0x53')]['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x3bfac9,null))[_0x00bd('0x2f')](function(_0x1ff6a8){if(_0x1ff6a8){_0x5e9876=_0x1ff6a8;logger[_0x00bd('0x1d')](_0x00bd('0x1e'),_0x00bd('0x25'),_0x00bd('0xde'),_0x1ff6a8[_0x00bd('0x3c')],util['inspect'](_0x2c5c8a[_0x00bd('0x3e')],{'showHidden':![],'depth':null}));switch(_0x1ff6a8[_0x00bd('0x3c')]){case'csc':if(_0x2c5c8a[_0x00bd('0x3e')][_0x00bd('0xdf')]&&_0x2c5c8a[_0x00bd('0x3e')][_0x00bd('0xe0')]){_0x4eca62=_0x2c5c8a[_0x00bd('0x3e')][_0x00bd('0xe0')];return db[_0x00bd('0xa6')][_0x00bd('0x56')]({'where':{'messageId':_0x2c5c8a['query'][_0x00bd('0xdf')]}});}break;}}})[_0x00bd('0x2f')](handleEntityNotFound(_0x3bfac9,null))[_0x00bd('0x2f')](function(_0x3e5bdf){if(_0x3e5bdf){_0x85c7e8=_0x3e5bdf;switch(_0x5e9876[_0x00bd('0x3c')]){case'csc':if(_0x4eca62==='2'||_0x4eca62==='6'){return _0x85c7e8[_0x00bd('0x2e')]({'read':!![]});}else{logger[_0x00bd('0x20')](_0x00bd('0x1e'),_0x00bd('0x25'),_0x00bd('0x8b'),util[_0x00bd('0xd6')](_0x2c5c8a[_0x00bd('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0x85c7e8;}})[_0x00bd('0x2f')](respondWithResult(_0x3bfac9,null))[_0x00bd('0x51')](handleError(_0x3bfac9,null));};exports[_0x00bd('0xe1')]=function(_0x2e40ec,_0x3cfdc8,_0x4bcb39){return db[_0x00bd('0x39')][_0x00bd('0x56')]({'where':{'id':_0x2e40ec[_0x00bd('0x53')]['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x3cfdc8,null))['then'](function(_0x2e1e35){if(_0x2e1e35){return _0x2e1e35[_0x00bd('0xe1')](_0x2e40ec['body'][_0x00bd('0x67')],_[_0x00bd('0x9d')](_0x2e40ec['body'],[_0x00bd('0x67'),'id'])||{})['spread'](function(_0x4e35b7){for(var _0x5f1dc9=0x0;_0x5f1dc9<_0x2e40ec[_0x00bd('0x58')][_0x00bd('0x67')][_0x00bd('0x44')];_0x5f1dc9+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x2e40ec[_0x00bd('0x58')][_0x00bd('0x67')][_0x5f1dc9]),'SmsAccountId':Number(_0x2e40ec['params']['id'])});}return _0x4e35b7;});}})[_0x00bd('0x2f')](respondWithResult(_0x3cfdc8,null))[_0x00bd('0x51')](handleError(_0x3cfdc8,null));};exports[_0x00bd('0xe2')]=function(_0x153b64,_0x1f36a9,_0x218b74){return db[_0x00bd('0x39')]['find']({'where':{'id':_0x153b64[_0x00bd('0x53')]['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x1f36a9,null))['then'](function(_0xc22f55){if(_0xc22f55){return _0xc22f55[_0x00bd('0xe2')](_0x153b64['query']['ids'])['then'](function(){if(_[_0x00bd('0xe3')](_0x153b64['query']['ids'])){for(var _0x4e5079=0x0;_0x4e5079<_0x153b64[_0x00bd('0x3e')]['ids'][_0x00bd('0x44')];_0x4e5079+=0x1){socket[_0x00bd('0xe4')]('userSmsAccount:remove',{'UserId':Number(_0x153b64[_0x00bd('0x3e')][_0x00bd('0x67')][_0x4e5079]),'SmsAccountId':Number(_0x153b64['params']['id'])});}}else{socket['emit'](_0x00bd('0xe5'),{'UserId':Number(_0x153b64[_0x00bd('0x3e')]['ids']),'SmsAccountId':Number(_0x153b64['params']['id'])});}});}})[_0x00bd('0x2f')](respondWithStatusCode(_0x1f36a9,null))[_0x00bd('0x51')](handleError(_0x1f36a9,null));};exports[_0x00bd('0xe6')]=function(_0x2177c6,_0x3deec9,_0x55eacf){var _0x240c56={};var _0x46e622={};var _0x1e0ac3;var _0x41e85c;return db[_0x00bd('0x39')][_0x00bd('0x6a')]({'where':{'id':_0x2177c6['params']['id']}})[_0x00bd('0x2f')](handleEntityNotFound(_0x3deec9,null))[_0x00bd('0x2f')](function(_0x5711c6){if(_0x5711c6){_0x1e0ac3=_0x5711c6;_0x46e622['model']=_[_0x00bd('0x3f')](db[_0x00bd('0xaa')]['rawAttributes']);_0x46e622['query']=_[_0x00bd('0x3f')](_0x2177c6[_0x00bd('0x3e')]);_0x46e622[_0x00bd('0x40')]=_[_0x00bd('0x41')](_0x46e622['model'],_0x46e622[_0x00bd('0x3e')]);_0x240c56[_0x00bd('0x43')]=_['intersection'](_0x46e622[_0x00bd('0x42')],qs[_0x00bd('0x54')](_0x2177c6[_0x00bd('0x3e')][_0x00bd('0x54')]));_0x240c56['attributes']=_0x240c56[_0x00bd('0x43')]['length']?_0x240c56[_0x00bd('0x43')]:_0x46e622['model'];_0x240c56[_0x00bd('0x46')]=qs[_0x00bd('0x47')](_0x2177c6[_0x00bd('0x3e')][_0x00bd('0x47')]);_0x240c56[_0x00bd('0x48')]=qs[_0x00bd('0x40')](_['pick'](_0x2177c6[_0x00bd('0x3e')],_0x46e622[_0x00bd('0x40')]));if(_0x2177c6['query'][_0x00bd('0x4a')]){_0x240c56[_0x00bd('0x48')]=_['merge'](_0x240c56[_0x00bd('0x48')],{'$or':_[_0x00bd('0x4c')](_0x240c56[_0x00bd('0x43')],function(_0x39fa47){var _0x4dc13a={};_0x4dc13a[_0x39fa47]={'$like':'%'+_0x2177c6[_0x00bd('0x3e')]['filter']+'%'};return _0x4dc13a;})});}_0x240c56=_[_0x00bd('0x4b')]({},_0x240c56,_0x2177c6['options']);return _0x1e0ac3[_0x00bd('0xe6')](_0x240c56);}})[_0x00bd('0x2f')](function(_0x200708){if(_0x200708){_0x41e85c=_0x200708['length'];if(!_0x2177c6[_0x00bd('0x3e')]['hasOwnProperty']('nolimit')){_0x240c56['limit']=qs[_0x00bd('0x29')](_0x2177c6[_0x00bd('0x3e')][_0x00bd('0x29')]);_0x240c56[_0x00bd('0x27')]=qs['offset'](_0x2177c6[_0x00bd('0x3e')][_0x00bd('0x27')]);}return _0x1e0ac3[_0x00bd('0xe6')](_0x240c56);}})['then'](function(_0x2afc40){if(_0x2afc40){return _0x2afc40?{'count':_0x41e85c,'rows':_0x2afc40}:null;}})[_0x00bd('0x2f')](respondWithResult(_0x3deec9,null))['catch'](handleError(_0x3deec9,null));}; \ No newline at end of file +var _0xbd93=['offset','set','Content-Range','apply','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','status','stack','name','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','includeAll','include','findAll','rows','params','mandatoryDispositionPause','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','SmsAccountId','findOne','merge','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','asc','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','replyMessageId','bandwidth','intelepeer','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','CmContact','contact','SmsInteraction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','AttachmentId','interaction','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','info','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','transaction','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','user','out','spread','dataValues','Messages','inspect','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','client','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','undefined','limit','count'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xbd93,0xb4));var _0x3bd9=function(_0x38055c,_0x37af4e){_0x38055c=_0x38055c-0x0;var _0x22696f=_0xbd93[_0x38055c];return _0x22696f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bd9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3bd9('0x1'));var rp=require(_0x3bd9('0x2'));var moment=require(_0x3bd9('0x3'));var BPromise=require(_0x3bd9('0x4'));var Mustache=require('mustache');var util=require(_0x3bd9('0x5'));var path=require(_0x3bd9('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3bd9('0x7'));var fs=require('fs');var fs_extra=require(_0x3bd9('0x8'));var _=require(_0x3bd9('0x9'));var squel=require(_0x3bd9('0xa'));var crypto=require(_0x3bd9('0xb'));var jsforce=require(_0x3bd9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3bd9('0xd'));var querystring=require('querystring');var Papa=require(_0x3bd9('0xe'));var Redis=require('ioredis');var authService=require(_0x3bd9('0xf'));var qs=require(_0x3bd9('0x10'));var as=require(_0x3bd9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bd9('0x12'))(_0x3bd9('0x13'));var utils=require(_0x3bd9('0x14'));var config=require(_0x3bd9('0x15'));var licenseUtil=require(_0x3bd9('0x16'));var db=require(_0x3bd9('0x17'))['db'];config[_0x3bd9('0x18')]=_[_0x3bd9('0x19')](config[_0x3bd9('0x18')],{'host':_0x3bd9('0x1a'),'port':0x18eb});var socket=require(_0x3bd9('0x1b'))(new Redis(config[_0x3bd9('0x18')]));require(_0x3bd9('0x1c'))[_0x3bd9('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3bd9('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4f2172,_0x2b5f95,_0x194349,_0xd2221d){return new BPromise(function(_0x483c05,_0x28de6d){var _0x7ec581=_0xd2221d||client;return _0x7ec581[_0x3bd9('0x1f')](_0x4f2172,_0x194349)[_0x3bd9('0x20')](function(_0x378ed9){logger['info'](_0x3bd9('0x21'),_0x2b5f95,_0x3bd9('0x22'));logger[_0x3bd9('0x23')](_0x3bd9('0x24'),_0x2b5f95,_0x3bd9('0x22'),JSON[_0x3bd9('0x25')](_0x378ed9));if(_0x378ed9['error']){if(_0x378ed9[_0x3bd9('0x26')][_0x3bd9('0x27')]===0x1f4){logger[_0x3bd9('0x26')]('SmsAccount,\x20%s,\x20%s',_0x2b5f95,_0x378ed9[_0x3bd9('0x26')]['message']);return _0x28de6d(_0x378ed9[_0x3bd9('0x26')][_0x3bd9('0x28')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x2b5f95,_0x378ed9[_0x3bd9('0x26')][_0x3bd9('0x28')]);return _0x483c05(_0x378ed9[_0x3bd9('0x26')][_0x3bd9('0x28')]);}else{logger['info'](_0x3bd9('0x21'),_0x2b5f95,_0x3bd9('0x22'));_0x483c05(_0x378ed9[_0x3bd9('0x29')][_0x3bd9('0x28')]);}})[_0x3bd9('0x2a')](function(_0x18a7f1){logger[_0x3bd9('0x26')](_0x3bd9('0x21'),_0x2b5f95,_0x18a7f1);_0x28de6d(_0x18a7f1);});});}function respondWithStatusCode(_0x59ba1a,_0x18de49){_0x18de49=_0x18de49||0xcc;return function(_0x2dcf66){if(_0x2dcf66){return _0x59ba1a[_0x3bd9('0x2b')](_0x18de49);}return _0x59ba1a['status'](_0x18de49)[_0x3bd9('0x2c')]();};}function respondWithResult(_0x5176df,_0x5d6c67){_0x5d6c67=_0x5d6c67||0xc8;return function(_0x2516b){if(_0x2516b){return _0x5176df['status'](_0x5d6c67)[_0x3bd9('0x2d')](_0x2516b);}};}function respondWithFilteredResult(_0x34b333,_0xd21fa8){return function(_0x3deec8){if(_0x3deec8){var _0x37efa5=typeof _0xd21fa8['offset']===_0x3bd9('0x2e')&&typeof _0xd21fa8[_0x3bd9('0x2f')]===_0x3bd9('0x2e');var _0x4a2d4c=_0x3deec8[_0x3bd9('0x30')];var _0x40b29f=_0x37efa5?0x0:_0xd21fa8[_0x3bd9('0x31')];var _0x29c798=_0x37efa5?_0x3deec8['count']:_0xd21fa8['offset']+_0xd21fa8[_0x3bd9('0x2f')];var _0x24595e;if(_0x29c798>=_0x4a2d4c){_0x29c798=_0x4a2d4c;_0x24595e=0xc8;}else{_0x24595e=0xce;}_0x34b333['status'](_0x24595e);return _0x34b333[_0x3bd9('0x32')](_0x3bd9('0x33'),_0x40b29f+'-'+_0x29c798+'/'+_0x4a2d4c)[_0x3bd9('0x2d')](_0x3deec8);}return null;};}function patchUpdates(_0x15e4c5){return function(_0x4a14aa){try{jsonpatch[_0x3bd9('0x34')](_0x4a14aa,_0x15e4c5,!![]);}catch(_0x21d373){return BPromise[_0x3bd9('0x35')](_0x21d373);}return _0x4a14aa[_0x3bd9('0x36')]();};}function saveUpdates(_0x5eeded,_0x243ea1){return function(_0x502e15){if(_0x502e15){return _0x502e15[_0x3bd9('0x37')](_0x5eeded)['then'](function(_0x2f1961){return _0x2f1961;});}return null;};}function removeEntity(_0x3fda89,_0x363326){return function(_0x5c51ea){if(_0x5c51ea){return _0x5c51ea['destroy']()[_0x3bd9('0x20')](function(){var _0x1e48a1=_0x5c51ea[_0x3bd9('0x38')]({'plain':!![]});var _0xc29eae=_0x3bd9('0x39');return db[_0x3bd9('0x3a')][_0x3bd9('0x3b')]({'where':{'type':_0xc29eae,'resourceId':_0x1e48a1['id']}})[_0x3bd9('0x20')](function(){return _0x5c51ea;});})['then'](function(){_0x3fda89[_0x3bd9('0x3c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c757a,_0x3aadba){return function(_0x5aa2e7){if(!_0x5aa2e7){_0x3c757a[_0x3bd9('0x2b')](0x194);}return _0x5aa2e7;};}function handleError(_0x5ee63a,_0x5eaff5){_0x5eaff5=_0x5eaff5||0x1f4;return function(_0x114ed1){logger['error'](_0x114ed1[_0x3bd9('0x3d')]);if(_0x114ed1[_0x3bd9('0x3e')]){delete _0x114ed1[_0x3bd9('0x3e')];}_0x5ee63a[_0x3bd9('0x3c')](_0x5eaff5)[_0x3bd9('0x3f')](_0x114ed1);};}exports[_0x3bd9('0x40')]=function(_0xcba711,_0x551af9){var _0x1dde7d={'include':[{'model':db[_0x3bd9('0x41')],'as':'mandatoryDispositionPause'}]},_0x23dd2e={},_0x565dc1={'count':0x0,'rows':[]};var _0x2e99de=_[_0x3bd9('0x42')](db[_0x3bd9('0x43')][_0x3bd9('0x44')],function(_0x55e73e){return{'name':_0x55e73e[_0x3bd9('0x45')],'type':_0x55e73e[_0x3bd9('0x46')]['key']};});_0x23dd2e[_0x3bd9('0x47')]=_[_0x3bd9('0x42')](_0x2e99de,_0x3bd9('0x3e'));_0x23dd2e['query']=_[_0x3bd9('0x48')](_0xcba711[_0x3bd9('0x49')]);_0x23dd2e[_0x3bd9('0x4a')]=_['intersection'](_0x23dd2e[_0x3bd9('0x47')],_0x23dd2e[_0x3bd9('0x49')]);_0x1dde7d[_0x3bd9('0x4b')]=_[_0x3bd9('0x4c')](_0x23dd2e[_0x3bd9('0x47')],qs['fields'](_0xcba711[_0x3bd9('0x49')][_0x3bd9('0x4d')]));_0x1dde7d[_0x3bd9('0x4b')]=_0x1dde7d[_0x3bd9('0x4b')][_0x3bd9('0x4e')]?_0x1dde7d[_0x3bd9('0x4b')]:_0x23dd2e['model'];if(!_0xcba711[_0x3bd9('0x49')][_0x3bd9('0x4f')](_0x3bd9('0x50'))){_0x1dde7d[_0x3bd9('0x2f')]=qs['limit'](_0xcba711[_0x3bd9('0x49')]['limit']);_0x1dde7d['offset']=qs[_0x3bd9('0x31')](_0xcba711[_0x3bd9('0x49')]['offset']);}_0x1dde7d[_0x3bd9('0x51')]=qs[_0x3bd9('0x52')](_0xcba711[_0x3bd9('0x49')]['sort']);_0x1dde7d['where']=qs[_0x3bd9('0x4a')](_[_0x3bd9('0x53')](_0xcba711[_0x3bd9('0x49')],_0x23dd2e['filters']),_0x2e99de);if(_0xcba711[_0x3bd9('0x49')][_0x3bd9('0x54')]){_0x1dde7d[_0x3bd9('0x55')]=_['merge'](_0x1dde7d[_0x3bd9('0x55')],{'$or':_['map'](_0x2e99de,function(_0x28378d){if(_0x28378d[_0x3bd9('0x46')]!==_0x3bd9('0x56')){var _0x5c684b={};_0x5c684b[_0x28378d[_0x3bd9('0x3e')]]={'$like':'%'+_0xcba711[_0x3bd9('0x49')][_0x3bd9('0x54')]+'%'};return _0x5c684b;}})});}_0x1dde7d=_['merge']({},_0x1dde7d,_0xcba711['options']);var _0x48c50b={'where':_0x1dde7d[_0x3bd9('0x55')]};return db[_0x3bd9('0x43')][_0x3bd9('0x30')](_0x48c50b)[_0x3bd9('0x20')](function(_0x1630bd){_0x565dc1[_0x3bd9('0x30')]=_0x1630bd;if(_0xcba711[_0x3bd9('0x49')][_0x3bd9('0x57')]){_0x1dde7d[_0x3bd9('0x58')]=[{'all':!![]}];}return db[_0x3bd9('0x43')][_0x3bd9('0x59')](_0x1dde7d);})['then'](function(_0x1915ac){_0x565dc1[_0x3bd9('0x5a')]=_0x1915ac;return _0x565dc1;})[_0x3bd9('0x20')](respondWithFilteredResult(_0x551af9,_0x1dde7d))[_0x3bd9('0x2a')](handleError(_0x551af9,null));};exports['show']=function(_0x4b7fe0,_0x411a70){var _0x5bc5d5={'raw':![],'where':{'id':_0x4b7fe0[_0x3bd9('0x5b')]['id']},'include':[{'model':db[_0x3bd9('0x41')],'as':_0x3bd9('0x5c')}]},_0x490a2f={};_0x490a2f['model']=_[_0x3bd9('0x48')](db[_0x3bd9('0x43')][_0x3bd9('0x44')]);_0x490a2f[_0x3bd9('0x49')]=_['keys'](_0x4b7fe0[_0x3bd9('0x49')]);_0x490a2f[_0x3bd9('0x4a')]=_[_0x3bd9('0x4c')](_0x490a2f[_0x3bd9('0x47')],_0x490a2f['query']);_0x5bc5d5[_0x3bd9('0x4b')]=_['intersection'](_0x490a2f[_0x3bd9('0x47')],qs['fields'](_0x4b7fe0['query'][_0x3bd9('0x4d')]));_0x5bc5d5[_0x3bd9('0x4b')]=_0x5bc5d5[_0x3bd9('0x4b')][_0x3bd9('0x4e')]?_0x5bc5d5['attributes']:_0x490a2f[_0x3bd9('0x47')];if(_0x4b7fe0[_0x3bd9('0x49')][_0x3bd9('0x57')]){_0x5bc5d5[_0x3bd9('0x58')]=[{'all':!![]}];}_0x5bc5d5=_['merge']({},_0x5bc5d5,_0x4b7fe0[_0x3bd9('0x5d')]);return db[_0x3bd9('0x43')]['find'](_0x5bc5d5)[_0x3bd9('0x20')](handleEntityNotFound(_0x411a70,null))[_0x3bd9('0x20')](respondWithResult(_0x411a70,null))[_0x3bd9('0x2a')](handleError(_0x411a70,null));};exports[_0x3bd9('0x5e')]=function(_0x40a0dd,_0x51ecfa){return db[_0x3bd9('0x43')]['create'](_0x40a0dd[_0x3bd9('0x5f')],{})[_0x3bd9('0x20')](function(_0x220ca0){var _0x479bb9=_0x40a0dd['user']['get']({'plain':!![]});if(!_0x479bb9)throw new Error(_0x3bd9('0x60'));if(_0x479bb9[_0x3bd9('0x61')]==='user'){var _0x3b651b=_0x220ca0[_0x3bd9('0x38')]({'plain':!![]});var _0xde5e33=_0x3bd9('0x39');return db[_0x3bd9('0x62')]['find']({'where':{'name':_0xde5e33,'userProfileId':_0x479bb9[_0x3bd9('0x63')]},'raw':!![]})[_0x3bd9('0x20')](function(_0x2b7915){if(_0x2b7915&&_0x2b7915[_0x3bd9('0x64')]===0x0){return db[_0x3bd9('0x3a')][_0x3bd9('0x5e')]({'name':_0x3b651b['name'],'resourceId':_0x3b651b['id'],'type':_0x2b7915['name'],'sectionId':_0x2b7915['id']},{})[_0x3bd9('0x20')](function(){return _0x220ca0;});}else{return _0x220ca0;}})[_0x3bd9('0x2a')](function(_0x2accf9){logger['error'](_0x3bd9('0x65'),_0x2accf9);throw _0x2accf9;});}return _0x220ca0;})[_0x3bd9('0x20')](respondWithResult(_0x51ecfa,0xc9))[_0x3bd9('0x2a')](handleError(_0x51ecfa,null));};exports[_0x3bd9('0x37')]=function(_0x141a9d,_0x383755){if(_0x141a9d[_0x3bd9('0x5f')]['id']){delete _0x141a9d[_0x3bd9('0x5f')]['id'];}return db['SmsAccount'][_0x3bd9('0x66')]({'where':{'id':_0x141a9d[_0x3bd9('0x5b')]['id']},'include':[{'model':db[_0x3bd9('0x41')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x383755,null))[_0x3bd9('0x20')](saveUpdates(_0x141a9d[_0x3bd9('0x5f')],null))[_0x3bd9('0x20')](respondWithResult(_0x383755,null))[_0x3bd9('0x2a')](handleError(_0x383755,null));};exports[_0x3bd9('0x3b')]=function(_0x4a87bf,_0x5cf50a){return db[_0x3bd9('0x43')]['find']({'where':{'id':_0x4a87bf['params']['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x5cf50a,null))[_0x3bd9('0x20')](removeEntity(_0x5cf50a,null))[_0x3bd9('0x2a')](handleError(_0x5cf50a,null));};exports[_0x3bd9('0x67')]=function(_0x2c65df,_0x560f35){return db[_0x3bd9('0x43')]['describe']()[_0x3bd9('0x20')](respondWithResult(_0x560f35,null))[_0x3bd9('0x2a')](handleError(_0x560f35,null));};exports[_0x3bd9('0x68')]=function(_0x512711,_0x492b78,_0x401bf2){if(_0x512711[_0x3bd9('0x5f')]['id']){delete _0x512711[_0x3bd9('0x5f')]['id'];}return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0x512711[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x492b78,null))[_0x3bd9('0x20')](function(_0x496102){if(_0x496102){_0x512711[_0x3bd9('0x5f')][_0x3bd9('0x69')]=_0x496102['id'];return db['Disposition'][_0x3bd9('0x5e')](_0x512711['body']);}})['then'](respondWithResult(_0x492b78,null))[_0x3bd9('0x2a')](handleError(_0x492b78,null));};exports['getDispositions']=function(_0x4929c8,_0x2573cf,_0x1fe82e){var _0x9d73dc={'raw':![],'where':{}};var _0xaa14b9={};var _0x20b5c9={'count':0x0,'rows':[]};return db['SmsAccount'][_0x3bd9('0x6a')]({'where':{'id':_0x4929c8[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x2573cf,null))[_0x3bd9('0x20')](function(_0x289568){if(_0x289568){_0xaa14b9[_0x3bd9('0x47')]=_[_0x3bd9('0x48')](db['Disposition'][_0x3bd9('0x44')]);_0xaa14b9[_0x3bd9('0x49')]=_[_0x3bd9('0x48')](_0x4929c8['query']);_0xaa14b9[_0x3bd9('0x4a')]=_[_0x3bd9('0x4c')](_0xaa14b9['model'],_0xaa14b9[_0x3bd9('0x49')]);_0x9d73dc[_0x3bd9('0x4b')]=_['intersection'](_0xaa14b9[_0x3bd9('0x47')],qs[_0x3bd9('0x4d')](_0x4929c8['query']['fields']));_0x9d73dc[_0x3bd9('0x4b')]=_0x9d73dc[_0x3bd9('0x4b')]['length']?_0x9d73dc['attributes']:_0xaa14b9[_0x3bd9('0x47')];if(!_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x4f')]('nolimit')){_0x9d73dc['limit']=qs['limit'](_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x2f')]);_0x9d73dc[_0x3bd9('0x31')]=qs['offset'](_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x31')]);}_0x9d73dc[_0x3bd9('0x51')]=qs[_0x3bd9('0x52')](_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x52')]);_0x9d73dc['where']=qs[_0x3bd9('0x4a')](_[_0x3bd9('0x53')](_0x4929c8[_0x3bd9('0x49')],_0xaa14b9[_0x3bd9('0x4a')]));_0x9d73dc[_0x3bd9('0x55')][_0x3bd9('0x69')]=_0x289568['id'];if(_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x54')]){_0x9d73dc[_0x3bd9('0x55')]=_[_0x3bd9('0x6b')](_0x9d73dc[_0x3bd9('0x55')],{'$or':_[_0x3bd9('0x42')](_0x9d73dc['attributes'],function(_0xe44d3b){var _0x31ee00={};_0x31ee00[_0xe44d3b]={'$like':'%'+_0x4929c8['query']['filter']+'%'};return _0x31ee00;})});}_0x9d73dc=_[_0x3bd9('0x6b')]({},_0x9d73dc,_0x4929c8[_0x3bd9('0x5d')]);return db[_0x3bd9('0x6c')][_0x3bd9('0x30')]({'where':_0x9d73dc[_0x3bd9('0x55')]})[_0x3bd9('0x20')](function(_0x2dbefb){_0x20b5c9[_0x3bd9('0x30')]=_0x2dbefb;if(_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x57')]){_0x9d73dc[_0x3bd9('0x58')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x9d73dc);})[_0x3bd9('0x20')](function(_0x25104e){_0x20b5c9['rows']=_0x25104e;return _0x20b5c9;});}})['then'](respondWithFilteredResult(_0x2573cf,_0x9d73dc))['catch'](handleError(_0x2573cf,null));};exports[_0x3bd9('0x6d')]=function(_0x3f811b,_0x17a8c6,_0x34871c){return db[_0x3bd9('0x43')]['find']({'where':{'id':_0x3f811b[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x17a8c6,null))[_0x3bd9('0x20')](function(_0x168278){if(_0x168278){return _0x168278[_0x3bd9('0x6d')](_0x3f811b[_0x3bd9('0x49')][_0x3bd9('0x6e')]);}})[_0x3bd9('0x20')](respondWithStatusCode(_0x17a8c6,null))[_0x3bd9('0x2a')](handleError(_0x17a8c6,null));};exports['addAnswer']=function(_0x109dcc,_0x523fa3,_0xd6e10a){if(_0x109dcc['body']['id']){delete _0x109dcc[_0x3bd9('0x5f')]['id'];}return db['SmsAccount'][_0x3bd9('0x66')]({'where':{'id':_0x109dcc[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x523fa3,null))[_0x3bd9('0x20')](function(_0x16fcfb){if(_0x16fcfb){_0x109dcc[_0x3bd9('0x5f')]['SmsAccountId']=_0x16fcfb['id'];return db[_0x3bd9('0x6f')]['create'](_0x109dcc['body']);}})[_0x3bd9('0x20')](respondWithResult(_0x523fa3,null))['catch'](handleError(_0x523fa3,null));};exports[_0x3bd9('0x70')]=function(_0x33ab3f,_0x5bb485,_0x133c82){var _0x2ecac2={'raw':![],'where':{}};var _0x31f43e={};var _0x3db924={'count':0x0,'rows':[]};return db[_0x3bd9('0x43')][_0x3bd9('0x6a')]({'where':{'id':_0x33ab3f[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x5bb485,null))[_0x3bd9('0x20')](function(_0x503a90){if(_0x503a90){_0x31f43e[_0x3bd9('0x47')]=_[_0x3bd9('0x48')](db[_0x3bd9('0x6f')][_0x3bd9('0x44')]);_0x31f43e[_0x3bd9('0x49')]=_[_0x3bd9('0x48')](_0x33ab3f['query']);_0x31f43e[_0x3bd9('0x4a')]=_['intersection'](_0x31f43e[_0x3bd9('0x47')],_0x31f43e[_0x3bd9('0x49')]);_0x2ecac2['attributes']=_[_0x3bd9('0x4c')](_0x31f43e[_0x3bd9('0x47')],qs['fields'](_0x33ab3f['query']['fields']));_0x2ecac2['attributes']=_0x2ecac2[_0x3bd9('0x4b')]['length']?_0x2ecac2[_0x3bd9('0x4b')]:_0x31f43e[_0x3bd9('0x47')];if(!_0x33ab3f['query'][_0x3bd9('0x4f')](_0x3bd9('0x50'))){_0x2ecac2[_0x3bd9('0x2f')]=qs[_0x3bd9('0x2f')](_0x33ab3f[_0x3bd9('0x49')]['limit']);_0x2ecac2[_0x3bd9('0x31')]=qs[_0x3bd9('0x31')](_0x33ab3f[_0x3bd9('0x49')][_0x3bd9('0x31')]);}_0x2ecac2[_0x3bd9('0x51')]=qs['sort'](_0x33ab3f[_0x3bd9('0x49')][_0x3bd9('0x52')]);_0x2ecac2['where']=qs[_0x3bd9('0x4a')](_[_0x3bd9('0x53')](_0x33ab3f['query'],_0x31f43e[_0x3bd9('0x4a')]));_0x2ecac2[_0x3bd9('0x55')]['SmsAccountId']=_0x503a90['id'];if(_0x33ab3f['query'][_0x3bd9('0x54')]){_0x2ecac2[_0x3bd9('0x55')]=_[_0x3bd9('0x6b')](_0x2ecac2[_0x3bd9('0x55')],{'$or':_[_0x3bd9('0x42')](_0x2ecac2[_0x3bd9('0x4b')],function(_0xab32b){var _0x17dfb3={};_0x17dfb3[_0xab32b]={'$like':'%'+_0x33ab3f[_0x3bd9('0x49')][_0x3bd9('0x54')]+'%'};return _0x17dfb3;})});}_0x2ecac2=_['merge']({},_0x2ecac2,_0x33ab3f[_0x3bd9('0x5d')]);return db['CannedAnswer'][_0x3bd9('0x30')]({'where':_0x2ecac2[_0x3bd9('0x55')]})[_0x3bd9('0x20')](function(_0xc6ddf7){_0x3db924[_0x3bd9('0x30')]=_0xc6ddf7;if(_0x33ab3f[_0x3bd9('0x49')]['includeAll']){_0x2ecac2['include']=[{'all':!![]}];}return db[_0x3bd9('0x6f')][_0x3bd9('0x59')](_0x2ecac2);})['then'](function(_0x2e7a4b){_0x3db924[_0x3bd9('0x5a')]=_0x2e7a4b;return _0x3db924;});}})[_0x3bd9('0x20')](respondWithFilteredResult(_0x5bb485,_0x2ecac2))[_0x3bd9('0x2a')](handleError(_0x5bb485,null));};exports[_0x3bd9('0x71')]=function(_0x37dade,_0x3c0c8a,_0xcebac2){return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0x37dade[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x3c0c8a,null))[_0x3bd9('0x20')](function(_0x44bce6){if(_0x44bce6){return _0x44bce6[_0x3bd9('0x71')](_0x37dade['query'][_0x3bd9('0x6e')]);}})[_0x3bd9('0x20')](respondWithStatusCode(_0x3c0c8a,null))['catch'](handleError(_0x3c0c8a,null));};exports[_0x3bd9('0x72')]=function(_0xdd5be,_0x4bcf48,_0x4ef49d){var _0x39d260={'channel':'sms'};var _0x34e241=[];var _0x2e3f86=[];var _0x1e5f55={};return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0xdd5be['params']['id']},'include':[{'model':db[_0x3bd9('0x73')],'as':_0x3bd9('0x74')}]})['then'](handleEntityNotFound(_0x4bcf48,null))[_0x3bd9('0x20')](function(_0x5dccd0){_0x39d260[_0x3bd9('0x75')]=_0x5dccd0;_0x39d260[_0x3bd9('0x76')]=_[_0x3bd9('0x77')](_0x5dccd0[_0x3bd9('0x74')],['priority'],[_0x3bd9('0x78')]);if(_0x39d260['account']['Applications']){delete _0x39d260['account']['Applications'];}return db['CmContact'][_0x3bd9('0x67')]();})['then'](function(_0xb3ad63){if(!_0xb3ad63){throw new db['Sequelize'][(_0x3bd9('0x79'))](_0x3bd9('0x7a'));}_0x34e241=_[_0x3bd9('0x7b')](_[_0x3bd9('0x48')](_0xb3ad63),[_0x3bd9('0x7c'),_0x3bd9('0x7d')]);_0x2e3f86=_[_0x3bd9('0x7b')](_[_0x3bd9('0x48')](_0xb3ad63),[_0x3bd9('0x7c'),_0x3bd9('0x7d'),_0x3bd9('0x7e'),_0x3bd9('0x7f')]);_0x39d260[_0x3bd9('0x5f')]={'mapKey':_0x3bd9('0x80')};if(_0x39d260['account'][_0x3bd9('0x46')]){switch(_0x39d260['account'][_0x3bd9('0x46')]){case _0x3bd9('0x81'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x83')];_0x39d260[_0x3bd9('0x5f')]['body']=_0xdd5be['body'][_0x3bd9('0x84')];_0x39d260['body'][_0x3bd9('0x85')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x86')];break;case _0x3bd9('0x87'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]='+'+_0xdd5be['body']['sender'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x88')];break;case _0x3bd9('0x89'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x82')];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')]['message'];break;case _0x3bd9('0x8a'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')]['from'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x5f')];_0x39d260['body'][_0x3bd9('0x85')]=_0xdd5be['body'][_0x3bd9('0x8b')];break;case'plivo':_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')]['From'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be['body'][_0x3bd9('0x8c')];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x85')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x8d')];break;case _0x3bd9('0x8e'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]='+'+_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x8f')][0x0]['from'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be['body'][_0x3bd9('0x8f')][0x0][_0x3bd9('0x88')];_0x39d260[_0x3bd9('0x5f')]['messageId']=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x8f')][0x0][_0x3bd9('0x85')];break;case _0x3bd9('0x90'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]=_0xdd5be['body'][_0x3bd9('0x91')];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')]['segmentedMessage'][_0x3bd9('0x28')];break;case _0x3bd9('0x92'):_0x39d260['body'][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')]['fromNumber'];_0x39d260['body'][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x88')];_0x39d260['body'][_0x3bd9('0x85')]=_0xdd5be['body'][_0x3bd9('0x93')];break;case _0x3bd9('0x94'):_0x39d260['body']['messageId']=_0xdd5be[_0x3bd9('0x5f')][0x0][_0x3bd9('0x28')]['id'];_0x39d260[_0x3bd9('0x5f')]['from']=_0xdd5be[_0x3bd9('0x5f')][0x0]['message']['from'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')][0x0]['message'][_0x3bd9('0x88')];break;case _0x3bd9('0x95'):_0x39d260['body'][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x82')];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')]['message'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x85')]=_0xdd5be[_0x3bd9('0x5f')]['refid'];break;}}if(_0x39d260[_0x3bd9('0x5f')]['id']){delete _0x39d260[_0x3bd9('0x5f')]['id'];}if(_[_0x3bd9('0x96')](_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')])){throw new db[(_0x3bd9('0x97'))][(_0x3bd9('0x79'))](_0x3bd9('0x98'));}if(_[_0x3bd9('0x96')](_0x39d260['body']['body'])||_0x39d260['body'][_0x3bd9('0x5f')]===''){throw new db[(_0x3bd9('0x97'))]['ValidationError'](_0x3bd9('0x99'));}if(_[_0x3bd9('0x96')](_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x9a')])){throw new db[(_0x3bd9('0x97'))][(_0x3bd9('0x79'))](_0x3bd9('0x9b')+_0x2e3f86);}if(!_[_0x3bd9('0x9c')](_0x2e3f86,_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x9a')])){throw new db[(_0x3bd9('0x97'))][(_0x3bd9('0x79'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e3f86);}_0x1e5f55[_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x9a')]]=_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')];return db[_0x3bd9('0x9d')][_0x3bd9('0x66')]({'where':{'id':_0x39d260['account'][_0x3bd9('0x7f')]},'include':[{'model':db['CmContact'],'as':_0x3bd9('0x9e'),'where':_0x1e5f55,'limit':0x1,'order':[[_0x3bd9('0x7d'),_0x3bd9('0x9f')]]}]});})[_0x3bd9('0x20')](handleEntityNotFound(_0x4bcf48,null))[_0x3bd9('0x20')](function(_0x22df3d){if(_0x22df3d){_0x39d260[_0x3bd9('0xa0')]=_[_0x3bd9('0xa1')](_0x22df3d,[_0x3bd9('0x9e')]);if(_0x22df3d[_0x3bd9('0x9e')]['length']){return _0x22df3d[_0x3bd9('0x9e')][0x0];}var _0x291968=_['defaults'](_0x39d260[_0x3bd9('0x5f')],{'firstName':_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')],'ListId':_0x22df3d['id']});_0x291968[_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x9a')]]=_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')];return db[_0x3bd9('0xa2')][_0x3bd9('0x5e')](_0x291968,{'fields':_0x34e241,'raw':!![]});}})[_0x3bd9('0x20')](handleEntityNotFound(_0x4bcf48,null))[_0x3bd9('0x20')](function(_0x2b2d06){if(_0x2b2d06){_0x39d260[_0x3bd9('0xa3')]=_0x2b2d06;var _0xdf4d0e={'ContactId':_0x2b2d06['id'],'phone':_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')],'SmsAccountId':_0xdd5be['params']['id']};var _0x25383c={'ContactId':_0x2b2d06['id'],'SmsAccountId':_0xdd5be[_0x3bd9('0x5b')]['id'],'closed':![]};return db[_0x3bd9('0xa4')]['find']({'where':_0x25383c})[_0x3bd9('0x20')](function(_0x3618f1){if(_0x3618f1){return[_0x3618f1,![]];}return db[_0x3bd9('0xa4')]['create'](_0xdf4d0e)[_0x3bd9('0x20')](function(_0x3ee190){return[_0x3ee190,!![]];});});}})['spread'](function(_0x5d6956,_0x57f53d){_0x39d260['interaction']=_0x5d6956['get']({'plain':!![]});_0x39d260['interaction']['created']=![];if(_0x57f53d){if(_0x39d260[_0x3bd9('0x75')][_0x3bd9('0xa5')]){_0x39d260[_0x3bd9('0x76')][_0x3bd9('0xa6')]({'id':0x0,'priority':_0x39d260[_0x3bd9('0x76')][_0x3bd9('0x4e')]+0x1,'app':_0x3bd9('0xa7'),'appdata':_0x3bd9('0xa8'),'interval':_0x3bd9('0xa9')});}_0x39d260['interaction'][_0x3bd9('0xaa')]=!![];}return db[_0x3bd9('0xab')][_0x3bd9('0x5e')]({'phone':_0x39d260['body'][_0x3bd9('0x82')],'messageId':_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x85')],'body':_0x39d260['body'][_0x3bd9('0x5f')],'SmsAccountId':_0xdd5be[_0x3bd9('0x5b')]['id'],'SmsInteractionId':_0x5d6956['id'],'direction':'in','ContactId':_0x5d6956['ContactId'],'AttachmentId':_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0xac')]});})[_0x3bd9('0x20')](function(_0x5a0bc1){_0x39d260[_0x3bd9('0x28')]=_0x5a0bc1;if(_0x39d260[_0x3bd9('0xad')][_0x3bd9('0xae')]){return db[_0x3bd9('0xaf')]['find']({'attributes':['id',_0x3bd9('0x3e')],'where':{'id':_0x39d260[_0x3bd9('0xad')][_0x3bd9('0xae')]}})[_0x3bd9('0x20')](function(_0x2ecb7b){if(_0x2ecb7b){_0x39d260[_0x3bd9('0x76')][_0x3bd9('0xb0')]({'id':0x0,'priority':0x0,'app':_0x3bd9('0xb1'),'appdata':_0x2ecb7b[_0x3bd9('0x3e')]+','+(_0x39d260[_0x3bd9('0x75')][_0x3bd9('0xb2')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x3bd9('0xb3'),_0x39d260);});}return respondWithRpcPromise(_0x3bd9('0xb4'),_0x3bd9('0xb3'),_0x39d260);})[_0x3bd9('0x20')](function(_0xbaf4fb){if(_0xbaf4fb){var _0x380715=0xc8;var _0x14908e=_0x3bd9('0xb5');logger[_0x3bd9('0xb6')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x14908e,_0x380715,_0x3bd9('0xb7'));logger[_0x3bd9('0x23')](_0x3bd9('0xb8'),_0x14908e,_0x380715,_0x3bd9('0xb7'),JSON['stringify'](_0xbaf4fb));if(_0x39d260['account'][_0x3bd9('0x46')]===_0x3bd9('0x81')){return _0x4bcf48['status'](_0x380715)['set'](_0x3bd9('0xb9'),_0x3bd9('0xba'))[_0x3bd9('0x3f')](_0x3bd9('0xbb'));}else{return _0x4bcf48['status'](_0x380715)[_0x3bd9('0x2d')](_0xbaf4fb);}}})['catch'](handleError(_0x4bcf48,null));};exports['addApplications']=function(_0x1e98fd,_0x16c032){var _0x2a2036=_0x1e98fd[_0x3bd9('0x5b')]['id'];var _0x9cc6f1=_0x1e98fd['body'];var _0x1e5b10=0xc8;var _0x6e9fbf=null;return db['sequelize'][_0x3bd9('0xbc')]({'isolationLevel':db[_0x3bd9('0xbd')][_0x3bd9('0xbe')]['ISOLATION_LEVELS'][_0x3bd9('0xbf')]},function(_0xff2482){return db[_0x3bd9('0x43')]['findOne']({'where':{'id':_0x2a2036},'transaction':_0xff2482})[_0x3bd9('0x20')](function(_0x352f7d){if(_0x352f7d){return db[_0x3bd9('0x73')]['destroy']({'where':{'SmsAccountId':_0x2a2036},'transaction':_0xff2482})[_0x3bd9('0x20')](function(){var _0xe5a53a=_[_0x3bd9('0x42')](_0x9cc6f1,function(_0x49749d){_0x49749d[_0x3bd9('0x69')]=_0x2a2036;return _0x49749d;});return db[_0x3bd9('0x73')][_0x3bd9('0xc0')](_0xe5a53a,{'transaction':_0xff2482});});}else{_0x1e5b10=0x194;_0x6e9fbf=[];}});})[_0x3bd9('0x20')](function(){if(_0x1e5b10!==0x194){return db['SmsApplication'][_0x3bd9('0xc1')]({'where':{'SmsAccountId':_0x2a2036},'order':_0x3bd9('0xc2')})[_0x3bd9('0x20')](function(_0xa2da2e){_0x6e9fbf=_0xa2da2e;});}})[_0x3bd9('0x2a')](function(_0x58c54f){_0x1e5b10=0x1f4;logger[_0x3bd9('0x26')](_0x58c54f[_0x3bd9('0x3d')]);if(_0x58c54f[_0x3bd9('0x3e')]){delete _0x58c54f[_0x3bd9('0x3e')];}_0x6e9fbf=_0x58c54f;})[_0x3bd9('0xc3')](function(){if(_0x6e9fbf===null){_0x16c032[_0x3bd9('0x2b')](_0x1e5b10);}else{if(_0x1e5b10===0x1f4){_0x16c032[_0x3bd9('0x3c')](_0x1e5b10)[_0x3bd9('0x3f')](_0x6e9fbf);}else{_0x16c032[_0x3bd9('0x3c')](_0x1e5b10)[_0x3bd9('0x2d')](_0x6e9fbf);}}});};exports[_0x3bd9('0xc4')]=function(_0x4800a8,_0x5ac55b,_0x45f34c){var _0x792439={};var _0x2455ff={};var _0x2e9724;var _0x27fec4;return db['SmsAccount'][_0x3bd9('0x6a')]({'where':{'id':_0x4800a8[_0x3bd9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5ac55b,null))[_0x3bd9('0x20')](function(_0x548d54){if(_0x548d54){_0x2e9724=_0x548d54;_0x2455ff[_0x3bd9('0x47')]=_[_0x3bd9('0x48')](db['SmsApplication'][_0x3bd9('0x44')]);_0x2455ff[_0x3bd9('0x49')]=_[_0x3bd9('0x48')](_0x4800a8[_0x3bd9('0x49')]);_0x2455ff[_0x3bd9('0x4a')]=_[_0x3bd9('0x4c')](_0x2455ff[_0x3bd9('0x47')],_0x2455ff[_0x3bd9('0x49')]);_0x792439['attributes']=_[_0x3bd9('0x4c')](_0x2455ff[_0x3bd9('0x47')],qs[_0x3bd9('0x4d')](_0x4800a8[_0x3bd9('0x49')]['fields']));_0x792439[_0x3bd9('0x4b')]=_0x792439[_0x3bd9('0x4b')][_0x3bd9('0x4e')]?_0x792439[_0x3bd9('0x4b')]:_0x2455ff['model'];_0x792439[_0x3bd9('0x51')]=qs[_0x3bd9('0x52')](_0x4800a8[_0x3bd9('0x49')]['sort']);_0x792439['where']=qs[_0x3bd9('0x4a')](_[_0x3bd9('0x53')](_0x4800a8[_0x3bd9('0x49')],_0x2455ff[_0x3bd9('0x4a')]));if(_0x4800a8[_0x3bd9('0x49')]['filter']){_0x792439[_0x3bd9('0x55')]=_['merge'](_0x792439['where'],{'$or':_['map'](_0x792439[_0x3bd9('0x4b')],function(_0x56e25c){var _0x18b30c={};_0x18b30c[_0x56e25c]={'$like':'%'+_0x4800a8[_0x3bd9('0x49')][_0x3bd9('0x54')]+'%'};return _0x18b30c;})});}_0x792439=_[_0x3bd9('0x6b')]({},_0x792439,_0x4800a8[_0x3bd9('0x5d')]);return _0x2e9724['getApplications'](_0x792439);}})['then'](function(_0x15411f){if(_0x15411f){_0x27fec4=_0x15411f['length'];if(!_0x4800a8[_0x3bd9('0x49')][_0x3bd9('0x4f')](_0x3bd9('0x50'))){_0x792439[_0x3bd9('0x2f')]=qs[_0x3bd9('0x2f')](_0x4800a8['query'][_0x3bd9('0x2f')]);_0x792439[_0x3bd9('0x31')]=qs[_0x3bd9('0x31')](_0x4800a8[_0x3bd9('0x49')][_0x3bd9('0x31')]);}return _0x2e9724[_0x3bd9('0xc4')](_0x792439);}})[_0x3bd9('0x20')](function(_0x3ee2b5){if(_0x3ee2b5){return _0x3ee2b5?{'count':_0x27fec4,'rows':_0x3ee2b5}:null;}})[_0x3bd9('0x20')](respondWithResult(_0x5ac55b,null))[_0x3bd9('0x2a')](handleError(_0x5ac55b,null));};exports['getInteractions']=function(_0x465836,_0x216917,_0x328ae1){var _0x55f2b7={'raw':![],'where':{}};var _0x26fdf5={};var _0x454315={'count':0x0,'rows':[]};return db[_0x3bd9('0x43')][_0x3bd9('0x6a')]({'where':{'id':_0x465836['params']['id']}})['then'](handleEntityNotFound(_0x216917,null))[_0x3bd9('0x20')](function(_0x111589){if(_0x111589){_0x26fdf5[_0x3bd9('0x47')]=_[_0x3bd9('0x48')](db[_0x3bd9('0xa4')]['rawAttributes']);_0x26fdf5[_0x3bd9('0x49')]=_[_0x3bd9('0x48')](_0x465836['query']);_0x26fdf5[_0x3bd9('0x4a')]=_[_0x3bd9('0x4c')](_0x26fdf5[_0x3bd9('0x47')],_0x26fdf5[_0x3bd9('0x49')]);_0x55f2b7[_0x3bd9('0x4b')]=_[_0x3bd9('0x4c')](_0x26fdf5[_0x3bd9('0x47')],qs[_0x3bd9('0x4d')](_0x465836[_0x3bd9('0x49')][_0x3bd9('0x4d')]));_0x55f2b7[_0x3bd9('0x4b')]=_0x55f2b7[_0x3bd9('0x4b')]['length']?_0x55f2b7[_0x3bd9('0x4b')]:_0x26fdf5['model'];if(!_0x465836[_0x3bd9('0x49')]['hasOwnProperty'](_0x3bd9('0x50'))){_0x55f2b7[_0x3bd9('0x2f')]=qs[_0x3bd9('0x2f')](_0x465836[_0x3bd9('0x49')][_0x3bd9('0x2f')]);_0x55f2b7[_0x3bd9('0x31')]=qs[_0x3bd9('0x31')](_0x465836[_0x3bd9('0x49')][_0x3bd9('0x31')]);}_0x55f2b7['order']=qs[_0x3bd9('0x52')](_0x465836[_0x3bd9('0x49')][_0x3bd9('0x52')]);_0x55f2b7[_0x3bd9('0x55')]=qs[_0x3bd9('0x4a')](_[_0x3bd9('0x53')](_0x465836['query'],_0x26fdf5[_0x3bd9('0x4a')]));_0x55f2b7[_0x3bd9('0x55')][_0x3bd9('0x69')]=_0x111589['id'];if(_0x465836['query']['filter']){_0x55f2b7[_0x3bd9('0x55')]=_[_0x3bd9('0x6b')](_0x55f2b7['where'],{'$or':_[_0x3bd9('0x42')](_0x55f2b7['attributes'],function(_0x5b84ad){var _0x2dd6ad={};_0x2dd6ad[_0x5b84ad]={'$like':'%'+_0x465836[_0x3bd9('0x49')]['filter']+'%'};return _0x2dd6ad;})});}_0x55f2b7=_['merge']({},_0x55f2b7,_0x465836[_0x3bd9('0x5d')]);return db[_0x3bd9('0xa4')][_0x3bd9('0x30')]({'where':_0x55f2b7[_0x3bd9('0x55')]})[_0x3bd9('0x20')](function(_0x546e0a){_0x454315[_0x3bd9('0x30')]=_0x546e0a;if(_0x465836[_0x3bd9('0x49')][_0x3bd9('0x57')]){_0x55f2b7[_0x3bd9('0x58')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x3bd9('0xaf')],'as':'Owner','attributes':[_0x3bd9('0x3e'),_0x3bd9('0xc5'),_0x3bd9('0xc6')],'required':![]},{'model':db[_0x3bd9('0xc7')],'as':_0x3bd9('0xc8'),'attributes':['id',_0x3bd9('0x3e'),'color'],'where':_0x465836['query'][_0x3bd9('0xc9')]?{'id':_0x465836[_0x3bd9('0x49')][_0x3bd9('0xc9')]}:undefined,'required':_0x465836['query']['tag']?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x55f2b7);})[_0x3bd9('0x20')](function(_0x144e64){_0x454315['rows']=_0x144e64;return _0x454315;});}})[_0x3bd9('0x20')](respondWithFilteredResult(_0x216917,_0x55f2b7))[_0x3bd9('0x2a')](handleError(_0x216917,null));};exports[_0x3bd9('0x3f')]=function(_0x446fb5,_0x324727,_0x31028c){var _0x1e0ada,_0x94fc15,_0x888ddf;if(_['isNil'](_0x446fb5[_0x3bd9('0x5f')][_0x3bd9('0x5f')])||_0x446fb5[_0x3bd9('0x5f')]['body']===''){throw new db[(_0x3bd9('0x97'))][(_0x3bd9('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3bd9('0x96')](_0x446fb5['body']['to'])){throw new db[(_0x3bd9('0x97'))][(_0x3bd9('0x79'))](_0x3bd9('0xca'));}_0x1e0ada=_0x446fb5[_0x3bd9('0x5f')]['to'];return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0x446fb5[_0x3bd9('0x5b')]['id']},'include':[{'model':db[_0x3bd9('0x9d')],'as':_0x3bd9('0xcb'),'include':[{'model':db[_0x3bd9('0xa2')],'as':_0x3bd9('0x9e'),'where':{'mobile':_0x1e0ada},'limit':0x1,'order':[[_0x3bd9('0x7d'),_0x3bd9('0x9f')]]}]}]})[_0x3bd9('0x20')](handleEntityNotFound(_0x324727,null))[_0x3bd9('0x20')](function(_0x1a7d4d){if(_0x1a7d4d&&_0x1a7d4d[_0x3bd9('0xcb')]){_0x94fc15=_0x1a7d4d[_0x3bd9('0x38')]({'plain':!![]});if(_0x94fc15[_0x3bd9('0xcb')]&&_0x94fc15[_0x3bd9('0xcb')]['Contacts'][_0x3bd9('0x4e')]){return _0x94fc15['List'][_0x3bd9('0x9e')][0x0];}return db['CmContact'][_0x3bd9('0x5e')](_['defaults'](_0x446fb5[_0x3bd9('0x5f')],{'firstName':_0x1e0ada,'mobile':_0x1e0ada,'phone':_0x1e0ada,'ListId':_0x94fc15['ListId']}));}})['then'](handleEntityNotFound(_0x324727,null))['then'](function(_0xbf68eb){if(_0xbf68eb){_0x888ddf=_0xbf68eb;return db[_0x3bd9('0xa4')][_0x3bd9('0x66')]({'where':{'ContactId':_0x888ddf['id'],'closed':![],'SmsAccountId':_0x94fc15['id']}})[_0x3bd9('0x20')](function(_0x387f6d){if(_0x387f6d){return[_0x387f6d,![]];}return db[_0x3bd9('0xa4')][_0x3bd9('0x5e')]({'UserId':_0x446fb5[_0x3bd9('0xcc')]['id'],'ContactId':_0x888ddf['id'],'SmsAccountId':_0x94fc15['id'],'phone':_0x1e0ada,'firstMsgDirection':_0x3bd9('0xcd'),'Messages':[_[_0x3bd9('0x6b')](_0x446fb5['body'],{'read':![],'body':_0x446fb5[_0x3bd9('0x5f')]['body'],'phone':_0x1e0ada,'SmsAccountId':_0x94fc15['id'],'UserId':_0x446fb5[_0x3bd9('0xcc')]['id'],'ContactId':_0x888ddf['id']})]},{'include':[{'model':db[_0x3bd9('0xab')],'as':'Messages'}]})[_0x3bd9('0x20')](function(_0x6522cf){return[_0x6522cf,!![]];});});}})[_0x3bd9('0xce')](function(_0x4a2863,_0x373926){if(_0x373926){return _0x4a2863;}return db[_0x3bd9('0xab')][_0x3bd9('0x5e')](_[_0x3bd9('0x6b')](_0x446fb5['body'],{'read':![],'body':_0x446fb5[_0x3bd9('0x5f')][_0x3bd9('0x5f')],'phone':_0x1e0ada,'SmsAccountId':_0x94fc15['id'],'SmsInteractionId':_0x4a2863['id'],'UserId':_0x446fb5[_0x3bd9('0xcc')]['id'],'ContactId':_0x888ddf['id']}))[_0x3bd9('0x20')](function(_0x3c9efd){_0x4a2863[_0x3bd9('0xcf')][_0x3bd9('0xd0')]=[];_0x4a2863[_0x3bd9('0xcf')][_0x3bd9('0xd0')]['push'](_0x3c9efd[_0x3bd9('0xcf')]);return _0x4a2863;});})[_0x3bd9('0x20')](respondWithResult(_0x324727,null))['catch'](handleError(_0x324727,null));};exports['status']=function(_0x360285,_0x1e5322,_0x4b1f02){if(_0x360285['body']['id']){delete _0x360285[_0x3bd9('0x5f')]['id'];}var _0x158ac7,_0x408a85,_0x575df0;return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0x360285[_0x3bd9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1e5322,null))[_0x3bd9('0x20')](function(_0x50b793){if(_0x50b793){_0x575df0=_0x50b793;logger['debug'](_0x3bd9('0x24'),_0x3bd9('0x3c'),'received\x20delivery\x20report\x20from',_0x50b793[_0x3bd9('0x46')],util[_0x3bd9('0xd1')](_0x360285[_0x3bd9('0x5f')],{'showHidden':![],'depth':null}));switch(_0x50b793[_0x3bd9('0x46')]){case'skebby':if(_0x360285[_0x3bd9('0x5f')]['skebby_dispatch_id']&&_0x360285['body'][_0x3bd9('0x3c')]){_0x408a85=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x3c')];return db[_0x3bd9('0xab')][_0x3bd9('0x66')]({'where':{'messageId':_0x360285[_0x3bd9('0x5f')]['skebby_dispatch_id']}});}break;case _0x3bd9('0x89'):if(_0x360285['body'][_0x3bd9('0xd2')]&&_0x360285['body'][_0x3bd9('0xd3')]){_0x408a85=_0x360285[_0x3bd9('0x5f')]['statusInt'];return db['SmsMessage']['find']({'where':{'messageId':_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd2')]}});}break;case _0x3bd9('0x8a'):if(_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x8b')]&&_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd4')]){_0x408a85=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd4')];return db['SmsMessage'][_0x3bd9('0x66')]({'where':{'messageId':_0x360285['body']['message_id']}});}break;case _0x3bd9('0x8e'):var _0x2756d2=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x8f')][0x0];if(_0x2756d2[_0x3bd9('0x85')]&&_0x2756d2['status'][_0x3bd9('0xd5')]===_0x3bd9('0xd6')){_0x408a85=_0x2756d2['status'][_0x3bd9('0xd5')];return db[_0x3bd9('0xab')][_0x3bd9('0x66')]({'where':{'messageId':_0x2756d2[_0x3bd9('0x85')]}});}break;case _0x3bd9('0x92'):if(_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x85')]&&_0x360285[_0x3bd9('0x5f')]['status']){_0x408a85=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x3c')];return db['SmsMessage'][_0x3bd9('0x66')]({'where':{'messageId':_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x85')]}});}break;case'bandwidth':if(_0x360285[_0x3bd9('0x5f')][0x0][_0x3bd9('0x28')]['id']){_0x408a85=_0x360285[_0x3bd9('0x5f')][0x0]['type'];return db[_0x3bd9('0xab')][_0x3bd9('0x66')]({'where':{'messageId':_0x360285['body'][0x0][_0x3bd9('0x28')]['id']}});}break;case _0x3bd9('0x95'):if(_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd7')]&&_0x360285['body'][_0x3bd9('0x3c')]){_0x408a85=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x3c')];return db[_0x3bd9('0xab')][_0x3bd9('0x66')]({'where':{'messageId':_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd7')]}});}break;}}})[_0x3bd9('0x20')](handleEntityNotFound(_0x1e5322,null))[_0x3bd9('0x20')](function(_0x37c6b8){if(_0x37c6b8){_0x158ac7=_0x37c6b8;switch(_0x575df0['type']){case _0x3bd9('0x87'):if(_0x408a85===_0x3bd9('0xd6')){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger['error'](_0x3bd9('0x24'),'status','skebby',util[_0x3bd9('0xd1')](_0x360285['body'],{'showHidden':![],'depth':null}));}break;case _0x3bd9('0x89'):if(_0x408a85==='1'){return _0x158ac7['update']({'read':!![]});}else{logger[_0x3bd9('0x26')](_0x3bd9('0x24'),'status','skebby',util[_0x3bd9('0xd1')](_0x360285['body'],{'showHidden':![],'depth':null}));}break;case _0x3bd9('0x8a'):if(!_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd8')]&&_0x408a85>=0xc8&&_0x408a85<=0xce){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger[_0x3bd9('0x26')](_0x3bd9('0x24'),_0x3bd9('0x3c'),_0x3bd9('0x8a'),util[_0x3bd9('0xd1')](_0x360285['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x399774=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x8f')][0x0];if(_0x399774[_0x3bd9('0x3c')][_0x3bd9('0xd5')]==='DELIVERED'){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger['error'](_0x3bd9('0x24'),'status','infobip',util[_0x3bd9('0xd1')](_0x360285[_0x3bd9('0x5f')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x408a85=='DELIVERED_TO_GATEWAY'||_0x408a85=='RECEIVED_BY_RECIPIENT'){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger[_0x3bd9('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3bd9('0x3c'),_0x3bd9('0x92'),util['inspect'](_0x360285[_0x3bd9('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x3bd9('0x94'):if(_0x408a85==_0x3bd9('0xd9')){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger[_0x3bd9('0x26')](_0x3bd9('0x24'),_0x3bd9('0x3c'),_0x3bd9('0x94'),util[_0x3bd9('0xd1')](_0x360285[_0x3bd9('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x3bd9('0x95'):if(_0x408a85===_0x3bd9('0xda')||_0x408a85==='ACCEPTD'){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger[_0x3bd9('0x26')](_0x3bd9('0x24'),_0x3bd9('0x3c'),_0x3bd9('0x95'),util[_0x3bd9('0xd1')](_0x360285[_0x3bd9('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x158ac7;}})[_0x3bd9('0x20')](respondWithResult(_0x1e5322,null))[_0x3bd9('0x2a')](handleError(_0x1e5322,null));};exports[_0x3bd9('0xdb')]=function(_0x36f8e8,_0x2578ee,_0x1d175d){var _0x2f76c4,_0x1bcea8,_0x16b7d5;return db[_0x3bd9('0x43')]['find']({'where':{'id':_0x36f8e8['params']['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x2578ee,null))[_0x3bd9('0x20')](function(_0x2159d8){if(_0x2159d8){_0x16b7d5=_0x2159d8;logger[_0x3bd9('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x2159d8[_0x3bd9('0x46')],util['inspect'](_0x36f8e8[_0x3bd9('0x49')],{'showHidden':![],'depth':null}));switch(_0x2159d8[_0x3bd9('0x46')]){case _0x3bd9('0x90'):if(_0x36f8e8[_0x3bd9('0x49')][_0x3bd9('0xdc')]&&_0x36f8e8['query'][_0x3bd9('0xdd')]){_0x1bcea8=_0x36f8e8[_0x3bd9('0x49')][_0x3bd9('0xdd')];return db[_0x3bd9('0xab')][_0x3bd9('0x66')]({'where':{'messageId':_0x36f8e8[_0x3bd9('0x49')][_0x3bd9('0xdc')]}});}break;}}})[_0x3bd9('0x20')](handleEntityNotFound(_0x2578ee,null))[_0x3bd9('0x20')](function(_0x374fa5){if(_0x374fa5){_0x2f76c4=_0x374fa5;switch(_0x16b7d5['type']){case'csc':if(_0x1bcea8==='2'||_0x1bcea8==='6'){return _0x2f76c4[_0x3bd9('0x37')]({'read':!![]});}else{logger[_0x3bd9('0x26')](_0x3bd9('0x24'),_0x3bd9('0x3c'),_0x3bd9('0x90'),util[_0x3bd9('0xd1')](_0x36f8e8[_0x3bd9('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x2f76c4;}})[_0x3bd9('0x20')](respondWithResult(_0x2578ee,null))[_0x3bd9('0x2a')](handleError(_0x2578ee,null));};exports[_0x3bd9('0xde')]=function(_0x224317,_0x4a8d10,_0x1f1976){return db['SmsAccount'][_0x3bd9('0x66')]({'where':{'id':_0x224317[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x4a8d10,null))[_0x3bd9('0x20')](function(_0x17cb7b){if(_0x17cb7b){return _0x17cb7b['addAgents'](_0x224317[_0x3bd9('0x5f')]['ids'],_[_0x3bd9('0xa1')](_0x224317['body'],['ids','id'])||{})['spread'](function(_0x58305b){for(var _0x106f08=0x0;_0x106f08<_0x224317[_0x3bd9('0x5f')][_0x3bd9('0x6e')][_0x3bd9('0x4e')];_0x106f08+=0x1){socket[_0x3bd9('0xdf')](_0x3bd9('0xe0'),{'UserId':Number(_0x224317[_0x3bd9('0x5f')][_0x3bd9('0x6e')][_0x106f08]),'SmsAccountId':Number(_0x224317[_0x3bd9('0x5b')]['id'])});}return _0x58305b;});}})['then'](respondWithResult(_0x4a8d10,null))[_0x3bd9('0x2a')](handleError(_0x4a8d10,null));};exports[_0x3bd9('0xe1')]=function(_0x14f842,_0x52d78b,_0x31d1f6){return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0x14f842[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x52d78b,null))['then'](function(_0x14fc81){if(_0x14fc81){return _0x14fc81[_0x3bd9('0xe1')](_0x14f842['query'][_0x3bd9('0x6e')])['then'](function(){if(_[_0x3bd9('0xe2')](_0x14f842['query']['ids'])){for(var _0x169d8c=0x0;_0x169d8c<_0x14f842[_0x3bd9('0x49')][_0x3bd9('0x6e')][_0x3bd9('0x4e')];_0x169d8c+=0x1){socket['emit'](_0x3bd9('0xe3'),{'UserId':Number(_0x14f842[_0x3bd9('0x49')][_0x3bd9('0x6e')][_0x169d8c]),'SmsAccountId':Number(_0x14f842[_0x3bd9('0x5b')]['id'])});}}else{socket[_0x3bd9('0xdf')](_0x3bd9('0xe3'),{'UserId':Number(_0x14f842[_0x3bd9('0x49')][_0x3bd9('0x6e')]),'SmsAccountId':Number(_0x14f842[_0x3bd9('0x5b')]['id'])});}});}})[_0x3bd9('0x20')](respondWithStatusCode(_0x52d78b,null))[_0x3bd9('0x2a')](handleError(_0x52d78b,null));};exports['getAgents']=function(_0x2f920b,_0x5e6d06,_0x473095){var _0x3ecbd1={};var _0x256c57={};var _0x332da0;var _0x5d3f83;return db['SmsAccount'][_0x3bd9('0x6a')]({'where':{'id':_0x2f920b['params']['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x5e6d06,null))[_0x3bd9('0x20')](function(_0x1eb3ac){if(_0x1eb3ac){_0x332da0=_0x1eb3ac;_0x256c57[_0x3bd9('0x47')]=_['keys'](db[_0x3bd9('0xaf')]['rawAttributes']);_0x256c57['query']=_[_0x3bd9('0x48')](_0x2f920b[_0x3bd9('0x49')]);_0x256c57[_0x3bd9('0x4a')]=_[_0x3bd9('0x4c')](_0x256c57[_0x3bd9('0x47')],_0x256c57[_0x3bd9('0x49')]);_0x3ecbd1[_0x3bd9('0x4b')]=_[_0x3bd9('0x4c')](_0x256c57['model'],qs[_0x3bd9('0x4d')](_0x2f920b[_0x3bd9('0x49')][_0x3bd9('0x4d')]));_0x3ecbd1[_0x3bd9('0x4b')]=_0x3ecbd1[_0x3bd9('0x4b')][_0x3bd9('0x4e')]?_0x3ecbd1[_0x3bd9('0x4b')]:_0x256c57['model'];_0x3ecbd1[_0x3bd9('0x51')]=qs[_0x3bd9('0x52')](_0x2f920b['query'][_0x3bd9('0x52')]);_0x3ecbd1['where']=qs['filters'](_[_0x3bd9('0x53')](_0x2f920b[_0x3bd9('0x49')],_0x256c57['filters']));if(_0x2f920b[_0x3bd9('0x49')]['filter']){_0x3ecbd1[_0x3bd9('0x55')]=_[_0x3bd9('0x6b')](_0x3ecbd1['where'],{'$or':_['map'](_0x3ecbd1['attributes'],function(_0x5e57bd){var _0x35d6d6={};_0x35d6d6[_0x5e57bd]={'$like':'%'+_0x2f920b[_0x3bd9('0x49')][_0x3bd9('0x54')]+'%'};return _0x35d6d6;})});}_0x3ecbd1=_[_0x3bd9('0x6b')]({},_0x3ecbd1,_0x2f920b['options']);return _0x332da0[_0x3bd9('0xe4')](_0x3ecbd1);}})[_0x3bd9('0x20')](function(_0x39399a){if(_0x39399a){_0x5d3f83=_0x39399a[_0x3bd9('0x4e')];if(!_0x2f920b[_0x3bd9('0x49')][_0x3bd9('0x4f')]('nolimit')){_0x3ecbd1[_0x3bd9('0x2f')]=qs[_0x3bd9('0x2f')](_0x2f920b[_0x3bd9('0x49')][_0x3bd9('0x2f')]);_0x3ecbd1['offset']=qs[_0x3bd9('0x31')](_0x2f920b['query']['offset']);}return _0x332da0[_0x3bd9('0xe4')](_0x3ecbd1);}})[_0x3bd9('0x20')](function(_0x3decc7){if(_0x3decc7){return _0x3decc7?{'count':_0x5d3f83,'rows':_0x3decc7}:null;}})[_0x3bd9('0x20')](respondWithResult(_0x5e6d06,null))[_0x3bd9('0x2a')](handleError(_0x5e6d06,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 0e9bd0e..df382ec 100644 --- a/server/api/smsAccount/smsAccount.events.js +++ b/server/api/smsAccount/smsAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2577=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsAccount'];(function(_0x37aaff,_0x833369){var _0x5bf2ac=function(_0xd1bdb0){while(--_0xd1bdb0){_0x37aaff['push'](_0x37aaff['shift']());}};_0x5bf2ac(++_0x833369);}(_0x2577,0xd5));var _0x7257=function(_0x169996,_0x4b59b5){_0x169996=_0x169996-0x0;var _0x28d7e6=_0x2577[_0x169996];return _0x28d7e6;};'use strict';var EventEmitter=require(_0x7257('0x0'));var SmsAccount=require(_0x7257('0x1'))['db'][_0x7257('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7257('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7257('0x4'),'afterDestroy':_0x7257('0x5')};function emitEvent(_0x2a7450){return function(_0x413120,_0x328222,_0x3a221d){SmsAccountEvents[_0x7257('0x6')](_0x2a7450+':'+_0x413120['id'],_0x413120);SmsAccountEvents['emit'](_0x2a7450,_0x413120);_0x3a221d(null);};}for(var e in events){if(events[_0x7257('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x7257('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x91b2=['emit','hook','exports','events','setMaxListeners','save','remove'];(function(_0x4b33d1,_0x2414e1){var _0x9e7221=function(_0x476ecc){while(--_0x476ecc){_0x4b33d1['push'](_0x4b33d1['shift']());}};_0x9e7221(++_0x2414e1);}(_0x91b2,0x1d8));var _0x291b=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x91b2[_0x9df060];return _0x338dfe;};'use strict';var EventEmitter=require(_0x291b('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x291b('0x1')](0x0);var events={'afterCreate':_0x291b('0x2'),'afterUpdate':'update','afterDestroy':_0x291b('0x3')};function emitEvent(_0x920df9){return function(_0x20c83f,_0x492254,_0x3e9046){SmsAccountEvents[_0x291b('0x4')](_0x920df9+':'+_0x20c83f['id'],_0x20c83f);SmsAccountEvents[_0x291b('0x4')](_0x920df9,_0x20c83f);_0x3e9046(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x291b('0x5')](e,emitEvent(event));}}module[_0x291b('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 4b54070..d07d294 100644 --- a/server/api/smsAccount/smsAccount.model.js +++ b/server/api/smsAccount/smsAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4aad=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','sms_accounts','lodash','util'];(function(_0x153a5d,_0x2d4fe2){var _0x33c47c=function(_0x40ba82){while(--_0x40ba82){_0x153a5d['push'](_0x153a5d['shift']());}};_0x33c47c(++_0x2d4fe2);}(_0x4aad,0x116));var _0xd4aa=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x4aad[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0xd4aa('0x0'));var util=require(_0xd4aa('0x1'));var logger=require(_0xd4aa('0x2'))('api');var moment=require(_0xd4aa('0x3'));var BPromise=require(_0xd4aa('0x4'));var rp=require(_0xd4aa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4aa('0x6'));var config=require(_0xd4aa('0x7'));var attributes=require(_0xd4aa('0x8'));module['exports']=function(_0x1c702b,_0x40f7cd){return _0x1c702b['define']('SmsAccount',attributes,{'tableName':_0xd4aa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda5b=['sms_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount'];(function(_0xfb885a,_0x538ad0){var _0x248965=function(_0x322548){while(--_0x322548){_0xfb885a['push'](_0xfb885a['shift']());}};_0x248965(++_0x538ad0);}(_0xda5b,0x12d));var _0xbda5=function(_0x334f9a,_0x542f01){_0x334f9a=_0x334f9a-0x0;var _0x2b219d=_0xda5b[_0x334f9a];return _0x2b219d;};'use strict';var _=require(_0xbda5('0x0'));var util=require(_0xbda5('0x1'));var logger=require(_0xbda5('0x2'))(_0xbda5('0x3'));var moment=require('moment');var BPromise=require(_0xbda5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbda5('0x5'));var rimraf=require(_0xbda5('0x6'));var config=require(_0xbda5('0x7'));var attributes=require(_0xbda5('0x8'));module['exports']=function(_0x201ebf,_0x496fd0){return _0x201ebf[_0xbda5('0x9')](_0xbda5('0xa'),attributes,{'tableName':_0xbda5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index a38f113..cdd6432 100644 --- a/server/api/smsAccount/smsAccount.rpc.js +++ b/server/api/smsAccount/smsAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae45=['SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','SmsAccount','find','options','attributes','include','map','model','ShowSmsAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./smsAccount.socket','request','then'];(function(_0x2de66b,_0x33ae0c){var _0x19c1ea=function(_0x2965d6){while(--_0x2965d6){_0x2de66b['push'](_0x2de66b['shift']());}};_0x19c1ea(++_0x33ae0c);}(_0xae45,0xb5));var _0x5ae4=function(_0x5673e5,_0xd0e87b){_0x5673e5=_0x5673e5-0x0;var _0x204445=_0xae45[_0x5673e5];return _0x204445;};'use strict';var _=require(_0x5ae4('0x0'));var util=require(_0x5ae4('0x1'));var moment=require(_0x5ae4('0x2'));var BPromise=require(_0x5ae4('0x3'));var rs=require(_0x5ae4('0x4'));var fs=require('fs');var Redis=require(_0x5ae4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ae4('0x6'));var logger=require(_0x5ae4('0x7'))(_0x5ae4('0x8'));var config=require(_0x5ae4('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ae4('0xa')]({'port':0x232a});config[_0x5ae4('0xb')]=_['defaults'](config[_0x5ae4('0xb')],{'host':_0x5ae4('0xc'),'port':0x18eb});var socket=require(_0x5ae4('0xd'))(new Redis(config[_0x5ae4('0xb')]));require(_0x5ae4('0xe'))['register'](socket);function respondWithRpcPromise(_0xcffc71,_0x42452e,_0x339ee3){return new BPromise(function(_0xf8035,_0x460864){return client[_0x5ae4('0xf')](_0xcffc71,_0x339ee3)[_0x5ae4('0x10')](function(_0x43fabe){logger['info'](_0x5ae4('0x11'),_0x42452e,_0x5ae4('0x12'));logger[_0x5ae4('0x13')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x42452e,_0x5ae4('0x12'),JSON[_0x5ae4('0x14')](_0x43fabe));if(_0x43fabe['error']){if(_0x43fabe['error'][_0x5ae4('0x15')]===0x1f4){logger[_0x5ae4('0x16')](_0x5ae4('0x11'),_0x42452e,_0x43fabe[_0x5ae4('0x16')]['message']);return _0x460864(_0x43fabe['error'][_0x5ae4('0x17')]);}logger['error'](_0x5ae4('0x11'),_0x42452e,_0x43fabe[_0x5ae4('0x16')]['message']);return _0xf8035(_0x43fabe[_0x5ae4('0x16')][_0x5ae4('0x17')]);}else{logger[_0x5ae4('0x18')](_0x5ae4('0x11'),_0x42452e,_0x5ae4('0x12'));_0xf8035(_0x43fabe['result'][_0x5ae4('0x17')]);}})['catch'](function(_0x175fe7){logger[_0x5ae4('0x16')](_0x5ae4('0x11'),_0x42452e,_0x175fe7);_0x460864(_0x175fe7);});});}exports['ShowSmsAccount']=function(_0x5bc7e4){var _0x85e7=this;return new Promise(function(_0x215399,_0x410272){return db[_0x5ae4('0x19')][_0x5ae4('0x1a')]({'raw':_0x5bc7e4['options']?_0x5bc7e4[_0x5ae4('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5bc7e4[_0x5ae4('0x1b')]?_0x5bc7e4[_0x5ae4('0x1b')]['where']||null:null,'attributes':_0x5bc7e4['options']?_0x5bc7e4[_0x5ae4('0x1b')][_0x5ae4('0x1c')]||null:null,'include':_0x5bc7e4[_0x5ae4('0x1b')]?_0x5bc7e4[_0x5ae4('0x1b')][_0x5ae4('0x1d')]?_[_0x5ae4('0x1e')](_0x5bc7e4[_0x5ae4('0x1b')][_0x5ae4('0x1d')],function(_0x286800){return{'model':db[_0x286800[_0x5ae4('0x1f')]],'as':_0x286800['as'],'attributes':_0x286800[_0x5ae4('0x1c')],'include':_0x286800['include']?_['map'](_0x286800[_0x5ae4('0x1d')],function(_0x303dc6){return{'model':db[_0x303dc6[_0x5ae4('0x1f')]],'as':_0x303dc6['as'],'attributes':_0x303dc6[_0x5ae4('0x1c')],'include':_0x303dc6[_0x5ae4('0x1d')]?_[_0x5ae4('0x1e')](_0x303dc6['include'],function(_0x3ec32b){return{'model':db[_0x3ec32b[_0x5ae4('0x1f')]],'as':_0x3ec32b['as'],'attributes':_0x3ec32b[_0x5ae4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5ae4('0x10')](function(_0x12f838){logger[_0x5ae4('0x18')](_0x5ae4('0x20'),_0x5bc7e4);logger['debug']('ShowSmsAccount',_0x5bc7e4,JSON[_0x5ae4('0x14')](_0x12f838));_0x215399(_0x12f838);})['catch'](function(_0x132313){logger[_0x5ae4('0x16')](_0x5ae4('0x20'),_0x132313[_0x5ae4('0x17')],_0x5bc7e4);_0x410272(_0x85e7[_0x5ae4('0x16')](0x1f4,_0x132313[_0x5ae4('0x17')]));});});}; \ No newline at end of file +var _0xc8f8=['request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','model','map','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x381306,_0x4a3435){var _0x4a8256=function(_0x39d4bf){while(--_0x39d4bf){_0x381306['push'](_0x381306['shift']());}};_0x4a8256(++_0x4a3435);}(_0xc8f8,0x1cc));var _0x8c8f=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xc8f8[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0x8c8f('0x0'));var moment=require(_0x8c8f('0x1'));var BPromise=require(_0x8c8f('0x2'));var rs=require(_0x8c8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c8f('0x4'))['db'];var utils=require(_0x8c8f('0x5'));var logger=require(_0x8c8f('0x6'))(_0x8c8f('0x7'));var config=require(_0x8c8f('0x8'));var jayson=require(_0x8c8f('0x9'));var client=jayson['client'][_0x8c8f('0xa')]({'port':0x232a});config[_0x8c8f('0xb')]=_['defaults'](config[_0x8c8f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8c8f('0xc'))(new Redis(config[_0x8c8f('0xb')]));require(_0x8c8f('0xd'))[_0x8c8f('0xe')](socket);function respondWithRpcPromise(_0x3d2806,_0x2ad4f3,_0x3633fa){return new BPromise(function(_0x70df11,_0x3afb34){return client[_0x8c8f('0xf')](_0x3d2806,_0x3633fa)[_0x8c8f('0x10')](function(_0x4ea06a){logger[_0x8c8f('0x11')](_0x8c8f('0x12'),_0x2ad4f3,'request\x20sent');logger[_0x8c8f('0x13')](_0x8c8f('0x14'),_0x2ad4f3,_0x8c8f('0x15'),JSON[_0x8c8f('0x16')](_0x4ea06a));if(_0x4ea06a[_0x8c8f('0x17')]){if(_0x4ea06a[_0x8c8f('0x17')][_0x8c8f('0x18')]===0x1f4){logger[_0x8c8f('0x17')]('SmsAccount,\x20%s,\x20%s',_0x2ad4f3,_0x4ea06a['error']['message']);return _0x3afb34(_0x4ea06a[_0x8c8f('0x17')][_0x8c8f('0x19')]);}logger['error'](_0x8c8f('0x12'),_0x2ad4f3,_0x4ea06a[_0x8c8f('0x17')][_0x8c8f('0x19')]);return _0x70df11(_0x4ea06a[_0x8c8f('0x17')][_0x8c8f('0x19')]);}else{logger[_0x8c8f('0x11')](_0x8c8f('0x12'),_0x2ad4f3,_0x8c8f('0x15'));_0x70df11(_0x4ea06a[_0x8c8f('0x1a')][_0x8c8f('0x19')]);}})[_0x8c8f('0x1b')](function(_0x2b3bfe){logger[_0x8c8f('0x17')](_0x8c8f('0x12'),_0x2ad4f3,_0x2b3bfe);_0x3afb34(_0x2b3bfe);});});}exports[_0x8c8f('0x1c')]=function(_0x31038c){var _0x1c843a=this;return new Promise(function(_0x5667f4,_0x5887a0){return db[_0x8c8f('0x1d')]['find']({'raw':_0x31038c[_0x8c8f('0x1e')]?_0x31038c[_0x8c8f('0x1e')][_0x8c8f('0x1f')]===undefined?!![]:![]:!![],'where':_0x31038c['options']?_0x31038c[_0x8c8f('0x1e')][_0x8c8f('0x20')]||null:null,'attributes':_0x31038c[_0x8c8f('0x1e')]?_0x31038c[_0x8c8f('0x1e')][_0x8c8f('0x21')]||null:null,'include':_0x31038c[_0x8c8f('0x1e')]?_0x31038c[_0x8c8f('0x1e')][_0x8c8f('0x22')]?_['map'](_0x31038c[_0x8c8f('0x1e')][_0x8c8f('0x22')],function(_0x4625ae){return{'model':db[_0x4625ae[_0x8c8f('0x23')]],'as':_0x4625ae['as'],'attributes':_0x4625ae[_0x8c8f('0x21')],'include':_0x4625ae['include']?_['map'](_0x4625ae[_0x8c8f('0x22')],function(_0x5824a1){return{'model':db[_0x5824a1['model']],'as':_0x5824a1['as'],'attributes':_0x5824a1[_0x8c8f('0x21')],'include':_0x5824a1[_0x8c8f('0x22')]?_[_0x8c8f('0x24')](_0x5824a1[_0x8c8f('0x22')],function(_0x32d2cb){return{'model':db[_0x32d2cb[_0x8c8f('0x23')]],'as':_0x32d2cb['as'],'attributes':_0x32d2cb[_0x8c8f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fd9bb){logger[_0x8c8f('0x11')]('ShowSmsAccount',_0x31038c);logger[_0x8c8f('0x13')](_0x8c8f('0x1c'),_0x31038c,JSON['stringify'](_0x3fd9bb));_0x5667f4(_0x3fd9bb);})['catch'](function(_0x524d03){logger[_0x8c8f('0x17')](_0x8c8f('0x1c'),_0x524d03[_0x8c8f('0x19')],_0x31038c);_0x5887a0(_0x1c843a['error'](0x1f4,_0x524d03['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index f2eb862..d52116d 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index c71b340..c8ce457 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x21a178,_0x5bfd31){var _0x57bc28=function(_0x5a70c6){while(--_0x5a70c6){_0x21a178['push'](_0x21a178['shift']());}};_0x57bc28(++_0x5bfd31);}(_0x008c,0x188));var _0xc008=function(_0x41ccbb,_0x3771e8){_0x41ccbb=_0x41ccbb-0x0;var _0x519c61=_0x008c[_0x41ccbb];return _0x519c61;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index ec9dd85..94aaed1 100644 --- a/server/api/smsApplication/smsApplication.attributes.js +++ b/server/api/smsApplication/smsApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x082e=['STRING','sequelize','exports','INTEGER','TEXT'];(function(_0x3d956e,_0x9e178f){var _0xc524c5=function(_0x59937a){while(--_0x59937a){_0x3d956e['push'](_0x3d956e['shift']());}};_0xc524c5(++_0x9e178f);}(_0x082e,0x17d));var _0xe082=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x082e[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xe082('0x0'));module[_0xe082('0x1')]={'priority':{'type':Sequelize[_0xe082('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe082('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe082('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1353=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x5d718c,_0x14527e){var _0x2a2706=function(_0x2efb1b){while(--_0x2efb1b){_0x5d718c['push'](_0x5d718c['shift']());}};_0x2a2706(++_0x14527e);}(_0x1353,0x164));var _0x3135=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1353[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x3135('0x0'));module[_0x3135('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3135('0x2')],'allowNull':![],'defaultValue':_0x3135('0x3')},'appdata':{'type':Sequelize[_0x3135('0x4')]()},'description':{'type':Sequelize[_0x3135('0x2')]},'interval':{'type':Sequelize[_0x3135('0x2')],'defaultValue':_0x3135('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index be8de42..6eb0d02 100644 --- a/server/api/smsApplication/smsApplication.controller.js +++ b/server/api/smsApplication/smsApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4c3=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SmsApplication','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0xe22f40,_0x3331e2){var _0x226c12=function(_0x213935){while(--_0x213935){_0xe22f40['push'](_0xe22f40['shift']());}};_0x226c12(++_0x3331e2);}(_0xd4c3,0x15c));var _0x3d4c=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0xd4c3[_0x3f4891];return _0x54f2d8;};'use strict';var emlformat=require(_0x3d4c('0x0'));var rimraf=require(_0x3d4c('0x1'));var zipdir=require(_0x3d4c('0x2'));var jsonpatch=require(_0x3d4c('0x3'));var rp=require(_0x3d4c('0x4'));var moment=require(_0x3d4c('0x5'));var BPromise=require(_0x3d4c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3d4c('0x7'));var sox=require(_0x3d4c('0x8'));var csv=require(_0x3d4c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d4c('0xa'));var _=require(_0x3d4c('0xb'));var squel=require(_0x3d4c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3d4c('0xd'));var toCsv=require(_0x3d4c('0x9'));var querystring=require(_0x3d4c('0xe'));var Papa=require('papaparse');var Redis=require(_0x3d4c('0xf'));var authService=require(_0x3d4c('0x10'));var qs=require(_0x3d4c('0x11'));var as=require(_0x3d4c('0x12'));var hardwareService=require(_0x3d4c('0x13'));var logger=require(_0x3d4c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3d4c('0x15'));var licenseUtil=require(_0x3d4c('0x16'));var db=require(_0x3d4c('0x17'))['db'];function respondWithStatusCode(_0x577db3,_0x30e497){_0x30e497=_0x30e497||0xcc;return function(_0x1a3b3a){if(_0x1a3b3a){return _0x577db3['sendStatus'](_0x30e497);}return _0x577db3['status'](_0x30e497)[_0x3d4c('0x18')]();};}function respondWithResult(_0x230a4e,_0x58cd43){_0x58cd43=_0x58cd43||0xc8;return function(_0x2ee8aa){if(_0x2ee8aa){return _0x230a4e[_0x3d4c('0x19')](_0x58cd43)[_0x3d4c('0x1a')](_0x2ee8aa);}};}function respondWithFilteredResult(_0x1b5be2,_0x4662c6){return function(_0x491576){if(_0x491576){var _0x9d2265=typeof _0x4662c6[_0x3d4c('0x1b')]==='undefined'&&typeof _0x4662c6[_0x3d4c('0x1c')]==='undefined';var _0x2882fc=_0x491576[_0x3d4c('0x1d')];var _0x391d59=_0x9d2265?0x0:_0x4662c6[_0x3d4c('0x1b')];var _0x17dc9a=_0x9d2265?_0x491576[_0x3d4c('0x1d')]:_0x4662c6[_0x3d4c('0x1b')]+_0x4662c6[_0x3d4c('0x1c')];var _0x3baf05;if(_0x17dc9a>=_0x2882fc){_0x17dc9a=_0x2882fc;_0x3baf05=0xc8;}else{_0x3baf05=0xce;}_0x1b5be2[_0x3d4c('0x19')](_0x3baf05);return _0x1b5be2[_0x3d4c('0x1e')]('Content-Range',_0x391d59+'-'+_0x17dc9a+'/'+_0x2882fc)[_0x3d4c('0x1a')](_0x491576);}return null;};}function patchUpdates(_0xfb70ae){return function(_0x264314){try{jsonpatch[_0x3d4c('0x1f')](_0x264314,_0xfb70ae,!![]);}catch(_0x1afe30){return BPromise[_0x3d4c('0x20')](_0x1afe30);}return _0x264314[_0x3d4c('0x21')]();};}function saveUpdates(_0x480203,_0x56021e){return function(_0x53be9c){if(_0x53be9c){return _0x53be9c[_0x3d4c('0x22')](_0x480203)['then'](function(_0x448e43){return _0x448e43;});}return null;};}function removeEntity(_0x2197f3,_0x4ff8b3){return function(_0x2884a3){if(_0x2884a3){return _0x2884a3[_0x3d4c('0x23')]()[_0x3d4c('0x24')](function(){_0x2197f3[_0x3d4c('0x19')](0xcc)[_0x3d4c('0x18')]();});}};}function handleEntityNotFound(_0x52a01a,_0x42f098){return function(_0x5720a6){if(!_0x5720a6){_0x52a01a['sendStatus'](0x194);}return _0x5720a6;};}function handleError(_0x27d494,_0x51d129){_0x51d129=_0x51d129||0x1f4;return function(_0x4eff5f){logger[_0x3d4c('0x25')](_0x4eff5f[_0x3d4c('0x26')]);if(_0x4eff5f[_0x3d4c('0x27')]){delete _0x4eff5f[_0x3d4c('0x27')];}_0x27d494['status'](_0x51d129)[_0x3d4c('0x28')](_0x4eff5f);};}exports[_0x3d4c('0x29')]=function(_0x1f6dc6,_0x8c9b04){var _0x4c2b2d={},_0x4cd3fb={},_0x4b44f8={'count':0x0,'rows':[]};var _0x2e8125=_[_0x3d4c('0x2a')](db[_0x3d4c('0x2b')]['rawAttributes'],function(_0x368751){return{'name':_0x368751[_0x3d4c('0x2c')],'type':_0x368751['type'][_0x3d4c('0x2d')]};});_0x4cd3fb[_0x3d4c('0x2e')]=_[_0x3d4c('0x2a')](_0x2e8125,_0x3d4c('0x27'));_0x4cd3fb[_0x3d4c('0x2f')]=_[_0x3d4c('0x30')](_0x1f6dc6[_0x3d4c('0x2f')]);_0x4cd3fb[_0x3d4c('0x31')]=_[_0x3d4c('0x32')](_0x4cd3fb[_0x3d4c('0x2e')],_0x4cd3fb[_0x3d4c('0x2f')]);_0x4c2b2d[_0x3d4c('0x33')]=_[_0x3d4c('0x32')](_0x4cd3fb[_0x3d4c('0x2e')],qs[_0x3d4c('0x34')](_0x1f6dc6[_0x3d4c('0x2f')][_0x3d4c('0x34')]));_0x4c2b2d[_0x3d4c('0x33')]=_0x4c2b2d['attributes'][_0x3d4c('0x35')]?_0x4c2b2d[_0x3d4c('0x33')]:_0x4cd3fb[_0x3d4c('0x2e')];if(!_0x1f6dc6[_0x3d4c('0x2f')][_0x3d4c('0x36')]('nolimit')){_0x4c2b2d[_0x3d4c('0x1c')]=qs[_0x3d4c('0x1c')](_0x1f6dc6[_0x3d4c('0x2f')]['limit']);_0x4c2b2d['offset']=qs[_0x3d4c('0x1b')](_0x1f6dc6['query']['offset']);}_0x4c2b2d[_0x3d4c('0x37')]=qs['sort'](_0x1f6dc6[_0x3d4c('0x2f')][_0x3d4c('0x38')]);_0x4c2b2d[_0x3d4c('0x39')]=qs[_0x3d4c('0x31')](_[_0x3d4c('0x3a')](_0x1f6dc6[_0x3d4c('0x2f')],_0x4cd3fb['filters']),_0x2e8125);if(_0x1f6dc6[_0x3d4c('0x2f')][_0x3d4c('0x3b')]){_0x4c2b2d[_0x3d4c('0x39')]=_[_0x3d4c('0x3c')](_0x4c2b2d['where'],{'$or':_[_0x3d4c('0x2a')](_0x2e8125,function(_0x115bca){if(_0x115bca[_0x3d4c('0x3d')]!==_0x3d4c('0x3e')){var _0x414305={};_0x414305[_0x115bca[_0x3d4c('0x27')]]={'$like':'%'+_0x1f6dc6[_0x3d4c('0x2f')][_0x3d4c('0x3b')]+'%'};return _0x414305;}})});}_0x4c2b2d=_[_0x3d4c('0x3c')]({},_0x4c2b2d,_0x1f6dc6[_0x3d4c('0x3f')]);var _0x18aef6={'where':_0x4c2b2d[_0x3d4c('0x39')]};return db[_0x3d4c('0x2b')][_0x3d4c('0x1d')](_0x18aef6)[_0x3d4c('0x24')](function(_0x2d75e6){_0x4b44f8[_0x3d4c('0x1d')]=_0x2d75e6;if(_0x1f6dc6[_0x3d4c('0x2f')][_0x3d4c('0x40')]){_0x4c2b2d[_0x3d4c('0x41')]=[{'all':!![]}];}return db[_0x3d4c('0x2b')]['findAll'](_0x4c2b2d);})[_0x3d4c('0x24')](function(_0x4cc278){_0x4b44f8[_0x3d4c('0x42')]=_0x4cc278;return _0x4b44f8;})[_0x3d4c('0x24')](respondWithFilteredResult(_0x8c9b04,_0x4c2b2d))[_0x3d4c('0x43')](handleError(_0x8c9b04,null));};exports[_0x3d4c('0x44')]=function(_0x1bca79,_0x2c9cb2){var _0x674269={'raw':!![],'where':{'id':_0x1bca79[_0x3d4c('0x45')]['id']}},_0x4273a5={};_0x4273a5[_0x3d4c('0x2e')]=_['keys'](db[_0x3d4c('0x2b')]['rawAttributes']);_0x4273a5['query']=_['keys'](_0x1bca79[_0x3d4c('0x2f')]);_0x4273a5[_0x3d4c('0x31')]=_[_0x3d4c('0x32')](_0x4273a5[_0x3d4c('0x2e')],_0x4273a5[_0x3d4c('0x2f')]);_0x674269[_0x3d4c('0x33')]=_[_0x3d4c('0x32')](_0x4273a5[_0x3d4c('0x2e')],qs['fields'](_0x1bca79[_0x3d4c('0x2f')]['fields']));_0x674269['attributes']=_0x674269[_0x3d4c('0x33')][_0x3d4c('0x35')]?_0x674269['attributes']:_0x4273a5['model'];if(_0x1bca79['query'][_0x3d4c('0x40')]){_0x674269[_0x3d4c('0x41')]=[{'all':!![]}];}_0x674269=_['merge']({},_0x674269,_0x1bca79[_0x3d4c('0x3f')]);return db[_0x3d4c('0x2b')][_0x3d4c('0x46')](_0x674269)[_0x3d4c('0x24')](handleEntityNotFound(_0x2c9cb2,null))['then'](respondWithResult(_0x2c9cb2,null))[_0x3d4c('0x43')](handleError(_0x2c9cb2,null));};exports[_0x3d4c('0x47')]=function(_0x3ce0f4,_0x4a7606){return db[_0x3d4c('0x2b')][_0x3d4c('0x47')](_0x3ce0f4[_0x3d4c('0x48')],{})[_0x3d4c('0x24')](respondWithResult(_0x4a7606,0xc9))[_0x3d4c('0x43')](handleError(_0x4a7606,null));};exports[_0x3d4c('0x22')]=function(_0x300291,_0xcb601d){if(_0x300291[_0x3d4c('0x48')]['id']){delete _0x300291[_0x3d4c('0x48')]['id'];}return db[_0x3d4c('0x2b')][_0x3d4c('0x46')]({'where':{'id':_0x300291[_0x3d4c('0x45')]['id']}})[_0x3d4c('0x24')](handleEntityNotFound(_0xcb601d,null))[_0x3d4c('0x24')](saveUpdates(_0x300291[_0x3d4c('0x48')],null))['then'](respondWithResult(_0xcb601d,null))[_0x3d4c('0x43')](handleError(_0xcb601d,null));};exports['destroy']=function(_0x5837aa,_0x3cf399){return db[_0x3d4c('0x2b')][_0x3d4c('0x46')]({'where':{'id':_0x5837aa[_0x3d4c('0x45')]['id']}})['then'](handleEntityNotFound(_0x3cf399,null))['then'](removeEntity(_0x3cf399,null))[_0x3d4c('0x43')](handleError(_0x3cf399,null));}; \ No newline at end of file +var _0x6209=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','keys','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x58bd59,_0x5dca02){var _0x4a6eeb=function(_0x10e9df){while(--_0x10e9df){_0x58bd59['push'](_0x58bd59['shift']());}};_0x4a6eeb(++_0x5dca02);}(_0x6209,0x1b6));var _0x9620=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6209[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require(_0x9620('0x0'));var rimraf=require(_0x9620('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9620('0x2'));var rp=require('request-promise');var moment=require(_0x9620('0x3'));var BPromise=require(_0x9620('0x4'));var Mustache=require(_0x9620('0x5'));var util=require(_0x9620('0x6'));var path=require(_0x9620('0x7'));var sox=require(_0x9620('0x8'));var csv=require(_0x9620('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9620('0xa'));var _=require(_0x9620('0xb'));var squel=require(_0x9620('0xc'));var crypto=require(_0x9620('0xd'));var jsforce=require(_0x9620('0xe'));var deskjs=require(_0x9620('0xf'));var toCsv=require(_0x9620('0x9'));var querystring=require(_0x9620('0x10'));var Papa=require('papaparse');var Redis=require(_0x9620('0x11'));var authService=require(_0x9620('0x12'));var qs=require(_0x9620('0x13'));var as=require(_0x9620('0x14'));var hardwareService=require(_0x9620('0x15'));var logger=require(_0x9620('0x16'))('api');var utils=require(_0x9620('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9620('0x18'));var db=require(_0x9620('0x19'))['db'];function respondWithStatusCode(_0x37dbc9,_0x4144b8){_0x4144b8=_0x4144b8||0xcc;return function(_0x2db506){if(_0x2db506){return _0x37dbc9['sendStatus'](_0x4144b8);}return _0x37dbc9[_0x9620('0x1a')](_0x4144b8)[_0x9620('0x1b')]();};}function respondWithResult(_0x487ef0,_0xea3f4b){_0xea3f4b=_0xea3f4b||0xc8;return function(_0x5c3d73){if(_0x5c3d73){return _0x487ef0[_0x9620('0x1a')](_0xea3f4b)[_0x9620('0x1c')](_0x5c3d73);}};}function respondWithFilteredResult(_0x5e78e5,_0x504a7b){return function(_0x4b08b0){if(_0x4b08b0){var _0x24a222=typeof _0x504a7b[_0x9620('0x1d')]===_0x9620('0x1e')&&typeof _0x504a7b[_0x9620('0x1f')]===_0x9620('0x1e');var _0x6b85af=_0x4b08b0['count'];var _0x1d176c=_0x24a222?0x0:_0x504a7b[_0x9620('0x1d')];var _0x4f5781=_0x24a222?_0x4b08b0[_0x9620('0x20')]:_0x504a7b[_0x9620('0x1d')]+_0x504a7b[_0x9620('0x1f')];var _0x5d642;if(_0x4f5781>=_0x6b85af){_0x4f5781=_0x6b85af;_0x5d642=0xc8;}else{_0x5d642=0xce;}_0x5e78e5[_0x9620('0x1a')](_0x5d642);return _0x5e78e5[_0x9620('0x21')](_0x9620('0x22'),_0x1d176c+'-'+_0x4f5781+'/'+_0x6b85af)[_0x9620('0x1c')](_0x4b08b0);}return null;};}function patchUpdates(_0x5cff5d){return function(_0xeb1bbc){try{jsonpatch[_0x9620('0x23')](_0xeb1bbc,_0x5cff5d,!![]);}catch(_0x1a27d4){return BPromise[_0x9620('0x24')](_0x1a27d4);}return _0xeb1bbc[_0x9620('0x25')]();};}function saveUpdates(_0x39a4f2,_0x48fb65){return function(_0x45c253){if(_0x45c253){return _0x45c253[_0x9620('0x26')](_0x39a4f2)[_0x9620('0x27')](function(_0x4ddef5){return _0x4ddef5;});}return null;};}function removeEntity(_0xccf1cc,_0x36582f){return function(_0x1811c4){if(_0x1811c4){return _0x1811c4[_0x9620('0x28')]()[_0x9620('0x27')](function(){_0xccf1cc[_0x9620('0x1a')](0xcc)[_0x9620('0x1b')]();});}};}function handleEntityNotFound(_0x26b400,_0xf1579c){return function(_0x2dae6f){if(!_0x2dae6f){_0x26b400['sendStatus'](0x194);}return _0x2dae6f;};}function handleError(_0x318342,_0x181b0f){_0x181b0f=_0x181b0f||0x1f4;return function(_0x35f01c){logger['error'](_0x35f01c[_0x9620('0x29')]);if(_0x35f01c[_0x9620('0x2a')]){delete _0x35f01c['name'];}_0x318342[_0x9620('0x1a')](_0x181b0f)[_0x9620('0x2b')](_0x35f01c);};}exports[_0x9620('0x2c')]=function(_0x506d4f,_0x29a957){var _0x3f442b={},_0x4c950e={},_0x270179={'count':0x0,'rows':[]};var _0x50858f=_[_0x9620('0x2d')](db[_0x9620('0x2e')][_0x9620('0x2f')],function(_0x566c57){return{'name':_0x566c57[_0x9620('0x30')],'type':_0x566c57[_0x9620('0x31')]['key']};});_0x4c950e['model']=_[_0x9620('0x2d')](_0x50858f,_0x9620('0x2a'));_0x4c950e['query']=_[_0x9620('0x32')](_0x506d4f['query']);_0x4c950e['filters']=_['intersection'](_0x4c950e[_0x9620('0x33')],_0x4c950e[_0x9620('0x34')]);_0x3f442b[_0x9620('0x35')]=_[_0x9620('0x36')](_0x4c950e[_0x9620('0x33')],qs['fields'](_0x506d4f[_0x9620('0x34')][_0x9620('0x37')]));_0x3f442b[_0x9620('0x35')]=_0x3f442b[_0x9620('0x35')][_0x9620('0x38')]?_0x3f442b[_0x9620('0x35')]:_0x4c950e['model'];if(!_0x506d4f[_0x9620('0x34')][_0x9620('0x39')](_0x9620('0x3a'))){_0x3f442b[_0x9620('0x1f')]=qs[_0x9620('0x1f')](_0x506d4f[_0x9620('0x34')][_0x9620('0x1f')]);_0x3f442b[_0x9620('0x1d')]=qs[_0x9620('0x1d')](_0x506d4f[_0x9620('0x34')][_0x9620('0x1d')]);}_0x3f442b[_0x9620('0x3b')]=qs['sort'](_0x506d4f[_0x9620('0x34')]['sort']);_0x3f442b['where']=qs[_0x9620('0x3c')](_[_0x9620('0x3d')](_0x506d4f[_0x9620('0x34')],_0x4c950e[_0x9620('0x3c')]),_0x50858f);if(_0x506d4f[_0x9620('0x34')][_0x9620('0x3e')]){_0x3f442b[_0x9620('0x3f')]=_[_0x9620('0x40')](_0x3f442b['where'],{'$or':_['map'](_0x50858f,function(_0x1b885a){if(_0x1b885a[_0x9620('0x31')]!==_0x9620('0x41')){var _0x1894e4={};_0x1894e4[_0x1b885a['name']]={'$like':'%'+_0x506d4f[_0x9620('0x34')]['filter']+'%'};return _0x1894e4;}})});}_0x3f442b=_['merge']({},_0x3f442b,_0x506d4f['options']);var _0x261f25={'where':_0x3f442b[_0x9620('0x3f')]};return db[_0x9620('0x2e')]['count'](_0x261f25)[_0x9620('0x27')](function(_0xe0d724){_0x270179['count']=_0xe0d724;if(_0x506d4f['query']['includeAll']){_0x3f442b[_0x9620('0x42')]=[{'all':!![]}];}return db[_0x9620('0x2e')][_0x9620('0x43')](_0x3f442b);})['then'](function(_0x2d904b){_0x270179[_0x9620('0x44')]=_0x2d904b;return _0x270179;})['then'](respondWithFilteredResult(_0x29a957,_0x3f442b))[_0x9620('0x45')](handleError(_0x29a957,null));};exports[_0x9620('0x46')]=function(_0x1c027b,_0x21e4ae){var _0x2159ef={'raw':!![],'where':{'id':_0x1c027b[_0x9620('0x47')]['id']}},_0x539897={};_0x539897[_0x9620('0x33')]=_['keys'](db[_0x9620('0x2e')][_0x9620('0x2f')]);_0x539897['query']=_[_0x9620('0x32')](_0x1c027b[_0x9620('0x34')]);_0x539897['filters']=_[_0x9620('0x36')](_0x539897[_0x9620('0x33')],_0x539897['query']);_0x2159ef[_0x9620('0x35')]=_[_0x9620('0x36')](_0x539897['model'],qs[_0x9620('0x37')](_0x1c027b['query'][_0x9620('0x37')]));_0x2159ef[_0x9620('0x35')]=_0x2159ef[_0x9620('0x35')][_0x9620('0x38')]?_0x2159ef[_0x9620('0x35')]:_0x539897[_0x9620('0x33')];if(_0x1c027b[_0x9620('0x34')][_0x9620('0x48')]){_0x2159ef[_0x9620('0x42')]=[{'all':!![]}];}_0x2159ef=_[_0x9620('0x40')]({},_0x2159ef,_0x1c027b['options']);return db[_0x9620('0x2e')][_0x9620('0x49')](_0x2159ef)[_0x9620('0x27')](handleEntityNotFound(_0x21e4ae,null))[_0x9620('0x27')](respondWithResult(_0x21e4ae,null))[_0x9620('0x45')](handleError(_0x21e4ae,null));};exports[_0x9620('0x4a')]=function(_0x420faf,_0x3b86dd){return db[_0x9620('0x2e')]['create'](_0x420faf['body'],{})[_0x9620('0x27')](respondWithResult(_0x3b86dd,0xc9))[_0x9620('0x45')](handleError(_0x3b86dd,null));};exports[_0x9620('0x26')]=function(_0x5e94b5,_0x33a56d){if(_0x5e94b5[_0x9620('0x4b')]['id']){delete _0x5e94b5[_0x9620('0x4b')]['id'];}return db[_0x9620('0x2e')][_0x9620('0x49')]({'where':{'id':_0x5e94b5[_0x9620('0x47')]['id']}})[_0x9620('0x27')](handleEntityNotFound(_0x33a56d,null))['then'](saveUpdates(_0x5e94b5[_0x9620('0x4b')],null))['then'](respondWithResult(_0x33a56d,null))[_0x9620('0x45')](handleError(_0x33a56d,null));};exports[_0x9620('0x28')]=function(_0x37c620,_0x5712c7){return db[_0x9620('0x2e')][_0x9620('0x49')]({'where':{'id':_0x37c620['params']['id']}})['then'](handleEntityNotFound(_0x5712c7,null))[_0x9620('0x27')](removeEntity(_0x5712c7,null))[_0x9620('0x45')](handleError(_0x5712c7,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 331a5f8..fb0da33 100644 --- a/server/api/smsApplication/smsApplication.model.js +++ b/server/api/smsApplication/smsApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x460a=['path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5223c2,_0xe0d88f){var _0x10f398=function(_0x15e4ae){while(--_0x15e4ae){_0x5223c2['push'](_0x5223c2['shift']());}};_0x10f398(++_0xe0d88f);}(_0x460a,0x69));var _0xa460=function(_0x488ca1,_0xf6858e){_0x488ca1=_0x488ca1-0x0;var _0x4dd0a4=_0x460a[_0x488ca1];return _0x4dd0a4;};'use strict';var _=require(_0xa460('0x0'));var util=require(_0xa460('0x1'));var logger=require(_0xa460('0x2'))(_0xa460('0x3'));var moment=require(_0xa460('0x4'));var BPromise=require(_0xa460('0x5'));var rp=require(_0xa460('0x6'));var fs=require('fs');var path=require(_0xa460('0x7'));var rimraf=require(_0xa460('0x8'));var config=require(_0xa460('0x9'));var attributes=require(_0xa460('0xa'));module[_0xa460('0xb')]=function(_0x14dea3,_0x5d901d){return _0x14dea3[_0xa460('0xc')](_0xa460('0xd'),attributes,{'tableName':_0xa460('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa460('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc95c=['./smsApplication.attributes','exports','define','SmsApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1d5c5f,_0x5efc79){var _0x258f02=function(_0x438167){while(--_0x438167){_0x1d5c5f['push'](_0x1d5c5f['shift']());}};_0x258f02(++_0x5efc79);}(_0xc95c,0x130));var _0xcc95=function(_0x5d3768,_0x162a40){_0x5d3768=_0x5d3768-0x0;var _0x190fbc=_0xc95c[_0x5d3768];return _0x190fbc;};'use strict';var _=require(_0xcc95('0x0'));var util=require(_0xcc95('0x1'));var logger=require(_0xcc95('0x2'))(_0xcc95('0x3'));var moment=require(_0xcc95('0x4'));var BPromise=require(_0xcc95('0x5'));var rp=require(_0xcc95('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc95('0x7'));var config=require('../../config/environment');var attributes=require(_0xcc95('0x8'));module[_0xcc95('0x9')]=function(_0x4eccb6,_0x5a3f89){return _0x4eccb6[_0xcc95('0xa')](_0xcc95('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcc95('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index d7f0ccb..aa9a075 100644 --- a/server/api/smsApplication/smsApplication.rpc.js +++ b/server/api/smsApplication/smsApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf562=['../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','message','SmsApplication,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5a80ad,_0x5c6362){var _0x7e7563=function(_0x7a5719){while(--_0x7a5719){_0x5a80ad['push'](_0x5a80ad['shift']());}};_0x7e7563(++_0x5c6362);}(_0xf562,0x100));var _0x2f56=function(_0x21d9eb,_0x28ef11){_0x21d9eb=_0x21d9eb-0x0;var _0x3234f5=_0xf562[_0x21d9eb];return _0x3234f5;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var moment=require(_0x2f56('0x2'));var BPromise=require(_0x2f56('0x3'));var rs=require(_0x2f56('0x4'));var fs=require('fs');var Redis=require(_0x2f56('0x5'));var db=require(_0x2f56('0x6'))['db'];var utils=require(_0x2f56('0x7'));var logger=require(_0x2f56('0x8'))('rpc');var config=require(_0x2f56('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2f56('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fd9d8,_0x3c4002,_0x25f51a){return new BPromise(function(_0x1add20,_0x46799e){return client[_0x2f56('0xb')](_0x1fd9d8,_0x25f51a)[_0x2f56('0xc')](function(_0x2d549e){logger[_0x2f56('0xd')]('SmsApplication,\x20%s,\x20%s',_0x3c4002,_0x2f56('0xe'));logger[_0x2f56('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x3c4002,_0x2f56('0xe'),JSON[_0x2f56('0x10')](_0x2d549e));if(_0x2d549e['error']){if(_0x2d549e[_0x2f56('0x11')]['code']===0x1f4){logger[_0x2f56('0x11')]('SmsApplication,\x20%s,\x20%s',_0x3c4002,_0x2d549e[_0x2f56('0x11')][_0x2f56('0x12')]);return _0x46799e(_0x2d549e[_0x2f56('0x11')][_0x2f56('0x12')]);}logger[_0x2f56('0x11')](_0x2f56('0x13'),_0x3c4002,_0x2d549e[_0x2f56('0x11')][_0x2f56('0x12')]);return _0x1add20(_0x2d549e['error'][_0x2f56('0x12')]);}else{logger[_0x2f56('0xd')](_0x2f56('0x13'),_0x3c4002,_0x2f56('0xe'));_0x1add20(_0x2d549e[_0x2f56('0x14')]['message']);}})[_0x2f56('0x15')](function(_0x144edd){logger[_0x2f56('0x11')](_0x2f56('0x13'),_0x3c4002,_0x144edd);_0x46799e(_0x144edd);});});} \ No newline at end of file +var _0xd878=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','request','then','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4661b9,_0x1d96a7){var _0x2063f8=function(_0x1aa772){while(--_0x1aa772){_0x4661b9['push'](_0x4661b9['shift']());}};_0x2063f8(++_0x1d96a7);}(_0xd878,0x118));var _0x8d87=function(_0x5706dc,_0x281158){_0x5706dc=_0x5706dc-0x0;var _0x725bc9=_0xd878[_0x5706dc];return _0x725bc9;};'use strict';var _=require(_0x8d87('0x0'));var util=require(_0x8d87('0x1'));var moment=require(_0x8d87('0x2'));var BPromise=require(_0x8d87('0x3'));var rs=require(_0x8d87('0x4'));var fs=require('fs');var Redis=require(_0x8d87('0x5'));var db=require(_0x8d87('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8d87('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8d87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b504e,_0xcb4dae,_0x1eba92){return new BPromise(function(_0x38fded,_0x2c1bd0){return client[_0x8d87('0x9')](_0x1b504e,_0x1eba92)[_0x8d87('0xa')](function(_0xf6aa49){logger['info'](_0x8d87('0xb'),_0xcb4dae,'request\x20sent');logger['debug'](_0x8d87('0xc'),_0xcb4dae,_0x8d87('0xd'),JSON[_0x8d87('0xe')](_0xf6aa49));if(_0xf6aa49[_0x8d87('0xf')]){if(_0xf6aa49[_0x8d87('0xf')][_0x8d87('0x10')]===0x1f4){logger['error'](_0x8d87('0xb'),_0xcb4dae,_0xf6aa49['error'][_0x8d87('0x11')]);return _0x2c1bd0(_0xf6aa49['error'][_0x8d87('0x11')]);}logger[_0x8d87('0xf')](_0x8d87('0xb'),_0xcb4dae,_0xf6aa49['error'][_0x8d87('0x11')]);return _0x38fded(_0xf6aa49[_0x8d87('0xf')][_0x8d87('0x11')]);}else{logger[_0x8d87('0x12')](_0x8d87('0xb'),_0xcb4dae,_0x8d87('0xd'));_0x38fded(_0xf6aa49[_0x8d87('0x13')][_0x8d87('0x11')]);}})[_0x8d87('0x14')](function(_0x520df5){logger[_0x8d87('0xf')](_0x8d87('0xb'),_0xcb4dae,_0x520df5);_0x2c1bd0(_0x520df5);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 1c1eba3..79f76ed 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','/:id/tags','sms','smsinteraction:addtags','addTags','put','/:id','tracked','smsinteraction:update','update','smsinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x507056,_0xe16b72){var _0x4eaecc=function(_0x440b91){while(--_0x440b91){_0x507056['push'](_0x507056['shift']());}};_0x4eaecc(++_0xe16b72);}(_0x2032,0xd9));var _0x2203=function(_0xcfbad,_0x182f6f){_0xcfbad=_0xcfbad-0x0;var _0xccb7f7=_0x2032[_0xcfbad];return _0xccb7f7;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x2203('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2203('0x14'),_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0x18'),auth[_0x2203('0x9')](),interaction[_0x2203('0x19')](_0x2203('0x14'),_0x2203('0x1a')),controller[_0x2203('0x1b')]);router['delete'](_0x2203('0x18'),auth[_0x2203('0x9')](),interaction['tracked'](_0x2203('0x14'),_0x2203('0x1c')),controller['destroy']);router[_0x2203('0x1d')]('/:id/tags',auth[_0x2203('0x9')](),controller[_0x2203('0x1e')]);module[_0x2203('0x1f')]=router; \ No newline at end of file +var _0xf7b4=['/describe','describe','/:id','show','getMessages','/:id/download','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index'];(function(_0xa6939f,_0x20054f){var _0x3c39ba=function(_0x1fa0bf){while(--_0x1fa0bf){_0xa6939f['push'](_0xa6939f['shift']());}};_0x3c39ba(++_0x20054f);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1c8317,_0x10ba0e){_0x1c8317=_0x1c8317-0x0;var _0x58c0ac=_0xf7b4[_0x1c8317];return _0x58c0ac;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0x7')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0x7')]('/:id/messages',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0x7')](_0x4f7b('0xf'),auth[_0x4f7b('0x8')](),controller['download']);router[_0x4f7b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f7b('0x10')](_0x4f7b('0x11'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x12')]);router['post'](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x16')),controller[_0x4f7b('0x17')]);router[_0x4f7b('0x18')](_0x4f7b('0xc'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x19')),controller['update']);router[_0x4f7b('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),'smsinteraction:destroy'),controller[_0x4f7b('0x1b')]);router[_0x4f7b('0x1a')](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),controller['removeTags']);module[_0x4f7b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 1e4a469..4b62368 100644 --- a/server/api/smsInteraction/smsInteraction.attributes.js +++ b/server/api/smsInteraction/smsInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadf0=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2e334b,_0x426b6e){var _0x390570=function(_0x46a2a5){while(--_0x46a2a5){_0x2e334b['push'](_0x2e334b['shift']());}};_0x390570(++_0x426b6e);}(_0xadf0,0x12d));var _0x0adf=function(_0x16dd9b,_0x1feeff){_0x16dd9b=_0x16dd9b-0x0;var _0x5d0d74=_0xadf0[_0x16dd9b];return _0x5d0d74;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0adf('0x0'));module[_0x0adf('0x1')]={'closed':{'type':Sequelize[_0x0adf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0adf('0x3')]},'disposition':{'type':Sequelize[_0x0adf('0x4')]},'secondDisposition':{'type':Sequelize[_0x0adf('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0adf('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0adf('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0adf('0x5')]('in',_0x0adf('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0c42=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x2a15e6,_0xc937e5){var _0x16fec3=function(_0x2dce22){while(--_0x2dce22){_0x2a15e6['push'](_0x2a15e6['shift']());}};_0x16fec3(++_0xc937e5);}(_0x0c42,0x191));var _0x20c4=function(_0x519f6f,_0x1af590){_0x519f6f=_0x519f6f-0x0;var _0x495c3e=_0x0c42[_0x519f6f];return _0x495c3e;};'use strict';var Sequelize=require(_0x20c4('0x0'));var moment=require(_0x20c4('0x1'));module[_0x20c4('0x2')]={'closed':{'type':Sequelize[_0x20c4('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x20c4('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x20c4('0x5')]},'note':{'type':Sequelize[_0x20c4('0x5')]},'phone':{'type':Sequelize[_0x20c4('0x5')]},'read1stAt':{'type':Sequelize[_0x20c4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x20c4('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x20c4('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x20c4('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 954986f..81bd1b3 100644 --- a/server/api/smsInteraction/smsInteraction.controller.js +++ b/server/api/smsInteraction/smsInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd011=['length','includeAll','include','options','find','catch','create','body','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','nolimit','order','sort','where','filters','pick','SmsInteractionId','merge','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','push','User','Contact','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','Owner','fullname','get','mkdirSync','Sms','N.A.','closed','closedAt','disposition','out','System','firstName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','index','SmsInteraction','rawAttributes','fieldName','key','getOptions','sms','query','user','params','model','keys','intersection','attributes','fields'];(function(_0x280a2e,_0x244c6f){var _0x286f67=function(_0xe4620b){while(--_0xe4620b){_0x280a2e['push'](_0x280a2e['shift']());}};_0x286f67(++_0x244c6f);}(_0xd011,0xc6));var _0x1d01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd011[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x1d01('0x0'));var zipdir=require(_0x1d01('0x1'));var moment=require('moment');var BPromise=require(_0x1d01('0x2'));var util=require(_0x1d01('0x3'));var path=require(_0x1d01('0x4'));var ejs=require(_0x1d01('0x5'));var fs=require('fs');var _=require(_0x1d01('0x6'));var Redis=require(_0x1d01('0x7'));var interaction=require(_0x1d01('0x8'));var qs=require(_0x1d01('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x1d01('0xa'));var config=require(_0x1d01('0xb'));var db=require(_0x1d01('0xc'))['db'];config[_0x1d01('0xd')]=_['defaults'](config[_0x1d01('0xd')],{'host':_0x1d01('0xe'),'port':0x18eb});var socket=require(_0x1d01('0xf'))(new Redis(config[_0x1d01('0xd')]));require(_0x1d01('0x10'))[_0x1d01('0x11')](socket);function respondWithStatusCode(_0x493d6e,_0x49dfd1){_0x49dfd1=_0x49dfd1||0xcc;return function(_0xcb59a4){if(_0xcb59a4){return _0x493d6e[_0x1d01('0x12')](_0x49dfd1);}return _0x493d6e[_0x1d01('0x13')](_0x49dfd1)[_0x1d01('0x14')]();};}function respondWithResult(_0x3a9028,_0x213cff){_0x213cff=_0x213cff||0xc8;return function(_0x28abda){if(_0x28abda){return _0x3a9028[_0x1d01('0x13')](_0x213cff)[_0x1d01('0x15')](_0x28abda);}};}function respondWithFilteredResult(_0x81105a,_0x8ff01e){return function(_0x4bef03){if(_0x4bef03){var _0x328560=typeof _0x8ff01e[_0x1d01('0x16')]===_0x1d01('0x17')&&typeof _0x8ff01e[_0x1d01('0x18')]===_0x1d01('0x17');var _0x4039ae=_0x4bef03['count'];var _0x170154=_0x328560?0x0:_0x8ff01e[_0x1d01('0x16')];var _0x4d5fda=_0x328560?_0x4bef03[_0x1d01('0x19')]:_0x8ff01e[_0x1d01('0x16')]+_0x8ff01e[_0x1d01('0x18')];var _0x404084;if(_0x4d5fda>=_0x4039ae){_0x4d5fda=_0x4039ae;_0x404084=0xc8;}else{_0x404084=0xce;}_0x81105a['status'](_0x404084);return _0x81105a[_0x1d01('0x1a')](_0x1d01('0x1b'),_0x170154+'-'+_0x4d5fda+'/'+_0x4039ae)[_0x1d01('0x15')](_0x4bef03);}return null;};}function saveUpdates(_0x17ca66){return function(_0x29763d){if(_0x29763d){return _0x29763d[_0x1d01('0x1c')](_0x17ca66)['then'](function(_0x5dca3f){return _0x5dca3f;});}return null;};}function removeEntity(_0x262649){return function(_0x58c3ea){if(_0x58c3ea){return _0x58c3ea[_0x1d01('0x1d')]()[_0x1d01('0x1e')](function(){_0x262649[_0x1d01('0x13')](0xcc)[_0x1d01('0x14')]();});}};}function handleEntityNotFound(_0x42fc05){return function(_0x269baf){if(!_0x269baf){_0x42fc05[_0x1d01('0x12')](0x194);}return _0x269baf;};}function handleError(_0x571cbf,_0x32e65f){_0x32e65f=_0x32e65f||0x1f4;return function(_0x529bb0){logger[_0x1d01('0x1f')](_0x529bb0[_0x1d01('0x20')]);if(_0x529bb0[_0x1d01('0x21')]){delete _0x529bb0[_0x1d01('0x21')];}_0x571cbf['status'](_0x32e65f)[_0x1d01('0x22')](_0x529bb0);};}exports[_0x1d01('0x23')]=function(_0x570215,_0x2d23a3){var _0x33f15c={};var _0x1ff9f3=_['map'](db[_0x1d01('0x24')][_0x1d01('0x25')],function(_0xa8c63b){return{'name':_0xa8c63b[_0x1d01('0x26')],'type':_0xa8c63b['type'][_0x1d01('0x27')]};});_0x33f15c=qs[_0x1d01('0x28')](_0x1ff9f3,_0x570215);return interaction['findAll'](_0x1d01('0x29'),_0x570215[_0x1d01('0x2a')],_0x570215[_0x1d01('0x2b')],_0x33f15c,_0x1ff9f3)[_0x1d01('0x1e')](respondWithFilteredResult(_0x2d23a3,_0x33f15c))['catch'](handleError(_0x2d23a3,null));};exports['show']=function(_0x4cf52a,_0x530c00){var _0x3bc4a0={'raw':![],'where':{'id':_0x4cf52a[_0x1d01('0x2c')]['id']}},_0xc8f743={};_0xc8f743[_0x1d01('0x2d')]=_[_0x1d01('0x2e')](db['SmsInteraction'][_0x1d01('0x25')]);_0xc8f743[_0x1d01('0x2a')]=_[_0x1d01('0x2e')](_0x4cf52a[_0x1d01('0x2a')]);_0xc8f743['filters']=_[_0x1d01('0x2f')](_0xc8f743[_0x1d01('0x2d')],_0xc8f743['query']);_0x3bc4a0[_0x1d01('0x30')]=_[_0x1d01('0x2f')](_0xc8f743[_0x1d01('0x2d')],qs[_0x1d01('0x31')](_0x4cf52a[_0x1d01('0x2a')]['fields']));_0x3bc4a0[_0x1d01('0x30')]=_0x3bc4a0[_0x1d01('0x30')][_0x1d01('0x32')]?_0x3bc4a0[_0x1d01('0x30')]:_0xc8f743['model'];if(_0x4cf52a[_0x1d01('0x2a')][_0x1d01('0x33')]){_0x3bc4a0[_0x1d01('0x34')]=[{'all':!![]}];}_0x3bc4a0=_['merge']({},_0x3bc4a0,_0x4cf52a[_0x1d01('0x35')]);return db[_0x1d01('0x24')][_0x1d01('0x36')](_0x3bc4a0)[_0x1d01('0x1e')](handleEntityNotFound(_0x530c00,null))['then'](respondWithResult(_0x530c00,null))[_0x1d01('0x37')](handleError(_0x530c00,null));};exports[_0x1d01('0x38')]=function(_0x263755,_0x5c8334){return db[_0x1d01('0x24')][_0x1d01('0x38')](_0x263755[_0x1d01('0x39')],{})[_0x1d01('0x1e')](respondWithResult(_0x5c8334,0xc9))[_0x1d01('0x37')](handleError(_0x5c8334,null));};exports[_0x1d01('0x1c')]=function(_0x259a3c,_0x3163a7){if(_0x259a3c[_0x1d01('0x39')]['id']){delete _0x259a3c[_0x1d01('0x39')]['id'];}return db[_0x1d01('0x24')][_0x1d01('0x36')]({'where':{'id':_0x259a3c[_0x1d01('0x2c')]['id']}})[_0x1d01('0x1e')](handleEntityNotFound(_0x3163a7,null))['then'](saveUpdates(_0x259a3c[_0x1d01('0x39')],null))[_0x1d01('0x1e')](respondWithResult(_0x3163a7,null))[_0x1d01('0x37')](handleError(_0x3163a7,null));};exports[_0x1d01('0x1d')]=function(_0x3534ba,_0x10cddf){return db[_0x1d01('0x24')]['find']({'where':{'id':_0x3534ba[_0x1d01('0x2c')]['id']}})[_0x1d01('0x1e')](handleEntityNotFound(_0x10cddf,null))[_0x1d01('0x1e')](removeEntity(_0x10cddf,null))[_0x1d01('0x37')](handleError(_0x10cddf,null));};exports[_0x1d01('0x3a')]=function(_0x266c33,_0x2e0837){return db[_0x1d01('0x24')][_0x1d01('0x3a')]()[_0x1d01('0x1e')](respondWithResult(_0x2e0837,null))[_0x1d01('0x37')](handleError(_0x2e0837,null));};exports['addMessage']=function(_0x87a04b,_0x19ba00){return db[_0x1d01('0x3b')][_0x1d01('0x36')]({'where':{'id':_0x87a04b[_0x1d01('0x2c')]['id']}})[_0x1d01('0x1e')](handleEntityNotFound(_0x19ba00,null))[_0x1d01('0x1e')](function(_0x2d5322){if(_0x2d5322){return _0x2d5322[_0x1d01('0x3c')](_0x87a04b['body'][_0x1d01('0x3d')],_[_0x1d01('0x3e')](_0x87a04b[_0x1d01('0x39')],['ids','id'])||{});}})[_0x1d01('0x1e')](respondWithResult(_0x19ba00,null))[_0x1d01('0x37')](handleError(_0x19ba00,null));};exports[_0x1d01('0x3f')]=function(_0x221d22,_0x4ab09b){var _0x13073b={'raw':![],'where':{}};var _0x439a1c={};var _0x3545e4={'count':0x0,'rows':[]};return db[_0x1d01('0x24')][_0x1d01('0x40')]({'where':{'id':_0x221d22['params']['id']}})[_0x1d01('0x1e')](handleEntityNotFound(_0x4ab09b,null))[_0x1d01('0x1e')](function(_0xd4405a){if(_0xd4405a){_0x439a1c[_0x1d01('0x2d')]=_[_0x1d01('0x2e')](db[_0x1d01('0x3b')][_0x1d01('0x25')]);_0x439a1c[_0x1d01('0x2a')]=_[_0x1d01('0x2e')](_0x221d22[_0x1d01('0x2a')]);_0x439a1c['filters']=_['intersection'](_0x439a1c[_0x1d01('0x2d')],_0x439a1c['query']);_0x13073b[_0x1d01('0x30')]=_[_0x1d01('0x2f')](_0x439a1c['model'],qs[_0x1d01('0x31')](_0x221d22[_0x1d01('0x2a')][_0x1d01('0x31')]));_0x13073b['attributes']=_0x13073b[_0x1d01('0x30')][_0x1d01('0x32')]?_0x13073b[_0x1d01('0x30')]:_0x439a1c[_0x1d01('0x2d')];if(!_0x221d22[_0x1d01('0x2a')]['hasOwnProperty'](_0x1d01('0x41'))){_0x13073b[_0x1d01('0x18')]=qs[_0x1d01('0x18')](_0x221d22['query'][_0x1d01('0x18')]);_0x13073b[_0x1d01('0x16')]=qs[_0x1d01('0x16')](_0x221d22[_0x1d01('0x2a')][_0x1d01('0x16')]);}_0x13073b[_0x1d01('0x42')]=qs[_0x1d01('0x43')](_0x221d22[_0x1d01('0x2a')][_0x1d01('0x43')]);_0x13073b[_0x1d01('0x44')]=qs[_0x1d01('0x45')](_[_0x1d01('0x46')](_0x221d22['query'],_0x439a1c[_0x1d01('0x45')]));_0x13073b[_0x1d01('0x44')][_0x1d01('0x47')]=_0xd4405a['id'];if(_0x221d22[_0x1d01('0x2a')]['filter']){_0x13073b['where']=_[_0x1d01('0x48')](_0x13073b['where'],{'$or':_[_0x1d01('0x49')](_0x13073b[_0x1d01('0x30')],function(_0x4c9bdd){var _0x448391={};_0x448391[_0x4c9bdd]={'$like':'%'+_0x221d22[_0x1d01('0x2a')][_0x1d01('0x4a')]+'%'};return _0x448391;})});}if(_0x221d22[_0x1d01('0x2a')][_0x1d01('0x4b')]){var _0x339244=_0x221d22[_0x1d01('0x2a')][_0x1d01('0x4b')][_0x1d01('0x4c')](',');var _0x540f13={};_0x540f13[_0x339244[0x0]]={'$gte':moment(_0x339244[0x1])[_0x1d01('0x4d')](_0x1d01('0x4e'))};_0x13073b['where']=_[_0x1d01('0x48')](_0x13073b[_0x1d01('0x44')],_0x540f13);}_0x13073b=_['merge']({},_0x13073b,_0x221d22[_0x1d01('0x35')]);return db['SmsMessage'][_0x1d01('0x19')]({'where':_0x13073b[_0x1d01('0x44')]})['then'](function(_0x5c68cb){_0x3545e4[_0x1d01('0x19')]=_0x5c68cb;if(_0x221d22[_0x1d01('0x2a')][_0x1d01('0x33')]){_0x13073b['include']=[{'all':!![]}];}return db['SmsMessage'][_0x1d01('0x4f')](_0x13073b);})[_0x1d01('0x1e')](function(_0x38d326){_0x3545e4['rows']=_0x38d326;return _0x3545e4;});}})[_0x1d01('0x1e')](respondWithFilteredResult(_0x4ab09b,_0x13073b))[_0x1d01('0x37')](handleError(_0x4ab09b,null));};exports[_0x1d01('0x50')]=function(_0x590713,_0x1b57c0){return db['SmsInteraction']['find']({'where':{'id':_0x590713[_0x1d01('0x2c')]['id']}})[_0x1d01('0x1e')](handleEntityNotFound(_0x1b57c0,null))[_0x1d01('0x1e')](function(_0x790aa1){if(_0x790aa1){return _0x790aa1[_0x1d01('0x51')](_0x590713[_0x1d01('0x39')]['ids'],_[_0x1d01('0x3e')](_0x590713['body'],['ids','id'])||{})[_0x1d01('0x52')](function(){return db['Tag'][_0x1d01('0x4f')]({'attributes':['id',_0x1d01('0x21'),_0x1d01('0x53')],'where':{'id':_0x590713[_0x1d01('0x39')][_0x1d01('0x3d')]}});})[_0x1d01('0x1e')](function(_0x45b901){socket[_0x1d01('0x54')]('smsInteractionTags:save',{'id':Number(_0x590713['params']['id']),'tags':_0x45b901||[]});return{'id':Number(_0x590713['params']['id']),'tags':_0x45b901||[]};});}})[_0x1d01('0x1e')](respondWithResult(_0x1b57c0,null))['catch'](handleError(_0x1b57c0,null));};exports[_0x1d01('0x55')]=function(_0x2362d4,_0x2028ed){return db[_0x1d01('0x24')][_0x1d01('0x36')]({'where':{'id':_0x2362d4[_0x1d01('0x2c')]['id']}})[_0x1d01('0x1e')](handleEntityNotFound(_0x2028ed,null))['then'](function(_0x5ba04b){if(_0x5ba04b){return _0x5ba04b[_0x1d01('0x55')](_0x2362d4[_0x1d01('0x2a')]['ids']);}})[_0x1d01('0x1e')](respondWithStatusCode(_0x2028ed,null))[_0x1d01('0x37')](handleError(_0x2028ed,null));};exports[_0x1d01('0x56')]=function(_0x3b6919,_0x3d329c){var _0x20025a=moment()[_0x1d01('0x57')]()[_0x1d01('0x58')]();var _0x3dce18=path[_0x1d01('0x59')](config[_0x1d01('0x5a')],_0x1d01('0x5b'),_0x1d01('0x5c'),_0x1d01('0x5d'));var _0x504f29=path[_0x1d01('0x59')](_0x3dce18,_0x20025a);var _0x39c820=util[_0x1d01('0x4d')]('transcript-%d-%s.zip',_0x3b6919[_0x1d01('0x2c')]['id'],_0x20025a);var _0x128a5a=path[_0x1d01('0x59')](_0x3dce18,_0x39c820);var _0x11be74=[];_0x11be74[_0x1d01('0x5e')]({'model':db[_0x1d01('0x5f')],'as':_0x1d01('0x5f'),'attributes':['id','fullname'],'raw':!![]});_0x11be74[_0x1d01('0x5e')]({'model':db['CmContact'],'as':_0x1d01('0x60'),'attributes':['id','firstName',_0x1d01('0x61')],'raw':!![]});var _0x4fa065=[{'model':db[_0x1d01('0x3b')],'as':_0x1d01('0x62'),'attributes':['id',_0x1d01('0x39'),_0x1d01('0x63'),_0x1d01('0x64'),_0x1d01('0x65'),_0x1d01('0x66')],'include':_0x11be74}];_0x4fa065[_0x1d01('0x5e')]({'model':db[_0x1d01('0x67')],'as':_0x1d01('0x68'),'attributes':['id',_0x1d01('0x21')]});_0x4fa065[_0x1d01('0x5e')]({'model':db[_0x1d01('0x5f')],'as':_0x1d01('0x69'),'attributes':['id',_0x1d01('0x6a')]});return db[_0x1d01('0x24')][_0x1d01('0x36')]({'where':{'id':_0x3b6919['params']['id']},'include':_0x4fa065})[_0x1d01('0x1e')](handleEntityNotFound(_0x3d329c,null))[_0x1d01('0x1e')](function(_0x455484){if(_0x455484){var _0x4df9a2=_0x455484[_0x1d01('0x6b')]({'plain':!![]});fs[_0x1d01('0x6c')](_0x504f29);var _0x53c7a3={'channel':_0x1d01('0x6d'),'account':_0x4df9a2[_0x1d01('0x68')][_0x1d01('0x21')],'agent':_0x4df9a2[_0x1d01('0x69')]?_0x4df9a2[_0x1d01('0x69')][_0x1d01('0x6a')]:_0x1d01('0x6e'),'createdAt':moment(_0x4df9a2[_0x1d01('0x63')])['format'](_0x1d01('0x4e'))[_0x1d01('0x58')](),'closedAt':_0x4df9a2[_0x1d01('0x6f')]?moment(_0x4df9a2[_0x1d01('0x70')])[_0x1d01('0x4d')](_0x1d01('0x4e'))[_0x1d01('0x58')]():'','disposition':_0x4df9a2[_0x1d01('0x71')],'messages':_(_0x4df9a2['Messages'])[_0x1d01('0x4a')]({'secret':![]})[_0x1d01('0x49')](function(_0x4e5660){return{'date':moment(_0x4e5660[_0x1d01('0x63')])[_0x1d01('0x4d')](_0x1d01('0x4e'))[_0x1d01('0x58')](),'sender':_0x4e5660[_0x1d01('0x64')]===_0x1d01('0x72')?_0x4e5660[_0x1d01('0x5f')]?_0x4e5660['User'][_0x1d01('0x6a')]:_0x1d01('0x73'):_0x4e5660[_0x1d01('0x60')][_0x1d01('0x74')]+(_0x4e5660[_0x1d01('0x60')][_0x1d01('0x61')]?'\x20'+_0x4e5660[_0x1d01('0x60')]['lastName']:''),'body':_0x4e5660[_0x1d01('0x39')],'direction':_0x4e5660['direction']==='out'?'A':'C','secret':_0x4e5660['secret'],'read':_0x4e5660[_0x1d01('0x66')]};})['value']()};return ejs[_0x1d01('0x75')](path[_0x1d01('0x59')](config[_0x1d01('0x5a')],_0x1d01('0x5b'),_0x1d01('0x76'),_0x1d01('0x77')),{'interaction':_0x53c7a3})['then'](function(_0x1ac20d){var _0x6ec91f=path[_0x1d01('0x59')](_0x504f29,'transcript-'+_0x4df9a2['id']+'-'+_0x20025a+_0x1d01('0x78'));var _0x456c80={'path':_0x6ec91f,'channel':_0x1d01('0x6d'),'interactionId':_0x4df9a2['id']};return pdf[_0x1d01('0x79')](_0x1ac20d,_0x456c80);})[_0x1d01('0x1e')](function(){return new BPromise(function(_0x34ce88,_0x2cd5a3){zipdir(_0x504f29,{'saveTo':_0x128a5a},function(_0x2cd37f,_0x1f3a19){if(_0x2cd37f)return _0x2cd5a3(_0x2cd37f);return _0x34ce88(_0x1f3a19);});})[_0x1d01('0x1e')](function(){return new BPromise(function(_0x3487b3,_0x23d633){rimraf(_0x504f29,function(_0x423965){if(_0x423965)_0x23d633(_0x423965);return _0x3487b3();});});})[_0x1d01('0x1e')](function(){return _0x3d329c[_0x1d01('0x56')](_0x128a5a,_0x39c820,function(_0x3f55d1){if(_0x3f55d1){console[_0x1d01('0x7a')]('err',_0x3f55d1);}else{fs[_0x1d01('0x7b')](_0x128a5a);}});});});}else{return _0x3d329c['sendStatus'](0xc8);}})['catch'](handleError(_0x3d329c,null));}; \ No newline at end of file +var _0x18ff=['setTags','omit','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','root','server','tmp','format','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','Messages','createdAt','direction','secret','read','Owner','mkdirSync','Sms','Account','N.A.','closed','disposition','out','System','lastName','value','renderFile','downloadInteraction.ejs','join','log','err','rimraf','moment','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','SmsInteraction','rawAttributes','fieldName','type','getOptions','findAll','sms','user','catch','show','params','model','keys','filters','query','attributes','intersection','fields','length','include','merge','find','create','body','describe','addMessage','SmsMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','rows'];(function(_0x16337a,_0x4789a1){var _0x422365=function(_0x34f039){while(--_0x34f039){_0x16337a['push'](_0x16337a['shift']());}};_0x422365(++_0x4789a1);}(_0x18ff,0x113));var _0xf18f=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x18ff[_0xae7c2f];return _0x5d7001;};'use strict';var rimraf=require(_0xf18f('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf18f('0x1'));var BPromise=require('bluebird');var util=require(_0xf18f('0x2'));var path=require(_0xf18f('0x3'));var ejs=require(_0xf18f('0x4'));var fs=require('fs');var _=require(_0xf18f('0x5'));var Redis=require('ioredis');var interaction=require(_0xf18f('0x6'));var qs=require(_0xf18f('0x7'));var pdf=require(_0xf18f('0x8'));var logger=require(_0xf18f('0x9'))(_0xf18f('0xa'));var config=require(_0xf18f('0xb'));var db=require(_0xf18f('0xc'))['db'];config[_0xf18f('0xd')]=_[_0xf18f('0xe')](config['redis'],{'host':_0xf18f('0xf'),'port':0x18eb});var socket=require(_0xf18f('0x10'))(new Redis(config[_0xf18f('0xd')]));require(_0xf18f('0x11'))[_0xf18f('0x12')](socket);function respondWithStatusCode(_0x2f37e2,_0x592f5f){_0x592f5f=_0x592f5f||0xcc;return function(_0x107354){if(_0x107354){return _0x2f37e2[_0xf18f('0x13')](_0x592f5f);}return _0x2f37e2[_0xf18f('0x14')](_0x592f5f)[_0xf18f('0x15')]();};}function respondWithResult(_0x3f3b07,_0x8a0a1c){_0x8a0a1c=_0x8a0a1c||0xc8;return function(_0x5cbe5c){if(_0x5cbe5c){return _0x3f3b07['status'](_0x8a0a1c)[_0xf18f('0x16')](_0x5cbe5c);}};}function respondWithFilteredResult(_0x1102cd,_0x46135d){return function(_0x59c595){if(_0x59c595){var _0x4c88bc=typeof _0x46135d[_0xf18f('0x17')]===_0xf18f('0x18')&&typeof _0x46135d[_0xf18f('0x19')]===_0xf18f('0x18');var _0x467bbb=_0x59c595[_0xf18f('0x1a')];var _0x3066ab=_0x4c88bc?0x0:_0x46135d[_0xf18f('0x17')];var _0x853cdf=_0x4c88bc?_0x59c595[_0xf18f('0x1a')]:_0x46135d[_0xf18f('0x17')]+_0x46135d[_0xf18f('0x19')];var _0x356934;if(_0x853cdf>=_0x467bbb){_0x853cdf=_0x467bbb;_0x356934=0xc8;}else{_0x356934=0xce;}_0x1102cd[_0xf18f('0x14')](_0x356934);return _0x1102cd[_0xf18f('0x1b')](_0xf18f('0x1c'),_0x3066ab+'-'+_0x853cdf+'/'+_0x467bbb)['json'](_0x59c595);}return null;};}function saveUpdates(_0xa5ede4){return function(_0x412c48){if(_0x412c48){return _0x412c48[_0xf18f('0x1d')](_0xa5ede4)['then'](function(_0x1e304a){return _0x1e304a;});}return null;};}function removeEntity(_0x1afe95){return function(_0x7c2009){if(_0x7c2009){return _0x7c2009[_0xf18f('0x1e')]()[_0xf18f('0x1f')](function(){_0x1afe95[_0xf18f('0x14')](0xcc)[_0xf18f('0x15')]();});}};}function handleEntityNotFound(_0x19db31){return function(_0x269345){if(!_0x269345){_0x19db31[_0xf18f('0x13')](0x194);}return _0x269345;};}function handleError(_0x5ce601,_0x355a3a){_0x355a3a=_0x355a3a||0x1f4;return function(_0x3c1002){logger[_0xf18f('0x20')](_0x3c1002[_0xf18f('0x21')]);if(_0x3c1002[_0xf18f('0x22')]){delete _0x3c1002[_0xf18f('0x22')];}_0x5ce601[_0xf18f('0x14')](_0x355a3a)[_0xf18f('0x23')](_0x3c1002);};}exports['index']=function(_0x26a6f4,_0x403452){var _0x33669b={};var _0x24fd0f=_['map'](db[_0xf18f('0x24')][_0xf18f('0x25')],function(_0x3d6039){return{'name':_0x3d6039[_0xf18f('0x26')],'type':_0x3d6039[_0xf18f('0x27')]['key']};});_0x33669b=qs[_0xf18f('0x28')](_0x24fd0f,_0x26a6f4);return interaction[_0xf18f('0x29')](_0xf18f('0x2a'),_0x26a6f4['query'],_0x26a6f4[_0xf18f('0x2b')],_0x33669b,_0x24fd0f)[_0xf18f('0x1f')](respondWithFilteredResult(_0x403452,_0x33669b))[_0xf18f('0x2c')](handleError(_0x403452,null));};exports[_0xf18f('0x2d')]=function(_0x507945,_0x2dc501){var _0x39db56={'raw':![],'where':{'id':_0x507945[_0xf18f('0x2e')]['id']}},_0x1846b5={};_0x1846b5[_0xf18f('0x2f')]=_[_0xf18f('0x30')](db['SmsInteraction'][_0xf18f('0x25')]);_0x1846b5['query']=_[_0xf18f('0x30')](_0x507945['query']);_0x1846b5[_0xf18f('0x31')]=_['intersection'](_0x1846b5[_0xf18f('0x2f')],_0x1846b5[_0xf18f('0x32')]);_0x39db56[_0xf18f('0x33')]=_[_0xf18f('0x34')](_0x1846b5[_0xf18f('0x2f')],qs[_0xf18f('0x35')](_0x507945[_0xf18f('0x32')][_0xf18f('0x35')]));_0x39db56[_0xf18f('0x33')]=_0x39db56[_0xf18f('0x33')][_0xf18f('0x36')]?_0x39db56[_0xf18f('0x33')]:_0x1846b5[_0xf18f('0x2f')];if(_0x507945[_0xf18f('0x32')]['includeAll']){_0x39db56[_0xf18f('0x37')]=[{'all':!![]}];}_0x39db56=_[_0xf18f('0x38')]({},_0x39db56,_0x507945['options']);return db[_0xf18f('0x24')][_0xf18f('0x39')](_0x39db56)[_0xf18f('0x1f')](handleEntityNotFound(_0x2dc501,null))[_0xf18f('0x1f')](respondWithResult(_0x2dc501,null))['catch'](handleError(_0x2dc501,null));};exports[_0xf18f('0x3a')]=function(_0x37ca27,_0x479600){return db[_0xf18f('0x24')][_0xf18f('0x3a')](_0x37ca27['body'],{})[_0xf18f('0x1f')](respondWithResult(_0x479600,0xc9))[_0xf18f('0x2c')](handleError(_0x479600,null));};exports[_0xf18f('0x1d')]=function(_0x1715b2,_0xff820e){if(_0x1715b2['body']['id']){delete _0x1715b2[_0xf18f('0x3b')]['id'];}return db[_0xf18f('0x24')][_0xf18f('0x39')]({'where':{'id':_0x1715b2[_0xf18f('0x2e')]['id']}})['then'](handleEntityNotFound(_0xff820e,null))[_0xf18f('0x1f')](saveUpdates(_0x1715b2[_0xf18f('0x3b')],null))[_0xf18f('0x1f')](respondWithResult(_0xff820e,null))[_0xf18f('0x2c')](handleError(_0xff820e,null));};exports['destroy']=function(_0x1a946c,_0x4edd9e){return db[_0xf18f('0x24')][_0xf18f('0x39')]({'where':{'id':_0x1a946c['params']['id']}})[_0xf18f('0x1f')](handleEntityNotFound(_0x4edd9e,null))[_0xf18f('0x1f')](removeEntity(_0x4edd9e,null))[_0xf18f('0x2c')](handleError(_0x4edd9e,null));};exports[_0xf18f('0x3c')]=function(_0x4a2374,_0x1a43a3){return db['SmsInteraction']['describe']()[_0xf18f('0x1f')](respondWithResult(_0x1a43a3,null))['catch'](handleError(_0x1a43a3,null));};exports[_0xf18f('0x3d')]=function(_0x246115,_0x3db934){return db[_0xf18f('0x3e')][_0xf18f('0x39')]({'where':{'id':_0x246115[_0xf18f('0x2e')]['id']}})[_0xf18f('0x1f')](handleEntityNotFound(_0x3db934,null))[_0xf18f('0x1f')](function(_0xa808cd){if(_0xa808cd){return _0xa808cd[_0xf18f('0x3d')](_0x246115['body'][_0xf18f('0x3f')],_['omit'](_0x246115[_0xf18f('0x3b')],[_0xf18f('0x3f'),'id'])||{});}})[_0xf18f('0x1f')](respondWithResult(_0x3db934,null))[_0xf18f('0x2c')](handleError(_0x3db934,null));};exports[_0xf18f('0x40')]=function(_0x56b69c,_0x53bb3c){var _0x22cb96={'raw':![],'where':{}};var _0x3b56af={};var _0x145931={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x56b69c[_0xf18f('0x2e')]['id']}})[_0xf18f('0x1f')](handleEntityNotFound(_0x53bb3c,null))['then'](function(_0x14c4f6){if(_0x14c4f6){_0x3b56af['model']=_[_0xf18f('0x30')](db[_0xf18f('0x3e')][_0xf18f('0x25')]);_0x3b56af['query']=_['keys'](_0x56b69c[_0xf18f('0x32')]);_0x3b56af[_0xf18f('0x31')]=_['intersection'](_0x3b56af[_0xf18f('0x2f')],_0x3b56af['query']);_0x22cb96[_0xf18f('0x33')]=_[_0xf18f('0x34')](_0x3b56af['model'],qs[_0xf18f('0x35')](_0x56b69c['query']['fields']));_0x22cb96[_0xf18f('0x33')]=_0x22cb96[_0xf18f('0x33')]['length']?_0x22cb96['attributes']:_0x3b56af[_0xf18f('0x2f')];if(!_0x56b69c['query'][_0xf18f('0x41')](_0xf18f('0x42'))){_0x22cb96['limit']=qs[_0xf18f('0x19')](_0x56b69c[_0xf18f('0x32')][_0xf18f('0x19')]);_0x22cb96[_0xf18f('0x17')]=qs[_0xf18f('0x17')](_0x56b69c[_0xf18f('0x32')][_0xf18f('0x17')]);}_0x22cb96[_0xf18f('0x43')]=qs['sort'](_0x56b69c[_0xf18f('0x32')][_0xf18f('0x44')]);_0x22cb96[_0xf18f('0x45')]=qs['filters'](_[_0xf18f('0x46')](_0x56b69c[_0xf18f('0x32')],_0x3b56af['filters']));_0x22cb96[_0xf18f('0x45')]['SmsInteractionId']=_0x14c4f6['id'];if(_0x56b69c['query']['filter']){_0x22cb96[_0xf18f('0x45')]=_[_0xf18f('0x38')](_0x22cb96[_0xf18f('0x45')],{'$or':_['map'](_0x22cb96[_0xf18f('0x33')],function(_0xda671e){var _0x3dc7c1={};_0x3dc7c1[_0xda671e]={'$like':'%'+_0x56b69c['query'][_0xf18f('0x47')]+'%'};return _0x3dc7c1;})});}if(_0x56b69c[_0xf18f('0x32')]['$gte']){var _0x485ae3=_0x56b69c[_0xf18f('0x32')][_0xf18f('0x48')]['split'](',');var _0x465f40={};_0x465f40[_0x485ae3[0x0]]={'$gte':moment(_0x485ae3[0x1])['format'](_0xf18f('0x49'))};_0x22cb96[_0xf18f('0x45')]=_[_0xf18f('0x38')](_0x22cb96['where'],_0x465f40);}_0x22cb96=_['merge']({},_0x22cb96,_0x56b69c[_0xf18f('0x4a')]);return db[_0xf18f('0x3e')][_0xf18f('0x1a')]({'where':_0x22cb96[_0xf18f('0x45')]})[_0xf18f('0x1f')](function(_0x1ca97c){_0x145931['count']=_0x1ca97c;if(_0x56b69c['query']['includeAll']){_0x22cb96[_0xf18f('0x37')]=[{'all':!![]}];}return db[_0xf18f('0x3e')][_0xf18f('0x29')](_0x22cb96);})[_0xf18f('0x1f')](function(_0x2d7f72){_0x145931[_0xf18f('0x4b')]=_0x2d7f72;return _0x145931;});}})[_0xf18f('0x1f')](respondWithFilteredResult(_0x53bb3c,_0x22cb96))['catch'](handleError(_0x53bb3c,null));};exports['addTags']=function(_0x14ac8a,_0x24945f){return db[_0xf18f('0x24')]['find']({'where':{'id':_0x14ac8a[_0xf18f('0x2e')]['id']}})[_0xf18f('0x1f')](handleEntityNotFound(_0x24945f,null))[_0xf18f('0x1f')](function(_0x53af58){if(_0x53af58){return _0x53af58[_0xf18f('0x4c')](_0x14ac8a[_0xf18f('0x3b')][_0xf18f('0x3f')],_[_0xf18f('0x4d')](_0x14ac8a['body'],[_0xf18f('0x3f'),'id'])||{})[_0xf18f('0x4e')](function(){return db['Tag'][_0xf18f('0x29')]({'attributes':['id','name',_0xf18f('0x4f')],'where':{'id':_0x14ac8a[_0xf18f('0x3b')][_0xf18f('0x3f')]}});})[_0xf18f('0x1f')](function(_0x229202){socket[_0xf18f('0x50')](_0xf18f('0x51'),{'id':Number(_0x14ac8a['params']['id']),'tags':_0x229202||[]});return{'id':Number(_0x14ac8a['params']['id']),'tags':_0x229202||[]};});}})[_0xf18f('0x1f')](respondWithResult(_0x24945f,null))[_0xf18f('0x2c')](handleError(_0x24945f,null));};exports['removeTags']=function(_0x5507cb,_0x22125b){return db[_0xf18f('0x24')][_0xf18f('0x39')]({'where':{'id':_0x5507cb['params']['id']}})[_0xf18f('0x1f')](handleEntityNotFound(_0x22125b,null))[_0xf18f('0x1f')](function(_0x159c13){if(_0x159c13){return _0x159c13[_0xf18f('0x52')](_0x5507cb[_0xf18f('0x32')][_0xf18f('0x3f')]);}})[_0xf18f('0x1f')](respondWithStatusCode(_0x22125b,null))[_0xf18f('0x2c')](handleError(_0x22125b,null));};exports[_0xf18f('0x53')]=function(_0x175789,_0x25e4ef){var _0x256791=moment()[_0xf18f('0x54')]()[_0xf18f('0x55')]();var _0x2af3fd=path['join'](config[_0xf18f('0x56')],_0xf18f('0x57'),'files',_0xf18f('0x58'));var _0x33b5b6=path['join'](_0x2af3fd,_0x256791);var _0x595185=util[_0xf18f('0x59')](_0xf18f('0x5a'),_0x175789[_0xf18f('0x2e')]['id'],_0x256791);var _0x5dd808=path['join'](_0x2af3fd,_0x595185);var _0x5508b8=[];_0x5508b8[_0xf18f('0x5b')]({'model':db[_0xf18f('0x5c')],'as':'User','attributes':['id',_0xf18f('0x5d')],'raw':!![]});_0x5508b8[_0xf18f('0x5b')]({'model':db['CmContact'],'as':_0xf18f('0x5e'),'attributes':['id',_0xf18f('0x5f'),'lastName'],'raw':!![]});var _0x2cd467=[{'model':db[_0xf18f('0x3e')],'as':_0xf18f('0x60'),'attributes':['id','body',_0xf18f('0x61'),_0xf18f('0x62'),_0xf18f('0x63'),_0xf18f('0x64')],'include':_0x5508b8}];_0x2cd467[_0xf18f('0x5b')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xf18f('0x22')]});_0x2cd467['push']({'model':db[_0xf18f('0x5c')],'as':_0xf18f('0x65'),'attributes':['id',_0xf18f('0x5d')]});return db[_0xf18f('0x24')][_0xf18f('0x39')]({'where':{'id':_0x175789[_0xf18f('0x2e')]['id']},'include':_0x2cd467})[_0xf18f('0x1f')](handleEntityNotFound(_0x25e4ef,null))[_0xf18f('0x1f')](function(_0x57501f){if(_0x57501f){var _0x520c29=_0x57501f['get']({'plain':!![]});fs[_0xf18f('0x66')](_0x33b5b6);var _0x4e1b68={'channel':_0xf18f('0x67'),'account':_0x520c29[_0xf18f('0x68')][_0xf18f('0x22')],'agent':_0x520c29[_0xf18f('0x65')]?_0x520c29[_0xf18f('0x65')][_0xf18f('0x5d')]:_0xf18f('0x69'),'createdAt':moment(_0x520c29[_0xf18f('0x61')])[_0xf18f('0x59')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf18f('0x55')](),'closedAt':_0x520c29[_0xf18f('0x6a')]?moment(_0x520c29['closedAt'])[_0xf18f('0x59')](_0xf18f('0x49'))['toString']():'','disposition':_0x520c29[_0xf18f('0x6b')],'messages':_(_0x520c29[_0xf18f('0x60')])[_0xf18f('0x47')]({'secret':![]})['map'](function(_0x240082){return{'date':moment(_0x240082[_0xf18f('0x61')])[_0xf18f('0x59')](_0xf18f('0x49'))['toString'](),'sender':_0x240082[_0xf18f('0x62')]===_0xf18f('0x6c')?_0x240082[_0xf18f('0x5c')]?_0x240082[_0xf18f('0x5c')][_0xf18f('0x5d')]:_0xf18f('0x6d'):_0x240082[_0xf18f('0x5e')][_0xf18f('0x5f')]+(_0x240082[_0xf18f('0x5e')][_0xf18f('0x6e')]?'\x20'+_0x240082[_0xf18f('0x5e')][_0xf18f('0x6e')]:''),'body':_0x240082['body'],'direction':_0x240082[_0xf18f('0x62')]==='out'?'A':'C','secret':_0x240082[_0xf18f('0x63')],'read':_0x240082[_0xf18f('0x64')]};})[_0xf18f('0x6f')]()};return ejs[_0xf18f('0x70')](path['join'](config[_0xf18f('0x56')],'server','views',_0xf18f('0x71')),{'interaction':_0x4e1b68})[_0xf18f('0x1f')](function(_0x547d34){var _0x1241c1=path[_0xf18f('0x72')](_0x33b5b6,'transcript-'+_0x520c29['id']+'-'+_0x256791+'.pdf');var _0x26d14a={'path':_0x1241c1,'channel':_0xf18f('0x67'),'interactionId':_0x520c29['id']};return pdf['createPdfFromHTML'](_0x547d34,_0x26d14a);})[_0xf18f('0x1f')](function(){return new BPromise(function(_0x4e4f69,_0x79238c){zipdir(_0x33b5b6,{'saveTo':_0x5dd808},function(_0xbf1cbb,_0x321a45){if(_0xbf1cbb)return _0x79238c(_0xbf1cbb);return _0x4e4f69(_0x321a45);});})[_0xf18f('0x1f')](function(){return new BPromise(function(_0x5ab5b0,_0x497cdb){rimraf(_0x33b5b6,function(_0x2e7b99){if(_0x2e7b99)_0x497cdb(_0x2e7b99);return _0x5ab5b0();});});})['then'](function(){return _0x25e4ef[_0xf18f('0x53')](_0x5dd808,_0x595185,function(_0x29a516){if(_0x29a516){console[_0xf18f('0x73')](_0xf18f('0x74'),_0x29a516);}else{fs['unlinkSync'](_0x5dd808);}});});});}else{return _0x25e4ef['sendStatus'](0xc8);}})[_0xf18f('0x2c')](handleError(_0x25e4ef,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index ee9db49..98e6785 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93e9=['getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0xc0e2e9,_0xaa414b){var _0x13b810=function(_0x5f4f5f){while(--_0x5f4f5f){_0xc0e2e9['push'](_0xc0e2e9['shift']());}};_0x13b810(++_0xaa414b);}(_0x93e9,0xcc));var _0x993e=function(_0x387fe4,_0x186656){_0x387fe4=_0x387fe4-0x0;var _0x43c1c1=_0x93e9[_0x387fe4];return _0x43c1c1;};'use strict';var EventEmitter=require(_0x993e('0x0'));var SmsInteraction=require(_0x993e('0x1'))['db'][_0x993e('0x2')];var SmsMessage=require(_0x993e('0x1'))['db'][_0x993e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x993e('0x4')](0x0);var events={'afterCreate':_0x993e('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b762e){return function(_0x255045,_0x15ce9b,_0x45f52e){_0x255045[_0x993e('0x6')]({'attributes':['id'],'raw':!![]})[_0x993e('0x7')](function(_0x12ac94){_0x255045[_0x993e('0x8')]('Users',_0x12ac94[_0x993e('0x9')](function(_0x69ff1){return{'id':_0x69ff1['id']};}));return SmsMessage[_0x993e('0xa')]({'where':{'SmsInteractionId':_0x255045['id'],'direction':'in','read':![]},'raw':!![]});})[_0x993e('0x7')](function(_0x2cd389){_0x255045[_0x993e('0x8')](_0x993e('0xb'),_0x2cd389['length']);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e+':'+_0x255045['id'],_0x255045);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e,_0x255045);_0x45f52e(null);})['catch'](_0x45f52e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x993e('0xd')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xea28=['Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xea28,0x13a));var _0x8ea2=function(_0x38773d,_0x2fd5d7){_0x38773d=_0x38773d-0x0;var _0x2eeb1f=_0xea28[_0x38773d];return _0x2eeb1f;};'use strict';var EventEmitter=require(_0x8ea2('0x0'));var SmsInteraction=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x2')];var SmsMessage=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8ea2('0x4')](0x0);var events={'afterCreate':_0x8ea2('0x5'),'afterUpdate':_0x8ea2('0x6'),'afterDestroy':'remove'};function emitEvent(_0x9b45ab){return function(_0x23aaf1,_0x1ccf12,_0x513a0d){_0x23aaf1[_0x8ea2('0x7')]({'attributes':['id'],'raw':!![]})[_0x8ea2('0x8')](function(_0xb7f278){_0x23aaf1[_0x8ea2('0x9')](_0x8ea2('0xa'),_0xb7f278[_0x8ea2('0xb')](function(_0x19bd6c){return{'id':_0x19bd6c['id']};}));return SmsMessage[_0x8ea2('0xc')]({'where':{'SmsInteractionId':_0x23aaf1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8ea2('0x8')](function(_0x3000f9){_0x23aaf1[_0x8ea2('0x9')](_0x8ea2('0xd'),_0x3000f9['length']);SmsInteractionEvents['emit'](_0x9b45ab+':'+_0x23aaf1['id'],_0x23aaf1);SmsInteractionEvents[_0x8ea2('0xe')](_0x9b45ab,_0x23aaf1);_0x513a0d(null);})[_0x8ea2('0xf')](_0x513a0d(null));};}for(var e in events){if(events[_0x8ea2('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x8ea2('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index f90b50c..0b03a49 100644 --- a/server/api/smsInteraction/smsInteraction.model.js +++ b/server/api/smsInteraction/smsInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x502a=['lodash','util','api','moment','bluebird','request-promise','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','format'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x502a,0x118));var _0xa502=function(_0x141e78,_0x573a1c){_0x141e78=_0x141e78-0x0;var _0x11dd59=_0x502a[_0x141e78];return _0x11dd59;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var logger=require('../../config/logger')(_0xa502('0x2'));var moment=require(_0xa502('0x3'));var BPromise=require(_0xa502('0x4'));var rp=require(_0xa502('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa502('0x6'));var config=require('../../config/environment');var attributes=require(_0xa502('0x7'));module[_0xa502('0x8')]=function(_0x39cc20,_0x44a3ac){return _0x39cc20[_0xa502('0x9')](_0xa502('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe39ae0,_0x30f0dd,_0x5c920b){if(_0xe39ae0[_0xa502('0xb')](_0xa502('0xc'))){_0xe39ae0['closedAt']=moment()[_0xa502('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5c920b(null,_0xe39ae0);}}});}; \ No newline at end of file +var _0x612a=['define','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x612a,0xd6));var _0xa612=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0x612a[_0x1073ad];return _0x528474;};'use strict';var _=require(_0xa612('0x0'));var util=require(_0xa612('0x1'));var logger=require(_0xa612('0x2'))(_0xa612('0x3'));var moment=require('moment');var BPromise=require(_0xa612('0x4'));var rp=require(_0xa612('0x5'));var fs=require('fs');var path=require(_0xa612('0x6'));var rimraf=require(_0xa612('0x7'));var config=require(_0xa612('0x8'));var attributes=require('./smsInteraction.attributes');module[_0xa612('0x9')]=function(_0x57157d,_0x2605be){return _0x57157d[_0xa612('0xa')]('SmsInteraction',attributes,{'tableName':_0xa612('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xbe567e,_0x4eacce,_0x24aee4){if(_0xbe567e[_0xa612('0xc')](_0xa612('0xd'))){_0xbe567e[_0xa612('0xe')]=moment()['format'](_0xa612('0xf'));}_0x24aee4(null,_0xbe567e);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 9188c0a..2a77cfb 100644 --- a/server/api/smsInteraction/smsInteraction.rpc.js +++ b/server/api/smsInteraction/smsInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8349=['omit','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','then','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','raw','options','limit','debug','AddTagsToSmsInteraction','where','addTags','ids'];(function(_0x1c83c9,_0x2a0efc){var _0x49c840=function(_0x2945e2){while(--_0x2945e2){_0x1c83c9['push'](_0x1c83c9['shift']());}};_0x49c840(++_0x2a0efc);}(_0x8349,0x161));var _0x9834=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x8349[_0xe45118];return _0x15e15d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9834('0x0'));var BPromise=require(_0x9834('0x1'));var rs=require(_0x9834('0x2'));var fs=require('fs');var Redis=require(_0x9834('0x3'));var db=require(_0x9834('0x4'))['db'];var utils=require(_0x9834('0x5'));var logger=require(_0x9834('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9834('0x7')][_0x9834('0x8')]({'port':0x232a});config['redis']=_[_0x9834('0x9')](config[_0x9834('0xa')],{'host':_0x9834('0xb'),'port':0x18eb});var socket=require(_0x9834('0xc'))(new Redis(config[_0x9834('0xa')]));require(_0x9834('0xd'))['register'](socket);function respondWithRpcPromise(_0x374bca,_0xc2ebb8,_0x532eaf){return new BPromise(function(_0x4eae50,_0x1fa867){return client['request'](_0x374bca,_0x532eaf)[_0x9834('0xe')](function(_0xbfccdb){logger['info'](_0x9834('0xf'),_0xc2ebb8,'request\x20sent');logger['debug'](_0x9834('0x10'),_0xc2ebb8,_0x9834('0x11'),JSON[_0x9834('0x12')](_0xbfccdb));if(_0xbfccdb['error']){if(_0xbfccdb[_0x9834('0x13')][_0x9834('0x14')]===0x1f4){logger['error'](_0x9834('0xf'),_0xc2ebb8,_0xbfccdb[_0x9834('0x13')][_0x9834('0x15')]);return _0x1fa867(_0xbfccdb[_0x9834('0x13')][_0x9834('0x15')]);}logger[_0x9834('0x13')]('SmsInteraction,\x20%s,\x20%s',_0xc2ebb8,_0xbfccdb['error'][_0x9834('0x15')]);return _0x4eae50(_0xbfccdb['error'][_0x9834('0x15')]);}else{logger[_0x9834('0x16')]('SmsInteraction,\x20%s,\x20%s',_0xc2ebb8,'request\x20sent');_0x4eae50(_0xbfccdb[_0x9834('0x17')][_0x9834('0x15')]);}})[_0x9834('0x18')](function(_0x444c83){logger['error'](_0x9834('0xf'),_0xc2ebb8,_0x444c83);_0x1fa867(_0x444c83);});});}exports[_0x9834('0x19')]=function(_0x171d9d){var _0x3d303a=this;return new Promise(function(_0x307115,_0x1cab0d){return db[_0x9834('0x1a')][_0x9834('0x1b')](_0x171d9d[_0x9834('0x1c')],{'raw':_0x171d9d['options']?_0x171d9d['options'][_0x9834('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x171d9d['options']?_0x171d9d[_0x9834('0x1e')]['where']||null:null,'attributes':_0x171d9d['options']?_0x171d9d[_0x9834('0x1e')]['attributes']||null:null,'limit':_0x171d9d[_0x9834('0x1e')]?_0x171d9d[_0x9834('0x1e')][_0x9834('0x1f')]||null:null})['then'](function(_0x1c47b0){logger['info'](_0x9834('0x19'),_0x171d9d);logger[_0x9834('0x20')](_0x9834('0x19'),_0x171d9d,JSON['stringify'](_0x1c47b0));_0x307115(_0x1c47b0);})[_0x9834('0x18')](function(_0x5f2f6f){logger['error']('UpdateSmsInteraction',_0x5f2f6f[_0x9834('0x15')],_0x171d9d);_0x1cab0d(_0x3d303a[_0x9834('0x13')](0x1f4,_0x5f2f6f[_0x9834('0x15')]));});});};exports[_0x9834('0x21')]=function(_0x2b5633){return new Promise(function(_0x1d216a,_0x34525a){return db[_0x9834('0x1a')]['find']({'where':_0x2b5633['options']?_0x2b5633[_0x9834('0x1e')][_0x9834('0x22')]||null:null})['then'](function(_0x4a751d){if(_0x4a751d){return _0x4a751d[_0x9834('0x23')](_0x2b5633['body'][_0x9834('0x24')],_[_0x9834('0x25')](_0x2b5633[_0x9834('0x1c')],[_0x9834('0x24'),'id'])||{});}})['spread'](function(_0xa9e04b){logger[_0x9834('0x16')]('AddTags',_0x2b5633);logger[_0x9834('0x20')]('AddTags',_0x2b5633,JSON[_0x9834('0x12')](_0xa9e04b));_0x1d216a(_0xa9e04b);})[_0x9834('0x18')](function(_0x45b385){logger['error'](_0x9834('0x26'),_0x45b385[_0x9834('0x15')],_0x2b5633);_0x34525a(_this[_0x9834('0x13')](0x1f4,_0x45b385['message']));});});}; \ No newline at end of file +var _0xbb47=['limit','catch','find','addTags','body','ids','omit','spread','AddTags','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','UpdateSmsInteraction','SmsInteraction','options','raw','where','attributes'];(function(_0x141e11,_0x38f0a7){var _0x5135e9=function(_0x39a007){while(--_0x39a007){_0x141e11['push'](_0x141e11['shift']());}};_0x5135e9(++_0x38f0a7);}(_0xbb47,0xc7));var _0x7bb4=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0xbb47[_0x207d2f];return _0x3c3498;};'use strict';var _=require('lodash');var util=require(_0x7bb4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7bb4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7bb4('0x2'))(_0x7bb4('0x3'));var config=require(_0x7bb4('0x4'));var jayson=require(_0x7bb4('0x5'));var client=jayson[_0x7bb4('0x6')][_0x7bb4('0x7')]({'port':0x232a});config[_0x7bb4('0x8')]=_['defaults'](config[_0x7bb4('0x8')],{'host':_0x7bb4('0x9'),'port':0x18eb});var socket=require(_0x7bb4('0xa'))(new Redis(config['redis']));require(_0x7bb4('0xb'))[_0x7bb4('0xc')](socket);function respondWithRpcPromise(_0x4d4813,_0x27f23e,_0x5694c0){return new BPromise(function(_0x346867,_0x1f2b97){return client[_0x7bb4('0xd')](_0x4d4813,_0x5694c0)[_0x7bb4('0xe')](function(_0x2dcdc6){logger[_0x7bb4('0xf')](_0x7bb4('0x10'),_0x27f23e,_0x7bb4('0x11'));logger[_0x7bb4('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x27f23e,'request\x20sent',JSON[_0x7bb4('0x13')](_0x2dcdc6));if(_0x2dcdc6[_0x7bb4('0x14')]){if(_0x2dcdc6['error']['code']===0x1f4){logger[_0x7bb4('0x14')](_0x7bb4('0x10'),_0x27f23e,_0x2dcdc6[_0x7bb4('0x14')][_0x7bb4('0x15')]);return _0x1f2b97(_0x2dcdc6[_0x7bb4('0x14')][_0x7bb4('0x15')]);}logger['error'](_0x7bb4('0x10'),_0x27f23e,_0x2dcdc6['error'][_0x7bb4('0x15')]);return _0x346867(_0x2dcdc6[_0x7bb4('0x14')][_0x7bb4('0x15')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x27f23e,'request\x20sent');_0x346867(_0x2dcdc6[_0x7bb4('0x16')][_0x7bb4('0x15')]);}})['catch'](function(_0x163abe){logger[_0x7bb4('0x14')](_0x7bb4('0x10'),_0x27f23e,_0x163abe);_0x1f2b97(_0x163abe);});});}exports[_0x7bb4('0x17')]=function(_0x4ed554){var _0x32b75c=this;return new Promise(function(_0x1afc0a,_0x443779){return db[_0x7bb4('0x18')]['update'](_0x4ed554['body'],{'raw':_0x4ed554[_0x7bb4('0x19')]?_0x4ed554['options'][_0x7bb4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ed554[_0x7bb4('0x19')]?_0x4ed554[_0x7bb4('0x19')][_0x7bb4('0x1b')]||null:null,'attributes':_0x4ed554[_0x7bb4('0x19')]?_0x4ed554[_0x7bb4('0x19')][_0x7bb4('0x1c')]||null:null,'limit':_0x4ed554[_0x7bb4('0x19')]?_0x4ed554[_0x7bb4('0x19')][_0x7bb4('0x1d')]||null:null})[_0x7bb4('0xe')](function(_0x593389){logger[_0x7bb4('0xf')](_0x7bb4('0x17'),_0x4ed554);logger[_0x7bb4('0x12')]('UpdateSmsInteraction',_0x4ed554,JSON[_0x7bb4('0x13')](_0x593389));_0x1afc0a(_0x593389);})[_0x7bb4('0x1e')](function(_0x599f8a){logger[_0x7bb4('0x14')]('UpdateSmsInteraction',_0x599f8a[_0x7bb4('0x15')],_0x4ed554);_0x443779(_0x32b75c[_0x7bb4('0x14')](0x1f4,_0x599f8a[_0x7bb4('0x15')]));});});};exports['AddTagsToSmsInteraction']=function(_0x36e865){return new Promise(function(_0x5c268f,_0x1a892f){return db[_0x7bb4('0x18')][_0x7bb4('0x1f')]({'where':_0x36e865[_0x7bb4('0x19')]?_0x36e865['options'][_0x7bb4('0x1b')]||null:null})['then'](function(_0xbadc06){if(_0xbadc06){return _0xbadc06[_0x7bb4('0x20')](_0x36e865[_0x7bb4('0x21')][_0x7bb4('0x22')],_[_0x7bb4('0x23')](_0x36e865[_0x7bb4('0x21')],['ids','id'])||{});}})[_0x7bb4('0x24')](function(_0xce3d3){logger[_0x7bb4('0xf')](_0x7bb4('0x25'),_0x36e865);logger[_0x7bb4('0x12')](_0x7bb4('0x25'),_0x36e865,JSON[_0x7bb4('0x13')](_0xce3d3));_0x5c268f(_0xce3d3);})['catch'](function(_0x58691f){logger[_0x7bb4('0x14')](_0x7bb4('0x25'),_0x58691f['message'],_0x36e865);_0x1a892f(_this[_0x7bb4('0x14')](0x1f4,_0x58691f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index fc8a7d7..e32b605 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66cc=['remove','update','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x3c157f,_0x25bb5b){var _0x2dbe37=function(_0x409dc2){while(--_0x409dc2){_0x3c157f['push'](_0x3c157f['shift']());}};_0x2dbe37(++_0x25bb5b);}(_0x66cc,0x117));var _0xc66c=function(_0x5a693b,_0x4838d1){_0x5a693b=_0x5a693b-0x0;var _0x50e613=_0x66cc[_0x5a693b];return _0x50e613;};'use strict';var SmsInteractionEvents=require(_0xc66c('0x0'));var events=['save',_0xc66c('0x1'),_0xc66c('0x2')];function createListener(_0x1cddea,_0x5e65b2){return function(_0x287908){_0x5e65b2['emit'](_0x1cddea,_0x287908);};}function removeListener(_0x119fd4,_0x1952ab){return function(){SmsInteractionEvents[_0xc66c('0x3')](_0x119fd4,_0x1952ab);};}exports[_0xc66c('0x4')]=function(_0x2b988a){for(var _0x3c5e8=0x0,_0xc7fbb5=events[_0xc66c('0x5')];_0x3c5e8<_0xc7fbb5;_0x3c5e8++){var _0x14d662=events[_0x3c5e8];var _0x27e49b=createListener(_0xc66c('0x6')+_0x14d662,_0x2b988a);SmsInteractionEvents['on'](_0x14d662,_0x27e49b);}}; \ No newline at end of file +var _0xe7ef=['update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xe7ef,0x106));var _0xfe7e=function(_0x407b1a,_0x558fa4){_0x407b1a=_0x407b1a-0x0;var _0x580980=_0xe7ef[_0x407b1a];return _0x580980;};'use strict';var SmsInteractionEvents=require(_0xfe7e('0x0'));var events=[_0xfe7e('0x1'),'remove',_0xfe7e('0x2')];function createListener(_0x44def6,_0x2e5662){return function(_0x1655a3){_0x2e5662[_0xfe7e('0x3')](_0x44def6,_0x1655a3);};}function removeListener(_0x1dac07,_0x8f2b0){return function(){SmsInteractionEvents[_0xfe7e('0x4')](_0x1dac07,_0x8f2b0);};}exports[_0xfe7e('0x5')]=function(_0x120b1f){for(var _0x4f22cf=0x0,_0x4081da=events[_0xfe7e('0x6')];_0x4f22cf<_0x4081da;_0x4f22cf++){var _0x4cbdfa=events[_0x4f22cf];var _0xfdf7d7=createListener(_0xfe7e('0x7')+_0x4cbdfa,_0x120b1f);SmsInteractionEvents['on'](_0x4cbdfa,_0xfdf7d7);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 4ef2cc0..4ab9a92 100644 --- a/server/api/smsMessage/index.js +++ b/server/api/smsMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5a4=['isAuthenticated','/:id','post','smsmessage:create','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0xa5a4,0xaf));var _0x4a5a=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0xa5a4[_0x383356];return _0x32ee5a;};'use strict';var multer=require(_0x4a5a('0x0'));var util=require(_0x4a5a('0x1'));var path=require(_0x4a5a('0x2'));var timeout=require(_0x4a5a('0x3'));var express=require(_0x4a5a('0x4'));var router=express[_0x4a5a('0x5')]();var fs_extra=require(_0x4a5a('0x6'));var auth=require(_0x4a5a('0x7'));var interaction=require(_0x4a5a('0x8'));var config=require(_0x4a5a('0x9'));var controller=require(_0x4a5a('0xa'));router[_0x4a5a('0xb')]('/',auth['isAuthenticated'](),controller[_0x4a5a('0xc')]);router[_0x4a5a('0xb')](_0x4a5a('0xd'),auth[_0x4a5a('0xe')](),controller['describe']);router[_0x4a5a('0xb')](_0x4a5a('0xf'),auth[_0x4a5a('0xe')](),controller['show']);router[_0x4a5a('0x10')]('/',auth[_0x4a5a('0xe')](),interaction['tracked']('sms',_0x4a5a('0x11')),controller['create']);router[_0x4a5a('0x10')]('/:id/status',controller[_0x4a5a('0x12')]);router[_0x4a5a('0x13')](_0x4a5a('0xf'),auth[_0x4a5a('0xe')](),controller['update']);router[_0x4a5a('0x13')](_0x4a5a('0x14'),auth['isAuthenticated'](),controller[_0x4a5a('0x15')]);router[_0x4a5a('0x13')](_0x4a5a('0x16'),auth[_0x4a5a('0xe')](),controller[_0x4a5a('0x17')]);router[_0x4a5a('0x18')](_0x4a5a('0xf'),auth[_0x4a5a('0xe')](),controller[_0x4a5a('0x19')]);module[_0x4a5a('0x1a')]=router; \ No newline at end of file +var _0x9ed4=['isAuthenticated','index','get','/describe','describe','show','tracked','sms','smsmessage:create','create','post','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller'];(function(_0x3ea47c,_0x522e1d){var _0x25092c=function(_0x8c6338){while(--_0x8c6338){_0x3ea47c['push'](_0x3ea47c['shift']());}};_0x25092c(++_0x522e1d);}(_0x9ed4,0x1a7));var _0x49ed=function(_0x9fe7aa,_0x92dcf2){_0x9fe7aa=_0x9fe7aa-0x0;var _0x21c804=_0x9ed4[_0x9fe7aa];return _0x21c804;};'use strict';var multer=require(_0x49ed('0x0'));var util=require(_0x49ed('0x1'));var path=require(_0x49ed('0x2'));var timeout=require(_0x49ed('0x3'));var express=require(_0x49ed('0x4'));var router=express[_0x49ed('0x5')]();var fs_extra=require(_0x49ed('0x6'));var auth=require(_0x49ed('0x7'));var interaction=require(_0x49ed('0x8'));var config=require(_0x49ed('0x9'));var controller=require(_0x49ed('0xa'));router['get']('/',auth[_0x49ed('0xb')](),controller[_0x49ed('0xc')]);router[_0x49ed('0xd')](_0x49ed('0xe'),auth[_0x49ed('0xb')](),controller[_0x49ed('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x49ed('0x10')]);router['post']('/',auth[_0x49ed('0xb')](),interaction[_0x49ed('0x11')](_0x49ed('0x12'),_0x49ed('0x13')),controller[_0x49ed('0x14')]);router[_0x49ed('0x15')](_0x49ed('0x16'),controller[_0x49ed('0x17')]);router[_0x49ed('0x18')](_0x49ed('0x19'),auth[_0x49ed('0xb')](),controller[_0x49ed('0x1a')]);router[_0x49ed('0x18')](_0x49ed('0x1b'),auth['isAuthenticated'](),controller[_0x49ed('0x1c')]);router[_0x49ed('0x18')](_0x49ed('0x1d'),auth[_0x49ed('0xb')](),controller['reject']);router['delete'](_0x49ed('0x19'),auth['isAuthenticated'](),controller['destroy']);module[_0x49ed('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 81f06a1..4f224a5 100644 --- a/server/api/smsMessage/smsMessage.attributes.js +++ b/server/api/smsMessage/smsMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e88=['TEXT','sequelize','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x13332f,_0x4df9e3){var _0x238f2a=function(_0x510e76){while(--_0x510e76){_0x13332f['push'](_0x13332f['shift']());}};_0x238f2a(++_0x4df9e3);}(_0x7e88,0x149));var _0x87e8=function(_0x108920,_0x37fa62){_0x108920=_0x108920-0x0;var _0x371d25=_0x7e88[_0x108920];return _0x371d25;};'use strict';var Sequelize=require(_0x87e8('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x87e8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x87e8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x87e8('0x3')]('in',_0x87e8('0x4')),'defaultValue':_0x87e8('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x87e8('0x5')]},'readAt':{'type':Sequelize[_0x87e8('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x87e8('0x5')]},'providerResponse':{'type':Sequelize[_0x87e8('0x7')]}}; \ No newline at end of file +var _0x6cd0=['STRING','BOOLEAN','sequelize','medium','out'];(function(_0x3f24b1,_0x5018d0){var _0x360542=function(_0x447bf9){while(--_0x447bf9){_0x3f24b1['push'](_0x3f24b1['shift']());}};_0x360542(++_0x5018d0);}(_0x6cd0,0x1ce));var _0x06cd=function(_0x3be8f7,_0xc946b7){_0x3be8f7=_0x3be8f7-0x0;var _0x430179=_0x6cd0[_0x3be8f7];return _0x430179;};'use strict';var Sequelize=require(_0x06cd('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x06cd('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x06cd('0x2')),'defaultValue':_0x06cd('0x2'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x06cd('0x3')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x06cd('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x06cd('0x3')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 5435c67..187ab75 100644 --- a/server/api/smsMessage/smsMessage.controller.js +++ b/server/api/smsMessage/smsMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x855f=['rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','info','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','params','find','create','body','describe','sms-interactions','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','email','internal','event'];(function(_0x8b43dc,_0x3a0dde){var _0x4bb2b8=function(_0x5420a9){while(--_0x5420a9){_0x8b43dc['push'](_0x8b43dc['shift']());}};_0x4bb2b8(++_0x3a0dde);}(_0x855f,0x145));var _0xf855=function(_0x579b0a,_0x17ad46){_0x579b0a=_0x579b0a-0x0;var _0xc7b318=_0x855f[_0x579b0a];return _0xc7b318;};'use strict';var emlformat=require(_0xf855('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf855('0x1'));var jsonpatch=require(_0xf855('0x2'));var rp=require(_0xf855('0x3'));var moment=require(_0xf855('0x4'));var BPromise=require(_0xf855('0x5'));var Mustache=require('mustache');var util=require(_0xf855('0x6'));var path=require(_0xf855('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf855('0x8'));var fs=require('fs');var fs_extra=require(_0xf855('0x9'));var _=require(_0xf855('0xa'));var squel=require(_0xf855('0xb'));var crypto=require(_0xf855('0xc'));var jsforce=require(_0xf855('0xd'));var deskjs=require(_0xf855('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf855('0xf'));var Papa=require(_0xf855('0x10'));var Redis=require(_0xf855('0x11'));var authService=require(_0xf855('0x12'));var qs=require(_0xf855('0x13'));var as=require(_0xf855('0x14'));var hardwareService=require(_0xf855('0x15'));var logger=require(_0xf855('0x16'))('api');var utils=require(_0xf855('0x17'));var config=require(_0xf855('0x18'));var licenseUtil=require(_0xf855('0x19'));var db=require('../../mysqldb')['db'];config[_0xf855('0x1a')]=_[_0xf855('0x1b')](config[_0xf855('0x1a')],{'host':_0xf855('0x1c'),'port':0x18eb});var socket=require(_0xf855('0x1d'))(new Redis(config[_0xf855('0x1a')]));require(_0xf855('0x1e'))['register'](socket);var jayson=require(_0xf855('0x1f'));var client=jayson[_0xf855('0x20')][_0xf855('0x21')]({'port':0x232c});var client9002=jayson[_0xf855('0x20')][_0xf855('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x310fc3,_0x1db377,_0x496de4,_0x5e7439){return new BPromise(function(_0xcf59f6,_0xcd9d5f){var _0x31e76d=_0x5e7439||client;return _0x31e76d['request'](_0x310fc3,_0x496de4)[_0xf855('0x22')](function(_0x2068e0){logger['info']('SmsMessage,\x20%s,\x20%s',_0x1db377,_0xf855('0x23'));logger[_0xf855('0x24')](_0xf855('0x25'),_0x1db377,_0xf855('0x23'),JSON[_0xf855('0x26')](_0x2068e0));if(_0x2068e0[_0xf855('0x27')]){if(_0x2068e0[_0xf855('0x27')][_0xf855('0x28')]===0x1f4){logger[_0xf855('0x27')](_0xf855('0x29'),_0x1db377,_0x2068e0[_0xf855('0x27')][_0xf855('0x2a')]);return _0xcd9d5f(_0x2068e0[_0xf855('0x27')]['message']);}logger[_0xf855('0x27')](_0xf855('0x29'),_0x1db377,_0x2068e0[_0xf855('0x27')]['message']);return _0xcf59f6(_0x2068e0[_0xf855('0x27')]['message']);}else{logger[_0xf855('0x2b')](_0xf855('0x29'),_0x1db377,_0xf855('0x23'));_0xcf59f6(_0x2068e0['result'][_0xf855('0x2a')]);}})[_0xf855('0x2c')](function(_0x53719d){logger[_0xf855('0x27')](_0xf855('0x29'),_0x1db377,_0x53719d);_0xcd9d5f(_0x53719d);});});}function respondWithStatusCode(_0x3d9d8c,_0x2c87ab){_0x2c87ab=_0x2c87ab||0xcc;return function(_0x3506c7){if(_0x3506c7){return _0x3d9d8c['sendStatus'](_0x2c87ab);}return _0x3d9d8c['status'](_0x2c87ab)[_0xf855('0x2d')]();};}function respondWithResult(_0x482ae,_0x530b91){_0x530b91=_0x530b91||0xc8;return function(_0x3fe7de){if(_0x3fe7de){return _0x482ae[_0xf855('0x2e')](_0x530b91)[_0xf855('0x2f')](_0x3fe7de);}};}function respondWithFilteredResult(_0x353a5d,_0xffb3c2){return function(_0x34e8b9){if(_0x34e8b9){var _0x27897a=typeof _0xffb3c2[_0xf855('0x30')]===_0xf855('0x31')&&typeof _0xffb3c2[_0xf855('0x32')]===_0xf855('0x31');var _0x5d9084=_0x34e8b9[_0xf855('0x33')];var _0x574033=_0x27897a?0x0:_0xffb3c2['offset'];var _0x4e4b9e=_0x27897a?_0x34e8b9[_0xf855('0x33')]:_0xffb3c2[_0xf855('0x30')]+_0xffb3c2[_0xf855('0x32')];var _0x2791ca;if(_0x4e4b9e>=_0x5d9084){_0x4e4b9e=_0x5d9084;_0x2791ca=0xc8;}else{_0x2791ca=0xce;}_0x353a5d['status'](_0x2791ca);return _0x353a5d[_0xf855('0x34')](_0xf855('0x35'),_0x574033+'-'+_0x4e4b9e+'/'+_0x5d9084)[_0xf855('0x2f')](_0x34e8b9);}return null;};}function patchUpdates(_0x249cc7){return function(_0x497fb6){try{jsonpatch[_0xf855('0x36')](_0x497fb6,_0x249cc7,!![]);}catch(_0x22e492){return BPromise[_0xf855('0x37')](_0x22e492);}return _0x497fb6[_0xf855('0x38')]();};}function saveUpdates(_0x529af5,_0x5575d2){return function(_0xcbf6d6){if(_0xcbf6d6){return _0xcbf6d6[_0xf855('0x39')](_0x529af5)['then'](function(_0x1f77d5){return _0x1f77d5;});}return null;};}function removeEntity(_0x5ab5d6,_0x308fd5){return function(_0x346cef){if(_0x346cef){return _0x346cef[_0xf855('0x3a')]()[_0xf855('0x22')](function(){_0x5ab5d6[_0xf855('0x2e')](0xcc)[_0xf855('0x2d')]();});}};}function handleEntityNotFound(_0x1703f8,_0xa60343){return function(_0x18f1fe){if(!_0x18f1fe){_0x1703f8[_0xf855('0x3b')](0x194);}return _0x18f1fe;};}function handleError(_0x98a68d,_0x3a6f64){_0x3a6f64=_0x3a6f64||0x1f4;return function(_0x235cf0){logger[_0xf855('0x27')](_0x235cf0[_0xf855('0x3c')]);if(_0x235cf0[_0xf855('0x3d')]){delete _0x235cf0[_0xf855('0x3d')];}_0x98a68d[_0xf855('0x2e')](_0x3a6f64)['send'](_0x235cf0);};}exports[_0xf855('0x3e')]=function(_0x381821,_0x2f54ae){var _0x4eb368={},_0xd4916b={},_0xd2edc2={'count':0x0,'rows':[]};var _0x6233da=_['map'](db[_0xf855('0x3f')][_0xf855('0x40')],function(_0x39fb76){return{'name':_0x39fb76[_0xf855('0x41')],'type':_0x39fb76[_0xf855('0x42')][_0xf855('0x43')]};});_0xd4916b[_0xf855('0x44')]=_['map'](_0x6233da,_0xf855('0x3d'));_0xd4916b[_0xf855('0x45')]=_[_0xf855('0x46')](_0x381821[_0xf855('0x45')]);_0xd4916b[_0xf855('0x47')]=_[_0xf855('0x48')](_0xd4916b[_0xf855('0x44')],_0xd4916b[_0xf855('0x45')]);_0x4eb368[_0xf855('0x49')]=_[_0xf855('0x48')](_0xd4916b['model'],qs[_0xf855('0x4a')](_0x381821[_0xf855('0x45')][_0xf855('0x4a')]));_0x4eb368[_0xf855('0x49')]=_0x4eb368[_0xf855('0x49')][_0xf855('0x4b')]?_0x4eb368[_0xf855('0x49')]:_0xd4916b['model'];if(!_0x381821[_0xf855('0x45')][_0xf855('0x4c')](_0xf855('0x4d'))){_0x4eb368[_0xf855('0x32')]=qs[_0xf855('0x32')](_0x381821['query'][_0xf855('0x32')]);_0x4eb368['offset']=qs['offset'](_0x381821[_0xf855('0x45')]['offset']);}_0x4eb368[_0xf855('0x4e')]=qs['sort'](_0x381821[_0xf855('0x45')][_0xf855('0x4f')]);_0x4eb368['where']=qs[_0xf855('0x47')](_[_0xf855('0x50')](_0x381821[_0xf855('0x45')],_0xd4916b[_0xf855('0x47')]),_0x6233da);if(_0x381821[_0xf855('0x45')][_0xf855('0x51')]){_0x4eb368[_0xf855('0x52')]=_[_0xf855('0x53')](_0x4eb368[_0xf855('0x52')],{'$or':_[_0xf855('0x54')](_0x6233da,function(_0x102870){if(_0x102870['type']!==_0xf855('0x55')){var _0x353e24={};_0x353e24[_0x102870[_0xf855('0x3d')]]={'$like':'%'+_0x381821[_0xf855('0x45')][_0xf855('0x51')]+'%'};return _0x353e24;}})});}_0x4eb368=_['merge']({},_0x4eb368,_0x381821[_0xf855('0x56')]);var _0x50ae67={'where':_0x4eb368[_0xf855('0x52')]};return db[_0xf855('0x3f')][_0xf855('0x33')](_0x50ae67)[_0xf855('0x22')](function(_0x2ed656){_0xd2edc2[_0xf855('0x33')]=_0x2ed656;if(_0x381821[_0xf855('0x45')][_0xf855('0x57')]){_0x4eb368[_0xf855('0x58')]=[{'all':!![]}];}return db[_0xf855('0x3f')][_0xf855('0x59')](_0x4eb368);})[_0xf855('0x22')](function(_0x459b3b){_0xd2edc2['rows']=_0x459b3b;return _0xd2edc2;})[_0xf855('0x22')](respondWithFilteredResult(_0x2f54ae,_0x4eb368))[_0xf855('0x2c')](handleError(_0x2f54ae,null));};exports['show']=function(_0x1c4045,_0x4c5b35){var _0x6ebccc={'raw':!![],'where':{'id':_0x1c4045[_0xf855('0x5a')]['id']}},_0x4964fe={};_0x4964fe[_0xf855('0x44')]=_[_0xf855('0x46')](db['SmsMessage'][_0xf855('0x40')]);_0x4964fe['query']=_['keys'](_0x1c4045[_0xf855('0x45')]);_0x4964fe[_0xf855('0x47')]=_['intersection'](_0x4964fe[_0xf855('0x44')],_0x4964fe['query']);_0x6ebccc['attributes']=_[_0xf855('0x48')](_0x4964fe[_0xf855('0x44')],qs[_0xf855('0x4a')](_0x1c4045[_0xf855('0x45')][_0xf855('0x4a')]));_0x6ebccc[_0xf855('0x49')]=_0x6ebccc[_0xf855('0x49')][_0xf855('0x4b')]?_0x6ebccc[_0xf855('0x49')]:_0x4964fe[_0xf855('0x44')];if(_0x1c4045[_0xf855('0x45')][_0xf855('0x57')]){_0x6ebccc[_0xf855('0x58')]=[{'all':!![]}];}_0x6ebccc=_['merge']({},_0x6ebccc,_0x1c4045['options']);return db[_0xf855('0x3f')][_0xf855('0x5b')](_0x6ebccc)[_0xf855('0x22')](handleEntityNotFound(_0x4c5b35,null))[_0xf855('0x22')](respondWithResult(_0x4c5b35,null))[_0xf855('0x2c')](handleError(_0x4c5b35,null));};exports['create']=function(_0x2a09d1,_0x468eb9){return db['SmsMessage'][_0xf855('0x5c')](_0x2a09d1[_0xf855('0x5d')],{})[_0xf855('0x22')](respondWithResult(_0x468eb9,0xc9))[_0xf855('0x2c')](handleError(_0x468eb9,null));};exports['update']=function(_0x1fca92,_0x31aac8){if(_0x1fca92['body']['id']){delete _0x1fca92[_0xf855('0x5d')]['id'];}return db[_0xf855('0x3f')][_0xf855('0x5b')]({'where':{'id':_0x1fca92['params']['id']}})[_0xf855('0x22')](handleEntityNotFound(_0x31aac8,null))[_0xf855('0x22')](saveUpdates(_0x1fca92[_0xf855('0x5d')],null))[_0xf855('0x22')](respondWithResult(_0x31aac8,null))['catch'](handleError(_0x31aac8,null));};exports[_0xf855('0x3a')]=function(_0x27ea43,_0x1c7716){return db['SmsMessage'][_0xf855('0x5b')]({'where':{'id':_0x27ea43[_0xf855('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1c7716,null))['then'](removeEntity(_0x1c7716,null))['catch'](handleError(_0x1c7716,null));};exports[_0xf855('0x5e')]=function(_0x346f60,_0x3aced6){return db[_0xf855('0x3f')][_0xf855('0x5e')]()['then'](respondWithResult(_0x3aced6,null))[_0xf855('0x2c')](handleError(_0x3aced6,null));};var interaction_log=require(_0xf855('0x16'))(_0xf855('0x5f'));exports[_0xf855('0x60')]=function(_0x4c2392,_0x2f071b,_0x2b6001){var _0x31ebfd={'agent':{},'channel':_0xf855('0x61')};if(_0x4c2392['body']['id']){delete _0x4c2392[_0xf855('0x5d')]['id'];}_0x4c2392[_0xf855('0x5d')][_0xf855('0x62')]=!![];_0x4c2392[_0xf855('0x5d')]['readAt']=moment()['format'](_0xf855('0x63'));_0x4c2392[_0xf855('0x5d')][_0xf855('0x64')]=_0x4c2392[_0xf855('0x5d')][_0xf855('0x64')]||_0x4c2392['user']['id'];_0x31ebfd['agent']['id']=_0x4c2392[_0xf855('0x5d')]['UserId'];return db[_0xf855('0x3f')][_0xf855('0x5b')]({'where':{'id':_0x4c2392[_0xf855('0x5a')]['id'],'UserId':null}})[_0xf855('0x22')](handleEntityNotFound(_0x2f071b,null))[_0xf855('0x22')](saveUpdates(_0x4c2392['body'],null))[_0xf855('0x22')](function(_0x5d0212){if(_0x5d0212){_0x31ebfd[_0xf855('0x2a')]=_0x5d0212[_0xf855('0x65')]({'plain':!![]});return db[_0xf855('0x66')][_0xf855('0x5b')]({'where':{'id':_0x5d0212[_0xf855('0x67')]}});}return null;})[_0xf855('0x22')](handleEntityNotFound(_0x2f071b,null))[_0xf855('0x22')](function(_0x4ac8cc){if(_0x4ac8cc){return _0x4ac8cc[_0xf855('0x39')]({'UserId':_0x4c2392['body'][_0xf855('0x64')],'read1stAt':_[_0xf855('0x68')](_0x4ac8cc[_0xf855('0x69')])?moment()[_0xf855('0x6a')](_0xf855('0x63')):undefined});}return null;})[_0xf855('0x22')](function(_0xf7d372){if(_0xf7d372){_0x31ebfd[_0xf855('0x6b')]=_0xf7d372[_0xf855('0x65')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c2392['user']['id'],_0x4c2392[_0xf855('0x6c')][_0xf855('0x3d')],_0x4c2392['user'][_0xf855('0x6d')],_0x31ebfd[_0xf855('0x6b')]['id'],_0x4c2392['body']?JSON[_0xf855('0x26')](_0x4c2392[_0xf855('0x5d')]):_0xf855('0x6e'));return respondWithRpcPromise(_0xf855('0x6f'),_0xf855('0x70'),_0x31ebfd);}return null;})['then'](function(_0x3eb368){var _0x48ccd3=_0xf855('0x71')+_0x3eb368[_0xf855('0x2a')]['ContactId'];return db[_0xf855('0x72')][_0xf855('0x45')](_0x48ccd3,{'type':db['Sequelize'][_0xf855('0x73')][_0xf855('0x74')],'raw':!![]})[_0xf855('0x22')](function(_0x267af9){return _0x267af9;});})[_0xf855('0x22')](function(_0x39ffb8){if(_0x39ffb8){_0x31ebfd['message'][_0xf855('0x75')]=_0x39ffb8[0x0];if(!_0x4c2392[_0xf855('0x5d')][_0xf855('0x64')])return;return db[_0xf855('0x76')]['find']({'where':{'id':_0x4c2392[_0xf855('0x5d')][_0xf855('0x64')],'role':_0xf855('0x77')},'attributes':['id',_0xf855('0x3d'),_0xf855('0x78'),'email','internal'],'raw':!![]});}return null;})[_0xf855('0x22')](function(_0xaaced0){if(!_0xaaced0)return null;_0x31ebfd[_0xf855('0x2a')]['agent']=_0xaaced0;return _0x31ebfd;})['then'](function(_0x4efdb6){if(_0x4efdb6){if(_0x4c2392[_0xf855('0x5d')][_0xf855('0x79')]){_0x31ebfd[_0xf855('0x2a')][_0xf855('0x7a')]=util[_0xf855('0x6a')](_0xf855('0x7b'),_0x4c2392[_0xf855('0x6c')]['name']);_0x31ebfd[_0xf855('0x2a')][_0xf855('0x7c')]=_0x31ebfd[_0xf855('0x7c')];_0x31ebfd[_0xf855('0x2a')][_0xf855('0x7d')]=_0x31ebfd[_0xf855('0x7c')];_0x31ebfd[_0xf855('0x2a')]['event']=_0xf855('0x60');return respondWithRpcPromise(_0xf855('0x7e'),'EventManager',{'event':_0xf855('0x7f'),'message':_0x31ebfd[_0xf855('0x2a')]},client9002)[_0xf855('0x22')](function(){return _0x31ebfd;});}return _0x31ebfd;}return null;})[_0xf855('0x22')](respondWithResult(_0x2f071b,null))[_0xf855('0x2c')](handleError(_0x2f071b,null));};var interaction_log=require(_0xf855('0x16'))(_0xf855('0x5f'));exports['reject']=function(_0x1afc2d,_0xf8a501,_0xb83ff){var _0x28b839={'agent':{},'channel':_0xf855('0x61')};if(_0x1afc2d[_0xf855('0x5d')]['id']){delete _0x1afc2d[_0xf855('0x5d')]['id'];}_0x1afc2d[_0xf855('0x5d')][_0xf855('0x64')]=_0x1afc2d[_0xf855('0x5d')][_0xf855('0x64')]||_0x1afc2d[_0xf855('0x6c')]['id'];_0x28b839[_0xf855('0x77')]['id']=_0x1afc2d['body'][_0xf855('0x64')];return db[_0xf855('0x3f')][_0xf855('0x5b')]({'where':{'id':_0x1afc2d[_0xf855('0x5a')]['id'],'UserId':null}})[_0xf855('0x22')](handleEntityNotFound(_0xf8a501,null))[_0xf855('0x22')](function(_0x3420a3){if(_0x3420a3){_0x28b839[_0xf855('0x2a')]=_0x3420a3['get']({'plain':!![]});return db[_0xf855('0x66')]['find']({'where':{'id':_0x3420a3[_0xf855('0x67')]}});}return null;})[_0xf855('0x22')](handleEntityNotFound(_0xf8a501,null))[_0xf855('0x22')](function(_0x3cc48f){if(_0x3cc48f){_0x28b839['interaction']=_0x3cc48f[_0xf855('0x65')]({'plain':!![]});interaction_log[_0xf855('0x2b')](_0xf855('0x80'),_0x1afc2d[_0xf855('0x6c')]['id'],_0x1afc2d[_0xf855('0x6c')][_0xf855('0x3d')],_0x1afc2d[_0xf855('0x6c')][_0xf855('0x6d')],_0x28b839['interaction']['id'],_0x1afc2d[_0xf855('0x5d')]?JSON[_0xf855('0x26')](_0x1afc2d[_0xf855('0x5d')]):_0xf855('0x6e'));return respondWithRpcPromise(_0xf855('0x81'),_0xf855('0x82'),_0x28b839);}return null;})[_0xf855('0x22')](function(_0x2a11c4){var _0x44a998=_0xf855('0x71')+_0x2a11c4[_0xf855('0x2a')]['ContactId'];return db[_0xf855('0x72')]['query'](_0x44a998,{'type':db['Sequelize'][_0xf855('0x73')][_0xf855('0x74')],'raw':!![]})[_0xf855('0x22')](function(_0x51a09b){return _0x51a09b;});})[_0xf855('0x22')](function(_0xcdb91b){if(_0xcdb91b){_0x28b839[_0xf855('0x2a')][_0xf855('0x75')]=_0xcdb91b[0x0];if(!_0x1afc2d[_0xf855('0x5d')][_0xf855('0x64')])return;return db[_0xf855('0x76')]['find']({'where':{'id':_0x1afc2d[_0xf855('0x5d')][_0xf855('0x64')],'role':_0xf855('0x77')},'attributes':['id',_0xf855('0x3d'),_0xf855('0x78'),_0xf855('0x83'),_0xf855('0x84')],'raw':!![]});}return null;})['then'](function(_0x2358c4){if(!_0x2358c4)return null;_0x28b839[_0xf855('0x2a')][_0xf855('0x77')]=_0x2358c4;return _0x28b839;})['then'](function(_0x3634c2){if(_0x3634c2){_0x3634c2[_0xf855('0x2a')]['interface']=util[_0xf855('0x6a')]('SIP/%s',_0x1afc2d[_0xf855('0x6c')][_0xf855('0x3d')]);_0x3634c2[_0xf855('0x2a')]['channel']=_0x28b839[_0xf855('0x7c')];_0x3634c2[_0xf855('0x2a')]['motionChannel']=_0x28b839[_0xf855('0x7c')];_0x3634c2[_0xf855('0x2a')][_0xf855('0x85')]=_0xf855('0x37');respondWithRpcPromise(_0xf855('0x7e'),_0xf855('0x7e'),{'event':_0xf855('0x86'),'message':_0x3634c2['message']},client9002);return _0x28b839;}return null;})[_0xf855('0x22')](respondWithResult(_0xf8a501,null))[_0xf855('0x2c')](handleError(_0xf8a501,null));};exports[_0xf855('0x2e')]=function(_0x421ae1,_0x3a5ede,_0x2d7a36){if(_0x421ae1[_0xf855('0x5d')]['id']){delete _0x421ae1['body']['id'];}var _0x24d578;return db[_0xf855('0x3f')][_0xf855('0x5b')]({'where':{'id':_0x421ae1[_0xf855('0x5a')]['id']}})[_0xf855('0x22')](handleEntityNotFound(_0x3a5ede,null))[_0xf855('0x22')](function(_0x5ec2c1){if(_0x5ec2c1){_0x24d578=_0x5ec2c1;return db[_0xf855('0x87')][_0xf855('0x5b')]({'where':{'id':_0x5ec2c1[_0xf855('0x88')]}});}})[_0xf855('0x22')](handleEntityNotFound(_0x3a5ede,null))[_0xf855('0x22')](function(_0x52bdf0){if(_0x52bdf0){logger[_0xf855('0x24')](_0xf855('0x25'),_0xf855('0x2e'),_0xf855('0x89'),_0x52bdf0['type'],util[_0xf855('0x8a')](_0x421ae1[_0xf855('0x5d')],{'showHidden':![],'depth':null}));switch(_0x52bdf0[_0xf855('0x42')]){case _0xf855('0x8b'):if(_0x421ae1[_0xf855('0x5d')]['MessageSid']&&_0x421ae1[_0xf855('0x5d')][_0xf855('0x8c')]===_0x24d578[_0xf855('0x8d')]){return _0x24d578['update']({'read':!![]});}else{logger[_0xf855('0x27')](_0xf855('0x8e'),_0xf855('0x2e'),_0xf855('0x8b'),util['inspect'](_0x421ae1[_0xf855('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xf855('0x8f'):if(_0x421ae1[_0xf855('0x5d')][_0xf855('0x90')]&&_0x421ae1['body'][_0xf855('0x90')]===_0x24d578[_0xf855('0x8d')]&&_[_0xf855('0x91')]([_0xf855('0x92'),'delivered'],_0x421ae1['body'][_0xf855('0x93')])>=0x0){return _0x24d578[_0xf855('0x39')]({'read':!![]});}else{logger[_0xf855('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf855('0x2e'),_0xf855('0x94'),util['inspect'](_0x421ae1[_0xf855('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xf855('0x95'):var _0x335d78=_0x421ae1[_0xf855('0x5d')][_0xf855('0x96')][0x0];if(_0x335d78[_0xf855('0x2e')][_0xf855('0x97')]===_0xf855('0x98')){return _0x24d578[_0xf855('0x39')]({'read':!![]});}else{logger[_0xf855('0x27')](_0xf855('0x8e'),'status',_0xf855('0x95'),util[_0xf855('0x8a')](_0x421ae1[_0xf855('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x24d578;}})[_0xf855('0x22')](respondWithResult(_0x3a5ede,null))[_0xf855('0x2c')](handleError(_0x3a5ede,null));}; \ No newline at end of file +var _0x18c9=['sequelize','QueryTypes','SELECT','internal','interface','motionChannel','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','SmsMessage','findAll','rows','show','create','body','params','destroy','find','describe','sms-interactions','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','contact','User','fullname','email','manual','SIP/%s','channel','event','accept','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId'];(function(_0x5a2f36,_0x26d664){var _0x1956ec=function(_0xad0b6f){while(--_0xad0b6f){_0x5a2f36['push'](_0x5a2f36['shift']());}};_0x1956ec(++_0x26d664);}(_0x18c9,0x13c));var _0x918c=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x18c9[_0x16771d];return _0x386f11;};'use strict';var emlformat=require(_0x918c('0x0'));var rimraf=require(_0x918c('0x1'));var zipdir=require(_0x918c('0x2'));var jsonpatch=require(_0x918c('0x3'));var rp=require(_0x918c('0x4'));var moment=require(_0x918c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x918c('0x6'));var util=require(_0x918c('0x7'));var path=require('path');var sox=require(_0x918c('0x8'));var csv=require('to-csv');var ejs=require(_0x918c('0x9'));var fs=require('fs');var fs_extra=require(_0x918c('0xa'));var _=require(_0x918c('0xb'));var squel=require(_0x918c('0xc'));var crypto=require(_0x918c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x918c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x918c('0xf'));var Redis=require(_0x918c('0x10'));var authService=require(_0x918c('0x11'));var qs=require(_0x918c('0x12'));var as=require(_0x918c('0x13'));var hardwareService=require(_0x918c('0x14'));var logger=require(_0x918c('0x15'))(_0x918c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x918c('0x17'));var db=require(_0x918c('0x18'))['db'];config[_0x918c('0x19')]=_[_0x918c('0x1a')](config[_0x918c('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x918c('0x1b'))(new Redis(config[_0x918c('0x19')]));require(_0x918c('0x1c'))[_0x918c('0x1d')](socket);var jayson=require(_0x918c('0x1e'));var client=jayson[_0x918c('0x1f')][_0x918c('0x20')]({'port':0x232c});var client9002=jayson[_0x918c('0x1f')][_0x918c('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x50d54d,_0x51b1bd,_0x50f880,_0x5baa51){return new BPromise(function(_0x4fa363,_0x19d3eb){var _0x54f9fa=_0x5baa51||client;return _0x54f9fa[_0x918c('0x21')](_0x50d54d,_0x50f880)[_0x918c('0x22')](function(_0x215eb8){logger['info']('SmsMessage,\x20%s,\x20%s',_0x51b1bd,_0x918c('0x23'));logger[_0x918c('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x51b1bd,_0x918c('0x23'),JSON[_0x918c('0x25')](_0x215eb8));if(_0x215eb8[_0x918c('0x26')]){if(_0x215eb8[_0x918c('0x26')]['code']===0x1f4){logger[_0x918c('0x26')](_0x918c('0x27'),_0x51b1bd,_0x215eb8['error']['message']);return _0x19d3eb(_0x215eb8[_0x918c('0x26')]['message']);}logger['error'](_0x918c('0x27'),_0x51b1bd,_0x215eb8['error'][_0x918c('0x28')]);return _0x4fa363(_0x215eb8[_0x918c('0x26')]['message']);}else{logger[_0x918c('0x29')](_0x918c('0x27'),_0x51b1bd,_0x918c('0x23'));_0x4fa363(_0x215eb8[_0x918c('0x2a')]['message']);}})[_0x918c('0x2b')](function(_0x8577fe){logger[_0x918c('0x26')](_0x918c('0x27'),_0x51b1bd,_0x8577fe);_0x19d3eb(_0x8577fe);});});}function respondWithStatusCode(_0x124e3d,_0xebf958){_0xebf958=_0xebf958||0xcc;return function(_0x4cf95c){if(_0x4cf95c){return _0x124e3d[_0x918c('0x2c')](_0xebf958);}return _0x124e3d[_0x918c('0x2d')](_0xebf958)[_0x918c('0x2e')]();};}function respondWithResult(_0x11e8bf,_0x481fd7){_0x481fd7=_0x481fd7||0xc8;return function(_0x194e7e){if(_0x194e7e){return _0x11e8bf[_0x918c('0x2d')](_0x481fd7)['json'](_0x194e7e);}};}function respondWithFilteredResult(_0x2af472,_0x2ffb5f){return function(_0x1f4f17){if(_0x1f4f17){var _0x146579=typeof _0x2ffb5f[_0x918c('0x2f')]===_0x918c('0x30')&&typeof _0x2ffb5f[_0x918c('0x31')]===_0x918c('0x30');var _0x1372a1=_0x1f4f17[_0x918c('0x32')];var _0x48d5da=_0x146579?0x0:_0x2ffb5f[_0x918c('0x2f')];var _0x38c253=_0x146579?_0x1f4f17['count']:_0x2ffb5f['offset']+_0x2ffb5f[_0x918c('0x31')];var _0x2cba74;if(_0x38c253>=_0x1372a1){_0x38c253=_0x1372a1;_0x2cba74=0xc8;}else{_0x2cba74=0xce;}_0x2af472[_0x918c('0x2d')](_0x2cba74);return _0x2af472['set'](_0x918c('0x33'),_0x48d5da+'-'+_0x38c253+'/'+_0x1372a1)['json'](_0x1f4f17);}return null;};}function patchUpdates(_0x1d5a3c){return function(_0x133e7b){try{jsonpatch[_0x918c('0x34')](_0x133e7b,_0x1d5a3c,!![]);}catch(_0x2c7693){return BPromise[_0x918c('0x35')](_0x2c7693);}return _0x133e7b['save']();};}function saveUpdates(_0x18b46a,_0x593c0e){return function(_0x46555a){if(_0x46555a){return _0x46555a[_0x918c('0x36')](_0x18b46a)[_0x918c('0x22')](function(_0x1cff82){return _0x1cff82;});}return null;};}function removeEntity(_0x57271a,_0x5f4a85){return function(_0x1ca273){if(_0x1ca273){return _0x1ca273['destroy']()[_0x918c('0x22')](function(){_0x57271a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19658d,_0x2d8aea){return function(_0x8e6fdd){if(!_0x8e6fdd){_0x19658d['sendStatus'](0x194);}return _0x8e6fdd;};}function handleError(_0x511fb1,_0x415122){_0x415122=_0x415122||0x1f4;return function(_0x29c3a3){logger['error'](_0x29c3a3[_0x918c('0x37')]);if(_0x29c3a3[_0x918c('0x38')]){delete _0x29c3a3[_0x918c('0x38')];}_0x511fb1[_0x918c('0x2d')](_0x415122)[_0x918c('0x39')](_0x29c3a3);};}exports['index']=function(_0x270b4d,_0x330223){var _0x5ed510={},_0x41feaa={},_0x581b93={'count':0x0,'rows':[]};var _0x6b753e=_[_0x918c('0x3a')](db['SmsMessage'][_0x918c('0x3b')],function(_0x459caa){return{'name':_0x459caa[_0x918c('0x3c')],'type':_0x459caa[_0x918c('0x3d')][_0x918c('0x3e')]};});_0x41feaa[_0x918c('0x3f')]=_[_0x918c('0x3a')](_0x6b753e,_0x918c('0x38'));_0x41feaa[_0x918c('0x40')]=_[_0x918c('0x41')](_0x270b4d['query']);_0x41feaa[_0x918c('0x42')]=_[_0x918c('0x43')](_0x41feaa[_0x918c('0x3f')],_0x41feaa[_0x918c('0x40')]);_0x5ed510[_0x918c('0x44')]=_['intersection'](_0x41feaa[_0x918c('0x3f')],qs[_0x918c('0x45')](_0x270b4d[_0x918c('0x40')][_0x918c('0x45')]));_0x5ed510[_0x918c('0x44')]=_0x5ed510['attributes'][_0x918c('0x46')]?_0x5ed510[_0x918c('0x44')]:_0x41feaa[_0x918c('0x3f')];if(!_0x270b4d['query'][_0x918c('0x47')]('nolimit')){_0x5ed510[_0x918c('0x31')]=qs[_0x918c('0x31')](_0x270b4d[_0x918c('0x40')][_0x918c('0x31')]);_0x5ed510['offset']=qs[_0x918c('0x2f')](_0x270b4d[_0x918c('0x40')][_0x918c('0x2f')]);}_0x5ed510[_0x918c('0x48')]=qs['sort'](_0x270b4d[_0x918c('0x40')][_0x918c('0x49')]);_0x5ed510[_0x918c('0x4a')]=qs['filters'](_[_0x918c('0x4b')](_0x270b4d['query'],_0x41feaa[_0x918c('0x42')]),_0x6b753e);if(_0x270b4d[_0x918c('0x40')][_0x918c('0x4c')]){_0x5ed510[_0x918c('0x4a')]=_[_0x918c('0x4d')](_0x5ed510[_0x918c('0x4a')],{'$or':_[_0x918c('0x3a')](_0x6b753e,function(_0x1ec06d){if(_0x1ec06d[_0x918c('0x3d')]!=='VIRTUAL'){var _0x1a84ce={};_0x1a84ce[_0x1ec06d[_0x918c('0x38')]]={'$like':'%'+_0x270b4d[_0x918c('0x40')][_0x918c('0x4c')]+'%'};return _0x1a84ce;}})});}_0x5ed510=_[_0x918c('0x4d')]({},_0x5ed510,_0x270b4d[_0x918c('0x4e')]);var _0x5b92c3={'where':_0x5ed510[_0x918c('0x4a')]};return db['SmsMessage'][_0x918c('0x32')](_0x5b92c3)[_0x918c('0x22')](function(_0x1450ec){_0x581b93[_0x918c('0x32')]=_0x1450ec;if(_0x270b4d[_0x918c('0x40')][_0x918c('0x4f')]){_0x5ed510[_0x918c('0x50')]=[{'all':!![]}];}return db[_0x918c('0x51')][_0x918c('0x52')](_0x5ed510);})[_0x918c('0x22')](function(_0x5d3194){_0x581b93[_0x918c('0x53')]=_0x5d3194;return _0x581b93;})[_0x918c('0x22')](respondWithFilteredResult(_0x330223,_0x5ed510))['catch'](handleError(_0x330223,null));};exports[_0x918c('0x54')]=function(_0x926a62,_0x3601c9){var _0x22603a={'raw':!![],'where':{'id':_0x926a62['params']['id']}},_0x2f131f={};_0x2f131f['model']=_[_0x918c('0x41')](db[_0x918c('0x51')][_0x918c('0x3b')]);_0x2f131f[_0x918c('0x40')]=_['keys'](_0x926a62[_0x918c('0x40')]);_0x2f131f[_0x918c('0x42')]=_[_0x918c('0x43')](_0x2f131f[_0x918c('0x3f')],_0x2f131f['query']);_0x22603a[_0x918c('0x44')]=_['intersection'](_0x2f131f['model'],qs[_0x918c('0x45')](_0x926a62['query'][_0x918c('0x45')]));_0x22603a[_0x918c('0x44')]=_0x22603a['attributes']['length']?_0x22603a[_0x918c('0x44')]:_0x2f131f['model'];if(_0x926a62[_0x918c('0x40')]['includeAll']){_0x22603a[_0x918c('0x50')]=[{'all':!![]}];}_0x22603a=_[_0x918c('0x4d')]({},_0x22603a,_0x926a62[_0x918c('0x4e')]);return db[_0x918c('0x51')]['find'](_0x22603a)[_0x918c('0x22')](handleEntityNotFound(_0x3601c9,null))[_0x918c('0x22')](respondWithResult(_0x3601c9,null))['catch'](handleError(_0x3601c9,null));};exports[_0x918c('0x55')]=function(_0x442810,_0x3d7b93){return db[_0x918c('0x51')]['create'](_0x442810[_0x918c('0x56')],{})[_0x918c('0x22')](respondWithResult(_0x3d7b93,0xc9))[_0x918c('0x2b')](handleError(_0x3d7b93,null));};exports[_0x918c('0x36')]=function(_0x469a46,_0x3566fa){if(_0x469a46[_0x918c('0x56')]['id']){delete _0x469a46[_0x918c('0x56')]['id'];}return db[_0x918c('0x51')]['find']({'where':{'id':_0x469a46[_0x918c('0x57')]['id']}})[_0x918c('0x22')](handleEntityNotFound(_0x3566fa,null))[_0x918c('0x22')](saveUpdates(_0x469a46['body'],null))[_0x918c('0x22')](respondWithResult(_0x3566fa,null))[_0x918c('0x2b')](handleError(_0x3566fa,null));};exports[_0x918c('0x58')]=function(_0x214fb3,_0x1be1b0){return db[_0x918c('0x51')][_0x918c('0x59')]({'where':{'id':_0x214fb3['params']['id']}})[_0x918c('0x22')](handleEntityNotFound(_0x1be1b0,null))['then'](removeEntity(_0x1be1b0,null))['catch'](handleError(_0x1be1b0,null));};exports[_0x918c('0x5a')]=function(_0x1d317e,_0x39ef96){return db['SmsMessage'][_0x918c('0x5a')]()[_0x918c('0x22')](respondWithResult(_0x39ef96,null))['catch'](handleError(_0x39ef96,null));};var interaction_log=require(_0x918c('0x15'))(_0x918c('0x5b'));exports['accept']=function(_0x31fd14,_0x14a0de,_0xba4df4){var _0x39f98={'agent':{},'channel':'sms'};if(_0x31fd14[_0x918c('0x56')]['id']){delete _0x31fd14[_0x918c('0x56')]['id'];}_0x31fd14[_0x918c('0x56')][_0x918c('0x5c')]=!![];_0x31fd14[_0x918c('0x56')]['readAt']=moment()['format'](_0x918c('0x5d'));_0x31fd14['body'][_0x918c('0x5e')]=_0x31fd14[_0x918c('0x56')][_0x918c('0x5e')]||_0x31fd14[_0x918c('0x5f')]['id'];_0x39f98[_0x918c('0x60')]['id']=_0x31fd14['body'][_0x918c('0x5e')];return db['SmsMessage'][_0x918c('0x59')]({'where':{'id':_0x31fd14[_0x918c('0x57')]['id'],'UserId':null}})[_0x918c('0x22')](handleEntityNotFound(_0x14a0de,null))[_0x918c('0x22')](saveUpdates(_0x31fd14[_0x918c('0x56')],null))['then'](function(_0x5bce7f){if(_0x5bce7f){_0x39f98[_0x918c('0x28')]=_0x5bce7f['get']({'plain':!![]});return db[_0x918c('0x61')]['find']({'where':{'id':_0x5bce7f[_0x918c('0x62')]}});}return null;})[_0x918c('0x22')](handleEntityNotFound(_0x14a0de,null))[_0x918c('0x22')](function(_0xb0eec2){if(_0xb0eec2){return _0xb0eec2[_0x918c('0x36')]({'UserId':_0x31fd14[_0x918c('0x56')][_0x918c('0x5e')],'read1stAt':_[_0x918c('0x63')](_0xb0eec2[_0x918c('0x64')])?moment()[_0x918c('0x65')](_0x918c('0x5d')):undefined});}return null;})[_0x918c('0x22')](function(_0x5edfbb){if(_0x5edfbb){_0x39f98['interaction']=_0x5edfbb[_0x918c('0x66')]({'plain':!![]});interaction_log[_0x918c('0x29')](_0x918c('0x67'),_0x31fd14['user']['id'],_0x31fd14[_0x918c('0x5f')][_0x918c('0x38')],_0x31fd14[_0x918c('0x5f')][_0x918c('0x68')],_0x39f98[_0x918c('0x69')]['id'],_0x31fd14[_0x918c('0x56')]?JSON[_0x918c('0x25')](_0x31fd14['body']):_0x918c('0x6a'));return respondWithRpcPromise(_0x918c('0x6b'),_0x918c('0x6c'),_0x39f98);}return null;})['then'](function(_0x3870b1){var _0x15fa08=_0x918c('0x6d')+_0x3870b1[_0x918c('0x28')]['ContactId'];return db['sequelize'][_0x918c('0x40')](_0x15fa08,{'type':db[_0x918c('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x1931c5){return _0x1931c5;});})[_0x918c('0x22')](function(_0x4e8263){if(_0x4e8263){_0x39f98[_0x918c('0x28')][_0x918c('0x6f')]=_0x4e8263[0x0];if(!_0x31fd14[_0x918c('0x56')][_0x918c('0x5e')])return;return db[_0x918c('0x70')][_0x918c('0x59')]({'where':{'id':_0x31fd14['body'][_0x918c('0x5e')],'role':'agent'},'attributes':['id','name',_0x918c('0x71'),_0x918c('0x72'),'internal'],'raw':!![]});}return null;})[_0x918c('0x22')](function(_0x4b99ca){if(!_0x4b99ca)return null;_0x39f98[_0x918c('0x28')][_0x918c('0x60')]=_0x4b99ca;return _0x39f98;})[_0x918c('0x22')](function(_0x24cac0){if(_0x24cac0){if(_0x31fd14[_0x918c('0x56')][_0x918c('0x73')]){_0x39f98[_0x918c('0x28')]['interface']=util[_0x918c('0x65')](_0x918c('0x74'),_0x31fd14[_0x918c('0x5f')][_0x918c('0x38')]);_0x39f98[_0x918c('0x28')][_0x918c('0x75')]=_0x39f98[_0x918c('0x75')];_0x39f98[_0x918c('0x28')]['motionChannel']=_0x39f98[_0x918c('0x75')];_0x39f98[_0x918c('0x28')][_0x918c('0x76')]=_0x918c('0x77');return respondWithRpcPromise(_0x918c('0x78'),_0x918c('0x78'),{'event':'acceptmessage','message':_0x39f98[_0x918c('0x28')]},client9002)[_0x918c('0x22')](function(){return _0x39f98;});}return _0x39f98;}return null;})[_0x918c('0x22')](respondWithResult(_0x14a0de,null))[_0x918c('0x2b')](handleError(_0x14a0de,null));};var interaction_log=require('../../config/logger')(_0x918c('0x5b'));exports[_0x918c('0x35')]=function(_0x3ca6bd,_0x3ad580,_0x10ae97){var _0x43bbd1={'agent':{},'channel':'sms'};if(_0x3ca6bd['body']['id']){delete _0x3ca6bd[_0x918c('0x56')]['id'];}_0x3ca6bd['body'][_0x918c('0x5e')]=_0x3ca6bd[_0x918c('0x56')][_0x918c('0x5e')]||_0x3ca6bd['user']['id'];_0x43bbd1[_0x918c('0x60')]['id']=_0x3ca6bd[_0x918c('0x56')][_0x918c('0x5e')];return db['SmsMessage'][_0x918c('0x59')]({'where':{'id':_0x3ca6bd[_0x918c('0x57')]['id'],'UserId':null}})[_0x918c('0x22')](handleEntityNotFound(_0x3ad580,null))[_0x918c('0x22')](function(_0x3b1b6f){if(_0x3b1b6f){_0x43bbd1[_0x918c('0x28')]=_0x3b1b6f['get']({'plain':!![]});return db[_0x918c('0x61')]['find']({'where':{'id':_0x3b1b6f[_0x918c('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x3ad580,null))[_0x918c('0x22')](function(_0x39f8b9){if(_0x39f8b9){_0x43bbd1[_0x918c('0x69')]=_0x39f8b9['get']({'plain':!![]});interaction_log['info'](_0x918c('0x79'),_0x3ca6bd[_0x918c('0x5f')]['id'],_0x3ca6bd['user']['name'],_0x3ca6bd[_0x918c('0x5f')][_0x918c('0x68')],_0x43bbd1[_0x918c('0x69')]['id'],_0x3ca6bd[_0x918c('0x56')]?JSON['stringify'](_0x3ca6bd[_0x918c('0x56')]):_0x918c('0x6a'));return respondWithRpcPromise(_0x918c('0x7a'),_0x918c('0x7b'),_0x43bbd1);}return null;})[_0x918c('0x22')](function(_0x4ba9b6){var _0x1ca78d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4ba9b6[_0x918c('0x28')][_0x918c('0x7c')];return db[_0x918c('0x7d')]['query'](_0x1ca78d,{'type':db['Sequelize'][_0x918c('0x7e')][_0x918c('0x7f')],'raw':!![]})[_0x918c('0x22')](function(_0x47ed1d){return _0x47ed1d;});})[_0x918c('0x22')](function(_0x194154){if(_0x194154){_0x43bbd1[_0x918c('0x28')][_0x918c('0x6f')]=_0x194154[0x0];if(!_0x3ca6bd[_0x918c('0x56')][_0x918c('0x5e')])return;return db['User']['find']({'where':{'id':_0x3ca6bd[_0x918c('0x56')]['UserId'],'role':_0x918c('0x60')},'attributes':['id',_0x918c('0x38'),'fullname',_0x918c('0x72'),_0x918c('0x80')],'raw':!![]});}return null;})[_0x918c('0x22')](function(_0xafc667){if(!_0xafc667)return null;_0x43bbd1[_0x918c('0x28')][_0x918c('0x60')]=_0xafc667;return _0x43bbd1;})[_0x918c('0x22')](function(_0x4e6cae){if(_0x4e6cae){_0x4e6cae[_0x918c('0x28')][_0x918c('0x81')]=util[_0x918c('0x65')](_0x918c('0x74'),_0x3ca6bd[_0x918c('0x5f')][_0x918c('0x38')]);_0x4e6cae[_0x918c('0x28')][_0x918c('0x75')]=_0x43bbd1[_0x918c('0x75')];_0x4e6cae[_0x918c('0x28')][_0x918c('0x82')]=_0x43bbd1['channel'];_0x4e6cae[_0x918c('0x28')][_0x918c('0x76')]='reject';respondWithRpcPromise(_0x918c('0x78'),_0x918c('0x78'),{'event':'rejectmessage','message':_0x4e6cae[_0x918c('0x28')]},client9002);return _0x43bbd1;}return null;})[_0x918c('0x22')](respondWithResult(_0x3ad580,null))[_0x918c('0x2b')](handleError(_0x3ad580,null));};exports['status']=function(_0x3b9e96,_0x4a74aa,_0x53a648){if(_0x3b9e96['body']['id']){delete _0x3b9e96[_0x918c('0x56')]['id'];}var _0x1d5756;return db[_0x918c('0x51')]['find']({'where':{'id':_0x3b9e96['params']['id']}})[_0x918c('0x22')](handleEntityNotFound(_0x4a74aa,null))[_0x918c('0x22')](function(_0x3c6e56){if(_0x3c6e56){_0x1d5756=_0x3c6e56;return db[_0x918c('0x83')][_0x918c('0x59')]({'where':{'id':_0x3c6e56[_0x918c('0x84')]}});}})[_0x918c('0x22')](handleEntityNotFound(_0x4a74aa,null))[_0x918c('0x22')](function(_0x3b7b9d){if(_0x3b7b9d){logger[_0x918c('0x24')](_0x918c('0x85'),_0x918c('0x2d'),_0x918c('0x86'),_0x3b7b9d[_0x918c('0x3d')],util['inspect'](_0x3b9e96[_0x918c('0x56')],{'showHidden':![],'depth':null}));switch(_0x3b7b9d['type']){case _0x918c('0x87'):if(_0x3b9e96[_0x918c('0x56')][_0x918c('0x88')]&&_0x3b9e96[_0x918c('0x56')][_0x918c('0x88')]===_0x1d5756[_0x918c('0x89')]){return _0x1d5756[_0x918c('0x36')]({'read':!![]});}else{logger[_0x918c('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x918c('0x2d'),_0x918c('0x87'),util['inspect'](_0x3b9e96['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3b9e96[_0x918c('0x56')][_0x918c('0x8a')]&&_0x3b9e96[_0x918c('0x56')]['MessageUUID']===_0x1d5756['messageId']&&_[_0x918c('0x8b')]([_0x918c('0x8c'),_0x918c('0x8d')],_0x3b9e96[_0x918c('0x56')]['Status'])>=0x0){return _0x1d5756['update']({'read':!![]});}else{logger['error'](_0x918c('0x8e'),_0x918c('0x2d'),_0x918c('0x8f'),util['inspect'](_0x3b9e96[_0x918c('0x56')],{'showHidden':![],'depth':null}));}break;case _0x918c('0x90'):var _0x5a71d4=_0x3b9e96[_0x918c('0x56')]['results'][0x0];if(_0x5a71d4[_0x918c('0x2d')][_0x918c('0x91')]===_0x918c('0x92')){return _0x1d5756[_0x918c('0x36')]({'read':!![]});}else{logger[_0x918c('0x26')](_0x918c('0x8e'),_0x918c('0x2d'),_0x918c('0x90'),util['inspect'](_0x3b9e96[_0x918c('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x1d5756;}})[_0x918c('0x22')](respondWithResult(_0x4a74aa,null))[_0x918c('0x2b')](handleError(_0x4a74aa,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 1d82424..4fc18b0 100644 --- a/server/api/smsMessage/smsMessage.events.js +++ b/server/api/smsMessage/smsMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5ef=['hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit'];(function(_0x33b13d,_0x3a04a2){var _0x2a7ed3=function(_0x8e8c4a){while(--_0x8e8c4a){_0x33b13d['push'](_0x33b13d['shift']());}};_0x2a7ed3(++_0x3a04a2);}(_0xd5ef,0x12e));var _0xfd5e=function(_0x52bd65,_0x160646){_0x52bd65=_0x52bd65-0x0;var _0x13fd57=_0xd5ef[_0x52bd65];return _0x13fd57;};'use strict';var EventEmitter=require(_0xfd5e('0x0'));var SmsMessage=require(_0xfd5e('0x1'))['db'][_0xfd5e('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xfd5e('0x3')](0x0);var events={'afterCreate':_0xfd5e('0x4'),'afterUpdate':_0xfd5e('0x5'),'afterDestroy':_0xfd5e('0x6')};function emitEvent(_0x48c511){return function(_0xdfa2fe,_0x3a242b,_0x1b1b33){SmsMessageEvents[_0xfd5e('0x7')](_0x48c511+':'+_0xdfa2fe['id'],_0xdfa2fe);SmsMessageEvents['emit'](_0x48c511,_0xdfa2fe);_0x1b1b33(null);};}for(var e in events){if(events[_0xfd5e('0x8')](e)){var event=events[e];SmsMessage[_0xfd5e('0x9')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x6532=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x6532,0xf8));var _0x2653=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0x6532[_0x32e264];return _0x1d7175;};'use strict';var EventEmitter=require(_0x2653('0x0'));var SmsMessage=require(_0x2653('0x1'))['db'][_0x2653('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2653('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2653('0x4'),'afterDestroy':_0x2653('0x5')};function emitEvent(_0x576a93){return function(_0x118d0b,_0x4c6ff9,_0xd624ca){SmsMessageEvents[_0x2653('0x6')](_0x576a93+':'+_0x118d0b['id'],_0x118d0b);SmsMessageEvents[_0x2653('0x6')](_0x576a93,_0x118d0b);_0xd624ca(null);};}for(var e in events){if(events[_0x2653('0x7')](e)){var event=events[e];SmsMessage[_0x2653('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 9b92099..bf8f520 100644 --- a/server/api/smsMessage/smsMessage.model.js +++ b/server/api/smsMessage/smsMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9df7=['https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','direction','toLowerCase','secret','isNil','SmsInteractionId','findOne','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','body','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','login?username=','&password=','GET','split','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','messages','message_id','clickSend','plivo','remote','/api/sms/messages/','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','/auth/1/session','baseUrl','/sms/2/text/advanced','IBSSO\x20','csc','apiKey','sender','text','timestamp','sort','length','digest','hex','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','bandwidth','applicationId','toString','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message'];(function(_0x404ff8,_0x239ef7){var _0x1abcf8=function(_0x408dae){while(--_0x408dae){_0x404ff8['push'](_0x404ff8['shift']());}};_0x1abcf8(++_0x239ef7);}(_0x9df7,0x1ef));var _0x79df=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9df7[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x79df('0x0'));var util=require(_0x79df('0x1'));var logger=require(_0x79df('0x2'))(_0x79df('0x3'));var moment=require(_0x79df('0x4'));var BPromise=require(_0x79df('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x79df('0x6'));var config=require(_0x79df('0x7'));var attributes=require(_0x79df('0x8'));module[_0x79df('0x9')]=function(_0x484d0c,_0x29ee10){return _0x484d0c[_0x79df('0xa')](_0x79df('0xb'),attributes,{'tableName':_0x79df('0xc'),'paranoid':![],'indexes':[{'name':_0x79df('0xd'),'fields':[_0x79df('0xd')]},{'name':_0x79df('0xe'),'fields':['body'],'type':_0x79df('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f4045,_0x1287f5,_0x2961c4){var _0x5e700c=_0x484d0c['models'];var _0x2c8287=_0x3f4045[_0x79df('0x10')]({'plain':!![]});if(_0x2c8287[_0x79df('0x11')][_0x79df('0x12')]()==='in'||_0x2c8287[_0x79df('0x11')][_0x79df('0x12')]()==='out'&&!_0x2c8287[_0x79df('0x13')]&&!_[_0x79df('0x14')](_0x2c8287['UserId'])&&!_[_0x79df('0x14')](_0x2c8287[_0x79df('0x15')])){_0x5e700c['SmsInteraction'][_0x79df('0x16')]({'where':{'id':_0x2c8287[_0x79df('0x15')]}})[_0x79df('0x17')](function(_0x555a17){if(_0x555a17){_0x555a17[_0x79df('0x18')]({'lastMsgAt':_0x2c8287[_0x79df('0x19')],'lastMsgDirection':_0x2c8287[_0x79df('0x11')]['toLowerCase']()});}})[_0x79df('0x1a')](function(_0x367f86){console[_0x79df('0x1b')](_0x367f86);});}if(_0x2c8287[_0x79df('0x11')]==='out'&&!_0x2c8287[_0x79df('0x13')]){var _0x4606ca;_0x5e700c[_0x79df('0x1c')][_0x79df('0x1d')]({'where':{'id':_0x2c8287[_0x79df('0x1e')]},'raw':!![]})[_0x79df('0x17')](function(_0x33779b){_0x4606ca=_0x33779b;if(_0x4606ca&&_0x4606ca['type']){switch(_0x4606ca[_0x79df('0x1f')]){case _0x79df('0x20'):var _0x2923d9=require(_0x79df('0x20'));if(_0x4606ca[_0x79df('0x21')]&&_0x4606ca['authToken']&&_0x4606ca[_0x79df('0x22')]){var _0x1b119f=new _0x2923d9(_0x4606ca[_0x79df('0x21')],_0x4606ca[_0x79df('0x23')]);_0x1b119f['messages']['create']({'body':_0x2c8287[_0x79df('0x24')],'to':_0x2c8287['phone'],'from':_0x4606ca[_0x79df('0x22')],'statusCallback':_0x4606ca['remote']+'/api/sms/messages/'+_0x2c8287['id']+_0x79df('0x25')+_0x4606ca[_0x79df('0x26')]})[_0x79df('0x17')](function(_0x14f36){if(_0x14f36[_0x79df('0x27')]){return _0x3f4045['update']({'messageId':_0x14f36[_0x79df('0x27')]});}})[_0x79df('0x1a')](function(_0x47f24c){logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x20'),util[_0x79df('0x2a')](_0x47f24c,{'showHidden':![],'depth':null}));});}else{logger[_0x79df('0x1b')](_0x79df('0x28'),'afterCreate',_0x79df('0x20'),_0x79df('0x2b'));}break;case _0x79df('0x2c'):var _0x5cb950='https://api.skebby.it/API/v1.0/REST/';if(_0x4606ca[_0x79df('0x2d')]&&_0x4606ca[_0x79df('0x2e')]){var _0x5a8040={'recipient':[_0x2c8287[_0x79df('0x22')]],'message':_0x2c8287[_0x79df('0x24')],'message_type':_0x4606ca[_0x79df('0x2f')]};if(_0x4606ca[_0x79df('0x2f')]&&_0x4606ca['smsMethod']!=='SI'){_0x5a8040['sender']=_0x4606ca[_0x79df('0x22')];}var _0x5d3b8a={'url':_0x5cb950+_0x79df('0x30')+_0x4606ca[_0x79df('0x2d')]+_0x79df('0x31')+_0x4606ca[_0x79df('0x2e')],'method':_0x79df('0x32')};rp(_0x5d3b8a)[_0x79df('0x17')](function(_0x3a5a94){var _0x390175=_0x3a5a94[_0x79df('0x33')](';');var _0x53ad46={'user_key':_0x390175[0x0],'session_key':_0x390175[0x1]};_0x5d3b8a={'url':_0x5cb950+'sms','method':_0x79df('0x34'),'headers':{'user_key':_0x53ad46[_0x79df('0x35')],'Session_key':_0x53ad46[_0x79df('0x36')]},'json':!![],'body':_0x5a8040};return rp(_0x5d3b8a);})['then'](function(_0x591a24){if(_0x591a24[_0x79df('0x37')]>=0x1){var _0x3d8f3d={'messageId':_0x591a24[_0x79df('0x38')]};if(_0x4606ca['smsMethod']!=='GP'||!_0x4606ca['deliveryReport']){_0x3d8f3d[_0x79df('0x39')]=!![];}return _0x3f4045[_0x79df('0x18')](_0x3d8f3d);}else{return logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x2c'),util[_0x79df('0x2a')](_0x591a24,{'showHidden':![],'depth':null}));}})[_0x79df('0x1a')](function(_0x3ca9d7){return logger[_0x79df('0x1b')](_0x79df('0x28'),'afterCreate',_0x79df('0x2c'),util[_0x79df('0x2a')](_0x3ca9d7,{'showHidden':![],'depth':null}));});}else{logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x2c'),_0x79df('0x3a'));}break;case _0x79df('0x3b'):if(_0x4606ca['authToken']){var _0x58a128={'recipient':_0x2c8287[_0x79df('0x22')],'message':_0x2c8287[_0x79df('0x24')],'sender':_0x4606ca[_0x79df('0x3c')]||_0x4606ca[_0x79df('0x22')],'authorization':_0x4606ca[_0x79df('0x23')]};var _0x1287f5={'method':_0x79df('0x34'),'uri':_0x79df('0x3d'),'body':_0x58a128,'json':!![]};rp(_0x1287f5)['then'](function(_0x35223c){var _0x2b974e={'messageId':_0x35223c[_0x79df('0x3e')]};if(!_0x4606ca[_0x79df('0x3f')]){_0x2b974e[_0x79df('0x39')]=!![];}return _0x3f4045[_0x79df('0x18')](_0x2b974e);})['catch'](function(_0x24bef9){logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),'connectel',util[_0x79df('0x2a')](_0x24bef9,{'showHidden':![],'depth':null}));});}else{logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),'connectel',_0x79df('0x40'));}break;case _0x79df('0x41'):if(_0x4606ca[_0x79df('0x2d')]&&_0x4606ca[_0x79df('0x2e')]){var _0x58a128={'messages':[{'source':_0x79df('0x42'),'to':_0x2c8287[_0x79df('0x22')],'body':_0x2c8287['body'],'from':_0x4606ca['senderString']||_0x4606ca[_0x79df('0x22')]}]};var _0x4d8481=util[_0x79df('0x43')](_0x79df('0x44'),_0x4606ca[_0x79df('0x2d')],_0x4606ca['password']);var _0x1287f5={'method':_0x79df('0x34'),'uri':_0x79df('0x45'),'body':_0x58a128,'headers':{'Authorization':util[_0x79df('0x43')]('Basic\x20%s',new Buffer(_0x4d8481)['toString'](_0x79df('0x46')))},'json':!![]};rp(_0x1287f5)[_0x79df('0x17')](function(_0x2361f5){if(_0x2361f5[_0x79df('0x47')]>=0xc8&&_0x2361f5['http_code']<=0xce){if(_0x2361f5['data']&&_0x2361f5[_0x79df('0x48')]['queued_count']>0x0){var _0x4513e3=_['head'](_0x2361f5[_0x79df('0x48')][_0x79df('0x49')]);var _0x14ee44={'messageId':_0x4513e3[_0x79df('0x4a')]};if(!_0x4606ca[_0x79df('0x3f')]){_0x14ee44[_0x79df('0x39')]=!![];}return _0x3f4045[_0x79df('0x18')](_0x14ee44);}else{logger[_0x79df('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x79df('0x29'),'clickSend',util[_0x79df('0x2a')](_0x2361f5,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x79df('0x29'),_0x79df('0x4b'),util[_0x79df('0x2a')](_0x2361f5,{'showHidden':![],'depth':null}));}})[_0x79df('0x1a')](function(_0x5aa115){logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x4b'),util[_0x79df('0x2a')](_0x5aa115,{'showHidden':![],'depth':null}));});}else{logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x4b'),_0x79df('0x3a'));}break;case _0x79df('0x4c'):if(_0x4606ca['authId']&&_0x4606ca[_0x79df('0x23')]){var _0x58a128={'dst':_0x2c8287[_0x79df('0x22')],'text':_0x2c8287[_0x79df('0x24')],'src':_0x4606ca[_0x79df('0x3c')]||_0x4606ca['phone'],'url':_0x4606ca[_0x79df('0x4d')]+_0x79df('0x4e')+_0x2c8287['id']+'/status?token='+_0x4606ca[_0x79df('0x26')]};var _0x4d8481=util['format'](_0x79df('0x44'),_0x4606ca[_0x79df('0x4f')],_0x4606ca['authToken']);var _0x1287f5={'method':_0x79df('0x34'),'uri':util[_0x79df('0x43')](_0x79df('0x50'),_0x4606ca[_0x79df('0x4f')]),'body':_0x58a128,'headers':{'Authorization':util[_0x79df('0x43')](_0x79df('0x51'),new Buffer(_0x4d8481)['toString'](_0x79df('0x46')))},'json':!![]};rp(_0x1287f5)[_0x79df('0x17')](function(_0x2d02ed){var _0x9a6565={'messageId':_0x2d02ed[_0x79df('0x52')][0x0]};return _0x3f4045[_0x79df('0x18')](_0x9a6565);})[_0x79df('0x1a')](function(_0x430098){logger['error'](_0x79df('0x28'),_0x79df('0x29'),'plivo',util['inspect'](_0x430098,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x4c'),_0x79df('0x53'));}break;case _0x79df('0x54'):if(_0x4606ca[_0x79df('0x2d')]&&_0x4606ca[_0x79df('0x2e')]){if(_0x4606ca['baseUrl']){var _0x4fbd7c={'method':_0x79df('0x34'),'uri':_0x4606ca['baseUrl']+_0x79df('0x55'),'body':{'username':_0x4606ca[_0x79df('0x2d')],'password':_0x4606ca[_0x79df('0x2e')]},'json':!![]};return rp(_0x4fbd7c)['then'](function(_0x3d1c6a){var _0x2a12b1={'method':'POST','uri':_0x4606ca[_0x79df('0x56')]+_0x79df('0x57'),'body':{'messages':[{'from':_0x4606ca[_0x79df('0x22')],'destinations':[{'to':_0x2c8287[_0x79df('0x22')]}],'text':_0x2c8287[_0x79df('0x24')],'notifyUrl':_0x4606ca[_0x79df('0x4d')]+_0x79df('0x4e')+_0x2c8287['id']+_0x79df('0x25')+_0x4606ca[_0x79df('0x26')],'notifyContentType':'application/json','callbackData':_0x4606ca['phone']+';'+_0x2c8287['body']}]},'headers':{'Authorization':_0x79df('0x58')+_0x3d1c6a[_0x79df('0x26')]},'json':!![]};return rp(_0x2a12b1)[_0x79df('0x17')](function(_0x147f21){if(_0x147f21[_0x79df('0x49')]){var _0x3170f7={'messageId':_0x147f21[_0x79df('0x49')][0x0][_0x79df('0xd')]};if(!_0x4606ca[_0x79df('0x3f')]){_0x3170f7[_0x79df('0x39')]=!![];}return _0x3f4045[_0x79df('0x18')](_0x3170f7);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x79df('0x29'),_0x79df('0x54'),util[_0x79df('0x2a')](_0x147f21,{'showHidden':![],'depth':null}));}});})['catch'](function(_0xdd4866){return logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x54'),util[_0x79df('0x2a')](_0xdd4866,{'showHidden':![],'depth':null}));});}else{logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x54'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x79df('0x28'),_0x79df('0x29'),'infobip',_0x79df('0x3a'));}break;case _0x79df('0x59'):var _0x18f974=require('crypto');if(_0x4606ca[_0x79df('0x5a')]){var _0x372335={};_0x372335['login']=_0x4606ca[_0x79df('0x2d')];_0x372335[_0x79df('0x22')]=_0x2c8287[_0x79df('0x22')];_0x372335[_0x79df('0x5b')]=_0x4606ca[_0x79df('0x22')];_0x372335[_0x79df('0x5c')]=_0x2c8287[_0x79df('0x24')];_0x372335[_0x79df('0x5d')]=+new Date();var _0x5c3beb='';var _0x47b6d6='';var _0x227107=Object['keys'](_0x372335);_0x227107[_0x79df('0x5e')]();for(var _0x143215=0x0;_0x143215<_0x227107[_0x79df('0x5f')];_0x143215++){if(_0x5c3beb!=''){_0x5c3beb+='&';}_0x5c3beb+=_0x227107[_0x143215]+'='+encodeURIComponent(_0x372335[_0x227107[_0x143215]]);_0x47b6d6+=_0x372335[_0x227107[_0x143215]];}_0x47b6d6+=_0x4606ca[_0x79df('0x5a')];_0x47b6d6=_0x18f974['createHash']('md5')['update'](_0x47b6d6)[_0x79df('0x60')](_0x79df('0x61'));if(_0x5c3beb!==''){_0x5c3beb+='&';}_0x5c3beb+=_0x79df('0x62')+_0x47b6d6;var _0x5d3b8a={'method':_0x79df('0x32'),'uri':_0x4606ca[_0x79df('0x56')]+_0x79df('0x63')+_0x5c3beb,'json':!![]};return rp(_0x5d3b8a)['then'](function(_0x204383){var _0x151aee=Object[_0x79df('0x64')](_0x204383);if(_0x204383[_0x151aee[0x0]][_0x79df('0x1b')]&&parseInt(_0x204383[_0x151aee[0x0]][_0x79df('0x1b')])===0x0){var _0xce0747={'messageId':_0x204383[_0x151aee[0x0]][_0x79df('0x65')]};if(!_0x4606ca[_0x79df('0x3f')]){_0xce0747[_0x79df('0x39')]=!![];}return _0x3f4045[_0x79df('0x18')](_0xce0747);}else{return logger[_0x79df('0x1b')](_0x79df('0x28'),'afterCreate',_0x79df('0x59'),util[_0x79df('0x2a')](_0x204383[_0x79df('0x1b')],{'showHidden':![],'depth':null}));}})[_0x79df('0x1a')](function(_0x34dd56){return logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),'csc',util['inspect'](_0x34dd56,{'showHidden':![],'depth':null}));});}else{logger[_0x79df('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x79df('0x29'),_0x79df('0x59'),_0x79df('0x66'));}break;case'clickatell':if(_0x4606ca[_0x79df('0x5a')]){var _0x57a6cf={'method':_0x79df('0x34'),'uri':_0x79df('0x67'),'headers':{'Authorization':_0x4606ca[_0x79df('0x5a')]},'body':{'content':_0x2c8287['body'],'to':[_0x2c8287[_0x79df('0x22')]],'from':_0x4606ca[_0x79df('0x22')],'binary':![],'clientMessageId':_0x79df('0x68'),'charset':_0x79df('0x69')},'json':!![]};rp(_0x57a6cf)[_0x79df('0x17')](function(_0x5d6933){if(!_0x5d6933['error']){var _0x413865={'messageId':_0x5d6933[_0x79df('0x49')][0x0][_0x79df('0x6a')]};if(!_0x4606ca['deliveryReport']){_0x413865[_0x79df('0x39')]=!![];}return _0x3f4045[_0x79df('0x18')](_0x413865);}else{return logger[_0x79df('0x1b')](_0x79df('0x28'),'afterCreate',_0x79df('0x6b'),util[_0x79df('0x2a')](_0x5d6933[_0x79df('0x1b')],{'showHidden':![],'depth':null}));}})[_0x79df('0x1a')](function(_0x55bb34){return logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x6b'),util['inspect'](_0x55bb34,{'showHidden':![],'depth':null}));});}else{logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x6b'),_0x79df('0x66'));}break;case _0x79df('0x6c'):if(_0x4606ca[_0x79df('0x2d')]&&_0x4606ca[_0x79df('0x2e')]){var _0x4d8481=util[_0x79df('0x43')]('%s:%s',_0x4606ca[_0x79df('0x2d')],_0x4606ca[_0x79df('0x2e')]);var _0x1287f5={'method':_0x79df('0x34'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4606ca['accountId']+'/messages','body':{'to':[_0x2c8287['phone']],'text':_0x2c8287['body'],'from':_0x4606ca[_0x79df('0x22')],'applicationId':_0x4606ca[_0x79df('0x6d')]},'headers':{'Authorization':util[_0x79df('0x43')](_0x79df('0x51'),new Buffer(_0x4d8481)[_0x79df('0x6e')]('base64'))},'json':!![]};rp(_0x1287f5)[_0x79df('0x17')](function(_0x34daf6){if(_0x34daf6['id']){var _0x4dcfbf={'messageId':_0x34daf6['id']};return _0x3f4045[_0x79df('0x18')](_0x4dcfbf);}else{logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x6c'),util[_0x79df('0x2a')](_0x34daf6,{'showHidden':![],'depth':null}));}})['catch'](function(_0x178363){logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x6c'),util[_0x79df('0x2a')](_0x178363,{'showHidden':![],'depth':null}));});}else{logger[_0x79df('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x79df('0x29'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x4606ca['apiKey']){var _0x5494b8={};var _0x5d3b8a={'method':_0x79df('0x34'),'uri':_0x79df('0x6f'),'headers':{'Authorization':_0x79df('0x70')+_0x4606ca['apiKey'],'Content-Type':_0x79df('0x71')},'body':{'from':_0x4606ca['phone'],'to':_0x2c8287[_0x79df('0x22')],'text':_0x2c8287[_0x79df('0x24')]},'json':!![]};return rp(_0x5d3b8a)['then'](function(_0x4c75b2){if(_0x4c75b2['code']==0xca){_0x5494b8[_0x79df('0x72')]=_0x4c75b2;var _0x23b884={'method':_0x79df('0x34'),'uri':_0x79df('0x73'),'headers':{'Authorization':_0x79df('0x70')+_0x4606ca['apiKey'],'Content-Type':_0x79df('0x71')},'body':{'refid':_0x5494b8['message'][_0x79df('0x74')]},'json':!![]};return rp(_0x23b884)[_0x79df('0x17')](function(_0x34fcb6){_0x5494b8[_0x79df('0x75')]=_0x34fcb6;var _0x303bc3={'messageId':_0x5494b8[_0x79df('0x72')][_0x79df('0x74')],'read':!![]};return _0x3f4045[_0x79df('0x18')](_0x303bc3);});}else{return logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),_0x79df('0x76'),util[_0x79df('0x2a')](_0x4c75b2,{'showHidden':![],'depth':null}));}})[_0x79df('0x1a')](function(_0x351de3){return logger['error'](_0x79df('0x28'),'afterCreate','intelepeer',util[_0x79df('0x2a')](_0x351de3,{'showHidden':![],'depth':null}));});}else{return logger[_0x79df('0x1b')](_0x79df('0x28'),_0x79df('0x29'),'intelepeer',_0x79df('0x77'));}break;}}})[_0x79df('0x78')](function(){_0x2961c4();});}else{_0x2961c4();}}},'charset':'utf8mb4','collate':_0x79df('0x79')});}; \ No newline at end of file +var _0xc069=['authId','format','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','csc','crypto','login','text','keys','sort','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','toString','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','models','toLowerCase','direction','secret','UserId','SmsInteraction','findOne','SmsInteractionId','update','catch','error','out','SmsAccount','then','type','twilio','accountSid','authToken','messages','create','body','phone','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','POST','user_key','session_key','internal_order_id','read','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo'];(function(_0x33f586,_0x29fffd){var _0x3bf7bc=function(_0x11a209){while(--_0x11a209){_0x33f586['push'](_0x33f586['shift']());}};_0x3bf7bc(++_0x29fffd);}(_0xc069,0xab));var _0x9c06=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc069[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9c06('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9c06('0x1'));var moment=require(_0x9c06('0x2'));var BPromise=require('bluebird');var rp=require(_0x9c06('0x3'));var fs=require('fs');var path=require(_0x9c06('0x4'));var rimraf=require(_0x9c06('0x5'));var config=require(_0x9c06('0x6'));var attributes=require(_0x9c06('0x7'));module[_0x9c06('0x8')]=function(_0x1038e3,_0x556265){return _0x1038e3['define'](_0x9c06('0x9'),attributes,{'tableName':_0x9c06('0xa'),'paranoid':![],'indexes':[{'name':_0x9c06('0xb'),'fields':[_0x9c06('0xb')]},{'name':_0x9c06('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d75af,_0x2431c7,_0x23f1dc){var _0x292060=_0x1038e3[_0x9c06('0xd')];var _0x202897=_0x2d75af['get']({'plain':!![]});if(_0x202897['direction'][_0x9c06('0xe')]()==='in'||_0x202897[_0x9c06('0xf')][_0x9c06('0xe')]()==='out'&&!_0x202897[_0x9c06('0x10')]&&!_['isNil'](_0x202897[_0x9c06('0x11')])&&!_['isNil'](_0x202897['SmsInteractionId'])){_0x292060[_0x9c06('0x12')][_0x9c06('0x13')]({'where':{'id':_0x202897[_0x9c06('0x14')]}})['then'](function(_0x16a17e){if(_0x16a17e){_0x16a17e[_0x9c06('0x15')]({'lastMsgAt':_0x202897['createdAt'],'lastMsgDirection':_0x202897[_0x9c06('0xf')][_0x9c06('0xe')]()});}})[_0x9c06('0x16')](function(_0x390e2a){console[_0x9c06('0x17')](_0x390e2a);});}if(_0x202897[_0x9c06('0xf')]===_0x9c06('0x18')&&!_0x202897[_0x9c06('0x10')]){var _0x30d6d3;_0x292060[_0x9c06('0x19')]['find']({'where':{'id':_0x202897['SmsAccountId']},'raw':!![]})[_0x9c06('0x1a')](function(_0x42db03){_0x30d6d3=_0x42db03;if(_0x30d6d3&&_0x30d6d3['type']){switch(_0x30d6d3[_0x9c06('0x1b')]){case _0x9c06('0x1c'):var _0x9d6f75=require(_0x9c06('0x1c'));if(_0x30d6d3[_0x9c06('0x1d')]&&_0x30d6d3['authToken']&&_0x30d6d3['phone']){var _0x552d4c=new _0x9d6f75(_0x30d6d3[_0x9c06('0x1d')],_0x30d6d3[_0x9c06('0x1e')]);_0x552d4c[_0x9c06('0x1f')][_0x9c06('0x20')]({'body':_0x202897[_0x9c06('0x21')],'to':_0x202897[_0x9c06('0x22')],'from':_0x30d6d3[_0x9c06('0x22')],'statusCallback':_0x30d6d3[_0x9c06('0x23')]+_0x9c06('0x24')+_0x202897['id']+_0x9c06('0x25')+_0x30d6d3[_0x9c06('0x26')]})['then'](function(_0x5d2023){if(_0x5d2023['sid']){return _0x2d75af[_0x9c06('0x15')]({'messageId':_0x5d2023[_0x9c06('0x27')]});}})['catch'](function(_0x189f27){logger[_0x9c06('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x1c'),util[_0x9c06('0x29')](_0x189f27,{'showHidden':![],'depth':null}));});}else{logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x9c06('0x2b'):var _0x25ff6b=_0x9c06('0x2c');if(_0x30d6d3[_0x9c06('0x2d')]&&_0x30d6d3[_0x9c06('0x2e')]){var _0x1bf455={'recipient':[_0x202897[_0x9c06('0x22')]],'message':_0x202897[_0x9c06('0x21')],'message_type':_0x30d6d3[_0x9c06('0x2f')]};if(_0x30d6d3[_0x9c06('0x2f')]&&_0x30d6d3[_0x9c06('0x2f')]!=='SI'){_0x1bf455[_0x9c06('0x30')]=_0x30d6d3['phone'];}var _0x3712a5={'url':_0x25ff6b+'login?username='+_0x30d6d3[_0x9c06('0x2d')]+_0x9c06('0x31')+_0x30d6d3[_0x9c06('0x2e')],'method':_0x9c06('0x32')};rp(_0x3712a5)[_0x9c06('0x1a')](function(_0x29d513){var _0x29e833=_0x29d513['split'](';');var _0x58a3e9={'user_key':_0x29e833[0x0],'session_key':_0x29e833[0x1]};_0x3712a5={'url':_0x25ff6b+'sms','method':_0x9c06('0x33'),'headers':{'user_key':_0x58a3e9[_0x9c06('0x34')],'Session_key':_0x58a3e9[_0x9c06('0x35')]},'json':!![],'body':_0x1bf455};return rp(_0x3712a5);})[_0x9c06('0x1a')](function(_0x4c90e0){if(_0x4c90e0['total_sent']>=0x1){var _0x2b6228={'messageId':_0x4c90e0[_0x9c06('0x36')]};if(_0x30d6d3[_0x9c06('0x2f')]!=='GP'||!_0x30d6d3['deliveryReport']){_0x2b6228[_0x9c06('0x37')]=!![];}return _0x2d75af[_0x9c06('0x15')](_0x2b6228);}else{return logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x2b'),util[_0x9c06('0x29')](_0x4c90e0,{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0x5906e5){return logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x2b'),util[_0x9c06('0x29')](_0x5906e5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0x9c06('0x38'):if(_0x30d6d3[_0x9c06('0x1e')]){var _0x2f6c17={'recipient':_0x202897['phone'],'message':_0x202897[_0x9c06('0x21')],'sender':_0x30d6d3[_0x9c06('0x39')]||_0x30d6d3[_0x9c06('0x22')],'authorization':_0x30d6d3[_0x9c06('0x1e')]};var _0x2431c7={'method':_0x9c06('0x33'),'uri':_0x9c06('0x3a'),'body':_0x2f6c17,'json':!![]};rp(_0x2431c7)[_0x9c06('0x1a')](function(_0x2a8b0b){var _0x11e6b5={'messageId':_0x2a8b0b[_0x9c06('0x3b')]};if(!_0x30d6d3[_0x9c06('0x3c')]){_0x11e6b5[_0x9c06('0x37')]=!![];}return _0x2d75af[_0x9c06('0x15')](_0x11e6b5);})[_0x9c06('0x16')](function(_0x5a7ac5){logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),'connectel',util[_0x9c06('0x29')](_0x5a7ac5,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x9c06('0x3d'):if(_0x30d6d3[_0x9c06('0x2d')]&&_0x30d6d3[_0x9c06('0x2e')]){var _0x2f6c17={'messages':[{'source':_0x9c06('0x3e'),'to':_0x202897['phone'],'body':_0x202897['body'],'from':_0x30d6d3['senderString']||_0x30d6d3['phone']}]};var _0x144921=util['format'](_0x9c06('0x3f'),_0x30d6d3[_0x9c06('0x2d')],_0x30d6d3[_0x9c06('0x2e')]);var _0x2431c7={'method':_0x9c06('0x33'),'uri':_0x9c06('0x40'),'body':_0x2f6c17,'headers':{'Authorization':util['format'](_0x9c06('0x41'),new Buffer(_0x144921)['toString'](_0x9c06('0x42')))},'json':!![]};rp(_0x2431c7)['then'](function(_0xbbdab8){if(_0xbbdab8[_0x9c06('0x43')]>=0xc8&&_0xbbdab8[_0x9c06('0x43')]<=0xce){if(_0xbbdab8[_0x9c06('0x44')]&&_0xbbdab8['data'][_0x9c06('0x45')]>0x0){var _0x1fb89b=_[_0x9c06('0x46')](_0xbbdab8[_0x9c06('0x44')][_0x9c06('0x1f')]);var _0x3f71e8={'messageId':_0x1fb89b[_0x9c06('0x47')]};if(!_0x30d6d3['deliveryReport']){_0x3f71e8[_0x9c06('0x37')]=!![];}return _0x2d75af['update'](_0x3f71e8);}else{logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x48'),util[_0x9c06('0x29')](_0xbbdab8,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x48'),util[_0x9c06('0x29')](_0xbbdab8,{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0x82f0f9){logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x48'),util[_0x9c06('0x29')](_0x82f0f9,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x48'),_0x9c06('0x49'));}break;case _0x9c06('0x4a'):if(_0x30d6d3[_0x9c06('0x4b')]&&_0x30d6d3[_0x9c06('0x1e')]){var _0x2f6c17={'dst':_0x202897['phone'],'text':_0x202897[_0x9c06('0x21')],'src':_0x30d6d3[_0x9c06('0x39')]||_0x30d6d3[_0x9c06('0x22')],'url':_0x30d6d3[_0x9c06('0x23')]+_0x9c06('0x24')+_0x202897['id']+_0x9c06('0x25')+_0x30d6d3[_0x9c06('0x26')]};var _0x144921=util['format'](_0x9c06('0x3f'),_0x30d6d3[_0x9c06('0x4b')],_0x30d6d3[_0x9c06('0x1e')]);var _0x2431c7={'method':_0x9c06('0x33'),'uri':util[_0x9c06('0x4c')](_0x9c06('0x4d'),_0x30d6d3[_0x9c06('0x4b')]),'body':_0x2f6c17,'headers':{'Authorization':util[_0x9c06('0x4c')](_0x9c06('0x41'),new Buffer(_0x144921)['toString'](_0x9c06('0x42')))},'json':!![]};rp(_0x2431c7)[_0x9c06('0x1a')](function(_0xb5fed){var _0x1acb5b={'messageId':_0xb5fed['message_uuid'][0x0]};return _0x2d75af[_0x9c06('0x15')](_0x1acb5b);})['catch'](function(_0x39f0fe){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x4a'),util['inspect'](_0x39f0fe,{'showHidden':![],'depth':null}));});}else{logger[_0x9c06('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x4a'),_0x9c06('0x4e'));}break;case'infobip':if(_0x30d6d3[_0x9c06('0x2d')]&&_0x30d6d3['password']){if(_0x30d6d3[_0x9c06('0x4f')]){var _0x45cec2={'method':_0x9c06('0x33'),'uri':_0x30d6d3[_0x9c06('0x4f')]+_0x9c06('0x50'),'body':{'username':_0x30d6d3[_0x9c06('0x2d')],'password':_0x30d6d3[_0x9c06('0x2e')]},'json':!![]};return rp(_0x45cec2)['then'](function(_0xf0fb5a){var _0x35d3a6={'method':_0x9c06('0x33'),'uri':_0x30d6d3['baseUrl']+_0x9c06('0x51'),'body':{'messages':[{'from':_0x30d6d3[_0x9c06('0x22')],'destinations':[{'to':_0x202897[_0x9c06('0x22')]}],'text':_0x202897[_0x9c06('0x21')],'notifyUrl':_0x30d6d3[_0x9c06('0x23')]+'/api/sms/messages/'+_0x202897['id']+_0x9c06('0x25')+_0x30d6d3[_0x9c06('0x26')],'notifyContentType':_0x9c06('0x52'),'callbackData':_0x30d6d3[_0x9c06('0x22')]+';'+_0x202897['body']}]},'headers':{'Authorization':_0x9c06('0x53')+_0xf0fb5a['token']},'json':!![]};return rp(_0x35d3a6)[_0x9c06('0x1a')](function(_0x3f253d){if(_0x3f253d[_0x9c06('0x1f')]){var _0x1b89f3={'messageId':_0x3f253d[_0x9c06('0x1f')][0x0][_0x9c06('0xb')]};if(!_0x30d6d3['deliveryReport']){_0x1b89f3[_0x9c06('0x37')]=!![];}return _0x2d75af[_0x9c06('0x15')](_0x1b89f3);}else{return logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x54'),util['inspect'](_0x3f253d,{'showHidden':![],'depth':null}));}});})[_0x9c06('0x16')](function(_0x5b999d){return logger[_0x9c06('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x54'),util['inspect'](_0x5b999d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x54'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x54'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x9c06('0x55'):var _0x13656a=require(_0x9c06('0x56'));if(_0x30d6d3['apiKey']){var _0x1ad12e={};_0x1ad12e[_0x9c06('0x57')]=_0x30d6d3[_0x9c06('0x2d')];_0x1ad12e[_0x9c06('0x22')]=_0x202897[_0x9c06('0x22')];_0x1ad12e['sender']=_0x30d6d3[_0x9c06('0x22')];_0x1ad12e[_0x9c06('0x58')]=_0x202897[_0x9c06('0x21')];_0x1ad12e['timestamp']=+new Date();var _0xd5add3='';var _0x50dc1f='';var _0x4cf766=Object[_0x9c06('0x59')](_0x1ad12e);_0x4cf766[_0x9c06('0x5a')]();for(var _0x2ce275=0x0;_0x2ce275<_0x4cf766[_0x9c06('0x5b')];_0x2ce275++){if(_0xd5add3!=''){_0xd5add3+='&';}_0xd5add3+=_0x4cf766[_0x2ce275]+'='+encodeURIComponent(_0x1ad12e[_0x4cf766[_0x2ce275]]);_0x50dc1f+=_0x1ad12e[_0x4cf766[_0x2ce275]];}_0x50dc1f+=_0x30d6d3[_0x9c06('0x5c')];_0x50dc1f=_0x13656a[_0x9c06('0x5d')](_0x9c06('0x5e'))[_0x9c06('0x15')](_0x50dc1f)[_0x9c06('0x5f')](_0x9c06('0x60'));if(_0xd5add3!==''){_0xd5add3+='&';}_0xd5add3+=_0x9c06('0x61')+_0x50dc1f;var _0x3712a5={'method':_0x9c06('0x32'),'uri':_0x30d6d3['baseUrl']+_0x9c06('0x62')+_0xd5add3,'json':!![]};return rp(_0x3712a5)[_0x9c06('0x1a')](function(_0x7d46d){var _0x52d461=Object['keys'](_0x7d46d);if(_0x7d46d[_0x52d461[0x0]][_0x9c06('0x17')]&&parseInt(_0x7d46d[_0x52d461[0x0]][_0x9c06('0x17')])===0x0){var _0x330e3a={'messageId':_0x7d46d[_0x52d461[0x0]][_0x9c06('0x63')]};if(!_0x30d6d3[_0x9c06('0x3c')]){_0x330e3a[_0x9c06('0x37')]=!![];}return _0x2d75af[_0x9c06('0x15')](_0x330e3a);}else{return logger[_0x9c06('0x17')](_0x9c06('0x2a'),'afterCreate',_0x9c06('0x55'),util[_0x9c06('0x29')](_0x7d46d[_0x9c06('0x17')],{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0x722549){return logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x55'),util[_0x9c06('0x29')](_0x722549,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),'csc',_0x9c06('0x64'));}break;case'clickatell':if(_0x30d6d3[_0x9c06('0x5c')]){var _0x22e5e6={'method':_0x9c06('0x33'),'uri':_0x9c06('0x65'),'headers':{'Authorization':_0x30d6d3[_0x9c06('0x5c')]},'body':{'content':_0x202897['body'],'to':[_0x202897[_0x9c06('0x22')]],'from':_0x30d6d3['phone'],'binary':![],'clientMessageId':_0x9c06('0x66'),'charset':_0x9c06('0x67')},'json':!![]};rp(_0x22e5e6)['then'](function(_0x329d50){if(!_0x329d50[_0x9c06('0x17')]){var _0x140abe={'messageId':_0x329d50[_0x9c06('0x1f')][0x0][_0x9c06('0x68')]};if(!_0x30d6d3['deliveryReport']){_0x140abe[_0x9c06('0x37')]=!![];}return _0x2d75af[_0x9c06('0x15')](_0x140abe);}else{return logger['error'](_0x9c06('0x2a'),'afterCreate',_0x9c06('0x69'),util['inspect'](_0x329d50[_0x9c06('0x17')],{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0x418df0){return logger[_0x9c06('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),'clickatell',util[_0x9c06('0x29')](_0x418df0,{'showHidden':![],'depth':null}));});}else{logger[_0x9c06('0x17')](_0x9c06('0x2a'),'afterCreate',_0x9c06('0x69'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x30d6d3[_0x9c06('0x2d')]&&_0x30d6d3[_0x9c06('0x2e')]){var _0x144921=util[_0x9c06('0x4c')]('%s:%s',_0x30d6d3[_0x9c06('0x2d')],_0x30d6d3[_0x9c06('0x2e')]);var _0x2431c7={'method':_0x9c06('0x33'),'uri':_0x9c06('0x6a')+_0x30d6d3[_0x9c06('0x6b')]+_0x9c06('0x6c'),'body':{'to':[_0x202897[_0x9c06('0x22')]],'text':_0x202897[_0x9c06('0x21')],'from':_0x30d6d3[_0x9c06('0x22')],'applicationId':_0x30d6d3['applicationId']},'headers':{'Authorization':util['format'](_0x9c06('0x41'),new Buffer(_0x144921)[_0x9c06('0x6d')]('base64'))},'json':!![]};rp(_0x2431c7)[_0x9c06('0x1a')](function(_0x1c45bb){if(_0x1c45bb['id']){var _0x1d1dd4={'messageId':_0x1c45bb['id']};return _0x2d75af[_0x9c06('0x15')](_0x1d1dd4);}else{logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x6e'),util['inspect'](_0x1c45bb,{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0x4a91bd){logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x6e'),util[_0x9c06('0x29')](_0x4a91bd,{'showHidden':![],'depth':null}));});}else{logger[_0x9c06('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x6e'),_0x9c06('0x49'));}break;case _0x9c06('0x6f'):if(_0x30d6d3['apiKey']){var _0x19eab5={};var _0x3712a5={'method':_0x9c06('0x33'),'uri':_0x9c06('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x30d6d3[_0x9c06('0x5c')],'Content-Type':_0x9c06('0x52')},'body':{'from':_0x30d6d3[_0x9c06('0x22')],'to':_0x202897[_0x9c06('0x22')],'text':_0x202897[_0x9c06('0x21')]},'json':!![]};return rp(_0x3712a5)[_0x9c06('0x1a')](function(_0x3c9cf4){if(_0x3c9cf4[_0x9c06('0x71')]==0xca){_0x19eab5[_0x9c06('0x72')]=_0x3c9cf4;var _0x1c9ff1={'method':_0x9c06('0x33'),'uri':_0x9c06('0x73'),'headers':{'Authorization':_0x9c06('0x74')+_0x30d6d3[_0x9c06('0x5c')],'Content-Type':_0x9c06('0x52')},'body':{'refid':_0x19eab5[_0x9c06('0x72')][_0x9c06('0x75')]},'json':!![]};return rp(_0x1c9ff1)[_0x9c06('0x1a')](function(_0x24c7ed){_0x19eab5[_0x9c06('0x76')]=_0x24c7ed;var _0x3ccfbc={'messageId':_0x19eab5[_0x9c06('0x72')]['refid'],'read':!![]};return _0x2d75af[_0x9c06('0x15')](_0x3ccfbc);});}else{return logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x6f'),util[_0x9c06('0x29')](_0x3c9cf4,{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0xd19eb5){return logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x6f'),util[_0x9c06('0x29')](_0xd19eb5,{'showHidden':![],'depth':null}));});}else{return logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),'intelepeer',_0x9c06('0x77'));}break;}}})[_0x9c06('0x78')](function(){_0x23f1dc();});}else{_0x23f1dc();}}},'charset':_0x9c06('0x79'),'collate':_0x9c06('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 79afbb1..8cd0528 100644 --- a/server/api/smsMessage/smsMessage.rpc.js +++ b/server/api/smsMessage/smsMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdda2=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','lodash'];(function(_0x581b43,_0x3b64c2){var _0x371b6f=function(_0x3ade4f){while(--_0x3ade4f){_0x581b43['push'](_0x581b43['shift']());}};_0x371b6f(++_0x3b64c2);}(_0xdda2,0x18b));var _0x2dda=function(_0x353b3c,_0x5da02b){_0x353b3c=_0x353b3c-0x0;var _0x2c7201=_0xdda2[_0x353b3c];return _0x2c7201;};'use strict';var _=require(_0x2dda('0x0'));var util=require(_0x2dda('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2dda('0x2'));var fs=require('fs');var Redis=require(_0x2dda('0x3'));var db=require(_0x2dda('0x4'))['db'];var utils=require(_0x2dda('0x5'));var logger=require(_0x2dda('0x6'))('rpc');var config=require(_0x2dda('0x7'));var jayson=require(_0x2dda('0x8'));var client=jayson[_0x2dda('0x9')][_0x2dda('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2dda('0xb')],{'host':_0x2dda('0xc'),'port':0x18eb});var socket=require(_0x2dda('0xd'))(new Redis(config[_0x2dda('0xb')]));require(_0x2dda('0xe'))[_0x2dda('0xf')](socket);function respondWithRpcPromise(_0x14e4d6,_0x374001,_0x493a97){return new BPromise(function(_0x523aae,_0x144eb7){return client[_0x2dda('0x10')](_0x14e4d6,_0x493a97)[_0x2dda('0x11')](function(_0x2b83fc){logger[_0x2dda('0x12')]('SmsMessage,\x20%s,\x20%s',_0x374001,_0x2dda('0x13'));logger[_0x2dda('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x374001,_0x2dda('0x13'),JSON['stringify'](_0x2b83fc));if(_0x2b83fc[_0x2dda('0x15')]){if(_0x2b83fc[_0x2dda('0x15')][_0x2dda('0x16')]===0x1f4){logger[_0x2dda('0x15')](_0x2dda('0x17'),_0x374001,_0x2b83fc[_0x2dda('0x15')][_0x2dda('0x18')]);return _0x144eb7(_0x2b83fc[_0x2dda('0x15')][_0x2dda('0x18')]);}logger[_0x2dda('0x15')](_0x2dda('0x17'),_0x374001,_0x2b83fc[_0x2dda('0x15')][_0x2dda('0x18')]);return _0x523aae(_0x2b83fc[_0x2dda('0x15')]['message']);}else{logger[_0x2dda('0x12')](_0x2dda('0x17'),_0x374001,'request\x20sent');_0x523aae(_0x2b83fc[_0x2dda('0x19')][_0x2dda('0x18')]);}})[_0x2dda('0x1a')](function(_0x445909){logger[_0x2dda('0x15')]('SmsMessage,\x20%s,\x20%s',_0x374001,_0x445909);_0x144eb7(_0x445909);});});}exports['CreateSmsMessage']=function(_0x24c526){var _0x172bb6=this;return new Promise(function(_0x158c0b,_0x5626c5){return db[_0x2dda('0x1b')][_0x2dda('0x1c')](_0x24c526[_0x2dda('0x1d')],{'raw':_0x24c526[_0x2dda('0x1e')]?_0x24c526[_0x2dda('0x1e')][_0x2dda('0x1f')]===undefined?!![]:![]:!![]})[_0x2dda('0x11')](function(_0x4666d9){logger[_0x2dda('0x12')](_0x2dda('0x20'),_0x24c526);logger[_0x2dda('0x14')](_0x2dda('0x20'),_0x24c526,JSON['stringify'](_0x4666d9));_0x158c0b(_0x4666d9);})[_0x2dda('0x1a')](function(_0x10074b){logger['error']('CreateSmsMessage',_0x10074b[_0x2dda('0x18')],_0x24c526);_0x5626c5(_0x172bb6[_0x2dda('0x15')](0x1f4,_0x10074b[_0x2dda('0x18')]));});});}; \ No newline at end of file +var _0x4867=['info','result','CreateSmsMessage','SmsMessage','create','options','then','debug','stringify','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x2f85e9,_0x32efbc){var _0x295444=function(_0x4be5b8){while(--_0x4be5b8){_0x2f85e9['push'](_0x2f85e9['shift']());}};_0x295444(++_0x32efbc);}(_0x4867,0xc3));var _0x7486=function(_0x2863e7,_0x2e4167){_0x2863e7=_0x2863e7-0x0;var _0xf4870f=_0x4867[_0x2863e7];return _0xf4870f;};'use strict';var _=require('lodash');var util=require(_0x7486('0x0'));var moment=require(_0x7486('0x1'));var BPromise=require('bluebird');var rs=require(_0x7486('0x2'));var fs=require('fs');var Redis=require(_0x7486('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7486('0x4'));var logger=require(_0x7486('0x5'))(_0x7486('0x6'));var config=require(_0x7486('0x7'));var jayson=require(_0x7486('0x8'));var client=jayson[_0x7486('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7486('0xa')],{'host':_0x7486('0xb'),'port':0x18eb});var socket=require(_0x7486('0xc'))(new Redis(config['redis']));require(_0x7486('0xd'))[_0x7486('0xe')](socket);function respondWithRpcPromise(_0x540eb8,_0x228e04,_0x2a77d8){return new BPromise(function(_0x5f4677,_0x150c4e){return client[_0x7486('0xf')](_0x540eb8,_0x2a77d8)['then'](function(_0x4797e4){logger['info'](_0x7486('0x10'),_0x228e04,'request\x20sent');logger['debug'](_0x7486('0x11'),_0x228e04,_0x7486('0x12'),JSON['stringify'](_0x4797e4));if(_0x4797e4[_0x7486('0x13')]){if(_0x4797e4[_0x7486('0x13')][_0x7486('0x14')]===0x1f4){logger[_0x7486('0x13')](_0x7486('0x10'),_0x228e04,_0x4797e4['error'][_0x7486('0x15')]);return _0x150c4e(_0x4797e4[_0x7486('0x13')][_0x7486('0x15')]);}logger['error'](_0x7486('0x10'),_0x228e04,_0x4797e4[_0x7486('0x13')]['message']);return _0x5f4677(_0x4797e4[_0x7486('0x13')][_0x7486('0x15')]);}else{logger[_0x7486('0x16')]('SmsMessage,\x20%s,\x20%s',_0x228e04,_0x7486('0x12'));_0x5f4677(_0x4797e4[_0x7486('0x17')][_0x7486('0x15')]);}})['catch'](function(_0x17f694){logger[_0x7486('0x13')](_0x7486('0x10'),_0x228e04,_0x17f694);_0x150c4e(_0x17f694);});});}exports[_0x7486('0x18')]=function(_0x11f1c5){var _0x962820=this;return new Promise(function(_0x3cdf99,_0x2ca33d){return db[_0x7486('0x19')][_0x7486('0x1a')](_0x11f1c5['body'],{'raw':_0x11f1c5['options']?_0x11f1c5[_0x7486('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x7486('0x1c')](function(_0x122487){logger[_0x7486('0x16')](_0x7486('0x18'),_0x11f1c5);logger[_0x7486('0x1d')](_0x7486('0x18'),_0x11f1c5,JSON[_0x7486('0x1e')](_0x122487));_0x3cdf99(_0x122487);})['catch'](function(_0x41d507){logger[_0x7486('0x13')]('CreateSmsMessage',_0x41d507['message'],_0x11f1c5);_0x2ca33d(_0x962820[_0x7486('0x13')](0x1f4,_0x41d507[_0x7486('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 760c216..14cacc5 100644 --- a/server/api/smsMessage/smsMessage.socket.js +++ b/server/api/smsMessage/smsMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1212=['save','remove','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x1212,0xf2));var _0x2121=function(_0x253b13,_0x247a2f){_0x253b13=_0x253b13-0x0;var _0x396bcc=_0x1212[_0x253b13];return _0x396bcc;};'use strict';var SmsMessageEvents=require(_0x2121('0x0'));var events=[_0x2121('0x1'),_0x2121('0x2'),_0x2121('0x3')];function createListener(_0x22edb6,_0x5f7910){return function(_0x114508){_0x5f7910[_0x2121('0x4')](_0x22edb6,_0x114508);};}function removeListener(_0x400036,_0x2511f3){return function(){SmsMessageEvents[_0x2121('0x5')](_0x400036,_0x2511f3);};}exports[_0x2121('0x6')]=function(_0x2a4126){for(var _0x4d8881=0x0,_0x58c241=events[_0x2121('0x7')];_0x4d8881<_0x58c241;_0x4d8881++){var _0x26bad0=events[_0x4d8881];var _0x2f81bf=createListener(_0x2121('0x8')+_0x26bad0,_0x2a4126);SmsMessageEvents['on'](_0x26bad0,_0x2f81bf);}}; \ No newline at end of file +var _0x2c13=['remove','update','emit','removeListener','register','length','smsMessage:','save'];(function(_0xf61a76,_0x249781){var _0x168c51=function(_0x1e2bac){while(--_0x1e2bac){_0xf61a76['push'](_0xf61a76['shift']());}};_0x168c51(++_0x249781);}(_0x2c13,0x1b7));var _0x32c1=function(_0x2e0216,_0xd90f87){_0x2e0216=_0x2e0216-0x0;var _0x1ab498=_0x2c13[_0x2e0216];return _0x1ab498;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x32c1('0x0'),_0x32c1('0x1'),_0x32c1('0x2')];function createListener(_0x167573,_0x422cf4){return function(_0x1bfb0a){_0x422cf4[_0x32c1('0x3')](_0x167573,_0x1bfb0a);};}function removeListener(_0x1545af,_0x3e7a1f){return function(){SmsMessageEvents[_0x32c1('0x4')](_0x1545af,_0x3e7a1f);};}exports[_0x32c1('0x5')]=function(_0x2ef858){for(var _0x36e891=0x0,_0x824ee=events[_0x32c1('0x6')];_0x36e891<_0x824ee;_0x36e891++){var _0x2b8df7=events[_0x36e891];var _0x3a240c=createListener(_0x32c1('0x7')+_0x2b8df7,_0x2ef858);SmsMessageEvents['on'](_0x2b8df7,_0x3a240c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index c73f8cf..198bbcf 100644 --- a/server/api/smsQueue/index.js +++ b/server/api/smsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48f4=['getMembers','getTeams','/:id/users','getAgents','create','/:id/teams','post','addAgents','update','destroy','delete','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x48f4,0x1de));var _0x448f=function(_0x5b9d3a,_0x1f1842){_0x5b9d3a=_0x5b9d3a-0x0;var _0x383375=_0x48f4[_0x5b9d3a];return _0x383375;};'use strict';var multer=require(_0x448f('0x0'));var util=require(_0x448f('0x1'));var path=require(_0x448f('0x2'));var timeout=require('connect-timeout');var express=require(_0x448f('0x3'));var router=express[_0x448f('0x4')]();var fs_extra=require(_0x448f('0x5'));var auth=require(_0x448f('0x6'));var interaction=require(_0x448f('0x7'));var config=require(_0x448f('0x8'));var controller=require(_0x448f('0x9'));router[_0x448f('0xa')]('/',auth[_0x448f('0xb')](),controller[_0x448f('0xc')]);router[_0x448f('0xa')](_0x448f('0xd'),auth[_0x448f('0xb')](),controller[_0x448f('0xe')]);router[_0x448f('0xa')](_0x448f('0xf'),auth['isAuthenticated'](),controller[_0x448f('0x10')]);router[_0x448f('0xa')](_0x448f('0x11'),auth['isAuthenticated'](),controller[_0x448f('0x12')]);router[_0x448f('0xa')]('/:id/teams',auth[_0x448f('0xb')](),controller[_0x448f('0x13')]);router[_0x448f('0xa')](_0x448f('0x14'),auth[_0x448f('0xb')](),controller[_0x448f('0x15')]);router['post']('/',auth[_0x448f('0xb')](),controller[_0x448f('0x16')]);router['post'](_0x448f('0x17'),auth[_0x448f('0xb')](),controller['addTeams']);router[_0x448f('0x18')]('/:id/users',auth[_0x448f('0xb')](),controller[_0x448f('0x19')]);router['put']('/:id',auth[_0x448f('0xb')](),controller[_0x448f('0x1a')]);router['delete'](_0x448f('0xf'),auth[_0x448f('0xb')](),controller[_0x448f('0x1b')]);router[_0x448f('0x1c')](_0x448f('0x17'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x448f('0x1c')](_0x448f('0x14'),auth[_0x448f('0xb')](),controller[_0x448f('0x1d')]);module[_0x448f('0x1e')]=router; \ No newline at end of file +var _0x0ee3=['/describe','isAuthenticated','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index'];(function(_0x3472e7,_0x71f00c){var _0x4db011=function(_0x7887d5){while(--_0x7887d5){_0x3472e7['push'](_0x3472e7['shift']());}};_0x4db011(++_0x71f00c);}(_0x0ee3,0x160));var _0x30ee=function(_0x5ed155,_0x283365){_0x5ed155=_0x5ed155-0x0;var _0x241ca3=_0x0ee3[_0x5ed155];return _0x241ca3;};'use strict';var multer=require(_0x30ee('0x0'));var util=require(_0x30ee('0x1'));var path=require(_0x30ee('0x2'));var timeout=require(_0x30ee('0x3'));var express=require(_0x30ee('0x4'));var router=express[_0x30ee('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x30ee('0x6'));var interaction=require(_0x30ee('0x7'));var config=require(_0x30ee('0x8'));var controller=require(_0x30ee('0x9'));router[_0x30ee('0xa')]('/',auth['isAuthenticated'](),controller[_0x30ee('0xb')]);router[_0x30ee('0xa')](_0x30ee('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x30ee('0xa')]('/:id',auth[_0x30ee('0xd')](),controller[_0x30ee('0xe')]);router[_0x30ee('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x30ee('0xf')]);router[_0x30ee('0xa')](_0x30ee('0x10'),auth['isAuthenticated'](),controller[_0x30ee('0x11')]);router[_0x30ee('0xa')](_0x30ee('0x12'),auth['isAuthenticated'](),controller[_0x30ee('0x13')]);router[_0x30ee('0x14')]('/',auth[_0x30ee('0xd')](),controller[_0x30ee('0x15')]);router[_0x30ee('0x14')](_0x30ee('0x10'),auth[_0x30ee('0xd')](),controller[_0x30ee('0x16')]);router[_0x30ee('0x14')](_0x30ee('0x12'),auth['isAuthenticated'](),controller[_0x30ee('0x17')]);router[_0x30ee('0x18')](_0x30ee('0x19'),auth[_0x30ee('0xd')](),controller['update']);router[_0x30ee('0x1a')](_0x30ee('0x19'),auth[_0x30ee('0xd')](),controller[_0x30ee('0x1b')]);router[_0x30ee('0x1a')](_0x30ee('0x10'),auth[_0x30ee('0xd')](),controller['removeTeams']);router[_0x30ee('0x1a')](_0x30ee('0x12'),auth[_0x30ee('0xd')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 470eab7..3b9515d 100644 --- a/server/api/smsQueue/smsQueue.attributes.js +++ b/server/api/smsQueue/smsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2213=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x44f218,_0x111a44){var _0x3e1460=function(_0x353f90){while(--_0x353f90){_0x44f218['push'](_0x44f218['shift']());}};_0x3e1460(++_0x111a44);}(_0x2213,0x173));var _0x3221=function(_0x3e2808,_0x1b8933){_0x3e2808=_0x3e2808-0x0;var _0x3142d7=_0x2213[_0x3e2808];return _0x3142d7;};'use strict';var Sequelize=require(_0x3221('0x0'));module[_0x3221('0x1')]={'name':{'type':Sequelize[_0x3221('0x2')],'unique':_0x3221('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3221('0x2')]},'timeout':{'type':Sequelize[_0x3221('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3221('0x5')](_0x3221('0x6'),_0x3221('0x7'),_0x3221('0x8'))}}; \ No newline at end of file +var _0x05f1=['ENUM','sequelize','exports','STRING','INTEGER'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0x05f1,0x1c3));var _0x105f=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x05f1[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x105f('0x0'));module[_0x105f('0x1')]={'name':{'type':Sequelize[_0x105f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x105f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x105f('0x4')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 27d49a8..3f8a5d0 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x86bc=['voicePause','interface','flatMap','transaction','each','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','all','union','compact','forEach','userSmsQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','index','map','SmsQueue','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','catch','create','body','user','role','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','nolimit','pick','SmsQueueId','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online'];(function(_0x4ee2b9,_0xf82058){var _0x22ee23=function(_0x426eb4){while(--_0x426eb4){_0x4ee2b9['push'](_0x4ee2b9['shift']());}};_0x22ee23(++_0xf82058);}(_0x86bc,0x1b1));var _0xc86b=function(_0x533a68,_0x18c38d){_0x533a68=_0x533a68-0x0;var _0x2536a6=_0x86bc[_0x533a68];return _0x2536a6;};'use strict';var emlformat=require(_0xc86b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc86b('0x1'));var jsonpatch=require(_0xc86b('0x2'));var rp=require(_0xc86b('0x3'));var moment=require(_0xc86b('0x4'));var BPromise=require(_0xc86b('0x5'));var Mustache=require(_0xc86b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc86b('0x7'));var csv=require('to-csv');var ejs=require(_0xc86b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc86b('0x9'));var crypto=require(_0xc86b('0xa'));var jsforce=require(_0xc86b('0xb'));var deskjs=require(_0xc86b('0xc'));var toCsv=require(_0xc86b('0xd'));var querystring=require('querystring');var Papa=require(_0xc86b('0xe'));var Redis=require(_0xc86b('0xf'));var authService=require(_0xc86b('0x10'));var qs=require(_0xc86b('0x11'));var as=require(_0xc86b('0x12'));var hardwareService=require(_0xc86b('0x13'));var logger=require(_0xc86b('0x14'))(_0xc86b('0x15'));var utils=require('../../config/utils');var config=require(_0xc86b('0x16'));var licenseUtil=require(_0xc86b('0x17'));var db=require(_0xc86b('0x18'))['db'];config['redis']=_[_0xc86b('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc86b('0x1a'))(new Redis(config[_0xc86b('0x1b')]));require('./smsQueue.socket')[_0xc86b('0x1c')](socket);function respondWithStatusCode(_0x59d5bf,_0x12dab3){_0x12dab3=_0x12dab3||0xcc;return function(_0x244fea){if(_0x244fea){return _0x59d5bf[_0xc86b('0x1d')](_0x12dab3);}return _0x59d5bf[_0xc86b('0x1e')](_0x12dab3)[_0xc86b('0x1f')]();};}function respondWithResult(_0x534b48,_0x360916){_0x360916=_0x360916||0xc8;return function(_0x22beec){if(_0x22beec){return _0x534b48[_0xc86b('0x1e')](_0x360916)[_0xc86b('0x20')](_0x22beec);}};}function respondWithFilteredResult(_0x53dcf3,_0x346ed7){return function(_0x42479a){if(_0x42479a){var _0x36d681=typeof _0x346ed7[_0xc86b('0x21')]==='undefined'&&typeof _0x346ed7[_0xc86b('0x22')]===_0xc86b('0x23');var _0x4c0a21=_0x42479a[_0xc86b('0x24')];var _0x2ade00=_0x36d681?0x0:_0x346ed7['offset'];var _0x58446d=_0x36d681?_0x42479a[_0xc86b('0x24')]:_0x346ed7['offset']+_0x346ed7[_0xc86b('0x22')];var _0x517b18;if(_0x58446d>=_0x4c0a21){_0x58446d=_0x4c0a21;_0x517b18=0xc8;}else{_0x517b18=0xce;}_0x53dcf3[_0xc86b('0x1e')](_0x517b18);return _0x53dcf3[_0xc86b('0x25')]('Content-Range',_0x2ade00+'-'+_0x58446d+'/'+_0x4c0a21)[_0xc86b('0x20')](_0x42479a);}return null;};}function patchUpdates(_0x4e0322){return function(_0xc71c29){try{jsonpatch[_0xc86b('0x26')](_0xc71c29,_0x4e0322,!![]);}catch(_0x276c72){return BPromise[_0xc86b('0x27')](_0x276c72);}return _0xc71c29['save']();};}function saveUpdates(_0x819baf,_0x1a2c27){return function(_0x212be7){if(_0x212be7){return _0x212be7[_0xc86b('0x28')](_0x819baf)[_0xc86b('0x29')](function(_0x4ef627){return _0x4ef627;});}return null;};}function removeEntity(_0x41b99c,_0x564f1){return function(_0xe7dc4b){if(_0xe7dc4b){return _0xe7dc4b[_0xc86b('0x2a')]()[_0xc86b('0x29')](function(){var _0x4d66bd=_0xe7dc4b[_0xc86b('0x2b')]({'plain':!![]});var _0x57c7fd=_0xc86b('0x2c');return db[_0xc86b('0x2d')][_0xc86b('0x2a')]({'where':{'type':_0x57c7fd,'resourceId':_0x4d66bd['id']}})[_0xc86b('0x29')](function(){return _0xe7dc4b;});})[_0xc86b('0x29')](function(){_0x41b99c[_0xc86b('0x1e')](0xcc)[_0xc86b('0x1f')]();});}};}function handleEntityNotFound(_0x259db7,_0x37fc26){return function(_0x35ca48){if(!_0x35ca48){_0x259db7[_0xc86b('0x1d')](0x194);}return _0x35ca48;};}function handleError(_0x5ca37b,_0x5101f0){_0x5101f0=_0x5101f0||0x1f4;return function(_0x58767a){logger[_0xc86b('0x2e')](_0x58767a['stack']);if(_0x58767a['name']){delete _0x58767a[_0xc86b('0x2f')];}_0x5ca37b[_0xc86b('0x1e')](_0x5101f0)[_0xc86b('0x30')](_0x58767a);};}exports[_0xc86b('0x31')]=function(_0x1597f7,_0x519770){var _0x56f3f5={},_0x115223={},_0x282301={'count':0x0,'rows':[]};var _0x9e4348=_[_0xc86b('0x32')](db[_0xc86b('0x33')][_0xc86b('0x34')],function(_0x42ca71){return{'name':_0x42ca71['fieldName'],'type':_0x42ca71[_0xc86b('0x35')]['key']};});_0x115223[_0xc86b('0x36')]=_[_0xc86b('0x32')](_0x9e4348,_0xc86b('0x2f'));_0x115223[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x1597f7['query']);_0x115223[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x115223[_0xc86b('0x36')],_0x115223['query']);_0x56f3f5[_0xc86b('0x3b')]=_['intersection'](_0x115223['model'],qs[_0xc86b('0x3c')](_0x1597f7['query']['fields']));_0x56f3f5[_0xc86b('0x3b')]=_0x56f3f5[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x56f3f5['attributes']:_0x115223['model'];if(!_0x1597f7[_0xc86b('0x37')][_0xc86b('0x3e')]('nolimit')){_0x56f3f5['limit']=qs[_0xc86b('0x22')](_0x1597f7[_0xc86b('0x37')][_0xc86b('0x22')]);_0x56f3f5[_0xc86b('0x21')]=qs['offset'](_0x1597f7[_0xc86b('0x37')][_0xc86b('0x21')]);}_0x56f3f5[_0xc86b('0x3f')]=qs[_0xc86b('0x40')](_0x1597f7[_0xc86b('0x37')][_0xc86b('0x40')]);_0x56f3f5[_0xc86b('0x41')]=qs[_0xc86b('0x39')](_['pick'](_0x1597f7[_0xc86b('0x37')],_0x115223[_0xc86b('0x39')]),_0x9e4348);if(_0x1597f7[_0xc86b('0x37')][_0xc86b('0x42')]){_0x56f3f5[_0xc86b('0x41')]=_[_0xc86b('0x43')](_0x56f3f5[_0xc86b('0x41')],{'$or':_[_0xc86b('0x32')](_0x9e4348,function(_0x4105cb){if(_0x4105cb[_0xc86b('0x35')]!=='VIRTUAL'){var _0x132860={};_0x132860[_0x4105cb[_0xc86b('0x2f')]]={'$like':'%'+_0x1597f7['query'][_0xc86b('0x42')]+'%'};return _0x132860;}})});}_0x56f3f5=_[_0xc86b('0x43')]({},_0x56f3f5,_0x1597f7[_0xc86b('0x44')]);var _0x3e3ce5={'where':_0x56f3f5[_0xc86b('0x41')]};return db[_0xc86b('0x33')]['count'](_0x3e3ce5)['then'](function(_0x5d7693){_0x282301[_0xc86b('0x24')]=_0x5d7693;if(_0x1597f7[_0xc86b('0x37')][_0xc86b('0x45')]){_0x56f3f5[_0xc86b('0x46')]=[{'all':!![]}];}return db[_0xc86b('0x33')]['findAll'](_0x56f3f5);})['then'](function(_0x134e76){_0x282301['rows']=_0x134e76;return _0x282301;})[_0xc86b('0x29')](respondWithFilteredResult(_0x519770,_0x56f3f5))[_0xc86b('0x47')](handleError(_0x519770,null));};exports['show']=function(_0x45f33f,_0x5b5815){var _0x485671={'raw':!![],'where':{'id':_0x45f33f['params']['id']}},_0x55228c={};_0x55228c[_0xc86b('0x36')]=_[_0xc86b('0x38')](db[_0xc86b('0x33')]['rawAttributes']);_0x55228c['query']=_[_0xc86b('0x38')](_0x45f33f[_0xc86b('0x37')]);_0x55228c[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x55228c['model'],_0x55228c[_0xc86b('0x37')]);_0x485671[_0xc86b('0x3b')]=_['intersection'](_0x55228c[_0xc86b('0x36')],qs[_0xc86b('0x3c')](_0x45f33f['query'][_0xc86b('0x3c')]));_0x485671[_0xc86b('0x3b')]=_0x485671[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x485671[_0xc86b('0x3b')]:_0x55228c[_0xc86b('0x36')];if(_0x45f33f[_0xc86b('0x37')][_0xc86b('0x45')]){_0x485671[_0xc86b('0x46')]=[{'all':!![]}];}_0x485671=_[_0xc86b('0x43')]({},_0x485671,_0x45f33f[_0xc86b('0x44')]);return db[_0xc86b('0x33')]['find'](_0x485671)['then'](handleEntityNotFound(_0x5b5815,null))[_0xc86b('0x29')](respondWithResult(_0x5b5815,null))['catch'](handleError(_0x5b5815,null));};exports[_0xc86b('0x48')]=function(_0x28f9a6,_0x5e8bcc){return db['SmsQueue'][_0xc86b('0x48')](_0x28f9a6[_0xc86b('0x49')],{})[_0xc86b('0x29')](function(_0x405068){var _0x47c43a=_0x28f9a6[_0xc86b('0x4a')][_0xc86b('0x2b')]({'plain':!![]});if(!_0x47c43a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47c43a[_0xc86b('0x4b')]===_0xc86b('0x4a')){var _0x40e35e=_0x405068[_0xc86b('0x2b')]({'plain':!![]});var _0x6f806c='SmsQueues';return db['UserProfileSection'][_0xc86b('0x4c')]({'where':{'name':_0x6f806c,'userProfileId':_0x47c43a['userProfileId']},'raw':!![]})['then'](function(_0x389bf3){if(_0x389bf3&&_0x389bf3['autoAssociation']===0x0){return db[_0xc86b('0x2d')][_0xc86b('0x48')]({'name':_0x40e35e[_0xc86b('0x2f')],'resourceId':_0x40e35e['id'],'type':_0x389bf3[_0xc86b('0x2f')],'sectionId':_0x389bf3['id']},{})['then'](function(){return _0x405068;});}else{return _0x405068;}})[_0xc86b('0x47')](function(_0x29d1d0){logger[_0xc86b('0x2e')](_0xc86b('0x4d'),_0x29d1d0);throw _0x29d1d0;});}return _0x405068;})[_0xc86b('0x29')](respondWithResult(_0x5e8bcc,0xc9))[_0xc86b('0x47')](handleError(_0x5e8bcc,null));};exports[_0xc86b('0x28')]=function(_0x435858,_0x186019){if(_0x435858[_0xc86b('0x49')]['id']){delete _0x435858[_0xc86b('0x49')]['id'];}return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x435858[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x186019,null))[_0xc86b('0x29')](saveUpdates(_0x435858[_0xc86b('0x49')],null))['then'](respondWithResult(_0x186019,null))['catch'](handleError(_0x186019,null));};exports[_0xc86b('0x2a')]=function(_0x4f26c1,_0x3cc6d8){return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x4f26c1[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x3cc6d8,null))['then'](removeEntity(_0x3cc6d8,null))[_0xc86b('0x47')](handleError(_0x3cc6d8,null));};exports[_0xc86b('0x4f')]=function(_0x3a276b,_0x15516c){return db[_0xc86b('0x33')]['describe']()[_0xc86b('0x29')](respondWithResult(_0x15516c,null))[_0xc86b('0x47')](handleError(_0x15516c,null));};exports[_0xc86b('0x50')]=function(_0x468218,_0x15a461,_0x598df0){var _0x4e6219={'raw':!![],'where':{}},_0x403dfe={},_0x11077c;return db[_0xc86b('0x33')][_0xc86b('0x51')]({'where':{'id':_0x468218[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x15a461,null))[_0xc86b('0x29')](function(_0x1be7cf){if(_0x1be7cf){_0x11077c=_0x1be7cf['get']({'plain':!![]});_0x403dfe[_0xc86b('0x36')]=_[_0xc86b('0x38')](db[_0xc86b('0x52')][_0xc86b('0x34')]);_0x403dfe[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x468218['query']);_0x403dfe[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x403dfe[_0xc86b('0x36')],_0x403dfe['query']);_0x4e6219[_0xc86b('0x3b')]=_[_0xc86b('0x3a')](_0x403dfe['model'],qs[_0xc86b('0x3c')](_0x468218[_0xc86b('0x37')][_0xc86b('0x3c')]));_0x4e6219['attributes']=_0x4e6219[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x4e6219[_0xc86b('0x3b')]:_0x403dfe[_0xc86b('0x36')];if(!_0x468218['query'][_0xc86b('0x3e')](_0xc86b('0x53'))){_0x4e6219[_0xc86b('0x22')]=qs[_0xc86b('0x22')](_0x468218[_0xc86b('0x37')][_0xc86b('0x22')]);_0x4e6219[_0xc86b('0x21')]=qs[_0xc86b('0x21')](_0x468218[_0xc86b('0x37')][_0xc86b('0x21')]);}_0x4e6219['order']=qs[_0xc86b('0x40')](_0x468218[_0xc86b('0x37')][_0xc86b('0x40')]);_0x4e6219[_0xc86b('0x41')]=qs[_0xc86b('0x39')](_[_0xc86b('0x54')](_0x468218[_0xc86b('0x37')],_0x403dfe['filters']));_0x4e6219[_0xc86b('0x41')][_0xc86b('0x55')]=_0x1be7cf['id'];if(_0x468218[_0xc86b('0x37')][_0xc86b('0x42')]){_0x4e6219['where']=_[_0xc86b('0x43')](_0x4e6219[_0xc86b('0x41')],{'$or':_[_0xc86b('0x32')](_0x4e6219[_0xc86b('0x3b')],function(_0x432d39){var _0x3a9022={};_0x3a9022[_0x432d39]={'$like':'%'+_0x468218[_0xc86b('0x37')]['filter']+'%'};return _0x3a9022;})});}_0x4e6219=_[_0xc86b('0x43')]({},_0x4e6219,_0x468218[_0xc86b('0x44')]);return db[_0xc86b('0x52')][_0xc86b('0x56')](_0x4e6219);}})[_0xc86b('0x29')](function(_0x4b126c){if(_0x4b126c){return db[_0xc86b('0x57')][_0xc86b('0x58')]({'where':{'id':_[_0xc86b('0x32')](_0x4b126c,_0xc86b('0x59')),'role':_0xc86b('0x5a')},'attributes':['id','name',_0xc86b('0x5b'),_0xc86b('0x5c'),_0xc86b('0x5d')]});}})['then'](function(_0x31b971){if(_0x31b971){return{'count':_0x31b971[_0xc86b('0x24')],'rows':_[_0xc86b('0x32')](_0x31b971['rows'],function(_0x137721){return{'membername':_0x137721['name'],'UserId':_0x137721['id'],'queue_name':_0x11077c[_0xc86b('0x2f')],'SmsQueueId':_0x11077c['id'],'interface':util[_0xc86b('0x5e')](_0xc86b('0x5f'),_0xc86b('0x60'),_0x137721['name']),'penalty':0x0,'paused':_0x137721['smsPause'],'createdAt':_0x137721['createdAt'],'updatedAt':_0x137721[_0xc86b('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc86b('0x29')](respondWithFilteredResult(_0x15a461,_0x4e6219))[_0xc86b('0x47')](handleError(_0x15a461,null));};exports[_0xc86b('0x61')]=function(_0x593f4f,_0x2a017e,_0x159cad){var _0x49acc7={};var _0x3be667={};var _0x2984ac;var _0x4534f2;return db['SmsQueue'][_0xc86b('0x51')]({'where':{'id':_0x593f4f[_0xc86b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2a017e,null))[_0xc86b('0x29')](function(_0x428fb7){if(_0x428fb7){_0x2984ac=_0x428fb7;_0x3be667[_0xc86b('0x36')]=_[_0xc86b('0x38')](db[_0xc86b('0x62')][_0xc86b('0x34')]);_0x3be667[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x593f4f[_0xc86b('0x37')]);_0x3be667['filters']=_[_0xc86b('0x3a')](_0x3be667['model'],_0x3be667[_0xc86b('0x37')]);_0x49acc7[_0xc86b('0x3b')]=_['intersection'](_0x3be667[_0xc86b('0x36')],qs['fields'](_0x593f4f[_0xc86b('0x37')]['fields']));_0x49acc7[_0xc86b('0x3b')]=_0x49acc7[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x49acc7[_0xc86b('0x3b')]:_0x3be667['model'];_0x49acc7['order']=qs[_0xc86b('0x40')](_0x593f4f[_0xc86b('0x37')][_0xc86b('0x40')]);_0x49acc7[_0xc86b('0x41')]=qs['filters'](_[_0xc86b('0x54')](_0x593f4f[_0xc86b('0x37')],_0x3be667[_0xc86b('0x39')]));if(_0x593f4f['query']['filter']){_0x49acc7[_0xc86b('0x41')]=_[_0xc86b('0x43')](_0x49acc7[_0xc86b('0x41')],{'$or':_[_0xc86b('0x32')](_0x49acc7[_0xc86b('0x3b')],function(_0x5ac108){var _0x271ddc={};_0x271ddc[_0x5ac108]={'$like':'%'+_0x593f4f[_0xc86b('0x37')][_0xc86b('0x42')]+'%'};return _0x271ddc;})});}_0x49acc7=_[_0xc86b('0x43')]({},_0x49acc7,_0x593f4f['options']);return _0x2984ac['getTeams'](_0x49acc7);}})[_0xc86b('0x29')](function(_0x20a6bf){if(_0x20a6bf){_0x4534f2=_0x20a6bf[_0xc86b('0x3d')];if(!_0x593f4f[_0xc86b('0x37')]['hasOwnProperty']('nolimit')){_0x49acc7['limit']=qs[_0xc86b('0x22')](_0x593f4f[_0xc86b('0x37')][_0xc86b('0x22')]);_0x49acc7[_0xc86b('0x21')]=qs[_0xc86b('0x21')](_0x593f4f['query'][_0xc86b('0x21')]);}return _0x2984ac[_0xc86b('0x61')](_0x49acc7);}})[_0xc86b('0x29')](function(_0x494a77){if(_0x494a77){return _0x494a77?{'count':_0x4534f2,'rows':_0x494a77}:null;}})[_0xc86b('0x29')](respondWithResult(_0x2a017e,null))[_0xc86b('0x47')](handleError(_0x2a017e,null));};exports[_0xc86b('0x63')]=function(_0x2f628c,_0x16c138,_0x356664){var _0x303aa8=_0x2f628c[_0xc86b('0x49')][_0xc86b('0x64')];return db[_0xc86b('0x62')][_0xc86b('0x56')]({'where':{'id':_0x303aa8},'attributes':['id'],'include':[{'model':db[_0xc86b('0x57')],'as':_0xc86b('0x65'),'attributes':['id',_0xc86b('0x2f'),_0xc86b('0x66'),_0xc86b('0x67'),_0xc86b('0x68')],'raw':!![]}]})[_0xc86b('0x29')](function(_0x1d589d){if(_0x1d589d){var _0x1c3316=_[_0xc86b('0x69')](_0x1d589d,function(_0x21572e){var _0x4fd0af=_0x21572e[_0xc86b('0x2b')]({'plain':!![]});return _0x4fd0af[_0xc86b('0x65')];});return db[_0xc86b('0x33')]['find']({'where':{'id':_0x2f628c['params']['id']}})['then'](function(_0xc965f){return db['sequelize'][_0xc86b('0x6a')](function(_0x314233){return _0xc965f[_0xc86b('0x63')](_0x303aa8,{'transaction':_0x314233})['then'](function(){return BPromise[_0xc86b('0x6b')](_0x1c3316,function(_0x29ad21){return db[_0xc86b('0x52')]['findOrCreate']({'where':{'UserId':_0x29ad21['id'],'SmsQueueId':_0x2f628c['params']['id']},'transaction':_0x314233});});})[_0xc86b('0x29')](function(){_0x1c3316['forEach'](function(_0x39440f){socket[_0xc86b('0x6c')](_0xc86b('0x6d'),{'UserId':_0x39440f['id'],'SmsQueueId':_0xc965f['id']});});});});});}})[_0xc86b('0x29')](respondWithStatusCode(_0x16c138,null))[_0xc86b('0x47')](handleError(_0x16c138,null));};exports[_0xc86b('0x6e')]=function(_0x1ac7f9,_0x4b4cbb,_0x5db4d2){return db[_0xc86b('0x62')][_0xc86b('0x56')]({'where':{'id':_0x1ac7f9[_0xc86b('0x37')][_0xc86b('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc86b('0x65'),'attributes':['id'],'raw':!![]}]})[_0xc86b('0x29')](handleEntityNotFound(_0x4b4cbb,null))[_0xc86b('0x29')](function(_0x5d779f){var _0x5b30f3=_[_0xc86b('0x32')](_0x5d779f,'id');var _0x11787c=[];var _0x5f23e0=[];var _0x256d80=squel[_0xc86b('0x6f')]();_0x256d80[_0xc86b('0x70')](_0xc86b('0x71'))['from'](_0xc86b('0x72'),'tq')[_0xc86b('0x73')](_0xc86b('0x74'),'ut',_0xc86b('0x75'))[_0xc86b('0x41')]('SmsQueueId\x20=\x20?',_0x1ac7f9[_0xc86b('0x4e')]['id']);for(var _0x15996b=0x0;_0x15996b<_0x5d779f[_0xc86b('0x3d')];_0x15996b+=0x1){let _0x3a0f1d=_0x5d779f[_0x15996b];for(var _0x407be0=0x0;_0x407be0<_0x3a0f1d[_0xc86b('0x65')][_0xc86b('0x3d')];_0x407be0+=0x1){let _0x17a4bb=_0x3a0f1d[_0xc86b('0x65')][_0x407be0];var _0x1981a9=_0x256d80[_0xc86b('0x76')]();_0x1981a9[_0xc86b('0x41')](_0xc86b('0x77'),_0x17a4bb['id']);_0x5f23e0['push'](db[_0xc86b('0x78')][_0xc86b('0x37')](_0x1981a9[_0xc86b('0x79')](),{'type':db[_0xc86b('0x78')][_0xc86b('0x7a')][_0xc86b('0x7b')]})[_0xc86b('0x29')](function(_0x291219){if(_0x291219[_0xc86b('0x3d')]===0x1){return _0x17a4bb['id'];}else{var _0x5a58d9=_['every'](_[_0xc86b('0x32')](_0x291219,'TeamId'),function(_0x4ba809){return _['includes'](_0x5b30f3,_0x4ba809);});if(_0x5a58d9){return _0x17a4bb['id'];}}}));}}return BPromise[_0xc86b('0x7c')](_0x5f23e0)[_0xc86b('0x29')](function(_0x1ae55d){_0x11787c=_(_0x11787c)[_0xc86b('0x7d')](_0x1ae55d)[_0xc86b('0x7e')]()['value']();return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x1ac7f9['params']['id']}})[_0xc86b('0x29')](function(_0x59ce29){return db['sequelize'][_0xc86b('0x6a')](function(_0x569dec){return _0x59ce29[_0xc86b('0x6e')](_0x1ac7f9[_0xc86b('0x37')]['ids'],{'transaction':_0x569dec})[_0xc86b('0x29')](function(){if(!_['isEmpty'](_0x11787c)){return _0x59ce29['removeAgents'](_0x11787c,{'transaction':_0x569dec});}})['then'](function(){_0x11787c[_0xc86b('0x7f')](function(_0x5f03d){socket['emit'](_0xc86b('0x80'),{'UserId':_0x5f03d,'SmsQueueId':_0x59ce29['id']});});});});});});})['then'](respondWithStatusCode(_0x4b4cbb,null))[_0xc86b('0x47')](handleError(_0x4b4cbb,null));};exports['addAgents']=function(_0x3cac00,_0x4c5c12,_0x44b661){return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x3cac00[_0xc86b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4c5c12,null))[_0xc86b('0x29')](function(_0x43f556){if(_0x43f556){return _0x43f556[_0xc86b('0x81')](_0x3cac00[_0xc86b('0x49')][_0xc86b('0x64')],_[_0xc86b('0x82')](_0x3cac00[_0xc86b('0x49')],[_0xc86b('0x64'),'id'])||{})['spread'](function(_0x539077){for(var _0x3f90fe=0x0;_0x3f90fe<_0x3cac00[_0xc86b('0x49')][_0xc86b('0x64')][_0xc86b('0x3d')];_0x3f90fe+=0x1){socket['emit'](_0xc86b('0x6d'),{'UserId':Number(_0x3cac00[_0xc86b('0x49')][_0xc86b('0x64')][_0x3f90fe]),'SmsQueueId':Number(_0x3cac00[_0xc86b('0x4e')]['id'])});}return _0x539077;});}})[_0xc86b('0x29')](respondWithResult(_0x4c5c12,null))[_0xc86b('0x47')](handleError(_0x4c5c12,null));};exports['removeAgents']=function(_0x16a00f,_0x37444f,_0x177a8e){return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x16a00f[_0xc86b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x37444f,null))[_0xc86b('0x29')](function(_0x155027){if(_0x155027){return _0x155027[_0xc86b('0x83')](_0x16a00f[_0xc86b('0x37')]['ids'])[_0xc86b('0x29')](function(){if(_[_0xc86b('0x84')](_0x16a00f[_0xc86b('0x37')][_0xc86b('0x64')])){for(var _0x4e27bb=0x0;_0x4e27bb<_0x16a00f[_0xc86b('0x37')]['ids'][_0xc86b('0x3d')];_0x4e27bb+=0x1){socket[_0xc86b('0x6c')](_0xc86b('0x80'),{'UserId':Number(_0x16a00f[_0xc86b('0x37')][_0xc86b('0x64')][_0x4e27bb]),'SmsQueueId':Number(_0x16a00f[_0xc86b('0x4e')]['id'])});}}else{socket[_0xc86b('0x6c')]('userSmsQueue:remove',{'UserId':Number(_0x16a00f['query']['ids']),'SmsQueueId':Number(_0x16a00f[_0xc86b('0x4e')]['id'])});}});}})[_0xc86b('0x29')](respondWithStatusCode(_0x37444f,null))['catch'](handleError(_0x37444f,null));};exports[_0xc86b('0x85')]=function(_0x570705,_0x3de6af,_0x325407){var _0x1d4f56={};var _0x297113={};var _0x547759;var _0x2ae6d3;return db['SmsQueue']['findOne']({'where':{'id':_0x570705[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x3de6af,null))[_0xc86b('0x29')](function(_0x5c37f6){if(_0x5c37f6){_0x547759=_0x5c37f6;_0x297113['model']=_[_0xc86b('0x38')](db[_0xc86b('0x57')][_0xc86b('0x34')]);_0x297113[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x570705[_0xc86b('0x37')]);_0x297113[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x297113[_0xc86b('0x36')],_0x297113[_0xc86b('0x37')]);_0x1d4f56[_0xc86b('0x3b')]=_[_0xc86b('0x3a')](_0x297113[_0xc86b('0x36')],qs[_0xc86b('0x3c')](_0x570705[_0xc86b('0x37')][_0xc86b('0x3c')]));_0x1d4f56[_0xc86b('0x3b')]=_0x1d4f56[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x1d4f56[_0xc86b('0x3b')]:_0x297113[_0xc86b('0x36')];_0x1d4f56[_0xc86b('0x3f')]=qs[_0xc86b('0x40')](_0x570705[_0xc86b('0x37')][_0xc86b('0x40')]);_0x1d4f56[_0xc86b('0x41')]=qs['filters'](_[_0xc86b('0x54')](_0x570705['query'],_0x297113[_0xc86b('0x39')]));if(_0x570705[_0xc86b('0x37')][_0xc86b('0x42')]){_0x1d4f56[_0xc86b('0x41')]=_['merge'](_0x1d4f56['where'],{'$or':_[_0xc86b('0x32')](_0x1d4f56[_0xc86b('0x3b')],function(_0x450f5c){var _0x49f911={};_0x49f911[_0x450f5c]={'$like':'%'+_0x570705[_0xc86b('0x37')][_0xc86b('0x42')]+'%'};return _0x49f911;})});}_0x1d4f56=_['merge']({},_0x1d4f56,_0x570705[_0xc86b('0x44')]);return _0x547759[_0xc86b('0x85')](_0x1d4f56);}})['then'](function(_0x24c34e){if(_0x24c34e){_0x2ae6d3=_0x24c34e['length'];if(!_0x570705[_0xc86b('0x37')][_0xc86b('0x3e')](_0xc86b('0x53'))){_0x1d4f56[_0xc86b('0x22')]=qs[_0xc86b('0x22')](_0x570705[_0xc86b('0x37')]['limit']);_0x1d4f56[_0xc86b('0x21')]=qs[_0xc86b('0x21')](_0x570705[_0xc86b('0x37')][_0xc86b('0x21')]);}return _0x547759[_0xc86b('0x85')](_0x1d4f56);}})[_0xc86b('0x29')](function(_0x2f0a81){if(_0x2f0a81){return _0x2f0a81?{'count':_0x2ae6d3,'rows':_0x2f0a81}:null;}})['then'](respondWithResult(_0x3de6af,null))[_0xc86b('0x47')](handleError(_0x3de6af,null));}; \ No newline at end of file +var _0x184c=['forEach','emit','userSmsQueue:save','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','removeTeams','ids','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','fieldName','type','model','query','filters','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','then','include','findAll','catch','show','keys','attributes','length','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','find','describe','findOne','UserSmsQueue','nolimit','User','findAndCountAll','UserId','agent','smsPause','rows','format','%s/%s','createdAt','updatedAt','getTeams','Agents','voicePause','sequelize','transaction','each'];(function(_0x2678c9,_0x5e330f){var _0x495a2a=function(_0x511700){while(--_0x511700){_0x2678c9['push'](_0x2678c9['shift']());}};_0x495a2a(++_0x5e330f);}(_0x184c,0x1c3));var _0xc184=function(_0x57a124,_0x2787b4){_0x57a124=_0x57a124-0x0;var _0x171bb8=_0x184c[_0x57a124];return _0x171bb8;};'use strict';var emlformat=require(_0xc184('0x0'));var rimraf=require(_0xc184('0x1'));var zipdir=require(_0xc184('0x2'));var jsonpatch=require(_0xc184('0x3'));var rp=require(_0xc184('0x4'));var moment=require(_0xc184('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc184('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc184('0x7'));var csv=require('to-csv');var ejs=require(_0xc184('0x8'));var fs=require('fs');var fs_extra=require(_0xc184('0x9'));var _=require(_0xc184('0xa'));var squel=require('squel');var crypto=require(_0xc184('0xb'));var jsforce=require(_0xc184('0xc'));var deskjs=require(_0xc184('0xd'));var toCsv=require(_0xc184('0xe'));var querystring=require('querystring');var Papa=require(_0xc184('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc184('0x10'));var as=require(_0xc184('0x11'));var hardwareService=require(_0xc184('0x12'));var logger=require(_0xc184('0x13'))(_0xc184('0x14'));var utils=require(_0xc184('0x15'));var config=require(_0xc184('0x16'));var licenseUtil=require(_0xc184('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc184('0x18')](config[_0xc184('0x19')],{'host':_0xc184('0x1a'),'port':0x18eb});var socket=require(_0xc184('0x1b'))(new Redis(config[_0xc184('0x19')]));require(_0xc184('0x1c'))[_0xc184('0x1d')](socket);function respondWithStatusCode(_0x38bbbe,_0x52b8ca){_0x52b8ca=_0x52b8ca||0xcc;return function(_0x2a926f){if(_0x2a926f){return _0x38bbbe[_0xc184('0x1e')](_0x52b8ca);}return _0x38bbbe['status'](_0x52b8ca)[_0xc184('0x1f')]();};}function respondWithResult(_0x1b95cd,_0x22a9af){_0x22a9af=_0x22a9af||0xc8;return function(_0x461144){if(_0x461144){return _0x1b95cd['status'](_0x22a9af)[_0xc184('0x20')](_0x461144);}};}function respondWithFilteredResult(_0x4add75,_0x34f9f9){return function(_0x48e252){if(_0x48e252){var _0x5821b2=typeof _0x34f9f9[_0xc184('0x21')]===_0xc184('0x22')&&typeof _0x34f9f9[_0xc184('0x23')]===_0xc184('0x22');var _0x1f8620=_0x48e252[_0xc184('0x24')];var _0x591f7e=_0x5821b2?0x0:_0x34f9f9[_0xc184('0x21')];var _0x21cb0d=_0x5821b2?_0x48e252['count']:_0x34f9f9['offset']+_0x34f9f9[_0xc184('0x23')];var _0x4afb66;if(_0x21cb0d>=_0x1f8620){_0x21cb0d=_0x1f8620;_0x4afb66=0xc8;}else{_0x4afb66=0xce;}_0x4add75[_0xc184('0x25')](_0x4afb66);return _0x4add75[_0xc184('0x26')](_0xc184('0x27'),_0x591f7e+'-'+_0x21cb0d+'/'+_0x1f8620)[_0xc184('0x20')](_0x48e252);}return null;};}function patchUpdates(_0x200277){return function(_0x1bb6af){try{jsonpatch[_0xc184('0x28')](_0x1bb6af,_0x200277,!![]);}catch(_0x21c643){return BPromise[_0xc184('0x29')](_0x21c643);}return _0x1bb6af[_0xc184('0x2a')]();};}function saveUpdates(_0x55b55d,_0x288de4){return function(_0x39f0f7){if(_0x39f0f7){return _0x39f0f7[_0xc184('0x2b')](_0x55b55d)['then'](function(_0x1704ff){return _0x1704ff;});}return null;};}function removeEntity(_0x545de6,_0x3271ca){return function(_0xe7931){if(_0xe7931){return _0xe7931['destroy']()['then'](function(){var _0x4dde0b=_0xe7931['get']({'plain':!![]});var _0xcf69da=_0xc184('0x2c');return db[_0xc184('0x2d')]['destroy']({'where':{'type':_0xcf69da,'resourceId':_0x4dde0b['id']}})['then'](function(){return _0xe7931;});})['then'](function(){_0x545de6[_0xc184('0x25')](0xcc)[_0xc184('0x1f')]();});}};}function handleEntityNotFound(_0x923d5e,_0x246718){return function(_0x3c6bd4){if(!_0x3c6bd4){_0x923d5e[_0xc184('0x1e')](0x194);}return _0x3c6bd4;};}function handleError(_0x2848f3,_0x498bd3){_0x498bd3=_0x498bd3||0x1f4;return function(_0x3e9c0f){logger[_0xc184('0x2e')](_0x3e9c0f[_0xc184('0x2f')]);if(_0x3e9c0f[_0xc184('0x30')]){delete _0x3e9c0f[_0xc184('0x30')];}_0x2848f3[_0xc184('0x25')](_0x498bd3)[_0xc184('0x31')](_0x3e9c0f);};}exports[_0xc184('0x32')]=function(_0xc1c90b,_0x4953b2){var _0x572da2={},_0x2f205a={},_0x179989={'count':0x0,'rows':[]};var _0x550739=_[_0xc184('0x33')](db[_0xc184('0x34')]['rawAttributes'],function(_0x1c0c6d){return{'name':_0x1c0c6d[_0xc184('0x35')],'type':_0x1c0c6d[_0xc184('0x36')]['key']};});_0x2f205a[_0xc184('0x37')]=_['map'](_0x550739,'name');_0x2f205a[_0xc184('0x38')]=_['keys'](_0xc1c90b[_0xc184('0x38')]);_0x2f205a[_0xc184('0x39')]=_[_0xc184('0x3a')](_0x2f205a[_0xc184('0x37')],_0x2f205a[_0xc184('0x38')]);_0x572da2['attributes']=_['intersection'](_0x2f205a[_0xc184('0x37')],qs[_0xc184('0x3b')](_0xc1c90b[_0xc184('0x38')][_0xc184('0x3b')]));_0x572da2['attributes']=_0x572da2['attributes']['length']?_0x572da2['attributes']:_0x2f205a[_0xc184('0x37')];if(!_0xc1c90b[_0xc184('0x38')][_0xc184('0x3c')]('nolimit')){_0x572da2['limit']=qs[_0xc184('0x23')](_0xc1c90b[_0xc184('0x38')]['limit']);_0x572da2[_0xc184('0x21')]=qs[_0xc184('0x21')](_0xc1c90b['query'][_0xc184('0x21')]);}_0x572da2[_0xc184('0x3d')]=qs[_0xc184('0x3e')](_0xc1c90b['query'][_0xc184('0x3e')]);_0x572da2[_0xc184('0x3f')]=qs[_0xc184('0x39')](_[_0xc184('0x40')](_0xc1c90b[_0xc184('0x38')],_0x2f205a['filters']),_0x550739);if(_0xc1c90b[_0xc184('0x38')][_0xc184('0x41')]){_0x572da2['where']=_[_0xc184('0x42')](_0x572da2[_0xc184('0x3f')],{'$or':_[_0xc184('0x33')](_0x550739,function(_0x3aea9c){if(_0x3aea9c[_0xc184('0x36')]!==_0xc184('0x43')){var _0xf3c34d={};_0xf3c34d[_0x3aea9c[_0xc184('0x30')]]={'$like':'%'+_0xc1c90b['query'][_0xc184('0x41')]+'%'};return _0xf3c34d;}})});}_0x572da2=_['merge']({},_0x572da2,_0xc1c90b['options']);var _0x2194c3={'where':_0x572da2[_0xc184('0x3f')]};return db[_0xc184('0x34')][_0xc184('0x24')](_0x2194c3)[_0xc184('0x44')](function(_0x4d5ce0){_0x179989[_0xc184('0x24')]=_0x4d5ce0;if(_0xc1c90b[_0xc184('0x38')]['includeAll']){_0x572da2[_0xc184('0x45')]=[{'all':!![]}];}return db['SmsQueue'][_0xc184('0x46')](_0x572da2);})[_0xc184('0x44')](function(_0x24059e){_0x179989['rows']=_0x24059e;return _0x179989;})[_0xc184('0x44')](respondWithFilteredResult(_0x4953b2,_0x572da2))[_0xc184('0x47')](handleError(_0x4953b2,null));};exports[_0xc184('0x48')]=function(_0x56c2c3,_0x4a4563){var _0x4de24d={'raw':!![],'where':{'id':_0x56c2c3['params']['id']}},_0x167b4c={};_0x167b4c[_0xc184('0x37')]=_[_0xc184('0x49')](db[_0xc184('0x34')]['rawAttributes']);_0x167b4c[_0xc184('0x38')]=_[_0xc184('0x49')](_0x56c2c3[_0xc184('0x38')]);_0x167b4c[_0xc184('0x39')]=_[_0xc184('0x3a')](_0x167b4c[_0xc184('0x37')],_0x167b4c[_0xc184('0x38')]);_0x4de24d[_0xc184('0x4a')]=_[_0xc184('0x3a')](_0x167b4c[_0xc184('0x37')],qs[_0xc184('0x3b')](_0x56c2c3['query'][_0xc184('0x3b')]));_0x4de24d['attributes']=_0x4de24d[_0xc184('0x4a')][_0xc184('0x4b')]?_0x4de24d[_0xc184('0x4a')]:_0x167b4c[_0xc184('0x37')];if(_0x56c2c3[_0xc184('0x38')][_0xc184('0x4c')]){_0x4de24d['include']=[{'all':!![]}];}_0x4de24d=_[_0xc184('0x42')]({},_0x4de24d,_0x56c2c3[_0xc184('0x4d')]);return db[_0xc184('0x34')]['find'](_0x4de24d)[_0xc184('0x44')](handleEntityNotFound(_0x4a4563,null))[_0xc184('0x44')](respondWithResult(_0x4a4563,null))[_0xc184('0x47')](handleError(_0x4a4563,null));};exports[_0xc184('0x4e')]=function(_0x1031e6,_0x487435){return db[_0xc184('0x34')][_0xc184('0x4e')](_0x1031e6[_0xc184('0x4f')],{})[_0xc184('0x44')](function(_0xc8d73e){var _0xb9ccae=_0x1031e6[_0xc184('0x50')][_0xc184('0x51')]({'plain':!![]});if(!_0xb9ccae)throw new Error(_0xc184('0x52'));if(_0xb9ccae['role']===_0xc184('0x50')){var _0x2212ba=_0xc8d73e[_0xc184('0x51')]({'plain':!![]});var _0x265ed0='SmsQueues';return db[_0xc184('0x53')]['find']({'where':{'name':_0x265ed0,'userProfileId':_0xb9ccae['userProfileId']},'raw':!![]})[_0xc184('0x44')](function(_0x4aecc9){if(_0x4aecc9&&_0x4aecc9[_0xc184('0x54')]===0x0){return db[_0xc184('0x2d')][_0xc184('0x4e')]({'name':_0x2212ba[_0xc184('0x30')],'resourceId':_0x2212ba['id'],'type':_0x4aecc9[_0xc184('0x30')],'sectionId':_0x4aecc9['id']},{})[_0xc184('0x44')](function(){return _0xc8d73e;});}else{return _0xc8d73e;}})[_0xc184('0x47')](function(_0x356773){logger[_0xc184('0x2e')](_0xc184('0x55'),_0x356773);throw _0x356773;});}return _0xc8d73e;})[_0xc184('0x44')](respondWithResult(_0x487435,0xc9))[_0xc184('0x47')](handleError(_0x487435,null));};exports['update']=function(_0x234953,_0x175755){if(_0x234953[_0xc184('0x4f')]['id']){delete _0x234953[_0xc184('0x4f')]['id'];}return db[_0xc184('0x34')]['find']({'where':{'id':_0x234953[_0xc184('0x56')]['id']}})[_0xc184('0x44')](handleEntityNotFound(_0x175755,null))[_0xc184('0x44')](saveUpdates(_0x234953[_0xc184('0x4f')],null))[_0xc184('0x44')](respondWithResult(_0x175755,null))[_0xc184('0x47')](handleError(_0x175755,null));};exports[_0xc184('0x57')]=function(_0x2ad5bc,_0x14557a){return db['SmsQueue'][_0xc184('0x58')]({'where':{'id':_0x2ad5bc[_0xc184('0x56')]['id']}})['then'](handleEntityNotFound(_0x14557a,null))[_0xc184('0x44')](removeEntity(_0x14557a,null))['catch'](handleError(_0x14557a,null));};exports[_0xc184('0x59')]=function(_0x5f124d,_0x3bab49){return db[_0xc184('0x34')][_0xc184('0x59')]()['then'](respondWithResult(_0x3bab49,null))[_0xc184('0x47')](handleError(_0x3bab49,null));};exports['getMembers']=function(_0xcd08a7,_0x308284,_0x231993){var _0x52b58c={'raw':!![],'where':{}},_0x5e9ebc={},_0x1d9b80;return db[_0xc184('0x34')][_0xc184('0x5a')]({'where':{'id':_0xcd08a7[_0xc184('0x56')]['id']}})['then'](handleEntityNotFound(_0x308284,null))[_0xc184('0x44')](function(_0x59ba0d){if(_0x59ba0d){_0x1d9b80=_0x59ba0d[_0xc184('0x51')]({'plain':!![]});_0x5e9ebc[_0xc184('0x37')]=_[_0xc184('0x49')](db[_0xc184('0x5b')]['rawAttributes']);_0x5e9ebc[_0xc184('0x38')]=_[_0xc184('0x49')](_0xcd08a7[_0xc184('0x38')]);_0x5e9ebc[_0xc184('0x39')]=_['intersection'](_0x5e9ebc[_0xc184('0x37')],_0x5e9ebc[_0xc184('0x38')]);_0x52b58c['attributes']=_[_0xc184('0x3a')](_0x5e9ebc[_0xc184('0x37')],qs[_0xc184('0x3b')](_0xcd08a7[_0xc184('0x38')][_0xc184('0x3b')]));_0x52b58c[_0xc184('0x4a')]=_0x52b58c[_0xc184('0x4a')][_0xc184('0x4b')]?_0x52b58c[_0xc184('0x4a')]:_0x5e9ebc[_0xc184('0x37')];if(!_0xcd08a7[_0xc184('0x38')]['hasOwnProperty'](_0xc184('0x5c'))){_0x52b58c[_0xc184('0x23')]=qs[_0xc184('0x23')](_0xcd08a7[_0xc184('0x38')]['limit']);_0x52b58c['offset']=qs[_0xc184('0x21')](_0xcd08a7['query']['offset']);}_0x52b58c[_0xc184('0x3d')]=qs[_0xc184('0x3e')](_0xcd08a7['query']['sort']);_0x52b58c['where']=qs['filters'](_[_0xc184('0x40')](_0xcd08a7[_0xc184('0x38')],_0x5e9ebc[_0xc184('0x39')]));_0x52b58c[_0xc184('0x3f')]['SmsQueueId']=_0x59ba0d['id'];if(_0xcd08a7[_0xc184('0x38')][_0xc184('0x41')]){_0x52b58c['where']=_['merge'](_0x52b58c['where'],{'$or':_['map'](_0x52b58c[_0xc184('0x4a')],function(_0x1bf593){var _0xe84e12={};_0xe84e12[_0x1bf593]={'$like':'%'+_0xcd08a7[_0xc184('0x38')]['filter']+'%'};return _0xe84e12;})});}_0x52b58c=_[_0xc184('0x42')]({},_0x52b58c,_0xcd08a7[_0xc184('0x4d')]);return db[_0xc184('0x5b')][_0xc184('0x46')](_0x52b58c);}})[_0xc184('0x44')](function(_0x30747e){if(_0x30747e){return db[_0xc184('0x5d')][_0xc184('0x5e')]({'where':{'id':_[_0xc184('0x33')](_0x30747e,_0xc184('0x5f')),'role':_0xc184('0x60')},'attributes':['id',_0xc184('0x30'),_0xc184('0x61'),'updatedAt','createdAt']});}})['then'](function(_0x1c9da4){if(_0x1c9da4){return{'count':_0x1c9da4['count'],'rows':_[_0xc184('0x33')](_0x1c9da4[_0xc184('0x62')],function(_0x165819){return{'membername':_0x165819[_0xc184('0x30')],'UserId':_0x165819['id'],'queue_name':_0x1d9b80[_0xc184('0x30')],'SmsQueueId':_0x1d9b80['id'],'interface':util[_0xc184('0x63')](_0xc184('0x64'),'SIP',_0x165819[_0xc184('0x30')]),'penalty':0x0,'paused':_0x165819[_0xc184('0x61')],'createdAt':_0x165819[_0xc184('0x65')],'updatedAt':_0x165819[_0xc184('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x308284,_0x52b58c))[_0xc184('0x47')](handleError(_0x308284,null));};exports['getTeams']=function(_0x212390,_0x56b55d,_0x368ea4){var _0x2e33ca={};var _0x5baa0f={};var _0x3e68ae;var _0x5aff31;return db[_0xc184('0x34')][_0xc184('0x5a')]({'where':{'id':_0x212390[_0xc184('0x56')]['id']}})[_0xc184('0x44')](handleEntityNotFound(_0x56b55d,null))['then'](function(_0x3847d4){if(_0x3847d4){_0x3e68ae=_0x3847d4;_0x5baa0f['model']=_['keys'](db['Team']['rawAttributes']);_0x5baa0f[_0xc184('0x38')]=_['keys'](_0x212390[_0xc184('0x38')]);_0x5baa0f[_0xc184('0x39')]=_[_0xc184('0x3a')](_0x5baa0f[_0xc184('0x37')],_0x5baa0f[_0xc184('0x38')]);_0x2e33ca[_0xc184('0x4a')]=_[_0xc184('0x3a')](_0x5baa0f['model'],qs[_0xc184('0x3b')](_0x212390[_0xc184('0x38')][_0xc184('0x3b')]));_0x2e33ca[_0xc184('0x4a')]=_0x2e33ca[_0xc184('0x4a')][_0xc184('0x4b')]?_0x2e33ca[_0xc184('0x4a')]:_0x5baa0f['model'];_0x2e33ca[_0xc184('0x3d')]=qs['sort'](_0x212390[_0xc184('0x38')][_0xc184('0x3e')]);_0x2e33ca['where']=qs['filters'](_[_0xc184('0x40')](_0x212390[_0xc184('0x38')],_0x5baa0f[_0xc184('0x39')]));if(_0x212390['query'][_0xc184('0x41')]){_0x2e33ca[_0xc184('0x3f')]=_[_0xc184('0x42')](_0x2e33ca['where'],{'$or':_[_0xc184('0x33')](_0x2e33ca[_0xc184('0x4a')],function(_0x261d58){var _0x3bb911={};_0x3bb911[_0x261d58]={'$like':'%'+_0x212390[_0xc184('0x38')][_0xc184('0x41')]+'%'};return _0x3bb911;})});}_0x2e33ca=_['merge']({},_0x2e33ca,_0x212390['options']);return _0x3e68ae[_0xc184('0x67')](_0x2e33ca);}})['then'](function(_0x264aed){if(_0x264aed){_0x5aff31=_0x264aed[_0xc184('0x4b')];if(!_0x212390['query'][_0xc184('0x3c')](_0xc184('0x5c'))){_0x2e33ca['limit']=qs['limit'](_0x212390[_0xc184('0x38')][_0xc184('0x23')]);_0x2e33ca[_0xc184('0x21')]=qs[_0xc184('0x21')](_0x212390[_0xc184('0x38')][_0xc184('0x21')]);}return _0x3e68ae[_0xc184('0x67')](_0x2e33ca);}})[_0xc184('0x44')](function(_0x3356dc){if(_0x3356dc){return _0x3356dc?{'count':_0x5aff31,'rows':_0x3356dc}:null;}})['then'](respondWithResult(_0x56b55d,null))[_0xc184('0x47')](handleError(_0x56b55d,null));};exports['addTeams']=function(_0xe1c66d,_0x1bf265,_0x5a3372){var _0x367b55=_0xe1c66d[_0xc184('0x4f')]['ids'];return db['Team']['findAll']({'where':{'id':_0x367b55},'attributes':['id'],'include':[{'model':db[_0xc184('0x5d')],'as':_0xc184('0x68'),'attributes':['id','name','online',_0xc184('0x69'),'interface'],'raw':!![]}]})['then'](function(_0x4c39d0){if(_0x4c39d0){var _0x3e21c4=_['flatMap'](_0x4c39d0,function(_0x5725d8){var _0x20d7dc=_0x5725d8[_0xc184('0x51')]({'plain':!![]});return _0x20d7dc[_0xc184('0x68')];});return db[_0xc184('0x34')][_0xc184('0x58')]({'where':{'id':_0xe1c66d[_0xc184('0x56')]['id']}})[_0xc184('0x44')](function(_0x2d919e){return db[_0xc184('0x6a')][_0xc184('0x6b')](function(_0x235234){return _0x2d919e['addTeams'](_0x367b55,{'transaction':_0x235234})[_0xc184('0x44')](function(){return BPromise[_0xc184('0x6c')](_0x3e21c4,function(_0xe261e8){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0xe261e8['id'],'SmsQueueId':_0xe1c66d['params']['id']},'transaction':_0x235234});});})['then'](function(){_0x3e21c4[_0xc184('0x6d')](function(_0x3ca67c){socket[_0xc184('0x6e')](_0xc184('0x6f'),{'UserId':_0x3ca67c['id'],'SmsQueueId':_0x2d919e['id']});});});});});}})['then'](respondWithStatusCode(_0x1bf265,null))[_0xc184('0x47')](handleError(_0x1bf265,null));};exports['removeTeams']=function(_0x20e135,_0x2d690f,_0x357bd1){return db['Team'][_0xc184('0x46')]({'where':{'id':_0x20e135[_0xc184('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc184('0x68'),'attributes':['id'],'raw':!![]}]})[_0xc184('0x44')](handleEntityNotFound(_0x2d690f,null))[_0xc184('0x44')](function(_0x56455f){var _0x6e05ce=_[_0xc184('0x33')](_0x56455f,'id');var _0x46059e=[];var _0x1b05e0=[];var _0x1bb8c6=squel[_0xc184('0x70')]();_0x1bb8c6['field'](_0xc184('0x71'))[_0xc184('0x72')](_0xc184('0x73'),'tq')[_0xc184('0x74')](_0xc184('0x75'),'ut',_0xc184('0x76'))['where']('SmsQueueId\x20=\x20?',_0x20e135[_0xc184('0x56')]['id']);for(var _0x178cb3=0x0;_0x178cb3<_0x56455f[_0xc184('0x4b')];_0x178cb3+=0x1){let _0x3ce05b=_0x56455f[_0x178cb3];for(var _0x23da4c=0x0;_0x23da4c<_0x3ce05b[_0xc184('0x68')][_0xc184('0x4b')];_0x23da4c+=0x1){let _0x39c780=_0x3ce05b[_0xc184('0x68')][_0x23da4c];var _0xbe8129=_0x1bb8c6[_0xc184('0x77')]();_0xbe8129[_0xc184('0x3f')](_0xc184('0x78'),_0x39c780['id']);_0x1b05e0[_0xc184('0x79')](db[_0xc184('0x6a')][_0xc184('0x38')](_0xbe8129[_0xc184('0x7a')](),{'type':db['sequelize'][_0xc184('0x7b')][_0xc184('0x7c')]})[_0xc184('0x44')](function(_0x176a1f){if(_0x176a1f[_0xc184('0x4b')]===0x1){return _0x39c780['id'];}else{var _0x64e6e1=_[_0xc184('0x7d')](_[_0xc184('0x33')](_0x176a1f,'TeamId'),function(_0x4eb2ee){return _['includes'](_0x6e05ce,_0x4eb2ee);});if(_0x64e6e1){return _0x39c780['id'];}}}));}}return BPromise[_0xc184('0x7e')](_0x1b05e0)[_0xc184('0x44')](function(_0x28236d){_0x46059e=_(_0x46059e)[_0xc184('0x7f')](_0x28236d)[_0xc184('0x80')]()['value']();return db[_0xc184('0x34')][_0xc184('0x58')]({'where':{'id':_0x20e135[_0xc184('0x56')]['id']}})['then'](function(_0x264ed8){return db[_0xc184('0x6a')][_0xc184('0x6b')](function(_0x277829){return _0x264ed8[_0xc184('0x81')](_0x20e135['query'][_0xc184('0x82')],{'transaction':_0x277829})[_0xc184('0x44')](function(){if(!_[_0xc184('0x83')](_0x46059e)){return _0x264ed8[_0xc184('0x84')](_0x46059e,{'transaction':_0x277829});}})[_0xc184('0x44')](function(){_0x46059e[_0xc184('0x6d')](function(_0x3c6565){socket['emit'](_0xc184('0x85'),{'UserId':_0x3c6565,'SmsQueueId':_0x264ed8['id']});});});});});});})[_0xc184('0x44')](respondWithStatusCode(_0x2d690f,null))['catch'](handleError(_0x2d690f,null));};exports['addAgents']=function(_0x4ccea8,_0x41dc48,_0x267020){return db[_0xc184('0x34')]['find']({'where':{'id':_0x4ccea8[_0xc184('0x56')]['id']}})[_0xc184('0x44')](handleEntityNotFound(_0x41dc48,null))[_0xc184('0x44')](function(_0x2350c7){if(_0x2350c7){return _0x2350c7[_0xc184('0x86')](_0x4ccea8[_0xc184('0x4f')][_0xc184('0x82')],_[_0xc184('0x87')](_0x4ccea8[_0xc184('0x4f')],[_0xc184('0x82'),'id'])||{})[_0xc184('0x88')](function(_0x3920f0){for(var _0x50b1a6=0x0;_0x50b1a6<_0x4ccea8[_0xc184('0x4f')][_0xc184('0x82')]['length'];_0x50b1a6+=0x1){socket[_0xc184('0x6e')](_0xc184('0x6f'),{'UserId':Number(_0x4ccea8[_0xc184('0x4f')][_0xc184('0x82')][_0x50b1a6]),'SmsQueueId':Number(_0x4ccea8['params']['id'])});}return _0x3920f0;});}})['then'](respondWithResult(_0x41dc48,null))[_0xc184('0x47')](handleError(_0x41dc48,null));};exports[_0xc184('0x84')]=function(_0x15c7f8,_0xfcd682,_0x378ccb){return db['SmsQueue'][_0xc184('0x58')]({'where':{'id':_0x15c7f8[_0xc184('0x56')]['id']}})[_0xc184('0x44')](handleEntityNotFound(_0xfcd682,null))['then'](function(_0x30134e){if(_0x30134e){return _0x30134e['removeAgents'](_0x15c7f8[_0xc184('0x38')][_0xc184('0x82')])[_0xc184('0x44')](function(){if(_[_0xc184('0x89')](_0x15c7f8[_0xc184('0x38')][_0xc184('0x82')])){for(var _0x59b75f=0x0;_0x59b75f<_0x15c7f8[_0xc184('0x38')][_0xc184('0x82')][_0xc184('0x4b')];_0x59b75f+=0x1){socket['emit'](_0xc184('0x85'),{'UserId':Number(_0x15c7f8[_0xc184('0x38')]['ids'][_0x59b75f]),'SmsQueueId':Number(_0x15c7f8[_0xc184('0x56')]['id'])});}}else{socket[_0xc184('0x6e')](_0xc184('0x85'),{'UserId':Number(_0x15c7f8[_0xc184('0x38')]['ids']),'SmsQueueId':Number(_0x15c7f8[_0xc184('0x56')]['id'])});}});}})[_0xc184('0x44')](respondWithStatusCode(_0xfcd682,null))['catch'](handleError(_0xfcd682,null));};exports[_0xc184('0x8a')]=function(_0x23d676,_0x346760,_0x5c18c5){var _0x304f25={};var _0x5aa3ba={};var _0x15428a;var _0x5cb38f;return db[_0xc184('0x34')][_0xc184('0x5a')]({'where':{'id':_0x23d676[_0xc184('0x56')]['id']}})[_0xc184('0x44')](handleEntityNotFound(_0x346760,null))[_0xc184('0x44')](function(_0x3bd6b2){if(_0x3bd6b2){_0x15428a=_0x3bd6b2;_0x5aa3ba['model']=_['keys'](db[_0xc184('0x5d')][_0xc184('0x8b')]);_0x5aa3ba[_0xc184('0x38')]=_[_0xc184('0x49')](_0x23d676[_0xc184('0x38')]);_0x5aa3ba[_0xc184('0x39')]=_[_0xc184('0x3a')](_0x5aa3ba[_0xc184('0x37')],_0x5aa3ba['query']);_0x304f25[_0xc184('0x4a')]=_[_0xc184('0x3a')](_0x5aa3ba[_0xc184('0x37')],qs[_0xc184('0x3b')](_0x23d676[_0xc184('0x38')][_0xc184('0x3b')]));_0x304f25[_0xc184('0x4a')]=_0x304f25[_0xc184('0x4a')]['length']?_0x304f25[_0xc184('0x4a')]:_0x5aa3ba[_0xc184('0x37')];_0x304f25[_0xc184('0x3d')]=qs[_0xc184('0x3e')](_0x23d676[_0xc184('0x38')][_0xc184('0x3e')]);_0x304f25[_0xc184('0x3f')]=qs[_0xc184('0x39')](_[_0xc184('0x40')](_0x23d676[_0xc184('0x38')],_0x5aa3ba[_0xc184('0x39')]));if(_0x23d676[_0xc184('0x38')]['filter']){_0x304f25[_0xc184('0x3f')]=_[_0xc184('0x42')](_0x304f25[_0xc184('0x3f')],{'$or':_[_0xc184('0x33')](_0x304f25[_0xc184('0x4a')],function(_0x5c6df6){var _0x491910={};_0x491910[_0x5c6df6]={'$like':'%'+_0x23d676[_0xc184('0x38')]['filter']+'%'};return _0x491910;})});}_0x304f25=_['merge']({},_0x304f25,_0x23d676[_0xc184('0x4d')]);return _0x15428a[_0xc184('0x8a')](_0x304f25);}})[_0xc184('0x44')](function(_0x15369d){if(_0x15369d){_0x5cb38f=_0x15369d[_0xc184('0x4b')];if(!_0x23d676['query']['hasOwnProperty'](_0xc184('0x5c'))){_0x304f25[_0xc184('0x23')]=qs[_0xc184('0x23')](_0x23d676['query'][_0xc184('0x23')]);_0x304f25[_0xc184('0x21')]=qs[_0xc184('0x21')](_0x23d676[_0xc184('0x38')][_0xc184('0x21')]);}return _0x15428a[_0xc184('0x8a')](_0x304f25);}})['then'](function(_0x583c9){if(_0x583c9){return _0x583c9?{'count':_0x5cb38f,'rows':_0x583c9}:null;}})[_0xc184('0x44')](respondWithResult(_0x346760,null))['catch'](handleError(_0x346760,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 887f909..025ec0e 100644 --- a/server/api/smsQueue/smsQueue.events.js +++ b/server/api/smsQueue/smsQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87cf=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove'];(function(_0x146eed,_0x547c97){var _0x17cdc4=function(_0xeac53){while(--_0xeac53){_0x146eed['push'](_0x146eed['shift']());}};_0x17cdc4(++_0x547c97);}(_0x87cf,0x189));var _0xf87c=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x87cf[_0x4b055c];return _0x4b62bb;};'use strict';var EventEmitter=require(_0xf87c('0x0'));var SmsQueue=require(_0xf87c('0x1'))['db'][_0xf87c('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf87c('0x3')](0x0);var events={'afterCreate':_0xf87c('0x4'),'afterUpdate':_0xf87c('0x5'),'afterDestroy':_0xf87c('0x6')};function emitEvent(_0x915352){return function(_0x3b855b,_0x33b04e,_0x3053c7){SmsQueueEvents['emit'](_0x915352+':'+_0x3b855b['id'],_0x3b855b);SmsQueueEvents['emit'](_0x915352,_0x3b855b);_0x3053c7(null);};}for(var e in events){if(events[_0xf87c('0x7')](e)){var event=events[e];SmsQueue[_0xf87c('0x8')](e,emitEvent(event));}}module[_0xf87c('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x4eea=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','hook'];(function(_0x43e172,_0x560b2f){var _0x13f811=function(_0x3f87ca){while(--_0x3f87ca){_0x43e172['push'](_0x43e172['shift']());}};_0x13f811(++_0x560b2f);}(_0x4eea,0x184));var _0xa4ee=function(_0x2bbd11,_0x155c1d){_0x2bbd11=_0x2bbd11-0x0;var _0x1cf67c=_0x4eea[_0x2bbd11];return _0x1cf67c;};'use strict';var EventEmitter=require(_0xa4ee('0x0'));var SmsQueue=require(_0xa4ee('0x1'))['db'][_0xa4ee('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa4ee('0x3')](0x0);var events={'afterCreate':_0xa4ee('0x4'),'afterUpdate':_0xa4ee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x212ab9){return function(_0x1189d0,_0x121c16,_0x2832bf){SmsQueueEvents[_0xa4ee('0x6')](_0x212ab9+':'+_0x1189d0['id'],_0x1189d0);SmsQueueEvents['emit'](_0x212ab9,_0x1189d0);_0x2832bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xa4ee('0x7')](e,emitEvent(event));}}module[_0xa4ee('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 580e331..accac21 100644 --- a/server/api/smsQueue/smsQueue.model.js +++ b/server/api/smsQueue/smsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70da=['moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','define','sms_queues','util','api'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0x70da,0x1b6));var _0xa70d=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x70da[_0x1deb03];return _0x189fe7;};'use strict';var _=require('lodash');var util=require(_0xa70d('0x0'));var logger=require('../../config/logger')(_0xa70d('0x1'));var moment=require(_0xa70d('0x2'));var BPromise=require(_0xa70d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa70d('0x4'));var rimraf=require(_0xa70d('0x5'));var config=require(_0xa70d('0x6'));var attributes=require(_0xa70d('0x7'));module['exports']=function(_0x55678e,_0x3bf22b){return _0x55678e[_0xa70d('0x8')]('SmsQueue',attributes,{'tableName':_0xa70d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3776=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','../../config/logger'];(function(_0x93b411,_0x4263ca){var _0x14ce11=function(_0x3f71c4){while(--_0x3f71c4){_0x93b411['push'](_0x93b411['shift']());}};_0x14ce11(++_0x4263ca);}(_0x3776,0x16a));var _0x6377=function(_0x1a3fe2,_0x553b71){_0x1a3fe2=_0x1a3fe2-0x0;var _0x490ee2=_0x3776[_0x1a3fe2];return _0x490ee2;};'use strict';var _=require(_0x6377('0x0'));var util=require('util');var logger=require(_0x6377('0x1'))(_0x6377('0x2'));var moment=require(_0x6377('0x3'));var BPromise=require(_0x6377('0x4'));var rp=require(_0x6377('0x5'));var fs=require('fs');var path=require(_0x6377('0x6'));var rimraf=require(_0x6377('0x7'));var config=require(_0x6377('0x8'));var attributes=require(_0x6377('0x9'));module[_0x6377('0xa')]=function(_0xa68aea,_0x1a4748){return _0xa68aea['define'](_0x6377('0xb'),attributes,{'tableName':_0x6377('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 509520c..056b524 100644 --- a/server/api/smsQueue/smsQueue.rpc.js +++ b/server/api/smsQueue/smsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77fd=['SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','request\x20sent','catch','GetSmsQueue','options','raw','include','map','attributes','model','ShowSmsQueue','where','then','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','register','info','debug'];(function(_0x4f0533,_0x5d8276){var _0x3351df=function(_0x40bd98){while(--_0x40bd98){_0x4f0533['push'](_0x4f0533['shift']());}};_0x3351df(++_0x5d8276);}(_0x77fd,0xde));var _0xd77f=function(_0x3a0b39,_0x23b380){_0x3a0b39=_0x3a0b39-0x0;var _0x157a23=_0x77fd[_0x3a0b39];return _0x157a23;};'use strict';var _=require(_0xd77f('0x0'));var util=require('util');var moment=require(_0xd77f('0x1'));var BPromise=require(_0xd77f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd77f('0x3'));var db=require(_0xd77f('0x4'))['db'];var utils=require(_0xd77f('0x5'));var logger=require(_0xd77f('0x6'))(_0xd77f('0x7'));var config=require('../../config/environment');var jayson=require(_0xd77f('0x8'));var client=jayson['client'][_0xd77f('0x9')]({'port':0x232a});config[_0xd77f('0xa')]=_[_0xd77f('0xb')](config[_0xd77f('0xa')],{'host':_0xd77f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd77f('0xa')]));require('./smsQueue.socket')[_0xd77f('0xd')](socket);function respondWithRpcPromise(_0x317e10,_0x2cd1c8,_0x19d8e3){return new BPromise(function(_0x1d865e,_0x12795c){return client['request'](_0x317e10,_0x19d8e3)['then'](function(_0x4f8407){logger[_0xd77f('0xe')]('SmsQueue,\x20%s,\x20%s',_0x2cd1c8,'request\x20sent');logger[_0xd77f('0xf')](_0xd77f('0x10'),_0x2cd1c8,'request\x20sent',JSON[_0xd77f('0x11')](_0x4f8407));if(_0x4f8407[_0xd77f('0x12')]){if(_0x4f8407[_0xd77f('0x12')][_0xd77f('0x13')]===0x1f4){logger[_0xd77f('0x12')](_0xd77f('0x14'),_0x2cd1c8,_0x4f8407[_0xd77f('0x12')][_0xd77f('0x15')]);return _0x12795c(_0x4f8407[_0xd77f('0x12')][_0xd77f('0x15')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x2cd1c8,_0x4f8407[_0xd77f('0x12')][_0xd77f('0x15')]);return _0x1d865e(_0x4f8407[_0xd77f('0x12')][_0xd77f('0x15')]);}else{logger[_0xd77f('0xe')](_0xd77f('0x14'),_0x2cd1c8,_0xd77f('0x16'));_0x1d865e(_0x4f8407['result'][_0xd77f('0x15')]);}})[_0xd77f('0x17')](function(_0x23ad13){logger[_0xd77f('0x12')]('SmsQueue,\x20%s,\x20%s',_0x2cd1c8,_0x23ad13);_0x12795c(_0x23ad13);});});}exports[_0xd77f('0x18')]=function(_0x1af84d){var _0xdb8cd7=this;return new Promise(function(_0x13a02d,_0x4f1646){return db['SmsQueue']['findAll']({'raw':_0x1af84d[_0xd77f('0x19')]?_0x1af84d[_0xd77f('0x19')][_0xd77f('0x1a')]===undefined?!![]:![]:!![],'where':_0x1af84d['options']?_0x1af84d[_0xd77f('0x19')]['where']||null:null,'attributes':_0x1af84d['options']?_0x1af84d[_0xd77f('0x19')]['attributes']||null:null,'limit':_0x1af84d['options']?_0x1af84d[_0xd77f('0x19')]['limit']||null:null,'include':_0x1af84d[_0xd77f('0x19')]?_0x1af84d['options'][_0xd77f('0x1b')]?_[_0xd77f('0x1c')](_0x1af84d[_0xd77f('0x19')][_0xd77f('0x1b')],function(_0xdce3f2){return{'model':db[_0xdce3f2['model']],'as':_0xdce3f2['as'],'attributes':_0xdce3f2[_0xd77f('0x1d')],'include':_0xdce3f2[_0xd77f('0x1b')]?_[_0xd77f('0x1c')](_0xdce3f2[_0xd77f('0x1b')],function(_0x42fbea){return{'model':db[_0x42fbea[_0xd77f('0x1e')]],'as':_0x42fbea['as'],'attributes':_0x42fbea[_0xd77f('0x1d')],'include':_0x42fbea[_0xd77f('0x1b')]?_['map'](_0x42fbea[_0xd77f('0x1b')],function(_0xb57be8){return{'model':db[_0xb57be8[_0xd77f('0x1e')]],'as':_0xb57be8['as'],'attributes':_0xb57be8[_0xd77f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bd49c){logger[_0xd77f('0xe')](_0xd77f('0x18'),_0x1af84d);logger[_0xd77f('0xf')](_0xd77f('0x18'),_0x1af84d,JSON['stringify'](_0x1bd49c));_0x13a02d(_0x1bd49c);})[_0xd77f('0x17')](function(_0x12e986){logger[_0xd77f('0x12')](_0xd77f('0x18'),_0x12e986[_0xd77f('0x15')],_0x1af84d);_0x4f1646(_0xdb8cd7[_0xd77f('0x12')](0x1f4,_0x12e986[_0xd77f('0x15')]));});});};exports[_0xd77f('0x1f')]=function(_0x1a2be0){var _0x3bf38f=this;return new Promise(function(_0x373ef6,_0x58009d){return db['SmsQueue']['find']({'raw':_0x1a2be0[_0xd77f('0x19')]?_0x1a2be0[_0xd77f('0x19')][_0xd77f('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a2be0['options']?_0x1a2be0[_0xd77f('0x19')][_0xd77f('0x20')]||null:null,'attributes':_0x1a2be0[_0xd77f('0x19')]?_0x1a2be0[_0xd77f('0x19')][_0xd77f('0x1d')]||null:null,'include':_0x1a2be0[_0xd77f('0x19')]?_0x1a2be0[_0xd77f('0x19')][_0xd77f('0x1b')]?_[_0xd77f('0x1c')](_0x1a2be0[_0xd77f('0x19')]['include'],function(_0x59b001){return{'model':db[_0x59b001[_0xd77f('0x1e')]],'as':_0x59b001['as'],'attributes':_0x59b001[_0xd77f('0x1d')],'include':_0x59b001[_0xd77f('0x1b')]?_[_0xd77f('0x1c')](_0x59b001[_0xd77f('0x1b')],function(_0x3b2de5){return{'model':db[_0x3b2de5[_0xd77f('0x1e')]],'as':_0x3b2de5['as'],'attributes':_0x3b2de5[_0xd77f('0x1d')],'include':_0x3b2de5['include']?_[_0xd77f('0x1c')](_0x3b2de5[_0xd77f('0x1b')],function(_0x19844b){return{'model':db[_0x19844b['model']],'as':_0x19844b['as'],'attributes':_0x19844b[_0xd77f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd77f('0x21')](function(_0x100003){logger[_0xd77f('0xe')](_0xd77f('0x1f'),_0x1a2be0);logger['debug'](_0xd77f('0x1f'),_0x1a2be0,JSON['stringify'](_0x100003));_0x373ef6(_0x100003);})[_0xd77f('0x17')](function(_0x16ec35){logger['error']('ShowSmsQueue',_0x16ec35['message'],_0x1a2be0);_0x58009d(_0x3bf38f['error'](0x1f4,_0x16ec35[_0xd77f('0x15')]));});});}; \ No newline at end of file +var _0x2499=['request\x20sent','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','model','map','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x45f575,_0x3ae51c){var _0xd8e1a1=function(_0x34867b){while(--_0x34867b){_0x45f575['push'](_0x45f575['shift']());}};_0xd8e1a1(++_0x3ae51c);}(_0x2499,0x108));var _0x9249=function(_0x1f6cf6,_0x7ebb5){_0x1f6cf6=_0x1f6cf6-0x0;var _0x157182=_0x2499[_0x1f6cf6];return _0x157182;};'use strict';var _=require(_0x9249('0x0'));var util=require(_0x9249('0x1'));var moment=require(_0x9249('0x2'));var BPromise=require(_0x9249('0x3'));var rs=require(_0x9249('0x4'));var fs=require('fs');var Redis=require(_0x9249('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9249('0x6'));var logger=require('../../config/logger')(_0x9249('0x7'));var config=require(_0x9249('0x8'));var jayson=require(_0x9249('0x9'));var client=jayson[_0x9249('0xa')][_0x9249('0xb')]({'port':0x232a});config[_0x9249('0xc')]=_[_0x9249('0xd')](config[_0x9249('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9249('0xe'))(new Redis(config[_0x9249('0xc')]));require(_0x9249('0xf'))[_0x9249('0x10')](socket);function respondWithRpcPromise(_0x3ba37b,_0x1a3e44,_0x1124cc){return new BPromise(function(_0xdf6272,_0x32bced){return client[_0x9249('0x11')](_0x3ba37b,_0x1124cc)[_0x9249('0x12')](function(_0x395765){logger[_0x9249('0x13')](_0x9249('0x14'),_0x1a3e44,'request\x20sent');logger[_0x9249('0x15')](_0x9249('0x16'),_0x1a3e44,_0x9249('0x17'),JSON[_0x9249('0x18')](_0x395765));if(_0x395765[_0x9249('0x19')]){if(_0x395765[_0x9249('0x19')]['code']===0x1f4){logger[_0x9249('0x19')](_0x9249('0x14'),_0x1a3e44,_0x395765[_0x9249('0x19')][_0x9249('0x1a')]);return _0x32bced(_0x395765[_0x9249('0x19')][_0x9249('0x1a')]);}logger[_0x9249('0x19')](_0x9249('0x14'),_0x1a3e44,_0x395765['error']['message']);return _0xdf6272(_0x395765[_0x9249('0x19')][_0x9249('0x1a')]);}else{logger[_0x9249('0x13')](_0x9249('0x14'),_0x1a3e44,_0x9249('0x17'));_0xdf6272(_0x395765[_0x9249('0x1b')]['message']);}})[_0x9249('0x1c')](function(_0x647fef){logger[_0x9249('0x19')](_0x9249('0x14'),_0x1a3e44,_0x647fef);_0x32bced(_0x647fef);});});}exports[_0x9249('0x1d')]=function(_0x23af74){var _0x5a4988=this;return new Promise(function(_0x220453,_0x88a615){return db[_0x9249('0x1e')][_0x9249('0x1f')]({'raw':_0x23af74[_0x9249('0x20')]?_0x23af74['options'][_0x9249('0x21')]===undefined?!![]:![]:!![],'where':_0x23af74[_0x9249('0x20')]?_0x23af74['options'][_0x9249('0x22')]||null:null,'attributes':_0x23af74[_0x9249('0x20')]?_0x23af74[_0x9249('0x20')][_0x9249('0x23')]||null:null,'limit':_0x23af74[_0x9249('0x20')]?_0x23af74['options']['limit']||null:null,'include':_0x23af74[_0x9249('0x20')]?_0x23af74[_0x9249('0x20')][_0x9249('0x24')]?_['map'](_0x23af74[_0x9249('0x20')][_0x9249('0x24')],function(_0x29a32c){return{'model':db[_0x29a32c[_0x9249('0x25')]],'as':_0x29a32c['as'],'attributes':_0x29a32c[_0x9249('0x23')],'include':_0x29a32c[_0x9249('0x24')]?_[_0x9249('0x26')](_0x29a32c[_0x9249('0x24')],function(_0x5db669){return{'model':db[_0x5db669[_0x9249('0x25')]],'as':_0x5db669['as'],'attributes':_0x5db669[_0x9249('0x23')],'include':_0x5db669[_0x9249('0x24')]?_[_0x9249('0x26')](_0x5db669[_0x9249('0x24')],function(_0x52db31){return{'model':db[_0x52db31[_0x9249('0x25')]],'as':_0x52db31['as'],'attributes':_0x52db31[_0x9249('0x23')]};}):[]};}):[]};}):[]:[]})[_0x9249('0x12')](function(_0x43683e){logger['info'](_0x9249('0x1d'),_0x23af74);logger[_0x9249('0x15')](_0x9249('0x1d'),_0x23af74,JSON[_0x9249('0x18')](_0x43683e));_0x220453(_0x43683e);})[_0x9249('0x1c')](function(_0x2ea0cc){logger[_0x9249('0x19')](_0x9249('0x1d'),_0x2ea0cc['message'],_0x23af74);_0x88a615(_0x5a4988['error'](0x1f4,_0x2ea0cc[_0x9249('0x1a')]));});});};exports['ShowSmsQueue']=function(_0x182dbf){var _0x976926=this;return new Promise(function(_0x37ad8c,_0x1d0ffd){return db[_0x9249('0x1e')][_0x9249('0x27')]({'raw':_0x182dbf[_0x9249('0x20')]?_0x182dbf['options'][_0x9249('0x21')]===undefined?!![]:![]:!![],'where':_0x182dbf[_0x9249('0x20')]?_0x182dbf['options']['where']||null:null,'attributes':_0x182dbf[_0x9249('0x20')]?_0x182dbf['options'][_0x9249('0x23')]||null:null,'include':_0x182dbf['options']?_0x182dbf['options'][_0x9249('0x24')]?_[_0x9249('0x26')](_0x182dbf['options'][_0x9249('0x24')],function(_0x197f39){return{'model':db[_0x197f39[_0x9249('0x25')]],'as':_0x197f39['as'],'attributes':_0x197f39[_0x9249('0x23')],'include':_0x197f39[_0x9249('0x24')]?_[_0x9249('0x26')](_0x197f39[_0x9249('0x24')],function(_0x1fbfd0){return{'model':db[_0x1fbfd0[_0x9249('0x25')]],'as':_0x1fbfd0['as'],'attributes':_0x1fbfd0[_0x9249('0x23')],'include':_0x1fbfd0['include']?_[_0x9249('0x26')](_0x1fbfd0[_0x9249('0x24')],function(_0x2a6f0f){return{'model':db[_0x2a6f0f[_0x9249('0x25')]],'as':_0x2a6f0f['as'],'attributes':_0x2a6f0f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x8483b1){logger[_0x9249('0x13')](_0x9249('0x28'),_0x182dbf);logger[_0x9249('0x15')]('ShowSmsQueue',_0x182dbf,JSON[_0x9249('0x18')](_0x8483b1));_0x37ad8c(_0x8483b1);})['catch'](function(_0x54b4d3){logger[_0x9249('0x19')](_0x9249('0x28'),_0x54b4d3[_0x9249('0x1a')],_0x182dbf);_0x1d0ffd(_0x976926[_0x9249('0x19')](0x1f4,_0x54b4d3['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index f90fb61..15012a4 100644 --- a/server/api/smsQueue/smsQueue.socket.js +++ b/server/api/smsQueue/smsQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x072b=['smsQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x11cbd9,_0x10d5b3){var _0x1fa142=function(_0xcacba0){while(--_0xcacba0){_0x11cbd9['push'](_0x11cbd9['shift']());}};_0x1fa142(++_0x10d5b3);}(_0x072b,0x159));var _0xb072=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x072b[_0x5d4607];return _0x5e4a86;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xb072('0x0'),_0xb072('0x1'),_0xb072('0x2')];function createListener(_0x848e7f,_0x5a096e){return function(_0x156030){_0x5a096e[_0xb072('0x3')](_0x848e7f,_0x156030);};}function removeListener(_0x53683e,_0x47344d){return function(){SmsQueueEvents[_0xb072('0x4')](_0x53683e,_0x47344d);};}exports[_0xb072('0x5')]=function(_0x22f88f){for(var _0x5e3576=0x0,_0x1807d8=events[_0xb072('0x6')];_0x5e3576<_0x1807d8;_0x5e3576++){var _0x2a4f2f=events[_0x5e3576];var _0x521c37=createListener(_0xb072('0x7')+_0x2a4f2f,_0x22f88f);SmsQueueEvents['on'](_0x2a4f2f,_0x521c37);}}; \ No newline at end of file +var _0x36bf=['./smsQueue.events','update','removeListener','register','length'];(function(_0x48eba1,_0x1dc374){var _0x201de6=function(_0x5982ba){while(--_0x5982ba){_0x48eba1['push'](_0x48eba1['shift']());}};_0x201de6(++_0x1dc374);}(_0x36bf,0x14f));var _0xf36b=function(_0xb434e2,_0x563d4a){_0xb434e2=_0xb434e2-0x0;var _0x487e47=_0x36bf[_0xb434e2];return _0x487e47;};'use strict';var SmsQueueEvents=require(_0xf36b('0x0'));var events=['save','remove',_0xf36b('0x1')];function createListener(_0x174d42,_0x56e8d3){return function(_0x433699){_0x56e8d3['emit'](_0x174d42,_0x433699);};}function removeListener(_0x1a918d,_0x2d818a){return function(){SmsQueueEvents[_0xf36b('0x2')](_0x1a918d,_0x2d818a);};}exports[_0xf36b('0x3')]=function(_0x238195){for(var _0x33e051=0x0,_0x154f73=events[_0xf36b('0x4')];_0x33e051<_0x154f73;_0x33e051++){var _0x4efa6a=events[_0x33e051];var _0x4656d0=createListener('smsQueue:'+_0x4efa6a,_0x238195);SmsQueueEvents['on'](_0x4efa6a,_0x4656d0);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 2c4f5e9..4315adc 100644 --- a/server/api/smsQueueReport/index.js +++ b/server/api/smsQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc40e=['./smsQueueReport.controller','isAuthenticated','index','get','/:id','show','post','put','destroy','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x3116c9,_0x1db034){var _0x2ca671=function(_0x24dae4){while(--_0x24dae4){_0x3116c9['push'](_0x3116c9['shift']());}};_0x2ca671(++_0x1db034);}(_0xc40e,0xd9));var _0xec40=function(_0x2bcf3a,_0x460372){_0x2bcf3a=_0x2bcf3a-0x0;var _0x3bdb48=_0xc40e[_0x2bcf3a];return _0x3bdb48;};'use strict';var multer=require('multer');var util=require(_0xec40('0x0'));var path=require(_0xec40('0x1'));var timeout=require(_0xec40('0x2'));var express=require(_0xec40('0x3'));var router=express[_0xec40('0x4')]();var fs_extra=require(_0xec40('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xec40('0x6'));var controller=require(_0xec40('0x7'));router['get']('/',auth[_0xec40('0x8')](),controller[_0xec40('0x9')]);router[_0xec40('0xa')]('/describe',auth[_0xec40('0x8')](),controller['describe']);router[_0xec40('0xa')](_0xec40('0xb'),auth[_0xec40('0x8')](),controller[_0xec40('0xc')]);router[_0xec40('0xd')]('/',auth[_0xec40('0x8')](),controller['create']);router[_0xec40('0xe')](_0xec40('0xb'),auth[_0xec40('0x8')](),controller['update']);router['delete'](_0xec40('0xb'),auth['isAuthenticated'](),controller[_0xec40('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5004=['show','post','create','put','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','describe','/:id','isAuthenticated'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5004,0x84));var _0x4500=function(_0x10cb99,_0x5d712f){_0x10cb99=_0x10cb99-0x0;var _0x1c3a90=_0x5004[_0x10cb99];return _0x1c3a90;};'use strict';var multer=require('multer');var util=require(_0x4500('0x0'));var path=require(_0x4500('0x1'));var timeout=require('connect-timeout');var express=require(_0x4500('0x2'));var router=express[_0x4500('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4500('0x4'));var interaction=require(_0x4500('0x5'));var config=require(_0x4500('0x6'));var controller=require(_0x4500('0x7'));router[_0x4500('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4500('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x4500('0x9')]);router[_0x4500('0x8')](_0x4500('0xa'),auth[_0x4500('0xb')](),controller[_0x4500('0xc')]);router[_0x4500('0xd')]('/',auth[_0x4500('0xb')](),controller[_0x4500('0xe')]);router[_0x4500('0xf')](_0x4500('0xa'),auth[_0x4500('0xb')](),controller['update']);router[_0x4500('0x10')](_0x4500('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x4500('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index a63b81d..277b8ec 100644 --- a/server/api/smsQueueReport/smsQueueReport.attributes.js +++ b/server/api/smsQueueReport/smsQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40a9=['DATE','sequelize','exports','STRING'];(function(_0x552706,_0x1b193c){var _0x236183=function(_0x1a9c9a){while(--_0x1a9c9a){_0x552706['push'](_0x552706['shift']());}};_0x236183(++_0x1b193c);}(_0x40a9,0xd9));var _0x940a=function(_0x139afb,_0x416598){_0x139afb=_0x139afb-0x0;var _0x5367ce=_0x40a9[_0x139afb];return _0x5367ce;};'use strict';var moment=require('moment');var Sequelize=require(_0x940a('0x0'));module[_0x940a('0x1')]={'uniqueid':{'type':Sequelize[_0x940a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x940a('0x2')]},'joinAt':{'type':Sequelize[_0x940a('0x3')]},'leaveAt':{'type':Sequelize[_0x940a('0x3')]},'acceptAt':{'type':Sequelize[_0x940a('0x3')]},'exitAt':{'type':Sequelize[_0x940a('0x3')]},'reason':{'type':Sequelize[_0x940a('0x2')]}}; \ No newline at end of file +var _0x134d=['moment','exports','STRING','DATE'];(function(_0x42cfab,_0x1634ce){var _0x5666dc=function(_0xb9a0dd){while(--_0xb9a0dd){_0x42cfab['push'](_0x42cfab['shift']());}};_0x5666dc(++_0x1634ce);}(_0x134d,0xfc));var _0xd134=function(_0x41793b,_0x3e438d){_0x41793b=_0x41793b-0x0;var _0x37d52d=_0x134d[_0x41793b];return _0x37d52d;};'use strict';var moment=require(_0xd134('0x0'));var Sequelize=require('sequelize');module[_0xd134('0x1')]={'uniqueid':{'type':Sequelize[_0xd134('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd134('0x2')]},'joinAt':{'type':Sequelize[_0xd134('0x3')]},'leaveAt':{'type':Sequelize[_0xd134('0x3')]},'acceptAt':{'type':Sequelize[_0xd134('0x3')]},'exitAt':{'type':Sequelize[_0xd134('0x3')]},'reason':{'type':Sequelize[_0xd134('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 551e129..52fa403 100644 --- a/server/api/smsQueueReport/smsQueueReport.controller.js +++ b/server/api/smsQueueReport/smsQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd25b=['limit','count','Content-Range','reject','update','then','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd25b,0x105));var _0xbd25=function(_0x4ddf6b,_0x207b93){_0x4ddf6b=_0x4ddf6b-0x0;var _0x17e942=_0xd25b[_0x4ddf6b];return _0x17e942;};'use strict';var emlformat=require(_0xbd25('0x0'));var rimraf=require(_0xbd25('0x1'));var zipdir=require(_0xbd25('0x2'));var jsonpatch=require(_0xbd25('0x3'));var rp=require(_0xbd25('0x4'));var moment=require('moment');var BPromise=require(_0xbd25('0x5'));var Mustache=require(_0xbd25('0x6'));var util=require(_0xbd25('0x7'));var path=require(_0xbd25('0x8'));var sox=require(_0xbd25('0x9'));var csv=require(_0xbd25('0xa'));var ejs=require(_0xbd25('0xb'));var fs=require('fs');var fs_extra=require(_0xbd25('0xc'));var _=require(_0xbd25('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbd25('0xe'));var deskjs=require(_0xbd25('0xf'));var toCsv=require(_0xbd25('0xa'));var querystring=require(_0xbd25('0x10'));var Papa=require(_0xbd25('0x11'));var Redis=require(_0xbd25('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbd25('0x13'));var as=require(_0xbd25('0x14'));var hardwareService=require(_0xbd25('0x15'));var logger=require(_0xbd25('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xbd25('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd25('0x18'))['db'];function respondWithStatusCode(_0x251cdd,_0xa69f41){_0xa69f41=_0xa69f41||0xcc;return function(_0x6dd15a){if(_0x6dd15a){return _0x251cdd[_0xbd25('0x19')](_0xa69f41);}return _0x251cdd['status'](_0xa69f41)[_0xbd25('0x1a')]();};}function respondWithResult(_0x4bbcc6,_0xcc8fcc){_0xcc8fcc=_0xcc8fcc||0xc8;return function(_0x3d301c){if(_0x3d301c){return _0x4bbcc6[_0xbd25('0x1b')](_0xcc8fcc)[_0xbd25('0x1c')](_0x3d301c);}};}function respondWithFilteredResult(_0x550b5f,_0x22a092){return function(_0xdf9805){if(_0xdf9805){var _0x1f1c24=typeof _0x22a092[_0xbd25('0x1d')]===_0xbd25('0x1e')&&typeof _0x22a092[_0xbd25('0x1f')]===_0xbd25('0x1e');var _0x458f44=_0xdf9805[_0xbd25('0x20')];var _0x20d98d=_0x1f1c24?0x0:_0x22a092[_0xbd25('0x1d')];var _0x238f7e=_0x1f1c24?_0xdf9805['count']:_0x22a092[_0xbd25('0x1d')]+_0x22a092[_0xbd25('0x1f')];var _0x1546c4;if(_0x238f7e>=_0x458f44){_0x238f7e=_0x458f44;_0x1546c4=0xc8;}else{_0x1546c4=0xce;}_0x550b5f['status'](_0x1546c4);return _0x550b5f['set'](_0xbd25('0x21'),_0x20d98d+'-'+_0x238f7e+'/'+_0x458f44)[_0xbd25('0x1c')](_0xdf9805);}return null;};}function patchUpdates(_0x230cbc){return function(_0x4d909a){try{jsonpatch['apply'](_0x4d909a,_0x230cbc,!![]);}catch(_0x2b1629){return BPromise[_0xbd25('0x22')](_0x2b1629);}return _0x4d909a['save']();};}function saveUpdates(_0x325690,_0x5855a8){return function(_0x50d9fc){if(_0x50d9fc){return _0x50d9fc[_0xbd25('0x23')](_0x325690)[_0xbd25('0x24')](function(_0x3b7a94){return _0x3b7a94;});}return null;};}function removeEntity(_0x22188a,_0x4de9dc){return function(_0x264608){if(_0x264608){return _0x264608['destroy']()[_0xbd25('0x24')](function(){_0x22188a[_0xbd25('0x1b')](0xcc)[_0xbd25('0x1a')]();});}};}function handleEntityNotFound(_0x2f9a9a,_0x283b68){return function(_0x5bdb73){if(!_0x5bdb73){_0x2f9a9a[_0xbd25('0x19')](0x194);}return _0x5bdb73;};}function handleError(_0x4972a6,_0x14f858){_0x14f858=_0x14f858||0x1f4;return function(_0x840f87){logger['error'](_0x840f87[_0xbd25('0x25')]);if(_0x840f87[_0xbd25('0x26')]){delete _0x840f87['name'];}_0x4972a6['status'](_0x14f858)[_0xbd25('0x27')](_0x840f87);};}exports[_0xbd25('0x28')]=function(_0x52046d,_0x22833d){var _0x5a4c42={},_0x904f66={},_0x4d82cb={'count':0x0,'rows':[]};var _0x399e75=_[_0xbd25('0x29')](db[_0xbd25('0x2a')][_0xbd25('0x2b')],function(_0x5bb094){return{'name':_0x5bb094[_0xbd25('0x2c')],'type':_0x5bb094[_0xbd25('0x2d')][_0xbd25('0x2e')]};});_0x904f66[_0xbd25('0x2f')]=_[_0xbd25('0x29')](_0x399e75,_0xbd25('0x26'));_0x904f66['query']=_[_0xbd25('0x30')](_0x52046d[_0xbd25('0x31')]);_0x904f66[_0xbd25('0x32')]=_[_0xbd25('0x33')](_0x904f66[_0xbd25('0x2f')],_0x904f66[_0xbd25('0x31')]);_0x5a4c42[_0xbd25('0x34')]=_['intersection'](_0x904f66[_0xbd25('0x2f')],qs[_0xbd25('0x35')](_0x52046d['query'][_0xbd25('0x35')]));_0x5a4c42['attributes']=_0x5a4c42[_0xbd25('0x34')]['length']?_0x5a4c42[_0xbd25('0x34')]:_0x904f66['model'];if(!_0x52046d[_0xbd25('0x31')][_0xbd25('0x36')](_0xbd25('0x37'))){_0x5a4c42['limit']=qs[_0xbd25('0x1f')](_0x52046d[_0xbd25('0x31')][_0xbd25('0x1f')]);_0x5a4c42[_0xbd25('0x1d')]=qs['offset'](_0x52046d[_0xbd25('0x31')]['offset']);}_0x5a4c42[_0xbd25('0x38')]=qs[_0xbd25('0x39')](_0x52046d[_0xbd25('0x31')][_0xbd25('0x39')]);_0x5a4c42[_0xbd25('0x3a')]=qs[_0xbd25('0x32')](_[_0xbd25('0x3b')](_0x52046d['query'],_0x904f66['filters']),_0x399e75);if(_0x52046d['query'][_0xbd25('0x3c')]){_0x5a4c42['where']=_['merge'](_0x5a4c42[_0xbd25('0x3a')],{'$or':_[_0xbd25('0x29')](_0x399e75,function(_0x8dba74){if(_0x8dba74['type']!==_0xbd25('0x3d')){var _0x26531a={};_0x26531a[_0x8dba74['name']]={'$like':'%'+_0x52046d[_0xbd25('0x31')]['filter']+'%'};return _0x26531a;}})});}_0x5a4c42=_[_0xbd25('0x3e')]({},_0x5a4c42,_0x52046d[_0xbd25('0x3f')]);var _0xd0a335={'where':_0x5a4c42[_0xbd25('0x3a')]};return db[_0xbd25('0x2a')]['count'](_0xd0a335)[_0xbd25('0x24')](function(_0x28b604){_0x4d82cb[_0xbd25('0x20')]=_0x28b604;if(_0x52046d[_0xbd25('0x31')][_0xbd25('0x40')]){_0x5a4c42[_0xbd25('0x41')]=[{'all':!![]}];}return db[_0xbd25('0x2a')][_0xbd25('0x42')](_0x5a4c42);})[_0xbd25('0x24')](function(_0x5acd60){_0x4d82cb[_0xbd25('0x43')]=_0x5acd60;return _0x4d82cb;})[_0xbd25('0x24')](respondWithFilteredResult(_0x22833d,_0x5a4c42))[_0xbd25('0x44')](handleError(_0x22833d,null));};exports['show']=function(_0x1fb1ed,_0x53e375){var _0x54ab38={'raw':!![],'where':{'id':_0x1fb1ed['params']['id']}},_0x5c596b={};_0x5c596b[_0xbd25('0x2f')]=_[_0xbd25('0x30')](db[_0xbd25('0x2a')][_0xbd25('0x2b')]);_0x5c596b[_0xbd25('0x31')]=_['keys'](_0x1fb1ed[_0xbd25('0x31')]);_0x5c596b[_0xbd25('0x32')]=_[_0xbd25('0x33')](_0x5c596b['model'],_0x5c596b[_0xbd25('0x31')]);_0x54ab38[_0xbd25('0x34')]=_[_0xbd25('0x33')](_0x5c596b[_0xbd25('0x2f')],qs['fields'](_0x1fb1ed[_0xbd25('0x31')][_0xbd25('0x35')]));_0x54ab38['attributes']=_0x54ab38[_0xbd25('0x34')]['length']?_0x54ab38[_0xbd25('0x34')]:_0x5c596b[_0xbd25('0x2f')];if(_0x1fb1ed['query'][_0xbd25('0x40')]){_0x54ab38[_0xbd25('0x41')]=[{'all':!![]}];}_0x54ab38=_[_0xbd25('0x3e')]({},_0x54ab38,_0x1fb1ed['options']);return db[_0xbd25('0x2a')][_0xbd25('0x45')](_0x54ab38)[_0xbd25('0x24')](handleEntityNotFound(_0x53e375,null))[_0xbd25('0x24')](respondWithResult(_0x53e375,null))[_0xbd25('0x44')](handleError(_0x53e375,null));};exports[_0xbd25('0x46')]=function(_0x106e79,_0x354c81){return db[_0xbd25('0x2a')][_0xbd25('0x46')](_0x106e79[_0xbd25('0x47')],{})['then'](respondWithResult(_0x354c81,0xc9))[_0xbd25('0x44')](handleError(_0x354c81,null));};exports[_0xbd25('0x23')]=function(_0x324917,_0x5c8eb9){if(_0x324917[_0xbd25('0x47')]['id']){delete _0x324917[_0xbd25('0x47')]['id'];}return db[_0xbd25('0x2a')][_0xbd25('0x45')]({'where':{'id':_0x324917[_0xbd25('0x48')]['id']}})[_0xbd25('0x24')](handleEntityNotFound(_0x5c8eb9,null))[_0xbd25('0x24')](saveUpdates(_0x324917[_0xbd25('0x47')],null))['then'](respondWithResult(_0x5c8eb9,null))[_0xbd25('0x44')](handleError(_0x5c8eb9,null));};exports['destroy']=function(_0x407b7f,_0x26f0e2){return db[_0xbd25('0x2a')][_0xbd25('0x45')]({'where':{'id':_0x407b7f['params']['id']}})[_0xbd25('0x24')](handleEntityNotFound(_0x26f0e2,null))[_0xbd25('0x24')](removeEntity(_0x26f0e2,null))[_0xbd25('0x44')](handleError(_0x26f0e2,null));};exports['describe']=function(_0x1ee881,_0x839f9f){return db[_0xbd25('0x2a')]['describe']()[_0xbd25('0x24')](respondWithResult(_0x839f9f,null))[_0xbd25('0x44')](handleError(_0x839f9f,null));}; \ No newline at end of file +var _0x415e=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0xbf663b,_0x4c5443){var _0x597703=function(_0x2c5de1){while(--_0x2c5de1){_0xbf663b['push'](_0xbf663b['shift']());}};_0x597703(++_0x4c5443);}(_0x415e,0x11f));var _0xe415=function(_0x309616,_0x5a9ee8){_0x309616=_0x309616-0x0;var _0x32bf33=_0x415e[_0x309616];return _0x32bf33;};'use strict';var emlformat=require(_0xe415('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe415('0x1'));var moment=require('moment');var BPromise=require(_0xe415('0x2'));var Mustache=require('mustache');var util=require(_0xe415('0x3'));var path=require(_0xe415('0x4'));var sox=require(_0xe415('0x5'));var csv=require('to-csv');var ejs=require(_0xe415('0x6'));var fs=require('fs');var fs_extra=require(_0xe415('0x7'));var _=require(_0xe415('0x8'));var squel=require(_0xe415('0x9'));var crypto=require(_0xe415('0xa'));var jsforce=require(_0xe415('0xb'));var deskjs=require(_0xe415('0xc'));var toCsv=require(_0xe415('0xd'));var querystring=require(_0xe415('0xe'));var Papa=require(_0xe415('0xf'));var Redis=require(_0xe415('0x10'));var authService=require(_0xe415('0x11'));var qs=require(_0xe415('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe415('0x13'));var logger=require(_0xe415('0x14'))(_0xe415('0x15'));var utils=require(_0xe415('0x16'));var config=require(_0xe415('0x17'));var licenseUtil=require(_0xe415('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ed1fc,_0x306c0a){_0x306c0a=_0x306c0a||0xcc;return function(_0x2d0836){if(_0x2d0836){return _0x5ed1fc[_0xe415('0x19')](_0x306c0a);}return _0x5ed1fc[_0xe415('0x1a')](_0x306c0a)[_0xe415('0x1b')]();};}function respondWithResult(_0x393fbf,_0x33a19b){_0x33a19b=_0x33a19b||0xc8;return function(_0x523700){if(_0x523700){return _0x393fbf['status'](_0x33a19b)[_0xe415('0x1c')](_0x523700);}};}function respondWithFilteredResult(_0xcf4ccb,_0xb1e112){return function(_0x12bc2e){if(_0x12bc2e){var _0x198ed8=typeof _0xb1e112[_0xe415('0x1d')]===_0xe415('0x1e')&&typeof _0xb1e112[_0xe415('0x1f')]===_0xe415('0x1e');var _0x392538=_0x12bc2e[_0xe415('0x20')];var _0x53c6e7=_0x198ed8?0x0:_0xb1e112[_0xe415('0x1d')];var _0x1212f6=_0x198ed8?_0x12bc2e['count']:_0xb1e112[_0xe415('0x1d')]+_0xb1e112[_0xe415('0x1f')];var _0x6debf0;if(_0x1212f6>=_0x392538){_0x1212f6=_0x392538;_0x6debf0=0xc8;}else{_0x6debf0=0xce;}_0xcf4ccb[_0xe415('0x1a')](_0x6debf0);return _0xcf4ccb[_0xe415('0x21')]('Content-Range',_0x53c6e7+'-'+_0x1212f6+'/'+_0x392538)[_0xe415('0x1c')](_0x12bc2e);}return null;};}function patchUpdates(_0x222135){return function(_0x289586){try{jsonpatch[_0xe415('0x22')](_0x289586,_0x222135,!![]);}catch(_0x287c87){return BPromise[_0xe415('0x23')](_0x287c87);}return _0x289586[_0xe415('0x24')]();};}function saveUpdates(_0x168a02,_0x59bb4f){return function(_0x34790f){if(_0x34790f){return _0x34790f[_0xe415('0x25')](_0x168a02)[_0xe415('0x26')](function(_0x2f1040){return _0x2f1040;});}return null;};}function removeEntity(_0x20164f,_0x46b1c9){return function(_0x517299){if(_0x517299){return _0x517299[_0xe415('0x27')]()['then'](function(){_0x20164f[_0xe415('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1e64,_0x310d93){return function(_0x2c0b56){if(!_0x2c0b56){_0x4e1e64[_0xe415('0x19')](0x194);}return _0x2c0b56;};}function handleError(_0x5ae63c,_0x2c57af){_0x2c57af=_0x2c57af||0x1f4;return function(_0x54532d){logger['error'](_0x54532d[_0xe415('0x28')]);if(_0x54532d[_0xe415('0x29')]){delete _0x54532d[_0xe415('0x29')];}_0x5ae63c[_0xe415('0x1a')](_0x2c57af)['send'](_0x54532d);};}exports[_0xe415('0x2a')]=function(_0x7babe8,_0x34f79c){var _0x46b5cc={},_0x1c1779={},_0x3e40c5={'count':0x0,'rows':[]};var _0x1a551e=_[_0xe415('0x2b')](db[_0xe415('0x2c')][_0xe415('0x2d')],function(_0x27e952){return{'name':_0x27e952['fieldName'],'type':_0x27e952[_0xe415('0x2e')][_0xe415('0x2f')]};});_0x1c1779[_0xe415('0x30')]=_[_0xe415('0x2b')](_0x1a551e,_0xe415('0x29'));_0x1c1779[_0xe415('0x31')]=_[_0xe415('0x32')](_0x7babe8[_0xe415('0x31')]);_0x1c1779[_0xe415('0x33')]=_[_0xe415('0x34')](_0x1c1779[_0xe415('0x30')],_0x1c1779[_0xe415('0x31')]);_0x46b5cc[_0xe415('0x35')]=_[_0xe415('0x34')](_0x1c1779[_0xe415('0x30')],qs[_0xe415('0x36')](_0x7babe8[_0xe415('0x31')][_0xe415('0x36')]));_0x46b5cc[_0xe415('0x35')]=_0x46b5cc[_0xe415('0x35')][_0xe415('0x37')]?_0x46b5cc[_0xe415('0x35')]:_0x1c1779['model'];if(!_0x7babe8[_0xe415('0x31')]['hasOwnProperty'](_0xe415('0x38'))){_0x46b5cc[_0xe415('0x1f')]=qs['limit'](_0x7babe8['query'][_0xe415('0x1f')]);_0x46b5cc[_0xe415('0x1d')]=qs[_0xe415('0x1d')](_0x7babe8['query'][_0xe415('0x1d')]);}_0x46b5cc[_0xe415('0x39')]=qs[_0xe415('0x3a')](_0x7babe8['query'][_0xe415('0x3a')]);_0x46b5cc[_0xe415('0x3b')]=qs[_0xe415('0x33')](_[_0xe415('0x3c')](_0x7babe8['query'],_0x1c1779[_0xe415('0x33')]),_0x1a551e);if(_0x7babe8[_0xe415('0x31')][_0xe415('0x3d')]){_0x46b5cc[_0xe415('0x3b')]=_[_0xe415('0x3e')](_0x46b5cc[_0xe415('0x3b')],{'$or':_[_0xe415('0x2b')](_0x1a551e,function(_0x1dfbaa){if(_0x1dfbaa[_0xe415('0x2e')]!==_0xe415('0x3f')){var _0x5a448c={};_0x5a448c[_0x1dfbaa[_0xe415('0x29')]]={'$like':'%'+_0x7babe8['query'][_0xe415('0x3d')]+'%'};return _0x5a448c;}})});}_0x46b5cc=_['merge']({},_0x46b5cc,_0x7babe8[_0xe415('0x40')]);var _0x1fd56d={'where':_0x46b5cc['where']};return db['SmsQueueReport'][_0xe415('0x20')](_0x1fd56d)['then'](function(_0xd00ebb){_0x3e40c5[_0xe415('0x20')]=_0xd00ebb;if(_0x7babe8['query'][_0xe415('0x41')]){_0x46b5cc[_0xe415('0x42')]=[{'all':!![]}];}return db[_0xe415('0x2c')][_0xe415('0x43')](_0x46b5cc);})[_0xe415('0x26')](function(_0x22a5a2){_0x3e40c5[_0xe415('0x44')]=_0x22a5a2;return _0x3e40c5;})[_0xe415('0x26')](respondWithFilteredResult(_0x34f79c,_0x46b5cc))[_0xe415('0x45')](handleError(_0x34f79c,null));};exports[_0xe415('0x46')]=function(_0x95fbf5,_0x5e3a4d){var _0x52db76={'raw':!![],'where':{'id':_0x95fbf5[_0xe415('0x47')]['id']}},_0x56247e={};_0x56247e['model']=_[_0xe415('0x32')](db[_0xe415('0x2c')][_0xe415('0x2d')]);_0x56247e[_0xe415('0x31')]=_[_0xe415('0x32')](_0x95fbf5[_0xe415('0x31')]);_0x56247e[_0xe415('0x33')]=_['intersection'](_0x56247e[_0xe415('0x30')],_0x56247e[_0xe415('0x31')]);_0x52db76[_0xe415('0x35')]=_[_0xe415('0x34')](_0x56247e[_0xe415('0x30')],qs[_0xe415('0x36')](_0x95fbf5[_0xe415('0x31')]['fields']));_0x52db76['attributes']=_0x52db76[_0xe415('0x35')][_0xe415('0x37')]?_0x52db76[_0xe415('0x35')]:_0x56247e[_0xe415('0x30')];if(_0x95fbf5[_0xe415('0x31')][_0xe415('0x41')]){_0x52db76['include']=[{'all':!![]}];}_0x52db76=_[_0xe415('0x3e')]({},_0x52db76,_0x95fbf5[_0xe415('0x40')]);return db[_0xe415('0x2c')]['find'](_0x52db76)[_0xe415('0x26')](handleEntityNotFound(_0x5e3a4d,null))['then'](respondWithResult(_0x5e3a4d,null))['catch'](handleError(_0x5e3a4d,null));};exports['create']=function(_0x25b233,_0x49c6e4){return db[_0xe415('0x2c')][_0xe415('0x48')](_0x25b233[_0xe415('0x49')],{})[_0xe415('0x26')](respondWithResult(_0x49c6e4,0xc9))[_0xe415('0x45')](handleError(_0x49c6e4,null));};exports[_0xe415('0x25')]=function(_0x23993a,_0x204d1f){if(_0x23993a[_0xe415('0x49')]['id']){delete _0x23993a[_0xe415('0x49')]['id'];}return db[_0xe415('0x2c')][_0xe415('0x4a')]({'where':{'id':_0x23993a[_0xe415('0x47')]['id']}})[_0xe415('0x26')](handleEntityNotFound(_0x204d1f,null))[_0xe415('0x26')](saveUpdates(_0x23993a[_0xe415('0x49')],null))['then'](respondWithResult(_0x204d1f,null))[_0xe415('0x45')](handleError(_0x204d1f,null));};exports[_0xe415('0x27')]=function(_0xd960f0,_0x5886e6){return db[_0xe415('0x2c')][_0xe415('0x4a')]({'where':{'id':_0xd960f0[_0xe415('0x47')]['id']}})[_0xe415('0x26')](handleEntityNotFound(_0x5886e6,null))[_0xe415('0x26')](removeEntity(_0x5886e6,null))[_0xe415('0x45')](handleError(_0x5886e6,null));};exports[_0xe415('0x4b')]=function(_0x5806c5,_0x3e28a2){return db[_0xe415('0x2c')][_0xe415('0x4b')]()['then'](respondWithResult(_0x3e28a2,null))[_0xe415('0x45')](handleError(_0x3e28a2,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 60ebd7b..b8da22d 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x40b3cf,_0x2c5859){var _0x4978ed=function(_0x3e8f91){while(--_0x3e8f91){_0x40b3cf['push'](_0x40b3cf['shift']());}};_0x4978ed(++_0x2c5859);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x5efc65,_0x2aa00d){var _0x475e4d=function(_0x3d9e61){while(--_0x3d9e61){_0x5efc65['push'](_0x5efc65['shift']());}};_0x475e4d(++_0x2aa00d);}(_0x70e0,0x17b));var _0x070e=function(_0x393337,_0x1f9b3a){_0x393337=_0x393337-0x0;var _0x4cfe87=_0x70e0[_0x393337];return _0x4cfe87;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 75c8882..59537a4 100644 --- a/server/api/smsQueueReport/smsQueueReport.rpc.js +++ b/server/api/smsQueueReport/smsQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50fa=['UpdateSmsQueueReport','update','where','attributes','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw'];(function(_0x12ac45,_0xeb2f08){var _0x72a550=function(_0xe8be35){while(--_0xe8be35){_0x12ac45['push'](_0x12ac45['shift']());}};_0x72a550(++_0xeb2f08);}(_0x50fa,0x112));var _0xa50f=function(_0x460dea,_0x167423){_0x460dea=_0x460dea-0x0;var _0x41a610=_0x50fa[_0x460dea];return _0x41a610;};'use strict';var _=require(_0xa50f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa50f('0x1'));var fs=require('fs');var Redis=require(_0xa50f('0x2'));var db=require(_0xa50f('0x3'))['db'];var utils=require(_0xa50f('0x4'));var logger=require(_0xa50f('0x5'))(_0xa50f('0x6'));var config=require('../../config/environment');var jayson=require(_0xa50f('0x7'));var client=jayson[_0xa50f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fa9f4,_0x92184c,_0x2f2b8a){return new BPromise(function(_0x186e32,_0xb292b1){return client[_0xa50f('0x9')](_0x1fa9f4,_0x2f2b8a)[_0xa50f('0xa')](function(_0x3b73d1){logger[_0xa50f('0xb')](_0xa50f('0xc'),_0x92184c,_0xa50f('0xd'));logger[_0xa50f('0xe')](_0xa50f('0xf'),_0x92184c,'request\x20sent',JSON[_0xa50f('0x10')](_0x3b73d1));if(_0x3b73d1[_0xa50f('0x11')]){if(_0x3b73d1[_0xa50f('0x11')][_0xa50f('0x12')]===0x1f4){logger[_0xa50f('0x11')](_0xa50f('0xc'),_0x92184c,_0x3b73d1[_0xa50f('0x11')][_0xa50f('0x13')]);return _0xb292b1(_0x3b73d1[_0xa50f('0x11')]['message']);}logger[_0xa50f('0x11')](_0xa50f('0xc'),_0x92184c,_0x3b73d1[_0xa50f('0x11')][_0xa50f('0x13')]);return _0x186e32(_0x3b73d1[_0xa50f('0x11')][_0xa50f('0x13')]);}else{logger[_0xa50f('0xb')](_0xa50f('0xc'),_0x92184c,_0xa50f('0xd'));_0x186e32(_0x3b73d1['result'][_0xa50f('0x13')]);}})[_0xa50f('0x14')](function(_0x332866){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x92184c,_0x332866);_0xb292b1(_0x332866);});});}exports[_0xa50f('0x15')]=function(_0x587aa9){var _0x5f0e13=this;return new Promise(function(_0x2b104f,_0x7f9a26){return db[_0xa50f('0x16')]['create'](_0x587aa9[_0xa50f('0x17')],{'raw':_0x587aa9[_0xa50f('0x18')]?_0x587aa9['options'][_0xa50f('0x19')]===undefined?!![]:![]:!![]})[_0xa50f('0xa')](function(_0x283ec3){logger[_0xa50f('0xb')](_0xa50f('0x15'),_0x587aa9);logger['debug'](_0xa50f('0x15'),_0x587aa9,JSON[_0xa50f('0x10')](_0x283ec3));_0x2b104f(_0x283ec3);})[_0xa50f('0x14')](function(_0x2a56ce){logger[_0xa50f('0x11')]('CreateSmsQueueReport',_0x2a56ce[_0xa50f('0x13')],_0x587aa9);_0x7f9a26(_0x5f0e13[_0xa50f('0x11')](0x1f4,_0x2a56ce[_0xa50f('0x13')]));});});};exports[_0xa50f('0x1a')]=function(_0x4a28c3){var _0x3d0bdf=this;return new Promise(function(_0xfa8fdb,_0x403dfb){return db[_0xa50f('0x16')][_0xa50f('0x1b')](_0x4a28c3['body'],{'raw':_0x4a28c3[_0xa50f('0x18')]?_0x4a28c3[_0xa50f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a28c3['options']?_0x4a28c3[_0xa50f('0x18')][_0xa50f('0x1c')]||null:null,'attributes':_0x4a28c3[_0xa50f('0x18')]?_0x4a28c3[_0xa50f('0x18')][_0xa50f('0x1d')]||null:null,'limit':_0x4a28c3[_0xa50f('0x18')]?_0x4a28c3[_0xa50f('0x18')]['limit']||null:null})[_0xa50f('0xa')](function(_0x41cf8c){logger[_0xa50f('0xb')](_0xa50f('0x1a'),_0x4a28c3);logger[_0xa50f('0xe')]('UpdateSmsQueueReport',_0x4a28c3,JSON[_0xa50f('0x10')](_0x41cf8c));_0xfa8fdb(_0x41cf8c);})[_0xa50f('0x14')](function(_0x238a97){logger[_0xa50f('0x11')](_0xa50f('0x1a'),_0x238a97['message'],_0x4a28c3);_0x403dfb(_0x3d0bdf[_0xa50f('0x11')](0x1f4,_0x238a97[_0xa50f('0x13')]));});});}; \ No newline at end of file +var _0x3dcd=['result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','UpdateSmsQueueReport','body','attributes','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x318b97,_0x3e0753){var _0x56c589=function(_0x4eb285){while(--_0x4eb285){_0x318b97['push'](_0x318b97['shift']());}};_0x56c589(++_0x3e0753);}(_0x3dcd,0x1bd));var _0xd3dc=function(_0xe66e24,_0x3688c1){_0xe66e24=_0xe66e24-0x0;var _0x586475=_0x3dcd[_0xe66e24];return _0x586475;};'use strict';var _=require(_0xd3dc('0x0'));var util=require('util');var moment=require(_0xd3dc('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3dc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3dc('0x3'))['db'];var utils=require(_0xd3dc('0x4'));var logger=require(_0xd3dc('0x5'))('rpc');var config=require(_0xd3dc('0x6'));var jayson=require(_0xd3dc('0x7'));var client=jayson[_0xd3dc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x223932,_0x170912,_0x15194c){return new BPromise(function(_0x2e7000,_0x36a895){return client['request'](_0x223932,_0x15194c)[_0xd3dc('0x9')](function(_0x507954){logger[_0xd3dc('0xa')](_0xd3dc('0xb'),_0x170912,'request\x20sent');logger[_0xd3dc('0xc')](_0xd3dc('0xd'),_0x170912,_0xd3dc('0xe'),JSON[_0xd3dc('0xf')](_0x507954));if(_0x507954[_0xd3dc('0x10')]){if(_0x507954[_0xd3dc('0x10')][_0xd3dc('0x11')]===0x1f4){logger[_0xd3dc('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x170912,_0x507954[_0xd3dc('0x10')][_0xd3dc('0x12')]);return _0x36a895(_0x507954[_0xd3dc('0x10')][_0xd3dc('0x12')]);}logger[_0xd3dc('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x170912,_0x507954['error']['message']);return _0x2e7000(_0x507954[_0xd3dc('0x10')]['message']);}else{logger['info'](_0xd3dc('0xb'),_0x170912,_0xd3dc('0xe'));_0x2e7000(_0x507954[_0xd3dc('0x13')]['message']);}})[_0xd3dc('0x14')](function(_0x1d8dd7){logger['error'](_0xd3dc('0xb'),_0x170912,_0x1d8dd7);_0x36a895(_0x1d8dd7);});});}exports[_0xd3dc('0x15')]=function(_0x42a310){var _0x588827=this;return new Promise(function(_0x2513c0,_0xb40b96){return db[_0xd3dc('0x16')][_0xd3dc('0x17')](_0x42a310['body'],{'raw':_0x42a310['options']?_0x42a310[_0xd3dc('0x18')][_0xd3dc('0x19')]===undefined?!![]:![]:!![]})[_0xd3dc('0x9')](function(_0x450300){logger[_0xd3dc('0xa')](_0xd3dc('0x15'),_0x42a310);logger[_0xd3dc('0xc')](_0xd3dc('0x15'),_0x42a310,JSON[_0xd3dc('0xf')](_0x450300));_0x2513c0(_0x450300);})[_0xd3dc('0x14')](function(_0x36b721){logger['error'](_0xd3dc('0x15'),_0x36b721[_0xd3dc('0x12')],_0x42a310);_0xb40b96(_0x588827[_0xd3dc('0x10')](0x1f4,_0x36b721[_0xd3dc('0x12')]));});});};exports[_0xd3dc('0x1a')]=function(_0x1ad4e4){var _0x2e84cf=this;return new Promise(function(_0x56ee07,_0x3b7fe9){return db[_0xd3dc('0x16')]['update'](_0x1ad4e4[_0xd3dc('0x1b')],{'raw':_0x1ad4e4[_0xd3dc('0x18')]?_0x1ad4e4[_0xd3dc('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ad4e4['options']?_0x1ad4e4[_0xd3dc('0x18')]['where']||null:null,'attributes':_0x1ad4e4[_0xd3dc('0x18')]?_0x1ad4e4[_0xd3dc('0x18')][_0xd3dc('0x1c')]||null:null,'limit':_0x1ad4e4[_0xd3dc('0x18')]?_0x1ad4e4[_0xd3dc('0x18')]['limit']||null:null})[_0xd3dc('0x9')](function(_0x53a78e){logger[_0xd3dc('0xa')](_0xd3dc('0x1a'),_0x1ad4e4);logger[_0xd3dc('0xc')](_0xd3dc('0x1a'),_0x1ad4e4,JSON[_0xd3dc('0xf')](_0x53a78e));_0x56ee07(_0x53a78e);})[_0xd3dc('0x14')](function(_0x405ace){logger[_0xd3dc('0x10')](_0xd3dc('0x1a'),_0x405ace['message'],_0x1ad4e4);_0x3b7fe9(_0x2e84cf['error'](0x1f4,_0x405ace[_0xd3dc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 44d3683..93b2569 100644 --- a/server/api/smsTransferReport/index.js +++ b/server/api/smsTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','/describe','describe','/:id','create','put','delete','destroy','exports','multer','util','path'];(function(_0x2c1868,_0x398df4){var _0x590b71=function(_0xc71a79){while(--_0xc71a79){_0x2c1868['push'](_0x2c1868['shift']());}};_0x590b71(++_0x398df4);}(_0xb138,0x1dd));var _0x8b13=function(_0x4511e6,_0x2c3afe){_0x4511e6=_0x4511e6-0x0;var _0x573951=_0xb138[_0x4511e6];return _0x573951;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get']('/',auth[_0x8b13('0xa')](),controller[_0x8b13('0xb')]);router['get'](_0x8b13('0xc'),auth[_0x8b13('0xa')](),controller[_0x8b13('0xd')]);router['get'](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller['show']);router['post']('/',auth[_0x8b13('0xa')](),controller[_0x8b13('0xf')]);router[_0x8b13('0x10')](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller['update']);router[_0x8b13('0x11')](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller[_0x8b13('0x12')]);module[_0x8b13('0x13')]=router; \ No newline at end of file +var _0x4300=['describe','/:id','show','post','put','update','delete','destroy','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x23be51,_0xc02a1b){var _0x47a26d=function(_0xa92395){while(--_0xa92395){_0x23be51['push'](_0x23be51['shift']());}};_0x47a26d(++_0xc02a1b);}(_0x4300,0x1a6));var _0x0430=function(_0x131895,_0x5b9ab8){_0x131895=_0x131895-0x0;var _0x1cae94=_0x4300[_0x131895];return _0x1cae94;};'use strict';var multer=require(_0x0430('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0430('0x1')]();var fs_extra=require(_0x0430('0x2'));var auth=require(_0x0430('0x3'));var interaction=require(_0x0430('0x4'));var config=require(_0x0430('0x5'));var controller=require('./smsTransferReport.controller');router[_0x0430('0x6')]('/',auth['isAuthenticated'](),controller[_0x0430('0x7')]);router['get'](_0x0430('0x8'),auth[_0x0430('0x9')](),controller[_0x0430('0xa')]);router[_0x0430('0x6')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0xc')]);router[_0x0430('0xd')]('/',auth[_0x0430('0x9')](),controller['create']);router[_0x0430('0xe')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0xf')]);router[_0x0430('0x10')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 706f336..f13811e 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x390c58,_0x5f1915){var _0x28e212=function(_0x3dd560){while(--_0x3dd560){_0x390c58['push'](_0x390c58['shift']());}};_0x28e212(++_0x5f1915);}(_0xedd9,0xfc));var _0x9edd=function(_0x2508c2,_0x476b25){_0x2508c2=_0x2508c2-0x0;var _0x3ce5de=_0xedd9[_0x2508c2];return _0x3ce5de;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x2eebfa,_0x2b23fd){var _0xdb8044=function(_0x3f11e0){while(--_0x3f11e0){_0x2eebfa['push'](_0x2eebfa['shift']());}};_0xdb8044(++_0x2b23fd);}(_0x4b84,0x1cc));var _0x44b8=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0x4b84[_0x12e073];return _0x267748;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 8cc17d1..9718c23 100644 --- a/server/api/smsTransferReport/smsTransferReport.controller.js +++ b/server/api/smsTransferReport/smsTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c1a=['map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key','model'];(function(_0x5b077b,_0x50b707){var _0x16faf7=function(_0x41ba83){while(--_0x41ba83){_0x5b077b['push'](_0x5b077b['shift']());}};_0x16faf7(++_0x50b707);}(_0x7c1a,0x1a9));var _0xa7c1=function(_0x1e24fe,_0x4c00bb){_0x1e24fe=_0x1e24fe-0x0;var _0x1318c3=_0x7c1a[_0x1e24fe];return _0x1318c3;};'use strict';var emlformat=require(_0xa7c1('0x0'));var rimraf=require(_0xa7c1('0x1'));var zipdir=require(_0xa7c1('0x2'));var jsonpatch=require(_0xa7c1('0x3'));var rp=require('request-promise');var moment=require(_0xa7c1('0x4'));var BPromise=require(_0xa7c1('0x5'));var Mustache=require(_0xa7c1('0x6'));var util=require(_0xa7c1('0x7'));var path=require(_0xa7c1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa7c1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa7c1('0xa'));var crypto=require('crypto');var jsforce=require(_0xa7c1('0xb'));var deskjs=require(_0xa7c1('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa7c1('0xd'));var Papa=require(_0xa7c1('0xe'));var Redis=require('ioredis');var authService=require(_0xa7c1('0xf'));var qs=require(_0xa7c1('0x10'));var as=require(_0xa7c1('0x11'));var hardwareService=require(_0xa7c1('0x12'));var logger=require(_0xa7c1('0x13'))(_0xa7c1('0x14'));var utils=require(_0xa7c1('0x15'));var config=require(_0xa7c1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7c1('0x17'))['db'];function respondWithStatusCode(_0x255fe5,_0x522f64){_0x522f64=_0x522f64||0xcc;return function(_0x53bc06){if(_0x53bc06){return _0x255fe5[_0xa7c1('0x18')](_0x522f64);}return _0x255fe5[_0xa7c1('0x19')](_0x522f64)[_0xa7c1('0x1a')]();};}function respondWithResult(_0x46035a,_0x30e133){_0x30e133=_0x30e133||0xc8;return function(_0x5e2b20){if(_0x5e2b20){return _0x46035a['status'](_0x30e133)[_0xa7c1('0x1b')](_0x5e2b20);}};}function respondWithFilteredResult(_0x1e7562,_0x468188){return function(_0x233905){if(_0x233905){var _0x4fc381=typeof _0x468188[_0xa7c1('0x1c')]===_0xa7c1('0x1d')&&typeof _0x468188[_0xa7c1('0x1e')]===_0xa7c1('0x1d');var _0x30a884=_0x233905[_0xa7c1('0x1f')];var _0x127871=_0x4fc381?0x0:_0x468188[_0xa7c1('0x1c')];var _0x2ea88b=_0x4fc381?_0x233905[_0xa7c1('0x1f')]:_0x468188[_0xa7c1('0x1c')]+_0x468188[_0xa7c1('0x1e')];var _0xccd882;if(_0x2ea88b>=_0x30a884){_0x2ea88b=_0x30a884;_0xccd882=0xc8;}else{_0xccd882=0xce;}_0x1e7562[_0xa7c1('0x19')](_0xccd882);return _0x1e7562[_0xa7c1('0x20')](_0xa7c1('0x21'),_0x127871+'-'+_0x2ea88b+'/'+_0x30a884)[_0xa7c1('0x1b')](_0x233905);}return null;};}function patchUpdates(_0x3bc9fe){return function(_0x454b14){try{jsonpatch[_0xa7c1('0x22')](_0x454b14,_0x3bc9fe,!![]);}catch(_0x3a6632){return BPromise[_0xa7c1('0x23')](_0x3a6632);}return _0x454b14[_0xa7c1('0x24')]();};}function saveUpdates(_0x3b0f00,_0x309005){return function(_0x446475){if(_0x446475){return _0x446475['update'](_0x3b0f00)[_0xa7c1('0x25')](function(_0xc48f55){return _0xc48f55;});}return null;};}function removeEntity(_0x593464,_0x1b0219){return function(_0x3079c0){if(_0x3079c0){return _0x3079c0[_0xa7c1('0x26')]()[_0xa7c1('0x25')](function(){_0x593464[_0xa7c1('0x19')](0xcc)[_0xa7c1('0x1a')]();});}};}function handleEntityNotFound(_0xaabfb1,_0x303d52){return function(_0x4d45fd){if(!_0x4d45fd){_0xaabfb1[_0xa7c1('0x18')](0x194);}return _0x4d45fd;};}function handleError(_0x160019,_0x4e11e2){_0x4e11e2=_0x4e11e2||0x1f4;return function(_0x495e55){logger[_0xa7c1('0x27')](_0x495e55['stack']);if(_0x495e55[_0xa7c1('0x28')]){delete _0x495e55[_0xa7c1('0x28')];}_0x160019[_0xa7c1('0x19')](_0x4e11e2)[_0xa7c1('0x29')](_0x495e55);};}exports[_0xa7c1('0x2a')]=function(_0x2e70bf,_0x4b1f59){var _0xf5da7c={},_0x1d13de={},_0x3635ad={'count':0x0,'rows':[]};var _0x31f4f7=_['map'](db[_0xa7c1('0x2b')][_0xa7c1('0x2c')],function(_0x6bb3b6){return{'name':_0x6bb3b6[_0xa7c1('0x2d')],'type':_0x6bb3b6[_0xa7c1('0x2e')][_0xa7c1('0x2f')]};});_0x1d13de[_0xa7c1('0x30')]=_[_0xa7c1('0x31')](_0x31f4f7,_0xa7c1('0x28'));_0x1d13de[_0xa7c1('0x32')]=_[_0xa7c1('0x33')](_0x2e70bf[_0xa7c1('0x32')]);_0x1d13de[_0xa7c1('0x34')]=_[_0xa7c1('0x35')](_0x1d13de[_0xa7c1('0x30')],_0x1d13de[_0xa7c1('0x32')]);_0xf5da7c[_0xa7c1('0x36')]=_['intersection'](_0x1d13de[_0xa7c1('0x30')],qs[_0xa7c1('0x37')](_0x2e70bf[_0xa7c1('0x32')][_0xa7c1('0x37')]));_0xf5da7c[_0xa7c1('0x36')]=_0xf5da7c['attributes'][_0xa7c1('0x38')]?_0xf5da7c['attributes']:_0x1d13de[_0xa7c1('0x30')];if(!_0x2e70bf[_0xa7c1('0x32')][_0xa7c1('0x39')](_0xa7c1('0x3a'))){_0xf5da7c['limit']=qs[_0xa7c1('0x1e')](_0x2e70bf['query'][_0xa7c1('0x1e')]);_0xf5da7c['offset']=qs[_0xa7c1('0x1c')](_0x2e70bf[_0xa7c1('0x32')][_0xa7c1('0x1c')]);}_0xf5da7c[_0xa7c1('0x3b')]=qs['sort'](_0x2e70bf[_0xa7c1('0x32')][_0xa7c1('0x3c')]);_0xf5da7c[_0xa7c1('0x3d')]=qs[_0xa7c1('0x34')](_[_0xa7c1('0x3e')](_0x2e70bf[_0xa7c1('0x32')],_0x1d13de[_0xa7c1('0x34')]),_0x31f4f7);if(_0x2e70bf[_0xa7c1('0x32')][_0xa7c1('0x3f')]){_0xf5da7c[_0xa7c1('0x3d')]=_[_0xa7c1('0x40')](_0xf5da7c[_0xa7c1('0x3d')],{'$or':_[_0xa7c1('0x31')](_0x31f4f7,function(_0x1d7e6d){if(_0x1d7e6d[_0xa7c1('0x2e')]!==_0xa7c1('0x41')){var _0x3921ee={};_0x3921ee[_0x1d7e6d[_0xa7c1('0x28')]]={'$like':'%'+_0x2e70bf['query'][_0xa7c1('0x3f')]+'%'};return _0x3921ee;}})});}_0xf5da7c=_[_0xa7c1('0x40')]({},_0xf5da7c,_0x2e70bf['options']);var _0x432ea8={'where':_0xf5da7c[_0xa7c1('0x3d')]};return db[_0xa7c1('0x2b')][_0xa7c1('0x1f')](_0x432ea8)[_0xa7c1('0x25')](function(_0x491a32){_0x3635ad['count']=_0x491a32;if(_0x2e70bf[_0xa7c1('0x32')][_0xa7c1('0x42')]){_0xf5da7c['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xa7c1('0x43')](_0xf5da7c);})[_0xa7c1('0x25')](function(_0x1c39c5){_0x3635ad[_0xa7c1('0x44')]=_0x1c39c5;return _0x3635ad;})[_0xa7c1('0x25')](respondWithFilteredResult(_0x4b1f59,_0xf5da7c))[_0xa7c1('0x45')](handleError(_0x4b1f59,null));};exports[_0xa7c1('0x46')]=function(_0x289572,_0x103f5b){var _0x52115a={'raw':!![],'where':{'id':_0x289572[_0xa7c1('0x47')]['id']}},_0x441c16={};_0x441c16[_0xa7c1('0x30')]=_[_0xa7c1('0x33')](db['SmsTransferReport'][_0xa7c1('0x2c')]);_0x441c16['query']=_[_0xa7c1('0x33')](_0x289572['query']);_0x441c16[_0xa7c1('0x34')]=_[_0xa7c1('0x35')](_0x441c16[_0xa7c1('0x30')],_0x441c16[_0xa7c1('0x32')]);_0x52115a[_0xa7c1('0x36')]=_[_0xa7c1('0x35')](_0x441c16[_0xa7c1('0x30')],qs[_0xa7c1('0x37')](_0x289572[_0xa7c1('0x32')]['fields']));_0x52115a[_0xa7c1('0x36')]=_0x52115a['attributes']['length']?_0x52115a[_0xa7c1('0x36')]:_0x441c16[_0xa7c1('0x30')];if(_0x289572[_0xa7c1('0x32')][_0xa7c1('0x42')]){_0x52115a[_0xa7c1('0x48')]=[{'all':!![]}];}_0x52115a=_['merge']({},_0x52115a,_0x289572[_0xa7c1('0x49')]);return db['SmsTransferReport'][_0xa7c1('0x4a')](_0x52115a)[_0xa7c1('0x25')](handleEntityNotFound(_0x103f5b,null))[_0xa7c1('0x25')](respondWithResult(_0x103f5b,null))[_0xa7c1('0x45')](handleError(_0x103f5b,null));};exports[_0xa7c1('0x4b')]=function(_0x2c10f9,_0x3c695c){return db['SmsTransferReport']['create'](_0x2c10f9[_0xa7c1('0x4c')],{})['then'](respondWithResult(_0x3c695c,0xc9))[_0xa7c1('0x45')](handleError(_0x3c695c,null));};exports[_0xa7c1('0x4d')]=function(_0x954eeb,_0x2c3e2c){if(_0x954eeb[_0xa7c1('0x4c')]['id']){delete _0x954eeb['body']['id'];}return db[_0xa7c1('0x2b')][_0xa7c1('0x4a')]({'where':{'id':_0x954eeb[_0xa7c1('0x47')]['id']}})[_0xa7c1('0x25')](handleEntityNotFound(_0x2c3e2c,null))[_0xa7c1('0x25')](saveUpdates(_0x954eeb[_0xa7c1('0x4c')],null))[_0xa7c1('0x25')](respondWithResult(_0x2c3e2c,null))['catch'](handleError(_0x2c3e2c,null));};exports[_0xa7c1('0x26')]=function(_0x464cfd,_0x33aa60){return db[_0xa7c1('0x2b')][_0xa7c1('0x4a')]({'where':{'id':_0x464cfd[_0xa7c1('0x47')]['id']}})[_0xa7c1('0x25')](handleEntityNotFound(_0x33aa60,null))[_0xa7c1('0x25')](removeEntity(_0x33aa60,null))[_0xa7c1('0x45')](handleError(_0x33aa60,null));};exports[_0xa7c1('0x4e')]=function(_0x1b06cf,_0x503217){return db[_0xa7c1('0x2b')]['describe']()[_0xa7c1('0x25')](respondWithResult(_0x503217,null))[_0xa7c1('0x45')](handleError(_0x503217,null));}; \ No newline at end of file +var _0x354a=['count','offset','set','apply','save','update','then','destroy','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x264ef7,_0x581221){var _0x8e0109=function(_0x472196){while(--_0x472196){_0x264ef7['push'](_0x264ef7['shift']());}};_0x8e0109(++_0x581221);}(_0x354a,0x1ec));var _0xa354=function(_0x1cb455,_0x183114){_0x1cb455=_0x1cb455-0x0;var _0x5f1d53=_0x354a[_0x1cb455];return _0x5f1d53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa354('0x0'));var zipdir=require(_0xa354('0x1'));var jsonpatch=require(_0xa354('0x2'));var rp=require(_0xa354('0x3'));var moment=require(_0xa354('0x4'));var BPromise=require(_0xa354('0x5'));var Mustache=require(_0xa354('0x6'));var util=require(_0xa354('0x7'));var path=require(_0xa354('0x8'));var sox=require(_0xa354('0x9'));var csv=require(_0xa354('0xa'));var ejs=require(_0xa354('0xb'));var fs=require('fs');var fs_extra=require(_0xa354('0xc'));var _=require(_0xa354('0xd'));var squel=require('squel');var crypto=require(_0xa354('0xe'));var jsforce=require(_0xa354('0xf'));var deskjs=require(_0xa354('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa354('0x11'));var Papa=require(_0xa354('0x12'));var Redis=require(_0xa354('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa354('0x14'));var as=require(_0xa354('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa354('0x16'))(_0xa354('0x17'));var utils=require(_0xa354('0x18'));var config=require(_0xa354('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa354('0x1a'))['db'];function respondWithStatusCode(_0x54507c,_0x16d943){_0x16d943=_0x16d943||0xcc;return function(_0x317082){if(_0x317082){return _0x54507c[_0xa354('0x1b')](_0x16d943);}return _0x54507c[_0xa354('0x1c')](_0x16d943)[_0xa354('0x1d')]();};}function respondWithResult(_0x19d4e6,_0x1250c5){_0x1250c5=_0x1250c5||0xc8;return function(_0x18c18e){if(_0x18c18e){return _0x19d4e6[_0xa354('0x1c')](_0x1250c5)[_0xa354('0x1e')](_0x18c18e);}};}function respondWithFilteredResult(_0x186c8d,_0x10aa3d){return function(_0x1dcd7e){if(_0x1dcd7e){var _0x53e296=typeof _0x10aa3d['offset']===_0xa354('0x1f')&&typeof _0x10aa3d[_0xa354('0x20')]===_0xa354('0x1f');var _0x57ed2c=_0x1dcd7e[_0xa354('0x21')];var _0x5ed803=_0x53e296?0x0:_0x10aa3d[_0xa354('0x22')];var _0x316b53=_0x53e296?_0x1dcd7e[_0xa354('0x21')]:_0x10aa3d['offset']+_0x10aa3d[_0xa354('0x20')];var _0x1fd39d;if(_0x316b53>=_0x57ed2c){_0x316b53=_0x57ed2c;_0x1fd39d=0xc8;}else{_0x1fd39d=0xce;}_0x186c8d[_0xa354('0x1c')](_0x1fd39d);return _0x186c8d[_0xa354('0x23')]('Content-Range',_0x5ed803+'-'+_0x316b53+'/'+_0x57ed2c)['json'](_0x1dcd7e);}return null;};}function patchUpdates(_0x1e524e){return function(_0x5bdedc){try{jsonpatch[_0xa354('0x24')](_0x5bdedc,_0x1e524e,!![]);}catch(_0x428d9c){return BPromise['reject'](_0x428d9c);}return _0x5bdedc[_0xa354('0x25')]();};}function saveUpdates(_0x14f6f2,_0x55af7d){return function(_0x44da9e){if(_0x44da9e){return _0x44da9e[_0xa354('0x26')](_0x14f6f2)[_0xa354('0x27')](function(_0x5cb9cb){return _0x5cb9cb;});}return null;};}function removeEntity(_0x1dce82,_0x20fcae){return function(_0x2f56ed){if(_0x2f56ed){return _0x2f56ed[_0xa354('0x28')]()['then'](function(){_0x1dce82[_0xa354('0x1c')](0xcc)[_0xa354('0x1d')]();});}};}function handleEntityNotFound(_0x4f3a1b,_0x2842d8){return function(_0x526f3b){if(!_0x526f3b){_0x4f3a1b[_0xa354('0x1b')](0x194);}return _0x526f3b;};}function handleError(_0xe7ae5b,_0x254cca){_0x254cca=_0x254cca||0x1f4;return function(_0x25c81f){logger[_0xa354('0x29')](_0x25c81f[_0xa354('0x2a')]);if(_0x25c81f['name']){delete _0x25c81f[_0xa354('0x2b')];}_0xe7ae5b[_0xa354('0x1c')](_0x254cca)['send'](_0x25c81f);};}exports['index']=function(_0x1269c9,_0x625f55){var _0x99e03={},_0x4c616c={},_0x38a440={'count':0x0,'rows':[]};var _0x2dcd39=_[_0xa354('0x2c')](db[_0xa354('0x2d')][_0xa354('0x2e')],function(_0x3a26e3){return{'name':_0x3a26e3[_0xa354('0x2f')],'type':_0x3a26e3[_0xa354('0x30')][_0xa354('0x31')]};});_0x4c616c[_0xa354('0x32')]=_['map'](_0x2dcd39,'name');_0x4c616c[_0xa354('0x33')]=_[_0xa354('0x34')](_0x1269c9[_0xa354('0x33')]);_0x4c616c[_0xa354('0x35')]=_['intersection'](_0x4c616c['model'],_0x4c616c[_0xa354('0x33')]);_0x99e03[_0xa354('0x36')]=_[_0xa354('0x37')](_0x4c616c[_0xa354('0x32')],qs[_0xa354('0x38')](_0x1269c9[_0xa354('0x33')][_0xa354('0x38')]));_0x99e03[_0xa354('0x36')]=_0x99e03[_0xa354('0x36')][_0xa354('0x39')]?_0x99e03[_0xa354('0x36')]:_0x4c616c[_0xa354('0x32')];if(!_0x1269c9[_0xa354('0x33')][_0xa354('0x3a')]('nolimit')){_0x99e03[_0xa354('0x20')]=qs['limit'](_0x1269c9['query']['limit']);_0x99e03[_0xa354('0x22')]=qs['offset'](_0x1269c9[_0xa354('0x33')][_0xa354('0x22')]);}_0x99e03[_0xa354('0x3b')]=qs[_0xa354('0x3c')](_0x1269c9[_0xa354('0x33')]['sort']);_0x99e03['where']=qs[_0xa354('0x35')](_[_0xa354('0x3d')](_0x1269c9['query'],_0x4c616c[_0xa354('0x35')]),_0x2dcd39);if(_0x1269c9[_0xa354('0x33')][_0xa354('0x3e')]){_0x99e03['where']=_[_0xa354('0x3f')](_0x99e03[_0xa354('0x40')],{'$or':_['map'](_0x2dcd39,function(_0x43eccb){if(_0x43eccb[_0xa354('0x30')]!==_0xa354('0x41')){var _0x4fdc61={};_0x4fdc61[_0x43eccb[_0xa354('0x2b')]]={'$like':'%'+_0x1269c9[_0xa354('0x33')][_0xa354('0x3e')]+'%'};return _0x4fdc61;}})});}_0x99e03=_['merge']({},_0x99e03,_0x1269c9['options']);var _0x47577e={'where':_0x99e03[_0xa354('0x40')]};return db[_0xa354('0x2d')][_0xa354('0x21')](_0x47577e)['then'](function(_0x26bcee){_0x38a440[_0xa354('0x21')]=_0x26bcee;if(_0x1269c9[_0xa354('0x33')][_0xa354('0x42')]){_0x99e03['include']=[{'all':!![]}];}return db[_0xa354('0x2d')][_0xa354('0x43')](_0x99e03);})['then'](function(_0x509fca){_0x38a440['rows']=_0x509fca;return _0x38a440;})[_0xa354('0x27')](respondWithFilteredResult(_0x625f55,_0x99e03))[_0xa354('0x44')](handleError(_0x625f55,null));};exports[_0xa354('0x45')]=function(_0x462124,_0x2e16d6){var _0x4f2d9f={'raw':!![],'where':{'id':_0x462124[_0xa354('0x46')]['id']}},_0x5111bc={};_0x5111bc[_0xa354('0x32')]=_[_0xa354('0x34')](db[_0xa354('0x2d')][_0xa354('0x2e')]);_0x5111bc['query']=_[_0xa354('0x34')](_0x462124[_0xa354('0x33')]);_0x5111bc[_0xa354('0x35')]=_[_0xa354('0x37')](_0x5111bc[_0xa354('0x32')],_0x5111bc[_0xa354('0x33')]);_0x4f2d9f[_0xa354('0x36')]=_[_0xa354('0x37')](_0x5111bc[_0xa354('0x32')],qs['fields'](_0x462124['query']['fields']));_0x4f2d9f[_0xa354('0x36')]=_0x4f2d9f[_0xa354('0x36')][_0xa354('0x39')]?_0x4f2d9f['attributes']:_0x5111bc['model'];if(_0x462124[_0xa354('0x33')]['includeAll']){_0x4f2d9f['include']=[{'all':!![]}];}_0x4f2d9f=_['merge']({},_0x4f2d9f,_0x462124['options']);return db['SmsTransferReport'][_0xa354('0x47')](_0x4f2d9f)['then'](handleEntityNotFound(_0x2e16d6,null))[_0xa354('0x27')](respondWithResult(_0x2e16d6,null))[_0xa354('0x44')](handleError(_0x2e16d6,null));};exports[_0xa354('0x48')]=function(_0x5e5602,_0x2ab123){return db[_0xa354('0x2d')][_0xa354('0x48')](_0x5e5602[_0xa354('0x49')],{})[_0xa354('0x27')](respondWithResult(_0x2ab123,0xc9))['catch'](handleError(_0x2ab123,null));};exports[_0xa354('0x26')]=function(_0xf22461,_0x13a760){if(_0xf22461['body']['id']){delete _0xf22461[_0xa354('0x49')]['id'];}return db[_0xa354('0x2d')][_0xa354('0x47')]({'where':{'id':_0xf22461[_0xa354('0x46')]['id']}})['then'](handleEntityNotFound(_0x13a760,null))[_0xa354('0x27')](saveUpdates(_0xf22461['body'],null))['then'](respondWithResult(_0x13a760,null))[_0xa354('0x44')](handleError(_0x13a760,null));};exports[_0xa354('0x28')]=function(_0x46bf83,_0x4f17eb){return db[_0xa354('0x2d')][_0xa354('0x47')]({'where':{'id':_0x46bf83[_0xa354('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f17eb,null))[_0xa354('0x27')](removeEntity(_0x4f17eb,null))[_0xa354('0x44')](handleError(_0x4f17eb,null));};exports['describe']=function(_0x182d9c,_0x341bf7){return db[_0xa354('0x2d')][_0xa354('0x4a')]()[_0xa354('0x27')](respondWithResult(_0x341bf7,null))[_0xa354('0x44')](handleError(_0x341bf7,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 70d123d..90aadb7 100644 --- a/server/api/smsTransferReport/smsTransferReport.model.js +++ b/server/api/smsTransferReport/smsTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec82=['uniqueid','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer'];(function(_0x219f4a,_0x2b24f3){var _0x5b97db=function(_0x40b40a){while(--_0x40b40a){_0x219f4a['push'](_0x219f4a['shift']());}};_0x5b97db(++_0x2b24f3);}(_0xec82,0x83));var _0x2ec8=function(_0x495e12,_0x205230){_0x495e12=_0x495e12-0x0;var _0x15f5ff=_0xec82[_0x495e12];return _0x15f5ff;};'use strict';var _=require(_0x2ec8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2ec8('0x1'));var moment=require(_0x2ec8('0x2'));var BPromise=require('bluebird');var rp=require(_0x2ec8('0x3'));var fs=require('fs');var path=require(_0x2ec8('0x4'));var rimraf=require(_0x2ec8('0x5'));var config=require(_0x2ec8('0x6'));var attributes=require(_0x2ec8('0x7'));module[_0x2ec8('0x8')]=function(_0x3da5fe,_0x5f3342){return _0x3da5fe[_0x2ec8('0x9')](_0x2ec8('0xa'),attributes,{'tableName':_0x2ec8('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2ec8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4fdb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x37fb3a,_0x5a14ee){var _0x1e5c8f=function(_0x4e79d1){while(--_0x4e79d1){_0x37fb3a['push'](_0x37fb3a['shift']());}};_0x1e5c8f(++_0x5a14ee);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x763056,_0x180be3){_0x763056=_0x763056-0x0;var _0x4aa4c9=_0x4fdb[_0x763056];return _0x4aa4c9;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var moment=require(_0xb4fd('0x4'));var BPromise=require(_0xb4fd('0x5'));var rp=require(_0xb4fd('0x6'));var fs=require('fs');var path=require(_0xb4fd('0x7'));var rimraf=require(_0xb4fd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4fd('0x9'));module['exports']=function(_0x14052b,_0x5d8b39){return _0x14052b['define'](_0xb4fd('0xa'),attributes,{'tableName':_0xb4fd('0xb'),'paranoid':![],'indexes':[{'name':_0xb4fd('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 1c6e2c5..6907c14 100644 --- a/server/api/smsTransferReport/smsTransferReport.rpc.js +++ b/server/api/smsTransferReport/smsTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2c8=['jayson/promise','client','http','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x250a93,_0x4dab95){var _0x247f0b=function(_0x429972){while(--_0x429972){_0x250a93['push'](_0x250a93['shift']());}};_0x247f0b(++_0x4dab95);}(_0xa2c8,0x99));var _0x8a2c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa2c8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8a2c('0x0'));var util=require(_0x8a2c('0x1'));var moment=require(_0x8a2c('0x2'));var BPromise=require(_0x8a2c('0x3'));var rs=require(_0x8a2c('0x4'));var fs=require('fs');var Redis=require(_0x8a2c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a2c('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8a2c('0x7'));var client=jayson[_0x8a2c('0x8')][_0x8a2c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1031fb,_0x4e007c,_0xe1e335){return new BPromise(function(_0x1d2885,_0x43745f){return client['request'](_0x1031fb,_0xe1e335)['then'](function(_0x4c237a){logger[_0x8a2c('0xa')](_0x8a2c('0xb'),_0x4e007c,'request\x20sent');logger[_0x8a2c('0xc')](_0x8a2c('0xd'),_0x4e007c,_0x8a2c('0xe'),JSON[_0x8a2c('0xf')](_0x4c237a));if(_0x4c237a[_0x8a2c('0x10')]){if(_0x4c237a[_0x8a2c('0x10')]['code']===0x1f4){logger[_0x8a2c('0x10')](_0x8a2c('0xb'),_0x4e007c,_0x4c237a['error'][_0x8a2c('0x11')]);return _0x43745f(_0x4c237a[_0x8a2c('0x10')]['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4e007c,_0x4c237a['error'][_0x8a2c('0x11')]);return _0x1d2885(_0x4c237a[_0x8a2c('0x10')][_0x8a2c('0x11')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x4e007c,_0x8a2c('0xe'));_0x1d2885(_0x4c237a[_0x8a2c('0x12')][_0x8a2c('0x11')]);}})[_0x8a2c('0x13')](function(_0x4388b0){logger[_0x8a2c('0x10')](_0x8a2c('0xb'),_0x4e007c,_0x4388b0);_0x43745f(_0x4388b0);});});} \ No newline at end of file +var _0x7fbe=['request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x155b37,_0x4008c9){var _0x566704=function(_0x18125e){while(--_0x18125e){_0x155b37['push'](_0x155b37['shift']());}};_0x566704(++_0x4008c9);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x7fbe[_0x3932eb];return _0x5316e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index c4c4a4e..60e62e5 100644 --- a/server/api/sound/index.js +++ b/server/api/sound/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8053=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','download','diskStorage','join','originalname','replace','extname','now','single','file'];(function(_0x55803c,_0x321b2c){var _0x3e8c04=function(_0x146c50){while(--_0x146c50){_0x55803c['push'](_0x55803c['shift']());}};_0x3e8c04(++_0x321b2c);}(_0x8053,0x122));var _0x3805=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0x8053[_0x29a29f];return _0x443ea3;};'use strict';var multer=require(_0x3805('0x0'));var util=require(_0x3805('0x1'));var path=require(_0x3805('0x2'));var timeout=require(_0x3805('0x3'));var express=require(_0x3805('0x4'));var router=express[_0x3805('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3805('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3805('0x7'));var controller=require(_0x3805('0x8'));router[_0x3805('0x9')]('/',auth[_0x3805('0xa')](),controller[_0x3805('0xb')]);router[_0x3805('0x9')](_0x3805('0xc'),auth[_0x3805('0xa')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x3805('0xd')]);var upload=multer({'storage':multer[_0x3805('0xe')]({'destination':function(_0x40449f,_0x36e826,_0x49a192){_0x49a192(null,path[_0x3805('0xf')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x5d4893,_0x2fb644,_0x464bc7){_0x2fb644['originalname']=_0x2fb644[_0x3805('0x10')][_0x3805('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x464bc7(null,util['format']('%s-%s%s',path['basename'](_0x2fb644['originalname'],path[_0x3805('0x12')](_0x2fb644[_0x3805('0x10')])),Date[_0x3805('0x13')](),path[_0x3805('0x12')](_0x2fb644[_0x3805('0x10')])));}})});router['post']('/',upload[_0x3805('0x14')](_0x3805('0x15')),controller['create']);router[_0x3805('0x16')](_0x3805('0xc'),auth['isAuthenticated'](),controller[_0x3805('0x17')]);router[_0x3805('0x18')](_0x3805('0xc'),auth['isAuthenticated'](),controller[_0x3805('0x18')]);module[_0x3805('0x19')]=router; \ No newline at end of file +var _0xe0a4=['update','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','root','originalname','replace','format','%s-%s%s','basename','now','extname','post','file','create','put'];(function(_0x58fd6c,_0x5a15d2){var _0xf979ab=function(_0x2c42c5){while(--_0x2c42c5){_0x58fd6c['push'](_0x58fd6c['shift']());}};_0xf979ab(++_0x5a15d2);}(_0xe0a4,0x17c));var _0x4e0a=function(_0x5b58f0,_0xefc43c){_0x5b58f0=_0x5b58f0-0x0;var _0x181cd5=_0xe0a4[_0x5b58f0];return _0x181cd5;};'use strict';var multer=require(_0x4e0a('0x0'));var util=require('util');var path=require(_0x4e0a('0x1'));var timeout=require('connect-timeout');var express=require(_0x4e0a('0x2'));var router=express[_0x4e0a('0x3')]();var fs_extra=require(_0x4e0a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4e0a('0x5'));var config=require('../../config/environment');var controller=require(_0x4e0a('0x6'));router[_0x4e0a('0x7')]('/',auth[_0x4e0a('0x8')](),controller[_0x4e0a('0x9')]);router['get'](_0x4e0a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4e0a('0x7')](_0x4e0a('0xb'),auth[_0x4e0a('0x8')](),controller[_0x4e0a('0xc')]);var upload=multer({'storage':multer[_0x4e0a('0xd')]({'destination':function(_0x186182,_0x3cad37,_0x120efb){_0x120efb(null,path['join'](config[_0x4e0a('0xe')],'server/files/sounds/original/'));},'filename':function(_0x37c2c4,_0x54853c,_0x392977){_0x54853c[_0x4e0a('0xf')]=_0x54853c[_0x4e0a('0xf')][_0x4e0a('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x392977(null,util[_0x4e0a('0x11')](_0x4e0a('0x12'),path[_0x4e0a('0x13')](_0x54853c[_0x4e0a('0xf')],path['extname'](_0x54853c[_0x4e0a('0xf')])),Date[_0x4e0a('0x14')](),path[_0x4e0a('0x15')](_0x54853c[_0x4e0a('0xf')])));}})});router[_0x4e0a('0x16')]('/',upload['single'](_0x4e0a('0x17')),controller[_0x4e0a('0x18')]);router[_0x4e0a('0x19')]('/:id',auth[_0x4e0a('0x8')](),controller[_0x4e0a('0x1a')]);router['delete'](_0x4e0a('0xa'),auth[_0x4e0a('0x8')](),controller[_0x4e0a('0x1b')]);module[_0x4e0a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 57c4024..d051d56 100644 --- a/server/api/sound/sound.attributes.js +++ b/server/api/sound/sound.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4b6=['sequelize','exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x5b8f54,_0x24ab0e){var _0xfd7988=function(_0x16f1d3){while(--_0x16f1d3){_0x5b8f54['push'](_0x5b8f54['shift']());}};_0xfd7988(++_0x24ab0e);}(_0xa4b6,0x150));var _0x6a4b=function(_0x2175bc,_0x499819){_0x2175bc=_0x2175bc-0x0;var _0x5594de=_0xa4b6[_0x2175bc];return _0x5594de;};'use strict';var Sequelize=require(_0x6a4b('0x0'));module[_0x6a4b('0x1')]={'name':{'type':Sequelize[_0x6a4b('0x2')],'unique':_0x6a4b('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6a4b('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x6a4b('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x6a4b('0x4')]},'original_sampleCount':{'type':Sequelize[_0x6a4b('0x5')]},'original_channelCount':{'type':Sequelize[_0x6a4b('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x6a4b('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x6a4b('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x6a4b('0x5')]},'converted_channelCount':{'type':Sequelize[_0x6a4b('0x6')]},'converted_bitRate':{'type':Sequelize[_0x6a4b('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6f20=['INTEGER','FLOAT','exports','name','STRING','BIGINT'];(function(_0x4f8ee2,_0x1a1748){var _0x4ea4e2=function(_0x2a0bf9){while(--_0x2a0bf9){_0x4f8ee2['push'](_0x4f8ee2['shift']());}};_0x4ea4e2(++_0x1a1748);}(_0x6f20,0x1d0));var _0x06f2=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x6f20[_0x513047];return _0x15b779;};'use strict';var Sequelize=require('sequelize');module[_0x06f2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x06f2('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x06f2('0x2')]},'display_name':{'type':Sequelize[_0x06f2('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x06f2('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x06f2('0x3')]},'original_sampleRate':{'type':Sequelize[_0x06f2('0x4')]},'converted_format':{'type':Sequelize[_0x06f2('0x2')]},'converted_duration':{'type':Sequelize[_0x06f2('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x06f2('0x3')]},'converted_channelCount':{'type':Sequelize[_0x06f2('0x4')]},'converted_bitRate':{'type':Sequelize[_0x06f2('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x06f2('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index f1c1dfb..a3e9c3f 100644 --- a/server/api/sound/sound.controller.js +++ b/server/api/sound/sound.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ec4=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','Sounds','name','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','options','Sound','include','findAll','rows','merge','download','find','params','save_name','converted_format','root','Sequelize','ValidationError','Sound\x20not\x20found','join','server/files/sounds/converted','format','%s.%s','catch','create','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','sampleCount','converted_bitRate','converted_sampleRate','chmodSync','role','body','userProfileId','UserProfileSection','autoAssociation','start','update','description','eml-format','rimraf'];(function(_0x2a3f45,_0x4a7e67){var _0x5148a0=function(_0x2ffbf2){while(--_0x2ffbf2){_0x2a3f45['push'](_0x2a3f45['shift']());}};_0x5148a0(++_0x4a7e67);}(_0x6ec4,0xee));var _0x46ec=function(_0x2ed92f,_0x54091f){_0x2ed92f=_0x2ed92f-0x0;var _0x26ff04=_0x6ec4[_0x2ed92f];return _0x26ff04;};'use strict';var emlformat=require(_0x46ec('0x0'));var rimraf=require(_0x46ec('0x1'));var zipdir=require(_0x46ec('0x2'));var jsonpatch=require(_0x46ec('0x3'));var rp=require(_0x46ec('0x4'));var moment=require('moment');var BPromise=require(_0x46ec('0x5'));var Mustache=require(_0x46ec('0x6'));var util=require(_0x46ec('0x7'));var path=require(_0x46ec('0x8'));var sox=require(_0x46ec('0x9'));var csv=require(_0x46ec('0xa'));var ejs=require(_0x46ec('0xb'));var fs=require('fs');var fs_extra=require(_0x46ec('0xc'));var _=require(_0x46ec('0xd'));var squel=require('squel');var crypto=require(_0x46ec('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x46ec('0xf'));var toCsv=require(_0x46ec('0xa'));var querystring=require(_0x46ec('0x10'));var Papa=require(_0x46ec('0x11'));var Redis=require('ioredis');var authService=require(_0x46ec('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46ec('0x13'));var logger=require('../../config/logger')(_0x46ec('0x14'));var utils=require(_0x46ec('0x15'));var config=require(_0x46ec('0x16'));var licenseUtil=require(_0x46ec('0x17'));var db=require(_0x46ec('0x18'))['db'];function respondWithStatusCode(_0x30872b,_0x339fd4){_0x339fd4=_0x339fd4||0xcc;return function(_0x38d592){if(_0x38d592){return _0x30872b[_0x46ec('0x19')](_0x339fd4);}return _0x30872b[_0x46ec('0x1a')](_0x339fd4)[_0x46ec('0x1b')]();};}function respondWithResult(_0x42860f,_0x4168e0){_0x4168e0=_0x4168e0||0xc8;return function(_0x513e51){if(_0x513e51){return _0x42860f[_0x46ec('0x1a')](_0x4168e0)[_0x46ec('0x1c')](_0x513e51);}};}function respondWithFilteredResult(_0x4542fe,_0x216765){return function(_0x4ff3fd){if(_0x4ff3fd){var _0x2d1f94=typeof _0x216765[_0x46ec('0x1d')]===_0x46ec('0x1e')&&typeof _0x216765[_0x46ec('0x1f')]===_0x46ec('0x1e');var _0x197227=_0x4ff3fd['count'];var _0x79e33d=_0x2d1f94?0x0:_0x216765[_0x46ec('0x1d')];var _0x5b900a=_0x2d1f94?_0x4ff3fd[_0x46ec('0x20')]:_0x216765[_0x46ec('0x1d')]+_0x216765['limit'];var _0x445b53;if(_0x5b900a>=_0x197227){_0x5b900a=_0x197227;_0x445b53=0xc8;}else{_0x445b53=0xce;}_0x4542fe[_0x46ec('0x1a')](_0x445b53);return _0x4542fe['set']('Content-Range',_0x79e33d+'-'+_0x5b900a+'/'+_0x197227)['json'](_0x4ff3fd);}return null;};}function patchUpdates(_0xe6a714){return function(_0xc72630){try{jsonpatch[_0x46ec('0x21')](_0xc72630,_0xe6a714,!![]);}catch(_0x3a7e49){return BPromise[_0x46ec('0x22')](_0x3a7e49);}return _0xc72630[_0x46ec('0x23')]();};}function saveUpdates(_0x379147,_0xada961){return function(_0x45418f){if(_0x45418f){return _0x45418f['update'](_0x379147)[_0x46ec('0x24')](function(_0x4e2d11){return _0x4e2d11;});}return null;};}function removeEntity(_0x149790,_0x2e9730){return function(_0x144e7f){if(_0x144e7f){return _0x144e7f[_0x46ec('0x25')]()[_0x46ec('0x24')](function(){var _0x48adad=_0x144e7f['get']({'plain':!![]});var _0x1cb59d=_0x46ec('0x26');return db['UserProfileResource'][_0x46ec('0x25')]({'where':{'type':_0x1cb59d,'resourceId':_0x48adad['id']}})[_0x46ec('0x24')](function(){return _0x144e7f;});})[_0x46ec('0x24')](function(){_0x149790['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xda0f8f,_0x9ec884){return function(_0x2a9a24){if(!_0x2a9a24){_0xda0f8f[_0x46ec('0x19')](0x194);}return _0x2a9a24;};}function handleError(_0x264f18,_0x211a28){_0x211a28=_0x211a28||0x1f4;return function(_0x3166f6){logger['error'](_0x3166f6['stack']);if(_0x3166f6[_0x46ec('0x27')]){delete _0x3166f6[_0x46ec('0x27')];}_0x264f18[_0x46ec('0x1a')](_0x211a28)[_0x46ec('0x28')](_0x3166f6);};}exports[_0x46ec('0x29')]=function(_0xfaaa40,_0x507324){var _0x544873={},_0x20cd4a={},_0x39120d={'count':0x0,'rows':[]};var _0x523942=_['map'](db['Sound'][_0x46ec('0x2a')],function(_0x3baf0c){return{'name':_0x3baf0c['fieldName'],'type':_0x3baf0c[_0x46ec('0x2b')][_0x46ec('0x2c')]};});_0x20cd4a[_0x46ec('0x2d')]=_['map'](_0x523942,_0x46ec('0x27'));_0x20cd4a[_0x46ec('0x2e')]=_[_0x46ec('0x2f')](_0xfaaa40['query']);_0x20cd4a[_0x46ec('0x30')]=_[_0x46ec('0x31')](_0x20cd4a[_0x46ec('0x2d')],_0x20cd4a['query']);_0x544873[_0x46ec('0x32')]=_[_0x46ec('0x31')](_0x20cd4a[_0x46ec('0x2d')],qs[_0x46ec('0x33')](_0xfaaa40[_0x46ec('0x2e')]['fields']));_0x544873[_0x46ec('0x32')]=_0x544873[_0x46ec('0x32')][_0x46ec('0x34')]?_0x544873['attributes']:_0x20cd4a['model'];if(!_0xfaaa40[_0x46ec('0x2e')][_0x46ec('0x35')](_0x46ec('0x36'))){_0x544873[_0x46ec('0x1f')]=qs['limit'](_0xfaaa40[_0x46ec('0x2e')]['limit']);_0x544873['offset']=qs['offset'](_0xfaaa40['query'][_0x46ec('0x1d')]);}_0x544873[_0x46ec('0x37')]=qs[_0x46ec('0x38')](_0xfaaa40[_0x46ec('0x2e')]['sort']);_0x544873[_0x46ec('0x39')]=qs[_0x46ec('0x30')](_[_0x46ec('0x3a')](_0xfaaa40[_0x46ec('0x2e')],_0x20cd4a[_0x46ec('0x30')]),_0x523942);if(_0xfaaa40[_0x46ec('0x2e')][_0x46ec('0x3b')]){_0x544873['where']=_['merge'](_0x544873[_0x46ec('0x39')],{'$or':_[_0x46ec('0x3c')](_0x523942,function(_0x542ff7){if(_0x542ff7[_0x46ec('0x2b')]!==_0x46ec('0x3d')){var _0xc1c161={};_0xc1c161[_0x542ff7['name']]={'$like':'%'+_0xfaaa40[_0x46ec('0x2e')][_0x46ec('0x3b')]+'%'};return _0xc1c161;}})});}_0x544873=_['merge']({},_0x544873,_0xfaaa40[_0x46ec('0x3e')]);var _0x255797={'where':_0x544873[_0x46ec('0x39')]};return db[_0x46ec('0x3f')][_0x46ec('0x20')](_0x255797)[_0x46ec('0x24')](function(_0x1867d2){_0x39120d[_0x46ec('0x20')]=_0x1867d2;if(_0xfaaa40[_0x46ec('0x2e')]['includeAll']){_0x544873[_0x46ec('0x40')]=[{'all':!![]}];}return db['Sound'][_0x46ec('0x41')](_0x544873);})[_0x46ec('0x24')](function(_0x9eec80){_0x39120d[_0x46ec('0x42')]=_0x9eec80;return _0x39120d;})[_0x46ec('0x24')](respondWithFilteredResult(_0x507324,_0x544873))['catch'](handleError(_0x507324,null));};exports['show']=function(_0x5a258d,_0x21d846){var _0x5ea676={'raw':!![],'where':{'id':_0x5a258d['params']['id']}},_0x36388d={};_0x36388d['model']=_[_0x46ec('0x2f')](db['Sound'][_0x46ec('0x2a')]);_0x36388d[_0x46ec('0x2e')]=_[_0x46ec('0x2f')](_0x5a258d[_0x46ec('0x2e')]);_0x36388d[_0x46ec('0x30')]=_[_0x46ec('0x31')](_0x36388d[_0x46ec('0x2d')],_0x36388d['query']);_0x5ea676['attributes']=_[_0x46ec('0x31')](_0x36388d['model'],qs[_0x46ec('0x33')](_0x5a258d['query'][_0x46ec('0x33')]));_0x5ea676['attributes']=_0x5ea676[_0x46ec('0x32')]['length']?_0x5ea676[_0x46ec('0x32')]:_0x36388d[_0x46ec('0x2d')];if(_0x5a258d[_0x46ec('0x2e')]['includeAll']){_0x5ea676[_0x46ec('0x40')]=[{'all':!![]}];}_0x5ea676=_[_0x46ec('0x43')]({},_0x5ea676,_0x5a258d[_0x46ec('0x3e')]);return db['Sound']['find'](_0x5ea676)[_0x46ec('0x24')](handleEntityNotFound(_0x21d846,null))['then'](respondWithResult(_0x21d846,null))['catch'](handleError(_0x21d846,null));};exports[_0x46ec('0x44')]=function(_0x5676da,_0x3da758,_0x147e80){return db['Sound'][_0x46ec('0x45')]({'where':{'id':_0x5676da[_0x46ec('0x46')]['id']},'attributes':[_0x46ec('0x27'),_0x46ec('0x47'),_0x46ec('0x48')],'raw':!![]})[_0x46ec('0x24')](handleEntityNotFound(_0x3da758,null))[_0x46ec('0x24')](function(_0x396d20){if(_0x396d20){if(!fs['existsSync'](path['join'](config[_0x46ec('0x49')],'server/files/sounds/converted',_0x396d20[_0x46ec('0x47')]+'.'+_0x396d20['converted_format']))){throw new db[(_0x46ec('0x4a'))][(_0x46ec('0x4b'))](_0x46ec('0x4c'));}return _0x3da758[_0x46ec('0x44')](path[_0x46ec('0x4d')](config[_0x46ec('0x49')],_0x46ec('0x4e'),util[_0x46ec('0x4f')](_0x46ec('0x50'),_0x396d20['save_name'],_0x396d20['converted_format'])),util[_0x46ec('0x4f')](_0x46ec('0x50'),_0x396d20[_0x46ec('0x27')],_0x396d20[_0x46ec('0x48')]));}return null;})[_0x46ec('0x51')](handleError(_0x3da758,null));};exports[_0x46ec('0x52')]=function(_0x3b64a0,_0x382115,_0x1897e4){var _0x4cee1f={'name':path[_0x46ec('0x53')](_0x3b64a0[_0x46ec('0x54')]['originalname'],path[_0x46ec('0x55')](_0x3b64a0[_0x46ec('0x54')][_0x46ec('0x56')])),'save_name':path['basename'](_0x3b64a0['file']['filename'],path[_0x46ec('0x55')](_0x3b64a0[_0x46ec('0x54')][_0x46ec('0x57')])),'original_format':path[_0x46ec('0x55')](_0x3b64a0[_0x46ec('0x54')][_0x46ec('0x56')])[_0x46ec('0x58')](0x1),'converted_format':_0x46ec('0x59')};var _0x2fa670=path[_0x46ec('0x4d')](config[_0x46ec('0x49')],_0x46ec('0x5a'),_0x3b64a0[_0x46ec('0x54')]['filename']);var _0x3ab58c=path[_0x46ec('0x4d')](config[_0x46ec('0x49')],_0x46ec('0x4e'),util[_0x46ec('0x4f')](_0x46ec('0x50'),path[_0x46ec('0x53')](_0x3b64a0['file'][_0x46ec('0x57')],path[_0x46ec('0x55')](_0x3b64a0[_0x46ec('0x54')][_0x46ec('0x57')])),_0x4cee1f[_0x46ec('0x48')]));logger[_0x46ec('0x5b')](_0x46ec('0x5c'),_0x2fa670);logger[_0x46ec('0x5b')](_0x46ec('0x5d'),_0x3ab58c);try{fs['chmodSync'](_0x2fa670,parseInt(_0x46ec('0x5e'),0x8));var _0x218ed9=sox[_0x46ec('0x5f')](_0x2fa670,_0x3ab58c,{'sampleRate':0x1f40,'format':_0x46ec('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x218ed9['on'](_0x46ec('0x60'),function(_0x126be5){fs[_0x46ec('0x61')](_0x2fa670);_0x382115[_0x46ec('0x1a')](0x1f4)[_0x46ec('0x28')](_0x126be5);});_0x218ed9['on'](_0x46ec('0x62'),function(_0x3f6a44){_0x4cee1f[_0x46ec('0x63')]=isNaN(_0x3f6a44['duration'])?null:_0x3f6a44[_0x46ec('0x64')]*0x3e8;_0x4cee1f[_0x46ec('0x65')]=isNaN(_0x3f6a44['sampleCount'])?null:_0x3f6a44['sampleCount'];_0x4cee1f[_0x46ec('0x66')]=isNaN(_0x3f6a44[_0x46ec('0x67')])?null:_0x3f6a44['channelCount'];_0x4cee1f[_0x46ec('0x68')]=isNaN(_0x3f6a44[_0x46ec('0x69')])?null:_0x3f6a44[_0x46ec('0x69')];_0x4cee1f[_0x46ec('0x6a')]=isNaN(_0x3f6a44['sampleRate'])?null:_0x3f6a44[_0x46ec('0x6b')];});_0x218ed9['on']('dest',function(_0x436fa4){_0x4cee1f['converted_duration']=isNaN(_0x436fa4['duration'])?null:_0x436fa4[_0x46ec('0x64')]*0x3e8;_0x4cee1f['converted_sampleCount']=isNaN(_0x436fa4['sampleCount'])?null:_0x436fa4[_0x46ec('0x6c')];_0x4cee1f['converted_channelCount']=isNaN(_0x436fa4[_0x46ec('0x67')])?null:_0x436fa4[_0x46ec('0x67')];_0x4cee1f[_0x46ec('0x6d')]=isNaN(_0x436fa4[_0x46ec('0x69')])?null:_0x436fa4['bitRate'];_0x4cee1f[_0x46ec('0x6e')]=isNaN(_0x436fa4[_0x46ec('0x6b')])?null:_0x436fa4[_0x46ec('0x6b')];});_0x218ed9['on'](_0x46ec('0x1b'),function(){fs[_0x46ec('0x6f')](_0x3ab58c,parseInt(_0x46ec('0x5e'),0x8));return db[_0x46ec('0x3f')]['create'](_0x4cee1f)[_0x46ec('0x24')](function(_0x2e53c9){var _0xb28197={'role':_0x3b64a0['body'][_0x46ec('0x70')],'userProfileId':_0x3b64a0[_0x46ec('0x71')][_0x46ec('0x72')]};if(!_0xb28197)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb28197['role']==='user'){var _0x788728=_0x2e53c9['get']({'plain':!![]});return db[_0x46ec('0x73')][_0x46ec('0x45')]({'where':{'name':_0x46ec('0x26'),'userProfileId':_0xb28197[_0x46ec('0x72')]},'raw':!![]})[_0x46ec('0x24')](function(_0x561e53){if(_0x561e53&&_0x561e53[_0x46ec('0x74')]===0x0){return db['UserProfileResource'][_0x46ec('0x52')]({'name':_0x788728['name'],'resourceId':_0x788728['id'],'type':_0x561e53['name'],'sectionId':_0x561e53['id']},{})[_0x46ec('0x24')](function(){return _0x2e53c9;});}else{return _0x2e53c9;}})[_0x46ec('0x51')](function(_0x585ce4){logger[_0x46ec('0x60')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x585ce4);throw _0x585ce4;});}return _0x2e53c9;})[_0x46ec('0x24')](respondWithResult(_0x382115,null))['catch'](handleError(_0x382115,null));});_0x218ed9[_0x46ec('0x75')]();}catch(_0x16b3b1){_0x382115[_0x46ec('0x1a')](0x1f4)['send'](_0x16b3b1);}};exports[_0x46ec('0x76')]=function(_0x2eccc0,_0x2dd9e8,_0xe09beb){return db[_0x46ec('0x3f')][_0x46ec('0x45')]({'where':{'id':_0x2eccc0[_0x46ec('0x46')]['id']}})[_0x46ec('0x24')](handleEntityNotFound(_0x2dd9e8,null))['then'](saveUpdates(_[_0x46ec('0x3a')](_0x2eccc0[_0x46ec('0x71')],[_0x46ec('0x27'),_0x46ec('0x77')]),null))[_0x46ec('0x24')](respondWithResult(_0x2dd9e8,null))['catch'](handleError(_0x2dd9e8,null));};exports['delete']=function(_0x459b8f,_0x409b93,_0x1ba122){return db[_0x46ec('0x3f')][_0x46ec('0x45')]({'where':{'id':_0x459b8f[_0x46ec('0x46')]['id']}})[_0x46ec('0x24')](function(_0xfdf238){if(_0xfdf238){return _0xfdf238['destroy']();}})[_0x46ec('0x24')](function(_0x53fb53){var _0x42fe4d=path[_0x46ec('0x4d')](config['root'],_0x46ec('0x5a'),util['format'](_0x46ec('0x50'),_0x53fb53[_0x46ec('0x47')],_0x53fb53['original_format']));var _0xb6750e=path[_0x46ec('0x4d')](config[_0x46ec('0x49')],_0x46ec('0x4e'),util[_0x46ec('0x4f')](_0x46ec('0x50'),_0x53fb53[_0x46ec('0x47')],_0x53fb53[_0x46ec('0x48')]));fs[_0x46ec('0x61')](_0x42fe4d);fs[_0x46ec('0x61')](_0xb6750e);return _0x53fb53;})[_0x46ec('0x24')](function(_0x54b2c1){if(_0x54b2c1){return _0x409b93[_0x46ec('0x1a')](0xcc)['end']();}})[_0x46ec('0x24')](handleEntityNotFound(_0x409b93,null))['catch'](handleError(_0x409b93,null));}; \ No newline at end of file +var _0x21f5=['delete','server/files/sounds/original','original_format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','json','apply','reject','save','destroy','then','get','name','index','map','Sound','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','options','count','includeAll','include','catch','show','params','merge','find','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sound\x20not\x20found','download','format','%s.%s','basename','file','extname','originalname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','send','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','end','0777','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description'];(function(_0x224728,_0x1a2564){var _0xd3bc1c=function(_0x28338d){while(--_0x28338d){_0x224728['push'](_0x224728['shift']());}};_0xd3bc1c(++_0x1a2564);}(_0x21f5,0x1eb));var _0x521f=function(_0x3765ba,_0xbc65e6){_0x3765ba=_0x3765ba-0x0;var _0xecc48=_0x21f5[_0x3765ba];return _0xecc48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x521f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x521f('0x1'));var rp=require(_0x521f('0x2'));var moment=require(_0x521f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x521f('0x4'));var util=require(_0x521f('0x5'));var path=require(_0x521f('0x6'));var sox=require(_0x521f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x521f('0x8'));var _=require('lodash');var squel=require(_0x521f('0x9'));var crypto=require('crypto');var jsforce=require(_0x521f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x521f('0xb'));var querystring=require(_0x521f('0xc'));var Papa=require(_0x521f('0xd'));var Redis=require(_0x521f('0xe'));var authService=require(_0x521f('0xf'));var qs=require(_0x521f('0x10'));var as=require(_0x521f('0x11'));var hardwareService=require(_0x521f('0x12'));var logger=require(_0x521f('0x13'))(_0x521f('0x14'));var utils=require(_0x521f('0x15'));var config=require(_0x521f('0x16'));var licenseUtil=require(_0x521f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2af993,_0x5296e9){_0x5296e9=_0x5296e9||0xcc;return function(_0x4b40b5){if(_0x4b40b5){return _0x2af993[_0x521f('0x18')](_0x5296e9);}return _0x2af993[_0x521f('0x19')](_0x5296e9)['end']();};}function respondWithResult(_0x6ec6ad,_0x2a2402){_0x2a2402=_0x2a2402||0xc8;return function(_0x51e007){if(_0x51e007){return _0x6ec6ad[_0x521f('0x19')](_0x2a2402)['json'](_0x51e007);}};}function respondWithFilteredResult(_0x274de7,_0x23f4cd){return function(_0x195240){if(_0x195240){var _0x5bc450=typeof _0x23f4cd[_0x521f('0x1a')]===_0x521f('0x1b')&&typeof _0x23f4cd[_0x521f('0x1c')]==='undefined';var _0x4e3278=_0x195240['count'];var _0x43569d=_0x5bc450?0x0:_0x23f4cd[_0x521f('0x1a')];var _0xd9d38e=_0x5bc450?_0x195240['count']:_0x23f4cd[_0x521f('0x1a')]+_0x23f4cd[_0x521f('0x1c')];var _0x4a8c99;if(_0xd9d38e>=_0x4e3278){_0xd9d38e=_0x4e3278;_0x4a8c99=0xc8;}else{_0x4a8c99=0xce;}_0x274de7[_0x521f('0x19')](_0x4a8c99);return _0x274de7[_0x521f('0x1d')]('Content-Range',_0x43569d+'-'+_0xd9d38e+'/'+_0x4e3278)[_0x521f('0x1e')](_0x195240);}return null;};}function patchUpdates(_0x517f87){return function(_0x2866e9){try{jsonpatch[_0x521f('0x1f')](_0x2866e9,_0x517f87,!![]);}catch(_0x2b3ca9){return BPromise[_0x521f('0x20')](_0x2b3ca9);}return _0x2866e9[_0x521f('0x21')]();};}function saveUpdates(_0x4d918f,_0x4bac39){return function(_0x21e2dc){if(_0x21e2dc){return _0x21e2dc['update'](_0x4d918f)['then'](function(_0x36f06f){return _0x36f06f;});}return null;};}function removeEntity(_0x550233,_0x5c71c6){return function(_0x6fa681){if(_0x6fa681){return _0x6fa681[_0x521f('0x22')]()[_0x521f('0x23')](function(){var _0x353e22=_0x6fa681[_0x521f('0x24')]({'plain':!![]});var _0xc6cdb5='Sounds';return db['UserProfileResource']['destroy']({'where':{'type':_0xc6cdb5,'resourceId':_0x353e22['id']}})[_0x521f('0x23')](function(){return _0x6fa681;});})[_0x521f('0x23')](function(){_0x550233[_0x521f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49a295,_0x40684b){return function(_0x2446f0){if(!_0x2446f0){_0x49a295['sendStatus'](0x194);}return _0x2446f0;};}function handleError(_0x4b68b6,_0x2c019e){_0x2c019e=_0x2c019e||0x1f4;return function(_0xabd68e){logger['error'](_0xabd68e['stack']);if(_0xabd68e['name']){delete _0xabd68e[_0x521f('0x25')];}_0x4b68b6[_0x521f('0x19')](_0x2c019e)['send'](_0xabd68e);};}exports[_0x521f('0x26')]=function(_0x51ef39,_0x138ae2){var _0x3c737={},_0x483b8e={},_0x590118={'count':0x0,'rows':[]};var _0xa1a0e0=_[_0x521f('0x27')](db[_0x521f('0x28')][_0x521f('0x29')],function(_0x381684){return{'name':_0x381684[_0x521f('0x2a')],'type':_0x381684['type'][_0x521f('0x2b')]};});_0x483b8e[_0x521f('0x2c')]=_[_0x521f('0x27')](_0xa1a0e0,_0x521f('0x25'));_0x483b8e[_0x521f('0x2d')]=_[_0x521f('0x2e')](_0x51ef39[_0x521f('0x2d')]);_0x483b8e[_0x521f('0x2f')]=_[_0x521f('0x30')](_0x483b8e[_0x521f('0x2c')],_0x483b8e[_0x521f('0x2d')]);_0x3c737[_0x521f('0x31')]=_[_0x521f('0x30')](_0x483b8e[_0x521f('0x2c')],qs['fields'](_0x51ef39[_0x521f('0x2d')]['fields']));_0x3c737[_0x521f('0x31')]=_0x3c737[_0x521f('0x31')][_0x521f('0x32')]?_0x3c737[_0x521f('0x31')]:_0x483b8e['model'];if(!_0x51ef39[_0x521f('0x2d')][_0x521f('0x33')](_0x521f('0x34'))){_0x3c737[_0x521f('0x1c')]=qs[_0x521f('0x1c')](_0x51ef39[_0x521f('0x2d')][_0x521f('0x1c')]);_0x3c737[_0x521f('0x1a')]=qs[_0x521f('0x1a')](_0x51ef39['query'][_0x521f('0x1a')]);}_0x3c737[_0x521f('0x35')]=qs['sort'](_0x51ef39['query']['sort']);_0x3c737['where']=qs[_0x521f('0x2f')](_[_0x521f('0x36')](_0x51ef39[_0x521f('0x2d')],_0x483b8e[_0x521f('0x2f')]),_0xa1a0e0);if(_0x51ef39['query'][_0x521f('0x37')]){_0x3c737[_0x521f('0x38')]=_['merge'](_0x3c737[_0x521f('0x38')],{'$or':_[_0x521f('0x27')](_0xa1a0e0,function(_0x5abacd){if(_0x5abacd['type']!==_0x521f('0x39')){var _0x470563={};_0x470563[_0x5abacd[_0x521f('0x25')]]={'$like':'%'+_0x51ef39[_0x521f('0x2d')][_0x521f('0x37')]+'%'};return _0x470563;}})});}_0x3c737=_['merge']({},_0x3c737,_0x51ef39[_0x521f('0x3a')]);var _0x1dcfdc={'where':_0x3c737[_0x521f('0x38')]};return db[_0x521f('0x28')][_0x521f('0x3b')](_0x1dcfdc)[_0x521f('0x23')](function(_0x2c54d3){_0x590118[_0x521f('0x3b')]=_0x2c54d3;if(_0x51ef39[_0x521f('0x2d')][_0x521f('0x3c')]){_0x3c737[_0x521f('0x3d')]=[{'all':!![]}];}return db[_0x521f('0x28')]['findAll'](_0x3c737);})['then'](function(_0x5b1b47){_0x590118['rows']=_0x5b1b47;return _0x590118;})[_0x521f('0x23')](respondWithFilteredResult(_0x138ae2,_0x3c737))[_0x521f('0x3e')](handleError(_0x138ae2,null));};exports[_0x521f('0x3f')]=function(_0x58e81c,_0x476556){var _0x2dd55f={'raw':!![],'where':{'id':_0x58e81c[_0x521f('0x40')]['id']}},_0x2bb013={};_0x2bb013[_0x521f('0x2c')]=_[_0x521f('0x2e')](db[_0x521f('0x28')][_0x521f('0x29')]);_0x2bb013[_0x521f('0x2d')]=_[_0x521f('0x2e')](_0x58e81c[_0x521f('0x2d')]);_0x2bb013[_0x521f('0x2f')]=_[_0x521f('0x30')](_0x2bb013[_0x521f('0x2c')],_0x2bb013['query']);_0x2dd55f['attributes']=_[_0x521f('0x30')](_0x2bb013[_0x521f('0x2c')],qs['fields'](_0x58e81c[_0x521f('0x2d')]['fields']));_0x2dd55f[_0x521f('0x31')]=_0x2dd55f[_0x521f('0x31')][_0x521f('0x32')]?_0x2dd55f[_0x521f('0x31')]:_0x2bb013[_0x521f('0x2c')];if(_0x58e81c[_0x521f('0x2d')]['includeAll']){_0x2dd55f['include']=[{'all':!![]}];}_0x2dd55f=_[_0x521f('0x41')]({},_0x2dd55f,_0x58e81c[_0x521f('0x3a')]);return db[_0x521f('0x28')][_0x521f('0x42')](_0x2dd55f)[_0x521f('0x23')](handleEntityNotFound(_0x476556,null))[_0x521f('0x23')](respondWithResult(_0x476556,null))[_0x521f('0x3e')](handleError(_0x476556,null));};exports['download']=function(_0x2bf0e7,_0x3d8002,_0x2bab17){return db[_0x521f('0x28')][_0x521f('0x42')]({'where':{'id':_0x2bf0e7[_0x521f('0x40')]['id']},'attributes':['name','save_name',_0x521f('0x43')],'raw':!![]})['then'](handleEntityNotFound(_0x3d8002,null))[_0x521f('0x23')](function(_0x173997){if(_0x173997){if(!fs[_0x521f('0x44')](path[_0x521f('0x45')](config[_0x521f('0x46')],_0x521f('0x47'),_0x173997[_0x521f('0x48')]+'.'+_0x173997[_0x521f('0x43')]))){throw new db['Sequelize']['ValidationError'](_0x521f('0x49'));}return _0x3d8002[_0x521f('0x4a')](path[_0x521f('0x45')](config['root'],_0x521f('0x47'),util[_0x521f('0x4b')](_0x521f('0x4c'),_0x173997['save_name'],_0x173997[_0x521f('0x43')])),util['format']('%s.%s',_0x173997[_0x521f('0x25')],_0x173997[_0x521f('0x43')]));}return null;})[_0x521f('0x3e')](handleError(_0x3d8002,null));};exports['create']=function(_0x83ec55,_0x265f10,_0x1655bf){var _0x237f1f={'name':path[_0x521f('0x4d')](_0x83ec55[_0x521f('0x4e')]['originalname'],path[_0x521f('0x4f')](_0x83ec55[_0x521f('0x4e')][_0x521f('0x50')])),'save_name':path['basename'](_0x83ec55[_0x521f('0x4e')][_0x521f('0x51')],path[_0x521f('0x4f')](_0x83ec55[_0x521f('0x4e')][_0x521f('0x51')])),'original_format':path['extname'](_0x83ec55['file']['originalname'])[_0x521f('0x52')](0x1),'converted_format':_0x521f('0x53')};var _0x1bfa7d=path[_0x521f('0x45')](config[_0x521f('0x46')],'server/files/sounds/original',_0x83ec55[_0x521f('0x4e')][_0x521f('0x51')]);var _0x7112b8=path['join'](config['root'],_0x521f('0x47'),util['format']('%s.%s',path['basename'](_0x83ec55[_0x521f('0x4e')][_0x521f('0x51')],path[_0x521f('0x4f')](_0x83ec55[_0x521f('0x4e')][_0x521f('0x51')])),_0x237f1f[_0x521f('0x43')]));logger[_0x521f('0x54')](_0x521f('0x55'),_0x1bfa7d);logger[_0x521f('0x54')](_0x521f('0x56'),_0x7112b8);try{fs[_0x521f('0x57')](_0x1bfa7d,parseInt('0777',0x8));var _0x1fb12a=sox[_0x521f('0x58')](_0x1bfa7d,_0x7112b8,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1fb12a['on']('error',function(_0x2aba64){fs[_0x521f('0x59')](_0x1bfa7d);_0x265f10[_0x521f('0x19')](0x1f4)[_0x521f('0x5a')](_0x2aba64);});_0x1fb12a['on'](_0x521f('0x5b'),function(_0x2f82f6){_0x237f1f['original_duration']=isNaN(_0x2f82f6[_0x521f('0x5c')])?null:_0x2f82f6['duration']*0x3e8;_0x237f1f['original_sampleCount']=isNaN(_0x2f82f6['sampleCount'])?null:_0x2f82f6[_0x521f('0x5d')];_0x237f1f[_0x521f('0x5e')]=isNaN(_0x2f82f6[_0x521f('0x5f')])?null:_0x2f82f6[_0x521f('0x5f')];_0x237f1f[_0x521f('0x60')]=isNaN(_0x2f82f6['bitRate'])?null:_0x2f82f6[_0x521f('0x61')];_0x237f1f[_0x521f('0x62')]=isNaN(_0x2f82f6[_0x521f('0x63')])?null:_0x2f82f6['sampleRate'];});_0x1fb12a['on'](_0x521f('0x64'),function(_0x47c70f){_0x237f1f[_0x521f('0x65')]=isNaN(_0x47c70f[_0x521f('0x5c')])?null:_0x47c70f[_0x521f('0x5c')]*0x3e8;_0x237f1f[_0x521f('0x66')]=isNaN(_0x47c70f[_0x521f('0x5d')])?null:_0x47c70f[_0x521f('0x5d')];_0x237f1f['converted_channelCount']=isNaN(_0x47c70f['channelCount'])?null:_0x47c70f[_0x521f('0x5f')];_0x237f1f[_0x521f('0x67')]=isNaN(_0x47c70f[_0x521f('0x61')])?null:_0x47c70f[_0x521f('0x61')];_0x237f1f[_0x521f('0x68')]=isNaN(_0x47c70f['sampleRate'])?null:_0x47c70f[_0x521f('0x63')];});_0x1fb12a['on'](_0x521f('0x69'),function(){fs[_0x521f('0x57')](_0x7112b8,parseInt(_0x521f('0x6a'),0x8));return db['Sound'][_0x521f('0x6b')](_0x237f1f)[_0x521f('0x23')](function(_0x1ec3a9){var _0x1312e4={'role':_0x83ec55[_0x521f('0x6c')][_0x521f('0x6d')],'userProfileId':_0x83ec55['body'][_0x521f('0x6e')]};if(!_0x1312e4)throw new Error(_0x521f('0x6f'));if(_0x1312e4[_0x521f('0x6d')]==='user'){var _0x2bfbc1=_0x1ec3a9[_0x521f('0x24')]({'plain':!![]});return db[_0x521f('0x70')][_0x521f('0x42')]({'where':{'name':'Sounds','userProfileId':_0x1312e4['userProfileId']},'raw':!![]})[_0x521f('0x23')](function(_0x242201){if(_0x242201&&_0x242201[_0x521f('0x71')]===0x0){return db[_0x521f('0x72')][_0x521f('0x6b')]({'name':_0x2bfbc1[_0x521f('0x25')],'resourceId':_0x2bfbc1['id'],'type':_0x242201[_0x521f('0x25')],'sectionId':_0x242201['id']},{})[_0x521f('0x23')](function(){return _0x1ec3a9;});}else{return _0x1ec3a9;}})[_0x521f('0x3e')](function(_0x221ba1){logger[_0x521f('0x73')](_0x521f('0x74'),_0x221ba1);throw _0x221ba1;});}return _0x1ec3a9;})[_0x521f('0x23')](respondWithResult(_0x265f10,null))['catch'](handleError(_0x265f10,null));});_0x1fb12a['start']();}catch(_0x123204){_0x265f10['status'](0x1f4)['send'](_0x123204);}};exports[_0x521f('0x75')]=function(_0x314166,_0x3579f8,_0x59009c){return db[_0x521f('0x28')][_0x521f('0x42')]({'where':{'id':_0x314166[_0x521f('0x40')]['id']}})[_0x521f('0x23')](handleEntityNotFound(_0x3579f8,null))[_0x521f('0x23')](saveUpdates(_[_0x521f('0x36')](_0x314166[_0x521f('0x6c')],[_0x521f('0x25'),_0x521f('0x76')]),null))[_0x521f('0x23')](respondWithResult(_0x3579f8,null))[_0x521f('0x3e')](handleError(_0x3579f8,null));};exports[_0x521f('0x77')]=function(_0x335e8e,_0x4d4982,_0x465b9f){return db[_0x521f('0x28')][_0x521f('0x42')]({'where':{'id':_0x335e8e[_0x521f('0x40')]['id']}})[_0x521f('0x23')](function(_0x383424){if(_0x383424){return _0x383424['destroy']();}})[_0x521f('0x23')](function(_0x265c18){var _0x20357f=path['join'](config[_0x521f('0x46')],_0x521f('0x78'),util['format'](_0x521f('0x4c'),_0x265c18[_0x521f('0x48')],_0x265c18[_0x521f('0x79')]));var _0xb9e3d=path[_0x521f('0x45')](config[_0x521f('0x46')],_0x521f('0x47'),util['format'](_0x521f('0x4c'),_0x265c18[_0x521f('0x48')],_0x265c18[_0x521f('0x43')]));fs[_0x521f('0x59')](_0x20357f);fs[_0x521f('0x59')](_0xb9e3d);return _0x265c18;})[_0x521f('0x23')](function(_0x1050a3){if(_0x1050a3){return _0x4d4982['status'](0xcc)[_0x521f('0x69')]();}})[_0x521f('0x23')](handleEntityNotFound(_0x4d4982,null))[_0x521f('0x3e')](handleError(_0x4d4982,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 991750f..c46a5da 100644 --- a/server/api/sound/sound.model.js +++ b/server/api/sound/sound.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46e0=['tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound'];(function(_0x430c14,_0x3afe0b){var _0xbceb21=function(_0x18568b){while(--_0x18568b){_0x430c14['push'](_0x430c14['shift']());}};_0xbceb21(++_0x3afe0b);}(_0x46e0,0x1b3));var _0x046e=function(_0x32b7d6,_0x3dce0d){_0x32b7d6=_0x32b7d6-0x0;var _0x2ddedb=_0x46e0[_0x32b7d6];return _0x2ddedb;};'use strict';var _=require(_0x046e('0x0'));var util=require(_0x046e('0x1'));var logger=require(_0x046e('0x2'))(_0x046e('0x3'));var moment=require(_0x046e('0x4'));var BPromise=require(_0x046e('0x5'));var rp=require(_0x046e('0x6'));var fs=require('fs');var path=require(_0x046e('0x7'));var rimraf=require(_0x046e('0x8'));var config=require(_0x046e('0x9'));var attributes=require(_0x046e('0xa'));module['exports']=function(_0x3ec007,_0x24e75b){return _0x3ec007[_0x046e('0xb')](_0x046e('0xc'),attributes,{'tableName':_0x046e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5993=['request-promise','path','./sound.attributes','define','Sound','tools_sounds','util','../../config/logger','moment','bluebird'];(function(_0x16631c,_0x152fc8){var _0x258256=function(_0x4841d2){while(--_0x4841d2){_0x16631c['push'](_0x16631c['shift']());}};_0x258256(++_0x152fc8);}(_0x5993,0x1f0));var _0x3599=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x5993[_0x266618];return _0x54dbf5;};'use strict';var _=require('lodash');var util=require(_0x3599('0x0'));var logger=require(_0x3599('0x1'))('api');var moment=require(_0x3599('0x2'));var BPromise=require(_0x3599('0x3'));var rp=require(_0x3599('0x4'));var fs=require('fs');var path=require(_0x3599('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3599('0x6'));module['exports']=function(_0x3e2205,_0x324dff){return _0x3e2205[_0x3599('0x7')](_0x3599('0x8'),attributes,{'tableName':_0x3599('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 6b541da..ef18681 100644 --- a/server/api/sound/sound.rpc.js +++ b/server/api/sound/sound.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e0d=['map','then','stringify','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','model'];(function(_0x46defe,_0x3c2f95){var _0x35c14a=function(_0x578bc9){while(--_0x578bc9){_0x46defe['push'](_0x46defe['shift']());}};_0x35c14a(++_0x3c2f95);}(_0x8e0d,0x1f0));var _0xd8e0=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x8e0d[_0x10004e];return _0x5af990;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var moment=require(_0xd8e0('0x1'));var BPromise=require(_0xd8e0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8e0('0x3'))['db'];var utils=require(_0xd8e0('0x4'));var logger=require(_0xd8e0('0x5'))('rpc');var config=require(_0xd8e0('0x6'));var jayson=require(_0xd8e0('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d04aa,_0x362269,_0x289e36){return new BPromise(function(_0x596787,_0x528f0c){return client[_0xd8e0('0x8')](_0x2d04aa,_0x289e36)['then'](function(_0x2d6e28){logger[_0xd8e0('0x9')](_0xd8e0('0xa'),_0x362269,_0xd8e0('0xb'));logger['debug'](_0xd8e0('0xc'),_0x362269,_0xd8e0('0xb'),JSON['stringify'](_0x2d6e28));if(_0x2d6e28[_0xd8e0('0xd')]){if(_0x2d6e28[_0xd8e0('0xd')]['code']===0x1f4){logger['error'](_0xd8e0('0xa'),_0x362269,_0x2d6e28[_0xd8e0('0xd')][_0xd8e0('0xe')]);return _0x528f0c(_0x2d6e28[_0xd8e0('0xd')]['message']);}logger[_0xd8e0('0xd')](_0xd8e0('0xa'),_0x362269,_0x2d6e28[_0xd8e0('0xd')][_0xd8e0('0xe')]);return _0x596787(_0x2d6e28[_0xd8e0('0xd')][_0xd8e0('0xe')]);}else{logger['info']('Sound,\x20%s,\x20%s',_0x362269,'request\x20sent');_0x596787(_0x2d6e28[_0xd8e0('0xf')][_0xd8e0('0xe')]);}})[_0xd8e0('0x10')](function(_0x231b00){logger[_0xd8e0('0xd')](_0xd8e0('0xa'),_0x362269,_0x231b00);_0x528f0c(_0x231b00);});});}exports[_0xd8e0('0x11')]=function(_0x41de8a){var _0xfcf050=this;return new Promise(function(_0x4ff853,_0x47b4a9){return db[_0xd8e0('0x12')][_0xd8e0('0x13')]({'raw':_0x41de8a[_0xd8e0('0x14')]?_0x41de8a[_0xd8e0('0x14')][_0xd8e0('0x15')]===undefined?!![]:![]:!![],'where':_0x41de8a[_0xd8e0('0x14')]?_0x41de8a[_0xd8e0('0x14')][_0xd8e0('0x16')]||null:null,'attributes':_0x41de8a[_0xd8e0('0x14')]?_0x41de8a[_0xd8e0('0x14')][_0xd8e0('0x17')]||null:null,'include':_0x41de8a[_0xd8e0('0x14')]?_0x41de8a[_0xd8e0('0x14')]['include']?_['map'](_0x41de8a['options'][_0xd8e0('0x18')],function(_0x499691){return{'model':db[_0x499691[_0xd8e0('0x19')]],'as':_0x499691['as'],'attributes':_0x499691[_0xd8e0('0x17')],'include':_0x499691[_0xd8e0('0x18')]?_[_0xd8e0('0x1a')](_0x499691[_0xd8e0('0x18')],function(_0x2d9278){return{'model':db[_0x2d9278[_0xd8e0('0x19')]],'as':_0x2d9278['as'],'attributes':_0x2d9278[_0xd8e0('0x17')],'include':_0x2d9278[_0xd8e0('0x18')]?_[_0xd8e0('0x1a')](_0x2d9278[_0xd8e0('0x18')],function(_0x418737){return{'model':db[_0x418737[_0xd8e0('0x19')]],'as':_0x418737['as'],'attributes':_0x418737[_0xd8e0('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd8e0('0x1b')](function(_0x56001c){logger[_0xd8e0('0x9')](_0xd8e0('0x11'),_0x41de8a);logger['debug'](_0xd8e0('0x11'),_0x41de8a,JSON[_0xd8e0('0x1c')](_0x56001c));_0x4ff853(_0x56001c);})[_0xd8e0('0x10')](function(_0x1089ba){logger[_0xd8e0('0xd')]('ShowSound',_0x1089ba[_0xd8e0('0xe')],_0x41de8a);_0x47b4a9(_0xfcf050['error'](0x1f4,_0x1089ba[_0xd8e0('0xe')]));});});}; \ No newline at end of file +var _0xcc78=['jayson/promise','client','http','request','then','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','Sound,\x20%s,\x20%s','message','result','ShowSound','Sound','options','raw','where','attributes','include','map','model','info','stringify','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x21b4d6,_0x53c476){var _0x5d50f8=function(_0x2ff446){while(--_0x2ff446){_0x21b4d6['push'](_0x21b4d6['shift']());}};_0x5d50f8(++_0x53c476);}(_0xcc78,0x1da));var _0x8cc7=function(_0x36987b,_0x49a49f){_0x36987b=_0x36987b-0x0;var _0x38f317=_0xcc78[_0x36987b];return _0x38f317;};'use strict';var _=require(_0x8cc7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8cc7('0x1'));var rs=require(_0x8cc7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8cc7('0x3'));var logger=require(_0x8cc7('0x4'))(_0x8cc7('0x5'));var config=require('../../config/environment');var jayson=require(_0x8cc7('0x6'));var client=jayson[_0x8cc7('0x7')][_0x8cc7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b4cd9,_0x348358,_0x217081){return new BPromise(function(_0x39b2ed,_0x16a08e){return client[_0x8cc7('0x9')](_0x2b4cd9,_0x217081)[_0x8cc7('0xa')](function(_0x4da772){logger['info']('Sound,\x20%s,\x20%s',_0x348358,_0x8cc7('0xb'));logger[_0x8cc7('0xc')](_0x8cc7('0xd'),_0x348358,_0x8cc7('0xb'),JSON['stringify'](_0x4da772));if(_0x4da772[_0x8cc7('0xe')]){if(_0x4da772['error']['code']===0x1f4){logger['error'](_0x8cc7('0xf'),_0x348358,_0x4da772[_0x8cc7('0xe')][_0x8cc7('0x10')]);return _0x16a08e(_0x4da772[_0x8cc7('0xe')][_0x8cc7('0x10')]);}logger[_0x8cc7('0xe')](_0x8cc7('0xf'),_0x348358,_0x4da772[_0x8cc7('0xe')]['message']);return _0x39b2ed(_0x4da772[_0x8cc7('0xe')]['message']);}else{logger['info']('Sound,\x20%s,\x20%s',_0x348358,_0x8cc7('0xb'));_0x39b2ed(_0x4da772[_0x8cc7('0x11')][_0x8cc7('0x10')]);}})['catch'](function(_0x61e468){logger[_0x8cc7('0xe')](_0x8cc7('0xf'),_0x348358,_0x61e468);_0x16a08e(_0x61e468);});});}exports[_0x8cc7('0x12')]=function(_0xe6c9bf){var _0x50a649=this;return new Promise(function(_0xee4467,_0x388f62){return db[_0x8cc7('0x13')]['find']({'raw':_0xe6c9bf['options']?_0xe6c9bf[_0x8cc7('0x14')][_0x8cc7('0x15')]===undefined?!![]:![]:!![],'where':_0xe6c9bf['options']?_0xe6c9bf[_0x8cc7('0x14')][_0x8cc7('0x16')]||null:null,'attributes':_0xe6c9bf[_0x8cc7('0x14')]?_0xe6c9bf[_0x8cc7('0x14')][_0x8cc7('0x17')]||null:null,'include':_0xe6c9bf[_0x8cc7('0x14')]?_0xe6c9bf[_0x8cc7('0x14')][_0x8cc7('0x18')]?_[_0x8cc7('0x19')](_0xe6c9bf[_0x8cc7('0x14')][_0x8cc7('0x18')],function(_0x78b277){return{'model':db[_0x78b277[_0x8cc7('0x1a')]],'as':_0x78b277['as'],'attributes':_0x78b277['attributes'],'include':_0x78b277[_0x8cc7('0x18')]?_[_0x8cc7('0x19')](_0x78b277[_0x8cc7('0x18')],function(_0x54ba46){return{'model':db[_0x54ba46[_0x8cc7('0x1a')]],'as':_0x54ba46['as'],'attributes':_0x54ba46[_0x8cc7('0x17')],'include':_0x54ba46[_0x8cc7('0x18')]?_[_0x8cc7('0x19')](_0x54ba46[_0x8cc7('0x18')],function(_0x1a8e7c){return{'model':db[_0x1a8e7c[_0x8cc7('0x1a')]],'as':_0x1a8e7c['as'],'attributes':_0x1a8e7c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x7d0524){logger[_0x8cc7('0x1b')](_0x8cc7('0x12'),_0xe6c9bf);logger['debug'](_0x8cc7('0x12'),_0xe6c9bf,JSON[_0x8cc7('0x1c')](_0x7d0524));_0xee4467(_0x7d0524);})[_0x8cc7('0x1d')](function(_0x5e36e5){logger['error'](_0x8cc7('0x12'),_0x5e36e5[_0x8cc7('0x10')],_0xe6c9bf);_0x388f62(_0x50a649['error'](0x1f4,_0x5e36e5[_0x8cc7('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 1b4fe2a..6e80adf 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x320d91,_0x21b9bc){var _0x50b32f=function(_0x50c3c4){while(--_0x50c3c4){_0x320d91['push'](_0x320d91['shift']());}};_0x50b32f(++_0x21b9bc);}(_0xac4a,0x13f));var _0xaac4=function(_0x1fb232,_0x5159d7){_0x1fb232=_0x1fb232-0x0;var _0x321fcb=_0xac4a[_0x1fb232];return _0x321fcb;};'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 fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x5bb818,_0x57780a){var _0xc56b13=function(_0x3de0a8){while(--_0x3de0a8){_0x5bb818['push'](_0x5bb818['shift']());}};_0xc56b13(++_0x57780a);}(_0xda2d,0x102));var _0xdda2=function(_0x3ed8b4,_0x255c5e){_0x3ed8b4=_0x3ed8b4-0x0;var _0x5ea042=_0xda2d[_0x3ed8b4];return _0x5ea042;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index c57d7ea..52ada0b 100644 --- a/server/api/squareMessage/squareMessage.attributes.js +++ b/server/api/squareMessage/squareMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9642=['TEXT','medium','ENUM','out','exports','STRING'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x9642,0x178));var _0x2964=function(_0x244b93,_0x496cdd){_0x244b93=_0x244b93-0x0;var _0x57a847=_0x9642[_0x244b93];return _0x57a847;};'use strict';var Sequelize=require('sequelize');module[_0x2964('0x0')]={'uniqueid':{'type':Sequelize[_0x2964('0x1')]},'body':{'type':Sequelize[_0x2964('0x2')](_0x2964('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x2964('0x4')]('in','out'),'defaultValue':_0x2964('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xcb52=['medium','ENUM','out','STRING','TEXT'];(function(_0x2ff022,_0x183a9c){var _0x1cbaa5=function(_0x342bd9){while(--_0x342bd9){_0x2ff022['push'](_0x2ff022['shift']());}};_0x1cbaa5(++_0x183a9c);}(_0xcb52,0xc2));var _0x2cb5=function(_0x5c5995,_0x2e14e1){_0x5c5995=_0x5c5995-0x0;var _0x38d223=_0xcb52[_0x5c5995];return _0x38d223;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x2cb5('0x0')](_0x2cb5('0x1')),'allowNull':![]},'direction':{'type':Sequelize[_0x2cb5('0x2')]('in',_0x2cb5('0x3')),'defaultValue':_0x2cb5('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2cb5('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index f817cac..31255cc 100644 --- a/server/api/squareMessage/squareMessage.controller.js +++ b/server/api/squareMessage/squareMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x186d=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','save','then','destroy','sendStatus','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model'];(function(_0xaef996,_0xff6c7b){var _0x5f1425=function(_0x2e0713){while(--_0x2e0713){_0xaef996['push'](_0xaef996['shift']());}};_0x5f1425(++_0xff6c7b);}(_0x186d,0x1ca));var _0xd186=function(_0x17f145,_0x3422bb){_0x17f145=_0x17f145-0x0;var _0x2d5420=_0x186d[_0x17f145];return _0x2d5420;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd186('0x0'));var zipdir=require(_0xd186('0x1'));var jsonpatch=require(_0xd186('0x2'));var rp=require(_0xd186('0x3'));var moment=require(_0xd186('0x4'));var BPromise=require(_0xd186('0x5'));var Mustache=require('mustache');var util=require(_0xd186('0x6'));var path=require(_0xd186('0x7'));var sox=require(_0xd186('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd186('0x9'));var _=require(_0xd186('0xa'));var squel=require(_0xd186('0xb'));var crypto=require('crypto');var jsforce=require(_0xd186('0xc'));var deskjs=require(_0xd186('0xd'));var toCsv=require(_0xd186('0xe'));var querystring=require('querystring');var Papa=require(_0xd186('0xf'));var Redis=require(_0xd186('0x10'));var authService=require(_0xd186('0x11'));var qs=require(_0xd186('0x12'));var as=require(_0xd186('0x13'));var hardwareService=require(_0xd186('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd186('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd186('0x16'));var db=require(_0xd186('0x17'))['db'];function respondWithStatusCode(_0x2cefe9,_0x5cfef6){_0x5cfef6=_0x5cfef6||0xcc;return function(_0x131881){if(_0x131881){return _0x2cefe9['sendStatus'](_0x5cfef6);}return _0x2cefe9[_0xd186('0x18')](_0x5cfef6)[_0xd186('0x19')]();};}function respondWithResult(_0x17368e,_0x4618ab){_0x4618ab=_0x4618ab||0xc8;return function(_0x32c917){if(_0x32c917){return _0x17368e[_0xd186('0x18')](_0x4618ab)[_0xd186('0x1a')](_0x32c917);}};}function respondWithFilteredResult(_0x152ede,_0xc23af7){return function(_0xfb67a0){if(_0xfb67a0){var _0x207d6a=typeof _0xc23af7['offset']===_0xd186('0x1b')&&typeof _0xc23af7[_0xd186('0x1c')]===_0xd186('0x1b');var _0x1ff34e=_0xfb67a0[_0xd186('0x1d')];var _0x45fc9f=_0x207d6a?0x0:_0xc23af7[_0xd186('0x1e')];var _0x5d1a1c=_0x207d6a?_0xfb67a0[_0xd186('0x1d')]:_0xc23af7[_0xd186('0x1e')]+_0xc23af7['limit'];var _0xcded5d;if(_0x5d1a1c>=_0x1ff34e){_0x5d1a1c=_0x1ff34e;_0xcded5d=0xc8;}else{_0xcded5d=0xce;}_0x152ede[_0xd186('0x18')](_0xcded5d);return _0x152ede['set']('Content-Range',_0x45fc9f+'-'+_0x5d1a1c+'/'+_0x1ff34e)[_0xd186('0x1a')](_0xfb67a0);}return null;};}function patchUpdates(_0x374e72){return function(_0x46e238){try{jsonpatch[_0xd186('0x1f')](_0x46e238,_0x374e72,!![]);}catch(_0x363693){return BPromise['reject'](_0x363693);}return _0x46e238[_0xd186('0x20')]();};}function saveUpdates(_0x745706,_0x1cc315){return function(_0x4a9db0){if(_0x4a9db0){return _0x4a9db0['update'](_0x745706)[_0xd186('0x21')](function(_0x1b5aae){return _0x1b5aae;});}return null;};}function removeEntity(_0x223bc7,_0x5a5ff0){return function(_0x5c4dc5){if(_0x5c4dc5){return _0x5c4dc5[_0xd186('0x22')]()[_0xd186('0x21')](function(){_0x223bc7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x116618,_0x379db6){return function(_0x3c0a37){if(!_0x3c0a37){_0x116618[_0xd186('0x23')](0x194);}return _0x3c0a37;};}function handleError(_0x2111e2,_0x4a0280){_0x4a0280=_0x4a0280||0x1f4;return function(_0x341818){logger['error'](_0x341818['stack']);if(_0x341818[_0xd186('0x24')]){delete _0x341818[_0xd186('0x24')];}_0x2111e2[_0xd186('0x18')](_0x4a0280)[_0xd186('0x25')](_0x341818);};}exports[_0xd186('0x26')]=function(_0x5962c9,_0x2ac1e2){var _0x8563a2={},_0x27b95a={},_0x3a5284={'count':0x0,'rows':[]};var _0x39c051=_[_0xd186('0x27')](db[_0xd186('0x28')][_0xd186('0x29')],function(_0x43be30){return{'name':_0x43be30[_0xd186('0x2a')],'type':_0x43be30[_0xd186('0x2b')][_0xd186('0x2c')]};});_0x27b95a[_0xd186('0x2d')]=_[_0xd186('0x27')](_0x39c051,_0xd186('0x24'));_0x27b95a[_0xd186('0x2e')]=_[_0xd186('0x2f')](_0x5962c9[_0xd186('0x2e')]);_0x27b95a[_0xd186('0x30')]=_[_0xd186('0x31')](_0x27b95a[_0xd186('0x2d')],_0x27b95a[_0xd186('0x2e')]);_0x8563a2[_0xd186('0x32')]=_[_0xd186('0x31')](_0x27b95a[_0xd186('0x2d')],qs[_0xd186('0x33')](_0x5962c9[_0xd186('0x2e')][_0xd186('0x33')]));_0x8563a2[_0xd186('0x32')]=_0x8563a2[_0xd186('0x32')][_0xd186('0x34')]?_0x8563a2[_0xd186('0x32')]:_0x27b95a['model'];if(!_0x5962c9[_0xd186('0x2e')][_0xd186('0x35')](_0xd186('0x36'))){_0x8563a2[_0xd186('0x1c')]=qs[_0xd186('0x1c')](_0x5962c9[_0xd186('0x2e')][_0xd186('0x1c')]);_0x8563a2[_0xd186('0x1e')]=qs['offset'](_0x5962c9[_0xd186('0x2e')][_0xd186('0x1e')]);}_0x8563a2[_0xd186('0x37')]=qs[_0xd186('0x38')](_0x5962c9[_0xd186('0x2e')][_0xd186('0x38')]);_0x8563a2[_0xd186('0x39')]=qs[_0xd186('0x30')](_[_0xd186('0x3a')](_0x5962c9[_0xd186('0x2e')],_0x27b95a[_0xd186('0x30')]),_0x39c051);if(_0x5962c9[_0xd186('0x2e')]['filter']){_0x8563a2[_0xd186('0x39')]=_[_0xd186('0x3b')](_0x8563a2['where'],{'$or':_[_0xd186('0x27')](_0x39c051,function(_0x3b6874){if(_0x3b6874[_0xd186('0x2b')]!==_0xd186('0x3c')){var _0x53bcad={};_0x53bcad[_0x3b6874[_0xd186('0x24')]]={'$like':'%'+_0x5962c9['query'][_0xd186('0x3d')]+'%'};return _0x53bcad;}})});}_0x8563a2=_[_0xd186('0x3b')]({},_0x8563a2,_0x5962c9[_0xd186('0x3e')]);var _0x58df98={'where':_0x8563a2['where']};return db[_0xd186('0x28')][_0xd186('0x1d')](_0x58df98)['then'](function(_0x4aa4dc){_0x3a5284[_0xd186('0x1d')]=_0x4aa4dc;if(_0x5962c9[_0xd186('0x2e')]['includeAll']){_0x8563a2[_0xd186('0x3f')]=[{'all':!![]}];}return db[_0xd186('0x28')][_0xd186('0x40')](_0x8563a2);})[_0xd186('0x21')](function(_0x4a0be7){_0x3a5284[_0xd186('0x41')]=_0x4a0be7;return _0x3a5284;})['then'](respondWithFilteredResult(_0x2ac1e2,_0x8563a2))[_0xd186('0x42')](handleError(_0x2ac1e2,null));};exports['show']=function(_0x2cf1e8,_0x279da7){var _0x312944={'raw':!![],'where':{'id':_0x2cf1e8[_0xd186('0x43')]['id']}},_0x536b05={};_0x536b05[_0xd186('0x2d')]=_['keys'](db[_0xd186('0x28')][_0xd186('0x29')]);_0x536b05['query']=_['keys'](_0x2cf1e8[_0xd186('0x2e')]);_0x536b05['filters']=_[_0xd186('0x31')](_0x536b05['model'],_0x536b05['query']);_0x312944[_0xd186('0x32')]=_[_0xd186('0x31')](_0x536b05['model'],qs[_0xd186('0x33')](_0x2cf1e8[_0xd186('0x2e')]['fields']));_0x312944['attributes']=_0x312944[_0xd186('0x32')][_0xd186('0x34')]?_0x312944[_0xd186('0x32')]:_0x536b05[_0xd186('0x2d')];if(_0x2cf1e8[_0xd186('0x2e')][_0xd186('0x44')]){_0x312944[_0xd186('0x3f')]=[{'all':!![]}];}_0x312944=_['merge']({},_0x312944,_0x2cf1e8[_0xd186('0x3e')]);return db['SquareMessage'][_0xd186('0x45')](_0x312944)[_0xd186('0x21')](handleEntityNotFound(_0x279da7,null))[_0xd186('0x21')](respondWithResult(_0x279da7,null))[_0xd186('0x42')](handleError(_0x279da7,null));};exports[_0xd186('0x46')]=function(_0x117d58,_0x4a7f34){return db[_0xd186('0x28')][_0xd186('0x46')](_0x117d58[_0xd186('0x47')],{})[_0xd186('0x21')](respondWithResult(_0x4a7f34,0xc9))[_0xd186('0x42')](handleError(_0x4a7f34,null));};exports['update']=function(_0x5414c8,_0x18a213){if(_0x5414c8[_0xd186('0x47')]['id']){delete _0x5414c8['body']['id'];}return db[_0xd186('0x28')][_0xd186('0x45')]({'where':{'id':_0x5414c8['params']['id']}})[_0xd186('0x21')](handleEntityNotFound(_0x18a213,null))['then'](saveUpdates(_0x5414c8[_0xd186('0x47')],null))['then'](respondWithResult(_0x18a213,null))[_0xd186('0x42')](handleError(_0x18a213,null));};exports[_0xd186('0x22')]=function(_0x89c05,_0x321f0a){return db['SquareMessage'][_0xd186('0x45')]({'where':{'id':_0x89c05[_0xd186('0x43')]['id']}})[_0xd186('0x21')](handleEntityNotFound(_0x321f0a,null))['then'](removeEntity(_0x321f0a,null))['catch'](handleError(_0x321f0a,null));}; \ No newline at end of file +var _0x8374=['options','includeAll','findAll','rows','show','params','keys','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','sort','where','pick','filter','merge'];(function(_0x3efbd6,_0x3723ee){var _0x4f06e4=function(_0x325eff){while(--_0x325eff){_0x3efbd6['push'](_0x3efbd6['shift']());}};_0x4f06e4(++_0x3723ee);}(_0x8374,0x174));var _0x4837=function(_0xd208aa,_0x3c2ce3){_0xd208aa=_0xd208aa-0x0;var _0x3de95f=_0x8374[_0xd208aa];return _0x3de95f;};'use strict';var emlformat=require(_0x4837('0x0'));var rimraf=require(_0x4837('0x1'));var zipdir=require(_0x4837('0x2'));var jsonpatch=require(_0x4837('0x3'));var rp=require(_0x4837('0x4'));var moment=require(_0x4837('0x5'));var BPromise=require(_0x4837('0x6'));var Mustache=require(_0x4837('0x7'));var util=require(_0x4837('0x8'));var path=require(_0x4837('0x9'));var sox=require(_0x4837('0xa'));var csv=require(_0x4837('0xb'));var ejs=require(_0x4837('0xc'));var fs=require('fs');var fs_extra=require(_0x4837('0xd'));var _=require('lodash');var squel=require(_0x4837('0xe'));var crypto=require('crypto');var jsforce=require(_0x4837('0xf'));var deskjs=require(_0x4837('0x10'));var toCsv=require(_0x4837('0xb'));var querystring=require(_0x4837('0x11'));var Papa=require(_0x4837('0x12'));var Redis=require(_0x4837('0x13'));var authService=require(_0x4837('0x14'));var qs=require(_0x4837('0x15'));var as=require(_0x4837('0x16'));var hardwareService=require(_0x4837('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x4837('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4837('0x19'));var db=require(_0x4837('0x1a'))['db'];function respondWithStatusCode(_0x5338cf,_0x55c6da){_0x55c6da=_0x55c6da||0xcc;return function(_0x4fdb97){if(_0x4fdb97){return _0x5338cf[_0x4837('0x1b')](_0x55c6da);}return _0x5338cf[_0x4837('0x1c')](_0x55c6da)[_0x4837('0x1d')]();};}function respondWithResult(_0x1a31d8,_0x4b18c5){_0x4b18c5=_0x4b18c5||0xc8;return function(_0x3609d5){if(_0x3609d5){return _0x1a31d8[_0x4837('0x1c')](_0x4b18c5)[_0x4837('0x1e')](_0x3609d5);}};}function respondWithFilteredResult(_0x52a82c,_0x1685ee){return function(_0xae4f01){if(_0xae4f01){var _0x5d49b6=typeof _0x1685ee[_0x4837('0x1f')]===_0x4837('0x20')&&typeof _0x1685ee[_0x4837('0x21')]===_0x4837('0x20');var _0x27460b=_0xae4f01[_0x4837('0x22')];var _0x48b61b=_0x5d49b6?0x0:_0x1685ee[_0x4837('0x1f')];var _0x1cb24a=_0x5d49b6?_0xae4f01[_0x4837('0x22')]:_0x1685ee[_0x4837('0x1f')]+_0x1685ee[_0x4837('0x21')];var _0x2c1ddf;if(_0x1cb24a>=_0x27460b){_0x1cb24a=_0x27460b;_0x2c1ddf=0xc8;}else{_0x2c1ddf=0xce;}_0x52a82c[_0x4837('0x1c')](_0x2c1ddf);return _0x52a82c['set']('Content-Range',_0x48b61b+'-'+_0x1cb24a+'/'+_0x27460b)[_0x4837('0x1e')](_0xae4f01);}return null;};}function patchUpdates(_0x133e9d){return function(_0x36603e){try{jsonpatch[_0x4837('0x23')](_0x36603e,_0x133e9d,!![]);}catch(_0x5e8f16){return BPromise[_0x4837('0x24')](_0x5e8f16);}return _0x36603e['save']();};}function saveUpdates(_0x208943,_0x5f5631){return function(_0x55d6fa){if(_0x55d6fa){return _0x55d6fa[_0x4837('0x25')](_0x208943)['then'](function(_0x4988f5){return _0x4988f5;});}return null;};}function removeEntity(_0x57d48a,_0x40bebd){return function(_0x2d820a){if(_0x2d820a){return _0x2d820a['destroy']()[_0x4837('0x26')](function(){_0x57d48a[_0x4837('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa5ad,_0x127ab9){return function(_0x4d4278){if(!_0x4d4278){_0x3fa5ad[_0x4837('0x1b')](0x194);}return _0x4d4278;};}function handleError(_0x1e7f7e,_0x1a8871){_0x1a8871=_0x1a8871||0x1f4;return function(_0x22ca2b){logger[_0x4837('0x27')](_0x22ca2b['stack']);if(_0x22ca2b[_0x4837('0x28')]){delete _0x22ca2b[_0x4837('0x28')];}_0x1e7f7e[_0x4837('0x1c')](_0x1a8871)[_0x4837('0x29')](_0x22ca2b);};}exports[_0x4837('0x2a')]=function(_0x17266c,_0x215858){var _0x107a5f={},_0x55f82b={},_0x18f95c={'count':0x0,'rows':[]};var _0x35c602=_[_0x4837('0x2b')](db[_0x4837('0x2c')][_0x4837('0x2d')],function(_0x18c7a7){return{'name':_0x18c7a7[_0x4837('0x2e')],'type':_0x18c7a7[_0x4837('0x2f')][_0x4837('0x30')]};});_0x55f82b['model']=_[_0x4837('0x2b')](_0x35c602,'name');_0x55f82b[_0x4837('0x31')]=_['keys'](_0x17266c[_0x4837('0x31')]);_0x55f82b[_0x4837('0x32')]=_[_0x4837('0x33')](_0x55f82b['model'],_0x55f82b['query']);_0x107a5f[_0x4837('0x34')]=_[_0x4837('0x33')](_0x55f82b[_0x4837('0x35')],qs[_0x4837('0x36')](_0x17266c[_0x4837('0x31')]['fields']));_0x107a5f[_0x4837('0x34')]=_0x107a5f[_0x4837('0x34')]['length']?_0x107a5f[_0x4837('0x34')]:_0x55f82b['model'];if(!_0x17266c[_0x4837('0x31')]['hasOwnProperty']('nolimit')){_0x107a5f[_0x4837('0x21')]=qs[_0x4837('0x21')](_0x17266c[_0x4837('0x31')]['limit']);_0x107a5f[_0x4837('0x1f')]=qs[_0x4837('0x1f')](_0x17266c['query'][_0x4837('0x1f')]);}_0x107a5f['order']=qs[_0x4837('0x37')](_0x17266c[_0x4837('0x31')][_0x4837('0x37')]);_0x107a5f[_0x4837('0x38')]=qs['filters'](_[_0x4837('0x39')](_0x17266c[_0x4837('0x31')],_0x55f82b[_0x4837('0x32')]),_0x35c602);if(_0x17266c[_0x4837('0x31')][_0x4837('0x3a')]){_0x107a5f[_0x4837('0x38')]=_['merge'](_0x107a5f[_0x4837('0x38')],{'$or':_['map'](_0x35c602,function(_0x465737){if(_0x465737[_0x4837('0x2f')]!=='VIRTUAL'){var _0x5eb13b={};_0x5eb13b[_0x465737[_0x4837('0x28')]]={'$like':'%'+_0x17266c[_0x4837('0x31')][_0x4837('0x3a')]+'%'};return _0x5eb13b;}})});}_0x107a5f=_[_0x4837('0x3b')]({},_0x107a5f,_0x17266c[_0x4837('0x3c')]);var _0x2d70c3={'where':_0x107a5f[_0x4837('0x38')]};return db[_0x4837('0x2c')][_0x4837('0x22')](_0x2d70c3)[_0x4837('0x26')](function(_0x43d57a){_0x18f95c[_0x4837('0x22')]=_0x43d57a;if(_0x17266c[_0x4837('0x31')][_0x4837('0x3d')]){_0x107a5f['include']=[{'all':!![]}];}return db['SquareMessage'][_0x4837('0x3e')](_0x107a5f);})[_0x4837('0x26')](function(_0x4d2b7e){_0x18f95c[_0x4837('0x3f')]=_0x4d2b7e;return _0x18f95c;})['then'](respondWithFilteredResult(_0x215858,_0x107a5f))['catch'](handleError(_0x215858,null));};exports[_0x4837('0x40')]=function(_0x5870f6,_0x5409e4){var _0x11a818={'raw':!![],'where':{'id':_0x5870f6[_0x4837('0x41')]['id']}},_0x230f85={};_0x230f85['model']=_[_0x4837('0x42')](db[_0x4837('0x2c')]['rawAttributes']);_0x230f85[_0x4837('0x31')]=_[_0x4837('0x42')](_0x5870f6[_0x4837('0x31')]);_0x230f85[_0x4837('0x32')]=_[_0x4837('0x33')](_0x230f85[_0x4837('0x35')],_0x230f85[_0x4837('0x31')]);_0x11a818[_0x4837('0x34')]=_[_0x4837('0x33')](_0x230f85[_0x4837('0x35')],qs[_0x4837('0x36')](_0x5870f6[_0x4837('0x31')][_0x4837('0x36')]));_0x11a818[_0x4837('0x34')]=_0x11a818[_0x4837('0x34')]['length']?_0x11a818[_0x4837('0x34')]:_0x230f85[_0x4837('0x35')];if(_0x5870f6[_0x4837('0x31')][_0x4837('0x3d')]){_0x11a818['include']=[{'all':!![]}];}_0x11a818=_[_0x4837('0x3b')]({},_0x11a818,_0x5870f6[_0x4837('0x3c')]);return db['SquareMessage']['find'](_0x11a818)[_0x4837('0x26')](handleEntityNotFound(_0x5409e4,null))[_0x4837('0x26')](respondWithResult(_0x5409e4,null))[_0x4837('0x43')](handleError(_0x5409e4,null));};exports['create']=function(_0x37df13,_0x130441){return db[_0x4837('0x2c')][_0x4837('0x44')](_0x37df13[_0x4837('0x45')],{})[_0x4837('0x26')](respondWithResult(_0x130441,0xc9))[_0x4837('0x43')](handleError(_0x130441,null));};exports[_0x4837('0x25')]=function(_0x38d55e,_0x5aa7cf){if(_0x38d55e['body']['id']){delete _0x38d55e[_0x4837('0x45')]['id'];}return db['SquareMessage'][_0x4837('0x46')]({'where':{'id':_0x38d55e[_0x4837('0x41')]['id']}})[_0x4837('0x26')](handleEntityNotFound(_0x5aa7cf,null))[_0x4837('0x26')](saveUpdates(_0x38d55e[_0x4837('0x45')],null))[_0x4837('0x26')](respondWithResult(_0x5aa7cf,null))['catch'](handleError(_0x5aa7cf,null));};exports[_0x4837('0x47')]=function(_0x1be48b,_0x14f353){return db[_0x4837('0x2c')]['find']({'where':{'id':_0x1be48b[_0x4837('0x41')]['id']}})[_0x4837('0x26')](handleEntityNotFound(_0x14f353,null))[_0x4837('0x26')](removeEntity(_0x14f353,null))[_0x4837('0x43')](handleError(_0x14f353,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index c2352f9..fd8b99f 100644 --- a/server/api/squareMessage/squareMessage.model.js +++ b/server/api/squareMessage/squareMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc057=['square_messages','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x2773d5,_0x3c8202){var _0x21bbc7=function(_0x2b0fc){while(--_0x2b0fc){_0x2773d5['push'](_0x2773d5['shift']());}};_0x21bbc7(++_0x3c8202);}(_0xc057,0x9b));var _0x7c05=function(_0x5ec49a,_0x10c596){_0x5ec49a=_0x5ec49a-0x0;var _0x2d4fcf=_0xc057[_0x5ec49a];return _0x2d4fcf;};'use strict';var _=require('lodash');var util=require(_0x7c05('0x0'));var logger=require(_0x7c05('0x1'))(_0x7c05('0x2'));var moment=require(_0x7c05('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c05('0x4'));var rimraf=require(_0x7c05('0x5'));var config=require(_0x7c05('0x6'));var attributes=require(_0x7c05('0x7'));module[_0x7c05('0x8')]=function(_0x3ae52a,_0x5f22ba){return _0x3ae52a[_0x7c05('0x9')]('SquareMessage',attributes,{'tableName':_0x7c05('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbe0=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash'];(function(_0x2a99a8,_0x32619e){var _0x5f03ad=function(_0xf5ae36){while(--_0xf5ae36){_0x2a99a8['push'](_0x2a99a8['shift']());}};_0x5f03ad(++_0x32619e);}(_0xdbe0,0xa7));var _0x0dbe=function(_0x4d08a1,_0x11aed1){_0x4d08a1=_0x4d08a1-0x0;var _0x167faa=_0xdbe0[_0x4d08a1];return _0x167faa;};'use strict';var _=require(_0x0dbe('0x0'));var util=require(_0x0dbe('0x1'));var logger=require(_0x0dbe('0x2'))(_0x0dbe('0x3'));var moment=require(_0x0dbe('0x4'));var BPromise=require(_0x0dbe('0x5'));var rp=require(_0x0dbe('0x6'));var fs=require('fs');var path=require(_0x0dbe('0x7'));var rimraf=require(_0x0dbe('0x8'));var config=require(_0x0dbe('0x9'));var attributes=require(_0x0dbe('0xa'));module['exports']=function(_0x47d6d5,_0x25f615){return _0x47d6d5[_0x0dbe('0xb')](_0x0dbe('0xc'),attributes,{'tableName':_0x0dbe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 72d3333..39f3532 100644 --- a/server/api/squareMessage/squareMessage.rpc.js +++ b/server/api/squareMessage/squareMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99a2=['raw','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','SquareMessage,\x20%s,\x20%s','result','catch','CreateSquareMessage','create','body','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x99a2,0x107));var _0x299a=function(_0x210d24,_0x35982f){_0x210d24=_0x210d24-0x0;var _0xcfec6b=_0x99a2[_0x210d24];return _0xcfec6b;};'use strict';var _=require(_0x299a('0x0'));var util=require(_0x299a('0x1'));var moment=require(_0x299a('0x2'));var BPromise=require(_0x299a('0x3'));var rs=require(_0x299a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x299a('0x5'))['db'];var utils=require(_0x299a('0x6'));var logger=require(_0x299a('0x7'))(_0x299a('0x8'));var config=require(_0x299a('0x9'));var jayson=require(_0x299a('0xa'));var client=jayson[_0x299a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11b8fb,_0x47ebb0,_0x158bc5){return new BPromise(function(_0x1d465b,_0x1ca3d9){return client['request'](_0x11b8fb,_0x158bc5)[_0x299a('0xc')](function(_0x3d6f2f){logger[_0x299a('0xd')]('SquareMessage,\x20%s,\x20%s',_0x47ebb0,_0x299a('0xe'));logger['debug'](_0x299a('0xf'),_0x47ebb0,_0x299a('0xe'),JSON[_0x299a('0x10')](_0x3d6f2f));if(_0x3d6f2f['error']){if(_0x3d6f2f['error'][_0x299a('0x11')]===0x1f4){logger[_0x299a('0x12')]('SquareMessage,\x20%s,\x20%s',_0x47ebb0,_0x3d6f2f[_0x299a('0x12')][_0x299a('0x13')]);return _0x1ca3d9(_0x3d6f2f[_0x299a('0x12')][_0x299a('0x13')]);}logger[_0x299a('0x12')]('SquareMessage,\x20%s,\x20%s',_0x47ebb0,_0x3d6f2f[_0x299a('0x12')]['message']);return _0x1d465b(_0x3d6f2f[_0x299a('0x12')][_0x299a('0x13')]);}else{logger['info'](_0x299a('0x14'),_0x47ebb0,_0x299a('0xe'));_0x1d465b(_0x3d6f2f[_0x299a('0x15')][_0x299a('0x13')]);}})[_0x299a('0x16')](function(_0x39d69){logger[_0x299a('0x12')](_0x299a('0x14'),_0x47ebb0,_0x39d69);_0x1ca3d9(_0x39d69);});});}exports[_0x299a('0x17')]=function(_0x1f164b){var _0x51aaca=this;return new Promise(function(_0xa3920c,_0xedcdf0){return db['SquareMessage'][_0x299a('0x18')](_0x1f164b[_0x299a('0x19')],{'raw':_0x1f164b[_0x299a('0x1a')]?_0x1f164b[_0x299a('0x1a')][_0x299a('0x1b')]===undefined?!![]:![]:!![]})[_0x299a('0xc')](function(_0x1f7b08){logger[_0x299a('0xd')](_0x299a('0x17'),_0x1f164b);logger[_0x299a('0x1c')](_0x299a('0x17'),_0x1f164b,JSON[_0x299a('0x10')](_0x1f7b08));_0xa3920c(_0x1f7b08);})[_0x299a('0x16')](function(_0x520661){logger[_0x299a('0x12')](_0x299a('0x17'),_0x520661[_0x299a('0x13')],_0x1f164b);_0xedcdf0(_0x51aaca[_0x299a('0x12')](0x1f4,_0x520661[_0x299a('0x13')]));});});}; \ No newline at end of file +var _0x6ccd=['raw','CreateSquareMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SquareMessage','body','options'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x6ccd,0x147));var _0xd6cc=function(_0x1aca28,_0x48cc28){_0x1aca28=_0x1aca28-0x0;var _0x58f781=_0x6ccd[_0x1aca28];return _0x58f781;};'use strict';var _=require('lodash');var util=require(_0xd6cc('0x0'));var moment=require(_0xd6cc('0x1'));var BPromise=require(_0xd6cc('0x2'));var rs=require(_0xd6cc('0x3'));var fs=require('fs');var Redis=require(_0xd6cc('0x4'));var db=require(_0xd6cc('0x5'))['db'];var utils=require(_0xd6cc('0x6'));var logger=require('../../config/logger')(_0xd6cc('0x7'));var config=require(_0xd6cc('0x8'));var jayson=require(_0xd6cc('0x9'));var client=jayson['client'][_0xd6cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f1f60,_0x2b569d,_0x5cb7d9){return new BPromise(function(_0x5977ce,_0x5a28b0){return client['request'](_0x1f1f60,_0x5cb7d9)[_0xd6cc('0xb')](function(_0x55b015){logger[_0xd6cc('0xc')](_0xd6cc('0xd'),_0x2b569d,'request\x20sent');logger[_0xd6cc('0xe')](_0xd6cc('0xf'),_0x2b569d,_0xd6cc('0x10'),JSON[_0xd6cc('0x11')](_0x55b015));if(_0x55b015[_0xd6cc('0x12')]){if(_0x55b015['error']['code']===0x1f4){logger[_0xd6cc('0x12')]('SquareMessage,\x20%s,\x20%s',_0x2b569d,_0x55b015[_0xd6cc('0x12')][_0xd6cc('0x13')]);return _0x5a28b0(_0x55b015[_0xd6cc('0x12')][_0xd6cc('0x13')]);}logger[_0xd6cc('0x12')](_0xd6cc('0xd'),_0x2b569d,_0x55b015[_0xd6cc('0x12')]['message']);return _0x5977ce(_0x55b015['error'][_0xd6cc('0x13')]);}else{logger['info'](_0xd6cc('0xd'),_0x2b569d,_0xd6cc('0x10'));_0x5977ce(_0x55b015['result'][_0xd6cc('0x13')]);}})['catch'](function(_0x5744d8){logger[_0xd6cc('0x12')]('SquareMessage,\x20%s,\x20%s',_0x2b569d,_0x5744d8);_0x5a28b0(_0x5744d8);});});}exports['CreateSquareMessage']=function(_0xc2ea38){var _0x58fdd0=this;return new Promise(function(_0x5b43ba,_0x5a3222){return db[_0xd6cc('0x14')]['create'](_0xc2ea38[_0xd6cc('0x15')],{'raw':_0xc2ea38[_0xd6cc('0x16')]?_0xc2ea38['options'][_0xd6cc('0x17')]===undefined?!![]:![]:!![]})[_0xd6cc('0xb')](function(_0x1f27d4){logger['info']('CreateSquareMessage',_0xc2ea38);logger['debug']('CreateSquareMessage',_0xc2ea38,JSON['stringify'](_0x1f27d4));_0x5b43ba(_0x1f27d4);})['catch'](function(_0x2144d7){logger[_0xd6cc('0x12')](_0xd6cc('0x18'),_0x2144d7['message'],_0xc2ea38);_0x5a3222(_0x58fdd0['error'](0x1f4,_0x2144d7[_0xd6cc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a4b1344..9f93992 100644 --- a/server/api/squareOdbc/index.js +++ b/server/api/squareOdbc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf21b=['post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','15s'];(function(_0x21a878,_0x2b8094){var _0xe9ad7d=function(_0x894db2){while(--_0x894db2){_0x21a878['push'](_0x21a878['shift']());}};_0xe9ad7d(++_0x2b8094);}(_0xf21b,0x124));var _0xbf21=function(_0x869ae8,_0x192d4e){_0x869ae8=_0x869ae8-0x0;var _0x56a5e7=_0xf21b[_0x869ae8];return _0x56a5e7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbf21('0x0'));var timeout=require(_0xbf21('0x1'));var express=require(_0xbf21('0x2'));var router=express[_0xbf21('0x3')]();var fs_extra=require(_0xbf21('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf21('0x5'));var controller=require(_0xbf21('0x6'));router[_0xbf21('0x7')]('/',auth[_0xbf21('0x8')](),controller[_0xbf21('0x9')]);router[_0xbf21('0x7')](_0xbf21('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xbf21('0x7')]('/:id/test',auth[_0xbf21('0x8')](),timeout(_0xbf21('0xb')),controller['test']);router[_0xbf21('0xc')]('/',auth['isAuthenticated'](),controller[_0xbf21('0xd')]);router[_0xbf21('0xe')](_0xbf21('0xa'),auth[_0xbf21('0x8')](),controller[_0xbf21('0xf')]);router[_0xbf21('0x10')](_0xbf21('0xa'),auth[_0xbf21('0x8')](),controller[_0xbf21('0x11')]);module[_0xbf21('0x12')]=router; \ No newline at end of file +var _0xd380=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/test','15s','test','post','/:id','update','delete'];(function(_0x4d9fc,_0x865376){var _0x1b47ce=function(_0x2b6ffb){while(--_0x2b6ffb){_0x4d9fc['push'](_0x4d9fc['shift']());}};_0x1b47ce(++_0x865376);}(_0xd380,0x156));var _0x0d38=function(_0x39bf92,_0x134911){_0x39bf92=_0x39bf92-0x0;var _0x4043ff=_0xd380[_0x39bf92];return _0x4043ff;};'use strict';var multer=require('multer');var util=require(_0x0d38('0x0'));var path=require(_0x0d38('0x1'));var timeout=require(_0x0d38('0x2'));var express=require(_0x0d38('0x3'));var router=express['Router']();var fs_extra=require(_0x0d38('0x4'));var auth=require(_0x0d38('0x5'));var interaction=require(_0x0d38('0x6'));var config=require(_0x0d38('0x7'));var controller=require('./squareOdbc.controller');router[_0x0d38('0x8')]('/',auth[_0x0d38('0x9')](),controller['index']);router[_0x0d38('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0d38('0xa')]);router[_0x0d38('0x8')](_0x0d38('0xb'),auth[_0x0d38('0x9')](),timeout(_0x0d38('0xc')),controller[_0x0d38('0xd')]);router[_0x0d38('0xe')]('/',auth[_0x0d38('0x9')](),controller['create']);router['put'](_0x0d38('0xf'),auth[_0x0d38('0x9')](),controller[_0x0d38('0x10')]);router[_0x0d38('0x11')]('/:id',auth[_0x0d38('0x9')](),controller[_0x0d38('0x12')]);module[_0x0d38('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 9e91d61..eb5d34e 100644 --- a/server/api/squareOdbc/squareOdbc.attributes.js +++ b/server/api/squareOdbc/squareOdbc.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x675b=['STRING','name','sequelize','exports'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x675b,0x1c6));var _0xb675=function(_0x5db64a,_0x2d6433){_0x5db64a=_0x5db64a-0x0;var _0x3fa79f=_0x675b[_0x5db64a];return _0x3fa79f;};'use strict';var Sequelize=require(_0xb675('0x0'));module[_0xb675('0x1')]={'name':{'type':Sequelize[_0xb675('0x2')],'unique':_0xb675('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xb675('0x2')]},'description':{'type':Sequelize[_0xb675('0x2')]}}; \ No newline at end of file +var _0x3abe=['name','sequelize','STRING'];(function(_0x567d04,_0x3d13a1){var _0x58ee79=function(_0x4c5548){while(--_0x4c5548){_0x567d04['push'](_0x567d04['shift']());}};_0x58ee79(++_0x3d13a1);}(_0x3abe,0x1cc));var _0xe3ab=function(_0x5c52f7,_0x123409){_0x5c52f7=_0x5c52f7-0x0;var _0x167068=_0x3abe[_0x5c52f7];return _0x167068;};'use strict';var Sequelize=require(_0xe3ab('0x0'));module['exports']={'name':{'type':Sequelize[_0xe3ab('0x1')],'unique':_0xe3ab('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xe3ab('0x1')]},'description':{'type':Sequelize[_0xe3ab('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index dc2b302..e053cf7 100644 --- a/server/api/squareOdbc/squareOdbc.controller.js +++ b/server/api/squareOdbc/squareOdbc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf39=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','SquareOdbc','count','includeAll','include','findAll','catch','show','params','keys','find','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','set','apply','reject','update','then','get','ODBC','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x5b5095,_0x4518d0){var _0x54d290=function(_0x1cfe88){while(--_0x1cfe88){_0x5b5095['push'](_0x5b5095['shift']());}};_0x54d290(++_0x4518d0);}(_0xbf39,0x1cb));var _0x9bf3=function(_0x182cf8,_0x14448e){_0x182cf8=_0x182cf8-0x0;var _0x108c50=_0xbf39[_0x182cf8];return _0x108c50;};'use strict';var emlformat=require(_0x9bf3('0x0'));var rimraf=require(_0x9bf3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9bf3('0x2'));var rp=require(_0x9bf3('0x3'));var moment=require('moment');var BPromise=require(_0x9bf3('0x4'));var Mustache=require(_0x9bf3('0x5'));var util=require(_0x9bf3('0x6'));var path=require(_0x9bf3('0x7'));var sox=require(_0x9bf3('0x8'));var csv=require(_0x9bf3('0x9'));var ejs=require(_0x9bf3('0xa'));var fs=require('fs');var fs_extra=require(_0x9bf3('0xb'));var _=require(_0x9bf3('0xc'));var squel=require(_0x9bf3('0xd'));var crypto=require(_0x9bf3('0xe'));var jsforce=require(_0x9bf3('0xf'));var deskjs=require(_0x9bf3('0x10'));var toCsv=require(_0x9bf3('0x9'));var querystring=require('querystring');var Papa=require(_0x9bf3('0x11'));var Redis=require(_0x9bf3('0x12'));var authService=require(_0x9bf3('0x13'));var qs=require(_0x9bf3('0x14'));var as=require(_0x9bf3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9bf3('0x16'));var utils=require(_0x9bf3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9bf3('0x18'));var db=require(_0x9bf3('0x19'))['db'];function respondWithStatusCode(_0x4aaca2,_0x3e8a11){_0x3e8a11=_0x3e8a11||0xcc;return function(_0x509c21){if(_0x509c21){return _0x4aaca2[_0x9bf3('0x1a')](_0x3e8a11);}return _0x4aaca2[_0x9bf3('0x1b')](_0x3e8a11)[_0x9bf3('0x1c')]();};}function respondWithResult(_0xb0c91d,_0x3926e5){_0x3926e5=_0x3926e5||0xc8;return function(_0x2ec727){if(_0x2ec727){return _0xb0c91d[_0x9bf3('0x1b')](_0x3926e5)[_0x9bf3('0x1d')](_0x2ec727);}};}function respondWithFilteredResult(_0x49ccb5,_0x2b9f6f){return function(_0x2bbabe){if(_0x2bbabe){var _0x4d178a=typeof _0x2b9f6f['offset']==='undefined'&&typeof _0x2b9f6f[_0x9bf3('0x1e')]===_0x9bf3('0x1f');var _0x47fa4e=_0x2bbabe['count'];var _0x2b0a75=_0x4d178a?0x0:_0x2b9f6f[_0x9bf3('0x20')];var _0x2a9f11=_0x4d178a?_0x2bbabe['count']:_0x2b9f6f[_0x9bf3('0x20')]+_0x2b9f6f[_0x9bf3('0x1e')];var _0x10ab92;if(_0x2a9f11>=_0x47fa4e){_0x2a9f11=_0x47fa4e;_0x10ab92=0xc8;}else{_0x10ab92=0xce;}_0x49ccb5[_0x9bf3('0x1b')](_0x10ab92);return _0x49ccb5[_0x9bf3('0x21')]('Content-Range',_0x2b0a75+'-'+_0x2a9f11+'/'+_0x47fa4e)[_0x9bf3('0x1d')](_0x2bbabe);}return null;};}function patchUpdates(_0x3ac529){return function(_0x279421){try{jsonpatch[_0x9bf3('0x22')](_0x279421,_0x3ac529,!![]);}catch(_0x4ca640){return BPromise[_0x9bf3('0x23')](_0x4ca640);}return _0x279421['save']();};}function saveUpdates(_0x2f1e59,_0x5707bb){return function(_0x1d51e9){if(_0x1d51e9){return _0x1d51e9[_0x9bf3('0x24')](_0x2f1e59)[_0x9bf3('0x25')](function(_0x5100a4){return _0x5100a4;});}return null;};}function removeEntity(_0x42648b,_0x15117c){return function(_0x1c54f3){if(_0x1c54f3){return _0x1c54f3['destroy']()[_0x9bf3('0x25')](function(){var _0x26f22b=_0x1c54f3[_0x9bf3('0x26')]({'plain':!![]});var _0x7982f0=_0x9bf3('0x27');return db[_0x9bf3('0x28')][_0x9bf3('0x29')]({'where':{'type':_0x7982f0,'resourceId':_0x26f22b['id']}})[_0x9bf3('0x25')](function(){return _0x1c54f3;});})[_0x9bf3('0x25')](function(){_0x42648b[_0x9bf3('0x1b')](0xcc)[_0x9bf3('0x1c')]();});}};}function handleEntityNotFound(_0x382638,_0xa45303){return function(_0x2e753f){if(!_0x2e753f){_0x382638['sendStatus'](0x194);}return _0x2e753f;};}function handleError(_0x4dfbd1,_0xc6e04c){_0xc6e04c=_0xc6e04c||0x1f4;return function(_0x41d54c){logger[_0x9bf3('0x2a')](_0x41d54c['stack']);if(_0x41d54c[_0x9bf3('0x2b')]){delete _0x41d54c[_0x9bf3('0x2b')];}_0x4dfbd1['status'](_0xc6e04c)[_0x9bf3('0x2c')](_0x41d54c);};}exports[_0x9bf3('0x2d')]=function(_0x3b65d4,_0x321432){var _0x38db3f={},_0x57fb56={},_0x8b047f={'count':0x0,'rows':[]};var _0x58ad9d=_[_0x9bf3('0x2e')](db['SquareOdbc'][_0x9bf3('0x2f')],function(_0x235a34){return{'name':_0x235a34[_0x9bf3('0x30')],'type':_0x235a34['type'][_0x9bf3('0x31')]};});_0x57fb56[_0x9bf3('0x32')]=_[_0x9bf3('0x2e')](_0x58ad9d,'name');_0x57fb56[_0x9bf3('0x33')]=_['keys'](_0x3b65d4[_0x9bf3('0x33')]);_0x57fb56[_0x9bf3('0x34')]=_[_0x9bf3('0x35')](_0x57fb56['model'],_0x57fb56[_0x9bf3('0x33')]);_0x38db3f[_0x9bf3('0x36')]=_[_0x9bf3('0x35')](_0x57fb56[_0x9bf3('0x32')],qs[_0x9bf3('0x37')](_0x3b65d4[_0x9bf3('0x33')][_0x9bf3('0x37')]));_0x38db3f[_0x9bf3('0x36')]=_0x38db3f[_0x9bf3('0x36')][_0x9bf3('0x38')]?_0x38db3f['attributes']:_0x57fb56[_0x9bf3('0x32')];if(!_0x3b65d4[_0x9bf3('0x33')]['hasOwnProperty'](_0x9bf3('0x39'))){_0x38db3f['limit']=qs['limit'](_0x3b65d4[_0x9bf3('0x33')][_0x9bf3('0x1e')]);_0x38db3f[_0x9bf3('0x20')]=qs['offset'](_0x3b65d4[_0x9bf3('0x33')]['offset']);}_0x38db3f[_0x9bf3('0x3a')]=qs['sort'](_0x3b65d4[_0x9bf3('0x33')][_0x9bf3('0x3b')]);_0x38db3f['where']=qs[_0x9bf3('0x34')](_['pick'](_0x3b65d4[_0x9bf3('0x33')],_0x57fb56[_0x9bf3('0x34')]),_0x58ad9d);if(_0x3b65d4[_0x9bf3('0x33')][_0x9bf3('0x3c')]){_0x38db3f[_0x9bf3('0x3d')]=_[_0x9bf3('0x3e')](_0x38db3f[_0x9bf3('0x3d')],{'$or':_['map'](_0x58ad9d,function(_0x5a98cb){if(_0x5a98cb['type']!==_0x9bf3('0x3f')){var _0x1ffc72={};_0x1ffc72[_0x5a98cb[_0x9bf3('0x2b')]]={'$like':'%'+_0x3b65d4[_0x9bf3('0x33')]['filter']+'%'};return _0x1ffc72;}})});}_0x38db3f=_[_0x9bf3('0x3e')]({},_0x38db3f,_0x3b65d4[_0x9bf3('0x40')]);var _0x335f1a={'where':_0x38db3f[_0x9bf3('0x3d')]};return db[_0x9bf3('0x41')]['count'](_0x335f1a)[_0x9bf3('0x25')](function(_0x40a50f){_0x8b047f[_0x9bf3('0x42')]=_0x40a50f;if(_0x3b65d4[_0x9bf3('0x33')][_0x9bf3('0x43')]){_0x38db3f[_0x9bf3('0x44')]=[{'all':!![]}];}return db[_0x9bf3('0x41')][_0x9bf3('0x45')](_0x38db3f);})[_0x9bf3('0x25')](function(_0x5ed2df){_0x8b047f['rows']=_0x5ed2df;return _0x8b047f;})[_0x9bf3('0x25')](respondWithFilteredResult(_0x321432,_0x38db3f))[_0x9bf3('0x46')](handleError(_0x321432,null));};exports[_0x9bf3('0x47')]=function(_0x4f0cbf,_0x2a7547){var _0x290331={'raw':!![],'where':{'id':_0x4f0cbf[_0x9bf3('0x48')]['id']}},_0x216732={};_0x216732[_0x9bf3('0x32')]=_[_0x9bf3('0x49')](db[_0x9bf3('0x41')]['rawAttributes']);_0x216732[_0x9bf3('0x33')]=_[_0x9bf3('0x49')](_0x4f0cbf[_0x9bf3('0x33')]);_0x216732[_0x9bf3('0x34')]=_[_0x9bf3('0x35')](_0x216732[_0x9bf3('0x32')],_0x216732[_0x9bf3('0x33')]);_0x290331[_0x9bf3('0x36')]=_['intersection'](_0x216732[_0x9bf3('0x32')],qs[_0x9bf3('0x37')](_0x4f0cbf[_0x9bf3('0x33')][_0x9bf3('0x37')]));_0x290331[_0x9bf3('0x36')]=_0x290331[_0x9bf3('0x36')][_0x9bf3('0x38')]?_0x290331['attributes']:_0x216732[_0x9bf3('0x32')];if(_0x4f0cbf['query'][_0x9bf3('0x43')]){_0x290331[_0x9bf3('0x44')]=[{'all':!![]}];}_0x290331=_[_0x9bf3('0x3e')]({},_0x290331,_0x4f0cbf['options']);return db[_0x9bf3('0x41')][_0x9bf3('0x4a')](_0x290331)[_0x9bf3('0x25')](handleEntityNotFound(_0x2a7547,null))[_0x9bf3('0x25')](respondWithResult(_0x2a7547,null))[_0x9bf3('0x46')](handleError(_0x2a7547,null));};exports[_0x9bf3('0x4b')]=function(_0x3eecf5,_0x3759d0){return db[_0x9bf3('0x41')]['create'](_0x3eecf5['body'],{})[_0x9bf3('0x25')](function(_0x33894d){var _0x1b9fe9=_0x3eecf5[_0x9bf3('0x4c')][_0x9bf3('0x26')]({'plain':!![]});if(!_0x1b9fe9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b9fe9[_0x9bf3('0x4d')]===_0x9bf3('0x4c')){var _0x312082=_0x33894d['get']({'plain':!![]});var _0x488632=_0x9bf3('0x27');return db[_0x9bf3('0x4e')][_0x9bf3('0x4a')]({'where':{'name':_0x488632,'userProfileId':_0x1b9fe9['userProfileId']},'raw':!![]})[_0x9bf3('0x25')](function(_0x199672){if(_0x199672&&_0x199672[_0x9bf3('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x312082[_0x9bf3('0x2b')],'resourceId':_0x312082['id'],'type':_0x199672['name'],'sectionId':_0x199672['id']},{})[_0x9bf3('0x25')](function(){return _0x33894d;});}else{return _0x33894d;}})[_0x9bf3('0x46')](function(_0x2402f2){logger[_0x9bf3('0x2a')](_0x9bf3('0x50'),_0x2402f2);throw _0x2402f2;});}return _0x33894d;})['then'](respondWithResult(_0x3759d0,0xc9))[_0x9bf3('0x46')](handleError(_0x3759d0,null));};exports[_0x9bf3('0x24')]=function(_0x136c7e,_0x238828){if(_0x136c7e[_0x9bf3('0x51')]['id']){delete _0x136c7e[_0x9bf3('0x51')]['id'];}return db[_0x9bf3('0x41')][_0x9bf3('0x4a')]({'where':{'id':_0x136c7e[_0x9bf3('0x48')]['id']}})[_0x9bf3('0x25')](handleEntityNotFound(_0x238828,null))[_0x9bf3('0x25')](saveUpdates(_0x136c7e['body'],null))['then'](respondWithResult(_0x238828,null))[_0x9bf3('0x46')](handleError(_0x238828,null));};exports['destroy']=function(_0x2373b7,_0x331b54){return db['SquareOdbc']['find']({'where':{'id':_0x2373b7['params']['id']}})['then'](handleEntityNotFound(_0x331b54,null))[_0x9bf3('0x25')](removeEntity(_0x331b54,null))[_0x9bf3('0x46')](handleError(_0x331b54,null));};exports[_0x9bf3('0x52')]=function(_0x4a3d07,_0x141e2e,_0x420847){var _0x3eb5ed;return db['SquareOdbc'][_0x9bf3('0x4a')]({'where':{'id':_0x4a3d07[_0x9bf3('0x48')]['id']},'attributes':['id',_0x9bf3('0x53')]})['then'](handleEntityNotFound(_0x141e2e,null))[_0x9bf3('0x25')](function(_0xe72439){if(_0xe72439){var _0x506d76=require('odbc')();_0x506d76[_0x9bf3('0x54')](_0xe72439[_0x9bf3('0x53')]);_0x506d76[_0x9bf3('0x55')]();return _0xe72439;}})[_0x9bf3('0x25')](respondWithResult(_0x141e2e,null))[_0x9bf3('0x46')](handleError(_0x141e2e,null));}; \ No newline at end of file +var _0xa9d9=['catch','show','params','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','openSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','destroy','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9d9,0x122));var _0x9a9d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9d9[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x9a9d('0x0'));var rimraf=require(_0x9a9d('0x1'));var zipdir=require(_0x9a9d('0x2'));var jsonpatch=require(_0x9a9d('0x3'));var rp=require(_0x9a9d('0x4'));var moment=require(_0x9a9d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9a9d('0x6'));var path=require(_0x9a9d('0x7'));var sox=require(_0x9a9d('0x8'));var csv=require(_0x9a9d('0x9'));var ejs=require(_0x9a9d('0xa'));var fs=require('fs');var fs_extra=require(_0x9a9d('0xb'));var _=require(_0x9a9d('0xc'));var squel=require(_0x9a9d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a9d('0xe'));var toCsv=require(_0x9a9d('0x9'));var querystring=require('querystring');var Papa=require(_0x9a9d('0xf'));var Redis=require(_0x9a9d('0x10'));var authService=require(_0x9a9d('0x11'));var qs=require(_0x9a9d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a9d('0x13'));var logger=require('../../config/logger')(_0x9a9d('0x14'));var utils=require('../../config/utils');var config=require(_0x9a9d('0x15'));var licenseUtil=require(_0x9a9d('0x16'));var db=require(_0x9a9d('0x17'))['db'];function respondWithStatusCode(_0x26745d,_0x40cdc5){_0x40cdc5=_0x40cdc5||0xcc;return function(_0x418ee3){if(_0x418ee3){return _0x26745d[_0x9a9d('0x18')](_0x40cdc5);}return _0x26745d['status'](_0x40cdc5)[_0x9a9d('0x19')]();};}function respondWithResult(_0x187a6b,_0x5ad4c5){_0x5ad4c5=_0x5ad4c5||0xc8;return function(_0x451210){if(_0x451210){return _0x187a6b[_0x9a9d('0x1a')](_0x5ad4c5)[_0x9a9d('0x1b')](_0x451210);}};}function respondWithFilteredResult(_0x3bccda,_0x3c8da8){return function(_0x31213d){if(_0x31213d){var _0x173f23=typeof _0x3c8da8[_0x9a9d('0x1c')]===_0x9a9d('0x1d')&&typeof _0x3c8da8['limit']===_0x9a9d('0x1d');var _0x584cba=_0x31213d[_0x9a9d('0x1e')];var _0x5d6779=_0x173f23?0x0:_0x3c8da8[_0x9a9d('0x1c')];var _0x7dffbe=_0x173f23?_0x31213d[_0x9a9d('0x1e')]:_0x3c8da8[_0x9a9d('0x1c')]+_0x3c8da8[_0x9a9d('0x1f')];var _0x886e1c;if(_0x7dffbe>=_0x584cba){_0x7dffbe=_0x584cba;_0x886e1c=0xc8;}else{_0x886e1c=0xce;}_0x3bccda[_0x9a9d('0x1a')](_0x886e1c);return _0x3bccda[_0x9a9d('0x20')](_0x9a9d('0x21'),_0x5d6779+'-'+_0x7dffbe+'/'+_0x584cba)[_0x9a9d('0x1b')](_0x31213d);}return null;};}function patchUpdates(_0x25bcfc){return function(_0x84e52){try{jsonpatch[_0x9a9d('0x22')](_0x84e52,_0x25bcfc,!![]);}catch(_0x2c978d){return BPromise[_0x9a9d('0x23')](_0x2c978d);}return _0x84e52[_0x9a9d('0x24')]();};}function saveUpdates(_0x4adf12,_0x3ac763){return function(_0x4de336){if(_0x4de336){return _0x4de336[_0x9a9d('0x25')](_0x4adf12)[_0x9a9d('0x26')](function(_0x30cfec){return _0x30cfec;});}return null;};}function removeEntity(_0x47a9dc,_0x5ede64){return function(_0x3e76d6){if(_0x3e76d6){return _0x3e76d6['destroy']()[_0x9a9d('0x26')](function(){var _0x5e27bf=_0x3e76d6[_0x9a9d('0x27')]({'plain':!![]});var _0x5d7ca8=_0x9a9d('0x28');return db[_0x9a9d('0x29')][_0x9a9d('0x2a')]({'where':{'type':_0x5d7ca8,'resourceId':_0x5e27bf['id']}})[_0x9a9d('0x26')](function(){return _0x3e76d6;});})[_0x9a9d('0x26')](function(){_0x47a9dc[_0x9a9d('0x1a')](0xcc)[_0x9a9d('0x19')]();});}};}function handleEntityNotFound(_0x5a9605,_0xc91381){return function(_0x1c94fd){if(!_0x1c94fd){_0x5a9605[_0x9a9d('0x18')](0x194);}return _0x1c94fd;};}function handleError(_0x44cee0,_0x2663f3){_0x2663f3=_0x2663f3||0x1f4;return function(_0x433668){logger[_0x9a9d('0x2b')](_0x433668[_0x9a9d('0x2c')]);if(_0x433668[_0x9a9d('0x2d')]){delete _0x433668['name'];}_0x44cee0['status'](_0x2663f3)[_0x9a9d('0x2e')](_0x433668);};}exports[_0x9a9d('0x2f')]=function(_0x814d76,_0x121553){var _0x247056={},_0x4647bc={},_0x56e1b3={'count':0x0,'rows':[]};var _0x2f0c0c=_[_0x9a9d('0x30')](db[_0x9a9d('0x31')][_0x9a9d('0x32')],function(_0x1995de){return{'name':_0x1995de[_0x9a9d('0x33')],'type':_0x1995de[_0x9a9d('0x34')]['key']};});_0x4647bc[_0x9a9d('0x35')]=_[_0x9a9d('0x30')](_0x2f0c0c,_0x9a9d('0x2d'));_0x4647bc['query']=_[_0x9a9d('0x36')](_0x814d76[_0x9a9d('0x37')]);_0x4647bc['filters']=_[_0x9a9d('0x38')](_0x4647bc['model'],_0x4647bc[_0x9a9d('0x37')]);_0x247056[_0x9a9d('0x39')]=_[_0x9a9d('0x38')](_0x4647bc['model'],qs[_0x9a9d('0x3a')](_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x3a')]));_0x247056[_0x9a9d('0x39')]=_0x247056[_0x9a9d('0x39')][_0x9a9d('0x3b')]?_0x247056[_0x9a9d('0x39')]:_0x4647bc[_0x9a9d('0x35')];if(!_0x814d76['query'][_0x9a9d('0x3c')](_0x9a9d('0x3d'))){_0x247056['limit']=qs['limit'](_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x1f')]);_0x247056[_0x9a9d('0x1c')]=qs[_0x9a9d('0x1c')](_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x1c')]);}_0x247056[_0x9a9d('0x3e')]=qs[_0x9a9d('0x3f')](_0x814d76['query'][_0x9a9d('0x3f')]);_0x247056[_0x9a9d('0x40')]=qs['filters'](_[_0x9a9d('0x41')](_0x814d76['query'],_0x4647bc[_0x9a9d('0x42')]),_0x2f0c0c);if(_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x43')]){_0x247056[_0x9a9d('0x40')]=_[_0x9a9d('0x44')](_0x247056[_0x9a9d('0x40')],{'$or':_[_0x9a9d('0x30')](_0x2f0c0c,function(_0x3861ab){if(_0x3861ab[_0x9a9d('0x34')]!==_0x9a9d('0x45')){var _0x32615c={};_0x32615c[_0x3861ab[_0x9a9d('0x2d')]]={'$like':'%'+_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x43')]+'%'};return _0x32615c;}})});}_0x247056=_[_0x9a9d('0x44')]({},_0x247056,_0x814d76['options']);var _0x2479dd={'where':_0x247056[_0x9a9d('0x40')]};return db[_0x9a9d('0x31')][_0x9a9d('0x1e')](_0x2479dd)[_0x9a9d('0x26')](function(_0x49170b){_0x56e1b3[_0x9a9d('0x1e')]=_0x49170b;if(_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x46')]){_0x247056[_0x9a9d('0x47')]=[{'all':!![]}];}return db[_0x9a9d('0x31')][_0x9a9d('0x48')](_0x247056);})[_0x9a9d('0x26')](function(_0x46a1b1){_0x56e1b3[_0x9a9d('0x49')]=_0x46a1b1;return _0x56e1b3;})[_0x9a9d('0x26')](respondWithFilteredResult(_0x121553,_0x247056))[_0x9a9d('0x4a')](handleError(_0x121553,null));};exports[_0x9a9d('0x4b')]=function(_0x46f7b5,_0x3913b8){var _0x2f31fb={'raw':!![],'where':{'id':_0x46f7b5[_0x9a9d('0x4c')]['id']}},_0x9e9bc7={};_0x9e9bc7['model']=_[_0x9a9d('0x36')](db['SquareOdbc'][_0x9a9d('0x32')]);_0x9e9bc7['query']=_[_0x9a9d('0x36')](_0x46f7b5['query']);_0x9e9bc7[_0x9a9d('0x42')]=_[_0x9a9d('0x38')](_0x9e9bc7[_0x9a9d('0x35')],_0x9e9bc7[_0x9a9d('0x37')]);_0x2f31fb[_0x9a9d('0x39')]=_[_0x9a9d('0x38')](_0x9e9bc7[_0x9a9d('0x35')],qs[_0x9a9d('0x3a')](_0x46f7b5['query'][_0x9a9d('0x3a')]));_0x2f31fb[_0x9a9d('0x39')]=_0x2f31fb[_0x9a9d('0x39')]['length']?_0x2f31fb[_0x9a9d('0x39')]:_0x9e9bc7[_0x9a9d('0x35')];if(_0x46f7b5[_0x9a9d('0x37')][_0x9a9d('0x46')]){_0x2f31fb['include']=[{'all':!![]}];}_0x2f31fb=_[_0x9a9d('0x44')]({},_0x2f31fb,_0x46f7b5[_0x9a9d('0x4d')]);return db[_0x9a9d('0x31')][_0x9a9d('0x4e')](_0x2f31fb)[_0x9a9d('0x26')](handleEntityNotFound(_0x3913b8,null))[_0x9a9d('0x26')](respondWithResult(_0x3913b8,null))[_0x9a9d('0x4a')](handleError(_0x3913b8,null));};exports['create']=function(_0x198c42,_0x4baa02){return db['SquareOdbc'][_0x9a9d('0x4f')](_0x198c42['body'],{})[_0x9a9d('0x26')](function(_0x2a7304){var _0x417466=_0x198c42['user'][_0x9a9d('0x27')]({'plain':!![]});if(!_0x417466)throw new Error(_0x9a9d('0x50'));if(_0x417466[_0x9a9d('0x51')]===_0x9a9d('0x52')){var _0x4a9e15=_0x2a7304['get']({'plain':!![]});var _0x496478=_0x9a9d('0x28');return db[_0x9a9d('0x53')]['find']({'where':{'name':_0x496478,'userProfileId':_0x417466[_0x9a9d('0x54')]},'raw':!![]})[_0x9a9d('0x26')](function(_0x116e3e){if(_0x116e3e&&_0x116e3e[_0x9a9d('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a9e15[_0x9a9d('0x2d')],'resourceId':_0x4a9e15['id'],'type':_0x116e3e[_0x9a9d('0x2d')],'sectionId':_0x116e3e['id']},{})[_0x9a9d('0x26')](function(){return _0x2a7304;});}else{return _0x2a7304;}})[_0x9a9d('0x4a')](function(_0x1a4ed4){logger[_0x9a9d('0x2b')](_0x9a9d('0x56'),_0x1a4ed4);throw _0x1a4ed4;});}return _0x2a7304;})[_0x9a9d('0x26')](respondWithResult(_0x4baa02,0xc9))[_0x9a9d('0x4a')](handleError(_0x4baa02,null));};exports[_0x9a9d('0x25')]=function(_0x1765e9,_0x4aa4fe){if(_0x1765e9['body']['id']){delete _0x1765e9[_0x9a9d('0x57')]['id'];}return db[_0x9a9d('0x31')][_0x9a9d('0x4e')]({'where':{'id':_0x1765e9[_0x9a9d('0x4c')]['id']}})[_0x9a9d('0x26')](handleEntityNotFound(_0x4aa4fe,null))[_0x9a9d('0x26')](saveUpdates(_0x1765e9[_0x9a9d('0x57')],null))[_0x9a9d('0x26')](respondWithResult(_0x4aa4fe,null))[_0x9a9d('0x4a')](handleError(_0x4aa4fe,null));};exports[_0x9a9d('0x2a')]=function(_0x1d3a00,_0xa9249){return db[_0x9a9d('0x31')][_0x9a9d('0x4e')]({'where':{'id':_0x1d3a00[_0x9a9d('0x4c')]['id']}})[_0x9a9d('0x26')](handleEntityNotFound(_0xa9249,null))[_0x9a9d('0x26')](removeEntity(_0xa9249,null))[_0x9a9d('0x4a')](handleError(_0xa9249,null));};exports[_0x9a9d('0x58')]=function(_0x51bb5f,_0x3df679,_0x3caaac){var _0x4df4af;return db[_0x9a9d('0x31')][_0x9a9d('0x4e')]({'where':{'id':_0x51bb5f[_0x9a9d('0x4c')]['id']},'attributes':['id',_0x9a9d('0x59')]})[_0x9a9d('0x26')](handleEntityNotFound(_0x3df679,null))[_0x9a9d('0x26')](function(_0xfe8d3e){if(_0xfe8d3e){var _0x4b2faa=require('odbc')();_0x4b2faa[_0x9a9d('0x5a')](_0xfe8d3e[_0x9a9d('0x59')]);_0x4b2faa['closeSync']();return _0xfe8d3e;}})[_0x9a9d('0x26')](respondWithResult(_0x3df679,null))[_0x9a9d('0x4a')](handleError(_0x3df679,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 475cc95..09dda11 100644 --- a/server/api/squareOdbc/squareOdbc.model.js +++ b/server/api/squareOdbc/squareOdbc.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa796=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./squareOdbc.attributes','exports','SquareOdbc','square_odbc'];(function(_0xdc89c3,_0x225f70){var _0x4f5784=function(_0x3e4586){while(--_0x3e4586){_0xdc89c3['push'](_0xdc89c3['shift']());}};_0x4f5784(++_0x225f70);}(_0xa796,0x181));var _0x6a79=function(_0x4369ef,_0x33cde3){_0x4369ef=_0x4369ef-0x0;var _0xf9dac4=_0xa796[_0x4369ef];return _0xf9dac4;};'use strict';var _=require(_0x6a79('0x0'));var util=require(_0x6a79('0x1'));var logger=require(_0x6a79('0x2'))(_0x6a79('0x3'));var moment=require(_0x6a79('0x4'));var BPromise=require(_0x6a79('0x5'));var rp=require(_0x6a79('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6a79('0x7'));module[_0x6a79('0x8')]=function(_0x577e9c,_0x5ae93b){return _0x577e9c['define'](_0x6a79('0x9'),attributes,{'tableName':_0x6a79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd72b=['exports','SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x1fb6ff,_0x474709){var _0x339f61=function(_0x424713){while(--_0x424713){_0x1fb6ff['push'](_0x1fb6ff['shift']());}};_0x339f61(++_0x474709);}(_0xd72b,0x176));var _0xbd72=function(_0xfe437e,_0x54557e){_0xfe437e=_0xfe437e-0x0;var _0x70f17e=_0xd72b[_0xfe437e];return _0x70f17e;};'use strict';var _=require(_0xbd72('0x0'));var util=require(_0xbd72('0x1'));var logger=require(_0xbd72('0x2'))(_0xbd72('0x3'));var moment=require(_0xbd72('0x4'));var BPromise=require(_0xbd72('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd72('0x6'));var rimraf=require(_0xbd72('0x7'));var config=require(_0xbd72('0x8'));var attributes=require(_0xbd72('0x9'));module[_0xbd72('0xa')]=function(_0x510657,_0x124b84){return _0x510657['define'](_0xbd72('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 4604592..f8c4499 100644 --- a/server/api/squareOdbc/squareOdbc.rpc.js +++ b/server/api/squareOdbc/squareOdbc.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6c9=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','SquareOdbc,\x20%s,\x20%s','message','request\x20sent','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','info','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5175df,_0x12b843){var _0x1e1c5e=function(_0x431155){while(--_0x431155){_0x5175df['push'](_0x5175df['shift']());}};_0x1e1c5e(++_0x12b843);}(_0xe6c9,0x136));var _0x9e6c=function(_0x5700bf,_0x2cc96c){_0x5700bf=_0x5700bf-0x0;var _0x55a137=_0xe6c9[_0x5700bf];return _0x55a137;};'use strict';var _=require(_0x9e6c('0x0'));var util=require(_0x9e6c('0x1'));var moment=require(_0x9e6c('0x2'));var BPromise=require(_0x9e6c('0x3'));var rs=require(_0x9e6c('0x4'));var fs=require('fs');var Redis=require(_0x9e6c('0x5'));var db=require(_0x9e6c('0x6'))['db'];var utils=require(_0x9e6c('0x7'));var logger=require(_0x9e6c('0x8'))(_0x9e6c('0x9'));var config=require(_0x9e6c('0xa'));var jayson=require(_0x9e6c('0xb'));var client=jayson[_0x9e6c('0xc')][_0x9e6c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x56735a,_0x45e8f4,_0x9e67b9){return new BPromise(function(_0x14b58f,_0x3dc206){return client[_0x9e6c('0xe')](_0x56735a,_0x9e67b9)[_0x9e6c('0xf')](function(_0x397dfa){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x45e8f4,'request\x20sent');logger[_0x9e6c('0x10')](_0x9e6c('0x11'),_0x45e8f4,'request\x20sent',JSON['stringify'](_0x397dfa));if(_0x397dfa[_0x9e6c('0x12')]){if(_0x397dfa['error'][_0x9e6c('0x13')]===0x1f4){logger[_0x9e6c('0x12')](_0x9e6c('0x14'),_0x45e8f4,_0x397dfa['error']['message']);return _0x3dc206(_0x397dfa['error'][_0x9e6c('0x15')]);}logger[_0x9e6c('0x12')](_0x9e6c('0x14'),_0x45e8f4,_0x397dfa[_0x9e6c('0x12')][_0x9e6c('0x15')]);return _0x14b58f(_0x397dfa[_0x9e6c('0x12')]['message']);}else{logger['info'](_0x9e6c('0x14'),_0x45e8f4,_0x9e6c('0x16'));_0x14b58f(_0x397dfa['result'][_0x9e6c('0x15')]);}})['catch'](function(_0x5f1732){logger[_0x9e6c('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x45e8f4,_0x5f1732);_0x3dc206(_0x5f1732);});});}exports[_0x9e6c('0x17')]=function(_0x598bda){var _0x37f45a=this;return new Promise(function(_0x43b84e,_0x18963e){return db[_0x9e6c('0x18')][_0x9e6c('0x19')]({'raw':_0x598bda[_0x9e6c('0x1a')]?_0x598bda[_0x9e6c('0x1a')][_0x9e6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x598bda[_0x9e6c('0x1a')]?_0x598bda['options'][_0x9e6c('0x1c')]||null:null,'attributes':_0x598bda[_0x9e6c('0x1a')]?_0x598bda['options'][_0x9e6c('0x1d')]||null:null,'include':_0x598bda['options']?_0x598bda[_0x9e6c('0x1a')][_0x9e6c('0x1e')]?_[_0x9e6c('0x1f')](_0x598bda[_0x9e6c('0x1a')][_0x9e6c('0x1e')],function(_0x48b3e0){return{'model':db[_0x48b3e0[_0x9e6c('0x20')]],'as':_0x48b3e0['as'],'attributes':_0x48b3e0[_0x9e6c('0x1d')],'include':_0x48b3e0['include']?_[_0x9e6c('0x1f')](_0x48b3e0['include'],function(_0x1ec2ff){return{'model':db[_0x1ec2ff[_0x9e6c('0x20')]],'as':_0x1ec2ff['as'],'attributes':_0x1ec2ff[_0x9e6c('0x1d')],'include':_0x1ec2ff[_0x9e6c('0x1e')]?_[_0x9e6c('0x1f')](_0x1ec2ff[_0x9e6c('0x1e')],function(_0x57cebd){return{'model':db[_0x57cebd[_0x9e6c('0x20')]],'as':_0x57cebd['as'],'attributes':_0x57cebd['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e6c('0xf')](function(_0x9868f9){logger[_0x9e6c('0x21')](_0x9e6c('0x17'),_0x598bda);logger[_0x9e6c('0x10')](_0x9e6c('0x17'),_0x598bda,JSON['stringify'](_0x9868f9));_0x43b84e(_0x9868f9);})[_0x9e6c('0x22')](function(_0x4ae4a7){logger[_0x9e6c('0x12')]('ShowSquareOdbc',_0x4ae4a7[_0x9e6c('0x15')],_0x598bda);_0x18963e(_0x37f45a[_0x9e6c('0x12')](0x1f4,_0x4ae4a7['message']));});});}; \ No newline at end of file +var _0xd667=['where','include','map','model','attributes','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ShowSquareOdbc','find','options'];(function(_0x57ac66,_0x528cf6){var _0x42d12f=function(_0x5da7c9){while(--_0x5da7c9){_0x57ac66['push'](_0x57ac66['shift']());}};_0x42d12f(++_0x528cf6);}(_0xd667,0x16e));var _0x7d66=function(_0x5f04bf,_0x12854f){_0x5f04bf=_0x5f04bf-0x0;var _0x288ea1=_0xd667[_0x5f04bf];return _0x288ea1;};'use strict';var _=require(_0x7d66('0x0'));var util=require('util');var moment=require(_0x7d66('0x1'));var BPromise=require('bluebird');var rs=require(_0x7d66('0x2'));var fs=require('fs');var Redis=require(_0x7d66('0x3'));var db=require(_0x7d66('0x4'))['db'];var utils=require(_0x7d66('0x5'));var logger=require(_0x7d66('0x6'))(_0x7d66('0x7'));var config=require(_0x7d66('0x8'));var jayson=require(_0x7d66('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11f684,_0x597ba8,_0x303b3){return new BPromise(function(_0x305e8d,_0x2addd4){return client[_0x7d66('0xa')](_0x11f684,_0x303b3)[_0x7d66('0xb')](function(_0x50e518){logger['info'](_0x7d66('0xc'),_0x597ba8,_0x7d66('0xd'));logger[_0x7d66('0xe')](_0x7d66('0xf'),_0x597ba8,_0x7d66('0xd'),JSON[_0x7d66('0x10')](_0x50e518));if(_0x50e518[_0x7d66('0x11')]){if(_0x50e518[_0x7d66('0x11')]['code']===0x1f4){logger[_0x7d66('0x11')](_0x7d66('0xc'),_0x597ba8,_0x50e518[_0x7d66('0x11')][_0x7d66('0x12')]);return _0x2addd4(_0x50e518[_0x7d66('0x11')][_0x7d66('0x12')]);}logger[_0x7d66('0x11')](_0x7d66('0xc'),_0x597ba8,_0x50e518[_0x7d66('0x11')][_0x7d66('0x12')]);return _0x305e8d(_0x50e518[_0x7d66('0x11')][_0x7d66('0x12')]);}else{logger[_0x7d66('0x13')](_0x7d66('0xc'),_0x597ba8,_0x7d66('0xd'));_0x305e8d(_0x50e518[_0x7d66('0x14')][_0x7d66('0x12')]);}})['catch'](function(_0xe11bde){logger[_0x7d66('0x11')](_0x7d66('0xc'),_0x597ba8,_0xe11bde);_0x2addd4(_0xe11bde);});});}exports[_0x7d66('0x15')]=function(_0x1ab7f4){var _0x251758=this;return new Promise(function(_0x2d4039,_0x1c82d5){return db['SquareOdbc'][_0x7d66('0x16')]({'raw':_0x1ab7f4[_0x7d66('0x17')]?_0x1ab7f4['options']['raw']===undefined?!![]:![]:!![],'where':_0x1ab7f4[_0x7d66('0x17')]?_0x1ab7f4['options'][_0x7d66('0x18')]||null:null,'attributes':_0x1ab7f4[_0x7d66('0x17')]?_0x1ab7f4[_0x7d66('0x17')]['attributes']||null:null,'include':_0x1ab7f4[_0x7d66('0x17')]?_0x1ab7f4[_0x7d66('0x17')][_0x7d66('0x19')]?_[_0x7d66('0x1a')](_0x1ab7f4[_0x7d66('0x17')][_0x7d66('0x19')],function(_0x5c70ad){return{'model':db[_0x5c70ad[_0x7d66('0x1b')]],'as':_0x5c70ad['as'],'attributes':_0x5c70ad[_0x7d66('0x1c')],'include':_0x5c70ad[_0x7d66('0x19')]?_[_0x7d66('0x1a')](_0x5c70ad[_0x7d66('0x19')],function(_0x26f122){return{'model':db[_0x26f122[_0x7d66('0x1b')]],'as':_0x26f122['as'],'attributes':_0x26f122[_0x7d66('0x1c')],'include':_0x26f122[_0x7d66('0x19')]?_[_0x7d66('0x1a')](_0x26f122[_0x7d66('0x19')],function(_0x29033f){return{'model':db[_0x29033f[_0x7d66('0x1b')]],'as':_0x29033f['as'],'attributes':_0x29033f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x58c746){logger[_0x7d66('0x13')](_0x7d66('0x15'),_0x1ab7f4);logger[_0x7d66('0xe')](_0x7d66('0x15'),_0x1ab7f4,JSON[_0x7d66('0x10')](_0x58c746));_0x2d4039(_0x58c746);})[_0x7d66('0x1d')](function(_0x54f290){logger[_0x7d66('0x11')](_0x7d66('0x15'),_0x54f290['message'],_0x1ab7f4);_0x1c82d5(_0x251758[_0x7d66('0x11')](0x1f4,_0x54f290['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 9c60c41..15f3aab 100644 --- a/server/api/squareProject/index.js +++ b/server/api/squareProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e44=['./squareProject.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service'];(function(_0x4811a4,_0x408b93){var _0xbfd072=function(_0x12ef69){while(--_0x12ef69){_0x4811a4['push'](_0x4811a4['shift']());}};_0xbfd072(++_0x408b93);}(_0x6e44,0xbc));var _0x46e4=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x6e44[_0x23b655];return _0x364b32;};'use strict';var multer=require(_0x46e4('0x0'));var util=require('util');var path=require(_0x46e4('0x1'));var timeout=require(_0x46e4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x46e4('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x46e4('0x4'));router['get']('/',auth[_0x46e4('0x5')](),controller[_0x46e4('0x6')]);router[_0x46e4('0x7')](_0x46e4('0x8'),auth[_0x46e4('0x5')](),controller[_0x46e4('0x9')]);router[_0x46e4('0xa')]('/',auth[_0x46e4('0x5')](),controller['create']);router[_0x46e4('0xb')](_0x46e4('0x8'),auth['isAuthenticated'](),controller[_0x46e4('0xc')]);router[_0x46e4('0xd')](_0x46e4('0x8'),auth['isAuthenticated'](),controller[_0x46e4('0xe')]);module[_0x46e4('0xf')]=router; \ No newline at end of file +var _0x1021=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','put','delete','exports','multer'];(function(_0x4a3acd,_0x4bf641){var _0x3efdaa=function(_0x32842d){while(--_0x32842d){_0x4a3acd['push'](_0x4a3acd['shift']());}};_0x3efdaa(++_0x4bf641);}(_0x1021,0x125));var _0x1102=function(_0xc212b6,_0x4d69ec){_0xc212b6=_0xc212b6-0x0;var _0x3f7c10=_0x1021[_0xc212b6];return _0x3f7c10;};'use strict';var multer=require(_0x1102('0x0'));var util=require('util');var path=require(_0x1102('0x1'));var timeout=require(_0x1102('0x2'));var express=require(_0x1102('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1102('0x4'));var interaction=require(_0x1102('0x5'));var config=require(_0x1102('0x6'));var controller=require(_0x1102('0x7'));router[_0x1102('0x8')]('/',auth[_0x1102('0x9')](),controller['index']);router['get'](_0x1102('0xa'),auth[_0x1102('0x9')](),controller['show']);router['post']('/',auth[_0x1102('0x9')](),controller['create']);router[_0x1102('0xb')](_0x1102('0xa'),auth[_0x1102('0x9')](),controller['update']);router[_0x1102('0xc')](_0x1102('0xa'),auth[_0x1102('0x9')](),controller['destroy']);module[_0x1102('0xd')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 5913106..2faaa85 100644 --- a/server/api/squareProject/squareProject.attributes.js +++ b/server/api/squareProject/squareProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7670=['production','DATE','sequelize','exports','STRING','TEXT','BLOB','getDataValue','preproduction','utf8','long'];(function(_0xbfe450,_0x32c49b){var _0x16aa8=function(_0x5a4f69){while(--_0x5a4f69){_0xbfe450['push'](_0xbfe450['shift']());}};_0x16aa8(++_0x32c49b);}(_0x7670,0x162));var _0x0767=function(_0x49cb2a,_0x30f953){_0x49cb2a=_0x49cb2a-0x0;var _0xea8e0b=_0x7670[_0x49cb2a];return _0xea8e0b;};'use strict';var Sequelize=require(_0x0767('0x0'));module[_0x0767('0x1')]={'name':{'type':Sequelize[_0x0767('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0767('0x2')]},'notes':{'type':Sequelize[_0x0767('0x3')]},'preproduction':{'type':Sequelize[_0x0767('0x4')]('long'),'get':function(){if(this[_0x0767('0x5')]('preproduction')){return this[_0x0767('0x5')](_0x0767('0x6'))['toString'](_0x0767('0x7'));}}},'production':{'type':Sequelize[_0x0767('0x4')](_0x0767('0x8')),'get':function(){if(this[_0x0767('0x5')](_0x0767('0x9'))){return this['getDataValue']('production')['toString'](_0x0767('0x7'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x0767('0xa')]}}; \ No newline at end of file +var _0xd09b=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','BLOB','long'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd09b,0x1da));var _0xbd09=function(_0x43e43b,_0x3a4f80){_0x43e43b=_0x43e43b-0x0;var _0x2c306d=_0xd09b[_0x43e43b];return _0x2c306d;};'use strict';var Sequelize=require(_0xbd09('0x0'));module[_0xbd09('0x1')]={'name':{'type':Sequelize[_0xbd09('0x2')],'unique':_0xbd09('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xbd09('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xbd09('0x4')](_0xbd09('0x5')),'get':function(){if(this[_0xbd09('0x6')](_0xbd09('0x7'))){return this[_0xbd09('0x6')](_0xbd09('0x7'))[_0xbd09('0x8')](_0xbd09('0x9'));}}},'production':{'type':Sequelize[_0xbd09('0x4')](_0xbd09('0x5')),'get':function(){if(this[_0xbd09('0x6')](_0xbd09('0xa'))){return this[_0xbd09('0x6')](_0xbd09('0xa'))[_0xbd09('0x8')](_0xbd09('0x9'));}}},'savedAt':{'type':Sequelize[_0xbd09('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 0ee9c36..d0ff5d1 100644 --- a/server/api/squareProject/squareProject.controller.js +++ b/server/api/squareProject/squareProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedca=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','agi','stringify','production','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','count','offset','update','then','destroy','get','SquareProjects','UserProfileResource','publish','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareProject','include','findAll','show','params','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xedca,0xdc));var _0xaedc=function(_0x28d8e0,_0x46ad31){_0x28d8e0=_0x28d8e0-0x0;var _0x8c09ba=_0xedca[_0x28d8e0];return _0x8c09ba;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xaedc('0x0'));var logger=require(_0xaedc('0x1'))(_0xaedc('0x2'));var config=require(_0xaedc('0x3'));var db=require(_0xaedc('0x4'))['db'];config[_0xaedc('0x5')]=_[_0xaedc('0x6')](config[_0xaedc('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xaedc('0x7'))(new Redis(config['redis']));require(_0xaedc('0x8'))[_0xaedc('0x9')](socket);function respondWithResult(_0x5e1e47,_0x3bcdc4){_0x3bcdc4=_0x3bcdc4||0xc8;return function(_0x2ddc40){if(_0x2ddc40){return _0x5e1e47[_0xaedc('0xa')](_0x3bcdc4)[_0xaedc('0xb')](_0x2ddc40);}};}function respondWithFilteredResult(_0x222630,_0x5dba64){return function(_0x4422ca){if(_0x4422ca){var _0x5af17c=typeof _0x5dba64['offset']===_0xaedc('0xc')&&typeof _0x5dba64[_0xaedc('0xd')]===_0xaedc('0xc');var _0x50ac53=_0x4422ca[_0xaedc('0xe')];var _0x536417=_0x5af17c?0x0:_0x5dba64['offset'];var _0x288761=_0x5af17c?_0x4422ca['count']:_0x5dba64[_0xaedc('0xf')]+_0x5dba64[_0xaedc('0xd')];var _0x4b86cf;if(_0x288761>=_0x50ac53){_0x288761=_0x50ac53;_0x4b86cf=0xc8;}else{_0x4b86cf=0xce;}_0x222630[_0xaedc('0xa')](_0x4b86cf);return _0x222630['set']('Content-Range',_0x536417+'-'+_0x288761+'/'+_0x50ac53)[_0xaedc('0xb')](_0x4422ca);}return null;};}function saveUpdates(_0x3b378a){return function(_0x402d44){if(_0x402d44){return _0x402d44[_0xaedc('0x10')](_0x3b378a)[_0xaedc('0x11')](function(_0xf97b7e){return _0xf97b7e;});}return null;};}function removeEntity(_0x2ecbc2){return function(_0x17d79a){if(_0x17d79a){return _0x17d79a[_0xaedc('0x12')]()[_0xaedc('0x11')](function(){var _0x594651=_0x17d79a[_0xaedc('0x13')]({'plain':!![]});var _0x386169=_0xaedc('0x14');return db[_0xaedc('0x15')][_0xaedc('0x12')]({'where':{'type':_0x386169,'resourceId':_0x594651['id']}})[_0xaedc('0x11')](function(){return _0x17d79a;});})[_0xaedc('0x11')](function(){var _0x4c9fe5=new Redis(config[_0xaedc('0x5')]);_0x4c9fe5[_0xaedc('0x16')]('agi',JSON['stringify']({'id':_0x17d79a['id'],'deleted':!![]}));})[_0xaedc('0x11')](function(){_0x2ecbc2[_0xaedc('0xa')](0xcc)[_0xaedc('0x17')]();});}};}function handleEntityNotFound(_0xcae125){return function(_0x4631d1){if(!_0x4631d1){_0xcae125[_0xaedc('0x18')](0x194);}return _0x4631d1;};}function handleError(_0xc552f4,_0x199736){_0x199736=_0x199736||0x1f4;return function(_0x52b9a1){logger[_0xaedc('0x19')](_0x52b9a1[_0xaedc('0x1a')]);if(_0x52b9a1[_0xaedc('0x1b')]){delete _0x52b9a1[_0xaedc('0x1b')];}_0xc552f4[_0xaedc('0xa')](_0x199736)[_0xaedc('0x1c')](_0x52b9a1);};}exports['index']=function(_0x56e20e,_0x4e7273){var _0xa10ba7={},_0x26c681={},_0x57ffde={'count':0x0,'rows':[]};var _0x3582b6=_[_0xaedc('0x1d')](db['SquareProject'][_0xaedc('0x1e')],function(_0x2d88e1){return{'name':_0x2d88e1[_0xaedc('0x1f')],'type':_0x2d88e1[_0xaedc('0x20')]['key']};});_0x26c681[_0xaedc('0x21')]=_['map'](_0x3582b6,'name');_0x26c681[_0xaedc('0x22')]=_[_0xaedc('0x23')](_0x56e20e[_0xaedc('0x22')]);_0x26c681[_0xaedc('0x24')]=_[_0xaedc('0x25')](_0x26c681[_0xaedc('0x21')],_0x26c681[_0xaedc('0x22')]);_0xa10ba7['attributes']=_[_0xaedc('0x25')](_0x26c681['model'],qs[_0xaedc('0x26')](_0x56e20e['query'][_0xaedc('0x26')]));_0xa10ba7[_0xaedc('0x27')]=_0xa10ba7[_0xaedc('0x27')][_0xaedc('0x28')]?_0xa10ba7[_0xaedc('0x27')]:_0x26c681[_0xaedc('0x21')];if(!_0x56e20e[_0xaedc('0x22')][_0xaedc('0x29')](_0xaedc('0x2a'))){_0xa10ba7['limit']=qs[_0xaedc('0xd')](_0x56e20e['query'][_0xaedc('0xd')]);_0xa10ba7[_0xaedc('0xf')]=qs[_0xaedc('0xf')](_0x56e20e[_0xaedc('0x22')]['offset']);}_0xa10ba7[_0xaedc('0x2b')]=qs[_0xaedc('0x2c')](_0x56e20e[_0xaedc('0x22')]['sort']);_0xa10ba7[_0xaedc('0x2d')]=qs[_0xaedc('0x24')](_[_0xaedc('0x2e')](_0x56e20e[_0xaedc('0x22')],_0x26c681[_0xaedc('0x24')]),_0x3582b6);if(_0x56e20e['query'][_0xaedc('0x2f')]){_0xa10ba7['where']=_[_0xaedc('0x30')](_0xa10ba7[_0xaedc('0x2d')],{'$or':_['map'](_0x3582b6,function(_0x4e0e7){if(_0x4e0e7[_0xaedc('0x20')]!==_0xaedc('0x31')){var _0x5edce9={};_0x5edce9[_0x4e0e7[_0xaedc('0x1b')]]={'$like':'%'+_0x56e20e['query'][_0xaedc('0x2f')]+'%'};return _0x5edce9;}})});}_0xa10ba7=_[_0xaedc('0x30')]({},_0xa10ba7,_0x56e20e[_0xaedc('0x32')]);var _0x5e07d8={'where':_0xa10ba7[_0xaedc('0x2d')]};return db[_0xaedc('0x33')][_0xaedc('0xe')](_0x5e07d8)[_0xaedc('0x11')](function(_0x4f9a79){_0x57ffde[_0xaedc('0xe')]=_0x4f9a79;if(_0x56e20e[_0xaedc('0x22')]['includeAll']){_0xa10ba7[_0xaedc('0x34')]=[{'all':!![]}];}return db[_0xaedc('0x33')][_0xaedc('0x35')](_0xa10ba7);})[_0xaedc('0x11')](function(_0x581a32){_0x57ffde['rows']=_0x581a32;return _0x57ffde;})[_0xaedc('0x11')](respondWithFilteredResult(_0x4e7273,_0xa10ba7))['catch'](handleError(_0x4e7273,null));};exports[_0xaedc('0x36')]=function(_0x1d75d9,_0x4c8167){var _0x2898ab={'raw':![],'where':{'id':_0x1d75d9[_0xaedc('0x37')]['id']}},_0x174257={};_0x174257[_0xaedc('0x21')]=_[_0xaedc('0x23')](db['SquareProject'][_0xaedc('0x1e')]);_0x174257[_0xaedc('0x22')]=_['keys'](_0x1d75d9['query']);_0x174257[_0xaedc('0x24')]=_[_0xaedc('0x25')](_0x174257['model'],_0x174257[_0xaedc('0x22')]);_0x2898ab[_0xaedc('0x27')]=_['intersection'](_0x174257[_0xaedc('0x21')],qs['fields'](_0x1d75d9['query']['fields']));_0x2898ab[_0xaedc('0x27')]=_0x2898ab[_0xaedc('0x27')][_0xaedc('0x28')]?_0x2898ab['attributes']:_0x174257['model'];if(_0x1d75d9['query'][_0xaedc('0x38')]){_0x2898ab[_0xaedc('0x34')]=[{'all':!![]}];}_0x2898ab=_[_0xaedc('0x30')]({},_0x2898ab,_0x1d75d9[_0xaedc('0x32')]);return db[_0xaedc('0x33')][_0xaedc('0x39')](_0x2898ab)[_0xaedc('0x11')](handleEntityNotFound(_0x4c8167,null))[_0xaedc('0x11')](respondWithResult(_0x4c8167,null))[_0xaedc('0x3a')](handleError(_0x4c8167,null));};exports[_0xaedc('0x3b')]=function(_0x3350f7,_0xb130b0){return db[_0xaedc('0x33')][_0xaedc('0x3b')](_0x3350f7['body'],{})[_0xaedc('0x11')](function(_0x195745){var _0x5af774=_0x3350f7['user']['get']({'plain':!![]});if(!_0x5af774)throw new Error(_0xaedc('0x3c'));if(_0x5af774[_0xaedc('0x3d')]===_0xaedc('0x3e')){var _0x49a788=_0x195745['get']({'plain':!![]});var _0x4f5b7b=_0xaedc('0x14');return db[_0xaedc('0x3f')]['find']({'where':{'name':_0x4f5b7b,'userProfileId':_0x5af774[_0xaedc('0x40')]},'raw':!![]})[_0xaedc('0x11')](function(_0x2a6bf3){if(_0x2a6bf3&&_0x2a6bf3[_0xaedc('0x41')]===0x0){return db[_0xaedc('0x15')][_0xaedc('0x3b')]({'name':_0x49a788[_0xaedc('0x1b')],'resourceId':_0x49a788['id'],'type':_0x2a6bf3[_0xaedc('0x1b')],'sectionId':_0x2a6bf3['id']},{})[_0xaedc('0x11')](function(){return _0x195745;});}else{return _0x195745;}})['catch'](function(_0x3c597d){logger[_0xaedc('0x19')](_0xaedc('0x42'),_0x3c597d);throw _0x3c597d;});}return _0x195745;})[_0xaedc('0x11')](respondWithResult(_0xb130b0,0xc9))['catch'](handleError(_0xb130b0,null));};exports[_0xaedc('0x10')]=function(_0x4abe2c,_0x32ff43){if(_0x4abe2c[_0xaedc('0x43')]['id']){delete _0x4abe2c[_0xaedc('0x43')]['id'];}return db['SquareProject'][_0xaedc('0x39')]({'where':{'id':_0x4abe2c[_0xaedc('0x37')]['id']}})[_0xaedc('0x11')](handleEntityNotFound(_0x32ff43,null))[_0xaedc('0x11')](saveUpdates(_0x4abe2c[_0xaedc('0x43')],null))[_0xaedc('0x11')](function(_0x4dd2d0){if(!_0x4dd2d0)return;var _0x4884d7=_0x4dd2d0['get']({'plain':!![]});return _0x4884d7;})[_0xaedc('0x11')](function(_0x2cc6ad){var _0xa644f5=new Redis(config['redis']);_0xa644f5[_0xaedc('0x16')](_0xaedc('0x44'),JSON[_0xaedc('0x45')](_['pick'](_0x2cc6ad,['id','name',_0xaedc('0x46')])));return _0x2cc6ad;})['then'](respondWithResult(_0x32ff43,null))[_0xaedc('0x3a')](handleError(_0x32ff43,null));};exports['destroy']=function(_0x3160a3,_0xcc6c9c){return db[_0xaedc('0x33')][_0xaedc('0x39')]({'where':{'id':_0x3160a3[_0xaedc('0x37')]['id']}})[_0xaedc('0x11')](handleEntityNotFound(_0xcc6c9c,null))[_0xaedc('0x11')](removeEntity(_0xcc6c9c,null))[_0xaedc('0x3a')](handleError(_0xcc6c9c,null));}; \ No newline at end of file +var _0xafca=['redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','json','offset','undefined','limit','count','status','then','destroy','get','UserProfileResource','publish','agi','stringify','end','sendStatus','name','index','map','SquareProject','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','production','lodash','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xafca,0x148));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaafc('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xaafc('0x1'));var db=require('../../mysqldb')['db'];config[_0xaafc('0x2')]=_[_0xaafc('0x3')](config[_0xaafc('0x2')],{'host':_0xaafc('0x4'),'port':0x18eb});var socket=require(_0xaafc('0x5'))(new Redis(config['redis']));require(_0xaafc('0x6'))[_0xaafc('0x7')](socket);function respondWithResult(_0x291161,_0xe5f782){_0xe5f782=_0xe5f782||0xc8;return function(_0x9fc4b7){if(_0x9fc4b7){return _0x291161['status'](_0xe5f782)[_0xaafc('0x8')](_0x9fc4b7);}};}function respondWithFilteredResult(_0x1c959b,_0x47f521){return function(_0x1be8a3){if(_0x1be8a3){var _0x151db4=typeof _0x47f521[_0xaafc('0x9')]===_0xaafc('0xa')&&typeof _0x47f521[_0xaafc('0xb')]===_0xaafc('0xa');var _0x2fdef9=_0x1be8a3[_0xaafc('0xc')];var _0x4caca0=_0x151db4?0x0:_0x47f521[_0xaafc('0x9')];var _0x4dd854=_0x151db4?_0x1be8a3['count']:_0x47f521[_0xaafc('0x9')]+_0x47f521['limit'];var _0x395704;if(_0x4dd854>=_0x2fdef9){_0x4dd854=_0x2fdef9;_0x395704=0xc8;}else{_0x395704=0xce;}_0x1c959b[_0xaafc('0xd')](_0x395704);return _0x1c959b['set']('Content-Range',_0x4caca0+'-'+_0x4dd854+'/'+_0x2fdef9)[_0xaafc('0x8')](_0x1be8a3);}return null;};}function saveUpdates(_0x324674){return function(_0x47ee88){if(_0x47ee88){return _0x47ee88['update'](_0x324674)[_0xaafc('0xe')](function(_0x499255){return _0x499255;});}return null;};}function removeEntity(_0xfb5590){return function(_0x1efc6b){if(_0x1efc6b){return _0x1efc6b[_0xaafc('0xf')]()[_0xaafc('0xe')](function(){var _0x334e1d=_0x1efc6b[_0xaafc('0x10')]({'plain':!![]});var _0x4a6639='SquareProjects';return db[_0xaafc('0x11')][_0xaafc('0xf')]({'where':{'type':_0x4a6639,'resourceId':_0x334e1d['id']}})[_0xaafc('0xe')](function(){return _0x1efc6b;});})[_0xaafc('0xe')](function(){var _0x423839=new Redis(config[_0xaafc('0x2')]);_0x423839[_0xaafc('0x12')](_0xaafc('0x13'),JSON[_0xaafc('0x14')]({'id':_0x1efc6b['id'],'deleted':!![]}));})[_0xaafc('0xe')](function(){_0xfb5590[_0xaafc('0xd')](0xcc)[_0xaafc('0x15')]();});}};}function handleEntityNotFound(_0x4af52b){return function(_0x414f84){if(!_0x414f84){_0x4af52b[_0xaafc('0x16')](0x194);}return _0x414f84;};}function handleError(_0x1f5d0f,_0x2d3d24){_0x2d3d24=_0x2d3d24||0x1f4;return function(_0x5c87ee){logger['error'](_0x5c87ee['stack']);if(_0x5c87ee[_0xaafc('0x17')]){delete _0x5c87ee[_0xaafc('0x17')];}_0x1f5d0f['status'](_0x2d3d24)['send'](_0x5c87ee);};}exports[_0xaafc('0x18')]=function(_0x27c1af,_0x5f53fc){var _0x393c78={},_0x48f1be={},_0x39f1f3={'count':0x0,'rows':[]};var _0x4f4cd4=_[_0xaafc('0x19')](db[_0xaafc('0x1a')]['rawAttributes'],function(_0x4143d6){return{'name':_0x4143d6[_0xaafc('0x1b')],'type':_0x4143d6['type'][_0xaafc('0x1c')]};});_0x48f1be['model']=_[_0xaafc('0x19')](_0x4f4cd4,_0xaafc('0x17'));_0x48f1be[_0xaafc('0x1d')]=_[_0xaafc('0x1e')](_0x27c1af[_0xaafc('0x1d')]);_0x48f1be[_0xaafc('0x1f')]=_['intersection'](_0x48f1be['model'],_0x48f1be[_0xaafc('0x1d')]);_0x393c78['attributes']=_[_0xaafc('0x20')](_0x48f1be[_0xaafc('0x21')],qs[_0xaafc('0x22')](_0x27c1af['query']['fields']));_0x393c78['attributes']=_0x393c78[_0xaafc('0x23')][_0xaafc('0x24')]?_0x393c78['attributes']:_0x48f1be[_0xaafc('0x21')];if(!_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x25')](_0xaafc('0x26'))){_0x393c78[_0xaafc('0xb')]=qs[_0xaafc('0xb')](_0x27c1af[_0xaafc('0x1d')][_0xaafc('0xb')]);_0x393c78[_0xaafc('0x9')]=qs[_0xaafc('0x9')](_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x9')]);}_0x393c78[_0xaafc('0x27')]=qs[_0xaafc('0x28')](_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x28')]);_0x393c78['where']=qs[_0xaafc('0x1f')](_[_0xaafc('0x29')](_0x27c1af[_0xaafc('0x1d')],_0x48f1be[_0xaafc('0x1f')]),_0x4f4cd4);if(_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x2a')]){_0x393c78[_0xaafc('0x2b')]=_[_0xaafc('0x2c')](_0x393c78[_0xaafc('0x2b')],{'$or':_[_0xaafc('0x19')](_0x4f4cd4,function(_0x229f9b){if(_0x229f9b['type']!==_0xaafc('0x2d')){var _0xb30bfb={};_0xb30bfb[_0x229f9b[_0xaafc('0x17')]]={'$like':'%'+_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x2a')]+'%'};return _0xb30bfb;}})});}_0x393c78=_[_0xaafc('0x2c')]({},_0x393c78,_0x27c1af[_0xaafc('0x2e')]);var _0xc958a8={'where':_0x393c78[_0xaafc('0x2b')]};return db[_0xaafc('0x1a')][_0xaafc('0xc')](_0xc958a8)['then'](function(_0x1c5186){_0x39f1f3[_0xaafc('0xc')]=_0x1c5186;if(_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x2f')]){_0x393c78[_0xaafc('0x30')]=[{'all':!![]}];}return db[_0xaafc('0x1a')][_0xaafc('0x31')](_0x393c78);})[_0xaafc('0xe')](function(_0x38c315){_0x39f1f3[_0xaafc('0x32')]=_0x38c315;return _0x39f1f3;})['then'](respondWithFilteredResult(_0x5f53fc,_0x393c78))[_0xaafc('0x33')](handleError(_0x5f53fc,null));};exports[_0xaafc('0x34')]=function(_0x406e54,_0x346949){var _0x443b47={'raw':![],'where':{'id':_0x406e54[_0xaafc('0x35')]['id']}},_0x247dfb={};_0x247dfb['model']=_[_0xaafc('0x1e')](db[_0xaafc('0x1a')][_0xaafc('0x36')]);_0x247dfb['query']=_['keys'](_0x406e54[_0xaafc('0x1d')]);_0x247dfb[_0xaafc('0x1f')]=_[_0xaafc('0x20')](_0x247dfb[_0xaafc('0x21')],_0x247dfb['query']);_0x443b47['attributes']=_[_0xaafc('0x20')](_0x247dfb[_0xaafc('0x21')],qs['fields'](_0x406e54[_0xaafc('0x1d')][_0xaafc('0x22')]));_0x443b47[_0xaafc('0x23')]=_0x443b47[_0xaafc('0x23')]['length']?_0x443b47['attributes']:_0x247dfb[_0xaafc('0x21')];if(_0x406e54[_0xaafc('0x1d')][_0xaafc('0x2f')]){_0x443b47[_0xaafc('0x30')]=[{'all':!![]}];}_0x443b47=_[_0xaafc('0x2c')]({},_0x443b47,_0x406e54['options']);return db[_0xaafc('0x1a')][_0xaafc('0x37')](_0x443b47)[_0xaafc('0xe')](handleEntityNotFound(_0x346949,null))[_0xaafc('0xe')](respondWithResult(_0x346949,null))[_0xaafc('0x33')](handleError(_0x346949,null));};exports[_0xaafc('0x38')]=function(_0x5b020c,_0x3fbaf3){return db['SquareProject'][_0xaafc('0x38')](_0x5b020c['body'],{})[_0xaafc('0xe')](function(_0x595152){var _0x272a32=_0x5b020c[_0xaafc('0x39')][_0xaafc('0x10')]({'plain':!![]});if(!_0x272a32)throw new Error(_0xaafc('0x3a'));if(_0x272a32['role']===_0xaafc('0x39')){var _0x2a347=_0x595152[_0xaafc('0x10')]({'plain':!![]});var _0xaa59b5=_0xaafc('0x3b');return db[_0xaafc('0x3c')]['find']({'where':{'name':_0xaa59b5,'userProfileId':_0x272a32['userProfileId']},'raw':!![]})[_0xaafc('0xe')](function(_0x24726b){if(_0x24726b&&_0x24726b['autoAssociation']===0x0){return db[_0xaafc('0x11')]['create']({'name':_0x2a347[_0xaafc('0x17')],'resourceId':_0x2a347['id'],'type':_0x24726b[_0xaafc('0x17')],'sectionId':_0x24726b['id']},{})[_0xaafc('0xe')](function(){return _0x595152;});}else{return _0x595152;}})[_0xaafc('0x33')](function(_0x541a1f){logger[_0xaafc('0x3d')](_0xaafc('0x3e'),_0x541a1f);throw _0x541a1f;});}return _0x595152;})[_0xaafc('0xe')](respondWithResult(_0x3fbaf3,0xc9))[_0xaafc('0x33')](handleError(_0x3fbaf3,null));};exports[_0xaafc('0x3f')]=function(_0x133496,_0x3973b4){if(_0x133496[_0xaafc('0x40')]['id']){delete _0x133496['body']['id'];}return db[_0xaafc('0x1a')][_0xaafc('0x37')]({'where':{'id':_0x133496[_0xaafc('0x35')]['id']}})['then'](handleEntityNotFound(_0x3973b4,null))[_0xaafc('0xe')](saveUpdates(_0x133496[_0xaafc('0x40')],null))[_0xaafc('0xe')](function(_0x4dd941){if(!_0x4dd941)return;var _0xf707b0=_0x4dd941[_0xaafc('0x10')]({'plain':!![]});return _0xf707b0;})[_0xaafc('0xe')](function(_0x6a5200){var _0x4e96c7=new Redis(config[_0xaafc('0x2')]);_0x4e96c7[_0xaafc('0x12')](_0xaafc('0x13'),JSON[_0xaafc('0x14')](_[_0xaafc('0x29')](_0x6a5200,['id',_0xaafc('0x17'),_0xaafc('0x41')])));return _0x6a5200;})['then'](respondWithResult(_0x3973b4,null))[_0xaafc('0x33')](handleError(_0x3973b4,null));};exports[_0xaafc('0xf')]=function(_0x291a3d,_0x4eaac2){return db[_0xaafc('0x1a')][_0xaafc('0x37')]({'where':{'id':_0x291a3d['params']['id']}})[_0xaafc('0xe')](handleEntityNotFound(_0x4eaac2,null))[_0xaafc('0xe')](removeEntity(_0x4eaac2,null))['catch'](handleError(_0x4eaac2,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 5c6bca5..6c1fda6 100644 --- a/server/api/squareProject/squareProject.events.js +++ b/server/api/squareProject/squareProject.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4ad=['events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','exports'];(function(_0x4090e7,_0xc289ab){var _0x475fc4=function(_0x393043){while(--_0x393043){_0x4090e7['push'](_0x4090e7['shift']());}};_0x475fc4(++_0xc289ab);}(_0xc4ad,0x129));var _0xdc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ad[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xdc4a('0x0'));var SquareProject=require(_0xdc4a('0x1'))['db'][_0xdc4a('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xdc4a('0x3')](0x0);var events={'afterCreate':_0xdc4a('0x4'),'afterUpdate':_0xdc4a('0x5'),'afterDestroy':_0xdc4a('0x6')};function emitEvent(_0x1b927a){return function(_0x41a3b2,_0x77767f,_0x378e3f){SquareProjectEvents['emit'](_0x1b927a+':'+_0x41a3b2['id'],_0x41a3b2);SquareProjectEvents[_0xdc4a('0x7')](_0x1b927a,_0x41a3b2);_0x378e3f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xdc4a('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x3f9b=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb','SquareProject'];(function(_0x32db24,_0x31bfa0){var _0x36cf93=function(_0x45fb35){while(--_0x45fb35){_0x32db24['push'](_0x32db24['shift']());}};_0x36cf93(++_0x31bfa0);}(_0x3f9b,0x156));var _0xb3f9=function(_0x1be648,_0x1e8622){_0x1be648=_0x1be648-0x0;var _0x281bd1=_0x3f9b[_0x1be648];return _0x281bd1;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xb3f9('0x0'))['db'][_0xb3f9('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb3f9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb3f9('0x3'),'afterDestroy':_0xb3f9('0x4')};function emitEvent(_0x3cf4a4){return function(_0x3e49cd,_0x1bd263,_0x512989){SquareProjectEvents[_0xb3f9('0x5')](_0x3cf4a4+':'+_0x3e49cd['id'],_0x3e49cd);SquareProjectEvents['emit'](_0x3cf4a4,_0x3e49cd);_0x512989(null);};}for(var e in events){if(events[_0xb3f9('0x6')](e)){var event=events[e];SquareProject[_0xb3f9('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 668f9e7..f157c1e 100644 --- a/server/api/squareProject/squareProject.model.js +++ b/server/api/squareProject/squareProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37c3=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','preproduction','savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x26ed12,_0x4c0151){var _0x2fd84c=function(_0x457a66){while(--_0x457a66){_0x26ed12['push'](_0x26ed12['shift']());}};_0x2fd84c(++_0x4c0151);}(_0x37c3,0x160));var _0x337c=function(_0x5bc4b6,_0x5ae95c){_0x5bc4b6=_0x5bc4b6-0x0;var _0xf93b52=_0x37c3[_0x5bc4b6];return _0xf93b52;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x337c('0x0'))(_0x337c('0x1'));var moment=require('moment');var BPromise=require(_0x337c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x337c('0x3'));var rimraf=require(_0x337c('0x4'));var config=require(_0x337c('0x5'));var attributes=require(_0x337c('0x6'));module[_0x337c('0x7')]=function(_0x1b984a,_0x13060f){return _0x1b984a[_0x337c('0x8')](_0x337c('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f8016,_0x21dc00,_0x55162f){if(_0x2f8016['changed'](_0x337c('0xa'))){_0x2f8016[_0x337c('0xb')]=moment()[_0x337c('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2f8016['changed'](_0x337c('0xd'))){_0x2f8016[_0x337c('0xe')]=moment()[_0x337c('0xc')](_0x337c('0xf'));}_0x55162f(null,_0x2f8016);}}});}; \ No newline at end of file +var _0x9e4d=['../../config/environment','./squareProject.attributes','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x444fe3,_0x49a537){var _0x316f20=function(_0x5bcb02){while(--_0x5bcb02){_0x444fe3['push'](_0x444fe3['shift']());}};_0x316f20(++_0x49a537);}(_0x9e4d,0x129));var _0xd9e4=function(_0x179f07,_0x4763dc){_0x179f07=_0x179f07-0x0;var _0x12d6d1=_0x9e4d[_0x179f07];return _0x12d6d1;};'use strict';var _=require('lodash');var util=require(_0xd9e4('0x0'));var logger=require('../../config/logger')(_0xd9e4('0x1'));var moment=require(_0xd9e4('0x2'));var BPromise=require(_0xd9e4('0x3'));var rp=require(_0xd9e4('0x4'));var fs=require('fs');var path=require(_0xd9e4('0x5'));var rimraf=require(_0xd9e4('0x6'));var config=require(_0xd9e4('0x7'));var attributes=require(_0xd9e4('0x8'));module['exports']=function(_0x14d651,_0x274ef2){return _0x14d651['define'](_0xd9e4('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x115220,_0xda86db,_0x526e66){if(_0x115220[_0xd9e4('0xa')](_0xd9e4('0xb'))){_0x115220[_0xd9e4('0xc')]=moment()[_0xd9e4('0xd')](_0xd9e4('0xe'));}if(_0x115220[_0xd9e4('0xa')]('production')){_0x115220[_0xd9e4('0xf')]=moment()[_0xd9e4('0xd')](_0xd9e4('0xe'));}_0x526e66(null,_0x115220);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 45ccbee..37fc145 100644 --- a/server/api/squareProject/squareProject.rpc.js +++ b/server/api/squareProject/squareProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a79=['../../config/environment','defaults','socket.io-emitter','redis','./squareProject.socket','GetSquareProjects','SquareProject','options','raw','where','attributes','limit','include','map','model','then','info','stringify','catch','message','error','find','ShowSquareProject','debug','lodash','ioredis','../../mysqldb','rpc'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x5a79,0xa4));var _0x95a7=function(_0x2b9324,_0x32f260){_0x2b9324=_0x2b9324-0x0;var _0x5063a4=_0x5a79[_0x2b9324];return _0x5063a4;};'use strict';var _=require(_0x95a7('0x0'));var Redis=require(_0x95a7('0x1'));var db=require(_0x95a7('0x2'))['db'];var logger=require('../../config/logger')(_0x95a7('0x3'));var config=require(_0x95a7('0x4'));config['redis']=_[_0x95a7('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x95a7('0x6'))(new Redis(config[_0x95a7('0x7')]));require(_0x95a7('0x8'))['register'](socket);exports[_0x95a7('0x9')]=function(_0x3d1665){var _0x57de9e=this;return new Promise(function(_0x32506,_0xedd8f4){return db[_0x95a7('0xa')]['findAll']({'raw':_0x3d1665[_0x95a7('0xb')]?_0x3d1665['options'][_0x95a7('0xc')]===undefined?!![]:![]:!![],'where':_0x3d1665[_0x95a7('0xb')]?_0x3d1665[_0x95a7('0xb')][_0x95a7('0xd')]||null:null,'attributes':_0x3d1665[_0x95a7('0xb')]?_0x3d1665[_0x95a7('0xb')][_0x95a7('0xe')]||null:null,'limit':_0x3d1665['options']?_0x3d1665[_0x95a7('0xb')][_0x95a7('0xf')]||null:null,'include':_0x3d1665[_0x95a7('0xb')]?_0x3d1665[_0x95a7('0xb')][_0x95a7('0x10')]?_[_0x95a7('0x11')](_0x3d1665[_0x95a7('0xb')][_0x95a7('0x10')],function(_0x4668fc){return{'model':db[_0x4668fc['model']],'as':_0x4668fc['as'],'attributes':_0x4668fc[_0x95a7('0xe')],'include':_0x4668fc[_0x95a7('0x10')]?_[_0x95a7('0x11')](_0x4668fc[_0x95a7('0x10')],function(_0x4b0741){return{'model':db[_0x4b0741[_0x95a7('0x12')]],'as':_0x4b0741['as'],'attributes':_0x4b0741[_0x95a7('0xe')],'include':_0x4b0741[_0x95a7('0x10')]?_['map'](_0x4b0741[_0x95a7('0x10')],function(_0x5719a8){return{'model':db[_0x5719a8[_0x95a7('0x12')]],'as':_0x5719a8['as'],'attributes':_0x5719a8[_0x95a7('0xe')]};}):[]};}):[]};}):[]:[]})[_0x95a7('0x13')](function(_0x5591a8){logger[_0x95a7('0x14')](_0x95a7('0x9'),_0x3d1665);logger['debug'](_0x95a7('0x9'),_0x3d1665,JSON[_0x95a7('0x15')](_0x5591a8));_0x32506(_0x5591a8);})[_0x95a7('0x16')](function(_0x1bd484){logger['error'](_0x95a7('0x9'),_0x1bd484[_0x95a7('0x17')],_0x3d1665);_0xedd8f4(_0x57de9e[_0x95a7('0x18')](0x1f4,_0x1bd484['message']));});});};exports['ShowSquareProject']=function(_0x4da10f){var _0x21df29=this;return new Promise(function(_0x30c971,_0x45bda9){return db[_0x95a7('0xa')][_0x95a7('0x19')]({'raw':_0x4da10f[_0x95a7('0xb')]?_0x4da10f[_0x95a7('0xb')][_0x95a7('0xc')]===undefined?!![]:![]:!![],'where':_0x4da10f[_0x95a7('0xb')]?_0x4da10f[_0x95a7('0xb')][_0x95a7('0xd')]||null:null,'attributes':_0x4da10f[_0x95a7('0xb')]?_0x4da10f[_0x95a7('0xb')]['attributes']||null:null,'include':_0x4da10f[_0x95a7('0xb')]?_0x4da10f[_0x95a7('0xb')][_0x95a7('0x10')]?_['map'](_0x4da10f[_0x95a7('0xb')][_0x95a7('0x10')],function(_0x4d7508){return{'model':db[_0x4d7508[_0x95a7('0x12')]],'as':_0x4d7508['as'],'attributes':_0x4d7508[_0x95a7('0xe')],'include':_0x4d7508['include']?_[_0x95a7('0x11')](_0x4d7508['include'],function(_0x407f7d){return{'model':db[_0x407f7d['model']],'as':_0x407f7d['as'],'attributes':_0x407f7d[_0x95a7('0xe')],'include':_0x407f7d['include']?_['map'](_0x407f7d[_0x95a7('0x10')],function(_0x3c8b8c){return{'model':db[_0x3c8b8c[_0x95a7('0x12')]],'as':_0x3c8b8c['as'],'attributes':_0x3c8b8c[_0x95a7('0xe')]};}):[]};}):[]};}):[]:[]})[_0x95a7('0x13')](function(_0x2e4050){logger[_0x95a7('0x14')](_0x95a7('0x1a'),_0x4da10f);logger[_0x95a7('0x1b')](_0x95a7('0x1a'),_0x4da10f,JSON[_0x95a7('0x15')](_0x2e4050));_0x30c971(_0x2e4050);})['catch'](function(_0x25549b){logger[_0x95a7('0x18')]('ShowSquareProject',_0x25549b[_0x95a7('0x17')],_0x4da10f);_0x45bda9(_0x21df29[_0x95a7('0x18')](0x1f4,_0x25549b['message']));});});}; \ No newline at end of file +var _0x7de4=['catch','lodash','ioredis','../../mysqldb','rpc','../../config/environment','redis','defaults','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','attributes','limit','map','model','include','then','info','stringify','message','ShowSquareProject','find','where','debug'];(function(_0x1547db,_0x25815e){var _0x124414=function(_0x57ea82){while(--_0x57ea82){_0x1547db['push'](_0x1547db['shift']());}};_0x124414(++_0x25815e);}(_0x7de4,0x92));var _0x47de=function(_0x99e31b,_0x1b91ff){_0x99e31b=_0x99e31b-0x0;var _0x4c765b=_0x7de4[_0x99e31b];return _0x4c765b;};'use strict';var _=require(_0x47de('0x0'));var Redis=require(_0x47de('0x1'));var db=require(_0x47de('0x2'))['db'];var logger=require('../../config/logger')(_0x47de('0x3'));var config=require(_0x47de('0x4'));config[_0x47de('0x5')]=_[_0x47de('0x6')](config[_0x47de('0x5')],{'host':_0x47de('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47de('0x5')]));require(_0x47de('0x8'))[_0x47de('0x9')](socket);exports[_0x47de('0xa')]=function(_0x309deb){var _0x64b9aa=this;return new Promise(function(_0x131a6b,_0x34c1b8){return db[_0x47de('0xb')][_0x47de('0xc')]({'raw':_0x309deb[_0x47de('0xd')]?_0x309deb['options'][_0x47de('0xe')]===undefined?!![]:![]:!![],'where':_0x309deb['options']?_0x309deb[_0x47de('0xd')]['where']||null:null,'attributes':_0x309deb[_0x47de('0xd')]?_0x309deb['options'][_0x47de('0xf')]||null:null,'limit':_0x309deb[_0x47de('0xd')]?_0x309deb[_0x47de('0xd')][_0x47de('0x10')]||null:null,'include':_0x309deb[_0x47de('0xd')]?_0x309deb[_0x47de('0xd')]['include']?_[_0x47de('0x11')](_0x309deb[_0x47de('0xd')]['include'],function(_0x54cd1d){return{'model':db[_0x54cd1d[_0x47de('0x12')]],'as':_0x54cd1d['as'],'attributes':_0x54cd1d[_0x47de('0xf')],'include':_0x54cd1d['include']?_[_0x47de('0x11')](_0x54cd1d[_0x47de('0x13')],function(_0x3090eb){return{'model':db[_0x3090eb[_0x47de('0x12')]],'as':_0x3090eb['as'],'attributes':_0x3090eb[_0x47de('0xf')],'include':_0x3090eb[_0x47de('0x13')]?_['map'](_0x3090eb['include'],function(_0x1ad6cf){return{'model':db[_0x1ad6cf[_0x47de('0x12')]],'as':_0x1ad6cf['as'],'attributes':_0x1ad6cf[_0x47de('0xf')]};}):[]};}):[]};}):[]:[]})[_0x47de('0x14')](function(_0x2c9c6e){logger[_0x47de('0x15')]('GetSquareProjects',_0x309deb);logger['debug'](_0x47de('0xa'),_0x309deb,JSON[_0x47de('0x16')](_0x2c9c6e));_0x131a6b(_0x2c9c6e);})['catch'](function(_0x54b7f9){logger['error']('GetSquareProjects',_0x54b7f9[_0x47de('0x17')],_0x309deb);_0x34c1b8(_0x64b9aa['error'](0x1f4,_0x54b7f9[_0x47de('0x17')]));});});};exports[_0x47de('0x18')]=function(_0x568bb5){var _0x2b878c=this;return new Promise(function(_0x4dc1b0,_0x4083ce){return db[_0x47de('0xb')][_0x47de('0x19')]({'raw':_0x568bb5[_0x47de('0xd')]?_0x568bb5[_0x47de('0xd')][_0x47de('0xe')]===undefined?!![]:![]:!![],'where':_0x568bb5[_0x47de('0xd')]?_0x568bb5[_0x47de('0xd')][_0x47de('0x1a')]||null:null,'attributes':_0x568bb5[_0x47de('0xd')]?_0x568bb5[_0x47de('0xd')]['attributes']||null:null,'include':_0x568bb5[_0x47de('0xd')]?_0x568bb5['options'][_0x47de('0x13')]?_[_0x47de('0x11')](_0x568bb5[_0x47de('0xd')]['include'],function(_0x1aeaa1){return{'model':db[_0x1aeaa1[_0x47de('0x12')]],'as':_0x1aeaa1['as'],'attributes':_0x1aeaa1['attributes'],'include':_0x1aeaa1[_0x47de('0x13')]?_[_0x47de('0x11')](_0x1aeaa1[_0x47de('0x13')],function(_0x19f7bd){return{'model':db[_0x19f7bd[_0x47de('0x12')]],'as':_0x19f7bd['as'],'attributes':_0x19f7bd['attributes'],'include':_0x19f7bd['include']?_[_0x47de('0x11')](_0x19f7bd['include'],function(_0x53a398){return{'model':db[_0x53a398[_0x47de('0x12')]],'as':_0x53a398['as'],'attributes':_0x53a398[_0x47de('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fe957){logger[_0x47de('0x15')](_0x47de('0x18'),_0x568bb5);logger[_0x47de('0x1b')](_0x47de('0x18'),_0x568bb5,JSON[_0x47de('0x16')](_0x4fe957));_0x4dc1b0(_0x4fe957);})[_0x47de('0x1c')](function(_0x2c6fd8){logger['error'](_0x47de('0x18'),_0x2c6fd8['message'],_0x568bb5);_0x4083ce(_0x2b878c['error'](0x1f4,_0x2c6fd8[_0x47de('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index cebb088..283c80d 100644 --- a/server/api/squareProject/squareProject.socket.js +++ b/server/api/squareProject/squareProject.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3768=['remove','update','emit','length','squareProject:','./squareProject.events','save'];(function(_0x42cd03,_0x47c76c){var _0x538b91=function(_0x27c281){while(--_0x27c281){_0x42cd03['push'](_0x42cd03['shift']());}};_0x538b91(++_0x47c76c);}(_0x3768,0x139));var _0x8376=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x3768[_0x528575];return _0x3063b7;};'use strict';var SquareProjectEvents=require(_0x8376('0x0'));var events=[_0x8376('0x1'),_0x8376('0x2'),_0x8376('0x3')];function createListener(_0x3ad7a7,_0x869a57){return function(_0x23d085){_0x869a57[_0x8376('0x4')](_0x3ad7a7,_0x23d085);};}function removeListener(_0x18e5ec,_0x3af068){return function(){SquareProjectEvents['removeListener'](_0x18e5ec,_0x3af068);};}exports['register']=function(_0x3e97db){for(var _0xc216aa=0x0,_0xaca27e=events[_0x8376('0x5')];_0xc216aa<_0xaca27e;_0xc216aa++){var _0x377dda=events[_0xc216aa];var _0x19c1b0=createListener(_0x8376('0x6')+_0x377dda,_0x3e97db);SquareProjectEvents['on'](_0x377dda,_0x19c1b0);}}; \ No newline at end of file +var _0x41e4=['removeListener','register','length','squareProject:','remove','emit'];(function(_0x4c70ca,_0x55b405){var _0x26a3b1=function(_0x277b2d){while(--_0x277b2d){_0x4c70ca['push'](_0x4c70ca['shift']());}};_0x26a3b1(++_0x55b405);}(_0x41e4,0x166));var _0x441e=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x41e4[_0x3c8e9a];return _0x2d4c57;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x441e('0x0'),'update'];function createListener(_0x53d5d4,_0x2421da){return function(_0x28069b){_0x2421da[_0x441e('0x1')](_0x53d5d4,_0x28069b);};}function removeListener(_0x4c6faa,_0x143344){return function(){SquareProjectEvents[_0x441e('0x2')](_0x4c6faa,_0x143344);};}exports[_0x441e('0x3')]=function(_0x594857){for(var _0x345243=0x0,_0x1d5616=events[_0x441e('0x4')];_0x345243<_0x1d5616;_0x345243++){var _0x3c19a4=events[_0x345243];var _0x34bd93=createListener(_0x441e('0x5')+_0x3c19a4,_0x594857);SquareProjectEvents['on'](_0x3c19a4,_0x34bd93);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 9c95813..e6274d9 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x394347,_0x247cf6){var _0x69598e=function(_0x2c438a){while(--_0x2c438a){_0x394347['push'](_0x394347['shift']());}};_0x69598e(++_0x247cf6);}(_0x1261,0x144));var _0x1126=function(_0x4014e5,_0x125e6a){_0x4014e5=_0x4014e5-0x0;var _0x4ee8b7=_0x1261[_0x4014e5];return _0x4ee8b7;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file +var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x202164,_0x370423){var _0x35aa4d=function(_0xc5414c){while(--_0xc5414c){_0x202164['push'](_0x202164['shift']());}};_0x35aa4d(++_0x370423);}(_0x5fc3,0xa8));var _0x35fc=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x5fc3[_0x402c8f];return _0x11e809;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 4b837f9..ff338b3 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd51=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','STRING'];(function(_0xbb03d2,_0x3a8509){var _0x4cb14e=function(_0x179509){while(--_0x179509){_0xbb03d2['push'](_0xbb03d2['shift']());}};_0x4cb14e(++_0x3a8509);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x53f6db,_0xa4f600){_0x53f6db=_0x53f6db-0x0;var _0x26f2a6=_0xbd51[_0x53f6db];return _0x26f2a6;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1bd5('0x1')]},'callerid':{'type':Sequelize[_0x1bd5('0x1')]},'calleridname':{'type':Sequelize[_0x1bd5('0x1')]},'context':{'type':Sequelize[_0x1bd5('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x1bd5('0x1')]},'saveName':{'type':Sequelize[_0x1bd5('0x1')]},'filename':{'type':Sequelize[_0x1bd5('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1bd5('0x2')],'get':function(){var _0x30a385='';var _0x19077c=this[_0x1bd5('0x3')](_0x1bd5('0x4'));if(_0x19077c){_0x30a385=_0x19077c['substring'](_0x19077c[_0x1bd5('0x5')]('.'));}return _0x30a385;}}}; \ No newline at end of file +var _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0x5d94f9,_0x354c31){var _0x60c9d=function(_0x14326c){while(--_0x14326c){_0x5d94f9['push'](_0x5d94f9['shift']());}};_0x60c9d(++_0x354c31);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3403d5,_0x3d99fc){_0x3403d5=_0x3403d5-0x0;var _0xf9df4f=_0xeec6[_0x3403d5];return _0xf9df4f;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'uniqueid':{'type':Sequelize[_0x6eec('0x2')]},'callerid':{'type':Sequelize[_0x6eec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6eec('0x2')]},'extension':{'type':Sequelize[_0x6eec('0x2')]},'priority':{'type':Sequelize[_0x6eec('0x2')]},'accountcode':{'type':Sequelize[_0x6eec('0x2')]},'dnid':{'type':Sequelize[_0x6eec('0x2')]},'projectName':{'type':Sequelize[_0x6eec('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6eec('0x2')]},'savePath':{'type':Sequelize[_0x6eec('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5a5e47='';var _0x1c810e=this[_0x6eec('0x3')](_0x6eec('0x4'));if(_0x1c810e){_0x5a5e47=_0x1c810e['substring'](_0x1c810e[_0x6eec('0x5')]('.'));}return _0x5a5e47;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index d1aafb2..aa44e64 100644 --- a/server/api/squareRecording/squareRecording.controller.js +++ b/server/api/squareRecording/squareRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x560e=['params','include','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','existsSync','decryptFile','Sequelize','SquareRecording\x20not\x20found','filename','unlink','message','isNil','cancellazione\x20fisica\x20documento\x20%s','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','SquareRecording','includeAll','rows','catch','show'];(function(_0x2aec24,_0x5bb38a){var _0x3cd1f1=function(_0xf695f3){while(--_0xf695f3){_0x2aec24['push'](_0x2aec24['shift']());}};_0x3cd1f1(++_0x5bb38a);}(_0x560e,0x78));var _0xe560=function(_0x2316dd,_0x568eaf){_0x2316dd=_0x2316dd-0x0;var _0x4a0dfe=_0x560e[_0x2316dd];return _0x4a0dfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe560('0x0'));var zipdir=require(_0xe560('0x1'));var jsonpatch=require(_0xe560('0x2'));var rp=require(_0xe560('0x3'));var moment=require(_0xe560('0x4'));var BPromise=require(_0xe560('0x5'));var Mustache=require(_0xe560('0x6'));var util=require(_0xe560('0x7'));var path=require('path');var sox=require(_0xe560('0x8'));var csv=require(_0xe560('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe560('0xa'));var _=require(_0xe560('0xb'));var squel=require(_0xe560('0xc'));var crypto=require(_0xe560('0xd'));var jsforce=require(_0xe560('0xe'));var deskjs=require(_0xe560('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe560('0x10'));var Papa=require(_0xe560('0x11'));var Redis=require(_0xe560('0x12'));var authService=require(_0xe560('0x13'));var qs=require(_0xe560('0x14'));var as=require(_0xe560('0x15'));var hardwareService=require(_0xe560('0x16'));var logger=require(_0xe560('0x17'))(_0xe560('0x18'));var utils=require(_0xe560('0x19'));var config=require(_0xe560('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4368cc,_0x1a3d99){_0x1a3d99=_0x1a3d99||0xcc;return function(_0x712cb2){if(_0x712cb2){return _0x4368cc[_0xe560('0x1b')](_0x1a3d99);}return _0x4368cc['status'](_0x1a3d99)[_0xe560('0x1c')]();};}function respondWithResult(_0x451957,_0x149c62){_0x149c62=_0x149c62||0xc8;return function(_0x2ed1f8){if(_0x2ed1f8){return _0x451957[_0xe560('0x1d')](_0x149c62)[_0xe560('0x1e')](_0x2ed1f8);}};}function respondWithFilteredResult(_0x2c4338,_0x3dd159){return function(_0x5162aa){if(_0x5162aa){var _0x30602c=typeof _0x3dd159[_0xe560('0x1f')]===_0xe560('0x20')&&typeof _0x3dd159['limit']===_0xe560('0x20');var _0xb7dbfc=_0x5162aa['count'];var _0x372ffb=_0x30602c?0x0:_0x3dd159[_0xe560('0x1f')];var _0x46c28e=_0x30602c?_0x5162aa[_0xe560('0x21')]:_0x3dd159[_0xe560('0x1f')]+_0x3dd159[_0xe560('0x22')];var _0x26735d;if(_0x46c28e>=_0xb7dbfc){_0x46c28e=_0xb7dbfc;_0x26735d=0xc8;}else{_0x26735d=0xce;}_0x2c4338['status'](_0x26735d);return _0x2c4338[_0xe560('0x23')](_0xe560('0x24'),_0x372ffb+'-'+_0x46c28e+'/'+_0xb7dbfc)['json'](_0x5162aa);}return null;};}function patchUpdates(_0x3b9c5d){return function(_0x1bc425){try{jsonpatch['apply'](_0x1bc425,_0x3b9c5d,!![]);}catch(_0x4cf458){return BPromise[_0xe560('0x25')](_0x4cf458);}return _0x1bc425[_0xe560('0x26')]();};}function saveUpdates(_0x224dc0,_0x558171){return function(_0x3c1741){if(_0x3c1741){return _0x3c1741[_0xe560('0x27')](_0x224dc0)[_0xe560('0x28')](function(_0x1aa65b){return _0x1aa65b;});}return null;};}function removeEntity(_0x55448e,_0x2f7c84){return function(_0x5cc562){if(_0x5cc562){return _0x5cc562[_0xe560('0x29')]()[_0xe560('0x28')](function(){_0x55448e['status'](0xcc)[_0xe560('0x1c')]();});}};}function handleEntityNotFound(_0x4e03c0,_0x384977){return function(_0x323722){if(!_0x323722){_0x4e03c0['sendStatus'](0x194);}return _0x323722;};}function handleError(_0x48ea46,_0x4c1b47){_0x4c1b47=_0x4c1b47||0x1f4;return function(_0x13cc66){logger[_0xe560('0x2a')](_0x13cc66[_0xe560('0x2b')]);if(_0x13cc66[_0xe560('0x2c')]){delete _0x13cc66[_0xe560('0x2c')];}_0x48ea46[_0xe560('0x1d')](_0x4c1b47)[_0xe560('0x2d')](_0x13cc66);};}exports[_0xe560('0x2e')]=function(_0x21c61e,_0x18691c){var _0x41a838={},_0x4eae5e={},_0x4af59c={'count':0x0,'rows':[]};var _0x5d2c71=_[_0xe560('0x2f')](db['SquareRecording'][_0xe560('0x30')],function(_0x5090e6){return{'name':_0x5090e6['fieldName'],'type':_0x5090e6[_0xe560('0x31')][_0xe560('0x32')]};});_0x4eae5e['model']=_[_0xe560('0x2f')](_0x5d2c71,_0xe560('0x2c'));_0x4eae5e[_0xe560('0x33')]=_[_0xe560('0x34')](_0x21c61e[_0xe560('0x33')]);_0x4eae5e['filters']=_[_0xe560('0x35')](_0x4eae5e[_0xe560('0x36')],_0x4eae5e['query']);_0x41a838[_0xe560('0x37')]=_['intersection'](_0x4eae5e[_0xe560('0x36')],qs[_0xe560('0x38')](_0x21c61e[_0xe560('0x33')][_0xe560('0x38')]));_0x41a838[_0xe560('0x37')]=_0x41a838[_0xe560('0x37')]['length']?_0x41a838['attributes']:_0x4eae5e[_0xe560('0x36')];if(!_0x21c61e[_0xe560('0x33')]['hasOwnProperty'](_0xe560('0x39'))){_0x41a838[_0xe560('0x22')]=qs[_0xe560('0x22')](_0x21c61e[_0xe560('0x33')][_0xe560('0x22')]);_0x41a838['offset']=qs['offset'](_0x21c61e[_0xe560('0x33')][_0xe560('0x1f')]);}_0x41a838[_0xe560('0x3a')]=qs[_0xe560('0x3b')](_0x21c61e['query']['sort']);_0x41a838[_0xe560('0x3c')]=qs[_0xe560('0x3d')](_[_0xe560('0x3e')](_0x21c61e['query'],_0x4eae5e['filters']),_0x5d2c71);if(_0x21c61e[_0xe560('0x33')]['filter']){_0x41a838['where']=_['merge'](_0x41a838['where'],{'$or':_[_0xe560('0x2f')](_0x5d2c71,function(_0x3bfa0d){if(_0x3bfa0d[_0xe560('0x31')]!==_0xe560('0x3f')){var _0x1728a1={};_0x1728a1[_0x3bfa0d[_0xe560('0x2c')]]={'$like':'%'+_0x21c61e[_0xe560('0x33')][_0xe560('0x40')]+'%'};return _0x1728a1;}})});}_0x41a838=_[_0xe560('0x41')]({},_0x41a838,_0x21c61e[_0xe560('0x42')]);var _0x58050c={'where':_0x41a838[_0xe560('0x3c')]};return db[_0xe560('0x43')][_0xe560('0x21')](_0x58050c)['then'](function(_0x3837ca){_0x4af59c[_0xe560('0x21')]=_0x3837ca;if(_0x21c61e[_0xe560('0x33')][_0xe560('0x44')]){_0x41a838['include']=[{'all':!![]}];}return db[_0xe560('0x43')]['findAll'](_0x41a838);})[_0xe560('0x28')](function(_0x25d344){_0x4af59c[_0xe560('0x45')]=_0x25d344;return _0x4af59c;})[_0xe560('0x28')](respondWithFilteredResult(_0x18691c,_0x41a838))[_0xe560('0x46')](handleError(_0x18691c,null));};exports[_0xe560('0x47')]=function(_0xbd85e7,_0x5a99ec){var _0x5c2aa1={'raw':!![],'where':{'id':_0xbd85e7[_0xe560('0x48')]['id']}},_0x4e5863={};_0x4e5863[_0xe560('0x36')]=_[_0xe560('0x34')](db[_0xe560('0x43')]['rawAttributes']);_0x4e5863[_0xe560('0x33')]=_['keys'](_0xbd85e7[_0xe560('0x33')]);_0x4e5863[_0xe560('0x3d')]=_['intersection'](_0x4e5863[_0xe560('0x36')],_0x4e5863[_0xe560('0x33')]);_0x5c2aa1[_0xe560('0x37')]=_['intersection'](_0x4e5863[_0xe560('0x36')],qs['fields'](_0xbd85e7['query'][_0xe560('0x38')]));_0x5c2aa1['attributes']=_0x5c2aa1[_0xe560('0x37')]['length']?_0x5c2aa1['attributes']:_0x4e5863[_0xe560('0x36')];if(_0xbd85e7[_0xe560('0x33')]['includeAll']){_0x5c2aa1[_0xe560('0x49')]=[{'all':!![]}];}_0x5c2aa1=_[_0xe560('0x41')]({},_0x5c2aa1,_0xbd85e7[_0xe560('0x42')]);return db[_0xe560('0x43')][_0xe560('0x4a')](_0x5c2aa1)['then'](handleEntityNotFound(_0x5a99ec,null))[_0xe560('0x28')](respondWithResult(_0x5a99ec,null))[_0xe560('0x46')](handleError(_0x5a99ec,null));};exports[_0xe560('0x4b')]=function(_0x5612a6,_0x3f16c4){return db[_0xe560('0x43')][_0xe560('0x4b')](_0x5612a6[_0xe560('0x4c')],{})[_0xe560('0x28')](respondWithResult(_0x3f16c4,0xc9))[_0xe560('0x46')](handleError(_0x3f16c4,null));};exports[_0xe560('0x27')]=function(_0x4ac6ad,_0x571403){if(_0x4ac6ad['body']['id']){delete _0x4ac6ad['body']['id'];}return db[_0xe560('0x43')][_0xe560('0x4a')]({'where':{'id':_0x4ac6ad['params']['id']}})[_0xe560('0x28')](handleEntityNotFound(_0x571403,null))[_0xe560('0x28')](saveUpdates(_0x4ac6ad[_0xe560('0x4c')],null))[_0xe560('0x28')](respondWithResult(_0x571403,null))[_0xe560('0x46')](handleError(_0x571403,null));};exports[_0xe560('0x4d')]=function(_0x53bdf6,_0x372d6f,_0x4e4309){var _0xb180c7=require(_0xe560('0x4e'));var _0x23ab4a=![];var _0x5a9330={};if(_0x53bdf6[_0xe560('0x33')][_0xe560('0x31')]&&_0x53bdf6[_0xe560('0x33')][_0xe560('0x31')]===_0xe560('0x4f')){_0x5a9330[_0xe560('0x4f')]=_0x53bdf6['params']['id'];}else{_0x5a9330['id']=_0x53bdf6[_0xe560('0x48')]['id'];}return db[_0xe560('0x43')][_0xe560('0x4a')]({'where':_0x5a9330,'attributes':['id','savePath','filename'],'raw':!![]})[_0xe560('0x28')](handleEntityNotFound(_0x372d6f,null))[_0xe560('0x28')](function(_0x3555eb){if(_0x3555eb){var _0x1307dd=_0x3555eb[_0xe560('0x50')];var _0x57d546=util[_0xe560('0x51')]('%s.cypher',_0x1307dd);if(fs[_0xe560('0x52')](_0x57d546)){_0x23ab4a=!![];return _0xb180c7[_0xe560('0x53')](_0x57d546,_0x1307dd,config['secrets']['recording'])['then'](function(){return _0x3555eb;});}return _0x3555eb;}})[_0xe560('0x28')](function(_0x413167){if(_0x413167){var _0x54a099=_0x413167[_0xe560('0x50')];if(!fs['existsSync'](_0x54a099)){throw new db[(_0xe560('0x54'))]['ValidationError'](_0xe560('0x55'));}if(_0x413167[_0xe560('0x56')]){return _0x372d6f[_0xe560('0x4d')](_0x54a099,_0x413167['filename']+path['extname'](_0x54a099),function(){if(_0x23ab4a){fs[_0xe560('0x57')](_0x54a099);}});}else{return _0x372d6f[_0xe560('0x4d')](_0x54a099,function(_0x31102e){if(_0x23ab4a){fs['unlink'](_0x54a099);}});}}})['catch'](function(_0x13c865){if(_0x13c865[_0xe560('0x58')]===_0xe560('0x55')){_0x372d6f[_0xe560('0x1d')](0x194)[_0xe560('0x2d')]('Not\x20found');}else{return handleError(_0x372d6f,null);}});};exports[_0xe560('0x29')]=function(_0x12ddfb,_0x312300){return db[_0xe560('0x43')][_0xe560('0x4a')]({'where':{'id':_0x12ddfb[_0xe560('0x48')]['id']}})[_0xe560('0x28')](function(_0x1d31c1){if(_[_0xe560('0x59')](_0x1d31c1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1d31c1;})[_0xe560('0x28')](function(_0x43e96b){var _0x53879e=_0x43e96b[_0xe560('0x50')];logger['info'](_0xe560('0x5a'),_0x53879e);if(!_['isNil'](_0x43e96b[_0xe560('0x50')])&&fs[_0xe560('0x52')](_0x53879e)){logger[_0xe560('0x5b')]('File:\x20\x22'+_0x53879e+_0xe560('0x5c'));fs[_0xe560('0x5d')](_0x53879e);}_0x53879e=_0x53879e+_0xe560('0x5e');if(!_[_0xe560('0x59')](_0x43e96b[_0xe560('0x50')])&&fs['existsSync'](_0x53879e)){logger['info'](_0xe560('0x5f')+_0x53879e+_0xe560('0x5c'));fs[_0xe560('0x5d')](_0x53879e);}return _0x43e96b;})['then'](function(_0x1bfb6f){if(!_0x1bfb6f)throw new InternalError();return _0x1bfb6f[_0xe560('0x29')]();})[_0xe560('0x28')](function(){_0x312300[_0xe560('0x1d')](0xcc)[_0xe560('0x1c')]();})[_0xe560('0x46')](handleError(_0x312300,null));}; \ No newline at end of file +var _0x49a8=['filters','pick','filter','merge','VIRTUAL','includeAll','include','SquareRecording','findAll','rows','catch','show','params','rawAttributes','keys','options','find','create','body','download','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','save','destroy','then','error','stack','name','send','index','map','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x49a8,0x13f));var _0x849a=function(_0xe8e2f5,_0xd84b9f){_0xe8e2f5=_0xe8e2f5-0x0;var _0x162e2b=_0x49a8[_0xe8e2f5];return _0x162e2b;};'use strict';var emlformat=require(_0x849a('0x0'));var rimraf=require(_0x849a('0x1'));var zipdir=require(_0x849a('0x2'));var jsonpatch=require(_0x849a('0x3'));var rp=require(_0x849a('0x4'));var moment=require(_0x849a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x849a('0x6'));var util=require(_0x849a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x849a('0x8'));var ejs=require(_0x849a('0x9'));var fs=require('fs');var fs_extra=require(_0x849a('0xa'));var _=require(_0x849a('0xb'));var squel=require(_0x849a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x849a('0x8'));var querystring=require(_0x849a('0xd'));var Papa=require(_0x849a('0xe'));var Redis=require(_0x849a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x849a('0x10'));var as=require(_0x849a('0x11'));var hardwareService=require(_0x849a('0x12'));var logger=require(_0x849a('0x13'))(_0x849a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x849a('0x15'));var db=require(_0x849a('0x16'))['db'];function respondWithStatusCode(_0x12f426,_0x5c98fe){_0x5c98fe=_0x5c98fe||0xcc;return function(_0x44cbce){if(_0x44cbce){return _0x12f426[_0x849a('0x17')](_0x5c98fe);}return _0x12f426[_0x849a('0x18')](_0x5c98fe)[_0x849a('0x19')]();};}function respondWithResult(_0x596588,_0x5ceaea){_0x5ceaea=_0x5ceaea||0xc8;return function(_0x4778df){if(_0x4778df){return _0x596588[_0x849a('0x18')](_0x5ceaea)[_0x849a('0x1a')](_0x4778df);}};}function respondWithFilteredResult(_0x3d5f0a,_0x1cca72){return function(_0x16f778){if(_0x16f778){var _0x5c286d=typeof _0x1cca72[_0x849a('0x1b')]==='undefined'&&typeof _0x1cca72[_0x849a('0x1c')]==='undefined';var _0x100334=_0x16f778[_0x849a('0x1d')];var _0x450380=_0x5c286d?0x0:_0x1cca72['offset'];var _0x4f9824=_0x5c286d?_0x16f778[_0x849a('0x1d')]:_0x1cca72[_0x849a('0x1b')]+_0x1cca72[_0x849a('0x1c')];var _0xdde1a;if(_0x4f9824>=_0x100334){_0x4f9824=_0x100334;_0xdde1a=0xc8;}else{_0xdde1a=0xce;}_0x3d5f0a['status'](_0xdde1a);return _0x3d5f0a[_0x849a('0x1e')]('Content-Range',_0x450380+'-'+_0x4f9824+'/'+_0x100334)[_0x849a('0x1a')](_0x16f778);}return null;};}function patchUpdates(_0x43cfde){return function(_0x4d18e1){try{jsonpatch[_0x849a('0x1f')](_0x4d18e1,_0x43cfde,!![]);}catch(_0x3fe09a){return BPromise['reject'](_0x3fe09a);}return _0x4d18e1[_0x849a('0x20')]();};}function saveUpdates(_0x1092fb,_0x3c5f47){return function(_0x6a50aa){if(_0x6a50aa){return _0x6a50aa['update'](_0x1092fb)['then'](function(_0xd98a7f){return _0xd98a7f;});}return null;};}function removeEntity(_0x5c4f69,_0xb14fae){return function(_0x101038){if(_0x101038){return _0x101038[_0x849a('0x21')]()[_0x849a('0x22')](function(){_0x5c4f69[_0x849a('0x18')](0xcc)[_0x849a('0x19')]();});}};}function handleEntityNotFound(_0x35f65d,_0x395c7e){return function(_0x229a34){if(!_0x229a34){_0x35f65d['sendStatus'](0x194);}return _0x229a34;};}function handleError(_0x5750ad,_0x1c1753){_0x1c1753=_0x1c1753||0x1f4;return function(_0x456e32){logger[_0x849a('0x23')](_0x456e32[_0x849a('0x24')]);if(_0x456e32[_0x849a('0x25')]){delete _0x456e32['name'];}_0x5750ad[_0x849a('0x18')](_0x1c1753)[_0x849a('0x26')](_0x456e32);};}exports[_0x849a('0x27')]=function(_0x3c025e,_0x276cee){var _0x5691c1={},_0x49ed48={},_0x4d2eac={'count':0x0,'rows':[]};var _0x283a1a=_[_0x849a('0x28')](db['SquareRecording']['rawAttributes'],function(_0x19a20b){return{'name':_0x19a20b[_0x849a('0x29')],'type':_0x19a20b[_0x849a('0x2a')]['key']};});_0x49ed48[_0x849a('0x2b')]=_[_0x849a('0x28')](_0x283a1a,_0x849a('0x25'));_0x49ed48[_0x849a('0x2c')]=_['keys'](_0x3c025e['query']);_0x49ed48['filters']=_[_0x849a('0x2d')](_0x49ed48[_0x849a('0x2b')],_0x49ed48[_0x849a('0x2c')]);_0x5691c1[_0x849a('0x2e')]=_[_0x849a('0x2d')](_0x49ed48['model'],qs[_0x849a('0x2f')](_0x3c025e[_0x849a('0x2c')]['fields']));_0x5691c1[_0x849a('0x2e')]=_0x5691c1[_0x849a('0x2e')][_0x849a('0x30')]?_0x5691c1[_0x849a('0x2e')]:_0x49ed48[_0x849a('0x2b')];if(!_0x3c025e['query'][_0x849a('0x31')](_0x849a('0x32'))){_0x5691c1[_0x849a('0x1c')]=qs[_0x849a('0x1c')](_0x3c025e[_0x849a('0x2c')]['limit']);_0x5691c1[_0x849a('0x1b')]=qs[_0x849a('0x1b')](_0x3c025e[_0x849a('0x2c')]['offset']);}_0x5691c1['order']=qs[_0x849a('0x33')](_0x3c025e[_0x849a('0x2c')][_0x849a('0x33')]);_0x5691c1[_0x849a('0x34')]=qs[_0x849a('0x35')](_[_0x849a('0x36')](_0x3c025e[_0x849a('0x2c')],_0x49ed48[_0x849a('0x35')]),_0x283a1a);if(_0x3c025e['query'][_0x849a('0x37')]){_0x5691c1['where']=_[_0x849a('0x38')](_0x5691c1[_0x849a('0x34')],{'$or':_[_0x849a('0x28')](_0x283a1a,function(_0x4c0f98){if(_0x4c0f98['type']!==_0x849a('0x39')){var _0x1d7a58={};_0x1d7a58[_0x4c0f98[_0x849a('0x25')]]={'$like':'%'+_0x3c025e['query'][_0x849a('0x37')]+'%'};return _0x1d7a58;}})});}_0x5691c1=_[_0x849a('0x38')]({},_0x5691c1,_0x3c025e['options']);var _0xe052={'where':_0x5691c1[_0x849a('0x34')]};return db['SquareRecording'][_0x849a('0x1d')](_0xe052)[_0x849a('0x22')](function(_0x10a147){_0x4d2eac[_0x849a('0x1d')]=_0x10a147;if(_0x3c025e[_0x849a('0x2c')][_0x849a('0x3a')]){_0x5691c1[_0x849a('0x3b')]=[{'all':!![]}];}return db[_0x849a('0x3c')][_0x849a('0x3d')](_0x5691c1);})[_0x849a('0x22')](function(_0xc779c0){_0x4d2eac[_0x849a('0x3e')]=_0xc779c0;return _0x4d2eac;})[_0x849a('0x22')](respondWithFilteredResult(_0x276cee,_0x5691c1))[_0x849a('0x3f')](handleError(_0x276cee,null));};exports[_0x849a('0x40')]=function(_0x58b93b,_0x482069){var _0x397305={'raw':!![],'where':{'id':_0x58b93b[_0x849a('0x41')]['id']}},_0x172be7={};_0x172be7[_0x849a('0x2b')]=_['keys'](db[_0x849a('0x3c')][_0x849a('0x42')]);_0x172be7['query']=_[_0x849a('0x43')](_0x58b93b[_0x849a('0x2c')]);_0x172be7[_0x849a('0x35')]=_['intersection'](_0x172be7[_0x849a('0x2b')],_0x172be7['query']);_0x397305[_0x849a('0x2e')]=_[_0x849a('0x2d')](_0x172be7[_0x849a('0x2b')],qs[_0x849a('0x2f')](_0x58b93b[_0x849a('0x2c')][_0x849a('0x2f')]));_0x397305[_0x849a('0x2e')]=_0x397305[_0x849a('0x2e')][_0x849a('0x30')]?_0x397305[_0x849a('0x2e')]:_0x172be7[_0x849a('0x2b')];if(_0x58b93b[_0x849a('0x2c')][_0x849a('0x3a')]){_0x397305[_0x849a('0x3b')]=[{'all':!![]}];}_0x397305=_[_0x849a('0x38')]({},_0x397305,_0x58b93b[_0x849a('0x44')]);return db[_0x849a('0x3c')][_0x849a('0x45')](_0x397305)['then'](handleEntityNotFound(_0x482069,null))[_0x849a('0x22')](respondWithResult(_0x482069,null))[_0x849a('0x3f')](handleError(_0x482069,null));};exports[_0x849a('0x46')]=function(_0x51afe2,_0x5a6589){return db[_0x849a('0x3c')][_0x849a('0x46')](_0x51afe2['body'],{})[_0x849a('0x22')](respondWithResult(_0x5a6589,0xc9))[_0x849a('0x3f')](handleError(_0x5a6589,null));};exports['update']=function(_0xd4e478,_0x5851ed){if(_0xd4e478[_0x849a('0x47')]['id']){delete _0xd4e478['body']['id'];}return db[_0x849a('0x3c')]['find']({'where':{'id':_0xd4e478[_0x849a('0x41')]['id']}})[_0x849a('0x22')](handleEntityNotFound(_0x5851ed,null))['then'](saveUpdates(_0xd4e478[_0x849a('0x47')],null))[_0x849a('0x22')](respondWithResult(_0x5851ed,null))[_0x849a('0x3f')](handleError(_0x5851ed,null));};exports[_0x849a('0x48')]=function(_0x334daf,_0x8b754c,_0x562c1a){var _0x371685=require('../../components/encryptor');var _0x166618=![];var _0x105564={};if(_0x334daf['query'][_0x849a('0x2a')]&&_0x334daf[_0x849a('0x2c')]['type']===_0x849a('0x49')){_0x105564[_0x849a('0x49')]=_0x334daf['params']['id'];}else{_0x105564['id']=_0x334daf[_0x849a('0x41')]['id'];}return db[_0x849a('0x3c')][_0x849a('0x45')]({'where':_0x105564,'attributes':['id',_0x849a('0x4a'),_0x849a('0x4b')],'raw':!![]})[_0x849a('0x22')](handleEntityNotFound(_0x8b754c,null))[_0x849a('0x22')](function(_0x15caa6){if(_0x15caa6){var _0x5cda27=_0x15caa6[_0x849a('0x4a')];var _0x2e7bf3=util[_0x849a('0x4c')]('%s.cypher',_0x5cda27);if(fs[_0x849a('0x4d')](_0x2e7bf3)){_0x166618=!![];return _0x371685[_0x849a('0x4e')](_0x2e7bf3,_0x5cda27,config[_0x849a('0x4f')]['recording'])[_0x849a('0x22')](function(){return _0x15caa6;});}return _0x15caa6;}})['then'](function(_0x2e1c34){if(_0x2e1c34){var _0x33ed39=_0x2e1c34['savePath'];if(!fs[_0x849a('0x4d')](_0x33ed39)){throw new db[(_0x849a('0x50'))][(_0x849a('0x51'))]('SquareRecording\x20not\x20found');}if(_0x2e1c34[_0x849a('0x4b')]){return _0x8b754c[_0x849a('0x48')](_0x33ed39,_0x2e1c34[_0x849a('0x4b')]+path[_0x849a('0x52')](_0x33ed39),function(){if(_0x166618){fs['unlink'](_0x33ed39);}});}else{return _0x8b754c['download'](_0x33ed39,function(_0x31cd91){if(_0x166618){fs[_0x849a('0x53')](_0x33ed39);}});}}})[_0x849a('0x3f')](function(_0xf0d667){if(_0xf0d667[_0x849a('0x54')]===_0x849a('0x55')){_0x8b754c['status'](0x194)[_0x849a('0x26')](_0x849a('0x56'));}else{return handleError(_0x8b754c,null);}});};exports[_0x849a('0x21')]=function(_0x994f66,_0x4a8e7f){return db[_0x849a('0x3c')][_0x849a('0x45')]({'where':{'id':_0x994f66[_0x849a('0x41')]['id']}})[_0x849a('0x22')](function(_0x5782c7){if(_[_0x849a('0x57')](_0x5782c7)){throw new ReferenceError(_0x849a('0x58'));}return _0x5782c7;})[_0x849a('0x22')](function(_0x2d077c){var _0x1e7111=_0x2d077c['savePath'];logger[_0x849a('0x59')](_0x849a('0x5a'),_0x1e7111);if(!_[_0x849a('0x57')](_0x2d077c[_0x849a('0x4a')])&&fs['existsSync'](_0x1e7111)){logger[_0x849a('0x59')](_0x849a('0x5b')+_0x1e7111+_0x849a('0x5c'));fs['unlinkSync'](_0x1e7111);}_0x1e7111=_0x1e7111+'.cypher';if(!_[_0x849a('0x57')](_0x2d077c[_0x849a('0x4a')])&&fs[_0x849a('0x4d')](_0x1e7111)){logger[_0x849a('0x59')](_0x849a('0x5b')+_0x1e7111+_0x849a('0x5c'));fs['unlinkSync'](_0x1e7111);}return _0x2d077c;})[_0x849a('0x22')](function(_0x5aa83e){if(!_0x5aa83e)throw new InternalError();return _0x5aa83e[_0x849a('0x21')]();})[_0x849a('0x22')](function(){_0x4a8e7f['status'](0xcc)[_0x849a('0x19')]();})[_0x849a('0x3f')](handleError(_0x4a8e7f,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 497ea1b..e08620a 100644 --- a/server/api/squareRecording/squareRecording.model.js +++ b/server/api/squareRecording/squareRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00cd=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings','lodash','util'];(function(_0xaad26d,_0x243c1e){var _0x4ec627=function(_0x5b73f4){while(--_0x5b73f4){_0xaad26d['push'](_0xaad26d['shift']());}};_0x4ec627(++_0x243c1e);}(_0x00cd,0xee));var _0xd00c=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x00cd[_0x2bda14];return _0xb5dd49;};'use strict';var _=require(_0xd00c('0x0'));var util=require(_0xd00c('0x1'));var logger=require(_0xd00c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd00c('0x3'));var rp=require(_0xd00c('0x4'));var fs=require('fs');var path=require(_0xd00c('0x5'));var rimraf=require(_0xd00c('0x6'));var config=require(_0xd00c('0x7'));var attributes=require('./squareRecording.attributes');module[_0xd00c('0x8')]=function(_0xbeac62,_0x2eb6ca){return _0xbeac62[_0xd00c('0x9')](_0xd00c('0xa'),attributes,{'tableName':_0xd00c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1751=['../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1fafff,_0x47783e){var _0x4c4332=function(_0x1f43e7){while(--_0x1f43e7){_0x1fafff['push'](_0x1fafff['shift']());}};_0x4c4332(++_0x47783e);}(_0x1751,0x76));var _0x1175=function(_0x52301d,_0x43e269){_0x52301d=_0x52301d-0x0;var _0xe2c669=_0x1751[_0x52301d];return _0xe2c669;};'use strict';var _=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var logger=require(_0x1175('0x2'))(_0x1175('0x3'));var moment=require('moment');var BPromise=require(_0x1175('0x4'));var rp=require(_0x1175('0x5'));var fs=require('fs');var path=require(_0x1175('0x6'));var rimraf=require(_0x1175('0x7'));var config=require(_0x1175('0x8'));var attributes=require(_0x1175('0x9'));module[_0x1175('0xa')]=function(_0x171756,_0x3f99ca){return _0x171756[_0x1175('0xb')](_0x1175('0xc'),attributes,{'tableName':_0x1175('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index d5eefc1..3dbe558 100644 --- a/server/api/squareRecording/squareRecording.rpc.js +++ b/server/api/squareRecording/squareRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x258a=['request','then','info','SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','http'];(function(_0x9f9ebf,_0x1d1c66){var _0x5e867c=function(_0x5e05db){while(--_0x5e05db){_0x9f9ebf['push'](_0x9f9ebf['shift']());}};_0x5e867c(++_0x1d1c66);}(_0x258a,0x1d8));var _0xa258=function(_0x329a57,_0x275ab9){_0x329a57=_0x329a57-0x0;var _0x2d4a28=_0x258a[_0x329a57];return _0x2d4a28;};'use strict';var _=require(_0xa258('0x0'));var util=require(_0xa258('0x1'));var moment=require(_0xa258('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa258('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa258('0x4'));var logger=require('../../config/logger')(_0xa258('0x5'));var config=require(_0xa258('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa258('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x283ff7,_0x19652f,_0x52a6a3){return new BPromise(function(_0x41f60b,_0x59e1cd){return client[_0xa258('0x8')](_0x283ff7,_0x52a6a3)[_0xa258('0x9')](function(_0x34c414){logger[_0xa258('0xa')](_0xa258('0xb'),_0x19652f,'request\x20sent');logger['debug'](_0xa258('0xc'),_0x19652f,_0xa258('0xd'),JSON['stringify'](_0x34c414));if(_0x34c414['error']){if(_0x34c414[_0xa258('0xe')]['code']===0x1f4){logger['error'](_0xa258('0xb'),_0x19652f,_0x34c414[_0xa258('0xe')]['message']);return _0x59e1cd(_0x34c414[_0xa258('0xe')][_0xa258('0xf')]);}logger['error'](_0xa258('0xb'),_0x19652f,_0x34c414[_0xa258('0xe')][_0xa258('0xf')]);return _0x41f60b(_0x34c414[_0xa258('0xe')][_0xa258('0xf')]);}else{logger[_0xa258('0xa')](_0xa258('0xb'),_0x19652f,_0xa258('0xd'));_0x41f60b(_0x34c414[_0xa258('0x10')][_0xa258('0xf')]);}})[_0xa258('0x11')](function(_0x813ca2){logger[_0xa258('0xe')]('SquareRecording,\x20%s,\x20%s',_0x19652f,_0x813ca2);_0x59e1cd(_0x813ca2);});});}exports[_0xa258('0x12')]=function(_0x5ce749){var _0x211843=this;return new Promise(function(_0x1e680c,_0x4bf357){return db[_0xa258('0x13')][_0xa258('0x14')](_0x5ce749[_0xa258('0x15')],{'raw':_0x5ce749[_0xa258('0x16')]?_0x5ce749[_0xa258('0x16')][_0xa258('0x17')]===undefined?!![]:![]:!![]})[_0xa258('0x9')](function(_0x3d0916){logger[_0xa258('0xa')](_0xa258('0x12'),_0x5ce749);logger['debug'](_0xa258('0x12'),_0x5ce749,JSON['stringify'](_0x3d0916));_0x1e680c(_0x3d0916);})[_0xa258('0x11')](function(_0x3c4a72){logger[_0xa258('0xe')]('CreateSquareRecording',_0x3c4a72[_0xa258('0xf')],_0x5ce749);_0x4bf357(_0x211843[_0xa258('0xe')](0x1f4,_0x3c4a72[_0xa258('0xf')]));});});}; \ No newline at end of file +var _0xc358=['then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','CreateSquareRecording','SquareRecording','create','body','options','raw','catch','util','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x1d8d01,_0xdc4a05){var _0x311e40=function(_0x5f093f){while(--_0x5f093f){_0x1d8d01['push'](_0x1d8d01['shift']());}};_0x311e40(++_0xdc4a05);}(_0xc358,0x1f4));var _0x8c35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc358[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8c35('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c35('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c35('0x2'))(_0x8c35('0x3'));var config=require(_0x8c35('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8c35('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18ef96,_0x16a961,_0x4a5fd0){return new BPromise(function(_0x516aa3,_0x4bc85c){return client['request'](_0x18ef96,_0x4a5fd0)[_0x8c35('0x6')](function(_0x547962){logger[_0x8c35('0x7')](_0x8c35('0x8'),_0x16a961,'request\x20sent');logger[_0x8c35('0x9')](_0x8c35('0xa'),_0x16a961,'request\x20sent',JSON[_0x8c35('0xb')](_0x547962));if(_0x547962[_0x8c35('0xc')]){if(_0x547962[_0x8c35('0xc')]['code']===0x1f4){logger['error'](_0x8c35('0x8'),_0x16a961,_0x547962[_0x8c35('0xc')]['message']);return _0x4bc85c(_0x547962[_0x8c35('0xc')][_0x8c35('0xd')]);}logger[_0x8c35('0xc')](_0x8c35('0x8'),_0x16a961,_0x547962[_0x8c35('0xc')]['message']);return _0x516aa3(_0x547962[_0x8c35('0xc')]['message']);}else{logger[_0x8c35('0x7')](_0x8c35('0x8'),_0x16a961,_0x8c35('0xe'));_0x516aa3(_0x547962[_0x8c35('0xf')]['message']);}})['catch'](function(_0x3ce542){logger['error'](_0x8c35('0x8'),_0x16a961,_0x3ce542);_0x4bc85c(_0x3ce542);});});}exports[_0x8c35('0x10')]=function(_0x37b38f){var _0x2be3a=this;return new Promise(function(_0x36a9c9,_0x2863f6){return db[_0x8c35('0x11')][_0x8c35('0x12')](_0x37b38f[_0x8c35('0x13')],{'raw':_0x37b38f['options']?_0x37b38f[_0x8c35('0x14')][_0x8c35('0x15')]===undefined?!![]:![]:!![]})[_0x8c35('0x6')](function(_0x16121c){logger[_0x8c35('0x7')](_0x8c35('0x10'),_0x37b38f);logger[_0x8c35('0x9')](_0x8c35('0x10'),_0x37b38f,JSON[_0x8c35('0xb')](_0x16121c));_0x36a9c9(_0x16121c);})[_0x8c35('0x16')](function(_0x5544be){logger['error']('CreateSquareRecording',_0x5544be[_0x8c35('0xd')],_0x37b38f);_0x2863f6(_0x2be3a[_0x8c35('0xc')](0x1f4,_0x5544be[_0x8c35('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index f3bbc2c..11635b1 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x436540,_0x2655d8){var _0x4fb5cb=function(_0x400758){while(--_0x400758){_0x436540['push'](_0x436540['shift']());}};_0x4fb5cb(++_0x2655d8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x38750a,_0x316de4){var _0x92e34a=function(_0x4f83e1){while(--_0x4f83e1){_0x38750a['push'](_0x38750a['shift']());}};_0x92e34a(++_0x316de4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 5559f12..8773f4a 100644 --- a/server/api/squareReport/squareReport.attributes.js +++ b/server/api/squareReport/squareReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9285=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x95e7d4,_0x2ef58b){var _0x2c9559=function(_0x2de6b8){while(--_0x2de6b8){_0x95e7d4['push'](_0x95e7d4['shift']());}};_0x2c9559(++_0x2ef58b);}(_0x9285,0x1a0));var _0x5928=function(_0x3ad540,_0x151f19){_0x3ad540=_0x3ad540-0x0;var _0x2f6a43=_0x9285[_0x3ad540];return _0x2f6a43;};'use strict';var Sequelize=require(_0x5928('0x0'));module[_0x5928('0x1')]={'network':{'type':Sequelize[_0x5928('0x2')]},'network_script':{'type':Sequelize[_0x5928('0x2')]},'request':{'type':Sequelize[_0x5928('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5928('0x2')]},'uniqueid':{'type':Sequelize[_0x5928('0x2')]},'version':{'type':Sequelize[_0x5928('0x2')]},'callerid':{'type':Sequelize[_0x5928('0x2')]},'calleridname':{'type':Sequelize[_0x5928('0x2')]},'callingpres':{'type':Sequelize[_0x5928('0x2')]},'callingani2':{'type':Sequelize[_0x5928('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x5928('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5928('0x2')]},'enhanced':{'type':Sequelize[_0x5928('0x2')]},'accountcode':{'type':Sequelize[_0x5928('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x5928('0x2')]},'joinAt':{'type':Sequelize[_0x5928('0x3')]},'leaveAt':{'type':Sequelize[_0x5928('0x3')]},'bot':{'type':Sequelize[_0x5928('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x31c8=['exports','STRING','DATE','sequelize'];(function(_0x4e1211,_0x1c0e26){var _0x4ae887=function(_0x6e55ff){while(--_0x6e55ff){_0x4e1211['push'](_0x4e1211['shift']());}};_0x4ae887(++_0x1c0e26);}(_0x31c8,0xf3));var _0x831c=function(_0x478e34,_0x4960b4){_0x478e34=_0x478e34-0x0;var _0x2d96f0=_0x31c8[_0x478e34];return _0x2d96f0;};'use strict';var Sequelize=require(_0x831c('0x0'));module[_0x831c('0x1')]={'network':{'type':Sequelize[_0x831c('0x2')]},'network_script':{'type':Sequelize[_0x831c('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x831c('0x2')]},'language':{'type':Sequelize[_0x831c('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x831c('0x2')]},'version':{'type':Sequelize[_0x831c('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x831c('0x2')]},'callingpres':{'type':Sequelize[_0x831c('0x2')]},'callingani2':{'type':Sequelize[_0x831c('0x2')]},'callington':{'type':Sequelize[_0x831c('0x2')]},'callingtns':{'type':Sequelize[_0x831c('0x2')]},'dnid':{'type':Sequelize[_0x831c('0x2')]},'rdnis':{'type':Sequelize[_0x831c('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x831c('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x831c('0x2')]},'accountcode':{'type':Sequelize[_0x831c('0x2')]},'threadid':{'type':Sequelize[_0x831c('0x2')]},'project_name':{'type':Sequelize[_0x831c('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x831c('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index e9ca3dc..7806b36 100644 --- a/server/api/squareReport/squareReport.controller.js +++ b/server/api/squareReport/squareReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c32=['length','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','update','then','error','name','index','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params'];(function(_0x9f4501,_0x5ca332){var _0x5ebbe9=function(_0x234a83){while(--_0x234a83){_0x9f4501['push'](_0x9f4501['shift']());}};_0x5ebbe9(++_0x5ca332);}(_0x3c32,0x13a));var _0x23c3=function(_0x20934e,_0x559081){_0x20934e=_0x20934e-0x0;var _0x46fa95=_0x3c32[_0x20934e];return _0x46fa95;};'use strict';var emlformat=require(_0x23c3('0x0'));var rimraf=require(_0x23c3('0x1'));var zipdir=require(_0x23c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23c3('0x3'));var moment=require(_0x23c3('0x4'));var BPromise=require(_0x23c3('0x5'));var Mustache=require(_0x23c3('0x6'));var util=require(_0x23c3('0x7'));var path=require(_0x23c3('0x8'));var sox=require(_0x23c3('0x9'));var csv=require('to-csv');var ejs=require(_0x23c3('0xa'));var fs=require('fs');var fs_extra=require(_0x23c3('0xb'));var _=require(_0x23c3('0xc'));var squel=require(_0x23c3('0xd'));var crypto=require(_0x23c3('0xe'));var jsforce=require(_0x23c3('0xf'));var deskjs=require(_0x23c3('0x10'));var toCsv=require(_0x23c3('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x23c3('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x23c3('0x13'));var hardwareService=require(_0x23c3('0x14'));var logger=require(_0x23c3('0x15'))(_0x23c3('0x16'));var utils=require(_0x23c3('0x17'));var config=require(_0x23c3('0x18'));var licenseUtil=require(_0x23c3('0x19'));var db=require(_0x23c3('0x1a'))['db'];function respondWithStatusCode(_0x513faa,_0x20b652){_0x20b652=_0x20b652||0xcc;return function(_0x48d5a9){if(_0x48d5a9){return _0x513faa[_0x23c3('0x1b')](_0x20b652);}return _0x513faa['status'](_0x20b652)[_0x23c3('0x1c')]();};}function respondWithResult(_0x361e25,_0x246c86){_0x246c86=_0x246c86||0xc8;return function(_0x1b892b){if(_0x1b892b){return _0x361e25['status'](_0x246c86)[_0x23c3('0x1d')](_0x1b892b);}};}function respondWithFilteredResult(_0x36ce54,_0x47c787){return function(_0x2f30ce){if(_0x2f30ce){var _0x7e3752=typeof _0x47c787[_0x23c3('0x1e')]===_0x23c3('0x1f')&&typeof _0x47c787[_0x23c3('0x20')]===_0x23c3('0x1f');var _0x228abe=_0x2f30ce[_0x23c3('0x21')];var _0x148dd7=_0x7e3752?0x0:_0x47c787[_0x23c3('0x1e')];var _0x364249=_0x7e3752?_0x2f30ce[_0x23c3('0x21')]:_0x47c787['offset']+_0x47c787['limit'];var _0x5f310f;if(_0x364249>=_0x228abe){_0x364249=_0x228abe;_0x5f310f=0xc8;}else{_0x5f310f=0xce;}_0x36ce54[_0x23c3('0x22')](_0x5f310f);return _0x36ce54[_0x23c3('0x23')]('Content-Range',_0x148dd7+'-'+_0x364249+'/'+_0x228abe)[_0x23c3('0x1d')](_0x2f30ce);}return null;};}function patchUpdates(_0x1820d3){return function(_0x28ab28){try{jsonpatch[_0x23c3('0x24')](_0x28ab28,_0x1820d3,!![]);}catch(_0x243872){return BPromise[_0x23c3('0x25')](_0x243872);}return _0x28ab28['save']();};}function saveUpdates(_0x2e2ff6,_0x30905b){return function(_0x5512af){if(_0x5512af){return _0x5512af[_0x23c3('0x26')](_0x2e2ff6)['then'](function(_0x594533){return _0x594533;});}return null;};}function removeEntity(_0x386d13,_0x5eb18d){return function(_0x3fc7ed){if(_0x3fc7ed){return _0x3fc7ed['destroy']()[_0x23c3('0x27')](function(){_0x386d13[_0x23c3('0x22')](0xcc)[_0x23c3('0x1c')]();});}};}function handleEntityNotFound(_0x167a2a,_0x30c998){return function(_0x1db80f){if(!_0x1db80f){_0x167a2a[_0x23c3('0x1b')](0x194);}return _0x1db80f;};}function handleError(_0x4315d8,_0x105904){_0x105904=_0x105904||0x1f4;return function(_0x560d85){logger[_0x23c3('0x28')](_0x560d85['stack']);if(_0x560d85[_0x23c3('0x29')]){delete _0x560d85[_0x23c3('0x29')];}_0x4315d8['status'](_0x105904)['send'](_0x560d85);};}exports[_0x23c3('0x2a')]=function(_0xd39990,_0x4be5ab){var _0x23e947={},_0x2a77bc={},_0xae3d={'count':0x0,'rows':[]};var _0x579f11=_['map'](db[_0x23c3('0x2b')][_0x23c3('0x2c')],function(_0x5792eb){return{'name':_0x5792eb[_0x23c3('0x2d')],'type':_0x5792eb[_0x23c3('0x2e')][_0x23c3('0x2f')]};});_0x2a77bc[_0x23c3('0x30')]=_['map'](_0x579f11,_0x23c3('0x29'));_0x2a77bc[_0x23c3('0x31')]=_[_0x23c3('0x32')](_0xd39990[_0x23c3('0x31')]);_0x2a77bc['filters']=_[_0x23c3('0x33')](_0x2a77bc[_0x23c3('0x30')],_0x2a77bc[_0x23c3('0x31')]);_0x23e947['attributes']=_[_0x23c3('0x33')](_0x2a77bc[_0x23c3('0x30')],qs[_0x23c3('0x34')](_0xd39990[_0x23c3('0x31')][_0x23c3('0x34')]));_0x23e947['attributes']=_0x23e947[_0x23c3('0x35')]['length']?_0x23e947[_0x23c3('0x35')]:_0x2a77bc['model'];if(!_0xd39990['query'][_0x23c3('0x36')](_0x23c3('0x37'))){_0x23e947[_0x23c3('0x20')]=qs[_0x23c3('0x20')](_0xd39990[_0x23c3('0x31')]['limit']);_0x23e947['offset']=qs['offset'](_0xd39990[_0x23c3('0x31')][_0x23c3('0x1e')]);}_0x23e947[_0x23c3('0x38')]=qs[_0x23c3('0x39')](_0xd39990[_0x23c3('0x31')]['sort']);_0x23e947[_0x23c3('0x3a')]=qs[_0x23c3('0x3b')](_[_0x23c3('0x3c')](_0xd39990[_0x23c3('0x31')],_0x2a77bc[_0x23c3('0x3b')]),_0x579f11);if(_0xd39990[_0x23c3('0x31')][_0x23c3('0x3d')]){_0x23e947[_0x23c3('0x3a')]=_[_0x23c3('0x3e')](_0x23e947['where'],{'$or':_[_0x23c3('0x3f')](_0x579f11,function(_0x4f6953){if(_0x4f6953['type']!=='VIRTUAL'){var _0x568748={};_0x568748[_0x4f6953[_0x23c3('0x29')]]={'$like':'%'+_0xd39990[_0x23c3('0x31')][_0x23c3('0x3d')]+'%'};return _0x568748;}})});}_0x23e947=_[_0x23c3('0x3e')]({},_0x23e947,_0xd39990[_0x23c3('0x40')]);var _0xd29bf3={'where':_0x23e947[_0x23c3('0x3a')]};return db['SquareReport']['count'](_0xd29bf3)['then'](function(_0x288ab1){_0xae3d['count']=_0x288ab1;if(_0xd39990[_0x23c3('0x31')][_0x23c3('0x41')]){_0x23e947[_0x23c3('0x42')]=[{'all':!![]}];}return db[_0x23c3('0x2b')][_0x23c3('0x43')](_0x23e947);})[_0x23c3('0x27')](function(_0x16dc3d){_0xae3d['rows']=_0x16dc3d;return _0xae3d;})['then'](respondWithFilteredResult(_0x4be5ab,_0x23e947))[_0x23c3('0x44')](handleError(_0x4be5ab,null));};exports[_0x23c3('0x45')]=function(_0x3be18c,_0x41e003){var _0x5914d8={'raw':!![],'where':{'id':_0x3be18c[_0x23c3('0x46')]['id']}},_0x159dd5={};_0x159dd5[_0x23c3('0x30')]=_[_0x23c3('0x32')](db[_0x23c3('0x2b')]['rawAttributes']);_0x159dd5[_0x23c3('0x31')]=_[_0x23c3('0x32')](_0x3be18c[_0x23c3('0x31')]);_0x159dd5[_0x23c3('0x3b')]=_[_0x23c3('0x33')](_0x159dd5['model'],_0x159dd5[_0x23c3('0x31')]);_0x5914d8['attributes']=_[_0x23c3('0x33')](_0x159dd5[_0x23c3('0x30')],qs[_0x23c3('0x34')](_0x3be18c[_0x23c3('0x31')][_0x23c3('0x34')]));_0x5914d8[_0x23c3('0x35')]=_0x5914d8[_0x23c3('0x35')][_0x23c3('0x47')]?_0x5914d8[_0x23c3('0x35')]:_0x159dd5[_0x23c3('0x30')];if(_0x3be18c[_0x23c3('0x31')][_0x23c3('0x41')]){_0x5914d8[_0x23c3('0x42')]=[{'all':!![]}];}_0x5914d8=_['merge']({},_0x5914d8,_0x3be18c[_0x23c3('0x40')]);return db[_0x23c3('0x2b')]['find'](_0x5914d8)[_0x23c3('0x27')](handleEntityNotFound(_0x41e003,null))[_0x23c3('0x27')](respondWithResult(_0x41e003,null))[_0x23c3('0x44')](handleError(_0x41e003,null));};exports[_0x23c3('0x48')]=function(_0x34b3c5,_0x4776ac){return db[_0x23c3('0x2b')][_0x23c3('0x48')](_0x34b3c5['body'],{})[_0x23c3('0x27')](respondWithResult(_0x4776ac,0xc9))[_0x23c3('0x44')](handleError(_0x4776ac,null));};exports[_0x23c3('0x26')]=function(_0x1cb91f,_0x547a83){if(_0x1cb91f[_0x23c3('0x49')]['id']){delete _0x1cb91f[_0x23c3('0x49')]['id'];}return db['SquareReport'][_0x23c3('0x4a')]({'where':{'id':_0x1cb91f[_0x23c3('0x46')]['id']}})[_0x23c3('0x27')](handleEntityNotFound(_0x547a83,null))[_0x23c3('0x27')](saveUpdates(_0x1cb91f[_0x23c3('0x49')],null))[_0x23c3('0x27')](respondWithResult(_0x547a83,null))[_0x23c3('0x44')](handleError(_0x547a83,null));};exports[_0x23c3('0x4b')]=function(_0x5f2d92,_0x2c43f3){return db[_0x23c3('0x2b')][_0x23c3('0x4a')]({'where':{'id':_0x5f2d92[_0x23c3('0x46')]['id']}})[_0x23c3('0x27')](handleEntityNotFound(_0x2c43f3,null))['then'](removeEntity(_0x2c43f3,null))[_0x23c3('0x44')](handleError(_0x2c43f3,null));};exports[_0x23c3('0x4c')]=function(_0x10700f,_0x51998d){return db[_0x23c3('0x2b')][_0x23c3('0x4c')]()[_0x23c3('0x27')](respondWithResult(_0x51998d,null))[_0x23c3('0x44')](handleError(_0x51998d,null));}; \ No newline at end of file +var _0x6c47=['to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','options','SquareReport','includeAll','include','catch','params','filters','merge','find','create','body','describe','eml-format','zip-dir','bluebird','util','path','sox'];(function(_0x434804,_0x415f68){var _0x573fc8=function(_0x3ce265){while(--_0x3ce265){_0x434804['push'](_0x434804['shift']());}};_0x573fc8(++_0x415f68);}(_0x6c47,0x1b0));var _0x76c4=function(_0x43df6e,_0x4b1cf4){_0x43df6e=_0x43df6e-0x0;var _0x17fceb=_0x6c47[_0x43df6e];return _0x17fceb;};'use strict';var emlformat=require(_0x76c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x76c4('0x2'));var Mustache=require('mustache');var util=require(_0x76c4('0x3'));var path=require(_0x76c4('0x4'));var sox=require(_0x76c4('0x5'));var csv=require(_0x76c4('0x6'));var ejs=require(_0x76c4('0x7'));var fs=require('fs');var fs_extra=require(_0x76c4('0x8'));var _=require(_0x76c4('0x9'));var squel=require(_0x76c4('0xa'));var crypto=require('crypto');var jsforce=require(_0x76c4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x76c4('0x6'));var querystring=require(_0x76c4('0xc'));var Papa=require(_0x76c4('0xd'));var Redis=require(_0x76c4('0xe'));var authService=require(_0x76c4('0xf'));var qs=require(_0x76c4('0x10'));var as=require(_0x76c4('0x11'));var hardwareService=require(_0x76c4('0x12'));var logger=require('../../config/logger')(_0x76c4('0x13'));var utils=require(_0x76c4('0x14'));var config=require(_0x76c4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x76c4('0x16'))['db'];function respondWithStatusCode(_0x25b48c,_0x5c570e){_0x5c570e=_0x5c570e||0xcc;return function(_0x35bb4c){if(_0x35bb4c){return _0x25b48c[_0x76c4('0x17')](_0x5c570e);}return _0x25b48c[_0x76c4('0x18')](_0x5c570e)[_0x76c4('0x19')]();};}function respondWithResult(_0x28f8a2,_0x272e93){_0x272e93=_0x272e93||0xc8;return function(_0x47796f){if(_0x47796f){return _0x28f8a2[_0x76c4('0x18')](_0x272e93)[_0x76c4('0x1a')](_0x47796f);}};}function respondWithFilteredResult(_0x2c3611,_0x398c47){return function(_0x500034){if(_0x500034){var _0xa45836=typeof _0x398c47[_0x76c4('0x1b')]==='undefined'&&typeof _0x398c47[_0x76c4('0x1c')]===_0x76c4('0x1d');var _0x1c52b8=_0x500034['count'];var _0x49d77f=_0xa45836?0x0:_0x398c47[_0x76c4('0x1b')];var _0x42a8dc=_0xa45836?_0x500034[_0x76c4('0x1e')]:_0x398c47['offset']+_0x398c47[_0x76c4('0x1c')];var _0x558f39;if(_0x42a8dc>=_0x1c52b8){_0x42a8dc=_0x1c52b8;_0x558f39=0xc8;}else{_0x558f39=0xce;}_0x2c3611[_0x76c4('0x18')](_0x558f39);return _0x2c3611[_0x76c4('0x1f')](_0x76c4('0x20'),_0x49d77f+'-'+_0x42a8dc+'/'+_0x1c52b8)[_0x76c4('0x1a')](_0x500034);}return null;};}function patchUpdates(_0x247b76){return function(_0x13f018){try{jsonpatch[_0x76c4('0x21')](_0x13f018,_0x247b76,!![]);}catch(_0x37a672){return BPromise[_0x76c4('0x22')](_0x37a672);}return _0x13f018[_0x76c4('0x23')]();};}function saveUpdates(_0x589374,_0x3ecb83){return function(_0x577e6b){if(_0x577e6b){return _0x577e6b[_0x76c4('0x24')](_0x589374)['then'](function(_0x300a26){return _0x300a26;});}return null;};}function removeEntity(_0x4b775c,_0x1ee11d){return function(_0x58717e){if(_0x58717e){return _0x58717e[_0x76c4('0x25')]()[_0x76c4('0x26')](function(){_0x4b775c['status'](0xcc)[_0x76c4('0x19')]();});}};}function handleEntityNotFound(_0x21c1f5,_0x2a0380){return function(_0x138b59){if(!_0x138b59){_0x21c1f5[_0x76c4('0x17')](0x194);}return _0x138b59;};}function handleError(_0x33d65f,_0x36f6b0){_0x36f6b0=_0x36f6b0||0x1f4;return function(_0x3e182d){logger[_0x76c4('0x27')](_0x3e182d[_0x76c4('0x28')]);if(_0x3e182d[_0x76c4('0x29')]){delete _0x3e182d[_0x76c4('0x29')];}_0x33d65f[_0x76c4('0x18')](_0x36f6b0)[_0x76c4('0x2a')](_0x3e182d);};}exports[_0x76c4('0x2b')]=function(_0x17e958,_0x40c241){var _0x3d91ce={},_0x48890d={},_0x3d7cbf={'count':0x0,'rows':[]};var _0x1038b7=_[_0x76c4('0x2c')](db['SquareReport'][_0x76c4('0x2d')],function(_0x30e814){return{'name':_0x30e814['fieldName'],'type':_0x30e814[_0x76c4('0x2e')][_0x76c4('0x2f')]};});_0x48890d[_0x76c4('0x30')]=_[_0x76c4('0x2c')](_0x1038b7,_0x76c4('0x29'));_0x48890d[_0x76c4('0x31')]=_[_0x76c4('0x32')](_0x17e958[_0x76c4('0x31')]);_0x48890d['filters']=_[_0x76c4('0x33')](_0x48890d[_0x76c4('0x30')],_0x48890d[_0x76c4('0x31')]);_0x3d91ce['attributes']=_['intersection'](_0x48890d['model'],qs[_0x76c4('0x34')](_0x17e958[_0x76c4('0x31')][_0x76c4('0x34')]));_0x3d91ce[_0x76c4('0x35')]=_0x3d91ce['attributes'][_0x76c4('0x36')]?_0x3d91ce['attributes']:_0x48890d[_0x76c4('0x30')];if(!_0x17e958[_0x76c4('0x31')][_0x76c4('0x37')]('nolimit')){_0x3d91ce['limit']=qs['limit'](_0x17e958['query'][_0x76c4('0x1c')]);_0x3d91ce[_0x76c4('0x1b')]=qs[_0x76c4('0x1b')](_0x17e958[_0x76c4('0x31')]['offset']);}_0x3d91ce[_0x76c4('0x38')]=qs[_0x76c4('0x39')](_0x17e958[_0x76c4('0x31')][_0x76c4('0x39')]);_0x3d91ce[_0x76c4('0x3a')]=qs['filters'](_[_0x76c4('0x3b')](_0x17e958['query'],_0x48890d['filters']),_0x1038b7);if(_0x17e958[_0x76c4('0x31')][_0x76c4('0x3c')]){_0x3d91ce['where']=_['merge'](_0x3d91ce[_0x76c4('0x3a')],{'$or':_[_0x76c4('0x2c')](_0x1038b7,function(_0x5509f6){if(_0x5509f6[_0x76c4('0x2e')]!=='VIRTUAL'){var _0x43ec3d={};_0x43ec3d[_0x5509f6[_0x76c4('0x29')]]={'$like':'%'+_0x17e958[_0x76c4('0x31')][_0x76c4('0x3c')]+'%'};return _0x43ec3d;}})});}_0x3d91ce=_['merge']({},_0x3d91ce,_0x17e958[_0x76c4('0x3d')]);var _0x1513fb={'where':_0x3d91ce[_0x76c4('0x3a')]};return db[_0x76c4('0x3e')][_0x76c4('0x1e')](_0x1513fb)[_0x76c4('0x26')](function(_0x397aa3){_0x3d7cbf[_0x76c4('0x1e')]=_0x397aa3;if(_0x17e958[_0x76c4('0x31')][_0x76c4('0x3f')]){_0x3d91ce[_0x76c4('0x40')]=[{'all':!![]}];}return db[_0x76c4('0x3e')]['findAll'](_0x3d91ce);})[_0x76c4('0x26')](function(_0x15ad3a){_0x3d7cbf['rows']=_0x15ad3a;return _0x3d7cbf;})[_0x76c4('0x26')](respondWithFilteredResult(_0x40c241,_0x3d91ce))[_0x76c4('0x41')](handleError(_0x40c241,null));};exports['show']=function(_0x3de586,_0x4d591d){var _0x298d43={'raw':!![],'where':{'id':_0x3de586[_0x76c4('0x42')]['id']}},_0x5cdd26={};_0x5cdd26[_0x76c4('0x30')]=_[_0x76c4('0x32')](db['SquareReport'][_0x76c4('0x2d')]);_0x5cdd26['query']=_[_0x76c4('0x32')](_0x3de586['query']);_0x5cdd26[_0x76c4('0x43')]=_['intersection'](_0x5cdd26[_0x76c4('0x30')],_0x5cdd26[_0x76c4('0x31')]);_0x298d43[_0x76c4('0x35')]=_[_0x76c4('0x33')](_0x5cdd26[_0x76c4('0x30')],qs[_0x76c4('0x34')](_0x3de586['query'][_0x76c4('0x34')]));_0x298d43['attributes']=_0x298d43[_0x76c4('0x35')][_0x76c4('0x36')]?_0x298d43[_0x76c4('0x35')]:_0x5cdd26[_0x76c4('0x30')];if(_0x3de586[_0x76c4('0x31')]['includeAll']){_0x298d43[_0x76c4('0x40')]=[{'all':!![]}];}_0x298d43=_[_0x76c4('0x44')]({},_0x298d43,_0x3de586[_0x76c4('0x3d')]);return db['SquareReport'][_0x76c4('0x45')](_0x298d43)['then'](handleEntityNotFound(_0x4d591d,null))['then'](respondWithResult(_0x4d591d,null))[_0x76c4('0x41')](handleError(_0x4d591d,null));};exports[_0x76c4('0x46')]=function(_0x58e6f4,_0x3391d0){return db['SquareReport'][_0x76c4('0x46')](_0x58e6f4[_0x76c4('0x47')],{})['then'](respondWithResult(_0x3391d0,0xc9))[_0x76c4('0x41')](handleError(_0x3391d0,null));};exports[_0x76c4('0x24')]=function(_0x4802bd,_0x93b74){if(_0x4802bd[_0x76c4('0x47')]['id']){delete _0x4802bd[_0x76c4('0x47')]['id'];}return db[_0x76c4('0x3e')][_0x76c4('0x45')]({'where':{'id':_0x4802bd[_0x76c4('0x42')]['id']}})['then'](handleEntityNotFound(_0x93b74,null))[_0x76c4('0x26')](saveUpdates(_0x4802bd[_0x76c4('0x47')],null))[_0x76c4('0x26')](respondWithResult(_0x93b74,null))[_0x76c4('0x41')](handleError(_0x93b74,null));};exports[_0x76c4('0x25')]=function(_0x5ebf83,_0x253713){return db[_0x76c4('0x3e')][_0x76c4('0x45')]({'where':{'id':_0x5ebf83[_0x76c4('0x42')]['id']}})[_0x76c4('0x26')](handleEntityNotFound(_0x253713,null))['then'](removeEntity(_0x253713,null))[_0x76c4('0x41')](handleError(_0x253713,null));};exports[_0x76c4('0x48')]=function(_0x1df82b,_0x4ecb26){return db['SquareReport'][_0x76c4('0x48')]()[_0x76c4('0x26')](respondWithResult(_0x4ecb26,null))[_0x76c4('0x41')](handleError(_0x4ecb26,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 6159bb1..682d5e8 100644 --- a/server/api/squareReport/squareReport.model.js +++ b/server/api/squareReport/squareReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf73b=['bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','leaveAt','util','../../config/logger'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xf73b,0x166));var _0xbf73=function(_0x503b0f,_0x5b3784){_0x503b0f=_0x503b0f-0x0;var _0x17b92d=_0xf73b[_0x503b0f];return _0x17b92d;};'use strict';var _=require('lodash');var util=require(_0xbf73('0x0'));var logger=require(_0xbf73('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbf73('0x2'));var rp=require(_0xbf73('0x3'));var fs=require('fs');var path=require(_0xbf73('0x4'));var rimraf=require(_0xbf73('0x5'));var config=require(_0xbf73('0x6'));var attributes=require(_0xbf73('0x7'));module[_0xbf73('0x8')]=function(_0x57331a,_0x1e98bb){return _0x57331a[_0xbf73('0x9')](_0xbf73('0xa'),attributes,{'tableName':_0xbf73('0xb'),'paranoid':![],'indexes':[{'name':_0xbf73('0xc'),'fields':[_0xbf73('0xd'),'project_name']},{'name':'leaveAt','fields':[_0xbf73('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdc30=['bluebird','path','exports','SquareReport','report_square','project_name','leaveAt','util','../../config/logger','api','moment'];(function(_0x458285,_0x2132d0){var _0x311be0=function(_0x46d466){while(--_0x46d466){_0x458285['push'](_0x458285['shift']());}};_0x311be0(++_0x2132d0);}(_0xdc30,0x80));var _0x0dc3=function(_0xda6ad1,_0x5f09e3){_0xda6ad1=_0xda6ad1-0x0;var _0xedc3a5=_0xdc30[_0xda6ad1];return _0xedc3a5;};'use strict';var _=require('lodash');var util=require(_0x0dc3('0x0'));var logger=require(_0x0dc3('0x1'))(_0x0dc3('0x2'));var moment=require(_0x0dc3('0x3'));var BPromise=require(_0x0dc3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0dc3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x0dc3('0x6')]=function(_0xd979da,_0x2964d2){return _0xd979da['define'](_0x0dc3('0x7'),attributes,{'tableName':_0x0dc3('0x8'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x0dc3('0x9')]},{'name':_0x0dc3('0xa'),'fields':[_0x0dc3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index ce9494a..c982da6 100644 --- a/server/api/squareReport/squareReport.rpc.js +++ b/server/api/squareReport/squareReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f21=['then','info','UpdateSquareReport','raw','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareReport','SquareReport','body','options'];(function(_0x3d8d91,_0x3cf8c9){var _0x368294=function(_0x3eacda){while(--_0x3eacda){_0x3d8d91['push'](_0x3d8d91['shift']());}};_0x368294(++_0x3cf8c9);}(_0x3f21,0x1b9));var _0x13f2=function(_0x42510c,_0x56f06c){_0x42510c=_0x42510c-0x0;var _0x468014=_0x3f21[_0x42510c];return _0x468014;};'use strict';var _=require('lodash');var util=require(_0x13f2('0x0'));var moment=require(_0x13f2('0x1'));var BPromise=require(_0x13f2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13f2('0x3'));var db=require(_0x13f2('0x4'))['db'];var utils=require(_0x13f2('0x5'));var logger=require('../../config/logger')(_0x13f2('0x6'));var config=require(_0x13f2('0x7'));var jayson=require(_0x13f2('0x8'));var client=jayson[_0x13f2('0x9')][_0x13f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x428a45,_0x293248,_0x3475a1){return new BPromise(function(_0xb9e9b6,_0x4d1341){return client['request'](_0x428a45,_0x3475a1)['then'](function(_0xce3ba6){logger['info'](_0x13f2('0xb'),_0x293248,_0x13f2('0xc'));logger[_0x13f2('0xd')](_0x13f2('0xe'),_0x293248,_0x13f2('0xc'),JSON['stringify'](_0xce3ba6));if(_0xce3ba6[_0x13f2('0xf')]){if(_0xce3ba6[_0x13f2('0xf')][_0x13f2('0x10')]===0x1f4){logger[_0x13f2('0xf')]('SquareReport,\x20%s,\x20%s',_0x293248,_0xce3ba6[_0x13f2('0xf')]['message']);return _0x4d1341(_0xce3ba6[_0x13f2('0xf')][_0x13f2('0x11')]);}logger['error'](_0x13f2('0xb'),_0x293248,_0xce3ba6[_0x13f2('0xf')][_0x13f2('0x11')]);return _0xb9e9b6(_0xce3ba6[_0x13f2('0xf')][_0x13f2('0x11')]);}else{logger['info'](_0x13f2('0xb'),_0x293248,_0x13f2('0xc'));_0xb9e9b6(_0xce3ba6[_0x13f2('0x12')][_0x13f2('0x11')]);}})[_0x13f2('0x13')](function(_0x33acd5){logger[_0x13f2('0xf')](_0x13f2('0xb'),_0x293248,_0x33acd5);_0x4d1341(_0x33acd5);});});}exports[_0x13f2('0x14')]=function(_0x388927){var _0x5bef56=this;return new Promise(function(_0x2d3326,_0x19cd85){return db[_0x13f2('0x15')]['create'](_0x388927[_0x13f2('0x16')],{'raw':_0x388927[_0x13f2('0x17')]?_0x388927[_0x13f2('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x13f2('0x18')](function(_0x57b336){logger[_0x13f2('0x19')]('CreateSquareReport',_0x388927);logger[_0x13f2('0xd')](_0x13f2('0x14'),_0x388927,JSON['stringify'](_0x57b336));_0x2d3326(_0x57b336);})[_0x13f2('0x13')](function(_0x2e8caa){logger[_0x13f2('0xf')](_0x13f2('0x14'),_0x2e8caa[_0x13f2('0x11')],_0x388927);_0x19cd85(_0x5bef56['error'](0x1f4,_0x2e8caa['message']));});});};exports[_0x13f2('0x1a')]=function(_0x236568){var _0x5c9dca=this;return new Promise(function(_0x5d10c1,_0x307145){return db['SquareReport']['update'](_0x236568['body'],{'raw':_0x236568['options']?_0x236568[_0x13f2('0x17')][_0x13f2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x236568[_0x13f2('0x17')]?_0x236568['options'][_0x13f2('0x1c')]||null:null,'attributes':_0x236568[_0x13f2('0x17')]?_0x236568[_0x13f2('0x17')][_0x13f2('0x1d')]||null:null,'limit':_0x236568[_0x13f2('0x17')]?_0x236568[_0x13f2('0x17')][_0x13f2('0x1e')]||null:null})['then'](function(_0x2b29ab){logger[_0x13f2('0x19')](_0x13f2('0x1a'),_0x236568);logger[_0x13f2('0xd')](_0x13f2('0x1a'),_0x236568,JSON['stringify'](_0x2b29ab));_0x5d10c1(_0x2b29ab);})[_0x13f2('0x13')](function(_0x55f0f3){logger[_0x13f2('0xf')](_0x13f2('0x1a'),_0x55f0f3[_0x13f2('0x11')],_0x236568);_0x307145(_0x5c9dca[_0x13f2('0xf')](0x1f4,_0x55f0f3['message']));});});}; \ No newline at end of file +var _0x6112=['raw','UpdateSquareReport','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateSquareReport','SquareReport','create','body','options'];(function(_0x3d6d2c,_0x194844){var _0x3a9bf5=function(_0x257c7e){while(--_0x257c7e){_0x3d6d2c['push'](_0x3d6d2c['shift']());}};_0x3a9bf5(++_0x194844);}(_0x6112,0x138));var _0x2611=function(_0x1ac58d,_0x4e1034){_0x1ac58d=_0x1ac58d-0x0;var _0x4489ac=_0x6112[_0x1ac58d];return _0x4489ac;};'use strict';var _=require(_0x2611('0x0'));var util=require(_0x2611('0x1'));var moment=require(_0x2611('0x2'));var BPromise=require(_0x2611('0x3'));var rs=require(_0x2611('0x4'));var fs=require('fs');var Redis=require(_0x2611('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2611('0x6'));var logger=require(_0x2611('0x7'))(_0x2611('0x8'));var config=require(_0x2611('0x9'));var jayson=require(_0x2611('0xa'));var client=jayson['client'][_0x2611('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dd1e3,_0x4ff8f7,_0x204333){return new BPromise(function(_0x1ef052,_0x939d92){return client['request'](_0x1dd1e3,_0x204333)[_0x2611('0xc')](function(_0x53316f){logger[_0x2611('0xd')](_0x2611('0xe'),_0x4ff8f7,'request\x20sent');logger['debug'](_0x2611('0xf'),_0x4ff8f7,'request\x20sent',JSON[_0x2611('0x10')](_0x53316f));if(_0x53316f[_0x2611('0x11')]){if(_0x53316f[_0x2611('0x11')][_0x2611('0x12')]===0x1f4){logger['error'](_0x2611('0xe'),_0x4ff8f7,_0x53316f[_0x2611('0x11')][_0x2611('0x13')]);return _0x939d92(_0x53316f['error'][_0x2611('0x13')]);}logger[_0x2611('0x11')](_0x2611('0xe'),_0x4ff8f7,_0x53316f[_0x2611('0x11')][_0x2611('0x13')]);return _0x1ef052(_0x53316f[_0x2611('0x11')][_0x2611('0x13')]);}else{logger[_0x2611('0xd')](_0x2611('0xe'),_0x4ff8f7,_0x2611('0x14'));_0x1ef052(_0x53316f[_0x2611('0x15')][_0x2611('0x13')]);}})[_0x2611('0x16')](function(_0x7c60d1){logger[_0x2611('0x11')](_0x2611('0xe'),_0x4ff8f7,_0x7c60d1);_0x939d92(_0x7c60d1);});});}exports[_0x2611('0x17')]=function(_0xa055c6){var _0x4cac3e=this;return new Promise(function(_0x133f8d,_0x21a5b3){return db[_0x2611('0x18')][_0x2611('0x19')](_0xa055c6[_0x2611('0x1a')],{'raw':_0xa055c6[_0x2611('0x1b')]?_0xa055c6[_0x2611('0x1b')][_0x2611('0x1c')]===undefined?!![]:![]:!![]})[_0x2611('0xc')](function(_0x26e926){logger[_0x2611('0xd')](_0x2611('0x17'),_0xa055c6);logger['debug'](_0x2611('0x17'),_0xa055c6,JSON['stringify'](_0x26e926));_0x133f8d(_0x26e926);})[_0x2611('0x16')](function(_0x426b4c){logger['error'](_0x2611('0x17'),_0x426b4c[_0x2611('0x13')],_0xa055c6);_0x21a5b3(_0x4cac3e['error'](0x1f4,_0x426b4c[_0x2611('0x13')]));});});};exports[_0x2611('0x1d')]=function(_0x248fa2){var _0x2000c0=this;return new Promise(function(_0x1f8d33,_0x21d57c){return db[_0x2611('0x18')]['update'](_0x248fa2['body'],{'raw':_0x248fa2[_0x2611('0x1b')]?_0x248fa2['options'][_0x2611('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x248fa2[_0x2611('0x1b')]?_0x248fa2[_0x2611('0x1b')][_0x2611('0x1e')]||null:null,'attributes':_0x248fa2[_0x2611('0x1b')]?_0x248fa2[_0x2611('0x1b')][_0x2611('0x1f')]||null:null,'limit':_0x248fa2['options']?_0x248fa2[_0x2611('0x1b')][_0x2611('0x20')]||null:null})[_0x2611('0xc')](function(_0xf45b39){logger[_0x2611('0xd')](_0x2611('0x1d'),_0x248fa2);logger[_0x2611('0x21')](_0x2611('0x1d'),_0x248fa2,JSON['stringify'](_0xf45b39));_0x1f8d33(_0xf45b39);})[_0x2611('0x16')](function(_0x5397f3){logger[_0x2611('0x11')]('UpdateSquareReport',_0x5397f3[_0x2611('0x13')],_0x248fa2);_0x21d57c(_0x2000c0['error'](0x1f4,_0x5397f3[_0x2611('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 1575163..8ebef51 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0ea=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','multer'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xb0ea,0x1b4));var _0xab0e=function(_0x59881a,_0x5ef668){_0x59881a=_0x59881a-0x0;var _0x33a221=_0xb0ea[_0x59881a];return _0x33a221;};'use strict';var multer=require(_0xab0e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xab0e('0x1'));var express=require('express');var router=express[_0xab0e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xab0e('0x3'));var interaction=require(_0xab0e('0x4'));var config=require(_0xab0e('0x5'));var controller=require(_0xab0e('0x6'));router[_0xab0e('0x7')]('/',auth[_0xab0e('0x8')](),controller[_0xab0e('0x9')]);router[_0xab0e('0x7')](_0xab0e('0xa'),auth[_0xab0e('0x8')](),controller[_0xab0e('0xb')]);router[_0xab0e('0x7')](_0xab0e('0xc'),auth[_0xab0e('0x8')](),controller[_0xab0e('0xd')]);router[_0xab0e('0xe')]('/',auth[_0xab0e('0x8')](),controller[_0xab0e('0xf')]);router['put'](_0xab0e('0xc'),auth[_0xab0e('0x8')](),controller[_0xab0e('0x10')]);router['delete'](_0xab0e('0xc'),auth['isAuthenticated'](),controller[_0xab0e('0x11')]);module[_0xab0e('0x12')]=router; \ No newline at end of file +var _0x129a=['post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x129a,0x192));var _0xa129=function(_0x5b2200,_0x51c58a){_0x5b2200=_0x5b2200-0x0;var _0x446082=_0x129a[_0x5b2200];return _0x446082;};'use strict';var multer=require(_0xa129('0x0'));var util=require(_0xa129('0x1'));var path=require(_0xa129('0x2'));var timeout=require(_0xa129('0x3'));var express=require(_0xa129('0x4'));var router=express[_0xa129('0x5')]();var fs_extra=require(_0xa129('0x6'));var auth=require(_0xa129('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa129('0x8'));var controller=require(_0xa129('0x9'));router['get']('/',auth[_0xa129('0xa')](),controller[_0xa129('0xb')]);router[_0xa129('0xc')](_0xa129('0xd'),auth[_0xa129('0xa')](),controller['describe']);router[_0xa129('0xc')](_0xa129('0xe'),auth[_0xa129('0xa')](),controller[_0xa129('0xf')]);router[_0xa129('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa129('0x11')](_0xa129('0xe'),auth[_0xa129('0xa')](),controller[_0xa129('0x12')]);router[_0xa129('0x13')](_0xa129('0xe'),auth[_0xa129('0xa')](),controller[_0xa129('0x14')]);module[_0xa129('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 9ce894f..91a5ac1 100644 --- a/server/api/squareReportDetail/squareReportDetail.attributes.js +++ b/server/api/squareReportDetail/squareReportDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97de=['TEXT','exports','STRING'];(function(_0x22a524,_0x32c0d0){var _0x2ebb53=function(_0x4899a6){while(--_0x4899a6){_0x22a524['push'](_0x22a524['shift']());}};_0x2ebb53(++_0x32c0d0);}(_0x97de,0x17e));var _0xe97d=function(_0x5738d0,_0x3f77df){_0x5738d0=_0x5738d0-0x0;var _0x2bc0dd=_0x97de[_0x5738d0];return _0x2bc0dd;};'use strict';var Sequelize=require('sequelize');module[_0xe97d('0x0')]={'uniqueid':{'type':Sequelize[_0xe97d('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xe97d('0x1')]},'data':{'type':Sequelize[_0xe97d('0x2')]},'project_name':{'type':Sequelize[_0xe97d('0x1')]},'callerid':{'type':Sequelize[_0xe97d('0x1')]}}; \ No newline at end of file +var _0x124f=['sequelize','exports','STRING','TEXT'];(function(_0x7654ab,_0x599afb){var _0x223e77=function(_0x38c768){while(--_0x38c768){_0x7654ab['push'](_0x7654ab['shift']());}};_0x223e77(++_0x599afb);}(_0x124f,0x1a8));var _0xf124=function(_0x16d583,_0x5adfc6){_0x16d583=_0x16d583-0x0;var _0x303695=_0x124f[_0x16d583];return _0x303695;};'use strict';var Sequelize=require(_0xf124('0x0'));module[_0xf124('0x1')]={'uniqueid':{'type':Sequelize[_0xf124('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xf124('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf124('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 311f343..e19173b 100644 --- a/server/api/squareReportDetail/squareReportDetail.controller.js +++ b/server/api/squareReportDetail/squareReportDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3485=['type','VIRTUAL','options','SquareDetailsReport','includeAll','include','rows','show','params','length','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','send','rawAttributes','model','map','name','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3485,0x9d));var _0x5348=function(_0x1064e0,_0x3b02ce){_0x1064e0=_0x1064e0-0x0;var _0x76e1e9=_0x3485[_0x1064e0];return _0x76e1e9;};'use strict';var emlformat=require(_0x5348('0x0'));var rimraf=require(_0x5348('0x1'));var zipdir=require(_0x5348('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5348('0x3'));var moment=require(_0x5348('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5348('0x5'));var sox=require(_0x5348('0x6'));var csv=require(_0x5348('0x7'));var ejs=require(_0x5348('0x8'));var fs=require('fs');var fs_extra=require(_0x5348('0x9'));var _=require(_0x5348('0xa'));var squel=require(_0x5348('0xb'));var crypto=require(_0x5348('0xc'));var jsforce=require(_0x5348('0xd'));var deskjs=require(_0x5348('0xe'));var toCsv=require(_0x5348('0x7'));var querystring=require(_0x5348('0xf'));var Papa=require('papaparse');var Redis=require(_0x5348('0x10'));var authService=require(_0x5348('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5348('0x12'));var hardwareService=require(_0x5348('0x13'));var logger=require('../../config/logger')(_0x5348('0x14'));var utils=require(_0x5348('0x15'));var config=require(_0x5348('0x16'));var licenseUtil=require(_0x5348('0x17'));var db=require(_0x5348('0x18'))['db'];function respondWithStatusCode(_0x579caa,_0x1c5f04){_0x1c5f04=_0x1c5f04||0xcc;return function(_0x3f02a2){if(_0x3f02a2){return _0x579caa['sendStatus'](_0x1c5f04);}return _0x579caa[_0x5348('0x19')](_0x1c5f04)[_0x5348('0x1a')]();};}function respondWithResult(_0x26c9bf,_0x320f64){_0x320f64=_0x320f64||0xc8;return function(_0x3c6316){if(_0x3c6316){return _0x26c9bf['status'](_0x320f64)[_0x5348('0x1b')](_0x3c6316);}};}function respondWithFilteredResult(_0x15efba,_0x23366c){return function(_0x4734b0){if(_0x4734b0){var _0x197c92=typeof _0x23366c[_0x5348('0x1c')]===_0x5348('0x1d')&&typeof _0x23366c[_0x5348('0x1e')]==='undefined';var _0xda6af3=_0x4734b0[_0x5348('0x1f')];var _0x545a06=_0x197c92?0x0:_0x23366c[_0x5348('0x1c')];var _0x4055ea=_0x197c92?_0x4734b0['count']:_0x23366c[_0x5348('0x1c')]+_0x23366c[_0x5348('0x1e')];var _0x54177a;if(_0x4055ea>=_0xda6af3){_0x4055ea=_0xda6af3;_0x54177a=0xc8;}else{_0x54177a=0xce;}_0x15efba[_0x5348('0x19')](_0x54177a);return _0x15efba[_0x5348('0x20')]('Content-Range',_0x545a06+'-'+_0x4055ea+'/'+_0xda6af3)[_0x5348('0x1b')](_0x4734b0);}return null;};}function patchUpdates(_0x479a0a){return function(_0x570be1){try{jsonpatch[_0x5348('0x21')](_0x570be1,_0x479a0a,!![]);}catch(_0x1f4466){return BPromise[_0x5348('0x22')](_0x1f4466);}return _0x570be1[_0x5348('0x23')]();};}function saveUpdates(_0x4f2991,_0x358a2c){return function(_0x45ba61){if(_0x45ba61){return _0x45ba61[_0x5348('0x24')](_0x4f2991)['then'](function(_0x6876a1){return _0x6876a1;});}return null;};}function removeEntity(_0x547d66,_0x593724){return function(_0x2c3306){if(_0x2c3306){return _0x2c3306[_0x5348('0x25')]()[_0x5348('0x26')](function(){_0x547d66['status'](0xcc)[_0x5348('0x1a')]();});}};}function handleEntityNotFound(_0xa68373,_0x37e418){return function(_0x51ca3f){if(!_0x51ca3f){_0xa68373[_0x5348('0x27')](0x194);}return _0x51ca3f;};}function handleError(_0x37424b,_0x2fbbff){_0x2fbbff=_0x2fbbff||0x1f4;return function(_0x4a771e){logger['error'](_0x4a771e['stack']);if(_0x4a771e['name']){delete _0x4a771e['name'];}_0x37424b[_0x5348('0x19')](_0x2fbbff)[_0x5348('0x28')](_0x4a771e);};}exports['index']=function(_0x544a69,_0x52d802){var _0x44f10d={},_0xa8b2ed={},_0x360d57={'count':0x0,'rows':[]};var _0x336c5e=_['map'](db['SquareDetailsReport'][_0x5348('0x29')],function(_0x5f20d8){return{'name':_0x5f20d8['fieldName'],'type':_0x5f20d8['type']['key']};});_0xa8b2ed[_0x5348('0x2a')]=_[_0x5348('0x2b')](_0x336c5e,_0x5348('0x2c'));_0xa8b2ed[_0x5348('0x2d')]=_[_0x5348('0x2e')](_0x544a69[_0x5348('0x2d')]);_0xa8b2ed[_0x5348('0x2f')]=_[_0x5348('0x30')](_0xa8b2ed[_0x5348('0x2a')],_0xa8b2ed[_0x5348('0x2d')]);_0x44f10d[_0x5348('0x31')]=_[_0x5348('0x30')](_0xa8b2ed[_0x5348('0x2a')],qs[_0x5348('0x32')](_0x544a69[_0x5348('0x2d')][_0x5348('0x32')]));_0x44f10d[_0x5348('0x31')]=_0x44f10d[_0x5348('0x31')]['length']?_0x44f10d[_0x5348('0x31')]:_0xa8b2ed['model'];if(!_0x544a69[_0x5348('0x2d')]['hasOwnProperty'](_0x5348('0x33'))){_0x44f10d[_0x5348('0x1e')]=qs[_0x5348('0x1e')](_0x544a69['query'][_0x5348('0x1e')]);_0x44f10d[_0x5348('0x1c')]=qs[_0x5348('0x1c')](_0x544a69[_0x5348('0x2d')][_0x5348('0x1c')]);}_0x44f10d['order']=qs[_0x5348('0x34')](_0x544a69[_0x5348('0x2d')][_0x5348('0x34')]);_0x44f10d[_0x5348('0x35')]=qs['filters'](_['pick'](_0x544a69[_0x5348('0x2d')],_0xa8b2ed[_0x5348('0x2f')]),_0x336c5e);if(_0x544a69[_0x5348('0x2d')][_0x5348('0x36')]){_0x44f10d['where']=_[_0x5348('0x37')](_0x44f10d[_0x5348('0x35')],{'$or':_[_0x5348('0x2b')](_0x336c5e,function(_0x2d67f1){if(_0x2d67f1[_0x5348('0x38')]!==_0x5348('0x39')){var _0x1a0cb3={};_0x1a0cb3[_0x2d67f1[_0x5348('0x2c')]]={'$like':'%'+_0x544a69[_0x5348('0x2d')][_0x5348('0x36')]+'%'};return _0x1a0cb3;}})});}_0x44f10d=_['merge']({},_0x44f10d,_0x544a69[_0x5348('0x3a')]);var _0xa4c34b={'where':_0x44f10d['where']};return db[_0x5348('0x3b')][_0x5348('0x1f')](_0xa4c34b)[_0x5348('0x26')](function(_0x5f53cc){_0x360d57['count']=_0x5f53cc;if(_0x544a69[_0x5348('0x2d')][_0x5348('0x3c')]){_0x44f10d[_0x5348('0x3d')]=[{'all':!![]}];}return db[_0x5348('0x3b')]['findAll'](_0x44f10d);})[_0x5348('0x26')](function(_0x36effd){_0x360d57[_0x5348('0x3e')]=_0x36effd;return _0x360d57;})[_0x5348('0x26')](respondWithFilteredResult(_0x52d802,_0x44f10d))['catch'](handleError(_0x52d802,null));};exports[_0x5348('0x3f')]=function(_0x2f83c8,_0xb4441d){var _0x42d7c6={'raw':!![],'where':{'id':_0x2f83c8[_0x5348('0x40')]['id']}},_0x5dac88={};_0x5dac88[_0x5348('0x2a')]=_[_0x5348('0x2e')](db[_0x5348('0x3b')][_0x5348('0x29')]);_0x5dac88[_0x5348('0x2d')]=_['keys'](_0x2f83c8['query']);_0x5dac88['filters']=_[_0x5348('0x30')](_0x5dac88['model'],_0x5dac88[_0x5348('0x2d')]);_0x42d7c6[_0x5348('0x31')]=_[_0x5348('0x30')](_0x5dac88[_0x5348('0x2a')],qs[_0x5348('0x32')](_0x2f83c8['query']['fields']));_0x42d7c6['attributes']=_0x42d7c6[_0x5348('0x31')][_0x5348('0x41')]?_0x42d7c6[_0x5348('0x31')]:_0x5dac88[_0x5348('0x2a')];if(_0x2f83c8['query'][_0x5348('0x3c')]){_0x42d7c6['include']=[{'all':!![]}];}_0x42d7c6=_['merge']({},_0x42d7c6,_0x2f83c8[_0x5348('0x3a')]);return db[_0x5348('0x3b')][_0x5348('0x42')](_0x42d7c6)[_0x5348('0x26')](handleEntityNotFound(_0xb4441d,null))[_0x5348('0x26')](respondWithResult(_0xb4441d,null))['catch'](handleError(_0xb4441d,null));};exports[_0x5348('0x43')]=function(_0xb615d2,_0x4d4c39){return db['SquareDetailsReport']['create'](_0xb615d2[_0x5348('0x44')],{})[_0x5348('0x26')](respondWithResult(_0x4d4c39,0xc9))[_0x5348('0x45')](handleError(_0x4d4c39,null));};exports[_0x5348('0x24')]=function(_0x3e8418,_0x1e5e84){if(_0x3e8418[_0x5348('0x44')]['id']){delete _0x3e8418[_0x5348('0x44')]['id'];}return db['SquareDetailsReport'][_0x5348('0x42')]({'where':{'id':_0x3e8418['params']['id']}})[_0x5348('0x26')](handleEntityNotFound(_0x1e5e84,null))[_0x5348('0x26')](saveUpdates(_0x3e8418[_0x5348('0x44')],null))[_0x5348('0x26')](respondWithResult(_0x1e5e84,null))[_0x5348('0x45')](handleError(_0x1e5e84,null));};exports[_0x5348('0x25')]=function(_0xca6e4b,_0x3e87b4){return db[_0x5348('0x3b')]['find']({'where':{'id':_0xca6e4b['params']['id']}})[_0x5348('0x26')](handleEntityNotFound(_0x3e87b4,null))[_0x5348('0x26')](removeEntity(_0x3e87b4,null))['catch'](handleError(_0x3e87b4,null));};exports[_0x5348('0x46')]=function(_0x1abf23,_0xa93c92){return db[_0x5348('0x3b')]['describe']()[_0x5348('0x26')](respondWithResult(_0xa93c92,null))[_0x5348('0x45')](handleError(_0xa93c92,null));}; \ No newline at end of file +var _0x91cd=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','apply','reject','save','update','then','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring'];(function(_0x32109b,_0x5319c0){var _0xfa3430=function(_0xae5e9d){while(--_0xae5e9d){_0x32109b['push'](_0x32109b['shift']());}};_0xfa3430(++_0x5319c0);}(_0x91cd,0x118));var _0xd91c=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x91cd[_0x3e69ae];return _0x3d7f42;};'use strict';var emlformat=require(_0xd91c('0x0'));var rimraf=require(_0xd91c('0x1'));var zipdir=require(_0xd91c('0x2'));var jsonpatch=require(_0xd91c('0x3'));var rp=require(_0xd91c('0x4'));var moment=require(_0xd91c('0x5'));var BPromise=require(_0xd91c('0x6'));var Mustache=require(_0xd91c('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd91c('0x8'));var csv=require('to-csv');var ejs=require(_0xd91c('0x9'));var fs=require('fs');var fs_extra=require(_0xd91c('0xa'));var _=require(_0xd91c('0xb'));var squel=require(_0xd91c('0xc'));var crypto=require(_0xd91c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd91c('0xe'));var querystring=require(_0xd91c('0xf'));var Papa=require('papaparse');var Redis=require(_0xd91c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd91c('0x11'));var as=require(_0xd91c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd91c('0x13'))(_0xd91c('0x14'));var utils=require(_0xd91c('0x15'));var config=require(_0xd91c('0x16'));var licenseUtil=require(_0xd91c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f9e76,_0x59171a){_0x59171a=_0x59171a||0xcc;return function(_0xd8d583){if(_0xd8d583){return _0x1f9e76[_0xd91c('0x18')](_0x59171a);}return _0x1f9e76['status'](_0x59171a)[_0xd91c('0x19')]();};}function respondWithResult(_0x2bbc4f,_0x1b0164){_0x1b0164=_0x1b0164||0xc8;return function(_0x4135ef){if(_0x4135ef){return _0x2bbc4f['status'](_0x1b0164)[_0xd91c('0x1a')](_0x4135ef);}};}function respondWithFilteredResult(_0x390543,_0x87126d){return function(_0x304c6c){if(_0x304c6c){var _0x1c3519=typeof _0x87126d['offset']===_0xd91c('0x1b')&&typeof _0x87126d[_0xd91c('0x1c')]===_0xd91c('0x1b');var _0x1177dc=_0x304c6c[_0xd91c('0x1d')];var _0x2f804c=_0x1c3519?0x0:_0x87126d[_0xd91c('0x1e')];var _0x5898fb=_0x1c3519?_0x304c6c[_0xd91c('0x1d')]:_0x87126d[_0xd91c('0x1e')]+_0x87126d['limit'];var _0x401488;if(_0x5898fb>=_0x1177dc){_0x5898fb=_0x1177dc;_0x401488=0xc8;}else{_0x401488=0xce;}_0x390543[_0xd91c('0x1f')](_0x401488);return _0x390543[_0xd91c('0x20')]('Content-Range',_0x2f804c+'-'+_0x5898fb+'/'+_0x1177dc)[_0xd91c('0x1a')](_0x304c6c);}return null;};}function patchUpdates(_0x1bb3b1){return function(_0x2882fe){try{jsonpatch[_0xd91c('0x21')](_0x2882fe,_0x1bb3b1,!![]);}catch(_0xaef65d){return BPromise[_0xd91c('0x22')](_0xaef65d);}return _0x2882fe[_0xd91c('0x23')]();};}function saveUpdates(_0x26d820,_0x5cea2f){return function(_0x4ecd11){if(_0x4ecd11){return _0x4ecd11[_0xd91c('0x24')](_0x26d820)['then'](function(_0x52075c){return _0x52075c;});}return null;};}function removeEntity(_0x2f9708,_0x1d5ad5){return function(_0xa07289){if(_0xa07289){return _0xa07289['destroy']()[_0xd91c('0x25')](function(){_0x2f9708[_0xd91c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15fc4b,_0x3a330d){return function(_0x5226ba){if(!_0x5226ba){_0x15fc4b[_0xd91c('0x18')](0x194);}return _0x5226ba;};}function handleError(_0x49338,_0x384a44){_0x384a44=_0x384a44||0x1f4;return function(_0x500786){logger[_0xd91c('0x26')](_0x500786['stack']);if(_0x500786[_0xd91c('0x27')]){delete _0x500786['name'];}_0x49338[_0xd91c('0x1f')](_0x384a44)[_0xd91c('0x28')](_0x500786);};}exports[_0xd91c('0x29')]=function(_0x1d732c,_0x135c7c){var _0x335b84={},_0x4658f1={},_0x3cc9fe={'count':0x0,'rows':[]};var _0x1502a3=_[_0xd91c('0x2a')](db[_0xd91c('0x2b')][_0xd91c('0x2c')],function(_0x574045){return{'name':_0x574045[_0xd91c('0x2d')],'type':_0x574045[_0xd91c('0x2e')][_0xd91c('0x2f')]};});_0x4658f1[_0xd91c('0x30')]=_[_0xd91c('0x2a')](_0x1502a3,_0xd91c('0x27'));_0x4658f1[_0xd91c('0x31')]=_[_0xd91c('0x32')](_0x1d732c['query']);_0x4658f1[_0xd91c('0x33')]=_[_0xd91c('0x34')](_0x4658f1[_0xd91c('0x30')],_0x4658f1[_0xd91c('0x31')]);_0x335b84[_0xd91c('0x35')]=_[_0xd91c('0x34')](_0x4658f1['model'],qs['fields'](_0x1d732c[_0xd91c('0x31')][_0xd91c('0x36')]));_0x335b84[_0xd91c('0x35')]=_0x335b84['attributes'][_0xd91c('0x37')]?_0x335b84['attributes']:_0x4658f1['model'];if(!_0x1d732c[_0xd91c('0x31')][_0xd91c('0x38')](_0xd91c('0x39'))){_0x335b84['limit']=qs['limit'](_0x1d732c[_0xd91c('0x31')][_0xd91c('0x1c')]);_0x335b84[_0xd91c('0x1e')]=qs['offset'](_0x1d732c[_0xd91c('0x31')]['offset']);}_0x335b84[_0xd91c('0x3a')]=qs['sort'](_0x1d732c[_0xd91c('0x31')][_0xd91c('0x3b')]);_0x335b84[_0xd91c('0x3c')]=qs[_0xd91c('0x33')](_['pick'](_0x1d732c['query'],_0x4658f1[_0xd91c('0x33')]),_0x1502a3);if(_0x1d732c[_0xd91c('0x31')]['filter']){_0x335b84[_0xd91c('0x3c')]=_[_0xd91c('0x3d')](_0x335b84[_0xd91c('0x3c')],{'$or':_[_0xd91c('0x2a')](_0x1502a3,function(_0x35393c){if(_0x35393c[_0xd91c('0x2e')]!==_0xd91c('0x3e')){var _0x402aae={};_0x402aae[_0x35393c[_0xd91c('0x27')]]={'$like':'%'+_0x1d732c[_0xd91c('0x31')]['filter']+'%'};return _0x402aae;}})});}_0x335b84=_[_0xd91c('0x3d')]({},_0x335b84,_0x1d732c['options']);var _0x4411e7={'where':_0x335b84['where']};return db[_0xd91c('0x2b')]['count'](_0x4411e7)[_0xd91c('0x25')](function(_0x1704f0){_0x3cc9fe[_0xd91c('0x1d')]=_0x1704f0;if(_0x1d732c[_0xd91c('0x31')][_0xd91c('0x3f')]){_0x335b84['include']=[{'all':!![]}];}return db[_0xd91c('0x2b')]['findAll'](_0x335b84);})[_0xd91c('0x25')](function(_0x38ab4d){_0x3cc9fe[_0xd91c('0x40')]=_0x38ab4d;return _0x3cc9fe;})[_0xd91c('0x25')](respondWithFilteredResult(_0x135c7c,_0x335b84))[_0xd91c('0x41')](handleError(_0x135c7c,null));};exports[_0xd91c('0x42')]=function(_0x432889,_0x49f759){var _0x2cbd49={'raw':!![],'where':{'id':_0x432889[_0xd91c('0x43')]['id']}},_0x4d0683={};_0x4d0683[_0xd91c('0x30')]=_[_0xd91c('0x32')](db[_0xd91c('0x2b')][_0xd91c('0x2c')]);_0x4d0683['query']=_['keys'](_0x432889[_0xd91c('0x31')]);_0x4d0683[_0xd91c('0x33')]=_[_0xd91c('0x34')](_0x4d0683[_0xd91c('0x30')],_0x4d0683['query']);_0x2cbd49[_0xd91c('0x35')]=_[_0xd91c('0x34')](_0x4d0683[_0xd91c('0x30')],qs[_0xd91c('0x36')](_0x432889[_0xd91c('0x31')]['fields']));_0x2cbd49[_0xd91c('0x35')]=_0x2cbd49['attributes']['length']?_0x2cbd49['attributes']:_0x4d0683[_0xd91c('0x30')];if(_0x432889[_0xd91c('0x31')][_0xd91c('0x3f')]){_0x2cbd49[_0xd91c('0x44')]=[{'all':!![]}];}_0x2cbd49=_['merge']({},_0x2cbd49,_0x432889[_0xd91c('0x45')]);return db[_0xd91c('0x2b')][_0xd91c('0x46')](_0x2cbd49)[_0xd91c('0x25')](handleEntityNotFound(_0x49f759,null))[_0xd91c('0x25')](respondWithResult(_0x49f759,null))[_0xd91c('0x41')](handleError(_0x49f759,null));};exports[_0xd91c('0x47')]=function(_0x3ffc0d,_0x338c66){return db[_0xd91c('0x2b')][_0xd91c('0x47')](_0x3ffc0d['body'],{})[_0xd91c('0x25')](respondWithResult(_0x338c66,0xc9))['catch'](handleError(_0x338c66,null));};exports[_0xd91c('0x24')]=function(_0x1c7196,_0x1cbe5b){if(_0x1c7196['body']['id']){delete _0x1c7196[_0xd91c('0x48')]['id'];}return db[_0xd91c('0x2b')][_0xd91c('0x46')]({'where':{'id':_0x1c7196[_0xd91c('0x43')]['id']}})[_0xd91c('0x25')](handleEntityNotFound(_0x1cbe5b,null))['then'](saveUpdates(_0x1c7196['body'],null))[_0xd91c('0x25')](respondWithResult(_0x1cbe5b,null))['catch'](handleError(_0x1cbe5b,null));};exports['destroy']=function(_0x44b6a8,_0xf1257c){return db[_0xd91c('0x2b')][_0xd91c('0x46')]({'where':{'id':_0x44b6a8[_0xd91c('0x43')]['id']}})[_0xd91c('0x25')](handleEntityNotFound(_0xf1257c,null))[_0xd91c('0x25')](removeEntity(_0xf1257c,null))[_0xd91c('0x41')](handleError(_0xf1257c,null));};exports[_0xd91c('0x49')]=function(_0x22733b,_0x5e3094){return db[_0xd91c('0x2b')][_0xd91c('0x49')]()[_0xd91c('0x25')](respondWithResult(_0x5e3094,null))[_0xd91c('0x41')](handleError(_0x5e3094,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 382f107..4a41562 100644 --- a/server/api/squareReportDetail/squareReportDetail.model.js +++ b/server/api/squareReportDetail/squareReportDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8696=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x8696,0x1ee));var _0x6869=function(_0x5b44d0,_0x50ab82){_0x5b44d0=_0x5b44d0-0x0;var _0x52c145=_0x8696[_0x5b44d0];return _0x52c145;};'use strict';var _=require('lodash');var util=require(_0x6869('0x0'));var logger=require(_0x6869('0x1'))(_0x6869('0x2'));var moment=require('moment');var BPromise=require(_0x6869('0x3'));var rp=require(_0x6869('0x4'));var fs=require('fs');var path=require(_0x6869('0x5'));var rimraf=require(_0x6869('0x6'));var config=require(_0x6869('0x7'));var attributes=require(_0x6869('0x8'));module[_0x6869('0x9')]=function(_0x2fee89,_0x224248){return _0x2fee89[_0x6869('0xa')](_0x6869('0xb'),attributes,{'tableName':_0x6869('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ce6=['path','rimraf','../../config/environment','exports','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment'];(function(_0x5df0ad,_0x24c80b){var _0x20d061=function(_0x4fa747){while(--_0x4fa747){_0x5df0ad['push'](_0x5df0ad['shift']());}};_0x20d061(++_0x24c80b);}(_0x3ce6,0x1d4));var _0x63ce=function(_0x208f29,_0x2c10ab){_0x208f29=_0x208f29-0x0;var _0x2b5440=_0x3ce6[_0x208f29];return _0x2b5440;};'use strict';var _=require(_0x63ce('0x0'));var util=require(_0x63ce('0x1'));var logger=require(_0x63ce('0x2'))(_0x63ce('0x3'));var moment=require(_0x63ce('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x63ce('0x5'));var rimraf=require(_0x63ce('0x6'));var config=require(_0x63ce('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x63ce('0x8')]=function(_0x6b75a9,_0x344d19){return _0x6b75a9['define'](_0x63ce('0x9'),attributes,{'tableName':_0x63ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 131c7a0..658969f 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb62e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','then','lodash','util'];(function(_0x56ea2f,_0x3b447d){var _0x11e4b6=function(_0x57864a){while(--_0x57864a){_0x56ea2f['push'](_0x56ea2f['shift']());}};_0x11e4b6(++_0x3b447d);}(_0xb62e,0x1de));var _0xeb62=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb62e[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var moment=require(_0xeb62('0x2'));var BPromise=require(_0xeb62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb62('0x4'));var db=require(_0xeb62('0x5'))['db'];var utils=require(_0xeb62('0x6'));var logger=require(_0xeb62('0x7'))(_0xeb62('0x8'));var config=require(_0xeb62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb62('0xa')][_0xeb62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31f5ea,_0x5e0dc4,_0x2065a0){return new BPromise(function(_0xab7049,_0x1e10ae){return client[_0xeb62('0xc')](_0x31f5ea,_0x2065a0)['then'](function(_0x5cdef3){logger[_0xeb62('0xd')](_0xeb62('0xe'),_0x5e0dc4,_0xeb62('0xf'));logger[_0xeb62('0x10')](_0xeb62('0x11'),_0x5e0dc4,_0xeb62('0xf'),JSON[_0xeb62('0x12')](_0x5cdef3));if(_0x5cdef3[_0xeb62('0x13')]){if(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x14')]===0x1f4){logger['error'](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);return _0x1e10ae(_0x5cdef3[_0xeb62('0x13')]['message']);}logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')]['message']);return _0xab7049(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);}else{logger[_0xeb62('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x5e0dc4,_0xeb62('0xf'));_0xab7049(_0x5cdef3[_0xeb62('0x16')][_0xeb62('0x15')]);}})[_0xeb62('0x17')](function(_0x3fb280){logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x3fb280);_0x1e10ae(_0x3fb280);});});}exports[_0xeb62('0x18')]=function(_0x39b138){var _0x27fd84=this;return new Promise(function(_0x27efc8,_0x11d516){return db[_0xeb62('0x19')]['create'](_0x39b138[_0xeb62('0x1a')],{'raw':_0x39b138[_0xeb62('0x1b')]?_0x39b138[_0xeb62('0x1b')][_0xeb62('0x1c')]===undefined?!![]:![]:!![]})[_0xeb62('0x1d')](function(_0x24cbf3){logger[_0xeb62('0xd')]('CreateSquareDetailsReport',_0x39b138);logger['debug'](_0xeb62('0x18'),_0x39b138,JSON[_0xeb62('0x12')](_0x24cbf3));_0x27efc8(_0x24cbf3);})[_0xeb62('0x17')](function(_0x13243f){logger[_0xeb62('0x13')]('CreateSquareDetailsReport',_0x13243f['message'],_0x39b138);_0x11d516(_0x27fd84[_0xeb62('0x13')](0x1f4,_0x13243f[_0xeb62('0x15')]));});});}; \ No newline at end of file +var _0x5423=['options','raw','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5423,0xe3));var _0x3542=function(_0x17392e,_0x425148){_0x17392e=_0x17392e-0x0;var _0x16514a=_0x5423[_0x17392e];return _0x16514a;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var moment=require('moment');var BPromise=require(_0x3542('0x2'));var rs=require(_0x3542('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3542('0x4'))['db'];var utils=require(_0x3542('0x5'));var logger=require(_0x3542('0x6'))(_0x3542('0x7'));var config=require('../../config/environment');var jayson=require(_0x3542('0x8'));var client=jayson[_0x3542('0x9')][_0x3542('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29c3fa,_0x2e1a62,_0x55413c){return new BPromise(function(_0x4cdc86,_0xbc51ab){return client[_0x3542('0xb')](_0x29c3fa,_0x55413c)['then'](function(_0x681195){logger[_0x3542('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x2e1a62,_0x3542('0xd'));logger[_0x3542('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x2e1a62,_0x3542('0xd'),JSON[_0x3542('0xf')](_0x681195));if(_0x681195[_0x3542('0x10')]){if(_0x681195[_0x3542('0x10')][_0x3542('0x11')]===0x1f4){logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x681195[_0x3542('0x10')][_0x3542('0x13')]);return _0xbc51ab(_0x681195[_0x3542('0x10')][_0x3542('0x13')]);}logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x681195['error'][_0x3542('0x13')]);return _0x4cdc86(_0x681195['error'][_0x3542('0x13')]);}else{logger[_0x3542('0xc')](_0x3542('0x12'),_0x2e1a62,'request\x20sent');_0x4cdc86(_0x681195[_0x3542('0x14')][_0x3542('0x13')]);}})[_0x3542('0x15')](function(_0x5726af){logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x5726af);_0xbc51ab(_0x5726af);});});}exports[_0x3542('0x16')]=function(_0x3d5199){var _0x493d95=this;return new Promise(function(_0x32df3f,_0x53d4aa){return db[_0x3542('0x17')][_0x3542('0x18')](_0x3d5199['body'],{'raw':_0x3d5199[_0x3542('0x19')]?_0x3d5199[_0x3542('0x19')][_0x3542('0x1a')]===undefined?!![]:![]:!![]})[_0x3542('0x1b')](function(_0x212950){logger['info']('CreateSquareDetailsReport',_0x3d5199);logger['debug'](_0x3542('0x16'),_0x3d5199,JSON['stringify'](_0x212950));_0x32df3f(_0x212950);})[_0x3542('0x15')](function(_0x551645){logger[_0x3542('0x10')]('CreateSquareDetailsReport',_0x551645['message'],_0x3d5199);_0x53d4aa(_0x493d95[_0x3542('0x10')](0x1f4,_0x551645[_0x3542('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 033dee7..e3d5cf8 100644 --- a/server/api/system/index.js +++ b/server/api/system/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x728b=['killProcess','exports','express','Router','isAuthenticated','index','get'];(function(_0x2fe678,_0x439334){var _0x58e423=function(_0xc4e9ea){while(--_0xc4e9ea){_0x2fe678['push'](_0x2fe678['shift']());}};_0x58e423(++_0x439334);}(_0x728b,0x167));var _0xb728=function(_0x40241a,_0x44fcb9){_0x40241a=_0x40241a-0x0;var _0x3cb2ce=_0x728b[_0x40241a];return _0x3cb2ce;};'use strict';var express=require(_0xb728('0x0'));var router=express[_0xb728('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router['get']('/',auth[_0xb728('0x2')](),controller[_0xb728('0x3')]);router[_0xb728('0x4')]('/process/:pid/kill',auth[_0xb728('0x2')](),controller[_0xb728('0x5')]);module[_0xb728('0x6')]=router; \ No newline at end of file +var _0x3640=['/process/:pid/kill','killProcess','exports','express','get','isAuthenticated','index'];(function(_0x401b20,_0x53de7f){var _0x27f818=function(_0x56f60d){while(--_0x56f60d){_0x401b20['push'](_0x401b20['shift']());}};_0x27f818(++_0x53de7f);}(_0x3640,0x1df));var _0x0364=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x3640[_0x2a6809];return _0x11c371;};'use strict';var express=require(_0x0364('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x0364('0x1')]('/',auth[_0x0364('0x2')](),controller[_0x0364('0x3')]);router[_0x0364('0x1')](_0x0364('0x4'),auth[_0x0364('0x2')](),controller[_0x0364('0x5')]);module[_0x0364('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 0baedd4..fec7a9d 100644 --- a/server/api/system/system.controller.js +++ b/server/api/system/system.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69f6=['systeminformation','child_process','exec','../../config/logger','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0xc695fe,_0x4e9720){var _0x5a5fa3=function(_0x13fa45){while(--_0x13fa45){_0xc695fe['push'](_0xc695fe['shift']());}};_0x5a5fa3(++_0x4e9720);}(_0x69f6,0x179));var _0x669f=function(_0x2c4bf2,_0x3b48d1){_0x2c4bf2=_0x2c4bf2-0x0;var _0x23645c=_0x69f6[_0x2c4bf2];return _0x23645c;};'use strict';var info=require(_0x669f('0x0'));var exec=require(_0x669f('0x1'))[_0x669f('0x2')];var logger=require(_0x669f('0x3'))(_0x669f('0x4'));var util=require(_0x669f('0x5'));var BPromise=require('bluebird');var _=require(_0x669f('0x6'));function handleError(_0x4272d9,_0x487afa,_0x47e433){_0x487afa=_0x487afa||0x1f4;return function(_0x4972d4){logger[_0x669f('0x7')](_0x669f('0x8'),_0x47e433,_0x487afa,util[_0x669f('0x9')](_0x4972d4,{'showHidden':![],'depth':null}));delete _0x4972d4[_0x669f('0xa')];_0x4272d9[_0x669f('0xb')](_0x487afa)[_0x669f('0xc')](_0x4972d4);};}exports[_0x669f('0xd')]=function(_0x34fff2,_0x5f4fd2){return info[_0x669f('0xe')]()[_0x669f('0xf')](function(_0x2c7fb3){return _0x5f4fd2[_0x669f('0xb')](0xc8)[_0x669f('0x10')](_0x2c7fb3);})[_0x669f('0x11')](function(_0x511732){return _0x5f4fd2[_0x669f('0xb')](0x1f4)[_0x669f('0x10')](_0x511732);});};exports['killProcess']=function(_0x43bf7c,_0x4e4f52){var _0x1dabd4=[_0x669f('0x12')];return new BPromise(function(_0x127a16,_0x41163c){return exec(util[_0x669f('0x13')](_0x669f('0x14'),_0x43bf7c[_0x669f('0x15')][_0x669f('0x16')]),function(_0x5d0c36,_0x3fd90d,_0x3e9a03){if(_0x5d0c36){return _0x41163c(_0x5d0c36);}return _0x127a16(_0x3fd90d);});})[_0x669f('0xf')](function(_0x2f0615){var _0x514cc9=![];var _0x396f57=_0x2f0615['split'](/\n/);for(var _0x4e98e2=0x0,_0x5173de=_0x1dabd4[_0x669f('0x17')];_0x4e98e2<_0x5173de,_0x514cc9===![];_0x4e98e2+=0x1){if(_0x2f0615[_0x669f('0x18')](_0x1dabd4[_0x4e98e2])>=0x0){_0x514cc9=!![];}}if(!_0x514cc9){throw new Error(util[_0x669f('0x13')](_0x669f('0x19'),_0x43bf7c[_0x669f('0x15')]['pid']));}process[_0x669f('0x1a')](_0x43bf7c[_0x669f('0x15')]['pid'],_0x669f('0x1b'));return _0x4e4f52[_0x669f('0xb')](0xc8)[_0x669f('0x10')]({'message':util[_0x669f('0x13')](_0x669f('0x1c'),_0x43bf7c[_0x669f('0x15')][_0x669f('0x16')])});})['catch'](handleError(_0x4e4f52,null,'killProcess'));}; \ No newline at end of file +var _0x098a=['indexOf','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x098a,0x8b));var _0xa098=function(_0x51f68e,_0x2494f0){_0x51f68e=_0x51f68e-0x0;var _0xc3e7c0=_0x098a[_0x51f68e];return _0xc3e7c0;};'use strict';var info=require(_0xa098('0x0'));var exec=require(_0xa098('0x1'))[_0xa098('0x2')];var logger=require('../../config/logger')(_0xa098('0x3'));var util=require(_0xa098('0x4'));var BPromise=require('bluebird');var _=require(_0xa098('0x5'));function handleError(_0x1ddff6,_0x240125,_0x3ab91e){_0x240125=_0x240125||0x1f4;return function(_0x1cb041){logger[_0xa098('0x6')](_0xa098('0x7'),_0x3ab91e,_0x240125,util[_0xa098('0x8')](_0x1cb041,{'showHidden':![],'depth':null}));delete _0x1cb041[_0xa098('0x9')];_0x1ddff6[_0xa098('0xa')](_0x240125)['send'](_0x1cb041);};}exports[_0xa098('0xb')]=function(_0x2cf06c,_0x437e42){return info[_0xa098('0xc')]()[_0xa098('0xd')](function(_0x3ddb4a){return _0x437e42['status'](0xc8)[_0xa098('0xe')](_0x3ddb4a);})[_0xa098('0xf')](function(_0x178679){return _0x437e42[_0xa098('0xa')](0x1f4)[_0xa098('0xe')](_0x178679);});};exports['killProcess']=function(_0x531bff,_0x3743a5){var _0x37c6e3=[_0xa098('0x10')];return new BPromise(function(_0x198b8f,_0x4e0028){return exec(util[_0xa098('0x11')](_0xa098('0x12'),_0x531bff[_0xa098('0x13')][_0xa098('0x14')]),function(_0x5e9eca,_0x29e330,_0x396255){if(_0x5e9eca){return _0x4e0028(_0x5e9eca);}return _0x198b8f(_0x29e330);});})[_0xa098('0xd')](function(_0x1795d9){var _0x1b04a3=![];var _0x2aea75=_0x1795d9[_0xa098('0x15')](/\n/);for(var _0x1a6c94=0x0,_0x293ca2=_0x37c6e3[_0xa098('0x16')];_0x1a6c94<_0x293ca2,_0x1b04a3===![];_0x1a6c94+=0x1){if(_0x1795d9[_0xa098('0x17')](_0x37c6e3[_0x1a6c94])>=0x0){_0x1b04a3=!![];}}if(!_0x1b04a3){throw new Error(util[_0xa098('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x531bff[_0xa098('0x13')][_0xa098('0x14')]));}process['kill'](_0x531bff['params'][_0xa098('0x14')],_0xa098('0x18'));return _0x3743a5['status'](0xc8)[_0xa098('0xe')]({'message':util[_0xa098('0x11')](_0xa098('0x19'),_0x531bff[_0xa098('0x13')]['pid'])});})[_0xa098('0xf')](handleError(_0x3743a5,null,_0xa098('0x1a')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index bf046f3..6057420 100644 --- a/server/api/tag/index.js +++ b/server/api/tag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7e5=['get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x3c3d47,_0x391539){var _0xb6128a=function(_0x11c995){while(--_0x11c995){_0x3c3d47['push'](_0x3c3d47['shift']());}};_0xb6128a(++_0x391539);}(_0xf7e5,0x7d));var _0x5f7e=function(_0x23c217,_0x3aee12){_0x23c217=_0x23c217-0x0;var _0x53fcf8=_0xf7e5[_0x23c217];return _0x53fcf8;};'use strict';var multer=require('multer');var util=require(_0x5f7e('0x0'));var path=require(_0x5f7e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5f7e('0x2')]();var fs_extra=require(_0x5f7e('0x3'));var auth=require(_0x5f7e('0x4'));var interaction=require(_0x5f7e('0x5'));var config=require(_0x5f7e('0x6'));var controller=require(_0x5f7e('0x7'));router[_0x5f7e('0x8')]('/',auth[_0x5f7e('0x9')](),controller[_0x5f7e('0xa')]);router['get']('/:id',auth[_0x5f7e('0x9')](),controller[_0x5f7e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5f7e('0xc')]);router[_0x5f7e('0xd')](_0x5f7e('0xe'),auth['isAuthenticated'](),controller[_0x5f7e('0xf')]);router[_0x5f7e('0x10')](_0x5f7e('0xe'),auth[_0x5f7e('0x9')](),controller[_0x5f7e('0x11')]);module[_0x5f7e('0x12')]=router; \ No newline at end of file +var _0x9aa8=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','multer','util','path','express'];(function(_0x2f452c,_0x45498e){var _0x5130ff=function(_0x46c6f4){while(--_0x46c6f4){_0x2f452c['push'](_0x2f452c['shift']());}};_0x5130ff(++_0x45498e);}(_0x9aa8,0x155));var _0x89aa=function(_0x108e18,_0x2b7aab){_0x108e18=_0x108e18-0x0;var _0x1f4710=_0x9aa8[_0x108e18];return _0x1f4710;};'use strict';var multer=require(_0x89aa('0x0'));var util=require(_0x89aa('0x1'));var path=require(_0x89aa('0x2'));var timeout=require('connect-timeout');var express=require(_0x89aa('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x89aa('0x4'));var config=require(_0x89aa('0x5'));var controller=require('./tag.controller');router[_0x89aa('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x89aa('0x6')](_0x89aa('0x7'),auth[_0x89aa('0x8')](),controller[_0x89aa('0x9')]);router[_0x89aa('0xa')]('/',auth[_0x89aa('0x8')](),controller[_0x89aa('0xb')]);router[_0x89aa('0xc')](_0x89aa('0x7'),auth[_0x89aa('0x8')](),controller[_0x89aa('0xd')]);router[_0x89aa('0xe')](_0x89aa('0x7'),auth[_0x89aa('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 684b0e0..404e3ac 100644 --- a/server/api/tag/tag.attributes.js +++ b/server/api/tag/tag.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3149=['#0091EA','sequelize','STRING','name'];(function(_0x462b51,_0x3f2aff){var _0x5c8948=function(_0x51c462){while(--_0x51c462){_0x462b51['push'](_0x462b51['shift']());}};_0x5c8948(++_0x3f2aff);}(_0x3149,0x181));var _0x9314=function(_0x2b3006,_0x31763c){_0x2b3006=_0x2b3006-0x0;var _0x5e24d4=_0x3149[_0x2b3006];return _0x5e24d4;};'use strict';var Sequelize=require(_0x9314('0x0'));module['exports']={'name':{'type':Sequelize[_0x9314('0x1')],'unique':_0x9314('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x9314('0x1')],'defaultValue':_0x9314('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1399=['exports','name','#0091EA','STRING','sequelize'];(function(_0xf390de,_0x55fa16){var _0x1c005c=function(_0x151cb4){while(--_0x151cb4){_0xf390de['push'](_0xf390de['shift']());}};_0x1c005c(++_0x55fa16);}(_0x1399,0x16c));var _0x9139=function(_0x1113dc,_0x188e4b){_0x1113dc=_0x1113dc-0x0;var _0x1ebf6e=_0x1399[_0x1113dc];return _0x1ebf6e;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9139('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x9139('0x3')},'description':{'type':Sequelize[_0x9139('0x4')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 6518fc7..7a699ed 100644 --- a/server/api/tag/tag.controller.js +++ b/server/api/tag/tag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76dc=['where','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','name','send','Tag','fieldName','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3d3fa5,_0x5be144){var _0x5a1a7a=function(_0x2949ee){while(--_0x2949ee){_0x3d3fa5['push'](_0x3d3fa5['shift']());}};_0x5a1a7a(++_0x5be144);}(_0x76dc,0x1f2));var _0xc76d=function(_0x5152e6,_0x3a7f4f){_0x5152e6=_0x5152e6-0x0;var _0x4e045a=_0x76dc[_0x5152e6];return _0x4e045a;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){var _0x637d68=_0x11b42f[_0xc76d('0x26')]({'plain':!![]});var _0x55ca79=_0xc76d('0x27');return db[_0xc76d('0x28')][_0xc76d('0x25')]({'where':{'type':_0x55ca79,'resourceId':_0x637d68['id']}})[_0xc76d('0x24')](function(){return _0x11b42f;});})[_0xc76d('0x24')](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x59ebd1,_0x59dabf){return function(_0x285430){if(!_0x285430){_0x59ebd1[_0xc76d('0x17')](0x194);}return _0x285430;};}function handleError(_0x5069ea,_0x31501a){_0x31501a=_0x31501a||0x1f4;return function(_0x52a79a){logger[_0xc76d('0x29')](_0x52a79a['stack']);if(_0x52a79a[_0xc76d('0x2a')]){delete _0x52a79a['name'];}_0x5069ea[_0xc76d('0x18')](_0x31501a)[_0xc76d('0x2b')](_0x52a79a);};}exports['index']=function(_0x3d4076,_0x1c68f3){var _0x9ab96c={},_0x2cf501={},_0x4feeda={'count':0x0,'rows':[]};var _0x283e16=_['map'](db[_0xc76d('0x2c')]['rawAttributes'],function(_0x30769f){return{'name':_0x30769f[_0xc76d('0x2d')],'type':_0x30769f['type']['key']};});_0x2cf501['model']=_['map'](_0x283e16,_0xc76d('0x2a'));_0x2cf501[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x3d4076[_0xc76d('0x2e')]);_0x2cf501[_0xc76d('0x30')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],_0x2cf501['query']);_0x9ab96c[_0xc76d('0x32')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x9ab96c[_0xc76d('0x32')]=_0x9ab96c['attributes'][_0xc76d('0x34')]?_0x9ab96c[_0xc76d('0x32')]:_0x2cf501[_0xc76d('0x31')];if(!_0x3d4076['query'][_0xc76d('0x35')](_0xc76d('0x36'))){_0x9ab96c[_0xc76d('0x1d')]=qs['limit'](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1d')]);_0x9ab96c[_0xc76d('0x1c')]=qs[_0xc76d('0x1c')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x9ab96c['order']=qs['sort'](_0x3d4076[_0xc76d('0x2e')]['sort']);_0x9ab96c[_0xc76d('0x37')]=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x3d4076[_0xc76d('0x2e')],_0x2cf501['filters']),_0x283e16);if(_0x3d4076['query'][_0xc76d('0x39')]){_0x9ab96c[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x9ab96c[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x283e16,function(_0x58c724){if(_0x58c724[_0xc76d('0x3c')]!==_0xc76d('0x3d')){var _0x321989={};_0x321989[_0x58c724[_0xc76d('0x2a')]]={'$like':'%'+_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x321989;}})});}_0x9ab96c=_[_0xc76d('0x3a')]({},_0x9ab96c,_0x3d4076[_0xc76d('0x3e')]);var _0x305f7d={'where':_0x9ab96c[_0xc76d('0x37')]};return db['Tag']['count'](_0x305f7d)[_0xc76d('0x24')](function(_0x2a0759){_0x4feeda[_0xc76d('0x1b')]=_0x2a0759;if(_0x3d4076[_0xc76d('0x2e')]['includeAll']){_0x9ab96c['include']=[{'all':!![]}];}return db[_0xc76d('0x2c')][_0xc76d('0x3f')](_0x9ab96c);})[_0xc76d('0x24')](function(_0x15eb42){_0x4feeda[_0xc76d('0x40')]=_0x15eb42;return _0x4feeda;})[_0xc76d('0x24')](respondWithFilteredResult(_0x1c68f3,_0x9ab96c))[_0xc76d('0x41')](handleError(_0x1c68f3,null));};exports[_0xc76d('0x42')]=function(_0x50e922,_0x7bf0){var _0x95193f={'raw':!![],'where':{'id':_0x50e922[_0xc76d('0x43')]['id']}},_0x1bf8a0={};_0x1bf8a0['model']=_['keys'](db['Tag']['rawAttributes']);_0x1bf8a0['query']=_['keys'](_0x50e922['query']);_0x1bf8a0[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],_0x1bf8a0[_0xc76d('0x2e')]);_0x95193f[_0xc76d('0x32')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x50e922['query'][_0xc76d('0x33')]));_0x95193f[_0xc76d('0x32')]=_0x95193f[_0xc76d('0x32')][_0xc76d('0x34')]?_0x95193f[_0xc76d('0x32')]:_0x1bf8a0[_0xc76d('0x31')];if(_0x50e922[_0xc76d('0x2e')][_0xc76d('0x45')]){_0x95193f[_0xc76d('0x46')]=[{'all':!![]}];}_0x95193f=_['merge']({},_0x95193f,_0x50e922['options']);return db[_0xc76d('0x2c')][_0xc76d('0x47')](_0x95193f)[_0xc76d('0x24')](handleEntityNotFound(_0x7bf0,null))[_0xc76d('0x24')](respondWithResult(_0x7bf0,null))[_0xc76d('0x41')](handleError(_0x7bf0,null));};exports['create']=function(_0x25fc9d,_0x1ede13){return db['Tag']['create'](_0x25fc9d[_0xc76d('0x48')],{})[_0xc76d('0x24')](function(_0x48cad0){var _0xe44a25=_0x25fc9d[_0xc76d('0x49')][_0xc76d('0x26')]({'plain':!![]});if(!_0xe44a25)throw new Error(_0xc76d('0x4a'));if(_0xe44a25[_0xc76d('0x4b')]===_0xc76d('0x49')){var _0x25a549=_0x48cad0[_0xc76d('0x26')]({'plain':!![]});var _0x4452a8=_0xc76d('0x27');return db['UserProfileSection'][_0xc76d('0x47')]({'where':{'name':_0x4452a8,'userProfileId':_0xe44a25[_0xc76d('0x4c')]},'raw':!![]})[_0xc76d('0x24')](function(_0x55e3af){if(_0x55e3af&&_0x55e3af[_0xc76d('0x4d')]===0x0){return db[_0xc76d('0x28')]['create']({'name':_0x25a549[_0xc76d('0x2a')],'resourceId':_0x25a549['id'],'type':_0x55e3af['name'],'sectionId':_0x55e3af['id']},{})[_0xc76d('0x24')](function(){return _0x48cad0;});}else{return _0x48cad0;}})[_0xc76d('0x41')](function(_0x316978){logger[_0xc76d('0x29')](_0xc76d('0x4e'),_0x316978);throw _0x316978;});}return _0x48cad0;})['then'](respondWithResult(_0x1ede13,0xc9))['catch'](handleError(_0x1ede13,null));};exports['update']=function(_0x320483,_0x746759){if(_0x320483[_0xc76d('0x48')]['id']){delete _0x320483[_0xc76d('0x48')]['id'];}return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x320483['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x746759,null))[_0xc76d('0x24')](saveUpdates(_0x320483[_0xc76d('0x48')],null))[_0xc76d('0x24')](respondWithResult(_0x746759,null))[_0xc76d('0x41')](handleError(_0x746759,null));};exports['destroy']=function(_0x275dfd,_0x463cbe){return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x275dfd[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x463cbe,null))['then'](removeEntity(_0x463cbe,null))[_0xc76d('0x41')](handleError(_0x463cbe,null));}; \ No newline at end of file +var _0xb332=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','send','index','map','Tag','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','options','count','include','findAll','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','find','body','destroy','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce'];(function(_0x106b3d,_0x2fb530){var _0x597454=function(_0x1e017d){while(--_0x1e017d){_0x106b3d['push'](_0x106b3d['shift']());}};_0x597454(++_0x2fb530);}(_0xb332,0xd9));var _0x2b33=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xb332[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x2b33('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2b33('0x1'));var jsonpatch=require(_0x2b33('0x2'));var rp=require('request-promise');var moment=require(_0x2b33('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2b33('0x4'));var util=require('util');var path=require(_0x2b33('0x5'));var sox=require('sox');var csv=require(_0x2b33('0x6'));var ejs=require(_0x2b33('0x7'));var fs=require('fs');var fs_extra=require(_0x2b33('0x8'));var _=require(_0x2b33('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2b33('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2b33('0x6'));var querystring=require(_0x2b33('0xb'));var Papa=require(_0x2b33('0xc'));var Redis=require(_0x2b33('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2b33('0xe'));var as=require(_0x2b33('0xf'));var hardwareService=require(_0x2b33('0x10'));var logger=require(_0x2b33('0x11'))(_0x2b33('0x12'));var utils=require(_0x2b33('0x13'));var config=require(_0x2b33('0x14'));var licenseUtil=require(_0x2b33('0x15'));var db=require(_0x2b33('0x16'))['db'];function respondWithStatusCode(_0x3969cb,_0xca2248){_0xca2248=_0xca2248||0xcc;return function(_0x4df129){if(_0x4df129){return _0x3969cb[_0x2b33('0x17')](_0xca2248);}return _0x3969cb[_0x2b33('0x18')](_0xca2248)[_0x2b33('0x19')]();};}function respondWithResult(_0x4ef886,_0x173c75){_0x173c75=_0x173c75||0xc8;return function(_0x4d39db){if(_0x4d39db){return _0x4ef886[_0x2b33('0x18')](_0x173c75)[_0x2b33('0x1a')](_0x4d39db);}};}function respondWithFilteredResult(_0x233cd9,_0x57aea7){return function(_0x52693f){if(_0x52693f){var _0x1d8e75=typeof _0x57aea7[_0x2b33('0x1b')]===_0x2b33('0x1c')&&typeof _0x57aea7[_0x2b33('0x1d')]===_0x2b33('0x1c');var _0x4d69d0=_0x52693f['count'];var _0x59f0b6=_0x1d8e75?0x0:_0x57aea7[_0x2b33('0x1b')];var _0x4f10c4=_0x1d8e75?_0x52693f['count']:_0x57aea7[_0x2b33('0x1b')]+_0x57aea7[_0x2b33('0x1d')];var _0x205d8f;if(_0x4f10c4>=_0x4d69d0){_0x4f10c4=_0x4d69d0;_0x205d8f=0xc8;}else{_0x205d8f=0xce;}_0x233cd9['status'](_0x205d8f);return _0x233cd9[_0x2b33('0x1e')]('Content-Range',_0x59f0b6+'-'+_0x4f10c4+'/'+_0x4d69d0)[_0x2b33('0x1a')](_0x52693f);}return null;};}function patchUpdates(_0x2565be){return function(_0x8c8dc2){try{jsonpatch[_0x2b33('0x1f')](_0x8c8dc2,_0x2565be,!![]);}catch(_0x233ba6){return BPromise[_0x2b33('0x20')](_0x233ba6);}return _0x8c8dc2[_0x2b33('0x21')]();};}function saveUpdates(_0x4fb725,_0x23024c){return function(_0x1d9c98){if(_0x1d9c98){return _0x1d9c98[_0x2b33('0x22')](_0x4fb725)[_0x2b33('0x23')](function(_0x58998e){return _0x58998e;});}return null;};}function removeEntity(_0x1c27d4,_0x27f1b8){return function(_0x2605e6){if(_0x2605e6){return _0x2605e6['destroy']()[_0x2b33('0x23')](function(){var _0x1b9a48=_0x2605e6[_0x2b33('0x24')]({'plain':!![]});var _0x32b835='Tags';return db[_0x2b33('0x25')]['destroy']({'where':{'type':_0x32b835,'resourceId':_0x1b9a48['id']}})[_0x2b33('0x23')](function(){return _0x2605e6;});})['then'](function(){_0x1c27d4[_0x2b33('0x18')](0xcc)[_0x2b33('0x19')]();});}};}function handleEntityNotFound(_0x5d8d05,_0x195aa2){return function(_0x53c2ad){if(!_0x53c2ad){_0x5d8d05[_0x2b33('0x17')](0x194);}return _0x53c2ad;};}function handleError(_0x5b16a8,_0x315ebd){_0x315ebd=_0x315ebd||0x1f4;return function(_0xa109f4){logger[_0x2b33('0x26')](_0xa109f4[_0x2b33('0x27')]);if(_0xa109f4[_0x2b33('0x28')]){delete _0xa109f4[_0x2b33('0x28')];}_0x5b16a8[_0x2b33('0x18')](_0x315ebd)[_0x2b33('0x29')](_0xa109f4);};}exports[_0x2b33('0x2a')]=function(_0x203c43,_0x4cf72f){var _0x5b6527={},_0x106ea0={},_0x2a081c={'count':0x0,'rows':[]};var _0x3282bf=_[_0x2b33('0x2b')](db[_0x2b33('0x2c')]['rawAttributes'],function(_0x570765){return{'name':_0x570765[_0x2b33('0x2d')],'type':_0x570765[_0x2b33('0x2e')][_0x2b33('0x2f')]};});_0x106ea0[_0x2b33('0x30')]=_[_0x2b33('0x2b')](_0x3282bf,_0x2b33('0x28'));_0x106ea0['query']=_[_0x2b33('0x31')](_0x203c43['query']);_0x106ea0[_0x2b33('0x32')]=_[_0x2b33('0x33')](_0x106ea0[_0x2b33('0x30')],_0x106ea0[_0x2b33('0x34')]);_0x5b6527[_0x2b33('0x35')]=_[_0x2b33('0x33')](_0x106ea0[_0x2b33('0x30')],qs[_0x2b33('0x36')](_0x203c43[_0x2b33('0x34')][_0x2b33('0x36')]));_0x5b6527[_0x2b33('0x35')]=_0x5b6527[_0x2b33('0x35')][_0x2b33('0x37')]?_0x5b6527[_0x2b33('0x35')]:_0x106ea0[_0x2b33('0x30')];if(!_0x203c43[_0x2b33('0x34')]['hasOwnProperty']('nolimit')){_0x5b6527['limit']=qs[_0x2b33('0x1d')](_0x203c43[_0x2b33('0x34')][_0x2b33('0x1d')]);_0x5b6527[_0x2b33('0x1b')]=qs[_0x2b33('0x1b')](_0x203c43['query']['offset']);}_0x5b6527[_0x2b33('0x38')]=qs['sort'](_0x203c43[_0x2b33('0x34')][_0x2b33('0x39')]);_0x5b6527[_0x2b33('0x3a')]=qs[_0x2b33('0x32')](_[_0x2b33('0x3b')](_0x203c43[_0x2b33('0x34')],_0x106ea0[_0x2b33('0x32')]),_0x3282bf);if(_0x203c43[_0x2b33('0x34')][_0x2b33('0x3c')]){_0x5b6527[_0x2b33('0x3a')]=_['merge'](_0x5b6527[_0x2b33('0x3a')],{'$or':_[_0x2b33('0x2b')](_0x3282bf,function(_0x1f0160){if(_0x1f0160['type']!=='VIRTUAL'){var _0x3afaa5={};_0x3afaa5[_0x1f0160['name']]={'$like':'%'+_0x203c43[_0x2b33('0x34')][_0x2b33('0x3c')]+'%'};return _0x3afaa5;}})});}_0x5b6527=_['merge']({},_0x5b6527,_0x203c43[_0x2b33('0x3d')]);var _0x13874a={'where':_0x5b6527['where']};return db[_0x2b33('0x2c')][_0x2b33('0x3e')](_0x13874a)['then'](function(_0x2168b6){_0x2a081c[_0x2b33('0x3e')]=_0x2168b6;if(_0x203c43[_0x2b33('0x34')]['includeAll']){_0x5b6527[_0x2b33('0x3f')]=[{'all':!![]}];}return db[_0x2b33('0x2c')][_0x2b33('0x40')](_0x5b6527);})[_0x2b33('0x23')](function(_0x22ce0c){_0x2a081c['rows']=_0x22ce0c;return _0x2a081c;})[_0x2b33('0x23')](respondWithFilteredResult(_0x4cf72f,_0x5b6527))[_0x2b33('0x41')](handleError(_0x4cf72f,null));};exports[_0x2b33('0x42')]=function(_0x5ad3b2,_0x1fd4b2){var _0x2ac846={'raw':!![],'where':{'id':_0x5ad3b2[_0x2b33('0x43')]['id']}},_0x3c61d6={};_0x3c61d6['model']=_[_0x2b33('0x31')](db[_0x2b33('0x2c')]['rawAttributes']);_0x3c61d6['query']=_['keys'](_0x5ad3b2[_0x2b33('0x34')]);_0x3c61d6['filters']=_[_0x2b33('0x33')](_0x3c61d6[_0x2b33('0x30')],_0x3c61d6[_0x2b33('0x34')]);_0x2ac846[_0x2b33('0x35')]=_[_0x2b33('0x33')](_0x3c61d6[_0x2b33('0x30')],qs[_0x2b33('0x36')](_0x5ad3b2[_0x2b33('0x34')]['fields']));_0x2ac846[_0x2b33('0x35')]=_0x2ac846[_0x2b33('0x35')][_0x2b33('0x37')]?_0x2ac846[_0x2b33('0x35')]:_0x3c61d6[_0x2b33('0x30')];if(_0x5ad3b2[_0x2b33('0x34')]['includeAll']){_0x2ac846['include']=[{'all':!![]}];}_0x2ac846=_['merge']({},_0x2ac846,_0x5ad3b2['options']);return db[_0x2b33('0x2c')]['find'](_0x2ac846)[_0x2b33('0x23')](handleEntityNotFound(_0x1fd4b2,null))['then'](respondWithResult(_0x1fd4b2,null))['catch'](handleError(_0x1fd4b2,null));};exports[_0x2b33('0x44')]=function(_0xd15da9,_0x357724){return db['Tag'][_0x2b33('0x44')](_0xd15da9['body'],{})[_0x2b33('0x23')](function(_0x27d3b6){var _0x2a20a4=_0xd15da9[_0x2b33('0x45')][_0x2b33('0x24')]({'plain':!![]});if(!_0x2a20a4)throw new Error(_0x2b33('0x46'));if(_0x2a20a4['role']===_0x2b33('0x45')){var _0x27f766=_0x27d3b6[_0x2b33('0x24')]({'plain':!![]});var _0x4e8c21=_0x2b33('0x47');return db[_0x2b33('0x48')][_0x2b33('0x49')]({'where':{'name':_0x4e8c21,'userProfileId':_0x2a20a4['userProfileId']},'raw':!![]})[_0x2b33('0x23')](function(_0x4cffe9){if(_0x4cffe9&&_0x4cffe9['autoAssociation']===0x0){return db[_0x2b33('0x25')][_0x2b33('0x44')]({'name':_0x27f766[_0x2b33('0x28')],'resourceId':_0x27f766['id'],'type':_0x4cffe9[_0x2b33('0x28')],'sectionId':_0x4cffe9['id']},{})[_0x2b33('0x23')](function(){return _0x27d3b6;});}else{return _0x27d3b6;}})[_0x2b33('0x41')](function(_0x1982aa){logger[_0x2b33('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1982aa);throw _0x1982aa;});}return _0x27d3b6;})[_0x2b33('0x23')](respondWithResult(_0x357724,0xc9))[_0x2b33('0x41')](handleError(_0x357724,null));};exports['update']=function(_0x28e75b,_0x45a939){if(_0x28e75b['body']['id']){delete _0x28e75b[_0x2b33('0x4a')]['id'];}return db[_0x2b33('0x2c')][_0x2b33('0x49')]({'where':{'id':_0x28e75b[_0x2b33('0x43')]['id']}})['then'](handleEntityNotFound(_0x45a939,null))[_0x2b33('0x23')](saveUpdates(_0x28e75b[_0x2b33('0x4a')],null))['then'](respondWithResult(_0x45a939,null))[_0x2b33('0x41')](handleError(_0x45a939,null));};exports[_0x2b33('0x4b')]=function(_0x1ce316,_0x26e0ca){return db[_0x2b33('0x2c')][_0x2b33('0x49')]({'where':{'id':_0x1ce316[_0x2b33('0x43')]['id']}})['then'](handleEntityNotFound(_0x26e0ca,null))['then'](removeEntity(_0x26e0ca,null))[_0x2b33('0x41')](handleError(_0x26e0ca,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index b978fdd..86ca159 100644 --- a/server/api/tag/tag.model.js +++ b/server/api/tag/tag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0286=['path','rimraf','../../config/environment','exports','define','Tag','tools_tags','util','../../config/logger','api','moment','request-promise'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0x0286,0x7f));var _0x6028=function(_0x35004b,_0x95cc91){_0x35004b=_0x35004b-0x0;var _0x588a1a=_0x0286[_0x35004b];return _0x588a1a;};'use strict';var _=require('lodash');var util=require(_0x6028('0x0'));var logger=require(_0x6028('0x1'))(_0x6028('0x2'));var moment=require(_0x6028('0x3'));var BPromise=require('bluebird');var rp=require(_0x6028('0x4'));var fs=require('fs');var path=require(_0x6028('0x5'));var rimraf=require(_0x6028('0x6'));var config=require(_0x6028('0x7'));var attributes=require('./tag.attributes');module[_0x6028('0x8')]=function(_0x4b9b65,_0x398959){return _0x4b9b65[_0x6028('0x9')](_0x6028('0xa'),attributes,{'tableName':_0x6028('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93da=['define','Tag','tools_tags','lodash','../../config/logger','api','moment','bluebird','../../config/environment','./tag.attributes','exports'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x93da,0x92));var _0xa93d=function(_0x10c81b,_0x3b7d25){_0x10c81b=_0x10c81b-0x0;var _0x13a8f4=_0x93da[_0x10c81b];return _0x13a8f4;};'use strict';var _=require(_0xa93d('0x0'));var util=require('util');var logger=require(_0xa93d('0x1'))(_0xa93d('0x2'));var moment=require(_0xa93d('0x3'));var BPromise=require(_0xa93d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa93d('0x5'));var attributes=require(_0xa93d('0x6'));module[_0xa93d('0x7')]=function(_0x425437,_0x179156){return _0x425437[_0xa93d('0x8')](_0xa93d('0x9'),attributes,{'tableName':_0xa93d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 3df2ce5..0fabf2f 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6953=['catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x6953,0x91));var _0x3695=function(_0x2c319c,_0x384cbb){_0x2c319c=_0x2c319c-0x0;var _0xd7bb48=_0x6953[_0x2c319c];return _0xd7bb48;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3695('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3695('0x3'));var logger=require(_0x3695('0x4'))(_0x3695('0x5'));var config=require('../../config/environment');var jayson=require(_0x3695('0x6'));var client=jayson['client'][_0x3695('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14eb32,_0x912099,_0x1a4e75){return new BPromise(function(_0x301e46,_0x4e337b){return client[_0x3695('0x8')](_0x14eb32,_0x1a4e75)['then'](function(_0x1fcd43){logger['info']('Tag,\x20%s,\x20%s',_0x912099,_0x3695('0x9'));logger['debug'](_0x3695('0xa'),_0x912099,_0x3695('0x9'),JSON[_0x3695('0xb')](_0x1fcd43));if(_0x1fcd43[_0x3695('0xc')]){if(_0x1fcd43[_0x3695('0xc')][_0x3695('0xd')]===0x1f4){logger['error'](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x4e337b(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}logger[_0x3695('0xc')](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x301e46(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}else{logger['info'](_0x3695('0xe'),_0x912099,_0x3695('0x9'));_0x301e46(_0x1fcd43[_0x3695('0x10')][_0x3695('0xf')]);}})[_0x3695('0x11')](function(_0x1973ee){logger[_0x3695('0xc')]('Tag,\x20%s,\x20%s',_0x912099,_0x1973ee);_0x4e337b(_0x1973ee);});});} \ No newline at end of file +var _0x2123=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Tag,\x20%s,\x20%s','message','catch'];(function(_0x4776cc,_0x3a715e){var _0x427bda=function(_0x36b1c7){while(--_0x36b1c7){_0x4776cc['push'](_0x4776cc['shift']());}};_0x427bda(++_0x3a715e);}(_0x2123,0x190));var _0x3212=function(_0x47d393,_0x109ffb){_0x47d393=_0x47d393-0x0;var _0x5df3bf=_0x2123[_0x47d393];return _0x5df3bf;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var BPromise=require(_0x3212('0x3'));var rs=require(_0x3212('0x4'));var fs=require('fs');var Redis=require(_0x3212('0x5'));var db=require(_0x3212('0x6'))['db'];var utils=require(_0x3212('0x7'));var logger=require(_0x3212('0x8'))(_0x3212('0x9'));var config=require(_0x3212('0xa'));var jayson=require(_0x3212('0xb'));var client=jayson['client'][_0x3212('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b1302,_0x1fec5d,_0x4b35e9){return new BPromise(function(_0x3e17a3,_0x56c38f){return client[_0x3212('0xd')](_0x2b1302,_0x4b35e9)[_0x3212('0xe')](function(_0x8ca483){logger[_0x3212('0xf')]('Tag,\x20%s,\x20%s',_0x1fec5d,'request\x20sent');logger[_0x3212('0x10')](_0x3212('0x11'),_0x1fec5d,_0x3212('0x12'),JSON[_0x3212('0x13')](_0x8ca483));if(_0x8ca483[_0x3212('0x14')]){if(_0x8ca483[_0x3212('0x14')][_0x3212('0x15')]===0x1f4){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x56c38f(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x3e17a3(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}else{logger[_0x3212('0xf')](_0x3212('0x16'),_0x1fec5d,_0x3212('0x12'));_0x3e17a3(_0x8ca483['result'][_0x3212('0x17')]);}})[_0x3212('0x18')](function(_0x2720c6){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x2720c6);_0x56c38f(_0x2720c6);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index decce08..aa3d967 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 6eab7d0..83561a6 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['name','exports','STRING'];(function(_0x495947,_0x3ed5ca){var _0x4c19d3=function(_0x56098c){while(--_0x56098c){_0x495947['push'](_0x495947['shift']());}};_0x4c19d3(++_0x3ed5ca);}(_0x2032,0xd9));var _0x2203=function(_0x5bdc1b,_0x2202fe){_0x5bdc1b=_0x5bdc1b-0x0;var _0x42acdd=_0x2032[_0x5bdc1b];return _0x42acdd;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe706,0xa3));var _0x6e70=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0xe706[_0x17784a];return _0x41aded;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index c7fbee5..ff6c273 100644 --- a/server/api/team/team.controller.js +++ b/server/api/team/team.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7072=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','addQueues','Unknown\x20channel','add','Queues','ids','removeQueues','isArray','Voice','Chat','Mail','Sms','Fax','Whatsapp','penalty','QueueId','findOrCreate','emit','Queue:save','User','interface','isNil','SIP/%s','voicePause','TeamVoiceQueue','all','TeamVoicePrefix','UserVoicePrefix','upsert','removeAgents','Openchannel','transaction','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','update','error','stack','name','send','Team','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','then','rows','catch','show','params','keys','options','find','create'];(function(_0x37ad63,_0x2f0899){var _0x54cc03=function(_0x35d5c3){while(--_0x35d5c3){_0x37ad63['push'](_0x37ad63['shift']());}};_0x54cc03(++_0x2f0899);}(_0x7072,0xe7));var _0x2707=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x7072[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x2707('0x0'));var rimraf=require(_0x2707('0x1'));var zipdir=require(_0x2707('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require(_0x2707('0x5'));var Mustache=require(_0x2707('0x6'));var util=require(_0x2707('0x7'));var path=require(_0x2707('0x8'));var sox=require(_0x2707('0x9'));var csv=require(_0x2707('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2707('0xb'));var _=require(_0x2707('0xc'));var squel=require(_0x2707('0xd'));var crypto=require(_0x2707('0xe'));var jsforce=require(_0x2707('0xf'));var deskjs=require(_0x2707('0x10'));var toCsv=require(_0x2707('0xa'));var querystring=require(_0x2707('0x11'));var Papa=require(_0x2707('0x12'));var Redis=require(_0x2707('0x13'));var authService=require(_0x2707('0x14'));var qs=require(_0x2707('0x15'));var as=require(_0x2707('0x16'));var hardwareService=require(_0x2707('0x17'));var logger=require(_0x2707('0x18'))(_0x2707('0x19'));var utils=require(_0x2707('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x2707('0x1b'));var db=require(_0x2707('0x1c'))['db'];config['redis']=_[_0x2707('0x1d')](config[_0x2707('0x1e')],{'host':_0x2707('0x1f'),'port':0x18eb});var socket=require(_0x2707('0x20'))(new Redis(config[_0x2707('0x1e')]));require(_0x2707('0x21'))['register'](socket);function respondWithStatusCode(_0x36fc55,_0x2c2e00){_0x2c2e00=_0x2c2e00||0xcc;return function(_0x37ab2e){if(_0x37ab2e){return _0x36fc55[_0x2707('0x22')](_0x2c2e00);}return _0x36fc55[_0x2707('0x23')](_0x2c2e00)[_0x2707('0x24')]();};}function respondWithResult(_0x2c8bfd,_0x328bb0){_0x328bb0=_0x328bb0||0xc8;return function(_0x457a3c){if(_0x457a3c){return _0x2c8bfd[_0x2707('0x23')](_0x328bb0)[_0x2707('0x25')](_0x457a3c);}};}function respondWithFilteredResult(_0x503961,_0x537f66){return function(_0x2825cb){if(_0x2825cb){var _0x18aea2=typeof _0x537f66['offset']==='undefined'&&typeof _0x537f66['limit']===_0x2707('0x26');var _0x56c503=_0x2825cb['count'];var _0x119288=_0x18aea2?0x0:_0x537f66['offset'];var _0x1db67a=_0x18aea2?_0x2825cb[_0x2707('0x27')]:_0x537f66[_0x2707('0x28')]+_0x537f66['limit'];var _0x1cc323;if(_0x1db67a>=_0x56c503){_0x1db67a=_0x56c503;_0x1cc323=0xc8;}else{_0x1cc323=0xce;}_0x503961[_0x2707('0x23')](_0x1cc323);return _0x503961[_0x2707('0x29')]('Content-Range',_0x119288+'-'+_0x1db67a+'/'+_0x56c503)['json'](_0x2825cb);}return null;};}function patchUpdates(_0x3480fc){return function(_0x35aa76){try{jsonpatch[_0x2707('0x2a')](_0x35aa76,_0x3480fc,!![]);}catch(_0x998bae){return BPromise[_0x2707('0x2b')](_0x998bae);}return _0x35aa76[_0x2707('0x2c')]();};}function saveUpdates(_0x54710e,_0xf97bca){return function(_0x1027d2){if(_0x1027d2){return _0x1027d2[_0x2707('0x2d')](_0x54710e)['then'](function(_0x21dc3c){return _0x21dc3c;});}return null;};}function handleEntityNotFound(_0x5d0aeb,_0x5a76f9){return function(_0x2cced2){if(!_0x2cced2){_0x5d0aeb[_0x2707('0x22')](0x194);}return _0x2cced2;};}function handleError(_0x2fea86,_0x1444ea){_0x1444ea=_0x1444ea||0x1f4;return function(_0x3d5f19){logger[_0x2707('0x2e')](_0x3d5f19[_0x2707('0x2f')]);if(_0x3d5f19[_0x2707('0x30')]){delete _0x3d5f19[_0x2707('0x30')];}_0x2fea86['status'](_0x1444ea)[_0x2707('0x31')](_0x3d5f19);};}exports['index']=function(_0xbe6b71,_0x4a4edf){var _0x1b07ad={},_0x3c6cd5={},_0x5abbe2={'count':0x0,'rows':[]};var _0x26de9f=_['map'](db[_0x2707('0x32')][_0x2707('0x33')],function(_0x29a4f5){return{'name':_0x29a4f5[_0x2707('0x34')],'type':_0x29a4f5[_0x2707('0x35')][_0x2707('0x36')]};});_0x3c6cd5[_0x2707('0x37')]=_[_0x2707('0x38')](_0x26de9f,'name');_0x3c6cd5[_0x2707('0x39')]=_['keys'](_0xbe6b71[_0x2707('0x39')]);_0x3c6cd5[_0x2707('0x3a')]=_[_0x2707('0x3b')](_0x3c6cd5[_0x2707('0x37')],_0x3c6cd5[_0x2707('0x39')]);_0x1b07ad[_0x2707('0x3c')]=_[_0x2707('0x3b')](_0x3c6cd5[_0x2707('0x37')],qs['fields'](_0xbe6b71[_0x2707('0x39')][_0x2707('0x3d')]));_0x1b07ad[_0x2707('0x3c')]=_0x1b07ad[_0x2707('0x3c')][_0x2707('0x3e')]?_0x1b07ad[_0x2707('0x3c')]:_0x3c6cd5[_0x2707('0x37')];if(!_0xbe6b71[_0x2707('0x39')][_0x2707('0x3f')](_0x2707('0x40'))){_0x1b07ad['limit']=qs[_0x2707('0x41')](_0xbe6b71[_0x2707('0x39')]['limit']);_0x1b07ad[_0x2707('0x28')]=qs['offset'](_0xbe6b71['query'][_0x2707('0x28')]);}_0x1b07ad[_0x2707('0x42')]=qs['sort'](_0xbe6b71[_0x2707('0x39')][_0x2707('0x43')]);_0x1b07ad[_0x2707('0x44')]=qs[_0x2707('0x3a')](_[_0x2707('0x45')](_0xbe6b71[_0x2707('0x39')],_0x3c6cd5[_0x2707('0x3a')]),_0x26de9f);if(_0xbe6b71[_0x2707('0x39')][_0x2707('0x46')]){_0x1b07ad[_0x2707('0x44')]=_[_0x2707('0x47')](_0x1b07ad[_0x2707('0x44')],{'$or':_['map'](_0x26de9f,function(_0x405afa){if(_0x405afa['type']!==_0x2707('0x48')){var _0x1f5f30={};_0x1f5f30[_0x405afa[_0x2707('0x30')]]={'$like':'%'+_0xbe6b71[_0x2707('0x39')]['filter']+'%'};return _0x1f5f30;}})});}_0x1b07ad=_[_0x2707('0x47')]({},_0x1b07ad,_0xbe6b71['options']);var _0x296fd0={'where':_0x1b07ad[_0x2707('0x44')]};return db[_0x2707('0x32')][_0x2707('0x27')](_0x296fd0)['then'](function(_0x6cd5ed){_0x5abbe2[_0x2707('0x27')]=_0x6cd5ed;if(_0xbe6b71[_0x2707('0x39')][_0x2707('0x49')]){_0x1b07ad[_0x2707('0x4a')]=[{'all':!![]}];}return db[_0x2707('0x32')][_0x2707('0x4b')](_0x1b07ad);})[_0x2707('0x4c')](function(_0x3fe301){_0x5abbe2[_0x2707('0x4d')]=_0x3fe301;return _0x5abbe2;})[_0x2707('0x4c')](respondWithFilteredResult(_0x4a4edf,_0x1b07ad))[_0x2707('0x4e')](handleError(_0x4a4edf,null));};exports[_0x2707('0x4f')]=function(_0x173c62,_0x322b31){var _0x588fe7={'raw':![],'where':{'id':_0x173c62[_0x2707('0x50')]['id']}},_0xd2e122={};_0xd2e122[_0x2707('0x37')]=_['keys'](db['Team'][_0x2707('0x33')]);_0xd2e122[_0x2707('0x39')]=_[_0x2707('0x51')](_0x173c62[_0x2707('0x39')]);_0xd2e122[_0x2707('0x3a')]=_['intersection'](_0xd2e122['model'],_0xd2e122['query']);_0x588fe7[_0x2707('0x3c')]=_[_0x2707('0x3b')](_0xd2e122[_0x2707('0x37')],qs[_0x2707('0x3d')](_0x173c62['query'][_0x2707('0x3d')]));_0x588fe7['attributes']=_0x588fe7['attributes']['length']?_0x588fe7['attributes']:_0xd2e122[_0x2707('0x37')];if(_0x173c62['query'][_0x2707('0x49')]){_0x588fe7['include']=[{'all':!![]}];}_0x588fe7=_[_0x2707('0x47')]({},_0x588fe7,_0x173c62[_0x2707('0x52')]);return db[_0x2707('0x32')][_0x2707('0x53')](_0x588fe7)[_0x2707('0x4c')](handleEntityNotFound(_0x322b31,null))[_0x2707('0x4c')](respondWithResult(_0x322b31,null))['catch'](handleError(_0x322b31,null));};exports[_0x2707('0x54')]=function(_0x39d409,_0xc9ff98){return db['Team']['create'](_0x39d409['body'],{})['then'](function(_0x41e029){var _0x3d42c2=_0x39d409[_0x2707('0x55')][_0x2707('0x56')]({'plain':!![]});if(!_0x3d42c2)throw new Error(_0x2707('0x57'));if(_0x3d42c2[_0x2707('0x58')]===_0x2707('0x55')){var _0x464497=_0x41e029['get']({'plain':!![]});var _0x34e84c=_0x2707('0x59');return db['UserProfileSection']['find']({'where':{'name':_0x34e84c,'userProfileId':_0x3d42c2[_0x2707('0x5a')]},'raw':!![]})[_0x2707('0x4c')](function(_0x4d0e61){if(_0x4d0e61&&_0x4d0e61['autoAssociation']===0x0){return db[_0x2707('0x5b')][_0x2707('0x54')]({'name':_0x464497[_0x2707('0x30')],'resourceId':_0x464497['id'],'type':_0x4d0e61['name'],'sectionId':_0x4d0e61['id']},{})['then'](function(){return _0x41e029;});}else{return _0x41e029;}})[_0x2707('0x4e')](function(_0x5b9e95){logger[_0x2707('0x2e')](_0x2707('0x5c'),_0x5b9e95);throw _0x5b9e95;});}return _0x41e029;})[_0x2707('0x4c')](respondWithResult(_0xc9ff98,0xc9))[_0x2707('0x4e')](handleError(_0xc9ff98,null));};exports['update']=function(_0x4a054e,_0x3f4a4b){if(_0x4a054e['body']['id']){delete _0x4a054e['body']['id'];}return db['Team'][_0x2707('0x53')]({'where':{'id':_0x4a054e[_0x2707('0x50')]['id']}})[_0x2707('0x4c')](handleEntityNotFound(_0x3f4a4b,null))[_0x2707('0x4c')](saveUpdates(_0x4a054e[_0x2707('0x5d')],null))['then'](respondWithResult(_0x3f4a4b,null))[_0x2707('0x4e')](handleError(_0x3f4a4b,null));};exports[_0x2707('0x5e')]=function(_0x2c4a91,_0x30e74d){var _0x5e79b4=_0x2c4a91[_0x2707('0x50')]['id'];var _0x119275=[];return db['sequelize']['transaction'](function(_0x146991){var _0x407ddd=_0x2707('0x5f')+_0x5e79b4;return db[_0x2707('0x60')][_0x2707('0x39')](_0x407ddd,{'type':db['Sequelize']['QueryTypes'][_0x2707('0x61')],'raw':!![],'transaction':_0x146991})[_0x2707('0x4c')](function(_0x347d29){_0x119275=_[_0x2707('0x38')](_0x347d29,function(_0xc44b4c){return Number(_0xc44b4c[_0x2707('0x62')]);});})[_0x2707('0x4c')](function(){var _0x2ff901=_0x2707('0x63')+_0x5e79b4;return db[_0x2707('0x60')][_0x2707('0x39')](_0x2ff901,{'type':db[_0x2707('0x64')][_0x2707('0x65')][_0x2707('0x61')],'raw':!![],'transaction':_0x146991});})['then'](function(_0x50aca1){var _0x52d591=_[_0x2707('0x38')](_0x50aca1,function(_0x32fba5){return Number(_0x32fba5[_0x2707('0x66')]);});return db[_0x2707('0x67')][_0x2707('0x5e')]({'where':{'UserId':{'$in':_0x119275},'VoiceQueueId':{'$in':_0x52d591}},'transaction':_0x146991});})[_0x2707('0x4c')](function(){var _0x5082e2=_0x2707('0x68')+_0x5e79b4;return db[_0x2707('0x60')][_0x2707('0x39')](_0x5082e2,{'type':db[_0x2707('0x64')][_0x2707('0x65')][_0x2707('0x61')],'raw':!![],'transaction':_0x146991});})[_0x2707('0x4c')](function(_0x2037a8){var _0x1b34e6=_[_0x2707('0x38')](_0x2037a8,function(_0xb3c22){return Number(_0xb3c22[_0x2707('0x69')]);});return db['UserMailQueue'][_0x2707('0x5e')]({'where':{'UserId':{'$in':_0x119275},'MailQueueId':{'$in':_0x1b34e6}},'transaction':_0x146991});})[_0x2707('0x4c')](function(){var _0x4c70da='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5e79b4;return db[_0x2707('0x60')][_0x2707('0x39')](_0x4c70da,{'type':db[_0x2707('0x64')]['QueryTypes'][_0x2707('0x61')],'raw':!![],'transaction':_0x146991});})[_0x2707('0x4c')](function(_0x5db1a7){var _0x8c6e93=_[_0x2707('0x38')](_0x5db1a7,function(_0x5197f5){return Number(_0x5197f5['SmsQueueId']);});return db['UserSmsQueue'][_0x2707('0x5e')]({'where':{'UserId':{'$in':_0x119275},'SmsQueueId':{'$in':_0x8c6e93}},'transaction':_0x146991});})[_0x2707('0x4c')](function(){var _0x3f8e82=_0x2707('0x6a')+_0x5e79b4;return db['sequelize']['query'](_0x3f8e82,{'type':db['Sequelize']['QueryTypes'][_0x2707('0x61')],'raw':!![],'transaction':_0x146991});})[_0x2707('0x4c')](function(_0x4525a5){var _0x583d0e=_[_0x2707('0x38')](_0x4525a5,function(_0x1e6528){return Number(_0x1e6528[_0x2707('0x6b')]);});return db[_0x2707('0x6c')][_0x2707('0x5e')]({'where':{'UserId':{'$in':_0x119275},'ChatQueueId':{'$in':_0x583d0e}},'transaction':_0x146991});})[_0x2707('0x4c')](function(){var _0x1acae2=_0x2707('0x6d')+_0x5e79b4;return db[_0x2707('0x60')][_0x2707('0x39')](_0x1acae2,{'type':db[_0x2707('0x64')][_0x2707('0x65')][_0x2707('0x61')],'raw':!![],'transaction':_0x146991});})['then'](function(_0x5cfa2d){var _0x2023eb=_[_0x2707('0x38')](_0x5cfa2d,function(_0x3f530d){return Number(_0x3f530d[_0x2707('0x6e')]);});return db[_0x2707('0x6f')][_0x2707('0x5e')]({'where':{'UserId':{'$in':_0x119275},'FaxQueueId':{'$in':_0x2023eb}},'transaction':_0x146991});})['then'](function(){var _0x47748a='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5e79b4;return db[_0x2707('0x60')][_0x2707('0x39')](_0x47748a,{'type':db[_0x2707('0x64')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x146991});})[_0x2707('0x4c')](function(_0x405560){var _0x5e16c1=_[_0x2707('0x38')](_0x405560,function(_0x4290c0){return Number(_0x4290c0['OpenchannelQueueId']);});return db[_0x2707('0x70')]['destroy']({'where':{'UserId':{'$in':_0x119275},'OpenchannelQueueId':{'$in':_0x5e16c1}},'transaction':_0x146991});})['then'](function(){var _0x3c2c55=_0x2707('0x71')+_0x5e79b4;return db[_0x2707('0x60')][_0x2707('0x39')](_0x3c2c55,{'type':db[_0x2707('0x64')]['QueryTypes'][_0x2707('0x61')],'raw':!![],'transaction':_0x146991});})[_0x2707('0x4c')](function(_0x23e2e0){var _0x57785d=_['map'](_0x23e2e0,function(_0x12b115){return Number(_0x12b115[_0x2707('0x72')]);});return db['UserWhatsappQueue'][_0x2707('0x5e')]({'where':{'UserId':{'$in':_0x119275},'WhatsappQueueId':{'$in':_0x57785d}},'transaction':_0x146991});})[_0x2707('0x4c')](function(){return db['TeamVoicePrefix'][_0x2707('0x53')]({'where':{'TeamId':_0x5e79b4}});})[_0x2707('0x4c')](function(_0xffabc6){if(_0xffabc6===null){return;}return db['UserVoicePrefix'][_0x2707('0x5e')]({'where':{'UserId':{'$in':_0x119275},'VoicePrefixId':_0xffabc6[_0x2707('0x73')]},'transaction':_0x146991});})[_0x2707('0x4c')](function(){return db[_0x2707('0x32')][_0x2707('0x5e')]({'where':{'id':_0x5e79b4},'cascade':!![],'transaction':_0x146991});})['then'](function(_0x21f2f7){if(_0x21f2f7===0x0){_0x30e74d[_0x2707('0x22')](0x194);}else{return db[_0x2707('0x5b')][_0x2707('0x5e')]({'where':{'type':_0x2707('0x59'),'resourceId':_0x5e79b4},'cascade':!![],'transaction':_0x146991})[_0x2707('0x4c')](function(){_0x30e74d[_0x2707('0x23')](0xcc)[_0x2707('0x24')]();});}})[_0x2707('0x4e')](function(_0x5c12be){_0x30e74d[_0x2707('0x23')](0x1f4)['send'](_0x5c12be);});});};exports[_0x2707('0x74')]=function(_0x53b83a,_0x503ef7,_0x42c533){return db[_0x2707('0x32')][_0x2707('0x75')]({'where':{'id':_0x53b83a[_0x2707('0x50')]['id']}})[_0x2707('0x4c')](handleEntityNotFound(_0x503ef7,null))[_0x2707('0x4c')](function(_0x4ffffe){if(!_0x53b83a['query'][_0x2707('0x76')]||!utils[_0x2707('0x77')](_0x53b83a[_0x2707('0x39')][_0x2707('0x76')])){throw new db[(_0x2707('0x64'))][(_0x2707('0x78'))]('Unknown\x20channel');}var _0x14dd02={};var _0x14f6fe={};_0x14f6fe[_0x2707('0x37')]=_[_0x2707('0x51')](db[_[_0x2707('0x79')](_0x53b83a[_0x2707('0x39')]['channel'][_0x2707('0x7a')]())+_0x2707('0x7b')][_0x2707('0x33')]);_0x14f6fe[_0x2707('0x39')]=_[_0x2707('0x51')](_0x53b83a[_0x2707('0x39')]);_0x14f6fe[_0x2707('0x3a')]=_[_0x2707('0x3b')](_0x14f6fe[_0x2707('0x37')],_0x14f6fe[_0x2707('0x39')]);_0x14dd02[_0x2707('0x3c')]=_[_0x2707('0x3b')](_0x14f6fe[_0x2707('0x37')],qs[_0x2707('0x3d')](_0x53b83a[_0x2707('0x39')][_0x2707('0x3d')]));_0x14dd02[_0x2707('0x3c')]=_0x14dd02[_0x2707('0x3c')][_0x2707('0x3e')]?_0x14dd02[_0x2707('0x3c')]:_0x14f6fe['model'];_0x14dd02[_0x2707('0x41')]=qs[_0x2707('0x41')](_0x53b83a[_0x2707('0x39')]['limit']);_0x14dd02[_0x2707('0x28')]=qs[_0x2707('0x28')](_0x53b83a[_0x2707('0x39')][_0x2707('0x28')]);_0x14dd02['order']=qs[_0x2707('0x43')](_0x53b83a['query'][_0x2707('0x43')]);_0x14dd02[_0x2707('0x44')]=qs[_0x2707('0x3a')](_[_0x2707('0x45')](_0x53b83a[_0x2707('0x39')],_0x14f6fe[_0x2707('0x3a')]));_0x14dd02=_[_0x2707('0x47')]({},_0x14dd02,_0x53b83a[_0x2707('0x52')]);return _0x4ffffe[_0x2707('0x56')+_[_0x2707('0x79')](_0x53b83a[_0x2707('0x39')][_0x2707('0x76')][_0x2707('0x7a')]())+'Queues'](_0x14dd02);})[_0x2707('0x4c')](respondWithResult(_0x503ef7,null))[_0x2707('0x4e')](handleError(_0x503ef7,null));};exports[_0x2707('0x7c')]=function(_0xa697a,_0x4f6e60,_0x55d45e){return db[_0x2707('0x32')][_0x2707('0x75')]({'where':{'id':_0xa697a[_0x2707('0x50')]['id']}})[_0x2707('0x4c')](function(_0x5f3bc1){if(_0x5f3bc1){if(!_0xa697a[_0x2707('0x5d')][_0x2707('0x76')]||!utils[_0x2707('0x77')](_0xa697a[_0x2707('0x5d')][_0x2707('0x76')])){throw new db[(_0x2707('0x64'))]['ValidationError'](_0x2707('0x7d'));}return _0x5f3bc1[_0x2707('0x7e')+_[_0x2707('0x79')](_0xa697a[_0x2707('0x5d')][_0x2707('0x76')][_0x2707('0x7a')]())+_0x2707('0x7f')](_0xa697a[_0x2707('0x5d')][_0x2707('0x80')]);}return null;})[_0x2707('0x4c')](handleEntityNotFound(_0x4f6e60,null))['then'](respondWithStatusCode(_0x4f6e60,null))['catch'](handleError(_0x4f6e60,null));};exports[_0x2707('0x81')]=function(_0x1eb719,_0x402216,_0x480702){return db[_0x2707('0x32')][_0x2707('0x75')]({'where':{'id':_0x1eb719[_0x2707('0x50')]['id']}})['then'](function(_0x375720){if(_0x375720){if(!_0x1eb719[_0x2707('0x39')]['channel']||!utils[_0x2707('0x77')](_0x1eb719[_0x2707('0x39')]['channel'])){throw new db['Sequelize'][(_0x2707('0x78'))](_0x2707('0x7d'));}return _0x375720['remove'+_['capitalize'](_0x1eb719['query'][_0x2707('0x76')][_0x2707('0x7a')]())+_0x2707('0x7f')](_0x1eb719['query'][_0x2707('0x80')]);}return null;})[_0x2707('0x4c')](handleEntityNotFound(_0x402216,null))[_0x2707('0x4c')](respondWithStatusCode(_0x402216,null))[_0x2707('0x4e')](handleError(_0x402216,null));};exports['addAgents']=function(_0x3c0d6e,_0x2f8f3d){var _0x1b3b60=_[_0x2707('0x82')](_0x3c0d6e[_0x2707('0x5d')]['ids'])?_0x3c0d6e[_0x2707('0x5d')][_0x2707('0x80')]:[_0x3c0d6e[_0x2707('0x5d')]['ids']];var _0x2766e8=_0x3c0d6e['params']['id'];return db[_0x2707('0x32')][_0x2707('0x53')]({'where':{'id':_0x2766e8}})[_0x2707('0x4c')](handleEntityNotFound(_0x2f8f3d,null))[_0x2707('0x4c')](function(_0x17b175){if(_0x17b175){var _0x502392=[_0x2707('0x83'),_0x2707('0x84'),_0x2707('0x85'),_0x2707('0x86'),_0x2707('0x87'),'Openchannel',_0x2707('0x88')];return db[_0x2707('0x60')]['transaction'](function(_0x5e44cc){var _0x9ef9b5=_[_0x2707('0x38')](_0x502392,function(_0x40f342){var _0x340266={'attributes':['id',_0x2707('0x30')]};if(_0x40f342===_0x2707('0x83')){_0x340266['through']={'attributes':[_0x2707('0x89')]};}return _0x17b175[_0x2707('0x56')+_0x40f342+_0x2707('0x7f')](_0x340266)[_0x2707('0x4c')](function(_0x5a7dda){var _0x29fe00=_[_0x2707('0x38')](_0x5a7dda,function(_0x417630){var _0x600b56=_[_0x2707('0x38')](_0x1b3b60,function(_0x258324){var _0x46c100={'where':{'UserId':_0x258324,[_0x40f342+_0x2707('0x8a')]:_0x417630['id']},'transaction':_0x5e44cc};if(_0x40f342==='Voice'){_0x46c100[_0x2707('0x1d')]={'penalty':_0x417630['TeamVoiceQueue'][_0x2707('0x89')]};}return db['User'+_0x40f342+'Queue'][_0x2707('0x8b')](_0x46c100)[_0x2707('0x4c')](function(){socket[_0x2707('0x8c')]('user'+_0x40f342+_0x2707('0x8d'),{'UserId':_0x258324,[_0x40f342+'QueueId']:_0x417630['id']});if(_0x40f342!==_0x2707('0x83')){return;}return db[_0x2707('0x8e')][_0x2707('0x4b')]({'where':{'id':_0x1b3b60,'online':0x1},'attributes':['id','name','online','voicePause',_0x2707('0x8f')],'raw':!![]})['then'](function(_0x379660){var _0x32bf7c=_[_0x2707('0x38')](_0x379660,function(_0x4671d6){return db['UserVoiceQueueRt']['upsert']({'membername':_0x4671d6[_0x2707('0x30')],'UserId':_0x4671d6['id'],'queue_name':_0x417630[_0x2707('0x30')],'VoiceQueueId':_0x417630['id'],'interface':_[_0x2707('0x90')](_0x4671d6[_0x2707('0x8f')])?util['format'](_0x2707('0x91'),_0x4671d6[_0x2707('0x30')]):_0x4671d6[_0x2707('0x8f')],'paused':_0x4671d6[_0x2707('0x92')]||![],'penalty':_0x417630[_0x2707('0x93')][_0x2707('0x89')]},{'transaction':_0x5e44cc});});return Promise[_0x2707('0x94')](_0x32bf7c);});});});return Promise[_0x2707('0x94')](_0x600b56);});return Promise[_0x2707('0x94')](_0x29fe00);})['then'](function(){return db[_0x2707('0x95')]['findOne']({'where':{'teamId':_0x2766e8}})[_0x2707('0x4c')](function(_0x41cf5c){if(_0x41cf5c){var _0x3deb16=_[_0x2707('0x38')](_0x1b3b60,function(_0x26fa11){db[_0x2707('0x96')][_0x2707('0x97')]({'UserId':_0x26fa11,'VoicePrefixId':_0x41cf5c[_0x2707('0x73')]});});return Promise[_0x2707('0x94')](_0x3deb16);}});});});return Promise[_0x2707('0x94')](_0x9ef9b5)[_0x2707('0x4c')](function(){return _0x17b175['addAgents'](_0x1b3b60,{'transaction':_0x5e44cc})['spread'](function(_0x3f9de5){return _0x3f9de5;});});});}})['then'](respondWithResult(_0x2f8f3d,null))[_0x2707('0x4e')](handleError(_0x2f8f3d,null));};exports[_0x2707('0x98')]=function(_0xeedff,_0x3b4e47){var _0x5a286a=_[_0x2707('0x82')](_0xeedff[_0x2707('0x39')][_0x2707('0x80')])?_0xeedff[_0x2707('0x39')][_0x2707('0x80')]:[_0xeedff['query'][_0x2707('0x80')]];var _0x229200=_0xeedff[_0x2707('0x50')]['id'];return db[_0x2707('0x32')][_0x2707('0x53')]({'where':{'id':_0x229200}})[_0x2707('0x4c')](handleEntityNotFound(_0x3b4e47,null))[_0x2707('0x4c')](function(_0x5d082b){if(_0x5d082b){var _0x2a599a=['Voice',_0x2707('0x84'),_0x2707('0x85'),_0x2707('0x86'),'Fax',_0x2707('0x99'),'Whatsapp'];return db['sequelize'][_0x2707('0x9a')](function(_0x4ff9e8){var _0x2062b9=_[_0x2707('0x38')](_0x2a599a,function(_0x5b9ebd){var _0x31a20c={'attributes':['id',_0x2707('0x30')]};return _0x5d082b[_0x2707('0x56')+_0x5b9ebd+_0x2707('0x7f')](_0x31a20c)[_0x2707('0x4c')](function(_0x476105){var _0x58ffee=_[_0x2707('0x38')](_0x476105,function(_0x413a16){return _0x413a16[_0x2707('0x98')](_0x5a286a,{'transaction':_0x4ff9e8})[_0x2707('0x4c')](function(){var _0x4cecc1=_[_0x2707('0x38')](_0x5a286a,function(_0x2b0e84){socket['emit']('user'+_0x5b9ebd+_0x2707('0x9b'),{'UserId':Number(_0x2b0e84),[_0x5b9ebd+_0x2707('0x8a')]:_0x413a16['id']});if(_0x5b9ebd!==_0x2707('0x83')){return;}return db[_0x2707('0x9c')][_0x2707('0x5e')]({'where':{'VoiceQueueId':_0x413a16['id'],'UserId':_0x2b0e84},'transaction':_0x4ff9e8});});return Promise[_0x2707('0x94')](_0x4cecc1);});});return Promise[_0x2707('0x94')](_0x58ffee);});});return Promise[_0x2707('0x94')](_0x2062b9)[_0x2707('0x4c')](function(){return _0x5d082b[_0x2707('0x98')](_0x5a286a,{'transaction':_0x4ff9e8});})['then'](function(){return db[_0x2707('0x95')][_0x2707('0x75')]({'where':{'teamId':_0x229200}})[_0x2707('0x4c')](function(_0x1e0ffa){if(_0x1e0ffa){var _0x3cc7fd=_[_0x2707('0x38')](_0x5a286a,function(_0x387d3a){db[_0x2707('0x96')]['destroy']({'where':{'UserId':_0x387d3a,'VoicePrefixId':_0x1e0ffa[_0x2707('0x73')]}});});return Promise[_0x2707('0x94')](_0x3cc7fd);}});});});}})[_0x2707('0x4c')](respondWithStatusCode(_0x3b4e47,null))[_0x2707('0x4e')](handleError(_0x3b4e47,null));};exports[_0x2707('0x9d')]=function(_0x58787d,_0x27dc03,_0x3947f3){var _0x2ca91f={};var _0x38c440={};var _0xf06737;var _0x34c711;return db['Team'][_0x2707('0x75')]({'where':{'id':_0x58787d[_0x2707('0x50')]['id']}})[_0x2707('0x4c')](handleEntityNotFound(_0x27dc03,null))[_0x2707('0x4c')](function(_0x2fd062){if(_0x2fd062){_0xf06737=_0x2fd062;_0x38c440[_0x2707('0x37')]=_[_0x2707('0x51')](db[_0x2707('0x8e')][_0x2707('0x33')]);_0x38c440[_0x2707('0x39')]=_[_0x2707('0x51')](_0x58787d[_0x2707('0x39')]);_0x38c440['filters']=_[_0x2707('0x3b')](_0x38c440[_0x2707('0x37')],_0x38c440[_0x2707('0x39')]);_0x2ca91f['attributes']=_[_0x2707('0x3b')](_0x38c440[_0x2707('0x37')],qs[_0x2707('0x3d')](_0x58787d[_0x2707('0x39')][_0x2707('0x3d')]));_0x2ca91f[_0x2707('0x3c')]=_0x2ca91f[_0x2707('0x3c')]['length']?_0x2ca91f[_0x2707('0x3c')]:_0x38c440[_0x2707('0x37')];_0x2ca91f['order']=qs[_0x2707('0x43')](_0x58787d['query'][_0x2707('0x43')]);_0x2ca91f['where']=qs[_0x2707('0x3a')](_[_0x2707('0x45')](_0x58787d[_0x2707('0x39')],_0x38c440[_0x2707('0x3a')]));if(_0x58787d[_0x2707('0x39')]['filter']){_0x2ca91f[_0x2707('0x44')]=_[_0x2707('0x47')](_0x2ca91f[_0x2707('0x44')],{'$or':_[_0x2707('0x38')](_0x2ca91f[_0x2707('0x3c')],function(_0xc9a729){var _0xbde7a={};_0xbde7a[_0xc9a729]={'$like':'%'+_0x58787d[_0x2707('0x39')][_0x2707('0x46')]+'%'};return _0xbde7a;})});}_0x2ca91f=_[_0x2707('0x47')]({},_0x2ca91f,_0x58787d[_0x2707('0x52')]);return _0xf06737[_0x2707('0x9d')](_0x2ca91f);}})['then'](function(_0x24dc79){if(_0x24dc79){_0x34c711=_0x24dc79[_0x2707('0x3e')];if(!_0x58787d[_0x2707('0x39')]['hasOwnProperty'](_0x2707('0x40'))){_0x2ca91f['limit']=qs[_0x2707('0x41')](_0x58787d[_0x2707('0x39')][_0x2707('0x41')]);_0x2ca91f[_0x2707('0x28')]=qs['offset'](_0x58787d[_0x2707('0x39')]['offset']);}return _0xf06737['getAgents'](_0x2ca91f);}})[_0x2707('0x4c')](function(_0x20e842){if(_0x20e842){return _0x20e842?{'count':_0x34c711,'rows':_0x20e842}:null;}})[_0x2707('0x4c')](respondWithResult(_0x27dc03,null))['catch'](handleError(_0x27dc03,null));}; \ No newline at end of file +var _0x5a5e=['removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','Team','rawAttributes','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','length','options','create','body','user','get','role','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','isValidChannel','channel','ValidationError','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','isArray','Voice','Chat','Mail','Sms','Openchannel','transaction','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','all','spread','Queue:remove'];(function(_0x1d0992,_0x19c94e){var _0x129b92=function(_0x3ccfed){while(--_0x3ccfed){_0x1d0992['push'](_0x1d0992['shift']());}};_0x129b92(++_0x19c94e);}(_0x5a5e,0x9a));var _0xe5a5=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0x5a5e[_0x34232c];return _0x4d4f4e;};'use strict';var emlformat=require(_0xe5a5('0x0'));var rimraf=require(_0xe5a5('0x1'));var zipdir=require(_0xe5a5('0x2'));var jsonpatch=require(_0xe5a5('0x3'));var rp=require(_0xe5a5('0x4'));var moment=require('moment');var BPromise=require(_0xe5a5('0x5'));var Mustache=require(_0xe5a5('0x6'));var util=require(_0xe5a5('0x7'));var path=require(_0xe5a5('0x8'));var sox=require(_0xe5a5('0x9'));var csv=require(_0xe5a5('0xa'));var ejs=require(_0xe5a5('0xb'));var fs=require('fs');var fs_extra=require(_0xe5a5('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe5a5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe5a5('0xe'));var Papa=require('papaparse');var Redis=require(_0xe5a5('0xf'));var authService=require(_0xe5a5('0x10'));var qs=require(_0xe5a5('0x11'));var as=require(_0xe5a5('0x12'));var hardwareService=require(_0xe5a5('0x13'));var logger=require(_0xe5a5('0x14'))(_0xe5a5('0x15'));var utils=require(_0xe5a5('0x16'));var config=require(_0xe5a5('0x17'));var licenseUtil=require(_0xe5a5('0x18'));var db=require(_0xe5a5('0x19'))['db'];config[_0xe5a5('0x1a')]=_[_0xe5a5('0x1b')](config[_0xe5a5('0x1a')],{'host':_0xe5a5('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5a5('0x1a')]));require(_0xe5a5('0x1d'))[_0xe5a5('0x1e')](socket);function respondWithStatusCode(_0x393c8c,_0x5d6398){_0x5d6398=_0x5d6398||0xcc;return function(_0x16b7a1){if(_0x16b7a1){return _0x393c8c[_0xe5a5('0x1f')](_0x5d6398);}return _0x393c8c[_0xe5a5('0x20')](_0x5d6398)[_0xe5a5('0x21')]();};}function respondWithResult(_0x189131,_0xfdbc0f){_0xfdbc0f=_0xfdbc0f||0xc8;return function(_0x18b4da){if(_0x18b4da){return _0x189131[_0xe5a5('0x20')](_0xfdbc0f)['json'](_0x18b4da);}};}function respondWithFilteredResult(_0x2b7219,_0x4f1133){return function(_0x511998){if(_0x511998){var _0x516a15=typeof _0x4f1133[_0xe5a5('0x22')]==='undefined'&&typeof _0x4f1133['limit']===_0xe5a5('0x23');var _0x4121ba=_0x511998[_0xe5a5('0x24')];var _0x178c6e=_0x516a15?0x0:_0x4f1133[_0xe5a5('0x22')];var _0x3a848e=_0x516a15?_0x511998[_0xe5a5('0x24')]:_0x4f1133[_0xe5a5('0x22')]+_0x4f1133[_0xe5a5('0x25')];var _0x3db6c4;if(_0x3a848e>=_0x4121ba){_0x3a848e=_0x4121ba;_0x3db6c4=0xc8;}else{_0x3db6c4=0xce;}_0x2b7219[_0xe5a5('0x20')](_0x3db6c4);return _0x2b7219[_0xe5a5('0x26')](_0xe5a5('0x27'),_0x178c6e+'-'+_0x3a848e+'/'+_0x4121ba)[_0xe5a5('0x28')](_0x511998);}return null;};}function patchUpdates(_0x351847){return function(_0x35945a){try{jsonpatch[_0xe5a5('0x29')](_0x35945a,_0x351847,!![]);}catch(_0x505acb){return BPromise[_0xe5a5('0x2a')](_0x505acb);}return _0x35945a['save']();};}function saveUpdates(_0x4f01f0,_0xe07049){return function(_0xa0cb6e){if(_0xa0cb6e){return _0xa0cb6e[_0xe5a5('0x2b')](_0x4f01f0)[_0xe5a5('0x2c')](function(_0x50a374){return _0x50a374;});}return null;};}function handleEntityNotFound(_0x46fff5,_0x17dd1c){return function(_0x4e2e67){if(!_0x4e2e67){_0x46fff5[_0xe5a5('0x1f')](0x194);}return _0x4e2e67;};}function handleError(_0x295832,_0x45ab0a){_0x45ab0a=_0x45ab0a||0x1f4;return function(_0x88cca2){logger[_0xe5a5('0x2d')](_0x88cca2[_0xe5a5('0x2e')]);if(_0x88cca2[_0xe5a5('0x2f')]){delete _0x88cca2[_0xe5a5('0x2f')];}_0x295832[_0xe5a5('0x20')](_0x45ab0a)[_0xe5a5('0x30')](_0x88cca2);};}exports[_0xe5a5('0x31')]=function(_0x257f03,_0x2be026){var _0xf5b26={},_0xf9b70b={},_0x246931={'count':0x0,'rows':[]};var _0x1c287f=_[_0xe5a5('0x32')](db[_0xe5a5('0x33')][_0xe5a5('0x34')],function(_0x4d04fc){return{'name':_0x4d04fc['fieldName'],'type':_0x4d04fc['type'][_0xe5a5('0x35')]};});_0xf9b70b['model']=_['map'](_0x1c287f,_0xe5a5('0x2f'));_0xf9b70b['query']=_['keys'](_0x257f03[_0xe5a5('0x36')]);_0xf9b70b[_0xe5a5('0x37')]=_[_0xe5a5('0x38')](_0xf9b70b['model'],_0xf9b70b[_0xe5a5('0x36')]);_0xf5b26[_0xe5a5('0x39')]=_[_0xe5a5('0x38')](_0xf9b70b[_0xe5a5('0x3a')],qs['fields'](_0x257f03[_0xe5a5('0x36')][_0xe5a5('0x3b')]));_0xf5b26[_0xe5a5('0x39')]=_0xf5b26[_0xe5a5('0x39')]['length']?_0xf5b26[_0xe5a5('0x39')]:_0xf9b70b[_0xe5a5('0x3a')];if(!_0x257f03[_0xe5a5('0x36')][_0xe5a5('0x3c')](_0xe5a5('0x3d'))){_0xf5b26[_0xe5a5('0x25')]=qs['limit'](_0x257f03['query']['limit']);_0xf5b26['offset']=qs[_0xe5a5('0x22')](_0x257f03[_0xe5a5('0x36')][_0xe5a5('0x22')]);}_0xf5b26[_0xe5a5('0x3e')]=qs[_0xe5a5('0x3f')](_0x257f03[_0xe5a5('0x36')]['sort']);_0xf5b26[_0xe5a5('0x40')]=qs[_0xe5a5('0x37')](_[_0xe5a5('0x41')](_0x257f03[_0xe5a5('0x36')],_0xf9b70b[_0xe5a5('0x37')]),_0x1c287f);if(_0x257f03[_0xe5a5('0x36')][_0xe5a5('0x42')]){_0xf5b26[_0xe5a5('0x40')]=_[_0xe5a5('0x43')](_0xf5b26[_0xe5a5('0x40')],{'$or':_[_0xe5a5('0x32')](_0x1c287f,function(_0x2ae93e){if(_0x2ae93e[_0xe5a5('0x44')]!==_0xe5a5('0x45')){var _0x4336f5={};_0x4336f5[_0x2ae93e[_0xe5a5('0x2f')]]={'$like':'%'+_0x257f03[_0xe5a5('0x36')][_0xe5a5('0x42')]+'%'};return _0x4336f5;}})});}_0xf5b26=_[_0xe5a5('0x43')]({},_0xf5b26,_0x257f03['options']);var _0x3d3945={'where':_0xf5b26[_0xe5a5('0x40')]};return db[_0xe5a5('0x33')]['count'](_0x3d3945)[_0xe5a5('0x2c')](function(_0x3536bc){_0x246931[_0xe5a5('0x24')]=_0x3536bc;if(_0x257f03[_0xe5a5('0x36')]['includeAll']){_0xf5b26[_0xe5a5('0x46')]=[{'all':!![]}];}return db['Team'][_0xe5a5('0x47')](_0xf5b26);})[_0xe5a5('0x2c')](function(_0x47fbcf){_0x246931[_0xe5a5('0x48')]=_0x47fbcf;return _0x246931;})[_0xe5a5('0x2c')](respondWithFilteredResult(_0x2be026,_0xf5b26))[_0xe5a5('0x49')](handleError(_0x2be026,null));};exports[_0xe5a5('0x4a')]=function(_0x185492,_0x1f5ece){var _0x194446={'raw':![],'where':{'id':_0x185492[_0xe5a5('0x4b')]['id']}},_0x33ca38={};_0x33ca38[_0xe5a5('0x3a')]=_[_0xe5a5('0x4c')](db[_0xe5a5('0x33')]['rawAttributes']);_0x33ca38[_0xe5a5('0x36')]=_['keys'](_0x185492['query']);_0x33ca38[_0xe5a5('0x37')]=_[_0xe5a5('0x38')](_0x33ca38['model'],_0x33ca38[_0xe5a5('0x36')]);_0x194446['attributes']=_[_0xe5a5('0x38')](_0x33ca38[_0xe5a5('0x3a')],qs[_0xe5a5('0x3b')](_0x185492[_0xe5a5('0x36')]['fields']));_0x194446['attributes']=_0x194446[_0xe5a5('0x39')][_0xe5a5('0x4d')]?_0x194446[_0xe5a5('0x39')]:_0x33ca38[_0xe5a5('0x3a')];if(_0x185492[_0xe5a5('0x36')]['includeAll']){_0x194446[_0xe5a5('0x46')]=[{'all':!![]}];}_0x194446=_[_0xe5a5('0x43')]({},_0x194446,_0x185492[_0xe5a5('0x4e')]);return db[_0xe5a5('0x33')]['find'](_0x194446)[_0xe5a5('0x2c')](handleEntityNotFound(_0x1f5ece,null))[_0xe5a5('0x2c')](respondWithResult(_0x1f5ece,null))[_0xe5a5('0x49')](handleError(_0x1f5ece,null));};exports[_0xe5a5('0x4f')]=function(_0x5c9772,_0x476b78){return db['Team'][_0xe5a5('0x4f')](_0x5c9772[_0xe5a5('0x50')],{})[_0xe5a5('0x2c')](function(_0xc8b94f){var _0x2a5478=_0x5c9772[_0xe5a5('0x51')][_0xe5a5('0x52')]({'plain':!![]});if(!_0x2a5478)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a5478[_0xe5a5('0x53')]===_0xe5a5('0x51')){var _0x2b2f63=_0xc8b94f[_0xe5a5('0x52')]({'plain':!![]});var _0x33eed6=_0xe5a5('0x54');return db[_0xe5a5('0x55')]['find']({'where':{'name':_0x33eed6,'userProfileId':_0x2a5478[_0xe5a5('0x56')]},'raw':!![]})[_0xe5a5('0x2c')](function(_0x44909f){if(_0x44909f&&_0x44909f['autoAssociation']===0x0){return db[_0xe5a5('0x57')][_0xe5a5('0x4f')]({'name':_0x2b2f63[_0xe5a5('0x2f')],'resourceId':_0x2b2f63['id'],'type':_0x44909f[_0xe5a5('0x2f')],'sectionId':_0x44909f['id']},{})['then'](function(){return _0xc8b94f;});}else{return _0xc8b94f;}})[_0xe5a5('0x49')](function(_0x5dc20f){logger[_0xe5a5('0x2d')](_0xe5a5('0x58'),_0x5dc20f);throw _0x5dc20f;});}return _0xc8b94f;})[_0xe5a5('0x2c')](respondWithResult(_0x476b78,0xc9))['catch'](handleError(_0x476b78,null));};exports[_0xe5a5('0x2b')]=function(_0x5f5159,_0x408dd2){if(_0x5f5159[_0xe5a5('0x50')]['id']){delete _0x5f5159['body']['id'];}return db[_0xe5a5('0x33')][_0xe5a5('0x59')]({'where':{'id':_0x5f5159[_0xe5a5('0x4b')]['id']}})[_0xe5a5('0x2c')](handleEntityNotFound(_0x408dd2,null))[_0xe5a5('0x2c')](saveUpdates(_0x5f5159['body'],null))[_0xe5a5('0x2c')](respondWithResult(_0x408dd2,null))[_0xe5a5('0x49')](handleError(_0x408dd2,null));};exports[_0xe5a5('0x5a')]=function(_0x537251,_0xa626f4){var _0xea480f=_0x537251['params']['id'];var _0x5700eb=[];return db[_0xe5a5('0x5b')]['transaction'](function(_0x23869e){var _0x2762a2=_0xe5a5('0x5c')+_0xea480f;return db[_0xe5a5('0x5b')][_0xe5a5('0x36')](_0x2762a2,{'type':db[_0xe5a5('0x5d')][_0xe5a5('0x5e')][_0xe5a5('0x5f')],'raw':!![],'transaction':_0x23869e})[_0xe5a5('0x2c')](function(_0x2049ae){_0x5700eb=_[_0xe5a5('0x32')](_0x2049ae,function(_0x3049c8){return Number(_0x3049c8['UserId']);});})[_0xe5a5('0x2c')](function(){var _0xe94d43=_0xe5a5('0x60')+_0xea480f;return db[_0xe5a5('0x5b')]['query'](_0xe94d43,{'type':db[_0xe5a5('0x5d')]['QueryTypes'][_0xe5a5('0x5f')],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x568fd1){var _0x2c7724=_[_0xe5a5('0x32')](_0x568fd1,function(_0xd6885d){return Number(_0xd6885d[_0xe5a5('0x61')]);});return db[_0xe5a5('0x62')][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'VoiceQueueId':{'$in':_0x2c7724}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0x137d40=_0xe5a5('0x63')+_0xea480f;return db[_0xe5a5('0x5b')][_0xe5a5('0x36')](_0x137d40,{'type':db[_0xe5a5('0x5d')][_0xe5a5('0x5e')][_0xe5a5('0x5f')],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x1b3083){var _0x522e15=_[_0xe5a5('0x32')](_0x1b3083,function(_0x1b906e){return Number(_0x1b906e['MailQueueId']);});return db[_0xe5a5('0x64')][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'MailQueueId':{'$in':_0x522e15}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0x15e8f5=_0xe5a5('0x65')+_0xea480f;return db[_0xe5a5('0x5b')][_0xe5a5('0x36')](_0x15e8f5,{'type':db['Sequelize'][_0xe5a5('0x5e')]['SELECT'],'raw':!![],'transaction':_0x23869e});})['then'](function(_0x35557c){var _0x40d418=_['map'](_0x35557c,function(_0xc5735f){return Number(_0xc5735f[_0xe5a5('0x66')]);});return db[_0xe5a5('0x67')][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'SmsQueueId':{'$in':_0x40d418}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0x5806e1='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0xea480f;return db[_0xe5a5('0x5b')][_0xe5a5('0x36')](_0x5806e1,{'type':db[_0xe5a5('0x5d')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x1179e6){var _0x2da34e=_[_0xe5a5('0x32')](_0x1179e6,function(_0x280508){return Number(_0x280508[_0xe5a5('0x68')]);});return db['UserChatQueue'][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'ChatQueueId':{'$in':_0x2da34e}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0xbab02b=_0xe5a5('0x69')+_0xea480f;return db[_0xe5a5('0x5b')]['query'](_0xbab02b,{'type':db[_0xe5a5('0x5d')][_0xe5a5('0x5e')][_0xe5a5('0x5f')],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x4bb6f8){var _0x550cee=_[_0xe5a5('0x32')](_0x4bb6f8,function(_0xc4f124){return Number(_0xc4f124[_0xe5a5('0x6a')]);});return db['UserFaxQueue'][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'FaxQueueId':{'$in':_0x550cee}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0x3644b5=_0xe5a5('0x6b')+_0xea480f;return db[_0xe5a5('0x5b')][_0xe5a5('0x36')](_0x3644b5,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x341454){var _0x4befe7=_[_0xe5a5('0x32')](_0x341454,function(_0x9ed9e5){return Number(_0x9ed9e5[_0xe5a5('0x6c')]);});return db['UserOpenchannelQueue'][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'OpenchannelQueueId':{'$in':_0x4befe7}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0x2c610f='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0xea480f;return db['sequelize'][_0xe5a5('0x36')](_0x2c610f,{'type':db[_0xe5a5('0x5d')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x3dc904){var _0x242a25=_[_0xe5a5('0x32')](_0x3dc904,function(_0x216686){return Number(_0x216686[_0xe5a5('0x6d')]);});return db[_0xe5a5('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x5700eb},'WhatsappQueueId':{'$in':_0x242a25}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){return db[_0xe5a5('0x6f')][_0xe5a5('0x59')]({'where':{'TeamId':_0xea480f}});})[_0xe5a5('0x2c')](function(_0x553992){if(_0x553992===null){return;}return db[_0xe5a5('0x70')][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'VoicePrefixId':_0x553992[_0xe5a5('0x71')]},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){return db[_0xe5a5('0x33')][_0xe5a5('0x5a')]({'where':{'id':_0xea480f},'cascade':!![],'transaction':_0x23869e});})['then'](function(_0x63fcd){if(_0x63fcd===0x0){_0xa626f4['sendStatus'](0x194);}else{return db[_0xe5a5('0x57')][_0xe5a5('0x5a')]({'where':{'type':'Teams','resourceId':_0xea480f},'cascade':!![],'transaction':_0x23869e})[_0xe5a5('0x2c')](function(){_0xa626f4[_0xe5a5('0x20')](0xcc)[_0xe5a5('0x21')]();});}})[_0xe5a5('0x49')](function(_0x4e3d1a){_0xa626f4['status'](0x1f4)[_0xe5a5('0x30')](_0x4e3d1a);});});};exports[_0xe5a5('0x72')]=function(_0x547462,_0x3c722c,_0x5db0f7){return db['Team'][_0xe5a5('0x73')]({'where':{'id':_0x547462[_0xe5a5('0x4b')]['id']}})[_0xe5a5('0x2c')](handleEntityNotFound(_0x3c722c,null))[_0xe5a5('0x2c')](function(_0x31af60){if(!_0x547462[_0xe5a5('0x36')]['channel']||!utils[_0xe5a5('0x74')](_0x547462[_0xe5a5('0x36')][_0xe5a5('0x75')])){throw new db['Sequelize'][(_0xe5a5('0x76'))]('Unknown\x20channel');}var _0x3312b5={};var _0xf1dfd1={};_0xf1dfd1[_0xe5a5('0x3a')]=_[_0xe5a5('0x4c')](db[_[_0xe5a5('0x77')](_0x547462[_0xe5a5('0x36')][_0xe5a5('0x75')][_0xe5a5('0x78')]())+_0xe5a5('0x79')]['rawAttributes']);_0xf1dfd1[_0xe5a5('0x36')]=_[_0xe5a5('0x4c')](_0x547462[_0xe5a5('0x36')]);_0xf1dfd1[_0xe5a5('0x37')]=_['intersection'](_0xf1dfd1[_0xe5a5('0x3a')],_0xf1dfd1[_0xe5a5('0x36')]);_0x3312b5[_0xe5a5('0x39')]=_[_0xe5a5('0x38')](_0xf1dfd1['model'],qs[_0xe5a5('0x3b')](_0x547462[_0xe5a5('0x36')]['fields']));_0x3312b5[_0xe5a5('0x39')]=_0x3312b5['attributes'][_0xe5a5('0x4d')]?_0x3312b5['attributes']:_0xf1dfd1[_0xe5a5('0x3a')];_0x3312b5['limit']=qs[_0xe5a5('0x25')](_0x547462[_0xe5a5('0x36')][_0xe5a5('0x25')]);_0x3312b5[_0xe5a5('0x22')]=qs[_0xe5a5('0x22')](_0x547462[_0xe5a5('0x36')][_0xe5a5('0x22')]);_0x3312b5[_0xe5a5('0x3e')]=qs['sort'](_0x547462[_0xe5a5('0x36')][_0xe5a5('0x3f')]);_0x3312b5[_0xe5a5('0x40')]=qs[_0xe5a5('0x37')](_[_0xe5a5('0x41')](_0x547462['query'],_0xf1dfd1[_0xe5a5('0x37')]));_0x3312b5=_[_0xe5a5('0x43')]({},_0x3312b5,_0x547462[_0xe5a5('0x4e')]);return _0x31af60[_0xe5a5('0x52')+_[_0xe5a5('0x77')](_0x547462['query']['channel'][_0xe5a5('0x78')]())+_0xe5a5('0x7a')](_0x3312b5);})[_0xe5a5('0x2c')](respondWithResult(_0x3c722c,null))[_0xe5a5('0x49')](handleError(_0x3c722c,null));};exports[_0xe5a5('0x7b')]=function(_0xb62f7e,_0x144333,_0x349901){return db[_0xe5a5('0x33')][_0xe5a5('0x73')]({'where':{'id':_0xb62f7e[_0xe5a5('0x4b')]['id']}})[_0xe5a5('0x2c')](function(_0x332fd7){if(_0x332fd7){if(!_0xb62f7e[_0xe5a5('0x50')]['channel']||!utils[_0xe5a5('0x74')](_0xb62f7e['body'][_0xe5a5('0x75')])){throw new db[(_0xe5a5('0x5d'))]['ValidationError']('Unknown\x20channel');}return _0x332fd7[_0xe5a5('0x7c')+_[_0xe5a5('0x77')](_0xb62f7e[_0xe5a5('0x50')]['channel']['toLowerCase']())+_0xe5a5('0x7a')](_0xb62f7e[_0xe5a5('0x50')][_0xe5a5('0x7d')]);}return null;})[_0xe5a5('0x2c')](handleEntityNotFound(_0x144333,null))['then'](respondWithStatusCode(_0x144333,null))['catch'](handleError(_0x144333,null));};exports['removeQueues']=function(_0x39ec01,_0x5703f8,_0x294076){return db[_0xe5a5('0x33')]['findOne']({'where':{'id':_0x39ec01['params']['id']}})['then'](function(_0x46d302){if(_0x46d302){if(!_0x39ec01[_0xe5a5('0x36')][_0xe5a5('0x75')]||!utils['isValidChannel'](_0x39ec01[_0xe5a5('0x36')][_0xe5a5('0x75')])){throw new db[(_0xe5a5('0x5d'))][(_0xe5a5('0x76'))]('Unknown\x20channel');}return _0x46d302['remove'+_[_0xe5a5('0x77')](_0x39ec01[_0xe5a5('0x36')][_0xe5a5('0x75')][_0xe5a5('0x78')]())+_0xe5a5('0x7a')](_0x39ec01[_0xe5a5('0x36')][_0xe5a5('0x7d')]);}return null;})[_0xe5a5('0x2c')](handleEntityNotFound(_0x5703f8,null))[_0xe5a5('0x2c')](respondWithStatusCode(_0x5703f8,null))[_0xe5a5('0x49')](handleError(_0x5703f8,null));};exports['addAgents']=function(_0x65a89e,_0x1efc08){var _0x9d24c7=_[_0xe5a5('0x7e')](_0x65a89e[_0xe5a5('0x50')][_0xe5a5('0x7d')])?_0x65a89e[_0xe5a5('0x50')][_0xe5a5('0x7d')]:[_0x65a89e[_0xe5a5('0x50')][_0xe5a5('0x7d')]];var _0x49d0a9=_0x65a89e[_0xe5a5('0x4b')]['id'];return db['Team']['find']({'where':{'id':_0x49d0a9}})[_0xe5a5('0x2c')](handleEntityNotFound(_0x1efc08,null))[_0xe5a5('0x2c')](function(_0x424f0b){if(_0x424f0b){var _0x50bf61=[_0xe5a5('0x7f'),_0xe5a5('0x80'),_0xe5a5('0x81'),_0xe5a5('0x82'),'Fax',_0xe5a5('0x83'),'Whatsapp'];return db[_0xe5a5('0x5b')][_0xe5a5('0x84')](function(_0x1036cd){var _0xedffa8=_[_0xe5a5('0x32')](_0x50bf61,function(_0xebd66f){var _0x1688fc={'attributes':['id',_0xe5a5('0x2f')]};if(_0xebd66f===_0xe5a5('0x7f')){_0x1688fc[_0xe5a5('0x85')]={'attributes':[_0xe5a5('0x86')]};}return _0x424f0b[_0xe5a5('0x52')+_0xebd66f+'Queues'](_0x1688fc)[_0xe5a5('0x2c')](function(_0x28557d){var _0x4b3fbe=_[_0xe5a5('0x32')](_0x28557d,function(_0xc8f918){var _0xe0042c=_['map'](_0x9d24c7,function(_0x4dda07){var _0x5a0e83={'where':{'UserId':_0x4dda07,[_0xebd66f+_0xe5a5('0x87')]:_0xc8f918['id']},'transaction':_0x1036cd};if(_0xebd66f==='Voice'){_0x5a0e83[_0xe5a5('0x1b')]={'penalty':_0xc8f918[_0xe5a5('0x88')][_0xe5a5('0x86')]};}return db[_0xe5a5('0x89')+_0xebd66f+'Queue'][_0xe5a5('0x8a')](_0x5a0e83)[_0xe5a5('0x2c')](function(){socket[_0xe5a5('0x8b')]('user'+_0xebd66f+'Queue:save',{'UserId':_0x4dda07,[_0xebd66f+_0xe5a5('0x87')]:_0xc8f918['id']});if(_0xebd66f!=='Voice'){return;}return db[_0xe5a5('0x89')]['findAll']({'where':{'id':_0x9d24c7,'online':0x1},'attributes':['id','name',_0xe5a5('0x8c'),_0xe5a5('0x8d'),_0xe5a5('0x8e')],'raw':!![]})[_0xe5a5('0x2c')](function(_0xbae6cb){var _0x1859f1=_[_0xe5a5('0x32')](_0xbae6cb,function(_0x4cdf4d){return db[_0xe5a5('0x8f')][_0xe5a5('0x90')]({'membername':_0x4cdf4d['name'],'UserId':_0x4cdf4d['id'],'queue_name':_0xc8f918[_0xe5a5('0x2f')],'VoiceQueueId':_0xc8f918['id'],'interface':_[_0xe5a5('0x91')](_0x4cdf4d[_0xe5a5('0x8e')])?util['format'](_0xe5a5('0x92'),_0x4cdf4d[_0xe5a5('0x2f')]):_0x4cdf4d[_0xe5a5('0x8e')],'paused':_0x4cdf4d[_0xe5a5('0x8d')]||![],'penalty':_0xc8f918[_0xe5a5('0x88')][_0xe5a5('0x86')]},{'transaction':_0x1036cd});});return Promise[_0xe5a5('0x93')](_0x1859f1);});});});return Promise[_0xe5a5('0x93')](_0xe0042c);});return Promise['all'](_0x4b3fbe);})[_0xe5a5('0x2c')](function(){return db[_0xe5a5('0x6f')][_0xe5a5('0x73')]({'where':{'teamId':_0x49d0a9}})[_0xe5a5('0x2c')](function(_0x488f97){if(_0x488f97){var _0x2ef72b=_[_0xe5a5('0x32')](_0x9d24c7,function(_0x1ca1ad){db[_0xe5a5('0x70')]['upsert']({'UserId':_0x1ca1ad,'VoicePrefixId':_0x488f97[_0xe5a5('0x71')]});});return Promise[_0xe5a5('0x93')](_0x2ef72b);}});});});return Promise[_0xe5a5('0x93')](_0xedffa8)[_0xe5a5('0x2c')](function(){return _0x424f0b['addAgents'](_0x9d24c7,{'transaction':_0x1036cd})[_0xe5a5('0x94')](function(_0x359ebe){return _0x359ebe;});});});}})[_0xe5a5('0x2c')](respondWithResult(_0x1efc08,null))[_0xe5a5('0x49')](handleError(_0x1efc08,null));};exports['removeAgents']=function(_0x381433,_0x1748c3){var _0x4fb665=_[_0xe5a5('0x7e')](_0x381433['query']['ids'])?_0x381433['query'][_0xe5a5('0x7d')]:[_0x381433['query'][_0xe5a5('0x7d')]];var _0x4c5d91=_0x381433[_0xe5a5('0x4b')]['id'];return db[_0xe5a5('0x33')][_0xe5a5('0x59')]({'where':{'id':_0x4c5d91}})[_0xe5a5('0x2c')](handleEntityNotFound(_0x1748c3,null))['then'](function(_0x21e940){if(_0x21e940){var _0x4a4c73=[_0xe5a5('0x7f'),_0xe5a5('0x80'),_0xe5a5('0x81'),_0xe5a5('0x82'),'Fax',_0xe5a5('0x83'),'Whatsapp'];return db[_0xe5a5('0x5b')][_0xe5a5('0x84')](function(_0xe9398b){var _0x2b8030=_[_0xe5a5('0x32')](_0x4a4c73,function(_0x171b4a){var _0x520289={'attributes':['id','name']};return _0x21e940[_0xe5a5('0x52')+_0x171b4a+_0xe5a5('0x7a')](_0x520289)['then'](function(_0x1a6d58){var _0x11c66e=_['map'](_0x1a6d58,function(_0x1773ea){return _0x1773ea['removeAgents'](_0x4fb665,{'transaction':_0xe9398b})['then'](function(){var _0x25cf45=_[_0xe5a5('0x32')](_0x4fb665,function(_0x2f1794){socket[_0xe5a5('0x8b')](_0xe5a5('0x51')+_0x171b4a+_0xe5a5('0x95'),{'UserId':Number(_0x2f1794),[_0x171b4a+_0xe5a5('0x87')]:_0x1773ea['id']});if(_0x171b4a!==_0xe5a5('0x7f')){return;}return db[_0xe5a5('0x8f')][_0xe5a5('0x5a')]({'where':{'VoiceQueueId':_0x1773ea['id'],'UserId':_0x2f1794},'transaction':_0xe9398b});});return Promise[_0xe5a5('0x93')](_0x25cf45);});});return Promise[_0xe5a5('0x93')](_0x11c66e);});});return Promise['all'](_0x2b8030)[_0xe5a5('0x2c')](function(){return _0x21e940[_0xe5a5('0x96')](_0x4fb665,{'transaction':_0xe9398b});})['then'](function(){return db[_0xe5a5('0x6f')][_0xe5a5('0x73')]({'where':{'teamId':_0x4c5d91}})[_0xe5a5('0x2c')](function(_0x3b49f8){if(_0x3b49f8){var _0x3a4ca7=_[_0xe5a5('0x32')](_0x4fb665,function(_0x5eb39f){db[_0xe5a5('0x70')][_0xe5a5('0x5a')]({'where':{'UserId':_0x5eb39f,'VoicePrefixId':_0x3b49f8['VoicePrefixId']}});});return Promise['all'](_0x3a4ca7);}});});});}})[_0xe5a5('0x2c')](respondWithStatusCode(_0x1748c3,null))[_0xe5a5('0x49')](handleError(_0x1748c3,null));};exports[_0xe5a5('0x97')]=function(_0x4c0aea,_0xc4cff5,_0x508729){var _0x59dad8={};var _0x1b272={};var _0x299649;var _0x3293ec;return db[_0xe5a5('0x33')][_0xe5a5('0x73')]({'where':{'id':_0x4c0aea[_0xe5a5('0x4b')]['id']}})[_0xe5a5('0x2c')](handleEntityNotFound(_0xc4cff5,null))[_0xe5a5('0x2c')](function(_0x467a28){if(_0x467a28){_0x299649=_0x467a28;_0x1b272['model']=_[_0xe5a5('0x4c')](db[_0xe5a5('0x89')][_0xe5a5('0x34')]);_0x1b272['query']=_['keys'](_0x4c0aea[_0xe5a5('0x36')]);_0x1b272[_0xe5a5('0x37')]=_['intersection'](_0x1b272['model'],_0x1b272[_0xe5a5('0x36')]);_0x59dad8[_0xe5a5('0x39')]=_[_0xe5a5('0x38')](_0x1b272[_0xe5a5('0x3a')],qs['fields'](_0x4c0aea[_0xe5a5('0x36')][_0xe5a5('0x3b')]));_0x59dad8[_0xe5a5('0x39')]=_0x59dad8[_0xe5a5('0x39')][_0xe5a5('0x4d')]?_0x59dad8[_0xe5a5('0x39')]:_0x1b272['model'];_0x59dad8['order']=qs[_0xe5a5('0x3f')](_0x4c0aea[_0xe5a5('0x36')][_0xe5a5('0x3f')]);_0x59dad8[_0xe5a5('0x40')]=qs['filters'](_['pick'](_0x4c0aea[_0xe5a5('0x36')],_0x1b272['filters']));if(_0x4c0aea[_0xe5a5('0x36')][_0xe5a5('0x42')]){_0x59dad8[_0xe5a5('0x40')]=_[_0xe5a5('0x43')](_0x59dad8['where'],{'$or':_['map'](_0x59dad8[_0xe5a5('0x39')],function(_0xe68874){var _0xa86030={};_0xa86030[_0xe68874]={'$like':'%'+_0x4c0aea[_0xe5a5('0x36')][_0xe5a5('0x42')]+'%'};return _0xa86030;})});}_0x59dad8=_[_0xe5a5('0x43')]({},_0x59dad8,_0x4c0aea[_0xe5a5('0x4e')]);return _0x299649[_0xe5a5('0x97')](_0x59dad8);}})['then'](function(_0xb49d46){if(_0xb49d46){_0x3293ec=_0xb49d46['length'];if(!_0x4c0aea[_0xe5a5('0x36')]['hasOwnProperty'](_0xe5a5('0x3d'))){_0x59dad8[_0xe5a5('0x25')]=qs[_0xe5a5('0x25')](_0x4c0aea[_0xe5a5('0x36')]['limit']);_0x59dad8[_0xe5a5('0x22')]=qs[_0xe5a5('0x22')](_0x4c0aea[_0xe5a5('0x36')][_0xe5a5('0x22')]);}return _0x299649[_0xe5a5('0x97')](_0x59dad8);}})[_0xe5a5('0x2c')](function(_0x5e607b){if(_0x5e607b){return _0x5e607b?{'count':_0x3293ec,'rows':_0x5e607b}:null;}})[_0xe5a5('0x2c')](respondWithResult(_0xc4cff5,null))[_0xe5a5('0x49')](handleError(_0xc4cff5,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 4844911..9df69dd 100644 --- a/server/api/team/team.events.js +++ b/server/api/team/team.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6242=['emit','hasOwnProperty','exports','events','../../mysqldb','Team','remove'];(function(_0x6324da,_0x16c0bd){var _0x980fd8=function(_0x364fcb){while(--_0x364fcb){_0x6324da['push'](_0x6324da['shift']());}};_0x980fd8(++_0x16c0bd);}(_0x6242,0x81));var _0x2624=function(_0x8f3ac4,_0x1617b3){_0x8f3ac4=_0x8f3ac4-0x0;var _0x2fdaf9=_0x6242[_0x8f3ac4];return _0x2fdaf9;};'use strict';var EventEmitter=require(_0x2624('0x0'));var Team=require(_0x2624('0x1'))['db'][_0x2624('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2624('0x3')};function emitEvent(_0x579038){return function(_0x5a335d,_0x4e0934,_0x54955f){TeamEvents['emit'](_0x579038+':'+_0x5a335d['id'],_0x5a335d);TeamEvents[_0x2624('0x4')](_0x579038,_0x5a335d);_0x54955f(null);};}for(var e in events){if(events[_0x2624('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x2624('0x6')]=TeamEvents; \ No newline at end of file +var _0x1ba8=['hasOwnProperty','hook','events','../../mysqldb','Team','setMaxListeners','save','remove','emit'];(function(_0x542b6b,_0x4eee55){var _0x17dddc=function(_0x2389ed){while(--_0x2389ed){_0x542b6b['push'](_0x542b6b['shift']());}};_0x17dddc(++_0x4eee55);}(_0x1ba8,0x89));var _0x81ba=function(_0x9b1a2,_0x4fc8c1){_0x9b1a2=_0x9b1a2-0x0;var _0x2feb67=_0x1ba8[_0x9b1a2];return _0x2feb67;};'use strict';var EventEmitter=require(_0x81ba('0x0'));var Team=require(_0x81ba('0x1'))['db'][_0x81ba('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x81ba('0x3')](0x0);var events={'afterCreate':_0x81ba('0x4'),'afterUpdate':'update','afterDestroy':_0x81ba('0x5')};function emitEvent(_0x770930){return function(_0x15c750,_0x193024,_0x2a9aa4){TeamEvents[_0x81ba('0x6')](_0x770930+':'+_0x15c750['id'],_0x15c750);TeamEvents[_0x81ba('0x6')](_0x770930,_0x15c750);_0x2a9aa4(null);};}for(var e in events){if(events[_0x81ba('0x7')](e)){var event=events[e];Team[_0x81ba('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 6e2dc8b..0ca5706 100644 --- a/server/api/team/team.model.js +++ b/server/api/team/team.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xece0=['catch','exports','Team','Chat','Mail','Voice','all','lodash','./team.attributes','Queues','then','map','setDataValue','channel'];(function(_0x2bc301,_0x34bebc){var _0x54cea9=function(_0x355579){while(--_0x355579){_0x2bc301['push'](_0x2bc301['shift']());}};_0x54cea9(++_0x34bebc);}(_0xece0,0x77));var _0x0ece=function(_0x51ba06,_0x4ed036){_0x51ba06=_0x51ba06-0x0;var _0x32a797=_0xece0[_0x51ba06];return _0x32a797;};'use strict';var _=require(_0x0ece('0x0'));var attributes=require(_0x0ece('0x1'));function getQueuesByChannel(_0x2caefb,_0x28e155){var _0x574a10='get'+_0x28e155+_0x0ece('0x2');return _0x2caefb[_0x574a10]()[_0x0ece('0x3')](function(_0x2c3d92){return _[_0x0ece('0x4')](_0x2c3d92,function(_0x4ff8df){_0x4ff8df[_0x0ece('0x5')](_0x0ece('0x6'),_0x28e155);return _0x4ff8df;});})[_0x0ece('0x7')](function(_0x73bec){throw _0x73bec;});}module[_0x0ece('0x8')]=function(_0x299664){return _0x299664['define'](_0x0ece('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x381ec2=this;var _0x5bce66=[_0x0ece('0xa'),'Fax',_0x0ece('0xb'),'Openchannel','Sms',_0x0ece('0xc'),'Whatsapp'];return Promise['resolve']()['then'](function(){var _0x423fb1=_[_0x0ece('0x4')](_0x5bce66,function(_0x3eacaf){return getQueuesByChannel(_0x381ec2,_0x3eacaf);});return Promise[_0x0ece('0xd')](_0x423fb1);})['catch'](function(_0x40b2c7){throw _0x40b2c7;});}}});}; \ No newline at end of file +var _0xdda5=['catch','exports','define','Team','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','map','all','./team.attributes','get','Queues','then','setDataValue'];(function(_0x4f23a5,_0x59b1f6){var _0x8d6574=function(_0x4b97ee){while(--_0x4b97ee){_0x4f23a5['push'](_0x4f23a5['shift']());}};_0x8d6574(++_0x59b1f6);}(_0xdda5,0xc1));var _0x5dda=function(_0x5beb1e,_0x5e9d6c){_0x5beb1e=_0x5beb1e-0x0;var _0x4d034b=_0xdda5[_0x5beb1e];return _0x4d034b;};'use strict';var _=require('lodash');var attributes=require(_0x5dda('0x0'));function getQueuesByChannel(_0x8ea1df,_0x40d02b){var _0xeefb49=_0x5dda('0x1')+_0x40d02b+_0x5dda('0x2');return _0x8ea1df[_0xeefb49]()[_0x5dda('0x3')](function(_0x48c249){return _['map'](_0x48c249,function(_0x2c907a){_0x2c907a[_0x5dda('0x4')]('channel',_0x40d02b);return _0x2c907a;});})[_0x5dda('0x5')](function(_0xb9919c){throw _0xb9919c;});}module[_0x5dda('0x6')]=function(_0x40efd3){return _0x40efd3[_0x5dda('0x7')](_0x5dda('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4d5b0b=this;var _0x576de1=[_0x5dda('0x9'),_0x5dda('0xa'),_0x5dda('0xb'),_0x5dda('0xc'),_0x5dda('0xd'),_0x5dda('0xe'),_0x5dda('0xf')];return Promise['resolve']()[_0x5dda('0x3')](function(){var _0x71e578=_[_0x5dda('0x10')](_0x576de1,function(_0x4ec920){return getQueuesByChannel(_0x4d5b0b,_0x4ec920);});return Promise[_0x5dda('0x11')](_0x71e578);})[_0x5dda('0x5')](function(_0x54ddf0){throw _0x54ddf0;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 4a1f853..4cea48c 100644 --- a/server/api/team/team.rpc.js +++ b/server/api/team/team.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec03=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x52200a,_0x14e4b4){var _0x5eae07=function(_0x3476f4){while(--_0x3476f4){_0x52200a['push'](_0x52200a['shift']());}};_0x5eae07(++_0x14e4b4);}(_0xec03,0x96));var _0x3ec0=function(_0x5a59d4,_0x1a5340){_0x5a59d4=_0x5a59d4-0x0;var _0x165db1=_0xec03[_0x5a59d4];return _0x165db1;};'use strict';var _=require('lodash');var util=require(_0x3ec0('0x0'));var moment=require(_0x3ec0('0x1'));var BPromise=require(_0x3ec0('0x2'));var rs=require(_0x3ec0('0x3'));var fs=require('fs');var Redis=require(_0x3ec0('0x4'));var db=require(_0x3ec0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ec0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3ec0('0x7'));var client=jayson['client'][_0x3ec0('0x8')]({'port':0x232a});config[_0x3ec0('0x9')]=_[_0x3ec0('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3ec0('0xb'))(new Redis(config[_0x3ec0('0x9')]));require('./team.socket')[_0x3ec0('0xc')](socket);function respondWithRpcPromise(_0x513421,_0x1b7e61,_0x31fc8b){return new BPromise(function(_0x406ecb,_0x435cf6){return client[_0x3ec0('0xd')](_0x513421,_0x31fc8b)[_0x3ec0('0xe')](function(_0x95a0c6){logger[_0x3ec0('0xf')](_0x3ec0('0x10'),_0x1b7e61,'request\x20sent');logger[_0x3ec0('0x11')](_0x3ec0('0x12'),_0x1b7e61,_0x3ec0('0x13'),JSON[_0x3ec0('0x14')](_0x95a0c6));if(_0x95a0c6[_0x3ec0('0x15')]){if(_0x95a0c6[_0x3ec0('0x15')][_0x3ec0('0x16')]===0x1f4){logger[_0x3ec0('0x15')](_0x3ec0('0x10'),_0x1b7e61,_0x95a0c6['error'][_0x3ec0('0x17')]);return _0x435cf6(_0x95a0c6['error'][_0x3ec0('0x17')]);}logger[_0x3ec0('0x15')](_0x3ec0('0x10'),_0x1b7e61,_0x95a0c6[_0x3ec0('0x15')][_0x3ec0('0x17')]);return _0x406ecb(_0x95a0c6['error']['message']);}else{logger[_0x3ec0('0xf')](_0x3ec0('0x10'),_0x1b7e61,'request\x20sent');_0x406ecb(_0x95a0c6['result']['message']);}})[_0x3ec0('0x18')](function(_0x1f12a7){logger[_0x3ec0('0x15')](_0x3ec0('0x10'),_0x1b7e61,_0x1f12a7);_0x435cf6(_0x1f12a7);});});} \ No newline at end of file +var _0xb498=['localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/logger','jayson/promise','http','redis'];(function(_0x133ee2,_0x1365ff){var _0x28e86f=function(_0x162938){while(--_0x162938){_0x133ee2['push'](_0x133ee2['shift']());}};_0x28e86f(++_0x1365ff);}(_0xb498,0x6b));var _0x8b49=function(_0x3f081d,_0x59d70b){_0x3f081d=_0x3f081d-0x0;var _0xfb386a=_0xb498[_0x3f081d];return _0xfb386a;};'use strict';var _=require(_0x8b49('0x0'));var util=require(_0x8b49('0x1'));var moment=require('moment');var BPromise=require(_0x8b49('0x2'));var rs=require(_0x8b49('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8b49('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8b49('0x5'));var client=jayson['client'][_0x8b49('0x6')]({'port':0x232a});config[_0x8b49('0x7')]=_['defaults'](config[_0x8b49('0x7')],{'host':_0x8b49('0x8'),'port':0x18eb});var socket=require(_0x8b49('0x9'))(new Redis(config[_0x8b49('0x7')]));require(_0x8b49('0xa'))[_0x8b49('0xb')](socket);function respondWithRpcPromise(_0x56b8dd,_0x1d5b22,_0x5f5abd){return new BPromise(function(_0x31f30d,_0x21d65a){return client[_0x8b49('0xc')](_0x56b8dd,_0x5f5abd)[_0x8b49('0xd')](function(_0x4ea323){logger[_0x8b49('0xe')]('Team,\x20%s,\x20%s',_0x1d5b22,'request\x20sent');logger['debug'](_0x8b49('0xf'),_0x1d5b22,_0x8b49('0x10'),JSON['stringify'](_0x4ea323));if(_0x4ea323['error']){if(_0x4ea323[_0x8b49('0x11')][_0x8b49('0x12')]===0x1f4){logger[_0x8b49('0x11')](_0x8b49('0x13'),_0x1d5b22,_0x4ea323[_0x8b49('0x11')][_0x8b49('0x14')]);return _0x21d65a(_0x4ea323[_0x8b49('0x11')][_0x8b49('0x14')]);}logger[_0x8b49('0x11')](_0x8b49('0x13'),_0x1d5b22,_0x4ea323['error'][_0x8b49('0x14')]);return _0x31f30d(_0x4ea323[_0x8b49('0x11')][_0x8b49('0x14')]);}else{logger['info'](_0x8b49('0x13'),_0x1d5b22,_0x8b49('0x10'));_0x31f30d(_0x4ea323[_0x8b49('0x15')]['message']);}})[_0x8b49('0x16')](function(_0x3390bd){logger[_0x8b49('0x11')](_0x8b49('0x13'),_0x1d5b22,_0x3390bd);_0x21d65a(_0x3390bd);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 67aeac5..0f35cfa 100644 --- a/server/api/team/team.socket.js +++ b/server/api/team/team.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x983c=['removeListener','register','length','./team.events','save','remove','update','emit'];(function(_0x15bf8b,_0x5d5342){var _0x163060=function(_0x43b6f3){while(--_0x43b6f3){_0x15bf8b['push'](_0x15bf8b['shift']());}};_0x163060(++_0x5d5342);}(_0x983c,0xf3));var _0xc983=function(_0x241811,_0x35ca5f){_0x241811=_0x241811-0x0;var _0x1d1e76=_0x983c[_0x241811];return _0x1d1e76;};'use strict';var TeamEvents=require(_0xc983('0x0'));var events=[_0xc983('0x1'),_0xc983('0x2'),_0xc983('0x3')];function createListener(_0x27efe2,_0x59dc7d){return function(_0xaa635b){_0x59dc7d[_0xc983('0x4')](_0x27efe2,_0xaa635b);};}function removeListener(_0x14b999,_0x2e8c5d){return function(){TeamEvents[_0xc983('0x5')](_0x14b999,_0x2e8c5d);};}exports[_0xc983('0x6')]=function(_0x3897b9){for(var _0x541e6f=0x0,_0x346933=events[_0xc983('0x7')];_0x541e6f<_0x346933;_0x541e6f++){var _0x141900=events[_0x541e6f];var _0x11cd44=createListener('team:'+_0x141900,_0x3897b9);TeamEvents['on'](_0x141900,_0x11cd44);}}; \ No newline at end of file +var _0x361a=['register','length','./team.events','save','remove','update','emit','removeListener'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x361a,0x102));var _0xa361=function(_0x3ed744,_0x57df1b){_0x3ed744=_0x3ed744-0x0;var _0x455407=_0x361a[_0x3ed744];return _0x455407;};'use strict';var TeamEvents=require(_0xa361('0x0'));var events=[_0xa361('0x1'),_0xa361('0x2'),_0xa361('0x3')];function createListener(_0x531e30,_0x2ea24f){return function(_0x2d53cf){_0x2ea24f[_0xa361('0x4')](_0x531e30,_0x2d53cf);};}function removeListener(_0x4ed762,_0x1a8ad1){return function(){TeamEvents[_0xa361('0x5')](_0x4ed762,_0x1a8ad1);};}exports[_0xa361('0x6')]=function(_0x2df977){for(var _0x2145de=0x0,_0x5ec147=events[_0xa361('0x7')];_0x2145de<_0x5ec147;_0x2145de++){var _0x10541a=events[_0x2145de];var _0x383d1f=createListener('team:'+_0x10541a,_0x2df977);TeamEvents['on'](_0x10541a,_0x383d1f);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 2e68426..0ad097c 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f73=['INTEGER','sequelize','exports'];(function(_0xb89eae,_0x4cc531){var _0x53ae96=function(_0x3017ef){while(--_0x3017ef){_0xb89eae['push'](_0xb89eae['shift']());}};_0x53ae96(++_0x4cc531);}(_0x4f73,0x10f));var _0x34f7=function(_0xf3c843,_0x8ff24e){_0xf3c843=_0xf3c843-0x0;var _0x3191c6=_0x4f73[_0xf3c843];return _0x3191c6;};'use strict';var Sequelize=require(_0x34f7('0x0'));module[_0x34f7('0x1')]={'TeamId':{'type':Sequelize[_0x34f7('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x34f7('0x2')]}}; \ No newline at end of file +var _0x534d=['INTEGER','sequelize','exports'];(function(_0x2d8c36,_0x49ac28){var _0x4b04af=function(_0x10ba19){while(--_0x10ba19){_0x2d8c36['push'](_0x2d8c36['shift']());}};_0x4b04af(++_0x49ac28);}(_0x534d,0x79));var _0xd534=function(_0x49b75f,_0x150ea3){_0x49b75f=_0x49b75f-0x0;var _0x10c316=_0x534d[_0x49b75f];return _0x10c316;};'use strict';var Sequelize=require(_0xd534('0x0'));module[_0xd534('0x1')]={'TeamId':{'type':Sequelize[_0xd534('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd534('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 2a96c39..a065814 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c7c=['./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x59ee41,_0xaf7db8){var _0x3ecd3e=function(_0x2f9291){while(--_0x2f9291){_0x59ee41['push'](_0x59ee41['shift']());}};_0x3ecd3e(++_0xaf7db8);}(_0x1c7c,0x164));var _0xc1c7=function(_0x43ab97,_0x31c131){_0x43ab97=_0x43ab97-0x0;var _0x59ba31=_0x1c7c[_0x43ab97];return _0x59ba31;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var logger=require(_0xc1c7('0x2'))(_0xc1c7('0x3'));var moment=require('moment');var BPromise=require(_0xc1c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1c7('0x5'));var rimraf=require(_0xc1c7('0x6'));var config=require(_0xc1c7('0x7'));var attributes=require(_0xc1c7('0x8'));module[_0xc1c7('0x9')]=function(_0x364dde,_0x1f3e21){return _0x364dde[_0xc1c7('0xa')](_0xc1c7('0xb'),attributes,{'tableName':_0xc1c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf972=['moment','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xf972,0x171));var _0x2f97=function(_0x774ed9,_0x53533c){_0x774ed9=_0x774ed9-0x0;var _0x1e0394=_0xf972[_0x774ed9];return _0x1e0394;};'use strict';var _=require(_0x2f97('0x0'));var util=require('util');var logger=require(_0x2f97('0x1'))(_0x2f97('0x2'));var moment=require(_0x2f97('0x3'));var BPromise=require('bluebird');var rp=require(_0x2f97('0x4'));var fs=require('fs');var path=require(_0x2f97('0x5'));var rimraf=require('rimraf');var config=require(_0x2f97('0x6'));var attributes=require(_0x2f97('0x7'));module[_0x2f97('0x8')]=function(_0x14b139,_0x37482e){return _0x14b139[_0x2f97('0x9')](_0x2f97('0xa'),attributes,{'tableName':_0x2f97('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index ffcbe1c..abced1e 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1cf6b3,_0x30535a){var _0x525118=function(_0x470a97){while(--_0x470a97){_0x1cf6b3['push'](_0x1cf6b3['shift']());}};_0x525118(++_0x30535a);}(_0xe706,0xa3));var _0x6e70=function(_0x21dd50,_0x921f70){_0x21dd50=_0x21dd50-0x0;var _0x1b7d5e=_0xe706[_0x21dd50];return _0x1b7d5e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1ccb4b,_0x1c5bdc){var _0x2fd92c=function(_0x1a0286){while(--_0x1a0286){_0x1ccb4b['push'](_0x1ccb4b['shift']());}};_0x2fd92c(++_0x1c5bdc);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index c47c1b1..349d698 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb01=['sequelize','exports'];(function(_0x4333be,_0x5276a7){var _0x2489a0=function(_0x1736fb){while(--_0x1736fb){_0x4333be['push'](_0x4333be['shift']());}};_0x2489a0(++_0x5276a7);}(_0xcb01,0x10e));var _0x1cb0=function(_0x5a2ec8,_0x560609){_0x5a2ec8=_0x5a2ec8-0x0;var _0x69efdb=_0xcb01[_0x5a2ec8];return _0x69efdb;};'use strict';var Sequelize=require(_0x1cb0('0x0'));module[_0x1cb0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8ddc=['exports','INTEGER','sequelize'];(function(_0x40ef6a,_0x3b52ec){var _0x58d0c4=function(_0x3166bc){while(--_0x3166bc){_0x40ef6a['push'](_0x40ef6a['shift']());}};_0x58d0c4(++_0x3b52ec);}(_0x8ddc,0x13d));var _0xc8dd=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8ddc[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0xc8dd('0x0'));module[_0xc8dd('0x1')]={'penalty':{'type':Sequelize[_0xc8dd('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 95508be..bda44a1 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89e8=['moment','bluebird','request-promise','path','exports','TeamVoiceQueue','lodash','util','../../config/logger','api'];(function(_0x22d59c,_0x4e1840){var _0xfe4927=function(_0x31f5f7){while(--_0x31f5f7){_0x22d59c['push'](_0x22d59c['shift']());}};_0xfe4927(++_0x4e1840);}(_0x89e8,0x74));var _0x889e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x89e8[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var logger=require(_0x889e('0x2'))(_0x889e('0x3'));var moment=require(_0x889e('0x4'));var BPromise=require(_0x889e('0x5'));var rp=require(_0x889e('0x6'));var fs=require('fs');var path=require(_0x889e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0x889e('0x8')]=function(_0x293daf,_0x25f9e2){return _0x293daf['define'](_0x889e('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba6c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash'];(function(_0xc81fc5,_0xd232c0){var _0x1308f6=function(_0x3de09f){while(--_0x3de09f){_0xc81fc5['push'](_0xc81fc5['shift']());}};_0x1308f6(++_0xd232c0);}(_0xba6c,0x113));var _0xcba6=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0xba6c[_0x48999d];return _0x1ad0d1;};'use strict';var _=require(_0xcba6('0x0'));var util=require('util');var logger=require(_0xcba6('0x1'))(_0xcba6('0x2'));var moment=require(_0xcba6('0x3'));var BPromise=require(_0xcba6('0x4'));var rp=require(_0xcba6('0x5'));var fs=require('fs');var path=require(_0xcba6('0x6'));var rimraf=require(_0xcba6('0x7'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0xcba6('0x8')]=function(_0x1fd901,_0x34d35d){return _0x1fd901[_0xcba6('0x9')](_0xcba6('0xa'),attributes,{'tableName':_0xcba6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 4e8ae88..80f66a6 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x643b=['client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x582e1a,_0x30c676){var _0x53d34c=function(_0x92d7d8){while(--_0x92d7d8){_0x582e1a['push'](_0x582e1a['shift']());}};_0x53d34c(++_0x30c676);}(_0x643b,0xdc));var _0xb643=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x643b[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xb643('0x0'));var util=require(_0xb643('0x1'));var moment=require(_0xb643('0x2'));var BPromise=require(_0xb643('0x3'));var rs=require(_0xb643('0x4'));var fs=require('fs');var Redis=require(_0xb643('0x5'));var db=require(_0xb643('0x6'))['db'];var utils=require(_0xb643('0x7'));var logger=require('../../config/logger')(_0xb643('0x8'));var config=require('../../config/environment');var jayson=require(_0xb643('0x9'));var client=jayson[_0xb643('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3798ae,_0x274706,_0x5a3a11){return new BPromise(function(_0x2cf39a,_0x4f4f99){return client[_0xb643('0xb')](_0x3798ae,_0x5a3a11)[_0xb643('0xc')](function(_0xfa9073){logger[_0xb643('0xd')](_0xb643('0xe'),_0x274706,'request\x20sent');logger[_0xb643('0xf')](_0xb643('0x10'),_0x274706,_0xb643('0x11'),JSON[_0xb643('0x12')](_0xfa9073));if(_0xfa9073[_0xb643('0x13')]){if(_0xfa9073[_0xb643('0x13')]['code']===0x1f4){logger[_0xb643('0x13')](_0xb643('0xe'),_0x274706,_0xfa9073['error']['message']);return _0x4f4f99(_0xfa9073[_0xb643('0x13')][_0xb643('0x14')]);}logger[_0xb643('0x13')](_0xb643('0xe'),_0x274706,_0xfa9073[_0xb643('0x13')][_0xb643('0x14')]);return _0x2cf39a(_0xfa9073[_0xb643('0x13')][_0xb643('0x14')]);}else{logger[_0xb643('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x274706,_0xb643('0x11'));_0x2cf39a(_0xfa9073[_0xb643('0x15')][_0xb643('0x14')]);}})[_0xb643('0x16')](function(_0x12a252){logger['error'](_0xb643('0xe'),_0x274706,_0x12a252);_0x4f4f99(_0x12a252);});});} \ No newline at end of file +var _0x81c9=['code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','stringify','error'];(function(_0x1cc4dc,_0x3deedd){var _0x1805b8=function(_0x1a0dde){while(--_0x1a0dde){_0x1cc4dc['push'](_0x1cc4dc['shift']());}};_0x1805b8(++_0x3deedd);}(_0x81c9,0xf7));var _0x981c=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x81c9[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x981c('0x0'));var util=require(_0x981c('0x1'));var moment=require(_0x981c('0x2'));var BPromise=require(_0x981c('0x3'));var rs=require(_0x981c('0x4'));var fs=require('fs');var Redis=require(_0x981c('0x5'));var db=require(_0x981c('0x6'))['db'];var utils=require(_0x981c('0x7'));var logger=require('../../config/logger')(_0x981c('0x8'));var config=require(_0x981c('0x9'));var jayson=require(_0x981c('0xa'));var client=jayson[_0x981c('0xb')][_0x981c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ee362,_0x14d2dd,_0x1805f4){return new BPromise(function(_0xdfd42c,_0x1ff25a){return client['request'](_0x4ee362,_0x1805f4)['then'](function(_0x4f3ae3){logger[_0x981c('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x14d2dd,_0x981c('0xe'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x14d2dd,_0x981c('0xe'),JSON[_0x981c('0xf')](_0x4f3ae3));if(_0x4f3ae3[_0x981c('0x10')]){if(_0x4f3ae3['error'][_0x981c('0x11')]===0x1f4){logger[_0x981c('0x10')](_0x981c('0x12'),_0x14d2dd,_0x4f3ae3[_0x981c('0x10')][_0x981c('0x13')]);return _0x1ff25a(_0x4f3ae3['error']['message']);}logger[_0x981c('0x10')](_0x981c('0x12'),_0x14d2dd,_0x4f3ae3['error']['message']);return _0xdfd42c(_0x4f3ae3[_0x981c('0x10')]['message']);}else{logger[_0x981c('0xd')](_0x981c('0x12'),_0x14d2dd,_0x981c('0xe'));_0xdfd42c(_0x4f3ae3[_0x981c('0x14')][_0x981c('0x13')]);}})[_0x981c('0x15')](function(_0x3da1ca){logger['error'](_0x981c('0x12'),_0x14d2dd,_0x3da1ca);_0x1ff25a(_0x3da1ca);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 9899db7..a21688e 100644 --- a/server/api/template/index.js +++ b/server/api/template/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0954=['put','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','/:id','isAuthenticated','show','post'];(function(_0x4fce4a,_0x46bcd9){var _0x1098aa=function(_0x5716c8){while(--_0x5716c8){_0x4fce4a['push'](_0x4fce4a['shift']());}};_0x1098aa(++_0x46bcd9);}(_0x0954,0x135));var _0x4095=function(_0x46b22a,_0x5bf83a){_0x46b22a=_0x46b22a-0x0;var _0x44c2e8=_0x0954[_0x46b22a];return _0x44c2e8;};'use strict';var multer=require(_0x4095('0x0'));var util=require('util');var path=require(_0x4095('0x1'));var timeout=require(_0x4095('0x2'));var express=require('express');var router=express[_0x4095('0x3')]();var fs_extra=require(_0x4095('0x4'));var auth=require(_0x4095('0x5'));var interaction=require(_0x4095('0x6'));var config=require(_0x4095('0x7'));var controller=require(_0x4095('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4095('0x9')](_0x4095('0xa'),auth[_0x4095('0xb')](),controller[_0x4095('0xc')]);router[_0x4095('0xd')]('/',auth[_0x4095('0xb')](),controller['create']);router[_0x4095('0xe')](_0x4095('0xa'),auth[_0x4095('0xb')](),controller['update']);router[_0x4095('0xf')](_0x4095('0xa'),auth[_0x4095('0xb')](),controller['destroy']);module[_0x4095('0x10')]=router; \ No newline at end of file +var _0x79a3=['isAuthenticated','index','show','post','create','put','/:id','exports','multer','path','connect-timeout','Router','../../config/environment','./template.controller','get'];(function(_0x439614,_0x4b1191){var _0x2fdbec=function(_0xc29793){while(--_0xc29793){_0x439614['push'](_0x439614['shift']());}};_0x2fdbec(++_0x4b1191);}(_0x79a3,0x80));var _0x379a=function(_0x590874,_0x1fdfe7){_0x590874=_0x590874-0x0;var _0x584cf1=_0x79a3[_0x590874];return _0x584cf1;};'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 fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x379a('0x4'));var controller=require(_0x379a('0x5'));router[_0x379a('0x6')]('/',auth[_0x379a('0x7')](),controller[_0x379a('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x379a('0x9')]);router[_0x379a('0xa')]('/',auth[_0x379a('0x7')](),controller[_0x379a('0xb')]);router[_0x379a('0xc')](_0x379a('0xd'),auth[_0x379a('0x7')](),controller['update']);router['delete'](_0x379a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x379a('0xe')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index b771483..7063f27 100644 --- a/server/api/template/template.attributes.js +++ b/server/api/template/template.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc517=['exports','STRING','TEXT'];(function(_0xea46d,_0x254082){var _0x1fa4c5=function(_0x4d7817){while(--_0x4d7817){_0xea46d['push'](_0xea46d['shift']());}};_0x1fa4c5(++_0x254082);}(_0xc517,0x138));var _0x7c51=function(_0x521c0c,_0x1e5313){_0x521c0c=_0x521c0c-0x0;var _0x465ed8=_0xc517[_0x521c0c];return _0x465ed8;};'use strict';var Sequelize=require('sequelize');module[_0x7c51('0x0')]={'name':{'type':Sequelize[_0x7c51('0x1')]},'description':{'type':Sequelize[_0x7c51('0x1')]},'html':{'type':Sequelize[_0x7c51('0x2')]}}; \ No newline at end of file +var _0xc876=['sequelize','exports','STRING','TEXT'];(function(_0x1f3591,_0x5688f1){var _0x2339f1=function(_0x2f6460){while(--_0x2f6460){_0x1f3591['push'](_0x1f3591['shift']());}};_0x2339f1(++_0x5688f1);}(_0xc876,0x198));var _0x6c87=function(_0x546413,_0x2c9fae){_0x546413=_0x546413-0x0;var _0x4d446b=_0xc876[_0x546413];return _0x4d446b;};'use strict';var Sequelize=require(_0x6c87('0x0'));module[_0x6c87('0x1')]={'name':{'type':Sequelize[_0x6c87('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x6c87('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 61d81ae..b212fe3 100644 --- a/server/api/template/template.controller.js +++ b/server/api/template/template.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcae9=['json','apply','save','then','destroy','get','Templates','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Template','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','end','limit','undefined','count','offset','set','Content-Range'];(function(_0x45fe54,_0x3e263e){var _0x219a09=function(_0x4397d3){while(--_0x4397d3){_0x45fe54['push'](_0x45fe54['shift']());}};_0x219a09(++_0x3e263e);}(_0xcae9,0x8a));var _0x9cae=function(_0xbbfe59,_0x46067f){_0xbbfe59=_0xbbfe59-0x0;var _0x28a2a4=_0xcae9[_0xbbfe59];return _0x28a2a4;};'use strict';var emlformat=require(_0x9cae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9cae('0x1'));var jsonpatch=require(_0x9cae('0x2'));var rp=require(_0x9cae('0x3'));var moment=require(_0x9cae('0x4'));var BPromise=require(_0x9cae('0x5'));var Mustache=require(_0x9cae('0x6'));var util=require(_0x9cae('0x7'));var path=require('path');var sox=require(_0x9cae('0x8'));var csv=require('to-csv');var ejs=require(_0x9cae('0x9'));var fs=require('fs');var fs_extra=require(_0x9cae('0xa'));var _=require(_0x9cae('0xb'));var squel=require(_0x9cae('0xc'));var crypto=require('crypto');var jsforce=require(_0x9cae('0xd'));var deskjs=require(_0x9cae('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9cae('0xf'));var Redis=require(_0x9cae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9cae('0x11'));var as=require(_0x9cae('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cae('0x13'))(_0x9cae('0x14'));var utils=require('../../config/utils');var config=require(_0x9cae('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20a547,_0x1c22c0){_0x1c22c0=_0x1c22c0||0xcc;return function(_0x28dfe5){if(_0x28dfe5){return _0x20a547['sendStatus'](_0x1c22c0);}return _0x20a547[_0x9cae('0x16')](_0x1c22c0)[_0x9cae('0x17')]();};}function respondWithResult(_0x2bac97,_0x21462b){_0x21462b=_0x21462b||0xc8;return function(_0x41a019){if(_0x41a019){return _0x2bac97[_0x9cae('0x16')](_0x21462b)['json'](_0x41a019);}};}function respondWithFilteredResult(_0xf860d9,_0x56ebb9){return function(_0x5da711){if(_0x5da711){var _0x5dac04=typeof _0x56ebb9['offset']==='undefined'&&typeof _0x56ebb9[_0x9cae('0x18')]===_0x9cae('0x19');var _0x24c0d2=_0x5da711[_0x9cae('0x1a')];var _0x2c8b5a=_0x5dac04?0x0:_0x56ebb9['offset'];var _0x5ea3b1=_0x5dac04?_0x5da711['count']:_0x56ebb9[_0x9cae('0x1b')]+_0x56ebb9[_0x9cae('0x18')];var _0x1b4b9c;if(_0x5ea3b1>=_0x24c0d2){_0x5ea3b1=_0x24c0d2;_0x1b4b9c=0xc8;}else{_0x1b4b9c=0xce;}_0xf860d9[_0x9cae('0x16')](_0x1b4b9c);return _0xf860d9[_0x9cae('0x1c')](_0x9cae('0x1d'),_0x2c8b5a+'-'+_0x5ea3b1+'/'+_0x24c0d2)[_0x9cae('0x1e')](_0x5da711);}return null;};}function patchUpdates(_0x4fbd9e){return function(_0x214488){try{jsonpatch[_0x9cae('0x1f')](_0x214488,_0x4fbd9e,!![]);}catch(_0x2e24a2){return BPromise['reject'](_0x2e24a2);}return _0x214488[_0x9cae('0x20')]();};}function saveUpdates(_0x316cec,_0x4e742b){return function(_0x806f7c){if(_0x806f7c){return _0x806f7c['update'](_0x316cec)[_0x9cae('0x21')](function(_0x306c6c){return _0x306c6c;});}return null;};}function removeEntity(_0x3433fd,_0x630791){return function(_0x507538){if(_0x507538){return _0x507538[_0x9cae('0x22')]()['then'](function(){var _0xd728c0=_0x507538[_0x9cae('0x23')]({'plain':!![]});var _0x3750a9=_0x9cae('0x24');return db['UserProfileResource'][_0x9cae('0x22')]({'where':{'type':_0x3750a9,'resourceId':_0xd728c0['id']}})['then'](function(){return _0x507538;});})[_0x9cae('0x21')](function(){_0x3433fd[_0x9cae('0x16')](0xcc)[_0x9cae('0x17')]();});}};}function handleEntityNotFound(_0x2dc1f4,_0x89eb5a){return function(_0x359bc9){if(!_0x359bc9){_0x2dc1f4[_0x9cae('0x25')](0x194);}return _0x359bc9;};}function handleError(_0x2e5db6,_0x544e93){_0x544e93=_0x544e93||0x1f4;return function(_0x228d5a){logger['error'](_0x228d5a[_0x9cae('0x26')]);if(_0x228d5a[_0x9cae('0x27')]){delete _0x228d5a[_0x9cae('0x27')];}_0x2e5db6[_0x9cae('0x16')](_0x544e93)[_0x9cae('0x28')](_0x228d5a);};}exports['index']=function(_0x49b40f,_0x50a325){var _0x114d5e={},_0x471d3a={},_0xfe15b0={'count':0x0,'rows':[]};var _0x5bdcaa=_[_0x9cae('0x29')](db['Template'][_0x9cae('0x2a')],function(_0x54476f){return{'name':_0x54476f[_0x9cae('0x2b')],'type':_0x54476f[_0x9cae('0x2c')][_0x9cae('0x2d')]};});_0x471d3a[_0x9cae('0x2e')]=_[_0x9cae('0x29')](_0x5bdcaa,_0x9cae('0x27'));_0x471d3a[_0x9cae('0x2f')]=_[_0x9cae('0x30')](_0x49b40f[_0x9cae('0x2f')]);_0x471d3a['filters']=_[_0x9cae('0x31')](_0x471d3a[_0x9cae('0x2e')],_0x471d3a['query']);_0x114d5e[_0x9cae('0x32')]=_[_0x9cae('0x31')](_0x471d3a[_0x9cae('0x2e')],qs[_0x9cae('0x33')](_0x49b40f[_0x9cae('0x2f')][_0x9cae('0x33')]));_0x114d5e[_0x9cae('0x32')]=_0x114d5e[_0x9cae('0x32')][_0x9cae('0x34')]?_0x114d5e[_0x9cae('0x32')]:_0x471d3a[_0x9cae('0x2e')];if(!_0x49b40f[_0x9cae('0x2f')][_0x9cae('0x35')](_0x9cae('0x36'))){_0x114d5e['limit']=qs[_0x9cae('0x18')](_0x49b40f[_0x9cae('0x2f')]['limit']);_0x114d5e['offset']=qs[_0x9cae('0x1b')](_0x49b40f[_0x9cae('0x2f')][_0x9cae('0x1b')]);}_0x114d5e[_0x9cae('0x37')]=qs[_0x9cae('0x38')](_0x49b40f[_0x9cae('0x2f')][_0x9cae('0x38')]);_0x114d5e[_0x9cae('0x39')]=qs[_0x9cae('0x3a')](_[_0x9cae('0x3b')](_0x49b40f[_0x9cae('0x2f')],_0x471d3a[_0x9cae('0x3a')]),_0x5bdcaa);if(_0x49b40f['query'][_0x9cae('0x3c')]){_0x114d5e[_0x9cae('0x39')]=_[_0x9cae('0x3d')](_0x114d5e[_0x9cae('0x39')],{'$or':_['map'](_0x5bdcaa,function(_0x2bd79c){if(_0x2bd79c[_0x9cae('0x2c')]!==_0x9cae('0x3e')){var _0xe49250={};_0xe49250[_0x2bd79c[_0x9cae('0x27')]]={'$like':'%'+_0x49b40f['query'][_0x9cae('0x3c')]+'%'};return _0xe49250;}})});}_0x114d5e=_[_0x9cae('0x3d')]({},_0x114d5e,_0x49b40f[_0x9cae('0x3f')]);var _0x4dc735={'where':_0x114d5e['where']};return db[_0x9cae('0x40')][_0x9cae('0x1a')](_0x4dc735)['then'](function(_0x41dca1){_0xfe15b0[_0x9cae('0x1a')]=_0x41dca1;if(_0x49b40f[_0x9cae('0x2f')][_0x9cae('0x41')]){_0x114d5e[_0x9cae('0x42')]=[{'all':!![]}];}return db[_0x9cae('0x40')][_0x9cae('0x43')](_0x114d5e);})['then'](function(_0x51d1b9){_0xfe15b0[_0x9cae('0x44')]=_0x51d1b9;return _0xfe15b0;})['then'](respondWithFilteredResult(_0x50a325,_0x114d5e))[_0x9cae('0x45')](handleError(_0x50a325,null));};exports[_0x9cae('0x46')]=function(_0x4e2dbb,_0x5288f5){var _0x422bae={'raw':!![],'where':{'id':_0x4e2dbb[_0x9cae('0x47')]['id']}},_0xb5298b={};_0xb5298b[_0x9cae('0x2e')]=_[_0x9cae('0x30')](db['Template'][_0x9cae('0x2a')]);_0xb5298b[_0x9cae('0x2f')]=_[_0x9cae('0x30')](_0x4e2dbb[_0x9cae('0x2f')]);_0xb5298b[_0x9cae('0x3a')]=_['intersection'](_0xb5298b[_0x9cae('0x2e')],_0xb5298b[_0x9cae('0x2f')]);_0x422bae[_0x9cae('0x32')]=_['intersection'](_0xb5298b['model'],qs['fields'](_0x4e2dbb['query'][_0x9cae('0x33')]));_0x422bae[_0x9cae('0x32')]=_0x422bae[_0x9cae('0x32')][_0x9cae('0x34')]?_0x422bae[_0x9cae('0x32')]:_0xb5298b[_0x9cae('0x2e')];if(_0x4e2dbb[_0x9cae('0x2f')][_0x9cae('0x41')]){_0x422bae['include']=[{'all':!![]}];}_0x422bae=_['merge']({},_0x422bae,_0x4e2dbb['options']);return db[_0x9cae('0x40')][_0x9cae('0x48')](_0x422bae)['then'](handleEntityNotFound(_0x5288f5,null))['then'](respondWithResult(_0x5288f5,null))[_0x9cae('0x45')](handleError(_0x5288f5,null));};exports[_0x9cae('0x49')]=function(_0x370b06,_0x3a9049){return db[_0x9cae('0x40')][_0x9cae('0x49')](_0x370b06[_0x9cae('0x4a')],{})['then'](function(_0x1a5c9e){var _0x2a6405=_0x370b06['user'][_0x9cae('0x23')]({'plain':!![]});if(!_0x2a6405)throw new Error(_0x9cae('0x4b'));if(_0x2a6405[_0x9cae('0x4c')]===_0x9cae('0x4d')){var _0x422389=_0x1a5c9e[_0x9cae('0x23')]({'plain':!![]});var _0x1aeb2c=_0x9cae('0x24');return db[_0x9cae('0x4e')]['find']({'where':{'name':_0x1aeb2c,'userProfileId':_0x2a6405[_0x9cae('0x4f')]},'raw':!![]})[_0x9cae('0x21')](function(_0x31d95e){if(_0x31d95e&&_0x31d95e['autoAssociation']===0x0){return db[_0x9cae('0x50')][_0x9cae('0x49')]({'name':_0x422389[_0x9cae('0x27')],'resourceId':_0x422389['id'],'type':_0x31d95e[_0x9cae('0x27')],'sectionId':_0x31d95e['id']},{})[_0x9cae('0x21')](function(){return _0x1a5c9e;});}else{return _0x1a5c9e;}})[_0x9cae('0x45')](function(_0xdf0ea7){logger[_0x9cae('0x51')](_0x9cae('0x52'),_0xdf0ea7);throw _0xdf0ea7;});}return _0x1a5c9e;})['then'](respondWithResult(_0x3a9049,0xc9))[_0x9cae('0x45')](handleError(_0x3a9049,null));};exports[_0x9cae('0x53')]=function(_0x38b1ff,_0x505959){if(_0x38b1ff[_0x9cae('0x4a')]['id']){delete _0x38b1ff['body']['id'];}return db[_0x9cae('0x40')][_0x9cae('0x48')]({'where':{'id':_0x38b1ff[_0x9cae('0x47')]['id']}})[_0x9cae('0x21')](handleEntityNotFound(_0x505959,null))[_0x9cae('0x21')](saveUpdates(_0x38b1ff['body'],null))['then'](respondWithResult(_0x505959,null))['catch'](handleError(_0x505959,null));};exports[_0x9cae('0x22')]=function(_0xae9682,_0x416aad){return db['Template'][_0x9cae('0x48')]({'where':{'id':_0xae9682[_0x9cae('0x47')]['id']}})[_0x9cae('0x21')](handleEntityNotFound(_0x416aad,null))['then'](removeEntity(_0x416aad,null))[_0x9cae('0x45')](handleError(_0x416aad,null));}; \ No newline at end of file +var _0x0a4e=['pick','filter','merge','VIRTUAL','findAll','catch','show','params','includeAll','include','options','create','body','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x0a4e,0x67));var _0xe0a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a4e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe0a4('0x0'));var rimraf=require(_0xe0a4('0x1'));var zipdir=require(_0xe0a4('0x2'));var jsonpatch=require(_0xe0a4('0x3'));var rp=require('request-promise');var moment=require(_0xe0a4('0x4'));var BPromise=require(_0xe0a4('0x5'));var Mustache=require(_0xe0a4('0x6'));var util=require(_0xe0a4('0x7'));var path=require(_0xe0a4('0x8'));var sox=require(_0xe0a4('0x9'));var csv=require('to-csv');var ejs=require(_0xe0a4('0xa'));var fs=require('fs');var fs_extra=require(_0xe0a4('0xb'));var _=require(_0xe0a4('0xc'));var squel=require(_0xe0a4('0xd'));var crypto=require(_0xe0a4('0xe'));var jsforce=require(_0xe0a4('0xf'));var deskjs=require(_0xe0a4('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe0a4('0x11'));var Redis=require(_0xe0a4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe0a4('0x13'));var as=require(_0xe0a4('0x14'));var hardwareService=require(_0xe0a4('0x15'));var logger=require('../../config/logger')(_0xe0a4('0x16'));var utils=require('../../config/utils');var config=require(_0xe0a4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x96031b,_0x2be2e0){_0x2be2e0=_0x2be2e0||0xcc;return function(_0x128f0c){if(_0x128f0c){return _0x96031b[_0xe0a4('0x18')](_0x2be2e0);}return _0x96031b['status'](_0x2be2e0)[_0xe0a4('0x19')]();};}function respondWithResult(_0x169f69,_0x4611c9){_0x4611c9=_0x4611c9||0xc8;return function(_0x1205fd){if(_0x1205fd){return _0x169f69['status'](_0x4611c9)['json'](_0x1205fd);}};}function respondWithFilteredResult(_0x5bc4f2,_0x1344e5){return function(_0x5e5b3a){if(_0x5e5b3a){var _0x39f085=typeof _0x1344e5[_0xe0a4('0x1a')]===_0xe0a4('0x1b')&&typeof _0x1344e5[_0xe0a4('0x1c')]==='undefined';var _0x176f2d=_0x5e5b3a[_0xe0a4('0x1d')];var _0x4fd4f5=_0x39f085?0x0:_0x1344e5[_0xe0a4('0x1a')];var _0x11e67e=_0x39f085?_0x5e5b3a[_0xe0a4('0x1d')]:_0x1344e5['offset']+_0x1344e5[_0xe0a4('0x1c')];var _0x334d16;if(_0x11e67e>=_0x176f2d){_0x11e67e=_0x176f2d;_0x334d16=0xc8;}else{_0x334d16=0xce;}_0x5bc4f2[_0xe0a4('0x1e')](_0x334d16);return _0x5bc4f2[_0xe0a4('0x1f')](_0xe0a4('0x20'),_0x4fd4f5+'-'+_0x11e67e+'/'+_0x176f2d)[_0xe0a4('0x21')](_0x5e5b3a);}return null;};}function patchUpdates(_0x467cce){return function(_0x3d35b4){try{jsonpatch[_0xe0a4('0x22')](_0x3d35b4,_0x467cce,!![]);}catch(_0x5a20a8){return BPromise[_0xe0a4('0x23')](_0x5a20a8);}return _0x3d35b4[_0xe0a4('0x24')]();};}function saveUpdates(_0x437c93,_0x539bdc){return function(_0x45586c){if(_0x45586c){return _0x45586c[_0xe0a4('0x25')](_0x437c93)['then'](function(_0x212ba0){return _0x212ba0;});}return null;};}function removeEntity(_0x5c64e9,_0x3b700c){return function(_0x29e469){if(_0x29e469){return _0x29e469[_0xe0a4('0x26')]()[_0xe0a4('0x27')](function(){var _0x1cdcaf=_0x29e469[_0xe0a4('0x28')]({'plain':!![]});var _0x163bbc=_0xe0a4('0x29');return db[_0xe0a4('0x2a')][_0xe0a4('0x26')]({'where':{'type':_0x163bbc,'resourceId':_0x1cdcaf['id']}})[_0xe0a4('0x27')](function(){return _0x29e469;});})[_0xe0a4('0x27')](function(){_0x5c64e9[_0xe0a4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x407a05,_0xdcec49){return function(_0x25fc39){if(!_0x25fc39){_0x407a05[_0xe0a4('0x18')](0x194);}return _0x25fc39;};}function handleError(_0x4ac417,_0x14c931){_0x14c931=_0x14c931||0x1f4;return function(_0x1da411){logger[_0xe0a4('0x2b')](_0x1da411[_0xe0a4('0x2c')]);if(_0x1da411[_0xe0a4('0x2d')]){delete _0x1da411['name'];}_0x4ac417['status'](_0x14c931)[_0xe0a4('0x2e')](_0x1da411);};}exports[_0xe0a4('0x2f')]=function(_0x5c0769,_0x36d741){var _0x225fe9={},_0x38ac24={},_0x2f1374={'count':0x0,'rows':[]};var _0x1d6e3b=_[_0xe0a4('0x30')](db[_0xe0a4('0x31')][_0xe0a4('0x32')],function(_0x4ad1d8){return{'name':_0x4ad1d8[_0xe0a4('0x33')],'type':_0x4ad1d8[_0xe0a4('0x34')][_0xe0a4('0x35')]};});_0x38ac24[_0xe0a4('0x36')]=_[_0xe0a4('0x30')](_0x1d6e3b,'name');_0x38ac24[_0xe0a4('0x37')]=_[_0xe0a4('0x38')](_0x5c0769['query']);_0x38ac24[_0xe0a4('0x39')]=_[_0xe0a4('0x3a')](_0x38ac24['model'],_0x38ac24[_0xe0a4('0x37')]);_0x225fe9[_0xe0a4('0x3b')]=_[_0xe0a4('0x3a')](_0x38ac24[_0xe0a4('0x36')],qs[_0xe0a4('0x3c')](_0x5c0769[_0xe0a4('0x37')]['fields']));_0x225fe9[_0xe0a4('0x3b')]=_0x225fe9[_0xe0a4('0x3b')][_0xe0a4('0x3d')]?_0x225fe9[_0xe0a4('0x3b')]:_0x38ac24['model'];if(!_0x5c0769[_0xe0a4('0x37')]['hasOwnProperty'](_0xe0a4('0x3e'))){_0x225fe9[_0xe0a4('0x1c')]=qs[_0xe0a4('0x1c')](_0x5c0769[_0xe0a4('0x37')][_0xe0a4('0x1c')]);_0x225fe9[_0xe0a4('0x1a')]=qs[_0xe0a4('0x1a')](_0x5c0769[_0xe0a4('0x37')][_0xe0a4('0x1a')]);}_0x225fe9['order']=qs[_0xe0a4('0x3f')](_0x5c0769['query']['sort']);_0x225fe9[_0xe0a4('0x40')]=qs[_0xe0a4('0x39')](_[_0xe0a4('0x41')](_0x5c0769[_0xe0a4('0x37')],_0x38ac24[_0xe0a4('0x39')]),_0x1d6e3b);if(_0x5c0769['query'][_0xe0a4('0x42')]){_0x225fe9[_0xe0a4('0x40')]=_[_0xe0a4('0x43')](_0x225fe9['where'],{'$or':_[_0xe0a4('0x30')](_0x1d6e3b,function(_0x221bc6){if(_0x221bc6[_0xe0a4('0x34')]!==_0xe0a4('0x44')){var _0x4e091e={};_0x4e091e[_0x221bc6[_0xe0a4('0x2d')]]={'$like':'%'+_0x5c0769['query']['filter']+'%'};return _0x4e091e;}})});}_0x225fe9=_[_0xe0a4('0x43')]({},_0x225fe9,_0x5c0769['options']);var _0x1475c9={'where':_0x225fe9[_0xe0a4('0x40')]};return db['Template'][_0xe0a4('0x1d')](_0x1475c9)[_0xe0a4('0x27')](function(_0x3324b8){_0x2f1374[_0xe0a4('0x1d')]=_0x3324b8;if(_0x5c0769['query']['includeAll']){_0x225fe9['include']=[{'all':!![]}];}return db[_0xe0a4('0x31')][_0xe0a4('0x45')](_0x225fe9);})[_0xe0a4('0x27')](function(_0x18c16b){_0x2f1374['rows']=_0x18c16b;return _0x2f1374;})[_0xe0a4('0x27')](respondWithFilteredResult(_0x36d741,_0x225fe9))[_0xe0a4('0x46')](handleError(_0x36d741,null));};exports[_0xe0a4('0x47')]=function(_0x5f42a4,_0x3a4326){var _0x395f41={'raw':!![],'where':{'id':_0x5f42a4[_0xe0a4('0x48')]['id']}},_0x79ae69={};_0x79ae69['model']=_[_0xe0a4('0x38')](db['Template'][_0xe0a4('0x32')]);_0x79ae69[_0xe0a4('0x37')]=_['keys'](_0x5f42a4[_0xe0a4('0x37')]);_0x79ae69['filters']=_[_0xe0a4('0x3a')](_0x79ae69[_0xe0a4('0x36')],_0x79ae69['query']);_0x395f41[_0xe0a4('0x3b')]=_[_0xe0a4('0x3a')](_0x79ae69[_0xe0a4('0x36')],qs[_0xe0a4('0x3c')](_0x5f42a4[_0xe0a4('0x37')][_0xe0a4('0x3c')]));_0x395f41['attributes']=_0x395f41[_0xe0a4('0x3b')][_0xe0a4('0x3d')]?_0x395f41[_0xe0a4('0x3b')]:_0x79ae69['model'];if(_0x5f42a4['query'][_0xe0a4('0x49')]){_0x395f41[_0xe0a4('0x4a')]=[{'all':!![]}];}_0x395f41=_[_0xe0a4('0x43')]({},_0x395f41,_0x5f42a4[_0xe0a4('0x4b')]);return db['Template']['find'](_0x395f41)['then'](handleEntityNotFound(_0x3a4326,null))[_0xe0a4('0x27')](respondWithResult(_0x3a4326,null))[_0xe0a4('0x46')](handleError(_0x3a4326,null));};exports[_0xe0a4('0x4c')]=function(_0x515899,_0x40d47d){return db[_0xe0a4('0x31')][_0xe0a4('0x4c')](_0x515899[_0xe0a4('0x4d')],{})[_0xe0a4('0x27')](function(_0x2d962e){var _0xff1e46=_0x515899['user']['get']({'plain':!![]});if(!_0xff1e46)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xff1e46[_0xe0a4('0x4e')]===_0xe0a4('0x4f')){var _0x1f7139=_0x2d962e[_0xe0a4('0x28')]({'plain':!![]});var _0x55f116=_0xe0a4('0x29');return db[_0xe0a4('0x50')][_0xe0a4('0x51')]({'where':{'name':_0x55f116,'userProfileId':_0xff1e46['userProfileId']},'raw':!![]})[_0xe0a4('0x27')](function(_0x319d6e){if(_0x319d6e&&_0x319d6e[_0xe0a4('0x52')]===0x0){return db['UserProfileResource'][_0xe0a4('0x4c')]({'name':_0x1f7139[_0xe0a4('0x2d')],'resourceId':_0x1f7139['id'],'type':_0x319d6e[_0xe0a4('0x2d')],'sectionId':_0x319d6e['id']},{})[_0xe0a4('0x27')](function(){return _0x2d962e;});}else{return _0x2d962e;}})[_0xe0a4('0x46')](function(_0x18ea16){logger[_0xe0a4('0x2b')](_0xe0a4('0x53'),_0x18ea16);throw _0x18ea16;});}return _0x2d962e;})[_0xe0a4('0x27')](respondWithResult(_0x40d47d,0xc9))['catch'](handleError(_0x40d47d,null));};exports['update']=function(_0x73b0d2,_0x188c14){if(_0x73b0d2[_0xe0a4('0x4d')]['id']){delete _0x73b0d2[_0xe0a4('0x4d')]['id'];}return db[_0xe0a4('0x31')][_0xe0a4('0x51')]({'where':{'id':_0x73b0d2[_0xe0a4('0x48')]['id']}})[_0xe0a4('0x27')](handleEntityNotFound(_0x188c14,null))[_0xe0a4('0x27')](saveUpdates(_0x73b0d2[_0xe0a4('0x4d')],null))['then'](respondWithResult(_0x188c14,null))['catch'](handleError(_0x188c14,null));};exports[_0xe0a4('0x26')]=function(_0x13de4e,_0x5ed413){return db[_0xe0a4('0x31')][_0xe0a4('0x51')]({'where':{'id':_0x13de4e[_0xe0a4('0x48')]['id']}})[_0xe0a4('0x27')](handleEntityNotFound(_0x5ed413,null))[_0xe0a4('0x27')](removeEntity(_0x5ed413,null))['catch'](handleError(_0x5ed413,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1f059a6..3907322 100644 --- a/server/api/template/template.model.js +++ b/server/api/template/template.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2dab=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','tools_templates','lodash'];(function(_0x73ac34,_0x53c9df){var _0x1c23c8=function(_0x3796ee){while(--_0x3796ee){_0x73ac34['push'](_0x73ac34['shift']());}};_0x1c23c8(++_0x53c9df);}(_0x2dab,0x19f));var _0xb2da=function(_0x387168,_0x2a4917){_0x387168=_0x387168-0x0;var _0x102587=_0x2dab[_0x387168];return _0x102587;};'use strict';var _=require(_0xb2da('0x0'));var util=require(_0xb2da('0x1'));var logger=require('../../config/logger')(_0xb2da('0x2'));var moment=require(_0xb2da('0x3'));var BPromise=require(_0xb2da('0x4'));var rp=require(_0xb2da('0x5'));var fs=require('fs');var path=require(_0xb2da('0x6'));var rimraf=require(_0xb2da('0x7'));var config=require(_0xb2da('0x8'));var attributes=require(_0xb2da('0x9'));module[_0xb2da('0xa')]=function(_0x209910,_0x437f5b){return _0x209910[_0xb2da('0xb')]('Template',attributes,{'tableName':_0xb2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfde=['define','Template','tools_templates','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./template.attributes'];(function(_0x465e3e,_0x5680de){var _0x8b895f=function(_0x3f6bff){while(--_0x3f6bff){_0x465e3e['push'](_0x465e3e['shift']());}};_0x8b895f(++_0x5680de);}(_0xbfde,0x87));var _0xebfd=function(_0x4ffa55,_0x4babc3){_0x4ffa55=_0x4ffa55-0x0;var _0x2ad5b8=_0xbfde[_0x4ffa55];return _0x2ad5b8;};'use strict';var _=require('lodash');var util=require(_0xebfd('0x0'));var logger=require(_0xebfd('0x1'))(_0xebfd('0x2'));var moment=require('moment');var BPromise=require(_0xebfd('0x3'));var rp=require(_0xebfd('0x4'));var fs=require('fs');var path=require(_0xebfd('0x5'));var rimraf=require('rimraf');var config=require(_0xebfd('0x6'));var attributes=require(_0xebfd('0x7'));module['exports']=function(_0x2e5487,_0x16280b){return _0x2e5487[_0xebfd('0x8')](_0xebfd('0x9'),attributes,{'tableName':_0xebfd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 224cc9b..5c03f21 100644 --- a/server/api/template/template.rpc.js +++ b/server/api/template/template.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a16=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTemplate','Template','findAll','options','where','attributes','limit','map','include','model','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a16,0xe6));var _0x68a1=function(_0x1fd1a0,_0x314e2b){_0x1fd1a0=_0x1fd1a0-0x0;var _0xf7adce=_0x8a16[_0x1fd1a0];return _0xf7adce;};'use strict';var _=require(_0x68a1('0x0'));var util=require('util');var moment=require(_0x68a1('0x1'));var BPromise=require(_0x68a1('0x2'));var rs=require(_0x68a1('0x3'));var fs=require('fs');var Redis=require(_0x68a1('0x4'));var db=require(_0x68a1('0x5'))['db'];var utils=require(_0x68a1('0x6'));var logger=require(_0x68a1('0x7'))('rpc');var config=require(_0x68a1('0x8'));var jayson=require(_0x68a1('0x9'));var client=jayson['client'][_0x68a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cb6d4,_0x2a154a,_0x121c9f){return new BPromise(function(_0x363f65,_0x5e0457){return client[_0x68a1('0xb')](_0x5cb6d4,_0x121c9f)[_0x68a1('0xc')](function(_0x334d16){logger[_0x68a1('0xd')](_0x68a1('0xe'),_0x2a154a,_0x68a1('0xf'));logger[_0x68a1('0x10')](_0x68a1('0x11'),_0x2a154a,_0x68a1('0xf'),JSON[_0x68a1('0x12')](_0x334d16));if(_0x334d16[_0x68a1('0x13')]){if(_0x334d16[_0x68a1('0x13')][_0x68a1('0x14')]===0x1f4){logger[_0x68a1('0x13')](_0x68a1('0xe'),_0x2a154a,_0x334d16['error'][_0x68a1('0x15')]);return _0x5e0457(_0x334d16[_0x68a1('0x13')]['message']);}logger['error'](_0x68a1('0xe'),_0x2a154a,_0x334d16[_0x68a1('0x13')][_0x68a1('0x15')]);return _0x363f65(_0x334d16['error'][_0x68a1('0x15')]);}else{logger[_0x68a1('0xd')](_0x68a1('0xe'),_0x2a154a,'request\x20sent');_0x363f65(_0x334d16[_0x68a1('0x16')][_0x68a1('0x15')]);}})['catch'](function(_0xdbfc1f){logger[_0x68a1('0x13')](_0x68a1('0xe'),_0x2a154a,_0xdbfc1f);_0x5e0457(_0xdbfc1f);});});}exports[_0x68a1('0x17')]=function(_0x556e03){var _0x3c5f7b=this;return new Promise(function(_0x32bb5a,_0x46bf57){return db[_0x68a1('0x18')][_0x68a1('0x19')]({'raw':_0x556e03[_0x68a1('0x1a')]?_0x556e03['options']['raw']===undefined?!![]:![]:!![],'where':_0x556e03[_0x68a1('0x1a')]?_0x556e03[_0x68a1('0x1a')][_0x68a1('0x1b')]||null:null,'attributes':_0x556e03[_0x68a1('0x1a')]?_0x556e03[_0x68a1('0x1a')][_0x68a1('0x1c')]||null:null,'limit':_0x556e03['options']?_0x556e03[_0x68a1('0x1a')][_0x68a1('0x1d')]||null:null,'include':_0x556e03[_0x68a1('0x1a')]?_0x556e03[_0x68a1('0x1a')]['include']?_[_0x68a1('0x1e')](_0x556e03[_0x68a1('0x1a')][_0x68a1('0x1f')],function(_0x592aec){return{'model':db[_0x592aec['model']],'as':_0x592aec['as'],'attributes':_0x592aec[_0x68a1('0x1c')],'include':_0x592aec[_0x68a1('0x1f')]?_['map'](_0x592aec[_0x68a1('0x1f')],function(_0x232adb){return{'model':db[_0x232adb[_0x68a1('0x20')]],'as':_0x232adb['as'],'attributes':_0x232adb[_0x68a1('0x1c')],'include':_0x232adb[_0x68a1('0x1f')]?_[_0x68a1('0x1e')](_0x232adb['include'],function(_0x254ba0){return{'model':db[_0x254ba0['model']],'as':_0x254ba0['as'],'attributes':_0x254ba0[_0x68a1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x68a1('0xc')](function(_0x1bf751){logger[_0x68a1('0xd')](_0x68a1('0x17'),_0x556e03);logger[_0x68a1('0x10')](_0x68a1('0x17'),_0x556e03,JSON[_0x68a1('0x12')](_0x1bf751));_0x32bb5a(_0x1bf751);})['catch'](function(_0x786b82){logger[_0x68a1('0x13')](_0x68a1('0x17'),_0x786b82['message'],_0x556e03);_0x46bf57(_0x3c5f7b[_0x68a1('0x13')](0x1f4,_0x786b82[_0x68a1('0x15')]));});});}; \ No newline at end of file +var _0xf54a=['GetTemplate','Template','findAll','options','where','limit','include','model','attributes','map','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Template,\x20%s,\x20%s','message','catch'];(function(_0x2a134b,_0x43fbb7){var _0x457ae8=function(_0x940fcd){while(--_0x940fcd){_0x2a134b['push'](_0x2a134b['shift']());}};_0x457ae8(++_0x43fbb7);}(_0xf54a,0xa1));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xaf54('0x0'));var rs=require(_0xaf54('0x1'));var fs=require('fs');var Redis=require(_0xaf54('0x2'));var db=require(_0xaf54('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf54('0x4'))(_0xaf54('0x5'));var config=require(_0xaf54('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaf54('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a016c,_0x289e73,_0x4a7c48){return new BPromise(function(_0x47b07a,_0x15e963){return client[_0xaf54('0x8')](_0x3a016c,_0x4a7c48)[_0xaf54('0x9')](function(_0x31e386){logger[_0xaf54('0xa')]('Template,\x20%s,\x20%s',_0x289e73,'request\x20sent');logger[_0xaf54('0xb')](_0xaf54('0xc'),_0x289e73,_0xaf54('0xd'),JSON['stringify'](_0x31e386));if(_0x31e386[_0xaf54('0xe')]){if(_0x31e386[_0xaf54('0xe')][_0xaf54('0xf')]===0x1f4){logger['error'](_0xaf54('0x10'),_0x289e73,_0x31e386['error'][_0xaf54('0x11')]);return _0x15e963(_0x31e386[_0xaf54('0xe')]['message']);}logger[_0xaf54('0xe')]('Template,\x20%s,\x20%s',_0x289e73,_0x31e386['error']['message']);return _0x47b07a(_0x31e386[_0xaf54('0xe')][_0xaf54('0x11')]);}else{logger['info'](_0xaf54('0x10'),_0x289e73,_0xaf54('0xd'));_0x47b07a(_0x31e386['result'][_0xaf54('0x11')]);}})[_0xaf54('0x12')](function(_0x5c2326){logger['error'](_0xaf54('0x10'),_0x289e73,_0x5c2326);_0x15e963(_0x5c2326);});});}exports[_0xaf54('0x13')]=function(_0xce6493){var _0x12be55=this;return new Promise(function(_0x4e255a,_0xe9bf72){return db[_0xaf54('0x14')][_0xaf54('0x15')]({'raw':_0xce6493['options']?_0xce6493[_0xaf54('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xce6493[_0xaf54('0x16')]?_0xce6493[_0xaf54('0x16')][_0xaf54('0x17')]||null:null,'attributes':_0xce6493[_0xaf54('0x16')]?_0xce6493[_0xaf54('0x16')]['attributes']||null:null,'limit':_0xce6493[_0xaf54('0x16')]?_0xce6493[_0xaf54('0x16')][_0xaf54('0x18')]||null:null,'include':_0xce6493[_0xaf54('0x16')]?_0xce6493[_0xaf54('0x16')]['include']?_['map'](_0xce6493[_0xaf54('0x16')][_0xaf54('0x19')],function(_0x6b77a5){return{'model':db[_0x6b77a5[_0xaf54('0x1a')]],'as':_0x6b77a5['as'],'attributes':_0x6b77a5[_0xaf54('0x1b')],'include':_0x6b77a5[_0xaf54('0x19')]?_[_0xaf54('0x1c')](_0x6b77a5['include'],function(_0x5448e6){return{'model':db[_0x5448e6[_0xaf54('0x1a')]],'as':_0x5448e6['as'],'attributes':_0x5448e6[_0xaf54('0x1b')],'include':_0x5448e6['include']?_[_0xaf54('0x1c')](_0x5448e6[_0xaf54('0x19')],function(_0x21324e){return{'model':db[_0x21324e[_0xaf54('0x1a')]],'as':_0x21324e['as'],'attributes':_0x21324e[_0xaf54('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaf54('0x9')](function(_0x20ccf8){logger[_0xaf54('0xa')](_0xaf54('0x13'),_0xce6493);logger['debug'](_0xaf54('0x13'),_0xce6493,JSON[_0xaf54('0x1d')](_0x20ccf8));_0x4e255a(_0x20ccf8);})[_0xaf54('0x12')](function(_0x2bf191){logger[_0xaf54('0xe')](_0xaf54('0x13'),_0x2bf191[_0xaf54('0x11')],_0xce6493);_0xe9bf72(_0x12be55[_0xaf54('0xe')](0x1f4,_0x2bf191[_0xaf54('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index c3b8521..5291f7c 100644 --- a/server/api/trigger/index.js +++ b/server/api/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea54=['delete','exports','path','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','update'];(function(_0xa21c85,_0x1dabfa){var _0x490538=function(_0x1f92c9){while(--_0x1f92c9){_0xa21c85['push'](_0xa21c85['shift']());}};_0x490538(++_0x1dabfa);}(_0xea54,0x142));var _0x4ea5=function(_0x140789,_0x43cd27){_0x140789=_0x140789-0x0;var _0x49ffcb=_0xea54[_0x140789];return _0x49ffcb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ea5('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4ea5('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x4ea5('0x2'));var controller=require('./trigger.controller');router[_0x4ea5('0x3')]('/',auth[_0x4ea5('0x4')](),controller['index']);router[_0x4ea5('0x3')](_0x4ea5('0x5'),auth[_0x4ea5('0x4')](),controller['show']);router[_0x4ea5('0x3')](_0x4ea5('0x6'),auth[_0x4ea5('0x4')](),controller[_0x4ea5('0x7')]);router[_0x4ea5('0x3')]('/:id/any_conditions',auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x4ea5('0x3')](_0x4ea5('0x8'),auth['isAuthenticated'](),controller[_0x4ea5('0x9')]);router[_0x4ea5('0xa')]('/',auth[_0x4ea5('0x4')](),controller[_0x4ea5('0xb')]);router[_0x4ea5('0xa')](_0x4ea5('0x6'),auth[_0x4ea5('0x4')](),controller[_0x4ea5('0xc')]);router[_0x4ea5('0xa')](_0x4ea5('0xd'),auth[_0x4ea5('0x4')](),controller[_0x4ea5('0xe')]);router[_0x4ea5('0xa')](_0x4ea5('0x8'),auth['isAuthenticated'](),controller[_0x4ea5('0xf')]);router[_0x4ea5('0x10')]('/:id',auth[_0x4ea5('0x4')](),controller[_0x4ea5('0x11')]);router[_0x4ea5('0x12')](_0x4ea5('0x5'),auth[_0x4ea5('0x4')](),controller['destroy']);module[_0x4ea5('0x13')]=router; \ No newline at end of file +var _0xf4e9=['fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions','addAllCondition','post','addAnyCondition','addAction','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x1a7c9f,_0x495a57){var _0x54bcaf=function(_0x274992){while(--_0x274992){_0x1a7c9f['push'](_0x1a7c9f['shift']());}};_0x54bcaf(++_0x495a57);}(_0xf4e9,0x174));var _0x9f4e=function(_0x3b9c2c,_0x3168fd){_0x3b9c2c=_0x3b9c2c-0x0;var _0x3e283c=_0xf4e9[_0x3b9c2c];return _0x3e283c;};'use strict';var multer=require(_0x9f4e('0x0'));var util=require(_0x9f4e('0x1'));var path=require(_0x9f4e('0x2'));var timeout=require(_0x9f4e('0x3'));var express=require(_0x9f4e('0x4'));var router=express[_0x9f4e('0x5')]();var fs_extra=require(_0x9f4e('0x6'));var auth=require(_0x9f4e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9f4e('0x8'));var controller=require(_0x9f4e('0x9'));router['get']('/',auth[_0x9f4e('0xa')](),controller[_0x9f4e('0xb')]);router[_0x9f4e('0xc')](_0x9f4e('0xd'),auth[_0x9f4e('0xa')](),controller[_0x9f4e('0xe')]);router[_0x9f4e('0xc')](_0x9f4e('0xf'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x9f4e('0xc')](_0x9f4e('0x10'),auth[_0x9f4e('0xa')](),controller['getAnyConditions']);router[_0x9f4e('0xc')](_0x9f4e('0x11'),auth[_0x9f4e('0xa')](),controller[_0x9f4e('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9f4e('0xf'),auth[_0x9f4e('0xa')](),controller[_0x9f4e('0x13')]);router[_0x9f4e('0x14')](_0x9f4e('0x10'),auth['isAuthenticated'](),controller[_0x9f4e('0x15')]);router[_0x9f4e('0x14')](_0x9f4e('0x11'),auth[_0x9f4e('0xa')](),controller[_0x9f4e('0x16')]);router[_0x9f4e('0x17')](_0x9f4e('0xd'),auth[_0x9f4e('0xa')](),controller[_0x9f4e('0x18')]);router[_0x9f4e('0x19')]('/:id',auth[_0x9f4e('0xa')](),controller[_0x9f4e('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index d61dfbb..ef44bc0 100644 --- a/server/api/trigger/trigger.attributes.js +++ b/server/api/trigger/trigger.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74d8=['STRING'];(function(_0x2aa451,_0x8d8eed){var _0x176192=function(_0x50cae6){while(--_0x50cae6){_0x2aa451['push'](_0x2aa451['shift']());}};_0x176192(++_0x8d8eed);}(_0x74d8,0xd8));var _0x874d=function(_0x43b791,_0xf2ab1){_0x43b791=_0x43b791-0x0;var _0x63c17f=_0x74d8[_0x43b791];return _0x63c17f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x874d('0x0')]},'channel':{'type':Sequelize[_0x874d('0x0')]},'description':{'type':Sequelize[_0x874d('0x0')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1ff6=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1ae4e5,_0x2b5181){var _0x4e4861=function(_0x20772a){while(--_0x20772a){_0x1ae4e5['push'](_0x1ae4e5['shift']());}};_0x4e4861(++_0x2b5181);}(_0x1ff6,0x68));var _0x61ff=function(_0x5cdb0f,_0xa8c789){_0x5cdb0f=_0x5cdb0f-0x0;var _0x1a6403=_0x1ff6[_0x5cdb0f];return _0x1a6403;};'use strict';var Sequelize=require(_0x61ff('0x0'));module[_0x61ff('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x61ff('0x2')]},'status':{'type':Sequelize[_0x61ff('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 65a684b..627cabd 100644 --- a/server/api/trigger/trigger.controller.js +++ b/server/api/trigger/trigger.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d3f=['params','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','pick','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','get','Triggers','status','error','stack','name','send','map','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','Trigger','includeAll','include','findAll','rows','catch','show','keys','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition'];(function(_0x295007,_0x56f293){var _0x17d8bf=function(_0x249f04){while(--_0x249f04){_0x295007['push'](_0x295007['shift']());}};_0x17d8bf(++_0x56f293);}(_0x6d3f,0xc7));var _0xf6d3=function(_0x4b9cef,_0x527a7d){_0x4b9cef=_0x4b9cef-0x0;var _0x2f2147=_0x6d3f[_0x4b9cef];return _0x2f2147;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6d3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6d3('0x1'));var Mustache=require(_0xf6d3('0x2'));var util=require(_0xf6d3('0x3'));var path=require(_0xf6d3('0x4'));var sox=require(_0xf6d3('0x5'));var csv=require(_0xf6d3('0x6'));var ejs=require(_0xf6d3('0x7'));var fs=require('fs');var fs_extra=require(_0xf6d3('0x8'));var _=require(_0xf6d3('0x9'));var squel=require(_0xf6d3('0xa'));var crypto=require(_0xf6d3('0xb'));var jsforce=require(_0xf6d3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf6d3('0x6'));var querystring=require(_0xf6d3('0xd'));var Papa=require(_0xf6d3('0xe'));var Redis=require(_0xf6d3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf6d3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf6d3('0x11'));var utils=require(_0xf6d3('0x12'));var config=require(_0xf6d3('0x13'));var licenseUtil=require(_0xf6d3('0x14'));var db=require(_0xf6d3('0x15'))['db'];function respondWithStatusCode(_0x365f89,_0x506375){_0x506375=_0x506375||0xcc;return function(_0x54e044){if(_0x54e044){return _0x365f89['sendStatus'](_0x506375);}return _0x365f89['status'](_0x506375)[_0xf6d3('0x16')]();};}function respondWithResult(_0x59878d,_0x105dfb){_0x105dfb=_0x105dfb||0xc8;return function(_0x5a4adc){if(_0x5a4adc){return _0x59878d['status'](_0x105dfb)['json'](_0x5a4adc);}};}function respondWithFilteredResult(_0x17119b,_0x5b6ffc){return function(_0x1f7f12){if(_0x1f7f12){var _0x17f085=typeof _0x5b6ffc['offset']===_0xf6d3('0x17')&&typeof _0x5b6ffc['limit']===_0xf6d3('0x17');var _0x5c0121=_0x1f7f12[_0xf6d3('0x18')];var _0x5851ae=_0x17f085?0x0:_0x5b6ffc[_0xf6d3('0x19')];var _0x5d6bf0=_0x17f085?_0x1f7f12['count']:_0x5b6ffc[_0xf6d3('0x19')]+_0x5b6ffc[_0xf6d3('0x1a')];var _0x1017a5;if(_0x5d6bf0>=_0x5c0121){_0x5d6bf0=_0x5c0121;_0x1017a5=0xc8;}else{_0x1017a5=0xce;}_0x17119b['status'](_0x1017a5);return _0x17119b[_0xf6d3('0x1b')](_0xf6d3('0x1c'),_0x5851ae+'-'+_0x5d6bf0+'/'+_0x5c0121)[_0xf6d3('0x1d')](_0x1f7f12);}return null;};}function patchUpdates(_0x446d1){return function(_0x41661a){try{jsonpatch['apply'](_0x41661a,_0x446d1,!![]);}catch(_0xbeb618){return BPromise[_0xf6d3('0x1e')](_0xbeb618);}return _0x41661a[_0xf6d3('0x1f')]();};}function saveUpdates(_0x4e873d,_0x24a9bf){return function(_0x10c4ee){if(_0x10c4ee){return _0x10c4ee[_0xf6d3('0x20')](_0x4e873d)[_0xf6d3('0x21')](function(_0x1634f7){return _0x1634f7;});}return null;};}function removeEntity(_0x5e1ac2,_0x9af7af){return function(_0x59201b){if(_0x59201b){return _0x59201b[_0xf6d3('0x22')]()[_0xf6d3('0x21')](function(){var _0x738175=_0x59201b[_0xf6d3('0x23')]({'plain':!![]});var _0x3034ae=_0xf6d3('0x24');return db['UserProfileResource'][_0xf6d3('0x22')]({'where':{'type':_0x3034ae,'resourceId':_0x738175['id']}})[_0xf6d3('0x21')](function(){return _0x59201b;});})[_0xf6d3('0x21')](function(){_0x5e1ac2[_0xf6d3('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x410031,_0x2052f2){return function(_0x539b0a){if(!_0x539b0a){_0x410031['sendStatus'](0x194);}return _0x539b0a;};}function handleError(_0x8fa186,_0xfd29df){_0xfd29df=_0xfd29df||0x1f4;return function(_0x7e8a93){logger[_0xf6d3('0x26')](_0x7e8a93[_0xf6d3('0x27')]);if(_0x7e8a93[_0xf6d3('0x28')]){delete _0x7e8a93[_0xf6d3('0x28')];}_0x8fa186[_0xf6d3('0x25')](_0xfd29df)[_0xf6d3('0x29')](_0x7e8a93);};}exports['index']=function(_0x1b400e,_0x3e1aa8){var _0x343276={},_0x284e56={},_0x354bd4={'count':0x0,'rows':[]};var _0x11c881=_[_0xf6d3('0x2a')](db['Trigger'][_0xf6d3('0x2b')],function(_0x235f58){return{'name':_0x235f58[_0xf6d3('0x2c')],'type':_0x235f58['type']['key']};});_0x284e56[_0xf6d3('0x2d')]=_[_0xf6d3('0x2a')](_0x11c881,_0xf6d3('0x28'));_0x284e56[_0xf6d3('0x2e')]=_['keys'](_0x1b400e['query']);_0x284e56[_0xf6d3('0x2f')]=_['intersection'](_0x284e56[_0xf6d3('0x2d')],_0x284e56[_0xf6d3('0x2e')]);_0x343276[_0xf6d3('0x30')]=_[_0xf6d3('0x31')](_0x284e56[_0xf6d3('0x2d')],qs[_0xf6d3('0x32')](_0x1b400e['query'][_0xf6d3('0x32')]));_0x343276[_0xf6d3('0x30')]=_0x343276[_0xf6d3('0x30')]['length']?_0x343276['attributes']:_0x284e56[_0xf6d3('0x2d')];if(!_0x1b400e[_0xf6d3('0x2e')][_0xf6d3('0x33')](_0xf6d3('0x34'))){_0x343276[_0xf6d3('0x1a')]=qs[_0xf6d3('0x1a')](_0x1b400e[_0xf6d3('0x2e')][_0xf6d3('0x1a')]);_0x343276['offset']=qs['offset'](_0x1b400e[_0xf6d3('0x2e')][_0xf6d3('0x19')]);}_0x343276[_0xf6d3('0x35')]=qs[_0xf6d3('0x36')](_0x1b400e['query']['sort']);_0x343276[_0xf6d3('0x37')]=qs[_0xf6d3('0x2f')](_['pick'](_0x1b400e[_0xf6d3('0x2e')],_0x284e56[_0xf6d3('0x2f')]),_0x11c881);if(_0x1b400e[_0xf6d3('0x2e')][_0xf6d3('0x38')]){_0x343276[_0xf6d3('0x37')]=_[_0xf6d3('0x39')](_0x343276[_0xf6d3('0x37')],{'$or':_[_0xf6d3('0x2a')](_0x11c881,function(_0x2c0a7f){if(_0x2c0a7f[_0xf6d3('0x3a')]!==_0xf6d3('0x3b')){var _0x3bcccf={};_0x3bcccf[_0x2c0a7f[_0xf6d3('0x28')]]={'$like':'%'+_0x1b400e['query'][_0xf6d3('0x38')]+'%'};return _0x3bcccf;}})});}_0x343276=_[_0xf6d3('0x39')]({},_0x343276,_0x1b400e['options']);var _0x31190a={'where':_0x343276[_0xf6d3('0x37')]};return db[_0xf6d3('0x3c')]['count'](_0x31190a)[_0xf6d3('0x21')](function(_0xbe0b80){_0x354bd4['count']=_0xbe0b80;if(_0x1b400e[_0xf6d3('0x2e')][_0xf6d3('0x3d')]){_0x343276[_0xf6d3('0x3e')]=[{'all':!![]}];}return db['Trigger'][_0xf6d3('0x3f')](_0x343276);})[_0xf6d3('0x21')](function(_0x1c0812){_0x354bd4[_0xf6d3('0x40')]=_0x1c0812;return _0x354bd4;})[_0xf6d3('0x21')](respondWithFilteredResult(_0x3e1aa8,_0x343276))[_0xf6d3('0x41')](handleError(_0x3e1aa8,null));};exports[_0xf6d3('0x42')]=function(_0x1c980c,_0x5a0ef7){var _0x350ae5={'raw':![],'where':{'id':_0x1c980c['params']['id']}},_0x16388e={};_0x16388e[_0xf6d3('0x2d')]=_['keys'](db[_0xf6d3('0x3c')][_0xf6d3('0x2b')]);_0x16388e[_0xf6d3('0x2e')]=_[_0xf6d3('0x43')](_0x1c980c[_0xf6d3('0x2e')]);_0x16388e[_0xf6d3('0x2f')]=_[_0xf6d3('0x31')](_0x16388e[_0xf6d3('0x2d')],_0x16388e['query']);_0x350ae5['attributes']=_[_0xf6d3('0x31')](_0x16388e[_0xf6d3('0x2d')],qs['fields'](_0x1c980c['query']['fields']));_0x350ae5[_0xf6d3('0x30')]=_0x350ae5[_0xf6d3('0x30')][_0xf6d3('0x44')]?_0x350ae5[_0xf6d3('0x30')]:_0x16388e[_0xf6d3('0x2d')];if(_0x1c980c[_0xf6d3('0x2e')][_0xf6d3('0x3d')]){_0x350ae5[_0xf6d3('0x3e')]=[{'all':!![]}];}_0x350ae5=_['merge']({},_0x350ae5,_0x1c980c[_0xf6d3('0x45')]);return db[_0xf6d3('0x3c')][_0xf6d3('0x46')](_0x350ae5)[_0xf6d3('0x21')](handleEntityNotFound(_0x5a0ef7,null))[_0xf6d3('0x21')](respondWithResult(_0x5a0ef7,null))['catch'](handleError(_0x5a0ef7,null));};exports[_0xf6d3('0x47')]=function(_0x1c4414,_0x1b1545){return db[_0xf6d3('0x3c')][_0xf6d3('0x47')](_0x1c4414['body'],{})[_0xf6d3('0x21')](function(_0x731ee8){var _0x54ed67=_0x1c4414[_0xf6d3('0x48')]['get']({'plain':!![]});if(!_0x54ed67)throw new Error(_0xf6d3('0x49'));if(_0x54ed67[_0xf6d3('0x4a')]==='user'){var _0x5e9e30=_0x731ee8[_0xf6d3('0x23')]({'plain':!![]});var _0x4c8f40=_0xf6d3('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x4c8f40,'userProfileId':_0x54ed67[_0xf6d3('0x4b')]},'raw':!![]})[_0xf6d3('0x21')](function(_0x3ed404){if(_0x3ed404&&_0x3ed404['autoAssociation']===0x0){return db[_0xf6d3('0x4c')]['create']({'name':_0x5e9e30[_0xf6d3('0x28')],'resourceId':_0x5e9e30['id'],'type':_0x3ed404['name'],'sectionId':_0x3ed404['id']},{})[_0xf6d3('0x21')](function(){return _0x731ee8;});}else{return _0x731ee8;}})[_0xf6d3('0x41')](function(_0x1fa3d2){logger[_0xf6d3('0x26')](_0xf6d3('0x4d'),_0x1fa3d2);throw _0x1fa3d2;});}return _0x731ee8;})[_0xf6d3('0x21')](respondWithResult(_0x1b1545,0xc9))[_0xf6d3('0x41')](handleError(_0x1b1545,null));};exports[_0xf6d3('0x20')]=function(_0x497b0a,_0x29fa17){if(_0x497b0a['body']['id']){delete _0x497b0a[_0xf6d3('0x4e')]['id'];}return db['Trigger'][_0xf6d3('0x46')]({'where':{'id':_0x497b0a['params']['id']}})[_0xf6d3('0x21')](handleEntityNotFound(_0x29fa17,null))['then'](saveUpdates(_0x497b0a[_0xf6d3('0x4e')],null))[_0xf6d3('0x21')](respondWithResult(_0x29fa17,null))[_0xf6d3('0x41')](handleError(_0x29fa17,null));};exports[_0xf6d3('0x22')]=function(_0x406c21,_0x22ce5e){return db['Trigger']['find']({'where':{'id':_0x406c21['params']['id']}})[_0xf6d3('0x21')](handleEntityNotFound(_0x22ce5e,null))[_0xf6d3('0x21')](removeEntity(_0x22ce5e,null))[_0xf6d3('0x41')](handleError(_0x22ce5e,null));};exports[_0xf6d3('0x4f')]=function(_0x5220b0,_0x31fc48,_0x24e440){if(_0x5220b0[_0xf6d3('0x4e')]['id']){delete _0x5220b0[_0xf6d3('0x4e')]['id'];}return db[_0xf6d3('0x3c')][_0xf6d3('0x46')]({'where':{'id':_0x5220b0[_0xf6d3('0x50')]['id']}})['then'](handleEntityNotFound(_0x31fc48,null))[_0xf6d3('0x21')](function(_0x5c20be){if(_0x5c20be){_0x5220b0[_0xf6d3('0x4e')][_0xf6d3('0x51')]=_0x5c20be['id'];return db[_0xf6d3('0x52')][_0xf6d3('0x47')](_0x5220b0['body']);}})[_0xf6d3('0x21')](respondWithResult(_0x31fc48,null))['catch'](handleError(_0x31fc48,null));};exports[_0xf6d3('0x53')]=function(_0x14d90e,_0x230e4d,_0x317416){if(_0x14d90e[_0xf6d3('0x4e')]['id']){delete _0x14d90e[_0xf6d3('0x4e')]['id'];}return db['Trigger']['find']({'where':{'id':_0x14d90e['params']['id']}})[_0xf6d3('0x21')](handleEntityNotFound(_0x230e4d,null))[_0xf6d3('0x21')](function(_0x37760c){if(_0x37760c){_0x14d90e['body'][_0xf6d3('0x54')]=_0x37760c['id'];return db[_0xf6d3('0x52')][_0xf6d3('0x47')](_0x14d90e[_0xf6d3('0x4e')]);}})[_0xf6d3('0x21')](respondWithResult(_0x230e4d,null))[_0xf6d3('0x41')](handleError(_0x230e4d,null));};exports[_0xf6d3('0x55')]=function(_0x2b135a,_0x59a3bb,_0x38816d){var _0x2f1636={};var _0x5dc46c={};var _0x54001b;var _0x1cce13;return db[_0xf6d3('0x3c')][_0xf6d3('0x56')]({'where':{'id':_0x2b135a[_0xf6d3('0x50')]['id']}})[_0xf6d3('0x21')](handleEntityNotFound(_0x59a3bb,null))[_0xf6d3('0x21')](function(_0x539e80){if(_0x539e80){_0x54001b=_0x539e80;_0x5dc46c[_0xf6d3('0x2d')]=_[_0xf6d3('0x43')](db['Condition'][_0xf6d3('0x2b')]);_0x5dc46c[_0xf6d3('0x2e')]=_['keys'](_0x2b135a[_0xf6d3('0x2e')]);_0x5dc46c[_0xf6d3('0x2f')]=_[_0xf6d3('0x31')](_0x5dc46c[_0xf6d3('0x2d')],_0x5dc46c[_0xf6d3('0x2e')]);_0x2f1636[_0xf6d3('0x30')]=_[_0xf6d3('0x31')](_0x5dc46c[_0xf6d3('0x2d')],qs['fields'](_0x2b135a[_0xf6d3('0x2e')]['fields']));_0x2f1636[_0xf6d3('0x30')]=_0x2f1636['attributes'][_0xf6d3('0x44')]?_0x2f1636[_0xf6d3('0x30')]:_0x5dc46c[_0xf6d3('0x2d')];_0x2f1636[_0xf6d3('0x35')]=qs['sort'](_0x2b135a['query']['sort']);_0x2f1636['where']=qs[_0xf6d3('0x2f')](_[_0xf6d3('0x57')](_0x2b135a[_0xf6d3('0x2e')],_0x5dc46c[_0xf6d3('0x2f')]));if(_0x2b135a[_0xf6d3('0x2e')][_0xf6d3('0x38')]){_0x2f1636[_0xf6d3('0x37')]=_['merge'](_0x2f1636[_0xf6d3('0x37')],{'$or':_[_0xf6d3('0x2a')](_0x2f1636[_0xf6d3('0x30')],function(_0x143e04){var _0x1017a8={};_0x1017a8[_0x143e04]={'$like':'%'+_0x2b135a[_0xf6d3('0x2e')]['filter']+'%'};return _0x1017a8;})});}_0x2f1636=_[_0xf6d3('0x39')]({},_0x2f1636,_0x2b135a[_0xf6d3('0x45')]);return _0x54001b[_0xf6d3('0x55')](_0x2f1636);}})[_0xf6d3('0x21')](function(_0x365268){if(_0x365268){_0x1cce13=_0x365268['length'];if(!_0x2b135a['query'][_0xf6d3('0x33')](_0xf6d3('0x34'))){_0x2f1636['limit']=qs[_0xf6d3('0x1a')](_0x2b135a[_0xf6d3('0x2e')][_0xf6d3('0x1a')]);_0x2f1636[_0xf6d3('0x19')]=qs[_0xf6d3('0x19')](_0x2b135a['query']['offset']);}return _0x54001b['getAllConditions'](_0x2f1636);}})[_0xf6d3('0x21')](function(_0x191fe1){if(_0x191fe1){return _0x191fe1?{'count':_0x1cce13,'rows':_0x191fe1}:null;}})[_0xf6d3('0x21')](respondWithResult(_0x59a3bb,null))['catch'](handleError(_0x59a3bb,null));};exports[_0xf6d3('0x58')]=function(_0x1b2aea,_0x585d0c,_0x352e91){var _0x4d1aec={};var _0xd7d845={};var _0x5d48b4;var _0x21cb69;return db[_0xf6d3('0x3c')][_0xf6d3('0x56')]({'where':{'id':_0x1b2aea[_0xf6d3('0x50')]['id']}})['then'](handleEntityNotFound(_0x585d0c,null))['then'](function(_0x35590d){if(_0x35590d){_0x5d48b4=_0x35590d;_0xd7d845['model']=_[_0xf6d3('0x43')](db[_0xf6d3('0x52')][_0xf6d3('0x2b')]);_0xd7d845[_0xf6d3('0x2e')]=_[_0xf6d3('0x43')](_0x1b2aea[_0xf6d3('0x2e')]);_0xd7d845[_0xf6d3('0x2f')]=_[_0xf6d3('0x31')](_0xd7d845['model'],_0xd7d845[_0xf6d3('0x2e')]);_0x4d1aec[_0xf6d3('0x30')]=_[_0xf6d3('0x31')](_0xd7d845[_0xf6d3('0x2d')],qs[_0xf6d3('0x32')](_0x1b2aea['query'][_0xf6d3('0x32')]));_0x4d1aec['attributes']=_0x4d1aec[_0xf6d3('0x30')][_0xf6d3('0x44')]?_0x4d1aec[_0xf6d3('0x30')]:_0xd7d845['model'];_0x4d1aec['order']=qs[_0xf6d3('0x36')](_0x1b2aea['query'][_0xf6d3('0x36')]);_0x4d1aec[_0xf6d3('0x37')]=qs['filters'](_[_0xf6d3('0x57')](_0x1b2aea[_0xf6d3('0x2e')],_0xd7d845[_0xf6d3('0x2f')]));if(_0x1b2aea[_0xf6d3('0x2e')]['filter']){_0x4d1aec[_0xf6d3('0x37')]=_[_0xf6d3('0x39')](_0x4d1aec[_0xf6d3('0x37')],{'$or':_[_0xf6d3('0x2a')](_0x4d1aec[_0xf6d3('0x30')],function(_0xc32415){var _0x2fa051={};_0x2fa051[_0xc32415]={'$like':'%'+_0x1b2aea[_0xf6d3('0x2e')][_0xf6d3('0x38')]+'%'};return _0x2fa051;})});}_0x4d1aec=_['merge']({},_0x4d1aec,_0x1b2aea[_0xf6d3('0x45')]);return _0x5d48b4[_0xf6d3('0x58')](_0x4d1aec);}})[_0xf6d3('0x21')](function(_0x54db6c){if(_0x54db6c){_0x21cb69=_0x54db6c[_0xf6d3('0x44')];if(!_0x1b2aea[_0xf6d3('0x2e')][_0xf6d3('0x33')](_0xf6d3('0x34'))){_0x4d1aec['limit']=qs[_0xf6d3('0x1a')](_0x1b2aea[_0xf6d3('0x2e')][_0xf6d3('0x1a')]);_0x4d1aec[_0xf6d3('0x19')]=qs['offset'](_0x1b2aea[_0xf6d3('0x2e')][_0xf6d3('0x19')]);}return _0x5d48b4[_0xf6d3('0x58')](_0x4d1aec);}})['then'](function(_0x4fb950){if(_0x4fb950){return _0x4fb950?{'count':_0x21cb69,'rows':_0x4fb950}:null;}})[_0xf6d3('0x21')](respondWithResult(_0x585d0c,null))[_0xf6d3('0x41')](handleError(_0x585d0c,null));};exports[_0xf6d3('0x59')]=function(_0x556e6c,_0x2111c5,_0x42b427){if(_0x556e6c[_0xf6d3('0x4e')]['id']){delete _0x556e6c[_0xf6d3('0x4e')]['id'];}return db[_0xf6d3('0x3c')][_0xf6d3('0x46')]({'where':{'id':_0x556e6c[_0xf6d3('0x50')]['id']}})[_0xf6d3('0x21')](handleEntityNotFound(_0x2111c5,null))[_0xf6d3('0x21')](function(_0xa980fc){if(_0xa980fc){_0x556e6c['body'][_0xf6d3('0x5a')]=_0xa980fc['id'];return db[_0xf6d3('0x5b')][_0xf6d3('0x47')](_0x556e6c['body']);}})[_0xf6d3('0x21')](respondWithResult(_0x2111c5,null))[_0xf6d3('0x41')](handleError(_0x2111c5,null));};exports['getActions']=function(_0x3fdbc0,_0x5b4116,_0x46aac6){var _0x1030a7={};var _0x52a430={};var _0x439317;var _0x4ffd64;return db[_0xf6d3('0x3c')]['findOne']({'where':{'id':_0x3fdbc0[_0xf6d3('0x50')]['id']}})[_0xf6d3('0x21')](handleEntityNotFound(_0x5b4116,null))[_0xf6d3('0x21')](function(_0x5a1bbc){if(_0x5a1bbc){_0x439317=_0x5a1bbc;_0x52a430[_0xf6d3('0x2d')]=_['keys'](db[_0xf6d3('0x5b')][_0xf6d3('0x2b')]);_0x52a430[_0xf6d3('0x2e')]=_[_0xf6d3('0x43')](_0x3fdbc0['query']);_0x52a430['filters']=_[_0xf6d3('0x31')](_0x52a430[_0xf6d3('0x2d')],_0x52a430[_0xf6d3('0x2e')]);_0x1030a7[_0xf6d3('0x30')]=_[_0xf6d3('0x31')](_0x52a430['model'],qs[_0xf6d3('0x32')](_0x3fdbc0[_0xf6d3('0x2e')][_0xf6d3('0x32')]));_0x1030a7[_0xf6d3('0x30')]=_0x1030a7[_0xf6d3('0x30')][_0xf6d3('0x44')]?_0x1030a7[_0xf6d3('0x30')]:_0x52a430['model'];_0x1030a7[_0xf6d3('0x35')]=qs['sort'](_0x3fdbc0[_0xf6d3('0x2e')]['sort']);_0x1030a7[_0xf6d3('0x37')]=qs['filters'](_[_0xf6d3('0x57')](_0x3fdbc0[_0xf6d3('0x2e')],_0x52a430['filters']));if(_0x3fdbc0[_0xf6d3('0x2e')]['filter']){_0x1030a7[_0xf6d3('0x37')]=_[_0xf6d3('0x39')](_0x1030a7[_0xf6d3('0x37')],{'$or':_[_0xf6d3('0x2a')](_0x1030a7['attributes'],function(_0x54ff72){var _0x4e919f={};_0x4e919f[_0x54ff72]={'$like':'%'+_0x3fdbc0['query']['filter']+'%'};return _0x4e919f;})});}_0x1030a7=_['merge']({},_0x1030a7,_0x3fdbc0['options']);return _0x439317[_0xf6d3('0x5c')](_0x1030a7);}})[_0xf6d3('0x21')](function(_0x19125e){if(_0x19125e){_0x4ffd64=_0x19125e[_0xf6d3('0x44')];if(!_0x3fdbc0[_0xf6d3('0x2e')][_0xf6d3('0x33')](_0xf6d3('0x34'))){_0x1030a7[_0xf6d3('0x1a')]=qs[_0xf6d3('0x1a')](_0x3fdbc0[_0xf6d3('0x2e')][_0xf6d3('0x1a')]);_0x1030a7[_0xf6d3('0x19')]=qs[_0xf6d3('0x19')](_0x3fdbc0[_0xf6d3('0x2e')][_0xf6d3('0x19')]);}return _0x439317[_0xf6d3('0x5c')](_0x1030a7);}})[_0xf6d3('0x21')](function(_0x33b1b0){if(_0x33b1b0){return _0x33b1b0?{'count':_0x4ffd64,'rows':_0x33b1b0}:null;}})[_0xf6d3('0x21')](respondWithResult(_0x5b4116,null))[_0xf6d3('0x41')](handleError(_0x5b4116,null));}; \ No newline at end of file +var _0xd620=['merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','includeAll','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','addAllCondition','TriggerAllId','TriggerAnyId','Condition','findOne','getAllConditions','getAnyConditions','pick','length','addAction','TriggerId','getActions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','Triggers','UserProfileResource','destroy','error','stack','name','send','index','map','Trigger','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','filter'];(function(_0x51432c,_0x19aa29){var _0x52fa27=function(_0x501c7a){while(--_0x501c7a){_0x51432c['push'](_0x51432c['shift']());}};_0x52fa27(++_0x19aa29);}(_0xd620,0x135));var _0x0d62=function(_0x3d2fc3,_0x49d9cc){_0x3d2fc3=_0x3d2fc3-0x0;var _0x5885ce=_0xd620[_0x3d2fc3];return _0x5885ce;};'use strict';var emlformat=require(_0x0d62('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d62('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d62('0x2'));var moment=require(_0x0d62('0x3'));var BPromise=require(_0x0d62('0x4'));var Mustache=require(_0x0d62('0x5'));var util=require(_0x0d62('0x6'));var path=require('path');var sox=require(_0x0d62('0x7'));var csv=require(_0x0d62('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d62('0x9'));var _=require('lodash');var squel=require(_0x0d62('0xa'));var crypto=require('crypto');var jsforce=require(_0x0d62('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d62('0x8'));var querystring=require(_0x0d62('0xc'));var Papa=require('papaparse');var Redis=require(_0x0d62('0xd'));var authService=require(_0x0d62('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0d62('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0d62('0x10'));var utils=require(_0x0d62('0x11'));var config=require(_0x0d62('0x12'));var licenseUtil=require(_0x0d62('0x13'));var db=require(_0x0d62('0x14'))['db'];function respondWithStatusCode(_0x14393d,_0x262323){_0x262323=_0x262323||0xcc;return function(_0xa72272){if(_0xa72272){return _0x14393d['sendStatus'](_0x262323);}return _0x14393d['status'](_0x262323)[_0x0d62('0x15')]();};}function respondWithResult(_0x3b08fd,_0xd156ad){_0xd156ad=_0xd156ad||0xc8;return function(_0x4e495b){if(_0x4e495b){return _0x3b08fd[_0x0d62('0x16')](_0xd156ad)[_0x0d62('0x17')](_0x4e495b);}};}function respondWithFilteredResult(_0x5903a6,_0x266794){return function(_0x50e776){if(_0x50e776){var _0x335d75=typeof _0x266794[_0x0d62('0x18')]===_0x0d62('0x19')&&typeof _0x266794['limit']===_0x0d62('0x19');var _0x3e3c7e=_0x50e776[_0x0d62('0x1a')];var _0x4db055=_0x335d75?0x0:_0x266794[_0x0d62('0x18')];var _0x3ff63d=_0x335d75?_0x50e776['count']:_0x266794[_0x0d62('0x18')]+_0x266794['limit'];var _0x5a4d88;if(_0x3ff63d>=_0x3e3c7e){_0x3ff63d=_0x3e3c7e;_0x5a4d88=0xc8;}else{_0x5a4d88=0xce;}_0x5903a6[_0x0d62('0x16')](_0x5a4d88);return _0x5903a6[_0x0d62('0x1b')](_0x0d62('0x1c'),_0x4db055+'-'+_0x3ff63d+'/'+_0x3e3c7e)[_0x0d62('0x17')](_0x50e776);}return null;};}function patchUpdates(_0x42bd86){return function(_0x5f1e74){try{jsonpatch[_0x0d62('0x1d')](_0x5f1e74,_0x42bd86,!![]);}catch(_0x1baac6){return BPromise['reject'](_0x1baac6);}return _0x5f1e74[_0x0d62('0x1e')]();};}function saveUpdates(_0x30751a,_0x47bfcc){return function(_0x37462a){if(_0x37462a){return _0x37462a[_0x0d62('0x1f')](_0x30751a)['then'](function(_0x37d3d5){return _0x37d3d5;});}return null;};}function removeEntity(_0x3c99f4,_0x4c0a30){return function(_0xf216c2){if(_0xf216c2){return _0xf216c2['destroy']()[_0x0d62('0x20')](function(){var _0x5e4cc8=_0xf216c2['get']({'plain':!![]});var _0x3257e2=_0x0d62('0x21');return db[_0x0d62('0x22')][_0x0d62('0x23')]({'where':{'type':_0x3257e2,'resourceId':_0x5e4cc8['id']}})[_0x0d62('0x20')](function(){return _0xf216c2;});})[_0x0d62('0x20')](function(){_0x3c99f4['status'](0xcc)[_0x0d62('0x15')]();});}};}function handleEntityNotFound(_0x3f75e5,_0x4fb8d7){return function(_0x36fcf1){if(!_0x36fcf1){_0x3f75e5['sendStatus'](0x194);}return _0x36fcf1;};}function handleError(_0x2cac7c,_0x1908d6){_0x1908d6=_0x1908d6||0x1f4;return function(_0x5d5680){logger[_0x0d62('0x24')](_0x5d5680[_0x0d62('0x25')]);if(_0x5d5680['name']){delete _0x5d5680[_0x0d62('0x26')];}_0x2cac7c[_0x0d62('0x16')](_0x1908d6)[_0x0d62('0x27')](_0x5d5680);};}exports[_0x0d62('0x28')]=function(_0x4516b9,_0x5c9e97){var _0x17b063={},_0x42bee5={},_0x331002={'count':0x0,'rows':[]};var _0x2c3dea=_[_0x0d62('0x29')](db[_0x0d62('0x2a')]['rawAttributes'],function(_0xa32d5c){return{'name':_0xa32d5c[_0x0d62('0x2b')],'type':_0xa32d5c[_0x0d62('0x2c')][_0x0d62('0x2d')]};});_0x42bee5[_0x0d62('0x2e')]=_['map'](_0x2c3dea,'name');_0x42bee5[_0x0d62('0x2f')]=_[_0x0d62('0x30')](_0x4516b9[_0x0d62('0x2f')]);_0x42bee5[_0x0d62('0x31')]=_['intersection'](_0x42bee5[_0x0d62('0x2e')],_0x42bee5['query']);_0x17b063[_0x0d62('0x32')]=_[_0x0d62('0x33')](_0x42bee5['model'],qs['fields'](_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x34')]));_0x17b063['attributes']=_0x17b063[_0x0d62('0x32')]['length']?_0x17b063[_0x0d62('0x32')]:_0x42bee5[_0x0d62('0x2e')];if(!_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x35')]('nolimit')){_0x17b063[_0x0d62('0x36')]=qs[_0x0d62('0x36')](_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x36')]);_0x17b063['offset']=qs['offset'](_0x4516b9['query']['offset']);}_0x17b063[_0x0d62('0x37')]=qs['sort'](_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x38')]);_0x17b063[_0x0d62('0x39')]=qs[_0x0d62('0x31')](_['pick'](_0x4516b9[_0x0d62('0x2f')],_0x42bee5['filters']),_0x2c3dea);if(_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x3a')]){_0x17b063[_0x0d62('0x39')]=_[_0x0d62('0x3b')](_0x17b063['where'],{'$or':_['map'](_0x2c3dea,function(_0x37a4c1){if(_0x37a4c1[_0x0d62('0x2c')]!==_0x0d62('0x3c')){var _0x563b4f={};_0x563b4f[_0x37a4c1[_0x0d62('0x26')]]={'$like':'%'+_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x3a')]+'%'};return _0x563b4f;}})});}_0x17b063=_[_0x0d62('0x3b')]({},_0x17b063,_0x4516b9[_0x0d62('0x3d')]);var _0x9d3bd={'where':_0x17b063[_0x0d62('0x39')]};return db[_0x0d62('0x2a')][_0x0d62('0x1a')](_0x9d3bd)['then'](function(_0x34e75f){_0x331002[_0x0d62('0x1a')]=_0x34e75f;if(_0x4516b9['query']['includeAll']){_0x17b063[_0x0d62('0x3e')]=[{'all':!![]}];}return db[_0x0d62('0x2a')][_0x0d62('0x3f')](_0x17b063);})['then'](function(_0x1131c8){_0x331002[_0x0d62('0x40')]=_0x1131c8;return _0x331002;})[_0x0d62('0x20')](respondWithFilteredResult(_0x5c9e97,_0x17b063))[_0x0d62('0x41')](handleError(_0x5c9e97,null));};exports['show']=function(_0x8d3f7,_0x3c4192){var _0xe32583={'raw':![],'where':{'id':_0x8d3f7[_0x0d62('0x42')]['id']}},_0x55b7d2={};_0x55b7d2[_0x0d62('0x2e')]=_['keys'](db[_0x0d62('0x2a')][_0x0d62('0x43')]);_0x55b7d2[_0x0d62('0x2f')]=_['keys'](_0x8d3f7['query']);_0x55b7d2[_0x0d62('0x31')]=_[_0x0d62('0x33')](_0x55b7d2['model'],_0x55b7d2[_0x0d62('0x2f')]);_0xe32583['attributes']=_[_0x0d62('0x33')](_0x55b7d2[_0x0d62('0x2e')],qs['fields'](_0x8d3f7[_0x0d62('0x2f')][_0x0d62('0x34')]));_0xe32583['attributes']=_0xe32583[_0x0d62('0x32')]['length']?_0xe32583[_0x0d62('0x32')]:_0x55b7d2[_0x0d62('0x2e')];if(_0x8d3f7[_0x0d62('0x2f')][_0x0d62('0x44')]){_0xe32583[_0x0d62('0x3e')]=[{'all':!![]}];}_0xe32583=_[_0x0d62('0x3b')]({},_0xe32583,_0x8d3f7['options']);return db[_0x0d62('0x2a')][_0x0d62('0x45')](_0xe32583)[_0x0d62('0x20')](handleEntityNotFound(_0x3c4192,null))[_0x0d62('0x20')](respondWithResult(_0x3c4192,null))['catch'](handleError(_0x3c4192,null));};exports[_0x0d62('0x46')]=function(_0x7ca4ca,_0x210808){return db[_0x0d62('0x2a')][_0x0d62('0x46')](_0x7ca4ca[_0x0d62('0x47')],{})[_0x0d62('0x20')](function(_0x463ddb){var _0x1344b5=_0x7ca4ca[_0x0d62('0x48')][_0x0d62('0x49')]({'plain':!![]});if(!_0x1344b5)throw new Error(_0x0d62('0x4a'));if(_0x1344b5[_0x0d62('0x4b')]==='user'){var _0x4b770e=_0x463ddb['get']({'plain':!![]});var _0x2c9ae0=_0x0d62('0x21');return db[_0x0d62('0x4c')][_0x0d62('0x45')]({'where':{'name':_0x2c9ae0,'userProfileId':_0x1344b5[_0x0d62('0x4d')]},'raw':!![]})['then'](function(_0x50e6c1){if(_0x50e6c1&&_0x50e6c1[_0x0d62('0x4e')]===0x0){return db[_0x0d62('0x22')][_0x0d62('0x46')]({'name':_0x4b770e['name'],'resourceId':_0x4b770e['id'],'type':_0x50e6c1[_0x0d62('0x26')],'sectionId':_0x50e6c1['id']},{})[_0x0d62('0x20')](function(){return _0x463ddb;});}else{return _0x463ddb;}})[_0x0d62('0x41')](function(_0x5ef5ae){logger[_0x0d62('0x24')](_0x0d62('0x4f'),_0x5ef5ae);throw _0x5ef5ae;});}return _0x463ddb;})[_0x0d62('0x20')](respondWithResult(_0x210808,0xc9))[_0x0d62('0x41')](handleError(_0x210808,null));};exports['update']=function(_0x8796ad,_0x10f84c){if(_0x8796ad[_0x0d62('0x47')]['id']){delete _0x8796ad[_0x0d62('0x47')]['id'];}return db[_0x0d62('0x2a')][_0x0d62('0x45')]({'where':{'id':_0x8796ad[_0x0d62('0x42')]['id']}})['then'](handleEntityNotFound(_0x10f84c,null))[_0x0d62('0x20')](saveUpdates(_0x8796ad['body'],null))[_0x0d62('0x20')](respondWithResult(_0x10f84c,null))['catch'](handleError(_0x10f84c,null));};exports[_0x0d62('0x23')]=function(_0x489067,_0x5da671){return db['Trigger'][_0x0d62('0x45')]({'where':{'id':_0x489067[_0x0d62('0x42')]['id']}})[_0x0d62('0x20')](handleEntityNotFound(_0x5da671,null))[_0x0d62('0x20')](removeEntity(_0x5da671,null))['catch'](handleError(_0x5da671,null));};exports[_0x0d62('0x50')]=function(_0x2bc102,_0x2523df,_0x2fef65){if(_0x2bc102['body']['id']){delete _0x2bc102['body']['id'];}return db[_0x0d62('0x2a')][_0x0d62('0x45')]({'where':{'id':_0x2bc102[_0x0d62('0x42')]['id']}})[_0x0d62('0x20')](handleEntityNotFound(_0x2523df,null))[_0x0d62('0x20')](function(_0x3ba28f){if(_0x3ba28f){_0x2bc102[_0x0d62('0x47')][_0x0d62('0x51')]=_0x3ba28f['id'];return db['Condition']['create'](_0x2bc102[_0x0d62('0x47')]);}})[_0x0d62('0x20')](respondWithResult(_0x2523df,null))[_0x0d62('0x41')](handleError(_0x2523df,null));};exports['addAnyCondition']=function(_0x8e4dba,_0x490f28,_0x4372b1){if(_0x8e4dba[_0x0d62('0x47')]['id']){delete _0x8e4dba['body']['id'];}return db['Trigger'][_0x0d62('0x45')]({'where':{'id':_0x8e4dba[_0x0d62('0x42')]['id']}})[_0x0d62('0x20')](handleEntityNotFound(_0x490f28,null))[_0x0d62('0x20')](function(_0x3fc810){if(_0x3fc810){_0x8e4dba['body'][_0x0d62('0x52')]=_0x3fc810['id'];return db[_0x0d62('0x53')]['create'](_0x8e4dba[_0x0d62('0x47')]);}})[_0x0d62('0x20')](respondWithResult(_0x490f28,null))[_0x0d62('0x41')](handleError(_0x490f28,null));};exports['getAllConditions']=function(_0x44aa13,_0x9e0503,_0x4aff98){var _0x42e3cf={};var _0x13bcd8={};var _0x3f0256;var _0xf493dd;return db['Trigger'][_0x0d62('0x54')]({'where':{'id':_0x44aa13[_0x0d62('0x42')]['id']}})['then'](handleEntityNotFound(_0x9e0503,null))[_0x0d62('0x20')](function(_0x580ce0){if(_0x580ce0){_0x3f0256=_0x580ce0;_0x13bcd8[_0x0d62('0x2e')]=_[_0x0d62('0x30')](db[_0x0d62('0x53')][_0x0d62('0x43')]);_0x13bcd8[_0x0d62('0x2f')]=_[_0x0d62('0x30')](_0x44aa13[_0x0d62('0x2f')]);_0x13bcd8[_0x0d62('0x31')]=_[_0x0d62('0x33')](_0x13bcd8[_0x0d62('0x2e')],_0x13bcd8[_0x0d62('0x2f')]);_0x42e3cf[_0x0d62('0x32')]=_[_0x0d62('0x33')](_0x13bcd8[_0x0d62('0x2e')],qs[_0x0d62('0x34')](_0x44aa13[_0x0d62('0x2f')]['fields']));_0x42e3cf[_0x0d62('0x32')]=_0x42e3cf['attributes']['length']?_0x42e3cf['attributes']:_0x13bcd8[_0x0d62('0x2e')];_0x42e3cf[_0x0d62('0x37')]=qs['sort'](_0x44aa13['query'][_0x0d62('0x38')]);_0x42e3cf[_0x0d62('0x39')]=qs[_0x0d62('0x31')](_['pick'](_0x44aa13[_0x0d62('0x2f')],_0x13bcd8['filters']));if(_0x44aa13[_0x0d62('0x2f')][_0x0d62('0x3a')]){_0x42e3cf[_0x0d62('0x39')]=_[_0x0d62('0x3b')](_0x42e3cf[_0x0d62('0x39')],{'$or':_[_0x0d62('0x29')](_0x42e3cf['attributes'],function(_0x580036){var _0x3e3963={};_0x3e3963[_0x580036]={'$like':'%'+_0x44aa13[_0x0d62('0x2f')][_0x0d62('0x3a')]+'%'};return _0x3e3963;})});}_0x42e3cf=_[_0x0d62('0x3b')]({},_0x42e3cf,_0x44aa13[_0x0d62('0x3d')]);return _0x3f0256[_0x0d62('0x55')](_0x42e3cf);}})[_0x0d62('0x20')](function(_0x15d059){if(_0x15d059){_0xf493dd=_0x15d059['length'];if(!_0x44aa13[_0x0d62('0x2f')][_0x0d62('0x35')]('nolimit')){_0x42e3cf[_0x0d62('0x36')]=qs[_0x0d62('0x36')](_0x44aa13['query'][_0x0d62('0x36')]);_0x42e3cf['offset']=qs[_0x0d62('0x18')](_0x44aa13[_0x0d62('0x2f')]['offset']);}return _0x3f0256[_0x0d62('0x55')](_0x42e3cf);}})[_0x0d62('0x20')](function(_0x2a8389){if(_0x2a8389){return _0x2a8389?{'count':_0xf493dd,'rows':_0x2a8389}:null;}})[_0x0d62('0x20')](respondWithResult(_0x9e0503,null))[_0x0d62('0x41')](handleError(_0x9e0503,null));};exports[_0x0d62('0x56')]=function(_0x40c022,_0x504477,_0x145bdc){var _0x17770d={};var _0x348d89={};var _0x67e396;var _0x112fb6;return db[_0x0d62('0x2a')][_0x0d62('0x54')]({'where':{'id':_0x40c022[_0x0d62('0x42')]['id']}})[_0x0d62('0x20')](handleEntityNotFound(_0x504477,null))[_0x0d62('0x20')](function(_0x14d1a6){if(_0x14d1a6){_0x67e396=_0x14d1a6;_0x348d89['model']=_[_0x0d62('0x30')](db[_0x0d62('0x53')]['rawAttributes']);_0x348d89[_0x0d62('0x2f')]=_[_0x0d62('0x30')](_0x40c022[_0x0d62('0x2f')]);_0x348d89[_0x0d62('0x31')]=_['intersection'](_0x348d89[_0x0d62('0x2e')],_0x348d89[_0x0d62('0x2f')]);_0x17770d['attributes']=_[_0x0d62('0x33')](_0x348d89['model'],qs['fields'](_0x40c022[_0x0d62('0x2f')][_0x0d62('0x34')]));_0x17770d['attributes']=_0x17770d[_0x0d62('0x32')]['length']?_0x17770d[_0x0d62('0x32')]:_0x348d89[_0x0d62('0x2e')];_0x17770d[_0x0d62('0x37')]=qs[_0x0d62('0x38')](_0x40c022[_0x0d62('0x2f')]['sort']);_0x17770d[_0x0d62('0x39')]=qs[_0x0d62('0x31')](_[_0x0d62('0x57')](_0x40c022[_0x0d62('0x2f')],_0x348d89[_0x0d62('0x31')]));if(_0x40c022[_0x0d62('0x2f')]['filter']){_0x17770d[_0x0d62('0x39')]=_[_0x0d62('0x3b')](_0x17770d[_0x0d62('0x39')],{'$or':_[_0x0d62('0x29')](_0x17770d[_0x0d62('0x32')],function(_0x24c1fa){var _0x11b66a={};_0x11b66a[_0x24c1fa]={'$like':'%'+_0x40c022['query']['filter']+'%'};return _0x11b66a;})});}_0x17770d=_[_0x0d62('0x3b')]({},_0x17770d,_0x40c022['options']);return _0x67e396['getAnyConditions'](_0x17770d);}})[_0x0d62('0x20')](function(_0x2ae973){if(_0x2ae973){_0x112fb6=_0x2ae973[_0x0d62('0x58')];if(!_0x40c022['query'][_0x0d62('0x35')]('nolimit')){_0x17770d[_0x0d62('0x36')]=qs['limit'](_0x40c022[_0x0d62('0x2f')][_0x0d62('0x36')]);_0x17770d['offset']=qs['offset'](_0x40c022[_0x0d62('0x2f')][_0x0d62('0x18')]);}return _0x67e396[_0x0d62('0x56')](_0x17770d);}})[_0x0d62('0x20')](function(_0x4178d8){if(_0x4178d8){return _0x4178d8?{'count':_0x112fb6,'rows':_0x4178d8}:null;}})['then'](respondWithResult(_0x504477,null))['catch'](handleError(_0x504477,null));};exports[_0x0d62('0x59')]=function(_0x2ea59f,_0x265478,_0x4e3ef5){if(_0x2ea59f['body']['id']){delete _0x2ea59f[_0x0d62('0x47')]['id'];}return db['Trigger']['find']({'where':{'id':_0x2ea59f[_0x0d62('0x42')]['id']}})['then'](handleEntityNotFound(_0x265478,null))['then'](function(_0x2eea28){if(_0x2eea28){_0x2ea59f[_0x0d62('0x47')][_0x0d62('0x5a')]=_0x2eea28['id'];return db['Action'][_0x0d62('0x46')](_0x2ea59f[_0x0d62('0x47')]);}})[_0x0d62('0x20')](respondWithResult(_0x265478,null))[_0x0d62('0x41')](handleError(_0x265478,null));};exports['getActions']=function(_0x7c0462,_0x5455ef,_0x2f4804){var _0x2b45c3={};var _0x2bfa96={};var _0x149630;var _0x144677;return db[_0x0d62('0x2a')][_0x0d62('0x54')]({'where':{'id':_0x7c0462[_0x0d62('0x42')]['id']}})[_0x0d62('0x20')](handleEntityNotFound(_0x5455ef,null))[_0x0d62('0x20')](function(_0x30c6f6){if(_0x30c6f6){_0x149630=_0x30c6f6;_0x2bfa96['model']=_['keys'](db['Action'][_0x0d62('0x43')]);_0x2bfa96[_0x0d62('0x2f')]=_[_0x0d62('0x30')](_0x7c0462[_0x0d62('0x2f')]);_0x2bfa96[_0x0d62('0x31')]=_[_0x0d62('0x33')](_0x2bfa96[_0x0d62('0x2e')],_0x2bfa96['query']);_0x2b45c3['attributes']=_[_0x0d62('0x33')](_0x2bfa96['model'],qs[_0x0d62('0x34')](_0x7c0462[_0x0d62('0x2f')][_0x0d62('0x34')]));_0x2b45c3['attributes']=_0x2b45c3['attributes'][_0x0d62('0x58')]?_0x2b45c3[_0x0d62('0x32')]:_0x2bfa96[_0x0d62('0x2e')];_0x2b45c3[_0x0d62('0x37')]=qs['sort'](_0x7c0462['query'][_0x0d62('0x38')]);_0x2b45c3['where']=qs[_0x0d62('0x31')](_['pick'](_0x7c0462[_0x0d62('0x2f')],_0x2bfa96[_0x0d62('0x31')]));if(_0x7c0462[_0x0d62('0x2f')][_0x0d62('0x3a')]){_0x2b45c3[_0x0d62('0x39')]=_[_0x0d62('0x3b')](_0x2b45c3[_0x0d62('0x39')],{'$or':_[_0x0d62('0x29')](_0x2b45c3[_0x0d62('0x32')],function(_0x4b3979){var _0x4dabfe={};_0x4dabfe[_0x4b3979]={'$like':'%'+_0x7c0462['query'][_0x0d62('0x3a')]+'%'};return _0x4dabfe;})});}_0x2b45c3=_[_0x0d62('0x3b')]({},_0x2b45c3,_0x7c0462['options']);return _0x149630[_0x0d62('0x5b')](_0x2b45c3);}})['then'](function(_0x4a08e2){if(_0x4a08e2){_0x144677=_0x4a08e2[_0x0d62('0x58')];if(!_0x7c0462[_0x0d62('0x2f')][_0x0d62('0x35')]('nolimit')){_0x2b45c3[_0x0d62('0x36')]=qs[_0x0d62('0x36')](_0x7c0462[_0x0d62('0x2f')]['limit']);_0x2b45c3['offset']=qs[_0x0d62('0x18')](_0x7c0462['query'][_0x0d62('0x18')]);}return _0x149630[_0x0d62('0x5b')](_0x2b45c3);}})[_0x0d62('0x20')](function(_0x4a6794){if(_0x4a6794){return _0x4a6794?{'count':_0x144677,'rows':_0x4a6794}:null;}})['then'](respondWithResult(_0x5455ef,null))['catch'](handleError(_0x5455ef,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 976213a..fc38148 100644 --- a/server/api/trigger/trigger.model.js +++ b/server/api/trigger/trigger.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5044=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','util','api','moment','bluebird'];(function(_0x28f0b2,_0x58eaa8){var _0x5c0dbf=function(_0x10c501){while(--_0x10c501){_0x28f0b2['push'](_0x28f0b2['shift']());}};_0x5c0dbf(++_0x58eaa8);}(_0x5044,0xc8));var _0x4504=function(_0x3f1ae8,_0x1b29ea){_0x3f1ae8=_0x3f1ae8-0x0;var _0x2bec06=_0x5044[_0x3f1ae8];return _0x2bec06;};'use strict';var _=require('lodash');var util=require(_0x4504('0x0'));var logger=require('../../config/logger')(_0x4504('0x1'));var moment=require(_0x4504('0x2'));var BPromise=require(_0x4504('0x3'));var rp=require(_0x4504('0x4'));var fs=require('fs');var path=require(_0x4504('0x5'));var rimraf=require(_0x4504('0x6'));var config=require(_0x4504('0x7'));var attributes=require(_0x4504('0x8'));module['exports']=function(_0x10b50f,_0x40195b){return _0x10b50f[_0x4504('0x9')](_0x4504('0xa'),attributes,{'tableName':_0x4504('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7579=['define','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x5e7c7e,_0x41fbb1){var _0x4e85de=function(_0xac92bc){while(--_0xac92bc){_0x5e7c7e['push'](_0x5e7c7e['shift']());}};_0x4e85de(++_0x41fbb1);}(_0x7579,0x1e2));var _0x9757=function(_0x1cf913,_0x1f32c3){_0x1cf913=_0x1cf913-0x0;var _0x45f562=_0x7579[_0x1cf913];return _0x45f562;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var logger=require(_0x9757('0x2'))(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var BPromise=require(_0x9757('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9757('0x6'));var rimraf=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var attributes=require(_0x9757('0x9'));module['exports']=function(_0x2aede4,_0x80e411){return _0x2aede4[_0x9757('0xa')]('Trigger',attributes,{'tableName':_0x9757('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index bfda770..fef8983 100644 --- a/server/api/trigger/trigger.rpc.js +++ b/server/api/trigger/trigger.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e10=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetTrigger','Trigger','findAll','options','raw','limit','include','map','model','attributes','ShowTrigger','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0e10,0x7c));var _0x00e1=function(_0x498ece,_0x30bc47){_0x498ece=_0x498ece-0x0;var _0x4b9ce7=_0x0e10[_0x498ece];return _0x4b9ce7;};'use strict';var _=require(_0x00e1('0x0'));var util=require(_0x00e1('0x1'));var moment=require('moment');var BPromise=require(_0x00e1('0x2'));var rs=require(_0x00e1('0x3'));var fs=require('fs');var Redis=require(_0x00e1('0x4'));var db=require(_0x00e1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x00e1('0x6'))('rpc');var config=require(_0x00e1('0x7'));var jayson=require(_0x00e1('0x8'));var client=jayson[_0x00e1('0x9')][_0x00e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b4569,_0x2ca91d,_0x3e3bc0){return new BPromise(function(_0x3719ef,_0x42ce93){return client[_0x00e1('0xb')](_0x1b4569,_0x3e3bc0)[_0x00e1('0xc')](function(_0x38979e){logger['info'](_0x00e1('0xd'),_0x2ca91d,_0x00e1('0xe'));logger[_0x00e1('0xf')](_0x00e1('0x10'),_0x2ca91d,_0x00e1('0xe'),JSON[_0x00e1('0x11')](_0x38979e));if(_0x38979e[_0x00e1('0x12')]){if(_0x38979e['error']['code']===0x1f4){logger[_0x00e1('0x12')](_0x00e1('0xd'),_0x2ca91d,_0x38979e['error'][_0x00e1('0x13')]);return _0x42ce93(_0x38979e['error']['message']);}logger[_0x00e1('0x12')]('Trigger,\x20%s,\x20%s',_0x2ca91d,_0x38979e[_0x00e1('0x12')]['message']);return _0x3719ef(_0x38979e[_0x00e1('0x12')][_0x00e1('0x13')]);}else{logger[_0x00e1('0x14')](_0x00e1('0xd'),_0x2ca91d,_0x00e1('0xe'));_0x3719ef(_0x38979e['result'][_0x00e1('0x13')]);}})[_0x00e1('0x15')](function(_0x5e2724){logger[_0x00e1('0x12')](_0x00e1('0xd'),_0x2ca91d,_0x5e2724);_0x42ce93(_0x5e2724);});});}exports[_0x00e1('0x16')]=function(_0x1f7d0c){var _0x2a1165=this;return new Promise(function(_0x3c9fcc,_0x3f1a5e){return db[_0x00e1('0x17')][_0x00e1('0x18')]({'raw':_0x1f7d0c['options']?_0x1f7d0c[_0x00e1('0x19')][_0x00e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f7d0c[_0x00e1('0x19')]?_0x1f7d0c[_0x00e1('0x19')]['where']||null:null,'attributes':_0x1f7d0c['options']?_0x1f7d0c[_0x00e1('0x19')]['attributes']||null:null,'limit':_0x1f7d0c['options']?_0x1f7d0c['options'][_0x00e1('0x1b')]||null:null,'include':_0x1f7d0c[_0x00e1('0x19')]?_0x1f7d0c[_0x00e1('0x19')][_0x00e1('0x1c')]?_[_0x00e1('0x1d')](_0x1f7d0c['options']['include'],function(_0x113b38){return{'model':db[_0x113b38[_0x00e1('0x1e')]],'as':_0x113b38['as'],'attributes':_0x113b38[_0x00e1('0x1f')],'include':_0x113b38[_0x00e1('0x1c')]?_[_0x00e1('0x1d')](_0x113b38[_0x00e1('0x1c')],function(_0x41cb73){return{'model':db[_0x41cb73['model']],'as':_0x41cb73['as'],'attributes':_0x41cb73[_0x00e1('0x1f')],'include':_0x41cb73['include']?_[_0x00e1('0x1d')](_0x41cb73[_0x00e1('0x1c')],function(_0x4be41c){return{'model':db[_0x4be41c['model']],'as':_0x4be41c['as'],'attributes':_0x4be41c[_0x00e1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x00e1('0xc')](function(_0xbb8561){logger['info'](_0x00e1('0x16'),_0x1f7d0c);logger['debug'](_0x00e1('0x16'),_0x1f7d0c,JSON[_0x00e1('0x11')](_0xbb8561));_0x3c9fcc(_0xbb8561);})['catch'](function(_0x358c96){logger[_0x00e1('0x12')]('GetTrigger',_0x358c96[_0x00e1('0x13')],_0x1f7d0c);_0x3f1a5e(_0x2a1165[_0x00e1('0x12')](0x1f4,_0x358c96[_0x00e1('0x13')]));});});};exports[_0x00e1('0x20')]=function(_0x6783bf){var _0x4ea0eb=this;return new Promise(function(_0x55b52a,_0x264775){return db[_0x00e1('0x17')][_0x00e1('0x21')]({'raw':_0x6783bf[_0x00e1('0x19')]?_0x6783bf[_0x00e1('0x19')][_0x00e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x6783bf[_0x00e1('0x19')]?_0x6783bf['options'][_0x00e1('0x22')]||null:null,'attributes':_0x6783bf[_0x00e1('0x19')]?_0x6783bf['options'][_0x00e1('0x1f')]||null:null,'include':_0x6783bf[_0x00e1('0x19')]?_0x6783bf['options'][_0x00e1('0x1c')]?_[_0x00e1('0x1d')](_0x6783bf['options'][_0x00e1('0x1c')],function(_0x3dcef1){return{'model':db[_0x3dcef1['model']],'as':_0x3dcef1['as'],'attributes':_0x3dcef1[_0x00e1('0x1f')],'include':_0x3dcef1[_0x00e1('0x1c')]?_[_0x00e1('0x1d')](_0x3dcef1[_0x00e1('0x1c')],function(_0x388bdb){return{'model':db[_0x388bdb[_0x00e1('0x1e')]],'as':_0x388bdb['as'],'attributes':_0x388bdb[_0x00e1('0x1f')],'include':_0x388bdb[_0x00e1('0x1c')]?_[_0x00e1('0x1d')](_0x388bdb[_0x00e1('0x1c')],function(_0x28f067){return{'model':db[_0x28f067['model']],'as':_0x28f067['as'],'attributes':_0x28f067['attributes']};}):[]};}):[]};}):[]:[]})[_0x00e1('0xc')](function(_0x15047f){logger['info'](_0x00e1('0x20'),_0x6783bf);logger[_0x00e1('0xf')](_0x00e1('0x20'),_0x6783bf,JSON['stringify'](_0x15047f));_0x55b52a(_0x15047f);})['catch'](function(_0xba5a35){logger[_0x00e1('0x12')](_0x00e1('0x20'),_0xba5a35['message'],_0x6783bf);_0x264775(_0x4ea0eb[_0x00e1('0x12')](0x1f4,_0xba5a35[_0x00e1('0x13')]));});});}; \ No newline at end of file +var _0x85c9=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','options','where','attributes','limit','map','include','model','debug','Trigger','find','raw','ShowTrigger','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x246233,_0x322137){var _0x48f431=function(_0x2f41e4){while(--_0x2f41e4){_0x246233['push'](_0x246233['shift']());}};_0x48f431(++_0x322137);}(_0x85c9,0x167));var _0x985c=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x85c9[_0x2d364e];return _0x1b9312;};'use strict';var _=require('lodash');var util=require(_0x985c('0x0'));var moment=require('moment');var BPromise=require(_0x985c('0x1'));var rs=require(_0x985c('0x2'));var fs=require('fs');var Redis=require(_0x985c('0x3'));var db=require(_0x985c('0x4'))['db'];var utils=require(_0x985c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x985c('0x6'));var jayson=require(_0x985c('0x7'));var client=jayson[_0x985c('0x8')][_0x985c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32ab7b,_0x372404,_0x4d16b1){return new BPromise(function(_0x119c1a,_0xe9956d){return client[_0x985c('0xa')](_0x32ab7b,_0x4d16b1)[_0x985c('0xb')](function(_0x27c58c){logger[_0x985c('0xc')](_0x985c('0xd'),_0x372404,_0x985c('0xe'));logger['debug'](_0x985c('0xf'),_0x372404,_0x985c('0xe'),JSON[_0x985c('0x10')](_0x27c58c));if(_0x27c58c[_0x985c('0x11')]){if(_0x27c58c[_0x985c('0x11')][_0x985c('0x12')]===0x1f4){logger[_0x985c('0x11')](_0x985c('0xd'),_0x372404,_0x27c58c[_0x985c('0x11')][_0x985c('0x13')]);return _0xe9956d(_0x27c58c[_0x985c('0x11')]['message']);}logger[_0x985c('0x11')](_0x985c('0xd'),_0x372404,_0x27c58c[_0x985c('0x11')][_0x985c('0x13')]);return _0x119c1a(_0x27c58c[_0x985c('0x11')][_0x985c('0x13')]);}else{logger[_0x985c('0xc')](_0x985c('0xd'),_0x372404,_0x985c('0xe'));_0x119c1a(_0x27c58c['result'][_0x985c('0x13')]);}})[_0x985c('0x14')](function(_0x34ad16){logger[_0x985c('0x11')](_0x985c('0xd'),_0x372404,_0x34ad16);_0xe9956d(_0x34ad16);});});}exports[_0x985c('0x15')]=function(_0x2e700d){var _0x1981de=this;return new Promise(function(_0x1e0c57,_0x169bf4){return db['Trigger']['findAll']({'raw':_0x2e700d[_0x985c('0x16')]?_0x2e700d[_0x985c('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2e700d[_0x985c('0x16')]?_0x2e700d['options'][_0x985c('0x17')]||null:null,'attributes':_0x2e700d[_0x985c('0x16')]?_0x2e700d[_0x985c('0x16')][_0x985c('0x18')]||null:null,'limit':_0x2e700d['options']?_0x2e700d[_0x985c('0x16')][_0x985c('0x19')]||null:null,'include':_0x2e700d[_0x985c('0x16')]?_0x2e700d['options']['include']?_[_0x985c('0x1a')](_0x2e700d[_0x985c('0x16')][_0x985c('0x1b')],function(_0x33c3eb){return{'model':db[_0x33c3eb[_0x985c('0x1c')]],'as':_0x33c3eb['as'],'attributes':_0x33c3eb[_0x985c('0x18')],'include':_0x33c3eb[_0x985c('0x1b')]?_[_0x985c('0x1a')](_0x33c3eb['include'],function(_0x15507f){return{'model':db[_0x15507f[_0x985c('0x1c')]],'as':_0x15507f['as'],'attributes':_0x15507f[_0x985c('0x18')],'include':_0x15507f['include']?_[_0x985c('0x1a')](_0x15507f[_0x985c('0x1b')],function(_0xe0b91c){return{'model':db[_0xe0b91c['model']],'as':_0xe0b91c['as'],'attributes':_0xe0b91c[_0x985c('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x295753){logger[_0x985c('0xc')]('GetTrigger',_0x2e700d);logger[_0x985c('0x1d')](_0x985c('0x15'),_0x2e700d,JSON[_0x985c('0x10')](_0x295753));_0x1e0c57(_0x295753);})[_0x985c('0x14')](function(_0x169e84){logger[_0x985c('0x11')](_0x985c('0x15'),_0x169e84['message'],_0x2e700d);_0x169bf4(_0x1981de['error'](0x1f4,_0x169e84[_0x985c('0x13')]));});});};exports['ShowTrigger']=function(_0x539cec){var _0x2945e6=this;return new Promise(function(_0x21f60e,_0xdeaaaa){return db[_0x985c('0x1e')][_0x985c('0x1f')]({'raw':_0x539cec['options']?_0x539cec[_0x985c('0x16')][_0x985c('0x20')]===undefined?!![]:![]:!![],'where':_0x539cec[_0x985c('0x16')]?_0x539cec['options'][_0x985c('0x17')]||null:null,'attributes':_0x539cec[_0x985c('0x16')]?_0x539cec[_0x985c('0x16')]['attributes']||null:null,'include':_0x539cec['options']?_0x539cec[_0x985c('0x16')][_0x985c('0x1b')]?_[_0x985c('0x1a')](_0x539cec['options'][_0x985c('0x1b')],function(_0x378efb){return{'model':db[_0x378efb[_0x985c('0x1c')]],'as':_0x378efb['as'],'attributes':_0x378efb[_0x985c('0x18')],'include':_0x378efb[_0x985c('0x1b')]?_[_0x985c('0x1a')](_0x378efb['include'],function(_0xd19ebd){return{'model':db[_0xd19ebd[_0x985c('0x1c')]],'as':_0xd19ebd['as'],'attributes':_0xd19ebd[_0x985c('0x18')],'include':_0xd19ebd[_0x985c('0x1b')]?_[_0x985c('0x1a')](_0xd19ebd[_0x985c('0x1b')],function(_0x40a370){return{'model':db[_0x40a370[_0x985c('0x1c')]],'as':_0x40a370['as'],'attributes':_0x40a370[_0x985c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x985c('0xb')](function(_0x3dd9ce){logger['info'](_0x985c('0x21'),_0x539cec);logger[_0x985c('0x1d')]('ShowTrigger',_0x539cec,JSON[_0x985c('0x10')](_0x3dd9ce));_0x21f60e(_0x3dd9ce);})[_0x985c('0x14')](function(_0x21e3a2){logger[_0x985c('0x11')]('ShowTrigger',_0x21e3a2[_0x985c('0x13')],_0x539cec);_0xdeaaaa(_0x2945e6['error'](0x1f4,_0x21e3a2[_0x985c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d15f106..efc0712 100644 --- a/server/api/trunk/index.js +++ b/server/api/trunk/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ac3=['get','/:id','post','/:id/clone','clone','create','update','delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7ac3,0x114));var _0x37ac=function(_0x538e54,_0x4dd5fc){_0x538e54=_0x538e54-0x0;var _0x165e76=_0x7ac3[_0x538e54];return _0x165e76;};'use strict';var multer=require(_0x37ac('0x0'));var util=require('util');var path=require(_0x37ac('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x37ac('0x2'));var auth=require(_0x37ac('0x3'));var interaction=require(_0x37ac('0x4'));var config=require(_0x37ac('0x5'));var controller=require(_0x37ac('0x6'));router['get']('/',auth[_0x37ac('0x7')](),controller[_0x37ac('0x8')]);router[_0x37ac('0x9')](_0x37ac('0xa'),auth[_0x37ac('0x7')](),controller['show']);router[_0x37ac('0xb')](_0x37ac('0xc'),auth[_0x37ac('0x7')](),controller[_0x37ac('0xd')]);router[_0x37ac('0xb')]('/',auth[_0x37ac('0x7')](),controller[_0x37ac('0xe')]);router['put'](_0x37ac('0xa'),auth['isAuthenticated'](),controller[_0x37ac('0xf')]);router[_0x37ac('0x10')](_0x37ac('0xa'),auth[_0x37ac('0x7')](),controller[_0x37ac('0x11')]);module[_0x37ac('0x12')]=router; \ No newline at end of file +var _0xbed7=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','clone','post','create','update','destroy','exports','multer'];(function(_0x57b335,_0x141fee){var _0x283495=function(_0x1a9d10){while(--_0x1a9d10){_0x57b335['push'](_0x57b335['shift']());}};_0x283495(++_0x141fee);}(_0xbed7,0x1da));var _0x7bed=function(_0xd882e8,_0x5eb1a4){_0xd882e8=_0xd882e8-0x0;var _0x33a76a=_0xbed7[_0xd882e8];return _0x33a76a;};'use strict';var multer=require(_0x7bed('0x0'));var util=require(_0x7bed('0x1'));var path=require(_0x7bed('0x2'));var timeout=require('connect-timeout');var express=require(_0x7bed('0x3'));var router=express[_0x7bed('0x4')]();var fs_extra=require(_0x7bed('0x5'));var auth=require(_0x7bed('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7bed('0x7'));var controller=require(_0x7bed('0x8'));router['get']('/',auth[_0x7bed('0x9')](),controller[_0x7bed('0xa')]);router[_0x7bed('0xb')](_0x7bed('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/:id/clone',auth[_0x7bed('0x9')](),controller[_0x7bed('0xd')]);router[_0x7bed('0xe')]('/',auth['isAuthenticated'](),controller[_0x7bed('0xf')]);router['put'](_0x7bed('0xc'),auth[_0x7bed('0x9')](),controller[_0x7bed('0x10')]);router['delete'](_0x7bed('0xc'),auth[_0x7bed('0x9')](),controller[_0x7bed('0x11')]);module[_0x7bed('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 3d9b4ff..ea29279 100644 --- a/server/api/trunk/trunk.attributes.js +++ b/server/api/trunk/trunk.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dd6=['update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','certificate','active','dynamic','update'];(function(_0x3c504f,_0xac559f){var _0x5f5a53=function(_0x4f4793){while(--_0x4f4793){_0x3c504f['push'](_0x3c504f['shift']());}};_0x5f5a53(++_0xac559f);}(_0x6dd6,0x183));var _0x66dd=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0x6dd6[_0x4cee4b];return _0x4d891d;};'use strict';var Sequelize=require(_0x66dd('0x0'));module[_0x66dd('0x1')]={'name':{'type':Sequelize[_0x66dd('0x2')],'allowNull':![],'unique':_0x66dd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x5'),_0x66dd('0x6'),_0x66dd('0x7')),'allowNull':![],'defaultValue':_0x66dd('0x5')},'context':{'type':Sequelize[_0x66dd('0x2')],'allowNull':![],'defaultValue':_0x66dd('0x8')},'callingpres':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x9'),_0x66dd('0xa'),_0x66dd('0xb'),_0x66dd('0xc'),_0x66dd('0xd'),_0x66dd('0xe'),_0x66dd('0xf'),_0x66dd('0x10'))},'deny':{'type':Sequelize[_0x66dd('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x66dd('0x2')]},'md5secret':{'type':Sequelize[_0x66dd('0x2')]},'remotesecret':{'type':Sequelize[_0x66dd('0x2')]},'transport':{'type':Sequelize[_0x66dd('0x2')],'defaultValue':_0x66dd('0x11'),'set':function(_0x4395c7){this[_0x66dd('0x12')](_0x66dd('0x13'),_0x4395c7?_0x4395c7[_0x66dd('0x14')](','):null);},'get':function(){return this[_0x66dd('0x15')](_0x66dd('0x13'))?this[_0x66dd('0x15')](_0x66dd('0x13'))[_0x66dd('0x16')](','):null;},'comment':_0x66dd('0x17')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x66dd('0x18'),_0x66dd('0x19'),_0x66dd('0x1a'),'auto'),'defaultValue':_0x66dd('0x1b')},'directmedia':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no',_0x66dd('0x1d'),'update',_0x66dd('0x1e')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x66dd('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x66dd('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x66dd('0x1f'),'set':function(_0x21fa5b){this[_0x66dd('0x12')](_0x66dd('0x20'),_0x21fa5b?_0x21fa5b[_0x66dd('0x14')](','):null);},'get':function(){return this[_0x66dd('0x15')](_0x66dd('0x20'))?this['getDataValue'](_0x66dd('0x20'))[_0x66dd('0x16')](','):null;},'comment':_0x66dd('0x21')},'callgroup':{'type':Sequelize[_0x66dd('0x2')]},'namedcallgroup':{'type':Sequelize[_0x66dd('0x2')]},'pickupgroup':{'type':Sequelize[_0x66dd('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x66dd('0x2')]},'language':{'type':Sequelize[_0x66dd('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x66dd('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x66dd('0x2')],'defaultValue':_0x66dd('0x22')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x151094){this['setDataValue'](_0x66dd('0x23'),_0x151094?_0x151094[_0x66dd('0x14')](';'):_0x66dd('0x24'));},'get':function(){return this[_0x66dd('0x15')](_0x66dd('0x23'))?this[_0x66dd('0x15')]('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no')},'insecure':{'type':Sequelize[_0x66dd('0x2')],'defaultValue':_0x66dd('0x25'),'set':function(_0x86e5ed){this['setDataValue'](_0x66dd('0x26'),_0x86e5ed?_0x86e5ed['join'](','):null);},'get':function(){return this[_0x66dd('0x15')]('insecure')?this['getDataValue'](_0x66dd('0x26'))['split'](','):null;},'comment':_0x66dd('0x27')},'trustrpid':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x66dd('0x1c'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x66dd('0x1c'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x66dd('0x1c'),'no')},'accountcode':{'type':Sequelize[_0x66dd('0x28')](0xb)},'setvar':{'type':Sequelize[_0x66dd('0x2')]},'callerid':{'type':Sequelize[_0x66dd('0x2')],'defaultValue':_0x66dd('0x29')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no'),'defaultValue':_0x66dd('0x1c')},'busylevel':{'type':Sequelize[_0x66dd('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x66dd('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize[_0x66dd('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x66dd('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no',_0x66dd('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x66dd('0x1c'),'no')},'mailbox':{'type':Sequelize[_0x66dd('0x2')]},'session_timers':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x2b'),_0x66dd('0x2c'),_0x66dd('0x2d'))},'session_expires':{'type':Sequelize[_0x66dd('0x28')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x2e'),_0x66dd('0x2f')),'defaultValue':_0x66dd('0x2f')},'t38pt_usertpsource':{'type':Sequelize[_0x66dd('0x2')]},'regexten':{'type':Sequelize[_0x66dd('0x2')]},'fromdomain':{'type':Sequelize[_0x66dd('0x2')]},'fromuser':{'type':Sequelize[_0x66dd('0x2')]},'port':{'type':Sequelize[_0x66dd('0x28')](0x5)},'qualify':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x66dd('0x28')](0xb)},'defaultip':{'type':Sequelize[_0x66dd('0x2')]},'defaultuser':{'type':Sequelize[_0x66dd('0x2')]},'rtptimeout':{'type':Sequelize[_0x66dd('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no',_0x66dd('0x30')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x66dd('0x28')](0xb)},'timerb':{'type':Sequelize[_0x66dd('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x66dd('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0x66dd('0x2')]},'contactdeny':{'type':Sequelize[_0x66dd('0x2')]},'contactacl':{'type':Sequelize[_0x66dd('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x66dd('0x2')]},'use_q850_reason':{'type':Sequelize[_0x66dd('0x2')]},'maxforwards':{'type':Sequelize[_0x66dd('0x28')](0xb)},'encryption':{'type':Sequelize[_0x66dd('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x66dd('0x1c'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x66dd('0x1c'),'no','fingerprint',_0x66dd('0x31'))},'dtlsrekey':{'type':Sequelize[_0x66dd('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x66dd('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x66dd('0x2')]},'dtlscipher':{'type':Sequelize[_0x66dd('0x2')]},'dtlscafile':{'type':Sequelize[_0x66dd('0x2')]},'dtlscapath':{'type':Sequelize[_0x66dd('0x2')]},'dtlssetup':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x32'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x66dd('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x66dd('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x66dd('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x66dd('0x4')](_0x66dd('0x1c'),'no')},'subscribemwi':{'type':Sequelize[_0x66dd('0x4')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x66dd('0x2')]},'mohsuggest':{'type':Sequelize[_0x66dd('0x2')]},'parkinglot':{'type':Sequelize[_0x66dd('0x2')]},'description':{'type':Sequelize[_0x66dd('0x2')]},'host':{'type':Sequelize[_0x66dd('0x2')],'defaultValue':_0x66dd('0x33')},'canreinvite':{'type':Sequelize[_0x66dd('0x4')]('yes','no',_0x66dd('0x1d'),_0x66dd('0x34'),_0x66dd('0x35')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x66dd('0x2')]},'active':{'type':Sequelize[_0x66dd('0x36')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x4e3c=['nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','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','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','certificate','active','passive','actpass','dynamic'];(function(_0x1aaaed,_0x15a650){var _0xf044a1=function(_0x348fd9){while(--_0x348fd9){_0x1aaaed['push'](_0x1aaaed['shift']());}};_0xf044a1(++_0x15a650);}(_0x4e3c,0x1df));var _0xc4e3=function(_0x44a9c8,_0x19facb){_0x44a9c8=_0x44a9c8-0x0;var _0x3a3d70=_0x4e3c[_0x44a9c8];return _0x3a3d70;};'use strict';var Sequelize=require(_0xc4e3('0x0'));module[_0xc4e3('0x1')]={'name':{'type':Sequelize[_0xc4e3('0x2')],'allowNull':![],'unique':_0xc4e3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x5'),_0xc4e3('0x6'),_0xc4e3('0x7')),'allowNull':![],'defaultValue':_0xc4e3('0x5')},'context':{'type':Sequelize[_0xc4e3('0x2')],'allowNull':![],'defaultValue':_0xc4e3('0x8')},'callingpres':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x9'),_0xc4e3('0xa'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0xc4e3('0xb'),_0xc4e3('0xc'),_0xc4e3('0xd'),_0xc4e3('0xe'))},'deny':{'type':Sequelize[_0xc4e3('0x2')]},'permit':{'type':Sequelize[_0xc4e3('0x2')]},'secret':{'type':Sequelize[_0xc4e3('0x2')]},'md5secret':{'type':Sequelize[_0xc4e3('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':'udp','set':function(_0x4c59b7){this[_0xc4e3('0xf')](_0xc4e3('0x10'),_0x4c59b7?_0x4c59b7[_0xc4e3('0x11')](','):null);},'get':function(){return this[_0xc4e3('0x12')](_0xc4e3('0x10'))?this[_0xc4e3('0x12')]('transport')[_0xc4e3('0x13')](','):null;},'comment':_0xc4e3('0x14')},'dtmfmode':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x15'),_0xc4e3('0x16'),_0xc4e3('0x17'),_0xc4e3('0x18'),_0xc4e3('0x19')),'defaultValue':_0xc4e3('0x15')},'directmedia':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc4e3('0x2')]},'directmediadeny':{'type':Sequelize[_0xc4e3('0x2')]},'nat':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':_0xc4e3('0x1b'),'set':function(_0x3ba647){this['setDataValue']('nat',_0x3ba647?_0x3ba647[_0xc4e3('0x11')](','):null);},'get':function(){return this[_0xc4e3('0x12')](_0xc4e3('0x1c'))?this[_0xc4e3('0x12')]('nat')['split'](','):null;},'comment':_0xc4e3('0x1d')},'callgroup':{'type':Sequelize[_0xc4e3('0x2')]},'namedcallgroup':{'type':Sequelize[_0xc4e3('0x2')]},'pickupgroup':{'type':Sequelize[_0xc4e3('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xc4e3('0x2')]},'language':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':_0xc4e3('0x1e')},'allow':{'type':Sequelize[_0xc4e3('0x2')],'allowNull':![],'defaultValue':_0xc4e3('0x1f'),'set':function(_0x690d7c){this[_0xc4e3('0xf')](_0xc4e3('0x20'),_0x690d7c?_0x690d7c[_0xc4e3('0x11')](';'):_0xc4e3('0x1f'));},'get':function(){return this['getDataValue'](_0xc4e3('0x20'))?this[_0xc4e3('0x12')]('allow')[_0xc4e3('0x13')](';'):null;},'comment':_0xc4e3('0x21')},'autoframing':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'insecure':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':'port,invite','set':function(_0x2f7976){this['setDataValue'](_0xc4e3('0x22'),_0x2f7976?_0x2f7976[_0xc4e3('0x11')](','):null);},'get':function(){return this[_0xc4e3('0x12')](_0xc4e3('0x22'))?this['getDataValue'](_0xc4e3('0x22'))[_0xc4e3('0x13')](','):null;},'comment':_0xc4e3('0x23')},'trustrpid':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc4e3('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc4e3('0x4')]('yes','no',_0xc4e3('0x24'))},'promiscredir':{'type':Sequelize[_0xc4e3('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'setvar':{'type':Sequelize[_0xc4e3('0x2')]},'callerid':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':_0xc4e3('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':_0xc4e3('0x1a')},'busylevel':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xc4e3('0x1a'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xc4e3('0x2')]},'videosupport':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no',_0xc4e3('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'mailbox':{'type':Sequelize[_0xc4e3('0x2')]},'session_timers':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x28'),_0xc4e3('0x29'),_0xc4e3('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x2b'),_0xc4e3('0x2c')),'defaultValue':_0xc4e3('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xc4e3('0x2')]},'regexten':{'type':Sequelize[_0xc4e3('0x2')]},'fromdomain':{'type':Sequelize[_0xc4e3('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xc4e3('0x25')](0x5)},'qualify':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xc4e3('0x2')]},'rtptimeout':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no',_0xc4e3('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc4e3('0x2')]},'callbackextension':{'type':Sequelize[_0xc4e3('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xc4e3('0x2')]},'contactdeny':{'type':Sequelize[_0xc4e3('0x2')]},'contactacl':{'type':Sequelize[_0xc4e3('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xc4e3('0x2')]},'use_q850_reason':{'type':Sequelize[_0xc4e3('0x2')]},'maxforwards':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'encryption':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'force_avp':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no','fingerprint',_0xc4e3('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xc4e3('0x2')]},'dtlscafile':{'type':Sequelize[_0xc4e3('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x2f'),_0xc4e3('0x30'),_0xc4e3('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc4e3('0x2')]},'usereqphone':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc4e3('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xc4e3('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xc4e3('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xc4e3('0x2')]},'mohsuggest':{'type':Sequelize[_0xc4e3('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc4e3('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xc4e3('0x32')},'canreinvite':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no',_0xc4e3('0x33'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xc4e3('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc4e3('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index f6c72cb..478e457 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','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','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x26735a,_0x182331){var _0x33ac63=function(_0x12cf73){while(--_0x12cf73){_0x26735a['push'](_0x26735a['shift']());}};_0x33ac63(++_0x182331);}(_0x54ef,0x112));var _0xf54e=function(_0x32e233,_0x7c9cce){_0x32e233=_0x32e233-0x0;var _0x4af95c=_0x54ef[_0x32e233];return _0x4af95c;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file +var _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','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','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x14ec6e,_0x2b637e){var _0x2de3dd=function(_0x915cb9){while(--_0x915cb9){_0x14ec6e['push'](_0x14ec6e['shift']());}};_0x2de3dd(++_0x2b637e);}(_0x54ef,0x112));var _0xf54e=function(_0x5ad8cf,_0x66d2af){_0x5ad8cf=_0x5ad8cf-0x0;var _0x46b92b=_0x54ef[_0x5ad8cf];return _0x46b92b;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 9d09f45..e155f01 100644 --- a/server/api/trunk/trunk.model.js +++ b/server/api/trunk/trunk.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f87=['moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3f87,0xf3));var _0x73f8=function(_0x5e7e5c,_0x370624){_0x5e7e5c=_0x5e7e5c-0x0;var _0x5b69a0=_0x3f87[_0x5e7e5c];return _0x5b69a0;};'use strict';var _=require(_0x73f8('0x0'));var util=require(_0x73f8('0x1'));var logger=require(_0x73f8('0x2'))(_0x73f8('0x3'));var moment=require(_0x73f8('0x4'));var BPromise=require('bluebird');var rp=require(_0x73f8('0x5'));var fs=require('fs');var path=require(_0x73f8('0x6'));var rimraf=require(_0x73f8('0x7'));var config=require(_0x73f8('0x8'));var attributes=require(_0x73f8('0x9'));module[_0x73f8('0xa')]=function(_0x59ae53,_0x517daf){return _0x59ae53['define'](_0x73f8('0xb'),attributes,{'tableName':_0x73f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9d5=['path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','api','moment','request-promise'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xd9d5,0xf9));var _0x5d9d=function(_0x3fc8b4,_0xf14b34){_0x3fc8b4=_0x3fc8b4-0x0;var _0x137d9b=_0xd9d5[_0x3fc8b4];return _0x137d9b;};'use strict';var _=require(_0x5d9d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5d9d('0x1'));var moment=require(_0x5d9d('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d9d('0x3'));var fs=require('fs');var path=require(_0x5d9d('0x4'));var rimraf=require('rimraf');var config=require(_0x5d9d('0x5'));var attributes=require(_0x5d9d('0x6'));module[_0x5d9d('0x7')]=function(_0x47a182,_0x82a9ad){return _0x47a182[_0x5d9d('0x8')](_0x5d9d('0x9'),attributes,{'tableName':_0x5d9d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 62fb958..61bf579 100644 --- a/server/api/trunk/trunk.rpc.js +++ b/server/api/trunk/trunk.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ddc=['limit','include','model','map','attributes','GetTrunk','stringify','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','Trunk','findAll','options','raw','where'];(function(_0x52d8e5,_0x45ddef){var _0x371501=function(_0x32e825){while(--_0x32e825){_0x52d8e5['push'](_0x52d8e5['shift']());}};_0x371501(++_0x45ddef);}(_0x7ddc,0x10c));var _0xc7dd=function(_0x1dab69,_0x56695e){_0x1dab69=_0x1dab69-0x0;var _0xde0feb=_0x7ddc[_0x1dab69];return _0xde0feb;};'use strict';var _=require(_0xc7dd('0x0'));var util=require(_0xc7dd('0x1'));var moment=require(_0xc7dd('0x2'));var BPromise=require(_0xc7dd('0x3'));var rs=require(_0xc7dd('0x4'));var fs=require('fs');var Redis=require(_0xc7dd('0x5'));var db=require(_0xc7dd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc7dd('0x7'))(_0xc7dd('0x8'));var config=require(_0xc7dd('0x9'));var jayson=require(_0xc7dd('0xa'));var client=jayson[_0xc7dd('0xb')][_0xc7dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46b147,_0x5ce781,_0x3863a2){return new BPromise(function(_0x55136c,_0x1f247e){return client['request'](_0x46b147,_0x3863a2)[_0xc7dd('0xd')](function(_0x3f7fd0){logger[_0xc7dd('0xe')](_0xc7dd('0xf'),_0x5ce781,_0xc7dd('0x10'));logger[_0xc7dd('0x11')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5ce781,_0xc7dd('0x10'),JSON['stringify'](_0x3f7fd0));if(_0x3f7fd0[_0xc7dd('0x12')]){if(_0x3f7fd0[_0xc7dd('0x12')][_0xc7dd('0x13')]===0x1f4){logger[_0xc7dd('0x12')](_0xc7dd('0xf'),_0x5ce781,_0x3f7fd0[_0xc7dd('0x12')][_0xc7dd('0x14')]);return _0x1f247e(_0x3f7fd0[_0xc7dd('0x12')][_0xc7dd('0x14')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5ce781,_0x3f7fd0[_0xc7dd('0x12')]['message']);return _0x55136c(_0x3f7fd0[_0xc7dd('0x12')][_0xc7dd('0x14')]);}else{logger[_0xc7dd('0xe')](_0xc7dd('0xf'),_0x5ce781,_0xc7dd('0x10'));_0x55136c(_0x3f7fd0[_0xc7dd('0x15')][_0xc7dd('0x14')]);}})[_0xc7dd('0x16')](function(_0x21a30d){logger[_0xc7dd('0x12')]('Trunk,\x20%s,\x20%s',_0x5ce781,_0x21a30d);_0x1f247e(_0x21a30d);});});}exports['GetTrunk']=function(_0x2a1388){var _0x36c425=this;return new Promise(function(_0x10e17a,_0x3e441d){return db[_0xc7dd('0x17')][_0xc7dd('0x18')]({'raw':_0x2a1388[_0xc7dd('0x19')]?_0x2a1388[_0xc7dd('0x19')][_0xc7dd('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a1388[_0xc7dd('0x19')]?_0x2a1388[_0xc7dd('0x19')][_0xc7dd('0x1b')]||null:null,'attributes':_0x2a1388[_0xc7dd('0x19')]?_0x2a1388[_0xc7dd('0x19')]['attributes']||null:null,'limit':_0x2a1388['options']?_0x2a1388[_0xc7dd('0x19')][_0xc7dd('0x1c')]||null:null,'include':_0x2a1388[_0xc7dd('0x19')]?_0x2a1388[_0xc7dd('0x19')][_0xc7dd('0x1d')]?_['map'](_0x2a1388[_0xc7dd('0x19')][_0xc7dd('0x1d')],function(_0x3e27b5){return{'model':db[_0x3e27b5[_0xc7dd('0x1e')]],'as':_0x3e27b5['as'],'attributes':_0x3e27b5['attributes'],'include':_0x3e27b5[_0xc7dd('0x1d')]?_[_0xc7dd('0x1f')](_0x3e27b5[_0xc7dd('0x1d')],function(_0x382502){return{'model':db[_0x382502[_0xc7dd('0x1e')]],'as':_0x382502['as'],'attributes':_0x382502[_0xc7dd('0x20')],'include':_0x382502['include']?_['map'](_0x382502[_0xc7dd('0x1d')],function(_0x27a28c){return{'model':db[_0x27a28c[_0xc7dd('0x1e')]],'as':_0x27a28c['as'],'attributes':_0x27a28c[_0xc7dd('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc7dd('0xd')](function(_0x38b5e9){logger[_0xc7dd('0xe')](_0xc7dd('0x21'),_0x2a1388);logger[_0xc7dd('0x11')]('GetTrunk',_0x2a1388,JSON[_0xc7dd('0x22')](_0x38b5e9));_0x10e17a(_0x38b5e9);})[_0xc7dd('0x16')](function(_0x4fa4f3){logger['error'](_0xc7dd('0x21'),_0x4fa4f3['message'],_0x2a1388);_0x3e441d(_0x36c425[_0xc7dd('0x12')](0x1f4,_0x4fa4f3[_0xc7dd('0x14')]));});});};exports[_0xc7dd('0x23')]=function(_0x625350){var _0xd2bebb=this;return new Promise(function(_0x34fde8,_0x1d5b53){return db[_0xc7dd('0x17')][_0xc7dd('0x24')]({'raw':_0x625350[_0xc7dd('0x19')]?_0x625350['options'][_0xc7dd('0x1a')]===undefined?!![]:![]:!![],'where':_0x625350[_0xc7dd('0x19')]?_0x625350[_0xc7dd('0x19')][_0xc7dd('0x1b')]||null:null,'attributes':_0x625350[_0xc7dd('0x19')]?_0x625350[_0xc7dd('0x19')][_0xc7dd('0x20')]||null:null,'include':_0x625350[_0xc7dd('0x19')]?_0x625350['options'][_0xc7dd('0x1d')]?_[_0xc7dd('0x1f')](_0x625350['options'][_0xc7dd('0x1d')],function(_0x4fc4a3){return{'model':db[_0x4fc4a3[_0xc7dd('0x1e')]],'as':_0x4fc4a3['as'],'attributes':_0x4fc4a3[_0xc7dd('0x20')],'include':_0x4fc4a3[_0xc7dd('0x1d')]?_[_0xc7dd('0x1f')](_0x4fc4a3['include'],function(_0x8b89e3){return{'model':db[_0x8b89e3[_0xc7dd('0x1e')]],'as':_0x8b89e3['as'],'attributes':_0x8b89e3[_0xc7dd('0x20')],'include':_0x8b89e3[_0xc7dd('0x1d')]?_[_0xc7dd('0x1f')](_0x8b89e3[_0xc7dd('0x1d')],function(_0x5e76b7){return{'model':db[_0x5e76b7['model']],'as':_0x5e76b7['as'],'attributes':_0x5e76b7[_0xc7dd('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc7dd('0xd')](function(_0x4bd4ff){logger[_0xc7dd('0xe')]('ShowTrunk',_0x625350);logger[_0xc7dd('0x11')](_0xc7dd('0x23'),_0x625350,JSON[_0xc7dd('0x22')](_0x4bd4ff));_0x34fde8(_0x4bd4ff);})[_0xc7dd('0x16')](function(_0x39bbb7){logger[_0xc7dd('0x12')]('ShowTrunk',_0x39bbb7['message'],_0x625350);_0x1d5b53(_0xd2bebb['error'](0x1f4,_0x39bbb7[_0xc7dd('0x14')]));});});}; \ No newline at end of file +var _0x96b3=['message','catch','GetTrunk','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowTrunk','Trunk','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x58dc32,_0x4c5ff2){var _0x36cb8b=function(_0x22d1b9){while(--_0x22d1b9){_0x58dc32['push'](_0x58dc32['shift']());}};_0x36cb8b(++_0x4c5ff2);}(_0x96b3,0x131));var _0x396b=function(_0x24e641,_0x3d4d74){_0x24e641=_0x24e641-0x0;var _0x5dedb3=_0x96b3[_0x24e641];return _0x5dedb3;};'use strict';var _=require(_0x396b('0x0'));var util=require(_0x396b('0x1'));var moment=require(_0x396b('0x2'));var BPromise=require('bluebird');var rs=require(_0x396b('0x3'));var fs=require('fs');var Redis=require(_0x396b('0x4'));var db=require(_0x396b('0x5'))['db'];var utils=require(_0x396b('0x6'));var logger=require(_0x396b('0x7'))(_0x396b('0x8'));var config=require(_0x396b('0x9'));var jayson=require(_0x396b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e213f,_0x5f3ead,_0x59c86b){return new BPromise(function(_0x147a01,_0x291082){return client[_0x396b('0xb')](_0x3e213f,_0x59c86b)[_0x396b('0xc')](function(_0x55f27d){logger[_0x396b('0xd')](_0x396b('0xe'),_0x5f3ead,_0x396b('0xf'));logger['debug'](_0x396b('0x10'),_0x5f3ead,'request\x20sent',JSON['stringify'](_0x55f27d));if(_0x55f27d[_0x396b('0x11')]){if(_0x55f27d[_0x396b('0x11')][_0x396b('0x12')]===0x1f4){logger[_0x396b('0x11')](_0x396b('0xe'),_0x5f3ead,_0x55f27d[_0x396b('0x11')][_0x396b('0x13')]);return _0x291082(_0x55f27d[_0x396b('0x11')][_0x396b('0x13')]);}logger[_0x396b('0x11')](_0x396b('0xe'),_0x5f3ead,_0x55f27d['error'][_0x396b('0x13')]);return _0x147a01(_0x55f27d[_0x396b('0x11')]['message']);}else{logger['info'](_0x396b('0xe'),_0x5f3ead,_0x396b('0xf'));_0x147a01(_0x55f27d['result'][_0x396b('0x13')]);}})[_0x396b('0x14')](function(_0x2223d8){logger[_0x396b('0x11')](_0x396b('0xe'),_0x5f3ead,_0x2223d8);_0x291082(_0x2223d8);});});}exports[_0x396b('0x15')]=function(_0x1cae7b){var _0x55727a=this;return new Promise(function(_0x3d23a8,_0x1f69a3){return db['Trunk'][_0x396b('0x16')]({'raw':_0x1cae7b[_0x396b('0x17')]?_0x1cae7b[_0x396b('0x17')][_0x396b('0x18')]===undefined?!![]:![]:!![],'where':_0x1cae7b[_0x396b('0x17')]?_0x1cae7b['options'][_0x396b('0x19')]||null:null,'attributes':_0x1cae7b['options']?_0x1cae7b[_0x396b('0x17')][_0x396b('0x1a')]||null:null,'limit':_0x1cae7b[_0x396b('0x17')]?_0x1cae7b[_0x396b('0x17')][_0x396b('0x1b')]||null:null,'include':_0x1cae7b[_0x396b('0x17')]?_0x1cae7b['options'][_0x396b('0x1c')]?_['map'](_0x1cae7b['options'][_0x396b('0x1c')],function(_0x55caed){return{'model':db[_0x55caed['model']],'as':_0x55caed['as'],'attributes':_0x55caed[_0x396b('0x1a')],'include':_0x55caed['include']?_[_0x396b('0x1d')](_0x55caed['include'],function(_0x4d5a8b){return{'model':db[_0x4d5a8b[_0x396b('0x1e')]],'as':_0x4d5a8b['as'],'attributes':_0x4d5a8b[_0x396b('0x1a')],'include':_0x4d5a8b[_0x396b('0x1c')]?_[_0x396b('0x1d')](_0x4d5a8b[_0x396b('0x1c')],function(_0x1f3318){return{'model':db[_0x1f3318[_0x396b('0x1e')]],'as':_0x1f3318['as'],'attributes':_0x1f3318[_0x396b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x396b('0xc')](function(_0x162682){logger['info'](_0x396b('0x15'),_0x1cae7b);logger[_0x396b('0x1f')](_0x396b('0x15'),_0x1cae7b,JSON[_0x396b('0x20')](_0x162682));_0x3d23a8(_0x162682);})[_0x396b('0x14')](function(_0x30ff4b){logger['error']('GetTrunk',_0x30ff4b[_0x396b('0x13')],_0x1cae7b);_0x1f69a3(_0x55727a[_0x396b('0x11')](0x1f4,_0x30ff4b[_0x396b('0x13')]));});});};exports[_0x396b('0x21')]=function(_0x1007b6){var _0x56f818=this;return new Promise(function(_0x4c9aae,_0x5f11a2){return db[_0x396b('0x22')][_0x396b('0x23')]({'raw':_0x1007b6['options']?_0x1007b6[_0x396b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1007b6[_0x396b('0x17')]?_0x1007b6[_0x396b('0x17')][_0x396b('0x19')]||null:null,'attributes':_0x1007b6[_0x396b('0x17')]?_0x1007b6['options'][_0x396b('0x1a')]||null:null,'include':_0x1007b6['options']?_0x1007b6['options'][_0x396b('0x1c')]?_[_0x396b('0x1d')](_0x1007b6[_0x396b('0x17')][_0x396b('0x1c')],function(_0x48ee15){return{'model':db[_0x48ee15[_0x396b('0x1e')]],'as':_0x48ee15['as'],'attributes':_0x48ee15[_0x396b('0x1a')],'include':_0x48ee15[_0x396b('0x1c')]?_[_0x396b('0x1d')](_0x48ee15['include'],function(_0x3f9b73){return{'model':db[_0x3f9b73['model']],'as':_0x3f9b73['as'],'attributes':_0x3f9b73['attributes'],'include':_0x3f9b73[_0x396b('0x1c')]?_[_0x396b('0x1d')](_0x3f9b73[_0x396b('0x1c')],function(_0x1b1a4b){return{'model':db[_0x1b1a4b[_0x396b('0x1e')]],'as':_0x1b1a4b['as'],'attributes':_0x1b1a4b['attributes']};}):[]};}):[]};}):[]:[]})[_0x396b('0xc')](function(_0x25fa61){logger[_0x396b('0xd')](_0x396b('0x21'),_0x1007b6);logger['debug']('ShowTrunk',_0x1007b6,JSON[_0x396b('0x20')](_0x25fa61));_0x4c9aae(_0x25fa61);})[_0x396b('0x14')](function(_0xfbba44){logger[_0x396b('0x11')]('ShowTrunk',_0xfbba44['message'],_0x1007b6);_0x5f11a2(_0x56f818[_0x396b('0x11')](0x1f4,_0xfbba44[_0x396b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 59bdfb9..1ab485f 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b1f=['/:id','isAuthenticated','Router','./user-setting.controller','put'];(function(_0x559d35,_0x267080){var _0x51bbc3=function(_0x51bac2){while(--_0x51bac2){_0x559d35['push'](_0x559d35['shift']());}};_0x51bbc3(++_0x267080);}(_0x3b1f,0xe3));var _0xf3b1=function(_0x51d653,_0x4d3b99){_0x51d653=_0x51d653-0x0;var _0x5108cd=_0x3b1f[_0x51d653];return _0x5108cd;};'use strict';var express=require('express');var router=express[_0xf3b1('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xf3b1('0x1'));router[_0xf3b1('0x2')](_0xf3b1('0x3'),auth[_0xf3b1('0x4')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x1041=['update','express','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x4c2537,_0x20afdf){var _0x94fb5c=function(_0x49e2f3){while(--_0x49e2f3){_0x4c2537['push'](_0x4c2537['shift']());}};_0x94fb5c(++_0x20afdf);}(_0x1041,0x159));var _0x1104=function(_0x5c2e65,_0x20e630){_0x5c2e65=_0x5c2e65-0x0;var _0x445359=_0x1041[_0x5c2e65];return _0x445359;};'use strict';var express=require(_0x1104('0x0'));var router=express[_0x1104('0x1')]();var auth=require(_0x1104('0x2'));var controller=require(_0x1104('0x3'));router[_0x1104('0x4')](_0x1104('0x5'),auth[_0x1104('0x6')](),controller[_0x1104('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 67700ec..16be5e5 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed25=['info','debug','exports','ENUM','BOOLEAN','INTEGER','UserId','sequelize','error'];(function(_0x340174,_0x25dca5){var _0x4f3450=function(_0x193146){while(--_0x193146){_0x340174['push'](_0x340174['shift']());}};_0x4f3450(++_0x25dca5);}(_0xed25,0x154));var _0x5ed2=function(_0x2a4291,_0x53bdd8){_0x2a4291=_0x2a4291-0x0;var _0xf91cbe=_0xed25[_0x2a4291];return _0xf91cbe;};'use strict';var Sequelize=require(_0x5ed2('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x5ed2('0x1'),'warning',_0x5ed2('0x2'),_0x5ed2('0x3')];module[_0x5ed2('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x5ed2('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x5ed2('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x5ed2('0x7')],'unique':_0x5ed2('0x8')}}; \ No newline at end of file +var _0xf224=['BOOLEAN','TEXT','DATE','sequelize','error','warning','info','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf224,0x1a3));var _0x4f22=function(_0x4c13d8,_0x7362d6){_0x4c13d8=_0x4c13d8-0x0;var _0x3ecbb2=_0xf224[_0x4c13d8];return _0x3ecbb2;};'use strict';var Sequelize=require(_0x4f22('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x4f22('0x1'),_0x4f22('0x2'),_0x4f22('0x3'),'debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x4f22('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x4f22('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x4f22('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x4f22('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x4f22('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 5e2b57c..630ec0a 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x777f=['../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','status','json','update','sendStatus','error','name','send','admin','params','Invalid\x20user\x20setting\x20id','UserSetting','then','body','catch','lodash','ioredis'];(function(_0x245954,_0x833e4e){var _0x2ea8fb=function(_0x39c101){while(--_0x39c101){_0x245954['push'](_0x245954['shift']());}};_0x2ea8fb(++_0x833e4e);}(_0x777f,0x9f));var _0xf777=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x777f[_0x240261];return _0x45c332;};'use strict';var _=require(_0xf777('0x0'));var Redis=require(_0xf777('0x1'));var logger=require(_0xf777('0x2'))(_0xf777('0x3'));var config=require(_0xf777('0x4'));var db=require(_0xf777('0x5'))['db'];var socket=require(_0xf777('0x6'))(new Redis(config[_0xf777('0x7')]));require('./user-setting.socket')[_0xf777('0x8')](socket);config[_0xf777('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0xa78a3,_0x6d105c){_0x6d105c=_0x6d105c||0xc8;return function(_0x3cbcaa){if(_0x3cbcaa){return _0xa78a3[_0xf777('0x9')](_0x6d105c)[_0xf777('0xa')](_0x3cbcaa);}};}function saveUpdates(_0x467dc2){return function(_0x44ad18){if(_0x44ad18){return _0x44ad18[_0xf777('0xb')](_0x467dc2)['then'](function(_0x4b849a){return _0x4b849a;});}return null;};}function handleEntityNotFound(_0x5d8752){return function(_0x121128){if(!_0x121128){_0x5d8752[_0xf777('0xc')](0x194);}return _0x121128;};}function handleError(_0x557c9e,_0x133cfc){_0x133cfc=_0x133cfc||0x1f4;return function(_0x2141f2){logger[_0xf777('0xd')](_0x2141f2['stack']);if(_0x2141f2[_0xf777('0xe')]){delete _0x2141f2[_0xf777('0xe')];}_0x557c9e[_0xf777('0x9')](_0x133cfc)[_0xf777('0xf')](_0x2141f2);};}exports[_0xf777('0xb')]=function(_0x20469e,_0x235a0f){if(_0x20469e['user']['role']!==_0xf777('0x10'))throw new Error('Unauthorized');if(isNaN(Number(_0x20469e[_0xf777('0x11')]['id'])))throw new Error(_0xf777('0x12'));return db[_0xf777('0x13')]['find']({'where':{'id':_0x20469e[_0xf777('0x11')]['id']}})[_0xf777('0x14')](handleEntityNotFound(_0x235a0f,null))[_0xf777('0x14')](saveUpdates(_0x20469e[_0xf777('0x15')],null))[_0xf777('0x14')](respondWithResult(_0x235a0f,null))[_0xf777('0x16')](handleError(_0x235a0f,null));}; \ No newline at end of file +var _0x175e=['Invalid\x20user\x20setting\x20id','UserSetting','find','then','body','lodash','ioredis','../../config/logger','api','../../config/environment','redis','./user-setting.socket','register','defaults','localhost','status','json','update','sendStatus','name','send','user','admin','Unauthorized','params'];(function(_0x58cbde,_0x4b0f62){var _0x5799f3=function(_0x326eca){while(--_0x326eca){_0x58cbde['push'](_0x58cbde['shift']());}};_0x5799f3(++_0x4b0f62);}(_0x175e,0xe6));var _0xe175=function(_0x512375,_0x53e0db){_0x512375=_0x512375-0x0;var _0x2bb4db=_0x175e[_0x512375];return _0x2bb4db;};'use strict';var _=require(_0xe175('0x0'));var Redis=require(_0xe175('0x1'));var logger=require(_0xe175('0x2'))(_0xe175('0x3'));var config=require(_0xe175('0x4'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xe175('0x5')]));require(_0xe175('0x6'))[_0xe175('0x7')](socket);config[_0xe175('0x5')]=_[_0xe175('0x8')](config[_0xe175('0x5')],{'host':_0xe175('0x9'),'port':0x18eb});function respondWithResult(_0xbe8cd,_0x470c64){_0x470c64=_0x470c64||0xc8;return function(_0x2e1356){if(_0x2e1356){return _0xbe8cd[_0xe175('0xa')](_0x470c64)[_0xe175('0xb')](_0x2e1356);}};}function saveUpdates(_0xbc5f3b){return function(_0x18b677){if(_0x18b677){return _0x18b677[_0xe175('0xc')](_0xbc5f3b)['then'](function(_0x52850e){return _0x52850e;});}return null;};}function handleEntityNotFound(_0x2b3755){return function(_0x591ec3){if(!_0x591ec3){_0x2b3755[_0xe175('0xd')](0x194);}return _0x591ec3;};}function handleError(_0x1e1d7c,_0x2cc353){_0x2cc353=_0x2cc353||0x1f4;return function(_0x1a71dc){logger['error'](_0x1a71dc['stack']);if(_0x1a71dc[_0xe175('0xe')]){delete _0x1a71dc['name'];}_0x1e1d7c['status'](_0x2cc353)[_0xe175('0xf')](_0x1a71dc);};}exports[_0xe175('0xc')]=function(_0xf92dec,_0x36ee94){if(_0xf92dec[_0xe175('0x10')]['role']!==_0xe175('0x11'))throw new Error(_0xe175('0x12'));if(isNaN(Number(_0xf92dec[_0xe175('0x13')]['id'])))throw new Error(_0xe175('0x14'));return db[_0xe175('0x15')][_0xe175('0x16')]({'where':{'id':_0xf92dec[_0xe175('0x13')]['id']}})['then'](handleEntityNotFound(_0x36ee94,null))[_0xe175('0x17')](saveUpdates(_0xf92dec[_0xe175('0x18')],null))[_0xe175('0x17')](respondWithResult(_0x36ee94,null))['catch'](handleError(_0x36ee94,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index b1242a5..0eed00d 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd574=['hook','../../mysqldb','UserSetting','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0xd574,0x89));var _0x4d57=function(_0x5ced4a,_0x3b6c54){_0x5ced4a=_0x5ced4a-0x0;var _0x446da2=_0xd574[_0x5ced4a];return _0x446da2;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x4d57('0x0'))['db'][_0x4d57('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x4d57('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d57('0x3'),'afterDestroy':_0x4d57('0x4')};function emitEvent(_0x5c69e3){return function(_0x8a7e2d,_0x59c86d,_0xa9ce28){UserSettingEvents[_0x4d57('0x5')](_0x5c69e3+':'+_0x8a7e2d['id'],_0x8a7e2d);UserSettingEvents[_0x4d57('0x5')](_0x5c69e3,_0x8a7e2d);_0xa9ce28(null);};}for(var e in events){if(events[_0x4d57('0x6')](e)){var event=events[e];UserSetting[_0x4d57('0x7')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0x6351=['hook','exports','../../mysqldb','UserSetting','setMaxListeners','save','remove','emit'];(function(_0x40dde3,_0x384a6f){var _0x45d18b=function(_0x365d53){while(--_0x365d53){_0x40dde3['push'](_0x40dde3['shift']());}};_0x45d18b(++_0x384a6f);}(_0x6351,0x1ba));var _0x1635=function(_0x4d2552,_0x560684){_0x4d2552=_0x4d2552-0x0;var _0x56761b=_0x6351[_0x4d2552];return _0x56761b;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x1635('0x0'))['db'][_0x1635('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1635('0x2')](0x0);var events={'afterCreate':_0x1635('0x3'),'afterUpdate':'update','afterDestroy':_0x1635('0x4')};function emitEvent(_0x2e65c1){return function(_0x2d7cfe,_0x617214,_0x4e36ee){UserSettingEvents[_0x1635('0x5')](_0x2e65c1+':'+_0x2d7cfe['id'],_0x2d7cfe);UserSettingEvents['emit'](_0x2e65c1,_0x2d7cfe);_0x4e36ee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x1635('0x6')](e,emitEvent(event));}}module[_0x1635('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index e1699e2..5fdcc5d 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x235a=['./user-setting.attributes','exports','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x66b739,_0x3ddaba){var _0x2c9de7=function(_0x3280c6){while(--_0x3280c6){_0x66b739['push'](_0x66b739['shift']());}};_0x2c9de7(++_0x3ddaba);}(_0x235a,0x1ef));var _0xa235=function(_0x427cfb,_0x49e7a9){_0x427cfb=_0x427cfb-0x0;var _0x53fd0a=_0x235a[_0x427cfb];return _0x53fd0a;};'use strict';var attributes=require(_0xa235('0x0'));module[_0xa235('0x1')]=function(_0x95e7f5){return _0x95e7f5['define'](_0xa235('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ae786){if(!_0x3ae786[_0xa235('0x3')])_0x3ae786[_0xa235('0x4')]=null;else if(_0x3ae786[_0xa235('0x4')]===null)_0x3ae786[_0xa235('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x594d=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','UserSetting','user_settings'];(function(_0x54c77a,_0x5d06f4){var _0xf0b45b=function(_0x413cdf){while(--_0x413cdf){_0x54c77a['push'](_0x54c77a['shift']());}};_0xf0b45b(++_0x5d06f4);}(_0x594d,0x92));var _0xd594=function(_0x476e92,_0x5e7872){_0x476e92=_0x476e92-0x0;var _0x4bd9df=_0x594d[_0x476e92];return _0x4bd9df;};'use strict';var attributes=require(_0xd594('0x0'));module['exports']=function(_0x4a7d4b){return _0x4a7d4b[_0xd594('0x1')](_0xd594('0x2'),attributes,{'tableName':_0xd594('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x496b6a){if(!_0x496b6a[_0xd594('0x4')])_0x496b6a[_0xd594('0x5')]=null;else if(_0x496b6a[_0xd594('0x5')]===null)_0x496b6a[_0xd594('0x5')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 176adc2..5de5e47 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5a9=['length','user-setting:','./user-setting.events','remove','update','emit','user-setting:update:user-','register'];(function(_0x2371a3,_0x84a147){var _0x41f614=function(_0x219ba7){while(--_0x219ba7){_0x2371a3['push'](_0x2371a3['shift']());}};_0x41f614(++_0x84a147);}(_0xb5a9,0xb2));var _0x9b5a=function(_0x6b026,_0x14a3e0){_0x6b026=_0x6b026-0x0;var _0x43dd2e=_0xb5a9[_0x6b026];return _0x43dd2e;};'use strict';var UserSettingEvents=require(_0x9b5a('0x0'));var events=['save',_0x9b5a('0x1'),_0x9b5a('0x2')];function createListener(_0x3fc9f8,_0x26b63f){return function(_0x402e47){_0x26b63f[_0x9b5a('0x3')](_0x3fc9f8,_0x402e47);if(_0x3fc9f8==='user-setting:update'){_0x26b63f['emit'](_0x9b5a('0x4')+_0x402e47['UserId'],_0x402e47);}};}exports[_0x9b5a('0x5')]=function(_0x5196e4){for(var _0x2dcb3a=0x0,_0x38b00b=events[_0x9b5a('0x6')];_0x2dcb3a<_0x38b00b;_0x2dcb3a++){var _0xd9b645=events[_0x2dcb3a];var _0x4d9937=createListener(_0x9b5a('0x7')+_0xd9b645,_0x5196e4);UserSettingEvents['on'](_0xd9b645,_0x4d9937);}}; \ No newline at end of file +var _0x1239=['user-setting:update','register','length','user-setting:','./user-setting.events','save','remove','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1239,0xd3));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var UserSettingEvents=require(_0x9123('0x0'));var events=[_0x9123('0x1'),_0x9123('0x2'),_0x9123('0x3')];function createListener(_0x334dbc,_0x2e09c1){return function(_0x40eb05){_0x2e09c1[_0x9123('0x4')](_0x334dbc,_0x40eb05);if(_0x334dbc===_0x9123('0x5')){_0x2e09c1[_0x9123('0x4')]('user-setting:update:user-'+_0x40eb05['UserId'],_0x40eb05);}};}exports[_0x9123('0x6')]=function(_0x3ece9d){for(var _0x4639c3=0x0,_0x28efdd=events[_0x9123('0x7')];_0x4639c3<_0x28efdd;_0x4639c3++){var _0x19f959=events[_0x4639c3];var _0x22a7ca=createListener(_0x9123('0x8')+_0x19f959,_0x3ece9d);UserSettingEvents['on'](_0x19f959,_0x22a7ca);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index dae016a..880823c 100644 --- a/server/api/user/index.js +++ b/server/api/user/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88b5=['single','/:id/login','login','logout','pause','/:id/unpause','unpause','/:id/teams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','put','update','/:id/password','changePassword','removeQueues','delete','removeTeams','/:id','destroy','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/whoami','whoami','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','addQueues','diskStorage','join','server/files/images/','format','%s-%s','originalname'];(function(_0x515e72,_0x224638){var _0x21d3bf=function(_0x46dfbe){while(--_0x46dfbe){_0x515e72['push'](_0x515e72['shift']());}};_0x21d3bf(++_0x224638);}(_0x88b5,0x10f));var _0x588b=function(_0x26674d,_0x54e603){_0x26674d=_0x26674d-0x0;var _0x403982=_0x88b5[_0x26674d];return _0x403982;};'use strict';var multer=require(_0x588b('0x0'));var util=require(_0x588b('0x1'));var path=require(_0x588b('0x2'));var timeout=require('connect-timeout');var express=require(_0x588b('0x3'));var router=express[_0x588b('0x4')]();var fs_extra=require(_0x588b('0x5'));var auth=require(_0x588b('0x6'));var interaction=require(_0x588b('0x7'));var config=require(_0x588b('0x8'));var controller=require('./user.controller');router[_0x588b('0x9')]('/',auth[_0x588b('0xa')](),controller['index']);router['get'](_0x588b('0xb'),auth[_0x588b('0xa')](),controller['describe']);router[_0x588b('0x9')](_0x588b('0xc'),auth[_0x588b('0xa')](),controller[_0x588b('0xd')]);router[_0x588b('0x9')]('/presence',auth[_0x588b('0xa')](),controller['getPresence']);router['get']('/:id',auth[_0x588b('0xa')](),controller[_0x588b('0xe')]);router[_0x588b('0x9')](_0x588b('0xf'),controller[_0x588b('0x10')]);router[_0x588b('0x9')](_0x588b('0x11'),auth['isAuthenticated'](),controller[_0x588b('0x12')]);router[_0x588b('0x9')](_0x588b('0x13'),auth[_0x588b('0xa')](),controller[_0x588b('0x14')]);router[_0x588b('0x9')](_0x588b('0x15'),auth[_0x588b('0xa')](),controller[_0x588b('0x16')]);router[_0x588b('0x9')](_0x588b('0x17'),auth[_0x588b('0xa')](),controller[_0x588b('0x18')]);router['get']('/:id/groups',auth[_0x588b('0xa')](),controller[_0x588b('0x19')]);router[_0x588b('0x9')](_0x588b('0x1a'),auth[_0x588b('0xa')](),controller[_0x588b('0x1b')]);router['get'](_0x588b('0x1c'),auth[_0x588b('0xa')](),controller[_0x588b('0x1d')]);router['get'](_0x588b('0x1e'),auth[_0x588b('0xa')](),controller[_0x588b('0x1f')]);router[_0x588b('0x9')](_0x588b('0x20'),auth[_0x588b('0xa')](),controller[_0x588b('0x21')]);router['get'](_0x588b('0x22'),auth['isAuthenticated'](),controller[_0x588b('0x23')]);router[_0x588b('0x9')](_0x588b('0x24'),auth[_0x588b('0xa')](),controller[_0x588b('0x25')]);router[_0x588b('0x9')](_0x588b('0x26'),auth[_0x588b('0xa')](),controller[_0x588b('0x27')]);router[_0x588b('0x9')](_0x588b('0x28'),auth['isAuthenticated'](),controller[_0x588b('0x29')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x588b('0x2a')]);router[_0x588b('0x9')](_0x588b('0x2b'),auth[_0x588b('0xa')](),controller['getLists']);router[_0x588b('0x9')](_0x588b('0x2c'),auth[_0x588b('0xa')](),controller['getAgents']);router[_0x588b('0x9')](_0x588b('0x2d'),auth[_0x588b('0xa')](),controller[_0x588b('0x2e')]);router[_0x588b('0x9')](_0x588b('0x2f'),auth[_0x588b('0xa')](),controller[_0x588b('0x30')]);router['get'](_0x588b('0x31'),auth[_0x588b('0xa')](),controller[_0x588b('0x32')]);router[_0x588b('0x9')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x588b('0x33')]);router[_0x588b('0x9')](_0x588b('0x34'),auth[_0x588b('0xa')](),controller[_0x588b('0x35')]);router[_0x588b('0x9')]('/:id/chat_websites',auth[_0x588b('0xa')](),controller['getChatWebsites']);router[_0x588b('0x9')](_0x588b('0x36'),auth[_0x588b('0xa')](),controller[_0x588b('0x37')]);router[_0x588b('0x9')](_0x588b('0x38'),auth[_0x588b('0xa')](),controller[_0x588b('0x39')]);router[_0x588b('0x9')]('/:id/api_key',auth[_0x588b('0xa')](),controller[_0x588b('0x3a')]);router[_0x588b('0x3b')](_0x588b('0x13'),auth['isAuthenticated'](),controller[_0x588b('0x3c')]);router[_0x588b('0x3b')]('/',auth[_0x588b('0xa')](),controller['create']);router['post']('/create_many',auth[_0x588b('0xa')](),controller['bulkCreate']);router['post'](_0x588b('0x15'),auth[_0x588b('0xa')](),controller[_0x588b('0x3d')]);var upload=multer({'storage':multer[_0x588b('0x3e')]({'destination':function(_0x3a9633,_0x1dc395,_0x127239){_0x127239(null,path[_0x588b('0x3f')](config['root'],_0x588b('0x40')));},'filename':function(_0x26fd52,_0x4612e1,_0x54256a){_0x54256a(null,util[_0x588b('0x41')](_0x588b('0x42'),Date['now'](),_0x4612e1[_0x588b('0x43')]));}})});router[_0x588b('0x3b')](_0x588b('0xf'),upload[_0x588b('0x44')]('file'),controller['addAvatar']);router[_0x588b('0x3b')](_0x588b('0x45'),auth[_0x588b('0xa')](),controller[_0x588b('0x46')]);router[_0x588b('0x3b')]('/:id/logout',auth[_0x588b('0xa')](),controller[_0x588b('0x47')]);router[_0x588b('0x3b')]('/:id/pause',auth[_0x588b('0xa')](),controller[_0x588b('0x48')]);router['post'](_0x588b('0x49'),auth['isAuthenticated'](),controller[_0x588b('0x4a')]);router[_0x588b('0x3b')](_0x588b('0x4b'),auth[_0x588b('0xa')](),controller['addTeams']);router[_0x588b('0x3b')](_0x588b('0x4c'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x588b('0x3b')]('/:id/mail_interactions',auth[_0x588b('0xa')](),controller[_0x588b('0x4d')]);router[_0x588b('0x3b')](_0x588b('0x4e'),auth['isAuthenticated'](),controller[_0x588b('0x4f')]);router['post'](_0x588b('0x50'),auth['isAuthenticated'](),controller[_0x588b('0x51')]);router[_0x588b('0x3b')]('/:id/openchannel_interactions',auth[_0x588b('0xa')](),controller['addOpenchannelInteractions']);router['post']('/:id/whatsapp_interactions',auth[_0x588b('0xa')](),controller[_0x588b('0x52')]);router[_0x588b('0x3b')]('/:id/fax_accounts',auth[_0x588b('0xa')](),controller[_0x588b('0x53')]);router[_0x588b('0x3b')](_0x588b('0x31'),auth['isAuthenticated'](),controller[_0x588b('0x54')]);router[_0x588b('0x3b')](_0x588b('0x55'),auth[_0x588b('0xa')](),controller[_0x588b('0x56')]);router['post'](_0x588b('0x34'),auth[_0x588b('0xa')](),controller[_0x588b('0x57')]);router[_0x588b('0x3b')](_0x588b('0x58'),auth[_0x588b('0xa')](),controller[_0x588b('0x59')]);router['post']('/:id/whatsapp_accounts',auth[_0x588b('0xa')](),controller[_0x588b('0x5a')]);router[_0x588b('0x3b')](_0x588b('0x5b'),auth[_0x588b('0xa')](),controller[_0x588b('0x5c')]);router[_0x588b('0x5d')]('/:id',auth['isAuthenticated'](),controller[_0x588b('0x5e')]);router[_0x588b('0x5d')](_0x588b('0x5f'),auth[_0x588b('0xa')](),controller[_0x588b('0x60')]);router['delete'](_0x588b('0x15'),auth[_0x588b('0xa')](),controller[_0x588b('0x61')]);router[_0x588b('0x62')](_0x588b('0x4b'),auth[_0x588b('0xa')](),controller[_0x588b('0x63')]);router[_0x588b('0x62')](_0x588b('0x64'),auth[_0x588b('0xa')](),controller[_0x588b('0x65')]);router[_0x588b('0x62')](_0x588b('0x4c'),auth[_0x588b('0xa')](),controller[_0x588b('0x66')]);router[_0x588b('0x62')]('/:id/mail_interactions',auth[_0x588b('0xa')](),controller['removeMailInteractions']);router[_0x588b('0x62')](_0x588b('0x4e'),auth[_0x588b('0xa')](),controller[_0x588b('0x67')]);router[_0x588b('0x62')](_0x588b('0x50'),auth[_0x588b('0xa')](),controller[_0x588b('0x68')]);router[_0x588b('0x62')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x588b('0x69')]);router[_0x588b('0x62')](_0x588b('0x6a'),auth['isAuthenticated'](),controller[_0x588b('0x6b')]);router['delete'](_0x588b('0x2f'),auth[_0x588b('0xa')](),controller[_0x588b('0x6c')]);router[_0x588b('0x62')](_0x588b('0x31'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x588b('0x62')](_0x588b('0x55'),auth[_0x588b('0xa')](),controller[_0x588b('0x6d')]);router['delete'](_0x588b('0x34'),auth[_0x588b('0xa')](),controller[_0x588b('0x6e')]);router[_0x588b('0x62')](_0x588b('0x58'),auth[_0x588b('0xa')](),controller[_0x588b('0x6f')]);router[_0x588b('0x62')](_0x588b('0x36'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0x588b('0x62')](_0x588b('0x5b'),auth[_0x588b('0xa')](),controller[_0x588b('0x70')]);module['exports']=router; \ No newline at end of file +var _0x1123=['getOpenTabs','/:id/contacts','/:id/queues_rt','/:id/groups','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getAgents','/:id/prefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','/:id/api_key','post','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','server/files/images/','format','now','originalname','file','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addMailAccounts','addSmsAccounts','addWhatsappAccounts','put','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','path','express','Router','fs-extra','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','/:id','show','/:id/avatar'];(function(_0x191f81,_0x18ea6d){var _0x11b627=function(_0x534255){while(--_0x534255){_0x191f81['push'](_0x191f81['shift']());}};_0x11b627(++_0x18ea6d);}(_0x1123,0x118));var _0x3112=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1123[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3112('0x0'));var timeout=require('connect-timeout');var express=require(_0x3112('0x1'));var router=express[_0x3112('0x2')]();var fs_extra=require(_0x3112('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3112('0x4'));var controller=require(_0x3112('0x5'));router[_0x3112('0x6')]('/',auth[_0x3112('0x7')](),controller[_0x3112('0x8')]);router[_0x3112('0x6')](_0x3112('0x9'),auth[_0x3112('0x7')](),controller[_0x3112('0xa')]);router['get'](_0x3112('0xb'),auth[_0x3112('0x7')](),controller[_0x3112('0xc')]);router[_0x3112('0x6')](_0x3112('0xd'),auth[_0x3112('0x7')](),controller['getPresence']);router['get'](_0x3112('0xe'),auth[_0x3112('0x7')](),controller[_0x3112('0xf')]);router[_0x3112('0x6')](_0x3112('0x10'),controller['getAvatar']);router[_0x3112('0x6')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x3112('0x11')]);router[_0x3112('0x6')](_0x3112('0x12'),auth['isAuthenticated'](),controller['getContacts']);router[_0x3112('0x6')]('/:id/queues',auth[_0x3112('0x7')](),controller['getQueues']);router['get'](_0x3112('0x13'),auth[_0x3112('0x7')](),controller['getVoiceQueuesRt']);router[_0x3112('0x6')](_0x3112('0x14'),auth['isAuthenticated'](),controller['getGroups']);router[_0x3112('0x6')]('/:id/recordings',auth[_0x3112('0x7')](),controller[_0x3112('0x15')]);router['get']('/:id/screen_recordings',auth[_0x3112('0x7')](),controller[_0x3112('0x16')]);router[_0x3112('0x6')](_0x3112('0x17'),auth[_0x3112('0x7')](),controller[_0x3112('0x18')]);router['get'](_0x3112('0x19'),auth['isAuthenticated'](),controller[_0x3112('0x1a')]);router[_0x3112('0x6')](_0x3112('0x1b'),auth[_0x3112('0x7')](),controller[_0x3112('0x1c')]);router['get'](_0x3112('0x1d'),auth['isAuthenticated'](),controller[_0x3112('0x1e')]);router['get']('/:id/fax/interactions',auth[_0x3112('0x7')](),controller['getFaxInteractions']);router[_0x3112('0x6')](_0x3112('0x1f'),auth[_0x3112('0x7')](),controller['getWhatsappInteractions']);router[_0x3112('0x6')](_0x3112('0x20'),auth[_0x3112('0x7')](),controller[_0x3112('0x21')]);router['get'](_0x3112('0x22'),auth[_0x3112('0x7')](),controller['getLists']);router[_0x3112('0x6')]('/:id/agents',auth[_0x3112('0x7')](),controller[_0x3112('0x23')]);router[_0x3112('0x6')](_0x3112('0x24'),auth[_0x3112('0x7')](),controller['getVoicePrefixes']);router[_0x3112('0x6')]('/:id/fax_accounts',auth[_0x3112('0x7')](),controller['getFaxAccounts']);router[_0x3112('0x6')](_0x3112('0x25'),auth[_0x3112('0x7')](),controller[_0x3112('0x26')]);router[_0x3112('0x6')](_0x3112('0x27'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0x3112('0x6')](_0x3112('0x28'),auth[_0x3112('0x7')](),controller[_0x3112('0x29')]);router[_0x3112('0x6')](_0x3112('0x2a'),auth['isAuthenticated'](),controller[_0x3112('0x2b')]);router[_0x3112('0x6')](_0x3112('0x2c'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x3112('0x6')](_0x3112('0x2d'),auth[_0x3112('0x7')](),controller['getScheduledCalls']);router[_0x3112('0x6')](_0x3112('0x2e'),auth[_0x3112('0x7')](),controller['getApiKey']);router[_0x3112('0x2f')](_0x3112('0x12'),auth['isAuthenticated'](),controller['addContacts']);router[_0x3112('0x2f')]('/',auth[_0x3112('0x7')](),controller[_0x3112('0x30')]);router['post'](_0x3112('0x31'),auth[_0x3112('0x7')](),controller[_0x3112('0x32')]);router[_0x3112('0x2f')](_0x3112('0x33'),auth[_0x3112('0x7')](),controller[_0x3112('0x34')]);var upload=multer({'storage':multer[_0x3112('0x35')]({'destination':function(_0x1ab660,_0x2ed34f,_0x19f18c){_0x19f18c(null,path[_0x3112('0x36')](config['root'],_0x3112('0x37')));},'filename':function(_0x6b9d73,_0x32764c,_0x4d044c){_0x4d044c(null,util[_0x3112('0x38')]('%s-%s',Date[_0x3112('0x39')](),_0x32764c[_0x3112('0x3a')]));}})});router[_0x3112('0x2f')](_0x3112('0x10'),upload['single'](_0x3112('0x3b')),controller['addAvatar']);router[_0x3112('0x2f')](_0x3112('0x3c'),auth[_0x3112('0x7')](),controller['login']);router[_0x3112('0x2f')](_0x3112('0x3d'),auth[_0x3112('0x7')](),controller['logout']);router[_0x3112('0x2f')](_0x3112('0x3e'),auth[_0x3112('0x7')](),controller[_0x3112('0x3f')]);router[_0x3112('0x2f')](_0x3112('0x40'),auth[_0x3112('0x7')](),controller['unpause']);router[_0x3112('0x2f')](_0x3112('0x20'),auth[_0x3112('0x7')](),controller[_0x3112('0x41')]);router[_0x3112('0x2f')](_0x3112('0x42'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x3112('0x2f')](_0x3112('0x43'),auth[_0x3112('0x7')](),controller[_0x3112('0x44')]);router[_0x3112('0x2f')](_0x3112('0x45'),auth['isAuthenticated'](),controller[_0x3112('0x46')]);router[_0x3112('0x2f')](_0x3112('0x47'),auth[_0x3112('0x7')](),controller[_0x3112('0x48')]);router[_0x3112('0x2f')](_0x3112('0x49'),auth[_0x3112('0x7')](),controller['addOpenchannelInteractions']);router[_0x3112('0x2f')](_0x3112('0x4a'),auth['isAuthenticated'](),controller[_0x3112('0x4b')]);router['post'](_0x3112('0x4c'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0x3112('0x2f')]('/:id/mail_accounts',auth[_0x3112('0x7')](),controller[_0x3112('0x4d')]);router['post'](_0x3112('0x27'),auth[_0x3112('0x7')](),controller['addOpenchannelAccounts']);router['post'](_0x3112('0x28'),auth[_0x3112('0x7')](),controller[_0x3112('0x4e')]);router['post'](_0x3112('0x2a'),auth[_0x3112('0x7')](),controller['addChatWebsites']);router[_0x3112('0x2f')]('/:id/whatsapp_accounts',auth[_0x3112('0x7')](),controller[_0x3112('0x4f')]);router[_0x3112('0x2f')](_0x3112('0x2e'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x3112('0x50')](_0x3112('0xe'),auth[_0x3112('0x7')](),controller['update']);router[_0x3112('0x50')](_0x3112('0x51'),auth[_0x3112('0x7')](),controller[_0x3112('0x52')]);router['delete'](_0x3112('0x33'),auth[_0x3112('0x7')](),controller[_0x3112('0x53')]);router[_0x3112('0x54')](_0x3112('0x20'),auth[_0x3112('0x7')](),controller[_0x3112('0x55')]);router[_0x3112('0x54')]('/:id',auth[_0x3112('0x7')](),controller[_0x3112('0x56')]);router['delete'](_0x3112('0x42'),auth[_0x3112('0x7')](),controller[_0x3112('0x57')]);router[_0x3112('0x54')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x3112('0x58')]);router[_0x3112('0x54')](_0x3112('0x45'),auth[_0x3112('0x7')](),controller[_0x3112('0x59')]);router['delete'](_0x3112('0x47'),auth[_0x3112('0x7')](),controller[_0x3112('0x5a')]);router[_0x3112('0x54')](_0x3112('0x49'),auth[_0x3112('0x7')](),controller['removeOpenchannelInteractions']);router['delete'](_0x3112('0x4a'),auth[_0x3112('0x7')](),controller[_0x3112('0x5b')]);router[_0x3112('0x54')]('/:id/fax_accounts',auth[_0x3112('0x7')](),controller[_0x3112('0x5c')]);router[_0x3112('0x54')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x3112('0x5d')]);router['delete'](_0x3112('0x27'),auth['isAuthenticated'](),controller[_0x3112('0x5e')]);router[_0x3112('0x54')]('/:id/sms_accounts',auth[_0x3112('0x7')](),controller[_0x3112('0x5f')]);router[_0x3112('0x54')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x3112('0x60')]);router['delete'](_0x3112('0x2c'),auth[_0x3112('0x7')](),controller[_0x3112('0x61')]);router['delete'](_0x3112('0x2e'),auth[_0x3112('0x7')](),controller[_0x3112('0x62')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index eb83891..94f2afc 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0xd255ad,_0x17dc20){var _0x5f4465=function(_0xe9709d){while(--_0xe9709d){_0xd255ad['push'](_0xd255ad['shift']());}};_0x5f4465(++_0x17dc20);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0xcb91[_0xa30766];return _0x24e780;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x429f32,_0xdd2362){var _0x15b912=function(_0x28db62){while(--_0x28db62){_0x429f32['push'](_0x429f32['shift']());}};_0x15b912(++_0xdd2362);}(_0x34e8,0x12c));var _0x834e=function(_0x2a0cfc,_0x130449){_0x2a0cfc=_0x2a0cfc-0x0;var _0x234b87=_0x34e8[_0x2a0cfc];return _0x234b87;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 3898f66..625ddce 100644 --- a/server/api/user/user.controller.js +++ b/server/api/user/user.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b35=['addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','110','104','105','107','109','100','114','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','isEmpty','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','QueueId','Queue:save','voice','interface','voicePause','penalty','UserVoiceQueueRt','isValidChannel','remove','Queue:remove','addAvatar','userpic','filename','getAvatar','join','root','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','getContacts','CmContact','filters','order','sort','pick','where','merge','hasOwnProperty','CmList','List','tag','nolimit','getQueues','findOne','Unknown\x20role','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','mobile','format','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','QueuePause','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','flattenDeep','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','Query\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','removeTeams','removeAgent','destroy','VoicePrefixId','getLists','getAgents','values','send','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','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$like','$notLike','$iLike','$overlap','$contains','$any','firstName','lastName','phone','VoiceQueue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','API\x20key\x20not\x20available','whoami','getUserSetting','getPresence','teams','inbound','queues','flatten','col','toString','desc','asc','substring','uniqBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','voiceStatus','slice','charAt','field','_interactions','ui.UserId\x20=\x20?','moment','util','lodash','squel','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APINotFoundError','handleError','socket.io-emitter','redis','./user.socket','register','defaults','localhost','http','info','debug','request\x20sent','error','User,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','update','then','role','agent','emit','userNotification:recalc:','get','admin','Users','user','Agents','Telephones','telephone','ignore','map','value','find','name','UserProfileResource','status','stack','User','rawAttributes','fieldName','type','filter','password','salt','query','includeAll','include','true','UserSetting','userSetting','includes','attributes','push','findAll','openTabs','length','dataValues','sms','rows','fax','mail','openchannel','params','differenceBy','keys','intersection','fields','model','options','chat','whatsapp','all','body','describe'];(function(_0x38fa77,_0x1aaaa8){var _0x32d69b=function(_0x6cb755){while(--_0x6cb755){_0x38fa77['push'](_0x38fa77['shift']());}};_0x32d69b(++_0x1aaaa8);}(_0x1b35,0x12a));var _0x51b3=function(_0x148741,_0x1849de){_0x148741=_0x148741-0x0;var _0x48da76=_0x1b35[_0x148741];return _0x48da76;};'use strict';var moment=require(_0x51b3('0x0'));var util=require(_0x51b3('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x51b3('0x2'));var squel=require(_0x51b3('0x3'));var jayson=require(_0x51b3('0x4'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x51b3('0x5'));var logger=require(_0x51b3('0x6'))(_0x51b3('0x7'));var utils=require(_0x51b3('0x8'));var config=require(_0x51b3('0x9'));var licenseUtil=require(_0x51b3('0xa'));var APIBadRequestError=require(_0x51b3('0xb'))['APIBadRequestError'];var APINotFoundError=require(_0x51b3('0xb'))[_0x51b3('0xc')];var APIHandleError=require(_0x51b3('0xb'))[_0x51b3('0xd')];var db=require('../../mysqldb')['db'];var socket=require(_0x51b3('0xe'))(new Redis(config[_0x51b3('0xf')]));require(_0x51b3('0x10'))[_0x51b3('0x11')](socket);config[_0x51b3('0xf')]=_[_0x51b3('0x12')](config['redis'],{'host':_0x51b3('0x13'),'port':0x18eb});var amiClient=jayson['client'][_0x51b3('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x53b678,_0x3c27c1,_0x1cfd52,_0x24b5ec){return new Promise(function(_0x3f4fa6,_0x331a49){var _0x5fb370=_0x24b5ec||amiClient;return _0x5fb370['request'](_0x53b678,_0x1cfd52)['then'](function(_0x496d15){logger[_0x51b3('0x15')]('User,\x20%s,\x20%s',_0x3c27c1,'request\x20sent');logger[_0x51b3('0x16')]('User,\x20%s,\x20%s,\x20%s',_0x3c27c1,_0x51b3('0x17'),JSON['stringify'](_0x496d15));if(_0x496d15[_0x51b3('0x18')]){if(_0x496d15[_0x51b3('0x18')]['code']===0x1f4){logger[_0x51b3('0x18')](_0x51b3('0x19'),_0x3c27c1,_0x496d15[_0x51b3('0x18')]['message']);return _0x331a49(_0x496d15['error'][_0x51b3('0x1a')]);}logger[_0x51b3('0x18')](_0x51b3('0x19'),_0x3c27c1,_0x496d15[_0x51b3('0x18')][_0x51b3('0x1a')]);return _0x3f4fa6(_0x496d15[_0x51b3('0x18')][_0x51b3('0x1a')]);}else{logger[_0x51b3('0x15')](_0x51b3('0x19'),_0x3c27c1,_0x51b3('0x17'));_0x3f4fa6(_0x496d15[_0x51b3('0x1b')][_0x51b3('0x1a')]);}})[_0x51b3('0x1c')](function(_0x2c8828){logger['error']('User,\x20%s,\x20%s',_0x3c27c1,_0x2c8828);_0x331a49(_0x2c8828);});});}function respondWithStatusCode(_0x9b37c3,_0x5a6f9f){_0x5a6f9f=_0x5a6f9f||0xcc;return function(_0xa95c0f){if(_0xa95c0f){return _0x9b37c3[_0x51b3('0x1d')](_0x5a6f9f);}return _0x9b37c3['status'](_0x5a6f9f)[_0x51b3('0x1e')]();};}function respondWithResult(_0x26fc28,_0x47773e){_0x47773e=_0x47773e||0xc8;return function(_0x45703e){if(_0x45703e){return _0x26fc28['status'](_0x47773e)[_0x51b3('0x1f')](_0x45703e);}};}function respondWithFilteredResult(_0x134809,_0x334b43){return function(_0x917875){if(_0x917875){var _0x20d135=typeof _0x334b43[_0x51b3('0x20')]===_0x51b3('0x21')&&typeof _0x334b43['limit']==='undefined';var _0x246ecd=_0x917875['count'];var _0x5ccd65=_0x20d135?0x0:_0x334b43['offset'];var _0xa5f58b=_0x20d135?_0x917875[_0x51b3('0x22')]:_0x334b43['offset']+_0x334b43[_0x51b3('0x23')];var _0x46d2d1;if(_0xa5f58b>=_0x246ecd){_0xa5f58b=_0x246ecd;_0x46d2d1=0xc8;}else{_0x46d2d1=0xce;}_0x134809['status'](_0x46d2d1);return _0x134809[_0x51b3('0x24')](_0x51b3('0x25'),_0x5ccd65+'-'+_0xa5f58b+'/'+_0x246ecd)['json'](_0x917875);}return null;};}function saveUpdates(_0x563546){return function(_0x343505){if(_0x343505){return _0x343505[_0x51b3('0x26')](_0x563546)[_0x51b3('0x27')](function(_0x4a6765){if(_0x4a6765[_0x51b3('0x28')]===_0x51b3('0x29')){socket[_0x51b3('0x2a')](_0x51b3('0x2b')+_0x4a6765['id'],_0x4a6765);}return _0x4a6765;});}return null;};}function removeEntity(_0x40b6f2){return function(_0x31485a){if(_0x31485a){return _0x31485a['destroy']()[_0x51b3('0x27')](function(){var _0x6bf495=_0x31485a[_0x51b3('0x2c')]({'plain':!![]});if(_0x6bf495[_0x51b3('0x28')]===_0x51b3('0x2d'))return;var _0x44c4de=[{'name':_0x51b3('0x2e'),'value':_0x51b3('0x2f'),'ignore':!![]},{'name':_0x51b3('0x30'),'value':_0x51b3('0x29'),'ignore':![]},{'name':_0x51b3('0x31'),'value':_0x51b3('0x32'),'ignore':![]}];var _0x54901e=_(_0x44c4de)['filter'](_0x51b3('0x33'))[_0x51b3('0x34')](_0x51b3('0x35'))['value']();if(_['includes'](_0x54901e,_0x6bf495[_0x51b3('0x28')])){return;}var _0x42b8bb=_[_0x51b3('0x36')](_0x44c4de,['value',_0x6bf495[_0x51b3('0x28')]])[_0x51b3('0x37')];return db[_0x51b3('0x38')]['destroy']({'where':{'type':_0x42b8bb,'resourceId':_0x6bf495['id']}})[_0x51b3('0x27')](function(){return _0x31485a;});})[_0x51b3('0x27')](function(){_0x40b6f2[_0x51b3('0x39')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf8aae6){return function(_0x3f5b87){if(!_0x3f5b87){_0xf8aae6[_0x51b3('0x1d')](0x194);}return _0x3f5b87;};}function handleError(_0x2f0b8d,_0xa1165c){_0xa1165c=_0xa1165c||0x1f4;return function(_0xe406a6){logger[_0x51b3('0x18')](_0xe406a6[_0x51b3('0x3a')]);if(_0xe406a6[_0x51b3('0x37')]){delete _0xe406a6[_0x51b3('0x37')];}_0x2f0b8d[_0x51b3('0x39')](_0xa1165c)['send'](_0xe406a6);};}exports['index']=function(_0x14bc12,_0x24ed61){var _0x341d6e={},_0xe081ea={'count':0x0,'rows':[]};var _0x2d8f69=_(db[_0x51b3('0x3b')][_0x51b3('0x3c')])[_0x51b3('0x34')](function(_0x1c8431){return{'name':_0x1c8431[_0x51b3('0x3d')],'type':_0x1c8431[_0x51b3('0x3e')]['key']};})[_0x51b3('0x3f')](function(_0x17e254){return!_['includes']([_0x51b3('0x40'),_0x51b3('0x41')],_0x17e254['name']);})[_0x51b3('0x35')]();_0x341d6e=qs['getOptions'](_0x2d8f69,_0x14bc12);var _0x1daf55={'where':_0x341d6e['where']};return db[_0x51b3('0x3b')][_0x51b3('0x22')](_0x1daf55)[_0x51b3('0x27')](function(_0x5b2c02){_0xe081ea[_0x51b3('0x22')]=_0x5b2c02;if(_0x14bc12[_0x51b3('0x42')][_0x51b3('0x43')]){_0x341d6e[_0x51b3('0x44')]=[{'all':!![]}];}if(_0x14bc12[_0x51b3('0x42')]['userSetting']===_0x51b3('0x45')){_0x341d6e['include']=[{'model':db[_0x51b3('0x46')],'as':_0x51b3('0x47')}];}if(!_[_0x51b3('0x48')](_0x341d6e[_0x51b3('0x49')],'id')){_0x341d6e[_0x51b3('0x49')][_0x51b3('0x4a')]('id');}return db[_0x51b3('0x3b')][_0x51b3('0x4b')](_0x341d6e);})[_0x51b3('0x27')](function(_0x193dbe){_0xe081ea['rows']=_0x193dbe;if(_0x14bc12['query'][_0x51b3('0x4c')]===_0x51b3('0x45')){var _0x540bbc=[];for(var _0x59fe41=0x0;_0x59fe41<_0xe081ea['rows'][_0x51b3('0x4d')];_0x59fe41++){_0x540bbc[_0x51b3('0x4a')](get_open_tabs('chat',_0xe081ea['rows'][_0x59fe41][_0x51b3('0x4e')]));_0x540bbc[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x4f'),_0xe081ea[_0x51b3('0x50')][_0x59fe41][_0x51b3('0x4e')]));_0x540bbc[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x51'),_0xe081ea[_0x51b3('0x50')][_0x59fe41][_0x51b3('0x4e')]));_0x540bbc[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x52'),_0xe081ea[_0x51b3('0x50')][_0x59fe41]['dataValues']));_0x540bbc['push'](get_open_tabs(_0x51b3('0x53'),_0xe081ea['rows'][_0x59fe41][_0x51b3('0x4e')]));_0x540bbc[_0x51b3('0x4a')](get_open_tabs('whatsapp',_0xe081ea[_0x51b3('0x50')][_0x59fe41][_0x51b3('0x4e')]));}return Promise['all'](_0x540bbc)[_0x51b3('0x27')](function(){return _0xe081ea;});}else{return _0xe081ea;}})[_0x51b3('0x27')](respondWithFilteredResult(_0x24ed61,_0x341d6e))[_0x51b3('0x1c')](handleError(_0x24ed61,null));};exports['show']=function(_0x55e9e8,_0x512e2f){var _0x4b8a99={'raw':![],'where':{'id':_0x55e9e8[_0x51b3('0x54')]['id']}},_0x59f671={};_0x59f671['model']=_[_0x51b3('0x55')](_[_0x51b3('0x56')](db[_0x51b3('0x3b')]['rawAttributes']),[_0x51b3('0x40'),_0x51b3('0x41')]);_0x59f671[_0x51b3('0x42')]=_['keys'](_0x55e9e8['query']);_0x59f671['filters']=_['intersection'](_0x59f671['model'],_0x59f671[_0x51b3('0x42')]);_0x4b8a99[_0x51b3('0x49')]=_[_0x51b3('0x57')](_0x59f671['model'],qs[_0x51b3('0x58')](_0x55e9e8['query'][_0x51b3('0x58')]));_0x4b8a99[_0x51b3('0x49')]=_0x4b8a99['attributes'][_0x51b3('0x4d')]?_0x4b8a99[_0x51b3('0x49')]:_0x59f671[_0x51b3('0x59')];if(_0x55e9e8[_0x51b3('0x42')][_0x51b3('0x43')]){_0x4b8a99[_0x51b3('0x44')]=[{'all':!![]}];}if(_0x55e9e8['query']['userSetting']==='true'){_0x4b8a99[_0x51b3('0x44')]=[{'model':db[_0x51b3('0x46')],'as':_0x51b3('0x47')}];}_0x4b8a99=_['merge']({},_0x4b8a99,_0x55e9e8[_0x51b3('0x5a')]);if(!_[_0x51b3('0x48')](_0x4b8a99[_0x51b3('0x49')],'id')){_0x4b8a99[_0x51b3('0x49')][_0x51b3('0x4a')]('id');}return db[_0x51b3('0x3b')]['find'](_0x4b8a99)[_0x51b3('0x27')](handleEntityNotFound(_0x512e2f,null))[_0x51b3('0x27')](function(_0x3188c9){var _0x45f59b=[];values=_0x3188c9;if(_0x55e9e8[_0x51b3('0x42')][_0x51b3('0x4c')]==='true'){_0x45f59b[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x5b'),_0x3188c9[_0x51b3('0x4e')]));_0x45f59b[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x4f'),_0x3188c9[_0x51b3('0x4e')]));_0x45f59b['push'](get_open_tabs(_0x51b3('0x53'),_0x3188c9[_0x51b3('0x4e')]));_0x45f59b[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x5c'),_0x3188c9[_0x51b3('0x4e')]));_0x45f59b[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x51'),_0x3188c9[_0x51b3('0x4e')]));_0x45f59b[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x52'),_0x3188c9[_0x51b3('0x4e')]));return Promise[_0x51b3('0x5d')](_0x45f59b);}else{return values;}})['then'](function(){return values;})[_0x51b3('0x27')](respondWithResult(_0x512e2f,null))[_0x51b3('0x1c')](handleError(_0x512e2f,null));};exports['update']=function(_0x4aa8b5,_0x60ca90){if(_0x4aa8b5[_0x51b3('0x5e')]['id']){delete _0x4aa8b5[_0x51b3('0x5e')]['id'];}delete _0x4aa8b5[_0x51b3('0x5e')][_0x51b3('0x28')];return db[_0x51b3('0x3b')][_0x51b3('0x36')]({'where':{'id':_0x4aa8b5['params']['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x60ca90,null))['then'](saveUpdates(_0x4aa8b5[_0x51b3('0x5e')],null))[_0x51b3('0x27')](respondWithResult(_0x60ca90,null))[_0x51b3('0x1c')](handleError(_0x60ca90,null));};exports[_0x51b3('0x5f')]=function(_0x57b9c1,_0x37a41a){return db[_0x51b3('0x3b')]['describe']()[_0x51b3('0x27')](respondWithResult(_0x37a41a,null))[_0x51b3('0x1c')](handleError(_0x37a41a,null));};exports[_0x51b3('0x60')]=function(_0x391ccc,_0x1f876f){return db[_0x51b3('0x3b')]['find']({'where':{'id':_0x391ccc['params']['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x1f876f,null))[_0x51b3('0x27')](function(_0x353a73){if(_0x353a73){return _0x353a73['addContacts'](_0x391ccc[_0x51b3('0x5e')][_0x51b3('0x61')],_[_0x51b3('0x62')](_0x391ccc[_0x51b3('0x5e')],[_0x51b3('0x61'),'id'])||{});}})[_0x51b3('0x27')](respondWithResult(_0x1f876f,null))['catch'](handleError(_0x1f876f,null));};function validateUser(_0x247b55){return new Promise(function(_0x59180e,_0xf7de12){if(_0x247b55[_0x51b3('0x63')])return _0x59180e(_0x247b55);return db['Setting'][_0x51b3('0x64')](0x1)['then'](function(_0x78fc72){if(_0x78fc72[_0x51b3('0x65')])authService[_0x51b3('0x66')](_0x247b55[_0x51b3('0x40')]);db['User'][_0x51b3('0x67')]('internal')[_0x51b3('0x27')](function(_0x3194b8){if(_[_0x51b3('0x68')](_0x3194b8)){_0x247b55['internal']=_0x78fc72[_0x51b3('0x69')]||0x1;return;}if(_[_0x51b3('0x68')](_0x78fc72[_0x51b3('0x69')])||_0x78fc72[_0x51b3('0x69')]===_0x3194b8){_0x247b55[_0x51b3('0x63')]=_0x3194b8+0x1;return;}if(_0x78fc72[_0x51b3('0x69')]>_0x3194b8){_0x247b55[_0x51b3('0x63')]=_0x78fc72['min_internal'];return;}return db[_0x51b3('0x6a')][_0x51b3('0x42')](_0x51b3('0x6b'),{'type':db['sequelize'][_0x51b3('0x6c')]['SELECT']})[_0x51b3('0x27')](function(_0x457a96){if(_0x457a96&&_0x457a96[_0x51b3('0x4d')]){for(var _0x32070a=0x0,_0x3a1922=_0x457a96[_0x51b3('0x4d')];_0x32070a<_0x3a1922&&_[_0x51b3('0x68')](_0x247b55[_0x51b3('0x63')]);_0x32070a++){if(_0x78fc72['min_internal']<=_0x457a96[_0x32070a][_0x51b3('0x6d')]){_0x247b55['internal']=_0x457a96[_0x32070a][_0x51b3('0x6d')];}else if(_0x78fc72[_0x51b3('0x69')]>_0x457a96[_0x32070a][_0x51b3('0x6d')]&&_0x78fc72['min_internal']<=_0x457a96[_0x32070a]['to']){_0x247b55[_0x51b3('0x63')]=_0x78fc72[_0x51b3('0x69')];}}}if(_[_0x51b3('0x68')](_0x247b55[_0x51b3('0x63')])){_0x247b55[_0x51b3('0x63')]=_0x3194b8+0x1;}return _0x59180e(_0x247b55);});});})[_0x51b3('0x1c')](function(_0x59d422){_0xf7de12(_0x59d422);});});}function updateUser(_0xe7085b){return new Promise(function(_0x3d20c7,_0x4080f3){try{if(_0xe7085b[_0x51b3('0x6e')]){_0xe7085b[_0x51b3('0x6f')]=_0xe7085b[_0x51b3('0x63')];_0xe7085b[_0x51b3('0x70')]={'mailbox':_0xe7085b['internal'],'password':_0xe7085b['password'],'fullname':_0xe7085b[_0x51b3('0x71')],'email':_0xe7085b[_0x51b3('0x72')]};}if(_0xe7085b[_0x51b3('0x28')]===_0x51b3('0x29')){if(!_0xe7085b['permissions'])_0xe7085b[_0x51b3('0x73')]=[_0x51b3('0x74'),_0x51b3('0x75'),'103','113',_0x51b3('0x76'),_0x51b3('0x77'),_0x51b3('0x78'),'106',_0x51b3('0x79'),'108',_0x51b3('0x7a'),_0x51b3('0x7b'),'111',_0x51b3('0x7c'),'115'];}_0x3d20c7(_0xe7085b);}catch(_0x5139a1){_0x4080f3(_0x5139a1);}});}exports[_0x51b3('0x7d')]=function(_0x993260,_0x404bc7){if(_0x993260[_0x51b3('0x2f')][_0x51b3('0x28')]===_0x51b3('0x29'))throw new Error(_0x51b3('0x7e'));if(_0x993260['body'][_0x51b3('0x28')]==='user'&&_0x993260[_0x51b3('0x2f')][_0x51b3('0x28')]!=='admin'){throw new Error(_0x51b3('0x7f'));}if(_0x993260['body'][_0x51b3('0x28')]==='admin'&&_0x993260[_0x51b3('0x2f')][_0x51b3('0x28')]!=='admin'){throw new Error(_0x51b3('0x80'));}return licenseUtil[_0x51b3('0x81')]([_0x993260['body']])['then'](function(){return validateUser(_0x993260[_0x51b3('0x5e')]);})[_0x51b3('0x27')](function(_0x2bc02c){return updateUser(_0x2bc02c)[_0x51b3('0x27')](function(_0x4a6dec){if(_0x4a6dec['role']==='admin'){_0x4a6dec[_0x51b3('0x82')]=_0x993260[_0x51b3('0x2f')][_0x51b3('0x82')];delete _0x4a6dec[_0x51b3('0x83')];}return _0x4a6dec;});})[_0x51b3('0x27')](function(_0x288127){return db[_0x51b3('0x3b')][_0x51b3('0x7d')](_0x288127,{'include':[{'model':db['VoiceMail'],'as':_0x51b3('0x70')}]});})[_0x51b3('0x27')](function(_0x3e768b){if(_0x993260[_0x51b3('0x5e')][_0x51b3('0x28')]===_0x51b3('0x2f'))return _0x3e768b;if(_0x993260[_0x51b3('0x2f')][_0x51b3('0x28')]!==_0x51b3('0x2f'))return _0x3e768b;return db[_0x51b3('0x84')][_0x51b3('0x36')]({'where':{'name':_0x3e768b[_0x51b3('0x28')]==='agent'?_0x51b3('0x30'):'Telephones','userProfileId':_0x993260[_0x51b3('0x2f')][_0x51b3('0x83')]},'raw':!![]})[_0x51b3('0x27')](function(_0x58c5e9){if(!_0x58c5e9||_0x58c5e9[_0x51b3('0x85')]!=0x0)return _0x3e768b;return db[_0x51b3('0x38')][_0x51b3('0x7d')]({'name':_0x3e768b[_0x51b3('0x37')],'resourceId':_0x3e768b['id'],'type':_0x58c5e9['name'],'sectionId':_0x58c5e9['id']},{})[_0x51b3('0x27')](function(){return _0x3e768b;});})[_0x51b3('0x1c')](function(_0x1f2925){logger[_0x51b3('0x18')](_0x51b3('0x86'),_0x1f2925);throw _0x1f2925;});})[_0x51b3('0x27')](respondWithResult(_0x404bc7,0xc9))['catch'](handleError(_0x404bc7,null));};exports[_0x51b3('0x87')]=function(_0x3039bf,_0x1cc06a){var _0x33682d=_0x3039bf[_0x51b3('0x5e')];var _0x2fca29=[];if(_0x3039bf['user'][_0x51b3('0x28')]===_0x51b3('0x29'))throw new Error(_0x51b3('0x7e'));if(_[_0x51b3('0x88')](_0x33682d,[_0x51b3('0x28'),_0x51b3('0x2f')])&&_0x3039bf[_0x51b3('0x2f')][_0x51b3('0x28')]!=='admin'){throw new Error(_0x51b3('0x7f'));}if(_[_0x51b3('0x88')](_0x33682d,[_0x51b3('0x28'),'admin'])&&_0x3039bf[_0x51b3('0x2f')][_0x51b3('0x28')]!==_0x51b3('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x51b3('0x81')](_0x33682d)['then'](function(){return validateUser(_0x33682d[0x0]);})['then'](function(){for(var _0x4a85f8=0x1;_0x4a85f8<_0x33682d[_0x51b3('0x4d')];_0x4a85f8++){var _0x3f9e49=_0x33682d[_0x4a85f8-0x1]['internal'];if(!_0x33682d[_0x4a85f8][_0x51b3('0x63')])_0x33682d[_0x4a85f8][_0x51b3('0x63')]=_0x3f9e49+0x1;_0x2fca29[_0x51b3('0x4a')](validateUser(_0x33682d[_0x4a85f8]));}return Promise[_0x51b3('0x5d')](_0x2fca29);})[_0x51b3('0x27')](function(){_0x2fca29=[];for(var _0x3246f8=0x0;_0x3246f8<_0x33682d[_0x51b3('0x4d')];_0x3246f8++){_0x2fca29[_0x51b3('0x4a')](updateUser(_0x33682d[_0x3246f8]));}return Promise[_0x51b3('0x5d')](_0x2fca29);})[_0x51b3('0x27')](function(){_0x2fca29=_0x33682d['map'](function(_0x5413ee){return db[_0x51b3('0x3b')][_0x51b3('0x7d')](_0x5413ee,{'include':[{'model':db[_0x51b3('0x70')],'as':'VoiceMail'}]})['then'](function(_0x535c55){_0x5413ee['id']=_0x535c55['id'];return _0x5413ee;});});return Promise['all'](_0x2fca29);})['then'](function(_0x405e35){if(_0x3039bf[_0x51b3('0x5e')][_0x51b3('0x28')]===_0x51b3('0x2f'))return _0x405e35;if(_0x3039bf['user'][_0x51b3('0x28')]!==_0x51b3('0x2f'))return _0x405e35;var _0x11b23d=_[_0x51b3('0x88')](_0x405e35,function(_0x3472db){return _0x3472db[_0x51b3('0x28')]===_0x51b3('0x29')||_0x3472db['role']===_0x51b3('0x32');});if(!_0x11b23d)return _0x405e35;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0x51b3('0x30'),_0x51b3('0x31')]},'userProfileId':_0x3039bf[_0x51b3('0x2f')][_0x51b3('0x83')]},'raw':!![]})[_0x51b3('0x27')](function(_0x3e785c){if(_[_0x51b3('0x89')](_0x3e785c)||!_[_0x51b3('0x88')](_0x3e785c,[_0x51b3('0x85'),0x0]))return _0x405e35;_0x2fca29=[];var _0x5afd76=_(_0x3e785c)[_0x51b3('0x34')](function(_0x483770){if(_0x483770[_0x51b3('0x85')]===0x1)return;return _0x483770[_0x51b3('0x37')]===_0x51b3('0x30')?_0x51b3('0x29'):'telephone';})['compact']()[_0x51b3('0x35')]();for(var _0x274c4a=0x0;_0x274c4a<_0x405e35[_0x51b3('0x4d')];_0x274c4a++){if(!_[_0x51b3('0x48')](_0x5afd76,_0x405e35[_0x274c4a][_0x51b3('0x28')]))return;var _0x4f913e=_0x405e35[_0x274c4a]['role']===_0x51b3('0x29')?_0x51b3('0x30'):_0x51b3('0x31');_0x2fca29[_0x51b3('0x4a')](db[_0x51b3('0x38')][_0x51b3('0x7d')]({'name':_0x405e35[_0x274c4a]['name'],'resourceId':_0x405e35[_0x274c4a]['id'],'type':_0x4f913e,'sectionId':_['find'](_0x3e785c,['name',_0x4f913e])['id']},{}));}return Promise[_0x51b3('0x5d')](_0x2fca29);});})[_0x51b3('0x27')](respondWithResult(_0x1cc06a,0xc9))[_0x51b3('0x1c')](handleError(_0x1cc06a,null));};exports['changePassword']=function(_0x251595,_0x5c9d8d){if(_0x251595[_0x51b3('0x5e')]['id']){delete _0x251595['body']['id'];}return db[_0x51b3('0x3b')]['find']({'where':{'id':_0x251595[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](function(_0x3c277c){if(!_0x3c277c)return null;if(_0x3c277c['id']===_0x251595[_0x51b3('0x2f')]['id']){if(!_0x251595[_0x51b3('0x5e')][_0x51b3('0x8a')]||!_0x251595[_0x51b3('0x5e')][_0x51b3('0x8b')]){throw new db['Sequelize'][(_0x51b3('0x8c'))](_0x51b3('0x8d'));}if(!_0x3c277c[_0x51b3('0x8e')](_0x251595[_0x51b3('0x5e')][_0x51b3('0x8a')])){throw new db[(_0x51b3('0x8f'))]['ValidationError'](_0x51b3('0x90'));}if(_0x251595['body'][_0x51b3('0x8a')]===_0x251595[_0x51b3('0x5e')][_0x51b3('0x8b')]){throw new db[(_0x51b3('0x8f'))][(_0x51b3('0x8c'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x251595[_0x51b3('0x2f')]['role']===_0x51b3('0x2d')){if(!_0x251595[_0x51b3('0x5e')][_0x51b3('0x8b')]){throw new db[(_0x51b3('0x8f'))]['ValidationError'](_0x51b3('0x91'));}}else if(_0x251595['user']['role']===_0x51b3('0x2f')){if(!_0x251595['body']['newPassword']){throw new db[(_0x51b3('0x8f'))][(_0x51b3('0x8c'))](_0x51b3('0x91'));}if(_0x3c277c[_0x51b3('0x28')]!==_0x51b3('0x29')){throw new db[(_0x51b3('0x8f'))][(_0x51b3('0x8c'))]('Unauthorized');}}else{throw new db['Sequelize'][(_0x51b3('0x8c'))](_0x51b3('0x7e'));}return _0x3c277c;})[_0x51b3('0x27')](handleEntityNotFound(_0x5c9d8d,null))[_0x51b3('0x27')](function(_0x21479c){return db[_0x51b3('0x92')]['findOne']({'attributes':['id','securePassword',_0x51b3('0x93'),'passwordHistoryLimit']})[_0x51b3('0x27')](function(_0x352b07){if(_0x352b07['securePassword'])authService['validatePasswordPattern'](_0x251595[_0x51b3('0x5e')][_0x51b3('0x8b')]);if(!_0x352b07[_0x51b3('0x93')]||!_0x21479c[_0x51b3('0x94')])return _0x21479c;authService[_0x51b3('0x95')](_0x251595[_0x51b3('0x5e')][_0x51b3('0x8b')],_0x21479c[_0x51b3('0x94')],_0x352b07['passwordHistoryLimit']);return _0x21479c;})[_0x51b3('0x27')](saveUpdates({'password':_0x251595[_0x51b3('0x5e')]['newPassword'],'passwordResetAt':_0x251595[_0x51b3('0x2f')]['id']==_0x251595[_0x51b3('0x54')]['id']?moment():null,'previousPasswords':authService[_0x51b3('0x96')](_0x251595[_0x51b3('0x5e')][_0x51b3('0x8b')],_0x21479c['previousPasswords'])},null));})[_0x51b3('0x27')](respondWithResult(_0x5c9d8d,null))['catch'](handleError(_0x5c9d8d,null));};exports[_0x51b3('0x97')]=function(_0x374438,_0x2f8728){var _0xa19f93=_0x374438[_0x51b3('0x5e')][_0x51b3('0x98')];return db[_0x51b3('0x3b')][_0x51b3('0x36')]({'where':{'id':_0x374438[_0x51b3('0x54')]['id']},'attributes':['id','name',_0x51b3('0x28'),_0x51b3('0x99'),_0x51b3('0x9a'),'voicePause','interface']})[_0x51b3('0x27')](handleEntityNotFound(_0x2f8728,null))[_0x51b3('0x27')](function(_0x422bd0){if(_0x422bd0){if(!utils['isValidChannel'](_0xa19f93)){throw new db[(_0x51b3('0x8f'))][(_0x51b3('0x8c'))](_0x51b3('0x9b'));}return _0x422bd0[_0x51b3('0x9c')+_[_0x51b3('0x9d')](_0xa19f93[_0x51b3('0x9e')]())+_0x51b3('0x9f')](_0x374438[_0x51b3('0x5e')][_0x51b3('0x61')],{'penalty':_0x374438['body']['penalty']||0x0})[_0x51b3('0xa0')](function(_0x1faff6){for(var _0x3612f1=0x0;_0x3612f1<_0x374438[_0x51b3('0x5e')][_0x51b3('0x61')][_0x51b3('0x4d')];_0x3612f1+=0x1){var _0x46f3d4={'UserId':Number(_0x374438['params']['id'])};_0x46f3d4[_[_0x51b3('0x9d')](_0xa19f93[_0x51b3('0x9e')]())+_0x51b3('0xa1')]=Number(_0x374438['body']['ids'][_0x3612f1]);socket[_0x51b3('0x2a')](_0x51b3('0x2f')+_['capitalize'](_0xa19f93[_0x51b3('0x9e')]())+_0x51b3('0xa2'),_0x46f3d4);}return _0x1faff6;})[_0x51b3('0x27')](function(){if(_0xa19f93==='voice'){return db['VoiceQueue'][_0x51b3('0x4b')]({'where':{'id':_0x374438[_0x51b3('0x5e')][_0x51b3('0x61')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x51b3('0x27')](function(_0x5c41b1){var _0x171830=_0x422bd0[_0x51b3('0x2c')]({'plain':!![]});var _0x163b55=[];if(_0xa19f93===_0x51b3('0xa3')&&_0x171830[_0x51b3('0x28')]==='agent'&&_0x171830[_0x51b3('0x99')]){for(let _0x178f48=0x0;_0x178f48<_0x5c41b1[_0x51b3('0x4d')];_0x178f48+=0x1){_0x163b55[_0x51b3('0x4a')]({'membername':_0x171830[_0x51b3('0x37')],'UserId':_0x171830['id'],'queue_name':_0x5c41b1[_0x178f48]['name'],'VoiceQueueId':_0x5c41b1[_0x178f48]['id'],'interface':_['isNil'](_0x171830[_0x51b3('0xa4')])?util['format']('SIP/%s',_0x171830['name']):_0x171830[_0x51b3('0xa4')],'paused':_0x171830[_0x51b3('0xa5')]||![],'penalty':_0x374438[_0x51b3('0x5e')][_0x51b3('0xa6')]||0x0});}return Promise[_0x51b3('0x5d')](_0x163b55['map'](function(_0x58986a){return db[_0x51b3('0xa7')]['upsert'](_0x58986a);}));}return _0x422bd0;});}})[_0x51b3('0x27')](respondWithStatusCode(_0x2f8728,null))['catch'](handleError(_0x2f8728,null));};exports['removeQueues']=function(_0x221584,_0x5ac046){var _0x3b4f56,_0x51b433;return db['User'][_0x51b3('0x36')]({'where':{'id':_0x221584[_0x51b3('0x54')]['id']},'attributes':['id',_0x51b3('0x37'),_0x51b3('0x28')]})['then'](handleEntityNotFound(_0x5ac046,null))[_0x51b3('0x27')](function(_0x211b15){if(_0x211b15){_0x3b4f56=_0x211b15;if(!_0x221584[_0x51b3('0x42')]['channel']||!utils[_0x51b3('0xa8')](_0x221584[_0x51b3('0x42')][_0x51b3('0x98')])){throw new db[(_0x51b3('0x8f'))]['ValidationError'](_0x51b3('0x9b'));}return _0x211b15[_0x51b3('0xa9')+_[_0x51b3('0x9d')](_0x221584[_0x51b3('0x42')]['channel'][_0x51b3('0x9e')]())+_0x51b3('0x9f')](_0x221584[_0x51b3('0x42')][_0x51b3('0x61')]);}})[_0x51b3('0x27')](function(_0x1189f0){if(_['isArray'](_0x221584['query'][_0x51b3('0x61')])){for(var _0x1c934c=0x0;_0x1c934c<_0x221584[_0x51b3('0x42')]['ids'][_0x51b3('0x4d')];_0x1c934c+=0x1){_0x51b433={'UserId':Number(_0x221584[_0x51b3('0x54')]['id'])};_0x51b433[_[_0x51b3('0x9d')](_0x221584[_0x51b3('0x42')][_0x51b3('0x98')][_0x51b3('0x9e')]())+_0x51b3('0xa1')]=Number(_0x221584[_0x51b3('0x42')][_0x51b3('0x61')][_0x1c934c]);socket[_0x51b3('0x2a')](_0x51b3('0x2f')+_[_0x51b3('0x9d')](_0x221584[_0x51b3('0x42')]['channel'][_0x51b3('0x9e')]())+_0x51b3('0xaa'),_0x51b433);}}else{_0x51b433={'UserId':Number(_0x221584[_0x51b3('0x54')]['id'])};_0x51b433[_['capitalize'](_0x221584[_0x51b3('0x42')]['channel'][_0x51b3('0x9e')]())+_0x51b3('0xa1')]=Number(_0x221584[_0x51b3('0x42')][_0x51b3('0x61')]);socket[_0x51b3('0x2a')](_0x51b3('0x2f')+_[_0x51b3('0x9d')](_0x221584[_0x51b3('0x42')][_0x51b3('0x98')][_0x51b3('0x9e')]())+_0x51b3('0xaa'),_0x51b433);}return _0x1189f0;})[_0x51b3('0x27')](function(){if(_0x221584[_0x51b3('0x42')][_0x51b3('0x98')]===_0x51b3('0xa3')){return db[_0x51b3('0xa7')]['destroy']({'where':{'UserId':_0x221584[_0x51b3('0x54')]['id'],'VoiceQueueId':_0x221584['query'][_0x51b3('0x61')]},'individualHooks':!![]})['then'](function(){return _0x3b4f56;});}return _0x3b4f56;})[_0x51b3('0x27')](respondWithStatusCode(_0x5ac046,null))[_0x51b3('0x1c')](handleError(_0x5ac046,null));};exports[_0x51b3('0xab')]=function(_0x160141,_0x31e1f4){_0x160141[_0x51b3('0x5e')][_0x51b3('0xac')]=_0x160141['file'][_0x51b3('0xad')];return db[_0x51b3('0x3b')][_0x51b3('0x36')]({'where':{'id':_0x160141[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x31e1f4,null))[_0x51b3('0x27')](saveUpdates(_0x160141['body'],null))['then'](respondWithResult(_0x31e1f4,null))['catch'](handleError(_0x31e1f4,null));};exports[_0x51b3('0xae')]=function(_0x59cf86,_0x3e9abe){var _0x51d6f7=path[_0x51b3('0xaf')](config[_0x51b3('0xb0')],'server/files/images/logos/default_profile.png');return db[_0x51b3('0x3b')]['find']({'where':{'id':_0x59cf86[_0x51b3('0x54')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x51b3('0x27')](handleEntityNotFound(_0x3e9abe,null))[_0x51b3('0x27')](function(_0x4db9b4){if(_0x4db9b4){if(_[_0x51b3('0x68')](_0x4db9b4['userpic'])){return _0x3e9abe[_0x51b3('0xb1')](_0x51d6f7);}else{if(!fs[_0x51b3('0xb2')](path['join'](config[_0x51b3('0xb0')],_0x51b3('0xb3'),_0x4db9b4[_0x51b3('0xac')]))){return _0x3e9abe[_0x51b3('0xb1')](_0x51d6f7);}return _0x3e9abe[_0x51b3('0xb1')](path[_0x51b3('0xaf')](config[_0x51b3('0xb0')],'server/files/images/',_0x4db9b4['userpic']));}}})[_0x51b3('0x1c')](handleError(_0x3e9abe,null));};exports[_0x51b3('0xb4')]=function(_0xce2062,_0x3f0052){return db[_0x51b3('0x3b')][_0x51b3('0x36')]({'where':{'id':_0xce2062[_0x51b3('0x54')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x3f0052,null))[_0x51b3('0x27')](function(_0x37d407){var _0x44c962=[];values=_0x37d407[_0x51b3('0x4e')];_0x44c962[_0x51b3('0x4a')](get_open_tabs('chat',_0x37d407['dataValues']));_0x44c962[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x4f'),_0x37d407[_0x51b3('0x4e')]));_0x44c962[_0x51b3('0x4a')](get_open_tabs('openchannel',_0x37d407['dataValues']));_0x44c962[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x5c'),_0x37d407[_0x51b3('0x4e')]));_0x44c962[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x51'),_0x37d407[_0x51b3('0x4e')]));_0x44c962[_0x51b3('0x4a')](get_open_tabs(_0x51b3('0x52'),_0x37d407[_0x51b3('0x4e')]));return Promise[_0x51b3('0x5d')](_0x44c962);})[_0x51b3('0x27')](function(_0x510db3){if(_0x510db3){var _0x1374ce=_[_0x51b3('0x34')](values[_0x51b3('0xb5')],function(_0x3484ef){return{'channel':_0x51b3('0xb6'),'id':_0x3484ef['id'],'createdAt':_0x3484ef['createdAt']};});var _0x41ee05=_[_0x51b3('0x34')](values[_0x51b3('0xb7')],function(_0x1499a3){return{'channel':_0x51b3('0xb8'),'id':_0x1499a3['id'],'createdAt':_0x1499a3[_0x51b3('0xb9')]};});var _0x47f44b=_[_0x51b3('0x34')](values[_0x51b3('0xba')],function(_0xd3ab2b){return{'channel':_0x51b3('0xbb'),'id':_0xd3ab2b['id'],'createdAt':_0xd3ab2b['createdAt']};});var _0x3ece0d=_[_0x51b3('0x34')](values[_0x51b3('0xbc')],function(_0x22184f){return{'channel':'MAIL','id':_0x22184f['id'],'createdAt':_0x22184f['createdAt']};});var _0x55e3c7=_[_0x51b3('0x34')](values[_0x51b3('0xbd')],function(_0x1d6d56){return{'channel':'SMS','id':_0x1d6d56['id'],'createdAt':_0x1d6d56[_0x51b3('0xb9')]};});var _0x192bf0=_[_0x51b3('0x34')](values['WhatsappOpenTabs'],function(_0x4ef05f){return{'channel':'WHATSAPP','id':_0x4ef05f['id'],'createdAt':_0x4ef05f[_0x51b3('0xb9')]};});var _0x47ab96=_['concat'](_0x1374ce,_0x41ee05,_0x47f44b,_0x3ece0d,_0x55e3c7,_0x192bf0);var _0x45a3b1={'count':_0x47ab96[_0x51b3('0x4d')],'rows':_0x47ab96};return _0x45a3b1;}else return null;})[_0x51b3('0x27')](respondWithResult(_0x3f0052,null))[_0x51b3('0x1c')](handleError(_0x3f0052,null));};exports[_0x51b3('0xbe')]=function(_0x1b78d5,_0x56086c){var _0x36295b={};var _0x29c972={};var _0x573bef;var _0x1c5015;return db['User']['findOne']({'where':{'id':_0x1b78d5[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x56086c,null))[_0x51b3('0x27')](function(_0x56b9f6){if(_0x56b9f6){_0x573bef=_0x56b9f6;_0x29c972[_0x51b3('0x59')]=_['keys'](db[_0x51b3('0xbf')][_0x51b3('0x3c')]);_0x29c972[_0x51b3('0x42')]=_[_0x51b3('0x56')](_0x1b78d5[_0x51b3('0x42')]);_0x29c972[_0x51b3('0xc0')]=_['intersection'](_0x29c972[_0x51b3('0x59')],_0x29c972['query']);_0x36295b[_0x51b3('0x49')]=_['intersection'](_0x29c972[_0x51b3('0x59')],qs[_0x51b3('0x58')](_0x1b78d5[_0x51b3('0x42')][_0x51b3('0x58')]));_0x36295b[_0x51b3('0x49')]=_0x36295b[_0x51b3('0x49')][_0x51b3('0x4d')]?_0x36295b[_0x51b3('0x49')]:_0x29c972[_0x51b3('0x59')];_0x36295b[_0x51b3('0xc1')]=qs[_0x51b3('0xc2')](_0x1b78d5[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x36295b['where']=qs['filters'](_[_0x51b3('0xc3')](_0x1b78d5[_0x51b3('0x42')],_0x29c972[_0x51b3('0xc0')]));if(_0x1b78d5[_0x51b3('0x42')][_0x51b3('0x3f')]){_0x36295b[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x36295b[_0x51b3('0xc4')],{'$or':_[_0x51b3('0x34')](_0x36295b[_0x51b3('0x49')],function(_0x439f50){var _0x1c2caa={};_0x1c2caa[_0x439f50]={'$like':'%'+_0x1b78d5[_0x51b3('0x42')]['filter']+'%'};return _0x1c2caa;})});}_0x36295b=_[_0x51b3('0xc5')]({},_0x36295b,_0x1b78d5[_0x51b3('0x5a')]);return _0x573bef[_0x51b3('0xbe')](_0x36295b);}})[_0x51b3('0x27')](function(_0x54382c){if(_0x54382c){_0x1c5015=_0x54382c[_0x51b3('0x4d')];if(_0x1b78d5[_0x51b3('0x42')][_0x51b3('0xc6')](_0x51b3('0x43'))){_0x36295b[_0x51b3('0x44')]=[{'model':db[_0x51b3('0xc7')],'as':_0x51b3('0xc8'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0x1b78d5['query'][_0x51b3('0xc9')]?{'id':_0x1b78d5[_0x51b3('0x42')][_0x51b3('0xc9')]}:undefined,'required':_0x1b78d5[_0x51b3('0x42')][_0x51b3('0xc9')]?!![]:![]}];}if(!_0x1b78d5[_0x51b3('0x42')][_0x51b3('0xc6')](_0x51b3('0xca'))){_0x36295b[_0x51b3('0x23')]=qs[_0x51b3('0x23')](_0x1b78d5[_0x51b3('0x42')]['limit']);_0x36295b[_0x51b3('0x20')]=qs['offset'](_0x1b78d5[_0x51b3('0x42')][_0x51b3('0x20')]);}return _0x573bef[_0x51b3('0xbe')](_0x36295b);}})[_0x51b3('0x27')](function(_0x5c16a7){if(_0x5c16a7){return _0x5c16a7?{'count':_0x1c5015,'rows':_0x5c16a7}:null;}})[_0x51b3('0x27')](respondWithResult(_0x56086c,null))['catch'](handleError(_0x56086c,null));};exports[_0x51b3('0xcb')]=function(_0xcf3e7d,_0x34377e){var _0xdadad2;var _0x3a25f6={};var _0x20a6f5;return db[_0x51b3('0x3b')][_0x51b3('0xcc')]({'where':{'id':_0xcf3e7d['params']['id']},'attributes':['id',_0x51b3('0x37'),_0x51b3('0x28')]})['then'](handleEntityNotFound(_0x34377e,null))['then'](function(_0x1de46d){if(!utils[_0x51b3('0xa8')](_0xcf3e7d['query']['channel'])){throw new db[(_0x51b3('0x8f'))][(_0x51b3('0x8c'))]('Unknown\x20channel');}_0xdadad2=_0x1de46d;var _0x2fff8d={};_0x2fff8d['model']=_['keys'](db[_[_0x51b3('0x9d')](_0xcf3e7d[_0x51b3('0x42')][_0x51b3('0x98')])+'Queue'][_0x51b3('0x3c')]);_0x2fff8d['query']=_['keys'](_0xcf3e7d[_0x51b3('0x42')]);_0x2fff8d[_0x51b3('0xc0')]=_[_0x51b3('0x57')](_0x2fff8d['model'],_0x2fff8d[_0x51b3('0x42')]);_0x3a25f6[_0x51b3('0x49')]=_[_0x51b3('0x57')](_0x2fff8d['model'],qs[_0x51b3('0x58')](_0xcf3e7d['query'][_0x51b3('0x58')]));_0x3a25f6[_0x51b3('0x49')]=_0x3a25f6[_0x51b3('0x49')][_0x51b3('0x4d')]?_0x3a25f6[_0x51b3('0x49')]:_0x2fff8d[_0x51b3('0x59')];_0x3a25f6[_0x51b3('0xc1')]=qs['sort'](_0xcf3e7d[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x3a25f6['where']=qs[_0x51b3('0xc0')](_['pick'](_0xcf3e7d[_0x51b3('0x42')],_0x2fff8d[_0x51b3('0xc0')]));if(_0xcf3e7d['query'][_0x51b3('0x3f')]){_0x3a25f6[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x3a25f6[_0x51b3('0xc4')],{'$or':_[_0x51b3('0x34')](_0x3a25f6[_0x51b3('0x49')],function(_0x246fe2){var _0xae76b5={};_0xae76b5[_0x246fe2]={'$like':'%'+_0xcf3e7d[_0x51b3('0x42')]['filter']+'%'};return _0xae76b5;})});}_0x3a25f6=_[_0x51b3('0xc5')]({},_0x3a25f6,_0xcf3e7d[_0x51b3('0x5a')]);switch(_0xdadad2[_0x51b3('0x28')]){case'admin':return db[_[_0x51b3('0x9d')](_0xcf3e7d['query'][_0x51b3('0x98')])+'Queue']['findAll'](_0x3a25f6);case'user':case _0x51b3('0x29'):return _0xdadad2[_0x51b3('0x2c')+_[_0x51b3('0x9d')](_0xcf3e7d[_0x51b3('0x42')][_0x51b3('0x98')])+_0x51b3('0x9f')](_0x3a25f6);default:throw new db[(_0x51b3('0x8f'))][(_0x51b3('0x8c'))](_0x51b3('0xcd'));}})['then'](function(_0x241fba){_0x20a6f5=_0x241fba[_0x51b3('0x4d')];if(!_0xcf3e7d['query'][_0x51b3('0xc6')](_0x51b3('0xca'))){_0x3a25f6['limit']=qs['limit'](_0xcf3e7d[_0x51b3('0x42')][_0x51b3('0x23')]);_0x3a25f6[_0x51b3('0x20')]=qs[_0x51b3('0x20')](_0xcf3e7d['query'][_0x51b3('0x20')]);}switch(_0xdadad2[_0x51b3('0x28')]){case _0x51b3('0x2d'):return db[_[_0x51b3('0x9d')](_0xcf3e7d[_0x51b3('0x42')][_0x51b3('0x98')])+_0x51b3('0xce')]['findAll'](_0x3a25f6);case _0x51b3('0x2f'):case _0x51b3('0x29'):return _0xdadad2[_0x51b3('0x2c')+_[_0x51b3('0x9d')](_0xcf3e7d[_0x51b3('0x42')][_0x51b3('0x98')])+_0x51b3('0x9f')](_0x3a25f6);}})[_0x51b3('0x27')](function(_0x484472){return{'count':_0x20a6f5,'rows':_0x484472};})[_0x51b3('0x27')](respondWithResult(_0x34377e,null))[_0x51b3('0x1c')](handleError(_0x34377e,null));};exports[_0x51b3('0xcf')]=function(_0xd90a75,_0x37e898){var _0x147e97={};var _0x49b29a={};var _0x5dd8b3;var _0x942db9;return db[_0x51b3('0x3b')][_0x51b3('0xcc')]({'where':{'id':_0xd90a75[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x37e898,null))[_0x51b3('0x27')](function(_0x1345e6){if(_0x1345e6){_0x5dd8b3=_0x1345e6;_0x49b29a[_0x51b3('0x59')]=_[_0x51b3('0x56')](db[_0x51b3('0xa7')]['rawAttributes']);_0x49b29a[_0x51b3('0x42')]=_[_0x51b3('0x56')](_0xd90a75[_0x51b3('0x42')]);_0x49b29a['filters']=_[_0x51b3('0x57')](_0x49b29a[_0x51b3('0x59')],_0x49b29a['query']);_0x147e97['attributes']=_['intersection'](_0x49b29a['model'],qs[_0x51b3('0x58')](_0xd90a75[_0x51b3('0x42')][_0x51b3('0x58')]));_0x147e97[_0x51b3('0x49')]=_0x147e97[_0x51b3('0x49')][_0x51b3('0x4d')]?_0x147e97[_0x51b3('0x49')]:_0x49b29a['model'];_0x147e97[_0x51b3('0xc1')]=qs[_0x51b3('0xc2')](_0xd90a75[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x147e97[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0xd90a75['query'],_0x49b29a[_0x51b3('0xc0')]));if(_0xd90a75[_0x51b3('0x42')][_0x51b3('0x3f')]){_0x147e97[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x147e97[_0x51b3('0xc4')],{'$or':_[_0x51b3('0x34')](_0x147e97['attributes'],function(_0x591772){var _0x397cfa={};_0x397cfa[_0x591772]={'$like':'%'+_0xd90a75[_0x51b3('0x42')][_0x51b3('0x3f')]+'%'};return _0x397cfa;})});}_0x147e97=_['merge']({},_0x147e97,_0xd90a75[_0x51b3('0x5a')]);return _0x5dd8b3[_0x51b3('0xcf')](_0x147e97);}})['then'](function(_0x37e7d5){if(_0x37e7d5){_0x942db9=_0x37e7d5[_0x51b3('0x4d')];if(!_0xd90a75[_0x51b3('0x42')]['hasOwnProperty']('nolimit')){_0x147e97[_0x51b3('0x23')]=qs['limit'](_0xd90a75[_0x51b3('0x42')]['limit']);_0x147e97['offset']=qs[_0x51b3('0x20')](_0xd90a75[_0x51b3('0x42')][_0x51b3('0x20')]);}return _0x5dd8b3[_0x51b3('0xcf')](_0x147e97);}})['then'](function(_0x98220f){if(_0x98220f){return _0x98220f?{'count':_0x942db9,'rows':_0x98220f}:null;}})[_0x51b3('0x27')](respondWithResult(_0x37e898,null))[_0x51b3('0x1c')](handleError(_0x37e898,null));};exports[_0x51b3('0xd0')]=function(_0x4d151,_0xe37ff6){var _0x54aa46={};var _0x4fd2c0={};var _0x5a6c3a;var _0xebcbbc;return db[_0x51b3('0x3b')][_0x51b3('0xcc')]({'where':{'id':_0x4d151[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0xe37ff6,null))[_0x51b3('0x27')](function(_0x12083c){if(_0x12083c){_0x5a6c3a=_0x12083c;_0x4fd2c0[_0x51b3('0x59')]=_['keys'](db[_0x51b3('0xd1')][_0x51b3('0x3c')]);_0x4fd2c0[_0x51b3('0x42')]=_[_0x51b3('0x56')](_0x4d151[_0x51b3('0x42')]);_0x4fd2c0[_0x51b3('0xc0')]=_['intersection'](_0x4fd2c0[_0x51b3('0x59')],_0x4fd2c0[_0x51b3('0x42')]);_0x54aa46[_0x51b3('0x49')]=_[_0x51b3('0x57')](_0x4fd2c0[_0x51b3('0x59')],qs['fields'](_0x4d151[_0x51b3('0x42')][_0x51b3('0x58')]));_0x54aa46[_0x51b3('0x49')]=_0x54aa46[_0x51b3('0x49')]['length']?_0x54aa46[_0x51b3('0x49')]:_0x4fd2c0[_0x51b3('0x59')];_0x54aa46['order']=qs[_0x51b3('0xc2')](_0x4d151['query'][_0x51b3('0xc2')]);_0x54aa46['where']=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x4d151[_0x51b3('0x42')],_0x4fd2c0[_0x51b3('0xc0')]));if(_0x4d151[_0x51b3('0x42')][_0x51b3('0x3f')]){_0x54aa46[_0x51b3('0xc4')]=_['merge'](_0x54aa46[_0x51b3('0xc4')],{'$or':_[_0x51b3('0x34')](_0x54aa46[_0x51b3('0x49')],function(_0x4c588b){var _0x1a9a79={};_0x1a9a79[_0x4c588b]={'$like':'%'+_0x4d151[_0x51b3('0x42')]['filter']+'%'};return _0x1a9a79;})});}_0x54aa46=_['merge']({},_0x54aa46,_0x4d151['options']);return _0x5a6c3a['getGroups'](_0x54aa46);}})['then'](function(_0xabcd12){if(_0xabcd12){_0xebcbbc=_0xabcd12[_0x51b3('0x4d')];if(!_0x4d151[_0x51b3('0x42')][_0x51b3('0xc6')](_0x51b3('0xca'))){_0x54aa46[_0x51b3('0x23')]=qs[_0x51b3('0x23')](_0x4d151['query']['limit']);_0x54aa46[_0x51b3('0x20')]=qs[_0x51b3('0x20')](_0x4d151[_0x51b3('0x42')][_0x51b3('0x20')]);}return _0x5a6c3a[_0x51b3('0xd0')](_0x54aa46);}})[_0x51b3('0x27')](function(_0x4b7595){if(_0x4b7595){return _0x4b7595?{'count':_0xebcbbc,'rows':_0x4b7595}:null;}})['then'](respondWithResult(_0xe37ff6,null))[_0x51b3('0x1c')](handleError(_0xe37ff6,null));};exports[_0x51b3('0xd2')]=function(_0x4538e2,_0x2d7321){var _0x47383c={'raw':!![],'where':{}};var _0xe421d0={};var _0x1ef885={'count':0x0,'rows':[]};return db[_0x51b3('0x3b')]['findOne']({'where':{'id':_0x4538e2['params']['id']}})['then'](handleEntityNotFound(_0x2d7321,null))[_0x51b3('0x27')](function(_0x2a5d3d){if(_0x2a5d3d){_0xe421d0['model']=_[_0x51b3('0x56')](db[_0x51b3('0xd3')]['rawAttributes']);_0xe421d0['query']=_['keys'](_0x4538e2['query']);_0xe421d0[_0x51b3('0xc0')]=_[_0x51b3('0x57')](_0xe421d0[_0x51b3('0x59')],_0xe421d0[_0x51b3('0x42')]);_0x47383c['attributes']=_[_0x51b3('0x57')](_0xe421d0[_0x51b3('0x59')],qs[_0x51b3('0x58')](_0x4538e2[_0x51b3('0x42')]['fields']));_0x47383c[_0x51b3('0x49')]=_0x47383c['attributes'][_0x51b3('0x4d')]?_0x47383c[_0x51b3('0x49')]:_0xe421d0[_0x51b3('0x59')];if(!_0x4538e2[_0x51b3('0x42')][_0x51b3('0xc6')](_0x51b3('0xca'))){_0x47383c[_0x51b3('0x23')]=qs[_0x51b3('0x23')](_0x4538e2[_0x51b3('0x42')]['limit']);_0x47383c['offset']=qs[_0x51b3('0x20')](_0x4538e2[_0x51b3('0x42')][_0x51b3('0x20')]);}_0x47383c[_0x51b3('0xc1')]=qs[_0x51b3('0xc2')](_0x4538e2[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x47383c[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x4538e2[_0x51b3('0x42')],_0xe421d0[_0x51b3('0xc0')]));_0x47383c[_0x51b3('0xc4')][_0x51b3('0xd4')]=_0x2a5d3d['id'];if(_0x4538e2[_0x51b3('0x42')][_0x51b3('0x3f')]){_0x47383c[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x47383c['where'],{'$or':_[_0x51b3('0x34')](_0x47383c['attributes'],function(_0x4390bb){var _0x212b27={};_0x212b27[_0x4390bb]={'$like':'%'+_0x4538e2[_0x51b3('0x42')][_0x51b3('0x3f')]+'%'};return _0x212b27;})});}_0x47383c=_[_0x51b3('0xc5')]({},_0x47383c,_0x4538e2['options']);return db[_0x51b3('0xd3')][_0x51b3('0x22')]({'where':_0x47383c[_0x51b3('0xc4')]})['then'](function(_0x3acc9c){_0x1ef885['count']=_0x3acc9c;if(_0x4538e2[_0x51b3('0x42')][_0x51b3('0x43')]){_0x47383c[_0x51b3('0x44')]=[{'all':!![]}];}return db['VoiceRecording'][_0x51b3('0x4b')](_0x47383c);})['then'](function(_0x45aca9){_0x1ef885[_0x51b3('0x50')]=_0x45aca9;return _0x1ef885;});}})[_0x51b3('0x27')](respondWithFilteredResult(_0x2d7321,_0x47383c))['catch'](handleError(_0x2d7321,null));};exports[_0x51b3('0xd5')]=function(_0x957a9,_0x30aae5){var _0x3947f3={'raw':!![],'where':{}};var _0x413c6f={};var _0x1dc3a1={'count':0x0,'rows':[]};return db['User'][_0x51b3('0xcc')]({'where':{'id':_0x957a9[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x30aae5,null))[_0x51b3('0x27')](function(_0xffffe5){if(_0xffffe5){_0x413c6f[_0x51b3('0x59')]=_[_0x51b3('0x56')](db[_0x51b3('0xd6')][_0x51b3('0x3c')]);_0x413c6f[_0x51b3('0x42')]=_[_0x51b3('0x56')](_0x957a9[_0x51b3('0x42')]);_0x413c6f[_0x51b3('0xc0')]=_[_0x51b3('0x57')](_0x413c6f[_0x51b3('0x59')],_0x413c6f[_0x51b3('0x42')]);_0x3947f3[_0x51b3('0x49')]=_[_0x51b3('0x57')](_0x413c6f[_0x51b3('0x59')],qs[_0x51b3('0x58')](_0x957a9[_0x51b3('0x42')][_0x51b3('0x58')]));_0x3947f3['attributes']=_0x3947f3[_0x51b3('0x49')][_0x51b3('0x4d')]?_0x3947f3[_0x51b3('0x49')]:_0x413c6f[_0x51b3('0x59')];if(!_0x957a9['query'][_0x51b3('0xc6')](_0x51b3('0xca'))){_0x3947f3[_0x51b3('0x23')]=qs[_0x51b3('0x23')](_0x957a9['query'][_0x51b3('0x23')]);_0x3947f3['offset']=qs[_0x51b3('0x20')](_0x957a9[_0x51b3('0x42')][_0x51b3('0x20')]);}_0x3947f3['order']=qs[_0x51b3('0xc2')](_0x957a9[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x3947f3[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x957a9['query'],_0x413c6f['filters']));_0x3947f3[_0x51b3('0xc4')][_0x51b3('0xd4')]=_0xffffe5['id'];if(_0x957a9[_0x51b3('0x42')]['filter']){_0x3947f3[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x3947f3[_0x51b3('0xc4')],{'$or':_[_0x51b3('0x34')](_0x3947f3[_0x51b3('0x49')],function(_0x41f228){var _0x2302a3={};_0x2302a3[_0x41f228]={'$like':'%'+_0x957a9[_0x51b3('0x42')][_0x51b3('0x3f')]+'%'};return _0x2302a3;})});}_0x3947f3=_[_0x51b3('0xc5')]({},_0x3947f3,_0x957a9[_0x51b3('0x5a')]);return db[_0x51b3('0xd6')][_0x51b3('0x22')]({'where':_0x3947f3[_0x51b3('0xc4')]})[_0x51b3('0x27')](function(_0x4deb2e){_0x1dc3a1['count']=_0x4deb2e;if(_0x957a9[_0x51b3('0x42')][_0x51b3('0x43')]){_0x3947f3['include']=[{'all':!![]}];}return db[_0x51b3('0xd6')][_0x51b3('0x4b')](_0x3947f3);})[_0x51b3('0x27')](function(_0x190f3c){_0x1dc3a1[_0x51b3('0x50')]=_0x190f3c;return _0x1dc3a1;});}})[_0x51b3('0x27')](respondWithFilteredResult(_0x30aae5,_0x3947f3))[_0x51b3('0x1c')](handleError(_0x30aae5,null));};exports['getChatInteractions']=function(_0x554dde,_0xb252cc){var _0x4f3ef2={};var _0x37e786={};var _0x4882e5;var _0xe67bda;return db[_0x51b3('0x3b')][_0x51b3('0xcc')]({'where':{'id':_0x554dde[_0x51b3('0x54')]['id']}})['then'](handleEntityNotFound(_0xb252cc,null))['then'](function(_0x5b6d97){if(_0x5b6d97){_0x4882e5=_0x5b6d97;_0x37e786['model']=_[_0x51b3('0x56')](db['ChatInteraction'][_0x51b3('0x3c')]);_0x37e786[_0x51b3('0x42')]=_[_0x51b3('0x56')](_0x554dde['query']);_0x37e786['filters']=_[_0x51b3('0x57')](_0x37e786[_0x51b3('0x59')],_0x37e786['query']);_0x4f3ef2[_0x51b3('0x49')]=_[_0x51b3('0x57')](_0x37e786[_0x51b3('0x59')],qs[_0x51b3('0x58')](_0x554dde['query'][_0x51b3('0x58')]));_0x4f3ef2['attributes']=_0x4f3ef2[_0x51b3('0x49')][_0x51b3('0x4d')]?_0x4f3ef2[_0x51b3('0x49')]:_0x37e786['model'];_0x4f3ef2['order']=qs['sort'](_0x554dde[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x4f3ef2['where']=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x554dde['query'],_0x37e786[_0x51b3('0xc0')]));if(_0x554dde[_0x51b3('0x42')][_0x51b3('0x3f')]){_0x4f3ef2[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x4f3ef2[_0x51b3('0xc4')],{'$or':_[_0x51b3('0x34')](_0x4f3ef2[_0x51b3('0x49')],function(_0x10669c){var _0x10e261={};_0x10e261[_0x10669c]={'$like':'%'+_0x554dde[_0x51b3('0x42')][_0x51b3('0x3f')]+'%'};return _0x10e261;})});}_0x4f3ef2=_[_0x51b3('0xc5')]({},_0x4f3ef2,_0x554dde[_0x51b3('0x5a')]);return _0x4882e5[_0x51b3('0xd7')](_0x4f3ef2);}})[_0x51b3('0x27')](function(_0x62a4a5){if(_0x62a4a5){_0xe67bda=_0x62a4a5['length'];if(!_0x554dde['query'][_0x51b3('0xc6')]('nolimit')){_0x4f3ef2['limit']=qs[_0x51b3('0x23')](_0x554dde[_0x51b3('0x42')]['limit']);_0x4f3ef2[_0x51b3('0x20')]=qs['offset'](_0x554dde[_0x51b3('0x42')][_0x51b3('0x20')]);}return _0x4882e5['getChatInteractions'](_0x4f3ef2);}})[_0x51b3('0x27')](function(_0x2936b3){if(_0x2936b3){return _0x2936b3?{'count':_0xe67bda,'rows':_0x2936b3}:null;}})['then'](respondWithResult(_0xb252cc,null))[_0x51b3('0x1c')](handleError(_0xb252cc,null));};exports[_0x51b3('0xd8')]=function(_0x3b6ccd,_0x4b0371){var _0xfcb561={};var _0x1d9d0b={};var _0x10917c;var _0x4875fa;return db[_0x51b3('0x3b')][_0x51b3('0xcc')]({'where':{'id':_0x3b6ccd[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x4b0371,null))['then'](function(_0x585180){if(_0x585180){_0x10917c=_0x585180;_0x1d9d0b[_0x51b3('0x59')]=_[_0x51b3('0x56')](db[_0x51b3('0xd9')][_0x51b3('0x3c')]);_0x1d9d0b[_0x51b3('0x42')]=_[_0x51b3('0x56')](_0x3b6ccd['query']);_0x1d9d0b['filters']=_[_0x51b3('0x57')](_0x1d9d0b[_0x51b3('0x59')],_0x1d9d0b[_0x51b3('0x42')]);_0xfcb561[_0x51b3('0x49')]=_[_0x51b3('0x57')](_0x1d9d0b[_0x51b3('0x59')],qs['fields'](_0x3b6ccd['query'][_0x51b3('0x58')]));_0xfcb561[_0x51b3('0x49')]=_0xfcb561[_0x51b3('0x49')]['length']?_0xfcb561[_0x51b3('0x49')]:_0x1d9d0b[_0x51b3('0x59')];_0xfcb561['order']=qs[_0x51b3('0xc2')](_0x3b6ccd[_0x51b3('0x42')][_0x51b3('0xc2')]);_0xfcb561[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x3b6ccd['query'],_0x1d9d0b[_0x51b3('0xc0')]));if(_0x3b6ccd[_0x51b3('0x42')]['filter']){_0xfcb561[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0xfcb561['where'],{'$or':_[_0x51b3('0x34')](_0xfcb561[_0x51b3('0x49')],function(_0x3baf41){var _0x164b19={};_0x164b19[_0x3baf41]={'$like':'%'+_0x3b6ccd[_0x51b3('0x42')][_0x51b3('0x3f')]+'%'};return _0x164b19;})});}_0xfcb561=_[_0x51b3('0xc5')]({},_0xfcb561,_0x3b6ccd[_0x51b3('0x5a')]);return _0x10917c[_0x51b3('0xd8')](_0xfcb561);}})[_0x51b3('0x27')](function(_0x59eaf6){if(_0x59eaf6){_0x4875fa=_0x59eaf6[_0x51b3('0x4d')];if(!_0x3b6ccd[_0x51b3('0x42')]['hasOwnProperty'](_0x51b3('0xca'))){_0xfcb561['limit']=qs['limit'](_0x3b6ccd[_0x51b3('0x42')][_0x51b3('0x23')]);_0xfcb561[_0x51b3('0x20')]=qs['offset'](_0x3b6ccd['query'][_0x51b3('0x20')]);}return _0x10917c[_0x51b3('0xd8')](_0xfcb561);}})[_0x51b3('0x27')](function(_0xf5cf2b){if(_0xf5cf2b){return _0xf5cf2b?{'count':_0x4875fa,'rows':_0xf5cf2b}:null;}})[_0x51b3('0x27')](respondWithResult(_0x4b0371,null))[_0x51b3('0x1c')](handleError(_0x4b0371,null));};exports[_0x51b3('0xda')]=function(_0xb7fe15,_0x370b89){var _0x21edfe={'raw':!![],'where':{}};var _0x4f0e43={};var _0x55699d={'count':0x0,'rows':[]};return db[_0x51b3('0x3b')]['findOne']({'where':{'id':_0xb7fe15[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x370b89,null))['then'](function(_0x1f2c7c){if(_0x1f2c7c){_0x4f0e43[_0x51b3('0x59')]=_['keys'](db[_0x51b3('0xdb')][_0x51b3('0x3c')]);_0x4f0e43[_0x51b3('0x42')]=_[_0x51b3('0x56')](_0xb7fe15[_0x51b3('0x42')]);_0x4f0e43['filters']=_[_0x51b3('0x57')](_0x4f0e43[_0x51b3('0x59')],_0x4f0e43[_0x51b3('0x42')]);_0x21edfe[_0x51b3('0x49')]=_[_0x51b3('0x57')](_0x4f0e43[_0x51b3('0x59')],qs['fields'](_0xb7fe15[_0x51b3('0x42')][_0x51b3('0x58')]));_0x21edfe[_0x51b3('0x49')]=_0x21edfe['attributes'][_0x51b3('0x4d')]?_0x21edfe[_0x51b3('0x49')]:_0x4f0e43['model'];if(!_0xb7fe15['query'][_0x51b3('0xc6')](_0x51b3('0xca'))){_0x21edfe[_0x51b3('0x23')]=qs[_0x51b3('0x23')](_0xb7fe15[_0x51b3('0x42')][_0x51b3('0x23')]);_0x21edfe[_0x51b3('0x20')]=qs[_0x51b3('0x20')](_0xb7fe15[_0x51b3('0x42')]['offset']);}_0x21edfe['order']=qs[_0x51b3('0xc2')](_0xb7fe15[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x21edfe[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0xb7fe15[_0x51b3('0x42')],_0x4f0e43[_0x51b3('0xc0')]));_0x21edfe[_0x51b3('0xc4')][_0x51b3('0xd4')]=_0x1f2c7c['id'];if(_0xb7fe15[_0x51b3('0x42')][_0x51b3('0x3f')]){_0x21edfe[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x21edfe[_0x51b3('0xc4')],{'$or':_[_0x51b3('0x34')](_0x21edfe[_0x51b3('0x49')],function(_0x123f02){var _0x201dbb={};_0x201dbb[_0x123f02]={'$like':'%'+_0xb7fe15[_0x51b3('0x42')][_0x51b3('0x3f')]+'%'};return _0x201dbb;})});}_0x21edfe=_['merge']({},_0x21edfe,_0xb7fe15[_0x51b3('0x5a')]);return db['MailInteraction'][_0x51b3('0x22')]({'where':_0x21edfe[_0x51b3('0xc4')]})['then'](function(_0x561168){_0x55699d['count']=_0x561168;if(_0xb7fe15[_0x51b3('0x42')]['includeAll']){_0x21edfe['include']=[{'all':!![]}];}return db['MailInteraction'][_0x51b3('0x4b')](_0x21edfe);})['then'](function(_0x28cbd2){_0x55699d['rows']=_0x28cbd2;return _0x55699d;});}})['then'](respondWithFilteredResult(_0x370b89,_0x21edfe))[_0x51b3('0x1c')](handleError(_0x370b89,null));};exports[_0x51b3('0xdc')]=function(_0x1f2767,_0x13db5e){var _0x5efa1a={};var _0x469bca={};var _0x375bdf;var _0x14cf4e;return db[_0x51b3('0x3b')][_0x51b3('0xcc')]({'where':{'id':_0x1f2767[_0x51b3('0x54')]['id']}})['then'](handleEntityNotFound(_0x13db5e,null))['then'](function(_0x2d98c6){if(_0x2d98c6){_0x375bdf=_0x2d98c6;_0x469bca[_0x51b3('0x59')]=_[_0x51b3('0x56')](db['SmsInteraction'][_0x51b3('0x3c')]);_0x469bca[_0x51b3('0x42')]=_[_0x51b3('0x56')](_0x1f2767['query']);_0x469bca[_0x51b3('0xc0')]=_[_0x51b3('0x57')](_0x469bca[_0x51b3('0x59')],_0x469bca['query']);_0x5efa1a['attributes']=_[_0x51b3('0x57')](_0x469bca[_0x51b3('0x59')],qs[_0x51b3('0x58')](_0x1f2767['query'][_0x51b3('0x58')]));_0x5efa1a[_0x51b3('0x49')]=_0x5efa1a['attributes']['length']?_0x5efa1a[_0x51b3('0x49')]:_0x469bca[_0x51b3('0x59')];_0x5efa1a[_0x51b3('0xc1')]=qs[_0x51b3('0xc2')](_0x1f2767[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x5efa1a[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x1f2767['query'],_0x469bca[_0x51b3('0xc0')]));if(_0x1f2767[_0x51b3('0x42')][_0x51b3('0x3f')]){_0x5efa1a[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x5efa1a['where'],{'$or':_['map'](_0x5efa1a[_0x51b3('0x49')],function(_0x4d636f){var _0x41831c={};_0x41831c[_0x4d636f]={'$like':'%'+_0x1f2767['query'][_0x51b3('0x3f')]+'%'};return _0x41831c;})});}_0x5efa1a=_['merge']({},_0x5efa1a,_0x1f2767[_0x51b3('0x5a')]);return _0x375bdf['getSmsInteractions'](_0x5efa1a);}})[_0x51b3('0x27')](function(_0x4dba83){if(_0x4dba83){_0x14cf4e=_0x4dba83['length'];if(!_0x1f2767[_0x51b3('0x42')][_0x51b3('0xc6')](_0x51b3('0xca'))){_0x5efa1a[_0x51b3('0x23')]=qs[_0x51b3('0x23')](_0x1f2767[_0x51b3('0x42')][_0x51b3('0x23')]);_0x5efa1a['offset']=qs[_0x51b3('0x20')](_0x1f2767['query'][_0x51b3('0x20')]);}return _0x375bdf[_0x51b3('0xdc')](_0x5efa1a);}})['then'](function(_0x42af5f){if(_0x42af5f){return _0x42af5f?{'count':_0x14cf4e,'rows':_0x42af5f}:null;}})[_0x51b3('0x27')](respondWithResult(_0x13db5e,null))['catch'](handleError(_0x13db5e,null));};exports[_0x51b3('0xdd')]=function(_0x4a89bd,_0x1dfdc9){var _0x410301={};var _0x569c27={};var _0x3b0d88;var _0x2eddd0;return db[_0x51b3('0x3b')]['findOne']({'where':{'id':_0x4a89bd[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x1dfdc9,null))[_0x51b3('0x27')](function(_0x571905){if(_0x571905){_0x3b0d88=_0x571905;_0x569c27['model']=_[_0x51b3('0x56')](db[_0x51b3('0xde')]['rawAttributes']);_0x569c27['query']=_[_0x51b3('0x56')](_0x4a89bd[_0x51b3('0x42')]);_0x569c27[_0x51b3('0xc0')]=_[_0x51b3('0x57')](_0x569c27[_0x51b3('0x59')],_0x569c27[_0x51b3('0x42')]);_0x410301['attributes']=_[_0x51b3('0x57')](_0x569c27[_0x51b3('0x59')],qs['fields'](_0x4a89bd[_0x51b3('0x42')][_0x51b3('0x58')]));_0x410301[_0x51b3('0x49')]=_0x410301[_0x51b3('0x49')][_0x51b3('0x4d')]?_0x410301[_0x51b3('0x49')]:_0x569c27[_0x51b3('0x59')];_0x410301[_0x51b3('0xc1')]=qs[_0x51b3('0xc2')](_0x4a89bd['query'][_0x51b3('0xc2')]);_0x410301[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x4a89bd[_0x51b3('0x42')],_0x569c27[_0x51b3('0xc0')]));if(_0x4a89bd['query'][_0x51b3('0x3f')]){_0x410301['where']=_['merge'](_0x410301[_0x51b3('0xc4')],{'$or':_[_0x51b3('0x34')](_0x410301[_0x51b3('0x49')],function(_0x17308a){var _0x4b86ce={};_0x4b86ce[_0x17308a]={'$like':'%'+_0x4a89bd[_0x51b3('0x42')][_0x51b3('0x3f')]+'%'};return _0x4b86ce;})});}_0x410301=_[_0x51b3('0xc5')]({},_0x410301,_0x4a89bd['options']);return _0x3b0d88['getFaxInteractions'](_0x410301);}})[_0x51b3('0x27')](function(_0x30032e){if(_0x30032e){_0x2eddd0=_0x30032e['length'];if(!_0x4a89bd[_0x51b3('0x42')][_0x51b3('0xc6')]('nolimit')){_0x410301['limit']=qs[_0x51b3('0x23')](_0x4a89bd['query'][_0x51b3('0x23')]);_0x410301[_0x51b3('0x20')]=qs[_0x51b3('0x20')](_0x4a89bd[_0x51b3('0x42')][_0x51b3('0x20')]);}return _0x3b0d88[_0x51b3('0xdd')](_0x410301);}})[_0x51b3('0x27')](function(_0x1d566a){if(_0x1d566a){return _0x1d566a?{'count':_0x2eddd0,'rows':_0x1d566a}:null;}})[_0x51b3('0x27')](respondWithResult(_0x1dfdc9,null))[_0x51b3('0x1c')](handleError(_0x1dfdc9,null));};exports[_0x51b3('0xdf')]=function(_0x1cc26a,_0x417f4c){var _0x716e7c={};var _0x59ba23={};var _0x5e7c8c;var _0x519c2a;return db['User'][_0x51b3('0xcc')]({'where':{'id':_0x1cc26a[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x417f4c,null))[_0x51b3('0x27')](function(_0x5caae7){if(_0x5caae7){_0x5e7c8c=_0x5caae7;_0x59ba23[_0x51b3('0x59')]=_[_0x51b3('0x56')](db['WhatsappInteraction'][_0x51b3('0x3c')]);_0x59ba23['query']=_[_0x51b3('0x56')](_0x1cc26a['query']);_0x59ba23['filters']=_[_0x51b3('0x57')](_0x59ba23['model'],_0x59ba23[_0x51b3('0x42')]);_0x716e7c[_0x51b3('0x49')]=_[_0x51b3('0x57')](_0x59ba23[_0x51b3('0x59')],qs[_0x51b3('0x58')](_0x1cc26a[_0x51b3('0x42')][_0x51b3('0x58')]));_0x716e7c[_0x51b3('0x49')]=_0x716e7c['attributes'][_0x51b3('0x4d')]?_0x716e7c[_0x51b3('0x49')]:_0x59ba23[_0x51b3('0x59')];_0x716e7c[_0x51b3('0xc1')]=qs['sort'](_0x1cc26a[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x716e7c[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x1cc26a['query'],_0x59ba23[_0x51b3('0xc0')]));if(_0x1cc26a[_0x51b3('0x42')][_0x51b3('0x3f')]){_0x716e7c['where']=_['merge'](_0x716e7c[_0x51b3('0xc4')],{'$or':_[_0x51b3('0x34')](_0x716e7c[_0x51b3('0x49')],function(_0x251f33){var _0x248e2a={};_0x248e2a[_0x251f33]={'$like':'%'+_0x1cc26a[_0x51b3('0x42')][_0x51b3('0x3f')]+'%'};return _0x248e2a;})});}_0x716e7c=_['merge']({},_0x716e7c,_0x1cc26a[_0x51b3('0x5a')]);return _0x5e7c8c['getWhatsappInteractions'](_0x716e7c);}})[_0x51b3('0x27')](function(_0x43fb3c){if(_0x43fb3c){_0x519c2a=_0x43fb3c[_0x51b3('0x4d')];if(!_0x1cc26a['query']['hasOwnProperty'](_0x51b3('0xca'))){_0x716e7c[_0x51b3('0x23')]=qs[_0x51b3('0x23')](_0x1cc26a[_0x51b3('0x42')][_0x51b3('0x23')]);_0x716e7c[_0x51b3('0x20')]=qs['offset'](_0x1cc26a[_0x51b3('0x42')][_0x51b3('0x20')]);}return _0x5e7c8c[_0x51b3('0xdf')](_0x716e7c);}})[_0x51b3('0x27')](function(_0x547db8){if(_0x547db8){return _0x547db8?{'count':_0x519c2a,'rows':_0x547db8}:null;}})[_0x51b3('0x27')](respondWithResult(_0x417f4c,null))[_0x51b3('0x1c')](handleError(_0x417f4c,null));};exports[_0x51b3('0xe0')]=function(_0xb2b25b,_0x1ba672,_0x36d2e6){var _0xe85e15;var _0x5727ed;var _0x562642;var _0x414752=!_[_0x51b3('0x68')](_0xb2b25b['params']['id'])?_0xb2b25b[_0x51b3('0x54')]['id']:!_[_0x51b3('0x68')](_0xb2b25b[_0x51b3('0x2f')]['id'])?_0xb2b25b[_0x51b3('0x2f')]['id']:null;return db[_0x51b3('0x3b')]['find']({'where':{'id':_0x414752,'role':{'$or':[_0x51b3('0x2d'),_0x51b3('0x2f'),_0x51b3('0x29')]}},'attributes':['id','name','phone',_0x51b3('0xe1'),'role',_0x51b3('0x63'),_0x51b3('0x9a')]})[_0x51b3('0x27')](function(_0x120b15){if(_0x120b15){if(_0x120b15[_0x51b3('0x28')]===_0x51b3('0x29')){_0xe85e15=_0x120b15;if(_0xb2b25b[_0x51b3('0x5e')][_0x51b3('0xa4')]){_0x562642=util[_0x51b3('0xe2')](_0x51b3('0xe3'),_0xe85e15[_0xb2b25b[_0x51b3('0x5e')][_0x51b3('0xa4')]]);}else if(_0xb2b25b[_0x51b3('0x5e')][_0x51b3('0xe4')]){_0x562642=util[_0x51b3('0xe2')](_0x51b3('0xe5'),_0xb2b25b[_0x51b3('0x5e')][_0x51b3('0xe4')]);}else{_0x562642=util[_0x51b3('0xe2')](_0x51b3('0xe5'),_0xe85e15['name']);}socket['to'](util[_0x51b3('0xe2')](_0x51b3('0xe6'),_0xe85e15[_0x51b3('0x37')]))[_0x51b3('0x2a')](_0x51b3('0xe7'),{'user':{'id':_0xe85e15['id'],'name':_0xe85e15[_0x51b3('0x37')]},'ip':_0xb2b25b['headers'][_0x51b3('0xe8')]||_0xb2b25b[_0x51b3('0xe9')][_0x51b3('0xea')]||_0xb2b25b['socket'][_0x51b3('0xea')]||_0xb2b25b[_0x51b3('0xe9')][_0x51b3('0xeb')]['remoteAddress']});return db[_0x51b3('0xa7')]['destroy']({'where':{'membername':_0xe85e15[_0x51b3('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x51b3('0x8f'))][(_0x51b3('0x8c'))](_0x51b3('0xec'));}})[_0x51b3('0x27')](function(){if(_0xe85e15){return _0xe85e15[_0x51b3('0xed')]({'raw':!![]});}})[_0x51b3('0x27')](function(_0x40162c){if(_0xe85e15){if(_0x40162c){_0x5727ed=_0x40162c;if(_0x5727ed['length']){var _0x21eb39=_0x5727ed[_0x51b3('0x34')](function(_0x3a788b){var _0x3f6ada={'membername':_0xe85e15[_0x51b3('0x37')],'UserId':_0xe85e15['id'],'queue_name':_0x3a788b[_0x51b3('0x37')],'VoiceQueueId':_0x3a788b['id'],'interface':_0x562642,'paused':_0xe85e15[_0x51b3('0x9a')]||![],'penalty':_0x3a788b[_0x51b3('0xee')]||0x0};return db[_0x51b3('0xa7')][_0x51b3('0xef')](_0x3f6ada);});return Promise[_0x51b3('0x5d')](_0x21eb39);}}}})[_0x51b3('0x27')](function(){if(_0xe85e15){return db[_0x51b3('0xf0')][_0x51b3('0x4b')]({'where':{'membername':_0xe85e15[_0x51b3('0x37')],'exitAt':null}});}})[_0x51b3('0x27')](function(_0x75b9d){if(_0xe85e15){var _0x3a12c8=[];_0x75b9d[_0x51b3('0xf1')](function(_0x3f3688){_0x3a12c8['push'](_0x3f3688['update']({'exitAt':moment()[_0x51b3('0xe2')](_0x51b3('0xf2'))}));});return Promise[_0x51b3('0x5d')](_0x3a12c8);}})[_0x51b3('0x27')](function(){if(_0xe85e15){var _0x2ce602=[];var _0x1ad1ff=[];var _0x34f453=utils[_0x51b3('0xf3')]();var _0x36ad07={'membername':_0xe85e15[_0x51b3('0x37')],'interface':_0x562642,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xe85e15['role'],'internal':_0xe85e15['internal']};_0x34f453[_0x51b3('0xf1')](function(_0xc73bbf){_0x2ce602['push'](_[_0x51b3('0xc5')]({'channel':_0xc73bbf,'type':_0x51b3('0xf4'),'data1':_0xb2b25b[_0x51b3('0x5e')][_0x51b3('0xf5')],'data2':_0x562642},_0x36ad07));if(_0xe85e15['loginInPause']){_0x1ad1ff[_0x51b3('0x4a')](_[_0x51b3('0xc5')]({'channel':_0xc73bbf,'type':_0x51b3('0xf6'),'data1':_0x51b3('0xf7')},_0x36ad07));}});return db[_0x51b3('0xf0')][_0x51b3('0x87')](_0x2ce602[_0x51b3('0xf8')](_0x1ad1ff),{'individualHooks':!![]});}})[_0x51b3('0x27')](function(){if(_0xe85e15){return _0xe85e15[_0x51b3('0x26')]({'online':!![],'lastLoginAt':moment()[_0x51b3('0xe2')](_0x51b3('0xf2')),'voicePause':_0xe85e15['loginInPause']||![],'mailPause':_0xe85e15[_0x51b3('0x9a')]||![],'chatPause':_0xe85e15[_0x51b3('0x9a')]||![],'faxPause':_0xe85e15[_0x51b3('0x9a')]||![],'smsPause':_0xe85e15[_0x51b3('0x9a')]||![],'openchannelPause':_0xe85e15[_0x51b3('0x9a')]||![],'whatsappPause':_0xe85e15[_0x51b3('0x9a')]||![],'pauseType':_0xe85e15[_0x51b3('0x9a')]?'LOGININPAUSE':null,'interface':_0x562642,'lastPauseAt':moment()[_0x51b3('0xe2')](_0x51b3('0xf2'))});}})[_0x51b3('0x27')](function(_0x1fe844){if(_0xb2b25b[_0x51b3('0xf9')]){return _0x36d2e6();}else{return Promise[_0x51b3('0xfa')](_0x1fe844)[_0x51b3('0x27')](respondWithResult(_0x1ba672,null));}})[_0x51b3('0x1c')](handleError(_0x1ba672,null));};exports[_0x51b3('0xfb')]=function(_0x2a3515,_0x4ee935){var _0x2f074b;return db['User'][_0x51b3('0x36')]({'where':{'id':_0x2a3515['params']['id'],'role':'agent'},'attributes':['id',_0x51b3('0x37'),_0x51b3('0x28')]})[_0x51b3('0x27')](handleEntityNotFound(_0x4ee935,null))[_0x51b3('0x27')](function(_0x25c2c5){if(_0x25c2c5){_0x2f074b=_0x25c2c5;return db[_0x51b3('0xa7')]['destroy']({'where':{'membername':_0x2f074b[_0x51b3('0x37')]},'individualHooks':!![]});}})[_0x51b3('0x27')](function(){return db[_0x51b3('0xf0')]['findAll']({'where':{'membername':_0x2f074b[_0x51b3('0x37')],'exitAt':null}});})[_0x51b3('0x27')](function(_0x3a9d9c){var _0x3d9a7b=[];_0x3a9d9c[_0x51b3('0xf1')](function(_0x58c33a){_0x3d9a7b[_0x51b3('0x4a')](_0x58c33a[_0x51b3('0x26')]({'exitAt':moment()['format'](_0x51b3('0xf2'))}));});return Promise[_0x51b3('0x5d')](_0x3d9a7b);})[_0x51b3('0x27')](function(){return _0x2f074b[_0x51b3('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x51b3('0x27')](respondWithResult(_0x4ee935,null))[_0x51b3('0x1c')](handleError(_0x4ee935,null));};exports['pause']=function(_0x34dc4b,_0x3dd3f5){var _0x434bd3;return db[_0x51b3('0xa7')][_0x51b3('0x26')]({'paused':0x1},{'where':{'UserId':_0x34dc4b[_0x51b3('0x54')]['id']},'individualHooks':!![]})[_0x51b3('0x27')](function(){return db[_0x51b3('0x3b')][_0x51b3('0x36')]({'where':{'id':_0x34dc4b[_0x51b3('0x54')]['id'],'role':'agent'},'attributes':['id',_0x51b3('0x37'),_0x51b3('0x28'),_0x51b3('0x63'),_0x51b3('0xa4'),'online']});})[_0x51b3('0x27')](handleEntityNotFound(_0x3dd3f5,null))[_0x51b3('0x27')](function(_0x1b7c22){if(_0x1b7c22){_0x434bd3=_0x1b7c22;return respondWithRpcPromise(_0x51b3('0xfc'),_0x51b3('0xfd'),{'id':_0x434bd3['id'],'name':_0x434bd3[_0x51b3('0x37')],'pause':!![]});}})[_0x51b3('0x27')](function(){if(_0x434bd3){return db['MemberReport'][_0x51b3('0x4b')]({'where':{'membername':_0x434bd3['name'],'type':_0x51b3('0xf6'),'exitAt':null}});}})[_0x51b3('0x27')](function(_0x365f2f){if(_0x365f2f[_0x51b3('0x4d')]){var _0x12a860=moment()[_0x51b3('0xe2')](_0x51b3('0xf2'));for(var _0x333bc0=0x0,_0x3fb232=_0x365f2f[_0x51b3('0x4d')];_0x333bc0<_0x3fb232;_0x333bc0++){_0x365f2f[_0x333bc0][_0x51b3('0xfe')]({'exitAt':_0x12a860});}}})[_0x51b3('0x27')](function(){var _0x1e9829=[];var _0x5b06b1=utils['getChannels']();_0x5b06b1[_0x51b3('0xf1')](function(_0x227974){_0x1e9829[_0x51b3('0x4a')]({'channel':_0x227974,'membername':_0x434bd3[_0x51b3('0x37')],'interface':_[_0x51b3('0x68')](_0x434bd3[_0x51b3('0xa4')])?util[_0x51b3('0xe2')]('SIP/%s',_0x434bd3[_0x51b3('0x37')]):_0x434bd3[_0x51b3('0xa4')],'type':'PAUSE','enterAt':moment()[_0x51b3('0xe2')](_0x51b3('0xf2')),'data1':_0x34dc4b[_0x51b3('0x5e')]['type']||_0x51b3('0xff'),'role':_0x434bd3[_0x51b3('0x28')],'internal':_0x434bd3[_0x51b3('0x63')]});});return db['MemberReport']['bulkCreate'](_0x1e9829,{'individualHooks':!![]});})['then'](function(){return _0x434bd3[_0x51b3('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x34dc4b[_0x51b3('0x5e')][_0x51b3('0x3e')]||_0x51b3('0xff'),'lastPauseAt':moment()[_0x51b3('0xe2')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x51b3('0x27')](respondWithResult(_0x3dd3f5,null))[_0x51b3('0x1c')](handleError(_0x3dd3f5,null));};exports[_0x51b3('0x100')]=function(_0x1f077e,_0xa13389){if(_0x1f077e[_0x51b3('0x5e')][_0x51b3('0x98')]&&!utils[_0x51b3('0xa8')](_0x1f077e[_0x51b3('0x5e')][_0x51b3('0x98')])){throw new APIBadRequestError(util['format'](_0x51b3('0x101'),_0x1f077e['body'][_0x51b3('0x98')]));}return db[_0x51b3('0x3b')][_0x51b3('0x36')]({'where':{'id':_0x1f077e[_0x51b3('0x54')]['id']},'attributes':['id',_0x51b3('0x37'),_0x51b3('0x28'),'internal','interface',_0x51b3('0x99'),_0x51b3('0xa5'),_0x51b3('0x102'),_0x51b3('0x103'),_0x51b3('0x104'),_0x51b3('0x105'),_0x51b3('0x106'),_0x51b3('0x107'),_0x51b3('0x108'),_0x51b3('0x109')]})[_0x51b3('0x27')](function(_0x3ff02d){if(!_0x3ff02d){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x1f077e[_0x51b3('0x54')]['id']));}return _0x3ff02d['unpause'](_0x1f077e[_0x51b3('0x5e')][_0x51b3('0x98')]);})[_0x51b3('0x27')](respondWithResult(_0xa13389,null))[_0x51b3('0x1c')](APIHandleError(_0xa13389));};exports[_0x51b3('0x10a')]=function(_0x233c25,_0x50f3ba){var _0x2f7d84={};var _0x42da4d={};var _0x599c58;var _0x1917f2;return db[_0x51b3('0x3b')]['findOne']({'where':{'id':_0x233c25[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x50f3ba,null))['then'](function(_0x4083fe){if(_0x4083fe){_0x599c58=_0x4083fe;_0x42da4d['model']=_[_0x51b3('0x56')](db[_0x51b3('0x10b')]['rawAttributes']);_0x42da4d[_0x51b3('0x42')]=_[_0x51b3('0x56')](_0x233c25['query']);_0x42da4d[_0x51b3('0xc0')]=_[_0x51b3('0x57')](_0x42da4d['model'],_0x42da4d['query']);_0x2f7d84[_0x51b3('0x49')]=_[_0x51b3('0x57')](_0x42da4d[_0x51b3('0x59')],qs['fields'](_0x233c25['query'][_0x51b3('0x58')]));_0x2f7d84['attributes']=_0x2f7d84[_0x51b3('0x49')]['length']?_0x2f7d84[_0x51b3('0x49')]:_0x42da4d[_0x51b3('0x59')];_0x2f7d84[_0x51b3('0xc1')]=qs[_0x51b3('0xc2')](_0x233c25[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x2f7d84[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x233c25['query'],_0x42da4d[_0x51b3('0xc0')]));if(_0x233c25['query'][_0x51b3('0x3f')]){_0x2f7d84[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x2f7d84['where'],{'$or':_[_0x51b3('0x34')](_0x2f7d84[_0x51b3('0x49')],function(_0xdf6488){var _0x9422a6={};_0x9422a6[_0xdf6488]={'$like':'%'+_0x233c25[_0x51b3('0x42')][_0x51b3('0x3f')]+'%'};return _0x9422a6;})});}_0x2f7d84=_[_0x51b3('0xc5')]({},_0x2f7d84,_0x233c25[_0x51b3('0x5a')]);return _0x599c58[_0x51b3('0x10a')](_0x2f7d84);}})['then'](function(_0xf680){if(_0xf680){_0x1917f2=_0xf680[_0x51b3('0x4d')];if(!_0x233c25[_0x51b3('0x42')][_0x51b3('0xc6')](_0x51b3('0xca'))){_0x2f7d84[_0x51b3('0x23')]=qs['limit'](_0x233c25['query'][_0x51b3('0x23')]);_0x2f7d84[_0x51b3('0x20')]=qs[_0x51b3('0x20')](_0x233c25[_0x51b3('0x42')][_0x51b3('0x20')]);}return _0x599c58['getTeams'](_0x2f7d84);}})[_0x51b3('0x27')](function(_0x2d132d){if(_0x2d132d){return _0x2d132d?{'count':_0x1917f2,'rows':_0x2d132d}:null;}})[_0x51b3('0x27')](respondWithResult(_0x50f3ba,null))[_0x51b3('0x1c')](handleError(_0x50f3ba,null));};exports[_0x51b3('0x10c')]=function(_0x293555,_0x266122){var _0x2630e8=_0x293555[_0x51b3('0x54')]['id'];var _0x5616d2=_0x293555[_0x51b3('0x5e')]?_0x293555[_0x51b3('0x5e')]['ids']:null;var _0x2487d6=[];return Promise[_0x51b3('0xfa')]()[_0x51b3('0x27')](function(){if(!_0x5616d2)throw new APIBadRequestError(_0x51b3('0x10d'));})[_0x51b3('0x27')](function(){return db[_0x51b3('0x3b')][_0x51b3('0xcc')]({'where':{'id':_0x2630e8}});})[_0x51b3('0x27')](function(_0x562491){if(!_0x562491)throw new APINotFoundError(util[_0x51b3('0xe2')]('User\x20with\x20id\x20%s\x20not\x20found',_0x293555[_0x51b3('0x54')]['id']));return db[_0x51b3('0x6a')][_0x51b3('0x10e')](function(_0x4036b5){return _0x562491[_0x51b3('0x10c')](_0x5616d2,{'transaction':_0x4036b5})[_0x51b3('0x27')](function(){return db[_0x51b3('0x10b')]['findAll']({'where':{'id':{'$in':_0x5616d2}}});})[_0x51b3('0x27')](function(_0x8d0641){var _0x5ad6d1=_[_0x51b3('0x34')](_0x8d0641,function(_0x41ff0c){return _0x41ff0c[_0x51b3('0x10f')]();});return Promise[_0x51b3('0x5d')](_0x5ad6d1);})[_0x51b3('0x27')](function(_0x22ccba){_0x2487d6=_[_0x51b3('0x110')](_0x22ccba);var _0x3a3990=_[_0x51b3('0x34')](_0x2487d6,function(_0x7dde56){return _0x7dde56['addAgent'](_0x562491['id'],{'transaction':_0x4036b5});});return Promise[_0x51b3('0x5d')](_0x3a3990);})['then'](function(){if(!_0x562491[_0x51b3('0x99')])return;var _0x420bb3=_[_0x51b3('0x3f')](_0x2487d6,function(_0x1169dc){return _0x1169dc[_0x51b3('0x111')]('channel')===_0x51b3('0x112');});var _0x14bc1d=_[_0x51b3('0x34')](_0x420bb3,function(_0x34eaad){return db[_0x51b3('0xa7')][_0x51b3('0xef')]({'membername':_0x562491[_0x51b3('0x37')],'UserId':_0x562491['id'],'queue_name':_0x34eaad[_0x51b3('0x37')],'VoiceQueueId':_0x34eaad['id'],'interface':_['isNil'](_0x562491['interface'])?util[_0x51b3('0xe2')](_0x51b3('0xe5'),_0x562491[_0x51b3('0x37')]):_0x562491['interface'],'paused':_0x562491['voicePause']||![],'penalty':_0x562491['penalty']},{'transaction':_0x4036b5});});return Promise['all'](_0x14bc1d);})[_0x51b3('0x27')](function(){return db[_0x51b3('0x113')][_0x51b3('0x4b')]({'where':{'teamId':{'$in':_0x5616d2}}});})[_0x51b3('0x27')](function(_0x20fdb5){var _0x5f2a29=_[_0x51b3('0x34')](_0x20fdb5,function(_0x290122){return db[_0x51b3('0x114')][_0x51b3('0x7d')]({'UserId':_0x562491['id'],'VoicePrefixId':_0x290122['VoicePrefixId']},{'transaction':_0x4036b5});});return Promise[_0x51b3('0x5d')](_0x5f2a29);});});})[_0x51b3('0x27')](function(){for(var _0xb46e15=0x0;_0xb46e15<_0x2487d6[_0x51b3('0x4d')];_0xb46e15++){var _0x26a272=_0x2487d6[_0xb46e15]['getDataValue'](_0x51b3('0x98'));var _0x1099e0=_0x26a272+_0x51b3('0xa1');socket[_0x51b3('0x2a')]('user'+_0x26a272+_0x51b3('0xa2'),{'UserId':_0x2630e8,['queueField']:_0x2487d6[_0xb46e15]['id']});}})['then'](respondWithStatusCode(_0x266122,null))[_0x51b3('0x1c')](APIHandleError(_0x266122));};exports['removeTeams']=function(_0xc20280,_0x4cbec8){var _0x540d2f=_0xc20280[_0x51b3('0x54')]['id'];var _0x1faf3f=null;if(_0xc20280['query'][_0x51b3('0x61')]){_0x1faf3f=_['isArray'](_0xc20280[_0x51b3('0x42')]['ids'])?_0xc20280['query'][_0x51b3('0x61')]:[_0xc20280[_0x51b3('0x42')][_0x51b3('0x61')]];}var _0x18bcb0=[];return Promise[_0x51b3('0xfa')]()[_0x51b3('0x27')](function(){if(!_0x1faf3f)throw new APIBadRequestError(_0x51b3('0x115'));})[_0x51b3('0x27')](function(){return db['User'][_0x51b3('0xcc')]({'where':{'id':_0x540d2f}});})[_0x51b3('0x27')](function(_0xef0bdf){if(!_0xef0bdf)throw new APINotFoundError(util[_0x51b3('0xe2')](_0x51b3('0x116'),_0xc20280['params']['id']));return db[_0x51b3('0x6a')][_0x51b3('0x10e')](function(_0x499590){return _0xef0bdf[_0x51b3('0x117')](_0x1faf3f,{'transaction':_0x499590})[_0x51b3('0x27')](function(){return db[_0x51b3('0x10b')][_0x51b3('0x4b')]({'where':{'id':{'$in':_0x1faf3f}}});})[_0x51b3('0x27')](function(_0x2e2026){var _0x42a53e=_['map'](_0x2e2026,function(_0xf4d110){return _0xf4d110[_0x51b3('0x10f')]();});return Promise[_0x51b3('0x5d')](_0x42a53e);})[_0x51b3('0x27')](function(_0x1b8470){_0x18bcb0=_[_0x51b3('0x110')](_0x1b8470);var _0x3db702=_[_0x51b3('0x34')](_0x18bcb0,function(_0x324478){return _0x324478[_0x51b3('0x118')](_0xef0bdf['id'],{'transaction':_0x499590});});return Promise[_0x51b3('0x5d')](_0x3db702);})[_0x51b3('0x27')](function(){if(!_0xef0bdf[_0x51b3('0x99')])return;var _0x179643=_['filter'](_0x18bcb0,function(_0x56ef8e){return _0x56ef8e[_0x51b3('0x111')](_0x51b3('0x98'))===_0x51b3('0x112');});var _0x2e8f29=_['map'](_0x179643,function(_0x13dcf4){return db[_0x51b3('0xa7')][_0x51b3('0x119')]({'where':{'VoiceQueueId':_0x13dcf4['id'],'UserId':_0xef0bdf['id']},'transaction':_0x499590});});return Promise[_0x51b3('0x5d')](_0x2e8f29);})['then'](function(){return db[_0x51b3('0x113')]['findAll']({'where':{'teamId':{'$in':_0x1faf3f}}});})[_0x51b3('0x27')](function(_0x18f5a7){var _0x3104df=_[_0x51b3('0x34')](_0x18f5a7,function(_0x8b7b50){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0xef0bdf['id'],'VoicePrefixId':_0x8b7b50[_0x51b3('0x11a')]}},{'transaction':_0x499590});});return Promise[_0x51b3('0x5d')](_0x3104df);});});})[_0x51b3('0x27')](function(){for(var _0x2ed257=0x0;_0x2ed257<_0x18bcb0[_0x51b3('0x4d')];_0x2ed257++){var _0x2194d4=_0x18bcb0[_0x2ed257][_0x51b3('0x111')](_0x51b3('0x98'));var _0xac499a=_0x2194d4+_0x51b3('0xa1');socket[_0x51b3('0x2a')]('user'+_0x2194d4+_0x51b3('0xaa'),{'UserId':_0x540d2f,['queueField']:_0x18bcb0[_0x2ed257]['id']});}})[_0x51b3('0x27')](respondWithStatusCode(_0x4cbec8,null))['catch'](APIHandleError(_0x4cbec8));};exports[_0x51b3('0x11b')]=function(_0x2112bd,_0x30f99f){var _0x406bfa={};var _0x1ef049={};var _0x5db1ff;var _0x55cce9;return db[_0x51b3('0x3b')][_0x51b3('0xcc')]({'where':{'id':_0x2112bd[_0x51b3('0x54')]['id']}})[_0x51b3('0x27')](handleEntityNotFound(_0x30f99f,null))['then'](function(_0x258403){if(_0x258403){_0x5db1ff=_0x258403;_0x1ef049[_0x51b3('0x59')]=_['keys'](db[_0x51b3('0xc7')][_0x51b3('0x3c')]);_0x1ef049[_0x51b3('0x42')]=_['keys'](_0x2112bd[_0x51b3('0x42')]);_0x1ef049['filters']=_[_0x51b3('0x57')](_0x1ef049[_0x51b3('0x59')],_0x1ef049['query']);_0x406bfa['attributes']=_[_0x51b3('0x57')](_0x1ef049[_0x51b3('0x59')],qs[_0x51b3('0x58')](_0x2112bd[_0x51b3('0x42')][_0x51b3('0x58')]));_0x406bfa[_0x51b3('0x49')]=_0x406bfa[_0x51b3('0x49')][_0x51b3('0x4d')]?_0x406bfa[_0x51b3('0x49')]:_0x1ef049['model'];_0x406bfa[_0x51b3('0xc1')]=qs[_0x51b3('0xc2')](_0x2112bd[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x406bfa[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x2112bd[_0x51b3('0x42')],_0x1ef049[_0x51b3('0xc0')]));if(_0x2112bd[_0x51b3('0x42')][_0x51b3('0x3f')]){_0x406bfa[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x406bfa[_0x51b3('0xc4')],{'$or':_[_0x51b3('0x34')](_0x406bfa[_0x51b3('0x49')],function(_0x1b39cb){var _0x42796={};_0x42796[_0x1b39cb]={'$like':'%'+_0x2112bd[_0x51b3('0x42')][_0x51b3('0x3f')]+'%'};return _0x42796;})});}_0x406bfa=_['merge']({},_0x406bfa,_0x2112bd['options']);return _0x5db1ff[_0x51b3('0x11b')](_0x406bfa);}})['then'](function(_0x3fd22a){if(_0x3fd22a){_0x55cce9=_0x3fd22a[_0x51b3('0x4d')];if(!_0x2112bd[_0x51b3('0x42')][_0x51b3('0xc6')](_0x51b3('0xca'))){_0x406bfa['limit']=qs['limit'](_0x2112bd[_0x51b3('0x42')][_0x51b3('0x23')]);_0x406bfa['offset']=qs['offset'](_0x2112bd['query']['offset']);}return _0x5db1ff[_0x51b3('0x11b')](_0x406bfa);}})[_0x51b3('0x27')](function(_0xcc2df3){if(_0xcc2df3){return _0xcc2df3?{'count':_0x55cce9,'rows':_0xcc2df3}:null;}})[_0x51b3('0x27')](respondWithResult(_0x30f99f,null))[_0x51b3('0x1c')](handleError(_0x30f99f,null));};exports[_0x51b3('0x11c')]=function(_0x38325d,_0x39f82a){var _0x43ed4b={};var _0x592d57={};var _0x6268ba;return db['User'][_0x51b3('0xcc')]({'where':{'id':_0x38325d[_0x51b3('0x54')]['id']}})['then'](handleEntityNotFound(_0x39f82a,null))[_0x51b3('0x27')](function(_0x10861f){if(_0x10861f){_0x6268ba=_0x10861f;_0x592d57[_0x51b3('0x59')]=_[_0x51b3('0x56')](db[_0x51b3('0x3b')][_0x51b3('0x3c')]);_0x592d57[_0x51b3('0x42')]=_[_0x51b3('0x56')](_0x38325d[_0x51b3('0x42')]);_0x592d57[_0x51b3('0xc0')]=_[_0x51b3('0x57')](_0x592d57[_0x51b3('0x59')],_0x592d57[_0x51b3('0x42')]);_0x43ed4b[_0x51b3('0x49')]=_[_0x51b3('0x57')](_0x592d57[_0x51b3('0x59')],qs[_0x51b3('0x58')](_0x38325d[_0x51b3('0x42')][_0x51b3('0x58')]));_0x43ed4b['attributes']=_0x43ed4b[_0x51b3('0x49')][_0x51b3('0x4d')]?_0x43ed4b[_0x51b3('0x49')]:_0x592d57[_0x51b3('0x59')];_0x43ed4b[_0x51b3('0xc1')]=qs['sort'](_0x38325d[_0x51b3('0x42')][_0x51b3('0xc2')]);_0x43ed4b[_0x51b3('0xc4')]=qs[_0x51b3('0xc0')](_[_0x51b3('0xc3')](_0x38325d[_0x51b3('0x42')],_0x592d57[_0x51b3('0xc0')]));if(_0x38325d[_0x51b3('0x42')][_0x51b3('0x3f')]){_0x43ed4b[_0x51b3('0xc4')]=_[_0x51b3('0xc5')](_0x43ed4b[_0x51b3('0xc4')],{'$or':_['map'](_0x43ed4b[_0x51b3('0x49')],function(_0x1866fb){var _0x1c15fb={};_0x1c15fb[_0x1866fb]={'$like':'%'+_0x38325d[_0x51b3('0x42')]['filter']+'%'};return _0x1c15fb;})});}_0x43ed4b['model']=db[_0x51b3('0x3b')];_0x43ed4b['as']=_0x51b3('0x30');_0x43ed4b=_['merge']({},_0x43ed4b,_0x38325d['options']);return _0x6268ba['getVoiceQueues']({'include':[_0x43ed4b]});}})[_0x51b3('0x27')](function(_0x5f4c91){if(_0x5f4c91){var _0x32efdd={},_0x40df35=[];for(var _0x515eb5=0x0;_0x515eb5<_0x5f4c91[_0x51b3('0x4d')];_0x515eb5+=0x1){for(var _0x50fb3b=0x0,_0x5d3864;_0x50fb3b<_0x5f4c91[_0x515eb5][_0x51b3('0x30')][_0x51b3('0x4d')];_0x50fb3b+=0x1){_0x5d3864=_0x5f4c91[_0x515eb5][_0x51b3('0x30')][_0x50fb3b][_0x51b3('0x2c')]({'plain':!![]});_0x32efdd[_0x5d3864['id']]=_0x5d3864;}}_0x32efdd=_[_0x51b3('0x11d')](_0x32efdd);for(var _0x50215d=qs['offset'](_0x38325d[_0x51b3('0x42')][_0x51b3('0x20')]);_0x50215d<_0x32efdd['length']&&_0x40df35[_0x51b3('0x4d')]=_0xe09f3){_0x332cac=_0xe09f3;_0x66b5da=0xc8;}else{_0x66b5da=0xce;}_0x1a5e4b['status'](_0x66b5da);return _0x1a5e4b[_0x6533('0x2a')]('Content-Range',_0xbabd0c+'-'+_0x332cac+'/'+_0xe09f3)['json'](_0x2ac25c);}return null;};}function saveUpdates(_0x51efac){return function(_0x426f39){if(_0x426f39){return _0x426f39['update'](_0x51efac)[_0x6533('0x17')](function(_0x5c5367){if(_0x5c5367['role']===_0x6533('0x2b')){socket[_0x6533('0x2c')](_0x6533('0x2d')+_0x5c5367['id'],_0x5c5367);}return _0x5c5367;});}return null;};}function removeEntity(_0x2d4f4f){return function(_0xe9b8f9){if(_0xe9b8f9){return _0xe9b8f9[_0x6533('0x2e')]()['then'](function(){var _0x390e87=_0xe9b8f9[_0x6533('0x2f')]({'plain':!![]});if(_0x390e87[_0x6533('0x30')]===_0x6533('0x31'))return;var _0x3a74c3=[{'name':'Users','value':'user','ignore':!![]},{'name':'Agents','value':_0x6533('0x2b'),'ignore':![]},{'name':_0x6533('0x32'),'value':_0x6533('0x33'),'ignore':![]}];var _0x2585c8=_(_0x3a74c3)[_0x6533('0x34')](_0x6533('0x35'))[_0x6533('0x36')]('value')[_0x6533('0x37')]();if(_[_0x6533('0x38')](_0x2585c8,_0x390e87[_0x6533('0x30')])){return;}var _0x574bf6=_[_0x6533('0x39')](_0x3a74c3,[_0x6533('0x37'),_0x390e87['role']])[_0x6533('0x3a')];return db[_0x6533('0x3b')]['destroy']({'where':{'type':_0x574bf6,'resourceId':_0x390e87['id']}})['then'](function(){return _0xe9b8f9;});})[_0x6533('0x17')](function(){_0x2d4f4f['status'](0xcc)[_0x6533('0x23')]();});}};}function handleEntityNotFound(_0x33e1c4){return function(_0x4529a3){if(!_0x4529a3){_0x33e1c4[_0x6533('0x3c')](0x194);}return _0x4529a3;};}function handleError(_0x3d680a,_0x149f50){_0x149f50=_0x149f50||0x1f4;return function(_0x65f7f2){logger[_0x6533('0x1e')](_0x65f7f2[_0x6533('0x3d')]);if(_0x65f7f2[_0x6533('0x3a')]){delete _0x65f7f2[_0x6533('0x3a')];}_0x3d680a[_0x6533('0x24')](_0x149f50)[_0x6533('0x3e')](_0x65f7f2);};}exports[_0x6533('0x3f')]=function(_0x4c584a,_0x5855e4){var _0x276d1a={},_0x588b94={'count':0x0,'rows':[]};var _0xe70ea8=_(db[_0x6533('0x40')][_0x6533('0x41')])[_0x6533('0x36')](function(_0x46c1ad){return{'name':_0x46c1ad['fieldName'],'type':_0x46c1ad[_0x6533('0x42')]['key']};})[_0x6533('0x34')](function(_0x4313cd){return!_[_0x6533('0x38')](['password',_0x6533('0x43')],_0x4313cd['name']);})[_0x6533('0x37')]();_0x276d1a=qs[_0x6533('0x44')](_0xe70ea8,_0x4c584a);var _0x3dfa13={'where':_0x276d1a[_0x6533('0x45')]};return db['User'][_0x6533('0x28')](_0x3dfa13)['then'](function(_0xe41918){_0x588b94[_0x6533('0x28')]=_0xe41918;if(_0x4c584a[_0x6533('0x46')]['includeAll']){_0x276d1a[_0x6533('0x47')]=[{'all':!![]}];}if(_0x4c584a['query']['userSetting']==='true'){_0x276d1a[_0x6533('0x47')]=[{'model':db[_0x6533('0x48')],'as':'userSetting'}];}if(!_[_0x6533('0x38')](_0x276d1a[_0x6533('0x49')],'id')){_0x276d1a[_0x6533('0x49')][_0x6533('0x4a')]('id');}return db[_0x6533('0x40')][_0x6533('0x4b')](_0x276d1a);})[_0x6533('0x17')](function(_0x455b56){_0x588b94['rows']=_0x455b56;if(_0x4c584a['query'][_0x6533('0x4c')]==='true'){var _0x53d496=[];for(var _0x4870fd=0x0;_0x4870fd<_0x588b94[_0x6533('0x4d')][_0x6533('0x4e')];_0x4870fd++){_0x53d496[_0x6533('0x4a')](get_open_tabs(_0x6533('0x4f'),_0x588b94[_0x6533('0x4d')][_0x4870fd]['dataValues']));_0x53d496[_0x6533('0x4a')](get_open_tabs(_0x6533('0x50'),_0x588b94[_0x6533('0x4d')][_0x4870fd]['dataValues']));_0x53d496['push'](get_open_tabs(_0x6533('0x51'),_0x588b94['rows'][_0x4870fd][_0x6533('0x52')]));_0x53d496['push'](get_open_tabs(_0x6533('0x53'),_0x588b94[_0x6533('0x4d')][_0x4870fd][_0x6533('0x52')]));_0x53d496[_0x6533('0x4a')](get_open_tabs(_0x6533('0x54'),_0x588b94[_0x6533('0x4d')][_0x4870fd][_0x6533('0x52')]));_0x53d496[_0x6533('0x4a')](get_open_tabs('whatsapp',_0x588b94[_0x6533('0x4d')][_0x4870fd][_0x6533('0x52')]));}return Promise[_0x6533('0x55')](_0x53d496)[_0x6533('0x17')](function(){return _0x588b94;});}else{return _0x588b94;}})[_0x6533('0x17')](respondWithFilteredResult(_0x5855e4,_0x276d1a))[_0x6533('0x22')](handleError(_0x5855e4,null));};exports[_0x6533('0x56')]=function(_0x55f9ae,_0x470fb2){var _0x3dbf97={'raw':![],'where':{'id':_0x55f9ae[_0x6533('0x57')]['id']}},_0x5b4fc5={};_0x5b4fc5['model']=_[_0x6533('0x58')](_[_0x6533('0x59')](db[_0x6533('0x40')]['rawAttributes']),[_0x6533('0x5a'),_0x6533('0x43')]);_0x5b4fc5[_0x6533('0x46')]=_[_0x6533('0x59')](_0x55f9ae[_0x6533('0x46')]);_0x5b4fc5[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x5b4fc5[_0x6533('0x5d')],_0x5b4fc5['query']);_0x3dbf97[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x5b4fc5[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x55f9ae[_0x6533('0x46')][_0x6533('0x5e')]));_0x3dbf97[_0x6533('0x49')]=_0x3dbf97[_0x6533('0x49')][_0x6533('0x4e')]?_0x3dbf97['attributes']:_0x5b4fc5['model'];if(_0x55f9ae[_0x6533('0x46')][_0x6533('0x5f')]){_0x3dbf97[_0x6533('0x47')]=[{'all':!![]}];}if(_0x55f9ae[_0x6533('0x46')][_0x6533('0x60')]===_0x6533('0x61')){_0x3dbf97[_0x6533('0x47')]=[{'model':db[_0x6533('0x48')],'as':_0x6533('0x60')}];}_0x3dbf97=_[_0x6533('0x62')]({},_0x3dbf97,_0x55f9ae['options']);if(!_[_0x6533('0x38')](_0x3dbf97[_0x6533('0x49')],'id')){_0x3dbf97[_0x6533('0x49')][_0x6533('0x4a')]('id');}return db[_0x6533('0x40')][_0x6533('0x39')](_0x3dbf97)[_0x6533('0x17')](handleEntityNotFound(_0x470fb2,null))['then'](function(_0x3bf882){var _0x4dbf8d=[];values=_0x3bf882;if(_0x55f9ae[_0x6533('0x46')][_0x6533('0x4c')]==='true'){_0x4dbf8d[_0x6533('0x4a')](get_open_tabs(_0x6533('0x4f'),_0x3bf882[_0x6533('0x52')]));_0x4dbf8d['push'](get_open_tabs(_0x6533('0x50'),_0x3bf882[_0x6533('0x52')]));_0x4dbf8d[_0x6533('0x4a')](get_open_tabs('openchannel',_0x3bf882[_0x6533('0x52')]));_0x4dbf8d['push'](get_open_tabs(_0x6533('0x63'),_0x3bf882[_0x6533('0x52')]));_0x4dbf8d[_0x6533('0x4a')](get_open_tabs('fax',_0x3bf882[_0x6533('0x52')]));_0x4dbf8d[_0x6533('0x4a')](get_open_tabs('mail',_0x3bf882[_0x6533('0x52')]));return Promise[_0x6533('0x55')](_0x4dbf8d);}else{return values;}})[_0x6533('0x17')](function(){return values;})[_0x6533('0x17')](respondWithResult(_0x470fb2,null))[_0x6533('0x22')](handleError(_0x470fb2,null));};exports['update']=function(_0x35312a,_0x2d51fd){if(_0x35312a[_0x6533('0x64')]['id']){delete _0x35312a[_0x6533('0x64')]['id'];}delete _0x35312a[_0x6533('0x64')][_0x6533('0x30')];return db['User'][_0x6533('0x39')]({'where':{'id':_0x35312a[_0x6533('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d51fd,null))[_0x6533('0x17')](saveUpdates(_0x35312a[_0x6533('0x64')],null))[_0x6533('0x17')](respondWithResult(_0x2d51fd,null))['catch'](handleError(_0x2d51fd,null));};exports[_0x6533('0x65')]=function(_0x463b09,_0x4d70db){return db['User'][_0x6533('0x65')]()[_0x6533('0x17')](respondWithResult(_0x4d70db,null))['catch'](handleError(_0x4d70db,null));};exports[_0x6533('0x66')]=function(_0x42690c,_0x58d84d){return db['User'][_0x6533('0x39')]({'where':{'id':_0x42690c[_0x6533('0x57')]['id']}})['then'](handleEntityNotFound(_0x58d84d,null))[_0x6533('0x17')](function(_0x4e559a){if(_0x4e559a){return _0x4e559a['addContacts'](_0x42690c[_0x6533('0x64')]['ids'],_[_0x6533('0x67')](_0x42690c[_0x6533('0x64')],[_0x6533('0x68'),'id'])||{});}})[_0x6533('0x17')](respondWithResult(_0x58d84d,null))[_0x6533('0x22')](handleError(_0x58d84d,null));};function validateUser(_0x1a6cee){return new Promise(function(_0x27f55b,_0x335d59){if(_0x1a6cee[_0x6533('0x69')])return _0x27f55b(_0x1a6cee);return db[_0x6533('0x6a')]['findById'](0x1)[_0x6533('0x17')](function(_0x3b47c5){if(_0x3b47c5[_0x6533('0x6b')])authService[_0x6533('0x6c')](_0x1a6cee[_0x6533('0x5a')]);db[_0x6533('0x40')][_0x6533('0x6d')](_0x6533('0x69'))[_0x6533('0x17')](function(_0x8f5e23){if(_['isNil'](_0x8f5e23)){_0x1a6cee[_0x6533('0x69')]=_0x3b47c5['min_internal']||0x1;return;}if(_[_0x6533('0x6e')](_0x3b47c5[_0x6533('0x6f')])||_0x3b47c5[_0x6533('0x6f')]===_0x8f5e23){_0x1a6cee[_0x6533('0x69')]=_0x8f5e23+0x1;return;}if(_0x3b47c5[_0x6533('0x6f')]>_0x8f5e23){_0x1a6cee[_0x6533('0x69')]=_0x3b47c5[_0x6533('0x6f')];return;}return db['sequelize'][_0x6533('0x46')]('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)',{'type':db[_0x6533('0x70')][_0x6533('0x71')][_0x6533('0x72')]})[_0x6533('0x17')](function(_0x3c6147){if(_0x3c6147&&_0x3c6147[_0x6533('0x4e')]){for(var _0x3002cf=0x0,_0x4ff857=_0x3c6147[_0x6533('0x4e')];_0x3002cf<_0x4ff857&&_[_0x6533('0x6e')](_0x1a6cee[_0x6533('0x69')]);_0x3002cf++){if(_0x3b47c5[_0x6533('0x6f')]<=_0x3c6147[_0x3002cf][_0x6533('0x73')]){_0x1a6cee['internal']=_0x3c6147[_0x3002cf][_0x6533('0x73')];}else if(_0x3b47c5[_0x6533('0x6f')]>_0x3c6147[_0x3002cf][_0x6533('0x73')]&&_0x3b47c5[_0x6533('0x6f')]<=_0x3c6147[_0x3002cf]['to']){_0x1a6cee[_0x6533('0x69')]=_0x3b47c5[_0x6533('0x6f')];}}}if(_[_0x6533('0x6e')](_0x1a6cee[_0x6533('0x69')])){_0x1a6cee[_0x6533('0x69')]=_0x8f5e23+0x1;}return _0x27f55b(_0x1a6cee);});});})[_0x6533('0x22')](function(_0x52980a){_0x335d59(_0x52980a);});});}function updateUser(_0x1d649d){return new Promise(function(_0xa0075c,_0x48ac4a){try{if(_0x1d649d[_0x6533('0x74')]){_0x1d649d[_0x6533('0x75')]=_0x1d649d[_0x6533('0x69')];_0x1d649d[_0x6533('0x76')]={'mailbox':_0x1d649d[_0x6533('0x69')],'password':_0x1d649d[_0x6533('0x5a')],'fullname':_0x1d649d[_0x6533('0x77')],'email':_0x1d649d[_0x6533('0x78')]};}if(_0x1d649d[_0x6533('0x30')]==='agent'){if(!_0x1d649d['permissions'])_0x1d649d[_0x6533('0x79')]=[_0x6533('0x7a'),_0x6533('0x7b'),_0x6533('0x7c'),'113',_0x6533('0x7d'),_0x6533('0x7e'),_0x6533('0x7f'),_0x6533('0x80'),_0x6533('0x81'),_0x6533('0x82'),_0x6533('0x83'),'100','111',_0x6533('0x84'),'115'];}_0xa0075c(_0x1d649d);}catch(_0x2525d6){_0x48ac4a(_0x2525d6);}});}exports[_0x6533('0x85')]=function(_0xb40e9b,_0x438889){if(_0xb40e9b[_0x6533('0x86')][_0x6533('0x30')]===_0x6533('0x2b'))throw new Error(_0x6533('0x87'));if(_0xb40e9b['body'][_0x6533('0x30')]==='user'&&_0xb40e9b[_0x6533('0x86')][_0x6533('0x30')]!==_0x6533('0x31')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0xb40e9b[_0x6533('0x64')]['role']==='admin'&&_0xb40e9b[_0x6533('0x86')]['role']!==_0x6533('0x31')){throw new Error(_0x6533('0x88'));}return licenseUtil[_0x6533('0x89')]([_0xb40e9b[_0x6533('0x64')]])[_0x6533('0x17')](function(){return validateUser(_0xb40e9b['body']);})[_0x6533('0x17')](function(_0xf96371){return updateUser(_0xf96371)['then'](function(_0x1e6f43){if(_0x1e6f43[_0x6533('0x30')]===_0x6533('0x31')){_0x1e6f43[_0x6533('0x8a')]=_0xb40e9b[_0x6533('0x86')][_0x6533('0x8a')];delete _0x1e6f43[_0x6533('0x8b')];}return _0x1e6f43;});})[_0x6533('0x17')](function(_0x5e89a6){return db[_0x6533('0x40')]['create'](_0x5e89a6,{'include':[{'model':db[_0x6533('0x76')],'as':'VoiceMail'}]});})[_0x6533('0x17')](function(_0x32a19a){if(_0xb40e9b[_0x6533('0x64')][_0x6533('0x30')]===_0x6533('0x86'))return _0x32a19a;if(_0xb40e9b[_0x6533('0x86')][_0x6533('0x30')]!==_0x6533('0x86'))return _0x32a19a;return db[_0x6533('0x8c')]['find']({'where':{'name':_0x32a19a[_0x6533('0x30')]==='agent'?_0x6533('0x8d'):'Telephones','userProfileId':_0xb40e9b[_0x6533('0x86')]['userProfileId']},'raw':!![]})[_0x6533('0x17')](function(_0x55d2d4){if(!_0x55d2d4||_0x55d2d4[_0x6533('0x8e')]!=0x0)return _0x32a19a;return db[_0x6533('0x3b')][_0x6533('0x85')]({'name':_0x32a19a[_0x6533('0x3a')],'resourceId':_0x32a19a['id'],'type':_0x55d2d4['name'],'sectionId':_0x55d2d4['id']},{})[_0x6533('0x17')](function(){return _0x32a19a;});})[_0x6533('0x22')](function(_0x361ccf){logger[_0x6533('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x361ccf);throw _0x361ccf;});})[_0x6533('0x17')](respondWithResult(_0x438889,0xc9))[_0x6533('0x22')](handleError(_0x438889,null));};exports[_0x6533('0x8f')]=function(_0xbfafd1,_0x49e063){var _0x29a0e2=_0xbfafd1['body'];var _0x19034a=[];if(_0xbfafd1['user'][_0x6533('0x30')]===_0x6533('0x2b'))throw new Error(_0x6533('0x87'));if(_[_0x6533('0x90')](_0x29a0e2,[_0x6533('0x30'),'user'])&&_0xbfafd1['user'][_0x6533('0x30')]!==_0x6533('0x31')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x6533('0x90')](_0x29a0e2,['role',_0x6533('0x31')])&&_0xbfafd1[_0x6533('0x86')]['role']!==_0x6533('0x31')){throw new Error(_0x6533('0x91'));}return licenseUtil['checkUserLimits'](_0x29a0e2)[_0x6533('0x17')](function(){return validateUser(_0x29a0e2[0x0]);})['then'](function(){for(var _0x2d1c14=0x1;_0x2d1c14<_0x29a0e2[_0x6533('0x4e')];_0x2d1c14++){var _0x32785b=_0x29a0e2[_0x2d1c14-0x1][_0x6533('0x69')];if(!_0x29a0e2[_0x2d1c14]['internal'])_0x29a0e2[_0x2d1c14][_0x6533('0x69')]=_0x32785b+0x1;_0x19034a[_0x6533('0x4a')](validateUser(_0x29a0e2[_0x2d1c14]));}return Promise[_0x6533('0x55')](_0x19034a);})[_0x6533('0x17')](function(){_0x19034a=[];for(var _0x391d8f=0x0;_0x391d8f<_0x29a0e2['length'];_0x391d8f++){_0x19034a['push'](updateUser(_0x29a0e2[_0x391d8f]));}return Promise[_0x6533('0x55')](_0x19034a);})[_0x6533('0x17')](function(){_0x19034a=_0x29a0e2['map'](function(_0x1ee76f){return db[_0x6533('0x40')][_0x6533('0x85')](_0x1ee76f,{'include':[{'model':db[_0x6533('0x76')],'as':'VoiceMail'}]})[_0x6533('0x17')](function(_0x220fc2){_0x1ee76f['id']=_0x220fc2['id'];return _0x1ee76f;});});return Promise[_0x6533('0x55')](_0x19034a);})['then'](function(_0x2d25f7){if(_0xbfafd1[_0x6533('0x64')]['role']===_0x6533('0x86'))return _0x2d25f7;if(_0xbfafd1[_0x6533('0x86')]['role']!==_0x6533('0x86'))return _0x2d25f7;var _0x61ca1a=_[_0x6533('0x90')](_0x2d25f7,function(_0x2f30e5){return _0x2f30e5[_0x6533('0x30')]===_0x6533('0x2b')||_0x2f30e5['role']===_0x6533('0x33');});if(!_0x61ca1a)return _0x2d25f7;return db[_0x6533('0x8c')][_0x6533('0x4b')]({'where':{'name':{'$or':['Agents',_0x6533('0x32')]},'userProfileId':_0xbfafd1['user'][_0x6533('0x8b')]},'raw':!![]})[_0x6533('0x17')](function(_0x330e2f){if(_['isEmpty'](_0x330e2f)||!_[_0x6533('0x90')](_0x330e2f,[_0x6533('0x8e'),0x0]))return _0x2d25f7;_0x19034a=[];var _0x33fafc=_(_0x330e2f)[_0x6533('0x36')](function(_0x2a7918){if(_0x2a7918[_0x6533('0x8e')]===0x1)return;return _0x2a7918[_0x6533('0x3a')]===_0x6533('0x8d')?_0x6533('0x2b'):_0x6533('0x33');})[_0x6533('0x92')]()[_0x6533('0x37')]();for(var _0x3f2c4b=0x0;_0x3f2c4b<_0x2d25f7[_0x6533('0x4e')];_0x3f2c4b++){if(!_[_0x6533('0x38')](_0x33fafc,_0x2d25f7[_0x3f2c4b][_0x6533('0x30')]))return;var _0x486a43=_0x2d25f7[_0x3f2c4b]['role']===_0x6533('0x2b')?_0x6533('0x8d'):'Telephones';_0x19034a[_0x6533('0x4a')](db[_0x6533('0x3b')][_0x6533('0x85')]({'name':_0x2d25f7[_0x3f2c4b]['name'],'resourceId':_0x2d25f7[_0x3f2c4b]['id'],'type':_0x486a43,'sectionId':_[_0x6533('0x39')](_0x330e2f,[_0x6533('0x3a'),_0x486a43])['id']},{}));}return Promise['all'](_0x19034a);});})['then'](respondWithResult(_0x49e063,0xc9))[_0x6533('0x22')](handleError(_0x49e063,null));};exports[_0x6533('0x93')]=function(_0xcfa099,_0x5006e7){if(_0xcfa099[_0x6533('0x64')]['id']){delete _0xcfa099[_0x6533('0x64')]['id'];}return db[_0x6533('0x40')]['find']({'where':{'id':_0xcfa099['params']['id']}})[_0x6533('0x17')](function(_0x11ac00){if(!_0x11ac00)return null;if(_0x11ac00['id']===_0xcfa099[_0x6533('0x86')]['id']){if(!_0xcfa099['body'][_0x6533('0x94')]||!_0xcfa099[_0x6533('0x64')][_0x6533('0x95')]){throw new db[(_0x6533('0x96'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x11ac00[_0x6533('0x97')](_0xcfa099[_0x6533('0x64')]['oldPassword'])){throw new db[(_0x6533('0x96'))][(_0x6533('0x98'))](_0x6533('0x99'));}if(_0xcfa099[_0x6533('0x64')][_0x6533('0x94')]===_0xcfa099[_0x6533('0x64')][_0x6533('0x95')]){throw new db['Sequelize'][(_0x6533('0x98'))](_0x6533('0x9a'));}}else if(_0xcfa099[_0x6533('0x86')]['role']===_0x6533('0x31')){if(!_0xcfa099[_0x6533('0x64')][_0x6533('0x95')]){throw new db[(_0x6533('0x96'))][(_0x6533('0x98'))](_0x6533('0x9b'));}}else if(_0xcfa099[_0x6533('0x86')][_0x6533('0x30')]===_0x6533('0x86')){if(!_0xcfa099[_0x6533('0x64')][_0x6533('0x95')]){throw new db['Sequelize'][(_0x6533('0x98'))](_0x6533('0x9b'));}if(_0x11ac00[_0x6533('0x30')]!==_0x6533('0x2b')){throw new db[(_0x6533('0x96'))]['ValidationError'](_0x6533('0x87'));}}else{throw new db[(_0x6533('0x96'))][(_0x6533('0x98'))](_0x6533('0x87'));}return _0x11ac00;})[_0x6533('0x17')](handleEntityNotFound(_0x5006e7,null))[_0x6533('0x17')](function(_0x2ba6db){return db[_0x6533('0x6a')][_0x6533('0x9c')]({'attributes':['id',_0x6533('0x6b'),_0x6533('0x9d'),'passwordHistoryLimit']})[_0x6533('0x17')](function(_0x2c7d78){if(_0x2c7d78[_0x6533('0x6b')])authService[_0x6533('0x6c')](_0xcfa099[_0x6533('0x64')][_0x6533('0x95')]);if(!_0x2c7d78['enforcePasswordHistory']||!_0x2ba6db[_0x6533('0x9e')])return _0x2ba6db;authService[_0x6533('0x9f')](_0xcfa099[_0x6533('0x64')][_0x6533('0x95')],_0x2ba6db[_0x6533('0x9e')],_0x2c7d78['passwordHistoryLimit']);return _0x2ba6db;})[_0x6533('0x17')](saveUpdates({'password':_0xcfa099['body']['newPassword'],'passwordResetAt':_0xcfa099[_0x6533('0x86')]['id']==_0xcfa099[_0x6533('0x57')]['id']?moment():null,'previousPasswords':authService[_0x6533('0xa0')](_0xcfa099[_0x6533('0x64')][_0x6533('0x95')],_0x2ba6db['previousPasswords'])},null));})[_0x6533('0x17')](respondWithResult(_0x5006e7,null))['catch'](handleError(_0x5006e7,null));};exports[_0x6533('0xa1')]=function(_0x2b6f44,_0x30e34f){var _0x425878=_0x2b6f44[_0x6533('0x64')][_0x6533('0xa2')];return db[_0x6533('0x40')]['find']({'where':{'id':_0x2b6f44[_0x6533('0x57')]['id']},'attributes':['id','name',_0x6533('0x30'),'online',_0x6533('0xa3'),_0x6533('0xa4'),_0x6533('0xa5')]})[_0x6533('0x17')](handleEntityNotFound(_0x30e34f,null))[_0x6533('0x17')](function(_0x4bdab9){if(_0x4bdab9){if(!utils[_0x6533('0xa6')](_0x425878)){throw new db[(_0x6533('0x96'))]['ValidationError'](_0x6533('0xa7'));}return _0x4bdab9[_0x6533('0xa8')+_[_0x6533('0xa9')](_0x425878['toLowerCase']())+_0x6533('0xaa')](_0x2b6f44[_0x6533('0x64')][_0x6533('0x68')],{'penalty':_0x2b6f44['body']['penalty']||0x0})['spread'](function(_0x54cbac){for(var _0x2cd105=0x0;_0x2cd105<_0x2b6f44[_0x6533('0x64')]['ids'][_0x6533('0x4e')];_0x2cd105+=0x1){var _0x47cdb6={'UserId':Number(_0x2b6f44[_0x6533('0x57')]['id'])};_0x47cdb6[_['capitalize'](_0x425878[_0x6533('0xab')]())+'QueueId']=Number(_0x2b6f44['body']['ids'][_0x2cd105]);socket[_0x6533('0x2c')]('user'+_[_0x6533('0xa9')](_0x425878[_0x6533('0xab')]())+'Queue:save',_0x47cdb6);}return _0x54cbac;})[_0x6533('0x17')](function(){if(_0x425878===_0x6533('0xac')){return db[_0x6533('0xad')]['findAll']({'where':{'id':_0x2b6f44[_0x6533('0x64')][_0x6533('0x68')]||[]},'raw':!![],'attributes':['id',_0x6533('0x3a')]});}})[_0x6533('0x17')](function(_0x48a7b8){var _0x116ee5=_0x4bdab9[_0x6533('0x2f')]({'plain':!![]});var _0x4d42db=[];if(_0x425878==='voice'&&_0x116ee5[_0x6533('0x30')]==='agent'&&_0x116ee5[_0x6533('0xae')]){for(let _0x1dc8de=0x0;_0x1dc8de<_0x48a7b8[_0x6533('0x4e')];_0x1dc8de+=0x1){_0x4d42db['push']({'membername':_0x116ee5[_0x6533('0x3a')],'UserId':_0x116ee5['id'],'queue_name':_0x48a7b8[_0x1dc8de]['name'],'VoiceQueueId':_0x48a7b8[_0x1dc8de]['id'],'interface':_[_0x6533('0x6e')](_0x116ee5[_0x6533('0xa5')])?util[_0x6533('0xaf')](_0x6533('0xb0'),_0x116ee5[_0x6533('0x3a')]):_0x116ee5['interface'],'paused':_0x116ee5['voicePause']||![],'penalty':_0x2b6f44['body'][_0x6533('0xb1')]||0x0});}return Promise[_0x6533('0x55')](_0x4d42db[_0x6533('0x36')](function(_0x1b47a9){return db[_0x6533('0xb2')][_0x6533('0xb3')](_0x1b47a9);}));}return _0x4bdab9;});}})[_0x6533('0x17')](respondWithStatusCode(_0x30e34f,null))['catch'](handleError(_0x30e34f,null));};exports['removeQueues']=function(_0x2fccd1,_0x1e3d5a){var _0x2933c7,_0x15fe8d;return db[_0x6533('0x40')][_0x6533('0x39')]({'where':{'id':_0x2fccd1['params']['id']},'attributes':['id','name',_0x6533('0x30')]})[_0x6533('0x17')](handleEntityNotFound(_0x1e3d5a,null))[_0x6533('0x17')](function(_0x30d2af){if(_0x30d2af){_0x2933c7=_0x30d2af;if(!_0x2fccd1[_0x6533('0x46')][_0x6533('0xa2')]||!utils[_0x6533('0xa6')](_0x2fccd1[_0x6533('0x46')][_0x6533('0xa2')])){throw new db[(_0x6533('0x96'))][(_0x6533('0x98'))](_0x6533('0xa7'));}return _0x30d2af[_0x6533('0xb4')+_['capitalize'](_0x2fccd1[_0x6533('0x46')]['channel'][_0x6533('0xab')]())+_0x6533('0xaa')](_0x2fccd1[_0x6533('0x46')]['ids']);}})[_0x6533('0x17')](function(_0x50d6e9){if(_['isArray'](_0x2fccd1[_0x6533('0x46')][_0x6533('0x68')])){for(var _0x4614b7=0x0;_0x4614b7<_0x2fccd1[_0x6533('0x46')][_0x6533('0x68')]['length'];_0x4614b7+=0x1){_0x15fe8d={'UserId':Number(_0x2fccd1[_0x6533('0x57')]['id'])};_0x15fe8d[_['capitalize'](_0x2fccd1['query'][_0x6533('0xa2')][_0x6533('0xab')]())+'QueueId']=Number(_0x2fccd1[_0x6533('0x46')][_0x6533('0x68')][_0x4614b7]);socket[_0x6533('0x2c')]('user'+_[_0x6533('0xa9')](_0x2fccd1[_0x6533('0x46')][_0x6533('0xa2')]['toLowerCase']())+_0x6533('0xb5'),_0x15fe8d);}}else{_0x15fe8d={'UserId':Number(_0x2fccd1[_0x6533('0x57')]['id'])};_0x15fe8d[_[_0x6533('0xa9')](_0x2fccd1[_0x6533('0x46')][_0x6533('0xa2')]['toLowerCase']())+_0x6533('0xb6')]=Number(_0x2fccd1['query']['ids']);socket[_0x6533('0x2c')]('user'+_[_0x6533('0xa9')](_0x2fccd1[_0x6533('0x46')]['channel']['toLowerCase']())+_0x6533('0xb5'),_0x15fe8d);}return _0x50d6e9;})[_0x6533('0x17')](function(){if(_0x2fccd1[_0x6533('0x46')][_0x6533('0xa2')]===_0x6533('0xac')){return db[_0x6533('0xb2')]['destroy']({'where':{'UserId':_0x2fccd1[_0x6533('0x57')]['id'],'VoiceQueueId':_0x2fccd1['query'][_0x6533('0x68')]},'individualHooks':!![]})[_0x6533('0x17')](function(){return _0x2933c7;});}return _0x2933c7;})[_0x6533('0x17')](respondWithStatusCode(_0x1e3d5a,null))[_0x6533('0x22')](handleError(_0x1e3d5a,null));};exports[_0x6533('0xb7')]=function(_0x3fb4cc,_0x4ce585){_0x3fb4cc[_0x6533('0x64')][_0x6533('0xb8')]=_0x3fb4cc[_0x6533('0xb9')][_0x6533('0xba')];return db[_0x6533('0x40')]['find']({'where':{'id':_0x3fb4cc['params']['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x4ce585,null))['then'](saveUpdates(_0x3fb4cc['body'],null))['then'](respondWithResult(_0x4ce585,null))[_0x6533('0x22')](handleError(_0x4ce585,null));};exports[_0x6533('0xbb')]=function(_0xb1723f,_0x58e9fa){var _0x319f72=path[_0x6533('0xbc')](config['root'],_0x6533('0xbd'));return db['User'][_0x6533('0x39')]({'where':{'id':_0xb1723f['params']['id']},'attributes':['id',_0x6533('0xb8')],'raw':!![]})[_0x6533('0x17')](handleEntityNotFound(_0x58e9fa,null))[_0x6533('0x17')](function(_0x210ae7){if(_0x210ae7){if(_[_0x6533('0x6e')](_0x210ae7[_0x6533('0xb8')])){return _0x58e9fa[_0x6533('0xbe')](_0x319f72);}else{if(!fs[_0x6533('0xbf')](path[_0x6533('0xbc')](config[_0x6533('0xc0')],_0x6533('0xc1'),_0x210ae7['userpic']))){return _0x58e9fa[_0x6533('0xbe')](_0x319f72);}return _0x58e9fa['download'](path[_0x6533('0xbc')](config[_0x6533('0xc0')],_0x6533('0xc1'),_0x210ae7['userpic']));}}})[_0x6533('0x22')](handleError(_0x58e9fa,null));};exports[_0x6533('0xc2')]=function(_0x335dc5,_0x72c7f6){return db[_0x6533('0x40')][_0x6533('0x39')]({'where':{'id':_0x335dc5[_0x6533('0x57')]['id']},'attributes':['id']})[_0x6533('0x17')](handleEntityNotFound(_0x72c7f6,null))['then'](function(_0x55ebf2){var _0x2afd1c=[];values=_0x55ebf2['dataValues'];_0x2afd1c['push'](get_open_tabs(_0x6533('0x4f'),_0x55ebf2[_0x6533('0x52')]));_0x2afd1c['push'](get_open_tabs(_0x6533('0x50'),_0x55ebf2[_0x6533('0x52')]));_0x2afd1c['push'](get_open_tabs(_0x6533('0x54'),_0x55ebf2[_0x6533('0x52')]));_0x2afd1c[_0x6533('0x4a')](get_open_tabs('whatsapp',_0x55ebf2['dataValues']));_0x2afd1c[_0x6533('0x4a')](get_open_tabs('fax',_0x55ebf2[_0x6533('0x52')]));_0x2afd1c['push'](get_open_tabs(_0x6533('0x53'),_0x55ebf2[_0x6533('0x52')]));return Promise[_0x6533('0x55')](_0x2afd1c);})[_0x6533('0x17')](function(_0x4ac963){if(_0x4ac963){var _0x3ed8a9=_[_0x6533('0x36')](values[_0x6533('0xc3')],function(_0x22c1e1){return{'channel':_0x6533('0xc4'),'id':_0x22c1e1['id'],'createdAt':_0x22c1e1[_0x6533('0xc5')]};});var _0x48bada=_[_0x6533('0x36')](values[_0x6533('0xc6')],function(_0x2f2465){return{'channel':_0x6533('0xc7'),'id':_0x2f2465['id'],'createdAt':_0x2f2465[_0x6533('0xc5')]};});var _0x2838bd=_['map'](values['OpenchannelOpenTabs'],function(_0x5a1599){return{'channel':_0x6533('0xc8'),'id':_0x5a1599['id'],'createdAt':_0x5a1599['createdAt']};});var _0x1b8dc3=_[_0x6533('0x36')](values[_0x6533('0xc9')],function(_0x51b301){return{'channel':_0x6533('0xca'),'id':_0x51b301['id'],'createdAt':_0x51b301[_0x6533('0xc5')]};});var _0x434a22=_[_0x6533('0x36')](values[_0x6533('0xcb')],function(_0x5be762){return{'channel':_0x6533('0xcc'),'id':_0x5be762['id'],'createdAt':_0x5be762[_0x6533('0xc5')]};});var _0x3c0a7f=_['map'](values['WhatsappOpenTabs'],function(_0x1f61b6){return{'channel':_0x6533('0xcd'),'id':_0x1f61b6['id'],'createdAt':_0x1f61b6[_0x6533('0xc5')]};});var _0x5e416d=_[_0x6533('0xce')](_0x3ed8a9,_0x48bada,_0x2838bd,_0x1b8dc3,_0x434a22,_0x3c0a7f);var _0x5ea056={'count':_0x5e416d[_0x6533('0x4e')],'rows':_0x5e416d};return _0x5ea056;}else return null;})[_0x6533('0x17')](respondWithResult(_0x72c7f6,null))[_0x6533('0x22')](handleError(_0x72c7f6,null));};exports[_0x6533('0xcf')]=function(_0x28523b,_0xc0e1f2){var _0x4f000c={};var _0x4176d9={};var _0x483665;var _0x3122c0;return db['User'][_0x6533('0x9c')]({'where':{'id':_0x28523b['params']['id']}})[_0x6533('0x17')](handleEntityNotFound(_0xc0e1f2,null))[_0x6533('0x17')](function(_0x1f0720){if(_0x1f0720){_0x483665=_0x1f0720;_0x4176d9[_0x6533('0x5d')]=_['keys'](db[_0x6533('0xd0')][_0x6533('0x41')]);_0x4176d9['query']=_['keys'](_0x28523b[_0x6533('0x46')]);_0x4176d9[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x4176d9[_0x6533('0x5d')],_0x4176d9[_0x6533('0x46')]);_0x4f000c[_0x6533('0x49')]=_['intersection'](_0x4176d9[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x28523b[_0x6533('0x46')]['fields']));_0x4f000c[_0x6533('0x49')]=_0x4f000c[_0x6533('0x49')][_0x6533('0x4e')]?_0x4f000c[_0x6533('0x49')]:_0x4176d9[_0x6533('0x5d')];_0x4f000c[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x28523b[_0x6533('0x46')]['sort']);_0x4f000c['where']=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x28523b[_0x6533('0x46')],_0x4176d9[_0x6533('0x5b')]));if(_0x28523b['query'][_0x6533('0x34')]){_0x4f000c[_0x6533('0x45')]=_['merge'](_0x4f000c[_0x6533('0x45')],{'$or':_['map'](_0x4f000c[_0x6533('0x49')],function(_0x38e3d0){var _0xe92cfb={};_0xe92cfb[_0x38e3d0]={'$like':'%'+_0x28523b[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0xe92cfb;})});}_0x4f000c=_[_0x6533('0x62')]({},_0x4f000c,_0x28523b[_0x6533('0xd4')]);return _0x483665[_0x6533('0xcf')](_0x4f000c);}})[_0x6533('0x17')](function(_0x455397){if(_0x455397){_0x3122c0=_0x455397['length'];if(_0x28523b['query'][_0x6533('0xd5')](_0x6533('0x5f'))){_0x4f000c[_0x6533('0x47')]=[{'model':db[_0x6533('0xd6')],'as':'List','required':![]},{'model':db[_0x6533('0xd7')],'as':_0x6533('0xd8'),'attributes':['id',_0x6533('0x3a'),_0x6533('0xd9')],'where':_0x28523b[_0x6533('0x46')][_0x6533('0xda')]?{'id':_0x28523b[_0x6533('0x46')][_0x6533('0xda')]}:undefined,'required':_0x28523b[_0x6533('0x46')][_0x6533('0xda')]?!![]:![]}];}if(!_0x28523b[_0x6533('0x46')][_0x6533('0xd5')]('nolimit')){_0x4f000c[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x28523b[_0x6533('0x46')][_0x6533('0x27')]);_0x4f000c[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x28523b[_0x6533('0x46')][_0x6533('0x29')]);}return _0x483665[_0x6533('0xcf')](_0x4f000c);}})[_0x6533('0x17')](function(_0x3cf386){if(_0x3cf386){return _0x3cf386?{'count':_0x3122c0,'rows':_0x3cf386}:null;}})[_0x6533('0x17')](respondWithResult(_0xc0e1f2,null))[_0x6533('0x22')](handleError(_0xc0e1f2,null));};exports[_0x6533('0xdb')]=function(_0x267a1c,_0x3c25d7){var _0x556cb7;var _0x2593b8={};var _0x3a9256;return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x267a1c['params']['id']},'attributes':['id',_0x6533('0x3a'),'role']})[_0x6533('0x17')](handleEntityNotFound(_0x3c25d7,null))[_0x6533('0x17')](function(_0x55e79e){if(!utils[_0x6533('0xa6')](_0x267a1c[_0x6533('0x46')][_0x6533('0xa2')])){throw new db['Sequelize'][(_0x6533('0x98'))](_0x6533('0xa7'));}_0x556cb7=_0x55e79e;var _0x1401ad={};_0x1401ad[_0x6533('0x5d')]=_['keys'](db[_['capitalize'](_0x267a1c['query'][_0x6533('0xa2')])+_0x6533('0xdc')][_0x6533('0x41')]);_0x1401ad[_0x6533('0x46')]=_['keys'](_0x267a1c[_0x6533('0x46')]);_0x1401ad[_0x6533('0x5b')]=_['intersection'](_0x1401ad[_0x6533('0x5d')],_0x1401ad[_0x6533('0x46')]);_0x2593b8[_0x6533('0x49')]=_['intersection'](_0x1401ad[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x267a1c[_0x6533('0x46')][_0x6533('0x5e')]));_0x2593b8[_0x6533('0x49')]=_0x2593b8[_0x6533('0x49')]['length']?_0x2593b8[_0x6533('0x49')]:_0x1401ad[_0x6533('0x5d')];_0x2593b8[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x267a1c[_0x6533('0x46')]['sort']);_0x2593b8[_0x6533('0x45')]=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x267a1c[_0x6533('0x46')],_0x1401ad['filters']));if(_0x267a1c[_0x6533('0x46')][_0x6533('0x34')]){_0x2593b8[_0x6533('0x45')]=_[_0x6533('0x62')](_0x2593b8[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x2593b8[_0x6533('0x49')],function(_0x4fce39){var _0x4117cb={};_0x4117cb[_0x4fce39]={'$like':'%'+_0x267a1c['query']['filter']+'%'};return _0x4117cb;})});}_0x2593b8=_[_0x6533('0x62')]({},_0x2593b8,_0x267a1c[_0x6533('0xd4')]);switch(_0x556cb7[_0x6533('0x30')]){case _0x6533('0x31'):return db[_[_0x6533('0xa9')](_0x267a1c[_0x6533('0x46')]['channel'])+_0x6533('0xdc')]['findAll'](_0x2593b8);case _0x6533('0x86'):case _0x6533('0x2b'):return _0x556cb7[_0x6533('0x2f')+_[_0x6533('0xa9')](_0x267a1c[_0x6533('0x46')][_0x6533('0xa2')])+'Queues'](_0x2593b8);default:throw new db[(_0x6533('0x96'))][(_0x6533('0x98'))](_0x6533('0xdd'));}})[_0x6533('0x17')](function(_0x2a5782){_0x3a9256=_0x2a5782['length'];if(!_0x267a1c[_0x6533('0x46')]['hasOwnProperty'](_0x6533('0xde'))){_0x2593b8['limit']=qs[_0x6533('0x27')](_0x267a1c[_0x6533('0x46')][_0x6533('0x27')]);_0x2593b8[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x267a1c['query'][_0x6533('0x29')]);}switch(_0x556cb7[_0x6533('0x30')]){case'admin':return db[_['capitalize'](_0x267a1c['query'][_0x6533('0xa2')])+_0x6533('0xdc')][_0x6533('0x4b')](_0x2593b8);case _0x6533('0x86'):case'agent':return _0x556cb7[_0x6533('0x2f')+_['capitalize'](_0x267a1c[_0x6533('0x46')][_0x6533('0xa2')])+_0x6533('0xaa')](_0x2593b8);}})[_0x6533('0x17')](function(_0x180fbb){return{'count':_0x3a9256,'rows':_0x180fbb};})[_0x6533('0x17')](respondWithResult(_0x3c25d7,null))['catch'](handleError(_0x3c25d7,null));};exports[_0x6533('0xdf')]=function(_0x4fabae,_0x5b07e9){var _0x2421a8={};var _0x18bcf9={};var _0x4d1af6;var _0x5224aa;return db[_0x6533('0x40')]['findOne']({'where':{'id':_0x4fabae[_0x6533('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b07e9,null))[_0x6533('0x17')](function(_0x5a0496){if(_0x5a0496){_0x4d1af6=_0x5a0496;_0x18bcf9[_0x6533('0x5d')]=_[_0x6533('0x59')](db[_0x6533('0xb2')][_0x6533('0x41')]);_0x18bcf9[_0x6533('0x46')]=_['keys'](_0x4fabae[_0x6533('0x46')]);_0x18bcf9[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x18bcf9[_0x6533('0x5d')],_0x18bcf9[_0x6533('0x46')]);_0x2421a8['attributes']=_[_0x6533('0x5c')](_0x18bcf9[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x4fabae['query'][_0x6533('0x5e')]));_0x2421a8[_0x6533('0x49')]=_0x2421a8[_0x6533('0x49')][_0x6533('0x4e')]?_0x2421a8[_0x6533('0x49')]:_0x18bcf9[_0x6533('0x5d')];_0x2421a8[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x4fabae[_0x6533('0x46')][_0x6533('0xd2')]);_0x2421a8[_0x6533('0x45')]=qs['filters'](_[_0x6533('0xd3')](_0x4fabae['query'],_0x18bcf9[_0x6533('0x5b')]));if(_0x4fabae[_0x6533('0x46')][_0x6533('0x34')]){_0x2421a8[_0x6533('0x45')]=_[_0x6533('0x62')](_0x2421a8[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x2421a8[_0x6533('0x49')],function(_0x254eb5){var _0x1c0b19={};_0x1c0b19[_0x254eb5]={'$like':'%'+_0x4fabae[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x1c0b19;})});}_0x2421a8=_[_0x6533('0x62')]({},_0x2421a8,_0x4fabae[_0x6533('0xd4')]);return _0x4d1af6[_0x6533('0xdf')](_0x2421a8);}})[_0x6533('0x17')](function(_0x37ce20){if(_0x37ce20){_0x5224aa=_0x37ce20[_0x6533('0x4e')];if(!_0x4fabae[_0x6533('0x46')]['hasOwnProperty'](_0x6533('0xde'))){_0x2421a8[_0x6533('0x27')]=qs['limit'](_0x4fabae[_0x6533('0x46')][_0x6533('0x27')]);_0x2421a8[_0x6533('0x29')]=qs['offset'](_0x4fabae['query'][_0x6533('0x29')]);}return _0x4d1af6[_0x6533('0xdf')](_0x2421a8);}})[_0x6533('0x17')](function(_0xd90962){if(_0xd90962){return _0xd90962?{'count':_0x5224aa,'rows':_0xd90962}:null;}})[_0x6533('0x17')](respondWithResult(_0x5b07e9,null))[_0x6533('0x22')](handleError(_0x5b07e9,null));};exports[_0x6533('0xe0')]=function(_0x330ef6,_0x45ea6b){var _0x2835a6={};var _0x59fee5={};var _0x251c85;var _0x4f5d98;return db['User']['findOne']({'where':{'id':_0x330ef6[_0x6533('0x57')]['id']}})['then'](handleEntityNotFound(_0x45ea6b,null))[_0x6533('0x17')](function(_0x123f44){if(_0x123f44){_0x251c85=_0x123f44;_0x59fee5[_0x6533('0x5d')]=_['keys'](db['ChatGroup'][_0x6533('0x41')]);_0x59fee5[_0x6533('0x46')]=_['keys'](_0x330ef6[_0x6533('0x46')]);_0x59fee5['filters']=_[_0x6533('0x5c')](_0x59fee5[_0x6533('0x5d')],_0x59fee5['query']);_0x2835a6[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x59fee5[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x330ef6['query'][_0x6533('0x5e')]));_0x2835a6[_0x6533('0x49')]=_0x2835a6[_0x6533('0x49')][_0x6533('0x4e')]?_0x2835a6[_0x6533('0x49')]:_0x59fee5[_0x6533('0x5d')];_0x2835a6[_0x6533('0xd1')]=qs['sort'](_0x330ef6[_0x6533('0x46')][_0x6533('0xd2')]);_0x2835a6[_0x6533('0x45')]=qs['filters'](_['pick'](_0x330ef6[_0x6533('0x46')],_0x59fee5[_0x6533('0x5b')]));if(_0x330ef6[_0x6533('0x46')][_0x6533('0x34')]){_0x2835a6[_0x6533('0x45')]=_['merge'](_0x2835a6[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x2835a6[_0x6533('0x49')],function(_0x5bb076){var _0x3decb1={};_0x3decb1[_0x5bb076]={'$like':'%'+_0x330ef6['query'][_0x6533('0x34')]+'%'};return _0x3decb1;})});}_0x2835a6=_['merge']({},_0x2835a6,_0x330ef6['options']);return _0x251c85['getGroups'](_0x2835a6);}})['then'](function(_0x43298d){if(_0x43298d){_0x4f5d98=_0x43298d[_0x6533('0x4e')];if(!_0x330ef6[_0x6533('0x46')][_0x6533('0xd5')](_0x6533('0xde'))){_0x2835a6[_0x6533('0x27')]=qs['limit'](_0x330ef6['query'][_0x6533('0x27')]);_0x2835a6[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x330ef6[_0x6533('0x46')][_0x6533('0x29')]);}return _0x251c85[_0x6533('0xe0')](_0x2835a6);}})[_0x6533('0x17')](function(_0x298992){if(_0x298992){return _0x298992?{'count':_0x4f5d98,'rows':_0x298992}:null;}})[_0x6533('0x17')](respondWithResult(_0x45ea6b,null))[_0x6533('0x22')](handleError(_0x45ea6b,null));};exports[_0x6533('0xe1')]=function(_0x4a45d1,_0xe99189){var _0x410403={'raw':!![],'where':{}};var _0x24efdb={};var _0x5353b6={'count':0x0,'rows':[]};return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x4a45d1['params']['id']}})[_0x6533('0x17')](handleEntityNotFound(_0xe99189,null))[_0x6533('0x17')](function(_0x5b59be){if(_0x5b59be){_0x24efdb[_0x6533('0x5d')]=_['keys'](db[_0x6533('0xe2')]['rawAttributes']);_0x24efdb['query']=_[_0x6533('0x59')](_0x4a45d1['query']);_0x24efdb[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x24efdb[_0x6533('0x5d')],_0x24efdb['query']);_0x410403[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x24efdb[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x4a45d1[_0x6533('0x46')][_0x6533('0x5e')]));_0x410403['attributes']=_0x410403[_0x6533('0x49')][_0x6533('0x4e')]?_0x410403['attributes']:_0x24efdb[_0x6533('0x5d')];if(!_0x4a45d1[_0x6533('0x46')][_0x6533('0xd5')](_0x6533('0xde'))){_0x410403[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x4a45d1['query'][_0x6533('0x27')]);_0x410403[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x4a45d1['query']['offset']);}_0x410403[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x4a45d1[_0x6533('0x46')][_0x6533('0xd2')]);_0x410403['where']=qs[_0x6533('0x5b')](_['pick'](_0x4a45d1['query'],_0x24efdb[_0x6533('0x5b')]));_0x410403[_0x6533('0x45')]['UserId']=_0x5b59be['id'];if(_0x4a45d1['query'][_0x6533('0x34')]){_0x410403[_0x6533('0x45')]=_[_0x6533('0x62')](_0x410403[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x410403[_0x6533('0x49')],function(_0x4d2eb5){var _0x410ded={};_0x410ded[_0x4d2eb5]={'$like':'%'+_0x4a45d1['query'][_0x6533('0x34')]+'%'};return _0x410ded;})});}_0x410403=_[_0x6533('0x62')]({},_0x410403,_0x4a45d1[_0x6533('0xd4')]);return db[_0x6533('0xe2')][_0x6533('0x28')]({'where':_0x410403['where']})['then'](function(_0x38b42e){_0x5353b6[_0x6533('0x28')]=_0x38b42e;if(_0x4a45d1['query'][_0x6533('0x5f')]){_0x410403[_0x6533('0x47')]=[{'all':!![]}];}return db[_0x6533('0xe2')][_0x6533('0x4b')](_0x410403);})[_0x6533('0x17')](function(_0x839209){_0x5353b6['rows']=_0x839209;return _0x5353b6;});}})[_0x6533('0x17')](respondWithFilteredResult(_0xe99189,_0x410403))[_0x6533('0x22')](handleError(_0xe99189,null));};exports[_0x6533('0xe3')]=function(_0x12093c,_0x472a45){var _0x2a1b62={'raw':!![],'where':{}};var _0xba4a39={};var _0x12f1b6={'count':0x0,'rows':[]};return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x12093c[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x472a45,null))[_0x6533('0x17')](function(_0x5b0530){if(_0x5b0530){_0xba4a39['model']=_[_0x6533('0x59')](db[_0x6533('0xe4')][_0x6533('0x41')]);_0xba4a39[_0x6533('0x46')]=_[_0x6533('0x59')](_0x12093c[_0x6533('0x46')]);_0xba4a39['filters']=_[_0x6533('0x5c')](_0xba4a39[_0x6533('0x5d')],_0xba4a39[_0x6533('0x46')]);_0x2a1b62[_0x6533('0x49')]=_[_0x6533('0x5c')](_0xba4a39[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x12093c[_0x6533('0x46')][_0x6533('0x5e')]));_0x2a1b62[_0x6533('0x49')]=_0x2a1b62[_0x6533('0x49')]['length']?_0x2a1b62[_0x6533('0x49')]:_0xba4a39[_0x6533('0x5d')];if(!_0x12093c[_0x6533('0x46')]['hasOwnProperty'](_0x6533('0xde'))){_0x2a1b62[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x12093c[_0x6533('0x46')][_0x6533('0x27')]);_0x2a1b62[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x12093c[_0x6533('0x46')][_0x6533('0x29')]);}_0x2a1b62[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x12093c[_0x6533('0x46')][_0x6533('0xd2')]);_0x2a1b62['where']=qs[_0x6533('0x5b')](_['pick'](_0x12093c['query'],_0xba4a39[_0x6533('0x5b')]));_0x2a1b62['where']['UserId']=_0x5b0530['id'];if(_0x12093c[_0x6533('0x46')]['filter']){_0x2a1b62[_0x6533('0x45')]=_[_0x6533('0x62')](_0x2a1b62[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x2a1b62['attributes'],function(_0x505224){var _0x51f9f4={};_0x51f9f4[_0x505224]={'$like':'%'+_0x12093c[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x51f9f4;})});}_0x2a1b62=_[_0x6533('0x62')]({},_0x2a1b62,_0x12093c['options']);return db[_0x6533('0xe4')][_0x6533('0x28')]({'where':_0x2a1b62[_0x6533('0x45')]})[_0x6533('0x17')](function(_0x265911){_0x12f1b6[_0x6533('0x28')]=_0x265911;if(_0x12093c['query'][_0x6533('0x5f')]){_0x2a1b62['include']=[{'all':!![]}];}return db[_0x6533('0xe4')][_0x6533('0x4b')](_0x2a1b62);})['then'](function(_0x45305b){_0x12f1b6[_0x6533('0x4d')]=_0x45305b;return _0x12f1b6;});}})[_0x6533('0x17')](respondWithFilteredResult(_0x472a45,_0x2a1b62))['catch'](handleError(_0x472a45,null));};exports[_0x6533('0xe5')]=function(_0x469a14,_0x495fab){var _0x2ead12={};var _0x1dbac1={};var _0x4509eb;var _0x5dcd10;return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x469a14[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x495fab,null))[_0x6533('0x17')](function(_0xfe52df){if(_0xfe52df){_0x4509eb=_0xfe52df;_0x1dbac1[_0x6533('0x5d')]=_[_0x6533('0x59')](db[_0x6533('0xe6')][_0x6533('0x41')]);_0x1dbac1['query']=_[_0x6533('0x59')](_0x469a14[_0x6533('0x46')]);_0x1dbac1['filters']=_[_0x6533('0x5c')](_0x1dbac1[_0x6533('0x5d')],_0x1dbac1['query']);_0x2ead12[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x1dbac1[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x469a14[_0x6533('0x46')]['fields']));_0x2ead12[_0x6533('0x49')]=_0x2ead12['attributes']['length']?_0x2ead12[_0x6533('0x49')]:_0x1dbac1['model'];_0x2ead12[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x469a14[_0x6533('0x46')][_0x6533('0xd2')]);_0x2ead12[_0x6533('0x45')]=qs['filters'](_[_0x6533('0xd3')](_0x469a14[_0x6533('0x46')],_0x1dbac1['filters']));if(_0x469a14[_0x6533('0x46')][_0x6533('0x34')]){_0x2ead12[_0x6533('0x45')]=_[_0x6533('0x62')](_0x2ead12[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x2ead12[_0x6533('0x49')],function(_0x349074){var _0xb7da4f={};_0xb7da4f[_0x349074]={'$like':'%'+_0x469a14[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0xb7da4f;})});}_0x2ead12=_[_0x6533('0x62')]({},_0x2ead12,_0x469a14['options']);return _0x4509eb[_0x6533('0xe5')](_0x2ead12);}})[_0x6533('0x17')](function(_0x3a55d0){if(_0x3a55d0){_0x5dcd10=_0x3a55d0[_0x6533('0x4e')];if(!_0x469a14['query'][_0x6533('0xd5')](_0x6533('0xde'))){_0x2ead12[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x469a14['query']['limit']);_0x2ead12['offset']=qs['offset'](_0x469a14[_0x6533('0x46')][_0x6533('0x29')]);}return _0x4509eb[_0x6533('0xe5')](_0x2ead12);}})['then'](function(_0x306ec1){if(_0x306ec1){return _0x306ec1?{'count':_0x5dcd10,'rows':_0x306ec1}:null;}})[_0x6533('0x17')](respondWithResult(_0x495fab,null))[_0x6533('0x22')](handleError(_0x495fab,null));};exports[_0x6533('0xe7')]=function(_0x1466a6,_0x126f8b){var _0x1e5745={};var _0x4412ee={};var _0x39c72e;var _0x502b5e;return db[_0x6533('0x40')]['findOne']({'where':{'id':_0x1466a6[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x126f8b,null))[_0x6533('0x17')](function(_0x62fcc2){if(_0x62fcc2){_0x39c72e=_0x62fcc2;_0x4412ee['model']=_[_0x6533('0x59')](db[_0x6533('0xe8')][_0x6533('0x41')]);_0x4412ee[_0x6533('0x46')]=_[_0x6533('0x59')](_0x1466a6[_0x6533('0x46')]);_0x4412ee[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x4412ee[_0x6533('0x5d')],_0x4412ee[_0x6533('0x46')]);_0x1e5745[_0x6533('0x49')]=_['intersection'](_0x4412ee['model'],qs['fields'](_0x1466a6[_0x6533('0x46')]['fields']));_0x1e5745[_0x6533('0x49')]=_0x1e5745[_0x6533('0x49')][_0x6533('0x4e')]?_0x1e5745[_0x6533('0x49')]:_0x4412ee['model'];_0x1e5745['order']=qs[_0x6533('0xd2')](_0x1466a6[_0x6533('0x46')]['sort']);_0x1e5745['where']=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x1466a6[_0x6533('0x46')],_0x4412ee[_0x6533('0x5b')]));if(_0x1466a6['query']['filter']){_0x1e5745[_0x6533('0x45')]=_[_0x6533('0x62')](_0x1e5745[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x1e5745[_0x6533('0x49')],function(_0x5eaa74){var _0x1663f6={};_0x1663f6[_0x5eaa74]={'$like':'%'+_0x1466a6[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x1663f6;})});}_0x1e5745=_['merge']({},_0x1e5745,_0x1466a6[_0x6533('0xd4')]);return _0x39c72e[_0x6533('0xe7')](_0x1e5745);}})[_0x6533('0x17')](function(_0x2244a4){if(_0x2244a4){_0x502b5e=_0x2244a4['length'];if(!_0x1466a6[_0x6533('0x46')][_0x6533('0xd5')]('nolimit')){_0x1e5745[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x1466a6[_0x6533('0x46')]['limit']);_0x1e5745['offset']=qs[_0x6533('0x29')](_0x1466a6[_0x6533('0x46')]['offset']);}return _0x39c72e[_0x6533('0xe7')](_0x1e5745);}})[_0x6533('0x17')](function(_0x39341e){if(_0x39341e){return _0x39341e?{'count':_0x502b5e,'rows':_0x39341e}:null;}})[_0x6533('0x17')](respondWithResult(_0x126f8b,null))[_0x6533('0x22')](handleError(_0x126f8b,null));};exports[_0x6533('0xe9')]=function(_0x2801e2,_0x4f480d){var _0x4ce4e2={'raw':!![],'where':{}};var _0x430959={};var _0x9ffe05={'count':0x0,'rows':[]};return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x2801e2['params']['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x4f480d,null))['then'](function(_0x1b97dd){if(_0x1b97dd){_0x430959[_0x6533('0x5d')]=_[_0x6533('0x59')](db[_0x6533('0xea')][_0x6533('0x41')]);_0x430959[_0x6533('0x46')]=_['keys'](_0x2801e2[_0x6533('0x46')]);_0x430959['filters']=_[_0x6533('0x5c')](_0x430959[_0x6533('0x5d')],_0x430959[_0x6533('0x46')]);_0x4ce4e2[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x430959[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x2801e2['query'][_0x6533('0x5e')]));_0x4ce4e2[_0x6533('0x49')]=_0x4ce4e2[_0x6533('0x49')][_0x6533('0x4e')]?_0x4ce4e2[_0x6533('0x49')]:_0x430959[_0x6533('0x5d')];if(!_0x2801e2[_0x6533('0x46')]['hasOwnProperty'](_0x6533('0xde'))){_0x4ce4e2[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x2801e2[_0x6533('0x46')][_0x6533('0x27')]);_0x4ce4e2[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x2801e2['query'][_0x6533('0x29')]);}_0x4ce4e2[_0x6533('0xd1')]=qs['sort'](_0x2801e2[_0x6533('0x46')][_0x6533('0xd2')]);_0x4ce4e2['where']=qs['filters'](_[_0x6533('0xd3')](_0x2801e2[_0x6533('0x46')],_0x430959['filters']));_0x4ce4e2['where']['UserId']=_0x1b97dd['id'];if(_0x2801e2[_0x6533('0x46')][_0x6533('0x34')]){_0x4ce4e2[_0x6533('0x45')]=_[_0x6533('0x62')](_0x4ce4e2[_0x6533('0x45')],{'$or':_['map'](_0x4ce4e2[_0x6533('0x49')],function(_0xf3ff8){var _0xb7e4d0={};_0xb7e4d0[_0xf3ff8]={'$like':'%'+_0x2801e2['query']['filter']+'%'};return _0xb7e4d0;})});}_0x4ce4e2=_[_0x6533('0x62')]({},_0x4ce4e2,_0x2801e2[_0x6533('0xd4')]);return db[_0x6533('0xea')][_0x6533('0x28')]({'where':_0x4ce4e2[_0x6533('0x45')]})[_0x6533('0x17')](function(_0x4f14ff){_0x9ffe05[_0x6533('0x28')]=_0x4f14ff;if(_0x2801e2[_0x6533('0x46')][_0x6533('0x5f')]){_0x4ce4e2[_0x6533('0x47')]=[{'all':!![]}];}return db[_0x6533('0xea')][_0x6533('0x4b')](_0x4ce4e2);})[_0x6533('0x17')](function(_0x1deafb){_0x9ffe05[_0x6533('0x4d')]=_0x1deafb;return _0x9ffe05;});}})[_0x6533('0x17')](respondWithFilteredResult(_0x4f480d,_0x4ce4e2))[_0x6533('0x22')](handleError(_0x4f480d,null));};exports[_0x6533('0xeb')]=function(_0x5eb68d,_0x29231e){var _0x4c8107={};var _0x29dc5c={};var _0x3b6d03;var _0x566fc4;return db[_0x6533('0x40')]['findOne']({'where':{'id':_0x5eb68d[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x29231e,null))[_0x6533('0x17')](function(_0x17c817){if(_0x17c817){_0x3b6d03=_0x17c817;_0x29dc5c['model']=_[_0x6533('0x59')](db[_0x6533('0xec')][_0x6533('0x41')]);_0x29dc5c[_0x6533('0x46')]=_[_0x6533('0x59')](_0x5eb68d[_0x6533('0x46')]);_0x29dc5c[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x29dc5c[_0x6533('0x5d')],_0x29dc5c['query']);_0x4c8107[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x29dc5c[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x5eb68d[_0x6533('0x46')][_0x6533('0x5e')]));_0x4c8107[_0x6533('0x49')]=_0x4c8107[_0x6533('0x49')][_0x6533('0x4e')]?_0x4c8107[_0x6533('0x49')]:_0x29dc5c[_0x6533('0x5d')];_0x4c8107[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x5eb68d[_0x6533('0x46')][_0x6533('0xd2')]);_0x4c8107[_0x6533('0x45')]=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x5eb68d['query'],_0x29dc5c['filters']));if(_0x5eb68d['query']['filter']){_0x4c8107[_0x6533('0x45')]=_[_0x6533('0x62')](_0x4c8107[_0x6533('0x45')],{'$or':_['map'](_0x4c8107[_0x6533('0x49')],function(_0x4c38e4){var _0x34d2ca={};_0x34d2ca[_0x4c38e4]={'$like':'%'+_0x5eb68d[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x34d2ca;})});}_0x4c8107=_[_0x6533('0x62')]({},_0x4c8107,_0x5eb68d[_0x6533('0xd4')]);return _0x3b6d03[_0x6533('0xeb')](_0x4c8107);}})[_0x6533('0x17')](function(_0x63b9de){if(_0x63b9de){_0x566fc4=_0x63b9de['length'];if(!_0x5eb68d[_0x6533('0x46')][_0x6533('0xd5')](_0x6533('0xde'))){_0x4c8107[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x5eb68d[_0x6533('0x46')]['limit']);_0x4c8107[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x5eb68d['query'][_0x6533('0x29')]);}return _0x3b6d03[_0x6533('0xeb')](_0x4c8107);}})[_0x6533('0x17')](function(_0x4fdd66){if(_0x4fdd66){return _0x4fdd66?{'count':_0x566fc4,'rows':_0x4fdd66}:null;}})[_0x6533('0x17')](respondWithResult(_0x29231e,null))[_0x6533('0x22')](handleError(_0x29231e,null));};exports[_0x6533('0xed')]=function(_0x5e2921,_0x3c70f9){var _0x4e8453={};var _0x10342b={};var _0x4509e4;var _0xd1a1dd;return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x5e2921[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x3c70f9,null))[_0x6533('0x17')](function(_0x4e4e2f){if(_0x4e4e2f){_0x4509e4=_0x4e4e2f;_0x10342b[_0x6533('0x5d')]=_[_0x6533('0x59')](db[_0x6533('0xee')][_0x6533('0x41')]);_0x10342b['query']=_[_0x6533('0x59')](_0x5e2921[_0x6533('0x46')]);_0x10342b[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x10342b['model'],_0x10342b['query']);_0x4e8453[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x10342b['model'],qs[_0x6533('0x5e')](_0x5e2921[_0x6533('0x46')][_0x6533('0x5e')]));_0x4e8453[_0x6533('0x49')]=_0x4e8453[_0x6533('0x49')][_0x6533('0x4e')]?_0x4e8453[_0x6533('0x49')]:_0x10342b['model'];_0x4e8453[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x5e2921[_0x6533('0x46')][_0x6533('0xd2')]);_0x4e8453[_0x6533('0x45')]=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x5e2921[_0x6533('0x46')],_0x10342b[_0x6533('0x5b')]));if(_0x5e2921[_0x6533('0x46')]['filter']){_0x4e8453[_0x6533('0x45')]=_[_0x6533('0x62')](_0x4e8453['where'],{'$or':_[_0x6533('0x36')](_0x4e8453['attributes'],function(_0xbb8ce3){var _0x1b729d={};_0x1b729d[_0xbb8ce3]={'$like':'%'+_0x5e2921[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x1b729d;})});}_0x4e8453=_['merge']({},_0x4e8453,_0x5e2921['options']);return _0x4509e4[_0x6533('0xed')](_0x4e8453);}})[_0x6533('0x17')](function(_0x25dc9e){if(_0x25dc9e){_0xd1a1dd=_0x25dc9e[_0x6533('0x4e')];if(!_0x5e2921[_0x6533('0x46')][_0x6533('0xd5')]('nolimit')){_0x4e8453[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x5e2921['query'][_0x6533('0x27')]);_0x4e8453[_0x6533('0x29')]=qs['offset'](_0x5e2921[_0x6533('0x46')]['offset']);}return _0x4509e4['getFaxInteractions'](_0x4e8453);}})[_0x6533('0x17')](function(_0x44153f){if(_0x44153f){return _0x44153f?{'count':_0xd1a1dd,'rows':_0x44153f}:null;}})[_0x6533('0x17')](respondWithResult(_0x3c70f9,null))[_0x6533('0x22')](handleError(_0x3c70f9,null));};exports[_0x6533('0xef')]=function(_0x2beb65,_0x23e1dc){var _0x577dbf={};var _0x3d7880={};var _0x24efdd;var _0x18c202;return db[_0x6533('0x40')]['findOne']({'where':{'id':_0x2beb65[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x23e1dc,null))[_0x6533('0x17')](function(_0x8f138){if(_0x8f138){_0x24efdd=_0x8f138;_0x3d7880[_0x6533('0x5d')]=_[_0x6533('0x59')](db[_0x6533('0xf0')][_0x6533('0x41')]);_0x3d7880['query']=_[_0x6533('0x59')](_0x2beb65[_0x6533('0x46')]);_0x3d7880[_0x6533('0x5b')]=_['intersection'](_0x3d7880[_0x6533('0x5d')],_0x3d7880[_0x6533('0x46')]);_0x577dbf[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x3d7880[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x2beb65[_0x6533('0x46')]['fields']));_0x577dbf[_0x6533('0x49')]=_0x577dbf[_0x6533('0x49')][_0x6533('0x4e')]?_0x577dbf[_0x6533('0x49')]:_0x3d7880[_0x6533('0x5d')];_0x577dbf[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x2beb65[_0x6533('0x46')][_0x6533('0xd2')]);_0x577dbf[_0x6533('0x45')]=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x2beb65['query'],_0x3d7880['filters']));if(_0x2beb65[_0x6533('0x46')][_0x6533('0x34')]){_0x577dbf[_0x6533('0x45')]=_['merge'](_0x577dbf[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x577dbf[_0x6533('0x49')],function(_0x494647){var _0x4d7a8f={};_0x4d7a8f[_0x494647]={'$like':'%'+_0x2beb65[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x4d7a8f;})});}_0x577dbf=_['merge']({},_0x577dbf,_0x2beb65[_0x6533('0xd4')]);return _0x24efdd[_0x6533('0xef')](_0x577dbf);}})[_0x6533('0x17')](function(_0x518121){if(_0x518121){_0x18c202=_0x518121[_0x6533('0x4e')];if(!_0x2beb65['query'][_0x6533('0xd5')](_0x6533('0xde'))){_0x577dbf[_0x6533('0x27')]=qs['limit'](_0x2beb65[_0x6533('0x46')][_0x6533('0x27')]);_0x577dbf[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x2beb65[_0x6533('0x46')]['offset']);}return _0x24efdd[_0x6533('0xef')](_0x577dbf);}})[_0x6533('0x17')](function(_0x535f96){if(_0x535f96){return _0x535f96?{'count':_0x18c202,'rows':_0x535f96}:null;}})['then'](respondWithResult(_0x23e1dc,null))['catch'](handleError(_0x23e1dc,null));};exports[_0x6533('0xf1')]=function(_0x19b21b,_0x338dca,_0x358139){var _0x21df42;var _0x3676bf;var _0x1cb1f8;var _0x113233=!_[_0x6533('0x6e')](_0x19b21b[_0x6533('0x57')]['id'])?_0x19b21b[_0x6533('0x57')]['id']:!_['isNil'](_0x19b21b['user']['id'])?_0x19b21b[_0x6533('0x86')]['id']:null;return db[_0x6533('0x40')][_0x6533('0x39')]({'where':{'id':_0x113233,'role':{'$or':[_0x6533('0x31'),_0x6533('0x86'),_0x6533('0x2b')]}},'attributes':['id',_0x6533('0x3a'),_0x6533('0xf2'),_0x6533('0xf3'),'role',_0x6533('0x69'),'loginInPause']})[_0x6533('0x17')](function(_0x106c96){if(_0x106c96){if(_0x106c96[_0x6533('0x30')]===_0x6533('0x2b')){_0x21df42=_0x106c96;if(_0x19b21b[_0x6533('0x64')][_0x6533('0xa5')]){_0x1cb1f8=util['format'](_0x6533('0xf4'),_0x21df42[_0x19b21b[_0x6533('0x64')]['interface']]);}else if(_0x19b21b[_0x6533('0x64')][_0x6533('0xf5')]){_0x1cb1f8=util[_0x6533('0xaf')](_0x6533('0xb0'),_0x19b21b[_0x6533('0x64')]['intrf']);}else{_0x1cb1f8=util[_0x6533('0xaf')]('SIP/%s',_0x21df42[_0x6533('0x3a')]);}socket['to'](util[_0x6533('0xaf')](_0x6533('0xf6'),_0x21df42[_0x6533('0x3a')]))[_0x6533('0x2c')](_0x6533('0xf7'),{'user':{'id':_0x21df42['id'],'name':_0x21df42[_0x6533('0x3a')]},'ip':_0x19b21b[_0x6533('0xf8')]['x-forwarded-for']||_0x19b21b['connection'][_0x6533('0xf9')]||_0x19b21b[_0x6533('0xfa')][_0x6533('0xf9')]||_0x19b21b[_0x6533('0xfb')]['socket'][_0x6533('0xf9')]});return db[_0x6533('0xb2')][_0x6533('0x2e')]({'where':{'membername':_0x21df42[_0x6533('0x3a')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x6533('0x98'))](_0x6533('0xfc'));}})[_0x6533('0x17')](function(){if(_0x21df42){return _0x21df42[_0x6533('0xfd')]({'raw':!![]});}})[_0x6533('0x17')](function(_0xdc78b){if(_0x21df42){if(_0xdc78b){_0x3676bf=_0xdc78b;if(_0x3676bf[_0x6533('0x4e')]){var _0x5af95a=_0x3676bf[_0x6533('0x36')](function(_0x3908fb){var _0x34adb5={'membername':_0x21df42['name'],'UserId':_0x21df42['id'],'queue_name':_0x3908fb[_0x6533('0x3a')],'VoiceQueueId':_0x3908fb['id'],'interface':_0x1cb1f8,'paused':_0x21df42[_0x6533('0xa3')]||![],'penalty':_0x3908fb['UserVoiceQueue.penalty']||0x0};return db[_0x6533('0xb2')]['upsert'](_0x34adb5);});return Promise['all'](_0x5af95a);}}}})[_0x6533('0x17')](function(){if(_0x21df42){return db['MemberReport'][_0x6533('0x4b')]({'where':{'membername':_0x21df42[_0x6533('0x3a')],'exitAt':null}});}})[_0x6533('0x17')](function(_0x99c169){if(_0x21df42){var _0x90d8b3=[];_0x99c169['forEach'](function(_0x1e1779){_0x90d8b3['push'](_0x1e1779[_0x6533('0xfe')]({'exitAt':moment()[_0x6533('0xaf')](_0x6533('0xff'))}));});return Promise[_0x6533('0x55')](_0x90d8b3);}})['then'](function(){if(_0x21df42){var _0x1814c7=[];var _0x128eb6=[];var _0x2b7bd6=utils['getChannels']();var _0x4bf6e4={'membername':_0x21df42[_0x6533('0x3a')],'interface':_0x1cb1f8,'enterAt':moment()[_0x6533('0xaf')](_0x6533('0xff')),'role':_0x21df42[_0x6533('0x30')],'internal':_0x21df42[_0x6533('0x69')]};_0x2b7bd6[_0x6533('0x100')](function(_0x581c2f){_0x1814c7[_0x6533('0x4a')](_[_0x6533('0x62')]({'channel':_0x581c2f,'type':_0x6533('0x101'),'data1':_0x19b21b[_0x6533('0x64')]['device'],'data2':_0x1cb1f8},_0x4bf6e4));if(_0x21df42[_0x6533('0xa3')]){_0x128eb6[_0x6533('0x4a')](_[_0x6533('0x62')]({'channel':_0x581c2f,'type':_0x6533('0x102'),'data1':'LOGININPAUSE'},_0x4bf6e4));}});return db[_0x6533('0x103')][_0x6533('0x8f')](_0x1814c7[_0x6533('0xce')](_0x128eb6),{'individualHooks':!![]});}})[_0x6533('0x17')](function(){if(_0x21df42){return _0x21df42[_0x6533('0xfe')]({'online':!![],'lastLoginAt':moment()[_0x6533('0xaf')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x21df42['loginInPause']||![],'mailPause':_0x21df42['loginInPause']||![],'chatPause':_0x21df42['loginInPause']||![],'faxPause':_0x21df42[_0x6533('0xa3')]||![],'smsPause':_0x21df42[_0x6533('0xa3')]||![],'openchannelPause':_0x21df42[_0x6533('0xa3')]||![],'whatsappPause':_0x21df42[_0x6533('0xa3')]||![],'pauseType':_0x21df42[_0x6533('0xa3')]?_0x6533('0x104'):null,'interface':_0x1cb1f8,'lastPauseAt':moment()[_0x6533('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x6533('0x17')](function(_0xda1a52){if(_0x19b21b['isMiddleware']){return _0x358139();}else{return Promise[_0x6533('0x105')](_0xda1a52)['then'](respondWithResult(_0x338dca,null));}})['catch'](handleError(_0x338dca,null));};exports[_0x6533('0x106')]=function(_0x5524b2,_0x456ac9){var _0x3a13d6;return db[_0x6533('0x40')][_0x6533('0x39')]({'where':{'id':_0x5524b2['params']['id'],'role':_0x6533('0x2b')},'attributes':['id',_0x6533('0x3a'),_0x6533('0x30')]})[_0x6533('0x17')](handleEntityNotFound(_0x456ac9,null))[_0x6533('0x17')](function(_0x2ba68e){if(_0x2ba68e){_0x3a13d6=_0x2ba68e;return db[_0x6533('0xb2')]['destroy']({'where':{'membername':_0x3a13d6[_0x6533('0x3a')]},'individualHooks':!![]});}})['then'](function(){return db[_0x6533('0x103')][_0x6533('0x4b')]({'where':{'membername':_0x3a13d6[_0x6533('0x3a')],'exitAt':null}});})[_0x6533('0x17')](function(_0x56bd1a){var _0xb3637f=[];_0x56bd1a[_0x6533('0x100')](function(_0x217696){_0xb3637f[_0x6533('0x4a')](_0x217696[_0x6533('0xfe')]({'exitAt':moment()[_0x6533('0xaf')](_0x6533('0xff'))}));});return Promise[_0x6533('0x55')](_0xb3637f);})[_0x6533('0x17')](function(){return _0x3a13d6[_0x6533('0xfe')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6533('0x17')](respondWithResult(_0x456ac9,null))['catch'](handleError(_0x456ac9,null));};exports[_0x6533('0x107')]=function(_0x2164ff,_0x5c9c11){var _0x5ef067;return db[_0x6533('0xb2')][_0x6533('0xfe')]({'paused':0x1},{'where':{'UserId':_0x2164ff[_0x6533('0x57')]['id']},'individualHooks':!![]})[_0x6533('0x17')](function(){return db['User']['find']({'where':{'id':_0x2164ff[_0x6533('0x57')]['id'],'role':_0x6533('0x2b')},'attributes':['id',_0x6533('0x3a'),_0x6533('0x30'),'internal',_0x6533('0xa5'),_0x6533('0xae')]});})[_0x6533('0x17')](handleEntityNotFound(_0x5c9c11,null))[_0x6533('0x17')](function(_0x5a7d5e){if(_0x5a7d5e){_0x5ef067=_0x5a7d5e;return respondWithRpcPromise(_0x6533('0x108'),_0x6533('0x107'),{'id':_0x5ef067['id'],'name':_0x5ef067[_0x6533('0x3a')],'pause':!![]});}})['then'](function(){if(_0x5ef067){return db[_0x6533('0x103')][_0x6533('0x4b')]({'where':{'membername':_0x5ef067[_0x6533('0x3a')],'type':'PAUSE','exitAt':null}});}})[_0x6533('0x17')](function(_0x3105ae){if(_0x3105ae[_0x6533('0x4e')]){var _0x2ce07f=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x25bf07=0x0,_0x107f5f=_0x3105ae[_0x6533('0x4e')];_0x25bf07<_0x107f5f;_0x25bf07++){_0x3105ae[_0x25bf07][_0x6533('0x109')]({'exitAt':_0x2ce07f});}}})[_0x6533('0x17')](function(){var _0x1a2fd6=[];var _0x411086=utils[_0x6533('0x10a')]();_0x411086[_0x6533('0x100')](function(_0x4b1b80){_0x1a2fd6[_0x6533('0x4a')]({'channel':_0x4b1b80,'membername':_0x5ef067[_0x6533('0x3a')],'interface':_[_0x6533('0x6e')](_0x5ef067[_0x6533('0xa5')])?util[_0x6533('0xaf')](_0x6533('0xb0'),_0x5ef067[_0x6533('0x3a')]):_0x5ef067['interface'],'type':_0x6533('0x102'),'enterAt':moment()[_0x6533('0xaf')](_0x6533('0xff')),'data1':_0x2164ff[_0x6533('0x64')][_0x6533('0x42')]||'DEFAULT\x20PAUSE','role':_0x5ef067[_0x6533('0x30')],'internal':_0x5ef067[_0x6533('0x69')]});});return db[_0x6533('0x103')][_0x6533('0x8f')](_0x1a2fd6,{'individualHooks':!![]});})[_0x6533('0x17')](function(){return _0x5ef067[_0x6533('0xfe')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2164ff[_0x6533('0x64')][_0x6533('0x42')]||_0x6533('0x10b'),'lastPauseAt':moment()[_0x6533('0xaf')](_0x6533('0xff'))});})[_0x6533('0x17')](respondWithResult(_0x5c9c11,null))['catch'](handleError(_0x5c9c11,null));};exports[_0x6533('0x10c')]=function(_0x16f1ba,_0x4d5744){if(_0x16f1ba['body'][_0x6533('0xa2')]&&!utils[_0x6533('0xa6')](_0x16f1ba['body']['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x16f1ba[_0x6533('0x64')][_0x6533('0xa2')]));}return db['User'][_0x6533('0x39')]({'where':{'id':_0x16f1ba[_0x6533('0x57')]['id']},'attributes':['id',_0x6533('0x3a'),_0x6533('0x30'),'internal','interface',_0x6533('0xae'),'voicePause',_0x6533('0x10d'),_0x6533('0x10e'),_0x6533('0x10f'),_0x6533('0x110'),_0x6533('0x111'),_0x6533('0x112'),_0x6533('0x113'),_0x6533('0x114')]})[_0x6533('0x17')](function(_0x36c7f0){if(!_0x36c7f0){throw new APINotFoundError(util['format'](_0x6533('0x115'),_0x16f1ba[_0x6533('0x57')]['id']));}return _0x36c7f0[_0x6533('0x10c')](_0x16f1ba[_0x6533('0x64')][_0x6533('0xa2')]);})[_0x6533('0x17')](respondWithResult(_0x4d5744,null))[_0x6533('0x22')](APIHandleError(_0x4d5744));};exports['getTeams']=function(_0x2759a8,_0x369814){var _0x6a4c42={};var _0x165756={};var _0x1ab092;var _0x41b854;return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x2759a8['params']['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x369814,null))['then'](function(_0xfcddac){if(_0xfcddac){_0x1ab092=_0xfcddac;_0x165756['model']=_[_0x6533('0x59')](db['Team'][_0x6533('0x41')]);_0x165756[_0x6533('0x46')]=_[_0x6533('0x59')](_0x2759a8[_0x6533('0x46')]);_0x165756[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x165756[_0x6533('0x5d')],_0x165756[_0x6533('0x46')]);_0x6a4c42['attributes']=_[_0x6533('0x5c')](_0x165756[_0x6533('0x5d')],qs['fields'](_0x2759a8['query'][_0x6533('0x5e')]));_0x6a4c42[_0x6533('0x49')]=_0x6a4c42[_0x6533('0x49')]['length']?_0x6a4c42[_0x6533('0x49')]:_0x165756['model'];_0x6a4c42[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x2759a8[_0x6533('0x46')]['sort']);_0x6a4c42[_0x6533('0x45')]=qs[_0x6533('0x5b')](_['pick'](_0x2759a8[_0x6533('0x46')],_0x165756[_0x6533('0x5b')]));if(_0x2759a8[_0x6533('0x46')][_0x6533('0x34')]){_0x6a4c42['where']=_[_0x6533('0x62')](_0x6a4c42['where'],{'$or':_[_0x6533('0x36')](_0x6a4c42[_0x6533('0x49')],function(_0x1779df){var _0x74674={};_0x74674[_0x1779df]={'$like':'%'+_0x2759a8[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x74674;})});}_0x6a4c42=_['merge']({},_0x6a4c42,_0x2759a8[_0x6533('0xd4')]);return _0x1ab092[_0x6533('0x116')](_0x6a4c42);}})[_0x6533('0x17')](function(_0xc22c41){if(_0xc22c41){_0x41b854=_0xc22c41[_0x6533('0x4e')];if(!_0x2759a8[_0x6533('0x46')][_0x6533('0xd5')]('nolimit')){_0x6a4c42['limit']=qs[_0x6533('0x27')](_0x2759a8[_0x6533('0x46')]['limit']);_0x6a4c42[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x2759a8[_0x6533('0x46')][_0x6533('0x29')]);}return _0x1ab092[_0x6533('0x116')](_0x6a4c42);}})[_0x6533('0x17')](function(_0x2b09db){if(_0x2b09db){return _0x2b09db?{'count':_0x41b854,'rows':_0x2b09db}:null;}})[_0x6533('0x17')](respondWithResult(_0x369814,null))[_0x6533('0x22')](handleError(_0x369814,null));};exports[_0x6533('0x117')]=function(_0x1b276b,_0x4b1bf4){var _0x4e1d03=_0x1b276b[_0x6533('0x57')]['id'];var _0x59c97e=_0x1b276b[_0x6533('0x64')]?_0x1b276b[_0x6533('0x64')]['ids']:null;var _0x5ca793=[];return Promise[_0x6533('0x105')]()[_0x6533('0x17')](function(){if(!_0x59c97e)throw new APIBadRequestError(_0x6533('0x118'));})[_0x6533('0x17')](function(){return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x4e1d03}});})[_0x6533('0x17')](function(_0x31dee3){if(!_0x31dee3)throw new APINotFoundError(util[_0x6533('0xaf')](_0x6533('0x115'),_0x1b276b[_0x6533('0x57')]['id']));return db[_0x6533('0x70')][_0x6533('0x119')](function(_0x4752a4){return _0x31dee3[_0x6533('0x117')](_0x59c97e,{'transaction':_0x4752a4})[_0x6533('0x17')](function(){return db[_0x6533('0x11a')]['findAll']({'where':{'id':{'$in':_0x59c97e}}});})[_0x6533('0x17')](function(_0x56ffa8){var _0x3d03fd=_[_0x6533('0x36')](_0x56ffa8,function(_0x49609e){return _0x49609e[_0x6533('0x11b')]();});return Promise[_0x6533('0x55')](_0x3d03fd);})['then'](function(_0x4ef393){_0x5ca793=_[_0x6533('0x11c')](_0x4ef393);var _0x48df05=_['map'](_0x5ca793,function(_0x3cbc87){return _0x3cbc87[_0x6533('0x11d')](_0x31dee3['id'],{'transaction':_0x4752a4});});return Promise[_0x6533('0x55')](_0x48df05);})[_0x6533('0x17')](function(){if(!_0x31dee3['online'])return;var _0x42962b=_['filter'](_0x5ca793,function(_0x1985d9){return _0x1985d9[_0x6533('0x11e')](_0x6533('0xa2'))==='Voice';});var _0x5e27ad=_['map'](_0x42962b,function(_0x31c9f5){return db[_0x6533('0xb2')][_0x6533('0xb3')]({'membername':_0x31dee3['name'],'UserId':_0x31dee3['id'],'queue_name':_0x31c9f5[_0x6533('0x3a')],'VoiceQueueId':_0x31c9f5['id'],'interface':_[_0x6533('0x6e')](_0x31dee3[_0x6533('0xa5')])?util[_0x6533('0xaf')](_0x6533('0xb0'),_0x31dee3[_0x6533('0x3a')]):_0x31dee3[_0x6533('0xa5')],'paused':_0x31dee3[_0x6533('0xa4')]||![],'penalty':_0x31dee3['penalty']},{'transaction':_0x4752a4});});return Promise[_0x6533('0x55')](_0x5e27ad);})['then'](function(){return db['TeamVoicePrefix'][_0x6533('0x4b')]({'where':{'teamId':{'$in':_0x59c97e}}});})['then'](function(_0x50434f){var _0x4bf1c6=_['map'](_0x50434f,function(_0x5d1464){return db[_0x6533('0x11f')][_0x6533('0x85')]({'UserId':_0x31dee3['id'],'VoicePrefixId':_0x5d1464[_0x6533('0x120')]},{'transaction':_0x4752a4});});return Promise['all'](_0x4bf1c6);});});})[_0x6533('0x17')](function(){for(var _0x4b0836=0x0;_0x4b0836<_0x5ca793[_0x6533('0x4e')];_0x4b0836++){var _0x3904b3=_0x5ca793[_0x4b0836][_0x6533('0x11e')](_0x6533('0xa2'));var _0x38a9f4=_0x3904b3+'QueueId';socket[_0x6533('0x2c')]('user'+_0x3904b3+_0x6533('0x121'),{'UserId':_0x4e1d03,['queueField']:_0x5ca793[_0x4b0836]['id']});}})['then'](respondWithStatusCode(_0x4b1bf4,null))[_0x6533('0x22')](APIHandleError(_0x4b1bf4));};exports[_0x6533('0x122')]=function(_0x4a4d12,_0x307bbb){var _0x745d50=_0x4a4d12[_0x6533('0x57')]['id'];var _0x8dc49f=null;if(_0x4a4d12[_0x6533('0x46')][_0x6533('0x68')]){_0x8dc49f=_[_0x6533('0x123')](_0x4a4d12['query']['ids'])?_0x4a4d12[_0x6533('0x46')][_0x6533('0x68')]:[_0x4a4d12[_0x6533('0x46')][_0x6533('0x68')]];}var _0x5ac142=[];return Promise[_0x6533('0x105')]()[_0x6533('0x17')](function(){if(!_0x8dc49f)throw new APIBadRequestError(_0x6533('0x124'));})['then'](function(){return db[_0x6533('0x40')]['findOne']({'where':{'id':_0x745d50}});})[_0x6533('0x17')](function(_0x4ff083){if(!_0x4ff083)throw new APINotFoundError(util[_0x6533('0xaf')](_0x6533('0x115'),_0x4a4d12['params']['id']));return db[_0x6533('0x70')][_0x6533('0x119')](function(_0x46bb1d){return _0x4ff083[_0x6533('0x122')](_0x8dc49f,{'transaction':_0x46bb1d})['then'](function(){return db[_0x6533('0x11a')]['findAll']({'where':{'id':{'$in':_0x8dc49f}}});})['then'](function(_0x43104c){var _0x3aa05f=_[_0x6533('0x36')](_0x43104c,function(_0x64cd62){return _0x64cd62[_0x6533('0x11b')]();});return Promise[_0x6533('0x55')](_0x3aa05f);})[_0x6533('0x17')](function(_0x4074ac){_0x5ac142=_[_0x6533('0x11c')](_0x4074ac);var _0x3f249e=_['map'](_0x5ac142,function(_0x2fa954){return _0x2fa954[_0x6533('0x125')](_0x4ff083['id'],{'transaction':_0x46bb1d});});return Promise[_0x6533('0x55')](_0x3f249e);})[_0x6533('0x17')](function(){if(!_0x4ff083[_0x6533('0xae')])return;var _0x29fd9c=_[_0x6533('0x34')](_0x5ac142,function(_0x1b1966){return _0x1b1966['getDataValue'](_0x6533('0xa2'))===_0x6533('0x126');});var _0x71bc71=_[_0x6533('0x36')](_0x29fd9c,function(_0x19d343){return db['UserVoiceQueueRt'][_0x6533('0x2e')]({'where':{'VoiceQueueId':_0x19d343['id'],'UserId':_0x4ff083['id']},'transaction':_0x46bb1d});});return Promise['all'](_0x71bc71);})['then'](function(){return db['TeamVoicePrefix'][_0x6533('0x4b')]({'where':{'teamId':{'$in':_0x8dc49f}}});})[_0x6533('0x17')](function(_0x1d078f){var _0x5b5365=_['map'](_0x1d078f,function(_0x298bff){return db[_0x6533('0x11f')][_0x6533('0x2e')]({'where':{'UserId':_0x4ff083['id'],'VoicePrefixId':_0x298bff[_0x6533('0x120')]}},{'transaction':_0x46bb1d});});return Promise['all'](_0x5b5365);});});})[_0x6533('0x17')](function(){for(var _0x46820a=0x0;_0x46820a<_0x5ac142[_0x6533('0x4e')];_0x46820a++){var _0x28d950=_0x5ac142[_0x46820a][_0x6533('0x11e')](_0x6533('0xa2'));var _0x15bd0b=_0x28d950+'QueueId';socket['emit'](_0x6533('0x86')+_0x28d950+_0x6533('0xb5'),{'UserId':_0x745d50,['queueField']:_0x5ac142[_0x46820a]['id']});}})[_0x6533('0x17')](respondWithStatusCode(_0x307bbb,null))['catch'](APIHandleError(_0x307bbb));};exports[_0x6533('0x127')]=function(_0x2657c9,_0xb6c515){var _0x43776d={};var _0x39b69e={};var _0x19fcd7;var _0x2b4570;return db['User'][_0x6533('0x9c')]({'where':{'id':_0x2657c9[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0xb6c515,null))[_0x6533('0x17')](function(_0x102a24){if(_0x102a24){_0x19fcd7=_0x102a24;_0x39b69e['model']=_[_0x6533('0x59')](db[_0x6533('0xd6')]['rawAttributes']);_0x39b69e[_0x6533('0x46')]=_['keys'](_0x2657c9[_0x6533('0x46')]);_0x39b69e[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x39b69e['model'],_0x39b69e[_0x6533('0x46')]);_0x43776d['attributes']=_[_0x6533('0x5c')](_0x39b69e[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x2657c9[_0x6533('0x46')][_0x6533('0x5e')]));_0x43776d[_0x6533('0x49')]=_0x43776d['attributes'][_0x6533('0x4e')]?_0x43776d[_0x6533('0x49')]:_0x39b69e[_0x6533('0x5d')];_0x43776d[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x2657c9[_0x6533('0x46')][_0x6533('0xd2')]);_0x43776d[_0x6533('0x45')]=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x2657c9[_0x6533('0x46')],_0x39b69e['filters']));if(_0x2657c9[_0x6533('0x46')][_0x6533('0x34')]){_0x43776d[_0x6533('0x45')]=_[_0x6533('0x62')](_0x43776d[_0x6533('0x45')],{'$or':_['map'](_0x43776d[_0x6533('0x49')],function(_0x1db7b1){var _0x19e65b={};_0x19e65b[_0x1db7b1]={'$like':'%'+_0x2657c9[_0x6533('0x46')]['filter']+'%'};return _0x19e65b;})});}_0x43776d=_[_0x6533('0x62')]({},_0x43776d,_0x2657c9[_0x6533('0xd4')]);return _0x19fcd7[_0x6533('0x127')](_0x43776d);}})[_0x6533('0x17')](function(_0x4607b1){if(_0x4607b1){_0x2b4570=_0x4607b1['length'];if(!_0x2657c9[_0x6533('0x46')][_0x6533('0xd5')]('nolimit')){_0x43776d[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x2657c9['query'][_0x6533('0x27')]);_0x43776d['offset']=qs[_0x6533('0x29')](_0x2657c9[_0x6533('0x46')][_0x6533('0x29')]);}return _0x19fcd7['getLists'](_0x43776d);}})[_0x6533('0x17')](function(_0x2563a4){if(_0x2563a4){return _0x2563a4?{'count':_0x2b4570,'rows':_0x2563a4}:null;}})[_0x6533('0x17')](respondWithResult(_0xb6c515,null))[_0x6533('0x22')](handleError(_0xb6c515,null));};exports['getAgents']=function(_0x2106c9,_0x3d62a0){var _0x33876c={};var _0x492831={};var _0x2fadf9;return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x2106c9[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x3d62a0,null))[_0x6533('0x17')](function(_0x258c25){if(_0x258c25){_0x2fadf9=_0x258c25;_0x492831['model']=_[_0x6533('0x59')](db['User'][_0x6533('0x41')]);_0x492831[_0x6533('0x46')]=_[_0x6533('0x59')](_0x2106c9['query']);_0x492831[_0x6533('0x5b')]=_['intersection'](_0x492831['model'],_0x492831['query']);_0x33876c[_0x6533('0x49')]=_['intersection'](_0x492831[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x2106c9[_0x6533('0x46')][_0x6533('0x5e')]));_0x33876c[_0x6533('0x49')]=_0x33876c[_0x6533('0x49')]['length']?_0x33876c[_0x6533('0x49')]:_0x492831[_0x6533('0x5d')];_0x33876c[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x2106c9[_0x6533('0x46')]['sort']);_0x33876c[_0x6533('0x45')]=qs[_0x6533('0x5b')](_['pick'](_0x2106c9['query'],_0x492831[_0x6533('0x5b')]));if(_0x2106c9[_0x6533('0x46')][_0x6533('0x34')]){_0x33876c['where']=_['merge'](_0x33876c[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x33876c[_0x6533('0x49')],function(_0x235868){var _0x1853bb={};_0x1853bb[_0x235868]={'$like':'%'+_0x2106c9[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x1853bb;})});}_0x33876c[_0x6533('0x5d')]=db['User'];_0x33876c['as']=_0x6533('0x8d');_0x33876c=_['merge']({},_0x33876c,_0x2106c9[_0x6533('0xd4')]);return _0x2fadf9[_0x6533('0xfd')]({'include':[_0x33876c]});}})['then'](function(_0x2697a){if(_0x2697a){var _0x5ef4ee={},_0x4eb909=[];for(var _0x39c6a1=0x0;_0x39c6a1<_0x2697a['length'];_0x39c6a1+=0x1){for(var _0x2cd4e3=0x0,_0x5ad59f;_0x2cd4e3<_0x2697a[_0x39c6a1][_0x6533('0x8d')][_0x6533('0x4e')];_0x2cd4e3+=0x1){_0x5ad59f=_0x2697a[_0x39c6a1][_0x6533('0x8d')][_0x2cd4e3][_0x6533('0x2f')]({'plain':!![]});_0x5ef4ee[_0x5ad59f['id']]=_0x5ad59f;}}_0x5ef4ee=_['values'](_0x5ef4ee);for(var _0x52458d=qs[_0x6533('0x29')](_0x2106c9['query']['offset']);_0x52458d<_0x5ef4ee[_0x6533('0x4e')]&&_0x4eb909[_0x6533('0x4e')]=_0x378bc9[_0x2634('0x47')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x2634('0x11')](function(){if(_0x36387e){return db[_0x2634('0x23')][_0x2634('0x48')]({'where':{'membername':_0x36387e[_0x2634('0x1d')]},'individualHooks':!![]});}})[_0x2634('0x11')](function(){if(_0x36387e){return _0x36387e[_0x2634('0x49')]({'raw':!![]});}})[_0x2634('0x11')](function(_0x21f860){if(_0x36387e){if(_0x21f860){var _0x2b532a=[];_0x28e8b9=_0x21f860;if(_0x28e8b9['length']){for(var _0x465cf9=0x0;_0x465cf9<_0x28e8b9[_0x2634('0x26')];_0x465cf9++){_0x2b532a[_0x2634('0x4a')](db[_0x2634('0x23')]['upsert']({'membername':_0x36387e[_0x2634('0x1d')],'UserId':_0x36387e['id'],'queue_name':_0x28e8b9[_0x465cf9][_0x2634('0x1d')],'VoiceQueueId':_0x28e8b9[_0x465cf9]['id'],'interface':_0x3ec0f2,'paused':_0x36387e['loginInPause']||![],'penalty':_0x28e8b9[_0x465cf9]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x2b532a);}}}})['then'](function(){if(_0x36387e){return db[_0x2634('0x24')]['findAll']({'where':{'membername':_0x36387e[_0x2634('0x1d')],'exitAt':null}});}})['then'](function(_0x19766e){if(_0x36387e){if(_0x19766e&&_0x19766e['length']){var _0x3352dd=[];_0x19766e[_0x2634('0x2a')](function(_0x1e6df0){_0x3352dd[_0x2634('0x4a')](_0x1e6df0[_0x2634('0x30')]({'exitAt':moment()[_0x2634('0x20')](_0x2634('0x27'))}));});return BPromise[_0x2634('0x40')](_0x3352dd);}}})['then'](function(){if(_0x36387e){var _0x5dc2d8=[];var _0x5a77a7=[];var _0x7a5a24=utils[_0x2634('0x29')]();var _0x2e65ed={'membername':_0x36387e[_0x2634('0x1d')],'interface':_0x3ec0f2,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x36387e[_0x2634('0x1e')],'internal':_0x36387e[_0x2634('0x2f')]};_0x7a5a24['forEach'](function(_0x1df95c){_0x5dc2d8[_0x2634('0x4a')](_['merge']({'channel':_0x1df95c,'type':_0x2634('0x4b'),'data1':_0x2634('0x4c'),'data2':_0x3ec0f2},_0x2e65ed));if(_0x36387e[_0x2634('0x44')]){_0x5a77a7['push'](_[_0x2634('0x4d')]({'channel':_0x1df95c,'type':'PAUSE','data1':'LOGININPAUSE'},_0x2e65ed));}});return db[_0x2634('0x24')][_0x2634('0x4e')](_0x5dc2d8[_0x2634('0x4f')](_0x5a77a7),{'individualHooks':!![]});}})[_0x2634('0x11')](function(){if(_0x36387e){return _0x36387e[_0x2634('0x30')]({'online':!![],'lastLoginAt':moment()[_0x2634('0x20')](_0x2634('0x27')),'voicePause':_0x36387e[_0x2634('0x44')]||![],'mailPause':_0x36387e[_0x2634('0x44')]||![],'chatPause':_0x36387e['loginInPause']||![],'faxPause':_0x36387e[_0x2634('0x44')]||![],'smsPause':_0x36387e[_0x2634('0x44')]||![],'openchannelPause':_0x36387e[_0x2634('0x44')]||![],'pauseType':_0x36387e[_0x2634('0x44')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x2634('0x27')),'interface':_0x3ec0f2});}})[_0x2634('0x11')](function(_0xd1f7a8){_0xe33b8c(_0xd1f7a8);})[_0x2634('0x14')](function(_0x27a485){_0x1cc06a(_0x7e1351[_0x2634('0x15')](0x1f4,_0x27a485[_0x2634('0x16')]));});});}; \ No newline at end of file +var _0x13fd=['model','map','info','stringify','catch','message','error','ShowUser','find','then','debug','PauseUser','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','PAUSE','length','updateAttributes','push','isNil','body','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','YYYY-MM-DD\x20HH:mm:ss','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','chatPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','unpause','system','LogoutUser','destroy','forEach','all','LoginUser','mobile','phone','loginInPause','count','../../config/license/util','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','getChannels','LOGIN','LOGININPAUSE','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','GetUser','User','findAll','options','raw','where','attributes','include'];(function(_0x421f5c,_0x472f62){var _0x52d4fd=function(_0x2590ed){while(--_0x2590ed){_0x421f5c['push'](_0x421f5c['shift']());}};_0x52d4fd(++_0x472f62);}(_0x13fd,0x186));var _0xd13f=function(_0xe7dc69,_0x4bdca7){_0xe7dc69=_0xe7dc69-0x0;var _0xc78efc=_0x13fd[_0xe7dc69];return _0xc78efc;};'use strict';var _=require('lodash');var util=require(_0xd13f('0x0'));var moment=require(_0xd13f('0x1'));var BPromise=require(_0xd13f('0x2'));var Redis=require(_0xd13f('0x3'));var db=require(_0xd13f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd13f('0x5'))('rpc');var config=require(_0xd13f('0x6'));config[_0xd13f('0x7')]=_[_0xd13f('0x8')](config[_0xd13f('0x7')],{'host':_0xd13f('0x9'),'port':0x18eb});var socket=require(_0xd13f('0xa'))(new Redis(config['redis']));require(_0xd13f('0xb'))['register'](socket);exports[_0xd13f('0xc')]=function(_0x15f41f){var _0x200e95=this;return new Promise(function(_0x134a62,_0x1be926){return db[_0xd13f('0xd')][_0xd13f('0xe')]({'raw':_0x15f41f[_0xd13f('0xf')]?_0x15f41f[_0xd13f('0xf')][_0xd13f('0x10')]===undefined?!![]:![]:!![],'where':_0x15f41f[_0xd13f('0xf')]?_0x15f41f[_0xd13f('0xf')][_0xd13f('0x11')]||null:null,'attributes':_0x15f41f[_0xd13f('0xf')]?_0x15f41f[_0xd13f('0xf')][_0xd13f('0x12')]||null:null,'limit':_0x15f41f[_0xd13f('0xf')]?_0x15f41f[_0xd13f('0xf')]['limit']||null:null,'include':_0x15f41f[_0xd13f('0xf')]?_0x15f41f[_0xd13f('0xf')]['include']?_['map'](_0x15f41f['options'][_0xd13f('0x13')],function(_0x1f78d0){return{'model':db[_0x1f78d0[_0xd13f('0x14')]],'as':_0x1f78d0['as'],'attributes':_0x1f78d0['attributes'],'include':_0x1f78d0[_0xd13f('0x13')]?_[_0xd13f('0x15')](_0x1f78d0[_0xd13f('0x13')],function(_0x5aa7e1){return{'model':db[_0x5aa7e1[_0xd13f('0x14')]],'as':_0x5aa7e1['as'],'attributes':_0x5aa7e1[_0xd13f('0x12')],'include':_0x5aa7e1[_0xd13f('0x13')]?_[_0xd13f('0x15')](_0x5aa7e1['include'],function(_0x52246a){return{'model':db[_0x52246a[_0xd13f('0x14')]],'as':_0x52246a['as'],'attributes':_0x52246a[_0xd13f('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x525f75){logger[_0xd13f('0x16')](_0xd13f('0xc'),_0x15f41f);logger['debug'](_0xd13f('0xc'),_0x15f41f,JSON[_0xd13f('0x17')](_0x525f75));_0x134a62(_0x525f75);})[_0xd13f('0x18')](function(_0x18880b){logger['error'](_0xd13f('0xc'),_0x18880b[_0xd13f('0x19')],_0x15f41f);_0x1be926(_0x200e95[_0xd13f('0x1a')](0x1f4,_0x18880b[_0xd13f('0x19')]));});});};exports[_0xd13f('0x1b')]=function(_0x405d66){var _0x259f01=this;return new Promise(function(_0x5833c6,_0x3a4714){return db['User'][_0xd13f('0x1c')]({'raw':_0x405d66['options']?_0x405d66[_0xd13f('0xf')][_0xd13f('0x10')]===undefined?!![]:![]:!![],'where':_0x405d66[_0xd13f('0xf')]?_0x405d66['options'][_0xd13f('0x11')]||null:null,'attributes':_0x405d66['options']?_0x405d66[_0xd13f('0xf')][_0xd13f('0x12')]||null:null,'include':_0x405d66[_0xd13f('0xf')]?_0x405d66[_0xd13f('0xf')][_0xd13f('0x13')]?_[_0xd13f('0x15')](_0x405d66['options'][_0xd13f('0x13')],function(_0x42969a){return{'model':db[_0x42969a[_0xd13f('0x14')]],'as':_0x42969a['as'],'attributes':_0x42969a[_0xd13f('0x12')],'include':_0x42969a[_0xd13f('0x13')]?_['map'](_0x42969a[_0xd13f('0x13')],function(_0x176796){return{'model':db[_0x176796['model']],'as':_0x176796['as'],'attributes':_0x176796['attributes'],'include':_0x176796['include']?_['map'](_0x176796[_0xd13f('0x13')],function(_0x4a019e){return{'model':db[_0x4a019e[_0xd13f('0x14')]],'as':_0x4a019e['as'],'attributes':_0x4a019e[_0xd13f('0x12')]};}):[]};}):[]};}):[]:[]})[_0xd13f('0x1d')](function(_0x310e4b){logger['info'](_0xd13f('0x1b'),_0x405d66);logger[_0xd13f('0x1e')](_0xd13f('0x1b'),_0x405d66,JSON[_0xd13f('0x17')](_0x310e4b));_0x5833c6(_0x310e4b);})[_0xd13f('0x18')](function(_0xd32657){logger[_0xd13f('0x1a')](_0xd13f('0x1b'),_0xd32657[_0xd13f('0x19')],_0x405d66);_0x3a4714(_0x259f01[_0xd13f('0x1a')](0x1f4,_0xd32657['message']));});});};exports[_0xd13f('0x1f')]=function(_0x4fc4a6){var _0x4afaf2;return db[_0xd13f('0xd')][_0xd13f('0x1c')]({'where':_0x4fc4a6['options'][_0xd13f('0x11')]||{},'attributes':['id',_0xd13f('0x20'),_0xd13f('0x21'),_0xd13f('0x22'),_0xd13f('0x23')]})[_0xd13f('0x1d')](function(_0x227969){if(!_0x227969){throw new Error(util[_0xd13f('0x24')](_0xd13f('0x25'),_0x4fc4a6[_0xd13f('0x26')]['id']));}_0x4afaf2=_0x227969;return db[_0xd13f('0x27')][_0xd13f('0x28')]({'paused':0x1},{'where':{'UserId':_0x4afaf2['id']},'individualHooks':!![]});})[_0xd13f('0x1d')](function(){return db[_0xd13f('0x29')]['findAll']({'where':{'membername':_0x4afaf2[_0xd13f('0x20')],'type':_0xd13f('0x2a'),'exitAt':null}});})['then'](function(_0x4d0599){if(_0x4d0599&&_0x4d0599['length']){var _0x1111cc=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3e1e25=0x0,_0x2967d6=_0x4d0599[_0xd13f('0x2b')];_0x3e1e25<_0x2967d6;_0x3e1e25++){_0x4d0599[_0x3e1e25][_0xd13f('0x2c')]({'exitAt':_0x1111cc});}}})[_0xd13f('0x1d')](function(){var _0x57b7ca=[];var _0xc37dd4=utils['getChannels']();_0xc37dd4['forEach'](function(_0x38a9a1){_0x57b7ca[_0xd13f('0x2d')]({'channel':_0x38a9a1,'membername':_0x4afaf2[_0xd13f('0x20')],'interface':_[_0xd13f('0x2e')](_0x4afaf2[_0xd13f('0x23')])?util[_0xd13f('0x24')]('SIP/%s',_0x4afaf2[_0xd13f('0x20')]):_0x4afaf2['interface'],'type':_0xd13f('0x2a'),'enterAt':moment()[_0xd13f('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4fc4a6[_0xd13f('0x2f')][_0xd13f('0x30')]||'DEFAULT\x20PAUSE','role':_0x4afaf2[_0xd13f('0x21')],'internal':_0x4afaf2[_0xd13f('0x22')],'uniqueid':_0x4fc4a6['body'][_0xd13f('0x31')]||null});});return db[_0xd13f('0x29')][_0xd13f('0x32')](_0x57b7ca,{'individualHooks':!![]});})[_0xd13f('0x1d')](function(){return _0x4afaf2[_0xd13f('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4fc4a6['body']['type']||_0xd13f('0x33'),'lastPauseAt':moment()[_0xd13f('0x24')](_0xd13f('0x34'))});})[_0xd13f('0x18')](function(_0x58576f){throw _0x58576f;});};exports['UnpauseUser']=function(_0x58e194){return Promise[_0xd13f('0x35')]()['then'](function(){if(_0x58e194['body'][_0xd13f('0x36')]&&!utils['isValidChannel'](_0x58e194['body']['channel'])){throw new Error(util[_0xd13f('0x24')](_0xd13f('0x37'),_0x58e194['body']['channel']));}return db[_0xd13f('0xd')][_0xd13f('0x38')]({'where':_0x58e194[_0xd13f('0xf')][_0xd13f('0x11')]||{},'attributes':['id',_0xd13f('0x20'),_0xd13f('0x21'),_0xd13f('0x22'),_0xd13f('0x23'),_0xd13f('0x39'),'voicePause','mailPause',_0xd13f('0x3a'),'faxPause',_0xd13f('0x3b'),_0xd13f('0x3c'),_0xd13f('0x3d'),'pauseType',_0xd13f('0x3e')]});})[_0xd13f('0x1d')](function(_0x58e163){if(!_0x58e163){throw new Error(util[_0xd13f('0x24')](_0xd13f('0x25'),_0x58e194[_0xd13f('0x26')]['id']));}return _0x58e163[_0xd13f('0x3f')](_0x58e194[_0xd13f('0x2f')][_0xd13f('0x36')],_0xd13f('0x40'));})[_0xd13f('0x18')](function(_0xb92ab6){throw _0xb92ab6;});};exports[_0xd13f('0x41')]=function(_0x4c0a93){var _0x483c7a=this;return new Promise(function(_0x430148,_0xede69a){var _0x1f775f;return db[_0xd13f('0xd')][_0xd13f('0x38')]({'where':_0x4c0a93[_0xd13f('0xf')]['where']||{},'attributes':['id',_0xd13f('0x20')]})[_0xd13f('0x1d')](function(_0x209f59){if(_0x209f59){_0x1f775f=_0x209f59;return db[_0xd13f('0x27')][_0xd13f('0x42')]({'where':{'membername':_0x1f775f[_0xd13f('0x20')]},'individualHooks':!![]});}})[_0xd13f('0x1d')](function(){if(_0x1f775f){return db[_0xd13f('0x29')][_0xd13f('0xe')]({'where':{'membername':_0x1f775f[_0xd13f('0x20')],'exitAt':null}});}})[_0xd13f('0x1d')](function(_0x3f0deb){if(_0x1f775f){if(_0x3f0deb&&_0x3f0deb['length']){var _0x162187=[];_0x3f0deb[_0xd13f('0x43')](function(_0x42e1bd){_0x162187[_0xd13f('0x2d')](_0x42e1bd[_0xd13f('0x28')]({'exitAt':moment()['format'](_0xd13f('0x34'))}));});return BPromise[_0xd13f('0x44')](_0x162187);}}})[_0xd13f('0x1d')](function(){if(_0x1f775f){return _0x1f775f[_0xd13f('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd13f('0x1d')](function(_0x2ff0e7){_0x430148(_0x2ff0e7);})[_0xd13f('0x18')](function(_0x22936f){_0xede69a(_0x483c7a[_0xd13f('0x1a')](0x1f4,_0x22936f[_0xd13f('0x19')]));});});};exports[_0xd13f('0x45')]=function(_0x2b51d0){var _0x5c256c=this;return new Promise(function(_0x56781a,_0x92fd34){var _0x45eabd;var _0x8c3ee4;var _0x25c9c6;var _0x5d7780;return db[_0xd13f('0xd')][_0xd13f('0x38')]({'where':_0x2b51d0['options'][_0xd13f('0x11')]||{},'attributes':['id',_0xd13f('0x20'),_0xd13f('0x21'),_0xd13f('0x46'),_0xd13f('0x47'),_0xd13f('0x22'),_0xd13f('0x48'),_0xd13f('0x23')]})['then'](function(_0x393a0c){if(_0x393a0c){_0x45eabd=_0x393a0c;_0x5d7780=_0x2b51d0[_0xd13f('0x2f')][_0xd13f('0x23')]?_0x2b51d0[_0xd13f('0x2f')][_0xd13f('0x23')]:util[_0xd13f('0x24')]('SIP/%s',_0x45eabd['name']);return db[_0xd13f('0xd')][_0xd13f('0x49')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x45eabd['id']}}});}})[_0xd13f('0x1d')](function(_0x8e1091){if(_0x8e1091){_0x25c9c6=_0x8e1091;return require(_0xd13f('0x4a'))['getLicense']();}})[_0xd13f('0x1d')](function(_0x5f362c){if(_0x5f362c&&_0x5f362c['agents']&&_0x25c9c6>=_0x5f362c['agents']){throw new Error(_0xd13f('0x4b'));}})[_0xd13f('0x1d')](function(){if(_0x45eabd){return db[_0xd13f('0x27')][_0xd13f('0x42')]({'where':{'membername':_0x45eabd[_0xd13f('0x20')]},'individualHooks':!![]});}})[_0xd13f('0x1d')](function(){if(_0x45eabd){return _0x45eabd[_0xd13f('0x4c')]({'raw':!![]});}})['then'](function(_0x201b72){if(_0x45eabd){if(_0x201b72){var _0x38b28a=[];_0x8c3ee4=_0x201b72;if(_0x8c3ee4[_0xd13f('0x2b')]){for(var _0x2ebc2d=0x0;_0x2ebc2d<_0x8c3ee4[_0xd13f('0x2b')];_0x2ebc2d++){_0x38b28a[_0xd13f('0x2d')](db[_0xd13f('0x27')][_0xd13f('0x4d')]({'membername':_0x45eabd[_0xd13f('0x20')],'UserId':_0x45eabd['id'],'queue_name':_0x8c3ee4[_0x2ebc2d]['name'],'VoiceQueueId':_0x8c3ee4[_0x2ebc2d]['id'],'interface':_0x5d7780,'paused':_0x45eabd['loginInPause']||![],'penalty':_0x8c3ee4[_0x2ebc2d][_0xd13f('0x4e')]||0x0}));}return BPromise[_0xd13f('0x44')](_0x38b28a);}}}})[_0xd13f('0x1d')](function(){if(_0x45eabd){return db[_0xd13f('0x29')][_0xd13f('0xe')]({'where':{'membername':_0x45eabd[_0xd13f('0x20')],'exitAt':null}});}})['then'](function(_0xaa0906){if(_0x45eabd){if(_0xaa0906&&_0xaa0906[_0xd13f('0x2b')]){var _0x4f2313=[];_0xaa0906['forEach'](function(_0x1c9180){_0x4f2313[_0xd13f('0x2d')](_0x1c9180[_0xd13f('0x28')]({'exitAt':moment()[_0xd13f('0x24')](_0xd13f('0x34'))}));});return BPromise[_0xd13f('0x44')](_0x4f2313);}}})[_0xd13f('0x1d')](function(){if(_0x45eabd){var _0x339b8b=[];var _0x1ddcbd=[];var _0x1e5f76=utils[_0xd13f('0x4f')]();var _0x361389={'membername':_0x45eabd[_0xd13f('0x20')],'interface':_0x5d7780,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x45eabd[_0xd13f('0x21')],'internal':_0x45eabd[_0xd13f('0x22')]};_0x1e5f76[_0xd13f('0x43')](function(_0x1a2650){_0x339b8b['push'](_['merge']({'channel':_0x1a2650,'type':_0xd13f('0x50'),'data1':'callysquare','data2':_0x5d7780},_0x361389));if(_0x45eabd[_0xd13f('0x48')]){_0x1ddcbd['push'](_['merge']({'channel':_0x1a2650,'type':_0xd13f('0x2a'),'data1':_0xd13f('0x51')},_0x361389));}});return db['MemberReport']['bulkCreate'](_0x339b8b['concat'](_0x1ddcbd),{'individualHooks':!![]});}})[_0xd13f('0x1d')](function(){if(_0x45eabd){return _0x45eabd[_0xd13f('0x28')]({'online':!![],'lastLoginAt':moment()[_0xd13f('0x24')](_0xd13f('0x34')),'voicePause':_0x45eabd[_0xd13f('0x48')]||![],'mailPause':_0x45eabd[_0xd13f('0x48')]||![],'chatPause':_0x45eabd[_0xd13f('0x48')]||![],'faxPause':_0x45eabd['loginInPause']||![],'smsPause':_0x45eabd[_0xd13f('0x48')]||![],'openchannelPause':_0x45eabd[_0xd13f('0x48')]||![],'pauseType':_0x45eabd[_0xd13f('0x48')]?_0xd13f('0x51'):null,'lastPauseAt':moment()[_0xd13f('0x24')](_0xd13f('0x34')),'interface':_0x5d7780});}})[_0xd13f('0x1d')](function(_0x369b06){_0x56781a(_0x369b06);})[_0xd13f('0x18')](function(_0x59aecd){_0x92fd34(_0x5c256c[_0xd13f('0x1a')](0x1f4,_0x59aecd[_0xd13f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index d2855b4..a0a4c40 100644 --- a/server/api/user/user.socket.js +++ b/server/api/user/user.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd375=['removeListener','register','length','user:','./user.events','save','remove','update','emit'];(function(_0x38df4c,_0x5adf17){var _0x1400e4=function(_0x40a7e0){while(--_0x40a7e0){_0x38df4c['push'](_0x38df4c['shift']());}};_0x1400e4(++_0x5adf17);}(_0xd375,0x12d));var _0x5d37=function(_0x4295ac,_0x40da0d){_0x4295ac=_0x4295ac-0x0;var _0x30c3f4=_0xd375[_0x4295ac];return _0x30c3f4;};'use strict';var UserEvents=require(_0x5d37('0x0'));var events=[_0x5d37('0x1'),_0x5d37('0x2'),_0x5d37('0x3')];function createListener(_0x39d40c,_0x4d1504){return function(_0x325955){_0x4d1504[_0x5d37('0x4')](_0x39d40c,_0x325955);};}function removeListener(_0x3672d5,_0x2303b7){return function(){UserEvents[_0x5d37('0x5')](_0x3672d5,_0x2303b7);};}exports[_0x5d37('0x6')]=function(_0x18316a){for(var _0x4a050c=0x0,_0x56f358=events[_0x5d37('0x7')];_0x4a050c<_0x56f358;_0x4a050c++){var _0x53aacb=events[_0x4a050c];var _0x566e38=createListener(_0x5d37('0x8')+_0x53aacb,_0x18316a);UserEvents['on'](_0x53aacb,_0x566e38);}}; \ No newline at end of file +var _0x9232=['length','user:','save','remove','update','removeListener'];(function(_0x24c135,_0x5c78ae){var _0x3cc0b7=function(_0x5cd68b){while(--_0x5cd68b){_0x24c135['push'](_0x24c135['shift']());}};_0x3cc0b7(++_0x5c78ae);}(_0x9232,0x1d0));var _0x2923=function(_0x7b5ee0,_0x32bbcc){_0x7b5ee0=_0x7b5ee0-0x0;var _0x3c995a=_0x9232[_0x7b5ee0];return _0x3c995a;};'use strict';var UserEvents=require('./user.events');var events=[_0x2923('0x0'),_0x2923('0x1'),_0x2923('0x2')];function createListener(_0x53b517,_0x2d6638){return function(_0x9b4f5c){_0x2d6638['emit'](_0x53b517,_0x9b4f5c);};}function removeListener(_0x5d622d,_0x3eae48){return function(){UserEvents[_0x2923('0x3')](_0x5d622d,_0x3eae48);};}exports['register']=function(_0x1f7f76){for(var _0xf588c6=0x0,_0xef60b9=events[_0x2923('0x4')];_0xf588c6<_0xef60b9;_0xf588c6++){var _0x4684f0=events[_0xf588c6];var _0xdadcec=createListener(_0x2923('0x5')+_0x4684f0,_0x1f7f76);UserEvents['on'](_0x4684f0,_0xdadcec);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 4b02a22..c7f362a 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xf68147,_0x4147a5){var _0x37344d=function(_0x128f5f){while(--_0x128f5f){_0xf68147['push'](_0xf68147['shift']());}};_0x37344d(++_0x4147a5);}(_0xe706,0xa3));var _0x6e70=function(_0x36633f,_0x26e83d){_0x36633f=_0x36633f-0x0;var _0x480eb0=_0xe706[_0x36633f];return _0x480eb0;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x521897,_0x37a068){var _0x371b73=function(_0x289d71){while(--_0x289d71){_0x521897['push'](_0x521897['shift']());}};_0x371b73(++_0x37a068);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 9df5ff8..f4bbc5b 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef8b=['exports','INTEGER'];(function(_0x507e57,_0xf1d63){var _0x24aa45=function(_0x292f8d){while(--_0x292f8d){_0x507e57['push'](_0x507e57['shift']());}};_0x24aa45(++_0xf1d63);}(_0xef8b,0x192));var _0xbef8=function(_0x50af9c,_0xf03b1e){_0x50af9c=_0x50af9c-0x0;var _0x5b5e5a=_0xef8b[_0x50af9c];return _0x5b5e5a;};'use strict';var Sequelize=require('sequelize');module[_0xbef8('0x0')]={'penalty':{'type':Sequelize[_0xbef8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb99d=['sequelize','INTEGER'];(function(_0x1af420,_0x4ad7c5){var _0x572d5f=function(_0x21f872){while(--_0x21f872){_0x1af420['push'](_0x1af420['shift']());}};_0x572d5f(++_0x4ad7c5);}(_0xb99d,0xb8));var _0xdb99=function(_0x23bf40,_0xf05f78){_0x23bf40=_0x23bf40-0x0;var _0x33ca5c=_0xb99d[_0x23bf40];return _0x33ca5c;};'use strict';var Sequelize=require(_0xdb99('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xdb99('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 43a8081..8de9c0b 100644 --- a/server/api/userChatQueue/userChatQueue.model.js +++ b/server/api/userChatQueue/userChatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc557=['moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api'];(function(_0x3e418d,_0x40a245){var _0x54458f=function(_0x1c0c75){while(--_0x1c0c75){_0x3e418d['push'](_0x3e418d['shift']());}};_0x54458f(++_0x40a245);}(_0xc557,0x1c3));var _0x7c55=function(_0x19c7bf,_0x130f9d){_0x19c7bf=_0x19c7bf-0x0;var _0x4c5970=_0xc557[_0x19c7bf];return _0x4c5970;};'use strict';var _=require(_0x7c55('0x0'));var util=require(_0x7c55('0x1'));var logger=require(_0x7c55('0x2'))(_0x7c55('0x3'));var moment=require(_0x7c55('0x4'));var BPromise=require('bluebird');var rp=require(_0x7c55('0x5'));var fs=require('fs');var path=require(_0x7c55('0x6'));var rimraf=require(_0x7c55('0x7'));var config=require(_0x7c55('0x8'));var attributes=require(_0x7c55('0x9'));module['exports']=function(_0x3020d4,_0x25d306){return _0x3020d4[_0x7c55('0xa')](_0x7c55('0xb'),attributes,{'tableName':_0x7c55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a7c=['rimraf','../../config/environment','./userChatQueue.attributes','exports','user_has_chat_queues','lodash','api','bluebird','request-promise','path'];(function(_0x2736e0,_0x248150){var _0x23f8de=function(_0x182b17){while(--_0x182b17){_0x2736e0['push'](_0x2736e0['shift']());}};_0x23f8de(++_0x248150);}(_0x0a7c,0xcd));var _0xc0a7=function(_0x291b8f,_0x3b8484){_0x291b8f=_0x291b8f-0x0;var _0x3b504b=_0x0a7c[_0x291b8f];return _0x3b504b;};'use strict';var _=require(_0xc0a7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc0a7('0x1'));var moment=require('moment');var BPromise=require(_0xc0a7('0x2'));var rp=require(_0xc0a7('0x3'));var fs=require('fs');var path=require(_0xc0a7('0x4'));var rimraf=require(_0xc0a7('0x5'));var config=require(_0xc0a7('0x6'));var attributes=require(_0xc0a7('0x7'));module[_0xc0a7('0x8')]=function(_0xf752b,_0x1ffd74){return _0xf752b['define']('UserChatQueue',attributes,{'tableName':_0xc0a7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 32fe6b0..ecc5c99 100644 --- a/server/api/userChatQueue/userChatQueue.rpc.js +++ b/server/api/userChatQueue/userChatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb599=['bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0xb599,0x11e));var _0x9b59=function(_0x28dad7,_0x576c76){_0x28dad7=_0x28dad7-0x0;var _0x1dabf3=_0xb599[_0x28dad7];return _0x1dabf3;};'use strict';var _=require('lodash');var util=require(_0x9b59('0x0'));var moment=require(_0x9b59('0x1'));var BPromise=require(_0x9b59('0x2'));var rs=require(_0x9b59('0x3'));var fs=require('fs');var Redis=require(_0x9b59('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b59('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9b59('0x6'));var client=jayson[_0x9b59('0x7')][_0x9b59('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a8001,_0x5c500c,_0xdeeceb){return new BPromise(function(_0xc129e7,_0x1ca697){return client[_0x9b59('0x9')](_0x3a8001,_0xdeeceb)['then'](function(_0xd9c5a){logger[_0x9b59('0xa')](_0x9b59('0xb'),_0x5c500c,_0x9b59('0xc'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5c500c,'request\x20sent',JSON[_0x9b59('0xd')](_0xd9c5a));if(_0xd9c5a['error']){if(_0xd9c5a['error']['code']===0x1f4){logger[_0x9b59('0xe')](_0x9b59('0xb'),_0x5c500c,_0xd9c5a['error'][_0x9b59('0xf')]);return _0x1ca697(_0xd9c5a['error'][_0x9b59('0xf')]);}logger[_0x9b59('0xe')](_0x9b59('0xb'),_0x5c500c,_0xd9c5a[_0x9b59('0xe')][_0x9b59('0xf')]);return _0xc129e7(_0xd9c5a[_0x9b59('0xe')][_0x9b59('0xf')]);}else{logger[_0x9b59('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x5c500c,_0x9b59('0xc'));_0xc129e7(_0xd9c5a[_0x9b59('0x10')][_0x9b59('0xf')]);}})[_0x9b59('0x11')](function(_0x33be35){logger[_0x9b59('0xe')](_0x9b59('0xb'),_0x5c500c,_0x33be35);_0x1ca697(_0x33be35);});});} \ No newline at end of file +var _0xf00a=['result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x20229e,_0xa59f8a){var _0x317377=function(_0x290697){while(--_0x290697){_0x20229e['push'](_0x20229e['shift']());}};_0x317377(++_0xa59f8a);}(_0xf00a,0x86));var _0xaf00=function(_0x320d18,_0x7a06d9){_0x320d18=_0x320d18-0x0;var _0x18166f=_0xf00a[_0x320d18];return _0x18166f;};'use strict';var _=require(_0xaf00('0x0'));var util=require(_0xaf00('0x1'));var moment=require(_0xaf00('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf00('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaf00('0x4'));var logger=require(_0xaf00('0x5'))(_0xaf00('0x6'));var config=require(_0xaf00('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaf00('0x8')][_0xaf00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29ed38,_0x32faf3,_0x5eba50){return new BPromise(function(_0xd4b83c,_0x55a5f5){return client[_0xaf00('0xa')](_0x29ed38,_0x5eba50)['then'](function(_0x5a3e15){logger[_0xaf00('0xb')](_0xaf00('0xc'),_0x32faf3,_0xaf00('0xd'));logger[_0xaf00('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x32faf3,_0xaf00('0xd'),JSON['stringify'](_0x5a3e15));if(_0x5a3e15[_0xaf00('0xf')]){if(_0x5a3e15[_0xaf00('0xf')][_0xaf00('0x10')]===0x1f4){logger[_0xaf00('0xf')](_0xaf00('0xc'),_0x32faf3,_0x5a3e15['error'][_0xaf00('0x11')]);return _0x55a5f5(_0x5a3e15['error'][_0xaf00('0x11')]);}logger[_0xaf00('0xf')](_0xaf00('0xc'),_0x32faf3,_0x5a3e15[_0xaf00('0xf')][_0xaf00('0x11')]);return _0xd4b83c(_0x5a3e15[_0xaf00('0xf')]['message']);}else{logger[_0xaf00('0xb')](_0xaf00('0xc'),_0x32faf3,'request\x20sent');_0xd4b83c(_0x5a3e15[_0xaf00('0x12')][_0xaf00('0x11')]);}})['catch'](function(_0x1d5156){logger[_0xaf00('0xf')](_0xaf00('0xc'),_0x32faf3,_0x1d5156);_0x55a5f5(_0x1d5156);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 0aae605..5fc4092 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4a9bab,_0x56015f){var _0x11ce30=function(_0x9a0762){while(--_0x9a0762){_0x4a9bab['push'](_0x4a9bab['shift']());}};_0x11ce30(++_0x56015f);}(_0xe706,0xa3));var _0x6e70=function(_0xabbd65,_0x546d99){_0xabbd65=_0xabbd65-0x0;var _0x1d005a=_0xe706[_0xabbd65];return _0x1d005a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x26f0da,_0xb6c33f){var _0x2df5dd=function(_0x4ec383){while(--_0x4ec383){_0x26f0da['push'](_0x26f0da['shift']());}};_0x2df5dd(++_0xb6c33f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 7174629..54a02d0 100644 --- a/server/api/userFaxQueue/userFaxQueue.attributes.js +++ b/server/api/userFaxQueue/userFaxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x771a=['INTEGER','STRING','exports'];(function(_0xc439f,_0x1494d4){var _0x2f437d=function(_0x206604){while(--_0x206604){_0xc439f['push'](_0xc439f['shift']());}};_0x2f437d(++_0x1494d4);}(_0x771a,0x1e2));var _0xa771=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x771a[_0x556bb1];return _0x45455f;};'use strict';var Sequelize=require('sequelize');module[_0xa771('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa771('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xa771('0x2')]}}; \ No newline at end of file +var _0xe1e3=['sequelize','exports','INTEGER','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe1e3,0x94));var _0x3e1e=function(_0x52c45c,_0x4d74e2){_0x52c45c=_0x52c45c-0x0;var _0x5b633c=_0xe1e3[_0x52c45c];return _0x5b633c;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3e1e('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3e1e('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index c3b2f67..45cc48e 100644 --- a/server/api/userFaxQueue/userFaxQueue.model.js +++ b/server/api/userFaxQueue/userFaxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf80a=['exports','define','UserFaxQueue','lodash','../../config/logger','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xf80a,0x11a));var _0xaf80=function(_0x4c6345,_0x2c4442){_0x4c6345=_0x4c6345-0x0;var _0x827ff=_0xf80a[_0x4c6345];return _0x827ff;};'use strict';var _=require(_0xaf80('0x0'));var util=require('util');var logger=require(_0xaf80('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf80('0x2'));var rimraf=require(_0xaf80('0x3'));var config=require(_0xaf80('0x4'));var attributes=require(_0xaf80('0x5'));module[_0xaf80('0x6')]=function(_0xd58869,_0x224a83){return _0xd58869[_0xaf80('0x7')](_0xaf80('0x8'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa936=['rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xa936,0xde));var _0x6a93=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xa936[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0x6a93('0x0'));var util=require(_0x6a93('0x1'));var logger=require(_0x6a93('0x2'))('api');var moment=require(_0x6a93('0x3'));var BPromise=require(_0x6a93('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a93('0x5'));var rimraf=require(_0x6a93('0x6'));var config=require('../../config/environment');var attributes=require(_0x6a93('0x7'));module[_0x6a93('0x8')]=function(_0x30e7a0,_0x4ef69b){return _0x30e7a0[_0x6a93('0x9')](_0x6a93('0xa'),attributes,{'tableName':_0x6a93('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index b6c308f..768ef39 100644 --- a/server/api/userFaxQueue/userFaxQueue.rpc.js +++ b/server/api/userFaxQueue/userFaxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cb7=['request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s'];(function(_0x384a9c,_0x19777e){var _0x5714ff=function(_0x14a7ba){while(--_0x14a7ba){_0x384a9c['push'](_0x384a9c['shift']());}};_0x5714ff(++_0x19777e);}(_0x5cb7,0xf9));var _0x75cb=function(_0x4deac0,_0x33a3a8){_0x4deac0=_0x4deac0-0x0;var _0x392c7c=_0x5cb7[_0x4deac0];return _0x392c7c;};'use strict';var _=require(_0x75cb('0x0'));var util=require(_0x75cb('0x1'));var moment=require(_0x75cb('0x2'));var BPromise=require(_0x75cb('0x3'));var rs=require(_0x75cb('0x4'));var fs=require('fs');var Redis=require(_0x75cb('0x5'));var db=require(_0x75cb('0x6'))['db'];var utils=require(_0x75cb('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x75cb('0x8'));var jayson=require(_0x75cb('0x9'));var client=jayson[_0x75cb('0xa')][_0x75cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40cff2,_0xa1bb08,_0x2fdccf){return new BPromise(function(_0x3a3d30,_0x45573b){return client['request'](_0x40cff2,_0x2fdccf)[_0x75cb('0xc')](function(_0x4d1537){logger[_0x75cb('0xd')](_0x75cb('0xe'),_0xa1bb08,_0x75cb('0xf'));logger['debug'](_0x75cb('0x10'),_0xa1bb08,_0x75cb('0xf'),JSON[_0x75cb('0x11')](_0x4d1537));if(_0x4d1537[_0x75cb('0x12')]){if(_0x4d1537[_0x75cb('0x12')]['code']===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0xa1bb08,_0x4d1537['error'][_0x75cb('0x13')]);return _0x45573b(_0x4d1537[_0x75cb('0x12')][_0x75cb('0x13')]);}logger['error'](_0x75cb('0xe'),_0xa1bb08,_0x4d1537[_0x75cb('0x12')][_0x75cb('0x13')]);return _0x3a3d30(_0x4d1537['error'][_0x75cb('0x13')]);}else{logger['info'](_0x75cb('0xe'),_0xa1bb08,_0x75cb('0xf'));_0x3a3d30(_0x4d1537[_0x75cb('0x14')][_0x75cb('0x13')]);}})[_0x75cb('0x15')](function(_0x4bbf34){logger['error'](_0x75cb('0xe'),_0xa1bb08,_0x4bbf34);_0x45573b(_0x4bbf34);});});} \ No newline at end of file +var _0x200c=['jayson/promise','http','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x200c,0x11f));var _0xc200=function(_0x593581,_0x44b77d){_0x593581=_0x593581-0x0;var _0x436585=_0x200c[_0x593581];return _0x436585;};'use strict';var _=require(_0xc200('0x0'));var util=require(_0xc200('0x1'));var moment=require('moment');var BPromise=require(_0xc200('0x2'));var rs=require(_0xc200('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc200('0x4'))['db'];var utils=require(_0xc200('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc200('0x6'));var jayson=require(_0xc200('0x7'));var client=jayson['client'][_0xc200('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3eee42,_0x2f948f,_0x5d9053){return new BPromise(function(_0x9ee309,_0x37bf40){return client[_0xc200('0x9')](_0x3eee42,_0x5d9053)[_0xc200('0xa')](function(_0x4fde4d){logger[_0xc200('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x2f948f,_0xc200('0xc'));logger[_0xc200('0xd')](_0xc200('0xe'),_0x2f948f,_0xc200('0xc'),JSON[_0xc200('0xf')](_0x4fde4d));if(_0x4fde4d[_0xc200('0x10')]){if(_0x4fde4d[_0xc200('0x10')][_0xc200('0x11')]===0x1f4){logger['error'](_0xc200('0x12'),_0x2f948f,_0x4fde4d[_0xc200('0x10')]['message']);return _0x37bf40(_0x4fde4d['error']['message']);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x2f948f,_0x4fde4d[_0xc200('0x10')][_0xc200('0x13')]);return _0x9ee309(_0x4fde4d[_0xc200('0x10')][_0xc200('0x13')]);}else{logger[_0xc200('0xb')](_0xc200('0x12'),_0x2f948f,_0xc200('0xc'));_0x9ee309(_0x4fde4d['result'][_0xc200('0x13')]);}})[_0xc200('0x14')](function(_0x1cf685){logger[_0xc200('0x10')](_0xc200('0x12'),_0x2f948f,_0x1cf685);_0x37bf40(_0x1cf685);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 52ec942..2641d53 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3efcd5,_0x9bbba3){var _0x54e50a=function(_0x34d7f4){while(--_0x34d7f4){_0x3efcd5['push'](_0x3efcd5['shift']());}};_0x54e50a(++_0x9bbba3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x259a42,_0x2b4483){var _0x548d68=function(_0x47656e){while(--_0x47656e){_0x259a42['push'](_0x259a42['shift']());}};_0x548d68(++_0x2b4483);}(_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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index dab01db..42d23c4 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x041a=['sequelize','exports','INTEGER'];(function(_0x56cea8,_0x33f21d){var _0x4667d9=function(_0x2993ac){while(--_0x2993ac){_0x56cea8['push'](_0x56cea8['shift']());}};_0x4667d9(++_0x33f21d);}(_0x041a,0x135));var _0xa041=function(_0x5d2f56,_0x453d87){_0x5d2f56=_0x5d2f56-0x0;var _0x3522ef=_0x041a[_0x5d2f56];return _0x3522ef;};'use strict';var Sequelize=require(_0xa041('0x0'));module[_0xa041('0x1')]={'penalty':{'type':Sequelize[_0xa041('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xef4b=['sequelize','INTEGER'];(function(_0x1f7dab,_0x437d18){var _0x1fe57f=function(_0x293530){while(--_0x293530){_0x1f7dab['push'](_0x1f7dab['shift']());}};_0x1fe57f(++_0x437d18);}(_0xef4b,0x128));var _0xbef4=function(_0x20a791,_0x49718f){_0x20a791=_0x20a791-0x0;var _0xe0f198=_0xef4b[_0x20a791];return _0xe0f198;};'use strict';var Sequelize=require(_0xbef4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbef4('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 168b1f3..1899943 100644 --- a/server/api/userMailQueue/userMailQueue.model.js +++ b/server/api/userMailQueue/userMailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3420=['util','../../config/logger','bluebird','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x58f401,_0x1136c9){var _0x146e3d=function(_0x249501){while(--_0x249501){_0x58f401['push'](_0x58f401['shift']());}};_0x146e3d(++_0x1136c9);}(_0x3420,0xba));var _0x0342=function(_0x48e4a4,_0x120886){_0x48e4a4=_0x48e4a4-0x0;var _0x2c7b56=_0x3420[_0x48e4a4];return _0x2c7b56;};'use strict';var _=require(_0x0342('0x0'));var util=require(_0x0342('0x1'));var logger=require(_0x0342('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0342('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0342('0x4'));var config=require(_0x0342('0x5'));var attributes=require(_0x0342('0x6'));module[_0x0342('0x7')]=function(_0x4fadfc,_0x2c21b3){return _0x4fadfc[_0x0342('0x8')](_0x0342('0x9'),attributes,{'tableName':_0x0342('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0703=['user_has_mail_queues','lodash','util','api','bluebird','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue'];(function(_0x5986ba,_0x39cfb6){var _0x4f07ed=function(_0x1bd455){while(--_0x1bd455){_0x5986ba['push'](_0x5986ba['shift']());}};_0x4f07ed(++_0x39cfb6);}(_0x0703,0x160));var _0x3070=function(_0x31b2a5,_0x2480b4){_0x31b2a5=_0x31b2a5-0x0;var _0x198fa4=_0x0703[_0x31b2a5];return _0x198fa4;};'use strict';var _=require(_0x3070('0x0'));var util=require(_0x3070('0x1'));var logger=require('../../config/logger')(_0x3070('0x2'));var moment=require('moment');var BPromise=require(_0x3070('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3070('0x4'));var attributes=require(_0x3070('0x5'));module[_0x3070('0x6')]=function(_0x2ac960,_0x489619){return _0x2ac960['define'](_0x3070('0x7'),attributes,{'tableName':_0x3070('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index b34178f..4bea40d 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x3e690a,_0x31aa0f){_0x3e690a=_0x3e690a-0x0;var _0x435ca0=_0x008c[_0x3e690a];return _0x435ca0;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x32d414,_0x4d23da){_0x32d414=_0x32d414-0x0;var _0x4e0bca=_0x008c[_0x32d414];return _0x4e0bca;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 361e794..46bceab 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebca=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util','connect-timeout','express','Router'];(function(_0x1a0f52,_0x27903d){var _0x52f62a=function(_0x59be17){while(--_0x59be17){_0x1a0f52['push'](_0x1a0f52['shift']());}};_0x52f62a(++_0x27903d);}(_0xebca,0x19b));var _0xaebc=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0xebca[_0x492535];return _0x256620;};'use strict';var multer=require(_0xaebc('0x0'));var util=require(_0xaebc('0x1'));var path=require('path');var timeout=require(_0xaebc('0x2'));var express=require(_0xaebc('0x3'));var router=express[_0xaebc('0x4')]();var fs_extra=require(_0xaebc('0x5'));var auth=require(_0xaebc('0x6'));var interaction=require(_0xaebc('0x7'));var config=require(_0xaebc('0x8'));var controller=require(_0xaebc('0x9'));router['post']('/',auth[_0xaebc('0xa')](),controller[_0xaebc('0xb')]);module[_0xaebc('0xc')]=router; \ No newline at end of file +var _0x0644=['../../config/environment','./userNotification.controller','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0644,0x1b2));var _0x4064=function(_0x2ef327,_0x5630c3){_0x2ef327=_0x2ef327-0x0;var _0x34e298=_0x0644[_0x2ef327];return _0x34e298;};'use strict';var multer=require(_0x4064('0x0'));var util=require(_0x4064('0x1'));var path=require(_0x4064('0x2'));var timeout=require(_0x4064('0x3'));var express=require(_0x4064('0x4'));var router=express['Router']();var fs_extra=require(_0x4064('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4064('0x6'));var config=require(_0x4064('0x7'));var controller=require(_0x4064('0x8'));router['post']('/',auth['isAuthenticated'](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 44e7190..43a1243 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf66a=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3e339b,_0x5b61ff){var _0x3d7a92=function(_0x2cdf01){while(--_0x2cdf01){_0x3e339b['push'](_0x3e339b['shift']());}};_0x3d7a92(++_0x5b61ff);}(_0xf66a,0x130));var _0xaf66=function(_0x27ed58,_0x28259b){_0x27ed58=_0x27ed58-0x0;var _0x5b7a20=_0xf66a[_0x27ed58];return _0x5b7a20;};'use strict';var Sequelize=require(_0xaf66('0x0'));module[_0xaf66('0x1')]={'body':{'type':Sequelize[_0xaf66('0x2')]},'senderName':{'type':Sequelize[_0xaf66('0x3')]},'recipientsId':{'type':Sequelize[_0xaf66('0x2')]},'recipientsDescription':{'type':Sequelize[_0xaf66('0x3')]},'beep':{'type':Sequelize[_0xaf66('0x4')]}}; \ No newline at end of file +var _0xe400=['STRING','sequelize','exports','TEXT'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe400,0x135));var _0x0e40=function(_0x5db7b2,_0x5f38c3){_0x5db7b2=_0x5db7b2-0x0;var _0x35d2e9=_0xe400[_0x5db7b2];return _0x35d2e9;};'use strict';var Sequelize=require(_0x0e40('0x0'));module[_0x0e40('0x1')]={'body':{'type':Sequelize[_0x0e40('0x2')]},'senderName':{'type':Sequelize[_0x0e40('0x3')]},'recipientsId':{'type':Sequelize[_0x0e40('0x2')]},'recipientsDescription':{'type':Sequelize[_0x0e40('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index c3d2674..2b7b12e 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7df=['faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','emit','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','union','ids','queue','Queue','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','reject','save','then','destroy','end','error','stack','name','sendUserNotification','body','hasOwnProperty','text','ValidationError','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Sequelize','Invalid\x20\x27recipients\x27\x20object','chatqueue'];(function(_0x3ab3a2,_0x5d819b){var _0x395938=function(_0x3253f8){while(--_0x3253f8){_0x3ab3a2['push'](_0x3ab3a2['shift']());}};_0x395938(++_0x5d819b);}(_0xf7df,0x1b1));var _0xff7d=function(_0x12f5e9,_0x143f50){_0x12f5e9=_0x12f5e9-0x0;var _0x2fd607=_0xf7df[_0x12f5e9];return _0x2fd607;};'use strict';var emlformat=require(_0xff7d('0x0'));var rimraf=require(_0xff7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff7d('0x2'));var rp=require(_0xff7d('0x3'));var moment=require(_0xff7d('0x4'));var BPromise=require(_0xff7d('0x5'));var Mustache=require(_0xff7d('0x6'));var util=require(_0xff7d('0x7'));var path=require(_0xff7d('0x8'));var sox=require(_0xff7d('0x9'));var csv=require(_0xff7d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff7d('0xb'));var _=require('lodash');var squel=require(_0xff7d('0xc'));var crypto=require(_0xff7d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xff7d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xff7d('0xf'));var Papa=require(_0xff7d('0x10'));var Redis=require(_0xff7d('0x11'));var authService=require(_0xff7d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xff7d('0x13'));var hardwareService=require(_0xff7d('0x14'));var logger=require(_0xff7d('0x15'))(_0xff7d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xff7d('0x17'));var db=require('../../mysqldb')['db'];config[_0xff7d('0x18')]=_[_0xff7d('0x19')](config[_0xff7d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xff7d('0x1a'))(new Redis(config[_0xff7d('0x18')]));require('./userNotification.socket')[_0xff7d('0x1b')](socket);function respondWithStatusCode(_0xa9fd54,_0x3463a1){_0x3463a1=_0x3463a1||0xcc;return function(_0x5e1b3b){if(_0x5e1b3b){return _0xa9fd54[_0xff7d('0x1c')](_0x3463a1);}return _0xa9fd54[_0xff7d('0x1d')](_0x3463a1)['end']();};}function respondWithResult(_0x58d121,_0x581bcb){_0x581bcb=_0x581bcb||0xc8;return function(_0x3cd916){if(_0x3cd916){return _0x58d121[_0xff7d('0x1d')](_0x581bcb)[_0xff7d('0x1e')](_0x3cd916);}};}function respondWithFilteredResult(_0x4964e4,_0x5538dd){return function(_0x3d1108){if(_0x3d1108){var _0xa2cc80=typeof _0x5538dd[_0xff7d('0x1f')]===_0xff7d('0x20')&&typeof _0x5538dd[_0xff7d('0x21')]===_0xff7d('0x20');var _0x3245e9=_0x3d1108[_0xff7d('0x22')];var _0x32880d=_0xa2cc80?0x0:_0x5538dd['offset'];var _0x5d984d=_0xa2cc80?_0x3d1108[_0xff7d('0x22')]:_0x5538dd[_0xff7d('0x1f')]+_0x5538dd[_0xff7d('0x21')];var _0x37f972;if(_0x5d984d>=_0x3245e9){_0x5d984d=_0x3245e9;_0x37f972=0xc8;}else{_0x37f972=0xce;}_0x4964e4['status'](_0x37f972);return _0x4964e4['set']('Content-Range',_0x32880d+'-'+_0x5d984d+'/'+_0x3245e9)[_0xff7d('0x1e')](_0x3d1108);}return null;};}function patchUpdates(_0x2378ea){return function(_0x17b287){try{jsonpatch['apply'](_0x17b287,_0x2378ea,!![]);}catch(_0x328f74){return BPromise[_0xff7d('0x23')](_0x328f74);}return _0x17b287[_0xff7d('0x24')]();};}function saveUpdates(_0x27e922,_0x590c51){return function(_0x2c2772){if(_0x2c2772){return _0x2c2772['update'](_0x27e922)[_0xff7d('0x25')](function(_0x4b4aad){return _0x4b4aad;});}return null;};}function removeEntity(_0x47c094,_0x7a3c93){return function(_0x4d72a3){if(_0x4d72a3){return _0x4d72a3[_0xff7d('0x26')]()[_0xff7d('0x25')](function(){_0x47c094[_0xff7d('0x1d')](0xcc)[_0xff7d('0x27')]();});}};}function handleEntityNotFound(_0x6f8f6,_0x2aec39){return function(_0x4ab83e){if(!_0x4ab83e){_0x6f8f6[_0xff7d('0x1c')](0x194);}return _0x4ab83e;};}function handleError(_0xf46b06,_0x5b79dc){_0x5b79dc=_0x5b79dc||0x1f4;return function(_0x106e79){logger[_0xff7d('0x28')](_0x106e79[_0xff7d('0x29')]);if(_0x106e79['name']){delete _0x106e79[_0xff7d('0x2a')];}_0xf46b06['status'](_0x5b79dc)['send'](_0x106e79);};}exports[_0xff7d('0x2b')]=function(_0x10c2ec,_0x325f60,_0x57aaba){if(!_0x10c2ec[_0xff7d('0x2c')][_0xff7d('0x2d')](_0xff7d('0x2e'))&&!_0x10c2ec[_0xff7d('0x2c')]['hasOwnProperty']('TemplateId')){throw new db['Sequelize'][(_0xff7d('0x2f'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x10c2ec[_0xff7d('0x2c')]['hasOwnProperty'](_0xff7d('0x30'))&&!_0x10c2ec[_0xff7d('0x2c')]['hasOwnProperty'](_0xff7d('0x31'))){throw new db['Sequelize']['ValidationError'](_0xff7d('0x32'));}if(!_0x10c2ec['body'][_0xff7d('0x2d')](_0xff7d('0x33'))){throw new db['Sequelize'][(_0xff7d('0x2f'))](_0xff7d('0x34'));}else{try{var _0x5c93fa=JSON[_0xff7d('0x35')](_0x10c2ec[_0xff7d('0x2c')][_0xff7d('0x33')]);}catch(_0x1189ec){logger[_0xff7d('0x28')](_0x1189ec);throw new db[(_0xff7d('0x36'))][(_0xff7d('0x2f'))](_0xff7d('0x37'));}var _0x48d6c3=[_0xff7d('0x38'),_0xff7d('0x39'),'mailqueue',_0xff7d('0x3a'),_0xff7d('0x3b'),_0xff7d('0x3c'),_0xff7d('0x3d'),_0xff7d('0x3e'),'user'];if(_['some'](_0x5c93fa,function(_0x39a799){return!_[_0xff7d('0x3f')](_0x48d6c3,_0x39a799[_0xff7d('0x40')][_0xff7d('0x41')]());})){throw new db[(_0xff7d('0x36'))][(_0xff7d('0x2f'))](_0xff7d('0x42'));}}}var _0x562004={};_0x562004[_0xff7d('0x43')]=_0x10c2ec[_0xff7d('0x2c')][_0xff7d('0x2d')](_0xff7d('0x43'))?_0x10c2ec[_0xff7d('0x2c')][_0xff7d('0x43')]:_0x10c2ec[_0xff7d('0x44')][_0xff7d('0x45')];_0x562004[_0xff7d('0x46')]=_[_0xff7d('0x47')](_0x10c2ec['body'][_0xff7d('0x46')])?null:_0x10c2ec[_0xff7d('0x2c')][_0xff7d('0x46')];_0x562004[_0xff7d('0x48')]=_0x10c2ec[_0xff7d('0x2c')]['beep']||![];_0x562004[_0xff7d('0x49')]=_0x10c2ec[_0xff7d('0x44')]['id'];return getContent(_0x10c2ec[_0xff7d('0x2c')])[_0xff7d('0x25')](function(_0x763a01){_0x562004[_0xff7d('0x2c')]=_0x763a01;return getRecipients(_0x5c93fa);})[_0xff7d('0x25')](function(_0x392983){_0x562004[_0xff7d('0x4a')]=_[_0xff7d('0x4b')](_0x392983)[_0xff7d('0x4c')](',');return db[_0xff7d('0x4d')]['transaction'](function(_0x59252d){return db[_0xff7d('0x4e')][_0xff7d('0x4f')](_0x562004,{'raw':!![],'transaction':_0x59252d})['then'](function(_0x3f1116){var _0x4d6cec={'sender':_0x562004[_0xff7d('0x43')],'description':_0x562004[_0xff7d('0x46')],'content':_0x562004[_0xff7d('0x2c')],'beep':_0x562004[_0xff7d('0x48')]};_0x392983[_0xff7d('0x50')](function(_0xc641df){_0x4d6cec[_0xff7d('0x51')]=_0xc641df;socket[_0xff7d('0x52')]('userNotification:send',_0x4d6cec);});return _0x3f1116;});});})[_0xff7d('0x25')](respondWithResult(_0x325f60,0xc9))['catch'](handleError(_0x325f60,null));};function getContent(_0xedfe48){return new BPromise(function(_0x1db1f4,_0x1e0c22){if(_0xedfe48['text']){_0x1db1f4(_0xedfe48[_0xff7d('0x2e')]);return;}return db[_0xff7d('0x53')][_0xff7d('0x54')]({'attributes':[_0xff7d('0x55')],'where':{'id':_0xedfe48[_0xff7d('0x30')]},'raw':!![]})[_0xff7d('0x25')](function(_0x56010c){if(!_0x56010c)throw new db['Sequelize'][(_0xff7d('0x2f'))](_0xff7d('0x56'));var _0x108833=Mustache[_0xff7d('0x57')](_0x56010c[_0xff7d('0x55')],_0xedfe48[_0xff7d('0x31')]);_0x1db1f4(_0x108833);})[_0xff7d('0x58')](function(_0x1d1f7a){_0x1e0c22(_0x1d1f7a);});});}function getRecipients(_0x4f6d4e){return new BPromise(function(_0xdf1ddc,_0x190cc3){var _0x215694=[];var _0xbcf49=[];_0x4f6d4e['forEach'](function(_0x3e31da){var _0x48adde=_[_0xff7d('0x59')](_0x3e31da['model'][_0xff7d('0x41')]());if(_0x48adde===_0xff7d('0x5a')){_0x215694=_[_0xff7d('0x5b')](_0x215694,_0x3e31da[_0xff7d('0x5c')]);}else{if(_[_0xff7d('0x3f')](_0x48adde,_0xff7d('0x5d')))_0x48adde=_0x48adde['replace'](_0xff7d('0x5d'),_0xff7d('0x5e'));_0x3e31da[_0xff7d('0x5c')][_0xff7d('0x50')](function(_0x4a15ac){_0xbcf49['push'](getAgents(_0x48adde,_0x4a15ac));});}});return BPromise['all'](_0xbcf49)[_0xff7d('0x25')](function(_0x3a11c9){_0x215694=_[_0xff7d('0x5b')](_0x215694,_[_0xff7d('0x5f')](_0x3a11c9));_0xdf1ddc(_0x215694);})[_0xff7d('0x58')](function(_0x1eec90){_0x190cc3(_0x1eec90);});});}function getAgents(_0x342004,_0x551671){return new BPromise(function(_0x4dcc36,_0x11d998){return db[_0x342004][_0xff7d('0x54')]({'where':{'id':_0x551671}})[_0xff7d('0x25')](function(_0x94ca84){return _0x94ca84[_0xff7d('0x60')]({'attributes':['id'],'raw':!![]})[_0xff7d('0x25')](function(_0x18742a){var _0xcdc172=_[_0xff7d('0x61')](_0x18742a,'id');_0x4dcc36(_0xcdc172);});})[_0xff7d('0x58')](function(_0xf9b6f7){_0x11d998(_0xf9b6f7);});});} \ No newline at end of file +var _0x50c0=['Template','render','startCase','toLowerCase','ids','replace','queue','Queue','push','all','union','flatten','getAgents','map','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','apply','save','update','then','error','stack','name','send','sendUserNotification','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','whatsappqueue','team','some','includes','model','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch'];(function(_0x5addae,_0x33677b){var _0x5efeda=function(_0x294e1b){while(--_0x294e1b){_0x5addae['push'](_0x5addae['shift']());}};_0x5efeda(++_0x33677b);}(_0x50c0,0x192));var _0x050c=function(_0x438434,_0x36f21f){_0x438434=_0x438434-0x0;var _0x3b97c9=_0x50c0[_0x438434];return _0x3b97c9;};'use strict';var emlformat=require(_0x050c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x050c('0x1'));var jsonpatch=require(_0x050c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x050c('0x3'));var Mustache=require(_0x050c('0x4'));var util=require(_0x050c('0x5'));var path=require(_0x050c('0x6'));var sox=require(_0x050c('0x7'));var csv=require(_0x050c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x050c('0x9'));var _=require(_0x050c('0xa'));var squel=require(_0x050c('0xb'));var crypto=require(_0x050c('0xc'));var jsforce=require(_0x050c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x050c('0x8'));var querystring=require(_0x050c('0xe'));var Papa=require(_0x050c('0xf'));var Redis=require(_0x050c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x050c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x050c('0x12'));var logger=require(_0x050c('0x13'))(_0x050c('0x14'));var utils=require('../../config/utils');var config=require(_0x050c('0x15'));var licenseUtil=require(_0x050c('0x16'));var db=require(_0x050c('0x17'))['db'];config[_0x050c('0x18')]=_['defaults'](config[_0x050c('0x18')],{'host':_0x050c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x050c('0x18')]));require('./userNotification.socket')[_0x050c('0x1a')](socket);function respondWithStatusCode(_0x10a1e1,_0x21ee21){_0x21ee21=_0x21ee21||0xcc;return function(_0x4eb2b7){if(_0x4eb2b7){return _0x10a1e1[_0x050c('0x1b')](_0x21ee21);}return _0x10a1e1[_0x050c('0x1c')](_0x21ee21)[_0x050c('0x1d')]();};}function respondWithResult(_0x1b0c9b,_0x4aff21){_0x4aff21=_0x4aff21||0xc8;return function(_0x1c15ef){if(_0x1c15ef){return _0x1b0c9b[_0x050c('0x1c')](_0x4aff21)['json'](_0x1c15ef);}};}function respondWithFilteredResult(_0x2f4fd1,_0x6188d3){return function(_0x195317){if(_0x195317){var _0xfb898b=typeof _0x6188d3['offset']===_0x050c('0x1e')&&typeof _0x6188d3[_0x050c('0x1f')]===_0x050c('0x1e');var _0xd0d084=_0x195317['count'];var _0x4ab646=_0xfb898b?0x0:_0x6188d3[_0x050c('0x20')];var _0x49f7d5=_0xfb898b?_0x195317[_0x050c('0x21')]:_0x6188d3[_0x050c('0x20')]+_0x6188d3[_0x050c('0x1f')];var _0x17a523;if(_0x49f7d5>=_0xd0d084){_0x49f7d5=_0xd0d084;_0x17a523=0xc8;}else{_0x17a523=0xce;}_0x2f4fd1[_0x050c('0x1c')](_0x17a523);return _0x2f4fd1['set'](_0x050c('0x22'),_0x4ab646+'-'+_0x49f7d5+'/'+_0xd0d084)[_0x050c('0x23')](_0x195317);}return null;};}function patchUpdates(_0x302799){return function(_0x2d80be){try{jsonpatch[_0x050c('0x24')](_0x2d80be,_0x302799,!![]);}catch(_0x20b8f1){return BPromise['reject'](_0x20b8f1);}return _0x2d80be[_0x050c('0x25')]();};}function saveUpdates(_0x417289,_0x2dca3f){return function(_0x323ac4){if(_0x323ac4){return _0x323ac4[_0x050c('0x26')](_0x417289)[_0x050c('0x27')](function(_0x21ee08){return _0x21ee08;});}return null;};}function removeEntity(_0x2a350d,_0x46c202){return function(_0x22fa2c){if(_0x22fa2c){return _0x22fa2c['destroy']()['then'](function(){_0x2a350d[_0x050c('0x1c')](0xcc)[_0x050c('0x1d')]();});}};}function handleEntityNotFound(_0x3f5837,_0x311783){return function(_0x407a42){if(!_0x407a42){_0x3f5837[_0x050c('0x1b')](0x194);}return _0x407a42;};}function handleError(_0x598841,_0x1bef71){_0x1bef71=_0x1bef71||0x1f4;return function(_0x549dec){logger[_0x050c('0x28')](_0x549dec[_0x050c('0x29')]);if(_0x549dec[_0x050c('0x2a')]){delete _0x549dec[_0x050c('0x2a')];}_0x598841[_0x050c('0x1c')](_0x1bef71)[_0x050c('0x2b')](_0x549dec);};}exports[_0x050c('0x2c')]=function(_0x180eb1,_0x47aedb,_0x48efc5){if(!_0x180eb1['body'][_0x050c('0x2d')](_0x050c('0x2e'))&&!_0x180eb1['body'][_0x050c('0x2d')](_0x050c('0x2f'))){throw new db[(_0x050c('0x30'))]['ValidationError'](_0x050c('0x31'));}else{if(_0x180eb1['body']['hasOwnProperty'](_0x050c('0x2f'))&&!_0x180eb1[_0x050c('0x32')]['hasOwnProperty'](_0x050c('0x33'))){throw new db[(_0x050c('0x30'))][(_0x050c('0x34'))](_0x050c('0x35'));}if(!_0x180eb1[_0x050c('0x32')][_0x050c('0x2d')](_0x050c('0x36'))){throw new db[(_0x050c('0x30'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x3ded90=JSON[_0x050c('0x37')](_0x180eb1[_0x050c('0x32')][_0x050c('0x36')]);}catch(_0x2ea05e){logger[_0x050c('0x28')](_0x2ea05e);throw new db['Sequelize']['ValidationError'](_0x050c('0x38'));}var _0x53cb93=[_0x050c('0x39'),_0x050c('0x3a'),'mailqueue','openchannelqueue','smsqueue','voicequeue',_0x050c('0x3b'),_0x050c('0x3c'),'user'];if(_[_0x050c('0x3d')](_0x3ded90,function(_0x409170){return!_[_0x050c('0x3e')](_0x53cb93,_0x409170[_0x050c('0x3f')]['toLowerCase']());})){throw new db[(_0x050c('0x30'))][(_0x050c('0x34'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x39f6bb={};_0x39f6bb['senderName']=_0x180eb1['body'][_0x050c('0x2d')](_0x050c('0x40'))?_0x180eb1[_0x050c('0x32')][_0x050c('0x40')]:_0x180eb1[_0x050c('0x41')][_0x050c('0x42')];_0x39f6bb[_0x050c('0x43')]=_[_0x050c('0x44')](_0x180eb1[_0x050c('0x32')][_0x050c('0x43')])?null:_0x180eb1[_0x050c('0x32')][_0x050c('0x43')];_0x39f6bb[_0x050c('0x45')]=_0x180eb1['body'][_0x050c('0x45')]||![];_0x39f6bb[_0x050c('0x46')]=_0x180eb1[_0x050c('0x41')]['id'];return getContent(_0x180eb1[_0x050c('0x32')])[_0x050c('0x27')](function(_0x1fb16d){_0x39f6bb[_0x050c('0x32')]=_0x1fb16d;return getRecipients(_0x3ded90);})[_0x050c('0x27')](function(_0x29ad8b){_0x39f6bb[_0x050c('0x47')]=_[_0x050c('0x48')](_0x29ad8b)[_0x050c('0x49')](',');return db[_0x050c('0x4a')][_0x050c('0x4b')](function(_0x3ff4da){return db[_0x050c('0x4c')][_0x050c('0x4d')](_0x39f6bb,{'raw':!![],'transaction':_0x3ff4da})[_0x050c('0x27')](function(_0x492717){var _0x40b0b3={'sender':_0x39f6bb[_0x050c('0x40')],'description':_0x39f6bb[_0x050c('0x43')],'content':_0x39f6bb[_0x050c('0x32')],'beep':_0x39f6bb[_0x050c('0x45')]};_0x29ad8b[_0x050c('0x4e')](function(_0x292b93){_0x40b0b3[_0x050c('0x4f')]=_0x292b93;socket[_0x050c('0x50')](_0x050c('0x51'),_0x40b0b3);});return _0x492717;});});})[_0x050c('0x27')](respondWithResult(_0x47aedb,0xc9))[_0x050c('0x52')](handleError(_0x47aedb,null));};function getContent(_0x4d6fbf){return new BPromise(function(_0x49cd14,_0x21d5c8){if(_0x4d6fbf[_0x050c('0x2e')]){_0x49cd14(_0x4d6fbf[_0x050c('0x2e')]);return;}return db[_0x050c('0x53')]['findOne']({'attributes':['html'],'where':{'id':_0x4d6fbf['TemplateId']},'raw':!![]})[_0x050c('0x27')](function(_0x49eb7f){if(!_0x49eb7f)throw new db[(_0x050c('0x30'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x28fafd=Mustache[_0x050c('0x54')](_0x49eb7f['html'],_0x4d6fbf[_0x050c('0x33')]);_0x49cd14(_0x28fafd);})[_0x050c('0x52')](function(_0xaf11a8){_0x21d5c8(_0xaf11a8);});});}function getRecipients(_0x14879f){return new BPromise(function(_0x3dd9e0,_0x33c924){var _0x3cda1c=[];var _0x27eb35=[];_0x14879f[_0x050c('0x4e')](function(_0x1e71c5){var _0x4109fe=_[_0x050c('0x55')](_0x1e71c5['model'][_0x050c('0x56')]());if(_0x4109fe==='User'){_0x3cda1c=_['union'](_0x3cda1c,_0x1e71c5[_0x050c('0x57')]);}else{if(_['includes'](_0x4109fe,'queue'))_0x4109fe=_0x4109fe[_0x050c('0x58')](_0x050c('0x59'),_0x050c('0x5a'));_0x1e71c5[_0x050c('0x57')][_0x050c('0x4e')](function(_0x200989){_0x27eb35[_0x050c('0x5b')](getAgents(_0x4109fe,_0x200989));});}});return BPromise[_0x050c('0x5c')](_0x27eb35)['then'](function(_0x2dbdb7){_0x3cda1c=_[_0x050c('0x5d')](_0x3cda1c,_[_0x050c('0x5e')](_0x2dbdb7));_0x3dd9e0(_0x3cda1c);})['catch'](function(_0x1f7c79){_0x33c924(_0x1f7c79);});});}function getAgents(_0x547cac,_0x3757b4){return new BPromise(function(_0xe5dabf,_0x3bdbae){return db[_0x547cac]['findOne']({'where':{'id':_0x3757b4}})[_0x050c('0x27')](function(_0x43704f){return _0x43704f[_0x050c('0x5f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x49d070){var _0x11933d=_[_0x050c('0x60')](_0x49d070,'id');_0xe5dabf(_0x11933d);});})[_0x050c('0x52')](function(_0x46584b){_0x3bdbae(_0x46584b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index f65cba4..53b4495 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x706e=['update','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x422559,_0x431db3){var _0x33b51a=function(_0x125e43){while(--_0x125e43){_0x422559['push'](_0x422559['shift']());}};_0x33b51a(++_0x431db3);}(_0x706e,0x11c));var _0xe706=function(_0x344dfe,_0x2510ac){_0x344dfe=_0x344dfe-0x0;var _0x17e34c=_0x706e[_0x344dfe];return _0x17e34c;};'use strict';var EventEmitter=require(_0xe706('0x0'));var UserNotification=require(_0xe706('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe706('0x2')](0x0);var events={'afterCreate':_0xe706('0x3'),'afterUpdate':_0xe706('0x4'),'afterDestroy':'remove'};function emitEvent(_0x24f843){return function(_0x5b7358,_0x5dde35,_0x2d36be){UserNotificationEvents['emit'](_0x24f843+':'+_0x5b7358['id'],_0x5b7358);UserNotificationEvents['emit'](_0x24f843,_0x5b7358);_0x2d36be(null);};}for(var e in events){if(events[_0xe706('0x5')](e)){var event=events[e];UserNotification[_0xe706('0x6')](e,emitEvent(event));}}module[_0xe706('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xf1a6=['remove','emit','events','../../mysqldb','setMaxListeners','save'];(function(_0x5640c1,_0x3f1926){var _0x5de860=function(_0x5aacd1){while(--_0x5aacd1){_0x5640c1['push'](_0x5640c1['shift']());}};_0x5de860(++_0x3f1926);}(_0xf1a6,0x1be));var _0x6f1a=function(_0x5fe167,_0x11426d){_0x5fe167=_0x5fe167-0x0;var _0x28560b=_0xf1a6[_0x5fe167];return _0x28560b;};'use strict';var EventEmitter=require(_0x6f1a('0x0'));var UserNotification=require(_0x6f1a('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x6f1a('0x2')](0x0);var events={'afterCreate':_0x6f1a('0x3'),'afterUpdate':'update','afterDestroy':_0x6f1a('0x4')};function emitEvent(_0x353c45){return function(_0x537830,_0x4db7bc,_0x489df5){UserNotificationEvents[_0x6f1a('0x5')](_0x353c45+':'+_0x537830['id'],_0x537830);UserNotificationEvents[_0x6f1a('0x5')](_0x353c45,_0x537830);_0x489df5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index be912c9..b36bc99 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6eeb=['path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise'];(function(_0x475526,_0x45e0e3){var _0x108f48=function(_0x22c7c2){while(--_0x22c7c2){_0x475526['push'](_0x475526['shift']());}};_0x108f48(++_0x45e0e3);}(_0x6eeb,0x7a));var _0xb6ee=function(_0x1978cf,_0x106e44){_0x1978cf=_0x1978cf-0x0;var _0x7ec3f5=_0x6eeb[_0x1978cf];return _0x7ec3f5;};'use strict';var _=require(_0xb6ee('0x0'));var util=require('util');var logger=require(_0xb6ee('0x1'))('api');var moment=require(_0xb6ee('0x2'));var BPromise=require('bluebird');var rp=require(_0xb6ee('0x3'));var fs=require('fs');var path=require(_0xb6ee('0x4'));var rimraf=require(_0xb6ee('0x5'));var config=require(_0xb6ee('0x6'));var attributes=require(_0xb6ee('0x7'));module[_0xb6ee('0x8')]=function(_0x56fcaa,_0x2f187b){return _0x56fcaa[_0xb6ee('0x9')](_0xb6ee('0xa'),attributes,{'tableName':_0xb6ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb6ee('0xc'),'collate':_0xb6ee('0xd')});}; \ No newline at end of file +var _0x38c9=['UserNotification','userNotifications','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userNotification.attributes','exports','define'];(function(_0x2147e6,_0x36e82a){var _0x2d3c52=function(_0x3a6bc2){while(--_0x3a6bc2){_0x2147e6['push'](_0x2147e6['shift']());}};_0x2d3c52(++_0x36e82a);}(_0x38c9,0x199));var _0x938c=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x38c9[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x938c('0x0'));var util=require(_0x938c('0x1'));var logger=require(_0x938c('0x2'))('api');var moment=require(_0x938c('0x3'));var BPromise=require(_0x938c('0x4'));var rp=require(_0x938c('0x5'));var fs=require('fs');var path=require(_0x938c('0x6'));var rimraf=require('rimraf');var config=require(_0x938c('0x7'));var attributes=require(_0x938c('0x8'));module[_0x938c('0x9')]=function(_0x15a858,_0x4dae36){return _0x15a858[_0x938c('0xa')](_0x938c('0xb'),attributes,{'tableName':_0x938c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x938c('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 4ca3494..e4824ef 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d36=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x5d36,0xe4));var _0x65d3=function(_0x10ed52,_0x4dcad2){_0x10ed52=_0x10ed52-0x0;var _0x2f4623=_0x5d36[_0x10ed52];return _0x2f4623;};'use strict';var _=require(_0x65d3('0x0'));var util=require(_0x65d3('0x1'));var moment=require(_0x65d3('0x2'));var BPromise=require(_0x65d3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65d3('0x4'));var db=require(_0x65d3('0x5'))['db'];var utils=require(_0x65d3('0x6'));var logger=require('../../config/logger')(_0x65d3('0x7'));var config=require(_0x65d3('0x8'));var jayson=require(_0x65d3('0x9'));var client=jayson[_0x65d3('0xa')][_0x65d3('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x65d3('0xc')],{'host':_0x65d3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65d3('0xc')]));require(_0x65d3('0xe'))[_0x65d3('0xf')](socket);function respondWithRpcPromise(_0x463cf3,_0xc23204,_0x1b6ec6){return new BPromise(function(_0x3eb237,_0x75006f){return client[_0x65d3('0x10')](_0x463cf3,_0x1b6ec6)[_0x65d3('0x11')](function(_0x550971){logger[_0x65d3('0x12')](_0x65d3('0x13'),_0xc23204,_0x65d3('0x14'));logger[_0x65d3('0x15')](_0x65d3('0x16'),_0xc23204,'request\x20sent',JSON[_0x65d3('0x17')](_0x550971));if(_0x550971[_0x65d3('0x18')]){if(_0x550971[_0x65d3('0x18')][_0x65d3('0x19')]===0x1f4){logger[_0x65d3('0x18')](_0x65d3('0x13'),_0xc23204,_0x550971[_0x65d3('0x18')][_0x65d3('0x1a')]);return _0x75006f(_0x550971[_0x65d3('0x18')][_0x65d3('0x1a')]);}logger[_0x65d3('0x18')](_0x65d3('0x13'),_0xc23204,_0x550971[_0x65d3('0x18')][_0x65d3('0x1a')]);return _0x3eb237(_0x550971[_0x65d3('0x18')][_0x65d3('0x1a')]);}else{logger[_0x65d3('0x12')](_0x65d3('0x13'),_0xc23204,_0x65d3('0x14'));_0x3eb237(_0x550971[_0x65d3('0x1b')][_0x65d3('0x1a')]);}})[_0x65d3('0x1c')](function(_0x371722){logger[_0x65d3('0x18')](_0x65d3('0x13'),_0xc23204,_0x371722);_0x75006f(_0x371722);});});} \ No newline at end of file +var _0xf1ab=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf1ab,0x159));var _0xbf1a=function(_0x1b2341,_0x11e599){_0x1b2341=_0x1b2341-0x0;var _0x94fca0=_0xf1ab[_0x1b2341];return _0x94fca0;};'use strict';var _=require(_0xbf1a('0x0'));var util=require(_0xbf1a('0x1'));var moment=require(_0xbf1a('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf1a('0x3'));var fs=require('fs');var Redis=require(_0xbf1a('0x4'));var db=require(_0xbf1a('0x5'))['db'];var utils=require(_0xbf1a('0x6'));var logger=require('../../config/logger')(_0xbf1a('0x7'));var config=require(_0xbf1a('0x8'));var jayson=require(_0xbf1a('0x9'));var client=jayson[_0xbf1a('0xa')]['http']({'port':0x232a});config[_0xbf1a('0xb')]=_[_0xbf1a('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf1a('0xb')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x2d45a8,_0x1d15be,_0x399dd6){return new BPromise(function(_0x32b2d9,_0x4da7fd){return client[_0xbf1a('0xd')](_0x2d45a8,_0x399dd6)[_0xbf1a('0xe')](function(_0x387601){logger[_0xbf1a('0xf')](_0xbf1a('0x10'),_0x1d15be,'request\x20sent');logger[_0xbf1a('0x11')](_0xbf1a('0x12'),_0x1d15be,_0xbf1a('0x13'),JSON[_0xbf1a('0x14')](_0x387601));if(_0x387601[_0xbf1a('0x15')]){if(_0x387601[_0xbf1a('0x15')][_0xbf1a('0x16')]===0x1f4){logger['error'](_0xbf1a('0x10'),_0x1d15be,_0x387601[_0xbf1a('0x15')][_0xbf1a('0x17')]);return _0x4da7fd(_0x387601[_0xbf1a('0x15')][_0xbf1a('0x17')]);}logger[_0xbf1a('0x15')](_0xbf1a('0x10'),_0x1d15be,_0x387601['error'][_0xbf1a('0x17')]);return _0x32b2d9(_0x387601[_0xbf1a('0x15')][_0xbf1a('0x17')]);}else{logger[_0xbf1a('0xf')](_0xbf1a('0x10'),_0x1d15be,_0xbf1a('0x13'));_0x32b2d9(_0x387601['result']['message']);}})[_0xbf1a('0x18')](function(_0x1ea6a6){logger['error'](_0xbf1a('0x10'),_0x1d15be,_0x1ea6a6);_0x4da7fd(_0x1ea6a6);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index a94c2d4..8dc92ff 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83fe=['register','length','userNotification:','./userNotification.events','save','update','emit'];(function(_0x4da196,_0x357dc9){var _0x375df3=function(_0x366603){while(--_0x366603){_0x4da196['push'](_0x4da196['shift']());}};_0x375df3(++_0x357dc9);}(_0x83fe,0x106));var _0xe83f=function(_0x2f1cde,_0x2b0fb7){_0x2f1cde=_0x2f1cde-0x0;var _0x2c3f24=_0x83fe[_0x2f1cde];return _0x2c3f24;};'use strict';var UserNotificationEvents=require(_0xe83f('0x0'));var events=[_0xe83f('0x1'),'remove',_0xe83f('0x2')];function createListener(_0x324ac5,_0x438cef){return function(_0x14c30b){_0x438cef[_0xe83f('0x3')](_0x324ac5,_0x14c30b);};}function removeListener(_0x2a7e4a,_0x146837){return function(){UserNotificationEvents['removeListener'](_0x2a7e4a,_0x146837);};}exports[_0xe83f('0x4')]=function(_0x514ebf){for(var _0x4f5bab=0x0,_0x297ba6=events[_0xe83f('0x5')];_0x4f5bab<_0x297ba6;_0x4f5bab++){var _0x1b9950=events[_0x4f5bab];var _0x13c865=createListener(_0xe83f('0x6')+_0x1b9950,_0x514ebf);UserNotificationEvents['on'](_0x1b9950,_0x13c865);}}; \ No newline at end of file +var _0x7b58=['removeListener','length','userNotification:','./userNotification.events','save','remove','update','emit'];(function(_0x155cc7,_0x4b3884){var _0x545006=function(_0x21e727){while(--_0x21e727){_0x155cc7['push'](_0x155cc7['shift']());}};_0x545006(++_0x4b3884);}(_0x7b58,0x10b));var _0x87b5=function(_0x4692a1,_0x41f54f){_0x4692a1=_0x4692a1-0x0;var _0x128700=_0x7b58[_0x4692a1];return _0x128700;};'use strict';var UserNotificationEvents=require(_0x87b5('0x0'));var events=[_0x87b5('0x1'),_0x87b5('0x2'),_0x87b5('0x3')];function createListener(_0x2159b4,_0xd15b23){return function(_0x234847){_0xd15b23[_0x87b5('0x4')](_0x2159b4,_0x234847);};}function removeListener(_0xbb146,_0x298bc2){return function(){UserNotificationEvents[_0x87b5('0x5')](_0xbb146,_0x298bc2);};}exports['register']=function(_0x50487a){for(var _0x3d8033=0x0,_0x11bd61=events[_0x87b5('0x6')];_0x3d8033<_0x11bd61;_0x3d8033++){var _0xadde90=events[_0x3d8033];var _0x134a7e=createListener(_0x87b5('0x7')+_0xadde90,_0x50487a);UserNotificationEvents['on'](_0xadde90,_0x134a7e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 234707f..6292c14 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4706dd,_0x1037a7){var _0x59103b=function(_0x404795){while(--_0x404795){_0x4706dd['push'](_0x4706dd['shift']());}};_0x59103b(++_0x1037a7);}(_0xedd9,0xfc));var _0x9edd=function(_0x2b1e4f,_0x1c664f){_0x2b1e4f=_0x2b1e4f-0x0;var _0x5b6c58=_0xedd9[_0x2b1e4f];return _0x5b6c58;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1da52d,_0x223882){var _0x5b1b6d=function(_0x1d189a){while(--_0x1d189a){_0x1da52d['push'](_0x1da52d['shift']());}};_0x5b1b6d(++_0x223882);}(_0x70e0,0x17b));var _0x070e=function(_0x294b06,_0xdf0995){_0x294b06=_0x294b06-0x0;var _0x2b7daf=_0x70e0[_0x294b06];return _0x2b7daf;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 29ffb11..559605c 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9dd=['INTEGER','sequelize','exports'];(function(_0x448f82,_0x51392b){var _0x18f3d0=function(_0x1f678a){while(--_0x1f678a){_0x448f82['push'](_0x448f82['shift']());}};_0x18f3d0(++_0x51392b);}(_0xb9dd,0x1f0));var _0xdb9d=function(_0x2959f7,_0x4701e6){_0x2959f7=_0x2959f7-0x0;var _0x5ce39d=_0xb9dd[_0x2959f7];return _0x5ce39d;};'use strict';var Sequelize=require(_0xdb9d('0x0'));module[_0xdb9d('0x1')]={'penalty':{'type':Sequelize[_0xdb9d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb6a=['INTEGER','sequelize','exports'];(function(_0x12fc6d,_0x1b2dc1){var _0x2929f0=function(_0x406001){while(--_0x406001){_0x12fc6d['push'](_0x12fc6d['shift']());}};_0x2929f0(++_0x1b2dc1);}(_0xcb6a,0x1b1));var _0xacb6=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xcb6a[_0x62c958];return _0x57ec61;};'use strict';var Sequelize=require(_0xacb6('0x0'));module[_0xacb6('0x1')]={'penalty':{'type':Sequelize[_0xacb6('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 5cf326f..7a61770 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa393=['UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x4dee14,_0x3d6aba){var _0x4daacb=function(_0x194cb3){while(--_0x194cb3){_0x4dee14['push'](_0x4dee14['shift']());}};_0x4daacb(++_0x3d6aba);}(_0xa393,0x110));var _0x3a39=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xa393[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require(_0x3a39('0x0'));var logger=require(_0x3a39('0x1'))(_0x3a39('0x2'));var moment=require(_0x3a39('0x3'));var BPromise=require(_0x3a39('0x4'));var rp=require(_0x3a39('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a39('0x6'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x3a39('0x7')]=function(_0x552878,_0xb681bb){return _0x552878['define'](_0x3a39('0x8'),attributes,{'tableName':_0x3a39('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11ca=['../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','util','api','moment','bluebird','request-promise','path'];(function(_0x47b54b,_0x54ff19){var _0x150c7f=function(_0x582b9c){while(--_0x582b9c){_0x47b54b['push'](_0x47b54b['shift']());}};_0x150c7f(++_0x54ff19);}(_0x11ca,0x19c));var _0xa11c=function(_0x4f4555,_0x441fd0){_0x4f4555=_0x4f4555-0x0;var _0x595df5=_0x11ca[_0x4f4555];return _0x595df5;};'use strict';var _=require('lodash');var util=require(_0xa11c('0x0'));var logger=require('../../config/logger')(_0xa11c('0x1'));var moment=require(_0xa11c('0x2'));var BPromise=require(_0xa11c('0x3'));var rp=require(_0xa11c('0x4'));var fs=require('fs');var path=require(_0xa11c('0x5'));var rimraf=require('rimraf');var config=require(_0xa11c('0x6'));var attributes=require(_0xa11c('0x7'));module[_0xa11c('0x8')]=function(_0x380fc6,_0x553756){return _0x380fc6['define'](_0xa11c('0x9'),attributes,{'tableName':_0xa11c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index a6c2367..dd6af2e 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ee6=['code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x41376f,_0x1194ad){var _0x58aace=function(_0x76d312){while(--_0x76d312){_0x41376f['push'](_0x41376f['shift']());}};_0x58aace(++_0x1194ad);}(_0x7ee6,0x154));var _0x67ee=function(_0xca8af2,_0xab3d64){_0xca8af2=_0xca8af2-0x0;var _0x467d1a=_0x7ee6[_0xca8af2];return _0x467d1a;};'use strict';var _=require('lodash');var util=require(_0x67ee('0x0'));var moment=require(_0x67ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x67ee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67ee('0x3'))['db'];var utils=require(_0x67ee('0x4'));var logger=require('../../config/logger')(_0x67ee('0x5'));var config=require(_0x67ee('0x6'));var jayson=require(_0x67ee('0x7'));var client=jayson[_0x67ee('0x8')][_0x67ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x571f1c,_0x570d3b,_0x386d8c){return new BPromise(function(_0x3076ef,_0x4734ed){return client[_0x67ee('0xa')](_0x571f1c,_0x386d8c)[_0x67ee('0xb')](function(_0x16007c){logger[_0x67ee('0xc')](_0x67ee('0xd'),_0x570d3b,_0x67ee('0xe'));logger[_0x67ee('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x570d3b,_0x67ee('0xe'),JSON['stringify'](_0x16007c));if(_0x16007c[_0x67ee('0x10')]){if(_0x16007c[_0x67ee('0x10')][_0x67ee('0x11')]===0x1f4){logger['error'](_0x67ee('0xd'),_0x570d3b,_0x16007c['error']['message']);return _0x4734ed(_0x16007c[_0x67ee('0x10')][_0x67ee('0x12')]);}logger[_0x67ee('0x10')](_0x67ee('0xd'),_0x570d3b,_0x16007c['error'][_0x67ee('0x12')]);return _0x3076ef(_0x16007c['error'][_0x67ee('0x12')]);}else{logger[_0x67ee('0xc')](_0x67ee('0xd'),_0x570d3b,_0x67ee('0xe'));_0x3076ef(_0x16007c[_0x67ee('0x13')][_0x67ee('0x12')]);}})[_0x67ee('0x14')](function(_0xa00dcc){logger['error'](_0x67ee('0xd'),_0x570d3b,_0xa00dcc);_0x4734ed(_0xa00dcc);});});} \ No newline at end of file +var _0xece6=['../../config/logger','rpc','../../config/environment','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2daea7,_0x41e7da){var _0x1f01bd=function(_0x39417b){while(--_0x39417b){_0x2daea7['push'](_0x2daea7['shift']());}};_0x1f01bd(++_0x41e7da);}(_0xece6,0x1c8));var _0x6ece=function(_0x5a28ed,_0x2bcf10){_0x5a28ed=_0x5a28ed-0x0;var _0x4d4f6a=_0xece6[_0x5a28ed];return _0x4d4f6a;};'use strict';var _=require(_0x6ece('0x0'));var util=require(_0x6ece('0x1'));var moment=require(_0x6ece('0x2'));var BPromise=require(_0x6ece('0x3'));var rs=require(_0x6ece('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ece('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ece('0x6'))(_0x6ece('0x7'));var config=require(_0x6ece('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6ece('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e058d,_0xc45887,_0x2e8edc){return new BPromise(function(_0x3c85c3,_0x233fc5){return client[_0x6ece('0xa')](_0x4e058d,_0x2e8edc)[_0x6ece('0xb')](function(_0x19cc32){logger['info'](_0x6ece('0xc'),_0xc45887,_0x6ece('0xd'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xc45887,'request\x20sent',JSON[_0x6ece('0xe')](_0x19cc32));if(_0x19cc32['error']){if(_0x19cc32[_0x6ece('0xf')][_0x6ece('0x10')]===0x1f4){logger[_0x6ece('0xf')](_0x6ece('0xc'),_0xc45887,_0x19cc32[_0x6ece('0xf')]['message']);return _0x233fc5(_0x19cc32[_0x6ece('0xf')][_0x6ece('0x11')]);}logger[_0x6ece('0xf')](_0x6ece('0xc'),_0xc45887,_0x19cc32['error'][_0x6ece('0x11')]);return _0x3c85c3(_0x19cc32[_0x6ece('0xf')][_0x6ece('0x11')]);}else{logger[_0x6ece('0x12')](_0x6ece('0xc'),_0xc45887,_0x6ece('0xd'));_0x3c85c3(_0x19cc32[_0x6ece('0x13')][_0x6ece('0x11')]);}})[_0x6ece('0x14')](function(_0x290fec){logger[_0x6ece('0xf')](_0x6ece('0xc'),_0xc45887,_0x290fec);_0x233fc5(_0x290fec);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 4a096e8..54346e7 100644 --- a/server/api/userProfile/index.js +++ b/server/api/userProfile/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6db=['destroy','removeResources','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','describe','show','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete'];(function(_0x2edc1a,_0x51ffd7){var _0x12b423=function(_0x270228){while(--_0x270228){_0x2edc1a['push'](_0x2edc1a['shift']());}};_0x12b423(++_0x51ffd7);}(_0xb6db,0x16f));var _0xbb6d=function(_0x392d73,_0x4a724e){_0x392d73=_0x392d73-0x0;var _0x239c1f=_0xb6db[_0x392d73];return _0x239c1f;};'use strict';var multer=require('multer');var util=require(_0xbb6d('0x0'));var path=require(_0xbb6d('0x1'));var timeout=require('connect-timeout');var express=require(_0xbb6d('0x2'));var router=express[_0xbb6d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbb6d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbb6d('0x5'));var controller=require(_0xbb6d('0x6'));router[_0xbb6d('0x7')]('/',auth['isAuthenticated'](),controller[_0xbb6d('0x8')]);router[_0xbb6d('0x7')](_0xbb6d('0x9'),auth[_0xbb6d('0xa')](),controller[_0xbb6d('0xb')]);router[_0xbb6d('0x7')]('/:id',auth[_0xbb6d('0xa')](),controller[_0xbb6d('0xc')]);router['get'](_0xbb6d('0xd'),auth['isAuthenticated'](),controller[_0xbb6d('0xe')]);router[_0xbb6d('0x7')](_0xbb6d('0xf'),auth['isAuthenticated'](),controller['getResources']);router[_0xbb6d('0x10')]('/',auth['isAuthenticated'](),controller[_0xbb6d('0x11')]);router[_0xbb6d('0x10')](_0xbb6d('0x12'),auth[_0xbb6d('0xa')](),controller[_0xbb6d('0x13')]);router[_0xbb6d('0x10')](_0xbb6d('0xd'),auth[_0xbb6d('0xa')](),controller[_0xbb6d('0x14')]);router[_0xbb6d('0x10')](_0xbb6d('0xf'),auth[_0xbb6d('0xa')](),controller[_0xbb6d('0x15')]);router[_0xbb6d('0x16')]('/:id',auth[_0xbb6d('0xa')](),controller[_0xbb6d('0x17')]);router[_0xbb6d('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xbb6d('0x19')]);router['delete'](_0xbb6d('0xd'),auth[_0xbb6d('0xa')](),controller['removeSections']);router[_0xbb6d('0x18')](_0xbb6d('0xf'),auth[_0xbb6d('0xa')](),controller[_0xbb6d('0x1a')]);module[_0xbb6d('0x1b')]=router; \ No newline at end of file +var _0x2c78=['./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','util','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xe4d94d,_0xcc9b88){var _0xbd5374=function(_0x386d41){while(--_0x386d41){_0xe4d94d['push'](_0xe4d94d['shift']());}};_0xbd5374(++_0xcc9b88);}(_0x2c78,0xa4));var _0x82c7=function(_0x369a41,_0x5ed95c){_0x369a41=_0x369a41-0x0;var _0x16807d=_0x2c78[_0x369a41];return _0x16807d;};'use strict';var multer=require('multer');var util=require(_0x82c7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x82c7('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x82c7('0x2'));var interaction=require(_0x82c7('0x3'));var config=require('../../config/environment');var controller=require(_0x82c7('0x4'));router[_0x82c7('0x5')]('/',auth['isAuthenticated'](),controller[_0x82c7('0x6')]);router['get'](_0x82c7('0x7'),auth[_0x82c7('0x8')](),controller[_0x82c7('0x9')]);router[_0x82c7('0x5')](_0x82c7('0xa'),auth[_0x82c7('0x8')](),controller[_0x82c7('0xb')]);router[_0x82c7('0x5')](_0x82c7('0xc'),auth[_0x82c7('0x8')](),controller[_0x82c7('0xd')]);router[_0x82c7('0x5')](_0x82c7('0xe'),auth[_0x82c7('0x8')](),controller[_0x82c7('0xf')]);router[_0x82c7('0x10')]('/',auth['isAuthenticated'](),controller[_0x82c7('0x11')]);router[_0x82c7('0x10')](_0x82c7('0x12'),auth['isAuthenticated'](),controller[_0x82c7('0x13')]);router[_0x82c7('0x10')](_0x82c7('0xc'),auth['isAuthenticated'](),controller[_0x82c7('0x14')]);router[_0x82c7('0x10')](_0x82c7('0xe'),auth[_0x82c7('0x8')](),controller[_0x82c7('0x15')]);router[_0x82c7('0x16')](_0x82c7('0xa'),auth['isAuthenticated'](),controller[_0x82c7('0x17')]);router[_0x82c7('0x18')](_0x82c7('0xa'),auth[_0x82c7('0x8')](),controller[_0x82c7('0x19')]);router[_0x82c7('0x18')](_0x82c7('0xc'),auth[_0x82c7('0x8')](),controller[_0x82c7('0x1a')]);router[_0x82c7('0x18')](_0x82c7('0xe'),auth['isAuthenticated'](),controller[_0x82c7('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 09f4322..9dc592e 100644 --- a/server/api/userProfile/userProfile.attributes.js +++ b/server/api/userProfile/userProfile.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5524=['STRING','name','setDataValue','crudPermissions','getDataValue','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5524,0x126));var _0x4552=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5524[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x4552('0x0'));module[_0x4552('0x1')]={'name':{'type':Sequelize[_0x4552('0x2')],'allowNull':![],'unique':_0x4552('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1f44f5){this[_0x4552('0x4')](_0x4552('0x5'),_0x1f44f5?_0x1f44f5['join'](''):[]);},'get':function(){return this[_0x4552('0x6')]('crudPermissions')?this[_0x4552('0x6')](_0x4552('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x4552('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x4552('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x4552('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x4552('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x4552('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4552('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x4552('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x0ebd=['exports','name','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0ebd,0x1df));var _0xd0eb=function(_0xf670e1,_0x207ae1){_0xf670e1=_0xf670e1-0x0;var _0x59d7c9=_0x0ebd[_0xf670e1];return _0x59d7c9;};'use strict';var Sequelize=require(_0xd0eb('0x0'));module[_0xd0eb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd0eb('0x2')},'crudPermissions':{'type':Sequelize[_0xd0eb('0x3')],'set':function(_0x807e0e){this[_0xd0eb('0x4')](_0xd0eb('0x5'),_0x807e0e?_0x807e0e[_0xd0eb('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xd0eb('0x5'))?this[_0xd0eb('0x7')](_0xd0eb('0x5'))[_0xd0eb('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd0eb('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd0eb('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd0eb('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd0eb('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index e80405c..cc8a012 100644 --- a/server/api/userProfile/userProfile.controller.js +++ b/server/api/userProfile/userProfile.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce1b=['moment','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','Resources','each','push','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','userProfileId','bulkCreate','removeResources','ids','section','hasOwnProperty','eml-format','fast-json-patch','request-promise'];(function(_0x35fda9,_0x1509c6){var _0x217f1b=function(_0x425dae){while(--_0x425dae){_0x35fda9['push'](_0x35fda9['shift']());}};_0x217f1b(++_0x1509c6);}(_0xce1b,0x73));var _0xbce1=function(_0x4c6dc8,_0x13764b){_0x4c6dc8=_0x4c6dc8-0x0;var _0x15b8c4=_0xce1b[_0x4c6dc8];return _0x15b8c4;};'use strict';var emlformat=require(_0xbce1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbce1('0x1'));var rp=require(_0xbce1('0x2'));var moment=require(_0xbce1('0x3'));var BPromise=require(_0xbce1('0x4'));var Mustache=require(_0xbce1('0x5'));var util=require(_0xbce1('0x6'));var path=require(_0xbce1('0x7'));var sox=require(_0xbce1('0x8'));var csv=require(_0xbce1('0x9'));var ejs=require(_0xbce1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbce1('0xb'));var squel=require(_0xbce1('0xc'));var crypto=require(_0xbce1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbce1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbce1('0xf'));var Papa=require(_0xbce1('0x10'));var Redis=require(_0xbce1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbce1('0x12'));var as=require(_0xbce1('0x13'));var hardwareService=require(_0xbce1('0x14'));var logger=require(_0xbce1('0x15'))(_0xbce1('0x16'));var utils=require(_0xbce1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbce1('0x18'));var db=require(_0xbce1('0x19'))['db'];config[_0xbce1('0x1a')]=_[_0xbce1('0x1b')](config[_0xbce1('0x1a')],{'host':_0xbce1('0x1c'),'port':0x18eb});var socket=require(_0xbce1('0x1d'))(new Redis(config[_0xbce1('0x1a')]));require(_0xbce1('0x1e'))[_0xbce1('0x1f')](socket);function respondWithStatusCode(_0x487df0,_0x5b6c88){_0x5b6c88=_0x5b6c88||0xcc;return function(_0x29c614){if(_0x29c614){return _0x487df0[_0xbce1('0x20')](_0x5b6c88);}return _0x487df0['status'](_0x5b6c88)[_0xbce1('0x21')]();};}function respondWithResult(_0x4c9d8d,_0x541d03){_0x541d03=_0x541d03||0xc8;return function(_0x10746f){if(_0x10746f){return _0x4c9d8d['status'](_0x541d03)[_0xbce1('0x22')](_0x10746f);}};}function respondWithFilteredResult(_0x3e2c9c,_0x27927a){return function(_0x534f67){if(_0x534f67){var _0x469a5d=typeof _0x27927a[_0xbce1('0x23')]===_0xbce1('0x24')&&typeof _0x27927a[_0xbce1('0x25')]===_0xbce1('0x24');var _0x5b1684=_0x534f67[_0xbce1('0x26')];var _0x2a027c=_0x469a5d?0x0:_0x27927a[_0xbce1('0x23')];var _0xd96991=_0x469a5d?_0x534f67[_0xbce1('0x26')]:_0x27927a[_0xbce1('0x23')]+_0x27927a['limit'];var _0x3f9a01;if(_0xd96991>=_0x5b1684){_0xd96991=_0x5b1684;_0x3f9a01=0xc8;}else{_0x3f9a01=0xce;}_0x3e2c9c[_0xbce1('0x27')](_0x3f9a01);return _0x3e2c9c[_0xbce1('0x28')](_0xbce1('0x29'),_0x2a027c+'-'+_0xd96991+'/'+_0x5b1684)['json'](_0x534f67);}return null;};}function patchUpdates(_0x5ac500){return function(_0x3807a5){try{jsonpatch[_0xbce1('0x2a')](_0x3807a5,_0x5ac500,!![]);}catch(_0x4cba86){return BPromise[_0xbce1('0x2b')](_0x4cba86);}return _0x3807a5[_0xbce1('0x2c')]();};}function saveUpdates(_0x2e889e,_0xd23014){return function(_0x48f679){if(_0x48f679){return _0x48f679[_0xbce1('0x2d')](_0x2e889e)['then'](function(_0x2b1ea7){return _0x2b1ea7;});}return null;};}function removeEntity(_0x16a2df,_0x594223){return function(_0x1f2d5a){if(_0x1f2d5a){return _0x1f2d5a[_0xbce1('0x2e')]()[_0xbce1('0x2f')](function(){_0x16a2df[_0xbce1('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f83df,_0x11cc52){return function(_0x10808b){if(!_0x10808b){_0x3f83df[_0xbce1('0x20')](0x194);}return _0x10808b;};}function handleError(_0x1f4cee,_0x5e0e5a){_0x5e0e5a=_0x5e0e5a||0x1f4;return function(_0x284e12){logger[_0xbce1('0x30')](_0x284e12[_0xbce1('0x31')]);if(_0x284e12[_0xbce1('0x32')]){delete _0x284e12[_0xbce1('0x32')];}_0x1f4cee[_0xbce1('0x27')](_0x5e0e5a)[_0xbce1('0x33')](_0x284e12);};}exports[_0xbce1('0x34')]=function(_0x4b2d3c,_0x36b186){var _0x302735={},_0x449f5f={},_0x5e6732={'count':0x0,'rows':[]};var _0x36594b=_[_0xbce1('0x35')](db[_0xbce1('0x36')][_0xbce1('0x37')],function(_0xc5125f){return{'name':_0xc5125f[_0xbce1('0x38')],'type':_0xc5125f[_0xbce1('0x39')][_0xbce1('0x3a')]};});_0x449f5f['model']=_[_0xbce1('0x35')](_0x36594b,'name');_0x449f5f[_0xbce1('0x3b')]=_[_0xbce1('0x3c')](_0x4b2d3c[_0xbce1('0x3b')]);_0x449f5f['filters']=_[_0xbce1('0x3d')](_0x449f5f['model'],_0x449f5f[_0xbce1('0x3b')]);_0x302735[_0xbce1('0x3e')]=_[_0xbce1('0x3d')](_0x449f5f[_0xbce1('0x3f')],qs[_0xbce1('0x40')](_0x4b2d3c[_0xbce1('0x3b')][_0xbce1('0x40')]));_0x302735[_0xbce1('0x3e')]=_0x302735['attributes']['length']?_0x302735[_0xbce1('0x3e')]:_0x449f5f[_0xbce1('0x3f')];if(!_0x4b2d3c[_0xbce1('0x3b')]['hasOwnProperty'](_0xbce1('0x41'))){_0x302735[_0xbce1('0x25')]=qs[_0xbce1('0x25')](_0x4b2d3c[_0xbce1('0x3b')][_0xbce1('0x25')]);_0x302735[_0xbce1('0x23')]=qs[_0xbce1('0x23')](_0x4b2d3c['query'][_0xbce1('0x23')]);}_0x302735[_0xbce1('0x42')]=qs[_0xbce1('0x43')](_0x4b2d3c[_0xbce1('0x3b')]['sort']);_0x302735['where']=qs[_0xbce1('0x44')](_[_0xbce1('0x45')](_0x4b2d3c[_0xbce1('0x3b')],_0x449f5f[_0xbce1('0x44')]),_0x36594b);if(_0x4b2d3c[_0xbce1('0x3b')]['filter']){_0x302735[_0xbce1('0x46')]=_['merge'](_0x302735[_0xbce1('0x46')],{'$or':_[_0xbce1('0x35')](_0x36594b,function(_0x22ea35){if(_0x22ea35['type']!==_0xbce1('0x47')){var _0x10a686={};_0x10a686[_0x22ea35[_0xbce1('0x32')]]={'$like':'%'+_0x4b2d3c[_0xbce1('0x3b')][_0xbce1('0x48')]+'%'};return _0x10a686;}})});}_0x302735=_[_0xbce1('0x49')]({},_0x302735,_0x4b2d3c[_0xbce1('0x4a')]);var _0x215954={'where':_0x302735[_0xbce1('0x46')]};return db[_0xbce1('0x36')][_0xbce1('0x26')](_0x215954)[_0xbce1('0x2f')](function(_0x5d19c4){_0x5e6732[_0xbce1('0x26')]=_0x5d19c4;if(_0x4b2d3c[_0xbce1('0x3b')]['includeAll']){_0x302735[_0xbce1('0x4b')]=[{'all':!![]}];}return db['UserProfile'][_0xbce1('0x4c')](_0x302735);})['then'](function(_0x370776){_0x5e6732[_0xbce1('0x4d')]=_0x370776;return _0x5e6732;})[_0xbce1('0x2f')](respondWithFilteredResult(_0x36b186,_0x302735))[_0xbce1('0x4e')](handleError(_0x36b186,null));};exports[_0xbce1('0x4f')]=function(_0x37e062,_0x1f08ee){var _0x7c237={'raw':![],'where':{'id':_0x37e062[_0xbce1('0x50')]['id']}},_0x4ca5d3={};_0x4ca5d3['model']=_[_0xbce1('0x3c')](db[_0xbce1('0x36')]['rawAttributes']);_0x4ca5d3[_0xbce1('0x3b')]=_['keys'](_0x37e062[_0xbce1('0x3b')]);_0x4ca5d3[_0xbce1('0x44')]=_[_0xbce1('0x3d')](_0x4ca5d3['model'],_0x4ca5d3['query']);_0x7c237['attributes']=_[_0xbce1('0x3d')](_0x4ca5d3[_0xbce1('0x3f')],qs[_0xbce1('0x40')](_0x37e062[_0xbce1('0x3b')][_0xbce1('0x40')]));_0x7c237[_0xbce1('0x3e')]=_0x7c237[_0xbce1('0x3e')]['length']?_0x7c237['attributes']:_0x4ca5d3[_0xbce1('0x3f')];if(_0x37e062[_0xbce1('0x3b')][_0xbce1('0x51')]){_0x7c237['include']=[{'all':!![]}];}_0x7c237=_['merge']({},_0x7c237,_0x37e062['options']);return db['UserProfile'][_0xbce1('0x52')](_0x7c237)[_0xbce1('0x2f')](handleEntityNotFound(_0x1f08ee,null))[_0xbce1('0x2f')](respondWithResult(_0x1f08ee,null))[_0xbce1('0x4e')](handleError(_0x1f08ee,null));};exports[_0xbce1('0x53')]=function(_0x9077f0,_0x42bcdd){return db[_0xbce1('0x36')][_0xbce1('0x53')](_0x9077f0[_0xbce1('0x54')],{})[_0xbce1('0x2f')](respondWithResult(_0x42bcdd,0xc9))[_0xbce1('0x4e')](handleError(_0x42bcdd,null));};exports[_0xbce1('0x55')]=function(_0x2987c2,_0x3f9989){var _0x3f376a={'where':{'id':_0x2987c2[_0xbce1('0x50')]['id']}},_0x24584c={};_0x24584c[_0xbce1('0x3f')]=_[_0xbce1('0x3c')](db[_0xbce1('0x36')][_0xbce1('0x37')]);_0x3f376a[_0xbce1('0x3e')]=_['intersection'](_0x24584c[_0xbce1('0x3f')],qs[_0xbce1('0x40')](_0x2987c2['query'][_0xbce1('0x40')]));_0x3f376a[_0xbce1('0x3e')]=_0x3f376a[_0xbce1('0x3e')]['length']?_0x3f376a[_0xbce1('0x3e')]:_0x24584c[_0xbce1('0x3f')];if(_0x2987c2[_0xbce1('0x3b')][_0xbce1('0x51')]){_0x3f376a[_0xbce1('0x4b')]=[{'all':!![]}];}_0x3f376a=_[_0xbce1('0x49')]({},_0x3f376a,_0x2987c2[_0xbce1('0x4a')]);return db[_0xbce1('0x36')]['find'](_0x3f376a)[_0xbce1('0x2f')](handleEntityNotFound(_0x3f9989,null))[_0xbce1('0x2f')](function(_0x437de9){if(_0x437de9){var _0x587572=_0x437de9[_0xbce1('0x56')]({'plain':!![]});_0x587572=qs[_0xbce1('0x57')](_0x587572,['id',_0xbce1('0x58'),_0xbce1('0x59'),_0xbce1('0x5a')]);_0x2987c2[_0xbce1('0x54')]=_[_0xbce1('0x57')](_0x2987c2[_0xbce1('0x54')],['id','createdAt',_0xbce1('0x59')]);return db[_0xbce1('0x5b')][_0xbce1('0x5c')](function(_0x514790){return db['UserProfile']['create'](_['merge'](_0x587572,_0x2987c2[_0xbce1('0x54')]),{'include':_0x2987c2[_0xbce1('0x3b')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x514790})[_0xbce1('0x2f')](function(_0xae8377){var _0x4b17f7=_0xae8377[_0xbce1('0x56')]({'plain':!![]});return db[_0xbce1('0x5d')][_0xbce1('0x4c')]({'where':{'userProfileId':_0x2987c2[_0xbce1('0x50')]['id']},'raw':!![]})[_0xbce1('0x2f')](function(_0x1df75a){if(_0x1df75a){return BPromise['each'](_0x1df75a,function(_0x5c72c0){return new BPromise(function(_0x158e5a,_0x863804){if(_0x5c72c0[_0xbce1('0x5e')]===null||_0x5c72c0[_0xbce1('0x5e')]===0x1)_0x158e5a(null);return db[_0xbce1('0x5f')][_0xbce1('0x4c')]({'where':{'sectionId':_0x5c72c0['id']},'raw':!![]})[_0xbce1('0x2f')](function(_0x6cee1){var _0xd79a9d=_[_0xbce1('0x35')](_0x6cee1,function(_0x290c57){return qs['omit'](_0x290c57,['id',_0xbce1('0x58'),_0xbce1('0x59'),_0xbce1('0x60')]);});_0x158e5a(_0xd79a9d);})[_0xbce1('0x4e')](function(_0x517109){_0x863804(_0x517109);});})[_0xbce1('0x2f')](function(_0x3821f7){var _0x21fdc6=qs[_0xbce1('0x57')](_0x5c72c0,['id','createdAt',_0xbce1('0x59')]);_0x21fdc6['userProfileId']=_0x4b17f7['id'];if(_0x3821f7)_0x21fdc6[_0xbce1('0x61')]=_0x3821f7;return _0x21fdc6;})['then'](function(_0x41b9ee){return db[_0xbce1('0x5d')][_0xbce1('0x53')](_0x41b9ee,{'include':[{'model':db[_0xbce1('0x5f')],'as':_0xbce1('0x61')}],'raw':!![],'transaction':_0x514790});});})[_0xbce1('0x2f')](function(){return _0x4b17f7;});}});});});}})[_0xbce1('0x2f')](respondWithResult(_0x3f9989,0xc9))['catch'](handleError(_0x3f9989,null));};exports[_0xbce1('0x2d')]=function(_0x110ee3,_0x31cb07){if(_0x110ee3[_0xbce1('0x54')]['id']){delete _0x110ee3[_0xbce1('0x54')]['id'];}return db[_0xbce1('0x36')][_0xbce1('0x52')]({'where':{'id':_0x110ee3[_0xbce1('0x50')]['id']}})['then'](handleEntityNotFound(_0x31cb07,null))['then'](saveUpdates(_0x110ee3[_0xbce1('0x54')],null))[_0xbce1('0x2f')](respondWithResult(_0x31cb07,null))[_0xbce1('0x4e')](handleError(_0x31cb07,null));};exports[_0xbce1('0x2e')]=function(_0x5e5f33,_0x19e026){return db[_0xbce1('0x36')][_0xbce1('0x52')]({'where':{'id':_0x5e5f33[_0xbce1('0x50')]['id']}})[_0xbce1('0x2f')](handleEntityNotFound(_0x19e026,null))[_0xbce1('0x2f')](removeEntity(_0x19e026,null))['catch'](handleError(_0x19e026,null));};exports['describe']=function(_0x5caae8,_0x12e549){return db['UserProfile']['describe']()[_0xbce1('0x2f')](respondWithResult(_0x12e549,null))[_0xbce1('0x4e')](handleError(_0x12e549,null));};exports['addSections']=function(_0x22de98,_0x310278){var _0x5d677f=_0x22de98['body'];return db[_0xbce1('0x36')]['find']({'where':{'id':_0x22de98['params']['id']}})[_0xbce1('0x2f')](handleEntityNotFound(_0x310278,null))['then'](function(_0x411c43){if(_0x411c43){return db[_0xbce1('0x5b')][_0xbce1('0x5c')](function(_0x33cc65){return db['UserProfileSection'][_0xbce1('0x2e')]({'where':{'userProfileId':_0x22de98['params']['id'],'sectionId':_[_0xbce1('0x35')](_0x5d677f,function(_0x181ec2){return _0x181ec2['sectionId'];})},'transaction':_0x33cc65})['then'](function(){var _0x13f2d8=_[_0xbce1('0x35')](_0x5d677f,function(_0x33bbb8){_0x33bbb8['userProfileId']=_0x22de98[_0xbce1('0x50')]['id'];return _0x33bbb8;});var _0x1b31ac=[];return BPromise[_0xbce1('0x62')](_0x13f2d8,function(_0x14df45){return db[_0xbce1('0x5d')][_0xbce1('0x53')](_0x14df45,{'include':[{'model':db[_0xbce1('0x5f')],'as':_0xbce1('0x61')}],'raw':!![],'transaction':_0x33cc65})['then'](function(_0x53f30d){_0x1b31ac[_0xbce1('0x63')](_0x53f30d[_0xbce1('0x56')]({'plain':!![]}));});})[_0xbce1('0x2f')](function(){return _0x1b31ac;});});});}})[_0xbce1('0x2f')](function(_0x3c1dac){return _0x3c1dac;})[_0xbce1('0x2f')](respondWithResult(_0x310278,null))[_0xbce1('0x4e')](handleError(_0x310278,null));};exports['removeSections']=function(_0x21272e,_0x52b43a){var _0x4b07ce;return db['UserProfile']['find']({'where':{'id':_0x21272e[_0xbce1('0x50')]['id']},'attributes':['id',_0xbce1('0x32')]})[_0xbce1('0x2f')](handleEntityNotFound(_0x52b43a,null))[_0xbce1('0x2f')](function(_0x5c688c){if(_0x5c688c){_0x4b07ce=_0x5c688c;return db[_0xbce1('0x5d')][_0xbce1('0x2e')]({'where':{'userProfileId':_0x21272e[_0xbce1('0x50')]['id'],'sectionId':_0x21272e['query']['ids']}});}})[_0xbce1('0x2f')](function(){return _0x4b07ce;})['then'](respondWithStatusCode(_0x52b43a,null))[_0xbce1('0x4e')](handleError(_0x52b43a,null));};exports[_0xbce1('0x64')]=function(_0x2d2f85,_0x14ca5c){var _0x404cf0=[];var _0x572f3d=[];return db[_0xbce1('0x5d')]['findAll']({'where':{'userProfileId':_0x2d2f85['params']['id']},'raw':!![]})[_0xbce1('0x2f')](function(_0xd492ca){_0x404cf0=_[_0xbce1('0x48')](_0xd492ca,function(_0x5abfb0){return _0x5abfb0[_0xbce1('0x65')]===0x1||_[_0xbce1('0x66')]([0x3eb,0x709],_0x5abfb0['sectionId']);});if(!_[_0xbce1('0x67')](_0x404cf0)){return _[_0xbce1('0x35')](_0x404cf0,function(_0x41a842){return _0x41a842[_0xbce1('0x60')];});}else{return;}})['then'](function(_0x1a7784){if(_0x1a7784)_0x572f3d=_0x1a7784;if(_[_0xbce1('0x66')](_0x572f3d,0x64)){var _0x4a2cbb=_['find'](_0x404cf0,{'sectionId':0x64});return hasDefaultDashboard(_0x4a2cbb)['then'](function(_0x20e0ae){return _[_0xbce1('0x35')](_0x404cf0,function(_0x880456){if(_0x880456[_0xbce1('0x60')]===0x64){_0x880456[_0xbce1('0x68')]=_0x20e0ae;}return _0x880456;});});}else{return;}})[_0xbce1('0x2f')](function(_0x59527a){if(_0x59527a)_0x404cf0=_0x59527a;if(_[_0xbce1('0x66')](_0x572f3d,0x3eb)){var _0x2f5518=_[_0xbce1('0x52')](_0x404cf0,{'sectionId':0x3eb});return getCustomDashboards(_0x2f5518)[_0xbce1('0x2f')](function(_0x43fe76){return _['map'](_0x404cf0,function(_0x395c00){if(_0x2f5518[_0xbce1('0x65')]){if(_0x395c00[_0xbce1('0x60')]===0x3eb){_0x395c00[_0xbce1('0x68')]=_0x43fe76;}}else{if(_0x395c00[_0xbce1('0x60')]===0x64){if(!_0x395c00['subsections']){_0x395c00[_0xbce1('0x68')]=[];}_0x395c00[_0xbce1('0x68')]=_0x395c00['subsections'][_0xbce1('0x69')](_0x43fe76);}}return _0x395c00;});});}else{return;}})[_0xbce1('0x2f')](function(_0x24d1ba){if(_0x24d1ba)_0x404cf0=_0x24d1ba;if(_[_0xbce1('0x66')](_0x572f3d,0x709)){var _0xe74f51=_[_0xbce1('0x52')](_0x404cf0,{'sectionId':0x709});return getPlugins(_0xe74f51)[_0xbce1('0x2f')](function(_0x7d02d7){if(_0xe74f51[_0xbce1('0x65')]){return _[_0xbce1('0x35')](_0x404cf0,function(_0x161d81){if(_0x161d81[_0xbce1('0x60')]===0x709){_0x161d81['subsections']=_0x7d02d7;}return _0x161d81;});}else{var _0x276357={'sectionId':0x76c,'enabled':0x1,'subsections':_0x7d02d7};var _0x3ed438=_['map'](_0x404cf0);_0x3ed438['push'](_0x276357);return _0x3ed438;}});}else{return;}})[_0xbce1('0x2f')](function(_0x5aabe7){if(_0x5aabe7)_0x404cf0=_0x5aabe7;return _[_0xbce1('0x48')](_0x404cf0,[_0xbce1('0x65'),0x1]);})['then'](respondWithResult(_0x14ca5c,null))[_0xbce1('0x4e')](handleError(_0x14ca5c,null));};function hasDefaultDashboard(_0x9464c8){var _0x9da343=[0x65];return new BPromise(function(_0x1077ab,_0x1e4ac6){try{if(_0x9464c8['autoAssociation']){_0x1077ab(_0x9da343);}else{return db[_0xbce1('0x5f')][_0xbce1('0x6a')]({'where':{'sectionId':_0x9464c8['id']},'raw':!![]})['then'](function(_0x60f06e){_0x60f06e?_0x1077ab(_0x9da343):_0x1077ab();});}}catch(_0xc28ffe){_0x1e4ac6(_0xc28ffe);}});}function getCustomDashboards(_0x3b3630){var _0x22221c=[];return new BPromise(function(_0x49f3f1,_0x54422a){try{if(_0x3b3630[_0xbce1('0x5e')]){return db[_0xbce1('0x6b')]['findAll']({'raw':!![]})[_0xbce1('0x2f')](function(_0x90d05e){_0x90d05e[_0xbce1('0x6c')](function(_0xe8a2f8){_0x22221c['push'](_0xe8a2f8['id']+0x1869f);});_0x49f3f1(_0x22221c);});}else{return db[_0xbce1('0x5f')]['findAll']({'where':{'sectionId':_0x3b3630['id']},'raw':!![]})[_0xbce1('0x2f')](function(_0x5554e7){_0x5554e7[_0xbce1('0x6c')](function(_0x41faaa){_0x22221c[_0xbce1('0x63')](_0x41faaa[_0xbce1('0x6d')]+0x1869f);});_0x49f3f1(_0x22221c);});}}catch(_0x3321e2){_0x54422a(_0x3321e2);}});}function getPlugins(_0x13f60a){var _0x20b545=[];return new BPromise(function(_0x1c390d,_0x13df0f){try{if(_0x13f60a[_0xbce1('0x5e')]){return db[_0xbce1('0x6e')][_0xbce1('0x4c')]({'raw':!![]})[_0xbce1('0x2f')](function(_0x4f0616){_0x4f0616[_0xbce1('0x6c')](function(_0x300c72){_0x20b545[_0xbce1('0x63')](_0x300c72['id']+0x15b38);});_0x1c390d(_0x20b545);});}else{return db[_0xbce1('0x5f')][_0xbce1('0x4c')]({'where':{'sectionId':_0x13f60a['id']},'raw':!![]})[_0xbce1('0x2f')](function(_0xa0e6ff){_0xa0e6ff['forEach'](function(_0x3dc61b){_0x20b545['push'](_0x3dc61b[_0xbce1('0x6d')]+0x15b38);});_0x1c390d(_0x20b545);});}}catch(_0x5201fe){_0x13df0f(_0x5201fe);}});}exports[_0xbce1('0x6f')]=function(_0x2c6065,_0x3dfc42){return db[_0xbce1('0x36')][_0xbce1('0x52')]({'where':{'id':_0x2c6065[_0xbce1('0x50')]['id']}})['then'](handleEntityNotFound(_0x3dfc42,null))[_0xbce1('0x2f')](function(_0x4e8b12){if(_0x4e8b12){return db[_0xbce1('0x5b')][_0xbce1('0x5c')](function(_0x4a9036){return db[_0xbce1('0x5d')][_0xbce1('0x4c')]({'where':{'userProfileId':_0x2c6065[_0xbce1('0x50')]['id']},'attributes':['id'],'raw':!![]})[_0xbce1('0x2f')](function(_0x31ae9c){if(_0x31ae9c){return db[_0xbce1('0x5d')][_0xbce1('0x2e')]({'where':{'userProfileId':_0x2c6065[_0xbce1('0x50')]['id'],'id':_[_0xbce1('0x35')](_0x31ae9c,function(_0x30af1b){return _0x30af1b['id'];})},'transaction':_0x4a9036});}})[_0xbce1('0x2f')](function(_0x1f557f){var _0x41a270=_[_0xbce1('0x35')](_0x2c6065[_0xbce1('0x54')],function(_0x219523){_0x219523[_0xbce1('0x70')]=_0x2c6065[_0xbce1('0x50')]['id'];return _0x219523;});return db[_0xbce1('0x5d')][_0xbce1('0x71')](_0x41a270,{'raw':!![],'transaction':_0x4a9036});})[_0xbce1('0x2f')](function(_0x54bcf0){var _0x1050f5=_[_0xbce1('0x48')](_['map'](_0x54bcf0,function(_0x2d3598){return _0x2d3598[_0xbce1('0x56')]({'plain':!![]});}),{'includeAll':![]});if(_0x1050f5){return db[_0xbce1('0x5d')]['findAll']({'where':{'userProfileId':_0x2c6065[_0xbce1('0x50')]['id'],'sectionId':_[_0xbce1('0x35')](_0x1050f5,function(_0x27dd7e){return _0x27dd7e[_0xbce1('0x60')];})},'attributes':['id',_0xbce1('0x60')],'raw':!![]})[_0xbce1('0x2f')](function(_0x288f70){var _0x2ade4d=_[_0xbce1('0x35')](_0x2c6065['body'],function(_0x9e95ad){_0x9e95ad[_0xbce1('0x70')]=_0x2c6065[_0xbce1('0x50')]['id'];return _0x9e95ad;});return db['UserProfileResource'][_0xbce1('0x71')](_0x2ade4d,{'raw':!![],'transaction':_0x4a9036});});}})[_0xbce1('0x4e')](handleError(_0x3dfc42,null));});}})[_0xbce1('0x2f')](function(_0x41c3c6){var _0x457b79=_[_0xbce1('0x35')](_0x41c3c6,function(_0x39c890){return _0x39c890[_0xbce1('0x56')]({'plain':!![]});});})[_0xbce1('0x2f')](respondWithResult(_0x3dfc42,null))['catch'](handleError(_0x3dfc42,null));};exports[_0xbce1('0x72')]=function(_0x4f9856,_0x28be89,_0x332e81){return db['UserProfile'][_0xbce1('0x52')]({'where':{'id':_0x4f9856[_0xbce1('0x50')]['id']}})[_0xbce1('0x2f')](handleEntityNotFound(_0x28be89,null))[_0xbce1('0x2f')](function(_0x18b15b){if(_0x18b15b){return _0x18b15b['removeResources'](_0x4f9856[_0xbce1('0x3b')][_0xbce1('0x73')]);}})['then'](respondWithStatusCode(_0x28be89,null))['catch'](handleError(_0x28be89,null));};exports['getResources']=function(_0x13093e,_0x3969ad){var _0x3c34cf={};if(!_0x13093e[_0xbce1('0x3b')][_0xbce1('0x74')])throw new Error('Missing\x20section\x20parameter');if(!_0x13093e[_0xbce1('0x3b')][_0xbce1('0x75')](_0xbce1('0x41'))){_0x3c34cf[_0xbce1('0x25')]=qs['limit'](_0x13093e[_0xbce1('0x3b')][_0xbce1('0x25')]);_0x3c34cf[_0xbce1('0x23')]=qs['offset'](_0x13093e['query'][_0xbce1('0x23')]);}return db[_0xbce1('0x36')][_0xbce1('0x52')]({'where':{'id':_0x13093e[_0xbce1('0x50')]['id']}})['then'](function(_0x297b74){if(!_0x297b74)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x13093e[_0xbce1('0x50')]['id']);return db[_0xbce1('0x36')]['getResources'](_0x13093e);})[_0xbce1('0x2f')](respondWithFilteredResult(_0x3969ad,_0x3c34cf))[_0xbce1('0x4e')](handleError(_0x3969ad,null));}; \ No newline at end of file +var _0x7f2f=['order','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','clone','get','createdAt','updatedAt','crudPermissions','omit','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','sequelize','push','removeSections','ids','enabled','includes','isEmpty','subsections','concat','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0xcec785,_0x126335){var _0x557953=function(_0x5e250e){while(--_0x5e250e){_0xcec785['push'](_0xcec785['shift']());}};_0x557953(++_0x126335);}(_0x7f2f,0x198));var _0xf7f2=function(_0x26a515,_0x286339){_0x26a515=_0x26a515-0x0;var _0x314682=_0x7f2f[_0x26a515];return _0x314682;};'use strict';var emlformat=require(_0xf7f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7f2('0x1'));var jsonpatch=require(_0xf7f2('0x2'));var rp=require(_0xf7f2('0x3'));var moment=require(_0xf7f2('0x4'));var BPromise=require(_0xf7f2('0x5'));var Mustache=require('mustache');var util=require(_0xf7f2('0x6'));var path=require('path');var sox=require(_0xf7f2('0x7'));var csv=require(_0xf7f2('0x8'));var ejs=require(_0xf7f2('0x9'));var fs=require('fs');var fs_extra=require(_0xf7f2('0xa'));var _=require(_0xf7f2('0xb'));var squel=require(_0xf7f2('0xc'));var crypto=require(_0xf7f2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf7f2('0xe'));var toCsv=require(_0xf7f2('0x8'));var querystring=require('querystring');var Papa=require(_0xf7f2('0xf'));var Redis=require(_0xf7f2('0x10'));var authService=require(_0xf7f2('0x11'));var qs=require(_0xf7f2('0x12'));var as=require(_0xf7f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7f2('0x14'))(_0xf7f2('0x15'));var utils=require(_0xf7f2('0x16'));var config=require(_0xf7f2('0x17'));var licenseUtil=require(_0xf7f2('0x18'));var db=require(_0xf7f2('0x19'))['db'];config[_0xf7f2('0x1a')]=_['defaults'](config['redis'],{'host':_0xf7f2('0x1b'),'port':0x18eb});var socket=require(_0xf7f2('0x1c'))(new Redis(config['redis']));require(_0xf7f2('0x1d'))[_0xf7f2('0x1e')](socket);function respondWithStatusCode(_0x316c18,_0x28190b){_0x28190b=_0x28190b||0xcc;return function(_0x49212c){if(_0x49212c){return _0x316c18[_0xf7f2('0x1f')](_0x28190b);}return _0x316c18[_0xf7f2('0x20')](_0x28190b)[_0xf7f2('0x21')]();};}function respondWithResult(_0x48ac89,_0x10921d){_0x10921d=_0x10921d||0xc8;return function(_0x219b10){if(_0x219b10){return _0x48ac89[_0xf7f2('0x20')](_0x10921d)['json'](_0x219b10);}};}function respondWithFilteredResult(_0x3609e5,_0x2343f8){return function(_0x3c08e1){if(_0x3c08e1){var _0x3806ca=typeof _0x2343f8['offset']===_0xf7f2('0x22')&&typeof _0x2343f8['limit']===_0xf7f2('0x22');var _0x4f637b=_0x3c08e1[_0xf7f2('0x23')];var _0x474328=_0x3806ca?0x0:_0x2343f8[_0xf7f2('0x24')];var _0x397bd2=_0x3806ca?_0x3c08e1[_0xf7f2('0x23')]:_0x2343f8[_0xf7f2('0x24')]+_0x2343f8[_0xf7f2('0x25')];var _0x2351cc;if(_0x397bd2>=_0x4f637b){_0x397bd2=_0x4f637b;_0x2351cc=0xc8;}else{_0x2351cc=0xce;}_0x3609e5['status'](_0x2351cc);return _0x3609e5[_0xf7f2('0x26')](_0xf7f2('0x27'),_0x474328+'-'+_0x397bd2+'/'+_0x4f637b)['json'](_0x3c08e1);}return null;};}function patchUpdates(_0x563c39){return function(_0x3f2aa4){try{jsonpatch[_0xf7f2('0x28')](_0x3f2aa4,_0x563c39,!![]);}catch(_0x43b942){return BPromise[_0xf7f2('0x29')](_0x43b942);}return _0x3f2aa4['save']();};}function saveUpdates(_0x50bba5,_0x4583b6){return function(_0x41ec91){if(_0x41ec91){return _0x41ec91[_0xf7f2('0x2a')](_0x50bba5)[_0xf7f2('0x2b')](function(_0x306acc){return _0x306acc;});}return null;};}function removeEntity(_0x59839b,_0x33f1b5){return function(_0x4a76aa){if(_0x4a76aa){return _0x4a76aa[_0xf7f2('0x2c')]()[_0xf7f2('0x2b')](function(){_0x59839b[_0xf7f2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb2d94,_0x33542a){return function(_0x518274){if(!_0x518274){_0xb2d94[_0xf7f2('0x1f')](0x194);}return _0x518274;};}function handleError(_0x17f913,_0x1f5a33){_0x1f5a33=_0x1f5a33||0x1f4;return function(_0x172487){logger[_0xf7f2('0x2d')](_0x172487[_0xf7f2('0x2e')]);if(_0x172487[_0xf7f2('0x2f')]){delete _0x172487[_0xf7f2('0x2f')];}_0x17f913[_0xf7f2('0x20')](_0x1f5a33)[_0xf7f2('0x30')](_0x172487);};}exports[_0xf7f2('0x31')]=function(_0x11e4f9,_0x5d3ea2){var _0x436bf7={},_0x28e113={},_0x475db6={'count':0x0,'rows':[]};var _0x249114=_[_0xf7f2('0x32')](db[_0xf7f2('0x33')][_0xf7f2('0x34')],function(_0x58f044){return{'name':_0x58f044[_0xf7f2('0x35')],'type':_0x58f044[_0xf7f2('0x36')][_0xf7f2('0x37')]};});_0x28e113[_0xf7f2('0x38')]=_[_0xf7f2('0x32')](_0x249114,'name');_0x28e113[_0xf7f2('0x39')]=_[_0xf7f2('0x3a')](_0x11e4f9[_0xf7f2('0x39')]);_0x28e113[_0xf7f2('0x3b')]=_[_0xf7f2('0x3c')](_0x28e113[_0xf7f2('0x38')],_0x28e113[_0xf7f2('0x39')]);_0x436bf7[_0xf7f2('0x3d')]=_[_0xf7f2('0x3c')](_0x28e113[_0xf7f2('0x38')],qs[_0xf7f2('0x3e')](_0x11e4f9[_0xf7f2('0x39')][_0xf7f2('0x3e')]));_0x436bf7['attributes']=_0x436bf7[_0xf7f2('0x3d')][_0xf7f2('0x3f')]?_0x436bf7['attributes']:_0x28e113['model'];if(!_0x11e4f9[_0xf7f2('0x39')]['hasOwnProperty']('nolimit')){_0x436bf7[_0xf7f2('0x25')]=qs['limit'](_0x11e4f9[_0xf7f2('0x39')][_0xf7f2('0x25')]);_0x436bf7[_0xf7f2('0x24')]=qs['offset'](_0x11e4f9['query'][_0xf7f2('0x24')]);}_0x436bf7[_0xf7f2('0x40')]=qs['sort'](_0x11e4f9['query']['sort']);_0x436bf7['where']=qs[_0xf7f2('0x3b')](_[_0xf7f2('0x41')](_0x11e4f9[_0xf7f2('0x39')],_0x28e113[_0xf7f2('0x3b')]),_0x249114);if(_0x11e4f9['query'][_0xf7f2('0x42')]){_0x436bf7['where']=_[_0xf7f2('0x43')](_0x436bf7[_0xf7f2('0x44')],{'$or':_[_0xf7f2('0x32')](_0x249114,function(_0x5acfc2){if(_0x5acfc2['type']!==_0xf7f2('0x45')){var _0x5084f9={};_0x5084f9[_0x5acfc2[_0xf7f2('0x2f')]]={'$like':'%'+_0x11e4f9[_0xf7f2('0x39')][_0xf7f2('0x42')]+'%'};return _0x5084f9;}})});}_0x436bf7=_[_0xf7f2('0x43')]({},_0x436bf7,_0x11e4f9[_0xf7f2('0x46')]);var _0x56eb92={'where':_0x436bf7[_0xf7f2('0x44')]};return db[_0xf7f2('0x33')][_0xf7f2('0x23')](_0x56eb92)['then'](function(_0x4e5515){_0x475db6[_0xf7f2('0x23')]=_0x4e5515;if(_0x11e4f9[_0xf7f2('0x39')][_0xf7f2('0x47')]){_0x436bf7[_0xf7f2('0x48')]=[{'all':!![]}];}return db[_0xf7f2('0x33')][_0xf7f2('0x49')](_0x436bf7);})[_0xf7f2('0x2b')](function(_0x193827){_0x475db6[_0xf7f2('0x4a')]=_0x193827;return _0x475db6;})['then'](respondWithFilteredResult(_0x5d3ea2,_0x436bf7))[_0xf7f2('0x4b')](handleError(_0x5d3ea2,null));};exports[_0xf7f2('0x4c')]=function(_0x569561,_0x97ad0){var _0x4e7dae={'raw':![],'where':{'id':_0x569561[_0xf7f2('0x4d')]['id']}},_0xd0cc00={};_0xd0cc00[_0xf7f2('0x38')]=_[_0xf7f2('0x3a')](db['UserProfile']['rawAttributes']);_0xd0cc00[_0xf7f2('0x39')]=_[_0xf7f2('0x3a')](_0x569561[_0xf7f2('0x39')]);_0xd0cc00[_0xf7f2('0x3b')]=_[_0xf7f2('0x3c')](_0xd0cc00['model'],_0xd0cc00['query']);_0x4e7dae[_0xf7f2('0x3d')]=_[_0xf7f2('0x3c')](_0xd0cc00['model'],qs[_0xf7f2('0x3e')](_0x569561[_0xf7f2('0x39')][_0xf7f2('0x3e')]));_0x4e7dae[_0xf7f2('0x3d')]=_0x4e7dae[_0xf7f2('0x3d')]['length']?_0x4e7dae[_0xf7f2('0x3d')]:_0xd0cc00[_0xf7f2('0x38')];if(_0x569561[_0xf7f2('0x39')][_0xf7f2('0x47')]){_0x4e7dae[_0xf7f2('0x48')]=[{'all':!![]}];}_0x4e7dae=_[_0xf7f2('0x43')]({},_0x4e7dae,_0x569561[_0xf7f2('0x46')]);return db[_0xf7f2('0x33')][_0xf7f2('0x4e')](_0x4e7dae)[_0xf7f2('0x2b')](handleEntityNotFound(_0x97ad0,null))[_0xf7f2('0x2b')](respondWithResult(_0x97ad0,null))[_0xf7f2('0x4b')](handleError(_0x97ad0,null));};exports[_0xf7f2('0x4f')]=function(_0x5de7c2,_0x5d69ec){return db['UserProfile']['create'](_0x5de7c2[_0xf7f2('0x50')],{})[_0xf7f2('0x2b')](respondWithResult(_0x5d69ec,0xc9))['catch'](handleError(_0x5d69ec,null));};exports[_0xf7f2('0x51')]=function(_0x56377a,_0x2d71cb){var _0x3deed0={'where':{'id':_0x56377a[_0xf7f2('0x4d')]['id']}},_0xb92dcf={};_0xb92dcf[_0xf7f2('0x38')]=_['keys'](db[_0xf7f2('0x33')][_0xf7f2('0x34')]);_0x3deed0[_0xf7f2('0x3d')]=_[_0xf7f2('0x3c')](_0xb92dcf[_0xf7f2('0x38')],qs[_0xf7f2('0x3e')](_0x56377a['query']['fields']));_0x3deed0[_0xf7f2('0x3d')]=_0x3deed0[_0xf7f2('0x3d')][_0xf7f2('0x3f')]?_0x3deed0[_0xf7f2('0x3d')]:_0xb92dcf['model'];if(_0x56377a['query'][_0xf7f2('0x47')]){_0x3deed0[_0xf7f2('0x48')]=[{'all':!![]}];}_0x3deed0=_[_0xf7f2('0x43')]({},_0x3deed0,_0x56377a[_0xf7f2('0x46')]);return db['UserProfile']['find'](_0x3deed0)[_0xf7f2('0x2b')](handleEntityNotFound(_0x2d71cb,null))[_0xf7f2('0x2b')](function(_0x1479a6){if(_0x1479a6){var _0x270815=_0x1479a6[_0xf7f2('0x52')]({'plain':!![]});_0x270815=qs['omit'](_0x270815,['id',_0xf7f2('0x53'),_0xf7f2('0x54'),_0xf7f2('0x55')]);_0x56377a['body']=_[_0xf7f2('0x56')](_0x56377a[_0xf7f2('0x50')],['id',_0xf7f2('0x53'),'updatedAt']);return db['sequelize'][_0xf7f2('0x57')](function(_0x3af47b){return db[_0xf7f2('0x33')]['create'](_[_0xf7f2('0x43')](_0x270815,_0x56377a[_0xf7f2('0x50')]),{'include':_0x56377a['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3af47b})['then'](function(_0x4ec067){var _0x281ba7=_0x4ec067[_0xf7f2('0x52')]({'plain':!![]});return db['UserProfileSection'][_0xf7f2('0x49')]({'where':{'userProfileId':_0x56377a['params']['id']},'raw':!![]})['then'](function(_0x331916){if(_0x331916){return BPromise[_0xf7f2('0x58')](_0x331916,function(_0x343128){return new BPromise(function(_0x2e797e,_0x3fd62e){if(_0x343128['autoAssociation']===null||_0x343128[_0xf7f2('0x59')]===0x1)_0x2e797e(null);return db[_0xf7f2('0x5a')][_0xf7f2('0x49')]({'where':{'sectionId':_0x343128['id']},'raw':!![]})[_0xf7f2('0x2b')](function(_0x92da48){var _0x18246b=_[_0xf7f2('0x32')](_0x92da48,function(_0x132135){return qs[_0xf7f2('0x56')](_0x132135,['id',_0xf7f2('0x53'),_0xf7f2('0x54'),_0xf7f2('0x5b')]);});_0x2e797e(_0x18246b);})[_0xf7f2('0x4b')](function(_0x21d858){_0x3fd62e(_0x21d858);});})[_0xf7f2('0x2b')](function(_0x13f5b0){var _0x5e8a8d=qs[_0xf7f2('0x56')](_0x343128,['id',_0xf7f2('0x53'),_0xf7f2('0x54')]);_0x5e8a8d[_0xf7f2('0x5c')]=_0x281ba7['id'];if(_0x13f5b0)_0x5e8a8d[_0xf7f2('0x5d')]=_0x13f5b0;return _0x5e8a8d;})['then'](function(_0x225467){return db[_0xf7f2('0x5e')][_0xf7f2('0x4f')](_0x225467,{'include':[{'model':db[_0xf7f2('0x5a')],'as':_0xf7f2('0x5d')}],'raw':!![],'transaction':_0x3af47b});});})[_0xf7f2('0x2b')](function(){return _0x281ba7;});}});});});}})[_0xf7f2('0x2b')](respondWithResult(_0x2d71cb,0xc9))[_0xf7f2('0x4b')](handleError(_0x2d71cb,null));};exports[_0xf7f2('0x2a')]=function(_0xc096d,_0x36fab3){if(_0xc096d[_0xf7f2('0x50')]['id']){delete _0xc096d[_0xf7f2('0x50')]['id'];}return db['UserProfile']['find']({'where':{'id':_0xc096d['params']['id']}})[_0xf7f2('0x2b')](handleEntityNotFound(_0x36fab3,null))[_0xf7f2('0x2b')](saveUpdates(_0xc096d[_0xf7f2('0x50')],null))[_0xf7f2('0x2b')](respondWithResult(_0x36fab3,null))[_0xf7f2('0x4b')](handleError(_0x36fab3,null));};exports[_0xf7f2('0x2c')]=function(_0x5ddb53,_0x5aba52){return db['UserProfile'][_0xf7f2('0x4e')]({'where':{'id':_0x5ddb53[_0xf7f2('0x4d')]['id']}})[_0xf7f2('0x2b')](handleEntityNotFound(_0x5aba52,null))[_0xf7f2('0x2b')](removeEntity(_0x5aba52,null))[_0xf7f2('0x4b')](handleError(_0x5aba52,null));};exports[_0xf7f2('0x5f')]=function(_0x53f15d,_0x282b4b){return db[_0xf7f2('0x33')]['describe']()[_0xf7f2('0x2b')](respondWithResult(_0x282b4b,null))['catch'](handleError(_0x282b4b,null));};exports[_0xf7f2('0x60')]=function(_0x55bd13,_0x147b2c){var _0x1e7dd4=_0x55bd13['body'];return db[_0xf7f2('0x33')][_0xf7f2('0x4e')]({'where':{'id':_0x55bd13[_0xf7f2('0x4d')]['id']}})[_0xf7f2('0x2b')](handleEntityNotFound(_0x147b2c,null))[_0xf7f2('0x2b')](function(_0x4d26d8){if(_0x4d26d8){return db[_0xf7f2('0x61')][_0xf7f2('0x57')](function(_0x169b47){return db[_0xf7f2('0x5e')][_0xf7f2('0x2c')]({'where':{'userProfileId':_0x55bd13[_0xf7f2('0x4d')]['id'],'sectionId':_[_0xf7f2('0x32')](_0x1e7dd4,function(_0x8515eb){return _0x8515eb[_0xf7f2('0x5b')];})},'transaction':_0x169b47})[_0xf7f2('0x2b')](function(){var _0x26862b=_[_0xf7f2('0x32')](_0x1e7dd4,function(_0x408eaf){_0x408eaf['userProfileId']=_0x55bd13[_0xf7f2('0x4d')]['id'];return _0x408eaf;});var _0x1e271e=[];return BPromise[_0xf7f2('0x58')](_0x26862b,function(_0x277a82){return db[_0xf7f2('0x5e')][_0xf7f2('0x4f')](_0x277a82,{'include':[{'model':db[_0xf7f2('0x5a')],'as':_0xf7f2('0x5d')}],'raw':!![],'transaction':_0x169b47})[_0xf7f2('0x2b')](function(_0x120c8){_0x1e271e[_0xf7f2('0x62')](_0x120c8[_0xf7f2('0x52')]({'plain':!![]}));});})[_0xf7f2('0x2b')](function(){return _0x1e271e;});});});}})[_0xf7f2('0x2b')](function(_0x41feee){return _0x41feee;})[_0xf7f2('0x2b')](respondWithResult(_0x147b2c,null))[_0xf7f2('0x4b')](handleError(_0x147b2c,null));};exports[_0xf7f2('0x63')]=function(_0x5d0a50,_0x2442c0){var _0x3f623d;return db[_0xf7f2('0x33')][_0xf7f2('0x4e')]({'where':{'id':_0x5d0a50[_0xf7f2('0x4d')]['id']},'attributes':['id',_0xf7f2('0x2f')]})[_0xf7f2('0x2b')](handleEntityNotFound(_0x2442c0,null))['then'](function(_0x573bf2){if(_0x573bf2){_0x3f623d=_0x573bf2;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x5d0a50[_0xf7f2('0x4d')]['id'],'sectionId':_0x5d0a50['query'][_0xf7f2('0x64')]}});}})['then'](function(){return _0x3f623d;})[_0xf7f2('0x2b')](respondWithStatusCode(_0x2442c0,null))[_0xf7f2('0x4b')](handleError(_0x2442c0,null));};exports['getSections']=function(_0x22ad61,_0x4e8258){var _0x25b958=[];var _0x1145ca=[];return db[_0xf7f2('0x5e')]['findAll']({'where':{'userProfileId':_0x22ad61['params']['id']},'raw':!![]})['then'](function(_0xe1c7d5){_0x25b958=_[_0xf7f2('0x42')](_0xe1c7d5,function(_0x585bf9){return _0x585bf9[_0xf7f2('0x65')]===0x1||_[_0xf7f2('0x66')]([0x3eb,0x709],_0x585bf9[_0xf7f2('0x5b')]);});if(!_[_0xf7f2('0x67')](_0x25b958)){return _[_0xf7f2('0x32')](_0x25b958,function(_0x24fb1d){return _0x24fb1d['sectionId'];});}else{return;}})[_0xf7f2('0x2b')](function(_0x4a1e02){if(_0x4a1e02)_0x1145ca=_0x4a1e02;if(_[_0xf7f2('0x66')](_0x1145ca,0x64)){var _0x1b5d7f=_['find'](_0x25b958,{'sectionId':0x64});return hasDefaultDashboard(_0x1b5d7f)['then'](function(_0x41329e){return _[_0xf7f2('0x32')](_0x25b958,function(_0x4a579c){if(_0x4a579c[_0xf7f2('0x5b')]===0x64){_0x4a579c[_0xf7f2('0x68')]=_0x41329e;}return _0x4a579c;});});}else{return;}})['then'](function(_0x3a026d){if(_0x3a026d)_0x25b958=_0x3a026d;if(_[_0xf7f2('0x66')](_0x1145ca,0x3eb)){var _0x44986b=_[_0xf7f2('0x4e')](_0x25b958,{'sectionId':0x3eb});return getCustomDashboards(_0x44986b)[_0xf7f2('0x2b')](function(_0xedf1af){return _[_0xf7f2('0x32')](_0x25b958,function(_0x2c295b){if(_0x44986b[_0xf7f2('0x65')]){if(_0x2c295b[_0xf7f2('0x5b')]===0x3eb){_0x2c295b[_0xf7f2('0x68')]=_0xedf1af;}}else{if(_0x2c295b[_0xf7f2('0x5b')]===0x64){if(!_0x2c295b[_0xf7f2('0x68')]){_0x2c295b['subsections']=[];}_0x2c295b[_0xf7f2('0x68')]=_0x2c295b[_0xf7f2('0x68')][_0xf7f2('0x69')](_0xedf1af);}}return _0x2c295b;});});}else{return;}})[_0xf7f2('0x2b')](function(_0x56a365){if(_0x56a365)_0x25b958=_0x56a365;if(_[_0xf7f2('0x66')](_0x1145ca,0x709)){var _0x39a3aa=_[_0xf7f2('0x4e')](_0x25b958,{'sectionId':0x709});return getPlugins(_0x39a3aa)[_0xf7f2('0x2b')](function(_0x2dcf33){if(_0x39a3aa[_0xf7f2('0x65')]){return _[_0xf7f2('0x32')](_0x25b958,function(_0x2c3d25){if(_0x2c3d25[_0xf7f2('0x5b')]===0x709){_0x2c3d25[_0xf7f2('0x68')]=_0x2dcf33;}return _0x2c3d25;});}else{var _0x2aa5c6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2dcf33};var _0x1cb034=_[_0xf7f2('0x32')](_0x25b958);_0x1cb034[_0xf7f2('0x62')](_0x2aa5c6);return _0x1cb034;}});}else{return;}})[_0xf7f2('0x2b')](function(_0x1e0953){if(_0x1e0953)_0x25b958=_0x1e0953;return _['filter'](_0x25b958,[_0xf7f2('0x65'),0x1]);})[_0xf7f2('0x2b')](respondWithResult(_0x4e8258,null))['catch'](handleError(_0x4e8258,null));};function hasDefaultDashboard(_0x2c69c2){var _0x11cc43=[0x65];return new BPromise(function(_0x11822b,_0x36c6cf){try{if(_0x2c69c2[_0xf7f2('0x59')]){_0x11822b(_0x11cc43);}else{return db[_0xf7f2('0x5a')][_0xf7f2('0x6a')]({'where':{'sectionId':_0x2c69c2['id']},'raw':!![]})[_0xf7f2('0x2b')](function(_0x7c6477){_0x7c6477?_0x11822b(_0x11cc43):_0x11822b();});}}catch(_0xee0fb5){_0x36c6cf(_0xee0fb5);}});}function getCustomDashboards(_0x230ed5){var _0x43c1ce=[];return new BPromise(function(_0x59eb2c,_0x3a5f00){try{if(_0x230ed5[_0xf7f2('0x59')]){return db['Dashboard'][_0xf7f2('0x49')]({'raw':!![]})['then'](function(_0x403295){_0x403295[_0xf7f2('0x6b')](function(_0x839737){_0x43c1ce[_0xf7f2('0x62')](_0x839737['id']+0x1869f);});_0x59eb2c(_0x43c1ce);});}else{return db['UserProfileResource'][_0xf7f2('0x49')]({'where':{'sectionId':_0x230ed5['id']},'raw':!![]})[_0xf7f2('0x2b')](function(_0x184cea){_0x184cea[_0xf7f2('0x6b')](function(_0x36417e){_0x43c1ce[_0xf7f2('0x62')](_0x36417e[_0xf7f2('0x6c')]+0x1869f);});_0x59eb2c(_0x43c1ce);});}}catch(_0x51c926){_0x3a5f00(_0x51c926);}});}function getPlugins(_0x4f3b74){var _0x553e6c=[];return new BPromise(function(_0x5cd576,_0x2aaa02){try{if(_0x4f3b74['autoAssociation']){return db[_0xf7f2('0x6d')][_0xf7f2('0x49')]({'raw':!![]})['then'](function(_0x53c44b){_0x53c44b[_0xf7f2('0x6b')](function(_0x5ff483){_0x553e6c[_0xf7f2('0x62')](_0x5ff483['id']+0x15b38);});_0x5cd576(_0x553e6c);});}else{return db['UserProfileResource'][_0xf7f2('0x49')]({'where':{'sectionId':_0x4f3b74['id']},'raw':!![]})[_0xf7f2('0x2b')](function(_0x3073c7){_0x3073c7[_0xf7f2('0x6b')](function(_0x564d99){_0x553e6c[_0xf7f2('0x62')](_0x564d99[_0xf7f2('0x6c')]+0x15b38);});_0x5cd576(_0x553e6c);});}}catch(_0x25e01e){_0x2aaa02(_0x25e01e);}});}exports[_0xf7f2('0x6e')]=function(_0x3b7cb7,_0xc10c99){return db[_0xf7f2('0x33')][_0xf7f2('0x4e')]({'where':{'id':_0x3b7cb7['params']['id']}})[_0xf7f2('0x2b')](handleEntityNotFound(_0xc10c99,null))[_0xf7f2('0x2b')](function(_0x595d12){if(_0x595d12){return db['sequelize'][_0xf7f2('0x57')](function(_0x283d59){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3b7cb7['params']['id']},'attributes':['id'],'raw':!![]})[_0xf7f2('0x2b')](function(_0x3a1c7d){if(_0x3a1c7d){return db[_0xf7f2('0x5e')][_0xf7f2('0x2c')]({'where':{'userProfileId':_0x3b7cb7[_0xf7f2('0x4d')]['id'],'id':_[_0xf7f2('0x32')](_0x3a1c7d,function(_0x4236d4){return _0x4236d4['id'];})},'transaction':_0x283d59});}})[_0xf7f2('0x2b')](function(_0x58f421){var _0x54b76d=_['map'](_0x3b7cb7[_0xf7f2('0x50')],function(_0x28ddd9){_0x28ddd9[_0xf7f2('0x5c')]=_0x3b7cb7['params']['id'];return _0x28ddd9;});return db[_0xf7f2('0x5e')][_0xf7f2('0x6f')](_0x54b76d,{'raw':!![],'transaction':_0x283d59});})[_0xf7f2('0x2b')](function(_0x2dba6e){var _0x55fea0=_[_0xf7f2('0x42')](_[_0xf7f2('0x32')](_0x2dba6e,function(_0x1c5cce){return _0x1c5cce[_0xf7f2('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x55fea0){return db[_0xf7f2('0x5e')][_0xf7f2('0x49')]({'where':{'userProfileId':_0x3b7cb7['params']['id'],'sectionId':_[_0xf7f2('0x32')](_0x55fea0,function(_0x51d8d7){return _0x51d8d7[_0xf7f2('0x5b')];})},'attributes':['id',_0xf7f2('0x5b')],'raw':!![]})['then'](function(_0x2430ce){var _0x2f9b2b=_[_0xf7f2('0x32')](_0x3b7cb7[_0xf7f2('0x50')],function(_0x5debe0){_0x5debe0[_0xf7f2('0x5c')]=_0x3b7cb7['params']['id'];return _0x5debe0;});return db[_0xf7f2('0x5a')][_0xf7f2('0x6f')](_0x2f9b2b,{'raw':!![],'transaction':_0x283d59});});}})[_0xf7f2('0x4b')](handleError(_0xc10c99,null));});}})[_0xf7f2('0x2b')](function(_0x3812cf){var _0x14c886=_['map'](_0x3812cf,function(_0x3a82c5){return _0x3a82c5[_0xf7f2('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0xc10c99,null))[_0xf7f2('0x4b')](handleError(_0xc10c99,null));};exports[_0xf7f2('0x70')]=function(_0x4e89e1,_0x4731f2,_0x3ab7c9){return db[_0xf7f2('0x33')][_0xf7f2('0x4e')]({'where':{'id':_0x4e89e1[_0xf7f2('0x4d')]['id']}})[_0xf7f2('0x2b')](handleEntityNotFound(_0x4731f2,null))['then'](function(_0x48e5e4){if(_0x48e5e4){return _0x48e5e4[_0xf7f2('0x70')](_0x4e89e1[_0xf7f2('0x39')][_0xf7f2('0x64')]);}})[_0xf7f2('0x2b')](respondWithStatusCode(_0x4731f2,null))[_0xf7f2('0x4b')](handleError(_0x4731f2,null));};exports[_0xf7f2('0x71')]=function(_0x48c20f,_0x4a21fd){var _0x1d5a8c={};if(!_0x48c20f[_0xf7f2('0x39')][_0xf7f2('0x72')])throw new Error(_0xf7f2('0x73'));if(!_0x48c20f[_0xf7f2('0x39')][_0xf7f2('0x74')](_0xf7f2('0x75'))){_0x1d5a8c[_0xf7f2('0x25')]=qs[_0xf7f2('0x25')](_0x48c20f[_0xf7f2('0x39')][_0xf7f2('0x25')]);_0x1d5a8c[_0xf7f2('0x24')]=qs[_0xf7f2('0x24')](_0x48c20f[_0xf7f2('0x39')][_0xf7f2('0x24')]);}return db['UserProfile'][_0xf7f2('0x4e')]({'where':{'id':_0x48c20f[_0xf7f2('0x4d')]['id']}})[_0xf7f2('0x2b')](function(_0x440d42){if(!_0x440d42)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x48c20f[_0xf7f2('0x4d')]['id']);return db['UserProfile'][_0xf7f2('0x71')](_0x48c20f);})[_0xf7f2('0x2b')](respondWithFilteredResult(_0x4a21fd,_0x1d5a8c))[_0xf7f2('0x4b')](handleError(_0x4a21fd,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index c608d83..2f68548 100644 --- a/server/api/userProfile/userProfile.events.js +++ b/server/api/userProfile/userProfile.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2272=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x65d13d,_0x49e929){var _0x309bb3=function(_0x2d7f73){while(--_0x2d7f73){_0x65d13d['push'](_0x65d13d['shift']());}};_0x309bb3(++_0x49e929);}(_0x2272,0xd8));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x2227('0x0'));var UserProfile=require(_0x2227('0x1'))['db'][_0x2227('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2227('0x3')](0x0);var events={'afterCreate':_0x2227('0x4'),'afterUpdate':'update','afterDestroy':_0x2227('0x5')};function emitEvent(_0x3bb7ba){return function(_0x1f5a4a,_0x4c17c2,_0x4ebde3){UserProfileEvents[_0x2227('0x6')](_0x3bb7ba+':'+_0x1f5a4a['id'],_0x1f5a4a);UserProfileEvents[_0x2227('0x6')](_0x3bb7ba,_0x1f5a4a);_0x4ebde3(null);};}for(var e in events){if(events[_0x2227('0x7')](e)){var event=events[e];UserProfile[_0x2227('0x8')](e,emitEvent(event));}}module[_0x2227('0x9')]=UserProfileEvents; \ No newline at end of file +var _0xfcf0=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x13dd37,_0x1a62d7){var _0x4018ef=function(_0x24f017){while(--_0x24f017){_0x13dd37['push'](_0x13dd37['shift']());}};_0x4018ef(++_0x1a62d7);}(_0xfcf0,0x138));var _0x0fcf=function(_0x37c8ef,_0x334449){_0x37c8ef=_0x37c8ef-0x0;var _0x5eaee9=_0xfcf0[_0x37c8ef];return _0x5eaee9;};'use strict';var EventEmitter=require(_0x0fcf('0x0'));var UserProfile=require(_0x0fcf('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0fcf('0x2')](0x0);var events={'afterCreate':_0x0fcf('0x3'),'afterUpdate':_0x0fcf('0x4'),'afterDestroy':_0x0fcf('0x5')};function emitEvent(_0x5c865e){return function(_0x2fe6d8,_0x265968,_0x3bd34d){UserProfileEvents[_0x0fcf('0x6')](_0x5c865e+':'+_0x2fe6d8['id'],_0x2fe6d8);UserProfileEvents[_0x0fcf('0x6')](_0x5c865e,_0x2fe6d8);_0x3bd34d(null);};}for(var e in events){if(events[_0x0fcf('0x7')](e)){var event=events[e];UserProfile[_0x0fcf('0x8')](e,emitEvent(event));}}module[_0x0fcf('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index ece763e..8698203 100644 --- a/server/api/userProfile/userProfile.model.js +++ b/server/api/userProfile/userProfile.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69b4=['whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','VoiceQueues','users','agents','admin','zendeskaccounts','ZendeskAccount','SalesforceAccount','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','CannedAnswer','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Tag','templates','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','OpenTabs','UserProfile','user_profiles','query','section','mergeResources','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','custom','CustomReports','count','rows','ids','extraQueryConditions','Tags','color','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','projectName','contacts','CmContact','Lists','ListId','CmList','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','VoiceMail','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','queue','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues'];(function(_0x3a1da8,_0x10e646){var _0x30bdad=function(_0x574805){while(--_0x574805){_0x3a1da8['push'](_0x3a1da8['shift']());}};_0x30bdad(++_0x10e646);}(_0x69b4,0x6c));var _0x469b=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x69b4[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x469b('0x0'));var attributes=require(_0x469b('0x1'));var qs=require(_0x469b('0x2'));var squel=require(_0x469b('0x3'));module[_0x469b('0x4')]=function(_0x602c15){var _0x31b3df=_0x602c15[_0x469b('0x5')];function _0x19b3b2(_0x2f4871,_0x1bec8a){return new Promise(function(_0xd687e5,_0x340a11){if(!_0x1bec8a)return _0xd687e5(null);var _0x3adcc7=_0x1bec8a[_0x469b('0x6')]?{[_0x1bec8a[_0x469b('0x6')][_0x469b('0x7')]]:_0x1bec8a[_0x469b('0x6')][_0x469b('0x8')]}:undefined;return _0x31b3df[_0x2f4871][_0x469b('0x9')]({'where':_0x3adcc7,'raw':!![]})[_0x469b('0xa')](function(_0x38e316){_0x1bec8a[_0x469b('0xb')]=_[_0x469b('0xc')](_0x38e316,'id');_0xd687e5(_0x1bec8a);})[_0x469b('0xd')](function(_0x144f6a){_0x340a11(_0x144f6a);});});}function _0x34003f(_0x3eb4aa,_0x3b8575){return new Promise(function(_0x2e5b07,_0xbca9e6){var _0x3402ee=_0x3eb4aa[_0x469b('0x6')]?{[_0x3eb4aa[_0x469b('0x6')][_0x469b('0x7')]]:_0x3eb4aa['filter'][_0x469b('0x8')]}:undefined;return _0x31b3df[_0x3eb4aa[_0x469b('0xe')]][_0x469b('0x9')]({'where':_0x3402ee,'raw':!![]})[_0x469b('0xa')](function(_0x57bf02){_0x3b8575[_0x469b('0xb')]=_[_0x469b('0xc')](_0x57bf02,function(_0x255591){return _0x255591[_0x469b('0xf')];});_0x2e5b07(_0x3b8575);})['catch'](function(_0x1ac278){_0xbca9e6(_0x1ac278);});});}function _0x21a205(_0x755b21,_0xb4739e,_0x2ffdaf){if(!_0xb4739e)return Promise[_0x469b('0x10')](null);return new Promise(function(_0x1722fc,_0x1bba29){return _0x31b3df[_0x469b('0x11')][_0x469b('0x9')]({'where':{'sectionId':_0xb4739e['id']},'raw':!![]})['then'](function(_0x3d7023){if(_0x755b21[_0x469b('0x7')]&&_0x755b21[_0x469b('0x7')]!=='id'){_0xb4739e[_0x469b('0xb')]=_['map'](_0x3d7023,function(_0x515185){return _0x515185[_0x755b21[_0x469b('0x7')]];});}else{if(_0x2ffdaf===_0x469b('0x12')){_0xb4739e[_0x469b('0xb')]=_[_0x469b('0xc')](_0x3d7023,function(_0x4c7dc2){return{'id':_0x4c7dc2[_0x469b('0x13')],'type':_0x4c7dc2[_0x469b('0x14')]};});}else{_0xb4739e['associatedResources']=_[_0x469b('0xc')](_0x3d7023,function(_0x2bfd97){return _0x2bfd97[_0x469b('0x13')];});}}_0x1722fc(_0xb4739e);})[_0x469b('0xd')](function(_0xa7f26e){_0x1bba29(_0xa7f26e);});});}function _0x85345(_0x394bf7,_0x139187){var _0x61bfb7={'parentSections':[]};switch(_0x394bf7[_0x469b('0x15')]()){case'squareprojects':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x17');break;case _0x469b('0x18'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x19');break;case _0x469b('0x1a'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x1b');_0x61bfb7[_0x469b('0x1c')]=[{'name':'SquareProjects','field':_0x469b('0xf'),'foreignKey':_0x469b('0x1d')}];break;case'projects':_0x61bfb7['childModel']='JscriptyProject';break;case _0x469b('0x1e'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x1f');_0x61bfb7['parentSections']=[{'name':_0x469b('0x20'),'field':'id','foreignKey':_0x469b('0x21')}];break;case'lists':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x22');break;case'companies':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x23');break;case _0x469b('0x24'):_0x61bfb7['childModel']=_0x469b('0x25');break;case'chatqueues':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x26');break;case _0x469b('0x27'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x28');break;case _0x469b('0x29'):_0x61bfb7['childModel']='FaxQueue';break;case _0x469b('0x2a'):_0x61bfb7[_0x469b('0x16')]='FaxAccount';break;case _0x469b('0x2b'):case _0x469b('0x2c'):case _0x469b('0x2d'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x2e');break;case'contexts':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x2f');break;case'voicemails':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x30');break;case'voicerecordings':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x31');_0x61bfb7[_0x469b('0x1c')]=[{'name':_0x469b('0x32'),'field':_0x469b('0xf'),'foreignKey':_0x469b('0x33'),'model':'User','filter':{'field':_0x469b('0x34'),'value':[_0x469b('0x35')]}},{'name':_0x469b('0x36'),'field':_0x469b('0xf'),'foreignKey':_0x469b('0x33'),'model':_0x469b('0x37'),'filter':{'field':_0x469b('0x34'),'value':[_0x469b('0x38')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x469b('0x39'),'model':_0x469b('0x3a'),'filter':{'field':_0x469b('0x14'),'value':['inbound']}},{'name':_0x469b('0x3b'),'field':'name','foreignKey':_0x469b('0x39'),'model':_0x469b('0x3a'),'filter':{'field':'type','value':['outbound']}}];break;case _0x469b('0x3c'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x3d');break;case _0x469b('0x3e'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x3f');break;case _0x469b('0x40'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x41');break;case'ivrcampaigns':_0x61bfb7['childModel']='Campaign';break;case _0x469b('0x42'):_0x61bfb7['childModel']=_0x469b('0x43');break;case _0x469b('0x44'):_0x61bfb7['childModel']=_0x469b('0x45');break;case _0x469b('0x46'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x47');break;case'openchannelqueues':_0x61bfb7[_0x469b('0x16')]='OpenchannelQueue';break;case _0x469b('0x48'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x49');break;case _0x469b('0x4a'):_0x61bfb7['childModel']=_0x469b('0x4b');break;case _0x469b('0x4c'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x4d');break;case _0x469b('0x4e'):_0x61bfb7[_0x469b('0x16')]='WhatsappQueue';break;case _0x469b('0x4f'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x50');break;case _0x469b('0x51'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x52');break;case'voicequeues':case _0x469b('0x53'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x3a');if(_0x139187){_0x61bfb7[_0x469b('0x1c')]=[{'name':_0x469b('0x54')},{'name':'QueueCampaigns'}];}break;case _0x469b('0x55'):case _0x469b('0x56'):case'telephones':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x37');if(_0x139187){_0x61bfb7['parentSections']=[{'name':'Users','filter':{'field':_0x469b('0x34'),'value':[_0x469b('0x57'),'user']},'ignore':!![]},{'name':_0x469b('0x32')},{'name':_0x469b('0x36')}];}break;case _0x469b('0x58'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x59');break;case'salesforceaccounts':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x5a');break;case'freshdeskaccounts':_0x61bfb7['childModel']=_0x469b('0x5b');break;case'sugarcrmaccounts':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x5c');break;case _0x469b('0x5d'):_0x61bfb7['childModel']=_0x469b('0x5e');break;case'zohoaccounts':_0x61bfb7[_0x469b('0x16')]='ZohoAccount';break;case _0x469b('0x5f'):_0x61bfb7[_0x469b('0x16')]='User';break;case'cannedanswers':_0x61bfb7['childModel']=_0x469b('0x60');break;case'dispositions':_0x61bfb7[_0x469b('0x16')]='Disposition';break;case'customdashboards':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x61');break;case _0x469b('0x62'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x63');break;case _0x469b('0x64'):_0x61bfb7['childModel']='Pause';break;case _0x469b('0x65'):_0x61bfb7['childModel']=_0x469b('0x66');break;case _0x469b('0x67'):_0x61bfb7[_0x469b('0x16')]='Sound';break;case'tags':_0x61bfb7[_0x469b('0x16')]=_0x469b('0x68');break;case _0x469b('0x69'):_0x61bfb7[_0x469b('0x16')]='Template';break;case _0x469b('0x6a'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x6b');break;case _0x469b('0x6c'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x6d');break;case _0x469b('0x6e'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x6f');break;case _0x469b('0x70'):_0x61bfb7['childModel']=_0x469b('0x71');break;case'extractedreports':_0x61bfb7[_0x469b('0x16')]='AnalyticExtractedReport';_0x61bfb7[_0x469b('0x1c')]=[{'name':_0x469b('0x72'),'field':'id','foreignKey':_0x469b('0x73')}];break;case _0x469b('0x74'):_0x61bfb7[_0x469b('0x16')]=_0x469b('0x75');break;}return _0x61bfb7;}function _0xc4b79f(_0x3f569a,_0x49e270){var _0x44c8ac=_0x3f569a[_0x469b('0x76')](0x0)[_0x469b('0x77')]()+_0x3f569a[_0x469b('0x78')](0x1);var _0x2bbe99={'type':_0x31b3df[_0x469b('0x79')][_0x469b('0x7a')]['SELECT'],'raw':!![]};return new Promise(function(_0x18fd28,_0x5790ee){var _0x469d99=squel[_0x469b('0x7b')]()['field'](_0x469b('0x7c')+_0x44c8ac+_0x469b('0x7d'),'id')[_0x469b('0x7')]('ui.createdAt')[_0x469b('0x7e')](_0x469b('0x7f')+_0x3f569a+_0x469b('0x80'),'ui')[_0x469b('0x81')](_0x469b('0x82'),_0x49e270['id']);return _0x31b3df[_0x469b('0x83')]['query'](_0x469d99['toString'](),_0x2bbe99)[_0x469b('0xa')](function(_0x11dc12){_0x49e270[_0x44c8ac+_0x469b('0x84')]=_0x11dc12;_0x18fd28(_0x11dc12);})['catch'](function(_0x44a711){_0x5790ee(_0x44a711);});});}return _0x602c15['define'](_0x469b('0x85'),attributes,{'tableName':_0x469b('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4596f3){var _0x546c93={'raw':_0x4596f3[_0x469b('0x87')]['raw'],'where':{}};var _0x16d090={};var _0xd5b851={'count':0x0,'rows':[]};var _0x33dca8=_0x4596f3['query'][_0x469b('0x88')];var _0x1e3456=_0x4596f3[_0x469b('0x87')][_0x469b('0x89')]||![];var _0x4d9f27=_0x85345(_0x33dca8,_0x1e3456);if(!_0x4d9f27[_0x469b('0x16')])throw new Error('Invalid\x20section\x20\x27'+_0x33dca8+'\x27');var _0x59c1fe=[{'name':_0x33dca8}];if(!_[_0x469b('0x8a')](_0x4d9f27[_0x469b('0x1c')]))_0x59c1fe=_0x4d9f27[_0x469b('0x1c')];var _0x29de5b=[];for(var _0x4de8e2=0x0;_0x4de8e2<_0x59c1fe[_0x469b('0x8b')];_0x4de8e2++){_0x29de5b[_0x469b('0x8c')](_0x31b3df[_0x469b('0x8d')][_0x469b('0x8e')]({'where':{'userProfileId':_0x4596f3[_0x469b('0x8f')]['id'],'name':_0x59c1fe[_0x4de8e2][_0x469b('0xf')]},'raw':!![]}));}return Promise[_0x469b('0x90')](_0x29de5b)[_0x469b('0xa')](function(_0x5174b4){var _0x2b40a1=_[_0x469b('0x6')](_0x5174b4,function(_0x4a7000){return _0x4a7000?_0x4a7000:undefined;});var _0x26f2fe=_[_0x469b('0x6')](_0x59c1fe,[_0x469b('0x91'),!![]]);var _0x2d5780=_[_0x469b('0x8a')](_0x2b40a1)&&_[_0x469b('0x8a')](_0x26f2fe)?null:_['union'](_0x26f2fe,_0x2b40a1);if(!_0x2d5780)return null;var _0x36fb72=[];for(var _0x5bfdb6=0x0;_0x5bfdb6<_0x2d5780[_0x469b('0x8b')];_0x5bfdb6++){var _0x12838e=_[_0x469b('0x8e')](_0x59c1fe,function(_0x4915a0){return _0x2d5780[_0x5bfdb6]?_0x4915a0[_0x469b('0xf')]===_0x2d5780[_0x5bfdb6][_0x469b('0xf')]:null;});if(_0x12838e){if(_0x2d5780[_0x5bfdb6][_0x469b('0x91')]){_0x36fb72[_0x469b('0x8c')](_0x19b3b2(_0x4d9f27[_0x469b('0x16')],_0x2d5780[_0x5bfdb6]));}else{if(!_0x2d5780[_0x5bfdb6][_0x469b('0x92')]){_0x36fb72['push'](_0x21a205(_0x12838e,_0x2d5780[_0x5bfdb6],_0x4d9f27['childModel']));}else{if(_0x12838e[_0x469b('0xe')]){_0x36fb72[_0x469b('0x8c')](_0x34003f(_0x12838e,_0x2d5780[_0x5bfdb6]));}}}}}return Promise[_0x469b('0x90')](_0x36fb72);})[_0x469b('0xa')](function(_0x2cb73c){var _0x41b4fc=_0x2cb73c;var _0x4c475b=null;if(_0x41b4fc){_0x4c475b=_0x41b4fc[_0x469b('0x8b')]===0x1?_0x41b4fc[0x0]:null;}if(!_0x4c475b&&!_0x41b4fc)return _0xd5b851;var _0x1001cc=_0x31b3df[_0x4d9f27[_0x469b('0x16')]][_0x469b('0x93')];_0x16d090['model']=_['keys'](_0x1001cc);_0x16d090[_0x469b('0x87')]=_[_0x469b('0x94')](_0x4596f3[_0x469b('0x87')]);_0x16d090[_0x469b('0x95')]=_[_0x469b('0x96')](_0x16d090[_0x469b('0xe')],_0x16d090[_0x469b('0x87')]);_0x546c93[_0x469b('0x97')]=_[_0x469b('0x96')](_0x16d090['model'],qs[_0x469b('0x98')](_0x4596f3['query']['fields']));_0x546c93['attributes']=_0x546c93[_0x469b('0x97')]['length']?_0x546c93['attributes']:_0x16d090[_0x469b('0xe')];if(!_0x4596f3['query'][_0x469b('0x99')](_0x469b('0x9a'))){_0x546c93[_0x469b('0x9b')]=qs[_0x469b('0x9b')](_0x4596f3[_0x469b('0x87')][_0x469b('0x9b')]);_0x546c93[_0x469b('0x9c')]=qs[_0x469b('0x9c')](_0x4596f3[_0x469b('0x87')][_0x469b('0x9c')]);}_0x546c93[_0x469b('0x9d')]=qs[_0x469b('0x9e')](_0x4596f3[_0x469b('0x87')][_0x469b('0x9e')]);_0x546c93[_0x469b('0x81')]=qs[_0x469b('0x95')](_[_0x469b('0x9f')](_0x4596f3['query'],_0x16d090['filters']));if(_0x4596f3['query'][_0x469b('0x6')]){_0x546c93['where']=_[_0x469b('0xa0')](_0x546c93[_0x469b('0x81')],{'$or':_[_0x469b('0xc')](_0x1001cc,function(_0x41b4b0){if(_0x41b4b0[_0x469b('0x14')][_0x469b('0xa1')]!==_0x469b('0xa2')){var _0x1d219e={};_0x1d219e[_0x41b4b0['field']]={'$like':'%'+_0x4596f3[_0x469b('0x87')]['filter']+'%'};return _0x1d219e;}})});}var _0x390065=[];var _0x58962e=null;var _0x45c721={};if(_0x4c475b){_0x58962e=_[_0x469b('0x8e')](_0x59c1fe,['name',_0x4c475b[_0x469b('0xf')]]);if(_0x58962e[_0x469b('0x7')]){_0x45c721={};if(_0x4d9f27[_0x469b('0x16')]===_0x469b('0x12')){_0x45c721[_0x58962e[_0x469b('0xa3')]]=_[_0x469b('0xc')](_0x4c475b[_0x469b('0xb')],'id');}else{_0x45c721[_0x58962e[_0x469b('0xa3')]]=_0x4c475b['associatedResources'];}_0x390065[_0x469b('0x8c')](_0x45c721);}else{_0x546c93[_0x469b('0x81')]['id']=_0x4c475b[_0x469b('0xb')];}}else{for(var _0x223039=0x0;_0x223039<_0x41b4fc['length'];_0x223039++){_0x58962e=_[_0x469b('0x8e')](_0x59c1fe,['name',_0x41b4fc[_0x223039]['name']]);if(_0x58962e[_0x469b('0x7')]){_0x45c721={};_0x45c721[_0x58962e[_0x469b('0xa3')]]=_0x41b4fc[_0x223039]['associatedResources'];_0x390065[_0x469b('0x8c')](_0x45c721);}else{if(!_0x546c93[_0x469b('0x81')]['id'])_0x546c93[_0x469b('0x81')]['id']=[];_0x41b4fc[_0x223039][_0x469b('0xb')][_0x469b('0xa4')](function(_0x54bcdd){_0x546c93[_0x469b('0x81')]['id'][_0x469b('0x8c')](_0x54bcdd);});}}}if(!_['isEmpty'](_0x390065)){_0x546c93[_0x469b('0x81')]=_[_0x469b('0xa0')](_0x546c93[_0x469b('0x81')],{'$and':{'$or':_0x390065}});}_0x546c93=_[_0x469b('0xa0')]({},_0x546c93,_0x4596f3['options']);if(_0x4c475b&&!_0x4c475b['autoAssociation']&&_0x4d9f27[_0x469b('0x16')]===_0x469b('0x12')){if(_0x4596f3[_0x469b('0x87')][_0x469b('0xa5')]){_0x546c93[_0x469b('0xa6')]=[{'all':!![]}];}return _0x31b3df[_0x4d9f27['childModel']]['findAll'](_0x546c93)[_0x469b('0xa')](function(_0x5af054){var _0x24ee44=[];_0x5af054[_0x469b('0xa4')](function(_0x1cadd5){var _0x2379c2;switch(_0x1cadd5[_0x469b('0xa7')]){case _0x469b('0xa8'):_0x2379c2=_[_0x469b('0x8e')](_0x4c475b[_0x469b('0xb')],function(_0x3a5cda){return _0x3a5cda['id']===_0x1cadd5[_0x469b('0x73')]&&_0x3a5cda['type']==='DefaultReports';});break;case _0x469b('0xa9'):_0x2379c2=_[_0x469b('0x8e')](_0x4c475b[_0x469b('0xb')],function(_0x4bcee1){return _0x4bcee1['id']===_0x1cadd5[_0x469b('0x73')]&&_0x4bcee1[_0x469b('0x14')]===_0x469b('0xaa');});break;}if(_0x2379c2)_0x24ee44['push'](_0x1cadd5);});_0xd5b851[_0x469b('0xab')]=_0x24ee44['length'];_0xd5b851[_0x469b('0xac')]=_0x24ee44;return _0xd5b851;});}else{if(!_['isEmpty'](_0x4596f3['query'][_0x469b('0xad')])){_0x546c93['where']['id']=_0x546c93[_0x469b('0x81')]['id']?_['intersection'](_0x546c93[_0x469b('0x81')]['id'],_0x4596f3['query'][_0x469b('0xad')]):_0x4596f3[_0x469b('0x87')][_0x469b('0xad')];if(_0x4596f3[_0x469b('0x87')]['customSorting']){_0x546c93['order']=_0x4596f3[_0x469b('0x87')]['customSorting'];}}if(_0x4596f3[_0x469b('0x87')]['extraQueryConditions']){_0x546c93[_0x469b('0x81')]=_[_0x469b('0xa0')](_0x546c93['where'],{'$and':_0x4596f3[_0x469b('0x87')][_0x469b('0xae')]});}return _0x31b3df[_0x4d9f27['childModel']][_0x469b('0xab')]({'where':_0x546c93[_0x469b('0x81')]})[_0x469b('0xa')](function(_0x1dc665){_0xd5b851[_0x469b('0xab')]=_0x1dc665;if(_0x4596f3['query'][_0x469b('0xa5')]){if(_0x4d9f27[_0x469b('0x16')]==='CmContact'){_0x546c93['include']=[{'model':_0x31b3df[_0x469b('0x68')],'as':_0x469b('0xaf'),'attributes':['id','name',_0x469b('0xb0')],'required':_0x4596f3[_0x469b('0x87')][_0x469b('0xb1')]?!![]:![]},{'model':_0x31b3df[_0x469b('0x68')],'as':'ThroughTags','attributes':['id',_0x469b('0xf'),_0x469b('0xb0')],'through':_0x4596f3[_0x469b('0x87')][_0x469b('0xb1')]?{'attributes':[],'where':{'TagId':_0x4596f3[_0x469b('0x87')][_0x469b('0xb1')]||undefined}}:{},'required':_0x4596f3[_0x469b('0x87')]['tag']?!![]:![]}];}else{_0x546c93[_0x469b('0xa6')]=[{'all':!![]}];}}return _0x31b3df[_0x4d9f27[_0x469b('0x16')]][_0x469b('0x9')](_0x546c93);})[_0x469b('0xa')](function(_0x46ea6b){_0xd5b851[_0x469b('0xac')]=_0x46ea6b;if(_0x33dca8==='Agents'&&_0x4596f3[_0x469b('0x87')][_0x469b('0xb2')]===_0x469b('0xb3')){var _0x163ea7=[];for(var _0x3fc36f=0x0;_0x3fc36f<_0xd5b851['rows'][_0x469b('0x8b')];_0x3fc36f++){_0x163ea7[_0x469b('0x8c')](_0xc4b79f(_0x469b('0xb4'),_0xd5b851[_0x469b('0xac')][_0x3fc36f][_0x469b('0xb5')]));_0x163ea7[_0x469b('0x8c')](_0xc4b79f(_0x469b('0xb6'),_0xd5b851[_0x469b('0xac')][_0x3fc36f][_0x469b('0xb5')]));_0x163ea7[_0x469b('0x8c')](_0xc4b79f(_0x469b('0xb7'),_0xd5b851['rows'][_0x3fc36f]['dataValues']));_0x163ea7[_0x469b('0x8c')](_0xc4b79f(_0x469b('0xb8'),_0xd5b851['rows'][_0x3fc36f][_0x469b('0xb5')]));_0x163ea7['push'](_0xc4b79f(_0x469b('0xb9'),_0xd5b851['rows'][_0x3fc36f][_0x469b('0xb5')]));_0x163ea7[_0x469b('0x8c')](_0xc4b79f(_0x469b('0xba'),_0xd5b851['rows'][_0x3fc36f]['dataValues']));}return Promise[_0x469b('0x90')](_0x163ea7)[_0x469b('0xa')](function(){return _0xd5b851;});}return _0xd5b851;});}});}}});}; \ No newline at end of file +var _0x91b4=['internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','role','agent','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','pauses','Pause','Schedule','sounds','Sound','tags','Tag','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','params','isEmpty','union','find','ignore','autoAssociation','model','all','rawAttributes','keys','filters','intersection','fields','attributes','nolimit','limit','offset','order','sort','pick','merge','key','foreignKey','options','includeAll','include','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','CmContact','Tags','color','tag','true','chat','dataValues','fax','mail','openchannel','lodash','./userProfile.attributes','exports','models','filter','field','value','findAll','then','associatedResources','map','name','catch','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','parentSections','ListId','lists','companies','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x91b4,0x9a));var _0x491b=function(_0x5a92ad,_0x2219a6){_0x5a92ad=_0x5a92ad-0x0;var _0x2466f8=_0x91b4[_0x5a92ad];return _0x2466f8;};'use strict';var _=require(_0x491b('0x0'));var attributes=require(_0x491b('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x491b('0x2')]=function(_0x23148d){var _0x315335=_0x23148d[_0x491b('0x3')];function _0x29bf15(_0x58075b,_0x589bd7){return new Promise(function(_0x441345,_0x21ea1c){if(!_0x589bd7)return _0x441345(null);var _0x12a3d6=_0x589bd7['filter']?{[_0x589bd7[_0x491b('0x4')][_0x491b('0x5')]]:_0x589bd7[_0x491b('0x4')][_0x491b('0x6')]}:undefined;return _0x315335[_0x58075b][_0x491b('0x7')]({'where':_0x12a3d6,'raw':!![]})[_0x491b('0x8')](function(_0x3034a3){_0x589bd7[_0x491b('0x9')]=_[_0x491b('0xa')](_0x3034a3,'id');_0x441345(_0x589bd7);})['catch'](function(_0x113cd5){_0x21ea1c(_0x113cd5);});});}function _0x3ffacc(_0x297d53,_0x1695f4){return new Promise(function(_0x11af4f,_0x25c247){var _0x3dc2ae=_0x297d53[_0x491b('0x4')]?{[_0x297d53[_0x491b('0x4')][_0x491b('0x5')]]:_0x297d53['filter']['value']}:undefined;return _0x315335[_0x297d53['model']][_0x491b('0x7')]({'where':_0x3dc2ae,'raw':!![]})[_0x491b('0x8')](function(_0x460d64){_0x1695f4[_0x491b('0x9')]=_[_0x491b('0xa')](_0x460d64,function(_0x3ab08c){return _0x3ab08c[_0x491b('0xb')];});_0x11af4f(_0x1695f4);})[_0x491b('0xc')](function(_0x262fd7){_0x25c247(_0x262fd7);});});}function _0x167937(_0xbfe088,_0x40ce37,_0x9c8007){if(!_0x40ce37)return Promise[_0x491b('0xd')](null);return new Promise(function(_0xde903f,_0x2e73b9){return _0x315335['UserProfileResource'][_0x491b('0x7')]({'where':{'sectionId':_0x40ce37['id']},'raw':!![]})['then'](function(_0x3416ba){if(_0xbfe088['field']&&_0xbfe088['field']!=='id'){_0x40ce37[_0x491b('0x9')]=_['map'](_0x3416ba,function(_0x16add4){return _0x16add4[_0xbfe088['field']];});}else{if(_0x9c8007===_0x491b('0xe')){_0x40ce37['associatedResources']=_[_0x491b('0xa')](_0x3416ba,function(_0x532eac){return{'id':_0x532eac[_0x491b('0xf')],'type':_0x532eac[_0x491b('0x10')]};});}else{_0x40ce37[_0x491b('0x9')]=_['map'](_0x3416ba,function(_0x1e2449){return _0x1e2449[_0x491b('0xf')];});}}_0xde903f(_0x40ce37);})[_0x491b('0xc')](function(_0x25c54b){_0x2e73b9(_0x25c54b);});});}function _0x41ac11(_0x5af327,_0x587d3e){var _0x395efb={'parentSections':[]};switch(_0x5af327[_0x491b('0x11')]()){case'squareprojects':_0x395efb[_0x491b('0x12')]=_0x491b('0x13');break;case _0x491b('0x14'):_0x395efb['childModel']=_0x491b('0x15');break;case _0x491b('0x16'):_0x395efb[_0x491b('0x12')]=_0x491b('0x17');_0x395efb['parentSections']=[{'name':_0x491b('0x18'),'field':_0x491b('0xb'),'foreignKey':_0x491b('0x19')}];break;case'projects':_0x395efb[_0x491b('0x12')]=_0x491b('0x1a');break;case'contacts':_0x395efb[_0x491b('0x12')]='CmContact';_0x395efb[_0x491b('0x1b')]=[{'name':'Lists','field':'id','foreignKey':_0x491b('0x1c')}];break;case _0x491b('0x1d'):_0x395efb[_0x491b('0x12')]='CmList';break;case _0x491b('0x1e'):_0x395efb[_0x491b('0x12')]='CmCompany';break;case _0x491b('0x1f'):_0x395efb['childModel']='CmCustomField';break;case _0x491b('0x20'):_0x395efb[_0x491b('0x12')]=_0x491b('0x21');break;case _0x491b('0x22'):_0x395efb[_0x491b('0x12')]=_0x491b('0x23');break;case _0x491b('0x24'):_0x395efb['childModel']='FaxQueue';break;case _0x491b('0x25'):_0x395efb[_0x491b('0x12')]=_0x491b('0x26');break;case'inboundroutes':case _0x491b('0x27'):case _0x491b('0x28'):_0x395efb[_0x491b('0x12')]='VoiceExtension';break;case _0x491b('0x29'):_0x395efb['childModel']=_0x491b('0x2a');break;case _0x491b('0x2b'):_0x395efb['childModel']=_0x491b('0x2c');break;case'voicerecordings':_0x395efb[_0x491b('0x12')]=_0x491b('0x2d');_0x395efb[_0x491b('0x1b')]=[{'name':_0x491b('0x2e'),'field':_0x491b('0xb'),'foreignKey':_0x491b('0x2f'),'model':_0x491b('0x30'),'filter':{'field':_0x491b('0x31'),'value':[_0x491b('0x32')]}},{'name':'Telephones','field':_0x491b('0xb'),'foreignKey':_0x491b('0x2f'),'model':'User','filter':{'field':_0x491b('0x31'),'value':[_0x491b('0x33')]}},{'name':_0x491b('0x34'),'field':'name','foreignKey':'queue','model':_0x491b('0x35'),'filter':{'field':_0x491b('0x10'),'value':[_0x491b('0x36')]}},{'name':_0x491b('0x37'),'field':'name','foreignKey':_0x491b('0x38'),'model':_0x491b('0x35'),'filter':{'field':_0x491b('0x10'),'value':[_0x491b('0x39')]}}];break;case _0x491b('0x3a'):_0x395efb[_0x491b('0x12')]=_0x491b('0x3b');break;case _0x491b('0x3c'):_0x395efb[_0x491b('0x12')]='VoiceChanSpy';break;case _0x491b('0x3d'):_0x395efb[_0x491b('0x12')]=_0x491b('0x3e');break;case _0x491b('0x3f'):_0x395efb[_0x491b('0x12')]='Campaign';break;case _0x491b('0x40'):_0x395efb['childModel']=_0x491b('0x41');break;case _0x491b('0x42'):_0x395efb['childModel']=_0x491b('0x43');break;case _0x491b('0x44'):_0x395efb[_0x491b('0x12')]=_0x491b('0x45');break;case _0x491b('0x46'):_0x395efb['childModel']=_0x491b('0x47');break;case _0x491b('0x48'):_0x395efb[_0x491b('0x12')]=_0x491b('0x49');break;case'smsqueues':_0x395efb['childModel']='SmsQueue';break;case _0x491b('0x4a'):_0x395efb['childModel']=_0x491b('0x4b');break;case _0x491b('0x4c'):_0x395efb[_0x491b('0x12')]=_0x491b('0x4d');break;case _0x491b('0x4e'):_0x395efb[_0x491b('0x12')]=_0x491b('0x4f');break;case _0x491b('0x50'):_0x395efb[_0x491b('0x12')]='Team';break;case _0x491b('0x51'):case _0x491b('0x52'):_0x395efb['childModel']=_0x491b('0x35');if(_0x587d3e){_0x395efb[_0x491b('0x1b')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x491b('0x53'):case _0x491b('0x54'):case _0x491b('0x55'):_0x395efb[_0x491b('0x12')]=_0x491b('0x30');if(_0x587d3e){_0x395efb['parentSections']=[{'name':_0x491b('0x56'),'filter':{'field':_0x491b('0x31'),'value':['admin',_0x491b('0x57')]},'ignore':!![]},{'name':_0x491b('0x2e')},{'name':_0x491b('0x58')}];}break;case _0x491b('0x59'):_0x395efb[_0x491b('0x12')]=_0x491b('0x5a');break;case _0x491b('0x5b'):_0x395efb[_0x491b('0x12')]=_0x491b('0x5c');break;case'freshdeskaccounts':_0x395efb[_0x491b('0x12')]=_0x491b('0x5d');break;case _0x491b('0x5e'):_0x395efb[_0x491b('0x12')]=_0x491b('0x5f');break;case _0x491b('0x60'):_0x395efb[_0x491b('0x12')]=_0x491b('0x61');break;case'zohoaccounts':_0x395efb['childModel']=_0x491b('0x62');break;case _0x491b('0x63'):_0x395efb[_0x491b('0x12')]='User';break;case _0x491b('0x64'):_0x395efb[_0x491b('0x12')]=_0x491b('0x65');break;case'dispositions':_0x395efb['childModel']=_0x491b('0x66');break;case _0x491b('0x67'):_0x395efb['childModel']=_0x491b('0x68');break;case _0x491b('0x69'):_0x395efb[_0x491b('0x12')]='Interval';break;case _0x491b('0x6a'):_0x395efb[_0x491b('0x12')]=_0x491b('0x6b');break;case'scheduler':_0x395efb[_0x491b('0x12')]=_0x491b('0x6c');break;case _0x491b('0x6d'):_0x395efb['childModel']=_0x491b('0x6e');break;case _0x491b('0x6f'):_0x395efb['childModel']=_0x491b('0x70');break;case'templates':_0x395efb[_0x491b('0x12')]=_0x491b('0x71');break;case _0x491b('0x72'):_0x395efb[_0x491b('0x12')]=_0x491b('0x73');break;case _0x491b('0x74'):_0x395efb[_0x491b('0x12')]=_0x491b('0x75');break;case _0x491b('0x76'):_0x395efb[_0x491b('0x12')]=_0x491b('0x77');break;case _0x491b('0x78'):_0x395efb['childModel']=_0x491b('0x79');break;case _0x491b('0x7a'):_0x395efb['childModel']=_0x491b('0xe');_0x395efb[_0x491b('0x1b')]=[{'name':'Reports','field':'id','foreignKey':_0x491b('0x7b')}];break;case _0x491b('0x7c'):_0x395efb[_0x491b('0x12')]=_0x491b('0x7d');break;}return _0x395efb;}function _0x284c5b(_0x36ac46,_0x57f6e6){var _0x4d4cf0=_0x36ac46[_0x491b('0x7e')](0x0)['toUpperCase']()+_0x36ac46['slice'](0x1);var _0xff9c4a={'type':_0x315335['Sequelize'][_0x491b('0x7f')][_0x491b('0x80')],'raw':!![]};return new Promise(function(_0x811b4e,_0x43b0ad){var _0xc60bae=squel['select']()[_0x491b('0x5')](_0x491b('0x81')+_0x4d4cf0+_0x491b('0x82'),'id')[_0x491b('0x5')](_0x491b('0x83'))[_0x491b('0x84')](_0x491b('0x85')+_0x36ac46+_0x491b('0x86'),'ui')[_0x491b('0x87')]('ui.UserId\x20=\x20?',_0x57f6e6['id']);return _0x315335['sequelize'][_0x491b('0x88')](_0xc60bae[_0x491b('0x89')](),_0xff9c4a)['then'](function(_0x8d04b7){_0x57f6e6[_0x4d4cf0+_0x491b('0x8a')]=_0x8d04b7;_0x811b4e(_0x8d04b7);})[_0x491b('0xc')](function(_0x2c7f50){_0x43b0ad(_0x2c7f50);});});}return _0x23148d[_0x491b('0x8b')](_0x491b('0x8c'),attributes,{'tableName':_0x491b('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2bb2d0){var _0x4000cd={'raw':_0x2bb2d0[_0x491b('0x88')][_0x491b('0x8e')],'where':{}};var _0xd971ac={};var _0x686af8={'count':0x0,'rows':[]};var _0x5bd74d=_0x2bb2d0[_0x491b('0x88')][_0x491b('0x8f')];var _0x45d807=_0x2bb2d0['query'][_0x491b('0x90')]||![];var _0x65b8d=_0x41ac11(_0x5bd74d,_0x45d807);if(!_0x65b8d[_0x491b('0x12')])throw new Error(_0x491b('0x91')+_0x5bd74d+'\x27');var _0x5ba647=[{'name':_0x5bd74d}];if(!_['isEmpty'](_0x65b8d[_0x491b('0x1b')]))_0x5ba647=_0x65b8d['parentSections'];var _0x27839b=[];for(var _0x35e9da=0x0;_0x35e9da<_0x5ba647[_0x491b('0x92')];_0x35e9da++){_0x27839b[_0x491b('0x93')](_0x315335['UserProfileSection']['find']({'where':{'userProfileId':_0x2bb2d0[_0x491b('0x94')]['id'],'name':_0x5ba647[_0x35e9da][_0x491b('0xb')]},'raw':!![]}));}return Promise['all'](_0x27839b)['then'](function(_0x422360){var _0x4c8bc7=_[_0x491b('0x4')](_0x422360,function(_0x4f61a1){return _0x4f61a1?_0x4f61a1:undefined;});var _0x30e97e=_['filter'](_0x5ba647,['ignore',!![]]);var _0x3702e3=_[_0x491b('0x95')](_0x4c8bc7)&&_[_0x491b('0x95')](_0x30e97e)?null:_[_0x491b('0x96')](_0x30e97e,_0x4c8bc7);if(!_0x3702e3)return null;var _0x22564a=[];for(var _0x21164e=0x0;_0x21164e<_0x3702e3[_0x491b('0x92')];_0x21164e++){var _0x3d4448=_[_0x491b('0x97')](_0x5ba647,function(_0x3f39ed){return _0x3702e3[_0x21164e]?_0x3f39ed[_0x491b('0xb')]===_0x3702e3[_0x21164e]['name']:null;});if(_0x3d4448){if(_0x3702e3[_0x21164e][_0x491b('0x98')]){_0x22564a[_0x491b('0x93')](_0x29bf15(_0x65b8d['childModel'],_0x3702e3[_0x21164e]));}else{if(!_0x3702e3[_0x21164e][_0x491b('0x99')]){_0x22564a[_0x491b('0x93')](_0x167937(_0x3d4448,_0x3702e3[_0x21164e],_0x65b8d[_0x491b('0x12')]));}else{if(_0x3d4448[_0x491b('0x9a')]){_0x22564a[_0x491b('0x93')](_0x3ffacc(_0x3d4448,_0x3702e3[_0x21164e]));}}}}}return Promise[_0x491b('0x9b')](_0x22564a);})[_0x491b('0x8')](function(_0x9b2382){var _0xdff40b=_0x9b2382;var _0x1979f6=null;if(_0xdff40b){_0x1979f6=_0xdff40b['length']===0x1?_0xdff40b[0x0]:null;}if(!_0x1979f6&&!_0xdff40b)return _0x686af8;var _0x2fa8d5=_0x315335[_0x65b8d['childModel']][_0x491b('0x9c')];_0xd971ac['model']=_[_0x491b('0x9d')](_0x2fa8d5);_0xd971ac[_0x491b('0x88')]=_['keys'](_0x2bb2d0['query']);_0xd971ac[_0x491b('0x9e')]=_[_0x491b('0x9f')](_0xd971ac[_0x491b('0x9a')],_0xd971ac[_0x491b('0x88')]);_0x4000cd['attributes']=_[_0x491b('0x9f')](_0xd971ac[_0x491b('0x9a')],qs[_0x491b('0xa0')](_0x2bb2d0[_0x491b('0x88')][_0x491b('0xa0')]));_0x4000cd['attributes']=_0x4000cd['attributes'][_0x491b('0x92')]?_0x4000cd[_0x491b('0xa1')]:_0xd971ac[_0x491b('0x9a')];if(!_0x2bb2d0['query']['hasOwnProperty'](_0x491b('0xa2'))){_0x4000cd[_0x491b('0xa3')]=qs[_0x491b('0xa3')](_0x2bb2d0[_0x491b('0x88')]['limit']);_0x4000cd['offset']=qs[_0x491b('0xa4')](_0x2bb2d0[_0x491b('0x88')][_0x491b('0xa4')]);}_0x4000cd[_0x491b('0xa5')]=qs[_0x491b('0xa6')](_0x2bb2d0[_0x491b('0x88')][_0x491b('0xa6')]);_0x4000cd[_0x491b('0x87')]=qs[_0x491b('0x9e')](_[_0x491b('0xa7')](_0x2bb2d0['query'],_0xd971ac[_0x491b('0x9e')]));if(_0x2bb2d0['query'][_0x491b('0x4')]){_0x4000cd[_0x491b('0x87')]=_[_0x491b('0xa8')](_0x4000cd[_0x491b('0x87')],{'$or':_[_0x491b('0xa')](_0x2fa8d5,function(_0xe69380){if(_0xe69380['type'][_0x491b('0xa9')]!=='VIRTUAL'){var _0x1f3cc7={};_0x1f3cc7[_0xe69380[_0x491b('0x5')]]={'$like':'%'+_0x2bb2d0[_0x491b('0x88')][_0x491b('0x4')]+'%'};return _0x1f3cc7;}})});}var _0x171a03=[];var _0x156cd2=null;var _0x459259={};if(_0x1979f6){_0x156cd2=_['find'](_0x5ba647,[_0x491b('0xb'),_0x1979f6[_0x491b('0xb')]]);if(_0x156cd2[_0x491b('0x5')]){_0x459259={};if(_0x65b8d[_0x491b('0x12')]===_0x491b('0xe')){_0x459259[_0x156cd2[_0x491b('0xaa')]]=_[_0x491b('0xa')](_0x1979f6['associatedResources'],'id');}else{_0x459259[_0x156cd2[_0x491b('0xaa')]]=_0x1979f6[_0x491b('0x9')];}_0x171a03[_0x491b('0x93')](_0x459259);}else{_0x4000cd['where']['id']=_0x1979f6[_0x491b('0x9')];}}else{for(var _0x46310e=0x0;_0x46310e<_0xdff40b['length'];_0x46310e++){_0x156cd2=_[_0x491b('0x97')](_0x5ba647,[_0x491b('0xb'),_0xdff40b[_0x46310e][_0x491b('0xb')]]);if(_0x156cd2['field']){_0x459259={};_0x459259[_0x156cd2['foreignKey']]=_0xdff40b[_0x46310e]['associatedResources'];_0x171a03[_0x491b('0x93')](_0x459259);}else{if(!_0x4000cd[_0x491b('0x87')]['id'])_0x4000cd[_0x491b('0x87')]['id']=[];_0xdff40b[_0x46310e]['associatedResources']['forEach'](function(_0x10f1db){_0x4000cd[_0x491b('0x87')]['id'][_0x491b('0x93')](_0x10f1db);});}}}if(!_[_0x491b('0x95')](_0x171a03)){_0x4000cd[_0x491b('0x87')]=_[_0x491b('0xa8')](_0x4000cd[_0x491b('0x87')],{'$and':{'$or':_0x171a03}});}_0x4000cd=_[_0x491b('0xa8')]({},_0x4000cd,_0x2bb2d0[_0x491b('0xab')]);if(_0x1979f6&&!_0x1979f6['autoAssociation']&&_0x65b8d['childModel']===_0x491b('0xe')){if(_0x2bb2d0[_0x491b('0x88')][_0x491b('0xac')]){_0x4000cd[_0x491b('0xad')]=[{'all':!![]}];}return _0x315335[_0x65b8d[_0x491b('0x12')]][_0x491b('0x7')](_0x4000cd)[_0x491b('0x8')](function(_0x14fbe2){var _0x5d95d4=[];_0x14fbe2['forEach'](function(_0x44f6d7){var _0x1c95c3;switch(_0x44f6d7['reportType']){case _0x491b('0xae'):_0x1c95c3=_[_0x491b('0x97')](_0x1979f6[_0x491b('0x9')],function(_0x45b16d){return _0x45b16d['id']===_0x44f6d7[_0x491b('0x7b')]&&_0x45b16d[_0x491b('0x10')]===_0x491b('0xaf');});break;case _0x491b('0xb0'):_0x1c95c3=_[_0x491b('0x97')](_0x1979f6[_0x491b('0x9')],function(_0x496383){return _0x496383['id']===_0x44f6d7[_0x491b('0x7b')]&&_0x496383[_0x491b('0x10')]===_0x491b('0xb1');});break;}if(_0x1c95c3)_0x5d95d4['push'](_0x44f6d7);});_0x686af8[_0x491b('0xb2')]=_0x5d95d4[_0x491b('0x92')];_0x686af8[_0x491b('0xb3')]=_0x5d95d4;return _0x686af8;});}else{if(!_[_0x491b('0x95')](_0x2bb2d0[_0x491b('0x88')][_0x491b('0xb4')])){_0x4000cd['where']['id']=_0x4000cd[_0x491b('0x87')]['id']?_[_0x491b('0x9f')](_0x4000cd[_0x491b('0x87')]['id'],_0x2bb2d0[_0x491b('0x88')][_0x491b('0xb4')]):_0x2bb2d0[_0x491b('0x88')][_0x491b('0xb4')];if(_0x2bb2d0[_0x491b('0x88')]['customSorting']){_0x4000cd[_0x491b('0xa5')]=_0x2bb2d0[_0x491b('0x88')][_0x491b('0xb5')];}}if(_0x2bb2d0[_0x491b('0x88')][_0x491b('0xb6')]){_0x4000cd[_0x491b('0x87')]=_[_0x491b('0xa8')](_0x4000cd['where'],{'$and':_0x2bb2d0['query']['extraQueryConditions']});}return _0x315335[_0x65b8d[_0x491b('0x12')]][_0x491b('0xb2')]({'where':_0x4000cd[_0x491b('0x87')]})['then'](function(_0x2d34ac){_0x686af8['count']=_0x2d34ac;if(_0x2bb2d0[_0x491b('0x88')][_0x491b('0xac')]){if(_0x65b8d['childModel']===_0x491b('0xb7')){_0x4000cd[_0x491b('0xad')]=[{'model':_0x315335[_0x491b('0x70')],'as':_0x491b('0xb8'),'attributes':['id',_0x491b('0xb'),_0x491b('0xb9')],'required':_0x2bb2d0[_0x491b('0x88')]['tag']?!![]:![]},{'model':_0x315335[_0x491b('0x70')],'as':'ThroughTags','attributes':['id',_0x491b('0xb'),_0x491b('0xb9')],'through':_0x2bb2d0['query']['tag']?{'attributes':[],'where':{'TagId':_0x2bb2d0[_0x491b('0x88')][_0x491b('0xba')]||undefined}}:{},'required':_0x2bb2d0[_0x491b('0x88')][_0x491b('0xba')]?!![]:![]}];}else{_0x4000cd[_0x491b('0xad')]=[{'all':!![]}];}}return _0x315335[_0x65b8d[_0x491b('0x12')]][_0x491b('0x7')](_0x4000cd);})[_0x491b('0x8')](function(_0x3c4ba1){_0x686af8[_0x491b('0xb3')]=_0x3c4ba1;if(_0x5bd74d===_0x491b('0x2e')&&_0x2bb2d0[_0x491b('0x88')]['openTabs']===_0x491b('0xbb')){var _0x40960e=[];for(var _0x54d313=0x0;_0x54d313<_0x686af8[_0x491b('0xb3')]['length'];_0x54d313++){_0x40960e['push'](_0x284c5b(_0x491b('0xbc'),_0x686af8[_0x491b('0xb3')][_0x54d313][_0x491b('0xbd')]));_0x40960e[_0x491b('0x93')](_0x284c5b('sms',_0x686af8[_0x491b('0xb3')][_0x54d313]['dataValues']));_0x40960e[_0x491b('0x93')](_0x284c5b(_0x491b('0xbe'),_0x686af8[_0x491b('0xb3')][_0x54d313][_0x491b('0xbd')]));_0x40960e[_0x491b('0x93')](_0x284c5b(_0x491b('0xbf'),_0x686af8[_0x491b('0xb3')][_0x54d313][_0x491b('0xbd')]));_0x40960e[_0x491b('0x93')](_0x284c5b(_0x491b('0xc0'),_0x686af8[_0x491b('0xb3')][_0x54d313]['dataValues']));_0x40960e['push'](_0x284c5b('whatsapp',_0x686af8['rows'][_0x54d313][_0x491b('0xbd')]));}return Promise['all'](_0x40960e)[_0x491b('0x8')](function(){return _0x686af8;});}return _0x686af8;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 9ae3ce3..2f715e9 100644 --- a/server/api/userProfile/userProfile.rpc.js +++ b/server/api/userProfile/userProfile.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a99=['error','message','result','catch','UserProfile,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./userProfile.socket','register','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x349a7d,_0x63dab2){var _0x3b0344=function(_0x3f3dbd){while(--_0x3f3dbd){_0x349a7d['push'](_0x349a7d['shift']());}};_0x3b0344(++_0x63dab2);}(_0x5a99,0xc9));var _0x95a9=function(_0x91d1e9,_0x42afc4){_0x91d1e9=_0x91d1e9-0x0;var _0x3851ea=_0x5a99[_0x91d1e9];return _0x3851ea;};'use strict';var _=require(_0x95a9('0x0'));var util=require(_0x95a9('0x1'));var moment=require(_0x95a9('0x2'));var BPromise=require('bluebird');var rs=require(_0x95a9('0x3'));var fs=require('fs');var Redis=require(_0x95a9('0x4'));var db=require(_0x95a9('0x5'))['db'];var utils=require(_0x95a9('0x6'));var logger=require('../../config/logger')(_0x95a9('0x7'));var config=require(_0x95a9('0x8'));var jayson=require(_0x95a9('0x9'));var client=jayson[_0x95a9('0xa')]['http']({'port':0x232a});config[_0x95a9('0xb')]=_[_0x95a9('0xc')](config[_0x95a9('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x95a9('0xd'))(new Redis(config['redis']));require(_0x95a9('0xe'))[_0x95a9('0xf')](socket);function respondWithRpcPromise(_0x48d5f0,_0x2be9a2,_0xc0e40d){return new BPromise(function(_0x4de148,_0x4aedae){return client[_0x95a9('0x10')](_0x48d5f0,_0xc0e40d)[_0x95a9('0x11')](function(_0x4de6ba){logger[_0x95a9('0x12')]('UserProfile,\x20%s,\x20%s',_0x2be9a2,_0x95a9('0x13'));logger[_0x95a9('0x14')](_0x95a9('0x15'),_0x2be9a2,_0x95a9('0x13'),JSON[_0x95a9('0x16')](_0x4de6ba));if(_0x4de6ba['error']){if(_0x4de6ba['error']['code']===0x1f4){logger[_0x95a9('0x17')]('UserProfile,\x20%s,\x20%s',_0x2be9a2,_0x4de6ba[_0x95a9('0x17')][_0x95a9('0x18')]);return _0x4aedae(_0x4de6ba[_0x95a9('0x17')]['message']);}logger[_0x95a9('0x17')]('UserProfile,\x20%s,\x20%s',_0x2be9a2,_0x4de6ba[_0x95a9('0x17')][_0x95a9('0x18')]);return _0x4de148(_0x4de6ba[_0x95a9('0x17')]['message']);}else{logger[_0x95a9('0x12')]('UserProfile,\x20%s,\x20%s',_0x2be9a2,'request\x20sent');_0x4de148(_0x4de6ba[_0x95a9('0x19')][_0x95a9('0x18')]);}})[_0x95a9('0x1a')](function(_0x183a64){logger[_0x95a9('0x17')](_0x95a9('0x1b'),_0x2be9a2,_0x183a64);_0x4aedae(_0x183a64);});});} \ No newline at end of file +var _0x8af6=['then','info','debug','stringify','error','message','request\x20sent','result','catch','UserProfile,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request'];(function(_0x4c5c41,_0x723137){var _0x3d8943=function(_0x13a75c){while(--_0x13a75c){_0x4c5c41['push'](_0x4c5c41['shift']());}};_0x3d8943(++_0x723137);}(_0x8af6,0x76));var _0x68af=function(_0x3ed82e,_0x532f8c){_0x3ed82e=_0x3ed82e-0x0;var _0x25c537=_0x8af6[_0x3ed82e];return _0x25c537;};'use strict';var _=require(_0x68af('0x0'));var util=require(_0x68af('0x1'));var moment=require(_0x68af('0x2'));var BPromise=require(_0x68af('0x3'));var rs=require(_0x68af('0x4'));var fs=require('fs');var Redis=require(_0x68af('0x5'));var db=require(_0x68af('0x6'))['db'];var utils=require(_0x68af('0x7'));var logger=require(_0x68af('0x8'))(_0x68af('0x9'));var config=require('../../config/environment');var jayson=require(_0x68af('0xa'));var client=jayson['client'][_0x68af('0xb')]({'port':0x232a});config[_0x68af('0xc')]=_[_0x68af('0xd')](config[_0x68af('0xc')],{'host':_0x68af('0xe'),'port':0x18eb});var socket=require(_0x68af('0xf'))(new Redis(config[_0x68af('0xc')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x449f3f,_0x33ddae,_0x4a3c97){return new BPromise(function(_0x227485,_0x21b83b){return client[_0x68af('0x10')](_0x449f3f,_0x4a3c97)[_0x68af('0x11')](function(_0x407d44){logger[_0x68af('0x12')]('UserProfile,\x20%s,\x20%s',_0x33ddae,'request\x20sent');logger[_0x68af('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x33ddae,'request\x20sent',JSON[_0x68af('0x14')](_0x407d44));if(_0x407d44[_0x68af('0x15')]){if(_0x407d44[_0x68af('0x15')]['code']===0x1f4){logger[_0x68af('0x15')]('UserProfile,\x20%s,\x20%s',_0x33ddae,_0x407d44[_0x68af('0x15')][_0x68af('0x16')]);return _0x21b83b(_0x407d44[_0x68af('0x15')][_0x68af('0x16')]);}logger[_0x68af('0x15')]('UserProfile,\x20%s,\x20%s',_0x33ddae,_0x407d44[_0x68af('0x15')][_0x68af('0x16')]);return _0x227485(_0x407d44[_0x68af('0x15')][_0x68af('0x16')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x33ddae,_0x68af('0x17'));_0x227485(_0x407d44[_0x68af('0x18')]['message']);}})[_0x68af('0x19')](function(_0x452c9d){logger[_0x68af('0x15')](_0x68af('0x1a'),_0x33ddae,_0x452c9d);_0x21b83b(_0x452c9d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 857a12d..62a1223 100644 --- a/server/api/userProfile/userProfile.socket.js +++ b/server/api/userProfile/userProfile.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad4b=['emit','removeListener','register','userProfile:','./userProfile.events','save','remove'];(function(_0x25e21b,_0x2dc7af){var _0xfa924b=function(_0x3cd26b){while(--_0x3cd26b){_0x25e21b['push'](_0x25e21b['shift']());}};_0xfa924b(++_0x2dc7af);}(_0xad4b,0x1e0));var _0xbad4=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xad4b[_0x4fc9e6];return _0x551d28;};'use strict';var UserProfileEvents=require(_0xbad4('0x0'));var events=[_0xbad4('0x1'),_0xbad4('0x2'),'update'];function createListener(_0x2de192,_0x3cb4d8){return function(_0x217a78){_0x3cb4d8[_0xbad4('0x3')](_0x2de192,_0x217a78);};}function removeListener(_0x11cf70,_0x2f2ea7){return function(){UserProfileEvents[_0xbad4('0x4')](_0x11cf70,_0x2f2ea7);};}exports[_0xbad4('0x5')]=function(_0x11c89b){for(var _0x50ab7d=0x0,_0x1cc0d7=events['length'];_0x50ab7d<_0x1cc0d7;_0x50ab7d++){var _0xda334=events[_0x50ab7d];var _0x5c7f76=createListener(_0xbad4('0x6')+_0xda334,_0x11c89b);UserProfileEvents['on'](_0xda334,_0x5c7f76);}}; \ No newline at end of file +var _0x0781=['./userProfile.events','remove','update','removeListener','register','length','userProfile:'];(function(_0x31e3e4,_0x5c795a){var _0x4ee39e=function(_0x21ee01){while(--_0x21ee01){_0x31e3e4['push'](_0x31e3e4['shift']());}};_0x4ee39e(++_0x5c795a);}(_0x0781,0x181));var _0x1078=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0781[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0x1078('0x0'));var events=['save',_0x1078('0x1'),_0x1078('0x2')];function createListener(_0x41509b,_0x133285){return function(_0x262585){_0x133285['emit'](_0x41509b,_0x262585);};}function removeListener(_0xe5ea4a,_0x29b67a){return function(){UserProfileEvents[_0x1078('0x3')](_0xe5ea4a,_0x29b67a);};}exports[_0x1078('0x4')]=function(_0x1b237b){for(var _0x202b2e=0x0,_0x3e4bad=events[_0x1078('0x5')];_0x202b2e<_0x3e4bad;_0x202b2e++){var _0x7598a7=events[_0x202b2e];var _0x343936=createListener(_0x1078('0x6')+_0x7598a7,_0x1b237b);UserProfileEvents['on'](_0x7598a7,_0x343936);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index f13c98f..c7280b0 100644 --- a/server/api/userProfileResource/index.js +++ b/server/api/userProfileResource/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdcb=['util','connect-timeout','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','update','delete','exports','multer'];(function(_0x10b86d,_0x12a985){var _0x330b24=function(_0x18fd21){while(--_0x18fd21){_0x10b86d['push'](_0x10b86d['shift']());}};_0x330b24(++_0x12a985);}(_0xfdcb,0x1ca));var _0xbfdc=function(_0x24c39a,_0x48fc91){_0x24c39a=_0x24c39a-0x0;var _0x4c2fa6=_0xfdcb[_0x24c39a];return _0x4c2fa6;};'use strict';var multer=require(_0xbfdc('0x0'));var util=require(_0xbfdc('0x1'));var path=require('path');var timeout=require(_0xbfdc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbfdc('0x3'));var config=require(_0xbfdc('0x4'));var controller=require(_0xbfdc('0x5'));router['get']('/',auth[_0xbfdc('0x6')](),controller[_0xbfdc('0x7')]);router[_0xbfdc('0x8')](_0xbfdc('0x9'),auth[_0xbfdc('0x6')](),controller[_0xbfdc('0xa')]);router[_0xbfdc('0x8')](_0xbfdc('0xb'),auth[_0xbfdc('0x6')](),controller[_0xbfdc('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbfdc('0xd')]);router['put'](_0xbfdc('0xb'),auth[_0xbfdc('0x6')](),controller[_0xbfdc('0xe')]);router[_0xbfdc('0xf')](_0xbfdc('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xbfdc('0x10')]=router; \ No newline at end of file +var _0xd16e=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','./userProfileResource.controller','isAuthenticated','describe','get','post','create','put','/:id','update','delete'];(function(_0x347cad,_0x557129){var _0x2412ec=function(_0x509885){while(--_0x509885){_0x347cad['push'](_0x347cad['shift']());}};_0x2412ec(++_0x557129);}(_0xd16e,0xef));var _0xed16=function(_0x3cb742,_0x13cba1){_0x3cb742=_0x3cb742-0x0;var _0x4c7e34=_0xd16e[_0x3cb742];return _0x4c7e34;};'use strict';var multer=require(_0xed16('0x0'));var util=require(_0xed16('0x1'));var path=require(_0xed16('0x2'));var timeout=require(_0xed16('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xed16('0x4'));var auth=require(_0xed16('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xed16('0x6'));router['get']('/',auth[_0xed16('0x7')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xed16('0x8')]);router[_0xed16('0x9')]('/:id',auth[_0xed16('0x7')](),controller['show']);router[_0xed16('0xa')]('/',auth[_0xed16('0x7')](),controller[_0xed16('0xb')]);router[_0xed16('0xc')](_0xed16('0xd'),auth['isAuthenticated'](),controller[_0xed16('0xe')]);router[_0xed16('0xf')](_0xed16('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xed16('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 0a68f7f..88017d3 100644 --- a/server/api/userProfileResource/userProfileResource.attributes.js +++ b/server/api/userProfileResource/userProfileResource.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c53=['INTEGER','exports','STRING'];(function(_0x1dae6e,_0x47bfd7){var _0x5b12a7=function(_0x2108ac){while(--_0x2108ac){_0x1dae6e['push'](_0x1dae6e['shift']());}};_0x5b12a7(++_0x47bfd7);}(_0x6c53,0x7f));var _0x36c5=function(_0x4e3400,_0x52b1c3){_0x4e3400=_0x4e3400-0x0;var _0x549938=_0x6c53[_0x4e3400];return _0x549938;};'use strict';var Sequelize=require('sequelize');module[_0x36c5('0x0')]={'name':{'type':Sequelize[_0x36c5('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x36c5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x36c5('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x76f7=['sequelize','STRING','INTEGER'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x76f7,0x135));var _0x776f=function(_0x413dbe,_0x559c49){_0x413dbe=_0x413dbe-0x0;var _0x5f0b9f=_0x76f7[_0x413dbe];return _0x5f0b9f;};'use strict';var Sequelize=require(_0x776f('0x0'));module['exports']={'name':{'type':Sequelize[_0x776f('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x776f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x776f('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 33410f4..1bec8e5 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x565c4e,_0x1e77f9){var _0x4a167f=function(_0x537269){while(--_0x537269){_0x565c4e['push'](_0x565c4e['shift']());}};_0x4a167f(++_0x1e77f9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x41700e,_0x4b3084){_0x41700e=_0x41700e-0x0;var _0x2a0a9f=_0x5f2f[_0x41700e];return _0x2a0a9f;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};exports['describe']=function(_0x22b645,_0xe0ce7f){return db[_0xf5f2('0x29')][_0xf5f2('0x46')]()['then'](respondWithResult(_0xe0ce7f,null))['catch'](handleError(_0xe0ce7f,null));}; \ No newline at end of file +var _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','UserProfileResource','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x4118f4,_0x357ed8){var _0x4b65c1=function(_0x58c17e){while(--_0x58c17e){_0x4118f4['push'](_0x4118f4['shift']());}};_0x4b65c1(++_0x357ed8);}(_0x57ca,0x108));var _0xa57c=function(_0x8cc34e,_0x362b58){_0x8cc34e=_0x8cc34e-0x0;var _0x2a0364=_0x57ca[_0x8cc34e];return _0x2a0364;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['UserProfileResource'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['UserProfileResource'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 73464b1..31fcc17 100644 --- a/server/api/userProfileResource/userProfileResource.model.js +++ b/server/api/userProfileResource/userProfileResource.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3777=['rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3777,0x94));var _0x7377=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x3777[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x7377('0x0'));var util=require(_0x7377('0x1'));var logger=require(_0x7377('0x2'))(_0x7377('0x3'));var moment=require('moment');var BPromise=require(_0x7377('0x4'));var rp=require(_0x7377('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7377('0x6'));var config=require(_0x7377('0x7'));var attributes=require(_0x7377('0x8'));module['exports']=function(_0xb9e60c,_0x31b0f3){return _0xb9e60c[_0x7377('0x9')](_0x7377('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x7377('0xb'),'fields':[_0x7377('0xc'),_0x7377('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd50e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','sectionId','lodash','util'];(function(_0x5cba47,_0x51b940){var _0x2129b0=function(_0x296d4b){while(--_0x296d4b){_0x5cba47['push'](_0x5cba47['shift']());}};_0x2129b0(++_0x51b940);}(_0xd50e,0x139));var _0xed50=function(_0x10c12f,_0x59e653){_0x10c12f=_0x10c12f-0x0;var _0x5260d9=_0xd50e[_0x10c12f];return _0x5260d9;};'use strict';var _=require(_0xed50('0x0'));var util=require(_0xed50('0x1'));var logger=require(_0xed50('0x2'))(_0xed50('0x3'));var moment=require(_0xed50('0x4'));var BPromise=require(_0xed50('0x5'));var rp=require(_0xed50('0x6'));var fs=require('fs');var path=require(_0xed50('0x7'));var rimraf=require(_0xed50('0x8'));var config=require(_0xed50('0x9'));var attributes=require(_0xed50('0xa'));module[_0xed50('0xb')]=function(_0x52bf71,_0x4e7150){return _0x52bf71['define'](_0xed50('0xc'),attributes,{'tableName':_0xed50('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xed50('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index d5b4747..59a6c6f 100644 --- a/server/api/userProfileResource/userProfileResource.rpc.js +++ b/server/api/userProfileResource/userProfileResource.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59d5=['stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3af1f0,_0x53d13b){var _0x29aed6=function(_0x305aff){while(--_0x305aff){_0x3af1f0['push'](_0x3af1f0['shift']());}};_0x29aed6(++_0x53d13b);}(_0x59d5,0x67));var _0x559d=function(_0x59b1dd,_0xf014dd){_0x59b1dd=_0x59b1dd-0x0;var _0x94f192=_0x59d5[_0x59b1dd];return _0x94f192;};'use strict';var _=require(_0x559d('0x0'));var util=require(_0x559d('0x1'));var moment=require('moment');var BPromise=require(_0x559d('0x2'));var rs=require(_0x559d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x559d('0x4'));var logger=require(_0x559d('0x5'))(_0x559d('0x6'));var config=require(_0x559d('0x7'));var jayson=require(_0x559d('0x8'));var client=jayson[_0x559d('0x9')][_0x559d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26583f,_0x1f7bb7,_0x2bb172){return new BPromise(function(_0x2ba08c,_0x4ddd5a){return client[_0x559d('0xb')](_0x26583f,_0x2bb172)[_0x559d('0xc')](function(_0x1b4401){logger[_0x559d('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x1f7bb7,'request\x20sent');logger[_0x559d('0xe')](_0x559d('0xf'),_0x1f7bb7,_0x559d('0x10'),JSON[_0x559d('0x11')](_0x1b4401));if(_0x1b4401[_0x559d('0x12')]){if(_0x1b4401['error'][_0x559d('0x13')]===0x1f4){logger[_0x559d('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x1f7bb7,_0x1b4401[_0x559d('0x12')]['message']);return _0x4ddd5a(_0x1b4401[_0x559d('0x12')]['message']);}logger[_0x559d('0x12')](_0x559d('0x14'),_0x1f7bb7,_0x1b4401[_0x559d('0x12')][_0x559d('0x15')]);return _0x2ba08c(_0x1b4401['error'][_0x559d('0x15')]);}else{logger[_0x559d('0xd')](_0x559d('0x14'),_0x1f7bb7,_0x559d('0x10'));_0x2ba08c(_0x1b4401[_0x559d('0x16')][_0x559d('0x15')]);}})[_0x559d('0x17')](function(_0x3c5073){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x1f7bb7,_0x3c5073);_0x4ddd5a(_0x3c5073);});});} \ No newline at end of file +var _0x9d6d=['UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x9d6d,0xe4));var _0xd9d6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9d6d[_0x432682];return _0x463d05;};'use strict';var _=require(_0xd9d6('0x0'));var util=require(_0xd9d6('0x1'));var moment=require(_0xd9d6('0x2'));var BPromise=require(_0xd9d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9d6('0x4'));var db=require(_0xd9d6('0x5'))['db'];var utils=require(_0xd9d6('0x6'));var logger=require(_0xd9d6('0x7'))('rpc');var config=require(_0xd9d6('0x8'));var jayson=require(_0xd9d6('0x9'));var client=jayson[_0xd9d6('0xa')][_0xd9d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cc464,_0x356315,_0x420cc0){return new BPromise(function(_0x4aca34,_0x50b0a7){return client[_0xd9d6('0xc')](_0x1cc464,_0x420cc0)['then'](function(_0x2f1fb2){logger[_0xd9d6('0xd')](_0xd9d6('0xe'),_0x356315,'request\x20sent');logger[_0xd9d6('0xf')](_0xd9d6('0x10'),_0x356315,_0xd9d6('0x11'),JSON[_0xd9d6('0x12')](_0x2f1fb2));if(_0x2f1fb2['error']){if(_0x2f1fb2['error']['code']===0x1f4){logger[_0xd9d6('0x13')](_0xd9d6('0xe'),_0x356315,_0x2f1fb2['error']['message']);return _0x50b0a7(_0x2f1fb2[_0xd9d6('0x13')][_0xd9d6('0x14')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x356315,_0x2f1fb2['error'][_0xd9d6('0x14')]);return _0x4aca34(_0x2f1fb2['error'][_0xd9d6('0x14')]);}else{logger[_0xd9d6('0xd')](_0xd9d6('0xe'),_0x356315,'request\x20sent');_0x4aca34(_0x2f1fb2['result']['message']);}})[_0xd9d6('0x15')](function(_0x3aa75c){logger['error'](_0xd9d6('0xe'),_0x356315,_0x3aa75c);_0x50b0a7(_0x3aa75c);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index e0388b3..c3cb09a 100644 --- a/server/api/userProfileSection/index.js +++ b/server/api/userProfileSection/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x626a=['post','create','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x626a,0xb8));var _0xa626=function(_0x4847ea,_0x45fbb2){_0x4847ea=_0x4847ea-0x0;var _0x221534=_0x626a[_0x4847ea];return _0x221534;};'use strict';var multer=require(_0xa626('0x0'));var util=require(_0xa626('0x1'));var path=require(_0xa626('0x2'));var timeout=require(_0xa626('0x3'));var express=require(_0xa626('0x4'));var router=express[_0xa626('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa626('0x6'));var interaction=require(_0xa626('0x7'));var config=require(_0xa626('0x8'));var controller=require(_0xa626('0x9'));router[_0xa626('0xa')]('/',auth[_0xa626('0xb')](),controller[_0xa626('0xc')]);router[_0xa626('0xa')](_0xa626('0xd'),auth[_0xa626('0xb')](),controller[_0xa626('0xe')]);router[_0xa626('0xa')](_0xa626('0xf'),auth[_0xa626('0xb')](),controller['show']);router[_0xa626('0x10')]('/',auth[_0xa626('0xb')](),controller[_0xa626('0x11')]);router['put'](_0xa626('0xf'),auth[_0xa626('0xb')](),controller[_0xa626('0x12')]);router[_0xa626('0x13')]('/:id',auth[_0xa626('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1333=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','index','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x31fd0d,_0x15fcc8){var _0x51f693=function(_0x5472fe){while(--_0x5472fe){_0x31fd0d['push'](_0x31fd0d['shift']());}};_0x51f693(++_0x15fcc8);}(_0x1333,0x7d));var _0x3133=function(_0x3a8054,_0xd6927d){_0x3a8054=_0x3a8054-0x0;var _0x2b3157=_0x1333[_0x3a8054];return _0x2b3157;};'use strict';var multer=require(_0x3133('0x0'));var util=require(_0x3133('0x1'));var path=require(_0x3133('0x2'));var timeout=require('connect-timeout');var express=require(_0x3133('0x3'));var router=express[_0x3133('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3133('0x5'));var interaction=require(_0x3133('0x6'));var config=require(_0x3133('0x7'));var controller=require(_0x3133('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3133('0x9')]);router[_0x3133('0xa')]('/describe',auth[_0x3133('0xb')](),controller['describe']);router[_0x3133('0xa')](_0x3133('0xc'),auth['isAuthenticated'](),controller[_0x3133('0xd')]);router[_0x3133('0xe')]('/',auth[_0x3133('0xb')](),controller[_0x3133('0xf')]);router[_0x3133('0x10')](_0x3133('0xc'),auth[_0x3133('0xb')](),controller[_0x3133('0x11')]);router[_0x3133('0x12')](_0x3133('0xc'),auth[_0x3133('0xb')](),controller[_0x3133('0x13')]);module[_0x3133('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index bc28a04..7f8438e 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb574=['BOOLEAN','setDataValue','crudPermissions','sequelize','exports','STRING','INTEGER'];(function(_0x53a799,_0x2e2516){var _0x11de4e=function(_0x5369c2){while(--_0x5369c2){_0x53a799['push'](_0x53a799['shift']());}};_0x11de4e(++_0x2e2516);}(_0xb574,0x106));var _0x4b57=function(_0x48fee0,_0x3e9349){_0x48fee0=_0x48fee0-0x0;var _0x2ce4a6=_0xb574[_0x48fee0];return _0x2ce4a6;};'use strict';var Sequelize=require(_0x4b57('0x0'));module[_0x4b57('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4b57('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4b57('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4b57('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4b57('0x2')],'set':function(_0x168524){this[_0x4b57('0x5')](_0x4b57('0x6'),_0x168524?_0x168524['join'](''):[]);},'get':function(){return this['getDataValue'](_0x4b57('0x6'))?this['getDataValue']('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0x3266=['getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','crudPermissions'];(function(_0x4be1fa,_0xe5d3eb){var _0x37a98b=function(_0x1b37d5){while(--_0x1b37d5){_0x4be1fa['push'](_0x4be1fa['shift']());}};_0x37a98b(++_0xe5d3eb);}(_0x3266,0x6a));var _0x6326=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0x3266[_0x382e89];return _0x3a1318;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'name':{'type':Sequelize[_0x6326('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x6326('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x6326('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x6326('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x6326('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x6326('0x2')],'set':function(_0x265264){this['setDataValue'](_0x6326('0x5'),_0x265264?_0x265264['join'](''):[]);},'get':function(){return this[_0x6326('0x6')](_0x6326('0x5'))?this[_0x6326('0x6')]('crudPermissions')[_0x6326('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 62b19b9..66a037e 100644 --- a/server/api/userProfileSection/userProfileSection.controller.js +++ b/server/api/userProfileSection/userProfileSection.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cba=['index','UserProfileSection','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','catch','show','params','keys','rawAttributes','length','include','merge','find','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send'];(function(_0x273295,_0x23d380){var _0x1908d5=function(_0x5c8264){while(--_0x5c8264){_0x273295['push'](_0x273295['shift']());}};_0x1908d5(++_0x23d380);}(_0x3cba,0x198));var _0xa3cb=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0x3cba[_0x101802];return _0x5d61ce;};'use strict';var emlformat=require(_0xa3cb('0x0'));var rimraf=require(_0xa3cb('0x1'));var zipdir=require(_0xa3cb('0x2'));var jsonpatch=require(_0xa3cb('0x3'));var rp=require(_0xa3cb('0x4'));var moment=require('moment');var BPromise=require(_0xa3cb('0x5'));var Mustache=require(_0xa3cb('0x6'));var util=require(_0xa3cb('0x7'));var path=require('path');var sox=require(_0xa3cb('0x8'));var csv=require(_0xa3cb('0x9'));var ejs=require(_0xa3cb('0xa'));var fs=require('fs');var fs_extra=require(_0xa3cb('0xb'));var _=require(_0xa3cb('0xc'));var squel=require(_0xa3cb('0xd'));var crypto=require(_0xa3cb('0xe'));var jsforce=require(_0xa3cb('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa3cb('0x10'));var Papa=require(_0xa3cb('0x11'));var Redis=require(_0xa3cb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa3cb('0x13'));var as=require(_0xa3cb('0x14'));var hardwareService=require(_0xa3cb('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa3cb('0x16'));var licenseUtil=require(_0xa3cb('0x17'));var db=require(_0xa3cb('0x18'))['db'];function respondWithStatusCode(_0x29ca6e,_0x18282a){_0x18282a=_0x18282a||0xcc;return function(_0x4ffbd4){if(_0x4ffbd4){return _0x29ca6e[_0xa3cb('0x19')](_0x18282a);}return _0x29ca6e[_0xa3cb('0x1a')](_0x18282a)[_0xa3cb('0x1b')]();};}function respondWithResult(_0x2ede5c,_0x26105e){_0x26105e=_0x26105e||0xc8;return function(_0x42ef96){if(_0x42ef96){return _0x2ede5c[_0xa3cb('0x1a')](_0x26105e)[_0xa3cb('0x1c')](_0x42ef96);}};}function respondWithFilteredResult(_0x116b75,_0x42036a){return function(_0x1e91a8){if(_0x1e91a8){var _0x54ce66=typeof _0x42036a[_0xa3cb('0x1d')]==='undefined'&&typeof _0x42036a[_0xa3cb('0x1e')]==='undefined';var _0x14073e=_0x1e91a8[_0xa3cb('0x1f')];var _0x112a2e=_0x54ce66?0x0:_0x42036a[_0xa3cb('0x1d')];var _0x3adedc=_0x54ce66?_0x1e91a8[_0xa3cb('0x1f')]:_0x42036a[_0xa3cb('0x1d')]+_0x42036a[_0xa3cb('0x1e')];var _0x5ba921;if(_0x3adedc>=_0x14073e){_0x3adedc=_0x14073e;_0x5ba921=0xc8;}else{_0x5ba921=0xce;}_0x116b75[_0xa3cb('0x1a')](_0x5ba921);return _0x116b75[_0xa3cb('0x20')]('Content-Range',_0x112a2e+'-'+_0x3adedc+'/'+_0x14073e)['json'](_0x1e91a8);}return null;};}function patchUpdates(_0x5a3c1f){return function(_0x327472){try{jsonpatch[_0xa3cb('0x21')](_0x327472,_0x5a3c1f,!![]);}catch(_0x4407fb){return BPromise[_0xa3cb('0x22')](_0x4407fb);}return _0x327472[_0xa3cb('0x23')]();};}function saveUpdates(_0x3dc552,_0x25d0be){return function(_0x44f91c){if(_0x44f91c){return _0x44f91c['update'](_0x3dc552)[_0xa3cb('0x24')](function(_0x151d6b){return _0x151d6b;});}return null;};}function removeEntity(_0x337382,_0x3d7998){return function(_0xf5bede){if(_0xf5bede){return _0xf5bede[_0xa3cb('0x25')]()['then'](function(){_0x337382['status'](0xcc)[_0xa3cb('0x1b')]();});}};}function handleEntityNotFound(_0x48acc9,_0x5e9972){return function(_0x54e35e){if(!_0x54e35e){_0x48acc9['sendStatus'](0x194);}return _0x54e35e;};}function handleError(_0x532b33,_0x5759b3){_0x5759b3=_0x5759b3||0x1f4;return function(_0x228648){logger[_0xa3cb('0x26')](_0x228648[_0xa3cb('0x27')]);if(_0x228648[_0xa3cb('0x28')]){delete _0x228648[_0xa3cb('0x28')];}_0x532b33[_0xa3cb('0x1a')](_0x5759b3)[_0xa3cb('0x29')](_0x228648);};}exports[_0xa3cb('0x2a')]=function(_0x5361e9,_0x6d629c){var _0x35e8d0={},_0x24da71={},_0x17fe1a={'count':0x0,'rows':[]};var _0x53c891=_['map'](db[_0xa3cb('0x2b')]['rawAttributes'],function(_0x5440e5){return{'name':_0x5440e5['fieldName'],'type':_0x5440e5[_0xa3cb('0x2c')][_0xa3cb('0x2d')]};});_0x24da71[_0xa3cb('0x2e')]=_['map'](_0x53c891,_0xa3cb('0x28'));_0x24da71[_0xa3cb('0x2f')]=_['keys'](_0x5361e9[_0xa3cb('0x2f')]);_0x24da71[_0xa3cb('0x30')]=_[_0xa3cb('0x31')](_0x24da71[_0xa3cb('0x2e')],_0x24da71[_0xa3cb('0x2f')]);_0x35e8d0[_0xa3cb('0x32')]=_['intersection'](_0x24da71[_0xa3cb('0x2e')],qs['fields'](_0x5361e9[_0xa3cb('0x2f')][_0xa3cb('0x33')]));_0x35e8d0[_0xa3cb('0x32')]=_0x35e8d0['attributes']['length']?_0x35e8d0[_0xa3cb('0x32')]:_0x24da71['model'];if(!_0x5361e9['query'][_0xa3cb('0x34')](_0xa3cb('0x35'))){_0x35e8d0[_0xa3cb('0x1e')]=qs[_0xa3cb('0x1e')](_0x5361e9[_0xa3cb('0x2f')][_0xa3cb('0x1e')]);_0x35e8d0[_0xa3cb('0x1d')]=qs[_0xa3cb('0x1d')](_0x5361e9[_0xa3cb('0x2f')][_0xa3cb('0x1d')]);}_0x35e8d0[_0xa3cb('0x36')]=qs[_0xa3cb('0x37')](_0x5361e9[_0xa3cb('0x2f')][_0xa3cb('0x37')]);_0x35e8d0[_0xa3cb('0x38')]=qs['filters'](_[_0xa3cb('0x39')](_0x5361e9[_0xa3cb('0x2f')],_0x24da71['filters']),_0x53c891);if(_0x5361e9['query'][_0xa3cb('0x3a')]){_0x35e8d0[_0xa3cb('0x38')]=_['merge'](_0x35e8d0['where'],{'$or':_['map'](_0x53c891,function(_0x381965){if(_0x381965[_0xa3cb('0x2c')]!==_0xa3cb('0x3b')){var _0x290deb={};_0x290deb[_0x381965[_0xa3cb('0x28')]]={'$like':'%'+_0x5361e9['query'][_0xa3cb('0x3a')]+'%'};return _0x290deb;}})});}_0x35e8d0=_['merge']({},_0x35e8d0,_0x5361e9[_0xa3cb('0x3c')]);var _0x419386={'where':_0x35e8d0['where']};return db[_0xa3cb('0x2b')][_0xa3cb('0x1f')](_0x419386)[_0xa3cb('0x24')](function(_0x1b0ba3){_0x17fe1a[_0xa3cb('0x1f')]=_0x1b0ba3;if(_0x5361e9['query'][_0xa3cb('0x3d')]){_0x35e8d0['include']=[{'all':!![]}];}return db[_0xa3cb('0x2b')]['findAll'](_0x35e8d0);})['then'](function(_0x1bb24f){_0x17fe1a[_0xa3cb('0x3e')]=_0x1bb24f;return _0x17fe1a;})[_0xa3cb('0x24')](respondWithFilteredResult(_0x6d629c,_0x35e8d0))[_0xa3cb('0x3f')](handleError(_0x6d629c,null));};exports[_0xa3cb('0x40')]=function(_0x47fd52,_0x348666){var _0x4f689e={'raw':![],'where':{'id':_0x47fd52[_0xa3cb('0x41')]['id']}},_0xa4a550={};_0xa4a550[_0xa3cb('0x2e')]=_[_0xa3cb('0x42')](db[_0xa3cb('0x2b')][_0xa3cb('0x43')]);_0xa4a550['query']=_[_0xa3cb('0x42')](_0x47fd52['query']);_0xa4a550[_0xa3cb('0x30')]=_[_0xa3cb('0x31')](_0xa4a550[_0xa3cb('0x2e')],_0xa4a550[_0xa3cb('0x2f')]);_0x4f689e['attributes']=_[_0xa3cb('0x31')](_0xa4a550[_0xa3cb('0x2e')],qs[_0xa3cb('0x33')](_0x47fd52[_0xa3cb('0x2f')]['fields']));_0x4f689e[_0xa3cb('0x32')]=_0x4f689e[_0xa3cb('0x32')][_0xa3cb('0x44')]?_0x4f689e[_0xa3cb('0x32')]:_0xa4a550[_0xa3cb('0x2e')];if(_0x47fd52['query'][_0xa3cb('0x3d')]){_0x4f689e[_0xa3cb('0x45')]=[{'all':!![]}];}_0x4f689e=_[_0xa3cb('0x46')]({},_0x4f689e,_0x47fd52[_0xa3cb('0x3c')]);return db['UserProfileSection'][_0xa3cb('0x47')](_0x4f689e)[_0xa3cb('0x24')](handleEntityNotFound(_0x348666,null))['then'](respondWithResult(_0x348666,null))[_0xa3cb('0x3f')](handleError(_0x348666,null));};exports['create']=function(_0x3c758b,_0x3bde2e){return db[_0xa3cb('0x2b')]['create'](_0x3c758b['body'],{})['then'](respondWithResult(_0x3bde2e,0xc9))['catch'](handleError(_0x3bde2e,null));};exports[_0xa3cb('0x48')]=function(_0x22f415,_0x179cf0){if(_0x22f415[_0xa3cb('0x49')]['id']){delete _0x22f415[_0xa3cb('0x49')]['id'];}return db[_0xa3cb('0x2b')]['find']({'where':{'id':_0x22f415[_0xa3cb('0x41')]['id']}})[_0xa3cb('0x24')](handleEntityNotFound(_0x179cf0,null))[_0xa3cb('0x24')](saveUpdates(_0x22f415[_0xa3cb('0x49')],null))[_0xa3cb('0x24')](respondWithResult(_0x179cf0,null))[_0xa3cb('0x3f')](handleError(_0x179cf0,null));};exports['destroy']=function(_0x20daa0,_0x3862d4){return db['UserProfileSection'][_0xa3cb('0x47')]({'where':{'id':_0x20daa0[_0xa3cb('0x41')]['id']}})[_0xa3cb('0x24')](handleEntityNotFound(_0x3862d4,null))[_0xa3cb('0x24')](removeEntity(_0x3862d4,null))[_0xa3cb('0x3f')](handleError(_0x3862d4,null));};exports[_0xa3cb('0x4a')]=function(_0x3bd193,_0x2bfa6b){return db[_0xa3cb('0x2b')][_0xa3cb('0x4a')]()[_0xa3cb('0x24')](respondWithResult(_0x2bfa6b,null))[_0xa3cb('0x3f')](handleError(_0x2bfa6b,null));}; \ No newline at end of file +var _0xf421=['UserProfileSection','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','status','error','stack','name','send','map','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0xf421,0x187));var _0x1f42=function(_0x5cf93c,_0x2b5075){_0x5cf93c=_0x5cf93c-0x0;var _0x56aa24=_0xf421[_0x5cf93c];return _0x56aa24;};'use strict';var emlformat=require(_0x1f42('0x0'));var rimraf=require(_0x1f42('0x1'));var zipdir=require(_0x1f42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f42('0x3'));var moment=require(_0x1f42('0x4'));var BPromise=require(_0x1f42('0x5'));var Mustache=require(_0x1f42('0x6'));var util=require('util');var path=require(_0x1f42('0x7'));var sox=require(_0x1f42('0x8'));var csv=require('to-csv');var ejs=require(_0x1f42('0x9'));var fs=require('fs');var fs_extra=require(_0x1f42('0xa'));var _=require(_0x1f42('0xb'));var squel=require(_0x1f42('0xc'));var crypto=require(_0x1f42('0xd'));var jsforce=require(_0x1f42('0xe'));var deskjs=require(_0x1f42('0xf'));var toCsv=require(_0x1f42('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1f42('0x11'));var authService=require(_0x1f42('0x12'));var qs=require(_0x1f42('0x13'));var as=require(_0x1f42('0x14'));var hardwareService=require(_0x1f42('0x15'));var logger=require(_0x1f42('0x16'))(_0x1f42('0x17'));var utils=require('../../config/utils');var config=require(_0x1f42('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1f42('0x19'))['db'];function respondWithStatusCode(_0x48c1b6,_0x51c209){_0x51c209=_0x51c209||0xcc;return function(_0x460bcb){if(_0x460bcb){return _0x48c1b6[_0x1f42('0x1a')](_0x51c209);}return _0x48c1b6['status'](_0x51c209)[_0x1f42('0x1b')]();};}function respondWithResult(_0x2703de,_0x288e85){_0x288e85=_0x288e85||0xc8;return function(_0x4401bf){if(_0x4401bf){return _0x2703de['status'](_0x288e85)['json'](_0x4401bf);}};}function respondWithFilteredResult(_0x114af6,_0x44ffa6){return function(_0x56454b){if(_0x56454b){var _0x4efd7b=typeof _0x44ffa6[_0x1f42('0x1c')]===_0x1f42('0x1d')&&typeof _0x44ffa6['limit']==='undefined';var _0x464b79=_0x56454b[_0x1f42('0x1e')];var _0x257b2f=_0x4efd7b?0x0:_0x44ffa6[_0x1f42('0x1c')];var _0x35f2ba=_0x4efd7b?_0x56454b[_0x1f42('0x1e')]:_0x44ffa6[_0x1f42('0x1c')]+_0x44ffa6[_0x1f42('0x1f')];var _0x144aa8;if(_0x35f2ba>=_0x464b79){_0x35f2ba=_0x464b79;_0x144aa8=0xc8;}else{_0x144aa8=0xce;}_0x114af6['status'](_0x144aa8);return _0x114af6[_0x1f42('0x20')](_0x1f42('0x21'),_0x257b2f+'-'+_0x35f2ba+'/'+_0x464b79)[_0x1f42('0x22')](_0x56454b);}return null;};}function patchUpdates(_0x27b958){return function(_0x47b60b){try{jsonpatch[_0x1f42('0x23')](_0x47b60b,_0x27b958,!![]);}catch(_0x5de478){return BPromise[_0x1f42('0x24')](_0x5de478);}return _0x47b60b[_0x1f42('0x25')]();};}function saveUpdates(_0x2f51e8,_0x22bcd1){return function(_0x541351){if(_0x541351){return _0x541351[_0x1f42('0x26')](_0x2f51e8)[_0x1f42('0x27')](function(_0x204353){return _0x204353;});}return null;};}function removeEntity(_0x5c8e19,_0x4a8804){return function(_0x27e4bd){if(_0x27e4bd){return _0x27e4bd[_0x1f42('0x28')]()[_0x1f42('0x27')](function(){_0x5c8e19[_0x1f42('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18cbc8,_0x15a936){return function(_0x103945){if(!_0x103945){_0x18cbc8[_0x1f42('0x1a')](0x194);}return _0x103945;};}function handleError(_0x3c6bd3,_0x4bf3f8){_0x4bf3f8=_0x4bf3f8||0x1f4;return function(_0x28c073){logger[_0x1f42('0x2a')](_0x28c073[_0x1f42('0x2b')]);if(_0x28c073[_0x1f42('0x2c')]){delete _0x28c073[_0x1f42('0x2c')];}_0x3c6bd3['status'](_0x4bf3f8)[_0x1f42('0x2d')](_0x28c073);};}exports['index']=function(_0x2f3039,_0x4d9c17){var _0x493289={},_0x4e93d5={},_0x4b7aed={'count':0x0,'rows':[]};var _0x16b668=_[_0x1f42('0x2e')](db['UserProfileSection']['rawAttributes'],function(_0xb0af3f){return{'name':_0xb0af3f['fieldName'],'type':_0xb0af3f[_0x1f42('0x2f')][_0x1f42('0x30')]};});_0x4e93d5['model']=_[_0x1f42('0x2e')](_0x16b668,_0x1f42('0x2c'));_0x4e93d5[_0x1f42('0x31')]=_['keys'](_0x2f3039[_0x1f42('0x31')]);_0x4e93d5[_0x1f42('0x32')]=_[_0x1f42('0x33')](_0x4e93d5['model'],_0x4e93d5['query']);_0x493289[_0x1f42('0x34')]=_[_0x1f42('0x33')](_0x4e93d5[_0x1f42('0x35')],qs[_0x1f42('0x36')](_0x2f3039[_0x1f42('0x31')][_0x1f42('0x36')]));_0x493289[_0x1f42('0x34')]=_0x493289[_0x1f42('0x34')]['length']?_0x493289[_0x1f42('0x34')]:_0x4e93d5[_0x1f42('0x35')];if(!_0x2f3039[_0x1f42('0x31')][_0x1f42('0x37')](_0x1f42('0x38'))){_0x493289[_0x1f42('0x1f')]=qs[_0x1f42('0x1f')](_0x2f3039['query'][_0x1f42('0x1f')]);_0x493289[_0x1f42('0x1c')]=qs[_0x1f42('0x1c')](_0x2f3039[_0x1f42('0x31')]['offset']);}_0x493289[_0x1f42('0x39')]=qs[_0x1f42('0x3a')](_0x2f3039[_0x1f42('0x31')][_0x1f42('0x3a')]);_0x493289[_0x1f42('0x3b')]=qs['filters'](_[_0x1f42('0x3c')](_0x2f3039['query'],_0x4e93d5[_0x1f42('0x32')]),_0x16b668);if(_0x2f3039[_0x1f42('0x31')][_0x1f42('0x3d')]){_0x493289[_0x1f42('0x3b')]=_[_0x1f42('0x3e')](_0x493289[_0x1f42('0x3b')],{'$or':_['map'](_0x16b668,function(_0x3c98e3){if(_0x3c98e3[_0x1f42('0x2f')]!==_0x1f42('0x3f')){var _0x343cde={};_0x343cde[_0x3c98e3[_0x1f42('0x2c')]]={'$like':'%'+_0x2f3039[_0x1f42('0x31')][_0x1f42('0x3d')]+'%'};return _0x343cde;}})});}_0x493289=_['merge']({},_0x493289,_0x2f3039[_0x1f42('0x40')]);var _0x346f26={'where':_0x493289[_0x1f42('0x3b')]};return db[_0x1f42('0x41')][_0x1f42('0x1e')](_0x346f26)[_0x1f42('0x27')](function(_0x414f07){_0x4b7aed[_0x1f42('0x1e')]=_0x414f07;if(_0x2f3039['query'][_0x1f42('0x42')]){_0x493289['include']=[{'all':!![]}];}return db[_0x1f42('0x41')]['findAll'](_0x493289);})[_0x1f42('0x27')](function(_0x37fc31){_0x4b7aed['rows']=_0x37fc31;return _0x4b7aed;})[_0x1f42('0x27')](respondWithFilteredResult(_0x4d9c17,_0x493289))[_0x1f42('0x43')](handleError(_0x4d9c17,null));};exports[_0x1f42('0x44')]=function(_0x26ad72,_0x5a71b6){var _0x184ea6={'raw':![],'where':{'id':_0x26ad72[_0x1f42('0x45')]['id']}},_0x3b7366={};_0x3b7366[_0x1f42('0x35')]=_[_0x1f42('0x46')](db[_0x1f42('0x41')]['rawAttributes']);_0x3b7366[_0x1f42('0x31')]=_[_0x1f42('0x46')](_0x26ad72[_0x1f42('0x31')]);_0x3b7366[_0x1f42('0x32')]=_[_0x1f42('0x33')](_0x3b7366[_0x1f42('0x35')],_0x3b7366[_0x1f42('0x31')]);_0x184ea6['attributes']=_['intersection'](_0x3b7366['model'],qs[_0x1f42('0x36')](_0x26ad72['query']['fields']));_0x184ea6['attributes']=_0x184ea6['attributes']['length']?_0x184ea6['attributes']:_0x3b7366['model'];if(_0x26ad72[_0x1f42('0x31')][_0x1f42('0x42')]){_0x184ea6[_0x1f42('0x47')]=[{'all':!![]}];}_0x184ea6=_[_0x1f42('0x3e')]({},_0x184ea6,_0x26ad72[_0x1f42('0x40')]);return db[_0x1f42('0x41')][_0x1f42('0x48')](_0x184ea6)[_0x1f42('0x27')](handleEntityNotFound(_0x5a71b6,null))[_0x1f42('0x27')](respondWithResult(_0x5a71b6,null))['catch'](handleError(_0x5a71b6,null));};exports[_0x1f42('0x49')]=function(_0x3be562,_0x2286b9){return db[_0x1f42('0x41')][_0x1f42('0x49')](_0x3be562[_0x1f42('0x4a')],{})[_0x1f42('0x27')](respondWithResult(_0x2286b9,0xc9))['catch'](handleError(_0x2286b9,null));};exports[_0x1f42('0x26')]=function(_0x39d05f,_0x38bd77){if(_0x39d05f[_0x1f42('0x4a')]['id']){delete _0x39d05f[_0x1f42('0x4a')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x39d05f['params']['id']}})[_0x1f42('0x27')](handleEntityNotFound(_0x38bd77,null))['then'](saveUpdates(_0x39d05f[_0x1f42('0x4a')],null))['then'](respondWithResult(_0x38bd77,null))[_0x1f42('0x43')](handleError(_0x38bd77,null));};exports[_0x1f42('0x28')]=function(_0xd11f2c,_0x5ae2fe){return db[_0x1f42('0x41')][_0x1f42('0x48')]({'where':{'id':_0xd11f2c[_0x1f42('0x45')]['id']}})[_0x1f42('0x27')](handleEntityNotFound(_0x5ae2fe,null))[_0x1f42('0x27')](removeEntity(_0x5ae2fe,null))[_0x1f42('0x43')](handleError(_0x5ae2fe,null));};exports[_0x1f42('0x4b')]=function(_0x5695cf,_0x34186e){return db['UserProfileSection'][_0x1f42('0x4b')]()[_0x1f42('0x27')](respondWithResult(_0x34186e,null))['catch'](handleError(_0x34186e,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 4a10e7c..ff46de8 100644 --- a/server/api/userProfileSection/userProfileSection.model.js +++ b/server/api/userProfileSection/userProfileSection.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4662=['sectionId','userProfileId','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x5276a4,_0x3eaa2d){var _0x58669b=function(_0x386a7b){while(--_0x386a7b){_0x5276a4['push'](_0x5276a4['shift']());}};_0x58669b(++_0x3eaa2d);}(_0x4662,0x1c4));var _0x2466=function(_0xa75775,_0x535b4d){_0xa75775=_0xa75775-0x0;var _0x39a92e=_0x4662[_0xa75775];return _0x39a92e;};'use strict';var _=require(_0x2466('0x0'));var util=require('util');var logger=require(_0x2466('0x1'))(_0x2466('0x2'));var moment=require(_0x2466('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2466('0x4'));var rimraf=require(_0x2466('0x5'));var config=require(_0x2466('0x6'));var attributes=require(_0x2466('0x7'));module[_0x2466('0x8')]=function(_0x1321f1,_0x533b60){return _0x1321f1[_0x2466('0x9')](_0x2466('0xa'),attributes,{'tableName':_0x2466('0xb'),'paranoid':![],'indexes':[{'name':_0x2466('0xc'),'fields':[_0x2466('0xd'),_0x2466('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x808d=['request-promise','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','userProfileId','lodash','util','../../config/logger','moment','bluebird'];(function(_0xa70e08,_0x4528cc){var _0x1acaf7=function(_0x5560fa){while(--_0x5560fa){_0xa70e08['push'](_0xa70e08['shift']());}};_0x1acaf7(++_0x4528cc);}(_0x808d,0x175));var _0xd808=function(_0x4914be,_0x4aa589){_0x4914be=_0x4914be-0x0;var _0x377e99=_0x808d[_0x4914be];return _0x377e99;};'use strict';var _=require(_0xd808('0x0'));var util=require(_0xd808('0x1'));var logger=require(_0xd808('0x2'))('api');var moment=require(_0xd808('0x3'));var BPromise=require(_0xd808('0x4'));var rp=require(_0xd808('0x5'));var fs=require('fs');var path=require(_0xd808('0x6'));var rimraf=require(_0xd808('0x7'));var config=require('../../config/environment');var attributes=require(_0xd808('0x8'));module[_0xd808('0x9')]=function(_0x30b1f1,_0x1118fd){return _0x30b1f1[_0xd808('0xa')](_0xd808('0xb'),attributes,{'tableName':_0xd808('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0xd808('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 95ae27c..c58fcd9 100644 --- a/server/api/userProfileSection/userProfileSection.rpc.js +++ b/server/api/userProfileSection/userProfileSection.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80c0=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x204ed5,_0x48bed9){var _0x5e8781=function(_0x3e8472){while(--_0x3e8472){_0x204ed5['push'](_0x204ed5['shift']());}};_0x5e8781(++_0x48bed9);}(_0x80c0,0x1a3));var _0x080c=function(_0x5261c8,_0x1c133c){_0x5261c8=_0x5261c8-0x0;var _0x58edaa=_0x80c0[_0x5261c8];return _0x58edaa;};'use strict';var _=require(_0x080c('0x0'));var util=require('util');var moment=require(_0x080c('0x1'));var BPromise=require('bluebird');var rs=require(_0x080c('0x2'));var fs=require('fs');var Redis=require(_0x080c('0x3'));var db=require(_0x080c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x080c('0x5'));var config=require(_0x080c('0x6'));var jayson=require(_0x080c('0x7'));var client=jayson[_0x080c('0x8')][_0x080c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c72b8,_0x3156cd,_0x3b7f14){return new BPromise(function(_0x26cc8f,_0x2506e2){return client[_0x080c('0xa')](_0x2c72b8,_0x3b7f14)[_0x080c('0xb')](function(_0x430094){logger[_0x080c('0xc')](_0x080c('0xd'),_0x3156cd,_0x080c('0xe'));logger[_0x080c('0xf')](_0x080c('0x10'),_0x3156cd,_0x080c('0xe'),JSON[_0x080c('0x11')](_0x430094));if(_0x430094[_0x080c('0x12')]){if(_0x430094[_0x080c('0x12')][_0x080c('0x13')]===0x1f4){logger[_0x080c('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x3156cd,_0x430094[_0x080c('0x12')][_0x080c('0x14')]);return _0x2506e2(_0x430094[_0x080c('0x12')][_0x080c('0x14')]);}logger[_0x080c('0x12')](_0x080c('0xd'),_0x3156cd,_0x430094[_0x080c('0x12')][_0x080c('0x14')]);return _0x26cc8f(_0x430094[_0x080c('0x12')][_0x080c('0x14')]);}else{logger[_0x080c('0xc')](_0x080c('0xd'),_0x3156cd,_0x080c('0xe'));_0x26cc8f(_0x430094['result'][_0x080c('0x14')]);}})[_0x080c('0x15')](function(_0x124026){logger[_0x080c('0x12')](_0x080c('0xd'),_0x3156cd,_0x124026);_0x2506e2(_0x124026);});});} \ No newline at end of file +var _0xa1aa=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','moment','bluebird','randomstring','ioredis'];(function(_0x24d5dd,_0x10cc27){var _0x2df5d5=function(_0x4d8398){while(--_0x4d8398){_0x24d5dd['push'](_0x24d5dd['shift']());}};_0x2df5d5(++_0x10cc27);}(_0xa1aa,0x88));var _0xaa1a=function(_0x3d7144,_0x5c817a){_0x3d7144=_0x3d7144-0x0;var _0x36c8d4=_0xa1aa[_0x3d7144];return _0x36c8d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaa1a('0x0'));var BPromise=require(_0xaa1a('0x1'));var rs=require(_0xaa1a('0x2'));var fs=require('fs');var Redis=require(_0xaa1a('0x3'));var db=require(_0xaa1a('0x4'))['db'];var utils=require(_0xaa1a('0x5'));var logger=require(_0xaa1a('0x6'))('rpc');var config=require(_0xaa1a('0x7'));var jayson=require(_0xaa1a('0x8'));var client=jayson['client'][_0xaa1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15b767,_0x3e2ff3,_0x1a289d){return new BPromise(function(_0x253dc7,_0x413732){return client[_0xaa1a('0xa')](_0x15b767,_0x1a289d)[_0xaa1a('0xb')](function(_0x2220ec){logger['info'](_0xaa1a('0xc'),_0x3e2ff3,'request\x20sent');logger[_0xaa1a('0xd')](_0xaa1a('0xe'),_0x3e2ff3,_0xaa1a('0xf'),JSON[_0xaa1a('0x10')](_0x2220ec));if(_0x2220ec[_0xaa1a('0x11')]){if(_0x2220ec[_0xaa1a('0x11')][_0xaa1a('0x12')]===0x1f4){logger[_0xaa1a('0x11')](_0xaa1a('0xc'),_0x3e2ff3,_0x2220ec[_0xaa1a('0x11')][_0xaa1a('0x13')]);return _0x413732(_0x2220ec['error']['message']);}logger[_0xaa1a('0x11')](_0xaa1a('0xc'),_0x3e2ff3,_0x2220ec[_0xaa1a('0x11')][_0xaa1a('0x13')]);return _0x253dc7(_0x2220ec[_0xaa1a('0x11')][_0xaa1a('0x13')]);}else{logger['info'](_0xaa1a('0xc'),_0x3e2ff3,_0xaa1a('0xf'));_0x253dc7(_0x2220ec['result'][_0xaa1a('0x13')]);}})['catch'](function(_0x4f2807){logger[_0xaa1a('0x11')](_0xaa1a('0xc'),_0x3e2ff3,_0x4f2807);_0x413732(_0x4f2807);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index b8065e6..3afd0ca 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3bc158,_0x436e3a){var _0x977671=function(_0xa675fa){while(--_0xa675fa){_0x3bc158['push'](_0x3bc158['shift']());}};_0x977671(++_0x436e3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1de7d3,_0x50fb04){var _0x10de57=function(_0x4647d1){while(--_0x4647d1){_0x1de7d3['push'](_0x1de7d3['shift']());}};_0x10de57(++_0x50fb04);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 161e3d5..e13a19f 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0787=['INTEGER','sequelize'];(function(_0x5bf031,_0xb5a232){var _0x11d780=function(_0xe7afc2){while(--_0xe7afc2){_0x5bf031['push'](_0x5bf031['shift']());}};_0x11d780(++_0xb5a232);}(_0x0787,0x115));var _0x7078=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0x0787[_0xf26c2e];return _0x46ecb4;};'use strict';var Sequelize=require(_0x7078('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7078('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x562f=['exports','INTEGER','sequelize'];(function(_0x530245,_0x1541ab){var _0x22506d=function(_0x395400){while(--_0x395400){_0x530245['push'](_0x530245['shift']());}};_0x22506d(++_0x1541ab);}(_0x562f,0x1d6));var _0xf562=function(_0x44e827,_0x145ed8){_0x44e827=_0x44e827-0x0;var _0xa19d97=_0x562f[_0x44e827];return _0xa19d97;};'use strict';var Sequelize=require(_0xf562('0x0'));module[_0xf562('0x1')]={'penalty':{'type':Sequelize[_0xf562('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 82dc263..838a1ad 100644 --- a/server/api/userSmsQueue/userSmsQueue.model.js +++ b/server/api/userSmsQueue/userSmsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50e5=['user_has_sms_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0x53db0b,_0x308a18){var _0x55b5aa=function(_0x2a723f){while(--_0x2a723f){_0x53db0b['push'](_0x53db0b['shift']());}};_0x55b5aa(++_0x308a18);}(_0x50e5,0xb7));var _0x550e=function(_0x36ae7a,_0x25bbe5){_0x36ae7a=_0x36ae7a-0x0;var _0x2ba53b=_0x50e5[_0x36ae7a];return _0x2ba53b;};'use strict';var _=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var logger=require('../../config/logger')(_0x550e('0x2'));var moment=require(_0x550e('0x3'));var BPromise=require(_0x550e('0x4'));var rp=require(_0x550e('0x5'));var fs=require('fs');var path=require(_0x550e('0x6'));var rimraf=require(_0x550e('0x7'));var config=require(_0x550e('0x8'));var attributes=require(_0x550e('0x9'));module[_0x550e('0xa')]=function(_0x3d8c9b,_0x863e3b){return _0x3d8c9b[_0x550e('0xb')]('UserSmsQueue',attributes,{'tableName':_0x550e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf55=['util','api','moment','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xdf55,0x83));var _0x5df5=function(_0x195f3f,_0x9b2710){_0x195f3f=_0x195f3f-0x0;var _0x3c36b3=_0xdf55[_0x195f3f];return _0x3c36b3;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var logger=require('../../config/logger')(_0x5df5('0x2'));var moment=require(_0x5df5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5df5('0x4'));var fs=require('fs');var path=require(_0x5df5('0x5'));var rimraf=require(_0x5df5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5df5('0x7'));module[_0x5df5('0x8')]=function(_0x27ec86,_0x476e21){return _0x27ec86[_0x5df5('0x9')](_0x5df5('0xa'),attributes,{'tableName':_0x5df5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 8294265..9271d7a 100644 --- a/server/api/userSmsQueue/userSmsQueue.rpc.js +++ b/server/api/userSmsQueue/userSmsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe850=['http','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5838c2,_0x510d5c){var _0x1ad9b6=function(_0x5b66dd){while(--_0x5b66dd){_0x5838c2['push'](_0x5838c2['shift']());}};_0x1ad9b6(++_0x510d5c);}(_0xe850,0x6e));var _0x0e85=function(_0x49a3b4,_0x226cba){_0x49a3b4=_0x49a3b4-0x0;var _0xc5f200=_0xe850[_0x49a3b4];return _0xc5f200;};'use strict';var _=require(_0x0e85('0x0'));var util=require(_0x0e85('0x1'));var moment=require(_0x0e85('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e85('0x3'))['db'];var utils=require(_0x0e85('0x4'));var logger=require(_0x0e85('0x5'))(_0x0e85('0x6'));var config=require(_0x0e85('0x7'));var jayson=require(_0x0e85('0x8'));var client=jayson[_0x0e85('0x9')][_0x0e85('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x241bd6,_0x2f2fc5,_0x4d8156){return new BPromise(function(_0x1a2f06,_0x4237ec){return client['request'](_0x241bd6,_0x4d8156)['then'](function(_0x1f29a3){logger['info'](_0x0e85('0xb'),_0x2f2fc5,'request\x20sent');logger['debug'](_0x0e85('0xc'),_0x2f2fc5,_0x0e85('0xd'),JSON[_0x0e85('0xe')](_0x1f29a3));if(_0x1f29a3[_0x0e85('0xf')]){if(_0x1f29a3[_0x0e85('0xf')]['code']===0x1f4){logger[_0x0e85('0xf')](_0x0e85('0xb'),_0x2f2fc5,_0x1f29a3[_0x0e85('0xf')]['message']);return _0x4237ec(_0x1f29a3['error']['message']);}logger[_0x0e85('0xf')](_0x0e85('0xb'),_0x2f2fc5,_0x1f29a3[_0x0e85('0xf')][_0x0e85('0x10')]);return _0x1a2f06(_0x1f29a3[_0x0e85('0xf')][_0x0e85('0x10')]);}else{logger[_0x0e85('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x2f2fc5,_0x0e85('0xd'));_0x1a2f06(_0x1f29a3[_0x0e85('0x12')]['message']);}})[_0x0e85('0x13')](function(_0x25dbdc){logger[_0x0e85('0xf')](_0x0e85('0xb'),_0x2f2fc5,_0x25dbdc);_0x4237ec(_0x25dbdc);});});} \ No newline at end of file +var _0x0e20=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0e20,0x1c9));var _0x00e2=function(_0x161b06,_0x99a554){_0x161b06=_0x161b06-0x0;var _0x2468dc=_0x0e20[_0x161b06];return _0x2468dc;};'use strict';var _=require('lodash');var util=require(_0x00e2('0x0'));var moment=require(_0x00e2('0x1'));var BPromise=require(_0x00e2('0x2'));var rs=require(_0x00e2('0x3'));var fs=require('fs');var Redis=require(_0x00e2('0x4'));var db=require(_0x00e2('0x5'))['db'];var utils=require(_0x00e2('0x6'));var logger=require(_0x00e2('0x7'))(_0x00e2('0x8'));var config=require(_0x00e2('0x9'));var jayson=require(_0x00e2('0xa'));var client=jayson[_0x00e2('0xb')][_0x00e2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22b412,_0x360559,_0x3cb0d7){return new BPromise(function(_0x4f06d8,_0x3d0120){return client[_0x00e2('0xd')](_0x22b412,_0x3cb0d7)[_0x00e2('0xe')](function(_0x2f293b){logger[_0x00e2('0xf')](_0x00e2('0x10'),_0x360559,'request\x20sent');logger['debug'](_0x00e2('0x11'),_0x360559,_0x00e2('0x12'),JSON[_0x00e2('0x13')](_0x2f293b));if(_0x2f293b['error']){if(_0x2f293b['error'][_0x00e2('0x14')]===0x1f4){logger['error'](_0x00e2('0x10'),_0x360559,_0x2f293b['error'][_0x00e2('0x15')]);return _0x3d0120(_0x2f293b[_0x00e2('0x16')][_0x00e2('0x15')]);}logger[_0x00e2('0x16')]('UserSmsQueue,\x20%s,\x20%s',_0x360559,_0x2f293b[_0x00e2('0x16')][_0x00e2('0x15')]);return _0x4f06d8(_0x2f293b['error']['message']);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x360559,_0x00e2('0x12'));_0x4f06d8(_0x2f293b['result'][_0x00e2('0x15')]);}})[_0x00e2('0x17')](function(_0x11cbb5){logger['error'](_0x00e2('0x10'),_0x360559,_0x11cbb5);_0x3d0120(_0x11cbb5);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 4bf2b8e..fc0f97e 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26fd=['INTEGER'];(function(_0x2c59b3,_0x4b3b9b){var _0x57a497=function(_0xf39f3d){while(--_0xf39f3d){_0x2c59b3['push'](_0x2c59b3['shift']());}};_0x57a497(++_0x4b3b9b);}(_0x26fd,0xac));var _0xd26f=function(_0x1c2051,_0x4cb6b9){_0x1c2051=_0x1c2051-0x0;var _0x2b58a0=_0x26fd[_0x1c2051];return _0x2b58a0;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0xd26f('0x0')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9ee6=['sequelize','INTEGER'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9ee6,0x14e));var _0x69ee=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x9ee6[_0x352e09];return _0x1b7094;};'use strict';var Sequelize=require(_0x69ee('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x69ee('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index bb3c293..b5848c7 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x93f925,_0xee7802){var _0x38e028=function(_0x2decad){while(--_0x2decad){_0x93f925['push'](_0x93f925['shift']());}};_0x38e028(++_0xee7802);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x276001,_0x1755e3){var _0xd823df=function(_0x58e4fb){while(--_0x58e4fb){_0x276001['push'](_0x276001['shift']());}};_0xd823df(++_0x1755e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index a427894..e15afec 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x153495,_0x325886){var _0x1e181e=function(_0x38e33d){while(--_0x38e33d){_0x153495['push'](_0x153495['shift']());}};_0x1e181e(++_0x325886);}(_0x70e0,0x17b));var _0x070e=function(_0x4d68c4,_0x166b7e){_0x4d68c4=_0x4d68c4-0x0;var _0x5f075e=_0x70e0[_0x4d68c4];return _0x5f075e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x29976b,_0x13a2dd){var _0x2780de=function(_0x1208e7){while(--_0x1208e7){_0x29976b['push'](_0x29976b['shift']());}};_0x2780de(++_0x13a2dd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 11427c5..6a1074f 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x170d=['sequelize','exports','INTEGER'];(function(_0x1cbc47,_0x58b1e4){var _0x2759ff=function(_0x4294af){while(--_0x4294af){_0x1cbc47['push'](_0x1cbc47['shift']());}};_0x2759ff(++_0x58b1e4);}(_0x170d,0x13b));var _0xd170=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x170d[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xd170('0x0'));module[_0xd170('0x1')]={'penalty':{'type':Sequelize[_0xd170('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x37c3=['exports','INTEGER','sequelize'];(function(_0x22d045,_0x13fd64){var _0x2460b1=function(_0x3e0ddf){while(--_0x3e0ddf){_0x22d045['push'](_0x22d045['shift']());}};_0x2460b1(++_0x13fd64);}(_0x37c3,0xd1));var _0x337c=function(_0x54b45c,_0xbfb39b){_0x54b45c=_0x54b45c-0x0;var _0x101941=_0x37c3[_0x54b45c];return _0x101941;};'use strict';var Sequelize=require(_0x337c('0x0'));module[_0x337c('0x1')]={'penalty':{'type':Sequelize[_0x337c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index a50ec84..81d1f00 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.model.js +++ b/server/api/userVoiceQueue/userVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c26=['bluebird','request-promise','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x5a2064,_0x119766){var _0x6c3590=function(_0xee9deb){while(--_0xee9deb){_0x5a2064['push'](_0x5a2064['shift']());}};_0x6c3590(++_0x119766);}(_0x6c26,0x1b3));var _0x66c2=function(_0x41b78f,_0x3dd2ee){_0x41b78f=_0x41b78f-0x0;var _0x39f8bf=_0x6c26[_0x41b78f];return _0x39f8bf;};'use strict';var _=require(_0x66c2('0x0'));var util=require(_0x66c2('0x1'));var logger=require(_0x66c2('0x2'))(_0x66c2('0x3'));var moment=require(_0x66c2('0x4'));var BPromise=require(_0x66c2('0x5'));var rp=require(_0x66c2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x66c2('0x7'));module[_0x66c2('0x8')]=function(_0x546169,_0x3f5c31){return _0x546169['define'](_0x66c2('0x9'),attributes,{'tableName':_0x66c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc63c=['../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x52caac,_0x286dea){var _0x192a9f=function(_0x307d04){while(--_0x307d04){_0x52caac['push'](_0x52caac['shift']());}};_0x192a9f(++_0x286dea);}(_0xc63c,0x139));var _0xcc63=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0xc63c[_0x49c68e];return _0x33032b;};'use strict';var _=require(_0xcc63('0x0'));var util=require('util');var logger=require(_0xcc63('0x1'))(_0xcc63('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc63('0x3'));var fs=require('fs');var path=require(_0xcc63('0x4'));var rimraf=require(_0xcc63('0x5'));var config=require(_0xcc63('0x6'));var attributes=require(_0xcc63('0x7'));module['exports']=function(_0x4561eb,_0x1d10a3){return _0x4561eb[_0xcc63('0x8')](_0xcc63('0x9'),attributes,{'tableName':_0xcc63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index c5729c8..9987342 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js +++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4c4=['request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x535069,_0x3362a6){var _0x323700=function(_0x4e7a5d){while(--_0x4e7a5d){_0x535069['push'](_0x535069['shift']());}};_0x323700(++_0x3362a6);}(_0xd4c4,0x8e));var _0x4d4c=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0xd4c4[_0xf5d71c];return _0x5af672;};'use strict';var _=require(_0x4d4c('0x0'));var util=require('util');var moment=require(_0x4d4c('0x1'));var BPromise=require(_0x4d4c('0x2'));var rs=require(_0x4d4c('0x3'));var fs=require('fs');var Redis=require(_0x4d4c('0x4'));var db=require(_0x4d4c('0x5'))['db'];var utils=require(_0x4d4c('0x6'));var logger=require(_0x4d4c('0x7'))(_0x4d4c('0x8'));var config=require(_0x4d4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4d4c('0xa')][_0x4d4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d6f3b,_0x1e1cd3,_0x1290e0){return new BPromise(function(_0x4a8ce7,_0x1f6da8){return client[_0x4d4c('0xc')](_0x3d6f3b,_0x1290e0)[_0x4d4c('0xd')](function(_0x5e7535){logger['info'](_0x4d4c('0xe'),_0x1e1cd3,_0x4d4c('0xf'));logger[_0x4d4c('0x10')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1e1cd3,'request\x20sent',JSON['stringify'](_0x5e7535));if(_0x5e7535[_0x4d4c('0x11')]){if(_0x5e7535[_0x4d4c('0x11')][_0x4d4c('0x12')]===0x1f4){logger[_0x4d4c('0x11')](_0x4d4c('0xe'),_0x1e1cd3,_0x5e7535[_0x4d4c('0x11')][_0x4d4c('0x13')]);return _0x1f6da8(_0x5e7535[_0x4d4c('0x11')][_0x4d4c('0x13')]);}logger['error'](_0x4d4c('0xe'),_0x1e1cd3,_0x5e7535[_0x4d4c('0x11')][_0x4d4c('0x13')]);return _0x4a8ce7(_0x5e7535['error'][_0x4d4c('0x13')]);}else{logger['info'](_0x4d4c('0xe'),_0x1e1cd3,_0x4d4c('0xf'));_0x4a8ce7(_0x5e7535[_0x4d4c('0x14')]['message']);}})[_0x4d4c('0x15')](function(_0x299d78){logger[_0x4d4c('0x11')](_0x4d4c('0xe'),_0x1e1cd3,_0x299d78);_0x1f6da8(_0x299d78);});});} \ No newline at end of file +var _0x5cbb=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util'];(function(_0x491380,_0x10a568){var _0x3daab3=function(_0x2c329f){while(--_0x2c329f){_0x491380['push'](_0x491380['shift']());}};_0x3daab3(++_0x10a568);}(_0x5cbb,0xa9));var _0xb5cb=function(_0xcdaac,_0xa83386){_0xcdaac=_0xcdaac-0x0;var _0x573db8=_0x5cbb[_0xcdaac];return _0x573db8;};'use strict';var _=require(_0xb5cb('0x0'));var util=require(_0xb5cb('0x1'));var moment=require(_0xb5cb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5cb('0x3'));var db=require(_0xb5cb('0x4'))['db'];var utils=require(_0xb5cb('0x5'));var logger=require(_0xb5cb('0x6'))(_0xb5cb('0x7'));var config=require('../../config/environment');var jayson=require(_0xb5cb('0x8'));var client=jayson['client'][_0xb5cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x393567,_0x2b1c81,_0x3d36b9){return new BPromise(function(_0x42f6b3,_0x591a08){return client[_0xb5cb('0xa')](_0x393567,_0x3d36b9)[_0xb5cb('0xb')](function(_0x4b7adb){logger[_0xb5cb('0xc')](_0xb5cb('0xd'),_0x2b1c81,_0xb5cb('0xe'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2b1c81,_0xb5cb('0xe'),JSON[_0xb5cb('0xf')](_0x4b7adb));if(_0x4b7adb[_0xb5cb('0x10')]){if(_0x4b7adb[_0xb5cb('0x10')]['code']===0x1f4){logger[_0xb5cb('0x10')](_0xb5cb('0xd'),_0x2b1c81,_0x4b7adb[_0xb5cb('0x10')][_0xb5cb('0x11')]);return _0x591a08(_0x4b7adb['error'][_0xb5cb('0x11')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x2b1c81,_0x4b7adb[_0xb5cb('0x10')][_0xb5cb('0x11')]);return _0x42f6b3(_0x4b7adb['error']['message']);}else{logger['info'](_0xb5cb('0xd'),_0x2b1c81,'request\x20sent');_0x42f6b3(_0x4b7adb['result'][_0xb5cb('0x11')]);}})[_0xb5cb('0x12')](function(_0xb66112){logger[_0xb5cb('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x2b1c81,_0xb66112);_0x591a08(_0xb66112);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index b80a2b2..b8eec17 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xc07e77,_0x131f5f){var _0x8a489e=function(_0x3cc02a){while(--_0x3cc02a){_0xc07e77['push'](_0xc07e77['shift']());}};_0x8a489e(++_0x131f5f);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x198f3a,_0x3fc081){var _0x230ad5=function(_0x21c98d){while(--_0x21c98d){_0x198f3a['push'](_0x198f3a['shift']());}};_0x230ad5(++_0x3fc081);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index c5467b9..07e2a64 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe52b=['STRING','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x27f80b,_0x5399bb){var _0x146f2f=function(_0x124c42){while(--_0x124c42){_0x27f80b['push'](_0x27f80b['shift']());}};_0x146f2f(++_0x5399bb);}(_0xe52b,0x132));var _0xbe52=function(_0x14be2d,_0x4cf6f7){_0x14be2d=_0x14be2d-0x0;var _0x4ffa68=_0xe52b[_0x14be2d];return _0x4ffa68;};'use strict';var Sequelize=require(_0xbe52('0x0'));module[_0xbe52('0x1')]={'uniqueid':{'type':Sequelize[_0xbe52('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xbe52('0x3')},'membername':{'type':Sequelize[_0xbe52('0x4')],'allowNull':![],'comment':_0xbe52('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xbe52('0x3')},'VoiceQueueId':{'type':Sequelize[_0xbe52('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xbe52('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xbe52('0x3')},'penalty':{'type':Sequelize[_0xbe52('0x2')](0xb),'defaultValue':0x0,'comment':_0xbe52('0x3')},'paused':{'type':Sequelize[_0xbe52('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x3c2f=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x2ab9b7,_0x550eec){var _0x5e1c81=function(_0x2b3901){while(--_0x2b3901){_0x2ab9b7['push'](_0x2ab9b7['shift']());}};_0x5e1c81(++_0x550eec);}(_0x3c2f,0x91));var _0xf3c2=function(_0x5ca79e,_0x185d0e){_0x5ca79e=_0x5ca79e-0x0;var _0x8d5177=_0x3c2f[_0x5ca79e];return _0x8d5177;};'use strict';var Sequelize=require(_0xf3c2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf3c2('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf3c2('0x2')},'membername':{'type':Sequelize[_0xf3c2('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xf3c2('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf3c2('0x4'),'comment':_0xf3c2('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xf3c2('0x3')],'allowNull':![],'unique':_0xf3c2('0x4'),'comment':_0xf3c2('0x2')},'penalty':{'type':Sequelize[_0xf3c2('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xf3c2('0x1')](0xb),'defaultValue':0x0,'comment':_0xf3c2('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 564e9e2..71b81de 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1de=['save','update','remove','emit','hook','../../mysqldb','setMaxListeners'];(function(_0x1d65db,_0x2b50f8){var _0x5c1617=function(_0x2fffc4){while(--_0x2fffc4){_0x1d65db['push'](_0x1d65db['shift']());}};_0x5c1617(++_0x2b50f8);}(_0xf1de,0x155));var _0xef1d=function(_0x22e204,_0x35e723){_0x22e204=_0x22e204-0x0;var _0x2b577f=_0xf1de[_0x22e204];return _0x2b577f;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xef1d('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xef1d('0x1')](0x0);var events={'afterCreate':_0xef1d('0x2'),'afterUpdate':_0xef1d('0x3'),'afterDestroy':_0xef1d('0x4')};function emitEvent(_0x1ee14a){return function(_0x5c4df2,_0x477ff1,_0xe3fd9){UserVoiceQueueRtEvents[_0xef1d('0x5')](_0x1ee14a+':'+_0x5c4df2['id'],_0x5c4df2);UserVoiceQueueRtEvents['emit'](_0x1ee14a,_0x5c4df2);_0xe3fd9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xef1d('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xbf73=['../../mysqldb','save','update','remove','emit','hook','exports','events'];(function(_0x2d405c,_0x504384){var _0x3db0f8=function(_0x44fec0){while(--_0x44fec0){_0x2d405c['push'](_0x2d405c['shift']());}};_0x3db0f8(++_0x504384);}(_0xbf73,0x1d7));var _0x3bf7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbf73[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x3bf7('0x0'));var UserVoiceQueueRt=require(_0x3bf7('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3bf7('0x2'),'afterUpdate':_0x3bf7('0x3'),'afterDestroy':_0x3bf7('0x4')};function emitEvent(_0x282867){return function(_0x47c209,_0x38d482,_0x4c5434){UserVoiceQueueRtEvents['emit'](_0x282867+':'+_0x47c209['id'],_0x47c209);UserVoiceQueueRtEvents[_0x3bf7('0x5')](_0x282867,_0x47c209);_0x4c5434(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x3bf7('0x6')](e,emitEvent(event));}}module[_0x3bf7('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 338344a..6e6fa87 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa957=['path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0xa957,0xfe));var _0x7a95=function(_0x11f7a6,_0x5db765){_0x11f7a6=_0x11f7a6-0x0;var _0x122da5=_0xa957[_0x11f7a6];return _0x122da5;};'use strict';var _=require(_0x7a95('0x0'));var util=require('util');var logger=require(_0x7a95('0x1'))(_0x7a95('0x2'));var moment=require(_0x7a95('0x3'));var BPromise=require(_0x7a95('0x4'));var rp=require(_0x7a95('0x5'));var fs=require('fs');var path=require(_0x7a95('0x6'));var rimraf=require('rimraf');var config=require(_0x7a95('0x7'));var attributes=require(_0x7a95('0x8'));module[_0x7a95('0x9')]=function(_0x59798e,_0x192ee7){return _0x59798e[_0x7a95('0xa')](_0x7a95('0xb'),attributes,{'tableName':_0x7a95('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fcf=['bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger','api','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9fcf,0x97));var _0xf9fc=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x9fcf[_0x1cb18a];return _0x22442e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf9fc('0x0'))(_0xf9fc('0x1'));var moment=require(_0xf9fc('0x2'));var BPromise=require(_0xf9fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9fc('0x4'));var rimraf=require(_0xf9fc('0x5'));var config=require(_0xf9fc('0x6'));var attributes=require(_0xf9fc('0x7'));module['exports']=function(_0x2882fb,_0x207534){return _0x2882fb[_0xf9fc('0x8')](_0xf9fc('0x9'),attributes,{'tableName':_0xf9fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index d699c14..acc6d32 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefd4=['../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueueRtPauses','findAll','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1bcd44,_0x19c738){var _0x517db7=function(_0x1c62c8){while(--_0x1c62c8){_0x1bcd44['push'](_0x1bcd44['shift']());}};_0x517db7(++_0x19c738);}(_0xefd4,0x18e));var _0x4efd=function(_0x37594c,_0x250938){_0x37594c=_0x37594c-0x0;var _0xc6c829=_0xefd4[_0x37594c];return _0xc6c829;};'use strict';var _=require(_0x4efd('0x0'));var util=require(_0x4efd('0x1'));var moment=require(_0x4efd('0x2'));var BPromise=require(_0x4efd('0x3'));var rs=require(_0x4efd('0x4'));var fs=require('fs');var Redis=require(_0x4efd('0x5'));var db=require(_0x4efd('0x6'))['db'];var utils=require(_0x4efd('0x7'));var logger=require('../../config/logger')(_0x4efd('0x8'));var config=require(_0x4efd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4efd('0xa')]({'port':0x232a});config[_0x4efd('0xb')]=_[_0x4efd('0xc')](config['redis'],{'host':_0x4efd('0xd'),'port':0x18eb});var socket=require(_0x4efd('0xe'))(new Redis(config[_0x4efd('0xb')]));require(_0x4efd('0xf'))[_0x4efd('0x10')](socket);function respondWithRpcPromise(_0x29506a,_0x3fd613,_0x6ffc98){return new BPromise(function(_0x57d817,_0x496401){return client[_0x4efd('0x11')](_0x29506a,_0x6ffc98)[_0x4efd('0x12')](function(_0x2effcd){logger[_0x4efd('0x13')](_0x4efd('0x14'),_0x3fd613,_0x4efd('0x15'));logger[_0x4efd('0x16')](_0x4efd('0x17'),_0x3fd613,_0x4efd('0x15'),JSON['stringify'](_0x2effcd));if(_0x2effcd[_0x4efd('0x18')]){if(_0x2effcd[_0x4efd('0x18')][_0x4efd('0x19')]===0x1f4){logger['error'](_0x4efd('0x14'),_0x3fd613,_0x2effcd[_0x4efd('0x18')]['message']);return _0x496401(_0x2effcd[_0x4efd('0x18')][_0x4efd('0x1a')]);}logger[_0x4efd('0x18')](_0x4efd('0x14'),_0x3fd613,_0x2effcd[_0x4efd('0x18')]['message']);return _0x57d817(_0x2effcd['error'][_0x4efd('0x1a')]);}else{logger[_0x4efd('0x13')](_0x4efd('0x14'),_0x3fd613,_0x4efd('0x15'));_0x57d817(_0x2effcd[_0x4efd('0x1b')][_0x4efd('0x1a')]);}})['catch'](function(_0xaf50d2){logger['error'](_0x4efd('0x14'),_0x3fd613,_0xaf50d2);_0x496401(_0xaf50d2);});});}exports[_0x4efd('0x1c')]=function(_0xef6cea){var _0x2500bf=this;return new Promise(function(_0x57a3ed,_0x55eaeb){return db['UserVoiceQueueRt'][_0x4efd('0x1d')]({'raw':_0xef6cea[_0x4efd('0x1e')]?_0xef6cea[_0x4efd('0x1e')][_0x4efd('0x1f')]===undefined?!![]:![]:!![],'where':_0xef6cea['options']?_0xef6cea['options']['where']||null:null,'attributes':[[db[_0x4efd('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4efd('0x20')][_0x4efd('0x21')](_0x4efd('0x22')))),'outboundQueuePauses']]})[_0x4efd('0x12')](function(_0x382895){logger['info'](_0x4efd('0x1c'),_0xef6cea);logger[_0x4efd('0x16')]('GetVoiceQueueRtPauses',_0xef6cea,JSON[_0x4efd('0x23')](_0x382895));_0x57a3ed(_0x382895);})[_0x4efd('0x24')](function(_0x41b251){logger[_0x4efd('0x18')](_0x4efd('0x1c'),_0x41b251[_0x4efd('0x1a')],_0xef6cea);_0x55eaeb(_0x2500bf[_0x4efd('0x18')](0x1f4,_0x41b251[_0x4efd('0x1a')]));});});}; \ No newline at end of file +var _0x7700=['UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','GetVoiceQueueRtPauses','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x150c65,_0x303f38){var _0x4ca489=function(_0x2c2e26){while(--_0x2c2e26){_0x150c65['push'](_0x150c65['shift']());}};_0x4ca489(++_0x303f38);}(_0x7700,0xc9));var _0x0770=function(_0x17de8e,_0x41ad4c){_0x17de8e=_0x17de8e-0x0;var _0x39aba5=_0x7700[_0x17de8e];return _0x39aba5;};'use strict';var _=require('lodash');var util=require(_0x0770('0x0'));var moment=require(_0x0770('0x1'));var BPromise=require(_0x0770('0x2'));var rs=require(_0x0770('0x3'));var fs=require('fs');var Redis=require(_0x0770('0x4'));var db=require(_0x0770('0x5'))['db'];var utils=require(_0x0770('0x6'));var logger=require(_0x0770('0x7'))(_0x0770('0x8'));var config=require(_0x0770('0x9'));var jayson=require(_0x0770('0xa'));var client=jayson[_0x0770('0xb')]['http']({'port':0x232a});config[_0x0770('0xc')]=_['defaults'](config[_0x0770('0xc')],{'host':_0x0770('0xd'),'port':0x18eb});var socket=require(_0x0770('0xe'))(new Redis(config[_0x0770('0xc')]));require('./userVoiceQueueRt.socket')[_0x0770('0xf')](socket);function respondWithRpcPromise(_0x5499c1,_0x259534,_0x4d1749){return new BPromise(function(_0x52d258,_0x177f8f){return client[_0x0770('0x10')](_0x5499c1,_0x4d1749)[_0x0770('0x11')](function(_0xa55e42){logger[_0x0770('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x259534,_0x0770('0x13'));logger[_0x0770('0x14')](_0x0770('0x15'),_0x259534,_0x0770('0x13'),JSON[_0x0770('0x16')](_0xa55e42));if(_0xa55e42['error']){if(_0xa55e42[_0x0770('0x17')][_0x0770('0x18')]===0x1f4){logger[_0x0770('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x259534,_0xa55e42['error'][_0x0770('0x19')]);return _0x177f8f(_0xa55e42['error'][_0x0770('0x19')]);}logger[_0x0770('0x17')](_0x0770('0x1a'),_0x259534,_0xa55e42[_0x0770('0x17')][_0x0770('0x19')]);return _0x52d258(_0xa55e42[_0x0770('0x17')][_0x0770('0x19')]);}else{logger[_0x0770('0x12')](_0x0770('0x1a'),_0x259534,_0x0770('0x13'));_0x52d258(_0xa55e42['result'][_0x0770('0x19')]);}})['catch'](function(_0x3cda30){logger['error'](_0x0770('0x1a'),_0x259534,_0x3cda30);_0x177f8f(_0x3cda30);});});}exports['GetVoiceQueueRtPauses']=function(_0x3215d9){var _0x430f52=this;return new Promise(function(_0x50c2df,_0x39254a){return db[_0x0770('0x1b')][_0x0770('0x1c')]({'raw':_0x3215d9[_0x0770('0x1d')]?_0x3215d9['options'][_0x0770('0x1e')]===undefined?!![]:![]:!![],'where':_0x3215d9[_0x0770('0x1d')]?_0x3215d9[_0x0770('0x1d')][_0x0770('0x1f')]||null:null,'attributes':[[db[_0x0770('0x20')]['fn'](_0x0770('0x21'),db[_0x0770('0x20')]['fn']('IF',db[_0x0770('0x20')][_0x0770('0x22')]('`paused`\x20=\x201,\x201,\x20null'))),_0x0770('0x23')]]})[_0x0770('0x11')](function(_0x374a8c){logger['info'](_0x0770('0x24'),_0x3215d9);logger[_0x0770('0x14')](_0x0770('0x24'),_0x3215d9,JSON[_0x0770('0x16')](_0x374a8c));_0x50c2df(_0x374a8c);})[_0x0770('0x25')](function(_0x5bb52b){logger[_0x0770('0x17')](_0x0770('0x24'),_0x5bb52b['message'],_0x3215d9);_0x39254a(_0x430f52[_0x0770('0x17')](0x1f4,_0x5bb52b[_0x0770('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index a3d27e0..2a670f1 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8efc=['removeListener','length','userVoiceQueueRt:','remove','emit'];(function(_0x18a8c7,_0x20a3e9){var _0x13aebd=function(_0x52cc32){while(--_0x52cc32){_0x18a8c7['push'](_0x18a8c7['shift']());}};_0x13aebd(++_0x20a3e9);}(_0x8efc,0x8f));var _0xc8ef=function(_0x4cba56,_0x5b2c44){_0x4cba56=_0x4cba56-0x0;var _0x3cc9f3=_0x8efc[_0x4cba56];return _0x3cc9f3;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0xc8ef('0x0'),'update'];function createListener(_0x35d82e,_0x48fc28){return function(_0x16d145){_0x48fc28[_0xc8ef('0x1')](_0x35d82e,_0x16d145);};}function removeListener(_0x4dbf24,_0x4ee0cc){return function(){UserVoiceQueueRtEvents[_0xc8ef('0x2')](_0x4dbf24,_0x4ee0cc);};}exports['register']=function(_0x1d65c1){for(var _0x1b4901=0x0,_0x1648ac=events[_0xc8ef('0x3')];_0x1b4901<_0x1648ac;_0x1b4901++){var _0x819e70=events[_0x1b4901];var _0x522d75=createListener(_0xc8ef('0x4')+_0x819e70,_0x1d65c1);UserVoiceQueueRtEvents['on'](_0x819e70,_0x522d75);}}; \ No newline at end of file +var _0xa1f6=['save','remove','update','register','length','./userVoiceQueueRt.events'];(function(_0x3fd531,_0x538738){var _0x5bd9db=function(_0x676411){while(--_0x676411){_0x3fd531['push'](_0x3fd531['shift']());}};_0x5bd9db(++_0x538738);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xa1f6[_0x5e9a69];return _0x5979c8;};'use strict';var UserVoiceQueueRtEvents=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(){UserVoiceQueueRtEvents['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('userVoiceQueueRt:'+_0x3ecd63,_0x426ae1);UserVoiceQueueRtEvents['on'](_0x3ecd63,_0x36c00b);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 77f6394..33670cf 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x39b20f,_0x244203){var _0x6906f=function(_0x192203){while(--_0x192203){_0x39b20f['push'](_0x39b20f['shift']());}};_0x6906f(++_0x244203);}(_0x70e0,0x17b));var _0x070e=function(_0x37f61f,_0x1fe7d8){_0x37f61f=_0x37f61f-0x0;var _0x4f4c1c=_0x70e0[_0x37f61f];return _0x4f4c1c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x52c4e4,_0x4978e3){var _0x4d154e=function(_0x461e20){while(--_0x461e20){_0x52c4e4['push'](_0x52c4e4['shift']());}};_0x4d154e(++_0x4978e3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 24490b0..6dfe390 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a7f=['INTEGER'];(function(_0x18c55f,_0x327651){var _0x334690=function(_0x4510b0){while(--_0x4510b0){_0x18c55f['push'](_0x18c55f['shift']());}};_0x334690(++_0x327651);}(_0x0a7f,0xdf));var _0xf0a7=function(_0x47ad1a,_0x467d68){_0x47ad1a=_0x47ad1a-0x0;var _0x586211=_0x0a7f[_0x47ad1a];return _0x586211;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xf0a7('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf890=['INTEGER','sequelize','exports'];(function(_0x78a74a,_0x357046){var _0x4b44f1=function(_0x25571e){while(--_0x25571e){_0x78a74a['push'](_0x78a74a['shift']());}};_0x4b44f1(++_0x357046);}(_0xf890,0xa3));var _0x0f89=function(_0x1b9530,_0x4d2106){_0x1b9530=_0x1b9530-0x0;var _0x74d78d=_0xf890[_0x1b9530];return _0x74d78d;};'use strict';var Sequelize=require(_0x0f89('0x0'));module[_0x0f89('0x1')]={'penalty':{'type':Sequelize[_0x0f89('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 73cb0d2..fd5df0e 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3c3=['./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x36cd93,_0x593481){var _0x10f6cd=function(_0x1c3aa3){while(--_0x1c3aa3){_0x36cd93['push'](_0x36cd93['shift']());}};_0x10f6cd(++_0x593481);}(_0xe3c3,0x17a));var _0x3e3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe3c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3e3c('0x0'));var logger=require(_0x3e3c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3e3c('0x2'));var rp=require(_0x3e3c('0x3'));var fs=require('fs');var path=require(_0x3e3c('0x4'));var rimraf=require(_0x3e3c('0x5'));var config=require(_0x3e3c('0x6'));var attributes=require(_0x3e3c('0x7'));module[_0x3e3c('0x8')]=function(_0x146cf8,_0x517fa2){return _0x146cf8[_0x3e3c('0x9')](_0x3e3c('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x367a=['user_has_whatsapp_queues','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define','UserWhatsappQueue'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0x367a,0xfe));var _0xa367=function(_0x216dc3,_0x564b16){_0x216dc3=_0x216dc3-0x0;var _0xe1d184=_0x367a[_0x216dc3];return _0xe1d184;};'use strict';var _=require(_0xa367('0x0'));var util=require(_0xa367('0x1'));var logger=require('../../config/logger')(_0xa367('0x2'));var moment=require('moment');var BPromise=require(_0xa367('0x3'));var rp=require(_0xa367('0x4'));var fs=require('fs');var path=require(_0xa367('0x5'));var rimraf=require(_0xa367('0x6'));var config=require(_0xa367('0x7'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x33f633,_0x206fca){return _0x33f633[_0xa367('0x8')](_0xa367('0x9'),attributes,{'tableName':_0xa367('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 15b74be..9aa954f 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9a2=['request','then','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserWhatsappQueue,\x20%s,\x20%s','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x15a3d2,_0x13dfe0){var _0x1e316d=function(_0x27b9c9){while(--_0x27b9c9){_0x15a3d2['push'](_0x15a3d2['shift']());}};_0x1e316d(++_0x13dfe0);}(_0xd9a2,0xfb));var _0x2d9a=function(_0x5b0d88,_0x39cc32){_0x5b0d88=_0x5b0d88-0x0;var _0x566736=_0xd9a2[_0x5b0d88];return _0x566736;};'use strict';var _=require(_0x2d9a('0x0'));var util=require(_0x2d9a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2d9a('0x2'));var fs=require('fs');var Redis=require(_0x2d9a('0x3'));var db=require(_0x2d9a('0x4'))['db'];var utils=require(_0x2d9a('0x5'));var logger=require(_0x2d9a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2d9a('0x7'));var client=jayson[_0x2d9a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ae81d,_0xb0c86a,_0x59eca1){return new BPromise(function(_0x1e9b9a,_0x5bb9b5){return client[_0x2d9a('0x9')](_0x1ae81d,_0x59eca1)[_0x2d9a('0xa')](function(_0x3d2f55){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0xb0c86a,_0x2d9a('0xb'));logger[_0x2d9a('0xc')](_0x2d9a('0xd'),_0xb0c86a,_0x2d9a('0xb'),JSON[_0x2d9a('0xe')](_0x3d2f55));if(_0x3d2f55['error']){if(_0x3d2f55['error']['code']===0x1f4){logger[_0x2d9a('0xf')](_0x2d9a('0x10'),_0xb0c86a,_0x3d2f55['error']['message']);return _0x5bb9b5(_0x3d2f55[_0x2d9a('0xf')]['message']);}logger[_0x2d9a('0xf')](_0x2d9a('0x10'),_0xb0c86a,_0x3d2f55[_0x2d9a('0xf')]['message']);return _0x1e9b9a(_0x3d2f55[_0x2d9a('0xf')]['message']);}else{logger[_0x2d9a('0x11')](_0x2d9a('0x10'),_0xb0c86a,'request\x20sent');_0x1e9b9a(_0x3d2f55[_0x2d9a('0x12')]['message']);}})[_0x2d9a('0x13')](function(_0x11135c){logger[_0x2d9a('0xf')](_0x2d9a('0x10'),_0xb0c86a,_0x11135c);_0x5bb9b5(_0x11135c);});});} \ No newline at end of file +var _0xe6c6=['lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe6c6,0x108));var _0x6e6c=function(_0x267c08,_0x547afd){_0x267c08=_0x267c08-0x0;var _0x1da5d2=_0xe6c6[_0x267c08];return _0x1da5d2;};'use strict';var _=require(_0x6e6c('0x0'));var util=require(_0x6e6c('0x1'));var moment=require(_0x6e6c('0x2'));var BPromise=require(_0x6e6c('0x3'));var rs=require(_0x6e6c('0x4'));var fs=require('fs');var Redis=require(_0x6e6c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6e6c('0x6'));var config=require(_0x6e6c('0x7'));var jayson=require(_0x6e6c('0x8'));var client=jayson[_0x6e6c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x329760,_0x107226,_0x5af057){return new BPromise(function(_0x5d1fe4,_0x4e1476){return client[_0x6e6c('0xa')](_0x329760,_0x5af057)[_0x6e6c('0xb')](function(_0x2c8d84){logger[_0x6e6c('0xc')](_0x6e6c('0xd'),_0x107226,_0x6e6c('0xe'));logger[_0x6e6c('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x107226,_0x6e6c('0xe'),JSON[_0x6e6c('0x10')](_0x2c8d84));if(_0x2c8d84['error']){if(_0x2c8d84[_0x6e6c('0x11')][_0x6e6c('0x12')]===0x1f4){logger[_0x6e6c('0x11')](_0x6e6c('0xd'),_0x107226,_0x2c8d84[_0x6e6c('0x11')]['message']);return _0x4e1476(_0x2c8d84[_0x6e6c('0x11')][_0x6e6c('0x13')]);}logger[_0x6e6c('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x107226,_0x2c8d84['error'][_0x6e6c('0x13')]);return _0x5d1fe4(_0x2c8d84[_0x6e6c('0x11')]['message']);}else{logger[_0x6e6c('0xc')](_0x6e6c('0xd'),_0x107226,_0x6e6c('0xe'));_0x5d1fe4(_0x2c8d84[_0x6e6c('0x14')]['message']);}})[_0x6e6c('0x15')](function(_0x5c5f08){logger['error'](_0x6e6c('0xd'),_0x107226,_0x5c5f08);_0x4e1476(_0x5c5f08);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 5b87d3a..1f3ae91 100644 --- a/server/api/variable/index.js +++ b/server/api/variable/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb647=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','exports','multer','util'];(function(_0x14e40b,_0x47f041){var _0x46e892=function(_0x406ac1){while(--_0x406ac1){_0x14e40b['push'](_0x14e40b['shift']());}};_0x46e892(++_0x47f041);}(_0xb647,0xdb));var _0x7b64=function(_0x4283ff,_0x5589e4){_0x4283ff=_0x4283ff-0x0;var _0x421b74=_0xb647[_0x4283ff];return _0x421b74;};'use strict';var multer=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var path=require(_0x7b64('0x2'));var timeout=require(_0x7b64('0x3'));var express=require(_0x7b64('0x4'));var router=express[_0x7b64('0x5')]();var fs_extra=require(_0x7b64('0x6'));var auth=require(_0x7b64('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7b64('0x8'));var controller=require('./variable.controller');router[_0x7b64('0x9')]('/',auth[_0x7b64('0xa')](),controller[_0x7b64('0xb')]);router[_0x7b64('0x9')](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller[_0x7b64('0xd')]);router[_0x7b64('0xe')]('/',auth[_0x7b64('0xa')](),controller['create']);router[_0x7b64('0xf')]('/:id',auth[_0x7b64('0xa')](),controller['update']);router['delete'](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller['destroy']);module[_0x7b64('0x10')]=router; \ No newline at end of file +var _0x70e0=['put','/:id','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','show','post','create'];(function(_0x969742,_0x19f986){var _0x33ab30=function(_0x47946f){while(--_0x47946f){_0x969742['push'](_0x969742['shift']());}};_0x33ab30(++_0x19f986);}(_0x70e0,0x17b));var _0x070e=function(_0x4258dc,_0x4457f1){_0x4258dc=_0x4258dc-0x0;var _0x29bf7c=_0x70e0[_0x4258dc];return _0x29bf7c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')]('/',auth[_0x070e('0x8')](),controller[_0x070e('0xb')]);router[_0x070e('0xc')](_0x070e('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x070e('0xe')](_0x070e('0xd'),auth[_0x070e('0x8')](),controller[_0x070e('0xf')]);module[_0x070e('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 3bc7106..68bfe8c 100644 --- a/server/api/variable/variable.attributes.js +++ b/server/api/variable/variable.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeeea=['exports','STRING','name','sequelize'];(function(_0x2eb376,_0x582814){var _0x58d070=function(_0x22d578){while(--_0x22d578){_0x2eb376['push'](_0x2eb376['shift']());}};_0x58d070(++_0x582814);}(_0xeeea,0x1a3));var _0xaeee=function(_0x208fc8,_0x36b3e4){_0x208fc8=_0x208fc8-0x0;var _0x4848a9=_0xeeea[_0x208fc8];return _0x4848a9;};'use strict';var Sequelize=require(_0xaeee('0x0'));module[_0xaeee('0x1')]={'name':{'type':Sequelize[_0xaeee('0x2')],'unique':_0xaeee('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xaeee('0x2')]}}; \ No newline at end of file +var _0x1b4a=['name','sequelize','exports','STRING'];(function(_0x57b77e,_0x2a243e){var _0x5bb843=function(_0x198343){while(--_0x198343){_0x57b77e['push'](_0x57b77e['shift']());}};_0x5bb843(++_0x2a243e);}(_0x1b4a,0x99));var _0xa1b4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1b4a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa1b4('0x0'));module[_0xa1b4('0x1')]={'name':{'type':Sequelize[_0xa1b4('0x2')],'unique':_0xa1b4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 0f1d130..975aee4 100644 --- a/server/api/variable/variable.controller.js +++ b/server/api/variable/variable.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e23=['sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','Variables','UserProfileResource','destroy','then','error','stack','name','send','index','Variable','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','moment','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3e3bbe,_0x5687c1){var _0x2d1762=function(_0x562fd6){while(--_0x562fd6){_0x3e3bbe['push'](_0x3e3bbe['shift']());}};_0x2d1762(++_0x5687c1);}(_0x8e23,0x1c6));var _0x38e2=function(_0x52a05e,_0x3effa1){_0x52a05e=_0x52a05e-0x0;var _0x3be94b=_0x8e23[_0x52a05e];return _0x3be94b;};'use strict';var emlformat=require(_0x38e2('0x0'));var rimraf=require(_0x38e2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38e2('0x2'));var rp=require('request-promise');var moment=require(_0x38e2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x38e2('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x38e2('0x5'));var ejs=require(_0x38e2('0x6'));var fs=require('fs');var fs_extra=require(_0x38e2('0x7'));var _=require('lodash');var squel=require(_0x38e2('0x8'));var crypto=require(_0x38e2('0x9'));var jsforce=require(_0x38e2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x38e2('0x5'));var querystring=require(_0x38e2('0xb'));var Papa=require(_0x38e2('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x38e2('0xd'));var as=require(_0x38e2('0xe'));var hardwareService=require(_0x38e2('0xf'));var logger=require(_0x38e2('0x10'))(_0x38e2('0x11'));var utils=require(_0x38e2('0x12'));var config=require(_0x38e2('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53aec2,_0x5dd757){_0x5dd757=_0x5dd757||0xcc;return function(_0x38c540){if(_0x38c540){return _0x53aec2[_0x38e2('0x14')](_0x5dd757);}return _0x53aec2[_0x38e2('0x15')](_0x5dd757)['end']();};}function respondWithResult(_0x45cf06,_0x3cba69){_0x3cba69=_0x3cba69||0xc8;return function(_0x1f79af){if(_0x1f79af){return _0x45cf06[_0x38e2('0x15')](_0x3cba69)[_0x38e2('0x16')](_0x1f79af);}};}function respondWithFilteredResult(_0x4eec90,_0x16dbdd){return function(_0x13d4de){if(_0x13d4de){var _0x1625eb=typeof _0x16dbdd[_0x38e2('0x17')]===_0x38e2('0x18')&&typeof _0x16dbdd[_0x38e2('0x19')]===_0x38e2('0x18');var _0x49ebb1=_0x13d4de[_0x38e2('0x1a')];var _0x522a23=_0x1625eb?0x0:_0x16dbdd[_0x38e2('0x17')];var _0x4c1faa=_0x1625eb?_0x13d4de[_0x38e2('0x1a')]:_0x16dbdd[_0x38e2('0x17')]+_0x16dbdd['limit'];var _0x44afd5;if(_0x4c1faa>=_0x49ebb1){_0x4c1faa=_0x49ebb1;_0x44afd5=0xc8;}else{_0x44afd5=0xce;}_0x4eec90[_0x38e2('0x15')](_0x44afd5);return _0x4eec90['set'](_0x38e2('0x1b'),_0x522a23+'-'+_0x4c1faa+'/'+_0x49ebb1)[_0x38e2('0x16')](_0x13d4de);}return null;};}function patchUpdates(_0x36e5bb){return function(_0x53e9b9){try{jsonpatch[_0x38e2('0x1c')](_0x53e9b9,_0x36e5bb,!![]);}catch(_0x2244d5){return BPromise[_0x38e2('0x1d')](_0x2244d5);}return _0x53e9b9[_0x38e2('0x1e')]();};}function saveUpdates(_0x92d1dc,_0x192891){return function(_0x560255){if(_0x560255){return _0x560255[_0x38e2('0x1f')](_0x92d1dc)['then'](function(_0x37a879){return _0x37a879;});}return null;};}function removeEntity(_0x2978b4,_0x3c99cb){return function(_0x4bcdbf){if(_0x4bcdbf){return _0x4bcdbf['destroy']()['then'](function(){var _0x392ea5=_0x4bcdbf[_0x38e2('0x20')]({'plain':!![]});var _0x11646e=_0x38e2('0x21');return db[_0x38e2('0x22')][_0x38e2('0x23')]({'where':{'type':_0x11646e,'resourceId':_0x392ea5['id']}})[_0x38e2('0x24')](function(){return _0x4bcdbf;});})[_0x38e2('0x24')](function(){_0x2978b4[_0x38e2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7eb0,_0xd1570){return function(_0x18d6a7){if(!_0x18d6a7){_0x2c7eb0[_0x38e2('0x14')](0x194);}return _0x18d6a7;};}function handleError(_0x2b3fd6,_0x2c23bc){_0x2c23bc=_0x2c23bc||0x1f4;return function(_0x45862c){logger[_0x38e2('0x25')](_0x45862c[_0x38e2('0x26')]);if(_0x45862c[_0x38e2('0x27')]){delete _0x45862c[_0x38e2('0x27')];}_0x2b3fd6[_0x38e2('0x15')](_0x2c23bc)[_0x38e2('0x28')](_0x45862c);};}exports[_0x38e2('0x29')]=function(_0xb304d6,_0xaece){var _0x4e6dd9={},_0x2c8772={},_0x59c5d7={'count':0x0,'rows':[]};var _0x597cfd=_['map'](db[_0x38e2('0x2a')][_0x38e2('0x2b')],function(_0xdd713b){return{'name':_0xdd713b[_0x38e2('0x2c')],'type':_0xdd713b[_0x38e2('0x2d')]['key']};});_0x2c8772[_0x38e2('0x2e')]=_[_0x38e2('0x2f')](_0x597cfd,_0x38e2('0x27'));_0x2c8772[_0x38e2('0x30')]=_[_0x38e2('0x31')](_0xb304d6[_0x38e2('0x30')]);_0x2c8772['filters']=_[_0x38e2('0x32')](_0x2c8772[_0x38e2('0x2e')],_0x2c8772['query']);_0x4e6dd9['attributes']=_['intersection'](_0x2c8772['model'],qs[_0x38e2('0x33')](_0xb304d6[_0x38e2('0x30')][_0x38e2('0x33')]));_0x4e6dd9[_0x38e2('0x34')]=_0x4e6dd9['attributes']['length']?_0x4e6dd9[_0x38e2('0x34')]:_0x2c8772[_0x38e2('0x2e')];if(!_0xb304d6[_0x38e2('0x30')]['hasOwnProperty'](_0x38e2('0x35'))){_0x4e6dd9['limit']=qs[_0x38e2('0x19')](_0xb304d6[_0x38e2('0x30')][_0x38e2('0x19')]);_0x4e6dd9[_0x38e2('0x17')]=qs[_0x38e2('0x17')](_0xb304d6[_0x38e2('0x30')][_0x38e2('0x17')]);}_0x4e6dd9['order']=qs[_0x38e2('0x36')](_0xb304d6[_0x38e2('0x30')][_0x38e2('0x36')]);_0x4e6dd9[_0x38e2('0x37')]=qs[_0x38e2('0x38')](_[_0x38e2('0x39')](_0xb304d6[_0x38e2('0x30')],_0x2c8772[_0x38e2('0x38')]),_0x597cfd);if(_0xb304d6[_0x38e2('0x30')][_0x38e2('0x3a')]){_0x4e6dd9[_0x38e2('0x37')]=_[_0x38e2('0x3b')](_0x4e6dd9[_0x38e2('0x37')],{'$or':_['map'](_0x597cfd,function(_0x35a877){if(_0x35a877['type']!=='VIRTUAL'){var _0x5c964d={};_0x5c964d[_0x35a877[_0x38e2('0x27')]]={'$like':'%'+_0xb304d6[_0x38e2('0x30')][_0x38e2('0x3a')]+'%'};return _0x5c964d;}})});}_0x4e6dd9=_[_0x38e2('0x3b')]({},_0x4e6dd9,_0xb304d6[_0x38e2('0x3c')]);var _0x483c70={'where':_0x4e6dd9[_0x38e2('0x37')]};return db[_0x38e2('0x2a')][_0x38e2('0x1a')](_0x483c70)[_0x38e2('0x24')](function(_0x58d29c){_0x59c5d7[_0x38e2('0x1a')]=_0x58d29c;if(_0xb304d6[_0x38e2('0x30')][_0x38e2('0x3d')]){_0x4e6dd9[_0x38e2('0x3e')]=[{'all':!![]}];}return db[_0x38e2('0x2a')][_0x38e2('0x3f')](_0x4e6dd9);})[_0x38e2('0x24')](function(_0x366349){_0x59c5d7[_0x38e2('0x40')]=_0x366349;return _0x59c5d7;})['then'](respondWithFilteredResult(_0xaece,_0x4e6dd9))['catch'](handleError(_0xaece,null));};exports[_0x38e2('0x41')]=function(_0x3087db,_0x2a4b1b){var _0xe3d628={'raw':!![],'where':{'id':_0x3087db[_0x38e2('0x42')]['id']}},_0xdd8261={};_0xdd8261[_0x38e2('0x2e')]=_['keys'](db[_0x38e2('0x2a')]['rawAttributes']);_0xdd8261['query']=_[_0x38e2('0x31')](_0x3087db['query']);_0xdd8261[_0x38e2('0x38')]=_[_0x38e2('0x32')](_0xdd8261[_0x38e2('0x2e')],_0xdd8261[_0x38e2('0x30')]);_0xe3d628[_0x38e2('0x34')]=_[_0x38e2('0x32')](_0xdd8261[_0x38e2('0x2e')],qs[_0x38e2('0x33')](_0x3087db[_0x38e2('0x30')]['fields']));_0xe3d628[_0x38e2('0x34')]=_0xe3d628[_0x38e2('0x34')][_0x38e2('0x43')]?_0xe3d628['attributes']:_0xdd8261[_0x38e2('0x2e')];if(_0x3087db[_0x38e2('0x30')][_0x38e2('0x3d')]){_0xe3d628['include']=[{'all':!![]}];}_0xe3d628=_['merge']({},_0xe3d628,_0x3087db[_0x38e2('0x3c')]);return db[_0x38e2('0x2a')]['find'](_0xe3d628)[_0x38e2('0x24')](handleEntityNotFound(_0x2a4b1b,null))['then'](respondWithResult(_0x2a4b1b,null))['catch'](handleError(_0x2a4b1b,null));};exports[_0x38e2('0x44')]=function(_0x5622e1,_0x48fa1d){return db[_0x38e2('0x2a')][_0x38e2('0x44')](_0x5622e1['body'],{})[_0x38e2('0x24')](function(_0x20b105){var _0x37b4ee=_0x5622e1[_0x38e2('0x45')][_0x38e2('0x20')]({'plain':!![]});if(!_0x37b4ee)throw new Error(_0x38e2('0x46'));if(_0x37b4ee[_0x38e2('0x47')]===_0x38e2('0x45')){var _0x1a5e8e=_0x20b105[_0x38e2('0x20')]({'plain':!![]});var _0x337b09=_0x38e2('0x21');return db[_0x38e2('0x48')][_0x38e2('0x49')]({'where':{'name':_0x337b09,'userProfileId':_0x37b4ee[_0x38e2('0x4a')]},'raw':!![]})[_0x38e2('0x24')](function(_0x442a64){if(_0x442a64&&_0x442a64[_0x38e2('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x1a5e8e[_0x38e2('0x27')],'resourceId':_0x1a5e8e['id'],'type':_0x442a64['name'],'sectionId':_0x442a64['id']},{})['then'](function(){return _0x20b105;});}else{return _0x20b105;}})[_0x38e2('0x4c')](function(_0x24a2c9){logger['error'](_0x38e2('0x4d'),_0x24a2c9);throw _0x24a2c9;});}return _0x20b105;})[_0x38e2('0x24')](respondWithResult(_0x48fa1d,0xc9))['catch'](handleError(_0x48fa1d,null));};exports[_0x38e2('0x1f')]=function(_0x999dcf,_0x1052d5){if(_0x999dcf[_0x38e2('0x4e')]['id']){delete _0x999dcf[_0x38e2('0x4e')]['id'];}return db[_0x38e2('0x2a')][_0x38e2('0x49')]({'where':{'id':_0x999dcf[_0x38e2('0x42')]['id']}})[_0x38e2('0x24')](handleEntityNotFound(_0x1052d5,null))[_0x38e2('0x24')](saveUpdates(_0x999dcf[_0x38e2('0x4e')],null))['then'](respondWithResult(_0x1052d5,null))['catch'](handleError(_0x1052d5,null));};exports[_0x38e2('0x23')]=function(_0x11abd0,_0x48e02e){return db['Variable'][_0x38e2('0x49')]({'where':{'id':_0x11abd0[_0x38e2('0x42')]['id']}})[_0x38e2('0x24')](handleEntityNotFound(_0x48e02e,null))[_0x38e2('0x24')](removeEntity(_0x48e02e,null))['catch'](handleError(_0x48e02e,null));}; \ No newline at end of file +var _0x2b6a=['../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','Variables','UserProfileResource','sendStatus','error','stack','name','index','map','Variable','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5b99cc,_0x859705){var _0x16023c=function(_0x633bb3){while(--_0x633bb3){_0x5b99cc['push'](_0x5b99cc['shift']());}};_0x16023c(++_0x859705);}(_0x2b6a,0xdb));var _0xa2b6=function(_0x2de36b,_0x339fcc){_0x2de36b=_0x2de36b-0x0;var _0x499feb=_0x2b6a[_0x2de36b];return _0x499feb;};'use strict';var emlformat=require(_0xa2b6('0x0'));var rimraf=require(_0xa2b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa2b6('0x2'));var Mustache=require(_0xa2b6('0x3'));var util=require(_0xa2b6('0x4'));var path=require(_0xa2b6('0x5'));var sox=require(_0xa2b6('0x6'));var csv=require('to-csv');var ejs=require(_0xa2b6('0x7'));var fs=require('fs');var fs_extra=require(_0xa2b6('0x8'));var _=require(_0xa2b6('0x9'));var squel=require(_0xa2b6('0xa'));var crypto=require(_0xa2b6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa2b6('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa2b6('0xd'));var Papa=require(_0xa2b6('0xe'));var Redis=require('ioredis');var authService=require(_0xa2b6('0xf'));var qs=require(_0xa2b6('0x10'));var as=require(_0xa2b6('0x11'));var hardwareService=require(_0xa2b6('0x12'));var logger=require(_0xa2b6('0x13'))(_0xa2b6('0x14'));var utils=require(_0xa2b6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa2b6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bfd14,_0x25d1b8){_0x25d1b8=_0x25d1b8||0xcc;return function(_0x2a7e6b){if(_0x2a7e6b){return _0x2bfd14['sendStatus'](_0x25d1b8);}return _0x2bfd14[_0xa2b6('0x17')](_0x25d1b8)[_0xa2b6('0x18')]();};}function respondWithResult(_0x121f7d,_0x562dcd){_0x562dcd=_0x562dcd||0xc8;return function(_0x220119){if(_0x220119){return _0x121f7d[_0xa2b6('0x17')](_0x562dcd)[_0xa2b6('0x19')](_0x220119);}};}function respondWithFilteredResult(_0x5791fc,_0x39180d){return function(_0x582f2d){if(_0x582f2d){var _0xd2fb64=typeof _0x39180d[_0xa2b6('0x1a')]===_0xa2b6('0x1b')&&typeof _0x39180d[_0xa2b6('0x1c')]===_0xa2b6('0x1b');var _0xb00da8=_0x582f2d[_0xa2b6('0x1d')];var _0x1a1103=_0xd2fb64?0x0:_0x39180d[_0xa2b6('0x1a')];var _0x50f35c=_0xd2fb64?_0x582f2d[_0xa2b6('0x1d')]:_0x39180d[_0xa2b6('0x1a')]+_0x39180d[_0xa2b6('0x1c')];var _0x5849ad;if(_0x50f35c>=_0xb00da8){_0x50f35c=_0xb00da8;_0x5849ad=0xc8;}else{_0x5849ad=0xce;}_0x5791fc[_0xa2b6('0x17')](_0x5849ad);return _0x5791fc[_0xa2b6('0x1e')]('Content-Range',_0x1a1103+'-'+_0x50f35c+'/'+_0xb00da8)[_0xa2b6('0x19')](_0x582f2d);}return null;};}function patchUpdates(_0x12f98b){return function(_0x3e14dc){try{jsonpatch['apply'](_0x3e14dc,_0x12f98b,!![]);}catch(_0x41e9b1){return BPromise[_0xa2b6('0x1f')](_0x41e9b1);}return _0x3e14dc['save']();};}function saveUpdates(_0x52260c,_0x4ddd3c){return function(_0x5020fb){if(_0x5020fb){return _0x5020fb[_0xa2b6('0x20')](_0x52260c)[_0xa2b6('0x21')](function(_0x54868f){return _0x54868f;});}return null;};}function removeEntity(_0x483b5f,_0x1bfb16){return function(_0x411880){if(_0x411880){return _0x411880[_0xa2b6('0x22')]()[_0xa2b6('0x21')](function(){var _0x5b026c=_0x411880[_0xa2b6('0x23')]({'plain':!![]});var _0x5830ef=_0xa2b6('0x24');return db[_0xa2b6('0x25')][_0xa2b6('0x22')]({'where':{'type':_0x5830ef,'resourceId':_0x5b026c['id']}})['then'](function(){return _0x411880;});})[_0xa2b6('0x21')](function(){_0x483b5f[_0xa2b6('0x17')](0xcc)[_0xa2b6('0x18')]();});}};}function handleEntityNotFound(_0x44c322,_0x43def4){return function(_0x399fd0){if(!_0x399fd0){_0x44c322[_0xa2b6('0x26')](0x194);}return _0x399fd0;};}function handleError(_0x304328,_0x33b9ae){_0x33b9ae=_0x33b9ae||0x1f4;return function(_0x4f755f){logger[_0xa2b6('0x27')](_0x4f755f[_0xa2b6('0x28')]);if(_0x4f755f[_0xa2b6('0x29')]){delete _0x4f755f['name'];}_0x304328[_0xa2b6('0x17')](_0x33b9ae)['send'](_0x4f755f);};}exports[_0xa2b6('0x2a')]=function(_0x3ad09f,_0x783a2e){var _0x3fb39c={},_0x3775d0={},_0x510c44={'count':0x0,'rows':[]};var _0x88bda9=_[_0xa2b6('0x2b')](db[_0xa2b6('0x2c')][_0xa2b6('0x2d')],function(_0x3973c1){return{'name':_0x3973c1[_0xa2b6('0x2e')],'type':_0x3973c1['type'][_0xa2b6('0x2f')]};});_0x3775d0[_0xa2b6('0x30')]=_[_0xa2b6('0x2b')](_0x88bda9,_0xa2b6('0x29'));_0x3775d0[_0xa2b6('0x31')]=_[_0xa2b6('0x32')](_0x3ad09f['query']);_0x3775d0[_0xa2b6('0x33')]=_[_0xa2b6('0x34')](_0x3775d0[_0xa2b6('0x30')],_0x3775d0[_0xa2b6('0x31')]);_0x3fb39c['attributes']=_['intersection'](_0x3775d0['model'],qs[_0xa2b6('0x35')](_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x35')]));_0x3fb39c[_0xa2b6('0x36')]=_0x3fb39c[_0xa2b6('0x36')][_0xa2b6('0x37')]?_0x3fb39c[_0xa2b6('0x36')]:_0x3775d0[_0xa2b6('0x30')];if(!_0x3ad09f[_0xa2b6('0x31')]['hasOwnProperty']('nolimit')){_0x3fb39c[_0xa2b6('0x1c')]=qs['limit'](_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x1c')]);_0x3fb39c[_0xa2b6('0x1a')]=qs[_0xa2b6('0x1a')](_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x1a')]);}_0x3fb39c[_0xa2b6('0x38')]=qs[_0xa2b6('0x39')](_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x39')]);_0x3fb39c[_0xa2b6('0x3a')]=qs[_0xa2b6('0x33')](_[_0xa2b6('0x3b')](_0x3ad09f['query'],_0x3775d0['filters']),_0x88bda9);if(_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x3c')]){_0x3fb39c['where']=_[_0xa2b6('0x3d')](_0x3fb39c[_0xa2b6('0x3a')],{'$or':_[_0xa2b6('0x2b')](_0x88bda9,function(_0x470993){if(_0x470993[_0xa2b6('0x3e')]!==_0xa2b6('0x3f')){var _0x11c9c9={};_0x11c9c9[_0x470993[_0xa2b6('0x29')]]={'$like':'%'+_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x3c')]+'%'};return _0x11c9c9;}})});}_0x3fb39c=_['merge']({},_0x3fb39c,_0x3ad09f[_0xa2b6('0x40')]);var _0x427778={'where':_0x3fb39c[_0xa2b6('0x3a')]};return db[_0xa2b6('0x2c')][_0xa2b6('0x1d')](_0x427778)[_0xa2b6('0x21')](function(_0x4d29a7){_0x510c44[_0xa2b6('0x1d')]=_0x4d29a7;if(_0x3ad09f['query'][_0xa2b6('0x41')]){_0x3fb39c[_0xa2b6('0x42')]=[{'all':!![]}];}return db[_0xa2b6('0x2c')][_0xa2b6('0x43')](_0x3fb39c);})[_0xa2b6('0x21')](function(_0x30b845){_0x510c44[_0xa2b6('0x44')]=_0x30b845;return _0x510c44;})['then'](respondWithFilteredResult(_0x783a2e,_0x3fb39c))[_0xa2b6('0x45')](handleError(_0x783a2e,null));};exports[_0xa2b6('0x46')]=function(_0x17140a,_0x3b896d){var _0x1a914e={'raw':!![],'where':{'id':_0x17140a[_0xa2b6('0x47')]['id']}},_0xd732be={};_0xd732be[_0xa2b6('0x30')]=_[_0xa2b6('0x32')](db[_0xa2b6('0x2c')]['rawAttributes']);_0xd732be[_0xa2b6('0x31')]=_[_0xa2b6('0x32')](_0x17140a[_0xa2b6('0x31')]);_0xd732be['filters']=_[_0xa2b6('0x34')](_0xd732be[_0xa2b6('0x30')],_0xd732be['query']);_0x1a914e[_0xa2b6('0x36')]=_[_0xa2b6('0x34')](_0xd732be[_0xa2b6('0x30')],qs[_0xa2b6('0x35')](_0x17140a[_0xa2b6('0x31')][_0xa2b6('0x35')]));_0x1a914e[_0xa2b6('0x36')]=_0x1a914e[_0xa2b6('0x36')][_0xa2b6('0x37')]?_0x1a914e[_0xa2b6('0x36')]:_0xd732be[_0xa2b6('0x30')];if(_0x17140a[_0xa2b6('0x31')]['includeAll']){_0x1a914e[_0xa2b6('0x42')]=[{'all':!![]}];}_0x1a914e=_[_0xa2b6('0x3d')]({},_0x1a914e,_0x17140a[_0xa2b6('0x40')]);return db['Variable'][_0xa2b6('0x48')](_0x1a914e)[_0xa2b6('0x21')](handleEntityNotFound(_0x3b896d,null))['then'](respondWithResult(_0x3b896d,null))[_0xa2b6('0x45')](handleError(_0x3b896d,null));};exports[_0xa2b6('0x49')]=function(_0x16f510,_0x384145){return db['Variable'][_0xa2b6('0x49')](_0x16f510[_0xa2b6('0x4a')],{})[_0xa2b6('0x21')](function(_0x278ced){var _0x29aa16=_0x16f510[_0xa2b6('0x4b')][_0xa2b6('0x23')]({'plain':!![]});if(!_0x29aa16)throw new Error(_0xa2b6('0x4c'));if(_0x29aa16['role']===_0xa2b6('0x4b')){var _0x59631e=_0x278ced[_0xa2b6('0x23')]({'plain':!![]});var _0x157846='Variables';return db[_0xa2b6('0x4d')]['find']({'where':{'name':_0x157846,'userProfileId':_0x29aa16['userProfileId']},'raw':!![]})[_0xa2b6('0x21')](function(_0x2b3d2a){if(_0x2b3d2a&&_0x2b3d2a[_0xa2b6('0x4e')]===0x0){return db['UserProfileResource'][_0xa2b6('0x49')]({'name':_0x59631e[_0xa2b6('0x29')],'resourceId':_0x59631e['id'],'type':_0x2b3d2a[_0xa2b6('0x29')],'sectionId':_0x2b3d2a['id']},{})['then'](function(){return _0x278ced;});}else{return _0x278ced;}})[_0xa2b6('0x45')](function(_0x2515e8){logger[_0xa2b6('0x27')](_0xa2b6('0x4f'),_0x2515e8);throw _0x2515e8;});}return _0x278ced;})[_0xa2b6('0x21')](respondWithResult(_0x384145,0xc9))[_0xa2b6('0x45')](handleError(_0x384145,null));};exports[_0xa2b6('0x20')]=function(_0x22b267,_0x1bb6bb){if(_0x22b267[_0xa2b6('0x4a')]['id']){delete _0x22b267[_0xa2b6('0x4a')]['id'];}return db['Variable'][_0xa2b6('0x48')]({'where':{'id':_0x22b267['params']['id']}})[_0xa2b6('0x21')](handleEntityNotFound(_0x1bb6bb,null))['then'](saveUpdates(_0x22b267[_0xa2b6('0x4a')],null))[_0xa2b6('0x21')](respondWithResult(_0x1bb6bb,null))[_0xa2b6('0x45')](handleError(_0x1bb6bb,null));};exports['destroy']=function(_0x7976c8,_0x1d8c36){return db[_0xa2b6('0x2c')][_0xa2b6('0x48')]({'where':{'id':_0x7976c8[_0xa2b6('0x47')]['id']}})[_0xa2b6('0x21')](handleEntityNotFound(_0x1d8c36,null))[_0xa2b6('0x21')](removeEntity(_0x1d8c36,null))[_0xa2b6('0x45')](handleError(_0x1d8c36,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index be66c53..681b6c5 100644 --- a/server/api/variable/variable.model.js +++ b/server/api/variable/variable.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4691=['Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define'];(function(_0x5a7153,_0x1c165b){var _0x38bf31=function(_0x131ad8){while(--_0x131ad8){_0x5a7153['push'](_0x5a7153['shift']());}};_0x38bf31(++_0x1c165b);}(_0x4691,0x15b));var _0x1469=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x4691[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0x1469('0x0'));var util=require(_0x1469('0x1'));var logger=require(_0x1469('0x2'))(_0x1469('0x3'));var moment=require(_0x1469('0x4'));var BPromise=require(_0x1469('0x5'));var rp=require(_0x1469('0x6'));var fs=require('fs');var path=require(_0x1469('0x7'));var rimraf=require(_0x1469('0x8'));var config=require(_0x1469('0x9'));var attributes=require(_0x1469('0xa'));module[_0x1469('0xb')]=function(_0x2562d9,_0x4d7761){return _0x2562d9[_0x1469('0xc')](_0x1469('0xd'),attributes,{'tableName':_0x1469('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2979=['define','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x54fa45,_0x2bdb06){var _0xe56868=function(_0x3ed103){while(--_0x3ed103){_0x54fa45['push'](_0x54fa45['shift']());}};_0xe56868(++_0x2bdb06);}(_0x2979,0x70));var _0x9297=function(_0x48a81d,_0x2b3d9e){_0x48a81d=_0x48a81d-0x0;var _0x19699a=_0x2979[_0x48a81d];return _0x19699a;};'use strict';var _=require(_0x9297('0x0'));var util=require(_0x9297('0x1'));var logger=require(_0x9297('0x2'))(_0x9297('0x3'));var moment=require(_0x9297('0x4'));var BPromise=require(_0x9297('0x5'));var rp=require(_0x9297('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9297('0x7'));var config=require(_0x9297('0x8'));var attributes=require('./variable.attributes');module['exports']=function(_0x2143be,_0x1468ee){return _0x2143be[_0x9297('0x9')]('Variable',attributes,{'tableName':_0x9297('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 30ae2f0..ee95e78 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x101094,_0x5d3900){var _0x3d6d75=function(_0x10aa02){while(--_0x10aa02){_0x101094['push'](_0x101094['shift']());}};_0x3d6d75(++_0x5d3900);}(_0x1cb9,0x14e));var _0x91cb=function(_0x539a48,_0x29d7ad){_0x539a48=_0x539a48-0x0;var _0x467a53=_0x1cb9[_0x539a48];return _0x467a53;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x58ab93,_0xdf0e53){var _0x8e8faa=function(_0x48381b){while(--_0x48381b){_0x58ab93['push'](_0x58ab93['shift']());}};_0x8e8faa(++_0xdf0e53);}(_0xf494,0x1c6));var _0x4f49=function(_0x162c2a,_0x4a9987){_0x162c2a=_0x162c2a-0x0;var _0x361036=_0xf494[_0x162c2a];return _0x361036;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index c779f9d..19eccdc 100644 --- a/server/api/version/index.js +++ b/server/api/version/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb584=['reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','fetch','/reset','canUpdate'];(function(_0x13c750,_0x360f30){var _0x980725=function(_0x57519f){while(--_0x57519f){_0x13c750['push'](_0x13c750['shift']());}};_0x980725(++_0x360f30);}(_0xb584,0x1a6));var _0x4b58=function(_0x3d8037,_0x320c29){_0x3d8037=_0x3d8037-0x0;var _0x3be586=_0xb584[_0x3d8037];return _0x3be586;};'use strict';var express=require(_0x4b58('0x0'));var router=express['Router']();var auth=require(_0x4b58('0x1'));var controller=require(_0x4b58('0x2'));router[_0x4b58('0x3')]('/',controller[_0x4b58('0x4')]);router['get'](_0x4b58('0x5'),auth[_0x4b58('0x6')](),auth['canUpdate'](),controller[_0x4b58('0x7')]);router[_0x4b58('0x3')](_0x4b58('0x8'),auth[_0x4b58('0x6')](),auth[_0x4b58('0x9')](),controller[_0x4b58('0xa')]);router[_0x4b58('0x3')](_0x4b58('0xb'),auth['isAuthenticated'](),auth[_0x4b58('0x9')](),controller[_0x4b58('0xc')]);router[_0x4b58('0x3')](_0x4b58('0xd'),auth[_0x4b58('0x6')](),controller[_0x4b58('0xe')]);router[_0x4b58('0x3')](_0x4b58('0xf'),controller[_0x4b58('0x10')]);module[_0x4b58('0x11')]=router; \ No newline at end of file +var _0x4ed2=['/restart','restart','migrations','exports','express','../../components/auth/service','./version.controller','index','get','isAuthenticated','/reset','canUpdate','reset','/pull','pull'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x4ed2,0x199));var _0x24ed=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4ed2[_0x4a9fb1];return _0x348672;};'use strict';var express=require(_0x24ed('0x0'));var router=express['Router']();var auth=require(_0x24ed('0x1'));var controller=require(_0x24ed('0x2'));router['get']('/',controller[_0x24ed('0x3')]);router[_0x24ed('0x4')]('/fetch',auth[_0x24ed('0x5')](),auth['canUpdate'](),controller['fetch']);router[_0x24ed('0x4')](_0x24ed('0x6'),auth[_0x24ed('0x5')](),auth[_0x24ed('0x7')](),controller[_0x24ed('0x8')]);router[_0x24ed('0x4')](_0x24ed('0x9'),auth[_0x24ed('0x5')](),auth[_0x24ed('0x7')](),controller[_0x24ed('0xa')]);router['get'](_0x24ed('0xb'),auth[_0x24ed('0x5')](),controller[_0x24ed('0xc')]);router[_0x24ed('0x4')]('/migrations',controller[_0x24ed('0xd')]);module[_0x24ed('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 3b3418a..11c4b9d 100644 --- a/server/api/version/version.controller.js +++ b/server/api/version/version.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x583c=['latest','tags','2.0.0','json','fetch','origin','master','error','status','info','git\x20fetch','reset','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','join','server','replace','push','length','sort','sequelize','Migration','getQueryInterface','constructor','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','version','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x583c,0xd0));var _0xc583=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x583c[_0x5dbb84];return _0x1d6eae;};'use strict';var Umzug=require(_0xc583('0x0'));var path=require(_0xc583('0x1'));var fs=require('fs');var _=require(_0xc583('0x2'));var pkginfo=require(_0xc583('0x3'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0xc583('0x4'))[_0xc583('0x5')];var db=require(_0xc583('0x6'))['db'];var config=require(_0xc583('0x7'));var pm2=require(_0xc583('0x8'));var logger=require(_0xc583('0x9'))('update');var git=require(_0xc583('0xa'))(config[_0xc583('0xb')]);exports[_0xc583('0xc')]=function(_0x28b533,_0x17b67f){var _0x6e24f4={'current':module[_0xc583('0xd')][_0xc583('0xe')],'phonebar':0x2};if(_0x28b533[_0xc583('0xf')]&&_0x28b533['query'][_0xc583('0x10')]){return git['fetch']()[_0xc583('0x11')](function(_0x2466f5,_0x10bca5){_0x6e24f4[_0xc583('0x10')]=(_0x2466f5?module['exports']['version']:_0x10bca5[_0xc583('0x10')])||_0xc583('0x12');return _0x17b67f['status'](0xc8)['json'](_0x6e24f4);});}else{return _0x17b67f['status'](0xc8)[_0xc583('0x13')](_0x6e24f4);}};exports[_0xc583('0x14')]=function(_0x239841,_0x4f15e4){return git['fetch']([_0xc583('0x15'),_0xc583('0x16')],function(_0x2a66fe){if(_0x2a66fe){logger[_0xc583('0x17')](_0x2a66fe);return _0x4f15e4[_0xc583('0x18')](0x1f4)['json'](_0x2a66fe);}logger[_0xc583('0x19')](_0xc583('0x1a'));return _0x4f15e4[_0xc583('0x18')](0xc8)[_0xc583('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xc583('0x1b')]=function(_0x21e861,_0x5412d5){return git['reset'](['--hard','FETCH_HEAD'],function(_0x5c54f2){if(_0x5c54f2){logger['error'](_0x5c54f2);return _0x5412d5[_0xc583('0x18')](0x1f4)[_0xc583('0x13')](_0x5c54f2);}logger[_0xc583('0x19')](_0xc583('0x1c'));return _0x5412d5[_0xc583('0x18')](0xc8)[_0xc583('0x13')]({'output':_0xc583('0x1d')});});};exports[_0xc583('0x1e')]=function(_0x30b0fd,_0x3fba4f){exec(_0xc583('0x1f'),function(_0x308c27,_0x1a2153,_0x2fc855){logger[_0xc583('0x19')](_0x1a2153);logger['info'](_0x2fc855);if(_0x308c27){logger['error'](_0x308c27);return _0x3fba4f[_0xc583('0x18')](0x1f4)[_0xc583('0x13')](_0x308c27);}return _0x3fba4f[_0xc583('0x18')](0xc8)[_0xc583('0x13')]({'output':_0x1a2153});});};exports[_0xc583('0x20')]=function(_0x8494ef,_0x84c52f){return pm2[_0xc583('0x20')](_0xc583('0x21'))[_0xc583('0x22')](function(_0x55ce91){logger[_0xc583('0x19')](_0xc583('0x23'),_0x55ce91);return _0x84c52f[_0xc583('0x18')](0xc8)[_0xc583('0x13')]({'output':_0xc583('0x24')});})[_0xc583('0x25')](function(_0x359e27){logger[_0xc583('0x17')](_0x359e27);return _0x84c52f[_0xc583('0x18')](0x1f4)[_0xc583('0x13')](_0x359e27);});};exports[_0xc583('0x26')]=function(_0x2fb3b1,_0xff2ab2){var _0x31b481=fs['readdirSync'](path[_0xc583('0x27')](config[_0xc583('0xb')],_0xc583('0x28'),_0xc583('0x26')));var _0x474f07=[];for(var _0x98404b=0x0;_0x98404b<_0x31b481['length'];_0x98404b++){var _0x536dd0=_0x31b481[_0x98404b][_0xc583('0x29')]('.js','');if(compareVersions(module['exports'][_0xc583('0xe')],_0x536dd0)===-0x1){_0x474f07[_0xc583('0x2a')](_0x536dd0);}}if(_0x474f07[_0xc583('0x2b')]){var _0x433746=_0x474f07[_0xc583('0x2c')](compareVersions);var _0x14bf99=new Umzug({'storage':_0xc583('0x2d'),'storageOptions':{'model':db[_0xc583('0x2e')],'modelName':_0xc583('0x2e'),'columnName':'version'},'migrations':{'params':[db[_0xc583('0x2d')][_0xc583('0x2f')](),db[_0xc583('0x2d')][_0xc583('0x30')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xc583('0x27')](config[_0xc583('0xb')],_0xc583('0x28'),_0xc583('0x26')),'pattern':/\.js$/}});_0x14bf99['up']({'migrations':_[_0xc583('0x31')](_0x433746,function(_0x1cc457){return _0x1cc457+_0xc583('0x32');})})[_0xc583('0x22')](function(){return _0xff2ab2[_0xc583('0x18')](0xc8)[_0xc583('0x13')]({'output':_0xc583('0x33')+module['exports']['version']+_0xc583('0x34')+_[_0xc583('0x35')](_0x433746),'migrations':_[_0xc583('0x27')](_0x433746)});})['catch'](function(_0x5e1f50){if(_0x5e1f50 instanceof db[_0xc583('0x2d')][_0xc583('0x36')]){return _0xff2ab2[_0xc583('0x18')](0xc8)['json']({'output':_0xc583('0x37')});}else{return _0xff2ab2['status'](0x1f4)[_0xc583('0x13')](_0x5e1f50);}});}else{return _0xff2ab2[_0xc583('0x18')](0xc8)[_0xc583('0x13')]({'output':_0xc583('0x37')});}}; \ No newline at end of file +var _0x7ac2=['restart','motion2','then','readdirSync','server','migrations','length','replace','.js','push','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','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','exports','query','latest','fetch','2.0.0','status','json','origin','master','error','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','info'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x7ac2,0xb2));var _0x27ac=function(_0x141310,_0x4fb243){_0x141310=_0x141310-0x0;var _0x4680ae=_0x7ac2[_0x141310];return _0x4680ae;};'use strict';var Umzug=require(_0x27ac('0x0'));var path=require(_0x27ac('0x1'));var fs=require('fs');var _=require(_0x27ac('0x2'));var pkginfo=require(_0x27ac('0x3'))(module,_0x27ac('0x4'));var compareVersions=require(_0x27ac('0x5'));var exec=require('child_process')[_0x27ac('0x6')];var db=require(_0x27ac('0x7'))['db'];var config=require(_0x27ac('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x27ac('0x9'))(_0x27ac('0xa'));var git=require(_0x27ac('0xb'))(config[_0x27ac('0xc')]);exports['index']=function(_0x475d6a,_0x12adff){var _0x2ad2b0={'current':module[_0x27ac('0xd')]['version'],'phonebar':0x2};if(_0x475d6a[_0x27ac('0xe')]&&_0x475d6a[_0x27ac('0xe')][_0x27ac('0xf')]){return git[_0x27ac('0x10')]()['tags'](function(_0x27cd42,_0x459038){_0x2ad2b0[_0x27ac('0xf')]=(_0x27cd42?module[_0x27ac('0xd')][_0x27ac('0x4')]:_0x459038['latest'])||_0x27ac('0x11');return _0x12adff[_0x27ac('0x12')](0xc8)[_0x27ac('0x13')](_0x2ad2b0);});}else{return _0x12adff[_0x27ac('0x12')](0xc8)['json'](_0x2ad2b0);}};exports[_0x27ac('0x10')]=function(_0xf1a762,_0xaffba7){return git['fetch']([_0x27ac('0x14'),_0x27ac('0x15')],function(_0x55645c){if(_0x55645c){logger[_0x27ac('0x16')](_0x55645c);return _0xaffba7['status'](0x1f4)[_0x27ac('0x13')](_0x55645c);}logger['info'](_0x27ac('0x17'));return _0xaffba7[_0x27ac('0x12')](0xc8)[_0x27ac('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x27ac('0x18')]=function(_0x49636c,_0x2bdb34){return git['reset'](['--hard',_0x27ac('0x19')],function(_0x5d73bb){if(_0x5d73bb){logger[_0x27ac('0x16')](_0x5d73bb);return _0x2bdb34['status'](0x1f4)[_0x27ac('0x13')](_0x5d73bb);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2bdb34[_0x27ac('0x12')](0xc8)[_0x27ac('0x13')]({'output':_0x27ac('0x1a')});});};exports[_0x27ac('0x1b')]=function(_0x30af5b,_0x1115e1){exec(_0x27ac('0x1c'),function(_0x1a9a5c,_0x3d736d,_0x5820d2){logger[_0x27ac('0x1d')](_0x3d736d);logger['info'](_0x5820d2);if(_0x1a9a5c){logger['error'](_0x1a9a5c);return _0x1115e1[_0x27ac('0x12')](0x1f4)[_0x27ac('0x13')](_0x1a9a5c);}return _0x1115e1[_0x27ac('0x12')](0xc8)[_0x27ac('0x13')]({'output':_0x3d736d});});};exports['restart']=function(_0x181350,_0xfad142){return pm2[_0x27ac('0x1e')](_0x27ac('0x1f'))[_0x27ac('0x20')](function(_0x2aaa25){logger[_0x27ac('0x1d')]('pm2\x20restart\x20motion\x20%s',_0x2aaa25);return _0xfad142[_0x27ac('0x12')](0xc8)[_0x27ac('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x55f7c8){logger['error'](_0x55f7c8);return _0xfad142[_0x27ac('0x12')](0x1f4)[_0x27ac('0x13')](_0x55f7c8);});};exports['migrations']=function(_0xedc26c,_0x48f7c9){var _0x41adca=fs[_0x27ac('0x21')](path['join'](config[_0x27ac('0xc')],_0x27ac('0x22'),_0x27ac('0x23')));var _0x5ebe59=[];for(var _0x47a7d1=0x0;_0x47a7d1<_0x41adca[_0x27ac('0x24')];_0x47a7d1++){var _0x9558ba=_0x41adca[_0x47a7d1][_0x27ac('0x25')](_0x27ac('0x26'),'');if(compareVersions(module[_0x27ac('0xd')][_0x27ac('0x4')],_0x9558ba)===-0x1){_0x5ebe59[_0x27ac('0x27')](_0x9558ba);}}if(_0x5ebe59[_0x27ac('0x24')]){var _0x470114=_0x5ebe59['sort'](compareVersions);var _0x2d0dcf=new Umzug({'storage':_0x27ac('0x28'),'storageOptions':{'model':db[_0x27ac('0x29')],'modelName':_0x27ac('0x29'),'columnName':_0x27ac('0x4')},'migrations':{'params':[db[_0x27ac('0x28')][_0x27ac('0x2a')](),db[_0x27ac('0x28')][_0x27ac('0x2b')],function(){throw new Error(_0x27ac('0x2c'));}],'path':path[_0x27ac('0x2d')](config[_0x27ac('0xc')],_0x27ac('0x22'),'migrations'),'pattern':/\.js$/}});_0x2d0dcf['up']({'migrations':_[_0x27ac('0x2e')](_0x470114,function(_0x3c9cb3){return _0x3c9cb3+_0x27ac('0x26');})})['then'](function(){return _0x48f7c9['status'](0xc8)[_0x27ac('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x27ac('0xd')][_0x27ac('0x4')]+_0x27ac('0x2f')+_[_0x27ac('0x30')](_0x470114),'migrations':_[_0x27ac('0x2d')](_0x470114)});})[_0x27ac('0x31')](function(_0x412a6a){if(_0x412a6a instanceof db[_0x27ac('0x28')][_0x27ac('0x32')]){return _0x48f7c9['status'](0xc8)[_0x27ac('0x13')]({'output':_0x27ac('0x33')});}else{return _0x48f7c9[_0x27ac('0x12')](0x1f4)[_0x27ac('0x13')](_0x412a6a);}});}else{return _0x48f7c9['status'](0xc8)[_0x27ac('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 7358177..39e3b13 100644 --- a/server/api/voiceAgentReport/index.js +++ b/server/api/voiceAgentReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7cd=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated','index','/describe','get','/:id','show','post','create','update','delete'];(function(_0x48e86c,_0x9f034d){var _0x54fa11=function(_0x199705){while(--_0x199705){_0x48e86c['push'](_0x48e86c['shift']());}};_0x54fa11(++_0x9f034d);}(_0xd7cd,0x66));var _0xdd7c=function(_0x26e0db,_0x264210){_0x26e0db=_0x26e0db-0x0;var _0xcb246f=_0xd7cd[_0x26e0db];return _0xcb246f;};'use strict';var multer=require(_0xdd7c('0x0'));var util=require('util');var path=require(_0xdd7c('0x1'));var timeout=require(_0xdd7c('0x2'));var express=require(_0xdd7c('0x3'));var router=express['Router']();var fs_extra=require(_0xdd7c('0x4'));var auth=require(_0xdd7c('0x5'));var interaction=require(_0xdd7c('0x6'));var config=require('../../config/environment');var controller=require(_0xdd7c('0x7'));router['get']('/',auth[_0xdd7c('0x8')](),controller[_0xdd7c('0x9')]);router['get'](_0xdd7c('0xa'),auth[_0xdd7c('0x8')](),controller['describe']);router[_0xdd7c('0xb')](_0xdd7c('0xc'),auth[_0xdd7c('0x8')](),controller[_0xdd7c('0xd')]);router[_0xdd7c('0xe')]('/',auth['isAuthenticated'](),controller[_0xdd7c('0xf')]);router['put']('/:id',auth[_0xdd7c('0x8')](),controller[_0xdd7c('0x10')]);router[_0xdd7c('0x11')](_0xdd7c('0xc'),auth['isAuthenticated'](),controller[_0xdd7c('0x12')]);module[_0xdd7c('0x13')]=router; \ No newline at end of file +var _0xb6c1=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/:id','show','create','put','delete','destroy','exports'];(function(_0x43c05a,_0x2773bf){var _0x4140d0=function(_0x484d8a){while(--_0x484d8a){_0x43c05a['push'](_0x43c05a['shift']());}};_0x4140d0(++_0x2773bf);}(_0xb6c1,0x77));var _0x1b6c=function(_0xa3944e,_0x168f4c){_0xa3944e=_0xa3944e-0x0;var _0xa1f2dd=_0xb6c1[_0xa3944e];return _0xa1f2dd;};'use strict';var multer=require('multer');var util=require(_0x1b6c('0x0'));var path=require(_0x1b6c('0x1'));var timeout=require(_0x1b6c('0x2'));var express=require(_0x1b6c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b6c('0x4'));var config=require(_0x1b6c('0x5'));var controller=require(_0x1b6c('0x6'));router['get']('/',auth[_0x1b6c('0x7')](),controller[_0x1b6c('0x8')]);router[_0x1b6c('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x1b6c('0xa'),auth[_0x1b6c('0x7')](),controller[_0x1b6c('0xb')]);router['post']('/',auth[_0x1b6c('0x7')](),controller[_0x1b6c('0xc')]);router[_0x1b6c('0xd')](_0x1b6c('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x1b6c('0xe')]('/:id',auth[_0x1b6c('0x7')](),controller[_0x1b6c('0xf')]);module[_0x1b6c('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 6c15290..c30ab57 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js +++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33d2=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x1ca45,_0x29a0ab){var _0x295578=function(_0x3865d2){while(--_0x3865d2){_0x1ca45['push'](_0x1ca45['shift']());}};_0x295578(++_0x29a0ab);}(_0x33d2,0x7f));var _0x233d=function(_0x4e9a52,_0x25b20d){_0x4e9a52=_0x4e9a52-0x0;var _0x2d425f=_0x33d2[_0x4e9a52];return _0x2d425f;};'use strict';var Sequelize=require(_0x233d('0x0'));module[_0x233d('0x1')]={'type':{'type':Sequelize[_0x233d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x233d('0x2')]},'calleridname':{'type':Sequelize[_0x233d('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x233d('0x2')]},'membername':{'type':Sequelize[_0x233d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x233d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x233d('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x233d('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x233d('0x3')]},'agentdumpAt':{'type':Sequelize[_0x233d('0x3')]},'holdtime':{'type':Sequelize[_0x233d('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x233d('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x233d('0x4')]},'agentacw':{'type':Sequelize[_0x233d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x233d('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x233d('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x233d('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x233d('0x2')]},'connectedlinename':{'type':Sequelize[_0x233d('0x2')]},'language':{'type':Sequelize[_0x233d('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x233d('0x2')]},'exten':{'type':Sequelize[_0x233d('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x233d('0x2')]},'destchannelstate':{'type':Sequelize[_0x233d('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x233d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x233d('0x2')]},'destcalleridname':{'type':Sequelize[_0x233d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x233d('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x233d('0x2')]},'destaccountcode':{'type':Sequelize[_0x233d('0x2')]},'destcontext':{'type':Sequelize[_0x233d('0x2')]},'destexten':{'type':Sequelize[_0x233d('0x2')]},'destpriority':{'type':Sequelize[_0x233d('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x233d('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x233d('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x233d('0x2')],'comment':_0x233d('0x6')},'transferexten':{'type':Sequelize[_0x233d('0x2')]},'transferuniqueid':{'type':Sequelize[_0x233d('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x93e6=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x1ecd68,_0x3cfc63){var _0x5dde2b=function(_0x265306){while(--_0x265306){_0x1ecd68['push'](_0x1ecd68['shift']());}};_0x5dde2b(++_0x3cfc63);}(_0x93e6,0x11e));var _0x693e=function(_0xee40b0,_0x1270b8){_0xee40b0=_0xee40b0-0x0;var _0x55e4c1=_0x93e6[_0xee40b0];return _0x55e4c1;};'use strict';var Sequelize=require(_0x693e('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x693e('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x693e('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x693e('0x1')]},'membername':{'type':Sequelize[_0x693e('0x1')]},'agentcalledAt':{'type':Sequelize[_0x693e('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x693e('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x693e('0x2')]},'agentdumpAt':{'type':Sequelize[_0x693e('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x693e('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x693e('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x693e('0x4')]},'reason':{'type':Sequelize[_0x693e('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x693e('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x693e('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x693e('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x693e('0x1')]},'exten':{'type':Sequelize[_0x693e('0x1')]},'priority':{'type':Sequelize[_0x693e('0x1')]},'destchannel':{'type':Sequelize[_0x693e('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x693e('0x1')]},'destcalleridnum':{'type':Sequelize[_0x693e('0x1')]},'destcalleridname':{'type':Sequelize[_0x693e('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x693e('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x693e('0x1')]},'destlanguage':{'type':Sequelize[_0x693e('0x1')]},'destaccountcode':{'type':Sequelize[_0x693e('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x693e('0x1')]},'destpriority':{'type':Sequelize[_0x693e('0x1')]},'destuniqueid':{'type':Sequelize[_0x693e('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x693e('0x1')]},'transfer':{'type':Sequelize[_0x693e('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x693e('0x1')],'comment':_0x693e('0x5')},'transferexten':{'type':Sequelize[_0x693e('0x1')]},'transferuniqueid':{'type':Sequelize[_0x693e('0x1')]},'agententerreason':{'type':Sequelize[_0x693e('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 7486366..c414aa9 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index ca8bcb1..8d029f3 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.model.js +++ b/server/api/voiceAgentReport/voiceAgentReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3148=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','destuniqueid','lodash'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x3148,0x1d3));var _0x8314=function(_0x472072,_0x5add18){_0x472072=_0x472072-0x0;var _0x38ca35=_0x3148[_0x472072];return _0x38ca35;};'use strict';var _=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var logger=require('../../config/logger')(_0x8314('0x2'));var moment=require(_0x8314('0x3'));var BPromise=require(_0x8314('0x4'));var rp=require(_0x8314('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8314('0x6'));var config=require(_0x8314('0x7'));var attributes=require(_0x8314('0x8'));module[_0x8314('0x9')]=function(_0x18a30b,_0x9cb271){return _0x18a30b[_0x8314('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x8314('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x8314('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f02=['path','rimraf','./voiceAgentReport.attributes','define','destuniqueid','lodash','moment','bluebird','request-promise'];(function(_0x57a237,_0x46498c){var _0x39a359=function(_0x36f761){while(--_0x36f761){_0x57a237['push'](_0x57a237['shift']());}};_0x39a359(++_0x46498c);}(_0x9f02,0x68));var _0x29f0=function(_0x2f7cf0,_0x2a4d5e){_0x2f7cf0=_0x2f7cf0-0x0;var _0x2f32fb=_0x9f02[_0x2f7cf0];return _0x2f32fb;};'use strict';var _=require(_0x29f0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x29f0('0x1'));var BPromise=require(_0x29f0('0x2'));var rp=require(_0x29f0('0x3'));var fs=require('fs');var path=require(_0x29f0('0x4'));var rimraf=require(_0x29f0('0x5'));var config=require('../../config/environment');var attributes=require(_0x29f0('0x6'));module['exports']=function(_0x391b66,_0x213cba){return _0x391b66[_0x29f0('0x7')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid',_0x29f0('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index f17a74a..3049d50 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js +++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4395=['request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','create','body','options','raw','then','debug','UpdateVoiceAgentReport','VoiceAgentReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x22191f,_0x7affe5){var _0x52212e=function(_0x49ed60){while(--_0x49ed60){_0x22191f['push'](_0x22191f['shift']());}};_0x52212e(++_0x7affe5);}(_0x4395,0x72));var _0x5439=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4395[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5439('0x0'));var util=require(_0x5439('0x1'));var moment=require(_0x5439('0x2'));var BPromise=require('bluebird');var rs=require(_0x5439('0x3'));var fs=require('fs');var Redis=require(_0x5439('0x4'));var db=require(_0x5439('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5439('0x6'));var jayson=require(_0x5439('0x7'));var client=jayson[_0x5439('0x8')][_0x5439('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a7822,_0x3bf5f6,_0x17bdc8){return new BPromise(function(_0x55a294,_0x3bf944){return client[_0x5439('0xa')](_0x4a7822,_0x17bdc8)['then'](function(_0x40bd43){logger[_0x5439('0xb')](_0x5439('0xc'),_0x3bf5f6,_0x5439('0xd'));logger['debug'](_0x5439('0xe'),_0x3bf5f6,_0x5439('0xd'),JSON[_0x5439('0xf')](_0x40bd43));if(_0x40bd43[_0x5439('0x10')]){if(_0x40bd43[_0x5439('0x10')][_0x5439('0x11')]===0x1f4){logger['error'](_0x5439('0xc'),_0x3bf5f6,_0x40bd43[_0x5439('0x10')][_0x5439('0x12')]);return _0x3bf944(_0x40bd43[_0x5439('0x10')]['message']);}logger[_0x5439('0x10')](_0x5439('0xc'),_0x3bf5f6,_0x40bd43[_0x5439('0x10')][_0x5439('0x12')]);return _0x55a294(_0x40bd43['error'][_0x5439('0x12')]);}else{logger[_0x5439('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x3bf5f6,_0x5439('0xd'));_0x55a294(_0x40bd43[_0x5439('0x13')][_0x5439('0x12')]);}})[_0x5439('0x14')](function(_0x477e0c){logger['error'](_0x5439('0xc'),_0x3bf5f6,_0x477e0c);_0x3bf944(_0x477e0c);});});}exports[_0x5439('0x15')]=function(_0x1d25ad){var _0x3d940f=this;return new Promise(function(_0x30d022,_0x4bd547){return db['VoiceAgentReport'][_0x5439('0x16')](_0x1d25ad[_0x5439('0x17')],{'raw':_0x1d25ad[_0x5439('0x18')]?_0x1d25ad['options'][_0x5439('0x19')]===undefined?!![]:![]:!![]})[_0x5439('0x1a')](function(_0x42a670){logger['info']('CreateVoiceAgentReport',_0x1d25ad);logger[_0x5439('0x1b')](_0x5439('0x15'),_0x1d25ad,JSON[_0x5439('0xf')](_0x42a670));_0x30d022(_0x42a670);})[_0x5439('0x14')](function(_0x2d1238){logger['error'](_0x5439('0x15'),_0x2d1238[_0x5439('0x12')],_0x1d25ad);_0x4bd547(_0x3d940f[_0x5439('0x10')](0x1f4,_0x2d1238[_0x5439('0x12')]));});});};exports[_0x5439('0x1c')]=function(_0x23c5f5){var _0x3a459b=this;return new Promise(function(_0xc304fd,_0x3acac7){return db[_0x5439('0x1d')][_0x5439('0x1e')](_0x23c5f5[_0x5439('0x17')],{'raw':_0x23c5f5['options']?_0x23c5f5[_0x5439('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23c5f5[_0x5439('0x18')]?_0x23c5f5[_0x5439('0x18')]['where']||null:null,'attributes':_0x23c5f5[_0x5439('0x18')]?_0x23c5f5[_0x5439('0x18')]['attributes']||null:null,'limit':_0x23c5f5[_0x5439('0x18')]?_0x23c5f5[_0x5439('0x18')]['limit']||null:null})['then'](function(_0xd4d112){logger[_0x5439('0xb')](_0x5439('0x1c'),_0x23c5f5);logger[_0x5439('0x1b')](_0x5439('0x1c'),_0x23c5f5,JSON[_0x5439('0xf')](_0xd4d112));_0xc304fd(_0xd4d112);})[_0x5439('0x14')](function(_0x5e182e){logger[_0x5439('0x10')](_0x5439('0x1c'),_0x5e182e[_0x5439('0x12')],_0x23c5f5);_0x3acac7(_0x3a459b[_0x5439('0x10')](0x1f4,_0x5e182e[_0x5439('0x12')]));});});}; \ No newline at end of file +var _0x5365=['VoiceAgentReport','options','raw','then','update','body','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport'];(function(_0xd4e399,_0x4a8481){var _0x1186c9=function(_0x48aa19){while(--_0x48aa19){_0xd4e399['push'](_0xd4e399['shift']());}};_0x1186c9(++_0x4a8481);}(_0x5365,0x134));var _0x5536=function(_0x4d22be,_0x3d70df){_0x4d22be=_0x4d22be-0x0;var _0x4f9f45=_0x5365[_0x4d22be];return _0x4f9f45;};'use strict';var _=require(_0x5536('0x0'));var util=require(_0x5536('0x1'));var moment=require(_0x5536('0x2'));var BPromise=require(_0x5536('0x3'));var rs=require(_0x5536('0x4'));var fs=require('fs');var Redis=require(_0x5536('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5536('0x6'))('rpc');var config=require(_0x5536('0x7'));var jayson=require(_0x5536('0x8'));var client=jayson['client'][_0x5536('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d599e,_0x3bb275,_0x2ddb50){return new BPromise(function(_0xeb7d9,_0x126432){return client[_0x5536('0xa')](_0x3d599e,_0x2ddb50)['then'](function(_0x41883a){logger[_0x5536('0xb')](_0x5536('0xc'),_0x3bb275,_0x5536('0xd'));logger[_0x5536('0xe')](_0x5536('0xf'),_0x3bb275,_0x5536('0xd'),JSON[_0x5536('0x10')](_0x41883a));if(_0x41883a[_0x5536('0x11')]){if(_0x41883a[_0x5536('0x11')]['code']===0x1f4){logger[_0x5536('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x3bb275,_0x41883a[_0x5536('0x11')][_0x5536('0x12')]);return _0x126432(_0x41883a['error']['message']);}logger[_0x5536('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x3bb275,_0x41883a['error'][_0x5536('0x12')]);return _0xeb7d9(_0x41883a['error'][_0x5536('0x12')]);}else{logger[_0x5536('0xb')](_0x5536('0xc'),_0x3bb275,'request\x20sent');_0xeb7d9(_0x41883a[_0x5536('0x13')]['message']);}})[_0x5536('0x14')](function(_0x5909fc){logger[_0x5536('0x11')](_0x5536('0xc'),_0x3bb275,_0x5909fc);_0x126432(_0x5909fc);});});}exports[_0x5536('0x15')]=function(_0x5aae91){var _0x41d9e5=this;return new Promise(function(_0x227498,_0x5c4227){return db[_0x5536('0x16')]['create'](_0x5aae91['body'],{'raw':_0x5aae91['options']?_0x5aae91[_0x5536('0x17')][_0x5536('0x18')]===undefined?!![]:![]:!![]})[_0x5536('0x19')](function(_0x3b4955){logger['info']('CreateVoiceAgentReport',_0x5aae91);logger[_0x5536('0xe')](_0x5536('0x15'),_0x5aae91,JSON[_0x5536('0x10')](_0x3b4955));_0x227498(_0x3b4955);})[_0x5536('0x14')](function(_0x3a60c1){logger[_0x5536('0x11')]('CreateVoiceAgentReport',_0x3a60c1[_0x5536('0x12')],_0x5aae91);_0x5c4227(_0x41d9e5[_0x5536('0x11')](0x1f4,_0x3a60c1[_0x5536('0x12')]));});});};exports['UpdateVoiceAgentReport']=function(_0x50a15e){var _0x36149c=this;return new Promise(function(_0x1f46dc,_0x532161){return db[_0x5536('0x16')][_0x5536('0x1a')](_0x50a15e[_0x5536('0x1b')],{'raw':_0x50a15e[_0x5536('0x17')]?_0x50a15e[_0x5536('0x17')][_0x5536('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50a15e[_0x5536('0x17')]?_0x50a15e[_0x5536('0x17')]['where']||null:null,'attributes':_0x50a15e['options']?_0x50a15e[_0x5536('0x17')]['attributes']||null:null,'limit':_0x50a15e['options']?_0x50a15e['options'][_0x5536('0x1c')]||null:null})[_0x5536('0x19')](function(_0x216380){logger[_0x5536('0xb')]('UpdateVoiceAgentReport',_0x50a15e);logger[_0x5536('0xe')](_0x5536('0x1d'),_0x50a15e,JSON[_0x5536('0x10')](_0x216380));_0x1f46dc(_0x216380);})[_0x5536('0x14')](function(_0x20fafd){logger['error'](_0x5536('0x1d'),_0x20fafd[_0x5536('0x12')],_0x50a15e);_0x532161(_0x36149c[_0x5536('0x11')](0x1f4,_0x20fafd[_0x5536('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index b071df0..65b480e 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x7217,0x19e));var _0x7721=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x7217[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router; \ No newline at end of file +var _0x56a4=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x1ef762,_0x42bb3a){var _0x23d466=function(_0x3c4903){while(--_0x3c4903){_0x1ef762['push'](_0x1ef762['shift']());}};_0x23d466(++_0x42bb3a);}(_0x56a4,0x11b));var _0x456a=function(_0x328b40,_0x370642){_0x328b40=_0x328b40-0x0;var _0x556a56=_0x56a4[_0x328b40];return _0x556a56;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/describe',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0x8')]('/:id',auth[_0x456a('0xa')](),controller['show']);router[_0x456a('0xc')]('/',auth[_0x456a('0xa')](),controller[_0x456a('0xd')]);router[_0x456a('0xe')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x10')]);router[_0x456a('0x11')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 634ff26..9a1e13f 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcae=['ENUM','inbound','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x457732,_0x52ea72){var _0x3a5d18=function(_0x377ed0){while(--_0x377ed0){_0x457732['push'](_0x457732['shift']());}};_0x3a5d18(++_0x52ea72);}(_0xfcae,0x141));var _0xefca=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xfcae[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require(_0xefca('0x0'));module[_0xefca('0x1')]={'uniqueid':{'type':Sequelize[_0xefca('0x2')]},'type':{'type':Sequelize[_0xefca('0x3')](_0xefca('0x4'),'internal',_0xefca('0x5'),_0xefca('0x6'),_0xefca('0x7'),_0xefca('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xefca('0x2')]},'source':{'type':Sequelize[_0xefca('0x2')]},'destination':{'type':Sequelize[_0xefca('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xefca('0x2')]},'channel':{'type':Sequelize[_0xefca('0x2')]},'destinationchannel':{'type':Sequelize[_0xefca('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xefca('0x9')]},'starttime':{'type':Sequelize[_0xefca('0xa')]},'systemanswertime':{'type':Sequelize[_0xefca('0xa')]},'answertime':{'type':Sequelize[_0xefca('0xa')]},'endtime':{'type':Sequelize[_0xefca('0xa')]},'duration':{'type':Sequelize[_0xefca('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xefca('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xefca('0x2')]},'amaflags':{'type':Sequelize[_0xefca('0x2')]},'userfield':{'type':Sequelize[_0xefca('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xefca('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xefca('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xefca('0x2')]},'routeid':{'type':Sequelize[_0xefca('0xb')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd615=['inbound','internal','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x158c73,_0x5a4335){var _0x18cdcc=function(_0x40ed86){while(--_0x40ed86){_0x158c73['push'](_0x158c73['shift']());}};_0x18cdcc(++_0x5a4335);}(_0xd615,0x132));var _0x5d61=function(_0x396dea,_0x371796){_0x396dea=_0x396dea-0x0;var _0x1d0332=_0xd615[_0x396dea];return _0x1d0332;};'use strict';var Sequelize=require(_0x5d61('0x0'));module[_0x5d61('0x1')]={'uniqueid':{'type':Sequelize[_0x5d61('0x2')]},'type':{'type':Sequelize[_0x5d61('0x3')](_0x5d61('0x4'),_0x5d61('0x5'),'outbound','inbound-fax','outbound-fax',_0x5d61('0x6'))},'tag':{'type':Sequelize[_0x5d61('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x5d61('0x2')]},'destination':{'type':Sequelize[_0x5d61('0x2')]},'destinationcontext':{'type':Sequelize[_0x5d61('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5d61('0x2')]},'destinationchannel':{'type':Sequelize[_0x5d61('0x2')]},'lastapplication':{'type':Sequelize[_0x5d61('0x2')]},'lastdata':{'type':Sequelize[_0x5d61('0x7')]},'starttime':{'type':Sequelize[_0x5d61('0x8')]},'systemanswertime':{'type':Sequelize[_0x5d61('0x8')]},'answertime':{'type':Sequelize[_0x5d61('0x8')]},'endtime':{'type':Sequelize[_0x5d61('0x8')]},'duration':{'type':Sequelize[_0x5d61('0x9')]},'billableseconds':{'type':Sequelize[_0x5d61('0x9')]},'mohtime':{'type':Sequelize[_0x5d61('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5d61('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x5d61('0x2')]},'userDisposition':{'type':Sequelize[_0x5d61('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x5d61('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x5d61('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x5d61('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x5d61('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index d6eb9aa..80f09c0 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0xa09b63,_0x4a0568){var _0x4e06d7=function(_0x3adc40){while(--_0x3adc40){_0xa09b63['push'](_0xa09b63['shift']());}};_0x4e06d7(++_0x4a0568);}(_0x0b0e,0x187));var _0xe0b0=function(_0x503641,_0x33a3cf){_0x503641=_0x503641-0x0;var _0x17757d=_0x0b0e[_0x503641];return _0x17757d;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0x5f2f,0x73));var _0xf5f2=function(_0xbcc4d5,_0x301c34){_0xbcc4d5=_0xbcc4d5-0x0;var _0x481d7b=_0x5f2f[_0xbcc4d5];return _0x481d7b;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index a594e93..374ecab 100644 --- a/server/api/voiceCallReport/voiceCallReport.model.js +++ b/server/api/voiceCallReport/voiceCallReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c59=['report_call','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','VoiceCallReport'];(function(_0x3c1ca2,_0x3428ae){var _0x310c01=function(_0x1e25a2){while(--_0x1e25a2){_0x3c1ca2['push'](_0x3c1ca2['shift']());}};_0x310c01(++_0x3428ae);}(_0x1c59,0xe5));var _0x91c5=function(_0x50a7f5,_0x2c87f0){_0x50a7f5=_0x50a7f5-0x0;var _0x590d42=_0x1c59[_0x50a7f5];return _0x590d42;};'use strict';var _=require('lodash');var util=require(_0x91c5('0x0'));var logger=require(_0x91c5('0x1'))(_0x91c5('0x2'));var moment=require(_0x91c5('0x3'));var BPromise=require(_0x91c5('0x4'));var rp=require(_0x91c5('0x5'));var fs=require('fs');var path=require(_0x91c5('0x6'));var rimraf=require('rimraf');var config=require(_0x91c5('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x91c5('0x8')]=function(_0x42caaa,_0x2bcf77){return _0x42caaa[_0x91c5('0x9')](_0x91c5('0xa'),attributes,{'tableName':_0x91c5('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1d9d=['../../config/logger','api','bluebird','request-promise','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','util'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x1d9d,0x6d));var _0xd1d9=function(_0x215ad5,_0x1eb6c1){_0x215ad5=_0x215ad5-0x0;var _0x42593b=_0x1d9d[_0x215ad5];return _0x42593b;};'use strict';var _=require('lodash');var util=require(_0xd1d9('0x0'));var logger=require(_0xd1d9('0x1'))(_0xd1d9('0x2'));var moment=require('moment');var BPromise=require(_0xd1d9('0x3'));var rp=require(_0xd1d9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd1d9('0x5'));var attributes=require(_0xd1d9('0x6'));module['exports']=function(_0x714dec,_0x118183){return _0x714dec[_0xd1d9('0x7')](_0xd1d9('0x8'),attributes,{'tableName':_0xd1d9('0x9'),'paranoid':![],'indexes':[{'fields':[_0xd1d9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index d493e92..3214a4f 100644 --- a/server/api/voiceCallReport/voiceCallReport.rpc.js +++ b/server/api/voiceCallReport/voiceCallReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b9d=['UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit','include','map','model','then','CreateVoiceCallReport','create','body'];(function(_0x2652e4,_0x441296){var _0x2b0507=function(_0x2b14c5){while(--_0x2b14c5){_0x2652e4['push'](_0x2652e4['shift']());}};_0x2b0507(++_0x441296);}(_0x8b9d,0xf1));var _0xd8b9=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x8b9d[_0x3a7634];return _0x23bbe9;};'use strict';var _=require(_0xd8b9('0x0'));var util=require(_0xd8b9('0x1'));var moment=require(_0xd8b9('0x2'));var BPromise=require(_0xd8b9('0x3'));var rs=require(_0xd8b9('0x4'));var fs=require('fs');var Redis=require(_0xd8b9('0x5'));var db=require(_0xd8b9('0x6'))['db'];var utils=require(_0xd8b9('0x7'));var logger=require(_0xd8b9('0x8'))(_0xd8b9('0x9'));var config=require(_0xd8b9('0xa'));var jayson=require(_0xd8b9('0xb'));var client=jayson[_0xd8b9('0xc')][_0xd8b9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2430d7,_0x463dd1,_0x255378){return new BPromise(function(_0x4cb85,_0xa345ce){return client[_0xd8b9('0xe')](_0x2430d7,_0x255378)['then'](function(_0x525be8){logger[_0xd8b9('0xf')](_0xd8b9('0x10'),_0x463dd1,_0xd8b9('0x11'));logger[_0xd8b9('0x12')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x463dd1,_0xd8b9('0x11'),JSON[_0xd8b9('0x13')](_0x525be8));if(_0x525be8['error']){if(_0x525be8[_0xd8b9('0x14')][_0xd8b9('0x15')]===0x1f4){logger[_0xd8b9('0x14')](_0xd8b9('0x10'),_0x463dd1,_0x525be8[_0xd8b9('0x14')][_0xd8b9('0x16')]);return _0xa345ce(_0x525be8['error']['message']);}logger[_0xd8b9('0x14')](_0xd8b9('0x10'),_0x463dd1,_0x525be8[_0xd8b9('0x14')][_0xd8b9('0x16')]);return _0x4cb85(_0x525be8['error'][_0xd8b9('0x16')]);}else{logger[_0xd8b9('0xf')](_0xd8b9('0x10'),_0x463dd1,_0xd8b9('0x11'));_0x4cb85(_0x525be8[_0xd8b9('0x17')][_0xd8b9('0x16')]);}})[_0xd8b9('0x18')](function(_0x552cba){logger[_0xd8b9('0x14')](_0xd8b9('0x10'),_0x463dd1,_0x552cba);_0xa345ce(_0x552cba);});});}exports[_0xd8b9('0x19')]=function(_0x45a316){var _0x5e58dd=this;return new Promise(function(_0x4a0be0,_0x2685b0){return db[_0xd8b9('0x1a')]['findAll']({'raw':_0x45a316[_0xd8b9('0x1b')]?_0x45a316[_0xd8b9('0x1b')][_0xd8b9('0x1c')]===undefined?!![]:![]:!![],'where':_0x45a316[_0xd8b9('0x1b')]?_0x45a316[_0xd8b9('0x1b')][_0xd8b9('0x1d')]||null:null,'attributes':_0x45a316[_0xd8b9('0x1b')]?_0x45a316['options'][_0xd8b9('0x1e')]||null:null,'limit':_0x45a316[_0xd8b9('0x1b')]?_0x45a316[_0xd8b9('0x1b')][_0xd8b9('0x1f')]||null:null,'include':_0x45a316['options']?_0x45a316['options'][_0xd8b9('0x20')]?_[_0xd8b9('0x21')](_0x45a316[_0xd8b9('0x1b')][_0xd8b9('0x20')],function(_0x121aa1){return{'model':db[_0x121aa1[_0xd8b9('0x22')]],'as':_0x121aa1['as'],'attributes':_0x121aa1[_0xd8b9('0x1e')],'include':_0x121aa1['include']?_[_0xd8b9('0x21')](_0x121aa1[_0xd8b9('0x20')],function(_0x5bf913){return{'model':db[_0x5bf913[_0xd8b9('0x22')]],'as':_0x5bf913['as'],'attributes':_0x5bf913[_0xd8b9('0x1e')],'include':_0x5bf913[_0xd8b9('0x20')]?_['map'](_0x5bf913['include'],function(_0x807c0f){return{'model':db[_0x807c0f['model']],'as':_0x807c0f['as'],'attributes':_0x807c0f[_0xd8b9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd8b9('0x23')](function(_0x2f8361){logger[_0xd8b9('0xf')](_0xd8b9('0x19'),_0x45a316);logger[_0xd8b9('0x12')](_0xd8b9('0x19'),_0x45a316,JSON[_0xd8b9('0x13')](_0x2f8361));_0x4a0be0(_0x2f8361);})[_0xd8b9('0x18')](function(_0x4fa151){logger['error'](_0xd8b9('0x19'),_0x4fa151[_0xd8b9('0x16')],_0x45a316);_0x2685b0(_0x5e58dd['error'](0x1f4,_0x4fa151[_0xd8b9('0x16')]));});});};exports[_0xd8b9('0x24')]=function(_0x1114a0){var _0x414ee8=this;return new Promise(function(_0x5e6ada,_0x1dd795){return db[_0xd8b9('0x1a')][_0xd8b9('0x25')](_0x1114a0[_0xd8b9('0x26')],{'raw':_0x1114a0[_0xd8b9('0x1b')]?_0x1114a0[_0xd8b9('0x1b')][_0xd8b9('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3cab79){logger[_0xd8b9('0xf')](_0xd8b9('0x24'),_0x1114a0);logger[_0xd8b9('0x12')]('CreateVoiceCallReport',_0x1114a0,JSON[_0xd8b9('0x13')](_0x3cab79));_0x5e6ada(_0x3cab79);})[_0xd8b9('0x18')](function(_0x324569){logger[_0xd8b9('0x14')](_0xd8b9('0x24'),_0x324569[_0xd8b9('0x16')],_0x1114a0);_0x1dd795(_0x414ee8[_0xd8b9('0x14')](0x1f4,_0x324569[_0xd8b9('0x16')]));});});};exports[_0xd8b9('0x27')]=function(_0x1862d6){var _0x1848fb=this;return new Promise(function(_0x5f3719,_0x3dcd71){return db[_0xd8b9('0x1a')]['update'](_0x1862d6[_0xd8b9('0x26')],{'raw':_0x1862d6[_0xd8b9('0x1b')]?_0x1862d6[_0xd8b9('0x1b')][_0xd8b9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1862d6[_0xd8b9('0x1b')]?_0x1862d6[_0xd8b9('0x1b')][_0xd8b9('0x1d')]||null:null,'attributes':_0x1862d6[_0xd8b9('0x1b')]?_0x1862d6[_0xd8b9('0x1b')][_0xd8b9('0x1e')]||null:null,'limit':_0x1862d6[_0xd8b9('0x1b')]?_0x1862d6[_0xd8b9('0x1b')]['limit']||null:null})[_0xd8b9('0x23')](function(_0x2a6df4){logger[_0xd8b9('0xf')](_0xd8b9('0x27'),_0x1862d6);logger[_0xd8b9('0x12')](_0xd8b9('0x27'),_0x1862d6,JSON['stringify'](_0x2a6df4));_0x5f3719(_0x2a6df4);})[_0xd8b9('0x18')](function(_0x11d6a3){logger[_0xd8b9('0x14')](_0xd8b9('0x27'),_0x11d6a3[_0xd8b9('0x16')],_0x1862d6);_0x3dcd71(_0x1848fb['error'](0x1f4,_0x11d6a3[_0xd8b9('0x16')]));});});}; \ No newline at end of file +var _0x25c7=['message','info','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','VoiceCallReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','then','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x29b740,_0x467605){var _0x256b4b=function(_0x28fc94){while(--_0x28fc94){_0x29b740['push'](_0x29b740['shift']());}};_0x256b4b(++_0x467605);}(_0x25c7,0xc8));var _0x725c=function(_0x5d3b4c,_0x4b7fac){_0x5d3b4c=_0x5d3b4c-0x0;var _0x4c06ee=_0x25c7[_0x5d3b4c];return _0x4c06ee;};'use strict';var _=require(_0x725c('0x0'));var util=require(_0x725c('0x1'));var moment=require(_0x725c('0x2'));var BPromise=require(_0x725c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x725c('0x4'));var db=require(_0x725c('0x5'))['db'];var utils=require(_0x725c('0x6'));var logger=require('../../config/logger')(_0x725c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25074c,_0x1340a9,_0x536c98){return new BPromise(function(_0x10d3d2,_0x14e56e){return client['request'](_0x25074c,_0x536c98)[_0x725c('0x8')](function(_0x16655e){logger['info'](_0x725c('0x9'),_0x1340a9,'request\x20sent');logger[_0x725c('0xa')](_0x725c('0xb'),_0x1340a9,_0x725c('0xc'),JSON[_0x725c('0xd')](_0x16655e));if(_0x16655e[_0x725c('0xe')]){if(_0x16655e[_0x725c('0xe')][_0x725c('0xf')]===0x1f4){logger[_0x725c('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x1340a9,_0x16655e[_0x725c('0xe')][_0x725c('0x10')]);return _0x14e56e(_0x16655e[_0x725c('0xe')][_0x725c('0x10')]);}logger[_0x725c('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x1340a9,_0x16655e['error'][_0x725c('0x10')]);return _0x10d3d2(_0x16655e[_0x725c('0xe')]['message']);}else{logger[_0x725c('0x11')](_0x725c('0x9'),_0x1340a9,_0x725c('0xc'));_0x10d3d2(_0x16655e[_0x725c('0x12')][_0x725c('0x10')]);}})[_0x725c('0x13')](function(_0x56ca67){logger[_0x725c('0xe')](_0x725c('0x9'),_0x1340a9,_0x56ca67);_0x14e56e(_0x56ca67);});});}exports[_0x725c('0x14')]=function(_0x1bb98a){var _0x50152c=this;return new Promise(function(_0x1f76a0,_0x2fd84b){return db['VoiceCallReport'][_0x725c('0x15')]({'raw':_0x1bb98a['options']?_0x1bb98a[_0x725c('0x16')][_0x725c('0x17')]===undefined?!![]:![]:!![],'where':_0x1bb98a[_0x725c('0x16')]?_0x1bb98a[_0x725c('0x16')][_0x725c('0x18')]||null:null,'attributes':_0x1bb98a[_0x725c('0x16')]?_0x1bb98a[_0x725c('0x16')][_0x725c('0x19')]||null:null,'limit':_0x1bb98a[_0x725c('0x16')]?_0x1bb98a[_0x725c('0x16')][_0x725c('0x1a')]||null:null,'include':_0x1bb98a[_0x725c('0x16')]?_0x1bb98a[_0x725c('0x16')][_0x725c('0x1b')]?_[_0x725c('0x1c')](_0x1bb98a['options']['include'],function(_0xf58e78){return{'model':db[_0xf58e78['model']],'as':_0xf58e78['as'],'attributes':_0xf58e78[_0x725c('0x19')],'include':_0xf58e78[_0x725c('0x1b')]?_[_0x725c('0x1c')](_0xf58e78[_0x725c('0x1b')],function(_0x20ce16){return{'model':db[_0x20ce16[_0x725c('0x1d')]],'as':_0x20ce16['as'],'attributes':_0x20ce16['attributes'],'include':_0x20ce16[_0x725c('0x1b')]?_[_0x725c('0x1c')](_0x20ce16[_0x725c('0x1b')],function(_0x6d1d0b){return{'model':db[_0x6d1d0b['model']],'as':_0x6d1d0b['as'],'attributes':_0x6d1d0b[_0x725c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x725c('0x8')](function(_0x2b2df4){logger['info'](_0x725c('0x14'),_0x1bb98a);logger[_0x725c('0xa')]('GetVoiceCallReport',_0x1bb98a,JSON[_0x725c('0xd')](_0x2b2df4));_0x1f76a0(_0x2b2df4);})['catch'](function(_0x1fa5a4){logger[_0x725c('0xe')](_0x725c('0x14'),_0x1fa5a4[_0x725c('0x10')],_0x1bb98a);_0x2fd84b(_0x50152c[_0x725c('0xe')](0x1f4,_0x1fa5a4['message']));});});};exports[_0x725c('0x1e')]=function(_0x265bfa){var _0x3a7508=this;return new Promise(function(_0x3dea56,_0x1cc182){return db['VoiceCallReport'][_0x725c('0x1f')](_0x265bfa[_0x725c('0x20')],{'raw':_0x265bfa[_0x725c('0x16')]?_0x265bfa[_0x725c('0x16')][_0x725c('0x17')]===undefined?!![]:![]:!![]})[_0x725c('0x8')](function(_0x1e65be){logger['info'](_0x725c('0x1e'),_0x265bfa);logger[_0x725c('0xa')]('CreateVoiceCallReport',_0x265bfa,JSON[_0x725c('0xd')](_0x1e65be));_0x3dea56(_0x1e65be);})[_0x725c('0x13')](function(_0x1c1344){logger[_0x725c('0xe')](_0x725c('0x1e'),_0x1c1344[_0x725c('0x10')],_0x265bfa);_0x1cc182(_0x3a7508[_0x725c('0xe')](0x1f4,_0x1c1344[_0x725c('0x10')]));});});};exports[_0x725c('0x21')]=function(_0xdb5ec2){var _0x34048f=this;return new Promise(function(_0x10e38a,_0x548534){return db[_0x725c('0x22')][_0x725c('0x23')](_0xdb5ec2[_0x725c('0x20')],{'raw':_0xdb5ec2[_0x725c('0x16')]?_0xdb5ec2[_0x725c('0x16')][_0x725c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdb5ec2[_0x725c('0x16')]?_0xdb5ec2['options'][_0x725c('0x18')]||null:null,'attributes':_0xdb5ec2[_0x725c('0x16')]?_0xdb5ec2[_0x725c('0x16')][_0x725c('0x19')]||null:null,'limit':_0xdb5ec2['options']?_0xdb5ec2[_0x725c('0x16')][_0x725c('0x1a')]||null:null})[_0x725c('0x8')](function(_0x42fc46){logger['info']('UpdateVoiceCallReport',_0xdb5ec2);logger[_0x725c('0xa')](_0x725c('0x21'),_0xdb5ec2,JSON[_0x725c('0xd')](_0x42fc46));_0x10e38a(_0x42fc46);})['catch'](function(_0x59d2d6){logger['error'](_0x725c('0x21'),_0x59d2d6['message'],_0xdb5ec2);_0x548534(_0x34048f[_0x725c('0xe')](0x1f4,_0x59d2d6[_0x725c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index e3f22a3..2129281 100644 --- a/server/api/voiceChanSpy/index.js +++ b/server/api/voiceChanSpy/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x216f=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x216f,0x1c0));var _0xf216=function(_0x4d2e30,_0x1fa8a9){_0x4d2e30=_0x4d2e30-0x0;var _0x14ad51=_0x216f[_0x4d2e30];return _0x14ad51;};'use strict';var multer=require('multer');var util=require(_0xf216('0x0'));var path=require(_0xf216('0x1'));var timeout=require(_0xf216('0x2'));var express=require(_0xf216('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf216('0x4'));var config=require(_0xf216('0x5'));var controller=require(_0xf216('0x6'));router[_0xf216('0x7')]('/',auth[_0xf216('0x8')](),controller[_0xf216('0x9')]);router[_0xf216('0x7')](_0xf216('0xa'),auth['isAuthenticated'](),controller[_0xf216('0xb')]);router[_0xf216('0xc')]('/',auth['isAuthenticated'](),controller[_0xf216('0xd')]);router[_0xf216('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf216('0xf')]);router[_0xf216('0x10')]('/:id',auth[_0xf216('0x8')](),controller[_0xf216('0x11')]);module[_0xf216('0x12')]=router; \ No newline at end of file +var _0x0629=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id','update','delete'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0x0629,0x156));var _0x9062=function(_0x2bc2cc,_0x256e16){_0x2bc2cc=_0x2bc2cc-0x0;var _0x205a9d=_0x0629[_0x2bc2cc];return _0x205a9d;};'use strict';var multer=require(_0x9062('0x0'));var util=require(_0x9062('0x1'));var path=require(_0x9062('0x2'));var timeout=require(_0x9062('0x3'));var express=require(_0x9062('0x4'));var router=express[_0x9062('0x5')]();var fs_extra=require(_0x9062('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9062('0x7'));var config=require(_0x9062('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x9062('0x9')]('/',auth[_0x9062('0xa')](),controller[_0x9062('0xb')]);router[_0x9062('0x9')]('/:id',auth[_0x9062('0xa')](),controller['show']);router[_0x9062('0xc')]('/',auth[_0x9062('0xa')](),controller[_0x9062('0xd')]);router[_0x9062('0xe')](_0x9062('0xf'),auth[_0x9062('0xa')](),controller[_0x9062('0x10')]);router[_0x9062('0x11')](_0x9062('0xf'),auth['isAuthenticated'](),controller[_0x9062('0x12')]);module[_0x9062('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 915d075..8e3c7bd 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js +++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cbd=['options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9cbd,0x145));var _0xd9cb=function(_0x35709c,_0x54a93d){_0x35709c=_0x35709c-0x0;var _0x15a19d=_0x9cbd[_0x35709c];return _0x15a19d;};'use strict';var Sequelize=require(_0xd9cb('0x0'));module[_0xd9cb('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xd9cb('0x2')],'unique':_0xd9cb('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xd9cb('0x2')],'set':function(_0x4d7611){this[_0xd9cb('0x4')](_0xd9cb('0x5'),_0x4d7611?_0x4d7611[_0xd9cb('0x6')](''):[]);},'get':function(){return this[_0xd9cb('0x7')](_0xd9cb('0x5'))?this[_0xd9cb('0x7')](_0xd9cb('0x5'))[_0xd9cb('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xd9cb('0x2')]},'record':{'type':Sequelize[_0xd9cb('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd9cb('0x2')]}}; \ No newline at end of file +var _0x8001=['STRING','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x2cfa02,_0x36fd77){var _0x2d4622=function(_0x1c11a7){while(--_0x1c11a7){_0x2cfa02['push'](_0x2cfa02['shift']());}};_0x2d4622(++_0x36fd77);}(_0x8001,0x19c));var _0x1800=function(_0x3b8d0c,_0x136302){_0x3b8d0c=_0x3b8d0c-0x0;var _0x5b4163=_0x8001[_0x3b8d0c];return _0x5b4163;};'use strict';var Sequelize=require(_0x1800('0x0'));module[_0x1800('0x1')]={'name':{'type':Sequelize[_0x1800('0x2')]},'prefix':{'type':Sequelize[_0x1800('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x1800('0x2')],'set':function(_0x41d9b0){this[_0x1800('0x3')](_0x1800('0x4'),_0x41d9b0?_0x41d9b0[_0x1800('0x5')](''):[]);},'get':function(){return this[_0x1800('0x6')](_0x1800('0x4'))?this[_0x1800('0x6')](_0x1800('0x4'))[_0x1800('0x7')](''):[];}},'auth':{'type':Sequelize[_0x1800('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x1800('0x2')]},'record':{'type':Sequelize[_0x1800('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1800('0x2')]},'description':{'type':Sequelize[_0x1800('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index faf63b0..f4f0fc0 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.controller.js +++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa769=['include','catch','show','params','keys','length','includeAll','find','create','user','role','get','ChanSpies','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xa769,0xfb));var _0x9a76=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa769[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x9a76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a76('0x1'));var jsonpatch=require(_0x9a76('0x2'));var rp=require(_0x9a76('0x3'));var moment=require('moment');var BPromise=require(_0x9a76('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9a76('0x5'));var sox=require(_0x9a76('0x6'));var csv=require('to-csv');var ejs=require(_0x9a76('0x7'));var fs=require('fs');var fs_extra=require(_0x9a76('0x8'));var _=require(_0x9a76('0x9'));var squel=require(_0x9a76('0xa'));var crypto=require(_0x9a76('0xb'));var jsforce=require(_0x9a76('0xc'));var deskjs=require(_0x9a76('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9a76('0xe'));var Papa=require(_0x9a76('0xf'));var Redis=require(_0x9a76('0x10'));var authService=require(_0x9a76('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a76('0x12'));var logger=require('../../config/logger')(_0x9a76('0x13'));var utils=require(_0x9a76('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9a76('0x15'));var db=require(_0x9a76('0x16'))['db'];function respondWithStatusCode(_0x5852f9,_0x34b7c9){_0x34b7c9=_0x34b7c9||0xcc;return function(_0x30d1be){if(_0x30d1be){return _0x5852f9[_0x9a76('0x17')](_0x34b7c9);}return _0x5852f9[_0x9a76('0x18')](_0x34b7c9)[_0x9a76('0x19')]();};}function respondWithResult(_0xbb0dda,_0x204e33){_0x204e33=_0x204e33||0xc8;return function(_0x28ebac){if(_0x28ebac){return _0xbb0dda[_0x9a76('0x18')](_0x204e33)[_0x9a76('0x1a')](_0x28ebac);}};}function respondWithFilteredResult(_0x42cd61,_0x259664){return function(_0x1e687a){if(_0x1e687a){var _0x54028e=typeof _0x259664[_0x9a76('0x1b')]==='undefined'&&typeof _0x259664[_0x9a76('0x1c')]===_0x9a76('0x1d');var _0x140b08=_0x1e687a[_0x9a76('0x1e')];var _0x38e509=_0x54028e?0x0:_0x259664[_0x9a76('0x1b')];var _0x58a964=_0x54028e?_0x1e687a['count']:_0x259664[_0x9a76('0x1b')]+_0x259664[_0x9a76('0x1c')];var _0x248dcb;if(_0x58a964>=_0x140b08){_0x58a964=_0x140b08;_0x248dcb=0xc8;}else{_0x248dcb=0xce;}_0x42cd61[_0x9a76('0x18')](_0x248dcb);return _0x42cd61[_0x9a76('0x1f')](_0x9a76('0x20'),_0x38e509+'-'+_0x58a964+'/'+_0x140b08)['json'](_0x1e687a);}return null;};}function patchUpdates(_0x17de93){return function(_0x3ebe6c){try{jsonpatch['apply'](_0x3ebe6c,_0x17de93,!![]);}catch(_0x2e9dcf){return BPromise[_0x9a76('0x21')](_0x2e9dcf);}return _0x3ebe6c['save']();};}function saveUpdates(_0x3adc8e,_0x35b608){return function(_0x3e978f){if(_0x3e978f){return _0x3e978f[_0x9a76('0x22')](_0x3adc8e)[_0x9a76('0x23')](function(_0x4a40bf){return _0x4a40bf;});}return null;};}function removeEntity(_0x1a4667,_0x5c3afa){return function(_0x523727){if(_0x523727){return _0x523727[_0x9a76('0x24')]()[_0x9a76('0x23')](function(){var _0x4c9391=_0x523727['get']({'plain':!![]});var _0x3d7f2b='ChanSpies';return db['UserProfileResource'][_0x9a76('0x24')]({'where':{'type':_0x3d7f2b,'resourceId':_0x4c9391['id']}})['then'](function(){return _0x523727;});})[_0x9a76('0x23')](function(){_0x1a4667[_0x9a76('0x18')](0xcc)[_0x9a76('0x19')]();});}};}function handleEntityNotFound(_0x2d141a,_0x43ffc7){return function(_0x3d228d){if(!_0x3d228d){_0x2d141a[_0x9a76('0x17')](0x194);}return _0x3d228d;};}function handleError(_0x962bc4,_0x57152c){_0x57152c=_0x57152c||0x1f4;return function(_0x42c35b){logger['error'](_0x42c35b[_0x9a76('0x25')]);if(_0x42c35b[_0x9a76('0x26')]){delete _0x42c35b[_0x9a76('0x26')];}_0x962bc4['status'](_0x57152c)[_0x9a76('0x27')](_0x42c35b);};}exports[_0x9a76('0x28')]=function(_0x36ad86,_0x3289b3){var _0x266e54={},_0x26fbaa={},_0x50956f={'count':0x0,'rows':[]};var _0x318d2d=_[_0x9a76('0x29')](db[_0x9a76('0x2a')][_0x9a76('0x2b')],function(_0x4d9f6e){return{'name':_0x4d9f6e[_0x9a76('0x2c')],'type':_0x4d9f6e[_0x9a76('0x2d')][_0x9a76('0x2e')]};});_0x26fbaa['model']=_[_0x9a76('0x29')](_0x318d2d,_0x9a76('0x26'));_0x26fbaa[_0x9a76('0x2f')]=_['keys'](_0x36ad86[_0x9a76('0x2f')]);_0x26fbaa[_0x9a76('0x30')]=_[_0x9a76('0x31')](_0x26fbaa[_0x9a76('0x32')],_0x26fbaa[_0x9a76('0x2f')]);_0x266e54['attributes']=_[_0x9a76('0x31')](_0x26fbaa['model'],qs[_0x9a76('0x33')](_0x36ad86[_0x9a76('0x2f')][_0x9a76('0x33')]));_0x266e54['attributes']=_0x266e54['attributes']['length']?_0x266e54[_0x9a76('0x34')]:_0x26fbaa[_0x9a76('0x32')];if(!_0x36ad86['query'][_0x9a76('0x35')](_0x9a76('0x36'))){_0x266e54[_0x9a76('0x1c')]=qs[_0x9a76('0x1c')](_0x36ad86[_0x9a76('0x2f')][_0x9a76('0x1c')]);_0x266e54['offset']=qs[_0x9a76('0x1b')](_0x36ad86['query'][_0x9a76('0x1b')]);}_0x266e54['order']=qs[_0x9a76('0x37')](_0x36ad86['query'][_0x9a76('0x37')]);_0x266e54[_0x9a76('0x38')]=qs[_0x9a76('0x30')](_['pick'](_0x36ad86['query'],_0x26fbaa[_0x9a76('0x30')]),_0x318d2d);if(_0x36ad86['query'][_0x9a76('0x39')]){_0x266e54[_0x9a76('0x38')]=_[_0x9a76('0x3a')](_0x266e54[_0x9a76('0x38')],{'$or':_['map'](_0x318d2d,function(_0x2ac6ec){if(_0x2ac6ec['type']!==_0x9a76('0x3b')){var _0x4f6970={};_0x4f6970[_0x2ac6ec[_0x9a76('0x26')]]={'$like':'%'+_0x36ad86[_0x9a76('0x2f')][_0x9a76('0x39')]+'%'};return _0x4f6970;}})});}_0x266e54=_[_0x9a76('0x3a')]({},_0x266e54,_0x36ad86[_0x9a76('0x3c')]);var _0x39358c={'where':_0x266e54[_0x9a76('0x38')]};return db[_0x9a76('0x2a')][_0x9a76('0x1e')](_0x39358c)[_0x9a76('0x23')](function(_0x56145d){_0x50956f[_0x9a76('0x1e')]=_0x56145d;if(_0x36ad86['query']['includeAll']){_0x266e54[_0x9a76('0x3d')]=[{'all':!![]}];}return db[_0x9a76('0x2a')]['findAll'](_0x266e54);})[_0x9a76('0x23')](function(_0x4a32ca){_0x50956f['rows']=_0x4a32ca;return _0x50956f;})[_0x9a76('0x23')](respondWithFilteredResult(_0x3289b3,_0x266e54))[_0x9a76('0x3e')](handleError(_0x3289b3,null));};exports[_0x9a76('0x3f')]=function(_0x2d372f,_0x168e2d){var _0x4a750d={'raw':![],'where':{'id':_0x2d372f[_0x9a76('0x40')]['id']}},_0x15f3e6={};_0x15f3e6[_0x9a76('0x32')]=_[_0x9a76('0x41')](db[_0x9a76('0x2a')]['rawAttributes']);_0x15f3e6[_0x9a76('0x2f')]=_[_0x9a76('0x41')](_0x2d372f[_0x9a76('0x2f')]);_0x15f3e6[_0x9a76('0x30')]=_[_0x9a76('0x31')](_0x15f3e6['model'],_0x15f3e6[_0x9a76('0x2f')]);_0x4a750d[_0x9a76('0x34')]=_[_0x9a76('0x31')](_0x15f3e6['model'],qs[_0x9a76('0x33')](_0x2d372f[_0x9a76('0x2f')][_0x9a76('0x33')]));_0x4a750d[_0x9a76('0x34')]=_0x4a750d[_0x9a76('0x34')][_0x9a76('0x42')]?_0x4a750d['attributes']:_0x15f3e6[_0x9a76('0x32')];if(_0x2d372f[_0x9a76('0x2f')][_0x9a76('0x43')]){_0x4a750d[_0x9a76('0x3d')]=[{'all':!![]}];}_0x4a750d=_[_0x9a76('0x3a')]({},_0x4a750d,_0x2d372f['options']);return db['VoiceChanSpy'][_0x9a76('0x44')](_0x4a750d)[_0x9a76('0x23')](handleEntityNotFound(_0x168e2d,null))['then'](respondWithResult(_0x168e2d,null))['catch'](handleError(_0x168e2d,null));};exports[_0x9a76('0x45')]=function(_0x1dd4fd,_0x17cc8f){return db[_0x9a76('0x2a')][_0x9a76('0x45')](_0x1dd4fd['body'],{})[_0x9a76('0x23')](function(_0x5768c8){var _0x547bcb=_0x1dd4fd[_0x9a76('0x46')]['get']({'plain':!![]});if(!_0x547bcb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x547bcb[_0x9a76('0x47')]===_0x9a76('0x46')){var _0x5216b9=_0x5768c8[_0x9a76('0x48')]({'plain':!![]});var _0x95d953=_0x9a76('0x49');return db['UserProfileSection'][_0x9a76('0x44')]({'where':{'name':_0x95d953,'userProfileId':_0x547bcb['userProfileId']},'raw':!![]})[_0x9a76('0x23')](function(_0x5da34d){if(_0x5da34d&&_0x5da34d['autoAssociation']===0x0){return db[_0x9a76('0x4a')][_0x9a76('0x45')]({'name':_0x5216b9[_0x9a76('0x26')],'resourceId':_0x5216b9['id'],'type':_0x5da34d['name'],'sectionId':_0x5da34d['id']},{})['then'](function(){return _0x5768c8;});}else{return _0x5768c8;}})[_0x9a76('0x3e')](function(_0x3d1d86){logger[_0x9a76('0x4b')](_0x9a76('0x4c'),_0x3d1d86);throw _0x3d1d86;});}return _0x5768c8;})[_0x9a76('0x23')](respondWithResult(_0x17cc8f,0xc9))[_0x9a76('0x3e')](handleError(_0x17cc8f,null));};exports['update']=function(_0x1cd9b2,_0x39a2eb){if(_0x1cd9b2[_0x9a76('0x4d')]['id']){delete _0x1cd9b2[_0x9a76('0x4d')]['id'];}return db[_0x9a76('0x2a')][_0x9a76('0x44')]({'where':{'id':_0x1cd9b2[_0x9a76('0x40')]['id']}})['then'](handleEntityNotFound(_0x39a2eb,null))[_0x9a76('0x23')](saveUpdates(_0x1cd9b2[_0x9a76('0x4d')],null))[_0x9a76('0x23')](respondWithResult(_0x39a2eb,null))['catch'](handleError(_0x39a2eb,null));};exports[_0x9a76('0x24')]=function(_0x40383f,_0x47e0d9){return db['VoiceChanSpy']['find']({'where':{'id':_0x40383f['params']['id']}})[_0x9a76('0x23')](handleEntityNotFound(_0x47e0d9,null))[_0x9a76('0x23')](removeEntity(_0x47e0d9,null))[_0x9a76('0x3e')](handleError(_0x47e0d9,null));}; \ No newline at end of file +var _0x225c=['catch','show','params','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','include','VoiceChanSpy','findAll','rows'];(function(_0x1790a6,_0x3d7bec){var _0x96c32=function(_0x5a818b){while(--_0x5a818b){_0x1790a6['push'](_0x1790a6['shift']());}};_0x96c32(++_0x3d7bec);}(_0x225c,0x106));var _0xc225=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x225c[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xc225('0x0'));var rimraf=require(_0xc225('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc225('0x2'));var moment=require('moment');var BPromise=require(_0xc225('0x3'));var Mustache=require(_0xc225('0x4'));var util=require(_0xc225('0x5'));var path=require(_0xc225('0x6'));var sox=require(_0xc225('0x7'));var csv=require(_0xc225('0x8'));var ejs=require(_0xc225('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc225('0xa'));var squel=require(_0xc225('0xb'));var crypto=require(_0xc225('0xc'));var jsforce=require(_0xc225('0xd'));var deskjs=require(_0xc225('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc225('0xf'));var Papa=require('papaparse');var Redis=require(_0xc225('0x10'));var authService=require(_0xc225('0x11'));var qs=require(_0xc225('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc225('0x13'));var logger=require(_0xc225('0x14'))(_0xc225('0x15'));var utils=require(_0xc225('0x16'));var config=require(_0xc225('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc225('0x18'))['db'];function respondWithStatusCode(_0x460f86,_0x551d77){_0x551d77=_0x551d77||0xcc;return function(_0x57189b){if(_0x57189b){return _0x460f86[_0xc225('0x19')](_0x551d77);}return _0x460f86[_0xc225('0x1a')](_0x551d77)[_0xc225('0x1b')]();};}function respondWithResult(_0x5a3e02,_0x5d421f){_0x5d421f=_0x5d421f||0xc8;return function(_0x48db11){if(_0x48db11){return _0x5a3e02['status'](_0x5d421f)['json'](_0x48db11);}};}function respondWithFilteredResult(_0x4d55be,_0xe950b8){return function(_0x40b1a6){if(_0x40b1a6){var _0x520049=typeof _0xe950b8[_0xc225('0x1c')]==='undefined'&&typeof _0xe950b8['limit']===_0xc225('0x1d');var _0x5d1c4a=_0x40b1a6[_0xc225('0x1e')];var _0x3bedfb=_0x520049?0x0:_0xe950b8['offset'];var _0x3efc1d=_0x520049?_0x40b1a6[_0xc225('0x1e')]:_0xe950b8[_0xc225('0x1c')]+_0xe950b8[_0xc225('0x1f')];var _0x14e2a0;if(_0x3efc1d>=_0x5d1c4a){_0x3efc1d=_0x5d1c4a;_0x14e2a0=0xc8;}else{_0x14e2a0=0xce;}_0x4d55be[_0xc225('0x1a')](_0x14e2a0);return _0x4d55be[_0xc225('0x20')]('Content-Range',_0x3bedfb+'-'+_0x3efc1d+'/'+_0x5d1c4a)[_0xc225('0x21')](_0x40b1a6);}return null;};}function patchUpdates(_0x1efef5){return function(_0x194f4b){try{jsonpatch[_0xc225('0x22')](_0x194f4b,_0x1efef5,!![]);}catch(_0x571841){return BPromise[_0xc225('0x23')](_0x571841);}return _0x194f4b['save']();};}function saveUpdates(_0x45a276,_0x54429f){return function(_0x515632){if(_0x515632){return _0x515632[_0xc225('0x24')](_0x45a276)[_0xc225('0x25')](function(_0x54000c){return _0x54000c;});}return null;};}function removeEntity(_0x5cede3,_0x5572e4){return function(_0x5ca305){if(_0x5ca305){return _0x5ca305[_0xc225('0x26')]()['then'](function(){var _0x347247=_0x5ca305[_0xc225('0x27')]({'plain':!![]});var _0x3c9452=_0xc225('0x28');return db[_0xc225('0x29')][_0xc225('0x26')]({'where':{'type':_0x3c9452,'resourceId':_0x347247['id']}})[_0xc225('0x25')](function(){return _0x5ca305;});})[_0xc225('0x25')](function(){_0x5cede3[_0xc225('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x76b9,_0x4e9cee){return function(_0x1caf12){if(!_0x1caf12){_0x76b9[_0xc225('0x19')](0x194);}return _0x1caf12;};}function handleError(_0x2b4e26,_0xf21727){_0xf21727=_0xf21727||0x1f4;return function(_0xa59278){logger[_0xc225('0x2a')](_0xa59278[_0xc225('0x2b')]);if(_0xa59278[_0xc225('0x2c')]){delete _0xa59278['name'];}_0x2b4e26[_0xc225('0x1a')](_0xf21727)[_0xc225('0x2d')](_0xa59278);};}exports['index']=function(_0x46c7f5,_0x2f95cb){var _0x4e5ad2={},_0x1477ae={},_0x359f24={'count':0x0,'rows':[]};var _0x33d5d1=_['map'](db['VoiceChanSpy'][_0xc225('0x2e')],function(_0x19ce86){return{'name':_0x19ce86[_0xc225('0x2f')],'type':_0x19ce86[_0xc225('0x30')][_0xc225('0x31')]};});_0x1477ae[_0xc225('0x32')]=_[_0xc225('0x33')](_0x33d5d1,_0xc225('0x2c'));_0x1477ae[_0xc225('0x34')]=_[_0xc225('0x35')](_0x46c7f5[_0xc225('0x34')]);_0x1477ae[_0xc225('0x36')]=_[_0xc225('0x37')](_0x1477ae[_0xc225('0x32')],_0x1477ae[_0xc225('0x34')]);_0x4e5ad2[_0xc225('0x38')]=_['intersection'](_0x1477ae[_0xc225('0x32')],qs[_0xc225('0x39')](_0x46c7f5[_0xc225('0x34')][_0xc225('0x39')]));_0x4e5ad2['attributes']=_0x4e5ad2[_0xc225('0x38')][_0xc225('0x3a')]?_0x4e5ad2['attributes']:_0x1477ae[_0xc225('0x32')];if(!_0x46c7f5[_0xc225('0x34')]['hasOwnProperty'](_0xc225('0x3b'))){_0x4e5ad2['limit']=qs[_0xc225('0x1f')](_0x46c7f5[_0xc225('0x34')][_0xc225('0x1f')]);_0x4e5ad2[_0xc225('0x1c')]=qs[_0xc225('0x1c')](_0x46c7f5[_0xc225('0x34')][_0xc225('0x1c')]);}_0x4e5ad2[_0xc225('0x3c')]=qs[_0xc225('0x3d')](_0x46c7f5['query'][_0xc225('0x3d')]);_0x4e5ad2[_0xc225('0x3e')]=qs['filters'](_[_0xc225('0x3f')](_0x46c7f5[_0xc225('0x34')],_0x1477ae[_0xc225('0x36')]),_0x33d5d1);if(_0x46c7f5[_0xc225('0x34')][_0xc225('0x40')]){_0x4e5ad2[_0xc225('0x3e')]=_[_0xc225('0x41')](_0x4e5ad2[_0xc225('0x3e')],{'$or':_[_0xc225('0x33')](_0x33d5d1,function(_0x17fef0){if(_0x17fef0[_0xc225('0x30')]!=='VIRTUAL'){var _0xcc1c77={};_0xcc1c77[_0x17fef0[_0xc225('0x2c')]]={'$like':'%'+_0x46c7f5[_0xc225('0x34')][_0xc225('0x40')]+'%'};return _0xcc1c77;}})});}_0x4e5ad2=_[_0xc225('0x41')]({},_0x4e5ad2,_0x46c7f5['options']);var _0x55241c={'where':_0x4e5ad2[_0xc225('0x3e')]};return db['VoiceChanSpy'][_0xc225('0x1e')](_0x55241c)[_0xc225('0x25')](function(_0x2a4c5f){_0x359f24[_0xc225('0x1e')]=_0x2a4c5f;if(_0x46c7f5[_0xc225('0x34')]['includeAll']){_0x4e5ad2[_0xc225('0x42')]=[{'all':!![]}];}return db[_0xc225('0x43')][_0xc225('0x44')](_0x4e5ad2);})[_0xc225('0x25')](function(_0x3083f4){_0x359f24[_0xc225('0x45')]=_0x3083f4;return _0x359f24;})[_0xc225('0x25')](respondWithFilteredResult(_0x2f95cb,_0x4e5ad2))[_0xc225('0x46')](handleError(_0x2f95cb,null));};exports[_0xc225('0x47')]=function(_0x4c74b0,_0x5bd1cd){var _0x5b1c13={'raw':![],'where':{'id':_0x4c74b0[_0xc225('0x48')]['id']}},_0x2d39fb={};_0x2d39fb[_0xc225('0x32')]=_['keys'](db[_0xc225('0x43')][_0xc225('0x2e')]);_0x2d39fb['query']=_[_0xc225('0x35')](_0x4c74b0[_0xc225('0x34')]);_0x2d39fb[_0xc225('0x36')]=_[_0xc225('0x37')](_0x2d39fb['model'],_0x2d39fb['query']);_0x5b1c13[_0xc225('0x38')]=_[_0xc225('0x37')](_0x2d39fb[_0xc225('0x32')],qs[_0xc225('0x39')](_0x4c74b0['query'][_0xc225('0x39')]));_0x5b1c13[_0xc225('0x38')]=_0x5b1c13[_0xc225('0x38')]['length']?_0x5b1c13['attributes']:_0x2d39fb['model'];if(_0x4c74b0[_0xc225('0x34')][_0xc225('0x49')]){_0x5b1c13[_0xc225('0x42')]=[{'all':!![]}];}_0x5b1c13=_[_0xc225('0x41')]({},_0x5b1c13,_0x4c74b0[_0xc225('0x4a')]);return db[_0xc225('0x43')]['find'](_0x5b1c13)[_0xc225('0x25')](handleEntityNotFound(_0x5bd1cd,null))['then'](respondWithResult(_0x5bd1cd,null))[_0xc225('0x46')](handleError(_0x5bd1cd,null));};exports[_0xc225('0x4b')]=function(_0x4abcb1,_0x3ffca3){return db['VoiceChanSpy'][_0xc225('0x4b')](_0x4abcb1[_0xc225('0x4c')],{})[_0xc225('0x25')](function(_0x342a48){var _0x353d4e=_0x4abcb1['user']['get']({'plain':!![]});if(!_0x353d4e)throw new Error(_0xc225('0x4d'));if(_0x353d4e[_0xc225('0x4e')]===_0xc225('0x4f')){var _0x301ca3=_0x342a48['get']({'plain':!![]});var _0x271fa4=_0xc225('0x28');return db[_0xc225('0x50')][_0xc225('0x51')]({'where':{'name':_0x271fa4,'userProfileId':_0x353d4e['userProfileId']},'raw':!![]})[_0xc225('0x25')](function(_0x4dc574){if(_0x4dc574&&_0x4dc574['autoAssociation']===0x0){return db[_0xc225('0x29')][_0xc225('0x4b')]({'name':_0x301ca3[_0xc225('0x2c')],'resourceId':_0x301ca3['id'],'type':_0x4dc574[_0xc225('0x2c')],'sectionId':_0x4dc574['id']},{})[_0xc225('0x25')](function(){return _0x342a48;});}else{return _0x342a48;}})[_0xc225('0x46')](function(_0x2a666a){logger[_0xc225('0x2a')](_0xc225('0x52'),_0x2a666a);throw _0x2a666a;});}return _0x342a48;})[_0xc225('0x25')](respondWithResult(_0x3ffca3,0xc9))[_0xc225('0x46')](handleError(_0x3ffca3,null));};exports[_0xc225('0x24')]=function(_0x20da65,_0x9c6486){if(_0x20da65[_0xc225('0x4c')]['id']){delete _0x20da65['body']['id'];}return db[_0xc225('0x43')]['find']({'where':{'id':_0x20da65[_0xc225('0x48')]['id']}})[_0xc225('0x25')](handleEntityNotFound(_0x9c6486,null))['then'](saveUpdates(_0x20da65[_0xc225('0x4c')],null))['then'](respondWithResult(_0x9c6486,null))[_0xc225('0x46')](handleError(_0x9c6486,null));};exports[_0xc225('0x26')]=function(_0x375d89,_0x1434f8){return db[_0xc225('0x43')][_0xc225('0x51')]({'where':{'id':_0x375d89[_0xc225('0x48')]['id']}})[_0xc225('0x25')](handleEntityNotFound(_0x1434f8,null))[_0xc225('0x25')](removeEntity(_0x1434f8,null))[_0xc225('0x46')](handleError(_0x1434f8,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 56da61d..a2e9aa5 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.model.js +++ b/server/api/voiceChanSpy/voiceChanSpy.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87fa=['options','StopMixMonitor','length','internal','name','concat','User','agent','exports','models','then','bulkCreate','VoiceExtension','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','merge','Set','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','ChanSpy','SIP/%s,%s'];(function(_0xdb5214,_0x1646a3){var _0x31b3c6=function(_0x11ca4b){while(--_0x11ca4b){_0xdb5214['push'](_0xdb5214['shift']());}};_0x31b3c6(++_0x1646a3);}(_0x87fa,0x11f));var _0xa87f=function(_0x540930,_0x282706){_0x540930=_0x540930-0x0;var _0x45e96a=_0x87fa[_0x540930];return _0x45e96a;};'use strict';var _=require(_0xa87f('0x0'));var util=require(_0xa87f('0x1'));var BPromise=require(_0xa87f('0x2'));var attributes=require(_0xa87f('0x3'));var getUserApplications=function(_0x3f381f,_0x420a20,_0x19ee51){var _0x34b964=0x1;var _0x365193=[];var _0x4c2fa1={'context':_0x420a20[_0xa87f('0x4')]||_0xa87f('0x5'),'exten':util[_0xa87f('0x6')](_0xa87f('0x7'),_0x3f381f[_0xa87f('0x8')],_0x19ee51),'type':'system','isApp':![],'ChanSpyId':_0x3f381f['id'],'UserId':_0x420a20['id']};_0x365193['push'](_[_0xa87f('0x9')]({'app':_0xa87f('0xa'),'appdata':util[_0xa87f('0x6')](_0xa87f('0xb'),_0xa87f('0xc')),'priority':_0x34b964++},_0x4c2fa1));if(_0x3f381f[_0xa87f('0xd')]){_0x365193[_0xa87f('0xe')](_[_0xa87f('0x9')]({'app':_0xa87f('0xf'),'appdata':util[_0xa87f('0x6')](_0xa87f('0x10'),_0x3f381f['recordingFormat']),'priority':_0x34b964++},_0x4c2fa1));}if(_0x3f381f['auth']){_0x365193[_0xa87f('0xe')](_[_0xa87f('0x9')]({'app':'Authenticate','appdata':_0x3f381f['password'],'priority':_0x34b964++},_0x4c2fa1));}_0x365193[_0xa87f('0xe')](_['merge']({'app':_0xa87f('0x11'),'appdata':util[_0xa87f('0x6')](_0xa87f('0x12'),_0x420a20['name'],_0x3f381f[_0xa87f('0x13')]?_0x3f381f[_0xa87f('0x13')]['join'](''):''),'priority':_0x34b964++},_0x4c2fa1));if(_0x3f381f[_0xa87f('0xd')]){_0x365193['push'](_[_0xa87f('0x9')]({'app':_0xa87f('0x14'),'priority':_0x34b964++},_0x4c2fa1));}return _0x365193;};var getChanSpyApplications=function(_0x38ee4a,_0x3f60f2){var _0x550d72=[];for(var _0x5c769f=0x0,_0x5d0bc3=0x1;_0x5c769f<_0x3f60f2[_0xa87f('0x15')];_0x5c769f++,_0x5d0bc3=0x1){_0x550d72=_0x550d72['concat'](getUserApplications(_0x38ee4a,_0x3f60f2[_0x5c769f],_0x3f60f2[_0x5c769f][_0xa87f('0x16')]));if(_0x3f60f2[_0x5c769f][_0xa87f('0x16')]!=_0x3f60f2[_0x5c769f][_0xa87f('0x17')]){_0x550d72=_0x550d72[_0xa87f('0x18')](getUserApplications(_0x38ee4a,_0x3f60f2[_0x5c769f],_0x3f60f2[_0x5c769f][_0xa87f('0x17')]));}}return _0x550d72;};var getChanSpyPromise=function(_0x378257,_0x3b4d42){return new BPromise(function(_0xd085d2,_0x59b51d){return _0x378257[_0xa87f('0x19')]['findAll']({'attributes':['id',_0xa87f('0x17'),'internal'],'where':{'role':_0xa87f('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x38ef83){if(_0x38ef83){return _0xd085d2(getChanSpyApplications(_0x3b4d42,_0x38ef83));}return _0xd085d2([]);})['catch'](function(_0x3783f8){_0x59b51d(_0x3783f8);});});};module[_0xa87f('0x1b')]=function(_0x2ed4ba,_0x3be474){var _0x4237ae=_0x2ed4ba[_0xa87f('0x1c')];return _0x2ed4ba['define']('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a8b26,_0x1e1e69,_0x5d85ff){return getChanSpyPromise(_0x4237ae,_0x2a8b26)[_0xa87f('0x1d')](function(_0x3a829f){if(_0x3a829f&&_0x3a829f[_0xa87f('0x15')]){return _0x4237ae['VoiceExtension'][_0xa87f('0x1e')](_0x3a829f);}})[_0xa87f('0x1d')](function(){_0x5d85ff();})['catch'](function(_0x5fa228){_0x5d85ff(_0x5fa228);});},'afterUpdate':function(_0x33c7ef,_0x2e00bc,_0x30bc29){return _0x4237ae[_0xa87f('0x1f')]['destroy']({'where':{'ChanSpyId':_0x33c7ef['id']}})[_0xa87f('0x1d')](function(){return getChanSpyPromise(_0x4237ae,_0x33c7ef);})['then'](function(_0x2fa108){if(_0x2fa108&&_0x2fa108[_0xa87f('0x15')]){return _0x4237ae[_0xa87f('0x1f')][_0xa87f('0x1e')](_0x2fa108);}})['then'](function(){_0x30bc29();})[_0xa87f('0x20')](function(_0x2df1ca){_0x30bc29(_0x2df1ca);});},'afterDestroy':function(_0x4a13d6,_0x5f4b30,_0x45f63d){return _0x4237ae[_0xa87f('0x1f')][_0xa87f('0x21')]({'where':{'ChanSpyId':_0x4a13d6['id']}})[_0xa87f('0x1d')](function(){_0x45f63d();})[_0xa87f('0x20')](function(_0x737732){_0x45f63d(_0x737732);});}}});}; \ No newline at end of file +var _0xc973=['%s%s','prefix','push','merge','Set','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','concat','internal','name','User','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','catch','destroy','bulkCreate','lodash','bluebird','from-sip','format'];(function(_0x3a242e,_0x18ad7e){var _0x56cd32=function(_0x36d8a3){while(--_0x36d8a3){_0x3a242e['push'](_0x3a242e['shift']());}};_0x56cd32(++_0x18ad7e);}(_0xc973,0x6e));var _0x3c97=function(_0x3b9c33,_0x293cdc){_0x3b9c33=_0x3b9c33-0x0;var _0x23f17c=_0xc973[_0x3b9c33];return _0x23f17c;};'use strict';var _=require(_0x3c97('0x0'));var util=require('util');var BPromise=require(_0x3c97('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3d7c58,_0x5d1b2e,_0x531eaa){var _0x32ff4f=0x1;var _0x1bc2c1=[];var _0x1478d8={'context':_0x5d1b2e['context']||_0x3c97('0x2'),'exten':util[_0x3c97('0x3')](_0x3c97('0x4'),_0x3d7c58[_0x3c97('0x5')],_0x531eaa),'type':'system','isApp':![],'ChanSpyId':_0x3d7c58['id'],'UserId':_0x5d1b2e['id']};_0x1bc2c1[_0x3c97('0x6')](_[_0x3c97('0x7')]({'app':_0x3c97('0x8'),'appdata':util[_0x3c97('0x3')](_0x3c97('0x9'),'chanspy'),'priority':_0x32ff4f++},_0x1478d8));if(_0x3d7c58[_0x3c97('0xa')]){_0x1bc2c1['push'](_[_0x3c97('0x7')]({'app':_0x3c97('0xb'),'appdata':util[_0x3c97('0x3')](_0x3c97('0xc'),_0x3d7c58[_0x3c97('0xd')]),'priority':_0x32ff4f++},_0x1478d8));}if(_0x3d7c58[_0x3c97('0xe')]){_0x1bc2c1[_0x3c97('0x6')](_[_0x3c97('0x7')]({'app':_0x3c97('0xf'),'appdata':_0x3d7c58[_0x3c97('0x10')],'priority':_0x32ff4f++},_0x1478d8));}_0x1bc2c1['push'](_[_0x3c97('0x7')]({'app':_0x3c97('0x11'),'appdata':util['format'](_0x3c97('0x12'),_0x5d1b2e['name'],_0x3d7c58[_0x3c97('0x13')]?_0x3d7c58[_0x3c97('0x13')][_0x3c97('0x14')](''):''),'priority':_0x32ff4f++},_0x1478d8));if(_0x3d7c58['record']){_0x1bc2c1[_0x3c97('0x6')](_[_0x3c97('0x7')]({'app':_0x3c97('0x15'),'priority':_0x32ff4f++},_0x1478d8));}return _0x1bc2c1;};var getChanSpyApplications=function(_0x3d6f1b,_0x5be8ed){var _0x32aaf3=[];for(var _0x526e46=0x0,_0x28d166=0x1;_0x526e46<_0x5be8ed['length'];_0x526e46++,_0x28d166=0x1){_0x32aaf3=_0x32aaf3[_0x3c97('0x16')](getUserApplications(_0x3d6f1b,_0x5be8ed[_0x526e46],_0x5be8ed[_0x526e46][_0x3c97('0x17')]));if(_0x5be8ed[_0x526e46]['internal']!=_0x5be8ed[_0x526e46][_0x3c97('0x18')]){_0x32aaf3=_0x32aaf3[_0x3c97('0x16')](getUserApplications(_0x3d6f1b,_0x5be8ed[_0x526e46],_0x5be8ed[_0x526e46][_0x3c97('0x18')]));}}return _0x32aaf3;};var getChanSpyPromise=function(_0xb6d014,_0x51e1ca){return new BPromise(function(_0x916a26,_0x54aa8f){return _0xb6d014[_0x3c97('0x19')]['findAll']({'attributes':['id',_0x3c97('0x18'),_0x3c97('0x17')],'where':{'role':_0x3c97('0x1a'),'chanspy':!![]},'raw':!![]})[_0x3c97('0x1b')](function(_0xed36c5){if(_0xed36c5){return _0x916a26(getChanSpyApplications(_0x51e1ca,_0xed36c5));}return _0x916a26([]);})['catch'](function(_0x3bab58){_0x54aa8f(_0x3bab58);});});};module[_0x3c97('0x1c')]=function(_0x2f265b,_0x2222be){var _0x5b92cd=_0x2f265b[_0x3c97('0x1d')];return _0x2f265b[_0x3c97('0x1e')](_0x3c97('0x1f'),attributes,{'tableName':_0x3c97('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35f12b,_0x511f88,_0x103a40){return getChanSpyPromise(_0x5b92cd,_0x35f12b)[_0x3c97('0x1b')](function(_0xfe2388){if(_0xfe2388&&_0xfe2388[_0x3c97('0x21')]){return _0x5b92cd[_0x3c97('0x22')]['bulkCreate'](_0xfe2388);}})[_0x3c97('0x1b')](function(){_0x103a40();})[_0x3c97('0x23')](function(_0x202999){_0x103a40(_0x202999);});},'afterUpdate':function(_0x22ca69,_0x210657,_0x4d50ff){return _0x5b92cd['VoiceExtension'][_0x3c97('0x24')]({'where':{'ChanSpyId':_0x22ca69['id']}})[_0x3c97('0x1b')](function(){return getChanSpyPromise(_0x5b92cd,_0x22ca69);})[_0x3c97('0x1b')](function(_0x102d27){if(_0x102d27&&_0x102d27[_0x3c97('0x21')]){return _0x5b92cd['VoiceExtension'][_0x3c97('0x25')](_0x102d27);}})[_0x3c97('0x1b')](function(){_0x4d50ff();})[_0x3c97('0x23')](function(_0x46bb31){_0x4d50ff(_0x46bb31);});},'afterDestroy':function(_0x26f3d7,_0x454e7c,_0x48f0a0){return _0x5b92cd[_0x3c97('0x22')][_0x3c97('0x24')]({'where':{'ChanSpyId':_0x26f3d7['id']}})[_0x3c97('0x1b')](function(){_0x48f0a0();})[_0x3c97('0x23')](function(_0x4a446e){_0x48f0a0(_0x4a446e);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a6f08f9..bea84b4 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9348=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3ecc30,_0x75412b){var _0x2682bc=function(_0x34c384){while(--_0x34c384){_0x3ecc30['push'](_0x3ecc30['shift']());}};_0x2682bc(++_0x75412b);}(_0x9348,0x10d));var _0x8934=function(_0x35045f,_0x1b5df6){_0x35045f=_0x35045f-0x0;var _0x14a22b=_0x9348[_0x35045f];return _0x14a22b;};'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')]('VoiceChanSpy,\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);});});} \ No newline at end of file +var _0x9348=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1918a8,_0x56f70a){var _0x194237=function(_0x38337c){while(--_0x38337c){_0x1918a8['push'](_0x1918a8['shift']());}};_0x194237(++_0x56f70a);}(_0x9348,0x10d));var _0x8934=function(_0x3f8fa2,_0x2173f7){_0x3f8fa2=_0x3f8fa2-0x0;var _0x4d4574=_0x9348[_0x3f8fa2];return _0x4d4574;};'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')]('VoiceChanSpy,\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);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 89727e5..dbfea6c 100644 --- a/server/api/voiceContext/index.js +++ b/server/api/voiceContext/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fe8=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','/:id','isAuthenticated','post','update','delete','destroy','exports','multer'];(function(_0x1edb57,_0x217b2d){var _0x311eec=function(_0x536c5c){while(--_0x536c5c){_0x1edb57['push'](_0x1edb57['shift']());}};_0x311eec(++_0x217b2d);}(_0x8fe8,0x1ed));var _0x88fe=function(_0x8f212b,_0x12335d){_0x8f212b=_0x8f212b-0x0;var _0x443dfd=_0x8fe8[_0x8f212b];return _0x443dfd;};'use strict';var multer=require(_0x88fe('0x0'));var util=require(_0x88fe('0x1'));var path=require(_0x88fe('0x2'));var timeout=require(_0x88fe('0x3'));var express=require(_0x88fe('0x4'));var router=express[_0x88fe('0x5')]();var fs_extra=require(_0x88fe('0x6'));var auth=require(_0x88fe('0x7'));var interaction=require(_0x88fe('0x8'));var config=require(_0x88fe('0x9'));var controller=require(_0x88fe('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x88fe('0xb')](_0x88fe('0xc'),auth[_0x88fe('0xd')](),controller['show']);router[_0x88fe('0xe')]('/',auth[_0x88fe('0xd')](),controller['create']);router['put']('/:id',auth[_0x88fe('0xd')](),controller[_0x88fe('0xf')]);router[_0x88fe('0x10')](_0x88fe('0xc'),auth[_0x88fe('0xd')](),controller[_0x88fe('0x11')]);module[_0x88fe('0x12')]=router; \ No newline at end of file +var _0xdd2a=['show','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xdd2a,0xdf));var _0xadd2=function(_0xccdcc5,_0x24fcf7){_0xccdcc5=_0xccdcc5-0x0;var _0x58a9bb=_0xdd2a[_0xccdcc5];return _0x58a9bb;};'use strict';var multer=require(_0xadd2('0x0'));var util=require(_0xadd2('0x1'));var path=require(_0xadd2('0x2'));var timeout=require(_0xadd2('0x3'));var express=require(_0xadd2('0x4'));var router=express[_0xadd2('0x5')]();var fs_extra=require(_0xadd2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xadd2('0x7'));var controller=require('./voiceContext.controller');router[_0xadd2('0x8')]('/',auth[_0xadd2('0x9')](),controller[_0xadd2('0xa')]);router['get']('/:id',auth[_0xadd2('0x9')](),controller[_0xadd2('0xb')]);router[_0xadd2('0xc')]('/',auth[_0xadd2('0x9')](),controller[_0xadd2('0xd')]);router['put'](_0xadd2('0xe'),auth[_0xadd2('0x9')](),controller[_0xadd2('0xf')]);router[_0xadd2('0x10')](_0xadd2('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xadd2('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 657e6ca..12826f7 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad13=['sequelize','exports','BOOLEAN'];(function(_0x1c6f85,_0x14204){var _0x157681=function(_0x12fab5){while(--_0x12fab5){_0x1c6f85['push'](_0x1c6f85['shift']());}};_0x157681(++_0x14204);}(_0xad13,0x129));var _0x3ad1=function(_0xff0b0b,_0x5ea0a5){_0xff0b0b=_0xff0b0b-0x0;var _0x4b58bc=_0xad13[_0xff0b0b];return _0x4b58bc;};'use strict';var Sequelize=require(_0x3ad1('0x0'));module[_0x3ad1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x3ad1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe5f5=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x2db409,_0x2a0d27){var _0x5748bb=function(_0x32d8a6){while(--_0x32d8a6){_0x2db409['push'](_0x2db409['shift']());}};_0x5748bb(++_0x2a0d27);}(_0xe5f5,0xf3));var _0x5e5f=function(_0x3d2f86,_0x47d904){_0x3d2f86=_0x3d2f86-0x0;var _0x23b0c2=_0xe5f5[_0x3d2f86];return _0x23b0c2;};'use strict';var Sequelize=require(_0x5e5f('0x0'));module[_0x5e5f('0x1')]={'name':{'type':Sequelize[_0x5e5f('0x2')],'unique':_0x5e5f('0x3')},'description':{'type':Sequelize[_0x5e5f('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5e5f('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 4d7169f..47de41b 100644 --- a/server/api/voiceContext/voiceContext.controller.js +++ b/server/api/voiceContext/voiceContext.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c0d=['Unable\x20to\x20retrieve\x20the\x20current\x20user','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','writeFileSync','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','end','stack','name','index','map','VoiceContext','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1c0d,0x192));var _0xd1c0=function(_0x17d4a6,_0x123d8c){_0x17d4a6=_0x17d4a6-0x0;var _0x5178fa=_0x1c0d[_0x17d4a6];return _0x5178fa;};'use strict';var emlformat=require(_0xd1c0('0x0'));var rimraf=require(_0xd1c0('0x1'));var zipdir=require(_0xd1c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd1c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd1c0('0x4'));var util=require('util');var path=require(_0xd1c0('0x5'));var sox=require(_0xd1c0('0x6'));var csv=require(_0xd1c0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1c0('0x8'));var _=require(_0xd1c0('0x9'));var squel=require(_0xd1c0('0xa'));var crypto=require(_0xd1c0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd1c0('0xc'));var toCsv=require(_0xd1c0('0x7'));var querystring=require('querystring');var Papa=require(_0xd1c0('0xd'));var Redis=require(_0xd1c0('0xe'));var authService=require(_0xd1c0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd1c0('0x10'));var utils=require(_0xd1c0('0x11'));var config=require(_0xd1c0('0x12'));var licenseUtil=require(_0xd1c0('0x13'));var db=require(_0xd1c0('0x14'))['db'];var jayson=require(_0xd1c0('0x15'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf8868,_0x31b8c4,_0x435057,_0x46c0ea){return new BPromise(function(_0x4cf5b9,_0x44dcea){var _0x615d74=_0x46c0ea||client;return _0x615d74[_0xd1c0('0x16')](_0xf8868,_0x435057)[_0xd1c0('0x17')](function(_0x5992ee){logger[_0xd1c0('0x18')]('VoiceContext,\x20%s,\x20%s',_0x31b8c4,_0xd1c0('0x19'));logger[_0xd1c0('0x1a')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x31b8c4,_0xd1c0('0x19'),JSON[_0xd1c0('0x1b')](_0x5992ee));if(_0x5992ee[_0xd1c0('0x1c')]){if(_0x5992ee[_0xd1c0('0x1c')][_0xd1c0('0x1d')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x31b8c4,_0x5992ee['error']['message']);return _0x44dcea(_0x5992ee[_0xd1c0('0x1c')][_0xd1c0('0x1e')]);}logger[_0xd1c0('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x31b8c4,_0x5992ee[_0xd1c0('0x1c')][_0xd1c0('0x1e')]);return _0x4cf5b9(_0x5992ee[_0xd1c0('0x1c')]['message']);}else{logger[_0xd1c0('0x18')](_0xd1c0('0x1f'),_0x31b8c4,_0xd1c0('0x19'));_0x4cf5b9(_0x5992ee[_0xd1c0('0x20')]['message']);}})[_0xd1c0('0x21')](function(_0x19cd0c){logger['error'](_0xd1c0('0x1f'),_0x31b8c4,_0x19cd0c);_0x44dcea(_0x19cd0c);});});}function respondWithStatusCode(_0x1f9993,_0x3a54e2){_0x3a54e2=_0x3a54e2||0xcc;return function(_0x377997){if(_0x377997){return _0x1f9993[_0xd1c0('0x22')](_0x3a54e2);}return _0x1f9993[_0xd1c0('0x23')](_0x3a54e2)['end']();};}function respondWithResult(_0x3ef96a,_0x3bb4c1){_0x3bb4c1=_0x3bb4c1||0xc8;return function(_0x2e2a56){if(_0x2e2a56){return _0x3ef96a[_0xd1c0('0x23')](_0x3bb4c1)[_0xd1c0('0x24')](_0x2e2a56);}};}function respondWithFilteredResult(_0x55ee68,_0x20afd0){return function(_0x3e2be1){if(_0x3e2be1){var _0x25c209=typeof _0x20afd0['offset']===_0xd1c0('0x25')&&typeof _0x20afd0[_0xd1c0('0x26')]===_0xd1c0('0x25');var _0x59ed20=_0x3e2be1[_0xd1c0('0x27')];var _0x252201=_0x25c209?0x0:_0x20afd0[_0xd1c0('0x28')];var _0x3a7d10=_0x25c209?_0x3e2be1[_0xd1c0('0x27')]:_0x20afd0[_0xd1c0('0x28')]+_0x20afd0[_0xd1c0('0x26')];var _0x5664a9;if(_0x3a7d10>=_0x59ed20){_0x3a7d10=_0x59ed20;_0x5664a9=0xc8;}else{_0x5664a9=0xce;}_0x55ee68['status'](_0x5664a9);return _0x55ee68[_0xd1c0('0x29')](_0xd1c0('0x2a'),_0x252201+'-'+_0x3a7d10+'/'+_0x59ed20)[_0xd1c0('0x24')](_0x3e2be1);}return null;};}function patchUpdates(_0x2a05e0){return function(_0x523e8a){try{jsonpatch[_0xd1c0('0x2b')](_0x523e8a,_0x2a05e0,!![]);}catch(_0xc119b8){return BPromise[_0xd1c0('0x2c')](_0xc119b8);}return _0x523e8a[_0xd1c0('0x2d')]();};}function saveUpdates(_0x197755,_0x37db3c){return function(_0x1460d5){if(_0x1460d5){return _0x1460d5[_0xd1c0('0x2e')](_0x197755)[_0xd1c0('0x17')](function(_0x4b486f){return _0x4b486f;});}return null;};}function removeEntity(_0x125c6d,_0x157192){return function(_0x30281b){if(_0x30281b){return _0x30281b[_0xd1c0('0x2f')]()[_0xd1c0('0x17')](function(){var _0x154a7a=_0x30281b[_0xd1c0('0x30')]({'plain':!![]});var _0x378731='Contexts';return db[_0xd1c0('0x31')][_0xd1c0('0x2f')]({'where':{'type':_0x378731,'resourceId':_0x154a7a['id']}})[_0xd1c0('0x17')](function(){return _0x30281b;});})['then'](function(){_0x125c6d[_0xd1c0('0x23')](0xcc)[_0xd1c0('0x32')]();});}};}function handleEntityNotFound(_0x46df1d,_0x4f9e4e){return function(_0x12d5b3){if(!_0x12d5b3){_0x46df1d[_0xd1c0('0x22')](0x194);}return _0x12d5b3;};}function handleError(_0x29771a,_0x36c600){_0x36c600=_0x36c600||0x1f4;return function(_0x42f26c){logger[_0xd1c0('0x1c')](_0x42f26c[_0xd1c0('0x33')]);if(_0x42f26c[_0xd1c0('0x34')]){delete _0x42f26c[_0xd1c0('0x34')];}_0x29771a['status'](_0x36c600)['send'](_0x42f26c);};}exports[_0xd1c0('0x35')]=function(_0x6482fd,_0x24a621){var _0x1f4b37={},_0x3e5f44={},_0x277b34={'count':0x0,'rows':[]};var _0x34b482=_[_0xd1c0('0x36')](db[_0xd1c0('0x37')][_0xd1c0('0x38')],function(_0x384dcb){return{'name':_0x384dcb[_0xd1c0('0x39')],'type':_0x384dcb['type'][_0xd1c0('0x3a')]};});_0x3e5f44[_0xd1c0('0x3b')]=_[_0xd1c0('0x36')](_0x34b482,_0xd1c0('0x34'));_0x3e5f44[_0xd1c0('0x3c')]=_[_0xd1c0('0x3d')](_0x6482fd[_0xd1c0('0x3c')]);_0x3e5f44[_0xd1c0('0x3e')]=_[_0xd1c0('0x3f')](_0x3e5f44['model'],_0x3e5f44[_0xd1c0('0x3c')]);_0x1f4b37[_0xd1c0('0x40')]=_[_0xd1c0('0x3f')](_0x3e5f44[_0xd1c0('0x3b')],qs[_0xd1c0('0x41')](_0x6482fd[_0xd1c0('0x3c')][_0xd1c0('0x41')]));_0x1f4b37['attributes']=_0x1f4b37['attributes'][_0xd1c0('0x42')]?_0x1f4b37['attributes']:_0x3e5f44['model'];if(!_0x6482fd[_0xd1c0('0x3c')][_0xd1c0('0x43')]('nolimit')){_0x1f4b37['limit']=qs[_0xd1c0('0x26')](_0x6482fd[_0xd1c0('0x3c')]['limit']);_0x1f4b37[_0xd1c0('0x28')]=qs[_0xd1c0('0x28')](_0x6482fd[_0xd1c0('0x3c')][_0xd1c0('0x28')]);}_0x1f4b37['order']=qs[_0xd1c0('0x44')](_0x6482fd[_0xd1c0('0x3c')][_0xd1c0('0x44')]);_0x1f4b37[_0xd1c0('0x45')]=qs[_0xd1c0('0x3e')](_[_0xd1c0('0x46')](_0x6482fd[_0xd1c0('0x3c')],_0x3e5f44[_0xd1c0('0x3e')]),_0x34b482);if(_0x6482fd['query'][_0xd1c0('0x47')]){_0x1f4b37[_0xd1c0('0x45')]=_['merge'](_0x1f4b37[_0xd1c0('0x45')],{'$or':_['map'](_0x34b482,function(_0x51471a){if(_0x51471a[_0xd1c0('0x48')]!==_0xd1c0('0x49')){var _0xd01d70={};_0xd01d70[_0x51471a['name']]={'$like':'%'+_0x6482fd['query']['filter']+'%'};return _0xd01d70;}})});}_0x1f4b37=_['merge']({},_0x1f4b37,_0x6482fd[_0xd1c0('0x4a')]);var _0x4e54c5={'where':_0x1f4b37[_0xd1c0('0x45')]};return db[_0xd1c0('0x37')][_0xd1c0('0x27')](_0x4e54c5)['then'](function(_0x5dd771){_0x277b34[_0xd1c0('0x27')]=_0x5dd771;if(_0x6482fd[_0xd1c0('0x3c')]['includeAll']){_0x1f4b37[_0xd1c0('0x4b')]=[{'all':!![]}];}return db[_0xd1c0('0x37')][_0xd1c0('0x4c')](_0x1f4b37);})[_0xd1c0('0x17')](function(_0x3b92cf){_0x277b34[_0xd1c0('0x4d')]=_0x3b92cf;return _0x277b34;})[_0xd1c0('0x17')](respondWithFilteredResult(_0x24a621,_0x1f4b37))[_0xd1c0('0x21')](handleError(_0x24a621,null));};exports[_0xd1c0('0x4e')]=function(_0x52b2a7,_0xec65ad){var _0x34a130={'raw':![],'where':{'id':_0x52b2a7[_0xd1c0('0x4f')]['id']}},_0x5ff5a9={};_0x5ff5a9[_0xd1c0('0x3b')]=_[_0xd1c0('0x3d')](db[_0xd1c0('0x37')]['rawAttributes']);_0x5ff5a9[_0xd1c0('0x3c')]=_[_0xd1c0('0x3d')](_0x52b2a7[_0xd1c0('0x3c')]);_0x5ff5a9['filters']=_[_0xd1c0('0x3f')](_0x5ff5a9[_0xd1c0('0x3b')],_0x5ff5a9[_0xd1c0('0x3c')]);_0x34a130[_0xd1c0('0x40')]=_[_0xd1c0('0x3f')](_0x5ff5a9[_0xd1c0('0x3b')],qs[_0xd1c0('0x41')](_0x52b2a7[_0xd1c0('0x3c')]['fields']));_0x34a130[_0xd1c0('0x40')]=_0x34a130['attributes']['length']?_0x34a130[_0xd1c0('0x40')]:_0x5ff5a9[_0xd1c0('0x3b')];if(_0x52b2a7[_0xd1c0('0x3c')][_0xd1c0('0x50')]){_0x34a130[_0xd1c0('0x4b')]=[{'all':!![]}];}_0x34a130=_['merge']({},_0x34a130,_0x52b2a7[_0xd1c0('0x4a')]);return db[_0xd1c0('0x37')][_0xd1c0('0x51')](_0x34a130)[_0xd1c0('0x17')](handleEntityNotFound(_0xec65ad,null))[_0xd1c0('0x17')](respondWithResult(_0xec65ad,null))[_0xd1c0('0x21')](handleError(_0xec65ad,null));};exports[_0xd1c0('0x52')]=function(_0x2d71ae,_0x1b7a15,_0x370300){var _0x37b93d;return db[_0xd1c0('0x37')][_0xd1c0('0x52')](_0x2d71ae[_0xd1c0('0x53')],{'raw':!![]})[_0xd1c0('0x17')](function(_0x430127){_0x37b93d=_0x430127;return db['VoiceContext'][_0xd1c0('0x4c')]({'raw':!![]});})['then'](function(_0x5e54f8){var _0x55878f=fs[_0xd1c0('0x54')](path[_0xd1c0('0x55')](config['root'],_0xd1c0('0x56')),_0xd1c0('0x57'));var _0x4d884a=ejs[_0xd1c0('0x58')](_0x55878f,{'contexts':_0x5e54f8||[]});fs['writeFileSync'](_0xd1c0('0x59'),_0x4d884a);})['then'](function(){return respondWithRpcPromise(_0xd1c0('0x5a'),_0xd1c0('0x52'),{'module':_0xd1c0('0x5b')});})['then'](function(){var _0x2f2d8b=_0x2d71ae[_0xd1c0('0x5c')]['get']({'plain':!![]});if(!_0x2f2d8b)throw new Error(_0xd1c0('0x5d'));if(_0x2f2d8b['role']===_0xd1c0('0x5c')){var _0x4b39f1=_0x37b93d[_0xd1c0('0x30')]({'plain':!![]});return db['UserProfileSection'][_0xd1c0('0x51')]({'where':{'name':_0xd1c0('0x5e'),'userProfileId':_0x2f2d8b[_0xd1c0('0x5f')]},'raw':!![]})['then'](function(_0x5d7541){if(_0x5d7541&&_0x5d7541[_0xd1c0('0x60')]===0x0){return db[_0xd1c0('0x31')][_0xd1c0('0x52')]({'name':_0x4b39f1[_0xd1c0('0x34')],'resourceId':_0x4b39f1['id'],'type':_0x5d7541[_0xd1c0('0x34')],'sectionId':_0x5d7541['id']},{})[_0xd1c0('0x17')](function(){return _0x37b93d;});}else{return _0x37b93d;}})[_0xd1c0('0x21')](function(_0x48df1d){logger[_0xd1c0('0x1c')](_0xd1c0('0x61'),_0x48df1d);throw _0x48df1d;});}return _0x37b93d;})['then'](respondWithResult(_0x1b7a15,0xc9))[_0xd1c0('0x21')](handleError(_0x1b7a15,null));};exports[_0xd1c0('0x2e')]=function(_0x145e6c,_0x431465,_0x5b05cd){var _0x1bf617;return db[_0xd1c0('0x37')][_0xd1c0('0x51')]({'where':{'id':_0x145e6c[_0xd1c0('0x4f')]['id']}})[_0xd1c0('0x17')](handleEntityNotFound(_0x431465,null))[_0xd1c0('0x17')](saveUpdates(_0x145e6c[_0xd1c0('0x53')],null))[_0xd1c0('0x17')](function(_0x4c501e){if(_0x4c501e){_0x1bf617=_0x4c501e;return db['VoiceContext'][_0xd1c0('0x4c')]({'raw':!![]});}})['then'](function(_0x419130){var _0x4db472=fs[_0xd1c0('0x54')](path['join'](config['root'],'server/files/templates/context.ejs'),_0xd1c0('0x57'));var _0x792656=ejs[_0xd1c0('0x58')](_0x4db472,{'contexts':_0x419130||[]});fs[_0xd1c0('0x62')](_0xd1c0('0x59'),_0x792656);})[_0xd1c0('0x17')](function(){return respondWithRpcPromise(_0xd1c0('0x5a'),_0xd1c0('0x2e'),{'module':_0xd1c0('0x5b')});})[_0xd1c0('0x17')](function(){return _0x1bf617;})[_0xd1c0('0x17')](respondWithResult(_0x431465,null))[_0xd1c0('0x21')](handleError(_0x431465,null));};exports[_0xd1c0('0x2f')]=function(_0x132213,_0x36a42a,_0x3d63c8){var _0x6b6679;return db['VoiceContext'][_0xd1c0('0x51')]({'where':{'id':_0x132213['params']['id']}})[_0xd1c0('0x17')](handleEntityNotFound(_0x36a42a,null))[_0xd1c0('0x17')](removeEntity(_0x36a42a,null))['then'](function(){return db[_0xd1c0('0x37')][_0xd1c0('0x4c')]({'raw':!![]});})[_0xd1c0('0x17')](function(_0x7f038a){var _0x31887a=fs[_0xd1c0('0x54')](path[_0xd1c0('0x55')](config['root'],_0xd1c0('0x56')),_0xd1c0('0x57'));var _0x17cd8e=ejs['render'](_0x31887a,{'contexts':_0x7f038a});fs[_0xd1c0('0x62')](_0xd1c0('0x59'),_0x17cd8e);return respondWithRpcPromise('Reload',_0xd1c0('0x2f'),{'module':_0xd1c0('0x5b')});})[_0xd1c0('0x21')](handleError(_0x36a42a,null));}; \ No newline at end of file +var _0xc7a8=['/etc/asterisk/extensions_xcally_contexts.conf','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','Contexts','UserProfileResource','stack','name','send','index','VoiceContext','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','length','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync'];(function(_0x3bf8cc,_0x13d6f2){var _0x3fe553=function(_0x219def){while(--_0x219def){_0x3bf8cc['push'](_0x3bf8cc['shift']());}};_0x3fe553(++_0x13d6f2);}(_0xc7a8,0x13e));var _0x8c7a=function(_0x2b9828,_0x50c0a6){_0x2b9828=_0x2b9828-0x0;var _0x381948=_0xc7a8[_0x2b9828];return _0x381948;};'use strict';var emlformat=require(_0x8c7a('0x0'));var rimraf=require(_0x8c7a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c7a('0x2'));var rp=require(_0x8c7a('0x3'));var moment=require('moment');var BPromise=require(_0x8c7a('0x4'));var Mustache=require('mustache');var util=require(_0x8c7a('0x5'));var path=require('path');var sox=require(_0x8c7a('0x6'));var csv=require(_0x8c7a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c7a('0x8'));var _=require('lodash');var squel=require(_0x8c7a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8c7a('0xa'));var toCsv=require(_0x8c7a('0x7'));var querystring=require(_0x8c7a('0xb'));var Papa=require(_0x8c7a('0xc'));var Redis=require(_0x8c7a('0xd'));var authService=require(_0x8c7a('0xe'));var qs=require(_0x8c7a('0xf'));var as=require(_0x8c7a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8c7a('0x11'));var utils=require(_0x8c7a('0x12'));var config=require(_0x8c7a('0x13'));var licenseUtil=require(_0x8c7a('0x14'));var db=require(_0x8c7a('0x15'))['db'];var jayson=require(_0x8c7a('0x16'));var client=jayson[_0x8c7a('0x17')][_0x8c7a('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x39194d,_0x4282df,_0x4b6ef3,_0x207407){return new BPromise(function(_0x139c8a,_0x4b3323){var _0x3f3c26=_0x207407||client;return _0x3f3c26[_0x8c7a('0x19')](_0x39194d,_0x4b6ef3)[_0x8c7a('0x1a')](function(_0x47ac53){logger['info'](_0x8c7a('0x1b'),_0x4282df,_0x8c7a('0x1c'));logger[_0x8c7a('0x1d')](_0x8c7a('0x1e'),_0x4282df,_0x8c7a('0x1c'),JSON[_0x8c7a('0x1f')](_0x47ac53));if(_0x47ac53[_0x8c7a('0x20')]){if(_0x47ac53['error'][_0x8c7a('0x21')]===0x1f4){logger[_0x8c7a('0x20')](_0x8c7a('0x1b'),_0x4282df,_0x47ac53['error'][_0x8c7a('0x22')]);return _0x4b3323(_0x47ac53[_0x8c7a('0x20')][_0x8c7a('0x22')]);}logger[_0x8c7a('0x20')](_0x8c7a('0x1b'),_0x4282df,_0x47ac53[_0x8c7a('0x20')][_0x8c7a('0x22')]);return _0x139c8a(_0x47ac53[_0x8c7a('0x20')]['message']);}else{logger[_0x8c7a('0x23')]('VoiceContext,\x20%s,\x20%s',_0x4282df,_0x8c7a('0x1c'));_0x139c8a(_0x47ac53[_0x8c7a('0x24')][_0x8c7a('0x22')]);}})[_0x8c7a('0x25')](function(_0x1d9cd3){logger[_0x8c7a('0x20')](_0x8c7a('0x1b'),_0x4282df,_0x1d9cd3);_0x4b3323(_0x1d9cd3);});});}function respondWithStatusCode(_0x332793,_0x521209){_0x521209=_0x521209||0xcc;return function(_0x2890e3){if(_0x2890e3){return _0x332793[_0x8c7a('0x26')](_0x521209);}return _0x332793[_0x8c7a('0x27')](_0x521209)[_0x8c7a('0x28')]();};}function respondWithResult(_0x143495,_0xba13a6){_0xba13a6=_0xba13a6||0xc8;return function(_0x35929d){if(_0x35929d){return _0x143495[_0x8c7a('0x27')](_0xba13a6)[_0x8c7a('0x29')](_0x35929d);}};}function respondWithFilteredResult(_0x3ad0a3,_0x923d5f){return function(_0x5b8697){if(_0x5b8697){var _0x2d67c6=typeof _0x923d5f[_0x8c7a('0x2a')]===_0x8c7a('0x2b')&&typeof _0x923d5f[_0x8c7a('0x2c')]===_0x8c7a('0x2b');var _0x3f304d=_0x5b8697['count'];var _0x4812c7=_0x2d67c6?0x0:_0x923d5f[_0x8c7a('0x2a')];var _0x4d5ca1=_0x2d67c6?_0x5b8697[_0x8c7a('0x2d')]:_0x923d5f[_0x8c7a('0x2a')]+_0x923d5f[_0x8c7a('0x2c')];var _0x15e11a;if(_0x4d5ca1>=_0x3f304d){_0x4d5ca1=_0x3f304d;_0x15e11a=0xc8;}else{_0x15e11a=0xce;}_0x3ad0a3[_0x8c7a('0x27')](_0x15e11a);return _0x3ad0a3[_0x8c7a('0x2e')](_0x8c7a('0x2f'),_0x4812c7+'-'+_0x4d5ca1+'/'+_0x3f304d)[_0x8c7a('0x29')](_0x5b8697);}return null;};}function patchUpdates(_0x2aa16c){return function(_0x487d48){try{jsonpatch[_0x8c7a('0x30')](_0x487d48,_0x2aa16c,!![]);}catch(_0xda6263){return BPromise['reject'](_0xda6263);}return _0x487d48[_0x8c7a('0x31')]();};}function saveUpdates(_0x13e58a,_0x1f3ee6){return function(_0x237585){if(_0x237585){return _0x237585[_0x8c7a('0x32')](_0x13e58a)['then'](function(_0x2d3554){return _0x2d3554;});}return null;};}function removeEntity(_0x1e5970,_0x1a7d5f){return function(_0x7e7e4d){if(_0x7e7e4d){return _0x7e7e4d[_0x8c7a('0x33')]()['then'](function(){var _0x1d35f9=_0x7e7e4d['get']({'plain':!![]});var _0x26e35f=_0x8c7a('0x34');return db[_0x8c7a('0x35')][_0x8c7a('0x33')]({'where':{'type':_0x26e35f,'resourceId':_0x1d35f9['id']}})[_0x8c7a('0x1a')](function(){return _0x7e7e4d;});})[_0x8c7a('0x1a')](function(){_0x1e5970[_0x8c7a('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38af3d,_0x39a5dc){return function(_0x3b43bd){if(!_0x3b43bd){_0x38af3d[_0x8c7a('0x26')](0x194);}return _0x3b43bd;};}function handleError(_0xb56bc3,_0x363d90){_0x363d90=_0x363d90||0x1f4;return function(_0x3aaaf4){logger[_0x8c7a('0x20')](_0x3aaaf4[_0x8c7a('0x36')]);if(_0x3aaaf4[_0x8c7a('0x37')]){delete _0x3aaaf4[_0x8c7a('0x37')];}_0xb56bc3[_0x8c7a('0x27')](_0x363d90)[_0x8c7a('0x38')](_0x3aaaf4);};}exports[_0x8c7a('0x39')]=function(_0x384556,_0x5b9179){var _0x7c3481={},_0x20b766={},_0x4066ed={'count':0x0,'rows':[]};var _0x5e3428=_['map'](db[_0x8c7a('0x3a')][_0x8c7a('0x3b')],function(_0x8d5397){return{'name':_0x8d5397['fieldName'],'type':_0x8d5397[_0x8c7a('0x3c')][_0x8c7a('0x3d')]};});_0x20b766['model']=_[_0x8c7a('0x3e')](_0x5e3428,_0x8c7a('0x37'));_0x20b766[_0x8c7a('0x3f')]=_[_0x8c7a('0x40')](_0x384556['query']);_0x20b766[_0x8c7a('0x41')]=_[_0x8c7a('0x42')](_0x20b766[_0x8c7a('0x43')],_0x20b766[_0x8c7a('0x3f')]);_0x7c3481[_0x8c7a('0x44')]=_[_0x8c7a('0x42')](_0x20b766[_0x8c7a('0x43')],qs[_0x8c7a('0x45')](_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x45')]));_0x7c3481[_0x8c7a('0x44')]=_0x7c3481[_0x8c7a('0x44')]['length']?_0x7c3481[_0x8c7a('0x44')]:_0x20b766[_0x8c7a('0x43')];if(!_0x384556[_0x8c7a('0x3f')]['hasOwnProperty'](_0x8c7a('0x46'))){_0x7c3481[_0x8c7a('0x2c')]=qs[_0x8c7a('0x2c')](_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x2c')]);_0x7c3481[_0x8c7a('0x2a')]=qs[_0x8c7a('0x2a')](_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x2a')]);}_0x7c3481[_0x8c7a('0x47')]=qs[_0x8c7a('0x48')](_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x48')]);_0x7c3481['where']=qs['filters'](_['pick'](_0x384556['query'],_0x20b766[_0x8c7a('0x41')]),_0x5e3428);if(_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x49')]){_0x7c3481[_0x8c7a('0x4a')]=_[_0x8c7a('0x4b')](_0x7c3481[_0x8c7a('0x4a')],{'$or':_['map'](_0x5e3428,function(_0x2d52be){if(_0x2d52be[_0x8c7a('0x3c')]!==_0x8c7a('0x4c')){var _0x155fe2={};_0x155fe2[_0x2d52be[_0x8c7a('0x37')]]={'$like':'%'+_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x49')]+'%'};return _0x155fe2;}})});}_0x7c3481=_['merge']({},_0x7c3481,_0x384556[_0x8c7a('0x4d')]);var _0x1595d1={'where':_0x7c3481[_0x8c7a('0x4a')]};return db['VoiceContext'][_0x8c7a('0x2d')](_0x1595d1)['then'](function(_0x3a1cf8){_0x4066ed[_0x8c7a('0x2d')]=_0x3a1cf8;if(_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x4e')]){_0x7c3481[_0x8c7a('0x4f')]=[{'all':!![]}];}return db[_0x8c7a('0x3a')]['findAll'](_0x7c3481);})['then'](function(_0x1a0811){_0x4066ed['rows']=_0x1a0811;return _0x4066ed;})[_0x8c7a('0x1a')](respondWithFilteredResult(_0x5b9179,_0x7c3481))[_0x8c7a('0x25')](handleError(_0x5b9179,null));};exports[_0x8c7a('0x50')]=function(_0x1324a3,_0x587215){var _0xe0f2f5={'raw':![],'where':{'id':_0x1324a3[_0x8c7a('0x51')]['id']}},_0x360ee6={};_0x360ee6[_0x8c7a('0x43')]=_['keys'](db[_0x8c7a('0x3a')][_0x8c7a('0x3b')]);_0x360ee6[_0x8c7a('0x3f')]=_['keys'](_0x1324a3[_0x8c7a('0x3f')]);_0x360ee6[_0x8c7a('0x41')]=_['intersection'](_0x360ee6[_0x8c7a('0x43')],_0x360ee6[_0x8c7a('0x3f')]);_0xe0f2f5[_0x8c7a('0x44')]=_[_0x8c7a('0x42')](_0x360ee6['model'],qs[_0x8c7a('0x45')](_0x1324a3[_0x8c7a('0x3f')][_0x8c7a('0x45')]));_0xe0f2f5[_0x8c7a('0x44')]=_0xe0f2f5[_0x8c7a('0x44')][_0x8c7a('0x52')]?_0xe0f2f5[_0x8c7a('0x44')]:_0x360ee6['model'];if(_0x1324a3[_0x8c7a('0x3f')]['includeAll']){_0xe0f2f5[_0x8c7a('0x4f')]=[{'all':!![]}];}_0xe0f2f5=_[_0x8c7a('0x4b')]({},_0xe0f2f5,_0x1324a3[_0x8c7a('0x4d')]);return db[_0x8c7a('0x3a')][_0x8c7a('0x53')](_0xe0f2f5)[_0x8c7a('0x1a')](handleEntityNotFound(_0x587215,null))[_0x8c7a('0x1a')](respondWithResult(_0x587215,null))[_0x8c7a('0x25')](handleError(_0x587215,null));};exports[_0x8c7a('0x54')]=function(_0x5a5975,_0x340e21,_0xf76a33){var _0x131fc6;return db[_0x8c7a('0x3a')]['create'](_0x5a5975[_0x8c7a('0x55')],{'raw':!![]})[_0x8c7a('0x1a')](function(_0x31734e){_0x131fc6=_0x31734e;return db['VoiceContext'][_0x8c7a('0x56')]({'raw':!![]});})[_0x8c7a('0x1a')](function(_0xeb5a57){var _0x366e4d=fs[_0x8c7a('0x57')](path[_0x8c7a('0x58')](config[_0x8c7a('0x59')],_0x8c7a('0x5a')),_0x8c7a('0x5b'));var _0x4aa456=ejs[_0x8c7a('0x5c')](_0x366e4d,{'contexts':_0xeb5a57||[]});fs[_0x8c7a('0x5d')](_0x8c7a('0x5e'),_0x4aa456);})['then'](function(){return respondWithRpcPromise('Reload',_0x8c7a('0x54'),{'module':'chan_sip.so'});})[_0x8c7a('0x1a')](function(){var _0x3eabf5=_0x5a5975['user'][_0x8c7a('0x5f')]({'plain':!![]});if(!_0x3eabf5)throw new Error(_0x8c7a('0x60'));if(_0x3eabf5['role']===_0x8c7a('0x61')){var _0x56d163=_0x131fc6[_0x8c7a('0x5f')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Contexts','userProfileId':_0x3eabf5[_0x8c7a('0x62')]},'raw':!![]})[_0x8c7a('0x1a')](function(_0x56c180){if(_0x56c180&&_0x56c180[_0x8c7a('0x63')]===0x0){return db[_0x8c7a('0x35')][_0x8c7a('0x54')]({'name':_0x56d163['name'],'resourceId':_0x56d163['id'],'type':_0x56c180[_0x8c7a('0x37')],'sectionId':_0x56c180['id']},{})[_0x8c7a('0x1a')](function(){return _0x131fc6;});}else{return _0x131fc6;}})['catch'](function(_0x1e514e){logger['error'](_0x8c7a('0x64'),_0x1e514e);throw _0x1e514e;});}return _0x131fc6;})[_0x8c7a('0x1a')](respondWithResult(_0x340e21,0xc9))[_0x8c7a('0x25')](handleError(_0x340e21,null));};exports['update']=function(_0x2ae2f7,_0x244a6d,_0x56d33c){var _0x222e2e;return db[_0x8c7a('0x3a')][_0x8c7a('0x53')]({'where':{'id':_0x2ae2f7['params']['id']}})[_0x8c7a('0x1a')](handleEntityNotFound(_0x244a6d,null))[_0x8c7a('0x1a')](saveUpdates(_0x2ae2f7['body'],null))['then'](function(_0x4a1a8d){if(_0x4a1a8d){_0x222e2e=_0x4a1a8d;return db[_0x8c7a('0x3a')][_0x8c7a('0x56')]({'raw':!![]});}})[_0x8c7a('0x1a')](function(_0x35f3f9){var _0xbb22ee=fs[_0x8c7a('0x57')](path[_0x8c7a('0x58')](config[_0x8c7a('0x59')],_0x8c7a('0x5a')),_0x8c7a('0x5b'));var _0xae936a=ejs[_0x8c7a('0x5c')](_0xbb22ee,{'contexts':_0x35f3f9||[]});fs[_0x8c7a('0x5d')](_0x8c7a('0x5e'),_0xae936a);})[_0x8c7a('0x1a')](function(){return respondWithRpcPromise(_0x8c7a('0x65'),'update',{'module':_0x8c7a('0x66')});})[_0x8c7a('0x1a')](function(){return _0x222e2e;})['then'](respondWithResult(_0x244a6d,null))[_0x8c7a('0x25')](handleError(_0x244a6d,null));};exports[_0x8c7a('0x33')]=function(_0x1cde8b,_0x2b7efd,_0x4a2b2a){var _0xed5ad2;return db['VoiceContext']['find']({'where':{'id':_0x1cde8b[_0x8c7a('0x51')]['id']}})[_0x8c7a('0x1a')](handleEntityNotFound(_0x2b7efd,null))[_0x8c7a('0x1a')](removeEntity(_0x2b7efd,null))[_0x8c7a('0x1a')](function(){return db[_0x8c7a('0x3a')]['findAll']({'raw':!![]});})[_0x8c7a('0x1a')](function(_0x54fe95){var _0x1b9c1a=fs[_0x8c7a('0x57')](path['join'](config[_0x8c7a('0x59')],'server/files/templates/context.ejs'),_0x8c7a('0x5b'));var _0x4df33c=ejs[_0x8c7a('0x5c')](_0x1b9c1a,{'contexts':_0x54fe95});fs[_0x8c7a('0x5d')](_0x8c7a('0x5e'),_0x4df33c);return respondWithRpcPromise(_0x8c7a('0x65'),_0x8c7a('0x33'),{'module':_0x8c7a('0x66')});})[_0x8c7a('0x25')](handleError(_0x2b7efd,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 41d5166..29965be 100644 --- a/server/api/voiceContext/voiceContext.model.js +++ b/server/api/voiceContext/voiceContext.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdec0=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts'];(function(_0x51d20a,_0x319e39){var _0x3c0f6f=function(_0x50f112){while(--_0x50f112){_0x51d20a['push'](_0x51d20a['shift']());}};_0x3c0f6f(++_0x319e39);}(_0xdec0,0x1d4));var _0x0dec=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0xdec0[_0x44cb92];return _0x56b9e6;};'use strict';var _=require(_0x0dec('0x0'));var util=require(_0x0dec('0x1'));var logger=require(_0x0dec('0x2'))(_0x0dec('0x3'));var moment=require('moment');var BPromise=require(_0x0dec('0x4'));var rp=require(_0x0dec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0dec('0x6'));var config=require('../../config/environment');var attributes=require(_0x0dec('0x7'));module[_0x0dec('0x8')]=function(_0x281750,_0x2bd5dd){return _0x281750[_0x0dec('0x9')](_0x0dec('0xa'),attributes,{'tableName':_0x0dec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4367=['../../config/environment','./voiceContext.attributes','exports','define','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x58d373,_0x440d26){var _0x4f27b2=function(_0x4b6420){while(--_0x4b6420){_0x58d373['push'](_0x58d373['shift']());}};_0x4f27b2(++_0x440d26);}(_0x4367,0x1f3));var _0x7436=function(_0x157559,_0x3e1b99){_0x157559=_0x157559-0x0;var _0x165e17=_0x4367[_0x157559];return _0x165e17;};'use strict';var _=require('lodash');var util=require(_0x7436('0x0'));var logger=require(_0x7436('0x1'))(_0x7436('0x2'));var moment=require(_0x7436('0x3'));var BPromise=require('bluebird');var rp=require(_0x7436('0x4'));var fs=require('fs');var path=require(_0x7436('0x5'));var rimraf=require(_0x7436('0x6'));var config=require(_0x7436('0x7'));var attributes=require(_0x7436('0x8'));module[_0x7436('0x9')]=function(_0xb90e60,_0x5083f5){return _0xb90e60[_0x7436('0xa')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index d79201f..b5139fe 100644 --- a/server/api/voiceContext/voiceContext.rpc.js +++ b/server/api/voiceContext/voiceContext.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa71a=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','info','catch','lodash'];(function(_0x394464,_0x4b11b6){var _0x271452=function(_0x2382a4){while(--_0x2382a4){_0x394464['push'](_0x394464['shift']());}};_0x271452(++_0x4b11b6);}(_0xa71a,0xf1));var _0xaa71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa71a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaa71('0x0'));var util=require(_0xaa71('0x1'));var moment=require(_0xaa71('0x2'));var BPromise=require(_0xaa71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa71('0x4'));var db=require(_0xaa71('0x5'))['db'];var utils=require(_0xaa71('0x6'));var logger=require('../../config/logger')(_0xaa71('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa71('0x8'));var client=jayson[_0xaa71('0x9')][_0xaa71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5893aa,_0x274dce,_0x35b8cf){return new BPromise(function(_0x5a0dca,_0x50ad8f){return client[_0xaa71('0xb')](_0x5893aa,_0x35b8cf)[_0xaa71('0xc')](function(_0xc26148){logger['info']('VoiceContext,\x20%s,\x20%s',_0x274dce,_0xaa71('0xd'));logger[_0xaa71('0xe')](_0xaa71('0xf'),_0x274dce,_0xaa71('0xd'),JSON[_0xaa71('0x10')](_0xc26148));if(_0xc26148[_0xaa71('0x11')]){if(_0xc26148['error']['code']===0x1f4){logger['error'](_0xaa71('0x12'),_0x274dce,_0xc26148[_0xaa71('0x11')][_0xaa71('0x13')]);return _0x50ad8f(_0xc26148['error'][_0xaa71('0x13')]);}logger[_0xaa71('0x11')](_0xaa71('0x12'),_0x274dce,_0xc26148[_0xaa71('0x11')][_0xaa71('0x13')]);return _0x5a0dca(_0xc26148[_0xaa71('0x11')]['message']);}else{logger[_0xaa71('0x14')](_0xaa71('0x12'),_0x274dce,_0xaa71('0xd'));_0x5a0dca(_0xc26148['result'][_0xaa71('0x13')]);}})[_0xaa71('0x15')](function(_0x25a7ac){logger[_0xaa71('0x11')](_0xaa71('0x12'),_0x274dce,_0x25a7ac);_0x50ad8f(_0x25a7ac);});});} \ No newline at end of file +var _0x6cb4=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','stringify','error','VoiceContext,\x20%s,\x20%s'];(function(_0x51c30c,_0x1b39f4){var _0x3f57bc=function(_0x227874){while(--_0x227874){_0x51c30c['push'](_0x51c30c['shift']());}};_0x3f57bc(++_0x1b39f4);}(_0x6cb4,0xff));var _0x46cb=function(_0x1e0f80,_0x3f3355){_0x1e0f80=_0x1e0f80-0x0;var _0x1e1749=_0x6cb4[_0x1e0f80];return _0x1e1749;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11262d,_0x148d0f,_0x31b35b){return new BPromise(function(_0x2d6c29,_0x24b4f5){return client[_0x46cb('0xb')](_0x11262d,_0x31b35b)['then'](function(_0x3d7663){logger[_0x46cb('0xc')]('VoiceContext,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'));logger[_0x46cb('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'),JSON[_0x46cb('0xf')](_0x3d7663));if(_0x3d7663['error']){if(_0x3d7663['error']['code']===0x1f4){logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x24b4f5(_0x3d7663['error'][_0x46cb('0x12')]);}logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x2d6c29(_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);}else{logger[_0x46cb('0xc')](_0x46cb('0x11'),_0x148d0f,_0x46cb('0xd'));_0x2d6c29(_0x3d7663[_0x46cb('0x13')]['message']);}})[_0x46cb('0x14')](function(_0x5796d2){logger[_0x46cb('0x10')]('VoiceContext,\x20%s,\x20%s',_0x148d0f,_0x5796d2);_0x24b4f5(_0x5796d2);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 268d717..bbac24b 100644 --- a/server/api/voiceDialReport/index.js +++ b/server/api/voiceDialReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b95=['create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','/:id','show','post'];(function(_0x50ab1d,_0x426c80){var _0x382e91=function(_0x295cc2){while(--_0x295cc2){_0x50ab1d['push'](_0x50ab1d['shift']());}};_0x382e91(++_0x426c80);}(_0x2b95,0x159));var _0x52b9=function(_0x31cc0e,_0x24ba4c){_0x31cc0e=_0x31cc0e-0x0;var _0x144862=_0x2b95[_0x31cc0e];return _0x144862;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x52b9('0x0'));var timeout=require(_0x52b9('0x1'));var express=require(_0x52b9('0x2'));var router=express[_0x52b9('0x3')]();var fs_extra=require(_0x52b9('0x4'));var auth=require(_0x52b9('0x5'));var interaction=require(_0x52b9('0x6'));var config=require(_0x52b9('0x7'));var controller=require(_0x52b9('0x8'));router[_0x52b9('0x9')]('/',auth[_0x52b9('0xa')](),controller['index']);router['get'](_0x52b9('0xb'),auth[_0x52b9('0xa')](),controller['describe']);router[_0x52b9('0x9')](_0x52b9('0xc'),auth[_0x52b9('0xa')](),controller[_0x52b9('0xd')]);router[_0x52b9('0xe')]('/',auth[_0x52b9('0xa')](),controller[_0x52b9('0xf')]);router[_0x52b9('0x10')](_0x52b9('0xc'),auth['isAuthenticated'](),controller[_0x52b9('0x11')]);router[_0x52b9('0x12')]('/:id',auth[_0x52b9('0xa')](),controller[_0x52b9('0x13')]);module['exports']=router; \ No newline at end of file +var _0xd4f2=['/:id','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','update','delete'];(function(_0x28ef41,_0x53f780){var _0x2da854=function(_0x3798a5){while(--_0x3798a5){_0x28ef41['push'](_0x28ef41['shift']());}};_0x2da854(++_0x53f780);}(_0xd4f2,0x132));var _0x2d4f=function(_0x3e627e,_0x94e430){_0x3e627e=_0x3e627e-0x0;var _0x157c8e=_0xd4f2[_0x3e627e];return _0x157c8e;};'use strict';var multer=require(_0x2d4f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4f('0x1'));var express=require('express');var router=express[_0x2d4f('0x2')]();var fs_extra=require(_0x2d4f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2d4f('0x4'));var config=require(_0x2d4f('0x5'));var controller=require(_0x2d4f('0x6'));router[_0x2d4f('0x7')]('/',auth[_0x2d4f('0x8')](),controller[_0x2d4f('0x9')]);router['get'](_0x2d4f('0xa'),auth[_0x2d4f('0x8')](),controller[_0x2d4f('0xb')]);router['get']('/:id',auth[_0x2d4f('0x8')](),controller[_0x2d4f('0xc')]);router[_0x2d4f('0xd')]('/',auth[_0x2d4f('0x8')](),controller['create']);router[_0x2d4f('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x2d4f('0xf')]);router[_0x2d4f('0x10')](_0x2d4f('0x11'),auth[_0x2d4f('0x8')](),controller['destroy']);module[_0x2d4f('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 6432c1b..ea55d3c 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x4205e0,_0x159b52){var _0x1e74b0=function(_0x16f88d){while(--_0x16f88d){_0x4205e0['push'](_0x4205e0['shift']());}};_0x1e74b0(++_0x159b52);}(_0x008c,0x188));var _0xc008=function(_0x52c1f6,_0x4eda0b){_0x52c1f6=_0x52c1f6-0x0;var _0x4df981=_0x008c[_0x52c1f6];return _0x4df981;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4b05c8,_0x498886){var _0x4363b0=function(_0x2419bb){while(--_0x2419bb){_0x4b05c8['push'](_0x4b05c8['shift']());}};_0x4363b0(++_0x498886);}(_0x34e8,0x12c));var _0x834e=function(_0x44629c,_0x237a77){_0x44629c=_0x44629c-0x0;var _0xa1befb=_0x34e8[_0x44629c];return _0xa1befb;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'privilege':{'type':Sequelize[_0x834e('0x2')]},'channel':{'type':Sequelize[_0x834e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'calleridnum':{'type':Sequelize[_0x834e('0x2')]},'calleridname':{'type':Sequelize[_0x834e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'connectedlinename':{'type':Sequelize[_0x834e('0x2')]},'language':{'type':Sequelize[_0x834e('0x2')]},'accountcode':{'type':Sequelize[_0x834e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x834e('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x834e('0x2')]},'linkedid':{'type':Sequelize[_0x834e('0x2')]},'destchannel':{'type':Sequelize[_0x834e('0x2')]},'destchannelstate':{'type':Sequelize[_0x834e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x834e('0x2')]},'destcalleridname':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x834e('0x2')]},'destlanguage':{'type':Sequelize[_0x834e('0x2')]},'destaccountcode':{'type':Sequelize[_0x834e('0x2')]},'destcontext':{'type':Sequelize[_0x834e('0x2')]},'destexten':{'type':Sequelize[_0x834e('0x2')]},'destpriority':{'type':Sequelize[_0x834e('0x3')]},'destuniqueid':{'type':Sequelize[_0x834e('0x2')]},'destlinkedid':{'type':Sequelize[_0x834e('0x2')]},'dialstring':{'type':Sequelize[_0x834e('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x834e('0x4')]},'answertime':{'type':Sequelize[_0x834e('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x834e('0x2')],'comment':_0x834e('0x5')},'routeId':{'type':Sequelize[_0x834e('0x3')]},'duration':{'type':Sequelize[_0x834e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x834e('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 969d92b..8b0c0fd 100644 --- a/server/api/voiceDialReport/voiceDialReport.controller.js +++ b/server/api/voiceDialReport/voiceDialReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd8c=['../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x26eec6,_0x34535a){var _0x44b9aa=function(_0x6c9c1e){while(--_0x6c9c1e){_0x26eec6['push'](_0x26eec6['shift']());}};_0x44b9aa(++_0x34535a);}(_0xfd8c,0x119));var _0xcfd8=function(_0x520ce8,_0x445e56){_0x520ce8=_0x520ce8-0x0;var _0x64369e=_0xfd8c[_0x520ce8];return _0x64369e;};'use strict';var emlformat=require(_0xcfd8('0x0'));var rimraf=require(_0xcfd8('0x1'));var zipdir=require(_0xcfd8('0x2'));var jsonpatch=require(_0xcfd8('0x3'));var rp=require('request-promise');var moment=require(_0xcfd8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcfd8('0x5'));var util=require(_0xcfd8('0x6'));var path=require(_0xcfd8('0x7'));var sox=require(_0xcfd8('0x8'));var csv=require(_0xcfd8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfd8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcfd8('0xb'));var jsforce=require(_0xcfd8('0xc'));var deskjs=require(_0xcfd8('0xd'));var toCsv=require(_0xcfd8('0x9'));var querystring=require(_0xcfd8('0xe'));var Papa=require(_0xcfd8('0xf'));var Redis=require(_0xcfd8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcfd8('0x11'));var as=require(_0xcfd8('0x12'));var hardwareService=require(_0xcfd8('0x13'));var logger=require(_0xcfd8('0x14'))(_0xcfd8('0x15'));var utils=require(_0xcfd8('0x16'));var config=require(_0xcfd8('0x17'));var licenseUtil=require(_0xcfd8('0x18'));var db=require(_0xcfd8('0x19'))['db'];function respondWithStatusCode(_0x474e0e,_0xbd1be5){_0xbd1be5=_0xbd1be5||0xcc;return function(_0xe93104){if(_0xe93104){return _0x474e0e['sendStatus'](_0xbd1be5);}return _0x474e0e[_0xcfd8('0x1a')](_0xbd1be5)[_0xcfd8('0x1b')]();};}function respondWithResult(_0x38819c,_0x54af92){_0x54af92=_0x54af92||0xc8;return function(_0x2d1989){if(_0x2d1989){return _0x38819c[_0xcfd8('0x1a')](_0x54af92)['json'](_0x2d1989);}};}function respondWithFilteredResult(_0x5268b2,_0x292265){return function(_0x16ce4d){if(_0x16ce4d){var _0x17a612=typeof _0x292265['offset']==='undefined'&&typeof _0x292265['limit']===_0xcfd8('0x1c');var _0x3b9b26=_0x16ce4d[_0xcfd8('0x1d')];var _0x389bc1=_0x17a612?0x0:_0x292265['offset'];var _0x134b86=_0x17a612?_0x16ce4d[_0xcfd8('0x1d')]:_0x292265[_0xcfd8('0x1e')]+_0x292265['limit'];var _0x4af565;if(_0x134b86>=_0x3b9b26){_0x134b86=_0x3b9b26;_0x4af565=0xc8;}else{_0x4af565=0xce;}_0x5268b2[_0xcfd8('0x1a')](_0x4af565);return _0x5268b2[_0xcfd8('0x1f')](_0xcfd8('0x20'),_0x389bc1+'-'+_0x134b86+'/'+_0x3b9b26)[_0xcfd8('0x21')](_0x16ce4d);}return null;};}function patchUpdates(_0x235a0f){return function(_0x3ae884){try{jsonpatch['apply'](_0x3ae884,_0x235a0f,!![]);}catch(_0x101b53){return BPromise[_0xcfd8('0x22')](_0x101b53);}return _0x3ae884['save']();};}function saveUpdates(_0x40e887,_0x3540aa){return function(_0x2641b5){if(_0x2641b5){return _0x2641b5[_0xcfd8('0x23')](_0x40e887)[_0xcfd8('0x24')](function(_0x1965ad){return _0x1965ad;});}return null;};}function removeEntity(_0x2bb284,_0x2a47b6){return function(_0x959d56){if(_0x959d56){return _0x959d56[_0xcfd8('0x25')]()[_0xcfd8('0x24')](function(){_0x2bb284[_0xcfd8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7fbc3f,_0x13f59c){return function(_0x2d3854){if(!_0x2d3854){_0x7fbc3f['sendStatus'](0x194);}return _0x2d3854;};}function handleError(_0x2f0bfc,_0x37f6bd){_0x37f6bd=_0x37f6bd||0x1f4;return function(_0x2865dd){logger[_0xcfd8('0x26')](_0x2865dd[_0xcfd8('0x27')]);if(_0x2865dd[_0xcfd8('0x28')]){delete _0x2865dd['name'];}_0x2f0bfc[_0xcfd8('0x1a')](_0x37f6bd)[_0xcfd8('0x29')](_0x2865dd);};}exports['index']=function(_0x3bfff8,_0x16eb78){var _0x44c00e={},_0x1df3bb={},_0x21dd82={'count':0x0,'rows':[]};var _0x4c0180=_[_0xcfd8('0x2a')](db[_0xcfd8('0x2b')][_0xcfd8('0x2c')],function(_0x26a816){return{'name':_0x26a816[_0xcfd8('0x2d')],'type':_0x26a816[_0xcfd8('0x2e')][_0xcfd8('0x2f')]};});_0x1df3bb['model']=_[_0xcfd8('0x2a')](_0x4c0180,_0xcfd8('0x28'));_0x1df3bb[_0xcfd8('0x30')]=_[_0xcfd8('0x31')](_0x3bfff8[_0xcfd8('0x30')]);_0x1df3bb[_0xcfd8('0x32')]=_[_0xcfd8('0x33')](_0x1df3bb[_0xcfd8('0x34')],_0x1df3bb[_0xcfd8('0x30')]);_0x44c00e[_0xcfd8('0x35')]=_[_0xcfd8('0x33')](_0x1df3bb[_0xcfd8('0x34')],qs[_0xcfd8('0x36')](_0x3bfff8[_0xcfd8('0x30')][_0xcfd8('0x36')]));_0x44c00e[_0xcfd8('0x35')]=_0x44c00e[_0xcfd8('0x35')][_0xcfd8('0x37')]?_0x44c00e[_0xcfd8('0x35')]:_0x1df3bb[_0xcfd8('0x34')];if(!_0x3bfff8[_0xcfd8('0x30')][_0xcfd8('0x38')]('nolimit')){_0x44c00e['limit']=qs['limit'](_0x3bfff8[_0xcfd8('0x30')][_0xcfd8('0x39')]);_0x44c00e['offset']=qs[_0xcfd8('0x1e')](_0x3bfff8[_0xcfd8('0x30')]['offset']);}_0x44c00e['order']=qs[_0xcfd8('0x3a')](_0x3bfff8[_0xcfd8('0x30')][_0xcfd8('0x3a')]);_0x44c00e[_0xcfd8('0x3b')]=qs[_0xcfd8('0x32')](_[_0xcfd8('0x3c')](_0x3bfff8['query'],_0x1df3bb[_0xcfd8('0x32')]),_0x4c0180);if(_0x3bfff8[_0xcfd8('0x30')][_0xcfd8('0x3d')]){_0x44c00e[_0xcfd8('0x3b')]=_[_0xcfd8('0x3e')](_0x44c00e[_0xcfd8('0x3b')],{'$or':_[_0xcfd8('0x2a')](_0x4c0180,function(_0x2fd856){if(_0x2fd856[_0xcfd8('0x2e')]!==_0xcfd8('0x3f')){var _0x8b0e79={};_0x8b0e79[_0x2fd856['name']]={'$like':'%'+_0x3bfff8[_0xcfd8('0x30')][_0xcfd8('0x3d')]+'%'};return _0x8b0e79;}})});}_0x44c00e=_[_0xcfd8('0x3e')]({},_0x44c00e,_0x3bfff8[_0xcfd8('0x40')]);var _0x329f17={'where':_0x44c00e[_0xcfd8('0x3b')]};return db[_0xcfd8('0x2b')][_0xcfd8('0x1d')](_0x329f17)[_0xcfd8('0x24')](function(_0x342173){_0x21dd82[_0xcfd8('0x1d')]=_0x342173;if(_0x3bfff8[_0xcfd8('0x30')][_0xcfd8('0x41')]){_0x44c00e['include']=[{'all':!![]}];}return db[_0xcfd8('0x2b')][_0xcfd8('0x42')](_0x44c00e);})[_0xcfd8('0x24')](function(_0x1ac7f0){_0x21dd82[_0xcfd8('0x43')]=_0x1ac7f0;return _0x21dd82;})[_0xcfd8('0x24')](respondWithFilteredResult(_0x16eb78,_0x44c00e))[_0xcfd8('0x44')](handleError(_0x16eb78,null));};exports[_0xcfd8('0x45')]=function(_0x4d383d,_0xefb86){var _0x451860={'raw':!![],'where':{'id':_0x4d383d['params']['id']}},_0x21ed60={};_0x21ed60[_0xcfd8('0x34')]=_[_0xcfd8('0x31')](db[_0xcfd8('0x2b')][_0xcfd8('0x2c')]);_0x21ed60[_0xcfd8('0x30')]=_[_0xcfd8('0x31')](_0x4d383d[_0xcfd8('0x30')]);_0x21ed60[_0xcfd8('0x32')]=_[_0xcfd8('0x33')](_0x21ed60[_0xcfd8('0x34')],_0x21ed60[_0xcfd8('0x30')]);_0x451860[_0xcfd8('0x35')]=_[_0xcfd8('0x33')](_0x21ed60['model'],qs[_0xcfd8('0x36')](_0x4d383d[_0xcfd8('0x30')][_0xcfd8('0x36')]));_0x451860['attributes']=_0x451860['attributes'][_0xcfd8('0x37')]?_0x451860[_0xcfd8('0x35')]:_0x21ed60[_0xcfd8('0x34')];if(_0x4d383d[_0xcfd8('0x30')][_0xcfd8('0x41')]){_0x451860[_0xcfd8('0x46')]=[{'all':!![]}];}_0x451860=_['merge']({},_0x451860,_0x4d383d['options']);return db[_0xcfd8('0x2b')][_0xcfd8('0x47')](_0x451860)[_0xcfd8('0x24')](handleEntityNotFound(_0xefb86,null))[_0xcfd8('0x24')](respondWithResult(_0xefb86,null))[_0xcfd8('0x44')](handleError(_0xefb86,null));};exports[_0xcfd8('0x48')]=function(_0x493994,_0x22c186){return db['VoiceDialReport'][_0xcfd8('0x48')](_0x493994[_0xcfd8('0x49')],{})['then'](respondWithResult(_0x22c186,0xc9))[_0xcfd8('0x44')](handleError(_0x22c186,null));};exports['update']=function(_0x374210,_0x43fd9e){if(_0x374210[_0xcfd8('0x49')]['id']){delete _0x374210[_0xcfd8('0x49')]['id'];}return db[_0xcfd8('0x2b')][_0xcfd8('0x47')]({'where':{'id':_0x374210[_0xcfd8('0x4a')]['id']}})[_0xcfd8('0x24')](handleEntityNotFound(_0x43fd9e,null))[_0xcfd8('0x24')](saveUpdates(_0x374210[_0xcfd8('0x49')],null))[_0xcfd8('0x24')](respondWithResult(_0x43fd9e,null))['catch'](handleError(_0x43fd9e,null));};exports[_0xcfd8('0x25')]=function(_0x3e8056,_0x182aa3){return db[_0xcfd8('0x2b')][_0xcfd8('0x47')]({'where':{'id':_0x3e8056['params']['id']}})[_0xcfd8('0x24')](handleEntityNotFound(_0x182aa3,null))['then'](removeEntity(_0x182aa3,null))[_0xcfd8('0x44')](handleError(_0x182aa3,null));};exports[_0xcfd8('0x4b')]=function(_0x5548d0,_0xc046c5){return db[_0xcfd8('0x2b')]['describe']()[_0xcfd8('0x24')](respondWithResult(_0xc046c5,null))['catch'](handleError(_0xc046c5,null));}; \ No newline at end of file +var _0xdaf7=['pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','describe','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','name','send','VoiceDialReport','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where'];(function(_0x6be187,_0x5b2394){var _0x18a47d=function(_0x4a4b1e){while(--_0x4a4b1e){_0x6be187['push'](_0x6be187['shift']());}};_0x18a47d(++_0x5b2394);}(_0xdaf7,0x135));var _0x7daf=function(_0x197e1b,_0x4a58b6){_0x197e1b=_0x197e1b-0x0;var _0x422afe=_0xdaf7[_0x197e1b];return _0x422afe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7daf('0x0'));var zipdir=require(_0x7daf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7daf('0x2'));var moment=require(_0x7daf('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7daf('0x4'));var path=require('path');var sox=require(_0x7daf('0x5'));var csv=require(_0x7daf('0x6'));var ejs=require(_0x7daf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7daf('0x8'));var squel=require(_0x7daf('0x9'));var crypto=require('crypto');var jsforce=require(_0x7daf('0xa'));var deskjs=require(_0x7daf('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7daf('0xc'));var Papa=require(_0x7daf('0xd'));var Redis=require(_0x7daf('0xe'));var authService=require(_0x7daf('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7daf('0x10'));var hardwareService=require(_0x7daf('0x11'));var logger=require(_0x7daf('0x12'))('api');var utils=require(_0x7daf('0x13'));var config=require(_0x7daf('0x14'));var licenseUtil=require(_0x7daf('0x15'));var db=require(_0x7daf('0x16'))['db'];function respondWithStatusCode(_0x345bbd,_0x34ca0b){_0x34ca0b=_0x34ca0b||0xcc;return function(_0x113553){if(_0x113553){return _0x345bbd[_0x7daf('0x17')](_0x34ca0b);}return _0x345bbd[_0x7daf('0x18')](_0x34ca0b)[_0x7daf('0x19')]();};}function respondWithResult(_0x2b420a,_0x3ad427){_0x3ad427=_0x3ad427||0xc8;return function(_0x42e855){if(_0x42e855){return _0x2b420a[_0x7daf('0x18')](_0x3ad427)[_0x7daf('0x1a')](_0x42e855);}};}function respondWithFilteredResult(_0x9ceb72,_0x2e44b9){return function(_0x3c0018){if(_0x3c0018){var _0x38f56e=typeof _0x2e44b9[_0x7daf('0x1b')]===_0x7daf('0x1c')&&typeof _0x2e44b9[_0x7daf('0x1d')]===_0x7daf('0x1c');var _0x37b334=_0x3c0018[_0x7daf('0x1e')];var _0x36508f=_0x38f56e?0x0:_0x2e44b9[_0x7daf('0x1b')];var _0x2425b0=_0x38f56e?_0x3c0018['count']:_0x2e44b9['offset']+_0x2e44b9[_0x7daf('0x1d')];var _0x53b563;if(_0x2425b0>=_0x37b334){_0x2425b0=_0x37b334;_0x53b563=0xc8;}else{_0x53b563=0xce;}_0x9ceb72[_0x7daf('0x18')](_0x53b563);return _0x9ceb72['set'](_0x7daf('0x1f'),_0x36508f+'-'+_0x2425b0+'/'+_0x37b334)['json'](_0x3c0018);}return null;};}function patchUpdates(_0x3a5f93){return function(_0x257a03){try{jsonpatch[_0x7daf('0x20')](_0x257a03,_0x3a5f93,!![]);}catch(_0x3866b5){return BPromise[_0x7daf('0x21')](_0x3866b5);}return _0x257a03[_0x7daf('0x22')]();};}function saveUpdates(_0x4a021c,_0x4be5ba){return function(_0x351785){if(_0x351785){return _0x351785['update'](_0x4a021c)[_0x7daf('0x23')](function(_0x36f8e1){return _0x36f8e1;});}return null;};}function removeEntity(_0x28a975,_0x37340e){return function(_0xa84136){if(_0xa84136){return _0xa84136[_0x7daf('0x24')]()[_0x7daf('0x23')](function(){_0x28a975[_0x7daf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40a8fc,_0x34cfdf){return function(_0x472314){if(!_0x472314){_0x40a8fc[_0x7daf('0x17')](0x194);}return _0x472314;};}function handleError(_0x34f5b1,_0x565de1){_0x565de1=_0x565de1||0x1f4;return function(_0x10c43f){logger[_0x7daf('0x25')](_0x10c43f['stack']);if(_0x10c43f['name']){delete _0x10c43f[_0x7daf('0x26')];}_0x34f5b1[_0x7daf('0x18')](_0x565de1)[_0x7daf('0x27')](_0x10c43f);};}exports['index']=function(_0x26483c,_0x132e4e){var _0x32628f={},_0xd0e4e5={},_0x3cd1ef={'count':0x0,'rows':[]};var _0x1ee97d=_['map'](db[_0x7daf('0x28')]['rawAttributes'],function(_0x27f6ca){return{'name':_0x27f6ca[_0x7daf('0x29')],'type':_0x27f6ca[_0x7daf('0x2a')][_0x7daf('0x2b')]};});_0xd0e4e5[_0x7daf('0x2c')]=_[_0x7daf('0x2d')](_0x1ee97d,_0x7daf('0x26'));_0xd0e4e5[_0x7daf('0x2e')]=_['keys'](_0x26483c[_0x7daf('0x2e')]);_0xd0e4e5[_0x7daf('0x2f')]=_['intersection'](_0xd0e4e5[_0x7daf('0x2c')],_0xd0e4e5[_0x7daf('0x2e')]);_0x32628f[_0x7daf('0x30')]=_[_0x7daf('0x31')](_0xd0e4e5[_0x7daf('0x2c')],qs[_0x7daf('0x32')](_0x26483c[_0x7daf('0x2e')][_0x7daf('0x32')]));_0x32628f['attributes']=_0x32628f[_0x7daf('0x30')][_0x7daf('0x33')]?_0x32628f[_0x7daf('0x30')]:_0xd0e4e5[_0x7daf('0x2c')];if(!_0x26483c[_0x7daf('0x2e')][_0x7daf('0x34')](_0x7daf('0x35'))){_0x32628f['limit']=qs['limit'](_0x26483c[_0x7daf('0x2e')][_0x7daf('0x1d')]);_0x32628f[_0x7daf('0x1b')]=qs[_0x7daf('0x1b')](_0x26483c[_0x7daf('0x2e')][_0x7daf('0x1b')]);}_0x32628f[_0x7daf('0x36')]=qs['sort'](_0x26483c[_0x7daf('0x2e')]['sort']);_0x32628f[_0x7daf('0x37')]=qs[_0x7daf('0x2f')](_[_0x7daf('0x38')](_0x26483c[_0x7daf('0x2e')],_0xd0e4e5[_0x7daf('0x2f')]),_0x1ee97d);if(_0x26483c[_0x7daf('0x2e')][_0x7daf('0x39')]){_0x32628f['where']=_['merge'](_0x32628f[_0x7daf('0x37')],{'$or':_[_0x7daf('0x2d')](_0x1ee97d,function(_0x404c7f){if(_0x404c7f['type']!==_0x7daf('0x3a')){var _0x2474a3={};_0x2474a3[_0x404c7f['name']]={'$like':'%'+_0x26483c[_0x7daf('0x2e')][_0x7daf('0x39')]+'%'};return _0x2474a3;}})});}_0x32628f=_[_0x7daf('0x3b')]({},_0x32628f,_0x26483c[_0x7daf('0x3c')]);var _0x2abdb4={'where':_0x32628f['where']};return db[_0x7daf('0x28')][_0x7daf('0x1e')](_0x2abdb4)[_0x7daf('0x23')](function(_0x5b5758){_0x3cd1ef[_0x7daf('0x1e')]=_0x5b5758;if(_0x26483c['query']['includeAll']){_0x32628f['include']=[{'all':!![]}];}return db[_0x7daf('0x28')][_0x7daf('0x3d')](_0x32628f);})[_0x7daf('0x23')](function(_0x4985a2){_0x3cd1ef[_0x7daf('0x3e')]=_0x4985a2;return _0x3cd1ef;})[_0x7daf('0x23')](respondWithFilteredResult(_0x132e4e,_0x32628f))[_0x7daf('0x3f')](handleError(_0x132e4e,null));};exports[_0x7daf('0x40')]=function(_0x4ecff,_0x426ec8){var _0x4ece6d={'raw':!![],'where':{'id':_0x4ecff[_0x7daf('0x41')]['id']}},_0xda102f={};_0xda102f[_0x7daf('0x2c')]=_[_0x7daf('0x42')](db['VoiceDialReport']['rawAttributes']);_0xda102f['query']=_[_0x7daf('0x42')](_0x4ecff[_0x7daf('0x2e')]);_0xda102f[_0x7daf('0x2f')]=_[_0x7daf('0x31')](_0xda102f[_0x7daf('0x2c')],_0xda102f['query']);_0x4ece6d[_0x7daf('0x30')]=_[_0x7daf('0x31')](_0xda102f['model'],qs['fields'](_0x4ecff[_0x7daf('0x2e')][_0x7daf('0x32')]));_0x4ece6d['attributes']=_0x4ece6d['attributes'][_0x7daf('0x33')]?_0x4ece6d[_0x7daf('0x30')]:_0xda102f[_0x7daf('0x2c')];if(_0x4ecff[_0x7daf('0x2e')][_0x7daf('0x43')]){_0x4ece6d[_0x7daf('0x44')]=[{'all':!![]}];}_0x4ece6d=_[_0x7daf('0x3b')]({},_0x4ece6d,_0x4ecff['options']);return db[_0x7daf('0x28')][_0x7daf('0x45')](_0x4ece6d)[_0x7daf('0x23')](handleEntityNotFound(_0x426ec8,null))[_0x7daf('0x23')](respondWithResult(_0x426ec8,null))['catch'](handleError(_0x426ec8,null));};exports[_0x7daf('0x46')]=function(_0xbd2ec0,_0x42394f){return db[_0x7daf('0x28')][_0x7daf('0x46')](_0xbd2ec0[_0x7daf('0x47')],{})[_0x7daf('0x23')](respondWithResult(_0x42394f,0xc9))[_0x7daf('0x3f')](handleError(_0x42394f,null));};exports['update']=function(_0x3dd376,_0x1d7f34){if(_0x3dd376['body']['id']){delete _0x3dd376[_0x7daf('0x47')]['id'];}return db[_0x7daf('0x28')][_0x7daf('0x45')]({'where':{'id':_0x3dd376[_0x7daf('0x41')]['id']}})[_0x7daf('0x23')](handleEntityNotFound(_0x1d7f34,null))[_0x7daf('0x23')](saveUpdates(_0x3dd376[_0x7daf('0x47')],null))['then'](respondWithResult(_0x1d7f34,null))[_0x7daf('0x3f')](handleError(_0x1d7f34,null));};exports[_0x7daf('0x24')]=function(_0x4b8090,_0x35d38c){return db[_0x7daf('0x28')][_0x7daf('0x45')]({'where':{'id':_0x4b8090['params']['id']}})[_0x7daf('0x23')](handleEntityNotFound(_0x35d38c,null))['then'](removeEntity(_0x35d38c,null))['catch'](handleError(_0x35d38c,null));};exports[_0x7daf('0x48')]=function(_0x2d5be1,_0x15368d){return db[_0x7daf('0x28')]['describe']()[_0x7daf('0x23')](respondWithResult(_0x15368d,null))[_0x7daf('0x3f')](handleError(_0x15368d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 9a7aa34..1e6a56c 100644 --- a/server/api/voiceDialReport/voiceDialReport.model.js +++ b/server/api/voiceDialReport/voiceDialReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x221b=['./voiceDialReport.attributes','exports','report_dial','uniqueid','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x29ced0,_0x152d0b){var _0x1b068e=function(_0x2ff695){while(--_0x2ff695){_0x29ced0['push'](_0x29ced0['shift']());}};_0x1b068e(++_0x152d0b);}(_0x221b,0xbf));var _0xb221=function(_0x3a05a4,_0x46dfaa){_0x3a05a4=_0x3a05a4-0x0;var _0x415ca1=_0x221b[_0x3a05a4];return _0x415ca1;};'use strict';var _=require(_0xb221('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb221('0x1'));var moment=require(_0xb221('0x2'));var BPromise=require(_0xb221('0x3'));var rp=require(_0xb221('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb221('0x5'));var config=require(_0xb221('0x6'));var attributes=require(_0xb221('0x7'));module[_0xb221('0x8')]=function(_0x31390b,_0x3f276c){return _0x31390b['define']('VoiceDialReport',attributes,{'tableName':_0xb221('0x9'),'paranoid':![],'indexes':[{'fields':[_0xb221('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8075=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceDialReport','uniqueid','lodash','util'];(function(_0xd6476f,_0x1c0cab){var _0x3db90b=function(_0x28b4ba){while(--_0x28b4ba){_0xd6476f['push'](_0xd6476f['shift']());}};_0x3db90b(++_0x1c0cab);}(_0x8075,0x191));var _0x5807=function(_0x4707f9,_0xe64a59){_0x4707f9=_0x4707f9-0x0;var _0x906324=_0x8075[_0x4707f9];return _0x906324;};'use strict';var _=require(_0x5807('0x0'));var util=require(_0x5807('0x1'));var logger=require('../../config/logger')(_0x5807('0x2'));var moment=require(_0x5807('0x3'));var BPromise=require(_0x5807('0x4'));var rp=require(_0x5807('0x5'));var fs=require('fs');var path=require(_0x5807('0x6'));var rimraf=require(_0x5807('0x7'));var config=require(_0x5807('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x5807('0x9')]=function(_0x4e22e5,_0x5ad700){return _0x4e22e5[_0x5807('0xa')](_0x5807('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x5807('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 0a9e6c9..6e66805 100644 --- a/server/api/voiceDialReport/voiceDialReport.rpc.js +++ b/server/api/voiceDialReport/voiceDialReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67e8=['where','attributes','limit','UpdateVoiceDialReport','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','VoiceDialReport,\x20%s,\x20%s','message','catch','CreateVoiceDialReport','options','raw','stringify','VoiceDialReport','update','body'];(function(_0x2688a9,_0x4d66e2){var _0x1d7f68=function(_0x1b38c0){while(--_0x1b38c0){_0x2688a9['push'](_0x2688a9['shift']());}};_0x1d7f68(++_0x4d66e2);}(_0x67e8,0xb2));var _0x867e=function(_0x15c7c5,_0x563abe){_0x15c7c5=_0x15c7c5-0x0;var _0x5f0735=_0x67e8[_0x15c7c5];return _0x5f0735;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x867e('0x0'));var BPromise=require(_0x867e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x867e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x867e('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x867e('0x4'));var jayson=require(_0x867e('0x5'));var client=jayson[_0x867e('0x6')][_0x867e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3e4800,_0x491da2,_0x31d5c4){return new BPromise(function(_0x1e4d70,_0xffc12d){return client[_0x867e('0x8')](_0x3e4800,_0x31d5c4)[_0x867e('0x9')](function(_0x3c2ce8){logger[_0x867e('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x491da2,_0x867e('0xb'));logger[_0x867e('0xc')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x491da2,'request\x20sent',JSON['stringify'](_0x3c2ce8));if(_0x3c2ce8[_0x867e('0xd')]){if(_0x3c2ce8[_0x867e('0xd')][_0x867e('0xe')]===0x1f4){logger['error'](_0x867e('0xf'),_0x491da2,_0x3c2ce8[_0x867e('0xd')][_0x867e('0x10')]);return _0xffc12d(_0x3c2ce8[_0x867e('0xd')][_0x867e('0x10')]);}logger[_0x867e('0xd')](_0x867e('0xf'),_0x491da2,_0x3c2ce8[_0x867e('0xd')][_0x867e('0x10')]);return _0x1e4d70(_0x3c2ce8[_0x867e('0xd')][_0x867e('0x10')]);}else{logger[_0x867e('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x491da2,'request\x20sent');_0x1e4d70(_0x3c2ce8['result']['message']);}})[_0x867e('0x11')](function(_0x4d0373){logger[_0x867e('0xd')](_0x867e('0xf'),_0x491da2,_0x4d0373);_0xffc12d(_0x4d0373);});});}exports[_0x867e('0x12')]=function(_0x41ad2b){var _0x213d7e=this;return new Promise(function(_0x4469cf,_0x17c39c){return db['VoiceDialReport']['create'](_0x41ad2b['body'],{'raw':_0x41ad2b[_0x867e('0x13')]?_0x41ad2b[_0x867e('0x13')][_0x867e('0x14')]===undefined?!![]:![]:!![]})[_0x867e('0x9')](function(_0x3ff153){logger[_0x867e('0xa')](_0x867e('0x12'),_0x41ad2b);logger[_0x867e('0xc')](_0x867e('0x12'),_0x41ad2b,JSON[_0x867e('0x15')](_0x3ff153));_0x4469cf(_0x3ff153);})[_0x867e('0x11')](function(_0x34108f){logger[_0x867e('0xd')]('CreateVoiceDialReport',_0x34108f[_0x867e('0x10')],_0x41ad2b);_0x17c39c(_0x213d7e['error'](0x1f4,_0x34108f[_0x867e('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x486f90){var _0x3a3bfc=this;return new Promise(function(_0x32c789,_0x430f8d){return db[_0x867e('0x16')][_0x867e('0x17')](_0x486f90[_0x867e('0x18')],{'raw':_0x486f90[_0x867e('0x13')]?_0x486f90['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x486f90[_0x867e('0x13')]?_0x486f90[_0x867e('0x13')][_0x867e('0x19')]||null:null,'attributes':_0x486f90[_0x867e('0x13')]?_0x486f90['options'][_0x867e('0x1a')]||null:null,'limit':_0x486f90[_0x867e('0x13')]?_0x486f90[_0x867e('0x13')][_0x867e('0x1b')]||null:null})[_0x867e('0x9')](function(_0x94f876){logger['info']('UpdateVoiceDialReport',_0x486f90);logger[_0x867e('0xc')](_0x867e('0x1c'),_0x486f90,JSON[_0x867e('0x15')](_0x94f876));_0x32c789(_0x94f876);})[_0x867e('0x11')](function(_0x485803){logger[_0x867e('0xd')](_0x867e('0x1c'),_0x485803[_0x867e('0x10')],_0x486f90);_0x430f8d(_0x3a3bfc['error'](0x1f4,_0x485803[_0x867e('0x10')]));});});}; \ No newline at end of file +var _0x7658=['attributes','limit','util','moment','bluebird','randomstring','../../config/logger','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','stringify','UpdateVoiceDialReport','raw','where'];(function(_0x434ca4,_0x2127c8){var _0x20a5de=function(_0x105e60){while(--_0x105e60){_0x434ca4['push'](_0x434ca4['shift']());}};_0x20a5de(++_0x2127c8);}(_0x7658,0x16a));var _0x8765=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7658[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x8765('0x0'));var moment=require(_0x8765('0x1'));var BPromise=require(_0x8765('0x2'));var rs=require(_0x8765('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8765('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8765('0x5'));var client=jayson[_0x8765('0x6')][_0x8765('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f48c7,_0x6c198e,_0x4bcad7){return new BPromise(function(_0x5291f5,_0x451d2d){return client[_0x8765('0x8')](_0x5f48c7,_0x4bcad7)[_0x8765('0x9')](function(_0x30abf5){logger[_0x8765('0xa')](_0x8765('0xb'),_0x6c198e,_0x8765('0xc'));logger[_0x8765('0xd')](_0x8765('0xe'),_0x6c198e,_0x8765('0xc'),JSON['stringify'](_0x30abf5));if(_0x30abf5[_0x8765('0xf')]){if(_0x30abf5[_0x8765('0xf')][_0x8765('0x10')]===0x1f4){logger[_0x8765('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x6c198e,_0x30abf5['error'][_0x8765('0x11')]);return _0x451d2d(_0x30abf5[_0x8765('0xf')][_0x8765('0x11')]);}logger['error'](_0x8765('0xb'),_0x6c198e,_0x30abf5[_0x8765('0xf')][_0x8765('0x11')]);return _0x5291f5(_0x30abf5[_0x8765('0xf')][_0x8765('0x11')]);}else{logger[_0x8765('0xa')](_0x8765('0xb'),_0x6c198e,'request\x20sent');_0x5291f5(_0x30abf5[_0x8765('0x12')][_0x8765('0x11')]);}})[_0x8765('0x13')](function(_0x558794){logger['error'](_0x8765('0xb'),_0x6c198e,_0x558794);_0x451d2d(_0x558794);});});}exports[_0x8765('0x14')]=function(_0x1ee72a){var _0x18f1da=this;return new Promise(function(_0x3e5b71,_0x3aefed){return db[_0x8765('0x15')]['create'](_0x1ee72a[_0x8765('0x16')],{'raw':_0x1ee72a['options']?_0x1ee72a[_0x8765('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x58928e){logger[_0x8765('0xa')](_0x8765('0x14'),_0x1ee72a);logger[_0x8765('0xd')]('CreateVoiceDialReport',_0x1ee72a,JSON[_0x8765('0x18')](_0x58928e));_0x3e5b71(_0x58928e);})[_0x8765('0x13')](function(_0x54e9bf){logger[_0x8765('0xf')](_0x8765('0x14'),_0x54e9bf[_0x8765('0x11')],_0x1ee72a);_0x3aefed(_0x18f1da['error'](0x1f4,_0x54e9bf['message']));});});};exports[_0x8765('0x19')]=function(_0x2dca00){var _0x924fd4=this;return new Promise(function(_0xb81539,_0x54cc65){return db[_0x8765('0x15')]['update'](_0x2dca00[_0x8765('0x16')],{'raw':_0x2dca00[_0x8765('0x17')]?_0x2dca00[_0x8765('0x17')][_0x8765('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dca00[_0x8765('0x17')]?_0x2dca00[_0x8765('0x17')][_0x8765('0x1b')]||null:null,'attributes':_0x2dca00[_0x8765('0x17')]?_0x2dca00[_0x8765('0x17')][_0x8765('0x1c')]||null:null,'limit':_0x2dca00['options']?_0x2dca00[_0x8765('0x17')][_0x8765('0x1d')]||null:null})['then'](function(_0x4c8fbe){logger[_0x8765('0xa')](_0x8765('0x19'),_0x2dca00);logger[_0x8765('0xd')](_0x8765('0x19'),_0x2dca00,JSON['stringify'](_0x4c8fbe));_0xb81539(_0x4c8fbe);})[_0x8765('0x13')](function(_0x262200){logger[_0x8765('0xf')](_0x8765('0x19'),_0x262200[_0x8765('0x11')],_0x2dca00);_0x54cc65(_0x924fd4[_0x8765('0xf')](0x1f4,_0x262200[_0x8765('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index d61cab9..05c7a88 100644 --- a/server/api/voiceExtension/index.js +++ b/server/api/voiceExtension/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b29=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','/:id/applications','addApplications','put','update','delete'];(function(_0x532c55,_0x4dab9a){var _0x1eefe9=function(_0x13b8cb){while(--_0x13b8cb){_0x532c55['push'](_0x532c55['shift']());}};_0x1eefe9(++_0x4dab9a);}(_0x6b29,0x1e6));var _0x96b2=function(_0x6eb833,_0x2bb5e5){_0x6eb833=_0x6eb833-0x0;var _0xdfc38c=_0x6b29[_0x6eb833];return _0xdfc38c;};'use strict';var multer=require(_0x96b2('0x0'));var util=require(_0x96b2('0x1'));var path=require(_0x96b2('0x2'));var timeout=require(_0x96b2('0x3'));var express=require(_0x96b2('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x96b2('0x5'));var interaction=require(_0x96b2('0x6'));var config=require(_0x96b2('0x7'));var controller=require(_0x96b2('0x8'));router[_0x96b2('0x9')]('/',auth[_0x96b2('0xa')](),controller[_0x96b2('0xb')]);router['get'](_0x96b2('0xc'),auth['isAuthenticated'](),controller[_0x96b2('0xd')]);router[_0x96b2('0xe')]('/',auth[_0x96b2('0xa')](),controller['create']);router[_0x96b2('0xe')](_0x96b2('0xf'),auth['isAuthenticated'](),controller[_0x96b2('0x10')]);router[_0x96b2('0x11')](_0x96b2('0xc'),auth[_0x96b2('0xa')](),controller[_0x96b2('0x12')]);router[_0x96b2('0x13')](_0x96b2('0xc'),auth[_0x96b2('0xa')](),controller[_0x96b2('0x14')]);module[_0x96b2('0x15')]=router; \ No newline at end of file +var _0x6aa2=['delete','destroy','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','show','post','/:id/applications','put','update'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0x6aa2,0x1ab));var _0x26aa=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0x6aa2[_0x27c068];return _0xe5a67f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x26aa('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x26aa('0x1'));var auth=require(_0x26aa('0x2'));var interaction=require(_0x26aa('0x3'));var config=require(_0x26aa('0x4'));var controller=require(_0x26aa('0x5'));router[_0x26aa('0x6')]('/',auth['isAuthenticated'](),controller[_0x26aa('0x7')]);router[_0x26aa('0x6')](_0x26aa('0x8'),auth[_0x26aa('0x9')](),controller[_0x26aa('0xa')]);router[_0x26aa('0xb')]('/',auth[_0x26aa('0x9')](),controller['create']);router[_0x26aa('0xb')](_0x26aa('0xc'),auth['isAuthenticated'](),controller['addApplications']);router[_0x26aa('0xd')](_0x26aa('0x8'),auth[_0x26aa('0x9')](),controller[_0x26aa('0xe')]);router[_0x26aa('0xf')](_0x26aa('0x8'),auth[_0x26aa('0x9')](),controller[_0x26aa('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index f13840e..d6ee4f8 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x894f=['internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','compositeIndex','STRING','ENUM','inbound'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x894f,0x1ab));var _0xf894=function(_0x52f412,_0x2a6972){_0x52f412=_0x52f412-0x0;var _0x3b8d25=_0x894f[_0x52f412];return _0x3b8d25;};'use strict';var Sequelize=require(_0xf894('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf894('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xf894('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xf894('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xf894('0x1')},'tag':{'type':Sequelize[_0xf894('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xf894('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xf894('0x3')](_0xf894('0x4'),'outbound',_0xf894('0x5'),_0xf894('0x6'),_0xf894('0x7'),_0xf894('0x8'),_0xf894('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf894('0x2')],'allowNull':![],'defaultValue':_0xf894('0xa')},'IntervalId':{'type':Sequelize[_0xf894('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xf894('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xf894('0x2')],'defaultValue':_0xf894('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xf894('0xe')],'get':function(_0x257ec1){return this[_0xf894('0xf')]('exten');}},'alias':{'type':Sequelize[_0xf894('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x25c8=['any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','outbound','outbound-fax','system'];(function(_0xf1a005,_0x361fee){var _0x5313f6=function(_0x3753f8){while(--_0x3753f8){_0xf1a005['push'](_0xf1a005['shift']());}};_0x5313f6(++_0x361fee);}(_0x25c8,0x68));var _0x825c=function(_0x5cfdf1,_0x1754fd){_0x5cfdf1=_0x5cfdf1-0x0;var _0x1413e0=_0x25c8[_0x5cfdf1];return _0x1413e0;};'use strict';var Sequelize=require(_0x825c('0x0'));module[_0x825c('0x1')]={'context':{'type':Sequelize[_0x825c('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x825c('0x2')],'allowNull':![],'unique':_0x825c('0x3')},'priority':{'type':Sequelize[_0x825c('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x825c('0x2')],'allowNull':![],'defaultValue':_0x825c('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0x825c('0x5'),'internal','inbound-fax',_0x825c('0x6'),_0x825c('0x7'),_0x825c('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x825c('0x2')]},'interval':{'type':Sequelize[_0x825c('0x2')],'allowNull':![],'defaultValue':_0x825c('0x9')},'IntervalId':{'type':Sequelize[_0x825c('0xa')]},'isApp':{'type':Sequelize[_0x825c('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x825c('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x825c('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x825c('0xa')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x825c('0xc')},'answer':{'type':Sequelize[_0x825c('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x825c('0xd')],'get':function(_0x3a0860){return this[_0x825c('0xe')](_0x825c('0xf'));}},'alias':{'type':Sequelize[_0x825c('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 59b43f7..45d4ef8 100644 --- a/server/api/voiceExtension/voiceExtension.controller.js +++ b/server/api/voiceExtension/voiceExtension.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb892=['where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','body','startsWith','exten','concat','user','role','inbound','OutboundRoutes','InternalRoutes','internal','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../components/parsers/qs','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','get','InboundRoutes','outbound','filter','map','value','type','find','then','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x142fce,_0x52e744){var _0x30295e=function(_0x11ecb1){while(--_0x11ecb1){_0x142fce['push'](_0x142fce['shift']());}};_0x30295e(++_0x52e744);}(_0xb892,0x13f));var _0x2b89=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb892[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var Redis=require(_0x2b89('0x0'));var qs=require(_0x2b89('0x1'));var logger=require('../../config/logger')('api');var config=require(_0x2b89('0x2'));var db=require('../../mysqldb')['db'];config[_0x2b89('0x3')]=_[_0x2b89('0x4')](config['redis'],{'host':_0x2b89('0x5'),'port':0x18eb});var socket=require(_0x2b89('0x6'))(new Redis(config[_0x2b89('0x3')]));require(_0x2b89('0x7'))['register'](socket);function respondWithStatusCode(_0x1dc1b6,_0x2e3165){_0x2e3165=_0x2e3165||0xcc;return function(_0x2e3977){if(_0x2e3977){return _0x1dc1b6[_0x2b89('0x8')](_0x2e3165);}return _0x1dc1b6[_0x2b89('0x9')](_0x2e3165)[_0x2b89('0xa')]();};}function respondWithResult(_0x532ae2,_0x5bbae8){_0x5bbae8=_0x5bbae8||0xc8;return function(_0x22d5d9){if(_0x22d5d9){return _0x532ae2[_0x2b89('0x9')](_0x5bbae8)['json'](_0x22d5d9);}};}function respondWithFilteredResult(_0x5959b5,_0x30a158){return function(_0x2fc5c3){if(_0x2fc5c3){var _0x2e9e8e=typeof _0x30a158[_0x2b89('0xb')]===_0x2b89('0xc')&&typeof _0x30a158[_0x2b89('0xd')]===_0x2b89('0xc');var _0x3a9988=_0x2fc5c3[_0x2b89('0xe')];var _0x2c6530=_0x2e9e8e?0x0:_0x30a158[_0x2b89('0xb')];var _0x3be6f2=_0x2e9e8e?_0x2fc5c3[_0x2b89('0xe')]:_0x30a158[_0x2b89('0xb')]+_0x30a158[_0x2b89('0xd')];var _0x141bfa;if(_0x3be6f2>=_0x3a9988){_0x3be6f2=_0x3a9988;_0x141bfa=0xc8;}else{_0x141bfa=0xce;}_0x5959b5['status'](_0x141bfa);return _0x5959b5[_0x2b89('0xf')](_0x2b89('0x10'),_0x2c6530+'-'+_0x3be6f2+'/'+_0x3a9988)[_0x2b89('0x11')](_0x2fc5c3);}return null;};}function removeEntity(_0x2c56a9){return function(_0x37cc5d){if(_0x37cc5d){return _0x37cc5d[_0x2b89('0x12')]()['then'](function(){var _0x2338d2=_0x37cc5d[_0x2b89('0x13')]({'plain':!![]});var _0x353d5c=[{'name':_0x2b89('0x14'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x2b89('0x15'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x16e66b=_(_0x353d5c)[_0x2b89('0x16')]('ignore')[_0x2b89('0x17')]('value')[_0x2b89('0x18')]();if(_['includes'](_0x16e66b,_0x2338d2[_0x2b89('0x19')])){return;}var _0x31fd6a=_[_0x2b89('0x1a')](_0x353d5c,[_0x2b89('0x18'),_0x2338d2[_0x2b89('0x19')]])['name'];return db['UserProfileResource'][_0x2b89('0x12')]({'where':{'type':_0x31fd6a,'resourceId':_0x2338d2['id']}})[_0x2b89('0x1b')](function(){return _0x37cc5d;});})[_0x2b89('0x1b')](function(){_0x2c56a9[_0x2b89('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c445a){return function(_0x14a0ae){if(!_0x14a0ae){_0x3c445a[_0x2b89('0x8')](0x194);}return _0x14a0ae;};}function handleError(_0x5e6336,_0x200723){_0x200723=_0x200723||0x1f4;return function(_0x2aadf1){logger[_0x2b89('0x1c')](_0x2aadf1[_0x2b89('0x1d')]);if(_0x2aadf1[_0x2b89('0x1e')]){delete _0x2aadf1[_0x2b89('0x1e')];}_0x5e6336[_0x2b89('0x9')](_0x200723)[_0x2b89('0x1f')](_0x2aadf1);};}exports[_0x2b89('0x20')]=function(_0x198dff,_0x180f78){var _0x31f8bb={},_0x22a94b={},_0x570d81={'count':0x0,'rows':[]};var _0x41fb96=_[_0x2b89('0x17')](db[_0x2b89('0x21')][_0x2b89('0x22')],function(_0x49902f){return{'name':_0x49902f[_0x2b89('0x23')],'type':_0x49902f[_0x2b89('0x19')][_0x2b89('0x24')]};});_0x22a94b[_0x2b89('0x25')]=_['map'](_0x41fb96,_0x2b89('0x1e'));_0x22a94b[_0x2b89('0x26')]=_[_0x2b89('0x27')](_0x198dff[_0x2b89('0x26')]);_0x22a94b[_0x2b89('0x28')]=_[_0x2b89('0x29')](_0x22a94b[_0x2b89('0x25')],_0x22a94b['query']);_0x31f8bb[_0x2b89('0x2a')]=_[_0x2b89('0x29')](_0x22a94b[_0x2b89('0x25')],qs[_0x2b89('0x2b')](_0x198dff[_0x2b89('0x26')][_0x2b89('0x2b')]));_0x31f8bb[_0x2b89('0x2a')]=_0x31f8bb['attributes'][_0x2b89('0x2c')]?_0x31f8bb[_0x2b89('0x2a')]:_0x22a94b['model'];if(!_0x198dff[_0x2b89('0x26')][_0x2b89('0x2d')](_0x2b89('0x2e'))){_0x31f8bb[_0x2b89('0xd')]=qs['limit'](_0x198dff[_0x2b89('0x26')][_0x2b89('0xd')]);_0x31f8bb[_0x2b89('0xb')]=qs['offset'](_0x198dff[_0x2b89('0x26')]['offset']);}_0x31f8bb[_0x2b89('0x2f')]=qs[_0x2b89('0x30')](_0x198dff[_0x2b89('0x26')]['sort']);_0x31f8bb[_0x2b89('0x31')]=qs['filters'](_[_0x2b89('0x32')](_0x198dff[_0x2b89('0x26')],_0x22a94b['filters']),_0x41fb96);if(_0x198dff[_0x2b89('0x26')][_0x2b89('0x16')]){_0x31f8bb[_0x2b89('0x31')]=_[_0x2b89('0x33')](_0x31f8bb[_0x2b89('0x31')],{'$or':_[_0x2b89('0x17')](_0x41fb96,function(_0x2912b4){if(_0x2912b4[_0x2b89('0x19')]!==_0x2b89('0x34')){var _0x28cedf={};_0x28cedf[_0x2912b4[_0x2b89('0x1e')]]={'$like':'%'+_0x198dff[_0x2b89('0x26')]['filter']+'%'};return _0x28cedf;}})});}_0x31f8bb=_['merge']({},_0x31f8bb,_0x198dff[_0x2b89('0x35')]);var _0x865a63={'where':_0x31f8bb[_0x2b89('0x31')]};return db[_0x2b89('0x21')][_0x2b89('0xe')](_0x865a63)['then'](function(_0x1cc31e){_0x570d81['count']=_0x1cc31e;if(_0x198dff[_0x2b89('0x26')][_0x2b89('0x36')]){_0x31f8bb[_0x2b89('0x37')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x31f8bb);})['then'](function(_0x57df7f){_0x570d81[_0x2b89('0x38')]=_0x57df7f;return _0x570d81;})['then'](respondWithFilteredResult(_0x180f78,_0x31f8bb))[_0x2b89('0x39')](handleError(_0x180f78,null));};exports['show']=function(_0x5f34f2,_0x40c64a){var _0x36164f={'raw':![],'where':{'id':_0x5f34f2[_0x2b89('0x3a')]['id']}},_0x30f325={};_0x30f325[_0x2b89('0x25')]=_[_0x2b89('0x27')](db[_0x2b89('0x21')][_0x2b89('0x22')]);_0x30f325['query']=_['keys'](_0x5f34f2[_0x2b89('0x26')]);_0x30f325[_0x2b89('0x28')]=_[_0x2b89('0x29')](_0x30f325[_0x2b89('0x25')],_0x30f325[_0x2b89('0x26')]);_0x36164f[_0x2b89('0x2a')]=_[_0x2b89('0x29')](_0x30f325[_0x2b89('0x25')],qs['fields'](_0x5f34f2[_0x2b89('0x26')]['fields']));_0x36164f[_0x2b89('0x2a')]=_0x36164f[_0x2b89('0x2a')][_0x2b89('0x2c')]?_0x36164f[_0x2b89('0x2a')]:_0x30f325['model'];if(_0x5f34f2[_0x2b89('0x26')][_0x2b89('0x36')]){_0x36164f[_0x2b89('0x37')]=[{'all':!![]}];}_0x36164f=_[_0x2b89('0x33')]({},_0x36164f,_0x5f34f2[_0x2b89('0x35')]);return db[_0x2b89('0x21')]['find'](_0x36164f)[_0x2b89('0x1b')](handleEntityNotFound(_0x40c64a,null))[_0x2b89('0x1b')](respondWithResult(_0x40c64a,null))[_0x2b89('0x39')](handleError(_0x40c64a,null));};exports[_0x2b89('0x12')]=function(_0x3163f4,_0xae3818){return db[_0x2b89('0x21')][_0x2b89('0x1a')]({'where':{'id':_0x3163f4[_0x2b89('0x3a')]['id']}})[_0x2b89('0x1b')](handleEntityNotFound(_0xae3818,null))[_0x2b89('0x1b')](removeEntity(_0xae3818,null))[_0x2b89('0x39')](handleError(_0xae3818,null));};exports['create']=function(_0x19c496,_0x27e2ad){if(_0x19c496[_0x2b89('0x3b')]['type']==='outbound'&&!_[_0x2b89('0x3c')](_0x19c496[_0x2b89('0x3b')]['exten'],'_')){_0x19c496[_0x2b89('0x3b')][_0x2b89('0x3d')]='_'[_0x2b89('0x3e')](_0x19c496[_0x2b89('0x3b')][_0x2b89('0x3d')]);}return db['VoiceExtension']['create'](_0x19c496[_0x2b89('0x3b')],{'raw':![]})[_0x2b89('0x1b')](function(_0x1214d1){var _0x213908=_0x19c496[_0x2b89('0x3f')][_0x2b89('0x13')]({'plain':!![]});if(!_0x213908)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x213908[_0x2b89('0x40')]==='user'){var _0x57c4dd=_0x1214d1[_0x2b89('0x13')]({'plain':!![]});var _0x510240=[{'name':_0x2b89('0x14'),'value':_0x2b89('0x41')},{'name':_0x2b89('0x42'),'value':_0x2b89('0x15')},{'name':_0x2b89('0x43'),'value':_0x2b89('0x44')}];var _0x450ae7=_[_0x2b89('0x1a')](_0x510240,[_0x2b89('0x18'),_0x57c4dd['type']])[_0x2b89('0x1e')];return db[_0x2b89('0x45')][_0x2b89('0x1a')]({'where':{'name':_0x450ae7,'userProfileId':_0x213908['userProfileId']},'raw':!![]})[_0x2b89('0x1b')](function(_0x310444){if(_0x310444&&_0x310444[_0x2b89('0x46')]===0x0){return db[_0x2b89('0x47')][_0x2b89('0x48')]({'name':_0x57c4dd[_0x2b89('0x1e')],'resourceId':_0x57c4dd['id'],'type':_0x310444[_0x2b89('0x1e')],'sectionId':_0x310444['id']},{})['then'](function(){return _0x1214d1;});}else{return _0x1214d1;}})[_0x2b89('0x39')](function(_0x374503){logger[_0x2b89('0x1c')](_0x2b89('0x49'),_0x374503);throw _0x374503;});}return _0x1214d1;})[_0x2b89('0x1b')](respondWithResult(_0x27e2ad,0xc9))[_0x2b89('0x39')](handleError(_0x27e2ad,null));};exports['update']=function(_0x1209e0,_0x2b89c5){if(_0x1209e0[_0x2b89('0x3b')]['id']){delete _0x1209e0['body']['id'];}return db[_0x2b89('0x21')][_0x2b89('0x1a')]({'where':{'id':_0x1209e0[_0x2b89('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2b89c5,null))['then'](function(_0x44f372){if(_0x44f372){return db[_0x2b89('0x21')]['update'](_[_0x2b89('0x32')](_0x1209e0['body'],[_0x2b89('0x3d'),_0x2b89('0x4a'),_0x2b89('0x4b'),_0x2b89('0x4c'),_0x2b89('0x4d'),_0x2b89('0x4e'),_0x2b89('0x4f')]),{'where':{'context':_0x44f372[_0x2b89('0x4a')],'exten':_0x44f372[_0x2b89('0x3d')]},'individualHooks':!![]})[_0x2b89('0x1b')](function(_0x4814ba){return _0x4814ba;});}return null;})[_0x2b89('0x1b')](respondWithStatusCode(_0x2b89c5,null))[_0x2b89('0x39')](handleError(_0x2b89c5,null));};exports[_0x2b89('0x50')]=function(_0x5c44c8,_0x11f903){var _0x55b5cf=_0x5c44c8['params']['id'];var _0x564759=_0x5c44c8[_0x2b89('0x3b')];var _0x2e827c=0xc8;var _0x27f1a5=null;return db[_0x2b89('0x51')]['transaction']({'isolationLevel':db[_0x2b89('0x51')][_0x2b89('0x52')][_0x2b89('0x53')][_0x2b89('0x54')]},function(_0x22624a){return db['VoiceExtension']['findOne']({'where':{'id':_0x55b5cf},'transaction':_0x22624a})[_0x2b89('0x1b')](function(_0x1de03b){if(_0x1de03b){return db[_0x2b89('0x21')][_0x2b89('0x12')]({'where':{'VoiceExtensionId':_0x55b5cf},'transaction':_0x22624a})[_0x2b89('0x1b')](function(){var _0x1cd561=_[_0x2b89('0x17')](_0x564759,function(_0x1af3bd){_0x1af3bd[_0x2b89('0x55')]=_0x55b5cf;_0x1af3bd[_0x2b89('0x56')]=!![];return _0x1af3bd;});return _0x1de03b[_0x2b89('0x57')](_0x1cd561);})[_0x2b89('0x1b')](function(_0x84805){return db[_0x2b89('0x21')][_0x2b89('0x58')](_0x84805,{'transaction':_0x22624a});});}else{_0x2e827c=0x194;_0x27f1a5=[];}});})[_0x2b89('0x1b')](function(){if(_0x2e827c!==0x194){return db[_0x2b89('0x21')][_0x2b89('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x55b5cf},'order':_0x2b89('0x5a')})[_0x2b89('0x1b')](function(_0xb61b0e){_0x27f1a5=_0xb61b0e;});}})[_0x2b89('0x39')](function(_0x28ee46){_0x2e827c=0x1f4;logger[_0x2b89('0x1c')](_0x28ee46[_0x2b89('0x1d')]);if(_0x28ee46[_0x2b89('0x1e')]){delete _0x28ee46[_0x2b89('0x1e')];}_0x27f1a5=_0x28ee46;})[_0x2b89('0x5b')](function(){if(_0x27f1a5===null){_0x11f903['sendStatus'](_0x2e827c);}else{if(_0x2e827c===0x1f4){_0x11f903[_0x2b89('0x9')](_0x2e827c)['send'](_0x27f1a5);}else{_0x11f903[_0x2b89('0x9')](_0x2e827c)['json'](_0x27f1a5);}}});}; \ No newline at end of file +var _0x2f21=['register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','destroy','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','type','find','then','stack','name','send','index','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','include','findAll','rows','catch','show','length','includeAll','body','exten','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','outbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','context','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','./voiceExtension.socket'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x2f21,0x1ba));var _0x12f2=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x2f21[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x12f2('0x0'));var Redis=require(_0x12f2('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x12f2('0x2'))('api');var config=require(_0x12f2('0x3'));var db=require(_0x12f2('0x4'))['db'];config[_0x12f2('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x12f2('0x6'))(new Redis(config[_0x12f2('0x5')]));require(_0x12f2('0x7'))[_0x12f2('0x8')](socket);function respondWithStatusCode(_0x4ef2b2,_0x23be91){_0x23be91=_0x23be91||0xcc;return function(_0x1df92d){if(_0x1df92d){return _0x4ef2b2[_0x12f2('0x9')](_0x23be91);}return _0x4ef2b2[_0x12f2('0xa')](_0x23be91)[_0x12f2('0xb')]();};}function respondWithResult(_0x74c730,_0x3b6474){_0x3b6474=_0x3b6474||0xc8;return function(_0x9116a7){if(_0x9116a7){return _0x74c730[_0x12f2('0xa')](_0x3b6474)[_0x12f2('0xc')](_0x9116a7);}};}function respondWithFilteredResult(_0x186996,_0xedd76b){return function(_0x1d903a){if(_0x1d903a){var _0x10c23a=typeof _0xedd76b[_0x12f2('0xd')]===_0x12f2('0xe')&&typeof _0xedd76b['limit']==='undefined';var _0x5c6d1c=_0x1d903a[_0x12f2('0xf')];var _0x107f1e=_0x10c23a?0x0:_0xedd76b[_0x12f2('0xd')];var _0x3db9a9=_0x10c23a?_0x1d903a[_0x12f2('0xf')]:_0xedd76b['offset']+_0xedd76b[_0x12f2('0x10')];var _0xa205b8;if(_0x3db9a9>=_0x5c6d1c){_0x3db9a9=_0x5c6d1c;_0xa205b8=0xc8;}else{_0xa205b8=0xce;}_0x186996[_0x12f2('0xa')](_0xa205b8);return _0x186996['set'](_0x12f2('0x11'),_0x107f1e+'-'+_0x3db9a9+'/'+_0x5c6d1c)[_0x12f2('0xc')](_0x1d903a);}return null;};}function removeEntity(_0x2ac424){return function(_0x150f3e){if(_0x150f3e){return _0x150f3e[_0x12f2('0x12')]()['then'](function(){var _0x25f774=_0x150f3e['get']({'plain':!![]});var _0x2659f8=[{'name':'InboundRoutes','value':_0x12f2('0x13'),'ignore':![]},{'name':_0x12f2('0x14'),'value':'outbound','ignore':![]},{'name':_0x12f2('0x15'),'value':_0x12f2('0x16'),'ignore':![]}];var _0x5e5c10=_(_0x2659f8)[_0x12f2('0x17')](_0x12f2('0x18'))[_0x12f2('0x19')](_0x12f2('0x1a'))[_0x12f2('0x1a')]();if(_['includes'](_0x5e5c10,_0x25f774[_0x12f2('0x1b')])){return;}var _0x12c309=_[_0x12f2('0x1c')](_0x2659f8,[_0x12f2('0x1a'),_0x25f774[_0x12f2('0x1b')]])['name'];return db['UserProfileResource'][_0x12f2('0x12')]({'where':{'type':_0x12c309,'resourceId':_0x25f774['id']}})[_0x12f2('0x1d')](function(){return _0x150f3e;});})[_0x12f2('0x1d')](function(){_0x2ac424['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b739e){return function(_0x572e07){if(!_0x572e07){_0x5b739e[_0x12f2('0x9')](0x194);}return _0x572e07;};}function handleError(_0x35dcb9,_0x105c10){_0x105c10=_0x105c10||0x1f4;return function(_0x4d44d6){logger['error'](_0x4d44d6[_0x12f2('0x1e')]);if(_0x4d44d6['name']){delete _0x4d44d6[_0x12f2('0x1f')];}_0x35dcb9[_0x12f2('0xa')](_0x105c10)[_0x12f2('0x20')](_0x4d44d6);};}exports[_0x12f2('0x21')]=function(_0x5120cf,_0x434c8c){var _0x520d7b={},_0x1264e7={},_0x17d383={'count':0x0,'rows':[]};var _0x58a88c=_[_0x12f2('0x19')](db['VoiceExtension'][_0x12f2('0x22')],function(_0x3f2a01){return{'name':_0x3f2a01[_0x12f2('0x23')],'type':_0x3f2a01[_0x12f2('0x1b')]['key']};});_0x1264e7[_0x12f2('0x24')]=_[_0x12f2('0x19')](_0x58a88c,'name');_0x1264e7[_0x12f2('0x25')]=_[_0x12f2('0x26')](_0x5120cf['query']);_0x1264e7[_0x12f2('0x27')]=_[_0x12f2('0x28')](_0x1264e7['model'],_0x1264e7[_0x12f2('0x25')]);_0x520d7b[_0x12f2('0x29')]=_[_0x12f2('0x28')](_0x1264e7[_0x12f2('0x24')],qs['fields'](_0x5120cf[_0x12f2('0x25')][_0x12f2('0x2a')]));_0x520d7b[_0x12f2('0x29')]=_0x520d7b[_0x12f2('0x29')]['length']?_0x520d7b[_0x12f2('0x29')]:_0x1264e7[_0x12f2('0x24')];if(!_0x5120cf[_0x12f2('0x25')][_0x12f2('0x2b')]('nolimit')){_0x520d7b['limit']=qs[_0x12f2('0x10')](_0x5120cf['query']['limit']);_0x520d7b[_0x12f2('0xd')]=qs['offset'](_0x5120cf[_0x12f2('0x25')]['offset']);}_0x520d7b[_0x12f2('0x2c')]=qs[_0x12f2('0x2d')](_0x5120cf['query'][_0x12f2('0x2d')]);_0x520d7b[_0x12f2('0x2e')]=qs[_0x12f2('0x27')](_[_0x12f2('0x2f')](_0x5120cf['query'],_0x1264e7[_0x12f2('0x27')]),_0x58a88c);if(_0x5120cf[_0x12f2('0x25')][_0x12f2('0x17')]){_0x520d7b[_0x12f2('0x2e')]=_[_0x12f2('0x30')](_0x520d7b['where'],{'$or':_[_0x12f2('0x19')](_0x58a88c,function(_0x325e7b){if(_0x325e7b[_0x12f2('0x1b')]!==_0x12f2('0x31')){var _0x5ee567={};_0x5ee567[_0x325e7b[_0x12f2('0x1f')]]={'$like':'%'+_0x5120cf['query'][_0x12f2('0x17')]+'%'};return _0x5ee567;}})});}_0x520d7b=_[_0x12f2('0x30')]({},_0x520d7b,_0x5120cf[_0x12f2('0x32')]);var _0x562907={'where':_0x520d7b[_0x12f2('0x2e')]};return db[_0x12f2('0x33')]['count'](_0x562907)[_0x12f2('0x1d')](function(_0x5f46c7){_0x17d383[_0x12f2('0xf')]=_0x5f46c7;if(_0x5120cf['query']['includeAll']){_0x520d7b[_0x12f2('0x34')]=[{'all':!![]}];}return db['VoiceExtension'][_0x12f2('0x35')](_0x520d7b);})['then'](function(_0xefc053){_0x17d383[_0x12f2('0x36')]=_0xefc053;return _0x17d383;})[_0x12f2('0x1d')](respondWithFilteredResult(_0x434c8c,_0x520d7b))[_0x12f2('0x37')](handleError(_0x434c8c,null));};exports[_0x12f2('0x38')]=function(_0x17042e,_0x5a9252){var _0x4ff6f5={'raw':![],'where':{'id':_0x17042e['params']['id']}},_0x5a3bc1={};_0x5a3bc1['model']=_[_0x12f2('0x26')](db[_0x12f2('0x33')][_0x12f2('0x22')]);_0x5a3bc1[_0x12f2('0x25')]=_['keys'](_0x17042e['query']);_0x5a3bc1[_0x12f2('0x27')]=_[_0x12f2('0x28')](_0x5a3bc1[_0x12f2('0x24')],_0x5a3bc1[_0x12f2('0x25')]);_0x4ff6f5[_0x12f2('0x29')]=_['intersection'](_0x5a3bc1[_0x12f2('0x24')],qs[_0x12f2('0x2a')](_0x17042e[_0x12f2('0x25')][_0x12f2('0x2a')]));_0x4ff6f5['attributes']=_0x4ff6f5[_0x12f2('0x29')][_0x12f2('0x39')]?_0x4ff6f5[_0x12f2('0x29')]:_0x5a3bc1['model'];if(_0x17042e[_0x12f2('0x25')][_0x12f2('0x3a')]){_0x4ff6f5[_0x12f2('0x34')]=[{'all':!![]}];}_0x4ff6f5=_[_0x12f2('0x30')]({},_0x4ff6f5,_0x17042e[_0x12f2('0x32')]);return db['VoiceExtension']['find'](_0x4ff6f5)[_0x12f2('0x1d')](handleEntityNotFound(_0x5a9252,null))[_0x12f2('0x1d')](respondWithResult(_0x5a9252,null))[_0x12f2('0x37')](handleError(_0x5a9252,null));};exports['destroy']=function(_0x50159d,_0x1c96dc){return db[_0x12f2('0x33')]['find']({'where':{'id':_0x50159d['params']['id']}})['then'](handleEntityNotFound(_0x1c96dc,null))['then'](removeEntity(_0x1c96dc,null))['catch'](handleError(_0x1c96dc,null));};exports['create']=function(_0xc9317a,_0x1f5595){if(_0xc9317a[_0x12f2('0x3b')][_0x12f2('0x1b')]==='outbound'&&!_['startsWith'](_0xc9317a[_0x12f2('0x3b')]['exten'],'_')){_0xc9317a[_0x12f2('0x3b')][_0x12f2('0x3c')]='_'['concat'](_0xc9317a[_0x12f2('0x3b')]['exten']);}return db['VoiceExtension'][_0x12f2('0x3d')](_0xc9317a[_0x12f2('0x3b')],{'raw':![]})[_0x12f2('0x1d')](function(_0x4729d6){var _0x2ace71=_0xc9317a[_0x12f2('0x3e')][_0x12f2('0x3f')]({'plain':!![]});if(!_0x2ace71)throw new Error(_0x12f2('0x40'));if(_0x2ace71[_0x12f2('0x41')]===_0x12f2('0x3e')){var _0x26bd18=_0x4729d6[_0x12f2('0x3f')]({'plain':!![]});var _0x107ded=[{'name':_0x12f2('0x42'),'value':_0x12f2('0x13')},{'name':_0x12f2('0x14'),'value':_0x12f2('0x43')},{'name':'InternalRoutes','value':_0x12f2('0x16')}];var _0x25d262=_[_0x12f2('0x1c')](_0x107ded,[_0x12f2('0x1a'),_0x26bd18['type']])[_0x12f2('0x1f')];return db[_0x12f2('0x44')][_0x12f2('0x1c')]({'where':{'name':_0x25d262,'userProfileId':_0x2ace71[_0x12f2('0x45')]},'raw':!![]})[_0x12f2('0x1d')](function(_0x2144bf){if(_0x2144bf&&_0x2144bf[_0x12f2('0x46')]===0x0){return db[_0x12f2('0x47')][_0x12f2('0x3d')]({'name':_0x26bd18[_0x12f2('0x1f')],'resourceId':_0x26bd18['id'],'type':_0x2144bf[_0x12f2('0x1f')],'sectionId':_0x2144bf['id']},{})[_0x12f2('0x1d')](function(){return _0x4729d6;});}else{return _0x4729d6;}})[_0x12f2('0x37')](function(_0x263fba){logger[_0x12f2('0x48')](_0x12f2('0x49'),_0x263fba);throw _0x263fba;});}return _0x4729d6;})[_0x12f2('0x1d')](respondWithResult(_0x1f5595,0xc9))[_0x12f2('0x37')](handleError(_0x1f5595,null));};exports[_0x12f2('0x4a')]=function(_0xccef76,_0x47a6fe){if(_0xccef76[_0x12f2('0x3b')]['id']){delete _0xccef76[_0x12f2('0x3b')]['id'];}return db['VoiceExtension'][_0x12f2('0x1c')]({'where':{'id':_0xccef76[_0x12f2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x47a6fe,null))['then'](function(_0x882d5a){if(_0x882d5a){return db[_0x12f2('0x33')][_0x12f2('0x4a')](_[_0x12f2('0x2f')](_0xccef76['body'],[_0x12f2('0x3c'),_0x12f2('0x4c'),'description','recordingFormat',_0x12f2('0x4d'),_0x12f2('0x4e'),_0x12f2('0x4f')]),{'where':{'context':_0x882d5a[_0x12f2('0x4c')],'exten':_0x882d5a[_0x12f2('0x3c')]},'individualHooks':!![]})[_0x12f2('0x1d')](function(_0x193452){return _0x193452;});}return null;})['then'](respondWithStatusCode(_0x47a6fe,null))['catch'](handleError(_0x47a6fe,null));};exports[_0x12f2('0x50')]=function(_0x54df87,_0x478f48){var _0x4fcfb6=_0x54df87[_0x12f2('0x4b')]['id'];var _0x3c9caa=_0x54df87['body'];var _0x54646e=0xc8;var _0x287fd1=null;return db[_0x12f2('0x51')][_0x12f2('0x52')]({'isolationLevel':db[_0x12f2('0x51')][_0x12f2('0x53')][_0x12f2('0x54')][_0x12f2('0x55')]},function(_0xcf8086){return db[_0x12f2('0x33')]['findOne']({'where':{'id':_0x4fcfb6},'transaction':_0xcf8086})['then'](function(_0x3d0adf){if(_0x3d0adf){return db['VoiceExtension'][_0x12f2('0x12')]({'where':{'VoiceExtensionId':_0x4fcfb6},'transaction':_0xcf8086})['then'](function(){var _0x2ce54e=_[_0x12f2('0x19')](_0x3c9caa,function(_0x3c89ad){_0x3c89ad[_0x12f2('0x56')]=_0x4fcfb6;_0x3c89ad['isApp']=!![];return _0x3c89ad;});return _0x3d0adf[_0x12f2('0x57')](_0x2ce54e);})[_0x12f2('0x1d')](function(_0x9d450a){return db['VoiceExtension']['bulkCreate'](_0x9d450a,{'transaction':_0xcf8086});});}else{_0x54646e=0x194;_0x287fd1=[];}});})[_0x12f2('0x1d')](function(){if(_0x54646e!==0x194){return db[_0x12f2('0x33')][_0x12f2('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4fcfb6},'order':_0x12f2('0x59')})['then'](function(_0x560513){_0x287fd1=_0x560513;});}})[_0x12f2('0x37')](function(_0x144e7a){_0x54646e=0x1f4;logger[_0x12f2('0x48')](_0x144e7a[_0x12f2('0x1e')]);if(_0x144e7a['name']){delete _0x144e7a[_0x12f2('0x1f')];}_0x287fd1=_0x144e7a;})['finally'](function(){if(_0x287fd1===null){_0x478f48[_0x12f2('0x9')](_0x54646e);}else{if(_0x54646e===0x1f4){_0x478f48[_0x12f2('0xa')](_0x54646e)[_0x12f2('0x20')](_0x287fd1);}else{_0x478f48['status'](_0x54646e)[_0x12f2('0xc')](_0x287fd1);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 18c9edf..822abf3 100644 --- a/server/api/voiceExtension/voiceExtension.events.js +++ b/server/api/voiceExtension/voiceExtension.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a74=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x1b92bc,_0x3bf36f){var _0x14c454=function(_0x1a441d){while(--_0x1a441d){_0x1b92bc['push'](_0x1b92bc['shift']());}};_0x14c454(++_0x3bf36f);}(_0x4a74,0xc3));var _0x44a7=function(_0x506f6f,_0x38d528){_0x506f6f=_0x506f6f-0x0;var _0x127adf=_0x4a74[_0x506f6f];return _0x127adf;};'use strict';var EventEmitter=require(_0x44a7('0x0'));var VoiceExtension=require(_0x44a7('0x1'))['db'][_0x44a7('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x44a7('0x3'),'afterUpdate':'update','afterDestroy':_0x44a7('0x4')};function emitEvent(_0x1fdfc7){return function(_0x485c9f,_0x173b0d,_0x3a8275){VoiceExtensionEvents[_0x44a7('0x5')](_0x1fdfc7+':'+_0x485c9f['id'],_0x485c9f);VoiceExtensionEvents['emit'](_0x1fdfc7,_0x485c9f);_0x3a8275(null);};}for(var e in events){if(events[_0x44a7('0x6')](e)){var event=events[e];VoiceExtension[_0x44a7('0x7')](e,emitEvent(event));}}module[_0x44a7('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x0abb=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0abb,0x7a));var _0xb0ab=function(_0x41ee09,_0x756735){_0x41ee09=_0x41ee09-0x0;var _0xa9af5c=_0x0abb[_0x41ee09];return _0xa9af5c;};'use strict';var EventEmitter=require(_0xb0ab('0x0'));var VoiceExtension=require(_0xb0ab('0x1'))['db'][_0xb0ab('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb0ab('0x3')](0x0);var events={'afterCreate':_0xb0ab('0x4'),'afterUpdate':_0xb0ab('0x5'),'afterDestroy':_0xb0ab('0x6')};function emitEvent(_0x24e652){return function(_0x13ec94,_0x4381b2,_0x3bd607){VoiceExtensionEvents[_0xb0ab('0x7')](_0x24e652+':'+_0x13ec94['id'],_0x13ec94);VoiceExtensionEvents['emit'](_0x24e652,_0x13ec94);_0x3bd607(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xb0ab('0x8')](e,emitEvent(event));}}module[_0xb0ab('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index b4767a0..6e1a3e9 100644 --- a/server/api/voiceExtension/voiceExtension.model.js +++ b/server/api/voiceExtension/voiceExtension.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x873a=['CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','timeout','options','split','length','name','trunk','phone','param','prefix','${EXTEN:','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','define','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','exports','type','Set','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','):Goto('];(function(_0x5f5721,_0xfba99c){var _0x261a86=function(_0x30f5cf){while(--_0x30f5cf){_0x5f5721['push'](_0x5f5721['shift']());}};_0x261a86(++_0xfba99c);}(_0x873a,0x1c2));var _0xa873=function(_0x6e20ac,_0x3fbe9a){_0x6e20ac=_0x6e20ac-0x0;var _0x280408=_0x873a[_0x6e20ac];return _0x280408;};'use strict';var _=require(_0xa873('0x0'));var attributes=require(_0xa873('0x1'));module[_0xa873('0x2')]=function(_0x52186c){var _0x1de6be=_0x52186c['models'];function _0x52c086(_0x423a1a){var _0x46971d=0x2;var _0x5a0d23=[{'type':_0x423a1a[_0xa873('0x3')],'app':_0xa873('0x4'),'appdata':'CDR(type)='+_0x423a1a[_0xa873('0x3')],'context':_0x423a1a['context'],'exten':_0x423a1a[_0xa873('0x5')],'priority':_0x46971d++,'VoiceExtensionId':_0x423a1a['id']},{'type':_0x423a1a[_0xa873('0x3')],'app':_0x423a1a[_0xa873('0x6')]?_0xa873('0x4'):_0xa873('0x7'),'appdata':_0x423a1a[_0xa873('0x6')]?_0xa873('0x8')+_0x423a1a[_0xa873('0x6')]:_0xa873('0x9'),'context':_0x423a1a[_0xa873('0xa')],'exten':_0x423a1a[_0xa873('0x5')],'priority':_0x46971d++,'VoiceExtensionId':_0x423a1a['id']}];if(_0x423a1a['type']===_0xa873('0xb')){_0x5a0d23['push']({'type':_0xa873('0xb'),'app':'Set','appdata':'CDR(routeid)='+_0x423a1a['id'],'context':_0x423a1a[_0xa873('0xa')],'exten':_0x423a1a['exten'],'priority':_0x46971d++,'VoiceExtensionId':_0x423a1a['id']});}_0x5a0d23[_0xa873('0xc')]({'type':_0x423a1a[_0xa873('0x3')],'app':'Set','appdata':_0xa873('0xd'),'context':_0x423a1a[_0xa873('0xa')],'exten':_0x423a1a[_0xa873('0x5')],'priority':_0x46971d++,'VoiceExtensionId':_0x423a1a['id']},{'type':_0x423a1a['type'],'app':_0xa873('0x4'),'appdata':_0xa873('0xe'),'context':_0x423a1a[_0xa873('0xa')],'exten':_0x423a1a['exten'],'priority':_0x46971d++,'VoiceExtensionId':_0x423a1a['id']},{'type':_0x423a1a[_0xa873('0x3')],'app':_0xa873('0x4'),'appdata':_0xa873('0xf'),'context':_0x423a1a['context'],'exten':_0x423a1a[_0xa873('0x5')],'priority':_0x46971d++,'VoiceExtensionId':_0x423a1a['id']});return _0x5a0d23;}function _0x4e0476(_0x1335bc){var _0x5189a6=0x2;var _0x3fe06=[{'type':_0xa873('0x10'),'app':'Set','appdata':_0xa873('0x11'),'context':_0x1335bc[_0xa873('0xa')],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']},{'type':'outbound','app':_0x1335bc[_0xa873('0x6')]?_0xa873('0x4'):_0xa873('0x7'),'appdata':_0x1335bc[_0xa873('0x6')]?_0xa873('0x8')+_0x1335bc[_0xa873('0x6')]:_0xa873('0x9'),'context':_0x1335bc['context'],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']},{'type':_0xa873('0x10'),'app':_0xa873('0x4'),'appdata':_0xa873('0x12')+(_0x1335bc[_0xa873('0x13')]?'${EXTEN:'+_0x1335bc[_0xa873('0x13')]+'}':_0xa873('0x14')),'context':_0x1335bc['context'],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']},{'type':'outbound','app':_0xa873('0x4'),'appdata':_0xa873('0x15')+_0x1335bc['id'],'context':_0x1335bc[_0xa873('0xa')],'exten':_0x1335bc['exten'],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']},{'type':'outbound','app':_0xa873('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5189a6+0x2)+_0xa873('0x17')+(_0x5189a6+0x1)+')','context':_0x1335bc['context'],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']},{'type':_0xa873('0x10'),'app':'Set','appdata':_0x1335bc[_0xa873('0x13')]?_0xa873('0x18')+_0x1335bc[_0xa873('0x13')]+'}':_0xa873('0x19'),'context':_0x1335bc[_0xa873('0xa')],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']},{'type':_0xa873('0x10'),'app':_0xa873('0x4'),'appdata':_0xa873('0xd'),'context':_0x1335bc[_0xa873('0xa')],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']},{'type':_0xa873('0x10'),'app':_0xa873('0x4'),'appdata':_0xa873('0xe'),'context':_0x1335bc[_0xa873('0xa')],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']},{'type':_0xa873('0x10'),'app':_0xa873('0x4'),'appdata':_0xa873('0xf'),'context':_0x1335bc[_0xa873('0xa')],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']},{'type':_0xa873('0x10'),'app':_0xa873('0x4'),'appdata':_0xa873('0x1a')+_0x1335bc['id'],'context':_0x1335bc[_0xa873('0xa')],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']}];if(_0x1335bc['hasOwnProperty'](_0xa873('0x1b'))&&_0x1335bc[_0xa873('0x1b')]!==_0xa873('0x1c')){_0x3fe06[_0xa873('0xc')]({'type':_0xa873('0x10'),'app':_0xa873('0x4'),'appdata':_0xa873('0x1d'),'context':_0x1335bc['context'],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']},{'type':_0xa873('0x10'),'app':_0xa873('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1335bc[_0xa873('0x1b')]||_0xa873('0x1e'),'context':_0x1335bc[_0xa873('0xa')],'exten':_0x1335bc[_0xa873('0x5')],'priority':_0x5189a6++,'VoiceExtensionId':_0x1335bc['id']});}return _0x3fe06;}function _0x1074b4(_0x5e51f0,_0x5a859e){var _0x5aae7e=[{'name':'trunk','param':0x0},{'name':_0xa873('0x1f'),'param':0x1},{'name':_0xa873('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x1dd54f={};var _0x442830=_0x5a859e[_0xa873('0x21')](',');var _0x3ce968=[];for(var _0x2f5890=0x0;_0x2f5890<_0x5aae7e[_0xa873('0x22')];_0x2f5890++){switch(_0x5aae7e[_0x2f5890][_0xa873('0x23')]){case'trunk':_0x1dd54f[_0xa873('0x24')]=_0x442830[_0x5aae7e[_0x2f5890]['param']][_0xa873('0x21')]('/')[0x1];_0x1dd54f[_0xa873('0x25')]=_0x442830[_0x5aae7e[_0x2f5890][_0xa873('0x26')]][_0xa873('0x21')]('/')[0x2];_0x1dd54f['prefix']=_0x1dd54f[_0xa873('0x25')]?_0x1dd54f[_0xa873('0x25')][_0xa873('0x21')]('$')[0x0]:undefined;_0x1dd54f['phone']=_0x5e51f0[_0xa873('0x13')]?(_0x1dd54f[_0xa873('0x27')]||'')+_0xa873('0x28')+_0x5e51f0[_0xa873('0x13')]+'}':(_0x1dd54f['prefix']||'')+_0xa873('0x14');_0x3ce968[_0x5aae7e[_0x2f5890][_0xa873('0x26')]]=[_0xa873('0x29'),_0x1dd54f[_0xa873('0x24')],_0x1dd54f['phone']][_0xa873('0x2a')]('/');break;case _0xa873('0x20'):_0x1dd54f[_0xa873('0x20')]=_0x442830[_0x5aae7e[_0x2f5890][_0xa873('0x26')]];if(_0x5e51f0[_0xa873('0x1b')]!==_0xa873('0x1c')){if(_0x1dd54f[_0xa873('0x20')][_0xa873('0x2b')](_0xa873('0x2c'))<0x0){_0x1dd54f['options']+='U(xcally-mixmonitor-context)';}}else{_0x1dd54f[_0xa873('0x20')]=_0x1dd54f[_0xa873('0x20')][_0xa873('0x2d')](_0xa873('0x2c'),'');}_0x3ce968[_0x5aae7e[_0x2f5890][_0xa873('0x26')]]=_0x1dd54f['options'];break;default:_0x3ce968[_0x5aae7e[_0x2f5890][_0xa873('0x26')]]=_0x442830[_0x5aae7e[_0x2f5890][_0xa873('0x26')]];}}return _0x3ce968[_0xa873('0x2a')](',');}function _0x4e89bc(_0x504666,_0x2361c4,_0x231a3b){return new Promise(function(_0xf311b8,_0x5d4000){var _0x3f2ce4=[];if(_['isEmpty'](_0x2361c4))return _0xf311b8(_0x3f2ce4);_0x1de6be['Interval'][_0xa873('0x2e')]({'attributes':['id',_0xa873('0x2f'),_0xa873('0x30')],'raw':!![]})[_0xa873('0x31')](function(_0x71f1dc){for(var _0xc756b2=0x0,_0x4a9f70=0x0;_0xc756b2<_0x2361c4[_0xa873('0x22')];_0xc756b2++,_0x4a9f70=0x0){var _0x544a06=_0x2361c4[_0xc756b2];var _0x30528e=[];var _0x227b9b=[];delete _0x544a06['id'];if(_0x544a06[_0xa873('0x2f')]!==_0xa873('0x32')){_0x544a06[_0xa873('0x33')]=[_0x544a06[_0xa873('0x2f')]];}else{_0x544a06[_0xa873('0x33')]=_0x544a06[_0xa873('0x30')]?_[_0xa873('0x34')](_[_0xa873('0x35')](_0x71f1dc,{'IntervalId':_0x544a06['IntervalId']}),_0xa873('0x2f')):[];}_0x544a06[_0xa873('0xa')]=_0x504666[_0xa873('0xa')];_0x544a06[_0xa873('0x5')]=_0x504666['exten'];if(_0x544a06[_0xa873('0x3')])_0x544a06['type']=_0x544a06['type'][_0xa873('0x36')]();if(_0x504666[_0xa873('0x3')]===_0xa873('0x10')){if(_0x544a06[_0xa873('0x37')]('tag')&&_0x544a06[_0xa873('0x38')]&&_0x544a06[_0xa873('0x38')]!=='--'){_0x30528e[_0xa873('0xc')]({'type':_0x544a06[_0xa873('0x3')]['toLowerCase'](),'app':_0xa873('0x4'),'appdata':_0xa873('0x39')+_0x544a06[_0xa873('0x38')],'context':_0x504666[_0xa873('0xa')],'exten':_0x504666[_0xa873('0x5')],'priority':_0x544a06['intervals'][_0xa873('0x22')]+_0x231a3b+_0x4a9f70++,'VoiceExtensionId':_0x504666['id']});}_0x30528e['push']({'type':_0x544a06['type'][_0xa873('0x36')](),'app':_0xa873('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x544a06[_0xa873('0x3a')]?'Set(CALLERID(all)='+_0x544a06[_0xa873('0x3a')]+')':_0xa873('0x3b')),'context':_0x504666[_0xa873('0xa')],'exten':_0x504666[_0xa873('0x5')],'priority':_0x544a06[_0xa873('0x33')][_0xa873('0x22')]+_0x231a3b+_0x4a9f70++,'VoiceExtensionId':_0x504666['id']});}else{if(_0x544a06[_0xa873('0x37')](_0xa873('0x3c'))){if([_0xa873('0x3d'),_0xa873('0x3e')][_0xa873('0x3f')](_0x544a06[_0xa873('0x40')][_0xa873('0x36')]())&&_0x544a06['appType']!==_0xa873('0x41')){if(_0x544a06[_0xa873('0x3c')]){_0x30528e[_0xa873('0xc')]({'type':_0x544a06[_0xa873('0x3')][_0xa873('0x36')](),'app':_0xa873('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x504666[_0xa873('0xa')],'exten':_0x504666[_0xa873('0x5')],'priority':_0x544a06['intervals']['length']+_0x231a3b+_0x4a9f70++,'VoiceExtensionId':_0x504666['id']});_0x30528e['push']({'type':_0x544a06[_0xa873('0x3')][_0xa873('0x36')](),'app':'Set','appdata':_0xa873('0x42'),'context':_0x504666[_0xa873('0xa')],'exten':_0x504666[_0xa873('0x5')],'priority':_0x544a06[_0xa873('0x33')][_0xa873('0x22')]+_0x231a3b+_0x4a9f70++,'VoiceExtensionId':_0x504666['id']});}else{_0x30528e[_0xa873('0xc')]({'type':_0x544a06[_0xa873('0x3')][_0xa873('0x36')](),'app':'ExecIf','appdata':_0xa873('0x43'),'context':_0x504666[_0xa873('0xa')],'exten':_0x504666[_0xa873('0x5')],'priority':_0x544a06['intervals'][_0xa873('0x22')]+_0x231a3b+_0x4a9f70++,'VoiceExtensionId':_0x504666['id']});_0x30528e['push']({'type':_0x544a06['type'][_0xa873('0x36')](),'app':_0xa873('0x4'),'appdata':_0xa873('0x44'),'context':_0x504666[_0xa873('0xa')],'exten':_0x504666[_0xa873('0x5')],'priority':_0x544a06[_0xa873('0x33')][_0xa873('0x22')]+_0x231a3b+_0x4a9f70++,'VoiceExtensionId':_0x504666['id']});}}}}for(var _0x1638ae=0x0;_0x1638ae<_0x544a06[_0xa873('0x33')][_0xa873('0x22')];_0x1638ae++){var _0x41bef5=_0x231a3b+_0x544a06[_0xa873('0x33')]['length'];var _0x1ed193=_0x1638ae===_0x544a06[_0xa873('0x33')][_0xa873('0x22')]-0x1?_0x231a3b+_0x30528e[_0xa873('0x22')]+_0x227b9b[_0xa873('0x22')]+0x2:_0x231a3b+_0x1638ae+0x1;_0x30528e['splice'](_0x1638ae,0x0,{'type':_0x504666['type'],'app':_0xa873('0x45'),'appdata':_0x544a06[_0xa873('0x33')][_0x1638ae]+'?'+_0x504666[_0xa873('0xa')]+',${EXTEN},'+_0x41bef5+':'+_0x504666[_0xa873('0xa')]+_0xa873('0x46')+_0x1ed193,'exten':_0x504666[_0xa873('0x5')],'context':_0x504666[_0xa873('0xa')],'priority':_0x231a3b+_0x1638ae,'VoiceExtensionId':_0x504666['id']});}if(_0x544a06['appType']==='outboundDial')_0x544a06[_0xa873('0x47')]=_0x1074b4(_0x504666,_0x544a06[_0xa873('0x47')]);_0x544a06[_0xa873('0x48')]=_0x30528e[_0xa873('0x22')]?_[_0xa873('0x49')](_0x30528e)[_0xa873('0x48')]+0x1:_0x231a3b;_0x3f2ce4=_[_0xa873('0x4a')](_0x3f2ce4,_0x30528e,[_0x544a06],_0x227b9b);_0x231a3b=_['last'](_0x3f2ce4)['priority']+0x1;}return _0xf311b8(_0x3f2ce4);})['catch'](function(_0x11d0e9){_0x5d4000(_0x11d0e9);});});}return _0x52186c[_0xa873('0x4b')](_0xa873('0x4c'),attributes,{'tableName':_0xa873('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x35e2ed){var _0x1a17e2=this['get']({'plain':!![]});var _0x428336=_0x1a17e2['type']===_0xa873('0x10')?_0x4e0476(_0x1a17e2):_0x52c086(_0x1a17e2);return _0x4e89bc(_0x1a17e2,_0x35e2ed,_[_0xa873('0x49')](_0x428336)[_0xa873('0x48')]+0x1)[_0xa873('0x31')](function(_0x3e9467){var _0x3fa536=_[_0xa873('0x4a')](_0x428336,_0x3e9467);_0x3fa536[_0xa873('0xc')]({'type':_0x1a17e2[_0xa873('0x3')],'app':_0xa873('0x4e'),'exten':_0x1a17e2[_0xa873('0x5')],'context':_0x1a17e2[_0xa873('0xa')],'priority':_[_0xa873('0x49')](_0x3fa536)[_0xa873('0x48')]+0x1,'VoiceExtensionId':_0x1a17e2['id']});return _0x3fa536;});}}});}; \ No newline at end of file +var _0x5fc3=['queue','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','priority','last','concat','catch','VoiceExtension','get','lodash','./voiceExtension.attributes','models','type','Set','context','alias','NoOp','CDR(routeAlias)=','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','url','length','name','split','param','prefix','phone','SIP','trunk','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','intervals','map','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer'];(function(_0x21b283,_0x46d64a){var _0x14631a=function(_0x4d2432){while(--_0x4d2432){_0x21b283['push'](_0x21b283['shift']());}};_0x14631a(++_0x46d64a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0x5fc3[_0x102977];return _0x15c466;};'use strict';var _=require(_0x35fc('0x0'));var attributes=require(_0x35fc('0x1'));module['exports']=function(_0x253d6e){var _0x2ac6da=_0x253d6e[_0x35fc('0x2')];function _0x91d024(_0xb4f9ce){var _0x5e75e6=0x2;var _0x2d1404=[{'type':_0xb4f9ce[_0x35fc('0x3')],'app':_0x35fc('0x4'),'appdata':'CDR(type)='+_0xb4f9ce['type'],'context':_0xb4f9ce[_0x35fc('0x5')],'exten':_0xb4f9ce['exten'],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']},{'type':_0xb4f9ce[_0x35fc('0x3')],'app':_0xb4f9ce[_0x35fc('0x6')]?_0x35fc('0x4'):_0x35fc('0x7'),'appdata':_0xb4f9ce[_0x35fc('0x6')]?_0x35fc('0x8')+_0xb4f9ce[_0x35fc('0x6')]:'No\x20alias\x20set','context':_0xb4f9ce[_0x35fc('0x5')],'exten':_0xb4f9ce[_0x35fc('0x9')],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']}];if(_0xb4f9ce['type']===_0x35fc('0xa')){_0x2d1404[_0x35fc('0xb')]({'type':'inbound','app':_0x35fc('0x4'),'appdata':_0x35fc('0xc')+_0xb4f9ce['id'],'context':_0xb4f9ce['context'],'exten':_0xb4f9ce['exten'],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']});}_0x2d1404[_0x35fc('0xb')]({'type':_0xb4f9ce['type'],'app':_0x35fc('0x4'),'appdata':_0x35fc('0xd'),'context':_0xb4f9ce[_0x35fc('0x5')],'exten':_0xb4f9ce[_0x35fc('0x9')],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']},{'type':_0xb4f9ce[_0x35fc('0x3')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xb4f9ce['context'],'exten':_0xb4f9ce['exten'],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']},{'type':_0xb4f9ce[_0x35fc('0x3')],'app':_0x35fc('0x4'),'appdata':_0x35fc('0xe'),'context':_0xb4f9ce[_0x35fc('0x5')],'exten':_0xb4f9ce[_0x35fc('0x9')],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']});return _0x2d1404;}function _0x1121fa(_0x480851){var _0x26ba54=0x2;var _0x45c8b7=[{'type':'outbound','app':_0x35fc('0x4'),'appdata':_0x35fc('0xf'),'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851['exten'],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x480851[_0x35fc('0x6')]?_0x35fc('0x4'):'NoOp','appdata':_0x480851[_0x35fc('0x6')]?_0x35fc('0x8')+_0x480851[_0x35fc('0x6')]:_0x35fc('0x11'),'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x35fc('0x12')+(_0x480851[_0x35fc('0x13')]?'${EXTEN:'+_0x480851[_0x35fc('0x13')]+'}':_0x35fc('0x14')),'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':'Set','appdata':_0x35fc('0xc')+_0x480851['id'],'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851['exten'],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x15'),'appdata':_0x35fc('0x16')+(_0x26ba54+0x2)+'):Goto('+(_0x26ba54+0x1)+')','context':_0x480851[_0x35fc('0x5')],'exten':_0x480851['exten'],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x480851['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x480851[_0x35fc('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':'outbound','app':_0x35fc('0x4'),'appdata':_0x35fc('0xd'),'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x35fc('0x17'),'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851['exten'],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x35fc('0xe'),'context':_0x480851['context'],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x35fc('0x18')+_0x480851['id'],'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']}];if(_0x480851[_0x35fc('0x19')](_0x35fc('0x1a'))&&_0x480851[_0x35fc('0x1a')]!==_0x35fc('0x1b')){_0x45c8b7['push']({'type':'outbound','app':_0x35fc('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x35fc('0x1c')+_0x480851[_0x35fc('0x1a')]||'wav','context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']});}return _0x45c8b7;}function _0x46b9ef(_0x4441d8,_0x2bbd36){var _0x2f823b=[{'name':'trunk','param':0x0},{'name':_0x35fc('0x1d'),'param':0x1},{'name':_0x35fc('0x1e'),'param':0x2},{'name':_0x35fc('0x1f'),'param':0x3}];var _0x52f53d={};var _0x2c657d=_0x2bbd36['split'](',');var _0x2ecb2e=[];for(var _0x33a377=0x0;_0x33a377<_0x2f823b[_0x35fc('0x20')];_0x33a377++){switch(_0x2f823b[_0x33a377][_0x35fc('0x21')]){case'trunk':_0x52f53d['trunk']=_0x2c657d[_0x2f823b[_0x33a377]['param']][_0x35fc('0x22')]('/')[0x1];_0x52f53d['phone']=_0x2c657d[_0x2f823b[_0x33a377][_0x35fc('0x23')]]['split']('/')[0x2];_0x52f53d[_0x35fc('0x24')]=_0x52f53d[_0x35fc('0x25')]?_0x52f53d[_0x35fc('0x25')][_0x35fc('0x22')]('$')[0x0]:undefined;_0x52f53d[_0x35fc('0x25')]=_0x4441d8[_0x35fc('0x13')]?(_0x52f53d[_0x35fc('0x24')]||'')+'${EXTEN:'+_0x4441d8[_0x35fc('0x13')]+'}':(_0x52f53d[_0x35fc('0x24')]||'')+'${EXTEN}';_0x2ecb2e[_0x2f823b[_0x33a377][_0x35fc('0x23')]]=[_0x35fc('0x26'),_0x52f53d[_0x35fc('0x27')],_0x52f53d[_0x35fc('0x25')]][_0x35fc('0x28')]('/');break;case _0x35fc('0x1e'):_0x52f53d['options']=_0x2c657d[_0x2f823b[_0x33a377][_0x35fc('0x23')]];if(_0x4441d8[_0x35fc('0x1a')]!==_0x35fc('0x1b')){if(_0x52f53d['options'][_0x35fc('0x29')](_0x35fc('0x2a'))<0x0){_0x52f53d['options']+=_0x35fc('0x2a');}}else{_0x52f53d[_0x35fc('0x1e')]=_0x52f53d[_0x35fc('0x1e')][_0x35fc('0x2b')](_0x35fc('0x2a'),'');}_0x2ecb2e[_0x2f823b[_0x33a377][_0x35fc('0x23')]]=_0x52f53d[_0x35fc('0x1e')];break;default:_0x2ecb2e[_0x2f823b[_0x33a377][_0x35fc('0x23')]]=_0x2c657d[_0x2f823b[_0x33a377]['param']];}}return _0x2ecb2e['join'](',');}function _0x210d5d(_0x36fcf9,_0x4fdc6d,_0x5c2e5c){return new Promise(function(_0x4ff202,_0x79677d){var _0x10f98b=[];if(_['isEmpty'](_0x4fdc6d))return _0x4ff202(_0x10f98b);_0x2ac6da[_0x35fc('0x2c')][_0x35fc('0x2d')]({'attributes':['id',_0x35fc('0x2e'),_0x35fc('0x2f')],'raw':!![]})['then'](function(_0x57105c){for(var _0x5bf2f4=0x0,_0x539157=0x0;_0x5bf2f4<_0x4fdc6d['length'];_0x5bf2f4++,_0x539157=0x0){var _0xb26e3f=_0x4fdc6d[_0x5bf2f4];var _0x27eabf=[];var _0x4fc5bc=[];delete _0xb26e3f['id'];if(_0xb26e3f[_0x35fc('0x2e')]!=='*,*,*,*'){_0xb26e3f[_0x35fc('0x30')]=[_0xb26e3f[_0x35fc('0x2e')]];}else{_0xb26e3f[_0x35fc('0x30')]=_0xb26e3f[_0x35fc('0x2f')]?_[_0x35fc('0x31')](_['filter'](_0x57105c,{'IntervalId':_0xb26e3f[_0x35fc('0x2f')]}),_0x35fc('0x2e')):[];}_0xb26e3f['context']=_0x36fcf9[_0x35fc('0x5')];_0xb26e3f[_0x35fc('0x9')]=_0x36fcf9[_0x35fc('0x9')];if(_0xb26e3f[_0x35fc('0x3')])_0xb26e3f['type']=_0xb26e3f[_0x35fc('0x3')]['toLowerCase']();if(_0x36fcf9['type']===_0x35fc('0x10')){if(_0xb26e3f[_0x35fc('0x19')](_0x35fc('0x32'))&&_0xb26e3f[_0x35fc('0x32')]&&_0xb26e3f[_0x35fc('0x32')]!=='--'){_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f[_0x35fc('0x3')][_0x35fc('0x33')](),'app':'Set','appdata':_0x35fc('0x34')+_0xb26e3f[_0x35fc('0x32')],'context':_0x36fcf9[_0x35fc('0x5')],'exten':_0x36fcf9[_0x35fc('0x9')],'priority':_0xb26e3f[_0x35fc('0x30')][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});}_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f[_0x35fc('0x3')][_0x35fc('0x33')](),'app':_0x35fc('0x15'),'appdata':_0x35fc('0x35')+(_0xb26e3f[_0x35fc('0x36')]?_0x35fc('0x37')+_0xb26e3f[_0x35fc('0x36')]+')':'NoOp(No\x20number\x20available)'),'context':_0x36fcf9['context'],'exten':_0x36fcf9[_0x35fc('0x9')],'priority':_0xb26e3f[_0x35fc('0x30')][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});}else{if(_0xb26e3f[_0x35fc('0x19')](_0x35fc('0x38'))){if([_0x35fc('0x39'),'playback']['includes'](_0xb26e3f[_0x35fc('0x3a')][_0x35fc('0x33')]())&&_0xb26e3f[_0x35fc('0x3b')]!==_0x35fc('0x3c')){if(_0xb26e3f['answer']){_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f[_0x35fc('0x3')]['toLowerCase'](),'app':_0x35fc('0x15'),'appdata':_0x35fc('0x3d'),'context':_0x36fcf9['context'],'exten':_0x36fcf9[_0x35fc('0x9')],'priority':_0xb26e3f[_0x35fc('0x30')][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f['type']['toLowerCase'](),'app':'Set','appdata':_0x35fc('0x3e'),'context':_0x36fcf9[_0x35fc('0x5')],'exten':_0x36fcf9['exten'],'priority':_0xb26e3f[_0x35fc('0x30')][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});}else{_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f[_0x35fc('0x3')][_0x35fc('0x33')](),'app':'ExecIf','appdata':_0x35fc('0x3f'),'context':_0x36fcf9[_0x35fc('0x5')],'exten':_0x36fcf9[_0x35fc('0x9')],'priority':_0xb26e3f['intervals'][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f['type'][_0x35fc('0x33')](),'app':_0x35fc('0x4'),'appdata':_0x35fc('0x40'),'context':_0x36fcf9[_0x35fc('0x5')],'exten':_0x36fcf9[_0x35fc('0x9')],'priority':_0xb26e3f[_0x35fc('0x30')][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});}}}}for(var _0x998fd9=0x0;_0x998fd9<_0xb26e3f['intervals'][_0x35fc('0x20')];_0x998fd9++){var _0x2c9c9a=_0x5c2e5c+_0xb26e3f[_0x35fc('0x30')]['length'];var _0x243871=_0x998fd9===_0xb26e3f['intervals']['length']-0x1?_0x5c2e5c+_0x27eabf['length']+_0x4fc5bc[_0x35fc('0x20')]+0x2:_0x5c2e5c+_0x998fd9+0x1;_0x27eabf[_0x35fc('0x41')](_0x998fd9,0x0,{'type':_0x36fcf9[_0x35fc('0x3')],'app':_0x35fc('0x42'),'appdata':_0xb26e3f[_0x35fc('0x30')][_0x998fd9]+'?'+_0x36fcf9['context']+',${EXTEN},'+_0x2c9c9a+':'+_0x36fcf9['context']+',${EXTEN},'+_0x243871,'exten':_0x36fcf9['exten'],'context':_0x36fcf9[_0x35fc('0x5')],'priority':_0x5c2e5c+_0x998fd9,'VoiceExtensionId':_0x36fcf9['id']});}if(_0xb26e3f[_0x35fc('0x3b')]===_0x35fc('0x43'))_0xb26e3f[_0x35fc('0x44')]=_0x46b9ef(_0x36fcf9,_0xb26e3f['appdata']);_0xb26e3f[_0x35fc('0x45')]=_0x27eabf[_0x35fc('0x20')]?_[_0x35fc('0x46')](_0x27eabf)[_0x35fc('0x45')]+0x1:_0x5c2e5c;_0x10f98b=_[_0x35fc('0x47')](_0x10f98b,_0x27eabf,[_0xb26e3f],_0x4fc5bc);_0x5c2e5c=_[_0x35fc('0x46')](_0x10f98b)[_0x35fc('0x45')]+0x1;}return _0x4ff202(_0x10f98b);})[_0x35fc('0x48')](function(_0x462ceb){_0x79677d(_0x462ceb);});});}return _0x253d6e['define'](_0x35fc('0x49'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xfbd737){var _0x9029e3=this[_0x35fc('0x4a')]({'plain':!![]});var _0x2bc76c=_0x9029e3['type']===_0x35fc('0x10')?_0x1121fa(_0x9029e3):_0x91d024(_0x9029e3);return _0x210d5d(_0x9029e3,_0xfbd737,_['last'](_0x2bc76c)['priority']+0x1)['then'](function(_0x10dd1a){var _0x5dfeb7=_[_0x35fc('0x47')](_0x2bc76c,_0x10dd1a);_0x5dfeb7['push']({'type':_0x9029e3[_0x35fc('0x3')],'app':'Hangup','exten':_0x9029e3[_0x35fc('0x9')],'context':_0x9029e3[_0x35fc('0x5')],'priority':_[_0x35fc('0x46')](_0x5dfeb7)[_0x35fc('0x45')]+0x1,'VoiceExtensionId':_0x9029e3['id']});return _0x5dfeb7;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 0df2c8e..1762c39 100644 --- a/server/api/voiceExtension/voiceExtension.rpc.js +++ b/server/api/voiceExtension/voiceExtension.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa23f=['VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','socket.io-emitter','./voiceExtension.socket','register','request','info'];(function(_0x163dcf,_0x4c03ae){var _0xb06a8f=function(_0x367b58){while(--_0x367b58){_0x163dcf['push'](_0x163dcf['shift']());}};_0xb06a8f(++_0x4c03ae);}(_0xa23f,0x7c));var _0xfa23=function(_0x476b9a,_0x50aab7){_0x476b9a=_0x476b9a-0x0;var _0x5eb5d8=_0xa23f[_0x476b9a];return _0x5eb5d8;};'use strict';var _=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfa23('0x2'));var fs=require('fs');var Redis=require(_0xfa23('0x3'));var db=require(_0xfa23('0x4'))['db'];var utils=require(_0xfa23('0x5'));var logger=require('../../config/logger')(_0xfa23('0x6'));var config=require('../../config/environment');var jayson=require(_0xfa23('0x7'));var client=jayson[_0xfa23('0x8')][_0xfa23('0x9')]({'port':0x232a});config[_0xfa23('0xa')]=_['defaults'](config[_0xfa23('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa23('0xb'))(new Redis(config[_0xfa23('0xa')]));require(_0xfa23('0xc'))[_0xfa23('0xd')](socket);function respondWithRpcPromise(_0x798943,_0x539453,_0x4b59d1){return new BPromise(function(_0x20a9b6,_0x4ea7a8){return client[_0xfa23('0xe')](_0x798943,_0x4b59d1)['then'](function(_0x1b99b7){logger[_0xfa23('0xf')](_0xfa23('0x10'),_0x539453,'request\x20sent');logger[_0xfa23('0x11')](_0xfa23('0x12'),_0x539453,_0xfa23('0x13'),JSON['stringify'](_0x1b99b7));if(_0x1b99b7['error']){if(_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x15')]===0x1f4){logger[_0xfa23('0x14')](_0xfa23('0x10'),_0x539453,_0x1b99b7['error'][_0xfa23('0x16')]);return _0x4ea7a8(_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x16')]);}logger[_0xfa23('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x539453,_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x16')]);return _0x20a9b6(_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x16')]);}else{logger[_0xfa23('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x539453,'request\x20sent');_0x20a9b6(_0x1b99b7['result'][_0xfa23('0x16')]);}})[_0xfa23('0x17')](function(_0x4bd0e0){logger[_0xfa23('0x14')](_0xfa23('0x10'),_0x539453,_0x4bd0e0);_0x4ea7a8(_0x4bd0e0);});});}exports[_0xfa23('0x18')]=function(_0x54bb04){var _0x1970ec=this;return new Promise(function(_0x452604,_0x47c323){return db[_0xfa23('0x19')][_0xfa23('0x1a')]({'raw':_0x54bb04[_0xfa23('0x1b')]?_0x54bb04[_0xfa23('0x1b')][_0xfa23('0x1c')]===undefined?!![]:![]:!![],'where':_0x54bb04[_0xfa23('0x1b')]?_0x54bb04[_0xfa23('0x1b')]['where']||null:null,'attributes':_0x54bb04[_0xfa23('0x1b')]?_0x54bb04[_0xfa23('0x1b')][_0xfa23('0x1d')]||null:null,'limit':_0x54bb04[_0xfa23('0x1b')]?_0x54bb04['options'][_0xfa23('0x1e')]||null:null,'include':_0x54bb04['options']?_0x54bb04[_0xfa23('0x1b')][_0xfa23('0x1f')]?_[_0xfa23('0x20')](_0x54bb04[_0xfa23('0x1b')][_0xfa23('0x1f')],function(_0x1340d9){return{'model':db[_0x1340d9[_0xfa23('0x21')]],'as':_0x1340d9['as'],'attributes':_0x1340d9[_0xfa23('0x1d')],'include':_0x1340d9['include']?_[_0xfa23('0x20')](_0x1340d9['include'],function(_0x1ae38a){return{'model':db[_0x1ae38a['model']],'as':_0x1ae38a['as'],'attributes':_0x1ae38a['attributes'],'include':_0x1ae38a[_0xfa23('0x1f')]?_[_0xfa23('0x20')](_0x1ae38a[_0xfa23('0x1f')],function(_0x3b00a8){return{'model':db[_0x3b00a8[_0xfa23('0x21')]],'as':_0x3b00a8['as'],'attributes':_0x3b00a8[_0xfa23('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfa23('0x22')](function(_0x4c1ab0){logger[_0xfa23('0xf')]('GetVoiceExtension',_0x54bb04);logger[_0xfa23('0x11')](_0xfa23('0x18'),_0x54bb04,JSON['stringify'](_0x4c1ab0));_0x452604(_0x4c1ab0);})[_0xfa23('0x17')](function(_0x3a6966){logger[_0xfa23('0x14')](_0xfa23('0x18'),_0x3a6966[_0xfa23('0x16')],_0x54bb04);_0x47c323(_0x1970ec[_0xfa23('0x14')](0x1f4,_0x3a6966[_0xfa23('0x16')]));});});}; \ No newline at end of file +var _0x38d3=['then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0xd93063,_0x49b618){var _0xf1841=function(_0x1c9b35){while(--_0x1c9b35){_0xd93063['push'](_0xd93063['shift']());}};_0xf1841(++_0x49b618);}(_0x38d3,0x1a7));var _0x338d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x38d3[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var moment=require('moment');var BPromise=require(_0x338d('0x2'));var rs=require(_0x338d('0x3'));var fs=require('fs');var Redis=require(_0x338d('0x4'));var db=require(_0x338d('0x5'))['db'];var utils=require(_0x338d('0x6'));var logger=require(_0x338d('0x7'))(_0x338d('0x8'));var config=require(_0x338d('0x9'));var jayson=require(_0x338d('0xa'));var client=jayson['client'][_0x338d('0xb')]({'port':0x232a});config[_0x338d('0xc')]=_[_0x338d('0xd')](config[_0x338d('0xc')],{'host':_0x338d('0xe'),'port':0x18eb});var socket=require(_0x338d('0xf'))(new Redis(config[_0x338d('0xc')]));require('./voiceExtension.socket')[_0x338d('0x10')](socket);function respondWithRpcPromise(_0x46b524,_0x3c9b82,_0x4733ad){return new BPromise(function(_0x111c22,_0x3d7647){return client['request'](_0x46b524,_0x4733ad)[_0x338d('0x11')](function(_0x261217){logger[_0x338d('0x12')](_0x338d('0x13'),_0x3c9b82,_0x338d('0x14'));logger[_0x338d('0x15')](_0x338d('0x16'),_0x3c9b82,_0x338d('0x14'),JSON['stringify'](_0x261217));if(_0x261217['error']){if(_0x261217['error'][_0x338d('0x17')]===0x1f4){logger[_0x338d('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x3c9b82,_0x261217[_0x338d('0x18')]['message']);return _0x3d7647(_0x261217[_0x338d('0x18')][_0x338d('0x19')]);}logger[_0x338d('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x3c9b82,_0x261217['error']['message']);return _0x111c22(_0x261217[_0x338d('0x18')]['message']);}else{logger[_0x338d('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x3c9b82,'request\x20sent');_0x111c22(_0x261217[_0x338d('0x1a')][_0x338d('0x19')]);}})[_0x338d('0x1b')](function(_0x2c1e24){logger[_0x338d('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x3c9b82,_0x2c1e24);_0x3d7647(_0x2c1e24);});});}exports[_0x338d('0x1c')]=function(_0x27527d){var _0x4698b8=this;return new Promise(function(_0x51d50f,_0x4213b0){return db[_0x338d('0x1d')][_0x338d('0x1e')]({'raw':_0x27527d[_0x338d('0x1f')]?_0x27527d[_0x338d('0x1f')][_0x338d('0x20')]===undefined?!![]:![]:!![],'where':_0x27527d[_0x338d('0x1f')]?_0x27527d[_0x338d('0x1f')][_0x338d('0x21')]||null:null,'attributes':_0x27527d[_0x338d('0x1f')]?_0x27527d[_0x338d('0x1f')][_0x338d('0x22')]||null:null,'limit':_0x27527d['options']?_0x27527d[_0x338d('0x1f')][_0x338d('0x23')]||null:null,'include':_0x27527d[_0x338d('0x1f')]?_0x27527d['options']['include']?_['map'](_0x27527d['options'][_0x338d('0x24')],function(_0x1fb38f){return{'model':db[_0x1fb38f[_0x338d('0x25')]],'as':_0x1fb38f['as'],'attributes':_0x1fb38f[_0x338d('0x22')],'include':_0x1fb38f[_0x338d('0x24')]?_[_0x338d('0x26')](_0x1fb38f[_0x338d('0x24')],function(_0x2e50ec){return{'model':db[_0x2e50ec[_0x338d('0x25')]],'as':_0x2e50ec['as'],'attributes':_0x2e50ec[_0x338d('0x22')],'include':_0x2e50ec['include']?_[_0x338d('0x26')](_0x2e50ec[_0x338d('0x24')],function(_0x6e99c4){return{'model':db[_0x6e99c4['model']],'as':_0x6e99c4['as'],'attributes':_0x6e99c4[_0x338d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x338d('0x11')](function(_0x4bb176){logger[_0x338d('0x12')]('GetVoiceExtension',_0x27527d);logger[_0x338d('0x15')](_0x338d('0x1c'),_0x27527d,JSON[_0x338d('0x27')](_0x4bb176));_0x51d50f(_0x4bb176);})[_0x338d('0x1b')](function(_0x3055a7){logger[_0x338d('0x18')]('GetVoiceExtension',_0x3055a7[_0x338d('0x19')],_0x27527d);_0x4213b0(_0x4698b8[_0x338d('0x18')](0x1f4,_0x3055a7['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 49d8a55..04334a4 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x94ba5b,_0x3fa01a){var _0x563bcc=function(_0x12b074){while(--_0x12b074){_0x94ba5b['push'](_0x94ba5b['shift']());}};_0x563bcc(++_0x3fa01a);}(_0x326f,0xd1));var _0xf326=function(_0x30716b,_0xff2dc9){_0x30716b=_0x30716b-0x0;var _0x7742cf=_0x326f[_0x30716b];return _0x7742cf;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x586d68,_0x25fc92){_0x586d68=_0x586d68-0x0;var _0x2d66f4=_0x1cb9[_0x586d68];return _0x2d66f4;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index dd87a04..93f1609 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdbd=['get','getMessages','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','isAuthenticated','index','show'];(function(_0x287c3f,_0x1ac285){var _0x2d14b5=function(_0x412186){while(--_0x412186){_0x287c3f['push'](_0x287c3f['shift']());}};_0x2d14b5(++_0x1ac285);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0xfdbd[_0x1895b7];return _0x1aecdc;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get']('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id/messages',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')]('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x10')]);router[_0xdfdb('0x11')](_0xdfdb('0x12'),auth['isAuthenticated'](),controller[_0xdfdb('0x13')]);router[_0xdfdb('0x14')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x15')]);module[_0xdfdb('0x16')]=router; \ No newline at end of file +var _0xb016=['get','isAuthenticated','index','show','getMessages','post','create','update','delete','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x68c4d9,_0x419b3c){var _0x62da93=function(_0x51ae9a){while(--_0x51ae9a){_0x68c4d9['push'](_0x68c4d9['shift']());}};_0x62da93(++_0x419b3c);}(_0xb016,0x159));var _0x6b01=function(_0x14492d,_0x20ef09){_0x14492d=_0x14492d-0x0;var _0x511683=_0xb016[_0x14492d];return _0x511683;};'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 fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./voiceMail.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id/messages',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0xc')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0xd')]);router['put']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router[_0x6b01('0xf')]('/:id',auth[_0x6b01('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index af62c52..b88d02f 100644 --- a/server/api/voiceMail/voiceMail.attributes.js +++ b/server/api/voiceMail/voiceMail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90df=['central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x90df,0x102));var _0xf90d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90df[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf90d('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf90d('0x1')],'defaultValue':_0xf90d('0x2'),'unique':_0xf90d('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xf90d('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf90d('0x1')],'validate':{'isEmail':!![]},'set':function(_0x57eb2d){this[_0xf90d('0x4')](_0xf90d('0x5'),typeof _0x57eb2d===_0xf90d('0x6')&&_0x57eb2d[_0xf90d('0x7')]()?_0x57eb2d[_0xf90d('0x7')]():null);}},'pager':{'type':Sequelize[_0xf90d('0x1')]},'tz':{'type':Sequelize[_0xf90d('0x1')],'defaultValue':_0xf90d('0x8')},'attach':{'type':Sequelize['ENUM'](_0xf90d('0x9'),'no'),'defaultValue':_0xf90d('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xf90d('0xa')](_0xf90d('0x9'),'no'),'defaultValue':_0xf90d('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xf90d('0x1')]},'callback':{'type':Sequelize[_0xf90d('0x1')]},'review':{'type':Sequelize[_0xf90d('0xa')](_0xf90d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf90d('0xa')](_0xf90d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf90d('0xa')](_0xf90d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf90d('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf90d('0xa')](_0xf90d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf90d('0xa')](_0xf90d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xf90d('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xf90d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xf90d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf90d('0xa')]('yes','no'),'defaultValue':_0xf90d('0x9'),'allowNull':![]},'stamp':{'type':_0xf90d('0xc')},'emailsubject':{'type':Sequelize[_0xf90d('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf90d('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf90d('0xe')],'get':function(){return this[_0xf90d('0xf')](_0xf90d('0x10'))+_0xf90d('0x11')+this['getDataValue'](_0xf90d('0x12'));}}}; \ No newline at end of file +var _0xbab3=['exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','getDataValue','fullname','\x20-\x20','mailbox','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbab3,0x10f));var _0x3bab=function(_0x18959e,_0x24e830){_0x18959e=_0x18959e-0x0;var _0x308aba=_0xbab3[_0x18959e];return _0x308aba;};'use strict';var Sequelize=require(_0x3bab('0x0'));module[_0x3bab('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x3bab('0x2'),'unique':_0x3bab('0x3')},'mailbox':{'type':Sequelize[_0x3bab('0x4')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x3bab('0x4')]},'fullname':{'type':Sequelize[_0x3bab('0x4')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x19d92){this[_0x3bab('0x5')](_0x3bab('0x6'),typeof _0x19d92===_0x3bab('0x7')&&_0x19d92['trim']()?_0x19d92[_0x3bab('0x8')]():null);}},'pager':{'type':Sequelize[_0x3bab('0x4')]},'tz':{'type':Sequelize[_0x3bab('0x4')],'defaultValue':_0x3bab('0x9')},'attach':{'type':Sequelize[_0x3bab('0xa')]('yes','no'),'defaultValue':_0x3bab('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3bab('0xa')]('yes','no'),'defaultValue':_0x3bab('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3bab('0x4')]},'callback':{'type':Sequelize[_0x3bab('0x4')]},'review':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x3bab('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3bab('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3bab('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':_0x3bab('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3bab('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':_0x3bab('0xb'),'allowNull':![]},'stamp':{'type':_0x3bab('0xc')},'emailsubject':{'type':Sequelize[_0x3bab('0x4')]},'emailbody':{'type':Sequelize[_0x3bab('0x4')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3bab('0xd')](_0x3bab('0xe'))+_0x3bab('0xf')+this['getDataValue'](_0x3bab('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 68a847c..8226bb3 100644 --- a/server/api/voiceMail/voiceMail.controller.js +++ b/server/api/voiceMail/voiceMail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63a5=['index','map','VoiceMail','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','getMessages','VoiceMailMessage','sort','pick','mailbox','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send'];(function(_0x1a64ee,_0x2a8eb6){var _0xb46048=function(_0x42886e){while(--_0x42886e){_0x1a64ee['push'](_0x1a64ee['shift']());}};_0xb46048(++_0x2a8eb6);}(_0x63a5,0x18e));var _0x563a=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x63a5[_0x36ed3c];return _0x52a2e0;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61d5b2,_0x214f42){_0x214f42=_0x214f42||0xcc;return function(_0x10de2e){if(_0x10de2e){return _0x61d5b2[_0x563a('0x19')](_0x214f42);}return _0x61d5b2[_0x563a('0x1a')](_0x214f42)[_0x563a('0x1b')]();};}function respondWithResult(_0x50396b,_0x2cf052){_0x2cf052=_0x2cf052||0xc8;return function(_0x3045ac){if(_0x3045ac){return _0x50396b[_0x563a('0x1a')](_0x2cf052)[_0x563a('0x1c')](_0x3045ac);}};}function respondWithFilteredResult(_0x5a2980,_0x504cb7){return function(_0x414535){if(_0x414535){var _0x2ad667=typeof _0x504cb7['offset']===_0x563a('0x1d')&&typeof _0x504cb7[_0x563a('0x1e')]===_0x563a('0x1d');var _0x9c2f77=_0x414535['count'];var _0x598693=_0x2ad667?0x0:_0x504cb7[_0x563a('0x1f')];var _0x422aaf=_0x2ad667?_0x414535[_0x563a('0x20')]:_0x504cb7['offset']+_0x504cb7['limit'];var _0x52b99a;if(_0x422aaf>=_0x9c2f77){_0x422aaf=_0x9c2f77;_0x52b99a=0xc8;}else{_0x52b99a=0xce;}_0x5a2980['status'](_0x52b99a);return _0x5a2980[_0x563a('0x21')](_0x563a('0x22'),_0x598693+'-'+_0x422aaf+'/'+_0x9c2f77)[_0x563a('0x1c')](_0x414535);}return null;};}function patchUpdates(_0x43b7a8){return function(_0x562fce){try{jsonpatch['apply'](_0x562fce,_0x43b7a8,!![]);}catch(_0x3930f0){return BPromise[_0x563a('0x23')](_0x3930f0);}return _0x562fce[_0x563a('0x24')]();};}function saveUpdates(_0x2beccb,_0x1bf502){return function(_0x2dc7e2){if(_0x2dc7e2){return _0x2dc7e2[_0x563a('0x25')](_0x2beccb)[_0x563a('0x26')](function(_0x506491){return _0x506491;});}return null;};}function removeEntity(_0xd59ba8,_0x5422f6){return function(_0x44e2c1){if(_0x44e2c1){return _0x44e2c1[_0x563a('0x27')]()[_0x563a('0x26')](function(){var _0x1250e6=_0x44e2c1[_0x563a('0x28')]({'plain':!![]});var _0x1682ee=_0x563a('0x29');return db[_0x563a('0x2a')]['destroy']({'where':{'type':_0x1682ee,'resourceId':_0x1250e6['id']}})[_0x563a('0x26')](function(){return _0x44e2c1;});})[_0x563a('0x26')](function(){_0xd59ba8[_0x563a('0x1a')](0xcc)[_0x563a('0x1b')]();});}};}function handleEntityNotFound(_0xce8165,_0x1898f9){return function(_0x1afdff){if(!_0x1afdff){_0xce8165[_0x563a('0x19')](0x194);}return _0x1afdff;};}function handleError(_0x249db8,_0x8f3429){_0x8f3429=_0x8f3429||0x1f4;return function(_0x1a69d5){logger[_0x563a('0x2b')](_0x1a69d5[_0x563a('0x2c')]);if(_0x1a69d5[_0x563a('0x2d')]){delete _0x1a69d5['name'];}_0x249db8[_0x563a('0x1a')](_0x8f3429)[_0x563a('0x2e')](_0x1a69d5);};}exports[_0x563a('0x2f')]=function(_0x4aaa3d,_0x1e8d43){var _0x2e5c4b={},_0x3a59cb={},_0x28a8f6={'count':0x0,'rows':[]};var _0x166f89=_[_0x563a('0x30')](db[_0x563a('0x31')]['rawAttributes'],function(_0x2418ae){return{'name':_0x2418ae[_0x563a('0x32')],'type':_0x2418ae[_0x563a('0x33')][_0x563a('0x34')]};});_0x3a59cb[_0x563a('0x35')]=_['map'](_0x166f89,'name');_0x3a59cb['query']=_['keys'](_0x4aaa3d[_0x563a('0x36')]);_0x3a59cb[_0x563a('0x37')]=_[_0x563a('0x38')](_0x3a59cb[_0x563a('0x35')],_0x3a59cb[_0x563a('0x36')]);_0x2e5c4b[_0x563a('0x39')]=_['intersection'](_0x3a59cb['model'],qs[_0x563a('0x3a')](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x3a')]));_0x2e5c4b[_0x563a('0x39')]=_0x2e5c4b[_0x563a('0x39')][_0x563a('0x3b')]?_0x2e5c4b[_0x563a('0x39')]:_0x3a59cb[_0x563a('0x35')];if(!_0x4aaa3d[_0x563a('0x36')][_0x563a('0x3c')](_0x563a('0x3d'))){_0x2e5c4b[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x1e')]);_0x2e5c4b[_0x563a('0x1f')]=qs['offset'](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x1f')]);}_0x2e5c4b[_0x563a('0x3e')]=qs['sort'](_0x4aaa3d[_0x563a('0x36')]['sort']);_0x2e5c4b[_0x563a('0x3f')]=qs[_0x563a('0x37')](_['pick'](_0x4aaa3d['query'],_0x3a59cb[_0x563a('0x37')]),_0x166f89);if(_0x4aaa3d['query'][_0x563a('0x40')]){_0x2e5c4b[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x2e5c4b[_0x563a('0x3f')],{'$or':_['map'](_0x166f89,function(_0x47d37a){if(_0x47d37a[_0x563a('0x33')]!=='VIRTUAL'){var _0x46d471={};_0x46d471[_0x47d37a[_0x563a('0x2d')]]={'$like':'%'+_0x4aaa3d[_0x563a('0x36')][_0x563a('0x40')]+'%'};return _0x46d471;}})});}_0x2e5c4b=_[_0x563a('0x41')]({},_0x2e5c4b,_0x4aaa3d[_0x563a('0x42')]);var _0x4bf555={'where':_0x2e5c4b[_0x563a('0x3f')]};return db['VoiceMail'][_0x563a('0x20')](_0x4bf555)['then'](function(_0x20c142){_0x28a8f6[_0x563a('0x20')]=_0x20c142;if(_0x4aaa3d[_0x563a('0x36')][_0x563a('0x43')]){_0x2e5c4b['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x2e5c4b);})[_0x563a('0x26')](function(_0x1255da){_0x28a8f6[_0x563a('0x44')]=_0x1255da;return _0x28a8f6;})[_0x563a('0x26')](respondWithFilteredResult(_0x1e8d43,_0x2e5c4b))[_0x563a('0x45')](handleError(_0x1e8d43,null));};exports[_0x563a('0x46')]=function(_0x29a1c0,_0x2ca0f4){var _0x19c2cc={'raw':!![],'where':{'id':_0x29a1c0[_0x563a('0x47')]['id']}},_0x433353={};_0x433353[_0x563a('0x35')]=_[_0x563a('0x48')](db[_0x563a('0x31')][_0x563a('0x49')]);_0x433353[_0x563a('0x36')]=_[_0x563a('0x48')](_0x29a1c0[_0x563a('0x36')]);_0x433353[_0x563a('0x37')]=_['intersection'](_0x433353['model'],_0x433353[_0x563a('0x36')]);_0x19c2cc[_0x563a('0x39')]=_[_0x563a('0x38')](_0x433353[_0x563a('0x35')],qs[_0x563a('0x3a')](_0x29a1c0[_0x563a('0x36')][_0x563a('0x3a')]));_0x19c2cc[_0x563a('0x39')]=_0x19c2cc['attributes']['length']?_0x19c2cc[_0x563a('0x39')]:_0x433353[_0x563a('0x35')];if(_0x29a1c0[_0x563a('0x36')][_0x563a('0x43')]){_0x19c2cc[_0x563a('0x4a')]=[{'all':!![]}];}_0x19c2cc=_[_0x563a('0x41')]({},_0x19c2cc,_0x29a1c0[_0x563a('0x42')]);return db[_0x563a('0x31')]['find'](_0x19c2cc)[_0x563a('0x26')](handleEntityNotFound(_0x2ca0f4,null))[_0x563a('0x26')](respondWithResult(_0x2ca0f4,null))['catch'](handleError(_0x2ca0f4,null));};exports[_0x563a('0x4b')]=function(_0x5a063a,_0x3ea787){return db[_0x563a('0x31')][_0x563a('0x4b')](_0x5a063a['body'],{})[_0x563a('0x26')](function(_0x23efcf){var _0xb1dbc8=_0x5a063a[_0x563a('0x4c')][_0x563a('0x28')]({'plain':!![]});if(!_0xb1dbc8)throw new Error(_0x563a('0x4d'));if(_0xb1dbc8[_0x563a('0x4e')]===_0x563a('0x4c')){var _0x277d54=_0x23efcf[_0x563a('0x28')]({'plain':!![]});var _0x3c98d5=_0x563a('0x29');return db[_0x563a('0x4f')]['find']({'where':{'name':_0x3c98d5,'userProfileId':_0xb1dbc8['userProfileId']},'raw':!![]})[_0x563a('0x26')](function(_0xaae9fd){if(_0xaae9fd&&_0xaae9fd[_0x563a('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x277d54[_0x563a('0x2d')],'resourceId':_0x277d54['id'],'type':_0xaae9fd[_0x563a('0x2d')],'sectionId':_0xaae9fd['id']},{})['then'](function(){return _0x23efcf;});}else{return _0x23efcf;}})['catch'](function(_0x51e142){logger[_0x563a('0x2b')](_0x563a('0x51'),_0x51e142);throw _0x51e142;});}return _0x23efcf;})[_0x563a('0x26')](respondWithResult(_0x3ea787,0xc9))[_0x563a('0x45')](handleError(_0x3ea787,null));};exports[_0x563a('0x25')]=function(_0x2805eb,_0x4dd257){if(_0x2805eb['body']['id']){delete _0x2805eb[_0x563a('0x52')]['id'];}return db['VoiceMail'][_0x563a('0x53')]({'where':{'id':_0x2805eb[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x4dd257,null))[_0x563a('0x26')](saveUpdates(_0x2805eb[_0x563a('0x52')],null))[_0x563a('0x26')](respondWithResult(_0x4dd257,null))[_0x563a('0x45')](handleError(_0x4dd257,null));};exports['destroy']=function(_0x22cc91,_0x227372){return db['VoiceMail'][_0x563a('0x53')]({'where':{'id':_0x22cc91[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x227372,null))[_0x563a('0x26')](removeEntity(_0x227372,null))[_0x563a('0x45')](handleError(_0x227372,null));};exports[_0x563a('0x54')]=function(_0x16aa03,_0x3919a3,_0x1e275c){return db[_0x563a('0x31')]['findOne']({'where':{'id':_0x16aa03[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x3919a3,null))['then'](function(_0x503896){var _0x402bdd;var _0x709bfd={},_0x579d61={};_0x579d61[_0x563a('0x35')]=_['keys'](db[_0x563a('0x55')][_0x563a('0x49')]);_0x579d61[_0x563a('0x36')]=_[_0x563a('0x48')](_0x16aa03[_0x563a('0x36')]);_0x579d61['filters']=_['intersection'](_0x579d61['model'],_0x579d61['query']);_0x709bfd[_0x563a('0x39')]=_['intersection'](_0x579d61[_0x563a('0x35')],qs['fields'](_0x16aa03[_0x563a('0x36')][_0x563a('0x3a')]));_0x709bfd[_0x563a('0x39')]=_0x709bfd[_0x563a('0x39')][_0x563a('0x3b')]?_0x709bfd['attributes']:_0x579d61[_0x563a('0x35')];if(!_0x16aa03['query']['hasOwnProperty'](_0x563a('0x3d'))){_0x709bfd[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x16aa03[_0x563a('0x36')][_0x563a('0x1e')]);_0x709bfd['offset']=qs[_0x563a('0x1f')](_0x16aa03[_0x563a('0x36')][_0x563a('0x1f')]);}_0x709bfd[_0x563a('0x3e')]=qs[_0x563a('0x56')](_0x16aa03['query'][_0x563a('0x56')]);_0x709bfd['where']=qs[_0x563a('0x37')](_[_0x563a('0x57')](_0x16aa03['query'],_0x579d61[_0x563a('0x37')]));if(_0x16aa03[_0x563a('0x36')][_0x563a('0x40')]){_0x709bfd[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x709bfd[_0x563a('0x3f')],{'$or':_[_0x563a('0x30')](_0x709bfd[_0x563a('0x39')],function(_0x4cfa73){var _0x103c59={};_0x103c59[_0x4cfa73]={'$like':'%'+_0x16aa03[_0x563a('0x36')][_0x563a('0x40')]+'%'};return _0x103c59;})});}_0x709bfd[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x709bfd[_0x563a('0x3f')],{'mailboxuser':_0x503896[_0x563a('0x58')]});_0x709bfd=_['merge']({},_0x709bfd,_0x16aa03[_0x563a('0x42')]);return db['VoiceMailMessage']['findAndCountAll'](_0x709bfd)['then'](respondWithFilteredResult(_0x3919a3,_0x709bfd));})[_0x563a('0x45')](handleError(_0x3919a3,null));}; \ No newline at end of file +var _0xeffd=['create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','nolimit','order','pick','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','update','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','type','merge','count','includeAll','include','findAll','catch','show','params','rawAttributes','options','find'];(function(_0x5cf217,_0x5bbb33){var _0x8835bc=function(_0x37043d){while(--_0x37043d){_0x5cf217['push'](_0x5cf217['shift']());}};_0x8835bc(++_0x5bbb33);}(_0xeffd,0x6b));var _0xdeff=function(_0x4fee9a,_0x2883f3){_0x4fee9a=_0x4fee9a-0x0;var _0x23ec7b=_0xeffd[_0x4fee9a];return _0x23ec7b;};'use strict';var emlformat=require(_0xdeff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeff('0x1'));var jsonpatch=require(_0xdeff('0x2'));var rp=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var BPromise=require(_0xdeff('0x5'));var Mustache=require(_0xdeff('0x6'));var util=require(_0xdeff('0x7'));var path=require(_0xdeff('0x8'));var sox=require(_0xdeff('0x9'));var csv=require(_0xdeff('0xa'));var ejs=require(_0xdeff('0xb'));var fs=require('fs');var fs_extra=require(_0xdeff('0xc'));var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var Redis=require(_0xdeff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdeff('0x15'));var as=require(_0xdeff('0x16'));var hardwareService=require(_0xdeff('0x17'));var logger=require(_0xdeff('0x18'))(_0xdeff('0x19'));var utils=require(_0xdeff('0x1a'));var config=require(_0xdeff('0x1b'));var licenseUtil=require(_0xdeff('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461699,_0x116bf9){_0x116bf9=_0x116bf9||0xcc;return function(_0x4952f2){if(_0x4952f2){return _0x461699[_0xdeff('0x1d')](_0x116bf9);}return _0x461699['status'](_0x116bf9)['end']();};}function respondWithResult(_0x3e56a1,_0x47410f){_0x47410f=_0x47410f||0xc8;return function(_0x1585e8){if(_0x1585e8){return _0x3e56a1[_0xdeff('0x1e')](_0x47410f)['json'](_0x1585e8);}};}function respondWithFilteredResult(_0x826132,_0x314ded){return function(_0xea6c4){if(_0xea6c4){var _0x391633=typeof _0x314ded[_0xdeff('0x1f')]===_0xdeff('0x20')&&typeof _0x314ded['limit']==='undefined';var _0x7440af=_0xea6c4['count'];var _0x5c9837=_0x391633?0x0:_0x314ded[_0xdeff('0x1f')];var _0x369e13=_0x391633?_0xea6c4['count']:_0x314ded[_0xdeff('0x1f')]+_0x314ded[_0xdeff('0x21')];var _0x1ab1fa;if(_0x369e13>=_0x7440af){_0x369e13=_0x7440af;_0x1ab1fa=0xc8;}else{_0x1ab1fa=0xce;}_0x826132[_0xdeff('0x1e')](_0x1ab1fa);return _0x826132[_0xdeff('0x22')](_0xdeff('0x23'),_0x5c9837+'-'+_0x369e13+'/'+_0x7440af)[_0xdeff('0x24')](_0xea6c4);}return null;};}function patchUpdates(_0x919c93){return function(_0x488faa){try{jsonpatch['apply'](_0x488faa,_0x919c93,!![]);}catch(_0x56cb84){return BPromise[_0xdeff('0x25')](_0x56cb84);}return _0x488faa['save']();};}function saveUpdates(_0x189627,_0x91c0b4){return function(_0x543653){if(_0x543653){return _0x543653[_0xdeff('0x26')](_0x189627)[_0xdeff('0x27')](function(_0x4eb2a8){return _0x4eb2a8;});}return null;};}function removeEntity(_0x5dbe96,_0x3b2554){return function(_0x15c425){if(_0x15c425){return _0x15c425[_0xdeff('0x28')]()[_0xdeff('0x27')](function(){var _0x32add9=_0x15c425['get']({'plain':!![]});var _0xb08f19=_0xdeff('0x29');return db[_0xdeff('0x2a')][_0xdeff('0x28')]({'where':{'type':_0xb08f19,'resourceId':_0x32add9['id']}})[_0xdeff('0x27')](function(){return _0x15c425;});})[_0xdeff('0x27')](function(){_0x5dbe96[_0xdeff('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31bb72,_0x1a546c){return function(_0x53b168){if(!_0x53b168){_0x31bb72['sendStatus'](0x194);}return _0x53b168;};}function handleError(_0x830be4,_0x2ea8e9){_0x2ea8e9=_0x2ea8e9||0x1f4;return function(_0x16b2d0){logger[_0xdeff('0x2b')](_0x16b2d0[_0xdeff('0x2c')]);if(_0x16b2d0[_0xdeff('0x2d')]){delete _0x16b2d0[_0xdeff('0x2d')];}_0x830be4['status'](_0x2ea8e9)[_0xdeff('0x2e')](_0x16b2d0);};}exports[_0xdeff('0x2f')]=function(_0x34e258,_0x5045b8){var _0x59f7a0={},_0x346743={},_0x505e3f={'count':0x0,'rows':[]};var _0x69842a=_[_0xdeff('0x30')](db[_0xdeff('0x31')]['rawAttributes'],function(_0x189a51){return{'name':_0x189a51['fieldName'],'type':_0x189a51['type'][_0xdeff('0x32')]};});_0x346743[_0xdeff('0x33')]=_[_0xdeff('0x30')](_0x69842a,_0xdeff('0x2d'));_0x346743['query']=_[_0xdeff('0x34')](_0x34e258[_0xdeff('0x35')]);_0x346743[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x346743[_0xdeff('0x33')],_0x346743[_0xdeff('0x35')]);_0x59f7a0[_0xdeff('0x38')]=_['intersection'](_0x346743[_0xdeff('0x33')],qs['fields'](_0x34e258[_0xdeff('0x35')][_0xdeff('0x39')]));_0x59f7a0[_0xdeff('0x38')]=_0x59f7a0[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x59f7a0[_0xdeff('0x38')]:_0x346743['model'];if(!_0x34e258[_0xdeff('0x35')][_0xdeff('0x3b')]('nolimit')){_0x59f7a0[_0xdeff('0x21')]=qs[_0xdeff('0x21')](_0x34e258[_0xdeff('0x35')][_0xdeff('0x21')]);_0x59f7a0[_0xdeff('0x1f')]=qs[_0xdeff('0x1f')](_0x34e258[_0xdeff('0x35')][_0xdeff('0x1f')]);}_0x59f7a0['order']=qs[_0xdeff('0x3c')](_0x34e258['query'][_0xdeff('0x3c')]);_0x59f7a0[_0xdeff('0x3d')]=qs[_0xdeff('0x36')](_['pick'](_0x34e258[_0xdeff('0x35')],_0x346743[_0xdeff('0x36')]),_0x69842a);if(_0x34e258[_0xdeff('0x35')][_0xdeff('0x3e')]){_0x59f7a0[_0xdeff('0x3d')]=_['merge'](_0x59f7a0[_0xdeff('0x3d')],{'$or':_['map'](_0x69842a,function(_0x393d75){if(_0x393d75[_0xdeff('0x3f')]!=='VIRTUAL'){var _0x30609b={};_0x30609b[_0x393d75[_0xdeff('0x2d')]]={'$like':'%'+_0x34e258[_0xdeff('0x35')][_0xdeff('0x3e')]+'%'};return _0x30609b;}})});}_0x59f7a0=_[_0xdeff('0x40')]({},_0x59f7a0,_0x34e258['options']);var _0x3d8a33={'where':_0x59f7a0[_0xdeff('0x3d')]};return db[_0xdeff('0x31')][_0xdeff('0x41')](_0x3d8a33)[_0xdeff('0x27')](function(_0x5dfbb3){_0x505e3f['count']=_0x5dfbb3;if(_0x34e258[_0xdeff('0x35')][_0xdeff('0x42')]){_0x59f7a0[_0xdeff('0x43')]=[{'all':!![]}];}return db[_0xdeff('0x31')][_0xdeff('0x44')](_0x59f7a0);})[_0xdeff('0x27')](function(_0x2cd68a){_0x505e3f['rows']=_0x2cd68a;return _0x505e3f;})[_0xdeff('0x27')](respondWithFilteredResult(_0x5045b8,_0x59f7a0))[_0xdeff('0x45')](handleError(_0x5045b8,null));};exports[_0xdeff('0x46')]=function(_0x54fa5b,_0x1c3532){var _0x2c5eee={'raw':!![],'where':{'id':_0x54fa5b[_0xdeff('0x47')]['id']}},_0x14dc7b={};_0x14dc7b['model']=_[_0xdeff('0x34')](db[_0xdeff('0x31')][_0xdeff('0x48')]);_0x14dc7b[_0xdeff('0x35')]=_[_0xdeff('0x34')](_0x54fa5b[_0xdeff('0x35')]);_0x14dc7b[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x14dc7b['model'],_0x14dc7b[_0xdeff('0x35')]);_0x2c5eee[_0xdeff('0x38')]=_[_0xdeff('0x37')](_0x14dc7b[_0xdeff('0x33')],qs[_0xdeff('0x39')](_0x54fa5b['query'][_0xdeff('0x39')]));_0x2c5eee[_0xdeff('0x38')]=_0x2c5eee[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x2c5eee[_0xdeff('0x38')]:_0x14dc7b['model'];if(_0x54fa5b[_0xdeff('0x35')]['includeAll']){_0x2c5eee[_0xdeff('0x43')]=[{'all':!![]}];}_0x2c5eee=_[_0xdeff('0x40')]({},_0x2c5eee,_0x54fa5b[_0xdeff('0x49')]);return db[_0xdeff('0x31')][_0xdeff('0x4a')](_0x2c5eee)[_0xdeff('0x27')](handleEntityNotFound(_0x1c3532,null))['then'](respondWithResult(_0x1c3532,null))['catch'](handleError(_0x1c3532,null));};exports[_0xdeff('0x4b')]=function(_0xf91a72,_0x3dc206){return db['VoiceMail']['create'](_0xf91a72[_0xdeff('0x4c')],{})[_0xdeff('0x27')](function(_0x497d9f){var _0x23f17d=_0xf91a72[_0xdeff('0x4d')][_0xdeff('0x4e')]({'plain':!![]});if(!_0x23f17d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23f17d[_0xdeff('0x4f')]===_0xdeff('0x4d')){var _0x1ca376=_0x497d9f['get']({'plain':!![]});var _0xce8379=_0xdeff('0x29');return db[_0xdeff('0x50')][_0xdeff('0x4a')]({'where':{'name':_0xce8379,'userProfileId':_0x23f17d[_0xdeff('0x51')]},'raw':!![]})[_0xdeff('0x27')](function(_0x2c7fa4){if(_0x2c7fa4&&_0x2c7fa4['autoAssociation']===0x0){return db[_0xdeff('0x2a')][_0xdeff('0x4b')]({'name':_0x1ca376['name'],'resourceId':_0x1ca376['id'],'type':_0x2c7fa4[_0xdeff('0x2d')],'sectionId':_0x2c7fa4['id']},{})[_0xdeff('0x27')](function(){return _0x497d9f;});}else{return _0x497d9f;}})[_0xdeff('0x45')](function(_0x33482b){logger[_0xdeff('0x2b')](_0xdeff('0x52'),_0x33482b);throw _0x33482b;});}return _0x497d9f;})[_0xdeff('0x27')](respondWithResult(_0x3dc206,0xc9))[_0xdeff('0x45')](handleError(_0x3dc206,null));};exports['update']=function(_0x1b7eb3,_0x3a518d){if(_0x1b7eb3[_0xdeff('0x4c')]['id']){delete _0x1b7eb3['body']['id'];}return db['VoiceMail'][_0xdeff('0x4a')]({'where':{'id':_0x1b7eb3[_0xdeff('0x47')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x3a518d,null))[_0xdeff('0x27')](saveUpdates(_0x1b7eb3[_0xdeff('0x4c')],null))[_0xdeff('0x27')](respondWithResult(_0x3a518d,null))['catch'](handleError(_0x3a518d,null));};exports['destroy']=function(_0x38338b,_0x1cc2c1){return db['VoiceMail']['find']({'where':{'id':_0x38338b[_0xdeff('0x47')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x1cc2c1,null))['then'](removeEntity(_0x1cc2c1,null))[_0xdeff('0x45')](handleError(_0x1cc2c1,null));};exports[_0xdeff('0x53')]=function(_0x577fa8,_0x14fa7f,_0xe731d8){return db['VoiceMail'][_0xdeff('0x54')]({'where':{'id':_0x577fa8[_0xdeff('0x47')]['id']}})['then'](handleEntityNotFound(_0x14fa7f,null))[_0xdeff('0x27')](function(_0x152187){var _0x2a83ac;var _0x592ea6={},_0x47e86d={};_0x47e86d[_0xdeff('0x33')]=_['keys'](db[_0xdeff('0x55')][_0xdeff('0x48')]);_0x47e86d[_0xdeff('0x35')]=_[_0xdeff('0x34')](_0x577fa8[_0xdeff('0x35')]);_0x47e86d['filters']=_['intersection'](_0x47e86d[_0xdeff('0x33')],_0x47e86d[_0xdeff('0x35')]);_0x592ea6[_0xdeff('0x38')]=_[_0xdeff('0x37')](_0x47e86d[_0xdeff('0x33')],qs[_0xdeff('0x39')](_0x577fa8['query'][_0xdeff('0x39')]));_0x592ea6['attributes']=_0x592ea6[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x592ea6[_0xdeff('0x38')]:_0x47e86d[_0xdeff('0x33')];if(!_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3b')](_0xdeff('0x56'))){_0x592ea6[_0xdeff('0x21')]=qs[_0xdeff('0x21')](_0x577fa8['query'][_0xdeff('0x21')]);_0x592ea6['offset']=qs[_0xdeff('0x1f')](_0x577fa8[_0xdeff('0x35')]['offset']);}_0x592ea6[_0xdeff('0x57')]=qs['sort'](_0x577fa8[_0xdeff('0x35')]['sort']);_0x592ea6['where']=qs[_0xdeff('0x36')](_[_0xdeff('0x58')](_0x577fa8['query'],_0x47e86d[_0xdeff('0x36')]));if(_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3e')]){_0x592ea6[_0xdeff('0x3d')]=_[_0xdeff('0x40')](_0x592ea6[_0xdeff('0x3d')],{'$or':_[_0xdeff('0x30')](_0x592ea6[_0xdeff('0x38')],function(_0x46046a){var _0x517ca7={};_0x517ca7[_0x46046a]={'$like':'%'+_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3e')]+'%'};return _0x517ca7;})});}_0x592ea6['where']=_['merge'](_0x592ea6[_0xdeff('0x3d')],{'mailboxuser':_0x152187[_0xdeff('0x59')]});_0x592ea6=_['merge']({},_0x592ea6,_0x577fa8[_0xdeff('0x49')]);return db[_0xdeff('0x55')][_0xdeff('0x5a')](_0x592ea6)[_0xdeff('0x27')](respondWithFilteredResult(_0x14fa7f,_0x592ea6));})[_0xdeff('0x45')](handleError(_0x14fa7f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 85ba3d7..6b89e69 100644 --- a/server/api/voiceMail/voiceMail.model.js +++ b/server/api/voiceMail/voiceMail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71d4=['context','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox'];(function(_0x30f5bb,_0x4db4bd){var _0x1cfc00=function(_0x20f833){while(--_0x20f833){_0x30f5bb['push'](_0x30f5bb['shift']());}};_0x1cfc00(++_0x4db4bd);}(_0x71d4,0x1a5));var _0x471d=function(_0x1f2561,_0x529d04){_0x1f2561=_0x1f2561-0x0;var _0x1aa827=_0x71d4[_0x1f2561];return _0x1aa827;};'use strict';var _=require(_0x471d('0x0'));var util=require('util');var logger=require(_0x471d('0x1'))('api');var moment=require(_0x471d('0x2'));var BPromise=require(_0x471d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x471d('0x4'));var rimraf=require(_0x471d('0x5'));var config=require(_0x471d('0x6'));var attributes=require(_0x471d('0x7'));module[_0x471d('0x8')]=function(_0x1c13ef,_0x1890e1){return _0x1c13ef[_0x471d('0x9')](_0x471d('0xa'),attributes,{'tableName':_0x471d('0xb'),'paranoid':![],'indexes':[{'name':_0x471d('0xc'),'fields':[_0x471d('0xd'),_0x471d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb14b=['mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context'];(function(_0x414a4e,_0x181824){var _0x13025f=function(_0x395d93){while(--_0x395d93){_0x414a4e['push'](_0x414a4e['shift']());}};_0x13025f(++_0x181824);}(_0xb14b,0x167));var _0xbb14=function(_0x418b74,_0x4c4385){_0x418b74=_0x418b74-0x0;var _0x1e01ba=_0xb14b[_0x418b74];return _0x1e01ba;};'use strict';var _=require(_0xbb14('0x0'));var util=require(_0xbb14('0x1'));var logger=require(_0xbb14('0x2'))(_0xbb14('0x3'));var moment=require(_0xbb14('0x4'));var BPromise=require(_0xbb14('0x5'));var rp=require(_0xbb14('0x6'));var fs=require('fs');var path=require(_0xbb14('0x7'));var rimraf=require(_0xbb14('0x8'));var config=require(_0xbb14('0x9'));var attributes=require(_0xbb14('0xa'));module[_0xbb14('0xb')]=function(_0x5dc6b9,_0x1af803){return _0x5dc6b9[_0xbb14('0xc')]('VoiceMail',attributes,{'tableName':_0xbb14('0xd'),'paranoid':![],'indexes':[{'name':_0xbb14('0xe'),'fields':[_0xbb14('0xf'),_0xbb14('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 4b62252..c92e0c8 100644 --- a/server/api/voiceMail/voiceMail.rpc.js +++ b/server/api/voiceMail/voiceMail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4257=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x2410fd,_0x11961d){var _0x258fd1=function(_0xf94579){while(--_0xf94579){_0x2410fd['push'](_0x2410fd['shift']());}};_0x258fd1(++_0x11961d);}(_0x4257,0x98));var _0x7425=function(_0x3ae97b,_0x506a65){_0x3ae97b=_0x3ae97b-0x0;var _0x448208=_0x4257[_0x3ae97b];return _0x448208;};'use strict';var _=require(_0x7425('0x0'));var util=require(_0x7425('0x1'));var moment=require(_0x7425('0x2'));var BPromise=require(_0x7425('0x3'));var rs=require(_0x7425('0x4'));var fs=require('fs');var Redis=require(_0x7425('0x5'));var db=require(_0x7425('0x6'))['db'];var utils=require(_0x7425('0x7'));var logger=require('../../config/logger')(_0x7425('0x8'));var config=require(_0x7425('0x9'));var jayson=require(_0x7425('0xa'));var client=jayson[_0x7425('0xb')][_0x7425('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x675f54,_0x1ef22d,_0x559033){return new BPromise(function(_0x187fa1,_0x47e7b4){return client[_0x7425('0xd')](_0x675f54,_0x559033)[_0x7425('0xe')](function(_0x51f07e){logger['info'](_0x7425('0xf'),_0x1ef22d,_0x7425('0x10'));logger[_0x7425('0x11')](_0x7425('0x12'),_0x1ef22d,'request\x20sent',JSON[_0x7425('0x13')](_0x51f07e));if(_0x51f07e[_0x7425('0x14')]){if(_0x51f07e[_0x7425('0x14')][_0x7425('0x15')]===0x1f4){logger['error'](_0x7425('0xf'),_0x1ef22d,_0x51f07e[_0x7425('0x14')][_0x7425('0x16')]);return _0x47e7b4(_0x51f07e['error']['message']);}logger[_0x7425('0x14')](_0x7425('0xf'),_0x1ef22d,_0x51f07e['error'][_0x7425('0x16')]);return _0x187fa1(_0x51f07e[_0x7425('0x14')]['message']);}else{logger[_0x7425('0x17')](_0x7425('0xf'),_0x1ef22d,_0x7425('0x10'));_0x187fa1(_0x51f07e[_0x7425('0x18')][_0x7425('0x16')]);}})[_0x7425('0x19')](function(_0x5baaf9){logger[_0x7425('0x14')]('VoiceMail,\x20%s,\x20%s',_0x1ef22d,_0x5baaf9);_0x47e7b4(_0x5baaf9);});});} \ No newline at end of file +var _0x7fb0=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMail,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x1ea8bf,_0x11701c){var _0x95d57a=function(_0x39d83a){while(--_0x39d83a){_0x1ea8bf['push'](_0x1ea8bf['shift']());}};_0x95d57a(++_0x11701c);}(_0x7fb0,0x1e2));var _0x07fb=function(_0x520bf2,_0xb4e8c3){_0x520bf2=_0x520bf2-0x0;var _0x1603ca=_0x7fb0[_0x520bf2];return _0x1603ca;};'use strict';var _=require(_0x07fb('0x0'));var util=require(_0x07fb('0x1'));var moment=require(_0x07fb('0x2'));var BPromise=require('bluebird');var rs=require(_0x07fb('0x3'));var fs=require('fs');var Redis=require(_0x07fb('0x4'));var db=require(_0x07fb('0x5'))['db'];var utils=require(_0x07fb('0x6'));var logger=require(_0x07fb('0x7'))(_0x07fb('0x8'));var config=require('../../config/environment');var jayson=require(_0x07fb('0x9'));var client=jayson['client'][_0x07fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2111ca,_0x2794af,_0x107940){return new BPromise(function(_0x308054,_0x674645){return client[_0x07fb('0xb')](_0x2111ca,_0x107940)[_0x07fb('0xc')](function(_0xa0e0a8){logger['info']('VoiceMail,\x20%s,\x20%s',_0x2794af,_0x07fb('0xd'));logger[_0x07fb('0xe')](_0x07fb('0xf'),_0x2794af,'request\x20sent',JSON[_0x07fb('0x10')](_0xa0e0a8));if(_0xa0e0a8[_0x07fb('0x11')]){if(_0xa0e0a8['error']['code']===0x1f4){logger[_0x07fb('0x11')](_0x07fb('0x12'),_0x2794af,_0xa0e0a8[_0x07fb('0x11')][_0x07fb('0x13')]);return _0x674645(_0xa0e0a8[_0x07fb('0x11')][_0x07fb('0x13')]);}logger[_0x07fb('0x11')]('VoiceMail,\x20%s,\x20%s',_0x2794af,_0xa0e0a8[_0x07fb('0x11')][_0x07fb('0x13')]);return _0x308054(_0xa0e0a8[_0x07fb('0x11')]['message']);}else{logger[_0x07fb('0x14')](_0x07fb('0x12'),_0x2794af,'request\x20sent');_0x308054(_0xa0e0a8[_0x07fb('0x15')][_0x07fb('0x13')]);}})[_0x07fb('0x16')](function(_0x5ac059){logger[_0x07fb('0x11')](_0x07fb('0x12'),_0x2794af,_0x5ac059);_0x674645(_0x5ac059);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index ada024e..3ce726a 100644 --- a/server/api/voiceMailMessage/index.js +++ b/server/api/voiceMailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49b5=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','download'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x49b5,0x113));var _0x549b=function(_0x44237c,_0x13430a){_0x44237c=_0x44237c-0x0;var _0x337db1=_0x49b5[_0x44237c];return _0x337db1;};'use strict';var multer=require(_0x549b('0x0'));var util=require(_0x549b('0x1'));var path=require(_0x549b('0x2'));var timeout=require(_0x549b('0x3'));var express=require(_0x549b('0x4'));var router=express[_0x549b('0x5')]();var fs_extra=require(_0x549b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x549b('0x7'));var controller=require('./voiceMailMessage.controller');router[_0x549b('0x8')]('/',auth[_0x549b('0x9')](),controller[_0x549b('0xa')]);router[_0x549b('0x8')](_0x549b('0xb'),auth[_0x549b('0x9')](),controller['show']);router[_0x549b('0x8')]('/:id/download',auth[_0x549b('0x9')](),controller[_0x549b('0xc')]);router['post']('/',auth[_0x549b('0x9')](),controller[_0x549b('0xd')]);router[_0x549b('0xe')](_0x549b('0xb'),auth[_0x549b('0x9')](),controller[_0x549b('0xf')]);router[_0x549b('0x10')](_0x549b('0xb'),auth['isAuthenticated'](),controller[_0x549b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x549d=['../../components/auth/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','util','connect-timeout','express','fs-extra'];(function(_0x50272d,_0x4a0f39){var _0x276c4c=function(_0x4e44d5){while(--_0x4e44d5){_0x50272d['push'](_0x50272d['shift']());}};_0x276c4c(++_0x4a0f39);}(_0x549d,0x155));var _0xd549=function(_0x1fc6cf,_0xa47f14){_0x1fc6cf=_0x1fc6cf-0x0;var _0x4772cb=_0x549d[_0x1fc6cf];return _0x4772cb;};'use strict';var multer=require('multer');var util=require(_0xd549('0x0'));var path=require('path');var timeout=require(_0xd549('0x1'));var express=require(_0xd549('0x2'));var router=express['Router']();var fs_extra=require(_0xd549('0x3'));var auth=require(_0xd549('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd549('0x5'));router[_0xd549('0x6')]('/',auth[_0xd549('0x7')](),controller[_0xd549('0x8')]);router[_0xd549('0x6')](_0xd549('0x9'),auth['isAuthenticated'](),controller[_0xd549('0xa')]);router[_0xd549('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xd549('0x7')](),controller[_0xd549('0xb')]);router['put'](_0xd549('0x9'),auth['isAuthenticated'](),controller[_0xd549('0xc')]);router['delete'](_0xd549('0x9'),auth[_0xd549('0x7')](),controller[_0xd549('0xd')]);module[_0xd549('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 76a0679..3d0c4dd 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js +++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5494=['STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL'];(function(_0x1bc5d1,_0x33bae1){var _0x471a11=function(_0x43411e){while(--_0x43411e){_0x1bc5d1['push'](_0x1bc5d1['shift']());}};_0x471a11(++_0x33bae1);}(_0x5494,0x71));var _0x4549=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5494[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require(_0x4549('0x0'));module['exports']={'name':{'type':Sequelize[_0x4549('0x1')],'get':function(_0x3975a9){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4549('0x2')],'defaultValue':''},'callerid':{'type':Sequelize[_0x4549('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0x4549('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0x4549('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4549('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x4549('0x2')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x4549('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x4549('0x2')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x4549('0x3')](_0x4549('0x4'))}}; \ No newline at end of file +var _0x215b=['INTEGER','STRING','BLOB','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x215b,0x14d));var _0xb215=function(_0x3c0854,_0x4222ac){_0x3c0854=_0x3c0854-0x0;var _0x379312=_0x215b[_0x3c0854];return _0x379312;};'use strict';var Sequelize=require('sequelize');module[_0xb215('0x0')]={'name':{'type':Sequelize[_0xb215('0x1')],'get':function(_0x53c770){return this[_0xb215('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xb215('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xb215('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xb215('0x6'),'defaultValue':Sequelize['literal'](_0xb215('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index eb722c2..c2df5e1 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.controller.js +++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb630=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','VoiceMailMessage','fieldName','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','options','include','catch','includeAll','find','create','body','destroy','params','download','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','msg_id','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb630,0xf7));var _0x0b63=function(_0x3ae1a9,_0x3f6243){_0x3ae1a9=_0x3ae1a9-0x0;var _0x36b7e4=_0xb630[_0x3ae1a9];return _0x36b7e4;};'use strict';var emlformat=require(_0x0b63('0x0'));var rimraf=require(_0x0b63('0x1'));var zipdir=require(_0x0b63('0x2'));var jsonpatch=require(_0x0b63('0x3'));var rp=require(_0x0b63('0x4'));var moment=require(_0x0b63('0x5'));var BPromise=require(_0x0b63('0x6'));var Mustache=require(_0x0b63('0x7'));var util=require(_0x0b63('0x8'));var path=require(_0x0b63('0x9'));var sox=require(_0x0b63('0xa'));var csv=require(_0x0b63('0xb'));var ejs=require(_0x0b63('0xc'));var fs=require('fs');var fs_extra=require(_0x0b63('0xd'));var _=require(_0x0b63('0xe'));var squel=require(_0x0b63('0xf'));var crypto=require(_0x0b63('0x10'));var jsforce=require(_0x0b63('0x11'));var deskjs=require(_0x0b63('0x12'));var toCsv=require(_0x0b63('0xb'));var querystring=require(_0x0b63('0x13'));var Papa=require(_0x0b63('0x14'));var Redis=require(_0x0b63('0x15'));var authService=require(_0x0b63('0x16'));var qs=require(_0x0b63('0x17'));var as=require(_0x0b63('0x18'));var hardwareService=require(_0x0b63('0x19'));var logger=require('../../config/logger')(_0x0b63('0x1a'));var utils=require('../../config/utils');var config=require(_0x0b63('0x1b'));var licenseUtil=require(_0x0b63('0x1c'));var db=require(_0x0b63('0x1d'))['db'];function respondWithStatusCode(_0x52dbe1,_0x4381ae){_0x4381ae=_0x4381ae||0xcc;return function(_0x500264){if(_0x500264){return _0x52dbe1[_0x0b63('0x1e')](_0x4381ae);}return _0x52dbe1[_0x0b63('0x1f')](_0x4381ae)['end']();};}function respondWithResult(_0x1cddad,_0x526a00){_0x526a00=_0x526a00||0xc8;return function(_0x46170e){if(_0x46170e){return _0x1cddad['status'](_0x526a00)[_0x0b63('0x20')](_0x46170e);}};}function respondWithFilteredResult(_0x4b307c,_0x52e999){return function(_0x21c6bb){if(_0x21c6bb){var _0x512f2e=typeof _0x52e999[_0x0b63('0x21')]==='undefined'&&typeof _0x52e999[_0x0b63('0x22')]==='undefined';var _0x187a2e=_0x21c6bb[_0x0b63('0x23')];var _0x59445f=_0x512f2e?0x0:_0x52e999[_0x0b63('0x21')];var _0x245b08=_0x512f2e?_0x21c6bb[_0x0b63('0x23')]:_0x52e999[_0x0b63('0x21')]+_0x52e999[_0x0b63('0x22')];var _0x34b1f1;if(_0x245b08>=_0x187a2e){_0x245b08=_0x187a2e;_0x34b1f1=0xc8;}else{_0x34b1f1=0xce;}_0x4b307c[_0x0b63('0x1f')](_0x34b1f1);return _0x4b307c[_0x0b63('0x24')](_0x0b63('0x25'),_0x59445f+'-'+_0x245b08+'/'+_0x187a2e)[_0x0b63('0x20')](_0x21c6bb);}return null;};}function patchUpdates(_0x502ff3){return function(_0x3acd85){try{jsonpatch[_0x0b63('0x26')](_0x3acd85,_0x502ff3,!![]);}catch(_0x199518){return BPromise['reject'](_0x199518);}return _0x3acd85[_0x0b63('0x27')]();};}function saveUpdates(_0x135b6a,_0x2778bb){return function(_0x3bb61e){if(_0x3bb61e){return _0x3bb61e[_0x0b63('0x28')](_0x135b6a)[_0x0b63('0x29')](function(_0x2d5a0a){return _0x2d5a0a;});}return null;};}function removeEntity(_0x1594b2,_0x42db98){return function(_0x26b122){if(_0x26b122){return _0x26b122['destroy']()[_0x0b63('0x29')](function(){_0x1594b2[_0x0b63('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a7193,_0x2b9d5e){return function(_0x2b72cb){if(!_0x2b72cb){_0x2a7193[_0x0b63('0x1e')](0x194);}return _0x2b72cb;};}function handleError(_0xeadb33,_0x1a3b96){_0x1a3b96=_0x1a3b96||0x1f4;return function(_0x3c696c){logger[_0x0b63('0x2a')](_0x3c696c[_0x0b63('0x2b')]);if(_0x3c696c[_0x0b63('0x2c')]){delete _0x3c696c['name'];}_0xeadb33[_0x0b63('0x1f')](_0x1a3b96)[_0x0b63('0x2d')](_0x3c696c);};}exports[_0x0b63('0x2e')]=function(_0x4185e9,_0x47926c){var _0x89c735={},_0x535803={},_0x505a49={'count':0x0,'rows':[]};var _0x279b3d=_[_0x0b63('0x2f')](db[_0x0b63('0x30')]['rawAttributes'],function(_0x2fe322){return{'name':_0x2fe322[_0x0b63('0x31')],'type':_0x2fe322['type'][_0x0b63('0x32')]};});_0x535803[_0x0b63('0x33')]=_[_0x0b63('0x34')](_[_0x0b63('0x2f')](_0x279b3d,_0x0b63('0x2c')),[_0x0b63('0x2c')]);_0x535803[_0x0b63('0x35')]=_[_0x0b63('0x36')](_0x4185e9[_0x0b63('0x35')]);_0x535803[_0x0b63('0x37')]=_[_0x0b63('0x38')](_0x535803[_0x0b63('0x33')],_0x535803[_0x0b63('0x35')]);_0x89c735[_0x0b63('0x39')]=_[_0x0b63('0x38')](_0x535803['model'],qs[_0x0b63('0x3a')](_0x4185e9['query'][_0x0b63('0x3a')]));_0x89c735[_0x0b63('0x39')]=_0x89c735[_0x0b63('0x39')][_0x0b63('0x3b')]?_0x89c735[_0x0b63('0x39')]:_0x535803['model'];if(!_0x4185e9[_0x0b63('0x35')][_0x0b63('0x3c')](_0x0b63('0x3d'))){_0x89c735[_0x0b63('0x22')]=qs[_0x0b63('0x22')](_0x4185e9[_0x0b63('0x35')][_0x0b63('0x22')]);_0x89c735[_0x0b63('0x21')]=qs[_0x0b63('0x21')](_0x4185e9[_0x0b63('0x35')][_0x0b63('0x21')]);}_0x89c735['order']=qs[_0x0b63('0x3e')](_0x4185e9[_0x0b63('0x35')][_0x0b63('0x3e')]);_0x89c735[_0x0b63('0x3f')]=qs[_0x0b63('0x37')](_[_0x0b63('0x40')](_0x4185e9[_0x0b63('0x35')],_0x535803[_0x0b63('0x37')]),_0x279b3d);if(_0x4185e9[_0x0b63('0x35')][_0x0b63('0x41')]){_0x89c735[_0x0b63('0x3f')]=_['merge'](_0x89c735[_0x0b63('0x3f')],{'$or':_[_0x0b63('0x2f')](_0x279b3d,function(_0xb33724){if(_0xb33724[_0x0b63('0x42')]!=='VIRTUAL'){var _0x45894c={};_0x45894c[_0xb33724[_0x0b63('0x2c')]]={'$like':'%'+_0x4185e9['query'][_0x0b63('0x41')]+'%'};return _0x45894c;}})});}_0x89c735=_[_0x0b63('0x43')]({},_0x89c735,_0x4185e9[_0x0b63('0x44')]);var _0x2337d7={'where':_0x89c735[_0x0b63('0x3f')]};return db['VoiceMailMessage']['count'](_0x2337d7)[_0x0b63('0x29')](function(_0x369e23){_0x505a49[_0x0b63('0x23')]=_0x369e23;if(_0x4185e9[_0x0b63('0x35')]['includeAll']){_0x89c735[_0x0b63('0x45')]=[{'all':!![]}];}return db[_0x0b63('0x30')]['findAll'](_0x89c735);})[_0x0b63('0x29')](function(_0x3d261a){_0x505a49['rows']=_0x3d261a;return _0x505a49;})[_0x0b63('0x29')](respondWithFilteredResult(_0x47926c,_0x89c735))[_0x0b63('0x46')](handleError(_0x47926c,null));};exports['show']=function(_0x1c7015,_0x2c1e1f){var _0x5c5429={'raw':!![],'where':{'id':_0x1c7015['params']['id']}},_0x5a857e={};_0x5a857e[_0x0b63('0x33')]=_[_0x0b63('0x36')](db[_0x0b63('0x30')]['rawAttributes']);_0x5a857e[_0x0b63('0x35')]=_[_0x0b63('0x36')](_0x1c7015[_0x0b63('0x35')]);_0x5a857e[_0x0b63('0x37')]=_[_0x0b63('0x38')](_0x5a857e[_0x0b63('0x33')],_0x5a857e[_0x0b63('0x35')]);_0x5c5429[_0x0b63('0x39')]=_[_0x0b63('0x38')](_0x5a857e[_0x0b63('0x33')],qs[_0x0b63('0x3a')](_0x1c7015[_0x0b63('0x35')][_0x0b63('0x3a')]));_0x5c5429[_0x0b63('0x39')]=_0x5c5429[_0x0b63('0x39')][_0x0b63('0x3b')]?_0x5c5429[_0x0b63('0x39')]:_0x5a857e[_0x0b63('0x33')];if(_0x1c7015[_0x0b63('0x35')][_0x0b63('0x47')]){_0x5c5429[_0x0b63('0x45')]=[{'all':!![]}];}_0x5c5429=_[_0x0b63('0x43')]({},_0x5c5429,_0x1c7015[_0x0b63('0x44')]);return db[_0x0b63('0x30')][_0x0b63('0x48')](_0x5c5429)[_0x0b63('0x29')](handleEntityNotFound(_0x2c1e1f,null))[_0x0b63('0x29')](respondWithResult(_0x2c1e1f,null))[_0x0b63('0x46')](handleError(_0x2c1e1f,null));};exports['create']=function(_0x5aa7f8,_0x32c876){return db[_0x0b63('0x30')][_0x0b63('0x49')](_0x5aa7f8[_0x0b63('0x4a')],{})[_0x0b63('0x29')](respondWithResult(_0x32c876,0xc9))[_0x0b63('0x46')](handleError(_0x32c876,null));};exports[_0x0b63('0x28')]=function(_0x550a8f,_0x3ff8c0){if(_0x550a8f[_0x0b63('0x4a')]['id']){delete _0x550a8f['body']['id'];}return db['VoiceMailMessage'][_0x0b63('0x48')]({'where':{'id':_0x550a8f['params']['id']}})[_0x0b63('0x29')](handleEntityNotFound(_0x3ff8c0,null))[_0x0b63('0x29')](saveUpdates(_0x550a8f['body'],null))[_0x0b63('0x29')](respondWithResult(_0x3ff8c0,null))[_0x0b63('0x46')](handleError(_0x3ff8c0,null));};exports[_0x0b63('0x4b')]=function(_0x2f73ce,_0x792496){return db[_0x0b63('0x30')][_0x0b63('0x48')]({'where':{'id':_0x2f73ce[_0x0b63('0x4c')]['id']}})['then'](handleEntityNotFound(_0x792496,null))['then'](removeEntity(_0x792496,null))[_0x0b63('0x46')](handleError(_0x792496,null));};exports[_0x0b63('0x4d')]=function(_0x45f2d0,_0x2b3d5e,_0x4a3a94){return db[_0x0b63('0x30')][_0x0b63('0x48')]({'where':{'id':_0x45f2d0['params']['id']},'attributes':['id','recording','msg_id']})[_0x0b63('0x29')](handleEntityNotFound(_0x2b3d5e,null))['then'](function(_0xbfb1c2){if(_0xbfb1c2){if(!_0xbfb1c2[_0x0b63('0x4e')]){throw new db[(_0x0b63('0x4f'))]['ValidationError'](_0x0b63('0x50'));}var _0x252172={'Content-Type':_0x0b63('0x51'),'Content-Disposition':_0x0b63('0x52')};if(_0xbfb1c2['msg_id']){_0x252172[_0x0b63('0x53')]=_0x0b63('0x54')+_0xbfb1c2[_0x0b63('0x55')]+'.wav\x22';}_0x2b3d5e[_0x0b63('0x24')](_0x252172);return _0x2b3d5e[_0x0b63('0x2d')](new Buffer(_0xbfb1c2[_0x0b63('0x4e')]));}})['catch'](handleError(_0x2b3d5e,null));}; \ No newline at end of file +var _0x3797=['attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','reject','update','then','error','stack','name','send','VoiceMailMessage','fieldName','key','model','differenceBy','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','rows','show','params','rawAttributes','fields','include','find','create','body','catch','destroy','download','msg_id','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav'];(function(_0x57ca25,_0x746af0){var _0x3afd27=function(_0x1828fe){while(--_0x1828fe){_0x57ca25['push'](_0x57ca25['shift']());}};_0x3afd27(++_0x746af0);}(_0x3797,0x1a2));var _0x7379=function(_0x2e2d04,_0x549042){_0x2e2d04=_0x2e2d04-0x0;var _0x4b3c77=_0x3797[_0x2e2d04];return _0x4b3c77;};'use strict';var emlformat=require(_0x7379('0x0'));var rimraf=require(_0x7379('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7379('0x2'));var rp=require('request-promise');var moment=require(_0x7379('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7379('0x4'));var util=require('util');var path=require(_0x7379('0x5'));var sox=require('sox');var csv=require(_0x7379('0x6'));var ejs=require(_0x7379('0x7'));var fs=require('fs');var fs_extra=require(_0x7379('0x8'));var _=require(_0x7379('0x9'));var squel=require('squel');var crypto=require(_0x7379('0xa'));var jsforce=require(_0x7379('0xb'));var deskjs=require(_0x7379('0xc'));var toCsv=require(_0x7379('0x6'));var querystring=require('querystring');var Papa=require(_0x7379('0xd'));var Redis=require(_0x7379('0xe'));var authService=require(_0x7379('0xf'));var qs=require(_0x7379('0x10'));var as=require(_0x7379('0x11'));var hardwareService=require(_0x7379('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x7379('0x13'));var config=require(_0x7379('0x14'));var licenseUtil=require(_0x7379('0x15'));var db=require(_0x7379('0x16'))['db'];function respondWithStatusCode(_0x41d76d,_0x3de4b5){_0x3de4b5=_0x3de4b5||0xcc;return function(_0x24921f){if(_0x24921f){return _0x41d76d[_0x7379('0x17')](_0x3de4b5);}return _0x41d76d[_0x7379('0x18')](_0x3de4b5)[_0x7379('0x19')]();};}function respondWithResult(_0xe41026,_0x4cdf15){_0x4cdf15=_0x4cdf15||0xc8;return function(_0xd73e9b){if(_0xd73e9b){return _0xe41026[_0x7379('0x18')](_0x4cdf15)['json'](_0xd73e9b);}};}function respondWithFilteredResult(_0x14eec7,_0x53902d){return function(_0x151f1b){if(_0x151f1b){var _0x1e0418=typeof _0x53902d[_0x7379('0x1a')]===_0x7379('0x1b')&&typeof _0x53902d[_0x7379('0x1c')]===_0x7379('0x1b');var _0x44e06e=_0x151f1b['count'];var _0x427342=_0x1e0418?0x0:_0x53902d[_0x7379('0x1a')];var _0x47da55=_0x1e0418?_0x151f1b['count']:_0x53902d['offset']+_0x53902d[_0x7379('0x1c')];var _0x39e756;if(_0x47da55>=_0x44e06e){_0x47da55=_0x44e06e;_0x39e756=0xc8;}else{_0x39e756=0xce;}_0x14eec7[_0x7379('0x18')](_0x39e756);return _0x14eec7[_0x7379('0x1d')](_0x7379('0x1e'),_0x427342+'-'+_0x47da55+'/'+_0x44e06e)[_0x7379('0x1f')](_0x151f1b);}return null;};}function patchUpdates(_0xb1adef){return function(_0x2d171a){try{jsonpatch['apply'](_0x2d171a,_0xb1adef,!![]);}catch(_0x5ad534){return BPromise[_0x7379('0x20')](_0x5ad534);}return _0x2d171a['save']();};}function saveUpdates(_0x2082eb,_0x541a9c){return function(_0xd643d6){if(_0xd643d6){return _0xd643d6[_0x7379('0x21')](_0x2082eb)[_0x7379('0x22')](function(_0x581d4b){return _0x581d4b;});}return null;};}function removeEntity(_0x55002b,_0x536642){return function(_0x2e8b23){if(_0x2e8b23){return _0x2e8b23['destroy']()[_0x7379('0x22')](function(){_0x55002b[_0x7379('0x18')](0xcc)[_0x7379('0x19')]();});}};}function handleEntityNotFound(_0x32cd58,_0x226e17){return function(_0x20a78e){if(!_0x20a78e){_0x32cd58[_0x7379('0x17')](0x194);}return _0x20a78e;};}function handleError(_0x2f9b7c,_0xe637d0){_0xe637d0=_0xe637d0||0x1f4;return function(_0x514580){logger[_0x7379('0x23')](_0x514580[_0x7379('0x24')]);if(_0x514580[_0x7379('0x25')]){delete _0x514580[_0x7379('0x25')];}_0x2f9b7c['status'](_0xe637d0)[_0x7379('0x26')](_0x514580);};}exports['index']=function(_0x39e1cb,_0x336cd8){var _0x35bbfe={},_0x435baa={},_0x4985a8={'count':0x0,'rows':[]};var _0x233b8c=_['map'](db[_0x7379('0x27')]['rawAttributes'],function(_0x2b1043){return{'name':_0x2b1043[_0x7379('0x28')],'type':_0x2b1043['type'][_0x7379('0x29')]};});_0x435baa[_0x7379('0x2a')]=_[_0x7379('0x2b')](_[_0x7379('0x2c')](_0x233b8c,'name'),[_0x7379('0x25')]);_0x435baa[_0x7379('0x2d')]=_[_0x7379('0x2e')](_0x39e1cb[_0x7379('0x2d')]);_0x435baa['filters']=_[_0x7379('0x2f')](_0x435baa[_0x7379('0x2a')],_0x435baa[_0x7379('0x2d')]);_0x35bbfe['attributes']=_[_0x7379('0x2f')](_0x435baa[_0x7379('0x2a')],qs['fields'](_0x39e1cb[_0x7379('0x2d')]['fields']));_0x35bbfe[_0x7379('0x30')]=_0x35bbfe[_0x7379('0x30')][_0x7379('0x31')]?_0x35bbfe['attributes']:_0x435baa[_0x7379('0x2a')];if(!_0x39e1cb['query'][_0x7379('0x32')](_0x7379('0x33'))){_0x35bbfe[_0x7379('0x1c')]=qs[_0x7379('0x1c')](_0x39e1cb[_0x7379('0x2d')][_0x7379('0x1c')]);_0x35bbfe[_0x7379('0x1a')]=qs[_0x7379('0x1a')](_0x39e1cb[_0x7379('0x2d')][_0x7379('0x1a')]);}_0x35bbfe[_0x7379('0x34')]=qs[_0x7379('0x35')](_0x39e1cb[_0x7379('0x2d')][_0x7379('0x35')]);_0x35bbfe['where']=qs[_0x7379('0x36')](_[_0x7379('0x37')](_0x39e1cb[_0x7379('0x2d')],_0x435baa[_0x7379('0x36')]),_0x233b8c);if(_0x39e1cb['query'][_0x7379('0x38')]){_0x35bbfe[_0x7379('0x39')]=_[_0x7379('0x3a')](_0x35bbfe[_0x7379('0x39')],{'$or':_['map'](_0x233b8c,function(_0xfac48e){if(_0xfac48e['type']!==_0x7379('0x3b')){var _0x3f7875={};_0x3f7875[_0xfac48e[_0x7379('0x25')]]={'$like':'%'+_0x39e1cb['query']['filter']+'%'};return _0x3f7875;}})});}_0x35bbfe=_[_0x7379('0x3a')]({},_0x35bbfe,_0x39e1cb[_0x7379('0x3c')]);var _0x7a9bb1={'where':_0x35bbfe[_0x7379('0x39')]};return db[_0x7379('0x27')][_0x7379('0x3d')](_0x7a9bb1)['then'](function(_0x3661e9){_0x4985a8[_0x7379('0x3d')]=_0x3661e9;if(_0x39e1cb[_0x7379('0x2d')][_0x7379('0x3e')]){_0x35bbfe['include']=[{'all':!![]}];}return db[_0x7379('0x27')]['findAll'](_0x35bbfe);})[_0x7379('0x22')](function(_0xc5f6be){_0x4985a8[_0x7379('0x3f')]=_0xc5f6be;return _0x4985a8;})[_0x7379('0x22')](respondWithFilteredResult(_0x336cd8,_0x35bbfe))['catch'](handleError(_0x336cd8,null));};exports[_0x7379('0x40')]=function(_0x903428,_0x320b38){var _0x5622dc={'raw':!![],'where':{'id':_0x903428[_0x7379('0x41')]['id']}},_0x5dd981={};_0x5dd981[_0x7379('0x2a')]=_['keys'](db[_0x7379('0x27')][_0x7379('0x42')]);_0x5dd981['query']=_['keys'](_0x903428[_0x7379('0x2d')]);_0x5dd981[_0x7379('0x36')]=_[_0x7379('0x2f')](_0x5dd981[_0x7379('0x2a')],_0x5dd981[_0x7379('0x2d')]);_0x5622dc[_0x7379('0x30')]=_[_0x7379('0x2f')](_0x5dd981[_0x7379('0x2a')],qs['fields'](_0x903428[_0x7379('0x2d')][_0x7379('0x43')]));_0x5622dc['attributes']=_0x5622dc[_0x7379('0x30')][_0x7379('0x31')]?_0x5622dc[_0x7379('0x30')]:_0x5dd981[_0x7379('0x2a')];if(_0x903428['query'][_0x7379('0x3e')]){_0x5622dc[_0x7379('0x44')]=[{'all':!![]}];}_0x5622dc=_[_0x7379('0x3a')]({},_0x5622dc,_0x903428[_0x7379('0x3c')]);return db[_0x7379('0x27')][_0x7379('0x45')](_0x5622dc)['then'](handleEntityNotFound(_0x320b38,null))[_0x7379('0x22')](respondWithResult(_0x320b38,null))['catch'](handleError(_0x320b38,null));};exports[_0x7379('0x46')]=function(_0x352a49,_0x186c74){return db[_0x7379('0x27')]['create'](_0x352a49['body'],{})[_0x7379('0x22')](respondWithResult(_0x186c74,0xc9))['catch'](handleError(_0x186c74,null));};exports[_0x7379('0x21')]=function(_0x5831df,_0x5cf83a){if(_0x5831df['body']['id']){delete _0x5831df[_0x7379('0x47')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x5831df[_0x7379('0x41')]['id']}})[_0x7379('0x22')](handleEntityNotFound(_0x5cf83a,null))['then'](saveUpdates(_0x5831df[_0x7379('0x47')],null))[_0x7379('0x22')](respondWithResult(_0x5cf83a,null))[_0x7379('0x48')](handleError(_0x5cf83a,null));};exports[_0x7379('0x49')]=function(_0x40cc11,_0x1a0d3f){return db[_0x7379('0x27')]['find']({'where':{'id':_0x40cc11[_0x7379('0x41')]['id']}})[_0x7379('0x22')](handleEntityNotFound(_0x1a0d3f,null))[_0x7379('0x22')](removeEntity(_0x1a0d3f,null))[_0x7379('0x48')](handleError(_0x1a0d3f,null));};exports[_0x7379('0x4a')]=function(_0x3d7b1c,_0x5cfeaf,_0x4c3257){return db[_0x7379('0x27')][_0x7379('0x45')]({'where':{'id':_0x3d7b1c[_0x7379('0x41')]['id']},'attributes':['id','recording',_0x7379('0x4b')]})[_0x7379('0x22')](handleEntityNotFound(_0x5cfeaf,null))[_0x7379('0x22')](function(_0x14e918){if(_0x14e918){if(!_0x14e918[_0x7379('0x4c')]){throw new db['Sequelize'][(_0x7379('0x4d'))](_0x7379('0x4e'));}var _0x2ad59c={'Content-Type':_0x7379('0x4f'),'Content-Disposition':_0x7379('0x50')};if(_0x14e918['msg_id']){_0x2ad59c[_0x7379('0x51')]=_0x7379('0x52')+_0x14e918[_0x7379('0x4b')]+'.wav\x22';}_0x5cfeaf['set'](_0x2ad59c);return _0x5cfeaf[_0x7379('0x26')](new Buffer(_0x14e918[_0x7379('0x4c')]));}})['catch'](handleError(_0x5cfeaf,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 3302da7..f0aec2d 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.model.js +++ b/server/api/voiceMailMessage/voiceMailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc96b=['define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0x32d7e8,_0x2ad5d8){var _0x33f098=function(_0x490c3a){while(--_0x490c3a){_0x32d7e8['push'](_0x32d7e8['shift']());}};_0x33f098(++_0x2ad5d8);}(_0xc96b,0x161));var _0xbc96=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc96b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbc96('0x0'));var util=require(_0xbc96('0x1'));var logger=require(_0xbc96('0x2'))(_0xbc96('0x3'));var moment=require('moment');var BPromise=require(_0xbc96('0x4'));var rp=require(_0xbc96('0x5'));var fs=require('fs');var path=require(_0xbc96('0x6'));var rimraf=require(_0xbc96('0x7'));var config=require(_0xbc96('0x8'));var attributes=require(_0xbc96('0x9'));module[_0xbc96('0xa')]=function(_0x57cae8,_0x41f041){return _0x57cae8[_0xbc96('0xb')]('VoiceMailMessage',attributes,{'tableName':_0xbc96('0xc'),'paranoid':![],'indexes':[{'name':_0xbc96('0xd'),'fields':[_0xbc96('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1c67=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1c67,0x193));var _0x71c6=function(_0xb8aa04,_0x18410d){_0xb8aa04=_0xb8aa04-0x0;var _0x1a2bcc=_0x1c67[_0xb8aa04];return _0x1a2bcc;};'use strict';var _=require(_0x71c6('0x0'));var util=require(_0x71c6('0x1'));var logger=require(_0x71c6('0x2'))('api');var moment=require(_0x71c6('0x3'));var BPromise=require(_0x71c6('0x4'));var rp=require(_0x71c6('0x5'));var fs=require('fs');var path=require(_0x71c6('0x6'));var rimraf=require(_0x71c6('0x7'));var config=require(_0x71c6('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x71c6('0x9')]=function(_0x46b8a1,_0x5e7606){return _0x46b8a1[_0x71c6('0xa')](_0x71c6('0xb'),attributes,{'tableName':_0x71c6('0xc'),'paranoid':![],'indexes':[{'name':_0x71c6('0xd'),'fields':[_0x71c6('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 9b10102..28b7fa3 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd0e=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x2c4b59,_0x265e11){var _0x1d4c19=function(_0x49a8c6){while(--_0x49a8c6){_0x2c4b59['push'](_0x2c4b59['shift']());}};_0x1d4c19(++_0x265e11);}(_0xdd0e,0x169));var _0xedd0=function(_0x324b13,_0x5104fe){_0x324b13=_0x324b13-0x0;var _0x5c9849=_0xdd0e[_0x324b13];return _0x5c9849;};'use strict';var _=require(_0xedd0('0x0'));var util=require(_0xedd0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xedd0('0x2'));var fs=require('fs');var Redis=require(_0xedd0('0x3'));var db=require(_0xedd0('0x4'))['db'];var utils=require(_0xedd0('0x5'));var logger=require(_0xedd0('0x6'))(_0xedd0('0x7'));var config=require(_0xedd0('0x8'));var jayson=require(_0xedd0('0x9'));var client=jayson[_0xedd0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xca87e1,_0xe32d05,_0x2b4793){return new BPromise(function(_0x3eba8d,_0xe3f6bd){return client[_0xedd0('0xb')](_0xca87e1,_0x2b4793)[_0xedd0('0xc')](function(_0xb3ae04){logger[_0xedd0('0xd')](_0xedd0('0xe'),_0xe32d05,_0xedd0('0xf'));logger[_0xedd0('0x10')](_0xedd0('0x11'),_0xe32d05,_0xedd0('0xf'),JSON[_0xedd0('0x12')](_0xb3ae04));if(_0xb3ae04['error']){if(_0xb3ae04['error'][_0xedd0('0x13')]===0x1f4){logger[_0xedd0('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0xe32d05,_0xb3ae04[_0xedd0('0x14')]['message']);return _0xe3f6bd(_0xb3ae04[_0xedd0('0x14')][_0xedd0('0x15')]);}logger[_0xedd0('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0xe32d05,_0xb3ae04[_0xedd0('0x14')][_0xedd0('0x15')]);return _0x3eba8d(_0xb3ae04[_0xedd0('0x14')][_0xedd0('0x15')]);}else{logger[_0xedd0('0xd')](_0xedd0('0xe'),_0xe32d05,_0xedd0('0xf'));_0x3eba8d(_0xb3ae04[_0xedd0('0x16')][_0xedd0('0x15')]);}})[_0xedd0('0x17')](function(_0x586f38){logger[_0xedd0('0x14')](_0xedd0('0xe'),_0xe32d05,_0x586f38);_0xe3f6bd(_0x586f38);});});} \ No newline at end of file +var _0x0739=['rpc','client','http','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x5a9655,_0x2b4bc2){var _0x1543c7=function(_0x357d71){while(--_0x357d71){_0x5a9655['push'](_0x5a9655['shift']());}};_0x1543c7(++_0x2b4bc2);}(_0x0739,0x176));var _0x9073=function(_0x353edc,_0x2a0e87){_0x353edc=_0x353edc-0x0;var _0x4effca=_0x0739[_0x353edc];return _0x4effca;};'use strict';var _=require(_0x9073('0x0'));var util=require(_0x9073('0x1'));var moment=require(_0x9073('0x2'));var BPromise=require(_0x9073('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9073('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9073('0x5'))(_0x9073('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9073('0x7')][_0x9073('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30f4e7,_0x23c736,_0x482183){return new BPromise(function(_0x125237,_0x4552c9){return client[_0x9073('0x9')](_0x30f4e7,_0x482183)['then'](function(_0x1748de){logger['info'](_0x9073('0xa'),_0x23c736,_0x9073('0xb'));logger[_0x9073('0xc')](_0x9073('0xd'),_0x23c736,'request\x20sent',JSON[_0x9073('0xe')](_0x1748de));if(_0x1748de['error']){if(_0x1748de[_0x9073('0xf')]['code']===0x1f4){logger[_0x9073('0xf')](_0x9073('0xa'),_0x23c736,_0x1748de['error']['message']);return _0x4552c9(_0x1748de['error'][_0x9073('0x10')]);}logger[_0x9073('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x23c736,_0x1748de[_0x9073('0xf')][_0x9073('0x10')]);return _0x125237(_0x1748de[_0x9073('0xf')][_0x9073('0x10')]);}else{logger['info'](_0x9073('0xa'),_0x23c736,_0x9073('0xb'));_0x125237(_0x1748de[_0x9073('0x11')][_0x9073('0x10')]);}})[_0x9073('0x12')](function(_0x28cd5b){logger[_0x9073('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x23c736,_0x28cd5b);_0x4552c9(_0x28cd5b);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 04abe90..529aebb 100644 --- a/server/api/voiceMusicOnHold/index.js +++ b/server/api/voiceMusicOnHold/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf562=['destroy','/:id/sounds/:id2','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','isAuthenticated','/:id/sounds','create','post','update','delete','/:id'];(function(_0x46db0b,_0x4ba336){var _0x14eff4=function(_0x360e0e){while(--_0x360e0e){_0x46db0b['push'](_0x46db0b['shift']());}};_0x14eff4(++_0x4ba336);}(_0xf562,0x71));var _0x2f56=function(_0x355387,_0x257705){_0x355387=_0x355387-0x0;var _0x62617f=_0xf562[_0x355387];return _0x62617f;};'use strict';var multer=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var path=require(_0x2f56('0x2'));var timeout=require(_0x2f56('0x3'));var express=require(_0x2f56('0x4'));var router=express['Router']();var fs_extra=require(_0x2f56('0x5'));var auth=require(_0x2f56('0x6'));var interaction=require(_0x2f56('0x7'));var config=require(_0x2f56('0x8'));var controller=require(_0x2f56('0x9'));router[_0x2f56('0xa')]('/',auth['isAuthenticated'](),controller[_0x2f56('0xb')]);router[_0x2f56('0xa')]('/:id',auth[_0x2f56('0xc')](),controller['show']);router[_0x2f56('0xa')](_0x2f56('0xd'),auth[_0x2f56('0xc')](),controller['getSounds']);router['post']('/',auth[_0x2f56('0xc')](),controller[_0x2f56('0xe')]);router[_0x2f56('0xf')](_0x2f56('0xd'),auth[_0x2f56('0xc')](),controller['addSound']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2f56('0x10')]);router[_0x2f56('0x11')](_0x2f56('0x12'),auth[_0x2f56('0xc')](),controller[_0x2f56('0x13')]);router[_0x2f56('0x11')](_0x2f56('0x14'),auth['isAuthenticated'](),controller['removeSound']);module[_0x2f56('0x15')]=router; \ No newline at end of file +var _0xf36b=['getSounds','post','create','/:id/sounds','put','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','Router','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xf36b,0xd1));var _0xbf36=function(_0x3ef7ef,_0x59e75b){_0x3ef7ef=_0x3ef7ef-0x0;var _0x446038=_0xf36b[_0x3ef7ef];return _0x446038;};'use strict';var multer=require(_0xbf36('0x0'));var util=require(_0xbf36('0x1'));var path=require(_0xbf36('0x2'));var timeout=require(_0xbf36('0x3'));var express=require('express');var router=express[_0xbf36('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf36('0x5'));var controller=require(_0xbf36('0x6'));router[_0xbf36('0x7')]('/',auth[_0xbf36('0x8')](),controller[_0xbf36('0x9')]);router[_0xbf36('0x7')](_0xbf36('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xbf36('0x7')]('/:id/sounds',auth[_0xbf36('0x8')](),controller[_0xbf36('0xb')]);router[_0xbf36('0xc')]('/',auth[_0xbf36('0x8')](),controller[_0xbf36('0xd')]);router[_0xbf36('0xc')](_0xbf36('0xe'),auth['isAuthenticated'](),controller['addSound']);router[_0xbf36('0xf')](_0xbf36('0xa'),auth[_0xbf36('0x8')](),controller['update']);router[_0xbf36('0x10')](_0xbf36('0xa'),auth[_0xbf36('0x8')](),controller['destroy']);router[_0xbf36('0x10')](_0xbf36('0x11'),auth[_0xbf36('0x8')](),controller[_0xbf36('0x12')]);module[_0xbf36('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 50af841..f413390 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0954=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','custom','files','quietmp3nb','quietmp3','mp3'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x0954,0x106));var _0x4095=function(_0x1e175d,_0x41ff45){_0x1e175d=_0x1e175d-0x0;var _0x3a3ce5=_0x0954[_0x1e175d];return _0x3a3ce5;};'use strict';var Sequelize=require(_0x4095('0x0'));module[_0x4095('0x1')]={'name':{'type':Sequelize[_0x4095('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x4095('0x3'),_0x4095('0x4'),'mp3nb',_0x4095('0x5'),_0x4095('0x6'),_0x4095('0x7')),'allowNull':!![],'defaultValue':_0x4095('0x4')},'directory':{'type':Sequelize[_0x4095('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x4095('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4095('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4095('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x4095('0x2')],'allowNull':!![]},'stamp':{'type':_0x4095('0x8')},'defaultEntry':{'type':Sequelize[_0x4095('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x44c7=['files','mp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x259e62,_0x184e80){var _0x64caea=function(_0x223d36){while(--_0x223d36){_0x259e62['push'](_0x259e62['shift']());}};_0x64caea(++_0x184e80);}(_0x44c7,0xab));var _0x744c=function(_0x1a2243,_0x593600){_0x1a2243=_0x1a2243-0x0;var _0x52a83e=_0x44c7[_0x1a2243];return _0x52a83e;};'use strict';var Sequelize=require(_0x744c('0x0'));module[_0x744c('0x1')]={'name':{'type':Sequelize[_0x744c('0x2')],'allowNull':![],'unique':_0x744c('0x3')},'mode':{'type':Sequelize[_0x744c('0x4')]('custom',_0x744c('0x5'),_0x744c('0x6'),'quietmp3nb',_0x744c('0x7'),_0x744c('0x8')),'allowNull':!![],'defaultValue':_0x744c('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x744c('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x744c('0x2')],'allowNull':!![]},'stamp':{'type':_0x744c('0x9')},'defaultEntry':{'type':Sequelize[_0x744c('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 5198cfe..6c4ac34 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc020=['include','findAll','rows','show','params','find','catch','body','create','sequelize','transaction','files','directory','join','server/files/moh','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','root','server/files/sounds/converted','%s.%s','basename','extname','converted_format','format','symlinkSync','removeSound','id2','createdAt','getSounds','order','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','count','set','json','apply','reject','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll'];(function(_0x184042,_0x45e2e5){var _0x144676=function(_0x357db1){while(--_0x357db1){_0x184042['push'](_0x184042['shift']());}};_0x144676(++_0x45e2e5);}(_0xc020,0x172));var _0x0c02=function(_0x2c944e,_0x26f659){_0x2c944e=_0x2c944e-0x0;var _0x2cc529=_0xc020[_0x2c944e];return _0x2cc529;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c02('0x0'));var jsonpatch=require(_0x0c02('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0c02('0x2'));var Mustache=require(_0x0c02('0x3'));var util=require(_0x0c02('0x4'));var path=require('path');var sox=require(_0x0c02('0x5'));var csv=require('to-csv');var ejs=require(_0x0c02('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c02('0x7'));var squel=require(_0x0c02('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0c02('0x9'));var toCsv=require(_0x0c02('0xa'));var querystring=require(_0x0c02('0xb'));var Papa=require(_0x0c02('0xc'));var Redis=require(_0x0c02('0xd'));var authService=require(_0x0c02('0xe'));var qs=require(_0x0c02('0xf'));var as=require(_0x0c02('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c02('0x11'))(_0x0c02('0x12'));var utils=require('../../config/utils');var config=require(_0x0c02('0x13'));var licenseUtil=require(_0x0c02('0x14'));var db=require(_0x0c02('0x15'))['db'];function respondWithStatusCode(_0x13b779,_0x5d1950){_0x5d1950=_0x5d1950||0xcc;return function(_0x22f897){if(_0x22f897){return _0x13b779['sendStatus'](_0x5d1950);}return _0x13b779['status'](_0x5d1950)[_0x0c02('0x16')]();};}function respondWithResult(_0x49096b,_0x2bcc42){_0x2bcc42=_0x2bcc42||0xc8;return function(_0x1facf2){if(_0x1facf2){return _0x49096b[_0x0c02('0x17')](_0x2bcc42)['json'](_0x1facf2);}};}function respondWithFilteredResult(_0x54516e,_0x39e75a){return function(_0x1c0a12){if(_0x1c0a12){var _0x541ad0=typeof _0x39e75a[_0x0c02('0x18')]==='undefined'&&typeof _0x39e75a[_0x0c02('0x19')]===_0x0c02('0x1a');var _0x376475=_0x1c0a12[_0x0c02('0x1b')];var _0x25bfef=_0x541ad0?0x0:_0x39e75a['offset'];var _0x1a8903=_0x541ad0?_0x1c0a12['count']:_0x39e75a[_0x0c02('0x18')]+_0x39e75a[_0x0c02('0x19')];var _0x2d9803;if(_0x1a8903>=_0x376475){_0x1a8903=_0x376475;_0x2d9803=0xc8;}else{_0x2d9803=0xce;}_0x54516e[_0x0c02('0x17')](_0x2d9803);return _0x54516e[_0x0c02('0x1c')]('Content-Range',_0x25bfef+'-'+_0x1a8903+'/'+_0x376475)[_0x0c02('0x1d')](_0x1c0a12);}return null;};}function patchUpdates(_0x157969){return function(_0x55fd6d){try{jsonpatch[_0x0c02('0x1e')](_0x55fd6d,_0x157969,!![]);}catch(_0x49fc2f){return BPromise[_0x0c02('0x1f')](_0x49fc2f);}return _0x55fd6d['save']();};}function saveUpdates(_0x4fa46f,_0x5e767e){return function(_0x31deb7){if(_0x31deb7){return _0x31deb7[_0x0c02('0x20')](_0x4fa46f)[_0x0c02('0x21')](function(_0x1441bb){return _0x1441bb;});}return null;};}function removeEntity(_0x3232db,_0x31f3dd){return function(_0xdf9765){if(_0xdf9765){return _0xdf9765['destroy']()[_0x0c02('0x21')](function(){var _0x115178=_0xdf9765['get']({'plain':!![]});var _0x11919e='MusicOnHolds';return db['UserProfileResource'][_0x0c02('0x22')]({'where':{'type':_0x11919e,'resourceId':_0x115178['id']}})[_0x0c02('0x21')](function(){return _0xdf9765;});})[_0x0c02('0x21')](function(){_0x3232db[_0x0c02('0x17')](0xcc)[_0x0c02('0x16')]();});}};}function handleEntityNotFound(_0x47fe4e,_0x2ea0a3){return function(_0x3fbe17){if(!_0x3fbe17){_0x47fe4e['sendStatus'](0x194);}return _0x3fbe17;};}function handleError(_0x295e1f,_0x31d4e8){_0x31d4e8=_0x31d4e8||0x1f4;return function(_0x491f74){logger[_0x0c02('0x23')](_0x491f74['stack']);if(_0x491f74[_0x0c02('0x24')]){delete _0x491f74[_0x0c02('0x24')];}_0x295e1f[_0x0c02('0x17')](_0x31d4e8)[_0x0c02('0x25')](_0x491f74);};}exports[_0x0c02('0x26')]=function(_0x36ca37,_0x4ff2bf){var _0x195b1b={},_0x11e61c={},_0x218c97={'count':0x0,'rows':[]};var _0x2772fa=_['map'](db['VoiceMusicOnHold'][_0x0c02('0x27')],function(_0x103cc7){return{'name':_0x103cc7[_0x0c02('0x28')],'type':_0x103cc7[_0x0c02('0x29')]['key']};});_0x11e61c[_0x0c02('0x2a')]=_[_0x0c02('0x2b')](_0x2772fa,'name');_0x11e61c[_0x0c02('0x2c')]=_[_0x0c02('0x2d')](_0x36ca37[_0x0c02('0x2c')]);_0x11e61c[_0x0c02('0x2e')]=_['intersection'](_0x11e61c['model'],_0x11e61c[_0x0c02('0x2c')]);_0x195b1b['attributes']=_[_0x0c02('0x2f')](_0x11e61c[_0x0c02('0x2a')],qs[_0x0c02('0x30')](_0x36ca37['query']['fields']));_0x195b1b[_0x0c02('0x31')]=_0x195b1b[_0x0c02('0x31')][_0x0c02('0x32')]?_0x195b1b[_0x0c02('0x31')]:_0x11e61c[_0x0c02('0x2a')];if(!_0x36ca37[_0x0c02('0x2c')][_0x0c02('0x33')](_0x0c02('0x34'))){_0x195b1b[_0x0c02('0x19')]=qs[_0x0c02('0x19')](_0x36ca37[_0x0c02('0x2c')]['limit']);_0x195b1b[_0x0c02('0x18')]=qs['offset'](_0x36ca37[_0x0c02('0x2c')][_0x0c02('0x18')]);}_0x195b1b['order']=qs[_0x0c02('0x35')](_0x36ca37[_0x0c02('0x2c')][_0x0c02('0x35')]);delete _0x36ca37[_0x0c02('0x2c')][_0x0c02('0x35')];_0x195b1b[_0x0c02('0x36')]=qs['filters'](_[_0x0c02('0x37')](_0x36ca37[_0x0c02('0x2c')],_0x11e61c['filters']),_0x2772fa);if(_0x36ca37[_0x0c02('0x2c')][_0x0c02('0x38')]){_0x195b1b[_0x0c02('0x36')]=_[_0x0c02('0x39')](_0x195b1b[_0x0c02('0x36')],{'$or':_[_0x0c02('0x2b')](_0x2772fa,function(_0x4b02b3){if(_0x4b02b3[_0x0c02('0x29')]!==_0x0c02('0x3a')){var _0x4b02f8={};_0x4b02f8[_0x4b02b3['name']]={'$like':'%'+_0x36ca37['query']['filter']+'%'};return _0x4b02f8;}})});}_0x195b1b=_[_0x0c02('0x39')]({},_0x195b1b,_0x36ca37[_0x0c02('0x3b')]);var _0x1f3977={'where':_0x195b1b[_0x0c02('0x36')]};return db[_0x0c02('0x3c')]['count'](_0x1f3977)['then'](function(_0x5f267f){_0x218c97[_0x0c02('0x1b')]=_0x5f267f;if(_0x36ca37[_0x0c02('0x2c')][_0x0c02('0x3d')]){_0x195b1b[_0x0c02('0x3e')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x0c02('0x3f')](_0x195b1b);})[_0x0c02('0x21')](function(_0x13ba8e){_0x218c97[_0x0c02('0x40')]=_0x13ba8e;return _0x218c97;})[_0x0c02('0x21')](respondWithFilteredResult(_0x4ff2bf,_0x195b1b))['catch'](handleError(_0x4ff2bf,null));};exports[_0x0c02('0x41')]=function(_0x508a9d,_0x191bdb){var _0x2628b1={'raw':![],'where':{'id':_0x508a9d[_0x0c02('0x42')]['id']}},_0x1cab65={};_0x1cab65[_0x0c02('0x2a')]=_[_0x0c02('0x2d')](db[_0x0c02('0x3c')][_0x0c02('0x27')]);_0x1cab65[_0x0c02('0x2c')]=_['keys'](_0x508a9d[_0x0c02('0x2c')]);_0x1cab65[_0x0c02('0x2e')]=_['intersection'](_0x1cab65[_0x0c02('0x2a')],_0x1cab65[_0x0c02('0x2c')]);_0x2628b1['attributes']=_['intersection'](_0x1cab65[_0x0c02('0x2a')],qs['fields'](_0x508a9d['query'][_0x0c02('0x30')]));_0x2628b1[_0x0c02('0x31')]=_0x2628b1[_0x0c02('0x31')][_0x0c02('0x32')]?_0x2628b1[_0x0c02('0x31')]:_0x1cab65[_0x0c02('0x2a')];if(_0x508a9d['query'][_0x0c02('0x3d')]){_0x2628b1[_0x0c02('0x3e')]=[{'all':!![]}];}_0x2628b1=_[_0x0c02('0x39')]({},_0x2628b1,_0x508a9d[_0x0c02('0x3b')]);return db[_0x0c02('0x3c')][_0x0c02('0x43')](_0x2628b1)[_0x0c02('0x21')](handleEntityNotFound(_0x191bdb,null))[_0x0c02('0x21')](respondWithResult(_0x191bdb,null))[_0x0c02('0x44')](handleError(_0x191bdb,null));};exports[_0x0c02('0x20')]=function(_0x1faba4,_0xcc5009){if(_0x1faba4[_0x0c02('0x45')]['id']){delete _0x1faba4['body']['id'];}return db[_0x0c02('0x3c')][_0x0c02('0x43')]({'where':{'id':_0x1faba4['params']['id']}})[_0x0c02('0x21')](handleEntityNotFound(_0xcc5009,null))[_0x0c02('0x21')](saveUpdates(_0x1faba4[_0x0c02('0x45')],null))[_0x0c02('0x21')](respondWithResult(_0xcc5009,null))[_0x0c02('0x44')](handleError(_0xcc5009,null));};exports[_0x0c02('0x46')]=function(_0x504ccc,_0x38f339,_0x78af16){return db[_0x0c02('0x47')][_0x0c02('0x48')](function(_0x419662){if(_0x504ccc['body']['mode']===_0x0c02('0x49')){_0x504ccc[_0x0c02('0x45')][_0x0c02('0x4a')]=path[_0x0c02('0x4b')](config['root'],_0x0c02('0x4c'),_0x504ccc['body'][_0x0c02('0x24')]);}return db['VoiceMusicOnHold'][_0x0c02('0x46')](_0x504ccc[_0x0c02('0x45')],{'transaction':_0x419662})[_0x0c02('0x21')](function(_0x1c3ad6){if(_0x504ccc['body']['mode']===_0x0c02('0x49')){fs['mkdirSync'](_0x1c3ad6['directory'],parseInt(_0x0c02('0x4d'),0x8));}var _0x5c138a=_0x504ccc[_0x0c02('0x4e')][_0x0c02('0x4f')]({'plain':!![]});if(!_0x5c138a)throw new Error(_0x0c02('0x50'));if(_0x5c138a['role']==='user'){var _0x58ffd8=_0x1c3ad6[_0x0c02('0x4f')]({'plain':!![]});return db['UserProfileSection'][_0x0c02('0x43')]({'where':{'name':_0x0c02('0x51'),'userProfileId':_0x5c138a[_0x0c02('0x52')]},'raw':!![]})[_0x0c02('0x21')](function(_0x428ffe){if(_0x428ffe&&_0x428ffe[_0x0c02('0x53')]===0x0){return db[_0x0c02('0x54')]['create']({'name':_0x58ffd8['name'],'resourceId':_0x58ffd8['id'],'type':_0x428ffe[_0x0c02('0x24')],'sectionId':_0x428ffe['id']},{})['then'](function(){return _0x1c3ad6;});}else{return _0x1c3ad6;}})[_0x0c02('0x44')](function(_0x4e97fa){logger[_0x0c02('0x23')](_0x0c02('0x55'),_0x4e97fa);});}return _0x1c3ad6;});})[_0x0c02('0x21')](respondWithResult(_0x38f339,0xc9))[_0x0c02('0x44')](handleError(_0x38f339,null));};exports[_0x0c02('0x22')]=function(_0x40e8f3,_0x2849a8,_0x36c927){var _0x4ab404;return db[_0x0c02('0x3c')][_0x0c02('0x43')]({'where':{'id':_0x40e8f3['params']['id']}})[_0x0c02('0x21')](function(_0x4ec2bb){if(_0x4ec2bb){return db[_0x0c02('0x47')][_0x0c02('0x48')](function(_0x50b48b){return _0x4ec2bb[_0x0c02('0x22')]({'transaction':_0x50b48b,'raw':!![]})[_0x0c02('0x21')](function(_0x10b2ac){if(_0x10b2ac[_0x0c02('0x4a')]){fs['readdirSync'](_0x10b2ac[_0x0c02('0x4a')])[_0x0c02('0x56')](function(_0x57e98f){fs[_0x0c02('0x57')](path['join'](_0x10b2ac[_0x0c02('0x4a')],_0x57e98f));});fs['rmdirSync'](_0x10b2ac['directory']);}return _0x10b2ac;});})[_0x0c02('0x44')](function(_0x266f07){throw new db[(_0x0c02('0x58'))][(_0x0c02('0x59'))](_0x266f07[_0x0c02('0x5a')]);});}})[_0x0c02('0x21')](handleEntityNotFound(_0x2849a8,null))[_0x0c02('0x21')](removeEntity(_0x2849a8,null))[_0x0c02('0x44')](handleError(_0x2849a8,null));};exports[_0x0c02('0x5b')]=function(_0x5423b0,_0x575d00,_0x4721fa){return db[_0x0c02('0x47')]['transaction'](function(_0x44b541){var _0x31f25b;return db[_0x0c02('0x3c')][_0x0c02('0x43')]({'where':{'id':_0x5423b0[_0x0c02('0x42')]['id']}})[_0x0c02('0x21')](function(_0x3268f7){if(_0x3268f7){_0x31f25b=_0x3268f7;return _0x3268f7[_0x0c02('0x5b')](_0x5423b0['body']['id'],{'transaction':_0x44b541});}})[_0x0c02('0x21')](function(_0x7aa629){if(_0x7aa629){return db[_0x0c02('0x5c')][_0x0c02('0x5d')]({'where':{'id':_0x5423b0[_0x0c02('0x45')]['id']},'attributes':['id',_0x0c02('0x24'),_0x0c02('0x5e'),'converted_format','createdAt'],'raw':!![]});}})[_0x0c02('0x21')](function(_0x1332b1){if(_0x1332b1){var _0x53f892=path[_0x0c02('0x4b')](config[_0x0c02('0x5f')],_0x0c02('0x60'),util['format'](_0x0c02('0x61'),path[_0x0c02('0x62')](_0x1332b1[_0x0c02('0x5e')],path[_0x0c02('0x63')](_0x1332b1['save_name'])),_0x1332b1[_0x0c02('0x64')]));var _0x5470fd=path['join'](config[_0x0c02('0x5f')],_0x0c02('0x4c'),_0x31f25b[_0x0c02('0x24')],util[_0x0c02('0x65')](_0x0c02('0x61'),_0x1332b1[_0x0c02('0x24')],_0x1332b1[_0x0c02('0x64')]));fs[_0x0c02('0x66')](_0x53f892,_0x5470fd);return _0x1332b1;}})['catch'](function(_0x59e803){throw new db[(_0x0c02('0x58'))][(_0x0c02('0x59'))](_0x59e803[_0x0c02('0x5a')]);});})[_0x0c02('0x21')](handleEntityNotFound(_0x575d00,null))[_0x0c02('0x21')](respondWithResult(_0x575d00,0xc9))[_0x0c02('0x44')](handleError(_0x575d00,null));};exports[_0x0c02('0x67')]=function(_0x56651d,_0xea89a7,_0x1df8eb){return db['sequelize'][_0x0c02('0x48')](function(_0x43d4f4){var _0x2ca31e;return db[_0x0c02('0x3c')][_0x0c02('0x5d')]({'where':{'id':_0x56651d['params']['id']}})[_0x0c02('0x21')](handleEntityNotFound(_0xea89a7,null))[_0x0c02('0x21')](function(_0x2910bd){if(_0x2910bd){_0x2ca31e=_0x2910bd;return _0x2910bd[_0x0c02('0x67')](_0x56651d[_0x0c02('0x42')][_0x0c02('0x68')]);}})[_0x0c02('0x21')](function(_0x5927b9){if(_0x5927b9){return db[_0x0c02('0x5c')][_0x0c02('0x5d')]({'where':{'id':_0x56651d[_0x0c02('0x42')][_0x0c02('0x68')]},'attributes':['id','name',_0x0c02('0x5e'),_0x0c02('0x64'),_0x0c02('0x69')],'raw':!![]});}})[_0x0c02('0x21')](function(_0x5da624){if(_0x5da624){fs[_0x0c02('0x57')](path['join'](_0x2ca31e['directory'],util[_0x0c02('0x65')]('%s.%s',_0x5da624[_0x0c02('0x24')],_0x5da624[_0x0c02('0x64')])));return _0x5da624;}})['catch'](function(_0x214fb1){throw new db[(_0x0c02('0x58'))][(_0x0c02('0x59'))](_0x214fb1[_0x0c02('0x5a')]);});})['then'](handleEntityNotFound(_0xea89a7,null))[_0x0c02('0x21')](respondWithStatusCode(_0xea89a7,0xcc))['catch'](handleError(_0xea89a7,null));};exports[_0x0c02('0x6a')]=function(_0x329ce9,_0x3a437f,_0x4bd1ca){var _0x1988ed={};var _0x1aa886={};var _0x159fda;var _0x34e1cb;return db[_0x0c02('0x3c')][_0x0c02('0x5d')]({'where':{'id':_0x329ce9[_0x0c02('0x42')]['id']}})[_0x0c02('0x21')](handleEntityNotFound(_0x3a437f,null))[_0x0c02('0x21')](function(_0x216921){if(_0x216921){_0x159fda=_0x216921;_0x1aa886[_0x0c02('0x2a')]=_['keys'](db[_0x0c02('0x5c')]['rawAttributes']);_0x1aa886[_0x0c02('0x2c')]=_[_0x0c02('0x2d')](_0x329ce9[_0x0c02('0x2c')]);_0x1aa886[_0x0c02('0x2e')]=_['intersection'](_0x1aa886[_0x0c02('0x2a')],_0x1aa886['query']);_0x1988ed['attributes']=_[_0x0c02('0x2f')](_0x1aa886[_0x0c02('0x2a')],qs[_0x0c02('0x30')](_0x329ce9[_0x0c02('0x2c')][_0x0c02('0x30')]));_0x1988ed[_0x0c02('0x31')]=_0x1988ed[_0x0c02('0x31')][_0x0c02('0x32')]?_0x1988ed[_0x0c02('0x31')]:_0x1aa886[_0x0c02('0x2a')];_0x1988ed[_0x0c02('0x6b')]=qs[_0x0c02('0x35')](_0x329ce9[_0x0c02('0x2c')][_0x0c02('0x35')]);_0x1988ed['where']=qs[_0x0c02('0x2e')](_['pick'](_0x329ce9[_0x0c02('0x2c')],_0x1aa886[_0x0c02('0x2e')]));if(_0x329ce9[_0x0c02('0x2c')][_0x0c02('0x38')]){_0x1988ed[_0x0c02('0x36')]=_[_0x0c02('0x39')](_0x1988ed[_0x0c02('0x36')],{'$or':_['map'](_0x1988ed[_0x0c02('0x31')],function(_0x18fc0f){var _0x1bacf9={};_0x1bacf9[_0x18fc0f]={'$like':'%'+_0x329ce9['query'][_0x0c02('0x38')]+'%'};return _0x1bacf9;})});}_0x1988ed=_[_0x0c02('0x39')]({},_0x1988ed,_0x329ce9[_0x0c02('0x3b')]);return _0x159fda['getSounds'](_0x1988ed);}})[_0x0c02('0x21')](function(_0x30276f){if(_0x30276f){_0x34e1cb=_0x30276f[_0x0c02('0x32')];if(!_0x329ce9['query'][_0x0c02('0x33')](_0x0c02('0x34'))){_0x1988ed[_0x0c02('0x19')]=qs[_0x0c02('0x19')](_0x329ce9['query'][_0x0c02('0x19')]);_0x1988ed['offset']=qs['offset'](_0x329ce9['query'][_0x0c02('0x18')]);}return _0x159fda[_0x0c02('0x6a')](_0x1988ed);}})[_0x0c02('0x21')](function(_0x209849){if(_0x209849){return _0x209849?{'count':_0x34e1cb,'rows':_0x209849}:null;}})[_0x0c02('0x21')](respondWithResult(_0x3a437f,null))['catch'](handleError(_0x3a437f,null));}; \ No newline at end of file +var _0x0ccc=['map','VoiceMusicOnHold','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','merge','include','findAll','rows','catch','show','params','length','includeAll','options','body','create','sequelize','mode','join','root','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','MusicOnHolds','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','rmdirSync','ValidationError','addSound','transaction','Sound','findOne','save_name','createdAt','%s.%s','extname','converted_format','server/files/moh','format','symlinkSync','Sequelize','message','removeSound','id2','getSounds','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','get','destroy','error','stack','name','send','index'];(function(_0x1fb57a,_0x148782){var _0x1716f4=function(_0x1f5072){while(--_0x1f5072){_0x1fb57a['push'](_0x1fb57a['shift']());}};_0x1716f4(++_0x148782);}(_0x0ccc,0xb5));var _0xc0cc=function(_0x20ddee,_0x504d08){_0x20ddee=_0x20ddee-0x0;var _0x55a343=_0x0ccc[_0x20ddee];return _0x55a343;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0cc('0x0'));var zipdir=require(_0xc0cc('0x1'));var jsonpatch=require(_0xc0cc('0x2'));var rp=require(_0xc0cc('0x3'));var moment=require(_0xc0cc('0x4'));var BPromise=require(_0xc0cc('0x5'));var Mustache=require(_0xc0cc('0x6'));var util=require(_0xc0cc('0x7'));var path=require('path');var sox=require(_0xc0cc('0x8'));var csv=require(_0xc0cc('0x9'));var ejs=require(_0xc0cc('0xa'));var fs=require('fs');var fs_extra=require(_0xc0cc('0xb'));var _=require(_0xc0cc('0xc'));var squel=require(_0xc0cc('0xd'));var crypto=require(_0xc0cc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc0cc('0xf'));var toCsv=require(_0xc0cc('0x9'));var querystring=require(_0xc0cc('0x10'));var Papa=require(_0xc0cc('0x11'));var Redis=require(_0xc0cc('0x12'));var authService=require(_0xc0cc('0x13'));var qs=require(_0xc0cc('0x14'));var as=require(_0xc0cc('0x15'));var hardwareService=require(_0xc0cc('0x16'));var logger=require('../../config/logger')(_0xc0cc('0x17'));var utils=require(_0xc0cc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc0cc('0x19'));var db=require(_0xc0cc('0x1a'))['db'];function respondWithStatusCode(_0x52f8bb,_0x7b073d){_0x7b073d=_0x7b073d||0xcc;return function(_0x5da0b6){if(_0x5da0b6){return _0x52f8bb[_0xc0cc('0x1b')](_0x7b073d);}return _0x52f8bb[_0xc0cc('0x1c')](_0x7b073d)[_0xc0cc('0x1d')]();};}function respondWithResult(_0x45850d,_0x22339c){_0x22339c=_0x22339c||0xc8;return function(_0x28b63a){if(_0x28b63a){return _0x45850d[_0xc0cc('0x1c')](_0x22339c)[_0xc0cc('0x1e')](_0x28b63a);}};}function respondWithFilteredResult(_0x1a3443,_0x30ede){return function(_0x48e735){if(_0x48e735){var _0x583f27=typeof _0x30ede['offset']===_0xc0cc('0x1f')&&typeof _0x30ede[_0xc0cc('0x20')]===_0xc0cc('0x1f');var _0x32283e=_0x48e735[_0xc0cc('0x21')];var _0x2fdf36=_0x583f27?0x0:_0x30ede[_0xc0cc('0x22')];var _0x11f66a=_0x583f27?_0x48e735[_0xc0cc('0x21')]:_0x30ede[_0xc0cc('0x22')]+_0x30ede[_0xc0cc('0x20')];var _0x2f8d13;if(_0x11f66a>=_0x32283e){_0x11f66a=_0x32283e;_0x2f8d13=0xc8;}else{_0x2f8d13=0xce;}_0x1a3443['status'](_0x2f8d13);return _0x1a3443[_0xc0cc('0x23')](_0xc0cc('0x24'),_0x2fdf36+'-'+_0x11f66a+'/'+_0x32283e)['json'](_0x48e735);}return null;};}function patchUpdates(_0xfad3dd){return function(_0x3504c8){try{jsonpatch['apply'](_0x3504c8,_0xfad3dd,!![]);}catch(_0x210f4e){return BPromise['reject'](_0x210f4e);}return _0x3504c8[_0xc0cc('0x25')]();};}function saveUpdates(_0xb346f8,_0x2e1040){return function(_0xcb9de){if(_0xcb9de){return _0xcb9de[_0xc0cc('0x26')](_0xb346f8)[_0xc0cc('0x27')](function(_0x3d7697){return _0x3d7697;});}return null;};}function removeEntity(_0x337434,_0x4dfac7){return function(_0x24f8e5){if(_0x24f8e5){return _0x24f8e5['destroy']()[_0xc0cc('0x27')](function(){var _0x548972=_0x24f8e5[_0xc0cc('0x28')]({'plain':!![]});var _0x2fe1b9='MusicOnHolds';return db['UserProfileResource'][_0xc0cc('0x29')]({'where':{'type':_0x2fe1b9,'resourceId':_0x548972['id']}})[_0xc0cc('0x27')](function(){return _0x24f8e5;});})[_0xc0cc('0x27')](function(){_0x337434[_0xc0cc('0x1c')](0xcc)[_0xc0cc('0x1d')]();});}};}function handleEntityNotFound(_0xbeb27f,_0x4e3867){return function(_0x5e9f10){if(!_0x5e9f10){_0xbeb27f[_0xc0cc('0x1b')](0x194);}return _0x5e9f10;};}function handleError(_0x44f7aa,_0x245f78){_0x245f78=_0x245f78||0x1f4;return function(_0xe6231c){logger[_0xc0cc('0x2a')](_0xe6231c[_0xc0cc('0x2b')]);if(_0xe6231c['name']){delete _0xe6231c[_0xc0cc('0x2c')];}_0x44f7aa[_0xc0cc('0x1c')](_0x245f78)[_0xc0cc('0x2d')](_0xe6231c);};}exports[_0xc0cc('0x2e')]=function(_0x3c47a2,_0x1ab305){var _0x41b30a={},_0x31bd79={},_0x2e1471={'count':0x0,'rows':[]};var _0x5672d8=_[_0xc0cc('0x2f')](db[_0xc0cc('0x30')][_0xc0cc('0x31')],function(_0x5281dc){return{'name':_0x5281dc['fieldName'],'type':_0x5281dc['type'][_0xc0cc('0x32')]};});_0x31bd79[_0xc0cc('0x33')]=_[_0xc0cc('0x2f')](_0x5672d8,_0xc0cc('0x2c'));_0x31bd79['query']=_[_0xc0cc('0x34')](_0x3c47a2[_0xc0cc('0x35')]);_0x31bd79[_0xc0cc('0x36')]=_[_0xc0cc('0x37')](_0x31bd79[_0xc0cc('0x33')],_0x31bd79[_0xc0cc('0x35')]);_0x41b30a['attributes']=_[_0xc0cc('0x37')](_0x31bd79['model'],qs[_0xc0cc('0x38')](_0x3c47a2[_0xc0cc('0x35')]['fields']));_0x41b30a[_0xc0cc('0x39')]=_0x41b30a[_0xc0cc('0x39')]['length']?_0x41b30a['attributes']:_0x31bd79[_0xc0cc('0x33')];if(!_0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x3a')]('nolimit')){_0x41b30a[_0xc0cc('0x20')]=qs[_0xc0cc('0x20')](_0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x20')]);_0x41b30a[_0xc0cc('0x22')]=qs['offset'](_0x3c47a2['query'][_0xc0cc('0x22')]);}_0x41b30a[_0xc0cc('0x3b')]=qs[_0xc0cc('0x3c')](_0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x3c')]);delete _0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x3c')];_0x41b30a['where']=qs[_0xc0cc('0x36')](_[_0xc0cc('0x3d')](_0x3c47a2[_0xc0cc('0x35')],_0x31bd79['filters']),_0x5672d8);if(_0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x3e')]){_0x41b30a[_0xc0cc('0x3f')]=_['merge'](_0x41b30a[_0xc0cc('0x3f')],{'$or':_['map'](_0x5672d8,function(_0x2a97a1){if(_0x2a97a1[_0xc0cc('0x40')]!==_0xc0cc('0x41')){var _0x3a7d5f={};_0x3a7d5f[_0x2a97a1[_0xc0cc('0x2c')]]={'$like':'%'+_0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x3e')]+'%'};return _0x3a7d5f;}})});}_0x41b30a=_[_0xc0cc('0x42')]({},_0x41b30a,_0x3c47a2['options']);var _0x52b6fc={'where':_0x41b30a[_0xc0cc('0x3f')]};return db[_0xc0cc('0x30')][_0xc0cc('0x21')](_0x52b6fc)[_0xc0cc('0x27')](function(_0x2cff85){_0x2e1471['count']=_0x2cff85;if(_0x3c47a2[_0xc0cc('0x35')]['includeAll']){_0x41b30a[_0xc0cc('0x43')]=[{'all':!![]}];}return db[_0xc0cc('0x30')][_0xc0cc('0x44')](_0x41b30a);})['then'](function(_0x20f75c){_0x2e1471[_0xc0cc('0x45')]=_0x20f75c;return _0x2e1471;})[_0xc0cc('0x27')](respondWithFilteredResult(_0x1ab305,_0x41b30a))[_0xc0cc('0x46')](handleError(_0x1ab305,null));};exports[_0xc0cc('0x47')]=function(_0x108a24,_0x4c4fb1){var _0x16f5ca={'raw':![],'where':{'id':_0x108a24[_0xc0cc('0x48')]['id']}},_0x5603aa={};_0x5603aa[_0xc0cc('0x33')]=_[_0xc0cc('0x34')](db[_0xc0cc('0x30')][_0xc0cc('0x31')]);_0x5603aa['query']=_['keys'](_0x108a24['query']);_0x5603aa['filters']=_['intersection'](_0x5603aa[_0xc0cc('0x33')],_0x5603aa[_0xc0cc('0x35')]);_0x16f5ca[_0xc0cc('0x39')]=_['intersection'](_0x5603aa[_0xc0cc('0x33')],qs[_0xc0cc('0x38')](_0x108a24[_0xc0cc('0x35')][_0xc0cc('0x38')]));_0x16f5ca[_0xc0cc('0x39')]=_0x16f5ca[_0xc0cc('0x39')][_0xc0cc('0x49')]?_0x16f5ca[_0xc0cc('0x39')]:_0x5603aa[_0xc0cc('0x33')];if(_0x108a24[_0xc0cc('0x35')][_0xc0cc('0x4a')]){_0x16f5ca[_0xc0cc('0x43')]=[{'all':!![]}];}_0x16f5ca=_[_0xc0cc('0x42')]({},_0x16f5ca,_0x108a24[_0xc0cc('0x4b')]);return db['VoiceMusicOnHold']['find'](_0x16f5ca)[_0xc0cc('0x27')](handleEntityNotFound(_0x4c4fb1,null))[_0xc0cc('0x27')](respondWithResult(_0x4c4fb1,null))[_0xc0cc('0x46')](handleError(_0x4c4fb1,null));};exports[_0xc0cc('0x26')]=function(_0x23ea8d,_0x54877e){if(_0x23ea8d['body']['id']){delete _0x23ea8d[_0xc0cc('0x4c')]['id'];}return db[_0xc0cc('0x30')]['find']({'where':{'id':_0x23ea8d[_0xc0cc('0x48')]['id']}})[_0xc0cc('0x27')](handleEntityNotFound(_0x54877e,null))[_0xc0cc('0x27')](saveUpdates(_0x23ea8d[_0xc0cc('0x4c')],null))[_0xc0cc('0x27')](respondWithResult(_0x54877e,null))[_0xc0cc('0x46')](handleError(_0x54877e,null));};exports[_0xc0cc('0x4d')]=function(_0x58aee5,_0x300dad,_0x23b376){return db[_0xc0cc('0x4e')]['transaction'](function(_0x194828){if(_0x58aee5['body'][_0xc0cc('0x4f')]==='files'){_0x58aee5['body']['directory']=path[_0xc0cc('0x50')](config[_0xc0cc('0x51')],'server/files/moh',_0x58aee5['body'][_0xc0cc('0x2c')]);}return db[_0xc0cc('0x30')][_0xc0cc('0x4d')](_0x58aee5[_0xc0cc('0x4c')],{'transaction':_0x194828})['then'](function(_0x3bce43){if(_0x58aee5[_0xc0cc('0x4c')][_0xc0cc('0x4f')]==='files'){fs[_0xc0cc('0x52')](_0x3bce43[_0xc0cc('0x53')],parseInt(_0xc0cc('0x54'),0x8));}var _0x52a501=_0x58aee5[_0xc0cc('0x55')]['get']({'plain':!![]});if(!_0x52a501)throw new Error(_0xc0cc('0x56'));if(_0x52a501[_0xc0cc('0x57')]===_0xc0cc('0x55')){var _0x2f2a3d=_0x3bce43[_0xc0cc('0x28')]({'plain':!![]});return db[_0xc0cc('0x58')][_0xc0cc('0x59')]({'where':{'name':_0xc0cc('0x5a'),'userProfileId':_0x52a501['userProfileId']},'raw':!![]})[_0xc0cc('0x27')](function(_0x1fad5d){if(_0x1fad5d&&_0x1fad5d['autoAssociation']===0x0){return db[_0xc0cc('0x5b')][_0xc0cc('0x4d')]({'name':_0x2f2a3d[_0xc0cc('0x2c')],'resourceId':_0x2f2a3d['id'],'type':_0x1fad5d[_0xc0cc('0x2c')],'sectionId':_0x1fad5d['id']},{})[_0xc0cc('0x27')](function(){return _0x3bce43;});}else{return _0x3bce43;}})[_0xc0cc('0x46')](function(_0x34642a){logger[_0xc0cc('0x2a')](_0xc0cc('0x5c'),_0x34642a);});}return _0x3bce43;});})[_0xc0cc('0x27')](respondWithResult(_0x300dad,0xc9))[_0xc0cc('0x46')](handleError(_0x300dad,null));};exports[_0xc0cc('0x29')]=function(_0x1a098a,_0x2ef855,_0x46a0a4){var _0x582ce1;return db[_0xc0cc('0x30')][_0xc0cc('0x59')]({'where':{'id':_0x1a098a['params']['id']}})[_0xc0cc('0x27')](function(_0x5e5184){if(_0x5e5184){return db[_0xc0cc('0x4e')]['transaction'](function(_0x495eb1){return _0x5e5184[_0xc0cc('0x29')]({'transaction':_0x495eb1,'raw':!![]})['then'](function(_0x4cb886){if(_0x4cb886[_0xc0cc('0x53')]){fs['readdirSync'](_0x4cb886['directory'])['forEach'](function(_0x65aa06){fs[_0xc0cc('0x5d')](path[_0xc0cc('0x50')](_0x4cb886[_0xc0cc('0x53')],_0x65aa06));});fs[_0xc0cc('0x5e')](_0x4cb886['directory']);}return _0x4cb886;});})[_0xc0cc('0x46')](function(_0x556fd1){throw new db['Sequelize'][(_0xc0cc('0x5f'))](_0x556fd1['message']);});}})['then'](handleEntityNotFound(_0x2ef855,null))[_0xc0cc('0x27')](removeEntity(_0x2ef855,null))['catch'](handleError(_0x2ef855,null));};exports[_0xc0cc('0x60')]=function(_0x37d341,_0x7d32cd,_0x3b5f70){return db[_0xc0cc('0x4e')][_0xc0cc('0x61')](function(_0x360125){var _0x2fb3ff;return db[_0xc0cc('0x30')]['find']({'where':{'id':_0x37d341[_0xc0cc('0x48')]['id']}})[_0xc0cc('0x27')](function(_0xd81a43){if(_0xd81a43){_0x2fb3ff=_0xd81a43;return _0xd81a43[_0xc0cc('0x60')](_0x37d341['body']['id'],{'transaction':_0x360125});}})['then'](function(_0x49eef6){if(_0x49eef6){return db[_0xc0cc('0x62')][_0xc0cc('0x63')]({'where':{'id':_0x37d341[_0xc0cc('0x4c')]['id']},'attributes':['id',_0xc0cc('0x2c'),_0xc0cc('0x64'),'converted_format',_0xc0cc('0x65')],'raw':!![]});}})[_0xc0cc('0x27')](function(_0x16ee7f){if(_0x16ee7f){var _0x3eb36f=path[_0xc0cc('0x50')](config[_0xc0cc('0x51')],'server/files/sounds/converted',util['format'](_0xc0cc('0x66'),path['basename'](_0x16ee7f[_0xc0cc('0x64')],path[_0xc0cc('0x67')](_0x16ee7f[_0xc0cc('0x64')])),_0x16ee7f[_0xc0cc('0x68')]));var _0x3efc06=path[_0xc0cc('0x50')](config[_0xc0cc('0x51')],_0xc0cc('0x69'),_0x2fb3ff[_0xc0cc('0x2c')],util[_0xc0cc('0x6a')](_0xc0cc('0x66'),_0x16ee7f[_0xc0cc('0x2c')],_0x16ee7f[_0xc0cc('0x68')]));fs[_0xc0cc('0x6b')](_0x3eb36f,_0x3efc06);return _0x16ee7f;}})[_0xc0cc('0x46')](function(_0x307eda){throw new db[(_0xc0cc('0x6c'))][(_0xc0cc('0x5f'))](_0x307eda[_0xc0cc('0x6d')]);});})[_0xc0cc('0x27')](handleEntityNotFound(_0x7d32cd,null))['then'](respondWithResult(_0x7d32cd,0xc9))[_0xc0cc('0x46')](handleError(_0x7d32cd,null));};exports[_0xc0cc('0x6e')]=function(_0x4ceb67,_0x307a5a,_0x7cfde6){return db[_0xc0cc('0x4e')]['transaction'](function(_0x505173){var _0x29be0f;return db[_0xc0cc('0x30')][_0xc0cc('0x63')]({'where':{'id':_0x4ceb67[_0xc0cc('0x48')]['id']}})['then'](handleEntityNotFound(_0x307a5a,null))[_0xc0cc('0x27')](function(_0x41d1db){if(_0x41d1db){_0x29be0f=_0x41d1db;return _0x41d1db[_0xc0cc('0x6e')](_0x4ceb67['params']['id2']);}})['then'](function(_0x39cd71){if(_0x39cd71){return db['Sound'][_0xc0cc('0x63')]({'where':{'id':_0x4ceb67[_0xc0cc('0x48')][_0xc0cc('0x6f')]},'attributes':['id','name',_0xc0cc('0x64'),_0xc0cc('0x68'),_0xc0cc('0x65')],'raw':!![]});}})[_0xc0cc('0x27')](function(_0xcee41d){if(_0xcee41d){fs['unlinkSync'](path[_0xc0cc('0x50')](_0x29be0f[_0xc0cc('0x53')],util[_0xc0cc('0x6a')]('%s.%s',_0xcee41d[_0xc0cc('0x2c')],_0xcee41d['converted_format'])));return _0xcee41d;}})[_0xc0cc('0x46')](function(_0x127707){throw new db[(_0xc0cc('0x6c'))][(_0xc0cc('0x5f'))](_0x127707['message']);});})[_0xc0cc('0x27')](handleEntityNotFound(_0x307a5a,null))[_0xc0cc('0x27')](respondWithStatusCode(_0x307a5a,0xcc))[_0xc0cc('0x46')](handleError(_0x307a5a,null));};exports[_0xc0cc('0x70')]=function(_0x4c297c,_0x4a526b,_0x579ee2){var _0x2ca98a={};var _0x5d59d6={};var _0x5f0b97;var _0x151607;return db[_0xc0cc('0x30')][_0xc0cc('0x63')]({'where':{'id':_0x4c297c[_0xc0cc('0x48')]['id']}})[_0xc0cc('0x27')](handleEntityNotFound(_0x4a526b,null))[_0xc0cc('0x27')](function(_0x4d9d7d){if(_0x4d9d7d){_0x5f0b97=_0x4d9d7d;_0x5d59d6[_0xc0cc('0x33')]=_[_0xc0cc('0x34')](db['Sound'][_0xc0cc('0x31')]);_0x5d59d6[_0xc0cc('0x35')]=_[_0xc0cc('0x34')](_0x4c297c['query']);_0x5d59d6[_0xc0cc('0x36')]=_[_0xc0cc('0x37')](_0x5d59d6[_0xc0cc('0x33')],_0x5d59d6[_0xc0cc('0x35')]);_0x2ca98a[_0xc0cc('0x39')]=_[_0xc0cc('0x37')](_0x5d59d6['model'],qs[_0xc0cc('0x38')](_0x4c297c[_0xc0cc('0x35')][_0xc0cc('0x38')]));_0x2ca98a['attributes']=_0x2ca98a[_0xc0cc('0x39')][_0xc0cc('0x49')]?_0x2ca98a[_0xc0cc('0x39')]:_0x5d59d6[_0xc0cc('0x33')];_0x2ca98a[_0xc0cc('0x3b')]=qs['sort'](_0x4c297c[_0xc0cc('0x35')]['sort']);_0x2ca98a['where']=qs[_0xc0cc('0x36')](_[_0xc0cc('0x3d')](_0x4c297c['query'],_0x5d59d6[_0xc0cc('0x36')]));if(_0x4c297c['query']['filter']){_0x2ca98a[_0xc0cc('0x3f')]=_[_0xc0cc('0x42')](_0x2ca98a[_0xc0cc('0x3f')],{'$or':_[_0xc0cc('0x2f')](_0x2ca98a[_0xc0cc('0x39')],function(_0x1ae552){var _0x4adf41={};_0x4adf41[_0x1ae552]={'$like':'%'+_0x4c297c[_0xc0cc('0x35')][_0xc0cc('0x3e')]+'%'};return _0x4adf41;})});}_0x2ca98a=_[_0xc0cc('0x42')]({},_0x2ca98a,_0x4c297c[_0xc0cc('0x4b')]);return _0x5f0b97[_0xc0cc('0x70')](_0x2ca98a);}})['then'](function(_0x1440e3){if(_0x1440e3){_0x151607=_0x1440e3[_0xc0cc('0x49')];if(!_0x4c297c[_0xc0cc('0x35')][_0xc0cc('0x3a')](_0xc0cc('0x71'))){_0x2ca98a['limit']=qs[_0xc0cc('0x20')](_0x4c297c[_0xc0cc('0x35')][_0xc0cc('0x20')]);_0x2ca98a[_0xc0cc('0x22')]=qs[_0xc0cc('0x22')](_0x4c297c[_0xc0cc('0x35')][_0xc0cc('0x22')]);}return _0x5f0b97[_0xc0cc('0x70')](_0x2ca98a);}})[_0xc0cc('0x27')](function(_0x11e38d){if(_0x11e38d){return _0x11e38d?{'count':_0x151607,'rows':_0x11e38d}:null;}})[_0xc0cc('0x27')](respondWithResult(_0x4a526b,null))[_0xc0cc('0x46')](handleError(_0x4a526b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 4183d09..8f1af00 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3a2=['define','VoiceMusicOnHold','voice_musiconhold','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x2581c5,_0x1bad78){var _0x42800e=function(_0x2c1fe3){while(--_0x2c1fe3){_0x2581c5['push'](_0x2581c5['shift']());}};_0x42800e(++_0x1bad78);}(_0xa3a2,0x117));var _0x2a3a=function(_0x11a289,_0x54b41c){_0x11a289=_0x11a289-0x0;var _0x224679=_0xa3a2[_0x11a289];return _0x224679;};'use strict';var _=require(_0x2a3a('0x0'));var util=require(_0x2a3a('0x1'));var logger=require('../../config/logger')(_0x2a3a('0x2'));var moment=require('moment');var BPromise=require(_0x2a3a('0x3'));var rp=require(_0x2a3a('0x4'));var fs=require('fs');var path=require(_0x2a3a('0x5'));var rimraf=require(_0x2a3a('0x6'));var config=require(_0x2a3a('0x7'));var attributes=require(_0x2a3a('0x8'));module['exports']=function(_0x348237,_0x3fb4e9){return _0x348237[_0x2a3a('0x9')](_0x2a3a('0xa'),attributes,{'tableName':_0x2a3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47ce=['lodash','util','../../config/logger','api','moment','request-promise','path','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x6f645f,_0x41abbd){var _0x11affa=function(_0x4c75a8){while(--_0x4c75a8){_0x6f645f['push'](_0x6f645f['shift']());}};_0x11affa(++_0x41abbd);}(_0x47ce,0x13f));var _0xe47c=function(_0x3413bd,_0x244c45){_0x3413bd=_0x3413bd-0x0;var _0x145e8e=_0x47ce[_0x3413bd];return _0x145e8e;};'use strict';var _=require(_0xe47c('0x0'));var util=require(_0xe47c('0x1'));var logger=require(_0xe47c('0x2'))(_0xe47c('0x3'));var moment=require(_0xe47c('0x4'));var BPromise=require('bluebird');var rp=require(_0xe47c('0x5'));var fs=require('fs');var path=require(_0xe47c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe47c('0x7'));module[_0xe47c('0x8')]=function(_0x1501ae,_0x44538e){return _0x1501ae[_0xe47c('0x9')](_0xe47c('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 2689cda..d570d63 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x3a30ba,_0x4b8af8){var _0x1f0494=function(_0x164b43){while(--_0x164b43){_0x3a30ba['push'](_0x3a30ba['shift']());}};_0x1f0494(++_0x4b8af8);}(_0xedd9,0xfc));var _0x9edd=function(_0x44d9b9,_0x409a69){_0x44d9b9=_0x44d9b9-0x0;var _0x47493f=_0xedd9[_0x44d9b9];return _0x47493f;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xd84e21,_0x1365e6){var _0xa52c5f=function(_0x3c8a90){while(--_0x3c8a90){_0xd84e21['push'](_0xd84e21['shift']());}};_0xa52c5f(++_0x1365e6);}(_0x70e0,0x17b));var _0x070e=function(_0x376e45,_0x292900){_0x376e45=_0x376e45-0x0;var _0x5008ab=_0x70e0[_0x376e45];return _0x5008ab;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 598e2c9..b3774fc 100644 --- a/server/api/voicePrefix/index.js +++ b/server/api/voicePrefix/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5f7=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','/:id','delete','destroy','removeAgents','removeTeams','exports','multer'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xe5f7,0x178));var _0x7e5f=function(_0x556732,_0x23c13b){_0x556732=_0x556732-0x0;var _0x32f5ce=_0xe5f7[_0x556732];return _0x32f5ce;};'use strict';var multer=require(_0x7e5f('0x0'));var util=require(_0x7e5f('0x1'));var path=require(_0x7e5f('0x2'));var timeout=require(_0x7e5f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7e5f('0x4'));var auth=require(_0x7e5f('0x5'));var interaction=require(_0x7e5f('0x6'));var config=require('../../config/environment');var controller=require(_0x7e5f('0x7'));router[_0x7e5f('0x8')]('/',auth['isAuthenticated'](),controller[_0x7e5f('0x9')]);router[_0x7e5f('0x8')](_0x7e5f('0xa'),auth[_0x7e5f('0xb')](),controller[_0x7e5f('0xc')]);router[_0x7e5f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7e5f('0xd')]);router[_0x7e5f('0x8')](_0x7e5f('0xe'),auth[_0x7e5f('0xb')](),controller[_0x7e5f('0xf')]);router[_0x7e5f('0x8')](_0x7e5f('0x10'),auth[_0x7e5f('0xb')](),controller[_0x7e5f('0x11')]);router[_0x7e5f('0x12')]('/',auth['isAuthenticated'](),controller[_0x7e5f('0x13')]);router['post'](_0x7e5f('0xe'),auth[_0x7e5f('0xb')](),controller[_0x7e5f('0x14')]);router[_0x7e5f('0x12')](_0x7e5f('0x10'),auth[_0x7e5f('0xb')](),controller[_0x7e5f('0x15')]);router[_0x7e5f('0x16')](_0x7e5f('0x17'),auth[_0x7e5f('0xb')](),controller['update']);router[_0x7e5f('0x18')](_0x7e5f('0x17'),auth[_0x7e5f('0xb')](),controller[_0x7e5f('0x19')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x7e5f('0x1a')]);router[_0x7e5f('0x18')]('/:id/teams',auth[_0x7e5f('0xb')](),controller[_0x7e5f('0x1b')]);module[_0x7e5f('0x1c')]=router; \ No newline at end of file +var _0xc992=['delete','destroy','removeAgents','removeTeams','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/users','/:id/teams','post','create','addAgents','addTeams','put','update'];(function(_0x5e3a59,_0x5e5af8){var _0x4c8605=function(_0x346521){while(--_0x346521){_0x5e3a59['push'](_0x5e3a59['shift']());}};_0x4c8605(++_0x5e5af8);}(_0xc992,0xbb));var _0x2c99=function(_0x5bea0d,_0x32f9db){_0x5bea0d=_0x5bea0d-0x0;var _0x2542c5=_0xc992[_0x5bea0d];return _0x2542c5;};'use strict';var multer=require(_0x2c99('0x0'));var util=require('util');var path=require(_0x2c99('0x1'));var timeout=require(_0x2c99('0x2'));var express=require('express');var router=express[_0x2c99('0x3')]();var fs_extra=require(_0x2c99('0x4'));var auth=require(_0x2c99('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c99('0x6'));var controller=require('./voicePrefix.controller');router[_0x2c99('0x7')]('/',auth[_0x2c99('0x8')](),controller[_0x2c99('0x9')]);router[_0x2c99('0x7')](_0x2c99('0xa'),auth[_0x2c99('0x8')](),controller['describe']);router[_0x2c99('0x7')](_0x2c99('0xb'),auth[_0x2c99('0x8')](),controller[_0x2c99('0xc')]);router['get'](_0x2c99('0xd'),auth[_0x2c99('0x8')](),controller['getAgents']);router[_0x2c99('0x7')](_0x2c99('0xe'),auth[_0x2c99('0x8')](),controller['getTeams']);router[_0x2c99('0xf')]('/',auth[_0x2c99('0x8')](),controller[_0x2c99('0x10')]);router[_0x2c99('0xf')](_0x2c99('0xd'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x11')]);router[_0x2c99('0xf')](_0x2c99('0xe'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x12')]);router[_0x2c99('0x13')]('/:id',auth[_0x2c99('0x8')](),controller[_0x2c99('0x14')]);router[_0x2c99('0x15')](_0x2c99('0xb'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x16')]);router[_0x2c99('0x15')]('/:id/users',auth[_0x2c99('0x8')](),controller[_0x2c99('0x17')]);router[_0x2c99('0x15')](_0x2c99('0xe'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x18')]);module[_0x2c99('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 0573aaa..bd805ac 100644 --- a/server/api/voicePrefix/voicePrefix.attributes.js +++ b/server/api/voicePrefix/voicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b95=['system-','getDataValue','sequelize','exports','STRING','name'];(function(_0x200295,_0x288367){var _0x5e3836=function(_0x2e4704){while(--_0x2e4704){_0x200295['push'](_0x200295['shift']());}};_0x5e3836(++_0x288367);}(_0x9b95,0xec));var _0x59b9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9b95[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x59b9('0x0'));module[_0x59b9('0x1')]={'name':{'type':Sequelize[_0x59b9('0x2')],'allowNull':![],'unique':_0x59b9('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x55b7f9){return _0x59b9('0x4')+this[_0x59b9('0x5')](_0x59b9('0x3'))+'-';}},'description':{'type':Sequelize[_0x59b9('0x2')]},'callerIdAll':{'type':Sequelize[_0x59b9('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb606=['name','INTEGER','sequelize','STRING','VIRTUAL','getDataValue'];(function(_0x4752ff,_0x52acb2){var _0x2246de=function(_0x54a8de){while(--_0x54a8de){_0x4752ff['push'](_0x4752ff['shift']());}};_0x2246de(++_0x52acb2);}(_0xb606,0x16a));var _0x6b60=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0xb606[_0x17b0d4];return _0x2d02c7;};'use strict';var Sequelize=require(_0x6b60('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b60('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x6b60('0x2')],'get':function(_0x2815dc){return'system-'+this[_0x6b60('0x3')](_0x6b60('0x4'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x6b60('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 13a56ea..db5af9d 100644 --- a/server/api/voicePrefix/voicePrefix.controller.js +++ b/server/api/voicePrefix/voicePrefix.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x160f=['forEach','removeTeams','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','name','send','index','map','VoicePrefix','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','type','system','description','Voice\x20Prefix\x20Extension','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','sequelize','VoiceExtensionId','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','nolimit','Team','getTeams','Agents','online','voicePause','interface','transaction','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf160('0x0'));var rimraf=require(_0xf160('0x1'));var zipdir=require(_0xf160('0x2'));var jsonpatch=require(_0xf160('0x3'));var rp=require('request-promise');var moment=require(_0xf160('0x4'));var BPromise=require(_0xf160('0x5'));var Mustache=require(_0xf160('0x6'));var util=require(_0xf160('0x7'));var path=require(_0xf160('0x8'));var sox=require(_0xf160('0x9'));var csv=require('to-csv');var ejs=require(_0xf160('0xa'));var fs=require('fs');var fs_extra=require(_0xf160('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf160('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf160('0xd'));var Papa=require(_0xf160('0xe'));var Redis=require(_0xf160('0xf'));var authService=require(_0xf160('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf160('0x11'));var logger=require(_0xf160('0x12'))(_0xf160('0x13'));var utils=require('../../config/utils');var config=require(_0xf160('0x14'));var licenseUtil=require(_0xf160('0x15'));var db=require(_0xf160('0x16'))['db'];config[_0xf160('0x17')]=_[_0xf160('0x18')](config['redis'],{'host':_0xf160('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf160('0x17')]));require(_0xf160('0x1a'))[_0xf160('0x1b')](socket);function respondWithStatusCode(_0x2bb6c7,_0x3a4faa){_0x3a4faa=_0x3a4faa||0xcc;return function(_0x31f7ae){if(_0x31f7ae){return _0x2bb6c7[_0xf160('0x1c')](_0x3a4faa);}return _0x2bb6c7[_0xf160('0x1d')](_0x3a4faa)[_0xf160('0x1e')]();};}function respondWithResult(_0x59ac02,_0x477e4d){_0x477e4d=_0x477e4d||0xc8;return function(_0x400bda){if(_0x400bda){return _0x59ac02[_0xf160('0x1d')](_0x477e4d)[_0xf160('0x1f')](_0x400bda);}};}function respondWithFilteredResult(_0x51824b,_0x36a978){return function(_0x4b8185){if(_0x4b8185){var _0x5388c7=typeof _0x36a978[_0xf160('0x20')]===_0xf160('0x21')&&typeof _0x36a978[_0xf160('0x22')]===_0xf160('0x21');var _0x205afa=_0x4b8185[_0xf160('0x23')];var _0x2a8cb4=_0x5388c7?0x0:_0x36a978[_0xf160('0x20')];var _0x4a58d9=_0x5388c7?_0x4b8185[_0xf160('0x23')]:_0x36a978[_0xf160('0x20')]+_0x36a978[_0xf160('0x22')];var _0x5ad173;if(_0x4a58d9>=_0x205afa){_0x4a58d9=_0x205afa;_0x5ad173=0xc8;}else{_0x5ad173=0xce;}_0x51824b[_0xf160('0x1d')](_0x5ad173);return _0x51824b[_0xf160('0x24')](_0xf160('0x25'),_0x2a8cb4+'-'+_0x4a58d9+'/'+_0x205afa)[_0xf160('0x1f')](_0x4b8185);}return null;};}function patchUpdates(_0x2e03c8){return function(_0x1b0081){try{jsonpatch[_0xf160('0x26')](_0x1b0081,_0x2e03c8,!![]);}catch(_0x5a72d1){return BPromise[_0xf160('0x27')](_0x5a72d1);}return _0x1b0081[_0xf160('0x28')]();};}function saveUpdates(_0x305f6a,_0x49bb5c){return function(_0x578f7d){if(_0x578f7d){return _0x578f7d[_0xf160('0x29')](_0x305f6a)[_0xf160('0x2a')](function(_0x4a8003){return _0x4a8003;});}return null;};}function removeEntity(_0x487c0c,_0x168a09){return function(_0x1cc04c){if(_0x1cc04c){return _0x1cc04c[_0xf160('0x2b')]()['then'](function(){var _0xcfa9bd=_0x1cc04c[_0xf160('0x2c')]({'plain':!![]});var _0x2851e8=_0xf160('0x2d');return db[_0xf160('0x2e')][_0xf160('0x2b')]({'where':{'type':_0x2851e8,'resourceId':_0xcfa9bd['id']}})['then'](function(){return _0x1cc04c;});})['then'](function(){_0x487c0c['status'](0xcc)[_0xf160('0x1e')]();});}};}function handleEntityNotFound(_0x16a5fa,_0xcaab39){return function(_0x26e06b){if(!_0x26e06b){_0x16a5fa[_0xf160('0x1c')](0x194);}return _0x26e06b;};}function handleError(_0x563103,_0x55f9c3){_0x55f9c3=_0x55f9c3||0x1f4;return function(_0x329d6b){logger['error'](_0x329d6b['stack']);if(_0x329d6b[_0xf160('0x2f')]){delete _0x329d6b[_0xf160('0x2f')];}_0x563103['status'](_0x55f9c3)[_0xf160('0x30')](_0x329d6b);};}exports[_0xf160('0x31')]=function(_0x4ab048,_0x528dff){var _0x4b3ef4={},_0x54d17f={},_0x3e7720={'count':0x0,'rows':[]};var _0x2bb5c4=_[_0xf160('0x32')](db[_0xf160('0x33')][_0xf160('0x34')],function(_0x26fc8b){return{'name':_0x26fc8b['fieldName'],'type':_0x26fc8b['type']['key']};});_0x54d17f[_0xf160('0x35')]=_['map'](_0x2bb5c4,'name');_0x54d17f[_0xf160('0x36')]=_[_0xf160('0x37')](_0x4ab048['query']);_0x54d17f[_0xf160('0x38')]=_[_0xf160('0x39')](_0x54d17f[_0xf160('0x35')],_0x54d17f[_0xf160('0x36')]);_0x4b3ef4[_0xf160('0x3a')]=_['intersection'](_0x54d17f[_0xf160('0x35')],qs[_0xf160('0x3b')](_0x4ab048[_0xf160('0x36')]['fields']));_0x4b3ef4[_0xf160('0x3a')]=_0x4b3ef4[_0xf160('0x3a')][_0xf160('0x3c')]?_0x4b3ef4[_0xf160('0x3a')]:_0x54d17f[_0xf160('0x35')];if(!_0x4ab048[_0xf160('0x36')]['hasOwnProperty']('nolimit')){_0x4b3ef4[_0xf160('0x22')]=qs[_0xf160('0x22')](_0x4ab048[_0xf160('0x36')][_0xf160('0x22')]);_0x4b3ef4[_0xf160('0x20')]=qs[_0xf160('0x20')](_0x4ab048[_0xf160('0x36')][_0xf160('0x20')]);}_0x4b3ef4[_0xf160('0x3d')]=qs[_0xf160('0x3e')](_0x4ab048[_0xf160('0x36')][_0xf160('0x3e')]);_0x4b3ef4[_0xf160('0x3f')]=qs[_0xf160('0x38')](_[_0xf160('0x40')](_0x4ab048[_0xf160('0x36')],_0x54d17f[_0xf160('0x38')]),_0x2bb5c4);if(_0x4ab048[_0xf160('0x36')][_0xf160('0x41')]){_0x4b3ef4[_0xf160('0x3f')]=_[_0xf160('0x42')](_0x4b3ef4[_0xf160('0x3f')],{'$or':_[_0xf160('0x32')](_0x2bb5c4,function(_0x1bdc44){if(_0x1bdc44['type']!==_0xf160('0x43')){var _0x476c31={};_0x476c31[_0x1bdc44[_0xf160('0x2f')]]={'$like':'%'+_0x4ab048[_0xf160('0x36')][_0xf160('0x41')]+'%'};return _0x476c31;}})});}_0x4b3ef4=_[_0xf160('0x42')]({},_0x4b3ef4,_0x4ab048[_0xf160('0x44')]);var _0x4f65c9={'where':_0x4b3ef4[_0xf160('0x3f')]};return db['VoicePrefix'][_0xf160('0x23')](_0x4f65c9)[_0xf160('0x2a')](function(_0x530fc5){_0x3e7720[_0xf160('0x23')]=_0x530fc5;if(_0x4ab048[_0xf160('0x36')][_0xf160('0x45')]){_0x4b3ef4[_0xf160('0x46')]=[{'all':!![]}];}return db[_0xf160('0x33')][_0xf160('0x47')](_0x4b3ef4);})[_0xf160('0x2a')](function(_0x4f5eba){_0x3e7720[_0xf160('0x48')]=_0x4f5eba;return _0x3e7720;})[_0xf160('0x2a')](respondWithFilteredResult(_0x528dff,_0x4b3ef4))[_0xf160('0x49')](handleError(_0x528dff,null));};exports[_0xf160('0x4a')]=function(_0x3e4f0e,_0x2caefa){var _0x33bef9={'raw':![],'where':{'id':_0x3e4f0e[_0xf160('0x4b')]['id']}},_0x15b31a={};_0x15b31a[_0xf160('0x35')]=_[_0xf160('0x37')](db['VoicePrefix']['rawAttributes']);_0x15b31a[_0xf160('0x36')]=_[_0xf160('0x37')](_0x3e4f0e[_0xf160('0x36')]);_0x15b31a[_0xf160('0x38')]=_[_0xf160('0x39')](_0x15b31a[_0xf160('0x35')],_0x15b31a['query']);_0x33bef9[_0xf160('0x3a')]=_['intersection'](_0x15b31a['model'],qs[_0xf160('0x3b')](_0x3e4f0e[_0xf160('0x36')]['fields']));_0x33bef9['attributes']=_0x33bef9[_0xf160('0x3a')][_0xf160('0x3c')]?_0x33bef9[_0xf160('0x3a')]:_0x15b31a[_0xf160('0x35')];if(_0x3e4f0e['query']['includeAll']){_0x33bef9['include']=[{'all':!![]}];}_0x33bef9=_['merge']({},_0x33bef9,_0x3e4f0e[_0xf160('0x44')]);return db['VoicePrefix'][_0xf160('0x4c')](_0x33bef9)[_0xf160('0x2a')](handleEntityNotFound(_0x2caefa,null))[_0xf160('0x2a')](respondWithResult(_0x2caefa,null))[_0xf160('0x49')](handleError(_0x2caefa,null));};exports['destroy']=function(_0x45af83,_0x283f55){return db[_0xf160('0x33')]['find']({'where':{'id':_0x45af83[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x283f55,null))[_0xf160('0x2a')](removeEntity(_0x283f55,null))['catch'](handleError(_0x283f55,null));};exports[_0xf160('0x4d')]=function(_0x6d8c9b,_0x409e7d){return db[_0xf160('0x33')][_0xf160('0x4d')]()['then'](respondWithResult(_0x409e7d,null))['catch'](handleError(_0x409e7d,null));};exports[_0xf160('0x4e')]=function(_0x5d81b9,_0x1d5168){var _0xf31056;return db['sequelize']['transaction'](function(_0x321309){return db[_0xf160('0x33')]['create'](_0x5d81b9[_0xf160('0x4f')],{'transaction':_0x321309})[_0xf160('0x2a')](function(_0x28605d){_0xf31056=_0x28605d[_0xf160('0x2c')]({'plain':!![]});return db['VoiceExtension'][_0xf160('0x4c')]({'where':{'id':_0xf31056['VoiceExtensionId']},'raw':!![]})[_0xf160('0x2a')](function(_0x1b3ec0){return createVoicePrefixExtensions(_0xf31056,_0x1b3ec0,_0x321309);});});})[_0xf160('0x2a')](function(){var _0x170ca4=_0x5d81b9[_0xf160('0x50')]['get']({'plain':!![]});if(!_0x170ca4)throw new Error(_0xf160('0x51'));if(_0x170ca4['role']===_0xf160('0x50')){var _0x1229cd=_0xf31056;return db[_0xf160('0x52')][_0xf160('0x4c')]({'where':{'name':_0xf160('0x2d'),'userProfileId':_0x170ca4[_0xf160('0x53')]},'raw':!![]})[_0xf160('0x2a')](function(_0x12c22){if(_0x12c22&&_0x12c22[_0xf160('0x54')]===0x0){return db[_0xf160('0x2e')]['create']({'name':_0x1229cd['name'],'resourceId':_0x1229cd['id'],'type':_0x12c22[_0xf160('0x2f')],'sectionId':_0x12c22['id']},{})[_0xf160('0x2a')](function(){return _0xf31056;});}else{return _0xf31056;}})['catch'](function(_0x12083d){logger[_0xf160('0x55')](_0xf160('0x56'),_0x12083d);throw _0x12083d;});}return _0xf31056;})['then'](respondWithResult(_0x1d5168,null))['catch'](handleError(_0x1d5168,null));};function Extension(_0x12ab32,_0x352ddb,_0x5eeab6,_0x3243c6){this[_0xf160('0x57')]='from-sip';this[_0xf160('0x58')]=_0x12ab32;this[_0xf160('0x59')]=_0x5eeab6;this[_0xf160('0x5a')]=_0xf160('0x5b');this[_0xf160('0x5c')]=_0xf160('0x5d');this['priority']=_0x352ddb;this[_0xf160('0x5e')]=_0x3243c6;}function createVoicePrefixExtensions(_0x3dc02f,_0x30f750,_0x1364bc){return new BPromise(function(_0x38ee0f,_0x5a1be3){var _0x1d22bb=new Extension(formatPrefixName(_0x3dc02f['prefix']),0x1,_0xf160('0x5f'),_0xf160('0x60'));_0x1d22bb[_0xf160('0x61')]=_0x3dc02f['id'];return db[_0xf160('0x62')][_0xf160('0x4e')](_0x1d22bb,{'transaction':_0x1364bc})[_0xf160('0x2a')](function(_0x492d5b){var _0x32ec90=_0x492d5b[_0xf160('0x2c')]({'plain':!![]});var _0x291320=_[_0xf160('0x32')](addVoicePrefixExtensions(_0x3dc02f,_0x30f750),function(_0x40e5a1){_0x40e5a1['VoiceExtensionId']=_0x32ec90['id'];_0x40e5a1['VoicePrefixId']=_0x3dc02f['id'];return _0x40e5a1;});return db[_0xf160('0x62')][_0xf160('0x63')](_0x291320,{'transaction':_0x1364bc})[_0xf160('0x2a')](function(_0x3d8c6c){if(!_0x3d8c6c){return _0x5a1be3(_0xf160('0x64'));}else{return _0x38ee0f(_0x3d8c6c);}})[_0xf160('0x49')](function(_0x4c151f){return _0x5a1be3(_0x4c151f);});});;});};function addVoicePrefixExtensions(_0x25f79e,_0x27332f){var _0x351fa9=[];var _0x352063=formatPrefixName(_0x25f79e[_0xf160('0x65')]);_0x351fa9[_0xf160('0x66')](new Extension(_0x352063,0x2,_0xf160('0x67'),_0xf160('0x68')+_0x25f79e['name']));if(_0x25f79e[_0xf160('0x69')]){_0x351fa9['push'](new Extension(_0x352063,0x3,_0xf160('0x67'),_0xf160('0x6a')+_0x25f79e[_0xf160('0x69')]));}else{_0x351fa9[_0xf160('0x66')](new Extension(_0x352063,0x3,_0xf160('0x5f'),_0xf160('0x6b')));}_0x351fa9['push'](new Extension(_0x352063,0x4,_0xf160('0x6c'),_0x27332f[_0xf160('0x57')]+','+_0xf160('0x6d')+(0x8+_0x25f79e['name'][_0xf160('0x3c')])+'}'+','+0x1));return _0x351fa9;}function formatPrefixName(_0x407a4a){var _0x4db1df='_';for(var _0x1db588=0x0;_0x1db588<_0x407a4a[_0xf160('0x3c')];_0x1db588++){if(_0x407a4a[_0xf160('0x6e')](_0x1db588)=='-'){_0x4db1df+=_0x407a4a['charAt'](_0x1db588);}else{_0x4db1df+='['+_0x407a4a[_0xf160('0x6e')](_0x1db588)+']';}}_0x4db1df+='.';return _0x4db1df;}exports[_0xf160('0x29')]=function(_0x4265e1,_0x4b9d21,_0xc78642){var _0x136919=_0x4265e1[_0xf160('0x4f')];_0x136919[_0xf160('0x65')]=_0xf160('0x6f')+_0x136919[_0xf160('0x2f')]+'-';return db[_0xf160('0x70')]['transaction'](function(_0x797ba1){return db[_0xf160('0x33')][_0xf160('0x29')](_0x136919,{'where':{'id':_0x136919['id']},'transaction':_0x797ba1})['then'](function(){return db[_0xf160('0x62')][_0xf160('0x2b')]({'where':{'VoicePrefixId':_0x136919['id']},'transaction':_0x797ba1})[_0xf160('0x2a')](function(){return db[_0xf160('0x62')][_0xf160('0x4c')]({'where':{'id':_0x136919[_0xf160('0x71')]},'raw':!![]})[_0xf160('0x2a')](function(_0x59b63c){return createVoicePrefixExtensions(_0x136919,_0x59b63c,_0x797ba1);});});});})['then'](function(){return db[_0xf160('0x33')][_0xf160('0x72')](_0x136919['id']);})[_0xf160('0x2a')](respondWithResult(_0x4b9d21,null))[_0xf160('0x49')](handleError(_0x4b9d21,null));};exports[_0xf160('0x73')]=function(_0x722f3a,_0x2f434c,_0x484b18){return db[_0xf160('0x33')][_0xf160('0x4c')]({'where':{'id':_0x722f3a['params']['id']}})['then'](handleEntityNotFound(_0x2f434c,null))[_0xf160('0x2a')](function(_0x14d69d){if(_0x14d69d){return _0x14d69d['addAgents'](_0x722f3a[_0xf160('0x4f')][_0xf160('0x74')],_['omit'](_0x722f3a[_0xf160('0x4f')],['ids','id'])||{})[_0xf160('0x75')](function(_0x355226){for(var _0x74028e=0x0;_0x74028e<_0x722f3a[_0xf160('0x4f')]['ids'][_0xf160('0x3c')];_0x74028e+=0x1){socket[_0xf160('0x76')](_0xf160('0x77'),{'UserId':Number(_0x722f3a[_0xf160('0x4f')][_0xf160('0x74')][_0x74028e]),'VoicePrefixId':Number(_0x722f3a['params']['id'])});}return _0x355226;});}})[_0xf160('0x2a')](respondWithResult(_0x2f434c,null))[_0xf160('0x49')](handleError(_0x2f434c,null));};exports[_0xf160('0x78')]=function(_0x5275b4,_0x2396f6,_0x1165f5){return db[_0xf160('0x33')][_0xf160('0x4c')]({'where':{'id':_0x5275b4[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x2396f6,null))[_0xf160('0x2a')](function(_0x543534){if(_0x543534){return _0x543534[_0xf160('0x78')](_0x5275b4[_0xf160('0x36')][_0xf160('0x74')])[_0xf160('0x2a')](function(){if(_[_0xf160('0x79')](_0x5275b4['query'][_0xf160('0x74')])){for(var _0x3526cd=0x0;_0x3526cd<_0x5275b4[_0xf160('0x36')][_0xf160('0x74')][_0xf160('0x3c')];_0x3526cd+=0x1){socket[_0xf160('0x76')](_0xf160('0x7a'),{'UserId':Number(_0x5275b4[_0xf160('0x36')][_0xf160('0x74')][_0x3526cd]),'VoicePrefixId':Number(_0x5275b4[_0xf160('0x4b')]['id'])});}}else{socket[_0xf160('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x5275b4[_0xf160('0x36')]['ids']),'VoicePrefixId':Number(_0x5275b4[_0xf160('0x4b')]['id'])});}});}})[_0xf160('0x2a')](respondWithStatusCode(_0x2396f6,null))[_0xf160('0x49')](handleError(_0x2396f6,null));};exports[_0xf160('0x7b')]=function(_0x6ff6b1,_0x59281e,_0x3f873a){var _0x38426d={};var _0x2a992a={};var _0x185268;var _0x5927c9;return db['VoicePrefix'][_0xf160('0x7c')]({'where':{'id':_0x6ff6b1['params']['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x59281e,null))['then'](function(_0x21b93a){if(_0x21b93a){_0x185268=_0x21b93a;_0x2a992a['model']=_['keys'](db[_0xf160('0x7d')][_0xf160('0x34')]);_0x2a992a[_0xf160('0x36')]=_[_0xf160('0x37')](_0x6ff6b1[_0xf160('0x36')]);_0x2a992a[_0xf160('0x38')]=_[_0xf160('0x39')](_0x2a992a[_0xf160('0x35')],_0x2a992a[_0xf160('0x36')]);_0x38426d['attributes']=_['intersection'](_0x2a992a[_0xf160('0x35')],qs[_0xf160('0x3b')](_0x6ff6b1[_0xf160('0x36')][_0xf160('0x3b')]));_0x38426d[_0xf160('0x3a')]=_0x38426d['attributes'][_0xf160('0x3c')]?_0x38426d[_0xf160('0x3a')]:_0x2a992a[_0xf160('0x35')];_0x38426d[_0xf160('0x3d')]=qs['sort'](_0x6ff6b1['query']['sort']);_0x38426d[_0xf160('0x3f')]=qs['filters'](_[_0xf160('0x40')](_0x6ff6b1['query'],_0x2a992a[_0xf160('0x38')]));if(_0x6ff6b1[_0xf160('0x36')]['filter']){_0x38426d[_0xf160('0x3f')]=_[_0xf160('0x42')](_0x38426d[_0xf160('0x3f')],{'$or':_[_0xf160('0x32')](_0x38426d[_0xf160('0x3a')],function(_0x39ec7e){var _0x2558b8={};_0x2558b8[_0x39ec7e]={'$like':'%'+_0x6ff6b1['query']['filter']+'%'};return _0x2558b8;})});}_0x38426d=_[_0xf160('0x42')]({},_0x38426d,_0x6ff6b1[_0xf160('0x44')]);return _0x185268[_0xf160('0x7b')](_0x38426d);}})['then'](function(_0x5316c5){if(_0x5316c5){_0x5927c9=_0x5316c5[_0xf160('0x3c')];if(!_0x6ff6b1[_0xf160('0x36')][_0xf160('0x7e')](_0xf160('0x7f'))){_0x38426d[_0xf160('0x22')]=qs[_0xf160('0x22')](_0x6ff6b1[_0xf160('0x36')][_0xf160('0x22')]);_0x38426d[_0xf160('0x20')]=qs[_0xf160('0x20')](_0x6ff6b1['query'][_0xf160('0x20')]);}return _0x185268[_0xf160('0x7b')](_0x38426d);}})[_0xf160('0x2a')](function(_0x3ee8d8){if(_0x3ee8d8){return _0x3ee8d8?{'count':_0x5927c9,'rows':_0x3ee8d8}:null;}})[_0xf160('0x2a')](respondWithResult(_0x59281e,null))[_0xf160('0x49')](handleError(_0x59281e,null));};exports['getTeams']=function(_0x336560,_0x120282,_0x2b6e56){var _0x362718={};var _0xcf5dee={};var _0x2a8af4;var _0x224dcc;return db[_0xf160('0x33')]['findOne']({'where':{'id':_0x336560['params']['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x120282,null))[_0xf160('0x2a')](function(_0x55865d){if(_0x55865d){_0x2a8af4=_0x55865d;_0xcf5dee[_0xf160('0x35')]=_[_0xf160('0x37')](db[_0xf160('0x80')][_0xf160('0x34')]);_0xcf5dee[_0xf160('0x36')]=_[_0xf160('0x37')](_0x336560[_0xf160('0x36')]);_0xcf5dee[_0xf160('0x38')]=_[_0xf160('0x39')](_0xcf5dee[_0xf160('0x35')],_0xcf5dee['query']);_0x362718[_0xf160('0x3a')]=_[_0xf160('0x39')](_0xcf5dee[_0xf160('0x35')],qs[_0xf160('0x3b')](_0x336560[_0xf160('0x36')]['fields']));_0x362718[_0xf160('0x3a')]=_0x362718[_0xf160('0x3a')][_0xf160('0x3c')]?_0x362718[_0xf160('0x3a')]:_0xcf5dee['model'];_0x362718[_0xf160('0x3d')]=qs[_0xf160('0x3e')](_0x336560['query']['sort']);_0x362718['where']=qs['filters'](_['pick'](_0x336560[_0xf160('0x36')],_0xcf5dee[_0xf160('0x38')]));if(_0x336560['query']['filter']){_0x362718[_0xf160('0x3f')]=_[_0xf160('0x42')](_0x362718['where'],{'$or':_[_0xf160('0x32')](_0x362718['attributes'],function(_0x32fb34){var _0x3b1d1a={};_0x3b1d1a[_0x32fb34]={'$like':'%'+_0x336560[_0xf160('0x36')]['filter']+'%'};return _0x3b1d1a;})});}_0x362718=_[_0xf160('0x42')]({},_0x362718,_0x336560['options']);return _0x2a8af4[_0xf160('0x81')](_0x362718);}})['then'](function(_0x308dd9){if(_0x308dd9){_0x224dcc=_0x308dd9['length'];if(!_0x336560[_0xf160('0x36')]['hasOwnProperty'](_0xf160('0x7f'))){_0x362718[_0xf160('0x22')]=qs['limit'](_0x336560[_0xf160('0x36')][_0xf160('0x22')]);_0x362718['offset']=qs[_0xf160('0x20')](_0x336560[_0xf160('0x36')][_0xf160('0x20')]);}return _0x2a8af4[_0xf160('0x81')](_0x362718);}})['then'](function(_0x5cdecf){if(_0x5cdecf){return _0x5cdecf?{'count':_0x224dcc,'rows':_0x5cdecf}:null;}})[_0xf160('0x2a')](respondWithResult(_0x120282,null))[_0xf160('0x49')](handleError(_0x120282,null));};exports['addTeams']=function(_0x28b2cb,_0x24e3b5,_0x5c0dc8){var _0x182ed8=_0x28b2cb['body'][_0xf160('0x74')];var _0x2eada8;return db[_0xf160('0x80')]['findAll']({'where':{'id':_0x182ed8},'attributes':['id'],'include':[{'model':db[_0xf160('0x7d')],'as':_0xf160('0x82'),'attributes':['id',_0xf160('0x2f'),_0xf160('0x83'),_0xf160('0x84'),_0xf160('0x85')],'raw':!![]}]})[_0xf160('0x2a')](function(_0x2dbb52){if(_0x2dbb52){_0x2eada8=_0x2dbb52;var _0x5b29e0=_['flatMap'](_0x2dbb52,function(_0x2ae1dc){var _0x50912b=_0x2ae1dc['get']({'plain':!![]});return _0x50912b[_0xf160('0x82')];});return db['VoicePrefix'][_0xf160('0x4c')]({'where':{'id':_0x28b2cb[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](function(_0x26aa72){return db[_0xf160('0x70')][_0xf160('0x86')](function(_0x1bef1a){return _0x26aa72[_0xf160('0x87')](_0x182ed8,{'transaction':_0x1bef1a})[_0xf160('0x2a')](function(){return BPromise[_0xf160('0x88')](_0x2eada8,function(_0x154789){return db[_0xf160('0x89')][_0xf160('0x8a')]({'TeamId':_0x154789['id'],'VoicePrefixId':_0x28b2cb['params']['id']},{'transaction':_0x1bef1a});});})[_0xf160('0x2a')](function(){return BPromise[_0xf160('0x88')](_0x5b29e0,function(_0x3e46d1){return db[_0xf160('0x8b')][_0xf160('0x8c')]({'where':{'UserId':_0x3e46d1['id'],'VoicePrefixId':_0x28b2cb[_0xf160('0x4b')]['id']},'transaction':_0x1bef1a});});})[_0xf160('0x2a')](function(){_0x5b29e0[_0xf160('0x8d')](function(_0x3e9116){socket[_0xf160('0x76')](_0xf160('0x77'),{'UserId':_0x3e9116['id'],'VoicePrefixId':_0x26aa72['id']});});});});});}})[_0xf160('0x2a')](respondWithStatusCode(_0x24e3b5,null))[_0xf160('0x49')](handleError(_0x24e3b5,null));};exports[_0xf160('0x8e')]=function(_0x481f96,_0x4186f7,_0x37579a){return db[_0xf160('0x80')][_0xf160('0x47')]({'where':{'id':_0x481f96[_0xf160('0x36')][_0xf160('0x74')]},'attributes':['id'],'include':[{'model':db[_0xf160('0x7d')],'as':_0xf160('0x82'),'attributes':['id'],'raw':!![]}]})[_0xf160('0x2a')](handleEntityNotFound(_0x4186f7,null))[_0xf160('0x2a')](function(_0x36c1c5){var _0x4753d6=_[_0xf160('0x32')](_0x36c1c5,'id');var _0x2c486d=[];var _0x26332b=[];var _0x539056=squel['select']();_0x539056['field'](_0xf160('0x8f'))[_0xf160('0x90')](_0xf160('0x91'),'tq')[_0xf160('0x92')](_0xf160('0x93'),'ut',_0xf160('0x94'))['where'](_0xf160('0x95'),_0x481f96[_0xf160('0x4b')]['id']);for(var _0x1d308e=0x0;_0x1d308e<_0x36c1c5[_0xf160('0x3c')];_0x1d308e+=0x1){let _0x5bc8a3=_0x36c1c5[_0x1d308e];for(var _0x19dc59=0x0;_0x19dc59<_0x5bc8a3[_0xf160('0x82')][_0xf160('0x3c')];_0x19dc59+=0x1){let _0x35de2b=_0x5bc8a3[_0xf160('0x82')][_0x19dc59];var _0x446548=_0x539056[_0xf160('0x96')]();_0x446548[_0xf160('0x3f')](_0xf160('0x97'),_0x35de2b['id']);_0x26332b[_0xf160('0x66')](db[_0xf160('0x70')][_0xf160('0x36')](_0x446548[_0xf160('0x98')](),{'type':db[_0xf160('0x70')][_0xf160('0x99')][_0xf160('0x9a')]})[_0xf160('0x2a')](function(_0x258ad9){if(_0x258ad9['length']===0x1){return _0x35de2b['id'];}else{var _0x27d3ef=_['every'](_['map'](_0x258ad9,'TeamId'),function(_0x191d89){return _[_0xf160('0x9b')](_0x4753d6,_0x191d89);});if(_0x27d3ef){return _0x35de2b['id'];}}}));}}return BPromise[_0xf160('0x9c')](_0x26332b)[_0xf160('0x2a')](function(_0x2391f9){_0x2c486d=_(_0x2c486d)['union'](_0x2391f9)['compact']()[_0xf160('0x9d')]();return db[_0xf160('0x33')]['find']({'where':{'id':_0x481f96[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](function(_0x3d9b9b){return db[_0xf160('0x70')][_0xf160('0x86')](function(_0x563e5d){return _0x3d9b9b[_0xf160('0x8e')](_0x481f96['query'][_0xf160('0x74')],{'transaction':_0x563e5d})[_0xf160('0x2a')](function(){if(!_[_0xf160('0x9e')](_0x2c486d)){return _0x3d9b9b['removeAgents'](_0x2c486d,{'transaction':_0x563e5d});}})[_0xf160('0x2a')](function(){_0x2c486d[_0xf160('0x8d')](function(_0xfb5d28){socket[_0xf160('0x76')](_0xf160('0x7a'),{'UserId':_0xfb5d28,'VoicePrefixId':_0x3d9b9b['id']});});});});});});})[_0xf160('0x2a')](respondWithStatusCode(_0x4186f7,null))[_0xf160('0x49')](handleError(_0x4186f7,null));}; \ No newline at end of file +var _0x5c3c=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','error','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','sequelize','transaction','get','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','VoiceExtensionId','findById','addAgents','ids','omit','removeAgents','isArray','userVoicePrefix:remove','emit','getAgents','findOne','User','pick','getTeams','addTeams','Team','findAll','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','Agents','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','union','compact','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x1c0028,_0x1ffe06){var _0x4c3b77=function(_0x389b78){while(--_0x389b78){_0x1c0028['push'](_0x1c0028['shift']());}};_0x4c3b77(++_0x1ffe06);}(_0x5c3c,0x132));var _0xc5c3=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x5c3c[_0x710815];return _0x5b3b89;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];config[_0xc5c3('0x18')]=_[_0xc5c3('0x19')](config[_0xc5c3('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5c3('0x1a'))(new Redis(config[_0xc5c3('0x18')]));require(_0xc5c3('0x1b'))[_0xc5c3('0x1c')](socket);function respondWithStatusCode(_0xc8a636,_0x5f34bb){_0x5f34bb=_0x5f34bb||0xcc;return function(_0x5c0341){if(_0x5c0341){return _0xc8a636[_0xc5c3('0x1d')](_0x5f34bb);}return _0xc8a636[_0xc5c3('0x1e')](_0x5f34bb)[_0xc5c3('0x1f')]();};}function respondWithResult(_0xef8b21,_0x5ecd4b){_0x5ecd4b=_0x5ecd4b||0xc8;return function(_0x4ff2de){if(_0x4ff2de){return _0xef8b21[_0xc5c3('0x1e')](_0x5ecd4b)['json'](_0x4ff2de);}};}function respondWithFilteredResult(_0xa9bc84,_0x17ec62){return function(_0x2ff158){if(_0x2ff158){var _0x13c867=typeof _0x17ec62[_0xc5c3('0x20')]==='undefined'&&typeof _0x17ec62[_0xc5c3('0x21')]===_0xc5c3('0x22');var _0x123dba=_0x2ff158[_0xc5c3('0x23')];var _0x4e570f=_0x13c867?0x0:_0x17ec62[_0xc5c3('0x20')];var _0x41578a=_0x13c867?_0x2ff158[_0xc5c3('0x23')]:_0x17ec62[_0xc5c3('0x20')]+_0x17ec62[_0xc5c3('0x21')];var _0x564815;if(_0x41578a>=_0x123dba){_0x41578a=_0x123dba;_0x564815=0xc8;}else{_0x564815=0xce;}_0xa9bc84[_0xc5c3('0x1e')](_0x564815);return _0xa9bc84[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e570f+'-'+_0x41578a+'/'+_0x123dba)[_0xc5c3('0x26')](_0x2ff158);}return null;};}function patchUpdates(_0x1c5793){return function(_0x67445){try{jsonpatch[_0xc5c3('0x27')](_0x67445,_0x1c5793,!![]);}catch(_0x5996a0){return BPromise['reject'](_0x5996a0);}return _0x67445[_0xc5c3('0x28')]();};}function saveUpdates(_0x38dd9e,_0x53ab72){return function(_0x5c7329){if(_0x5c7329){return _0x5c7329[_0xc5c3('0x29')](_0x38dd9e)[_0xc5c3('0x2a')](function(_0x38a3df){return _0x38a3df;});}return null;};}function removeEntity(_0x52e54a,_0x4af067){return function(_0x2df06b){if(_0x2df06b){return _0x2df06b[_0xc5c3('0x2b')]()[_0xc5c3('0x2a')](function(){var _0x29791c=_0x2df06b['get']({'plain':!![]});var _0x21efd6='VoicePrefixes';return db[_0xc5c3('0x2c')]['destroy']({'where':{'type':_0x21efd6,'resourceId':_0x29791c['id']}})[_0xc5c3('0x2a')](function(){return _0x2df06b;});})[_0xc5c3('0x2a')](function(){_0x52e54a[_0xc5c3('0x1e')](0xcc)[_0xc5c3('0x1f')]();});}};}function handleEntityNotFound(_0x15361c,_0x2d07e1){return function(_0x35a397){if(!_0x35a397){_0x15361c['sendStatus'](0x194);}return _0x35a397;};}function handleError(_0xbcafd6,_0x4a3300){_0x4a3300=_0x4a3300||0x1f4;return function(_0xc4b134){logger[_0xc5c3('0x2d')](_0xc4b134['stack']);if(_0xc4b134['name']){delete _0xc4b134[_0xc5c3('0x2e')];}_0xbcafd6[_0xc5c3('0x1e')](_0x4a3300)[_0xc5c3('0x2f')](_0xc4b134);};}exports[_0xc5c3('0x30')]=function(_0x52adcf,_0x3f9591){var _0x24aa70={},_0x3ebcbc={},_0x303eab={'count':0x0,'rows':[]};var _0x1b4538=_[_0xc5c3('0x31')](db[_0xc5c3('0x32')][_0xc5c3('0x33')],function(_0x1d1e6d){return{'name':_0x1d1e6d['fieldName'],'type':_0x1d1e6d[_0xc5c3('0x34')][_0xc5c3('0x35')]};});_0x3ebcbc[_0xc5c3('0x36')]=_[_0xc5c3('0x31')](_0x1b4538,_0xc5c3('0x2e'));_0x3ebcbc[_0xc5c3('0x37')]=_[_0xc5c3('0x38')](_0x52adcf['query']);_0x3ebcbc['filters']=_[_0xc5c3('0x39')](_0x3ebcbc['model'],_0x3ebcbc[_0xc5c3('0x37')]);_0x24aa70[_0xc5c3('0x3a')]=_[_0xc5c3('0x39')](_0x3ebcbc[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x52adcf['query'][_0xc5c3('0x3b')]));_0x24aa70[_0xc5c3('0x3a')]=_0x24aa70['attributes'][_0xc5c3('0x3c')]?_0x24aa70[_0xc5c3('0x3a')]:_0x3ebcbc[_0xc5c3('0x36')];if(!_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x3d')](_0xc5c3('0x3e'))){_0x24aa70[_0xc5c3('0x21')]=qs[_0xc5c3('0x21')](_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x21')]);_0x24aa70['offset']=qs[_0xc5c3('0x20')](_0x52adcf['query']['offset']);}_0x24aa70[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x40')]);_0x24aa70[_0xc5c3('0x41')]=qs['filters'](_['pick'](_0x52adcf[_0xc5c3('0x37')],_0x3ebcbc[_0xc5c3('0x42')]),_0x1b4538);if(_0x52adcf['query'][_0xc5c3('0x43')]){_0x24aa70['where']=_[_0xc5c3('0x44')](_0x24aa70[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x1b4538,function(_0x59c9cb){if(_0x59c9cb[_0xc5c3('0x34')]!==_0xc5c3('0x45')){var _0x525ef8={};_0x525ef8[_0x59c9cb[_0xc5c3('0x2e')]]={'$like':'%'+_0x52adcf['query'][_0xc5c3('0x43')]+'%'};return _0x525ef8;}})});}_0x24aa70=_[_0xc5c3('0x44')]({},_0x24aa70,_0x52adcf['options']);var _0x4d2056={'where':_0x24aa70['where']};return db[_0xc5c3('0x32')][_0xc5c3('0x23')](_0x4d2056)['then'](function(_0x1a8490){_0x303eab[_0xc5c3('0x23')]=_0x1a8490;if(_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x46')]){_0x24aa70['include']=[{'all':!![]}];}return db[_0xc5c3('0x32')]['findAll'](_0x24aa70);})['then'](function(_0x1363fa){_0x303eab[_0xc5c3('0x47')]=_0x1363fa;return _0x303eab;})['then'](respondWithFilteredResult(_0x3f9591,_0x24aa70))[_0xc5c3('0x48')](handleError(_0x3f9591,null));};exports[_0xc5c3('0x49')]=function(_0x590e65,_0x333c38){var _0x4ffc5a={'raw':![],'where':{'id':_0x590e65[_0xc5c3('0x4a')]['id']}},_0x122a6d={};_0x122a6d['model']=_[_0xc5c3('0x38')](db['VoicePrefix'][_0xc5c3('0x33')]);_0x122a6d[_0xc5c3('0x37')]=_['keys'](_0x590e65[_0xc5c3('0x37')]);_0x122a6d[_0xc5c3('0x42')]=_[_0xc5c3('0x39')](_0x122a6d[_0xc5c3('0x36')],_0x122a6d[_0xc5c3('0x37')]);_0x4ffc5a[_0xc5c3('0x3a')]=_['intersection'](_0x122a6d[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x590e65[_0xc5c3('0x37')][_0xc5c3('0x3b')]));_0x4ffc5a[_0xc5c3('0x3a')]=_0x4ffc5a['attributes']['length']?_0x4ffc5a[_0xc5c3('0x3a')]:_0x122a6d[_0xc5c3('0x36')];if(_0x590e65[_0xc5c3('0x37')]['includeAll']){_0x4ffc5a[_0xc5c3('0x4b')]=[{'all':!![]}];}_0x4ffc5a=_[_0xc5c3('0x44')]({},_0x4ffc5a,_0x590e65[_0xc5c3('0x4c')]);return db[_0xc5c3('0x32')][_0xc5c3('0x4d')](_0x4ffc5a)[_0xc5c3('0x2a')](handleEntityNotFound(_0x333c38,null))[_0xc5c3('0x2a')](respondWithResult(_0x333c38,null))['catch'](handleError(_0x333c38,null));};exports[_0xc5c3('0x2b')]=function(_0x3ff21e,_0x4538ab){return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x3ff21e[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x4538ab,null))[_0xc5c3('0x2a')](removeEntity(_0x4538ab,null))[_0xc5c3('0x48')](handleError(_0x4538ab,null));};exports['describe']=function(_0xd716e6,_0x58204c){return db[_0xc5c3('0x32')]['describe']()[_0xc5c3('0x2a')](respondWithResult(_0x58204c,null))[_0xc5c3('0x48')](handleError(_0x58204c,null));};exports[_0xc5c3('0x4e')]=function(_0x325643,_0x1311de){var _0x4be969;return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x348960){return db[_0xc5c3('0x32')][_0xc5c3('0x4e')](_0x325643['body'],{'transaction':_0x348960})[_0xc5c3('0x2a')](function(_0x34bf9c){_0x4be969=_0x34bf9c[_0xc5c3('0x51')]({'plain':!![]});return db['VoiceExtension'][_0xc5c3('0x4d')]({'where':{'id':_0x4be969['VoiceExtensionId']},'raw':!![]})['then'](function(_0x39f83a){return createVoicePrefixExtensions(_0x4be969,_0x39f83a,_0x348960);});});})[_0xc5c3('0x2a')](function(){var _0x110105=_0x325643[_0xc5c3('0x52')][_0xc5c3('0x51')]({'plain':!![]});if(!_0x110105)throw new Error(_0xc5c3('0x53'));if(_0x110105['role']===_0xc5c3('0x52')){var _0x1ad3aa=_0x4be969;return db[_0xc5c3('0x54')][_0xc5c3('0x4d')]({'where':{'name':_0xc5c3('0x55'),'userProfileId':_0x110105[_0xc5c3('0x56')]},'raw':!![]})[_0xc5c3('0x2a')](function(_0x524aff){if(_0x524aff&&_0x524aff['autoAssociation']===0x0){return db[_0xc5c3('0x2c')][_0xc5c3('0x4e')]({'name':_0x1ad3aa['name'],'resourceId':_0x1ad3aa['id'],'type':_0x524aff[_0xc5c3('0x2e')],'sectionId':_0x524aff['id']},{})[_0xc5c3('0x2a')](function(){return _0x4be969;});}else{return _0x4be969;}})[_0xc5c3('0x48')](function(_0x41bcf7){logger['error'](_0xc5c3('0x57'),_0x41bcf7);throw _0x41bcf7;});}return _0x4be969;})[_0xc5c3('0x2a')](respondWithResult(_0x1311de,null))[_0xc5c3('0x48')](handleError(_0x1311de,null));};function Extension(_0x314392,_0x1b66bf,_0x36420a,_0x90e30b){this[_0xc5c3('0x58')]=_0xc5c3('0x59');this['exten']=_0x314392;this[_0xc5c3('0x5a')]=_0x36420a;this[_0xc5c3('0x34')]=_0xc5c3('0x5b');this['description']=_0xc5c3('0x5c');this[_0xc5c3('0x5d')]=_0x1b66bf;this[_0xc5c3('0x5e')]=_0x90e30b;}function createVoicePrefixExtensions(_0x30226f,_0x32d5e2,_0x5067ed){return new BPromise(function(_0xf54924,_0xea569b){var _0xf40f27=new Extension(formatPrefixName(_0x30226f[_0xc5c3('0x5f')]),0x1,_0xc5c3('0x60'),_0xc5c3('0x61'));_0xf40f27[_0xc5c3('0x62')]=_0x30226f['id'];return db['VoiceExtension'][_0xc5c3('0x4e')](_0xf40f27,{'transaction':_0x5067ed})[_0xc5c3('0x2a')](function(_0x397fc8){var _0x13f6a1=_0x397fc8[_0xc5c3('0x51')]({'plain':!![]});var _0x3cd213=_[_0xc5c3('0x31')](addVoicePrefixExtensions(_0x30226f,_0x32d5e2),function(_0x5b9013){_0x5b9013['VoiceExtensionId']=_0x13f6a1['id'];_0x5b9013[_0xc5c3('0x62')]=_0x30226f['id'];return _0x5b9013;});return db[_0xc5c3('0x63')][_0xc5c3('0x64')](_0x3cd213,{'transaction':_0x5067ed})[_0xc5c3('0x2a')](function(_0x1ed757){if(!_0x1ed757){return _0xea569b(_0xc5c3('0x65'));}else{return _0xf54924(_0x1ed757);}})[_0xc5c3('0x48')](function(_0x2cdd7a){return _0xea569b(_0x2cdd7a);});});;});};function addVoicePrefixExtensions(_0x385b39,_0x4d3e6f){var _0x92c6cf=[];var _0x358b83=formatPrefixName(_0x385b39['prefix']);_0x92c6cf['push'](new Extension(_0x358b83,0x2,_0xc5c3('0x66'),_0xc5c3('0x67')+_0x385b39[_0xc5c3('0x2e')]));if(_0x385b39[_0xc5c3('0x68')]){_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x3,_0xc5c3('0x66'),_0xc5c3('0x6a')+_0x385b39[_0xc5c3('0x68')]));}else{_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x3,'NoOp',_0xc5c3('0x6b')));}_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x4,_0xc5c3('0x6c'),_0x4d3e6f[_0xc5c3('0x58')]+','+_0xc5c3('0x6d')+(0x8+_0x385b39[_0xc5c3('0x2e')][_0xc5c3('0x3c')])+'}'+','+0x1));return _0x92c6cf;}function formatPrefixName(_0x114c90){var _0x22606a='_';for(var _0x31e280=0x0;_0x31e280<_0x114c90[_0xc5c3('0x3c')];_0x31e280++){if(_0x114c90['charAt'](_0x31e280)=='-'){_0x22606a+=_0x114c90['charAt'](_0x31e280);}else{_0x22606a+='['+_0x114c90[_0xc5c3('0x6e')](_0x31e280)+']';}}_0x22606a+='.';return _0x22606a;}exports[_0xc5c3('0x29')]=function(_0x6281e5,_0x1951a5,_0x5540c0){var _0x2da018=_0x6281e5[_0xc5c3('0x6f')];_0x2da018[_0xc5c3('0x5f')]=_0xc5c3('0x70')+_0x2da018[_0xc5c3('0x2e')]+'-';return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x4a3f71){return db[_0xc5c3('0x32')]['update'](_0x2da018,{'where':{'id':_0x2da018['id']},'transaction':_0x4a3f71})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x63')][_0xc5c3('0x2b')]({'where':{'VoicePrefixId':_0x2da018['id']},'transaction':_0x4a3f71})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x63')][_0xc5c3('0x4d')]({'where':{'id':_0x2da018[_0xc5c3('0x71')]},'raw':!![]})[_0xc5c3('0x2a')](function(_0x4813a0){return createVoicePrefixExtensions(_0x2da018,_0x4813a0,_0x4a3f71);});});});})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x32')][_0xc5c3('0x72')](_0x2da018['id']);})['then'](respondWithResult(_0x1951a5,null))['catch'](handleError(_0x1951a5,null));};exports[_0xc5c3('0x73')]=function(_0x5d6b6b,_0x5bcbd3,_0x1f222f){return db[_0xc5c3('0x32')]['find']({'where':{'id':_0x5d6b6b[_0xc5c3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bcbd3,null))['then'](function(_0x2dbe80){if(_0x2dbe80){return _0x2dbe80[_0xc5c3('0x73')](_0x5d6b6b[_0xc5c3('0x6f')][_0xc5c3('0x74')],_[_0xc5c3('0x75')](_0x5d6b6b['body'],[_0xc5c3('0x74'),'id'])||{})['spread'](function(_0x110167){for(var _0x109cfa=0x0;_0x109cfa<_0x5d6b6b[_0xc5c3('0x6f')][_0xc5c3('0x74')][_0xc5c3('0x3c')];_0x109cfa+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x5d6b6b['body'][_0xc5c3('0x74')][_0x109cfa]),'VoicePrefixId':Number(_0x5d6b6b[_0xc5c3('0x4a')]['id'])});}return _0x110167;});}})[_0xc5c3('0x2a')](respondWithResult(_0x5bcbd3,null))['catch'](handleError(_0x5bcbd3,null));};exports[_0xc5c3('0x76')]=function(_0x41222d,_0x5dcd4d,_0x3afa94){return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x41222d[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x5dcd4d,null))[_0xc5c3('0x2a')](function(_0x4b0d02){if(_0x4b0d02){return _0x4b0d02[_0xc5c3('0x76')](_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')])[_0xc5c3('0x2a')](function(){if(_[_0xc5c3('0x77')](_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')])){for(var _0x1f36f8=0x0;_0x1f36f8<_0x41222d['query']['ids']['length'];_0x1f36f8+=0x1){socket['emit'](_0xc5c3('0x78'),{'UserId':Number(_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')][_0x1f36f8]),'VoicePrefixId':Number(_0x41222d[_0xc5c3('0x4a')]['id'])});}}else{socket[_0xc5c3('0x79')](_0xc5c3('0x78'),{'UserId':Number(_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')]),'VoicePrefixId':Number(_0x41222d[_0xc5c3('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5dcd4d,null))[_0xc5c3('0x48')](handleError(_0x5dcd4d,null));};exports[_0xc5c3('0x7a')]=function(_0x3aa5e2,_0x1efa1d,_0x2fae6d){var _0x258e36={};var _0x2f1be8={};var _0x550966;var _0x5733a2;return db[_0xc5c3('0x32')][_0xc5c3('0x7b')]({'where':{'id':_0x3aa5e2[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x1efa1d,null))[_0xc5c3('0x2a')](function(_0x306d22){if(_0x306d22){_0x550966=_0x306d22;_0x2f1be8[_0xc5c3('0x36')]=_[_0xc5c3('0x38')](db[_0xc5c3('0x7c')][_0xc5c3('0x33')]);_0x2f1be8[_0xc5c3('0x37')]=_['keys'](_0x3aa5e2[_0xc5c3('0x37')]);_0x2f1be8[_0xc5c3('0x42')]=_[_0xc5c3('0x39')](_0x2f1be8[_0xc5c3('0x36')],_0x2f1be8[_0xc5c3('0x37')]);_0x258e36['attributes']=_[_0xc5c3('0x39')](_0x2f1be8[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x3aa5e2[_0xc5c3('0x37')]['fields']));_0x258e36[_0xc5c3('0x3a')]=_0x258e36[_0xc5c3('0x3a')][_0xc5c3('0x3c')]?_0x258e36['attributes']:_0x2f1be8[_0xc5c3('0x36')];_0x258e36[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x40')]);_0x258e36[_0xc5c3('0x41')]=qs[_0xc5c3('0x42')](_[_0xc5c3('0x7d')](_0x3aa5e2[_0xc5c3('0x37')],_0x2f1be8[_0xc5c3('0x42')]));if(_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x43')]){_0x258e36[_0xc5c3('0x41')]=_[_0xc5c3('0x44')](_0x258e36[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x258e36['attributes'],function(_0x2bf9d2){var _0x8aaa64={};_0x8aaa64[_0x2bf9d2]={'$like':'%'+_0x3aa5e2['query'][_0xc5c3('0x43')]+'%'};return _0x8aaa64;})});}_0x258e36=_['merge']({},_0x258e36,_0x3aa5e2[_0xc5c3('0x4c')]);return _0x550966[_0xc5c3('0x7a')](_0x258e36);}})[_0xc5c3('0x2a')](function(_0x1800a0){if(_0x1800a0){_0x5733a2=_0x1800a0[_0xc5c3('0x3c')];if(!_0x3aa5e2['query'][_0xc5c3('0x3d')](_0xc5c3('0x3e'))){_0x258e36[_0xc5c3('0x21')]=qs['limit'](_0x3aa5e2['query'][_0xc5c3('0x21')]);_0x258e36['offset']=qs[_0xc5c3('0x20')](_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x20')]);}return _0x550966['getAgents'](_0x258e36);}})[_0xc5c3('0x2a')](function(_0x3325b6){if(_0x3325b6){return _0x3325b6?{'count':_0x5733a2,'rows':_0x3325b6}:null;}})[_0xc5c3('0x2a')](respondWithResult(_0x1efa1d,null))[_0xc5c3('0x48')](handleError(_0x1efa1d,null));};exports[_0xc5c3('0x7e')]=function(_0x57070d,_0x2f5315,_0x37ef35){var _0x2dcae5={};var _0x5d5248={};var _0xd3091c;var _0x26292e;return db[_0xc5c3('0x32')][_0xc5c3('0x7b')]({'where':{'id':_0x57070d[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x2f5315,null))[_0xc5c3('0x2a')](function(_0x12d800){if(_0x12d800){_0xd3091c=_0x12d800;_0x5d5248['model']=_[_0xc5c3('0x38')](db['Team'][_0xc5c3('0x33')]);_0x5d5248[_0xc5c3('0x37')]=_['keys'](_0x57070d[_0xc5c3('0x37')]);_0x5d5248[_0xc5c3('0x42')]=_['intersection'](_0x5d5248[_0xc5c3('0x36')],_0x5d5248[_0xc5c3('0x37')]);_0x2dcae5[_0xc5c3('0x3a')]=_[_0xc5c3('0x39')](_0x5d5248[_0xc5c3('0x36')],qs['fields'](_0x57070d[_0xc5c3('0x37')][_0xc5c3('0x3b')]));_0x2dcae5[_0xc5c3('0x3a')]=_0x2dcae5[_0xc5c3('0x3a')][_0xc5c3('0x3c')]?_0x2dcae5[_0xc5c3('0x3a')]:_0x5d5248['model'];_0x2dcae5[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x57070d['query']['sort']);_0x2dcae5[_0xc5c3('0x41')]=qs[_0xc5c3('0x42')](_['pick'](_0x57070d[_0xc5c3('0x37')],_0x5d5248[_0xc5c3('0x42')]));if(_0x57070d[_0xc5c3('0x37')]['filter']){_0x2dcae5[_0xc5c3('0x41')]=_[_0xc5c3('0x44')](_0x2dcae5[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x2dcae5[_0xc5c3('0x3a')],function(_0x86d21a){var _0x53f1d={};_0x53f1d[_0x86d21a]={'$like':'%'+_0x57070d[_0xc5c3('0x37')][_0xc5c3('0x43')]+'%'};return _0x53f1d;})});}_0x2dcae5=_[_0xc5c3('0x44')]({},_0x2dcae5,_0x57070d[_0xc5c3('0x4c')]);return _0xd3091c[_0xc5c3('0x7e')](_0x2dcae5);}})['then'](function(_0x48e3a2){if(_0x48e3a2){_0x26292e=_0x48e3a2[_0xc5c3('0x3c')];if(!_0x57070d['query']['hasOwnProperty'](_0xc5c3('0x3e'))){_0x2dcae5['limit']=qs[_0xc5c3('0x21')](_0x57070d[_0xc5c3('0x37')]['limit']);_0x2dcae5['offset']=qs[_0xc5c3('0x20')](_0x57070d['query']['offset']);}return _0xd3091c[_0xc5c3('0x7e')](_0x2dcae5);}})[_0xc5c3('0x2a')](function(_0x3ce0e9){if(_0x3ce0e9){return _0x3ce0e9?{'count':_0x26292e,'rows':_0x3ce0e9}:null;}})[_0xc5c3('0x2a')](respondWithResult(_0x2f5315,null))[_0xc5c3('0x48')](handleError(_0x2f5315,null));};exports[_0xc5c3('0x7f')]=function(_0x116965,_0xa4672a,_0x1aba09){var _0x557b8f=_0x116965['body'][_0xc5c3('0x74')];var _0x389c96;return db[_0xc5c3('0x80')][_0xc5c3('0x81')]({'where':{'id':_0x557b8f},'attributes':['id'],'include':[{'model':db[_0xc5c3('0x7c')],'as':'Agents','attributes':['id',_0xc5c3('0x2e'),'online',_0xc5c3('0x82'),_0xc5c3('0x83')],'raw':!![]}]})[_0xc5c3('0x2a')](function(_0x2c8937){if(_0x2c8937){_0x389c96=_0x2c8937;var _0x9e9372=_[_0xc5c3('0x84')](_0x2c8937,function(_0x1dcde5){var _0x2c8fdb=_0x1dcde5['get']({'plain':!![]});return _0x2c8fdb['Agents'];});return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x116965[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](function(_0x3cc60b){return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x2c5fd2){return _0x3cc60b[_0xc5c3('0x7f')](_0x557b8f,{'transaction':_0x2c5fd2})[_0xc5c3('0x2a')](function(){return BPromise[_0xc5c3('0x85')](_0x389c96,function(_0x554787){return db[_0xc5c3('0x86')][_0xc5c3('0x87')]({'TeamId':_0x554787['id'],'VoicePrefixId':_0x116965[_0xc5c3('0x4a')]['id']},{'transaction':_0x2c5fd2});});})[_0xc5c3('0x2a')](function(){return BPromise[_0xc5c3('0x85')](_0x9e9372,function(_0x589e28){return db[_0xc5c3('0x88')][_0xc5c3('0x89')]({'where':{'UserId':_0x589e28['id'],'VoicePrefixId':_0x116965[_0xc5c3('0x4a')]['id']},'transaction':_0x2c5fd2});});})['then'](function(){_0x9e9372[_0xc5c3('0x8a')](function(_0x2dd850){socket[_0xc5c3('0x79')](_0xc5c3('0x8b'),{'UserId':_0x2dd850['id'],'VoicePrefixId':_0x3cc60b['id']});});});});});}})[_0xc5c3('0x2a')](respondWithStatusCode(_0xa4672a,null))[_0xc5c3('0x48')](handleError(_0xa4672a,null));};exports[_0xc5c3('0x8c')]=function(_0x53a502,_0x762654,_0x37459f){return db['Team'][_0xc5c3('0x81')]({'where':{'id':_0x53a502[_0xc5c3('0x37')][_0xc5c3('0x74')]},'attributes':['id'],'include':[{'model':db[_0xc5c3('0x7c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc5c3('0x2a')](handleEntityNotFound(_0x762654,null))[_0xc5c3('0x2a')](function(_0x3aafa0){var _0xe80b2b=_[_0xc5c3('0x31')](_0x3aafa0,'id');var _0x2b49da=[];var _0x47bd08=[];var _0x314072=squel[_0xc5c3('0x8d')]();_0x314072['field'](_0xc5c3('0x8e'))['from'](_0xc5c3('0x8f'),'tq')[_0xc5c3('0x90')](_0xc5c3('0x91'),'ut',_0xc5c3('0x92'))['where']('VoicePrefixId\x20=\x20?',_0x53a502['params']['id']);for(var _0x3b5ca9=0x0;_0x3b5ca9<_0x3aafa0[_0xc5c3('0x3c')];_0x3b5ca9+=0x1){let _0x283935=_0x3aafa0[_0x3b5ca9];for(var _0x5cebbc=0x0;_0x5cebbc<_0x283935[_0xc5c3('0x93')]['length'];_0x5cebbc+=0x1){let _0x423b48=_0x283935[_0xc5c3('0x93')][_0x5cebbc];var _0x2a8dfc=_0x314072[_0xc5c3('0x94')]();_0x2a8dfc[_0xc5c3('0x41')](_0xc5c3('0x95'),_0x423b48['id']);_0x47bd08[_0xc5c3('0x69')](db[_0xc5c3('0x4f')][_0xc5c3('0x37')](_0x2a8dfc[_0xc5c3('0x96')](),{'type':db['sequelize'][_0xc5c3('0x97')]['SELECT']})[_0xc5c3('0x2a')](function(_0x397543){if(_0x397543[_0xc5c3('0x3c')]===0x1){return _0x423b48['id'];}else{var _0x21941a=_['every'](_[_0xc5c3('0x31')](_0x397543,_0xc5c3('0x98')),function(_0x1b7fc8){return _['includes'](_0xe80b2b,_0x1b7fc8);});if(_0x21941a){return _0x423b48['id'];}}}));}}return BPromise['all'](_0x47bd08)[_0xc5c3('0x2a')](function(_0x5731da){_0x2b49da=_(_0x2b49da)[_0xc5c3('0x99')](_0x5731da)[_0xc5c3('0x9a')]()['value']();return db[_0xc5c3('0x32')][_0xc5c3('0x4d')]({'where':{'id':_0x53a502['params']['id']}})['then'](function(_0x288b93){return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x187a7a){return _0x288b93['removeTeams'](_0x53a502[_0xc5c3('0x37')][_0xc5c3('0x74')],{'transaction':_0x187a7a})[_0xc5c3('0x2a')](function(){if(!_['isEmpty'](_0x2b49da)){return _0x288b93[_0xc5c3('0x76')](_0x2b49da,{'transaction':_0x187a7a});}})[_0xc5c3('0x2a')](function(){_0x2b49da['forEach'](function(_0x8ec6b6){socket[_0xc5c3('0x79')](_0xc5c3('0x78'),{'UserId':_0x8ec6b6,'VoicePrefixId':_0x288b93['id']});});});});});});})[_0xc5c3('0x2a')](respondWithStatusCode(_0x762654,null))[_0xc5c3('0x48')](handleError(_0x762654,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index c6d257a..8141b6d 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7a4=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hook'];(function(_0x139d3a,_0x23931e){var _0x345d6b=function(_0x3b1433){while(--_0x3b1433){_0x139d3a['push'](_0x139d3a['shift']());}};_0x345d6b(++_0x23931e);}(_0xe7a4,0x1a5));var _0x4e7a=function(_0x7590c4,_0x2a4ad2){_0x7590c4=_0x7590c4-0x0;var _0x3d922e=_0xe7a4[_0x7590c4];return _0x3d922e;};'use strict';var EventEmitter=require(_0x4e7a('0x0'));var VoicePrefix=require(_0x4e7a('0x1'))['db'][_0x4e7a('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4e7a('0x3')](0x0);var events={'afterCreate':_0x4e7a('0x4'),'afterUpdate':_0x4e7a('0x5'),'afterDestroy':_0x4e7a('0x6')};function emitEvent(_0x5adc35){return function(_0x527e3d,_0x5fd0de,_0xc6f6b){VoicePrefixEvents['emit'](_0x5adc35+':'+_0x527e3d['id'],_0x527e3d);VoicePrefixEvents[_0x4e7a('0x7')](_0x5adc35,_0x527e3d);_0xc6f6b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x4e7a('0x8')](e,emitEvent(event));}}module[_0x4e7a('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x1caa=['save','update','remove','hasOwnProperty','hook','exports','events','VoicePrefix','setMaxListeners'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0x1caa,0xba));var _0xa1ca=function(_0x52aad1,_0x2282bb){_0x52aad1=_0x52aad1-0x0;var _0x131f02=_0x1caa[_0x52aad1];return _0x131f02;};'use strict';var EventEmitter=require(_0xa1ca('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xa1ca('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa1ca('0x2')](0x0);var events={'afterCreate':_0xa1ca('0x3'),'afterUpdate':_0xa1ca('0x4'),'afterDestroy':_0xa1ca('0x5')};function emitEvent(_0x51e623){return function(_0x5437af,_0x526502,_0x78bfb0){VoicePrefixEvents['emit'](_0x51e623+':'+_0x5437af['id'],_0x5437af);VoicePrefixEvents['emit'](_0x51e623,_0x5437af);_0x78bfb0(null);};}for(var e in events){if(events[_0xa1ca('0x6')](e)){var event=events[e];VoicePrefix[_0xa1ca('0x7')](e,emitEvent(event));}}module[_0xa1ca('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index e99ba6b..3e0cc16 100644 --- a/server/api/voicePrefix/voicePrefix.model.js +++ b/server/api/voicePrefix/voicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab0e=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash'];(function(_0x523c8d,_0x6fa1ae){var _0x17ea25=function(_0x380940){while(--_0x380940){_0x523c8d['push'](_0x523c8d['shift']());}};_0x17ea25(++_0x6fa1ae);}(_0xab0e,0x1af));var _0xeab0=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xab0e[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xeab0('0x0'));var util=require(_0xeab0('0x1'));var logger=require(_0xeab0('0x2'))(_0xeab0('0x3'));var moment=require('moment');var BPromise=require(_0xeab0('0x4'));var rp=require(_0xeab0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeab0('0x6'));var config=require(_0xeab0('0x7'));var attributes=require(_0xeab0('0x8'));module[_0xeab0('0x9')]=function(_0x255971,_0x295d6a){return _0x255971['define'](_0xeab0('0xa'),attributes,{'tableName':_0xeab0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdad=['api','moment','request-promise','path','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','util'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xcdad,0x1a6));var _0xdcda=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xcdad[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0xdcda('0x0'));var logger=require('../../config/logger')(_0xdcda('0x1'));var moment=require(_0xdcda('0x2'));var BPromise=require('bluebird');var rp=require(_0xdcda('0x3'));var fs=require('fs');var path=require(_0xdcda('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdcda('0x5'));module[_0xdcda('0x6')]=function(_0x3cf540,_0x23a6ab){return _0x3cf540['define'](_0xdcda('0x7'),attributes,{'tableName':_0xdcda('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index bc29a22..fa3d7e5 100644 --- a/server/api/voicePrefix/voicePrefix.rpc.js +++ b/server/api/voicePrefix/voicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7804=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','code','VoicePrefix,\x20%s,\x20%s','error'];(function(_0x1c641e,_0x5e039b){var _0x34a3f9=function(_0x1cfe1f){while(--_0x1cfe1f){_0x1c641e['push'](_0x1c641e['shift']());}};_0x34a3f9(++_0x5e039b);}(_0x7804,0xc3));var _0x4780=function(_0x1b1b8b,_0x27d7d3){_0x1b1b8b=_0x1b1b8b-0x0;var _0x101d5f=_0x7804[_0x1b1b8b];return _0x101d5f;};'use strict';var _=require(_0x4780('0x0'));var util=require('util');var moment=require(_0x4780('0x1'));var BPromise=require(_0x4780('0x2'));var rs=require(_0x4780('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4780('0x4'))['db'];var utils=require(_0x4780('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4780('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4780('0x7')]({'port':0x232a});config[_0x4780('0x8')]=_[_0x4780('0x9')](config[_0x4780('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x4780('0xa'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x4780('0xb')](socket);function respondWithRpcPromise(_0x14be09,_0x2fc8a9,_0x45369b){return new BPromise(function(_0x4af80e,_0x5ca23a){return client[_0x4780('0xc')](_0x14be09,_0x45369b)[_0x4780('0xd')](function(_0x21d3d5){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x2fc8a9,_0x4780('0xe'));logger[_0x4780('0xf')](_0x4780('0x10'),_0x2fc8a9,_0x4780('0xe'),JSON[_0x4780('0x11')](_0x21d3d5));if(_0x21d3d5['error']){if(_0x21d3d5['error'][_0x4780('0x12')]===0x1f4){logger['error'](_0x4780('0x13'),_0x2fc8a9,_0x21d3d5[_0x4780('0x14')][_0x4780('0x15')]);return _0x5ca23a(_0x21d3d5[_0x4780('0x14')]['message']);}logger[_0x4780('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x2fc8a9,_0x21d3d5[_0x4780('0x14')][_0x4780('0x15')]);return _0x4af80e(_0x21d3d5[_0x4780('0x14')][_0x4780('0x15')]);}else{logger['info'](_0x4780('0x13'),_0x2fc8a9,'request\x20sent');_0x4af80e(_0x21d3d5[_0x4780('0x16')][_0x4780('0x15')]);}})[_0x4780('0x17')](function(_0x3af22f){logger['error'](_0x4780('0x13'),_0x2fc8a9,_0x3af22f);_0x5ca23a(_0x3af22f);});});} \ No newline at end of file +var _0xb145=['http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x143b98,_0x33e420){var _0x5a07be=function(_0x2eff14){while(--_0x2eff14){_0x143b98['push'](_0x143b98['shift']());}};_0x5a07be(++_0x33e420);}(_0xb145,0xa3));var _0x5b14=function(_0x10daf7,_0x2c2820){_0x10daf7=_0x10daf7-0x0;var _0xc0018b=_0xb145[_0x10daf7];return _0xc0018b;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});config['redis']=_[_0x5b14('0xc')](config[_0x5b14('0xd')],{'host':_0x5b14('0xe'),'port':0x18eb});var socket=require(_0x5b14('0xf'))(new Redis(config[_0x5b14('0xd')]));require('./voicePrefix.socket')[_0x5b14('0x10')](socket);function respondWithRpcPromise(_0x3bdb54,_0x4a4557,_0x1d8b5f){return new BPromise(function(_0x17047f,_0x1ecffb){return client[_0x5b14('0x11')](_0x3bdb54,_0x1d8b5f)[_0x5b14('0x12')](function(_0x4fb6da){logger[_0x5b14('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x4a4557,_0x5b14('0x14'));logger[_0x5b14('0x15')](_0x5b14('0x16'),_0x4a4557,_0x5b14('0x14'),JSON[_0x5b14('0x17')](_0x4fb6da));if(_0x4fb6da[_0x5b14('0x18')]){if(_0x4fb6da['error'][_0x5b14('0x19')]===0x1f4){logger[_0x5b14('0x18')](_0x5b14('0x1a'),_0x4a4557,_0x4fb6da[_0x5b14('0x18')][_0x5b14('0x1b')]);return _0x1ecffb(_0x4fb6da[_0x5b14('0x18')][_0x5b14('0x1b')]);}logger[_0x5b14('0x18')](_0x5b14('0x1a'),_0x4a4557,_0x4fb6da[_0x5b14('0x18')][_0x5b14('0x1b')]);return _0x17047f(_0x4fb6da[_0x5b14('0x18')]['message']);}else{logger[_0x5b14('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x4a4557,'request\x20sent');_0x17047f(_0x4fb6da['result'][_0x5b14('0x1b')]);}})[_0x5b14('0x1c')](function(_0x3662a7){logger[_0x5b14('0x18')](_0x5b14('0x1a'),_0x4a4557,_0x3662a7);_0x1ecffb(_0x3662a7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 818a3a4..e36a1bb 100644 --- a/server/api/voicePrefix/voicePrefix.socket.js +++ b/server/api/voicePrefix/voicePrefix.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9ad=['length','voicePrefix:','./voicePrefix.events','save','remove','update','removeListener','register'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xe9ad,0x82));var _0xde9a=function(_0x40ddc0,_0x41c082){_0x40ddc0=_0x40ddc0-0x0;var _0x1aebf1=_0xe9ad[_0x40ddc0];return _0x1aebf1;};'use strict';var VoicePrefixEvents=require(_0xde9a('0x0'));var events=[_0xde9a('0x1'),_0xde9a('0x2'),_0xde9a('0x3')];function createListener(_0x46f411,_0x398c3b){return function(_0x11047e){_0x398c3b['emit'](_0x46f411,_0x11047e);};}function removeListener(_0x30a58a,_0x28f94c){return function(){VoicePrefixEvents[_0xde9a('0x4')](_0x30a58a,_0x28f94c);};}exports[_0xde9a('0x5')]=function(_0x5290c5){for(var _0x27b380=0x0,_0x2bb666=events[_0xde9a('0x6')];_0x27b380<_0x2bb666;_0x27b380++){var _0x5d4412=events[_0x27b380];var _0x45d4a7=createListener(_0xde9a('0x7')+_0x5d4412,_0x5290c5);VoicePrefixEvents['on'](_0x5d4412,_0x45d4a7);}}; \ No newline at end of file +var _0x4584=['remove','update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x244862,_0x3da79e){var _0x2bce23=function(_0x235ae5){while(--_0x235ae5){_0x244862['push'](_0x244862['shift']());}};_0x2bce23(++_0x3da79e);}(_0x4584,0x1cf));var _0x4458=function(_0x17790d,_0x2532a6){_0x17790d=_0x17790d-0x0;var _0x59c20c=_0x4584[_0x17790d];return _0x59c20c;};'use strict';var VoicePrefixEvents=require(_0x4458('0x0'));var events=['save',_0x4458('0x1'),_0x4458('0x2')];function createListener(_0x23b438,_0x5340f5){return function(_0x570b9c){_0x5340f5[_0x4458('0x3')](_0x23b438,_0x570b9c);};}function removeListener(_0xde5996,_0x37118c){return function(){VoicePrefixEvents[_0x4458('0x4')](_0xde5996,_0x37118c);};}exports[_0x4458('0x5')]=function(_0xbf85ca){for(var _0x175c2d=0x0,_0x215b2d=events[_0x4458('0x6')];_0x175c2d<_0x215b2d;_0x175c2d++){var _0x51da14=events[_0x175c2d];var _0x14bb0f=createListener(_0x4458('0x7')+_0x51da14,_0xbf85ca);VoicePrefixEvents['on'](_0x51da14,_0x14bb0f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 08cae79..f8aac79 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xb10b,0x12a));var _0xbb10=function(_0x40001a,_0x57f2ae){_0x40001a=_0x40001a-0x0;var _0x4cec45=_0xb10b[_0x40001a];return _0x4cec45;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x45ab7c,_0x2e0b88){var _0x1390db=function(_0xac69f1){while(--_0xac69f1){_0x45ab7c['push'](_0x45ab7c['shift']());}};_0x1390db(++_0x2e0b88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index f821e29..417acb9 100644 --- a/server/api/voiceQueue/voiceQueue.attributes.js +++ b/server/api/voiceQueue/voiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1838=['linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','predictive','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\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\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','inbound','outbound','default','ENUM','ringall','leastrecent','fewestcalls','random','rrmemory'];(function(_0x5f3bbb,_0x2a2d7b){var _0x4fe990=function(_0x3e70a2){while(--_0x3e70a2){_0x5f3bbb['push'](_0x5f3bbb['shift']());}};_0x4fe990(++_0x2a2d7b);}(_0x1838,0x98));var _0x8183=function(_0x24a177,_0x3f18f8){_0x24a177=_0x24a177-0x0;var _0x146fe0=_0x1838[_0x24a177];return _0x146fe0;};'use strict';var Sequelize=require('sequelize');module[_0x8183('0x0')]={'name':{'type':Sequelize[_0x8183('0x1')],'allowNull':![],'unique':_0x8183('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x8183('0x3'),_0x8183('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x8183('0x1')],'defaultValue':_0x8183('0x5')},'announce':{'type':Sequelize[_0x8183('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x8183('0x6')]('rr',_0x8183('0x7'),_0x8183('0x8'),_0x8183('0x9'),_0x8183('0xa'),_0x8183('0xb'),_0x8183('0xc'),_0x8183('0xd'),_0x8183('0xe')),'allowNull':![],'defaultValue':_0x8183('0x7'),'set':function(_0x4bf245){this[_0x8183('0xf')](_0x8183('0x10'),_0x4bf245?_0x4bf245:_0x8183('0xb'));},'get':function(){var _0x513737=this[_0x8183('0x11')]('type');var _0x2a6c11=this[_0x8183('0x11')](_0x8183('0x12'));var _0x13693c=this['getDataValue']('strategy');if(_0x513737==='outbound'){if(_0x2a6c11===_0x8183('0x13')){return null;}if(_0x2a6c11===_0x8183('0x14')&&![_0x8183('0xb'),_0x8183('0x15')][_0x8183('0x16')](_0x13693c)){this[_0x8183('0xf')]('strategy',_0x8183('0xb'));}}return _0x13693c;}},'servicelevel':{'type':Sequelize[_0x8183('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8183('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8183('0x17')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8183('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8183('0x1')]},'weight':{'type':Sequelize[_0x8183('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8183('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x18'),'no'),'defaultValue':_0x8183('0x18')},'autopause':{'type':Sequelize[_0x8183('0x6')]('yes','no',_0x8183('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8183('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8183('0x6')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8183('0x6')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8183('0x6')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8183('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8183('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8183('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8183('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x18'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x8183('0x18'),'no',_0x8183('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8183('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x8183('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x8183('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8183('0x1')]},'queue_youarenext':{'type':Sequelize[_0x8183('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8183('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8183('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8183('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8183('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8183('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8183('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8183('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8183('0x1')]},'queue_quantity1':{'type':Sequelize[_0x8183('0x1')]},'queue_quantity2':{'type':Sequelize[_0x8183('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x8183('0x1')]},'queue_less_than':{'type':Sequelize[_0x8183('0x1')]},'periodic_announce':{'type':Sequelize[_0x8183('0x1b')],'set':function(_0x40036d){this[_0x8183('0xf')](_0x8183('0x1c'),_0x40036d?_0x40036d[_0x8183('0x1d')](','):[]);},'get':function(){return this[_0x8183('0x11')](_0x8183('0x1c'))?this[_0x8183('0x11')]('periodic_announce')[_0x8183('0x1e')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x8183('0x18'),'set':function(_0x45ce71){this[_0x8183('0xf')](_0x8183('0x1f'),_0x45ce71?_0x45ce71[_0x8183('0x1d')](','):undefined);},'get':function(){return this[_0x8183('0x11')]('joinempty')?this['getDataValue'](_0x8183('0x1f'))[_0x8183('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8183('0x1')],'defaultValue':'no','set':function(_0x360776){this[_0x8183('0xf')](_0x8183('0x20'),_0x360776?_0x360776[_0x8183('0x1d')](','):undefined);},'get':function(){return this[_0x8183('0x11')](_0x8183('0x20'))?this[_0x8183('0x11')](_0x8183('0x20'))[_0x8183('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8183('0x6')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8183('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8183('0x1')]},'description':{'type':Sequelize[_0x8183('0x1')]},'acw':{'type':Sequelize[_0x8183('0x21')],'defaultValue':0x0,'set':function(_0x4a4597){this[_0x8183('0xf')](_0x8183('0x22'),_0x4a4597);if(_0x4a4597){if(this[_0x8183('0x11')](_0x8183('0x23'))<0x2){this[_0x8183('0xf')](_0x8183('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8183('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8183('0x21')],'defaultValue':0x0,'comment':_0x8183('0x24')},'dialMethod':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x13'),_0x8183('0x25'),'power',_0x8183('0x26'),_0x8183('0x14')),'defaultValue':_0x8183('0x25'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x8183('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x8183('0x17')](0x4)[_0x8183('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x8183('0x28')](0x2)[_0x8183('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8183('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x8183('0x2a'),_0x8183('0x2b')),'defaultValue':_0x8183('0x2b'),'comment':_0x8183('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8183('0x28')](0x2)[_0x8183('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8183('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x8183('0x17')](0x3)[_0x8183('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8183('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8183('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x8183('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8183('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x8183('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x8183('0x17')](0x3)[_0x8183('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8183('0x31')},'dialQueueProject':{'type':Sequelize[_0x8183('0x1')],'comment':_0x8183('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8183('0x17')](0x3)[_0x8183('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8183('0x17')](0x5)[_0x8183('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8183('0x33')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8183('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8183('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8183('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8183('0x17')](0x3)[_0x8183('0x27')],'defaultValue':0x3,'comment':_0x8183('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8183('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8183('0x36')},'dialTimezone':{'type':Sequelize[_0x8183('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8183('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x8183('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x37'),_0x8183('0x38'),_0x8183('0x39')),'defaultValue':_0x8183('0x37')},'dialAMDActive':{'type':Sequelize[_0x8183('0x21')],'defaultValue':0x0,'comment':_0x8183('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x8183('0x17')](0x9)[_0x8183('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8183('0x3b')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8183('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8183('0x17')](0x9)[_0x8183('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x8183('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8183('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x8183('0x17')](0x9)[_0x8183('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8183('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8183('0x17')](0x9)[_0x8183('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8183('0x17')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8183('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8183('0x17')](0x5)[_0x8183('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8183('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8183('0x17')](0x9)[_0x8183('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8183('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x8183('0x17')](0x5)[_0x8183('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8183('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8183('0x6')](_0x8183('0x43'),_0x8183('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x8183('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8183('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8183('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8183('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x8183('0x17')](0x3)[_0x8183('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8183('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8183('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8183('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8183('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8183('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x8183('0x17')](0x3)[_0x8183('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8183('0x48')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8183('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8183('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8183('0x17')](0x3)[_0x8183('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8183('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8183('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x8183('0x17')](0x3)[_0x8183('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8183('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8183('0x17')](0x5)[_0x8183('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8183('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8183('0x17')](0x5)[_0x8183('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8183('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8183('0x17')],'allowNull':!![],'comment':_0x8183('0x4e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8183('0x4f'),'set':function(_0x1cba0e){if(!_0x1cba0e)this['setDataValue'](_0x8183('0x50'),null);this['setDataValue'](_0x8183('0x51'),_0x1cba0e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8183('0x17')](0x3)[_0x8183('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8183('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x8183('0x17')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8183('0x21')],'defaultValue':![]}}; \ No newline at end of file +var _0x3bba=['tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#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','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','STRING','name','ENUM','inbound','ringall','fewestcalls','random','rrmemory','rrordered','setDataValue','dialMethod','getDataValue','preview','booked','roundrobin','includes','strategy','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','BOOLEAN','acw','wrapuptime','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x56bf20,_0x282628){var _0x3bcf57=function(_0x12a6c5){while(--_0x12a6c5){_0x56bf20['push'](_0x56bf20['shift']());}};_0x3bcf57(++_0x282628);}(_0x3bba,0x186));var _0xa3bb=function(_0x23a145,_0x3ba4f8){_0x23a145=_0x23a145-0x0;var _0x17070e=_0x3bba[_0x23a145];return _0x17070e;};'use strict';var Sequelize=require('sequelize');module[_0xa3bb('0x0')]={'name':{'type':Sequelize[_0xa3bb('0x1')],'allowNull':![],'unique':_0xa3bb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x4'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xa3bb('0x5'),'leastrecent',_0xa3bb('0x6'),_0xa3bb('0x7'),_0xa3bb('0x8'),'linear','wrandom',_0xa3bb('0x9')),'allowNull':![],'defaultValue':_0xa3bb('0x5'),'set':function(_0x48c53b){this[_0xa3bb('0xa')]('strategy',_0x48c53b?_0x48c53b:_0xa3bb('0x8'));},'get':function(){var _0x2b84e2=this['getDataValue']('type');var _0x331a98=this['getDataValue'](_0xa3bb('0xb'));var _0x303fcc=this[_0xa3bb('0xc')]('strategy');if(_0x2b84e2==='outbound'){if(_0x331a98===_0xa3bb('0xd')){return null;}if(_0x331a98===_0xa3bb('0xe')&&![_0xa3bb('0x8'),_0xa3bb('0xf')][_0xa3bb('0x10')](_0x303fcc)){this['setDataValue'](_0xa3bb('0x11'),_0xa3bb('0x8'));}}return _0x303fcc;}},'servicelevel':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa3bb('0x12')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xa3bb('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa3bb('0x12')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa3bb('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa3bb('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xa3bb('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xa3bb('0x13'),'no'),'defaultValue':_0xa3bb('0x13')},'announce_holdtime':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no',_0xa3bb('0x14')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no')},'announce_position_limit':{'type':Sequelize[_0xa3bb('0x12')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa3bb('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa3bb('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xa3bb('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xa3bb('0x1')]},'queue_less_than':{'type':Sequelize[_0xa3bb('0x1')]},'periodic_announce':{'type':Sequelize[_0xa3bb('0x15')],'set':function(_0xee954b){this['setDataValue'](_0xa3bb('0x16'),_0xee954b?_0xee954b[_0xa3bb('0x17')](','):[]);},'get':function(){return this[_0xa3bb('0xc')](_0xa3bb('0x16'))?this['getDataValue'](_0xa3bb('0x16'))[_0xa3bb('0x18')](','):[];}},'joinempty':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':_0xa3bb('0x13'),'set':function(_0x22fc4b){this['setDataValue'](_0xa3bb('0x19'),_0x22fc4b?_0x22fc4b[_0xa3bb('0x17')](','):undefined);},'get':function(){return this['getDataValue'](_0xa3bb('0x19'))?this[_0xa3bb('0xc')]('joinempty')[_0xa3bb('0x18')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':'no','set':function(_0x4abe89){this[_0xa3bb('0xa')]('leavewhenempty',_0x4abe89?_0x4abe89[_0xa3bb('0x17')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0xa3bb('0xc')]('leavewhenempty')[_0xa3bb('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xa3bb('0x1')]},'description':{'type':Sequelize[_0xa3bb('0x1')]},'acw':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':0x0,'set':function(_0x1475b5){this['setDataValue'](_0xa3bb('0x1b'),_0x1475b5);if(_0x1475b5){if(this[_0xa3bb('0xc')](_0xa3bb('0x1c'))<0x2){this['setDataValue'](_0xa3bb('0x1c'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0xd'),_0xa3bb('0x1d'),_0xa3bb('0x1e'),_0xa3bb('0x1f'),_0xa3bb('0xe')),'defaultValue':_0xa3bb('0x1d'),'comment':_0xa3bb('0x20')},'dialLimitChannel':{'type':Sequelize[_0xa3bb('0x12')](0x4)[_0xa3bb('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa3bb('0x22')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xa3bb('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa3bb('0x23')},'dialPowerLevel':{'type':Sequelize[_0xa3bb('0x24')](0x2)[_0xa3bb('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xa3bb('0x25')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xa3bb('0x26'),'dropRate'),'defaultValue':_0xa3bb('0x27'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xa3bb('0x24')](0x2)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa3bb('0x28')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xa3bb('0x21')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xa3bb('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa3bb('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa3bb('0x12')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x29')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xa3bb('0x2a'),'comment':_0xa3bb('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x2c')},'dialQueueProject':{'type':Sequelize[_0xa3bb('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x2d')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'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['INTEGER'](0x3)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa3bb('0x2e')},'dialTimezone':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':_0xa3bb('0x2f')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xa3bb('0x30'),_0xa3bb('0x31'),'onlyIfOpen'),'defaultValue':_0xa3bb('0x30')},'dialAMDActive':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':0x0,'comment':_0xa3bb('0x32')},'dialAMDInitialSilence':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa3bb('0x33')},'dialAMDGreeting':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa3bb('0x34')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa3bb('0x35')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa3bb('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa3bb('0x36')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa3bb('0x37')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa3bb('0x38')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa3bb('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa3bb('0x39')},'dialRecallMeTimeout':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xa3bb('0x3a')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa3bb('0x3')]('DESC',_0xa3bb('0x3b')),'defaultValue':_0xa3bb('0x3c')},'dialQueueProject2':{'type':Sequelize[_0xa3bb('0x1')],'comment':_0xa3bb('0x3d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa3bb('0x3e')},'dialCutDigit':{'type':Sequelize[_0xa3bb('0x12')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa3bb('0x40')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x41')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa3bb('0x42')},'dialMachineMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x43')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa3bb('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa3bb('0x44')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa3bb('0x12')],'allowNull':!![],'comment':_0xa3bb('0x45')},'mandatoryDisposition':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':![],'comment':_0xa3bb('0x46'),'set':function(_0x1b29a0){if(!_0x1b29a0)this[_0xa3bb('0xa')](_0xa3bb('0x47'),null);this[_0xa3bb('0xa')]('mandatoryDisposition',_0x1b29a0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xa3bb('0x12')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 22b412a..113fd3a 100644 --- a/server/api/voiceQueue/voiceQueue.controller.js +++ b/server/api/voiceQueue/voiceQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40f3=['VoiceQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','options','omit','createdAt','updatedAt','update','destroy','VoiceQueueId','CmHopper','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','User','Agents','online','voicePause','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','findOrCreate','isNil','interface','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','ids','isEmpty','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','push','all','removeAgents','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','field','phone','CmListId','ListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','insert','ContactId','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_contacts','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','rimraf','zip-dir','request-promise','moment','util','path','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','./voiceQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','inbound','QueueCampaigns','outbound','ignore','value','type','find','name','UserProfileResource','end','error','map'];(function(_0x50aec5,_0x12464c){var _0x3b86c4=function(_0x4d457b){while(--_0x4d457b){_0x50aec5['push'](_0x50aec5['shift']());}};_0x3b86c4(++_0x12464c);}(_0x40f3,0x8b));var _0x340f=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x40f3[_0x2eb5bc];return _0x51c7b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x340f('0x0'));var zipdir=require(_0x340f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x340f('0x2'));var moment=require(_0x340f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x340f('0x4'));var path=require(_0x340f('0x5'));var sox=require('sox');var csv=require(_0x340f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x340f('0x7'));var squel=require(_0x340f('0x8'));var crypto=require(_0x340f('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x340f('0x6'));var querystring=require(_0x340f('0xa'));var Papa=require(_0x340f('0xb'));var Redis=require(_0x340f('0xc'));var authService=require(_0x340f('0xd'));var qs=require(_0x340f('0xe'));var as=require(_0x340f('0xf'));var hardwareService=require(_0x340f('0x10'));var logger=require(_0x340f('0x11'))(_0x340f('0x12'));var utils=require(_0x340f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x340f('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x340f('0x15')](config[_0x340f('0x16')],{'host':_0x340f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x340f('0x16')]));require(_0x340f('0x18'))[_0x340f('0x19')](socket);function respondWithStatusCode(_0x20beeb,_0x58e42f){_0x58e42f=_0x58e42f||0xcc;return function(_0x2fb52a){if(_0x2fb52a){return _0x20beeb[_0x340f('0x1a')](_0x58e42f);}return _0x20beeb[_0x340f('0x1b')](_0x58e42f)['end']();};}function respondWithResult(_0x14d631,_0x230101){_0x230101=_0x230101||0xc8;return function(_0x490ae6){if(_0x490ae6){return _0x14d631[_0x340f('0x1b')](_0x230101)[_0x340f('0x1c')](_0x490ae6);}};}function respondWithFilteredResult(_0x5c36ea,_0x2faf3c){return function(_0x55714f){if(_0x55714f){var _0x4fa470=typeof _0x2faf3c[_0x340f('0x1d')]==='undefined'&&typeof _0x2faf3c[_0x340f('0x1e')]===_0x340f('0x1f');var _0x3dede2=_0x55714f[_0x340f('0x20')];var _0x550762=_0x4fa470?0x0:_0x2faf3c['offset'];var _0x205fe2=_0x4fa470?_0x55714f[_0x340f('0x20')]:_0x2faf3c[_0x340f('0x1d')]+_0x2faf3c[_0x340f('0x1e')];var _0xe85ff2;if(_0x205fe2>=_0x3dede2){_0x205fe2=_0x3dede2;_0xe85ff2=0xc8;}else{_0xe85ff2=0xce;}_0x5c36ea[_0x340f('0x1b')](_0xe85ff2);return _0x5c36ea[_0x340f('0x21')](_0x340f('0x22'),_0x550762+'-'+_0x205fe2+'/'+_0x3dede2)[_0x340f('0x1c')](_0x55714f);}return null;};}function patchUpdates(_0x36a845){return function(_0x553287){try{jsonpatch[_0x340f('0x23')](_0x553287,_0x36a845,!![]);}catch(_0x3f0c03){return BPromise[_0x340f('0x24')](_0x3f0c03);}return _0x553287[_0x340f('0x25')]();};}function saveUpdates(_0x4acba5,_0x1d9d42){return function(_0x59db07){if(_0x59db07){return _0x59db07['update'](_0x4acba5)[_0x340f('0x26')](function(_0x3aee9c){return _0x3aee9c;});}return null;};}function removeEntity(_0x5c0034,_0x805a20){return function(_0xc809c1){if(_0xc809c1){return _0xc809c1['destroy']()[_0x340f('0x26')](function(){var _0x265543=_0xc809c1[_0x340f('0x27')]({'plain':!![]});var _0x1524c4=[{'name':'VoiceQueues','value':_0x340f('0x28'),'ignore':![]},{'name':_0x340f('0x29'),'value':_0x340f('0x2a'),'ignore':![]}];var _0x481685=_(_0x1524c4)['filter'](_0x340f('0x2b'))['map'](_0x340f('0x2c'))[_0x340f('0x2c')]();if(_['includes'](_0x481685,_0x265543[_0x340f('0x2d')])){return;}var _0x3c524b=_[_0x340f('0x2e')](_0x1524c4,[_0x340f('0x2c'),_0x265543[_0x340f('0x2d')]])[_0x340f('0x2f')];return db[_0x340f('0x30')]['destroy']({'where':{'type':_0x3c524b,'resourceId':_0x265543['id']}})[_0x340f('0x26')](function(){return _0xc809c1;});})['then'](function(){_0x5c0034[_0x340f('0x1b')](0xcc)[_0x340f('0x31')]();});}};}function handleEntityNotFound(_0x49fcdb,_0x1dfeda){return function(_0x1eedb4){if(!_0x1eedb4){_0x49fcdb[_0x340f('0x1a')](0x194);}return _0x1eedb4;};}function handleError(_0x11ada0,_0x42f147){_0x42f147=_0x42f147||0x1f4;return function(_0x590d2f){logger[_0x340f('0x32')](_0x590d2f['stack']);if(_0x590d2f[_0x340f('0x2f')]){delete _0x590d2f[_0x340f('0x2f')];}_0x11ada0[_0x340f('0x1b')](_0x42f147)['send'](_0x590d2f);};}exports['index']=function(_0x3f6a62,_0x150204){var _0x1e0b18={},_0x20a72f={},_0x13f98f={'count':0x0,'rows':[]};var _0x547e84=_[_0x340f('0x33')](db[_0x340f('0x34')][_0x340f('0x35')],function(_0x3bbfe5){return{'name':_0x3bbfe5[_0x340f('0x36')],'type':_0x3bbfe5[_0x340f('0x2d')][_0x340f('0x37')]};});_0x20a72f[_0x340f('0x38')]=_[_0x340f('0x33')](_0x547e84,_0x340f('0x2f'));_0x20a72f['query']=_[_0x340f('0x39')](_0x3f6a62[_0x340f('0x3a')]);_0x20a72f[_0x340f('0x3b')]=_[_0x340f('0x3c')](_0x20a72f[_0x340f('0x38')],_0x20a72f[_0x340f('0x3a')]);_0x1e0b18['attributes']=_['intersection'](_0x20a72f['model'],qs[_0x340f('0x3d')](_0x3f6a62[_0x340f('0x3a')][_0x340f('0x3d')]));_0x1e0b18[_0x340f('0x3e')]=_0x1e0b18[_0x340f('0x3e')]['length']?_0x1e0b18['attributes']:_0x20a72f[_0x340f('0x38')];if(!_0x3f6a62[_0x340f('0x3a')][_0x340f('0x3f')](_0x340f('0x40'))){_0x1e0b18[_0x340f('0x1e')]=qs[_0x340f('0x1e')](_0x3f6a62[_0x340f('0x3a')]['limit']);_0x1e0b18['offset']=qs[_0x340f('0x1d')](_0x3f6a62[_0x340f('0x3a')]['offset']);}_0x1e0b18[_0x340f('0x41')]=qs[_0x340f('0x42')](_0x3f6a62[_0x340f('0x3a')][_0x340f('0x42')]);_0x1e0b18['where']=qs[_0x340f('0x3b')](_[_0x340f('0x43')](_0x3f6a62[_0x340f('0x3a')],_0x20a72f[_0x340f('0x3b')]),_0x547e84);if(_0x3f6a62[_0x340f('0x3a')][_0x340f('0x44')]){_0x1e0b18[_0x340f('0x45')]=_[_0x340f('0x46')](_0x1e0b18[_0x340f('0x45')],{'$or':_[_0x340f('0x33')](_0x547e84,function(_0x4eb80d){if(_0x4eb80d['type']!==_0x340f('0x47')){var _0x2fb3ee={};_0x2fb3ee[_0x4eb80d[_0x340f('0x2f')]]={'$like':'%'+_0x3f6a62[_0x340f('0x3a')][_0x340f('0x44')]+'%'};return _0x2fb3ee;}})});}_0x1e0b18=_[_0x340f('0x46')]({},_0x1e0b18,_0x3f6a62['options']);var _0x423291={'where':_0x1e0b18[_0x340f('0x45')]};return db['VoiceQueue'][_0x340f('0x20')](_0x423291)[_0x340f('0x26')](function(_0x444f35){_0x13f98f[_0x340f('0x20')]=_0x444f35;if(_0x3f6a62[_0x340f('0x3a')][_0x340f('0x48')]){_0x1e0b18[_0x340f('0x49')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x1e0b18);})[_0x340f('0x26')](function(_0x3a9193){_0x13f98f[_0x340f('0x4a')]=_0x3a9193;return _0x13f98f;})[_0x340f('0x26')](respondWithFilteredResult(_0x150204,_0x1e0b18))[_0x340f('0x4b')](handleError(_0x150204,null));};exports[_0x340f('0x4c')]=function(_0x4d84d4,_0x1c3895){var _0x125057={'raw':![],'where':{'id':_0x4d84d4['params']['id']}},_0x24f2d1={};_0x24f2d1[_0x340f('0x38')]=_[_0x340f('0x39')](db[_0x340f('0x34')]['rawAttributes']);_0x24f2d1[_0x340f('0x3a')]=_[_0x340f('0x39')](_0x4d84d4[_0x340f('0x3a')]);_0x24f2d1['filters']=_['intersection'](_0x24f2d1[_0x340f('0x38')],_0x24f2d1[_0x340f('0x3a')]);_0x125057[_0x340f('0x3e')]=_[_0x340f('0x3c')](_0x24f2d1['model'],qs['fields'](_0x4d84d4[_0x340f('0x3a')][_0x340f('0x3d')]));_0x125057[_0x340f('0x3e')]=_0x125057[_0x340f('0x3e')][_0x340f('0x4d')]?_0x125057[_0x340f('0x3e')]:_0x24f2d1[_0x340f('0x38')];if(_0x4d84d4[_0x340f('0x3a')][_0x340f('0x48')]){_0x125057['include']=[{'all':!![]}];}_0x125057=_['merge']({},_0x125057,_0x4d84d4['options']);return db[_0x340f('0x34')]['find'](_0x125057)[_0x340f('0x26')](handleEntityNotFound(_0x1c3895,null))[_0x340f('0x26')](respondWithResult(_0x1c3895,null))['catch'](handleError(_0x1c3895,null));};exports['create']=function(_0x48d15e,_0x19cef1){return db[_0x340f('0x34')][_0x340f('0x4e')](_0x48d15e[_0x340f('0x4f')],{})['then'](function(_0x5a4550){var _0x5df4fe=_0x48d15e['user'][_0x340f('0x27')]({'plain':!![]});if(!_0x5df4fe)throw new Error(_0x340f('0x50'));if(_0x5df4fe[_0x340f('0x51')]===_0x340f('0x52')){var _0x2384e0=_0x5a4550[_0x340f('0x27')]({'plain':!![]});var _0x3e42f5=[{'name':_0x340f('0x53'),'value':_0x340f('0x28')},{'name':_0x340f('0x29'),'value':_0x340f('0x2a')}];var _0x1bbb8e=_[_0x340f('0x2e')](_0x3e42f5,[_0x340f('0x2c'),_0x2384e0['type']])[_0x340f('0x2f')];return db[_0x340f('0x54')][_0x340f('0x2e')]({'where':{'name':_0x1bbb8e,'userProfileId':_0x5df4fe[_0x340f('0x55')]},'raw':!![]})[_0x340f('0x26')](function(_0x402ed4){if(_0x402ed4&&_0x402ed4[_0x340f('0x56')]===0x0){return db[_0x340f('0x30')][_0x340f('0x4e')]({'name':_0x2384e0[_0x340f('0x2f')],'resourceId':_0x2384e0['id'],'type':_0x402ed4['name'],'sectionId':_0x402ed4['id']},{})[_0x340f('0x26')](function(){return _0x5a4550;});}else{return _0x5a4550;}})[_0x340f('0x4b')](function(_0xd17fce){logger[_0x340f('0x32')](_0x340f('0x57'),_0xd17fce);throw _0xd17fce;});}return _0x5a4550;})['then'](respondWithResult(_0x19cef1,0xc9))[_0x340f('0x4b')](handleError(_0x19cef1,null));};exports[_0x340f('0x58')]=function(_0x241b76,_0x101eeb){var _0x9a40b4={'where':{'id':_0x241b76[_0x340f('0x59')]['id']}},_0x4690e9={};_0x4690e9[_0x340f('0x38')]=_[_0x340f('0x39')](db[_0x340f('0x34')][_0x340f('0x35')]);_0x9a40b4['attributes']=_[_0x340f('0x3c')](_0x4690e9[_0x340f('0x38')],qs[_0x340f('0x3d')](_0x241b76[_0x340f('0x3a')][_0x340f('0x3d')]));_0x9a40b4[_0x340f('0x3e')]=_0x9a40b4[_0x340f('0x3e')][_0x340f('0x4d')]?_0x9a40b4['attributes']:_0x4690e9[_0x340f('0x38')];if(_0x241b76[_0x340f('0x3a')][_0x340f('0x48')]){_0x9a40b4['include']=[{'all':!![]}];}_0x9a40b4=_['merge']({},_0x9a40b4,_0x241b76[_0x340f('0x5a')]);return db[_0x340f('0x34')][_0x340f('0x2e')](_0x9a40b4)[_0x340f('0x26')](handleEntityNotFound(_0x101eeb,null))[_0x340f('0x26')](function(_0x520258){if(_0x520258){var _0x440791=_0x520258[_0x340f('0x27')]({'plain':!![]});_0x440791=qs[_0x340f('0x5b')](_0x440791,['id',_0x340f('0x5c'),_0x340f('0x5d')]);_0x241b76[_0x340f('0x4f')]=_[_0x340f('0x5b')](_0x241b76[_0x340f('0x4f')],['id',_0x340f('0x5c'),_0x340f('0x5d')]);return db[_0x340f('0x34')]['create'](_[_0x340f('0x46')](_0x440791,_0x241b76[_0x340f('0x4f')]),{'include':_0x241b76['query'][_0x340f('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x4c2b77){var _0xad0d8f=_0x241b76[_0x340f('0x52')][_0x340f('0x27')]({'plain':!![]});if(!_0xad0d8f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xad0d8f['role']===_0x340f('0x52')){var _0x352b5b=_0x4c2b77[_0x340f('0x27')]({'plain':!![]});var _0x37b177=[{'name':_0x340f('0x53'),'value':_0x340f('0x28')},{'name':_0x340f('0x29'),'value':_0x340f('0x2a')}];var _0x2562c6=_['find'](_0x37b177,['value',_0x352b5b[_0x340f('0x2d')]])[_0x340f('0x2f')];return db[_0x340f('0x54')][_0x340f('0x2e')]({'where':{'name':_0x2562c6,'userProfileId':_0xad0d8f[_0x340f('0x55')]},'raw':!![]})[_0x340f('0x26')](function(_0x41aa2){if(_0x41aa2&&_0x41aa2['autoAssociation']===0x0){return db['UserProfileResource'][_0x340f('0x4e')]({'name':_0x352b5b[_0x340f('0x2f')],'resourceId':_0x352b5b['id'],'type':_0x41aa2[_0x340f('0x2f')],'sectionId':_0x41aa2['id']},{})['then'](function(){return _0x4c2b77;});}else{return _0x4c2b77;}})[_0x340f('0x4b')](function(_0x3fbac0){logger[_0x340f('0x32')](_0x340f('0x57'),_0x3fbac0);throw _0x3fbac0;});}return _0x4c2b77;});}})[_0x340f('0x26')](respondWithResult(_0x101eeb,0xc9))['catch'](handleError(_0x101eeb,null));};exports[_0x340f('0x5e')]=function(_0x4b5088,_0x5dc17b){if(_0x4b5088[_0x340f('0x4f')]['id']){delete _0x4b5088['body']['id'];}return db['VoiceQueue'][_0x340f('0x2e')]({'where':{'id':_0x4b5088['params']['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x5dc17b,null))[_0x340f('0x26')](saveUpdates(_0x4b5088['body'],null))[_0x340f('0x26')](respondWithResult(_0x5dc17b,null))[_0x340f('0x4b')](handleError(_0x5dc17b,null));};exports[_0x340f('0x5f')]=function(_0x1ba95a,_0x5d66a5){return db[_0x340f('0x34')][_0x340f('0x2e')]({'where':{'id':_0x1ba95a['params']['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x5d66a5,null))[_0x340f('0x26')](removeEntity(_0x5d66a5,null))[_0x340f('0x4b')](handleError(_0x5d66a5,null));};exports['getHoppers']=function(_0x33cca7,_0x187a96,_0x332d74){var _0x11496c={'raw':![],'where':{}};var _0x1e4b16={};var _0x579d0b={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x33cca7[_0x340f('0x59')]['id']}})['then'](handleEntityNotFound(_0x187a96,null))[_0x340f('0x26')](function(_0xc1c37){if(_0xc1c37){_0x1e4b16['model']=_[_0x340f('0x39')](db['CmHopper'][_0x340f('0x35')]);_0x1e4b16[_0x340f('0x3a')]=_[_0x340f('0x39')](_0x33cca7['query']);_0x1e4b16[_0x340f('0x3b')]=_[_0x340f('0x3c')](_0x1e4b16[_0x340f('0x38')],_0x1e4b16[_0x340f('0x3a')]);_0x11496c[_0x340f('0x3e')]=_[_0x340f('0x3c')](_0x1e4b16['model'],qs['fields'](_0x33cca7[_0x340f('0x3a')][_0x340f('0x3d')]));_0x11496c[_0x340f('0x3e')]=_0x11496c[_0x340f('0x3e')]['length']?_0x11496c[_0x340f('0x3e')]:_0x1e4b16[_0x340f('0x38')];if(!_0x33cca7[_0x340f('0x3a')][_0x340f('0x3f')](_0x340f('0x40'))){_0x11496c[_0x340f('0x1e')]=qs[_0x340f('0x1e')](_0x33cca7['query'][_0x340f('0x1e')]);_0x11496c[_0x340f('0x1d')]=qs[_0x340f('0x1d')](_0x33cca7[_0x340f('0x3a')][_0x340f('0x1d')]);}_0x11496c['order']=qs['sort'](_0x33cca7['query'][_0x340f('0x42')]);_0x11496c[_0x340f('0x45')]=qs[_0x340f('0x3b')](_[_0x340f('0x43')](_0x33cca7[_0x340f('0x3a')],_0x1e4b16[_0x340f('0x3b')]));_0x11496c[_0x340f('0x45')][_0x340f('0x60')]=_0xc1c37['id'];if(_0x33cca7[_0x340f('0x3a')][_0x340f('0x44')]){_0x11496c[_0x340f('0x45')]=_[_0x340f('0x46')](_0x11496c[_0x340f('0x45')],{'$or':_[_0x340f('0x33')](_0x11496c[_0x340f('0x3e')],function(_0x2871f1){var _0x272ee9={};_0x272ee9[_0x2871f1]={'$like':'%'+_0x33cca7['query']['filter']+'%'};return _0x272ee9;})});}_0x11496c=_[_0x340f('0x46')]({},_0x11496c,_0x33cca7[_0x340f('0x5a')]);return db[_0x340f('0x61')][_0x340f('0x20')]({'where':_0x11496c[_0x340f('0x45')]})[_0x340f('0x26')](function(_0x4a5921){_0x579d0b[_0x340f('0x20')]=_0x4a5921;if(_0x33cca7[_0x340f('0x3a')][_0x340f('0x48')]){_0x11496c[_0x340f('0x49')]=[{'all':!![]}];}return db[_0x340f('0x61')][_0x340f('0x62')](_0x11496c);})[_0x340f('0x26')](function(_0x587613){_0x579d0b[_0x340f('0x4a')]=_0x587613;return _0x579d0b;});}})[_0x340f('0x26')](respondWithFilteredResult(_0x187a96,_0x11496c))['catch'](handleError(_0x187a96,null));};exports[_0x340f('0x63')]=function(_0x3038c5,_0x3b9ab9,_0x5dae7b){var _0x40a040={'raw':!![],'where':{}};var _0x4a1d50={};var _0x23ca61={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x340f('0x64')]({'where':{'id':_0x3038c5[_0x340f('0x59')]['id']}})['then'](handleEntityNotFound(_0x3b9ab9,null))[_0x340f('0x26')](function(_0x5de5b4){if(_0x5de5b4){_0x4a1d50[_0x340f('0x38')]=_[_0x340f('0x39')](db[_0x340f('0x65')][_0x340f('0x35')]);_0x4a1d50['query']=_['keys'](_0x3038c5[_0x340f('0x3a')]);_0x4a1d50[_0x340f('0x3b')]=_[_0x340f('0x3c')](_0x4a1d50[_0x340f('0x38')],_0x4a1d50[_0x340f('0x3a')]);_0x40a040[_0x340f('0x3e')]=_['intersection'](_0x4a1d50[_0x340f('0x38')],qs['fields'](_0x3038c5[_0x340f('0x3a')]['fields']));_0x40a040[_0x340f('0x3e')]=_0x40a040[_0x340f('0x3e')][_0x340f('0x4d')]?_0x40a040[_0x340f('0x3e')]:_0x4a1d50[_0x340f('0x38')];if(!_0x3038c5[_0x340f('0x3a')][_0x340f('0x3f')](_0x340f('0x40'))){_0x40a040[_0x340f('0x1e')]=qs[_0x340f('0x1e')](_0x3038c5[_0x340f('0x3a')][_0x340f('0x1e')]);_0x40a040[_0x340f('0x1d')]=qs['offset'](_0x3038c5['query'][_0x340f('0x1d')]);}_0x40a040[_0x340f('0x41')]=qs['sort'](_0x3038c5[_0x340f('0x3a')]['sort']);_0x40a040[_0x340f('0x45')]=qs[_0x340f('0x3b')](_[_0x340f('0x43')](_0x3038c5[_0x340f('0x3a')],_0x4a1d50[_0x340f('0x3b')]));_0x40a040[_0x340f('0x45')][_0x340f('0x60')]=_0x5de5b4['id'];if(_0x3038c5[_0x340f('0x3a')][_0x340f('0x44')]){_0x40a040[_0x340f('0x45')]=_[_0x340f('0x46')](_0x40a040[_0x340f('0x45')],{'$or':_['map'](_0x40a040[_0x340f('0x3e')],function(_0xd54f5f){var _0x4e73f1={};_0x4e73f1[_0xd54f5f]={'$like':'%'+_0x3038c5['query'][_0x340f('0x44')]+'%'};return _0x4e73f1;})});}_0x40a040=_[_0x340f('0x46')]({},_0x40a040,_0x3038c5[_0x340f('0x5a')]);return db['CmHopperHistory'][_0x340f('0x20')]({'where':_0x40a040[_0x340f('0x45')]})[_0x340f('0x26')](function(_0xa49755){_0x23ca61[_0x340f('0x20')]=_0xa49755;if(_0x3038c5[_0x340f('0x3a')][_0x340f('0x48')]){_0x40a040[_0x340f('0x49')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x340f('0x62')](_0x40a040);})['then'](function(_0x22d258){_0x23ca61[_0x340f('0x4a')]=_0x22d258;return _0x23ca61;});}})[_0x340f('0x26')](respondWithFilteredResult(_0x3b9ab9,_0x40a040))['catch'](handleError(_0x3b9ab9,null));};exports[_0x340f('0x66')]=function(_0x193318,_0x142bc7,_0x4c6978){var _0x46fc7c={'raw':!![],'where':{}};var _0x55160d={};var _0x19f3f2={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x340f('0x64')]({'where':{'id':_0x193318['params']['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x142bc7,null))[_0x340f('0x26')](function(_0x29a424){if(_0x29a424){_0x55160d[_0x340f('0x38')]=_[_0x340f('0x39')](db[_0x340f('0x67')]['rawAttributes']);_0x55160d[_0x340f('0x3a')]=_[_0x340f('0x39')](_0x193318['query']);_0x55160d[_0x340f('0x3b')]=_['intersection'](_0x55160d[_0x340f('0x38')],_0x55160d['query']);_0x46fc7c['attributes']=_[_0x340f('0x3c')](_0x55160d[_0x340f('0x38')],qs['fields'](_0x193318[_0x340f('0x3a')][_0x340f('0x3d')]));_0x46fc7c[_0x340f('0x3e')]=_0x46fc7c[_0x340f('0x3e')][_0x340f('0x4d')]?_0x46fc7c[_0x340f('0x3e')]:_0x55160d['model'];if(!_0x193318[_0x340f('0x3a')][_0x340f('0x3f')](_0x340f('0x40'))){_0x46fc7c['limit']=qs[_0x340f('0x1e')](_0x193318[_0x340f('0x3a')][_0x340f('0x1e')]);_0x46fc7c['offset']=qs[_0x340f('0x1d')](_0x193318[_0x340f('0x3a')][_0x340f('0x1d')]);}_0x46fc7c[_0x340f('0x41')]=qs['sort'](_0x193318[_0x340f('0x3a')]['sort']);_0x46fc7c[_0x340f('0x45')]=qs[_0x340f('0x3b')](_[_0x340f('0x43')](_0x193318[_0x340f('0x3a')],_0x55160d['filters']));_0x46fc7c[_0x340f('0x45')][_0x340f('0x60')]=_0x29a424['id'];if(_0x193318[_0x340f('0x3a')][_0x340f('0x44')]){_0x46fc7c[_0x340f('0x45')]=_['merge'](_0x46fc7c[_0x340f('0x45')],{'$or':_[_0x340f('0x33')](_0x46fc7c[_0x340f('0x3e')],function(_0x37d184){var _0x2efac8={};_0x2efac8[_0x37d184]={'$like':'%'+_0x193318[_0x340f('0x3a')]['filter']+'%'};return _0x2efac8;})});}_0x46fc7c=_[_0x340f('0x46')]({},_0x46fc7c,_0x193318['options']);return db['CmHopperFinal'][_0x340f('0x20')]({'where':_0x46fc7c['where']})[_0x340f('0x26')](function(_0x8fb81d){_0x19f3f2[_0x340f('0x20')]=_0x8fb81d;if(_0x193318[_0x340f('0x3a')][_0x340f('0x48')]){_0x46fc7c['include']=[{'all':!![]}];}return db[_0x340f('0x67')][_0x340f('0x62')](_0x46fc7c);})['then'](function(_0x2ca723){_0x19f3f2[_0x340f('0x4a')]=_0x2ca723;return _0x19f3f2;});}})[_0x340f('0x26')](respondWithFilteredResult(_0x142bc7,_0x46fc7c))[_0x340f('0x4b')](handleError(_0x142bc7,null));};exports[_0x340f('0x68')]=function(_0x2d7a29,_0x4f9747,_0x399530){var _0x139a2a={'raw':!![],'where':{}};var _0x2e0831={};var _0x399c3e={'count':0x0,'rows':[]};return db[_0x340f('0x34')][_0x340f('0x64')]({'where':{'id':_0x2d7a29[_0x340f('0x59')]['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x4f9747,null))[_0x340f('0x26')](function(_0x4a05fa){if(_0x4a05fa){_0x2e0831[_0x340f('0x38')]=_['keys'](db['CmHopperBlack'][_0x340f('0x35')]);_0x2e0831['query']=_[_0x340f('0x39')](_0x2d7a29[_0x340f('0x3a')]);_0x2e0831[_0x340f('0x3b')]=_[_0x340f('0x3c')](_0x2e0831['model'],_0x2e0831[_0x340f('0x3a')]);_0x139a2a[_0x340f('0x3e')]=_[_0x340f('0x3c')](_0x2e0831[_0x340f('0x38')],qs[_0x340f('0x3d')](_0x2d7a29[_0x340f('0x3a')]['fields']));_0x139a2a[_0x340f('0x3e')]=_0x139a2a[_0x340f('0x3e')][_0x340f('0x4d')]?_0x139a2a[_0x340f('0x3e')]:_0x2e0831[_0x340f('0x38')];if(!_0x2d7a29[_0x340f('0x3a')]['hasOwnProperty']('nolimit')){_0x139a2a[_0x340f('0x1e')]=qs['limit'](_0x2d7a29[_0x340f('0x3a')][_0x340f('0x1e')]);_0x139a2a[_0x340f('0x1d')]=qs['offset'](_0x2d7a29[_0x340f('0x3a')][_0x340f('0x1d')]);}_0x139a2a[_0x340f('0x41')]=qs[_0x340f('0x42')](_0x2d7a29[_0x340f('0x3a')][_0x340f('0x42')]);_0x139a2a[_0x340f('0x45')]=qs[_0x340f('0x3b')](_['pick'](_0x2d7a29[_0x340f('0x3a')],_0x2e0831[_0x340f('0x3b')]));_0x139a2a[_0x340f('0x45')][_0x340f('0x60')]=_0x4a05fa['id'];if(_0x2d7a29['query'][_0x340f('0x44')]){_0x139a2a[_0x340f('0x45')]=_[_0x340f('0x46')](_0x139a2a['where'],{'$or':_[_0x340f('0x33')](_0x139a2a[_0x340f('0x3e')],function(_0x17df3e){var _0x25aac1={};_0x25aac1[_0x17df3e]={'$like':'%'+_0x2d7a29[_0x340f('0x3a')]['filter']+'%'};return _0x25aac1;})});}_0x139a2a=_[_0x340f('0x46')]({},_0x139a2a,_0x2d7a29['options']);return db[_0x340f('0x69')][_0x340f('0x20')]({'where':_0x139a2a[_0x340f('0x45')]})[_0x340f('0x26')](function(_0x1b6049){_0x399c3e[_0x340f('0x20')]=_0x1b6049;if(_0x2d7a29[_0x340f('0x3a')][_0x340f('0x48')]){_0x139a2a['include']=[{'all':!![]}];}return db[_0x340f('0x69')]['findAll'](_0x139a2a);})['then'](function(_0x590ab7){_0x399c3e['rows']=_0x590ab7;return _0x399c3e;});}})['then'](respondWithFilteredResult(_0x4f9747,_0x139a2a))['catch'](handleError(_0x4f9747,null));};exports['getTeams']=function(_0x2359cf,_0x1db7af,_0x1c1ef4){var _0xf8a115={};var _0x51aa41={};var _0x5591bc;var _0x824a9b;return db['VoiceQueue'][_0x340f('0x64')]({'where':{'id':_0x2359cf['params']['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x1db7af,null))['then'](function(_0x5f491d){if(_0x5f491d){_0x5591bc=_0x5f491d;_0x51aa41['model']=_[_0x340f('0x39')](db[_0x340f('0x6a')]['rawAttributes']);_0x51aa41[_0x340f('0x3a')]=_[_0x340f('0x39')](_0x2359cf[_0x340f('0x3a')]);_0x51aa41[_0x340f('0x3b')]=_[_0x340f('0x3c')](_0x51aa41[_0x340f('0x38')],_0x51aa41[_0x340f('0x3a')]);_0xf8a115[_0x340f('0x3e')]=_[_0x340f('0x3c')](_0x51aa41[_0x340f('0x38')],qs['fields'](_0x2359cf[_0x340f('0x3a')][_0x340f('0x3d')]));_0xf8a115['attributes']=_0xf8a115[_0x340f('0x3e')]['length']?_0xf8a115[_0x340f('0x3e')]:_0x51aa41[_0x340f('0x38')];_0xf8a115[_0x340f('0x41')]=qs[_0x340f('0x42')](_0x2359cf[_0x340f('0x3a')][_0x340f('0x42')]);_0xf8a115[_0x340f('0x45')]=qs[_0x340f('0x3b')](_[_0x340f('0x43')](_0x2359cf[_0x340f('0x3a')],_0x51aa41['filters']));if(_0x2359cf['query'][_0x340f('0x44')]){_0xf8a115[_0x340f('0x45')]=_[_0x340f('0x46')](_0xf8a115[_0x340f('0x45')],{'$or':_[_0x340f('0x33')](_0xf8a115[_0x340f('0x3e')],function(_0x47024c){var _0x51a941={};_0x51a941[_0x47024c]={'$like':'%'+_0x2359cf[_0x340f('0x3a')][_0x340f('0x44')]+'%'};return _0x51a941;})});}_0xf8a115=_[_0x340f('0x46')]({},_0xf8a115,_0x2359cf[_0x340f('0x5a')]);return _0x5591bc[_0x340f('0x6b')](_0xf8a115);}})['then'](function(_0x59a651){if(_0x59a651){_0x824a9b=_0x59a651['length'];if(!_0x2359cf['query']['hasOwnProperty'](_0x340f('0x40'))){_0xf8a115[_0x340f('0x1e')]=qs[_0x340f('0x1e')](_0x2359cf[_0x340f('0x3a')][_0x340f('0x1e')]);_0xf8a115[_0x340f('0x1d')]=qs[_0x340f('0x1d')](_0x2359cf['query']['offset']);}return _0x5591bc[_0x340f('0x6b')](_0xf8a115);}})[_0x340f('0x26')](function(_0xecdfc4){if(_0xecdfc4){return _0xecdfc4?{'count':_0x824a9b,'rows':_0xecdfc4}:null;}})[_0x340f('0x26')](respondWithResult(_0x1db7af,null))[_0x340f('0x4b')](handleError(_0x1db7af,null));};exports['addTeams']=function(_0x9cb9e7,_0xfee516,_0x341fda){var _0x3b8576=_0x9cb9e7[_0x340f('0x4f')]['teams'];var _0x198c6d=_[_0x340f('0x33')](_0x3b8576,'id');return db['Team'][_0x340f('0x62')]({'where':{'id':_0x198c6d},'attributes':['id'],'include':[{'model':db[_0x340f('0x6c')],'as':_0x340f('0x6d'),'attributes':['id',_0x340f('0x2f'),_0x340f('0x6e'),_0x340f('0x6f'),'interface'],'raw':!![]}]})[_0x340f('0x26')](function(_0x41295a){if(_0x41295a){var _0x519fad=_['flatMap'](_0x41295a,function(_0x100ee2){var _0xf0d316=_0x100ee2[_0x340f('0x27')]({'plain':!![]});_0xf0d316['Agents'][_0x340f('0x70')](function(_0x6dd0ec){_0x6dd0ec[_0x340f('0x71')]=_[_0x340f('0x2e')](_0x3b8576,{'id':_0xf0d316['id']})['penalty'];});return _0xf0d316[_0x340f('0x6d')];});return db[_0x340f('0x34')][_0x340f('0x2e')]({'where':{'id':_0x9cb9e7[_0x340f('0x59')]['id']}})[_0x340f('0x26')](function(_0x3c39e3){return db[_0x340f('0x72')][_0x340f('0x73')](function(_0x26c71b){return _0x3c39e3['addTeams'](_0x198c6d,{'transaction':_0x26c71b})[_0x340f('0x26')](function(){return BPromise['each'](_0x3b8576,function(_0x385dcb){return db[_0x340f('0x74')][_0x340f('0x75')]({'TeamId':_0x385dcb['id'],'VoiceQueueId':_0x9cb9e7['params']['id'],'penalty':_0x385dcb[_0x340f('0x71')]},{'transaction':_0x26c71b});});})['then'](function(){return BPromise[_0x340f('0x76')](_0x519fad,function(_0x30386c){return db['UserVoiceQueue'][_0x340f('0x77')]({'where':{'UserId':_0x30386c['id'],'VoiceQueueId':_0x9cb9e7['params']['id']},'defaults':{'penalty':_0x30386c['penalty']},'transaction':_0x26c71b});});})['then'](function(){return BPromise['each'](_['filter'](_0x519fad,{'online':!![]}),function(_0x4635ec){return db['UserVoiceQueueRt']['upsert']({'membername':_0x4635ec['name'],'UserId':_0x4635ec['id'],'queue_name':_0x3c39e3[_0x340f('0x2f')],'VoiceQueueId':_0x3c39e3['id'],'interface':_[_0x340f('0x78')](_0x4635ec[_0x340f('0x79')])?util[_0x340f('0x7a')](_0x340f('0x7b'),_0x4635ec['name']):_0x4635ec[_0x340f('0x79')],'paused':_0x4635ec[_0x340f('0x6f')]||![],'penalty':_0x4635ec['penalty']},{'transaction':_0x26c71b});});})[_0x340f('0x26')](function(){_0x519fad[_0x340f('0x70')](function(_0x116f40){socket[_0x340f('0x7c')](_0x340f('0x7d'),{'UserId':_0x116f40['id'],'VoiceQueueId':_0x3c39e3['id']});});});});});}})[_0x340f('0x26')](respondWithStatusCode(_0xfee516,null))[_0x340f('0x4b')](handleError(_0xfee516,null));};exports[_0x340f('0x7e')]=function(_0x29eeaa,_0x9f6721,_0x55d13d){return db[_0x340f('0x6a')][_0x340f('0x62')]({'where':{'id':_0x29eeaa[_0x340f('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x340f('0x6c')],'as':_0x340f('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x9f6721,null))[_0x340f('0x26')](function(_0x8144a5){var _0x3fce00=_[_0x340f('0x33')](_0x8144a5,'id');var _0x4be8cc=[];var _0x24bed3=[];var _0x70793c=squel[_0x340f('0x7f')]();_0x70793c['field'](_0x340f('0x80'))[_0x340f('0x81')](_0x340f('0x82'),'tq')['join'](_0x340f('0x83'),'ut',_0x340f('0x84'))[_0x340f('0x45')](_0x340f('0x85'),_0x29eeaa['params']['id']);for(var _0x1e6239=0x0;_0x1e6239<_0x8144a5[_0x340f('0x4d')];_0x1e6239+=0x1){let _0x3352f8=_0x8144a5[_0x1e6239];for(var _0x24ffe1=0x0;_0x24ffe1<_0x3352f8[_0x340f('0x6d')][_0x340f('0x4d')];_0x24ffe1+=0x1){let _0x421285=_0x3352f8[_0x340f('0x6d')][_0x24ffe1];var _0x8ba255=_0x70793c[_0x340f('0x58')]();_0x8ba255[_0x340f('0x45')](_0x340f('0x86'),_0x421285['id']);_0x24bed3['push'](db[_0x340f('0x72')]['query'](_0x8ba255[_0x340f('0x87')](),{'type':db[_0x340f('0x72')][_0x340f('0x88')][_0x340f('0x89')]})[_0x340f('0x26')](function(_0x43dff1){if(_0x43dff1[_0x340f('0x4d')]===0x1){return _0x421285['id'];}else{var _0x4528c7=_['every'](_[_0x340f('0x33')](_0x43dff1,_0x340f('0x8a')),function(_0x4f182d){return _[_0x340f('0x8b')](_0x3fce00,_0x4f182d);});if(_0x4528c7){return _0x421285['id'];}}}));}}return BPromise['all'](_0x24bed3)[_0x340f('0x26')](function(_0x26fc4c){_0x4be8cc=_(_0x4be8cc)['union'](_0x26fc4c)['compact']()[_0x340f('0x2c')]();return db['VoiceQueue'][_0x340f('0x2e')]({'where':{'id':_0x29eeaa['params']['id']}})[_0x340f('0x26')](function(_0x38c7b7){return db[_0x340f('0x72')][_0x340f('0x73')](function(_0x1180fe){return _0x38c7b7[_0x340f('0x7e')](_0x29eeaa[_0x340f('0x3a')][_0x340f('0x8c')],{'transaction':_0x1180fe})[_0x340f('0x26')](function(){if(!_[_0x340f('0x8d')](_0x4be8cc)){return _0x38c7b7['removeAgents'](_0x4be8cc,{'transaction':_0x1180fe})[_0x340f('0x26')](function(){return db[_0x340f('0x8e')][_0x340f('0x5f')]({'where':{'VoiceQueueId':_0x29eeaa[_0x340f('0x59')]['id'],'UserId':_0x4be8cc},'transaction':_0x1180fe});});}})[_0x340f('0x26')](function(){_0x4be8cc[_0x340f('0x70')](function(_0x468cf4){socket['emit'](_0x340f('0x8f'),{'UserId':_0x468cf4,'VoiceQueueId':_0x38c7b7['id']});});});});});});})[_0x340f('0x26')](respondWithStatusCode(_0x9f6721,null))[_0x340f('0x4b')](handleError(_0x9f6721,null));};exports[_0x340f('0x90')]=function(_0x21815d,_0x177bf9,_0x2fb9d8){var _0x20dbf7,_0x2fcf16;return db[_0x340f('0x34')][_0x340f('0x2e')]({'where':{'id':_0x21815d[_0x340f('0x59')]['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x177bf9,null))['then'](function(_0x309eb8){if(_0x309eb8){_0x2fcf16=_0x309eb8;return _0x309eb8[_0x340f('0x90')](_0x21815d[_0x340f('0x4f')][_0x340f('0x8c')],_[_0x340f('0x5b')](_0x21815d[_0x340f('0x4f')],[_0x340f('0x8c'),'id'])||{})[_0x340f('0x91')](function(_0x43fa50){for(var _0x6997dd=0x0;_0x6997dd<_0x21815d[_0x340f('0x4f')][_0x340f('0x8c')][_0x340f('0x4d')];_0x6997dd+=0x1){socket[_0x340f('0x7c')](_0x340f('0x7d'),{'UserId':Number(_0x21815d[_0x340f('0x4f')][_0x340f('0x8c')][_0x6997dd]),'VoiceQueueId':Number(_0x21815d[_0x340f('0x59')]['id'])});}return _0x43fa50;});}})['then'](function(_0xd9845e){_0x20dbf7=_0xd9845e||[];if(_0x2fcf16){return db[_0x340f('0x6c')][_0x340f('0x62')]({'where':{'id':_0x21815d[_0x340f('0x4f')]['ids']},'attributes':['id',_0x340f('0x2f'),_0x340f('0x6e'),'voicePause','interface'],'raw':!![]});}})['then'](function(_0x31da1c){if(!_[_0x340f('0x8d')](_0x31da1c)){var _0x1fb472=[];for(var _0x542b90=0x0;_0x542b90<_0x31da1c[_0x340f('0x4d')];_0x542b90++){if(_0x31da1c[_0x542b90][_0x340f('0x6e')]){_0x1fb472[_0x340f('0x92')](db['UserVoiceQueueRt'][_0x340f('0x75')]({'membername':_0x31da1c[_0x542b90][_0x340f('0x2f')],'UserId':_0x31da1c[_0x542b90]['id'],'queue_name':_0x2fcf16[_0x340f('0x2f')],'VoiceQueueId':_0x2fcf16['id'],'interface':_[_0x340f('0x78')](_0x31da1c[_0x542b90][_0x340f('0x79')])?util[_0x340f('0x7a')](_0x340f('0x7b'),_0x31da1c[_0x542b90][_0x340f('0x2f')]):_0x31da1c[_0x542b90][_0x340f('0x79')],'paused':_0x31da1c[_0x542b90][_0x340f('0x6f')]||![],'penalty':_0x21815d[_0x340f('0x4f')][_0x340f('0x71')]||0x0}));}}return BPromise[_0x340f('0x93')](_0x1fb472);}})[_0x340f('0x26')](function(){return _0x20dbf7;})[_0x340f('0x26')](respondWithResult(_0x177bf9,null))['catch'](handleError(_0x177bf9,null));};exports[_0x340f('0x94')]=function(_0x6a254c,_0x22bad1,_0x3d3c18){return db[_0x340f('0x34')][_0x340f('0x2e')]({'where':{'id':_0x6a254c['params']['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x22bad1,null))['then'](function(_0x2b7aca){if(_0x2b7aca){return _0x2b7aca['removeAgents'](_0x6a254c['query'][_0x340f('0x8c')])[_0x340f('0x26')](function(){if(_['isArray'](_0x6a254c[_0x340f('0x3a')][_0x340f('0x8c')])){for(var _0x430fad=0x0;_0x430fad<_0x6a254c[_0x340f('0x3a')][_0x340f('0x8c')][_0x340f('0x4d')];_0x430fad+=0x1){socket[_0x340f('0x7c')](_0x340f('0x8f'),{'UserId':Number(_0x6a254c['query']['ids'][_0x430fad]),'VoiceQueueId':Number(_0x6a254c['params']['id'])});}}else{socket[_0x340f('0x7c')](_0x340f('0x8f'),{'UserId':Number(_0x6a254c[_0x340f('0x3a')]['ids']),'VoiceQueueId':Number(_0x6a254c[_0x340f('0x59')]['id'])});}});}})[_0x340f('0x26')](function(_0x4968ba){return db['UserVoiceQueueRt'][_0x340f('0x5f')]({'where':{'VoiceQueueId':_0x6a254c['params']['id'],'UserId':_0x6a254c[_0x340f('0x3a')][_0x340f('0x8c')]}})['then'](function(){return _0x4968ba;});})['then'](respondWithStatusCode(_0x22bad1,null))['catch'](handleError(_0x22bad1,null));};exports['getAgents']=function(_0xe5c903,_0x133b3b,_0x5b57b5){var _0x315ed0={};var _0x29188c={};var _0x551bb6;var _0xad825c;return db[_0x340f('0x34')][_0x340f('0x64')]({'where':{'id':_0xe5c903['params']['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x133b3b,null))[_0x340f('0x26')](function(_0x30ac23){if(_0x30ac23){_0x551bb6=_0x30ac23;_0x29188c[_0x340f('0x38')]=_['keys'](db['User']['rawAttributes']);_0x29188c[_0x340f('0x3a')]=_[_0x340f('0x39')](_0xe5c903[_0x340f('0x3a')]);_0x29188c['filters']=_['intersection'](_0x29188c[_0x340f('0x38')],_0x29188c[_0x340f('0x3a')]);_0x315ed0[_0x340f('0x3e')]=_['intersection'](_0x29188c[_0x340f('0x38')],qs[_0x340f('0x3d')](_0xe5c903[_0x340f('0x3a')][_0x340f('0x3d')]));_0x315ed0[_0x340f('0x3e')]=_0x315ed0[_0x340f('0x3e')][_0x340f('0x4d')]?_0x315ed0[_0x340f('0x3e')]:_0x29188c[_0x340f('0x38')];_0x315ed0[_0x340f('0x41')]=qs['sort'](_0xe5c903['query'][_0x340f('0x42')]);_0x315ed0[_0x340f('0x45')]=qs[_0x340f('0x3b')](_[_0x340f('0x43')](_0xe5c903[_0x340f('0x3a')],_0x29188c['filters']));if(_0xe5c903[_0x340f('0x3a')][_0x340f('0x44')]){_0x315ed0[_0x340f('0x45')]=_[_0x340f('0x46')](_0x315ed0[_0x340f('0x45')],{'$or':_[_0x340f('0x33')](_0x315ed0[_0x340f('0x3e')],function(_0x5c7e85){var _0x4caf0a={};_0x4caf0a[_0x5c7e85]={'$like':'%'+_0xe5c903[_0x340f('0x3a')][_0x340f('0x44')]+'%'};return _0x4caf0a;})});}_0x315ed0=_[_0x340f('0x46')]({},_0x315ed0,_0xe5c903[_0x340f('0x5a')]);return _0x551bb6[_0x340f('0x95')](_0x315ed0);}})[_0x340f('0x26')](function(_0x44993e){if(_0x44993e){_0xad825c=_0x44993e['length'];if(!_0xe5c903[_0x340f('0x3a')][_0x340f('0x3f')](_0x340f('0x40'))){_0x315ed0[_0x340f('0x1e')]=qs[_0x340f('0x1e')](_0xe5c903['query']['limit']);_0x315ed0[_0x340f('0x1d')]=qs[_0x340f('0x1d')](_0xe5c903[_0x340f('0x3a')][_0x340f('0x1d')]);}return _0x551bb6[_0x340f('0x95')](_0x315ed0);}})[_0x340f('0x26')](function(_0x8644cc){if(_0x8644cc){return _0x8644cc?{'count':_0xad825c,'rows':_0x8644cc}:null;}})[_0x340f('0x26')](respondWithResult(_0x133b3b,null))[_0x340f('0x4b')](handleError(_0x133b3b,null));};exports[_0x340f('0x96')]=function(_0x4d1b6c,_0x45bc02,_0x5f2244){var _0x471d3f={};var _0x1b8bb8={};var _0x2df270;var _0x4b6a7f;return db[_0x340f('0x34')][_0x340f('0x64')]({'where':{'id':_0x4d1b6c[_0x340f('0x59')]['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x45bc02,null))[_0x340f('0x26')](function(_0x698a86){if(_0x698a86){_0x2df270=_0x698a86;_0x1b8bb8['model']=_[_0x340f('0x39')](db[_0x340f('0x8e')][_0x340f('0x35')]);_0x1b8bb8['query']=_[_0x340f('0x39')](_0x4d1b6c[_0x340f('0x3a')]);_0x1b8bb8[_0x340f('0x3b')]=_[_0x340f('0x3c')](_0x1b8bb8[_0x340f('0x38')],_0x1b8bb8[_0x340f('0x3a')]);_0x471d3f['attributes']=_[_0x340f('0x3c')](_0x1b8bb8[_0x340f('0x38')],qs[_0x340f('0x3d')](_0x4d1b6c['query'][_0x340f('0x3d')]));_0x471d3f[_0x340f('0x3e')]=_0x471d3f[_0x340f('0x3e')][_0x340f('0x4d')]?_0x471d3f[_0x340f('0x3e')]:_0x1b8bb8[_0x340f('0x38')];_0x471d3f[_0x340f('0x41')]=qs[_0x340f('0x42')](_0x4d1b6c[_0x340f('0x3a')][_0x340f('0x42')]);_0x471d3f[_0x340f('0x45')]=qs[_0x340f('0x3b')](_[_0x340f('0x43')](_0x4d1b6c[_0x340f('0x3a')],_0x1b8bb8[_0x340f('0x3b')]));if(_0x4d1b6c[_0x340f('0x3a')][_0x340f('0x44')]){_0x471d3f[_0x340f('0x45')]=_[_0x340f('0x46')](_0x471d3f['where'],{'$or':_['map'](_0x471d3f['attributes'],function(_0x73ead4){var _0x1b3afb={};_0x1b3afb[_0x73ead4]={'$like':'%'+_0x4d1b6c[_0x340f('0x3a')][_0x340f('0x44')]+'%'};return _0x1b3afb;})});}_0x471d3f=_['merge']({},_0x471d3f,_0x4d1b6c[_0x340f('0x5a')]);return _0x2df270[_0x340f('0x96')](_0x471d3f);}})[_0x340f('0x26')](function(_0x4564a7){if(_0x4564a7){_0x4b6a7f=_0x4564a7[_0x340f('0x4d')];if(!_0x4d1b6c['query']['hasOwnProperty'](_0x340f('0x40'))){_0x471d3f[_0x340f('0x1e')]=qs[_0x340f('0x1e')](_0x4d1b6c['query'][_0x340f('0x1e')]);_0x471d3f[_0x340f('0x1d')]=qs[_0x340f('0x1d')](_0x4d1b6c[_0x340f('0x3a')][_0x340f('0x1d')]);}return _0x2df270[_0x340f('0x96')](_0x471d3f);}})[_0x340f('0x26')](function(_0x2ffb62){return _0x2ffb62?{'count':_0x4b6a7f,'rows':_0x2ffb62}:null;})[_0x340f('0x26')](respondWithResult(_0x45bc02,null))[_0x340f('0x4b')](handleError(_0x45bc02,null));};exports[_0x340f('0x97')]=function(_0x232aac,_0xeed6e1,_0x5ede8c){var _0x242de9={};var _0x3121bc={};var _0x3d5681;var _0x598d79;return db[_0x340f('0x34')][_0x340f('0x64')]({'where':{'id':_0x232aac[_0x340f('0x59')]['id']}})['then'](handleEntityNotFound(_0xeed6e1,null))[_0x340f('0x26')](function(_0x41077e){if(_0x41077e){_0x3d5681=_0x41077e;_0x3121bc[_0x340f('0x38')]=_['keys'](db['CmList'][_0x340f('0x35')]);_0x3121bc['query']=_[_0x340f('0x39')](_0x232aac[_0x340f('0x3a')]);_0x3121bc[_0x340f('0x3b')]=_['intersection'](_0x3121bc['model'],_0x3121bc[_0x340f('0x3a')]);_0x242de9[_0x340f('0x3e')]=_[_0x340f('0x3c')](_0x3121bc[_0x340f('0x38')],qs['fields'](_0x232aac['query'][_0x340f('0x3d')]));_0x242de9[_0x340f('0x3e')]=_0x242de9[_0x340f('0x3e')][_0x340f('0x4d')]?_0x242de9[_0x340f('0x3e')]:_0x3121bc[_0x340f('0x38')];_0x242de9[_0x340f('0x41')]=qs[_0x340f('0x42')](_0x232aac[_0x340f('0x3a')][_0x340f('0x42')]);_0x242de9['where']=qs[_0x340f('0x3b')](_['pick'](_0x232aac[_0x340f('0x3a')],_0x3121bc[_0x340f('0x3b')]));if(_0x232aac['query'][_0x340f('0x44')]){_0x242de9['where']=_['merge'](_0x242de9['where'],{'$or':_['map'](_0x242de9[_0x340f('0x3e')],function(_0x3da883){var _0x27c9c6={};_0x27c9c6[_0x3da883]={'$like':'%'+_0x232aac[_0x340f('0x3a')][_0x340f('0x44')]+'%'};return _0x27c9c6;})});}_0x242de9=_[_0x340f('0x46')]({},_0x242de9,_0x232aac['options']);return _0x3d5681[_0x340f('0x97')](_0x242de9);}})[_0x340f('0x26')](function(_0x27271c){if(_0x27271c){_0x598d79=_0x27271c[_0x340f('0x4d')];if(!_0x232aac['query'][_0x340f('0x3f')]('nolimit')){_0x242de9[_0x340f('0x1e')]=qs[_0x340f('0x1e')](_0x232aac[_0x340f('0x3a')][_0x340f('0x1e')]);_0x242de9['offset']=qs[_0x340f('0x1d')](_0x232aac[_0x340f('0x3a')][_0x340f('0x1d')]);}return _0x3d5681[_0x340f('0x97')](_0x242de9);}})[_0x340f('0x26')](function(_0x1069f0){if(_0x1069f0){return _0x1069f0?{'count':_0x598d79,'rows':_0x1069f0}:null;}})[_0x340f('0x26')](respondWithResult(_0xeed6e1,null))[_0x340f('0x4b')](handleError(_0xeed6e1,null));};exports[_0x340f('0x98')]=function(_0x5a8b79,_0x41078a,_0x4c4f27){var _0x59f66d=moment()[_0x340f('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2aac32,_0x48532d;return db[_0x340f('0x34')][_0x340f('0x2e')]({'where':{'id':_0x5a8b79[_0x340f('0x59')]['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x41078a,null))[_0x340f('0x26')](function(_0x5d4794){if(_0x5d4794){_0x48532d=_0x5d4794;return _0x5d4794[_0x340f('0x98')](_0x5a8b79['body'][_0x340f('0x8c')],_['omit'](_0x5a8b79[_0x340f('0x4f')],[_0x340f('0x8c'),'id'])||{});}return null;})[_0x340f('0x91')](function(_0x5e0030){var _0x3fae52;_0x2aac32=_0x5e0030||[];var _0x599dbd=[];if(_0x5e0030){for(var _0x461b23=0x0;_0x461b23<_0x5e0030['length'];_0x461b23+=0x1){var _0x39c7e1=_0x5e0030[_0x461b23][_0x340f('0x27')]({'plain':!![]});_0x48532d[_0x340f('0x99')]=_0x5a8b79[_0x340f('0x4f')][_0x340f('0x99')]?_0x5a8b79[_0x340f('0x4f')][_0x340f('0x99')]:_0x48532d['dialCheckDuplicateType'];switch(_0x48532d[_0x340f('0x99')]){case _0x340f('0x9a'):_0x3fae52=squel['insert']()[_0x340f('0x9b')](_0x340f('0x9c'))[_0x340f('0x9d')](['phone',_0x340f('0x9e'),'ContactId','ListId','VoiceQueueId',_0x340f('0x5c'),'updatedAt'],squel[_0x340f('0x7f')]()[_0x340f('0x9f')](_0x340f('0xa0'),_0x340f('0xa0'))[_0x340f('0x9f')]('\x27'+_0x59f66d+'\x27',_0x340f('0x9e'))[_0x340f('0x9f')]('id','ContactId')[_0x340f('0x9f')](_0x39c7e1[_0x340f('0xa1')][_0x340f('0x87')](),_0x340f('0xa2'))[_0x340f('0x9f')](_0x5a8b79[_0x340f('0x59')]['id'][_0x340f('0x87')](),_0x340f('0x60'))['field']('\x27'+_0x59f66d+'\x27','createdAt')[_0x340f('0x9f')]('\x27'+_0x59f66d+'\x27',_0x340f('0x5d'))[_0x340f('0x81')]('cm_contacts')[_0x340f('0x45')]('deletedAt\x20IS\x20NULL')[_0x340f('0x45')](_0x340f('0xa3'),_0x39c7e1['CmListId'][_0x340f('0x87')]())['where'](_0x340f('0xa4'))[_0x340f('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x340f('0x7f')]()[_0x340f('0x9f')](_0x340f('0xa5'))[_0x340f('0x81')](_0x340f('0xa6'))[_0x340f('0x45')](_0x340f('0x85'),_0x5a8b79[_0x340f('0x59')]['id'][_0x340f('0x87')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x340f('0x9f')]('COALESCE(phone,\x27\x27)')[_0x340f('0x81')](_0x340f('0x9c'))[_0x340f('0x45')](_0x340f('0x85'),_0x5a8b79[_0x340f('0x59')]['id']['toString']())))[_0x340f('0x87')]();break;case _0x340f('0xa7'):_0x3fae52=squel[_0x340f('0xa8')]()[_0x340f('0x9b')](_0x340f('0x9c'))['fromQuery']([_0x340f('0xa0'),_0x340f('0x9e'),_0x340f('0xa9'),_0x340f('0xa2'),_0x340f('0x60'),_0x340f('0x5c'),_0x340f('0x5d')],squel[_0x340f('0x7f')]()[_0x340f('0x9f')](_0x340f('0xa0'),_0x340f('0xa0'))[_0x340f('0x9f')]('\x27'+_0x59f66d+'\x27',_0x340f('0x9e'))[_0x340f('0x9f')]('id',_0x340f('0xa9'))[_0x340f('0x9f')](_0x39c7e1['CmListId'][_0x340f('0x87')](),_0x340f('0xa2'))['field'](_0x5a8b79[_0x340f('0x59')]['id'][_0x340f('0x87')](),_0x340f('0x60'))['field']('\x27'+_0x59f66d+'\x27',_0x340f('0x5c'))[_0x340f('0x9f')]('\x27'+_0x59f66d+'\x27','updatedAt')['from']('cm_contacts')[_0x340f('0x45')](_0x340f('0xaa'))[_0x340f('0x45')](_0x340f('0xa3'),_0x39c7e1[_0x340f('0xa1')][_0x340f('0x87')]())[_0x340f('0x45')](_0x340f('0xa4'))['where'](_0x340f('0xab'),squel['select']()[_0x340f('0x9f')](_0x340f('0xac'))['from'](_0x340f('0x9c'))['where'](_0x340f('0x85'),_0x5a8b79[_0x340f('0x59')]['id'][_0x340f('0x87')]())))[_0x340f('0x87')]();break;default:_0x3fae52=squel[_0x340f('0xa8')]()[_0x340f('0x9b')](_0x340f('0x9c'))[_0x340f('0x9d')]([_0x340f('0xa0'),_0x340f('0x9e'),_0x340f('0xa9'),_0x340f('0xa2'),_0x340f('0x60'),_0x340f('0x5c'),_0x340f('0x5d')],squel[_0x340f('0x7f')]()[_0x340f('0x9f')](_0x340f('0xa0'),_0x340f('0xa0'))[_0x340f('0x9f')]('\x27'+_0x59f66d+'\x27',_0x340f('0x9e'))[_0x340f('0x9f')]('id',_0x340f('0xa9'))[_0x340f('0x9f')](_0x39c7e1[_0x340f('0xa1')]['toString'](),'ListId')['field'](_0x5a8b79[_0x340f('0x59')]['id'][_0x340f('0x87')](),_0x340f('0x60'))[_0x340f('0x9f')]('\x27'+_0x59f66d+'\x27','createdAt')[_0x340f('0x9f')]('\x27'+_0x59f66d+'\x27',_0x340f('0x5d'))['from'](_0x340f('0xad'))[_0x340f('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x340f('0xa3'),_0x39c7e1['CmListId'][_0x340f('0x87')]())[_0x340f('0x45')](_0x340f('0xa4')))['toString']();}_0x599dbd[_0x340f('0x92')](db[_0x340f('0x72')][_0x340f('0x3a')](_0x3fae52));}return BPromise[_0x340f('0x93')](_0x599dbd);}})[_0x340f('0x26')](function(){var _0x4b5d61=[];var _0x2632f6=squel['insert']()[_0x340f('0x9b')](_0x340f('0xae'))[_0x340f('0x9d')]([_0x340f('0xaf'),'phone',_0x340f('0xb0'),_0x340f('0x5c'),_0x340f('0x5d')],squel[_0x340f('0x7f')]()['field'](_0x340f('0xb1'))[_0x340f('0x9f')](_0x340f('0xb2'))[_0x340f('0x9f')](_0x340f('0xb3'))[_0x340f('0x9f')]('\x27'+_0x59f66d+'\x27',_0x340f('0x5c'))['field']('\x27'+_0x59f66d+'\x27',_0x340f('0x5d'))['from'](_0x340f('0xb4'),'ci')[_0x340f('0xb5')](_0x340f('0x9c'),'h',_0x340f('0xb6'))[_0x340f('0x45')]('h.scheduledat=?',_0x59f66d)[_0x340f('0x45')](_0x340f('0xb7'),_0x340f('0xb8')))['toString']();_0x4b5d61[_0x340f('0x92')](db[_0x340f('0x72')][_0x340f('0x3a')](_0x2632f6));return BPromise[_0x340f('0x93')](_0x4b5d61);})['then'](function(){return _0x2aac32;})[_0x340f('0x26')](respondWithResult(_0x41078a,null))['catch'](handleError(_0x41078a,null));};exports[_0x340f('0xb9')]=function(_0x2d3a89,_0x1c10ec,_0x4f8f38){return db[_0x340f('0x34')]['find']({'where':{'id':_0x2d3a89[_0x340f('0x59')]['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x1c10ec,null))[_0x340f('0x26')](function(_0x533cf3){if(_0x533cf3){return _0x533cf3[_0x340f('0xb9')](_0x2d3a89[_0x340f('0x3a')][_0x340f('0x8c')]);}})['then'](function(_0x312244){if(_0x312244){return db['CmHopper'][_0x340f('0x5f')]({'where':{'ListId':_0x2d3a89['query'][_0x340f('0x8c')],'VoiceQueueId':_0x2d3a89['params']['id']}})[_0x340f('0x26')](function(){return _0x312244;});}})[_0x340f('0x26')](respondWithStatusCode(_0x1c10ec,null))[_0x340f('0x4b')](handleError(_0x1c10ec,null));};exports[_0x340f('0xba')]=function(_0x4f9054,_0x505973,_0x29a507){var _0x1899fc={};var _0x2a2d57={};var _0x281670;var _0x432426;return db[_0x340f('0x34')][_0x340f('0x64')]({'where':{'id':_0x4f9054[_0x340f('0x59')]['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x505973,null))[_0x340f('0x26')](function(_0x9b6859){if(_0x9b6859){_0x281670=_0x9b6859;_0x2a2d57[_0x340f('0x38')]=_[_0x340f('0x39')](db[_0x340f('0xbb')][_0x340f('0x35')]);_0x2a2d57['query']=_['keys'](_0x4f9054[_0x340f('0x3a')]);_0x2a2d57[_0x340f('0x3b')]=_[_0x340f('0x3c')](_0x2a2d57[_0x340f('0x38')],_0x2a2d57[_0x340f('0x3a')]);_0x1899fc['attributes']=_[_0x340f('0x3c')](_0x2a2d57['model'],qs[_0x340f('0x3d')](_0x4f9054[_0x340f('0x3a')]['fields']));_0x1899fc[_0x340f('0x3e')]=_0x1899fc[_0x340f('0x3e')][_0x340f('0x4d')]?_0x1899fc[_0x340f('0x3e')]:_0x2a2d57['model'];_0x1899fc['order']=qs[_0x340f('0x42')](_0x4f9054[_0x340f('0x3a')][_0x340f('0x42')]);_0x1899fc[_0x340f('0x45')]=qs[_0x340f('0x3b')](_['pick'](_0x4f9054[_0x340f('0x3a')],_0x2a2d57[_0x340f('0x3b')]));if(_0x4f9054[_0x340f('0x3a')]['filter']){_0x1899fc['where']=_[_0x340f('0x46')](_0x1899fc[_0x340f('0x45')],{'$or':_[_0x340f('0x33')](_0x1899fc['attributes'],function(_0x39bcac){var _0xc31e99={};_0xc31e99[_0x39bcac]={'$like':'%'+_0x4f9054[_0x340f('0x3a')][_0x340f('0x44')]+'%'};return _0xc31e99;})});}_0x1899fc=_[_0x340f('0x46')]({},_0x1899fc,_0x4f9054[_0x340f('0x5a')]);return _0x281670[_0x340f('0xba')](_0x1899fc);}})[_0x340f('0x26')](function(_0x15fecb){if(_0x15fecb){_0x432426=_0x15fecb[_0x340f('0x4d')];if(!_0x4f9054[_0x340f('0x3a')][_0x340f('0x3f')](_0x340f('0x40'))){_0x1899fc[_0x340f('0x1e')]=qs[_0x340f('0x1e')](_0x4f9054[_0x340f('0x3a')]['limit']);_0x1899fc[_0x340f('0x1d')]=qs[_0x340f('0x1d')](_0x4f9054[_0x340f('0x3a')][_0x340f('0x1d')]);}return _0x281670['getBlackLists'](_0x1899fc);}})['then'](function(_0x3cf63a){if(_0x3cf63a){return _0x3cf63a?{'count':_0x432426,'rows':_0x3cf63a}:null;}})['then'](respondWithResult(_0x505973,null))[_0x340f('0x4b')](handleError(_0x505973,null));};exports[_0x340f('0xbc')]=function(_0x2134b4,_0x5e5205,_0xa71b80){var _0x1e0441,_0x27281b;return db[_0x340f('0x34')][_0x340f('0x2e')]({'where':{'id':_0x2134b4['params']['id']}})['then'](handleEntityNotFound(_0x5e5205,null))[_0x340f('0x26')](function(_0x24dd64){if(_0x24dd64){_0x27281b=_0x24dd64;return _0x24dd64['addBlackLists'](_0x2134b4['body'][_0x340f('0x8c')],_[_0x340f('0x5b')](_0x2134b4[_0x340f('0x4f')],['ids','id'])||{});}return null;})['spread'](function(_0x19bc72){var _0x55ae25;_0x1e0441=_0x19bc72||[];var _0x136768=[];if(_0x19bc72){for(var _0x4aee35=0x0;_0x4aee35<_0x19bc72['length'];_0x4aee35+=0x1){var _0x2672eb=_0x19bc72[_0x4aee35][_0x340f('0x27')]({'plain':!![]});_0x55ae25=squel[_0x340f('0xa8')]()[_0x340f('0x9b')](_0x340f('0xbd'))['fromQuery']([_0x340f('0xa0'),_0x340f('0xa9'),_0x340f('0xa2'),'VoiceQueueId',_0x340f('0x5c'),_0x340f('0x5d')],squel[_0x340f('0x7f')]()[_0x340f('0x9f')](_0x340f('0xa0'),_0x340f('0xa0'))[_0x340f('0x9f')]('id',_0x340f('0xa9'))['field'](_0x2672eb['CmListId'][_0x340f('0x87')](),_0x340f('0xa2'))[_0x340f('0x9f')](_0x2134b4[_0x340f('0x59')]['id']['toString'](),_0x340f('0x60'))['field'](_0x340f('0xbe'),_0x340f('0x5c'))[_0x340f('0x9f')]('NOW()','updatedAt')[_0x340f('0x81')]('cm_contacts')['where'](_0x340f('0xaa'))[_0x340f('0x45')](_0x340f('0xa3'),_0x2672eb[_0x340f('0xa1')][_0x340f('0x87')]())[_0x340f('0x45')](_0x340f('0xa4')))[_0x340f('0x87')]();_0x136768[_0x340f('0x92')](db[_0x340f('0x72')][_0x340f('0x3a')](_0x55ae25));}return BPromise[_0x340f('0x93')](_0x136768);}})[_0x340f('0x26')](function(){return _0x1e0441;})[_0x340f('0x26')](respondWithResult(_0x5e5205,null))[_0x340f('0x4b')](handleError(_0x5e5205,null));};exports['removeBlackLists']=function(_0x4c6a4e,_0x3afe1c,_0x3300bd){return db['VoiceQueue'][_0x340f('0x2e')]({'where':{'id':_0x4c6a4e[_0x340f('0x59')]['id']}})['then'](handleEntityNotFound(_0x3afe1c,null))[_0x340f('0x26')](function(_0x1106e4){if(_0x1106e4){return _0x1106e4['removeBlackLists'](_0x4c6a4e[_0x340f('0x3a')][_0x340f('0x8c')]);}})[_0x340f('0x26')](function(_0x1fdccd){if(_0x1fdccd){return db[_0x340f('0x69')][_0x340f('0x5f')]({'where':{'ListId':_0x4c6a4e['query']['ids'],'VoiceQueueId':_0x4c6a4e['params']['id']}})[_0x340f('0x26')](function(){return _0x1fdccd;});}})[_0x340f('0x26')](respondWithStatusCode(_0x3afe1c,null))['catch'](handleError(_0x3afe1c,null));}; \ No newline at end of file +var _0xfd20=['autoAssociation','clone','merge','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','CmHopperHistory','CmHopperFinal','findAll','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','User','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','transaction','removeAgents','userVoiceQueue:remove','addAgents','omit','ids','spread','online','isEmpty','isNil','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ListId','scheduledAt','ContactId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','select','COALESCE(phone,\x27\x27)','onlyIfOpen','into','phone\x20IS\x20NOT\x20NULL','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','all','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','destroy','error','stack','send','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','options','VoiceQueue','includeAll','include','rows','catch','show','params','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd20,0x66));var _0x0fd2=function(_0x35fcb7,_0x3734c0){_0x35fcb7=_0x35fcb7-0x0;var _0x30f28a=_0xfd20[_0x35fcb7];return _0x30f28a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fd2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fd2('0x1'));var moment=require(_0x0fd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0fd2('0x3'));var util=require('util');var path=require(_0x0fd2('0x4'));var sox=require(_0x0fd2('0x5'));var csv=require(_0x0fd2('0x6'));var ejs=require(_0x0fd2('0x7'));var fs=require('fs');var fs_extra=require(_0x0fd2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fd2('0x9'));var jsforce=require(_0x0fd2('0xa'));var deskjs=require(_0x0fd2('0xb'));var toCsv=require(_0x0fd2('0x6'));var querystring=require(_0x0fd2('0xc'));var Papa=require(_0x0fd2('0xd'));var Redis=require(_0x0fd2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0fd2('0xf'));var as=require(_0x0fd2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd2('0x11'))('api');var utils=require(_0x0fd2('0x12'));var config=require(_0x0fd2('0x13'));var licenseUtil=require(_0x0fd2('0x14'));var db=require(_0x0fd2('0x15'))['db'];config[_0x0fd2('0x16')]=_[_0x0fd2('0x17')](config[_0x0fd2('0x16')],{'host':_0x0fd2('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0fd2('0x19'))[_0x0fd2('0x1a')](socket);function respondWithStatusCode(_0x21dcc5,_0x28dd2b){_0x28dd2b=_0x28dd2b||0xcc;return function(_0x52ab36){if(_0x52ab36){return _0x21dcc5[_0x0fd2('0x1b')](_0x28dd2b);}return _0x21dcc5['status'](_0x28dd2b)['end']();};}function respondWithResult(_0x2b6254,_0x50eedc){_0x50eedc=_0x50eedc||0xc8;return function(_0x42f44c){if(_0x42f44c){return _0x2b6254['status'](_0x50eedc)[_0x0fd2('0x1c')](_0x42f44c);}};}function respondWithFilteredResult(_0x4cd2bf,_0x267dfb){return function(_0x15c9de){if(_0x15c9de){var _0x53787a=typeof _0x267dfb[_0x0fd2('0x1d')]==='undefined'&&typeof _0x267dfb[_0x0fd2('0x1e')]===_0x0fd2('0x1f');var _0x3fb07e=_0x15c9de[_0x0fd2('0x20')];var _0x2977ef=_0x53787a?0x0:_0x267dfb[_0x0fd2('0x1d')];var _0x3ea260=_0x53787a?_0x15c9de[_0x0fd2('0x20')]:_0x267dfb[_0x0fd2('0x1d')]+_0x267dfb[_0x0fd2('0x1e')];var _0x5c50ad;if(_0x3ea260>=_0x3fb07e){_0x3ea260=_0x3fb07e;_0x5c50ad=0xc8;}else{_0x5c50ad=0xce;}_0x4cd2bf['status'](_0x5c50ad);return _0x4cd2bf['set'](_0x0fd2('0x21'),_0x2977ef+'-'+_0x3ea260+'/'+_0x3fb07e)[_0x0fd2('0x1c')](_0x15c9de);}return null;};}function patchUpdates(_0x53ab17){return function(_0x48586c){try{jsonpatch[_0x0fd2('0x22')](_0x48586c,_0x53ab17,!![]);}catch(_0x25563c){return BPromise[_0x0fd2('0x23')](_0x25563c);}return _0x48586c[_0x0fd2('0x24')]();};}function saveUpdates(_0x25cdd2,_0x5d15ed){return function(_0x233b01){if(_0x233b01){return _0x233b01[_0x0fd2('0x25')](_0x25cdd2)[_0x0fd2('0x26')](function(_0x54cce1){return _0x54cce1;});}return null;};}function removeEntity(_0x4c77a8,_0x11bb10){return function(_0x2a45e1){if(_0x2a45e1){return _0x2a45e1['destroy']()[_0x0fd2('0x26')](function(){var _0x429fef=_0x2a45e1[_0x0fd2('0x27')]({'plain':!![]});var _0x1defb4=[{'name':_0x0fd2('0x28'),'value':_0x0fd2('0x29'),'ignore':![]},{'name':_0x0fd2('0x2a'),'value':_0x0fd2('0x2b'),'ignore':![]}];var _0x5b32df=_(_0x1defb4)[_0x0fd2('0x2c')](_0x0fd2('0x2d'))[_0x0fd2('0x2e')](_0x0fd2('0x2f'))[_0x0fd2('0x2f')]();if(_['includes'](_0x5b32df,_0x429fef[_0x0fd2('0x30')])){return;}var _0x33335b=_[_0x0fd2('0x31')](_0x1defb4,[_0x0fd2('0x2f'),_0x429fef[_0x0fd2('0x30')]])[_0x0fd2('0x32')];return db[_0x0fd2('0x33')][_0x0fd2('0x34')]({'where':{'type':_0x33335b,'resourceId':_0x429fef['id']}})['then'](function(){return _0x2a45e1;});})[_0x0fd2('0x26')](function(){_0x4c77a8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1828cc,_0x553715){return function(_0x2faac3){if(!_0x2faac3){_0x1828cc['sendStatus'](0x194);}return _0x2faac3;};}function handleError(_0x244095,_0x53f585){_0x53f585=_0x53f585||0x1f4;return function(_0x5caeff){logger[_0x0fd2('0x35')](_0x5caeff[_0x0fd2('0x36')]);if(_0x5caeff[_0x0fd2('0x32')]){delete _0x5caeff['name'];}_0x244095['status'](_0x53f585)[_0x0fd2('0x37')](_0x5caeff);};}exports['index']=function(_0x11917f,_0x6b6cb4){var _0x803113={},_0x44167a={},_0x12f9ad={'count':0x0,'rows':[]};var _0x2975fb=_[_0x0fd2('0x2e')](db['VoiceQueue'][_0x0fd2('0x38')],function(_0x2ccfbe){return{'name':_0x2ccfbe['fieldName'],'type':_0x2ccfbe['type'][_0x0fd2('0x39')]};});_0x44167a['model']=_['map'](_0x2975fb,_0x0fd2('0x32'));_0x44167a[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x11917f[_0x0fd2('0x3a')]);_0x44167a[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x44167a[_0x0fd2('0x3e')],_0x44167a[_0x0fd2('0x3a')]);_0x803113[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x44167a[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x11917f[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x803113[_0x0fd2('0x3f')]=_0x803113[_0x0fd2('0x3f')]['length']?_0x803113[_0x0fd2('0x3f')]:_0x44167a[_0x0fd2('0x3e')];if(!_0x11917f[_0x0fd2('0x3a')][_0x0fd2('0x41')]('nolimit')){_0x803113[_0x0fd2('0x1e')]=qs['limit'](_0x11917f[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x803113['offset']=qs[_0x0fd2('0x1d')](_0x11917f[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}_0x803113[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x11917f[_0x0fd2('0x3a')]['sort']);_0x803113[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_[_0x0fd2('0x45')](_0x11917f[_0x0fd2('0x3a')],_0x44167a[_0x0fd2('0x3c')]),_0x2975fb);if(_0x11917f['query'][_0x0fd2('0x2c')]){_0x803113[_0x0fd2('0x44')]=_['merge'](_0x803113[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x2975fb,function(_0x400b49){if(_0x400b49[_0x0fd2('0x30')]!==_0x0fd2('0x46')){var _0x22c89d={};_0x22c89d[_0x400b49[_0x0fd2('0x32')]]={'$like':'%'+_0x11917f[_0x0fd2('0x3a')]['filter']+'%'};return _0x22c89d;}})});}_0x803113=_['merge']({},_0x803113,_0x11917f[_0x0fd2('0x47')]);var _0x19d9e2={'where':_0x803113['where']};return db[_0x0fd2('0x48')]['count'](_0x19d9e2)[_0x0fd2('0x26')](function(_0x241570){_0x12f9ad[_0x0fd2('0x20')]=_0x241570;if(_0x11917f[_0x0fd2('0x3a')][_0x0fd2('0x49')]){_0x803113[_0x0fd2('0x4a')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x803113);})[_0x0fd2('0x26')](function(_0x5065dc){_0x12f9ad[_0x0fd2('0x4b')]=_0x5065dc;return _0x12f9ad;})[_0x0fd2('0x26')](respondWithFilteredResult(_0x6b6cb4,_0x803113))[_0x0fd2('0x4c')](handleError(_0x6b6cb4,null));};exports[_0x0fd2('0x4d')]=function(_0x2f47f9,_0x500d1a){var _0x1bbe6a={'raw':![],'where':{'id':_0x2f47f9[_0x0fd2('0x4e')]['id']}},_0x49f5c2={};_0x49f5c2[_0x0fd2('0x3e')]=_['keys'](db[_0x0fd2('0x48')]['rawAttributes']);_0x49f5c2['query']=_[_0x0fd2('0x3b')](_0x2f47f9[_0x0fd2('0x3a')]);_0x49f5c2[_0x0fd2('0x3c')]=_['intersection'](_0x49f5c2[_0x0fd2('0x3e')],_0x49f5c2[_0x0fd2('0x3a')]);_0x1bbe6a[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x49f5c2['model'],qs[_0x0fd2('0x40')](_0x2f47f9[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x1bbe6a[_0x0fd2('0x3f')]=_0x1bbe6a[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x1bbe6a[_0x0fd2('0x3f')]:_0x49f5c2[_0x0fd2('0x3e')];if(_0x2f47f9[_0x0fd2('0x3a')][_0x0fd2('0x49')]){_0x1bbe6a[_0x0fd2('0x4a')]=[{'all':!![]}];}_0x1bbe6a=_['merge']({},_0x1bbe6a,_0x2f47f9[_0x0fd2('0x47')]);return db[_0x0fd2('0x48')]['find'](_0x1bbe6a)[_0x0fd2('0x26')](handleEntityNotFound(_0x500d1a,null))['then'](respondWithResult(_0x500d1a,null))[_0x0fd2('0x4c')](handleError(_0x500d1a,null));};exports[_0x0fd2('0x50')]=function(_0xe2cd72,_0xed36b3){return db[_0x0fd2('0x48')]['create'](_0xe2cd72[_0x0fd2('0x51')],{})[_0x0fd2('0x26')](function(_0x101509){var _0x4c1020=_0xe2cd72['user'][_0x0fd2('0x27')]({'plain':!![]});if(!_0x4c1020)throw new Error(_0x0fd2('0x52'));if(_0x4c1020[_0x0fd2('0x53')]===_0x0fd2('0x54')){var _0xec149c=_0x101509[_0x0fd2('0x27')]({'plain':!![]});var _0x4a9fe1=[{'name':_0x0fd2('0x28'),'value':_0x0fd2('0x29')},{'name':_0x0fd2('0x2a'),'value':_0x0fd2('0x2b')}];var _0x379524=_[_0x0fd2('0x31')](_0x4a9fe1,[_0x0fd2('0x2f'),_0xec149c[_0x0fd2('0x30')]])[_0x0fd2('0x32')];return db[_0x0fd2('0x55')][_0x0fd2('0x31')]({'where':{'name':_0x379524,'userProfileId':_0x4c1020[_0x0fd2('0x56')]},'raw':!![]})[_0x0fd2('0x26')](function(_0x50929f){if(_0x50929f&&_0x50929f[_0x0fd2('0x57')]===0x0){return db[_0x0fd2('0x33')]['create']({'name':_0xec149c[_0x0fd2('0x32')],'resourceId':_0xec149c['id'],'type':_0x50929f[_0x0fd2('0x32')],'sectionId':_0x50929f['id']},{})[_0x0fd2('0x26')](function(){return _0x101509;});}else{return _0x101509;}})[_0x0fd2('0x4c')](function(_0x5674b3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5674b3);throw _0x5674b3;});}return _0x101509;})[_0x0fd2('0x26')](respondWithResult(_0xed36b3,0xc9))[_0x0fd2('0x4c')](handleError(_0xed36b3,null));};exports[_0x0fd2('0x58')]=function(_0x27754d,_0x41dd02){var _0x1ba67f={'where':{'id':_0x27754d[_0x0fd2('0x4e')]['id']}},_0x47343a={};_0x47343a[_0x0fd2('0x3e')]=_[_0x0fd2('0x3b')](db['VoiceQueue']['rawAttributes']);_0x1ba67f['attributes']=_['intersection'](_0x47343a['model'],qs[_0x0fd2('0x40')](_0x27754d['query'][_0x0fd2('0x40')]));_0x1ba67f['attributes']=_0x1ba67f[_0x0fd2('0x3f')]['length']?_0x1ba67f[_0x0fd2('0x3f')]:_0x47343a[_0x0fd2('0x3e')];if(_0x27754d[_0x0fd2('0x3a')]['includeAll']){_0x1ba67f['include']=[{'all':!![]}];}_0x1ba67f=_[_0x0fd2('0x59')]({},_0x1ba67f,_0x27754d[_0x0fd2('0x47')]);return db[_0x0fd2('0x48')][_0x0fd2('0x31')](_0x1ba67f)[_0x0fd2('0x26')](handleEntityNotFound(_0x41dd02,null))[_0x0fd2('0x26')](function(_0x359ee2){if(_0x359ee2){var _0x44fd9d=_0x359ee2[_0x0fd2('0x27')]({'plain':!![]});_0x44fd9d=qs['omit'](_0x44fd9d,['id',_0x0fd2('0x5a'),_0x0fd2('0x5b')]);_0x27754d[_0x0fd2('0x51')]=_['omit'](_0x27754d[_0x0fd2('0x51')],['id','createdAt',_0x0fd2('0x5b')]);return db[_0x0fd2('0x48')][_0x0fd2('0x50')](_[_0x0fd2('0x59')](_0x44fd9d,_0x27754d[_0x0fd2('0x51')]),{'include':_0x27754d[_0x0fd2('0x3a')][_0x0fd2('0x49')]?[{'all':!![]}]:undefined})[_0x0fd2('0x26')](function(_0x53bb88){var _0x33530b=_0x27754d[_0x0fd2('0x54')]['get']({'plain':!![]});if(!_0x33530b)throw new Error(_0x0fd2('0x52'));if(_0x33530b[_0x0fd2('0x53')]===_0x0fd2('0x54')){var _0x58d2f1=_0x53bb88[_0x0fd2('0x27')]({'plain':!![]});var _0x43f751=[{'name':_0x0fd2('0x28'),'value':_0x0fd2('0x29')},{'name':_0x0fd2('0x2a'),'value':_0x0fd2('0x2b')}];var _0x1ed5db=_[_0x0fd2('0x31')](_0x43f751,[_0x0fd2('0x2f'),_0x58d2f1['type']])[_0x0fd2('0x32')];return db[_0x0fd2('0x55')][_0x0fd2('0x31')]({'where':{'name':_0x1ed5db,'userProfileId':_0x33530b['userProfileId']},'raw':!![]})[_0x0fd2('0x26')](function(_0x288212){if(_0x288212&&_0x288212[_0x0fd2('0x57')]===0x0){return db[_0x0fd2('0x33')][_0x0fd2('0x50')]({'name':_0x58d2f1['name'],'resourceId':_0x58d2f1['id'],'type':_0x288212['name'],'sectionId':_0x288212['id']},{})[_0x0fd2('0x26')](function(){return _0x53bb88;});}else{return _0x53bb88;}})[_0x0fd2('0x4c')](function(_0x39bd89){logger[_0x0fd2('0x35')](_0x0fd2('0x5c'),_0x39bd89);throw _0x39bd89;});}return _0x53bb88;});}})[_0x0fd2('0x26')](respondWithResult(_0x41dd02,0xc9))[_0x0fd2('0x4c')](handleError(_0x41dd02,null));};exports[_0x0fd2('0x25')]=function(_0x54aadc,_0x14f6fb){if(_0x54aadc[_0x0fd2('0x51')]['id']){delete _0x54aadc[_0x0fd2('0x51')]['id'];}return db[_0x0fd2('0x48')]['find']({'where':{'id':_0x54aadc[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x14f6fb,null))[_0x0fd2('0x26')](saveUpdates(_0x54aadc[_0x0fd2('0x51')],null))[_0x0fd2('0x26')](respondWithResult(_0x14f6fb,null))[_0x0fd2('0x4c')](handleError(_0x14f6fb,null));};exports[_0x0fd2('0x34')]=function(_0x16d33b,_0x404af9){return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x16d33b[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x404af9,null))[_0x0fd2('0x26')](removeEntity(_0x404af9,null))[_0x0fd2('0x4c')](handleError(_0x404af9,null));};exports[_0x0fd2('0x5d')]=function(_0x294e12,_0x3fb02f,_0x5e91c0){var _0x6660e4={'raw':![],'where':{}};var _0x3b4bfc={};var _0x32ee12={'count':0x0,'rows':[]};return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x294e12['params']['id']}})['then'](handleEntityNotFound(_0x3fb02f,null))[_0x0fd2('0x26')](function(_0x158899){if(_0x158899){_0x3b4bfc[_0x0fd2('0x3e')]=_['keys'](db[_0x0fd2('0x5f')][_0x0fd2('0x38')]);_0x3b4bfc[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x294e12[_0x0fd2('0x3a')]);_0x3b4bfc[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x3b4bfc[_0x0fd2('0x3e')],_0x3b4bfc[_0x0fd2('0x3a')]);_0x6660e4[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x3b4bfc[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x294e12[_0x0fd2('0x3a')]['fields']));_0x6660e4[_0x0fd2('0x3f')]=_0x6660e4[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x6660e4['attributes']:_0x3b4bfc[_0x0fd2('0x3e')];if(!_0x294e12[_0x0fd2('0x3a')][_0x0fd2('0x41')](_0x0fd2('0x60'))){_0x6660e4[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x294e12[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x6660e4[_0x0fd2('0x1d')]=qs['offset'](_0x294e12['query']['offset']);}_0x6660e4[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x294e12[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x6660e4[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_['pick'](_0x294e12[_0x0fd2('0x3a')],_0x3b4bfc['filters']));_0x6660e4[_0x0fd2('0x44')][_0x0fd2('0x61')]=_0x158899['id'];if(_0x294e12['query'][_0x0fd2('0x2c')]){_0x6660e4[_0x0fd2('0x44')]=_[_0x0fd2('0x59')](_0x6660e4['where'],{'$or':_[_0x0fd2('0x2e')](_0x6660e4[_0x0fd2('0x3f')],function(_0x5ee8bc){var _0x5659f6={};_0x5659f6[_0x5ee8bc]={'$like':'%'+_0x294e12[_0x0fd2('0x3a')][_0x0fd2('0x2c')]+'%'};return _0x5659f6;})});}_0x6660e4=_[_0x0fd2('0x59')]({},_0x6660e4,_0x294e12[_0x0fd2('0x47')]);return db[_0x0fd2('0x5f')]['count']({'where':_0x6660e4[_0x0fd2('0x44')]})[_0x0fd2('0x26')](function(_0x53a49c){_0x32ee12[_0x0fd2('0x20')]=_0x53a49c;if(_0x294e12[_0x0fd2('0x3a')][_0x0fd2('0x49')]){_0x6660e4[_0x0fd2('0x4a')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x6660e4);})[_0x0fd2('0x26')](function(_0x524528){_0x32ee12[_0x0fd2('0x4b')]=_0x524528;return _0x32ee12;});}})[_0x0fd2('0x26')](respondWithFilteredResult(_0x3fb02f,_0x6660e4))['catch'](handleError(_0x3fb02f,null));};exports['getHopperHistories']=function(_0x405814,_0x21d371,_0x2043f5){var _0x552dcd={'raw':!![],'where':{}};var _0x22c88a={};var _0x3883de={'count':0x0,'rows':[]};return db[_0x0fd2('0x48')]['findOne']({'where':{'id':_0x405814[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x21d371,null))['then'](function(_0x5cc6fe){if(_0x5cc6fe){_0x22c88a[_0x0fd2('0x3e')]=_[_0x0fd2('0x3b')](db[_0x0fd2('0x62')][_0x0fd2('0x38')]);_0x22c88a[_0x0fd2('0x3a')]=_['keys'](_0x405814[_0x0fd2('0x3a')]);_0x22c88a[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x22c88a[_0x0fd2('0x3e')],_0x22c88a[_0x0fd2('0x3a')]);_0x552dcd[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x22c88a[_0x0fd2('0x3e')],qs['fields'](_0x405814['query'][_0x0fd2('0x40')]));_0x552dcd[_0x0fd2('0x3f')]=_0x552dcd[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x552dcd['attributes']:_0x22c88a[_0x0fd2('0x3e')];if(!_0x405814[_0x0fd2('0x3a')]['hasOwnProperty']('nolimit')){_0x552dcd['limit']=qs[_0x0fd2('0x1e')](_0x405814[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x552dcd[_0x0fd2('0x1d')]=qs[_0x0fd2('0x1d')](_0x405814[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}_0x552dcd[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x405814[_0x0fd2('0x3a')]['sort']);_0x552dcd[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_[_0x0fd2('0x45')](_0x405814[_0x0fd2('0x3a')],_0x22c88a[_0x0fd2('0x3c')]));_0x552dcd[_0x0fd2('0x44')][_0x0fd2('0x61')]=_0x5cc6fe['id'];if(_0x405814['query'][_0x0fd2('0x2c')]){_0x552dcd[_0x0fd2('0x44')]=_[_0x0fd2('0x59')](_0x552dcd[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x552dcd[_0x0fd2('0x3f')],function(_0x203979){var _0x4141de={};_0x4141de[_0x203979]={'$like':'%'+_0x405814['query'][_0x0fd2('0x2c')]+'%'};return _0x4141de;})});}_0x552dcd=_[_0x0fd2('0x59')]({},_0x552dcd,_0x405814[_0x0fd2('0x47')]);return db[_0x0fd2('0x62')][_0x0fd2('0x20')]({'where':_0x552dcd[_0x0fd2('0x44')]})['then'](function(_0x146f01){_0x3883de[_0x0fd2('0x20')]=_0x146f01;if(_0x405814['query'][_0x0fd2('0x49')]){_0x552dcd[_0x0fd2('0x4a')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x552dcd);})[_0x0fd2('0x26')](function(_0x27e6ac){_0x3883de[_0x0fd2('0x4b')]=_0x27e6ac;return _0x3883de;});}})[_0x0fd2('0x26')](respondWithFilteredResult(_0x21d371,_0x552dcd))['catch'](handleError(_0x21d371,null));};exports['getHopperFinals']=function(_0x12e136,_0x46d4f2,_0x35ec32){var _0x5b88fc={'raw':!![],'where':{}};var _0x2fa756={};var _0x2acc75={'count':0x0,'rows':[]};return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x12e136[_0x0fd2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x46d4f2,null))[_0x0fd2('0x26')](function(_0x2f5c3b){if(_0x2f5c3b){_0x2fa756['model']=_[_0x0fd2('0x3b')](db[_0x0fd2('0x63')]['rawAttributes']);_0x2fa756[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x12e136[_0x0fd2('0x3a')]);_0x2fa756[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x2fa756[_0x0fd2('0x3e')],_0x2fa756[_0x0fd2('0x3a')]);_0x5b88fc[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x2fa756[_0x0fd2('0x3e')],qs['fields'](_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x5b88fc[_0x0fd2('0x3f')]=_0x5b88fc[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x5b88fc[_0x0fd2('0x3f')]:_0x2fa756[_0x0fd2('0x3e')];if(!_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x41')]('nolimit')){_0x5b88fc[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x5b88fc['offset']=qs[_0x0fd2('0x1d')](_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}_0x5b88fc['order']=qs['sort'](_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x5b88fc[_0x0fd2('0x44')]=qs['filters'](_[_0x0fd2('0x45')](_0x12e136[_0x0fd2('0x3a')],_0x2fa756['filters']));_0x5b88fc[_0x0fd2('0x44')][_0x0fd2('0x61')]=_0x2f5c3b['id'];if(_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x5b88fc[_0x0fd2('0x44')]=_['merge'](_0x5b88fc[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x5b88fc[_0x0fd2('0x3f')],function(_0x1260db){var _0x3dfe33={};_0x3dfe33[_0x1260db]={'$like':'%'+_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x2c')]+'%'};return _0x3dfe33;})});}_0x5b88fc=_['merge']({},_0x5b88fc,_0x12e136[_0x0fd2('0x47')]);return db[_0x0fd2('0x63')]['count']({'where':_0x5b88fc['where']})['then'](function(_0x3ab8c6){_0x2acc75['count']=_0x3ab8c6;if(_0x12e136['query'][_0x0fd2('0x49')]){_0x5b88fc['include']=[{'all':!![]}];}return db[_0x0fd2('0x63')][_0x0fd2('0x64')](_0x5b88fc);})['then'](function(_0x5d0ca9){_0x2acc75['rows']=_0x5d0ca9;return _0x2acc75;});}})['then'](respondWithFilteredResult(_0x46d4f2,_0x5b88fc))['catch'](handleError(_0x46d4f2,null));};exports[_0x0fd2('0x65')]=function(_0x244fd2,_0x50502e,_0x528fa4){var _0x453b8d={'raw':!![],'where':{}};var _0x1771ce={};var _0xf445a8={'count':0x0,'rows':[]};return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x244fd2[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x50502e,null))[_0x0fd2('0x26')](function(_0x2f56dd){if(_0x2f56dd){_0x1771ce[_0x0fd2('0x3e')]=_[_0x0fd2('0x3b')](db['CmHopperBlack'][_0x0fd2('0x38')]);_0x1771ce['query']=_[_0x0fd2('0x3b')](_0x244fd2[_0x0fd2('0x3a')]);_0x1771ce[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x1771ce['model'],_0x1771ce[_0x0fd2('0x3a')]);_0x453b8d[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x1771ce['model'],qs[_0x0fd2('0x40')](_0x244fd2[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x453b8d[_0x0fd2('0x3f')]=_0x453b8d[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x453b8d[_0x0fd2('0x3f')]:_0x1771ce[_0x0fd2('0x3e')];if(!_0x244fd2['query'][_0x0fd2('0x41')]('nolimit')){_0x453b8d[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x244fd2['query']['limit']);_0x453b8d[_0x0fd2('0x1d')]=qs[_0x0fd2('0x1d')](_0x244fd2[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}_0x453b8d[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x244fd2['query'][_0x0fd2('0x43')]);_0x453b8d[_0x0fd2('0x44')]=qs['filters'](_['pick'](_0x244fd2[_0x0fd2('0x3a')],_0x1771ce['filters']));_0x453b8d[_0x0fd2('0x44')][_0x0fd2('0x61')]=_0x2f56dd['id'];if(_0x244fd2[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x453b8d['where']=_[_0x0fd2('0x59')](_0x453b8d['where'],{'$or':_['map'](_0x453b8d[_0x0fd2('0x3f')],function(_0x1b7818){var _0x41e57e={};_0x41e57e[_0x1b7818]={'$like':'%'+_0x244fd2[_0x0fd2('0x3a')][_0x0fd2('0x2c')]+'%'};return _0x41e57e;})});}_0x453b8d=_['merge']({},_0x453b8d,_0x244fd2['options']);return db['CmHopperBlack']['count']({'where':_0x453b8d[_0x0fd2('0x44')]})['then'](function(_0x36b164){_0xf445a8[_0x0fd2('0x20')]=_0x36b164;if(_0x244fd2[_0x0fd2('0x3a')]['includeAll']){_0x453b8d[_0x0fd2('0x4a')]=[{'all':!![]}];}return db[_0x0fd2('0x66')][_0x0fd2('0x64')](_0x453b8d);})['then'](function(_0x1c0392){_0xf445a8[_0x0fd2('0x4b')]=_0x1c0392;return _0xf445a8;});}})[_0x0fd2('0x26')](respondWithFilteredResult(_0x50502e,_0x453b8d))[_0x0fd2('0x4c')](handleError(_0x50502e,null));};exports[_0x0fd2('0x67')]=function(_0x2dd7bd,_0x2fb19f,_0x1361ff){var _0x2311d8={};var _0x2fd8f8={};var _0xcc05d5;var _0x19f8c0;return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x2dd7bd[_0x0fd2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2fb19f,null))[_0x0fd2('0x26')](function(_0x4463eb){if(_0x4463eb){_0xcc05d5=_0x4463eb;_0x2fd8f8[_0x0fd2('0x3e')]=_['keys'](db[_0x0fd2('0x68')][_0x0fd2('0x38')]);_0x2fd8f8[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x2dd7bd[_0x0fd2('0x3a')]);_0x2fd8f8[_0x0fd2('0x3c')]=_['intersection'](_0x2fd8f8[_0x0fd2('0x3e')],_0x2fd8f8[_0x0fd2('0x3a')]);_0x2311d8[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x2fd8f8[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x2dd7bd[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x2311d8[_0x0fd2('0x3f')]=_0x2311d8[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x2311d8[_0x0fd2('0x3f')]:_0x2fd8f8[_0x0fd2('0x3e')];_0x2311d8[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x2dd7bd[_0x0fd2('0x3a')]['sort']);_0x2311d8[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_[_0x0fd2('0x45')](_0x2dd7bd[_0x0fd2('0x3a')],_0x2fd8f8[_0x0fd2('0x3c')]));if(_0x2dd7bd[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x2311d8['where']=_[_0x0fd2('0x59')](_0x2311d8[_0x0fd2('0x44')],{'$or':_['map'](_0x2311d8[_0x0fd2('0x3f')],function(_0x425333){var _0x7e2917={};_0x7e2917[_0x425333]={'$like':'%'+_0x2dd7bd[_0x0fd2('0x3a')]['filter']+'%'};return _0x7e2917;})});}_0x2311d8=_['merge']({},_0x2311d8,_0x2dd7bd[_0x0fd2('0x47')]);return _0xcc05d5['getTeams'](_0x2311d8);}})['then'](function(_0x11db90){if(_0x11db90){_0x19f8c0=_0x11db90['length'];if(!_0x2dd7bd[_0x0fd2('0x3a')]['hasOwnProperty'](_0x0fd2('0x60'))){_0x2311d8[_0x0fd2('0x1e')]=qs['limit'](_0x2dd7bd[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x2311d8[_0x0fd2('0x1d')]=qs['offset'](_0x2dd7bd[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}return _0xcc05d5['getTeams'](_0x2311d8);}})[_0x0fd2('0x26')](function(_0x293098){if(_0x293098){return _0x293098?{'count':_0x19f8c0,'rows':_0x293098}:null;}})[_0x0fd2('0x26')](respondWithResult(_0x2fb19f,null))[_0x0fd2('0x4c')](handleError(_0x2fb19f,null));};exports[_0x0fd2('0x69')]=function(_0x23db78,_0x2d97de,_0x5cb489){var _0x5a3809=_0x23db78[_0x0fd2('0x51')]['teams'];var _0x549306=_[_0x0fd2('0x2e')](_0x5a3809,'id');return db[_0x0fd2('0x68')][_0x0fd2('0x64')]({'where':{'id':_0x549306},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0fd2('0x6a'),'attributes':['id',_0x0fd2('0x32'),'online',_0x0fd2('0x6b'),_0x0fd2('0x6c')],'raw':!![]}]})[_0x0fd2('0x26')](function(_0x45eb44){if(_0x45eb44){var _0x254999=_[_0x0fd2('0x6d')](_0x45eb44,function(_0x3cc23a){var _0x17b6ee=_0x3cc23a[_0x0fd2('0x27')]({'plain':!![]});_0x17b6ee[_0x0fd2('0x6a')]['forEach'](function(_0x5d1bd1){_0x5d1bd1['penalty']=_[_0x0fd2('0x31')](_0x5a3809,{'id':_0x17b6ee['id']})[_0x0fd2('0x6e')];});return _0x17b6ee[_0x0fd2('0x6a')];});return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x23db78[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](function(_0x30c8aa){return db[_0x0fd2('0x6f')]['transaction'](function(_0x8aa97d){return _0x30c8aa[_0x0fd2('0x69')](_0x549306,{'transaction':_0x8aa97d})[_0x0fd2('0x26')](function(){return BPromise[_0x0fd2('0x70')](_0x5a3809,function(_0x3ac89f){return db[_0x0fd2('0x71')][_0x0fd2('0x72')]({'TeamId':_0x3ac89f['id'],'VoiceQueueId':_0x23db78['params']['id'],'penalty':_0x3ac89f[_0x0fd2('0x6e')]},{'transaction':_0x8aa97d});});})[_0x0fd2('0x26')](function(){return BPromise['each'](_0x254999,function(_0x26b5b0){return db[_0x0fd2('0x73')]['findOrCreate']({'where':{'UserId':_0x26b5b0['id'],'VoiceQueueId':_0x23db78['params']['id']},'defaults':{'penalty':_0x26b5b0['penalty']},'transaction':_0x8aa97d});});})['then'](function(){return BPromise[_0x0fd2('0x70')](_[_0x0fd2('0x2c')](_0x254999,{'online':!![]}),function(_0x45f4be){return db[_0x0fd2('0x74')][_0x0fd2('0x72')]({'membername':_0x45f4be['name'],'UserId':_0x45f4be['id'],'queue_name':_0x30c8aa[_0x0fd2('0x32')],'VoiceQueueId':_0x30c8aa['id'],'interface':_['isNil'](_0x45f4be[_0x0fd2('0x6c')])?util[_0x0fd2('0x75')](_0x0fd2('0x76'),_0x45f4be[_0x0fd2('0x32')]):_0x45f4be['interface'],'paused':_0x45f4be['voicePause']||![],'penalty':_0x45f4be[_0x0fd2('0x6e')]},{'transaction':_0x8aa97d});});})[_0x0fd2('0x26')](function(){_0x254999[_0x0fd2('0x77')](function(_0x5592a5){socket[_0x0fd2('0x78')](_0x0fd2('0x79'),{'UserId':_0x5592a5['id'],'VoiceQueueId':_0x30c8aa['id']});});});});});}})[_0x0fd2('0x26')](respondWithStatusCode(_0x2d97de,null))[_0x0fd2('0x4c')](handleError(_0x2d97de,null));};exports[_0x0fd2('0x7a')]=function(_0x204295,_0x3acba7,_0x502625){return db[_0x0fd2('0x68')][_0x0fd2('0x64')]({'where':{'id':_0x204295[_0x0fd2('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0fd2('0x7b')],'as':_0x0fd2('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x0fd2('0x26')](handleEntityNotFound(_0x3acba7,null))[_0x0fd2('0x26')](function(_0x2eee6e){var _0x2f46f0=_[_0x0fd2('0x2e')](_0x2eee6e,'id');var _0x930fd8=[];var _0x42359e=[];var _0x4055f4=squel['select']();_0x4055f4[_0x0fd2('0x7c')]('tq.TeamId')[_0x0fd2('0x7d')]('team_has_voice_queues','tq')[_0x0fd2('0x7e')](_0x0fd2('0x7f'),'ut',_0x0fd2('0x80'))[_0x0fd2('0x44')](_0x0fd2('0x81'),_0x204295[_0x0fd2('0x4e')]['id']);for(var _0x24676f=0x0;_0x24676f<_0x2eee6e['length'];_0x24676f+=0x1){let _0x4102c4=_0x2eee6e[_0x24676f];for(var _0x3cab70=0x0;_0x3cab70<_0x4102c4[_0x0fd2('0x6a')][_0x0fd2('0x4f')];_0x3cab70+=0x1){let _0x4af57f=_0x4102c4[_0x0fd2('0x6a')][_0x3cab70];var _0x5f54bb=_0x4055f4['clone']();_0x5f54bb[_0x0fd2('0x44')](_0x0fd2('0x82'),_0x4af57f['id']);_0x42359e[_0x0fd2('0x83')](db[_0x0fd2('0x6f')][_0x0fd2('0x3a')](_0x5f54bb[_0x0fd2('0x84')](),{'type':db[_0x0fd2('0x6f')][_0x0fd2('0x85')]['SELECT']})[_0x0fd2('0x26')](function(_0x1b8a6b){if(_0x1b8a6b[_0x0fd2('0x4f')]===0x1){return _0x4af57f['id'];}else{var _0x55bf30=_[_0x0fd2('0x86')](_['map'](_0x1b8a6b,_0x0fd2('0x87')),function(_0x329f21){return _[_0x0fd2('0x88')](_0x2f46f0,_0x329f21);});if(_0x55bf30){return _0x4af57f['id'];}}}));}}return BPromise['all'](_0x42359e)[_0x0fd2('0x26')](function(_0xfbbf6a){_0x930fd8=_(_0x930fd8)[_0x0fd2('0x89')](_0xfbbf6a)[_0x0fd2('0x8a')]()['value']();return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x204295[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](function(_0x1ea889){return db[_0x0fd2('0x6f')][_0x0fd2('0x8b')](function(_0x4ef946){return _0x1ea889[_0x0fd2('0x7a')](_0x204295[_0x0fd2('0x3a')]['ids'],{'transaction':_0x4ef946})[_0x0fd2('0x26')](function(){if(!_['isEmpty'](_0x930fd8)){return _0x1ea889[_0x0fd2('0x8c')](_0x930fd8,{'transaction':_0x4ef946})[_0x0fd2('0x26')](function(){return db[_0x0fd2('0x74')][_0x0fd2('0x34')]({'where':{'VoiceQueueId':_0x204295[_0x0fd2('0x4e')]['id'],'UserId':_0x930fd8},'transaction':_0x4ef946});});}})['then'](function(){_0x930fd8['forEach'](function(_0x337a61){socket['emit'](_0x0fd2('0x8d'),{'UserId':_0x337a61,'VoiceQueueId':_0x1ea889['id']});});});});});});})[_0x0fd2('0x26')](respondWithStatusCode(_0x3acba7,null))[_0x0fd2('0x4c')](handleError(_0x3acba7,null));};exports[_0x0fd2('0x8e')]=function(_0x2b36ba,_0x8ec643,_0xd0380a){var _0x5e7a1e,_0x33fb11;return db[_0x0fd2('0x48')][_0x0fd2('0x31')]({'where':{'id':_0x2b36ba[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x8ec643,null))[_0x0fd2('0x26')](function(_0x45a93b){if(_0x45a93b){_0x33fb11=_0x45a93b;return _0x45a93b[_0x0fd2('0x8e')](_0x2b36ba[_0x0fd2('0x51')]['ids'],_[_0x0fd2('0x8f')](_0x2b36ba[_0x0fd2('0x51')],[_0x0fd2('0x90'),'id'])||{})[_0x0fd2('0x91')](function(_0x489a04){for(var _0x56fa58=0x0;_0x56fa58<_0x2b36ba[_0x0fd2('0x51')]['ids'][_0x0fd2('0x4f')];_0x56fa58+=0x1){socket[_0x0fd2('0x78')](_0x0fd2('0x79'),{'UserId':Number(_0x2b36ba[_0x0fd2('0x51')]['ids'][_0x56fa58]),'VoiceQueueId':Number(_0x2b36ba[_0x0fd2('0x4e')]['id'])});}return _0x489a04;});}})[_0x0fd2('0x26')](function(_0x278640){_0x5e7a1e=_0x278640||[];if(_0x33fb11){return db[_0x0fd2('0x7b')]['findAll']({'where':{'id':_0x2b36ba[_0x0fd2('0x51')]['ids']},'attributes':['id',_0x0fd2('0x32'),_0x0fd2('0x92'),'voicePause','interface'],'raw':!![]});}})['then'](function(_0x2e2316){if(!_[_0x0fd2('0x93')](_0x2e2316)){var _0x44c4f6=[];for(var _0x5dce22=0x0;_0x5dce22<_0x2e2316[_0x0fd2('0x4f')];_0x5dce22++){if(_0x2e2316[_0x5dce22][_0x0fd2('0x92')]){_0x44c4f6[_0x0fd2('0x83')](db['UserVoiceQueueRt'][_0x0fd2('0x72')]({'membername':_0x2e2316[_0x5dce22][_0x0fd2('0x32')],'UserId':_0x2e2316[_0x5dce22]['id'],'queue_name':_0x33fb11[_0x0fd2('0x32')],'VoiceQueueId':_0x33fb11['id'],'interface':_[_0x0fd2('0x94')](_0x2e2316[_0x5dce22][_0x0fd2('0x6c')])?util['format'](_0x0fd2('0x76'),_0x2e2316[_0x5dce22][_0x0fd2('0x32')]):_0x2e2316[_0x5dce22]['interface'],'paused':_0x2e2316[_0x5dce22][_0x0fd2('0x6b')]||![],'penalty':_0x2b36ba['body'][_0x0fd2('0x6e')]||0x0}));}}return BPromise['all'](_0x44c4f6);}})['then'](function(){return _0x5e7a1e;})['then'](respondWithResult(_0x8ec643,null))[_0x0fd2('0x4c')](handleError(_0x8ec643,null));};exports[_0x0fd2('0x8c')]=function(_0x171fcd,_0x39d82a,_0x352e30){return db[_0x0fd2('0x48')][_0x0fd2('0x31')]({'where':{'id':_0x171fcd[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x39d82a,null))[_0x0fd2('0x26')](function(_0x25ec73){if(_0x25ec73){return _0x25ec73[_0x0fd2('0x8c')](_0x171fcd[_0x0fd2('0x3a')][_0x0fd2('0x90')])[_0x0fd2('0x26')](function(){if(_['isArray'](_0x171fcd[_0x0fd2('0x3a')][_0x0fd2('0x90')])){for(var _0xc64ae7=0x0;_0xc64ae7<_0x171fcd['query'][_0x0fd2('0x90')][_0x0fd2('0x4f')];_0xc64ae7+=0x1){socket['emit'](_0x0fd2('0x8d'),{'UserId':Number(_0x171fcd['query'][_0x0fd2('0x90')][_0xc64ae7]),'VoiceQueueId':Number(_0x171fcd[_0x0fd2('0x4e')]['id'])});}}else{socket[_0x0fd2('0x78')]('userVoiceQueue:remove',{'UserId':Number(_0x171fcd[_0x0fd2('0x3a')][_0x0fd2('0x90')]),'VoiceQueueId':Number(_0x171fcd[_0x0fd2('0x4e')]['id'])});}});}})[_0x0fd2('0x26')](function(_0x386e89){return db[_0x0fd2('0x74')][_0x0fd2('0x34')]({'where':{'VoiceQueueId':_0x171fcd['params']['id'],'UserId':_0x171fcd['query'][_0x0fd2('0x90')]}})[_0x0fd2('0x26')](function(){return _0x386e89;});})[_0x0fd2('0x26')](respondWithStatusCode(_0x39d82a,null))[_0x0fd2('0x4c')](handleError(_0x39d82a,null));};exports[_0x0fd2('0x95')]=function(_0x5288b4,_0x52581b,_0x36f6ad){var _0x38c3dc={};var _0x40d38a={};var _0xcb396d;var _0x3da13b;return db['VoiceQueue'][_0x0fd2('0x5e')]({'where':{'id':_0x5288b4[_0x0fd2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x52581b,null))[_0x0fd2('0x26')](function(_0x12c6fd){if(_0x12c6fd){_0xcb396d=_0x12c6fd;_0x40d38a[_0x0fd2('0x3e')]=_[_0x0fd2('0x3b')](db[_0x0fd2('0x7b')]['rawAttributes']);_0x40d38a[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x5288b4[_0x0fd2('0x3a')]);_0x40d38a['filters']=_[_0x0fd2('0x3d')](_0x40d38a[_0x0fd2('0x3e')],_0x40d38a[_0x0fd2('0x3a')]);_0x38c3dc[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x40d38a[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x38c3dc[_0x0fd2('0x3f')]=_0x38c3dc[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x38c3dc['attributes']:_0x40d38a[_0x0fd2('0x3e')];_0x38c3dc[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x38c3dc['where']=qs[_0x0fd2('0x3c')](_[_0x0fd2('0x45')](_0x5288b4[_0x0fd2('0x3a')],_0x40d38a[_0x0fd2('0x3c')]));if(_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x38c3dc[_0x0fd2('0x44')]=_[_0x0fd2('0x59')](_0x38c3dc['where'],{'$or':_[_0x0fd2('0x2e')](_0x38c3dc['attributes'],function(_0x838146){var _0x46c7de={};_0x46c7de[_0x838146]={'$like':'%'+_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x2c')]+'%'};return _0x46c7de;})});}_0x38c3dc=_[_0x0fd2('0x59')]({},_0x38c3dc,_0x5288b4[_0x0fd2('0x47')]);return _0xcb396d[_0x0fd2('0x95')](_0x38c3dc);}})[_0x0fd2('0x26')](function(_0x9e4ce8){if(_0x9e4ce8){_0x3da13b=_0x9e4ce8[_0x0fd2('0x4f')];if(!_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x41')](_0x0fd2('0x60'))){_0x38c3dc[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x5288b4['query'][_0x0fd2('0x1e')]);_0x38c3dc['offset']=qs['offset'](_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}return _0xcb396d[_0x0fd2('0x95')](_0x38c3dc);}})['then'](function(_0x389a13){if(_0x389a13){return _0x389a13?{'count':_0x3da13b,'rows':_0x389a13}:null;}})[_0x0fd2('0x26')](respondWithResult(_0x52581b,null))[_0x0fd2('0x4c')](handleError(_0x52581b,null));};exports['getMembers']=function(_0x2d72d3,_0x13d21f,_0x839fa2){var _0x2c937e={};var _0x2182ff={};var _0x57a3b7;var _0x4a560f;return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x2d72d3['params']['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x13d21f,null))[_0x0fd2('0x26')](function(_0xfb23b5){if(_0xfb23b5){_0x57a3b7=_0xfb23b5;_0x2182ff[_0x0fd2('0x3e')]=_[_0x0fd2('0x3b')](db[_0x0fd2('0x74')]['rawAttributes']);_0x2182ff[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x2d72d3[_0x0fd2('0x3a')]);_0x2182ff['filters']=_[_0x0fd2('0x3d')](_0x2182ff['model'],_0x2182ff['query']);_0x2c937e[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x2182ff[_0x0fd2('0x3e')],qs['fields'](_0x2d72d3[_0x0fd2('0x3a')]['fields']));_0x2c937e[_0x0fd2('0x3f')]=_0x2c937e[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x2c937e['attributes']:_0x2182ff[_0x0fd2('0x3e')];_0x2c937e[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x2c937e[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_[_0x0fd2('0x45')](_0x2d72d3['query'],_0x2182ff['filters']));if(_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x2c937e[_0x0fd2('0x44')]=_['merge'](_0x2c937e[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x2c937e['attributes'],function(_0x4cbf0b){var _0xbbdba={};_0xbbdba[_0x4cbf0b]={'$like':'%'+_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x2c')]+'%'};return _0xbbdba;})});}_0x2c937e=_[_0x0fd2('0x59')]({},_0x2c937e,_0x2d72d3[_0x0fd2('0x47')]);return _0x57a3b7[_0x0fd2('0x96')](_0x2c937e);}})['then'](function(_0xbc48){if(_0xbc48){_0x4a560f=_0xbc48['length'];if(!_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x41')](_0x0fd2('0x60'))){_0x2c937e[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x2c937e[_0x0fd2('0x1d')]=qs[_0x0fd2('0x1d')](_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}return _0x57a3b7[_0x0fd2('0x96')](_0x2c937e);}})[_0x0fd2('0x26')](function(_0x46d429){return _0x46d429?{'count':_0x4a560f,'rows':_0x46d429}:null;})[_0x0fd2('0x26')](respondWithResult(_0x13d21f,null))[_0x0fd2('0x4c')](handleError(_0x13d21f,null));};exports[_0x0fd2('0x97')]=function(_0x591dab,_0x187f92,_0x26d3d5){var _0x522123={};var _0xe0bf92={};var _0x15c72e;var _0x59eca9;return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x591dab['params']['id']}})['then'](handleEntityNotFound(_0x187f92,null))[_0x0fd2('0x26')](function(_0x5d3ae7){if(_0x5d3ae7){_0x15c72e=_0x5d3ae7;_0xe0bf92['model']=_[_0x0fd2('0x3b')](db['CmList'][_0x0fd2('0x38')]);_0xe0bf92[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x591dab[_0x0fd2('0x3a')]);_0xe0bf92[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0xe0bf92[_0x0fd2('0x3e')],_0xe0bf92[_0x0fd2('0x3a')]);_0x522123[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0xe0bf92[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x591dab[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x522123['attributes']=_0x522123[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x522123['attributes']:_0xe0bf92[_0x0fd2('0x3e')];_0x522123['order']=qs[_0x0fd2('0x43')](_0x591dab[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x522123['where']=qs['filters'](_[_0x0fd2('0x45')](_0x591dab[_0x0fd2('0x3a')],_0xe0bf92[_0x0fd2('0x3c')]));if(_0x591dab['query'][_0x0fd2('0x2c')]){_0x522123[_0x0fd2('0x44')]=_[_0x0fd2('0x59')](_0x522123[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x522123[_0x0fd2('0x3f')],function(_0x3ce674){var _0x43f2c6={};_0x43f2c6[_0x3ce674]={'$like':'%'+_0x591dab['query']['filter']+'%'};return _0x43f2c6;})});}_0x522123=_[_0x0fd2('0x59')]({},_0x522123,_0x591dab[_0x0fd2('0x47')]);return _0x15c72e[_0x0fd2('0x97')](_0x522123);}})[_0x0fd2('0x26')](function(_0xaace5f){if(_0xaace5f){_0x59eca9=_0xaace5f[_0x0fd2('0x4f')];if(!_0x591dab[_0x0fd2('0x3a')][_0x0fd2('0x41')](_0x0fd2('0x60'))){_0x522123[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x591dab[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x522123[_0x0fd2('0x1d')]=qs[_0x0fd2('0x1d')](_0x591dab[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}return _0x15c72e['getLists'](_0x522123);}})[_0x0fd2('0x26')](function(_0x451f31){if(_0x451f31){return _0x451f31?{'count':_0x59eca9,'rows':_0x451f31}:null;}})[_0x0fd2('0x26')](respondWithResult(_0x187f92,null))[_0x0fd2('0x4c')](handleError(_0x187f92,null));};exports[_0x0fd2('0x98')]=function(_0x468f7a,_0x4b0e7d,_0x4e1cef){var _0x2dc84d=moment()['format'](_0x0fd2('0x99'));var _0x1b61b2,_0x4f4b3b;return db[_0x0fd2('0x48')][_0x0fd2('0x31')]({'where':{'id':_0x468f7a[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x4b0e7d,null))['then'](function(_0x203fbe){if(_0x203fbe){_0x4f4b3b=_0x203fbe;return _0x203fbe[_0x0fd2('0x98')](_0x468f7a[_0x0fd2('0x51')][_0x0fd2('0x90')],_[_0x0fd2('0x8f')](_0x468f7a[_0x0fd2('0x51')],[_0x0fd2('0x90'),'id'])||{});}return null;})['spread'](function(_0x23a184){var _0x544885;_0x1b61b2=_0x23a184||[];var _0x6d0e63=[];if(_0x23a184){for(var _0x2379c0=0x0;_0x2379c0<_0x23a184[_0x0fd2('0x4f')];_0x2379c0+=0x1){var _0x285bd7=_0x23a184[_0x2379c0][_0x0fd2('0x27')]({'plain':!![]});_0x4f4b3b[_0x0fd2('0x9a')]=_0x468f7a['body'][_0x0fd2('0x9a')]?_0x468f7a[_0x0fd2('0x51')][_0x0fd2('0x9a')]:_0x4f4b3b[_0x0fd2('0x9a')];switch(_0x4f4b3b['dialCheckDuplicateType']){case _0x0fd2('0x9b'):_0x544885=squel[_0x0fd2('0x9c')]()['into'](_0x0fd2('0x9d'))[_0x0fd2('0x9e')]([_0x0fd2('0x9f'),'scheduledAt','ContactId',_0x0fd2('0xa0'),_0x0fd2('0x61'),_0x0fd2('0x5a'),'updatedAt'],squel['select']()[_0x0fd2('0x7c')](_0x0fd2('0x9f'),_0x0fd2('0x9f'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27',_0x0fd2('0xa1'))[_0x0fd2('0x7c')]('id',_0x0fd2('0xa2'))[_0x0fd2('0x7c')](_0x285bd7['CmListId'][_0x0fd2('0x84')](),_0x0fd2('0xa0'))[_0x0fd2('0x7c')](_0x468f7a[_0x0fd2('0x4e')]['id'][_0x0fd2('0x84')](),'VoiceQueueId')[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27',_0x0fd2('0x5a'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27',_0x0fd2('0x5b'))[_0x0fd2('0x7d')](_0x0fd2('0xa3'))[_0x0fd2('0x44')](_0x0fd2('0xa4'))[_0x0fd2('0x44')](_0x0fd2('0xa5'),_0x285bd7[_0x0fd2('0xa6')][_0x0fd2('0x84')]())[_0x0fd2('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x0fd2('0x44')](_0x0fd2('0xa7'),squel[_0x0fd2('0xa8')]()[_0x0fd2('0x7c')]('COALESCE(calleridnum,\x27\x27)')[_0x0fd2('0x7d')]('cm_hopper_final')[_0x0fd2('0x44')]('VoiceQueueId\x20=\x20?',_0x468f7a[_0x0fd2('0x4e')]['id']['toString']()))[_0x0fd2('0x44')](_0x0fd2('0xa7'),squel[_0x0fd2('0xa8')]()[_0x0fd2('0x7c')](_0x0fd2('0xa9'))[_0x0fd2('0x7d')](_0x0fd2('0x9d'))[_0x0fd2('0x44')](_0x0fd2('0x81'),_0x468f7a[_0x0fd2('0x4e')]['id'][_0x0fd2('0x84')]())))[_0x0fd2('0x84')]();break;case _0x0fd2('0xaa'):_0x544885=squel['insert']()[_0x0fd2('0xab')]('cm_hopper')['fromQuery']([_0x0fd2('0x9f'),_0x0fd2('0xa1'),_0x0fd2('0xa2'),_0x0fd2('0xa0'),_0x0fd2('0x61'),_0x0fd2('0x5a'),'updatedAt'],squel[_0x0fd2('0xa8')]()['field'](_0x0fd2('0x9f'),_0x0fd2('0x9f'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','scheduledAt')[_0x0fd2('0x7c')]('id',_0x0fd2('0xa2'))[_0x0fd2('0x7c')](_0x285bd7[_0x0fd2('0xa6')]['toString'](),_0x0fd2('0xa0'))[_0x0fd2('0x7c')](_0x468f7a[_0x0fd2('0x4e')]['id'][_0x0fd2('0x84')](),_0x0fd2('0x61'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','createdAt')[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','updatedAt')[_0x0fd2('0x7d')]('cm_contacts')[_0x0fd2('0x44')]('deletedAt\x20IS\x20NULL')[_0x0fd2('0x44')]('ListId\x20=\x20?',_0x285bd7['CmListId'][_0x0fd2('0x84')]())[_0x0fd2('0x44')](_0x0fd2('0xac'))[_0x0fd2('0x44')](_0x0fd2('0xa7'),squel[_0x0fd2('0xa8')]()[_0x0fd2('0x7c')](_0x0fd2('0xa9'))[_0x0fd2('0x7d')]('cm_hopper')[_0x0fd2('0x44')]('VoiceQueueId\x20=\x20?',_0x468f7a[_0x0fd2('0x4e')]['id']['toString']())))[_0x0fd2('0x84')]();break;default:_0x544885=squel[_0x0fd2('0x9c')]()['into'](_0x0fd2('0x9d'))['fromQuery']([_0x0fd2('0x9f'),_0x0fd2('0xa1'),_0x0fd2('0xa2'),_0x0fd2('0xa0'),'VoiceQueueId',_0x0fd2('0x5a'),_0x0fd2('0x5b')],squel[_0x0fd2('0xa8')]()[_0x0fd2('0x7c')](_0x0fd2('0x9f'),'phone')[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','scheduledAt')['field']('id','ContactId')[_0x0fd2('0x7c')](_0x285bd7[_0x0fd2('0xa6')]['toString'](),_0x0fd2('0xa0'))['field'](_0x468f7a[_0x0fd2('0x4e')]['id'][_0x0fd2('0x84')](),_0x0fd2('0x61'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','createdAt')[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27',_0x0fd2('0x5b'))[_0x0fd2('0x7d')](_0x0fd2('0xa3'))[_0x0fd2('0x44')]('deletedAt\x20IS\x20NULL')[_0x0fd2('0x44')]('ListId\x20=\x20?',_0x285bd7[_0x0fd2('0xa6')]['toString']())[_0x0fd2('0x44')](_0x0fd2('0xac')))[_0x0fd2('0x84')]();}_0x6d0e63[_0x0fd2('0x83')](db[_0x0fd2('0x6f')][_0x0fd2('0x3a')](_0x544885));}return BPromise['all'](_0x6d0e63);}})[_0x0fd2('0x26')](function(){var _0x4b2a0e=[];var _0x1ad987=squel[_0x0fd2('0x9c')]()[_0x0fd2('0xab')]('cm_hopper_additional_phones')[_0x0fd2('0x9e')]([_0x0fd2('0xad'),'phone',_0x0fd2('0xae'),_0x0fd2('0x5a'),'updatedAt'],squel[_0x0fd2('0xa8')]()[_0x0fd2('0x7c')]('h.id')[_0x0fd2('0x7c')](_0x0fd2('0xaf'))[_0x0fd2('0x7c')](_0x0fd2('0xb0'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27',_0x0fd2('0x5a'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','updatedAt')[_0x0fd2('0x7d')](_0x0fd2('0xb1'),'ci')[_0x0fd2('0x7e')](_0x0fd2('0x9d'),'h','h.ContactId=ci.CmContactId')[_0x0fd2('0x44')](_0x0fd2('0xb2'),_0x2dc84d)[_0x0fd2('0x44')](_0x0fd2('0xb3'),_0x0fd2('0xb4')))[_0x0fd2('0x84')]();_0x4b2a0e['push'](db[_0x0fd2('0x6f')]['query'](_0x1ad987));return BPromise[_0x0fd2('0xb5')](_0x4b2a0e);})[_0x0fd2('0x26')](function(){return _0x1b61b2;})['then'](respondWithResult(_0x4b0e7d,null))['catch'](handleError(_0x4b0e7d,null));};exports[_0x0fd2('0xb6')]=function(_0x3878eb,_0x5383ea,_0x260a1d){return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x3878eb['params']['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x5383ea,null))[_0x0fd2('0x26')](function(_0x4fd20b){if(_0x4fd20b){return _0x4fd20b[_0x0fd2('0xb6')](_0x3878eb[_0x0fd2('0x3a')][_0x0fd2('0x90')]);}})[_0x0fd2('0x26')](function(_0x318144){if(_0x318144){return db[_0x0fd2('0x5f')][_0x0fd2('0x34')]({'where':{'ListId':_0x3878eb[_0x0fd2('0x3a')][_0x0fd2('0x90')],'VoiceQueueId':_0x3878eb[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](function(){return _0x318144;});}})[_0x0fd2('0x26')](respondWithStatusCode(_0x5383ea,null))[_0x0fd2('0x4c')](handleError(_0x5383ea,null));};exports['getBlackLists']=function(_0x51b80a,_0x54585d,_0x407be5){var _0x241914={};var _0x64e087={};var _0x35479a;var _0x81b4bb;return db[_0x0fd2('0x48')]['findOne']({'where':{'id':_0x51b80a[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x54585d,null))['then'](function(_0x2ec276){if(_0x2ec276){_0x35479a=_0x2ec276;_0x64e087['model']=_[_0x0fd2('0x3b')](db[_0x0fd2('0xb7')][_0x0fd2('0x38')]);_0x64e087[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x51b80a[_0x0fd2('0x3a')]);_0x64e087[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x64e087[_0x0fd2('0x3e')],_0x64e087[_0x0fd2('0x3a')]);_0x241914[_0x0fd2('0x3f')]=_['intersection'](_0x64e087[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x51b80a[_0x0fd2('0x3a')]['fields']));_0x241914['attributes']=_0x241914[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x241914[_0x0fd2('0x3f')]:_0x64e087[_0x0fd2('0x3e')];_0x241914['order']=qs[_0x0fd2('0x43')](_0x51b80a[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x241914[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_['pick'](_0x51b80a['query'],_0x64e087[_0x0fd2('0x3c')]));if(_0x51b80a[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x241914[_0x0fd2('0x44')]=_['merge'](_0x241914[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x241914[_0x0fd2('0x3f')],function(_0x2c7824){var _0x1ec0da={};_0x1ec0da[_0x2c7824]={'$like':'%'+_0x51b80a['query']['filter']+'%'};return _0x1ec0da;})});}_0x241914=_[_0x0fd2('0x59')]({},_0x241914,_0x51b80a[_0x0fd2('0x47')]);return _0x35479a[_0x0fd2('0xb8')](_0x241914);}})[_0x0fd2('0x26')](function(_0x5a3e6d){if(_0x5a3e6d){_0x81b4bb=_0x5a3e6d[_0x0fd2('0x4f')];if(!_0x51b80a['query']['hasOwnProperty'](_0x0fd2('0x60'))){_0x241914[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x51b80a[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x241914['offset']=qs[_0x0fd2('0x1d')](_0x51b80a[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}return _0x35479a[_0x0fd2('0xb8')](_0x241914);}})['then'](function(_0x4567ad){if(_0x4567ad){return _0x4567ad?{'count':_0x81b4bb,'rows':_0x4567ad}:null;}})[_0x0fd2('0x26')](respondWithResult(_0x54585d,null))[_0x0fd2('0x4c')](handleError(_0x54585d,null));};exports[_0x0fd2('0xb9')]=function(_0x30ef90,_0x6ea2c8,_0x17a770){var _0x34b662,_0x14df62;return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x30ef90[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x6ea2c8,null))[_0x0fd2('0x26')](function(_0x3c0c6c){if(_0x3c0c6c){_0x14df62=_0x3c0c6c;return _0x3c0c6c[_0x0fd2('0xb9')](_0x30ef90[_0x0fd2('0x51')]['ids'],_[_0x0fd2('0x8f')](_0x30ef90[_0x0fd2('0x51')],[_0x0fd2('0x90'),'id'])||{});}return null;})[_0x0fd2('0x91')](function(_0x1da9f3){var _0x50e7ba;_0x34b662=_0x1da9f3||[];var _0x1739c7=[];if(_0x1da9f3){for(var _0x59618c=0x0;_0x59618c<_0x1da9f3[_0x0fd2('0x4f')];_0x59618c+=0x1){var _0x18ec77=_0x1da9f3[_0x59618c][_0x0fd2('0x27')]({'plain':!![]});_0x50e7ba=squel[_0x0fd2('0x9c')]()[_0x0fd2('0xab')](_0x0fd2('0xba'))[_0x0fd2('0x9e')]([_0x0fd2('0x9f'),_0x0fd2('0xa2'),_0x0fd2('0xa0'),'VoiceQueueId',_0x0fd2('0x5a'),_0x0fd2('0x5b')],squel['select']()[_0x0fd2('0x7c')](_0x0fd2('0x9f'),_0x0fd2('0x9f'))[_0x0fd2('0x7c')]('id',_0x0fd2('0xa2'))[_0x0fd2('0x7c')](_0x18ec77[_0x0fd2('0xa6')][_0x0fd2('0x84')](),'ListId')[_0x0fd2('0x7c')](_0x30ef90['params']['id'][_0x0fd2('0x84')](),_0x0fd2('0x61'))[_0x0fd2('0x7c')](_0x0fd2('0xbb'),_0x0fd2('0x5a'))[_0x0fd2('0x7c')](_0x0fd2('0xbb'),_0x0fd2('0x5b'))[_0x0fd2('0x7d')](_0x0fd2('0xa3'))[_0x0fd2('0x44')](_0x0fd2('0xa4'))[_0x0fd2('0x44')](_0x0fd2('0xa5'),_0x18ec77[_0x0fd2('0xa6')][_0x0fd2('0x84')]())[_0x0fd2('0x44')](_0x0fd2('0xac')))['toString']();_0x1739c7['push'](db[_0x0fd2('0x6f')][_0x0fd2('0x3a')](_0x50e7ba));}return BPromise[_0x0fd2('0xb5')](_0x1739c7);}})[_0x0fd2('0x26')](function(){return _0x34b662;})[_0x0fd2('0x26')](respondWithResult(_0x6ea2c8,null))[_0x0fd2('0x4c')](handleError(_0x6ea2c8,null));};exports[_0x0fd2('0xbc')]=function(_0x2085ad,_0x44db9a,_0x5134d9){return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x2085ad[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x44db9a,null))[_0x0fd2('0x26')](function(_0x5af168){if(_0x5af168){return _0x5af168[_0x0fd2('0xbc')](_0x2085ad['query'][_0x0fd2('0x90')]);}})[_0x0fd2('0x26')](function(_0x30e702){if(_0x30e702){return db[_0x0fd2('0x66')][_0x0fd2('0x34')]({'where':{'ListId':_0x2085ad['query'][_0x0fd2('0x90')],'VoiceQueueId':_0x2085ad[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](function(){return _0x30e702;});}})[_0x0fd2('0x26')](respondWithStatusCode(_0x44db9a,null))['catch'](handleError(_0x44db9a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index f277c72..3a278f7 100644 --- a/server/api/voiceQueue/voiceQueue.events.js +++ b/server/api/voiceQueue/voiceQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe800=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','events'];(function(_0x55cdc4,_0x28561f){var _0x31e578=function(_0x4d2bc2){while(--_0x4d2bc2){_0x55cdc4['push'](_0x55cdc4['shift']());}};_0x31e578(++_0x28561f);}(_0xe800,0x1aa));var _0x0e80=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xe800[_0x409353];return _0x4f4b59;};'use strict';var EventEmitter=require(_0x0e80('0x0'));var VoiceQueue=require(_0x0e80('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0e80('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0e80('0x3'),'afterDestroy':_0x0e80('0x4')};function emitEvent(_0x2359a8){return function(_0x4af739,_0x9bd7c,_0x171ba3){VoiceQueueEvents[_0x0e80('0x5')](_0x2359a8+':'+_0x4af739['id'],_0x4af739);VoiceQueueEvents[_0x0e80('0x5')](_0x2359a8,_0x4af739);_0x171ba3(null);};}for(var e in events){if(events[_0x0e80('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xbe72=['update','remove','hook','events','VoiceQueue','setMaxListeners'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0xbe72,0x1e3));var _0x2be7=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xbe72[_0x30ae5e];return _0x1f2e93;};'use strict';var EventEmitter=require(_0x2be7('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x2be7('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2be7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2be7('0x3'),'afterDestroy':_0x2be7('0x4')};function emitEvent(_0x16fb49){return function(_0x484dd0,_0x252f6d,_0x4cd726){VoiceQueueEvents['emit'](_0x16fb49+':'+_0x484dd0['id'],_0x484dd0);VoiceQueueEvents['emit'](_0x16fb49,_0x484dd0);_0x4cd726(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x2be7('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 48b8d5a..8261ce0 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x4d2d25,_0x42ecc9){var _0xb4bd7a=function(_0x2e7f01){while(--_0x2e7f01){_0x4d2d25['push'](_0x4d2d25['shift']());}};_0xb4bd7a(++_0x42ecc9);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x3ed95e,_0x2d2d13){var _0x4ab531=function(_0x4823b4){while(--_0x4823b4){_0x3ed95e['push'](_0x3ed95e['shift']());}};_0x4ab531(++_0x2d2d13);}(_0x008c,0x188));var _0xc008=function(_0x53b22e,_0x5e248f){_0x53b22e=_0x53b22e-0x0;var _0x14a0a4=_0x008c[_0x53b22e];return _0x14a0a4;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 045c896..4a16f5a 100644 --- a/server/api/voiceQueue/voiceQueue.rpc.js +++ b/server/api/voiceQueue/voiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f0f=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./voiceQueue.socket','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueue,\x20%s,\x20%s','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','limit','map','attributes','include','model','ShowVoiceQueue','where','lodash','util','moment','bluebird','randomstring'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x7f0f,0xc3));var _0xf7f0=function(_0xdd0606,_0x2c9619){_0xdd0606=_0xdd0606-0x0;var _0x3183f6=_0x7f0f[_0xdd0606];return _0x3183f6;};'use strict';var _=require(_0xf7f0('0x0'));var util=require(_0xf7f0('0x1'));var moment=require(_0xf7f0('0x2'));var BPromise=require(_0xf7f0('0x3'));var rs=require(_0xf7f0('0x4'));var fs=require('fs');var Redis=require(_0xf7f0('0x5'));var db=require(_0xf7f0('0x6'))['db'];var utils=require(_0xf7f0('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf7f0('0x8'));var jayson=require(_0xf7f0('0x9'));var client=jayson['client'][_0xf7f0('0xa')]({'port':0x232a});config[_0xf7f0('0xb')]=_['defaults'](config[_0xf7f0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf7f0('0xc'))(new Redis(config['redis']));require(_0xf7f0('0xd'))[_0xf7f0('0xe')](socket);function respondWithRpcPromise(_0x97bd07,_0x212ee3,_0x5c1839){return new BPromise(function(_0x516205,_0x3a8a56){return client[_0xf7f0('0xf')](_0x97bd07,_0x5c1839)[_0xf7f0('0x10')](function(_0x35cca5){logger[_0xf7f0('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x212ee3,_0xf7f0('0x12'));logger[_0xf7f0('0x13')](_0xf7f0('0x14'),_0x212ee3,_0xf7f0('0x12'),JSON[_0xf7f0('0x15')](_0x35cca5));if(_0x35cca5[_0xf7f0('0x16')]){if(_0x35cca5[_0xf7f0('0x16')][_0xf7f0('0x17')]===0x1f4){logger[_0xf7f0('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x212ee3,_0x35cca5[_0xf7f0('0x16')][_0xf7f0('0x18')]);return _0x3a8a56(_0x35cca5[_0xf7f0('0x16')][_0xf7f0('0x18')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x212ee3,_0x35cca5[_0xf7f0('0x16')][_0xf7f0('0x18')]);return _0x516205(_0x35cca5[_0xf7f0('0x16')][_0xf7f0('0x18')]);}else{logger[_0xf7f0('0x11')](_0xf7f0('0x19'),_0x212ee3,_0xf7f0('0x12'));_0x516205(_0x35cca5[_0xf7f0('0x1a')][_0xf7f0('0x18')]);}})[_0xf7f0('0x1b')](function(_0x30838f){logger['error'](_0xf7f0('0x19'),_0x212ee3,_0x30838f);_0x3a8a56(_0x30838f);});});}exports[_0xf7f0('0x1c')]=function(_0x16c512){var _0x395a86=this;return new Promise(function(_0x5c2f99,_0xba6ba5){return db[_0xf7f0('0x1d')][_0xf7f0('0x1e')]({'raw':_0x16c512[_0xf7f0('0x1f')]?_0x16c512[_0xf7f0('0x1f')][_0xf7f0('0x20')]===undefined?!![]:![]:!![],'where':_0x16c512[_0xf7f0('0x1f')]?_0x16c512[_0xf7f0('0x1f')]['where']||null:null,'attributes':_0x16c512['options']?_0x16c512['options']['attributes']||null:null,'limit':_0x16c512[_0xf7f0('0x1f')]?_0x16c512[_0xf7f0('0x1f')][_0xf7f0('0x21')]||null:null,'include':_0x16c512['options']?_0x16c512[_0xf7f0('0x1f')]['include']?_[_0xf7f0('0x22')](_0x16c512[_0xf7f0('0x1f')]['include'],function(_0x42ecd0){return{'model':db[_0x42ecd0['model']],'as':_0x42ecd0['as'],'attributes':_0x42ecd0[_0xf7f0('0x23')],'include':_0x42ecd0[_0xf7f0('0x24')]?_[_0xf7f0('0x22')](_0x42ecd0[_0xf7f0('0x24')],function(_0x92652d){return{'model':db[_0x92652d[_0xf7f0('0x25')]],'as':_0x92652d['as'],'attributes':_0x92652d['attributes'],'include':_0x92652d[_0xf7f0('0x24')]?_['map'](_0x92652d[_0xf7f0('0x24')],function(_0x451dd0){return{'model':db[_0x451dd0[_0xf7f0('0x25')]],'as':_0x451dd0['as'],'attributes':_0x451dd0['attributes']};}):[]};}):[]};}):[]:[]})[_0xf7f0('0x10')](function(_0x64ff37){logger[_0xf7f0('0x11')](_0xf7f0('0x1c'),_0x16c512);logger[_0xf7f0('0x13')](_0xf7f0('0x1c'),_0x16c512,JSON[_0xf7f0('0x15')](_0x64ff37));_0x5c2f99(_0x64ff37);})[_0xf7f0('0x1b')](function(_0x49e39){logger[_0xf7f0('0x16')]('GetVoiceQueue',_0x49e39[_0xf7f0('0x18')],_0x16c512);_0xba6ba5(_0x395a86['error'](0x1f4,_0x49e39[_0xf7f0('0x18')]));});});};exports[_0xf7f0('0x26')]=function(_0x381546){var _0x5527=this;return new Promise(function(_0xba5fd2,_0x5419c3){return db[_0xf7f0('0x1d')]['find']({'raw':_0x381546[_0xf7f0('0x1f')]?_0x381546[_0xf7f0('0x1f')][_0xf7f0('0x20')]===undefined?!![]:![]:!![],'where':_0x381546[_0xf7f0('0x1f')]?_0x381546[_0xf7f0('0x1f')][_0xf7f0('0x27')]||null:null,'attributes':_0x381546[_0xf7f0('0x1f')]?_0x381546[_0xf7f0('0x1f')][_0xf7f0('0x23')]||null:null,'include':_0x381546[_0xf7f0('0x1f')]?_0x381546[_0xf7f0('0x1f')][_0xf7f0('0x24')]?_[_0xf7f0('0x22')](_0x381546[_0xf7f0('0x1f')][_0xf7f0('0x24')],function(_0x4750bc){return{'model':db[_0x4750bc[_0xf7f0('0x25')]],'as':_0x4750bc['as'],'attributes':_0x4750bc[_0xf7f0('0x23')],'include':_0x4750bc[_0xf7f0('0x24')]?_[_0xf7f0('0x22')](_0x4750bc[_0xf7f0('0x24')],function(_0x37d2ef){return{'model':db[_0x37d2ef['model']],'as':_0x37d2ef['as'],'attributes':_0x37d2ef['attributes'],'include':_0x37d2ef[_0xf7f0('0x24')]?_[_0xf7f0('0x22')](_0x37d2ef[_0xf7f0('0x24')],function(_0x43c04b){return{'model':db[_0x43c04b[_0xf7f0('0x25')]],'as':_0x43c04b['as'],'attributes':_0x43c04b[_0xf7f0('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf7f0('0x10')](function(_0x12198e){logger[_0xf7f0('0x11')](_0xf7f0('0x26'),_0x381546);logger['debug'](_0xf7f0('0x26'),_0x381546,JSON['stringify'](_0x12198e));_0xba5fd2(_0x12198e);})[_0xf7f0('0x1b')](function(_0x494665){logger[_0xf7f0('0x16')]('ShowVoiceQueue',_0x494665[_0xf7f0('0x18')],_0x381546);_0x5419c3(_0x5527['error'](0x1f4,_0x494665['message']));});});}; \ No newline at end of file +var _0x88bf=['message','VoiceQueue,\x20%s,\x20%s','request\x20sent','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','find','then','ShowVoiceQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','debug','stringify','error'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x88bf,0x153));var _0xf88b=function(_0x5eb442,_0xe2ae2e){_0x5eb442=_0x5eb442-0x0;var _0x53aad0=_0x88bf[_0x5eb442];return _0x53aad0;};'use strict';var _=require('lodash');var util=require(_0xf88b('0x0'));var moment=require(_0xf88b('0x1'));var BPromise=require(_0xf88b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf88b('0x3'));var db=require(_0xf88b('0x4'))['db'];var utils=require(_0xf88b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf88b('0x6'));var jayson=require(_0xf88b('0x7'));var client=jayson[_0xf88b('0x8')][_0xf88b('0x9')]({'port':0x232a});config['redis']=_[_0xf88b('0xa')](config[_0xf88b('0xb')],{'host':_0xf88b('0xc'),'port':0x18eb});var socket=require(_0xf88b('0xd'))(new Redis(config[_0xf88b('0xb')]));require(_0xf88b('0xe'))[_0xf88b('0xf')](socket);function respondWithRpcPromise(_0x3d60c2,_0x58bbe4,_0x39f756){return new BPromise(function(_0x4fe4b6,_0x26a08c){return client[_0xf88b('0x10')](_0x3d60c2,_0x39f756)['then'](function(_0x17a4ef){logger[_0xf88b('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x58bbe4,'request\x20sent');logger[_0xf88b('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x58bbe4,'request\x20sent',JSON[_0xf88b('0x13')](_0x17a4ef));if(_0x17a4ef['error']){if(_0x17a4ef[_0xf88b('0x14')]['code']===0x1f4){logger[_0xf88b('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x58bbe4,_0x17a4ef[_0xf88b('0x14')][_0xf88b('0x15')]);return _0x26a08c(_0x17a4ef[_0xf88b('0x14')]['message']);}logger[_0xf88b('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x58bbe4,_0x17a4ef[_0xf88b('0x14')][_0xf88b('0x15')]);return _0x4fe4b6(_0x17a4ef[_0xf88b('0x14')][_0xf88b('0x15')]);}else{logger['info'](_0xf88b('0x16'),_0x58bbe4,_0xf88b('0x17'));_0x4fe4b6(_0x17a4ef[_0xf88b('0x18')]['message']);}})['catch'](function(_0x12d693){logger[_0xf88b('0x14')](_0xf88b('0x16'),_0x58bbe4,_0x12d693);_0x26a08c(_0x12d693);});});}exports[_0xf88b('0x19')]=function(_0x1c1afb){var _0x5c936d=this;return new Promise(function(_0x1485f0,_0x45ce89){return db[_0xf88b('0x1a')][_0xf88b('0x1b')]({'raw':_0x1c1afb[_0xf88b('0x1c')]?_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c1afb[_0xf88b('0x1c')]?_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x1e')]||null:null,'attributes':_0x1c1afb[_0xf88b('0x1c')]?_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x1f')]||null:null,'limit':_0x1c1afb[_0xf88b('0x1c')]?_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x20')]||null:null,'include':_0x1c1afb[_0xf88b('0x1c')]?_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x21')]?_[_0xf88b('0x22')](_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x21')],function(_0x4ee253){return{'model':db[_0x4ee253[_0xf88b('0x23')]],'as':_0x4ee253['as'],'attributes':_0x4ee253[_0xf88b('0x1f')],'include':_0x4ee253['include']?_['map'](_0x4ee253[_0xf88b('0x21')],function(_0x1f0164){return{'model':db[_0x1f0164[_0xf88b('0x23')]],'as':_0x1f0164['as'],'attributes':_0x1f0164['attributes'],'include':_0x1f0164[_0xf88b('0x21')]?_[_0xf88b('0x22')](_0x1f0164['include'],function(_0x163187){return{'model':db[_0x163187[_0xf88b('0x23')]],'as':_0x163187['as'],'attributes':_0x163187[_0xf88b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46946d){logger[_0xf88b('0x11')](_0xf88b('0x19'),_0x1c1afb);logger[_0xf88b('0x12')](_0xf88b('0x19'),_0x1c1afb,JSON[_0xf88b('0x13')](_0x46946d));_0x1485f0(_0x46946d);})[_0xf88b('0x24')](function(_0x5078d8){logger['error'](_0xf88b('0x19'),_0x5078d8[_0xf88b('0x15')],_0x1c1afb);_0x45ce89(_0x5c936d[_0xf88b('0x14')](0x1f4,_0x5078d8[_0xf88b('0x15')]));});});};exports['ShowVoiceQueue']=function(_0x9aa656){var _0x1e7c65=this;return new Promise(function(_0x3f4682,_0x3910ef){return db['VoiceQueue'][_0xf88b('0x25')]({'raw':_0x9aa656[_0xf88b('0x1c')]?_0x9aa656[_0xf88b('0x1c')][_0xf88b('0x1d')]===undefined?!![]:![]:!![],'where':_0x9aa656[_0xf88b('0x1c')]?_0x9aa656['options']['where']||null:null,'attributes':_0x9aa656['options']?_0x9aa656['options'][_0xf88b('0x1f')]||null:null,'include':_0x9aa656[_0xf88b('0x1c')]?_0x9aa656[_0xf88b('0x1c')][_0xf88b('0x21')]?_['map'](_0x9aa656[_0xf88b('0x1c')]['include'],function(_0x4a1fc3){return{'model':db[_0x4a1fc3[_0xf88b('0x23')]],'as':_0x4a1fc3['as'],'attributes':_0x4a1fc3['attributes'],'include':_0x4a1fc3['include']?_[_0xf88b('0x22')](_0x4a1fc3[_0xf88b('0x21')],function(_0x8158ed){return{'model':db[_0x8158ed[_0xf88b('0x23')]],'as':_0x8158ed['as'],'attributes':_0x8158ed['attributes'],'include':_0x8158ed[_0xf88b('0x21')]?_[_0xf88b('0x22')](_0x8158ed[_0xf88b('0x21')],function(_0x4c134d){return{'model':db[_0x4c134d[_0xf88b('0x23')]],'as':_0x4c134d['as'],'attributes':_0x4c134d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf88b('0x26')](function(_0x42b938){logger[_0xf88b('0x11')](_0xf88b('0x27'),_0x9aa656);logger[_0xf88b('0x12')]('ShowVoiceQueue',_0x9aa656,JSON[_0xf88b('0x13')](_0x42b938));_0x3f4682(_0x42b938);})[_0xf88b('0x24')](function(_0x398fa7){logger[_0xf88b('0x14')]('ShowVoiceQueue',_0x398fa7[_0xf88b('0x15')],_0x9aa656);_0x3910ef(_0x1e7c65[_0xf88b('0x14')](0x1f4,_0x398fa7[_0xf88b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index df88933..e61ac25 100644 --- a/server/api/voiceQueue/voiceQueue.socket.js +++ b/server/api/voiceQueue/voiceQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2922=['remove','emit','removeListener','register','length','./voiceQueue.events','save'];(function(_0x53e659,_0x28da89){var _0x1d5820=function(_0x302f7b){while(--_0x302f7b){_0x53e659['push'](_0x53e659['shift']());}};_0x1d5820(++_0x28da89);}(_0x2922,0xd0));var _0x2292=function(_0x2f6799,_0x4e7f00){_0x2f6799=_0x2f6799-0x0;var _0x3cb26f=_0x2922[_0x2f6799];return _0x3cb26f;};'use strict';var VoiceQueueEvents=require(_0x2292('0x0'));var events=[_0x2292('0x1'),_0x2292('0x2'),'update'];function createListener(_0x329337,_0x23f4c9){return function(_0x3a317d){_0x23f4c9[_0x2292('0x3')](_0x329337,_0x3a317d);};}function removeListener(_0x593eda,_0x2226a6){return function(){VoiceQueueEvents[_0x2292('0x4')](_0x593eda,_0x2226a6);};}exports[_0x2292('0x5')]=function(_0x3f008f){for(var _0x3343fa=0x0,_0x2fccde=events[_0x2292('0x6')];_0x3343fa<_0x2fccde;_0x3343fa++){var _0x2313aa=events[_0x3343fa];var _0x5d3697=createListener('voiceQueue:'+_0x2313aa,_0x3f008f);VoiceQueueEvents['on'](_0x2313aa,_0x5d3697);}}; \ No newline at end of file +var _0x32ab=['register','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x3149b9,_0x4a7937){var _0xc1c89=function(_0x458baa){while(--_0x458baa){_0x3149b9['push'](_0x3149b9['shift']());}};_0xc1c89(++_0x4a7937);}(_0x32ab,0xba));var _0xb32a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x32ab[_0x46698a];return _0x356db0;};'use strict';var VoiceQueueEvents=require(_0xb32a('0x0'));var events=[_0xb32a('0x1'),_0xb32a('0x2'),_0xb32a('0x3')];function createListener(_0x8a2c1,_0x492ff3){return function(_0xfdfa51){_0x492ff3[_0xb32a('0x4')](_0x8a2c1,_0xfdfa51);};}function removeListener(_0x1e58b9,_0xc7c8f7){return function(){VoiceQueueEvents[_0xb32a('0x5')](_0x1e58b9,_0xc7c8f7);};}exports[_0xb32a('0x6')]=function(_0x3e0bee){for(var _0x49099a=0x0,_0x8ef115=events['length'];_0x49099a<_0x8ef115;_0x49099a++){var _0x44194f=events[_0x49099a];var _0x451b62=createListener(_0xb32a('0x7')+_0x44194f,_0x3e0bee);VoiceQueueEvents['on'](_0x44194f,_0x451b62);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 994abb4..8d3d6d0 100644 --- a/server/api/voiceQueueReport/index.js +++ b/server/api/voiceQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94e9=['/index','show','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get'];(function(_0xcc4d5e,_0x5368a4){var _0x533ed9=function(_0x52f4a5){while(--_0x52f4a5){_0xcc4d5e['push'](_0xcc4d5e['shift']());}};_0x533ed9(++_0x5368a4);}(_0x94e9,0xd0));var _0x994e=function(_0x5e9d35,_0x382c91){_0x5e9d35=_0x5e9d35-0x0;var _0x3beb2e=_0x94e9[_0x5e9d35];return _0x3beb2e;};'use strict';var multer=require(_0x994e('0x0'));var util=require(_0x994e('0x1'));var path=require(_0x994e('0x2'));var timeout=require(_0x994e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x994e('0x4'));var auth=require(_0x994e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x994e('0x6'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x994e('0x7')](),controller[_0x994e('0x8')]);router['get'](_0x994e('0x9'),auth[_0x994e('0x7')](),controller[_0x994e('0xa')]);router[_0x994e('0xb')](_0x994e('0xc'),auth[_0x994e('0x7')](),controller['getVoiceQueuesReport']);router[_0x994e('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x994e('0xd')]);router[_0x994e('0xe')]('/',auth[_0x994e('0x7')](),controller[_0x994e('0xf')]);router[_0x994e('0x10')](_0x994e('0x11'),auth['isAuthenticated'](),controller[_0x994e('0x12')]);router[_0x994e('0x13')]('/:id',auth[_0x994e('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x69e6=['delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','isAuthenticated','/index','getVoiceQueuesReport','/:id','update'];(function(_0x474838,_0x303114){var _0x7e2f05=function(_0x27a114){while(--_0x27a114){_0x474838['push'](_0x474838['shift']());}};_0x7e2f05(++_0x303114);}(_0x69e6,0x145));var _0x669e=function(_0x1d33d9,_0x3a1352){_0x1d33d9=_0x1d33d9-0x0;var _0x407663=_0x69e6[_0x1d33d9];return _0x407663;};'use strict';var multer=require(_0x669e('0x0'));var util=require('util');var path=require(_0x669e('0x1'));var timeout=require(_0x669e('0x2'));var express=require('express');var router=express[_0x669e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x669e('0x4'));var interaction=require(_0x669e('0x5'));var config=require(_0x669e('0x6'));var controller=require(_0x669e('0x7'));router[_0x669e('0x8')]('/',auth['isAuthenticated'](),controller[_0x669e('0x9')]);router[_0x669e('0x8')]('/describe',auth[_0x669e('0xa')](),controller['describe']);router['get'](_0x669e('0xb'),auth[_0x669e('0xa')](),controller[_0x669e('0xc')]);router[_0x669e('0x8')](_0x669e('0xd'),auth[_0x669e('0xa')](),controller['show']);router['post']('/',auth[_0x669e('0xa')](),controller['create']);router['put'](_0x669e('0xd'),auth['isAuthenticated'](),controller[_0x669e('0xe')]);router[_0x669e('0xf')](_0x669e('0xd'),auth[_0x669e('0xa')](),controller[_0x669e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index df1acb1..a4a9ad2 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js +++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90b8=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN'];(function(_0x206e60,_0x27aed3){var _0x55ef48=function(_0x563715){while(--_0x563715){_0x206e60['push'](_0x206e60['shift']());}};_0x55ef48(++_0x27aed3);}(_0x90b8,0xc1));var _0x890b=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0x90b8[_0x580b15];return _0x1adb1b;};'use strict';var Sequelize=require(_0x890b('0x0'));var moment=require(_0x890b('0x1'));module[_0x890b('0x2')]={'type':{'type':Sequelize[_0x890b('0x3')]},'uniqueid':{'type':Sequelize[_0x890b('0x3')]},'calleridnum':{'type':Sequelize[_0x890b('0x3')]},'calleridname':{'type':Sequelize[_0x890b('0x3')]},'queue':{'type':Sequelize[_0x890b('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x890b('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x890b('0x4')],'set':function(_0x56b9d3){var _0x2c015b=moment(_0x56b9d3);var _0x1c4535=moment(this[_0x890b('0x5')](_0x890b('0x6')))[_0x890b('0x7')](_0x890b('0x8'));var _0x50dc18=_0x2c015b[_0x890b('0x9')](_0x1c4535,_0x890b('0xa'));this[_0x890b('0xb')]('queuecallerleaveAt',_0x56b9d3);this[_0x890b('0xb')](_0x890b('0xc'),_0x50dc18||null);}},'position':{'type':Sequelize[_0x890b('0xd')]},'count':{'type':Sequelize[_0x890b('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x890b('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x890b('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x890b('0x4')]},'queuecallerexit':{'type':Sequelize[_0x890b('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x890b('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x890b('0xd')]},'channel':{'type':Sequelize[_0x890b('0x3')]},'connectedlinenum':{'type':Sequelize[_0x890b('0x3')]},'connectedlinename':{'type':Sequelize[_0x890b('0x3')]},'accountcode':{'type':Sequelize[_0x890b('0x3')]},'context':{'type':Sequelize[_0x890b('0x3')]},'exten':{'type':Sequelize[_0x890b('0x3')]},'priority':{'type':Sequelize[_0x890b('0x3')]},'holdtime':{'type':Sequelize[_0x890b('0xd')]},'mohtime':{'type':Sequelize[_0x890b('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x890b('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x890b('0x3')]},'transfer':{'type':Sequelize[_0x890b('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x890b('0x3')],'comment':_0x890b('0xf')},'transferexten':{'type':Sequelize[_0x890b('0x3')]},'transferuniqueid':{'type':Sequelize[_0x890b('0x3')]},'disposition':{'type':Sequelize[_0x890b('0x3')]},'secondDisposition':{'type':Sequelize[_0x890b('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x890b('0xd')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xde99=['seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x56a3a7,_0x369bf1){var _0x25021d=function(_0x15e6db){while(--_0x15e6db){_0x56a3a7['push'](_0x56a3a7['shift']());}};_0x25021d(++_0x369bf1);}(_0xde99,0x147));var _0x9de9=function(_0x566dd5,_0x491250){_0x566dd5=_0x566dd5-0x0;var _0x184612=_0xde99[_0x566dd5];return _0x184612;};'use strict';var Sequelize=require(_0x9de9('0x0'));var moment=require(_0x9de9('0x1'));module[_0x9de9('0x2')]={'type':{'type':Sequelize[_0x9de9('0x3')]},'uniqueid':{'type':Sequelize[_0x9de9('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9de9('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x9de9('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x9de9('0x4')],'set':function(_0x724b01){var _0xf4e037=moment(_0x724b01);var _0xdf6564=moment(this['getDataValue'](_0x9de9('0x5')))[_0x9de9('0x6')](_0x9de9('0x7'));var _0xb03a62=_0xf4e037[_0x9de9('0x8')](_0xdf6564,_0x9de9('0x9'));this[_0x9de9('0xa')](_0x9de9('0xb'),_0x724b01);this[_0x9de9('0xa')](_0x9de9('0xc'),_0xb03a62||null);}},'position':{'type':Sequelize[_0x9de9('0xd')]},'count':{'type':Sequelize[_0x9de9('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x9de9('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9de9('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x9de9('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x9de9('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9de9('0x3')]},'accountcode':{'type':Sequelize[_0x9de9('0x3')]},'context':{'type':Sequelize[_0x9de9('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x9de9('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9de9('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9de9('0x3')],'comment':_0x9de9('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9de9('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9de9('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x9de9('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0x9de9('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 641f449..995898d 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.controller.js +++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd257=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','./voiceQueueReport.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','VoiceQueueReport','rawAttributes','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','update','body','describe','getVoiceQueuesReport','keys','filters','order','pick','eml-format','fast-json-patch','moment','util','sox','to-csv','lodash'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xd257,0x175));var _0x7d25=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0xd257[_0x216d45];return _0xbaac0b;};'use strict';var emlformat=require(_0x7d25('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7d25('0x1'));var rp=require('request-promise');var moment=require(_0x7d25('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d25('0x3'));var path=require('path');var sox=require(_0x7d25('0x4'));var csv=require(_0x7d25('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d25('0x6'));var squel=require('squel');var crypto=require(_0x7d25('0x7'));var jsforce=require(_0x7d25('0x8'));var deskjs=require(_0x7d25('0x9'));var toCsv=require(_0x7d25('0x5'));var querystring=require(_0x7d25('0xa'));var Papa=require(_0x7d25('0xb'));var Redis=require(_0x7d25('0xc'));var authService=require(_0x7d25('0xd'));var qs=require(_0x7d25('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d25('0xf'))(_0x7d25('0x10'));var utils=require('../../config/utils');var config=require(_0x7d25('0x11'));var licenseUtil=require(_0x7d25('0x12'));var db=require(_0x7d25('0x13'))['db'];config[_0x7d25('0x14')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d25('0x14')]));require(_0x7d25('0x15'))['register'](socket);function respondWithStatusCode(_0x484392,_0x3c485c){_0x3c485c=_0x3c485c||0xcc;return function(_0x60cade){if(_0x60cade){return _0x484392[_0x7d25('0x16')](_0x3c485c);}return _0x484392[_0x7d25('0x17')](_0x3c485c)['end']();};}function respondWithResult(_0x502077,_0x1f5c92){_0x1f5c92=_0x1f5c92||0xc8;return function(_0x52d663){if(_0x52d663){return _0x502077[_0x7d25('0x17')](_0x1f5c92)[_0x7d25('0x18')](_0x52d663);}};}function respondWithFilteredResult(_0x32a6bd,_0x33e549){return function(_0x3e8a14){if(_0x3e8a14){var _0x5b53a6=typeof _0x33e549[_0x7d25('0x19')]===_0x7d25('0x1a')&&typeof _0x33e549[_0x7d25('0x1b')]==='undefined';var _0x1c1ec7=_0x3e8a14[_0x7d25('0x1c')];var _0x17150c=_0x5b53a6?0x0:_0x33e549['offset'];var _0x4f07db=_0x5b53a6?_0x3e8a14[_0x7d25('0x1c')]:_0x33e549[_0x7d25('0x19')]+_0x33e549[_0x7d25('0x1b')];var _0x4bae8c;if(_0x4f07db>=_0x1c1ec7){_0x4f07db=_0x1c1ec7;_0x4bae8c=0xc8;}else{_0x4bae8c=0xce;}_0x32a6bd['status'](_0x4bae8c);return _0x32a6bd[_0x7d25('0x1d')](_0x7d25('0x1e'),_0x17150c+'-'+_0x4f07db+'/'+_0x1c1ec7)[_0x7d25('0x18')](_0x3e8a14);}return null;};}function patchUpdates(_0x1961b0){return function(_0x536867){try{jsonpatch[_0x7d25('0x1f')](_0x536867,_0x1961b0,!![]);}catch(_0x41f34d){return BPromise[_0x7d25('0x20')](_0x41f34d);}return _0x536867[_0x7d25('0x21')]();};}function saveUpdates(_0x4d8250,_0x46ccc0){return function(_0x20806d){if(_0x20806d){return _0x20806d['update'](_0x4d8250)[_0x7d25('0x22')](function(_0x46bfdd){return _0x46bfdd;});}return null;};}function removeEntity(_0x2b053f,_0x2fe579){return function(_0x190639){if(_0x190639){return _0x190639[_0x7d25('0x23')]()['then'](function(){_0x2b053f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x418483,_0x293c9d){return function(_0x3124e4){if(!_0x3124e4){_0x418483[_0x7d25('0x16')](0x194);}return _0x3124e4;};}function handleError(_0x4cb01b,_0x1e4512){_0x1e4512=_0x1e4512||0x1f4;return function(_0x4889b2){logger[_0x7d25('0x24')](_0x4889b2[_0x7d25('0x25')]);if(_0x4889b2[_0x7d25('0x26')]){delete _0x4889b2[_0x7d25('0x26')];}_0x4cb01b[_0x7d25('0x17')](_0x1e4512)['send'](_0x4889b2);};}exports[_0x7d25('0x27')]=function(_0x137f77,_0x3a2c6a){var _0x3db1ed={},_0x1a5009={},_0x344653={'count':0x0,'rows':[]};var _0x288532=_['map'](db[_0x7d25('0x28')][_0x7d25('0x29')],function(_0x758c09){return{'name':_0x758c09['fieldName'],'type':_0x758c09['type'][_0x7d25('0x2a')]};});_0x1a5009[_0x7d25('0x2b')]=_[_0x7d25('0x2c')](_0x288532,'name');_0x1a5009['query']=_['keys'](_0x137f77[_0x7d25('0x2d')]);_0x1a5009['filters']=_['intersection'](_0x1a5009['model'],_0x1a5009['query']);_0x3db1ed[_0x7d25('0x2e')]=_[_0x7d25('0x2f')](_0x1a5009[_0x7d25('0x2b')],qs[_0x7d25('0x30')](_0x137f77[_0x7d25('0x2d')][_0x7d25('0x30')]));_0x3db1ed[_0x7d25('0x2e')]=_0x3db1ed[_0x7d25('0x2e')][_0x7d25('0x31')]?_0x3db1ed[_0x7d25('0x2e')]:_0x1a5009[_0x7d25('0x2b')];if(!_0x137f77[_0x7d25('0x2d')][_0x7d25('0x32')](_0x7d25('0x33'))){_0x3db1ed[_0x7d25('0x1b')]=qs[_0x7d25('0x1b')](_0x137f77[_0x7d25('0x2d')][_0x7d25('0x1b')]);_0x3db1ed[_0x7d25('0x19')]=qs['offset'](_0x137f77[_0x7d25('0x2d')][_0x7d25('0x19')]);}_0x3db1ed['order']=qs[_0x7d25('0x34')](_0x137f77[_0x7d25('0x2d')][_0x7d25('0x34')]);_0x3db1ed[_0x7d25('0x35')]=qs['filters'](_['pick'](_0x137f77[_0x7d25('0x2d')],_0x1a5009['filters']),_0x288532);if(_0x137f77[_0x7d25('0x2d')]['filter']){_0x3db1ed['where']=_['merge'](_0x3db1ed['where'],{'$or':_['map'](_0x288532,function(_0x5d3327){if(_0x5d3327[_0x7d25('0x36')]!==_0x7d25('0x37')){var _0x3770fa={};_0x3770fa[_0x5d3327['name']]={'$like':'%'+_0x137f77[_0x7d25('0x2d')][_0x7d25('0x38')]+'%'};return _0x3770fa;}})});}_0x3db1ed=_[_0x7d25('0x39')]({},_0x3db1ed,_0x137f77[_0x7d25('0x3a')]);var _0x338f20={'where':_0x3db1ed[_0x7d25('0x35')]};return db[_0x7d25('0x28')][_0x7d25('0x1c')](_0x338f20)[_0x7d25('0x22')](function(_0x5f0ca5){_0x344653[_0x7d25('0x1c')]=_0x5f0ca5;if(_0x137f77[_0x7d25('0x2d')][_0x7d25('0x3b')]){_0x3db1ed['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x7d25('0x3c')](_0x3db1ed);})[_0x7d25('0x22')](function(_0x3136e9){_0x344653[_0x7d25('0x3d')]=_0x3136e9;return _0x344653;})[_0x7d25('0x22')](respondWithFilteredResult(_0x3a2c6a,_0x3db1ed))[_0x7d25('0x3e')](handleError(_0x3a2c6a,null));};exports[_0x7d25('0x3f')]=function(_0x219889,_0x4ff043){var _0x4c3921={'raw':![],'where':{'id':_0x219889[_0x7d25('0x40')]['id']}},_0x21fd75={};_0x21fd75[_0x7d25('0x2b')]=_['keys'](db[_0x7d25('0x28')][_0x7d25('0x29')]);_0x21fd75[_0x7d25('0x2d')]=_['keys'](_0x219889['query']);_0x21fd75['filters']=_[_0x7d25('0x2f')](_0x21fd75[_0x7d25('0x2b')],_0x21fd75[_0x7d25('0x2d')]);_0x4c3921[_0x7d25('0x2e')]=_[_0x7d25('0x2f')](_0x21fd75[_0x7d25('0x2b')],qs[_0x7d25('0x30')](_0x219889[_0x7d25('0x2d')][_0x7d25('0x30')]));_0x4c3921[_0x7d25('0x2e')]=_0x4c3921[_0x7d25('0x2e')]['length']?_0x4c3921['attributes']:_0x21fd75[_0x7d25('0x2b')];if(_0x219889[_0x7d25('0x2d')][_0x7d25('0x3b')]){_0x4c3921[_0x7d25('0x41')]=[{'all':!![]}];}_0x4c3921=_[_0x7d25('0x39')]({},_0x4c3921,_0x219889[_0x7d25('0x3a')]);return db['VoiceQueueReport'][_0x7d25('0x42')](_0x4c3921)[_0x7d25('0x22')](handleEntityNotFound(_0x4ff043,null))[_0x7d25('0x22')](respondWithResult(_0x4ff043,null))[_0x7d25('0x3e')](handleError(_0x4ff043,null));};exports[_0x7d25('0x43')]=function(_0x3b0e3d,_0x346087){return db[_0x7d25('0x28')][_0x7d25('0x43')](_0x3b0e3d['body'],{})[_0x7d25('0x22')](respondWithResult(_0x346087,0xc9))[_0x7d25('0x3e')](handleError(_0x346087,null));};exports[_0x7d25('0x44')]=function(_0x5369d4,_0x20e8f7){if(_0x5369d4[_0x7d25('0x45')]['id']){delete _0x5369d4[_0x7d25('0x45')]['id'];}return db[_0x7d25('0x28')][_0x7d25('0x42')]({'where':{'id':_0x5369d4[_0x7d25('0x40')]['id']}})[_0x7d25('0x22')](handleEntityNotFound(_0x20e8f7,null))[_0x7d25('0x22')](saveUpdates(_0x5369d4[_0x7d25('0x45')],null))[_0x7d25('0x22')](respondWithResult(_0x20e8f7,null))[_0x7d25('0x3e')](handleError(_0x20e8f7,null));};exports[_0x7d25('0x23')]=function(_0x1db6e5,_0x4f0329){return db[_0x7d25('0x28')]['find']({'where':{'id':_0x1db6e5[_0x7d25('0x40')]['id']}})[_0x7d25('0x22')](handleEntityNotFound(_0x4f0329,null))[_0x7d25('0x22')](removeEntity(_0x4f0329,null))[_0x7d25('0x3e')](handleError(_0x4f0329,null));};exports[_0x7d25('0x46')]=function(_0xb80e87,_0x582ced){return db[_0x7d25('0x28')][_0x7d25('0x46')]()[_0x7d25('0x22')](respondWithResult(_0x582ced,null))[_0x7d25('0x3e')](handleError(_0x582ced,null));};exports[_0x7d25('0x47')]=function(_0x4cd975,_0x34a826){var _0x29f454={},_0x2e12a0={},_0xbda264={'count':0x0,'rows':[]};_0x2e12a0[_0x7d25('0x2b')]=_[_0x7d25('0x48')](db[_0x7d25('0x28')][_0x7d25('0x29')]);_0x2e12a0[_0x7d25('0x2d')]=_[_0x7d25('0x48')](_0x4cd975[_0x7d25('0x2d')]);_0x2e12a0[_0x7d25('0x49')]=_['intersection'](_0x2e12a0['model'],_0x2e12a0[_0x7d25('0x2d')]);_0x29f454[_0x7d25('0x2e')]=_['intersection'](_0x2e12a0[_0x7d25('0x2b')],qs['fields'](_0x4cd975['query']['fields']));_0x29f454['attributes']=_0x29f454['attributes']['length']?_0x29f454[_0x7d25('0x2e')]:_0x2e12a0['model'];if(!_0x4cd975[_0x7d25('0x2d')][_0x7d25('0x32')](_0x7d25('0x33'))){_0x29f454[_0x7d25('0x1b')]=qs[_0x7d25('0x1b')](_0x4cd975[_0x7d25('0x2d')]['limit']);_0x29f454[_0x7d25('0x19')]=qs[_0x7d25('0x19')](_0x4cd975[_0x7d25('0x2d')][_0x7d25('0x19')]);}_0x29f454[_0x7d25('0x4a')]=qs[_0x7d25('0x34')](_0x4cd975['query']['sort']);_0x29f454[_0x7d25('0x35')]=qs[_0x7d25('0x49')](_[_0x7d25('0x4b')](_0x4cd975['query'],_0x2e12a0[_0x7d25('0x49')]));if(_0x4cd975['query'][_0x7d25('0x38')]){_0x29f454[_0x7d25('0x35')]=_[_0x7d25('0x39')](_0x29f454[_0x7d25('0x35')],{'$or':_[_0x7d25('0x2c')](_0x29f454['attributes'],function(_0x36d641){var _0x25d52b={};_0x25d52b[_0x36d641]={'$like':'%'+_0x4cd975['query']['filter']+'%'};return _0x25d52b;})});}_0x29f454=_[_0x7d25('0x39')]({},_0x29f454,_0x4cd975[_0x7d25('0x3a')]);var _0x4ddc20={'where':_0x29f454['where']};return db[_0x7d25('0x28')][_0x7d25('0x1c')](_0x4ddc20)[_0x7d25('0x22')](function(_0x218763){_0xbda264[_0x7d25('0x1c')]=_0x218763;if(_0x4cd975[_0x7d25('0x2d')][_0x7d25('0x3b')]){_0x29f454[_0x7d25('0x41')]=[{'all':!![]}];}return db[_0x7d25('0x28')][_0x7d25('0x3c')](_0x29f454);})[_0x7d25('0x22')](function(_0x487e6e){_0xbda264[_0x7d25('0x3d')]=_0x487e6e;return _0xbda264;})['then'](respondWithFilteredResult(_0x34a826,_0x29f454,_0x7d25('0x47')))[_0x7d25('0x3e')](handleError(_0x34a826,null,_0x7d25('0x47')));}; \ No newline at end of file +var _0x0fe5=['destroy','end','error','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','find','create','update','body','params','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0fe5,0x16c));var _0x50fe=function(_0x312bb4,_0x221c0f){_0x312bb4=_0x312bb4-0x0;var _0x158b85=_0x0fe5[_0x312bb4];return _0x158b85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50fe('0x0'));var zipdir=require(_0x50fe('0x1'));var jsonpatch=require(_0x50fe('0x2'));var rp=require(_0x50fe('0x3'));var moment=require(_0x50fe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x50fe('0x5'));var util=require(_0x50fe('0x6'));var path=require(_0x50fe('0x7'));var sox=require(_0x50fe('0x8'));var csv=require(_0x50fe('0x9'));var ejs=require(_0x50fe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50fe('0xb'));var squel=require(_0x50fe('0xc'));var crypto=require('crypto');var jsforce=require(_0x50fe('0xd'));var deskjs=require(_0x50fe('0xe'));var toCsv=require('to-csv');var querystring=require(_0x50fe('0xf'));var Papa=require(_0x50fe('0x10'));var Redis=require(_0x50fe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x50fe('0x12'));var as=require(_0x50fe('0x13'));var hardwareService=require(_0x50fe('0x14'));var logger=require(_0x50fe('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50fe('0x16'))['db'];config[_0x50fe('0x17')]=_[_0x50fe('0x18')](config[_0x50fe('0x17')],{'host':_0x50fe('0x19'),'port':0x18eb});var socket=require(_0x50fe('0x1a'))(new Redis(config['redis']));require(_0x50fe('0x1b'))[_0x50fe('0x1c')](socket);function respondWithStatusCode(_0x491f67,_0x2520bf){_0x2520bf=_0x2520bf||0xcc;return function(_0x455137){if(_0x455137){return _0x491f67[_0x50fe('0x1d')](_0x2520bf);}return _0x491f67[_0x50fe('0x1e')](_0x2520bf)['end']();};}function respondWithResult(_0x2d4d42,_0x2570d7){_0x2570d7=_0x2570d7||0xc8;return function(_0x564230){if(_0x564230){return _0x2d4d42[_0x50fe('0x1e')](_0x2570d7)[_0x50fe('0x1f')](_0x564230);}};}function respondWithFilteredResult(_0x343b74,_0x5718d7){return function(_0x5f4d87){if(_0x5f4d87){var _0x51dcd0=typeof _0x5718d7[_0x50fe('0x20')]===_0x50fe('0x21')&&typeof _0x5718d7[_0x50fe('0x22')]==='undefined';var _0x726fd0=_0x5f4d87[_0x50fe('0x23')];var _0xe27997=_0x51dcd0?0x0:_0x5718d7['offset'];var _0x217045=_0x51dcd0?_0x5f4d87['count']:_0x5718d7['offset']+_0x5718d7[_0x50fe('0x22')];var _0x1e8605;if(_0x217045>=_0x726fd0){_0x217045=_0x726fd0;_0x1e8605=0xc8;}else{_0x1e8605=0xce;}_0x343b74[_0x50fe('0x1e')](_0x1e8605);return _0x343b74[_0x50fe('0x24')](_0x50fe('0x25'),_0xe27997+'-'+_0x217045+'/'+_0x726fd0)[_0x50fe('0x1f')](_0x5f4d87);}return null;};}function patchUpdates(_0x2b4933){return function(_0x403f01){try{jsonpatch[_0x50fe('0x26')](_0x403f01,_0x2b4933,!![]);}catch(_0x555e33){return BPromise['reject'](_0x555e33);}return _0x403f01[_0x50fe('0x27')]();};}function saveUpdates(_0x6d5824,_0x33ace4){return function(_0x2c21a1){if(_0x2c21a1){return _0x2c21a1['update'](_0x6d5824)[_0x50fe('0x28')](function(_0x4a1752){return _0x4a1752;});}return null;};}function removeEntity(_0x5bc249,_0x5ebc87){return function(_0x32e50c){if(_0x32e50c){return _0x32e50c[_0x50fe('0x29')]()[_0x50fe('0x28')](function(){_0x5bc249[_0x50fe('0x1e')](0xcc)[_0x50fe('0x2a')]();});}};}function handleEntityNotFound(_0x1a30e8,_0x38e935){return function(_0x2c8add){if(!_0x2c8add){_0x1a30e8[_0x50fe('0x1d')](0x194);}return _0x2c8add;};}function handleError(_0x27f4cb,_0x49f709){_0x49f709=_0x49f709||0x1f4;return function(_0x11bff5){logger[_0x50fe('0x2b')](_0x11bff5['stack']);if(_0x11bff5[_0x50fe('0x2c')]){delete _0x11bff5[_0x50fe('0x2c')];}_0x27f4cb['status'](_0x49f709)[_0x50fe('0x2d')](_0x11bff5);};}exports[_0x50fe('0x2e')]=function(_0x2e350c,_0x22cd6e){var _0x2b42f8={},_0x3e0534={},_0x23f858={'count':0x0,'rows':[]};var _0x14d9d4=_[_0x50fe('0x2f')](db[_0x50fe('0x30')][_0x50fe('0x31')],function(_0x5d3aca){return{'name':_0x5d3aca['fieldName'],'type':_0x5d3aca[_0x50fe('0x32')][_0x50fe('0x33')]};});_0x3e0534[_0x50fe('0x34')]=_['map'](_0x14d9d4,_0x50fe('0x2c'));_0x3e0534['query']=_[_0x50fe('0x35')](_0x2e350c['query']);_0x3e0534[_0x50fe('0x36')]=_['intersection'](_0x3e0534['model'],_0x3e0534[_0x50fe('0x37')]);_0x2b42f8[_0x50fe('0x38')]=_[_0x50fe('0x39')](_0x3e0534[_0x50fe('0x34')],qs[_0x50fe('0x3a')](_0x2e350c[_0x50fe('0x37')]['fields']));_0x2b42f8[_0x50fe('0x38')]=_0x2b42f8[_0x50fe('0x38')][_0x50fe('0x3b')]?_0x2b42f8[_0x50fe('0x38')]:_0x3e0534[_0x50fe('0x34')];if(!_0x2e350c['query'][_0x50fe('0x3c')]('nolimit')){_0x2b42f8[_0x50fe('0x22')]=qs[_0x50fe('0x22')](_0x2e350c['query'][_0x50fe('0x22')]);_0x2b42f8[_0x50fe('0x20')]=qs[_0x50fe('0x20')](_0x2e350c[_0x50fe('0x37')][_0x50fe('0x20')]);}_0x2b42f8[_0x50fe('0x3d')]=qs[_0x50fe('0x3e')](_0x2e350c[_0x50fe('0x37')][_0x50fe('0x3e')]);_0x2b42f8[_0x50fe('0x3f')]=qs[_0x50fe('0x36')](_[_0x50fe('0x40')](_0x2e350c[_0x50fe('0x37')],_0x3e0534[_0x50fe('0x36')]),_0x14d9d4);if(_0x2e350c[_0x50fe('0x37')][_0x50fe('0x41')]){_0x2b42f8[_0x50fe('0x3f')]=_['merge'](_0x2b42f8[_0x50fe('0x3f')],{'$or':_['map'](_0x14d9d4,function(_0x5cd6c5){if(_0x5cd6c5['type']!==_0x50fe('0x42')){var _0x3aa6d8={};_0x3aa6d8[_0x5cd6c5[_0x50fe('0x2c')]]={'$like':'%'+_0x2e350c[_0x50fe('0x37')][_0x50fe('0x41')]+'%'};return _0x3aa6d8;}})});}_0x2b42f8=_[_0x50fe('0x43')]({},_0x2b42f8,_0x2e350c['options']);var _0x53c102={'where':_0x2b42f8[_0x50fe('0x3f')]};return db['VoiceQueueReport'][_0x50fe('0x23')](_0x53c102)[_0x50fe('0x28')](function(_0x7c9e72){_0x23f858[_0x50fe('0x23')]=_0x7c9e72;if(_0x2e350c[_0x50fe('0x37')][_0x50fe('0x44')]){_0x2b42f8[_0x50fe('0x45')]=[{'all':!![]}];}return db[_0x50fe('0x30')][_0x50fe('0x46')](_0x2b42f8);})[_0x50fe('0x28')](function(_0xc0a7c0){_0x23f858[_0x50fe('0x47')]=_0xc0a7c0;return _0x23f858;})['then'](respondWithFilteredResult(_0x22cd6e,_0x2b42f8))[_0x50fe('0x48')](handleError(_0x22cd6e,null));};exports[_0x50fe('0x49')]=function(_0x131d7f,_0x553a75){var _0x1424cf={'raw':![],'where':{'id':_0x131d7f['params']['id']}},_0x227571={};_0x227571[_0x50fe('0x34')]=_[_0x50fe('0x35')](db['VoiceQueueReport'][_0x50fe('0x31')]);_0x227571[_0x50fe('0x37')]=_[_0x50fe('0x35')](_0x131d7f[_0x50fe('0x37')]);_0x227571['filters']=_[_0x50fe('0x39')](_0x227571['model'],_0x227571[_0x50fe('0x37')]);_0x1424cf[_0x50fe('0x38')]=_[_0x50fe('0x39')](_0x227571['model'],qs['fields'](_0x131d7f[_0x50fe('0x37')][_0x50fe('0x3a')]));_0x1424cf[_0x50fe('0x38')]=_0x1424cf[_0x50fe('0x38')][_0x50fe('0x3b')]?_0x1424cf['attributes']:_0x227571[_0x50fe('0x34')];if(_0x131d7f['query']['includeAll']){_0x1424cf[_0x50fe('0x45')]=[{'all':!![]}];}_0x1424cf=_['merge']({},_0x1424cf,_0x131d7f['options']);return db[_0x50fe('0x30')][_0x50fe('0x4a')](_0x1424cf)[_0x50fe('0x28')](handleEntityNotFound(_0x553a75,null))[_0x50fe('0x28')](respondWithResult(_0x553a75,null))[_0x50fe('0x48')](handleError(_0x553a75,null));};exports[_0x50fe('0x4b')]=function(_0x33fefc,_0x4021ac){return db[_0x50fe('0x30')][_0x50fe('0x4b')](_0x33fefc['body'],{})['then'](respondWithResult(_0x4021ac,0xc9))[_0x50fe('0x48')](handleError(_0x4021ac,null));};exports[_0x50fe('0x4c')]=function(_0x41aba6,_0x2cbaa8){if(_0x41aba6[_0x50fe('0x4d')]['id']){delete _0x41aba6[_0x50fe('0x4d')]['id'];}return db[_0x50fe('0x30')]['find']({'where':{'id':_0x41aba6[_0x50fe('0x4e')]['id']}})[_0x50fe('0x28')](handleEntityNotFound(_0x2cbaa8,null))[_0x50fe('0x28')](saveUpdates(_0x41aba6['body'],null))['then'](respondWithResult(_0x2cbaa8,null))[_0x50fe('0x48')](handleError(_0x2cbaa8,null));};exports[_0x50fe('0x29')]=function(_0x58727d,_0x28a230){return db['VoiceQueueReport']['find']({'where':{'id':_0x58727d[_0x50fe('0x4e')]['id']}})['then'](handleEntityNotFound(_0x28a230,null))[_0x50fe('0x28')](removeEntity(_0x28a230,null))[_0x50fe('0x48')](handleError(_0x28a230,null));};exports[_0x50fe('0x4f')]=function(_0x37427d,_0x405e60){return db[_0x50fe('0x30')]['describe']()[_0x50fe('0x28')](respondWithResult(_0x405e60,null))[_0x50fe('0x48')](handleError(_0x405e60,null));};exports[_0x50fe('0x50')]=function(_0x4d3b0b,_0x5bf7ac){var _0x426835={},_0x1a18bd={},_0x2f5abe={'count':0x0,'rows':[]};_0x1a18bd[_0x50fe('0x34')]=_[_0x50fe('0x35')](db[_0x50fe('0x30')][_0x50fe('0x31')]);_0x1a18bd[_0x50fe('0x37')]=_[_0x50fe('0x35')](_0x4d3b0b['query']);_0x1a18bd[_0x50fe('0x36')]=_[_0x50fe('0x39')](_0x1a18bd[_0x50fe('0x34')],_0x1a18bd['query']);_0x426835[_0x50fe('0x38')]=_['intersection'](_0x1a18bd[_0x50fe('0x34')],qs[_0x50fe('0x3a')](_0x4d3b0b['query'][_0x50fe('0x3a')]));_0x426835['attributes']=_0x426835[_0x50fe('0x38')]['length']?_0x426835[_0x50fe('0x38')]:_0x1a18bd[_0x50fe('0x34')];if(!_0x4d3b0b['query'][_0x50fe('0x3c')]('nolimit')){_0x426835[_0x50fe('0x22')]=qs[_0x50fe('0x22')](_0x4d3b0b[_0x50fe('0x37')][_0x50fe('0x22')]);_0x426835[_0x50fe('0x20')]=qs[_0x50fe('0x20')](_0x4d3b0b[_0x50fe('0x37')]['offset']);}_0x426835[_0x50fe('0x3d')]=qs['sort'](_0x4d3b0b[_0x50fe('0x37')]['sort']);_0x426835[_0x50fe('0x3f')]=qs[_0x50fe('0x36')](_[_0x50fe('0x40')](_0x4d3b0b['query'],_0x1a18bd['filters']));if(_0x4d3b0b['query'][_0x50fe('0x41')]){_0x426835[_0x50fe('0x3f')]=_['merge'](_0x426835[_0x50fe('0x3f')],{'$or':_[_0x50fe('0x2f')](_0x426835[_0x50fe('0x38')],function(_0x48e5ee){var _0x34c7e2={};_0x34c7e2[_0x48e5ee]={'$like':'%'+_0x4d3b0b[_0x50fe('0x37')][_0x50fe('0x41')]+'%'};return _0x34c7e2;})});}_0x426835=_['merge']({},_0x426835,_0x4d3b0b['options']);var _0x332762={'where':_0x426835['where']};return db['VoiceQueueReport'][_0x50fe('0x23')](_0x332762)[_0x50fe('0x28')](function(_0x267252){_0x2f5abe[_0x50fe('0x23')]=_0x267252;if(_0x4d3b0b[_0x50fe('0x37')]['includeAll']){_0x426835[_0x50fe('0x45')]=[{'all':!![]}];}return db[_0x50fe('0x30')][_0x50fe('0x46')](_0x426835);})[_0x50fe('0x28')](function(_0x59ebf9){_0x2f5abe[_0x50fe('0x47')]=_0x59ebf9;return _0x2f5abe;})[_0x50fe('0x28')](respondWithFilteredResult(_0x5bf7ac,_0x426835,_0x50fe('0x50')))['catch'](handleError(_0x5bf7ac,null,_0x50fe('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 0498fcb..6c0b7c4 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.events.js +++ b/server/api/voiceQueueReport/voiceQueueReport.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceQueueReport','setMaxListeners','update'];(function(_0x391702,_0x25a95a){var _0x52cf07=function(_0x379a58){while(--_0x379a58){_0x391702['push'](_0x391702['shift']());}};_0x52cf07(++_0x25a95a);}(_0xda3f,0x1a4));var _0xfda3=function(_0xe7f97,_0x2971ac){_0xe7f97=_0xe7f97-0x0;var _0x10c8bb=_0xda3f[_0xe7f97];return _0x10c8bb;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xfda3('0x0'))['db'][_0xfda3('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xfda3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfda3('0x3'),'afterDestroy':_0xfda3('0x4')};function emitEvent(_0x53af00){return function(_0x21f9e,_0x2a4747,_0x3c1a7c){VoiceQueueReportEvents[_0xfda3('0x5')](_0x53af00+':'+_0x21f9e['id'],_0x21f9e);VoiceQueueReportEvents[_0xfda3('0x5')](_0x53af00,_0x21f9e);_0x3c1a7c(null);};}for(var e in events){if(events[_0xfda3('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xfda3('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xd7a3=['save','update','remove','emit','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd7a3,0x1b4));var _0x3d7a=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xd7a3[_0x543084];return _0x306a57;};'use strict';var EventEmitter=require(_0x3d7a('0x0'));var VoiceQueueReport=require(_0x3d7a('0x1'))['db'][_0x3d7a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3d7a('0x3')](0x0);var events={'afterCreate':_0x3d7a('0x4'),'afterUpdate':_0x3d7a('0x5'),'afterDestroy':_0x3d7a('0x6')};function emitEvent(_0x2b61a0){return function(_0xe147ae,_0x5d3826,_0x5b214a){VoiceQueueReportEvents[_0x3d7a('0x7')](_0x2b61a0+':'+_0xe147ae['id'],_0xe147ae);VoiceQueueReportEvents[_0x3d7a('0x7')](_0x2b61a0,_0xe147ae);_0x5b214a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x3d7a('0x8')](e,emitEvent(event));}}module[_0x3d7a('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index e4afbd5..1b0b24b 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.model.js +++ b/server/api/voiceQueueReport/voiceQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c7d=['rimraf','exports','calleridnum','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xf0091f,_0x382a66){var _0x59ee21=function(_0x4cd74d){while(--_0x4cd74d){_0xf0091f['push'](_0xf0091f['shift']());}};_0x59ee21(++_0x382a66);}(_0x4c7d,0xdf));var _0xd4c7=function(_0x57a6d8,_0x1adf17){_0x57a6d8=_0x57a6d8-0x0;var _0x177e0f=_0x4c7d[_0x57a6d8];return _0x177e0f;};'use strict';var _=require(_0xd4c7('0x0'));var util=require(_0xd4c7('0x1'));var logger=require(_0xd4c7('0x2'))('api');var moment=require(_0xd4c7('0x3'));var BPromise=require(_0xd4c7('0x4'));var rp=require(_0xd4c7('0x5'));var fs=require('fs');var path=require(_0xd4c7('0x6'));var rimraf=require(_0xd4c7('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0xd4c7('0x8')]=function(_0xb98af1,_0x1f8649){return _0xb98af1['define']('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xd4c7('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc4e=['path','../../config/environment','exports','define','VoiceQueueReport','report_queue','lodash','util','api','moment','request-promise'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xcc4e,0x19d));var _0xecc4=function(_0x507d23,_0x558746){_0x507d23=_0x507d23-0x0;var _0x378187=_0xcc4e[_0x507d23];return _0x378187;};'use strict';var _=require(_0xecc4('0x0'));var util=require(_0xecc4('0x1'));var logger=require('../../config/logger')(_0xecc4('0x2'));var moment=require(_0xecc4('0x3'));var BPromise=require('bluebird');var rp=require(_0xecc4('0x4'));var fs=require('fs');var path=require(_0xecc4('0x5'));var rimraf=require('rimraf');var config=require(_0xecc4('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0xecc4('0x7')]=function(_0x34e82c,_0x4a28b7){return _0x34e82c[_0xecc4('0x8')](_0xecc4('0x9'),attributes,{'tableName':_0xecc4('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 947efa5..737dfea 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js +++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b47=['update','where','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','model','map','stringify','create','body','CreateVoiceQueueReport'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0x0b47,0xd0));var _0x70b4=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0x0b47[_0x542da8];return _0x533d7e;};'use strict';var _=require(_0x70b4('0x0'));var util=require(_0x70b4('0x1'));var moment=require(_0x70b4('0x2'));var BPromise=require(_0x70b4('0x3'));var rs=require(_0x70b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x70b4('0x5'));var logger=require(_0x70b4('0x6'))(_0x70b4('0x7'));var config=require(_0x70b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x70b4('0x9')]['http']({'port':0x232a});config[_0x70b4('0xa')]=_[_0x70b4('0xb')](config[_0x70b4('0xa')],{'host':_0x70b4('0xc'),'port':0x18eb});var socket=require(_0x70b4('0xd'))(new Redis(config[_0x70b4('0xa')]));require(_0x70b4('0xe'))['register'](socket);function respondWithRpcPromise(_0x4397d7,_0x17d600,_0x53fcf9){return new BPromise(function(_0x9c1ed5,_0x27164a){return client['request'](_0x4397d7,_0x53fcf9)[_0x70b4('0xf')](function(_0x4a212b){logger['info'](_0x70b4('0x10'),_0x17d600,_0x70b4('0x11'));logger[_0x70b4('0x12')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x17d600,_0x70b4('0x11'),JSON['stringify'](_0x4a212b));if(_0x4a212b[_0x70b4('0x13')]){if(_0x4a212b[_0x70b4('0x13')][_0x70b4('0x14')]===0x1f4){logger[_0x70b4('0x13')](_0x70b4('0x10'),_0x17d600,_0x4a212b['error']['message']);return _0x27164a(_0x4a212b[_0x70b4('0x13')][_0x70b4('0x15')]);}logger[_0x70b4('0x13')](_0x70b4('0x10'),_0x17d600,_0x4a212b[_0x70b4('0x13')][_0x70b4('0x15')]);return _0x9c1ed5(_0x4a212b[_0x70b4('0x13')]['message']);}else{logger[_0x70b4('0x16')](_0x70b4('0x10'),_0x17d600,_0x70b4('0x11'));_0x9c1ed5(_0x4a212b['result'][_0x70b4('0x15')]);}})[_0x70b4('0x17')](function(_0x343a70){logger['error'](_0x70b4('0x10'),_0x17d600,_0x343a70);_0x27164a(_0x343a70);});});}exports[_0x70b4('0x18')]=function(_0x2fda90){var _0x275764=this;return new Promise(function(_0x3472ff,_0x1d7317){return db[_0x70b4('0x19')][_0x70b4('0x1a')]({'raw':_0x2fda90[_0x70b4('0x1b')]?_0x2fda90['options'][_0x70b4('0x1c')]===undefined?!![]:![]:!![],'where':_0x2fda90[_0x70b4('0x1b')]?_0x2fda90['options']['where']||null:null,'attributes':_0x2fda90[_0x70b4('0x1b')]?_0x2fda90[_0x70b4('0x1b')][_0x70b4('0x1d')]||null:null,'limit':_0x2fda90[_0x70b4('0x1b')]?_0x2fda90['options'][_0x70b4('0x1e')]||null:null,'include':_0x2fda90[_0x70b4('0x1b')]?_0x2fda90[_0x70b4('0x1b')][_0x70b4('0x1f')]?_['map'](_0x2fda90[_0x70b4('0x1b')]['include'],function(_0x32d272){return{'model':db[_0x32d272[_0x70b4('0x20')]],'as':_0x32d272['as'],'attributes':_0x32d272[_0x70b4('0x1d')],'include':_0x32d272[_0x70b4('0x1f')]?_[_0x70b4('0x21')](_0x32d272[_0x70b4('0x1f')],function(_0x3fd8dc){return{'model':db[_0x3fd8dc[_0x70b4('0x20')]],'as':_0x3fd8dc['as'],'attributes':_0x3fd8dc[_0x70b4('0x1d')],'include':_0x3fd8dc[_0x70b4('0x1f')]?_[_0x70b4('0x21')](_0x3fd8dc[_0x70b4('0x1f')],function(_0xb54891){return{'model':db[_0xb54891[_0x70b4('0x20')]],'as':_0xb54891['as'],'attributes':_0xb54891['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5edb33){logger[_0x70b4('0x16')]('GetVoiceQueueReport',_0x2fda90);logger['debug'](_0x70b4('0x18'),_0x2fda90,JSON[_0x70b4('0x22')](_0x5edb33));_0x3472ff(_0x5edb33);})[_0x70b4('0x17')](function(_0x14a8ab){logger['error'](_0x70b4('0x18'),_0x14a8ab['message'],_0x2fda90);_0x1d7317(_0x275764[_0x70b4('0x13')](0x1f4,_0x14a8ab[_0x70b4('0x15')]));});});};exports['CreateVoiceQueueReport']=function(_0x22c87e){var _0x3d16c5=this;return new Promise(function(_0x2c8087,_0x19bf42){return db[_0x70b4('0x19')][_0x70b4('0x23')](_0x22c87e[_0x70b4('0x24')],{'raw':_0x22c87e[_0x70b4('0x1b')]?_0x22c87e[_0x70b4('0x1b')][_0x70b4('0x1c')]===undefined?!![]:![]:!![]})[_0x70b4('0xf')](function(_0x3d9376){logger[_0x70b4('0x16')](_0x70b4('0x25'),_0x22c87e);logger[_0x70b4('0x12')]('CreateVoiceQueueReport',_0x22c87e,JSON[_0x70b4('0x22')](_0x3d9376));_0x2c8087(_0x3d9376);})['catch'](function(_0xae332b){logger['error'](_0x70b4('0x25'),_0xae332b[_0x70b4('0x15')],_0x22c87e);_0x19bf42(_0x3d16c5[_0x70b4('0x13')](0x1f4,_0xae332b[_0x70b4('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x144b6d){var _0x26d503=this;return new Promise(function(_0x3a024e,_0x3b39d9){return db[_0x70b4('0x19')][_0x70b4('0x26')](_0x144b6d[_0x70b4('0x24')],{'raw':_0x144b6d[_0x70b4('0x1b')]?_0x144b6d[_0x70b4('0x1b')][_0x70b4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x144b6d[_0x70b4('0x1b')]?_0x144b6d[_0x70b4('0x1b')][_0x70b4('0x27')]||null:null,'attributes':_0x144b6d[_0x70b4('0x1b')]?_0x144b6d[_0x70b4('0x1b')][_0x70b4('0x1d')]||null:null,'limit':_0x144b6d['options']?_0x144b6d[_0x70b4('0x1b')]['limit']||null:null})[_0x70b4('0xf')](function(_0x7ce0){logger[_0x70b4('0x16')](_0x70b4('0x28'),_0x144b6d);logger[_0x70b4('0x12')](_0x70b4('0x28'),_0x144b6d,JSON['stringify'](_0x7ce0));_0x3a024e(_0x7ce0);})[_0x70b4('0x17')](function(_0x3f5d36){logger[_0x70b4('0x13')](_0x70b4('0x28'),_0x3f5d36[_0x70b4('0x15')],_0x144b6d);_0x3b39d9(_0x26d503[_0x70b4('0x13')](0x1f4,_0x3f5d36[_0x70b4('0x15')]));});});}; \ No newline at end of file +var _0x98dd=['body','update','limit','UpdateVoiceQueueReport','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','include','map','model','attributes','info','CreateVoiceQueueReport'];(function(_0x105a4b,_0x293d3e){var _0x2c8659=function(_0x3c8f17){while(--_0x3c8f17){_0x105a4b['push'](_0x105a4b['shift']());}};_0x2c8659(++_0x293d3e);}(_0x98dd,0x11c));var _0xd98d=function(_0x52d17b,_0x56218d){_0x52d17b=_0x52d17b-0x0;var _0x3d0ddd=_0x98dd[_0x52d17b];return _0x3d0ddd;};'use strict';var _=require(_0xd98d('0x0'));var util=require(_0xd98d('0x1'));var moment=require(_0xd98d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd98d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd98d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd98d('0x5'));var jayson=require(_0xd98d('0x6'));var client=jayson[_0xd98d('0x7')][_0xd98d('0x8')]({'port':0x232a});config['redis']=_[_0xd98d('0x9')](config[_0xd98d('0xa')],{'host':_0xd98d('0xb'),'port':0x18eb});var socket=require(_0xd98d('0xc'))(new Redis(config[_0xd98d('0xa')]));require(_0xd98d('0xd'))[_0xd98d('0xe')](socket);function respondWithRpcPromise(_0x10f026,_0x25c1ce,_0x4b5414){return new BPromise(function(_0x4e7374,_0x215131){return client[_0xd98d('0xf')](_0x10f026,_0x4b5414)[_0xd98d('0x10')](function(_0x1ad662){logger['info'](_0xd98d('0x11'),_0x25c1ce,_0xd98d('0x12'));logger[_0xd98d('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x25c1ce,_0xd98d('0x12'),JSON[_0xd98d('0x14')](_0x1ad662));if(_0x1ad662[_0xd98d('0x15')]){if(_0x1ad662['error'][_0xd98d('0x16')]===0x1f4){logger[_0xd98d('0x15')](_0xd98d('0x11'),_0x25c1ce,_0x1ad662[_0xd98d('0x15')][_0xd98d('0x17')]);return _0x215131(_0x1ad662[_0xd98d('0x15')][_0xd98d('0x17')]);}logger[_0xd98d('0x15')](_0xd98d('0x11'),_0x25c1ce,_0x1ad662[_0xd98d('0x15')][_0xd98d('0x17')]);return _0x4e7374(_0x1ad662[_0xd98d('0x15')][_0xd98d('0x17')]);}else{logger['info'](_0xd98d('0x11'),_0x25c1ce,_0xd98d('0x12'));_0x4e7374(_0x1ad662[_0xd98d('0x18')][_0xd98d('0x17')]);}})['catch'](function(_0xf6fedd){logger[_0xd98d('0x15')](_0xd98d('0x11'),_0x25c1ce,_0xf6fedd);_0x215131(_0xf6fedd);});});}exports[_0xd98d('0x19')]=function(_0x1dee1c){var _0x15e515=this;return new Promise(function(_0x528e26,_0x10ac83){return db[_0xd98d('0x1a')]['findAll']({'raw':_0x1dee1c[_0xd98d('0x1b')]?_0x1dee1c[_0xd98d('0x1b')][_0xd98d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1dee1c[_0xd98d('0x1b')]?_0x1dee1c['options'][_0xd98d('0x1d')]||null:null,'attributes':_0x1dee1c[_0xd98d('0x1b')]?_0x1dee1c[_0xd98d('0x1b')]['attributes']||null:null,'limit':_0x1dee1c[_0xd98d('0x1b')]?_0x1dee1c[_0xd98d('0x1b')]['limit']||null:null,'include':_0x1dee1c['options']?_0x1dee1c[_0xd98d('0x1b')][_0xd98d('0x1e')]?_[_0xd98d('0x1f')](_0x1dee1c['options'][_0xd98d('0x1e')],function(_0x491821){return{'model':db[_0x491821[_0xd98d('0x20')]],'as':_0x491821['as'],'attributes':_0x491821[_0xd98d('0x21')],'include':_0x491821[_0xd98d('0x1e')]?_[_0xd98d('0x1f')](_0x491821['include'],function(_0x3f4ff6){return{'model':db[_0x3f4ff6['model']],'as':_0x3f4ff6['as'],'attributes':_0x3f4ff6[_0xd98d('0x21')],'include':_0x3f4ff6[_0xd98d('0x1e')]?_[_0xd98d('0x1f')](_0x3f4ff6[_0xd98d('0x1e')],function(_0x392d87){return{'model':db[_0x392d87[_0xd98d('0x20')]],'as':_0x392d87['as'],'attributes':_0x392d87[_0xd98d('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd98d('0x10')](function(_0x45110c){logger[_0xd98d('0x22')](_0xd98d('0x19'),_0x1dee1c);logger[_0xd98d('0x13')](_0xd98d('0x19'),_0x1dee1c,JSON[_0xd98d('0x14')](_0x45110c));_0x528e26(_0x45110c);})['catch'](function(_0x7cbead){logger[_0xd98d('0x15')](_0xd98d('0x19'),_0x7cbead[_0xd98d('0x17')],_0x1dee1c);_0x10ac83(_0x15e515['error'](0x1f4,_0x7cbead[_0xd98d('0x17')]));});});};exports[_0xd98d('0x23')]=function(_0x44da2d){var _0x1f8fa4=this;return new Promise(function(_0xd37b7d,_0x1d2fad){return db[_0xd98d('0x1a')]['create'](_0x44da2d[_0xd98d('0x24')],{'raw':_0x44da2d['options']?_0x44da2d[_0xd98d('0x1b')][_0xd98d('0x1c')]===undefined?!![]:![]:!![]})[_0xd98d('0x10')](function(_0x474296){logger['info']('CreateVoiceQueueReport',_0x44da2d);logger[_0xd98d('0x13')](_0xd98d('0x23'),_0x44da2d,JSON[_0xd98d('0x14')](_0x474296));_0xd37b7d(_0x474296);})['catch'](function(_0x16b5f4){logger[_0xd98d('0x15')](_0xd98d('0x23'),_0x16b5f4[_0xd98d('0x17')],_0x44da2d);_0x1d2fad(_0x1f8fa4[_0xd98d('0x15')](0x1f4,_0x16b5f4[_0xd98d('0x17')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4a81f2){var _0x2d15d3=this;return new Promise(function(_0x50965c,_0x48d3f9){return db[_0xd98d('0x1a')][_0xd98d('0x25')](_0x4a81f2['body'],{'raw':_0x4a81f2[_0xd98d('0x1b')]?_0x4a81f2[_0xd98d('0x1b')][_0xd98d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a81f2['options']?_0x4a81f2[_0xd98d('0x1b')]['where']||null:null,'attributes':_0x4a81f2[_0xd98d('0x1b')]?_0x4a81f2[_0xd98d('0x1b')][_0xd98d('0x21')]||null:null,'limit':_0x4a81f2[_0xd98d('0x1b')]?_0x4a81f2[_0xd98d('0x1b')][_0xd98d('0x26')]||null:null})[_0xd98d('0x10')](function(_0x44ccd6){logger[_0xd98d('0x22')](_0xd98d('0x27'),_0x4a81f2);logger['debug']('UpdateVoiceQueueReport',_0x4a81f2,JSON['stringify'](_0x44ccd6));_0x50965c(_0x44ccd6);})['catch'](function(_0x5dd5aa){logger[_0xd98d('0x15')](_0xd98d('0x27'),_0x5dd5aa['message'],_0x4a81f2);_0x48d3f9(_0x2d15d3[_0xd98d('0x15')](0x1f4,_0x5dd5aa[_0xd98d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 68735dd..e2defbd 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.socket.js +++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a28=['update','removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0xb327a4,_0x5cac8e){var _0x1ce9b0=function(_0x1f270b){while(--_0x1f270b){_0xb327a4['push'](_0xb327a4['shift']());}};_0x1ce9b0(++_0x5cac8e);}(_0x1a28,0x10e));var _0x81a2=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0x1a28[_0x2ab365];return _0x49fef3;};'use strict';var VoiceQueueReportEvents=require(_0x81a2('0x0'));var events=[_0x81a2('0x1'),_0x81a2('0x2'),_0x81a2('0x3')];function createListener(_0x46ac8d,_0x19b137){return function(_0x5e5b20){_0x19b137['emit'](_0x46ac8d,_0x5e5b20);};}function removeListener(_0x350cfe,_0x41fa0c){return function(){VoiceQueueReportEvents[_0x81a2('0x4')](_0x350cfe,_0x41fa0c);};}exports['register']=function(_0x4188d7){for(var _0x20dcd4=0x0,_0x597932=events[_0x81a2('0x5')];_0x20dcd4<_0x597932;_0x20dcd4++){var _0x2aa66f=events[_0x20dcd4];var _0x453392=createListener(_0x81a2('0x6')+_0x2aa66f,_0x4188d7);VoiceQueueReportEvents['on'](_0x2aa66f,_0x453392);}}; \ No newline at end of file +var _0xece0=['emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','update'];(function(_0x28ea3b,_0x13d7a1){var _0x5ac766=function(_0x1ea77b){while(--_0x1ea77b){_0x28ea3b['push'](_0x28ea3b['shift']());}};_0x5ac766(++_0x13d7a1);}(_0xece0,0xa5));var _0x0ece=function(_0x16d138,_0x3f1d49){_0x16d138=_0x16d138-0x0;var _0x30a98d=_0xece0[_0x16d138];return _0x30a98d;};'use strict';var VoiceQueueReportEvents=require(_0x0ece('0x0'));var events=[_0x0ece('0x1'),'remove',_0x0ece('0x2')];function createListener(_0x42a41c,_0x5304fa){return function(_0x116fb3){_0x5304fa[_0x0ece('0x3')](_0x42a41c,_0x116fb3);};}function removeListener(_0xc9c26b,_0x5f1c86){return function(){VoiceQueueReportEvents['removeListener'](_0xc9c26b,_0x5f1c86);};}exports[_0x0ece('0x4')]=function(_0x3a107d){for(var _0xb736f9=0x0,_0x22ffca=events[_0x0ece('0x5')];_0xb736f9<_0x22ffca;_0xb736f9++){var _0x1de5cd=events[_0xb736f9];var _0x41dae7=createListener(_0x0ece('0x6')+_0x1de5cd,_0x3a107d);VoiceQueueReportEvents['on'](_0x1de5cd,_0x41dae7);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 1247bf5..c175880 100644 --- a/server/api/voiceQueuesLog/index.js +++ b/server/api/voiceQueuesLog/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3315=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','post','put','/:id','delete','destroy','exports','util'];(function(_0x3bca2d,_0x1af8f4){var _0x144a7c=function(_0x2a46ce){while(--_0x2a46ce){_0x3bca2d['push'](_0x3bca2d['shift']());}};_0x144a7c(++_0x1af8f4);}(_0x3315,0x7f));var _0x5331=function(_0x10f41a,_0x3660ea){_0x10f41a=_0x10f41a-0x0;var _0x3f543d=_0x3315[_0x10f41a];return _0x3f543d;};'use strict';var multer=require('multer');var util=require(_0x5331('0x0'));var path=require('path');var timeout=require(_0x5331('0x1'));var express=require(_0x5331('0x2'));var router=express['Router']();var fs_extra=require(_0x5331('0x3'));var auth=require(_0x5331('0x4'));var interaction=require(_0x5331('0x5'));var config=require(_0x5331('0x6'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x5331('0x7')](),controller[_0x5331('0x8')]);router['get']('/:id',auth[_0x5331('0x7')](),controller[_0x5331('0x9')]);router[_0x5331('0xa')]('/',auth[_0x5331('0x7')](),controller['create']);router[_0x5331('0xb')](_0x5331('0xc'),auth[_0x5331('0x7')](),controller['update']);router[_0x5331('0xd')](_0x5331('0xc'),auth[_0x5331('0x7')](),controller[_0x5331('0xe')]);module[_0x5331('0xf')]=router; \ No newline at end of file +var _0xb2e6=['../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1b453b,_0x29fc28){var _0x5ee47a=function(_0x107cd1){while(--_0x107cd1){_0x1b453b['push'](_0x1b453b['shift']());}};_0x5ee47a(++_0x29fc28);}(_0xb2e6,0x1c6));var _0x6b2e=function(_0x4dff32,_0x2d45fc){_0x4dff32=_0x4dff32-0x0;var _0x337d8d=_0xb2e6[_0x4dff32];return _0x337d8d;};'use strict';var multer=require(_0x6b2e('0x0'));var util=require(_0x6b2e('0x1'));var path=require(_0x6b2e('0x2'));var timeout=require(_0x6b2e('0x3'));var express=require('express');var router=express[_0x6b2e('0x4')]();var fs_extra=require(_0x6b2e('0x5'));var auth=require(_0x6b2e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b2e('0x7'));var controller=require(_0x6b2e('0x8'));router[_0x6b2e('0x9')]('/',auth[_0x6b2e('0xa')](),controller[_0x6b2e('0xb')]);router[_0x6b2e('0x9')](_0x6b2e('0xc'),auth['isAuthenticated'](),controller[_0x6b2e('0xd')]);router[_0x6b2e('0xe')]('/',auth[_0x6b2e('0xa')](),controller[_0x6b2e('0xf')]);router[_0x6b2e('0x10')](_0x6b2e('0xc'),auth[_0x6b2e('0xa')](),controller[_0x6b2e('0x11')]);router[_0x6b2e('0x12')](_0x6b2e('0xc'),auth['isAuthenticated'](),controller[_0x6b2e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index f784846..55be61c 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5757=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','STRING','literal'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5757,0xa5));var _0x7575=function(_0x1497ba,_0x59ed8e){_0x1497ba=_0x1497ba-0x0;var _0x1aadb7=_0x5757[_0x1497ba];return _0x1aadb7;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x7575('0x0')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x7575('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7575('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7575('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7575('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7575('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7575('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x7575('0x2')](_0x7575('0x3'))}}; \ No newline at end of file +var _0xb3c6=['moment','exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x25752d,_0x2587e5){var _0x4eccbb=function(_0x4b7eac){while(--_0x4b7eac){_0x25752d['push'](_0x25752d['shift']());}};_0x4eccbb(++_0x2587e5);}(_0xb3c6,0x10e));var _0x6b3c=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0xb3c6[_0x575057];return _0x49dbc8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6b3c('0x0'));module[_0x6b3c('0x1')]={'time':{'type':Sequelize[_0x6b3c('0x2')]},'callid':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x6b3c('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x6b3c('0x4')](_0x6b3c('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 503d58e..42427e1 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f3b=['fields','length','sort','where','pick','filter','options','VoiceQueuesLog','includeAll','findAll','catch','show','params','include','merge','find','create','body','destroy','eml-format','rimraf','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes'];(function(_0xc70ff5,_0x1f8a90){var _0x3f84b4=function(_0x5d55d5){while(--_0x5d55d5){_0xc70ff5['push'](_0xc70ff5['shift']());}};_0x3f84b4(++_0x1f8a90);}(_0x0f3b,0x1e8));var _0xb0f3=function(_0x3dfa79,_0x30b2b0){_0x3dfa79=_0x3dfa79-0x0;var _0x32b93a=_0x0f3b[_0x3dfa79];return _0x32b93a;};'use strict';var emlformat=require(_0xb0f3('0x0'));var rimraf=require(_0xb0f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb0f3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb0f3('0x3'));var Mustache=require('mustache');var util=require(_0xb0f3('0x4'));var path=require('path');var sox=require(_0xb0f3('0x5'));var csv=require(_0xb0f3('0x6'));var ejs=require(_0xb0f3('0x7'));var fs=require('fs');var fs_extra=require(_0xb0f3('0x8'));var _=require(_0xb0f3('0x9'));var squel=require(_0xb0f3('0xa'));var crypto=require(_0xb0f3('0xb'));var jsforce=require(_0xb0f3('0xc'));var deskjs=require(_0xb0f3('0xd'));var toCsv=require(_0xb0f3('0x6'));var querystring=require('querystring');var Papa=require(_0xb0f3('0xe'));var Redis=require('ioredis');var authService=require(_0xb0f3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb0f3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0f3('0x11'))(_0xb0f3('0x12'));var utils=require(_0xb0f3('0x13'));var config=require(_0xb0f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb0f3('0x15'))['db'];function respondWithStatusCode(_0x40e063,_0x3623c6){_0x3623c6=_0x3623c6||0xcc;return function(_0x914016){if(_0x914016){return _0x40e063[_0xb0f3('0x16')](_0x3623c6);}return _0x40e063['status'](_0x3623c6)[_0xb0f3('0x17')]();};}function respondWithResult(_0x40df4a,_0x273245){_0x273245=_0x273245||0xc8;return function(_0x65d93b){if(_0x65d93b){return _0x40df4a[_0xb0f3('0x18')](_0x273245)[_0xb0f3('0x19')](_0x65d93b);}};}function respondWithFilteredResult(_0x3ddab8,_0x1d749f){return function(_0x183dd8){if(_0x183dd8){var _0x76836a=typeof _0x1d749f[_0xb0f3('0x1a')]===_0xb0f3('0x1b')&&typeof _0x1d749f['limit']==='undefined';var _0x5d6c41=_0x183dd8[_0xb0f3('0x1c')];var _0x2f5ec3=_0x76836a?0x0:_0x1d749f[_0xb0f3('0x1a')];var _0x51d404=_0x76836a?_0x183dd8['count']:_0x1d749f[_0xb0f3('0x1a')]+_0x1d749f[_0xb0f3('0x1d')];var _0x2e4c9e;if(_0x51d404>=_0x5d6c41){_0x51d404=_0x5d6c41;_0x2e4c9e=0xc8;}else{_0x2e4c9e=0xce;}_0x3ddab8[_0xb0f3('0x18')](_0x2e4c9e);return _0x3ddab8[_0xb0f3('0x1e')](_0xb0f3('0x1f'),_0x2f5ec3+'-'+_0x51d404+'/'+_0x5d6c41)[_0xb0f3('0x19')](_0x183dd8);}return null;};}function patchUpdates(_0x1a0338){return function(_0x256fa5){try{jsonpatch['apply'](_0x256fa5,_0x1a0338,!![]);}catch(_0x51c770){return BPromise['reject'](_0x51c770);}return _0x256fa5['save']();};}function saveUpdates(_0x538d6e,_0x403730){return function(_0x23dcbd){if(_0x23dcbd){return _0x23dcbd[_0xb0f3('0x20')](_0x538d6e)[_0xb0f3('0x21')](function(_0x4ec29a){return _0x4ec29a;});}return null;};}function removeEntity(_0x2de286,_0x1526c3){return function(_0x135fe5){if(_0x135fe5){return _0x135fe5['destroy']()[_0xb0f3('0x21')](function(){_0x2de286[_0xb0f3('0x18')](0xcc)[_0xb0f3('0x17')]();});}};}function handleEntityNotFound(_0x5dd70f,_0x4eb327){return function(_0x4edd0e){if(!_0x4edd0e){_0x5dd70f[_0xb0f3('0x16')](0x194);}return _0x4edd0e;};}function handleError(_0x3ddd77,_0x230cdb){_0x230cdb=_0x230cdb||0x1f4;return function(_0xed5f8d){logger['error'](_0xed5f8d[_0xb0f3('0x22')]);if(_0xed5f8d[_0xb0f3('0x23')]){delete _0xed5f8d[_0xb0f3('0x23')];}_0x3ddd77['status'](_0x230cdb)[_0xb0f3('0x24')](_0xed5f8d);};}exports[_0xb0f3('0x25')]=function(_0x7c4431,_0x371a31){var _0x465962={},_0x4b7a49={},_0x156b37={'count':0x0,'rows':[]};var _0xb9443=_[_0xb0f3('0x26')](db['VoiceQueuesLog'][_0xb0f3('0x27')],function(_0x31ba41){return{'name':_0x31ba41[_0xb0f3('0x28')],'type':_0x31ba41[_0xb0f3('0x29')]['key']};});_0x4b7a49['model']=_['map'](_0xb9443,_0xb0f3('0x23'));_0x4b7a49[_0xb0f3('0x2a')]=_[_0xb0f3('0x2b')](_0x7c4431[_0xb0f3('0x2a')]);_0x4b7a49[_0xb0f3('0x2c')]=_[_0xb0f3('0x2d')](_0x4b7a49[_0xb0f3('0x2e')],_0x4b7a49[_0xb0f3('0x2a')]);_0x465962[_0xb0f3('0x2f')]=_[_0xb0f3('0x2d')](_0x4b7a49[_0xb0f3('0x2e')],qs[_0xb0f3('0x30')](_0x7c4431['query']['fields']));_0x465962[_0xb0f3('0x2f')]=_0x465962[_0xb0f3('0x2f')][_0xb0f3('0x31')]?_0x465962['attributes']:_0x4b7a49[_0xb0f3('0x2e')];if(!_0x7c4431['query']['hasOwnProperty']('nolimit')){_0x465962[_0xb0f3('0x1d')]=qs[_0xb0f3('0x1d')](_0x7c4431[_0xb0f3('0x2a')][_0xb0f3('0x1d')]);_0x465962['offset']=qs[_0xb0f3('0x1a')](_0x7c4431[_0xb0f3('0x2a')][_0xb0f3('0x1a')]);}_0x465962['order']=qs[_0xb0f3('0x32')](_0x7c4431[_0xb0f3('0x2a')][_0xb0f3('0x32')]);_0x465962[_0xb0f3('0x33')]=qs[_0xb0f3('0x2c')](_[_0xb0f3('0x34')](_0x7c4431[_0xb0f3('0x2a')],_0x4b7a49[_0xb0f3('0x2c')]),_0xb9443);if(_0x7c4431[_0xb0f3('0x2a')][_0xb0f3('0x35')]){_0x465962[_0xb0f3('0x33')]=_['merge'](_0x465962['where'],{'$or':_['map'](_0xb9443,function(_0x418f26){if(_0x418f26['type']!=='VIRTUAL'){var _0x335e68={};_0x335e68[_0x418f26[_0xb0f3('0x23')]]={'$like':'%'+_0x7c4431[_0xb0f3('0x2a')]['filter']+'%'};return _0x335e68;}})});}_0x465962=_['merge']({},_0x465962,_0x7c4431[_0xb0f3('0x36')]);var _0x1a00d0={'where':_0x465962[_0xb0f3('0x33')]};return db[_0xb0f3('0x37')][_0xb0f3('0x1c')](_0x1a00d0)[_0xb0f3('0x21')](function(_0x3a4a83){_0x156b37[_0xb0f3('0x1c')]=_0x3a4a83;if(_0x7c4431['query'][_0xb0f3('0x38')]){_0x465962['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xb0f3('0x39')](_0x465962);})[_0xb0f3('0x21')](function(_0x3c5dc6){_0x156b37['rows']=_0x3c5dc6;return _0x156b37;})[_0xb0f3('0x21')](respondWithFilteredResult(_0x371a31,_0x465962))[_0xb0f3('0x3a')](handleError(_0x371a31,null));};exports[_0xb0f3('0x3b')]=function(_0x6e2e52,_0x609036){var _0x5951b6={'raw':!![],'where':{'id':_0x6e2e52[_0xb0f3('0x3c')]['id']}},_0x1a1b38={};_0x1a1b38[_0xb0f3('0x2e')]=_['keys'](db[_0xb0f3('0x37')]['rawAttributes']);_0x1a1b38[_0xb0f3('0x2a')]=_[_0xb0f3('0x2b')](_0x6e2e52[_0xb0f3('0x2a')]);_0x1a1b38[_0xb0f3('0x2c')]=_['intersection'](_0x1a1b38[_0xb0f3('0x2e')],_0x1a1b38[_0xb0f3('0x2a')]);_0x5951b6['attributes']=_[_0xb0f3('0x2d')](_0x1a1b38[_0xb0f3('0x2e')],qs[_0xb0f3('0x30')](_0x6e2e52['query'][_0xb0f3('0x30')]));_0x5951b6[_0xb0f3('0x2f')]=_0x5951b6[_0xb0f3('0x2f')][_0xb0f3('0x31')]?_0x5951b6['attributes']:_0x1a1b38['model'];if(_0x6e2e52[_0xb0f3('0x2a')]['includeAll']){_0x5951b6[_0xb0f3('0x3d')]=[{'all':!![]}];}_0x5951b6=_[_0xb0f3('0x3e')]({},_0x5951b6,_0x6e2e52[_0xb0f3('0x36')]);return db[_0xb0f3('0x37')][_0xb0f3('0x3f')](_0x5951b6)[_0xb0f3('0x21')](handleEntityNotFound(_0x609036,null))[_0xb0f3('0x21')](respondWithResult(_0x609036,null))[_0xb0f3('0x3a')](handleError(_0x609036,null));};exports[_0xb0f3('0x40')]=function(_0x233231,_0x3e2195){return db[_0xb0f3('0x37')][_0xb0f3('0x40')](_0x233231[_0xb0f3('0x41')],{})[_0xb0f3('0x21')](respondWithResult(_0x3e2195,0xc9))[_0xb0f3('0x3a')](handleError(_0x3e2195,null));};exports[_0xb0f3('0x20')]=function(_0x2e10c0,_0x5ddabe){if(_0x2e10c0[_0xb0f3('0x41')]['id']){delete _0x2e10c0['body']['id'];}return db[_0xb0f3('0x37')][_0xb0f3('0x3f')]({'where':{'id':_0x2e10c0[_0xb0f3('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5ddabe,null))[_0xb0f3('0x21')](saveUpdates(_0x2e10c0[_0xb0f3('0x41')],null))['then'](respondWithResult(_0x5ddabe,null))[_0xb0f3('0x3a')](handleError(_0x5ddabe,null));};exports[_0xb0f3('0x42')]=function(_0x78f2f1,_0x174e40){return db[_0xb0f3('0x37')][_0xb0f3('0x3f')]({'where':{'id':_0x78f2f1['params']['id']}})[_0xb0f3('0x21')](handleEntityNotFound(_0x174e40,null))['then'](removeEntity(_0x174e40,null))[_0xb0f3('0x3a')](handleError(_0x174e40,null));}; \ No newline at end of file +var _0x8726=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','rows','params','include','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','stack','name','send','VoiceQueuesLog','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length'];(function(_0x508a80,_0x2dfd88){var _0x287832=function(_0x370e14){while(--_0x370e14){_0x508a80['push'](_0x508a80['shift']());}};_0x287832(++_0x2dfd88);}(_0x8726,0x16f));var _0x6872=function(_0x14a1ab,_0x2b09f3){_0x14a1ab=_0x14a1ab-0x0;var _0x508777=_0x8726[_0x14a1ab];return _0x508777;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6872('0x0'));var zipdir=require(_0x6872('0x1'));var jsonpatch=require(_0x6872('0x2'));var rp=require(_0x6872('0x3'));var moment=require(_0x6872('0x4'));var BPromise=require(_0x6872('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6872('0x6'));var sox=require(_0x6872('0x7'));var csv=require(_0x6872('0x8'));var ejs=require(_0x6872('0x9'));var fs=require('fs');var fs_extra=require(_0x6872('0xa'));var _=require('lodash');var squel=require(_0x6872('0xb'));var crypto=require(_0x6872('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6872('0xd'));var toCsv=require(_0x6872('0x8'));var querystring=require(_0x6872('0xe'));var Papa=require(_0x6872('0xf'));var Redis=require(_0x6872('0x10'));var authService=require(_0x6872('0x11'));var qs=require(_0x6872('0x12'));var as=require(_0x6872('0x13'));var hardwareService=require(_0x6872('0x14'));var logger=require('../../config/logger')(_0x6872('0x15'));var utils=require(_0x6872('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6872('0x17'))['db'];function respondWithStatusCode(_0x272bc6,_0x25cd81){_0x25cd81=_0x25cd81||0xcc;return function(_0x3dc80b){if(_0x3dc80b){return _0x272bc6[_0x6872('0x18')](_0x25cd81);}return _0x272bc6[_0x6872('0x19')](_0x25cd81)[_0x6872('0x1a')]();};}function respondWithResult(_0x4fdd1,_0x49565a){_0x49565a=_0x49565a||0xc8;return function(_0x7571cf){if(_0x7571cf){return _0x4fdd1[_0x6872('0x19')](_0x49565a)[_0x6872('0x1b')](_0x7571cf);}};}function respondWithFilteredResult(_0x4f92ff,_0x3cf492){return function(_0x548c59){if(_0x548c59){var _0x121843=typeof _0x3cf492[_0x6872('0x1c')]===_0x6872('0x1d')&&typeof _0x3cf492['limit']===_0x6872('0x1d');var _0x170ab8=_0x548c59[_0x6872('0x1e')];var _0x21265a=_0x121843?0x0:_0x3cf492[_0x6872('0x1c')];var _0x1e934b=_0x121843?_0x548c59['count']:_0x3cf492[_0x6872('0x1c')]+_0x3cf492[_0x6872('0x1f')];var _0x2402c9;if(_0x1e934b>=_0x170ab8){_0x1e934b=_0x170ab8;_0x2402c9=0xc8;}else{_0x2402c9=0xce;}_0x4f92ff[_0x6872('0x19')](_0x2402c9);return _0x4f92ff[_0x6872('0x20')]('Content-Range',_0x21265a+'-'+_0x1e934b+'/'+_0x170ab8)[_0x6872('0x1b')](_0x548c59);}return null;};}function patchUpdates(_0x216c4f){return function(_0x17f0bf){try{jsonpatch[_0x6872('0x21')](_0x17f0bf,_0x216c4f,!![]);}catch(_0x57d4e8){return BPromise[_0x6872('0x22')](_0x57d4e8);}return _0x17f0bf['save']();};}function saveUpdates(_0x336007,_0x406723){return function(_0x599b98){if(_0x599b98){return _0x599b98[_0x6872('0x23')](_0x336007)[_0x6872('0x24')](function(_0x2abb5a){return _0x2abb5a;});}return null;};}function removeEntity(_0x3c803e,_0x203e66){return function(_0x276912){if(_0x276912){return _0x276912['destroy']()[_0x6872('0x24')](function(){_0x3c803e[_0x6872('0x19')](0xcc)[_0x6872('0x1a')]();});}};}function handleEntityNotFound(_0x2359a9,_0x56c27b){return function(_0x269724){if(!_0x269724){_0x2359a9[_0x6872('0x18')](0x194);}return _0x269724;};}function handleError(_0x4a9217,_0x50374c){_0x50374c=_0x50374c||0x1f4;return function(_0x2b8ec1){logger['error'](_0x2b8ec1[_0x6872('0x25')]);if(_0x2b8ec1[_0x6872('0x26')]){delete _0x2b8ec1[_0x6872('0x26')];}_0x4a9217[_0x6872('0x19')](_0x50374c)[_0x6872('0x27')](_0x2b8ec1);};}exports['index']=function(_0x22f3d2,_0x29b8fc){var _0x2807ec={},_0x14efb7={},_0x3804ff={'count':0x0,'rows':[]};var _0x20aea8=_['map'](db[_0x6872('0x28')][_0x6872('0x29')],function(_0x19cb3d){return{'name':_0x19cb3d['fieldName'],'type':_0x19cb3d[_0x6872('0x2a')][_0x6872('0x2b')]};});_0x14efb7[_0x6872('0x2c')]=_[_0x6872('0x2d')](_0x20aea8,_0x6872('0x26'));_0x14efb7[_0x6872('0x2e')]=_[_0x6872('0x2f')](_0x22f3d2['query']);_0x14efb7[_0x6872('0x30')]=_['intersection'](_0x14efb7[_0x6872('0x2c')],_0x14efb7['query']);_0x2807ec[_0x6872('0x31')]=_[_0x6872('0x32')](_0x14efb7[_0x6872('0x2c')],qs[_0x6872('0x33')](_0x22f3d2[_0x6872('0x2e')][_0x6872('0x33')]));_0x2807ec[_0x6872('0x31')]=_0x2807ec[_0x6872('0x31')][_0x6872('0x34')]?_0x2807ec['attributes']:_0x14efb7[_0x6872('0x2c')];if(!_0x22f3d2[_0x6872('0x2e')][_0x6872('0x35')](_0x6872('0x36'))){_0x2807ec[_0x6872('0x1f')]=qs[_0x6872('0x1f')](_0x22f3d2[_0x6872('0x2e')][_0x6872('0x1f')]);_0x2807ec[_0x6872('0x1c')]=qs[_0x6872('0x1c')](_0x22f3d2[_0x6872('0x2e')]['offset']);}_0x2807ec['order']=qs[_0x6872('0x37')](_0x22f3d2['query'][_0x6872('0x37')]);_0x2807ec[_0x6872('0x38')]=qs[_0x6872('0x30')](_[_0x6872('0x39')](_0x22f3d2[_0x6872('0x2e')],_0x14efb7[_0x6872('0x30')]),_0x20aea8);if(_0x22f3d2['query'][_0x6872('0x3a')]){_0x2807ec[_0x6872('0x38')]=_[_0x6872('0x3b')](_0x2807ec[_0x6872('0x38')],{'$or':_[_0x6872('0x2d')](_0x20aea8,function(_0x2bede4){if(_0x2bede4[_0x6872('0x2a')]!=='VIRTUAL'){var _0x5c4901={};_0x5c4901[_0x2bede4[_0x6872('0x26')]]={'$like':'%'+_0x22f3d2[_0x6872('0x2e')][_0x6872('0x3a')]+'%'};return _0x5c4901;}})});}_0x2807ec=_[_0x6872('0x3b')]({},_0x2807ec,_0x22f3d2[_0x6872('0x3c')]);var _0x44adf5={'where':_0x2807ec[_0x6872('0x38')]};return db[_0x6872('0x28')][_0x6872('0x1e')](_0x44adf5)['then'](function(_0x49eeb5){_0x3804ff['count']=_0x49eeb5;if(_0x22f3d2['query'][_0x6872('0x3d')]){_0x2807ec['include']=[{'all':!![]}];}return db[_0x6872('0x28')]['findAll'](_0x2807ec);})[_0x6872('0x24')](function(_0x5e153b){_0x3804ff[_0x6872('0x3e')]=_0x5e153b;return _0x3804ff;})[_0x6872('0x24')](respondWithFilteredResult(_0x29b8fc,_0x2807ec))['catch'](handleError(_0x29b8fc,null));};exports['show']=function(_0x4985ca,_0x5acbd3){var _0x429c30={'raw':!![],'where':{'id':_0x4985ca[_0x6872('0x3f')]['id']}},_0x191f62={};_0x191f62[_0x6872('0x2c')]=_[_0x6872('0x2f')](db[_0x6872('0x28')][_0x6872('0x29')]);_0x191f62[_0x6872('0x2e')]=_[_0x6872('0x2f')](_0x4985ca[_0x6872('0x2e')]);_0x191f62[_0x6872('0x30')]=_[_0x6872('0x32')](_0x191f62[_0x6872('0x2c')],_0x191f62[_0x6872('0x2e')]);_0x429c30[_0x6872('0x31')]=_['intersection'](_0x191f62[_0x6872('0x2c')],qs[_0x6872('0x33')](_0x4985ca['query'][_0x6872('0x33')]));_0x429c30[_0x6872('0x31')]=_0x429c30[_0x6872('0x31')][_0x6872('0x34')]?_0x429c30[_0x6872('0x31')]:_0x191f62['model'];if(_0x4985ca[_0x6872('0x2e')][_0x6872('0x3d')]){_0x429c30[_0x6872('0x40')]=[{'all':!![]}];}_0x429c30=_[_0x6872('0x3b')]({},_0x429c30,_0x4985ca[_0x6872('0x3c')]);return db['VoiceQueuesLog'][_0x6872('0x41')](_0x429c30)[_0x6872('0x24')](handleEntityNotFound(_0x5acbd3,null))['then'](respondWithResult(_0x5acbd3,null))[_0x6872('0x42')](handleError(_0x5acbd3,null));};exports[_0x6872('0x43')]=function(_0xcd635f,_0x314ed4){return db[_0x6872('0x28')][_0x6872('0x43')](_0xcd635f['body'],{})['then'](respondWithResult(_0x314ed4,0xc9))[_0x6872('0x42')](handleError(_0x314ed4,null));};exports[_0x6872('0x23')]=function(_0x212db5,_0x2168f4){if(_0x212db5[_0x6872('0x44')]['id']){delete _0x212db5[_0x6872('0x44')]['id'];}return db[_0x6872('0x28')][_0x6872('0x41')]({'where':{'id':_0x212db5[_0x6872('0x3f')]['id']}})[_0x6872('0x24')](handleEntityNotFound(_0x2168f4,null))[_0x6872('0x24')](saveUpdates(_0x212db5['body'],null))[_0x6872('0x24')](respondWithResult(_0x2168f4,null))[_0x6872('0x42')](handleError(_0x2168f4,null));};exports[_0x6872('0x45')]=function(_0xd52018,_0x1d20c7){return db['VoiceQueuesLog'][_0x6872('0x41')]({'where':{'id':_0xd52018['params']['id']}})[_0x6872('0x24')](handleEntityNotFound(_0x1d20c7,null))['then'](removeEntity(_0x1d20c7,null))['catch'](handleError(_0x1d20c7,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 0c91793..250a517 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fa4=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','dtm','util','../../config/logger','api','moment','bluebird'];(function(_0x38e4d8,_0x438401){var _0x43bce4=function(_0xc877f){while(--_0xc877f){_0x38e4d8['push'](_0x38e4d8['shift']());}};_0x43bce4(++_0x438401);}(_0x3fa4,0x87));var _0x43fa=function(_0x3b878a,_0x1a26ab){_0x3b878a=_0x3b878a-0x0;var _0x40ff31=_0x3fa4[_0x3b878a];return _0x40ff31;};'use strict';var _=require('lodash');var util=require(_0x43fa('0x0'));var logger=require(_0x43fa('0x1'))(_0x43fa('0x2'));var moment=require(_0x43fa('0x3'));var BPromise=require(_0x43fa('0x4'));var rp=require(_0x43fa('0x5'));var fs=require('fs');var path=require(_0x43fa('0x6'));var rimraf=require(_0x43fa('0x7'));var config=require(_0x43fa('0x8'));var attributes=require(_0x43fa('0x9'));module[_0x43fa('0xa')]=function(_0x1fd5ef,_0x4bac10){return _0x1fd5ef[_0x43fa('0xb')](_0x43fa('0xc'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x43fa('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xbe02=['define','VoiceQueuesLog','event_dtm','event','util','../../config/logger','api','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x4afdbe,_0x478132){var _0x434c4a=function(_0x436e9d){while(--_0x436e9d){_0x4afdbe['push'](_0x4afdbe['shift']());}};_0x434c4a(++_0x478132);}(_0xbe02,0x124));var _0x2be0=function(_0xeccb31,_0x111a5a){_0xeccb31=_0xeccb31-0x0;var _0x30a040=_0xbe02[_0xeccb31];return _0x30a040;};'use strict';var _=require('lodash');var util=require(_0x2be0('0x0'));var logger=require(_0x2be0('0x1'))(_0x2be0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2be0('0x3'));var fs=require('fs');var path=require(_0x2be0('0x4'));var rimraf=require('rimraf');var config=require(_0x2be0('0x5'));var attributes=require(_0x2be0('0x6'));module[_0x2be0('0x7')]=function(_0xa6a72f,_0x35e7d8){return _0xa6a72f[_0x2be0('0x8')](_0x2be0('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x2be0('0xa'),'fields':[_0x2be0('0xb'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 395b759..c75db52 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde56=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3198fd,_0x3729d8){var _0x2dd0b=function(_0x94b525){while(--_0x94b525){_0x3198fd['push'](_0x3198fd['shift']());}};_0x2dd0b(++_0x3729d8);}(_0xde56,0x144));var _0x6de5=function(_0x70fd53,_0x2a95a6){_0x70fd53=_0x70fd53-0x0;var _0x4b71c5=_0xde56[_0x70fd53];return _0x4b71c5;};'use strict';var _=require(_0x6de5('0x0'));var util=require('util');var moment=require(_0x6de5('0x1'));var BPromise=require(_0x6de5('0x2'));var rs=require(_0x6de5('0x3'));var fs=require('fs');var Redis=require(_0x6de5('0x4'));var db=require(_0x6de5('0x5'))['db'];var utils=require(_0x6de5('0x6'));var logger=require(_0x6de5('0x7'))(_0x6de5('0x8'));var config=require(_0x6de5('0x9'));var jayson=require(_0x6de5('0xa'));var client=jayson['client'][_0x6de5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x141d65,_0x27dcfe,_0x1f8236){return new BPromise(function(_0x1cd11e,_0x3f1400){return client['request'](_0x141d65,_0x1f8236)['then'](function(_0x1769af){logger[_0x6de5('0xc')](_0x6de5('0xd'),_0x27dcfe,_0x6de5('0xe'));logger['debug'](_0x6de5('0xf'),_0x27dcfe,_0x6de5('0xe'),JSON[_0x6de5('0x10')](_0x1769af));if(_0x1769af[_0x6de5('0x11')]){if(_0x1769af['error'][_0x6de5('0x12')]===0x1f4){logger[_0x6de5('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x27dcfe,_0x1769af[_0x6de5('0x11')][_0x6de5('0x13')]);return _0x3f1400(_0x1769af[_0x6de5('0x11')][_0x6de5('0x13')]);}logger['error'](_0x6de5('0xd'),_0x27dcfe,_0x1769af[_0x6de5('0x11')][_0x6de5('0x13')]);return _0x1cd11e(_0x1769af[_0x6de5('0x11')]['message']);}else{logger[_0x6de5('0xc')](_0x6de5('0xd'),_0x27dcfe,_0x6de5('0xe'));_0x1cd11e(_0x1769af[_0x6de5('0x14')]['message']);}})[_0x6de5('0x15')](function(_0x2316a6){logger[_0x6de5('0x11')](_0x6de5('0xd'),_0x27dcfe,_0x2316a6);_0x3f1400(_0x2316a6);});});} \ No newline at end of file +var _0x55e4=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x359d82,_0x3a14e6){var _0x4afe06=function(_0x2928c4){while(--_0x2928c4){_0x359d82['push'](_0x359d82['shift']());}};_0x4afe06(++_0x3a14e6);}(_0x55e4,0x142));var _0x455e=function(_0x5e1c92,_0x38c523){_0x5e1c92=_0x5e1c92-0x0;var _0x3ab170=_0x55e4[_0x5e1c92];return _0x3ab170;};'use strict';var _=require(_0x455e('0x0'));var util=require(_0x455e('0x1'));var moment=require(_0x455e('0x2'));var BPromise=require(_0x455e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x455e('0x4'))['db'];var utils=require(_0x455e('0x5'));var logger=require('../../config/logger')(_0x455e('0x6'));var config=require(_0x455e('0x7'));var jayson=require(_0x455e('0x8'));var client=jayson[_0x455e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53d214,_0x4d028f,_0xcd44b0){return new BPromise(function(_0x1fc462,_0x2301b6){return client[_0x455e('0xa')](_0x53d214,_0xcd44b0)[_0x455e('0xb')](function(_0x1d7d1f){logger[_0x455e('0xc')](_0x455e('0xd'),_0x4d028f,_0x455e('0xe'));logger[_0x455e('0xf')](_0x455e('0x10'),_0x4d028f,'request\x20sent',JSON[_0x455e('0x11')](_0x1d7d1f));if(_0x1d7d1f[_0x455e('0x12')]){if(_0x1d7d1f[_0x455e('0x12')][_0x455e('0x13')]===0x1f4){logger[_0x455e('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4d028f,_0x1d7d1f['error'][_0x455e('0x14')]);return _0x2301b6(_0x1d7d1f[_0x455e('0x12')][_0x455e('0x14')]);}logger[_0x455e('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4d028f,_0x1d7d1f[_0x455e('0x12')][_0x455e('0x14')]);return _0x1fc462(_0x1d7d1f['error'][_0x455e('0x14')]);}else{logger[_0x455e('0xc')](_0x455e('0xd'),_0x4d028f,'request\x20sent');_0x1fc462(_0x1d7d1f[_0x455e('0x15')][_0x455e('0x14')]);}})[_0x455e('0x16')](function(_0x454d1f){logger['error'](_0x455e('0xd'),_0x4d028f,_0x454d1f);_0x2301b6(_0x454d1f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 9dc6857..0529af5 100644 --- a/server/api/voiceRecording/index.js +++ b/server/api/voiceRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe860=['/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','update','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x2ce145,_0x89c7ac){var _0x4bc59c=function(_0x2becb0){while(--_0x2becb0){_0x2ce145['push'](_0x2ce145['shift']());}};_0x4bc59c(++_0x89c7ac);}(_0xe860,0x83));var _0x0e86=function(_0x86de05,_0x1f034a){_0x86de05=_0x86de05-0x0;var _0x43604d=_0xe860[_0x86de05];return _0x43604d;};'use strict';var multer=require(_0x0e86('0x0'));var util=require(_0x0e86('0x1'));var path=require('path');var timeout=require(_0x0e86('0x2'));var express=require(_0x0e86('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0e86('0x4'));var config=require(_0x0e86('0x5'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x0e86('0x6')](),controller[_0x0e86('0x7')]);router['get'](_0x0e86('0x8'),auth[_0x0e86('0x6')](),controller[_0x0e86('0x9')]);router[_0x0e86('0xa')](_0x0e86('0xb'),auth[_0x0e86('0x6')](),controller[_0x0e86('0xc')]);router[_0x0e86('0xa')](_0x0e86('0xd'),auth[_0x0e86('0x6')](),controller[_0x0e86('0xe')]);router['get'](_0x0e86('0xf'),controller['downloads']);router[_0x0e86('0xa')](_0x0e86('0x10'),auth[_0x0e86('0x6')](),controller[_0x0e86('0x11')]);router[_0x0e86('0x12')]('/',auth['isAuthenticated'](),controller[_0x0e86('0x13')]);router['post']('/:id/transcribe',auth[_0x0e86('0x6')](),controller[_0x0e86('0x14')]);router['put'](_0x0e86('0xb'),auth['isAuthenticated'](),controller[_0x0e86('0x15')]);router[_0x0e86('0x16')](_0x0e86('0xb'),auth['isAuthenticated'](),controller[_0x0e86('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2902=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','delete','exports'];(function(_0x143368,_0x5d0b64){var _0x44c10a=function(_0x30c90c){while(--_0x30c90c){_0x143368['push'](_0x143368['shift']());}};_0x44c10a(++_0x5d0b64);}(_0x2902,0x11e));var _0x2290=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2902[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0x2290('0x0'));var util=require('util');var path=require(_0x2290('0x1'));var timeout=require(_0x2290('0x2'));var express=require(_0x2290('0x3'));var router=express[_0x2290('0x4')]();var fs_extra=require(_0x2290('0x5'));var auth=require(_0x2290('0x6'));var interaction=require(_0x2290('0x7'));var config=require('../../config/environment');var controller=require(_0x2290('0x8'));router[_0x2290('0x9')]('/',auth[_0x2290('0xa')](),controller['index']);router[_0x2290('0x9')](_0x2290('0xb'),auth[_0x2290('0xa')](),controller[_0x2290('0xc')]);router[_0x2290('0x9')](_0x2290('0xd'),auth[_0x2290('0xa')](),controller[_0x2290('0xe')]);router['get'](_0x2290('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x2290('0x9')](_0x2290('0x10'),controller[_0x2290('0x11')]);router['get']('/:id/transcribe',auth[_0x2290('0xa')](),controller[_0x2290('0x12')]);router[_0x2290('0x13')]('/',auth['isAuthenticated'](),controller[_0x2290('0x14')]);router[_0x2290('0x13')](_0x2290('0x15'),auth[_0x2290('0xa')](),controller[_0x2290('0x16')]);router[_0x2290('0x17')](_0x2290('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2290('0x18')](_0x2290('0xd'),auth[_0x2290('0xa')](),controller['destroy']);module[_0x2290('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 2c52c7e..02f4158 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 28e4d0c..5a9385b 100644 --- a/server/api/voiceRecording/voiceRecording.controller.js +++ b/server/api/voiceRecording/voiceRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae5a=['[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','ValidationError','runSentiment','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','writeFile','downloadTranscribe','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','crypto','jsforce','desk.js','to-csv','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','name','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','send','downloads','sequelize','MD5','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request'];(function(_0x203e0d,_0x24e7d1){var _0x3ba6a1=function(_0x3f96b9){while(--_0x3f96b9){_0x203e0d['push'](_0x203e0d['shift']());}};_0x3ba6a1(++_0x24e7d1);}(_0xae5a,0x145));var _0xaae5=function(_0x1da8d8,_0x32ef0d){_0x1da8d8=_0x1da8d8-0x0;var _0x1618b9=_0xae5a[_0x1da8d8];return _0x1618b9;};'use strict';var emlformat=require(_0xaae5('0x0'));var rimraf=require(_0xaae5('0x1'));var zipdir=require(_0xaae5('0x2'));var jsonpatch=require(_0xaae5('0x3'));var rp=require(_0xaae5('0x4'));var moment=require(_0xaae5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaae5('0x6'));var path=require(_0xaae5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaae5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaae5('0x9'));var jsforce=require(_0xaae5('0xa'));var deskjs=require(_0xaae5('0xb'));var toCsv=require(_0xaae5('0xc'));var querystring=require('querystring');var Papa=require(_0xaae5('0xd'));var AWS=require(_0xaae5('0xe'));var uuidv4=require(_0xaae5('0xf'));var Redis=require(_0xaae5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xaae5('0x11'));var as=require(_0xaae5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaae5('0x13'))(_0xaae5('0x14'));var utils=require('../../config/utils');var config=require(_0xaae5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaae5('0x16'))['db'];function respondWithStatusCode(_0x505cf5,_0x3b1a1d){_0x3b1a1d=_0x3b1a1d||0xcc;return function(_0x5b0937){if(_0x5b0937){return _0x505cf5[_0xaae5('0x17')](_0x3b1a1d);}return _0x505cf5[_0xaae5('0x18')](_0x3b1a1d)[_0xaae5('0x19')]();};}function respondWithResult(_0x41c84d,_0x243712){_0x243712=_0x243712||0xc8;return function(_0x329d3b){if(_0x329d3b){return _0x41c84d[_0xaae5('0x18')](_0x243712)[_0xaae5('0x1a')](_0x329d3b);}};}function respondWithFilteredResult(_0x5e56ed,_0x4cccda){return function(_0x1a439d){if(_0x1a439d){var _0x5b5ddc=typeof _0x4cccda[_0xaae5('0x1b')]===_0xaae5('0x1c')&&typeof _0x4cccda[_0xaae5('0x1d')]==='undefined';var _0x4cd022=_0x1a439d[_0xaae5('0x1e')];var _0x100b25=_0x5b5ddc?0x0:_0x4cccda['offset'];var _0x2a94d6=_0x5b5ddc?_0x1a439d[_0xaae5('0x1e')]:_0x4cccda[_0xaae5('0x1b')]+_0x4cccda[_0xaae5('0x1d')];var _0x46a3bf;if(_0x2a94d6>=_0x4cd022){_0x2a94d6=_0x4cd022;_0x46a3bf=0xc8;}else{_0x46a3bf=0xce;}_0x5e56ed[_0xaae5('0x18')](_0x46a3bf);return _0x5e56ed[_0xaae5('0x1f')](_0xaae5('0x20'),_0x100b25+'-'+_0x2a94d6+'/'+_0x4cd022)[_0xaae5('0x1a')](_0x1a439d);}return null;};}function patchUpdates(_0x35595a){return function(_0x303ce0){try{jsonpatch[_0xaae5('0x21')](_0x303ce0,_0x35595a,!![]);}catch(_0x32f9d2){return BPromise['reject'](_0x32f9d2);}return _0x303ce0[_0xaae5('0x22')]();};}function saveUpdates(_0x1268c5,_0xbe24f3){return function(_0x54b9e1){if(_0x54b9e1){return _0x54b9e1[_0xaae5('0x23')](_0x1268c5)['then'](function(_0x2ff2d1){return _0x2ff2d1;});}return null;};}function removeEntity(_0x36b107,_0x233524){return function(_0x3f5308){if(_0x3f5308){return _0x3f5308[_0xaae5('0x24')]()[_0xaae5('0x25')](function(){_0x36b107[_0xaae5('0x18')](0xcc)[_0xaae5('0x19')]();});}};}function handleEntityNotFound(_0x4f2efc,_0xb62df8){return function(_0xb807d7){if(!_0xb807d7){_0x4f2efc[_0xaae5('0x17')](0x194);}return _0xb807d7;};}function handleError(_0x4833ba,_0x168bb6){_0x168bb6=_0x168bb6||0x1f4;return function(_0x1f348e){logger[_0xaae5('0x26')](_0x1f348e['stack']);if(_0x1f348e['name']){delete _0x1f348e[_0xaae5('0x27')];}_0x4833ba[_0xaae5('0x18')](_0x168bb6)['send'](_0x1f348e);};}exports[_0xaae5('0x28')]=function(_0x8daaa1,_0x39d76b){var _0x80b15={},_0x233fe0={},_0x334893={'count':0x0,'rows':[]};var _0x31c075=_[_0xaae5('0x29')](db[_0xaae5('0x2a')][_0xaae5('0x2b')],function(_0x739211){return{'name':_0x739211[_0xaae5('0x2c')],'type':_0x739211[_0xaae5('0x2d')][_0xaae5('0x2e')]};});_0x233fe0[_0xaae5('0x2f')]=_[_0xaae5('0x30')](_[_0xaae5('0x29')](_0x31c075,_0xaae5('0x27')),[_0xaae5('0x31')]);_0x233fe0[_0xaae5('0x32')]=_['keys'](_0x8daaa1[_0xaae5('0x32')]);_0x233fe0[_0xaae5('0x33')]=_[_0xaae5('0x34')](_0x233fe0[_0xaae5('0x2f')],_0x233fe0[_0xaae5('0x32')]);_0x80b15[_0xaae5('0x35')]=_[_0xaae5('0x34')](_0x233fe0[_0xaae5('0x2f')],qs[_0xaae5('0x36')](_0x8daaa1[_0xaae5('0x32')]['fields']));_0x80b15[_0xaae5('0x35')]=_0x80b15['attributes'][_0xaae5('0x37')]?_0x80b15[_0xaae5('0x35')]:_0x233fe0[_0xaae5('0x2f')];if(!_0x8daaa1[_0xaae5('0x32')][_0xaae5('0x38')]('nolimit')){_0x80b15[_0xaae5('0x1d')]=qs[_0xaae5('0x1d')](_0x8daaa1['query']['limit']);_0x80b15[_0xaae5('0x1b')]=qs[_0xaae5('0x1b')](_0x8daaa1['query'][_0xaae5('0x1b')]);}_0x80b15[_0xaae5('0x39')]=qs[_0xaae5('0x3a')](_0x8daaa1[_0xaae5('0x32')][_0xaae5('0x3a')]);_0x80b15['where']=qs['filters'](_[_0xaae5('0x3b')](_0x8daaa1[_0xaae5('0x32')],_0x233fe0['filters']),_0x31c075);if(_0x8daaa1[_0xaae5('0x32')][_0xaae5('0x3c')]){_0x80b15[_0xaae5('0x3d')]=_[_0xaae5('0x3e')](_0x80b15[_0xaae5('0x3d')],{'$or':_['map'](_0x31c075,function(_0x5b5c35){if(_0x5b5c35[_0xaae5('0x2d')]!==_0xaae5('0x3f')){var _0x171eda={};_0x171eda[_0x5b5c35[_0xaae5('0x27')]]={'$like':'%'+_0x8daaa1[_0xaae5('0x32')][_0xaae5('0x3c')]+'%'};return _0x171eda;}})});}_0x80b15=_['merge']({},_0x80b15,_0x8daaa1[_0xaae5('0x40')]);var _0x14e90e={'where':_0x80b15[_0xaae5('0x3d')]};return db[_0xaae5('0x2a')]['count'](_0x14e90e)[_0xaae5('0x25')](function(_0x50e045){_0x334893['count']=_0x50e045;if(_0x8daaa1['query']['includeAll']){_0x80b15[_0xaae5('0x41')]=[{'all':!![]}];}return db['VoiceRecording'][_0xaae5('0x42')](_0x80b15);})['then'](function(_0xe68f43){_0x334893[_0xaae5('0x43')]=_0xe68f43;return _0x334893;})['then'](respondWithFilteredResult(_0x39d76b,_0x80b15))[_0xaae5('0x44')](handleError(_0x39d76b,null));};exports[_0xaae5('0x45')]=function(_0x12f10a,_0x68d5ba){var _0x3f9a84={'raw':![],'where':{'id':_0x12f10a[_0xaae5('0x46')]['id']}},_0x27c52a={};_0x27c52a['model']=_['keys'](db['VoiceRecording'][_0xaae5('0x2b')]);_0x27c52a[_0xaae5('0x32')]=_[_0xaae5('0x47')](_0x12f10a[_0xaae5('0x32')]);_0x27c52a[_0xaae5('0x33')]=_[_0xaae5('0x34')](_0x27c52a[_0xaae5('0x2f')],_0x27c52a['query']);_0x3f9a84[_0xaae5('0x35')]=_[_0xaae5('0x34')](_0x27c52a['model'],qs[_0xaae5('0x36')](_0x12f10a[_0xaae5('0x32')][_0xaae5('0x36')]));_0x3f9a84['attributes']=_0x3f9a84[_0xaae5('0x35')][_0xaae5('0x37')]?_0x3f9a84[_0xaae5('0x35')]:_0x27c52a[_0xaae5('0x2f')];if(_0x12f10a[_0xaae5('0x32')]['includeAll']){_0x3f9a84[_0xaae5('0x41')]=[{'all':!![]}];}_0x3f9a84=_[_0xaae5('0x3e')]({},_0x3f9a84,_0x12f10a['options']);return db[_0xaae5('0x2a')][_0xaae5('0x48')](_0x3f9a84)['then'](handleEntityNotFound(_0x68d5ba,null))['then'](respondWithResult(_0x68d5ba,null))['catch'](handleError(_0x68d5ba,null));};exports[_0xaae5('0x49')]=function(_0x39f7e3,_0x102048){return db[_0xaae5('0x2a')][_0xaae5('0x49')](_0x39f7e3[_0xaae5('0x4a')],{})['then'](respondWithResult(_0x102048,0xc9))[_0xaae5('0x44')](handleError(_0x102048,null));};exports[_0xaae5('0x23')]=function(_0x25c93e,_0x47a2df){if(_0x25c93e['body']['id']){delete _0x25c93e['body']['id'];}return db[_0xaae5('0x2a')][_0xaae5('0x48')]({'where':{'id':_0x25c93e[_0xaae5('0x46')]['id']}})[_0xaae5('0x25')](handleEntityNotFound(_0x47a2df,null))[_0xaae5('0x25')](saveUpdates(_0x25c93e['body'],null))[_0xaae5('0x25')](respondWithResult(_0x47a2df,null))[_0xaae5('0x44')](handleError(_0x47a2df,null));};exports[_0xaae5('0x4b')]=function(_0x323dae,_0x2fd588){return db[_0xaae5('0x2a')][_0xaae5('0x4b')]()[_0xaae5('0x25')](respondWithResult(_0x2fd588,null))['catch'](handleError(_0x2fd588,null));};exports[_0xaae5('0x4c')]=function(_0x3660b8,_0x505f1b,_0x2ead55){var _0x492ca0=require(_0xaae5('0x4d'));var _0x5e7b2d=![];var _0x54274b={};if(_0x3660b8[_0xaae5('0x32')]['type']&&_0x3660b8['query'][_0xaae5('0x2d')]===_0xaae5('0x4e')){_0x54274b['uniqueid']=_0x3660b8[_0xaae5('0x46')]['id'];}else{_0x54274b['id']=_0x3660b8[_0xaae5('0x46')]['id'];}return db['VoiceRecording'][_0xaae5('0x48')]({'where':_0x54274b,'attributes':['id',_0xaae5('0x4f')],'raw':!![]})[_0xaae5('0x25')](handleEntityNotFound(_0x505f1b,null))['then'](function(_0x1de73a){if(_0x1de73a){var _0x593e0f=_0x1de73a[_0xaae5('0x4f')];var _0x2263a2=util['format'](_0xaae5('0x50'),_0x593e0f);if(fs[_0xaae5('0x51')](_0x2263a2)){_0x5e7b2d=!![];return _0x492ca0[_0xaae5('0x52')](_0x2263a2,_0x593e0f,config[_0xaae5('0x53')][_0xaae5('0x54')])[_0xaae5('0x25')](function(){return _0x1de73a;});}return _0x1de73a;}})[_0xaae5('0x25')](function(_0x2d5b2d){if(_0x2d5b2d){var _0x9bd2f5=_0x2d5b2d[_0xaae5('0x4f')];if(!fs[_0xaae5('0x51')](_0x9bd2f5)){throw new db[(_0xaae5('0x55'))]['ValidationError'](_0xaae5('0x56'));}if(_0x2d5b2d[_0xaae5('0x57')]){return _0x505f1b['download'](_0x9bd2f5,_0x2d5b2d['filename']+path['extname'](_0x9bd2f5),function(){if(_0x5e7b2d){fs[_0xaae5('0x58')](_0x9bd2f5);}});}else{return _0x505f1b[_0xaae5('0x4c')](_0x9bd2f5,function(_0x3a1235){if(_0x5e7b2d){fs[_0xaae5('0x58')](_0x9bd2f5);}});}}})[_0xaae5('0x44')](function(_0x1bcfaa){if(_0x1bcfaa[_0xaae5('0x59')]===_0xaae5('0x56')){_0x505f1b[_0xaae5('0x18')](0x194)[_0xaae5('0x5a')]('Not\x20found');}else{return handleError(_0x505f1b,null);}});};exports[_0xaae5('0x5b')]=function(_0x28874d,_0x33dc5c,_0x5bc459){var _0x978a89=require(_0xaae5('0x4d'));var _0x499aa4=![];var _0x3b422e={'$and':[db['sequelize'][_0xaae5('0x3d')](db[_0xaae5('0x5c')]['fn'](_0xaae5('0x5d'),db['sequelize']['col'](_0xaae5('0x4e'))),_0x28874d[_0xaae5('0x32')]['token'])]};if(_0x28874d[_0xaae5('0x32')][_0xaae5('0x2d')]&&_0x28874d[_0xaae5('0x32')][_0xaae5('0x2d')]===_0xaae5('0x4e')){_0x3b422e[_0xaae5('0x5e')][_0xaae5('0x5f')]({'uniqueid':_0x28874d[_0xaae5('0x46')]['id']});}else{_0x3b422e[_0xaae5('0x5e')]['push']({'id':_0x28874d[_0xaae5('0x46')]['id']});}return db['VoiceRecording'][_0xaae5('0x48')]({'where':_0x3b422e,'attributes':['id',_0xaae5('0x4f')],'raw':!![]})[_0xaae5('0x25')](handleEntityNotFound(_0x33dc5c,null))[_0xaae5('0x25')](function(_0x1d7aca){if(_0x1d7aca){var _0x408ba9=util['format'](_0xaae5('0x50'),_0x1d7aca['value']);if(fs[_0xaae5('0x51')](_0x408ba9)){_0x499aa4=!![];return _0x978a89[_0xaae5('0x52')](_0x408ba9,_0x1d7aca[_0xaae5('0x4f')],config[_0xaae5('0x53')][_0xaae5('0x54')])[_0xaae5('0x25')](function(){return _0x1d7aca;});}return _0x1d7aca;}})[_0xaae5('0x25')](function(_0x210076){if(_0x210076){if(!fs['existsSync'](_0x210076['value'])){throw new db[(_0xaae5('0x55'))]['ValidationError'](_0xaae5('0x56'));}if(_0x210076[_0xaae5('0x57')]){return _0x33dc5c['download'](_0x210076[_0xaae5('0x4f')],_0x210076['filename']+path['extname'](_0x210076[_0xaae5('0x4f')]),function(){if(_0x499aa4){fs[_0xaae5('0x58')](_0x210076[_0xaae5('0x4f')]);}});}else{return _0x33dc5c[_0xaae5('0x4c')](_0x210076[_0xaae5('0x4f')],function(_0x300565){if(_0x499aa4){fs['unlink'](_0x210076[_0xaae5('0x4f')]);}});}}})['catch'](handleError(_0x33dc5c,null));};exports['destroy']=function(_0x2993c7,_0x445a29){return db['VoiceRecording']['find']({'where':{'id':_0x2993c7[_0xaae5('0x46')]['id']}})['then'](function(_0xe2f60){if(_[_0xaae5('0x60')](_0xe2f60)){throw new ReferenceError(_0xaae5('0x61'));}return _0xe2f60;})[_0xaae5('0x25')](function(_0x3e756f){var _0x448ff0=_0x3e756f[_0xaae5('0x4f')];logger[_0xaae5('0x62')](_0xaae5('0x63'),_0x448ff0);if(!_['isNil'](_0x3e756f[_0xaae5('0x4f')])&&fs[_0xaae5('0x51')](_0x448ff0)){logger[_0xaae5('0x62')]('File:\x20\x22'+_0x448ff0+_0xaae5('0x64'));fs[_0xaae5('0x65')](_0x448ff0);}_0x448ff0=_0x448ff0+_0xaae5('0x66');if(!_['isNil'](_0x3e756f['value'])&&fs[_0xaae5('0x51')](_0x448ff0)){logger[_0xaae5('0x62')]('File:\x20\x22'+_0x448ff0+_0xaae5('0x64'));fs[_0xaae5('0x65')](_0x448ff0);}return _0x3e756f;})['then'](function(_0x2c7568){if(!_0x2c7568)throw new InternalError();return _0x2c7568['destroy']();})[_0xaae5('0x25')](function(){_0x445a29[_0xaae5('0x18')](0xcc)[_0xaae5('0x19')]();})[_0xaae5('0x44')](handleError(_0x445a29,null));};function getBucketslist(_0x365abc,_0x2776fc,_0x6e615f){return new Promise(function(_0x3c1e04,_0x2184d6){var _0xa11a37=new AWS['S3']({'accessKeyId':_0x2776fc,'secretAccessKey':_0x365abc,'region':_0x6e615f});_0xa11a37[_0xaae5('0x67')]({},function(_0x10b79a,_0x5495e8){if(_0x10b79a){return _0x2184d6(_0x10b79a);}else{return _0x3c1e04(_0x5495e8);}});});}function createBucket(_0x8d40ed,_0x8cd4b5,_0x536745,_0x716028){return new Promise(function(_0x3cf82f,_0x31cc5e){var _0xf45fff=new AWS['S3']({'accessKeyId':_0x8cd4b5,'secretAccessKey':_0x8d40ed,'region':_0x536745});_0xf45fff['createBucket']({'Bucket':_0x716028},function(_0x14de6c,_0x3dc90a){if(_0x14de6c){return _0x31cc5e(_0x14de6c);}else{return _0x3cf82f(_0x3dc90a);}});});}function uploadFile(_0x33403c,_0x4b55fe,_0x3d6ec8,_0x365724,_0x20ec05,_0xd9f51d){return new Promise(function(_0x278712,_0x4e2b26){var _0x4efa14=new AWS['S3']({'accessKeyId':_0x4b55fe,'secretAccessKey':_0x33403c,'region':_0x3d6ec8});_0x4efa14[_0xaae5('0x68')]({'Bucket':_0x365724,'Key':_0x20ec05,'Body':_0xd9f51d},function(_0x5bd35f,_0x1f0f8a){if(_0x5bd35f){return _0x4e2b26(_0x5bd35f);}else{return _0x278712(_0x1f0f8a);}});});}function startTranscribe(_0x2bccb4,_0x2a585b,_0xd645fd,_0x2b4394,_0x3d59e9,_0x341bc7){return new Promise(function(_0x1f828a,_0x8036fd){var _0x31e0d1=new AWS[(_0xaae5('0x69'))]({'accessKeyId':_0x2a585b,'secretAccessKey':_0x2bccb4,'region':_0xd645fd});_0x31e0d1[_0xaae5('0x6a')]({'TranscriptionJobName':_0x2b4394,'LanguageCode':_0x3d59e9,'Media':{'MediaFileUri':_0x341bc7}},function(_0x1d78cc,_0x2c2e87){if(_0x1d78cc){return _0x8036fd(_0x1d78cc);}else{return _0x1f828a(_0x2c2e87);}});});}function transcribe(_0x599b9e,_0x12f6b9,_0x33ec15,_0x22647f,_0x8d74b0,_0x3a1e65,_0x47ebdd){return new Promise(function(_0x21053c,_0x24adc5){var _0x49a509={};logger[_0xaae5('0x62')](util['format'](_0xaae5('0x6b'),_0x599b9e,_0x8d74b0));return uploadFile(_0x12f6b9,_0x33ec15,_0x22647f,_0x8d74b0,path[_0xaae5('0x6c')](_0x3a1e65),fs[_0xaae5('0x6d')](_0x3a1e65))[_0xaae5('0x25')](function(_0x55053f){logger[_0xaae5('0x62')](util[_0xaae5('0x31')](_0xaae5('0x6e'),_0x599b9e,_0x8d74b0,_0x55053f[_0xaae5('0x6f')]));_0x49a509[_0xaae5('0x70')]=_0x55053f[_0xaae5('0x71')];_0x49a509[_0xaae5('0x72')]=_0x55053f['Location'];logger[_0xaae5('0x62')](util['format'](_0xaae5('0x73'),_0x599b9e));return startTranscribe(_0x12f6b9,_0x33ec15,_0x22647f,uuidv4(),_0x47ebdd,_0x55053f[_0xaae5('0x6f')]);})['then'](function(_0x34c416){logger['info'](util[_0xaae5('0x31')](_0xaae5('0x74'),_0x599b9e,_0x34c416[_0xaae5('0x75')][_0xaae5('0x76')]));_0x49a509['transcribeName']=_0x34c416[_0xaae5('0x75')][_0xaae5('0x76')];_0x49a509[_0xaae5('0x77')]=_0x34c416[_0xaae5('0x75')][_0xaae5('0x78')];return _0x21053c(_0x49a509);})['catch'](function(_0x46a579){return _0x24adc5(_0x46a579);});});}exports['runTranscribe']=function(_0x5653a9,_0x37664b,_0x23eae6){var _0x50463f;var _0x5ea84;var _0x5dbf4b;var _0x5f5a0e=require(_0xaae5('0x4d'));return db['VoiceRecording'][_0xaae5('0x79')]({'where':{'id':_0x5653a9[_0xaae5('0x46')]['id']}})[_0xaae5('0x25')](function(_0x574345){if(_0x574345){var _0x266514=util[_0xaae5('0x31')](_0xaae5('0x50'),_0x574345[_0xaae5('0x4f')]);if(fs[_0xaae5('0x51')](_0x266514)){cypher=!![];return _0x5f5a0e['decryptFile'](_0x266514,_0x574345['value'],config[_0xaae5('0x53')][_0xaae5('0x54')])[_0xaae5('0x25')](function(){return _0x574345;});}return _0x574345;}})[_0xaae5('0x25')](function(_0xb9013f){if(!_0xb9013f){throw new db[(_0xaae5('0x55'))]['ValidationError'](_0xaae5('0x7a'));}_0x5ea84=_0xb9013f;return db[_0xaae5('0x7b')]['findOne']({'where':{'id':0x1}});})[_0xaae5('0x25')](handleEntityNotFound(_0x37664b,null))[_0xaae5('0x25')](function(_0x337932){if(_0x337932){_0x50463f=_0x337932;if(!_0x50463f[_0xaae5('0x7c')]||!_0x50463f[_0xaae5('0x7d')]||!_0x50463f[_0xaae5('0x7e')]||!_0x50463f['language']||!_0x50463f['bucket']){throw new db[(_0xaae5('0x55'))][(_0xaae5('0x7f'))]('Transcribe\x20not\x20configured');}if(_0x5653a9[_0xaae5('0x4a')][_0xaae5('0x80')]&&(!_0x50463f[_0xaae5('0x81')]||!_0x50463f[_0xaae5('0x82')]||!_0x50463f['sentimentRegion']||!_0x50463f[_0xaae5('0x83')]||!_0x50463f['bucket'])){throw new db[(_0xaae5('0x55'))]['ValidationError'](_0xaae5('0x84'));}return db[_0xaae5('0x85')][_0xaae5('0x79')]({'where':{'id':_0x50463f[_0xaae5('0x7d')]}});}})[_0xaae5('0x25')](function(_0x3b784d){if(!_0x3b784d){throw new db[(_0xaae5('0x55'))][(_0xaae5('0x7f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3b784d[_0xaae5('0x86')]||!_0x3b784d[_0xaae5('0x87')]){throw new db[(_0xaae5('0x55'))][(_0xaae5('0x7f'))]('Cloud\x20Provider\x20not\x20configured');}_0x5dbf4b=_0x3b784d;return getBucketslist(_0x5dbf4b['data1'],_0x5dbf4b['data2'],_0x50463f[_0xaae5('0x7e')]);})['then'](function(_0x56e6de){if(_0x56e6de&&_0x56e6de[_0xaae5('0x88')]){var _0x2f64be=_['find'](_0x56e6de[_0xaae5('0x88')],function(_0x179c18){return _0x179c18[_0xaae5('0x89')]===_0x50463f['bucket'];});if(!_0x2f64be){logger['info'](util[_0xaae5('0x31')](_0xaae5('0x8a'),_0x5653a9['params']['id'],_0x50463f[_0xaae5('0x70')]));return createBucket(_0x5dbf4b[_0xaae5('0x86')],_0x5dbf4b['data2'],_0x50463f[_0xaae5('0x7e')],_0x50463f[_0xaae5('0x70')]);}logger[_0xaae5('0x62')](util[_0xaae5('0x31')](_0xaae5('0x8b'),_0x5653a9[_0xaae5('0x46')]['id'],_0x50463f[_0xaae5('0x70')]));return;}})['then'](function(_0x9b56c4){if(_0x5ea84[_0xaae5('0x77')]===_0xaae5('0x8c')){return transcribe(_0x5653a9[_0xaae5('0x46')]['id'],_0x5dbf4b['data1'],_0x5dbf4b[_0xaae5('0x87')],_0x50463f[_0xaae5('0x7e')],_0x50463f[_0xaae5('0x70')],_0x5ea84['value'],_0x50463f[_0xaae5('0x83')]);}else{logger[_0xaae5('0x62')](util[_0xaae5('0x31')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x5653a9[_0xaae5('0x46')]['id']));return{'transcribeStatus':_0xaae5('0x8d')};}})['then'](function(_0x58905b){if(_0x58905b){_0x58905b['tempSentiment']=_0x5653a9[_0xaae5('0x4a')][_0xaae5('0x80')];return _0x5ea84['updateAttributes'](_0x58905b);}})[_0xaae5('0x25')](respondWithResult(_0x37664b,null))[_0xaae5('0x44')](handleError(_0x37664b,null));};function writeFile(_0x47a3b0,_0x5e5623){return new Promise(function(_0x137eb6,_0x5ac1dc){fs[_0xaae5('0x8e')](_0x5e5623,_0x47a3b0,function(_0x4763b0,_0x560dde){if(_0x4763b0){return _0x5ac1dc(_0x4763b0);}else{return _0x137eb6(_0x560dde);}});});}exports[_0xaae5('0x8f')]=function(_0x37ba95,_0x359007,_0x1aa638){return db[_0xaae5('0x2a')][_0xaae5('0x79')]({'where':{'id':_0x37ba95[_0xaae5('0x46')]['id']}})['then'](handleEntityNotFound(_0x359007))[_0xaae5('0x25')](function(_0x8a679c){if(_0x8a679c&&_0x8a679c['fileText']){var _0x18519b=_0x8a679c['fileText'];var _0x244c89=config[_0xaae5('0x90')]+_0xaae5('0x91')+_0x8a679c['id']+'.txt';if(fs[_0xaae5('0x51')](_0x244c89)){return _0x244c89;}return writeFile(_0x18519b,_0x244c89)[_0xaae5('0x25')](function(){return _0x244c89;});}else{throw new db[(_0xaae5('0x55'))][(_0xaae5('0x7f'))](_0xaae5('0x92'));}})[_0xaae5('0x25')](function(_0x2f14a8){return _0x359007[_0xaae5('0x4c')](_0x2f14a8);})[_0xaae5('0x44')](handleError(_0x359007));}; \ No newline at end of file +var _0xe81c=['transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','VoiceRecording','includeAll','include','findAll','rows','catch','params','length','find','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','format','secrets','Sequelize','extname','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[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','transcribeName','TranscriptionJobName','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe'];(function(_0x5ce1b5,_0x1db168){var _0xfe0245=function(_0x26f66c){while(--_0x26f66c){_0x5ce1b5['push'](_0x5ce1b5['shift']());}};_0xfe0245(++_0x1db168);}(_0xe81c,0x1de));var _0xce81=function(_0x2a75cd,_0x247962){_0x2a75cd=_0x2a75cd-0x0;var _0x2319bc=_0xe81c[_0x2a75cd];return _0x2319bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce81('0x0'));var zipdir=require(_0xce81('0x1'));var jsonpatch=require(_0xce81('0x2'));var rp=require(_0xce81('0x3'));var moment=require(_0xce81('0x4'));var BPromise=require(_0xce81('0x5'));var Mustache=require('mustache');var util=require(_0xce81('0x6'));var path=require(_0xce81('0x7'));var sox=require(_0xce81('0x8'));var csv=require(_0xce81('0x9'));var ejs=require(_0xce81('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce81('0xb'));var squel=require('squel');var crypto=require(_0xce81('0xc'));var jsforce=require(_0xce81('0xd'));var deskjs=require(_0xce81('0xe'));var toCsv=require('to-csv');var querystring=require(_0xce81('0xf'));var Papa=require('papaparse');var AWS=require(_0xce81('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xce81('0x11'));var authService=require(_0xce81('0x12'));var qs=require(_0xce81('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce81('0x14'));var logger=require(_0xce81('0x15'))(_0xce81('0x16'));var utils=require(_0xce81('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xce81('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a3079,_0x3f82e0){_0x3f82e0=_0x3f82e0||0xcc;return function(_0x351e46){if(_0x351e46){return _0x4a3079[_0xce81('0x19')](_0x3f82e0);}return _0x4a3079[_0xce81('0x1a')](_0x3f82e0)[_0xce81('0x1b')]();};}function respondWithResult(_0x1846f7,_0x54d27c){_0x54d27c=_0x54d27c||0xc8;return function(_0x38a7a1){if(_0x38a7a1){return _0x1846f7[_0xce81('0x1a')](_0x54d27c)['json'](_0x38a7a1);}};}function respondWithFilteredResult(_0x494d11,_0x1185d3){return function(_0x41f79c){if(_0x41f79c){var _0x9814e2=typeof _0x1185d3['offset']===_0xce81('0x1c')&&typeof _0x1185d3[_0xce81('0x1d')]===_0xce81('0x1c');var _0x47f2cb=_0x41f79c['count'];var _0x57cd3f=_0x9814e2?0x0:_0x1185d3[_0xce81('0x1e')];var _0x3171d6=_0x9814e2?_0x41f79c[_0xce81('0x1f')]:_0x1185d3[_0xce81('0x1e')]+_0x1185d3[_0xce81('0x1d')];var _0x4e6696;if(_0x3171d6>=_0x47f2cb){_0x3171d6=_0x47f2cb;_0x4e6696=0xc8;}else{_0x4e6696=0xce;}_0x494d11[_0xce81('0x1a')](_0x4e6696);return _0x494d11[_0xce81('0x20')](_0xce81('0x21'),_0x57cd3f+'-'+_0x3171d6+'/'+_0x47f2cb)[_0xce81('0x22')](_0x41f79c);}return null;};}function patchUpdates(_0x39f497){return function(_0x3351fa){try{jsonpatch[_0xce81('0x23')](_0x3351fa,_0x39f497,!![]);}catch(_0xa5a1f5){return BPromise[_0xce81('0x24')](_0xa5a1f5);}return _0x3351fa[_0xce81('0x25')]();};}function saveUpdates(_0x520252,_0x531cd9){return function(_0x4c5156){if(_0x4c5156){return _0x4c5156[_0xce81('0x26')](_0x520252)[_0xce81('0x27')](function(_0x375c0d){return _0x375c0d;});}return null;};}function removeEntity(_0x3032ff,_0x4afbd7){return function(_0x4a0dcd){if(_0x4a0dcd){return _0x4a0dcd[_0xce81('0x28')]()[_0xce81('0x27')](function(){_0x3032ff['status'](0xcc)[_0xce81('0x1b')]();});}};}function handleEntityNotFound(_0x273326,_0x4847b8){return function(_0x21747a){if(!_0x21747a){_0x273326[_0xce81('0x19')](0x194);}return _0x21747a;};}function handleError(_0x11f9db,_0x5e4200){_0x5e4200=_0x5e4200||0x1f4;return function(_0x551960){logger[_0xce81('0x29')](_0x551960['stack']);if(_0x551960[_0xce81('0x2a')]){delete _0x551960[_0xce81('0x2a')];}_0x11f9db[_0xce81('0x1a')](_0x5e4200)[_0xce81('0x2b')](_0x551960);};}exports['index']=function(_0x2f7519,_0x4d78a4){var _0x10ccff={},_0x466b71={},_0x1fe6e1={'count':0x0,'rows':[]};var _0x581128=_[_0xce81('0x2c')](db['VoiceRecording'][_0xce81('0x2d')],function(_0x493b6e){return{'name':_0x493b6e[_0xce81('0x2e')],'type':_0x493b6e[_0xce81('0x2f')][_0xce81('0x30')]};});_0x466b71['model']=_[_0xce81('0x31')](_[_0xce81('0x2c')](_0x581128,_0xce81('0x2a')),['format']);_0x466b71[_0xce81('0x32')]=_[_0xce81('0x33')](_0x2f7519[_0xce81('0x32')]);_0x466b71[_0xce81('0x34')]=_[_0xce81('0x35')](_0x466b71[_0xce81('0x36')],_0x466b71['query']);_0x10ccff[_0xce81('0x37')]=_['intersection'](_0x466b71[_0xce81('0x36')],qs[_0xce81('0x38')](_0x2f7519['query'][_0xce81('0x38')]));_0x10ccff[_0xce81('0x37')]=_0x10ccff[_0xce81('0x37')]['length']?_0x10ccff[_0xce81('0x37')]:_0x466b71[_0xce81('0x36')];if(!_0x2f7519[_0xce81('0x32')]['hasOwnProperty'](_0xce81('0x39'))){_0x10ccff[_0xce81('0x1d')]=qs[_0xce81('0x1d')](_0x2f7519['query']['limit']);_0x10ccff[_0xce81('0x1e')]=qs[_0xce81('0x1e')](_0x2f7519[_0xce81('0x32')][_0xce81('0x1e')]);}_0x10ccff[_0xce81('0x3a')]=qs[_0xce81('0x3b')](_0x2f7519[_0xce81('0x32')]['sort']);_0x10ccff[_0xce81('0x3c')]=qs[_0xce81('0x34')](_[_0xce81('0x3d')](_0x2f7519[_0xce81('0x32')],_0x466b71[_0xce81('0x34')]),_0x581128);if(_0x2f7519[_0xce81('0x32')][_0xce81('0x3e')]){_0x10ccff[_0xce81('0x3c')]=_[_0xce81('0x3f')](_0x10ccff['where'],{'$or':_['map'](_0x581128,function(_0xe40d7){if(_0xe40d7[_0xce81('0x2f')]!=='VIRTUAL'){var _0x4f3030={};_0x4f3030[_0xe40d7[_0xce81('0x2a')]]={'$like':'%'+_0x2f7519[_0xce81('0x32')][_0xce81('0x3e')]+'%'};return _0x4f3030;}})});}_0x10ccff=_[_0xce81('0x3f')]({},_0x10ccff,_0x2f7519[_0xce81('0x40')]);var _0x19bdb0={'where':_0x10ccff[_0xce81('0x3c')]};return db[_0xce81('0x41')][_0xce81('0x1f')](_0x19bdb0)[_0xce81('0x27')](function(_0x4cbc24){_0x1fe6e1['count']=_0x4cbc24;if(_0x2f7519['query'][_0xce81('0x42')]){_0x10ccff[_0xce81('0x43')]=[{'all':!![]}];}return db['VoiceRecording'][_0xce81('0x44')](_0x10ccff);})['then'](function(_0x265d7c){_0x1fe6e1[_0xce81('0x45')]=_0x265d7c;return _0x1fe6e1;})['then'](respondWithFilteredResult(_0x4d78a4,_0x10ccff))[_0xce81('0x46')](handleError(_0x4d78a4,null));};exports['show']=function(_0x439806,_0x5423c2){var _0x131149={'raw':![],'where':{'id':_0x439806[_0xce81('0x47')]['id']}},_0x436e2e={};_0x436e2e['model']=_[_0xce81('0x33')](db[_0xce81('0x41')][_0xce81('0x2d')]);_0x436e2e['query']=_[_0xce81('0x33')](_0x439806[_0xce81('0x32')]);_0x436e2e[_0xce81('0x34')]=_['intersection'](_0x436e2e[_0xce81('0x36')],_0x436e2e[_0xce81('0x32')]);_0x131149[_0xce81('0x37')]=_[_0xce81('0x35')](_0x436e2e[_0xce81('0x36')],qs['fields'](_0x439806[_0xce81('0x32')][_0xce81('0x38')]));_0x131149[_0xce81('0x37')]=_0x131149[_0xce81('0x37')][_0xce81('0x48')]?_0x131149[_0xce81('0x37')]:_0x436e2e[_0xce81('0x36')];if(_0x439806[_0xce81('0x32')][_0xce81('0x42')]){_0x131149[_0xce81('0x43')]=[{'all':!![]}];}_0x131149=_[_0xce81('0x3f')]({},_0x131149,_0x439806[_0xce81('0x40')]);return db[_0xce81('0x41')][_0xce81('0x49')](_0x131149)[_0xce81('0x27')](handleEntityNotFound(_0x5423c2,null))['then'](respondWithResult(_0x5423c2,null))[_0xce81('0x46')](handleError(_0x5423c2,null));};exports['create']=function(_0x369acf,_0x31a5bf){return db[_0xce81('0x41')]['create'](_0x369acf['body'],{})[_0xce81('0x27')](respondWithResult(_0x31a5bf,0xc9))['catch'](handleError(_0x31a5bf,null));};exports[_0xce81('0x26')]=function(_0x58bae7,_0x822b71){if(_0x58bae7[_0xce81('0x4a')]['id']){delete _0x58bae7[_0xce81('0x4a')]['id'];}return db[_0xce81('0x41')]['find']({'where':{'id':_0x58bae7['params']['id']}})[_0xce81('0x27')](handleEntityNotFound(_0x822b71,null))[_0xce81('0x27')](saveUpdates(_0x58bae7[_0xce81('0x4a')],null))[_0xce81('0x27')](respondWithResult(_0x822b71,null))[_0xce81('0x46')](handleError(_0x822b71,null));};exports['describe']=function(_0x4a0dcc,_0x1de1ee){return db[_0xce81('0x41')][_0xce81('0x4b')]()['then'](respondWithResult(_0x1de1ee,null))['catch'](handleError(_0x1de1ee,null));};exports[_0xce81('0x4c')]=function(_0x474256,_0x39f51f,_0x16f238){var _0x4512d7=require(_0xce81('0x4d'));var _0x175215=![];var _0x5b5230={};if(_0x474256[_0xce81('0x32')][_0xce81('0x2f')]&&_0x474256[_0xce81('0x32')]['type']===_0xce81('0x4e')){_0x5b5230[_0xce81('0x4e')]=_0x474256[_0xce81('0x47')]['id'];}else{_0x5b5230['id']=_0x474256[_0xce81('0x47')]['id'];}return db[_0xce81('0x41')][_0xce81('0x49')]({'where':_0x5b5230,'attributes':['id',_0xce81('0x4f')],'raw':!![]})[_0xce81('0x27')](handleEntityNotFound(_0x39f51f,null))[_0xce81('0x27')](function(_0x5f30c4){if(_0x5f30c4){var _0x39105f=_0x5f30c4['value'];var _0x20682f=util['format'](_0xce81('0x50'),_0x39105f);if(fs[_0xce81('0x51')](_0x20682f)){_0x175215=!![];return _0x4512d7[_0xce81('0x52')](_0x20682f,_0x39105f,config['secrets'][_0xce81('0x53')])[_0xce81('0x27')](function(){return _0x5f30c4;});}return _0x5f30c4;}})['then'](function(_0x127853){if(_0x127853){var _0x25ac35=_0x127853[_0xce81('0x4f')];if(!fs[_0xce81('0x51')](_0x25ac35)){throw new db['Sequelize'][(_0xce81('0x54'))](_0xce81('0x55'));}if(_0x127853[_0xce81('0x56')]){return _0x39f51f[_0xce81('0x4c')](_0x25ac35,_0x127853[_0xce81('0x56')]+path['extname'](_0x25ac35),function(){if(_0x175215){fs['unlink'](_0x25ac35);}});}else{return _0x39f51f[_0xce81('0x4c')](_0x25ac35,function(_0x2ef519){if(_0x175215){fs[_0xce81('0x57')](_0x25ac35);}});}}})[_0xce81('0x46')](function(_0x2e7569){if(_0x2e7569[_0xce81('0x58')]==='VoiceRecording\x20not\x20found'){_0x39f51f[_0xce81('0x1a')](0x194)['send'](_0xce81('0x59'));}else{return handleError(_0x39f51f,null);}});};exports[_0xce81('0x5a')]=function(_0x319f19,_0x1b1a43,_0x11ecef){var _0xa9e6c3=require(_0xce81('0x4d'));var _0x2dd35a=![];var _0x3e4a2d={'$and':[db[_0xce81('0x5b')][_0xce81('0x3c')](db[_0xce81('0x5b')]['fn'](_0xce81('0x5c'),db['sequelize'][_0xce81('0x5d')](_0xce81('0x4e'))),_0x319f19[_0xce81('0x32')][_0xce81('0x5e')])]};if(_0x319f19[_0xce81('0x32')][_0xce81('0x2f')]&&_0x319f19['query'][_0xce81('0x2f')]===_0xce81('0x4e')){_0x3e4a2d[_0xce81('0x5f')][_0xce81('0x60')]({'uniqueid':_0x319f19['params']['id']});}else{_0x3e4a2d[_0xce81('0x5f')]['push']({'id':_0x319f19[_0xce81('0x47')]['id']});}return db[_0xce81('0x41')][_0xce81('0x49')]({'where':_0x3e4a2d,'attributes':['id','value'],'raw':!![]})[_0xce81('0x27')](handleEntityNotFound(_0x1b1a43,null))['then'](function(_0x9e052a){if(_0x9e052a){var _0x1b2253=util[_0xce81('0x61')](_0xce81('0x50'),_0x9e052a[_0xce81('0x4f')]);if(fs[_0xce81('0x51')](_0x1b2253)){_0x2dd35a=!![];return _0xa9e6c3['decryptFile'](_0x1b2253,_0x9e052a[_0xce81('0x4f')],config[_0xce81('0x62')][_0xce81('0x53')])[_0xce81('0x27')](function(){return _0x9e052a;});}return _0x9e052a;}})[_0xce81('0x27')](function(_0x845e17){if(_0x845e17){if(!fs['existsSync'](_0x845e17[_0xce81('0x4f')])){throw new db[(_0xce81('0x63'))][(_0xce81('0x54'))](_0xce81('0x55'));}if(_0x845e17[_0xce81('0x56')]){return _0x1b1a43[_0xce81('0x4c')](_0x845e17[_0xce81('0x4f')],_0x845e17[_0xce81('0x56')]+path[_0xce81('0x64')](_0x845e17['value']),function(){if(_0x2dd35a){fs[_0xce81('0x57')](_0x845e17[_0xce81('0x4f')]);}});}else{return _0x1b1a43[_0xce81('0x4c')](_0x845e17[_0xce81('0x4f')],function(_0x4f0666){if(_0x2dd35a){fs[_0xce81('0x57')](_0x845e17['value']);}});}}})[_0xce81('0x46')](handleError(_0x1b1a43,null));};exports[_0xce81('0x28')]=function(_0x12c26c,_0x2916d9){return db[_0xce81('0x41')][_0xce81('0x49')]({'where':{'id':_0x12c26c['params']['id']}})[_0xce81('0x27')](function(_0x3dff1f){if(_['isNil'](_0x3dff1f)){throw new ReferenceError(_0xce81('0x65'));}return _0x3dff1f;})['then'](function(_0x2dee25){var _0x1cb72f=_0x2dee25[_0xce81('0x4f')];logger[_0xce81('0x66')](_0xce81('0x67'),_0x1cb72f);if(!_[_0xce81('0x68')](_0x2dee25[_0xce81('0x4f')])&&fs[_0xce81('0x51')](_0x1cb72f)){logger[_0xce81('0x66')](_0xce81('0x69')+_0x1cb72f+_0xce81('0x6a'));fs[_0xce81('0x6b')](_0x1cb72f);}_0x1cb72f=_0x1cb72f+'.cypher';if(!_[_0xce81('0x68')](_0x2dee25[_0xce81('0x4f')])&&fs[_0xce81('0x51')](_0x1cb72f)){logger[_0xce81('0x66')]('File:\x20\x22'+_0x1cb72f+_0xce81('0x6a'));fs[_0xce81('0x6b')](_0x1cb72f);}return _0x2dee25;})['then'](function(_0xe9f9a2){if(!_0xe9f9a2)throw new InternalError();return _0xe9f9a2['destroy']();})[_0xce81('0x27')](function(){_0x2916d9['status'](0xcc)['end']();})[_0xce81('0x46')](handleError(_0x2916d9,null));};function getBucketslist(_0x11573e,_0x52141b,_0x4ebb3a){return new Promise(function(_0x4a9c7d,_0x20437d){var _0x2753c4=new AWS['S3']({'accessKeyId':_0x52141b,'secretAccessKey':_0x11573e,'region':_0x4ebb3a});_0x2753c4[_0xce81('0x6c')]({},function(_0x256a73,_0x49c0e8){if(_0x256a73){return _0x20437d(_0x256a73);}else{return _0x4a9c7d(_0x49c0e8);}});});}function createBucket(_0x335de2,_0x4518ea,_0x5aac92,_0x40f5f6){return new Promise(function(_0x5007ca,_0x292e03){var _0x1d5779=new AWS['S3']({'accessKeyId':_0x4518ea,'secretAccessKey':_0x335de2,'region':_0x5aac92});_0x1d5779[_0xce81('0x6d')]({'Bucket':_0x40f5f6},function(_0x49641e,_0x4bee37){if(_0x49641e){return _0x292e03(_0x49641e);}else{return _0x5007ca(_0x4bee37);}});});}function uploadFile(_0xe8d6c4,_0x819bd7,_0x1129c0,_0x2c7294,_0x390079,_0x1cdb49){return new Promise(function(_0xc30729,_0x367f88){var _0x56c3ad=new AWS['S3']({'accessKeyId':_0x819bd7,'secretAccessKey':_0xe8d6c4,'region':_0x1129c0});_0x56c3ad[_0xce81('0x6e')]({'Bucket':_0x2c7294,'Key':_0x390079,'Body':_0x1cdb49},function(_0x3932e0,_0x306cc0){if(_0x3932e0){return _0x367f88(_0x3932e0);}else{return _0xc30729(_0x306cc0);}});});}function startTranscribe(_0x5a6bb0,_0x4db8d5,_0x48ff38,_0x1ca56f,_0x3a244d,_0x1717de){return new Promise(function(_0x3716b3,_0x553693){var _0x3ad0f3=new AWS['TranscribeService']({'accessKeyId':_0x4db8d5,'secretAccessKey':_0x5a6bb0,'region':_0x48ff38});_0x3ad0f3[_0xce81('0x6f')]({'TranscriptionJobName':_0x1ca56f,'LanguageCode':_0x3a244d,'Media':{'MediaFileUri':_0x1717de}},function(_0x33fb85,_0x1faa79){if(_0x33fb85){return _0x553693(_0x33fb85);}else{return _0x3716b3(_0x1faa79);}});});}function transcribe(_0x3bb61b,_0x163a58,_0x1373e1,_0x370b57,_0x1af1fe,_0x424e01,_0x3bf779){return new Promise(function(_0x2a622c,_0xf56dd){var _0x4eee6e={};logger[_0xce81('0x66')](util[_0xce81('0x61')](_0xce81('0x70'),_0x3bb61b,_0x1af1fe));return uploadFile(_0x163a58,_0x1373e1,_0x370b57,_0x1af1fe,path['basename'](_0x424e01),fs['readFileSync'](_0x424e01))[_0xce81('0x27')](function(_0x1f7786){logger[_0xce81('0x66')](util[_0xce81('0x61')](_0xce81('0x71'),_0x3bb61b,_0x1af1fe,_0x1f7786[_0xce81('0x72')]));_0x4eee6e['bucket']=_0x1f7786[_0xce81('0x73')];_0x4eee6e[_0xce81('0x74')]=_0x1f7786[_0xce81('0x72')];logger[_0xce81('0x66')](util[_0xce81('0x61')](_0xce81('0x75'),_0x3bb61b));return startTranscribe(_0x163a58,_0x1373e1,_0x370b57,uuidv4(),_0x3bf779,_0x1f7786[_0xce81('0x72')]);})['then'](function(_0x5b050c){logger[_0xce81('0x66')](util[_0xce81('0x61')](_0xce81('0x76'),_0x3bb61b,_0x5b050c[_0xce81('0x77')]['TranscriptionJobName']));_0x4eee6e[_0xce81('0x78')]=_0x5b050c[_0xce81('0x77')][_0xce81('0x79')];_0x4eee6e['transcribeStatus']=_0x5b050c[_0xce81('0x77')]['TranscriptionJobStatus'];return _0x2a622c(_0x4eee6e);})[_0xce81('0x46')](function(_0x49216b){return _0xf56dd(_0x49216b);});});}exports['runTranscribe']=function(_0x2893f6,_0x3a5255,_0x5d4fac){var _0x422d0d;var _0xaad4df;var _0x16c115;var _0xc5780c=require(_0xce81('0x4d'));return db[_0xce81('0x41')][_0xce81('0x7a')]({'where':{'id':_0x2893f6[_0xce81('0x47')]['id']}})[_0xce81('0x27')](function(_0x2e920f){if(_0x2e920f){var _0x1bb60d=util[_0xce81('0x61')](_0xce81('0x50'),_0x2e920f[_0xce81('0x4f')]);if(fs[_0xce81('0x51')](_0x1bb60d)){cypher=!![];return _0xc5780c[_0xce81('0x52')](_0x1bb60d,_0x2e920f[_0xce81('0x4f')],config['secrets'][_0xce81('0x53')])['then'](function(){return _0x2e920f;});}return _0x2e920f;}})['then'](function(_0x4ad082){if(!_0x4ad082){throw new db['Sequelize'][(_0xce81('0x54'))](_0xce81('0x7b'));}_0xaad4df=_0x4ad082;return db[_0xce81('0x7c')][_0xce81('0x7a')]({'where':{'id':0x1}});})[_0xce81('0x27')](handleEntityNotFound(_0x3a5255,null))['then'](function(_0x35d375){if(_0x35d375){_0x422d0d=_0x35d375;if(!_0x422d0d[_0xce81('0x7d')]||!_0x422d0d[_0xce81('0x7e')]||!_0x422d0d[_0xce81('0x7f')]||!_0x422d0d[_0xce81('0x80')]||!_0x422d0d[_0xce81('0x81')]){throw new db['Sequelize'][(_0xce81('0x54'))]('Transcribe\x20not\x20configured');}if(_0x2893f6[_0xce81('0x4a')][_0xce81('0x82')]&&(!_0x422d0d[_0xce81('0x83')]||!_0x422d0d['sentimentAccountId']||!_0x422d0d[_0xce81('0x84')]||!_0x422d0d[_0xce81('0x80')]||!_0x422d0d[_0xce81('0x81')])){throw new db[(_0xce81('0x63'))][(_0xce81('0x54'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xce81('0x85')][_0xce81('0x7a')]({'where':{'id':_0x422d0d[_0xce81('0x7e')]}});}})[_0xce81('0x27')](function(_0x3bbada){if(!_0x3bbada){throw new db[(_0xce81('0x63'))][(_0xce81('0x54'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3bbada['data1']||!_0x3bbada['data2']){throw new db[(_0xce81('0x63'))][(_0xce81('0x54'))](_0xce81('0x86'));}_0x16c115=_0x3bbada;return getBucketslist(_0x16c115['data1'],_0x16c115['data2'],_0x422d0d[_0xce81('0x7f')]);})[_0xce81('0x27')](function(_0x22e7d7){if(_0x22e7d7&&_0x22e7d7[_0xce81('0x87')]){var _0x36c64b=_[_0xce81('0x49')](_0x22e7d7[_0xce81('0x87')],function(_0x4e175e){return _0x4e175e['Name']===_0x422d0d['bucket'];});if(!_0x36c64b){logger[_0xce81('0x66')](util['format'](_0xce81('0x88'),_0x2893f6[_0xce81('0x47')]['id'],_0x422d0d[_0xce81('0x81')]));return createBucket(_0x16c115[_0xce81('0x89')],_0x16c115[_0xce81('0x8a')],_0x422d0d[_0xce81('0x7f')],_0x422d0d[_0xce81('0x81')]);}logger[_0xce81('0x66')](util[_0xce81('0x61')](_0xce81('0x8b'),_0x2893f6[_0xce81('0x47')]['id'],_0x422d0d[_0xce81('0x81')]));return;}})[_0xce81('0x27')](function(_0x2be794){if(_0xaad4df[_0xce81('0x8c')]===_0xce81('0x8d')){return transcribe(_0x2893f6['params']['id'],_0x16c115[_0xce81('0x89')],_0x16c115['data2'],_0x422d0d[_0xce81('0x7f')],_0x422d0d['bucket'],_0xaad4df[_0xce81('0x4f')],_0x422d0d[_0xce81('0x80')]);}else{logger[_0xce81('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x2893f6[_0xce81('0x47')]['id']));return{'transcribeStatus':_0xce81('0x8e')};}})['then'](function(_0x5473fd){if(_0x5473fd){_0x5473fd[_0xce81('0x8f')]=_0x2893f6[_0xce81('0x4a')][_0xce81('0x82')];return _0xaad4df[_0xce81('0x90')](_0x5473fd);}})[_0xce81('0x27')](respondWithResult(_0x3a5255,null))['catch'](handleError(_0x3a5255,null));};function writeFile(_0xc78001,_0x12b014){return new Promise(function(_0xfe353d,_0x58cad8){fs[_0xce81('0x91')](_0x12b014,_0xc78001,function(_0x5d4b77,_0x198830){if(_0x5d4b77){return _0x58cad8(_0x5d4b77);}else{return _0xfe353d(_0x198830);}});});}exports[_0xce81('0x92')]=function(_0x898f71,_0xd16324,_0x252023){return db[_0xce81('0x41')][_0xce81('0x7a')]({'where':{'id':_0x898f71[_0xce81('0x47')]['id']}})[_0xce81('0x27')](handleEntityNotFound(_0xd16324))[_0xce81('0x27')](function(_0x4c2cd7){if(_0x4c2cd7&&_0x4c2cd7['fileText']){var _0x1f58d6=_0x4c2cd7[_0xce81('0x93')];var _0x491ccd=config['root']+_0xce81('0x94')+_0x4c2cd7['id']+_0xce81('0x95');if(fs[_0xce81('0x51')](_0x491ccd)){return _0x491ccd;}return writeFile(_0x1f58d6,_0x491ccd)[_0xce81('0x27')](function(){return _0x491ccd;});}else{throw new db[(_0xce81('0x63'))][(_0xce81('0x54'))](_0xce81('0x96'));}})[_0xce81('0x27')](function(_0x3d3356){return _0xd16324[_0xce81('0x4c')](_0x3d3356);})['catch'](handleError(_0xd16324));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 3994e3a..94b398e 100644 --- a/server/api/voiceRecording/voiceRecording.model.js +++ b/server/api/voiceRecording/voiceRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x330c=['./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','transcribeStatus'];(function(_0xe59cff,_0x1a7dbe){var _0x26e8c1=function(_0x6a95cc){while(--_0x6a95cc){_0xe59cff['push'](_0xe59cff['shift']());}};_0x26e8c1(++_0x1a7dbe);}(_0x330c,0x186));var _0xc330=function(_0xe4bd12,_0x75f8a3){_0xe4bd12=_0xe4bd12-0x0;var _0x5943f2=_0x330c[_0xe4bd12];return _0x5943f2;};'use strict';var attributes=require(_0xc330('0x0'));module[_0xc330('0x1')]=function(_0x38be68,_0x3fadcd){return _0x38be68['define'](_0xc330('0x2'),attributes,{'tableName':_0xc330('0x3'),'paranoid':![],'indexes':[{'name':_0xc330('0x4'),'fields':[_0xc330('0x4')]},{'name':_0xc330('0x5'),'fields':[_0xc330('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x03ce=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','VoiceRecording'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x03ce,0x1a1));var _0xe03c=function(_0x1f0448,_0xa2865f){_0x1f0448=_0x1f0448-0x0;var _0x16fe78=_0x03ce[_0x1f0448];return _0x16fe78;};'use strict';var attributes=require(_0xe03c('0x0'));module[_0xe03c('0x1')]=function(_0x237c84,_0x4ca1c8){return _0x237c84['define'](_0xe03c('0x2'),attributes,{'tableName':_0xe03c('0x3'),'paranoid':![],'indexes':[{'name':_0xe03c('0x4'),'fields':['uniqueid']},{'name':_0xe03c('0x5'),'fields':[_0xe03c('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 85e255d..91e2b55 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb145=['info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','VoiceRecording,\x20%s,\x20%s','message','result','catch','VoiceRecording','update','body','options','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','then','create','existsSync','format','value','encryptFile','recording','unlink','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb145,0xa3));var _0x5b14=function(_0x15852c,_0x1dce96){_0x15852c=_0x15852c-0x0;var _0x53835d=_0xb145[_0x15852c];return _0x53835d;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});}exports['UpdateVoiceRecording']=function(_0x48d395){var _0x58bf3c=this;return new Promise(function(_0x3f397d,_0x3035b5){return db[_0x5b14('0x17')][_0x5b14('0x18')](_0x48d395[_0x5b14('0x19')],{'raw':_0x48d395[_0x5b14('0x1a')]?_0x48d395[_0x5b14('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48d395['options']?_0x48d395['options'][_0x5b14('0x1b')]||null:null,'attributes':_0x48d395[_0x5b14('0x1a')]?_0x48d395[_0x5b14('0x1a')][_0x5b14('0x1c')]||null:null,'limit':_0x48d395['options']?_0x48d395[_0x5b14('0x1a')][_0x5b14('0x1d')]||null:null})['then'](function(_0x2d7b38){logger[_0x5b14('0xd')]('UpdateVoiceRecording',_0x48d395);logger[_0x5b14('0xf')]('UpdateVoiceRecording',_0x48d395,JSON['stringify'](_0x2d7b38));_0x3f397d(_0x2d7b38);})['catch'](function(_0x4def4b){logger[_0x5b14('0x12')](_0x5b14('0x1e'),_0x4def4b[_0x5b14('0x14')],_0x48d395);_0x3035b5(_0x58bf3c['error'](0x1f4,_0x4def4b[_0x5b14('0x14')]));});});};exports[_0x5b14('0x1f')]=function(_0x2ac7b0){var _0x143648=this;return new Promise(function(_0xe6851b,_0x1bbbd7){var _0x422d22=require(_0x5b14('0x20'));var _0x296d65;return db[_0x5b14('0x21')][_0x5b14('0x22')]({'attributes':['id',_0x5b14('0x23')],'where':{'id':0x1},'raw':!![]})[_0x5b14('0x24')](function(_0x266bbe){_0x296d65=_0x266bbe;return db['VoiceRecording'][_0x5b14('0x25')](_0x2ac7b0[_0x5b14('0x19')]);})['then'](function(_0x4ecf7c){if(_0x296d65[_0x5b14('0x23')]&&fs[_0x5b14('0x26')](_0x4ecf7c['value'])){var _0x4c1f0e=util[_0x5b14('0x27')]('%s.cypher',_0x4ecf7c[_0x5b14('0x28')]);return _0x422d22[_0x5b14('0x29')](_0x4ecf7c['value'],_0x4c1f0e,config['secrets'][_0x5b14('0x2a')])[_0x5b14('0x24')](function(){fs[_0x5b14('0x2b')](_0x4ecf7c['value']);logger[_0x5b14('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x4ecf7c;});}return _0x4ecf7c;})[_0x5b14('0x24')](function(_0x291c92){logger[_0x5b14('0xd')](_0x5b14('0x1f'),_0x2ac7b0);logger['debug'](_0x5b14('0x1f'),_0x2ac7b0,JSON[_0x5b14('0x11')](_0x291c92));_0xe6851b(_0x291c92);})[_0x5b14('0x16')](function(_0x37f62c){logger['error'](_0x5b14('0x1f'),_0x37f62c[_0x5b14('0x14')],_0x2ac7b0);_0x1bbbd7(_0x143648[_0x5b14('0x12')](0x1f4,_0x37f62c['message']));});});}; \ No newline at end of file +var _0x2da6=['stringify','error','code','message','result','catch','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x58bed5,_0x14f5d4){var _0x59a047=function(_0x470fe6){while(--_0x470fe6){_0x58bed5['push'](_0x58bed5['shift']());}};_0x59a047(++_0x14f5d4);}(_0x2da6,0x1dd));var _0x62da=function(_0x943e7,_0x200b5e){_0x943e7=_0x943e7-0x0;var _0x2c7431=_0x2da6[_0x943e7];return _0x2c7431;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});}exports['UpdateVoiceRecording']=function(_0xa7050b){var _0x4ae4fb=this;return new Promise(function(_0x4d6482,_0x264366){return db[_0x62da('0x18')]['update'](_0xa7050b[_0x62da('0x19')],{'raw':_0xa7050b['options']?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1c')]||null:null,'attributes':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1d')]||null:null,'limit':_0xa7050b[_0x62da('0x1a')]?_0xa7050b['options'][_0x62da('0x1e')]||null:null})[_0x62da('0xc')](function(_0x2fd925){logger[_0x62da('0xd')](_0x62da('0x1f'),_0xa7050b);logger[_0x62da('0xf')](_0x62da('0x1f'),_0xa7050b,JSON['stringify'](_0x2fd925));_0x4d6482(_0x2fd925);})['catch'](function(_0x509fd9){logger[_0x62da('0x13')](_0x62da('0x1f'),_0x509fd9[_0x62da('0x15')],_0xa7050b);_0x264366(_0x4ae4fb[_0x62da('0x13')](0x1f4,_0x509fd9['message']));});});};exports[_0x62da('0x20')]=function(_0x3b9c06){var _0x5f0a9c=this;return new Promise(function(_0x3ccf96,_0x195dc4){var _0x1775ea=require('../../components/encryptor');var _0x41de3a;return db[_0x62da('0x21')][_0x62da('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3c6274){_0x41de3a=_0x3c6274;return db[_0x62da('0x18')][_0x62da('0x23')](_0x3b9c06['body']);})[_0x62da('0xc')](function(_0x2a4681){if(_0x41de3a[_0x62da('0x24')]&&fs[_0x62da('0x25')](_0x2a4681[_0x62da('0x26')])){var _0x1cf765=util['format'](_0x62da('0x27'),_0x2a4681['value']);return _0x1775ea[_0x62da('0x28')](_0x2a4681[_0x62da('0x26')],_0x1cf765,config[_0x62da('0x29')][_0x62da('0x2a')])[_0x62da('0xc')](function(){fs[_0x62da('0x2b')](_0x2a4681['value']);logger[_0x62da('0xd')](_0x62da('0x2c'));return _0x2a4681;});}return _0x2a4681;})[_0x62da('0xc')](function(_0x5107b1){logger[_0x62da('0xd')](_0x62da('0x20'),_0x3b9c06);logger[_0x62da('0xf')]('CreateVoiceRecording',_0x3b9c06,JSON[_0x62da('0x12')](_0x5107b1));_0x3ccf96(_0x5107b1);})[_0x62da('0x17')](function(_0x55eda7){logger[_0x62da('0x13')](_0x62da('0x20'),_0x55eda7['message'],_0x3b9c06);_0x195dc4(_0x5f0a9c[_0x62da('0x13')](0x1f4,_0x55eda7[_0x62da('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 12c01f4..fb8abfa 100644 --- a/server/api/voiceTransferReport/index.js +++ b/server/api/voiceTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85d0=['isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','/describe'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x85d0,0xa4));var _0x085d=function(_0x5ba203,_0x1491ba){_0x5ba203=_0x5ba203-0x0;var _0x6504bc=_0x85d0[_0x5ba203];return _0x6504bc;};'use strict';var multer=require(_0x085d('0x0'));var util=require(_0x085d('0x1'));var path=require(_0x085d('0x2'));var timeout=require(_0x085d('0x3'));var express=require(_0x085d('0x4'));var router=express[_0x085d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x085d('0x6'));var interaction=require(_0x085d('0x7'));var config=require(_0x085d('0x8'));var controller=require(_0x085d('0x9'));router[_0x085d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x085d('0xb'),auth[_0x085d('0xc')](),controller[_0x085d('0xd')]);router[_0x085d('0xa')](_0x085d('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x085d('0xf')]('/',auth[_0x085d('0xc')](),controller[_0x085d('0x10')]);router[_0x085d('0x11')](_0x085d('0xe'),auth[_0x085d('0xc')](),controller[_0x085d('0x12')]);router[_0x085d('0x13')]('/:id',auth[_0x085d('0xc')](),controller[_0x085d('0x14')]);module[_0x085d('0x15')]=router; \ No newline at end of file +var _0xc8c0=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x85b692,_0x2d28b1){var _0x236680=function(_0x57a1e){while(--_0x57a1e){_0x85b692['push'](_0x85b692['shift']());}};_0x236680(++_0x2d28b1);}(_0xc8c0,0xc3));var _0x0c8c=function(_0x46ab63,_0xb3113d){_0x46ab63=_0x46ab63-0x0;var _0xb4ec46=_0xc8c0[_0x46ab63];return _0xb4ec46;};'use strict';var multer=require(_0x0c8c('0x0'));var util=require(_0x0c8c('0x1'));var path=require('path');var timeout=require(_0x0c8c('0x2'));var express=require(_0x0c8c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0c8c('0x4'));var interaction=require(_0x0c8c('0x5'));var config=require(_0x0c8c('0x6'));var controller=require(_0x0c8c('0x7'));router[_0x0c8c('0x8')]('/',auth[_0x0c8c('0x9')](),controller[_0x0c8c('0xa')]);router['get'](_0x0c8c('0xb'),auth['isAuthenticated'](),controller[_0x0c8c('0xc')]);router[_0x0c8c('0x8')](_0x0c8c('0xd'),auth[_0x0c8c('0x9')](),controller[_0x0c8c('0xe')]);router[_0x0c8c('0xf')]('/',auth[_0x0c8c('0x9')](),controller[_0x0c8c('0x10')]);router[_0x0c8c('0x11')](_0x0c8c('0xd'),auth['isAuthenticated'](),controller[_0x0c8c('0x12')]);router[_0x0c8c('0x13')](_0x0c8c('0xd'),auth[_0x0c8c('0x9')](),controller[_0x0c8c('0x14')]);module[_0x0c8c('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 42e3107..77151f6 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js +++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x301d=['sequelize','exports','attended','STRING','ENUM','Yes'];(function(_0xc0bcd1,_0x1723e0){var _0x48e14e=function(_0x4a471d){while(--_0x4a471d){_0xc0bcd1['push'](_0xc0bcd1['shift']());}};_0x48e14e(++_0x1723e0);}(_0x301d,0xde));var _0xd301=function(_0x12f77e,_0x2cb7e2){_0x12f77e=_0x12f77e-0x0;var _0x4e9f71=_0x301d[_0x12f77e];return _0x4e9f71;};'use strict';var Sequelize=require(_0xd301('0x0'));var moment=require('moment');module[_0xd301('0x1')]={'type':{'type':Sequelize['ENUM']('blind',_0xd301('0x2'))},'result':{'type':Sequelize[_0xd301('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xd301('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xd301('0x3')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xd301('0x3')]},'transfererexten':{'type':Sequelize[_0xd301('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xd301('0x3')]},'transfereechannel':{'type':Sequelize[_0xd301('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0xd301('0x3')]},'transfereecalleridname':{'type':Sequelize[_0xd301('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xd301('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xd301('0x3')]},'transfereecontext':{'type':Sequelize[_0xd301('0x3')]},'transfereeexten':{'type':Sequelize[_0xd301('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xd301('0x4')](_0xd301('0x5'),'No')},'context':{'type':Sequelize[_0xd301('0x3')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8d73=['ENUM','blind','STRING','Yes','exports'];(function(_0x37d239,_0x9890dc){var _0x219891=function(_0xff7ebb){while(--_0xff7ebb){_0x37d239['push'](_0x37d239['shift']());}};_0x219891(++_0x9890dc);}(_0x8d73,0x1e4));var _0x38d7=function(_0xf7c208,_0x5cbc84){_0xf7c208=_0xf7c208-0x0;var _0x16992d=_0x8d73[_0xf7c208];return _0x16992d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x38d7('0x0')]={'type':{'type':Sequelize[_0x38d7('0x1')](_0x38d7('0x2'),'attended')},'result':{'type':Sequelize[_0x38d7('0x3')]},'transfererchannel':{'type':Sequelize[_0x38d7('0x3')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x38d7('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x38d7('0x3')]},'transferercontext':{'type':Sequelize[_0x38d7('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x38d7('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x38d7('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x38d7('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x38d7('0x3')]},'transfereeexten':{'type':Sequelize[_0x38d7('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x38d7('0x3')]},'isexternal':{'type':Sequelize[_0x38d7('0x1')](_0x38d7('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x38d7('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 08aeb16..4b52531 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.controller.js +++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fe8=['name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','update','then','destroy','error','stack'];(function(_0x177da0,_0x4ab9f5){var _0x3bd25b=function(_0x14b59e){while(--_0x14b59e){_0x177da0['push'](_0x177da0['shift']());}};_0x3bd25b(++_0x4ab9f5);}(_0x8fe8,0x14e));var _0x88fe=function(_0x33e457,_0x55ea27){_0x33e457=_0x33e457-0x0;var _0x4637be=_0x8fe8[_0x33e457];return _0x4637be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x88fe('0x0'));var zipdir=require(_0x88fe('0x1'));var jsonpatch=require(_0x88fe('0x2'));var rp=require('request-promise');var moment=require(_0x88fe('0x3'));var BPromise=require(_0x88fe('0x4'));var Mustache=require('mustache');var util=require(_0x88fe('0x5'));var path=require(_0x88fe('0x6'));var sox=require(_0x88fe('0x7'));var csv=require(_0x88fe('0x8'));var ejs=require(_0x88fe('0x9'));var fs=require('fs');var fs_extra=require(_0x88fe('0xa'));var _=require(_0x88fe('0xb'));var squel=require(_0x88fe('0xc'));var crypto=require('crypto');var jsforce=require(_0x88fe('0xd'));var deskjs=require(_0x88fe('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x88fe('0xf'));var Redis=require(_0x88fe('0x10'));var authService=require(_0x88fe('0x11'));var qs=require(_0x88fe('0x12'));var as=require(_0x88fe('0x13'));var hardwareService=require(_0x88fe('0x14'));var logger=require(_0x88fe('0x15'))('api');var utils=require(_0x88fe('0x16'));var config=require(_0x88fe('0x17'));var licenseUtil=require(_0x88fe('0x18'));var db=require(_0x88fe('0x19'))['db'];function respondWithStatusCode(_0x13b9ed,_0x4830cc){_0x4830cc=_0x4830cc||0xcc;return function(_0x4e721d){if(_0x4e721d){return _0x13b9ed[_0x88fe('0x1a')](_0x4830cc);}return _0x13b9ed['status'](_0x4830cc)[_0x88fe('0x1b')]();};}function respondWithResult(_0x1206a1,_0x14a69d){_0x14a69d=_0x14a69d||0xc8;return function(_0x4398f2){if(_0x4398f2){return _0x1206a1[_0x88fe('0x1c')](_0x14a69d)[_0x88fe('0x1d')](_0x4398f2);}};}function respondWithFilteredResult(_0x436c86,_0x471a5f){return function(_0x1f3f69){if(_0x1f3f69){var _0x578042=typeof _0x471a5f[_0x88fe('0x1e')]==='undefined'&&typeof _0x471a5f[_0x88fe('0x1f')]===_0x88fe('0x20');var _0x33ceeb=_0x1f3f69[_0x88fe('0x21')];var _0x1bd0d0=_0x578042?0x0:_0x471a5f[_0x88fe('0x1e')];var _0x58db6b=_0x578042?_0x1f3f69[_0x88fe('0x21')]:_0x471a5f[_0x88fe('0x1e')]+_0x471a5f[_0x88fe('0x1f')];var _0x4e9196;if(_0x58db6b>=_0x33ceeb){_0x58db6b=_0x33ceeb;_0x4e9196=0xc8;}else{_0x4e9196=0xce;}_0x436c86['status'](_0x4e9196);return _0x436c86[_0x88fe('0x22')]('Content-Range',_0x1bd0d0+'-'+_0x58db6b+'/'+_0x33ceeb)[_0x88fe('0x1d')](_0x1f3f69);}return null;};}function patchUpdates(_0x467625){return function(_0x59f821){try{jsonpatch['apply'](_0x59f821,_0x467625,!![]);}catch(_0x3f0b28){return BPromise[_0x88fe('0x23')](_0x3f0b28);}return _0x59f821['save']();};}function saveUpdates(_0x24a60e,_0x5445fe){return function(_0x32cc0d){if(_0x32cc0d){return _0x32cc0d[_0x88fe('0x24')](_0x24a60e)[_0x88fe('0x25')](function(_0xd96180){return _0xd96180;});}return null;};}function removeEntity(_0x312ef8,_0x1e92a3){return function(_0x3cf59a){if(_0x3cf59a){return _0x3cf59a[_0x88fe('0x26')]()[_0x88fe('0x25')](function(){_0x312ef8[_0x88fe('0x1c')](0xcc)[_0x88fe('0x1b')]();});}};}function handleEntityNotFound(_0x531d82,_0x5171b2){return function(_0x154d78){if(!_0x154d78){_0x531d82[_0x88fe('0x1a')](0x194);}return _0x154d78;};}function handleError(_0x2b63f5,_0x2146b4){_0x2146b4=_0x2146b4||0x1f4;return function(_0x22e44c){logger[_0x88fe('0x27')](_0x22e44c[_0x88fe('0x28')]);if(_0x22e44c[_0x88fe('0x29')]){delete _0x22e44c[_0x88fe('0x29')];}_0x2b63f5[_0x88fe('0x1c')](_0x2146b4)['send'](_0x22e44c);};}exports[_0x88fe('0x2a')]=function(_0x3ae074,_0xd2d282){var _0x27c4e8={},_0x472d83={},_0x332a2e={'count':0x0,'rows':[]};var _0x5b610b=_[_0x88fe('0x2b')](db[_0x88fe('0x2c')][_0x88fe('0x2d')],function(_0x4dfe5c){return{'name':_0x4dfe5c[_0x88fe('0x2e')],'type':_0x4dfe5c[_0x88fe('0x2f')][_0x88fe('0x30')]};});_0x472d83['model']=_[_0x88fe('0x2b')](_0x5b610b,'name');_0x472d83[_0x88fe('0x31')]=_[_0x88fe('0x32')](_0x3ae074[_0x88fe('0x31')]);_0x472d83[_0x88fe('0x33')]=_[_0x88fe('0x34')](_0x472d83[_0x88fe('0x35')],_0x472d83['query']);_0x27c4e8['attributes']=_[_0x88fe('0x34')](_0x472d83[_0x88fe('0x35')],qs[_0x88fe('0x36')](_0x3ae074['query'][_0x88fe('0x36')]));_0x27c4e8['attributes']=_0x27c4e8[_0x88fe('0x37')][_0x88fe('0x38')]?_0x27c4e8[_0x88fe('0x37')]:_0x472d83[_0x88fe('0x35')];if(!_0x3ae074[_0x88fe('0x31')][_0x88fe('0x39')]('nolimit')){_0x27c4e8[_0x88fe('0x1f')]=qs['limit'](_0x3ae074[_0x88fe('0x31')][_0x88fe('0x1f')]);_0x27c4e8[_0x88fe('0x1e')]=qs['offset'](_0x3ae074[_0x88fe('0x31')][_0x88fe('0x1e')]);}_0x27c4e8[_0x88fe('0x3a')]=qs['sort'](_0x3ae074['query']['sort']);_0x27c4e8[_0x88fe('0x3b')]=qs[_0x88fe('0x33')](_['pick'](_0x3ae074[_0x88fe('0x31')],_0x472d83[_0x88fe('0x33')]),_0x5b610b);if(_0x3ae074['query'][_0x88fe('0x3c')]){_0x27c4e8[_0x88fe('0x3b')]=_[_0x88fe('0x3d')](_0x27c4e8['where'],{'$or':_[_0x88fe('0x2b')](_0x5b610b,function(_0x4218e1){if(_0x4218e1[_0x88fe('0x2f')]!==_0x88fe('0x3e')){var _0x4ac0eb={};_0x4ac0eb[_0x4218e1[_0x88fe('0x29')]]={'$like':'%'+_0x3ae074[_0x88fe('0x31')][_0x88fe('0x3c')]+'%'};return _0x4ac0eb;}})});}_0x27c4e8=_['merge']({},_0x27c4e8,_0x3ae074[_0x88fe('0x3f')]);var _0x92bb46={'where':_0x27c4e8[_0x88fe('0x3b')]};return db['VoiceTransferReport'][_0x88fe('0x21')](_0x92bb46)[_0x88fe('0x25')](function(_0x1a9a90){_0x332a2e[_0x88fe('0x21')]=_0x1a9a90;if(_0x3ae074[_0x88fe('0x31')]['includeAll']){_0x27c4e8['include']=[{'all':!![]}];}return db[_0x88fe('0x2c')][_0x88fe('0x40')](_0x27c4e8);})[_0x88fe('0x25')](function(_0x372202){_0x332a2e[_0x88fe('0x41')]=_0x372202;return _0x332a2e;})[_0x88fe('0x25')](respondWithFilteredResult(_0xd2d282,_0x27c4e8))[_0x88fe('0x42')](handleError(_0xd2d282,null));};exports[_0x88fe('0x43')]=function(_0x535c76,_0x22145c){var _0x271a6c={'raw':!![],'where':{'id':_0x535c76[_0x88fe('0x44')]['id']}},_0x55014e={};_0x55014e[_0x88fe('0x35')]=_[_0x88fe('0x32')](db[_0x88fe('0x2c')]['rawAttributes']);_0x55014e['query']=_['keys'](_0x535c76[_0x88fe('0x31')]);_0x55014e['filters']=_[_0x88fe('0x34')](_0x55014e['model'],_0x55014e[_0x88fe('0x31')]);_0x271a6c[_0x88fe('0x37')]=_[_0x88fe('0x34')](_0x55014e[_0x88fe('0x35')],qs['fields'](_0x535c76['query'][_0x88fe('0x36')]));_0x271a6c[_0x88fe('0x37')]=_0x271a6c[_0x88fe('0x37')][_0x88fe('0x38')]?_0x271a6c[_0x88fe('0x37')]:_0x55014e[_0x88fe('0x35')];if(_0x535c76[_0x88fe('0x31')][_0x88fe('0x45')]){_0x271a6c[_0x88fe('0x46')]=[{'all':!![]}];}_0x271a6c=_[_0x88fe('0x3d')]({},_0x271a6c,_0x535c76[_0x88fe('0x3f')]);return db[_0x88fe('0x2c')][_0x88fe('0x47')](_0x271a6c)[_0x88fe('0x25')](handleEntityNotFound(_0x22145c,null))[_0x88fe('0x25')](respondWithResult(_0x22145c,null))[_0x88fe('0x42')](handleError(_0x22145c,null));};exports['create']=function(_0x12fb44,_0x589f9f){return db[_0x88fe('0x2c')][_0x88fe('0x48')](_0x12fb44['body'],{})[_0x88fe('0x25')](respondWithResult(_0x589f9f,0xc9))[_0x88fe('0x42')](handleError(_0x589f9f,null));};exports[_0x88fe('0x24')]=function(_0x1d4432,_0x2434f2){if(_0x1d4432[_0x88fe('0x49')]['id']){delete _0x1d4432[_0x88fe('0x49')]['id'];}return db['VoiceTransferReport'][_0x88fe('0x47')]({'where':{'id':_0x1d4432[_0x88fe('0x44')]['id']}})[_0x88fe('0x25')](handleEntityNotFound(_0x2434f2,null))[_0x88fe('0x25')](saveUpdates(_0x1d4432[_0x88fe('0x49')],null))[_0x88fe('0x25')](respondWithResult(_0x2434f2,null))['catch'](handleError(_0x2434f2,null));};exports[_0x88fe('0x26')]=function(_0x36fd1a,_0x4d54d4){return db[_0x88fe('0x2c')][_0x88fe('0x47')]({'where':{'id':_0x36fd1a[_0x88fe('0x44')]['id']}})[_0x88fe('0x25')](handleEntityNotFound(_0x4d54d4,null))[_0x88fe('0x25')](removeEntity(_0x4d54d4,null))[_0x88fe('0x42')](handleError(_0x4d54d4,null));};exports['describe']=function(_0x9af76a,_0x4ccb8e){return db['VoiceTransferReport'][_0x88fe('0x4a')]()[_0x88fe('0x25')](respondWithResult(_0x4ccb8e,null))[_0x88fe('0x42')](handleError(_0x4ccb8e,null));}; \ No newline at end of file +var _0x08b8=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceTransferReport','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','stack','name','index','map','type','key','model','query'];(function(_0x25f0cd,_0x4cde3e){var _0x1f442d=function(_0x4fffd1){while(--_0x4fffd1){_0x25f0cd['push'](_0x25f0cd['shift']());}};_0x1f442d(++_0x4cde3e);}(_0x08b8,0x139));var _0x808b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08b8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x808b('0x0'));var rimraf=require(_0x808b('0x1'));var zipdir=require(_0x808b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x808b('0x3'));var moment=require(_0x808b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x808b('0x5'));var util=require(_0x808b('0x6'));var path=require(_0x808b('0x7'));var sox=require(_0x808b('0x8'));var csv=require(_0x808b('0x9'));var ejs=require(_0x808b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x808b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x808b('0xc'));var toCsv=require(_0x808b('0x9'));var querystring=require('querystring');var Papa=require(_0x808b('0xd'));var Redis=require(_0x808b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x808b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x808b('0x10'));var logger=require(_0x808b('0x11'))('api');var utils=require(_0x808b('0x12'));var config=require(_0x808b('0x13'));var licenseUtil=require(_0x808b('0x14'));var db=require(_0x808b('0x15'))['db'];function respondWithStatusCode(_0x343175,_0x16a81a){_0x16a81a=_0x16a81a||0xcc;return function(_0x3c23b6){if(_0x3c23b6){return _0x343175[_0x808b('0x16')](_0x16a81a);}return _0x343175[_0x808b('0x17')](_0x16a81a)['end']();};}function respondWithResult(_0x4e27c8,_0x1d86ae){_0x1d86ae=_0x1d86ae||0xc8;return function(_0x21d846){if(_0x21d846){return _0x4e27c8[_0x808b('0x17')](_0x1d86ae)[_0x808b('0x18')](_0x21d846);}};}function respondWithFilteredResult(_0xffb16c,_0x544ee2){return function(_0x5bedd7){if(_0x5bedd7){var _0x34e653=typeof _0x544ee2[_0x808b('0x19')]===_0x808b('0x1a')&&typeof _0x544ee2[_0x808b('0x1b')]===_0x808b('0x1a');var _0x3a9a9b=_0x5bedd7[_0x808b('0x1c')];var _0x3917c1=_0x34e653?0x0:_0x544ee2['offset'];var _0x3ba575=_0x34e653?_0x5bedd7[_0x808b('0x1c')]:_0x544ee2['offset']+_0x544ee2[_0x808b('0x1b')];var _0x51fb4f;if(_0x3ba575>=_0x3a9a9b){_0x3ba575=_0x3a9a9b;_0x51fb4f=0xc8;}else{_0x51fb4f=0xce;}_0xffb16c[_0x808b('0x17')](_0x51fb4f);return _0xffb16c['set']('Content-Range',_0x3917c1+'-'+_0x3ba575+'/'+_0x3a9a9b)[_0x808b('0x18')](_0x5bedd7);}return null;};}function patchUpdates(_0x188c32){return function(_0x29ab83){try{jsonpatch[_0x808b('0x1d')](_0x29ab83,_0x188c32,!![]);}catch(_0x52a8a0){return BPromise[_0x808b('0x1e')](_0x52a8a0);}return _0x29ab83[_0x808b('0x1f')]();};}function saveUpdates(_0x2c55a9,_0x4f80e0){return function(_0x15e4bd){if(_0x15e4bd){return _0x15e4bd[_0x808b('0x20')](_0x2c55a9)[_0x808b('0x21')](function(_0x4373dc){return _0x4373dc;});}return null;};}function removeEntity(_0x206e58,_0xea9ae1){return function(_0x127543){if(_0x127543){return _0x127543['destroy']()[_0x808b('0x21')](function(){_0x206e58[_0x808b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41c46e,_0x5d687a){return function(_0x572330){if(!_0x572330){_0x41c46e[_0x808b('0x16')](0x194);}return _0x572330;};}function handleError(_0x2e573c,_0x54a2bb){_0x54a2bb=_0x54a2bb||0x1f4;return function(_0x1786d7){logger['error'](_0x1786d7[_0x808b('0x22')]);if(_0x1786d7[_0x808b('0x23')]){delete _0x1786d7[_0x808b('0x23')];}_0x2e573c[_0x808b('0x17')](_0x54a2bb)['send'](_0x1786d7);};}exports[_0x808b('0x24')]=function(_0x543054,_0x44136e){var _0x3f69e5={},_0x1667e3={},_0x106909={'count':0x0,'rows':[]};var _0x3ae02c=_[_0x808b('0x25')](db['VoiceTransferReport']['rawAttributes'],function(_0x3d4e1a){return{'name':_0x3d4e1a['fieldName'],'type':_0x3d4e1a[_0x808b('0x26')][_0x808b('0x27')]};});_0x1667e3[_0x808b('0x28')]=_[_0x808b('0x25')](_0x3ae02c,_0x808b('0x23'));_0x1667e3[_0x808b('0x29')]=_['keys'](_0x543054[_0x808b('0x29')]);_0x1667e3[_0x808b('0x2a')]=_[_0x808b('0x2b')](_0x1667e3[_0x808b('0x28')],_0x1667e3['query']);_0x3f69e5[_0x808b('0x2c')]=_[_0x808b('0x2b')](_0x1667e3[_0x808b('0x28')],qs[_0x808b('0x2d')](_0x543054[_0x808b('0x29')][_0x808b('0x2d')]));_0x3f69e5[_0x808b('0x2c')]=_0x3f69e5[_0x808b('0x2c')]['length']?_0x3f69e5[_0x808b('0x2c')]:_0x1667e3[_0x808b('0x28')];if(!_0x543054[_0x808b('0x29')][_0x808b('0x2e')](_0x808b('0x2f'))){_0x3f69e5['limit']=qs[_0x808b('0x1b')](_0x543054['query'][_0x808b('0x1b')]);_0x3f69e5[_0x808b('0x19')]=qs['offset'](_0x543054['query'][_0x808b('0x19')]);}_0x3f69e5[_0x808b('0x30')]=qs[_0x808b('0x31')](_0x543054[_0x808b('0x29')][_0x808b('0x31')]);_0x3f69e5[_0x808b('0x32')]=qs['filters'](_[_0x808b('0x33')](_0x543054['query'],_0x1667e3['filters']),_0x3ae02c);if(_0x543054[_0x808b('0x29')]['filter']){_0x3f69e5['where']=_[_0x808b('0x34')](_0x3f69e5[_0x808b('0x32')],{'$or':_[_0x808b('0x25')](_0x3ae02c,function(_0x9c2a91){if(_0x9c2a91[_0x808b('0x26')]!==_0x808b('0x35')){var _0x30c5df={};_0x30c5df[_0x9c2a91[_0x808b('0x23')]]={'$like':'%'+_0x543054['query'][_0x808b('0x36')]+'%'};return _0x30c5df;}})});}_0x3f69e5=_[_0x808b('0x34')]({},_0x3f69e5,_0x543054[_0x808b('0x37')]);var _0x44d7f5={'where':_0x3f69e5[_0x808b('0x32')]};return db[_0x808b('0x38')][_0x808b('0x1c')](_0x44d7f5)[_0x808b('0x21')](function(_0x1f5c7c){_0x106909[_0x808b('0x1c')]=_0x1f5c7c;if(_0x543054['query'][_0x808b('0x39')]){_0x3f69e5['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0x808b('0x3a')](_0x3f69e5);})[_0x808b('0x21')](function(_0x202e79){_0x106909[_0x808b('0x3b')]=_0x202e79;return _0x106909;})[_0x808b('0x21')](respondWithFilteredResult(_0x44136e,_0x3f69e5))[_0x808b('0x3c')](handleError(_0x44136e,null));};exports[_0x808b('0x3d')]=function(_0x24dc5c,_0x578a10){var _0xd64920={'raw':!![],'where':{'id':_0x24dc5c[_0x808b('0x3e')]['id']}},_0x160ea={};_0x160ea[_0x808b('0x28')]=_[_0x808b('0x3f')](db[_0x808b('0x38')][_0x808b('0x40')]);_0x160ea[_0x808b('0x29')]=_['keys'](_0x24dc5c[_0x808b('0x29')]);_0x160ea[_0x808b('0x2a')]=_[_0x808b('0x2b')](_0x160ea[_0x808b('0x28')],_0x160ea[_0x808b('0x29')]);_0xd64920[_0x808b('0x2c')]=_[_0x808b('0x2b')](_0x160ea['model'],qs[_0x808b('0x2d')](_0x24dc5c[_0x808b('0x29')][_0x808b('0x2d')]));_0xd64920[_0x808b('0x2c')]=_0xd64920[_0x808b('0x2c')][_0x808b('0x41')]?_0xd64920[_0x808b('0x2c')]:_0x160ea[_0x808b('0x28')];if(_0x24dc5c[_0x808b('0x29')][_0x808b('0x39')]){_0xd64920[_0x808b('0x42')]=[{'all':!![]}];}_0xd64920=_[_0x808b('0x34')]({},_0xd64920,_0x24dc5c['options']);return db[_0x808b('0x38')][_0x808b('0x43')](_0xd64920)['then'](handleEntityNotFound(_0x578a10,null))[_0x808b('0x21')](respondWithResult(_0x578a10,null))[_0x808b('0x3c')](handleError(_0x578a10,null));};exports['create']=function(_0x1aa41,_0x2f94bd){return db['VoiceTransferReport'][_0x808b('0x44')](_0x1aa41['body'],{})[_0x808b('0x21')](respondWithResult(_0x2f94bd,0xc9))['catch'](handleError(_0x2f94bd,null));};exports[_0x808b('0x20')]=function(_0x48743c,_0x295625){if(_0x48743c[_0x808b('0x45')]['id']){delete _0x48743c[_0x808b('0x45')]['id'];}return db[_0x808b('0x38')][_0x808b('0x43')]({'where':{'id':_0x48743c[_0x808b('0x3e')]['id']}})[_0x808b('0x21')](handleEntityNotFound(_0x295625,null))[_0x808b('0x21')](saveUpdates(_0x48743c[_0x808b('0x45')],null))['then'](respondWithResult(_0x295625,null))[_0x808b('0x3c')](handleError(_0x295625,null));};exports['destroy']=function(_0x5b30c7,_0x103c4d){return db[_0x808b('0x38')][_0x808b('0x43')]({'where':{'id':_0x5b30c7[_0x808b('0x3e')]['id']}})[_0x808b('0x21')](handleEntityNotFound(_0x103c4d,null))[_0x808b('0x21')](removeEntity(_0x103c4d,null))[_0x808b('0x3c')](handleError(_0x103c4d,null));};exports[_0x808b('0x46')]=function(_0x52fe25,_0x4410b1){return db[_0x808b('0x38')][_0x808b('0x46')]()['then'](respondWithResult(_0x4410b1,null))[_0x808b('0x3c')](handleError(_0x4410b1,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 21a11b4..72807f6 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.model.js +++ b/server/api/voiceTransferReport/voiceTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5cd=['api','moment','bluebird','request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','../../config/logger'];(function(_0xfef7c,_0x272a81){var _0x4a2805=function(_0x55ef61){while(--_0x55ef61){_0xfef7c['push'](_0xfef7c['shift']());}};_0x4a2805(++_0x272a81);}(_0xc5cd,0x11e));var _0xdc5c=function(_0x5d7451,_0x4af4ca){_0x5d7451=_0x5d7451-0x0;var _0x21bd4d=_0xc5cd[_0x5d7451];return _0x21bd4d;};'use strict';var _=require(_0xdc5c('0x0'));var util=require('util');var logger=require(_0xdc5c('0x1'))(_0xdc5c('0x2'));var moment=require(_0xdc5c('0x3'));var BPromise=require(_0xdc5c('0x4'));var rp=require(_0xdc5c('0x5'));var fs=require('fs');var path=require(_0xdc5c('0x6'));var rimraf=require('rimraf');var config=require(_0xdc5c('0x7'));var attributes=require(_0xdc5c('0x8'));module[_0xdc5c('0x9')]=function(_0xd7fc1,_0x2b2150){return _0xd7fc1['define'](_0xdc5c('0xa'),attributes,{'tableName':_0xdc5c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8384=['request-promise','path','exports','define','VoiceTransferReport','report_call_transfer','moment','bluebird'];(function(_0x281be2,_0x37e568){var _0x12599a=function(_0x354db3){while(--_0x354db3){_0x281be2['push'](_0x281be2['shift']());}};_0x12599a(++_0x37e568);}(_0x8384,0x6e));var _0x4838=function(_0x1ca761,_0x341ed6){_0x1ca761=_0x1ca761-0x0;var _0x25104e=_0x8384[_0x1ca761];return _0x25104e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4838('0x0'));var BPromise=require(_0x4838('0x1'));var rp=require(_0x4838('0x2'));var fs=require('fs');var path=require(_0x4838('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0x4838('0x4')]=function(_0x327c63,_0x317c8b){return _0x327c63[_0x4838('0x5')](_0x4838('0x6'),attributes,{'tableName':_0x4838('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 27d1af6..3149e57 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js +++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9329=['stringify','error','code','message','info','catch','CreateVoiceTransferReport','create','body','options','raw','then','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5aba56,_0x17f8bb){var _0x273611=function(_0x341702){while(--_0x341702){_0x5aba56['push'](_0x5aba56['shift']());}};_0x273611(++_0x17f8bb);}(_0x9329,0x1e7));var _0x9932=function(_0x38eb42,_0x52f625){_0x38eb42=_0x38eb42-0x0;var _0xbe9e2f=_0x9329[_0x38eb42];return _0xbe9e2f;};'use strict';var _=require(_0x9932('0x0'));var util=require('util');var moment=require(_0x9932('0x1'));var BPromise=require(_0x9932('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9932('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9932('0x4'))(_0x9932('0x5'));var config=require(_0x9932('0x6'));var jayson=require(_0x9932('0x7'));var client=jayson['client'][_0x9932('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3334a8,_0x3efbb4,_0x3a08cf){return new BPromise(function(_0x44751e,_0x30a871){return client[_0x9932('0x9')](_0x3334a8,_0x3a08cf)['then'](function(_0x2da29b){logger['info'](_0x9932('0xa'),_0x3efbb4,_0x9932('0xb'));logger[_0x9932('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3efbb4,_0x9932('0xb'),JSON[_0x9932('0xd')](_0x2da29b));if(_0x2da29b[_0x9932('0xe')]){if(_0x2da29b['error'][_0x9932('0xf')]===0x1f4){logger['error'](_0x9932('0xa'),_0x3efbb4,_0x2da29b[_0x9932('0xe')][_0x9932('0x10')]);return _0x30a871(_0x2da29b['error'][_0x9932('0x10')]);}logger[_0x9932('0xe')](_0x9932('0xa'),_0x3efbb4,_0x2da29b[_0x9932('0xe')][_0x9932('0x10')]);return _0x44751e(_0x2da29b[_0x9932('0xe')][_0x9932('0x10')]);}else{logger[_0x9932('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x3efbb4,_0x9932('0xb'));_0x44751e(_0x2da29b['result'][_0x9932('0x10')]);}})[_0x9932('0x12')](function(_0x120e9e){logger[_0x9932('0xe')](_0x9932('0xa'),_0x3efbb4,_0x120e9e);_0x30a871(_0x120e9e);});});}exports[_0x9932('0x13')]=function(_0x54fb55){var _0x1bf00c=this;return new Promise(function(_0x32abe5,_0x990d02){return db['VoiceTransferReport'][_0x9932('0x14')](_0x54fb55[_0x9932('0x15')],{'raw':_0x54fb55[_0x9932('0x16')]?_0x54fb55[_0x9932('0x16')][_0x9932('0x17')]===undefined?!![]:![]:!![]})[_0x9932('0x18')](function(_0x5c594e){logger[_0x9932('0x11')]('CreateVoiceTransferReport',_0x54fb55);logger[_0x9932('0xc')](_0x9932('0x13'),_0x54fb55,JSON['stringify'](_0x5c594e));_0x32abe5(_0x5c594e);})[_0x9932('0x12')](function(_0x2c6715){logger[_0x9932('0xe')](_0x9932('0x13'),_0x2c6715[_0x9932('0x10')],_0x54fb55);_0x990d02(_0x1bf00c[_0x9932('0xe')](0x1f4,_0x2c6715[_0x9932('0x10')]));});});}; \ No newline at end of file +var _0x3d5c=['code','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d5c,0xa2));var _0xc3d5=function(_0x584a03,_0x59e0c8){_0x584a03=_0x584a03-0x0;var _0x29d9c9=_0x3d5c[_0x584a03];return _0x29d9c9;};'use strict';var _=require(_0xc3d5('0x0'));var util=require(_0xc3d5('0x1'));var moment=require('moment');var BPromise=require(_0xc3d5('0x2'));var rs=require(_0xc3d5('0x3'));var fs=require('fs');var Redis=require(_0xc3d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc3d5('0x5'))(_0xc3d5('0x6'));var config=require(_0xc3d5('0x7'));var jayson=require(_0xc3d5('0x8'));var client=jayson[_0xc3d5('0x9')][_0xc3d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3046cf,_0x508eff,_0x260622){return new BPromise(function(_0x5d9b99,_0x7ec13a){return client[_0xc3d5('0xb')](_0x3046cf,_0x260622)[_0xc3d5('0xc')](function(_0x33df54){logger['info'](_0xc3d5('0xd'),_0x508eff,_0xc3d5('0xe'));logger['debug'](_0xc3d5('0xf'),_0x508eff,'request\x20sent',JSON[_0xc3d5('0x10')](_0x33df54));if(_0x33df54[_0xc3d5('0x11')]){if(_0x33df54[_0xc3d5('0x11')][_0xc3d5('0x12')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x508eff,_0x33df54[_0xc3d5('0x11')][_0xc3d5('0x13')]);return _0x7ec13a(_0x33df54['error'][_0xc3d5('0x13')]);}logger[_0xc3d5('0x11')](_0xc3d5('0xd'),_0x508eff,_0x33df54[_0xc3d5('0x11')]['message']);return _0x5d9b99(_0x33df54[_0xc3d5('0x11')][_0xc3d5('0x13')]);}else{logger[_0xc3d5('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x508eff,'request\x20sent');_0x5d9b99(_0x33df54[_0xc3d5('0x15')][_0xc3d5('0x13')]);}})[_0xc3d5('0x16')](function(_0x1b425e){logger[_0xc3d5('0x11')](_0xc3d5('0xd'),_0x508eff,_0x1b425e);_0x7ec13a(_0x1b425e);});});}exports[_0xc3d5('0x17')]=function(_0x19696f){var _0x41c202=this;return new Promise(function(_0x582366,_0x1de63a){return db[_0xc3d5('0x18')][_0xc3d5('0x19')](_0x19696f[_0xc3d5('0x1a')],{'raw':_0x19696f[_0xc3d5('0x1b')]?_0x19696f[_0xc3d5('0x1b')][_0xc3d5('0x1c')]===undefined?!![]:![]:!![]})[_0xc3d5('0xc')](function(_0x2e10af){logger[_0xc3d5('0x14')]('CreateVoiceTransferReport',_0x19696f);logger[_0xc3d5('0x1d')](_0xc3d5('0x17'),_0x19696f,JSON[_0xc3d5('0x10')](_0x2e10af));_0x582366(_0x2e10af);})[_0xc3d5('0x16')](function(_0x53ac72){logger[_0xc3d5('0x11')](_0xc3d5('0x17'),_0x53ac72[_0xc3d5('0x13')],_0x19696f);_0x1de63a(_0x41c202[_0xc3d5('0x11')](0x1f4,_0x53ac72['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 5fc434d..e298fc4 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x469590,_0x17dbf8){var _0x3d81a8=function(_0x32b78c){while(--_0x32b78c){_0x469590['push'](_0x469590['shift']());}};_0x3d81a8(++_0x17dbf8);}(_0xe5b3,0x133));var _0x3e5b=function(_0x4b9a62,_0x528ba3){_0x4b9a62=_0x4b9a62-0x0;var _0x45c582=_0xe5b3[_0x4b9a62];return _0x45c582;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe706=['/transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','/calls','calls'];(function(_0x5a2ca9,_0x48ef85){var _0x27b9ef=function(_0x2483c0){while(--_0x2483c0){_0x5a2ca9['push'](_0x5a2ca9['shift']());}};_0x27b9ef(++_0x48ef85);}(_0xe706,0xa3));var _0x6e70=function(_0x4f485f,_0x1db0f7){_0x4f485f=_0x4f485f-0x0;var _0x1e998e=_0xe706[_0x4f485f];return _0x1e998e;};'use strict';var express=require(_0x6e70('0x0'));var router=express[_0x6e70('0x1')]();var auth=require(_0x6e70('0x2'));var controller=require('./webbar.controller');router[_0x6e70('0x3')](_0x6e70('0x4'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x7')]);router[_0x6e70('0x3')](_0x6e70('0x8'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x9')]);router[_0x6e70('0x3')](_0x6e70('0xa'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x3')](_0x6e70('0xc'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x3')](_0x6e70('0xe'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller['unhold']);router['post'](_0x6e70('0xf'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x3')](_0x6e70('0x11'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller['transfer']);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index dda71a2..65335ec 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x702d=['message','result','catch','User','agent','then','VoiceChannels','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','body','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','userId','hangup\x20executed!','answer','answer\x20fired:','validate','webbar:answer','answer\x20executed!','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','all','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','ioredis','defaults','redis','localhost','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','NotFound'];(function(_0x417429,_0x22546a){var _0x557a04=function(_0x211fb1){while(--_0x211fb1){_0x417429['push'](_0x417429['shift']());}};_0x557a04(++_0x22546a);}(_0x702d,0x147));var _0xd702=function(_0x4cfbda,_0x1f3b18){_0x4cfbda=_0x4cfbda-0x0;var _0x5c04c3=_0x702d[_0x4cfbda];return _0x5c04c3;};'use strict';var path=require(_0xd702('0x0'));var fs=require('fs');var _=require(_0xd702('0x1'));var db=require(_0xd702('0x2'))['db'];var config=require(_0xd702('0x3'));var util=require(_0xd702('0x4'));var BPromise=require('bluebird');var jayson=require(_0xd702('0x5'));var amiClient=jayson[_0xd702('0x6')][_0xd702('0x7')]({'port':0x232a});var logger=require(_0xd702('0x8'))('webbarapi');var Redis=require(_0xd702('0x9'));config['redis']=_[_0xd702('0xa')](config[_0xd702('0xb')],{'host':_0xd702('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd702('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'callNumber':{'type':_0xd702('0xf'),'required':[!![],_0xd702('0x10')]},'callerId':{'type':_0xd702('0xf')},'callbackUrl':{'type':_0xd702('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'sessionId':{'type':_0xd702('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'sessionId':{'type':_0xd702('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xd702('0xf'),'required':[!![],_0xd702('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'sessionId':{'type':_0xd702('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xd702('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x268c66,_0x210c32,_0x55b93e){logger[_0xd702('0x12')](_0x268c66,_0x210c32,JSON[_0xd702('0x13')](_0x55b93e));io['to'](_0x268c66)[_0xd702('0x14')](_0x210c32,_0x55b93e);}function handleError(_0x4fdbbd){return function(_0x5b3b1d){console[_0xd702('0x15')]('handleError:',_0x5b3b1d,_0x5b3b1d instanceof RangeError);logger[_0xd702('0x16')](_0x5b3b1d[_0xd702('0x17')]);if(_0x5b3b1d instanceof RangeError){if(_0x5b3b1d[_0xd702('0x18')]){delete _0x5b3b1d[_0xd702('0x18')];}_0x4fdbbd[_0xd702('0x19')](0x194)[_0xd702('0x1a')](_0x5b3b1d);}else{if(_0x5b3b1d[_0xd702('0x18')]){delete _0x5b3b1d['name'];}_0x4fdbbd['status'](0x1f4)['send'](_0x5b3b1d);}};}function checkError(){return function(_0x55516e){if(!_0x55516e){throw new RangeError(_0xd702('0x1b'));}return _0x55516e;};}function respondWithRpcPromise(_0x5cbff4,_0x211200){return new BPromise(function(_0x5d91fd,_0xc4c246){var _0x5824ec=amiClient;return _0x5824ec['request'](_0x5cbff4,_0x211200)['then'](function(_0x21c00e){if(_0x21c00e[_0xd702('0x16')]){if(_0x21c00e[_0xd702('0x16')]['code']===0x1f4){return _0xc4c246(_0x21c00e[_0xd702('0x16')][_0xd702('0x1c')]);}return _0x5d91fd(_0x21c00e[_0xd702('0x16')][_0xd702('0x1c')]);}else{_0x5d91fd(_0x21c00e[_0xd702('0x1d')]);}})[_0xd702('0x1e')](function(_0x94c58d){_0xc4c246(_0x94c58d);});});}function getAgent(_0x45ca87){return db[_0xd702('0x1f')]['findOne']({'where':{'id':_0x45ca87,'role':_0xd702('0x20')}})[_0xd702('0x21')](checkError());}function getAgentCheckSession(_0x25e96a,_0x335202){return new BPromise(function(_0xbe4518,_0x38505d){var _0x797156=respondWithRpcPromise(_0xd702('0x22'));var _0x5f1084=getAgent(_0x25e96a);Promise['all']([_0x797156,_0x5f1084])[_0xd702('0x21')](function(_0x43cd38){var _0x56bc8d=_0x43cd38[0x0];var _0x45cd22=_0x43cd38[0x1];var _0xee8bf1=_[_0xd702('0x23')](_0x56bc8d[_0xd702('0x24')],function(_0x56e9cd){return _0x56e9cd[_0xd702('0x25')]==_0x45cd22['id']&&_0x56e9cd[_0xd702('0x26')]==_0x335202;});if(_0xee8bf1[_0xd702('0x27')]==0x1){_0xbe4518(_0x45cd22);}else{_0x38505d(new RangeError(_0xd702('0x28')+_0x335202+_0xd702('0x29')));}});});}exports['originate']=function(_0x1b1056,_0x219f41){logger[_0xd702('0x12')]('originate\x20fired:',_0x1b1056[_0xd702('0x2a')]);var _0x563103=originateValidation['validate'](_0x1b1056[_0xd702('0x2a')]);if(_0x563103[_0xd702('0x27')]>0x0){return _0x219f41[_0xd702('0x19')](0x190)['json'](_0x563103);}var _0x7b8af3=_0x1b1056[_0xd702('0x2a')]['userId'];var _0x208f50=_0x1b1056[_0xd702('0x2a')][_0xd702('0x2b')];var _0xd244cc=_0x1b1056[_0xd702('0x2a')][_0xd702('0x2c')];var _0x401f92=_0x1b1056[_0xd702('0x2a')][_0xd702('0x2d')];return getAgent(_0x7b8af3)[_0xd702('0x21')](function(_0x9f458b){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x9f458b['name']);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x9f458b[_0xd702('0x18')]),_0xd702('0x31'),{'callNumber':_0x208f50,'callerId':_0xd244cc,'callbackUrl':_0x401f92});return _0x219f41[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x33')});})['catch'](handleError(_0x219f41));};exports['hangup']=function(_0x138d54,_0x1810ee){logger['info']('hangup\x20fired:',_0x138d54[_0xd702('0x2a')]);var _0x234795=hangupValidation['validate'](_0x138d54[_0xd702('0x2a')]);if(_0x234795[_0xd702('0x27')]>0x0){return _0x1810ee[_0xd702('0x19')](0x190)['json'](_0x234795);}var _0x3444c8=_0x138d54[_0xd702('0x2a')][_0xd702('0x34')];var _0x506c4a=_0x138d54[_0xd702('0x2a')]['sessionId'];return getAgent(_0x3444c8)[_0xd702('0x21')](function(_0x239bec){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x239bec[_0xd702('0x18')]);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x239bec[_0xd702('0x18')]),'webbar:hangup',{'sessionId':_0x506c4a});return _0x1810ee[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x35')});})[_0xd702('0x1e')](handleError(_0x1810ee));};exports[_0xd702('0x36')]=function(_0x5ecb10,_0x203f5d){logger[_0xd702('0x12')](_0xd702('0x37'),_0x5ecb10['body']);var _0xd48ad0=answerValidation[_0xd702('0x38')](_0x5ecb10[_0xd702('0x2a')]);if(_0xd48ad0[_0xd702('0x27')]>0x0){return _0x203f5d['status'](0x190)[_0xd702('0x32')](_0xd48ad0);}var _0xfa5e9=_0x5ecb10[_0xd702('0x2a')][_0xd702('0x34')];var _0x185e4a=_0x5ecb10['body'][_0xd702('0x26')];return getAgent(_0xfa5e9)[_0xd702('0x21')](function(_0x5b1ab7){logger['info'](_0xd702('0x2e'),_0x5b1ab7[_0xd702('0x18')]);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x5b1ab7[_0xd702('0x18')]),_0xd702('0x39'),{'sessionId':_0x185e4a});return _0x203f5d[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x3a')});})['catch'](handleError(_0x203f5d));};exports['hold']=function(_0xbf6235,_0x58047c){logger[_0xd702('0x12')]('hold\x20fired:',_0xbf6235[_0xd702('0x2a')]);var _0x58a56f=holdValidation[_0xd702('0x38')](_0xbf6235['body']);if(_0x58a56f[_0xd702('0x27')]>0x0){return _0x58047c[_0xd702('0x19')](0x190)['json'](_0x58a56f);}var _0x160f5e=_0xbf6235[_0xd702('0x2a')][_0xd702('0x34')];var _0x18012d=_0xbf6235[_0xd702('0x2a')]['sessionId'];return getAgent(_0x160f5e)[_0xd702('0x21')](function(_0x14c1db){logger[_0xd702('0x12')]('entityFound:',_0x14c1db[_0xd702('0x18')]);emit(util['format'](_0xd702('0x30'),_0x14c1db[_0xd702('0x18')]),_0xd702('0x3b'),{'sessionId':_0x18012d});return _0x58047c['status'](0xc8)['json']({'error':![],'message':_0xd702('0x3c')});})[_0xd702('0x1e')](handleError(_0x58047c));};exports[_0xd702('0x3d')]=function(_0x397e91,_0x16e59b){logger[_0xd702('0x12')](_0xd702('0x3e'),_0x397e91[_0xd702('0x2a')]);var _0x7da555=unholdValidation[_0xd702('0x38')](_0x397e91['body']);if(_0x7da555['length']>0x0){return _0x16e59b[_0xd702('0x19')](0x190)[_0xd702('0x32')](_0x7da555);}var _0x229d47=_0x397e91['body']['userId'];var _0x831383=_0x397e91['body'][_0xd702('0x26')];return getAgent(_0x229d47)[_0xd702('0x21')](function(_0x18ef24){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x18ef24[_0xd702('0x18')]);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x18ef24[_0xd702('0x18')]),'webbar:unhold',{'sessionId':_0x831383});return _0x16e59b[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x3f')});})[_0xd702('0x1e')](handleError(_0x16e59b));};exports['calls']=function(_0x3f3045,_0x4e542a){logger[_0xd702('0x12')]('calls\x20fired:',_0x4e542a['body']);var _0x2a31c0=callsValidation[_0xd702('0x38')](_0x3f3045[_0xd702('0x2a')]);if(_0x2a31c0[_0xd702('0x27')]>0x0){return _0x4e542a[_0xd702('0x19')](0x190)[_0xd702('0x32')](_0x2a31c0);}var _0x5db532=_0x3f3045[_0xd702('0x2a')][_0xd702('0x34')];var _0x55719b=respondWithRpcPromise(_0xd702('0x22'));var _0x316520=getAgent(_0x5db532);return Promise[_0xd702('0x40')]([_0x55719b,_0x316520])[_0xd702('0x21')](function(_0x34a194){var _0x27e588=_0x34a194[0x0];var _0x554ab8=_0x34a194[0x1];var _0x2186e7=_[_0xd702('0x23')](_0x27e588[_0xd702('0x24')],function(_0x2e536a){return _0x2e536a[_0xd702('0x25')]==_0x554ab8['id'];});return _0x4e542a['status'](0xc8)['json']({'count':_0x2186e7[_0xd702('0x27')],'rows':_0x2186e7});})['catch'](handleError(_0x4e542a));};exports['conference']=function(_0x2fa2c7,_0x48e348){logger[_0xd702('0x12')](_0xd702('0x41'),_0x2fa2c7[_0xd702('0x2a')]);var _0x1ea97e=conferenceValidation['validate'](_0x2fa2c7[_0xd702('0x2a')]);if(_0x1ea97e['length']>0x0){return _0x48e348[_0xd702('0x19')](0x190)['json'](_0x1ea97e);}var _0x4453c5=_0x2fa2c7[_0xd702('0x2a')][_0xd702('0x34')];return getAgent(_0x4453c5)[_0xd702('0x21')](function(_0x329642){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x329642['name']);emit(util['format'](_0xd702('0x30'),_0x329642['name']),_0xd702('0x42'));return _0x48e348[_0xd702('0x19')](0xc8)['json']({'error':![],'message':_0xd702('0x43')});})[_0xd702('0x1e')](handleError(_0x48e348));};exports['transfer']=function(_0x1dbf12,_0x5e88cb){logger[_0xd702('0x12')](_0xd702('0x44'),_0x1dbf12[_0xd702('0x2a')]);var _0xc9611d=transferValidation['validate'](_0x1dbf12[_0xd702('0x2a')]);if(_0xc9611d[_0xd702('0x27')]>0x0){return _0x5e88cb[_0xd702('0x19')](0x190)[_0xd702('0x32')](_0xc9611d);}var _0x36a782=_0x1dbf12['body'][_0xd702('0x34')];var _0x1c514e=_0x1dbf12[_0xd702('0x2a')][_0xd702('0x26')];var _0x29fc86=_0x1dbf12[_0xd702('0x2a')]['transferNumber'];return getAgent(_0x36a782)[_0xd702('0x21')](function(_0x4f3e4f){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x4f3e4f[_0xd702('0x18')]);emit(util[_0xd702('0x2f')]('user:%s',_0x4f3e4f[_0xd702('0x18')]),_0xd702('0x45'),{'sessionId':_0x1c514e,'transferNumber':_0x29fc86});return _0x5e88cb[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x46')});})['catch'](handleError(_0x5e88cb));}; \ No newline at end of file +var _0xca66=['sessionId\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','code','message','result','catch','User','findOne','agent','all','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','hangup','hangup\x20fired:','validate','then','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','userId','sessionId','answer\x20executed!','hold','webbar:hold','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','VoiceChannels','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transferNumber','transfer\x20executed!','path','../../config/environment','util','bluebird','client','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required'];(function(_0x47c5bd,_0x7605da){var _0x2447dc=function(_0x1d4bff){while(--_0x1d4bff){_0x47c5bd['push'](_0x47c5bd['shift']());}};_0x2447dc(++_0x7605da);}(_0xca66,0x8b));var _0x6ca6=function(_0x49c82e,_0x5457d0){_0x49c82e=_0x49c82e-0x0;var _0x59934a=_0xca66[_0x49c82e];return _0x59934a;};'use strict';var path=require(_0x6ca6('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0x6ca6('0x1'));var util=require(_0x6ca6('0x2'));var BPromise=require(_0x6ca6('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x6ca6('0x4')]['http']({'port':0x232a});var logger=require(_0x6ca6('0x5'))('webbarapi');var Redis=require(_0x6ca6('0x6'));config[_0x6ca6('0x7')]=_[_0x6ca6('0x8')](config[_0x6ca6('0x7')],{'host':_0x6ca6('0x9'),'port':0x18eb});var io=require(_0x6ca6('0xa'))(new Redis(config[_0x6ca6('0x7')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],_0x6ca6('0xc')]},'callNumber':{'type':_0x6ca6('0xd'),'required':[!![],_0x6ca6('0xe')]},'callerId':{'type':_0x6ca6('0xd')},'callbackUrl':{'type':_0x6ca6('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x6ca6('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],_0x6ca6('0xc')]},'sessionId':{'type':_0x6ca6('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],_0x6ca6('0xc')]},'sessionId':{'type':'string','required':[!![],_0x6ca6('0xf')]},'transferNumber':{'type':_0x6ca6('0xd'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],_0x6ca6('0xc')]},'sessionId':{'type':_0x6ca6('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],_0x6ca6('0xc')]},'sessionId':{'type':_0x6ca6('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x6ca6('0xc')]}});function emit(_0x19e94f,_0x260b56,_0x3f03e6){logger[_0x6ca6('0x10')](_0x19e94f,_0x260b56,JSON[_0x6ca6('0x11')](_0x3f03e6));io['to'](_0x19e94f)[_0x6ca6('0x12')](_0x260b56,_0x3f03e6);}function handleError(_0x4f056d){return function(_0x2391ce){console[_0x6ca6('0x13')](_0x6ca6('0x14'),_0x2391ce,_0x2391ce instanceof RangeError);logger[_0x6ca6('0x15')](_0x2391ce[_0x6ca6('0x16')]);if(_0x2391ce instanceof RangeError){if(_0x2391ce[_0x6ca6('0x17')]){delete _0x2391ce[_0x6ca6('0x17')];}_0x4f056d[_0x6ca6('0x18')](0x194)[_0x6ca6('0x19')](_0x2391ce);}else{if(_0x2391ce[_0x6ca6('0x17')]){delete _0x2391ce[_0x6ca6('0x17')];}_0x4f056d['status'](0x1f4)[_0x6ca6('0x19')](_0x2391ce);}};}function checkError(){return function(_0x254afe){if(!_0x254afe){throw new RangeError(_0x6ca6('0x1a'));}return _0x254afe;};}function respondWithRpcPromise(_0x195c92,_0x3a24aa){return new BPromise(function(_0x438694,_0x593f15){var _0xfb962d=amiClient;return _0xfb962d[_0x6ca6('0x1b')](_0x195c92,_0x3a24aa)['then'](function(_0x4927c1){if(_0x4927c1[_0x6ca6('0x15')]){if(_0x4927c1[_0x6ca6('0x15')][_0x6ca6('0x1c')]===0x1f4){return _0x593f15(_0x4927c1[_0x6ca6('0x15')][_0x6ca6('0x1d')]);}return _0x438694(_0x4927c1['error'][_0x6ca6('0x1d')]);}else{_0x438694(_0x4927c1[_0x6ca6('0x1e')]);}})[_0x6ca6('0x1f')](function(_0x2d8c64){_0x593f15(_0x2d8c64);});});}function getAgent(_0x3971a2){return db[_0x6ca6('0x20')][_0x6ca6('0x21')]({'where':{'id':_0x3971a2,'role':_0x6ca6('0x22')}})['then'](checkError());}function getAgentCheckSession(_0x55b07f,_0x144ec5){return new BPromise(function(_0x9467bd,_0xf1d821){var _0x141c0f=respondWithRpcPromise('VoiceChannels');var _0x5ea6f7=getAgent(_0x55b07f);Promise[_0x6ca6('0x23')]([_0x141c0f,_0x5ea6f7])['then'](function(_0x4ab84c){var _0x141e78=_0x4ab84c[0x0];var _0xefd407=_0x4ab84c[0x1];var _0x4a15cb=_[_0x6ca6('0x24')](_0x141e78[_0x6ca6('0x25')],function(_0xac50e8){return _0xac50e8[_0x6ca6('0x26')]==_0xefd407['id']&&_0xac50e8['sessionId']==_0x144ec5;});if(_0x4a15cb[_0x6ca6('0x27')]==0x1){_0x9467bd(_0xefd407);}else{_0xf1d821(new RangeError(_0x6ca6('0x28')+_0x144ec5+_0x6ca6('0x29')));}});});}exports[_0x6ca6('0x2a')]=function(_0x480264,_0x467a89){logger[_0x6ca6('0x10')](_0x6ca6('0x2b'),_0x480264[_0x6ca6('0x2c')]);var _0x5788a2=originateValidation['validate'](_0x480264['body']);if(_0x5788a2['length']>0x0){return _0x467a89['status'](0x190)[_0x6ca6('0x2d')](_0x5788a2);}var _0x3389c2=_0x480264[_0x6ca6('0x2c')]['userId'];var _0x206ecd=_0x480264[_0x6ca6('0x2c')][_0x6ca6('0x2e')];var _0x388e32=_0x480264['body'][_0x6ca6('0x2f')];var _0x40de00=_0x480264[_0x6ca6('0x2c')][_0x6ca6('0x30')];return getAgent(_0x3389c2)['then'](function(_0x1e28b4){logger['info'](_0x6ca6('0x31'),_0x1e28b4['name']);emit(util['format'](_0x6ca6('0x32'),_0x1e28b4[_0x6ca6('0x17')]),_0x6ca6('0x33'),{'callNumber':_0x206ecd,'callerId':_0x388e32,'callbackUrl':_0x40de00});return _0x467a89[_0x6ca6('0x18')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x6ca6('0x1f')](handleError(_0x467a89));};exports[_0x6ca6('0x34')]=function(_0x49c8a4,_0x43c2cb){logger['info'](_0x6ca6('0x35'),_0x49c8a4['body']);var _0x1ada8b=hangupValidation[_0x6ca6('0x36')](_0x49c8a4[_0x6ca6('0x2c')]);if(_0x1ada8b[_0x6ca6('0x27')]>0x0){return _0x43c2cb[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0x1ada8b);}var _0x45e77b=_0x49c8a4[_0x6ca6('0x2c')]['userId'];var _0x2f6daf=_0x49c8a4['body']['sessionId'];return getAgent(_0x45e77b)[_0x6ca6('0x37')](function(_0x306eda){logger['info'](_0x6ca6('0x31'),_0x306eda['name']);emit(util[_0x6ca6('0x38')](_0x6ca6('0x32'),_0x306eda[_0x6ca6('0x17')]),_0x6ca6('0x39'),{'sessionId':_0x2f6daf});return _0x43c2cb['status'](0xc8)['json']({'error':![],'message':_0x6ca6('0x3a')});})[_0x6ca6('0x1f')](handleError(_0x43c2cb));};exports[_0x6ca6('0x3b')]=function(_0x3423e2,_0x4e6d4){logger['info'](_0x6ca6('0x3c'),_0x3423e2[_0x6ca6('0x2c')]);var _0x5bed6e=answerValidation[_0x6ca6('0x36')](_0x3423e2[_0x6ca6('0x2c')]);if(_0x5bed6e[_0x6ca6('0x27')]>0x0){return _0x4e6d4[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0x5bed6e);}var _0x3e658e=_0x3423e2[_0x6ca6('0x2c')][_0x6ca6('0x3d')];var _0x1a8b7e=_0x3423e2['body'][_0x6ca6('0x3e')];return getAgent(_0x3e658e)[_0x6ca6('0x37')](function(_0x243661){logger[_0x6ca6('0x10')](_0x6ca6('0x31'),_0x243661[_0x6ca6('0x17')]);emit(util[_0x6ca6('0x38')](_0x6ca6('0x32'),_0x243661['name']),'webbar:answer',{'sessionId':_0x1a8b7e});return _0x4e6d4[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'error':![],'message':_0x6ca6('0x3f')});})[_0x6ca6('0x1f')](handleError(_0x4e6d4));};exports[_0x6ca6('0x40')]=function(_0x33f5d5,_0x1f51f4){logger['info']('hold\x20fired:',_0x33f5d5[_0x6ca6('0x2c')]);var _0x42b263=holdValidation['validate'](_0x33f5d5[_0x6ca6('0x2c')]);if(_0x42b263[_0x6ca6('0x27')]>0x0){return _0x1f51f4[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0x42b263);}var _0xc1928f=_0x33f5d5[_0x6ca6('0x2c')][_0x6ca6('0x3d')];var _0x5f27f5=_0x33f5d5[_0x6ca6('0x2c')][_0x6ca6('0x3e')];return getAgent(_0xc1928f)[_0x6ca6('0x37')](function(_0x4fde51){logger[_0x6ca6('0x10')]('entityFound:',_0x4fde51[_0x6ca6('0x17')]);emit(util['format']('user:%s',_0x4fde51['name']),_0x6ca6('0x41'),{'sessionId':_0x5f27f5});return _0x1f51f4[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'error':![],'message':'hold\x20executed!'});})[_0x6ca6('0x1f')](handleError(_0x1f51f4));};exports['unhold']=function(_0x1f552d,_0x1010a6){logger[_0x6ca6('0x10')](_0x6ca6('0x42'),_0x1f552d[_0x6ca6('0x2c')]);var _0x2e6364=unholdValidation[_0x6ca6('0x36')](_0x1f552d[_0x6ca6('0x2c')]);if(_0x2e6364[_0x6ca6('0x27')]>0x0){return _0x1010a6[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0x2e6364);}var _0x5578fb=_0x1f552d[_0x6ca6('0x2c')][_0x6ca6('0x3d')];var _0x1de2ca=_0x1f552d[_0x6ca6('0x2c')][_0x6ca6('0x3e')];return getAgent(_0x5578fb)['then'](function(_0x14d87a){logger[_0x6ca6('0x10')](_0x6ca6('0x31'),_0x14d87a['name']);emit(util['format']('user:%s',_0x14d87a['name']),_0x6ca6('0x43'),{'sessionId':_0x1de2ca});return _0x1010a6[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x1010a6));};exports[_0x6ca6('0x44')]=function(_0x2cbf30,_0x2591de){logger['info'](_0x6ca6('0x45'),_0x2591de['body']);var _0x281759=callsValidation[_0x6ca6('0x36')](_0x2cbf30[_0x6ca6('0x2c')]);if(_0x281759[_0x6ca6('0x27')]>0x0){return _0x2591de['status'](0x190)[_0x6ca6('0x2d')](_0x281759);}var _0x4874d8=_0x2cbf30['body'][_0x6ca6('0x3d')];var _0x11538e=respondWithRpcPromise(_0x6ca6('0x46'));var _0x35854a=getAgent(_0x4874d8);return Promise['all']([_0x11538e,_0x35854a])[_0x6ca6('0x37')](function(_0x1c12ae){var _0x2c4053=_0x1c12ae[0x0];var _0x13d3ea=_0x1c12ae[0x1];var _0x43881a=_[_0x6ca6('0x24')](_0x2c4053[_0x6ca6('0x25')],function(_0x405609){return _0x405609[_0x6ca6('0x26')]==_0x13d3ea['id'];});return _0x2591de[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'count':_0x43881a[_0x6ca6('0x27')],'rows':_0x43881a});})[_0x6ca6('0x1f')](handleError(_0x2591de));};exports[_0x6ca6('0x47')]=function(_0x2eeed6,_0x290c04){logger['info'](_0x6ca6('0x48'),_0x2eeed6[_0x6ca6('0x2c')]);var _0x2f4886=conferenceValidation[_0x6ca6('0x36')](_0x2eeed6[_0x6ca6('0x2c')]);if(_0x2f4886[_0x6ca6('0x27')]>0x0){return _0x290c04[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0x2f4886);}var _0x3328ea=_0x2eeed6[_0x6ca6('0x2c')][_0x6ca6('0x3d')];return getAgent(_0x3328ea)[_0x6ca6('0x37')](function(_0x9834d6){logger[_0x6ca6('0x10')](_0x6ca6('0x31'),_0x9834d6[_0x6ca6('0x17')]);emit(util['format'](_0x6ca6('0x32'),_0x9834d6[_0x6ca6('0x17')]),_0x6ca6('0x49'));return _0x290c04[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'error':![],'message':_0x6ca6('0x4a')});})['catch'](handleError(_0x290c04));};exports['transfer']=function(_0x509fe3,_0x21f786){logger[_0x6ca6('0x10')]('transfer\x20fired:',_0x509fe3[_0x6ca6('0x2c')]);var _0xc6021a=transferValidation[_0x6ca6('0x36')](_0x509fe3['body']);if(_0xc6021a[_0x6ca6('0x27')]>0x0){return _0x21f786[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0xc6021a);}var _0x1c3064=_0x509fe3[_0x6ca6('0x2c')]['userId'];var _0x514684=_0x509fe3[_0x6ca6('0x2c')][_0x6ca6('0x3e')];var _0x47d420=_0x509fe3[_0x6ca6('0x2c')][_0x6ca6('0x4b')];return getAgent(_0x1c3064)[_0x6ca6('0x37')](function(_0x19e7ac){logger[_0x6ca6('0x10')](_0x6ca6('0x31'),_0x19e7ac[_0x6ca6('0x17')]);emit(util[_0x6ca6('0x38')](_0x6ca6('0x32'),_0x19e7ac['name']),'webbar:transfer',{'sessionId':_0x514684,'transferNumber':_0x47d420});return _0x21f786[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'error':![],'message':_0x6ca6('0x4c')});})[_0x6ca6('0x1f')](handleError(_0x21f786));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index dd9ecc7..04bd6ad 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7096=['removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/notify','/:id/send','send','/:id','update','delete','destroy','removeDispositions','removeAnswers'];(function(_0x1537a3,_0x50834a){var _0x23390f=function(_0x4c86d3){while(--_0x4c86d3){_0x1537a3['push'](_0x1537a3['shift']());}};_0x23390f(++_0x50834a);}(_0x7096,0x10c));var _0x6709=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x7096[_0x411add];return _0x238242;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['get']('/:id',auth[_0x6709('0x9')](),controller[_0x6709('0xd')]);router[_0x6709('0x8')](_0x6709('0xe'),auth[_0x6709('0x9')](),controller[_0x6709('0xf')]);router['get']('/:id/canned_answers',auth[_0x6709('0x9')](),controller[_0x6709('0x10')]);router[_0x6709('0x8')](_0x6709('0x11'),auth[_0x6709('0x9')](),controller[_0x6709('0x12')]);router[_0x6709('0x8')](_0x6709('0x13'),auth['isAuthenticated'](),controller[_0x6709('0x14')]);router[_0x6709('0x15')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0x16')]);router['post'](_0x6709('0xe'),auth['isAuthenticated'](),controller[_0x6709('0x17')]);router['post'](_0x6709('0x18'),auth[_0x6709('0x9')](),controller[_0x6709('0x19')]);router[_0x6709('0x15')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x6709('0x15')](_0x6709('0x13'),auth['isAuthenticated'](),controller[_0x6709('0x1a')]);router[_0x6709('0x15')](_0x6709('0x1b'),controller['notify']);router[_0x6709('0x15')](_0x6709('0x1c'),auth[_0x6709('0x9')](),controller[_0x6709('0x1d')]);router['put'](_0x6709('0x1e'),auth[_0x6709('0x9')](),controller[_0x6709('0x1f')]);router[_0x6709('0x20')](_0x6709('0x1e'),auth[_0x6709('0x9')](),controller[_0x6709('0x21')]);router[_0x6709('0x20')](_0x6709('0xe'),auth[_0x6709('0x9')](),controller[_0x6709('0x22')]);router[_0x6709('0x20')]('/:id/canned_answers',auth[_0x6709('0x9')](),controller[_0x6709('0x23')]);router[_0x6709('0x20')]('/:id/users',auth[_0x6709('0x9')](),controller[_0x6709('0x24')]);module[_0x6709('0x25')]=router; \ No newline at end of file +var _0xe2fe=['removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','destroy','delete','removeDispositions','removeAnswers'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./whatsappAccount.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x7')](_0xee2f('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xee2f('0x8')](),controller['getAnswers']);router['get']('/:id/users',auth[_0xee2f('0x8')](),controller[_0xee2f('0xd')]);router[_0xee2f('0x7')](_0xee2f('0xe'),auth[_0xee2f('0x8')](),controller[_0xee2f('0xf')]);router['post']('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0x10')](_0xee2f('0xc'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router[_0xee2f('0x10')](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x13')]);router['post'](_0xee2f('0x14'),auth['isAuthenticated'](),controller[_0xee2f('0x15')]);router[_0xee2f('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0xee2f('0x16')]);router['post'](_0xee2f('0x17'),controller[_0xee2f('0x18')]);router[_0xee2f('0x10')]('/:id/send',auth[_0xee2f('0x8')](),controller[_0xee2f('0x19')]);router[_0xee2f('0x1a')](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['update']);router['delete'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1b')]);router[_0xee2f('0x1c')](_0xee2f('0xc'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1d')]);router['delete'](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1e')]);router[_0xee2f('0x1c')](_0xee2f('0x14'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1f')]);module[_0xee2f('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 95ae310..f4e0cff 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd803=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x47f144,_0x38fdc7){var _0x1ac89a=function(_0x48d065){while(--_0x48d065){_0x47f144['push'](_0x47f144['shift']());}};_0x1ac89a(++_0x38fdc7);}(_0xd803,0x19b));var _0x3d80=function(_0x571809,_0x5cd967){_0x571809=_0x571809-0x0;var _0xc22642=_0xd803[_0x571809];return _0xc22642;};'use strict';var Sequelize=require(_0x3d80('0x0'));var rs=require(_0x3d80('0x1'));module['exports']={'name':{'type':Sequelize[_0x3d80('0x2')],'unique':_0x3d80('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x3d80('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x3d80('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x3d80('0x2')],'defaultValue':function(){return rs[_0x3d80('0x4')]();}},'phone':{'type':Sequelize[_0x3d80('0x2')]},'type':{'type':Sequelize['ENUM'](_0x3d80('0x5'),_0x3d80('0x6'))},'accountSid':{'type':Sequelize[_0x3d80('0x2')]},'baseUrl':{'type':Sequelize[_0x3d80('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x3d80('0x7');}},'notificationSound':{'type':Sequelize[_0x3d80('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x3d80('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3d80('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3d80('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3d80('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3d80('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3d80('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3d80('0xa'),'set':function(_0x25b552){if(!_0x25b552){this[_0x3d80('0xb')](_0x3d80('0xc'),null);}this['setDataValue'](_0x3d80('0xd'),_0x25b552);}},'description':{'type':Sequelize[_0x3d80('0x2')]}}; \ No newline at end of file +var _0x077e=['exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0xfb889f,_0x12597f){var _0x1a1cb1=function(_0x363c97){while(--_0x363c97){_0xfb889f['push'](_0xfb889f['shift']());}};_0x1a1cb1(++_0x12597f);}(_0x077e,0x1c0));var _0xe077=function(_0x352e4a,_0x18b9df){_0x352e4a=_0x352e4a-0x0;var _0x4d64e8=_0x077e[_0x352e4a];return _0x4d64e8;};'use strict';var Sequelize=require(_0xe077('0x0'));var rs=require(_0xe077('0x1'));module[_0xe077('0x2')]={'name':{'type':Sequelize[_0xe077('0x3')],'unique':_0xe077('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe077('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe077('0x5')]();}},'phone':{'type':Sequelize[_0xe077('0x3')]},'type':{'type':Sequelize[_0xe077('0x6')](_0xe077('0x7'),_0xe077('0x8'))},'accountSid':{'type':Sequelize[_0xe077('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xe077('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe077('0x9')],'defaultValue':function(){return _0xe077('0xa');}},'notificationSound':{'type':Sequelize[_0xe077('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe077('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe077('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe077('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe077('0xd')},'mandatoryDisposition':{'type':Sequelize[_0xe077('0xb')],'defaultValue':![],'comment':_0xe077('0xe'),'set':function(_0x4be00d){if(!_0x4be00d){this[_0xe077('0xf')](_0xe077('0x10'),null);}this['setDataValue'](_0xe077('0x11'),_0x4be00d);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 15aacea..490ec74 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd17=['to\x20is\x20mandatory','List','defaults','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','WhatsappAccount,\x20%s,\x20%s','message','catch','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','save','update','destroy','WhatsappAccounts','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','show','Pause','find','create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','sequelize','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','replace','Body','MessageSid','notifications','messageId','Sequelize','from\x20is\x20mandatory','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','Contacts','DESC','list','omit','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','created','ContactId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','set','Content-Type','text/xml','\x0a'];(function(_0x4f0245,_0x2a8193){var _0x307b6b=function(_0x40b9f5){while(--_0x40b9f5){_0x4f0245['push'](_0x4f0245['shift']());}};_0x307b6b(++_0x2a8193);}(_0xfd17,0x191));var _0x7fd1=function(_0x3869c8,_0x2ff137){_0x3869c8=_0x3869c8-0x0;var _0x4caf60=_0xfd17[_0x3869c8];return _0x4caf60;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7fd1('0x0'));var zipdir=require(_0x7fd1('0x1'));var jsonpatch=require(_0x7fd1('0x2'));var rp=require(_0x7fd1('0x3'));var moment=require(_0x7fd1('0x4'));var BPromise=require(_0x7fd1('0x5'));var Mustache=require('mustache');var util=require(_0x7fd1('0x6'));var path=require(_0x7fd1('0x7'));var sox=require(_0x7fd1('0x8'));var csv=require(_0x7fd1('0x9'));var ejs=require(_0x7fd1('0xa'));var fs=require('fs');var fs_extra=require(_0x7fd1('0xb'));var _=require(_0x7fd1('0xc'));var squel=require(_0x7fd1('0xd'));var crypto=require(_0x7fd1('0xe'));var jsforce=require(_0x7fd1('0xf'));var deskjs=require(_0x7fd1('0x10'));var toCsv=require(_0x7fd1('0x9'));var querystring=require(_0x7fd1('0x11'));var Papa=require('papaparse');var Redis=require(_0x7fd1('0x12'));var authService=require(_0x7fd1('0x13'));var qs=require(_0x7fd1('0x14'));var as=require(_0x7fd1('0x15'));var hardwareService=require(_0x7fd1('0x16'));var logger=require(_0x7fd1('0x17'))(_0x7fd1('0x18'));var utils=require(_0x7fd1('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7fd1('0x1a'));var db=require(_0x7fd1('0x1b'))['db'];config[_0x7fd1('0x1c')]=_['defaults'](config[_0x7fd1('0x1c')],{'host':_0x7fd1('0x1d'),'port':0x18eb});var socket=require(_0x7fd1('0x1e'))(new Redis(config[_0x7fd1('0x1c')]));require('./whatsappAccount.socket')[_0x7fd1('0x1f')](socket);var jayson=require(_0x7fd1('0x20'));var client=jayson[_0x7fd1('0x21')][_0x7fd1('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x2153f,_0x46f498,_0x3b60ab,_0x5d6eff){return new BPromise(function(_0x4b671f,_0xdc4154){var _0x32c817=_0x5d6eff||client;return _0x32c817[_0x7fd1('0x23')](_0x2153f,_0x3b60ab)[_0x7fd1('0x24')](function(_0x43d02b){logger[_0x7fd1('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x46f498,_0x7fd1('0x26'));logger[_0x7fd1('0x27')](_0x7fd1('0x28'),_0x46f498,_0x7fd1('0x26'),JSON[_0x7fd1('0x29')](_0x43d02b));if(_0x43d02b['error']){if(_0x43d02b['error'][_0x7fd1('0x2a')]===0x1f4){logger[_0x7fd1('0x2b')](_0x7fd1('0x2c'),_0x46f498,_0x43d02b[_0x7fd1('0x2b')][_0x7fd1('0x2d')]);return _0xdc4154(_0x43d02b[_0x7fd1('0x2b')][_0x7fd1('0x2d')]);}logger[_0x7fd1('0x2b')]('WhatsappAccount,\x20%s,\x20%s',_0x46f498,_0x43d02b[_0x7fd1('0x2b')]['message']);return _0x4b671f(_0x43d02b[_0x7fd1('0x2b')][_0x7fd1('0x2d')]);}else{logger[_0x7fd1('0x25')](_0x7fd1('0x2c'),_0x46f498,_0x7fd1('0x26'));_0x4b671f(_0x43d02b['result'][_0x7fd1('0x2d')]);}})[_0x7fd1('0x2e')](function(_0x205b7f){logger['error'](_0x7fd1('0x2c'),_0x46f498,_0x205b7f);_0xdc4154(_0x205b7f);});});}function respondWithStatusCode(_0x52fc16,_0x299a28){_0x299a28=_0x299a28||0xcc;return function(_0x22a014){if(_0x22a014){return _0x52fc16[_0x7fd1('0x2f')](_0x299a28);}return _0x52fc16['status'](_0x299a28)[_0x7fd1('0x30')]();};}function respondWithResult(_0x1c4b65,_0x255b99){_0x255b99=_0x255b99||0xc8;return function(_0x37083a){if(_0x37083a){return _0x1c4b65[_0x7fd1('0x31')](_0x255b99)['json'](_0x37083a);}};}function respondWithFilteredResult(_0x18d64a,_0x705ca3){return function(_0x546623){if(_0x546623){var _0x4d501a=typeof _0x705ca3[_0x7fd1('0x32')]===_0x7fd1('0x33')&&typeof _0x705ca3[_0x7fd1('0x34')]==='undefined';var _0x1db6d8=_0x546623[_0x7fd1('0x35')];var _0x2afbb3=_0x4d501a?0x0:_0x705ca3[_0x7fd1('0x32')];var _0x2be6a9=_0x4d501a?_0x546623['count']:_0x705ca3[_0x7fd1('0x32')]+_0x705ca3[_0x7fd1('0x34')];var _0x447d61;if(_0x2be6a9>=_0x1db6d8){_0x2be6a9=_0x1db6d8;_0x447d61=0xc8;}else{_0x447d61=0xce;}_0x18d64a[_0x7fd1('0x31')](_0x447d61);return _0x18d64a['set'](_0x7fd1('0x36'),_0x2afbb3+'-'+_0x2be6a9+'/'+_0x1db6d8)[_0x7fd1('0x37')](_0x546623);}return null;};}function patchUpdates(_0x5a2405){return function(_0x4d9609){try{jsonpatch['apply'](_0x4d9609,_0x5a2405,!![]);}catch(_0x30be65){return BPromise['reject'](_0x30be65);}return _0x4d9609[_0x7fd1('0x38')]();};}function saveUpdates(_0x4debd9,_0x10901d){return function(_0x2db298){if(_0x2db298){return _0x2db298[_0x7fd1('0x39')](_0x4debd9)[_0x7fd1('0x24')](function(_0x1c94cf){return _0x1c94cf;});}return null;};}function removeEntity(_0x5cb8f2,_0x160391){return function(_0x6bc6e1){if(_0x6bc6e1){return _0x6bc6e1[_0x7fd1('0x3a')]()['then'](function(){var _0x4a731a=_0x6bc6e1['get']({'plain':!![]});var _0xd6119d=_0x7fd1('0x3b');return db['UserProfileResource'][_0x7fd1('0x3a')]({'where':{'type':_0xd6119d,'resourceId':_0x4a731a['id']}})[_0x7fd1('0x24')](function(){return _0x6bc6e1;});})[_0x7fd1('0x24')](function(){_0x5cb8f2[_0x7fd1('0x31')](0xcc)[_0x7fd1('0x30')]();});}};}function handleEntityNotFound(_0x3c1d5b,_0x140ac9){return function(_0x7d796d){if(!_0x7d796d){_0x3c1d5b['sendStatus'](0x194);}return _0x7d796d;};}function handleError(_0x26020f,_0x40fc20){_0x40fc20=_0x40fc20||0x1f4;return function(_0x335f99){logger[_0x7fd1('0x2b')](_0x335f99['stack']);if(_0x335f99[_0x7fd1('0x3c')]){delete _0x335f99[_0x7fd1('0x3c')];}_0x26020f[_0x7fd1('0x31')](_0x40fc20)[_0x7fd1('0x3d')](_0x335f99);};}exports[_0x7fd1('0x3e')]=function(_0x4bcd9b,_0x40aa4c){var _0x4e1682={'include':[{'model':db['Pause'],'as':_0x7fd1('0x3f')}]},_0xa4e4ff={},_0x20c041={'count':0x0,'rows':[]};var _0x334153=_[_0x7fd1('0x40')](db[_0x7fd1('0x41')][_0x7fd1('0x42')],function(_0x37b279){return{'name':_0x37b279['fieldName'],'type':_0x37b279[_0x7fd1('0x43')][_0x7fd1('0x44')]};});_0xa4e4ff['model']=_[_0x7fd1('0x40')](_0x334153,_0x7fd1('0x3c'));_0xa4e4ff[_0x7fd1('0x45')]=_[_0x7fd1('0x46')](_0x4bcd9b[_0x7fd1('0x45')]);_0xa4e4ff[_0x7fd1('0x47')]=_['intersection'](_0xa4e4ff[_0x7fd1('0x48')],_0xa4e4ff['query']);_0x4e1682[_0x7fd1('0x49')]=_[_0x7fd1('0x4a')](_0xa4e4ff[_0x7fd1('0x48')],qs[_0x7fd1('0x4b')](_0x4bcd9b[_0x7fd1('0x45')]['fields']));_0x4e1682[_0x7fd1('0x49')]=_0x4e1682[_0x7fd1('0x49')][_0x7fd1('0x4c')]?_0x4e1682[_0x7fd1('0x49')]:_0xa4e4ff[_0x7fd1('0x48')];if(!_0x4bcd9b[_0x7fd1('0x45')]['hasOwnProperty']('nolimit')){_0x4e1682[_0x7fd1('0x34')]=qs['limit'](_0x4bcd9b['query']['limit']);_0x4e1682[_0x7fd1('0x32')]=qs[_0x7fd1('0x32')](_0x4bcd9b[_0x7fd1('0x45')][_0x7fd1('0x32')]);}_0x4e1682['order']=qs['sort'](_0x4bcd9b['query'][_0x7fd1('0x4d')]);_0x4e1682[_0x7fd1('0x4e')]=qs['filters'](_[_0x7fd1('0x4f')](_0x4bcd9b[_0x7fd1('0x45')],_0xa4e4ff[_0x7fd1('0x47')]),_0x334153);if(_0x4bcd9b[_0x7fd1('0x45')]['filter']){_0x4e1682[_0x7fd1('0x4e')]=_['merge'](_0x4e1682[_0x7fd1('0x4e')],{'$or':_[_0x7fd1('0x40')](_0x334153,function(_0x2f25a5){if(_0x2f25a5[_0x7fd1('0x43')]!==_0x7fd1('0x50')){var _0x39cbdd={};_0x39cbdd[_0x2f25a5[_0x7fd1('0x3c')]]={'$like':'%'+_0x4bcd9b[_0x7fd1('0x45')][_0x7fd1('0x51')]+'%'};return _0x39cbdd;}})});}_0x4e1682=_[_0x7fd1('0x52')]({},_0x4e1682,_0x4bcd9b[_0x7fd1('0x53')]);var _0x10afe2={'where':_0x4e1682[_0x7fd1('0x4e')]};return db[_0x7fd1('0x41')]['count'](_0x10afe2)['then'](function(_0x2a2c45){_0x20c041[_0x7fd1('0x35')]=_0x2a2c45;if(_0x4bcd9b[_0x7fd1('0x45')][_0x7fd1('0x54')]){_0x4e1682[_0x7fd1('0x55')]=[{'all':!![]}];}return db[_0x7fd1('0x41')]['findAll'](_0x4e1682);})[_0x7fd1('0x24')](function(_0x5d5741){_0x20c041[_0x7fd1('0x56')]=_0x5d5741;return _0x20c041;})['then'](respondWithFilteredResult(_0x40aa4c,_0x4e1682))[_0x7fd1('0x2e')](handleError(_0x40aa4c,null));};exports[_0x7fd1('0x57')]=function(_0x1f7c1c,_0x2d64fe){var _0x4d9473={'raw':![],'where':{'id':_0x1f7c1c['params']['id']},'include':[{'model':db[_0x7fd1('0x58')],'as':_0x7fd1('0x3f')}]},_0x46c378={};_0x46c378[_0x7fd1('0x48')]=_[_0x7fd1('0x46')](db[_0x7fd1('0x41')][_0x7fd1('0x42')]);_0x46c378[_0x7fd1('0x45')]=_[_0x7fd1('0x46')](_0x1f7c1c[_0x7fd1('0x45')]);_0x46c378[_0x7fd1('0x47')]=_[_0x7fd1('0x4a')](_0x46c378['model'],_0x46c378[_0x7fd1('0x45')]);_0x4d9473[_0x7fd1('0x49')]=_[_0x7fd1('0x4a')](_0x46c378[_0x7fd1('0x48')],qs[_0x7fd1('0x4b')](_0x1f7c1c[_0x7fd1('0x45')][_0x7fd1('0x4b')]));_0x4d9473[_0x7fd1('0x49')]=_0x4d9473[_0x7fd1('0x49')][_0x7fd1('0x4c')]?_0x4d9473[_0x7fd1('0x49')]:_0x46c378[_0x7fd1('0x48')];if(_0x1f7c1c['query']['includeAll']){_0x4d9473[_0x7fd1('0x55')]=[{'all':!![]}];}_0x4d9473=_['merge']({},_0x4d9473,_0x1f7c1c[_0x7fd1('0x53')]);return db[_0x7fd1('0x41')][_0x7fd1('0x59')](_0x4d9473)[_0x7fd1('0x24')](handleEntityNotFound(_0x2d64fe,null))[_0x7fd1('0x24')](respondWithResult(_0x2d64fe,null))[_0x7fd1('0x2e')](handleError(_0x2d64fe,null));};exports[_0x7fd1('0x5a')]=function(_0x2036c4,_0x270356){return db[_0x7fd1('0x41')]['create'](_0x2036c4[_0x7fd1('0x5b')],{})[_0x7fd1('0x24')](function(_0x4623b7){var _0x3f0022=_0x2036c4[_0x7fd1('0x5c')][_0x7fd1('0x5d')]({'plain':!![]});if(!_0x3f0022)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f0022[_0x7fd1('0x5e')]===_0x7fd1('0x5c')){var _0x5cf86c=_0x4623b7[_0x7fd1('0x5d')]({'plain':!![]});var _0x5a553e=_0x7fd1('0x3b');return db[_0x7fd1('0x5f')]['find']({'where':{'name':_0x5a553e,'userProfileId':_0x3f0022[_0x7fd1('0x60')]},'raw':!![]})[_0x7fd1('0x24')](function(_0x3ceb9d){if(_0x3ceb9d&&_0x3ceb9d['autoAssociation']===0x0){return db['UserProfileResource'][_0x7fd1('0x5a')]({'name':_0x5cf86c[_0x7fd1('0x3c')],'resourceId':_0x5cf86c['id'],'type':_0x3ceb9d[_0x7fd1('0x3c')],'sectionId':_0x3ceb9d['id']},{})[_0x7fd1('0x24')](function(){return _0x4623b7;});}else{return _0x4623b7;}})['catch'](function(_0x572d0f){logger['error'](_0x7fd1('0x61'),_0x572d0f);throw _0x572d0f;});}return _0x4623b7;})['then'](respondWithResult(_0x270356,0xc9))[_0x7fd1('0x2e')](handleError(_0x270356,null));};exports[_0x7fd1('0x39')]=function(_0xde1e52,_0x48152d){if(_0xde1e52[_0x7fd1('0x5b')]['id']){delete _0xde1e52['body']['id'];}return db[_0x7fd1('0x41')][_0x7fd1('0x59')]({'where':{'id':_0xde1e52['params']['id']},'include':[{'model':db[_0x7fd1('0x58')],'as':'mandatoryDispositionPause'}]})[_0x7fd1('0x24')](handleEntityNotFound(_0x48152d,null))['then'](saveUpdates(_0xde1e52[_0x7fd1('0x5b')],null))[_0x7fd1('0x24')](respondWithResult(_0x48152d,null))[_0x7fd1('0x2e')](handleError(_0x48152d,null));};exports[_0x7fd1('0x3a')]=function(_0x121901,_0x4d19ed){return db[_0x7fd1('0x41')][_0x7fd1('0x59')]({'where':{'id':_0x121901[_0x7fd1('0x62')]['id']}})['then'](handleEntityNotFound(_0x4d19ed,null))[_0x7fd1('0x24')](removeEntity(_0x4d19ed,null))[_0x7fd1('0x2e')](handleError(_0x4d19ed,null));};exports[_0x7fd1('0x63')]=function(_0x58e997,_0x44f89b){return db[_0x7fd1('0x41')]['describe']()['then'](respondWithResult(_0x44f89b,null))['catch'](handleError(_0x44f89b,null));};exports['addDisposition']=function(_0x441f43,_0x39f043,_0x2cbaf9){if(_0x441f43[_0x7fd1('0x5b')]['id']){delete _0x441f43[_0x7fd1('0x5b')]['id'];}return db[_0x7fd1('0x41')][_0x7fd1('0x59')]({'where':{'id':_0x441f43[_0x7fd1('0x62')]['id']}})['then'](handleEntityNotFound(_0x39f043,null))[_0x7fd1('0x24')](function(_0x4a3625){if(_0x4a3625){_0x441f43[_0x7fd1('0x5b')][_0x7fd1('0x64')]=_0x4a3625['id'];return db[_0x7fd1('0x65')][_0x7fd1('0x5a')](_0x441f43[_0x7fd1('0x5b')]);}})[_0x7fd1('0x24')](respondWithResult(_0x39f043,null))[_0x7fd1('0x2e')](handleError(_0x39f043,null));};exports[_0x7fd1('0x66')]=function(_0x258a9d,_0x56aece,_0x1dddd3){var _0x2eb7ca={'raw':![],'where':{}};var _0x47b327={};var _0x1af6e5={'count':0x0,'rows':[]};return db[_0x7fd1('0x41')][_0x7fd1('0x67')]({'where':{'id':_0x258a9d[_0x7fd1('0x62')]['id']}})[_0x7fd1('0x24')](handleEntityNotFound(_0x56aece,null))[_0x7fd1('0x24')](function(_0xff19c5){if(_0xff19c5){_0x47b327[_0x7fd1('0x48')]=_[_0x7fd1('0x46')](db[_0x7fd1('0x65')]['rawAttributes']);_0x47b327[_0x7fd1('0x45')]=_[_0x7fd1('0x46')](_0x258a9d[_0x7fd1('0x45')]);_0x47b327[_0x7fd1('0x47')]=_[_0x7fd1('0x4a')](_0x47b327[_0x7fd1('0x48')],_0x47b327['query']);_0x2eb7ca[_0x7fd1('0x49')]=_['intersection'](_0x47b327[_0x7fd1('0x48')],qs[_0x7fd1('0x4b')](_0x258a9d[_0x7fd1('0x45')][_0x7fd1('0x4b')]));_0x2eb7ca['attributes']=_0x2eb7ca[_0x7fd1('0x49')][_0x7fd1('0x4c')]?_0x2eb7ca['attributes']:_0x47b327[_0x7fd1('0x48')];if(!_0x258a9d[_0x7fd1('0x45')][_0x7fd1('0x68')](_0x7fd1('0x69'))){_0x2eb7ca['limit']=qs[_0x7fd1('0x34')](_0x258a9d[_0x7fd1('0x45')]['limit']);_0x2eb7ca[_0x7fd1('0x32')]=qs[_0x7fd1('0x32')](_0x258a9d[_0x7fd1('0x45')][_0x7fd1('0x32')]);}_0x2eb7ca[_0x7fd1('0x6a')]=qs['sort'](_0x258a9d['query'][_0x7fd1('0x4d')]);_0x2eb7ca[_0x7fd1('0x4e')]=qs[_0x7fd1('0x47')](_[_0x7fd1('0x4f')](_0x258a9d[_0x7fd1('0x45')],_0x47b327[_0x7fd1('0x47')]));_0x2eb7ca['where'][_0x7fd1('0x64')]=_0xff19c5['id'];if(_0x258a9d[_0x7fd1('0x45')]['filter']){_0x2eb7ca[_0x7fd1('0x4e')]=_[_0x7fd1('0x52')](_0x2eb7ca[_0x7fd1('0x4e')],{'$or':_[_0x7fd1('0x40')](_0x2eb7ca[_0x7fd1('0x49')],function(_0x3f2c34){var _0x15f9f2={};_0x15f9f2[_0x3f2c34]={'$like':'%'+_0x258a9d[_0x7fd1('0x45')][_0x7fd1('0x51')]+'%'};return _0x15f9f2;})});}_0x2eb7ca=_[_0x7fd1('0x52')]({},_0x2eb7ca,_0x258a9d[_0x7fd1('0x53')]);return db['Disposition'][_0x7fd1('0x35')]({'where':_0x2eb7ca[_0x7fd1('0x4e')]})['then'](function(_0x516af3){_0x1af6e5[_0x7fd1('0x35')]=_0x516af3;if(_0x258a9d['query'][_0x7fd1('0x54')]){_0x2eb7ca[_0x7fd1('0x55')]=[{'all':!![]}];}return db[_0x7fd1('0x65')][_0x7fd1('0x6b')](_0x2eb7ca);})[_0x7fd1('0x24')](function(_0x557215){_0x1af6e5['rows']=_0x557215;return _0x1af6e5;});}})['then'](respondWithFilteredResult(_0x56aece,_0x2eb7ca))[_0x7fd1('0x2e')](handleError(_0x56aece,null));};exports[_0x7fd1('0x6c')]=function(_0xfa91fe,_0x5229ac,_0x370a02){return db['WhatsappAccount']['find']({'where':{'id':_0xfa91fe[_0x7fd1('0x62')]['id']}})['then'](handleEntityNotFound(_0x5229ac,null))[_0x7fd1('0x24')](function(_0x4e3f6d){if(_0x4e3f6d){return _0x4e3f6d[_0x7fd1('0x6c')](_0xfa91fe['query'][_0x7fd1('0x6d')]);}})[_0x7fd1('0x24')](respondWithStatusCode(_0x5229ac,null))[_0x7fd1('0x2e')](handleError(_0x5229ac,null));};exports[_0x7fd1('0x6e')]=function(_0x1a8ff9,_0x2dde64,_0x1f5883){if(_0x1a8ff9[_0x7fd1('0x5b')]['id']){delete _0x1a8ff9[_0x7fd1('0x5b')]['id'];}return db[_0x7fd1('0x41')][_0x7fd1('0x59')]({'where':{'id':_0x1a8ff9[_0x7fd1('0x62')]['id']}})[_0x7fd1('0x24')](handleEntityNotFound(_0x2dde64,null))[_0x7fd1('0x24')](function(_0x4aad19){if(_0x4aad19){_0x1a8ff9[_0x7fd1('0x5b')][_0x7fd1('0x64')]=_0x4aad19['id'];return db[_0x7fd1('0x6f')]['create'](_0x1a8ff9[_0x7fd1('0x5b')]);}})[_0x7fd1('0x24')](respondWithResult(_0x2dde64,null))[_0x7fd1('0x2e')](handleError(_0x2dde64,null));};exports['getAnswers']=function(_0x301752,_0x2604d5,_0x582bbb){var _0x441900={'raw':![],'where':{}};var _0x277161={};var _0xd14203={'count':0x0,'rows':[]};return db[_0x7fd1('0x41')]['findOne']({'where':{'id':_0x301752[_0x7fd1('0x62')]['id']}})['then'](handleEntityNotFound(_0x2604d5,null))[_0x7fd1('0x24')](function(_0x4fb58e){if(_0x4fb58e){_0x277161[_0x7fd1('0x48')]=_['keys'](db[_0x7fd1('0x6f')][_0x7fd1('0x42')]);_0x277161[_0x7fd1('0x45')]=_[_0x7fd1('0x46')](_0x301752[_0x7fd1('0x45')]);_0x277161[_0x7fd1('0x47')]=_[_0x7fd1('0x4a')](_0x277161[_0x7fd1('0x48')],_0x277161[_0x7fd1('0x45')]);_0x441900[_0x7fd1('0x49')]=_['intersection'](_0x277161[_0x7fd1('0x48')],qs[_0x7fd1('0x4b')](_0x301752['query']['fields']));_0x441900['attributes']=_0x441900[_0x7fd1('0x49')][_0x7fd1('0x4c')]?_0x441900[_0x7fd1('0x49')]:_0x277161['model'];if(!_0x301752[_0x7fd1('0x45')][_0x7fd1('0x68')]('nolimit')){_0x441900['limit']=qs[_0x7fd1('0x34')](_0x301752[_0x7fd1('0x45')][_0x7fd1('0x34')]);_0x441900[_0x7fd1('0x32')]=qs[_0x7fd1('0x32')](_0x301752[_0x7fd1('0x45')][_0x7fd1('0x32')]);}_0x441900[_0x7fd1('0x6a')]=qs[_0x7fd1('0x4d')](_0x301752[_0x7fd1('0x45')]['sort']);_0x441900['where']=qs['filters'](_[_0x7fd1('0x4f')](_0x301752[_0x7fd1('0x45')],_0x277161[_0x7fd1('0x47')]));_0x441900[_0x7fd1('0x4e')][_0x7fd1('0x64')]=_0x4fb58e['id'];if(_0x301752[_0x7fd1('0x45')][_0x7fd1('0x51')]){_0x441900[_0x7fd1('0x4e')]=_[_0x7fd1('0x52')](_0x441900[_0x7fd1('0x4e')],{'$or':_[_0x7fd1('0x40')](_0x441900[_0x7fd1('0x49')],function(_0x22a552){var _0x4b5b9b={};_0x4b5b9b[_0x22a552]={'$like':'%'+_0x301752[_0x7fd1('0x45')][_0x7fd1('0x51')]+'%'};return _0x4b5b9b;})});}_0x441900=_[_0x7fd1('0x52')]({},_0x441900,_0x301752['options']);return db[_0x7fd1('0x6f')][_0x7fd1('0x35')]({'where':_0x441900['where']})['then'](function(_0x2e4789){_0xd14203[_0x7fd1('0x35')]=_0x2e4789;if(_0x301752['query'][_0x7fd1('0x54')]){_0x441900['include']=[{'all':!![]}];}return db[_0x7fd1('0x6f')]['findAll'](_0x441900);})[_0x7fd1('0x24')](function(_0x43c2a1){_0xd14203[_0x7fd1('0x56')]=_0x43c2a1;return _0xd14203;});}})['then'](respondWithFilteredResult(_0x2604d5,_0x441900))[_0x7fd1('0x2e')](handleError(_0x2604d5,null));};exports[_0x7fd1('0x70')]=function(_0x4891c6,_0x3f8f4e,_0x5c1db3){return db['WhatsappAccount'][_0x7fd1('0x59')]({'where':{'id':_0x4891c6[_0x7fd1('0x62')]['id']}})[_0x7fd1('0x24')](handleEntityNotFound(_0x3f8f4e,null))[_0x7fd1('0x24')](function(_0xd8faac){if(_0xd8faac){return _0xd8faac['removeAnswers'](_0x4891c6[_0x7fd1('0x45')]['ids']);}})[_0x7fd1('0x24')](respondWithStatusCode(_0x3f8f4e,null))['catch'](handleError(_0x3f8f4e,null));};exports[_0x7fd1('0x71')]=function(_0x48dd54,_0x236752,_0x2e810a){return db[_0x7fd1('0x41')][_0x7fd1('0x59')]({'where':{'id':_0x48dd54[_0x7fd1('0x62')]['id']}})[_0x7fd1('0x24')](handleEntityNotFound(_0x236752,null))['then'](function(_0x2becda){if(_0x2becda){return _0x2becda[_0x7fd1('0x71')](_0x48dd54[_0x7fd1('0x5b')][_0x7fd1('0x6d')],_['omit'](_0x48dd54[_0x7fd1('0x5b')],['ids','id'])||{})[_0x7fd1('0x72')](function(_0x1cdcf0){for(var _0x4e2b2b=0x0;_0x4e2b2b<_0x48dd54[_0x7fd1('0x5b')][_0x7fd1('0x6d')][_0x7fd1('0x4c')];_0x4e2b2b+=0x1){socket['emit'](_0x7fd1('0x73'),{'UserId':Number(_0x48dd54[_0x7fd1('0x5b')][_0x7fd1('0x6d')][_0x4e2b2b]),'WhatsappAccountId':Number(_0x48dd54[_0x7fd1('0x62')]['id'])});}return _0x1cdcf0;});}})['then'](respondWithResult(_0x236752,null))[_0x7fd1('0x2e')](handleError(_0x236752,null));};exports[_0x7fd1('0x74')]=function(_0x238f31,_0x3fedca,_0x48c7ab){return db['WhatsappAccount']['find']({'where':{'id':_0x238f31[_0x7fd1('0x62')]['id']}})['then'](handleEntityNotFound(_0x3fedca,null))[_0x7fd1('0x24')](function(_0xa978d){if(_0xa978d){return _0xa978d[_0x7fd1('0x74')](_0x238f31[_0x7fd1('0x45')]['ids'])[_0x7fd1('0x24')](function(){if(_[_0x7fd1('0x75')](_0x238f31[_0x7fd1('0x45')]['ids'])){for(var _0x144032=0x0;_0x144032<_0x238f31[_0x7fd1('0x45')][_0x7fd1('0x6d')]['length'];_0x144032+=0x1){socket[_0x7fd1('0x76')](_0x7fd1('0x77'),{'UserId':Number(_0x238f31[_0x7fd1('0x45')][_0x7fd1('0x6d')][_0x144032]),'WhatsappAccountId':Number(_0x238f31['params']['id'])});}}else{socket[_0x7fd1('0x76')](_0x7fd1('0x77'),{'UserId':Number(_0x238f31[_0x7fd1('0x45')][_0x7fd1('0x6d')]),'WhatsappAccountId':Number(_0x238f31['params']['id'])});}});}})[_0x7fd1('0x24')](respondWithStatusCode(_0x3fedca,null))['catch'](handleError(_0x3fedca,null));};exports[_0x7fd1('0x78')]=function(_0x4a3db6,_0x4d6a93,_0x26a7bf){var _0x8cb314={};var _0x4befcf={};var _0x5dab2e;var _0x257449;return db[_0x7fd1('0x41')][_0x7fd1('0x67')]({'where':{'id':_0x4a3db6[_0x7fd1('0x62')]['id']}})[_0x7fd1('0x24')](handleEntityNotFound(_0x4d6a93,null))[_0x7fd1('0x24')](function(_0x5b3a16){if(_0x5b3a16){_0x5dab2e=_0x5b3a16;_0x4befcf[_0x7fd1('0x48')]=_['keys'](db[_0x7fd1('0x79')][_0x7fd1('0x42')]);_0x4befcf[_0x7fd1('0x45')]=_[_0x7fd1('0x46')](_0x4a3db6[_0x7fd1('0x45')]);_0x4befcf['filters']=_[_0x7fd1('0x4a')](_0x4befcf[_0x7fd1('0x48')],_0x4befcf['query']);_0x8cb314['attributes']=_[_0x7fd1('0x4a')](_0x4befcf[_0x7fd1('0x48')],qs['fields'](_0x4a3db6[_0x7fd1('0x45')][_0x7fd1('0x4b')]));_0x8cb314[_0x7fd1('0x49')]=_0x8cb314[_0x7fd1('0x49')][_0x7fd1('0x4c')]?_0x8cb314[_0x7fd1('0x49')]:_0x4befcf['model'];_0x8cb314[_0x7fd1('0x6a')]=qs['sort'](_0x4a3db6['query'][_0x7fd1('0x4d')]);_0x8cb314[_0x7fd1('0x4e')]=qs[_0x7fd1('0x47')](_[_0x7fd1('0x4f')](_0x4a3db6[_0x7fd1('0x45')],_0x4befcf[_0x7fd1('0x47')]));if(_0x4a3db6[_0x7fd1('0x45')][_0x7fd1('0x51')]){_0x8cb314[_0x7fd1('0x4e')]=_[_0x7fd1('0x52')](_0x8cb314['where'],{'$or':_[_0x7fd1('0x40')](_0x8cb314['attributes'],function(_0x34ccc5){var _0xe04b08={};_0xe04b08[_0x34ccc5]={'$like':'%'+_0x4a3db6[_0x7fd1('0x45')]['filter']+'%'};return _0xe04b08;})});}_0x8cb314=_['merge']({},_0x8cb314,_0x4a3db6['options']);return _0x5dab2e['getAgents'](_0x8cb314);}})[_0x7fd1('0x24')](function(_0xaea24d){if(_0xaea24d){_0x257449=_0xaea24d[_0x7fd1('0x4c')];if(!_0x4a3db6[_0x7fd1('0x45')]['hasOwnProperty'](_0x7fd1('0x69'))){_0x8cb314[_0x7fd1('0x34')]=qs['limit'](_0x4a3db6[_0x7fd1('0x45')][_0x7fd1('0x34')]);_0x8cb314[_0x7fd1('0x32')]=qs[_0x7fd1('0x32')](_0x4a3db6[_0x7fd1('0x45')][_0x7fd1('0x32')]);}return _0x5dab2e[_0x7fd1('0x78')](_0x8cb314);}})[_0x7fd1('0x24')](function(_0x5943e2){if(_0x5943e2){return _0x5943e2?{'count':_0x257449,'rows':_0x5943e2}:null;}})[_0x7fd1('0x24')](respondWithResult(_0x4d6a93,null))[_0x7fd1('0x2e')](handleError(_0x4d6a93,null));};exports['addApplications']=function(_0x4061a9,_0xc9d00e){var _0x325a60=_0x4061a9['params']['id'];var _0x3db101=_0x4061a9[_0x7fd1('0x5b')];var _0x1b4382=0xc8;var _0x37c539=null;return db[_0x7fd1('0x7a')]['transaction']({'isolationLevel':db[_0x7fd1('0x7a')]['Transaction'][_0x7fd1('0x7b')]['READ_COMMITTED']},function(_0x461f75){return db[_0x7fd1('0x41')]['findOne']({'where':{'id':_0x325a60},'transaction':_0x461f75})['then'](function(_0x248336){if(_0x248336){return db[_0x7fd1('0x7c')][_0x7fd1('0x3a')]({'where':{'WhatsappAccountId':_0x325a60},'transaction':_0x461f75})['then'](function(){var _0x33a041=_['map'](_0x3db101,function(_0x13431a){_0x13431a[_0x7fd1('0x64')]=_0x325a60;return _0x13431a;});return db[_0x7fd1('0x7c')][_0x7fd1('0x7d')](_0x33a041,{'transaction':_0x461f75});});}else{_0x1b4382=0x194;_0x37c539=[];}});})[_0x7fd1('0x24')](function(){if(_0x1b4382!==0x194){return db[_0x7fd1('0x7c')][_0x7fd1('0x7e')]({'where':{'WhatsappAccountId':_0x325a60},'order':'priority'})[_0x7fd1('0x24')](function(_0x33c912){_0x37c539=_0x33c912;});}})[_0x7fd1('0x2e')](function(_0x241b17){_0x1b4382=0x1f4;logger[_0x7fd1('0x2b')](_0x241b17['stack']);if(_0x241b17[_0x7fd1('0x3c')]){delete _0x241b17[_0x7fd1('0x3c')];}_0x37c539=_0x241b17;})[_0x7fd1('0x7f')](function(){if(_0x37c539===null){_0xc9d00e[_0x7fd1('0x2f')](_0x1b4382);}else{if(_0x1b4382===0x1f4){_0xc9d00e['status'](_0x1b4382)['send'](_0x37c539);}else{_0xc9d00e[_0x7fd1('0x31')](_0x1b4382)[_0x7fd1('0x37')](_0x37c539);}}});};exports[_0x7fd1('0x80')]=function(_0x335d3e,_0x5591b9,_0x436722){var _0x47a303={};var _0x233a26={};var _0xe3f9b1;var _0x3d45c1;return db[_0x7fd1('0x41')][_0x7fd1('0x67')]({'where':{'id':_0x335d3e[_0x7fd1('0x62')]['id']}})[_0x7fd1('0x24')](handleEntityNotFound(_0x5591b9,null))[_0x7fd1('0x24')](function(_0x63c425){if(_0x63c425){_0xe3f9b1=_0x63c425;_0x233a26[_0x7fd1('0x48')]=_[_0x7fd1('0x46')](db['WhatsappApplication']['rawAttributes']);_0x233a26['query']=_[_0x7fd1('0x46')](_0x335d3e['query']);_0x233a26['filters']=_[_0x7fd1('0x4a')](_0x233a26[_0x7fd1('0x48')],_0x233a26[_0x7fd1('0x45')]);_0x47a303[_0x7fd1('0x49')]=_['intersection'](_0x233a26[_0x7fd1('0x48')],qs['fields'](_0x335d3e['query']['fields']));_0x47a303[_0x7fd1('0x49')]=_0x47a303['attributes']['length']?_0x47a303[_0x7fd1('0x49')]:_0x233a26[_0x7fd1('0x48')];_0x47a303[_0x7fd1('0x6a')]=qs[_0x7fd1('0x4d')](_0x335d3e[_0x7fd1('0x45')][_0x7fd1('0x4d')]);_0x47a303[_0x7fd1('0x4e')]=qs['filters'](_['pick'](_0x335d3e['query'],_0x233a26[_0x7fd1('0x47')]));if(_0x335d3e['query'][_0x7fd1('0x51')]){_0x47a303[_0x7fd1('0x4e')]=_[_0x7fd1('0x52')](_0x47a303[_0x7fd1('0x4e')],{'$or':_[_0x7fd1('0x40')](_0x47a303[_0x7fd1('0x49')],function(_0x54edf1){var _0x2aabef={};_0x2aabef[_0x54edf1]={'$like':'%'+_0x335d3e[_0x7fd1('0x45')]['filter']+'%'};return _0x2aabef;})});}_0x47a303=_[_0x7fd1('0x52')]({},_0x47a303,_0x335d3e[_0x7fd1('0x53')]);return _0xe3f9b1['getApplications'](_0x47a303);}})[_0x7fd1('0x24')](function(_0x51818d){if(_0x51818d){_0x3d45c1=_0x51818d['length'];if(!_0x335d3e['query'][_0x7fd1('0x68')](_0x7fd1('0x69'))){_0x47a303[_0x7fd1('0x34')]=qs[_0x7fd1('0x34')](_0x335d3e[_0x7fd1('0x45')][_0x7fd1('0x34')]);_0x47a303[_0x7fd1('0x32')]=qs['offset'](_0x335d3e[_0x7fd1('0x45')][_0x7fd1('0x32')]);}return _0xe3f9b1['getApplications'](_0x47a303);}})['then'](function(_0x43b05d){if(_0x43b05d){return _0x43b05d?{'count':_0x3d45c1,'rows':_0x43b05d}:null;}})['then'](respondWithResult(_0x5591b9,null))[_0x7fd1('0x2e')](handleError(_0x5591b9,null));};exports[_0x7fd1('0x81')]=function(_0x2799a1,_0x5c22cb,_0x3992ac){var _0x25e7db={'channel':_0x7fd1('0x82')};var _0x3b2ca2=[];var _0xd4ef4a=[];var _0x56dc48={};return db['WhatsappAccount'][_0x7fd1('0x59')]({'where':{'id':_0x2799a1[_0x7fd1('0x62')]['id']},'include':[{'model':db[_0x7fd1('0x7c')],'as':_0x7fd1('0x83')}]})['then'](handleEntityNotFound(_0x5c22cb,null))[_0x7fd1('0x24')](function(_0x12941d){_0x25e7db[_0x7fd1('0x84')]=_0x12941d;if(_0x25e7db['account']&&_0x25e7db[_0x7fd1('0x84')]['type']===_0x7fd1('0x85')&&_0x2799a1[_0x7fd1('0x5b')][_0x7fd1('0x86')]){if(_0x2799a1[_0x7fd1('0x5b')]['statuses']['length']===0x0)return;if(_0x2799a1['body'][_0x7fd1('0x86')][0x0][_0x7fd1('0x87')]!==_0x7fd1('0x88'))return;return db[_0x7fd1('0x89')][_0x7fd1('0x39')]({'read':!![],'readAt':_0x2799a1[_0x7fd1('0x5b')][_0x7fd1('0x86')][0x0][_0x7fd1('0x8a')]},{'where':{'messageId':_0x2799a1[_0x7fd1('0x5b')][_0x7fd1('0x86')][0x0][_0x7fd1('0x8b')]},'individualHooks':!![]})[_0x7fd1('0x24')](function(_0x433d1a){return _0x5c22cb[_0x7fd1('0x31')](0xc8)[_0x7fd1('0x37')](_0x433d1a);});}_0x25e7db[_0x7fd1('0x8c')]=_['orderBy'](_0x12941d[_0x7fd1('0x83')],[_0x7fd1('0x8d')],[_0x7fd1('0x8e')]);if(_0x25e7db[_0x7fd1('0x84')][_0x7fd1('0x83')]){delete _0x25e7db[_0x7fd1('0x84')][_0x7fd1('0x83')];}return db[_0x7fd1('0x8f')][_0x7fd1('0x63')]()[_0x7fd1('0x24')](function(_0x55dbbb){if(!_0x55dbbb){throw new db['Sequelize'][(_0x7fd1('0x90'))](_0x7fd1('0x91'));}_0x3b2ca2=_[_0x7fd1('0x92')](_[_0x7fd1('0x46')](_0x55dbbb),['createdAt',_0x7fd1('0x93')]);_0xd4ef4a=_['difference'](_[_0x7fd1('0x46')](_0x55dbbb),[_0x7fd1('0x94'),'updatedAt',_0x7fd1('0x95'),_0x7fd1('0x96')]);_0x25e7db['body']={'mapKey':_0x7fd1('0x97')};if(_0x25e7db[_0x7fd1('0x84')]&&_0x25e7db['account'][_0x7fd1('0x43')]===_0x7fd1('0x98')){_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0x99')]=_0x2799a1['body'][_0x7fd1('0x9a')][_0x7fd1('0x9b')]('whatsapp:','');_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0x5b')]=_0x2799a1[_0x7fd1('0x5b')][_0x7fd1('0x9c')];_0x25e7db[_0x7fd1('0x5b')]['messageId']=_0x2799a1[_0x7fd1('0x5b')][_0x7fd1('0x9d')];}if(_0x25e7db[_0x7fd1('0x84')]&&_0x25e7db['account'][_0x7fd1('0x43')]==='sinch'){_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0x99')]=_0x2799a1[_0x7fd1('0x5b')]['notifications'][0x0][_0x7fd1('0x99')];_0x25e7db['body']['body']=_0x2799a1['body'][_0x7fd1('0x9e')][0x0][_0x7fd1('0x2d')][_0x7fd1('0x5b')];_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0x9f')]=_0x2799a1[_0x7fd1('0x5b')][_0x7fd1('0x9e')][0x0]['message_id'];}if(_0x25e7db[_0x7fd1('0x5b')]['id']){delete _0x25e7db[_0x7fd1('0x5b')]['id'];}if(_['isNil'](_0x25e7db[_0x7fd1('0x5b')]['from'])){throw new db[(_0x7fd1('0xa0'))][(_0x7fd1('0x90'))](_0x7fd1('0xa1'));}if(_[_0x7fd1('0xa2')](_0x25e7db['body'][_0x7fd1('0x5b')])||_0x25e7db['body'][_0x7fd1('0x5b')]===''){throw new db[(_0x7fd1('0xa0'))][(_0x7fd1('0x90'))](_0x7fd1('0xa3'));}if(_[_0x7fd1('0xa2')](_0x25e7db['body'][_0x7fd1('0xa4')])){throw new db[(_0x7fd1('0xa0'))][(_0x7fd1('0x90'))](_0x7fd1('0xa5')+_0xd4ef4a);}if(!_[_0x7fd1('0xa6')](_0xd4ef4a,_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0xa4')])){throw new db[(_0x7fd1('0xa0'))][(_0x7fd1('0x90'))](_0x7fd1('0xa7')+_0xd4ef4a);}_0x56dc48[_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0xa4')]]=_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0x99')];return db['CmList'][_0x7fd1('0x59')]({'where':{'id':_0x25e7db[_0x7fd1('0x84')][_0x7fd1('0x96')]},'include':[{'model':db[_0x7fd1('0x8f')],'as':_0x7fd1('0xa8'),'where':_0x56dc48,'limit':0x1,'order':[[_0x7fd1('0x93'),_0x7fd1('0xa9')]]}]});})[_0x7fd1('0x24')](handleEntityNotFound(_0x5c22cb,null))[_0x7fd1('0x24')](function(_0x30534b){if(_0x30534b){_0x25e7db[_0x7fd1('0xaa')]=_[_0x7fd1('0xab')](_0x30534b,[_0x7fd1('0xa8')]);if(_0x30534b[_0x7fd1('0xa8')][_0x7fd1('0x4c')]){return _0x30534b[_0x7fd1('0xa8')][0x0];}var _0x53a35a=_['defaults'](_0x25e7db[_0x7fd1('0x5b')],{'firstName':_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0x99')],'ListId':_0x30534b['id']});_0x53a35a[_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0xa4')]]=_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0x99')];return db[_0x7fd1('0x8f')][_0x7fd1('0x5a')](_0x53a35a,{'fields':_0x3b2ca2,'raw':!![]});}})['then'](handleEntityNotFound(_0x5c22cb,null))['then'](function(_0x324d4c){if(_0x324d4c){_0x25e7db[_0x7fd1('0xac')]=_0x324d4c;var _0xc3096={'ContactId':_0x324d4c['id'],'phone':_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0x99')],'WhatsappAccountId':_0x2799a1['params']['id']};var _0x5c0ae5={'ContactId':_0x324d4c['id'],'WhatsappAccountId':_0x2799a1[_0x7fd1('0x62')]['id'],'closed':![]};return db[_0x7fd1('0xad')][_0x7fd1('0x59')]({'where':_0x5c0ae5})[_0x7fd1('0x24')](function(_0x46c54f){if(_0x46c54f){return[_0x46c54f,![]];}return db['WhatsappInteraction'][_0x7fd1('0x5a')](_0xc3096)[_0x7fd1('0x24')](function(_0x4284d5){return[_0x4284d5,!![]];});});}})[_0x7fd1('0x72')](function(_0xaef22f,_0x7ac5a0){_0x25e7db[_0x7fd1('0xae')]=_0xaef22f[_0x7fd1('0x5d')]({'plain':!![]});_0x25e7db[_0x7fd1('0xae')]['created']=![];if(_0x7ac5a0){if(_0x25e7db['account'][_0x7fd1('0xaf')]){_0x25e7db[_0x7fd1('0x8c')][_0x7fd1('0xb0')]({'id':0x0,'priority':_0x25e7db[_0x7fd1('0x8c')][_0x7fd1('0x4c')]+0x1,'app':_0x7fd1('0xb1'),'appdata':_0x7fd1('0xb2'),'interval':'*,*,*,*'});}_0x25e7db['interaction'][_0x7fd1('0xb3')]=!![];}return db[_0x7fd1('0x89')][_0x7fd1('0x5a')]({'phone':_0x25e7db['body'][_0x7fd1('0x99')],'messageId':_0x25e7db['body'][_0x7fd1('0x9f')],'body':_0x25e7db[_0x7fd1('0x5b')][_0x7fd1('0x5b')],'WhatsappAccountId':_0x2799a1['params']['id'],'WhatsappInteractionId':_0xaef22f['id'],'direction':'in','ContactId':_0xaef22f[_0x7fd1('0xb4')],'AttachmentId':_0x25e7db[_0x7fd1('0x5b')]['AttachmentId']});})[_0x7fd1('0x24')](function(_0x4da528){_0x25e7db[_0x7fd1('0x2d')]=_0x4da528;if(_0x25e7db['interaction'][_0x7fd1('0xb5')]){return db[_0x7fd1('0x79')]['find']({'attributes':['id',_0x7fd1('0x3c')],'where':{'id':_0x25e7db[_0x7fd1('0xae')][_0x7fd1('0xb5')]}})[_0x7fd1('0x24')](function(_0x29b46c){if(_0x29b46c){_0x25e7db[_0x7fd1('0x8c')][_0x7fd1('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x29b46c[_0x7fd1('0x3c')]+','+(_0x25e7db['account'][_0x7fd1('0xb7')]||0xa),'interval':_0x7fd1('0xb8')});}return respondWithRpcPromise(_0x7fd1('0xb9'),'startRouting',_0x25e7db);});}return respondWithRpcPromise(_0x7fd1('0xb9'),_0x7fd1('0xba'),_0x25e7db);})[_0x7fd1('0x24')](function(_0x659f0){if(_0x659f0){var _0x470255=0xc8;var _0x5df756=_0x7fd1('0xbb');logger[_0x7fd1('0x25')](_0x7fd1('0x28'),_0x5df756,_0x470255,'entity\x20found');logger[_0x7fd1('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x5df756,_0x470255,_0x7fd1('0xbc'),JSON['stringify'](_0x659f0));if(_0x25e7db[_0x7fd1('0x84')][_0x7fd1('0x43')]===_0x7fd1('0x98')){return _0x5c22cb[_0x7fd1('0x31')](_0x470255)[_0x7fd1('0xbd')](_0x7fd1('0xbe'),_0x7fd1('0xbf'))['send'](_0x7fd1('0xc0'));}else{return _0x5c22cb[_0x7fd1('0x31')](_0x470255)[_0x7fd1('0x37')](_0x659f0);}}});})[_0x7fd1('0x2e')](handleError(_0x5c22cb,null));};exports[_0x7fd1('0x3d')]=function(_0x2ffda3,_0x1094be,_0x3bc7d3){var _0xe30f1,_0x227e16,_0x5d1055;if(_[_0x7fd1('0xa2')](_0x2ffda3['body'][_0x7fd1('0x5b')])||_0x2ffda3[_0x7fd1('0x5b')][_0x7fd1('0x5b')]===''){throw new db['Sequelize'][(_0x7fd1('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7fd1('0xa2')](_0x2ffda3[_0x7fd1('0x5b')]['to'])){throw new db[(_0x7fd1('0xa0'))][(_0x7fd1('0x90'))](_0x7fd1('0xc1'));}_0xe30f1=_0x2ffda3[_0x7fd1('0x5b')]['to'];return db[_0x7fd1('0x41')][_0x7fd1('0x59')]({'where':{'id':_0x2ffda3['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7fd1('0x8f')],'as':_0x7fd1('0xa8'),'where':{'mobile':_0xe30f1},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x7fd1('0x24')](handleEntityNotFound(_0x1094be,null))[_0x7fd1('0x24')](function(_0x5ee2b0){if(_0x5ee2b0&&_0x5ee2b0[_0x7fd1('0xc2')]){_0x227e16=_0x5ee2b0[_0x7fd1('0x5d')]({'plain':!![]});if(_0x227e16[_0x7fd1('0xc2')]&&_0x227e16[_0x7fd1('0xc2')][_0x7fd1('0xa8')][_0x7fd1('0x4c')]){return _0x227e16[_0x7fd1('0xc2')][_0x7fd1('0xa8')][0x0];}return db[_0x7fd1('0x8f')][_0x7fd1('0x5a')](_[_0x7fd1('0xc3')](_0x2ffda3[_0x7fd1('0x5b')],{'firstName':_0xe30f1,'mobile':_0xe30f1,'phone':_0xe30f1,'ListId':_0x227e16[_0x7fd1('0x96')]}));}})['then'](handleEntityNotFound(_0x1094be,null))[_0x7fd1('0x24')](function(_0x2485d8){if(_0x2485d8){_0x5d1055=_0x2485d8;return db[_0x7fd1('0xad')][_0x7fd1('0x59')]({'where':{'ContactId':_0x5d1055['id'],'closed':![],'WhatsappAccountId':_0x227e16['id']}})[_0x7fd1('0x24')](function(_0x14024a){if(_0x14024a){return[_0x14024a,![]];}return db[_0x7fd1('0xad')][_0x7fd1('0x5a')]({'UserId':_0x2ffda3['user']['id'],'ContactId':_0x5d1055['id'],'WhatsappAccountId':_0x227e16['id'],'phone':_0xe30f1,'firstMsgDirection':'out','Messages':[_[_0x7fd1('0x52')](_0x2ffda3['body'],{'read':![],'body':_0x2ffda3['body']['body'],'phone':_0xe30f1,'WhatsappAccountId':_0x227e16['id'],'UserId':_0x2ffda3[_0x7fd1('0x5c')]['id'],'ContactId':_0x5d1055['id']})]},{'include':[{'model':db[_0x7fd1('0x89')],'as':_0x7fd1('0xc4')}]})[_0x7fd1('0x24')](function(_0x11c4c5){return[_0x11c4c5,!![]];});});}})['spread'](function(_0x3ddfc4,_0x2b473c){if(_0x2b473c){return _0x3ddfc4;}return db[_0x7fd1('0x89')][_0x7fd1('0x5a')](_[_0x7fd1('0x52')](_0x2ffda3[_0x7fd1('0x5b')],{'read':![],'body':_0x2ffda3[_0x7fd1('0x5b')][_0x7fd1('0x5b')],'phone':_0xe30f1,'WhatsappAccountId':_0x227e16['id'],'WhatsappInteractionId':_0x3ddfc4['id'],'UserId':_0x2ffda3[_0x7fd1('0x5c')]['id'],'ContactId':_0x5d1055['id']}))[_0x7fd1('0x24')](function(_0x410729){_0x3ddfc4[_0x7fd1('0xc5')][_0x7fd1('0xc4')]=[];_0x3ddfc4[_0x7fd1('0xc5')]['Messages'][_0x7fd1('0xb0')](_0x410729[_0x7fd1('0xc5')]);return _0x3ddfc4;});})[_0x7fd1('0x24')](respondWithResult(_0x1094be,null))[_0x7fd1('0x2e')](handleError(_0x1094be,null));}; \ No newline at end of file +var _0x81d3=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','WhatsappAccountId','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','sort','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','message_id','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','whatsapp:','Body','messageId','MessageSid','notifications','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','Contacts','defaults','contact','WhatsappInteraction','interaction','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','info','entity\x20found','Content-Type','text/xml','\x0a','List','out','Messages','dataValues','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','WhatsappAccounts','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','Pause','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x81d3,0x12a));var _0x381d=function(_0x3319bc,_0xbaba1b){_0x3319bc=_0x3319bc-0x0;var _0x419db9=_0x81d3[_0x3319bc];return _0x419db9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x381d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x381d('0x1'));var moment=require('moment');var BPromise=require(_0x381d('0x2'));var Mustache=require(_0x381d('0x3'));var util=require(_0x381d('0x4'));var path=require(_0x381d('0x5'));var sox=require(_0x381d('0x6'));var csv=require(_0x381d('0x7'));var ejs=require(_0x381d('0x8'));var fs=require('fs');var fs_extra=require(_0x381d('0x9'));var _=require(_0x381d('0xa'));var squel=require(_0x381d('0xb'));var crypto=require(_0x381d('0xc'));var jsforce=require(_0x381d('0xd'));var deskjs=require(_0x381d('0xe'));var toCsv=require(_0x381d('0x7'));var querystring=require(_0x381d('0xf'));var Papa=require(_0x381d('0x10'));var Redis=require(_0x381d('0x11'));var authService=require(_0x381d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x381d('0x13'));var hardwareService=require(_0x381d('0x14'));var logger=require(_0x381d('0x15'))(_0x381d('0x16'));var utils=require(_0x381d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x381d('0x18'));var db=require(_0x381d('0x19'))['db'];config[_0x381d('0x1a')]=_['defaults'](config[_0x381d('0x1a')],{'host':_0x381d('0x1b'),'port':0x18eb});var socket=require(_0x381d('0x1c'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x381d('0x1d')](socket);var jayson=require(_0x381d('0x1e'));var client=jayson[_0x381d('0x1f')][_0x381d('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x16ae10,_0x34df03,_0x4b49c1,_0x23dac4){return new BPromise(function(_0x3c77be,_0x12c2cf){var _0x4c1ccc=_0x23dac4||client;return _0x4c1ccc[_0x381d('0x21')](_0x16ae10,_0x4b49c1)[_0x381d('0x22')](function(_0x41a65c){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x34df03,_0x381d('0x23'));logger[_0x381d('0x24')](_0x381d('0x25'),_0x34df03,_0x381d('0x23'),JSON[_0x381d('0x26')](_0x41a65c));if(_0x41a65c['error']){if(_0x41a65c[_0x381d('0x27')][_0x381d('0x28')]===0x1f4){logger[_0x381d('0x27')](_0x381d('0x29'),_0x34df03,_0x41a65c['error'][_0x381d('0x2a')]);return _0x12c2cf(_0x41a65c[_0x381d('0x27')]['message']);}logger[_0x381d('0x27')](_0x381d('0x29'),_0x34df03,_0x41a65c[_0x381d('0x27')][_0x381d('0x2a')]);return _0x3c77be(_0x41a65c[_0x381d('0x27')][_0x381d('0x2a')]);}else{logger['info'](_0x381d('0x29'),_0x34df03,_0x381d('0x23'));_0x3c77be(_0x41a65c['result']['message']);}})[_0x381d('0x2b')](function(_0x1c33cf){logger[_0x381d('0x27')](_0x381d('0x29'),_0x34df03,_0x1c33cf);_0x12c2cf(_0x1c33cf);});});}function respondWithStatusCode(_0x3e92d5,_0x20ab8c){_0x20ab8c=_0x20ab8c||0xcc;return function(_0xcc4ed3){if(_0xcc4ed3){return _0x3e92d5[_0x381d('0x2c')](_0x20ab8c);}return _0x3e92d5[_0x381d('0x2d')](_0x20ab8c)[_0x381d('0x2e')]();};}function respondWithResult(_0x26ffbe,_0x841f9){_0x841f9=_0x841f9||0xc8;return function(_0x337cb1){if(_0x337cb1){return _0x26ffbe[_0x381d('0x2d')](_0x841f9)[_0x381d('0x2f')](_0x337cb1);}};}function respondWithFilteredResult(_0x1bc28c,_0x1578b3){return function(_0x48d722){if(_0x48d722){var _0x264678=typeof _0x1578b3[_0x381d('0x30')]===_0x381d('0x31')&&typeof _0x1578b3[_0x381d('0x32')]===_0x381d('0x31');var _0x3abcbd=_0x48d722[_0x381d('0x33')];var _0x144041=_0x264678?0x0:_0x1578b3[_0x381d('0x30')];var _0x7741ca=_0x264678?_0x48d722['count']:_0x1578b3[_0x381d('0x30')]+_0x1578b3[_0x381d('0x32')];var _0x497146;if(_0x7741ca>=_0x3abcbd){_0x7741ca=_0x3abcbd;_0x497146=0xc8;}else{_0x497146=0xce;}_0x1bc28c[_0x381d('0x2d')](_0x497146);return _0x1bc28c[_0x381d('0x34')](_0x381d('0x35'),_0x144041+'-'+_0x7741ca+'/'+_0x3abcbd)[_0x381d('0x2f')](_0x48d722);}return null;};}function patchUpdates(_0x29ffae){return function(_0x5e1a6c){try{jsonpatch['apply'](_0x5e1a6c,_0x29ffae,!![]);}catch(_0x10e54d){return BPromise[_0x381d('0x36')](_0x10e54d);}return _0x5e1a6c[_0x381d('0x37')]();};}function saveUpdates(_0x234c91,_0x2284c6){return function(_0x5c0f88){if(_0x5c0f88){return _0x5c0f88[_0x381d('0x38')](_0x234c91)['then'](function(_0x4a7c54){return _0x4a7c54;});}return null;};}function removeEntity(_0x2c6308,_0x39c4cc){return function(_0x516dff){if(_0x516dff){return _0x516dff[_0x381d('0x39')]()[_0x381d('0x22')](function(){var _0x5b07b9=_0x516dff[_0x381d('0x3a')]({'plain':!![]});var _0x3c14b2=_0x381d('0x3b');return db['UserProfileResource'][_0x381d('0x39')]({'where':{'type':_0x3c14b2,'resourceId':_0x5b07b9['id']}})['then'](function(){return _0x516dff;});})[_0x381d('0x22')](function(){_0x2c6308['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x70b4f8,_0x3a4493){return function(_0x554110){if(!_0x554110){_0x70b4f8[_0x381d('0x2c')](0x194);}return _0x554110;};}function handleError(_0x3c1369,_0x32296a){_0x32296a=_0x32296a||0x1f4;return function(_0x2db531){logger[_0x381d('0x27')](_0x2db531[_0x381d('0x3c')]);if(_0x2db531[_0x381d('0x3d')]){delete _0x2db531[_0x381d('0x3d')];}_0x3c1369[_0x381d('0x2d')](_0x32296a)[_0x381d('0x3e')](_0x2db531);};}exports[_0x381d('0x3f')]=function(_0x8ead5f,_0x4446e0){var _0x5face3={'include':[{'model':db['Pause'],'as':_0x381d('0x40')}]},_0x1d4688={},_0x128904={'count':0x0,'rows':[]};var _0xf25438=_[_0x381d('0x41')](db[_0x381d('0x42')][_0x381d('0x43')],function(_0x4bc3f4){return{'name':_0x4bc3f4[_0x381d('0x44')],'type':_0x4bc3f4['type'][_0x381d('0x45')]};});_0x1d4688[_0x381d('0x46')]=_[_0x381d('0x41')](_0xf25438,_0x381d('0x3d'));_0x1d4688[_0x381d('0x47')]=_[_0x381d('0x48')](_0x8ead5f[_0x381d('0x47')]);_0x1d4688[_0x381d('0x49')]=_[_0x381d('0x4a')](_0x1d4688['model'],_0x1d4688[_0x381d('0x47')]);_0x5face3['attributes']=_[_0x381d('0x4a')](_0x1d4688['model'],qs['fields'](_0x8ead5f[_0x381d('0x47')][_0x381d('0x4b')]));_0x5face3['attributes']=_0x5face3['attributes'][_0x381d('0x4c')]?_0x5face3[_0x381d('0x4d')]:_0x1d4688[_0x381d('0x46')];if(!_0x8ead5f[_0x381d('0x47')][_0x381d('0x4e')](_0x381d('0x4f'))){_0x5face3[_0x381d('0x32')]=qs[_0x381d('0x32')](_0x8ead5f[_0x381d('0x47')]['limit']);_0x5face3[_0x381d('0x30')]=qs[_0x381d('0x30')](_0x8ead5f['query']['offset']);}_0x5face3['order']=qs['sort'](_0x8ead5f['query']['sort']);_0x5face3[_0x381d('0x50')]=qs[_0x381d('0x49')](_[_0x381d('0x51')](_0x8ead5f[_0x381d('0x47')],_0x1d4688[_0x381d('0x49')]),_0xf25438);if(_0x8ead5f[_0x381d('0x47')][_0x381d('0x52')]){_0x5face3[_0x381d('0x50')]=_[_0x381d('0x53')](_0x5face3['where'],{'$or':_['map'](_0xf25438,function(_0x55ae55){if(_0x55ae55[_0x381d('0x54')]!==_0x381d('0x55')){var _0x5e40bb={};_0x5e40bb[_0x55ae55['name']]={'$like':'%'+_0x8ead5f['query'][_0x381d('0x52')]+'%'};return _0x5e40bb;}})});}_0x5face3=_[_0x381d('0x53')]({},_0x5face3,_0x8ead5f[_0x381d('0x56')]);var _0x21157f={'where':_0x5face3[_0x381d('0x50')]};return db['WhatsappAccount']['count'](_0x21157f)[_0x381d('0x22')](function(_0x30eb76){_0x128904['count']=_0x30eb76;if(_0x8ead5f[_0x381d('0x47')][_0x381d('0x57')]){_0x5face3['include']=[{'all':!![]}];}return db[_0x381d('0x42')][_0x381d('0x58')](_0x5face3);})[_0x381d('0x22')](function(_0x3bda4e){_0x128904[_0x381d('0x59')]=_0x3bda4e;return _0x128904;})[_0x381d('0x22')](respondWithFilteredResult(_0x4446e0,_0x5face3))[_0x381d('0x2b')](handleError(_0x4446e0,null));};exports[_0x381d('0x5a')]=function(_0x40e9d5,_0x2ef9a1){var _0x4c8651={'raw':![],'where':{'id':_0x40e9d5[_0x381d('0x5b')]['id']},'include':[{'model':db[_0x381d('0x5c')],'as':_0x381d('0x40')}]},_0x354429={};_0x354429['model']=_[_0x381d('0x48')](db['WhatsappAccount'][_0x381d('0x43')]);_0x354429[_0x381d('0x47')]=_[_0x381d('0x48')](_0x40e9d5[_0x381d('0x47')]);_0x354429['filters']=_[_0x381d('0x4a')](_0x354429['model'],_0x354429['query']);_0x4c8651[_0x381d('0x4d')]=_[_0x381d('0x4a')](_0x354429[_0x381d('0x46')],qs[_0x381d('0x4b')](_0x40e9d5[_0x381d('0x47')][_0x381d('0x4b')]));_0x4c8651['attributes']=_0x4c8651[_0x381d('0x4d')][_0x381d('0x4c')]?_0x4c8651[_0x381d('0x4d')]:_0x354429[_0x381d('0x46')];if(_0x40e9d5['query']['includeAll']){_0x4c8651[_0x381d('0x5d')]=[{'all':!![]}];}_0x4c8651=_[_0x381d('0x53')]({},_0x4c8651,_0x40e9d5['options']);return db['WhatsappAccount']['find'](_0x4c8651)['then'](handleEntityNotFound(_0x2ef9a1,null))[_0x381d('0x22')](respondWithResult(_0x2ef9a1,null))[_0x381d('0x2b')](handleError(_0x2ef9a1,null));};exports['create']=function(_0x45e7db,_0x3dd543){return db[_0x381d('0x42')][_0x381d('0x5e')](_0x45e7db[_0x381d('0x5f')],{})[_0x381d('0x22')](function(_0x5414d0){var _0x1ad310=_0x45e7db[_0x381d('0x60')][_0x381d('0x3a')]({'plain':!![]});if(!_0x1ad310)throw new Error(_0x381d('0x61'));if(_0x1ad310['role']===_0x381d('0x60')){var _0x34ffbe=_0x5414d0[_0x381d('0x3a')]({'plain':!![]});var _0x139244='WhatsappAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x139244,'userProfileId':_0x1ad310[_0x381d('0x62')]},'raw':!![]})['then'](function(_0x324c1d){if(_0x324c1d&&_0x324c1d[_0x381d('0x63')]===0x0){return db[_0x381d('0x64')][_0x381d('0x5e')]({'name':_0x34ffbe[_0x381d('0x3d')],'resourceId':_0x34ffbe['id'],'type':_0x324c1d[_0x381d('0x3d')],'sectionId':_0x324c1d['id']},{})[_0x381d('0x22')](function(){return _0x5414d0;});}else{return _0x5414d0;}})[_0x381d('0x2b')](function(_0x3f9422){logger[_0x381d('0x27')](_0x381d('0x65'),_0x3f9422);throw _0x3f9422;});}return _0x5414d0;})[_0x381d('0x22')](respondWithResult(_0x3dd543,0xc9))['catch'](handleError(_0x3dd543,null));};exports[_0x381d('0x38')]=function(_0x2f7e40,_0x1802bb){if(_0x2f7e40[_0x381d('0x5f')]['id']){delete _0x2f7e40[_0x381d('0x5f')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2f7e40[_0x381d('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x381d('0x40')}]})[_0x381d('0x22')](handleEntityNotFound(_0x1802bb,null))['then'](saveUpdates(_0x2f7e40[_0x381d('0x5f')],null))[_0x381d('0x22')](respondWithResult(_0x1802bb,null))['catch'](handleError(_0x1802bb,null));};exports[_0x381d('0x39')]=function(_0x5cf92a,_0x1d648b){return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x5cf92a[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x1d648b,null))[_0x381d('0x22')](removeEntity(_0x1d648b,null))[_0x381d('0x2b')](handleError(_0x1d648b,null));};exports['describe']=function(_0x55bca4,_0x161535){return db['WhatsappAccount'][_0x381d('0x67')]()[_0x381d('0x22')](respondWithResult(_0x161535,null))[_0x381d('0x2b')](handleError(_0x161535,null));};exports[_0x381d('0x68')]=function(_0x4da919,_0x48e4dc,_0x2df078){if(_0x4da919[_0x381d('0x5f')]['id']){delete _0x4da919['body']['id'];}return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x4da919[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x48e4dc,null))[_0x381d('0x22')](function(_0x5cb8c3){if(_0x5cb8c3){_0x4da919[_0x381d('0x5f')][_0x381d('0x69')]=_0x5cb8c3['id'];return db['Disposition']['create'](_0x4da919['body']);}})[_0x381d('0x22')](respondWithResult(_0x48e4dc,null))[_0x381d('0x2b')](handleError(_0x48e4dc,null));};exports['getDispositions']=function(_0x54b4b7,_0x125bd7,_0x46fa23){var _0x2ddc64={'raw':![],'where':{}};var _0x4e9834={};var _0xe6b4fb={'count':0x0,'rows':[]};return db[_0x381d('0x42')][_0x381d('0x6a')]({'where':{'id':_0x54b4b7[_0x381d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x125bd7,null))[_0x381d('0x22')](function(_0x1681fe){if(_0x1681fe){_0x4e9834[_0x381d('0x46')]=_[_0x381d('0x48')](db[_0x381d('0x6b')][_0x381d('0x43')]);_0x4e9834[_0x381d('0x47')]=_[_0x381d('0x48')](_0x54b4b7[_0x381d('0x47')]);_0x4e9834[_0x381d('0x49')]=_['intersection'](_0x4e9834['model'],_0x4e9834[_0x381d('0x47')]);_0x2ddc64[_0x381d('0x4d')]=_[_0x381d('0x4a')](_0x4e9834['model'],qs['fields'](_0x54b4b7[_0x381d('0x47')][_0x381d('0x4b')]));_0x2ddc64[_0x381d('0x4d')]=_0x2ddc64[_0x381d('0x4d')][_0x381d('0x4c')]?_0x2ddc64[_0x381d('0x4d')]:_0x4e9834[_0x381d('0x46')];if(!_0x54b4b7['query'][_0x381d('0x4e')](_0x381d('0x4f'))){_0x2ddc64[_0x381d('0x32')]=qs['limit'](_0x54b4b7[_0x381d('0x47')][_0x381d('0x32')]);_0x2ddc64['offset']=qs['offset'](_0x54b4b7['query']['offset']);}_0x2ddc64['order']=qs['sort'](_0x54b4b7[_0x381d('0x47')]['sort']);_0x2ddc64[_0x381d('0x50')]=qs['filters'](_['pick'](_0x54b4b7[_0x381d('0x47')],_0x4e9834[_0x381d('0x49')]));_0x2ddc64['where'][_0x381d('0x69')]=_0x1681fe['id'];if(_0x54b4b7[_0x381d('0x47')]['filter']){_0x2ddc64[_0x381d('0x50')]=_[_0x381d('0x53')](_0x2ddc64[_0x381d('0x50')],{'$or':_[_0x381d('0x41')](_0x2ddc64['attributes'],function(_0x791ae0){var _0x3ce073={};_0x3ce073[_0x791ae0]={'$like':'%'+_0x54b4b7[_0x381d('0x47')]['filter']+'%'};return _0x3ce073;})});}_0x2ddc64=_[_0x381d('0x53')]({},_0x2ddc64,_0x54b4b7[_0x381d('0x56')]);return db[_0x381d('0x6b')][_0x381d('0x33')]({'where':_0x2ddc64[_0x381d('0x50')]})[_0x381d('0x22')](function(_0x477c66){_0xe6b4fb['count']=_0x477c66;if(_0x54b4b7[_0x381d('0x47')][_0x381d('0x57')]){_0x2ddc64[_0x381d('0x5d')]=[{'all':!![]}];}return db[_0x381d('0x6b')]['findAll'](_0x2ddc64);})[_0x381d('0x22')](function(_0x288dfb){_0xe6b4fb[_0x381d('0x59')]=_0x288dfb;return _0xe6b4fb;});}})[_0x381d('0x22')](respondWithFilteredResult(_0x125bd7,_0x2ddc64))[_0x381d('0x2b')](handleError(_0x125bd7,null));};exports[_0x381d('0x6c')]=function(_0x2433d3,_0x37bbdd,_0x56ee7f){return db[_0x381d('0x42')]['find']({'where':{'id':_0x2433d3[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x37bbdd,null))[_0x381d('0x22')](function(_0x556ccf){if(_0x556ccf){return _0x556ccf[_0x381d('0x6c')](_0x2433d3[_0x381d('0x47')][_0x381d('0x6d')]);}})['then'](respondWithStatusCode(_0x37bbdd,null))['catch'](handleError(_0x37bbdd,null));};exports[_0x381d('0x6e')]=function(_0x10836c,_0x2012c8,_0x1a3002){if(_0x10836c['body']['id']){delete _0x10836c[_0x381d('0x5f')]['id'];}return db['WhatsappAccount'][_0x381d('0x66')]({'where':{'id':_0x10836c[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x2012c8,null))[_0x381d('0x22')](function(_0x1e10ac){if(_0x1e10ac){_0x10836c[_0x381d('0x5f')][_0x381d('0x69')]=_0x1e10ac['id'];return db[_0x381d('0x6f')][_0x381d('0x5e')](_0x10836c['body']);}})[_0x381d('0x22')](respondWithResult(_0x2012c8,null))[_0x381d('0x2b')](handleError(_0x2012c8,null));};exports[_0x381d('0x70')]=function(_0x46bd21,_0x38e3d3,_0x5069f7){var _0x563661={'raw':![],'where':{}};var _0x37b8dc={};var _0x1da5f4={'count':0x0,'rows':[]};return db[_0x381d('0x42')][_0x381d('0x6a')]({'where':{'id':_0x46bd21[_0x381d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x38e3d3,null))[_0x381d('0x22')](function(_0x2870d6){if(_0x2870d6){_0x37b8dc['model']=_[_0x381d('0x48')](db[_0x381d('0x6f')]['rawAttributes']);_0x37b8dc[_0x381d('0x47')]=_['keys'](_0x46bd21[_0x381d('0x47')]);_0x37b8dc[_0x381d('0x49')]=_[_0x381d('0x4a')](_0x37b8dc['model'],_0x37b8dc[_0x381d('0x47')]);_0x563661['attributes']=_[_0x381d('0x4a')](_0x37b8dc[_0x381d('0x46')],qs[_0x381d('0x4b')](_0x46bd21['query']['fields']));_0x563661[_0x381d('0x4d')]=_0x563661[_0x381d('0x4d')][_0x381d('0x4c')]?_0x563661[_0x381d('0x4d')]:_0x37b8dc[_0x381d('0x46')];if(!_0x46bd21[_0x381d('0x47')][_0x381d('0x4e')](_0x381d('0x4f'))){_0x563661['limit']=qs[_0x381d('0x32')](_0x46bd21[_0x381d('0x47')][_0x381d('0x32')]);_0x563661[_0x381d('0x30')]=qs[_0x381d('0x30')](_0x46bd21[_0x381d('0x47')][_0x381d('0x30')]);}_0x563661[_0x381d('0x71')]=qs[_0x381d('0x72')](_0x46bd21[_0x381d('0x47')][_0x381d('0x72')]);_0x563661[_0x381d('0x50')]=qs[_0x381d('0x49')](_[_0x381d('0x51')](_0x46bd21[_0x381d('0x47')],_0x37b8dc[_0x381d('0x49')]));_0x563661[_0x381d('0x50')][_0x381d('0x69')]=_0x2870d6['id'];if(_0x46bd21[_0x381d('0x47')][_0x381d('0x52')]){_0x563661[_0x381d('0x50')]=_['merge'](_0x563661['where'],{'$or':_[_0x381d('0x41')](_0x563661[_0x381d('0x4d')],function(_0x5252c1){var _0x15bc40={};_0x15bc40[_0x5252c1]={'$like':'%'+_0x46bd21[_0x381d('0x47')][_0x381d('0x52')]+'%'};return _0x15bc40;})});}_0x563661=_['merge']({},_0x563661,_0x46bd21[_0x381d('0x56')]);return db[_0x381d('0x6f')][_0x381d('0x33')]({'where':_0x563661[_0x381d('0x50')]})['then'](function(_0x4dc763){_0x1da5f4[_0x381d('0x33')]=_0x4dc763;if(_0x46bd21['query']['includeAll']){_0x563661[_0x381d('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0x381d('0x58')](_0x563661);})[_0x381d('0x22')](function(_0xf985ba){_0x1da5f4[_0x381d('0x59')]=_0xf985ba;return _0x1da5f4;});}})[_0x381d('0x22')](respondWithFilteredResult(_0x38e3d3,_0x563661))[_0x381d('0x2b')](handleError(_0x38e3d3,null));};exports[_0x381d('0x73')]=function(_0x3f3c0b,_0x578dda,_0x583d6f){return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x3f3c0b[_0x381d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x578dda,null))['then'](function(_0x3516eb){if(_0x3516eb){return _0x3516eb[_0x381d('0x73')](_0x3f3c0b[_0x381d('0x47')][_0x381d('0x6d')]);}})['then'](respondWithStatusCode(_0x578dda,null))[_0x381d('0x2b')](handleError(_0x578dda,null));};exports[_0x381d('0x74')]=function(_0x5b5f56,_0x1421ce,_0x220b9c){return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x5b5f56[_0x381d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1421ce,null))[_0x381d('0x22')](function(_0x2af7bc){if(_0x2af7bc){return _0x2af7bc[_0x381d('0x74')](_0x5b5f56[_0x381d('0x5f')][_0x381d('0x6d')],_[_0x381d('0x75')](_0x5b5f56[_0x381d('0x5f')],[_0x381d('0x6d'),'id'])||{})[_0x381d('0x76')](function(_0x4dab50){for(var _0x537ada=0x0;_0x537ada<_0x5b5f56[_0x381d('0x5f')][_0x381d('0x6d')][_0x381d('0x4c')];_0x537ada+=0x1){socket['emit'](_0x381d('0x77'),{'UserId':Number(_0x5b5f56[_0x381d('0x5f')][_0x381d('0x6d')][_0x537ada]),'WhatsappAccountId':Number(_0x5b5f56[_0x381d('0x5b')]['id'])});}return _0x4dab50;});}})[_0x381d('0x22')](respondWithResult(_0x1421ce,null))[_0x381d('0x2b')](handleError(_0x1421ce,null));};exports[_0x381d('0x78')]=function(_0x5a5db2,_0x5d8ab0,_0xd463e1){return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x5a5db2[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x5d8ab0,null))[_0x381d('0x22')](function(_0x2df1b1){if(_0x2df1b1){return _0x2df1b1[_0x381d('0x78')](_0x5a5db2['query'][_0x381d('0x6d')])[_0x381d('0x22')](function(){if(_[_0x381d('0x79')](_0x5a5db2[_0x381d('0x47')]['ids'])){for(var _0x458b94=0x0;_0x458b94<_0x5a5db2[_0x381d('0x47')][_0x381d('0x6d')][_0x381d('0x4c')];_0x458b94+=0x1){socket[_0x381d('0x7a')]('userWhatsappAccount:remove',{'UserId':Number(_0x5a5db2['query'][_0x381d('0x6d')][_0x458b94]),'WhatsappAccountId':Number(_0x5a5db2[_0x381d('0x5b')]['id'])});}}else{socket[_0x381d('0x7a')](_0x381d('0x7b'),{'UserId':Number(_0x5a5db2[_0x381d('0x47')]['ids']),'WhatsappAccountId':Number(_0x5a5db2[_0x381d('0x5b')]['id'])});}});}})[_0x381d('0x22')](respondWithStatusCode(_0x5d8ab0,null))['catch'](handleError(_0x5d8ab0,null));};exports[_0x381d('0x7c')]=function(_0x191f1c,_0xcb2802,_0x3c1f6c){var _0x432d1a={};var _0x11809a={};var _0x29b64b;var _0x490a32;return db[_0x381d('0x42')][_0x381d('0x6a')]({'where':{'id':_0x191f1c[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0xcb2802,null))['then'](function(_0x5aaaa3){if(_0x5aaaa3){_0x29b64b=_0x5aaaa3;_0x11809a['model']=_[_0x381d('0x48')](db[_0x381d('0x7d')]['rawAttributes']);_0x11809a['query']=_[_0x381d('0x48')](_0x191f1c[_0x381d('0x47')]);_0x11809a[_0x381d('0x49')]=_[_0x381d('0x4a')](_0x11809a[_0x381d('0x46')],_0x11809a['query']);_0x432d1a[_0x381d('0x4d')]=_['intersection'](_0x11809a[_0x381d('0x46')],qs[_0x381d('0x4b')](_0x191f1c[_0x381d('0x47')][_0x381d('0x4b')]));_0x432d1a[_0x381d('0x4d')]=_0x432d1a[_0x381d('0x4d')][_0x381d('0x4c')]?_0x432d1a[_0x381d('0x4d')]:_0x11809a[_0x381d('0x46')];_0x432d1a[_0x381d('0x71')]=qs[_0x381d('0x72')](_0x191f1c[_0x381d('0x47')][_0x381d('0x72')]);_0x432d1a[_0x381d('0x50')]=qs['filters'](_[_0x381d('0x51')](_0x191f1c[_0x381d('0x47')],_0x11809a[_0x381d('0x49')]));if(_0x191f1c[_0x381d('0x47')][_0x381d('0x52')]){_0x432d1a[_0x381d('0x50')]=_['merge'](_0x432d1a[_0x381d('0x50')],{'$or':_[_0x381d('0x41')](_0x432d1a['attributes'],function(_0x2137de){var _0x4e920d={};_0x4e920d[_0x2137de]={'$like':'%'+_0x191f1c[_0x381d('0x47')][_0x381d('0x52')]+'%'};return _0x4e920d;})});}_0x432d1a=_[_0x381d('0x53')]({},_0x432d1a,_0x191f1c[_0x381d('0x56')]);return _0x29b64b['getAgents'](_0x432d1a);}})[_0x381d('0x22')](function(_0x4193fd){if(_0x4193fd){_0x490a32=_0x4193fd[_0x381d('0x4c')];if(!_0x191f1c['query'][_0x381d('0x4e')](_0x381d('0x4f'))){_0x432d1a[_0x381d('0x32')]=qs['limit'](_0x191f1c['query'][_0x381d('0x32')]);_0x432d1a[_0x381d('0x30')]=qs[_0x381d('0x30')](_0x191f1c[_0x381d('0x47')][_0x381d('0x30')]);}return _0x29b64b[_0x381d('0x7c')](_0x432d1a);}})[_0x381d('0x22')](function(_0x5e80e8){if(_0x5e80e8){return _0x5e80e8?{'count':_0x490a32,'rows':_0x5e80e8}:null;}})[_0x381d('0x22')](respondWithResult(_0xcb2802,null))[_0x381d('0x2b')](handleError(_0xcb2802,null));};exports[_0x381d('0x7e')]=function(_0x4bebc8,_0x4e1881){var _0x2baa4e=_0x4bebc8[_0x381d('0x5b')]['id'];var _0x12defa=_0x4bebc8[_0x381d('0x5f')];var _0x305187=0xc8;var _0x995fa8=null;return db['sequelize'][_0x381d('0x7f')]({'isolationLevel':db[_0x381d('0x80')]['Transaction'][_0x381d('0x81')][_0x381d('0x82')]},function(_0x499cae){return db['WhatsappAccount'][_0x381d('0x6a')]({'where':{'id':_0x2baa4e},'transaction':_0x499cae})[_0x381d('0x22')](function(_0x239393){if(_0x239393){return db[_0x381d('0x83')]['destroy']({'where':{'WhatsappAccountId':_0x2baa4e},'transaction':_0x499cae})['then'](function(){var _0x8e820d=_[_0x381d('0x41')](_0x12defa,function(_0x5b38a3){_0x5b38a3[_0x381d('0x69')]=_0x2baa4e;return _0x5b38a3;});return db[_0x381d('0x83')][_0x381d('0x84')](_0x8e820d,{'transaction':_0x499cae});});}else{_0x305187=0x194;_0x995fa8=[];}});})['then'](function(){if(_0x305187!==0x194){return db[_0x381d('0x83')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x2baa4e},'order':_0x381d('0x85')})[_0x381d('0x22')](function(_0x55c372){_0x995fa8=_0x55c372;});}})[_0x381d('0x2b')](function(_0x10edc8){_0x305187=0x1f4;logger[_0x381d('0x27')](_0x10edc8[_0x381d('0x3c')]);if(_0x10edc8[_0x381d('0x3d')]){delete _0x10edc8[_0x381d('0x3d')];}_0x995fa8=_0x10edc8;})[_0x381d('0x86')](function(){if(_0x995fa8===null){_0x4e1881[_0x381d('0x2c')](_0x305187);}else{if(_0x305187===0x1f4){_0x4e1881['status'](_0x305187)[_0x381d('0x3e')](_0x995fa8);}else{_0x4e1881[_0x381d('0x2d')](_0x305187)[_0x381d('0x2f')](_0x995fa8);}}});};exports['getApplications']=function(_0x3cedaa,_0x403fd3,_0x3f3c5d){var _0x411914={};var _0x21baec={};var _0x4b41b7;var _0x762881;return db[_0x381d('0x42')][_0x381d('0x6a')]({'where':{'id':_0x3cedaa[_0x381d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x403fd3,null))[_0x381d('0x22')](function(_0x4f8679){if(_0x4f8679){_0x4b41b7=_0x4f8679;_0x21baec[_0x381d('0x46')]=_['keys'](db['WhatsappApplication'][_0x381d('0x43')]);_0x21baec[_0x381d('0x47')]=_[_0x381d('0x48')](_0x3cedaa['query']);_0x21baec[_0x381d('0x49')]=_[_0x381d('0x4a')](_0x21baec[_0x381d('0x46')],_0x21baec[_0x381d('0x47')]);_0x411914[_0x381d('0x4d')]=_[_0x381d('0x4a')](_0x21baec['model'],qs['fields'](_0x3cedaa[_0x381d('0x47')]['fields']));_0x411914['attributes']=_0x411914[_0x381d('0x4d')][_0x381d('0x4c')]?_0x411914[_0x381d('0x4d')]:_0x21baec[_0x381d('0x46')];_0x411914[_0x381d('0x71')]=qs[_0x381d('0x72')](_0x3cedaa[_0x381d('0x47')][_0x381d('0x72')]);_0x411914[_0x381d('0x50')]=qs[_0x381d('0x49')](_[_0x381d('0x51')](_0x3cedaa[_0x381d('0x47')],_0x21baec[_0x381d('0x49')]));if(_0x3cedaa[_0x381d('0x47')][_0x381d('0x52')]){_0x411914[_0x381d('0x50')]=_[_0x381d('0x53')](_0x411914[_0x381d('0x50')],{'$or':_[_0x381d('0x41')](_0x411914[_0x381d('0x4d')],function(_0x3a59fb){var _0x1032a1={};_0x1032a1[_0x3a59fb]={'$like':'%'+_0x3cedaa[_0x381d('0x47')][_0x381d('0x52')]+'%'};return _0x1032a1;})});}_0x411914=_[_0x381d('0x53')]({},_0x411914,_0x3cedaa[_0x381d('0x56')]);return _0x4b41b7[_0x381d('0x87')](_0x411914);}})[_0x381d('0x22')](function(_0x33d307){if(_0x33d307){_0x762881=_0x33d307['length'];if(!_0x3cedaa[_0x381d('0x47')]['hasOwnProperty'](_0x381d('0x4f'))){_0x411914[_0x381d('0x32')]=qs[_0x381d('0x32')](_0x3cedaa[_0x381d('0x47')][_0x381d('0x32')]);_0x411914['offset']=qs['offset'](_0x3cedaa['query'][_0x381d('0x30')]);}return _0x4b41b7[_0x381d('0x87')](_0x411914);}})['then'](function(_0x28b716){if(_0x28b716){return _0x28b716?{'count':_0x762881,'rows':_0x28b716}:null;}})[_0x381d('0x22')](respondWithResult(_0x403fd3,null))[_0x381d('0x2b')](handleError(_0x403fd3,null));};exports[_0x381d('0x88')]=function(_0x88aaef,_0x434454,_0x493edb){var _0x59c8f2={'channel':_0x381d('0x89')};var _0x23e687=[];var _0x4e7f72=[];var _0x27d724={};return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x88aaef['params']['id']},'include':[{'model':db[_0x381d('0x83')],'as':_0x381d('0x8a')}]})['then'](handleEntityNotFound(_0x434454,null))[_0x381d('0x22')](function(_0x22326d){_0x59c8f2[_0x381d('0x8b')]=_0x22326d;if(_0x59c8f2[_0x381d('0x8b')]&&_0x59c8f2['account']['type']===_0x381d('0x8c')&&_0x88aaef['body'][_0x381d('0x8d')]){if(_0x88aaef['body'][_0x381d('0x8d')][_0x381d('0x4c')]===0x0)return;if(_0x88aaef[_0x381d('0x5f')][_0x381d('0x8d')][0x0][_0x381d('0x8e')]!=='read')return;return db[_0x381d('0x8f')][_0x381d('0x38')]({'read':!![],'readAt':_0x88aaef[_0x381d('0x5f')][_0x381d('0x8d')][0x0]['timestamp']},{'where':{'messageId':_0x88aaef[_0x381d('0x5f')][_0x381d('0x8d')][0x0][_0x381d('0x90')]},'individualHooks':!![]})[_0x381d('0x22')](function(_0x278412){return _0x434454[_0x381d('0x2d')](0xc8)[_0x381d('0x2f')](_0x278412);});}_0x59c8f2[_0x381d('0x91')]=_['orderBy'](_0x22326d['Applications'],[_0x381d('0x85')],[_0x381d('0x92')]);if(_0x59c8f2[_0x381d('0x8b')][_0x381d('0x8a')]){delete _0x59c8f2['account'][_0x381d('0x8a')];}return db[_0x381d('0x93')]['describe']()[_0x381d('0x22')](function(_0x789f74){if(!_0x789f74){throw new db[(_0x381d('0x94'))][(_0x381d('0x95'))](_0x381d('0x96'));}_0x23e687=_[_0x381d('0x97')](_[_0x381d('0x48')](_0x789f74),[_0x381d('0x98'),'updatedAt']);_0x4e7f72=_[_0x381d('0x97')](_[_0x381d('0x48')](_0x789f74),[_0x381d('0x98'),_0x381d('0x99'),'CompanyId',_0x381d('0x9a')]);_0x59c8f2['body']={'mapKey':_0x381d('0x9b')};if(_0x59c8f2['account']&&_0x59c8f2['account'][_0x381d('0x54')]===_0x381d('0x9c')){_0x59c8f2[_0x381d('0x5f')][_0x381d('0x9d')]=_0x88aaef[_0x381d('0x5f')][_0x381d('0x9e')]['replace'](_0x381d('0x9f'),'');_0x59c8f2[_0x381d('0x5f')][_0x381d('0x5f')]=_0x88aaef[_0x381d('0x5f')][_0x381d('0xa0')];_0x59c8f2[_0x381d('0x5f')][_0x381d('0xa1')]=_0x88aaef[_0x381d('0x5f')][_0x381d('0xa2')];}if(_0x59c8f2[_0x381d('0x8b')]&&_0x59c8f2[_0x381d('0x8b')]['type']==='sinch'){_0x59c8f2[_0x381d('0x5f')][_0x381d('0x9d')]=_0x88aaef[_0x381d('0x5f')]['notifications'][0x0]['from'];_0x59c8f2[_0x381d('0x5f')][_0x381d('0x5f')]=_0x88aaef[_0x381d('0x5f')][_0x381d('0xa3')][0x0][_0x381d('0x2a')]['body'];_0x59c8f2[_0x381d('0x5f')][_0x381d('0xa1')]=_0x88aaef[_0x381d('0x5f')][_0x381d('0xa3')][0x0][_0x381d('0x90')];}if(_0x59c8f2[_0x381d('0x5f')]['id']){delete _0x59c8f2[_0x381d('0x5f')]['id'];}if(_[_0x381d('0xa4')](_0x59c8f2['body']['from'])){throw new db[(_0x381d('0x94'))][(_0x381d('0x95'))]('from\x20is\x20mandatory');}if(_[_0x381d('0xa4')](_0x59c8f2[_0x381d('0x5f')][_0x381d('0x5f')])||_0x59c8f2[_0x381d('0x5f')][_0x381d('0x5f')]===''){throw new db[(_0x381d('0x94'))][(_0x381d('0x95'))](_0x381d('0xa5'));}if(_['isNil'](_0x59c8f2[_0x381d('0x5f')][_0x381d('0xa6')])){throw new db[(_0x381d('0x94'))][(_0x381d('0x95'))](_0x381d('0xa7')+_0x4e7f72);}if(!_[_0x381d('0xa8')](_0x4e7f72,_0x59c8f2[_0x381d('0x5f')]['mapKey'])){throw new db['Sequelize'][(_0x381d('0x95'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e7f72);}_0x27d724[_0x59c8f2[_0x381d('0x5f')][_0x381d('0xa6')]]=_0x59c8f2[_0x381d('0x5f')][_0x381d('0x9d')];return db[_0x381d('0xa9')][_0x381d('0x66')]({'where':{'id':_0x59c8f2[_0x381d('0x8b')]['ListId']},'include':[{'model':db[_0x381d('0x93')],'as':'Contacts','where':_0x27d724,'limit':0x1,'order':[[_0x381d('0x99'),_0x381d('0xaa')]]}]});})[_0x381d('0x22')](handleEntityNotFound(_0x434454,null))['then'](function(_0x47f2d6){if(_0x47f2d6){_0x59c8f2[_0x381d('0xab')]=_[_0x381d('0x75')](_0x47f2d6,['Contacts']);if(_0x47f2d6[_0x381d('0xac')][_0x381d('0x4c')]){return _0x47f2d6['Contacts'][0x0];}var _0x37e2cf=_[_0x381d('0xad')](_0x59c8f2[_0x381d('0x5f')],{'firstName':_0x59c8f2['body']['from'],'ListId':_0x47f2d6['id']});_0x37e2cf[_0x59c8f2[_0x381d('0x5f')][_0x381d('0xa6')]]=_0x59c8f2[_0x381d('0x5f')][_0x381d('0x9d')];return db['CmContact'][_0x381d('0x5e')](_0x37e2cf,{'fields':_0x23e687,'raw':!![]});}})[_0x381d('0x22')](handleEntityNotFound(_0x434454,null))['then'](function(_0xd73695){if(_0xd73695){_0x59c8f2[_0x381d('0xae')]=_0xd73695;var _0x1f911c={'ContactId':_0xd73695['id'],'phone':_0x59c8f2[_0x381d('0x5f')]['from'],'WhatsappAccountId':_0x88aaef['params']['id']};var _0x7fe700={'ContactId':_0xd73695['id'],'WhatsappAccountId':_0x88aaef[_0x381d('0x5b')]['id'],'closed':![]};return db[_0x381d('0xaf')][_0x381d('0x66')]({'where':_0x7fe700})[_0x381d('0x22')](function(_0x206a8b){if(_0x206a8b){return[_0x206a8b,![]];}return db[_0x381d('0xaf')][_0x381d('0x5e')](_0x1f911c)[_0x381d('0x22')](function(_0x4d5f91){return[_0x4d5f91,!![]];});});}})[_0x381d('0x76')](function(_0x31c5a2,_0xaa15cb){_0x59c8f2['interaction']=_0x31c5a2['get']({'plain':!![]});_0x59c8f2[_0x381d('0xb0')]['created']=![];if(_0xaa15cb){if(_0x59c8f2[_0x381d('0x8b')][_0x381d('0xb1')]){_0x59c8f2['applications'][_0x381d('0xb2')]({'id':0x0,'priority':_0x59c8f2['applications'][_0x381d('0x4c')]+0x1,'app':'close','appdata':_0x381d('0xb3'),'interval':_0x381d('0xb4')});}_0x59c8f2[_0x381d('0xb0')]['created']=!![];}return db[_0x381d('0x8f')][_0x381d('0x5e')]({'phone':_0x59c8f2[_0x381d('0x5f')]['from'],'messageId':_0x59c8f2['body'][_0x381d('0xa1')],'body':_0x59c8f2[_0x381d('0x5f')][_0x381d('0x5f')],'WhatsappAccountId':_0x88aaef[_0x381d('0x5b')]['id'],'WhatsappInteractionId':_0x31c5a2['id'],'direction':'in','ContactId':_0x31c5a2['ContactId'],'AttachmentId':_0x59c8f2[_0x381d('0x5f')][_0x381d('0xb5')]});})[_0x381d('0x22')](function(_0x26b556){_0x59c8f2[_0x381d('0x2a')]=_0x26b556;if(_0x59c8f2[_0x381d('0xb0')][_0x381d('0xb6')]){return db[_0x381d('0x7d')][_0x381d('0x66')]({'attributes':['id',_0x381d('0x3d')],'where':{'id':_0x59c8f2[_0x381d('0xb0')][_0x381d('0xb6')]}})[_0x381d('0x22')](function(_0x3e9b93){if(_0x3e9b93){_0x59c8f2[_0x381d('0x91')][_0x381d('0xb7')]({'id':0x0,'priority':0x0,'app':_0x381d('0xb8'),'appdata':_0x3e9b93[_0x381d('0x3d')]+','+(_0x59c8f2[_0x381d('0x8b')][_0x381d('0xb9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x381d('0xba'),_0x59c8f2);});}return respondWithRpcPromise(_0x381d('0xbb'),_0x381d('0xba'),_0x59c8f2);})['then'](function(_0x8cd171){if(_0x8cd171){var _0x4f7a15=0xc8;var _0x391ec1=_0x381d('0xbc');logger[_0x381d('0xbd')](_0x381d('0x25'),_0x391ec1,_0x4f7a15,_0x381d('0xbe'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x391ec1,_0x4f7a15,_0x381d('0xbe'),JSON[_0x381d('0x26')](_0x8cd171));if(_0x59c8f2[_0x381d('0x8b')][_0x381d('0x54')]===_0x381d('0x9c')){return _0x434454[_0x381d('0x2d')](_0x4f7a15)[_0x381d('0x34')](_0x381d('0xbf'),_0x381d('0xc0'))[_0x381d('0x3e')](_0x381d('0xc1'));}else{return _0x434454[_0x381d('0x2d')](_0x4f7a15)['json'](_0x8cd171);}}});})[_0x381d('0x2b')](handleError(_0x434454,null));};exports[_0x381d('0x3e')]=function(_0x3c4e68,_0x5ed60e,_0x135f69){var _0xd357e8,_0x4784cf,_0x4a186d;if(_[_0x381d('0xa4')](_0x3c4e68[_0x381d('0x5f')]['body'])||_0x3c4e68['body'][_0x381d('0x5f')]===''){throw new db[(_0x381d('0x94'))][(_0x381d('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x381d('0xa4')](_0x3c4e68['body']['to'])){throw new db[(_0x381d('0x94'))]['ValidationError']('to\x20is\x20mandatory');}_0xd357e8=_0x3c4e68['body']['to'];return db['WhatsappAccount'][_0x381d('0x66')]({'where':{'id':_0x3c4e68[_0x381d('0x5b')]['id']},'include':[{'model':db[_0x381d('0xa9')],'as':'List','include':[{'model':db[_0x381d('0x93')],'as':_0x381d('0xac'),'where':{'mobile':_0xd357e8},'limit':0x1,'order':[[_0x381d('0x99'),'DESC']]}]}]})[_0x381d('0x22')](handleEntityNotFound(_0x5ed60e,null))[_0x381d('0x22')](function(_0x4ff1c0){if(_0x4ff1c0&&_0x4ff1c0[_0x381d('0xc2')]){_0x4784cf=_0x4ff1c0[_0x381d('0x3a')]({'plain':!![]});if(_0x4784cf[_0x381d('0xc2')]&&_0x4784cf[_0x381d('0xc2')][_0x381d('0xac')][_0x381d('0x4c')]){return _0x4784cf[_0x381d('0xc2')][_0x381d('0xac')][0x0];}return db[_0x381d('0x93')]['create'](_[_0x381d('0xad')](_0x3c4e68[_0x381d('0x5f')],{'firstName':_0xd357e8,'mobile':_0xd357e8,'phone':_0xd357e8,'ListId':_0x4784cf[_0x381d('0x9a')]}));}})[_0x381d('0x22')](handleEntityNotFound(_0x5ed60e,null))[_0x381d('0x22')](function(_0x350073){if(_0x350073){_0x4a186d=_0x350073;return db[_0x381d('0xaf')][_0x381d('0x66')]({'where':{'ContactId':_0x4a186d['id'],'closed':![],'WhatsappAccountId':_0x4784cf['id']}})[_0x381d('0x22')](function(_0x3afca9){if(_0x3afca9){return[_0x3afca9,![]];}return db['WhatsappInteraction'][_0x381d('0x5e')]({'UserId':_0x3c4e68['user']['id'],'ContactId':_0x4a186d['id'],'WhatsappAccountId':_0x4784cf['id'],'phone':_0xd357e8,'firstMsgDirection':_0x381d('0xc3'),'Messages':[_[_0x381d('0x53')](_0x3c4e68[_0x381d('0x5f')],{'read':![],'body':_0x3c4e68[_0x381d('0x5f')][_0x381d('0x5f')],'phone':_0xd357e8,'WhatsappAccountId':_0x4784cf['id'],'UserId':_0x3c4e68[_0x381d('0x60')]['id'],'ContactId':_0x4a186d['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x381d('0xc4')}]})[_0x381d('0x22')](function(_0x14682b){return[_0x14682b,!![]];});});}})[_0x381d('0x76')](function(_0x233cf4,_0x252f1f){if(_0x252f1f){return _0x233cf4;}return db[_0x381d('0x8f')]['create'](_[_0x381d('0x53')](_0x3c4e68[_0x381d('0x5f')],{'read':![],'body':_0x3c4e68[_0x381d('0x5f')]['body'],'phone':_0xd357e8,'WhatsappAccountId':_0x4784cf['id'],'WhatsappInteractionId':_0x233cf4['id'],'UserId':_0x3c4e68[_0x381d('0x60')]['id'],'ContactId':_0x4a186d['id']}))[_0x381d('0x22')](function(_0x302109){_0x233cf4[_0x381d('0xc5')][_0x381d('0xc4')]=[];_0x233cf4[_0x381d('0xc5')][_0x381d('0xc4')][_0x381d('0xb2')](_0x302109['dataValues']);return _0x233cf4;});})['then'](respondWithResult(_0x5ed60e,null))[_0x381d('0x2b')](handleError(_0x5ed60e,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 6dfb3c1..98f0768 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01cf=['save','update','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x1d0aee,_0x2c4454){var _0x34ee2c=function(_0x6e3b9d){while(--_0x6e3b9d){_0x1d0aee['push'](_0x1d0aee['shift']());}};_0x34ee2c(++_0x2c4454);}(_0x01cf,0xb4));var _0xf01c=function(_0x33d4a3,_0x3e2dd4){_0x33d4a3=_0x33d4a3-0x0;var _0x5c2ac2=_0x01cf[_0x33d4a3];return _0x5c2ac2;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xf01c('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf01c('0x1')](0x0);var events={'afterCreate':_0xf01c('0x2'),'afterUpdate':_0xf01c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2412d6){return function(_0x2ebe0b,_0x5dfc86,_0x42531b){WhatsappAccountEvents[_0xf01c('0x4')](_0x2412d6+':'+_0x2ebe0b['id'],_0x2ebe0b);WhatsappAccountEvents[_0xf01c('0x4')](_0x2412d6,_0x2ebe0b);_0x42531b(null);};}for(var e in events){if(events[_0xf01c('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xf01c('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0xd4e7=['hasOwnProperty','hook','exports','events','setMaxListeners','save','remove'];(function(_0x447ad8,_0x410b9d){var _0x545ef2=function(_0x2cbca6){while(--_0x2cbca6){_0x447ad8['push'](_0x447ad8['shift']());}};_0x545ef2(++_0x410b9d);}(_0xd4e7,0xce));var _0x7d4e=function(_0x46e1f5,_0x4b326e){_0x46e1f5=_0x46e1f5-0x0;var _0x22bc91=_0xd4e7[_0x46e1f5];return _0x22bc91;};'use strict';var EventEmitter=require(_0x7d4e('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7d4e('0x1')](0x0);var events={'afterCreate':_0x7d4e('0x2'),'afterUpdate':'update','afterDestroy':_0x7d4e('0x3')};function emitEvent(_0xd66743){return function(_0x5e783c,_0x55521a,_0x5af63e){WhatsappAccountEvents['emit'](_0xd66743+':'+_0x5e783c['id'],_0x5e783c);WhatsappAccountEvents['emit'](_0xd66743,_0x5e783c);_0x5af63e(null);};}for(var e in events){if(events[_0x7d4e('0x4')](e)){var event=events[e];WhatsappAccount[_0x7d4e('0x5')](e,emitEvent(event));}}module[_0x7d4e('0x6')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 52d3954..02a0277 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d9a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x1c2d01,_0x55590b){var _0x2fe07e=function(_0x1e56f1){while(--_0x1e56f1){_0x1c2d01['push'](_0x1c2d01['shift']());}};_0x2fe07e(++_0x55590b);}(_0x4d9a,0x8d));var _0xa4d9=function(_0x69ed47,_0x1843a9){_0x69ed47=_0x69ed47-0x0;var _0x44a175=_0x4d9a[_0x69ed47];return _0x44a175;};'use strict';var _=require(_0xa4d9('0x0'));var util=require(_0xa4d9('0x1'));var logger=require('../../config/logger')(_0xa4d9('0x2'));var moment=require(_0xa4d9('0x3'));var BPromise=require(_0xa4d9('0x4'));var rp=require(_0xa4d9('0x5'));var fs=require('fs');var path=require(_0xa4d9('0x6'));var rimraf=require(_0xa4d9('0x7'));var config=require(_0xa4d9('0x8'));var attributes=require(_0xa4d9('0x9'));module['exports']=function(_0x8e70d8,_0x12ab10){return _0x8e70d8[_0xa4d9('0xa')](_0xa4d9('0xb'),attributes,{'tableName':_0xa4d9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76ba=['path','rimraf','../../config/environment','./whatsappAccount.attributes','define','whatsapp_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x37af5a,_0x5e3f15){var _0x2cc353=function(_0x5c51e6){while(--_0x5c51e6){_0x37af5a['push'](_0x37af5a['shift']());}};_0x2cc353(++_0x5e3f15);}(_0x76ba,0x171));var _0xa76b=function(_0x29e5c0,_0x514882){_0x29e5c0=_0x29e5c0-0x0;var _0x3231b8=_0x76ba[_0x29e5c0];return _0x3231b8;};'use strict';var _=require('lodash');var util=require(_0xa76b('0x0'));var logger=require(_0xa76b('0x1'))(_0xa76b('0x2'));var moment=require(_0xa76b('0x3'));var BPromise=require(_0xa76b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa76b('0x5'));var rimraf=require(_0xa76b('0x6'));var config=require(_0xa76b('0x7'));var attributes=require(_0xa76b('0x8'));module['exports']=function(_0x474414,_0xbb1317){return _0x474414[_0xa76b('0x9')]('WhatsappAccount',attributes,{'tableName':_0xa76b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index c496a67..dc379a3 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa84=['raw','options','where','attributes','map','model','include','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find'];(function(_0x14a62c,_0x5c77e1){var _0x5bab14=function(_0xa6dc35){while(--_0xa6dc35){_0x14a62c['push'](_0x14a62c['shift']());}};_0x5bab14(++_0x5c77e1);}(_0xfa84,0xca));var _0x4fa8=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfa84[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x4fa8('0x0'));var util=require(_0x4fa8('0x1'));var moment=require(_0x4fa8('0x2'));var BPromise=require('bluebird');var rs=require(_0x4fa8('0x3'));var fs=require('fs');var Redis=require(_0x4fa8('0x4'));var db=require(_0x4fa8('0x5'))['db'];var utils=require(_0x4fa8('0x6'));var logger=require(_0x4fa8('0x7'))(_0x4fa8('0x8'));var config=require(_0x4fa8('0x9'));var jayson=require(_0x4fa8('0xa'));var client=jayson['client'][_0x4fa8('0xb')]({'port':0x232a});config['redis']=_[_0x4fa8('0xc')](config[_0x4fa8('0xd')],{'host':_0x4fa8('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4fa8('0xd')]));require('./whatsappAccount.socket')[_0x4fa8('0xf')](socket);function respondWithRpcPromise(_0x1f9317,_0xc204b6,_0x5b00c9){return new BPromise(function(_0x2b8fcc,_0x204c5d){return client[_0x4fa8('0x10')](_0x1f9317,_0x5b00c9)[_0x4fa8('0x11')](function(_0x301bcc){logger[_0x4fa8('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0xc204b6,_0x4fa8('0x13'));logger[_0x4fa8('0x14')](_0x4fa8('0x15'),_0xc204b6,_0x4fa8('0x13'),JSON[_0x4fa8('0x16')](_0x301bcc));if(_0x301bcc['error']){if(_0x301bcc[_0x4fa8('0x17')][_0x4fa8('0x18')]===0x1f4){logger[_0x4fa8('0x17')](_0x4fa8('0x19'),_0xc204b6,_0x301bcc[_0x4fa8('0x17')]['message']);return _0x204c5d(_0x301bcc[_0x4fa8('0x17')][_0x4fa8('0x1a')]);}logger[_0x4fa8('0x17')](_0x4fa8('0x19'),_0xc204b6,_0x301bcc['error'][_0x4fa8('0x1a')]);return _0x2b8fcc(_0x301bcc[_0x4fa8('0x17')][_0x4fa8('0x1a')]);}else{logger[_0x4fa8('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0xc204b6,'request\x20sent');_0x2b8fcc(_0x301bcc[_0x4fa8('0x1b')][_0x4fa8('0x1a')]);}})[_0x4fa8('0x1c')](function(_0x3fc15a){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0xc204b6,_0x3fc15a);_0x204c5d(_0x3fc15a);});});}exports[_0x4fa8('0x1d')]=function(_0x2c6eb9){var _0x432073=this;return new Promise(function(_0x4947cd,_0x43b81b){return db[_0x4fa8('0x1e')][_0x4fa8('0x1f')]({'raw':_0x2c6eb9['options']?_0x2c6eb9['options'][_0x4fa8('0x20')]===undefined?!![]:![]:!![],'where':_0x2c6eb9[_0x4fa8('0x21')]?_0x2c6eb9[_0x4fa8('0x21')][_0x4fa8('0x22')]||null:null,'attributes':_0x2c6eb9[_0x4fa8('0x21')]?_0x2c6eb9[_0x4fa8('0x21')][_0x4fa8('0x23')]||null:null,'include':_0x2c6eb9[_0x4fa8('0x21')]?_0x2c6eb9[_0x4fa8('0x21')]['include']?_[_0x4fa8('0x24')](_0x2c6eb9[_0x4fa8('0x21')]['include'],function(_0x11cae1){return{'model':db[_0x11cae1[_0x4fa8('0x25')]],'as':_0x11cae1['as'],'attributes':_0x11cae1[_0x4fa8('0x23')],'include':_0x11cae1['include']?_[_0x4fa8('0x24')](_0x11cae1['include'],function(_0x39da83){return{'model':db[_0x39da83[_0x4fa8('0x25')]],'as':_0x39da83['as'],'attributes':_0x39da83[_0x4fa8('0x23')],'include':_0x39da83['include']?_['map'](_0x39da83[_0x4fa8('0x26')],function(_0x4c47e7){return{'model':db[_0x4c47e7[_0x4fa8('0x25')]],'as':_0x4c47e7['as'],'attributes':_0x4c47e7[_0x4fa8('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4fa8('0x11')](function(_0x5b25ea){logger[_0x4fa8('0x12')](_0x4fa8('0x1d'),_0x2c6eb9);logger['debug'](_0x4fa8('0x1d'),_0x2c6eb9,JSON[_0x4fa8('0x16')](_0x5b25ea));_0x4947cd(_0x5b25ea);})['catch'](function(_0x4b73c6){logger[_0x4fa8('0x17')](_0x4fa8('0x1d'),_0x4b73c6[_0x4fa8('0x1a')],_0x2c6eb9);_0x43b81b(_0x432073[_0x4fa8('0x17')](0x1f4,_0x4b73c6[_0x4fa8('0x1a')]));});});}; \ No newline at end of file +var _0xc4b2=['randomstring','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird'];(function(_0x141cbe,_0x24b13a){var _0x395766=function(_0x1d7749){while(--_0x1d7749){_0x141cbe['push'](_0x141cbe['shift']());}};_0x395766(++_0x24b13a);}(_0xc4b2,0x113));var _0x2c4b=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0xc4b2[_0x4a6cf8];return _0x22205e;};'use strict';var _=require(_0x2c4b('0x0'));var util=require(_0x2c4b('0x1'));var moment=require(_0x2c4b('0x2'));var BPromise=require(_0x2c4b('0x3'));var rs=require(_0x2c4b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c4b('0x5'));var config=require(_0x2c4b('0x6'));var jayson=require(_0x2c4b('0x7'));var client=jayson['client'][_0x2c4b('0x8')]({'port':0x232a});config[_0x2c4b('0x9')]=_[_0x2c4b('0xa')](config[_0x2c4b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c4b('0xb'))(new Redis(config[_0x2c4b('0x9')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x345f7c,_0x3b7b98,_0x10aa39){return new BPromise(function(_0x2cb115,_0xe42357){return client['request'](_0x345f7c,_0x10aa39)['then'](function(_0x485579){logger[_0x2c4b('0xc')](_0x2c4b('0xd'),_0x3b7b98,'request\x20sent');logger[_0x2c4b('0xe')](_0x2c4b('0xf'),_0x3b7b98,'request\x20sent',JSON[_0x2c4b('0x10')](_0x485579));if(_0x485579['error']){if(_0x485579[_0x2c4b('0x11')]['code']===0x1f4){logger[_0x2c4b('0x11')](_0x2c4b('0xd'),_0x3b7b98,_0x485579[_0x2c4b('0x11')]['message']);return _0xe42357(_0x485579[_0x2c4b('0x11')][_0x2c4b('0x12')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x3b7b98,_0x485579[_0x2c4b('0x11')][_0x2c4b('0x12')]);return _0x2cb115(_0x485579[_0x2c4b('0x11')]['message']);}else{logger[_0x2c4b('0xc')](_0x2c4b('0xd'),_0x3b7b98,'request\x20sent');_0x2cb115(_0x485579[_0x2c4b('0x13')]['message']);}})[_0x2c4b('0x14')](function(_0x123762){logger[_0x2c4b('0x11')](_0x2c4b('0xd'),_0x3b7b98,_0x123762);_0xe42357(_0x123762);});});}exports[_0x2c4b('0x15')]=function(_0x53ba70){var _0x164087=this;return new Promise(function(_0x2b1ef2,_0x175a17){return db[_0x2c4b('0x16')]['find']({'raw':_0x53ba70['options']?_0x53ba70[_0x2c4b('0x17')][_0x2c4b('0x18')]===undefined?!![]:![]:!![],'where':_0x53ba70[_0x2c4b('0x17')]?_0x53ba70[_0x2c4b('0x17')][_0x2c4b('0x19')]||null:null,'attributes':_0x53ba70[_0x2c4b('0x17')]?_0x53ba70[_0x2c4b('0x17')][_0x2c4b('0x1a')]||null:null,'include':_0x53ba70[_0x2c4b('0x17')]?_0x53ba70[_0x2c4b('0x17')][_0x2c4b('0x1b')]?_[_0x2c4b('0x1c')](_0x53ba70[_0x2c4b('0x17')][_0x2c4b('0x1b')],function(_0x2d4ee2){return{'model':db[_0x2d4ee2['model']],'as':_0x2d4ee2['as'],'attributes':_0x2d4ee2['attributes'],'include':_0x2d4ee2[_0x2c4b('0x1b')]?_[_0x2c4b('0x1c')](_0x2d4ee2[_0x2c4b('0x1b')],function(_0x300bd0){return{'model':db[_0x300bd0[_0x2c4b('0x1d')]],'as':_0x300bd0['as'],'attributes':_0x300bd0['attributes'],'include':_0x300bd0[_0x2c4b('0x1b')]?_['map'](_0x300bd0[_0x2c4b('0x1b')],function(_0x3646f5){return{'model':db[_0x3646f5[_0x2c4b('0x1d')]],'as':_0x3646f5['as'],'attributes':_0x3646f5['attributes']};}):[]};}):[]};}):[]:[]})[_0x2c4b('0x1e')](function(_0x5ce143){logger[_0x2c4b('0xc')](_0x2c4b('0x15'),_0x53ba70);logger[_0x2c4b('0xe')](_0x2c4b('0x15'),_0x53ba70,JSON[_0x2c4b('0x10')](_0x5ce143));_0x2b1ef2(_0x5ce143);})[_0x2c4b('0x14')](function(_0x58d9d1){logger[_0x2c4b('0x11')](_0x2c4b('0x15'),_0x58d9d1[_0x2c4b('0x12')],_0x53ba70);_0x175a17(_0x164087[_0x2c4b('0x11')](0x1f4,_0x58d9d1[_0x2c4b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index c376ba6..3032830 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3add=['remove','update','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x6133ca,_0x1a58b3){var _0x47c198=function(_0x37f79e){while(--_0x37f79e){_0x6133ca['push'](_0x6133ca['shift']());}};_0x47c198(++_0x1a58b3);}(_0x3add,0x18e));var _0xd3ad=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x3add[_0x79b649];return _0x1af9b1;};'use strict';var WhatsappAccountEvents=require(_0xd3ad('0x0'));var events=[_0xd3ad('0x1'),_0xd3ad('0x2'),_0xd3ad('0x3')];function createListener(_0x25be5b,_0x8de6b2){return function(_0x2b2f92){_0x8de6b2['emit'](_0x25be5b,_0x2b2f92);};}function removeListener(_0x1f25cf,_0x12110d){return function(){WhatsappAccountEvents[_0xd3ad('0x4')](_0x1f25cf,_0x12110d);};}exports[_0xd3ad('0x5')]=function(_0x330b96){for(var _0x3e3693=0x0,_0x54e7a9=events[_0xd3ad('0x6')];_0x3e3693<_0x54e7a9;_0x3e3693++){var _0x537c4a=events[_0x3e3693];var _0x416251=createListener(_0xd3ad('0x7')+_0x537c4a,_0x330b96);WhatsappAccountEvents['on'](_0x537c4a,_0x416251);}}; \ No newline at end of file +var _0xdbc4=['whatsappAccount:','./whatsappAccount.events','save','remove','update','removeListener','register','length'];(function(_0x1ab8d7,_0xb19e9e){var _0x3c9e66=function(_0x4f67c9){while(--_0x4f67c9){_0x1ab8d7['push'](_0x1ab8d7['shift']());}};_0x3c9e66(++_0xb19e9e);}(_0xdbc4,0xd1));var _0x4dbc=function(_0x83db46,_0xfe0f30){_0x83db46=_0x83db46-0x0;var _0x102fa7=_0xdbc4[_0x83db46];return _0x102fa7;};'use strict';var WhatsappAccountEvents=require(_0x4dbc('0x0'));var events=[_0x4dbc('0x1'),_0x4dbc('0x2'),_0x4dbc('0x3')];function createListener(_0x4f3774,_0x132673){return function(_0x35f1ec){_0x132673['emit'](_0x4f3774,_0x35f1ec);};}function removeListener(_0x7d2d0c,_0xee7342){return function(){WhatsappAccountEvents[_0x4dbc('0x4')](_0x7d2d0c,_0xee7342);};}exports[_0x4dbc('0x5')]=function(_0x53e2bd){for(var _0x447849=0x0,_0x44971a=events[_0x4dbc('0x6')];_0x447849<_0x44971a;_0x447849++){var _0x2993e3=events[_0x447849];var _0xdfe391=createListener(_0x4dbc('0x7')+_0x2993e3,_0x53e2bd);WhatsappAccountEvents['on'](_0x2993e3,_0xdfe391);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 2280a12..f9f3f2f 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports'];(function(_0x2aed3,_0x5f9c05){var _0x160e00=function(_0x552b3a){while(--_0x552b3a){_0x2aed3['push'](_0x2aed3['shift']());}};_0x160e00(++_0x5f9c05);}(_0x9c00,0x88));var _0x09c0=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0x9c00[_0x4551f6];return _0x581dc2;};'use strict';var multer=require('multer');var util=require(_0x09c0('0x0'));var path=require('path');var timeout=require(_0x09c0('0x1'));var express=require('express');var router=express[_0x09c0('0x2')]();var fs_extra=require(_0x09c0('0x3'));var auth=require(_0x09c0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x09c0('0x5'));var controller=require(_0x09c0('0x6'));router[_0x09c0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x7')](_0x09c0('0x8'),auth[_0x09c0('0x9')](),controller[_0x09c0('0xa')]);router[_0x09c0('0xb')]('/',auth[_0x09c0('0x9')](),controller['create']);router[_0x09c0('0xc')](_0x09c0('0x8'),auth[_0x09c0('0x9')](),controller[_0x09c0('0xd')]);router[_0x09c0('0xe')](_0x09c0('0x8'),auth[_0x09c0('0x9')](),controller[_0x09c0('0xf')]);module[_0x09c0('0x10')]=router; \ No newline at end of file +var _0xc4b8=['../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','/:id','put','isAuthenticated','update','delete','exports','multer','path','fs-extra'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc4b8,0x19d));var _0x8c4b=function(_0x20ac45,_0x593ef2){_0x20ac45=_0x20ac45-0x0;var _0x3d01f8=_0xc4b8[_0x20ac45];return _0x3d01f8;};'use strict';var multer=require(_0x8c4b('0x0'));var util=require('util');var path=require(_0x8c4b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8c4b('0x2'));var auth=require(_0x8c4b('0x3'));var interaction=require(_0x8c4b('0x4'));var config=require('../../config/environment');var controller=require(_0x8c4b('0x5'));router[_0x8c4b('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8c4b('0x7'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8c4b('0x8')](_0x8c4b('0x7'),auth[_0x8c4b('0x9')](),controller[_0x8c4b('0xa')]);router[_0x8c4b('0xb')]('/:id',auth[_0x8c4b('0x9')](),controller['destroy']);module[_0x8c4b('0xc')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 382bc35..8561a99 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2c4=['sequelize','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x23b1d5,_0x3043fa){var _0x3f5702=function(_0xc9b7eb){while(--_0xc9b7eb){_0x23b1d5['push'](_0x23b1d5['shift']());}};_0x3f5702(++_0x3043fa);}(_0xa2c4,0xb4));var _0x4a2c=function(_0x204c88,_0x39d5f5){_0x204c88=_0x204c88-0x0;var _0x49975b=_0xa2c4[_0x204c88];return _0x49975b;};'use strict';var Sequelize=require(_0x4a2c('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4a2c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4a2c('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4a2c('0x3')]()},'description':{'type':Sequelize[_0x4a2c('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4a2c('0x4')}}; \ No newline at end of file +var _0x6465=['STRING','noop','sequelize','INTEGER'];(function(_0x5ee752,_0x35d3df){var _0x121f91=function(_0x1c1654){while(--_0x1c1654){_0x5ee752['push'](_0x5ee752['shift']());}};_0x121f91(++_0x35d3df);}(_0x6465,0x14a));var _0x5646=function(_0x4c973a,_0x1e68e7){_0x4c973a=_0x4c973a-0x0;var _0x1cb814=_0x6465[_0x4c973a];return _0x1cb814;};'use strict';var Sequelize=require(_0x5646('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5646('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5646('0x2')],'allowNull':![],'defaultValue':_0x5646('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5646('0x2')]},'interval':{'type':Sequelize[_0x5646('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index d48da75..cdbcfad 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd36=['WhatsappApplication','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','fields','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map'];(function(_0x40aa6f,_0x11ad11){var _0x561bd2=function(_0x18415b){while(--_0x18415b){_0x40aa6f['push'](_0x40aa6f['shift']());}};_0x561bd2(++_0x11ad11);}(_0xbd36,0x65));var _0x6bd3=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xbd36[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0x6bd3('0x0'));var rimraf=require(_0x6bd3('0x1'));var zipdir=require(_0x6bd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6bd3('0x3'));var BPromise=require(_0x6bd3('0x4'));var Mustache=require('mustache');var util=require(_0x6bd3('0x5'));var path=require(_0x6bd3('0x6'));var sox=require(_0x6bd3('0x7'));var csv=require(_0x6bd3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6bd3('0x9'));var _=require(_0x6bd3('0xa'));var squel=require(_0x6bd3('0xb'));var crypto=require(_0x6bd3('0xc'));var jsforce=require(_0x6bd3('0xd'));var deskjs=require(_0x6bd3('0xe'));var toCsv=require(_0x6bd3('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6bd3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6bd3('0x10'));var as=require(_0x6bd3('0x11'));var hardwareService=require(_0x6bd3('0x12'));var logger=require(_0x6bd3('0x13'))(_0x6bd3('0x14'));var utils=require('../../config/utils');var config=require(_0x6bd3('0x15'));var licenseUtil=require(_0x6bd3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29c44d,_0x43bf5f){_0x43bf5f=_0x43bf5f||0xcc;return function(_0x2a047c){if(_0x2a047c){return _0x29c44d[_0x6bd3('0x17')](_0x43bf5f);}return _0x29c44d[_0x6bd3('0x18')](_0x43bf5f)[_0x6bd3('0x19')]();};}function respondWithResult(_0x4dd159,_0x141121){_0x141121=_0x141121||0xc8;return function(_0x4987f9){if(_0x4987f9){return _0x4dd159[_0x6bd3('0x18')](_0x141121)[_0x6bd3('0x1a')](_0x4987f9);}};}function respondWithFilteredResult(_0x5ad1f8,_0x583df8){return function(_0x47acc9){if(_0x47acc9){var _0x115ca9=typeof _0x583df8['offset']===_0x6bd3('0x1b')&&typeof _0x583df8[_0x6bd3('0x1c')]===_0x6bd3('0x1b');var _0x4732f3=_0x47acc9['count'];var _0x573656=_0x115ca9?0x0:_0x583df8[_0x6bd3('0x1d')];var _0x769de8=_0x115ca9?_0x47acc9[_0x6bd3('0x1e')]:_0x583df8[_0x6bd3('0x1d')]+_0x583df8[_0x6bd3('0x1c')];var _0xf96734;if(_0x769de8>=_0x4732f3){_0x769de8=_0x4732f3;_0xf96734=0xc8;}else{_0xf96734=0xce;}_0x5ad1f8[_0x6bd3('0x18')](_0xf96734);return _0x5ad1f8[_0x6bd3('0x1f')](_0x6bd3('0x20'),_0x573656+'-'+_0x769de8+'/'+_0x4732f3)[_0x6bd3('0x1a')](_0x47acc9);}return null;};}function patchUpdates(_0x256bca){return function(_0x175d46){try{jsonpatch[_0x6bd3('0x21')](_0x175d46,_0x256bca,!![]);}catch(_0x36618c){return BPromise[_0x6bd3('0x22')](_0x36618c);}return _0x175d46[_0x6bd3('0x23')]();};}function saveUpdates(_0x473b10,_0x1d09fd){return function(_0x9ffd4b){if(_0x9ffd4b){return _0x9ffd4b[_0x6bd3('0x24')](_0x473b10)['then'](function(_0x3365a4){return _0x3365a4;});}return null;};}function removeEntity(_0x3a9d0d,_0x28b9a9){return function(_0x52def3){if(_0x52def3){return _0x52def3[_0x6bd3('0x25')]()[_0x6bd3('0x26')](function(){_0x3a9d0d[_0x6bd3('0x18')](0xcc)[_0x6bd3('0x19')]();});}};}function handleEntityNotFound(_0xa8c894,_0x24230d){return function(_0x143055){if(!_0x143055){_0xa8c894[_0x6bd3('0x17')](0x194);}return _0x143055;};}function handleError(_0x49dc5c,_0xab162b){_0xab162b=_0xab162b||0x1f4;return function(_0x585f4e){logger[_0x6bd3('0x27')](_0x585f4e[_0x6bd3('0x28')]);if(_0x585f4e['name']){delete _0x585f4e[_0x6bd3('0x29')];}_0x49dc5c[_0x6bd3('0x18')](_0xab162b)[_0x6bd3('0x2a')](_0x585f4e);};}exports[_0x6bd3('0x2b')]=function(_0x4444bd,_0x1f45af){var _0x7f3385={},_0x552628={},_0xf12e0d={'count':0x0,'rows':[]};var _0xe2772a=_[_0x6bd3('0x2c')](db[_0x6bd3('0x2d')]['rawAttributes'],function(_0x5e1281){return{'name':_0x5e1281['fieldName'],'type':_0x5e1281[_0x6bd3('0x2e')][_0x6bd3('0x2f')]};});_0x552628[_0x6bd3('0x30')]=_[_0x6bd3('0x2c')](_0xe2772a,_0x6bd3('0x29'));_0x552628['query']=_[_0x6bd3('0x31')](_0x4444bd[_0x6bd3('0x32')]);_0x552628['filters']=_[_0x6bd3('0x33')](_0x552628[_0x6bd3('0x30')],_0x552628[_0x6bd3('0x32')]);_0x7f3385['attributes']=_[_0x6bd3('0x33')](_0x552628[_0x6bd3('0x30')],qs['fields'](_0x4444bd[_0x6bd3('0x32')]['fields']));_0x7f3385[_0x6bd3('0x34')]=_0x7f3385[_0x6bd3('0x34')][_0x6bd3('0x35')]?_0x7f3385[_0x6bd3('0x34')]:_0x552628[_0x6bd3('0x30')];if(!_0x4444bd[_0x6bd3('0x32')][_0x6bd3('0x36')]('nolimit')){_0x7f3385[_0x6bd3('0x1c')]=qs[_0x6bd3('0x1c')](_0x4444bd[_0x6bd3('0x32')][_0x6bd3('0x1c')]);_0x7f3385[_0x6bd3('0x1d')]=qs[_0x6bd3('0x1d')](_0x4444bd[_0x6bd3('0x32')][_0x6bd3('0x1d')]);}_0x7f3385[_0x6bd3('0x37')]=qs[_0x6bd3('0x38')](_0x4444bd[_0x6bd3('0x32')]['sort']);_0x7f3385['where']=qs[_0x6bd3('0x39')](_[_0x6bd3('0x3a')](_0x4444bd[_0x6bd3('0x32')],_0x552628[_0x6bd3('0x39')]),_0xe2772a);if(_0x4444bd['query'][_0x6bd3('0x3b')]){_0x7f3385['where']=_[_0x6bd3('0x3c')](_0x7f3385[_0x6bd3('0x3d')],{'$or':_['map'](_0xe2772a,function(_0x4b9031){if(_0x4b9031[_0x6bd3('0x2e')]!==_0x6bd3('0x3e')){var _0x18274d={};_0x18274d[_0x4b9031[_0x6bd3('0x29')]]={'$like':'%'+_0x4444bd['query'][_0x6bd3('0x3b')]+'%'};return _0x18274d;}})});}_0x7f3385=_[_0x6bd3('0x3c')]({},_0x7f3385,_0x4444bd[_0x6bd3('0x3f')]);var _0x581a22={'where':_0x7f3385[_0x6bd3('0x3d')]};return db['WhatsappApplication'][_0x6bd3('0x1e')](_0x581a22)[_0x6bd3('0x26')](function(_0x37019f){_0xf12e0d['count']=_0x37019f;if(_0x4444bd[_0x6bd3('0x32')][_0x6bd3('0x40')]){_0x7f3385[_0x6bd3('0x41')]=[{'all':!![]}];}return db[_0x6bd3('0x2d')]['findAll'](_0x7f3385);})[_0x6bd3('0x26')](function(_0x41199e){_0xf12e0d['rows']=_0x41199e;return _0xf12e0d;})[_0x6bd3('0x26')](respondWithFilteredResult(_0x1f45af,_0x7f3385))[_0x6bd3('0x42')](handleError(_0x1f45af,null));};exports['show']=function(_0x100015,_0x397dc8){var _0xe2ca49={'raw':!![],'where':{'id':_0x100015[_0x6bd3('0x43')]['id']}},_0x1dbd4c={};_0x1dbd4c[_0x6bd3('0x30')]=_[_0x6bd3('0x31')](db[_0x6bd3('0x2d')][_0x6bd3('0x44')]);_0x1dbd4c['query']=_[_0x6bd3('0x31')](_0x100015['query']);_0x1dbd4c[_0x6bd3('0x39')]=_[_0x6bd3('0x33')](_0x1dbd4c[_0x6bd3('0x30')],_0x1dbd4c[_0x6bd3('0x32')]);_0xe2ca49[_0x6bd3('0x34')]=_[_0x6bd3('0x33')](_0x1dbd4c[_0x6bd3('0x30')],qs[_0x6bd3('0x45')](_0x100015[_0x6bd3('0x32')][_0x6bd3('0x45')]));_0xe2ca49['attributes']=_0xe2ca49[_0x6bd3('0x34')]['length']?_0xe2ca49[_0x6bd3('0x34')]:_0x1dbd4c[_0x6bd3('0x30')];if(_0x100015['query'][_0x6bd3('0x40')]){_0xe2ca49['include']=[{'all':!![]}];}_0xe2ca49=_[_0x6bd3('0x3c')]({},_0xe2ca49,_0x100015[_0x6bd3('0x3f')]);return db[_0x6bd3('0x2d')]['find'](_0xe2ca49)[_0x6bd3('0x26')](handleEntityNotFound(_0x397dc8,null))[_0x6bd3('0x26')](respondWithResult(_0x397dc8,null))[_0x6bd3('0x42')](handleError(_0x397dc8,null));};exports[_0x6bd3('0x46')]=function(_0xfd7b2,_0xba735e){return db['WhatsappApplication'][_0x6bd3('0x46')](_0xfd7b2[_0x6bd3('0x47')],{})[_0x6bd3('0x26')](respondWithResult(_0xba735e,0xc9))['catch'](handleError(_0xba735e,null));};exports[_0x6bd3('0x24')]=function(_0x59cee9,_0x52dfb1){if(_0x59cee9[_0x6bd3('0x47')]['id']){delete _0x59cee9[_0x6bd3('0x47')]['id'];}return db['WhatsappApplication'][_0x6bd3('0x48')]({'where':{'id':_0x59cee9['params']['id']}})[_0x6bd3('0x26')](handleEntityNotFound(_0x52dfb1,null))[_0x6bd3('0x26')](saveUpdates(_0x59cee9[_0x6bd3('0x47')],null))[_0x6bd3('0x26')](respondWithResult(_0x52dfb1,null))[_0x6bd3('0x42')](handleError(_0x52dfb1,null));};exports['destroy']=function(_0x4e4b52,_0x417e4f){return db['WhatsappApplication'][_0x6bd3('0x48')]({'where':{'id':_0x4e4b52[_0x6bd3('0x43')]['id']}})[_0x6bd3('0x26')](handleEntityNotFound(_0x417e4f,null))[_0x6bd3('0x26')](removeEntity(_0x417e4f,null))['catch'](handleError(_0x417e4f,null));}; \ No newline at end of file +var _0xd509=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','find','create','body','params','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x39b7f3,_0x50c53e){var _0xb34cbd=function(_0x638922){while(--_0x638922){_0x39b7f3['push'](_0x39b7f3['shift']());}};_0xb34cbd(++_0x50c53e);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9d50('0x0'));var jsonpatch=require(_0x9d50('0x1'));var rp=require(_0x9d50('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9d50('0x3'));var util=require(_0x9d50('0x4'));var path=require('path');var sox=require(_0x9d50('0x5'));var csv=require(_0x9d50('0x6'));var ejs=require(_0x9d50('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d50('0x8'));var squel=require('squel');var crypto=require(_0x9d50('0x9'));var jsforce=require(_0x9d50('0xa'));var deskjs=require(_0x9d50('0xb'));var toCsv=require(_0x9d50('0x6'));var querystring=require(_0x9d50('0xc'));var Papa=require('papaparse');var Redis=require(_0x9d50('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9d50('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d50('0xf'))(_0x9d50('0x10'));var utils=require(_0x9d50('0x11'));var config=require(_0x9d50('0x12'));var licenseUtil=require(_0x9d50('0x13'));var db=require(_0x9d50('0x14'))['db'];function respondWithStatusCode(_0x3bc884,_0x5c1d1b){_0x5c1d1b=_0x5c1d1b||0xcc;return function(_0x1eb11e){if(_0x1eb11e){return _0x3bc884['sendStatus'](_0x5c1d1b);}return _0x3bc884[_0x9d50('0x15')](_0x5c1d1b)[_0x9d50('0x16')]();};}function respondWithResult(_0x1fcdd7,_0x2fd96b){_0x2fd96b=_0x2fd96b||0xc8;return function(_0x36a82d){if(_0x36a82d){return _0x1fcdd7[_0x9d50('0x15')](_0x2fd96b)[_0x9d50('0x17')](_0x36a82d);}};}function respondWithFilteredResult(_0x3c115b,_0x25f253){return function(_0x304b42){if(_0x304b42){var _0x38d651=typeof _0x25f253[_0x9d50('0x18')]==='undefined'&&typeof _0x25f253[_0x9d50('0x19')]===_0x9d50('0x1a');var _0xa326fa=_0x304b42[_0x9d50('0x1b')];var _0x9c4cbd=_0x38d651?0x0:_0x25f253[_0x9d50('0x18')];var _0x437462=_0x38d651?_0x304b42[_0x9d50('0x1b')]:_0x25f253[_0x9d50('0x18')]+_0x25f253[_0x9d50('0x19')];var _0x2965a3;if(_0x437462>=_0xa326fa){_0x437462=_0xa326fa;_0x2965a3=0xc8;}else{_0x2965a3=0xce;}_0x3c115b[_0x9d50('0x15')](_0x2965a3);return _0x3c115b[_0x9d50('0x1c')](_0x9d50('0x1d'),_0x9c4cbd+'-'+_0x437462+'/'+_0xa326fa)[_0x9d50('0x17')](_0x304b42);}return null;};}function patchUpdates(_0x8905d3){return function(_0xdedc47){try{jsonpatch[_0x9d50('0x1e')](_0xdedc47,_0x8905d3,!![]);}catch(_0x40026b){return BPromise[_0x9d50('0x1f')](_0x40026b);}return _0xdedc47[_0x9d50('0x20')]();};}function saveUpdates(_0xfcb55e,_0x3febd6){return function(_0x4a2080){if(_0x4a2080){return _0x4a2080[_0x9d50('0x21')](_0xfcb55e)[_0x9d50('0x22')](function(_0x2a50f7){return _0x2a50f7;});}return null;};}function removeEntity(_0x1adf7d,_0x12ae02){return function(_0x257738){if(_0x257738){return _0x257738[_0x9d50('0x23')]()[_0x9d50('0x22')](function(){_0x1adf7d[_0x9d50('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cf61b,_0x4e0517){return function(_0x5c58e0){if(!_0x5c58e0){_0x2cf61b[_0x9d50('0x24')](0x194);}return _0x5c58e0;};}function handleError(_0xe121d2,_0x31420b){_0x31420b=_0x31420b||0x1f4;return function(_0x210a1b){logger['error'](_0x210a1b[_0x9d50('0x25')]);if(_0x210a1b[_0x9d50('0x26')]){delete _0x210a1b['name'];}_0xe121d2[_0x9d50('0x15')](_0x31420b)['send'](_0x210a1b);};}exports[_0x9d50('0x27')]=function(_0x460420,_0x40f8bd){var _0x5b3642={},_0x3bd762={},_0x515252={'count':0x0,'rows':[]};var _0x1d5a64=_[_0x9d50('0x28')](db[_0x9d50('0x29')][_0x9d50('0x2a')],function(_0x282493){return{'name':_0x282493[_0x9d50('0x2b')],'type':_0x282493[_0x9d50('0x2c')][_0x9d50('0x2d')]};});_0x3bd762[_0x9d50('0x2e')]=_['map'](_0x1d5a64,_0x9d50('0x26'));_0x3bd762['query']=_['keys'](_0x460420[_0x9d50('0x2f')]);_0x3bd762[_0x9d50('0x30')]=_[_0x9d50('0x31')](_0x3bd762['model'],_0x3bd762[_0x9d50('0x2f')]);_0x5b3642[_0x9d50('0x32')]=_[_0x9d50('0x31')](_0x3bd762[_0x9d50('0x2e')],qs[_0x9d50('0x33')](_0x460420[_0x9d50('0x2f')][_0x9d50('0x33')]));_0x5b3642[_0x9d50('0x32')]=_0x5b3642[_0x9d50('0x32')][_0x9d50('0x34')]?_0x5b3642[_0x9d50('0x32')]:_0x3bd762[_0x9d50('0x2e')];if(!_0x460420[_0x9d50('0x2f')][_0x9d50('0x35')](_0x9d50('0x36'))){_0x5b3642['limit']=qs[_0x9d50('0x19')](_0x460420['query'][_0x9d50('0x19')]);_0x5b3642['offset']=qs[_0x9d50('0x18')](_0x460420[_0x9d50('0x2f')][_0x9d50('0x18')]);}_0x5b3642[_0x9d50('0x37')]=qs[_0x9d50('0x38')](_0x460420['query'][_0x9d50('0x38')]);_0x5b3642[_0x9d50('0x39')]=qs[_0x9d50('0x30')](_[_0x9d50('0x3a')](_0x460420[_0x9d50('0x2f')],_0x3bd762[_0x9d50('0x30')]),_0x1d5a64);if(_0x460420[_0x9d50('0x2f')][_0x9d50('0x3b')]){_0x5b3642['where']=_[_0x9d50('0x3c')](_0x5b3642['where'],{'$or':_[_0x9d50('0x28')](_0x1d5a64,function(_0x5c32fb){if(_0x5c32fb[_0x9d50('0x2c')]!==_0x9d50('0x3d')){var _0x2d1b20={};_0x2d1b20[_0x5c32fb[_0x9d50('0x26')]]={'$like':'%'+_0x460420['query']['filter']+'%'};return _0x2d1b20;}})});}_0x5b3642=_[_0x9d50('0x3c')]({},_0x5b3642,_0x460420[_0x9d50('0x3e')]);var _0x365700={'where':_0x5b3642[_0x9d50('0x39')]};return db[_0x9d50('0x29')][_0x9d50('0x1b')](_0x365700)[_0x9d50('0x22')](function(_0x2a7aa6){_0x515252[_0x9d50('0x1b')]=_0x2a7aa6;if(_0x460420[_0x9d50('0x2f')][_0x9d50('0x3f')]){_0x5b3642['include']=[{'all':!![]}];}return db[_0x9d50('0x29')][_0x9d50('0x40')](_0x5b3642);})['then'](function(_0x14e4a7){_0x515252[_0x9d50('0x41')]=_0x14e4a7;return _0x515252;})[_0x9d50('0x22')](respondWithFilteredResult(_0x40f8bd,_0x5b3642))[_0x9d50('0x42')](handleError(_0x40f8bd,null));};exports[_0x9d50('0x43')]=function(_0x1bfaeb,_0x3bea37){var _0x5340b2={'raw':!![],'where':{'id':_0x1bfaeb['params']['id']}},_0x47d09f={};_0x47d09f[_0x9d50('0x2e')]=_[_0x9d50('0x44')](db[_0x9d50('0x29')][_0x9d50('0x2a')]);_0x47d09f[_0x9d50('0x2f')]=_['keys'](_0x1bfaeb['query']);_0x47d09f[_0x9d50('0x30')]=_[_0x9d50('0x31')](_0x47d09f[_0x9d50('0x2e')],_0x47d09f[_0x9d50('0x2f')]);_0x5340b2[_0x9d50('0x32')]=_[_0x9d50('0x31')](_0x47d09f[_0x9d50('0x2e')],qs[_0x9d50('0x33')](_0x1bfaeb[_0x9d50('0x2f')][_0x9d50('0x33')]));_0x5340b2['attributes']=_0x5340b2[_0x9d50('0x32')][_0x9d50('0x34')]?_0x5340b2[_0x9d50('0x32')]:_0x47d09f[_0x9d50('0x2e')];if(_0x1bfaeb[_0x9d50('0x2f')]['includeAll']){_0x5340b2['include']=[{'all':!![]}];}_0x5340b2=_[_0x9d50('0x3c')]({},_0x5340b2,_0x1bfaeb[_0x9d50('0x3e')]);return db[_0x9d50('0x29')][_0x9d50('0x45')](_0x5340b2)[_0x9d50('0x22')](handleEntityNotFound(_0x3bea37,null))['then'](respondWithResult(_0x3bea37,null))[_0x9d50('0x42')](handleError(_0x3bea37,null));};exports[_0x9d50('0x46')]=function(_0x4ed8dd,_0xe98a58){return db[_0x9d50('0x29')]['create'](_0x4ed8dd['body'],{})[_0x9d50('0x22')](respondWithResult(_0xe98a58,0xc9))[_0x9d50('0x42')](handleError(_0xe98a58,null));};exports[_0x9d50('0x21')]=function(_0x441fd5,_0x491876){if(_0x441fd5['body']['id']){delete _0x441fd5[_0x9d50('0x47')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x441fd5[_0x9d50('0x48')]['id']}})[_0x9d50('0x22')](handleEntityNotFound(_0x491876,null))['then'](saveUpdates(_0x441fd5['body'],null))[_0x9d50('0x22')](respondWithResult(_0x491876,null))[_0x9d50('0x42')](handleError(_0x491876,null));};exports[_0x9d50('0x23')]=function(_0x4fd62d,_0x15131a){return db[_0x9d50('0x29')]['find']({'where':{'id':_0x4fd62d[_0x9d50('0x48')]['id']}})['then'](handleEntityNotFound(_0x15131a,null))[_0x9d50('0x22')](removeEntity(_0x15131a,null))['catch'](handleError(_0x15131a,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 705435e..28bd9f0 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe644=['bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1cf760,_0x4306d8){var _0x2b4bc9=function(_0x2a8ef6){while(--_0x2a8ef6){_0x1cf760['push'](_0x1cf760['shift']());}};_0x2b4bc9(++_0x4306d8);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var logger=require(_0x4e64('0x2'))(_0x4e64('0x3'));var moment=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e64('0x6'));var rimraf=require(_0x4e64('0x7'));var config=require(_0x4e64('0x8'));var attributes=require(_0x4e64('0x9'));module[_0x4e64('0xa')]=function(_0x13fa90,_0x55c23b){return _0x13fa90[_0x4e64('0xb')](_0x4e64('0xc'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4e64('0xd')});}; \ No newline at end of file +var _0x495e=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','utf8mb4_unicode_ci','lodash','api'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0x495e,0xfb));var _0xe495=function(_0x291aaf,_0x4c6d8d){_0x291aaf=_0x291aaf-0x0;var _0x5571e6=_0x495e[_0x291aaf];return _0x5571e6;};'use strict';var _=require(_0xe495('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe495('0x1'));var moment=require(_0xe495('0x2'));var BPromise=require(_0xe495('0x3'));var rp=require(_0xe495('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe495('0x5'));var config=require(_0xe495('0x6'));var attributes=require(_0xe495('0x7'));module[_0xe495('0x8')]=function(_0x130db3,_0x467a69){return _0x130db3[_0xe495('0x9')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe495('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 54bc7b5..583293f 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c12=['../../config/environment','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0x5c12,0x188));var _0x25c1=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5c12[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});} \ No newline at end of file +var _0x5c12=['../../config/environment','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x5c12,0x188));var _0x25c1=function(_0x216799,_0x44b817){_0x216799=_0x216799-0x0;var _0x3661c3=_0x5c12[_0x216799];return _0x3661c3;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 5788038..1704230 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1db9=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id/messages','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x1db9,0x176));var _0x91db=function(_0x3d7b94,_0x574049){_0x3d7b94=_0x3d7b94-0x0;var _0x9d04e6=_0x1db9[_0x3d7b94];return _0x9d04e6;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x91db('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91db('0x8')](_0x91db('0x9'),auth[_0x91db('0xa')](),controller[_0x91db('0xb')]);router[_0x91db('0x8')]('/:id',auth[_0x91db('0xa')](),controller['show']);router[_0x91db('0x8')](_0x91db('0xc'),auth[_0x91db('0xa')](),controller['getMessages']);router[_0x91db('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x91db('0xd')]('/',auth[_0x91db('0xa')](),controller['create']);router['post'](_0x91db('0xc'),auth[_0x91db('0xa')](),controller[_0x91db('0xe')]);router[_0x91db('0xd')](_0x91db('0xf'),auth['isAuthenticated'](),interaction[_0x91db('0x10')](_0x91db('0x11'),_0x91db('0x12')),controller[_0x91db('0x13')]);router[_0x91db('0x14')](_0x91db('0x15'),auth[_0x91db('0xa')](),interaction[_0x91db('0x10')](_0x91db('0x11'),_0x91db('0x16')),controller[_0x91db('0x17')]);router[_0x91db('0x18')]('/:id',auth[_0x91db('0xa')](),interaction[_0x91db('0x10')](_0x91db('0x11'),_0x91db('0x19')),controller[_0x91db('0x1a')]);router[_0x91db('0x18')]('/:id/tags',auth['isAuthenticated'](),controller[_0x91db('0x1b')]);module[_0x91db('0x1c')]=router; \ No newline at end of file +var _0x9c5a=['isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','describe'];(function(_0x57042f,_0x1fdfd4){var _0x40a5ff=function(_0x149545){while(--_0x149545){_0x57042f['push'](_0x57042f['shift']());}};_0x40a5ff(++_0x1fdfd4);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x317307,_0x25c124){_0x317307=_0x317307-0x0;var _0x23b29a=_0x9c5a[_0x317307];return _0x23b29a;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./whatsappInteraction.controller');router[_0xa9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa9c5('0xa')]);router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xc')]);router['get'](_0xa9c5('0xd'),auth[_0xa9c5('0xb')](),controller['getMessages']);router['get'](_0xa9c5('0xe'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xf')]);router[_0xa9c5('0x10')]('/',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x11')]);router[_0xa9c5('0x10')](_0xa9c5('0xd'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x12')]);router['post'](_0xa9c5('0x13'),auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')](_0xa9c5('0x15'),_0xa9c5('0x16')),controller[_0xa9c5('0x17')]);router[_0xa9c5('0x18')](_0xa9c5('0x19'),auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')]('whatsapp',_0xa9c5('0x1a')),controller[_0xa9c5('0x1b')]);router[_0xa9c5('0x1c')]('/:id',auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')](_0xa9c5('0x15'),_0xa9c5('0x1d')),controller[_0xa9c5('0x1e')]);router[_0xa9c5('0x1c')](_0xa9c5('0x13'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x1f')]);module[_0xa9c5('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 3f2ae8f..30fe0d8 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4672=['out','ENUM','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x1c47dd,_0xf3411){var _0x212eff=function(_0x533089){while(--_0x533089){_0x1c47dd['push'](_0x1c47dd['shift']());}};_0x212eff(++_0xf3411);}(_0x4672,0x18a));var _0x2467=function(_0x511d5c,_0x4d44a0){_0x511d5c=_0x511d5c-0x0;var _0x128d3b=_0x4672[_0x511d5c];return _0x128d3b;};'use strict';var Sequelize=require(_0x2467('0x0'));var moment=require('moment');module[_0x2467('0x1')]={'closed':{'type':Sequelize[_0x2467('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2467('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2467('0x3')]},'note':{'type':Sequelize[_0x2467('0x3')]},'phone':{'type':Sequelize[_0x2467('0x3')]},'read1stAt':{'type':Sequelize[_0x2467('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x2467('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2467('0x6')]('in',_0x2467('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2467('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xd9ef=['ENUM','out','sequelize','moment','BOOLEAN','STRING','DATE'];(function(_0x43df9b,_0x36ccd2){var _0xdc5a1=function(_0x575453){while(--_0x575453){_0x43df9b['push'](_0x43df9b['shift']());}};_0xdc5a1(++_0x36ccd2);}(_0xd9ef,0x95));var _0xfd9e=function(_0x40bb34,_0x1fdb03){_0x40bb34=_0x40bb34-0x0;var _0x5d50b5=_0xd9ef[_0x40bb34];return _0x5d50b5;};'use strict';var Sequelize=require(_0xfd9e('0x0'));var moment=require(_0xfd9e('0x1'));module['exports']={'closed':{'type':Sequelize[_0xfd9e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfd9e('0x3')]},'note':{'type':Sequelize[_0xfd9e('0x3')]},'phone':{'type':Sequelize[_0xfd9e('0x3')]},'read1stAt':{'type':Sequelize[_0xfd9e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xfd9e('0x5')]('in',_0xfd9e('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfd9e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xfd9e('0x5')]('in',_0xfd9e('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfd9e('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 8cd4ab0..07ca162 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3620=['getMessages','findOne','rawAttributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','WhatsappInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','color','emit','whatsappInteractionTags:save','removeTags','download','toString','root','server','files','join','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Whatsapp','Account','Owner','N.A.','createdAt','closed','closedAt','disposition','basename','existsSync','createWriteStream','out','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','then','destroy','name','send','index','map','fieldName','key','getOptions','findAll','whatsapp','query','user','show','model','keys','WhatsappInteraction','attributes','intersection','includeAll','include','find','catch','create','update','body','params','describe','addMessage','WhatsappMessage','ids','omit'];(function(_0x30c99a,_0x1a4548){var _0x2e4b4a=function(_0x5e5751){while(--_0x5e5751){_0x30c99a['push'](_0x30c99a['shift']());}};_0x2e4b4a(++_0x1a4548);}(_0x3620,0x1c8));var _0x0362=function(_0xbcaa20,_0x4118ce){_0xbcaa20=_0xbcaa20-0x0;var _0x4faf04=_0x3620[_0xbcaa20];return _0x4faf04;};'use strict';var rimraf=require(_0x0362('0x0'));var zipdir=require(_0x0362('0x1'));var moment=require(_0x0362('0x2'));var BPromise=require(_0x0362('0x3'));var util=require(_0x0362('0x4'));var path=require('path');var ejs=require(_0x0362('0x5'));var fs=require('fs');var _=require(_0x0362('0x6'));var Redis=require(_0x0362('0x7'));var interaction=require(_0x0362('0x8'));var qs=require(_0x0362('0x9'));var pdf=require(_0x0362('0xa'));var logger=require('../../config/logger')(_0x0362('0xb'));var config=require(_0x0362('0xc'));var db=require(_0x0362('0xd'))['db'];config[_0x0362('0xe')]=_[_0x0362('0xf')](config[_0x0362('0xe')],{'host':_0x0362('0x10'),'port':0x18eb});var socket=require(_0x0362('0x11'))(new Redis(config[_0x0362('0xe')]));require(_0x0362('0x12'))['register'](socket);function respondWithStatusCode(_0x26f217,_0x4584a3){_0x4584a3=_0x4584a3||0xcc;return function(_0x4b2f58){if(_0x4b2f58){return _0x26f217[_0x0362('0x13')](_0x4584a3);}return _0x26f217[_0x0362('0x14')](_0x4584a3)[_0x0362('0x15')]();};}function respondWithResult(_0x2a89b9,_0x80fb25){_0x80fb25=_0x80fb25||0xc8;return function(_0xbec170){if(_0xbec170){return _0x2a89b9[_0x0362('0x14')](_0x80fb25)[_0x0362('0x16')](_0xbec170);}};}function respondWithFilteredResult(_0x5d8738,_0x47c1ba){return function(_0xe2acd){if(_0xe2acd){var _0x4d3370=typeof _0x47c1ba[_0x0362('0x17')]===_0x0362('0x18')&&typeof _0x47c1ba[_0x0362('0x19')]===_0x0362('0x18');var _0x945667=_0xe2acd[_0x0362('0x1a')];var _0x22c1a6=_0x4d3370?0x0:_0x47c1ba['offset'];var _0x563daa=_0x4d3370?_0xe2acd[_0x0362('0x1a')]:_0x47c1ba[_0x0362('0x17')]+_0x47c1ba[_0x0362('0x19')];var _0x124d77;if(_0x563daa>=_0x945667){_0x563daa=_0x945667;_0x124d77=0xc8;}else{_0x124d77=0xce;}_0x5d8738['status'](_0x124d77);return _0x5d8738[_0x0362('0x1b')]('Content-Range',_0x22c1a6+'-'+_0x563daa+'/'+_0x945667)[_0x0362('0x16')](_0xe2acd);}return null;};}function saveUpdates(_0x4971ca){return function(_0x5e6403){if(_0x5e6403){return _0x5e6403['update'](_0x4971ca)[_0x0362('0x1c')](function(_0x7cf22){return _0x7cf22;});}return null;};}function removeEntity(_0x5620bf){return function(_0x56e227){if(_0x56e227){return _0x56e227[_0x0362('0x1d')]()['then'](function(){_0x5620bf['status'](0xcc)[_0x0362('0x15')]();});}};}function handleEntityNotFound(_0x5921b0){return function(_0x3ffca2){if(!_0x3ffca2){_0x5921b0['sendStatus'](0x194);}return _0x3ffca2;};}function handleError(_0x2f1397,_0x38f9e7){_0x38f9e7=_0x38f9e7||0x1f4;return function(_0x238d01){logger['error'](_0x238d01['stack']);if(_0x238d01[_0x0362('0x1e')]){delete _0x238d01[_0x0362('0x1e')];}_0x2f1397['status'](_0x38f9e7)[_0x0362('0x1f')](_0x238d01);};}exports[_0x0362('0x20')]=function(_0x59ea0b,_0x57f3ba){var _0x34994b={};var _0x7893b3=_[_0x0362('0x21')](db['WhatsappInteraction']['rawAttributes'],function(_0x20776e){return{'name':_0x20776e[_0x0362('0x22')],'type':_0x20776e['type'][_0x0362('0x23')]};});_0x34994b=qs[_0x0362('0x24')](_0x7893b3,_0x59ea0b);return interaction[_0x0362('0x25')](_0x0362('0x26'),_0x59ea0b[_0x0362('0x27')],_0x59ea0b[_0x0362('0x28')],_0x34994b,_0x7893b3)[_0x0362('0x1c')](respondWithFilteredResult(_0x57f3ba,_0x34994b))['catch'](handleError(_0x57f3ba,null));};exports[_0x0362('0x29')]=function(_0x36e918,_0x4a7df0){var _0xdf5fd2={'raw':![],'where':{'id':_0x36e918['params']['id']}},_0x45b38e={};_0x45b38e[_0x0362('0x2a')]=_[_0x0362('0x2b')](db[_0x0362('0x2c')]['rawAttributes']);_0x45b38e[_0x0362('0x27')]=_[_0x0362('0x2b')](_0x36e918[_0x0362('0x27')]);_0x45b38e['filters']=_['intersection'](_0x45b38e[_0x0362('0x2a')],_0x45b38e[_0x0362('0x27')]);_0xdf5fd2[_0x0362('0x2d')]=_[_0x0362('0x2e')](_0x45b38e[_0x0362('0x2a')],qs['fields'](_0x36e918[_0x0362('0x27')]['fields']));_0xdf5fd2[_0x0362('0x2d')]=_0xdf5fd2[_0x0362('0x2d')]['length']?_0xdf5fd2[_0x0362('0x2d')]:_0x45b38e['model'];if(_0x36e918[_0x0362('0x27')][_0x0362('0x2f')]){_0xdf5fd2[_0x0362('0x30')]=[{'all':!![]}];}_0xdf5fd2=_['merge']({},_0xdf5fd2,_0x36e918['options']);return db[_0x0362('0x2c')][_0x0362('0x31')](_0xdf5fd2)[_0x0362('0x1c')](handleEntityNotFound(_0x4a7df0,null))['then'](respondWithResult(_0x4a7df0,null))[_0x0362('0x32')](handleError(_0x4a7df0,null));};exports['create']=function(_0x107fc4,_0x450213){return db['WhatsappInteraction'][_0x0362('0x33')](_0x107fc4['body'],{})[_0x0362('0x1c')](respondWithResult(_0x450213,0xc9))['catch'](handleError(_0x450213,null));};exports[_0x0362('0x34')]=function(_0x293418,_0x1ef0c3){if(_0x293418[_0x0362('0x35')]['id']){delete _0x293418[_0x0362('0x35')]['id'];}return db[_0x0362('0x2c')][_0x0362('0x31')]({'where':{'id':_0x293418[_0x0362('0x36')]['id']}})[_0x0362('0x1c')](handleEntityNotFound(_0x1ef0c3,null))[_0x0362('0x1c')](saveUpdates(_0x293418['body'],null))['then'](respondWithResult(_0x1ef0c3,null))[_0x0362('0x32')](handleError(_0x1ef0c3,null));};exports['destroy']=function(_0x5dc185,_0x98c54f){return db[_0x0362('0x2c')][_0x0362('0x31')]({'where':{'id':_0x5dc185['params']['id']}})['then'](handleEntityNotFound(_0x98c54f,null))[_0x0362('0x1c')](removeEntity(_0x98c54f,null))['catch'](handleError(_0x98c54f,null));};exports[_0x0362('0x37')]=function(_0x55140e,_0x4ba48b){return db[_0x0362('0x2c')][_0x0362('0x37')]()['then'](respondWithResult(_0x4ba48b,null))[_0x0362('0x32')](handleError(_0x4ba48b,null));};exports[_0x0362('0x38')]=function(_0x20412f,_0x8b9444){return db[_0x0362('0x39')][_0x0362('0x31')]({'where':{'id':_0x20412f['params']['id']}})[_0x0362('0x1c')](handleEntityNotFound(_0x8b9444,null))['then'](function(_0x3f3264){if(_0x3f3264){return _0x3f3264[_0x0362('0x38')](_0x20412f[_0x0362('0x35')][_0x0362('0x3a')],_[_0x0362('0x3b')](_0x20412f[_0x0362('0x35')],[_0x0362('0x3a'),'id'])||{});}})[_0x0362('0x1c')](respondWithResult(_0x8b9444,null))[_0x0362('0x32')](handleError(_0x8b9444,null));};exports[_0x0362('0x3c')]=function(_0x4dce9e,_0x36bdc1){var _0x162aad={'raw':![],'where':{}};var _0x3edb49={};var _0xdaeb81={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x0362('0x3d')]({'where':{'id':_0x4dce9e[_0x0362('0x36')]['id']}})[_0x0362('0x1c')](handleEntityNotFound(_0x36bdc1,null))[_0x0362('0x1c')](function(_0x593270){if(_0x593270){_0x3edb49[_0x0362('0x2a')]=_[_0x0362('0x2b')](db['WhatsappMessage'][_0x0362('0x3e')]);_0x3edb49[_0x0362('0x27')]=_[_0x0362('0x2b')](_0x4dce9e['query']);_0x3edb49['filters']=_['intersection'](_0x3edb49[_0x0362('0x2a')],_0x3edb49[_0x0362('0x27')]);_0x162aad[_0x0362('0x2d')]=_[_0x0362('0x2e')](_0x3edb49[_0x0362('0x2a')],qs[_0x0362('0x3f')](_0x4dce9e[_0x0362('0x27')][_0x0362('0x3f')]));_0x162aad['attributes']=_0x162aad['attributes'][_0x0362('0x40')]?_0x162aad[_0x0362('0x2d')]:_0x3edb49[_0x0362('0x2a')];if(!_0x4dce9e[_0x0362('0x27')][_0x0362('0x41')](_0x0362('0x42'))){_0x162aad[_0x0362('0x19')]=qs['limit'](_0x4dce9e[_0x0362('0x27')][_0x0362('0x19')]);_0x162aad[_0x0362('0x17')]=qs[_0x0362('0x17')](_0x4dce9e[_0x0362('0x27')]['offset']);}_0x162aad[_0x0362('0x43')]=qs[_0x0362('0x44')](_0x4dce9e['query'][_0x0362('0x44')]);_0x162aad[_0x0362('0x45')]=qs[_0x0362('0x46')](_[_0x0362('0x47')](_0x4dce9e[_0x0362('0x27')],_0x3edb49[_0x0362('0x46')]));_0x162aad['where'][_0x0362('0x48')]=_0x593270['id'];if(_0x4dce9e[_0x0362('0x27')][_0x0362('0x49')]){_0x162aad[_0x0362('0x45')]=_[_0x0362('0x4a')](_0x162aad['where'],{'$or':_[_0x0362('0x21')](_0x162aad[_0x0362('0x2d')],function(_0x1306f4){var _0x4c58f9={};_0x4c58f9[_0x1306f4]={'$like':'%'+_0x4dce9e[_0x0362('0x27')][_0x0362('0x49')]+'%'};return _0x4c58f9;})});}if(_0x4dce9e['query']['$gte']){var _0x4ef5a7=_0x4dce9e['query'][_0x0362('0x4b')][_0x0362('0x4c')](',');var _0x1736d6={};_0x1736d6[_0x4ef5a7[0x0]]={'$gte':moment(_0x4ef5a7[0x1])[_0x0362('0x4d')](_0x0362('0x4e'))};_0x162aad[_0x0362('0x45')]=_['merge'](_0x162aad[_0x0362('0x45')],_0x1736d6);}_0x162aad=_[_0x0362('0x4a')]({},_0x162aad,_0x4dce9e[_0x0362('0x4f')]);return db[_0x0362('0x39')][_0x0362('0x1a')]({'where':_0x162aad[_0x0362('0x45')]})[_0x0362('0x1c')](function(_0x1042c4){_0xdaeb81[_0x0362('0x1a')]=_0x1042c4;if(_0x4dce9e[_0x0362('0x27')][_0x0362('0x2f')]){_0x162aad[_0x0362('0x30')]=[{'all':!![]}];}return db[_0x0362('0x39')][_0x0362('0x25')](_0x162aad);})[_0x0362('0x1c')](function(_0x506e05){_0xdaeb81[_0x0362('0x50')]=_0x506e05;return _0xdaeb81;});}})[_0x0362('0x1c')](respondWithFilteredResult(_0x36bdc1,_0x162aad))[_0x0362('0x32')](handleError(_0x36bdc1,null));};exports[_0x0362('0x51')]=function(_0x5e55a2,_0x896e4b){return db['WhatsappInteraction'][_0x0362('0x31')]({'where':{'id':_0x5e55a2[_0x0362('0x36')]['id']}})['then'](handleEntityNotFound(_0x896e4b,null))['then'](function(_0x31175d){if(_0x31175d){return _0x31175d[_0x0362('0x52')](_0x5e55a2['body']['ids'],_[_0x0362('0x3b')](_0x5e55a2['body'],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x0362('0x53')],'where':{'id':_0x5e55a2[_0x0362('0x35')]['ids']}});})['then'](function(_0x4ed9a4){socket[_0x0362('0x54')](_0x0362('0x55'),{'id':Number(_0x5e55a2[_0x0362('0x36')]['id']),'tags':_0x4ed9a4||[]});return{'id':Number(_0x5e55a2['params']['id']),'tags':_0x4ed9a4||[]};});}})[_0x0362('0x1c')](respondWithResult(_0x896e4b,null))[_0x0362('0x32')](handleError(_0x896e4b,null));};exports[_0x0362('0x56')]=function(_0x57e5de,_0x3ec381){return db[_0x0362('0x2c')][_0x0362('0x31')]({'where':{'id':_0x57e5de[_0x0362('0x36')]['id']}})[_0x0362('0x1c')](handleEntityNotFound(_0x3ec381,null))[_0x0362('0x1c')](function(_0x2005e5){if(_0x2005e5){return _0x2005e5['removeTags'](_0x57e5de[_0x0362('0x27')]['ids']);}})[_0x0362('0x1c')](respondWithStatusCode(_0x3ec381,null))['catch'](handleError(_0x3ec381,null));};exports[_0x0362('0x57')]=function(_0x53b7e1,_0x4d5e43){var _0xdf5bdb=moment()['unix']()[_0x0362('0x58')]();var _0x549b73=path['join'](config[_0x0362('0x59')],_0x0362('0x5a'),_0x0362('0x5b'),'tmp');var _0xb75442=path[_0x0362('0x5c')](config[_0x0362('0x59')],_0x0362('0x5a'),_0x0362('0x5b'),_0x0362('0x5d'));var _0x39c768=path[_0x0362('0x5c')](_0x549b73,_0xdf5bdb);var _0x476011=util[_0x0362('0x4d')](_0x0362('0x5e'),_0x53b7e1[_0x0362('0x36')]['id'],_0xdf5bdb);var _0xe2c89d=path[_0x0362('0x5c')](_0x549b73,_0x476011);var _0x2ab353=[];_0x2ab353[_0x0362('0x5f')]({'model':db[_0x0362('0x60')],'as':_0x0362('0x60'),'attributes':['id',_0x0362('0x61')],'raw':!![]});_0x2ab353['push']({'model':db[_0x0362('0x62')],'as':_0x0362('0x63'),'attributes':['id',_0x0362('0x64'),_0x0362('0x65')],'raw':!![]});if(_0x53b7e1[_0x0362('0x27')][_0x0362('0x5d')]){_0x2ab353['push']({'model':db['Attachment'],'as':_0x0362('0x66'),'raw':!![]});}var _0x5f3ec8=[{'model':db['WhatsappMessage'],'as':_0x0362('0x67'),'attributes':['id','body','createdAt',_0x0362('0x68'),_0x0362('0x69'),_0x0362('0x6a')],'include':_0x2ab353}];_0x5f3ec8[_0x0362('0x5f')]({'model':db[_0x0362('0x6b')],'as':'Account','attributes':['id',_0x0362('0x1e')]});_0x5f3ec8[_0x0362('0x5f')]({'model':db[_0x0362('0x60')],'as':'Owner','attributes':['id',_0x0362('0x61')]});return db[_0x0362('0x2c')]['find']({'where':{'id':_0x53b7e1['params']['id']},'include':_0x5f3ec8})[_0x0362('0x1c')](handleEntityNotFound(_0x4d5e43,null))[_0x0362('0x1c')](function(_0x13d007){if(_0x13d007){var _0x212c78=_0x13d007['get']({'plain':!![]});fs['mkdirSync'](_0x39c768);var _0x2a2e76={'channel':_0x0362('0x6c'),'account':_0x212c78[_0x0362('0x6d')][_0x0362('0x1e')],'agent':_0x212c78[_0x0362('0x6e')]?_0x212c78[_0x0362('0x6e')][_0x0362('0x61')]:_0x0362('0x6f'),'createdAt':moment(_0x212c78[_0x0362('0x70')])[_0x0362('0x4d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0362('0x58')](),'closedAt':_0x212c78[_0x0362('0x71')]?moment(_0x212c78[_0x0362('0x72')])[_0x0362('0x4d')](_0x0362('0x4e'))[_0x0362('0x58')]():'','disposition':_0x212c78[_0x0362('0x73')],'messages':_(_0x212c78[_0x0362('0x67')])[_0x0362('0x49')]({'secret':![]})['map'](function(_0x35ab71){if(_0x35ab71['Attachment']){var _0x2af680=path[_0x0362('0x5c')](_0xb75442,_0x35ab71[_0x0362('0x66')][_0x0362('0x74')]);if(fs[_0x0362('0x75')](_0x2af680)){fs['createReadStream'](_0x2af680)['pipe'](fs[_0x0362('0x76')](path[_0x0362('0x5c')](_0x39c768,_0x35ab71[_0x0362('0x66')]['basename'])));}}return{'date':moment(_0x35ab71['createdAt'])[_0x0362('0x4d')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x35ab71[_0x0362('0x68')]===_0x0362('0x77')?_0x35ab71['User']?_0x35ab71[_0x0362('0x60')][_0x0362('0x61')]:'System':_0x35ab71[_0x0362('0x63')]['firstName']+(_0x35ab71['Contact']['lastName']?'\x20'+_0x35ab71['Contact']['lastName']:''),'body':_0x35ab71[_0x0362('0x66')]?_0x35ab71[_0x0362('0x66')][_0x0362('0x74')]:_0x35ab71[_0x0362('0x35')],'direction':_0x35ab71['direction']==='out'?'A':'C','secret':_0x35ab71['secret'],'read':_0x35ab71[_0x0362('0x6a')],'attachment':_0x35ab71[_0x0362('0x66')]};})[_0x0362('0x78')]()};return ejs[_0x0362('0x79')](path[_0x0362('0x5c')](config[_0x0362('0x59')],'server',_0x0362('0x7a'),_0x0362('0x7b')),{'interaction':_0x2a2e76})[_0x0362('0x1c')](function(_0x4b57b9){var _0x38880e=path[_0x0362('0x5c')](_0x39c768,_0x0362('0x7c')+_0x212c78['id']+'-'+_0xdf5bdb+'.pdf');var _0x23b62c={'path':_0x38880e,'channel':'Whatsapp','interactionId':_0x212c78['id']};return pdf[_0x0362('0x7d')](_0x4b57b9,_0x23b62c);})[_0x0362('0x1c')](function(){return new BPromise(function(_0x3ddf17,_0x69711){zipdir(_0x39c768,{'saveTo':_0xe2c89d},function(_0x417399,_0x199415){if(_0x417399)return _0x69711(_0x417399);return _0x3ddf17(_0x199415);});})[_0x0362('0x1c')](function(){return new BPromise(function(_0xbc3e8f,_0x2e3f56){rimraf(_0x39c768,function(_0x476ca0){if(_0x476ca0)_0x2e3f56(_0x476ca0);return _0xbc3e8f();});});})[_0x0362('0x1c')](function(){return _0x4d5e43['download'](_0xe2c89d,_0x476011,function(_0x21b100){if(_0x21b100){console[_0x0362('0x7e')](_0x0362('0x7f'),_0x21b100);}else{fs[_0x0362('0x80')](_0xe2c89d);}});});});}else{return _0x4d5e43[_0x0362('0x13')](0xc8);}})[_0x0362('0x32')](handleError(_0x4d5e43,null));}; \ No newline at end of file +var _0xfb07=['WhatsappAccount','Account','Owner','fullname','get','mkdirSync','Whatsapp','N.A.','createdAt','closed','closedAt','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','lastName','read','value','views','transcript-','.pdf','err','unlinkSync','rimraf','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','set','json','update','then','error','stack','name','send','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','user','catch','params','model','keys','query','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','destroy','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','pick','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','where','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','User','push','CmContact','Contact','firstName','Attachment','direction','secret'];(function(_0x5517c0,_0x358609){var _0x33803b=function(_0x513c18){while(--_0x513c18){_0x5517c0['push'](_0x5517c0['shift']());}};_0x33803b(++_0x358609);}(_0xfb07,0x94));var _0x7fb0=function(_0x4ce0f,_0x2926e1){_0x4ce0f=_0x4ce0f-0x0;var _0x522b82=_0xfb07[_0x4ce0f];return _0x522b82;};'use strict';var rimraf=require(_0x7fb0('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x7fb0('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7fb0('0x2'));var Redis=require(_0x7fb0('0x3'));var interaction=require('../../components/interaction/service');var qs=require(_0x7fb0('0x4'));var pdf=require('../../components/export/pdf');var logger=require(_0x7fb0('0x5'))(_0x7fb0('0x6'));var config=require('../../config/environment');var db=require(_0x7fb0('0x7'))['db'];config[_0x7fb0('0x8')]=_[_0x7fb0('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7fb0('0xa'))(new Redis(config[_0x7fb0('0x8')]));require('./whatsappInteraction.socket')[_0x7fb0('0xb')](socket);function respondWithStatusCode(_0x2e2b71,_0x5aa9d0){_0x5aa9d0=_0x5aa9d0||0xcc;return function(_0x5a0fbb){if(_0x5a0fbb){return _0x2e2b71[_0x7fb0('0xc')](_0x5aa9d0);}return _0x2e2b71['status'](_0x5aa9d0)[_0x7fb0('0xd')]();};}function respondWithResult(_0x4850da,_0x4ead2f){_0x4ead2f=_0x4ead2f||0xc8;return function(_0x5e5776){if(_0x5e5776){return _0x4850da[_0x7fb0('0xe')](_0x4ead2f)['json'](_0x5e5776);}};}function respondWithFilteredResult(_0x116628,_0x1cc287){return function(_0x2080e4){if(_0x2080e4){var _0x418c0c=typeof _0x1cc287[_0x7fb0('0xf')]===_0x7fb0('0x10')&&typeof _0x1cc287[_0x7fb0('0x11')]===_0x7fb0('0x10');var _0x12d3ef=_0x2080e4[_0x7fb0('0x12')];var _0x5f414d=_0x418c0c?0x0:_0x1cc287[_0x7fb0('0xf')];var _0x3a8715=_0x418c0c?_0x2080e4['count']:_0x1cc287[_0x7fb0('0xf')]+_0x1cc287['limit'];var _0x107e41;if(_0x3a8715>=_0x12d3ef){_0x3a8715=_0x12d3ef;_0x107e41=0xc8;}else{_0x107e41=0xce;}_0x116628[_0x7fb0('0xe')](_0x107e41);return _0x116628[_0x7fb0('0x13')]('Content-Range',_0x5f414d+'-'+_0x3a8715+'/'+_0x12d3ef)[_0x7fb0('0x14')](_0x2080e4);}return null;};}function saveUpdates(_0x46de43){return function(_0x57635e){if(_0x57635e){return _0x57635e[_0x7fb0('0x15')](_0x46de43)[_0x7fb0('0x16')](function(_0x4cc2e){return _0x4cc2e;});}return null;};}function removeEntity(_0x3203e0){return function(_0x35106c){if(_0x35106c){return _0x35106c['destroy']()[_0x7fb0('0x16')](function(){_0x3203e0[_0x7fb0('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4944f9){return function(_0x54b68e){if(!_0x54b68e){_0x4944f9[_0x7fb0('0xc')](0x194);}return _0x54b68e;};}function handleError(_0x11df9b,_0x5b8feb){_0x5b8feb=_0x5b8feb||0x1f4;return function(_0x3213b7){logger[_0x7fb0('0x17')](_0x3213b7[_0x7fb0('0x18')]);if(_0x3213b7[_0x7fb0('0x19')]){delete _0x3213b7[_0x7fb0('0x19')];}_0x11df9b[_0x7fb0('0xe')](_0x5b8feb)[_0x7fb0('0x1a')](_0x3213b7);};}exports['index']=function(_0x274cb4,_0x51b474){var _0x500cfa={};var _0x15f582=_[_0x7fb0('0x1b')](db[_0x7fb0('0x1c')][_0x7fb0('0x1d')],function(_0x4f4a24){return{'name':_0x4f4a24[_0x7fb0('0x1e')],'type':_0x4f4a24[_0x7fb0('0x1f')]['key']};});_0x500cfa=qs[_0x7fb0('0x20')](_0x15f582,_0x274cb4);return interaction[_0x7fb0('0x21')](_0x7fb0('0x22'),_0x274cb4['query'],_0x274cb4[_0x7fb0('0x23')],_0x500cfa,_0x15f582)[_0x7fb0('0x16')](respondWithFilteredResult(_0x51b474,_0x500cfa))[_0x7fb0('0x24')](handleError(_0x51b474,null));};exports['show']=function(_0x4f1b6,_0xd2e1e9){var _0x5cb5c4={'raw':![],'where':{'id':_0x4f1b6[_0x7fb0('0x25')]['id']}},_0x4a4d86={};_0x4a4d86[_0x7fb0('0x26')]=_[_0x7fb0('0x27')](db['WhatsappInteraction'][_0x7fb0('0x1d')]);_0x4a4d86[_0x7fb0('0x28')]=_[_0x7fb0('0x27')](_0x4f1b6[_0x7fb0('0x28')]);_0x4a4d86[_0x7fb0('0x29')]=_[_0x7fb0('0x2a')](_0x4a4d86[_0x7fb0('0x26')],_0x4a4d86[_0x7fb0('0x28')]);_0x5cb5c4[_0x7fb0('0x2b')]=_['intersection'](_0x4a4d86['model'],qs[_0x7fb0('0x2c')](_0x4f1b6[_0x7fb0('0x28')][_0x7fb0('0x2c')]));_0x5cb5c4[_0x7fb0('0x2b')]=_0x5cb5c4[_0x7fb0('0x2b')]['length']?_0x5cb5c4[_0x7fb0('0x2b')]:_0x4a4d86[_0x7fb0('0x26')];if(_0x4f1b6[_0x7fb0('0x28')][_0x7fb0('0x2d')]){_0x5cb5c4['include']=[{'all':!![]}];}_0x5cb5c4=_[_0x7fb0('0x2e')]({},_0x5cb5c4,_0x4f1b6[_0x7fb0('0x2f')]);return db[_0x7fb0('0x1c')][_0x7fb0('0x30')](_0x5cb5c4)[_0x7fb0('0x16')](handleEntityNotFound(_0xd2e1e9,null))[_0x7fb0('0x16')](respondWithResult(_0xd2e1e9,null))[_0x7fb0('0x24')](handleError(_0xd2e1e9,null));};exports[_0x7fb0('0x31')]=function(_0x5924d1,_0x153bc0){return db['WhatsappInteraction']['create'](_0x5924d1[_0x7fb0('0x32')],{})[_0x7fb0('0x16')](respondWithResult(_0x153bc0,0xc9))[_0x7fb0('0x24')](handleError(_0x153bc0,null));};exports['update']=function(_0x34a12a,_0x46da6f){if(_0x34a12a[_0x7fb0('0x32')]['id']){delete _0x34a12a['body']['id'];}return db[_0x7fb0('0x1c')][_0x7fb0('0x30')]({'where':{'id':_0x34a12a[_0x7fb0('0x25')]['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x46da6f,null))['then'](saveUpdates(_0x34a12a[_0x7fb0('0x32')],null))[_0x7fb0('0x16')](respondWithResult(_0x46da6f,null))[_0x7fb0('0x24')](handleError(_0x46da6f,null));};exports[_0x7fb0('0x33')]=function(_0x5ae25c,_0x3d93cd){return db[_0x7fb0('0x1c')][_0x7fb0('0x30')]({'where':{'id':_0x5ae25c[_0x7fb0('0x25')]['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x3d93cd,null))[_0x7fb0('0x16')](removeEntity(_0x3d93cd,null))[_0x7fb0('0x24')](handleError(_0x3d93cd,null));};exports['describe']=function(_0x167fb3,_0x410817){return db['WhatsappInteraction']['describe']()[_0x7fb0('0x16')](respondWithResult(_0x410817,null))['catch'](handleError(_0x410817,null));};exports[_0x7fb0('0x34')]=function(_0x33836d,_0x5c0e96){return db[_0x7fb0('0x35')][_0x7fb0('0x30')]({'where':{'id':_0x33836d['params']['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x5c0e96,null))[_0x7fb0('0x16')](function(_0x1aef66){if(_0x1aef66){return _0x1aef66[_0x7fb0('0x34')](_0x33836d[_0x7fb0('0x32')][_0x7fb0('0x36')],_[_0x7fb0('0x37')](_0x33836d[_0x7fb0('0x32')],['ids','id'])||{});}})[_0x7fb0('0x16')](respondWithResult(_0x5c0e96,null))[_0x7fb0('0x24')](handleError(_0x5c0e96,null));};exports[_0x7fb0('0x38')]=function(_0x1e4507,_0x1d6068){var _0x3bcadf={'raw':![],'where':{}};var _0x575d48={};var _0x4c2653={'count':0x0,'rows':[]};return db[_0x7fb0('0x1c')][_0x7fb0('0x39')]({'where':{'id':_0x1e4507[_0x7fb0('0x25')]['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x1d6068,null))['then'](function(_0x504614){if(_0x504614){_0x575d48[_0x7fb0('0x26')]=_['keys'](db[_0x7fb0('0x35')]['rawAttributes']);_0x575d48['query']=_[_0x7fb0('0x27')](_0x1e4507[_0x7fb0('0x28')]);_0x575d48['filters']=_[_0x7fb0('0x2a')](_0x575d48[_0x7fb0('0x26')],_0x575d48['query']);_0x3bcadf[_0x7fb0('0x2b')]=_[_0x7fb0('0x2a')](_0x575d48['model'],qs[_0x7fb0('0x2c')](_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x2c')]));_0x3bcadf[_0x7fb0('0x2b')]=_0x3bcadf[_0x7fb0('0x2b')]['length']?_0x3bcadf['attributes']:_0x575d48[_0x7fb0('0x26')];if(!_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x3a')](_0x7fb0('0x3b'))){_0x3bcadf[_0x7fb0('0x11')]=qs[_0x7fb0('0x11')](_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x11')]);_0x3bcadf[_0x7fb0('0xf')]=qs['offset'](_0x1e4507['query'][_0x7fb0('0xf')]);}_0x3bcadf[_0x7fb0('0x3c')]=qs['sort'](_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x3d')]);_0x3bcadf['where']=qs['filters'](_[_0x7fb0('0x3e')](_0x1e4507[_0x7fb0('0x28')],_0x575d48['filters']));_0x3bcadf['where'][_0x7fb0('0x3f')]=_0x504614['id'];if(_0x1e4507['query']['filter']){_0x3bcadf['where']=_['merge'](_0x3bcadf['where'],{'$or':_[_0x7fb0('0x1b')](_0x3bcadf[_0x7fb0('0x2b')],function(_0x5ef552){var _0x2afc81={};_0x2afc81[_0x5ef552]={'$like':'%'+_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x40')]+'%'};return _0x2afc81;})});}if(_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x41')]){var _0x8db6b=_0x1e4507['query']['$gte']['split'](',');var _0x7c8aa6={};_0x7c8aa6[_0x8db6b[0x0]]={'$gte':moment(_0x8db6b[0x1])[_0x7fb0('0x42')](_0x7fb0('0x43'))};_0x3bcadf[_0x7fb0('0x44')]=_['merge'](_0x3bcadf['where'],_0x7c8aa6);}_0x3bcadf=_[_0x7fb0('0x2e')]({},_0x3bcadf,_0x1e4507['options']);return db[_0x7fb0('0x35')]['count']({'where':_0x3bcadf['where']})[_0x7fb0('0x16')](function(_0x224e6c){_0x4c2653[_0x7fb0('0x12')]=_0x224e6c;if(_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x2d')]){_0x3bcadf['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x7fb0('0x21')](_0x3bcadf);})['then'](function(_0x1a8d37){_0x4c2653[_0x7fb0('0x45')]=_0x1a8d37;return _0x4c2653;});}})[_0x7fb0('0x16')](respondWithFilteredResult(_0x1d6068,_0x3bcadf))[_0x7fb0('0x24')](handleError(_0x1d6068,null));};exports[_0x7fb0('0x46')]=function(_0x45d425,_0x4d5d27){return db[_0x7fb0('0x1c')][_0x7fb0('0x30')]({'where':{'id':_0x45d425[_0x7fb0('0x25')]['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x4d5d27,null))['then'](function(_0x548fae){if(_0x548fae){return _0x548fae[_0x7fb0('0x47')](_0x45d425[_0x7fb0('0x32')][_0x7fb0('0x36')],_[_0x7fb0('0x37')](_0x45d425[_0x7fb0('0x32')],[_0x7fb0('0x36'),'id'])||{})[_0x7fb0('0x48')](function(){return db[_0x7fb0('0x49')][_0x7fb0('0x21')]({'attributes':['id',_0x7fb0('0x19'),_0x7fb0('0x4a')],'where':{'id':_0x45d425[_0x7fb0('0x32')]['ids']}});})[_0x7fb0('0x16')](function(_0x2e3902){socket[_0x7fb0('0x4b')]('whatsappInteractionTags:save',{'id':Number(_0x45d425['params']['id']),'tags':_0x2e3902||[]});return{'id':Number(_0x45d425[_0x7fb0('0x25')]['id']),'tags':_0x2e3902||[]};});}})[_0x7fb0('0x16')](respondWithResult(_0x4d5d27,null))[_0x7fb0('0x24')](handleError(_0x4d5d27,null));};exports['removeTags']=function(_0x40bc97,_0x2ab34b){return db[_0x7fb0('0x1c')][_0x7fb0('0x30')]({'where':{'id':_0x40bc97[_0x7fb0('0x25')]['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x2ab34b,null))[_0x7fb0('0x16')](function(_0x57ccf1){if(_0x57ccf1){return _0x57ccf1[_0x7fb0('0x4c')](_0x40bc97[_0x7fb0('0x28')][_0x7fb0('0x36')]);}})[_0x7fb0('0x16')](respondWithStatusCode(_0x2ab34b,null))['catch'](handleError(_0x2ab34b,null));};exports[_0x7fb0('0x4d')]=function(_0x530270,_0x635c41){var _0x164aad=moment()[_0x7fb0('0x4e')]()[_0x7fb0('0x4f')]();var _0xf6cee7=path[_0x7fb0('0x50')](config[_0x7fb0('0x51')],_0x7fb0('0x52'),_0x7fb0('0x53'),_0x7fb0('0x54'));var _0x38ab34=path['join'](config[_0x7fb0('0x51')],'server',_0x7fb0('0x53'),_0x7fb0('0x55'));var _0x597a48=path[_0x7fb0('0x50')](_0xf6cee7,_0x164aad);var _0x5bc104=util['format']('transcript-%d-%s.zip',_0x530270[_0x7fb0('0x25')]['id'],_0x164aad);var _0x1fc96c=path['join'](_0xf6cee7,_0x5bc104);var _0x1503f7=[];_0x1503f7['push']({'model':db['User'],'as':_0x7fb0('0x56'),'attributes':['id','fullname'],'raw':!![]});_0x1503f7[_0x7fb0('0x57')]({'model':db[_0x7fb0('0x58')],'as':_0x7fb0('0x59'),'attributes':['id',_0x7fb0('0x5a'),'lastName'],'raw':!![]});if(_0x530270[_0x7fb0('0x28')]['attachments']){_0x1503f7['push']({'model':db['Attachment'],'as':_0x7fb0('0x5b'),'raw':!![]});}var _0x244a84=[{'model':db[_0x7fb0('0x35')],'as':'Messages','attributes':['id',_0x7fb0('0x32'),'createdAt',_0x7fb0('0x5c'),_0x7fb0('0x5d'),'read'],'include':_0x1503f7}];_0x244a84[_0x7fb0('0x57')]({'model':db[_0x7fb0('0x5e')],'as':_0x7fb0('0x5f'),'attributes':['id','name']});_0x244a84[_0x7fb0('0x57')]({'model':db['User'],'as':_0x7fb0('0x60'),'attributes':['id',_0x7fb0('0x61')]});return db['WhatsappInteraction'][_0x7fb0('0x30')]({'where':{'id':_0x530270['params']['id']},'include':_0x244a84})[_0x7fb0('0x16')](handleEntityNotFound(_0x635c41,null))[_0x7fb0('0x16')](function(_0x2d29a9){if(_0x2d29a9){var _0x2b0049=_0x2d29a9[_0x7fb0('0x62')]({'plain':!![]});fs[_0x7fb0('0x63')](_0x597a48);var _0x1aebf4={'channel':_0x7fb0('0x64'),'account':_0x2b0049[_0x7fb0('0x5f')][_0x7fb0('0x19')],'agent':_0x2b0049[_0x7fb0('0x60')]?_0x2b0049[_0x7fb0('0x60')][_0x7fb0('0x61')]:_0x7fb0('0x65'),'createdAt':moment(_0x2b0049[_0x7fb0('0x66')])['format'](_0x7fb0('0x43'))[_0x7fb0('0x4f')](),'closedAt':_0x2b0049[_0x7fb0('0x67')]?moment(_0x2b0049[_0x7fb0('0x68')])[_0x7fb0('0x42')](_0x7fb0('0x43'))[_0x7fb0('0x4f')]():'','disposition':_0x2b0049['disposition'],'messages':_(_0x2b0049[_0x7fb0('0x69')])[_0x7fb0('0x40')]({'secret':![]})[_0x7fb0('0x1b')](function(_0x296d01){if(_0x296d01[_0x7fb0('0x5b')]){var _0x357651=path[_0x7fb0('0x50')](_0x38ab34,_0x296d01[_0x7fb0('0x5b')][_0x7fb0('0x6a')]);if(fs[_0x7fb0('0x6b')](_0x357651)){fs[_0x7fb0('0x6c')](_0x357651)[_0x7fb0('0x6d')](fs[_0x7fb0('0x6e')](path[_0x7fb0('0x50')](_0x597a48,_0x296d01[_0x7fb0('0x5b')][_0x7fb0('0x6a')])));}}return{'date':moment(_0x296d01[_0x7fb0('0x66')])['format'](_0x7fb0('0x43'))[_0x7fb0('0x4f')](),'sender':_0x296d01[_0x7fb0('0x5c')]===_0x7fb0('0x6f')?_0x296d01[_0x7fb0('0x56')]?_0x296d01[_0x7fb0('0x56')]['fullname']:_0x7fb0('0x70'):_0x296d01[_0x7fb0('0x59')]['firstName']+(_0x296d01[_0x7fb0('0x59')][_0x7fb0('0x71')]?'\x20'+_0x296d01[_0x7fb0('0x59')][_0x7fb0('0x71')]:''),'body':_0x296d01[_0x7fb0('0x5b')]?_0x296d01[_0x7fb0('0x5b')][_0x7fb0('0x6a')]:_0x296d01[_0x7fb0('0x32')],'direction':_0x296d01[_0x7fb0('0x5c')]===_0x7fb0('0x6f')?'A':'C','secret':_0x296d01['secret'],'read':_0x296d01[_0x7fb0('0x72')],'attachment':_0x296d01['Attachment']};})[_0x7fb0('0x73')]()};return ejs['renderFile'](path[_0x7fb0('0x50')](config[_0x7fb0('0x51')],_0x7fb0('0x52'),_0x7fb0('0x74'),'downloadInteraction.ejs'),{'interaction':_0x1aebf4})[_0x7fb0('0x16')](function(_0x4d7020){var _0x1bd3ff=path[_0x7fb0('0x50')](_0x597a48,_0x7fb0('0x75')+_0x2b0049['id']+'-'+_0x164aad+_0x7fb0('0x76'));var _0x34e474={'path':_0x1bd3ff,'channel':_0x7fb0('0x64'),'interactionId':_0x2b0049['id']};return pdf['createPdfFromHTML'](_0x4d7020,_0x34e474);})['then'](function(){return new BPromise(function(_0x3178f7,_0x4865cc){zipdir(_0x597a48,{'saveTo':_0x1fc96c},function(_0x400146,_0x12c86e){if(_0x400146)return _0x4865cc(_0x400146);return _0x3178f7(_0x12c86e);});})[_0x7fb0('0x16')](function(){return new BPromise(function(_0x35cfea,_0x439686){rimraf(_0x597a48,function(_0x67ed61){if(_0x67ed61)_0x439686(_0x67ed61);return _0x35cfea();});});})[_0x7fb0('0x16')](function(){return _0x635c41[_0x7fb0('0x4d')](_0x1fc96c,_0x5bc104,function(_0x192d8f){if(_0x192d8f){console['log'](_0x7fb0('0x77'),_0x192d8f);}else{fs[_0x7fb0('0x78')](_0x1fc96c);}});});});}else{return _0x635c41[_0x7fb0('0xc')](0xc8);}})[_0x7fb0('0x24')](handleError(_0x635c41,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index f732494..df7de54 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x195e=['../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x195e,0xfb));var _0xe195=function(_0x53c578,_0x308cfc){_0x53c578=_0x53c578-0x0;var _0x522b4c=_0x195e[_0x53c578];return _0x522b4c;};'use strict';var EventEmitter=require(_0xe195('0x0'));var WhatsappInteraction=require(_0xe195('0x1'))['db'][_0xe195('0x2')];var WhatsappMessage=require(_0xe195('0x1'))['db'][_0xe195('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe195('0x4')](0x0);var events={'afterCreate':_0xe195('0x5'),'afterUpdate':_0xe195('0x6'),'afterDestroy':_0xe195('0x7')};function emitEvent(_0x30011c){return function(_0x31f6c9,_0x2d1fa7,_0x11cc55){_0x31f6c9['getUsers']({'attributes':['id'],'raw':!![]})[_0xe195('0x8')](function(_0x663106){_0x31f6c9[_0xe195('0x9')](_0xe195('0xa'),_0x663106[_0xe195('0xb')](function(_0x595ac2){return{'id':_0x595ac2['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x31f6c9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3bf721){_0x31f6c9[_0xe195('0x9')](_0xe195('0xc'),_0x3bf721[_0xe195('0xd')]);WhatsappInteractionEvents['emit'](_0x30011c+':'+_0x31f6c9['id'],_0x31f6c9);WhatsappInteractionEvents[_0xe195('0xe')](_0x30011c,_0x31f6c9);_0x11cc55(null);})[_0xe195('0xf')](_0x11cc55(null));};}for(var e in events){if(events[_0xe195('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xe195('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xc9c3=['../../mysqldb','WhatsappInteraction','save','update','getUsers','then','map','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x2f1292,_0x222741){var _0x3e65fc=function(_0x46b2dd){while(--_0x46b2dd){_0x2f1292['push'](_0x2f1292['shift']());}};_0x3e65fc(++_0x222741);}(_0xc9c3,0xd0));var _0x3c9c=function(_0x4036be,_0x18edc0){_0x4036be=_0x4036be-0x0;var _0xe98986=_0xc9c3[_0x4036be];return _0xe98986;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x3c9c('0x0'))['db'][_0x3c9c('0x1')];var WhatsappMessage=require(_0x3c9c('0x0'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c9c('0x2'),'afterUpdate':_0x3c9c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x161be6){return function(_0x40e81a,_0x321f55,_0xfb5046){_0x40e81a[_0x3c9c('0x4')]({'attributes':['id'],'raw':!![]})[_0x3c9c('0x5')](function(_0x353324){_0x40e81a['setDataValue']('Users',_0x353324[_0x3c9c('0x6')](function(_0x3d10bc){return{'id':_0x3d10bc['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x40e81a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3c9c('0x5')](function(_0x417fdc){_0x40e81a[_0x3c9c('0x7')](_0x3c9c('0x8'),_0x417fdc['length']);WhatsappInteractionEvents['emit'](_0x161be6+':'+_0x40e81a['id'],_0x40e81a);WhatsappInteractionEvents[_0x3c9c('0x9')](_0x161be6,_0x40e81a);_0xfb5046(null);})[_0x3c9c('0xa')](_0xfb5046(null));};}for(var e in events){if(events[_0x3c9c('0xb')](e)){var event=events[e];WhatsappInteraction[_0x3c9c('0xc')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 61a2e2d..7fa2926 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65c5=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','WhatsappInteraction','closedAt','format'];(function(_0x1cb4b2,_0xfffe40){var _0xd80f7e=function(_0x338a1d){while(--_0x338a1d){_0x1cb4b2['push'](_0x1cb4b2['shift']());}};_0xd80f7e(++_0xfffe40);}(_0x65c5,0xc0));var _0x565c=function(_0x1f5c1a,_0x35b6bc){_0x1f5c1a=_0x1f5c1a-0x0;var _0x18aa15=_0x65c5[_0x1f5c1a];return _0x18aa15;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x565c('0x0'))(_0x565c('0x1'));var moment=require(_0x565c('0x2'));var BPromise=require(_0x565c('0x3'));var rp=require(_0x565c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x565c('0x5'));var config=require(_0x565c('0x6'));var attributes=require('./whatsappInteraction.attributes');module[_0x565c('0x7')]=function(_0x4315ee,_0x24b4a9){return _0x4315ee[_0x565c('0x8')](_0x565c('0x9'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c72ff,_0x56f707,_0x43cbf0){if(_0x5c72ff['changed']('closed')){_0x5c72ff[_0x565c('0xa')]=moment()[_0x565c('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x43cbf0(null,_0x5c72ff);}}});}; \ No newline at end of file +var _0xbdb8=['whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction'];(function(_0x4a7b06,_0x3a24c5){var _0x5cdc8d=function(_0x29d8a5){while(--_0x29d8a5){_0x4a7b06['push'](_0x4a7b06['shift']());}};_0x5cdc8d(++_0x3a24c5);}(_0xbdb8,0xf0));var _0x8bdb=function(_0x5124d2,_0x3400cb){_0x5124d2=_0x5124d2-0x0;var _0x361478=_0xbdb8[_0x5124d2];return _0x361478;};'use strict';var _=require('lodash');var util=require(_0x8bdb('0x0'));var logger=require(_0x8bdb('0x1'))('api');var moment=require(_0x8bdb('0x2'));var BPromise=require(_0x8bdb('0x3'));var rp=require(_0x8bdb('0x4'));var fs=require('fs');var path=require(_0x8bdb('0x5'));var rimraf=require(_0x8bdb('0x6'));var config=require(_0x8bdb('0x7'));var attributes=require(_0x8bdb('0x8'));module[_0x8bdb('0x9')]=function(_0x465ec3,_0x63895e){return _0x465ec3[_0x8bdb('0xa')](_0x8bdb('0xb'),attributes,{'tableName':_0x8bdb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e8906,_0x3bf5ea,_0x2426a3){if(_0x2e8906[_0x8bdb('0xd')](_0x8bdb('0xe'))){_0x2e8906[_0x8bdb('0xf')]=moment()[_0x8bdb('0x10')](_0x8bdb('0x11'));}_0x2426a3(null,_0x2e8906);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 5d813e1..f705430 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63d3=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','UpdateWhatsappInteraction','WhatsappInteraction','update','options','where','attributes','limit','stringify','catch','AddTagsToWhatsappInteraction','find','then','addTags','ids','omit','body','spread','AddTags','lodash'];(function(_0x2342c7,_0x8fa6c2){var _0x2155e4=function(_0x3a4fb1){while(--_0x3a4fb1){_0x2342c7['push'](_0x2342c7['shift']());}};_0x2155e4(++_0x8fa6c2);}(_0x63d3,0x1cd));var _0x363d=function(_0x5de064,_0x2dbae2){_0x5de064=_0x5de064-0x0;var _0x56cdf8=_0x63d3[_0x5de064];return _0x56cdf8;};'use strict';var _=require(_0x363d('0x0'));var util=require(_0x363d('0x1'));var moment=require(_0x363d('0x2'));var BPromise=require(_0x363d('0x3'));var rs=require(_0x363d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x363d('0x5'));var logger=require(_0x363d('0x6'))('rpc');var config=require(_0x363d('0x7'));var jayson=require(_0x363d('0x8'));var client=jayson[_0x363d('0x9')][_0x363d('0xa')]({'port':0x232a});config[_0x363d('0xb')]=_['defaults'](config['redis'],{'host':_0x363d('0xc'),'port':0x18eb});var socket=require(_0x363d('0xd'))(new Redis(config[_0x363d('0xb')]));require(_0x363d('0xe'))[_0x363d('0xf')](socket);function respondWithRpcPromise(_0x2f75b5,_0x535922,_0x18d609){return new BPromise(function(_0x55bb40,_0x1383fb){return client[_0x363d('0x10')](_0x2f75b5,_0x18d609)['then'](function(_0x4dc8bd){logger['info'](_0x363d('0x11'),_0x535922,_0x363d('0x12'));logger[_0x363d('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x535922,_0x363d('0x12'),JSON['stringify'](_0x4dc8bd));if(_0x4dc8bd[_0x363d('0x14')]){if(_0x4dc8bd[_0x363d('0x14')]['code']===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x535922,_0x4dc8bd['error'][_0x363d('0x15')]);return _0x1383fb(_0x4dc8bd[_0x363d('0x14')][_0x363d('0x15')]);}logger[_0x363d('0x14')](_0x363d('0x11'),_0x535922,_0x4dc8bd['error']['message']);return _0x55bb40(_0x4dc8bd[_0x363d('0x14')]['message']);}else{logger[_0x363d('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x535922,_0x363d('0x12'));_0x55bb40(_0x4dc8bd[_0x363d('0x17')][_0x363d('0x15')]);}})['catch'](function(_0x420702){logger[_0x363d('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x535922,_0x420702);_0x1383fb(_0x420702);});});}exports[_0x363d('0x18')]=function(_0x41bf54){var _0x57f604=this;return new Promise(function(_0x5249ef,_0x25729a){return db[_0x363d('0x19')][_0x363d('0x1a')](_0x41bf54['body'],{'raw':_0x41bf54[_0x363d('0x1b')]?_0x41bf54[_0x363d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41bf54[_0x363d('0x1b')]?_0x41bf54[_0x363d('0x1b')][_0x363d('0x1c')]||null:null,'attributes':_0x41bf54[_0x363d('0x1b')]?_0x41bf54['options'][_0x363d('0x1d')]||null:null,'limit':_0x41bf54[_0x363d('0x1b')]?_0x41bf54[_0x363d('0x1b')][_0x363d('0x1e')]||null:null})['then'](function(_0x151d29){logger[_0x363d('0x16')](_0x363d('0x18'),_0x41bf54);logger['debug']('UpdateWhatsappInteraction',_0x41bf54,JSON[_0x363d('0x1f')](_0x151d29));_0x5249ef(_0x151d29);})[_0x363d('0x20')](function(_0x1edf82){logger['error']('UpdateWhatsappInteraction',_0x1edf82[_0x363d('0x15')],_0x41bf54);_0x25729a(_0x57f604['error'](0x1f4,_0x1edf82['message']));});});};exports[_0x363d('0x21')]=function(_0xd3e378){return new Promise(function(_0x2b131e,_0x484c29){return db[_0x363d('0x19')][_0x363d('0x22')]({'where':_0xd3e378['options']?_0xd3e378[_0x363d('0x1b')][_0x363d('0x1c')]||null:null})[_0x363d('0x23')](function(_0x289719){if(_0x289719){return _0x289719[_0x363d('0x24')](_0xd3e378['body'][_0x363d('0x25')],_[_0x363d('0x26')](_0xd3e378[_0x363d('0x27')],[_0x363d('0x25'),'id'])||{});}})[_0x363d('0x28')](function(_0x235ee9){logger['info'](_0x363d('0x29'),_0xd3e378);logger[_0x363d('0x13')]('AddTags',_0xd3e378,JSON[_0x363d('0x1f')](_0x235ee9));_0x2b131e(_0x235ee9);})['catch'](function(_0x2dd06d){logger[_0x363d('0x14')]('AddTags',_0x2dd06d[_0x363d('0x15')],_0xd3e378);_0x484c29(_this[_0x363d('0x14')](0x1f4,_0x2dd06d[_0x363d('0x15')]));});});}; \ No newline at end of file +var _0x3ad0=['request\x20sent','stringify','error','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','attributes','limit','debug','AddTagsToWhatsappInteraction','where','addTags','ids','omit','spread','AddTags','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','redis','defaults','localhost','socket.io-emitter','then','info','WhatsappInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x4b3b40,_0x25836e){var _0x230259=function(_0x1ec204){while(--_0x1ec204){_0x4b3b40['push'](_0x4b3b40['shift']());}};_0x230259(++_0x25836e);}(_0x3ad0,0x103));var _0x03ad=function(_0x370dd8,_0x4ae757){_0x370dd8=_0x370dd8-0x0;var _0xd8de6=_0x3ad0[_0x370dd8];return _0xd8de6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x03ad('0x0'));var rs=require(_0x03ad('0x1'));var fs=require('fs');var Redis=require(_0x03ad('0x2'));var db=require(_0x03ad('0x3'))['db'];var utils=require(_0x03ad('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x03ad('0x5')]({'port':0x232a});config[_0x03ad('0x6')]=_[_0x03ad('0x7')](config[_0x03ad('0x6')],{'host':_0x03ad('0x8'),'port':0x18eb});var socket=require(_0x03ad('0x9'))(new Redis(config[_0x03ad('0x6')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x66ffe9,_0x189c14,_0x3cfbb2){return new BPromise(function(_0x5dd864,_0x2a7f32){return client['request'](_0x66ffe9,_0x3cfbb2)[_0x03ad('0xa')](function(_0x18f506){logger[_0x03ad('0xb')]('WhatsappInteraction,\x20%s,\x20%s',_0x189c14,'request\x20sent');logger['debug'](_0x03ad('0xc'),_0x189c14,_0x03ad('0xd'),JSON[_0x03ad('0xe')](_0x18f506));if(_0x18f506[_0x03ad('0xf')]){if(_0x18f506[_0x03ad('0xf')]['code']===0x1f4){logger[_0x03ad('0xf')](_0x03ad('0x10'),_0x189c14,_0x18f506['error'][_0x03ad('0x11')]);return _0x2a7f32(_0x18f506['error'][_0x03ad('0x11')]);}logger[_0x03ad('0xf')](_0x03ad('0x10'),_0x189c14,_0x18f506[_0x03ad('0xf')][_0x03ad('0x11')]);return _0x5dd864(_0x18f506[_0x03ad('0xf')]['message']);}else{logger[_0x03ad('0xb')]('WhatsappInteraction,\x20%s,\x20%s',_0x189c14,'request\x20sent');_0x5dd864(_0x18f506[_0x03ad('0x12')]['message']);}})[_0x03ad('0x13')](function(_0x478a7e){logger[_0x03ad('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x189c14,_0x478a7e);_0x2a7f32(_0x478a7e);});});}exports[_0x03ad('0x14')]=function(_0x3ea197){var _0x4ad5e5=this;return new Promise(function(_0xaaf441,_0xc2f185){return db[_0x03ad('0x15')]['update'](_0x3ea197[_0x03ad('0x16')],{'raw':_0x3ea197[_0x03ad('0x17')]?_0x3ea197['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ea197[_0x03ad('0x17')]?_0x3ea197['options']['where']||null:null,'attributes':_0x3ea197[_0x03ad('0x17')]?_0x3ea197[_0x03ad('0x17')][_0x03ad('0x18')]||null:null,'limit':_0x3ea197[_0x03ad('0x17')]?_0x3ea197['options'][_0x03ad('0x19')]||null:null})[_0x03ad('0xa')](function(_0x1842db){logger[_0x03ad('0xb')](_0x03ad('0x14'),_0x3ea197);logger[_0x03ad('0x1a')](_0x03ad('0x14'),_0x3ea197,JSON[_0x03ad('0xe')](_0x1842db));_0xaaf441(_0x1842db);})['catch'](function(_0x282082){logger[_0x03ad('0xf')](_0x03ad('0x14'),_0x282082[_0x03ad('0x11')],_0x3ea197);_0xc2f185(_0x4ad5e5[_0x03ad('0xf')](0x1f4,_0x282082[_0x03ad('0x11')]));});});};exports[_0x03ad('0x1b')]=function(_0x59e1b9){return new Promise(function(_0x371488,_0x2f419f){return db['WhatsappInteraction']['find']({'where':_0x59e1b9['options']?_0x59e1b9[_0x03ad('0x17')][_0x03ad('0x1c')]||null:null})[_0x03ad('0xa')](function(_0x2d4cff){if(_0x2d4cff){return _0x2d4cff[_0x03ad('0x1d')](_0x59e1b9['body'][_0x03ad('0x1e')],_[_0x03ad('0x1f')](_0x59e1b9['body'],['ids','id'])||{});}})[_0x03ad('0x20')](function(_0x49ac51){logger[_0x03ad('0xb')]('AddTags',_0x59e1b9);logger[_0x03ad('0x1a')](_0x03ad('0x21'),_0x59e1b9,JSON[_0x03ad('0xe')](_0x49ac51));_0x371488(_0x49ac51);})['catch'](function(_0x2d73e4){logger[_0x03ad('0xf')](_0x03ad('0x21'),_0x2d73e4[_0x03ad('0x11')],_0x59e1b9);_0x2f419f(_this[_0x03ad('0xf')](0x1f4,_0x2d73e4[_0x03ad('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index f2d2237..80143a2 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd727=['save','update','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x5be3a9,_0x9e6e5c){var _0x1cf328=function(_0x30f661){while(--_0x30f661){_0x5be3a9['push'](_0x5be3a9['shift']());}};_0x1cf328(++_0x9e6e5c);}(_0xd727,0x1df));var _0x7d72=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd727[_0x4a9fb1];return _0x348672;};'use strict';var WhatsappInteractionEvents=require(_0x7d72('0x0'));var events=[_0x7d72('0x1'),'remove',_0x7d72('0x2')];function createListener(_0xbd3238,_0x12c184){return function(_0x5a372d){_0x12c184['emit'](_0xbd3238,_0x5a372d);};}function removeListener(_0x950fad,_0x4635ff){return function(){WhatsappInteractionEvents['removeListener'](_0x950fad,_0x4635ff);};}exports[_0x7d72('0x3')]=function(_0x47cf0f){for(var _0x4f73fb=0x0,_0x94e4cc=events[_0x7d72('0x4')];_0x4f73fb<_0x94e4cc;_0x4f73fb++){var _0x30669a=events[_0x4f73fb];var _0x135594=createListener(_0x7d72('0x5')+_0x30669a,_0x47cf0f);WhatsappInteractionEvents['on'](_0x30669a,_0x135594);}}; \ No newline at end of file +var _0x42ea=['whatsappInteraction:','save','remove','update','removeListener','register','length'];(function(_0x4e4fd2,_0x92933){var _0x4d34cc=function(_0x3dd7ac){while(--_0x3dd7ac){_0x4e4fd2['push'](_0x4e4fd2['shift']());}};_0x4d34cc(++_0x92933);}(_0x42ea,0x12e));var _0xa42e=function(_0x13dcdd,_0x1f6330){_0x13dcdd=_0x13dcdd-0x0;var _0x4e39d6=_0x42ea[_0x13dcdd];return _0x4e39d6;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xa42e('0x0'),_0xa42e('0x1'),_0xa42e('0x2')];function createListener(_0x106541,_0x72b5fd){return function(_0x275307){_0x72b5fd['emit'](_0x106541,_0x275307);};}function removeListener(_0x4339eb,_0x304804){return function(){WhatsappInteractionEvents[_0xa42e('0x3')](_0x4339eb,_0x304804);};}exports[_0xa42e('0x4')]=function(_0x439ed3){for(var _0x2b4b8d=0x0,_0x1ec5e3=events[_0xa42e('0x5')];_0x2b4b8d<_0x1ec5e3;_0x2b4b8d++){var _0x289557=events[_0x2b4b8d];var _0x4f4d72=createListener(_0xa42e('0x6')+_0x289557,_0x439ed3);WhatsappInteractionEvents['on'](_0x289557,_0x4f4d72);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 8987fa6..8dcf1c9 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf65e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','whatsapp','create','put','update','accept','/:id/reject','reject','delete','path','connect-timeout'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xf65e,0x1d2));var _0xef65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf65e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xef65('0x0'));var timeout=require(_0xef65('0x1'));var express=require(_0xef65('0x2'));var router=express[_0xef65('0x3')]();var fs_extra=require(_0xef65('0x4'));var auth=require(_0xef65('0x5'));var interaction=require(_0xef65('0x6'));var config=require(_0xef65('0x7'));var controller=require(_0xef65('0x8'));router['get']('/',auth[_0xef65('0x9')](),controller[_0xef65('0xa')]);router[_0xef65('0xb')](_0xef65('0xc'),auth[_0xef65('0x9')](),controller[_0xef65('0xd')]);router[_0xef65('0xb')](_0xef65('0xe'),auth['isAuthenticated'](),controller[_0xef65('0xf')]);router[_0xef65('0x10')]('/',auth[_0xef65('0x9')](),interaction[_0xef65('0x11')](_0xef65('0x12'),'whatsappmessage:create'),controller[_0xef65('0x13')]);router[_0xef65('0x10')]('/:id/status',controller['status']);router[_0xef65('0x14')](_0xef65('0xe'),auth[_0xef65('0x9')](),controller[_0xef65('0x15')]);router[_0xef65('0x14')]('/:id/accept',auth[_0xef65('0x9')](),controller[_0xef65('0x16')]);router[_0xef65('0x14')](_0xef65('0x17'),auth['isAuthenticated'](),controller[_0xef65('0x18')]);router[_0xef65('0x19')](_0xef65('0xe'),auth[_0xef65('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x28c4=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','whatsappmessage:create','create','post','status','put','/:id/accept','accept','/:id/reject','reject'];(function(_0x291e3e,_0x5728cf){var _0xf4b415=function(_0x44eca6){while(--_0x44eca6){_0x291e3e['push'](_0x291e3e['shift']());}};_0xf4b415(++_0x5728cf);}(_0x28c4,0xd3));var _0x428c=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x28c4[_0x55ff79];return _0x579067;};'use strict';var multer=require('multer');var util=require(_0x428c('0x0'));var path=require(_0x428c('0x1'));var timeout=require(_0x428c('0x2'));var express=require(_0x428c('0x3'));var router=express[_0x428c('0x4')]();var fs_extra=require(_0x428c('0x5'));var auth=require(_0x428c('0x6'));var interaction=require(_0x428c('0x7'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x428c('0x8')]('/',auth[_0x428c('0x9')](),controller[_0x428c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x428c('0xb')]);router['get'](_0x428c('0xc'),auth[_0x428c('0x9')](),controller[_0x428c('0xd')]);router['post']('/',auth[_0x428c('0x9')](),interaction['tracked']('whatsapp',_0x428c('0xe')),controller[_0x428c('0xf')]);router[_0x428c('0x10')]('/:id/status',controller[_0x428c('0x11')]);router[_0x428c('0x12')](_0x428c('0xc'),auth[_0x428c('0x9')](),controller['update']);router['put'](_0x428c('0x13'),auth[_0x428c('0x9')](),controller[_0x428c('0x14')]);router[_0x428c('0x12')](_0x428c('0x15'),auth['isAuthenticated'](),controller[_0x428c('0x16')]);router[_0x428c('0x17')](_0x428c('0xc'),auth[_0x428c('0x9')](),controller[_0x428c('0x18')]);module[_0x428c('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index bc46cab..634cab0 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3d5=['STRING','DATE','sequelize','exports','TEXT','ENUM','out'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0xc3d5,0xc6));var _0x5c3d=function(_0x387391,_0x3542fa){_0x387391=_0x387391-0x0;var _0x556aed=_0xc3d5[_0x387391];return _0x556aed;};'use strict';var Sequelize=require(_0x5c3d('0x0'));module[_0x5c3d('0x1')]={'body':{'type':Sequelize[_0x5c3d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5c3d('0x3')]('in',_0x5c3d('0x4')),'defaultValue':_0x5c3d('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5c3d('0x5')](0xbe)},'phone':{'type':Sequelize[_0x5c3d('0x5')]},'readAt':{'type':Sequelize[_0x5c3d('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x5c3d('0x2')]}}; \ No newline at end of file +var _0x65bb=['exports','TEXT','medium','BOOLEAN','out','DATE','STRING','sequelize'];(function(_0x2bfad3,_0x10ab16){var _0xa480f7=function(_0x577993){while(--_0x577993){_0x2bfad3['push'](_0x2bfad3['shift']());}};_0xa480f7(++_0x10ab16);}(_0x65bb,0x1b7));var _0xb65b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x65bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb65b('0x0'));module[_0xb65b('0x1')]={'body':{'type':Sequelize[_0xb65b('0x2')](_0xb65b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb65b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb65b('0x5')),'defaultValue':_0xb65b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xb65b('0x6')]},'secret':{'type':Sequelize[_0xb65b('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb65b('0x7')]},'providerResponse':{'type':Sequelize[_0xb65b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 17fa40c..c043523 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xada2=['messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','WhatsappMessage,\x20%s,\x20%s','error','message','status','end','json','undefined','limit','count','offset','apply','update','destroy','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','describe','whatsapp-interactions','accept','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','interface','channel','motionChannel','event','EventManager','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio'];(function(_0x20634c,_0x5534fc){var _0x5d8936=function(_0x6b45f2){while(--_0x6b45f2){_0x20634c['push'](_0x20634c['shift']());}};_0x5d8936(++_0x5534fc);}(_0xada2,0x8d));var _0x2ada=function(_0x392a3d,_0x142165){_0x392a3d=_0x392a3d-0x0;var _0x37c6bf=_0xada2[_0x392a3d];return _0x37c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ada('0x0'));var zipdir=require(_0x2ada('0x1'));var jsonpatch=require(_0x2ada('0x2'));var rp=require(_0x2ada('0x3'));var moment=require('moment');var BPromise=require(_0x2ada('0x4'));var Mustache=require(_0x2ada('0x5'));var util=require('util');var path=require(_0x2ada('0x6'));var sox=require(_0x2ada('0x7'));var csv=require(_0x2ada('0x8'));var ejs=require(_0x2ada('0x9'));var fs=require('fs');var fs_extra=require(_0x2ada('0xa'));var _=require(_0x2ada('0xb'));var squel=require('squel');var crypto=require(_0x2ada('0xc'));var jsforce=require(_0x2ada('0xd'));var deskjs=require(_0x2ada('0xe'));var toCsv=require(_0x2ada('0x8'));var querystring=require('querystring');var Papa=require(_0x2ada('0xf'));var Redis=require(_0x2ada('0x10'));var authService=require(_0x2ada('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2ada('0x12'));var hardwareService=require(_0x2ada('0x13'));var logger=require(_0x2ada('0x14'))(_0x2ada('0x15'));var utils=require(_0x2ada('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2ada('0x17'))['db'];config[_0x2ada('0x18')]=_[_0x2ada('0x19')](config[_0x2ada('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ada('0x18')]));require(_0x2ada('0x1a'))[_0x2ada('0x1b')](socket);var jayson=require(_0x2ada('0x1c'));var client=jayson['client'][_0x2ada('0x1d')]({'port':0x232c});var client9002=jayson[_0x2ada('0x1e')][_0x2ada('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x39965c,_0x172a22,_0x33502a,_0x2c554c){return new BPromise(function(_0x552fbf,_0x200b1b){var _0x408a4c=_0x2c554c||client;return _0x408a4c[_0x2ada('0x1f')](_0x39965c,_0x33502a)[_0x2ada('0x20')](function(_0x3ad813){logger[_0x2ada('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x172a22,_0x2ada('0x22'));logger[_0x2ada('0x23')](_0x2ada('0x24'),_0x172a22,_0x2ada('0x22'),JSON[_0x2ada('0x25')](_0x3ad813));if(_0x3ad813['error']){if(_0x3ad813['error']['code']===0x1f4){logger['error'](_0x2ada('0x26'),_0x172a22,_0x3ad813['error']['message']);return _0x200b1b(_0x3ad813[_0x2ada('0x27')][_0x2ada('0x28')]);}logger[_0x2ada('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x172a22,_0x3ad813[_0x2ada('0x27')][_0x2ada('0x28')]);return _0x552fbf(_0x3ad813[_0x2ada('0x27')]['message']);}else{logger[_0x2ada('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x172a22,_0x2ada('0x22'));_0x552fbf(_0x3ad813['result'][_0x2ada('0x28')]);}})['catch'](function(_0x4a5ca8){logger[_0x2ada('0x27')](_0x2ada('0x26'),_0x172a22,_0x4a5ca8);_0x200b1b(_0x4a5ca8);});});}function respondWithStatusCode(_0x5bc9ba,_0x1fab6e){_0x1fab6e=_0x1fab6e||0xcc;return function(_0x1be32a){if(_0x1be32a){return _0x5bc9ba['sendStatus'](_0x1fab6e);}return _0x5bc9ba[_0x2ada('0x29')](_0x1fab6e)[_0x2ada('0x2a')]();};}function respondWithResult(_0x9ef814,_0x2268c7){_0x2268c7=_0x2268c7||0xc8;return function(_0x4bb73b){if(_0x4bb73b){return _0x9ef814[_0x2ada('0x29')](_0x2268c7)[_0x2ada('0x2b')](_0x4bb73b);}};}function respondWithFilteredResult(_0x3db082,_0x2e24c5){return function(_0x479f73){if(_0x479f73){var _0x558ff1=typeof _0x2e24c5['offset']===_0x2ada('0x2c')&&typeof _0x2e24c5[_0x2ada('0x2d')]==='undefined';var _0x318275=_0x479f73[_0x2ada('0x2e')];var _0x425da9=_0x558ff1?0x0:_0x2e24c5[_0x2ada('0x2f')];var _0x4448a3=_0x558ff1?_0x479f73[_0x2ada('0x2e')]:_0x2e24c5[_0x2ada('0x2f')]+_0x2e24c5['limit'];var _0x175bfb;if(_0x4448a3>=_0x318275){_0x4448a3=_0x318275;_0x175bfb=0xc8;}else{_0x175bfb=0xce;}_0x3db082[_0x2ada('0x29')](_0x175bfb);return _0x3db082['set']('Content-Range',_0x425da9+'-'+_0x4448a3+'/'+_0x318275)['json'](_0x479f73);}return null;};}function patchUpdates(_0x10eb13){return function(_0x18cc42){try{jsonpatch[_0x2ada('0x30')](_0x18cc42,_0x10eb13,!![]);}catch(_0x29ea4d){return BPromise['reject'](_0x29ea4d);}return _0x18cc42['save']();};}function saveUpdates(_0x2ad771,_0x5d5dbc){return function(_0x6269b0){if(_0x6269b0){return _0x6269b0[_0x2ada('0x31')](_0x2ad771)[_0x2ada('0x20')](function(_0x2a0fd3){return _0x2a0fd3;});}return null;};}function removeEntity(_0x594448,_0x1c7d4c){return function(_0x5cd522){if(_0x5cd522){return _0x5cd522[_0x2ada('0x32')]()['then'](function(){_0x594448[_0x2ada('0x29')](0xcc)[_0x2ada('0x2a')]();});}};}function handleEntityNotFound(_0x2b43db,_0x565a90){return function(_0x2e77f8){if(!_0x2e77f8){_0x2b43db['sendStatus'](0x194);}return _0x2e77f8;};}function handleError(_0x31e71c,_0x28e044){_0x28e044=_0x28e044||0x1f4;return function(_0x8a1333){logger[_0x2ada('0x27')](_0x8a1333[_0x2ada('0x33')]);if(_0x8a1333[_0x2ada('0x34')]){delete _0x8a1333['name'];}_0x31e71c['status'](_0x28e044)[_0x2ada('0x35')](_0x8a1333);};}exports[_0x2ada('0x36')]=function(_0x2a9710,_0x256f25){var _0xcd5169={},_0x2a0e3e={},_0x4f96f0={'count':0x0,'rows':[]};var _0x7713d7=_['map'](db[_0x2ada('0x37')][_0x2ada('0x38')],function(_0x588de0){return{'name':_0x588de0[_0x2ada('0x39')],'type':_0x588de0[_0x2ada('0x3a')][_0x2ada('0x3b')]};});_0x2a0e3e[_0x2ada('0x3c')]=_[_0x2ada('0x3d')](_0x7713d7,_0x2ada('0x34'));_0x2a0e3e[_0x2ada('0x3e')]=_['keys'](_0x2a9710[_0x2ada('0x3e')]);_0x2a0e3e['filters']=_[_0x2ada('0x3f')](_0x2a0e3e[_0x2ada('0x3c')],_0x2a0e3e['query']);_0xcd5169[_0x2ada('0x40')]=_[_0x2ada('0x3f')](_0x2a0e3e[_0x2ada('0x3c')],qs['fields'](_0x2a9710[_0x2ada('0x3e')][_0x2ada('0x41')]));_0xcd5169[_0x2ada('0x40')]=_0xcd5169[_0x2ada('0x40')]['length']?_0xcd5169[_0x2ada('0x40')]:_0x2a0e3e['model'];if(!_0x2a9710[_0x2ada('0x3e')][_0x2ada('0x42')](_0x2ada('0x43'))){_0xcd5169[_0x2ada('0x2d')]=qs['limit'](_0x2a9710[_0x2ada('0x3e')]['limit']);_0xcd5169[_0x2ada('0x2f')]=qs[_0x2ada('0x2f')](_0x2a9710[_0x2ada('0x3e')]['offset']);}_0xcd5169[_0x2ada('0x44')]=qs['sort'](_0x2a9710[_0x2ada('0x3e')][_0x2ada('0x45')]);_0xcd5169['where']=qs[_0x2ada('0x46')](_[_0x2ada('0x47')](_0x2a9710[_0x2ada('0x3e')],_0x2a0e3e[_0x2ada('0x46')]),_0x7713d7);if(_0x2a9710[_0x2ada('0x3e')]['filter']){_0xcd5169[_0x2ada('0x48')]=_[_0x2ada('0x49')](_0xcd5169[_0x2ada('0x48')],{'$or':_[_0x2ada('0x3d')](_0x7713d7,function(_0x263a37){if(_0x263a37[_0x2ada('0x3a')]!==_0x2ada('0x4a')){var _0x1ddb33={};_0x1ddb33[_0x263a37[_0x2ada('0x34')]]={'$like':'%'+_0x2a9710[_0x2ada('0x3e')]['filter']+'%'};return _0x1ddb33;}})});}_0xcd5169=_[_0x2ada('0x49')]({},_0xcd5169,_0x2a9710[_0x2ada('0x4b')]);var _0x148408={'where':_0xcd5169[_0x2ada('0x48')]};return db[_0x2ada('0x37')][_0x2ada('0x2e')](_0x148408)['then'](function(_0x23a3ee){_0x4f96f0[_0x2ada('0x2e')]=_0x23a3ee;if(_0x2a9710[_0x2ada('0x3e')][_0x2ada('0x4c')]){_0xcd5169[_0x2ada('0x4d')]=[{'all':!![]}];}return db[_0x2ada('0x37')][_0x2ada('0x4e')](_0xcd5169);})[_0x2ada('0x20')](function(_0x33e2f8){_0x4f96f0[_0x2ada('0x4f')]=_0x33e2f8;return _0x4f96f0;})[_0x2ada('0x20')](respondWithFilteredResult(_0x256f25,_0xcd5169))[_0x2ada('0x50')](handleError(_0x256f25,null));};exports[_0x2ada('0x51')]=function(_0x47cf75,_0x295cd2){var _0x2cb704={'raw':!![],'where':{'id':_0x47cf75['params']['id']}},_0x180fda={};_0x180fda[_0x2ada('0x3c')]=_[_0x2ada('0x52')](db[_0x2ada('0x37')][_0x2ada('0x38')]);_0x180fda[_0x2ada('0x3e')]=_['keys'](_0x47cf75[_0x2ada('0x3e')]);_0x180fda[_0x2ada('0x46')]=_[_0x2ada('0x3f')](_0x180fda[_0x2ada('0x3c')],_0x180fda['query']);_0x2cb704[_0x2ada('0x40')]=_[_0x2ada('0x3f')](_0x180fda[_0x2ada('0x3c')],qs[_0x2ada('0x41')](_0x47cf75['query'][_0x2ada('0x41')]));_0x2cb704[_0x2ada('0x40')]=_0x2cb704[_0x2ada('0x40')][_0x2ada('0x53')]?_0x2cb704[_0x2ada('0x40')]:_0x180fda['model'];if(_0x47cf75[_0x2ada('0x3e')][_0x2ada('0x4c')]){_0x2cb704[_0x2ada('0x4d')]=[{'all':!![]}];}_0x2cb704=_[_0x2ada('0x49')]({},_0x2cb704,_0x47cf75['options']);return db['WhatsappMessage'][_0x2ada('0x54')](_0x2cb704)[_0x2ada('0x20')](handleEntityNotFound(_0x295cd2,null))[_0x2ada('0x20')](respondWithResult(_0x295cd2,null))[_0x2ada('0x50')](handleError(_0x295cd2,null));};exports[_0x2ada('0x55')]=function(_0x4d0ad7,_0x29a9ba){return db[_0x2ada('0x37')][_0x2ada('0x55')](_0x4d0ad7[_0x2ada('0x56')],{})[_0x2ada('0x20')](respondWithResult(_0x29a9ba,0xc9))[_0x2ada('0x50')](handleError(_0x29a9ba,null));};exports[_0x2ada('0x31')]=function(_0x4f95a1,_0x4dc40d){if(_0x4f95a1[_0x2ada('0x56')]['id']){delete _0x4f95a1[_0x2ada('0x56')]['id'];}return db['WhatsappMessage'][_0x2ada('0x54')]({'where':{'id':_0x4f95a1[_0x2ada('0x57')]['id']}})[_0x2ada('0x20')](handleEntityNotFound(_0x4dc40d,null))[_0x2ada('0x20')](saveUpdates(_0x4f95a1[_0x2ada('0x56')],null))[_0x2ada('0x20')](respondWithResult(_0x4dc40d,null))['catch'](handleError(_0x4dc40d,null));};exports['destroy']=function(_0x2509ba,_0x28392e){return db[_0x2ada('0x37')]['find']({'where':{'id':_0x2509ba[_0x2ada('0x57')]['id']}})[_0x2ada('0x20')](handleEntityNotFound(_0x28392e,null))[_0x2ada('0x20')](removeEntity(_0x28392e,null))['catch'](handleError(_0x28392e,null));};exports[_0x2ada('0x58')]=function(_0x23d281,_0x3d87d8){return db[_0x2ada('0x37')][_0x2ada('0x58')]()[_0x2ada('0x20')](respondWithResult(_0x3d87d8,null))[_0x2ada('0x50')](handleError(_0x3d87d8,null));};var interaction_log=require(_0x2ada('0x14'))(_0x2ada('0x59'));exports[_0x2ada('0x5a')]=function(_0x3e3f97,_0x11f9e6,_0x5d793d){var _0x1be54b={'agent':{},'channel':_0x2ada('0x5b')};if(_0x3e3f97[_0x2ada('0x56')]['id']){delete _0x3e3f97[_0x2ada('0x56')]['id'];}_0x3e3f97[_0x2ada('0x56')]['read']=!![];_0x3e3f97['body'][_0x2ada('0x5c')]=moment()['format'](_0x2ada('0x5d'));_0x3e3f97['body'][_0x2ada('0x5e')]=_0x3e3f97[_0x2ada('0x56')][_0x2ada('0x5e')]||_0x3e3f97[_0x2ada('0x5f')]['id'];_0x1be54b[_0x2ada('0x60')]['id']=_0x3e3f97[_0x2ada('0x56')][_0x2ada('0x5e')];return db[_0x2ada('0x37')][_0x2ada('0x54')]({'where':{'id':_0x3e3f97[_0x2ada('0x57')]['id'],'UserId':null}})[_0x2ada('0x20')](handleEntityNotFound(_0x11f9e6,null))[_0x2ada('0x20')](saveUpdates(_0x3e3f97[_0x2ada('0x56')],null))[_0x2ada('0x20')](function(_0x1489b5){if(_0x1489b5){_0x1be54b[_0x2ada('0x28')]=_0x1489b5[_0x2ada('0x61')]({'plain':!![]});return db[_0x2ada('0x62')]['find']({'where':{'id':_0x1489b5['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x11f9e6,null))['then'](function(_0x297566){if(_0x297566){return _0x297566[_0x2ada('0x31')]({'UserId':_0x3e3f97[_0x2ada('0x56')][_0x2ada('0x5e')],'read1stAt':_[_0x2ada('0x63')](_0x297566[_0x2ada('0x64')])?moment()[_0x2ada('0x65')](_0x2ada('0x5d')):undefined});}return null;})['then'](function(_0xd29ad5){if(_0xd29ad5){_0x1be54b[_0x2ada('0x66')]=_0xd29ad5[_0x2ada('0x61')]({'plain':!![]});interaction_log[_0x2ada('0x21')](_0x2ada('0x67'),_0x3e3f97[_0x2ada('0x5f')]['id'],_0x3e3f97[_0x2ada('0x5f')][_0x2ada('0x34')],_0x3e3f97[_0x2ada('0x5f')][_0x2ada('0x68')],_0x1be54b[_0x2ada('0x66')]['id'],_0x3e3f97[_0x2ada('0x56')]?JSON[_0x2ada('0x25')](_0x3e3f97[_0x2ada('0x56')]):_0x2ada('0x69'));return respondWithRpcPromise('AcceptMessage',_0x2ada('0x6a'),_0x1be54b);}return null;})['then'](function(_0xfdb9cc){var _0x3dc564=_0x2ada('0x6b')+_0xfdb9cc['message'][_0x2ada('0x6c')];return db[_0x2ada('0x6d')]['query'](_0x3dc564,{'type':db[_0x2ada('0x6e')][_0x2ada('0x6f')][_0x2ada('0x70')],'raw':!![]})[_0x2ada('0x20')](function(_0x539b8a){return _0x539b8a;});})[_0x2ada('0x20')](function(_0x22cdec){if(_0x22cdec){_0x1be54b['message'][_0x2ada('0x71')]=_0x22cdec[0x0];if(!_0x3e3f97['body'][_0x2ada('0x5e')])return;return db['User'][_0x2ada('0x54')]({'where':{'id':_0x3e3f97[_0x2ada('0x56')]['UserId'],'role':_0x2ada('0x60')},'attributes':['id',_0x2ada('0x34'),_0x2ada('0x72'),_0x2ada('0x73'),_0x2ada('0x74')],'raw':!![]});}return null;})[_0x2ada('0x20')](function(_0x3ca58f){if(!_0x3ca58f)return null;_0x1be54b[_0x2ada('0x28')][_0x2ada('0x60')]=_0x3ca58f;return _0x1be54b;})[_0x2ada('0x20')](function(_0x4d64cc){if(_0x4d64cc){if(_0x3e3f97['body']['manual']){_0x1be54b[_0x2ada('0x28')][_0x2ada('0x75')]=util['format']('SIP/%s',_0x3e3f97[_0x2ada('0x5f')][_0x2ada('0x34')]);_0x1be54b[_0x2ada('0x28')]['channel']=_0x1be54b[_0x2ada('0x76')];_0x1be54b['message'][_0x2ada('0x77')]=_0x1be54b[_0x2ada('0x76')];_0x1be54b[_0x2ada('0x28')][_0x2ada('0x78')]='accept';return respondWithRpcPromise('EventManager',_0x2ada('0x79'),{'event':'acceptmessage','message':_0x1be54b[_0x2ada('0x28')]},client9002)[_0x2ada('0x20')](function(){return _0x1be54b;});}return _0x1be54b;}return null;})[_0x2ada('0x20')](respondWithResult(_0x11f9e6,null))[_0x2ada('0x50')](handleError(_0x11f9e6,null));};var interaction_log=require(_0x2ada('0x14'))(_0x2ada('0x59'));exports[_0x2ada('0x7a')]=function(_0x58ca77,_0x3ed16c,_0x182cf5){var _0x55fb14={'agent':{},'channel':_0x2ada('0x5b')};if(_0x58ca77[_0x2ada('0x56')]['id']){delete _0x58ca77[_0x2ada('0x56')]['id'];}_0x58ca77[_0x2ada('0x56')][_0x2ada('0x5e')]=_0x58ca77[_0x2ada('0x56')][_0x2ada('0x5e')]||_0x58ca77[_0x2ada('0x5f')]['id'];_0x55fb14[_0x2ada('0x60')]['id']=_0x58ca77['body'][_0x2ada('0x5e')];return db[_0x2ada('0x37')][_0x2ada('0x54')]({'where':{'id':_0x58ca77[_0x2ada('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3ed16c,null))[_0x2ada('0x20')](function(_0x1da6ac){if(_0x1da6ac){_0x55fb14[_0x2ada('0x28')]=_0x1da6ac[_0x2ada('0x61')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x1da6ac['WhatsappInteractionId']}});}return null;})[_0x2ada('0x20')](handleEntityNotFound(_0x3ed16c,null))[_0x2ada('0x20')](function(_0x5dc346){if(_0x5dc346){_0x55fb14[_0x2ada('0x66')]=_0x5dc346['get']({'plain':!![]});interaction_log['info'](_0x2ada('0x7b'),_0x58ca77['user']['id'],_0x58ca77[_0x2ada('0x5f')][_0x2ada('0x34')],_0x58ca77[_0x2ada('0x5f')][_0x2ada('0x68')],_0x55fb14['interaction']['id'],_0x58ca77[_0x2ada('0x56')]?JSON['stringify'](_0x58ca77[_0x2ada('0x56')]):_0x2ada('0x69'));return respondWithRpcPromise(_0x2ada('0x7c'),_0x2ada('0x7d'),_0x55fb14);}return null;})[_0x2ada('0x20')](function(_0x31da77){var _0x5246b1=_0x2ada('0x6b')+_0x31da77[_0x2ada('0x28')][_0x2ada('0x6c')];return db['sequelize'][_0x2ada('0x3e')](_0x5246b1,{'type':db[_0x2ada('0x6e')][_0x2ada('0x6f')][_0x2ada('0x70')],'raw':!![]})[_0x2ada('0x20')](function(_0x512d4e){return _0x512d4e;});})[_0x2ada('0x20')](function(_0x382bfb){if(_0x382bfb){_0x55fb14['message'][_0x2ada('0x71')]=_0x382bfb[0x0];if(!_0x58ca77[_0x2ada('0x56')][_0x2ada('0x5e')])return;return db[_0x2ada('0x7e')]['find']({'where':{'id':_0x58ca77['body']['UserId'],'role':_0x2ada('0x60')},'attributes':['id','name',_0x2ada('0x72'),_0x2ada('0x73'),_0x2ada('0x74')],'raw':!![]});}return null;})[_0x2ada('0x20')](function(_0x49c40d){if(!_0x49c40d)return null;_0x55fb14['message'][_0x2ada('0x60')]=_0x49c40d;return _0x55fb14;})[_0x2ada('0x20')](function(_0x17bd43){if(_0x17bd43){_0x17bd43[_0x2ada('0x28')][_0x2ada('0x75')]=util[_0x2ada('0x65')]('SIP/%s',_0x58ca77[_0x2ada('0x5f')][_0x2ada('0x34')]);_0x17bd43[_0x2ada('0x28')][_0x2ada('0x76')]=_0x55fb14['channel'];_0x17bd43[_0x2ada('0x28')]['motionChannel']=_0x55fb14[_0x2ada('0x76')];_0x17bd43[_0x2ada('0x28')][_0x2ada('0x78')]='reject';respondWithRpcPromise(_0x2ada('0x79'),'EventManager',{'event':_0x2ada('0x7f'),'message':_0x17bd43['message']},client9002);return _0x55fb14;}return null;})[_0x2ada('0x20')](respondWithResult(_0x3ed16c,null))[_0x2ada('0x50')](handleError(_0x3ed16c,null));};exports[_0x2ada('0x29')]=function(_0x1126f7,_0x4a7432,_0x5113d5){if(_0x1126f7[_0x2ada('0x56')]['id']){delete _0x1126f7[_0x2ada('0x56')]['id'];}var _0x387113;return db[_0x2ada('0x37')][_0x2ada('0x54')]({'where':{'id':_0x1126f7[_0x2ada('0x57')]['id']}})['then'](handleEntityNotFound(_0x4a7432,null))['then'](function(_0x4a44a1){if(_0x4a44a1){_0x387113=_0x4a44a1;return db[_0x2ada('0x80')]['find']({'where':{'id':_0x4a44a1[_0x2ada('0x81')]}});}})[_0x2ada('0x20')](handleEntityNotFound(_0x4a7432,null))[_0x2ada('0x20')](function(_0x59cd24){if(_0x59cd24){logger[_0x2ada('0x23')](_0x2ada('0x82'),_0x2ada('0x29'),'received\x20delivery\x20report\x20from',_0x59cd24[_0x2ada('0x3a')],util[_0x2ada('0x83')](_0x1126f7[_0x2ada('0x56')],{'showHidden':![],'depth':null}));switch(_0x59cd24[_0x2ada('0x3a')]){case _0x2ada('0x84'):if(_0x1126f7['body']['MessageSid']&&_0x1126f7[_0x2ada('0x56')]['MessageSid']===_0x387113[_0x2ada('0x85')]&&_0x1126f7[_0x2ada('0x56')][_0x2ada('0x86')]&&_0x1126f7[_0x2ada('0x56')][_0x2ada('0x86')]===_0x2ada('0x87')){return _0x387113['update']({'read':!![]});}else{logger[_0x2ada('0x27')](_0x2ada('0x88'),_0x2ada('0x29'),_0x2ada('0x84'),util[_0x2ada('0x83')](_0x1126f7[_0x2ada('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x387113;}})['then'](respondWithResult(_0x4a7432,null))[_0x2ada('0x50')](handleError(_0x4a7432,null));}; \ No newline at end of file +var _0xb8ad=['where','filters','filter','merge','VIRTUAL','includeAll','include','rows','show','params','intersection','options','find','create','body','update','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','User','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteraction','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','SELECT','contact','fullname','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','bluebird','mustache','util','path','sox','fs-extra','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x24e10e,_0x510e5c){var _0x3a9528=function(_0x55aabf){while(--_0x55aabf){_0x24e10e['push'](_0x24e10e['shift']());}};_0x3a9528(++_0x510e5c);}(_0xb8ad,0xd9));var _0xdb8a=function(_0x5b582b,_0x231536){_0x5b582b=_0x5b582b-0x0;var _0x3e9554=_0xb8ad[_0x5b582b];return _0x3e9554;};'use strict';var emlformat=require(_0xdb8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb8a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb8a('0x2'));var Mustache=require(_0xdb8a('0x3'));var util=require(_0xdb8a('0x4'));var path=require(_0xdb8a('0x5'));var sox=require(_0xdb8a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb8a('0x7'));var _=require(_0xdb8a('0x8'));var squel=require(_0xdb8a('0x9'));var crypto=require(_0xdb8a('0xa'));var jsforce=require(_0xdb8a('0xb'));var deskjs=require(_0xdb8a('0xc'));var toCsv=require(_0xdb8a('0xd'));var querystring=require('querystring');var Papa=require(_0xdb8a('0xe'));var Redis=require(_0xdb8a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdb8a('0x10'));var as=require(_0xdb8a('0x11'));var hardwareService=require(_0xdb8a('0x12'));var logger=require(_0xdb8a('0x13'))(_0xdb8a('0x14'));var utils=require(_0xdb8a('0x15'));var config=require(_0xdb8a('0x16'));var licenseUtil=require(_0xdb8a('0x17'));var db=require(_0xdb8a('0x18'))['db'];config[_0xdb8a('0x19')]=_[_0xdb8a('0x1a')](config['redis'],{'host':_0xdb8a('0x1b'),'port':0x18eb});var socket=require(_0xdb8a('0x1c'))(new Redis(config['redis']));require(_0xdb8a('0x1d'))['register'](socket);var jayson=require(_0xdb8a('0x1e'));var client=jayson[_0xdb8a('0x1f')][_0xdb8a('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xdb8a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x4cc453,_0x59e156,_0x4629d2,_0x419296){return new BPromise(function(_0x44ba5f,_0x247e5f){var _0xf074a=_0x419296||client;return _0xf074a[_0xdb8a('0x21')](_0x4cc453,_0x4629d2)['then'](function(_0x29c7b0){logger[_0xdb8a('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x59e156,_0xdb8a('0x23'));logger['debug'](_0xdb8a('0x24'),_0x59e156,_0xdb8a('0x23'),JSON[_0xdb8a('0x25')](_0x29c7b0));if(_0x29c7b0[_0xdb8a('0x26')]){if(_0x29c7b0[_0xdb8a('0x26')][_0xdb8a('0x27')]===0x1f4){logger[_0xdb8a('0x26')](_0xdb8a('0x28'),_0x59e156,_0x29c7b0[_0xdb8a('0x26')][_0xdb8a('0x29')]);return _0x247e5f(_0x29c7b0[_0xdb8a('0x26')][_0xdb8a('0x29')]);}logger[_0xdb8a('0x26')](_0xdb8a('0x28'),_0x59e156,_0x29c7b0[_0xdb8a('0x26')][_0xdb8a('0x29')]);return _0x44ba5f(_0x29c7b0[_0xdb8a('0x26')][_0xdb8a('0x29')]);}else{logger['info'](_0xdb8a('0x28'),_0x59e156,_0xdb8a('0x23'));_0x44ba5f(_0x29c7b0['result'][_0xdb8a('0x29')]);}})[_0xdb8a('0x2a')](function(_0x4631d2){logger[_0xdb8a('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x59e156,_0x4631d2);_0x247e5f(_0x4631d2);});});}function respondWithStatusCode(_0x3b98e3,_0x24ffb3){_0x24ffb3=_0x24ffb3||0xcc;return function(_0x49afa3){if(_0x49afa3){return _0x3b98e3[_0xdb8a('0x2b')](_0x24ffb3);}return _0x3b98e3['status'](_0x24ffb3)['end']();};}function respondWithResult(_0x3f260d,_0x1292e7){_0x1292e7=_0x1292e7||0xc8;return function(_0x16f8eb){if(_0x16f8eb){return _0x3f260d[_0xdb8a('0x2c')](_0x1292e7)['json'](_0x16f8eb);}};}function respondWithFilteredResult(_0x493e2a,_0x4578b3){return function(_0x138bd0){if(_0x138bd0){var _0x40ffa6=typeof _0x4578b3['offset']==='undefined'&&typeof _0x4578b3['limit']===_0xdb8a('0x2d');var _0x5b5420=_0x138bd0[_0xdb8a('0x2e')];var _0x458e8c=_0x40ffa6?0x0:_0x4578b3['offset'];var _0x3c189a=_0x40ffa6?_0x138bd0[_0xdb8a('0x2e')]:_0x4578b3[_0xdb8a('0x2f')]+_0x4578b3[_0xdb8a('0x30')];var _0x1e40b8;if(_0x3c189a>=_0x5b5420){_0x3c189a=_0x5b5420;_0x1e40b8=0xc8;}else{_0x1e40b8=0xce;}_0x493e2a[_0xdb8a('0x2c')](_0x1e40b8);return _0x493e2a[_0xdb8a('0x31')](_0xdb8a('0x32'),_0x458e8c+'-'+_0x3c189a+'/'+_0x5b5420)[_0xdb8a('0x33')](_0x138bd0);}return null;};}function patchUpdates(_0x44681f){return function(_0x2d72aa){try{jsonpatch[_0xdb8a('0x34')](_0x2d72aa,_0x44681f,!![]);}catch(_0x4d9ff5){return BPromise[_0xdb8a('0x35')](_0x4d9ff5);}return _0x2d72aa[_0xdb8a('0x36')]();};}function saveUpdates(_0x502e5b,_0x413cf7){return function(_0x2472f1){if(_0x2472f1){return _0x2472f1['update'](_0x502e5b)['then'](function(_0x260ec1){return _0x260ec1;});}return null;};}function removeEntity(_0x501b3b,_0x18a499){return function(_0x7ee931){if(_0x7ee931){return _0x7ee931[_0xdb8a('0x37')]()[_0xdb8a('0x38')](function(){_0x501b3b[_0xdb8a('0x2c')](0xcc)[_0xdb8a('0x39')]();});}};}function handleEntityNotFound(_0x376572,_0x5a6f6a){return function(_0x766f12){if(!_0x766f12){_0x376572['sendStatus'](0x194);}return _0x766f12;};}function handleError(_0x3d6afb,_0x2b2a5e){_0x2b2a5e=_0x2b2a5e||0x1f4;return function(_0x504ab2){logger[_0xdb8a('0x26')](_0x504ab2[_0xdb8a('0x3a')]);if(_0x504ab2[_0xdb8a('0x3b')]){delete _0x504ab2[_0xdb8a('0x3b')];}_0x3d6afb[_0xdb8a('0x2c')](_0x2b2a5e)[_0xdb8a('0x3c')](_0x504ab2);};}exports[_0xdb8a('0x3d')]=function(_0x487d0d,_0x5cf027){var _0x4593b6={},_0x39bb71={},_0x43e3ba={'count':0x0,'rows':[]};var _0x40c630=_[_0xdb8a('0x3e')](db[_0xdb8a('0x3f')][_0xdb8a('0x40')],function(_0x1a8731){return{'name':_0x1a8731[_0xdb8a('0x41')],'type':_0x1a8731[_0xdb8a('0x42')][_0xdb8a('0x43')]};});_0x39bb71['model']=_[_0xdb8a('0x3e')](_0x40c630,_0xdb8a('0x3b'));_0x39bb71[_0xdb8a('0x44')]=_[_0xdb8a('0x45')](_0x487d0d[_0xdb8a('0x44')]);_0x39bb71['filters']=_['intersection'](_0x39bb71[_0xdb8a('0x46')],_0x39bb71[_0xdb8a('0x44')]);_0x4593b6[_0xdb8a('0x47')]=_['intersection'](_0x39bb71[_0xdb8a('0x46')],qs[_0xdb8a('0x48')](_0x487d0d['query'][_0xdb8a('0x48')]));_0x4593b6[_0xdb8a('0x47')]=_0x4593b6[_0xdb8a('0x47')][_0xdb8a('0x49')]?_0x4593b6[_0xdb8a('0x47')]:_0x39bb71[_0xdb8a('0x46')];if(!_0x487d0d[_0xdb8a('0x44')][_0xdb8a('0x4a')](_0xdb8a('0x4b'))){_0x4593b6[_0xdb8a('0x30')]=qs[_0xdb8a('0x30')](_0x487d0d[_0xdb8a('0x44')]['limit']);_0x4593b6['offset']=qs[_0xdb8a('0x2f')](_0x487d0d[_0xdb8a('0x44')][_0xdb8a('0x2f')]);}_0x4593b6['order']=qs[_0xdb8a('0x4c')](_0x487d0d[_0xdb8a('0x44')][_0xdb8a('0x4c')]);_0x4593b6[_0xdb8a('0x4d')]=qs['filters'](_['pick'](_0x487d0d[_0xdb8a('0x44')],_0x39bb71[_0xdb8a('0x4e')]),_0x40c630);if(_0x487d0d[_0xdb8a('0x44')][_0xdb8a('0x4f')]){_0x4593b6['where']=_[_0xdb8a('0x50')](_0x4593b6[_0xdb8a('0x4d')],{'$or':_[_0xdb8a('0x3e')](_0x40c630,function(_0x529803){if(_0x529803[_0xdb8a('0x42')]!==_0xdb8a('0x51')){var _0x50aaa0={};_0x50aaa0[_0x529803[_0xdb8a('0x3b')]]={'$like':'%'+_0x487d0d['query'][_0xdb8a('0x4f')]+'%'};return _0x50aaa0;}})});}_0x4593b6=_['merge']({},_0x4593b6,_0x487d0d['options']);var _0x2953c7={'where':_0x4593b6[_0xdb8a('0x4d')]};return db['WhatsappMessage'][_0xdb8a('0x2e')](_0x2953c7)[_0xdb8a('0x38')](function(_0x28bed6){_0x43e3ba[_0xdb8a('0x2e')]=_0x28bed6;if(_0x487d0d[_0xdb8a('0x44')][_0xdb8a('0x52')]){_0x4593b6[_0xdb8a('0x53')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x4593b6);})['then'](function(_0xe9a877){_0x43e3ba[_0xdb8a('0x54')]=_0xe9a877;return _0x43e3ba;})[_0xdb8a('0x38')](respondWithFilteredResult(_0x5cf027,_0x4593b6))[_0xdb8a('0x2a')](handleError(_0x5cf027,null));};exports[_0xdb8a('0x55')]=function(_0x32c4d2,_0x35166c){var _0x3d689d={'raw':!![],'where':{'id':_0x32c4d2[_0xdb8a('0x56')]['id']}},_0x355430={};_0x355430['model']=_[_0xdb8a('0x45')](db['WhatsappMessage'][_0xdb8a('0x40')]);_0x355430['query']=_[_0xdb8a('0x45')](_0x32c4d2[_0xdb8a('0x44')]);_0x355430[_0xdb8a('0x4e')]=_[_0xdb8a('0x57')](_0x355430['model'],_0x355430[_0xdb8a('0x44')]);_0x3d689d[_0xdb8a('0x47')]=_[_0xdb8a('0x57')](_0x355430[_0xdb8a('0x46')],qs[_0xdb8a('0x48')](_0x32c4d2[_0xdb8a('0x44')][_0xdb8a('0x48')]));_0x3d689d['attributes']=_0x3d689d[_0xdb8a('0x47')]['length']?_0x3d689d[_0xdb8a('0x47')]:_0x355430[_0xdb8a('0x46')];if(_0x32c4d2[_0xdb8a('0x44')][_0xdb8a('0x52')]){_0x3d689d[_0xdb8a('0x53')]=[{'all':!![]}];}_0x3d689d=_[_0xdb8a('0x50')]({},_0x3d689d,_0x32c4d2[_0xdb8a('0x58')]);return db[_0xdb8a('0x3f')][_0xdb8a('0x59')](_0x3d689d)[_0xdb8a('0x38')](handleEntityNotFound(_0x35166c,null))[_0xdb8a('0x38')](respondWithResult(_0x35166c,null))[_0xdb8a('0x2a')](handleError(_0x35166c,null));};exports[_0xdb8a('0x5a')]=function(_0x94192a,_0x10cd5a){return db[_0xdb8a('0x3f')][_0xdb8a('0x5a')](_0x94192a[_0xdb8a('0x5b')],{})[_0xdb8a('0x38')](respondWithResult(_0x10cd5a,0xc9))[_0xdb8a('0x2a')](handleError(_0x10cd5a,null));};exports[_0xdb8a('0x5c')]=function(_0x2f92dd,_0x29bb2c){if(_0x2f92dd[_0xdb8a('0x5b')]['id']){delete _0x2f92dd['body']['id'];}return db[_0xdb8a('0x3f')][_0xdb8a('0x59')]({'where':{'id':_0x2f92dd[_0xdb8a('0x56')]['id']}})['then'](handleEntityNotFound(_0x29bb2c,null))[_0xdb8a('0x38')](saveUpdates(_0x2f92dd['body'],null))['then'](respondWithResult(_0x29bb2c,null))[_0xdb8a('0x2a')](handleError(_0x29bb2c,null));};exports['destroy']=function(_0x2e6ae0,_0x45edbc){return db[_0xdb8a('0x3f')][_0xdb8a('0x59')]({'where':{'id':_0x2e6ae0[_0xdb8a('0x56')]['id']}})[_0xdb8a('0x38')](handleEntityNotFound(_0x45edbc,null))[_0xdb8a('0x38')](removeEntity(_0x45edbc,null))[_0xdb8a('0x2a')](handleError(_0x45edbc,null));};exports[_0xdb8a('0x5d')]=function(_0x120405,_0x139234){return db['WhatsappMessage'][_0xdb8a('0x5d')]()[_0xdb8a('0x38')](respondWithResult(_0x139234,null))[_0xdb8a('0x2a')](handleError(_0x139234,null));};var interaction_log=require(_0xdb8a('0x13'))(_0xdb8a('0x5e'));exports[_0xdb8a('0x5f')]=function(_0x49bab2,_0x483dfe,_0x56bc24){var _0x253edb={'agent':{},'channel':_0xdb8a('0x60')};if(_0x49bab2[_0xdb8a('0x5b')]['id']){delete _0x49bab2[_0xdb8a('0x5b')]['id'];}_0x49bab2[_0xdb8a('0x5b')][_0xdb8a('0x61')]=!![];_0x49bab2[_0xdb8a('0x5b')][_0xdb8a('0x62')]=moment()[_0xdb8a('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x49bab2[_0xdb8a('0x5b')]['UserId']=_0x49bab2['body'][_0xdb8a('0x64')]||_0x49bab2[_0xdb8a('0x65')]['id'];_0x253edb[_0xdb8a('0x66')]['id']=_0x49bab2[_0xdb8a('0x5b')][_0xdb8a('0x64')];return db[_0xdb8a('0x3f')]['find']({'where':{'id':_0x49bab2['params']['id'],'UserId':null}})[_0xdb8a('0x38')](handleEntityNotFound(_0x483dfe,null))[_0xdb8a('0x38')](saveUpdates(_0x49bab2['body'],null))[_0xdb8a('0x38')](function(_0x45fcff){if(_0x45fcff){_0x253edb[_0xdb8a('0x29')]=_0x45fcff[_0xdb8a('0x67')]({'plain':!![]});return db['WhatsappInteraction'][_0xdb8a('0x59')]({'where':{'id':_0x45fcff[_0xdb8a('0x68')]}});}return null;})[_0xdb8a('0x38')](handleEntityNotFound(_0x483dfe,null))[_0xdb8a('0x38')](function(_0x3bd3ea){if(_0x3bd3ea){return _0x3bd3ea[_0xdb8a('0x5c')]({'UserId':_0x49bab2[_0xdb8a('0x5b')][_0xdb8a('0x64')],'read1stAt':_['isNil'](_0x3bd3ea[_0xdb8a('0x69')])?moment()[_0xdb8a('0x63')](_0xdb8a('0x6a')):undefined});}return null;})[_0xdb8a('0x38')](function(_0x2134e7){if(_0x2134e7){_0x253edb['interaction']=_0x2134e7[_0xdb8a('0x67')]({'plain':!![]});interaction_log[_0xdb8a('0x22')](_0xdb8a('0x6b'),_0x49bab2[_0xdb8a('0x65')]['id'],_0x49bab2[_0xdb8a('0x65')][_0xdb8a('0x3b')],_0x49bab2[_0xdb8a('0x65')][_0xdb8a('0x6c')],_0x253edb['interaction']['id'],_0x49bab2[_0xdb8a('0x5b')]?JSON[_0xdb8a('0x25')](_0x49bab2[_0xdb8a('0x5b')]):_0xdb8a('0x6d'));return respondWithRpcPromise(_0xdb8a('0x6e'),_0xdb8a('0x6f'),_0x253edb);}return null;})[_0xdb8a('0x38')](function(_0x9ca8da){var _0x1759e5=_0xdb8a('0x70')+_0x9ca8da[_0xdb8a('0x29')]['ContactId'];return db[_0xdb8a('0x71')][_0xdb8a('0x44')](_0x1759e5,{'type':db[_0xdb8a('0x72')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x1c9125){return _0x1c9125;});})[_0xdb8a('0x38')](function(_0x4fa1df){if(_0x4fa1df){_0x253edb[_0xdb8a('0x29')]['contact']=_0x4fa1df[0x0];if(!_0x49bab2[_0xdb8a('0x5b')][_0xdb8a('0x64')])return;return db[_0xdb8a('0x73')][_0xdb8a('0x59')]({'where':{'id':_0x49bab2['body'][_0xdb8a('0x64')],'role':'agent'},'attributes':['id','name','fullname',_0xdb8a('0x74'),_0xdb8a('0x75')],'raw':!![]});}return null;})[_0xdb8a('0x38')](function(_0x55659f){if(!_0x55659f)return null;_0x253edb[_0xdb8a('0x29')]['agent']=_0x55659f;return _0x253edb;})[_0xdb8a('0x38')](function(_0x567048){if(_0x567048){if(_0x49bab2['body']['manual']){_0x253edb[_0xdb8a('0x29')]['interface']=util[_0xdb8a('0x63')](_0xdb8a('0x76'),_0x49bab2[_0xdb8a('0x65')][_0xdb8a('0x3b')]);_0x253edb[_0xdb8a('0x29')]['channel']=_0x253edb[_0xdb8a('0x77')];_0x253edb[_0xdb8a('0x29')][_0xdb8a('0x78')]=_0x253edb[_0xdb8a('0x77')];_0x253edb['message'][_0xdb8a('0x79')]=_0xdb8a('0x5f');return respondWithRpcPromise(_0xdb8a('0x7a'),_0xdb8a('0x7a'),{'event':_0xdb8a('0x7b'),'message':_0x253edb[_0xdb8a('0x29')]},client9002)['then'](function(){return _0x253edb;});}return _0x253edb;}return null;})[_0xdb8a('0x38')](respondWithResult(_0x483dfe,null))['catch'](handleError(_0x483dfe,null));};var interaction_log=require(_0xdb8a('0x13'))(_0xdb8a('0x5e'));exports[_0xdb8a('0x35')]=function(_0x3f5145,_0x206418,_0x3e8e42){var _0x18be19={'agent':{},'channel':_0xdb8a('0x60')};if(_0x3f5145[_0xdb8a('0x5b')]['id']){delete _0x3f5145[_0xdb8a('0x5b')]['id'];}_0x3f5145[_0xdb8a('0x5b')]['UserId']=_0x3f5145[_0xdb8a('0x5b')][_0xdb8a('0x64')]||_0x3f5145['user']['id'];_0x18be19[_0xdb8a('0x66')]['id']=_0x3f5145[_0xdb8a('0x5b')]['UserId'];return db[_0xdb8a('0x3f')][_0xdb8a('0x59')]({'where':{'id':_0x3f5145[_0xdb8a('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x206418,null))[_0xdb8a('0x38')](function(_0x451bcc){if(_0x451bcc){_0x18be19[_0xdb8a('0x29')]=_0x451bcc[_0xdb8a('0x67')]({'plain':!![]});return db[_0xdb8a('0x7c')]['find']({'where':{'id':_0x451bcc[_0xdb8a('0x68')]}});}return null;})[_0xdb8a('0x38')](handleEntityNotFound(_0x206418,null))[_0xdb8a('0x38')](function(_0x479980){if(_0x479980){_0x18be19[_0xdb8a('0x7d')]=_0x479980[_0xdb8a('0x67')]({'plain':!![]});interaction_log[_0xdb8a('0x22')](_0xdb8a('0x7e'),_0x3f5145['user']['id'],_0x3f5145['user'][_0xdb8a('0x3b')],_0x3f5145['user'][_0xdb8a('0x6c')],_0x18be19['interaction']['id'],_0x3f5145[_0xdb8a('0x5b')]?JSON['stringify'](_0x3f5145[_0xdb8a('0x5b')]):'null');return respondWithRpcPromise(_0xdb8a('0x7f'),_0xdb8a('0x80'),_0x18be19);}return null;})[_0xdb8a('0x38')](function(_0x3bef3b){var _0xc306ae=_0xdb8a('0x70')+_0x3bef3b[_0xdb8a('0x29')][_0xdb8a('0x81')];return db[_0xdb8a('0x71')]['query'](_0xc306ae,{'type':db['Sequelize'][_0xdb8a('0x82')][_0xdb8a('0x83')],'raw':!![]})[_0xdb8a('0x38')](function(_0x560c64){return _0x560c64;});})[_0xdb8a('0x38')](function(_0x56e3b3){if(_0x56e3b3){_0x18be19[_0xdb8a('0x29')][_0xdb8a('0x84')]=_0x56e3b3[0x0];if(!_0x3f5145[_0xdb8a('0x5b')]['UserId'])return;return db[_0xdb8a('0x73')][_0xdb8a('0x59')]({'where':{'id':_0x3f5145[_0xdb8a('0x5b')][_0xdb8a('0x64')],'role':_0xdb8a('0x66')},'attributes':['id',_0xdb8a('0x3b'),_0xdb8a('0x85'),_0xdb8a('0x74'),_0xdb8a('0x75')],'raw':!![]});}return null;})[_0xdb8a('0x38')](function(_0x459ef0){if(!_0x459ef0)return null;_0x18be19['message'][_0xdb8a('0x66')]=_0x459ef0;return _0x18be19;})[_0xdb8a('0x38')](function(_0x2bce13){if(_0x2bce13){_0x2bce13[_0xdb8a('0x29')][_0xdb8a('0x86')]=util[_0xdb8a('0x63')]('SIP/%s',_0x3f5145[_0xdb8a('0x65')][_0xdb8a('0x3b')]);_0x2bce13[_0xdb8a('0x29')]['channel']=_0x18be19[_0xdb8a('0x77')];_0x2bce13['message'][_0xdb8a('0x78')]=_0x18be19[_0xdb8a('0x77')];_0x2bce13[_0xdb8a('0x29')][_0xdb8a('0x79')]=_0xdb8a('0x35');respondWithRpcPromise('EventManager',_0xdb8a('0x7a'),{'event':_0xdb8a('0x87'),'message':_0x2bce13['message']},client9002);return _0x18be19;}return null;})[_0xdb8a('0x38')](respondWithResult(_0x206418,null))[_0xdb8a('0x2a')](handleError(_0x206418,null));};exports['status']=function(_0x455130,_0x38e3c4,_0x362b2f){if(_0x455130[_0xdb8a('0x5b')]['id']){delete _0x455130[_0xdb8a('0x5b')]['id'];}var _0x5df166;return db[_0xdb8a('0x3f')][_0xdb8a('0x59')]({'where':{'id':_0x455130[_0xdb8a('0x56')]['id']}})['then'](handleEntityNotFound(_0x38e3c4,null))[_0xdb8a('0x38')](function(_0x42f894){if(_0x42f894){_0x5df166=_0x42f894;return db[_0xdb8a('0x88')][_0xdb8a('0x59')]({'where':{'id':_0x42f894[_0xdb8a('0x89')]}});}})['then'](handleEntityNotFound(_0x38e3c4,null))[_0xdb8a('0x38')](function(_0x4e2e0d){if(_0x4e2e0d){logger[_0xdb8a('0x8a')](_0xdb8a('0x8b'),_0xdb8a('0x2c'),_0xdb8a('0x8c'),_0x4e2e0d['type'],util[_0xdb8a('0x8d')](_0x455130[_0xdb8a('0x5b')],{'showHidden':![],'depth':null}));switch(_0x4e2e0d[_0xdb8a('0x42')]){case _0xdb8a('0x8e'):if(_0x455130['body'][_0xdb8a('0x8f')]&&_0x455130[_0xdb8a('0x5b')][_0xdb8a('0x8f')]===_0x5df166[_0xdb8a('0x90')]&&_0x455130[_0xdb8a('0x5b')][_0xdb8a('0x91')]&&_0x455130['body'][_0xdb8a('0x91')]==='read'){return _0x5df166[_0xdb8a('0x5c')]({'read':!![]});}else{logger['error'](_0xdb8a('0x92'),_0xdb8a('0x2c'),_0xdb8a('0x8e'),util[_0xdb8a('0x8d')](_0x455130[_0xdb8a('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x5df166;}})[_0xdb8a('0x38')](respondWithResult(_0x38e3c4,null))[_0xdb8a('0x2a')](handleError(_0x38e3c4,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 6c518a2..cafa29b 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf66=['exports','events','../../mysqldb','WhatsappMessage','save','update','emit','hasOwnProperty'];(function(_0xfc20c6,_0x253ca8){var _0x22b171=function(_0x57c168){while(--_0x57c168){_0xfc20c6['push'](_0xfc20c6['shift']());}};_0x22b171(++_0x253ca8);}(_0xcf66,0x71));var _0x6cf6=function(_0xee0a87,_0xe4d0a0){_0xee0a87=_0xee0a87-0x0;var _0x336acb=_0xcf66[_0xee0a87];return _0x336acb;};'use strict';var EventEmitter=require(_0x6cf6('0x0'));var WhatsappMessage=require(_0x6cf6('0x1'))['db'][_0x6cf6('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6cf6('0x3'),'afterUpdate':_0x6cf6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4e16eb){return function(_0x1c599d,_0x45d0d8,_0x57f22f){WhatsappMessageEvents[_0x6cf6('0x5')](_0x4e16eb+':'+_0x1c599d['id'],_0x1c599d);WhatsappMessageEvents[_0x6cf6('0x5')](_0x4e16eb,_0x1c599d);_0x57f22f(null);};}for(var e in events){if(events[_0x6cf6('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x6cf6('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x9e6b=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x39d473,_0x473ba4){var _0x3b016e=function(_0x422a17){while(--_0x422a17){_0x39d473['push'](_0x39d473['shift']());}};_0x3b016e(++_0x473ba4);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9e6b[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0xb9e6('0x0'));var WhatsappMessage=require(_0xb9e6('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb9e6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb9e6('0x3')};function emitEvent(_0x6fcb00){return function(_0xb74c07,_0x214661,_0x47fc84){WhatsappMessageEvents[_0xb9e6('0x4')](_0x6fcb00+':'+_0xb74c07['id'],_0xb74c07);WhatsappMessageEvents[_0xb9e6('0x4')](_0x6fcb00,_0xb74c07);_0x47fc84(null);};}for(var e in events){if(events[_0xb9e6('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xb9e6('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 683e42b..d384194 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd26d=['create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','text','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','then','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone'];(function(_0x2beb54,_0x8483b6){var _0x3e5a22=function(_0x1712fe){while(--_0x1712fe){_0x2beb54['push'](_0x2beb54['shift']());}};_0x3e5a22(++_0x8483b6);}(_0xd26d,0x108));var _0xdd26=function(_0x219729,_0x19f07d){_0x219729=_0x219729-0x0;var _0x35c464=_0xd26d[_0x219729];return _0x35c464;};'use strict';var _=require('lodash');var util=require(_0xdd26('0x0'));var logger=require(_0xdd26('0x1'))(_0xdd26('0x2'));var moment=require(_0xdd26('0x3'));var BPromise=require(_0xdd26('0x4'));var rp=require(_0xdd26('0x5'));var fetch=require(_0xdd26('0x6'));var fs=require('fs');var path=require(_0xdd26('0x7'));var rimraf=require('rimraf');var config=require(_0xdd26('0x8'));var attributes=require(_0xdd26('0x9'));module[_0xdd26('0xa')]=function(_0x412c84,_0x199761){return _0x412c84[_0xdd26('0xb')](_0xdd26('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xdd26('0xd'),'fields':[_0xdd26('0xd')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0xdd26('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x144296,_0x28b84c,_0x4c5db3){var _0x995a46=_0x412c84[_0xdd26('0xf')];var _0x5f19f4=_0x144296[_0xdd26('0x10')]({'plain':!![]});if(_0x5f19f4[_0xdd26('0x11')][_0xdd26('0x12')]()==='in'||_0x5f19f4[_0xdd26('0x11')]['toLowerCase']()===_0xdd26('0x13')&&!_0x5f19f4[_0xdd26('0x14')]&&!_[_0xdd26('0x15')](_0x5f19f4[_0xdd26('0x16')])){_0x995a46[_0xdd26('0x17')]['findOne']({'where':{'id':_0x5f19f4['WhatsappInteractionId']}})[_0xdd26('0x18')](function(_0x292348){if(_0x292348){_0x292348[_0xdd26('0x19')]({'lastMsgAt':_0x5f19f4[_0xdd26('0x1a')],'lastMsgDirection':_0x5f19f4[_0xdd26('0x11')][_0xdd26('0x12')]()});}})['catch'](function(_0x4af4f3){console[_0xdd26('0x1b')](_0x4af4f3);});}if(_0x5f19f4[_0xdd26('0x11')]===_0xdd26('0x13')&&!_0x5f19f4[_0xdd26('0x14')]){var _0x56d41b;_0x995a46[_0xdd26('0x1c')][_0xdd26('0x1d')]({'where':{'id':_0x5f19f4[_0xdd26('0x1e')]},'raw':!![]})[_0xdd26('0x18')](function(_0x123798){_0x56d41b=_0x123798;if(_0x56d41b&&_0x56d41b[_0xdd26('0x1f')]){switch(_0x56d41b['type']){case _0xdd26('0x20'):var _0x3bbd3a=require(_0xdd26('0x20'));if(_0x56d41b[_0xdd26('0x21')]&&_0x56d41b[_0xdd26('0x22')]&&_0x56d41b[_0xdd26('0x23')]){var _0x41bbfb=new _0x3bbd3a(_0x56d41b[_0xdd26('0x21')],_0x56d41b[_0xdd26('0x22')]);_0x41bbfb['messages'][_0xdd26('0x24')]({'body':_0x5f19f4[_0xdd26('0x25')],'to':_0xdd26('0x26')+_0x5f19f4[_0xdd26('0x23')],'from':_0xdd26('0x26')+_0x56d41b['phone'],'statusCallback':_0x56d41b[_0xdd26('0x27')]+_0xdd26('0x28')+_0x5f19f4['id']+_0xdd26('0x29')+_0x56d41b[_0xdd26('0x2a')]})[_0xdd26('0x18')](function(_0x480505){if(_0x480505['sid']){return _0x144296[_0xdd26('0x19')]({'messageId':_0x480505[_0xdd26('0x2b')]});}})[_0xdd26('0x2c')](function(_0x1ac71e){logger[_0xdd26('0x1b')](_0xdd26('0x2d'),'afterCreate',_0xdd26('0x20'),util[_0xdd26('0x2e')](_0x1ac71e,{'showHidden':![],'depth':null}));});}else{logger[_0xdd26('0x1b')](_0xdd26('0x2d'),_0xdd26('0x2f'),_0xdd26('0x20'),_0xdd26('0x30'));}break;case _0xdd26('0x31'):var _0x26726b=_0x56d41b[_0xdd26('0x21')];var _0x5c56da=_0x56d41b[_0xdd26('0x22')];var _0xf94fb7=_0x56d41b[_0xdd26('0x32')]+'/whatsapp/v1/'+_0x26726b+_0xdd26('0x33');var _0x421fe5={'to':[_0x5f19f4[_0xdd26('0x23')]],'message':{'type':_0xdd26('0x34'),'text':_0x5f19f4['body']}};var _0x44da2e={'method':'POST','uri':_0xf94fb7,'headers':{'Authorization':_0xdd26('0x35')+_0x5c56da,'Content-Type':'application/json'},'body':_0x421fe5,'json':!![]};rp(_0x44da2e)['then'](function(_0x16135a){if(_0x16135a[_0xdd26('0x36')][0x0][_0xdd26('0x37')]){return _0x144296[_0xdd26('0x19')]({'messageId':_0x16135a[_0xdd26('0x36')][0x0][_0xdd26('0x37')]});}})[_0xdd26('0x2c')](function(_0x56c45f){logger[_0xdd26('0x38')](_0xdd26('0x39'),_0x56c45f);});break;}}})[_0xdd26('0x3a')](function(){_0x4c5db3();});}else{_0x4c5db3();}}},'charset':'utf8mb4','collate':_0xdd26('0x3b')});}; \ No newline at end of file +var _0xf278=['WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','util','../../config/logger','api','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid'];(function(_0x27773e,_0x1fb5bd){var _0x24895c=function(_0x2c240d){while(--_0x2c240d){_0x27773e['push'](_0x27773e['shift']());}};_0x24895c(++_0x1fb5bd);}(_0xf278,0xc8));var _0x8f27=function(_0xb89931,_0x461b9e){_0xb89931=_0xb89931-0x0;var _0x324b86=_0xf278[_0xb89931];return _0x324b86;};'use strict';var _=require(_0x8f27('0x0'));var util=require(_0x8f27('0x1'));var logger=require(_0x8f27('0x2'))(_0x8f27('0x3'));var moment=require('moment');var BPromise=require(_0x8f27('0x4'));var rp=require('request-promise');var fetch=require(_0x8f27('0x5'));var fs=require('fs');var path=require(_0x8f27('0x6'));var rimraf=require(_0x8f27('0x7'));var config=require(_0x8f27('0x8'));var attributes=require(_0x8f27('0x9'));module['exports']=function(_0x22fd26,_0x4bc2f0){return _0x22fd26[_0x8f27('0xa')]('WhatsappMessage',attributes,{'tableName':_0x8f27('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x8f27('0xc'),'fields':[_0x8f27('0xd')],'type':_0x8f27('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b5862,_0x14d0f7,_0x43a06f){var _0x1a7f9e=_0x22fd26['models'];var _0x48a8a8=_0x1b5862[_0x8f27('0xf')]({'plain':!![]});if(_0x48a8a8[_0x8f27('0x10')][_0x8f27('0x11')]()==='in'||_0x48a8a8[_0x8f27('0x10')]['toLowerCase']()===_0x8f27('0x12')&&!_0x48a8a8[_0x8f27('0x13')]&&!_[_0x8f27('0x14')](_0x48a8a8[_0x8f27('0x15')])){_0x1a7f9e[_0x8f27('0x16')][_0x8f27('0x17')]({'where':{'id':_0x48a8a8[_0x8f27('0x18')]}})[_0x8f27('0x19')](function(_0x1802ee){if(_0x1802ee){_0x1802ee[_0x8f27('0x1a')]({'lastMsgAt':_0x48a8a8['createdAt'],'lastMsgDirection':_0x48a8a8[_0x8f27('0x10')]['toLowerCase']()});}})[_0x8f27('0x1b')](function(_0x59c3ca){console[_0x8f27('0x1c')](_0x59c3ca);});}if(_0x48a8a8[_0x8f27('0x10')]==='out'&&!_0x48a8a8['secret']){var _0x264ad9;_0x1a7f9e[_0x8f27('0x1d')][_0x8f27('0x1e')]({'where':{'id':_0x48a8a8[_0x8f27('0x1f')]},'raw':!![]})[_0x8f27('0x19')](function(_0x1cc3ef){_0x264ad9=_0x1cc3ef;if(_0x264ad9&&_0x264ad9[_0x8f27('0x20')]){switch(_0x264ad9[_0x8f27('0x20')]){case'twilio':var _0x58d025=require(_0x8f27('0x21'));if(_0x264ad9[_0x8f27('0x22')]&&_0x264ad9[_0x8f27('0x23')]&&_0x264ad9[_0x8f27('0x24')]){var _0x20ab89=new _0x58d025(_0x264ad9[_0x8f27('0x22')],_0x264ad9[_0x8f27('0x23')]);_0x20ab89[_0x8f27('0x25')][_0x8f27('0x26')]({'body':_0x48a8a8[_0x8f27('0xd')],'to':_0x8f27('0x27')+_0x48a8a8[_0x8f27('0x24')],'from':_0x8f27('0x27')+_0x264ad9[_0x8f27('0x24')],'statusCallback':_0x264ad9[_0x8f27('0x28')]+_0x8f27('0x29')+_0x48a8a8['id']+'/status?token='+_0x264ad9[_0x8f27('0x2a')]})[_0x8f27('0x19')](function(_0x5b6114){if(_0x5b6114[_0x8f27('0x2b')]){return _0x1b5862[_0x8f27('0x1a')]({'messageId':_0x5b6114[_0x8f27('0x2b')]});}})['catch'](function(_0x364167){logger['error'](_0x8f27('0x2c'),_0x8f27('0x2d'),_0x8f27('0x21'),util[_0x8f27('0x2e')](_0x364167,{'showHidden':![],'depth':null}));});}else{logger[_0x8f27('0x1c')](_0x8f27('0x2c'),_0x8f27('0x2d'),'twilio',_0x8f27('0x2f'));}break;case _0x8f27('0x30'):var _0x37ed8a=_0x264ad9['accountSid'];var _0x9773e2=_0x264ad9[_0x8f27('0x23')];var _0x54936a=_0x264ad9[_0x8f27('0x31')]+_0x8f27('0x32')+_0x37ed8a+_0x8f27('0x33');var _0x2dca43={'to':[_0x48a8a8[_0x8f27('0x24')]],'message':{'type':'text','text':_0x48a8a8[_0x8f27('0xd')]}};var _0x113711={'method':_0x8f27('0x34'),'uri':_0x54936a,'headers':{'Authorization':_0x8f27('0x35')+_0x9773e2,'Content-Type':_0x8f27('0x36')},'body':_0x2dca43,'json':!![]};rp(_0x113711)[_0x8f27('0x19')](function(_0x2081d5){if(_0x2081d5[_0x8f27('0x37')][0x0][_0x8f27('0x38')]){return _0x1b5862[_0x8f27('0x1a')]({'messageId':_0x2081d5[_0x8f27('0x37')][0x0]['message_id']});}})[_0x8f27('0x1b')](function(_0x28bb19){logger[_0x8f27('0x39')](_0x8f27('0x3a'),_0x28bb19);});break;}}})[_0x8f27('0x3b')](function(){_0x43a06f();});}else{_0x43a06f();}}},'charset':_0x8f27('0x3c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index e756eb1..620cc31 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ce7=['socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappMessage','create','body','options','raw','CreateWhatsappMessage','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5ce7,0x148));var _0x75ce=function(_0x2f888d,_0x597d3c){_0x2f888d=_0x2f888d-0x0;var _0x40f285=_0x5ce7[_0x2f888d];return _0x40f285;};'use strict';var _=require(_0x75ce('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x75ce('0x1'));var rs=require(_0x75ce('0x2'));var fs=require('fs');var Redis=require(_0x75ce('0x3'));var db=require(_0x75ce('0x4'))['db'];var utils=require(_0x75ce('0x5'));var logger=require('../../config/logger')(_0x75ce('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x75ce('0x7')][_0x75ce('0x8')]({'port':0x232a});config[_0x75ce('0x9')]=_[_0x75ce('0xa')](config['redis'],{'host':_0x75ce('0xb'),'port':0x18eb});var socket=require(_0x75ce('0xc'))(new Redis(config[_0x75ce('0x9')]));require(_0x75ce('0xd'))[_0x75ce('0xe')](socket);function respondWithRpcPromise(_0x9846bd,_0x318b68,_0x4147a9){return new BPromise(function(_0x907362,_0x4363f1){return client[_0x75ce('0xf')](_0x9846bd,_0x4147a9)[_0x75ce('0x10')](function(_0x47e9b1){logger[_0x75ce('0x11')](_0x75ce('0x12'),_0x318b68,_0x75ce('0x13'));logger[_0x75ce('0x14')](_0x75ce('0x15'),_0x318b68,_0x75ce('0x13'),JSON[_0x75ce('0x16')](_0x47e9b1));if(_0x47e9b1[_0x75ce('0x17')]){if(_0x47e9b1[_0x75ce('0x17')][_0x75ce('0x18')]===0x1f4){logger[_0x75ce('0x17')](_0x75ce('0x12'),_0x318b68,_0x47e9b1[_0x75ce('0x17')]['message']);return _0x4363f1(_0x47e9b1[_0x75ce('0x17')][_0x75ce('0x19')]);}logger['error'](_0x75ce('0x12'),_0x318b68,_0x47e9b1['error'][_0x75ce('0x19')]);return _0x907362(_0x47e9b1['error'][_0x75ce('0x19')]);}else{logger[_0x75ce('0x11')](_0x75ce('0x12'),_0x318b68,'request\x20sent');_0x907362(_0x47e9b1[_0x75ce('0x1a')]['message']);}})[_0x75ce('0x1b')](function(_0x1251e6){logger[_0x75ce('0x17')](_0x75ce('0x12'),_0x318b68,_0x1251e6);_0x4363f1(_0x1251e6);});});}exports['CreateWhatsappMessage']=function(_0x1d4c83){var _0x3d6384=this;return new Promise(function(_0x37ede4,_0x1d2e31){return db[_0x75ce('0x1c')][_0x75ce('0x1d')](_0x1d4c83[_0x75ce('0x1e')],{'raw':_0x1d4c83['options']?_0x1d4c83[_0x75ce('0x1f')][_0x75ce('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x4fd576){logger[_0x75ce('0x11')](_0x75ce('0x21'),_0x1d4c83);logger[_0x75ce('0x14')]('CreateWhatsappMessage',_0x1d4c83,JSON[_0x75ce('0x16')](_0x4fd576));_0x37ede4(_0x4fd576);})['catch'](function(_0x181b82){logger[_0x75ce('0x17')](_0x75ce('0x21'),_0x181b82['message'],_0x1d4c83);_0x1d2e31(_0x3d6384['error'](0x1f4,_0x181b82[_0x75ce('0x19')]));});});}; \ No newline at end of file +var _0x0b6e=['CreateWhatsappMessage','WhatsappMessage','body','options','raw','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2cb5ca,_0x653e5b){var _0x179732=function(_0x17af40){while(--_0x17af40){_0x2cb5ca['push'](_0x2cb5ca['shift']());}};_0x179732(++_0x653e5b);}(_0x0b6e,0xa6));var _0xe0b6=function(_0x1269a0,_0x4c3241){_0x1269a0=_0x1269a0-0x0;var _0x41d41f=_0x0b6e[_0x1269a0];return _0x41d41f;};'use strict';var _=require(_0xe0b6('0x0'));var util=require(_0xe0b6('0x1'));var moment=require('moment');var BPromise=require(_0xe0b6('0x2'));var rs=require(_0xe0b6('0x3'));var fs=require('fs');var Redis=require(_0xe0b6('0x4'));var db=require(_0xe0b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0b6('0x6'))(_0xe0b6('0x7'));var config=require(_0xe0b6('0x8'));var jayson=require(_0xe0b6('0x9'));var client=jayson[_0xe0b6('0xa')][_0xe0b6('0xb')]({'port':0x232a});config[_0xe0b6('0xc')]=_['defaults'](config[_0xe0b6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0b6('0xd'))(new Redis(config[_0xe0b6('0xc')]));require('./whatsappMessage.socket')[_0xe0b6('0xe')](socket);function respondWithRpcPromise(_0x1eeeb9,_0x813ff8,_0x296275){return new BPromise(function(_0x41a303,_0x3d964e){return client[_0xe0b6('0xf')](_0x1eeeb9,_0x296275)['then'](function(_0x5837d4){logger[_0xe0b6('0x10')](_0xe0b6('0x11'),_0x813ff8,_0xe0b6('0x12'));logger[_0xe0b6('0x13')](_0xe0b6('0x14'),_0x813ff8,'request\x20sent',JSON[_0xe0b6('0x15')](_0x5837d4));if(_0x5837d4[_0xe0b6('0x16')]){if(_0x5837d4[_0xe0b6('0x16')][_0xe0b6('0x17')]===0x1f4){logger[_0xe0b6('0x16')](_0xe0b6('0x11'),_0x813ff8,_0x5837d4[_0xe0b6('0x16')][_0xe0b6('0x18')]);return _0x3d964e(_0x5837d4[_0xe0b6('0x16')][_0xe0b6('0x18')]);}logger['error'](_0xe0b6('0x11'),_0x813ff8,_0x5837d4[_0xe0b6('0x16')][_0xe0b6('0x18')]);return _0x41a303(_0x5837d4[_0xe0b6('0x16')][_0xe0b6('0x18')]);}else{logger[_0xe0b6('0x10')](_0xe0b6('0x11'),_0x813ff8,_0xe0b6('0x12'));_0x41a303(_0x5837d4['result']['message']);}})[_0xe0b6('0x19')](function(_0x423b98){logger[_0xe0b6('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x813ff8,_0x423b98);_0x3d964e(_0x423b98);});});}exports[_0xe0b6('0x1a')]=function(_0x2a6ed3){var _0x5ef0e2=this;return new Promise(function(_0x32267a,_0x430267){return db[_0xe0b6('0x1b')]['create'](_0x2a6ed3[_0xe0b6('0x1c')],{'raw':_0x2a6ed3[_0xe0b6('0x1d')]?_0x2a6ed3['options'][_0xe0b6('0x1e')]===undefined?!![]:![]:!![]})[_0xe0b6('0x1f')](function(_0x3683b4){logger[_0xe0b6('0x10')](_0xe0b6('0x1a'),_0x2a6ed3);logger[_0xe0b6('0x13')](_0xe0b6('0x1a'),_0x2a6ed3,JSON[_0xe0b6('0x15')](_0x3683b4));_0x32267a(_0x3683b4);})[_0xe0b6('0x19')](function(_0x34cc59){logger[_0xe0b6('0x16')](_0xe0b6('0x1a'),_0x34cc59[_0xe0b6('0x18')],_0x2a6ed3);_0x430267(_0x5ef0e2[_0xe0b6('0x16')](0x1f4,_0x34cc59[_0xe0b6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index d0fd77d..4da1ee4 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x818b=['./whatsappMessage.events','save','update','emit','length','whatsappMessage:'];(function(_0x4a735c,_0x34fe01){var _0x258c88=function(_0x3336ec){while(--_0x3336ec){_0x4a735c['push'](_0x4a735c['shift']());}};_0x258c88(++_0x34fe01);}(_0x818b,0x1c2));var _0xb818=function(_0x3b45e4,_0x329893){_0x3b45e4=_0x3b45e4-0x0;var _0x502b9d=_0x818b[_0x3b45e4];return _0x502b9d;};'use strict';var WhatsappMessageEvents=require(_0xb818('0x0'));var events=[_0xb818('0x1'),'remove',_0xb818('0x2')];function createListener(_0x3dac0c,_0x4285a0){return function(_0x430bc1){_0x4285a0[_0xb818('0x3')](_0x3dac0c,_0x430bc1);};}function removeListener(_0x20b587,_0x36e35d){return function(){WhatsappMessageEvents['removeListener'](_0x20b587,_0x36e35d);};}exports['register']=function(_0x3e52df){for(var _0xc55e35=0x0,_0x4a807f=events[_0xb818('0x4')];_0xc55e35<_0x4a807f;_0xc55e35++){var _0x5d757c=events[_0xc55e35];var _0x59a5a8=createListener(_0xb818('0x5')+_0x5d757c,_0x3e52df);WhatsappMessageEvents['on'](_0x5d757c,_0x59a5a8);}}; \ No newline at end of file +var _0x7ad8=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0x7ad8,0x94));var _0x87ad=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0x7ad8[_0x112fe3];return _0x1ec903;};'use strict';var WhatsappMessageEvents=require(_0x87ad('0x0'));var events=[_0x87ad('0x1'),_0x87ad('0x2'),_0x87ad('0x3')];function createListener(_0x599ee0,_0x16ffc0){return function(_0x291cfd){_0x16ffc0[_0x87ad('0x4')](_0x599ee0,_0x291cfd);};}function removeListener(_0xba779f,_0x1489b0){return function(){WhatsappMessageEvents[_0x87ad('0x5')](_0xba779f,_0x1489b0);};}exports[_0x87ad('0x6')]=function(_0x34bece){for(var _0x1cac5c=0x0,_0x1a1c61=events[_0x87ad('0x7')];_0x1cac5c<_0x1a1c61;_0x1cac5c++){var _0x2bde0c=events[_0x1cac5c];var _0x562e4f=createListener(_0x87ad('0x8')+_0x2bde0c,_0x34bece);WhatsappMessageEvents['on'](_0x2bde0c,_0x562e4f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index cf789b1..3cd1a48 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80db=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','update','destroy','delete','removeTeams','removeAgents','multer','util','express','Router','fs-extra','../../components/auth/service','./whatsappQueue.controller'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x80db,0x1b9));var _0xb80d=function(_0x27d3aa,_0x339e7b){_0x27d3aa=_0x27d3aa-0x0;var _0x1e1b33=_0x80db[_0x27d3aa];return _0x1e1b33;};'use strict';var multer=require(_0xb80d('0x0'));var util=require(_0xb80d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb80d('0x2'));var router=express[_0xb80d('0x3')]();var fs_extra=require(_0xb80d('0x4'));var auth=require(_0xb80d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb80d('0x6'));router[_0xb80d('0x7')]('/',auth[_0xb80d('0x8')](),controller[_0xb80d('0x9')]);router['get'](_0xb80d('0xa'),auth[_0xb80d('0x8')](),controller[_0xb80d('0xb')]);router['get'](_0xb80d('0xc'),auth[_0xb80d('0x8')](),controller[_0xb80d('0xd')]);router[_0xb80d('0x7')](_0xb80d('0xe'),auth[_0xb80d('0x8')](),controller[_0xb80d('0xf')]);router[_0xb80d('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb80d('0x10')]);router[_0xb80d('0x7')](_0xb80d('0x11'),auth[_0xb80d('0x8')](),controller[_0xb80d('0x12')]);router[_0xb80d('0x13')]('/',auth[_0xb80d('0x8')](),controller[_0xb80d('0x14')]);router[_0xb80d('0x13')](_0xb80d('0x15'),auth[_0xb80d('0x8')](),controller['addTeams']);router[_0xb80d('0x13')]('/:id/users',auth[_0xb80d('0x8')](),controller[_0xb80d('0x16')]);router['put'](_0xb80d('0xc'),auth[_0xb80d('0x8')](),controller[_0xb80d('0x17')]);router['delete'](_0xb80d('0xc'),auth['isAuthenticated'](),controller[_0xb80d('0x18')]);router[_0xb80d('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb80d('0x1a')]);router['delete']('/:id/users',auth[_0xb80d('0x8')](),controller[_0xb80d('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xab40=['/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/members','getMembers'];(function(_0xb5e13a,_0x48d409){var _0x6756ad=function(_0x30ef30){while(--_0x30ef30){_0xb5e13a['push'](_0xb5e13a['shift']());}};_0x6756ad(++_0x48d409);}(_0xab40,0x193));var _0x0ab4=function(_0x5bac95,_0x13063f){_0x5bac95=_0x5bac95-0x0;var _0x11a942=_0xab40[_0x5bac95];return _0x11a942;};'use strict';var multer=require('multer');var util=require(_0x0ab4('0x0'));var path=require(_0x0ab4('0x1'));var timeout=require(_0x0ab4('0x2'));var express=require(_0x0ab4('0x3'));var router=express[_0x0ab4('0x4')]();var fs_extra=require(_0x0ab4('0x5'));var auth=require(_0x0ab4('0x6'));var interaction=require(_0x0ab4('0x7'));var config=require('../../config/environment');var controller=require(_0x0ab4('0x8'));router[_0x0ab4('0x9')]('/',auth['isAuthenticated'](),controller[_0x0ab4('0xa')]);router[_0x0ab4('0x9')]('/describe',auth[_0x0ab4('0xb')](),controller[_0x0ab4('0xc')]);router[_0x0ab4('0x9')](_0x0ab4('0xd'),auth[_0x0ab4('0xb')](),controller[_0x0ab4('0xe')]);router[_0x0ab4('0x9')](_0x0ab4('0xf'),auth[_0x0ab4('0xb')](),controller[_0x0ab4('0x10')]);router[_0x0ab4('0x9')](_0x0ab4('0x11'),auth[_0x0ab4('0xb')](),controller[_0x0ab4('0x12')]);router['get'](_0x0ab4('0x13'),auth[_0x0ab4('0xb')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x0ab4('0x14')]);router[_0x0ab4('0x15')]('/:id/teams',auth['isAuthenticated'](),controller[_0x0ab4('0x16')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x0ab4('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0ab4('0x18')](_0x0ab4('0xd'),auth[_0x0ab4('0xb')](),controller[_0x0ab4('0x19')]);router[_0x0ab4('0x18')](_0x0ab4('0x11'),auth[_0x0ab4('0xb')](),controller['removeTeams']);router[_0x0ab4('0x18')](_0x0ab4('0x13'),auth[_0x0ab4('0xb')](),controller[_0x0ab4('0x1a')]);module[_0x0ab4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 63469b1..653891b 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6308=['sequelize','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x40b970,_0x1b9d87){var _0x2c3648=function(_0x52fded){while(--_0x52fded){_0x40b970['push'](_0x40b970['shift']());}};_0x2c3648(++_0x1b9d87);}(_0x6308,0x1f2));var _0x8630=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x6308[_0x288f5e];return _0x476cc9;};'use strict';var Sequelize=require(_0x8630('0x0'));module['exports']={'name':{'type':Sequelize[_0x8630('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8630('0x2')](_0x8630('0x3'),_0x8630('0x4'),_0x8630('0x5'))},'description':{'type':Sequelize[_0x8630('0x1')]}}; \ No newline at end of file +var _0xcffe=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x303f58,_0x5ad7a3){var _0x21d600=function(_0x87d964){while(--_0x87d964){_0x303f58['push'](_0x303f58['shift']());}};_0x21d600(++_0x5ad7a3);}(_0xcffe,0x1a1));var _0xecff=function(_0x480cca,_0x33709f){_0x480cca=_0x480cca-0x0;var _0x22bcdb=_0xcffe[_0x480cca];return _0x22bcdb;};'use strict';var Sequelize=require(_0xecff('0x0'));module[_0xecff('0x1')]={'name':{'type':Sequelize[_0xecff('0x2')],'unique':_0xecff('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xecff('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xecff('0x5')](_0xecff('0x6'),_0xecff('0x7'),_0xecff('0x8'))},'description':{'type':Sequelize[_0xecff('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index e4e79b0..5e7aaa0 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc942=['TeamId','includes','compact','value','transaction','removeAgents','forEach','emit','userWhatsappQueue:remove','addAgents','spread','userWhatsappQueue:save','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','end','status','json','undefined','limit','offset','Content-Range','reject','update','destroy','then','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','map','WhatsappQueue','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','format','SIP','createdAt','getTeams','ids','Team','Agents','online','voicePause','flatMap','sequelize','each','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','push','toString','QueryTypes','SELECT','every'];(function(_0x3dea62,_0x260bbd){var _0x108ab4=function(_0x48eb71){while(--_0x48eb71){_0x3dea62['push'](_0x3dea62['shift']());}};_0x108ab4(++_0x260bbd);}(_0xc942,0x197));var _0x2c94=function(_0x5d06b5,_0x1e6e33){_0x5d06b5=_0x5d06b5-0x0;var _0x427921=_0xc942[_0x5d06b5];return _0x427921;};'use strict';var emlformat=require(_0x2c94('0x0'));var rimraf=require(_0x2c94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2c94('0x2'));var moment=require(_0x2c94('0x3'));var BPromise=require(_0x2c94('0x4'));var Mustache=require('mustache');var util=require(_0x2c94('0x5'));var path=require(_0x2c94('0x6'));var sox=require(_0x2c94('0x7'));var csv=require(_0x2c94('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c94('0x9'));var _=require(_0x2c94('0xa'));var squel=require(_0x2c94('0xb'));var crypto=require('crypto');var jsforce=require(_0x2c94('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2c94('0x8'));var querystring=require('querystring');var Papa=require(_0x2c94('0xd'));var Redis=require(_0x2c94('0xe'));var authService=require(_0x2c94('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2c94('0x10'));var hardwareService=require(_0x2c94('0x11'));var logger=require(_0x2c94('0x12'))(_0x2c94('0x13'));var utils=require(_0x2c94('0x14'));var config=require(_0x2c94('0x15'));var licenseUtil=require(_0x2c94('0x16'));var db=require(_0x2c94('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x2c94('0x18'),'port':0x18eb});var socket=require(_0x2c94('0x19'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x4e38cd,_0x3cc75b){_0x3cc75b=_0x3cc75b||0xcc;return function(_0x38ed78){if(_0x38ed78){return _0x4e38cd['sendStatus'](_0x3cc75b);}return _0x4e38cd['status'](_0x3cc75b)[_0x2c94('0x1a')]();};}function respondWithResult(_0xff99c9,_0x13e613){_0x13e613=_0x13e613||0xc8;return function(_0x59a800){if(_0x59a800){return _0xff99c9[_0x2c94('0x1b')](_0x13e613)[_0x2c94('0x1c')](_0x59a800);}};}function respondWithFilteredResult(_0x4163e6,_0x284553){return function(_0x375c70){if(_0x375c70){var _0x2a2b69=typeof _0x284553['offset']===_0x2c94('0x1d')&&typeof _0x284553[_0x2c94('0x1e')]===_0x2c94('0x1d');var _0x1b4cbe=_0x375c70['count'];var _0x42a943=_0x2a2b69?0x0:_0x284553[_0x2c94('0x1f')];var _0x13aeea=_0x2a2b69?_0x375c70['count']:_0x284553[_0x2c94('0x1f')]+_0x284553[_0x2c94('0x1e')];var _0x3c5713;if(_0x13aeea>=_0x1b4cbe){_0x13aeea=_0x1b4cbe;_0x3c5713=0xc8;}else{_0x3c5713=0xce;}_0x4163e6[_0x2c94('0x1b')](_0x3c5713);return _0x4163e6['set'](_0x2c94('0x20'),_0x42a943+'-'+_0x13aeea+'/'+_0x1b4cbe)[_0x2c94('0x1c')](_0x375c70);}return null;};}function patchUpdates(_0x22fd2f){return function(_0xb50e09){try{jsonpatch['apply'](_0xb50e09,_0x22fd2f,!![]);}catch(_0x53b6b6){return BPromise[_0x2c94('0x21')](_0x53b6b6);}return _0xb50e09['save']();};}function saveUpdates(_0x4d0769,_0x2ce229){return function(_0xeafa5a){if(_0xeafa5a){return _0xeafa5a[_0x2c94('0x22')](_0x4d0769)['then'](function(_0x5e2e87){return _0x5e2e87;});}return null;};}function removeEntity(_0x33a9cf,_0x44e86a){return function(_0x283658){if(_0x283658){return _0x283658[_0x2c94('0x23')]()[_0x2c94('0x24')](function(){var _0x4484d5=_0x283658['get']({'plain':!![]});var _0x949903=_0x2c94('0x25');return db[_0x2c94('0x26')]['destroy']({'where':{'type':_0x949903,'resourceId':_0x4484d5['id']}})['then'](function(){return _0x283658;});})[_0x2c94('0x24')](function(){_0x33a9cf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52cb09,_0x1ab0c8){return function(_0xbc8edc){if(!_0xbc8edc){_0x52cb09[_0x2c94('0x27')](0x194);}return _0xbc8edc;};}function handleError(_0x332208,_0x1ffb95){_0x1ffb95=_0x1ffb95||0x1f4;return function(_0x12eaee){logger[_0x2c94('0x28')](_0x12eaee[_0x2c94('0x29')]);if(_0x12eaee[_0x2c94('0x2a')]){delete _0x12eaee[_0x2c94('0x2a')];}_0x332208[_0x2c94('0x1b')](_0x1ffb95)[_0x2c94('0x2b')](_0x12eaee);};}exports['index']=function(_0x357262,_0x1c3833){var _0x598b4e={},_0x1fa8a1={},_0x3443a0={'count':0x0,'rows':[]};var _0x44d117=_[_0x2c94('0x2c')](db[_0x2c94('0x2d')]['rawAttributes'],function(_0x2bcb98){return{'name':_0x2bcb98[_0x2c94('0x2e')],'type':_0x2bcb98[_0x2c94('0x2f')][_0x2c94('0x30')]};});_0x1fa8a1['model']=_[_0x2c94('0x2c')](_0x44d117,_0x2c94('0x2a'));_0x1fa8a1['query']=_[_0x2c94('0x31')](_0x357262['query']);_0x1fa8a1[_0x2c94('0x32')]=_[_0x2c94('0x33')](_0x1fa8a1[_0x2c94('0x34')],_0x1fa8a1[_0x2c94('0x35')]);_0x598b4e['attributes']=_[_0x2c94('0x33')](_0x1fa8a1['model'],qs[_0x2c94('0x36')](_0x357262['query']['fields']));_0x598b4e[_0x2c94('0x37')]=_0x598b4e[_0x2c94('0x37')][_0x2c94('0x38')]?_0x598b4e[_0x2c94('0x37')]:_0x1fa8a1[_0x2c94('0x34')];if(!_0x357262[_0x2c94('0x35')][_0x2c94('0x39')](_0x2c94('0x3a'))){_0x598b4e['limit']=qs[_0x2c94('0x1e')](_0x357262[_0x2c94('0x35')][_0x2c94('0x1e')]);_0x598b4e[_0x2c94('0x1f')]=qs[_0x2c94('0x1f')](_0x357262[_0x2c94('0x35')][_0x2c94('0x1f')]);}_0x598b4e[_0x2c94('0x3b')]=qs[_0x2c94('0x3c')](_0x357262[_0x2c94('0x35')][_0x2c94('0x3c')]);_0x598b4e['where']=qs[_0x2c94('0x32')](_[_0x2c94('0x3d')](_0x357262[_0x2c94('0x35')],_0x1fa8a1[_0x2c94('0x32')]),_0x44d117);if(_0x357262[_0x2c94('0x35')][_0x2c94('0x3e')]){_0x598b4e['where']=_[_0x2c94('0x3f')](_0x598b4e[_0x2c94('0x40')],{'$or':_[_0x2c94('0x2c')](_0x44d117,function(_0xf03f1c){if(_0xf03f1c['type']!=='VIRTUAL'){var _0x7199f6={};_0x7199f6[_0xf03f1c[_0x2c94('0x2a')]]={'$like':'%'+_0x357262['query'][_0x2c94('0x3e')]+'%'};return _0x7199f6;}})});}_0x598b4e=_[_0x2c94('0x3f')]({},_0x598b4e,_0x357262[_0x2c94('0x41')]);var _0x55b4ce={'where':_0x598b4e[_0x2c94('0x40')]};return db['WhatsappQueue'][_0x2c94('0x42')](_0x55b4ce)['then'](function(_0x39838a){_0x3443a0['count']=_0x39838a;if(_0x357262[_0x2c94('0x35')][_0x2c94('0x43')]){_0x598b4e[_0x2c94('0x44')]=[{'all':!![]}];}return db[_0x2c94('0x2d')][_0x2c94('0x45')](_0x598b4e);})[_0x2c94('0x24')](function(_0x32fd98){_0x3443a0[_0x2c94('0x46')]=_0x32fd98;return _0x3443a0;})[_0x2c94('0x24')](respondWithFilteredResult(_0x1c3833,_0x598b4e))[_0x2c94('0x47')](handleError(_0x1c3833,null));};exports[_0x2c94('0x48')]=function(_0x3d9d4b,_0x346e0f){var _0x466bcc={'raw':!![],'where':{'id':_0x3d9d4b[_0x2c94('0x49')]['id']}},_0x236482={};_0x236482[_0x2c94('0x34')]=_[_0x2c94('0x31')](db['WhatsappQueue'][_0x2c94('0x4a')]);_0x236482[_0x2c94('0x35')]=_[_0x2c94('0x31')](_0x3d9d4b['query']);_0x236482[_0x2c94('0x32')]=_[_0x2c94('0x33')](_0x236482['model'],_0x236482[_0x2c94('0x35')]);_0x466bcc[_0x2c94('0x37')]=_[_0x2c94('0x33')](_0x236482[_0x2c94('0x34')],qs[_0x2c94('0x36')](_0x3d9d4b[_0x2c94('0x35')][_0x2c94('0x36')]));_0x466bcc[_0x2c94('0x37')]=_0x466bcc[_0x2c94('0x37')]['length']?_0x466bcc[_0x2c94('0x37')]:_0x236482[_0x2c94('0x34')];if(_0x3d9d4b[_0x2c94('0x35')][_0x2c94('0x43')]){_0x466bcc[_0x2c94('0x44')]=[{'all':!![]}];}_0x466bcc=_[_0x2c94('0x3f')]({},_0x466bcc,_0x3d9d4b[_0x2c94('0x41')]);return db[_0x2c94('0x2d')][_0x2c94('0x4b')](_0x466bcc)[_0x2c94('0x24')](handleEntityNotFound(_0x346e0f,null))[_0x2c94('0x24')](respondWithResult(_0x346e0f,null))[_0x2c94('0x47')](handleError(_0x346e0f,null));};exports[_0x2c94('0x4c')]=function(_0x3a9f55,_0x1b198c){return db['WhatsappQueue']['create'](_0x3a9f55[_0x2c94('0x4d')],{})['then'](function(_0x44b824){var _0xcf34e2=_0x3a9f55[_0x2c94('0x4e')][_0x2c94('0x4f')]({'plain':!![]});if(!_0xcf34e2)throw new Error(_0x2c94('0x50'));if(_0xcf34e2[_0x2c94('0x51')]==='user'){var _0x286b61=_0x44b824[_0x2c94('0x4f')]({'plain':!![]});var _0xdc13a7=_0x2c94('0x25');return db['UserProfileSection'][_0x2c94('0x4b')]({'where':{'name':_0xdc13a7,'userProfileId':_0xcf34e2['userProfileId']},'raw':!![]})[_0x2c94('0x24')](function(_0x31e6c8){if(_0x31e6c8&&_0x31e6c8[_0x2c94('0x52')]===0x0){return db[_0x2c94('0x26')][_0x2c94('0x4c')]({'name':_0x286b61['name'],'resourceId':_0x286b61['id'],'type':_0x31e6c8[_0x2c94('0x2a')],'sectionId':_0x31e6c8['id']},{})[_0x2c94('0x24')](function(){return _0x44b824;});}else{return _0x44b824;}})[_0x2c94('0x47')](function(_0xc3173c){logger[_0x2c94('0x28')](_0x2c94('0x53'),_0xc3173c);throw _0xc3173c;});}return _0x44b824;})[_0x2c94('0x24')](respondWithResult(_0x1b198c,0xc9))['catch'](handleError(_0x1b198c,null));};exports[_0x2c94('0x22')]=function(_0x7e85d8,_0x256a86){if(_0x7e85d8[_0x2c94('0x4d')]['id']){delete _0x7e85d8['body']['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x7e85d8[_0x2c94('0x49')]['id']}})['then'](handleEntityNotFound(_0x256a86,null))[_0x2c94('0x24')](saveUpdates(_0x7e85d8[_0x2c94('0x4d')],null))['then'](respondWithResult(_0x256a86,null))[_0x2c94('0x47')](handleError(_0x256a86,null));};exports[_0x2c94('0x23')]=function(_0x23a298,_0x2facc3){return db[_0x2c94('0x2d')][_0x2c94('0x4b')]({'where':{'id':_0x23a298[_0x2c94('0x49')]['id']}})[_0x2c94('0x24')](handleEntityNotFound(_0x2facc3,null))['then'](removeEntity(_0x2facc3,null))[_0x2c94('0x47')](handleError(_0x2facc3,null));};exports[_0x2c94('0x54')]=function(_0x147c63,_0x40afd7){return db[_0x2c94('0x2d')]['describe']()['then'](respondWithResult(_0x40afd7,null))[_0x2c94('0x47')](handleError(_0x40afd7,null));};exports['getMembers']=function(_0x41e36f,_0x3efe9c,_0x15d41d){var _0x2be6e5={'raw':!![],'where':{}},_0x50dd4c={},_0x44b4a7;return db['WhatsappQueue'][_0x2c94('0x55')]({'where':{'id':_0x41e36f[_0x2c94('0x49')]['id']}})[_0x2c94('0x24')](handleEntityNotFound(_0x3efe9c,null))[_0x2c94('0x24')](function(_0x789864){if(_0x789864){_0x44b4a7=_0x789864[_0x2c94('0x4f')]({'plain':!![]});_0x50dd4c[_0x2c94('0x34')]=_[_0x2c94('0x31')](db['UserWhatsappQueue'][_0x2c94('0x4a')]);_0x50dd4c[_0x2c94('0x35')]=_[_0x2c94('0x31')](_0x41e36f['query']);_0x50dd4c[_0x2c94('0x32')]=_[_0x2c94('0x33')](_0x50dd4c[_0x2c94('0x34')],_0x50dd4c[_0x2c94('0x35')]);_0x2be6e5[_0x2c94('0x37')]=_[_0x2c94('0x33')](_0x50dd4c[_0x2c94('0x34')],qs['fields'](_0x41e36f['query']['fields']));_0x2be6e5[_0x2c94('0x37')]=_0x2be6e5[_0x2c94('0x37')][_0x2c94('0x38')]?_0x2be6e5[_0x2c94('0x37')]:_0x50dd4c[_0x2c94('0x34')];if(!_0x41e36f[_0x2c94('0x35')]['hasOwnProperty'](_0x2c94('0x3a'))){_0x2be6e5[_0x2c94('0x1e')]=qs[_0x2c94('0x1e')](_0x41e36f[_0x2c94('0x35')][_0x2c94('0x1e')]);_0x2be6e5[_0x2c94('0x1f')]=qs[_0x2c94('0x1f')](_0x41e36f[_0x2c94('0x35')]['offset']);}_0x2be6e5[_0x2c94('0x3b')]=qs[_0x2c94('0x3c')](_0x41e36f[_0x2c94('0x35')][_0x2c94('0x3c')]);_0x2be6e5[_0x2c94('0x40')]=qs[_0x2c94('0x32')](_['pick'](_0x41e36f[_0x2c94('0x35')],_0x50dd4c[_0x2c94('0x32')]));_0x2be6e5[_0x2c94('0x40')]['WhatsappQueueId']=_0x789864['id'];if(_0x41e36f['query'][_0x2c94('0x3e')]){_0x2be6e5['where']=_['merge'](_0x2be6e5[_0x2c94('0x40')],{'$or':_[_0x2c94('0x2c')](_0x2be6e5[_0x2c94('0x37')],function(_0x15e6b1){var _0x4f6168={};_0x4f6168[_0x15e6b1]={'$like':'%'+_0x41e36f[_0x2c94('0x35')][_0x2c94('0x3e')]+'%'};return _0x4f6168;})});}_0x2be6e5=_[_0x2c94('0x3f')]({},_0x2be6e5,_0x41e36f[_0x2c94('0x41')]);return db[_0x2c94('0x56')][_0x2c94('0x45')](_0x2be6e5);}})['then'](function(_0x3ad076){if(_0x3ad076){return db[_0x2c94('0x57')][_0x2c94('0x58')]({'where':{'id':_['map'](_0x3ad076,_0x2c94('0x59')),'role':_0x2c94('0x5a')},'attributes':['id',_0x2c94('0x2a'),_0x2c94('0x5b'),_0x2c94('0x5c'),'createdAt']});}})[_0x2c94('0x24')](function(_0x54655a){if(_0x54655a){return{'count':_0x54655a[_0x2c94('0x42')],'rows':_[_0x2c94('0x2c')](_0x54655a[_0x2c94('0x46')],function(_0x338476){return{'membername':_0x338476[_0x2c94('0x2a')],'UserId':_0x338476['id'],'queue_name':_0x44b4a7[_0x2c94('0x2a')],'WhatsappQueueId':_0x44b4a7['id'],'interface':util[_0x2c94('0x5d')]('%s/%s',_0x2c94('0x5e'),_0x338476[_0x2c94('0x2a')]),'penalty':0x0,'paused':_0x338476['whatsappPause'],'createdAt':_0x338476[_0x2c94('0x5f')],'updatedAt':_0x338476[_0x2c94('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2c94('0x24')](respondWithFilteredResult(_0x3efe9c,_0x2be6e5))['catch'](handleError(_0x3efe9c,null));};exports['getTeams']=function(_0x19d62c,_0x52371d,_0xcb75a7){var _0x28b8e0={};var _0x391595={};var _0x13cf7a;var _0x59b2a6;return db[_0x2c94('0x2d')][_0x2c94('0x55')]({'where':{'id':_0x19d62c[_0x2c94('0x49')]['id']}})[_0x2c94('0x24')](handleEntityNotFound(_0x52371d,null))['then'](function(_0x55859d){if(_0x55859d){_0x13cf7a=_0x55859d;_0x391595[_0x2c94('0x34')]=_[_0x2c94('0x31')](db['Team'][_0x2c94('0x4a')]);_0x391595[_0x2c94('0x35')]=_[_0x2c94('0x31')](_0x19d62c[_0x2c94('0x35')]);_0x391595[_0x2c94('0x32')]=_[_0x2c94('0x33')](_0x391595[_0x2c94('0x34')],_0x391595['query']);_0x28b8e0[_0x2c94('0x37')]=_[_0x2c94('0x33')](_0x391595[_0x2c94('0x34')],qs[_0x2c94('0x36')](_0x19d62c[_0x2c94('0x35')]['fields']));_0x28b8e0[_0x2c94('0x37')]=_0x28b8e0[_0x2c94('0x37')]['length']?_0x28b8e0[_0x2c94('0x37')]:_0x391595[_0x2c94('0x34')];_0x28b8e0[_0x2c94('0x3b')]=qs['sort'](_0x19d62c['query'][_0x2c94('0x3c')]);_0x28b8e0[_0x2c94('0x40')]=qs[_0x2c94('0x32')](_['pick'](_0x19d62c[_0x2c94('0x35')],_0x391595[_0x2c94('0x32')]));if(_0x19d62c[_0x2c94('0x35')]['filter']){_0x28b8e0[_0x2c94('0x40')]=_[_0x2c94('0x3f')](_0x28b8e0[_0x2c94('0x40')],{'$or':_[_0x2c94('0x2c')](_0x28b8e0[_0x2c94('0x37')],function(_0x4545da){var _0x5bfc89={};_0x5bfc89[_0x4545da]={'$like':'%'+_0x19d62c['query'][_0x2c94('0x3e')]+'%'};return _0x5bfc89;})});}_0x28b8e0=_[_0x2c94('0x3f')]({},_0x28b8e0,_0x19d62c['options']);return _0x13cf7a[_0x2c94('0x60')](_0x28b8e0);}})[_0x2c94('0x24')](function(_0x45e37c){if(_0x45e37c){_0x59b2a6=_0x45e37c[_0x2c94('0x38')];if(!_0x19d62c[_0x2c94('0x35')]['hasOwnProperty'](_0x2c94('0x3a'))){_0x28b8e0['limit']=qs[_0x2c94('0x1e')](_0x19d62c[_0x2c94('0x35')][_0x2c94('0x1e')]);_0x28b8e0[_0x2c94('0x1f')]=qs['offset'](_0x19d62c[_0x2c94('0x35')][_0x2c94('0x1f')]);}return _0x13cf7a[_0x2c94('0x60')](_0x28b8e0);}})[_0x2c94('0x24')](function(_0x1f9d53){if(_0x1f9d53){return _0x1f9d53?{'count':_0x59b2a6,'rows':_0x1f9d53}:null;}})[_0x2c94('0x24')](respondWithResult(_0x52371d,null))['catch'](handleError(_0x52371d,null));};exports['addTeams']=function(_0xe1070c,_0x29aac0,_0x126d99){var _0x81ec72=_0xe1070c[_0x2c94('0x4d')][_0x2c94('0x61')];return db[_0x2c94('0x62')][_0x2c94('0x45')]({'where':{'id':_0x81ec72},'attributes':['id'],'include':[{'model':db[_0x2c94('0x57')],'as':_0x2c94('0x63'),'attributes':['id',_0x2c94('0x2a'),_0x2c94('0x64'),_0x2c94('0x65'),'interface'],'raw':!![]}]})[_0x2c94('0x24')](function(_0x4ceb90){if(_0x4ceb90){var _0x1d2028=_[_0x2c94('0x66')](_0x4ceb90,function(_0x3cbc77){var _0x52e7f4=_0x3cbc77[_0x2c94('0x4f')]({'plain':!![]});return _0x52e7f4[_0x2c94('0x63')];});return db[_0x2c94('0x2d')][_0x2c94('0x4b')]({'where':{'id':_0xe1070c['params']['id']}})['then'](function(_0x542c42){return db[_0x2c94('0x67')]['transaction'](function(_0x37cb05){return _0x542c42['addTeams'](_0x81ec72,{'transaction':_0x37cb05})[_0x2c94('0x24')](function(){return BPromise[_0x2c94('0x68')](_0x1d2028,function(_0x51568a){return db[_0x2c94('0x56')]['findOrCreate']({'where':{'UserId':_0x51568a['id'],'WhatsappQueueId':_0xe1070c['params']['id']},'transaction':_0x37cb05});});})[_0x2c94('0x24')](function(){_0x1d2028['forEach'](function(_0x2385d3){socket['emit']('userWhatsappQueue:save',{'UserId':_0x2385d3['id'],'WhatsappQueueId':_0x542c42['id']});});});});});}})[_0x2c94('0x24')](respondWithStatusCode(_0x29aac0,null))['catch'](handleError(_0x29aac0,null));};exports[_0x2c94('0x69')]=function(_0x1ba085,_0x47b4df,_0x4d7c08){return db[_0x2c94('0x62')][_0x2c94('0x45')]({'where':{'id':_0x1ba085[_0x2c94('0x35')][_0x2c94('0x61')]},'attributes':['id'],'include':[{'model':db[_0x2c94('0x57')],'as':_0x2c94('0x63'),'attributes':['id'],'raw':!![]}]})[_0x2c94('0x24')](handleEntityNotFound(_0x47b4df,null))[_0x2c94('0x24')](function(_0x50d840){var _0x59c6e0=_['map'](_0x50d840,'id');var _0x3631b1=[];var _0x13b030=[];var _0x3c0007=squel[_0x2c94('0x6a')]();_0x3c0007[_0x2c94('0x6b')](_0x2c94('0x6c'))['from'](_0x2c94('0x6d'),'tq')[_0x2c94('0x6e')](_0x2c94('0x6f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('WhatsappQueueId\x20=\x20?',_0x1ba085[_0x2c94('0x49')]['id']);for(var _0x165ed8=0x0;_0x165ed8<_0x50d840[_0x2c94('0x38')];_0x165ed8+=0x1){let _0x1459c0=_0x50d840[_0x165ed8];for(var _0x3dfbae=0x0;_0x3dfbae<_0x1459c0[_0x2c94('0x63')][_0x2c94('0x38')];_0x3dfbae+=0x1){let _0x193b48=_0x1459c0[_0x2c94('0x63')][_0x3dfbae];var _0x133413=_0x3c0007['clone']();_0x133413[_0x2c94('0x40')]('ut.UserId\x20=\x20?',_0x193b48['id']);_0x13b030[_0x2c94('0x70')](db[_0x2c94('0x67')][_0x2c94('0x35')](_0x133413[_0x2c94('0x71')](),{'type':db[_0x2c94('0x67')][_0x2c94('0x72')][_0x2c94('0x73')]})[_0x2c94('0x24')](function(_0x4dbf13){if(_0x4dbf13[_0x2c94('0x38')]===0x1){return _0x193b48['id'];}else{var _0x26c4ab=_[_0x2c94('0x74')](_[_0x2c94('0x2c')](_0x4dbf13,_0x2c94('0x75')),function(_0x4f97e1){return _[_0x2c94('0x76')](_0x59c6e0,_0x4f97e1);});if(_0x26c4ab){return _0x193b48['id'];}}}));}}return BPromise['all'](_0x13b030)[_0x2c94('0x24')](function(_0x2700ca){_0x3631b1=_(_0x3631b1)['union'](_0x2700ca)[_0x2c94('0x77')]()[_0x2c94('0x78')]();return db['WhatsappQueue'][_0x2c94('0x4b')]({'where':{'id':_0x1ba085[_0x2c94('0x49')]['id']}})[_0x2c94('0x24')](function(_0x5372aa){return db[_0x2c94('0x67')][_0x2c94('0x79')](function(_0x391fb0){return _0x5372aa[_0x2c94('0x69')](_0x1ba085[_0x2c94('0x35')][_0x2c94('0x61')],{'transaction':_0x391fb0})[_0x2c94('0x24')](function(){if(!_['isEmpty'](_0x3631b1)){return _0x5372aa[_0x2c94('0x7a')](_0x3631b1,{'transaction':_0x391fb0});}})[_0x2c94('0x24')](function(){_0x3631b1[_0x2c94('0x7b')](function(_0x46b44b){socket[_0x2c94('0x7c')](_0x2c94('0x7d'),{'UserId':_0x46b44b,'WhatsappQueueId':_0x5372aa['id']});});});});});});})['then'](respondWithStatusCode(_0x47b4df,null))[_0x2c94('0x47')](handleError(_0x47b4df,null));};exports[_0x2c94('0x7e')]=function(_0x434cd9,_0x1e0e33,_0x51e752){return db[_0x2c94('0x2d')][_0x2c94('0x4b')]({'where':{'id':_0x434cd9[_0x2c94('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e0e33,null))[_0x2c94('0x24')](function(_0x2d00e5){if(_0x2d00e5){return _0x2d00e5[_0x2c94('0x7e')](_0x434cd9[_0x2c94('0x4d')][_0x2c94('0x61')],_['omit'](_0x434cd9[_0x2c94('0x4d')],[_0x2c94('0x61'),'id'])||{})[_0x2c94('0x7f')](function(_0x42605f){for(var _0x5e5c6c=0x0;_0x5e5c6c<_0x434cd9[_0x2c94('0x4d')]['ids'][_0x2c94('0x38')];_0x5e5c6c+=0x1){socket[_0x2c94('0x7c')](_0x2c94('0x80'),{'UserId':Number(_0x434cd9[_0x2c94('0x4d')][_0x2c94('0x61')][_0x5e5c6c]),'WhatsappQueueId':Number(_0x434cd9[_0x2c94('0x49')]['id'])});}return _0x42605f;});}})[_0x2c94('0x24')](respondWithResult(_0x1e0e33,null))[_0x2c94('0x47')](handleError(_0x1e0e33,null));};exports['removeAgents']=function(_0x504a60,_0x475669,_0x547359){return db[_0x2c94('0x2d')][_0x2c94('0x4b')]({'where':{'id':_0x504a60['params']['id']}})[_0x2c94('0x24')](handleEntityNotFound(_0x475669,null))['then'](function(_0x374fe3){if(_0x374fe3){return _0x374fe3[_0x2c94('0x7a')](_0x504a60[_0x2c94('0x35')][_0x2c94('0x61')])[_0x2c94('0x24')](function(){if(_[_0x2c94('0x81')](_0x504a60[_0x2c94('0x35')][_0x2c94('0x61')])){for(var _0x55327d=0x0;_0x55327d<_0x504a60['query'][_0x2c94('0x61')][_0x2c94('0x38')];_0x55327d+=0x1){socket[_0x2c94('0x7c')](_0x2c94('0x7d'),{'UserId':Number(_0x504a60[_0x2c94('0x35')][_0x2c94('0x61')][_0x55327d]),'WhatsappQueueId':Number(_0x504a60[_0x2c94('0x49')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x504a60[_0x2c94('0x35')][_0x2c94('0x61')]),'WhatsappQueueId':Number(_0x504a60[_0x2c94('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x475669,null))[_0x2c94('0x47')](handleError(_0x475669,null));};exports[_0x2c94('0x82')]=function(_0x29c4a1,_0x272a36,_0x4790c1){var _0x499de9={};var _0x2e0971={};var _0x12cd8c;var _0x56470e;return db[_0x2c94('0x2d')][_0x2c94('0x55')]({'where':{'id':_0x29c4a1['params']['id']}})[_0x2c94('0x24')](handleEntityNotFound(_0x272a36,null))[_0x2c94('0x24')](function(_0x525cc7){if(_0x525cc7){_0x12cd8c=_0x525cc7;_0x2e0971[_0x2c94('0x34')]=_[_0x2c94('0x31')](db['User']['rawAttributes']);_0x2e0971['query']=_[_0x2c94('0x31')](_0x29c4a1['query']);_0x2e0971[_0x2c94('0x32')]=_['intersection'](_0x2e0971[_0x2c94('0x34')],_0x2e0971['query']);_0x499de9['attributes']=_[_0x2c94('0x33')](_0x2e0971[_0x2c94('0x34')],qs[_0x2c94('0x36')](_0x29c4a1[_0x2c94('0x35')][_0x2c94('0x36')]));_0x499de9['attributes']=_0x499de9[_0x2c94('0x37')][_0x2c94('0x38')]?_0x499de9[_0x2c94('0x37')]:_0x2e0971[_0x2c94('0x34')];_0x499de9[_0x2c94('0x3b')]=qs[_0x2c94('0x3c')](_0x29c4a1['query'][_0x2c94('0x3c')]);_0x499de9[_0x2c94('0x40')]=qs[_0x2c94('0x32')](_[_0x2c94('0x3d')](_0x29c4a1[_0x2c94('0x35')],_0x2e0971['filters']));if(_0x29c4a1['query'][_0x2c94('0x3e')]){_0x499de9[_0x2c94('0x40')]=_[_0x2c94('0x3f')](_0x499de9[_0x2c94('0x40')],{'$or':_[_0x2c94('0x2c')](_0x499de9[_0x2c94('0x37')],function(_0x5111f0){var _0x5bb942={};_0x5bb942[_0x5111f0]={'$like':'%'+_0x29c4a1[_0x2c94('0x35')][_0x2c94('0x3e')]+'%'};return _0x5bb942;})});}_0x499de9=_[_0x2c94('0x3f')]({},_0x499de9,_0x29c4a1[_0x2c94('0x41')]);return _0x12cd8c['getAgents'](_0x499de9);}})['then'](function(_0x4ba04b){if(_0x4ba04b){_0x56470e=_0x4ba04b[_0x2c94('0x38')];if(!_0x29c4a1[_0x2c94('0x35')][_0x2c94('0x39')]('nolimit')){_0x499de9[_0x2c94('0x1e')]=qs[_0x2c94('0x1e')](_0x29c4a1[_0x2c94('0x35')][_0x2c94('0x1e')]);_0x499de9[_0x2c94('0x1f')]=qs[_0x2c94('0x1f')](_0x29c4a1[_0x2c94('0x35')]['offset']);}return _0x12cd8c[_0x2c94('0x82')](_0x499de9);}})[_0x2c94('0x24')](function(_0x3b177a){if(_0x3b177a){return _0x3b177a?{'count':_0x56470e,'rows':_0x3b177a}:null;}})[_0x2c94('0x24')](respondWithResult(_0x272a36,null))['catch'](handleError(_0x272a36,null));}; \ No newline at end of file +var _0x3a83=['createdAt','getTeams','Team','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','WhatsappQueues','end','stack','name','send','index','map','rawAttributes','type','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','WhatsappQueue','include','findAll','catch','show','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','getMembers','findOne','params','WhatsappQueueId','options','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','format','%s/%s','SIP'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3a83,0x151));var _0x33a8=function(_0x12fef0,_0x2970df){_0x12fef0=_0x12fef0-0x0;var _0x33b4ea=_0x3a83[_0x12fef0];return _0x33b4ea;};'use strict';var emlformat=require(_0x33a8('0x0'));var rimraf=require(_0x33a8('0x1'));var zipdir=require(_0x33a8('0x2'));var jsonpatch=require(_0x33a8('0x3'));var rp=require(_0x33a8('0x4'));var moment=require(_0x33a8('0x5'));var BPromise=require(_0x33a8('0x6'));var Mustache=require('mustache');var util=require(_0x33a8('0x7'));var path=require(_0x33a8('0x8'));var sox=require(_0x33a8('0x9'));var csv=require('to-csv');var ejs=require(_0x33a8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33a8('0xb'));var squel=require(_0x33a8('0xc'));var crypto=require('crypto');var jsforce=require(_0x33a8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x33a8('0xe'));var querystring=require(_0x33a8('0xf'));var Papa=require('papaparse');var Redis=require(_0x33a8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x33a8('0x11'));var as=require(_0x33a8('0x12'));var hardwareService=require(_0x33a8('0x13'));var logger=require(_0x33a8('0x14'))(_0x33a8('0x15'));var utils=require(_0x33a8('0x16'));var config=require(_0x33a8('0x17'));var licenseUtil=require(_0x33a8('0x18'));var db=require(_0x33a8('0x19'))['db'];config[_0x33a8('0x1a')]=_[_0x33a8('0x1b')](config[_0x33a8('0x1a')],{'host':_0x33a8('0x1c'),'port':0x18eb});var socket=require(_0x33a8('0x1d'))(new Redis(config['redis']));require(_0x33a8('0x1e'))[_0x33a8('0x1f')](socket);function respondWithStatusCode(_0x103369,_0x50139a){_0x50139a=_0x50139a||0xcc;return function(_0x11e616){if(_0x11e616){return _0x103369[_0x33a8('0x20')](_0x50139a);}return _0x103369[_0x33a8('0x21')](_0x50139a)['end']();};}function respondWithResult(_0x215ca0,_0x20054e){_0x20054e=_0x20054e||0xc8;return function(_0x11bc74){if(_0x11bc74){return _0x215ca0['status'](_0x20054e)['json'](_0x11bc74);}};}function respondWithFilteredResult(_0x4fd435,_0x1e3803){return function(_0xd6901){if(_0xd6901){var _0x192a89=typeof _0x1e3803[_0x33a8('0x22')]===_0x33a8('0x23')&&typeof _0x1e3803['limit']==='undefined';var _0x189bd2=_0xd6901[_0x33a8('0x24')];var _0x1202aa=_0x192a89?0x0:_0x1e3803[_0x33a8('0x22')];var _0x47fea4=_0x192a89?_0xd6901[_0x33a8('0x24')]:_0x1e3803['offset']+_0x1e3803[_0x33a8('0x25')];var _0x39b6eb;if(_0x47fea4>=_0x189bd2){_0x47fea4=_0x189bd2;_0x39b6eb=0xc8;}else{_0x39b6eb=0xce;}_0x4fd435[_0x33a8('0x21')](_0x39b6eb);return _0x4fd435[_0x33a8('0x26')](_0x33a8('0x27'),_0x1202aa+'-'+_0x47fea4+'/'+_0x189bd2)[_0x33a8('0x28')](_0xd6901);}return null;};}function patchUpdates(_0x49fb64){return function(_0x13ddff){try{jsonpatch['apply'](_0x13ddff,_0x49fb64,!![]);}catch(_0x5927fb){return BPromise[_0x33a8('0x29')](_0x5927fb);}return _0x13ddff[_0x33a8('0x2a')]();};}function saveUpdates(_0x156342,_0x109974){return function(_0x4f1428){if(_0x4f1428){return _0x4f1428[_0x33a8('0x2b')](_0x156342)[_0x33a8('0x2c')](function(_0x1abcdb){return _0x1abcdb;});}return null;};}function removeEntity(_0x117d3e,_0x170102){return function(_0x1a90be){if(_0x1a90be){return _0x1a90be[_0x33a8('0x2d')]()[_0x33a8('0x2c')](function(){var _0x2ce8e3=_0x1a90be['get']({'plain':!![]});var _0x16b9d9=_0x33a8('0x2e');return db['UserProfileResource'][_0x33a8('0x2d')]({'where':{'type':_0x16b9d9,'resourceId':_0x2ce8e3['id']}})['then'](function(){return _0x1a90be;});})[_0x33a8('0x2c')](function(){_0x117d3e[_0x33a8('0x21')](0xcc)[_0x33a8('0x2f')]();});}};}function handleEntityNotFound(_0x549d78,_0x4c1b21){return function(_0x4b16c8){if(!_0x4b16c8){_0x549d78['sendStatus'](0x194);}return _0x4b16c8;};}function handleError(_0x2aeb4c,_0x51caf8){_0x51caf8=_0x51caf8||0x1f4;return function(_0x466fb7){logger['error'](_0x466fb7[_0x33a8('0x30')]);if(_0x466fb7['name']){delete _0x466fb7[_0x33a8('0x31')];}_0x2aeb4c[_0x33a8('0x21')](_0x51caf8)[_0x33a8('0x32')](_0x466fb7);};}exports[_0x33a8('0x33')]=function(_0x3e9ec9,_0x65e4fd){var _0x479706={},_0x737dc6={},_0x5629b6={'count':0x0,'rows':[]};var _0x443793=_[_0x33a8('0x34')](db['WhatsappQueue'][_0x33a8('0x35')],function(_0x4066a9){return{'name':_0x4066a9['fieldName'],'type':_0x4066a9[_0x33a8('0x36')]['key']};});_0x737dc6['model']=_[_0x33a8('0x34')](_0x443793,_0x33a8('0x31'));_0x737dc6['query']=_[_0x33a8('0x37')](_0x3e9ec9['query']);_0x737dc6['filters']=_[_0x33a8('0x38')](_0x737dc6[_0x33a8('0x39')],_0x737dc6[_0x33a8('0x3a')]);_0x479706[_0x33a8('0x3b')]=_[_0x33a8('0x38')](_0x737dc6[_0x33a8('0x39')],qs[_0x33a8('0x3c')](_0x3e9ec9['query'][_0x33a8('0x3c')]));_0x479706[_0x33a8('0x3b')]=_0x479706['attributes'][_0x33a8('0x3d')]?_0x479706['attributes']:_0x737dc6[_0x33a8('0x39')];if(!_0x3e9ec9['query'][_0x33a8('0x3e')](_0x33a8('0x3f'))){_0x479706[_0x33a8('0x25')]=qs['limit'](_0x3e9ec9[_0x33a8('0x3a')]['limit']);_0x479706['offset']=qs['offset'](_0x3e9ec9[_0x33a8('0x3a')][_0x33a8('0x22')]);}_0x479706[_0x33a8('0x40')]=qs[_0x33a8('0x41')](_0x3e9ec9[_0x33a8('0x3a')][_0x33a8('0x41')]);_0x479706['where']=qs[_0x33a8('0x42')](_[_0x33a8('0x43')](_0x3e9ec9['query'],_0x737dc6[_0x33a8('0x42')]),_0x443793);if(_0x3e9ec9['query'][_0x33a8('0x44')]){_0x479706[_0x33a8('0x45')]=_[_0x33a8('0x46')](_0x479706[_0x33a8('0x45')],{'$or':_['map'](_0x443793,function(_0x25f5be){if(_0x25f5be[_0x33a8('0x36')]!==_0x33a8('0x47')){var _0x4860f7={};_0x4860f7[_0x25f5be[_0x33a8('0x31')]]={'$like':'%'+_0x3e9ec9[_0x33a8('0x3a')][_0x33a8('0x44')]+'%'};return _0x4860f7;}})});}_0x479706=_['merge']({},_0x479706,_0x3e9ec9['options']);var _0x3e0aee={'where':_0x479706[_0x33a8('0x45')]};return db[_0x33a8('0x48')][_0x33a8('0x24')](_0x3e0aee)[_0x33a8('0x2c')](function(_0x3aa8fb){_0x5629b6['count']=_0x3aa8fb;if(_0x3e9ec9[_0x33a8('0x3a')]['includeAll']){_0x479706[_0x33a8('0x49')]=[{'all':!![]}];}return db[_0x33a8('0x48')][_0x33a8('0x4a')](_0x479706);})['then'](function(_0x5f2865){_0x5629b6['rows']=_0x5f2865;return _0x5629b6;})[_0x33a8('0x2c')](respondWithFilteredResult(_0x65e4fd,_0x479706))[_0x33a8('0x4b')](handleError(_0x65e4fd,null));};exports[_0x33a8('0x4c')]=function(_0x1deaca,_0x27c2f3){var _0x51210c={'raw':!![],'where':{'id':_0x1deaca['params']['id']}},_0x5c8140={};_0x5c8140['model']=_[_0x33a8('0x37')](db['WhatsappQueue'][_0x33a8('0x35')]);_0x5c8140['query']=_[_0x33a8('0x37')](_0x1deaca[_0x33a8('0x3a')]);_0x5c8140[_0x33a8('0x42')]=_['intersection'](_0x5c8140[_0x33a8('0x39')],_0x5c8140[_0x33a8('0x3a')]);_0x51210c[_0x33a8('0x3b')]=_[_0x33a8('0x38')](_0x5c8140[_0x33a8('0x39')],qs[_0x33a8('0x3c')](_0x1deaca[_0x33a8('0x3a')][_0x33a8('0x3c')]));_0x51210c[_0x33a8('0x3b')]=_0x51210c[_0x33a8('0x3b')][_0x33a8('0x3d')]?_0x51210c[_0x33a8('0x3b')]:_0x5c8140[_0x33a8('0x39')];if(_0x1deaca[_0x33a8('0x3a')][_0x33a8('0x4d')]){_0x51210c['include']=[{'all':!![]}];}_0x51210c=_[_0x33a8('0x46')]({},_0x51210c,_0x1deaca['options']);return db['WhatsappQueue'][_0x33a8('0x4e')](_0x51210c)[_0x33a8('0x2c')](handleEntityNotFound(_0x27c2f3,null))[_0x33a8('0x2c')](respondWithResult(_0x27c2f3,null))['catch'](handleError(_0x27c2f3,null));};exports[_0x33a8('0x4f')]=function(_0x3b1a00,_0x501622){return db[_0x33a8('0x48')][_0x33a8('0x4f')](_0x3b1a00[_0x33a8('0x50')],{})[_0x33a8('0x2c')](function(_0x255dd1){var _0x119ea2=_0x3b1a00[_0x33a8('0x51')][_0x33a8('0x52')]({'plain':!![]});if(!_0x119ea2)throw new Error(_0x33a8('0x53'));if(_0x119ea2[_0x33a8('0x54')]===_0x33a8('0x51')){var _0x23fa3c=_0x255dd1['get']({'plain':!![]});var _0x2092cf=_0x33a8('0x2e');return db['UserProfileSection'][_0x33a8('0x4e')]({'where':{'name':_0x2092cf,'userProfileId':_0x119ea2[_0x33a8('0x55')]},'raw':!![]})[_0x33a8('0x2c')](function(_0x3c2d40){if(_0x3c2d40&&_0x3c2d40[_0x33a8('0x56')]===0x0){return db[_0x33a8('0x57')][_0x33a8('0x4f')]({'name':_0x23fa3c['name'],'resourceId':_0x23fa3c['id'],'type':_0x3c2d40['name'],'sectionId':_0x3c2d40['id']},{})[_0x33a8('0x2c')](function(){return _0x255dd1;});}else{return _0x255dd1;}})[_0x33a8('0x4b')](function(_0x5f04bb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f04bb);throw _0x5f04bb;});}return _0x255dd1;})['then'](respondWithResult(_0x501622,0xc9))[_0x33a8('0x4b')](handleError(_0x501622,null));};exports[_0x33a8('0x2b')]=function(_0x5dcd9e,_0x4862d2){if(_0x5dcd9e[_0x33a8('0x50')]['id']){delete _0x5dcd9e[_0x33a8('0x50')]['id'];}return db[_0x33a8('0x48')][_0x33a8('0x4e')]({'where':{'id':_0x5dcd9e['params']['id']}})['then'](handleEntityNotFound(_0x4862d2,null))['then'](saveUpdates(_0x5dcd9e[_0x33a8('0x50')],null))['then'](respondWithResult(_0x4862d2,null))[_0x33a8('0x4b')](handleError(_0x4862d2,null));};exports['destroy']=function(_0x3ac159,_0x5349cf){return db['WhatsappQueue'][_0x33a8('0x4e')]({'where':{'id':_0x3ac159['params']['id']}})['then'](handleEntityNotFound(_0x5349cf,null))[_0x33a8('0x2c')](removeEntity(_0x5349cf,null))[_0x33a8('0x4b')](handleError(_0x5349cf,null));};exports['describe']=function(_0x96522c,_0x1adf0f){return db[_0x33a8('0x48')]['describe']()[_0x33a8('0x2c')](respondWithResult(_0x1adf0f,null))[_0x33a8('0x4b')](handleError(_0x1adf0f,null));};exports[_0x33a8('0x58')]=function(_0x52e454,_0x5e1c9b,_0x12bdf1){var _0x1a6886={'raw':!![],'where':{}},_0x2ab208={},_0x1141ee;return db[_0x33a8('0x48')][_0x33a8('0x59')]({'where':{'id':_0x52e454[_0x33a8('0x5a')]['id']}})[_0x33a8('0x2c')](handleEntityNotFound(_0x5e1c9b,null))[_0x33a8('0x2c')](function(_0x161414){if(_0x161414){_0x1141ee=_0x161414['get']({'plain':!![]});_0x2ab208['model']=_[_0x33a8('0x37')](db['UserWhatsappQueue'][_0x33a8('0x35')]);_0x2ab208['query']=_[_0x33a8('0x37')](_0x52e454[_0x33a8('0x3a')]);_0x2ab208[_0x33a8('0x42')]=_[_0x33a8('0x38')](_0x2ab208[_0x33a8('0x39')],_0x2ab208['query']);_0x1a6886[_0x33a8('0x3b')]=_[_0x33a8('0x38')](_0x2ab208[_0x33a8('0x39')],qs[_0x33a8('0x3c')](_0x52e454[_0x33a8('0x3a')][_0x33a8('0x3c')]));_0x1a6886[_0x33a8('0x3b')]=_0x1a6886[_0x33a8('0x3b')][_0x33a8('0x3d')]?_0x1a6886[_0x33a8('0x3b')]:_0x2ab208['model'];if(!_0x52e454[_0x33a8('0x3a')][_0x33a8('0x3e')](_0x33a8('0x3f'))){_0x1a6886[_0x33a8('0x25')]=qs[_0x33a8('0x25')](_0x52e454[_0x33a8('0x3a')][_0x33a8('0x25')]);_0x1a6886[_0x33a8('0x22')]=qs[_0x33a8('0x22')](_0x52e454[_0x33a8('0x3a')][_0x33a8('0x22')]);}_0x1a6886[_0x33a8('0x40')]=qs[_0x33a8('0x41')](_0x52e454[_0x33a8('0x3a')][_0x33a8('0x41')]);_0x1a6886[_0x33a8('0x45')]=qs[_0x33a8('0x42')](_[_0x33a8('0x43')](_0x52e454[_0x33a8('0x3a')],_0x2ab208[_0x33a8('0x42')]));_0x1a6886[_0x33a8('0x45')][_0x33a8('0x5b')]=_0x161414['id'];if(_0x52e454[_0x33a8('0x3a')]['filter']){_0x1a6886[_0x33a8('0x45')]=_[_0x33a8('0x46')](_0x1a6886[_0x33a8('0x45')],{'$or':_[_0x33a8('0x34')](_0x1a6886['attributes'],function(_0x1adac8){var _0x44b77d={};_0x44b77d[_0x1adac8]={'$like':'%'+_0x52e454[_0x33a8('0x3a')][_0x33a8('0x44')]+'%'};return _0x44b77d;})});}_0x1a6886=_[_0x33a8('0x46')]({},_0x1a6886,_0x52e454[_0x33a8('0x5c')]);return db[_0x33a8('0x5d')][_0x33a8('0x4a')](_0x1a6886);}})[_0x33a8('0x2c')](function(_0x1c7368){if(_0x1c7368){return db[_0x33a8('0x5e')][_0x33a8('0x5f')]({'where':{'id':_[_0x33a8('0x34')](_0x1c7368,_0x33a8('0x60')),'role':_0x33a8('0x61')},'attributes':['id','name',_0x33a8('0x62'),_0x33a8('0x63'),'createdAt']});}})['then'](function(_0x5cefe3){if(_0x5cefe3){return{'count':_0x5cefe3[_0x33a8('0x24')],'rows':_[_0x33a8('0x34')](_0x5cefe3[_0x33a8('0x64')],function(_0x43e8c8){return{'membername':_0x43e8c8['name'],'UserId':_0x43e8c8['id'],'queue_name':_0x1141ee[_0x33a8('0x31')],'WhatsappQueueId':_0x1141ee['id'],'interface':util[_0x33a8('0x65')](_0x33a8('0x66'),_0x33a8('0x67'),_0x43e8c8[_0x33a8('0x31')]),'penalty':0x0,'paused':_0x43e8c8['whatsappPause'],'createdAt':_0x43e8c8[_0x33a8('0x68')],'updatedAt':_0x43e8c8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x33a8('0x2c')](respondWithFilteredResult(_0x5e1c9b,_0x1a6886))[_0x33a8('0x4b')](handleError(_0x5e1c9b,null));};exports[_0x33a8('0x69')]=function(_0x52dd15,_0x437ac2,_0x209892){var _0x20f157={};var _0x189f17={};var _0x8ecd4e;var _0x54c06b;return db[_0x33a8('0x48')][_0x33a8('0x59')]({'where':{'id':_0x52dd15[_0x33a8('0x5a')]['id']}})[_0x33a8('0x2c')](handleEntityNotFound(_0x437ac2,null))['then'](function(_0x543f2a){if(_0x543f2a){_0x8ecd4e=_0x543f2a;_0x189f17[_0x33a8('0x39')]=_['keys'](db[_0x33a8('0x6a')][_0x33a8('0x35')]);_0x189f17[_0x33a8('0x3a')]=_['keys'](_0x52dd15[_0x33a8('0x3a')]);_0x189f17['filters']=_[_0x33a8('0x38')](_0x189f17[_0x33a8('0x39')],_0x189f17['query']);_0x20f157['attributes']=_[_0x33a8('0x38')](_0x189f17['model'],qs[_0x33a8('0x3c')](_0x52dd15[_0x33a8('0x3a')]['fields']));_0x20f157[_0x33a8('0x3b')]=_0x20f157['attributes'][_0x33a8('0x3d')]?_0x20f157[_0x33a8('0x3b')]:_0x189f17[_0x33a8('0x39')];_0x20f157[_0x33a8('0x40')]=qs['sort'](_0x52dd15[_0x33a8('0x3a')]['sort']);_0x20f157[_0x33a8('0x45')]=qs['filters'](_[_0x33a8('0x43')](_0x52dd15['query'],_0x189f17[_0x33a8('0x42')]));if(_0x52dd15[_0x33a8('0x3a')][_0x33a8('0x44')]){_0x20f157[_0x33a8('0x45')]=_['merge'](_0x20f157[_0x33a8('0x45')],{'$or':_[_0x33a8('0x34')](_0x20f157[_0x33a8('0x3b')],function(_0xfe1002){var _0x59ddff={};_0x59ddff[_0xfe1002]={'$like':'%'+_0x52dd15[_0x33a8('0x3a')][_0x33a8('0x44')]+'%'};return _0x59ddff;})});}_0x20f157=_[_0x33a8('0x46')]({},_0x20f157,_0x52dd15[_0x33a8('0x5c')]);return _0x8ecd4e[_0x33a8('0x69')](_0x20f157);}})['then'](function(_0x514df2){if(_0x514df2){_0x54c06b=_0x514df2[_0x33a8('0x3d')];if(!_0x52dd15[_0x33a8('0x3a')][_0x33a8('0x3e')]('nolimit')){_0x20f157[_0x33a8('0x25')]=qs[_0x33a8('0x25')](_0x52dd15[_0x33a8('0x3a')][_0x33a8('0x25')]);_0x20f157[_0x33a8('0x22')]=qs['offset'](_0x52dd15[_0x33a8('0x3a')][_0x33a8('0x22')]);}return _0x8ecd4e[_0x33a8('0x69')](_0x20f157);}})['then'](function(_0x3c1173){if(_0x3c1173){return _0x3c1173?{'count':_0x54c06b,'rows':_0x3c1173}:null;}})[_0x33a8('0x2c')](respondWithResult(_0x437ac2,null))[_0x33a8('0x4b')](handleError(_0x437ac2,null));};exports[_0x33a8('0x6b')]=function(_0x276a51,_0x26748a,_0x8b98d9){var _0x3b9deb=_0x276a51[_0x33a8('0x50')][_0x33a8('0x6c')];return db[_0x33a8('0x6a')]['findAll']({'where':{'id':_0x3b9deb},'attributes':['id'],'include':[{'model':db[_0x33a8('0x5e')],'as':'Agents','attributes':['id',_0x33a8('0x31'),'online',_0x33a8('0x6d'),_0x33a8('0x6e')],'raw':!![]}]})[_0x33a8('0x2c')](function(_0x17d1d9){if(_0x17d1d9){var _0x2bc265=_[_0x33a8('0x6f')](_0x17d1d9,function(_0x49bf0e){var _0x1d8c1f=_0x49bf0e[_0x33a8('0x52')]({'plain':!![]});return _0x1d8c1f[_0x33a8('0x70')];});return db['WhatsappQueue'][_0x33a8('0x4e')]({'where':{'id':_0x276a51['params']['id']}})['then'](function(_0x5af238){return db[_0x33a8('0x71')]['transaction'](function(_0x8f4a86){return _0x5af238[_0x33a8('0x6b')](_0x3b9deb,{'transaction':_0x8f4a86})[_0x33a8('0x2c')](function(){return BPromise['each'](_0x2bc265,function(_0x40609d){return db[_0x33a8('0x5d')][_0x33a8('0x72')]({'where':{'UserId':_0x40609d['id'],'WhatsappQueueId':_0x276a51[_0x33a8('0x5a')]['id']},'transaction':_0x8f4a86});});})[_0x33a8('0x2c')](function(){_0x2bc265['forEach'](function(_0x19168f){socket[_0x33a8('0x73')](_0x33a8('0x74'),{'UserId':_0x19168f['id'],'WhatsappQueueId':_0x5af238['id']});});});});});}})['then'](respondWithStatusCode(_0x26748a,null))[_0x33a8('0x4b')](handleError(_0x26748a,null));};exports[_0x33a8('0x75')]=function(_0x405ec4,_0x2b7842,_0xa897ec){return db[_0x33a8('0x6a')][_0x33a8('0x4a')]({'where':{'id':_0x405ec4[_0x33a8('0x3a')][_0x33a8('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x33a8('0x5e')],'as':_0x33a8('0x70'),'attributes':['id'],'raw':!![]}]})[_0x33a8('0x2c')](handleEntityNotFound(_0x2b7842,null))[_0x33a8('0x2c')](function(_0x4be4b1){var _0x2126a1=_[_0x33a8('0x34')](_0x4be4b1,'id');var _0x127e40=[];var _0x216010=[];var _0x35ca0e=squel[_0x33a8('0x76')]();_0x35ca0e[_0x33a8('0x77')]('tq.TeamId')[_0x33a8('0x78')](_0x33a8('0x79'),'tq')[_0x33a8('0x7a')](_0x33a8('0x7b'),'ut',_0x33a8('0x7c'))['where'](_0x33a8('0x7d'),_0x405ec4['params']['id']);for(var _0x619dbc=0x0;_0x619dbc<_0x4be4b1['length'];_0x619dbc+=0x1){let _0x1ab3a8=_0x4be4b1[_0x619dbc];for(var _0x1a3f94=0x0;_0x1a3f94<_0x1ab3a8['Agents'][_0x33a8('0x3d')];_0x1a3f94+=0x1){let _0x3325f8=_0x1ab3a8['Agents'][_0x1a3f94];var _0x5097f7=_0x35ca0e[_0x33a8('0x7e')]();_0x5097f7[_0x33a8('0x45')](_0x33a8('0x7f'),_0x3325f8['id']);_0x216010[_0x33a8('0x80')](db[_0x33a8('0x71')][_0x33a8('0x3a')](_0x5097f7['toString'](),{'type':db[_0x33a8('0x71')][_0x33a8('0x81')][_0x33a8('0x82')]})[_0x33a8('0x2c')](function(_0x29509f){if(_0x29509f[_0x33a8('0x3d')]===0x1){return _0x3325f8['id'];}else{var _0x42a85=_[_0x33a8('0x83')](_[_0x33a8('0x34')](_0x29509f,_0x33a8('0x84')),function(_0x114a31){return _[_0x33a8('0x85')](_0x2126a1,_0x114a31);});if(_0x42a85){return _0x3325f8['id'];}}}));}}return BPromise[_0x33a8('0x86')](_0x216010)[_0x33a8('0x2c')](function(_0x4f1aaa){_0x127e40=_(_0x127e40)[_0x33a8('0x87')](_0x4f1aaa)[_0x33a8('0x88')]()[_0x33a8('0x89')]();return db[_0x33a8('0x48')][_0x33a8('0x4e')]({'where':{'id':_0x405ec4['params']['id']}})[_0x33a8('0x2c')](function(_0x47c50b){return db[_0x33a8('0x71')]['transaction'](function(_0x44d48f){return _0x47c50b['removeTeams'](_0x405ec4[_0x33a8('0x3a')]['ids'],{'transaction':_0x44d48f})[_0x33a8('0x2c')](function(){if(!_[_0x33a8('0x8a')](_0x127e40)){return _0x47c50b[_0x33a8('0x8b')](_0x127e40,{'transaction':_0x44d48f});}})[_0x33a8('0x2c')](function(){_0x127e40[_0x33a8('0x8c')](function(_0x205d1c){socket[_0x33a8('0x73')](_0x33a8('0x8d'),{'UserId':_0x205d1c,'WhatsappQueueId':_0x47c50b['id']});});});});});});})[_0x33a8('0x2c')](respondWithStatusCode(_0x2b7842,null))['catch'](handleError(_0x2b7842,null));};exports[_0x33a8('0x8e')]=function(_0x4e4cca,_0x44c7df,_0x2f6352){return db['WhatsappQueue'][_0x33a8('0x4e')]({'where':{'id':_0x4e4cca['params']['id']}})['then'](handleEntityNotFound(_0x44c7df,null))[_0x33a8('0x2c')](function(_0x23ae00){if(_0x23ae00){return _0x23ae00[_0x33a8('0x8e')](_0x4e4cca[_0x33a8('0x50')][_0x33a8('0x6c')],_[_0x33a8('0x8f')](_0x4e4cca[_0x33a8('0x50')],[_0x33a8('0x6c'),'id'])||{})[_0x33a8('0x90')](function(_0x1c3a5f){for(var _0x525c83=0x0;_0x525c83<_0x4e4cca[_0x33a8('0x50')][_0x33a8('0x6c')][_0x33a8('0x3d')];_0x525c83+=0x1){socket[_0x33a8('0x73')](_0x33a8('0x74'),{'UserId':Number(_0x4e4cca[_0x33a8('0x50')][_0x33a8('0x6c')][_0x525c83]),'WhatsappQueueId':Number(_0x4e4cca['params']['id'])});}return _0x1c3a5f;});}})[_0x33a8('0x2c')](respondWithResult(_0x44c7df,null))[_0x33a8('0x4b')](handleError(_0x44c7df,null));};exports[_0x33a8('0x8b')]=function(_0x9b1fb1,_0x35789d,_0x2a012e){return db['WhatsappQueue'][_0x33a8('0x4e')]({'where':{'id':_0x9b1fb1[_0x33a8('0x5a')]['id']}})[_0x33a8('0x2c')](handleEntityNotFound(_0x35789d,null))[_0x33a8('0x2c')](function(_0x4e2bee){if(_0x4e2bee){return _0x4e2bee[_0x33a8('0x8b')](_0x9b1fb1[_0x33a8('0x3a')]['ids'])[_0x33a8('0x2c')](function(){if(_[_0x33a8('0x91')](_0x9b1fb1[_0x33a8('0x3a')][_0x33a8('0x6c')])){for(var _0x4926fc=0x0;_0x4926fc<_0x9b1fb1[_0x33a8('0x3a')][_0x33a8('0x6c')][_0x33a8('0x3d')];_0x4926fc+=0x1){socket[_0x33a8('0x73')](_0x33a8('0x8d'),{'UserId':Number(_0x9b1fb1[_0x33a8('0x3a')]['ids'][_0x4926fc]),'WhatsappQueueId':Number(_0x9b1fb1['params']['id'])});}}else{socket[_0x33a8('0x73')]('userWhatsappQueue:remove',{'UserId':Number(_0x9b1fb1['query']['ids']),'WhatsappQueueId':Number(_0x9b1fb1['params']['id'])});}});}})['then'](respondWithStatusCode(_0x35789d,null))[_0x33a8('0x4b')](handleError(_0x35789d,null));};exports[_0x33a8('0x92')]=function(_0x4cc449,_0x524e17,_0x112009){var _0x1f2cde={};var _0x395ff9={};var _0x1aa488;var _0x24b4e4;return db[_0x33a8('0x48')][_0x33a8('0x59')]({'where':{'id':_0x4cc449[_0x33a8('0x5a')]['id']}})[_0x33a8('0x2c')](handleEntityNotFound(_0x524e17,null))['then'](function(_0x16790a){if(_0x16790a){_0x1aa488=_0x16790a;_0x395ff9[_0x33a8('0x39')]=_[_0x33a8('0x37')](db[_0x33a8('0x5e')][_0x33a8('0x35')]);_0x395ff9[_0x33a8('0x3a')]=_[_0x33a8('0x37')](_0x4cc449[_0x33a8('0x3a')]);_0x395ff9[_0x33a8('0x42')]=_['intersection'](_0x395ff9['model'],_0x395ff9[_0x33a8('0x3a')]);_0x1f2cde[_0x33a8('0x3b')]=_[_0x33a8('0x38')](_0x395ff9['model'],qs['fields'](_0x4cc449[_0x33a8('0x3a')][_0x33a8('0x3c')]));_0x1f2cde['attributes']=_0x1f2cde[_0x33a8('0x3b')][_0x33a8('0x3d')]?_0x1f2cde[_0x33a8('0x3b')]:_0x395ff9['model'];_0x1f2cde[_0x33a8('0x40')]=qs['sort'](_0x4cc449[_0x33a8('0x3a')][_0x33a8('0x41')]);_0x1f2cde[_0x33a8('0x45')]=qs['filters'](_[_0x33a8('0x43')](_0x4cc449[_0x33a8('0x3a')],_0x395ff9['filters']));if(_0x4cc449['query']['filter']){_0x1f2cde[_0x33a8('0x45')]=_[_0x33a8('0x46')](_0x1f2cde[_0x33a8('0x45')],{'$or':_['map'](_0x1f2cde['attributes'],function(_0xe04203){var _0xcc3e1e={};_0xcc3e1e[_0xe04203]={'$like':'%'+_0x4cc449['query']['filter']+'%'};return _0xcc3e1e;})});}_0x1f2cde=_[_0x33a8('0x46')]({},_0x1f2cde,_0x4cc449[_0x33a8('0x5c')]);return _0x1aa488[_0x33a8('0x92')](_0x1f2cde);}})[_0x33a8('0x2c')](function(_0x15d8f2){if(_0x15d8f2){_0x24b4e4=_0x15d8f2['length'];if(!_0x4cc449[_0x33a8('0x3a')][_0x33a8('0x3e')]('nolimit')){_0x1f2cde['limit']=qs[_0x33a8('0x25')](_0x4cc449[_0x33a8('0x3a')]['limit']);_0x1f2cde[_0x33a8('0x22')]=qs[_0x33a8('0x22')](_0x4cc449[_0x33a8('0x3a')][_0x33a8('0x22')]);}return _0x1aa488[_0x33a8('0x92')](_0x1f2cde);}})[_0x33a8('0x2c')](function(_0x445435){if(_0x445435){return _0x445435?{'count':_0x24b4e4,'rows':_0x445435}:null;}})[_0x33a8('0x2c')](respondWithResult(_0x524e17,null))[_0x33a8('0x4b')](handleError(_0x524e17,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 32d6696..6b83c90 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe437=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0xf97eb0,_0x1578b7){var _0xea70f4=function(_0x574c8d){while(--_0x574c8d){_0xf97eb0['push'](_0xf97eb0['shift']());}};_0xea70f4(++_0x1578b7);}(_0xe437,0x17f));var _0x7e43=function(_0x1d7932,_0x5e7bbd){_0x1d7932=_0x1d7932-0x0;var _0x4be1ac=_0xe437[_0x1d7932];return _0x4be1ac;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x7e43('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x7e43('0x1')](0x0);var events={'afterCreate':_0x7e43('0x2'),'afterUpdate':_0x7e43('0x3'),'afterDestroy':_0x7e43('0x4')};function emitEvent(_0x19d97b){return function(_0x194191,_0x55adc6,_0x442871){WhatsappQueueEvents[_0x7e43('0x5')](_0x19d97b+':'+_0x194191['id'],_0x194191);WhatsappQueueEvents[_0x7e43('0x5')](_0x19d97b,_0x194191);_0x442871(null);};}for(var e in events){if(events[_0x7e43('0x6')](e)){var event=events[e];WhatsappQueue[_0x7e43('0x7')](e,emitEvent(event));}}module[_0x7e43('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xc6c1=['remove','emit','hook','events','WhatsappQueue','setMaxListeners','update'];(function(_0x278f83,_0x288600){var _0x4a2fad=function(_0x29f20e){while(--_0x29f20e){_0x278f83['push'](_0x278f83['shift']());}};_0x4a2fad(++_0x288600);}(_0xc6c1,0x1ae));var _0x1c6c=function(_0x436849,_0x430b00){_0x436849=_0x436849-0x0;var _0x5c5f73=_0xc6c1[_0x436849];return _0x5c5f73;};'use strict';var EventEmitter=require(_0x1c6c('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x1c6c('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1c6c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1c6c('0x3'),'afterDestroy':_0x1c6c('0x4')};function emitEvent(_0x137671){return function(_0x28a2af,_0xb8e9b,_0x4a9d87){WhatsappQueueEvents[_0x1c6c('0x5')](_0x137671+':'+_0x28a2af['id'],_0x28a2af);WhatsappQueueEvents[_0x1c6c('0x5')](_0x137671,_0x28a2af);_0x4a9d87(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x1c6c('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 00b51e6..1fe8a7e 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec0e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger'];(function(_0x4aca28,_0x4ab42c){var _0x1946a0=function(_0x42c5cd){while(--_0x42c5cd){_0x4aca28['push'](_0x4aca28['shift']());}};_0x1946a0(++_0x4ab42c);}(_0xec0e,0x190));var _0xeec0=function(_0x2e030a,_0x8e4c48){_0x2e030a=_0x2e030a-0x0;var _0x597df6=_0xec0e[_0x2e030a];return _0x597df6;};'use strict';var _=require(_0xeec0('0x0'));var util=require(_0xeec0('0x1'));var logger=require(_0xeec0('0x2'))('api');var moment=require(_0xeec0('0x3'));var BPromise=require(_0xeec0('0x4'));var rp=require(_0xeec0('0x5'));var fs=require('fs');var path=require(_0xeec0('0x6'));var rimraf=require(_0xeec0('0x7'));var config=require(_0xeec0('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0xeec0('0x9')]=function(_0x2eb4f6,_0x41b1c4){return _0x2eb4f6[_0xeec0('0xa')](_0xeec0('0xb'),attributes,{'tableName':_0xeec0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5f0=['whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue'];(function(_0x4bd69e,_0x33d62e){var _0xd28574=function(_0x2228c1){while(--_0x2228c1){_0x4bd69e['push'](_0x4bd69e['shift']());}};_0xd28574(++_0x33d62e);}(_0xa5f0,0x15f));var _0x0a5f=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xa5f0[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x0a5f('0x0'));var util=require(_0x0a5f('0x1'));var logger=require(_0x0a5f('0x2'))(_0x0a5f('0x3'));var moment=require(_0x0a5f('0x4'));var BPromise=require(_0x0a5f('0x5'));var rp=require(_0x0a5f('0x6'));var fs=require('fs');var path=require(_0x0a5f('0x7'));var rimraf=require(_0x0a5f('0x8'));var config=require(_0x0a5f('0x9'));var attributes=require(_0x0a5f('0xa'));module['exports']=function(_0x42b1b6,_0x298d15){return _0x42b1b6[_0x0a5f('0xb')](_0x0a5f('0xc'),attributes,{'tableName':_0x0a5f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 29489de..e1fee4d 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7af8=['info','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowWhatsappQueue','WhatsappQueue','find','stringify','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then'];(function(_0x4ab93d,_0x17a2b0){var _0x44a208=function(_0x2910c9){while(--_0x2910c9){_0x4ab93d['push'](_0x4ab93d['shift']());}};_0x44a208(++_0x17a2b0);}(_0x7af8,0x145));var _0x87af=function(_0xd06d80,_0x5579e7){_0xd06d80=_0xd06d80-0x0;var _0x4753d3=_0x7af8[_0xd06d80];return _0x4753d3;};'use strict';var _=require(_0x87af('0x0'));var util=require(_0x87af('0x1'));var moment=require(_0x87af('0x2'));var BPromise=require('bluebird');var rs=require(_0x87af('0x3'));var fs=require('fs');var Redis=require(_0x87af('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x87af('0x5'))(_0x87af('0x6'));var config=require(_0x87af('0x7'));var jayson=require(_0x87af('0x8'));var client=jayson[_0x87af('0x9')][_0x87af('0xa')]({'port':0x232a});config[_0x87af('0xb')]=_[_0x87af('0xc')](config[_0x87af('0xb')],{'host':_0x87af('0xd'),'port':0x18eb});var socket=require(_0x87af('0xe'))(new Redis(config['redis']));require(_0x87af('0xf'))[_0x87af('0x10')](socket);function respondWithRpcPromise(_0x506ec4,_0x169b77,_0x3741a2){return new BPromise(function(_0x38921c,_0x24d456){return client[_0x87af('0x11')](_0x506ec4,_0x3741a2)[_0x87af('0x12')](function(_0x27ad06){logger[_0x87af('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x169b77,_0x87af('0x14'));logger['debug'](_0x87af('0x15'),_0x169b77,_0x87af('0x14'),JSON['stringify'](_0x27ad06));if(_0x27ad06[_0x87af('0x16')]){if(_0x27ad06[_0x87af('0x16')][_0x87af('0x17')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x169b77,_0x27ad06[_0x87af('0x16')][_0x87af('0x18')]);return _0x24d456(_0x27ad06[_0x87af('0x16')][_0x87af('0x18')]);}logger[_0x87af('0x16')](_0x87af('0x19'),_0x169b77,_0x27ad06[_0x87af('0x16')][_0x87af('0x18')]);return _0x38921c(_0x27ad06['error'][_0x87af('0x18')]);}else{logger[_0x87af('0x13')](_0x87af('0x19'),_0x169b77,_0x87af('0x14'));_0x38921c(_0x27ad06[_0x87af('0x1a')][_0x87af('0x18')]);}})['catch'](function(_0x297d0d){logger[_0x87af('0x16')](_0x87af('0x19'),_0x169b77,_0x297d0d);_0x24d456(_0x297d0d);});});}exports[_0x87af('0x1b')]=function(_0x163286){var _0x7a88ec=this;return new Promise(function(_0x5506d9,_0x3eb7cc){return db['WhatsappQueue'][_0x87af('0x1c')]({'raw':_0x163286['options']?_0x163286[_0x87af('0x1d')][_0x87af('0x1e')]===undefined?!![]:![]:!![],'where':_0x163286[_0x87af('0x1d')]?_0x163286[_0x87af('0x1d')][_0x87af('0x1f')]||null:null,'attributes':_0x163286[_0x87af('0x1d')]?_0x163286[_0x87af('0x1d')][_0x87af('0x20')]||null:null,'limit':_0x163286[_0x87af('0x1d')]?_0x163286[_0x87af('0x1d')][_0x87af('0x21')]||null:null,'include':_0x163286[_0x87af('0x1d')]?_0x163286[_0x87af('0x1d')][_0x87af('0x22')]?_[_0x87af('0x23')](_0x163286[_0x87af('0x1d')][_0x87af('0x22')],function(_0x3549aa){return{'model':db[_0x3549aa[_0x87af('0x24')]],'as':_0x3549aa['as'],'attributes':_0x3549aa[_0x87af('0x20')],'include':_0x3549aa[_0x87af('0x22')]?_[_0x87af('0x23')](_0x3549aa['include'],function(_0x17753d){return{'model':db[_0x17753d['model']],'as':_0x17753d['as'],'attributes':_0x17753d[_0x87af('0x20')],'include':_0x17753d[_0x87af('0x22')]?_[_0x87af('0x23')](_0x17753d[_0x87af('0x22')],function(_0x5eb6e5){return{'model':db[_0x5eb6e5[_0x87af('0x24')]],'as':_0x5eb6e5['as'],'attributes':_0x5eb6e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x87af('0x12')](function(_0x2c2c79){logger['info'](_0x87af('0x1b'),_0x163286);logger[_0x87af('0x25')]('GetWhatsappQueue',_0x163286,JSON['stringify'](_0x2c2c79));_0x5506d9(_0x2c2c79);})[_0x87af('0x26')](function(_0x58be55){logger['error'](_0x87af('0x1b'),_0x58be55['message'],_0x163286);_0x3eb7cc(_0x7a88ec[_0x87af('0x16')](0x1f4,_0x58be55[_0x87af('0x18')]));});});};exports[_0x87af('0x27')]=function(_0x228c14){var _0x3b502d=this;return new Promise(function(_0x987034,_0x5eef90){return db[_0x87af('0x28')][_0x87af('0x29')]({'raw':_0x228c14[_0x87af('0x1d')]?_0x228c14[_0x87af('0x1d')][_0x87af('0x1e')]===undefined?!![]:![]:!![],'where':_0x228c14[_0x87af('0x1d')]?_0x228c14[_0x87af('0x1d')]['where']||null:null,'attributes':_0x228c14[_0x87af('0x1d')]?_0x228c14[_0x87af('0x1d')][_0x87af('0x20')]||null:null,'include':_0x228c14[_0x87af('0x1d')]?_0x228c14[_0x87af('0x1d')][_0x87af('0x22')]?_[_0x87af('0x23')](_0x228c14['options'][_0x87af('0x22')],function(_0xf21ee5){return{'model':db[_0xf21ee5[_0x87af('0x24')]],'as':_0xf21ee5['as'],'attributes':_0xf21ee5[_0x87af('0x20')],'include':_0xf21ee5['include']?_['map'](_0xf21ee5[_0x87af('0x22')],function(_0x2046d1){return{'model':db[_0x2046d1[_0x87af('0x24')]],'as':_0x2046d1['as'],'attributes':_0x2046d1[_0x87af('0x20')],'include':_0x2046d1[_0x87af('0x22')]?_[_0x87af('0x23')](_0x2046d1['include'],function(_0x332c4b){return{'model':db[_0x332c4b['model']],'as':_0x332c4b['as'],'attributes':_0x332c4b[_0x87af('0x20')]};}):[]};}):[]};}):[]:[]})[_0x87af('0x12')](function(_0x3774d2){logger[_0x87af('0x13')]('ShowWhatsappQueue',_0x228c14);logger[_0x87af('0x25')](_0x87af('0x27'),_0x228c14,JSON[_0x87af('0x2a')](_0x3774d2));_0x987034(_0x3774d2);})[_0x87af('0x26')](function(_0x4863bd){logger[_0x87af('0x16')](_0x87af('0x27'),_0x4863bd[_0x87af('0x18')],_0x228c14);_0x5eef90(_0x3b502d[_0x87af('0x16')](0x1f4,_0x4863bd[_0x87af('0x18')]));});});}; \ No newline at end of file +var _0x2501=['include','map','model','debug','ShowWhatsappQueue','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x2501,0x12e));var _0x1250=function(_0x45c074,_0x5498d5){_0x45c074=_0x45c074-0x0;var _0x2572d1=_0x2501[_0x45c074];return _0x2572d1;};'use strict';var _=require(_0x1250('0x0'));var util=require(_0x1250('0x1'));var moment=require('moment');var BPromise=require(_0x1250('0x2'));var rs=require(_0x1250('0x3'));var fs=require('fs');var Redis=require(_0x1250('0x4'));var db=require(_0x1250('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1250('0x6'));var jayson=require(_0x1250('0x7'));var client=jayson[_0x1250('0x8')]['http']({'port':0x232a});config[_0x1250('0x9')]=_[_0x1250('0xa')](config['redis'],{'host':_0x1250('0xb'),'port':0x18eb});var socket=require(_0x1250('0xc'))(new Redis(config[_0x1250('0x9')]));require(_0x1250('0xd'))['register'](socket);function respondWithRpcPromise(_0x545bf3,_0x4c656d,_0x475b45){return new BPromise(function(_0x2d73a2,_0x310340){return client[_0x1250('0xe')](_0x545bf3,_0x475b45)['then'](function(_0x1b09ca){logger[_0x1250('0xf')](_0x1250('0x10'),_0x4c656d,_0x1250('0x11'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4c656d,'request\x20sent',JSON[_0x1250('0x12')](_0x1b09ca));if(_0x1b09ca[_0x1250('0x13')]){if(_0x1b09ca[_0x1250('0x13')][_0x1250('0x14')]===0x1f4){logger['error'](_0x1250('0x10'),_0x4c656d,_0x1b09ca[_0x1250('0x13')][_0x1250('0x15')]);return _0x310340(_0x1b09ca[_0x1250('0x13')][_0x1250('0x15')]);}logger[_0x1250('0x13')](_0x1250('0x10'),_0x4c656d,_0x1b09ca[_0x1250('0x13')][_0x1250('0x15')]);return _0x2d73a2(_0x1b09ca[_0x1250('0x13')][_0x1250('0x15')]);}else{logger[_0x1250('0xf')](_0x1250('0x10'),_0x4c656d,'request\x20sent');_0x2d73a2(_0x1b09ca[_0x1250('0x16')][_0x1250('0x15')]);}})[_0x1250('0x17')](function(_0x3bd83e){logger[_0x1250('0x13')](_0x1250('0x10'),_0x4c656d,_0x3bd83e);_0x310340(_0x3bd83e);});});}exports[_0x1250('0x18')]=function(_0x1a3d0b){var _0x4df6c1=this;return new Promise(function(_0x103a39,_0x443224){return db[_0x1250('0x19')][_0x1250('0x1a')]({'raw':_0x1a3d0b['options']?_0x1a3d0b[_0x1250('0x1b')][_0x1250('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a3d0b[_0x1250('0x1b')]?_0x1a3d0b[_0x1250('0x1b')]['where']||null:null,'attributes':_0x1a3d0b[_0x1250('0x1b')]?_0x1a3d0b[_0x1250('0x1b')][_0x1250('0x1d')]||null:null,'limit':_0x1a3d0b['options']?_0x1a3d0b['options'][_0x1250('0x1e')]||null:null,'include':_0x1a3d0b[_0x1250('0x1b')]?_0x1a3d0b[_0x1250('0x1b')][_0x1250('0x1f')]?_[_0x1250('0x20')](_0x1a3d0b['options'][_0x1250('0x1f')],function(_0xb406ab){return{'model':db[_0xb406ab['model']],'as':_0xb406ab['as'],'attributes':_0xb406ab[_0x1250('0x1d')],'include':_0xb406ab[_0x1250('0x1f')]?_['map'](_0xb406ab['include'],function(_0x28c0d4){return{'model':db[_0x28c0d4[_0x1250('0x21')]],'as':_0x28c0d4['as'],'attributes':_0x28c0d4[_0x1250('0x1d')],'include':_0x28c0d4['include']?_[_0x1250('0x20')](_0x28c0d4[_0x1250('0x1f')],function(_0x4248e1){return{'model':db[_0x4248e1[_0x1250('0x21')]],'as':_0x4248e1['as'],'attributes':_0x4248e1[_0x1250('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8020f9){logger[_0x1250('0xf')](_0x1250('0x18'),_0x1a3d0b);logger[_0x1250('0x22')]('GetWhatsappQueue',_0x1a3d0b,JSON['stringify'](_0x8020f9));_0x103a39(_0x8020f9);})[_0x1250('0x17')](function(_0x1ed59f){logger[_0x1250('0x13')](_0x1250('0x18'),_0x1ed59f[_0x1250('0x15')],_0x1a3d0b);_0x443224(_0x4df6c1[_0x1250('0x13')](0x1f4,_0x1ed59f['message']));});});};exports[_0x1250('0x23')]=function(_0x195da0){var _0x287716=this;return new Promise(function(_0xed58c6,_0x363dad){return db[_0x1250('0x19')]['find']({'raw':_0x195da0['options']?_0x195da0[_0x1250('0x1b')][_0x1250('0x1c')]===undefined?!![]:![]:!![],'where':_0x195da0[_0x1250('0x1b')]?_0x195da0['options']['where']||null:null,'attributes':_0x195da0[_0x1250('0x1b')]?_0x195da0['options']['attributes']||null:null,'include':_0x195da0[_0x1250('0x1b')]?_0x195da0['options'][_0x1250('0x1f')]?_[_0x1250('0x20')](_0x195da0[_0x1250('0x1b')][_0x1250('0x1f')],function(_0x570eea){return{'model':db[_0x570eea[_0x1250('0x21')]],'as':_0x570eea['as'],'attributes':_0x570eea[_0x1250('0x1d')],'include':_0x570eea['include']?_['map'](_0x570eea[_0x1250('0x1f')],function(_0x29d971){return{'model':db[_0x29d971[_0x1250('0x21')]],'as':_0x29d971['as'],'attributes':_0x29d971[_0x1250('0x1d')],'include':_0x29d971['include']?_[_0x1250('0x20')](_0x29d971[_0x1250('0x1f')],function(_0x5d01c5){return{'model':db[_0x5d01c5[_0x1250('0x21')]],'as':_0x5d01c5['as'],'attributes':_0x5d01c5[_0x1250('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1250('0x24')](function(_0x3b064e){logger['info'](_0x1250('0x23'),_0x195da0);logger[_0x1250('0x22')](_0x1250('0x23'),_0x195da0,JSON[_0x1250('0x12')](_0x3b064e));_0xed58c6(_0x3b064e);})['catch'](function(_0x9bc73d){logger['error'](_0x1250('0x23'),_0x9bc73d[_0x1250('0x15')],_0x195da0);_0x363dad(_0x287716[_0x1250('0x13')](0x1f4,_0x9bc73d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 933d4fe..affd631 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46ec=['length','whatsappQueue:','./whatsappQueue.events','save','remove','emit','removeListener','register'];(function(_0x413ede,_0x53717d){var _0x4da879=function(_0xb5893b){while(--_0xb5893b){_0x413ede['push'](_0x413ede['shift']());}};_0x4da879(++_0x53717d);}(_0x46ec,0x6a));var _0xc46e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x46ec[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require(_0xc46e('0x0'));var events=[_0xc46e('0x1'),_0xc46e('0x2'),'update'];function createListener(_0x179025,_0x30da77){return function(_0x646ae3){_0x30da77[_0xc46e('0x3')](_0x179025,_0x646ae3);};}function removeListener(_0x199daa,_0x15b8f6){return function(){WhatsappQueueEvents[_0xc46e('0x4')](_0x199daa,_0x15b8f6);};}exports[_0xc46e('0x5')]=function(_0x92ca00){for(var _0x1ae93f=0x0,_0x54d167=events[_0xc46e('0x6')];_0x1ae93f<_0x54d167;_0x1ae93f++){var _0x4e9e7a=events[_0x1ae93f];var _0x110a12=createListener(_0xc46e('0x7')+_0x4e9e7a,_0x92ca00);WhatsappQueueEvents['on'](_0x4e9e7a,_0x110a12);}}; \ No newline at end of file +var _0xa1ae=['register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener'];(function(_0x502968,_0x215c0d){var _0x2c71f0=function(_0xdae7e8){while(--_0xdae7e8){_0x502968['push'](_0x502968['shift']());}};_0x2c71f0(++_0x215c0d);}(_0xa1ae,0x174));var _0xea1a=function(_0x5635ec,_0x1c2c17){_0x5635ec=_0x5635ec-0x0;var _0x124309=_0xa1ae[_0x5635ec];return _0x124309;};'use strict';var WhatsappQueueEvents=require(_0xea1a('0x0'));var events=[_0xea1a('0x1'),_0xea1a('0x2'),_0xea1a('0x3')];function createListener(_0x553b9d,_0x21dbab){return function(_0x30e5a1){_0x21dbab[_0xea1a('0x4')](_0x553b9d,_0x30e5a1);};}function removeListener(_0x467582,_0x10a18f){return function(){WhatsappQueueEvents[_0xea1a('0x5')](_0x467582,_0x10a18f);};}exports[_0xea1a('0x6')]=function(_0x348ca2){for(var _0x273ef4=0x0,_0x1d1bed=events[_0xea1a('0x7')];_0x273ef4<_0x1d1bed;_0x273ef4++){var _0x246169=events[_0x273ef4];var _0x268099=createListener(_0xea1a('0x8')+_0x246169,_0x348ca2);WhatsappQueueEvents['on'](_0x246169,_0x268099);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index f8845d6..026c443 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee1b=['./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0xee1b,0x9a));var _0xbee1=function(_0x3fb1d9,_0x9022c1){_0x3fb1d9=_0x3fb1d9-0x0;var _0x2e5668=_0xee1b[_0x3fb1d9];return _0x2e5668;};'use strict';var multer=require(_0xbee1('0x0'));var util=require(_0xbee1('0x1'));var path=require(_0xbee1('0x2'));var timeout=require(_0xbee1('0x3'));var express=require(_0xbee1('0x4'));var router=express[_0xbee1('0x5')]();var fs_extra=require(_0xbee1('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbee1('0x7'));var controller=require(_0xbee1('0x8'));router[_0xbee1('0x9')]('/',auth[_0xbee1('0xa')](),controller['index']);router[_0xbee1('0x9')](_0xbee1('0xb'),auth['isAuthenticated'](),controller[_0xbee1('0xc')]);router[_0xbee1('0x9')](_0xbee1('0xd'),auth[_0xbee1('0xa')](),controller['show']);router[_0xbee1('0xe')]('/',auth[_0xbee1('0xa')](),controller['create']);router['put'](_0xbee1('0xd'),auth['isAuthenticated'](),controller[_0xbee1('0xf')]);router[_0xbee1('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xbee1('0x11')]);module['exports']=router; \ No newline at end of file +var _0x756b=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','multer','util'];(function(_0x24270a,_0x58a926){var _0x53fa12=function(_0x23cd8c){while(--_0x23cd8c){_0x24270a['push'](_0x24270a['shift']());}};_0x53fa12(++_0x58a926);}(_0x756b,0xa0));var _0xb756=function(_0x38c01b,_0x399d76){_0x38c01b=_0x38c01b-0x0;var _0x40b880=_0x756b[_0x38c01b];return _0x40b880;};'use strict';var multer=require(_0xb756('0x0'));var util=require(_0xb756('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb756('0x2'));var router=express[_0xb756('0x3')]();var fs_extra=require(_0xb756('0x4'));var auth=require(_0xb756('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb756('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0xb756('0x7')]('/',auth[_0xb756('0x8')](),controller[_0xb756('0x9')]);router[_0xb756('0x7')](_0xb756('0xa'),auth[_0xb756('0x8')](),controller[_0xb756('0xb')]);router[_0xb756('0x7')](_0xb756('0xc'),auth[_0xb756('0x8')](),controller[_0xb756('0xd')]);router[_0xb756('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb756('0xf')]('/:id',auth[_0xb756('0x8')](),controller['update']);router[_0xb756('0x10')](_0xb756('0xc'),auth[_0xb756('0x8')](),controller[_0xb756('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 588cd5a..fea2a55 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x1ac489,_0x137110){var _0x1fc49e=function(_0x354c5c){while(--_0x354c5c){_0x1ac489['push'](_0x1ac489['shift']());}};_0x1fc49e(++_0x137110);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x11ae3d,_0x40fae0){var _0x5a00fb=function(_0x5197aa){while(--_0x5197aa){_0x11ae3d['push'](_0x11ae3d['shift']());}};_0x5a00fb(++_0x40fae0);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index a18af56..8b16147 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1339=['../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','end','sendStatus','error','name','send','index','map','WhatsappQueueReport','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','create','body','update','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2cf95a,_0x453bae){var _0x371f8f=function(_0x4090a9){while(--_0x4090a9){_0x2cf95a['push'](_0x2cf95a['shift']());}};_0x371f8f(++_0x453bae);}(_0x1339,0x1ed));var _0x9133=function(_0x2e705f,_0x40aaf5){_0x2e705f=_0x2e705f-0x0;var _0x30ba61=_0x1339[_0x2e705f];return _0x30ba61;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x22')]();});}};}function handleEntityNotFound(_0x3f278d,_0x14c1cb){return function(_0x4483ef){if(!_0x4483ef){_0x3f278d[_0x9133('0x23')](0x194);}return _0x4483ef;};}function handleError(_0x294332,_0x313d43){_0x313d43=_0x313d43||0x1f4;return function(_0x1b6b3e){logger[_0x9133('0x24')](_0x1b6b3e['stack']);if(_0x1b6b3e['name']){delete _0x1b6b3e[_0x9133('0x25')];}_0x294332[_0x9133('0x1a')](_0x313d43)[_0x9133('0x26')](_0x1b6b3e);};}exports[_0x9133('0x27')]=function(_0x4de894,_0x4ecd9e){var _0x3e2404={},_0x45966d={},_0x188c49={'count':0x0,'rows':[]};var _0x26d351=_[_0x9133('0x28')](db[_0x9133('0x29')]['rawAttributes'],function(_0x58afe0){return{'name':_0x58afe0['fieldName'],'type':_0x58afe0[_0x9133('0x2a')]['key']};});_0x45966d[_0x9133('0x2b')]=_[_0x9133('0x28')](_0x26d351,'name');_0x45966d[_0x9133('0x2c')]=_['keys'](_0x4de894[_0x9133('0x2c')]);_0x45966d[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x45966d['model'],_0x45966d[_0x9133('0x2c')]);_0x3e2404[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x45966d['model'],qs[_0x9133('0x30')](_0x4de894[_0x9133('0x2c')][_0x9133('0x30')]));_0x3e2404['attributes']=_0x3e2404[_0x9133('0x2f')][_0x9133('0x31')]?_0x3e2404[_0x9133('0x2f')]:_0x45966d[_0x9133('0x2b')];if(!_0x4de894['query'][_0x9133('0x32')](_0x9133('0x33'))){_0x3e2404['limit']=qs[_0x9133('0x1d')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1d')]);_0x3e2404[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1e')]);}_0x3e2404[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4de894[_0x9133('0x2c')][_0x9133('0x35')]);_0x3e2404['where']=qs[_0x9133('0x2d')](_[_0x9133('0x36')](_0x4de894['query'],_0x45966d[_0x9133('0x2d')]),_0x26d351);if(_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]){_0x3e2404[_0x9133('0x38')]=_[_0x9133('0x39')](_0x3e2404[_0x9133('0x38')],{'$or':_['map'](_0x26d351,function(_0x4e16d2){if(_0x4e16d2[_0x9133('0x2a')]!==_0x9133('0x3a')){var _0x156905={};_0x156905[_0x4e16d2[_0x9133('0x25')]]={'$like':'%'+_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]+'%'};return _0x156905;}})});}_0x3e2404=_[_0x9133('0x39')]({},_0x3e2404,_0x4de894[_0x9133('0x3b')]);var _0x720048={'where':_0x3e2404['where']};return db[_0x9133('0x29')][_0x9133('0x3c')](_0x720048)[_0x9133('0x20')](function(_0x199ae9){_0x188c49[_0x9133('0x3c')]=_0x199ae9;if(_0x4de894['query'][_0x9133('0x3d')]){_0x3e2404[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x29')][_0x9133('0x3f')](_0x3e2404);})['then'](function(_0x146734){_0x188c49[_0x9133('0x40')]=_0x146734;return _0x188c49;})[_0x9133('0x20')](respondWithFilteredResult(_0x4ecd9e,_0x3e2404))[_0x9133('0x41')](handleError(_0x4ecd9e,null));};exports[_0x9133('0x42')]=function(_0x338049,_0x3b2287){var _0x4ca1a3={'raw':!![],'where':{'id':_0x338049['params']['id']}},_0x7f6cd9={};_0x7f6cd9['model']=_[_0x9133('0x43')](db[_0x9133('0x29')][_0x9133('0x44')]);_0x7f6cd9[_0x9133('0x2c')]=_[_0x9133('0x43')](_0x338049[_0x9133('0x2c')]);_0x7f6cd9[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],_0x7f6cd9['query']);_0x4ca1a3[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],qs['fields'](_0x338049['query'][_0x9133('0x30')]));_0x4ca1a3[_0x9133('0x2f')]=_0x4ca1a3['attributes'][_0x9133('0x31')]?_0x4ca1a3[_0x9133('0x2f')]:_0x7f6cd9[_0x9133('0x2b')];if(_0x338049[_0x9133('0x2c')][_0x9133('0x3d')]){_0x4ca1a3['include']=[{'all':!![]}];}_0x4ca1a3=_[_0x9133('0x39')]({},_0x4ca1a3,_0x338049[_0x9133('0x3b')]);return db[_0x9133('0x29')]['find'](_0x4ca1a3)[_0x9133('0x20')](handleEntityNotFound(_0x3b2287,null))[_0x9133('0x20')](respondWithResult(_0x3b2287,null))['catch'](handleError(_0x3b2287,null));};exports['create']=function(_0x42c188,_0x2cd935){return db[_0x9133('0x29')][_0x9133('0x45')](_0x42c188[_0x9133('0x46')],{})[_0x9133('0x20')](respondWithResult(_0x2cd935,0xc9))[_0x9133('0x41')](handleError(_0x2cd935,null));};exports[_0x9133('0x47')]=function(_0x23f134,_0xf07fbb){if(_0x23f134[_0x9133('0x46')]['id']){delete _0x23f134[_0x9133('0x46')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x23f134[_0x9133('0x48')]['id']}})['then'](handleEntityNotFound(_0xf07fbb,null))[_0x9133('0x20')](saveUpdates(_0x23f134[_0x9133('0x46')],null))[_0x9133('0x20')](respondWithResult(_0xf07fbb,null))[_0x9133('0x41')](handleError(_0xf07fbb,null));};exports['destroy']=function(_0x2a3848,_0x25750f){return db[_0x9133('0x29')]['find']({'where':{'id':_0x2a3848[_0x9133('0x48')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x25750f,null))[_0x9133('0x20')](removeEntity(_0x25750f,null))['catch'](handleError(_0x25750f,null));};exports[_0x9133('0x49')]=function(_0x4f7b1e,_0x2342f4){return db[_0x9133('0x29')][_0x9133('0x49')]()[_0x9133('0x20')](respondWithResult(_0x2342f4,null))['catch'](handleError(_0x2342f4,null));}; \ No newline at end of file +var _0x6cb4=['apply','reject','save','update','then','stack','name','send','index','map','WhatsappQueueReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','includeAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range'];(function(_0x2ad6b2,_0x5b7de){var _0x5a318f=function(_0x325a64){while(--_0x325a64){_0x2ad6b2['push'](_0x2ad6b2['shift']());}};_0x5a318f(++_0x5b7de);}(_0x6cb4,0xff));var _0x46cb=function(_0xa42ce7,_0x165b03){_0xa42ce7=_0xa42ce7-0x0;var _0x1dab48=_0x6cb4[_0xa42ce7];return _0x1dab48;};'use strict';var emlformat=require(_0x46cb('0x0'));var rimraf=require(_0x46cb('0x1'));var zipdir=require(_0x46cb('0x2'));var jsonpatch=require(_0x46cb('0x3'));var rp=require(_0x46cb('0x4'));var moment=require(_0x46cb('0x5'));var BPromise=require(_0x46cb('0x6'));var Mustache=require(_0x46cb('0x7'));var util=require(_0x46cb('0x8'));var path=require('path');var sox=require(_0x46cb('0x9'));var csv=require('to-csv');var ejs=require(_0x46cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0x10'));var querystring=require('querystring');var Papa=require(_0x46cb('0x11'));var Redis=require(_0x46cb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x13'));var as=require(_0x46cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x15'))(_0x46cb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x46cb('0x17'))['db'];function respondWithStatusCode(_0x323ac2,_0x1058a8){_0x1058a8=_0x1058a8||0xcc;return function(_0xf22158){if(_0xf22158){return _0x323ac2['sendStatus'](_0x1058a8);}return _0x323ac2[_0x46cb('0x18')](_0x1058a8)[_0x46cb('0x19')]();};}function respondWithResult(_0x2a1f9d,_0x3c0071){_0x3c0071=_0x3c0071||0xc8;return function(_0x1f7150){if(_0x1f7150){return _0x2a1f9d[_0x46cb('0x18')](_0x3c0071)[_0x46cb('0x1a')](_0x1f7150);}};}function respondWithFilteredResult(_0x3c396b,_0x37d368){return function(_0x41e398){if(_0x41e398){var _0x136215=typeof _0x37d368['offset']===_0x46cb('0x1b')&&typeof _0x37d368['limit']===_0x46cb('0x1b');var _0x4ab22b=_0x41e398['count'];var _0x4e3454=_0x136215?0x0:_0x37d368[_0x46cb('0x1c')];var _0x1f2891=_0x136215?_0x41e398[_0x46cb('0x1d')]:_0x37d368[_0x46cb('0x1c')]+_0x37d368[_0x46cb('0x1e')];var _0x26e38d;if(_0x1f2891>=_0x4ab22b){_0x1f2891=_0x4ab22b;_0x26e38d=0xc8;}else{_0x26e38d=0xce;}_0x3c396b[_0x46cb('0x18')](_0x26e38d);return _0x3c396b[_0x46cb('0x1f')](_0x46cb('0x20'),_0x4e3454+'-'+_0x1f2891+'/'+_0x4ab22b)[_0x46cb('0x1a')](_0x41e398);}return null;};}function patchUpdates(_0x149483){return function(_0x46e541){try{jsonpatch[_0x46cb('0x21')](_0x46e541,_0x149483,!![]);}catch(_0x2f438b){return BPromise[_0x46cb('0x22')](_0x2f438b);}return _0x46e541[_0x46cb('0x23')]();};}function saveUpdates(_0x7084b2,_0x1fb467){return function(_0x41ecd2){if(_0x41ecd2){return _0x41ecd2[_0x46cb('0x24')](_0x7084b2)[_0x46cb('0x25')](function(_0x1e9e38){return _0x1e9e38;});}return null;};}function removeEntity(_0x309e4b,_0xadcad6){return function(_0x40e0e5){if(_0x40e0e5){return _0x40e0e5['destroy']()['then'](function(){_0x309e4b[_0x46cb('0x18')](0xcc)[_0x46cb('0x19')]();});}};}function handleEntityNotFound(_0x2711ac,_0xe078a8){return function(_0x6e6d9){if(!_0x6e6d9){_0x2711ac['sendStatus'](0x194);}return _0x6e6d9;};}function handleError(_0xc5a9a4,_0x578ffd){_0x578ffd=_0x578ffd||0x1f4;return function(_0x495886){logger['error'](_0x495886[_0x46cb('0x26')]);if(_0x495886[_0x46cb('0x27')]){delete _0x495886[_0x46cb('0x27')];}_0xc5a9a4[_0x46cb('0x18')](_0x578ffd)[_0x46cb('0x28')](_0x495886);};}exports[_0x46cb('0x29')]=function(_0x378dc7,_0x8c65b2){var _0x2b846a={},_0x12e01e={},_0x4620ef={'count':0x0,'rows':[]};var _0x4a1517=_[_0x46cb('0x2a')](db[_0x46cb('0x2b')]['rawAttributes'],function(_0x49e0bc){return{'name':_0x49e0bc[_0x46cb('0x2c')],'type':_0x49e0bc['type'][_0x46cb('0x2d')]};});_0x12e01e[_0x46cb('0x2e')]=_[_0x46cb('0x2a')](_0x4a1517,_0x46cb('0x27'));_0x12e01e[_0x46cb('0x2f')]=_[_0x46cb('0x30')](_0x378dc7['query']);_0x12e01e[_0x46cb('0x31')]=_['intersection'](_0x12e01e[_0x46cb('0x2e')],_0x12e01e[_0x46cb('0x2f')]);_0x2b846a['attributes']=_[_0x46cb('0x32')](_0x12e01e[_0x46cb('0x2e')],qs[_0x46cb('0x33')](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x33')]));_0x2b846a['attributes']=_0x2b846a[_0x46cb('0x34')]['length']?_0x2b846a[_0x46cb('0x34')]:_0x12e01e[_0x46cb('0x2e')];if(!_0x378dc7[_0x46cb('0x2f')]['hasOwnProperty'](_0x46cb('0x35'))){_0x2b846a[_0x46cb('0x1e')]=qs['limit'](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x1e')]);_0x2b846a[_0x46cb('0x1c')]=qs[_0x46cb('0x1c')](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x1c')]);}_0x2b846a[_0x46cb('0x36')]=qs[_0x46cb('0x37')](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x37')]);_0x2b846a[_0x46cb('0x38')]=qs['filters'](_['pick'](_0x378dc7['query'],_0x12e01e[_0x46cb('0x31')]),_0x4a1517);if(_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x39')]){_0x2b846a[_0x46cb('0x38')]=_[_0x46cb('0x3a')](_0x2b846a[_0x46cb('0x38')],{'$or':_['map'](_0x4a1517,function(_0x1f2e11){if(_0x1f2e11['type']!=='VIRTUAL'){var _0x173fac={};_0x173fac[_0x1f2e11['name']]={'$like':'%'+_0x378dc7['query'][_0x46cb('0x39')]+'%'};return _0x173fac;}})});}_0x2b846a=_['merge']({},_0x2b846a,_0x378dc7['options']);var _0x67bd14={'where':_0x2b846a[_0x46cb('0x38')]};return db[_0x46cb('0x2b')][_0x46cb('0x1d')](_0x67bd14)[_0x46cb('0x25')](function(_0x4075b4){_0x4620ef[_0x46cb('0x1d')]=_0x4075b4;if(_0x378dc7['query'][_0x46cb('0x3b')]){_0x2b846a['include']=[{'all':!![]}];}return db[_0x46cb('0x2b')]['findAll'](_0x2b846a);})[_0x46cb('0x25')](function(_0x2fbad9){_0x4620ef[_0x46cb('0x3c')]=_0x2fbad9;return _0x4620ef;})['then'](respondWithFilteredResult(_0x8c65b2,_0x2b846a))[_0x46cb('0x3d')](handleError(_0x8c65b2,null));};exports[_0x46cb('0x3e')]=function(_0x4d24b6,_0x18be96){var _0x3d0b83={'raw':!![],'where':{'id':_0x4d24b6[_0x46cb('0x3f')]['id']}},_0x1f67af={};_0x1f67af[_0x46cb('0x2e')]=_['keys'](db['WhatsappQueueReport'][_0x46cb('0x40')]);_0x1f67af['query']=_[_0x46cb('0x30')](_0x4d24b6[_0x46cb('0x2f')]);_0x1f67af['filters']=_[_0x46cb('0x32')](_0x1f67af[_0x46cb('0x2e')],_0x1f67af[_0x46cb('0x2f')]);_0x3d0b83['attributes']=_['intersection'](_0x1f67af['model'],qs['fields'](_0x4d24b6[_0x46cb('0x2f')][_0x46cb('0x33')]));_0x3d0b83[_0x46cb('0x34')]=_0x3d0b83[_0x46cb('0x34')][_0x46cb('0x41')]?_0x3d0b83['attributes']:_0x1f67af['model'];if(_0x4d24b6[_0x46cb('0x2f')][_0x46cb('0x3b')]){_0x3d0b83['include']=[{'all':!![]}];}_0x3d0b83=_[_0x46cb('0x3a')]({},_0x3d0b83,_0x4d24b6[_0x46cb('0x42')]);return db[_0x46cb('0x2b')][_0x46cb('0x43')](_0x3d0b83)[_0x46cb('0x25')](handleEntityNotFound(_0x18be96,null))[_0x46cb('0x25')](respondWithResult(_0x18be96,null))[_0x46cb('0x3d')](handleError(_0x18be96,null));};exports['create']=function(_0x58c69f,_0x449593){return db['WhatsappQueueReport'][_0x46cb('0x44')](_0x58c69f[_0x46cb('0x45')],{})[_0x46cb('0x25')](respondWithResult(_0x449593,0xc9))['catch'](handleError(_0x449593,null));};exports[_0x46cb('0x24')]=function(_0x5c1665,_0x5c02c9){if(_0x5c1665[_0x46cb('0x45')]['id']){delete _0x5c1665[_0x46cb('0x45')]['id'];}return db[_0x46cb('0x2b')][_0x46cb('0x43')]({'where':{'id':_0x5c1665[_0x46cb('0x3f')]['id']}})[_0x46cb('0x25')](handleEntityNotFound(_0x5c02c9,null))[_0x46cb('0x25')](saveUpdates(_0x5c1665['body'],null))['then'](respondWithResult(_0x5c02c9,null))[_0x46cb('0x3d')](handleError(_0x5c02c9,null));};exports[_0x46cb('0x46')]=function(_0x52e479,_0x34399d){return db[_0x46cb('0x2b')][_0x46cb('0x43')]({'where':{'id':_0x52e479[_0x46cb('0x3f')]['id']}})[_0x46cb('0x25')](handleEntityNotFound(_0x34399d,null))['then'](removeEntity(_0x34399d,null))[_0x46cb('0x3d')](handleError(_0x34399d,null));};exports[_0x46cb('0x47')]=function(_0x20cf6d,_0x52d1a7){return db[_0x46cb('0x2b')]['describe']()['then'](respondWithResult(_0x52d1a7,null))[_0x46cb('0x3d')](handleError(_0x52d1a7,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 14fe149..c4c9fac 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e80=['bluebird','request-promise','path','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2e80,0x14c));var _0x02e8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2e80[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x02e8('0x0'));var moment=require('moment');var BPromise=require(_0x02e8('0x1'));var rp=require(_0x02e8('0x2'));var fs=require('fs');var path=require(_0x02e8('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x02e8('0x4')]=function(_0xab03f4,_0x5b5403){return _0xab03f4[_0x02e8('0x5')](_0x02e8('0x6'),attributes,{'tableName':_0x02e8('0x7'),'paranoid':![],'indexes':[{'name':_0x02e8('0x8'),'fields':[_0x02e8('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc277=['lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','define','uniqueid'];(function(_0x1680ea,_0x3c6c58){var _0x25c2a8=function(_0x1571c8){while(--_0x1571c8){_0x1680ea['push'](_0x1680ea['shift']());}};_0x25c2a8(++_0x3c6c58);}(_0xc277,0x104));var _0x7c27=function(_0x4e33b2,_0x320b65){_0x4e33b2=_0x4e33b2-0x0;var _0x2564c8=_0xc277[_0x4e33b2];return _0x2564c8;};'use strict';var _=require(_0x7c27('0x0'));var util=require(_0x7c27('0x1'));var logger=require(_0x7c27('0x2'))(_0x7c27('0x3'));var moment=require('moment');var BPromise=require(_0x7c27('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c27('0x5'));var rimraf=require(_0x7c27('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x7c27('0x7')]=function(_0x105a33,_0x44c5d5){return _0x105a33[_0x7c27('0x8')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x7c27('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index d55b47b..920e1f5 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf7d=['randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','raw','debug','update','options','where','attributes','UpdateWhatsappQueueReport','lodash','util'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xbf7d,0x16a));var _0xdbf7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf7d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdbf7('0x0'));var util=require(_0xdbf7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdbf7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbf7('0x3'))['db'];var utils=require(_0xdbf7('0x4'));var logger=require(_0xdbf7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdbf7('0x6'));var client=jayson[_0xdbf7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42080d,_0x284575,_0x4be169){return new BPromise(function(_0xc1df0,_0x417017){return client[_0xdbf7('0x8')](_0x42080d,_0x4be169)[_0xdbf7('0x9')](function(_0x2f9d22){logger[_0xdbf7('0xa')](_0xdbf7('0xb'),_0x284575,_0xdbf7('0xc'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x284575,_0xdbf7('0xc'),JSON[_0xdbf7('0xd')](_0x2f9d22));if(_0x2f9d22[_0xdbf7('0xe')]){if(_0x2f9d22[_0xdbf7('0xe')]['code']===0x1f4){logger[_0xdbf7('0xe')](_0xdbf7('0xb'),_0x284575,_0x2f9d22[_0xdbf7('0xe')]['message']);return _0x417017(_0x2f9d22[_0xdbf7('0xe')][_0xdbf7('0xf')]);}logger[_0xdbf7('0xe')](_0xdbf7('0xb'),_0x284575,_0x2f9d22[_0xdbf7('0xe')][_0xdbf7('0xf')]);return _0xc1df0(_0x2f9d22[_0xdbf7('0xe')]['message']);}else{logger['info'](_0xdbf7('0xb'),_0x284575,_0xdbf7('0xc'));_0xc1df0(_0x2f9d22['result'][_0xdbf7('0xf')]);}})[_0xdbf7('0x10')](function(_0x365361){logger[_0xdbf7('0xe')](_0xdbf7('0xb'),_0x284575,_0x365361);_0x417017(_0x365361);});});}exports[_0xdbf7('0x11')]=function(_0x518053){var _0x4a8e57=this;return new Promise(function(_0x403e81,_0x5b18a8){return db[_0xdbf7('0x12')][_0xdbf7('0x13')](_0x518053[_0xdbf7('0x14')],{'raw':_0x518053['options']?_0x518053['options'][_0xdbf7('0x15')]===undefined?!![]:![]:!![]})[_0xdbf7('0x9')](function(_0xea0ded){logger[_0xdbf7('0xa')](_0xdbf7('0x11'),_0x518053);logger[_0xdbf7('0x16')]('CreateWhatsappQueueReport',_0x518053,JSON['stringify'](_0xea0ded));_0x403e81(_0xea0ded);})['catch'](function(_0x4cc944){logger['error']('CreateWhatsappQueueReport',_0x4cc944[_0xdbf7('0xf')],_0x518053);_0x5b18a8(_0x4a8e57[_0xdbf7('0xe')](0x1f4,_0x4cc944[_0xdbf7('0xf')]));});});};exports['UpdateWhatsappQueueReport']=function(_0xa6342e){var _0x12e260=this;return new Promise(function(_0x3fe87f,_0x38d55a){return db[_0xdbf7('0x12')][_0xdbf7('0x17')](_0xa6342e[_0xdbf7('0x14')],{'raw':_0xa6342e[_0xdbf7('0x18')]?_0xa6342e[_0xdbf7('0x18')][_0xdbf7('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa6342e[_0xdbf7('0x18')]?_0xa6342e[_0xdbf7('0x18')][_0xdbf7('0x19')]||null:null,'attributes':_0xa6342e['options']?_0xa6342e[_0xdbf7('0x18')][_0xdbf7('0x1a')]||null:null,'limit':_0xa6342e[_0xdbf7('0x18')]?_0xa6342e[_0xdbf7('0x18')]['limit']||null:null})[_0xdbf7('0x9')](function(_0x5454fe){logger[_0xdbf7('0xa')](_0xdbf7('0x1b'),_0xa6342e);logger[_0xdbf7('0x16')](_0xdbf7('0x1b'),_0xa6342e,JSON['stringify'](_0x5454fe));_0x3fe87f(_0x5454fe);})['catch'](function(_0x54d07d){logger[_0xdbf7('0xe')](_0xdbf7('0x1b'),_0x54d07d[_0xdbf7('0xf')],_0xa6342e);_0x38d55a(_0x12e260[_0xdbf7('0xe')](0x1f4,_0x54d07d[_0xdbf7('0xf')]));});});}; \ No newline at end of file +var _0x3dd5=['UpdateWhatsappQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','debug','body','where','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3dd5,0x1e2));var _0x53dd=function(_0x243b53,_0x5b8264){_0x243b53=_0x243b53-0x0;var _0x4cc63b=_0x3dd5[_0x243b53];return _0x4cc63b;};'use strict';var _=require(_0x53dd('0x0'));var util=require(_0x53dd('0x1'));var moment=require(_0x53dd('0x2'));var BPromise=require(_0x53dd('0x3'));var rs=require(_0x53dd('0x4'));var fs=require('fs');var Redis=require(_0x53dd('0x5'));var db=require(_0x53dd('0x6'))['db'];var utils=require(_0x53dd('0x7'));var logger=require(_0x53dd('0x8'))('rpc');var config=require(_0x53dd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x53dd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30e750,_0x57018b,_0x5ce527){return new BPromise(function(_0x2050ab,_0x34a3ec){return client[_0x53dd('0xb')](_0x30e750,_0x5ce527)[_0x53dd('0xc')](function(_0x4a3369){logger['info'](_0x53dd('0xd'),_0x57018b,_0x53dd('0xe'));logger['debug'](_0x53dd('0xf'),_0x57018b,_0x53dd('0xe'),JSON['stringify'](_0x4a3369));if(_0x4a3369[_0x53dd('0x10')]){if(_0x4a3369['error']['code']===0x1f4){logger[_0x53dd('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x57018b,_0x4a3369[_0x53dd('0x10')][_0x53dd('0x11')]);return _0x34a3ec(_0x4a3369[_0x53dd('0x10')][_0x53dd('0x11')]);}logger[_0x53dd('0x10')](_0x53dd('0xd'),_0x57018b,_0x4a3369[_0x53dd('0x10')][_0x53dd('0x11')]);return _0x2050ab(_0x4a3369[_0x53dd('0x10')][_0x53dd('0x11')]);}else{logger[_0x53dd('0x12')](_0x53dd('0xd'),_0x57018b,_0x53dd('0xe'));_0x2050ab(_0x4a3369['result']['message']);}})[_0x53dd('0x13')](function(_0x24d726){logger[_0x53dd('0x10')](_0x53dd('0xd'),_0x57018b,_0x24d726);_0x34a3ec(_0x24d726);});});}exports[_0x53dd('0x14')]=function(_0xb3e07c){var _0x9ca6a0=this;return new Promise(function(_0x5a70dc,_0x5eb40d){return db[_0x53dd('0x15')][_0x53dd('0x16')](_0xb3e07c['body'],{'raw':_0xb3e07c[_0x53dd('0x17')]?_0xb3e07c[_0x53dd('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x53dd('0xc')](function(_0x19d7ed){logger[_0x53dd('0x12')](_0x53dd('0x14'),_0xb3e07c);logger[_0x53dd('0x18')](_0x53dd('0x14'),_0xb3e07c,JSON['stringify'](_0x19d7ed));_0x5a70dc(_0x19d7ed);})[_0x53dd('0x13')](function(_0x3b3778){logger[_0x53dd('0x10')]('CreateWhatsappQueueReport',_0x3b3778[_0x53dd('0x11')],_0xb3e07c);_0x5eb40d(_0x9ca6a0[_0x53dd('0x10')](0x1f4,_0x3b3778['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0xf2221a){var _0x4b20aa=this;return new Promise(function(_0x35f041,_0x547f2b){return db[_0x53dd('0x15')]['update'](_0xf2221a[_0x53dd('0x19')],{'raw':_0xf2221a[_0x53dd('0x17')]?_0xf2221a[_0x53dd('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf2221a[_0x53dd('0x17')]?_0xf2221a[_0x53dd('0x17')][_0x53dd('0x1a')]||null:null,'attributes':_0xf2221a[_0x53dd('0x17')]?_0xf2221a['options'][_0x53dd('0x1b')]||null:null,'limit':_0xf2221a[_0x53dd('0x17')]?_0xf2221a[_0x53dd('0x17')]['limit']||null:null})['then'](function(_0x5e47a6){logger[_0x53dd('0x12')](_0x53dd('0x1c'),_0xf2221a);logger['debug'](_0x53dd('0x1c'),_0xf2221a,JSON[_0x53dd('0x1d')](_0x5e47a6));_0x35f041(_0x5e47a6);})[_0x53dd('0x13')](function(_0x474d99){logger[_0x53dd('0x10')](_0x53dd('0x1c'),_0x474d99[_0x53dd('0x11')],_0xf2221a);_0x547f2b(_0x4b20aa['error'](0x1f4,_0x474d99[_0x53dd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 882989f..ccf5a0d 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec4=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0xbec4,0x1d8));var _0x4bec=function(_0x275947,_0x25fa1b){_0x275947=_0x275947-0x0;var _0x4d08c6=_0xbec4[_0x275947];return _0x4d08c6;};'use strict';var multer=require(_0x4bec('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4bec('0x1'));var express=require(_0x4bec('0x2'));var router=express['Router']();var fs_extra=require(_0x4bec('0x3'));var auth=require(_0x4bec('0x4'));var interaction=require(_0x4bec('0x5'));var config=require(_0x4bec('0x6'));var controller=require(_0x4bec('0x7'));router[_0x4bec('0x8')]('/',auth[_0x4bec('0x9')](),controller[_0x4bec('0xa')]);router['get'](_0x4bec('0xb'),auth[_0x4bec('0x9')](),controller[_0x4bec('0xc')]);router[_0x4bec('0x8')](_0x4bec('0xd'),auth[_0x4bec('0x9')](),controller[_0x4bec('0xe')]);router['post']('/',auth[_0x4bec('0x9')](),controller[_0x4bec('0xf')]);router[_0x4bec('0x10')]('/:id',auth[_0x4bec('0x9')](),controller['update']);router[_0x4bec('0x11')](_0x4bec('0xd'),auth[_0x4bec('0x9')](),controller[_0x4bec('0x12')]);module[_0x4bec('0x13')]=router; \ No newline at end of file +var _0x81fa=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','update'];(function(_0x3ffba0,_0x1e16ff){var _0x276413=function(_0x22f9fd){while(--_0x22f9fd){_0x3ffba0['push'](_0x3ffba0['shift']());}};_0x276413(++_0x1e16ff);}(_0x81fa,0xdf));var _0xa81f=function(_0x2baa5d,_0x42a1cb){_0x2baa5d=_0x2baa5d-0x0;var _0x88bf18=_0x81fa[_0x2baa5d];return _0x88bf18;};'use strict';var multer=require(_0xa81f('0x0'));var util=require(_0xa81f('0x1'));var path=require(_0xa81f('0x2'));var timeout=require(_0xa81f('0x3'));var express=require(_0xa81f('0x4'));var router=express[_0xa81f('0x5')]();var fs_extra=require(_0xa81f('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa81f('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xa81f('0x8')]('/',auth[_0xa81f('0x9')](),controller[_0xa81f('0xa')]);router[_0xa81f('0x8')](_0xa81f('0xb'),auth[_0xa81f('0x9')](),controller['describe']);router[_0xa81f('0x8')](_0xa81f('0xc'),auth['isAuthenticated'](),controller[_0xa81f('0xd')]);router['post']('/',auth[_0xa81f('0x9')](),controller['create']);router['put'](_0xa81f('0xc'),auth[_0xa81f('0x9')](),controller[_0xa81f('0xe')]);router[_0xa81f('0xf')](_0xa81f('0xc'),auth[_0xa81f('0x9')](),controller[_0xa81f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 004af67..a743a72 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc224=['account','agent','queue','DATE','sequelize','exports','STRING'];(function(_0x351135,_0x245ea1){var _0x56f3d6=function(_0x4d2f48){while(--_0x4d2f48){_0x351135['push'](_0x351135['shift']());}};_0x56f3d6(++_0x245ea1);}(_0xc224,0x1af));var _0x4c22=function(_0x56dc38,_0x4e6057){_0x56dc38=_0x56dc38-0x0;var _0x9940ef=_0xc224[_0x56dc38];return _0x9940ef;};'use strict';var Sequelize=require(_0x4c22('0x0'));module[_0x4c22('0x1')]={'uniqueid':{'type':Sequelize[_0x4c22('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4c22('0x3'),_0x4c22('0x4'),_0x4c22('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4c22('0x6')]}}; \ No newline at end of file +var _0x75dc=['DATE','sequelize','exports','agent','queue'];(function(_0xf11d52,_0x54d5bf){var _0x256cba=function(_0x38ad63){while(--_0x38ad63){_0xf11d52['push'](_0xf11d52['shift']());}};_0x256cba(++_0x54d5bf);}(_0x75dc,0x1d7));var _0xc75d=function(_0x5c3891,_0x284f4c){_0x5c3891=_0x5c3891-0x0;var _0x34ecda=_0x75dc[_0x5c3891];return _0x34ecda;};'use strict';var Sequelize=require(_0xc75d('0x0'));module[_0xc75d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xc75d('0x2'),_0xc75d('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc75d('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index fec4b2f..2221937 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf767=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','WhatsappTransferReport','includeAll','findAll','rows','catch','params','keys','include','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf767,0x183));var _0x7f76=function(_0x1d211b,_0x475f3b){_0x1d211b=_0x1d211b-0x0;var _0x47c88b=_0xf767[_0x1d211b];return _0x47c88b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f76('0x0'));var jsonpatch=require(_0x7f76('0x1'));var rp=require(_0x7f76('0x2'));var moment=require(_0x7f76('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7f76('0x4'));var csv=require(_0x7f76('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f76('0x6'));var squel=require(_0x7f76('0x7'));var crypto=require('crypto');var jsforce=require(_0x7f76('0x8'));var deskjs=require(_0x7f76('0x9'));var toCsv=require('to-csv');var querystring=require(_0x7f76('0xa'));var Papa=require(_0x7f76('0xb'));var Redis=require(_0x7f76('0xc'));var authService=require(_0x7f76('0xd'));var qs=require(_0x7f76('0xe'));var as=require(_0x7f76('0xf'));var hardwareService=require(_0x7f76('0x10'));var logger=require(_0x7f76('0x11'))(_0x7f76('0x12'));var utils=require('../../config/utils');var config=require(_0x7f76('0x13'));var licenseUtil=require(_0x7f76('0x14'));var db=require(_0x7f76('0x15'))['db'];function respondWithStatusCode(_0x3a675,_0x3fd304){_0x3fd304=_0x3fd304||0xcc;return function(_0x16e939){if(_0x16e939){return _0x3a675[_0x7f76('0x16')](_0x3fd304);}return _0x3a675[_0x7f76('0x17')](_0x3fd304)[_0x7f76('0x18')]();};}function respondWithResult(_0x574cf9,_0x720f71){_0x720f71=_0x720f71||0xc8;return function(_0x3d93c0){if(_0x3d93c0){return _0x574cf9[_0x7f76('0x17')](_0x720f71)[_0x7f76('0x19')](_0x3d93c0);}};}function respondWithFilteredResult(_0x564b4f,_0x10010f){return function(_0x3e42a9){if(_0x3e42a9){var _0x436a2d=typeof _0x10010f['offset']==='undefined'&&typeof _0x10010f[_0x7f76('0x1a')]==='undefined';var _0x376f3d=_0x3e42a9[_0x7f76('0x1b')];var _0x380fd7=_0x436a2d?0x0:_0x10010f[_0x7f76('0x1c')];var _0x5c98c1=_0x436a2d?_0x3e42a9['count']:_0x10010f[_0x7f76('0x1c')]+_0x10010f[_0x7f76('0x1a')];var _0x588551;if(_0x5c98c1>=_0x376f3d){_0x5c98c1=_0x376f3d;_0x588551=0xc8;}else{_0x588551=0xce;}_0x564b4f[_0x7f76('0x17')](_0x588551);return _0x564b4f[_0x7f76('0x1d')](_0x7f76('0x1e'),_0x380fd7+'-'+_0x5c98c1+'/'+_0x376f3d)[_0x7f76('0x19')](_0x3e42a9);}return null;};}function patchUpdates(_0x5d114f){return function(_0x4c158b){try{jsonpatch['apply'](_0x4c158b,_0x5d114f,!![]);}catch(_0x285639){return BPromise[_0x7f76('0x1f')](_0x285639);}return _0x4c158b['save']();};}function saveUpdates(_0x3797fa,_0x38dae5){return function(_0x586059){if(_0x586059){return _0x586059[_0x7f76('0x20')](_0x3797fa)[_0x7f76('0x21')](function(_0x17b3a1){return _0x17b3a1;});}return null;};}function removeEntity(_0x2ba21e,_0x1b67ac){return function(_0x13d828){if(_0x13d828){return _0x13d828[_0x7f76('0x22')]()[_0x7f76('0x21')](function(){_0x2ba21e[_0x7f76('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x495abf,_0x4f355f){return function(_0x5bcb5d){if(!_0x5bcb5d){_0x495abf[_0x7f76('0x16')](0x194);}return _0x5bcb5d;};}function handleError(_0x47b427,_0x6315de){_0x6315de=_0x6315de||0x1f4;return function(_0x404ae1){logger[_0x7f76('0x23')](_0x404ae1[_0x7f76('0x24')]);if(_0x404ae1[_0x7f76('0x25')]){delete _0x404ae1['name'];}_0x47b427[_0x7f76('0x17')](_0x6315de)['send'](_0x404ae1);};}exports['index']=function(_0xf035b6,_0x548e26){var _0x23feef={},_0xa1f67c={},_0x306588={'count':0x0,'rows':[]};var _0x5d9c1c=_[_0x7f76('0x26')](db['WhatsappTransferReport'][_0x7f76('0x27')],function(_0x4b0e5d){return{'name':_0x4b0e5d[_0x7f76('0x28')],'type':_0x4b0e5d[_0x7f76('0x29')][_0x7f76('0x2a')]};});_0xa1f67c[_0x7f76('0x2b')]=_['map'](_0x5d9c1c,_0x7f76('0x25'));_0xa1f67c[_0x7f76('0x2c')]=_['keys'](_0xf035b6['query']);_0xa1f67c[_0x7f76('0x2d')]=_['intersection'](_0xa1f67c[_0x7f76('0x2b')],_0xa1f67c['query']);_0x23feef[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0xa1f67c[_0x7f76('0x2b')],qs[_0x7f76('0x30')](_0xf035b6[_0x7f76('0x2c')][_0x7f76('0x30')]));_0x23feef[_0x7f76('0x2e')]=_0x23feef[_0x7f76('0x2e')][_0x7f76('0x31')]?_0x23feef[_0x7f76('0x2e')]:_0xa1f67c[_0x7f76('0x2b')];if(!_0xf035b6[_0x7f76('0x2c')][_0x7f76('0x32')](_0x7f76('0x33'))){_0x23feef[_0x7f76('0x1a')]=qs[_0x7f76('0x1a')](_0xf035b6[_0x7f76('0x2c')][_0x7f76('0x1a')]);_0x23feef['offset']=qs[_0x7f76('0x1c')](_0xf035b6[_0x7f76('0x2c')][_0x7f76('0x1c')]);}_0x23feef[_0x7f76('0x34')]=qs[_0x7f76('0x35')](_0xf035b6['query']['sort']);_0x23feef[_0x7f76('0x36')]=qs['filters'](_[_0x7f76('0x37')](_0xf035b6[_0x7f76('0x2c')],_0xa1f67c['filters']),_0x5d9c1c);if(_0xf035b6[_0x7f76('0x2c')]['filter']){_0x23feef[_0x7f76('0x36')]=_[_0x7f76('0x38')](_0x23feef[_0x7f76('0x36')],{'$or':_[_0x7f76('0x26')](_0x5d9c1c,function(_0x26cbb5){if(_0x26cbb5[_0x7f76('0x29')]!==_0x7f76('0x39')){var _0x2a6b51={};_0x2a6b51[_0x26cbb5[_0x7f76('0x25')]]={'$like':'%'+_0xf035b6[_0x7f76('0x2c')][_0x7f76('0x3a')]+'%'};return _0x2a6b51;}})});}_0x23feef=_['merge']({},_0x23feef,_0xf035b6[_0x7f76('0x3b')]);var _0x5aa791={'where':_0x23feef['where']};return db[_0x7f76('0x3c')][_0x7f76('0x1b')](_0x5aa791)[_0x7f76('0x21')](function(_0x2ab88e){_0x306588[_0x7f76('0x1b')]=_0x2ab88e;if(_0xf035b6['query'][_0x7f76('0x3d')]){_0x23feef['include']=[{'all':!![]}];}return db[_0x7f76('0x3c')][_0x7f76('0x3e')](_0x23feef);})['then'](function(_0x479eb4){_0x306588[_0x7f76('0x3f')]=_0x479eb4;return _0x306588;})['then'](respondWithFilteredResult(_0x548e26,_0x23feef))[_0x7f76('0x40')](handleError(_0x548e26,null));};exports['show']=function(_0x28ce7e,_0xc4f9f6){var _0x3e21b2={'raw':!![],'where':{'id':_0x28ce7e[_0x7f76('0x41')]['id']}},_0xe6945e={};_0xe6945e[_0x7f76('0x2b')]=_[_0x7f76('0x42')](db[_0x7f76('0x3c')]['rawAttributes']);_0xe6945e['query']=_['keys'](_0x28ce7e['query']);_0xe6945e[_0x7f76('0x2d')]=_['intersection'](_0xe6945e['model'],_0xe6945e['query']);_0x3e21b2['attributes']=_[_0x7f76('0x2f')](_0xe6945e[_0x7f76('0x2b')],qs[_0x7f76('0x30')](_0x28ce7e[_0x7f76('0x2c')][_0x7f76('0x30')]));_0x3e21b2[_0x7f76('0x2e')]=_0x3e21b2[_0x7f76('0x2e')]['length']?_0x3e21b2[_0x7f76('0x2e')]:_0xe6945e['model'];if(_0x28ce7e['query'][_0x7f76('0x3d')]){_0x3e21b2[_0x7f76('0x43')]=[{'all':!![]}];}_0x3e21b2=_[_0x7f76('0x38')]({},_0x3e21b2,_0x28ce7e[_0x7f76('0x3b')]);return db[_0x7f76('0x3c')][_0x7f76('0x44')](_0x3e21b2)[_0x7f76('0x21')](handleEntityNotFound(_0xc4f9f6,null))['then'](respondWithResult(_0xc4f9f6,null))[_0x7f76('0x40')](handleError(_0xc4f9f6,null));};exports[_0x7f76('0x45')]=function(_0xe4d40c,_0x18a8d6){return db[_0x7f76('0x3c')]['create'](_0xe4d40c[_0x7f76('0x46')],{})[_0x7f76('0x21')](respondWithResult(_0x18a8d6,0xc9))[_0x7f76('0x40')](handleError(_0x18a8d6,null));};exports[_0x7f76('0x20')]=function(_0x2cce9c,_0x3db461){if(_0x2cce9c[_0x7f76('0x46')]['id']){delete _0x2cce9c[_0x7f76('0x46')]['id'];}return db[_0x7f76('0x3c')][_0x7f76('0x44')]({'where':{'id':_0x2cce9c[_0x7f76('0x41')]['id']}})[_0x7f76('0x21')](handleEntityNotFound(_0x3db461,null))[_0x7f76('0x21')](saveUpdates(_0x2cce9c[_0x7f76('0x46')],null))[_0x7f76('0x21')](respondWithResult(_0x3db461,null))[_0x7f76('0x40')](handleError(_0x3db461,null));};exports[_0x7f76('0x22')]=function(_0x209b0f,_0xa2ca9a){return db['WhatsappTransferReport'][_0x7f76('0x44')]({'where':{'id':_0x209b0f[_0x7f76('0x41')]['id']}})[_0x7f76('0x21')](handleEntityNotFound(_0xa2ca9a,null))[_0x7f76('0x21')](removeEntity(_0xa2ca9a,null))[_0x7f76('0x40')](handleError(_0xa2ca9a,null));};exports['describe']=function(_0x172fb0,_0x1b68d0){return db[_0x7f76('0x3c')][_0x7f76('0x47')]()[_0x7f76('0x21')](respondWithResult(_0x1b68d0,null))['catch'](handleError(_0x1b68d0,null));}; \ No newline at end of file +var _0x956c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','offset','count','set','Content-Range','apply','update','then','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','WhatsappTransferReport','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs'];(function(_0x3241f3,_0x537340){var _0x29ac16=function(_0x1847a3){while(--_0x1847a3){_0x3241f3['push'](_0x3241f3['shift']());}};_0x29ac16(++_0x537340);}(_0x956c,0x1d5));var _0xc956=function(_0x5cdd2f,_0x77b5b4){_0x5cdd2f=_0x5cdd2f-0x0;var _0x611149=_0x956c[_0x5cdd2f];return _0x611149;};'use strict';var emlformat=require(_0xc956('0x0'));var rimraf=require(_0xc956('0x1'));var zipdir=require(_0xc956('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc956('0x3'));var moment=require(_0xc956('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc956('0x5'));var util=require('util');var path=require(_0xc956('0x6'));var sox=require('sox');var csv=require(_0xc956('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc956('0x8'));var squel=require(_0xc956('0x9'));var crypto=require(_0xc956('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc956('0xb'));var toCsv=require(_0xc956('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc956('0xc'));var qs=require(_0xc956('0xd'));var as=require(_0xc956('0xe'));var hardwareService=require(_0xc956('0xf'));var logger=require(_0xc956('0x10'))(_0xc956('0x11'));var utils=require(_0xc956('0x12'));var config=require(_0xc956('0x13'));var licenseUtil=require(_0xc956('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a2b77,_0xde625d){_0xde625d=_0xde625d||0xcc;return function(_0x125e51){if(_0x125e51){return _0x2a2b77[_0xc956('0x15')](_0xde625d);}return _0x2a2b77[_0xc956('0x16')](_0xde625d)[_0xc956('0x17')]();};}function respondWithResult(_0x5e03f3,_0xe6c45a){_0xe6c45a=_0xe6c45a||0xc8;return function(_0x35431f){if(_0x35431f){return _0x5e03f3[_0xc956('0x16')](_0xe6c45a)[_0xc956('0x18')](_0x35431f);}};}function respondWithFilteredResult(_0x502494,_0x25d1ca){return function(_0x15b41f){if(_0x15b41f){var _0x52dd38=typeof _0x25d1ca['offset']==='undefined'&&typeof _0x25d1ca[_0xc956('0x19')]==='undefined';var _0x16472d=_0x15b41f['count'];var _0x154ec6=_0x52dd38?0x0:_0x25d1ca[_0xc956('0x1a')];var _0x51a8c2=_0x52dd38?_0x15b41f[_0xc956('0x1b')]:_0x25d1ca[_0xc956('0x1a')]+_0x25d1ca[_0xc956('0x19')];var _0x52f7b7;if(_0x51a8c2>=_0x16472d){_0x51a8c2=_0x16472d;_0x52f7b7=0xc8;}else{_0x52f7b7=0xce;}_0x502494[_0xc956('0x16')](_0x52f7b7);return _0x502494[_0xc956('0x1c')](_0xc956('0x1d'),_0x154ec6+'-'+_0x51a8c2+'/'+_0x16472d)[_0xc956('0x18')](_0x15b41f);}return null;};}function patchUpdates(_0x338f88){return function(_0x2cb86b){try{jsonpatch[_0xc956('0x1e')](_0x2cb86b,_0x338f88,!![]);}catch(_0x52bfdf){return BPromise['reject'](_0x52bfdf);}return _0x2cb86b['save']();};}function saveUpdates(_0x3b5518,_0x167974){return function(_0x4e9a1a){if(_0x4e9a1a){return _0x4e9a1a[_0xc956('0x1f')](_0x3b5518)[_0xc956('0x20')](function(_0x98465e){return _0x98465e;});}return null;};}function removeEntity(_0x66f07f,_0x709100){return function(_0x4c6068){if(_0x4c6068){return _0x4c6068['destroy']()[_0xc956('0x20')](function(){_0x66f07f['status'](0xcc)[_0xc956('0x17')]();});}};}function handleEntityNotFound(_0x11bb49,_0x2305ef){return function(_0x27548e){if(!_0x27548e){_0x11bb49['sendStatus'](0x194);}return _0x27548e;};}function handleError(_0x30eb54,_0x273ee2){_0x273ee2=_0x273ee2||0x1f4;return function(_0x47815e){logger['error'](_0x47815e['stack']);if(_0x47815e[_0xc956('0x21')]){delete _0x47815e[_0xc956('0x21')];}_0x30eb54[_0xc956('0x16')](_0x273ee2)[_0xc956('0x22')](_0x47815e);};}exports[_0xc956('0x23')]=function(_0x5246c8,_0xbb5dcf){var _0x1b6685={},_0x35cdaa={},_0x5e1cb6={'count':0x0,'rows':[]};var _0x21c3da=_[_0xc956('0x24')](db['WhatsappTransferReport'][_0xc956('0x25')],function(_0x33eecc){return{'name':_0x33eecc[_0xc956('0x26')],'type':_0x33eecc[_0xc956('0x27')][_0xc956('0x28')]};});_0x35cdaa['model']=_[_0xc956('0x24')](_0x21c3da,_0xc956('0x21'));_0x35cdaa[_0xc956('0x29')]=_[_0xc956('0x2a')](_0x5246c8[_0xc956('0x29')]);_0x35cdaa['filters']=_['intersection'](_0x35cdaa[_0xc956('0x2b')],_0x35cdaa[_0xc956('0x29')]);_0x1b6685[_0xc956('0x2c')]=_[_0xc956('0x2d')](_0x35cdaa[_0xc956('0x2b')],qs[_0xc956('0x2e')](_0x5246c8[_0xc956('0x29')][_0xc956('0x2e')]));_0x1b6685[_0xc956('0x2c')]=_0x1b6685[_0xc956('0x2c')][_0xc956('0x2f')]?_0x1b6685['attributes']:_0x35cdaa[_0xc956('0x2b')];if(!_0x5246c8[_0xc956('0x29')][_0xc956('0x30')](_0xc956('0x31'))){_0x1b6685['limit']=qs[_0xc956('0x19')](_0x5246c8[_0xc956('0x29')][_0xc956('0x19')]);_0x1b6685['offset']=qs[_0xc956('0x1a')](_0x5246c8['query'][_0xc956('0x1a')]);}_0x1b6685[_0xc956('0x32')]=qs[_0xc956('0x33')](_0x5246c8[_0xc956('0x29')][_0xc956('0x33')]);_0x1b6685[_0xc956('0x34')]=qs[_0xc956('0x35')](_[_0xc956('0x36')](_0x5246c8['query'],_0x35cdaa[_0xc956('0x35')]),_0x21c3da);if(_0x5246c8[_0xc956('0x29')]['filter']){_0x1b6685[_0xc956('0x34')]=_[_0xc956('0x37')](_0x1b6685[_0xc956('0x34')],{'$or':_[_0xc956('0x24')](_0x21c3da,function(_0x34920d){if(_0x34920d[_0xc956('0x27')]!==_0xc956('0x38')){var _0x137519={};_0x137519[_0x34920d[_0xc956('0x21')]]={'$like':'%'+_0x5246c8[_0xc956('0x29')]['filter']+'%'};return _0x137519;}})});}_0x1b6685=_['merge']({},_0x1b6685,_0x5246c8[_0xc956('0x39')]);var _0x593b38={'where':_0x1b6685['where']};return db['WhatsappTransferReport'][_0xc956('0x1b')](_0x593b38)[_0xc956('0x20')](function(_0xc1c6c){_0x5e1cb6[_0xc956('0x1b')]=_0xc1c6c;if(_0x5246c8[_0xc956('0x29')][_0xc956('0x3a')]){_0x1b6685[_0xc956('0x3b')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x1b6685);})[_0xc956('0x20')](function(_0x4315f7){_0x5e1cb6[_0xc956('0x3c')]=_0x4315f7;return _0x5e1cb6;})[_0xc956('0x20')](respondWithFilteredResult(_0xbb5dcf,_0x1b6685))[_0xc956('0x3d')](handleError(_0xbb5dcf,null));};exports[_0xc956('0x3e')]=function(_0x2c25bd,_0xf5703c){var _0x1cc734={'raw':!![],'where':{'id':_0x2c25bd[_0xc956('0x3f')]['id']}},_0xa5edea={};_0xa5edea[_0xc956('0x2b')]=_[_0xc956('0x2a')](db['WhatsappTransferReport'][_0xc956('0x25')]);_0xa5edea[_0xc956('0x29')]=_[_0xc956('0x2a')](_0x2c25bd[_0xc956('0x29')]);_0xa5edea[_0xc956('0x35')]=_[_0xc956('0x2d')](_0xa5edea[_0xc956('0x2b')],_0xa5edea['query']);_0x1cc734[_0xc956('0x2c')]=_['intersection'](_0xa5edea[_0xc956('0x2b')],qs[_0xc956('0x2e')](_0x2c25bd[_0xc956('0x29')][_0xc956('0x2e')]));_0x1cc734[_0xc956('0x2c')]=_0x1cc734[_0xc956('0x2c')][_0xc956('0x2f')]?_0x1cc734[_0xc956('0x2c')]:_0xa5edea[_0xc956('0x2b')];if(_0x2c25bd[_0xc956('0x29')]['includeAll']){_0x1cc734['include']=[{'all':!![]}];}_0x1cc734=_[_0xc956('0x37')]({},_0x1cc734,_0x2c25bd[_0xc956('0x39')]);return db[_0xc956('0x40')]['find'](_0x1cc734)[_0xc956('0x20')](handleEntityNotFound(_0xf5703c,null))[_0xc956('0x20')](respondWithResult(_0xf5703c,null))[_0xc956('0x3d')](handleError(_0xf5703c,null));};exports['create']=function(_0x467573,_0x5a1101){return db[_0xc956('0x40')]['create'](_0x467573[_0xc956('0x41')],{})['then'](respondWithResult(_0x5a1101,0xc9))[_0xc956('0x3d')](handleError(_0x5a1101,null));};exports[_0xc956('0x1f')]=function(_0x1fbd45,_0x52230a){if(_0x1fbd45[_0xc956('0x41')]['id']){delete _0x1fbd45[_0xc956('0x41')]['id'];}return db['WhatsappTransferReport'][_0xc956('0x42')]({'where':{'id':_0x1fbd45[_0xc956('0x3f')]['id']}})[_0xc956('0x20')](handleEntityNotFound(_0x52230a,null))['then'](saveUpdates(_0x1fbd45[_0xc956('0x41')],null))['then'](respondWithResult(_0x52230a,null))[_0xc956('0x3d')](handleError(_0x52230a,null));};exports[_0xc956('0x43')]=function(_0x2cac49,_0x80f665){return db[_0xc956('0x40')]['find']({'where':{'id':_0x2cac49[_0xc956('0x3f')]['id']}})[_0xc956('0x20')](handleEntityNotFound(_0x80f665,null))['then'](removeEntity(_0x80f665,null))[_0xc956('0x3d')](handleError(_0x80f665,null));};exports['describe']=function(_0xe9ab9e,_0x56efd0){return db[_0xc956('0x40')][_0xc956('0x44')]()['then'](respondWithResult(_0x56efd0,null))[_0xc956('0x3d')](handleError(_0x56efd0,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 17852f5..75641fa 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89bd=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x2b7a9e,_0x4a1436){var _0x2bfa12=function(_0x18b867){while(--_0x18b867){_0x2b7a9e['push'](_0x2b7a9e['shift']());}};_0x2bfa12(++_0x4a1436);}(_0x89bd,0x1d0));var _0xd89b=function(_0x2ca602,_0x2ce12d){_0x2ca602=_0x2ca602-0x0;var _0x44b1d6=_0x89bd[_0x2ca602];return _0x44b1d6;};'use strict';var _=require(_0xd89b('0x0'));var util=require(_0xd89b('0x1'));var logger=require(_0xd89b('0x2'))(_0xd89b('0x3'));var moment=require('moment');var BPromise=require(_0xd89b('0x4'));var rp=require(_0xd89b('0x5'));var fs=require('fs');var path=require(_0xd89b('0x6'));var rimraf=require(_0xd89b('0x7'));var config=require(_0xd89b('0x8'));var attributes=require(_0xd89b('0x9'));module['exports']=function(_0x2d694e,_0x2f98df){return _0x2d694e[_0xd89b('0xa')](_0xd89b('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xd89b('0xc'),'fields':[_0xd89b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe69=['report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','WhatsappTransferReport'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0xbe69,0x16a));var _0x9be6=function(_0x1abc4f,_0x4c1bc2){_0x1abc4f=_0x1abc4f-0x0;var _0x38f9df=_0xbe69[_0x1abc4f];return _0x38f9df;};'use strict';var _=require(_0x9be6('0x0'));var util=require(_0x9be6('0x1'));var logger=require(_0x9be6('0x2'))(_0x9be6('0x3'));var moment=require('moment');var BPromise=require(_0x9be6('0x4'));var rp=require(_0x9be6('0x5'));var fs=require('fs');var path=require(_0x9be6('0x6'));var rimraf=require('rimraf');var config=require(_0x9be6('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0x9be6('0x8')]=function(_0x79b94f,_0x35b7c2){return _0x79b94f['define'](_0x9be6('0x9'),attributes,{'tableName':_0x9be6('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9be6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index fb44434..46033b5 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd65f=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd65f,0x198));var _0xfd65=function(_0x1e896c,_0x3f9948){_0x1e896c=_0x1e896c-0x0;var _0xd149d9=_0xd65f[_0x1e896c];return _0xd149d9;};'use strict';var _=require('lodash');var util=require(_0xfd65('0x0'));var moment=require('moment');var BPromise=require(_0xfd65('0x1'));var rs=require(_0xfd65('0x2'));var fs=require('fs');var Redis=require(_0xfd65('0x3'));var db=require(_0xfd65('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd65('0x5'))(_0xfd65('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfd65('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26b48c,_0x16eef8,_0x38a3ee){return new BPromise(function(_0x1bd77e,_0x570b0a){return client[_0xfd65('0x8')](_0x26b48c,_0x38a3ee)[_0xfd65('0x9')](function(_0x53d92a){logger[_0xfd65('0xa')](_0xfd65('0xb'),_0x16eef8,_0xfd65('0xc'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x16eef8,_0xfd65('0xc'),JSON[_0xfd65('0xd')](_0x53d92a));if(_0x53d92a[_0xfd65('0xe')]){if(_0x53d92a[_0xfd65('0xe')]['code']===0x1f4){logger[_0xfd65('0xe')](_0xfd65('0xb'),_0x16eef8,_0x53d92a['error'][_0xfd65('0xf')]);return _0x570b0a(_0x53d92a[_0xfd65('0xe')][_0xfd65('0xf')]);}logger['error'](_0xfd65('0xb'),_0x16eef8,_0x53d92a['error'][_0xfd65('0xf')]);return _0x1bd77e(_0x53d92a['error'][_0xfd65('0xf')]);}else{logger[_0xfd65('0xa')](_0xfd65('0xb'),_0x16eef8,_0xfd65('0xc'));_0x1bd77e(_0x53d92a[_0xfd65('0x10')][_0xfd65('0xf')]);}})['catch'](function(_0x2612a8){logger[_0xfd65('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x16eef8,_0x2612a8);_0x570b0a(_0x2612a8);});});} \ No newline at end of file +var _0x8085=['jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1bbf61,_0x4b2648){var _0x215b3b=function(_0x210704){while(--_0x210704){_0x1bbf61['push'](_0x1bbf61['shift']());}};_0x215b3b(++_0x4b2648);}(_0x8085,0x174));var _0x5808=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0x8085[_0x22e47a];return _0x15a12a;};'use strict';var _=require(_0x5808('0x0'));var util=require(_0x5808('0x1'));var moment=require(_0x5808('0x2'));var BPromise=require('bluebird');var rs=require(_0x5808('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5808('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5808('0x5'))(_0x5808('0x6'));var config=require(_0x5808('0x7'));var jayson=require(_0x5808('0x8'));var client=jayson[_0x5808('0x9')][_0x5808('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x330357,_0x50bb71,_0x57504b){return new BPromise(function(_0x406ca5,_0x32e69f){return client[_0x5808('0xb')](_0x330357,_0x57504b)[_0x5808('0xc')](function(_0x2589de){logger[_0x5808('0xd')](_0x5808('0xe'),_0x50bb71,'request\x20sent');logger['debug'](_0x5808('0xf'),_0x50bb71,_0x5808('0x10'),JSON['stringify'](_0x2589de));if(_0x2589de[_0x5808('0x11')]){if(_0x2589de['error']['code']===0x1f4){logger['error'](_0x5808('0xe'),_0x50bb71,_0x2589de['error'][_0x5808('0x12')]);return _0x32e69f(_0x2589de[_0x5808('0x11')][_0x5808('0x12')]);}logger[_0x5808('0x11')](_0x5808('0xe'),_0x50bb71,_0x2589de[_0x5808('0x11')][_0x5808('0x12')]);return _0x406ca5(_0x2589de[_0x5808('0x11')][_0x5808('0x12')]);}else{logger[_0x5808('0xd')](_0x5808('0xe'),_0x50bb71,_0x5808('0x10'));_0x406ca5(_0x2589de[_0x5808('0x13')][_0x5808('0x12')]);}})['catch'](function(_0x303cc4){logger['error'](_0x5808('0xe'),_0x50bb71,_0x303cc4);_0x32e69f(_0x303cc4);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 54754a4..9d4fd96 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa423=['filter','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','seedDB','default','listen','start','info','number','exitCode','length','pm2_env','name','Online\x20apps:'];(function(_0x1d18f4,_0x2c49b6){var _0x221440=function(_0x1fb62e){while(--_0x1fb62e){_0x1d18f4['push'](_0x1d18f4['shift']());}};_0x221440(++_0x2c49b6);}(_0xa423,0x16c));var _0x3a42=function(_0x257e8f,_0xdc7fc9){_0x257e8f=_0x257e8f-0x0;var _0x2d8b1e=_0xa423[_0x257e8f];return _0x2d8b1e;};'use strict';var _=require(_0x3a42('0x0'));var db=require(_0x3a42('0x1'))['db'];var seedDb=require(_0x3a42('0x2'));var checkLicense=require(_0x3a42('0x3'));var rpc=require(_0x3a42('0x4'));var config=require('./config/environment');var logger=require(_0x3a42('0x5'))(_0x3a42('0x6'));var pm2=require('./config/pm2');var pm2Config=require(_0x3a42('0x7'));var schedule=require(_0x3a42('0x8'));var chat=require(_0x3a42('0x9'));var whatsapp=require(_0x3a42('0xa'));var transcribe=require(_0x3a42('0xb'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x3a42('0xc')][_0x3a42('0xd')]()[_0x3a42('0xe')](function(){if(config[_0x3a42('0xf')]){return seedDb[_0x3a42('0x10')]();}})[_0x3a42('0xe')](function(){return checkLicense[_0x3a42('0x10')]();})[_0x3a42('0xe')](function(){return rpc[_0x3a42('0x11')]();})[_0x3a42('0xe')](function(_0x397559){logger['info'](_0x397559);return chat[_0x3a42('0x12')]();})[_0x3a42('0xe')](function(){return whatsapp[_0x3a42('0x12')]();})[_0x3a42('0xe')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x3a42('0x12')]();})['then'](function(){return provider[_0x3a42('0x12')]();})[_0x3a42('0xe')](function(_0x198bf1){logger[_0x3a42('0x13')](_0x198bf1);return pm2[_0x3a42('0x12')](pm2Config);})[_0x3a42('0xe')](function(_0x5f5244){var _0xd32889=_0x5f5244['filter'](function(_0x469c73){return typeof _0x469c73['exitCode']===_0x3a42('0x14')&&_0x469c73[_0x3a42('0x15')]>=0x0;});if(_0xd32889[_0x3a42('0x16')]>0x0){throw new Error(_0xd32889['length']+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0xd32889,function(_0x26c844){return'\x22'+_0x26c844[_0x3a42('0x17')][_0x3a42('0x18')]+'\x22';}));}logger[_0x3a42('0x13')](_0x3a42('0x19'),_['map'](_[_0x3a42('0x1a')](_0x5f5244,{'status':_0x3a42('0x1b')}),_0x3a42('0x18'))[_0x3a42('0x1c')]());logger[_0x3a42('0x13')](_0x3a42('0x1d'),_['map'](_[_0x3a42('0x1a')](_0x5f5244,function(_0x3f4afb){return _0x3f4afb[_0x3a42('0x1e')]!==_0x3a42('0x1b');}),_0x3a42('0x18'))['join']()||_0x3a42('0x1f'));console[_0x3a42('0x20')](_0x3a42('0x21'));})[_0x3a42('0x22')](function(_0x44c6e7){console['log'](_0x3a42('0x23'),_0x44c6e7);logger[_0x3a42('0x24')](_0x3a42('0x25'),_0x44c6e7);process[_0x3a42('0x26')](0x1);});}main(); \ No newline at end of file +var _0xf50b=['join','Offline\x20apps:','status','name','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','listen','start','info','filter','exitCode','number','length','map','pm2_env','Online\x20apps:','online'];(function(_0xe20d48,_0x11f1d0){var _0x1580e6=function(_0x43b82f){while(--_0x43b82f){_0xe20d48['push'](_0xe20d48['shift']());}};_0x1580e6(++_0x11f1d0);}(_0xf50b,0xc8));var _0xbf50=function(_0x204eb8,_0x40cd16){_0x204eb8=_0x204eb8-0x0;var _0x36293d=_0xf50b[_0x204eb8];return _0x36293d;};'use strict';var _=require(_0xbf50('0x0'));var db=require(_0xbf50('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xbf50('0x2'));var rpc=require(_0xbf50('0x3'));var config=require(_0xbf50('0x4'));var logger=require(_0xbf50('0x5'))('app');var pm2=require(_0xbf50('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xbf50('0x7'));var chat=require(_0xbf50('0x8'));var whatsapp=require(_0xbf50('0x9'));var transcribe=require(_0xbf50('0xa'));var provider=require(_0xbf50('0xb'));function main(){return db[_0xbf50('0xc')][_0xbf50('0xd')]()['then'](function(){if(config[_0xbf50('0xe')]){return seedDb[_0xbf50('0xf')]();}})[_0xbf50('0x10')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0xbf50('0x11')]();})[_0xbf50('0x10')](function(_0x31c66f){logger['info'](_0x31c66f);return chat[_0xbf50('0x12')]();})[_0xbf50('0x10')](function(){return whatsapp[_0xbf50('0x12')]();})[_0xbf50('0x10')](function(){return schedule[_0xbf50('0x12')]();})[_0xbf50('0x10')](function(){return transcribe[_0xbf50('0x12')]();})['then'](function(){return provider[_0xbf50('0x12')]();})[_0xbf50('0x10')](function(_0x38ae23){logger[_0xbf50('0x13')](_0x38ae23);return pm2[_0xbf50('0x12')](pm2Config);})['then'](function(_0x554d70){var _0x4b05bb=_0x554d70[_0xbf50('0x14')](function(_0x5df099){return typeof _0x5df099[_0xbf50('0x15')]===_0xbf50('0x16')&&_0x5df099[_0xbf50('0x15')]>=0x0;});if(_0x4b05bb['length']>0x0){throw new Error(_0x4b05bb[_0xbf50('0x17')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xbf50('0x18')](_0x4b05bb,function(_0x2264a0){return'\x22'+_0x2264a0[_0xbf50('0x19')]['name']+'\x22';}));}logger[_0xbf50('0x13')](_0xbf50('0x1a'),_[_0xbf50('0x18')](_[_0xbf50('0x14')](_0x554d70,{'status':_0xbf50('0x1b')}),'name')[_0xbf50('0x1c')]());logger[_0xbf50('0x13')](_0xbf50('0x1d'),_[_0xbf50('0x18')](_[_0xbf50('0x14')](_0x554d70,function(_0x5a30db){return _0x5a30db[_0xbf50('0x1e')]!==_0xbf50('0x1b');}),_0xbf50('0x1f'))[_0xbf50('0x1c')]()||_0xbf50('0x20'));console[_0xbf50('0x21')](_0xbf50('0x22'));})['catch'](function(_0x304bd5){console[_0xbf50('0x21')](_0xbf50('0x23'),_0x304bd5);logger[_0xbf50('0x24')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x304bd5);process[_0xbf50('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index ec129e4..f83f207 100644 --- a/server/components/auth/service.js +++ b/server/components/auth/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','sign','session','payload','options','promisify','verify','randomBytes','hex','floor','HS512','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','name','userpic','permissions','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','hotdesk','interface','userProfileId','privacyEnabled','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','smsAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','then','unmanaged','json','headers','startsWith','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x008c,0x188));var _0xc008=function(_0x30fc1f,_0x56890f){_0x30fc1f=_0x30fc1f-0x0;var _0x5b25ff=_0x008c[_0x30fc1f];return _0x5b25ff;};'use strict';var db=require(_0xc008('0x0'))['db'];var config=require(_0xc008('0x1'));var hardwareConf=require(_0xc008('0x2'));var licenseUtil=require(_0xc008('0x3'));var encryptor=require(_0xc008('0x4'));var _=require('lodash');var jwt=require(_0xc008('0x5'));var expressJwt=require(_0xc008('0x6'));var compose=require(_0xc008('0x7'));var basicAuth=require(_0xc008('0x8'));var crypto=require(_0xc008('0x9'));var BPromise=require(_0xc008('0xa'));var util=require(_0xc008('0xb'));var moment=require(_0xc008('0xc'));var validateJwt=expressJwt({'secret':config[_0xc008('0xd')]['session']});var userAttributes=['id',_0xc008('0xe'),'fullname',_0xc008('0xf'),'internal','email',_0xc008('0x10'),_0xc008('0x11'),'md5secret','voicePause','chatPause',_0xc008('0x12'),_0xc008('0x13'),'smsPause',_0xc008('0x14'),_0xc008('0x15'),_0xc008('0x16'),_0xc008('0x17'),_0xc008('0x18'),_0xc008('0x19'),_0xc008('0x1a'),'passwordResetAt','alias',_0xc008('0x1b'),'phoneBarAutoAnswerDelay',_0xc008('0x1c'),_0xc008('0x1d'),_0xc008('0x1e'),_0xc008('0x1f'),_0xc008('0x20'),'phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0xc008('0x21'),_0xc008('0x22'),_0xc008('0x23'),_0xc008('0x24'),'settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions',_0xc008('0x25'),_0xc008('0x26'),'selectRecallMeCampaign',_0xc008('0x27'),'chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer',_0xc008('0x28'),'openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0xc008('0x29')];exports[_0xc008('0x2a')]=function(){return this[_0xc008('0x2b')](!![])[_0xc008('0x2c')](function(_0x11cc75,_0x110128,_0x4f43e2){if(_0x11cc75[_0xc008('0x2d')]){_0x4f43e2();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x11cc75[_0xc008('0x2e')]['id']},'attributes':['id',_0xc008('0x2f'),_0xc008('0x30')],'raw':!![]})[_0xc008('0x31')](function(_0x5410f5){if(_0x5410f5&&_0x5410f5['closed']){return _0x110128['status'](_0x5410f5[_0xc008('0x30')]===_0xc008('0x32')?0x195:0x193)[_0xc008('0x33')]({'message':_0x5410f5[_0xc008('0x30')]==='unmanaged'?'Unmanaged.':'Forbidden.'});}else{_0x4f43e2();}})['catch'](function(_0x4caaf4){_0x4f43e2(_0x4caaf4);});}});};exports[_0xc008('0x2b')]=function isAuthenticated(_0x29ba43){return compose()[_0xc008('0x2c')](function(_0x529961,_0x24c14c,_0x32390d){var _0x209591;if(_0x529961[_0xc008('0x34')]['authorization']){if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],'Basic')){var _0x539766=basicAuth(_0x529961);db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'name':_0x539766[_0xc008('0xf')]}})[_0xc008('0x31')](function(_0x1de04b){if(!_0x1de04b||!_0x1de04b[_0xc008('0x38')](_0x539766[_0xc008('0x39')])){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x3b')});}_0x529961[_0xc008('0x2d')]={'id':_0x1de04b['id']};_0x32390d();})[_0xc008('0x3c')](function(_0x596ee8){_0x32390d(_0x596ee8);});}else if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],_0xc008('0x3d'))){validateJwt(_0x529961,_0x24c14c,_0x32390d);}else{if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}}}else if(_0x529961[_0xc008('0x3f')][_0xc008('0x40')]){try{var _0x7cfbc5={'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};verifyJwt(_0x529961['query'][_0xc008('0x40')],_0x7cfbc5)[_0xc008('0x31')](function(_0x459df4){return db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x459df4[_0xc008('0x42')]}})[_0xc008('0x31')](function(_0x5d0e06){_0x209591=_0x5d0e06;return db[_0xc008('0x43')][_0xc008('0x44')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc008('0x45')],'raw':!![]});})[_0xc008('0x31')](function(_0x5e38d5){if(!_0x209591||!_[_0xc008('0x46')](_0x209591[_0xc008('0x47')],_0x459df4[_0xc008('0x48')])){return _0x24c14c['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x209591[_0xc008('0x49')]){return _0x24c14c['status'](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}if(_0x209591[_0xc008('0x4b')]){if(_0x5e38d5[_0xc008('0x45')]>0x0){if(moment(_0x209591[_0xc008('0x4c')])[_0xc008('0x4d')](_0x5e38d5[_0xc008('0x45')],_0xc008('0x4e'))>moment()){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}else{return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}_0x529961['user']={'id':_0x209591['id']};_0x32390d();});})[_0xc008('0x3c')](function(){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});});}catch(_0x49a16d){_0x32390d(_0x49a16d);}}else if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}})[_0xc008('0x2c')](function(_0x2d142d,_0x5706bb,_0x398cdd){if(_0x2d142d[_0xc008('0x2d')]){db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x2d142d[_0xc008('0x2d')]['id']},'attributes':userAttributes})['then'](function(_0xf4cc4b){if(!_0xf4cc4b){return _0x5706bb[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x4f')});}_0x2d142d['user']=_0xf4cc4b;_0x398cdd();})[_0xc008('0x3c')](function(_0xe37446){_0x398cdd(_0xe37446);});}else if(_0x29ba43){_0x398cdd();}else{return _0x5706bb[_0xc008('0x3a')](0x194)['json']({'message':_0xc008('0x50')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xc008('0x2c')](function(_0x5d3a72,_0x46fa8f,_0x213014){return licenseUtil['getLicense']()[_0xc008('0x31')](function(_0x24ba0f){if(_0x24ba0f[_0xc008('0x51')]){_0x213014();}else{return _0x46fa8f['status'](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x44fc5d){_0x213014(_0x44fc5d);});});};exports[_0xc008('0x53')]=function isWebrtcLicence(){return compose()[_0xc008('0x2c')](function(_0x59ca2b,_0x47cafa,_0x5283a8){return licenseUtil[_0xc008('0x54')]()[_0xc008('0x31')](function(_0x103a83){if(_0x103a83[_0xc008('0x55')]){_0x5283a8();}else{return _0x47cafa[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x572593){_0x5283a8(_0x572593);});});};exports['isMiddleware']=function(_0x516e43,_0x2d5a49,_0x2651cf){_0x516e43[_0xc008('0x56')]=!![];return _0x2651cf();};exports['signToken']=function signToken(_0x28bc33){return signJwt(_0x28bc33);};exports[_0xc008('0x57')]=function(_0x17ab1a,_0x1c2c50){if(!_0x17ab1a[_0xc008('0x2d')]){return _0x1c2c50[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x58')});}var _0x3fd7d9={'payload':{'id':_0x17ab1a[_0xc008('0x2d')]['id'],'role':_0x17ab1a['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3fd7d9)[_0xc008('0x31')](function(_0x51cb14){_0x1c2c50[_0xc008('0x59')](_0xc008('0x5a'),_0x51cb14);_0x1c2c50[_0xc008('0x5b')]('/dashboards/general');})[_0xc008('0x3c')](function(_0x32b435){return _0x1c2c50[_0xc008('0x3a')](0x1f4)[_0xc008('0x5c')](_0x32b435);});};exports[_0xc008('0x5d')]=function(_0x51105f){if(_[_0xc008('0x5e')](_0x51105f[_0xc008('0x47')])||_['isNil'](_0x51105f[_0xc008('0x5f')])){return null;}else{return createJwt(_0x51105f);}};exports[_0xc008('0x60')]=function(_0x5b5fbf){_0x5b5fbf['apiKeyNonce']=generateNonce();_0x5b5fbf[_0xc008('0x5f')]=generateIssuedAt();return createJwt(_0x5b5fbf);};exports[_0xc008('0x61')]=function(_0x20947b,_0x30d0aa){var _0x14b6a0=_0x20947b['query']['apikey'];if(_0x14b6a0){var _0x34b72a={'nonce':_0x30d0aa['apiKeyNonce'],'iat':_0x30d0aa[_0xc008('0x5f')],'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};return verifyJwt(_0x14b6a0,_0x34b72a)[_0xc008('0x31')](function(){return generateApiKey(_0x30d0aa);});}else{throw{'message':_0xc008('0x62')};}};exports[_0xc008('0x63')]=function(_0x49d8b0){var _0x2ea742=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2ea742[_0xc008('0x64')](_0x49d8b0))throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0xc008('0x67'));return;};exports['validatePasswordHistory']=function(_0x41fae3,_0x4fdab4,_0x535e6e){var _0x5dbfca=encryptor[_0xc008('0x68')](_0x4fdab4)[_0xc008('0x69')](',');for(var _0x5dfb69=0x0;_0x5dfb69<_0x535e6e;_0x5dfb69++){if(!_0x5dbfca[_0x5dfb69])break;if(_0x41fae3['toLowerCase']()===_0x5dbfca[_0x5dfb69][_0xc008('0x6a')]()){var _0x2d8361=util[_0xc008('0x6b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x535e6e);if(_0x535e6e===0x1){_0x2d8361=_0xc008('0x6c');}throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0x2d8361);}}return;};exports[_0xc008('0x6d')]=function(_0x5baff1,_0x4022dd){var _0x4eaa6d=_0x4022dd?encryptor[_0xc008('0x68')](_0x4022dd)[_0xc008('0x69')](','):[];if(_0x4eaa6d[_0xc008('0x6e')]===0x5){_0x4eaa6d[_0xc008('0x6f')](-0x1,0x1);}_0x4eaa6d[_0xc008('0x70')](_0x5baff1);return encryptor[_0xc008('0x71')](_0x4eaa6d['join'](','));};function signJwt(_0x375e71){var _0x570001=BPromise['promisify'](jwt[_0xc008('0x72')],{'context':jwt});var _0x30aa1e=_0x375e71['secret']||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x3e373e,_0x4517c0){_0x570001(_0x375e71[_0xc008('0x74')],_0x30aa1e,_0x375e71[_0xc008('0x75')])[_0xc008('0x31')](function(_0x57ce9a){_0x3e373e(_0x57ce9a);})[_0xc008('0x3c')](function(_0x462e1e){_0x4517c0(_0x462e1e);});});}function verifyJwt(_0x3bfb15,_0x2a60e6,_0xb3ca0f){var _0x167425=BPromise[_0xc008('0x76')](jwt[_0xc008('0x77')],{'context':jwt});var _0xbc430a=_0xb3ca0f||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x2b5eb6,_0x131b81){_0x167425(_0x3bfb15,_0xbc430a,_0x2a60e6)[_0xc008('0x31')](function(_0x4e0251){_0x2b5eb6(_0x4e0251);})[_0xc008('0x3c')](function(_0x2e5467){_0x131b81(_0x2e5467);});});}function generateNonce(){return crypto[_0xc008('0x78')](0x10)['toString'](_0xc008('0x79'));}function generateIssuedAt(){return Math[_0xc008('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x1a03fd){var _0x2a4c2b={'payload':{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd[_0xc008('0x47')]},'options':{'algorithm':_0xc008('0x7b'),'subject':_0x1a03fd['id'][_0xc008('0x7c')](),'issuer':hardwareConf[_0xc008('0x41')](),'audience':hardwareConf[_0xc008('0x41')]()}};return signJwt(_0x2a4c2b)[_0xc008('0x31')](function(_0x1b059b){return{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd['apiKeyNonce'],'token':_0x1b059b};});} \ No newline at end of file +var _0x3e74=['util','moment','session','role','fullname','name','internal','userpic','voicePause','chatPause','faxPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','then','disposition','unmanaged','json','Forbidden.','headers','authorization','startsWith','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','join','promisify','secret','secrets','payload','options','randomBytes','toString','floor','now','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','basic-auth','crypto','bluebird'];(function(_0xad8344,_0x23dbe6){var _0x48c4c5=function(_0x2079f8){while(--_0x2079f8){_0xad8344['push'](_0xad8344['shift']());}};_0x48c4c5(++_0x23dbe6);}(_0x3e74,0x175));var _0x43e7=function(_0x23d9ed,_0x45cc36){_0x23d9ed=_0x23d9ed-0x0;var _0x3e5478=_0x3e74[_0x23d9ed];return _0x3e5478;};'use strict';var db=require(_0x43e7('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x43e7('0x1'));var licenseUtil=require(_0x43e7('0x2'));var encryptor=require(_0x43e7('0x3'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x43e7('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x43e7('0x5'));var crypto=require(_0x43e7('0x6'));var BPromise=require(_0x43e7('0x7'));var util=require(_0x43e7('0x8'));var moment=require(_0x43e7('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x43e7('0xa')]});var userAttributes=['id',_0x43e7('0xb'),_0x43e7('0xc'),_0x43e7('0xd'),_0x43e7('0xe'),'email',_0x43e7('0xf'),'permissions','md5secret',_0x43e7('0x10'),_0x43e7('0x11'),'mailPause',_0x43e7('0x12'),'smsPause',_0x43e7('0x13'),_0x43e7('0x14'),'showWebBar',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),'passwordResetAt','alias',_0x43e7('0x19'),_0x43e7('0x1a'),_0x43e7('0x1b'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x43e7('0x1c'),_0x43e7('0x1d'),_0x43e7('0x1e'),_0x43e7('0x1f'),'phoneBarRemoteControlPort','hotdesk',_0x43e7('0x20'),_0x43e7('0x21'),_0x43e7('0x22'),'settingsEnabled','wssPort',_0x43e7('0x23'),_0x43e7('0x24'),_0x43e7('0x25'),_0x43e7('0x26'),_0x43e7('0x27'),_0x43e7('0x28'),_0x43e7('0x29'),_0x43e7('0x2a'),_0x43e7('0x2b'),_0x43e7('0x2c'),_0x43e7('0x2d'),_0x43e7('0x2e'),'openchannelAutoanswerDelay',_0x43e7('0x2f'),_0x43e7('0x30'),'whatsappAutoanswer',_0x43e7('0x31')];exports[_0x43e7('0x32')]=function(){return this[_0x43e7('0x33')](!![])[_0x43e7('0x34')](function(_0x4077fb,_0x2f4cb4,_0x54a9e7){if(_0x4077fb[_0x43e7('0x35')]){_0x54a9e7();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x4077fb[_0x43e7('0x36')]['id']},'attributes':['id',_0x43e7('0x37'),'disposition'],'raw':!![]})[_0x43e7('0x38')](function(_0x4ca5cf){if(_0x4ca5cf&&_0x4ca5cf[_0x43e7('0x37')]){return _0x2f4cb4['status'](_0x4ca5cf[_0x43e7('0x39')]===_0x43e7('0x3a')?0x195:0x193)[_0x43e7('0x3b')]({'message':_0x4ca5cf[_0x43e7('0x39')]==='unmanaged'?'Unmanaged.':_0x43e7('0x3c')});}else{_0x54a9e7();}})['catch'](function(_0x2dd5f){_0x54a9e7(_0x2dd5f);});}});};exports[_0x43e7('0x33')]=function isAuthenticated(_0x3565cf){return compose()[_0x43e7('0x34')](function(_0x5087d7,_0x33a1a5,_0x4690a6){var _0x45b675;if(_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')]){if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')],_0x43e7('0x40'))){var _0x35dbcd=basicAuth(_0x5087d7);db[_0x43e7('0x41')][_0x43e7('0x42')]({'where':{'name':_0x35dbcd[_0x43e7('0xd')]}})[_0x43e7('0x38')](function(_0x4bdb17){if(!_0x4bdb17||!_0x4bdb17[_0x43e7('0x43')](_0x35dbcd[_0x43e7('0x44')])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x46')});}_0x5087d7['user']={'id':_0x4bdb17['id']};_0x4690a6();})[_0x43e7('0x47')](function(_0x49b83d){_0x4690a6(_0x49b83d);});}else if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')]['authorization'],'Bearer')){validateJwt(_0x5087d7,_0x33a1a5,_0x4690a6);}else{if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5['status'](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x48')});}}}else if(_0x5087d7[_0x43e7('0x49')][_0x43e7('0x4a')]){try{var _0x108313={'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5087d7['query']['apikey'],_0x108313)['then'](function(_0x4e8e86){return db['User']['find']({'where':{'id':_0x4e8e86[_0x43e7('0x4c')]}})['then'](function(_0x2b4bfd){_0x45b675=_0x2b4bfd;return db[_0x43e7('0x4d')][_0x43e7('0x4e')]({'where':{'id':0x1},'attributes':[_0x43e7('0x4f'),_0x43e7('0x50')],'raw':!![]});})[_0x43e7('0x38')](function(_0x101d45){if(!_0x45b675||!_['isEqual'](_0x45b675['apiKeyNonce'],_0x4e8e86['nonce'])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x51')});}if(_0x45b675[_0x43e7('0x52')]){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}if(_0x45b675[_0x43e7('0x54')]){if(_0x101d45['blockDuration']>0x0){if(moment(_0x45b675[_0x43e7('0x55')])[_0x43e7('0x56')](_0x101d45['blockDuration'],_0x43e7('0x57'))>moment()){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}else{return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}_0x5087d7[_0x43e7('0x35')]={'id':_0x45b675['id']};_0x4690a6();});})['catch'](function(){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});});}catch(_0x44b6ae){_0x4690a6(_0x44b6ae);}}else if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':'Unknown\x20authorization\x20format'});}})[_0x43e7('0x34')](function(_0x4227c4,_0x575439,_0x3628e0){if(_0x4227c4['user']){db[_0x43e7('0x41')]['find']({'where':{'id':_0x4227c4[_0x43e7('0x35')]['id']},'attributes':userAttributes})[_0x43e7('0x38')](function(_0x3a5807){if(!_0x3a5807){return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x4227c4[_0x43e7('0x35')]=_0x3a5807;_0x3628e0();})[_0x43e7('0x47')](function(_0xe979b5){_0x3628e0(_0xe979b5);});}else if(_0x3565cf){_0x3628e0();}else{return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x43e7('0x34')](function(_0x57f5d0,_0x2ab022,_0x4b3a59){return licenseUtil['getLicense']()[_0x43e7('0x38')](function(_0x5ee1c5){if(_0x5ee1c5[_0x43e7('0x58')]){_0x4b3a59();}else{return _0x2ab022[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x59')});}})['catch'](function(_0x91f1e4){_0x4b3a59(_0x91f1e4);});});};exports[_0x43e7('0x5a')]=function isWebrtcLicence(){return compose()[_0x43e7('0x34')](function(_0x1fd277,_0x296dc8,_0x1efe59){return licenseUtil['getLicense']()['then'](function(_0x3bc9de){if(_0x3bc9de[_0x43e7('0x5b')]){_0x1efe59();}else{return _0x296dc8[_0x43e7('0x45')](0x193)['json']({'message':'Forbidden'});}})['catch'](function(_0x292ded){_0x1efe59(_0x292ded);});});};exports[_0x43e7('0x5c')]=function(_0x52b098,_0x351ca2,_0x47686e){_0x52b098[_0x43e7('0x5c')]=!![];return _0x47686e();};exports['signToken']=function signToken(_0x593155){return signJwt(_0x593155);};exports['setTokenCookie']=function(_0x4de644,_0x214e7e){if(!_0x4de644[_0x43e7('0x35')]){return _0x214e7e['status'](0x194)[_0x43e7('0x3b')]({'message':_0x43e7('0x5d')});}var _0x426bcb={'payload':{'id':_0x4de644[_0x43e7('0x35')]['id'],'role':_0x4de644['user'][_0x43e7('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x426bcb)['then'](function(_0x4bebd4){_0x214e7e[_0x43e7('0x5e')](_0x43e7('0x5f'),_0x4bebd4);_0x214e7e[_0x43e7('0x60')](_0x43e7('0x61'));})[_0x43e7('0x47')](function(_0x2351cf){return _0x214e7e[_0x43e7('0x45')](0x1f4)[_0x43e7('0x62')](_0x2351cf);});};exports[_0x43e7('0x63')]=function(_0x2b5515){if(_['isNil'](_0x2b5515[_0x43e7('0x64')])||_[_0x43e7('0x65')](_0x2b5515['apiKeyIat'])){return null;}else{return createJwt(_0x2b5515);}};exports[_0x43e7('0x66')]=function(_0x4e6f6d){_0x4e6f6d[_0x43e7('0x64')]=generateNonce();_0x4e6f6d[_0x43e7('0x67')]=generateIssuedAt();return createJwt(_0x4e6f6d);};exports[_0x43e7('0x68')]=function(_0x1f561f,_0xfe13fa){var _0x5e5556=_0x1f561f['query'][_0x43e7('0x4a')];if(_0x5e5556){var _0x2ab7ee={'nonce':_0xfe13fa[_0x43e7('0x64')],'iat':_0xfe13fa[_0x43e7('0x67')],'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf[_0x43e7('0x4b')]()};return verifyJwt(_0x5e5556,_0x2ab7ee)[_0x43e7('0x38')](function(){return generateApiKey(_0xfe13fa);});}else{throw{'message':_0x43e7('0x69')};}};exports[_0x43e7('0x6a')]=function(_0x24e758){var _0x312306=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x312306['test'](_0x24e758))throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x43e7('0x6d')]=function(_0x220bf2,_0x2d0052,_0x558d54){var _0x5d63c6=encryptor[_0x43e7('0x6e')](_0x2d0052)[_0x43e7('0x6f')](',');for(var _0x4ebdde=0x0;_0x4ebdde<_0x558d54;_0x4ebdde++){if(!_0x5d63c6[_0x4ebdde])break;if(_0x220bf2[_0x43e7('0x70')]()===_0x5d63c6[_0x4ebdde]['toLowerCase']()){var _0x49a6ce=util[_0x43e7('0x71')](_0x43e7('0x72'),_0x558d54);if(_0x558d54===0x1){_0x49a6ce=_0x43e7('0x73');}throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))](_0x49a6ce);}}return;};exports['updatePasswordsHistory']=function(_0xc3976,_0xdb9fbe){var _0x4d89bd=_0xdb9fbe?encryptor[_0x43e7('0x6e')](_0xdb9fbe)[_0x43e7('0x6f')](','):[];if(_0x4d89bd[_0x43e7('0x74')]===0x5){_0x4d89bd['splice'](-0x1,0x1);}_0x4d89bd['unshift'](_0xc3976);return encryptor['encryptString'](_0x4d89bd[_0x43e7('0x75')](','));};function signJwt(_0x4058ce){var _0x323cf7=BPromise[_0x43e7('0x76')](jwt['sign'],{'context':jwt});var _0x5a50fc=_0x4058ce[_0x43e7('0x77')]||config[_0x43e7('0x78')][_0x43e7('0xa')];return new BPromise(function(_0x5dd349,_0x5ea0db){_0x323cf7(_0x4058ce[_0x43e7('0x79')],_0x5a50fc,_0x4058ce[_0x43e7('0x7a')])[_0x43e7('0x38')](function(_0x2a194d){_0x5dd349(_0x2a194d);})[_0x43e7('0x47')](function(_0xd41e79){_0x5ea0db(_0xd41e79);});});}function verifyJwt(_0x4665db,_0x46748f,_0x406155){var _0x381208=BPromise[_0x43e7('0x76')](jwt['verify'],{'context':jwt});var _0x5f3824=_0x406155||config[_0x43e7('0x78')]['session'];return new BPromise(function(_0x501616,_0x50edb2){_0x381208(_0x4665db,_0x5f3824,_0x46748f)[_0x43e7('0x38')](function(_0xe666b0){_0x501616(_0xe666b0);})['catch'](function(_0xfe5a8d){_0x50edb2(_0xfe5a8d);});});}function generateNonce(){return crypto[_0x43e7('0x7b')](0x10)[_0x43e7('0x7c')]('hex');}function generateIssuedAt(){return Math[_0x43e7('0x7d')](Date[_0x43e7('0x7e')]()/0x3e8)[_0x43e7('0x7c')]();}function createJwt(_0xc9723){var _0x2f43d7={'payload':{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723[_0x43e7('0x64')]},'options':{'algorithm':'HS512','subject':_0xc9723['id'][_0x43e7('0x7c')](),'issuer':hardwareConf[_0x43e7('0x4b')](),'audience':hardwareConf[_0x43e7('0x4b')]()}};return signJwt(_0x2f43d7)['then'](function(_0x56b06d){return{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723['apiKeyNonce'],'token':_0x56b06d};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 9e6c7cf..c3000fc 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['buildContactsQuery','getFilteredContacts','catch','CmContact','keys','filter','cf_','CmCustomField','slice','all','length','./sql-utils','findAll','resolve','then','search','parseAdvancedSearchFilter','where','default','fields','clause','user','skip','checkListsRestrictions','ids','tag','count'];(function(_0x5a61e4,_0x2108be){var _0x33c1bd=function(_0x5c0ead){while(--_0x5c0ead){_0x5a61e4['push'](_0x5a61e4['shift']());}};_0x33c1bd(++_0x2108be);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var sqlUtils=require(_0x65f6('0x0'));var db=require('../../mysqldb')['db'];exports[_0x65f6('0x1')]=function(_0x2f06ae,_0x3461cd,_0xbce843,_0x1a330c){var _0x5eb9ad={'count':0x0,'rows':[]};var _0x3c5029=sqlUtils['skipContactsQuery'](_0x3461cd,_0x2f06ae);if(_0x3c5029){return Promise[_0x65f6('0x2')](_0x5eb9ad);}var _0x22b017=sqlUtils['getContactsSubquery']();var _0x4ed98f={};var _0x1c0e12=![];var _0x2c6571=![];return Promise[_0x65f6('0x2')]()[_0x65f6('0x3')](function(){if(_0x2f06ae[_0x65f6('0x4')]){return sqlUtils[_0x65f6('0x5')](_0x2f06ae['search'],_0x1a330c);}else{return sqlUtils['parseQueryParameters'](_0x2f06ae,_0x1a330c);}})[_0x65f6('0x3')](function(_0x2f6d5b){_0x22b017[_0x65f6('0x6')](_0x2f6d5b[_0x65f6('0x7')]);_0x22b017['where'](_0x2f6d5b[_0x65f6('0x8')]);_0x22b017['where'](_0x2f6d5b['filter']);_0x22b017[_0x65f6('0x6')](_0x2f6d5b['user'][_0x65f6('0x9')]);_0x4ed98f=_0x2f6d5b['tags'];_0x2c6571=_0x2f6d5b[_0x65f6('0xa')][_0x65f6('0xb')];return sqlUtils[_0x65f6('0xc')](_0x3461cd,_0x2f06ae,_0x2c6571);})[_0x65f6('0x3')](function(_0x369f96){_0x22b017[_0x65f6('0x6')](_0x369f96);var _0x44144b=_0x2f06ae[_0x65f6('0x4')]?_0x4ed98f[_0x65f6('0xd')]:_0x2f06ae[_0x65f6('0xe')];_0x1c0e12=_0x44144b?!![]:![];return sqlUtils['countFilteredContacts'](_0x22b017,_0x44144b);})[_0x65f6('0x3')](function(_0x49a913){_0x5eb9ad['count']=_0x49a913;if(_0x5eb9ad[_0x65f6('0xf')]===0x0){return;}return sqlUtils[_0x65f6('0x10')](_0x22b017,_0x2f06ae[_0x65f6('0x8')],_0xbce843,_0x1c0e12,_0x4ed98f[_0x65f6('0x9')],_0x2c6571);})[_0x65f6('0x3')](function(_0x1f974c){if(!_0x1f974c){return[];}return sqlUtils[_0x65f6('0x11')](_0x1f974c,_0x2f06ae,_0xbce843);})[_0x65f6('0x3')](function(_0x495dd6){_0x5eb9ad['rows']=_0x495dd6;return _0x5eb9ad;})[_0x65f6('0x12')](function(_0x5b4055){throw _0x5b4055;});};exports['describe']=function(){var _0x5c5b91={};var _0x365159=[];return db[_0x65f6('0x13')]['describe']()[_0x65f6('0x3')](function(_0x270893){_0x5c5b91=_0x270893;var _0xbee6a4=Object[_0x65f6('0x14')](_0x5c5b91)[_0x65f6('0x15')](function(_0xc139c2){return _['startsWith'](_0xc139c2,_0x65f6('0x16'))?_0xc139c2:undefined;});var _0x4bb39e=_0xbee6a4['map'](function(_0x212247){return db[_0x65f6('0x17')]['findOne']({'where':{'id':_0x212247[_0x65f6('0x18')](0x3)},'raw':!![]});});return Promise[_0x65f6('0x19')](_0x4bb39e);})[_0x65f6('0x3')](function(_0x2774a1){for(var _0x4f5a69=0x0;_0x4f5a69<_0x2774a1[_0x65f6('0x1a')];_0x4f5a69++){if(_0x2774a1[_0x4f5a69]){var _0x59ea32=_0x65f6('0x16')+_0x2774a1[_0x4f5a69]['id'];_0x5c5b91[_0x59ea32]['fieldType']=_0x2774a1[_0x4f5a69]['type'];}}_0x365159=_['map'](Object[_0x65f6('0x14')](_0x5c5b91),function(_0x16cde8){return{'name':_0x16cde8,'type':_0x5c5b91[_0x16cde8]['type']};});return _0x365159;})[_0x65f6('0x12')](function(_0x28f710){throw _0x28f710;});}; \ No newline at end of file +var _0xb7e7=['parseQueryParameters','where','default','fields','filter','user','clause','skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','startsWith','cf_','map','CmCustomField','fieldType','type','keys','lodash','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0xb7e7,0x121));var _0x7b7e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb7e7[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7b7e('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x7b7e('0x1'))['db'];exports['findAll']=function(_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){var _0x31d0ed={'count':0x0,'rows':[]};var _0x118577=sqlUtils[_0x7b7e('0x2')](_0x54a37f,_0x1b7cc7);if(_0x118577){return Promise['resolve'](_0x31d0ed);}var _0x53ed64=sqlUtils[_0x7b7e('0x3')]();var _0x372bde={};var _0x7f87e0=![];var _0x55ce81=![];return Promise[_0x7b7e('0x4')]()[_0x7b7e('0x5')](function(){if(_0x1b7cc7[_0x7b7e('0x6')]){return sqlUtils[_0x7b7e('0x7')](_0x1b7cc7[_0x7b7e('0x6')],_0x556d68);}else{return sqlUtils[_0x7b7e('0x8')](_0x1b7cc7,_0x556d68);}})[_0x7b7e('0x5')](function(_0x52de3b){_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xa')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xb')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xc')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xe')]);_0x372bde=_0x52de3b['tags'];_0x55ce81=_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xf')];return sqlUtils['checkListsRestrictions'](_0x54a37f,_0x1b7cc7,_0x55ce81);})[_0x7b7e('0x5')](function(_0x5976ac){_0x53ed64['where'](_0x5976ac);var _0x2889ed=_0x1b7cc7[_0x7b7e('0x6')]?_0x372bde[_0x7b7e('0x10')]:_0x1b7cc7[_0x7b7e('0x11')];_0x7f87e0=_0x2889ed?!![]:![];return sqlUtils[_0x7b7e('0x12')](_0x53ed64,_0x2889ed);})['then'](function(_0x51baf6){_0x31d0ed[_0x7b7e('0x13')]=_0x51baf6;if(_0x31d0ed[_0x7b7e('0x13')]===0x0){return;}return sqlUtils[_0x7b7e('0x14')](_0x53ed64,_0x1b7cc7[_0x7b7e('0xb')],_0x3f5804,_0x7f87e0,_0x372bde[_0x7b7e('0xe')],_0x55ce81);})[_0x7b7e('0x5')](function(_0x242368){if(!_0x242368){return[];}return sqlUtils[_0x7b7e('0x15')](_0x242368,_0x1b7cc7,_0x3f5804);})[_0x7b7e('0x5')](function(_0x429a0e){_0x31d0ed[_0x7b7e('0x16')]=_0x429a0e;return _0x31d0ed;})[_0x7b7e('0x17')](function(_0x448980){throw _0x448980;});};exports[_0x7b7e('0x18')]=function(){var _0x9776c3={};var _0x864287=[];return db[_0x7b7e('0x19')]['describe']()[_0x7b7e('0x5')](function(_0x43db4f){_0x9776c3=_0x43db4f;var _0x24718c=Object['keys'](_0x9776c3)[_0x7b7e('0xc')](function(_0xbf0cb3){return _[_0x7b7e('0x1a')](_0xbf0cb3,_0x7b7e('0x1b'))?_0xbf0cb3:undefined;});var _0x2b7211=_0x24718c[_0x7b7e('0x1c')](function(_0x28bf43){return db[_0x7b7e('0x1d')]['findOne']({'where':{'id':_0x28bf43['slice'](0x3)},'raw':!![]});});return Promise['all'](_0x2b7211);})[_0x7b7e('0x5')](function(_0x22598e){for(var _0x23bfa3=0x0;_0x23bfa3<_0x22598e['length'];_0x23bfa3++){if(_0x22598e[_0x23bfa3]){var _0x51d3b1='cf_'+_0x22598e[_0x23bfa3]['id'];_0x9776c3[_0x51d3b1][_0x7b7e('0x1e')]=_0x22598e[_0x23bfa3][_0x7b7e('0x1f')];}}_0x864287=_[_0x7b7e('0x1c')](Object[_0x7b7e('0x20')](_0x9776c3),function(_0x3ceaf5){return{'name':_0x3ceaf5,'type':_0x9776c3[_0x3ceaf5]['type']};});return _0x864287;})[_0x7b7e('0x17')](function(_0x21a15){throw _0x21a15;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index f99ec42..19ea090 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbf4=['color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','COUNT(*)','c.id','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','agent','search','ListId','autocomplete','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','cm_contact_has_tags','.id','tools_tags','t.id\x20=\x20ct.TagId','subqry','lastName','phone','fax','email','CompanyId','createdAt','updatedAt','deletedAt','includes','forEach','TagIds','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','buildExpression','default','text','value','start','end','Tag','map','tags','clause','ids','User','user','and','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','group','limit','offset','having','order','subqry.','from','findAll'];(function(_0x8026b2,_0x264756){var _0x4da442=function(_0x2d6bc0){while(--_0x2d6bc0){_0x8026b2['push'](_0x8026b2['shift']());}};_0x4da442(++_0x264756);}(_0xcbf4,0x7b));var _0x4cbf=function(_0xe7e1e6,_0x576a7d){_0xe7e1e6=_0xe7e1e6-0x0;var _0x21602f=_0xcbf4[_0xe7e1e6];return _0x21602f;};'use strict';var _=require(_0x4cbf('0x0'));var squel=require(_0x4cbf('0x1'));var as=require(_0x4cbf('0x2'));var qs=require(_0x4cbf('0x3'));var utils=require('../interaction/utils');var db=require(_0x4cbf('0x4'))['db'];function skipContactsQuery(_0x31e2ae,_0x1f238a){var _0x1e9011=![];if(_0x31e2ae[_0x4cbf('0x5')]===_0x4cbf('0x6')&&!_0x1f238a[_0x4cbf('0x7')]&&!_0x1f238a[_0x4cbf('0x8')]&&_0x1f238a[_0x4cbf('0x9')]!=='true'){_0x1e9011=!![];}return _0x1e9011;}function getContactsSubquery(){return squel['select']()['from']('cm_contacts','c')[_0x4cbf('0xa')](_0x4cbf('0xb'));}function applyJoinClauses(_0x30f06d,_0x28ce02){var _0x12da6e=_0x28ce02?'c':'subqry';_0x30f06d[_0x4cbf('0xc')](_0x4cbf('0xd'),'uc',_0x4cbf('0xe')+_0x12da6e+'.id')[_0x4cbf('0xc')](_0x4cbf('0xf'),'ct','ct.CmContactId\x20=\x20'+_0x12da6e+_0x4cbf('0x10'))[_0x4cbf('0xc')](_0x4cbf('0x11'),'t',_0x4cbf('0x12'));return _0x30f06d;}function addFieldsToQuery(_0x446bca,_0x24d316,_0x4bc614,_0x2d63fe,_0x523dd6){var _0x39a993=_0x523dd6?'c':_0x4cbf('0x13');if(!_0x24d316){_0x24d316=['id','firstName',_0x4cbf('0x14'),_0x4cbf('0x15'),'mobile',_0x4cbf('0x16'),_0x4cbf('0x17'),'ListId',_0x4cbf('0x18'),_0x4cbf('0x19'),_0x4cbf('0x1a'),_0x4cbf('0x1b'),'TagIds'];}else if(!_0x24d316[_0x4cbf('0x1c')]('id')){_0x24d316['push']('id');}var _0x2d791a=_0x4bc614&&_0x523dd6||!_0x4bc614&&!_0x523dd6;if(_0x2d63fe){_0x2d791a=_0x2d63fe&&_0x523dd6||!_0x2d63fe&&!_0x523dd6;}_0x24d316[_0x4cbf('0x1d')](function(_0x4a911d){if(_0x4a911d===_0x4cbf('0x1e')){if(_0x2d791a){_0x446bca[_0x4cbf('0x1f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4a911d);}else if(_0x4bc614||_0x2d63fe){_0x446bca[_0x4cbf('0x1f')](_0x39a993+'.'+_0x4a911d);}}else{_0x446bca['field'](_0x39a993+'.'+_0x4a911d);}});return _0x446bca;}function getSqlClauses(){var _0x141973={'default':squel[_0x4cbf('0x20')](),'fields':squel[_0x4cbf('0x20')](),'filter':squel[_0x4cbf('0x20')](),'tags':{'clause':squel[_0x4cbf('0x20')](),'ids':null},'user':{'clause':squel[_0x4cbf('0x20')](),'skip':![]}};return _0x141973;}function parseTagParameter(_0x4130df){var _0x30130c=squel[_0x4cbf('0x20')]();if(_0x4130df){var _0xc6f0a0=utils[_0x4cbf('0x21')](_0x4130df);_0xc6f0a0[_0x4cbf('0x1d')](function(_0xc667cc){_0x30130c['or'](_0x4cbf('0x22'),'%,'+_0xc667cc+',%');});}return _0x30130c;}function parseSearchFilter(_0x5e7f84){var _0x11103f=squel[_0x4cbf('0x20')]();if(_0x5e7f84){var _0x355344=_0x5e7f84[_0x4cbf('0x23')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x355344[_0x4cbf('0x24')]('\x20')[_0x4cbf('0x25')]>0x1){_0x11103f['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4cbf('0x26')](_0x355344),null);}else{if(qs[_0x4cbf('0x27')](_0x355344)){_0x11103f['or']('c.id\x20LIKE\x20?',_0x355344+'%');_0x11103f['or'](_0x4cbf('0x28'),_0x355344+'%');_0x11103f['or'](_0x4cbf('0x29'),_0x355344+'%');_0x11103f['or'](_0x4cbf('0x2a'),_0x355344+'%');}else if(qs[_0x4cbf('0x2b')](_0x355344)){_0x11103f['or']('c.email\x20LIKE\x20?',_0x355344+'%');}else{_0x11103f['or'](_0x4cbf('0x2c'),'%'+_0x355344+'%');_0x11103f['or']('c.lastName\x20LIKE\x20?','%'+_0x355344+'%');_0x11103f['or'](_0x4cbf('0x2d'),'%'+_0x355344+'%');}}}return _0x11103f;}function parseAdvancedSearchFilter(_0x470175,_0x10640f){var _0x329763=getSqlClauses();var _0x51f1ce=as['parseSearch'](_0x470175);var _0x132e86=_0x51f1ce[_0x4cbf('0x2e')];for(var _0x2443e8=0x0;_0x2443e8<_0x51f1ce[_0x4cbf('0x2f')][_0x4cbf('0x25')];_0x2443e8++){var _0x1d0898=_0x51f1ce[_0x4cbf('0x2f')][_0x2443e8];var _0x3a6494='c';var _0x5038fa=_[_0x4cbf('0x30')](_0x10640f,[_0x4cbf('0x31'),_0x1d0898['field']]);if(_0x5038fa){if(_0x1d0898['field']===_0x4cbf('0x32')||_0x5038fa[_0x4cbf('0x33')]===_0x4cbf('0x34')){_0x1d0898[_0x4cbf('0x35')]='DATE';}var _0x436914=as[_0x4cbf('0x36')](_0x3a6494,_0x5038fa['type'],_0x1d0898);_0x329763[_0x4cbf('0x37')][_0x132e86](_0x436914[_0x4cbf('0x38')],_0x436914[_0x4cbf('0x39')][_0x4cbf('0x3a')],_0x436914[_0x4cbf('0x39')][_0x4cbf('0x3b')]);}else{if(_0x1d0898[_0x4cbf('0x1f')]===_0x4cbf('0x3c')){var _0x3c4d49=_0x1d0898[_0x4cbf('0x39')][_0x4cbf('0x24')](',')[_0x4cbf('0x3d')](function(_0x33db0f){return Number(_0x33db0f);});var _0x745872=parseTagParameter(_0x3c4d49);_0x329763[_0x4cbf('0x3e')][_0x4cbf('0x3f')]['and'](_0x745872);_0x329763['tags'][_0x4cbf('0x40')]=_0x3c4d49;}else if(_0x1d0898[_0x4cbf('0x1f')]===_0x4cbf('0x41')){_0x329763[_0x4cbf('0x42')][_0x4cbf('0x3f')][_0x4cbf('0x43')](_0x4cbf('0x44'),_0x1d0898[_0x4cbf('0x39')]);_0x329763['user'][_0x4cbf('0x45')]=!![];}}}return _0x329763;}function parseModelFields(_0x3ed219,_0x19f860){var _0x47ca45=squel[_0x4cbf('0x20')]();var _0x3f17b4=_(_0x3ed219)[_0x4cbf('0x46')]()[_0x4cbf('0x3d')](function(_0x5e97e8){return _[_0x4cbf('0x47')](_0x19f860,['name',_0x5e97e8])?_0x5e97e8:undefined;})[_0x4cbf('0x48')]()['value']();if(_0x3ed219[_0x4cbf('0x49')]){_0x3f17b4[_0x4cbf('0x4a')]('Contact');}if(_0x3f17b4['length']>0x0){_0x3f17b4[_0x4cbf('0x1d')](function(_0x49b64c){if(_0x49b64c==='ListId'){_0x47ca45[_0x4cbf('0x43')](_0x4cbf('0x4b'),[][_0x4cbf('0x4c')](_0x3ed219[_0x49b64c]));}else if(_0x49b64c===_0x4cbf('0x49')){var _0x5563dd='%'+_0x3ed219[_0x49b64c]+'%';_0x47ca45[_0x4cbf('0x43')](_0x4cbf('0x4d'),_0x5563dd);}else{_0x47ca45[_0x4cbf('0x43')]('c.'+_0x49b64c+'\x20=\x20?',_0x3ed219[_0x49b64c]);}});}return _0x47ca45;}function parseQueryParameters(_0x5402a4,_0x5886ad){var _0x40daae=getSqlClauses();return Promise[_0x4cbf('0x4e')]()[_0x4cbf('0x4f')](function(){return parseModelFields(_0x5402a4,_0x5886ad);})[_0x4cbf('0x4f')](function(_0x348e53){_0x40daae[_0x4cbf('0x50')][_0x4cbf('0x43')](_0x348e53);return parseTagParameter(_0x5402a4[_0x4cbf('0x51')]);})[_0x4cbf('0x4f')](function(_0x4ca9e9){_0x40daae[_0x4cbf('0x3e')][_0x4cbf('0x3f')][_0x4cbf('0x43')](_0x4ca9e9);return parseSearchFilter(_0x5402a4[_0x4cbf('0x52')]);})[_0x4cbf('0x4f')](function(_0x392f36){_0x40daae['filter']=_0x392f36;return _0x40daae;});}function checkListsRestrictions(_0x1556f0,_0x4c617a,_0x159b1f){var _0xa92c79=squel[_0x4cbf('0x20')]();return Promise[_0x4cbf('0x4e')]()[_0x4cbf('0x4f')](function(){if(_0x4c617a[_0x4cbf('0x7')]&&_0x1556f0[_0x4cbf('0x5')]===_0x4cbf('0x6')&&!_0x159b1f){return _0x1556f0[_0x4cbf('0x53')]({'attributes':['id'],'raw':!![]});}})[_0x4cbf('0x4f')](function(_0x22698d){if(_0x22698d){if(_0x22698d[_0x4cbf('0x25')]===0x0){_0xa92c79[_0x4cbf('0x43')](_0x4cbf('0x54'));}else{_0xa92c79['and']('c.ListId\x20IN\x20?',_['map'](_0x22698d,'id'));}}})[_0x4cbf('0x4f')](function(){return _0xa92c79;});}function buildContactsQuery(_0x34a0c1,_0x54cd94,_0x357be9,_0xbe5353,_0x529e1d,_0x28564f){if(_0x54cd94){_0x54cd94=_0x357be9['attributes'];}_0x34a0c1=addFieldsToQuery(_0x34a0c1,_0x54cd94,_0xbe5353,_0x28564f,!![]);var _0x4871e3=squel['select']();_0x4871e3=addFieldsToQuery(_0x4871e3,_0x54cd94,_0xbe5353,_0x28564f,![]);if(_0xbe5353||_0x28564f){_0x34a0c1=applyJoinClauses(_0x34a0c1,!![]);_0x34a0c1[_0x4cbf('0x55')]('c.id');if(_0x357be9[_0x4cbf('0x56')]){_0x4871e3[_0x4cbf('0x56')](_0x357be9[_0x4cbf('0x56')]);}if(_0x357be9['offset']){_0x4871e3[_0x4cbf('0x57')](_0x357be9[_0x4cbf('0x57')]);}}else{_0x4871e3=applyJoinClauses(_0x4871e3,![]);_0x4871e3[_0x4cbf('0x55')]('subqry.id');if(_0x357be9['limit']){_0x34a0c1[_0x4cbf('0x56')](_0x357be9[_0x4cbf('0x56')]);}if(_0x357be9['offset']){_0x34a0c1[_0x4cbf('0x57')](_0x357be9[_0x4cbf('0x57')]);}}_0x4871e3[_0x4cbf('0x58')](_0x529e1d);if(_0x357be9[_0x4cbf('0x59')]){_0x357be9[_0x4cbf('0x59')][_0x4cbf('0x1d')](function(_0x11a892){_0x34a0c1['order']('c.'+_0x11a892[0x0],_0x11a892[0x1]==='DESC'?![]:!![]);_0x4871e3[_0x4cbf('0x59')](_0x4cbf('0x5a')+_0x11a892[0x0],_0x11a892[0x1]==='DESC'?![]:!![]);});}_0x4871e3[_0x4cbf('0x5b')](_0x34a0c1,_0x4cbf('0x13'));return _0x4871e3;}function getFilteredContacts(_0xc5416f){var _0x281fbb=[];return db[_0x4cbf('0x3c')][_0x4cbf('0x5c')]({'attributes':['id',_0x4cbf('0x31'),_0x4cbf('0x5d')],'raw':!![]})[_0x4cbf('0x4f')](function(_0x2a6892){_0x281fbb=_[_0x4cbf('0x5e')](_0x2a6892,'id');var _0x3f60bd={'type':db[_0x4cbf('0x5f')][_0x4cbf('0x60')][_0x4cbf('0x61')],'model':db[_0x4cbf('0x62')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x4cbf('0x63')][_0x4cbf('0x64')](_0xc5416f[_0x4cbf('0x65')](),_0x3f60bd);})[_0x4cbf('0x4f')](function(_0x428fc5){_0x428fc5[_0x4cbf('0x1d')](function(_0xd9572a){if(_0xd9572a[_0x4cbf('0x1e')]){_0xd9572a[_0x4cbf('0x66')]=[];_0xd9572a['TagIds']['split'](',')[_0x4cbf('0x1d')](function(_0x56a311){_0xd9572a[_0x4cbf('0x66')][_0x4cbf('0x4a')](_0x281fbb[_0x56a311]);});}delete _0xd9572a[_0x4cbf('0x1e')];});return _0x428fc5;});}function countFilteredContacts(_0x8eebf,_0x43da25){var _0x5af103=_0x8eebf['clone']();_0x5af103[_0x4cbf('0x1f')](_0x4cbf('0x67'));_0x5af103=applyJoinClauses(_0x5af103,!![]);_0x8eebf['group'](_0x4cbf('0x68'));var _0x3a198d=utils[_0x4cbf('0x21')](_0x43da25);if(!_[_0x4cbf('0x69')](_0x3a198d)){_0x5af103[_0x4cbf('0xa')](_0x4cbf('0x6a'),_0x3a198d);}var _0x5625b3={'type':db[_0x4cbf('0x5f')][_0x4cbf('0x60')][_0x4cbf('0x61')],'raw':!![]};return db['sequelize'][_0x4cbf('0x64')](_0x5af103[_0x4cbf('0x65')](),_0x5625b3)['then'](function(_0x397d2a){return _0x397d2a[0x0][_0x4cbf('0x67')];});}module[_0x4cbf('0x6b')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x74b8=['CmContact','sequelize','query','toString','Tags','clone','c.id','t.id\x20IN\x20?','COUNT(*)','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','ListId','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','subqry','firstName','lastName','phone','mobile','fax','email','createdAt','updatedAt','deletedAt','TagIds','includes','push','field','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','start','value','Tag','map','tags','and','ids','user','clause','uc.UserId\x20=\x20?','keys','compact','c.ListId\x20IN\x20?','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','agent','getLists','c.ListId\x20IS\x20NULL','attributes','group','limit','offset','subqry.id','having','order','DESC','findAll','color','keyBy','Sequelize','QueryTypes','SELECT'];(function(_0x41d902,_0x29d0b){var _0x360fb1=function(_0x2517ae){while(--_0x2517ae){_0x41d902['push'](_0x41d902['shift']());}};_0x360fb1(++_0x29d0b);}(_0x74b8,0x79));var _0x874b=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x74b8[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x874b('0x0'));var squel=require(_0x874b('0x1'));var as=require(_0x874b('0x2'));var qs=require(_0x874b('0x3'));var utils=require(_0x874b('0x4'));var db=require(_0x874b('0x5'))['db'];function skipContactsQuery(_0x400d74,_0x49eefc){var _0x3eb843=![];if(_0x400d74[_0x874b('0x6')]==='agent'&&!_0x49eefc[_0x874b('0x7')]&&!_0x49eefc[_0x874b('0x8')]&&_0x49eefc['autocomplete']!==_0x874b('0x9')){_0x3eb843=!![];}return _0x3eb843;}function getContactsSubquery(){return squel[_0x874b('0xa')]()[_0x874b('0xb')](_0x874b('0xc'),'c')[_0x874b('0xd')](_0x874b('0xe'));}function applyJoinClauses(_0x3defbc,_0x5a0dbf){var _0x234f09=_0x5a0dbf?'c':'subqry';_0x3defbc[_0x874b('0xf')]('cm_user_has_contacts','uc',_0x874b('0x10')+_0x234f09+_0x874b('0x11'))[_0x874b('0xf')]('cm_contact_has_tags','ct',_0x874b('0x12')+_0x234f09+_0x874b('0x11'))[_0x874b('0xf')](_0x874b('0x13'),'t','t.id\x20=\x20ct.TagId');return _0x3defbc;}function addFieldsToQuery(_0x3adf8f,_0x231043,_0x461386,_0x2f425b,_0x3b0e75){var _0x4560b6=_0x3b0e75?'c':_0x874b('0x14');if(!_0x231043){_0x231043=['id',_0x874b('0x15'),_0x874b('0x16'),_0x874b('0x17'),_0x874b('0x18'),_0x874b('0x19'),_0x874b('0x1a'),'ListId','CompanyId',_0x874b('0x1b'),_0x874b('0x1c'),_0x874b('0x1d'),_0x874b('0x1e')];}else if(!_0x231043[_0x874b('0x1f')]('id')){_0x231043[_0x874b('0x20')]('id');}var _0x2dbb4c=_0x461386&&_0x3b0e75||!_0x461386&&!_0x3b0e75;if(_0x2f425b){_0x2dbb4c=_0x2f425b&&_0x3b0e75||!_0x2f425b&&!_0x3b0e75;}_0x231043['forEach'](function(_0x3d9afa){if(_0x3d9afa==='TagIds'){if(_0x2dbb4c){_0x3adf8f[_0x874b('0x21')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3d9afa);}else if(_0x461386||_0x2f425b){_0x3adf8f[_0x874b('0x21')](_0x4560b6+'.'+_0x3d9afa);}}else{_0x3adf8f[_0x874b('0x21')](_0x4560b6+'.'+_0x3d9afa);}});return _0x3adf8f;}function getSqlClauses(){var _0x2113c4={'default':squel[_0x874b('0x22')](),'fields':squel[_0x874b('0x22')](),'filter':squel[_0x874b('0x22')](),'tags':{'clause':squel[_0x874b('0x22')](),'ids':null},'user':{'clause':squel[_0x874b('0x22')](),'skip':![]}};return _0x2113c4;}function parseTagParameter(_0x2bfb18){var _0x509c38=squel[_0x874b('0x22')]();if(_0x2bfb18){var _0x1cadbb=utils[_0x874b('0x23')](_0x2bfb18);_0x1cadbb[_0x874b('0x24')](function(_0xe1a9f0){_0x509c38['or'](_0x874b('0x25'),'%,'+_0xe1a9f0+',%');});}return _0x509c38;}function parseSearchFilter(_0x17d0af){var _0x1086eb=squel[_0x874b('0x22')]();if(_0x17d0af){var _0x16d917=_0x17d0af[_0x874b('0x26')]('\x5c','\x5c\x5c')[_0x874b('0x26')](/'/g,'\x27\x27');if(_0x16d917[_0x874b('0x27')]('\x20')[_0x874b('0x28')]>0x1){_0x1086eb['or'](_0x874b('0x29'),qs[_0x874b('0x2a')](_0x16d917),null);}else{if(qs[_0x874b('0x2b')](_0x16d917)){_0x1086eb['or'](_0x874b('0x2c'),_0x16d917+'%');_0x1086eb['or'](_0x874b('0x2d'),_0x16d917+'%');_0x1086eb['or'](_0x874b('0x2e'),_0x16d917+'%');_0x1086eb['or'](_0x874b('0x2f'),_0x16d917+'%');}else if(qs[_0x874b('0x30')](_0x16d917)){_0x1086eb['or'](_0x874b('0x31'),_0x16d917+'%');}else{_0x1086eb['or']('c.firstName\x20LIKE\x20?','%'+_0x16d917+'%');_0x1086eb['or']('c.lastName\x20LIKE\x20?','%'+_0x16d917+'%');_0x1086eb['or'](_0x874b('0x31'),'%'+_0x16d917+'%');}}}return _0x1086eb;}function parseAdvancedSearchFilter(_0x2d1b11,_0x41278){var _0x649497=getSqlClauses();var _0x52d95b=as[_0x874b('0x32')](_0x2d1b11);var _0x3e1dea=_0x52d95b['sqlOperator'];for(var _0x5688e0=0x0;_0x5688e0<_0x52d95b[_0x874b('0x33')]['length'];_0x5688e0++){var _0x4584a8=_0x52d95b['conditions'][_0x5688e0];var _0x567470='c';var _0x4936ef=_['find'](_0x41278,[_0x874b('0x34'),_0x4584a8[_0x874b('0x21')]]);if(_0x4936ef){if(_0x4584a8['field']===_0x874b('0x35')||_0x4936ef[_0x874b('0x36')]===_0x874b('0x37')){_0x4584a8[_0x874b('0x38')]=_0x874b('0x39');}var _0x34f1c2=as[_0x874b('0x3a')](_0x567470,_0x4936ef[_0x874b('0x3b')],_0x4584a8);_0x649497[_0x874b('0x3c')][_0x3e1dea](_0x34f1c2[_0x874b('0x3d')],_0x34f1c2['value'][_0x874b('0x3e')],_0x34f1c2[_0x874b('0x3f')]['end']);}else{if(_0x4584a8['field']===_0x874b('0x40')){var _0x5f409f=_0x4584a8[_0x874b('0x3f')]['split'](',')[_0x874b('0x41')](function(_0x4d04ca){return Number(_0x4d04ca);});var _0x5d2e79=parseTagParameter(_0x5f409f);_0x649497[_0x874b('0x42')]['clause'][_0x874b('0x43')](_0x5d2e79);_0x649497[_0x874b('0x42')][_0x874b('0x44')]=_0x5f409f;}else if(_0x4584a8[_0x874b('0x21')]==='User'){_0x649497[_0x874b('0x45')][_0x874b('0x46')][_0x874b('0x43')](_0x874b('0x47'),_0x4584a8[_0x874b('0x3f')]);_0x649497[_0x874b('0x45')]['skip']=!![];}}}return _0x649497;}function parseModelFields(_0x23ed60,_0x3e6733){var _0x21abab=squel[_0x874b('0x22')]();var _0x2631f8=_(_0x23ed60)[_0x874b('0x48')]()[_0x874b('0x41')](function(_0x3891e8){return _['some'](_0x3e6733,['name',_0x3891e8])?_0x3891e8:undefined;})[_0x874b('0x49')]()[_0x874b('0x3f')]();if(_0x23ed60['Contact']){_0x2631f8[_0x874b('0x20')]('Contact');}if(_0x2631f8[_0x874b('0x28')]>0x0){_0x2631f8[_0x874b('0x24')](function(_0x4af449){if(_0x4af449===_0x874b('0x8')){_0x21abab[_0x874b('0x43')](_0x874b('0x4a'),[][_0x874b('0x4b')](_0x23ed60[_0x4af449]));}else if(_0x4af449===_0x874b('0x4c')){var _0x37ac20='%'+_0x23ed60[_0x4af449]+'%';_0x21abab[_0x874b('0x43')](_0x874b('0x4d'),_0x37ac20);}else{_0x21abab['and']('c.'+_0x4af449+_0x874b('0x4e'),_0x23ed60[_0x4af449]);}});}return _0x21abab;}function parseQueryParameters(_0x327006,_0x25e5aa){var _0x246750=getSqlClauses();return Promise[_0x874b('0x4f')]()[_0x874b('0x50')](function(){return parseModelFields(_0x327006,_0x25e5aa);})['then'](function(_0x43c365){_0x246750[_0x874b('0x51')][_0x874b('0x43')](_0x43c365);return parseTagParameter(_0x327006[_0x874b('0x52')]);})[_0x874b('0x50')](function(_0x470dca){_0x246750[_0x874b('0x42')]['clause']['and'](_0x470dca);return parseSearchFilter(_0x327006[_0x874b('0x53')]);})[_0x874b('0x50')](function(_0x46bf12){_0x246750[_0x874b('0x53')]=_0x46bf12;return _0x246750;});}function checkListsRestrictions(_0x38bf94,_0xd15797,_0x45fc9d){var _0x1344a5=squel[_0x874b('0x22')]();return Promise[_0x874b('0x4f')]()[_0x874b('0x50')](function(){if(_0xd15797['search']&&_0x38bf94[_0x874b('0x6')]===_0x874b('0x54')&&!_0x45fc9d){return _0x38bf94[_0x874b('0x55')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x58138b){if(_0x58138b){if(_0x58138b[_0x874b('0x28')]===0x0){_0x1344a5[_0x874b('0x43')](_0x874b('0x56'));}else{_0x1344a5[_0x874b('0x43')]('c.ListId\x20IN\x20?',_[_0x874b('0x41')](_0x58138b,'id'));}}})['then'](function(){return _0x1344a5;});}function buildContactsQuery(_0x3bbc0d,_0xd251b9,_0x5f4a0b,_0x45cafa,_0x409789,_0x89783){if(_0xd251b9){_0xd251b9=_0x5f4a0b[_0x874b('0x57')];}_0x3bbc0d=addFieldsToQuery(_0x3bbc0d,_0xd251b9,_0x45cafa,_0x89783,!![]);var _0x3eda8b=squel[_0x874b('0xa')]();_0x3eda8b=addFieldsToQuery(_0x3eda8b,_0xd251b9,_0x45cafa,_0x89783,![]);if(_0x45cafa||_0x89783){_0x3bbc0d=applyJoinClauses(_0x3bbc0d,!![]);_0x3bbc0d[_0x874b('0x58')]('c.id');if(_0x5f4a0b['limit']){_0x3eda8b[_0x874b('0x59')](_0x5f4a0b[_0x874b('0x59')]);}if(_0x5f4a0b['offset']){_0x3eda8b['offset'](_0x5f4a0b[_0x874b('0x5a')]);}}else{_0x3eda8b=applyJoinClauses(_0x3eda8b,![]);_0x3eda8b[_0x874b('0x58')](_0x874b('0x5b'));if(_0x5f4a0b[_0x874b('0x59')]){_0x3bbc0d['limit'](_0x5f4a0b['limit']);}if(_0x5f4a0b[_0x874b('0x5a')]){_0x3bbc0d['offset'](_0x5f4a0b[_0x874b('0x5a')]);}}_0x3eda8b[_0x874b('0x5c')](_0x409789);if(_0x5f4a0b['order']){_0x5f4a0b[_0x874b('0x5d')][_0x874b('0x24')](function(_0x42538a){_0x3bbc0d['order']('c.'+_0x42538a[0x0],_0x42538a[0x1]==='DESC'?![]:!![]);_0x3eda8b['order']('subqry.'+_0x42538a[0x0],_0x42538a[0x1]===_0x874b('0x5e')?![]:!![]);});}_0x3eda8b[_0x874b('0xb')](_0x3bbc0d,_0x874b('0x14'));return _0x3eda8b;}function getFilteredContacts(_0x2c7693){var _0xd2b7aa=[];return db['Tag'][_0x874b('0x5f')]({'attributes':['id',_0x874b('0x34'),_0x874b('0x60')],'raw':!![]})[_0x874b('0x50')](function(_0x45f4c7){_0xd2b7aa=_[_0x874b('0x61')](_0x45f4c7,'id');var _0x59953e={'type':db[_0x874b('0x62')][_0x874b('0x63')][_0x874b('0x64')],'model':db[_0x874b('0x65')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x874b('0x66')][_0x874b('0x67')](_0x2c7693[_0x874b('0x68')](),_0x59953e);})[_0x874b('0x50')](function(_0x5b163c){_0x5b163c[_0x874b('0x24')](function(_0x5575b2){if(_0x5575b2[_0x874b('0x1e')]){_0x5575b2[_0x874b('0x69')]=[];_0x5575b2['TagIds']['split'](',')[_0x874b('0x24')](function(_0x56da2c){_0x5575b2[_0x874b('0x69')][_0x874b('0x20')](_0xd2b7aa[_0x56da2c]);});}delete _0x5575b2[_0x874b('0x1e')];});return _0x5b163c;});}function countFilteredContacts(_0x491b02,_0x161bc0){var _0x34e87f=_0x491b02[_0x874b('0x6a')]();_0x34e87f[_0x874b('0x21')]('COUNT(*)');_0x34e87f=applyJoinClauses(_0x34e87f,!![]);_0x491b02['group'](_0x874b('0x6b'));var _0x1cb232=utils[_0x874b('0x23')](_0x161bc0);if(!_['isEmpty'](_0x1cb232)){_0x34e87f[_0x874b('0xd')](_0x874b('0x6c'),_0x1cb232);}var _0x5522ff={'type':db[_0x874b('0x62')][_0x874b('0x63')][_0x874b('0x64')],'raw':!![]};return db['sequelize']['query'](_0x34e87f['toString'](),_0x5522ff)['then'](function(_0x43a7ce){return _0x43a7ce[0x0][_0x874b('0x6d')];});}module[_0x874b('0x6e')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 1958693..87bc5ef 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94fb=['secrets','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','close','decryptFile','createReadStream','final','unlink','encryptString','base64','decryptString','secret','createDecipher','utf8','crypto','bluebird','lodash','../../config/logger','app'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x94fb,0x17c));var _0xb94f=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x94fb[_0x5bd426];return _0x23a7eb;};'use strict';var crypto=require(_0xb94f('0x0'));var fs=require('fs');var BPromise=require(_0xb94f('0x1'));var _=require(_0xb94f('0x2'));var config=require('../../config/environment');var logger=require(_0xb94f('0x3'))(_0xb94f('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb94f('0x5')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0xb94f('0x6')]&&config[_0xb94f('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xb94f('0x6')][_0xb94f('0x7')]);if(isSupported){fileOptions[_0xb94f('0x7')]=config[_0xb94f('0x6')][_0xb94f('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb94f('0x8')](',\x20');logger[_0xb94f('0x9')](config['encrypt'][_0xb94f('0x7')],_0xb94f('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x4f4873){return AES_SUPPORTED_RX[_0xb94f('0xb')](_0x4f4873);}function getSupportedCiphers(){return crypto[_0xb94f('0xc')]()[_0xb94f('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x5ca49c){return getSupportedCiphers()[_0xb94f('0xe')](_0x5ca49c)>-0x1;}function combineOptions(_0x4faead){var _0xb994e2={};for(var _0x180ca2 in fileOptions){if(fileOptions[_0xb94f('0xf')](_0x180ca2)){_0xb994e2[_0x180ca2]=fileOptions[_0x180ca2];}}if(_0x4faead){for(var _0x5b3f4a in _0x4faead){if(_0x4faead[_0xb94f('0xf')](_0x5b3f4a)){_0xb994e2[_0x5b3f4a]=_0x4faead[_0x5b3f4a];}}}return _0xb994e2;}exports[_0xb94f('0x10')]=function(_0x544a16,_0x1336db,_0x5a2b5a,_0x106e22){return new BPromise(function(_0x113927,_0x468cbc){_0x106e22=combineOptions(_0x106e22);var _0x332de6=new Buffer(_0x5a2b5a);var _0x4798ec=fs['createReadStream'](_0x544a16);var _0x4a6ea1=fs[_0xb94f('0x11')](_0x1336db);var _0x2493f2=crypto[_0xb94f('0x12')](_0x106e22['algorithm'],_0x332de6);_0x4798ec['on'](_0xb94f('0x13'),function(_0x37d2b0){var _0x2be55e=new Buffer(_0x2493f2[_0xb94f('0x14')](_0x37d2b0),_0xb94f('0x15'));_0x4a6ea1[_0xb94f('0x16')](_0x2be55e);});_0x4798ec['on'](_0xb94f('0x17'),function(){try{var _0x3b64a4=new Buffer(_0x2493f2['final'](_0xb94f('0x15')),_0xb94f('0x15'));_0x4a6ea1[_0xb94f('0x16')](_0x3b64a4);_0x4a6ea1[_0xb94f('0x17')]();_0x4a6ea1['on'](_0xb94f('0x18'),function(){return _0x113927(_0x1336db);});}catch(_0xe02a9e){fs['unlink'](_0x1336db);return _0x468cbc(_0xe02a9e);}});});};exports[_0xb94f('0x19')]=function(_0x346740,_0x18909e,_0x50a25e,_0x591d92){return new BPromise(function(_0x33e036,_0x42b0c4){_0x591d92=combineOptions(_0x591d92);var _0x3847bd=new Buffer(_0x50a25e);var _0x3816d1=fs[_0xb94f('0x1a')](_0x346740);var _0x4f8a2b=fs['createWriteStream'](_0x18909e);var _0x3d732c=crypto['createDecipher'](_0x591d92[_0xb94f('0x7')],_0x3847bd);_0x3816d1['on'](_0xb94f('0x13'),function(_0x1b1917){var _0x14d048=new Buffer(_0x3d732c[_0xb94f('0x14')](_0x1b1917),'binary');_0x4f8a2b[_0xb94f('0x16')](_0x14d048);});_0x3816d1['on'](_0xb94f('0x17'),function(){try{var _0xd1583c=new Buffer(_0x3d732c[_0xb94f('0x1b')](_0xb94f('0x15')),_0xb94f('0x15'));_0x4f8a2b[_0xb94f('0x16')](_0xd1583c);_0x4f8a2b[_0xb94f('0x17')]();_0x4f8a2b['on'](_0xb94f('0x18'),function(){return _0x33e036(_0x18909e);});}catch(_0xf7d4c1){fs[_0xb94f('0x1c')](_0x18909e);return _0x42b0c4(_0xf7d4c1);}});});};exports[_0xb94f('0x1d')]=function(_0x5da2b8,_0xf640e0,_0x387041){var _0x110873=_0x387041||stringOptions[_0xb94f('0x7')];var _0xa460c0=_0xf640e0||stringOptions['secret'];var _0x57fc84=crypto[_0xb94f('0x12')](_0x110873,_0xa460c0);var _0x2b4180=_0x57fc84[_0xb94f('0x14')](_0x5da2b8,'utf8',_0xb94f('0x1e'));_0x2b4180+=_0x57fc84['final'](_0xb94f('0x1e'));return _0x2b4180;};exports[_0xb94f('0x1f')]=function(_0x238367,_0x5015fb,_0x1cb8a6){var _0x2c585c=_0x1cb8a6||stringOptions[_0xb94f('0x7')];var _0x479b5a=_0x5015fb||stringOptions[_0xb94f('0x20')];var _0x48eaa3=crypto[_0xb94f('0x21')](_0x2c585c,_0x479b5a);var _0x54be36=_0x48eaa3[_0xb94f('0x14')](_0x238367,_0xb94f('0x1e'),_0xb94f('0x22'));_0x54be36+=_0x48eaa3[_0xb94f('0x1b')]('utf8');return _0x54be36;}; \ No newline at end of file +var _0xbbfa=['encryptFile','createReadStream','createWriteStream','data','update','binary','write','end','final','createDecipher','close','createCipher','base64','decryptString','secret','utf8','bluebird','lodash','../../config/environment','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','filter','indexOf','hasOwnProperty'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xbbfa,0x6a));var _0xabbf=function(_0x13a68a,_0x2daaaa){_0x13a68a=_0x13a68a-0x0;var _0x27f857=_0xbbfa[_0x13a68a];return _0x27f857;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xabbf('0x0'));var _=require(_0xabbf('0x1'));var config=require(_0xabbf('0x2'));var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xabbf('0x3')][_0xabbf('0x4')],'algorithm':_0xabbf('0x5')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0xabbf('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0xabbf('0x7')]=config[_0xabbf('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xabbf('0x8')](',\x20');logger[_0xabbf('0x9')](config['encrypt']['algorithm'],_0xabbf('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x157a10){return AES_SUPPORTED_RX['test'](_0x157a10);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xabbf('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x23bddb){return getSupportedCiphers()[_0xabbf('0xc')](_0x23bddb)>-0x1;}function combineOptions(_0x4d17cd){var _0x2df118={};for(var _0x2e2c21 in fileOptions){if(fileOptions[_0xabbf('0xd')](_0x2e2c21)){_0x2df118[_0x2e2c21]=fileOptions[_0x2e2c21];}}if(_0x4d17cd){for(var _0x4d4a9a in _0x4d17cd){if(_0x4d17cd[_0xabbf('0xd')](_0x4d4a9a)){_0x2df118[_0x4d4a9a]=_0x4d17cd[_0x4d4a9a];}}}return _0x2df118;}exports[_0xabbf('0xe')]=function(_0x4e4743,_0xc7ad70,_0x4bd9dc,_0x30e15c){return new BPromise(function(_0x35b5b2,_0x97c02b){_0x30e15c=combineOptions(_0x30e15c);var _0x216918=new Buffer(_0x4bd9dc);var _0x220a65=fs[_0xabbf('0xf')](_0x4e4743);var _0x329087=fs[_0xabbf('0x10')](_0xc7ad70);var _0x3f8906=crypto['createCipher'](_0x30e15c[_0xabbf('0x7')],_0x216918);_0x220a65['on'](_0xabbf('0x11'),function(_0x3e2921){var _0x10dd1b=new Buffer(_0x3f8906[_0xabbf('0x12')](_0x3e2921),_0xabbf('0x13'));_0x329087[_0xabbf('0x14')](_0x10dd1b);});_0x220a65['on'](_0xabbf('0x15'),function(){try{var _0x227703=new Buffer(_0x3f8906[_0xabbf('0x16')](_0xabbf('0x13')),_0xabbf('0x13'));_0x329087[_0xabbf('0x14')](_0x227703);_0x329087[_0xabbf('0x15')]();_0x329087['on']('close',function(){return _0x35b5b2(_0xc7ad70);});}catch(_0x508063){fs['unlink'](_0xc7ad70);return _0x97c02b(_0x508063);}});});};exports['decryptFile']=function(_0x24936c,_0x52ac9b,_0x89f4dd,_0x246f4f){return new BPromise(function(_0x3b0e51,_0x419bcb){_0x246f4f=combineOptions(_0x246f4f);var _0x745f6a=new Buffer(_0x89f4dd);var _0x23268f=fs[_0xabbf('0xf')](_0x24936c);var _0x569cf4=fs[_0xabbf('0x10')](_0x52ac9b);var _0x5111f4=crypto[_0xabbf('0x17')](_0x246f4f[_0xabbf('0x7')],_0x745f6a);_0x23268f['on'](_0xabbf('0x11'),function(_0x4eb506){var _0x4446ae=new Buffer(_0x5111f4[_0xabbf('0x12')](_0x4eb506),'binary');_0x569cf4[_0xabbf('0x14')](_0x4446ae);});_0x23268f['on'](_0xabbf('0x15'),function(){try{var _0x9a1ac6=new Buffer(_0x5111f4[_0xabbf('0x16')](_0xabbf('0x13')),_0xabbf('0x13'));_0x569cf4[_0xabbf('0x14')](_0x9a1ac6);_0x569cf4['end']();_0x569cf4['on'](_0xabbf('0x18'),function(){return _0x3b0e51(_0x52ac9b);});}catch(_0x2bb603){fs['unlink'](_0x52ac9b);return _0x419bcb(_0x2bb603);}});});};exports['encryptString']=function(_0x297548,_0x5a3770,_0x4dca34){var _0x5d2bb8=_0x4dca34||stringOptions[_0xabbf('0x7')];var _0x1c5739=_0x5a3770||stringOptions['secret'];var _0x52964b=crypto[_0xabbf('0x19')](_0x5d2bb8,_0x1c5739);var _0x4b4b21=_0x52964b[_0xabbf('0x12')](_0x297548,'utf8',_0xabbf('0x1a'));_0x4b4b21+=_0x52964b[_0xabbf('0x16')]('base64');return _0x4b4b21;};exports[_0xabbf('0x1b')]=function(_0x1a2580,_0xf44182,_0x163fb1){var _0x229f7c=_0x163fb1||stringOptions[_0xabbf('0x7')];var _0x354f1e=_0xf44182||stringOptions[_0xabbf('0x1c')];var _0x7f0e87=crypto['createDecipher'](_0x229f7c,_0x354f1e);var _0xd013a4=_0x7f0e87[_0xabbf('0x12')](_0x1a2580,'base64',_0xabbf('0x1d'));_0xd013a4+=_0x7f0e87[_0xabbf('0x16')]('utf8');return _0xd013a4;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 05018e4..40134eb 100644 --- a/server/components/export/csv.js +++ b/server/components/export/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc62f=['zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','csv','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','join','each','%s.%s','writeFileSync'];(function(_0x31b81f,_0x4cac54){var _0x25d3c6=function(_0x38feae){while(--_0x38feae){_0x31b81f['push'](_0x31b81f['shift']());}};_0x25d3c6(++_0x4cac54);}(_0xc62f,0x190));var _0xfc62=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc62f[_0x5ddb1c];return _0x354adc;};'use strict';var util=require(_0xfc62('0x0'));var path=require(_0xfc62('0x1'));var _=require(_0xfc62('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xfc62('0x3'));var zipdir=require(_0xfc62('0x4'));var rimraf=require(_0xfc62('0x5'));var db=require(_0xfc62('0x6'))['db'];var dbH=require('../../mysqldb')[_0xfc62('0x7')];var logger=require(_0xfc62('0x8'))(_0xfc62('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x204a0b,_0x33517f){var _0x2ae398={'status':_0x204a0b};var _0x570e5f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x33517f){_0x2ae398[_0xfc62('0xa')]=_0x33517f;}return db[_0xfc62('0xb')][_0xfc62('0xc')](_0x2ae398,_0x570e5f);}function main(){var _0x2f2ea7=0x1388;var _0x4c37d8;logger[_0xfc62('0xd')](util[_0xfc62('0xe')](_0xfc62('0xf'),EXTRACTED_REPORT_ID,_0xfc62('0x10')));return db[_0xfc62('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfc62('0x12'),_0xfc62('0x13')]})[_0xfc62('0x14')](function(_0x55afb0){if(_0x55afb0){_0x4c37d8=_0x55afb0;_0x2f2ea7=_0x4c37d8[_0xfc62('0x13')]||0x1388;}})[_0xfc62('0x14')](function(){return dbH[_0xfc62('0x15')][_0xfc62('0x16')](util['format'](_0xfc62('0x17'),QUERY),{'type':dbH['sequelize'][_0xfc62('0x18')][_0xfc62('0x19')]});})['then'](function(_0x4d3f6f){if(!_0x4d3f6f[0x0][_0xfc62('0x1a')]){return analyticExtractedReport(_0xfc62('0x1b'));}var _0x178429=[];var _0x15fed6=0x0;if(_0x4c37d8[_0xfc62('0x12')]){if(_0x4d3f6f&&_0x4d3f6f[_0xfc62('0x1c')]){var _0xb176a6=_[_0xfc62('0x1d')](_0x4d3f6f[0x0][_0xfc62('0x1a')]/_0x2f2ea7);var _0x27f59d=Number[_0xfc62('0x1e')](_0x4d3f6f[0x0]['num']/_0x2f2ea7)?_0x4d3f6f[0x0][_0xfc62('0x1a')]%_0x2f2ea7:0x0;_0xb176a6[_0xfc62('0x1f')](function(_0x298af5){if(_0x298af5>0x0){_0x15fed6+=_0x2f2ea7;}_0x178429[_0xfc62('0x20')](dbH[_0xfc62('0x15')][_0xfc62('0x16')](util[_0xfc62('0xe')](_0xfc62('0x21'),QUERY,_0x2f2ea7,_0x15fed6),{'type':dbH[_0xfc62('0x15')][_0xfc62('0x18')]['SELECT']}));});if(_0x27f59d>0x0){_0x15fed6+=_0x2f2ea7;_0x178429[_0xfc62('0x20')](dbH[_0xfc62('0x15')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x27f59d,_0x15fed6),{'type':dbH[_0xfc62('0x15')]['QueryTypes'][_0xfc62('0x19')]}));}}}else{_0x178429[_0xfc62('0x20')](dbH[_0xfc62('0x15')]['query'](QUERY,{'type':dbH[_0xfc62('0x15')]['QueryTypes'][_0xfc62('0x19')]}));}var _0x2970ca=path['dirname'](PATH);var _0x665b70=path[_0xfc62('0x22')](PATH,_0xfc62('0x23'));var _0x1a11d9=_0x4c37d8[_0xfc62('0x12')]&&_0x178429[_0xfc62('0x1c')]>0x1;var _0x4038ce=[];if(!fs[_0xfc62('0x24')](path[_0xfc62('0x25')](_0x2970ca,_0x665b70))&&_0x1a11d9){fs['mkdirSync'](path[_0xfc62('0x25')](_0x2970ca,_0x665b70));}return BPromise[_0xfc62('0x26')](_0x178429,function(_0x2b9e0c){_0x4038ce[_0xfc62('0x20')](_0x2b9e0c);})[_0xfc62('0x14')](function(){for(var _0x134c5d=0x0;_0x134c5d<_0x4038ce[_0xfc62('0x1c')];_0x134c5d+=0x1){var _0xfdda01;var _0x3df5e3=_0x4038ce[_0x134c5d];if(_0x1a11d9){_0xfdda01=path['join'](_0x2970ca,_0x665b70,util[_0xfc62('0xe')]('%s%d.%s',_0x665b70,_0x134c5d,'csv'));}else{_0xfdda01=path['join'](_0x2970ca,util['format'](_0xfc62('0x27'),_0x665b70,'csv'));}fs[_0xfc62('0x28')](_0xfdda01,csv(_0x3df5e3));}})['then'](function(){if(_0x1a11d9){return new Promise(function(_0x1947a7){zipdir(path[_0xfc62('0x25')](_0x2970ca,_0x665b70),{'saveTo':path[_0xfc62('0x25')](_0x2970ca,util['format']('%s.%s',_0x665b70,'zip'))},function(_0x2507d6,_0x355ddc){rimraf(path[_0xfc62('0x25')](_0x2970ca,_0x665b70),function(){});_0x1947a7(_0xfc62('0x29'));});});}})[_0xfc62('0x14')](function(){logger[_0xfc62('0xd')](util[_0xfc62('0xe')](_0xfc62('0x2a'),EXTRACTED_REPORT_ID,_0xfc62('0x10')));return analyticExtractedReport(_0xfc62('0x2b'),_0x1a11d9?util[_0xfc62('0xe')](_0xfc62('0x27'),_0x665b70,_0x1a11d9?_0xfc62('0x2c'):_0xfc62('0x2d')):null);});})['catch'](function(_0x35116b){logger[_0xfc62('0xd')](util[_0xfc62('0xe')](_0xfc62('0x2e'),EXTRACTED_REPORT_ID,_0xfc62('0x10')),util[_0xfc62('0x2f')](_0x35116b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfc62('0x30'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xa6b2=['split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','isInteger','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','zip','zip\x20finished','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find'];(function(_0x446bc2,_0x3e65be){var _0x52b940=function(_0x1ee216){while(--_0x1ee216){_0x446bc2['push'](_0x446bc2['shift']());}};_0x52b940(++_0x3e65be);}(_0xa6b2,0x1eb));var _0x2a6b=function(_0x24f5ec,_0x34c588){_0x24f5ec=_0x24f5ec-0x0;var _0x366b7c=_0xa6b2[_0x24f5ec];return _0x366b7c;};'use strict';var util=require(_0x2a6b('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0x2a6b('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x2a6b('0x2'));var db=require(_0x2a6b('0x3'))['db'];var dbH=require(_0x2a6b('0x3'))[_0x2a6b('0x4')];var logger=require(_0x2a6b('0x5'))(_0x2a6b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x2a6b('0x7')][0x2]);var QUERY=process[_0x2a6b('0x7')][0x3];var PATH=process[_0x2a6b('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xde9f7b,_0x17c967){var _0x1285cb={'status':_0xde9f7b};var _0x256a8a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17c967){_0x1285cb['savename']=_0x17c967;}return db[_0x2a6b('0x8')][_0x2a6b('0x9')](_0x1285cb,_0x256a8a);}function main(){var _0x2dcc0a=0x1388;var _0x21edc6;logger[_0x2a6b('0xa')](util[_0x2a6b('0xb')](_0x2a6b('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x2a6b('0xd')][_0x2a6b('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2a6b('0xf'),'splitSizeCsv']})['then'](function(_0x4780de){if(_0x4780de){_0x21edc6=_0x4780de;_0x2dcc0a=_0x21edc6[_0x2a6b('0x10')]||0x1388;}})[_0x2a6b('0x11')](function(){return dbH['sequelize'][_0x2a6b('0x12')](util[_0x2a6b('0xb')](_0x2a6b('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x2a6b('0x14')]});})[_0x2a6b('0x11')](function(_0x12ed7d){if(!_0x12ed7d[0x0][_0x2a6b('0x15')]){return analyticExtractedReport(_0x2a6b('0x16'));}var _0x52aff7=[];var _0x442548=0x0;if(_0x21edc6['split']){if(_0x12ed7d&&_0x12ed7d[_0x2a6b('0x17')]){var _0x530f87=_['range'](_0x12ed7d[0x0]['num']/_0x2dcc0a);var _0x1bff81=Number[_0x2a6b('0x18')](_0x12ed7d[0x0]['num']/_0x2dcc0a)?_0x12ed7d[0x0][_0x2a6b('0x15')]%_0x2dcc0a:0x0;_0x530f87['forEach'](function(_0x13ab57){if(_0x13ab57>0x0){_0x442548+=_0x2dcc0a;}_0x52aff7[_0x2a6b('0x19')](dbH[_0x2a6b('0x1a')]['query'](util[_0x2a6b('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2dcc0a,_0x442548),{'type':dbH['sequelize']['QueryTypes'][_0x2a6b('0x14')]}));});if(_0x1bff81>0x0){_0x442548+=_0x2dcc0a;_0x52aff7[_0x2a6b('0x19')](dbH[_0x2a6b('0x1a')][_0x2a6b('0x12')](util['format'](_0x2a6b('0x1b'),QUERY,_0x1bff81,_0x442548),{'type':dbH[_0x2a6b('0x1a')][_0x2a6b('0x1c')][_0x2a6b('0x14')]}));}}}else{_0x52aff7[_0x2a6b('0x19')](dbH[_0x2a6b('0x1a')][_0x2a6b('0x12')](QUERY,{'type':dbH['sequelize'][_0x2a6b('0x1c')]['SELECT']}));}var _0x20fbaa=path[_0x2a6b('0x1d')](PATH);var _0x4e5683=path[_0x2a6b('0x1e')](PATH,_0x2a6b('0x1f'));var _0x3a8efa=_0x21edc6[_0x2a6b('0xf')]&&_0x52aff7['length']>0x1;var _0x1b6ecd=[];if(!fs[_0x2a6b('0x20')](path[_0x2a6b('0x21')](_0x20fbaa,_0x4e5683))&&_0x3a8efa){fs[_0x2a6b('0x22')](path[_0x2a6b('0x21')](_0x20fbaa,_0x4e5683));}return BPromise[_0x2a6b('0x23')](_0x52aff7,function(_0x55c02f){_0x1b6ecd['push'](_0x55c02f);})['then'](function(){for(var _0x4f32e0=0x0;_0x4f32e0<_0x1b6ecd[_0x2a6b('0x17')];_0x4f32e0+=0x1){var _0x35c7af;var _0x3f655c=_0x1b6ecd[_0x4f32e0];if(_0x3a8efa){_0x35c7af=path[_0x2a6b('0x21')](_0x20fbaa,_0x4e5683,util[_0x2a6b('0xb')](_0x2a6b('0x24'),_0x4e5683,_0x4f32e0,_0x2a6b('0x25')));}else{_0x35c7af=path['join'](_0x20fbaa,util[_0x2a6b('0xb')]('%s.%s',_0x4e5683,_0x2a6b('0x25')));}fs['writeFileSync'](_0x35c7af,csv(_0x3f655c));}})[_0x2a6b('0x11')](function(){if(_0x3a8efa){return new Promise(function(_0xfb0eb8){zipdir(path['join'](_0x20fbaa,_0x4e5683),{'saveTo':path['join'](_0x20fbaa,util[_0x2a6b('0xb')]('%s.%s',_0x4e5683,_0x2a6b('0x26')))},function(_0x597d67,_0x5ff74d){rimraf(path[_0x2a6b('0x21')](_0x20fbaa,_0x4e5683),function(){});_0xfb0eb8(_0x2a6b('0x27'));});});}})[_0x2a6b('0x11')](function(){logger[_0x2a6b('0xa')](util[_0x2a6b('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x2a6b('0x28')));return analyticExtractedReport(_0x2a6b('0x29'),_0x3a8efa?util['format']('%s.%s',_0x4e5683,_0x3a8efa?_0x2a6b('0x26'):_0x2a6b('0x25')):null);});})[_0x2a6b('0x2a')](function(_0x4280f3){logger[_0x2a6b('0xa')](util[_0x2a6b('0xb')](_0x2a6b('0x2b'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x4280f3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2a6b('0x2c'));})['finally'](function(){process[_0x2a6b('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 387795d..1a8f39b 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0028=['PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','value','fill','length','auto','body','push','concat','chunk','keys','forEach','startDate','format','endDate','header','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','join','mkdirSync','flatten','createPdfKitDocument','%s.%s','pdf','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed'];(function(_0x34e4a0,_0x1fd446){var _0x3ead3e=function(_0x47adec){while(--_0x47adec){_0x34e4a0['push'](_0x34e4a0['shift']());}};_0x3ead3e(++_0x1fd446);}(_0x0028,0xd7));var _0x8002=function(_0x2a8841,_0x355633){_0x2a8841=_0x2a8841-0x0;var _0x164f64=_0x0028[_0x2a8841];return _0x164f64;};'use strict';var _=require(_0x8002('0x0'));var fs=require('fs');var util=require(_0x8002('0x1'));var path=require(_0x8002('0x2'));var moment=require(_0x8002('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x8002('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x8002('0x5'));var JSDOM=require(_0x8002('0x6'))[_0x8002('0x7')];var window=new JSDOM('')[_0x8002('0x8')];var BPromise=require(_0x8002('0x9'));var db=require(_0x8002('0xa'))['db'];var dbH=require(_0x8002('0xa'))[_0x8002('0xb')];var logger=require(_0x8002('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x8002('0xd')][0x2]);var QUERY=process[_0x8002('0xd')][0x3];var PATH=process[_0x8002('0xd')][0x4];var NAME=process[_0x8002('0xd')][0x5];var FORMAT=_0x8002('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x297eb4,_0x57f315){var _0x5175f3={'status':_0x297eb4};var _0x1c9fd3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x57f315){_0x5175f3[_0x8002('0xf')]=_0x57f315;}return db[_0x8002('0x10')][_0x8002('0x11')](_0x5175f3,_0x1c9fd3);}function getHeaders(_0xb0d7ce){return _['map'](_0xb0d7ce,function(_0x59f304){return{'text':_0x59f304,'style':_0x8002('0x12')};});}function getRows(_0x411fc7,_0x5a6101){return _[_0x8002('0x13')](_0x5a6101,function(_0x3e744c){return _(_0x3e744c)[_0x8002('0x14')](_0x411fc7)[_0x8002('0x13')](function(_0x34056f){return _0x34056f?_[_0x8002('0x15')](_0x34056f):'';})[_0x8002('0x16')]();});}function createTable(_0x2e07ef,_0x32461d){var _0x157e93={'widths':_[_0x8002('0x17')](Array(_0x2e07ef[_0x8002('0x18')]),0x91),'heights':function(_0x343be9){return _0x343be9===0x0?_0x8002('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x45eaaa=getHeaders(_0x2e07ef);_0x157e93[_0x8002('0x1a')][_0x8002('0x1b')](_0x45eaaa);var _0x52a6a8=getRows(_0x2e07ef,_0x32461d);_0x157e93[_0x8002('0x1a')]=_0x157e93[_0x8002('0x1a')][_0x8002('0x1c')](_0x52a6a8);return _0x157e93;}function createTables(_0x56d5f5){var _0x4225bf=[];var _0x19a937=_[_0x8002('0x1d')](Object[_0x8002('0x1e')](_0x56d5f5[0x0]),0x5);_0x19a937[_0x8002('0x1f')](function(_0x69e64f){_0x4225bf[_0x8002('0x1b')](createTable(_0x69e64f,_0x56d5f5));});return _0x4225bf;}function getPDFDocDefinition(_0x5c1579){var _0x2ab4bc=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x8002('0x20')])[_0x8002('0x21')](FORMAT),moment(EXTRACTED_REPORT[_0x8002('0x22')])[_0x8002('0x21')](FORMAT));var _0x410eb6=[];for(var _0x5cc4e5=0x0;_0x5cc4e5<_0x5c1579['length'];_0x5cc4e5++){var _0x496c48=[];if(_0x5cc4e5===0x0){_0x496c48[_0x8002('0x1b')]({'text':_0x2ab4bc,'style':_0x8002('0x23')});}var _0x156326={'table':_0x5c1579[_0x5cc4e5]};if(_0x5cc4e5>0x0){_0x156326['pageBreak']=_0x8002('0x24');_0x156326[_0x8002('0x25')]=[0x0,0x46,0x0,0x0];}_0x496c48[_0x8002('0x1b')](_0x156326);_0x410eb6[_0x8002('0x1b')](_0x496c48);}return{'pageSize':'A4','pageOrientation':_0x8002('0x26'),'content':_0x410eb6,'footer':function(_0x4a9154,_0x25df9d){return{'text':_0x4a9154[_0x8002('0x15')]()+_0x8002('0x27')+_0x25df9d,'style':_0x8002('0x28')};},'defaultStyle':{'font':_0x8002('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8002('0x2a')},'footer':{'alignment':_0x8002('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2442cb){var _0x4aca4f=0x1388;var _0x263206;if(!_0x2442cb[0x0][_0x8002('0x2c')]){return analyticExtractedReport(_0x8002('0x2d'));}return db[_0x8002('0x2e')][_0x8002('0x2f')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8002('0x30'),_0x8002('0x31')]})[_0x8002('0x32')](function(_0x17618c){if(_0x17618c){_0x263206=_0x17618c;_0x4aca4f=_0x263206[_0x8002('0x31')]||0x3e8;}})[_0x8002('0x32')](function(){var _0x259a50=[];var _0x5ea5cd=0x0;if(_0x263206[_0x8002('0x30')]){if(_0x2442cb&&_0x2442cb['length']){var _0x2b8c28=_['range'](_0x2442cb[0x0]['num']/_0x4aca4f);var _0x18f22b=Number[_0x8002('0x33')](_0x2442cb[0x0][_0x8002('0x2c')]/_0x4aca4f)?_0x2442cb[0x0][_0x8002('0x2c')]%_0x4aca4f:0x0;_0x2b8c28['forEach'](function(_0x5ea1be){if(_0x5ea1be>0x0){_0x5ea5cd+=_0x4aca4f;}_0x259a50[_0x8002('0x1b')](dbH[_0x8002('0x34')][_0x8002('0x35')](util[_0x8002('0x21')](_0x8002('0x36'),QUERY,_0x4aca4f,_0x5ea5cd),{'type':dbH[_0x8002('0x34')][_0x8002('0x37')][_0x8002('0x38')]}));});if(_0x18f22b>0x0){_0x5ea5cd+=_0x4aca4f;_0x259a50[_0x8002('0x1b')](dbH['sequelize']['query'](util[_0x8002('0x21')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x18f22b,_0x5ea5cd),{'type':dbH['sequelize'][_0x8002('0x37')][_0x8002('0x38')]}));}}}else{_0x259a50[_0x8002('0x1b')](dbH[_0x8002('0x34')]['query'](QUERY,{'type':dbH[_0x8002('0x34')][_0x8002('0x37')][_0x8002('0x38')]}));}var _0x2c620e=path[_0x8002('0x39')](PATH);var _0x4cc05f=path[_0x8002('0x3a')](PATH,'.pdf');var _0x35c256=_0x263206[_0x8002('0x30')]&&_0x259a50['length']>0x1;var _0x3f80a9=[];if(!fs['existsSync'](path[_0x8002('0x3b')](_0x2c620e,_0x4cc05f))&&_0x35c256){fs[_0x8002('0x3c')](path['join'](_0x2c620e,_0x4cc05f));}return BPromise['each'](_0x259a50,function(_0x1de65c){_0x3f80a9[_0x8002('0x1b')](_0x1de65c);})['then'](function(){var _0x407ebb=[];for(var _0xd778ec=0x0;_0xd778ec<_0x3f80a9[_0x8002('0x18')];_0xd778ec+=0x1){var _0x307cd7=_0x3f80a9[_0xd778ec];var _0x540ac6=createTables(_[_0x8002('0x3d')](_0x307cd7));var _0xbe1c15;var _0x375159=getPDFDocDefinition(_0x540ac6);var _0x3cb882=getPDFPrinter();var _0x80badc=_0x3cb882[_0x8002('0x3e')](_0x375159);if(_0x35c256){_0xbe1c15=path[_0x8002('0x3b')](_0x2c620e,_0x4cc05f,util[_0x8002('0x21')]('%s%d.%s',_0x4cc05f,_0xd778ec,'pdf'));}else{_0xbe1c15=path[_0x8002('0x3b')](_0x2c620e,util['format'](_0x8002('0x3f'),_0x4cc05f,_0x8002('0x40')));}_0x407ebb[_0x8002('0x1b')](writePDFDocument(_0x80badc,_0xbe1c15));}return Promise[_0x8002('0x41')](_0x407ebb);})[_0x8002('0x32')](function(){if(_0x35c256){return new Promise(function(_0x380606){zipdir(path[_0x8002('0x3b')](_0x2c620e,_0x4cc05f),{'saveTo':path[_0x8002('0x3b')](_0x2c620e,util[_0x8002('0x21')](_0x8002('0x3f'),_0x4cc05f,_0x8002('0x42')))},function(){rimraf(path[_0x8002('0x3b')](_0x2c620e,_0x4cc05f),function(){});_0x380606(_0x8002('0x43'));});});}})[_0x8002('0x32')](function(){if(!_0x35c256)return;rimraf(path['join'](_0x2c620e,_0x4cc05f),function(){});})['then'](function(){logger[_0x8002('0x44')](util[_0x8002('0x21')](_0x8002('0x45'),EXTRACTED_REPORT_ID,_0x8002('0x46')));return analyticExtractedReport(_0x8002('0x47'),_0x35c256?util[_0x8002('0x21')](_0x8002('0x3f'),_0x4cc05f,_0x35c256?_0x8002('0x42'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8002('0x46')));return db[_0x8002('0x10')][_0x8002('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8002('0x32')](function(_0x2b5cec){EXTRACTED_REPORT=_0x2b5cec;return dbH['sequelize'][_0x8002('0x35')](util[_0x8002('0x21')](_0x8002('0x49'),QUERY),{'type':dbH[_0x8002('0x34')][_0x8002('0x37')][_0x8002('0x38')]});})['then'](extractReport)[_0x8002('0x4a')](function(_0x4e06e2){logger[_0x8002('0x44')](util[_0x8002('0x21')](_0x8002('0x4b'),EXTRACTED_REPORT_ID,_0x8002('0x46')),util[_0x8002('0x4c')](_0x4e06e2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8002('0x4d'));})[_0x8002('0x4e')](function(){process[_0x8002('0x4f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x314036=new PdfPrinter({'Arial':{'normal':__dirname+_0x8002('0x50'),'bold':__dirname+_0x8002('0x51'),'italics':__dirname+_0x8002('0x52'),'bolditalics':__dirname+_0x8002('0x53')}});return _0x314036;}function getPDFDocDefinitionFromHTML(_0x35d92c,_0x238a60){var _0x44a36d=util['format'](_0x8002('0x54'),_0x238a60[_0x8002('0x55')],_0x238a60['interactionId']);var _0x5b6d2a=moment()[_0x8002('0x21')](_0x8002('0x56'))[_0x8002('0x15')]();var _0x111535=htmlToPdfmake(_0x35d92c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x111535],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8002('0x57'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8002('0x57'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x8002('0x58'),'style':_0x8002('0x23')}];},'footer':function(_0x319ff6,_0x649467){return[{'text':util[_0x8002('0x21')](_0x8002('0x59'),_0x44a36d,_0x319ff6,_0x649467,_0x5b6d2a),'style':'footer'}];}};}function writePDFDocument(_0xef6315,_0x5b1b55){return new Promise(function(_0x50c1dd,_0xf9b5dd){var _0x1ce440=_0xef6315['pipe'](fs[_0x8002('0x5a')](_0x5b1b55));_0x1ce440['on'](_0x8002('0x5b'),function(){_0x50c1dd(_0x8002('0x5b'));});_0x1ce440['on'](_0x8002('0x5c'),function(_0x32ea56){_0xf9b5dd(_0x32ea56);});_0xef6315[_0x8002('0x5d')]();});}exports[_0x8002('0x5e')]=function(_0x2744a0,_0x40ed91){var _0x3f5a0b=getPDFPrinter();var _0x24b69e=getPDFDocDefinitionFromHTML(_0x2744a0,_0x40ed91);var _0x3d0934=_0x3f5a0b[_0x8002('0x3e')](_0x24b69e);return writePDFDocument(_0x3d0934,_0x40ed91[_0x8002('0x2')])[_0x8002('0x4a')](function(_0x3ffc2d){throw _0x3ffc2d;});}; \ No newline at end of file +var _0xf063=['inspect','finally','exit','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','createPdfFromHTML','createPdfKitDocument','lodash','path','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','fill','length','auto','push','body','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','landscape','toString','\x20/\x20','Arial','black','right','Setting','find','split','splitSizePdf','then','range','num','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','QueryTypes','dirname','basename','.pdf','existsSync','join','mkdirSync','each','pdf','%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0xf063,0xc0));var _0x3f06=function(_0x40c9a5,_0x254d8d){_0x40c9a5=_0x40c9a5-0x0;var _0x48413e=_0xf063[_0x40c9a5];return _0x48413e;};'use strict';var _=require(_0x3f06('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x3f06('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x3f06('0x2'));var PdfPrinter=require(_0x3f06('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x3f06('0x4'));var JSDOM=require(_0x3f06('0x5'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x3f06('0x6'));var db=require(_0x3f06('0x7'))['db'];var dbH=require(_0x3f06('0x7'))[_0x3f06('0x8')];var logger=require(_0x3f06('0x9'))(_0x3f06('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x3f06('0xb')][0x2]);var QUERY=process[_0x3f06('0xb')][0x3];var PATH=process[_0x3f06('0xb')][0x4];var NAME=process[_0x3f06('0xb')][0x5];var FORMAT=_0x3f06('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xac12bc,_0x3a69d1){var _0x5d7643={'status':_0xac12bc};var _0x4aec21={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a69d1){_0x5d7643[_0x3f06('0xd')]=_0x3a69d1;}return db[_0x3f06('0xe')][_0x3f06('0xf')](_0x5d7643,_0x4aec21);}function getHeaders(_0x351cd6){return _['map'](_0x351cd6,function(_0x1f040d){return{'text':_0x1f040d,'style':'tableHeader'};});}function getRows(_0x416f96,_0x3618f4){return _[_0x3f06('0x10')](_0x3618f4,function(_0x22d603){return _(_0x22d603)[_0x3f06('0x11')](_0x416f96)[_0x3f06('0x10')](function(_0x4d1bec){return _0x4d1bec?_['toString'](_0x4d1bec):'';})['value']();});}function createTable(_0x3da4b5,_0x5b4c7b){var _0x5a9e7c={'widths':_[_0x3f06('0x12')](Array(_0x3da4b5[_0x3f06('0x13')]),0x91),'heights':function(_0x5a8b55){return _0x5a8b55===0x0?_0x3f06('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x300091=getHeaders(_0x3da4b5);_0x5a9e7c['body'][_0x3f06('0x15')](_0x300091);var _0x4e0941=getRows(_0x3da4b5,_0x5b4c7b);_0x5a9e7c['body']=_0x5a9e7c[_0x3f06('0x16')]['concat'](_0x4e0941);return _0x5a9e7c;}function createTables(_0x16edef){var _0x160b21=[];var _0x56de0b=_[_0x3f06('0x17')](Object[_0x3f06('0x18')](_0x16edef[0x0]),0x5);_0x56de0b[_0x3f06('0x19')](function(_0x1d9c11){_0x160b21[_0x3f06('0x15')](createTable(_0x1d9c11,_0x16edef));});return _0x160b21;}function getPDFDocDefinition(_0x11bf79){var _0x3d65af=util[_0x3f06('0x1a')](_0x3f06('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x3f06('0x1c')])[_0x3f06('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x3f06('0x1d')])[_0x3f06('0x1a')](FORMAT));var _0x3dcffb=[];for(var _0x1c03eb=0x0;_0x1c03eb<_0x11bf79[_0x3f06('0x13')];_0x1c03eb++){var _0x3fdba3=[];if(_0x1c03eb===0x0){_0x3fdba3[_0x3f06('0x15')]({'text':_0x3d65af,'style':_0x3f06('0x1e')});}var _0x55f3af={'table':_0x11bf79[_0x1c03eb]};if(_0x1c03eb>0x0){_0x55f3af[_0x3f06('0x1f')]=_0x3f06('0x20');_0x55f3af['margin']=[0x0,0x46,0x0,0x0];}_0x3fdba3['push'](_0x55f3af);_0x3dcffb[_0x3f06('0x15')](_0x3fdba3);}return{'pageSize':'A4','pageOrientation':_0x3f06('0x21'),'content':_0x3dcffb,'footer':function(_0xae6b01,_0x6a32ff){return{'text':_0xae6b01[_0x3f06('0x22')]()+_0x3f06('0x23')+_0x6a32ff,'style':'footer'};},'defaultStyle':{'font':_0x3f06('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3f06('0x25')},'footer':{'alignment':_0x3f06('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x464638){var _0x342905=0x1388;var _0xef1181;if(!_0x464638[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0x3f06('0x27')][_0x3f06('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3f06('0x29'),_0x3f06('0x2a')]})[_0x3f06('0x2b')](function(_0x246d91){if(_0x246d91){_0xef1181=_0x246d91;_0x342905=_0xef1181[_0x3f06('0x2a')]||0x3e8;}})[_0x3f06('0x2b')](function(){var _0x587a60=[];var _0x5e68ca=0x0;if(_0xef1181[_0x3f06('0x29')]){if(_0x464638&&_0x464638[_0x3f06('0x13')]){var _0x19dcfd=_[_0x3f06('0x2c')](_0x464638[0x0][_0x3f06('0x2d')]/_0x342905);var _0x1f86b1=Number[_0x3f06('0x2e')](_0x464638[0x0][_0x3f06('0x2d')]/_0x342905)?_0x464638[0x0][_0x3f06('0x2d')]%_0x342905:0x0;_0x19dcfd[_0x3f06('0x19')](function(_0x31cdba){if(_0x31cdba>0x0){_0x5e68ca+=_0x342905;}_0x587a60['push'](dbH[_0x3f06('0x2f')]['query'](util[_0x3f06('0x1a')](_0x3f06('0x30'),QUERY,_0x342905,_0x5e68ca),{'type':dbH[_0x3f06('0x2f')]['QueryTypes'][_0x3f06('0x31')]}));});if(_0x1f86b1>0x0){_0x5e68ca+=_0x342905;_0x587a60[_0x3f06('0x15')](dbH['sequelize'][_0x3f06('0x32')](util['format'](_0x3f06('0x30'),QUERY,_0x1f86b1,_0x5e68ca),{'type':dbH[_0x3f06('0x2f')][_0x3f06('0x33')][_0x3f06('0x31')]}));}}}else{_0x587a60['push'](dbH['sequelize'][_0x3f06('0x32')](QUERY,{'type':dbH[_0x3f06('0x2f')]['QueryTypes'][_0x3f06('0x31')]}));}var _0x8b2a5=path[_0x3f06('0x34')](PATH);var _0x4f2f09=path[_0x3f06('0x35')](PATH,_0x3f06('0x36'));var _0x30accc=_0xef1181[_0x3f06('0x29')]&&_0x587a60[_0x3f06('0x13')]>0x1;var _0x418b03=[];if(!fs[_0x3f06('0x37')](path[_0x3f06('0x38')](_0x8b2a5,_0x4f2f09))&&_0x30accc){fs[_0x3f06('0x39')](path[_0x3f06('0x38')](_0x8b2a5,_0x4f2f09));}return BPromise[_0x3f06('0x3a')](_0x587a60,function(_0xad929d){_0x418b03['push'](_0xad929d);})[_0x3f06('0x2b')](function(){var _0x55bbff=[];for(var _0x45b4e4=0x0;_0x45b4e4<_0x418b03[_0x3f06('0x13')];_0x45b4e4+=0x1){var _0x3057fd=_0x418b03[_0x45b4e4];var _0x1f5917=createTables(_['flatten'](_0x3057fd));var _0xf6bbaf;var _0x31af3e=getPDFDocDefinition(_0x1f5917);var _0x3e78c3=getPDFPrinter();var _0x3ee48f=_0x3e78c3['createPdfKitDocument'](_0x31af3e);if(_0x30accc){_0xf6bbaf=path['join'](_0x8b2a5,_0x4f2f09,util[_0x3f06('0x1a')]('%s%d.%s',_0x4f2f09,_0x45b4e4,_0x3f06('0x3b')));}else{_0xf6bbaf=path[_0x3f06('0x38')](_0x8b2a5,util[_0x3f06('0x1a')](_0x3f06('0x3c'),_0x4f2f09,_0x3f06('0x3b')));}_0x55bbff['push'](writePDFDocument(_0x3ee48f,_0xf6bbaf));}return Promise['all'](_0x55bbff);})['then'](function(){if(_0x30accc){return new Promise(function(_0x2fab3b){zipdir(path[_0x3f06('0x38')](_0x8b2a5,_0x4f2f09),{'saveTo':path[_0x3f06('0x38')](_0x8b2a5,util[_0x3f06('0x1a')](_0x3f06('0x3c'),_0x4f2f09,'zip'))},function(){rimraf(path[_0x3f06('0x38')](_0x8b2a5,_0x4f2f09),function(){});_0x2fab3b('zip\x20finished');});});}})['then'](function(){if(!_0x30accc)return;rimraf(path[_0x3f06('0x38')](_0x8b2a5,_0x4f2f09),function(){});})[_0x3f06('0x2b')](function(){logger[_0x3f06('0x3d')](util[_0x3f06('0x1a')](_0x3f06('0x3e'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x3f06('0x3f'),_0x30accc?util[_0x3f06('0x1a')](_0x3f06('0x3c'),_0x4f2f09,_0x30accc?_0x3f06('0x40'):_0x3f06('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3f06('0x3d')](util[_0x3f06('0x1a')](_0x3f06('0x41'),EXTRACTED_REPORT_ID,_0x3f06('0x42')));return db[_0x3f06('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3f06('0x2b')](function(_0x3e40d8){EXTRACTED_REPORT=_0x3e40d8;return dbH[_0x3f06('0x2f')]['query'](util[_0x3f06('0x1a')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3f06('0x2f')][_0x3f06('0x33')][_0x3f06('0x31')]});})['then'](extractReport)[_0x3f06('0x43')](function(_0x4b0dc2){logger[_0x3f06('0x3d')](util['format'](_0x3f06('0x44'),EXTRACTED_REPORT_ID,_0x3f06('0x42')),util[_0x3f06('0x45')](_0x4b0dc2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x3f06('0x46')](function(){process[_0x3f06('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x760376=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x3f06('0x48'),'bolditalics':__dirname+_0x3f06('0x49')}});return _0x760376;}function getPDFDocDefinitionFromHTML(_0x1a228b,_0x519a48){var _0x5c1400=util['format'](_0x3f06('0x4a'),_0x519a48[_0x3f06('0x4b')],_0x519a48[_0x3f06('0x4c')]);var _0x410379=moment()[_0x3f06('0x1a')](_0x3f06('0x4d'))[_0x3f06('0x22')]();var _0x5d45fb=htmlToPdfmake(_0x1a228b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5d45fb],'defaultStyle':{'font':_0x3f06('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3f06('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x3f06('0x1e')}];},'footer':function(_0x85d95d,_0x53b668){return[{'text':util['format'](_0x3f06('0x4f'),_0x5c1400,_0x85d95d,_0x53b668,_0x410379),'style':_0x3f06('0x50')}];}};}function writePDFDocument(_0x548c38,_0x245eb4){return new Promise(function(_0x538001,_0x2a8b2d){var _0x3eedc8=_0x548c38[_0x3f06('0x51')](fs[_0x3f06('0x52')](_0x245eb4));_0x3eedc8['on'](_0x3f06('0x53'),function(){_0x538001('finish');});_0x3eedc8['on'](_0x3f06('0x54'),function(_0x1a1a05){_0x2a8b2d(_0x1a1a05);});_0x548c38['end']();});}exports[_0x3f06('0x55')]=function(_0x10481e,_0x282723){var _0x10dd27=getPDFPrinter();var _0x28e13b=getPDFDocDefinitionFromHTML(_0x10481e,_0x282723);var _0x184754=_0x10dd27[_0x3f06('0x56')](_0x28e13b);return writePDFDocument(_0x184754,_0x282723[_0x3f06('0x1')])[_0x3f06('0x43')](function(_0x327755){throw _0x327755;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 159d28c..bf7db81 100644 --- a/server/components/export/xlsx.js +++ b/server/components/export/xlsx.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d18=['%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','length','existsSync','mkdirSync','each','join','%s%d.%s','%s.%s','xlsx','writeFileSync','zip\x20finished','zip','inspect','finally','exit','util','path','lodash','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','query','sequelize','QueryTypes','SELECT','num','Empty','range','isInteger','forEach','push'];(function(_0x34cf11,_0x4f8828){var _0x1c82c8=function(_0x2897e9){while(--_0x2897e9){_0x34cf11['push'](_0x34cf11['shift']());}};_0x1c82c8(++_0x4f8828);}(_0x2d18,0xd5));var _0x82d1=function(_0x47e633,_0xeec4b4){_0x47e633=_0x47e633-0x0;var _0x1e4f34=_0x2d18[_0x47e633];return _0x1e4f34;};'use strict';var util=require(_0x82d1('0x0'));var path=require(_0x82d1('0x1'));var _=require(_0x82d1('0x2'));var fs=require('fs');var json2xls=require(_0x82d1('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x82d1('0x4'));var db=require(_0x82d1('0x5'))['db'];var dbH=require(_0x82d1('0x5'))[_0x82d1('0x6')];var logger=require(_0x82d1('0x7'))(_0x82d1('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x82d1('0x9')][0x2]);var QUERY=process[_0x82d1('0x9')][0x3];var PATH=process[_0x82d1('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x53e120,_0x5b8f24){var _0x2d5eca={'status':_0x53e120};var _0x8fb9b2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5b8f24){_0x2d5eca[_0x82d1('0xa')]=_0x5b8f24;}return db[_0x82d1('0xb')][_0x82d1('0xc')](_0x2d5eca,_0x8fb9b2);}function main(){var _0x4b83bb=0x1388;var _0x26a5a1;logger[_0x82d1('0xd')](util[_0x82d1('0xe')](_0x82d1('0xf'),EXTRACTED_REPORT_ID,_0x82d1('0x10')));return db[_0x82d1('0x11')][_0x82d1('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x82d1('0x13'),_0x82d1('0x14')]})[_0x82d1('0x15')](function(_0xecea25){if(_0xecea25){_0x26a5a1=_0xecea25;_0x4b83bb=_0x26a5a1[_0x82d1('0x14')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x82d1('0x16')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x82d1('0x17')][_0x82d1('0x18')][_0x82d1('0x19')]});})['then'](function(_0x3bdf41){if(!_0x3bdf41[0x0][_0x82d1('0x1a')]){return analyticExtractedReport(_0x82d1('0x1b'));}var _0x27e4ba=[];var _0x59ca13=0x0;if(_0x26a5a1['split']){if(_0x3bdf41&&_0x3bdf41['length']){var _0x2b49e4=_[_0x82d1('0x1c')](_0x3bdf41[0x0][_0x82d1('0x1a')]/_0x4b83bb);var _0x1aca17=Number[_0x82d1('0x1d')](_0x3bdf41[0x0][_0x82d1('0x1a')]/_0x4b83bb)?_0x3bdf41[0x0][_0x82d1('0x1a')]%_0x4b83bb:0x0;_0x2b49e4[_0x82d1('0x1e')](function(_0x3c81){if(_0x3c81>0x0){_0x59ca13+=_0x4b83bb;}_0x27e4ba[_0x82d1('0x1f')](dbH[_0x82d1('0x17')][_0x82d1('0x16')](util[_0x82d1('0xe')](_0x82d1('0x20'),QUERY,_0x4b83bb,_0x59ca13),{'type':dbH['sequelize'][_0x82d1('0x18')][_0x82d1('0x19')]}));});if(_0x1aca17>0x0){_0x59ca13+=_0x4b83bb;_0x27e4ba['push'](dbH[_0x82d1('0x17')][_0x82d1('0x16')](util[_0x82d1('0xe')](_0x82d1('0x20'),QUERY,_0x1aca17,_0x59ca13),{'type':dbH[_0x82d1('0x17')]['QueryTypes'][_0x82d1('0x19')]}));}}}else{_0x27e4ba[_0x82d1('0x1f')](dbH['sequelize'][_0x82d1('0x16')](QUERY,{'type':dbH[_0x82d1('0x17')][_0x82d1('0x18')][_0x82d1('0x19')]}));}var _0x35273a=path['dirname'](PATH);var _0x22dec9=path[_0x82d1('0x21')](PATH,_0x82d1('0x22'));var _0x1ab05c=_0x26a5a1[_0x82d1('0x13')]&&_0x27e4ba[_0x82d1('0x23')]>0x1;var _0x5f2abd=[];if(!fs[_0x82d1('0x24')](path['join'](_0x35273a,_0x22dec9))&&_0x1ab05c){fs[_0x82d1('0x25')](path['join'](_0x35273a,_0x22dec9));}return BPromise[_0x82d1('0x26')](_0x27e4ba,function(_0x73481e){_0x5f2abd[_0x82d1('0x1f')](_0x73481e);})[_0x82d1('0x15')](function(){for(var _0x25481d=0x0;_0x25481d<_0x5f2abd[_0x82d1('0x23')];_0x25481d+=0x1){var _0x4e49d4;var _0x14e3b3=_0x5f2abd[_0x25481d];if(_0x1ab05c){_0x4e49d4=path[_0x82d1('0x27')](_0x35273a,_0x22dec9,util[_0x82d1('0xe')](_0x82d1('0x28'),_0x22dec9,_0x25481d,'xlsx'));}else{_0x4e49d4=path['join'](_0x35273a,util[_0x82d1('0xe')](_0x82d1('0x29'),_0x22dec9,_0x82d1('0x2a')));}fs[_0x82d1('0x2b')](_0x4e49d4,json2xls(_0x14e3b3),'binary');}})['then'](function(){if(_0x1ab05c){return new Promise(function(_0x10455a){zipdir(path[_0x82d1('0x27')](_0x35273a,_0x22dec9),{'saveTo':path[_0x82d1('0x27')](_0x35273a,util[_0x82d1('0xe')](_0x82d1('0x29'),_0x22dec9,'zip'))},function(_0x553457,_0x26f468){rimraf(path['join'](_0x35273a,_0x22dec9),function(){});_0x10455a(_0x82d1('0x2c'));});});}})[_0x82d1('0x15')](function(){logger[_0x82d1('0xd')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x82d1('0x10')));return analyticExtractedReport('Completed',_0x1ab05c?util[_0x82d1('0xe')](_0x82d1('0x29'),_0x22dec9,_0x1ab05c?_0x82d1('0x2d'):_0x82d1('0x2a')):null);});})['catch'](function(_0x485260){logger[_0x82d1('0xd')](util[_0x82d1('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x82d1('0x10')),util[_0x82d1('0x2e')](_0x485260,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x82d1('0x2f')](function(){process[_0x82d1('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4809=['xlsx','%s.%s','binary','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','path','lodash','json2xls','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s'];(function(_0x5d439b,_0x20a697){var _0x3699d6=function(_0x1d683f){while(--_0x1d683f){_0x5d439b['push'](_0x5d439b['shift']());}};_0x3699d6(++_0x20a697);}(_0x4809,0x1e0));var _0x9480=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0x4809[_0x57d13b];return _0x467696;};'use strict';var util=require(_0x9480('0x0'));var path=require(_0x9480('0x1'));var _=require(_0x9480('0x2'));var fs=require('fs');var json2xls=require(_0x9480('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x9480('0x4'));var db=require(_0x9480('0x5'))['db'];var dbH=require('../../mysqldb')[_0x9480('0x6')];var logger=require('../../config/logger')(_0x9480('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9480('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x184f72,_0x3820ef){var _0x208960={'status':_0x184f72};var _0x1db5d7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3820ef){_0x208960[_0x9480('0x9')]=_0x3820ef;}return db[_0x9480('0xa')][_0x9480('0xb')](_0x208960,_0x1db5d7);}function main(){var _0x5e7541=0x1388;var _0x37345b;logger['info'](util['format'](_0x9480('0xc'),EXTRACTED_REPORT_ID,_0x9480('0xd')));return db[_0x9480('0xe')][_0x9480('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9480('0x10'),'splitSizeXlsx']})[_0x9480('0x11')](function(_0x5717da){if(_0x5717da){_0x37345b=_0x5717da;_0x5e7541=_0x37345b[_0x9480('0x12')]||0x1388;}})[_0x9480('0x11')](function(){return dbH[_0x9480('0x13')]['query'](util[_0x9480('0x14')](_0x9480('0x15'),QUERY),{'type':dbH[_0x9480('0x13')][_0x9480('0x16')][_0x9480('0x17')]});})[_0x9480('0x11')](function(_0x45598a){if(!_0x45598a[0x0][_0x9480('0x18')]){return analyticExtractedReport(_0x9480('0x19'));}var _0xfbd0c4=[];var _0x28c6a2=0x0;if(_0x37345b[_0x9480('0x10')]){if(_0x45598a&&_0x45598a[_0x9480('0x1a')]){var _0x59fc88=_['range'](_0x45598a[0x0][_0x9480('0x18')]/_0x5e7541);var _0x40a6a9=Number[_0x9480('0x1b')](_0x45598a[0x0][_0x9480('0x18')]/_0x5e7541)?_0x45598a[0x0][_0x9480('0x18')]%_0x5e7541:0x0;_0x59fc88[_0x9480('0x1c')](function(_0x5026b9){if(_0x5026b9>0x0){_0x28c6a2+=_0x5e7541;}_0xfbd0c4[_0x9480('0x1d')](dbH[_0x9480('0x13')][_0x9480('0x1e')](util['format'](_0x9480('0x1f'),QUERY,_0x5e7541,_0x28c6a2),{'type':dbH[_0x9480('0x13')]['QueryTypes'][_0x9480('0x17')]}));});if(_0x40a6a9>0x0){_0x28c6a2+=_0x5e7541;_0xfbd0c4[_0x9480('0x1d')](dbH[_0x9480('0x13')][_0x9480('0x1e')](util[_0x9480('0x14')](_0x9480('0x1f'),QUERY,_0x40a6a9,_0x28c6a2),{'type':dbH['sequelize'][_0x9480('0x16')][_0x9480('0x17')]}));}}}else{_0xfbd0c4['push'](dbH[_0x9480('0x13')][_0x9480('0x1e')](QUERY,{'type':dbH[_0x9480('0x13')][_0x9480('0x16')][_0x9480('0x17')]}));}var _0xc5bc4=path[_0x9480('0x20')](PATH);var _0x4cd421=path[_0x9480('0x21')](PATH,_0x9480('0x22'));var _0x148321=_0x37345b[_0x9480('0x10')]&&_0xfbd0c4['length']>0x1;var _0x554f19=[];if(!fs[_0x9480('0x23')](path[_0x9480('0x24')](_0xc5bc4,_0x4cd421))&&_0x148321){fs[_0x9480('0x25')](path[_0x9480('0x24')](_0xc5bc4,_0x4cd421));}return BPromise[_0x9480('0x26')](_0xfbd0c4,function(_0x491b67){_0x554f19[_0x9480('0x1d')](_0x491b67);})[_0x9480('0x11')](function(){for(var _0x2d2ff8=0x0;_0x2d2ff8<_0x554f19[_0x9480('0x1a')];_0x2d2ff8+=0x1){var _0x5bf7f0;var _0x2bb43a=_0x554f19[_0x2d2ff8];if(_0x148321){_0x5bf7f0=path[_0x9480('0x24')](_0xc5bc4,_0x4cd421,util[_0x9480('0x14')](_0x9480('0x27'),_0x4cd421,_0x2d2ff8,_0x9480('0x28')));}else{_0x5bf7f0=path[_0x9480('0x24')](_0xc5bc4,util[_0x9480('0x14')](_0x9480('0x29'),_0x4cd421,_0x9480('0x28')));}fs['writeFileSync'](_0x5bf7f0,json2xls(_0x2bb43a),_0x9480('0x2a'));}})[_0x9480('0x11')](function(){if(_0x148321){return new Promise(function(_0x347935){zipdir(path[_0x9480('0x24')](_0xc5bc4,_0x4cd421),{'saveTo':path[_0x9480('0x24')](_0xc5bc4,util[_0x9480('0x14')](_0x9480('0x29'),_0x4cd421,'zip'))},function(_0x4314c6,_0x15bd5e){rimraf(path['join'](_0xc5bc4,_0x4cd421),function(){});_0x347935(_0x9480('0x2b'));});});}})['then'](function(){logger[_0x9480('0x2c')](util[_0x9480('0x14')](_0x9480('0x2d'),EXTRACTED_REPORT_ID,_0x9480('0xd')));return analyticExtractedReport(_0x9480('0x2e'),_0x148321?util[_0x9480('0x14')](_0x9480('0x29'),_0x4cd421,_0x148321?'zip':'xlsx'):null);});})[_0x9480('0x2f')](function(_0x3ae040){logger[_0x9480('0x2c')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9480('0xd')),util[_0x9480('0x30')](_0x3ae040,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9480('0x31'));})[_0x9480('0x32')](function(){process[_0x9480('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 434c561..340a540 100644 --- a/server/components/extensions/rewrite.js +++ b/server/components/extensions/rewrite.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ab1=['last','concat','Hangup','transaction','destroy','sortBy','error','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','filter','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','format','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','interval','tag','CDR(tag)=','callerID','ExecIf','answer','indexOf','app','toLowerCase','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},'];(function(_0x19d011,_0x5bd108){var _0x4c52e2=function(_0x4cc259){while(--_0x4cc259){_0x19d011['push'](_0x19d011['shift']());}};_0x4c52e2(++_0x5bd108);}(_0x2ab1,0x10b));var _0x12ab=function(_0x397c4c,_0x2cc1ba){_0x397c4c=_0x397c4c-0x0;var _0x164665=_0x2ab1[_0x397c4c];return _0x164665;};'use strict';var _=require('lodash');var util=require(_0x12ab('0x0'));function rewrite(_0x303560,_0x29ffb2){var _0x198a2a=this;return _0x303560[_0x12ab('0x1')][_0x12ab('0x2')][_0x12ab('0x3')]({'raw':!![]})[_0x12ab('0x4')](function(_0x3f794a){_0x198a2a[_0x12ab('0x5')]=_0x3f794a;return _0x303560[_0x12ab('0x1')][_0x12ab('0x6')][_0x12ab('0x3')]({'where':{'IntervalId':_0x29ffb2[_0x12ab('0x7')]},'raw':!![]});})['then'](function(_0x590ea7){return _0x303560['models']['VoiceExtension'][_0x12ab('0x3')]({'where':{'exten':{'$in':_[_0x12ab('0x8')](_[_0x12ab('0x9')](_0x590ea7,_0x12ab('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x12ab('0x4')](function(_0x5e89d7){var _0x5251dc=_[_0x12ab('0xb')](_0x5e89d7,{'priority':'1'});var _0x441a0a=_['filter'](_0x5e89d7,{'isApp':0x1});var _0x4fcbde=_['groupBy'](_0x441a0a,'exten');var _0x2a83ef=[_0x12ab('0xc'),_0x12ab('0xd')];var _0xd3b4bd=[];var _0x1cf77e=[];for(var _0x439399 in _0x4fcbde){if(_0x4fcbde[_0x12ab('0xe')](_0x439399)){_0x198a2a[_0x12ab('0xf')]=0x2;_0x198a2a[_0x12ab('0x10')]=[];_0x198a2a[_0x12ab('0x11')]=_[_0x12ab('0x12')](_0x5251dc,{'exten':_0x4fcbde[_0x439399][0x0][_0x12ab('0xa')]});_0x198a2a[_0x12ab('0x10')][_0x12ab('0x13')]({'type':_0x4fcbde[_0x439399][0x0]['type'],'app':_0x12ab('0x14'),'appdata':util[_0x12ab('0x15')]('CDR(type)=%s',_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')]),'context':_0x4fcbde[_0x439399][0x0][_0x12ab('0x17')],'exten':_0x4fcbde[_0x439399][0x0][_0x12ab('0xa')],'priority':_0x198a2a[_0x12ab('0xf')]++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});if(_0x4fcbde[_0x439399][0x0]['type']===_0x12ab('0x19')){_0x198a2a[_0x12ab('0x10')][_0x12ab('0x13')]({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':_0x12ab('0x14'),'appdata':_0x12ab('0x1a')+_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')],'context':_0x4fcbde[_0x439399][0x0][_0x12ab('0x17')],'exten':_0x4fcbde[_0x439399][0x0]['exten'],'priority':_0x198a2a[_0x12ab('0xf')]++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});}else if(_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')]===_0x12ab('0x1b')){if(_0x198a2a[_0x12ab('0x11')]){_0x198a2a[_0x12ab('0x10')][_0x12ab('0x13')]({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':_0x12ab('0x14'),'appdata':_0x12ab('0x1c')+(_0x198a2a[_0x12ab('0x11')][_0x12ab('0x1d')]?_0x12ab('0x1e')+_0x198a2a[_0x12ab('0x11')][_0x12ab('0x1d')]+'}':_0x12ab('0x1f')),'context':_0x4fcbde[_0x439399][0x0]['context'],'exten':_0x4fcbde[_0x439399][0x0]['exten'],'priority':_0x198a2a[_0x12ab('0xf')]++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0]['VoiceExtensionId']});}_0x198a2a[_0x12ab('0x10')][_0x12ab('0x13')]({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':_0x12ab('0x14'),'appdata':_0x12ab('0x1a')+_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')],'context':_0x4fcbde[_0x439399][0x0]['context'],'exten':_0x4fcbde[_0x439399][0x0]['exten'],'priority':_0x198a2a['priority']++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});var _0x4b14dc=_0x198a2a[_0x12ab('0xf')]++;_0x198a2a[_0x12ab('0x10')]['push']({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4b14dc+0x2)+_0x12ab('0x20')+(_0x4b14dc+0x1)+')','context':_0x4fcbde[_0x439399][0x0][_0x12ab('0x17')],'exten':_0x4fcbde[_0x439399][0x0]['exten'],'priority':_0x4b14dc,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});if(_0x198a2a['extension']){_0x198a2a[_0x12ab('0x10')][_0x12ab('0x13')]({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':'Set','appdata':_0x198a2a[_0x12ab('0x11')][_0x12ab('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x198a2a['extension'][_0x12ab('0x1d')]+'}':_0x12ab('0x21'),'context':_0x4fcbde[_0x439399][0x0][_0x12ab('0x17')],'exten':_0x4fcbde[_0x439399][0x0][_0x12ab('0xa')],'priority':_0x198a2a[_0x12ab('0xf')]++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});}_0x198a2a['extensions'][_0x12ab('0x13')]({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':_0x12ab('0x14'),'appdata':_0x12ab('0x22')+_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')],'context':_0x4fcbde[_0x439399][0x0][_0x12ab('0x17')],'exten':_0x4fcbde[_0x439399][0x0]['exten'],'priority':_0x198a2a['priority']++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});if(_0x198a2a[_0x12ab('0x11')]&&_0x198a2a['extension'][_0x12ab('0xe')](_0x12ab('0x23'))&&_0x198a2a[_0x12ab('0x11')]['recordingFormat']!==_0x12ab('0x24')){_0x198a2a[_0x12ab('0x10')]['push']({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':_0x12ab('0x14'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4fcbde[_0x439399][0x0]['context'],'exten':_0x4fcbde[_0x439399][0x0]['exten'],'priority':_0x198a2a[_0x12ab('0xf')]++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});_0x198a2a['extensions'][_0x12ab('0x13')]({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':_0x12ab('0x14'),'appdata':_0x12ab('0x25')+_0x198a2a[_0x12ab('0x11')]['recordingFormat']||_0x12ab('0x26'),'context':_0x4fcbde[_0x439399][0x0]['context'],'exten':_0x4fcbde[_0x439399][0x0][_0x12ab('0xa')],'priority':_0x198a2a[_0x12ab('0xf')]++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});}}_0x198a2a[_0x12ab('0x10')][_0x12ab('0x13')]({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':'Set','appdata':_0x12ab('0x27'),'context':_0x4fcbde[_0x439399][0x0][_0x12ab('0x17')],'exten':_0x4fcbde[_0x439399][0x0][_0x12ab('0xa')],'priority':_0x198a2a[_0x12ab('0xf')]++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});_0x198a2a[_0x12ab('0x10')]['push']({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':_0x12ab('0x14'),'appdata':_0x12ab('0x28'),'context':_0x4fcbde[_0x439399][0x0]['context'],'exten':_0x4fcbde[_0x439399][0x0][_0x12ab('0xa')],'priority':_0x198a2a[_0x12ab('0xf')]++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});_0x198a2a[_0x12ab('0x10')]['push']({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':'Set','appdata':_0x12ab('0x29'),'context':_0x4fcbde[_0x439399][0x0][_0x12ab('0x17')],'exten':_0x4fcbde[_0x439399][0x0][_0x12ab('0xa')],'priority':_0x198a2a['priority']++,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0]['VoiceExtensionId']});for(var _0x1d294d=0x0,_0x3e53e9=0x0;_0x1d294d<_0x4fcbde[_0x439399][_0x12ab('0x2a')];_0x1d294d+=0x1,_0x3e53e9=0x0){var _0x1c6917=_0x4fcbde[_0x439399][_0x1d294d];if(_0x1c6917[_0x12ab('0x16')]){_0x1c6917['type']=_0x1c6917[_0x12ab('0x16')]['toLowerCase']();}var _0x5c3e8b=[];var _0x2e4472=[];delete _0x1c6917['id'];delete _0x1c6917['createdAt'];delete _0x1c6917['updatedAt'];var _0x5e3356=_0x1c6917['interval']!=='*,*,*,*'?[_0x1c6917['interval']]:_0x1c6917[_0x12ab('0x7')]?_[_0x12ab('0x9')](_[_0x12ab('0xb')](_0x198a2a[_0x12ab('0x5')],{'IntervalId':_0x1c6917['IntervalId']}),_0x12ab('0x2b')):[];if(_0x1c6917['hasOwnProperty'](_0x12ab('0x2c'))){if(_0x1c6917[_0x12ab('0x2c')]&&_0x1c6917['tag']!=='--'){_0x5c3e8b[_0x12ab('0x13')]({'type':_0x1c6917[_0x12ab('0x16')],'app':_0x12ab('0x14'),'appdata':_0x12ab('0x2d')+_0x1c6917[_0x12ab('0x2c')],'context':_0x1c6917[_0x12ab('0x17')],'exten':_0x1c6917[_0x12ab('0xa')],'priority':_0x5e3356['length']+_0x198a2a[_0x12ab('0xf')]+_0x3e53e9++,'VoiceExtensionId':_0x1c6917[_0x12ab('0x18')]});}}if(_0x1c6917['type']===_0x12ab('0x1b')&&_0x1c6917[_0x12ab('0xe')]('callerID')){if(_0x1c6917[_0x12ab('0x2e')]){_0x5c3e8b[_0x12ab('0x13')]({'type':_0x1c6917['type'],'app':_0x12ab('0x2f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x1c6917[_0x12ab('0x2e')]+')','context':_0x1c6917[_0x12ab('0x17')],'exten':_0x1c6917[_0x12ab('0xa')],'priority':_0x5e3356[_0x12ab('0x2a')]+_0x198a2a[_0x12ab('0xf')]+_0x3e53e9++,'VoiceExtensionId':_0x1c6917[_0x12ab('0x18')]});}else{_0x5c3e8b[_0x12ab('0x13')]({'type':_0x1c6917[_0x12ab('0x16')],'app':_0x12ab('0x2f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x1c6917[_0x12ab('0x17')],'exten':_0x1c6917['exten'],'priority':_0x5e3356[_0x12ab('0x2a')]+_0x198a2a['priority']+_0x3e53e9++,'VoiceExtensionId':_0x1c6917[_0x12ab('0x18')]});}}if(_0x1c6917[_0x12ab('0xe')](_0x12ab('0x30'))){if(_0x2a83ef[_0x12ab('0x31')](_0x1c6917[_0x12ab('0x32')][_0x12ab('0x33')]())>=0x0&&_0x1c6917['appType']!==_0x12ab('0x34')){if(_0x1c6917[_0x12ab('0x30')]){_0x5c3e8b[_0x12ab('0x13')]({'type':_0x1c6917['type'],'app':_0x12ab('0x2f'),'appdata':_0x12ab('0x35'),'context':_0x1c6917[_0x12ab('0x17')],'exten':_0x1c6917[_0x12ab('0xa')],'priority':_0x5e3356[_0x12ab('0x2a')]+_0x198a2a[_0x12ab('0xf')]+_0x3e53e9++,'VoiceExtensionId':_0x1c6917['VoiceExtensionId']});_0x5c3e8b[_0x12ab('0x13')]({'type':_0x1c6917[_0x12ab('0x16')],'app':'Set','appdata':_0x12ab('0x36'),'context':_0x1c6917[_0x12ab('0x17')],'exten':_0x1c6917[_0x12ab('0xa')],'priority':_0x5e3356['length']+_0x198a2a[_0x12ab('0xf')]+_0x3e53e9++,'VoiceExtensionId':_0x1c6917['VoiceExtensionId']});}else{_0x5c3e8b[_0x12ab('0x13')]({'type':_0x1c6917[_0x12ab('0x16')],'app':_0x12ab('0x2f'),'appdata':_0x12ab('0x37'),'context':_0x1c6917[_0x12ab('0x17')],'exten':_0x1c6917['exten'],'priority':_0x5e3356[_0x12ab('0x2a')]+_0x198a2a[_0x12ab('0xf')]+_0x3e53e9++,'VoiceExtensionId':_0x1c6917['VoiceExtensionId']});_0x5c3e8b[_0x12ab('0x13')]({'type':_0x1c6917[_0x12ab('0x16')],'app':_0x12ab('0x14'),'appdata':_0x12ab('0x38'),'context':_0x1c6917[_0x12ab('0x17')],'exten':_0x1c6917[_0x12ab('0xa')],'priority':_0x5e3356[_0x12ab('0x2a')]+_0x198a2a[_0x12ab('0xf')]+_0x3e53e9++,'VoiceExtensionId':_0x1c6917[_0x12ab('0x18')]});}}}for(var _0x10830d=0x0;_0x10830d<_0x5e3356[_0x12ab('0x2a')];_0x10830d+=0x1){var _0x129d0b=_0x198a2a[_0x12ab('0xf')]+_0x5e3356['length'];var _0x5d88bb=_0x10830d===_0x5e3356['length']-0x1?_0x198a2a['priority']+_0x5c3e8b['length']+_0x2e4472['length']+0x2:_0x198a2a[_0x12ab('0xf')]+_0x10830d+0x1;_0x5c3e8b['splice'](_0x10830d,0x0,{'type':_0x1c6917[_0x12ab('0x16')],'app':'GotoIfTime','appdata':_0x5e3356[_0x10830d]+'?'+_0x1c6917['context']+_0x12ab('0x39')+_0x129d0b+':'+_0x1c6917[_0x12ab('0x17')]+',${EXTEN},'+_0x5d88bb,'exten':_0x1c6917[_0x12ab('0xa')],'context':_0x1c6917['context'],'priority':_0x198a2a[_0x12ab('0xf')]+_0x10830d,'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});}_0x1c6917[_0x12ab('0xf')]=_0x5c3e8b[_0x12ab('0x2a')]?_['last'](_0x5c3e8b)[_0x12ab('0xf')]+0x1:_0x198a2a['priority'];_0x198a2a[_0x12ab('0xf')]=(_0x2e4472[_0x12ab('0x2a')]?_[_0x12ab('0x3a')](_0x2e4472)[_0x12ab('0xf')]:_0x1c6917[_0x12ab('0xf')])+0x1;_0x198a2a[_0x12ab('0x10')]=_[_0x12ab('0x3b')](_0x198a2a['extensions'],_0x5c3e8b,[_0x1c6917],_0x2e4472);}_0x198a2a[_0x12ab('0x10')][_0x12ab('0x13')]({'type':_0x4fcbde[_0x439399][0x0][_0x12ab('0x16')],'app':_0x12ab('0x3c'),'exten':_0x4fcbde[_0x439399][0x0][_0x12ab('0xa')],'context':_0x4fcbde[_0x439399][0x0][_0x12ab('0x17')],'priority':_0x198a2a[_0x12ab('0xf')],'VoiceExtensionId':_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]});_0xd3b4bd['push'](_0x4fcbde[_0x439399][0x0][_0x12ab('0x18')]);_0x1cf77e=_[_0x12ab('0x3b')](_0x1cf77e,_0x198a2a[_0x12ab('0x10')]);}}return _0x303560[_0x12ab('0x3d')](function(_0x3403d1){return _0x303560[_0x12ab('0x1')][_0x12ab('0x6')][_0x12ab('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0xd3b4bd}},'transaction':_0x3403d1})[_0x12ab('0x4')](function(_0x2071a7){return _0x303560[_0x12ab('0x1')][_0x12ab('0x6')]['bulkCreate'](_[_0x12ab('0x3f')](_0x1cf77e,_0x12ab('0xf')),{'transaction':_0x3403d1});});});})['catch'](function(_0x44bd8b){console[_0x12ab('0x40')](_0x44bd8b);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x3471=['map','tag','CDR(tag)=','callerID','ExecIf','$[${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','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','util','models','Interval','then','intervals','VoiceExtension','findAll','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','extensions','extension','find','Set','type','context','priority','VoiceExtensionId','inbound','push','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3471,0x135));var _0x1347=function(_0x5bd1dd,_0x3c4e21){_0x5bd1dd=_0x5bd1dd-0x0;var _0x5387cd=_0x3471[_0x5bd1dd];return _0x5387cd;};'use strict';var _=require('lodash');var util=require(_0x1347('0x0'));function rewrite(_0x1a28c6,_0x19119c){var _0x7400f1=this;return _0x1a28c6[_0x1347('0x1')][_0x1347('0x2')]['findAll']({'raw':!![]})[_0x1347('0x3')](function(_0x5ef6a3){_0x7400f1[_0x1347('0x4')]=_0x5ef6a3;return _0x1a28c6[_0x1347('0x1')][_0x1347('0x5')][_0x1347('0x6')]({'where':{'IntervalId':_0x19119c[_0x1347('0x7')]},'raw':!![]});})[_0x1347('0x3')](function(_0x1aabb1){return _0x1a28c6['models']['VoiceExtension'][_0x1347('0x6')]({'where':{'exten':{'$in':_[_0x1347('0x8')](_['map'](_0x1aabb1,_0x1347('0x9')))}},'order':[{'raw':_0x1347('0xa')}],'raw':!![]});})['then'](function(_0x38cc58){var _0x2b1457=_['filter'](_0x38cc58,{'priority':'1'});var _0x21c74f=_[_0x1347('0xb')](_0x38cc58,{'isApp':0x1});var _0x130369=_[_0x1347('0xc')](_0x21c74f,_0x1347('0x9'));var _0x5c2bfb=[_0x1347('0xd'),'playback'];var _0x19b8d1=[];var _0x3905d0=[];for(var _0x55af3f in _0x130369){if(_0x130369[_0x1347('0xe')](_0x55af3f)){_0x7400f1['priority']=0x2;_0x7400f1[_0x1347('0xf')]=[];_0x7400f1[_0x1347('0x10')]=_[_0x1347('0x11')](_0x2b1457,{'exten':_0x130369[_0x55af3f][0x0]['exten']});_0x7400f1[_0x1347('0xf')]['push']({'type':_0x130369[_0x55af3f][0x0]['type'],'app':_0x1347('0x12'),'appdata':util['format']('CDR(type)=%s',_0x130369[_0x55af3f][0x0][_0x1347('0x13')]),'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0]['exten'],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});if(_0x130369[_0x55af3f][0x0][_0x1347('0x13')]===_0x1347('0x17')){_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':'Set','appdata':_0x1347('0x19')+_0x130369[_0x55af3f][0x0][_0x1347('0x16')],'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0]['VoiceExtensionId']});}else if(_0x130369[_0x55af3f][0x0][_0x1347('0x13')]===_0x1347('0x1a')){if(_0x7400f1['extension']){_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0]['type'],'app':_0x1347('0x12'),'appdata':_0x1347('0x1b')+(_0x7400f1[_0x1347('0x10')][_0x1347('0x1c')]?'${EXTEN:'+_0x7400f1[_0x1347('0x10')]['cutdigits']+'}':_0x1347('0x1d')),'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0]['VoiceExtensionId']});}_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':'Set','appdata':_0x1347('0x19')+_0x130369[_0x55af3f][0x0][_0x1347('0x16')],'context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1['priority']++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0]['VoiceExtensionId']});var _0x5eacd0=_0x7400f1[_0x1347('0x15')]++;_0x7400f1['extensions']['push']({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':'ExecIf','appdata':_0x1347('0x1e')+(_0x5eacd0+0x2)+_0x1347('0x1f')+(_0x5eacd0+0x1)+')','context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x5eacd0,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});if(_0x7400f1['extension']){_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':_0x7400f1[_0x1347('0x10')][_0x1347('0x1c')]?_0x1347('0x20')+_0x7400f1[_0x1347('0x10')][_0x1347('0x1c')]+'}':_0x1347('0x21'),'context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});}_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':'outboundrouteid='+_0x130369[_0x55af3f][0x0][_0x1347('0x16')],'context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1['priority']++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});if(_0x7400f1[_0x1347('0x10')]&&_0x7400f1[_0x1347('0x10')][_0x1347('0xe')](_0x1347('0x22'))&&_0x7400f1[_0x1347('0x10')][_0x1347('0x22')]!==_0x1347('0x23')){_0x7400f1[_0x1347('0xf')]['push']({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':_0x1347('0x24'),'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});_0x7400f1[_0x1347('0xf')]['push']({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x7400f1[_0x1347('0x10')][_0x1347('0x22')]||_0x1347('0x25'),'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1['priority']++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});}}_0x7400f1['extensions']['push']({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':_0x1347('0x26'),'context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0]['exten'],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0]['VoiceExtensionId']});_0x7400f1[_0x1347('0xf')]['push']({'type':_0x130369[_0x55af3f][0x0]['type'],'app':_0x1347('0x12'),'appdata':_0x1347('0x27'),'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0]['exten'],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':'MONITOR_OPTIONS=ab','context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1['priority']++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});for(var _0x21a9da=0x0,_0x8d4b2d=0x0;_0x21a9da<_0x130369[_0x55af3f][_0x1347('0x28')];_0x21a9da+=0x1,_0x8d4b2d=0x0){var _0x5c2862=_0x130369[_0x55af3f][_0x21a9da];if(_0x5c2862[_0x1347('0x13')]){_0x5c2862[_0x1347('0x13')]=_0x5c2862[_0x1347('0x13')][_0x1347('0x29')]();}var _0x25ad33=[];var _0x972936=[];delete _0x5c2862['id'];delete _0x5c2862[_0x1347('0x2a')];delete _0x5c2862[_0x1347('0x2b')];var _0x2a3c4c=_0x5c2862[_0x1347('0x2c')]!==_0x1347('0x2d')?[_0x5c2862[_0x1347('0x2c')]]:_0x5c2862[_0x1347('0x7')]?_[_0x1347('0x2e')](_[_0x1347('0xb')](_0x7400f1['intervals'],{'IntervalId':_0x5c2862[_0x1347('0x7')]}),_0x1347('0x2c')):[];if(_0x5c2862[_0x1347('0xe')]('tag')){if(_0x5c2862[_0x1347('0x2f')]&&_0x5c2862[_0x1347('0x2f')]!=='--'){_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':_0x1347('0x30')+_0x5c2862['tag'],'context':_0x5c2862[_0x1347('0x14')],'exten':_0x5c2862['exten'],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1['priority']+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});}}if(_0x5c2862['type']==='outbound'&&_0x5c2862[_0x1347('0xe')](_0x1347('0x31'))){if(_0x5c2862[_0x1347('0x31')]){_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x32'),'appdata':_0x1347('0x33')+_0x5c2862[_0x1347('0x31')]+')','context':_0x5c2862['context'],'exten':_0x5c2862['exten'],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1['priority']+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});}else{_0x25ad33['push']({'type':_0x5c2862['type'],'app':_0x1347('0x32'),'appdata':_0x1347('0x34'),'context':_0x5c2862[_0x1347('0x14')],'exten':_0x5c2862[_0x1347('0x9')],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1[_0x1347('0x15')]+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862['VoiceExtensionId']});}}if(_0x5c2862['hasOwnProperty'](_0x1347('0x35'))){if(_0x5c2bfb[_0x1347('0x36')](_0x5c2862[_0x1347('0x37')][_0x1347('0x29')]())>=0x0&&_0x5c2862[_0x1347('0x38')]!=='custom'){if(_0x5c2862[_0x1347('0x35')]){_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x32'),'appdata':_0x1347('0x39'),'context':_0x5c2862[_0x1347('0x14')],'exten':_0x5c2862[_0x1347('0x9')],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1['priority']+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5c2862[_0x1347('0x14')],'exten':_0x5c2862[_0x1347('0x9')],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1[_0x1347('0x15')]+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});}else{_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862['type'],'app':'ExecIf','appdata':_0x1347('0x3a'),'context':_0x5c2862[_0x1347('0x14')],'exten':_0x5c2862[_0x1347('0x9')],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1[_0x1347('0x15')]+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':_0x1347('0x3b'),'context':_0x5c2862['context'],'exten':_0x5c2862[_0x1347('0x9')],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1[_0x1347('0x15')]+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});}}}for(var _0x4daa77=0x0;_0x4daa77<_0x2a3c4c[_0x1347('0x28')];_0x4daa77+=0x1){var _0x462e79=_0x7400f1['priority']+_0x2a3c4c[_0x1347('0x28')];var _0x138d05=_0x4daa77===_0x2a3c4c['length']-0x1?_0x7400f1[_0x1347('0x15')]+_0x25ad33['length']+_0x972936[_0x1347('0x28')]+0x2:_0x7400f1[_0x1347('0x15')]+_0x4daa77+0x1;_0x25ad33[_0x1347('0x3c')](_0x4daa77,0x0,{'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x3d'),'appdata':_0x2a3c4c[_0x4daa77]+'?'+_0x5c2862[_0x1347('0x14')]+_0x1347('0x3e')+_0x462e79+':'+_0x5c2862[_0x1347('0x14')]+',${EXTEN},'+_0x138d05,'exten':_0x5c2862['exten'],'context':_0x5c2862['context'],'priority':_0x7400f1[_0x1347('0x15')]+_0x4daa77,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});}_0x5c2862[_0x1347('0x15')]=_0x25ad33[_0x1347('0x28')]?_[_0x1347('0x3f')](_0x25ad33)[_0x1347('0x15')]+0x1:_0x7400f1[_0x1347('0x15')];_0x7400f1['priority']=(_0x972936[_0x1347('0x28')]?_['last'](_0x972936)[_0x1347('0x15')]:_0x5c2862[_0x1347('0x15')])+0x1;_0x7400f1[_0x1347('0xf')]=_[_0x1347('0x40')](_0x7400f1['extensions'],_0x25ad33,[_0x5c2862],_0x972936);}_0x7400f1[_0x1347('0xf')]['push']({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':'Hangup','exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'priority':_0x7400f1['priority'],'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});_0x19b8d1[_0x1347('0x18')](_0x130369[_0x55af3f][0x0][_0x1347('0x16')]);_0x3905d0=_['concat'](_0x3905d0,_0x7400f1['extensions']);}}return _0x1a28c6[_0x1347('0x41')](function(_0x80d198){return _0x1a28c6[_0x1347('0x1')][_0x1347('0x5')][_0x1347('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x19b8d1}},'transaction':_0x80d198})[_0x1347('0x3')](function(_0x33cb64){return _0x1a28c6[_0x1347('0x1')][_0x1347('0x5')][_0x1347('0x43')](_[_0x1347('0x44')](_0x3905d0,_0x1347('0x15')),{'transaction':_0x80d198});});});})[_0x1347('0x45')](function(_0x862666){console[_0x1347('0x46')](_0x862666);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 3741940..b546c68 100644 --- a/server/components/import/cm/csv.js +++ b/server/components/import/cm/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ce4=['sequelize','VoiceQueueId','onlyIfOpen','query','all','VoiceQueue','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','pause','info','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','select','\x20=\x20?','insert','ListId','from','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','get','always'];(function(_0x5a187b,_0x1f64fe){var _0x14d601=function(_0x45fd29){while(--_0x45fd29){_0x5a187b['push'](_0x5a187b['shift']());}};_0x14d601(++_0x1f64fe);}(_0x4ce4,0x88));var _0x44ce=function(_0x38a876,_0x427f22){_0x38a876=_0x38a876-0x0;var _0x50a71f=_0x4ce4[_0x38a876];return _0x50a71f;};'use strict';var BPromise=require(_0x44ce('0x0'));var util=require(_0x44ce('0x1'));var _=require(_0x44ce('0x2'));var fs=require('fs');var squel=require(_0x44ce('0x3'));var Papa=require(_0x44ce('0x4'));var Redis=require(_0x44ce('0x5'));var db=require(_0x44ce('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x44ce('0x7'))(_0x44ce('0x8'));config['redis']=_[_0x44ce('0x9')](config[_0x44ce('0xa')],{'host':_0x44ce('0xb'),'port':0x18eb});var socket=require(_0x44ce('0xc'))(new Redis(config['redis']));require(_0x44ce('0xd'))[_0x44ce('0xe')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]==='undefined'||process['argv'][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x44ce('0xf')][0x3]||process[_0x44ce('0xf')][0x3]===_0x44ce('0x10')||process[_0x44ce('0xf')][0x3]==='null'||!process['argv'][0x4]||process[_0x44ce('0xf')][0x4]==='undefined'||process[_0x44ce('0xf')][0x4]===_0x44ce('0x11')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x44ce('0x12')](process[_0x44ce('0xf')][0x3][_0x44ce('0x13')](','),process[_0x44ce('0xf')][0x4][_0x44ce('0x13')](','));if(!process[_0x44ce('0xf')][0x5]||process[_0x44ce('0xf')][0x5]===_0x44ce('0x10')||process[_0x44ce('0xf')][0x5]==='null'){throw new Error(_0x44ce('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x44ce('0xf')][0x6]&&process[_0x44ce('0xf')][0x6]!==_0x44ce('0x10')&&process[_0x44ce('0xf')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0x44ce('0xf')][0x7]&&process[_0x44ce('0xf')][0x7]!==_0x44ce('0x10')&&process[_0x44ce('0xf')][0x7]!==_0x44ce('0x11')?process[_0x44ce('0xf')][0x7]:null;if(!process[_0x44ce('0xf')][0x8]||process[_0x44ce('0xf')][0x8]==='undefined'||process['argv'][0x8]==='null'){throw new Error(_0x44ce('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x7c7afb){logger[_0x44ce('0x16')](_0x7c7afb);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(_0x1f2713,_0x38424b,_0x1b5cef,_0x1f4bb0){var _0x2efad4={'message':_0x38424b};_0x2efad4[_0x1f2713]=!![];if(_0x1b5cef){_0x2efad4[_0x44ce('0x17')]=_0x1b5cef;}if(_0x1f4bb0){_0x2efad4['index']=_0x1f4bb0;}return _0x2efad4;}function isEmail(_0x3890f0){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))*$/[_0x44ce('0x18')](_0x3890f0);}function checkRow(_0x193a79,_0x32e988,_0x9f6796){return new BPromise(function(_0x51710e,_0x45d7e9){if(_[_0x44ce('0x19')](_0x193a79)){return _0x45d7e9(handleCheckRowError('error',_0x44ce('0x1a'),null,_0x9f6796));}if(_0x193a79[_0x44ce('0x1b')]&&_0x193a79[_0x44ce('0x1b')][_0x44ce('0x1c')]){var _0x1efd57=_['map'](_0x193a79[_0x44ce('0x1b')],_0x44ce('0x1d'))[_0x44ce('0x1e')](';');return _0x45d7e9(handleCheckRowError(_0x44ce('0x16'),_0x1efd57,null,_0x9f6796));}var _0x3543a9={};for(var _0x37aed2 in FIELDS){if(FIELDS[_0x44ce('0x1f')](_0x37aed2)&&FIELDS[_0x37aed2]){_0x3543a9[_0x37aed2]=_0x193a79[_0x44ce('0x20')][0x0][FIELDS[_0x37aed2]]||_0x193a79[_0x44ce('0x20')][0x0]['\ufeff'+FIELDS[_0x37aed2]];}}if(!_0x3543a9[_0x44ce('0x21')]){return _0x45d7e9(handleCheckRowError('error',_0x44ce('0x22'),null,_0x9f6796));}if(!_0x3543a9[_0x44ce('0x23')]){return _0x45d7e9(handleCheckRowError(_0x44ce('0x16'),_0x44ce('0x24'),null,_0x9f6796));}if(_0x3543a9[_0x44ce('0x25')]){var _0x4d68b2=moment(_0x3543a9[_0x44ce('0x25')],_0x44ce('0x26'));if(!_0x4d68b2[_0x44ce('0x27')]()){return _0x45d7e9(handleCheckRowError(_0x44ce('0x16'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x9f6796));}}if(_0x3543a9[_0x44ce('0x28')]){if(!isEmail(_0x3543a9[_0x44ce('0x28')])){return _0x45d7e9(handleCheckRowError(_0x44ce('0x16'),_0x44ce('0x29'),null,_0x9f6796));}}_0x3543a9['ListId']=LISTID;_0x3543a9[_0x44ce('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x44ce('0x1c')]&&_0x32e988){var _0xa676f2={};for(var _0xf16645=0x0,_0x12545d=DUPLICATES[_0x44ce('0x1c')];_0xf16645<_0x12545d;_0xf16645+=0x1){_0xa676f2[DUPLICATES[_0xf16645]]=_0x3543a9[DUPLICATES[_0xf16645]];}var _0x5538d9=_[_0x44ce('0x2b')](_0x32e988,_0xa676f2);if(_0x5538d9){return _0x45d7e9(handleCheckRowError(_0x44ce('0x2c'),'Duplicate\x20Contact',_0x5538d9,_0x9f6796));}}return db[_0x44ce('0x2d')][_0x44ce('0x2e')](_0x3543a9,{'raw':!![],'hooks':![],'fields':_[_0x44ce('0x2f')](_0x3543a9)})[_0x44ce('0x30')](function(_0x81ff93){if(DUPLICATES&&DUPLICATES[_0x44ce('0x1c')]&&_0x32e988){_0x32e988[_0x44ce('0x31')](_[_0x44ce('0x32')](_0x3543a9,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x81ff93['id'];return _0x51710e();})[_0x44ce('0x33')](function(_0x2c4bcc){return _0x45d7e9(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x2c4bcc['message']||JSON[_0x44ce('0x34')](_0x2c4bcc)),null,_0x9f6796));});});}function checkHopper(){function _0x392952(){return function(_0x5a2448){logger[_0x44ce('0x16')](_0x44ce('0x35'),_0x44ce('0x36'),util[_0x44ce('0x37')](_0x5a2448,{'showHidden':![],'depth':null}));};}var _0x33c645=function(_0x4927e0,_0x22ccc3){var _0x5bc0d4=squel['insert']()[_0x44ce('0x38')](_0x44ce('0x39'))[_0x44ce('0x3a')]([_0x44ce('0x23'),_0x44ce('0x3b'),_0x44ce('0x3c'),'ListId',_0x22ccc3,_0x44ce('0x3d'),_0x44ce('0x3e')],squel['select']()[_0x44ce('0x3f')](_0x44ce('0x23'),_0x44ce('0x23'))[_0x44ce('0x3f')](_0x44ce('0x40'),'scheduledAt')[_0x44ce('0x3f')]('id',_0x44ce('0x3c'))[_0x44ce('0x3f')](LISTID[_0x44ce('0x41')](),'ListId')['field'](_0x4927e0['id'][_0x44ce('0x41')](),_0x22ccc3)['field'](_0x44ce('0x40'),_0x44ce('0x3d'))[_0x44ce('0x3f')](_0x44ce('0x40'),_0x44ce('0x3e'))['from'](_0x44ce('0x42'))[_0x44ce('0x43')](_0x44ce('0x44'))['where']('ListId\x20=\x20?',LISTID[_0x44ce('0x41')]())['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x44ce('0x45')]()[_0x44ce('0x3f')]('phone')['from'](_0x44ce('0x39'))[_0x44ce('0x43')](_0x22ccc3+_0x44ce('0x46'),_0x4927e0['id'][_0x44ce('0x41')]())))[_0x44ce('0x41')]();return _0x5bc0d4;};var _0x364794=function(_0x269f15,_0x272ac7){var _0x58b3f8=squel[_0x44ce('0x47')]()[_0x44ce('0x38')](_0x44ce('0x39'))['fromQuery'](['phone',_0x44ce('0x3b'),_0x44ce('0x3c'),'ListId',_0x272ac7,_0x44ce('0x3d'),_0x44ce('0x3e')],squel[_0x44ce('0x45')]()[_0x44ce('0x3f')](_0x44ce('0x23'),_0x44ce('0x23'))[_0x44ce('0x3f')]('NOW()','scheduledAt')[_0x44ce('0x3f')]('id',_0x44ce('0x3c'))[_0x44ce('0x3f')](LISTID[_0x44ce('0x41')](),_0x44ce('0x48'))[_0x44ce('0x3f')](_0x269f15['id'][_0x44ce('0x41')](),_0x272ac7)[_0x44ce('0x3f')](_0x44ce('0x40'),'createdAt')['field'](_0x44ce('0x40'),_0x44ce('0x3e'))[_0x44ce('0x49')](_0x44ce('0x42'))[_0x44ce('0x43')](_0x44ce('0x44'))['where'](_0x44ce('0x4a'),LISTID[_0x44ce('0x41')]())[_0x44ce('0x43')](_0x44ce('0x4b'),squel[_0x44ce('0x4c')](hopperContacts))[_0x44ce('0x43')](_0x44ce('0x4d'))[_0x44ce('0x43')](_0x44ce('0x4e'),squel[_0x44ce('0x45')]()[_0x44ce('0x3f')](_0x44ce('0x4f'))[_0x44ce('0x49')](_0x44ce('0x50'))['where'](_0x272ac7+_0x44ce('0x46'),_0x269f15['id'][_0x44ce('0x41')]()))[_0x44ce('0x43')](_0x44ce('0x4e'),squel[_0x44ce('0x45')]()[_0x44ce('0x3f')](_0x44ce('0x23'))[_0x44ce('0x49')]('cm_hopper')['where'](_0x272ac7+_0x44ce('0x46'),_0x269f15['id']['toString']())))[_0x44ce('0x41')]();return _0x58b3f8;};function _0xe2a267(_0x4cdf8a,_0x568f47){var _0x35099b=squel['insert']()[_0x44ce('0x38')](_0x44ce('0x39'))[_0x44ce('0x3a')]([_0x44ce('0x23'),_0x44ce('0x3b'),'ContactId',_0x44ce('0x48'),_0x568f47,_0x44ce('0x3d'),_0x44ce('0x3e')],squel[_0x44ce('0x45')]()[_0x44ce('0x3f')](_0x44ce('0x23'),'phone')['field'](_0x44ce('0x40'),_0x44ce('0x3b'))[_0x44ce('0x3f')]('id',_0x44ce('0x3c'))[_0x44ce('0x3f')](LISTID['toString'](),_0x44ce('0x48'))[_0x44ce('0x3f')](_0x4cdf8a['id']['toString'](),_0x568f47)[_0x44ce('0x3f')](_0x44ce('0x40'),'createdAt')[_0x44ce('0x3f')](_0x44ce('0x40'),_0x44ce('0x3e'))[_0x44ce('0x49')](_0x44ce('0x42'))[_0x44ce('0x43')](_0x44ce('0x44'))['where'](_0x44ce('0x4a'),LISTID[_0x44ce('0x41')]())[_0x44ce('0x43')](_0x44ce('0x4b'),squel[_0x44ce('0x4c')](hopperContacts))[_0x44ce('0x43')](_0x44ce('0x4d')))['toString']();return _0x35099b;}function _0x4d8ce2(_0x1376a8,_0x219dbf){var _0x240c9e=squel['insert']()['into'](_0x44ce('0x51'))['fromQuery']([_0x44ce('0x23'),'ContactId',_0x44ce('0x48'),_0x219dbf,_0x44ce('0x3d'),_0x44ce('0x3e')],squel['select']()['field'](_0x44ce('0x23'),_0x44ce('0x23'))[_0x44ce('0x3f')]('id','ContactId')[_0x44ce('0x3f')](LISTID[_0x44ce('0x41')](),_0x44ce('0x48'))[_0x44ce('0x3f')](_0x1376a8['id'][_0x44ce('0x41')](),_0x219dbf)['field'](_0x44ce('0x40'),_0x44ce('0x3d'))[_0x44ce('0x3f')](_0x44ce('0x40'),_0x44ce('0x3e'))['from'](_0x44ce('0x42'))[_0x44ce('0x43')](_0x44ce('0x44'))[_0x44ce('0x43')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x44ce('0x4c')](hopperContacts))['where'](_0x44ce('0x4d')))[_0x44ce('0x41')]();return _0x240c9e;}return db['VoiceQueue'][_0x44ce('0x52')]({'where':{'type':_0x44ce('0x53')},'attributes':['id',_0x44ce('0x54')],'include':[{'model':db[_0x44ce('0x55')],'as':'Lists','where':{'id':LISTID}}]})[_0x44ce('0x30')](function(_0x39a1bc){var _0x2bf7e6=[];if(_0x39a1bc){var _0xab42e0;for(var _0xb867f1=0x0,_0x444809;_0xb867f1<_0x39a1bc[_0x44ce('0x1c')];_0xb867f1+=0x1){_0x444809=_0x39a1bc[_0xb867f1][_0x44ce('0x56')]({'plain':!![]});switch(_0x444809[_0x44ce('0x54')]){case _0x44ce('0x57'):_0x2bf7e6[_0x44ce('0x31')](db[_0x44ce('0x58')]['query'](_0x364794(_0x444809,_0x44ce('0x59')))[_0x44ce('0x30')](function(){})['catch'](_0x392952()));break;case _0x44ce('0x5a'):_0x2bf7e6[_0x44ce('0x31')](db[_0x44ce('0x58')]['query'](_0x33c645(_0x444809,_0x44ce('0x59')))[_0x44ce('0x30')](function(){})[_0x44ce('0x33')](_0x392952()));break;default:_0x2bf7e6[_0x44ce('0x31')](db[_0x44ce('0x58')][_0x44ce('0x5b')](_0xe2a267(_0x444809,_0x44ce('0x59')))[_0x44ce('0x30')](function(){})[_0x44ce('0x33')](_0x392952()));}}}return _0x2bf7e6;})[_0x44ce('0x5c')]()[_0x44ce('0x30')](function(){return db[_0x44ce('0x5d')][_0x44ce('0x52')]({'where':{'type':_0x44ce('0x53')},'attributes':['id'],'include':[{'model':db[_0x44ce('0x55')],'as':_0x44ce('0x5e'),'where':{'id':LISTID}}]})[_0x44ce('0x30')](function(_0x43442e){var _0x239fe4=[];if(_0x43442e){var _0x2e8996;for(var _0x36cdc8=0x0,_0x256e77;_0x36cdc8<_0x43442e[_0x44ce('0x1c')];_0x36cdc8+=0x1){_0x256e77=_0x43442e[_0x36cdc8]['get']({'plain':!![]});_0x239fe4[_0x44ce('0x31')](db[_0x44ce('0x58')]['query'](_0x4d8ce2(_0x256e77,_0x44ce('0x59')))[_0x44ce('0x30')](function(){})['catch'](_0x392952()));}}return _0x239fe4;})['all']();})[_0x44ce('0x30')](function(){return db[_0x44ce('0x5f')]['findAll']({'attributes':['id',_0x44ce('0x54')],'include':[{'model':db[_0x44ce('0x55')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x4ea270){var _0x10135a=[];if(_0x4ea270){for(var _0x3bf1b9=0x0,_0x13d0dd;_0x3bf1b9<_0x4ea270[_0x44ce('0x1c')];_0x3bf1b9+=0x1){_0x13d0dd=_0x4ea270[_0x3bf1b9][_0x44ce('0x56')]({'plain':!![]});switch(_0x13d0dd['dialCheckDuplicateType']){case'always':_0x10135a[_0x44ce('0x31')](db[_0x44ce('0x58')][_0x44ce('0x5b')](_0x364794(_0x13d0dd,_0x44ce('0x60')))[_0x44ce('0x30')](function(){})[_0x44ce('0x33')](_0x392952()));break;case _0x44ce('0x5a'):_0x10135a[_0x44ce('0x31')](db[_0x44ce('0x58')][_0x44ce('0x5b')](_0x33c645(_0x13d0dd,_0x44ce('0x60')))[_0x44ce('0x30')](function(){})[_0x44ce('0x33')](_0x392952()));break;default:_0x10135a[_0x44ce('0x31')](db[_0x44ce('0x58')][_0x44ce('0x5b')](_0xe2a267(_0x13d0dd,_0x44ce('0x60')))[_0x44ce('0x30')](function(){})['catch'](_0x392952()));}}}return _0x10135a;})['all']();})['then'](function(){return db[_0x44ce('0x5f')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x44ce('0x55')],'as':_0x44ce('0x5e'),'where':{'id':LISTID}}]})[_0x44ce('0x30')](function(_0x5a55cf){var _0x5c1e3e=[];if(_0x5a55cf){for(var _0x1cd4ad=0x0,_0x589b69;_0x1cd4ad<_0x5a55cf[_0x44ce('0x1c')];_0x1cd4ad+=0x1){_0x589b69=_0x5a55cf[_0x1cd4ad][_0x44ce('0x56')]({'plain':!![]});_0x5c1e3e['push'](db['sequelize'][_0x44ce('0x5b')](_0x4d8ce2(_0x589b69,_0x44ce('0x60')))[_0x44ce('0x30')](function(){})[_0x44ce('0x33')](_0x392952()));}}return _0x5c1e3e;})[_0x44ce('0x5c')]();})[_0x44ce('0x33')](function(_0x659144){logger[_0x44ce('0x16')](_0x44ce('0x61'),_0x44ce('0x62'),_0x659144[_0x44ce('0x1d')]);});}var processPromises=function(_0x25aeb1){return BPromise[_0x44ce('0x5c')](promises)['then'](function(_0x13f2de){})[_0x44ce('0x33')](function(_0x216fe0){logger['error'](_0x44ce('0x63'),JSON[_0x44ce('0x34')](_0x216fe0));})[_0x44ce('0x64')](function(){socket[_0x44ce('0x65')](_0x44ce('0x66')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x25aeb1){return _0x25aeb1[_0x44ce('0x67')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x44ce('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0x44ce('0x30')](function(){socket['emit'](_0x44ce('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x4b4273){logger['error'](_0x44ce('0x68'),JSON[_0x44ce('0x34')](_0x4b4273));}finally{process['exit'](0x0);}});};process['on'](_0x44ce('0x69'),function(){logger['info'](_0x44ce('0x6a'));endCsv();});function main(){return BPromise[_0x44ce('0x6b')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x44ce('0x2d')][_0x44ce('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x5a2f4f){var _0x55da76=fs[_0x44ce('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x55da76,{'header':!![],'skipEmptyLines':!![],'step':function(_0x35e1f8,_0x49127c){total+=0x1;var _0x245e10=total;promises[_0x44ce('0x31')](checkRow(_0x35e1f8,_0x5a2f4f,_0x245e10)[_0x44ce('0x30')](function(){success+=0x1;})[_0x44ce('0x33')](function(_0x4d61c1){if(_0x4d61c1[_0x44ce('0x16')]){errors+=0x1;delete _0x4d61c1[_0x44ce('0x16')];}else if(_0x4d61c1[_0x44ce('0x2c')]){duplicates+=0x1;delete _0x4d61c1[_0x44ce('0x2c')];}rows[_0x44ce('0x31')](_0x4d61c1);}));if(total%0xc8===0x0){_0x49127c[_0x44ce('0x6d')]();return processPromises(_0x49127c);}},'complete':function(){return processPromises()[_0x44ce('0x30')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x48db64,_0x340e89){logger[_0x44ce('0x6e')]('CSV\x20parse\x20error',JSON['stringify'](_0x48db64));endCsv();}});})[_0x44ce('0x33')](function(_0x12c2f6){logger[_0x44ce('0x16')](_0x44ce('0x6f'),JSON[_0x44ce('0x34')](_0x12c2f6));});}main(); \ No newline at end of file +var _0xe1d5=['cm_hopper_black','VoiceQueue','CmList','Lists','then','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','\x20=\x20?','into','cm_contacts','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str'];(function(_0x16f474,_0x412a0c){var _0x2fb547=function(_0x231dd3){while(--_0x231dd3){_0x16f474['push'](_0x16f474['shift']());}};_0x2fb547(++_0x412a0c);}(_0xe1d5,0x91));var _0x5e1d=function(_0x40083e,_0x5c30d3){_0x40083e=_0x40083e-0x0;var _0x620390=_0xe1d5[_0x40083e];return _0x620390;};'use strict';var BPromise=require('bluebird');var util=require(_0x5e1d('0x0'));var _=require(_0x5e1d('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x5e1d('0x2'));var Redis=require(_0x5e1d('0x3'));var db=require(_0x5e1d('0x4'))['db'];var config=require(_0x5e1d('0x5'));var logger=require(_0x5e1d('0x6'))(_0x5e1d('0x7'));config[_0x5e1d('0x8')]=_[_0x5e1d('0x9')](config[_0x5e1d('0x8')],{'host':_0x5e1d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e1d('0x8')]));require(_0x5e1d('0xb'))[_0x5e1d('0xc')](socket);try{if(!process[_0x5e1d('0xd')][0x2]||process[_0x5e1d('0xd')][0x2]===_0x5e1d('0xe')||process[_0x5e1d('0xd')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x5e1d('0xd')][0x2];if(!process[_0x5e1d('0xd')][0x3]||process[_0x5e1d('0xd')][0x3]===_0x5e1d('0xe')||process[_0x5e1d('0xd')][0x3]===_0x5e1d('0xf')||!process[_0x5e1d('0xd')][0x4]||process[_0x5e1d('0xd')][0x4]==='undefined'||process[_0x5e1d('0xd')][0x4]===_0x5e1d('0xf')){throw new Error(_0x5e1d('0x10'));}var FIELDS=_[_0x5e1d('0x11')](process[_0x5e1d('0xd')][0x3]['split'](','),process[_0x5e1d('0xd')][0x4][_0x5e1d('0x12')](','));if(!process[_0x5e1d('0xd')][0x5]||process['argv'][0x5]==='undefined'||process[_0x5e1d('0xd')][0x5]===_0x5e1d('0xf')){throw new Error(_0x5e1d('0x13'));}var LISTID=process[_0x5e1d('0xd')][0x5];var COMPANYID=process[_0x5e1d('0xd')][0x6]&&process[_0x5e1d('0xd')][0x6]!==_0x5e1d('0xe')&&process[_0x5e1d('0xd')][0x6]!==_0x5e1d('0xf')?process[_0x5e1d('0xd')][0x6]:null;var DUPLICATES=process[_0x5e1d('0xd')][0x7]&&process[_0x5e1d('0xd')][0x7]!==_0x5e1d('0xe')&&process[_0x5e1d('0xd')][0x7]!==_0x5e1d('0xf')?process[_0x5e1d('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0x5e1d('0xd')][0x8]===_0x5e1d('0xe')||process[_0x5e1d('0xd')][0x8]===_0x5e1d('0xf')){throw new Error(_0x5e1d('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xd8011f){logger[_0x5e1d('0x15')](_0xd8011f);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(_0x472922,_0x1f161d,_0x6d7cef,_0x13d151){var _0x162780={'message':_0x1f161d};_0x162780[_0x472922]=!![];if(_0x6d7cef){_0x162780[_0x5e1d('0x16')]=_0x6d7cef;}if(_0x13d151){_0x162780[_0x5e1d('0x17')]=_0x13d151;}return _0x162780;}function isEmail(_0x5d2456){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'](_0x5d2456);}function checkRow(_0xd70130,_0x2223d9,_0x51bbc9){return new BPromise(function(_0x1a3960,_0x3ce867){if(_[_0x5e1d('0x18')](_0xd70130)){return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),_0x5e1d('0x19'),null,_0x51bbc9));}if(_0xd70130[_0x5e1d('0x1a')]&&_0xd70130[_0x5e1d('0x1a')][_0x5e1d('0x1b')]){var _0x4c448f=_[_0x5e1d('0x1c')](_0xd70130[_0x5e1d('0x1a')],_0x5e1d('0x1d'))[_0x5e1d('0x1e')](';');return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),_0x4c448f,null,_0x51bbc9));}var _0x49922c={};for(var _0x443a7c in FIELDS){if(FIELDS['hasOwnProperty'](_0x443a7c)&&FIELDS[_0x443a7c]){_0x49922c[_0x443a7c]=_0xd70130[_0x5e1d('0x1f')][0x0][FIELDS[_0x443a7c]]||_0xd70130[_0x5e1d('0x1f')][0x0]['\ufeff'+FIELDS[_0x443a7c]];}}if(!_0x49922c['firstName']){return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),_0x5e1d('0x20'),null,_0x51bbc9));}if(!_0x49922c[_0x5e1d('0x21')]){return _0x3ce867(handleCheckRowError('error',_0x5e1d('0x22'),null,_0x51bbc9));}if(_0x49922c[_0x5e1d('0x23')]){var _0x2eddc4=moment(_0x49922c[_0x5e1d('0x23')],'YYYY-MM-DD');if(!_0x2eddc4['isValid']()){return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x51bbc9));}}if(_0x49922c[_0x5e1d('0x24')]){if(!isEmail(_0x49922c['email'])){return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),_0x5e1d('0x25'),null,_0x51bbc9));}}_0x49922c[_0x5e1d('0x26')]=LISTID;_0x49922c['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5e1d('0x1b')]&&_0x2223d9){var _0x213415={};for(var _0x2d70c8=0x0,_0x196ea2=DUPLICATES[_0x5e1d('0x1b')];_0x2d70c8<_0x196ea2;_0x2d70c8+=0x1){_0x213415[DUPLICATES[_0x2d70c8]]=_0x49922c[DUPLICATES[_0x2d70c8]];}var _0x218d37=_[_0x5e1d('0x27')](_0x2223d9,_0x213415);if(_0x218d37){return _0x3ce867(handleCheckRowError(_0x5e1d('0x28'),_0x5e1d('0x29'),_0x218d37,_0x51bbc9));}}return db[_0x5e1d('0x2a')][_0x5e1d('0x2b')](_0x49922c,{'raw':!![],'hooks':![],'fields':_['keys'](_0x49922c)})['then'](function(_0x836e1e){if(DUPLICATES&&DUPLICATES[_0x5e1d('0x1b')]&&_0x2223d9){_0x2223d9[_0x5e1d('0x2c')](_[_0x5e1d('0x2d')](_0x49922c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x836e1e['id'];return _0x1a3960();})[_0x5e1d('0x2e')](function(_0x48e5bb){return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),_0x5e1d('0x2f')+(_0x48e5bb[_0x5e1d('0x1d')]||JSON[_0x5e1d('0x30')](_0x48e5bb)),null,_0x51bbc9));});});}function checkHopper(){function _0x4b05ae(){return function(_0x28da07){logger[_0x5e1d('0x15')]('cmContact',_0x5e1d('0x31'),util[_0x5e1d('0x32')](_0x28da07,{'showHidden':![],'depth':null}));};}var _0x4f8701=function(_0x5e4b2c,_0x3740d8){var _0x2fb47a=squel[_0x5e1d('0x33')]()['into'](_0x5e1d('0x34'))[_0x5e1d('0x35')](['phone',_0x5e1d('0x36'),_0x5e1d('0x37'),'ListId',_0x3740d8,_0x5e1d('0x38'),_0x5e1d('0x39')],squel['select']()[_0x5e1d('0x3a')](_0x5e1d('0x21'),_0x5e1d('0x21'))['field'](_0x5e1d('0x3b'),_0x5e1d('0x36'))['field']('id',_0x5e1d('0x37'))[_0x5e1d('0x3a')](LISTID[_0x5e1d('0x3c')](),'ListId')['field'](_0x5e4b2c['id'][_0x5e1d('0x3c')](),_0x3740d8)[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x38'))[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x39'))['from']('cm_contacts')[_0x5e1d('0x3d')]('deletedAt\x20IS\x20NULL')[_0x5e1d('0x3d')](_0x5e1d('0x3e'),LISTID[_0x5e1d('0x3c')]())[_0x5e1d('0x3d')](_0x5e1d('0x3f'))[_0x5e1d('0x3d')](_0x5e1d('0x40'),squel[_0x5e1d('0x41')]()[_0x5e1d('0x3a')](_0x5e1d('0x21'))[_0x5e1d('0x42')](_0x5e1d('0x34'))[_0x5e1d('0x3d')](_0x3740d8+_0x5e1d('0x43'),_0x5e4b2c['id'][_0x5e1d('0x3c')]())))[_0x5e1d('0x3c')]();return _0x2fb47a;};var _0x3eaad1=function(_0x298f7d,_0x279fe9){var _0x3ea588=squel[_0x5e1d('0x33')]()[_0x5e1d('0x44')](_0x5e1d('0x34'))[_0x5e1d('0x35')]([_0x5e1d('0x21'),_0x5e1d('0x36'),_0x5e1d('0x37'),_0x5e1d('0x26'),_0x279fe9,_0x5e1d('0x38'),_0x5e1d('0x39')],squel[_0x5e1d('0x41')]()[_0x5e1d('0x3a')](_0x5e1d('0x21'),_0x5e1d('0x21'))[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x36'))[_0x5e1d('0x3a')]('id',_0x5e1d('0x37'))[_0x5e1d('0x3a')](LISTID[_0x5e1d('0x3c')](),'ListId')[_0x5e1d('0x3a')](_0x298f7d['id'][_0x5e1d('0x3c')](),_0x279fe9)[_0x5e1d('0x3a')]('NOW()',_0x5e1d('0x38'))[_0x5e1d('0x3a')](_0x5e1d('0x3b'),'updatedAt')['from'](_0x5e1d('0x45'))[_0x5e1d('0x3d')](_0x5e1d('0x46'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x5e1d('0x3d')](_0x5e1d('0x47'),squel[_0x5e1d('0x48')](hopperContacts))[_0x5e1d('0x3d')](_0x5e1d('0x3f'))[_0x5e1d('0x3d')](_0x5e1d('0x40'),squel[_0x5e1d('0x41')]()[_0x5e1d('0x3a')]('calleridnum')[_0x5e1d('0x42')]('cm_hopper_final')[_0x5e1d('0x3d')](_0x279fe9+_0x5e1d('0x43'),_0x298f7d['id']['toString']()))[_0x5e1d('0x3d')](_0x5e1d('0x40'),squel[_0x5e1d('0x41')]()['field'](_0x5e1d('0x21'))[_0x5e1d('0x42')](_0x5e1d('0x34'))[_0x5e1d('0x3d')](_0x279fe9+_0x5e1d('0x43'),_0x298f7d['id'][_0x5e1d('0x3c')]())))[_0x5e1d('0x3c')]();return _0x3ea588;};function _0xaee81b(_0x190679,_0x493bbc){var _0x2f40de=squel[_0x5e1d('0x33')]()['into'](_0x5e1d('0x34'))[_0x5e1d('0x35')]([_0x5e1d('0x21'),_0x5e1d('0x36'),_0x5e1d('0x37'),_0x5e1d('0x26'),_0x493bbc,_0x5e1d('0x38'),_0x5e1d('0x39')],squel[_0x5e1d('0x41')]()[_0x5e1d('0x3a')](_0x5e1d('0x21'),_0x5e1d('0x21'))[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x36'))['field']('id',_0x5e1d('0x37'))[_0x5e1d('0x3a')](LISTID[_0x5e1d('0x3c')](),_0x5e1d('0x26'))['field'](_0x190679['id']['toString'](),_0x493bbc)[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x38'))[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x39'))[_0x5e1d('0x42')]('cm_contacts')[_0x5e1d('0x3d')](_0x5e1d('0x46'))[_0x5e1d('0x3d')](_0x5e1d('0x3e'),LISTID['toString']())[_0x5e1d('0x3d')]('id\x20IN\x20?',squel[_0x5e1d('0x48')](hopperContacts))['where'](_0x5e1d('0x3f')))[_0x5e1d('0x3c')]();return _0x2f40de;}function _0x568caf(_0x2dd781,_0x314e51){var _0x2c038e=squel['insert']()[_0x5e1d('0x44')](_0x5e1d('0x49'))['fromQuery']([_0x5e1d('0x21'),_0x5e1d('0x37'),_0x5e1d('0x26'),_0x314e51,_0x5e1d('0x38'),_0x5e1d('0x39')],squel[_0x5e1d('0x41')]()['field'](_0x5e1d('0x21'),_0x5e1d('0x21'))[_0x5e1d('0x3a')]('id','ContactId')['field'](LISTID[_0x5e1d('0x3c')](),'ListId')[_0x5e1d('0x3a')](_0x2dd781['id'][_0x5e1d('0x3c')](),_0x314e51)[_0x5e1d('0x3a')]('NOW()',_0x5e1d('0x38'))['field'](_0x5e1d('0x3b'),'updatedAt')[_0x5e1d('0x42')](_0x5e1d('0x45'))[_0x5e1d('0x3d')]('deletedAt\x20IS\x20NULL')['where'](_0x5e1d('0x3e'),LISTID['toString']())[_0x5e1d('0x3d')](_0x5e1d('0x47'),squel[_0x5e1d('0x48')](hopperContacts))[_0x5e1d('0x3d')](_0x5e1d('0x3f')))[_0x5e1d('0x3c')]();return _0x2c038e;}return db[_0x5e1d('0x4a')]['findAll']({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x5e1d('0x4b')],'as':_0x5e1d('0x4c'),'where':{'id':LISTID}}]})[_0x5e1d('0x4d')](function(_0x2d41db){var _0x56e3e7=[];if(_0x2d41db){var _0x558af2;for(var _0x1a02be=0x0,_0x14b6ea;_0x1a02be<_0x2d41db[_0x5e1d('0x1b')];_0x1a02be+=0x1){_0x14b6ea=_0x2d41db[_0x1a02be][_0x5e1d('0x4e')]({'plain':!![]});switch(_0x14b6ea[_0x5e1d('0x4f')]){case _0x5e1d('0x50'):_0x56e3e7[_0x5e1d('0x2c')](db[_0x5e1d('0x51')][_0x5e1d('0x52')](_0x3eaad1(_0x14b6ea,_0x5e1d('0x53')))[_0x5e1d('0x4d')](function(){})['catch'](_0x4b05ae()));break;case _0x5e1d('0x54'):_0x56e3e7['push'](db[_0x5e1d('0x51')]['query'](_0x4f8701(_0x14b6ea,'VoiceQueueId'))['then'](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));break;default:_0x56e3e7['push'](db['sequelize']['query'](_0xaee81b(_0x14b6ea,_0x5e1d('0x53')))['then'](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));}}}return _0x56e3e7;})[_0x5e1d('0x55')]()[_0x5e1d('0x4d')](function(){return db[_0x5e1d('0x4a')][_0x5e1d('0x56')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x5e1d('0x4b')],'as':_0x5e1d('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x1f96f2){var _0x36ce17=[];if(_0x1f96f2){var _0x57e907;for(var _0x7c843f=0x0,_0x8d72ce;_0x7c843f<_0x1f96f2[_0x5e1d('0x1b')];_0x7c843f+=0x1){_0x8d72ce=_0x1f96f2[_0x7c843f][_0x5e1d('0x4e')]({'plain':!![]});_0x36ce17[_0x5e1d('0x2c')](db['sequelize'][_0x5e1d('0x52')](_0x568caf(_0x8d72ce,'VoiceQueueId'))['then'](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));}}return _0x36ce17;})[_0x5e1d('0x55')]();})[_0x5e1d('0x4d')](function(){return db[_0x5e1d('0x58')][_0x5e1d('0x56')]({'attributes':['id',_0x5e1d('0x4f')],'include':[{'model':db['CmList'],'as':_0x5e1d('0x4c'),'where':{'id':LISTID}}]})[_0x5e1d('0x4d')](function(_0x5d233d){var _0x29020f=[];if(_0x5d233d){for(var _0x353fe1=0x0,_0x1f2152;_0x353fe1<_0x5d233d[_0x5e1d('0x1b')];_0x353fe1+=0x1){_0x1f2152=_0x5d233d[_0x353fe1]['get']({'plain':!![]});switch(_0x1f2152[_0x5e1d('0x4f')]){case _0x5e1d('0x50'):_0x29020f[_0x5e1d('0x2c')](db['sequelize'][_0x5e1d('0x52')](_0x3eaad1(_0x1f2152,_0x5e1d('0x59')))[_0x5e1d('0x4d')](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));break;case _0x5e1d('0x54'):_0x29020f[_0x5e1d('0x2c')](db[_0x5e1d('0x51')][_0x5e1d('0x52')](_0x4f8701(_0x1f2152,_0x5e1d('0x59')))[_0x5e1d('0x4d')](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));break;default:_0x29020f['push'](db['sequelize'][_0x5e1d('0x52')](_0xaee81b(_0x1f2152,_0x5e1d('0x59')))[_0x5e1d('0x4d')](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));}}}return _0x29020f;})[_0x5e1d('0x55')]();})[_0x5e1d('0x4d')](function(){return db[_0x5e1d('0x58')][_0x5e1d('0x56')]({'attributes':['id'],'include':[{'model':db[_0x5e1d('0x4b')],'as':_0x5e1d('0x57'),'where':{'id':LISTID}}]})[_0x5e1d('0x4d')](function(_0x52729a){var _0x12e6f6=[];if(_0x52729a){for(var _0x1c5165=0x0,_0x4dfaf5;_0x1c5165<_0x52729a[_0x5e1d('0x1b')];_0x1c5165+=0x1){_0x4dfaf5=_0x52729a[_0x1c5165][_0x5e1d('0x4e')]({'plain':!![]});_0x12e6f6[_0x5e1d('0x2c')](db['sequelize']['query'](_0x568caf(_0x4dfaf5,_0x5e1d('0x59')))[_0x5e1d('0x4d')](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));}}return _0x12e6f6;})[_0x5e1d('0x55')]();})['catch'](function(_0x6ff36e){logger[_0x5e1d('0x15')](_0x5e1d('0x5a'),_0x5e1d('0x5b'),_0x6ff36e['message']);});}var processPromises=function(_0x45e5ff){return BPromise[_0x5e1d('0x55')](promises)['then'](function(_0x538118){})[_0x5e1d('0x2e')](function(_0x277da){logger[_0x5e1d('0x15')](_0x5e1d('0x5c'),JSON[_0x5e1d('0x30')](_0x277da));})['finally'](function(){socket[_0x5e1d('0x5d')](_0x5e1d('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x45e5ff){return _0x45e5ff[_0x5e1d('0x5f')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x5e1d('0x4d')](function(){if(hopperContacts){return checkHopper();}})[_0x5e1d('0x4d')](function(){socket[_0x5e1d('0x5d')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5e1d('0x60')](FILEPATH);}catch(_0x112a6b){logger[_0x5e1d('0x15')](_0x5e1d('0x61'),JSON[_0x5e1d('0x30')](_0x112a6b));}finally{process[_0x5e1d('0x62')](0x0);}});};process['on'](_0x5e1d('0x63'),function(){logger['info'](_0x5e1d('0x64'));endCsv();});function main(){return BPromise[_0x5e1d('0x65')]()[_0x5e1d('0x4d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5e1d('0x12')](',');return db['CmContact'][_0x5e1d('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5e1d('0x4d')](function(_0x39f672){var _0x503b41=fs[_0x5e1d('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5e1d('0x67')](_0x503b41,{'header':!![],'skipEmptyLines':!![],'step':function(_0x57db16,_0x477d16){total+=0x1;var _0x491120=total;promises['push'](checkRow(_0x57db16,_0x39f672,_0x491120)['then'](function(){success+=0x1;})['catch'](function(_0x37acd3){if(_0x37acd3['error']){errors+=0x1;delete _0x37acd3[_0x5e1d('0x15')];}else if(_0x37acd3[_0x5e1d('0x28')]){duplicates+=0x1;delete _0x37acd3[_0x5e1d('0x28')];}rows['push'](_0x37acd3);}));if(total%0xc8===0x0){_0x477d16[_0x5e1d('0x68')]();return processPromises(_0x477d16);}},'complete':function(){return processPromises()[_0x5e1d('0x4d')](function(){logger[_0x5e1d('0x69')](_0x5e1d('0x6a'));endCsv();});},'error':function(_0x3761db,_0x33fb99){logger['info'](_0x5e1d('0x6b'),JSON['stringify'](_0x3761db));endCsv();}});})[_0x5e1d('0x2e')](function(_0x320a03){logger['error'](_0x5e1d('0x6c'),JSON[_0x5e1d('0x30')](_0x320a03));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 41ef5e3..0ccf5b0 100644 --- a/server/components/import/cm/csv2.js +++ b/server/components/import/cm/csv2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98ae=['PHONE','cm_contacts.phone','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ListId','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','cm_contacts.createdAt','cm_hopper_black','fromQuery','ContactId','createdAt','updatedAt','.CmListId','\x20=\x20','toString','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','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?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','info','exit','code','spread','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','message','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','set','query','main','stringify','send','start','binding','clone','server/files/tmp','includes','header','ContactItemType','findAll','name','_description','writeFileSync','parse','rows','errors','data','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','path','lodash','papaparse','util','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','then','length','push','all','AdditionalPhones','split','isNil','CmContactHasItem','findOne','update','create'];(function(_0x14d7e5,_0x5b4531){var _0x23ed2f=function(_0x3d11ad){while(--_0x3d11ad){_0x14d7e5['push'](_0x14d7e5['shift']());}};_0x23ed2f(++_0x5b4531);}(_0x98ae,0x142));var _0xe98a=function(_0x39fa55,_0x569ec4){_0x39fa55=_0x39fa55-0x0;var _0x562799=_0x98ae[_0x39fa55];return _0x562799;};'use strict';var fs=require('fs');var path=require(_0xe98a('0x0'));var _=require(_0xe98a('0x1'));var Papa=require(_0xe98a('0x2'));var util=require(_0xe98a('0x3'));var BPromise=require('bluebird');var moment=require(_0xe98a('0x4'));var squel=require(_0xe98a('0x5'));var Redis=require(_0xe98a('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0xe98a('0x7'));var shared=require(_0xe98a('0x8'));var logger=require('../../../config/logger')(_0xe98a('0x9'));config[_0xe98a('0xa')]=_[_0xe98a('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe98a('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xe98a('0xd')](_0xe98a('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xe98a('0xd')](_0xe98a('0xe'));function isEmail(_0xcccadd){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))*$/[_0xe98a('0xf')](_0xcccadd);}function selectNotIn(_0x19f2ae,_0x19c118,_0x517133,_0x1e04cd,_0x3ae846){return squel[_0xe98a('0x10')]()[_0xe98a('0x11')](_0xe98a('0x12'))[_0xe98a('0x13')](_0x1e04cd)[_0xe98a('0x14')](_0x19c118,null,_0x19c118+_0xe98a('0x15')+_0x1e04cd+'.'+_0x517133)['where'](_0x1e04cd+'.'+_0x517133+'\x20=\x20'+_0x19f2ae+'.'+_0x517133)['where'](_0x19c118+_0xe98a('0x16')+_0x3ae846['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2fd849,_0x389400){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xe98a('0x17')](function(_0x7d43a2){if(_0x7d43a2!==null){var _0x3c2f6b=[];for(var _0x1e1eae=0x0;_0x1e1eae<_0x7d43a2[_0xe98a('0x18')];_0x1e1eae++){var _0x13fec4=_0x7d43a2[_0x1e1eae];_0x3c2f6b[_0xe98a('0x19')](insertAdditionalPhones(_0x13fec4));}}Promise[_0xe98a('0x1a')](_0x3c2f6b)[_0xe98a('0x17')](function(){_0x2fd849({'val':0x1});});});});}function insertAdditionalPhones(_0x445d5a){return new Promise(function(_0x35873d,_0x551b0b){var _0x2fddaa=_0x445d5a[_0xe98a('0x1b')];var _0x1ae518=_0x2fddaa[_0xe98a('0x1c')](';');var _0x3031d7=[];orderBy=0x0;for(var _0x16c0ef=0x0;_0x16c0ef<_0x1ae518[_0xe98a('0x18')];_0x16c0ef++){_0x3031d7['push'](splitAdditionalPhone(_0x445d5a['id'],_0x1ae518[_0x16c0ef]));}Promise[_0xe98a('0x1a')](_0x3031d7)[_0xe98a('0x17')](function(){_0x35873d({'val':_0x1ae518[_0xe98a('0x18')]});});});}function splitAdditionalPhone(_0x518634,_0x1d16a0){return new Promise(function(_0x3f97e6,_0x33e9d8){var _0x1b2073=_0x1d16a0[_0xe98a('0x1c')](':');var _0x396691=_0x1b2073[0x0];var _0x49bbe1=_0x1b2073[0x1];if(!_[_0xe98a('0x1d')](_0x49bbe1)){var _0x31d795=_0x49bbe1[_0xe98a('0x1c')]('|');var _0x3e7758=[];for(var _0x293266=0x0;_0x293266<_0x31d795[_0xe98a('0x18')];_0x293266++){if(_0x31d795[_0x293266]!==''){var _0xe239f6=_['filter'](promisesAdditionalPhones,{'contactId':_0x518634,'phone':_0x31d795[_0x293266]});if(_0xe239f6[_0xe98a('0x18')]==0x0){orderBy++;promisesAdditionalPhones[_0xe98a('0x19')]({'contactId':_0x518634,'contactTypeId':_0x396691,'phone':_0x31d795[_0x293266],'orderBy':orderBy});}}}_0x3f97e6({'ok':0x1});}else _0x3f97e6({'res':0x0});});}function createAdditionalPhone(_0x4df506,_0x5c969b,_0x3c9257,_0x3e6752){var _0x548a0e='';var _0x52ffd4='';var _0x22a65a=_0x3c9257[_0xe98a('0x1c')]('§');_0x548a0e=_0x22a65a[0x0];if(_0x22a65a[_0xe98a('0x18')]==0x2)_0x52ffd4=_0x22a65a[0x1];return new Promise(function(_0x1c2fe2,_0x49d770){return db[_0xe98a('0x1e')][_0xe98a('0x1f')]({'where':{'CmContactId':_0x4df506,'item':_0x548a0e}})[_0xe98a('0x17')](function(_0x2a2c4e){if(_0x2a2c4e){return db[_0xe98a('0x1e')][_0xe98a('0x20')]({'ItemTypeId':_0x5c969b,'description':_0x52ffd4,'OrderBy':_0x3e6752},{'where':{'CmContactId':_0x4df506,'item':_0x548a0e}})[_0xe98a('0x17')](function(_0x5d9806){_0x1c2fe2({'res':'updated'});});}else{return db[_0xe98a('0x1e')][_0xe98a('0x21')]({'CmContactId':_0x4df506,'item':_0x548a0e,'description':_0x52ffd4,'ItemTypeId':_0x5c969b,'OrderBy':_0x3e6752,'ItemClass':_0xe98a('0x22')})[_0xe98a('0x17')](function(_0x1ac643){_0x1c2fe2({'res':'inserted'});});}});});}function insertCmHopper(_0x45b7b0,_0x5e6885,_0x4063ff,_0x556820,_0x5c4a9e){var _0x4d0f97=[_0xe98a('0x23'),'cm_contacts.scheduledat',_0xe98a('0x24'),'cm_contacts.ListId',_0x5e6885+'.'+_0x556820,'cm_contacts.createdAt',_0xe98a('0x25'),_0xe98a('0x26'),_0xe98a('0x27'),'\x22'+_0x5c4a9e+'\x22'];return squel[_0xe98a('0x28')]()[_0xe98a('0x29')](_0xe98a('0x2a'))['fromQuery']([_0xe98a('0x12'),_0xe98a('0x2b'),'ContactId',_0xe98a('0x2c'),_0x556820,'createdAt','updatedAt',_0xe98a('0x2d'),_0xe98a('0x2e'),_0xe98a('0x2f')],squel[_0xe98a('0x10')]()[_0xe98a('0x30')](_0x4d0f97)[_0xe98a('0x13')](_0x5e6885)[_0xe98a('0x14')]('cm_contacts',null,_0xe98a('0x31')+_0x5e6885+'.CmListId')[_0xe98a('0x14')](_0x4063ff,null,_0x4063ff+_0xe98a('0x15')+_0x5e6885+'.'+_0x556820)[_0xe98a('0x32')](_0x5e6885+_0xe98a('0x33'),_0x45b7b0)[_0xe98a('0x32')](_0xe98a('0x34'),NOW)[_0xe98a('0x32')](_0xe98a('0x35'),selectNotIn(_0x5e6885,_0x4063ff,_0x556820,'cm_hopper',[_0xe98a('0x36'),_0xe98a('0x37')]))['where'](_0xe98a('0x35'),selectNotIn(_0x5e6885,_0x4063ff,_0x556820,'cm_hopper',[_0xe98a('0x36')])))['toString']();}function insertCmHopperBlack(_0x3a9503,_0x275771,_0x11eb49,_0x3494d){var _0xf577f7=[_0xe98a('0x23'),'cm_contacts.id',_0xe98a('0x38'),_0x275771+'.'+_0x3494d,_0xe98a('0x39'),_0xe98a('0x25')];return squel['insert']()['into'](_0xe98a('0x3a'))[_0xe98a('0x3b')]([_0xe98a('0x12'),_0xe98a('0x3c'),_0xe98a('0x2c'),_0x3494d,_0xe98a('0x3d'),_0xe98a('0x3e')],squel['select']()[_0xe98a('0x30')](_0xf577f7)[_0xe98a('0x13')](_0x275771)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x275771+_0xe98a('0x3f'))['join'](_0x11eb49,null,_0x11eb49+_0xe98a('0x15')+_0x275771+'.'+_0x3494d)[_0xe98a('0x32')](_0x275771+'.CmListId\x20=\x20?',_0x3a9503)['where'](_0xe98a('0x34'),NOW)['where'](_0xe98a('0x35'),squel[_0xe98a('0x10')]()[_0xe98a('0x11')](_0xe98a('0x12'))[_0xe98a('0x13')](_0xe98a('0x3a'))['where']('ListId\x20=\x20?',_0x3a9503)[_0xe98a('0x32')](_0x3494d+_0xe98a('0x40')+_0x275771+'.'+_0x3494d)))[_0xe98a('0x41')]();}function insertTzCmHopper(_0x279c24,_0x3692ca,_0xc67f62,_0x276043,_0x5c1b6d,_0xe5bb0c){var _0x125dec=['cm_contacts.phone',_0xe98a('0x42')+_0xe5bb0c+'.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id',_0xe98a('0x38'),_0x3692ca+'.'+_0x276043,_0xe98a('0x39'),_0xe98a('0x25'),'cm_contacts.priority',_0xe98a('0x27'),'\x22'+_0x5c1b6d+'\x22'];var _0x337af=squel[_0xe98a('0x28')]()[_0xe98a('0x29')](_0xe98a('0x2a'))['fromQuery']([_0xe98a('0x12'),'scheduledat',_0xe98a('0x3c'),'ListId',_0x276043,_0xe98a('0x3d'),_0xe98a('0x3e'),_0xe98a('0x2d'),_0xe98a('0x2e'),_0xe98a('0x2f')],squel[_0xe98a('0x10')]()['fields'](_0x125dec)['from'](_0x3692ca)[_0xe98a('0x14')](_0xe98a('0x43'),null,_0xe98a('0x31')+_0x3692ca+_0xe98a('0x3f'))['join'](_0xc67f62,null,_0xc67f62+_0xe98a('0x15')+_0x3692ca+'.'+_0x276043)[_0xe98a('0x14')](_0xe5bb0c,null,_0xe5bb0c+_0xe98a('0x15')+_0x3692ca+'.'+_0x276043)[_0xe98a('0x32')](_0x3692ca+_0xe98a('0x33'),_0x279c24)[_0xe98a('0x32')](_0xe98a('0x34'),NOW)['where'](_0xe98a('0x35'),selectNotIn(_0x3692ca,_0xc67f62,_0x276043,_0xe98a('0x2a'),[_0xe98a('0x36'),_0xe98a('0x37')]))[_0xe98a('0x32')](_0xe98a('0x35'),selectNotIn(_0x3692ca,_0xc67f62,_0x276043,'cm_hopper',[_0xe98a('0x36')])))[_0xe98a('0x41')]();return _0x337af;}function insertTzCmHopperBlack(_0x1b12d4,_0x328b4c,_0x1ecb63,_0x3ddbc6){var _0x232aed=[_0xe98a('0x23'),_0xe98a('0x24'),_0xe98a('0x38'),_0x328b4c+'.'+_0x3ddbc6,_0xe98a('0x39'),_0xe98a('0x25')];return squel[_0xe98a('0x28')]()[_0xe98a('0x29')](_0xe98a('0x3a'))[_0xe98a('0x3b')]([_0xe98a('0x12'),_0xe98a('0x3c'),_0xe98a('0x2c'),_0x3ddbc6,_0xe98a('0x3d'),_0xe98a('0x3e')],squel[_0xe98a('0x10')]()['fields'](_0x232aed)[_0xe98a('0x13')](_0x328b4c)[_0xe98a('0x14')]('cm_contacts',null,_0xe98a('0x31')+_0x328b4c+'.CmListId')['join'](_0x1ecb63,null,_0x1ecb63+_0xe98a('0x15')+_0x328b4c+'.'+_0x3ddbc6)['where'](_0x328b4c+_0xe98a('0x33'),_0x1b12d4)[_0xe98a('0x32')](_0xe98a('0x34'),NOW)['where'](_0xe98a('0x35'),squel[_0xe98a('0x10')]()[_0xe98a('0x11')]('phone')['from'](_0xe98a('0x3a'))[_0xe98a('0x32')](_0xe98a('0x44'),_0x1b12d4)[_0xe98a('0x32')](_0x3ddbc6+_0xe98a('0x40')+_0x328b4c+'.'+_0x3ddbc6)))[_0xe98a('0x41')]();}function insertCmHopperAdditionalPhones(_0x45067a){var _0x472b18=[_0xe98a('0x45'),_0xe98a('0x46'),_0xe98a('0x47'),_0xe98a('0x48'),_0xe98a('0x49')];return squel['insert']()[_0xe98a('0x29')]('cm_hopper_additional_phones')[_0xe98a('0x3b')]([_0xe98a('0x4a'),_0xe98a('0x12'),_0xe98a('0x4b'),_0xe98a('0x3d'),'updatedAt'],squel[_0xe98a('0x10')]()[_0xe98a('0x30')](_0x472b18)[_0xe98a('0x13')](_0xe98a('0x2a'))['join'](_0xe98a('0x43'),null,_0xe98a('0x4c'))[_0xe98a('0x14')]('cm_contact_has_items',null,_0xe98a('0x4d'))[_0xe98a('0x32')](_0xe98a('0x4e'),_0x45067a)[_0xe98a('0x32')](_0xe98a('0x34'),NOW))['toString']();}function insertCmContact(_0x493618,_0x1769b0,_0x104e2d,_0x178a7c){var _0x1a555b=_[_0xe98a('0x4f')](_[_0xe98a('0x50')](_0x178a7c),[_0xe98a('0x2c'),_0xe98a('0x51'),_0xe98a('0x3d'),'updatedAt']);return squel[_0xe98a('0x28')]()[_0xe98a('0x29')](_0xe98a('0x43'))['fromQuery'](_0x1a555b,squel[_0xe98a('0x10')]()[_0xe98a('0x30')](_0x1a555b)[_0xe98a('0x13')](_0x1769b0)['where']('('+_0x104e2d[_0xe98a('0x14')](',')+_0xe98a('0x52'),squel[_0xe98a('0x10')]()['fields'](_0x104e2d)[_0xe98a('0x13')](_0xe98a('0x43'))[_0xe98a('0x32')](_0xe98a('0x44'),_0x493618)['where'](_0xe98a('0x53')))[_0xe98a('0x32')](_0xe98a('0x54'),squel[_0xe98a('0x10')]()['field']('MIN(id)',_0xe98a('0x55'))[_0xe98a('0x13')](_0x1769b0)['group'](_0x104e2d['join'](','))))[_0xe98a('0x41')]();}function handleStop(){logger[_0xe98a('0x56')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x475558){logger['error'](_0x475558['message']);process[_0xe98a('0x57')](0x1);}function handleError(_0xad21dc,_0x353546){stats['errors'][_0xe98a('0x19')]({'name':_0x353546[_0xe98a('0x58')],'message':_0x353546['message'],'row':_0xad21dc});}function handleQuery(_0x47f2ea){logger['info'](_0x47f2ea);return db['sequelize']['query'](_0x47f2ea)[_0xe98a('0x59')](function(_0xd19f92){results[_0xe98a('0x19')](_0xd19f92);})[_0xe98a('0x5a')](function(_0x195ec2){logger[_0xe98a('0x5b')](_0x195ec2['message']);});}function updateTzCampaigns(_0xd5b2d9){return new Promise(function(_0x427eea,_0x3b9f8e){var _0x353512=squel[_0xe98a('0x10')]()[_0xe98a('0x30')]([_0xe98a('0x5c'),_0xe98a('0x5d')])[_0xe98a('0x13')](_0xe98a('0x5e'))['join'](_0xe98a('0x5f'),null,_0xe98a('0x60'))[_0xe98a('0x32')](_0xe98a('0x61')+_0xd5b2d9);db[_0xe98a('0x62')]['query'](_0x353512[_0xe98a('0x41')]())['spread'](function(_0x1dcf82){var _0x3963dd=[];for(var _0x331740=0x0;_0x331740<_0x1dcf82['length'];_0x331740++){_0x3963dd[_0xe98a('0x19')](getTimezoneData(_0x1dcf82[_0x331740],tmp_campaigns));}BPromise[_0xe98a('0x1a')](_0x3963dd)[_0xe98a('0x17')](function(){_0x427eea({'val':0x1});});})[_0xe98a('0x5a')](function(_0x3711ca){logger[_0xe98a('0x5b')](_0x3711ca[_0xe98a('0x63')]);_0x427eea({'val':0x0});});});}function updateTzVoiceQueues(_0x4df06b){return new Promise(function(_0x25137a,_0x5e1389){var _0x571bb0=squel[_0xe98a('0x10')]()[_0xe98a('0x30')](['voice_queues.id','voice_queues.dialTimezone'])[_0xe98a('0x13')](_0xe98a('0x64'))['join'](_0xe98a('0x65'),null,_0xe98a('0x66'))['where'](_0xe98a('0x67')+_0x4df06b);db['sequelize']['query'](_0x571bb0[_0xe98a('0x41')]())['spread'](function(_0x31a633){var _0x34f55b=[];for(var _0x340631=0x0;_0x340631<_0x31a633[_0xe98a('0x18')];_0x340631++){_0x34f55b[_0xe98a('0x19')](getTimezoneData(_0x31a633[_0x340631],tmp_voice_queues));}BPromise[_0xe98a('0x1a')](_0x34f55b)[_0xe98a('0x17')](function(){_0x25137a({'val':0x1});});})[_0xe98a('0x5a')](function(_0x52839b){logger['error'](_0x52839b[_0xe98a('0x63')]);_0x25137a({'val':0x0});});});}function getTimezoneData(_0x4da5ce,_0x53d013){return new Promise(function(_0xe0fd07,_0xc58e38){var _0x304e29=shared[_0xe98a('0x68')];var _0xbe5009=_0x304e29[_0x4da5ce[_0xe98a('0x69')]];if(_['isNil'](_0xbe5009)){_0xe0fd07({'ret':0x1});}else{var _0x1c7a40=_0xbe5009['utcOffset'];var _0x2cb2f9=squel[_0xe98a('0x28')]()['into'](_0x53d013)[_0xe98a('0x6a')]('id',_0x4da5ce['id'])[_0xe98a('0x6a')]('offset',_0x1c7a40)[_0xe98a('0x6a')](_0xe98a('0x69'),_0x4da5ce[_0xe98a('0x69')])[_0xe98a('0x41')]();return db['sequelize'][_0xe98a('0x6b')](_0x2cb2f9)[_0xe98a('0x59')](function(_0x3c3e8d){_0xe0fd07({'ret':0x1});})[_0xe98a('0x5a')](function(_0xa621d2){logger['error'](_0xa621d2[_0xe98a('0x63')]);_0xc58e38({'ret':0x1});});}});}function handleTZQuery(_0x57c5bf){logger[_0xe98a('0x56')](_0x57c5bf);return db['sequelize'][_0xe98a('0x6b')](_0x57c5bf)[_0xe98a('0x59')](function(_0x7a3898){})[_0xe98a('0x5a')](function(_0x2f0390){logger['error'](_0x2f0390['message']);});}function main(_0x132dbb,_0x3d2195,_0x597095,_0x28d50f){logger[_0xe98a('0x56')](_0xe98a('0x6c'),_0x132dbb,JSON[_0xe98a('0x6d')](_0x3d2195));process[_0xe98a('0x6e')](_0xe98a('0x6f'));var _0x49aa93=_0x3d2195[_0xe98a('0x70')];var _0x43ca7a=_[_0xe98a('0x71')](_0x49aa93);var _0x4c7837=_0x3d2195['socket_timestamp'];var _0x902378=path[_0xe98a('0x14')](config['root'],_0xe98a('0x72'),_0x4c7837+'.csv');hasTZ=_[_0xe98a('0x50')](_0x49aa93)[_0xe98a('0x73')](_0xe98a('0x69'));var _0x43144b=_[_0xe98a('0x50')](_0x49aa93)[_0xe98a('0x14')]();logger['info'](_0xe98a('0x74'),_0x43144b);db[_0xe98a('0x75')][_0xe98a('0x76')]({'raw':!![],'attributes':['id',_0xe98a('0x77')]})[_0xe98a('0x17')](function(_0x2acbe5){for(var _0xd27033=0x0;_0xd27033<_0x2acbe5[_0xe98a('0x18')];_0xd27033++){if(_0x2acbe5[_0xd27033][_0xe98a('0x77')]in _0x49aa93){contactItemTypes[_0xe98a('0x19')](_0x2acbe5[_0xd27033]);delete _0x43ca7a[_0x2acbe5[_0xd27033][_0xe98a('0x77')]];hasAdditionalPhones=!![];}for(var _0x190fac in _0x49aa93){if(_0x2acbe5[_0xd27033][_0xe98a('0x77')]+_0xe98a('0x78')===_0x190fac){phoneDescriptions[_0xe98a('0x19')]({'itemTypeId':_0x2acbe5[_0xd27033]['id'],'description':_0x190fac});delete _0x43ca7a[_0x190fac];}}}if(hasAdditionalPhones)_0x43ca7a[_0xe98a('0x1b')]='';var _0x39a7c3=_['keys'](_0x43ca7a)['join']();logger[_0xe98a('0x56')](_0xe98a('0x74'),_0x39a7c3);fs[_0xe98a('0x79')](_0x902378,_0x39a7c3+'\x0a');Papa[_0xe98a('0x7a')](fs['createReadStream'](_0x132dbb),{'header':!![],'skipEmptyLines':!![],'step':function(_0x47f06a,_0x33622c){try{for(var _0x4256c6=0x0,_0x3ef603=[];_0x4256c6<_0x47f06a['data'][_0xe98a('0x18')];_0x4256c6++){stats[_0xe98a('0x7b')]+=0x1;if(_0x47f06a[_0xe98a('0x7c')][_0x4256c6]){handleError(_0x47f06a[_0xe98a('0x7d')][_0x4256c6],_0x47f06a[_0xe98a('0x7c')][_0x4256c6]);}else{var _0x4b38b4=[];var _0x357364=[];var _0xf8f900={};for(var _0x3d3030 in _0x49aa93){let _0x40efb5=contactItemTypes[_0xe98a('0x7e')](_0x550ac0=>_0x550ac0[_0xe98a('0x77')]===_0x3d3030);let _0x29a284=contactItemTypes[_0xe98a('0x7e')](_0x476435=>_0x476435[_0xe98a('0x77')]+_0xe98a('0x78')===_0x3d3030);if(_['isNil'](_0x40efb5)&&_[_0xe98a('0x1d')](_0x29a284)){if(_0x49aa93[_0xe98a('0x7f')](_0x3d3030)){if(_0x47f06a[_0xe98a('0x7d')][_0x4256c6][_0x49aa93[_0x3d3030]]){var _0x25fefd=_[_0xe98a('0x80')](_0x47f06a[_0xe98a('0x7d')][_0x4256c6][_0x49aa93[_0x3d3030]][_0xe98a('0x81')](/"/g,'\x27'));switch(_0x3d3030){case'scheduledat':var _0x4fab38=moment(_0x25fefd,_0xe98a('0xe'),!![]);if(_0x4fab38[_0xe98a('0x82')]()){_0x3ef603[_0xe98a('0x19')]('\x22'+_0x25fefd+'\x22');}else{_0x4b38b4[_0xe98a('0x19')](_0xe98a('0x83'));}break;case'priority':var _0x563bdb=parseInt(_0x25fefd);_0x25fefd=_[_0xe98a('0x84')](_0x563bdb)||_0x563bdb<0x0||_0x563bdb>0x4?_0x28d50f?0x3:0x2:_0x563bdb;_0x3ef603[_0xe98a('0x19')]('\x22'+_0x25fefd+'\x22');break;case _0xe98a('0x2e'):var _0x21f2fd=parseInt(_0x25fefd);if(_[_0xe98a('0x85')](_0x21f2fd)&&_[_0xe98a('0x73')](_0x597095,_0x21f2fd)){_0x3ef603['push']('\x22'+_0x21f2fd+'\x22');}else{_0x4b38b4['push'](_0xe98a('0x86'));}break;case _0xe98a('0x87'):if(isEmail(_0x25fefd)){_0x3ef603['push']('\x22'+_0x25fefd+'\x22');}else{_0x4b38b4['push'](_0xe98a('0x88'));}break;case _0xe98a('0x89'):var _0x2fca5f=moment(_0x25fefd,'YYYY-MM-DD',!![]);if(_0x2fca5f[_0xe98a('0x82')]()){_0x3ef603[_0xe98a('0x19')]('\x22'+_0x25fefd+'\x22');}else{_0x4b38b4[_0xe98a('0x19')](_0xe98a('0x8a'));}break;case _0xe98a('0x69'):var _0x1f9995=shared['timezones'];var _0x5a36db=_0x1f9995[_0x25fefd];if(!_[_0xe98a('0x1d')](_0x5a36db)){var _0x203438=_0x5a36db[_0xe98a('0x8b')];_0x3ef603['push']('\x22'+_0x25fefd+'\x22');_0x3ef603['push']('\x22'+_0x203438+'\x22');}break;default:_0x3ef603['push']('\x22'+_0x25fefd+'\x22');}}else{switch(_0x3d3030){case _0xe98a('0x8c'):case _0xe98a('0x12'):_0x4b38b4['push'](_0x3d3030+_0xe98a('0x8d'));break;default:_0x3ef603[_0xe98a('0x19')]('\x22\x22');}}}}else{var _0x2197d8='';if(!_[_0xe98a('0x1d')](_0x40efb5)){if(!_0xf8f900[_0xe98a('0x7f')](_0x40efb5['id'])){if(!_[_0xe98a('0x1d')](_0x47f06a[_0xe98a('0x7d')][_0x4256c6][_0x49aa93[_0x3d3030]])){var _0x25fefd=_[_0xe98a('0x80')](_0x47f06a[_0xe98a('0x7d')][_0x4256c6][_0x49aa93[_0x3d3030]]['replace'](/"/g,'\x27'));var _0x4c02e1=phoneDescriptions[_0xe98a('0x7e')](_0x4caada=>_0x4caada[_0xe98a('0x8e')]===_0x40efb5['id']);if(!_[_0xe98a('0x1d')](_0x4c02e1)){var _0x476db4=_['trim'](_0x47f06a[_0xe98a('0x7d')][_0x4256c6][_0x49aa93[_0x4c02e1[_0xe98a('0x8f')]]][_0xe98a('0x81')](/"/g,'\x27'));if(!_[_0xe98a('0x1d')](_0x476db4))_0x25fefd=_0x25fefd+'§'+_0x476db4;}if(_0x2197d8=='')_0x2197d8=_0x25fefd;else _0x2197d8+='|'+_0x25fefd;}_0x357364['push'](_0x40efb5['id']+':'+_0x2197d8);_0xf8f900[_0x40efb5['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3ef603[_0xe98a('0x19')]('\x22'+_0x357364[_0xe98a('0x14')](';')+'\x22');}if(_0x4b38b4[_0xe98a('0x18')]){handleError(_0x47f06a['data'][_0x4256c6],{'code':_0xe98a('0x90'),'message':_0x4b38b4[_0xe98a('0x14')]()});}else{fs[_0xe98a('0x91')](_0x902378,_0x3ef603[_0xe98a('0x14')]()+'\x0a');}_0x3ef603=[];}if(!(stats[_0xe98a('0x7b')]%0xc8)){socket[_0xe98a('0x92')](_0xe98a('0x93')+_0x4c7837,stats);stats[_0xe98a('0x7c')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x33622c['abort']();}}catch(_0x382618){handleError(_0x47f06a[_0xe98a('0x7d')][_0x4256c6],{'code':_0xe98a('0x94'),'message':_0x382618[_0xe98a('0x63')]});logger[_0xe98a('0x5b')](_0xe98a('0x95'),_0x382618[_0xe98a('0x63')]);}},'complete':function(){try{var _0x11c57e=[];var _0x21a0ec=[];var _0x4db0af=_0xe98a('0x43');if(_0x3d2195[_0xe98a('0x96')]&&_0x3d2195['duplicates']['length']){_0x4db0af=_0xe98a('0x97')+_0x4c7837;_0x11c57e[_0xe98a('0x19')](_0xe98a('0x98')+_0x4db0af+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xe98a('0x99')+_0x4c7837;tmp_voice_queues='voice_queues_'+_0x4c7837;_0x21a0ec['push'](_0xe98a('0x98')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x21a0ec[_0xe98a('0x19')](_0xe98a('0x98')+tmp_voice_queues+_0xe98a('0x9a'));BPromise['each'](_0x21a0ec,handleTZQuery)[_0xe98a('0x17')](function(_0x3066dd){updateTzCampaigns(_0x3d2195['ListId'])['then'](function(_0x13d178){updateTzVoiceQueues(_0x3d2195[_0xe98a('0x2c')])[_0xe98a('0x17')](function(_0x330aea){if(hasTZ)_0x39a7c3=_0x39a7c3['replace'](_0xe98a('0x69'),_0xe98a('0x9b'));var _0x2da8e3=util[_0xe98a('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\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x902378,_0x4db0af,_0x39a7c3,_0x3d2195[_0xe98a('0x2c')],_0x3d2195['CompanyId']||null,NOW,NOW);if(_[_0xe98a('0x1d')](_0x49aa93[_0xe98a('0x2b')])){_0x2da8e3+=_0xe98a('0x9c');}_0x11c57e[_0xe98a('0x19')](_0x2da8e3);if(_0x3d2195[_0xe98a('0x96')]&&_0x3d2195[_0xe98a('0x96')][_0xe98a('0x18')]){_0x11c57e[_0xe98a('0x19')](insertCmContact(_0x3d2195[_0xe98a('0x2c')],_0x4db0af,_0x3d2195[_0xe98a('0x96')],_0x49aa93));_0x11c57e[_0xe98a('0x19')](_0xe98a('0x9d')+_0x4db0af+';');}BPromise[_0xe98a('0x9e')](_0x11c57e,handleQuery)['then'](function(_0x2bf9f2){BPromise[_0xe98a('0x1a')]([handleAdditionalPhones()])[_0xe98a('0x17')](function(){_0x11c57e=[];for(var _0x4916b6=0x0;_0x4916b6\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','AdditionalPhones','length','push','then','split','all','filter','CmContactHasItem','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_hopper_black','fields','cm_contacts','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','into','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','error','exit','errors','info','sequelize','query','spread','catch','message','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','binding','socket_timestamp','server/files/tmp','.csv','keys','includes','ContactItemType','name','_description'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0xcd15,0xf6));var _0x5cd1=function(_0x4fda88,_0x1a4d19){_0x4fda88=_0x4fda88-0x0;var _0xe37511=_0xcd15[_0x4fda88];return _0xe37511;};'use strict';var fs=require('fs');var path=require(_0x5cd1('0x0'));var _=require(_0x5cd1('0x1'));var Papa=require(_0x5cd1('0x2'));var util=require(_0x5cd1('0x3'));var BPromise=require(_0x5cd1('0x4'));var moment=require(_0x5cd1('0x5'));var squel=require(_0x5cd1('0x6'));var Redis=require(_0x5cd1('0x7'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var shared=require(_0x5cd1('0x8'));var logger=require(_0x5cd1('0x9'))(_0x5cd1('0xa'));config[_0x5cd1('0xb')]=_[_0x5cd1('0xc')](config[_0x5cd1('0xb')],{'host':_0x5cd1('0xd'),'port':0x18eb});var socket=require(_0x5cd1('0xe'))(new Redis(config[_0x5cd1('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x5cd1('0xf')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x5cd1('0xf')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x1c14f5){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'](_0x1c14f5);}function selectNotIn(_0x8bd6c0,_0x125539,_0x4df576,_0x39c357,_0xe66e24){return squel[_0x5cd1('0x10')]()[_0x5cd1('0x11')](_0x5cd1('0x12'))[_0x5cd1('0x13')](_0x39c357)[_0x5cd1('0x14')](_0x125539,null,_0x125539+_0x5cd1('0x15')+_0x39c357+'.'+_0x4df576)[_0x5cd1('0x16')](_0x39c357+'.'+_0x4df576+_0x5cd1('0x17')+_0x8bd6c0+'.'+_0x4df576)[_0x5cd1('0x16')](_0x125539+'.dialCheckDuplicateType\x20IN\x20('+_0xe66e24[_0x5cd1('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3d3ef9,_0x2687d1){promisesAdditionalPhones=[];return db[_0x5cd1('0x18')][_0x5cd1('0x19')]({'raw':!![],'attributes':['id',_0x5cd1('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x44b418){if(_0x44b418!==null){var _0x373543=[];for(var _0x5fbd8f=0x0;_0x5fbd8f<_0x44b418[_0x5cd1('0x1b')];_0x5fbd8f++){var _0x1201c6=_0x44b418[_0x5fbd8f];_0x373543[_0x5cd1('0x1c')](insertAdditionalPhones(_0x1201c6));}}Promise['all'](_0x373543)[_0x5cd1('0x1d')](function(){_0x3d3ef9({'val':0x1});});});});}function insertAdditionalPhones(_0x3bdf3b){return new Promise(function(_0x52abba,_0x483ec6){var _0x4de2fc=_0x3bdf3b['AdditionalPhones'];var _0x47dee2=_0x4de2fc[_0x5cd1('0x1e')](';');var _0x2a2fef=[];orderBy=0x0;for(var _0x23aea4=0x0;_0x23aea4<_0x47dee2[_0x5cd1('0x1b')];_0x23aea4++){_0x2a2fef[_0x5cd1('0x1c')](splitAdditionalPhone(_0x3bdf3b['id'],_0x47dee2[_0x23aea4]));}Promise[_0x5cd1('0x1f')](_0x2a2fef)[_0x5cd1('0x1d')](function(){_0x52abba({'val':_0x47dee2['length']});});});}function splitAdditionalPhone(_0x106ad1,_0x5ada3f){return new Promise(function(_0x22f34d,_0x4b3729){var _0x109a0c=_0x5ada3f[_0x5cd1('0x1e')](':');var _0x551537=_0x109a0c[0x0];var _0x22216d=_0x109a0c[0x1];if(!_['isNil'](_0x22216d)){var _0x2d2c00=_0x22216d[_0x5cd1('0x1e')]('|');var _0x212991=[];for(var _0x431001=0x0;_0x431001<_0x2d2c00[_0x5cd1('0x1b')];_0x431001++){if(_0x2d2c00[_0x431001]!==''){var _0x2da530=_[_0x5cd1('0x20')](promisesAdditionalPhones,{'contactId':_0x106ad1,'phone':_0x2d2c00[_0x431001]});if(_0x2da530[_0x5cd1('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x5cd1('0x1c')]({'contactId':_0x106ad1,'contactTypeId':_0x551537,'phone':_0x2d2c00[_0x431001],'orderBy':orderBy});}}}_0x22f34d({'ok':0x1});}else _0x22f34d({'res':0x0});});}function createAdditionalPhone(_0x704733,_0x28d96a,_0x2ae1a4,_0x41e1db){var _0xb9a8f0='';var _0x239cb5='';var _0x20b958=_0x2ae1a4[_0x5cd1('0x1e')]('§');_0xb9a8f0=_0x20b958[0x0];if(_0x20b958[_0x5cd1('0x1b')]==0x2)_0x239cb5=_0x20b958[0x1];return new Promise(function(_0x163085,_0x5743bb){return db[_0x5cd1('0x21')]['findOne']({'where':{'CmContactId':_0x704733,'item':_0xb9a8f0}})[_0x5cd1('0x1d')](function(_0x46f1fd){if(_0x46f1fd){return db[_0x5cd1('0x21')]['update']({'ItemTypeId':_0x28d96a,'description':_0x239cb5,'OrderBy':_0x41e1db},{'where':{'CmContactId':_0x704733,'item':_0xb9a8f0}})['then'](function(_0x5924f2){_0x163085({'res':_0x5cd1('0x22')});});}else{return db[_0x5cd1('0x21')][_0x5cd1('0x23')]({'CmContactId':_0x704733,'item':_0xb9a8f0,'description':_0x239cb5,'ItemTypeId':_0x28d96a,'OrderBy':_0x41e1db,'ItemClass':'PHONE'})['then'](function(_0x23a5f3){_0x163085({'res':_0x5cd1('0x24')});});}});});}function insertCmHopper(_0x39a5e5,_0x2b4675,_0x233822,_0x531a91,_0x186fe5){var _0x5b145a=[_0x5cd1('0x25'),_0x5cd1('0x26'),_0x5cd1('0x27'),'cm_contacts.ListId',_0x2b4675+'.'+_0x531a91,_0x5cd1('0x28'),_0x5cd1('0x29'),_0x5cd1('0x2a'),_0x5cd1('0x2b'),'\x22'+_0x186fe5+'\x22'];return squel[_0x5cd1('0x2c')]()['into']('cm_hopper')[_0x5cd1('0x2d')](['phone',_0x5cd1('0x2e'),_0x5cd1('0x2f'),_0x5cd1('0x30'),_0x531a91,_0x5cd1('0x31'),_0x5cd1('0x32'),_0x5cd1('0x33'),_0x5cd1('0x34'),_0x5cd1('0x35')],squel[_0x5cd1('0x10')]()['fields'](_0x5b145a)['from'](_0x2b4675)[_0x5cd1('0x14')]('cm_contacts',null,_0x5cd1('0x36')+_0x2b4675+_0x5cd1('0x37'))[_0x5cd1('0x14')](_0x233822,null,_0x233822+_0x5cd1('0x15')+_0x2b4675+'.'+_0x531a91)[_0x5cd1('0x16')](_0x2b4675+_0x5cd1('0x38'),_0x39a5e5)[_0x5cd1('0x16')](_0x5cd1('0x39'),NOW)[_0x5cd1('0x16')](_0x5cd1('0x3a'),selectNotIn(_0x2b4675,_0x233822,_0x531a91,_0x5cd1('0x3b'),[_0x5cd1('0x3c'),_0x5cd1('0x3d')]))[_0x5cd1('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2b4675,_0x233822,_0x531a91,_0x5cd1('0x3b'),[_0x5cd1('0x3c')])))[_0x5cd1('0x3e')]();}function insertCmHopperBlack(_0x1afd4d,_0x485e30,_0x5787fe,_0x198786){var _0x5839bf=[_0x5cd1('0x25'),_0x5cd1('0x27'),_0x5cd1('0x3f'),_0x485e30+'.'+_0x198786,_0x5cd1('0x28'),'cm_contacts.updatedAt'];return squel[_0x5cd1('0x2c')]()['into'](_0x5cd1('0x40'))[_0x5cd1('0x2d')](['phone','ContactId',_0x5cd1('0x30'),_0x198786,'createdAt',_0x5cd1('0x32')],squel[_0x5cd1('0x10')]()[_0x5cd1('0x41')](_0x5839bf)['from'](_0x485e30)[_0x5cd1('0x14')](_0x5cd1('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x485e30+_0x5cd1('0x37'))[_0x5cd1('0x14')](_0x5787fe,null,_0x5787fe+_0x5cd1('0x15')+_0x485e30+'.'+_0x198786)[_0x5cd1('0x16')](_0x485e30+_0x5cd1('0x38'),_0x1afd4d)[_0x5cd1('0x16')](_0x5cd1('0x39'),NOW)[_0x5cd1('0x16')](_0x5cd1('0x3a'),squel[_0x5cd1('0x10')]()[_0x5cd1('0x11')]('phone')[_0x5cd1('0x13')](_0x5cd1('0x40'))[_0x5cd1('0x16')](_0x5cd1('0x43'),_0x1afd4d)[_0x5cd1('0x16')](_0x198786+_0x5cd1('0x17')+_0x485e30+'.'+_0x198786)))[_0x5cd1('0x3e')]();}function insertTzCmHopper(_0xa3a123,_0x5854ef,_0x268eaf,_0x55c5cc,_0xf040ca,_0x2d884b){var _0x3753f6=[_0x5cd1('0x25'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x2d884b+_0x5cd1('0x44'),_0x5cd1('0x27'),'cm_contacts.ListId',_0x5854ef+'.'+_0x55c5cc,'cm_contacts.createdAt',_0x5cd1('0x29'),_0x5cd1('0x2a'),_0x5cd1('0x2b'),'\x22'+_0xf040ca+'\x22'];var _0x688faf=squel[_0x5cd1('0x2c')]()[_0x5cd1('0x45')](_0x5cd1('0x3b'))[_0x5cd1('0x2d')](['phone','scheduledat',_0x5cd1('0x2f'),_0x5cd1('0x30'),_0x55c5cc,'createdAt',_0x5cd1('0x32'),_0x5cd1('0x33'),_0x5cd1('0x34'),_0x5cd1('0x35')],squel['select']()[_0x5cd1('0x41')](_0x3753f6)['from'](_0x5854ef)[_0x5cd1('0x14')](_0x5cd1('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x5854ef+_0x5cd1('0x37'))[_0x5cd1('0x14')](_0x268eaf,null,_0x268eaf+'.id\x20=\x20'+_0x5854ef+'.'+_0x55c5cc)[_0x5cd1('0x14')](_0x2d884b,null,_0x2d884b+_0x5cd1('0x15')+_0x5854ef+'.'+_0x55c5cc)[_0x5cd1('0x16')](_0x5854ef+_0x5cd1('0x38'),_0xa3a123)[_0x5cd1('0x16')](_0x5cd1('0x39'),NOW)[_0x5cd1('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5854ef,_0x268eaf,_0x55c5cc,_0x5cd1('0x3b'),[_0x5cd1('0x3c'),_0x5cd1('0x3d')]))[_0x5cd1('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5854ef,_0x268eaf,_0x55c5cc,_0x5cd1('0x3b'),[_0x5cd1('0x3c')])))[_0x5cd1('0x3e')]();return _0x688faf;}function insertTzCmHopperBlack(_0x487014,_0x2f2a46,_0x451d72,_0x413917){var _0x47d466=[_0x5cd1('0x25'),_0x5cd1('0x27'),_0x5cd1('0x3f'),_0x2f2a46+'.'+_0x413917,_0x5cd1('0x28'),_0x5cd1('0x29')];return squel[_0x5cd1('0x2c')]()[_0x5cd1('0x45')]('cm_hopper_black')['fromQuery']([_0x5cd1('0x12'),_0x5cd1('0x2f'),_0x5cd1('0x30'),_0x413917,_0x5cd1('0x31'),_0x5cd1('0x32')],squel['select']()[_0x5cd1('0x41')](_0x47d466)[_0x5cd1('0x13')](_0x2f2a46)[_0x5cd1('0x14')](_0x5cd1('0x42'),null,_0x5cd1('0x36')+_0x2f2a46+_0x5cd1('0x37'))['join'](_0x451d72,null,_0x451d72+_0x5cd1('0x15')+_0x2f2a46+'.'+_0x413917)[_0x5cd1('0x16')](_0x2f2a46+_0x5cd1('0x38'),_0x487014)[_0x5cd1('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5cd1('0x16')](_0x5cd1('0x3a'),squel[_0x5cd1('0x10')]()[_0x5cd1('0x11')](_0x5cd1('0x12'))['from'](_0x5cd1('0x40'))[_0x5cd1('0x16')]('ListId\x20=\x20?',_0x487014)['where'](_0x413917+_0x5cd1('0x17')+_0x2f2a46+'.'+_0x413917)))['toString']();}function insertCmHopperAdditionalPhones(_0xfbef0f){var _0x2e5fb0=[_0x5cd1('0x46'),_0x5cd1('0x47'),_0x5cd1('0x48'),_0x5cd1('0x49'),_0x5cd1('0x4a')];return squel['insert']()[_0x5cd1('0x45')]('cm_hopper_additional_phones')[_0x5cd1('0x2d')](['CmHopperId','phone',_0x5cd1('0x4b'),_0x5cd1('0x31'),_0x5cd1('0x32')],squel[_0x5cd1('0x10')]()[_0x5cd1('0x41')](_0x2e5fb0)['from']('cm_hopper')[_0x5cd1('0x14')](_0x5cd1('0x42'),null,_0x5cd1('0x4c'))[_0x5cd1('0x14')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x5cd1('0x16')](_0x5cd1('0x4d'),_0xfbef0f)['where'](_0x5cd1('0x39'),NOW))[_0x5cd1('0x3e')]();}function insertCmContact(_0x17e210,_0xac1001,_0xd923dd,_0x300946){var _0x30393d=_[_0x5cd1('0x4e')](_['keys'](_0x300946),[_0x5cd1('0x30'),_0x5cd1('0x4f'),_0x5cd1('0x31'),'updatedAt']);return squel[_0x5cd1('0x2c')]()['into'](_0x5cd1('0x42'))[_0x5cd1('0x2d')](_0x30393d,squel[_0x5cd1('0x10')]()[_0x5cd1('0x41')](_0x30393d)[_0x5cd1('0x13')](_0xac1001)[_0x5cd1('0x16')]('('+_0xd923dd[_0x5cd1('0x14')](',')+')\x20NOT\x20IN\x20?',squel[_0x5cd1('0x10')]()[_0x5cd1('0x41')](_0xd923dd)[_0x5cd1('0x13')](_0x5cd1('0x42'))[_0x5cd1('0x16')](_0x5cd1('0x43'),_0x17e210)[_0x5cd1('0x16')](_0x5cd1('0x50')))[_0x5cd1('0x16')](_0x5cd1('0x51'),squel[_0x5cd1('0x10')]()[_0x5cd1('0x11')](_0x5cd1('0x52'),'min_id')['from'](_0xac1001)[_0x5cd1('0x53')](_0xd923dd[_0x5cd1('0x14')](','))))[_0x5cd1('0x3e')]();}function handleStop(){logger['info'](_0x5cd1('0x54'));stopped=!![];}function handleUncaughtException(_0x34bd5c){logger[_0x5cd1('0x55')](_0x34bd5c['message']);process[_0x5cd1('0x56')](0x1);}function handleError(_0x496461,_0x360592){stats[_0x5cd1('0x57')][_0x5cd1('0x1c')]({'name':_0x360592['code'],'message':_0x360592['message'],'row':_0x496461});}function handleQuery(_0x45ec69){logger[_0x5cd1('0x58')](_0x45ec69);return db[_0x5cd1('0x59')][_0x5cd1('0x5a')](_0x45ec69)[_0x5cd1('0x5b')](function(_0x1ae296){results['push'](_0x1ae296);})[_0x5cd1('0x5c')](function(_0x52d3a8){logger[_0x5cd1('0x55')](_0x52d3a8[_0x5cd1('0x5d')]);});}function updateTzCampaigns(_0x1a6870){return new Promise(function(_0x8b76b8,_0x15b7e9){var _0x54d7fe=squel[_0x5cd1('0x10')]()[_0x5cd1('0x41')](['campaigns.id',_0x5cd1('0x5e')])[_0x5cd1('0x13')](_0x5cd1('0x5f'))[_0x5cd1('0x14')](_0x5cd1('0x60'),null,_0x5cd1('0x61'))[_0x5cd1('0x16')](_0x5cd1('0x62')+_0x1a6870);db[_0x5cd1('0x59')][_0x5cd1('0x5a')](_0x54d7fe['toString']())[_0x5cd1('0x5b')](function(_0x57a63e){var _0x3adb02=[];for(var _0x759a5d=0x0;_0x759a5d<_0x57a63e[_0x5cd1('0x1b')];_0x759a5d++){_0x3adb02['push'](getTimezoneData(_0x57a63e[_0x759a5d],tmp_campaigns));}BPromise['all'](_0x3adb02)['then'](function(){_0x8b76b8({'val':0x1});});})[_0x5cd1('0x5c')](function(_0x379253){logger['error'](_0x379253[_0x5cd1('0x5d')]);_0x8b76b8({'val':0x0});});});}function updateTzVoiceQueues(_0x2dd6c8){return new Promise(function(_0x307f87,_0x2fb848){var _0x35fbb8=squel[_0x5cd1('0x10')]()['fields']([_0x5cd1('0x63'),_0x5cd1('0x64')])[_0x5cd1('0x13')](_0x5cd1('0x65'))['join'](_0x5cd1('0x66'),null,_0x5cd1('0x67'))[_0x5cd1('0x16')](_0x5cd1('0x68')+_0x2dd6c8);db['sequelize']['query'](_0x35fbb8[_0x5cd1('0x3e')]())[_0x5cd1('0x5b')](function(_0x3d1c5d){var _0x40dce3=[];for(var _0x252b7d=0x0;_0x252b7d<_0x3d1c5d[_0x5cd1('0x1b')];_0x252b7d++){_0x40dce3[_0x5cd1('0x1c')](getTimezoneData(_0x3d1c5d[_0x252b7d],tmp_voice_queues));}BPromise[_0x5cd1('0x1f')](_0x40dce3)['then'](function(){_0x307f87({'val':0x1});});})[_0x5cd1('0x5c')](function(_0x13a84b){logger['error'](_0x13a84b[_0x5cd1('0x5d')]);_0x307f87({'val':0x0});});});}function getTimezoneData(_0x53ea91,_0x575d60){return new Promise(function(_0x24a800,_0x5d5e35){var _0xfc7bd5=shared['timezones'];var _0x2a6ef8=_0xfc7bd5[_0x53ea91[_0x5cd1('0x69')]];if(_[_0x5cd1('0x6a')](_0x2a6ef8)){_0x24a800({'ret':0x1});}else{var _0x55c328=_0x2a6ef8[_0x5cd1('0x6b')];var _0x20695f=squel[_0x5cd1('0x2c')]()['into'](_0x575d60)[_0x5cd1('0x6c')]('id',_0x53ea91['id'])[_0x5cd1('0x6c')](_0x5cd1('0x6d'),_0x55c328)[_0x5cd1('0x6c')](_0x5cd1('0x69'),_0x53ea91[_0x5cd1('0x69')])[_0x5cd1('0x3e')]();return db[_0x5cd1('0x59')]['query'](_0x20695f)[_0x5cd1('0x5b')](function(_0x24489f){_0x24a800({'ret':0x1});})[_0x5cd1('0x5c')](function(_0x2f7bbf){logger[_0x5cd1('0x55')](_0x2f7bbf['message']);_0x5d5e35({'ret':0x1});});}});}function handleTZQuery(_0x32976b){logger['info'](_0x32976b);return db[_0x5cd1('0x59')][_0x5cd1('0x5a')](_0x32976b)[_0x5cd1('0x5b')](function(_0x293254){})['catch'](function(_0xaa7adf){logger['error'](_0xaa7adf[_0x5cd1('0x5d')]);});}function main(_0x18788f,_0x589bba,_0x20c203,_0x1c8c12){logger[_0x5cd1('0x58')](_0x5cd1('0x6e'),_0x18788f,JSON[_0x5cd1('0x6f')](_0x589bba));process[_0x5cd1('0x70')]('start');var _0x5e30f5=_0x589bba[_0x5cd1('0x71')];var _0xab41e4=_['clone'](_0x5e30f5);var _0x897eef=_0x589bba[_0x5cd1('0x72')];var _0x2bfb2f=path[_0x5cd1('0x14')](config['root'],_0x5cd1('0x73'),_0x897eef+_0x5cd1('0x74'));hasTZ=_[_0x5cd1('0x75')](_0x5e30f5)[_0x5cd1('0x76')](_0x5cd1('0x69'));var _0x82c77d=_[_0x5cd1('0x75')](_0x5e30f5)[_0x5cd1('0x14')]();logger[_0x5cd1('0x58')]('header',_0x82c77d);db[_0x5cd1('0x77')][_0x5cd1('0x19')]({'raw':!![],'attributes':['id',_0x5cd1('0x78')]})[_0x5cd1('0x1d')](function(_0x356d3c){for(var _0x35ad69=0x0;_0x35ad69<_0x356d3c['length'];_0x35ad69++){if(_0x356d3c[_0x35ad69][_0x5cd1('0x78')]in _0x5e30f5){contactItemTypes[_0x5cd1('0x1c')](_0x356d3c[_0x35ad69]);delete _0xab41e4[_0x356d3c[_0x35ad69]['name']];hasAdditionalPhones=!![];}for(var _0x476d35 in _0x5e30f5){if(_0x356d3c[_0x35ad69][_0x5cd1('0x78')]+_0x5cd1('0x79')===_0x476d35){phoneDescriptions[_0x5cd1('0x1c')]({'itemTypeId':_0x356d3c[_0x35ad69]['id'],'description':_0x476d35});delete _0xab41e4[_0x476d35];}}}if(hasAdditionalPhones)_0xab41e4[_0x5cd1('0x1a')]='';var _0xafb128=_[_0x5cd1('0x75')](_0xab41e4)[_0x5cd1('0x14')]();logger[_0x5cd1('0x58')](_0x5cd1('0x7a'),_0xafb128);fs[_0x5cd1('0x7b')](_0x2bfb2f,_0xafb128+'\x0a');Papa[_0x5cd1('0x7c')](fs['createReadStream'](_0x18788f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x30f3c4,_0x92a77d){try{for(var _0x3ebbcf=0x0,_0x23bf60=[];_0x3ebbcf<_0x30f3c4[_0x5cd1('0x7d')][_0x5cd1('0x1b')];_0x3ebbcf++){stats[_0x5cd1('0x7e')]+=0x1;if(_0x30f3c4[_0x5cd1('0x57')][_0x3ebbcf]){handleError(_0x30f3c4['data'][_0x3ebbcf],_0x30f3c4['errors'][_0x3ebbcf]);}else{var _0x565ad6=[];var _0x1e7369=[];var _0x25a661={};for(var _0x5d6b93 in _0x5e30f5){let _0x316677=contactItemTypes[_0x5cd1('0x7f')](_0x3b1b44=>_0x3b1b44['name']===_0x5d6b93);let _0x527474=contactItemTypes[_0x5cd1('0x7f')](_0x5c983f=>_0x5c983f[_0x5cd1('0x78')]+_0x5cd1('0x79')===_0x5d6b93);if(_[_0x5cd1('0x6a')](_0x316677)&&_[_0x5cd1('0x6a')](_0x527474)){if(_0x5e30f5['hasOwnProperty'](_0x5d6b93)){if(_0x30f3c4['data'][_0x3ebbcf][_0x5e30f5[_0x5d6b93]]){var _0x4f6b03=_[_0x5cd1('0x80')](_0x30f3c4[_0x5cd1('0x7d')][_0x3ebbcf][_0x5e30f5[_0x5d6b93]][_0x5cd1('0x81')](/"/g,'\x27'));switch(_0x5d6b93){case _0x5cd1('0x2e'):var _0x566534=moment(_0x4f6b03,_0x5cd1('0x82'),!![]);if(_0x566534[_0x5cd1('0x83')]()){_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x4f6b03+'\x22');}else{_0x565ad6[_0x5cd1('0x1c')](_0x5cd1('0x84'));}break;case _0x5cd1('0x33'):var _0x54a5a5=parseInt(_0x4f6b03);_0x4f6b03=_['isNaN'](_0x54a5a5)||_0x54a5a5<0x0||_0x54a5a5>0x4?_0x1c8c12?0x3:0x2:_0x54a5a5;_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x4f6b03+'\x22');break;case _0x5cd1('0x34'):var _0x7b7bc9=parseInt(_0x4f6b03);if(_['isNumber'](_0x7b7bc9)&&_[_0x5cd1('0x76')](_0x20c203,_0x7b7bc9)){_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x7b7bc9+'\x22');}else{_0x565ad6['push'](_0x5cd1('0x85'));}break;case _0x5cd1('0x86'):if(isEmail(_0x4f6b03)){_0x23bf60['push']('\x22'+_0x4f6b03+'\x22');}else{_0x565ad6['push'](_0x5cd1('0x87'));}break;case'dateOfBirth':var _0x180b79=moment(_0x4f6b03,'YYYY-MM-DD',!![]);if(_0x180b79[_0x5cd1('0x83')]()){_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x4f6b03+'\x22');}else{_0x565ad6[_0x5cd1('0x1c')](_0x5cd1('0x88'));}break;case _0x5cd1('0x69'):var _0x23d0cd=shared[_0x5cd1('0x89')];var _0x39bbea=_0x23d0cd[_0x4f6b03];if(!_[_0x5cd1('0x6a')](_0x39bbea)){var _0x9a97ce=_0x39bbea['utcOffset'];_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x4f6b03+'\x22');_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x9a97ce+'\x22');}break;default:_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x4f6b03+'\x22');}}else{switch(_0x5d6b93){case _0x5cd1('0x8a'):case _0x5cd1('0x12'):_0x565ad6['push'](_0x5d6b93+_0x5cd1('0x8b'));break;default:_0x23bf60[_0x5cd1('0x1c')]('\x22\x22');}}}}else{var _0x141a47='';if(!_[_0x5cd1('0x6a')](_0x316677)){if(!_0x25a661[_0x5cd1('0x8c')](_0x316677['id'])){if(!_[_0x5cd1('0x6a')](_0x30f3c4[_0x5cd1('0x7d')][_0x3ebbcf][_0x5e30f5[_0x5d6b93]])){var _0x4f6b03=_['trim'](_0x30f3c4['data'][_0x3ebbcf][_0x5e30f5[_0x5d6b93]][_0x5cd1('0x81')](/"/g,'\x27'));var _0x3b734f=phoneDescriptions['find'](_0x484bfa=>_0x484bfa['itemTypeId']===_0x316677['id']);if(!_['isNil'](_0x3b734f)){var _0x50d75f=_[_0x5cd1('0x80')](_0x30f3c4[_0x5cd1('0x7d')][_0x3ebbcf][_0x5e30f5[_0x3b734f[_0x5cd1('0x8d')]]]['replace'](/"/g,'\x27'));if(!_[_0x5cd1('0x6a')](_0x50d75f))_0x4f6b03=_0x4f6b03+'§'+_0x50d75f;}if(_0x141a47=='')_0x141a47=_0x4f6b03;else _0x141a47+='|'+_0x4f6b03;}_0x1e7369[_0x5cd1('0x1c')](_0x316677['id']+':'+_0x141a47);_0x25a661[_0x316677['id']]=0x1;}}}}if(hasAdditionalPhones){_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x1e7369[_0x5cd1('0x14')](';')+'\x22');}if(_0x565ad6[_0x5cd1('0x1b')]){handleError(_0x30f3c4[_0x5cd1('0x7d')][_0x3ebbcf],{'code':_0x5cd1('0x8e'),'message':_0x565ad6['join']()});}else{fs[_0x5cd1('0x8f')](_0x2bfb2f,_0x23bf60[_0x5cd1('0x14')]()+'\x0a');}_0x23bf60=[];}if(!(stats['rows']%0xc8)){socket[_0x5cd1('0x90')](_0x5cd1('0x91')+_0x897eef,stats);stats[_0x5cd1('0x57')]=[];}}if(stopped){logger[_0x5cd1('0x58')](_0x5cd1('0x92'));_0x92a77d[_0x5cd1('0x93')]();}}catch(_0x71c599){handleError(_0x30f3c4[_0x5cd1('0x7d')][_0x3ebbcf],{'code':_0x5cd1('0x94'),'message':_0x71c599[_0x5cd1('0x5d')]});logger[_0x5cd1('0x55')](_0x5cd1('0x95'),_0x71c599['message']);}},'complete':function(){try{var _0x25c2fc=[];var _0x2b82e8=[];var _0x3e58b1='cm_contacts';if(_0x589bba[_0x5cd1('0x96')]&&_0x589bba['duplicates']['length']){_0x3e58b1=_0x5cd1('0x97')+_0x897eef;_0x25c2fc[_0x5cd1('0x1c')](_0x5cd1('0x98')+_0x3e58b1+_0x5cd1('0x99'));}tmp_campaigns=_0x5cd1('0x9a')+_0x897eef;tmp_voice_queues=_0x5cd1('0x9b')+_0x897eef;_0x2b82e8[_0x5cd1('0x1c')](_0x5cd1('0x98')+tmp_campaigns+_0x5cd1('0x9c'));_0x2b82e8['push'](_0x5cd1('0x98')+tmp_voice_queues+_0x5cd1('0x9c'));BPromise[_0x5cd1('0x9d')](_0x2b82e8,handleTZQuery)['then'](function(_0x1b0a8e){updateTzCampaigns(_0x589bba[_0x5cd1('0x30')])['then'](function(_0x4bb74e){updateTzVoiceQueues(_0x589bba[_0x5cd1('0x30')])['then'](function(_0x29752d){if(hasTZ)_0xafb128=_0xafb128[_0x5cd1('0x81')](_0x5cd1('0x69'),_0x5cd1('0x9e'));var _0x1d92ad=util[_0x5cd1('0xf')](_0x5cd1('0x9f'),_0x2bfb2f,_0x3e58b1,_0xafb128,_0x589bba[_0x5cd1('0x30')],_0x589bba[_0x5cd1('0x4f')]||null,NOW,NOW);if(_[_0x5cd1('0x6a')](_0x5e30f5['scheduledat'])){_0x1d92ad+=_0x5cd1('0xa0');}_0x25c2fc[_0x5cd1('0x1c')](_0x1d92ad);if(_0x589bba[_0x5cd1('0x96')]&&_0x589bba['duplicates'][_0x5cd1('0x1b')]){_0x25c2fc[_0x5cd1('0x1c')](insertCmContact(_0x589bba[_0x5cd1('0x30')],_0x3e58b1,_0x589bba[_0x5cd1('0x96')],_0x5e30f5));_0x25c2fc[_0x5cd1('0x1c')](_0x5cd1('0xa1')+_0x3e58b1+';');}BPromise[_0x5cd1('0x9d')](_0x25c2fc,handleQuery)[_0x5cd1('0x1d')](function(_0x200e12){BPromise[_0x5cd1('0x1f')]([handleAdditionalPhones()])[_0x5cd1('0x1d')](function(){_0x25c2fc=[];for(var _0x5e60a0=0x0;_0x5e60a0_0x5b0823[_0x4179('0x66')]===_0x1f763f);let _0x12210a=contactItemTypes[_0x4179('0x6d')](_0x2aa597=>_0x2aa597[_0x4179('0x66')]+_0x4179('0x6e')===_0x1f763f);if(_[_0x4179('0x1c')](_0x7258d0)&&_[_0x4179('0x1c')](_0x12210a)){if(_0x4b46d2[_0x4179('0x6f')](_0x1f763f)){if(_0x256387[_0x4179('0x6b')][_0x15bc5f][_0x4b46d2[_0x1f763f]]){var _0x123ea8=_[_0x4179('0x70')](_0x256387[_0x4179('0x6b')][_0x15bc5f][_0x4b46d2[_0x1f763f]]['replace'](/"/g,'\x27'));switch(_0x1f763f){case _0x4179('0x32'):var _0x4fe343=moment(_0x123ea8,_0x4179('0x71'),!![]);if(_0x4fe343[_0x4179('0x72')]()){_0x4456e4['push']('\x22'+_0x123ea8+'\x22');}else{_0x23f2e8[_0x4179('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x4179('0x35'):var _0xa649af=parseInt(_0x123ea8);_0x123ea8=_[_0x4179('0x73')](_0xa649af)||_0xa649af<0x0||_0xa649af>0x4?_0x326ff2?0x3:0x2:_0xa649af;_0x4456e4[_0x4179('0x1e')]('\x22'+_0x123ea8+'\x22');break;case _0x4179('0x36'):var _0x28bce8=parseInt(_0x123ea8);if(_[_0x4179('0x74')](_0x28bce8)&&_[_0x4179('0x75')](_0x18468a,_0x28bce8)){_0x4456e4[_0x4179('0x1e')]('\x22'+_0x28bce8+'\x22');}else{_0x23f2e8[_0x4179('0x1e')](_0x4179('0x76'));}break;case _0x4179('0x77'):if(isEmail(_0x123ea8)){_0x4456e4[_0x4179('0x1e')]('\x22'+_0x123ea8+'\x22');}else{_0x23f2e8[_0x4179('0x1e')](_0x4179('0x78'));}break;case _0x4179('0x79'):var _0x4b2668=moment(_0x123ea8,_0x4179('0x7a'),!![]);if(_0x4b2668[_0x4179('0x72')]()){_0x4456e4[_0x4179('0x1e')]('\x22'+_0x123ea8+'\x22');}else{_0x23f2e8[_0x4179('0x1e')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4456e4['push']('\x22'+_0x123ea8+'\x22');}}else{switch(_0x1f763f){case'firstName':case _0x4179('0x12'):_0x23f2e8['push'](_0x1f763f+_0x4179('0x7b'));break;default:_0x4456e4[_0x4179('0x1e')]('\x22\x22');}}}}else{var _0x241b89='';if(!_[_0x4179('0x1c')](_0x7258d0)){if(!_0x41f054['hasOwnProperty'](_0x7258d0['id'])){for(var _0x4bfaa5=0x0;_0x4bfaa5<_0x4b46d2[_0x1f763f][_0x4179('0x1b')];_0x4bfaa5++){var _0x123ea8=_[_0x4179('0x70')](_0x256387['data'][_0x15bc5f][_0x4b46d2[_0x1f763f][_0x4bfaa5]][_0x4179('0x7c')](/"/g,'\x27'));var _0x3837a5=phoneDescriptions[_0x4179('0x6d')](_0x374bc8=>_0x374bc8[_0x4179('0x7d')]===_0x7258d0['id']);if(!_[_0x4179('0x1c')](_0x3837a5)){var _0x2c725d=_['trim'](_0x256387[_0x4179('0x6b')][_0x15bc5f][_0x4b46d2[_0x3837a5['description']][0x0]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x2c725d))_0x123ea8=_0x123ea8+'§'+_0x2c725d;}if(_0x241b89=='')_0x241b89=_0x123ea8;else _0x241b89+='|'+_0x123ea8;}_0x2764ff[_0x4179('0x1e')](_0x7258d0['id']+':'+_0x241b89);_0x41f054[_0x7258d0['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4456e4[_0x4179('0x1e')]('\x22'+_0x2764ff[_0x4179('0x13')](';')+'\x22');}if(_0x23f2e8[_0x4179('0x1b')]){handleError(_0x256387[_0x4179('0x6b')][_0x15bc5f],{'code':'SystemRow','message':_0x23f2e8[_0x4179('0x13')]()});}else{fs[_0x4179('0x7e')](_0x1a8a10,_0x4456e4['join']()+'\x0a');}_0x4456e4=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x437e46,stats);stats[_0x4179('0x59')]=[];}}if(stopped){logger[_0x4179('0x56')](_0x4179('0x7f'));_0xe273de[_0x4179('0x80')]();}}catch(_0x2995c3){handleError(_0x256387[_0x4179('0x6b')][_0x15bc5f],{'code':_0x4179('0x81'),'message':_0x2995c3['message']});logger['error']('step',_0x2995c3['message']);}},'complete':function(){try{var _0x1507d3=[];var _0x24d97e=tempTableName;_0x1507d3[_0x4179('0x1e')](_0x4179('0x82')+_0x24d97e+_0x4179('0x83'));logger[_0x4179('0x56')](_0x4179('0x84'),contactItemTypes[_0x4179('0x1b')]);var _0x2c6a08=util['format']('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',_0x1a8a10,_0x24d97e,_0x13c9ad,_0x26cf04[_0x4179('0x41')],_0x26cf04[_0x4179('0x52')]||null,NOW,NOW);if(_[_0x4179('0x1c')](_0x4b46d2[_0x4179('0x32')])){_0x2c6a08+=',\x20scheduledAt\x20=\x20NOW()';}_0x1507d3[_0x4179('0x1e')](_0x2c6a08);BPromise[_0x4179('0x85')](_0x1507d3,handleQuery)[_0x4179('0x1f')](function(_0x186e4d){BPromise[_0x4179('0x86')]([handleAdditionalPhones()])[_0x4179('0x1f')](function(){_0x1507d3=[];for(var _0x2300eb=0x0;_0x2300eb\x20\x20');}var _0x2d4407=path[_0x4179('0x13')](config[_0x4179('0x62')],_0x4179('0x92'),process['argv'][0x2]);if(!fs['existsSync'](_0x2d4407)){throw new Error(_0x4179('0x93'));}var _0x4e9444={};try{_0x4e9444=JSON['parse'](process[_0x4179('0x91')][0x3]);if(!_0x4e9444[_0x4179('0x60')]){throw new Error(_0x4179('0x94'));}var _0x1388a1=0x0;if(_0x4e9444[_0x4179('0x60')][_0x4179('0x36')]){_0x1388a1=0x1;}if(!_0x4e9444[_0x4179('0x41')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x1f5557){throw new Error(_0x4179('0x95'));}var _0x574bee=[];try{_0x574bee=_[_0x4179('0x96')](JSON[_0x4179('0x69')](process['argv'][0x4]),'id');}catch(_0x469b3f){logger[_0x4179('0x56')](_0x4179('0x97'));}main(_0x2d4407,_0x4e9444,_0x574bee,_0x1388a1);}validate();process['on']('SIGINT',handleStop);process['on'](_0x4179('0x98'),handleUncaughtException); \ No newline at end of file +var _0x8c50=['errors','data','find','hasOwnProperty','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','description','replace','contact:import:','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','each','finish','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','defaults','redis','socket.io-emitter','format','cm_contacts_temp_','test','select','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','phone','AdditionalPhones','push','all','then','catch','error','message','isNil','split','CmContactHasItem','update','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','insert','cm_hopper_black','cm_contacts.createdAt\x20=\x20?','field','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','code','main','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','ContactItemType','findAll','name','_description','header','parse','createReadStream','rows'];(function(_0x48ca1b,_0x107936){var _0x2258c2=function(_0x164b55){while(--_0x164b55){_0x48ca1b['push'](_0x48ca1b['shift']());}};_0x2258c2(++_0x107936);}(_0x8c50,0xcd));var _0x08c5=function(_0x268c91,_0x3b3f17){_0x268c91=_0x268c91-0x0;var _0x546b80=_0x8c50[_0x268c91];return _0x546b80;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x08c5('0x0'));var Papa=require(_0x08c5('0x1'));var util=require('util');var BPromise=require(_0x08c5('0x2'));var moment=require(_0x08c5('0x3'));var squel=require(_0x08c5('0x4'));var Redis=require(_0x08c5('0x5'));var db=require(_0x08c5('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x08c5('0x7'))('import');config['redis']=_[_0x08c5('0x8')](config[_0x08c5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x08c5('0xa'))(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()[_0x08c5('0xb')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x08c5('0xc')+moment()[_0x08c5('0xb')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x200935){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))*$/[_0x08c5('0xd')](_0x200935);}function selectNotIn(_0x472dba,_0x20d6b8,_0x11ef4b,_0x18c9a1,_0x41a1aa){return squel[_0x08c5('0xe')]()['field']('phone')[_0x08c5('0xf')](_0x18c9a1)[_0x08c5('0x10')](_0x20d6b8,null,_0x20d6b8+_0x08c5('0x11')+_0x18c9a1+'.'+_0x11ef4b)[_0x08c5('0x12')](_0x18c9a1+'.'+_0x11ef4b+'\x20=\x20'+_0x472dba+'.'+_0x11ef4b)[_0x08c5('0x12')](_0x20d6b8+_0x08c5('0x13')+_0x41a1aa[_0x08c5('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3e6a76,_0x431628){promisesAdditionalPhones=[];promisesContact=[];return db[_0x08c5('0x14')][_0x08c5('0x15')]('select\x20*\x20from\x20'+tempTableName)[_0x08c5('0x16')](function(_0x5c5db0){if(_0x5c5db0!==null){var _0xa589ce=[];for(var _0xc08175=0x0;_0xc08175<_0x5c5db0[_0x08c5('0x17')];_0xc08175++){var _0x30f727=_0x5c5db0[_0xc08175];if(!_['isNil'](_0x30f727[_0x08c5('0x18')])){if(!_['isNil'](_0x30f727[_0x08c5('0x19')]))_0xa589ce[_0x08c5('0x1a')](insertAdditionalPhones(_0x30f727));promisesContact[_0x08c5('0x1a')]({'contact':_0x30f727});}}}Promise[_0x08c5('0x1b')](_0xa589ce)[_0x08c5('0x1c')](function(){_0x3e6a76({'val':0x1});});})[_0x08c5('0x1d')](function(_0xb6b966){logger[_0x08c5('0x1e')](_0xb6b966[_0x08c5('0x1f')]);});});}function insertAdditionalPhones(_0x2e155c){return new Promise(function(_0x65bf0a,_0x273e7e){var _0xa0fe5e=_0x2e155c['AdditionalPhones'];if(_[_0x08c5('0x20')](_0xa0fe5e))_0x273e7e({'val':0x0});else{var _0x183842=_0xa0fe5e[_0x08c5('0x21')](';');var _0x490a9c=[];orderBy=0x0;for(var _0x187734=0x0;_0x187734<_0x183842[_0x08c5('0x17')];_0x187734++){_0x490a9c['push'](splitAdditionalPhone(_0x2e155c['id'],_0x183842[_0x187734]));}Promise[_0x08c5('0x1b')](_0x490a9c)[_0x08c5('0x1c')](function(){_0x65bf0a({'val':_0x183842[_0x08c5('0x17')]});});}});}function splitAdditionalPhone(_0x53ff91,_0x24f1e6){return new Promise(function(_0x1b1bfb,_0x36c109){var _0x51b761=_0x24f1e6[_0x08c5('0x21')](':');var _0x4bbf24=_0x51b761[0x0];var _0xdd372e=_0x51b761[0x1];if(_0xdd372e!==''){var _0x388db4=_0xdd372e[_0x08c5('0x21')]('|');var _0x5490e7=[];for(var _0x43d950=0x0;_0x43d950<_0x388db4[_0x08c5('0x17')];_0x43d950++){if(_0x388db4[_0x43d950]!==''){var _0x1b65e4=_['filter'](promisesAdditionalPhones,{'contactId':_0x53ff91,'phone':_0x388db4[_0x43d950]});if(_0x1b65e4['length']==0x0){orderBy++;promisesAdditionalPhones[_0x08c5('0x1a')]({'contactId':_0x53ff91,'contactTypeId':_0x4bbf24,'phone':_0x388db4[_0x43d950],'orderBy':orderBy});}}}_0x1b1bfb({'ok':0x1});}else _0x1b1bfb({'res':0x0});});}function createAdditionalPhone(_0x22c96,_0x4a1e1c,_0x4b78b3,_0x17b115){var _0x54a559='';var _0x3b3aff='';var _0x3b84c3=_0x4b78b3[_0x08c5('0x21')]('§');_0x54a559=_0x3b84c3[0x0];if(_0x3b84c3[_0x08c5('0x17')]==0x2)_0x3b3aff=_0x3b84c3[0x1];return new Promise(function(_0x4d0193,_0x277897){return db[_0x08c5('0x22')]['findOne']({'where':{'CmContactId':_0x22c96,'item':_0x54a559}})[_0x08c5('0x1c')](function(_0x10f054){if(_0x10f054){return db[_0x08c5('0x22')][_0x08c5('0x23')]({'ItemTypeId':_0x4a1e1c,'description':_0x3b3aff,'OrderBy':_0x17b115},{'where':{'CmContactId':_0x22c96,'item':_0x54a559}})[_0x08c5('0x1c')](function(_0x1d6f34){_0x4d0193({'res':'updated'});});}else{return db[_0x08c5('0x22')][_0x08c5('0x24')]({'CmContactId':_0x22c96,'item':_0x54a559,'ItemTypeId':_0x4a1e1c,'description':_0x3b3aff,'OrderBy':_0x17b115,'ItemClass':_0x08c5('0x25')})[_0x08c5('0x1c')](function(_0x145add){_0x4d0193({'res':_0x08c5('0x26')});});}});});}function updateContact(_0x1434b0){return new Promise(function(_0x3b0c80,_0x5bfcc6){var _0x5dfb26=_0x1434b0['id'];delete _0x1434b0['id'];return db[_0x08c5('0x27')][_0x08c5('0x23')](_0x1434b0,{'where':{'id':_0x5dfb26}})[_0x08c5('0x1c')](function(_0xa91fb0){updatedRows+=0x1;return db[_0x08c5('0x28')][_0x08c5('0x23')]({'phone':_0x1434b0[_0x08c5('0x18')]},{'where':{'ContactId':_0x5dfb26}})[_0x08c5('0x1c')](function(_0x5c5e67){_0x3b0c80({'ret':'OK'});});});});}function insertCmHopper(_0x34a048,_0x254bc6,_0x4a7b36,_0x4f29f6,_0x48b587){var _0x1dc264=[_0x08c5('0x29'),_0x08c5('0x2a'),_0x08c5('0x2b'),_0x08c5('0x2c'),_0x254bc6+'.'+_0x4f29f6,_0x08c5('0x2d'),_0x08c5('0x2e'),_0x08c5('0x2f'),_0x08c5('0x30'),'\x22'+_0x48b587+'\x22'];return squel['insert']()[_0x08c5('0x31')](_0x08c5('0x32'))[_0x08c5('0x33')](['phone',_0x08c5('0x34'),_0x08c5('0x35'),_0x08c5('0x36'),_0x4f29f6,_0x08c5('0x37'),_0x08c5('0x38'),'priority',_0x08c5('0x39'),_0x08c5('0x3a')],squel[_0x08c5('0xe')]()[_0x08c5('0x3b')](_0x1dc264)[_0x08c5('0xf')](_0x254bc6)[_0x08c5('0x10')](_0x08c5('0x3c'),null,_0x08c5('0x3d')+_0x254bc6+_0x08c5('0x3e'))['join'](_0x4a7b36,null,_0x4a7b36+'.id\x20=\x20'+_0x254bc6+'.'+_0x4f29f6)[_0x08c5('0x12')](_0x254bc6+_0x08c5('0x3f'),_0x34a048)[_0x08c5('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x08c5('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x254bc6,_0x4a7b36,_0x4f29f6,_0x08c5('0x32'),['\x22always\x22',_0x08c5('0x40')]))[_0x08c5('0x12')](_0x08c5('0x41'),selectNotIn(_0x254bc6,_0x4a7b36,_0x4f29f6,_0x08c5('0x32'),[_0x08c5('0x42')])))[_0x08c5('0x43')]();}function insertCmHopperBlack(_0xf0f65f,_0x29cbf6,_0x3bcfaa,_0x29b2b5){var _0x33f407=[_0x08c5('0x29'),_0x08c5('0x2b'),'cm_contacts.ListId',_0x29cbf6+'.'+_0x29b2b5,_0x08c5('0x2d'),_0x08c5('0x2e')];return squel[_0x08c5('0x44')]()[_0x08c5('0x31')](_0x08c5('0x45'))['fromQuery']([_0x08c5('0x18'),_0x08c5('0x35'),'ListId',_0x29b2b5,_0x08c5('0x37'),_0x08c5('0x38')],squel[_0x08c5('0xe')]()[_0x08c5('0x3b')](_0x33f407)[_0x08c5('0xf')](_0x29cbf6)[_0x08c5('0x10')](_0x08c5('0x3c'),null,_0x08c5('0x3d')+_0x29cbf6+_0x08c5('0x3e'))[_0x08c5('0x10')](_0x3bcfaa,null,_0x3bcfaa+_0x08c5('0x11')+_0x29cbf6+'.'+_0x29b2b5)['where'](_0x29cbf6+_0x08c5('0x3f'),_0xf0f65f)[_0x08c5('0x12')](_0x08c5('0x46'),NOW)['where'](_0x08c5('0x41'),squel[_0x08c5('0xe')]()[_0x08c5('0x47')](_0x08c5('0x18'))[_0x08c5('0xf')](_0x08c5('0x45'))['where'](_0x08c5('0x48'),_0xf0f65f)['where'](_0x29b2b5+'\x20=\x20?',_0x29cbf6+'.'+_0x29b2b5)))[_0x08c5('0x43')]();}function insertCmHopperAdditionalPhones(_0x354306){var _0x4ca47a=[_0x08c5('0x49'),'cm_contact_has_items.item',_0x08c5('0x4a'),'cm_contact_has_items.createdAt',_0x08c5('0x4b')];return squel[_0x08c5('0x44')]()[_0x08c5('0x31')](_0x08c5('0x4c'))[_0x08c5('0x33')]([_0x08c5('0x4d'),_0x08c5('0x18'),_0x08c5('0x4e'),_0x08c5('0x37'),_0x08c5('0x38')],squel['select']()[_0x08c5('0x3b')](_0x4ca47a)[_0x08c5('0xf')](_0x08c5('0x32'))[_0x08c5('0x10')](_0x08c5('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x08c5('0x10')](_0x08c5('0x4f'),null,_0x08c5('0x50'))[_0x08c5('0x12')](_0x08c5('0x51'),_0x354306)['where'](_0x08c5('0x46'),NOW))[_0x08c5('0x43')]();}function insertCmContact(_0x36ea43,_0x111c77,_0x201dac,_0x255e2e){var _0x5c04ba=_['concat'](_[_0x08c5('0x52')](_0x255e2e),[_0x08c5('0x36'),'CompanyId','createdAt',_0x08c5('0x38')]);return squel[_0x08c5('0x44')]()[_0x08c5('0x31')](_0x08c5('0x3c'))[_0x08c5('0x33')](_0x5c04ba,squel[_0x08c5('0xe')]()[_0x08c5('0x3b')](_0x5c04ba)[_0x08c5('0xf')](_0x111c77)[_0x08c5('0x12')]('('+_0x201dac[_0x08c5('0x10')](',')+_0x08c5('0x53'),squel[_0x08c5('0xe')]()[_0x08c5('0x3b')](_0x201dac)[_0x08c5('0xf')]('cm_contacts')[_0x08c5('0x12')](_0x08c5('0x48'),_0x36ea43))[_0x08c5('0x12')](_0x08c5('0x54'),squel[_0x08c5('0xe')]()[_0x08c5('0x47')](_0x08c5('0x55'),_0x08c5('0x56'))[_0x08c5('0xf')](_0x111c77)[_0x08c5('0x57')](_0x201dac[_0x08c5('0x10')](','))))[_0x08c5('0x43')]();}function handleStop(){logger[_0x08c5('0x58')](_0x08c5('0x59'));stopped=!![];}function handleUncaughtException(_0x1b04b6){logger['error'](_0x1b04b6[_0x08c5('0x1f')]);process[_0x08c5('0x5a')](0x1);}function handleError(_0x3a36f3,_0x1dc369){stats['errors'][_0x08c5('0x1a')]({'name':_0x1dc369[_0x08c5('0x5b')],'message':_0x1dc369['message'],'row':_0x3a36f3});}function handleQuery(_0x23f0e4){logger['info'](_0x23f0e4);return db['sequelize'][_0x08c5('0x15')](_0x23f0e4)[_0x08c5('0x16')](function(_0x7e9c82){results['push'](_0x7e9c82);})[_0x08c5('0x1d')](function(_0x2ad27e){logger[_0x08c5('0x1e')](_0x2ad27e[_0x08c5('0x1f')]);});}function main(_0x371759,_0xd28366,_0x2fd8d6,_0x21e3b5){logger[_0x08c5('0x58')](_0x08c5('0x5c'),_0x371759,JSON['stringify'](_0xd28366));process[_0x08c5('0x5d')](_0x08c5('0x5e'));var _0x18357c=_0xd28366[_0x08c5('0x5f')];var _0x8f6923=_[_0x08c5('0x60')](_0x18357c);var _0x36d94e=_0xd28366[_0x08c5('0x61')];var _0x150acb=path['join'](config[_0x08c5('0x62')],_0x08c5('0x63'),_0x36d94e+_0x08c5('0x64'));logger['info']('body',_0xd28366);db[_0x08c5('0x65')][_0x08c5('0x66')]({'raw':!![],'attributes':['id',_0x08c5('0x67')]})['then'](function(_0x1dc988){for(var _0xd1f943=0x0;_0xd1f943<_0x1dc988[_0x08c5('0x17')];_0xd1f943++){if(_0x1dc988[_0xd1f943]['name']in _0x18357c){contactItemTypes[_0x08c5('0x1a')](_0x1dc988[_0xd1f943]);delete _0x8f6923[_0x1dc988[_0xd1f943][_0x08c5('0x67')]];hasAdditionalPhones=!![];}for(var _0x42c593 in _0x18357c){if(_0x1dc988[_0xd1f943][_0x08c5('0x67')]+_0x08c5('0x68')===_0x42c593){phoneDescriptions['push']({'itemTypeId':_0x1dc988[_0xd1f943]['id'],'description':_0x42c593});delete _0x8f6923[_0x42c593];}}}if(hasAdditionalPhones)_0x8f6923[_0x08c5('0x19')]='';var _0x187b69=_['keys'](_0x8f6923)[_0x08c5('0x10')]();logger[_0x08c5('0x58')](_0x08c5('0x69'),_0x187b69);fs['writeFileSync'](_0x150acb,_0x187b69+'\x0a');Papa[_0x08c5('0x6a')](fs[_0x08c5('0x6b')](_0x371759),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2a62ab,_0x3dd0fe){try{for(var _0x29580b=0x0,_0x384c90=[];_0x29580b<_0x2a62ab['data'][_0x08c5('0x17')];_0x29580b++){stats[_0x08c5('0x6c')]+=0x1;if(_0x2a62ab[_0x08c5('0x6d')][_0x29580b]){handleError(_0x2a62ab[_0x08c5('0x6e')][_0x29580b],_0x2a62ab[_0x08c5('0x6d')][_0x29580b]);}else{var _0x33460f=[];var _0x273c93=[];var _0x2e2ef0={};for(var _0x26eb31 in _0x18357c){let _0x3e8396=contactItemTypes[_0x08c5('0x6f')](_0x2bc01e=>_0x2bc01e[_0x08c5('0x67')]===_0x26eb31);let _0x59c90d=contactItemTypes[_0x08c5('0x6f')](_0x4880ba=>_0x4880ba[_0x08c5('0x67')]+_0x08c5('0x68')===_0x26eb31);if(_['isNil'](_0x3e8396)&&_[_0x08c5('0x20')](_0x59c90d)){if(_0x18357c[_0x08c5('0x70')](_0x26eb31)){if(_0x2a62ab[_0x08c5('0x6e')][_0x29580b][_0x18357c[_0x26eb31]]){var _0x5c21d7=_[_0x08c5('0x71')](_0x2a62ab['data'][_0x29580b][_0x18357c[_0x26eb31]]['replace'](/"/g,'\x27'));switch(_0x26eb31){case _0x08c5('0x34'):var _0x5160f1=moment(_0x5c21d7,_0x08c5('0x72'),!![]);if(_0x5160f1[_0x08c5('0x73')]()){_0x384c90[_0x08c5('0x1a')]('\x22'+_0x5c21d7+'\x22');}else{_0x33460f[_0x08c5('0x1a')](_0x08c5('0x74'));}break;case _0x08c5('0x75'):var _0x313806=parseInt(_0x5c21d7);_0x5c21d7=_[_0x08c5('0x76')](_0x313806)||_0x313806<0x0||_0x313806>0x4?_0x21e3b5?0x3:0x2:_0x313806;_0x384c90[_0x08c5('0x1a')]('\x22'+_0x5c21d7+'\x22');break;case _0x08c5('0x39'):var _0x3071e5=parseInt(_0x5c21d7);if(_[_0x08c5('0x77')](_0x3071e5)&&_[_0x08c5('0x78')](_0x2fd8d6,_0x3071e5)){_0x384c90[_0x08c5('0x1a')]('\x22'+_0x3071e5+'\x22');}else{_0x33460f['push'](_0x08c5('0x79'));}break;case'email':if(isEmail(_0x5c21d7)){_0x384c90[_0x08c5('0x1a')]('\x22'+_0x5c21d7+'\x22');}else{_0x33460f['push'](_0x08c5('0x7a'));}break;case _0x08c5('0x7b'):var _0x253bd5=moment(_0x5c21d7,_0x08c5('0x7c'),!![]);if(_0x253bd5[_0x08c5('0x73')]()){_0x384c90[_0x08c5('0x1a')]('\x22'+_0x5c21d7+'\x22');}else{_0x33460f[_0x08c5('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x384c90['push']('\x22'+_0x5c21d7+'\x22');}}else{switch(_0x26eb31){case _0x08c5('0x7d'):case _0x08c5('0x18'):_0x33460f[_0x08c5('0x1a')](_0x26eb31+'\x20not\x20specified');break;default:_0x384c90[_0x08c5('0x1a')]('\x22\x22');}}}}else{var _0x2701a8='';if(!_['isNil'](_0x3e8396)){if(!_0x2e2ef0[_0x08c5('0x70')](_0x3e8396['id'])){for(var _0x693d3f=0x0;_0x693d3f<_0x18357c[_0x26eb31]['length'];_0x693d3f++){var _0x5c21d7=_[_0x08c5('0x71')](_0x2a62ab['data'][_0x29580b][_0x18357c[_0x26eb31][_0x693d3f]]['replace'](/"/g,'\x27'));var _0x2c3492=phoneDescriptions[_0x08c5('0x6f')](_0x58af85=>_0x58af85['itemTypeId']===_0x3e8396['id']);if(!_[_0x08c5('0x20')](_0x2c3492)){var _0x112a70=_[_0x08c5('0x71')](_0x2a62ab[_0x08c5('0x6e')][_0x29580b][_0x18357c[_0x2c3492[_0x08c5('0x7e')]][0x0]][_0x08c5('0x7f')](/"/g,'\x27'));if(!_[_0x08c5('0x20')](_0x112a70))_0x5c21d7=_0x5c21d7+'§'+_0x112a70;}if(_0x2701a8=='')_0x2701a8=_0x5c21d7;else _0x2701a8+='|'+_0x5c21d7;}_0x273c93[_0x08c5('0x1a')](_0x3e8396['id']+':'+_0x2701a8);_0x2e2ef0[_0x3e8396['id']]=0x1;}}}}if(hasAdditionalPhones){_0x384c90['push']('\x22'+_0x273c93[_0x08c5('0x10')](';')+'\x22');}if(_0x33460f[_0x08c5('0x17')]){handleError(_0x2a62ab[_0x08c5('0x6e')][_0x29580b],{'code':'SystemRow','message':_0x33460f['join']()});}else{fs['appendFileSync'](_0x150acb,_0x384c90[_0x08c5('0x10')]()+'\x0a');}_0x384c90=[];}if(!(stats[_0x08c5('0x6c')]%0xc8)){socket['emit'](_0x08c5('0x80')+_0x36d94e,stats);stats[_0x08c5('0x6d')]=[];}}if(stopped){logger[_0x08c5('0x58')](_0x08c5('0x81'));_0x3dd0fe['abort']();}}catch(_0x2c969e){handleError(_0x2a62ab[_0x08c5('0x6e')][_0x29580b],{'code':_0x08c5('0x82'),'message':_0x2c969e[_0x08c5('0x1f')]});logger[_0x08c5('0x1e')](_0x08c5('0x83'),_0x2c969e[_0x08c5('0x1f')]);}},'complete':function(){try{var _0x575651=[];var _0x32529a=tempTableName;_0x575651[_0x08c5('0x1a')](_0x08c5('0x84')+_0x32529a+_0x08c5('0x85'));logger['info'](_0x08c5('0x86'),contactItemTypes[_0x08c5('0x17')]);var _0x5b4de9=util[_0x08c5('0xb')](_0x08c5('0x87'),_0x150acb,_0x32529a,_0x187b69,_0xd28366[_0x08c5('0x36')],_0xd28366[_0x08c5('0x88')]||null,NOW,NOW);if(_[_0x08c5('0x20')](_0x18357c[_0x08c5('0x34')])){_0x5b4de9+=_0x08c5('0x89');}_0x575651[_0x08c5('0x1a')](_0x5b4de9);BPromise['each'](_0x575651,handleQuery)[_0x08c5('0x1c')](function(_0x46d55c){BPromise[_0x08c5('0x1b')]([handleAdditionalPhones()])[_0x08c5('0x1c')](function(){_0x575651=[];for(var _0x2c74b6=0x0;_0x2c74b6\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.to','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName'];(function(_0x1faa64,_0x27380c){var _0x3e01e1=function(_0x23d69e){while(--_0x23d69e){_0x1faa64['push'](_0x1faa64['shift']());}};_0x3e01e1(++_0x27380c);}(_0xfd28,0x148));var _0x8fd2=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0xfd28[_0x52b7b9];return _0x5b5d30;};'use strict';var _=require('lodash');var squel=require(_0x8fd2('0x0'));var as=require(_0x8fd2('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0x8fd2('0x2'))['updateInteraction'];var utils=require(_0x8fd2('0x3'));var db=require(_0x8fd2('0x4'))['db'];function skipInteractionsQuery(_0x4e2108,_0x4b22ae,_0x155f46){var _0x2f694f=![];var _0x2ee87e=utils[_0x8fd2('0x5')](_0x4e2108);if(_0x4b22ae[_0x8fd2('0x6')]==='agent'&&!_0x155f46['search']&&!_0x155f46[_0x2ee87e]){_0x2f694f=!![];}return _0x2f694f;}function getTagsQuery(){return squel[_0x8fd2('0x7')]()[_0x8fd2('0x8')]('id')[_0x8fd2('0x8')]('name')[_0x8fd2('0x8')]('color')[_0x8fd2('0x9')]('tools_tags');}function getUsersQuery(_0x34ae5c,_0x4fdf0b){var _0x1ca2a1=utils['getInteractionFK'](_0x34ae5c);var _0x1b6558='user_has_'+_0x34ae5c+_0x8fd2('0xa');var _0x207298=squel[_0x8fd2('0x7')]()[_0x8fd2('0x8')](_0x8fd2('0xb'))[_0x8fd2('0x8')](_0x8fd2('0xc'))[_0x8fd2('0x8')](_0x8fd2('0xd')+_0x1ca2a1)[_0x8fd2('0x9')](_0x1b6558,'ui')[_0x8fd2('0xe')](_0x8fd2('0xf'),'u',_0x8fd2('0x10'));if(_0x4fdf0b[_0x8fd2('0x11')]>0x0){_0x207298[_0x8fd2('0x12')]('ui.'+_0x1ca2a1+_0x8fd2('0x13'),_['map'](_0x4fdf0b,'id'));}return _0x207298;}function getInteractionsQuery(_0x4f0b17){var _0x56f75d=utils[_0x8fd2('0x14')](_0x4f0b17);var _0x530866=utils[_0x8fd2('0x5')](_0x4f0b17);var _0x12e8a3=utils['getInteractionFK'](_0x4f0b17);return squel[_0x8fd2('0x7')]()[_0x8fd2('0x9')](_0x56f75d[_0x8fd2('0x15')],'i')[_0x8fd2('0xe')](_0x8fd2('0x16'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x8fd2('0xf'),'o','o.id\x20=\x20i.UserId')[_0x8fd2('0xe')](_0x56f75d['accounts'],'a',_0x8fd2('0x17')+_0x530866)[_0x8fd2('0xe')](_0x56f75d['messages'],'me',_0x8fd2('0x18')+_0x12e8a3+'\x20=\x20i.id')[_0x8fd2('0xe')](_0x56f75d[_0x8fd2('0x19')],'it','it.'+_0x12e8a3+_0x8fd2('0x1a'))[_0x8fd2('0xe')](_0x8fd2('0x1b'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x299c1c={'body':squel[_0x8fd2('0x1c')](),'contact':squel[_0x8fd2('0x1c')](),'default':squel[_0x8fd2('0x1c')](),'fields':squel[_0x8fd2('0x1c')](),'filter':squel[_0x8fd2('0x1c')](),'read':squel[_0x8fd2('0x1c')](),'tags':{'clause':squel[_0x8fd2('0x1c')](),'ids':null},'user':squel[_0x8fd2('0x1c')]()};return _0x299c1c;}function parseTagParameter(_0xbc5945){var _0x3392fb=squel[_0x8fd2('0x1c')]();if(_0xbc5945){var _0x3f16a3=utils['getSelectedTags'](_0xbc5945);_0x3f16a3['forEach'](function(_0x345bc3){_0x3392fb['or'](_0x8fd2('0x1d'),'%,'+_0x345bc3+',%');});}return _0x3392fb;}function parseReadParameter(_0x288bcd){var _0x56f294='';if(_0x288bcd){_0x56f294=_0x8fd2('0x1e');if(_0x288bcd==='1'){_0x56f294=_0x56f294[_0x8fd2('0x1f')](_0x8fd2('0x20'),'=');}else{_0x56f294=_0x56f294[_0x8fd2('0x1f')](_0x8fd2('0x20'),'>');}}return _0x56f294;}function parseSearchFilter(_0x4745bf,_0x332ab0){var _0x5bfaa4=squel[_0x8fd2('0x1c')]();if(_0x332ab0){var _0x13c9b9=_0x332ab0[_0x8fd2('0x1f')]('\x5c','\x5c\x5c')[_0x8fd2('0x1f')](/'/g,'\x27\x27');if(qs[_0x8fd2('0x21')](_0x13c9b9)){_0x5bfaa4['or'](_0x8fd2('0x22'),_0x13c9b9+'%');if([_0x8fd2('0x23'),'whatsapp']['includes'](_0x4745bf)){_0x5bfaa4['or']('i.phone\x20LIKE\x20?',_0x13c9b9+'%');}else if(_0x4745bf===_0x8fd2('0x24')){_0x5bfaa4['or'](_0x8fd2('0x25'),_0x13c9b9+'%');}else if(_0x4745bf===_0x8fd2('0x26')){_0x5bfaa4['or'](_0x8fd2('0x27'),_0x13c9b9+'%');}}else if(_0x4745bf==='mail'&&qs['isEmail'](_0x13c9b9)){_0x5bfaa4['or'](_0x8fd2('0x28'),_0x13c9b9+'%');}else{if(_0x4745bf===_0x8fd2('0x29')){_0x5bfaa4['or'](_0x8fd2('0x2a'),qs[_0x8fd2('0x2b')](_0x13c9b9))['or'](_0x8fd2('0x2c'),qs['getFullTextValue'](_0x13c9b9));}else{if(_0x4745bf!==_0x8fd2('0x24')){_0x5bfaa4['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8fd2('0x2b')](_0x13c9b9));}_0x5bfaa4['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x13c9b9+'%');}}}return _0x5bfaa4;}function parseAdvancedSearchFilter(_0x445b67,_0x4d9faa){var _0x134420=getSqlClauses();var _0x3449b1=as[_0x8fd2('0x2d')](_0x445b67);var _0x52422c=_0x3449b1[_0x8fd2('0x2e')];for(var _0x4e7f72=0x0;_0x4e7f72<_0x3449b1[_0x8fd2('0x2f')][_0x8fd2('0x11')];_0x4e7f72++){var _0x290c62=_0x3449b1['conditions'][_0x4e7f72];var _0x14f382='i';var _0x199a85=_[_0x8fd2('0x30')](_0x4d9faa,['name',_0x290c62[_0x8fd2('0x8')]]);if(_0x199a85){var _0x1f4428=as[_0x8fd2('0x31')](_0x14f382,_0x199a85['type'],_0x290c62);_0x134420[_0x8fd2('0x32')][_0x52422c](_0x1f4428[_0x8fd2('0x33')],_0x1f4428['value'][_0x8fd2('0x34')],_0x1f4428[_0x8fd2('0x35')][_0x8fd2('0x36')]);}else{switch(_0x290c62[_0x8fd2('0x8')]){case _0x8fd2('0x37'):var _0x35cbec=parseReadParameter(_0x290c62[_0x8fd2('0x35')]);_0x134420['read'][_0x8fd2('0x38')](_0x35cbec);break;case'Contact':if(_0x290c62['operator']===_0x8fd2('0x39')){if(_0x290c62[_0x8fd2('0x35')][_0x8fd2('0x3a')]('\x20')[_0x8fd2('0x11')]>0x1){_0x134420[_0x8fd2('0x3b')][_0x52422c](_0x8fd2('0x3c'),qs['getFullTextValue'](_0x290c62['value']),null);}else{var _0x2df1da='%'+_0x290c62['value']+'%';_0x134420['contact'][_0x52422c](_0x8fd2('0x3d'),_0x2df1da,_0x2df1da,_0x2df1da);}}else{_0x199a85=_[_0x8fd2('0x30')](_0x4d9faa,[_0x8fd2('0x3e'),_0x8fd2('0x3f')]);_0x290c62['field']=_0x8fd2('0x3f');_0x1f4428=as[_0x8fd2('0x31')](_0x14f382,_0x199a85[_0x8fd2('0x40')],_0x290c62);_0x134420[_0x8fd2('0x3b')][_0x52422c](_0x1f4428[_0x8fd2('0x33')],_0x1f4428[_0x8fd2('0x35')][_0x8fd2('0x34')],_0x1f4428['value'][_0x8fd2('0x36')]);}break;case _0x8fd2('0x41'):var _0x18eef9=_0x290c62[_0x8fd2('0x35')][_0x8fd2('0x3a')](',')[_0x8fd2('0x42')](function(_0x40a572){return Number(_0x40a572);});var _0x5ab7cf=parseTagParameter(_0x18eef9);_0x134420[_0x8fd2('0x43')][_0x8fd2('0x44')][_0x8fd2('0x38')](_0x5ab7cf);_0x134420[_0x8fd2('0x43')][_0x8fd2('0x45')]=_0x18eef9;break;case _0x8fd2('0x46'):if(_0x290c62[_0x8fd2('0x47')]==='$substring'){_0x134420[_0x8fd2('0x48')][_0x52422c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x290c62[_0x8fd2('0x35')]+'%',null);}else{_0x199a85=_['find'](_0x4d9faa,[_0x8fd2('0x3e'),_0x8fd2('0x49')]);_0x290c62[_0x8fd2('0x8')]='UserId';_0x1f4428=as[_0x8fd2('0x31')](_0x14f382,_0x199a85[_0x8fd2('0x40')],_0x290c62);_0x134420[_0x8fd2('0x48')][_0x52422c](_0x1f4428['text'],_0x1f4428[_0x8fd2('0x35')]['start'],_0x1f4428[_0x8fd2('0x35')][_0x8fd2('0x36')]);}break;case _0x8fd2('0x4a'):case _0x8fd2('0x4b'):_0x1f4428=as[_0x8fd2('0x31')]('me',null,_0x290c62);_0x134420[_0x8fd2('0x4a')][_0x52422c](_0x1f4428[_0x8fd2('0x33')],_0x1f4428[_0x8fd2('0x35')][_0x8fd2('0x34')],_0x1f4428[_0x8fd2('0x35')][_0x8fd2('0x36')]);break;}}}return _0x134420;}function parseModelFields(_0x34f3a2,_0xd3d8cb,_0x3d65bc){var _0x109d49=utils[_0x8fd2('0x5')](_0x34f3a2);var _0x385a95=squel[_0x8fd2('0x1c')]();var _0x2fdbe5=_(_0xd3d8cb)['keys']()['map'](function(_0x43a9a8){return _[_0x8fd2('0x4c')](_0x3d65bc,[_0x8fd2('0x3e'),_0x43a9a8])?_0x43a9a8:undefined;})['compact']()['value']();if(_0x2fdbe5[_0x8fd2('0x11')]>0x0){_0x2fdbe5['forEach'](function(_0x2f61a5){if(_0x2f61a5===_0x109d49){_0x385a95[_0x8fd2('0x38')]('i.'+_0x109d49+_0x8fd2('0x13'),[]['concat'](_0xd3d8cb[_0x2f61a5]));}else if(_0x2f61a5===_0x8fd2('0x4d')){var _0x1ec30e=JSON['parse'](_0xd3d8cb[_0x2f61a5])[_0x8fd2('0x4e')];var _0x27f5a2=JSON[_0x8fd2('0x4f')](_0xd3d8cb[_0x2f61a5])['$lte'];_0x385a95[_0x8fd2('0x38')](_0x8fd2('0x50'),_0x1ec30e,_0x27f5a2);}else{if(_0xd3d8cb[_0x2f61a5]===_0x8fd2('0x51')){_0x385a95[_0x8fd2('0x38')]('i.'+_0x2f61a5+_0x8fd2('0x52'));}else{_0x385a95[_0x8fd2('0x38')]('i.'+_0x2f61a5+'\x20=\x20?',_0xd3d8cb[_0x2f61a5]);}}});}return _0x385a95;}function parseQueryParameters(_0x4d5340,_0x46a1a1,_0x8c11e8){var _0x508957=getSqlClauses();return Promise[_0x8fd2('0x53')]()['then'](function(){return parseModelFields(_0x4d5340,_0x46a1a1,_0x8c11e8);})['then'](function(_0x2ef7e6){_0x508957[_0x8fd2('0x54')][_0x8fd2('0x38')](_0x2ef7e6);return parseReadParameter(_0x46a1a1[_0x8fd2('0x55')]);})[_0x8fd2('0x56')](function(_0x3de5b1){_0x508957['read'][_0x8fd2('0x38')](_0x3de5b1);return parseTagParameter(_0x46a1a1[_0x8fd2('0x57')]);})[_0x8fd2('0x56')](function(_0x930a07){_0x508957[_0x8fd2('0x43')]['clause']['and'](_0x930a07);return parseSearchFilter(_0x4d5340,_0x46a1a1['filter']);})['then'](function(_0x57b8f6){_0x508957[_0x8fd2('0x58')]=_0x57b8f6;return _0x508957;});}function checkAccountsRestrictions(_0x382154,_0x18ee30,_0x2988d0){var _0x21696c=utils[_0x8fd2('0x5')](_0x382154);var _0x460f31='get'+_[_0x8fd2('0x59')](_0x382154)+(_0x382154==='chat'?_0x8fd2('0x5a'):_0x8fd2('0x5b'));var _0x478aad=squel['expr']();return Promise[_0x8fd2('0x53')]()[_0x8fd2('0x56')](function(){if(_0x2988d0[_0x8fd2('0x5c')]&&_0x18ee30[_0x8fd2('0x6')]===_0x8fd2('0x5d')){return _0x18ee30[_0x460f31]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x2196d3){if(_0x2196d3){if(_0x2196d3[_0x8fd2('0x11')]===0x0){_0x478aad[_0x8fd2('0x38')]('i.'+_0x21696c+_0x8fd2('0x52'));}else{_0x478aad['and']('i.'+_0x21696c+_0x8fd2('0x13'),_[_0x8fd2('0x42')](_0x2196d3,'id'));}}else if(!_0x2988d0[_0x21696c]){_0x478aad[_0x8fd2('0x38')]('i.'+_0x21696c+_0x8fd2('0x5e'));}})['then'](function(){return _0x478aad;});}function getClosedOrderClause(_0x4e2b22,_0x5e142f){var _0x2e5693='';var _0x19e68d=[_0x8fd2('0x5f'),_0x8fd2('0x60'),_0x8fd2('0x61')];if(_0x4e2b22==='mail'){_0x19e68d[_0x8fd2('0x62')](_0x8fd2('0x63'));}if(_0x5e142f['closed']==='0'&&_0x4e2b22===_0x8fd2('0x29')){_0x2e5693=_0x8fd2('0x63');}else{if(_0x5e142f[_0x8fd2('0x64')]==='1'){_0x19e68d[_0x8fd2('0x65')]();}_0x2e5693=_0x8fd2('0x66')+_0x19e68d['join'](',\x20')+')';}return _0x2e5693;}function getFilteredInteractions(_0x428034,_0x3408ff,_0x21f1a7,_0x4606f7){var _0x437736=utils[_0x8fd2('0x67')](_0x428034);var _0x172933=_[_0x8fd2('0x59')](_0x428034)+_0x8fd2('0x68');var _0x4680f0=[];var _0xf7c83a=getTagsQuery();var _0x4d0402={'type':db[_0x8fd2('0x69')]['QueryTypes'][_0x8fd2('0x6a')],'raw':!![]};var _0x237756=[];var _0x4b043d=[];return db['sequelize']['query'](_0xf7c83a[_0x8fd2('0x6b')](),_0x4d0402)[_0x8fd2('0x56')](function(_0x2f462d){_0x4680f0=_[_0x8fd2('0x6c')](_0x2f462d,'id');_0x4d0402=_[_0x8fd2('0x6d')](_0x4d0402,{'model':db[_0x172933],'mapToModel':!![],'nest':!![]});if(_0x21f1a7[_0x8fd2('0x54')]){_0x4606f7['attributes'][_0x8fd2('0x6e')](function(_0x385321){_0x3408ff['field']('i.'+_0x385321);});}else{_0x3408ff[_0x8fd2('0x8')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8fd2('0x37'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x6f'),_0x8fd2('0x70'));_0x3408ff[_0x8fd2('0x8')]('a.mandatoryDisposition',_0x8fd2('0x71'));if(_0x428034===_0x8fd2('0x29')){_0x3408ff['field'](_0x8fd2('0x72'),'Account.email');_0x3408ff['field'](_0x8fd2('0x73'),_0x8fd2('0x74'));_0x3408ff['field'](_0x8fd2('0x75'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x76'));_0x3408ff['field'](_0x8fd2('0x77'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x78'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x79'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x7a'));_0x3408ff['field']('i.lastMsgAt');_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x7b'));_0x3408ff['field']('i.subject');_0x3408ff['field']('i.disposition');_0x3408ff['field'](_0x8fd2('0x60'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x5f'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x63'));_0x3408ff['field'](_0x8fd2('0x7c'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x7d'));_0x3408ff['field'](_0x8fd2('0x7e'));_0x3408ff[_0x8fd2('0x8')]('i.UserId');}else if(_0x428034===_0x8fd2('0x26')){_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x7f'),_0x8fd2('0x74'));}else{_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x80'),_0x8fd2('0x74'));}if(_0x428034!=='mail'){_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x81'));}_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x82'),_0x8fd2('0x83'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x84'),'Contact.lastName');_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x85'),'Contact.email');_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x86'),_0x8fd2('0x87'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x88'),_0x8fd2('0x89'));_0x3408ff[_0x8fd2('0x8')](_0x8fd2('0x8a'),'Contact.fax');_0x3408ff[_0x8fd2('0x8')]('o.fullname','Owner.fullname');_0x3408ff['field'](_0x8fd2('0x8b'),'Owner.internal');_0x3408ff[_0x8fd2('0x8')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4606f7[_0x8fd2('0x8c')]){_0x3408ff[_0x8fd2('0x8c')](_0x4606f7['limit']);}if(_0x4606f7[_0x8fd2('0x8d')]){_0x3408ff[_0x8fd2('0x8d')](_0x4606f7[_0x8fd2('0x8d')]);}return db[_0x8fd2('0x8e')]['query'](_0x3408ff['toString'](),_0x4d0402);})[_0x8fd2('0x56')](function(_0x53fb5a){_0x237756=_0x53fb5a;var _0x2b9e53=getUsersQuery(_0x428034,_0x237756);return db[_0x8fd2('0x8e')]['query'](_0x2b9e53[_0x8fd2('0x6b')](),_0x4d0402);})[_0x8fd2('0x56')](function(_0x415e56){_0x4b043d=_[_0x8fd2('0x8f')](_0x415e56,_0x437736);if(_0x428034===_0x8fd2('0x29')){return db[_0x8fd2('0x90')][_0x8fd2('0x91')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x8fd2('0x56')](function(_0x140c62){var _0x116a67=_0x140c62?_0x140c62[_0x8fd2('0x92')]:undefined;var _0x47ac94=_0x237756[_0x8fd2('0x42')](function(_0xad6e29){return updateInteraction(_0xad6e29,_0x4680f0,_0x4b043d,_0x116a67);});return Promise[_0x8fd2('0x93')](_0x47ac94);});}function countFilteredInteractions(_0x392198,_0x57cef4){var _0x4d229a=_0x392198[_0x8fd2('0x94')]();_0x4d229a['field']('COUNT(*)');_0x4d229a[_0x8fd2('0x8')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x2710a5=utils[_0x8fd2('0x95')](_0x57cef4);if(!_[_0x8fd2('0x96')](_0x2710a5)){_0x4d229a[_0x8fd2('0x12')](_0x8fd2('0x97'),_0x2710a5);}var _0x13b7c9={'type':db[_0x8fd2('0x69')]['QueryTypes'][_0x8fd2('0x6a')],'raw':!![]};return db[_0x8fd2('0x8e')][_0x8fd2('0x98')](_0x4d229a[_0x8fd2('0x6b')](),_0x13b7c9);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x8664=['expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','buildExpression','type','start','end','unreadMessages','value','read','and','Contact','operator','$substring','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','text','Tag','tags','clause','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','body','some','compact','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','resolve','fields','tag','then','filter','get','chat','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','closed','shift','CONCAT_WS(\x27\x27,\x20','join','capitalize','Interaction','Sequelize','SELECT','sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.substatus','i.to','i.ContactId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','query','toString','groupBy','Setting','findOne','enableEmailPreview','clone','isEmpty','QueryTypes','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','getInteractionFK','u.id','u.fullname','left_join','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','interactionsTags','it.','\x20=\x20i.id','tools_tags'];(function(_0x4491e5,_0x3aead){var _0x4cf0e3=function(_0x51484c){while(--_0x51484c){_0x4491e5['push'](_0x4491e5['shift']());}};_0x4cf0e3(++_0x3aead);}(_0x8664,0x11a));var _0x4866=function(_0x4684e6,_0x353bfd){_0x4684e6=_0x4684e6-0x0;var _0x4a5336=_0x8664[_0x4684e6];return _0x4a5336;};'use strict';var _=require(_0x4866('0x0'));var squel=require(_0x4866('0x1'));var as=require(_0x4866('0x2'));var qs=require(_0x4866('0x3'));var updateInteraction=require(_0x4866('0x4'))[_0x4866('0x5')];var utils=require(_0x4866('0x6'));var db=require(_0x4866('0x7'))['db'];function skipInteractionsQuery(_0x16a88f,_0x4a2986,_0x1d8d7a){var _0x595c9d=![];var _0x66b444=utils[_0x4866('0x8')](_0x16a88f);if(_0x4a2986[_0x4866('0x9')]===_0x4866('0xa')&&!_0x1d8d7a[_0x4866('0xb')]&&!_0x1d8d7a[_0x66b444]){_0x595c9d=!![];}return _0x595c9d;}function getTagsQuery(){return squel[_0x4866('0xc')]()['field']('id')[_0x4866('0xd')](_0x4866('0xe'))[_0x4866('0xd')](_0x4866('0xf'))[_0x4866('0x10')]('tools_tags');}function getUsersQuery(_0x35dab1,_0x61028f){var _0x5f21ba=utils[_0x4866('0x11')](_0x35dab1);var _0x3d80c7='user_has_'+_0x35dab1+'_interactions';var _0x47a50e=squel[_0x4866('0xc')]()[_0x4866('0xd')](_0x4866('0x12'))[_0x4866('0xd')](_0x4866('0x13'))[_0x4866('0xd')]('ui.'+_0x5f21ba)[_0x4866('0x10')](_0x3d80c7,'ui')[_0x4866('0x14')]('users','u',_0x4866('0x15'));if(_0x61028f[_0x4866('0x16')]>0x0){_0x47a50e[_0x4866('0x17')](_0x4866('0x18')+_0x5f21ba+_0x4866('0x19'),_[_0x4866('0x1a')](_0x61028f,'id'));}return _0x47a50e;}function getInteractionsQuery(_0x373888){var _0x653916=utils[_0x4866('0x1b')](_0x373888);var _0x56ba1f=utils['getAccountFK'](_0x373888);var _0x423490=utils[_0x4866('0x11')](_0x373888);return squel[_0x4866('0xc')]()['from'](_0x653916['interactions'],'i')[_0x4866('0x14')](_0x4866('0x1c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x4866('0x14')]('users','o',_0x4866('0x1d'))['left_join'](_0x653916[_0x4866('0x1e')],'a',_0x4866('0x1f')+_0x56ba1f)[_0x4866('0x14')](_0x653916[_0x4866('0x20')],'me',_0x4866('0x21')+_0x423490+'\x20=\x20i.id')['left_join'](_0x653916[_0x4866('0x22')],'it',_0x4866('0x23')+_0x423490+_0x4866('0x24'))['left_join'](_0x4866('0x25'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x4a16d1={'body':squel[_0x4866('0x26')](),'contact':squel[_0x4866('0x26')](),'default':squel['expr'](),'fields':squel[_0x4866('0x26')](),'filter':squel[_0x4866('0x26')](),'read':squel[_0x4866('0x26')](),'tags':{'clause':squel[_0x4866('0x26')](),'ids':null},'user':squel[_0x4866('0x26')]()};return _0x4a16d1;}function parseTagParameter(_0x2b5557){var _0x1a1813=squel[_0x4866('0x26')]();if(_0x2b5557){var _0x43c4e2=utils[_0x4866('0x27')](_0x2b5557);_0x43c4e2[_0x4866('0x28')](function(_0x58f5f4){_0x1a1813['or'](_0x4866('0x29'),'%,'+_0x58f5f4+',%');});}return _0x1a1813;}function parseReadParameter(_0x3f8632){var _0xa371d1='';if(_0x3f8632){_0xa371d1=_0x4866('0x2a');if(_0x3f8632==='1'){_0xa371d1=_0xa371d1[_0x4866('0x2b')](_0x4866('0x2c'),'=');}else{_0xa371d1=_0xa371d1[_0x4866('0x2b')](_0x4866('0x2c'),'>');}}return _0xa371d1;}function parseSearchFilter(_0x21a7f9,_0x194b87){var _0x18dedf=squel[_0x4866('0x26')]();if(_0x194b87){var _0x2dc47f=_0x194b87[_0x4866('0x2b')]('\x5c','\x5c\x5c')[_0x4866('0x2b')](/'/g,'\x27\x27');if(qs[_0x4866('0x2d')](_0x2dc47f)){_0x18dedf['or'](_0x4866('0x2e'),_0x2dc47f+'%');if([_0x4866('0x2f'),_0x4866('0x30')][_0x4866('0x31')](_0x21a7f9)){_0x18dedf['or'](_0x4866('0x32'),_0x2dc47f+'%');}else if(_0x21a7f9===_0x4866('0x33')){_0x18dedf['or']('i.fax\x20LIKE\x20?',_0x2dc47f+'%');}else if(_0x21a7f9==='openchannel'){_0x18dedf['or'](_0x4866('0x34'),_0x2dc47f+'%');}}else if(_0x21a7f9===_0x4866('0x35')&&qs[_0x4866('0x36')](_0x2dc47f)){_0x18dedf['or'](_0x4866('0x37'),_0x2dc47f+'%');}else{if(_0x21a7f9===_0x4866('0x35')){_0x18dedf['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4866('0x38')](_0x2dc47f))['or'](_0x4866('0x39'),qs[_0x4866('0x38')](_0x2dc47f));}else{if(_0x21a7f9!==_0x4866('0x33')){_0x18dedf['or'](_0x4866('0x3a'),qs['getFullTextValue'](_0x2dc47f));}_0x18dedf['or'](_0x4866('0x3b'),_0x2dc47f+'%');}}}return _0x18dedf;}function parseAdvancedSearchFilter(_0x4055f0,_0x398201){var _0x42d92d=getSqlClauses();var _0x2858fb=as[_0x4866('0x3c')](_0x4055f0);var _0x3b5505=_0x2858fb[_0x4866('0x3d')];for(var _0x34f7ae=0x0;_0x34f7ae<_0x2858fb['conditions'][_0x4866('0x16')];_0x34f7ae++){var _0x381bbc=_0x2858fb['conditions'][_0x34f7ae];var _0x176c43='i';var _0xab047f=_['find'](_0x398201,['name',_0x381bbc['field']]);if(_0xab047f){var _0x59c857=as[_0x4866('0x3e')](_0x176c43,_0xab047f[_0x4866('0x3f')],_0x381bbc);_0x42d92d['default'][_0x3b5505](_0x59c857['text'],_0x59c857['value'][_0x4866('0x40')],_0x59c857['value'][_0x4866('0x41')]);}else{switch(_0x381bbc['field']){case _0x4866('0x42'):var _0x5e3de6=parseReadParameter(_0x381bbc[_0x4866('0x43')]);_0x42d92d[_0x4866('0x44')][_0x4866('0x45')](_0x5e3de6);break;case _0x4866('0x46'):if(_0x381bbc[_0x4866('0x47')]===_0x4866('0x48')){if(_0x381bbc[_0x4866('0x43')]['split']('\x20')['length']>0x1){_0x42d92d[_0x4866('0x49')][_0x3b5505](_0x4866('0x4a'),qs[_0x4866('0x38')](_0x381bbc[_0x4866('0x43')]),null);}else{var _0x322422='%'+_0x381bbc[_0x4866('0x43')]+'%';_0x42d92d['contact'][_0x3b5505](_0x4866('0x4b'),_0x322422,_0x322422,_0x322422);}}else{_0xab047f=_[_0x4866('0x4c')](_0x398201,['name','ContactId']);_0x381bbc['field']='ContactId';_0x59c857=as[_0x4866('0x3e')](_0x176c43,_0xab047f[_0x4866('0x3f')],_0x381bbc);_0x42d92d[_0x4866('0x49')][_0x3b5505](_0x59c857[_0x4866('0x4d')],_0x59c857['value'][_0x4866('0x40')],_0x59c857[_0x4866('0x43')][_0x4866('0x41')]);}break;case _0x4866('0x4e'):var _0x13a28a=_0x381bbc[_0x4866('0x43')]['split'](',')[_0x4866('0x1a')](function(_0x44295e){return Number(_0x44295e);});var _0x3a7c13=parseTagParameter(_0x13a28a);_0x42d92d[_0x4866('0x4f')][_0x4866('0x50')][_0x4866('0x45')](_0x3a7c13);_0x42d92d[_0x4866('0x4f')]['ids']=_0x13a28a;break;case _0x4866('0x51'):if(_0x381bbc['operator']===_0x4866('0x48')){_0x42d92d['user'][_0x3b5505](_0x4866('0x52'),'%'+_0x381bbc[_0x4866('0x43')]+'%',null);}else{_0xab047f=_[_0x4866('0x4c')](_0x398201,[_0x4866('0xe'),'UserId']);_0x381bbc[_0x4866('0xd')]=_0x4866('0x53');_0x59c857=as[_0x4866('0x3e')](_0x176c43,_0xab047f['type'],_0x381bbc);_0x42d92d[_0x4866('0x54')][_0x3b5505](_0x59c857[_0x4866('0x4d')],_0x59c857[_0x4866('0x43')]['start'],_0x59c857[_0x4866('0x43')][_0x4866('0x41')]);}break;case _0x4866('0x55'):case'plainBody':_0x59c857=as[_0x4866('0x3e')]('me',null,_0x381bbc);_0x42d92d[_0x4866('0x55')][_0x3b5505](_0x59c857[_0x4866('0x4d')],_0x59c857[_0x4866('0x43')][_0x4866('0x40')],_0x59c857[_0x4866('0x43')][_0x4866('0x41')]);break;}}}return _0x42d92d;}function parseModelFields(_0x2f0e86,_0x59906e,_0x1feb85){var _0x4ed185=utils['getAccountFK'](_0x2f0e86);var _0x255fcc=squel[_0x4866('0x26')]();var _0x4608d8=_(_0x59906e)['keys']()[_0x4866('0x1a')](function(_0x39f0de){return _[_0x4866('0x56')](_0x1feb85,['name',_0x39f0de])?_0x39f0de:undefined;})[_0x4866('0x57')]()['value']();if(_0x4608d8[_0x4866('0x16')]>0x0){_0x4608d8[_0x4866('0x28')](function(_0x2e0e8c){if(_0x2e0e8c===_0x4ed185){_0x255fcc['and']('i.'+_0x4ed185+_0x4866('0x19'),[][_0x4866('0x58')](_0x59906e[_0x2e0e8c]));}else if(_0x2e0e8c===_0x4866('0x59')){var _0x21cd32=JSON[_0x4866('0x5a')](_0x59906e[_0x2e0e8c])['$gte'];var _0x6b6eeb=JSON[_0x4866('0x5a')](_0x59906e[_0x2e0e8c])[_0x4866('0x5b')];_0x255fcc[_0x4866('0x45')](_0x4866('0x5c'),_0x21cd32,_0x6b6eeb);}else{if(_0x59906e[_0x2e0e8c]===_0x4866('0x5d')){_0x255fcc['and']('i.'+_0x2e0e8c+_0x4866('0x5e'));}else{_0x255fcc[_0x4866('0x45')]('i.'+_0x2e0e8c+'\x20=\x20?',_0x59906e[_0x2e0e8c]);}}});}return _0x255fcc;}function parseQueryParameters(_0x50e171,_0x16af75,_0xbfe515){var _0x578687=getSqlClauses();return Promise[_0x4866('0x5f')]()['then'](function(){return parseModelFields(_0x50e171,_0x16af75,_0xbfe515);})['then'](function(_0x4413e9){_0x578687[_0x4866('0x60')][_0x4866('0x45')](_0x4413e9);return parseReadParameter(_0x16af75[_0x4866('0x44')]);})['then'](function(_0x4ab731){_0x578687[_0x4866('0x44')][_0x4866('0x45')](_0x4ab731);return parseTagParameter(_0x16af75[_0x4866('0x61')]);})[_0x4866('0x62')](function(_0x17e904){_0x578687[_0x4866('0x4f')][_0x4866('0x50')][_0x4866('0x45')](_0x17e904);return parseSearchFilter(_0x50e171,_0x16af75['filter']);})[_0x4866('0x62')](function(_0x1dc9a1){_0x578687[_0x4866('0x63')]=_0x1dc9a1;return _0x578687;});}function checkAccountsRestrictions(_0x5e5a55,_0x4bb889,_0x4b5bef){var _0x39a6e2=utils[_0x4866('0x8')](_0x5e5a55);var _0xd19e56=_0x4866('0x64')+_['capitalize'](_0x5e5a55)+(_0x5e5a55===_0x4866('0x65')?'Websites':'Accounts');var _0x19e7df=squel[_0x4866('0x26')]();return Promise[_0x4866('0x5f')]()['then'](function(){if(_0x4b5bef['search']&&_0x4bb889[_0x4866('0x9')]===_0x4866('0xa')){return _0x4bb889[_0xd19e56]({'attributes':['id'],'raw':!![]});}})[_0x4866('0x62')](function(_0x8ca5b5){if(_0x8ca5b5){if(_0x8ca5b5[_0x4866('0x16')]===0x0){_0x19e7df['and']('i.'+_0x39a6e2+_0x4866('0x5e'));}else{_0x19e7df['and']('i.'+_0x39a6e2+_0x4866('0x19'),_[_0x4866('0x1a')](_0x8ca5b5,'id'));}}else if(!_0x4b5bef[_0x39a6e2]){_0x19e7df[_0x4866('0x45')]('i.'+_0x39a6e2+_0x4866('0x66'));}})[_0x4866('0x62')](function(){return _0x19e7df;});}function getClosedOrderClause(_0x403cd8,_0x142050){var _0x5f3454='';var _0x8e465d=[_0x4866('0x67'),_0x4866('0x68'),_0x4866('0x69')];if(_0x403cd8===_0x4866('0x35')){_0x8e465d[_0x4866('0x6a')]('i.substatus');}if(_0x142050[_0x4866('0x6b')]==='0'&&_0x403cd8===_0x4866('0x35')){_0x5f3454='i.substatus';}else{if(_0x142050[_0x4866('0x6b')]==='1'){_0x8e465d[_0x4866('0x6c')]();}_0x5f3454=_0x4866('0x6d')+_0x8e465d[_0x4866('0x6e')](',\x20')+')';}return _0x5f3454;}function getFilteredInteractions(_0x7524cc,_0x390795,_0x52916f,_0x15afb5){var _0x29c4ca=utils['getInteractionFK'](_0x7524cc);var _0x17aea5=_[_0x4866('0x6f')](_0x7524cc)+_0x4866('0x70');var _0x2d9e5f=[];var _0x19622e=getTagsQuery();var _0x2daf0a={'type':db[_0x4866('0x71')]['QueryTypes'][_0x4866('0x72')],'raw':!![]};var _0x8d4e2a=[];var _0x4b5ba6=[];return db[_0x4866('0x73')]['query'](_0x19622e['toString'](),_0x2daf0a)[_0x4866('0x62')](function(_0x344fc2){_0x2d9e5f=_['keyBy'](_0x344fc2,'id');_0x2daf0a=_['merge'](_0x2daf0a,{'model':db[_0x17aea5],'mapToModel':!![],'nest':!![]});if(_0x52916f[_0x4866('0x60')]){_0x15afb5['attributes'][_0x4866('0x28')](function(_0x10e459){_0x390795['field']('i.'+_0x10e459);});}else{_0x390795[_0x4866('0xd')](_0x4866('0x74'),_0x4866('0x42'));_0x390795['field']('a.key',_0x4866('0x75'));_0x390795[_0x4866('0xd')](_0x4866('0x76'),_0x4866('0x77'));if(_0x7524cc===_0x4866('0x35')){_0x390795[_0x4866('0xd')](_0x4866('0x78'),_0x4866('0x79'));_0x390795[_0x4866('0xd')](_0x4866('0x7a'),_0x4866('0x7b'));_0x390795['field']('i.id');_0x390795[_0x4866('0xd')]('i.createdAt');_0x390795['field']('i.updatedAt');_0x390795[_0x4866('0xd')](_0x4866('0x7c'));_0x390795[_0x4866('0xd')](_0x4866('0x7d'));_0x390795[_0x4866('0xd')](_0x4866('0x7e'));_0x390795[_0x4866('0xd')](_0x4866('0x7f'));_0x390795[_0x4866('0xd')](_0x4866('0x80'));_0x390795[_0x4866('0xd')](_0x4866('0x81'));_0x390795['field'](_0x4866('0x69'));_0x390795[_0x4866('0xd')]('i.secondDisposition');_0x390795['field']('i.thirdDisposition');_0x390795[_0x4866('0xd')](_0x4866('0x82'));_0x390795[_0x4866('0xd')](_0x4866('0x83'));_0x390795[_0x4866('0xd')](_0x4866('0x84'));_0x390795[_0x4866('0xd')]('i.MailAccountId');_0x390795['field']('i.UserId');}else if(_0x7524cc==='openchannel'){_0x390795[_0x4866('0xd')](_0x4866('0x85'),'contactName');}else{_0x390795['field'](_0x4866('0x86'),_0x4866('0x7b'));}if(_0x7524cc!==_0x4866('0x35')){_0x390795[_0x4866('0xd')]('i.*');}_0x390795['field']('c.firstName',_0x4866('0x87'));_0x390795['field'](_0x4866('0x88'),'Contact.lastName');_0x390795['field'](_0x4866('0x89'),_0x4866('0x8a'));_0x390795[_0x4866('0xd')](_0x4866('0x8b'),_0x4866('0x8c'));_0x390795[_0x4866('0xd')]('c.mobile',_0x4866('0x8d'));_0x390795[_0x4866('0xd')](_0x4866('0x8e'),_0x4866('0x8f'));_0x390795['field'](_0x4866('0x90'),_0x4866('0x91'));_0x390795['field'](_0x4866('0x92'),_0x4866('0x93'));_0x390795['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4866('0x94'));}if(_0x15afb5[_0x4866('0x95')]){_0x390795[_0x4866('0x95')](_0x15afb5[_0x4866('0x95')]);}if(_0x15afb5[_0x4866('0x96')]){_0x390795[_0x4866('0x96')](_0x15afb5[_0x4866('0x96')]);}return db[_0x4866('0x73')]['query'](_0x390795['toString'](),_0x2daf0a);})['then'](function(_0x53b3f2){_0x8d4e2a=_0x53b3f2;var _0x18da02=getUsersQuery(_0x7524cc,_0x8d4e2a);return db[_0x4866('0x73')][_0x4866('0x97')](_0x18da02[_0x4866('0x98')](),_0x2daf0a);})['then'](function(_0x5df8a1){_0x4b5ba6=_[_0x4866('0x99')](_0x5df8a1,_0x29c4ca);if(_0x7524cc==='mail'){return db[_0x4866('0x9a')][_0x4866('0x9b')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x4866('0x62')](function(_0x2a04f6){var _0x507ccf=_0x2a04f6?_0x2a04f6[_0x4866('0x9c')]:undefined;var _0x20d55f=_0x8d4e2a['map'](function(_0x4b0e1c){return updateInteraction(_0x4b0e1c,_0x2d9e5f,_0x4b5ba6,_0x507ccf);});return Promise['all'](_0x20d55f);});}function countFilteredInteractions(_0x3800bb,_0x305bc9){var _0x2c6d5b=_0x3800bb[_0x4866('0x9d')]();_0x2c6d5b['field']('COUNT(*)');_0x2c6d5b[_0x4866('0xd')](_0x4866('0x74'),_0x4866('0x42'));var _0x24f7ef=utils['getSelectedTags'](_0x305bc9);if(!_[_0x4866('0x9e')](_0x24f7ef)){_0x2c6d5b[_0x4866('0x17')]('t.id\x20IN\x20?',_0x24f7ef);}var _0x54f9f9={'type':db[_0x4866('0x71')][_0x4866('0x9f')][_0x4866('0x72')],'raw':!![]};return db[_0x4866('0x73')][_0x4866('0x97')](_0x2c6d5b[_0x4866('0x98')](),_0x54f9f9);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 9ec000f..8bafe64 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x072e=['talking','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','updateInteraction','Users','TagIds','then','catch','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','unmanaged','abandoned','total','closed','disposition','UserId','answered'];(function(_0x4859f6,_0x186c2d){var _0x21e9ed=function(_0x2052ec){while(--_0x2052ec){_0x4859f6['push'](_0x4859f6['shift']());}};_0x21e9ed(++_0x186c2d);}(_0x072e,0x1e9));var _0xe072=function(_0x2dcdee,_0x472bf8){_0x2dcdee=_0x2dcdee-0x0;var _0x425806=_0x072e[_0x2dcdee];return _0x425806;};'use strict';var _=require(_0xe072('0x0'));var db=require(_0xe072('0x1'))['db'];function getInteractionUsers(_0x5451a9,_0x90e501){return new Promise(function(_0x84e34c,_0x2e2bb8){try{var _0x3e8f0c=[];if(_0x90e501[_0x5451a9]){_0x3e8f0c=_0x90e501[_0x5451a9][_0xe072('0x2')](function(_0x2db438){return{'id':_0x2db438['id'],'fullname':_0x2db438[_0xe072('0x3')]};});}return _0x84e34c(_0x3e8f0c);}catch(_0x3891f0){_0x2e2bb8(_0x3891f0);}});}function getInteractionTags(_0x394962,_0x5ab918){var _0x29667c=[];if(_0x394962){_0x394962[_0xe072('0x4')](',')[_0xe072('0x5')](function(_0x16d390){_0x29667c[_0xe072('0x6')](_0x5ab918[_0x16d390]);});}return _0x29667c;}function updateWaitingCounter(_0xa1526){if(_0xa1526[_0xe072('0x7')]){_0xa1526[_0xe072('0x7')]-=0x1;}}function updateInteractionCounters(_0x3a84d0){_0x3a84d0[_0xe072('0x7')]=0x0;_0x3a84d0['talking']=0x0;_0x3a84d0['answered']=0x0;_0x3a84d0[_0xe072('0x8')]=0x0;_0x3a84d0[_0xe072('0x9')]=0x0;_0x3a84d0[_0xe072('0xa')]=0x0;if(_0x3a84d0[_0xe072('0xb')]){if(_0x3a84d0[_0xe072('0xc')]==='abandoned'){_0x3a84d0[_0xe072('0x9')]+=0x1;updateWaitingCounter(_0x3a84d0);}if(_0x3a84d0[_0xe072('0xd')]){_0x3a84d0[_0xe072('0xe')]+=0x1;if(_0x3a84d0[_0xe072('0xf')]){_0x3a84d0[_0xe072('0xf')]-=0x1;}}else{if(_0x3a84d0[_0xe072('0xc')]){_0x3a84d0['unmanaged']+=0x1;updateWaitingCounter(_0x3a84d0);}}}else{if(!_0x3a84d0[_0xe072('0xd')]){_0x3a84d0['waiting']+=0x1;}if(_0x3a84d0[_0xe072('0xd')]){_0x3a84d0[_0xe072('0xf')]+=0x1;updateWaitingCounter(_0x3a84d0);}}_0x3a84d0[_0xe072('0xa')]+=0x1;return _0x3a84d0;}function getLastMessageText(_0x538dca){return db[_0xe072('0x10')][_0xe072('0x11')]({'where':{'$and':[{'MailInteractionId':_0x538dca['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xe072('0x12')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xe072('0x13')],'order':_0xe072('0x14'),'raw':!![]})['then'](function(_0xc95905){if(_0xc95905&&_0xc95905[_0xe072('0x13')]){_0x538dca[_0xe072('0x15')]=_[_0xe072('0x16')](_0xc95905[_0xe072('0x13')]);}return _0x538dca;})['catch'](function(_0x2a2fdc){throw _0x2a2fdc;});}exports[_0xe072('0x17')]=function(_0x400976,_0x50fa20,_0x49ea98,_0x20e389){return new Promise(function(_0x456c84,_0x579631){return getInteractionUsers(_0x400976['id'],_0x49ea98)['then'](function(_0x217e84){_0x400976[_0xe072('0x18')]=_0x217e84;return getInteractionTags(_0x400976[_0xe072('0x19')],_0x50fa20);})[_0xe072('0x1a')](function(_0x4537f1){_0x400976['Tags']=_0x4537f1;delete _0x400976[_0xe072('0x19')];return updateInteractionCounters(_0x400976);})[_0xe072('0x1a')](function(_0x3acf71){if(_0x20e389){return getLastMessageText(_0x3acf71);}else{return _0x3acf71;}})[_0xe072('0x1a')](function(_0x1c49db){_0x456c84(_0x1c49db);})[_0xe072('0x1b')](function(_0xa55209){_0x579631(_0xa55209);});});}; \ No newline at end of file +var _0xe12b=['lodash','../../mysqldb','map','fullname','split','forEach','waiting','abandoned','UserId','answered','talking','disposition','unmanaged','MailMessage','out','plainBody','-id','then','lastMsgText','trimStart','catch','Users','TagIds','Tags'];(function(_0x5058b6,_0x2cd40c){var _0x3cb924=function(_0x35165e){while(--_0x35165e){_0x5058b6['push'](_0x5058b6['shift']());}};_0x3cb924(++_0x2cd40c);}(_0xe12b,0xd8));var _0xbe12=function(_0x44c7c5,_0x7e632f){_0x44c7c5=_0x44c7c5-0x0;var _0x580c3b=_0xe12b[_0x44c7c5];return _0x580c3b;};'use strict';var _=require(_0xbe12('0x0'));var db=require(_0xbe12('0x1'))['db'];function getInteractionUsers(_0x202131,_0x28ee58){return new Promise(function(_0x53157a,_0x4f0a5d){try{var _0x39e746=[];if(_0x28ee58[_0x202131]){_0x39e746=_0x28ee58[_0x202131][_0xbe12('0x2')](function(_0x24660f){return{'id':_0x24660f['id'],'fullname':_0x24660f[_0xbe12('0x3')]};});}return _0x53157a(_0x39e746);}catch(_0x4bfba9){_0x4f0a5d(_0x4bfba9);}});}function getInteractionTags(_0x1eafc6,_0x595589){var _0xa2daa8=[];if(_0x1eafc6){_0x1eafc6[_0xbe12('0x4')](',')[_0xbe12('0x5')](function(_0x447aeb){_0xa2daa8['push'](_0x595589[_0x447aeb]);});}return _0xa2daa8;}function updateWaitingCounter(_0x292995){if(_0x292995['waiting']){_0x292995['waiting']-=0x1;}}function updateInteractionCounters(_0x5be830){_0x5be830[_0xbe12('0x6')]=0x0;_0x5be830['talking']=0x0;_0x5be830['answered']=0x0;_0x5be830['unmanaged']=0x0;_0x5be830['abandoned']=0x0;_0x5be830['total']=0x0;if(_0x5be830['closed']){if(_0x5be830['disposition']===_0xbe12('0x7')){_0x5be830['abandoned']+=0x1;updateWaitingCounter(_0x5be830);}if(_0x5be830[_0xbe12('0x8')]){_0x5be830[_0xbe12('0x9')]+=0x1;if(_0x5be830[_0xbe12('0xa')]){_0x5be830[_0xbe12('0xa')]-=0x1;}}else{if(_0x5be830[_0xbe12('0xb')]){_0x5be830[_0xbe12('0xc')]+=0x1;updateWaitingCounter(_0x5be830);}}}else{if(!_0x5be830[_0xbe12('0x8')]){_0x5be830[_0xbe12('0x6')]+=0x1;}if(_0x5be830['UserId']){_0x5be830[_0xbe12('0xa')]+=0x1;updateWaitingCounter(_0x5be830);}}_0x5be830['total']+=0x1;return _0x5be830;}function getLastMessageText(_0x287787){return db[_0xbe12('0xd')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x287787['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbe12('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xbe12('0xf')],'order':_0xbe12('0x10'),'raw':!![]})[_0xbe12('0x11')](function(_0x4f231d){if(_0x4f231d&&_0x4f231d[_0xbe12('0xf')]){_0x287787[_0xbe12('0x12')]=_[_0xbe12('0x13')](_0x4f231d[_0xbe12('0xf')]);}return _0x287787;})[_0xbe12('0x14')](function(_0x485f30){throw _0x485f30;});}exports['updateInteraction']=function(_0x33958f,_0x242f69,_0x38e7b1,_0x268cdb){return new Promise(function(_0x1d1a64,_0x23e653){return getInteractionUsers(_0x33958f['id'],_0x38e7b1)[_0xbe12('0x11')](function(_0x56c4ee){_0x33958f[_0xbe12('0x15')]=_0x56c4ee;return getInteractionTags(_0x33958f[_0xbe12('0x16')],_0x242f69);})['then'](function(_0x10b05b){_0x33958f[_0xbe12('0x17')]=_0x10b05b;delete _0x33958f['TagIds'];return updateInteractionCounters(_0x33958f);})[_0xbe12('0x11')](function(_0x15bbb9){if(_0x268cdb){return getLastMessageText(_0x15bbb9);}else{return _0x15bbb9;}})[_0xbe12('0x11')](function(_0x1316df){_0x1d1a64(_0x1316df);})[_0xbe12('0x14')](function(_0x1fbaf0){_0x23e653(_0x1fbaf0);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 9799e7e..a688dfa 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe148=['_interactions','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','findOne','then','update','catch','error','exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','Account','upperFirst','InteractionId','unknown','accounts','_messages'];(function(_0x248018,_0x3c34dc){var _0x23c1ad=function(_0x3a2c76){while(--_0x3a2c76){_0x248018['push'](_0x248018['shift']());}};_0x23c1ad(++_0x3c34dc);}(_0xe148,0x9e));var _0x8e14=function(_0x5c78d9,_0x2736c7){_0x5c78d9=_0x5c78d9-0x0;var _0x69ae1f=_0xe148[_0x5c78d9];return _0x69ae1f;};'use strict';var _=require(_0x8e14('0x0'));var db=require(_0x8e14('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x8e14('0x2')),'mail':require(_0x8e14('0x3'))('mail-interactions'),'fax':require(_0x8e14('0x3'))(_0x8e14('0x4')),'sms':require(_0x8e14('0x3'))(_0x8e14('0x5')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0x8e14('0x3'))(_0x8e14('0x6'))};function getAccountFK(_0x5d5232){return _[_0x8e14('0x7')](_0x5d5232)+(_0x5d5232===_0x8e14('0x8')?_0x8e14('0x9'):_0x8e14('0xa'))+'Id';}function getInteractionFK(_0x57b082){return _[_0x8e14('0x7')](_0x57b082)+'InteractionId';}function getInteractionId(_0x46abf4,_0x2587a1,_0x491a46){if(_0x46abf4&&_0x46abf4[_[_0x8e14('0xb')](_0x491a46)+'InteractionId']){return _0x46abf4[_['upperFirst'](_0x491a46)+_0x8e14('0xc')];}else if(_0x46abf4&&_0x46abf4['id']){return _0x46abf4['id'];}else if(_0x2587a1&&_0x2587a1['id']){return _0x2587a1['id'];}else{return _0x8e14('0xd');}}function getInteractionsTables(_0x3c505a){return{'accounts':_0x3c505a+'_'+(_0x3c505a===_0x8e14('0x8')?'websites':_0x8e14('0xe')),'interactions':_0x3c505a+'_interactions','interactionsTags':_0x3c505a+'_interaction_has_tags','messages':_0x3c505a+_0x8e14('0xf'),'userInteractions':'user_has_'+_0x3c505a+_0x8e14('0x10')};}function getSelectedTags(_0x4e1223){var _0x59e069=[];if(_0x4e1223){_0x59e069=Array['isArray'](_0x4e1223)?_0x4e1223:[_0x4e1223];}return _0x59e069;}function log(_0x1f9b2c,_0x45389f,_0x13bdc0,_0x128217,_0x40b964,_0x50db2e){loggers[_0x40b964[_0x8e14('0x11')]()][_0x1f9b2c](_0x8e14('0x12'),_0x50db2e['toUpperCase'](),_0x45389f?_0x45389f['id']:null,_0x45389f?_0x45389f[_0x8e14('0x13')]:null,_0x45389f?_0x45389f[_0x8e14('0x14')]:null,getInteractionId(_0x13bdc0,_0x128217,_0x40b964),_0x13bdc0?JSON[_0x8e14('0x15')](_0x13bdc0):_0x8e14('0x16'));}function updateUser(_0x10c24d,_0x2510ce,_0x10256c,_0x2b1ee1,_0xda5a03){db[_[_0x8e14('0xb')](_0x2b1ee1)+'Interaction'][_0x8e14('0x17')]({'where':{'id':getInteractionId(_0x2510ce,_0x10256c,_0x2b1ee1)}})[_0x8e14('0x18')](function(_0x5517c9){if(_0x5517c9){return _0x5517c9[_0x8e14('0x19')]({'UserId':_0x10c24d?_0x10c24d['id']:null});}})[_0x8e14('0x18')](function(_0x378e86){if(_0x378e86){log('info',_0x10c24d,_0x2510ce,_0x10256c,_0x2b1ee1,_0xda5a03);}})[_0x8e14('0x1a')](function(){log(_0x8e14('0x1b'),_0x10c24d,_0x2510ce,_0x10256c,_0x2b1ee1,_0xda5a03);});}module[_0x8e14('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xe5df=['toUpperCase','name','role','null','Interaction','then','update','info','catch','error','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x55e3de,_0x20ae6a){var _0x5d6764=function(_0x3e8f8f){while(--_0x3e8f8f){_0x55e3de['push'](_0x55e3de['shift']());}};_0x5d6764(++_0x20ae6a);}(_0xe5df,0x1b7));var _0xfe5d=function(_0x24d6dc,_0x1f79d8){_0x24d6dc=_0x24d6dc-0x0;var _0x4cca03=_0xe5df[_0x24d6dc];return _0x4cca03;};'use strict';var _=require(_0xfe5d('0x0'));var db=require(_0xfe5d('0x1'))['db'];var loggers={'openchannel':require(_0xfe5d('0x2'))(_0xfe5d('0x3')),'mail':require(_0xfe5d('0x2'))(_0xfe5d('0x4')),'fax':require(_0xfe5d('0x2'))('fax-interactions'),'sms':require(_0xfe5d('0x2'))(_0xfe5d('0x5')),'chat':require(_0xfe5d('0x2'))(_0xfe5d('0x6')),'whatsapp':require(_0xfe5d('0x2'))(_0xfe5d('0x7'))};function getAccountFK(_0x57879e){return _[_0xfe5d('0x8')](_0x57879e)+(_0x57879e===_0xfe5d('0x9')?_0xfe5d('0xa'):_0xfe5d('0xb'))+'Id';}function getInteractionFK(_0x2ff010){return _[_0xfe5d('0x8')](_0x2ff010)+_0xfe5d('0xc');}function getInteractionId(_0xb770e5,_0x4a1cbc,_0x35f52a){if(_0xb770e5&&_0xb770e5[_[_0xfe5d('0xd')](_0x35f52a)+_0xfe5d('0xc')]){return _0xb770e5[_['upperFirst'](_0x35f52a)+_0xfe5d('0xc')];}else if(_0xb770e5&&_0xb770e5['id']){return _0xb770e5['id'];}else if(_0x4a1cbc&&_0x4a1cbc['id']){return _0x4a1cbc['id'];}else{return _0xfe5d('0xe');}}function getInteractionsTables(_0x29514c){return{'accounts':_0x29514c+'_'+(_0x29514c==='chat'?_0xfe5d('0xf'):_0xfe5d('0x10')),'interactions':_0x29514c+_0xfe5d('0x11'),'interactionsTags':_0x29514c+'_interaction_has_tags','messages':_0x29514c+_0xfe5d('0x12'),'userInteractions':_0xfe5d('0x13')+_0x29514c+_0xfe5d('0x11')};}function getSelectedTags(_0x3df38c){var _0xc7a75e=[];if(_0x3df38c){_0xc7a75e=Array[_0xfe5d('0x14')](_0x3df38c)?_0x3df38c:[_0x3df38c];}return _0xc7a75e;}function log(_0x13a890,_0x5cccde,_0x48018d,_0x475c33,_0x1e0bef,_0x5b3e7d){loggers[_0x1e0bef[_0xfe5d('0x15')]()][_0x13a890](_0xfe5d('0x16'),_0x5b3e7d[_0xfe5d('0x17')](),_0x5cccde?_0x5cccde['id']:null,_0x5cccde?_0x5cccde[_0xfe5d('0x18')]:null,_0x5cccde?_0x5cccde[_0xfe5d('0x19')]:null,getInteractionId(_0x48018d,_0x475c33,_0x1e0bef),_0x48018d?JSON['stringify'](_0x48018d):_0xfe5d('0x1a'));}function updateUser(_0x30a6e5,_0x22de17,_0xd6b155,_0x18c9b1,_0x251858){db[_[_0xfe5d('0xd')](_0x18c9b1)+_0xfe5d('0x1b')]['findOne']({'where':{'id':getInteractionId(_0x22de17,_0xd6b155,_0x18c9b1)}})[_0xfe5d('0x1c')](function(_0x15906a){if(_0x15906a){return _0x15906a[_0xfe5d('0x1d')]({'UserId':_0x30a6e5?_0x30a6e5['id']:null});}})[_0xfe5d('0x1c')](function(_0x217ad9){if(_0x217ad9){log(_0xfe5d('0x1e'),_0x30a6e5,_0x22de17,_0xd6b155,_0x18c9b1,_0x251858);}})[_0xfe5d('0x1f')](function(){log(_0xfe5d('0x20'),_0x30a6e5,_0x22de17,_0xd6b155,_0x18c9b1,_0x251858);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 8abf52c..1cac27d 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0eb4=['data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','parse','count','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','crypto','util','composable-middleware','../../config/environment'];(function(_0xed9dd,_0x184eb5){var _0x2b0faf=function(_0x437e21){while(--_0x437e21){_0xed9dd['push'](_0xed9dd['shift']());}};_0x2b0faf(++_0x184eb5);}(_0x0eb4,0x146));var _0x40eb=function(_0x3bf936,_0xf44068){_0x3bf936=_0x3bf936-0x0;var _0x266f18=_0x0eb4[_0x3bf936];return _0x266f18;};'use strict';var crypto=require(_0x40eb('0x0'));var util=require(_0x40eb('0x1'));var compose=require(_0x40eb('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x40eb('0x3'));function getValueFromLicense(_0x18e449,_0x2b26f7){if(_0x18e449&&_0x2b26f7){if(_0x2b26f7[_0x40eb('0x4')]&&_0x2b26f7['license']){var _0x432e56=_0x2b26f7[_0x40eb('0x4')];var _0x4faf45=_0x2b26f7[_0x40eb('0x5')];var _0x1d4c60=_0x432e56[_0x40eb('0x6')]('-')[0x4];var _0x7ecb9b=_0x432e56[_0x40eb('0x6')]('-')[0x0];var _0x1907e9=crypto[_0x40eb('0x7')](_0x40eb('0x8'),util[_0x40eb('0x9')](_0x40eb('0xa'),_0x1d4c60,_0x432e56,_0x7ecb9b));var _0x533b45=_0x1907e9[_0x40eb('0xb')](_0x4faf45,'base64','utf8');_0x533b45+=_0x1907e9['final'](_0x40eb('0xc'));var _0x2b1674=JSON[_0x40eb('0xd')](_0x533b45);return _0x2b1674['hasOwnProperty'](_0x18e449)?_0x2b1674[_0x18e449]:null;}}return null;}function isLimit(_0x368046,_0x1deb47,_0x4eeecf,_0x1afc95){var _0x4a1f9c=_0x1deb47;return compose()['use'](function(_0x279dac,_0x56d906,_0x3b0492){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3a73cb){var _0x4313c0=getValueFromLicense(_0x368046,_0x3a73cb);return _0x4313c0?_0x4313c0:_0x4a1f9c;})['then'](function(_0x563541){_0x4a1f9c=_0x563541;return _0x4eeecf[_0x40eb('0xe')](_0x1afc95);})[_0x40eb('0xf')](function(_0x468c68){if(_0x468c68>=_0x4a1f9c){return _0x56d906[_0x40eb('0x10')](0x193)['json']({'message':util[_0x40eb('0x9')](_0x40eb('0x11'),_0x368046)});}_0x3b0492();})['catch'](function(_0x7f5f4){_0x3b0492(_0x7f5f4);});});}function isUserLimit(){return isLimit(_0x40eb('0x12'),0x1,db[_0x40eb('0x13')],{'where':{'$or':[{'role':_0x40eb('0x14')},{'role':_0x40eb('0x15')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x3db0=['composable-middleware','../../config/environment','license','data1','split','aes-256-ctr','format','utf8','final','parse','hasOwnProperty','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util'];(function(_0x572f1b,_0x9b4d72){var _0x1a9c6f=function(_0x400941){while(--_0x400941){_0x572f1b['push'](_0x572f1b['shift']());}};_0x1a9c6f(++_0x9b4d72);}(_0x3db0,0x7b));var _0x03db=function(_0x5da54c,_0x520452){_0x5da54c=_0x5da54c-0x0;var _0x1246b0=_0x3db0[_0x5da54c];return _0x1246b0;};'use strict';var crypto=require(_0x03db('0x0'));var util=require(_0x03db('0x1'));var compose=require(_0x03db('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x03db('0x3'));function getValueFromLicense(_0x29109d,_0x56c314){if(_0x29109d&&_0x56c314){if(_0x56c314['data1']&&_0x56c314[_0x03db('0x4')]){var _0x504b52=_0x56c314[_0x03db('0x5')];var _0x11a5d2=_0x56c314[_0x03db('0x4')];var _0x24561e=_0x504b52[_0x03db('0x6')]('-')[0x4];var _0x42977c=_0x504b52[_0x03db('0x6')]('-')[0x0];var _0x445069=crypto['createDecipher'](_0x03db('0x7'),util[_0x03db('0x8')]('%s:%s:%s',_0x24561e,_0x504b52,_0x42977c));var _0x27e976=_0x445069['update'](_0x11a5d2,'base64',_0x03db('0x9'));_0x27e976+=_0x445069[_0x03db('0xa')]('utf8');var _0x46f4ea=JSON[_0x03db('0xb')](_0x27e976);return _0x46f4ea[_0x03db('0xc')](_0x29109d)?_0x46f4ea[_0x29109d]:null;}}return null;}function isLimit(_0x17016b,_0x23efa0,_0x23aeac,_0x3b0884){var _0x4c56db=_0x23efa0;return compose()['use'](function(_0x74efd,_0x55a6d9,_0x42d1e2){return db[_0x03db('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x03db('0xe')](function(_0x2408ee){var _0x370958=getValueFromLicense(_0x17016b,_0x2408ee);return _0x370958?_0x370958:_0x4c56db;})['then'](function(_0x52d22c){_0x4c56db=_0x52d22c;return _0x23aeac[_0x03db('0xf')](_0x3b0884);})[_0x03db('0xe')](function(_0x20da47){if(_0x20da47>=_0x4c56db){return _0x55a6d9[_0x03db('0x10')](0x193)[_0x03db('0x11')]({'message':util[_0x03db('0x8')](_0x03db('0x12'),_0x17016b)});}_0x42d1e2();})[_0x03db('0x13')](function(_0x1361ef){_0x42d1e2(_0x1361ef);});});}function isUserLimit(){return isLimit(_0x03db('0x14'),0x1,db[_0x03db('0x15')],{'where':{'$or':[{'role':_0x03db('0x16')},{'role':_0x03db('0x17')}]}});}exports[_0x03db('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 0f34b79..99f5414 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe491=['split','length','slice','shift','match','filter','map','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','text','CAST(','field','\x20AS\x20','castTo','$ne','\x20OR\x20','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','lodash','moment','parseSearch','[$or]','and','replace','[$and]'];(function(_0x31d4a8,_0x27e8c6){var _0x599654=function(_0x7d20bc){while(--_0x7d20bc){_0x31d4a8['push'](_0x31d4a8['shift']());}};_0x599654(++_0x27e8c6);}(_0xe491,0x98));var _0x1e49=function(_0x4f3b8d,_0x2d112e){_0x4f3b8d=_0x4f3b8d-0x0;var _0x3a343a=_0xe491[_0x4f3b8d];return _0x3a343a;};'use strict';var _=require(_0x1e49('0x0'));var moment=require(_0x1e49('0x1'));exports[_0x1e49('0x2')]=function(_0x11e33d){var _0x2153b5={'conditions':[]};_0x2153b5['sqlOperator']=_['startsWith'](_0x11e33d,_0x1e49('0x3'))?'or':_0x1e49('0x4');var _0x5ba628=_0x11e33d[_0x1e49('0x5')](_0x1e49('0x6'),'')[_0x1e49('0x5')](_0x1e49('0x3'),'')[_0x1e49('0x7')]('||');for(var _0x432d4a=0x0;_0x432d4a<_0x5ba628[_0x1e49('0x8')];_0x432d4a++){var _0x2002d1=_0x5ba628[_0x432d4a][_0x1e49('0x7')](':=');var _0x346a79=_0x2002d1[0x0];var _0x5e66c0=_0x2002d1[_0x1e49('0x9')](0x1);_0x5e66c0['forEach'](function(_0x405f23){var _0x18768b=_0x405f23['split']('[')[_0x1e49('0xa')]();var _0x2f8f6a=_0x405f23[_0x1e49('0xb')](/\[(.*?)\]/g);_0x2f8f6a['forEach'](function(_0x1d6ab6){var _0x3cdf12=_0x1d6ab6[_0x1e49('0x7')]('[')[_0x1e49('0xc')](function(_0x3f7649){return _0x3f7649['indexOf'](']')>-0x1;})[_0x1e49('0xd')](function(_0x1578d5){return _0x1578d5[_0x1e49('0x7')](']')[0x0];})[0x0];_0x2153b5[_0x1e49('0xe')]['push']({'field':_0x346a79,'operator':_0x18768b,'value':_0x3cdf12});});});}return _0x2153b5;};exports[_0x1e49('0xf')]=function(_0x22f10f,_0x2ac755,_0x16036b){var _0x3499da={};if(_0x2ac755===_0x1e49('0x10')){if(_0x16036b[_0x1e49('0x11')]===_0x1e49('0x12')){_0x16036b[_0x1e49('0x11')]=_0x1e49('0x13');_0x16036b[_0x1e49('0x14')]+=','+_0x16036b[_0x1e49('0x14')];}else if(_[_0x1e49('0x15')]([_0x1e49('0x16'),_0x1e49('0x17')],_0x16036b['operator'])){_0x16036b[_0x1e49('0x14')]=moment(_0x16036b[_0x1e49('0x14')])[_0x1e49('0x18')](0x1,_0x1e49('0x19'))[_0x1e49('0x1a')]('YYYY-MM-DD');}}if(_0x16036b['castTo']){_0x2ac755=_0x16036b['castTo'];_0x3499da[_0x1e49('0x1b')]=_0x1e49('0x1c')+_0x22f10f+'.'+_0x16036b[_0x1e49('0x1d')]+_0x1e49('0x1e')+_0x16036b[_0x1e49('0x1f')]+')\x20'+parseOperator(_0x16036b[_0x1e49('0x11')]);}else{_0x3499da['text']=_0x22f10f+'.'+_0x16036b[_0x1e49('0x1d')]+'\x20'+parseOperator(_0x16036b[_0x1e49('0x11')]);}if(_[_0x1e49('0x15')]([_0x1e49('0x20'),'$notIn'],_0x16036b['operator']))_0x3499da[_0x1e49('0x1b')]='('+_0x3499da[_0x1e49('0x1b')]+_0x1e49('0x21')+_0x22f10f+'.'+_0x16036b[_0x1e49('0x1d')]+'\x20IS\x20NULL)';_0x3499da[_0x1e49('0x14')]=parseValue(_0x2ac755,_0x16036b[_0x1e49('0x11')],_0x16036b[_0x1e49('0x14')]);return _0x3499da;};function parseOperator(_0x579c6f){var _0x16f186;switch(_0x579c6f){case _0x1e49('0x22'):_0x16f186=_0x1e49('0x23');break;case _0x1e49('0x24'):_0x16f186=_0x1e49('0x25');break;case'$eq':_0x16f186=_0x1e49('0x26');break;case'$ne':_0x16f186=_0x1e49('0x27');break;case _0x1e49('0x28'):case _0x1e49('0x29'):case _0x1e49('0x2a'):_0x16f186='LIKE\x20?';break;case _0x1e49('0x2b'):_0x16f186=_0x1e49('0x2c');break;case _0x1e49('0x16'):_0x16f186=_0x1e49('0x2d');break;case'$lte':_0x16f186='<=\x20?';break;case _0x1e49('0x2e'):_0x16f186=_0x1e49('0x2f');break;case'$between':_0x16f186=_0x1e49('0x30');break;}return _0x16f186;}function parseValue(_0x27e71a,_0x1c5a42,_0x218465){var _0x1a1cca={'start':undefined,'end':undefined};switch(_0x1c5a42){case _0x1e49('0x22'):case _0x1e49('0x24'):_0x1a1cca[_0x1e49('0x31')]=_0x218465[_0x1e49('0x7')](',');break;case _0x1e49('0x28'):_0x1a1cca[_0x1e49('0x31')]='%'+_0x218465+'%';break;case _0x1e49('0x29'):_0x1a1cca['start']=_0x218465+'%';break;case _0x1e49('0x2a'):_0x1a1cca[_0x1e49('0x31')]='%'+_0x218465;break;case _0x1e49('0x13'):var _0x119d8a=_0x218465[_0x1e49('0x7')](',');var _0x218465=_0x119d8a[_0x1e49('0xa')]();var _0x556d7a=_0x119d8a[_0x1e49('0x32')]();if(_0x27e71a===_0x1e49('0x10')){_0x218465=moment(_0x218465)[_0x1e49('0x33')](0x0,!![])[_0x1e49('0x1a')]();_0x556d7a=moment(_0x556d7a)[_0x1e49('0x33')](0x0,!![])['add'](0x17,_0x1e49('0x34'))[_0x1e49('0x18')](0x3b,'minutes')['add'](0x3b,'seconds')[_0x1e49('0x1a')]();}_0x1a1cca={'start':_0x218465,'end':_0x556d7a};break;default:_0x1a1cca[_0x1e49('0x31')]=_0x218465;break;}return _0x1a1cca;} \ No newline at end of file +var _0x2edb=['replace','split','slice','forEach','shift','filter','indexOf','push','buildExpression','DATE','operator','$eq','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','\x20OR\x20','\x20IS\x20NULL)','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$in','start','pop','utcOffset','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','[$and]'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2edb,0x179));var _0xb2ed=function(_0x358bf3,_0x40ec1f){_0x358bf3=_0x358bf3-0x0;var _0x248106=_0x2edb[_0x358bf3];return _0x248106;};'use strict';var _=require(_0xb2ed('0x0'));var moment=require(_0xb2ed('0x1'));exports[_0xb2ed('0x2')]=function(_0x16c030){var _0x372327={'conditions':[]};_0x372327[_0xb2ed('0x3')]=_[_0xb2ed('0x4')](_0x16c030,_0xb2ed('0x5'))?'or':_0xb2ed('0x6');var _0x465148=_0x16c030['replace'](_0xb2ed('0x7'),'')[_0xb2ed('0x8')](_0xb2ed('0x5'),'')[_0xb2ed('0x9')]('||');for(var _0x374377=0x0;_0x374377<_0x465148['length'];_0x374377++){var _0x5c139a=_0x465148[_0x374377][_0xb2ed('0x9')](':=');var _0x271ec9=_0x5c139a[0x0];var _0x3c191e=_0x5c139a[_0xb2ed('0xa')](0x1);_0x3c191e[_0xb2ed('0xb')](function(_0x1cdc31){var _0x395a7d=_0x1cdc31[_0xb2ed('0x9')]('[')[_0xb2ed('0xc')]();var _0x5a8fbd=_0x1cdc31['match'](/\[(.*?)\]/g);_0x5a8fbd[_0xb2ed('0xb')](function(_0x861f7e){var _0x4cfdf4=_0x861f7e[_0xb2ed('0x9')]('[')[_0xb2ed('0xd')](function(_0x308478){return _0x308478[_0xb2ed('0xe')](']')>-0x1;})['map'](function(_0x49da90){return _0x49da90[_0xb2ed('0x9')](']')[0x0];})[0x0];_0x372327['conditions'][_0xb2ed('0xf')]({'field':_0x271ec9,'operator':_0x395a7d,'value':_0x4cfdf4});});});}return _0x372327;};exports[_0xb2ed('0x10')]=function(_0x4a2c4c,_0x11c5cc,_0x233d29){var _0x492d1e={};if(_0x11c5cc===_0xb2ed('0x11')){if(_0x233d29[_0xb2ed('0x12')]===_0xb2ed('0x13')){_0x233d29['operator']=_0xb2ed('0x14');_0x233d29[_0xb2ed('0x15')]+=','+_0x233d29['value'];}else if(_['includes']([_0xb2ed('0x16'),_0xb2ed('0x17')],_0x233d29['operator'])){_0x233d29['value']=moment(_0x233d29[_0xb2ed('0x15')])[_0xb2ed('0x18')](0x1,_0xb2ed('0x19'))[_0xb2ed('0x1a')](_0xb2ed('0x1b'));}}if(_0x233d29[_0xb2ed('0x1c')]){_0x11c5cc=_0x233d29['castTo'];_0x492d1e[_0xb2ed('0x1d')]=_0xb2ed('0x1e')+_0x4a2c4c+'.'+_0x233d29[_0xb2ed('0x1f')]+'\x20AS\x20'+_0x233d29['castTo']+')\x20'+parseOperator(_0x233d29[_0xb2ed('0x12')]);}else{_0x492d1e[_0xb2ed('0x1d')]=_0x4a2c4c+'.'+_0x233d29[_0xb2ed('0x1f')]+'\x20'+parseOperator(_0x233d29[_0xb2ed('0x12')]);}if(_['includes']([_0xb2ed('0x20'),'$notIn'],_0x233d29[_0xb2ed('0x12')]))_0x492d1e[_0xb2ed('0x1d')]='('+_0x492d1e[_0xb2ed('0x1d')]+_0xb2ed('0x21')+_0x4a2c4c+'.'+_0x233d29[_0xb2ed('0x1f')]+_0xb2ed('0x22');_0x492d1e[_0xb2ed('0x15')]=parseValue(_0x11c5cc,_0x233d29[_0xb2ed('0x12')],_0x233d29[_0xb2ed('0x15')]);return _0x492d1e;};function parseOperator(_0x1176f8){var _0x2f7ac3;switch(_0x1176f8){case'$in':_0x2f7ac3='IN\x20?';break;case _0xb2ed('0x23'):_0x2f7ac3=_0xb2ed('0x24');break;case _0xb2ed('0x13'):_0x2f7ac3=_0xb2ed('0x25');break;case _0xb2ed('0x20'):_0x2f7ac3=_0xb2ed('0x26');break;case _0xb2ed('0x27'):case _0xb2ed('0x28'):case _0xb2ed('0x29'):_0x2f7ac3=_0xb2ed('0x2a');break;case _0xb2ed('0x2b'):_0x2f7ac3=_0xb2ed('0x2c');break;case'$gt':_0x2f7ac3=_0xb2ed('0x2d');break;case _0xb2ed('0x17'):_0x2f7ac3=_0xb2ed('0x2e');break;case _0xb2ed('0x2f'):_0x2f7ac3='>=\x20?';break;case _0xb2ed('0x14'):_0x2f7ac3=_0xb2ed('0x30');break;}return _0x2f7ac3;}function parseValue(_0x275242,_0x5842b8,_0x51c1f9){var _0x388574={'start':undefined,'end':undefined};switch(_0x5842b8){case _0xb2ed('0x31'):case _0xb2ed('0x23'):_0x388574[_0xb2ed('0x32')]=_0x51c1f9[_0xb2ed('0x9')](',');break;case _0xb2ed('0x27'):_0x388574[_0xb2ed('0x32')]='%'+_0x51c1f9+'%';break;case _0xb2ed('0x28'):_0x388574[_0xb2ed('0x32')]=_0x51c1f9+'%';break;case'$endsWith':_0x388574['start']='%'+_0x51c1f9;break;case _0xb2ed('0x14'):var _0x251249=_0x51c1f9[_0xb2ed('0x9')](',');var _0x51c1f9=_0x251249[_0xb2ed('0xc')]();var _0x831f5=_0x251249[_0xb2ed('0x33')]();if(_0x275242===_0xb2ed('0x11')){_0x51c1f9=moment(_0x51c1f9)[_0xb2ed('0x34')](0x0,!![])['format']();_0x831f5=moment(_0x831f5)[_0xb2ed('0x34')](0x0,!![])[_0xb2ed('0x18')](0x17,_0xb2ed('0x35'))[_0xb2ed('0x18')](0x3b,'minutes')[_0xb2ed('0x18')](0x3b,_0xb2ed('0x36'))[_0xb2ed('0x1a')]();}_0x388574={'start':_0x51c1f9,'end':_0x831f5};break;default:_0x388574[_0xb2ed('0x32')]=_0x51c1f9;break;}return _0x388574;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index ee4c1e0..64c7340 100644 --- a/server/components/parsers/qs.js +++ b/server/components/parsers/qs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc978=['offset','sort','map','indexOf','priority','col','unsigned','ASC','omit','length','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','forEach','replace','join','getOptions','query','$id','model','intersection','attributes','nolimit','where','pick','filter','object','columns','merge','lower','options','lodash','sequelize','moment','keys','includes','parse','fields','split','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','YYYY-MM-DD','format','utc','subtract','name','uniqueid','isArray','limit'];(function(_0x27842c,_0x324fcb){var _0x493de8=function(_0x1f6c85){while(--_0x1f6c85){_0x27842c['push'](_0x27842c['shift']());}};_0x493de8(++_0x324fcb);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var sequelize=require(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x35f7e9){var _0x371c48=['ne'];try{var _0x44d4ea=JSON['parse'](_0x35f7e9);var _0x23f5e9=Object[_0x8c97('0x3')](_0x44d4ea)[0x0];return _0x371c48[_0x8c97('0x4')](_0x23f5e9);}catch(_0x2f12fc){return![];}}function getOperatorValue(_0x426a77){var _0x2a9434=JSON[_0x8c97('0x5')](_0x426a77);var _0x524196=Object[_0x8c97('0x3')](_0x2a9434)[0x0];var _0x1b5864=_0x2a9434[_0x524196];return{['$'+_0x524196]:_0x1b5864};}exports[_0x8c97('0x6')]=function(_0x26ff40){var _0x12116e=null;if(_0x26ff40){_0x12116e=_0x26ff40[_0x8c97('0x7')](',');}return _0x12116e;};exports[_0x8c97('0x8')]=function(_0x4f2d78,_0x179342){var _0x1234d4={};if(!_[_0x8c97('0x9')](_0x4f2d78)){_[_0x8c97('0xa')](_0x4f2d78,function(_0x400eb6,_0x949a83){try{if(_0x179342){var _0x1e8182=_[_0x8c97('0xb')](_0x179342,{'name':_0x949a83})||{};if(hasSequelizeOperator(_0x400eb6)){_0x1234d4[_0x949a83]=getOperatorValue(_0x400eb6);}else if(_0x1e8182[_0x8c97('0xc')]==='DATE'&&_[_0x8c97('0xd')](_0x400eb6)){var _0x346274=JSON['parse'](_0x400eb6);var _0x31ae92={'$gte':moment(moment(_0x346274[_0x8c97('0xe')])['format'](_0x8c97('0xf')))['utc']()['format'](),'$lte':moment(moment(_0x346274['$lte'])[_0x8c97('0x10')](_0x8c97('0xf')))[_0x8c97('0x11')]()[_0x8c97('0x12')](0x1,'s')[_0x8c97('0x10')]()};_0x1234d4[_0x949a83]=_0x31ae92;}else if(_0x1e8182[_0x8c97('0x13')]===_0x8c97('0x14')){_0x1234d4[_0x949a83]=_0x400eb6;}else{_0x1234d4[_0x949a83]=_[_0x8c97('0x15')](_0x400eb6)?_0x400eb6:JSON[_0x8c97('0x5')](_0x400eb6);}}else{_0x1234d4[_0x949a83]=_['isArray'](_0x400eb6)?_0x400eb6:JSON[_0x8c97('0x5')](_0x400eb6);}}catch(_0x3f7ac7){_0x1234d4[_0x949a83]=_0x400eb6[_0x8c97('0x7')](',');}});}return _0x1234d4;};exports[_0x8c97('0x16')]=function(_0x272010){_0x272010=parseInt(_0x272010,0xa);if(!_0x272010||_0x272010<0x0){_0x272010=LIMIT_VALUE;}return _0x272010;};exports[_0x8c97('0x17')]=function(_0xb502e7){_0xb502e7=parseInt(_0xb502e7,0xa);if(!_0xb502e7||_0xb502e7<0x0){_0xb502e7=0x0;}return _0xb502e7;};exports[_0x8c97('0x18')]=function(_0x9ea046){var _0x18e6fc,_0x3bb0fa=null;if(_0x9ea046){_0x18e6fc=_0x9ea046[_0x8c97('0x7')](',');_0x3bb0fa=_[_0x8c97('0x19')](_0x18e6fc,function(_0x16e3c4){if(_0x16e3c4[_0x8c97('0x1a')]('-')===0x0){return[_0x16e3c4===_0x8c97('0x1b')?sequelize['cast'](sequelize[_0x8c97('0x1c')](_0x8c97('0x1b')),_0x8c97('0x1d')):_0x16e3c4['substr'](0x1),'DESC'];}else{return[_0x16e3c4===_0x8c97('0x1b')?sequelize['cast'](sequelize[_0x8c97('0x1c')](_0x8c97('0x1b')),_0x8c97('0x1d')):_0x16e3c4,_0x8c97('0x1e')];}});}return _0x3bb0fa;};exports[_0x8c97('0x1f')]=function(_0x42464a,_0x18c81a){if(_['isEmpty'](_0x42464a)){return _0x42464a;}if(_['isArray'](_0x42464a)){for(var _0x3804d0=0x0;_0x3804d0<_0x42464a[_0x8c97('0x20')];_0x3804d0+=0x1){_0x42464a[_0x3804d0]=this[_0x8c97('0x1f')](_0x42464a[_0x3804d0],_0x18c81a);}return _0x42464a;}if(!_['isObject'](_0x42464a)){return _0x42464a;}if(_['isString'](_0x18c81a)){_0x18c81a=[_0x18c81a];}if(!_[_0x8c97('0x15')](_0x18c81a)){return _0x42464a;}for(var _0x37986d=0x0;_0x37986d<_0x18c81a[_0x8c97('0x20')];_0x37986d+=0x1){_[_0x8c97('0x21')](_0x42464a,_0x18c81a[_0x37986d]);}for(var _0x34f8be in _0x42464a){if(_0x42464a[_0x8c97('0x22')](_0x34f8be)){_0x42464a[_0x34f8be]=this['omit'](_0x42464a[_0x34f8be],_0x18c81a);}}return _0x42464a;};exports[_0x8c97('0x23')]=function(_0x509520){return _0x509520[_0x8c97('0x24')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x8c97('0x25')]=function(_0x154592){return _0x154592['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x8c97('0x26')]=function(_0x57fef8){var _0x388931=[];_0x57fef8[_0x8c97('0x7')](/[ ,]+/)[_0x8c97('0x27')](function(_0x2ebba4){_0x2ebba4=_0x2ebba4[_0x8c97('0x28')](/([^:]")"+/g,'$1');_0x2ebba4='+'+_0x2ebba4+'*';var _0x3644dd=/[ `!@#$%^&*()_\-?~]/;if(_0x2ebba4['match'](_0x3644dd))_0x2ebba4='\x22'+_0x2ebba4+'\x22';_0x388931['push'](_0x2ebba4);});return _0x388931[_0x8c97('0x29')]('\x20');};exports[_0x8c97('0x2a')]=function(_0x2575d0,_0x54af25,_0x3cf202){var _0x5db7a4={},_0x4a4d53={};if(_0x54af25[_0x8c97('0x2b')][_0x8c97('0x2c')]){_0x54af25[_0x8c97('0x2b')]['id']=_0x54af25[_0x8c97('0x2b')][_0x8c97('0x2c')];delete _0x54af25[_0x8c97('0x2b')]['$id'];}_0x5db7a4[_0x8c97('0x2d')]=_[_0x8c97('0x19')](_0x2575d0,_0x8c97('0x13'));_0x5db7a4[_0x8c97('0x2b')]=_[_0x8c97('0x3')](_0x54af25[_0x8c97('0x2b')]);_0x5db7a4[_0x8c97('0x8')]=_[_0x8c97('0x2e')](_0x5db7a4['model'],_0x5db7a4[_0x8c97('0x2b')]);_0x4a4d53[_0x8c97('0x2f')]=_[_0x8c97('0x2e')](_0x5db7a4[_0x8c97('0x2d')],this[_0x8c97('0x6')](_0x54af25[_0x8c97('0x2b')]['fields']));_0x4a4d53[_0x8c97('0x2f')]=_0x4a4d53[_0x8c97('0x2f')][_0x8c97('0x20')]?_0x4a4d53[_0x8c97('0x2f')]:_0x5db7a4[_0x8c97('0x2d')];if(!_0x54af25[_0x8c97('0x2b')][_0x8c97('0x22')](_0x8c97('0x30'))){_0x4a4d53[_0x8c97('0x16')]=this['limit'](_0x54af25[_0x8c97('0x2b')][_0x8c97('0x16')]);_0x4a4d53[_0x8c97('0x17')]=this[_0x8c97('0x17')](_0x54af25[_0x8c97('0x2b')][_0x8c97('0x17')]);}_0x4a4d53['order']=this[_0x8c97('0x18')](_0x54af25[_0x8c97('0x2b')][_0x8c97('0x18')]);_0x4a4d53[_0x8c97('0x31')]=this[_0x8c97('0x8')](_[_0x8c97('0x32')](_0x54af25[_0x8c97('0x2b')],_0x5db7a4[_0x8c97('0x8')]),_0x2575d0);if(_0x54af25[_0x8c97('0x2b')][_0x8c97('0x33')]){var _0x3220b7=_0x2575d0;var _0x367987=_0x54af25[_0x8c97('0x2b')][_0x8c97('0x33')];if(typeof _0x367987===_0x8c97('0x34')){_0x3220b7=_[_0x8c97('0x33')](_0x2575d0,function(_0x44f204){return _[_0x8c97('0x4')](_0x367987[_0x8c97('0x35')],_0x44f204[_0x8c97('0x13')]);});_0x367987=_0x367987['value'];}_0x4a4d53[_0x8c97('0x31')]=_[_0x8c97('0x36')](_0x4a4d53[_0x8c97('0x31')],{'$or':_[_0x8c97('0x19')](_0x3220b7,function(_0x35a230){if(_0x35a230[_0x8c97('0xc')]!=='VIRTUAL'){if(_0x3cf202){return sequelize[_0x8c97('0x31')](sequelize['fn'](_0x8c97('0x37'),sequelize[_0x8c97('0x1c')](_0x35a230[_0x8c97('0x13')])),{'$like':sequelize['fn'](_0x8c97('0x37'),'%'+_0x54af25[_0x8c97('0x2b')][_0x8c97('0x33')]+'%')});}else{var _0x2c07ee={};_0x2c07ee[_0x35a230[_0x8c97('0x13')]]={'$like':'%'+_0x54af25['query'][_0x8c97('0x33')]+'%'};return _0x2c07ee;}}})});}_0x4a4d53=_[_0x8c97('0x36')]({},_0x4a4d53,_0x54af25[_0x8c97('0x38')]);return _0x4a4d53;}; \ No newline at end of file +var _0x5162=['attributes','limit','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','lodash','parse','keys','includes','fields','split','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','cast','col','substr','DESC','unsigned','ASC','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','$id','query','model','intersection'];(function(_0x2013c7,_0x59f933){var _0x146363=function(_0x2960f6){while(--_0x2960f6){_0x2013c7['push'](_0x2013c7['shift']());}};_0x146363(++_0x59f933);}(_0x5162,0x103));var _0x2516=function(_0x32c9b9,_0x21a0cf){_0x32c9b9=_0x32c9b9-0x0;var _0x239eab=_0x5162[_0x32c9b9];return _0x239eab;};'use strict';var _=require(_0x2516('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5194e6){var _0x4db25c=['ne'];try{var _0x41fd28=JSON[_0x2516('0x1')](_0x5194e6);var _0x3ce7de=Object[_0x2516('0x2')](_0x41fd28)[0x0];return _0x4db25c[_0x2516('0x3')](_0x3ce7de);}catch(_0x25dce6){return![];}}function getOperatorValue(_0x3a7984){var _0x5b71b5=JSON['parse'](_0x3a7984);var _0x5beeb3=Object[_0x2516('0x2')](_0x5b71b5)[0x0];var _0xba4b36=_0x5b71b5[_0x5beeb3];return{['$'+_0x5beeb3]:_0xba4b36};}exports[_0x2516('0x4')]=function(_0x3a8834){var _0x3abc5d=null;if(_0x3a8834){_0x3abc5d=_0x3a8834[_0x2516('0x5')](',');}return _0x3abc5d;};exports[_0x2516('0x6')]=function(_0x590875,_0x409550){var _0x3f7e71={};if(!_[_0x2516('0x7')](_0x590875)){_['forOwn'](_0x590875,function(_0x530b1b,_0x4ba807){try{if(_0x409550){var _0x4ceaa1=_[_0x2516('0x8')](_0x409550,{'name':_0x4ba807})||{};if(hasSequelizeOperator(_0x530b1b)){_0x3f7e71[_0x4ba807]=getOperatorValue(_0x530b1b);}else if(_0x4ceaa1[_0x2516('0x9')]===_0x2516('0xa')&&_[_0x2516('0xb')](_0x530b1b)){var _0x56c69c=JSON[_0x2516('0x1')](_0x530b1b);var _0x458aca={'$gte':moment(moment(_0x56c69c[_0x2516('0xc')])[_0x2516('0xd')](_0x2516('0xe')))[_0x2516('0xf')]()[_0x2516('0xd')](),'$lte':moment(moment(_0x56c69c[_0x2516('0x10')])[_0x2516('0xd')](_0x2516('0xe')))[_0x2516('0xf')]()[_0x2516('0x11')](0x1,'s')[_0x2516('0xd')]()};_0x3f7e71[_0x4ba807]=_0x458aca;}else if(_0x4ceaa1[_0x2516('0x12')]===_0x2516('0x13')){_0x3f7e71[_0x4ba807]=_0x530b1b;}else{_0x3f7e71[_0x4ba807]=_['isArray'](_0x530b1b)?_0x530b1b:JSON[_0x2516('0x1')](_0x530b1b);}}else{_0x3f7e71[_0x4ba807]=_[_0x2516('0x14')](_0x530b1b)?_0x530b1b:JSON[_0x2516('0x1')](_0x530b1b);}}catch(_0x564d05){_0x3f7e71[_0x4ba807]=_0x530b1b[_0x2516('0x5')](',');}});}return _0x3f7e71;};exports['limit']=function(_0x532d46){_0x532d46=parseInt(_0x532d46,0xa);if(!_0x532d46||_0x532d46<0x0){_0x532d46=LIMIT_VALUE;}return _0x532d46;};exports[_0x2516('0x15')]=function(_0x3583cf){_0x3583cf=parseInt(_0x3583cf,0xa);if(!_0x3583cf||_0x3583cf<0x0){_0x3583cf=0x0;}return _0x3583cf;};exports[_0x2516('0x16')]=function(_0x618aed){var _0x198b93,_0x42ba50=null;if(_0x618aed){_0x198b93=_0x618aed[_0x2516('0x5')](',');_0x42ba50=_[_0x2516('0x17')](_0x198b93,function(_0x248c5a){if(_0x248c5a[_0x2516('0x18')]('-')===0x0){return[_0x248c5a===_0x2516('0x19')?sequelize[_0x2516('0x1a')](sequelize[_0x2516('0x1b')]('priority'),'unsigned'):_0x248c5a[_0x2516('0x1c')](0x1),_0x2516('0x1d')];}else{return[_0x248c5a===_0x2516('0x19')?sequelize[_0x2516('0x1a')](sequelize[_0x2516('0x1b')](_0x2516('0x19')),_0x2516('0x1e')):_0x248c5a,_0x2516('0x1f')];}});}return _0x42ba50;};exports['omit']=function(_0xa4538d,_0x39c63f){if(_[_0x2516('0x7')](_0xa4538d)){return _0xa4538d;}if(_[_0x2516('0x14')](_0xa4538d)){for(var _0x47f4fb=0x0;_0x47f4fb<_0xa4538d[_0x2516('0x20')];_0x47f4fb+=0x1){_0xa4538d[_0x47f4fb]=this[_0x2516('0x21')](_0xa4538d[_0x47f4fb],_0x39c63f);}return _0xa4538d;}if(!_[_0x2516('0x22')](_0xa4538d)){return _0xa4538d;}if(_[_0x2516('0x23')](_0x39c63f)){_0x39c63f=[_0x39c63f];}if(!_[_0x2516('0x14')](_0x39c63f)){return _0xa4538d;}for(var _0x4a3dc8=0x0;_0x4a3dc8<_0x39c63f[_0x2516('0x20')];_0x4a3dc8+=0x1){_[_0x2516('0x24')](_0xa4538d,_0x39c63f[_0x4a3dc8]);}for(var _0x935035 in _0xa4538d){if(_0xa4538d[_0x2516('0x25')](_0x935035)){_0xa4538d[_0x935035]=this[_0x2516('0x21')](_0xa4538d[_0x935035],_0x39c63f);}}return _0xa4538d;};exports[_0x2516('0x26')]=function(_0x556f01){return _0x556f01[_0x2516('0x27')](RegExp(_0x2516('0x28')))?!![]:![];};exports['isEmail']=function(_0x19d90d){return _0x19d90d[_0x2516('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0x2516('0x29')]=function(_0x3b1aa6){var _0x539704=[];_0x3b1aa6[_0x2516('0x5')](/[ ,]+/)[_0x2516('0x2a')](function(_0x3c1daf){_0x3c1daf=_0x3c1daf[_0x2516('0x2b')](/([^:]")"+/g,'$1');_0x3c1daf='+'+_0x3c1daf+'*';var _0x12d790=/[ `!@#$%^&*()_\-?~]/;if(_0x3c1daf[_0x2516('0x27')](_0x12d790))_0x3c1daf='\x22'+_0x3c1daf+'\x22';_0x539704[_0x2516('0x2c')](_0x3c1daf);});return _0x539704[_0x2516('0x2d')]('\x20');};exports[_0x2516('0x2e')]=function(_0xe29221,_0x56fda8,_0x3e7a55){var _0x54147b={},_0x35fdf8={};if(_0x56fda8['query'][_0x2516('0x2f')]){_0x56fda8['query']['id']=_0x56fda8[_0x2516('0x30')][_0x2516('0x2f')];delete _0x56fda8[_0x2516('0x30')][_0x2516('0x2f')];}_0x54147b[_0x2516('0x31')]=_[_0x2516('0x17')](_0xe29221,_0x2516('0x12'));_0x54147b[_0x2516('0x30')]=_[_0x2516('0x2')](_0x56fda8['query']);_0x54147b[_0x2516('0x6')]=_[_0x2516('0x32')](_0x54147b[_0x2516('0x31')],_0x54147b[_0x2516('0x30')]);_0x35fdf8['attributes']=_['intersection'](_0x54147b[_0x2516('0x31')],this[_0x2516('0x4')](_0x56fda8[_0x2516('0x30')][_0x2516('0x4')]));_0x35fdf8[_0x2516('0x33')]=_0x35fdf8[_0x2516('0x33')][_0x2516('0x20')]?_0x35fdf8[_0x2516('0x33')]:_0x54147b[_0x2516('0x31')];if(!_0x56fda8[_0x2516('0x30')]['hasOwnProperty']('nolimit')){_0x35fdf8[_0x2516('0x34')]=this[_0x2516('0x34')](_0x56fda8['query']['limit']);_0x35fdf8[_0x2516('0x15')]=this[_0x2516('0x15')](_0x56fda8['query'][_0x2516('0x15')]);}_0x35fdf8['order']=this[_0x2516('0x16')](_0x56fda8[_0x2516('0x30')]['sort']);_0x35fdf8[_0x2516('0x35')]=this[_0x2516('0x6')](_[_0x2516('0x36')](_0x56fda8[_0x2516('0x30')],_0x54147b[_0x2516('0x6')]),_0xe29221);if(_0x56fda8[_0x2516('0x30')][_0x2516('0x37')]){var _0x2371a8=_0xe29221;var _0x346e31=_0x56fda8[_0x2516('0x30')][_0x2516('0x37')];if(typeof _0x346e31===_0x2516('0x38')){_0x2371a8=_[_0x2516('0x37')](_0xe29221,function(_0x4c832b){return _[_0x2516('0x3')](_0x346e31[_0x2516('0x39')],_0x4c832b['name']);});_0x346e31=_0x346e31[_0x2516('0x3a')];}_0x35fdf8[_0x2516('0x35')]=_[_0x2516('0x3b')](_0x35fdf8[_0x2516('0x35')],{'$or':_[_0x2516('0x17')](_0x2371a8,function(_0x582cb6){if(_0x582cb6[_0x2516('0x9')]!==_0x2516('0x3c')){if(_0x3e7a55){return sequelize[_0x2516('0x35')](sequelize['fn'](_0x2516('0x3d'),sequelize[_0x2516('0x1b')](_0x582cb6[_0x2516('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x56fda8[_0x2516('0x30')][_0x2516('0x37')]+'%')});}else{var _0xe64acc={};_0xe64acc[_0x582cb6[_0x2516('0x12')]]={'$like':'%'+_0x56fda8[_0x2516('0x30')][_0x2516('0x37')]+'%'};return _0xe64acc;}}})});}_0x35fdf8=_[_0x2516('0x3b')]({},_0x35fdf8,_0x56fda8['options']);return _0x35fdf8;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 6ea2316..9a79f92 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2454=['client','http','chatPause','faxPause','mailPause','openchannelPause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','voicePause','pause','every','chatStatus','faxStatus','smsStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','smsPause','pauseType','globalStatus','getSortedAgentsIdsByStatus','split','startsWith','DESC','ASC','getUpdatedSortOptions','internal','indexOf','validateSortParameter','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','mailCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatus','mailStatus','whatsappStatus','openchannelStatusTime','smsStatusTime','whatsappStatusTime','queue','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb'];(function(_0x4427a0,_0x39edb4){var _0x2a9ccf=function(_0x39e02b){while(--_0x39e02b){_0x4427a0['push'](_0x4427a0['shift']());}};_0x2a9ccf(++_0x39edb4);}(_0x2454,0x111));var _0x4245=function(_0x490a62,_0x1fb76d){_0x490a62=_0x490a62-0x0;var _0xbe7859=_0x2454[_0x490a62];return _0xbe7859;};'use strict';var _=require(_0x4245('0x0'));var jayson=require(_0x4245('0x1'));var db=require(_0x4245('0x2'))['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0x4245('0x3')][_0x4245('0x4')]({'port':0x232c});function isAgentPaused(_0x1990b0,_0x30e9ac){var _0x34c4d6=[_0x1990b0[_0x4245('0x5')],_0x1990b0[_0x4245('0x6')],_0x1990b0[_0x4245('0x7')],_0x1990b0[_0x4245('0x8')],_0x1990b0['smsPause'],_0x1990b0['voicePause'],_0x1990b0[_0x4245('0x9')]];if(!_0x30e9ac)return _['every'](_0x34c4d6);var _0x104f49=_[_0x4245('0xa')](_0x34c4d6);return _0x104f49['length']>0x0&&_0x104f49[_0x4245('0xb')]<_0x34c4d6[_0x4245('0xb')]?!![]:![];}function isIdle(_0x5ccf81){return _0x5ccf81===_0x4245('0xc')||_0x5ccf81===_0x4245('0xd')||_0x5ccf81===_0x4245('0xe')||_0x5ccf81===_0x4245('0xf')||_[_0x4245('0x10')](_0x5ccf81);}function isAgentIdle(_0x8c4f4e){if(_0x8c4f4e[_0x4245('0x11')]!==_0x4245('0xc')&&_0x8c4f4e[_0x4245('0x12')]){_0x8c4f4e[_0x4245('0x11')]=_0x4245('0x13');return![];}return _[_0x4245('0x14')]([_0x8c4f4e[_0x4245('0x15')],_0x8c4f4e[_0x4245('0x16')],_0x8c4f4e['mailStatus'],_0x8c4f4e['openchannelStatus'],_0x8c4f4e[_0x4245('0x17')],_0x8c4f4e[_0x4245('0x11')],_0x8c4f4e['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x4245('0x18')](_0x4245('0x19'),{})[_0x4245('0x1a')](function(_0x2bb153){if(_0x2bb153[_0x4245('0x1b')]){throw new Error(_0x4245('0x1c'));}var _0x555f3f=_0x2bb153[_0x4245('0x1d')];return routingClient['request'](_0x4245('0x19'),{})[_0x4245('0x1a')](function(_0x54d47d){if(_0x54d47d[_0x4245('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x159bf6=_0x54d47d[_0x4245('0x1d')];return _[_0x4245('0x1e')]({},_0x555f3f,_0x159bf6);});})[_0x4245('0x1f')](function(_0x530a6b){throw _0x530a6b;});}exports[_0x4245('0x20')]=getRealtimeAgents;function getAgentStatus(_0x13d998){var _0x1b2f3c='unknown';if(isAgentPaused(_0x13d998))_0x1b2f3c=_0x4245('0x13');else if(isAgentPaused(_0x13d998,!![]))_0x1b2f3c='*pause';else if(isAgentIdle(_0x13d998))_0x1b2f3c=_0x4245('0xc');else _0x1b2f3c=_0x4245('0x21');return _0x1b2f3c;}exports[_0x4245('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x42a736,_0x3396c9){var _0x78647a=_[_0x4245('0x23')](_0x42a736)?_0x42a736:[_0x42a736];var _0x565642=_[_0x4245('0x24')](_0x3396c9)+_0x4245('0x25');var _0x255520=_[_0x4245('0x26')](_0x78647a,function(_0x22c3b7){return db[_0x565642][_0x4245('0x27')]({'where':{'id':_0x22c3b7}})['then'](function(_0x153645){if(!_0x153645)return[];return _0x153645['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x4245('0x28')](_0x255520)[_0x4245('0x1a')](function(_0x3119b9){var _0x333804=_(_0x3119b9)[_0x4245('0x29')]()[_0x4245('0x26')]('id')[_0x4245('0x2a')]()[_0x4245('0x2b')]();return _0x333804;});}exports[_0x4245('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0xf3e9e5,_0x265f73,_0x41bc63){try{if(_0x265f73[_0x4245('0xb')]>0x0){_0xf3e9e5=_0xf3e9e5[_0x4245('0xa')](function(_0x498b7a){return _0x265f73[_0x4245('0x2d')](_0x498b7a['id']);});}var _0x1602f5=_0xf3e9e5[_0x4245('0xa')](function(_0x59be9a){var _0x1fbdde='busy';if(isAgentIdle(_0x59be9a)){_0x1fbdde='idle';}return _0x1fbdde===_0x41bc63;});return _[_0x4245('0x26')](_0x1602f5,'id');}catch(_0x83dcff){throw _0x83dcff;}}exports[_0x4245('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x510c9a,_0x519d48,_0x3531bb){return Promise[_0x4245('0x2f')]()[_0x4245('0x1a')](function(){if(_0x519d48[_0x4245('0xb')]>0x0){_0x510c9a=_0x510c9a[_0x4245('0xa')](function(_0x51dcfa){return _0x519d48[_0x4245('0x2d')](_0x51dcfa['id']);});}return _0x510c9a;})['then'](function(){return db[_0x4245('0x30')][_0x4245('0x31')]({'attributes':['id',_0x4245('0x32'),_0x4245('0x33'),'chatPause',_0x4245('0x6'),'mailPause',_0x4245('0x8'),_0x4245('0x34'),_0x4245('0x12'),'whatsappPause',_0x4245('0x35')],'where':{'id':{'$in':_[_0x4245('0x26')](_0x510c9a,'id')}},'raw':!![]});})[_0x4245('0x1a')](function(_0x154b86){return _0x154b86[_0x4245('0x26')](function(_0x3dce24){var _0x1b8c01=_['find'](_0x510c9a,['id',_0x3dce24['id']]);var _0x606668=filterAgentAttributes(_0x1b8c01);_[_0x4245('0x1e')](_0x3dce24,_0x606668);_0x3dce24[_0x4245('0x36')]=getAgentStatus(_0x3dce24);return _0x3dce24;});})[_0x4245('0x1a')](function(_0x113909){var _0x13156a=sortAgentsByStatus(_0x113909,_0x3531bb);return _[_0x4245('0x26')](_0x13156a,'id');})[_0x4245('0x1f')](function(_0x248ebb){throw _0x248ebb;});}exports[_0x4245('0x37')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x17b0e1){var _0x2959eb={'fields':[],'order':null};var _0x15365c=_0x17b0e1[_0x4245('0x38')](',');_0x2959eb['fields']=_['filter'](_0x15365c,function(_0x193e8d){if(!_0x193e8d[_0x4245('0x2d')]('globalStatus')){return!![];}_0x2959eb['order']=_[_0x4245('0x39')](_0x193e8d,'-')?_0x4245('0x3a'):_0x4245('0x3b');return![];});return _0x2959eb;}exports[_0x4245('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x19dc6b){if(_0x19dc6b[_0x4245('0x2d')](_0x4245('0x33'))&&!_0x19dc6b['includes'](_0x4245('0x3d'))){var _0x3d0c58=_0x19dc6b['substring'](0x0,_0x19dc6b[_0x4245('0x3e')](_0x4245('0x33')));_0x19dc6b+=','+_0x3d0c58+_0x4245('0x3d');}return _0x19dc6b;}exports[_0x4245('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0xc683aa,_0x4ca26c){var _0x2e9bfa=_0xc683aa['sort'](function(_0xe6d369,_0x57e3e9){if(_0xe6d369['globalStatus']===_0x57e3e9[_0x4245('0x36')]){if(_0xe6d369[_0x4245('0x36')]===_0x4245('0x13')){if(_0x4ca26c==='DESC'){return(_0xe6d369[_0x4245('0x35')]||'')<(_0x57e3e9[_0x4245('0x35')]||'')||_0xe6d369[_0x4245('0x33')]['toLowerCase']()>_0x57e3e9[_0x4245('0x33')][_0x4245('0x40')]()?0x1:-0x1;}else{return(_0xe6d369[_0x4245('0x35')]||'')<(_0x57e3e9[_0x4245('0x35')]||'')||_0xe6d369[_0x4245('0x33')][_0x4245('0x40')]()>_0x57e3e9[_0x4245('0x33')][_0x4245('0x40')]()?-0x1:0x1;}}else{if(_0x4ca26c==='DESC'){return _0xe6d369[_0x4245('0x33')]['toLowerCase']()<_0x57e3e9[_0x4245('0x33')][_0x4245('0x40')]()?0x1:-0x1;}else{return _0xe6d369[_0x4245('0x33')][_0x4245('0x40')]()<_0x57e3e9['fullname'][_0x4245('0x40')]()?-0x1:0x1;}}}else{if(_0x4ca26c==='DESC'){return _0xe6d369['globalStatus']<_0x57e3e9[_0x4245('0x36')]?0x1:-0x1;}else{return _0xe6d369[_0x4245('0x36')]<_0x57e3e9[_0x4245('0x36')]?-0x1:0x1;}}});return _0x2e9bfa;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x415560){var _0x25b58d=[_0x4245('0x41'),_0x4245('0x42'),_0x4245('0x43'),_0x4245('0x44'),_0x4245('0x35'),'lastPauseAt',_0x4245('0x3d'),_0x4245('0x45'),'chatPause',_0x4245('0x8'),_0x4245('0x7'),'smsPause',_0x4245('0x9'),'faxPause',_0x4245('0x12'),_0x4245('0x46'),'openchannelCapacity',_0x4245('0x47'),_0x4245('0x48'),'whatsappCapacity',_0x4245('0x49'),_0x4245('0x4a'),_0x4245('0x4b'),_0x4245('0x4c'),_0x4245('0x4d'),_0x4245('0x4e'),_0x4245('0x4f'),_0x4245('0x15'),_0x4245('0x50'),_0x4245('0x51'),_0x4245('0x17'),_0x4245('0x52'),'faxStatus',_0x4245('0x11'),'chatStatusTime',_0x4245('0x53'),'mailStatusTime',_0x4245('0x54'),_0x4245('0x55'),'faxStatusTime','voiceStatusTime',_0x4245('0x56'),'destconnectedlinenum','screenrecording',_0x4245('0x57'),'phoneBarEnableAutomaticScreenRecording',_0x4245('0x58')];var _0x23dace=[_0x4245('0x5'),_0x4245('0x8'),'mailPause','smsPause',_0x4245('0x9'),_0x4245('0x6'),_0x4245('0x12'),'online'];var _0x15787c=_(_0x415560)[_0x4245('0x59')](_0x23dace)[_0x4245('0x5a')](_0x25b58d)[_0x4245('0x2b')]();return _0x15787c;}exports[_0x4245('0x5b')]=filterAgentAttributes; \ No newline at end of file +var _0x707a=['ringing','isNil','voiceStatus','voicePause','pause','chatStatus','openchannelStatus','whatsappStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','flatten','uniq','getAgentIdsByStatus','includes','User','name','fullname','chatPause','whatsappPause','pauseType','merge','split','fields','globalStatus','startsWith','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','DESC','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','value','lodash','jayson/promise','client','faxPause','mailPause','openchannelPause','smsPause','every','filter','length','idle','unavailable'];(function(_0x4dc1d8,_0x56976e){var _0x3f56cd=function(_0x378313){while(--_0x378313){_0x4dc1d8['push'](_0x4dc1d8['shift']());}};_0x3f56cd(++_0x56976e);}(_0x707a,0x102));var _0xa707=function(_0x3cf64b,_0x5d2fee){_0x3cf64b=_0x3cf64b-0x0;var _0x183727=_0x707a[_0x3cf64b];return _0x183727;};'use strict';var _=require(_0xa707('0x0'));var jayson=require(_0xa707('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xa707('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xa707('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x38bc3a,_0x29e12d){var _0x43e81f=[_0x38bc3a['chatPause'],_0x38bc3a[_0xa707('0x3')],_0x38bc3a[_0xa707('0x4')],_0x38bc3a[_0xa707('0x5')],_0x38bc3a[_0xa707('0x6')],_0x38bc3a['voicePause'],_0x38bc3a['whatsappPause']];if(!_0x29e12d)return _[_0xa707('0x7')](_0x43e81f);var _0x597e92=_[_0xa707('0x8')](_0x43e81f);return _0x597e92[_0xa707('0x9')]>0x0&&_0x597e92[_0xa707('0x9')]<_0x43e81f[_0xa707('0x9')]?!![]:![];}function isIdle(_0x4292fa){return _0x4292fa===_0xa707('0xa')||_0x4292fa==='unknown'||_0x4292fa===_0xa707('0xb')||_0x4292fa===_0xa707('0xc')||_[_0xa707('0xd')](_0x4292fa);}function isAgentIdle(_0x1e71f9){if(_0x1e71f9[_0xa707('0xe')]!==_0xa707('0xa')&&_0x1e71f9[_0xa707('0xf')]){_0x1e71f9[_0xa707('0xe')]=_0xa707('0x10');return![];}return _[_0xa707('0x7')]([_0x1e71f9[_0xa707('0x11')],_0x1e71f9['faxStatus'],_0x1e71f9['mailStatus'],_0x1e71f9[_0xa707('0x12')],_0x1e71f9['smsStatus'],_0x1e71f9['voiceStatus'],_0x1e71f9[_0xa707('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0xa707('0x14')](function(_0x470094){if(_0x470094[_0xa707('0x15')]){throw new Error(_0xa707('0x16'));}var _0x1ea568=_0x470094[_0xa707('0x17')];return routingClient['request']('Agents',{})[_0xa707('0x14')](function(_0x5c913d){if(_0x5c913d['error']){throw new Error(_0xa707('0x18'));}var _0x42ec8f=_0x5c913d[_0xa707('0x17')];return _['merge']({},_0x1ea568,_0x42ec8f);});})[_0xa707('0x19')](function(_0x329df2){throw _0x329df2;});}exports[_0xa707('0x1a')]=getRealtimeAgents;function getAgentStatus(_0x5eaf0c){var _0x10c41c='unknown';if(isAgentPaused(_0x5eaf0c))_0x10c41c=_0xa707('0x10');else if(isAgentPaused(_0x5eaf0c,!![]))_0x10c41c=_0xa707('0x1b');else if(isAgentIdle(_0x5eaf0c))_0x10c41c='idle';else _0x10c41c=_0xa707('0x1c');return _0x10c41c;}exports[_0xa707('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x13d97b,_0x130131){var _0x25c023=_[_0xa707('0x1e')](_0x13d97b)?_0x13d97b:[_0x13d97b];var _0x31b558=_['startCase'](_0x130131)+_0xa707('0x1f');var _0x57763e=_[_0xa707('0x20')](_0x25c023,function(_0x197a38){return db[_0x31b558][_0xa707('0x21')]({'where':{'id':_0x197a38}})[_0xa707('0x14')](function(_0x238a07){if(!_0x238a07)return[];return _0x238a07[_0xa707('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa707('0x23')](_0x57763e)[_0xa707('0x14')](function(_0xc836b){var _0x1178a5=_(_0xc836b)[_0xa707('0x24')]()[_0xa707('0x20')]('id')[_0xa707('0x25')]()['value']();return _0x1178a5;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x281f02,_0x3c4c97,_0x55593e){try{if(_0x3c4c97[_0xa707('0x9')]>0x0){_0x281f02=_0x281f02[_0xa707('0x8')](function(_0x5c12b9){return _0x3c4c97['includes'](_0x5c12b9['id']);});}var _0x934d3b=_0x281f02[_0xa707('0x8')](function(_0x509740){var _0x59f796=_0xa707('0x1c');if(isAgentIdle(_0x509740)){_0x59f796='idle';}return _0x59f796===_0x55593e;});return _[_0xa707('0x20')](_0x934d3b,'id');}catch(_0x2417ba){throw _0x2417ba;}}exports[_0xa707('0x26')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5b6314,_0x1c2fe8,_0x3c278d){return Promise['resolve']()['then'](function(){if(_0x1c2fe8[_0xa707('0x9')]>0x0){_0x5b6314=_0x5b6314['filter'](function(_0x3ab8d4){return _0x1c2fe8[_0xa707('0x27')](_0x3ab8d4['id']);});}return _0x5b6314;})[_0xa707('0x14')](function(){return db[_0xa707('0x28')]['findAll']({'attributes':['id',_0xa707('0x29'),_0xa707('0x2a'),_0xa707('0x2b'),'faxPause',_0xa707('0x4'),_0xa707('0x5'),_0xa707('0x6'),_0xa707('0xf'),_0xa707('0x2c'),_0xa707('0x2d')],'where':{'id':{'$in':_[_0xa707('0x20')](_0x5b6314,'id')}},'raw':!![]});})['then'](function(_0x6a6943){return _0x6a6943[_0xa707('0x20')](function(_0x5d0aaf){var _0x3df697=_['find'](_0x5b6314,['id',_0x5d0aaf['id']]);var _0x2a84b1=filterAgentAttributes(_0x3df697);_[_0xa707('0x2e')](_0x5d0aaf,_0x2a84b1);_0x5d0aaf['globalStatus']=getAgentStatus(_0x5d0aaf);return _0x5d0aaf;});})[_0xa707('0x14')](function(_0x4e51ec){var _0x47d3ac=sortAgentsByStatus(_0x4e51ec,_0x3c278d);return _[_0xa707('0x20')](_0x47d3ac,'id');})['catch'](function(_0x2798fb){throw _0x2798fb;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x37fd0c){var _0xf7a130={'fields':[],'order':null};var _0xdf6a77=_0x37fd0c[_0xa707('0x2f')](',');_0xf7a130[_0xa707('0x30')]=_[_0xa707('0x8')](_0xdf6a77,function(_0x5baee9){if(!_0x5baee9[_0xa707('0x27')](_0xa707('0x31'))){return!![];}_0xf7a130['order']=_[_0xa707('0x32')](_0x5baee9,'-')?'DESC':_0xa707('0x33');return![];});return _0xf7a130;}exports[_0xa707('0x34')]=getUpdatedSortOptions;function validateSortParameter(_0x41b314){if(_0x41b314[_0xa707('0x27')]('fullname')&&!_0x41b314[_0xa707('0x27')](_0xa707('0x35'))){var _0x35bb09=_0x41b314[_0xa707('0x36')](0x0,_0x41b314[_0xa707('0x37')](_0xa707('0x2a')));_0x41b314+=','+_0x35bb09+_0xa707('0x35');}return _0x41b314;}exports[_0xa707('0x38')]=validateSortParameter;function sortAgentsByStatus(_0x3a365e,_0x78e441){var _0x1b334a=_0x3a365e[_0xa707('0x39')](function(_0x2b4e6f,_0x499421){if(_0x2b4e6f[_0xa707('0x31')]===_0x499421[_0xa707('0x31')]){if(_0x2b4e6f[_0xa707('0x31')]==='pause'){if(_0x78e441===_0xa707('0x3a')){return(_0x2b4e6f['pauseType']||'')<(_0x499421[_0xa707('0x2d')]||'')||_0x2b4e6f[_0xa707('0x2a')][_0xa707('0x3b')]()>_0x499421[_0xa707('0x2a')][_0xa707('0x3b')]()?0x1:-0x1;}else{return(_0x2b4e6f[_0xa707('0x2d')]||'')<(_0x499421[_0xa707('0x2d')]||'')||_0x2b4e6f[_0xa707('0x2a')]['toLowerCase']()>_0x499421[_0xa707('0x2a')][_0xa707('0x3b')]()?-0x1:0x1;}}else{if(_0x78e441===_0xa707('0x3a')){return _0x2b4e6f['fullname'][_0xa707('0x3b')]()<_0x499421[_0xa707('0x2a')][_0xa707('0x3b')]()?0x1:-0x1;}else{return _0x2b4e6f[_0xa707('0x2a')][_0xa707('0x3b')]()<_0x499421[_0xa707('0x2a')][_0xa707('0x3b')]()?-0x1:0x1;}}}else{if(_0x78e441===_0xa707('0x3a')){return _0x2b4e6f[_0xa707('0x31')]<_0x499421[_0xa707('0x31')]?0x1:-0x1;}else{return _0x2b4e6f[_0xa707('0x31')]<_0x499421[_0xa707('0x31')]?-0x1:0x1;}}});return _0x1b334a;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x2698eb){var _0x4c7390=[_0xa707('0x3c'),_0xa707('0x3d'),_0xa707('0x3e'),'lastPauseAt',_0xa707('0x2d'),_0xa707('0x3f'),_0xa707('0x35'),'address',_0xa707('0x2b'),'openchannelPause',_0xa707('0x4'),_0xa707('0x6'),'whatsappPause',_0xa707('0x3'),_0xa707('0xf'),_0xa707('0x40'),_0xa707('0x41'),_0xa707('0x42'),_0xa707('0x43'),_0xa707('0x44'),_0xa707('0x45'),_0xa707('0x46'),'openchannelCurrentCapacity',_0xa707('0x47'),_0xa707('0x48'),_0xa707('0x49'),'faxCurrentCapacity',_0xa707('0x11'),_0xa707('0x12'),_0xa707('0x4a'),'smsStatus',_0xa707('0x13'),'faxStatus',_0xa707('0xe'),_0xa707('0x4b'),_0xa707('0x4c'),_0xa707('0x4d'),_0xa707('0x4e'),_0xa707('0x4f'),_0xa707('0x50'),_0xa707('0x51'),_0xa707('0x52'),_0xa707('0x53'),'screenrecording',_0xa707('0x54'),_0xa707('0x55'),_0xa707('0x56')];var _0x1ada18=[_0xa707('0x2b'),_0xa707('0x5'),_0xa707('0x4'),_0xa707('0x6'),'whatsappPause',_0xa707('0x3'),'voicePause',_0xa707('0x3d')];var _0x5d71af=_(_0x2698eb)[_0xa707('0x57')](_0x1ada18)[_0xa707('0x58')](_0x4c7390)[_0xa707('0x59')]();return _0x5d71af;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index f9903c0..816163a 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49c8=['client','available','loggedIn','paused','waiting','inUse','invalid','notInUse','onHold','ringInUse','unavailable','unknown','message','dialMethod','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','voice','inbound','outbound','concat','get','loggedInDb','busy','pTalking','find','pick','initializeQueues','lodash','jayson/promise','util','http'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x49c8,0xd0));var _0x849c=function(_0x4fde46,_0x4622e5){_0x4fde46=_0x4fde46-0x0;var _0x1af73e=_0x49c8[_0x4fde46];return _0x1af73e;};'use strict';var _=require(_0x849c('0x0'));var jayson=require(_0x849c('0x1'));var util=require(_0x849c('0x2'));var amiClient=jayson['client'][_0x849c('0x3')]({'port':0x232a});var routingClient=jayson[_0x849c('0x4')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x849c('0x5'),_0x849c('0x6'),_0x849c('0x7'),_0x849c('0x8')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x849c('0x9'),_0x849c('0xa'),'loggedInDb',_0x849c('0xb'),_0x849c('0xc'),'ringing',_0x849c('0xd'),'talking',_0x849c('0xe'),_0x849c('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated',_0x849c('0x10'),'statusMessage','dialActive',_0x849c('0x11'),'Trunk',_0x849c('0x12'),_0x849c('0x13'),_0x849c('0x14'),'erlangCallToSecond',_0x849c('0x15'),_0x849c('0x16'),_0x849c('0x17'),_0x849c('0x18'),_0x849c('0x19'),_0x849c('0x1a'),'predictiveIntervalTotalCalls',_0x849c('0x1b'),_0x849c('0x1c'),_0x849c('0x1d'),_0x849c('0x1e'),_0x849c('0x1f')];function getRealtimeQueues(_0x26872f,_0x43af12){var _0x10b6b3=_0x43af12==='voice'?amiClient:routingClient;return _0x10b6b3[_0x849c('0x20')](_[_0x849c('0x21')](_0x43af12)+_0x849c('0x22'),_0x26872f)[_0x849c('0x23')](function(_0x5a10da){if(_0x5a10da[_0x849c('0x24')])throw new Error(util[_0x849c('0x25')](_0x849c('0x26'),_0x43af12));return _0x5a10da[_0x849c('0x27')];})[_0x849c('0x28')](function(_0xd1afd2){throw _0xd1afd2;});}exports[_0x849c('0x29')]=getRealtimeQueues;function initializeQueues(_0x48e77a,_0x2befeb,_0x34f2fb,_0x3b86a7){var _0x202818=DEFAULT_QUEUE_ATTRIBUTES;if(_0x34f2fb===_0x849c('0x2a')){if(_0x3b86a7===_0x849c('0x2b')){_0x202818=_0x202818['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3b86a7===_0x849c('0x2c')){_0x202818=_0x202818[_0x849c('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x48e77a['map'](function(_0x485aec){var _0xb3737b=_0x485aec[_0x849c('0x2e')]({'plain':!![]});_0xb3737b[_0x849c('0x7')]=0x0;_0xb3737b[_0x849c('0x2f')]=0x0;_0xb3737b[_0x849c('0x6')]=0x0;_0xb3737b[_0x849c('0x5')]=0x0;_0xb3737b['waiting']=0x0;if(_0x34f2fb==='voice'){_0xb3737b['talking']=0x0;_0xb3737b[_0x849c('0x30')]=0x0;if(_0x3b86a7===_0x849c('0x2c')){_0xb3737b[_0x849c('0x31')]=0x0;_0xb3737b['originated']=0x0;}}var _0x2df5a9=_[_0x849c('0x32')](_0x2befeb,['id',_0xb3737b['id']]);if(_0x2df5a9){_['merge'](_0xb3737b,_[_0x849c('0x33')](_0x2df5a9,_0x202818));}return _0xb3737b;});}exports[_0x849c('0x34')]=initializeQueues; \ No newline at end of file +var _0x1c3e=['talking','unavailable','unknown','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','inbound','concat','outbound','map','get','loggedIn','busy','find','merge','pick','initializeQueues','lodash','util','client','http','available','paused','waiting','inUse','invalid','loggedInDb','notInUse','onHold'];(function(_0x17a472,_0x54811b){var _0x36a618=function(_0x17317){while(--_0x17317){_0x17a472['push'](_0x17a472['shift']());}};_0x36a618(++_0x54811b);}(_0x1c3e,0x194));var _0xe1c3=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0x1c3e[_0x40015a];return _0x42f8a4;};'use strict';var _=require(_0xe1c3('0x0'));var jayson=require('jayson/promise');var util=require(_0xe1c3('0x1'));var amiClient=jayson[_0xe1c3('0x2')][_0xe1c3('0x3')]({'port':0x232a});var routingClient=jayson[_0xe1c3('0x2')][_0xe1c3('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xe1c3('0x4'),'loggedIn',_0xe1c3('0x5'),_0xe1c3('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xe1c3('0x7'),_0xe1c3('0x8'),_0xe1c3('0x9'),_0xe1c3('0xa'),_0xe1c3('0xb'),'ringing','ringInUse',_0xe1c3('0xc'),_0xe1c3('0xd'),_0xe1c3('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xe1c3('0xf'),_0xe1c3('0x10'),_0xe1c3('0x11'),'statusMessage',_0xe1c3('0x12'),_0xe1c3('0x13'),_0xe1c3('0x14'),_0xe1c3('0x15'),_0xe1c3('0x16'),_0xe1c3('0x17'),'erlangCallToSecond',_0xe1c3('0x18'),'erlangBusyFactor',_0xe1c3('0x19'),_0xe1c3('0x1a'),_0xe1c3('0x1b'),_0xe1c3('0x1c'),'predictiveIntervalTotalCalls',_0xe1c3('0x1d'),_0xe1c3('0x1e'),_0xe1c3('0x1f'),_0xe1c3('0x20'),_0xe1c3('0x21')];function getRealtimeQueues(_0x5020a4,_0x4be8bd){var _0x2a81ff=_0x4be8bd===_0xe1c3('0x22')?amiClient:routingClient;return _0x2a81ff[_0xe1c3('0x23')](_[_0xe1c3('0x24')](_0x4be8bd)+'Queues',_0x5020a4)[_0xe1c3('0x25')](function(_0x4be13f){if(_0x4be13f[_0xe1c3('0x26')])throw new Error(util[_0xe1c3('0x27')](_0xe1c3('0x28'),_0x4be8bd));return _0x4be13f['result'];})['catch'](function(_0x79f740){throw _0x79f740;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x482e61,_0x428e59,_0x35bf6b,_0x29d7cd){var _0x70b2c6=DEFAULT_QUEUE_ATTRIBUTES;if(_0x35bf6b==='voice'){if(_0x29d7cd===_0xe1c3('0x29')){_0x70b2c6=_0x70b2c6[_0xe1c3('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x29d7cd===_0xe1c3('0x2b')){_0x70b2c6=_0x70b2c6[_0xe1c3('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x482e61[_0xe1c3('0x2c')](function(_0x45498f){var _0x4bb244=_0x45498f[_0xe1c3('0x2d')]({'plain':!![]});_0x4bb244['paused']=0x0;_0x4bb244[_0xe1c3('0x9')]=0x0;_0x4bb244[_0xe1c3('0x2e')]=0x0;_0x4bb244['available']=0x0;_0x4bb244['waiting']=0x0;if(_0x35bf6b==='voice'){_0x4bb244[_0xe1c3('0xc')]=0x0;_0x4bb244[_0xe1c3('0x2f')]=0x0;if(_0x29d7cd===_0xe1c3('0x2b')){_0x4bb244['pTalking']=0x0;_0x4bb244[_0xe1c3('0x10')]=0x0;}}var _0x52acdb=_[_0xe1c3('0x30')](_0x428e59,['id',_0x4bb244['id']]);if(_0x52acdb){_[_0xe1c3('0x31')](_0x4bb244,_[_0xe1c3('0x32')](_0x52acdb,_0x70b2c6));}return _0x4bb244;});}exports[_0xe1c3('0x33')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index cdb6cd6..ca46778 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x2c8b7a,_0x483fe0){var _0x1c1cf9=function(_0x464bcf){while(--_0x464bcf){_0x2c8b7a['push'](_0x2c8b7a['shift']());}};_0x1c1cf9(++_0x483fe0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x5997f4,_0x482272){var _0xa47e6a=function(_0x451754){while(--_0x451754){_0x5997f4['push'](_0x5997f4['shift']());}};_0xa47e6a(++_0x482272);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 33a8217..7d482a0 100644 --- a/server/config/license/hardware.js +++ b/server/config/license/hardware.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5efc=['length','filter','family','IPv4','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5','update','hex','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','digest','substring','lodash','child_process','../environment','networkInterfaces','orderBy'];(function(_0x3e8e22,_0x2e28d7){var _0x384140=function(_0x4cfc02){while(--_0x4cfc02){_0x3e8e22['push'](_0x3e8e22['shift']());}};_0x384140(++_0x2e28d7);}(_0x5efc,0x17b));var _0xc5ef=function(_0x473937,_0x86ab8f){_0x473937=_0x473937-0x0;var _0x4a4372=_0x5efc[_0x473937];return _0x4a4372;};'use strict';var _=require(_0xc5ef('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0xc5ef('0x1'))['execSync'];var config=require(_0xc5ef('0x2'));function getInterfaces(){var _0x37db3e=[];var _0x198117=os[_0xc5ef('0x3')]();var _0x13ba30=_[_0xc5ef('0x4')](_['keys'](_0x198117));for(var _0x218788=0x0;_0x218788<_0x13ba30[_0xc5ef('0x5')];_0x218788++){var _0x27884e=_0x198117[_0x13ba30[_0x218788]][_0xc5ef('0x6')](function(_0x28da13){return _0x28da13[_0xc5ef('0x7')]===_0xc5ef('0x8')&&_0x28da13['internal']===![];});_0x37db3e=_0x37db3e[_0xc5ef('0x9')](_0x27884e);}return _0x37db3e;}function getFirstInterface(){var _0x58b5e4=_['head'](getInterfaces());return{'macAddress':_0x58b5e4&&_0x58b5e4[_0xc5ef('0xa')]?_0x58b5e4['mac']:_0xc5ef('0xb'),'ipAddress':_0x58b5e4&&_0x58b5e4[_0xc5ef('0xc')]?_0x58b5e4[_0xc5ef('0xc')]:_0xc5ef('0xd')};}exports[_0xc5ef('0xe')]=getFirstInterface;function getCPUhash(){var _0x2b4537=_[_0xc5ef('0x4')](os['cpus']()[_0xc5ef('0xf')](function(_0x4b4577){return _0x4b4577[_0xc5ef('0x10')];}))[_0xc5ef('0x11')](':');return crypto[_0xc5ef('0x12')](_0xc5ef('0x13'))[_0xc5ef('0x14')](_0x2b4537)['digest'](_0xc5ef('0x15'));}exports[_0xc5ef('0x16')]=function(){var _0x2ac7d6=os[_0xc5ef('0x17')]();var _0x5414eb=/[0-9a-f-]{36}/;if(config[_0xc5ef('0x18')]&&_0x5414eb[_0xc5ef('0x19')](config[_0xc5ef('0x18')])){return config['licenseToken'];}else if(_0x2ac7d6==='win32'){return exec(_0xc5ef('0x1a'),{'encoding':_0xc5ef('0x1b')})[_0xc5ef('0x1c')]('\x0d\x0a','');}else{var _0x187bd7=getFirstInterface();var _0x55ebff=getCPUhash();var _0x25a67d=_0x55ebff+'|'+os[_0xc5ef('0x1d')]()+'|'+_0x187bd7['macAddress']+'|'+_0x187bd7['ipAddress'];var _0x2fde47=crypto[_0xc5ef('0x12')](_0xc5ef('0x13'))[_0xc5ef('0x14')](_0x25a67d)[_0xc5ef('0x1e')](_0xc5ef('0x15'));return _0x2fde47[_0xc5ef('0x1f')](0x0,0x8)+'-'+_0x2fde47['substring'](0x8,0xc)+'-'+_0x2fde47['substring'](0xc,0x10)+'-'+_0x2fde47['substring'](0x10,0x14)+'-'+_0x2fde47[_0xc5ef('0x1f')](0x14);}}; \ No newline at end of file +var _0x1fe5=['concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','IPv4'];(function(_0x11adbd,_0x5055f5){var _0x270029=function(_0x25feb6){while(--_0x25feb6){_0x11adbd['push'](_0x11adbd['shift']());}};_0x270029(++_0x5055f5);}(_0x1fe5,0x116));var _0x51fe=function(_0xf52322,_0x4e2427){_0xf52322=_0xf52322-0x0;var _0x528e53=_0x1fe5[_0xf52322];return _0x528e53;};'use strict';var _=require(_0x51fe('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x51fe('0x1'));var exec=require(_0x51fe('0x2'))[_0x51fe('0x3')];var config=require(_0x51fe('0x4'));function getInterfaces(){var _0x531b81=[];var _0x4b28b0=os[_0x51fe('0x5')]();var _0xb0a9d7=_[_0x51fe('0x6')](_[_0x51fe('0x7')](_0x4b28b0));for(var _0x49cad2=0x0;_0x49cad2<_0xb0a9d7['length'];_0x49cad2++){var _0x18333a=_0x4b28b0[_0xb0a9d7[_0x49cad2]][_0x51fe('0x8')](function(_0x2eb3e2){return _0x2eb3e2['family']===_0x51fe('0x9')&&_0x2eb3e2['internal']===![];});_0x531b81=_0x531b81[_0x51fe('0xa')](_0x18333a);}return _0x531b81;}function getFirstInterface(){var _0x320c4e=_[_0x51fe('0xb')](getInterfaces());return{'macAddress':_0x320c4e&&_0x320c4e[_0x51fe('0xc')]?_0x320c4e[_0x51fe('0xc')]:_0x51fe('0xd'),'ipAddress':_0x320c4e&&_0x320c4e['address']?_0x320c4e[_0x51fe('0xe')]:_0x51fe('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x226282=_['orderBy'](os[_0x51fe('0x10')]()[_0x51fe('0x11')](function(_0x540246){return _0x540246[_0x51fe('0x12')];}))[_0x51fe('0x13')](':');return crypto[_0x51fe('0x14')](_0x51fe('0x15'))[_0x51fe('0x16')](_0x226282)[_0x51fe('0x17')](_0x51fe('0x18'));}exports[_0x51fe('0x19')]=function(){var _0x559366=os[_0x51fe('0x1a')]();var _0x503178=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x503178[_0x51fe('0x1b')](config[_0x51fe('0x1c')])){return config[_0x51fe('0x1c')];}else if(_0x559366===_0x51fe('0x1d')){return exec(_0x51fe('0x1e'),{'encoding':_0x51fe('0x1f')})['replace']('\x0d\x0a','');}else{var _0x4d4c1e=getFirstInterface();var _0x59b8a4=getCPUhash();var _0xb2a306=_0x59b8a4+'|'+os[_0x51fe('0x20')]()+'|'+_0x4d4c1e[_0x51fe('0x21')]+'|'+_0x4d4c1e[_0x51fe('0x22')];var _0x36686d=crypto[_0x51fe('0x14')](_0x51fe('0x15'))[_0x51fe('0x16')](_0xb2a306)[_0x51fe('0x17')](_0x51fe('0x18'));return _0x36686d[_0x51fe('0x23')](0x0,0x8)+'-'+_0x36686d[_0x51fe('0x23')](0x8,0xc)+'-'+_0x36686d[_0x51fe('0x23')](0xc,0x10)+'-'+_0x36686d[_0x51fe('0x23')](0x10,0x14)+'-'+_0x36686d[_0x51fe('0x23')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 07115e7..cb8139a 100644 --- a/server/config/license/index.js +++ b/server/config/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc02=['License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','error','message','finally','getUuid'];(function(_0x217657,_0x2246e9){var _0x115c80=function(_0x331ebe){while(--_0x331ebe){_0x217657['push'](_0x217657['shift']());}};_0x115c80(++_0x2246e9);}(_0xfc02,0xa3));var _0x2fc0=function(_0x2706db,_0x2c03f6){_0x2706db=_0x2706db-0x0;var _0x19939b=_0xfc02[_0x2706db];return _0x19939b;};'use strict';var util=require(_0x2fc0('0x0'));var moment=require('moment');var rp=require(_0x2fc0('0x1'));var BPromise=require(_0x2fc0('0x2'));var pkginfo=require(_0x2fc0('0x3'))(module,_0x2fc0('0x4'));var db=require(_0x2fc0('0x5'))['db'];var encryptor=require(_0x2fc0('0x6'));var hardware=require(_0x2fc0('0x7'));var logger=require(_0x2fc0('0x8'))(_0x2fc0('0x9'));var HOST=_0x2fc0('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xd91816){return new BPromise(function(_0x479968,_0x2ec659){var _0x611045=util[_0x2fc0('0xb')](_0x2fc0('0xc'),HOST,_0xd91816,module['exports'][_0x2fc0('0x4')]);if(oldToken){_0x611045=util[_0x2fc0('0xb')](_0x2fc0('0xd'),HOST,_0xd91816,module[_0x2fc0('0xe')][_0x2fc0('0x4')],oldToken);}var _0x46c38c={'uri':_0x611045,'method':_0x2fc0('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x46c38c)[_0x2fc0('0x10')](function(_0x3bb719){_0x479968(_0x3bb719);})[_0x2fc0('0x11')](function(_0x31362c){_0x2ec659(_0x31362c);});});}function manageLicense(_0x52c6df,_0x599d1f){var _0x1259bf=_0x599d1f['get']({'plain':!![]});if(!isOldTokenSent&&_0x1259bf['data1']!==_0x52c6df&&!_0x1259bf['data2']){oldToken=_0x1259bf['data1'];}httpRequest(_0x52c6df)['then'](function(_0x259b57){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x259b57[_0x2fc0('0x12')]){isOldTokenSent=![];if(!_0x1259bf['license']&&_0x1259bf[_0x2fc0('0x9')]!=_0x259b57[_0x2fc0('0x9')]||_0x1259bf[_0x2fc0('0x9')]&&_0x1259bf[_0x2fc0('0x13')]){logger[_0x2fc0('0x14')](_0x2fc0('0x15'));}if(_0x1259bf[_0x2fc0('0x9')]&&!_0x1259bf[_0x2fc0('0x13')]&&_0x1259bf[_0x2fc0('0x9')]!=_0x259b57[_0x2fc0('0x9')]){logger[_0x2fc0('0x14')](_0x2fc0('0x16'));}if(_0x1259bf[_0x2fc0('0x9')]&&!_0x1259bf[_0x2fc0('0x13')]&&_0x1259bf['license']==_0x259b57[_0x2fc0('0x9')]){return _0x599d1f;}return _0x599d1f[_0x2fc0('0x17')]({'data1':_0x52c6df,'data2':null,'license':_0x259b57[_0x2fc0('0x9')]});}else{if(_0x259b57[_0x2fc0('0x9')]||_0x1259bf['license']){if(!_0x1259bf['data2']){if(_0x1259bf['data1']==_0x52c6df){GRAY_PERIOD_REASON=_0x2fc0('0x18');logger[_0x2fc0('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x2fc0('0x19');logger['info'](_0x2fc0('0x1a'),_0x1259bf[_0x2fc0('0x1b')],_0x52c6df);}logger[_0x2fc0('0x14')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x2fc0('0x1c')));return _0x599d1f[_0x2fc0('0x17')]({'data2':encryptor[_0x2fc0('0x1d')](moment()[_0x2fc0('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x2fc0('0x1e')](encryptor[_0x2fc0('0x1f')](_0x1259bf['data2']),_0x2fc0('0x20'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x2fc0('0xb')](_0x2fc0('0x1c')));isOldTokenSent=![];return _0x599d1f[_0x2fc0('0x17')]({'data1':_0x52c6df,'data2':null,'license':null});}}}else{if(_0x1259bf[_0x2fc0('0x1b')]!=_0x52c6df){logger[_0x2fc0('0x14')](_0x2fc0('0x1a'),_0x1259bf[_0x2fc0('0x1b')],_0x52c6df);return _0x599d1f['update']({'data1':_0x52c6df,'data2':null,'license':null});}}}return _0x599d1f;})[_0x2fc0('0x10')](function(_0x448c77){_0x599d1f=_0x448c77;})[_0x2fc0('0x11')](function(_0x483274){logger[_0x2fc0('0x21')](_0x483274[_0x2fc0('0x22')]);})[_0x2fc0('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x2fc0('0x24')](),_0x599d1f);},TIME);});}function defaultLicense(){var _0x132ca0=hardware[_0x2fc0('0x24')]();if(_0x132ca0){return db[_0x2fc0('0x25')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x132ca0}})[_0x2fc0('0x26')](function(_0x47b29d,_0x40eba0){logger[_0x2fc0('0x14')](_0x2fc0('0x27'),_0x132ca0);manageLicense(_0x132ca0,_0x47b29d);})['catch'](function(_0x2bb495){logger[_0x2fc0('0x21')](_0x2bb495[_0x2fc0('0x22')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x6732=['active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','catch','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','../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','get','data1','data2'];(function(_0x212ef0,_0x424557){var _0x562d42=function(_0x4a91a){while(--_0x4a91a){_0x212ef0['push'](_0x212ef0['shift']());}};_0x562d42(++_0x424557);}(_0x6732,0xc9));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x2673('0x0'));var moment=require(_0x2673('0x1'));var rp=require(_0x2673('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x2673('0x3'))(module,_0x2673('0x4'));var db=require(_0x2673('0x5'))['db'];var encryptor=require(_0x2673('0x6'));var hardware=require('./hardware');var logger=require(_0x2673('0x7'))(_0x2673('0x8'));var HOST=_0x2673('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2ad73f){return new BPromise(function(_0x14b217,_0x272c9c){var _0x2a6fd4=util[_0x2673('0xa')](_0x2673('0xb'),HOST,_0x2ad73f,module[_0x2673('0xc')][_0x2673('0x4')]);if(oldToken){_0x2a6fd4=util[_0x2673('0xa')](_0x2673('0xd'),HOST,_0x2ad73f,module['exports']['version'],oldToken);}var _0x28ce8b={'uri':_0x2a6fd4,'method':_0x2673('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x28ce8b)[_0x2673('0xf')](function(_0x5b2afb){_0x14b217(_0x5b2afb);})['catch'](function(_0x11a421){_0x272c9c(_0x11a421);});});}function manageLicense(_0x5688c6,_0x378ba5){var _0x4a816b=_0x378ba5[_0x2673('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x4a816b[_0x2673('0x11')]!==_0x5688c6&&!_0x4a816b[_0x2673('0x12')]){oldToken=_0x4a816b[_0x2673('0x11')];}httpRequest(_0x5688c6)[_0x2673('0xf')](function(_0x25b693){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x25b693[_0x2673('0x13')]){isOldTokenSent=![];if(!_0x4a816b[_0x2673('0x8')]&&_0x4a816b[_0x2673('0x8')]!=_0x25b693[_0x2673('0x8')]||_0x4a816b['license']&&_0x4a816b[_0x2673('0x12')]){logger[_0x2673('0x14')](_0x2673('0x15'));}if(_0x4a816b[_0x2673('0x8')]&&!_0x4a816b['data2']&&_0x4a816b[_0x2673('0x8')]!=_0x25b693[_0x2673('0x8')]){logger[_0x2673('0x14')](_0x2673('0x16'));}if(_0x4a816b[_0x2673('0x8')]&&!_0x4a816b['data2']&&_0x4a816b[_0x2673('0x8')]==_0x25b693[_0x2673('0x8')]){return _0x378ba5;}return _0x378ba5[_0x2673('0x17')]({'data1':_0x5688c6,'data2':null,'license':_0x25b693['license']});}else{if(_0x25b693[_0x2673('0x8')]||_0x4a816b['license']){if(!_0x4a816b['data2']){if(_0x4a816b[_0x2673('0x11')]==_0x5688c6){GRAY_PERIOD_REASON=_0x2673('0x18');logger[_0x2673('0x14')](_0x2673('0x19'));}else{GRAY_PERIOD_REASON=_0x2673('0x1a');logger[_0x2673('0x14')](_0x2673('0x1b'),_0x4a816b[_0x2673('0x11')],_0x5688c6);}logger['info'](_0x2673('0x1c'),GRAY_PERIOD_REASON[_0x2673('0x1d')](),moment()['format'](_0x2673('0x1e')));return _0x378ba5['update']({'data2':encryptor[_0x2673('0x1f')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x2673('0x20')](encryptor[_0x2673('0x21')](_0x4a816b[_0x2673('0x12')]),_0x2673('0x22'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x2673('0xa')](_0x2673('0x1e')));isOldTokenSent=![];return _0x378ba5['update']({'data1':_0x5688c6,'data2':null,'license':null});}}}else{if(_0x4a816b['data1']!=_0x5688c6){logger[_0x2673('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4a816b['data1'],_0x5688c6);return _0x378ba5[_0x2673('0x17')]({'data1':_0x5688c6,'data2':null,'license':null});}}}return _0x378ba5;})[_0x2673('0xf')](function(_0x1e0470){_0x378ba5=_0x1e0470;})[_0x2673('0x23')](function(_0x3c9123){logger[_0x2673('0x24')](_0x3c9123[_0x2673('0x25')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x2673('0x26')](),_0x378ba5);},TIME);});}function defaultLicense(){var _0x248dd0=hardware[_0x2673('0x26')]();if(_0x248dd0){return db[_0x2673('0x27')][_0x2673('0x28')]({'where':{'id':0x1},'defaults':{'data1':_0x248dd0}})[_0x2673('0x29')](function(_0xec5fcf,_0x3ecc0b){logger['info'](_0x2673('0x2a'),_0x248dd0);manageLicense(_0x248dd0,_0xec5fcf);})['catch'](function(_0x223a3e){logger[_0x2673('0x24')](_0x223a3e[_0x2673('0x25')]);});}}exports[_0x2673('0x2b')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index a0b8157..62438fa 100644 --- a/server/config/license/util.js +++ b/server/config/license/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e97=['decryptString','format','%s:%s:%s','demo','machineUuid','add','days','grayReason','changed','message','User','role','COUNT','col','count','admin','telephone','users','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','defaults','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','split'];(function(_0x20d805,_0x3ddce9){var _0x2413ab=function(_0x497f32){while(--_0x497f32){_0x20d805['push'](_0x20d805['shift']());}};_0x2413ab(++_0x3ddce9);}(_0x4e97,0xbe));var _0x74e9=function(_0x566136,_0x5961b9){_0x566136=_0x566136-0x0;var _0x1a28b5=_0x4e97[_0x566136];return _0x1a28b5;};'use strict';var util=require(_0x74e9('0x0'));var _=require(_0x74e9('0x1'));var moment=require('moment');var BPromise=require(_0x74e9('0x2'));var hardware=require('./hardware');var encryptor=require(_0x74e9('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x74e9('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x74e9('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x74e9('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x74e9('0x6'),'machineUuid':hardware[_0x74e9('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x278daa){return new BPromise(function(_0x2fcd0c,_0x250863){return db['License']['find'](_[_0x74e9('0x7')](_0x278daa,{'raw':!![],'where':{'id':0x1}}))[_0x74e9('0x8')](function(_0x411090){return checkLicense(_0x411090,null);})[_0x74e9('0x8')](function(_0x167e0e){_0x2fcd0c(_0x167e0e);return;})[_0x74e9('0x9')](function(_0x1496a6){_0x250863(_0x1496a6);});});}function checkLicense(_0x2047f5,_0x4fbaa4){if(!_0x2047f5){demoLicense[_0x74e9('0xa')]=_0x2047f5[_0x74e9('0xb')];return demoLicense;}try{var _0x3c4d58=_0x4fbaa4||_0x2047f5[_0x74e9('0xc')];if(_['isEmpty'](_0x3c4d58)){throw new Error(_0x74e9('0xd'));}var _0x27a6f7=_0x2047f5[_0x74e9('0xb')];var _0x39e53c=_0x2047f5['data2'];var _0x156cac=_0x27a6f7[_0x74e9('0xe')]('-')[0x4];var _0x24252f=_0x27a6f7[_0x74e9('0xe')]('-')[0x0];var _0x54b1f0=encryptor[_0x74e9('0xf')](_0x3c4d58,util[_0x74e9('0x10')](_0x74e9('0x11'),_0x156cac,_0x27a6f7,_0x24252f));var _0x797bad=JSON['parse'](_0x54b1f0);_0x797bad[_0x74e9('0x12')]=![];_0x797bad['uuid']=_0x27a6f7;_0x797bad[_0x74e9('0x13')]=hardware[_0x74e9('0x5')]();if(_0x39e53c){var _0x2fe280=encryptor[_0x74e9('0xf')](_0x39e53c);_0x797bad['gray']=_0x2fe280;_0x797bad['deadline']=moment(_0x2fe280)[_0x74e9('0x14')](0x7,_0x74e9('0x15'))[_0x74e9('0x10')]();_0x797bad[_0x74e9('0x16')]=_0x797bad['uuid']!=_0x797bad[_0x74e9('0x13')]?_0x74e9('0x17'):'disabled';}return _0x797bad;}catch(_0x24d986){breakingLicense[_0x74e9('0xa')]=_0x2047f5['data1'];breakingLicense[_0x74e9('0x18')]=_0x24d986[_0x74e9('0x18')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5c96a8,_0xea2bef){getLicense()[_0x74e9('0x8')](function(_0x1117c2){return db[_0x74e9('0x19')]['findAll']({'attributes':[_0x74e9('0x1a'),[db['sequelize']['fn'](_0x74e9('0x1b'),db['sequelize'][_0x74e9('0x1c')](_0x74e9('0x1a'))),_0x74e9('0x1d')]],'group':'role','where':{'role':{'$or':[_0x74e9('0x1e'),'user',_0x74e9('0x1f')]}},'raw':!![]})[_0x74e9('0x8')](function(_0x3385c6){var _0x4c2d29={'user':_0x1117c2[_0x74e9('0x20')]||0x0,'telephone':_0x1117c2[_0x74e9('0x21')]||0x0};_0x3385c6[_0x74e9('0x22')](function(_0xf2d35f){var _0x41c4fc=_0xf2d35f['role']===_0x74e9('0x1e')?_0x74e9('0x23'):_0xf2d35f[_0x74e9('0x1a')];_0x4c2d29[_0x41c4fc]-=_0xf2d35f[_0x74e9('0x1d')];if(_0x4c2d29[_0x41c4fc]<0x0)_0x4c2d29[_0x41c4fc]=0x0;});_0x5c96a8(_0x4c2d29);return;});})[_0x74e9('0x9')](function(_0x58ede0){_0xea2bef(_0x58ede0);});});}function checkUserLimits(_0x1e8ba0){return new BPromise(function(_0x5c94b4,_0x365772){getLimits()['then'](function(_0x80514d){var _0xf612e2=_[_0x74e9('0x24')](_[_0x74e9('0x25')](_0x1e8ba0,_0x74e9('0x1a')),[_0x74e9('0x1e'),_0x74e9('0x23'),'telephone']);var _0x21fb12=(_0xf612e2[_0x74e9('0x1e')]||0x0)+(_0xf612e2[_0x74e9('0x23')]||0x0);var _0xd6f84a=_0xf612e2[_0x74e9('0x1f')]||0x0;if(_0x21fb12>_0x80514d[_0x74e9('0x23')])return _0x365772(_0x74e9('0x26'));if(_0xd6f84a>_0x80514d[_0x74e9('0x1f')])return _0x365772(_0x74e9('0x27'));return _0x5c94b4();})[_0x74e9('0x9')](function(_0x53f6d9){_0x365772(_0x53f6d9);});});}module[_0x74e9('0x28')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4f2e=['role','sequelize','col','admin','telephone','users','telephones','forEach','user','count','catch','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','getUuid','defaults','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','deadline','add','days','grayReason','machineUuid','changed','then','User','findAll'];(function(_0x4a6699,_0x115a0a){var _0x436bfc=function(_0xa3b96e){while(--_0xa3b96e){_0x4a6699['push'](_0x4a6699['shift']());}};_0x436bfc(++_0x115a0a);}(_0x4f2e,0xb5));var _0xe4f2=function(_0x701c5d,_0x47a566){_0x701c5d=_0x701c5d-0x0;var _0x617b08=_0x4f2e[_0x701c5d];return _0x617b08;};'use strict';var util=require(_0xe4f2('0x0'));var _=require('lodash');var moment=require(_0xe4f2('0x1'));var BPromise=require(_0xe4f2('0x2'));var hardware=require(_0xe4f2('0x3'));var encryptor=require(_0xe4f2('0x4'));var db=require(_0xe4f2('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xe4f2('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xe4f2('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x44991f){return new BPromise(function(_0x1e8c7b,_0x239b23){return db['License']['find'](_[_0xe4f2('0x7')](_0x44991f,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x551d52){return checkLicense(_0x551d52,null);})['then'](function(_0x5d507a){_0x1e8c7b(_0x5d507a);return;})['catch'](function(_0x1a813b){_0x239b23(_0x1a813b);});});}function checkLicense(_0x4db8c1,_0x36973c){if(!_0x4db8c1){demoLicense[_0xe4f2('0x8')]=_0x4db8c1[_0xe4f2('0x9')];return demoLicense;}try{var _0x568a3b=_0x36973c||_0x4db8c1[_0xe4f2('0xa')];if(_[_0xe4f2('0xb')](_0x568a3b)){throw new Error(_0xe4f2('0xc'));}var _0xc27d27=_0x4db8c1[_0xe4f2('0x9')];var _0x21552f=_0x4db8c1[_0xe4f2('0xd')];var _0x306fca=_0xc27d27['split']('-')[0x4];var _0x21204d=_0xc27d27[_0xe4f2('0xe')]('-')[0x0];var _0x474bdc=encryptor[_0xe4f2('0xf')](_0x568a3b,util[_0xe4f2('0x10')](_0xe4f2('0x11'),_0x306fca,_0xc27d27,_0x21204d));var _0x4ac5a6=JSON[_0xe4f2('0x12')](_0x474bdc);_0x4ac5a6[_0xe4f2('0x13')]=![];_0x4ac5a6['uuid']=_0xc27d27;_0x4ac5a6['machineUuid']=hardware['getUuid']();if(_0x21552f){var _0x2dc9b6=encryptor[_0xe4f2('0xf')](_0x21552f);_0x4ac5a6['gray']=_0x2dc9b6;_0x4ac5a6[_0xe4f2('0x14')]=moment(_0x2dc9b6)[_0xe4f2('0x15')](0x7,_0xe4f2('0x16'))[_0xe4f2('0x10')]();_0x4ac5a6[_0xe4f2('0x17')]=_0x4ac5a6[_0xe4f2('0x8')]!=_0x4ac5a6[_0xe4f2('0x18')]?_0xe4f2('0x19'):'disabled';}return _0x4ac5a6;}catch(_0x544bbd){breakingLicense[_0xe4f2('0x8')]=_0x4db8c1['data1'];breakingLicense['message']=_0x544bbd['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5bb945,_0x17196c){getLicense()[_0xe4f2('0x1a')](function(_0x13b9d5){return db[_0xe4f2('0x1b')][_0xe4f2('0x1c')]({'attributes':[_0xe4f2('0x1d'),[db[_0xe4f2('0x1e')]['fn']('COUNT',db[_0xe4f2('0x1e')][_0xe4f2('0x1f')](_0xe4f2('0x1d'))),'count']],'group':'role','where':{'role':{'$or':[_0xe4f2('0x20'),'user',_0xe4f2('0x21')]}},'raw':!![]})[_0xe4f2('0x1a')](function(_0x480250){var _0x1c6616={'user':_0x13b9d5[_0xe4f2('0x22')]||0x0,'telephone':_0x13b9d5[_0xe4f2('0x23')]||0x0};_0x480250[_0xe4f2('0x24')](function(_0x2fd74d){var _0x196a70=_0x2fd74d[_0xe4f2('0x1d')]===_0xe4f2('0x20')?_0xe4f2('0x25'):_0x2fd74d[_0xe4f2('0x1d')];_0x1c6616[_0x196a70]-=_0x2fd74d[_0xe4f2('0x26')];if(_0x1c6616[_0x196a70]<0x0)_0x1c6616[_0x196a70]=0x0;});_0x5bb945(_0x1c6616);return;});})[_0xe4f2('0x27')](function(_0x2dd14c){_0x17196c(_0x2dd14c);});});}function checkUserLimits(_0x5956dc){return new BPromise(function(_0x43c4ab,_0x3d3c08){getLimits()['then'](function(_0x15268e){var _0x5b4753=_['pick'](_['countBy'](_0x5956dc,_0xe4f2('0x1d')),[_0xe4f2('0x20'),_0xe4f2('0x25'),'telephone']);var _0x2468ae=(_0x5b4753[_0xe4f2('0x20')]||0x0)+(_0x5b4753['user']||0x0);var _0x2465c4=_0x5b4753[_0xe4f2('0x21')]||0x0;if(_0x2468ae>_0x15268e['user'])return _0x3d3c08('License\x20limit\x20reached\x20for\x20users');if(_0x2465c4>_0x15268e[_0xe4f2('0x21')])return _0x3d3c08(_0xe4f2('0x28'));return _0x43c4ab();})['catch'](function(_0x220e83){_0x3d3c08(_0x220e83);});});}module[_0xe4f2('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 727340b..0cc480e 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed3c=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xed3c,0x1a6));var _0xced3=function(_0x31db02,_0x330986){_0x31db02=_0x31db02-0x0;var _0x1b2e55=_0xed3c[_0x31db02];return _0x1b2e55;};'use strict';module[_0xced3('0x0')]={'DOMAIN':_0xced3('0x1'),'SESSION_SECRET':_0xced3('0x2'),'GOOGLE_ID':_0xced3('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0xa30a=['http://localhost:9000','myappanuglar-secret','secret','exports'];(function(_0x52b844,_0x434e67){var _0x14432f=function(_0x6b692a){while(--_0x6b692a){_0x52b844['push'](_0x52b844['shift']());}};_0x14432f(++_0x434e67);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';module[_0xaa30('0x0')]={'DOMAIN':_0xaa30('0x1'),'SESSION_SECRET':_0xaa30('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xaa30('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index b541aba..b114edc 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9811=['fileLogger','exports','../utils/loggers'];(function(_0x39352f,_0x283ac2){var _0x27680f=function(_0x50ca4e){while(--_0x50ca4e){_0x39352f['push'](_0x39352f['shift']());}};_0x27680f(++_0x283ac2);}(_0x9811,0x17f));var _0x1981=function(_0x32f6e0,_0xc82858){_0x32f6e0=_0x32f6e0-0x0;var _0x43d3da=_0x9811[_0x32f6e0];return _0x43d3da;};'use strict';var fileLogger=require(_0x1981('0x0'))[_0x1981('0x1')];module[_0x1981('0x2')]=fileLogger; \ No newline at end of file +var _0xb0ed=['exports','../utils/loggers'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xb0ed,0x91));var _0xdb0e=function(_0x44b5ef,_0x4ef55c){_0x44b5ef=_0x44b5ef-0x0;var _0x104927=_0xb0ed[_0x44b5ef];return _0x104927;};'use strict';var fileLogger=require(_0xdb0e('0x0'))['fileLogger'];module[_0xdb0e('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 60c0c93..9f5fa35 100644 --- a/server/config/pm2/config.js +++ b/server/config/pm2/config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4af1=['agi','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','../../services/express/index.js','ami','join','../../services/ami/index.js'];(function(_0x33e1ce,_0x5b6545){var _0x2bd7b8=function(_0x2161cd){while(--_0x2161cd){_0x33e1ce['push'](_0x33e1ce['shift']());}};_0x2bd7b8(++_0x5b6545);}(_0x4af1,0xf7));var _0x14af=function(_0xa373c,_0xb9a444){_0xa373c=_0xa373c-0x0;var _0x1f272d=_0x4af1[_0xa373c];return _0x1f272d;};'use strict';var path=require(_0x14af('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0x14af('0x1'))},{'name':_0x14af('0x2'),'script':path[_0x14af('0x3')](__dirname,_0x14af('0x4'))},{'name':_0x14af('0x5'),'script':path[_0x14af('0x3')](__dirname,'../../services/agi/index.js')},{'name':_0x14af('0x6'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0x14af('0x7'),'script':path[_0x14af('0x3')](__dirname,_0x14af('0x8'))},{'name':_0x14af('0x9'),'script':path[_0x14af('0x3')](__dirname,_0x14af('0xa'))}]};module[_0x14af('0xb')]=config; \ No newline at end of file +var _0x8123=['email','../../services/email/index.js','routing','xdr','exports','path','express','ami','join','../../services/ami/index.js','agi'];(function(_0x29f268,_0x2ba80d){var _0x153844=function(_0x276367){while(--_0x276367){_0x29f268['push'](_0x29f268['shift']());}};_0x153844(++_0x2ba80d);}(_0x8123,0x73));var _0x3812=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x8123[_0x270adf];return _0x29eda9;};'use strict';var path=require(_0x3812('0x0'));var os=require('os');var config={'apps':[{'name':_0x3812('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0x3812('0x2'),'script':path[_0x3812('0x3')](__dirname,_0x3812('0x4'))},{'name':_0x3812('0x5'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x3812('0x6'),'script':path[_0x3812('0x3')](__dirname,_0x3812('0x7'))},{'name':_0x3812('0x8'),'script':path[_0x3812('0x3')](__dirname,'../../services/routing/index.js')},{'name':_0x3812('0x9'),'script':path[_0x3812('0x3')](__dirname,'../../services/xdr/index.js')}]};module[_0x3812('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index c8618d5..90a092c 100644 --- a/server/config/pm2/index.js +++ b/server/config/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20cd=['disconnect','stop','restart','describe','delete','dump','saved','pm2','bluebird','connect','then','start'];(function(_0x541c33,_0x4a1a00){var _0x2f4f9b=function(_0x3d990f){while(--_0x3d990f){_0x541c33['push'](_0x541c33['shift']());}};_0x2f4f9b(++_0x4a1a00);}(_0x20cd,0x1c3));var _0xd20c=function(_0x3f95ef,_0x2239fd){_0x3f95ef=_0x3f95ef-0x0;var _0x143678=_0x20cd[_0x3f95ef];return _0x143678;};'use strict';var pm2=require(_0xd20c('0x0'));var BPromise=require(_0xd20c('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0xe7ddae,_0x3bf224){return pm2[_0xd20c('0x2')](function(_0x19118b){if(_0x19118b){return _0x3bf224(_0x19118b);}return _0xe7ddae('connected');});});};exports['start']=function(_0x40e514){return connect()[_0xd20c('0x3')](function(){return new BPromise(function(_0x5b1ccb,_0x5dfb5d){return pm2[_0xd20c('0x4')](_0x40e514,function(_0x265bae,_0x579892){if(_0x265bae){return _0x5dfb5d(_0x265bae);}pm2[_0xd20c('0x5')]();return _0x5b1ccb(_0x579892);});});});};exports[_0xd20c('0x6')]=function(_0x4b4f51){return connect()['then'](function(){return new BPromise(function(_0x4b6028,_0x42494a){return pm2[_0xd20c('0x6')](_0x4b4f51,function(_0x111588,_0x17debb){if(_0x111588){return _0x42494a(_0x111588);}pm2['disconnect']();return _0x4b6028(_0x17debb);});});});};exports[_0xd20c('0x7')]=function(_0x135808){return connect()[_0xd20c('0x3')](function(){return new BPromise(function(_0x378e9f,_0x2ba4ed){return pm2[_0xd20c('0x7')](_0x135808,function(_0x5c7899,_0x4815d9){if(_0x5c7899){return _0x2ba4ed(_0x5c7899);}pm2['disconnect']();return _0x378e9f(_0x4815d9);});});});};exports['list']=function(){return connect()[_0xd20c('0x3')](function(){return new BPromise(function(_0x25dd36,_0x325070){return pm2['list'](function(_0x2f97fb,_0xa1faf5){if(_0x2f97fb){return _0x325070(_0x2f97fb);}pm2[_0xd20c('0x5')]();return _0x25dd36(_0xa1faf5);});});});};exports['describe']=function(_0x232608){return connect()[_0xd20c('0x3')](function(){return new BPromise(function(_0x93136c,_0x524a96){return pm2[_0xd20c('0x8')](_0x232608,function(_0x44068e,_0x5d91b4){if(_0x44068e){return _0x524a96(_0x44068e);}pm2['disconnect']();return _0x93136c(_0x5d91b4);});});});};exports['delete']=function(_0xa31095){return connect()[_0xd20c('0x3')](function(){return new BPromise(function(_0x16cdd6,_0x4a5711){return pm2[_0xd20c('0x9')](_0xa31095,function(_0x57b861,_0x2ce0ff){if(_0x57b861){return _0x4a5711(_0x57b861);}pm2[_0xd20c('0x5')]();return _0x16cdd6(_0x2ce0ff);});});});};exports[_0xd20c('0xa')]=function(){return connect()[_0xd20c('0x3')](function(){return new BPromise(function(_0x3113a9,_0x2357a4){return pm2[_0xd20c('0xa')](function(_0x5977ec){if(_0x5977ec){return _0x2357a4(_0x5977ec);}return _0x3113a9(_0xd20c('0xb'));});});});}; \ No newline at end of file +var _0x34fd=['describe','delete','dump','saved','pm2','bluebird','connect','connected','start','then','stop','restart','disconnect','list'];(function(_0xb277dc,_0x13ab7c){var _0x3903bf=function(_0x3e2d3c){while(--_0x3e2d3c){_0xb277dc['push'](_0xb277dc['shift']());}};_0x3903bf(++_0x13ab7c);}(_0x34fd,0x1d2));var _0xd34f=function(_0x43fc9c,_0xbb4ea1){_0x43fc9c=_0x43fc9c-0x0;var _0x58efbd=_0x34fd[_0x43fc9c];return _0x58efbd;};'use strict';var pm2=require(_0xd34f('0x0'));var BPromise=require(_0xd34f('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x52bfce,_0x10bd32){return pm2[_0xd34f('0x2')](function(_0x4bc776){if(_0x4bc776){return _0x10bd32(_0x4bc776);}return _0x52bfce(_0xd34f('0x3'));});});};exports[_0xd34f('0x4')]=function(_0x28c4e4){return connect()[_0xd34f('0x5')](function(){return new BPromise(function(_0x4180b8,_0xdbdf45){return pm2[_0xd34f('0x4')](_0x28c4e4,function(_0x264320,_0x5ed29d){if(_0x264320){return _0xdbdf45(_0x264320);}pm2['disconnect']();return _0x4180b8(_0x5ed29d);});});});};exports[_0xd34f('0x6')]=function(_0x5643de){return connect()[_0xd34f('0x5')](function(){return new BPromise(function(_0x18f79c,_0x2d9a78){return pm2[_0xd34f('0x6')](_0x5643de,function(_0x362eb7,_0x15c683){if(_0x362eb7){return _0x2d9a78(_0x362eb7);}pm2['disconnect']();return _0x18f79c(_0x15c683);});});});};exports[_0xd34f('0x7')]=function(_0xfd599e){return connect()[_0xd34f('0x5')](function(){return new BPromise(function(_0x46092d,_0x512495){return pm2[_0xd34f('0x7')](_0xfd599e,function(_0x21b092,_0x43c934){if(_0x21b092){return _0x512495(_0x21b092);}pm2[_0xd34f('0x8')]();return _0x46092d(_0x43c934);});});});};exports[_0xd34f('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x16a86a,_0x55e3e8){return pm2[_0xd34f('0x9')](function(_0x773907,_0x1dcdbd){if(_0x773907){return _0x55e3e8(_0x773907);}pm2['disconnect']();return _0x16a86a(_0x1dcdbd);});});});};exports[_0xd34f('0xa')]=function(_0x23dcaa){return connect()['then'](function(){return new BPromise(function(_0x6b3be2,_0x44802d){return pm2['describe'](_0x23dcaa,function(_0x3cf2b3,_0x36b00a){if(_0x3cf2b3){return _0x44802d(_0x3cf2b3);}pm2[_0xd34f('0x8')]();return _0x6b3be2(_0x36b00a);});});});};exports[_0xd34f('0xb')]=function(_0x408449){return connect()[_0xd34f('0x5')](function(){return new BPromise(function(_0x2218ad,_0x27068e){return pm2['delete'](_0x408449,function(_0x2b4f0b,_0xe2b7d8){if(_0x2b4f0b){return _0x27068e(_0x2b4f0b);}pm2[_0xd34f('0x8')]();return _0x2218ad(_0xe2b7d8);});});});};exports[_0xd34f('0xc')]=function(){return connect()[_0xd34f('0x5')](function(){return new BPromise(function(_0x4aaf53,_0x16ecf7){return pm2['dump'](function(_0x51a383){if(_0x51a383){return _0x16ecf7(_0x51a383);}return _0x4aaf53(_0xd34f('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 861a1af..87eb494 100644 --- a/server/config/schedule/chat.js +++ b/server/config/schedule/chat.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x876b=['then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','YYYY-MM-DD\x20HH:mm:ss','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','chatTimeout'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x876b,0x13d));var _0xb876=function(_0x2e5f35,_0x2968e6){_0x2e5f35=_0x2e5f35-0x0;var _0x264f40=_0x876b[_0x2e5f35];return _0x264f40;};'use strict';var _=require(_0xb876('0x0'));var moment=require(_0xb876('0x1'));var Redis=require(_0xb876('0x2'));var util=require(_0xb876('0x3'));var config=require(_0xb876('0x4'));var db=require(_0xb876('0x5'))['db'];var logger=require(_0xb876('0x6'))(_0xb876('0x7'));config[_0xb876('0x8')]=_[_0xb876('0x9')](config[_0xb876('0x8')],{'host':_0xb876('0xa'),'port':0x18eb});var io=require(_0xb876('0xb'))(new Redis(config[_0xb876('0x8')]));function closeInteractions(){var _0x248dc8=0x0;var _0x18ae38=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xb876('0xc')],'where':{'id':0x1}})[_0xb876('0xd')](function(_0x14edd8){_0x248dc8=_0x14edd8[_0xb876('0xc')];if(_0x248dc8){return db[_0xb876('0xe')][_0xb876('0xf')]({'raw':!![],'attributes':['id',_0xb876('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xb876('0x11')](_0x14edd8['chatTimeout'],_0xb876('0x12'))}}});}else{return[];}})[_0xb876('0xd')](function(_0x2d82e6){if(_0x2d82e6&&_0x2d82e6[_0xb876('0x13')]){_0x18ae38=_[_0xb876('0x14')](_0x2d82e6||[],'id');logger['info'](_0xb876('0x15'),_0x18ae38[_0xb876('0x16')]());return db['ChatInteraction']['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xb876('0x17'))},{'where':{'id':_0x18ae38}});}})['then'](function(){if(_0x18ae38&&_0x18ae38[_0xb876('0x13')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x18ae38[_0xb876('0x16')]());for(var _0x23027b=0x0;_0x23027b<_0x18ae38[_0xb876('0x13')];_0x23027b++){io[_0xb876('0x18')]('chatInteraction:update',{'id':_0x18ae38[_0x23027b],'closed':!![]});}}})[_0xb876('0x19')](function(_0x4a0880){logger[_0xb876('0x1a')](_0xb876('0x1b'),_0x4a0880?util[_0xb876('0x1c')](_0x4a0880,{'showHidden':![],'depth':null}):'');});}exports[_0xb876('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x717e=['catch','error','[CHAT]\x20Error\x20closing\x20interactions','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','lastMsgAt','subtract','then','map','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length','emit'];(function(_0x54d1c4,_0x3adff8){var _0x4cb00a=function(_0x2a7db2){while(--_0x2a7db2){_0x54d1c4['push'](_0x54d1c4['shift']());}};_0x4cb00a(++_0x3adff8);}(_0x717e,0x1f3));var _0xe717=function(_0xde9959,_0x415b88){_0xde9959=_0xde9959-0x0;var _0x24d9d5=_0x717e[_0xde9959];return _0x24d9d5;};'use strict';var _=require('lodash');var moment=require(_0xe717('0x0'));var Redis=require(_0xe717('0x1'));var util=require(_0xe717('0x2'));var config=require(_0xe717('0x3'));var db=require(_0xe717('0x4'))['db'];var logger=require(_0xe717('0x5'))(_0xe717('0x6'));config[_0xe717('0x7')]=_[_0xe717('0x8')](config[_0xe717('0x7')],{'host':_0xe717('0x9'),'port':0x18eb});var io=require(_0xe717('0xa'))(new Redis(config[_0xe717('0x7')]));function closeInteractions(){var _0x151f35=0x0;var _0x14211c=[];return db['Setting'][_0xe717('0xb')]({'raw':!![],'attributes':['id',_0xe717('0xc')],'where':{'id':0x1}})['then'](function(_0x503bed){_0x151f35=_0x503bed[_0xe717('0xc')];if(_0x151f35){return db[_0xe717('0xd')]['findAll']({'raw':!![],'attributes':['id',_0xe717('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe717('0xf')](_0x503bed[_0xe717('0xc')],'minutes')}}});}else{return[];}})[_0xe717('0x10')](function(_0x1aca34){if(_0x1aca34&&_0x1aca34['length']){_0x14211c=_[_0xe717('0x11')](_0x1aca34||[],'id');logger['info'](_0xe717('0x12'),_0x14211c[_0xe717('0x13')]());return db['ChatInteraction']['update']({'closeReason':_0xe717('0x14'),'disposition':_0xe717('0x15'),'closed':!![],'closedAt':moment()[_0xe717('0x16')](_0xe717('0x17'))},{'where':{'id':_0x14211c}});}})[_0xe717('0x10')](function(){if(_0x14211c&&_0x14211c['length']){logger[_0xe717('0x18')](_0xe717('0x19'),_0x14211c[_0xe717('0x13')]());for(var _0x38ac04=0x0;_0x38ac04<_0x14211c[_0xe717('0x1a')];_0x38ac04++){io[_0xe717('0x1b')]('chatInteraction:update',{'id':_0x14211c[_0x38ac04],'closed':!![]});}}})[_0xe717('0x1c')](function(_0x4f7018){logger[_0xe717('0x1d')](_0xe717('0x1e'),_0x4f7018?util['inspect'](_0x4f7018,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index e6a7c19..423a7e1 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4ba=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x4a3bd9,_0x4c6ea8){var _0x45b132=function(_0x8cf988){while(--_0x8cf988){_0x4a3bd9['push'](_0x4a3bd9['shift']());}};_0x45b132(++_0x4c6ea8);}(_0xd4ba,0x102));var _0xad4b=function(_0x33fe4f,_0xac463c){_0x33fe4f=_0x33fe4f-0x0;var _0x2572fc=_0xd4ba[_0x33fe4f];return _0x2572fc;};'use strict';function start(){var _0x45f970=require(_0xad4b('0x0'));return _0x45f970['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0xe90f=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x5ef631,_0x947435){var _0x1ad9d7=function(_0x13f01d){while(--_0x13f01d){_0x5ef631['push'](_0x5ef631['shift']());}};_0x1ad9d7(++_0x947435);}(_0xe90f,0x7f));var _0xfe90=function(_0x55e631,_0x4e9bdb){_0x55e631=_0x55e631-0x0;var _0x1a0670=_0xe90f[_0x55e631];return _0x1a0670;};'use strict';function start(){var _0x5d4a27=require(_0xfe90('0x0'));return _0x5d4a27[_0xfe90('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 8a10fcf..efaf21d 100644 --- a/server/config/schedule/index.js +++ b/server/config/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89c3=['endAt','start','add\x20cron','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','savename','%s.%s','basename','extname','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','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','resolve','run\x20job','cron','active','isBetween','startAt'];(function(_0x253bd2,_0x4e88ff){var _0x457ff9=function(_0x15cb2e){while(--_0x15cb2e){_0x253bd2['push'](_0x253bd2['shift']());}};_0x457ff9(++_0x4e88ff);}(_0x89c3,0xff));var _0x389c=function(_0x7f1a74,_0x2af157){_0x7f1a74=_0x7f1a74-0x0;var _0x4e595c=_0x89c3[_0x7f1a74];return _0x4e595c;};'use strict';var fs=require('fs');var util=require(_0x389c('0x0'));var path=require(_0x389c('0x1'));var _=require(_0x389c('0x2'));var moment=require(_0x389c('0x3'));var CronJobManager=require(_0x389c('0x4'));var jayson=require(_0x389c('0x5'));var BPromise=require(_0x389c('0x6'));var logger=require(_0x389c('0x7'))('schedule');var db=require(_0x389c('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x389c('0x9'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2f3e3f,_0x4a83ab){return function(){logger['info'](_0x389c('0xa'),_0x2f3e3f[_0x389c('0xb')]);var _0x28d373=!![];var _0x2efa82=_0x2f3e3f[_0x389c('0xc')][_0x389c('0xd')]();var _0x2a7d64={'account':_0x2efa82,'message':{'from':util[_0x389c('0xe')](_0x389c('0xf'),_0x2f3e3f['MailAccount'][_0x389c('0x10')],_0x2f3e3f[_0x389c('0xc')][_0x389c('0xb')]||_0x2f3e3f[_0x389c('0xc')][_0x389c('0x11')]['user']),'to':_0x2f3e3f['email'],'cc':_0x2f3e3f['cc'],'bcc':_0x2f3e3f[_0x389c('0x12')],'subject':util[_0x389c('0xe')](_0x389c('0x13'),_0x4a83ab['name'],_0x2f3e3f[_0x389c('0x14')],_0x2f3e3f['subtractUnit'])}};var _0x36e855=path[_0x389c('0x15')](__dirname,'../../files/reports');var _0x1687f2=_0x4a83ab[_0x389c('0x16')];var _0x36c118=util['format'](_0x389c('0x17'),path[_0x389c('0x18')](_0x4a83ab[_0x389c('0x16')],path[_0x389c('0x19')](_0x4a83ab[_0x389c('0x16')])),'zip');var _0x5b6ef8=path['join'](_0x36e855,_0x1687f2);var _0x335c3e=path[_0x389c('0x15')](_0x36e855,_0x36c118);if(fs['existsSync'](_0x5b6ef8)){_0x4a83ab[_0x389c('0x1a')]=_0x389c('0x1b');_0x2a7d64[_0x389c('0x1c')][_0x389c('0x1d')]=[{'filename':_0x1687f2,'path':_0x5b6ef8}];_0x2a7d64[_0x389c('0x1c')][_0x389c('0x1e')]=util[_0x389c('0xe')](_0x389c('0x1f'),JSON[_0x389c('0x20')](_0x4a83ab,null,0x2));}else if(fs['existsSync'](_0x335c3e)){_0x4a83ab[_0x389c('0x1a')]=_0x389c('0x1b');_0x2a7d64[_0x389c('0x1c')][_0x389c('0x1d')]=[{'filename':_0x36c118,'path':_0x335c3e}];}else{_0x2a7d64[_0x389c('0x1c')][_0x389c('0x1e')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2f3e3f[_0x389c('0x21')]){_0x28d373=![];logger[_0x389c('0x22')](_0x389c('0x23'));}}if(_0x28d373){return client[_0x389c('0x24')]('SendMail',_0x2a7d64)[_0x389c('0x25')](function(_0x2729bd){if(_0x2729bd['error']){return logger[_0x389c('0x26')]('error\x20mail',JSON[_0x389c('0x20')](_0x2729bd));}return logger[_0x389c('0x22')](_0x389c('0x27'));})[_0x389c('0x28')](function(_0x21ab93){return logger['error'](_0x389c('0x29'),JSON[_0x389c('0x20')](_0x21ab93));});}};}function handleError(){return function(_0x29e9f8){return logger[_0x389c('0x26')](JSON[_0x389c('0x20')](_0x29e9f8));};}function handleResult(_0x48c79e){return function(_0x3846a3){logger['info'](_0x389c('0x2a'),JSON[_0x389c('0x20')](_0x3846a3));if(_0x48c79e[_0x389c('0xc')]&&_0x48c79e[_0x389c('0xc')]['Smtp']&&!_[_0x389c('0x2b')](_0x48c79e[_0x389c('0xb')])){setTimeout(handleSendEmail(_0x48c79e,_0x3846a3),0x3c*0x3e8);}};}function handleJob(_0x594f6a){return function(){try{if(_[_0x389c('0x2b')](_0x594f6a[_0x389c('0x14')])){return logger[_0x389c('0x22')](_0x389c('0x2c'));}if(_[_0x389c('0x2b')](_0x594f6a[_0x389c('0x2d')])){return logger[_0x389c('0x22')](_0x389c('0x2e'));}var _0x22220d={'startDate':moment()[_0x389c('0x2f')](_0x594f6a[_0x389c('0x14')],_0x594f6a[_0x389c('0x2d')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x389c('0x30')),'type':'scheduled','output':_0x594f6a[_0x389c('0x31')],'name':_0x594f6a['name']};if(!_[_0x389c('0x2b')](_0x594f6a[_0x389c('0x32')])){logger[_0x389c('0x22')](_0x389c('0x33'),_0x594f6a['DefaultReportId']);return analyticDefaultReportController[_0x389c('0x34')]({'id':_0x594f6a[_0x389c('0x32')]},_0x22220d)[_0x389c('0x25')](handleResult(_0x594f6a))[_0x389c('0x28')](handleError());}if(!_[_0x389c('0x2b')](_0x594f6a[_0x389c('0x35')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x594f6a[_0x389c('0x35')]);return analyticCustomReportController[_0x389c('0x34')]({'id':_0x594f6a[_0x389c('0x35')]},_0x22220d)[_0x389c('0x25')](handleResult(_0x594f6a))[_0x389c('0x28')](handleError());}}catch(_0x3e37b0){logger[_0x389c('0x26')](JSON[_0x389c('0x20')](_0x3e37b0));}return logger[_0x389c('0x22')](_0x389c('0x36'));};}function getJobs(_0x3eec96){var _0x2bb993={};if(_0x3eec96){_0x2bb993['id']=_0x3eec96;}return db[_0x389c('0x37')]['findAll']({'where':_0x2bb993,'include':[{'model':db['MailAccount'],'attributes':['id',_0x389c('0x10'),_0x389c('0xb')],'include':[{'model':db[_0x389c('0x38')],'as':_0x389c('0x11'),'include':[{'model':db[_0x389c('0x39')],'as':_0x389c('0x39')}]}]}]})['then'](function(_0x57853f){var _0x31b0fa=_[_0x389c('0x3a')](manager[_0x389c('0x3b')]);var _0x4d9ec4=_[_0x389c('0x3c')](_0x57853f,function(_0x2884c4){return _0x2884c4['id'][_0x389c('0x3d')]();});var _0x3f85de=_[_0x389c('0x3e')](_0x57853f,function(_0x215dae){return _0x215dae['id']['toString']();});var _0x2e2e87=_0x3eec96?_0x4d9ec4:_[_0x389c('0x3f')](_0x4d9ec4,_0x31b0fa);var _0x3bb25e=_[_0x389c('0x40')](_0x4d9ec4,_0x31b0fa);var _0x56ea80=_[_0x389c('0x3f')](_0x31b0fa,_0x4d9ec4);var _0x591fcc;var _0x2dbce5;for(_0x591fcc=0x0;_0x591fcc<_0x56ea80[_0x389c('0x41')]&&!_0x3eec96;_0x591fcc+=0x1){_0x2dbce5=_0x56ea80[_0x591fcc][_0x389c('0x3d')]();if(manager[_0x389c('0x42')](_0x2dbce5)){manager[_0x389c('0x43')](_0x2dbce5);manager[_0x389c('0x44')](_0x2dbce5);logger[_0x389c('0x22')](_0x389c('0x45'),_0x2dbce5);}}logger[_0x389c('0x22')](_0x389c('0x46'),JSON[_0x389c('0x20')](_0x2e2e87));for(_0x591fcc=0x0;_0x591fcc<_0x2e2e87['length'];_0x591fcc+=0x1){_0x2dbce5=_0x2e2e87[_0x591fcc][_0x389c('0x3d')]();logger[_0x389c('0x22')]('index',_0x2dbce5);if(_0x3eec96){logger[_0x389c('0x22')]('my\x20id',_0x3eec96);logger[_0x389c('0x22')](JSON[_0x389c('0x20')](_0x3f85de[_0x2dbce5]));BPromise[_0x389c('0x47')]()[_0x389c('0x25')](handleJob(_0x3f85de[_0x2dbce5]));logger[_0x389c('0x22')](_0x389c('0x48'),_0x3f85de[_0x2dbce5][_0x389c('0x10')],_0x3f85de[_0x2dbce5][_0x389c('0x49')]);}else if(_0x3f85de[_0x2dbce5][_0x389c('0x49')]&&_0x3f85de[_0x2dbce5][_0x389c('0x4a')]&&moment()[_0x389c('0x4b')](_0x3f85de[_0x2dbce5][_0x389c('0x4c')],_0x3f85de[_0x2dbce5][_0x389c('0x4d')])){manager['add'](_0x2dbce5,_0x3f85de[_0x2dbce5]['cron'],handleJob(_0x3f85de[_0x2dbce5]));manager[_0x389c('0x4e')](_0x2dbce5);logger[_0x389c('0x22')](_0x389c('0x4f'),_0x3f85de[_0x2dbce5]['name'],_0x3f85de[_0x2dbce5][_0x389c('0x49')]);}else if(manager[_0x389c('0x42')](_0x2dbce5)){manager[_0x389c('0x43')](_0x2dbce5);manager[_0x389c('0x44')](_0x2dbce5);logger['info']('stop\x20cron',_0x3f85de[_0x2dbce5]['name'],_0x3f85de[_0x2dbce5]['cron']);}}for(_0x591fcc=0x0,_0x2dbce5;_0x591fcc<_0x3bb25e[_0x389c('0x41')]&&!_0x3eec96;_0x591fcc+=0x1){_0x2dbce5=_0x3bb25e[_0x591fcc]['toString']();if(manager['exists'](_0x2dbce5)){if(_0x3f85de[_0x2dbce5][_0x389c('0x49')]&&_0x3f85de[_0x2dbce5][_0x389c('0x4a')]&&moment()[_0x389c('0x4b')](_0x3f85de[_0x2dbce5][_0x389c('0x4c')],_0x3f85de[_0x2dbce5][_0x389c('0x4d')])){manager[_0x389c('0x50')](_0x2dbce5,_0x3f85de[_0x2dbce5][_0x389c('0x49')],handleJob(_0x3f85de[_0x2dbce5]));logger['info'](_0x389c('0x51'),_0x3f85de[_0x2dbce5][_0x389c('0x10')],_0x3f85de[_0x2dbce5][_0x389c('0x49')]);}else{manager[_0x389c('0x43')](_0x2dbce5);manager[_0x389c('0x44')](_0x2dbce5);logger[_0x389c('0x22')]('stop\x20cron',_0x3f85de[_0x2dbce5][_0x389c('0x10')],_0x3f85de[_0x2dbce5]['cron']);}}}})[_0x389c('0x28')](function(_0x48f955){logger[_0x389c('0x26')](JSON[_0x389c('0x20')](_0x48f955));});}exports[_0x389c('0x52')]=function(_0x3c684c){return getJobs(_0x3c684c);};exports[_0x389c('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x7acd=['then','findAll','CloudProvider','jobs','map','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','run\x20job','cron','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','length','active','update','update\x20cron','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','%s.%s','savename','extname','existsSync','status','Sent','message','attachments','stringify','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId'];(function(_0x4f3baa,_0x9d31ac){var _0x307f57=function(_0x5dee19){while(--_0x5dee19){_0x4f3baa['push'](_0x4f3baa['shift']());}};_0x307f57(++_0x9d31ac);}(_0x7acd,0x107));var _0xd7ac=function(_0x52aac3,_0x495cb2){_0x52aac3=_0x52aac3-0x0;var _0x4f213e=_0x7acd[_0x52aac3];return _0x4f213e;};'use strict';var fs=require('fs');var util=require(_0xd7ac('0x0'));var path=require('path');var _=require(_0xd7ac('0x1'));var moment=require(_0xd7ac('0x2'));var CronJobManager=require(_0xd7ac('0x3'));var jayson=require(_0xd7ac('0x4'));var BPromise=require(_0xd7ac('0x5'));var logger=require(_0xd7ac('0x6'))(_0xd7ac('0x7'));var db=require(_0xd7ac('0x8'))['db'];var analyticCustomReportController=require(_0xd7ac('0x9'));var analyticDefaultReportController=require(_0xd7ac('0xa'));var client=jayson[_0xd7ac('0xb')][_0xd7ac('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x48475c,_0xba4a67){return function(){logger[_0xd7ac('0xd')](_0xd7ac('0xe'),_0x48475c[_0xd7ac('0xf')]);var _0x4f2ccb=!![];var _0x2f099c=_0x48475c['MailAccount'][_0xd7ac('0x10')]();var _0x458657={'account':_0x2f099c,'message':{'from':util[_0xd7ac('0x11')](_0xd7ac('0x12'),_0x48475c[_0xd7ac('0x13')][_0xd7ac('0x14')],_0x48475c['MailAccount'][_0xd7ac('0xf')]||_0x48475c[_0xd7ac('0x13')][_0xd7ac('0x15')]['user']),'to':_0x48475c[_0xd7ac('0xf')],'cc':_0x48475c['cc'],'bcc':_0x48475c[_0xd7ac('0x16')],'subject':util[_0xd7ac('0x11')](_0xd7ac('0x17'),_0xba4a67[_0xd7ac('0x14')],_0x48475c[_0xd7ac('0x18')],_0x48475c[_0xd7ac('0x19')])}};var _0x39c246=path[_0xd7ac('0x1a')](__dirname,'../../files/reports');var _0x24ec98=_0xba4a67['savename'];var _0x3eb33f=util[_0xd7ac('0x11')](_0xd7ac('0x1b'),path['basename'](_0xba4a67[_0xd7ac('0x1c')],path[_0xd7ac('0x1d')](_0xba4a67[_0xd7ac('0x1c')])),'zip');var _0x1d0f21=path['join'](_0x39c246,_0x24ec98);var _0x55a4eb=path[_0xd7ac('0x1a')](_0x39c246,_0x3eb33f);if(fs[_0xd7ac('0x1e')](_0x1d0f21)){_0xba4a67[_0xd7ac('0x1f')]=_0xd7ac('0x20');_0x458657[_0xd7ac('0x21')][_0xd7ac('0x22')]=[{'filename':_0x24ec98,'path':_0x1d0f21}];_0x458657['message']['text']=util[_0xd7ac('0x11')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xd7ac('0x23')](_0xba4a67,null,0x2));}else if(fs[_0xd7ac('0x1e')](_0x55a4eb)){_0xba4a67[_0xd7ac('0x1f')]=_0xd7ac('0x20');_0x458657['message'][_0xd7ac('0x22')]=[{'filename':_0x3eb33f,'path':_0x55a4eb}];}else{_0x458657['message']['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x48475c['sendIfEmpty']){_0x4f2ccb=![];logger['info'](_0xd7ac('0x24'));}}if(_0x4f2ccb){return client[_0xd7ac('0x25')](_0xd7ac('0x26'),_0x458657)['then'](function(_0x28f206){if(_0x28f206[_0xd7ac('0x27')]){return logger['error'](_0xd7ac('0x28'),JSON[_0xd7ac('0x23')](_0x28f206));}return logger['info'](_0xd7ac('0x29'));})[_0xd7ac('0x2a')](function(_0x21567b){return logger[_0xd7ac('0x27')](_0xd7ac('0x28'),JSON[_0xd7ac('0x23')](_0x21567b));});}};}function handleError(){return function(_0x497f26){return logger[_0xd7ac('0x27')](JSON[_0xd7ac('0x23')](_0x497f26));};}function handleResult(_0xc2e59f){return function(_0x56e09e){logger[_0xd7ac('0xd')](_0xd7ac('0x2b'),JSON[_0xd7ac('0x23')](_0x56e09e));if(_0xc2e59f[_0xd7ac('0x13')]&&_0xc2e59f[_0xd7ac('0x13')][_0xd7ac('0x15')]&&!_[_0xd7ac('0x2c')](_0xc2e59f[_0xd7ac('0xf')])){setTimeout(handleSendEmail(_0xc2e59f,_0x56e09e),0x3c*0x3e8);}};}function handleJob(_0x234e93){return function(){try{if(_[_0xd7ac('0x2c')](_0x234e93[_0xd7ac('0x18')])){return logger[_0xd7ac('0xd')](_0xd7ac('0x2d'));}if(_[_0xd7ac('0x2c')](_0x234e93[_0xd7ac('0x19')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x5663b7={'startDate':moment()[_0xd7ac('0x2e')](_0x234e93[_0xd7ac('0x18')],_0x234e93[_0xd7ac('0x19')])[_0xd7ac('0x11')](_0xd7ac('0x2f')),'endDate':moment()[_0xd7ac('0x11')](_0xd7ac('0x2f')),'type':_0xd7ac('0x30'),'output':_0x234e93['output'],'name':_0x234e93[_0xd7ac('0x14')]};if(!_[_0xd7ac('0x2c')](_0x234e93[_0xd7ac('0x31')])){logger[_0xd7ac('0xd')](_0xd7ac('0x32'),_0x234e93[_0xd7ac('0x31')]);return analyticDefaultReportController[_0xd7ac('0x33')]({'id':_0x234e93[_0xd7ac('0x31')]},_0x5663b7)['then'](handleResult(_0x234e93))['catch'](handleError());}if(!_[_0xd7ac('0x2c')](_0x234e93[_0xd7ac('0x34')])){logger[_0xd7ac('0xd')]('exec\x20custom\x20report\x20id:%s',_0x234e93['CustomReportId']);return analyticCustomReportController[_0xd7ac('0x33')]({'id':_0x234e93['CustomReportId']},_0x5663b7)[_0xd7ac('0x35')](handleResult(_0x234e93))[_0xd7ac('0x2a')](handleError());}}catch(_0x26f52e){logger[_0xd7ac('0x27')](JSON[_0xd7ac('0x23')](_0x26f52e));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x39d880){var _0x21694a={};if(_0x39d880){_0x21694a['id']=_0x39d880;}return db['Schedule'][_0xd7ac('0x36')]({'where':_0x21694a,'include':[{'model':db['MailAccount'],'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0xd7ac('0x15'),'include':[{'model':db['CloudProvider'],'as':_0xd7ac('0x37')}]}]}]})[_0xd7ac('0x35')](function(_0x5ccf73){var _0x3e5af8=_['keys'](manager[_0xd7ac('0x38')]);var _0x4eb904=_[_0xd7ac('0x39')](_0x5ccf73,function(_0x3f71f2){return _0x3f71f2['id'][_0xd7ac('0x3a')]();});var _0x931772=_['keyBy'](_0x5ccf73,function(_0x36b777){return _0x36b777['id'][_0xd7ac('0x3a')]();});var _0xc39aea=_0x39d880?_0x4eb904:_[_0xd7ac('0x3b')](_0x4eb904,_0x3e5af8);var _0x59572f=_[_0xd7ac('0x3c')](_0x4eb904,_0x3e5af8);var _0x516956=_[_0xd7ac('0x3b')](_0x3e5af8,_0x4eb904);var _0x5aa476;var _0x415923;for(_0x5aa476=0x0;_0x5aa476<_0x516956['length']&&!_0x39d880;_0x5aa476+=0x1){_0x415923=_0x516956[_0x5aa476]['toString']();if(manager[_0xd7ac('0x3d')](_0x415923)){manager[_0xd7ac('0x3e')](_0x415923);manager[_0xd7ac('0x3f')](_0x415923);logger[_0xd7ac('0xd')](_0xd7ac('0x40'),_0x415923);}}logger[_0xd7ac('0xd')](_0xd7ac('0x41'),JSON['stringify'](_0xc39aea));for(_0x5aa476=0x0;_0x5aa476<_0xc39aea['length'];_0x5aa476+=0x1){_0x415923=_0xc39aea[_0x5aa476][_0xd7ac('0x3a')]();logger[_0xd7ac('0xd')]('index',_0x415923);if(_0x39d880){logger[_0xd7ac('0xd')](_0xd7ac('0x42'),_0x39d880);logger[_0xd7ac('0xd')](JSON[_0xd7ac('0x23')](_0x931772[_0x415923]));BPromise['resolve']()['then'](handleJob(_0x931772[_0x415923]));logger['info'](_0xd7ac('0x43'),_0x931772[_0x415923]['name'],_0x931772[_0x415923][_0xd7ac('0x44')]);}else if(_0x931772[_0x415923]['cron']&&_0x931772[_0x415923]['active']&&moment()[_0xd7ac('0x45')](_0x931772[_0x415923][_0xd7ac('0x46')],_0x931772[_0x415923][_0xd7ac('0x47')])){manager['add'](_0x415923,_0x931772[_0x415923][_0xd7ac('0x44')],handleJob(_0x931772[_0x415923]));manager[_0xd7ac('0x48')](_0x415923);logger[_0xd7ac('0xd')](_0xd7ac('0x49'),_0x931772[_0x415923]['name'],_0x931772[_0x415923][_0xd7ac('0x44')]);}else if(manager[_0xd7ac('0x3d')](_0x415923)){manager[_0xd7ac('0x3e')](_0x415923);manager['deleteJob'](_0x415923);logger['info'](_0xd7ac('0x4a'),_0x931772[_0x415923][_0xd7ac('0x14')],_0x931772[_0x415923][_0xd7ac('0x44')]);}}for(_0x5aa476=0x0,_0x415923;_0x5aa476<_0x59572f[_0xd7ac('0x4b')]&&!_0x39d880;_0x5aa476+=0x1){_0x415923=_0x59572f[_0x5aa476]['toString']();if(manager['exists'](_0x415923)){if(_0x931772[_0x415923]['cron']&&_0x931772[_0x415923][_0xd7ac('0x4c')]&&moment()[_0xd7ac('0x45')](_0x931772[_0x415923][_0xd7ac('0x46')],_0x931772[_0x415923]['endAt'])){manager[_0xd7ac('0x4d')](_0x415923,_0x931772[_0x415923][_0xd7ac('0x44')],handleJob(_0x931772[_0x415923]));logger['info'](_0xd7ac('0x4e'),_0x931772[_0x415923][_0xd7ac('0x14')],_0x931772[_0x415923][_0xd7ac('0x44')]);}else{manager[_0xd7ac('0x3e')](_0x415923);manager['deleteJob'](_0x415923);logger[_0xd7ac('0xd')](_0xd7ac('0x4a'),_0x931772[_0x415923]['name'],_0x931772[_0x415923][_0xd7ac('0x44')]);}}}})['catch'](function(_0x3d9386){logger[_0xd7ac('0x27')](JSON[_0xd7ac('0x23')](_0x3d9386));});}exports['run']=function(_0xb0149e){return getJobs(_0xb0149e);};exports[_0xd7ac('0x48')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 0fcad79..ae8f55b 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6739=['detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','update','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','bucket','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','forEach','push','all','SequelizeValidationError','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','TranscribeService','Comprehend'];(function(_0x2f6541,_0x363cba){var _0x4d76d8=function(_0x86404){while(--_0x86404){_0x2f6541['push'](_0x2f6541['shift']());}};_0x4d76d8(++_0x363cba);}(_0x6739,0xd3));var _0x9673=function(_0x1c1a64,_0x4e3ae5){_0x1c1a64=_0x1c1a64-0x0;var _0x5700e5=_0x6739[_0x1c1a64];return _0x5700e5;};var _=require(_0x9673('0x0'));var AWS=require(_0x9673('0x1'));var rp=require(_0x9673('0x2'));var util=require(_0x9673('0x3'));var BPromise=require(_0x9673('0x4'));var db=require(_0x9673('0x5'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x1d5ad7,_0x5e7a4f,_0xe813ff,_0x47e550){return new Promise(function(_0x57a9d5,_0x27f94b){var _0x3ad052=new AWS[(_0x9673('0x6'))]({'accessKeyId':_0x5e7a4f,'secretAccessKey':_0x1d5ad7,'region':_0xe813ff});_0x3ad052['getTranscriptionJob']({'TranscriptionJobName':_0x47e550},function(_0x4e1dd5,_0x39b0f0){if(_0x4e1dd5){return _0x27f94b(_0x4e1dd5);}else{return _0x57a9d5(_0x39b0f0);}});});}function sentiment(_0x21e4b4,_0x2c4d48,_0x509966,_0x405101,_0x1e99fd){return new Promise(function(_0x33073e,_0x55f6a5){var _0x30d538=new AWS[(_0x9673('0x7'))]({'accessKeyId':_0x2c4d48,'secretAccessKey':_0x21e4b4,'region':_0x509966});_0x30d538[_0x9673('0x8')]({'Text':_0x405101,'LanguageCode':_0x1e99fd[_0x9673('0x9')](0x0,0x2)},function(_0x5a8475,_0x3be407){if(_0x5a8475){return _0x55f6a5(_0x5a8475);}else{return _0x33073e(_0x3be407);}});});}function checkTranscribeJob(_0x3cf3d1,_0x440bad,_0x4603fd){var _0x565201;return new BPromise(function(_0x317eb0,_0x2c16b2){logger['info'](util[_0x9673('0xa')](_0x9673('0xb'),_0x3cf3d1['id'],_0x3cf3d1[_0x9673('0xc')]));return getTranscriptionJob(_0x4603fd['data1'],_0x4603fd[_0x9673('0xd')],_0x440bad['transcribeRegion'],_0x3cf3d1[_0x9673('0xc')])['then'](function(_0x597757){logger[_0x9673('0xe')](util['format'](_0x9673('0xf'),_0x3cf3d1['id'],_0x3cf3d1[_0x9673('0xc')],_0x597757['TranscriptionJob'][_0x9673('0x10')]));if(!_0x3cf3d1[_0x9673('0x11')]){switch(_0x597757[_0x9673('0x12')][_0x9673('0x10')]){case _0x9673('0x13'):var _0x281a1a={'transcribeStatus':_0x597757[_0x9673('0x12')][_0x9673('0x10')],'fileUri':_0x597757[_0x9673('0x12')][_0x9673('0x14')]['TranscriptFileUri']};logger[_0x9673('0xe')](util[_0x9673('0xa')]('[RECORDING:%d]\x20Get\x20transcript',_0x3cf3d1['id']));return rp({'uri':_0x597757[_0x9673('0x12')][_0x9673('0x14')]['TranscriptFileUri'],'json':!![]})[_0x9673('0x15')](function(_0xa8bc6d){logger[_0x9673('0xe')](util['format'](_0x9673('0x16'),_0x3cf3d1['id']));if(_0xa8bc6d&&_0xa8bc6d[_0x9673('0x17')]&&_0xa8bc6d[_0x9673('0x17')][_0x9673('0x18')]&&_0xa8bc6d['results'][_0x9673('0x18')]['length']){_0x281a1a[_0x9673('0x11')]='';for(var _0x404213=0x0;_0x404213<_0xa8bc6d[_0x9673('0x17')][_0x9673('0x18')][_0x9673('0x19')];_0x404213++){_0x281a1a[_0x9673('0x11')]+=_0xa8bc6d[_0x9673('0x17')][_0x9673('0x18')][_0x404213][_0x9673('0x1a')]+'';}}return _0x3cf3d1['update'](_0x281a1a);})[_0x9673('0x15')](function(){logger[_0x9673('0xe')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3cf3d1['id']));if(!_0x3cf3d1[_0x9673('0x1b')]){throw new db[(_0x9673('0x1c'))][(_0x9673('0x1d'))](_0x9673('0x1e'));}if(!_0x440bad['sentiment']||!_0x440bad[_0x9673('0x1f')]||!_0x440bad['sentimentRegion']||!_0x440bad[_0x9673('0x20')]||!_0x440bad['bucket']){throw new db[(_0x9673('0x1c'))][(_0x9673('0x1d'))](_0x9673('0x21'));}if(!_0x281a1a['fileText']){throw new Error(_0x9673('0x22'));}if(_0x440bad['sentimentAccountId']===_0x4603fd['id']){return _0x4603fd;}else{return db[_0x9673('0x23')][_0x9673('0x24')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x38e774){if(!_0x38e774){throw new db[(_0x9673('0x1c'))][(_0x9673('0x1d'))](_0x9673('0x25'));}if(!_0x38e774[_0x9673('0x26')]||!_0x38e774[_0x9673('0xd')]){throw new db[(_0x9673('0x1c'))]['ValidationError'](_0x9673('0x27'));}_0x565201=_0x38e774;logger[_0x9673('0xe')](util[_0x9673('0xa')](_0x9673('0x28'),_0x3cf3d1['id']));return sentiment(_0x565201[_0x9673('0x26')],_0x565201[_0x9673('0xd')],_0x440bad[_0x9673('0x29')],_0x281a1a[_0x9673('0x11')],_0x440bad[_0x9673('0x20')]);})[_0x9673('0x15')](function(_0x5f112a){logger[_0x9673('0xe')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3cf3d1['id']));return _0x3cf3d1[_0x9673('0x2a')]({'sentiment':_0x5f112a[_0x9673('0x2b')],'sPositive':_0x5f112a[_0x9673('0x2c')][_0x9673('0x2d')],'sNegative':_0x5f112a['SentimentScore'][_0x9673('0x2e')],'sMixed':_0x5f112a[_0x9673('0x2c')][_0x9673('0x2f')],'sNeutral':_0x5f112a[_0x9673('0x2c')][_0x9673('0x30')]});})[_0x9673('0x15')](function(){logger[_0x9673('0xe')](util[_0x9673('0xa')](_0x9673('0x31'),_0x3cf3d1['id']));_0x317eb0();});case'FAILED':return _0x3cf3d1[_0x9673('0x2a')]({'transcribeStatus':_0x9673('0x32'),'failureReason':_0x597757['TranscriptionJob']['FailureReason']})[_0x9673('0x15')](function(){logger['info'](util[_0x9673('0xa')](_0x9673('0x31'),_0x3cf3d1['id']));_0x317eb0();});default:logger['info'](util['format'](_0x9673('0x33'),_0x3cf3d1['id']));break;}}else{return BPromise[_0x9673('0x34')]()[_0x9673('0x15')](function(){if(!_0x3cf3d1[_0x9673('0x1b')]){throw new db[(_0x9673('0x1c'))][(_0x9673('0x1d'))](_0x9673('0x1e'));}if(!_0x440bad[_0x9673('0x35')]||!_0x440bad[_0x9673('0x1f')]||!_0x440bad['sentimentRegion']||!_0x440bad[_0x9673('0x20')]||!_0x440bad[_0x9673('0x36')]){throw new db[(_0x9673('0x1c'))][(_0x9673('0x1d'))](_0x9673('0x21'));}if(!_0x3cf3d1[_0x9673('0x11')]){throw new Error(_0x9673('0x22'));}if(_0x440bad['sentimentAccountId']===_0x4603fd['id']){return _0x4603fd;}else{return db[_0x9673('0x23')][_0x9673('0x24')]({'where':{'id':_settings[_0x9673('0x1f')]}});}})[_0x9673('0x15')](function(_0xef619a){if(!_0xef619a){throw new db['Sequelize'][(_0x9673('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xef619a[_0x9673('0x26')]||!_0xef619a['data2']){throw new db[(_0x9673('0x1c'))][(_0x9673('0x1d'))](_0x9673('0x27'));}_0x565201=_0xef619a;logger[_0x9673('0xe')](util[_0x9673('0xa')](_0x9673('0x28'),_0x3cf3d1['id']));return sentiment(_0x565201[_0x9673('0x26')],_0x565201[_0x9673('0xd')],_0x440bad['sentimentRegion'],_0x3cf3d1['fileText'],_0x440bad['language']);})['then'](function(_0x4050ab){logger[_0x9673('0xe')](util[_0x9673('0xa')](_0x9673('0x37'),_0x3cf3d1['id']));return _0x3cf3d1[_0x9673('0x2a')]({'sentiment':_0x4050ab['Sentiment'],'sPositive':_0x4050ab[_0x9673('0x2c')][_0x9673('0x2d')],'sNegative':_0x4050ab['SentimentScore'][_0x9673('0x2e')],'sMixed':_0x4050ab['SentimentScore']['Mixed'],'sNeutral':_0x4050ab[_0x9673('0x2c')][_0x9673('0x30')],'transcribeStatus':_0x9673('0x13')});})[_0x9673('0x15')](function(){logger['info'](util['format'](_0x9673('0x31'),_0x3cf3d1['id']));_0x317eb0();});}})[_0x9673('0x38')](function(_0x38f795){if(_0x38f795){if(!_0x38f795[_0x9673('0x39')]||_0x38f795[_0x9673('0x39')]!=='SequelizeValidationError'){logger[_0x9673('0x3a')](util[_0x9673('0xa')](_0x9673('0x3b'),_0x3cf3d1['id']),util['inspect'](_0x38f795,{'showHidden':![],'depth':null}));}}_0x317eb0();});});}function checkTranscribe(){var _0x4f175b;var _0x5080e2;var _0x4f0641;return db[_0x9673('0x3c')][_0x9673('0x3d')]({'where':{'transcribeStatus':_0x9673('0x3e')}})[_0x9673('0x15')](function(_0x2256d9){if(!_0x2256d9||!_0x2256d9[_0x9673('0x19')]){throw new db[(_0x9673('0x1c'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x4f175b=_0x2256d9;return db[_0x9673('0x3f')][_0x9673('0x24')]({'where':{'id':0x1}});})[_0x9673('0x15')](function(_0x53d06e){if(!_0x53d06e){throw new db[(_0x9673('0x1c'))][(_0x9673('0x1d'))](_0x9673('0x40'));}_0x5080e2=_0x53d06e;if(!_0x5080e2[_0x9673('0x41')]||!_0x5080e2['transcribeAccountId']||!_0x5080e2['transcribeRegion']||!_0x5080e2[_0x9673('0x20')]||!_0x5080e2['bucket']){throw new db[(_0x9673('0x1c'))][(_0x9673('0x1d'))](_0x9673('0x42'));}return db['CloudProvider'][_0x9673('0x24')]({'where':{'id':_0x5080e2['transcribeAccountId']}});})['then'](function(_0x1dd131){if(!_0x1dd131){throw new db[(_0x9673('0x1c'))][(_0x9673('0x1d'))](_0x9673('0x25'));}if(!_0x1dd131['data1']||!_0x1dd131[_0x9673('0xd')]){throw new db['Sequelize'][(_0x9673('0x1d'))](_0x9673('0x27'));}_0x4f0641=_0x1dd131;var _0x276c9b=[];_0x4f175b[_0x9673('0x43')](function(_0x5a9596){_0x276c9b[_0x9673('0x44')](checkTranscribeJob(_0x5a9596,_0x5080e2,_0x4f0641));});return BPromise[_0x9673('0x45')](_0x276c9b);})[_0x9673('0x38')](function(_0x4c81a9){if(_0x4c81a9){if(!_0x4c81a9[_0x9673('0x39')]||_0x4c81a9[_0x9673('0x39')]!==_0x9673('0x46')){logger[_0x9673('0x3a')](util[_0x9673('0x47')](_0x4c81a9,{'showHidden':![],'depth':null}));}}});}exports[_0x9673('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xfbb4=['[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','SequelizeValidationError','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeName','then','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Sequelize','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason'];(function(_0x56a90e,_0x139138){var _0x4d44ea=function(_0x1c4db2){while(--_0x1c4db2){_0x56a90e['push'](_0x56a90e['shift']());}};_0x4d44ea(++_0x139138);}(_0xfbb4,0x186));var _0x4fbb=function(_0x4c77a2,_0x451b31){_0x4c77a2=_0x4c77a2-0x0;var _0x1f41dd=_0xfbb4[_0x4c77a2];return _0x1f41dd;};var _=require(_0x4fbb('0x0'));var AWS=require(_0x4fbb('0x1'));var rp=require(_0x4fbb('0x2'));var util=require(_0x4fbb('0x3'));var BPromise=require(_0x4fbb('0x4'));var db=require(_0x4fbb('0x5'))['db'];var logger=require(_0x4fbb('0x6'))(_0x4fbb('0x7'));function getTranscriptionJob(_0x5c67e4,_0x514d23,_0x16c6f2,_0xba265e){return new Promise(function(_0x2b5756,_0x306f07){var _0x5f0b6b=new AWS['TranscribeService']({'accessKeyId':_0x514d23,'secretAccessKey':_0x5c67e4,'region':_0x16c6f2});_0x5f0b6b['getTranscriptionJob']({'TranscriptionJobName':_0xba265e},function(_0x4e57d7,_0xa17d45){if(_0x4e57d7){return _0x306f07(_0x4e57d7);}else{return _0x2b5756(_0xa17d45);}});});}function sentiment(_0x45ac3e,_0x5574b4,_0xc9ddea,_0xc3ed78,_0x4cac34){return new Promise(function(_0x360c27,_0x208526){var _0x1ecd42=new AWS[(_0x4fbb('0x8'))]({'accessKeyId':_0x5574b4,'secretAccessKey':_0x45ac3e,'region':_0xc9ddea});_0x1ecd42[_0x4fbb('0x9')]({'Text':_0xc3ed78,'LanguageCode':_0x4cac34['substring'](0x0,0x2)},function(_0xa148,_0x3e349){if(_0xa148){return _0x208526(_0xa148);}else{return _0x360c27(_0x3e349);}});});}function checkTranscribeJob(_0x3b94dc,_0x2aec34,_0x340523){var _0x486020;return new BPromise(function(_0x5f2a54,_0x19dd5e){logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')](_0x4fbb('0xc'),_0x3b94dc['id'],_0x3b94dc['transcribeName']));return getTranscriptionJob(_0x340523[_0x4fbb('0xd')],_0x340523['data2'],_0x2aec34['transcribeRegion'],_0x3b94dc[_0x4fbb('0xe')])[_0x4fbb('0xf')](function(_0x4c47ff){logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x3b94dc['id'],_0x3b94dc['transcribeName'],_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x11')]));if(!_0x3b94dc[_0x4fbb('0x12')]){switch(_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x11')]){case _0x4fbb('0x13'):var _0x91e29f={'transcribeStatus':_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x11')],'fileUri':_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x14')][_0x4fbb('0x15')]};logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')](_0x4fbb('0x16'),_0x3b94dc['id']));return rp({'uri':_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x14')][_0x4fbb('0x15')],'json':!![]})[_0x4fbb('0xf')](function(_0x2db786){logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')](_0x4fbb('0x17'),_0x3b94dc['id']));if(_0x2db786&&_0x2db786[_0x4fbb('0x18')]&&_0x2db786['results']['transcripts']&&_0x2db786[_0x4fbb('0x18')][_0x4fbb('0x19')][_0x4fbb('0x1a')]){_0x91e29f[_0x4fbb('0x12')]='';for(var _0x505c9d=0x0;_0x505c9d<_0x2db786[_0x4fbb('0x18')][_0x4fbb('0x19')]['length'];_0x505c9d++){_0x91e29f['fileText']+=_0x2db786['results'][_0x4fbb('0x19')][_0x505c9d][_0x4fbb('0x1b')]+'';}}return _0x3b94dc[_0x4fbb('0x1c')](_0x91e29f);})[_0x4fbb('0xf')](function(){logger['info'](util[_0x4fbb('0xb')](_0x4fbb('0x1d'),_0x3b94dc['id']));if(!_0x3b94dc[_0x4fbb('0x1e')]){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x20'));}if(!_0x2aec34[_0x4fbb('0x21')]||!_0x2aec34[_0x4fbb('0x22')]||!_0x2aec34[_0x4fbb('0x23')]||!_0x2aec34[_0x4fbb('0x24')]||!_0x2aec34[_0x4fbb('0x25')]){throw new db['Sequelize'][(_0x4fbb('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x91e29f[_0x4fbb('0x12')]){throw new Error(_0x4fbb('0x26'));}if(_0x2aec34[_0x4fbb('0x22')]===_0x340523['id']){return _0x340523;}else{return db[_0x4fbb('0x27')]['findOne']({'where':{'id':_settings[_0x4fbb('0x22')]}});}})[_0x4fbb('0xf')](function(_0x4f112c){if(!_0x4f112c){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x28'));}if(!_0x4f112c[_0x4fbb('0xd')]||!_0x4f112c['data2']){throw new db[(_0x4fbb('0x29'))]['ValidationError'](_0x4fbb('0x2a'));}_0x486020=_0x4f112c;logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')](_0x4fbb('0x2b'),_0x3b94dc['id']));return sentiment(_0x486020['data1'],_0x486020[_0x4fbb('0x2c')],_0x2aec34['sentimentRegion'],_0x91e29f['fileText'],_0x2aec34[_0x4fbb('0x24')]);})['then'](function(_0x3c2be1){logger[_0x4fbb('0xa')](util['format'](_0x4fbb('0x2d'),_0x3b94dc['id']));return _0x3b94dc[_0x4fbb('0x1c')]({'sentiment':_0x3c2be1[_0x4fbb('0x2e')],'sPositive':_0x3c2be1[_0x4fbb('0x2f')][_0x4fbb('0x30')],'sNegative':_0x3c2be1[_0x4fbb('0x2f')][_0x4fbb('0x31')],'sMixed':_0x3c2be1[_0x4fbb('0x2f')][_0x4fbb('0x32')],'sNeutral':_0x3c2be1[_0x4fbb('0x2f')][_0x4fbb('0x33')]});})[_0x4fbb('0xf')](function(){logger['info'](util[_0x4fbb('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3b94dc['id']));_0x5f2a54();});case _0x4fbb('0x34'):return _0x3b94dc[_0x4fbb('0x1c')]({'transcribeStatus':'FAILED','failureReason':_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x35')]})[_0x4fbb('0xf')](function(){logger['info'](util['format'](_0x4fbb('0x1d'),_0x3b94dc['id']));_0x5f2a54();});default:logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')](_0x4fbb('0x36'),_0x3b94dc['id']));break;}}else{return BPromise[_0x4fbb('0x37')]()[_0x4fbb('0xf')](function(){if(!_0x3b94dc['tempSentiment']){throw new db[(_0x4fbb('0x29'))]['ValidationError'](_0x4fbb('0x20'));}if(!_0x2aec34['sentiment']||!_0x2aec34[_0x4fbb('0x22')]||!_0x2aec34[_0x4fbb('0x23')]||!_0x2aec34['language']||!_0x2aec34['bucket']){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x38'));}if(!_0x3b94dc[_0x4fbb('0x12')]){throw new Error(_0x4fbb('0x26'));}if(_0x2aec34[_0x4fbb('0x22')]===_0x340523['id']){return _0x340523;}else{return db[_0x4fbb('0x27')]['findOne']({'where':{'id':_settings[_0x4fbb('0x22')]}});}})[_0x4fbb('0xf')](function(_0x19ea9d){if(!_0x19ea9d){throw new db[(_0x4fbb('0x29'))][(_0x4fbb('0x1f'))](_0x4fbb('0x28'));}if(!_0x19ea9d[_0x4fbb('0xd')]||!_0x19ea9d[_0x4fbb('0x2c')]){throw new db[(_0x4fbb('0x29'))][(_0x4fbb('0x1f'))](_0x4fbb('0x2a'));}_0x486020=_0x19ea9d;logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3b94dc['id']));return sentiment(_0x486020[_0x4fbb('0xd')],_0x486020[_0x4fbb('0x2c')],_0x2aec34[_0x4fbb('0x23')],_0x3b94dc[_0x4fbb('0x12')],_0x2aec34[_0x4fbb('0x24')]);})[_0x4fbb('0xf')](function(_0x5bbd77){logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3b94dc['id']));return _0x3b94dc[_0x4fbb('0x1c')]({'sentiment':_0x5bbd77[_0x4fbb('0x2e')],'sPositive':_0x5bbd77['SentimentScore'][_0x4fbb('0x30')],'sNegative':_0x5bbd77[_0x4fbb('0x2f')]['Negative'],'sMixed':_0x5bbd77[_0x4fbb('0x2f')][_0x4fbb('0x32')],'sNeutral':_0x5bbd77[_0x4fbb('0x2f')][_0x4fbb('0x33')],'transcribeStatus':_0x4fbb('0x13')});})[_0x4fbb('0xf')](function(){logger['info'](util['format'](_0x4fbb('0x1d'),_0x3b94dc['id']));_0x5f2a54();});}})['catch'](function(_0x574d10){if(_0x574d10){if(!_0x574d10[_0x4fbb('0x39')]||_0x574d10[_0x4fbb('0x39')]!=='SequelizeValidationError'){logger[_0x4fbb('0x3a')](util[_0x4fbb('0xb')](_0x4fbb('0x3b'),_0x3b94dc['id']),util[_0x4fbb('0x3c')](_0x574d10,{'showHidden':![],'depth':null}));}}_0x5f2a54();});});}function checkTranscribe(){var _0x38c149;var _0x143883;var _0x1b736d;return db[_0x4fbb('0x3d')]['findAll']({'where':{'transcribeStatus':_0x4fbb('0x3e')}})[_0x4fbb('0xf')](function(_0x12d624){if(!_0x12d624||!_0x12d624[_0x4fbb('0x1a')]){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x3f'));}_0x38c149=_0x12d624;return db[_0x4fbb('0x40')]['findOne']({'where':{'id':0x1}});})[_0x4fbb('0xf')](function(_0x236bea){if(!_0x236bea){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x41'));}_0x143883=_0x236bea;if(!_0x143883[_0x4fbb('0x7')]||!_0x143883[_0x4fbb('0x42')]||!_0x143883[_0x4fbb('0x43')]||!_0x143883[_0x4fbb('0x24')]||!_0x143883['bucket']){throw new db[(_0x4fbb('0x29'))]['ValidationError'](_0x4fbb('0x44'));}return db[_0x4fbb('0x27')]['findOne']({'where':{'id':_0x143883[_0x4fbb('0x42')]}});})[_0x4fbb('0xf')](function(_0x2030b5){if(!_0x2030b5){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x28'));}if(!_0x2030b5['data1']||!_0x2030b5[_0x4fbb('0x2c')]){throw new db[(_0x4fbb('0x29'))]['ValidationError'](_0x4fbb('0x2a'));}_0x1b736d=_0x2030b5;var _0x588f86=[];_0x38c149[_0x4fbb('0x45')](function(_0x12e00f){_0x588f86[_0x4fbb('0x46')](checkTranscribeJob(_0x12e00f,_0x143883,_0x1b736d));});return BPromise[_0x4fbb('0x47')](_0x588f86);})['catch'](function(_0x5a655c){if(_0x5a655c){if(!_0x5a655c['name']||_0x5a655c['name']!==_0x4fbb('0x48')){logger['error'](util['inspect'](_0x5a655c,{'showHidden':![],'depth':null}));}}});}exports[_0x4fbb('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index b85700e..77b2d8b 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6730=['join','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','util','../../config/environment','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x6730,0x1e3));var _0x0673=function(_0x4d189e,_0x2c0a04){_0x4d189e=_0x4d189e-0x0;var _0x1b36df=_0x6730[_0x4d189e];return _0x1b36df;};'use strict';var _=require(_0x0673('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x0673('0x1'));var config=require(_0x0673('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config[_0x0673('0x3')]=_[_0x0673('0x4')](config['redis'],{'host':_0x0673('0x5'),'port':0x18eb});var io=require(_0x0673('0x6'))(new Redis(config[_0x0673('0x3')]));function closeInteractions(){var _0x2e9354=[];return db[_0x0673('0x7')][_0x0673('0x8')]({'raw':!![],'attributes':['id',_0x0673('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0673('0xa')](0x18,'hours')}}})[_0x0673('0xb')](function(_0x3296e0){if(_0x3296e0&&_0x3296e0[_0x0673('0xc')]){_0x2e9354=_['map'](_0x3296e0||[],'id');logger[_0x0673('0xd')](_0x0673('0xe'),_0x2e9354['join']());return db[_0x0673('0x7')][_0x0673('0xf')]({'closeReason':_0x0673('0x10'),'disposition':_0x0673('0x11'),'closed':!![],'closedAt':moment()[_0x0673('0x12')](_0x0673('0x13'))},{'where':{'id':_0x2e9354}});}})['then'](function(){if(_0x2e9354&&_0x2e9354['length']){logger[_0x0673('0xd')](_0x0673('0x14'),_0x2e9354[_0x0673('0x15')]());for(var _0x439394=0x0;_0x439394<_0x2e9354[_0x0673('0xc')];_0x439394++){io[_0x0673('0x16')](_0x0673('0x17'),{'id':_0x2e9354[_0x439394],'closed':!![]});}}})[_0x0673('0x18')](function(_0x3ce0eb){logger[_0x0673('0x19')](_0x0673('0x1a'),_0x3ce0eb?util['inspect'](_0x3ce0eb,{'showHidden':![],'depth':null}):'');});}exports[_0x0673('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x32f3=['[WHATSAPP]\x20Error\x20closing\x20interactions','start','moment','ioredis','util','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error'];(function(_0x3f0685,_0x4edd55){var _0x3fdfdd=function(_0x7b9bd9){while(--_0x7b9bd9){_0x3f0685['push'](_0x3f0685['shift']());}};_0x3fdfdd(++_0x4edd55);}(_0x32f3,0xd4));var _0x332f=function(_0x461bbb,_0x45dd5b){_0x461bbb=_0x461bbb-0x0;var _0x3d97b2=_0x32f3[_0x461bbb];return _0x3d97b2;};'use strict';var _=require('lodash');var moment=require(_0x332f('0x0'));var Redis=require(_0x332f('0x1'));var util=require(_0x332f('0x2'));var config=require('../../config/environment');var db=require(_0x332f('0x3'))['db'];var logger=require(_0x332f('0x4'))(_0x332f('0x5'));config['redis']=_[_0x332f('0x6')](config[_0x332f('0x7')],{'host':_0x332f('0x8'),'port':0x18eb});var io=require(_0x332f('0x9'))(new Redis(config[_0x332f('0x7')]));function closeInteractions(){var _0x2f3c2c=[];return db[_0x332f('0xa')][_0x332f('0xb')]({'raw':!![],'attributes':['id',_0x332f('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x332f('0xd')](0x18,_0x332f('0xe'))}}})['then'](function(_0x38dd4e){if(_0x38dd4e&&_0x38dd4e[_0x332f('0xf')]){_0x2f3c2c=_['map'](_0x38dd4e||[],'id');logger[_0x332f('0x10')](_0x332f('0x11'),_0x2f3c2c['join']());return db[_0x332f('0xa')][_0x332f('0x12')]({'closeReason':_0x332f('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x332f('0x14')](_0x332f('0x15'))},{'where':{'id':_0x2f3c2c}});}})[_0x332f('0x16')](function(){if(_0x2f3c2c&&_0x2f3c2c[_0x332f('0xf')]){logger[_0x332f('0x10')](_0x332f('0x17'),_0x2f3c2c['join']());for(var _0x1fd935=0x0;_0x1fd935<_0x2f3c2c[_0x332f('0xf')];_0x1fd935++){io[_0x332f('0x18')](_0x332f('0x19'),{'id':_0x2f3c2c[_0x1fd935],'closed':!![]});}}})[_0x332f('0x1a')](function(_0x4953e8){logger[_0x332f('0x1b')](_0x332f('0x1c'),_0x4953e8?util['inspect'](_0x4953e8,{'showHidden':![],'depth':null}):'');});}exports[_0x332f('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 314a1a0..f8c6603 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b44=['finished\x20populating','CmHopper','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','bulkCreate','log'];(function(_0x32d414,_0x4d23da){var _0x4e0bca=function(_0x15d397){while(--_0x15d397){_0x32d414['push'](_0x32d414['shift']());}};_0x4e0bca(++_0x4d23da);}(_0x7b44,0xf3));var _0x47b4=function(_0x35a07c,_0x4a83a3){_0x35a07c=_0x35a07c-0x0;var _0x5502a9=_0x7b44[_0x35a07c];return _0x5502a9;};'use strict';var util=require(_0x47b4('0x0'));var db=require(_0x47b4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x47b4('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x47b4('0x3')+i,'phone':0xf879fb460+i,'email':_0x47b4('0x4')+i+_0x47b4('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x47b4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x47b4('0x6')](),'updatedAt':Date[_0x47b4('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x47b4('0x2')]({'id':i,'firstName':_0x47b4('0x7')+i,'lastName':_0x47b4('0x3')+i,'phone':0xf879fb460+i,'email':_0x47b4('0x4')+i+_0x47b4('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x47b4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x47b4('0x6')](),'updatedAt':Date[_0x47b4('0x6')]()});}db[_0x47b4('0x8')][_0x47b4('0x9')]({'where':{}})[_0x47b4('0xa')](function(){return db[_0x47b4('0x8')][_0x47b4('0xb')](contacts);})['then'](function(){console[_0x47b4('0xc')](_0x47b4('0xd'),'contacts1');return db[_0x47b4('0xe')]['destroy']({'where':{}});})['then'](function(){return db[_0x47b4('0xe')]['bulkCreate'](hopper);})[_0x47b4('0xa')](function(){console['log']('finished\x20populating','hopper1');return db[_0x47b4('0x8')][_0x47b4('0xb')](contacts2);})[_0x47b4('0xa')](function(){console['log'](_0x47b4('0xd'),'contacts2');return db['CmHopper'][_0x47b4('0xb')](hopper2);})['then'](function(){console['log'](_0x47b4('0xd'),'hopper2');})[_0x47b4('0xf')](function(_0x47a523){console[_0x47b4('0xc')](_0x47a523);}); \ No newline at end of file +var _0x21d6=['innocenzo.biondo','CmContact','destroy','then','finished\x20populating','contacts1','bulkCreate','log','hopper1','contacts2','CmHopper','catch','util','push','Innocenzo','Biondo','@xcally.com','now'];(function(_0x433d9d,_0xb36042){var _0xa3ecc7=function(_0x429740){while(--_0x429740){_0x433d9d['push'](_0x433d9d['shift']());}};_0xa3ecc7(++_0xb36042);}(_0x21d6,0x8a));var _0x621d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x21d6[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x621d('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x621d('0x1')]({'id':i,'firstName':_0x621d('0x2')+i,'lastName':_0x621d('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x621d('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x621d('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x621d('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x621d('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x621d('0x3')+i,'phone':0xf879fb460+i,'email':_0x621d('0x6')+i+_0x621d('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x621d('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x621d('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x621d('0x5')](),'updatedAt':Date[_0x621d('0x5')]()});}db[_0x621d('0x7')][_0x621d('0x8')]({'where':{}})[_0x621d('0x9')](function(){return db[_0x621d('0x7')]['bulkCreate'](contacts);})[_0x621d('0x9')](function(){console['log'](_0x621d('0xa'),_0x621d('0xb'));return db['CmHopper']['destroy']({'where':{}});})[_0x621d('0x9')](function(){return db['CmHopper'][_0x621d('0xc')](hopper);})['then'](function(){console[_0x621d('0xd')](_0x621d('0xa'),_0x621d('0xe'));return db[_0x621d('0x7')][_0x621d('0xc')](contacts2);})[_0x621d('0x9')](function(){console[_0x621d('0xd')]('finished\x20populating',_0x621d('0xf'));return db[_0x621d('0x10')][_0x621d('0xc')](hopper2);})[_0x621d('0x9')](function(){console[_0x621d('0xd')](_0x621d('0xa'),'hopper2');})[_0x621d('0x11')](function(_0x505100){console[_0x621d('0xd')](_0x505100);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 8bbe067..ffdeffb 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd90f=['agent','format','%s%s@xcally.com','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','util','../mysqldb','push','%s%s'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xd90f,0x1f0));var _0xfd90=function(_0x33ad6b,_0x16b536){_0x33ad6b=_0x33ad6b-0x0;var _0x585d6e=_0xd90f[_0x33ad6b];return _0x585d6e;};'use strict';var util=require(_0xfd90('0x0'));var db=require(_0xfd90('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xfd90('0x2')]({'name':util['format'](_0xfd90('0x3'),_0xfd90('0x4'),i),'fullname':util[_0xfd90('0x5')]('%s%s',_0xfd90('0x4'),i),'email':util[_0xfd90('0x5')](_0xfd90('0x6'),_0xfd90('0x4'),i),'role':_0xfd90('0x4'),'password':'password','internal':0xfa0+i,'type':_0xfd90('0x7'),'transport':[_0xfd90('0x8'),'ws',_0xfd90('0x9')],'disallow':[_0xfd90('0xa')],'allow':[_0xfd90('0xb')],'defaultuser':util[_0xfd90('0x5')]('%s%s',_0xfd90('0x4'),i),'encryption':_0xfd90('0xc'),'avpf':_0xfd90('0xc'),'force_avp':'yes','icesupport':_0xfd90('0xc'),'dtlsenable':_0xfd90('0xc'),'dtlsverify':'no','dtlscertfile':_0xfd90('0xd'),'dtlsprivatekey':_0xfd90('0xe'),'dtlssetup':'actpass','callerid':util[_0xfd90('0x5')](_0xfd90('0xf'),util[_0xfd90('0x5')]('%s%s',_0xfd90('0x4'),i),0xfa0+i)});}db['User'][_0xfd90('0x10')](users)[_0xfd90('0x11')](function(){console[_0xfd90('0x12')](_0xfd90('0x13'));})['catch'](function(_0x3703ac){console[_0xfd90('0x12')](_0x3703ac);}); \ No newline at end of file +var _0x7f41=['/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','ulaw','yes'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x7f41,0x94));var _0x17f4=function(_0x1bb306,_0x306b38){_0x1bb306=_0x1bb306-0x0;var _0x498eca=_0x7f41[_0x1bb306];return _0x498eca;};'use strict';var util=require(_0x17f4('0x0'));var db=require(_0x17f4('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x17f4('0x2')]({'name':util[_0x17f4('0x3')](_0x17f4('0x4'),_0x17f4('0x5'),i),'fullname':util[_0x17f4('0x3')](_0x17f4('0x4'),_0x17f4('0x5'),i),'email':util[_0x17f4('0x3')](_0x17f4('0x6'),_0x17f4('0x5'),i),'role':_0x17f4('0x5'),'password':_0x17f4('0x7'),'internal':0xfa0+i,'type':_0x17f4('0x8'),'transport':[_0x17f4('0x9'),'ws','wss'],'disallow':['all'],'allow':[_0x17f4('0xa')],'defaultuser':util[_0x17f4('0x3')](_0x17f4('0x4'),_0x17f4('0x5'),i),'encryption':_0x17f4('0xb'),'avpf':'yes','force_avp':_0x17f4('0xb'),'icesupport':_0x17f4('0xb'),'dtlsenable':_0x17f4('0xb'),'dtlsverify':'no','dtlscertfile':_0x17f4('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x17f4('0xd'),'callerid':util[_0x17f4('0x3')](_0x17f4('0xe'),util[_0x17f4('0x3')](_0x17f4('0x4'),_0x17f4('0x5'),i),0xfa0+i)});}db[_0x17f4('0xf')][_0x17f4('0x10')](users)['then'](function(){console['log'](_0x17f4('0x11'));})[_0x17f4('0x12')](function(_0x58e6da){console[_0x17f4('0x13')](_0x58e6da);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 7bfe7ef..2254d94 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0447=['getWhatsappQueues','all','length','voice','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','setMaxListeners','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','map','where','Campaign','format','%s:queue:%s','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','include','push','FaxQueue','MailQueue','Trunk','user','voice:outbound','ChatQueues','ChatQueue','SmsQueues','SmsQueue','MailQueues','OpenchannelQueue','WhatsappQueue','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues'];(function(_0x4c531d,_0x2431df){var _0x45cd94=function(_0x1cb1ea){while(--_0x1cb1ea){_0x4c531d['push'](_0x4c531d['shift']());}};_0x45cd94(++_0x2431df);}(_0x0447,0x8b));var _0x7044=function(_0x207438,_0x267449){_0x207438=_0x207438-0x0;var _0x405ae6=_0x0447[_0x207438];return _0x405ae6;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var BPromise=require(_0x7044('0x2'));var db=require(_0x7044('0x3'))['db'];var config=require(_0x7044('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x7044('0x5'),'model':db[_0x7044('0x6')],'attributes':['id',_0x7044('0x7'),_0x7044('0x8')],'raw':!![],'where':{'role':_0x7044('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7044('0x7')],'where':{'role':_0x7044('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7044('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x7044('0x7')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7044('0x7'),_0x7044('0xb')],'where':{'type':_0x7044('0xc')}};function getAssociatedResources(_0x42aa4,_0x4ee462,_0x41616d){return db[_0x7044('0xd')]['findOne']({'where':{'name':_0x42aa4,'userProfileId':_0x4ee462},'raw':!![]})[_0x7044('0xe')](function(_0xf38837){if(_0xf38837){if(_0xf38837[_0x7044('0xf')]){switch(_0x42aa4){case _0x7044('0x10'):case'ChatQueues':case _0x7044('0x11'):case'SmsQueues':case'MailQueues':case'OpenchannelQueues':case _0x7044('0x12'):return db[_0x41616d][_0x7044('0x13')](queryQueues);case _0x7044('0x14'):return db[_0x41616d][_0x7044('0x13')](queryTelephones);case'Trunks':return db[_0x41616d]['findAll'](queryTrunks);case _0x7044('0x15'):return db[_0x41616d][_0x7044('0x13')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0x7044('0x16')],'where':{'sectionId':_0xf38837['id']},'raw':!![]})[_0x7044('0xe')](function(_0x79f418){if(_0x79f418){var _0x35769e={'where':{'id':_[_0x7044('0x17')](_0x79f418,_0x7044('0x16'))},'raw':!![]};switch(_0x41616d){case'User':_0x35769e[_0x7044('0x18')][_0x7044('0x8')]=_0x7044('0xa');break;case _0x7044('0x19'):_0x35769e[_0x7044('0x18')][_0x7044('0xb')]='ivr';break;}return db[_0x41616d][_0x7044('0x13')](_0x35769e);}else{return[];}});}}else{return[];}})[_0x7044('0xe')](function(_0x1eeb45){return _0x1eeb45;});}function joinOrLeaveQueues(_0x4e7285,_0x4bbdb3,_0x543be8,_0xced6e4){_0x4e7285[_0x4bbdb3](util[_0x7044('0x1a')](_0x7044('0x1b'),_0x543be8,_0xced6e4[_0x7044('0x7')]));if(_0xced6e4[_0x7044('0x5')]){for(var _0x4faffe=0x0;_0x4faffe<_0xced6e4[_0x7044('0x5')]['length'];_0x4faffe+=0x1){_0x4e7285[_0x4bbdb3](util['format'](_0x7044('0x1c'),_0xced6e4[_0x7044('0x5')][_0x4faffe][_0x7044('0x7')]));}}}function joinOrLeave(_0x294915,_0x39d85e,_0x105da8){var _0x41a079;if(_0x294915[_0x7044('0x1d')][_0x7044('0x1e')]['id']){db['User']['find']({'attributes':['id',_0x7044('0x7'),_0x7044('0x8'),_0x7044('0x1f')],'where':{'id':_0x294915[_0x7044('0x1d')][_0x7044('0x1e')]['id']},'include':[{'model':db[_0x7044('0x20')],'as':_0x7044('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x7044('0x22')],'as':_0x7044('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x7044('0x24')],'as':_0x7044('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x7044('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7044('0x27')],'as':_0x7044('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x7044('0x29')],'as':_0x7044('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x2261af){if(_0x2261af){_0x41a079=_0x2261af;_0x294915[_0x39d85e](util['format']('user:%s',_0x2261af['name']));var _0x29501a=[];switch(_0x2261af['role']){case _0x7044('0x2b'):_0x294915[_0x39d85e](_0x7044('0x2c'));_0x294915[_0x39d85e]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x7044('0x2d'))){delete queryQueues['include'];}_0x29501a['push'](db['VoiceQueue'][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db['ChatQueue'][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db[_0x7044('0x2f')][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db['SmsQueue'][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db[_0x7044('0x30')][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db['OpenchannelQueue'][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db['WhatsappQueue'][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db[_0x7044('0x6')][_0x7044('0x13')](queryTelephones));_0x29501a[_0x7044('0x2e')](db[_0x7044('0x31')]['findAll'](queryTrunks));_0x29501a['push'](db[_0x7044('0x19')][_0x7044('0x13')](queryCampaigns));_0x29501a['push'](db[_0x7044('0x6')][_0x7044('0x13')](queryAgents));break;case _0x7044('0x32'):_0x294915[_0x39d85e](_0x7044('0x2c'));_0x294915[_0x39d85e](_0x7044('0x33'));_0x29501a[_0x7044('0x2e')](getAssociatedResources(_0x7044('0x10'),_0x2261af[_0x7044('0x1f')],'VoiceQueue'));_0x29501a['push'](getAssociatedResources(_0x7044('0x34'),_0x2261af[_0x7044('0x1f')],_0x7044('0x35')));_0x29501a[_0x7044('0x2e')](getAssociatedResources(_0x7044('0x11'),_0x2261af[_0x7044('0x1f')],_0x7044('0x2f')));_0x29501a['push'](getAssociatedResources(_0x7044('0x36'),_0x2261af[_0x7044('0x1f')],_0x7044('0x37')));_0x29501a['push'](getAssociatedResources(_0x7044('0x38'),_0x2261af['userProfileId'],'MailQueue'));_0x29501a[_0x7044('0x2e')](getAssociatedResources('OpenchannelQueues',_0x2261af[_0x7044('0x1f')],_0x7044('0x39')));_0x29501a[_0x7044('0x2e')](getAssociatedResources(_0x7044('0x12'),_0x2261af[_0x7044('0x1f')],_0x7044('0x3a')));_0x29501a[_0x7044('0x2e')](getAssociatedResources(_0x7044('0x14'),_0x2261af[_0x7044('0x1f')],_0x7044('0x6')));_0x29501a['push'](getAssociatedResources('Trunks',_0x2261af['userProfileId'],_0x7044('0x31')));_0x29501a[_0x7044('0x2e')](getAssociatedResources(_0x7044('0x15'),_0x2261af[_0x7044('0x1f')],'Campaign'));_0x29501a['push'](db['User'][_0x7044('0x13')](queryAgents));break;case _0x7044('0x9'):_0x294915[_0x39d85e](_0x7044('0x2c'));_0x294915[_0x39d85e](_0x7044('0x33'));_0x29501a[_0x7044('0x2e')](_0x2261af[_0x7044('0x3b')]({'attributes':['id',_0x7044('0x7')]}));_0x29501a[_0x7044('0x2e')](_0x2261af[_0x7044('0x3c')]({'attributes':['id','name']}));_0x29501a['push'](_0x2261af['getFaxQueues']({'attributes':['id',_0x7044('0x7')]}));_0x29501a[_0x7044('0x2e')](_0x2261af[_0x7044('0x3d')]({'attributes':['id',_0x7044('0x7')]}));_0x29501a[_0x7044('0x2e')](_0x2261af[_0x7044('0x3e')]({'attributes':['id',_0x7044('0x7')]}));_0x29501a['push'](_0x2261af['getOpenchannelQueues']({'attributes':['id',_0x7044('0x7')]}));_0x29501a[_0x7044('0x2e')](_0x2261af[_0x7044('0x3f')]({'attributes':['id',_0x7044('0x7')]}));break;}return BPromise[_0x7044('0x40')](_0x29501a);}})[_0x7044('0xe')](function(_0x4e4d17){if(_0x4e4d17&&_0x4e4d17['length']){for(var _0x52514c=0x0;_0x52514c<_0x4e4d17[_0x7044('0x41')];_0x52514c+=0x1){for(var _0x45e1da=0x0;_0x45e1da<_0x4e4d17[_0x52514c][_0x7044('0x41')];_0x45e1da+=0x1){switch(_0x52514c){case 0x0:joinOrLeaveQueues(_0x294915,_0x39d85e,_0x7044('0x42'),_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x1:joinOrLeaveQueues(_0x294915,_0x39d85e,'chat',_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x2:joinOrLeaveQueues(_0x294915,_0x39d85e,_0x7044('0x43'),_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x3:joinOrLeaveQueues(_0x294915,_0x39d85e,_0x7044('0x44'),_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x4:joinOrLeaveQueues(_0x294915,_0x39d85e,_0x7044('0x45'),_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x5:joinOrLeaveQueues(_0x294915,_0x39d85e,'openchannel',_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x6:joinOrLeaveQueues(_0x294915,_0x39d85e,_0x7044('0x46'),_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x7:if(_0x41a079[_0x7044('0x8')]!==_0x7044('0x9'))_0x294915[_0x39d85e](util['format'](_0x7044('0x47'),_0x4e4d17[_0x52514c][_0x45e1da][_0x7044('0x7')]));break;case 0x8:if(_0x41a079[_0x7044('0x8')]!==_0x7044('0x9'))_0x294915[_0x39d85e](util['format'](_0x7044('0x48'),_0x4e4d17[_0x52514c][_0x45e1da][_0x7044('0x7')]));break;case 0x9:if(_0x41a079['role']!==_0x7044('0x9'))_0x294915[_0x39d85e](util[_0x7044('0x1a')](_0x7044('0x49'),_0x4e4d17[_0x52514c][_0x45e1da][_0x7044('0xb')],_0x4e4d17[_0x52514c][_0x45e1da][_0x7044('0x7')]));break;case 0xa:_0x294915[_0x39d85e](util['format'](_0x7044('0x1c'),_0x4e4d17[_0x52514c][_0x45e1da][_0x7044('0x7')]));break;}}}}})['then'](function(){if(_0x39d85e==='leave'){var _0x1e4b69=_[_0x7044('0x17')](_0x41a079[_0x7044('0x21')],'id');return _0x41a079[_0x7044('0x4a')](_0x1e4b69)['then'](function(){for(var _0x1ae35d=0x0;_0x1ae35d<_0x1e4b69[_0x7044('0x41')];_0x1ae35d+=0x1){_0x105da8[_0x7044('0x4b')](_0x7044('0x4c'),{'ChatInteractionId':Number(_0x1e4b69[_0x1ae35d]),'UserId':Number(_0x41a079['id'])});}});}})[_0x7044('0xe')](function(){if(_0x39d85e===_0x7044('0x4d')){var _0x344f38=_[_0x7044('0x17')](_0x41a079[_0x7044('0x23')],'id');return _0x41a079[_0x7044('0x4e')](_0x344f38)[_0x7044('0xe')](function(){for(var _0xd0e940=0x0;_0xd0e940<_0x344f38[_0x7044('0x41')];_0xd0e940+=0x1){_0x105da8[_0x7044('0x4b')](_0x7044('0x4f'),{'MailInteractionId':Number(_0x344f38[_0xd0e940]),'UserId':Number(_0x41a079['id'])});}});}})['then'](function(){if(_0x39d85e==='leave'){var _0x4dbd9c=_[_0x7044('0x17')](_0x41a079[_0x7044('0x25')],'id');return _0x41a079[_0x7044('0x50')](_0x4dbd9c)[_0x7044('0xe')](function(){for(var _0x11d41f=0x0;_0x11d41f<_0x4dbd9c[_0x7044('0x41')];_0x11d41f+=0x1){_0x105da8['emit'](_0x7044('0x51'),{'FaxInteractionId':Number(_0x4dbd9c[_0x11d41f]),'UserId':Number(_0x41a079['id'])});}});}})['then'](function(){if(_0x39d85e===_0x7044('0x4d')){var _0x394534=_[_0x7044('0x17')](_0x41a079[_0x7044('0x52')],'id');return _0x41a079[_0x7044('0x53')](_0x394534)[_0x7044('0xe')](function(){for(var _0x505d42=0x0;_0x505d42<_0x394534['length'];_0x505d42+=0x1){_0x105da8[_0x7044('0x4b')](_0x7044('0x54'),{'SmsInteractionId':Number(_0x394534[_0x505d42]),'UserId':Number(_0x41a079['id'])});}});}})[_0x7044('0xe')](function(){if(_0x39d85e===_0x7044('0x4d')){var _0x1346a0=_[_0x7044('0x17')](_0x41a079[_0x7044('0x28')],'id');return _0x41a079['removeOpenchannelInteractions'](_0x1346a0)[_0x7044('0xe')](function(){for(var _0x45f689=0x0;_0x45f689<_0x1346a0['length'];_0x45f689+=0x1){_0x105da8[_0x7044('0x4b')](_0x7044('0x55'),{'OpenchannelInteractionId':Number(_0x1346a0[_0x45f689]),'UserId':Number(_0x41a079['id'])});}});}})[_0x7044('0xe')](function(){if(_0x39d85e===_0x7044('0x4d')){var _0x1dc5f9=_['map'](_0x41a079['WhatsappInteractions'],'id');return _0x41a079[_0x7044('0x56')](_0x1dc5f9)[_0x7044('0xe')](function(){for(var _0x5b076e=0x0;_0x5b076e<_0x1dc5f9[_0x7044('0x41')];_0x5b076e+=0x1){_0x105da8[_0x7044('0x4b')](_0x7044('0x57'),{'WhatsappInteractionId':Number(_0x1dc5f9[_0x5b076e]),'UserId':Number(_0x41a079['id'])});}});}})[_0x7044('0x58')](function(_0x42d8c0){_0x294915[_0x7044('0x59')](_0x42d8c0);});}}function onDisconnect(_0x5e3fa4,_0x46b13d){joinOrLeave(_0x5e3fa4,_0x7044('0x4d'),_0x46b13d);}function onConnect(_0x20e207){joinOrLeave(_0x20e207,_0x7044('0x5a'));}exports['default']=function(_0x37485b){_0x37485b['on']('connection',function(_0x304bdd){_0x304bdd[_0x7044('0x5b')](0x0);_0x304bdd['address']=_0x304bdd[_0x7044('0x5c')][_0x7044('0x5d')][_0x7044('0x5e')]+':'+_0x304bdd[_0x7044('0x5c')][_0x7044('0x5d')][_0x7044('0x5f')];_0x304bdd[_0x7044('0x60')]=new Date();_0x304bdd[_0x7044('0x59')]=function(_0x471859){console[_0x7044('0x59')](_0x7044('0x61')+_0x304bdd[_0x7044('0x62')][_0x7044('0x7')]+'['+_0x304bdd[_0x7044('0x63')]+']',_0x471859);};_0x304bdd['on'](_0x7044('0x64'),function(){onDisconnect(_0x304bdd,_0x37485b);_0x304bdd['log']('DISCONNECTED');});onConnect(_0x304bdd);_0x304bdd[_0x7044('0x59')]('CONNECTED');});}; \ No newline at end of file +var _0x50e5=['telephone','type','findOne','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','IvrCampaigns','UserProfileResource','then','where','format','%s:queue:%s','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','ChatQueues','ChatQueue','MailQueue','WhatsappQueues','Telephones','Trunks','getFaxQueues','getSmsQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','map','user_has_mail_interactions:remove','FaxInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','request','remoteAddress','remotePort','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','User','role','agent'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x50e5,0xb7));var _0x550e=function(_0x330816,_0x41cff3){_0x330816=_0x330816-0x0;var _0x2068b8=_0x50e5[_0x330816];return _0x2068b8;};'use strict';var _=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var BPromise=require('bluebird');var db=require(_0x550e('0x2'))['db'];var config=require(_0x550e('0x3'));var queryQueues={'attributes':['id',_0x550e('0x4')],'include':[{'as':_0x550e('0x5'),'model':db[_0x550e('0x6')],'attributes':['id',_0x550e('0x4'),_0x550e('0x7')],'raw':!![],'where':{'role':_0x550e('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x550e('0x4')],'where':{'role':_0x550e('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x550e('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x550e('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x550e('0x4'),_0x550e('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0xebedae,_0x3b7f0b,_0x1390a4){return db['UserProfileSection'][_0x550e('0xb')]({'where':{'name':_0xebedae,'userProfileId':_0x3b7f0b},'raw':!![]})['then'](function(_0x59c6c9){if(_0x59c6c9){if(_0x59c6c9[_0x550e('0xc')]){switch(_0xebedae){case _0x550e('0xd'):case'ChatQueues':case _0x550e('0xe'):case _0x550e('0xf'):case _0x550e('0x10'):case _0x550e('0x11'):case'WhatsappQueues':return db[_0x1390a4][_0x550e('0x12')](queryQueues);case'Telephones':return db[_0x1390a4][_0x550e('0x12')](queryTelephones);case'Trunks':return db[_0x1390a4][_0x550e('0x12')](queryTrunks);case _0x550e('0x13'):return db[_0x1390a4][_0x550e('0x12')](queryCampaigns);}}else{return db[_0x550e('0x14')][_0x550e('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0x59c6c9['id']},'raw':!![]})[_0x550e('0x15')](function(_0x49787c){if(_0x49787c){var _0xf28ba7={'where':{'id':_['map'](_0x49787c,'resourceId')},'raw':!![]};switch(_0x1390a4){case _0x550e('0x6'):_0xf28ba7[_0x550e('0x16')]['role']='telephone';break;case'Campaign':_0xf28ba7[_0x550e('0x16')]['type']='ivr';break;}return db[_0x1390a4][_0x550e('0x12')](_0xf28ba7);}else{return[];}});}}else{return[];}})[_0x550e('0x15')](function(_0x6c7178){return _0x6c7178;});}function joinOrLeaveQueues(_0x846ad,_0x1ff0e9,_0x29f2db,_0x3b4dca){_0x846ad[_0x1ff0e9](util[_0x550e('0x17')](_0x550e('0x18'),_0x29f2db,_0x3b4dca['name']));if(_0x3b4dca[_0x550e('0x5')]){for(var _0x106c68=0x0;_0x106c68<_0x3b4dca['Agents']['length'];_0x106c68+=0x1){_0x846ad[_0x1ff0e9](util[_0x550e('0x17')](_0x550e('0x19'),_0x3b4dca['Agents'][_0x106c68][_0x550e('0x4')]));}}}function joinOrLeave(_0xcf3981,_0x1762c3,_0x317249){var _0x3aa1b8;if(_0xcf3981[_0x550e('0x1a')]['query']['id']){db[_0x550e('0x6')][_0x550e('0x1b')]({'attributes':['id',_0x550e('0x4'),_0x550e('0x7'),_0x550e('0x1c')],'where':{'id':_0xcf3981[_0x550e('0x1a')][_0x550e('0x1d')]['id']},'include':[{'model':db[_0x550e('0x1e')],'as':_0x550e('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x550e('0x20')],'as':_0x550e('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x550e('0x22')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x550e('0x23')],'as':_0x550e('0x24'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x550e('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x550e('0x26')],'as':_0x550e('0x27'),'attributes':['id'],'raw':!![]}]})[_0x550e('0x15')](function(_0x1a4caa){if(_0x1a4caa){_0x3aa1b8=_0x1a4caa;_0xcf3981[_0x1762c3](util[_0x550e('0x17')](_0x550e('0x19'),_0x1a4caa[_0x550e('0x4')]));var _0x209f30=[];switch(_0x1a4caa[_0x550e('0x7')]){case _0x550e('0x28'):_0xcf3981[_0x1762c3](_0x550e('0x29'));_0xcf3981[_0x1762c3](_0x550e('0x2a'));if(queryQueues[_0x550e('0x2b')]('include')){delete queryQueues[_0x550e('0x2c')];}_0x209f30[_0x550e('0x2d')](db['VoiceQueue'][_0x550e('0x12')](queryQueues));_0x209f30[_0x550e('0x2d')](db['ChatQueue'][_0x550e('0x12')](queryQueues));_0x209f30[_0x550e('0x2d')](db[_0x550e('0x2e')][_0x550e('0x12')](queryQueues));_0x209f30[_0x550e('0x2d')](db[_0x550e('0x2f')][_0x550e('0x12')](queryQueues));_0x209f30[_0x550e('0x2d')](db['MailQueue'][_0x550e('0x12')](queryQueues));_0x209f30['push'](db[_0x550e('0x30')][_0x550e('0x12')](queryQueues));_0x209f30['push'](db[_0x550e('0x31')][_0x550e('0x12')](queryQueues));_0x209f30['push'](db['User']['findAll'](queryTelephones));_0x209f30['push'](db[_0x550e('0x32')][_0x550e('0x12')](queryTrunks));_0x209f30[_0x550e('0x2d')](db['Campaign']['findAll'](queryCampaigns));_0x209f30['push'](db[_0x550e('0x6')][_0x550e('0x12')](queryAgents));break;case'user':_0xcf3981[_0x1762c3]('voice:inbound');_0xcf3981[_0x1762c3]('voice:outbound');_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0xd'),_0x1a4caa[_0x550e('0x1c')],'VoiceQueue'));_0x209f30['push'](getAssociatedResources(_0x550e('0x33'),_0x1a4caa[_0x550e('0x1c')],_0x550e('0x34')));_0x209f30[_0x550e('0x2d')](getAssociatedResources('FaxQueues',_0x1a4caa[_0x550e('0x1c')],_0x550e('0x2e')));_0x209f30['push'](getAssociatedResources('SmsQueues',_0x1a4caa[_0x550e('0x1c')],_0x550e('0x2f')));_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0x10'),_0x1a4caa['userProfileId'],_0x550e('0x35')));_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0x11'),_0x1a4caa[_0x550e('0x1c')],'OpenchannelQueue'));_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0x36'),_0x1a4caa[_0x550e('0x1c')],_0x550e('0x31')));_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0x37'),_0x1a4caa['userProfileId'],_0x550e('0x6')));_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0x38'),_0x1a4caa[_0x550e('0x1c')],_0x550e('0x32')));_0x209f30['push'](getAssociatedResources(_0x550e('0x13'),_0x1a4caa[_0x550e('0x1c')],'Campaign'));_0x209f30[_0x550e('0x2d')](db[_0x550e('0x6')][_0x550e('0x12')](queryAgents));break;case'agent':_0xcf3981[_0x1762c3]('voice:inbound');_0xcf3981[_0x1762c3](_0x550e('0x2a'));_0x209f30[_0x550e('0x2d')](_0x1a4caa['getVoiceQueues']({'attributes':['id',_0x550e('0x4')]}));_0x209f30[_0x550e('0x2d')](_0x1a4caa['getChatQueues']({'attributes':['id',_0x550e('0x4')]}));_0x209f30[_0x550e('0x2d')](_0x1a4caa[_0x550e('0x39')]({'attributes':['id',_0x550e('0x4')]}));_0x209f30[_0x550e('0x2d')](_0x1a4caa[_0x550e('0x3a')]({'attributes':['id','name']}));_0x209f30[_0x550e('0x2d')](_0x1a4caa['getMailQueues']({'attributes':['id',_0x550e('0x4')]}));_0x209f30[_0x550e('0x2d')](_0x1a4caa['getOpenchannelQueues']({'attributes':['id',_0x550e('0x4')]}));_0x209f30[_0x550e('0x2d')](_0x1a4caa[_0x550e('0x3b')]({'attributes':['id',_0x550e('0x4')]}));break;}return BPromise[_0x550e('0x3c')](_0x209f30);}})[_0x550e('0x15')](function(_0x5e4596){if(_0x5e4596&&_0x5e4596[_0x550e('0x3d')]){for(var _0x30f708=0x0;_0x30f708<_0x5e4596[_0x550e('0x3d')];_0x30f708+=0x1){for(var _0x444c23=0x0;_0x444c23<_0x5e4596[_0x30f708][_0x550e('0x3d')];_0x444c23+=0x1){switch(_0x30f708){case 0x0:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x3e'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x1:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x3f'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x2:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x40'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x3:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x41'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x4:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x42'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x5:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x43'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x6:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x44'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x7:if(_0x3aa1b8[_0x550e('0x7')]!==_0x550e('0x8'))_0xcf3981[_0x1762c3](util[_0x550e('0x17')](_0x550e('0x45'),_0x5e4596[_0x30f708][_0x444c23][_0x550e('0x4')]));break;case 0x8:if(_0x3aa1b8[_0x550e('0x7')]!==_0x550e('0x8'))_0xcf3981[_0x1762c3](util[_0x550e('0x17')](_0x550e('0x46'),_0x5e4596[_0x30f708][_0x444c23][_0x550e('0x4')]));break;case 0x9:if(_0x3aa1b8['role']!==_0x550e('0x8'))_0xcf3981[_0x1762c3](util[_0x550e('0x17')](_0x550e('0x47'),_0x5e4596[_0x30f708][_0x444c23][_0x550e('0xa')],_0x5e4596[_0x30f708][_0x444c23][_0x550e('0x4')]));break;case 0xa:_0xcf3981[_0x1762c3](util[_0x550e('0x17')](_0x550e('0x19'),_0x5e4596[_0x30f708][_0x444c23]['name']));break;}}}}})[_0x550e('0x15')](function(){if(_0x1762c3===_0x550e('0x48')){var _0x23486f=_['map'](_0x3aa1b8['ChatInteractions'],'id');return _0x3aa1b8['removeChatInteractions'](_0x23486f)[_0x550e('0x15')](function(){for(var _0xed33ee=0x0;_0xed33ee<_0x23486f[_0x550e('0x3d')];_0xed33ee+=0x1){_0x317249[_0x550e('0x49')](_0x550e('0x4a'),{'ChatInteractionId':Number(_0x23486f[_0xed33ee]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x15')](function(){if(_0x1762c3==='leave'){var _0x7203cb=_[_0x550e('0x4b')](_0x3aa1b8[_0x550e('0x21')],'id');return _0x3aa1b8['removeMailInteractions'](_0x7203cb)[_0x550e('0x15')](function(){for(var _0x4ba38b=0x0;_0x4ba38b<_0x7203cb[_0x550e('0x3d')];_0x4ba38b+=0x1){_0x317249['emit'](_0x550e('0x4c'),{'MailInteractionId':Number(_0x7203cb[_0x4ba38b]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x15')](function(){if(_0x1762c3==='leave'){var _0x3740dd=_['map'](_0x3aa1b8[_0x550e('0x4d')],'id');return _0x3aa1b8['removeFaxInteractions'](_0x3740dd)[_0x550e('0x15')](function(){for(var _0x45b188=0x0;_0x45b188<_0x3740dd['length'];_0x45b188+=0x1){_0x317249[_0x550e('0x49')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3740dd[_0x45b188]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x15')](function(){if(_0x1762c3===_0x550e('0x48')){var _0x2c8734=_[_0x550e('0x4b')](_0x3aa1b8['SmsInteractions'],'id');return _0x3aa1b8['removeSmsInteractions'](_0x2c8734)[_0x550e('0x15')](function(){for(var _0x564b7d=0x0;_0x564b7d<_0x2c8734['length'];_0x564b7d+=0x1){_0x317249[_0x550e('0x49')](_0x550e('0x4e'),{'SmsInteractionId':Number(_0x2c8734[_0x564b7d]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x15')](function(){if(_0x1762c3===_0x550e('0x48')){var _0x46b54e=_[_0x550e('0x4b')](_0x3aa1b8['OpenchannelInteractions'],'id');return _0x3aa1b8[_0x550e('0x4f')](_0x46b54e)[_0x550e('0x15')](function(){for(var _0x17e969=0x0;_0x17e969<_0x46b54e[_0x550e('0x3d')];_0x17e969+=0x1){_0x317249[_0x550e('0x49')](_0x550e('0x50'),{'OpenchannelInteractionId':Number(_0x46b54e[_0x17e969]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x15')](function(){if(_0x1762c3===_0x550e('0x48')){var _0x27ddf5=_['map'](_0x3aa1b8[_0x550e('0x27')],'id');return _0x3aa1b8[_0x550e('0x51')](_0x27ddf5)[_0x550e('0x15')](function(){for(var _0x1ece5e=0x0;_0x1ece5e<_0x27ddf5[_0x550e('0x3d')];_0x1ece5e+=0x1){_0x317249[_0x550e('0x49')](_0x550e('0x52'),{'WhatsappInteractionId':Number(_0x27ddf5[_0x1ece5e]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x53')](function(_0x14b2c0){_0xcf3981[_0x550e('0x54')](_0x14b2c0);});}}function onDisconnect(_0x5094bb,_0x3b53b2){joinOrLeave(_0x5094bb,_0x550e('0x48'),_0x3b53b2);}function onConnect(_0x189904){joinOrLeave(_0x189904,_0x550e('0x55'));}exports[_0x550e('0x56')]=function(_0x2d5de5){_0x2d5de5['on'](_0x550e('0x57'),function(_0x4b710e){_0x4b710e['setMaxListeners'](0x0);_0x4b710e['address']=_0x4b710e[_0x550e('0x58')][_0x550e('0x57')][_0x550e('0x59')]+':'+_0x4b710e[_0x550e('0x58')][_0x550e('0x57')][_0x550e('0x5a')];_0x4b710e['connectedAt']=new Date();_0x4b710e[_0x550e('0x54')]=function(_0x3a0051){console['log']('SocketIO\x20'+_0x4b710e[_0x550e('0x5b')][_0x550e('0x4')]+'['+_0x4b710e[_0x550e('0x5c')]+']',_0x3a0051);};_0x4b710e['on'](_0x550e('0x5d'),function(){onDisconnect(_0x4b710e,_0x2d5de5);_0x4b710e[_0x550e('0x54')](_0x550e('0x5e'));});onConnect(_0x4b710e);_0x4b710e[_0x550e('0x54')](_0x550e('0x5f'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 99668f8..aa2f697 100644 --- a/server/config/triggers/index.js +++ b/server/config/triggers/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c5a=['default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','triggers','ChatInteraction','newinteraction','Chat','closedinteraction','ChatMessage','afterCreate','ChatOfflineMessage','newmessage','Sms','SmsInteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','Trigger,\x20%s','error','catch','get','channel','event','direction','resolve','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','undefined','interface','SIP/%s','name','agent','incomingmessage','AfterCreateMessage','motionChannel','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','format','AfterCreate','changed','substatus','closed','AfterUpdate','find','fullname','email','internal'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x4c5a,0x1b8));var _0xa4c5=function(_0x573c9e,_0xd4ab71){_0x573c9e=_0x573c9e-0x0;var _0x5d0714=_0x4c5a[_0x573c9e];return _0x5d0714;};'use strict';var util=require('util');var db=require(_0xa4c5('0x0'))['db'];var jayson=require(_0xa4c5('0x1'));var logger=require('../logger')(_0xa4c5('0x2'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xa4c5('0x3'),'event':'afterCreate','condition':_0xa4c5('0x4'),'callback':afterCreate},{'channel':_0xa4c5('0x5'),'model':_0xa4c5('0x3'),'event':'afterUpdate','condition':_0xa4c5('0x6'),'callback':afterUpdate},{'channel':_0xa4c5('0x5'),'model':_0xa4c5('0x7'),'event':_0xa4c5('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa4c5('0x5'),'model':_0xa4c5('0x9'),'event':_0xa4c5('0x8'),'condition':_0xa4c5('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0xa4c5('0xb'),'model':_0xa4c5('0xc'),'event':_0xa4c5('0x8'),'condition':_0xa4c5('0x4'),'callback':afterCreate},{'channel':_0xa4c5('0xb'),'model':_0xa4c5('0xc'),'event':_0xa4c5('0xd'),'condition':_0xa4c5('0x6'),'callback':afterUpdate},{'channel':_0xa4c5('0xb'),'model':_0xa4c5('0xe'),'event':_0xa4c5('0x8'),'condition':_0xa4c5('0xa'),'callback':afterCreateMessage},{'channel':_0xa4c5('0xf'),'model':_0xa4c5('0x10'),'event':_0xa4c5('0x8'),'condition':_0xa4c5('0x4'),'callback':afterCreate},{'channel':_0xa4c5('0xf'),'model':_0xa4c5('0x10'),'event':_0xa4c5('0xd'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa4c5('0xf'),'model':'WhatsappMessage','event':_0xa4c5('0x8'),'condition':_0xa4c5('0xa'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0xa4c5('0x8'),'condition':_0xa4c5('0x4'),'callback':afterCreate},{'channel':_0xa4c5('0x11'),'model':_0xa4c5('0x12'),'event':_0xa4c5('0xd'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa4c5('0x11'),'model':_0xa4c5('0x13'),'event':_0xa4c5('0x8'),'condition':_0xa4c5('0xa'),'callback':afterCreateMessage},{'channel':_0xa4c5('0x14'),'model':_0xa4c5('0x15'),'event':_0xa4c5('0x8'),'condition':_0xa4c5('0x4'),'callback':afterCreate},{'channel':_0xa4c5('0x14'),'model':_0xa4c5('0x15'),'event':'afterUpdate','condition':_0xa4c5('0x6'),'callback':afterUpdate},{'channel':'Mail','model':_0xa4c5('0x16'),'event':'afterCreate','condition':_0xa4c5('0xa'),'callback':afterCreateMessage},{'channel':_0xa4c5('0x17'),'model':'OpenchannelInteraction','event':_0xa4c5('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa4c5('0x17'),'model':_0xa4c5('0x18'),'event':_0xa4c5('0xd'),'condition':_0xa4c5('0x6'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xa4c5('0x19'),'event':_0xa4c5('0x8'),'condition':_0xa4c5('0xa'),'callback':afterCreateMessage}];function request(_0x2a4acf){return client['request'](_0xa4c5('0x1a'),_0x2a4acf)[_0xa4c5('0x1b')](function(_0x18ac78){logger['info'](_0xa4c5('0x1c'),_0xa4c5('0x1a'),_0x18ac78);if(_0x18ac78[_0xa4c5('0x1d')]){if(_0x18ac78[_0xa4c5('0x1d')]['code']===0x1f4){logger[_0xa4c5('0x1d')](_0xa4c5('0x1c'),_0xa4c5('0x1a'),_0x18ac78[_0xa4c5('0x1d')]);}}})[_0xa4c5('0x1e')](function(_0x940396){logger[_0xa4c5('0x1d')](_0xa4c5('0x1c'),'EventManager',_0x940396);});}function afterCreateMessage(_0x34724c){return function(_0x24cc70){_0x24cc70=_0x24cc70[_0xa4c5('0x1f')]({'plain':!![]});_0x24cc70[_0xa4c5('0x20')]=_0x34724c;_0x24cc70['motionChannel']=_0x34724c;_0x24cc70[_0xa4c5('0x21')]=_0x24cc70[_0xa4c5('0x22')];Promise[_0xa4c5('0x23')]()['then'](function(){if(typeof _0x24cc70[_0xa4c5('0x24')]==='undefined')return null;var _0x157139='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x24cc70[_0xa4c5('0x24')];return db[_0xa4c5('0x25')][_0xa4c5('0x26')](_0x157139,{'type':db[_0xa4c5('0x27')][_0xa4c5('0x28')][_0xa4c5('0x29')],'raw':!![]});})['then'](function(_0x129c8c){if(_0x129c8c){_0x24cc70[_0xa4c5('0x2a')]=_0x129c8c[0x0];}if(typeof _0x24cc70[_0xa4c5('0x2b')]===_0xa4c5('0x2c'))return;return getAgent(_0x24cc70[_0xa4c5('0x2b')]);})[_0xa4c5('0x1b')](function(_0x31c3d1){if(_0x31c3d1){_0x24cc70[_0xa4c5('0x2d')]=util['format'](_0xa4c5('0x2e'),_0x31c3d1[_0xa4c5('0x2f')]);_0x24cc70[_0xa4c5('0x30')]=_0x31c3d1;_0x24cc70['channel']=_0x34724c;return request({'event':_0xa4c5('0x31'),'message':_0x24cc70});}else{return request({'event':'outgoingmessage','message':_0x24cc70});}})['catch'](function(_0xdfdcef){logger[_0xa4c5('0x1d')]('Trigger,\x20%s',_0xa4c5('0x32'),_0xdfdcef);});};}function afterCreateOfflineMessage(_0x1af638){return function(_0x2356d0){_0x2356d0=_0x2356d0[_0xa4c5('0x1f')]({'plain':!![]});_0x2356d0['channel']=_0x1af638;_0x2356d0[_0xa4c5('0x33')]=_0x1af638;_0x2356d0['event']='offlineMessage';return request({'event':_0x2356d0[_0xa4c5('0x21')],'message':_0x2356d0});};}function afterCreate(_0xb81d12,_0x198286){return function(_0x123023){_0x123023=_0x123023[_0xa4c5('0x1f')]({'plain':!![]});_0x123023['channel']=_0xb81d12;_0x123023[_0xa4c5('0x33')]=_0xb81d12;_0x123023[_0xa4c5('0x21')]=_0xa4c5('0x34');Promise[_0xa4c5('0x23')]()['then'](function(){var _0x4aaa8c=_0xa4c5('0x35')+_0x123023['ContactId'];return db[_0xa4c5('0x25')][_0xa4c5('0x26')](_0x4aaa8c,{'type':db[_0xa4c5('0x27')]['QueryTypes'][_0xa4c5('0x29')],'raw':!![]});})[_0xa4c5('0x1b')](function(_0x177e8f){if(_0x177e8f){_0x123023[_0xa4c5('0x2a')]=_0x177e8f[0x0];}if(typeof _0x123023[_0xa4c5('0x2b')]===_0xa4c5('0x2c'))return;return getAgent(_0x123023[_0xa4c5('0x2b')]);})[_0xa4c5('0x1b')](function(_0x3128f3){if(_0x3128f3){_0x123023[_0xa4c5('0x2d')]=util[_0xa4c5('0x36')]('SIP/%s',_0x3128f3[_0xa4c5('0x2f')]);_0x123023[_0xa4c5('0x30')]=_0x3128f3;}return request({'event':_0x198286,'message':_0x123023});})[_0xa4c5('0x1e')](function(_0x15eacd){logger[_0xa4c5('0x1d')](_0xa4c5('0x1c'),_0xa4c5('0x37'),_0x15eacd);});};}function afterUpdate(_0x32f5c7){return function(_0x175316){var _0x30c6e7=_0x175316[_0xa4c5('0x38')]('closed')&&_0x175316['closed'];var _0x4238c3=_0x175316[_0xa4c5('0x38')]('substatus');if(_0x30c6e7||_0x4238c3){var _0x571852=_0x30c6e7?'closedinteraction':_0xa4c5('0x39');var _0xd15032=_0x175316[_0xa4c5('0x1f')]({'plain':!![]});_0xd15032[_0xa4c5('0x20')]=_0x32f5c7;_0xd15032['motionChannel']=_0x32f5c7;_0xd15032[_0xa4c5('0x21')]=_0x30c6e7?_0xa4c5('0x3a'):_0xa4c5('0x39');var _0x5d3749=_0xa4c5('0x35')+_0xd15032['ContactId'];return db[_0xa4c5('0x25')][_0xa4c5('0x26')](_0x5d3749,{'type':db[_0xa4c5('0x27')][_0xa4c5('0x28')]['SELECT'],'raw':!![]})['then'](function(_0x34d1cf){if(_0x34d1cf){_0xd15032[_0xa4c5('0x2a')]=_0x34d1cf[0x0];}if(typeof _0xd15032[_0xa4c5('0x2b')]==='undefined')return;return getAgent(_0xd15032[_0xa4c5('0x2b')]);})[_0xa4c5('0x1b')](function(_0x1b183c){if(_0x1b183c){_0xd15032[_0xa4c5('0x2d')]=util[_0xa4c5('0x36')](_0xa4c5('0x2e'),_0x1b183c[_0xa4c5('0x2f')]);_0xd15032['agent']=_0x1b183c;}return request({'event':_0x571852,'message':_0xd15032});})[_0xa4c5('0x1e')](function(_0x17f604){logger[_0xa4c5('0x1d')](_0xa4c5('0x1c'),_0xa4c5('0x3b'),_0x17f604);});}};}function getAgent(_0x3c4ba2){return db['User'][_0xa4c5('0x3c')]({'where':{'id':_0x3c4ba2},'attributes':['id',_0xa4c5('0x2f'),_0xa4c5('0x3d'),_0xa4c5('0x3e'),_0xa4c5('0x3f')],'raw':!![]})[_0xa4c5('0x1b')](function(_0x4f57f0){return _0x4f57f0;});}exports[_0xa4c5('0x40')]=function(){for(var _0x32785e=0x0;_0x32785e=_0x2cb6e3[_0x93a2('0x12')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x2ef5ed(_0x1dc92f);})['catch'](function(_0x52691b){_0x1838c7(_0x52691b);});});}; \ No newline at end of file +var _0xb1f5=['includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','agent','User','count','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','./license/util','voice','chat','sms','openchannel','isValidChannel','toLowerCase'];(function(_0x27afba,_0xe2e20b){var _0x4fe4d0=function(_0xf7aa2){while(--_0xf7aa2){_0x27afba['push'](_0x27afba['shift']());}};_0x4fe4d0(++_0xe2e20b);}(_0xb1f5,0x14e));var _0x5b1f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb1f5[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var BPromise=require(_0x5b1f('0x0'));var db=require('../mysqldb')['db'];var util=require(_0x5b1f('0x1'));var channels=[_0x5b1f('0x2'),'mail',_0x5b1f('0x3'),'fax',_0x5b1f('0x4'),'whatsapp',_0x5b1f('0x5')];exports['getChannels']=function(){return channels;};exports[_0x5b1f('0x6')]=function(_0x4e8827){_0x4e8827=_0x4e8827[_0x5b1f('0x7')]();return _[_0x5b1f('0x8')](channels,_0x4e8827);};exports[_0x5b1f('0x9')]=function(_0x4c7587,_0x4019a3,_0x39446b,_0x3b7cc2){var _0x291b63={'loginAttempts':_0x4019a3,'blocked':_0x39446b};if(!_[_0x5b1f('0xa')](_0x3b7cc2)){_0x291b63[_0x5b1f('0xb')]=_0x3b7cc2;}return _0x4c7587[_0x5b1f('0xc')](_0x291b63);};exports['getLicense']=function(_0x576da8){return new BPromise(function(_0x4a624e,_0x20bcad){var _0x3c2dbb=0x0;if(_0x576da8['role']!==_0x5b1f('0xd')){_0x4a624e(_0x576da8);}db[_0x5b1f('0xe')][_0x5b1f('0xf')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x576da8['id']}}})['then'](function(_0x213cc0){_0x3c2dbb=_0x213cc0;return util['getLicense']();})['then'](function(_0x3c9e8e){if(_0x3c9e8e&&_0x3c9e8e['agents']&&_0x3c2dbb>=_0x3c9e8e['agents']){throw Error(_0x5b1f('0x10'));}_0x4a624e(_0x576da8);})[_0x5b1f('0x11')](function(_0x55487b){_0x20bcad(_0x55487b);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index a5293ba..68812f8 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdace=['send','exports','util','api','Internal\x20Server\x20Error','name','Error','inherits','message','Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','error','status'];(function(_0x946e76,_0x4e9131){var _0x1efac0=function(_0x2a2a6e){while(--_0x2a2a6e){_0x946e76['push'](_0x946e76['shift']());}};_0x1efac0(++_0x4e9131);}(_0xdace,0xc5));var _0xedac=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xdace[_0x57975f];return _0x4793b8;};'use strict';var util=require(_0xedac('0x0'));var logger=require('../config/logger')(_0xedac('0x1'));var APIError=function(_0x13adb5,_0x46eba0){this['message']=_0x13adb5||_0xedac('0x2');this[_0xedac('0x3')]=_0x46eba0||_0xedac('0x4');util[_0xedac('0x5')](APIError,Error);};var APIBadRequestError=function(_0x5a97c0){this[_0xedac('0x6')]=_0x5a97c0||_0xedac('0x7');this[_0xedac('0x3')]='Bad\x20Request';util[_0xedac('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x21440e){this[_0xedac('0x6')]=_0x21440e||'Entity\x20not\x20found';this[_0xedac('0x3')]=_0xedac('0x8');util[_0xedac('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x4af030){switch(_0x4af030){case'Bad\x20Request':return 0x190;case _0xedac('0x9'),_0xedac('0xa'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x4d6a29){return function(_0x4db2ad){logger[_0xedac('0xb')](_0x4db2ad['stack']);var _0x261401=getStatusCode(_0x4db2ad['name']);if(_0x4db2ad[_0xedac('0x3')])delete _0x4db2ad[_0xedac('0x3')];return _0x4d6a29[_0xedac('0xc')](_0x261401)[_0xedac('0xd')](_0x4db2ad);};}module[_0xedac('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xa571=['name','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','inherits','Bad\x20Request'];(function(_0x485d2a,_0x1fd61e){var _0x59ff37=function(_0x56ba99){while(--_0x56ba99){_0x485d2a['push'](_0x485d2a['shift']());}};_0x59ff37(++_0x1fd61e);}(_0xa571,0x107));var _0x1a57=function(_0x57b2b2,_0x31bf5f){_0x57b2b2=_0x57b2b2-0x0;var _0x88ccc7=_0xa571[_0x57b2b2];return _0x88ccc7;};'use strict';var util=require(_0x1a57('0x0'));var logger=require(_0x1a57('0x1'))(_0x1a57('0x2'));var APIError=function(_0x1067d9,_0x48485e){this[_0x1a57('0x3')]=_0x1067d9||_0x1a57('0x4');this['name']=_0x48485e||'Error';util[_0x1a57('0x5')](APIError,Error);};var APIBadRequestError=function(_0x5067fa){this[_0x1a57('0x3')]=_0x5067fa||_0x1a57('0x6');this[_0x1a57('0x7')]=_0x1a57('0x6');util[_0x1a57('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x924873){this['message']=_0x924873||_0x1a57('0x8');this[_0x1a57('0x7')]=_0x1a57('0x9');util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x3c8182){switch(_0x3c8182){case _0x1a57('0x6'):return 0x190;case _0x1a57('0xa'),_0x1a57('0xb'):return 0x193;case _0x1a57('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x2980b2){return function(_0x62cc63){logger[_0x1a57('0xc')](_0x62cc63['stack']);var _0x562fa4=getStatusCode(_0x62cc63[_0x1a57('0x7')]);if(_0x62cc63[_0x1a57('0x7')])delete _0x62cc63[_0x1a57('0x7')];return _0x2980b2['status'](_0x562fa4)[_0x1a57('0xd')](_0x62cc63);};}module[_0x1a57('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 5e15e20..0698e06 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a21=['send','exports','status','json'];(function(_0x3defa2,_0x2f21d3){var _0x12deb2=function(_0x2cf76){while(--_0x2cf76){_0x3defa2['push'](_0x3defa2['shift']());}};_0x12deb2(++_0x2f21d3);}(_0x5a21,0xcd));var _0x15a2=function(_0x16ec06,_0x1513b5){_0x16ec06=_0x16ec06-0x0;var _0xee6d30=_0x5a21[_0x16ec06];return _0xee6d30;};'use strict';module[_0x15a2('0x0')][0x194]=function pageNotFound(_0x3ca445,_0x3cb3c3){var _0x2d7803='404';var _0x491c9d=0x194;var _0x30aad4={'status':_0x491c9d};_0x3cb3c3[_0x15a2('0x1')](_0x30aad4[_0x15a2('0x1')]);_0x3cb3c3['render'](_0x2d7803,{},function(_0xf1a411,_0xf42ac8){if(_0xf1a411){return _0x3cb3c3['status'](_0x30aad4[_0x15a2('0x1')])[_0x15a2('0x2')](_0x30aad4);}_0x3cb3c3[_0x15a2('0x3')](_0xf42ac8);});}; \ No newline at end of file +var _0x586b=['render','json','send','404','status'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x586b,0x1bb));var _0xb586=function(_0xd81e6c,_0x48d93d){_0xd81e6c=_0xd81e6c-0x0;var _0x41f111=_0x586b[_0xd81e6c];return _0x41f111;};'use strict';module['exports'][0x194]=function pageNotFound(_0x523790,_0x18427d){var _0x3e1832=_0xb586('0x0');var _0x2a15df=0x194;var _0x23f7c8={'status':_0x2a15df};_0x18427d[_0xb586('0x1')](_0x23f7c8[_0xb586('0x1')]);_0x18427d[_0xb586('0x2')](_0x3e1832,{},function(_0x5cfaf4,_0x51b75e){if(_0x5cfaf4){return _0x18427d[_0xb586('0x1')](_0x23f7c8[_0xb586('0x1')])[_0xb586('0x3')](_0x23f7c8);}_0x18427d[_0xb586('0x4')](_0x51b75e);});}; \ No newline at end of file diff --git a/server/files/chat/iframe.ejs b/server/files/chat/iframe.ejs index cce974f..220645c 100644 --- a/server/files/chat/iframe.ejs +++ b/server/files/chat/iframe.ejs @@ -259,7 +259,7 @@ <% } -%> break; case "init": <% if (alignment == 'right' || alignment == 'left') { -%> // Bottom, right - div_tab.style.backgroundColor textColor; + div_tab.style.backgroundColor = textColor; document.getElementById("chat_tab_text").style.color = textColor; document.getElementById("chat_tab_arrow").style.color = textColor; document.getElementById("chat_tab_arrow").style.backgroundColor = textColor; diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index a6549ba..ebd9d72 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe68=['FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Condition','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','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','CmHopperAdditionalPhone','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','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','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','UserId','userSetting','hasMany','Recordings','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','WhatsappAccounts','SpiedAgents','cascade','ChanSpyId','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceCallReport','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Disposition','Dispositions','CannedAnswer','Answers','MailMessage','Interactions','Applications','List','TemplateId','mandatoryDispositionPause','team_has_mail_queues','Account','Owner','Tag','Tags','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','ListId','Dashboard','Items','FaxAccountId','fax_interaction_has_tags','FaxInteractionId','AttachmentId','FaxQueueReport','SmsAccountId','user_has_sms_accounts','TagId','SmsInteractionId','sms_interaction_has_tags','SmsQueue','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','chat_group_has_users','CompanyId','Phones','CmContactId','cm_contact_has_tags','AdditionalPhones','CmHopperId','Agent','Queue','CampaignId','OwnerId','Automation','All','Any','AutomationAnyId','AutomationId','ParentId','Intervals','Extensions','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ItemType','ItemTypeId','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Actions','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','SalesforceField','Descriptions','DescriptionId','FieldId','Description','Field','Subjects','SubjectId','Subject','VariableId','DeskField','ZohoConfiguration','ZendeskAccount','ServicenowConfiguration','Dynamics365Configuration','FreshsalesAccount','FreshsalesConfiguration','FromId','ToId','SessionId','ProjectId','ChatQueues','team_has_whatsapp_queues','TeamVoicePrefix','VoicePrefixes','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToChatWebsiteId','FromFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserVoicePrefix','UserProfileSections','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','user','exports','sequelize','lodash','jstz','determine','defaultsDeep','xcall','xC@LL1234','utf8','utf8_general_ci','sequelizeHistory','motion2','127.0.0.1','mysql','utf8mb4','name','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction'];(function(_0xf15daf,_0x2a625d){var _0x2f76ff=function(_0x4665a8){while(--_0x4665a8){_0xf15daf['push'](_0xf15daf['shift']());}};_0x2f76ff(++_0x2a625d);}(_0xbe68,0x1b6));var _0x8be6=function(_0x27e168,_0x55c443){_0x27e168=_0x27e168-0x0;var _0x710a5b=_0xbe68[_0x27e168];return _0x710a5b;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x8be6('0x0'));var _=require(_0x8be6('0x1'));var jstz=require(_0x8be6('0x2'));var timezone=jstz[_0x8be6('0x3')]();config[_0x8be6('0x0')]=_[_0x8be6('0x4')](config['sequelize'],{'database':'motion2','username':_0x8be6('0x5'),'password':_0x8be6('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8be6('0x7'),'collate':_0x8be6('0x8')}}});config[_0x8be6('0x9')]=_[_0x8be6('0x4')](config[_0x8be6('0x9')],{'database':_0x8be6('0xa'),'username':_0x8be6('0x5'),'password':_0x8be6('0x6'),'options':{'host':_0x8be6('0xb'),'port':0xcea,'dialect':_0x8be6('0xc'),'dialectOptions':{'charset':_0x8be6('0xd')},'logging':![],'timezone':timezone[_0x8be6('0xe')](),'define':{'charset':_0x8be6('0x7'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8be6('0x0')][_0x8be6('0xf')],config['sequelize'][_0x8be6('0x10')],config[_0x8be6('0x0')][_0x8be6('0x11')],config['sequelize'][_0x8be6('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8be6('0x9')][_0x8be6('0xf')],config[_0x8be6('0x9')]['username'],config[_0x8be6('0x9')][_0x8be6('0x11')],config['sequelizeHistory'][_0x8be6('0x12')])};db[_0x8be6('0x13')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x15'));db[_0x8be6('0x16')]=db[_0x8be6('0x0')]['import'](_0x8be6('0x17'));db[_0x8be6('0x18')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/voiceContext/voiceContext.model');db[_0x8be6('0x19')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x1a'));db[_0x8be6('0x1b')]=db['sequelize']['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x8be6('0x1c')]=db[_0x8be6('0x0')]['import'](_0x8be6('0x1d'));db[_0x8be6('0x1e')]=db[_0x8be6('0x0')]['import'](_0x8be6('0x1f'));db[_0x8be6('0x20')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x21'));db[_0x8be6('0x22')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x23'));db['VoiceMailMessage']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x24'));db['VoiceCallReport']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x25'));db['VoiceDialReport']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x26'));db[_0x8be6('0x27')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x28'));db[_0x8be6('0x29')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x2a'));db[_0x8be6('0x2b')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/trunk/trunk.model');db[_0x8be6('0x2c')]=db[_0x8be6('0x0')]['import'](_0x8be6('0x2d'));db[_0x8be6('0x2e')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x2f'));db[_0x8be6('0x30')]=db['sequelize'][_0x8be6('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x8be6('0x31')]=db['sequelize'][_0x8be6('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0x8be6('0x32')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x8be6('0x33')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x34'));db[_0x8be6('0x35')]=db[_0x8be6('0x0')]['import']('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x36'));db[_0x8be6('0x37')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x38'));db[_0x8be6('0x39')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x3a'));db[_0x8be6('0x3b')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x3c'));db[_0x8be6('0x3d')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/mailAccount/mailAccount.model');db[_0x8be6('0x3e')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x3f'));db[_0x8be6('0x40')]=db['sequelize']['import'](_0x8be6('0x41'));db['MailInteraction']=db[_0x8be6('0x0')]['import'](_0x8be6('0x42'));db['MailMessage']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x43'));db[_0x8be6('0x44')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x45'));db[_0x8be6('0x46')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x47'));db['Dashboard']=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/dashboard/dashboard.model');db[_0x8be6('0x48')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x49'));db[_0x8be6('0x4a')]=db[_0x8be6('0x0')]['import'](_0x8be6('0x4b'));db[_0x8be6('0x4c')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/faxApplication/faxApplication.model');db[_0x8be6('0x4d')]=db[_0x8be6('0x0')]['import']('../api/faxInteraction/faxInteraction.model');db[_0x8be6('0x4e')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x4f'));db[_0x8be6('0x50')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x51'));db['FaxQueueReport']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x52'));db[_0x8be6('0x53')]=db['sequelize'][_0x8be6('0x14')]('../api/smsAccount/smsAccount.model');db[_0x8be6('0x54')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x55'));db['SmsInteraction']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x56'));db[_0x8be6('0x57')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x58'));db['SmsQueue']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x59'));db[_0x8be6('0x5a')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x5b'));db[_0x8be6('0x5c')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x5d'));db['OpenchannelMessage']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x5e'));db[_0x8be6('0x5f')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x60'));db[_0x8be6('0x61')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x62'));db[_0x8be6('0x63')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x64'));db['ChatInteraction']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x65'));db[_0x8be6('0x66')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x67'));db[_0x8be6('0x68')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x69'));db[_0x8be6('0x6a')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x6b'));db[_0x8be6('0x6c')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x6d'));db[_0x8be6('0x6e')]=db['sequelize']['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0x8be6('0x6f')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x70'));db[_0x8be6('0x71')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x72'));db[_0x8be6('0x73')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x74'));db[_0x8be6('0x75')]=db[_0x8be6('0x0')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x8be6('0x76')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x77'));db[_0x8be6('0x78')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x8be6('0x79')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x7a'));db[_0x8be6('0x7b')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x7c'));db[_0x8be6('0x7d')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x7e'));db['Automation']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x7f'));db['CannedAnswer']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x80'));db['Disposition']=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/disposition/disposition.model');db[_0x8be6('0x81')]=db['sequelize'][_0x8be6('0x14')]('../api/condition/condition.model');db[_0x8be6('0x82')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x83'));db[_0x8be6('0x84')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x85'));db['Cdr']=db['sequelize'][_0x8be6('0x14')]('../api/cdr/cdr.model');db[_0x8be6('0x86')]=db[_0x8be6('0x0')]['import'](_0x8be6('0x87'));db[_0x8be6('0x88')]=db[_0x8be6('0x0')]['import'](_0x8be6('0x89'));db[_0x8be6('0x8a')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x8b'));db['Tag']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x8c'));db[_0x8be6('0x8d')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x8e'));db[_0x8be6('0x8f')]=db['sequelize'][_0x8be6('0x14')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0x8be6('0x90')]=db['sequelize'][_0x8be6('0x14')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x8be6('0x91')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x92'));db[_0x8be6('0x93')]=db['sequelize'][_0x8be6('0x14')]('../api/trigger/trigger.model');db[_0x8be6('0x94')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x95'));db[_0x8be6('0x96')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x97'));db['IntegrationReport']=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x98'));db[_0x8be6('0x99')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x9a'));db[_0x8be6('0x9b')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x9c'));db[_0x8be6('0x9d')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x9e'));db['AnalyticMetric']=db[_0x8be6('0x0')]['import'](_0x8be6('0x9f'));db[_0x8be6('0xa0')]=db[_0x8be6('0x0')]['import'](_0x8be6('0xa1'));db[_0x8be6('0xa2')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xa3'));db[_0x8be6('0xa4')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xa5'));db[_0x8be6('0xa6')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xa7'));db['SalesforceField']=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xa8'));db[_0x8be6('0xa9')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x8be6('0xaa')]=db[_0x8be6('0x0')]['import'](_0x8be6('0xab'));db[_0x8be6('0xac')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xad'));db[_0x8be6('0xae')]=db[_0x8be6('0x0')]['import'](_0x8be6('0xaf'));db[_0x8be6('0xb0')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xb1'));db[_0x8be6('0xb2')]=db[_0x8be6('0x0')]['import'](_0x8be6('0xb3'));db['ZohoConfiguration']=db['sequelize'][_0x8be6('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x8be6('0xb4')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0x8be6('0x0')]['import'](_0x8be6('0xb5'));db[_0x8be6('0xb6')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xb7'));db[_0x8be6('0xb8')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xb9'));db[_0x8be6('0xba')]=db[_0x8be6('0x0')]['import'](_0x8be6('0xbb'));db[_0x8be6('0xbc')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x8be6('0xbd')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x8be6('0xbe')]=db['sequelize']['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0x8be6('0xbf')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xc0'));db[_0x8be6('0xc1')]=db['sequelize']['import'](_0x8be6('0xc2'));db[_0x8be6('0xc3')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xc4'));db['ServicenowConfiguration']=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xc5'));db[_0x8be6('0xc6')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xc7'));db[_0x8be6('0xc8')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xc9'));db['Dynamics365Configuration']=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xca'));db[_0x8be6('0xcb')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xcc'));db['FreshsalesAccount']=db[_0x8be6('0x0')]['import'](_0x8be6('0xcd'));db['FreshsalesConfiguration']=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xce'));db[_0x8be6('0xcf')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x8be6('0x96')]=db['sequelize'][_0x8be6('0x14')]('../api/integration/integration.model');db[_0x8be6('0xd0')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xd1'));db[_0x8be6('0xd2')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xd3'));db[_0x8be6('0xd4')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xd5'));db[_0x8be6('0xd6')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x8be6('0xd7')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xd8'));db[_0x8be6('0xd9')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xda'));db[_0x8be6('0xdb')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xdc'));db[_0x8be6('0xdd')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xde'));db[_0x8be6('0xdf')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xe0'));db[_0x8be6('0xe1')]=db[_0x8be6('0x0')]['import'](_0x8be6('0xe2'));db[_0x8be6('0xe3')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xe4'));db[_0x8be6('0xe5')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xe6'));db[_0x8be6('0xe7')]=db[_0x8be6('0x0')]['import']('../api/squareProject/squareProject.model');db[_0x8be6('0xe8')]=db[_0x8be6('0x0')]['import'](_0x8be6('0xe9'));db[_0x8be6('0xea')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xeb'));db[_0x8be6('0xec')]=db[_0x8be6('0x0')]['import']('../api/team/team.model');db['License']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xed'));db[_0x8be6('0xee')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xef'));db[_0x8be6('0xf0')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xf1'));db[_0x8be6('0xf2')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xf3'));db[_0x8be6('0xf4')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xf5'));db[_0x8be6('0xf6')]=db[_0x8be6('0x0')]['import']('../api/mailTransferReport/mailTransferReport.model');db[_0x8be6('0xf7')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xf8'));db[_0x8be6('0xf9')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xfa'));db['OpenchannelTransferReport']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0xfb'));db[_0x8be6('0xfc')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0xfd'));db[_0x8be6('0xfe')]=db['sequelize']['import'](_0x8be6('0xff'));db[_0x8be6('0x100')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x101'));db[_0x8be6('0x102')]=db[_0x8be6('0x0')]['import'](_0x8be6('0x103'));db[_0x8be6('0x104')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x105'));db[_0x8be6('0x106')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x107'));db[_0x8be6('0x108')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x109'));db[_0x8be6('0x10a')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x10b'));db[_0x8be6('0x10c')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x10d'));db[_0x8be6('0x10e')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x8be6('0x10f')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x110'));db[_0x8be6('0x111')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x8be6('0x112')]=db[_0x8be6('0x0')]['import'](_0x8be6('0x113'));db[_0x8be6('0x114')]=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x115'));db[_0x8be6('0x116')]=db['sequelize'][_0x8be6('0x14')](_0x8be6('0x117'));db[_0x8be6('0x118')]=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x8be6('0x0')][_0x8be6('0x14')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0x8be6('0x0')][_0x8be6('0x14')](_0x8be6('0x119'));db[_0x8be6('0x11a')]=db['sequelize']['import'](_0x8be6('0x11b'));db[_0x8be6('0x13')][_0x8be6('0x11c')](db['VoiceMail'],{'as':_0x8be6('0x22'),'onDelete':'cascade','foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')][_0x8be6('0x11c')](db[_0x8be6('0x11a')],{'as':_0x8be6('0x11e'),'onDelete':'cascade','foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')][_0x8be6('0x11f')](db[_0x8be6('0x1e')],{'as':_0x8be6('0x120'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')]['hasMany'](db['UserVoiceQueueRt'],{'as':'VoiceQueuesRt','foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')][_0x8be6('0x11f')](db[_0x8be6('0x19')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0x8be6('0x13')][_0x8be6('0x11f')](db[_0x8be6('0x76')],{'as':_0x8be6('0x121'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')][_0x8be6('0x11f')](db[_0x8be6('0x78')],{'as':_0x8be6('0x122'),'foreignKey':_0x8be6('0x11d')});db['User'][_0x8be6('0x11f')](db[_0x8be6('0x79')],{'as':_0x8be6('0x79'),'foreignKey':'UserId'});db[_0x8be6('0x13')][_0x8be6('0x11f')](db[_0x8be6('0x5c')],{'as':_0x8be6('0x123'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')][_0x8be6('0x11f')](db[_0x8be6('0x124')],{'as':_0x8be6('0x125'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')][_0x8be6('0x11f')](db['SmsInteraction'],{'as':_0x8be6('0x126'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')][_0x8be6('0x11f')](db[_0x8be6('0x4d')],{'as':_0x8be6('0x127'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')]['hasMany'](db[_0x8be6('0x128')],{'as':'MailInteractions','foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')][_0x8be6('0x11f')](db[_0x8be6('0x10e')],{'as':_0x8be6('0x129'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x13')][_0x8be6('0x11f')](db[_0x8be6('0x108')],{'as':_0x8be6('0x12a'),'foreignKey':_0x8be6('0x12b')});db['User'][_0x8be6('0x12c')](db[_0x8be6('0x102')],{'as':_0x8be6('0x102'),'foreignKey':_0x8be6('0x12d')});db[_0x8be6('0x13')]['belongsToMany'](db[_0x8be6('0x6c')],{'as':'Groups','through':'chat_group_has_users'});db[_0x8be6('0x13')][_0x8be6('0x12e')](db[_0x8be6('0x71')],{'as':_0x8be6('0x12f'),'through':_0x8be6('0x130')});db['User'][_0x8be6('0x12e')](db[_0x8be6('0xfe')],{'as':_0x8be6('0x131'),'through':_0x8be6('0x132')});db['User'][_0x8be6('0x12e')](db[_0x8be6('0xec')],{'through':_0x8be6('0x133')});db[_0x8be6('0x13')]['belongsToMany'](db['MailInteraction'],{'as':_0x8be6('0x134'),'through':_0x8be6('0x135')});db[_0x8be6('0x13')][_0x8be6('0x12e')](db[_0x8be6('0x124')],{'as':_0x8be6('0x125'),'through':_0x8be6('0x136')});db[_0x8be6('0x13')][_0x8be6('0x12e')](db[_0x8be6('0x4d')],{'as':_0x8be6('0x127'),'through':_0x8be6('0x137')});db[_0x8be6('0x13')][_0x8be6('0x12e')](db[_0x8be6('0x138')],{'as':'SmsInteractions','through':_0x8be6('0x139')});db[_0x8be6('0x13')][_0x8be6('0x12e')](db[_0x8be6('0x5c')],{'as':_0x8be6('0x123'),'through':_0x8be6('0x13a')});db['User'][_0x8be6('0x12e')](db[_0x8be6('0x10e')],{'as':_0x8be6('0x129'),'through':_0x8be6('0x13b')});db[_0x8be6('0x13')]['belongsToMany'](db[_0x8be6('0x1c')],{'as':_0x8be6('0x13c'),'through':_0x8be6('0x30'),'required':![]});db[_0x8be6('0x13')]['belongsToMany'](db[_0x8be6('0x100')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db[_0x8be6('0x13')][_0x8be6('0x12e')](db[_0x8be6('0x3e')],{'as':_0x8be6('0x13d'),'through':_0x8be6('0x32'),'required':![]});db['User'][_0x8be6('0x12e')](db[_0x8be6('0x6a')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0x8be6('0x13')][_0x8be6('0x12e')](db['FaxQueue'],{'as':_0x8be6('0x13e'),'through':_0x8be6('0x33'),'required':![]});db['User'][_0x8be6('0x12e')](db['SmsQueue'],{'as':_0x8be6('0x13f'),'through':_0x8be6('0x35'),'required':![]});db[_0x8be6('0x13')][_0x8be6('0x12e')](db[_0x8be6('0x5f')],{'as':_0x8be6('0x140'),'through':_0x8be6('0x141'),'required':![]});db[_0x8be6('0x13')][_0x8be6('0x12e')](db[_0x8be6('0x114')],{'as':_0x8be6('0x142'),'through':_0x8be6('0x37'),'required':![]});db[_0x8be6('0x13')][_0x8be6('0x12e')](db[_0x8be6('0xfe')],{'through':_0x8be6('0x132')});db['User'][_0x8be6('0x12e')](db['ChatWebsite'],{'as':_0x8be6('0x143'),'through':_0x8be6('0x144')});db['User'][_0x8be6('0x12e')](db[_0x8be6('0x4a')],{'as':_0x8be6('0x145'),'through':_0x8be6('0x146')});db['User'][_0x8be6('0x12e')](db['MailAccount'],{'as':_0x8be6('0x147'),'through':_0x8be6('0x148')});db[_0x8be6('0x13')][_0x8be6('0x12e')](db[_0x8be6('0x5a')],{'as':'OpenchannelAccounts','through':_0x8be6('0x149')});db[_0x8be6('0x13')][_0x8be6('0x12e')](db['SmsAccount'],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db['User'][_0x8be6('0x12e')](db[_0x8be6('0x10a')],{'as':_0x8be6('0x14a'),'through':'user_has_whatsapp_accounts'});db[_0x8be6('0x16')][_0x8be6('0x11f')](db[_0x8be6('0x19')],{'as':_0x8be6('0x14b'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x14d')});db[_0x8be6('0x18')][_0x8be6('0x11f')](db[_0x8be6('0x19')],{'onDelete':_0x8be6('0x14c')});db['VoiceExtension'][_0x8be6('0x11f')](db[_0x8be6('0x19')],{'as':'Applications','onDelete':_0x8be6('0x14c')});db[_0x8be6('0x1b')]['belongsToMany'](db[_0x8be6('0x8a')],{'as':'Sounds','through':'moh_has_sounds'});db['VoiceQueue'][_0x8be6('0x11f')](db[_0x8be6('0x2e')],{'as':_0x8be6('0x14e'),'foreignKey':_0x8be6('0x14f')});db[_0x8be6('0x1c')]['hasMany'](db[_0x8be6('0x73')],{'as':_0x8be6('0x150'),'foreignKey':_0x8be6('0x14f')});db[_0x8be6('0x1c')]['hasMany'](db[_0x8be6('0x76')],{'as':_0x8be6('0x121'),'foreignKey':_0x8be6('0x14f')});db[_0x8be6('0x1c')][_0x8be6('0x11f')](db[_0x8be6('0x78')],{'as':_0x8be6('0x151'),'foreignKey':'VoiceQueueId'});db[_0x8be6('0x1c')][_0x8be6('0x11f')](db['ReportAgentPreview'],{'as':_0x8be6('0x79'),'foreignKey':_0x8be6('0x14f')});db[_0x8be6('0x1c')][_0x8be6('0x11f')](db[_0x8be6('0x75')],{'as':_0x8be6('0x152'),'foreignKey':_0x8be6('0x14f')});db[_0x8be6('0x1c')]['hasMany'](db[_0x8be6('0xd9')],{'as':_0x8be6('0x153'),'foreignKey':_0x8be6('0x14f')});db[_0x8be6('0x1c')][_0x8be6('0x12c')](db[_0x8be6('0x2b')],{'as':_0x8be6('0x2b'),'foreignKey':_0x8be6('0x154')});db['VoiceQueue'][_0x8be6('0x12c')](db['Trunk'],{'as':_0x8be6('0x155'),'foreignKey':_0x8be6('0x156')});db['VoiceQueue'][_0x8be6('0x12c')](db[_0x8be6('0x82')],{'as':_0x8be6('0x82'),'foreignKey':_0x8be6('0x157')});db[_0x8be6('0x1c')][_0x8be6('0x12c')](db[_0x8be6('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x8be6('0x158')});db[_0x8be6('0x1c')][_0x8be6('0x12e')](db['CmList'],{'as':_0x8be6('0x131'),'through':_0x8be6('0x159')});db['VoiceQueue'][_0x8be6('0x12e')](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':_0x8be6('0x30')});db[_0x8be6('0x1c')][_0x8be6('0x12e')](db[_0x8be6('0xec')],{'as':_0x8be6('0x15b'),'through':'TeamVoiceQueue'});db[_0x8be6('0x1c')][_0x8be6('0x12e')](db[_0x8be6('0xfe')],{'as':_0x8be6('0x15c'),'through':_0x8be6('0x15d')});db['VoiceRecording'][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'as':_0x8be6('0x13'),'foreignKey':'UserId'});db[_0x8be6('0x20')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'as':_0x8be6('0x13'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x22')]['hasMany'](db[_0x8be6('0x15e')],{'as':_0x8be6('0x15f'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x160'),'sourceKey':_0x8be6('0x161')});db[_0x8be6('0x15e')][_0x8be6('0x12c')](db['VoiceMail'],{'foreignKey':_0x8be6('0x160'),'targetKey':_0x8be6('0x161')});db['VoiceCallReport']['hasMany'](db[_0x8be6('0x29')],{'as':_0x8be6('0x162'),'foreignKey':_0x8be6('0x163'),'constraints':![]});db[_0x8be6('0x164')][_0x8be6('0x11f')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0x8be6('0x163'),'constraints':![]});db['VoiceCallReport'][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x8be6('0x164')][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'as':_0x8be6('0x165'),'foreignKey':_0x8be6('0x166')});db[_0x8be6('0x39')][_0x8be6('0x12c')](db[_0x8be6('0x3d')],{'as':_0x8be6('0x3d'),'foreignKey':_0x8be6('0x167')});db[_0x8be6('0x39')][_0x8be6('0x12c')](db[_0x8be6('0x116')],{'as':_0x8be6('0x116'),'foreignKey':_0x8be6('0x168'),'onDelete':_0x8be6('0x169')});db['MailServerOut'][_0x8be6('0x12c')](db['MailAccount'],{'as':_0x8be6('0x3d'),'foreignKey':_0x8be6('0x167')});db[_0x8be6('0x3b')][_0x8be6('0x12c')](db[_0x8be6('0x116')],{'as':'CloudProvider','foreignKey':_0x8be6('0x168'),'onDelete':_0x8be6('0x169')});db[_0x8be6('0x3d')][_0x8be6('0x11c')](db[_0x8be6('0x39')],{'as':_0x8be6('0x16a'),'onDelete':'cascade'});db[_0x8be6('0x3d')][_0x8be6('0x11c')](db[_0x8be6('0x3b')],{'as':_0x8be6('0x16b'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0x3d')][_0x8be6('0x11f')](db[_0x8be6('0x16c')],{'as':_0x8be6('0x16d'),'foreignKey':'MailAccountId','onDelete':_0x8be6('0x14c')});db['MailAccount'][_0x8be6('0x11f')](db[_0x8be6('0x16e')],{'as':_0x8be6('0x16f'),'foreignKey':_0x8be6('0x167')});db[_0x8be6('0x3d')]['hasMany'](db[_0x8be6('0x170')],{'as':_0x8be6('0x15f'),'foreignKey':_0x8be6('0x167')});db[_0x8be6('0x3d')]['hasMany'](db[_0x8be6('0x128')],{'as':_0x8be6('0x171')});db[_0x8be6('0x3d')][_0x8be6('0x11f')](db['MailApplication'],{'as':_0x8be6('0x172')});db['MailAccount'][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':_0x8be6('0x173'),'foreignKey':'ListId'});db['MailAccount'][_0x8be6('0x12c')](db['Template'],{'as':_0x8be6('0x91'),'foreignKey':_0x8be6('0x174')});db['MailAccount'][_0x8be6('0x12c')](db[_0x8be6('0x84')],{'as':_0x8be6('0x175'),'foreignKey':_0x8be6('0x158')});db[_0x8be6('0x3d')]['belongsToMany'](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':_0x8be6('0x148')});db[_0x8be6('0x3e')]['belongsToMany'](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':_0x8be6('0x32')});db['MailQueue'][_0x8be6('0x12e')](db[_0x8be6('0xec')],{'through':_0x8be6('0x176'),'as':'Teams'});db[_0x8be6('0x128')][_0x8be6('0x11f')](db[_0x8be6('0x170')],{'as':_0x8be6('0x15f'),'onDelete':_0x8be6('0x14c'),'foreignKey':'MailInteractionId'});db[_0x8be6('0x128')][_0x8be6('0x12c')](db['MailAccount'],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x167')});db[_0x8be6('0x128')]['belongsTo'](db[_0x8be6('0x71')],{'as':_0x8be6('0x165'),'foreignKey':_0x8be6('0x166')});db[_0x8be6('0x128')][_0x8be6('0x12c')](db['User'],{'as':_0x8be6('0x178'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x128')][_0x8be6('0x12e')](db[_0x8be6('0x179')],{'through':'mail_interaction_has_tags','as':_0x8be6('0x17a')});db[_0x8be6('0x128')][_0x8be6('0x12e')](db[_0x8be6('0x179')],{'through':_0x8be6('0x17b'),'as':_0x8be6('0x17c')});db[_0x8be6('0x128')]['belongsToMany'](db[_0x8be6('0x13')],{'as':_0x8be6('0x17d'),'through':_0x8be6('0x135'),'foreignKey':_0x8be6('0x17e')});db['MailMessage'][_0x8be6('0x11f')](db[_0x8be6('0xf2')],{'as':_0x8be6('0x17f'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0x170')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'as':_0x8be6('0x13')});db['MailMessage'][_0x8be6('0x12c')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x8be6('0x170')][_0x8be6('0x12c')](db[_0x8be6('0x128')],{'as':_0x8be6('0x180'),'foreignKey':_0x8be6('0x17e')});db[_0x8be6('0x170')][_0x8be6('0x12c')](db['MailAccount'],{'as':_0x8be6('0x177'),'foreignKey':'MailAccountId'});db[_0x8be6('0x170')]['belongsTo'](db[_0x8be6('0x61')],{'as':_0x8be6('0x61'),'foreignKey':_0x8be6('0x181')});db['MailMessage'][_0x8be6('0x12c')](db[_0x8be6('0x68')],{'as':_0x8be6('0x68'),'foreignKey':_0x8be6('0x182')});db['MailApplication'][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'onDelete':'restrict'});db[_0x8be6('0x44')][_0x8be6('0x12c')](db[_0x8be6('0x3e')],{'onDelete':'restrict'});db[_0x8be6('0x44')]['belongsTo'](db['MailAccount'],{'onDelete':_0x8be6('0x169')});db[_0x8be6('0x44')]['belongsTo'](db[_0x8be6('0x82')],{'onDelete':_0x8be6('0x169'),'foreignKey':_0x8be6('0x157')});db[_0x8be6('0x44')][_0x8be6('0x12c')](db[_0x8be6('0x179')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db[_0x8be6('0x3d')],{});db[_0x8be6('0x46')][_0x8be6('0x12c')](db['CmList'],{'as':_0x8be6('0x173'),'foreignKey':_0x8be6('0x183')});db[_0x8be6('0x46')][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'as':'Contact','foreignKey':_0x8be6('0x166')});db[_0x8be6('0x46')]['belongsTo'](db[_0x8be6('0x128')],{});db['MailQueueReport']['belongsTo'](db[_0x8be6('0x170')],{});db[_0x8be6('0x46')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{});db[_0x8be6('0x46')][_0x8be6('0x12c')](db[_0x8be6('0x3e')],{});db[_0x8be6('0x184')]['hasMany'](db[_0x8be6('0x48')],{'as':_0x8be6('0x185'),'onDelete':'cascade'});db[_0x8be6('0x4a')][_0x8be6('0x11f')](db['Disposition'],{'as':_0x8be6('0x16d'),'foreignKey':'FaxAccountId','onDelete':_0x8be6('0x14c')});db[_0x8be6('0x4a')][_0x8be6('0x11f')](db[_0x8be6('0x16e')],{'as':'Answers','foreignKey':_0x8be6('0x186')});db[_0x8be6('0x4a')][_0x8be6('0x11f')](db['FaxInteraction'],{'as':_0x8be6('0x171')});db[_0x8be6('0x4a')][_0x8be6('0x11f')](db['FaxApplication'],{'as':'Applications'});db[_0x8be6('0x4a')]['hasMany'](db[_0x8be6('0x19')],{'as':'Exntensions','onDelete':_0x8be6('0x14c')});db[_0x8be6('0x4a')][_0x8be6('0x11f')](db[_0x8be6('0x4e')],{'as':_0x8be6('0x15f')});db['FaxAccount'][_0x8be6('0x12c')](db['Trunk'],{'as':_0x8be6('0x2b')});db[_0x8be6('0x4a')][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':_0x8be6('0x173'),'foreignKey':_0x8be6('0x183')});db['FaxAccount'][_0x8be6('0x12c')](db[_0x8be6('0x84')],{'as':_0x8be6('0x175'),'foreignKey':_0x8be6('0x158')});db[_0x8be6('0x4a')]['belongsToMany'](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':'user_has_fax_accounts'});db[_0x8be6('0x4c')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'onDelete':_0x8be6('0x169')});db['FaxApplication'][_0x8be6('0x12c')](db[_0x8be6('0x50')],{'onDelete':'restrict'});db[_0x8be6('0x4c')][_0x8be6('0x12c')](db['FaxAccount'],{'onDelete':'restrict'});db[_0x8be6('0x4c')][_0x8be6('0x12c')](db[_0x8be6('0x179')],{'onDelete':_0x8be6('0x169'),'foreignKey':'TagId'});db[_0x8be6('0x4d')]['hasMany'](db[_0x8be6('0x4e')],{'as':'Messages','onDelete':_0x8be6('0x14c'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0x8be6('0x12c')](db[_0x8be6('0x4a')],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x186')});db['FaxInteraction'][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'as':_0x8be6('0x165'),'foreignKey':_0x8be6('0x166')});db['FaxInteraction'][_0x8be6('0x12c')](db['User'],{'as':_0x8be6('0x178'),'foreignKey':_0x8be6('0x11d')});db['FaxInteraction'][_0x8be6('0x12e')](db[_0x8be6('0x179')],{'through':_0x8be6('0x187'),'as':'Tags'});db[_0x8be6('0x4d')][_0x8be6('0x12e')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x8be6('0x17c')});db[_0x8be6('0x4d')][_0x8be6('0x12e')](db['User'],{'as':'Users','through':_0x8be6('0x137'),'foreignKey':_0x8be6('0x188')});db[_0x8be6('0x4e')]['belongsTo'](db['User'],{'onDelete':_0x8be6('0x14c'),'as':_0x8be6('0x13')});db[_0x8be6('0x4e')][_0x8be6('0x12c')](db[_0x8be6('0x4d')],{'as':_0x8be6('0x180'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'onDelete':_0x8be6('0x14c'),'as':_0x8be6('0x165')});db[_0x8be6('0x4e')][_0x8be6('0x12c')](db[_0x8be6('0xf2')],{'as':_0x8be6('0xf2'),'foreignKey':_0x8be6('0x189')});db[_0x8be6('0x4e')][_0x8be6('0x12c')](db['FaxAccount'],{'as':_0x8be6('0x177'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0x8be6('0x12e')](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':'UserFaxQueue'});db[_0x8be6('0x50')]['belongsToMany'](db['Team'],{'through':'team_has_fax_queues','as':_0x8be6('0x15b')});db[_0x8be6('0x18a')][_0x8be6('0x12c')](db[_0x8be6('0x4a')],{});db['FaxQueueReport'][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':'List','foreignKey':_0x8be6('0x183')});db['FaxQueueReport'][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'as':'Contact','foreignKey':_0x8be6('0x166')});db['FaxQueueReport'][_0x8be6('0x12c')](db[_0x8be6('0x4d')],{});db[_0x8be6('0x18a')]['belongsTo'](db[_0x8be6('0x4e')],{});db[_0x8be6('0x18a')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{});db[_0x8be6('0x18a')][_0x8be6('0x12c')](db[_0x8be6('0x50')],{});db[_0x8be6('0x53')][_0x8be6('0x11f')](db[_0x8be6('0x16c')],{'as':'Dispositions','foreignKey':_0x8be6('0x18b'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0x53')]['hasMany'](db[_0x8be6('0x16e')],{'as':_0x8be6('0x16f'),'foreignKey':_0x8be6('0x18b')});db['SmsAccount'][_0x8be6('0x11f')](db[_0x8be6('0x57')],{'as':_0x8be6('0x15f'),'foreignKey':_0x8be6('0x18b')});db[_0x8be6('0x53')][_0x8be6('0x11f')](db[_0x8be6('0x138')],{'as':_0x8be6('0x171')});db[_0x8be6('0x53')][_0x8be6('0x11f')](db[_0x8be6('0x54')],{'as':'Applications'});db['SmsAccount'][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':_0x8be6('0x173'),'foreignKey':_0x8be6('0x183')});db[_0x8be6('0x53')][_0x8be6('0x12c')](db['Pause'],{'as':_0x8be6('0x175'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8be6('0x53')][_0x8be6('0x12e')](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':_0x8be6('0x18c')});db[_0x8be6('0x54')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'onDelete':_0x8be6('0x169')});db[_0x8be6('0x54')][_0x8be6('0x12c')](db['SmsQueue'],{'onDelete':_0x8be6('0x169')});db[_0x8be6('0x54')][_0x8be6('0x12c')](db['SmsAccount'],{'onDelete':_0x8be6('0x169')});db[_0x8be6('0x54')][_0x8be6('0x12c')](db['Interval'],{'onDelete':_0x8be6('0x169'),'foreignKey':'IntervalId'});db['SmsApplication'][_0x8be6('0x12c')](db[_0x8be6('0x179')],{'onDelete':'restrict','foreignKey':_0x8be6('0x18d')});db[_0x8be6('0x138')]['hasMany'](db[_0x8be6('0x57')],{'as':_0x8be6('0x15f'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x18e')});db[_0x8be6('0x138')]['belongsTo'](db[_0x8be6('0x53')],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x18b')});db['SmsInteraction']['belongsTo'](db['CmContact'],{'as':_0x8be6('0x165'),'foreignKey':_0x8be6('0x166')});db[_0x8be6('0x138')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'as':_0x8be6('0x178'),'foreignKey':_0x8be6('0x11d')});db['SmsInteraction'][_0x8be6('0x12e')](db['Tag'],{'through':_0x8be6('0x18f'),'as':_0x8be6('0x17a')});db[_0x8be6('0x138')][_0x8be6('0x12e')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x8be6('0x17c')});db[_0x8be6('0x138')]['belongsToMany'](db[_0x8be6('0x13')],{'as':'Users','through':_0x8be6('0x139'),'foreignKey':'SmsInteractionId'});db['SmsMessage']['belongsTo'](db['User'],{'as':_0x8be6('0x13')});db[_0x8be6('0x57')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x8be6('0x165')});db[_0x8be6('0x57')][_0x8be6('0x12c')](db[_0x8be6('0x138')],{'onDelete':_0x8be6('0x14c'),'as':_0x8be6('0x180'),'foreignKey':_0x8be6('0x18e')});db[_0x8be6('0x57')][_0x8be6('0x12c')](db[_0x8be6('0x53')],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x18b')});db[_0x8be6('0x190')]['belongsToMany'](db[_0x8be6('0x13')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0x8be6('0x191')});db[_0x8be6('0x190')][_0x8be6('0x12e')](db[_0x8be6('0xec')],{'through':_0x8be6('0x192'),'as':_0x8be6('0x15b')});db['OpenchannelAccount'][_0x8be6('0x11f')](db['Disposition'],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0x8be6('0x14c')});db[_0x8be6('0x5a')]['hasMany'](db[_0x8be6('0x16e')],{'as':'Answers','foreignKey':_0x8be6('0x193')});db[_0x8be6('0x5a')][_0x8be6('0x11f')](db[_0x8be6('0x5c')],{'as':_0x8be6('0x171'),'foreignKey':_0x8be6('0x193')});db['OpenchannelAccount'][_0x8be6('0x11f')](db[_0x8be6('0x194')],{'as':_0x8be6('0x15f'),'foreignKey':_0x8be6('0x193')});db[_0x8be6('0x5a')][_0x8be6('0x11f')](db[_0x8be6('0x195')],{'as':_0x8be6('0x172'),'foreignKey':'OpenchannelAccountId'});db[_0x8be6('0x5a')]['belongsTo'](db[_0x8be6('0xfe')],{'as':_0x8be6('0x173'),'foreignKey':'ListId'});db[_0x8be6('0x5a')][_0x8be6('0x12c')](db['Pause'],{'as':_0x8be6('0x175'),'foreignKey':_0x8be6('0x158')});db[_0x8be6('0x5a')]['belongsToMany'](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':_0x8be6('0x149')});db['OpenchannelApplication'][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'onDelete':_0x8be6('0x169')});db[_0x8be6('0x195')][_0x8be6('0x12c')](db[_0x8be6('0x5f')],{'onDelete':_0x8be6('0x169'),'foreignKey':_0x8be6('0x196')});db[_0x8be6('0x195')][_0x8be6('0x12c')](db[_0x8be6('0x5a')],{'onDelete':_0x8be6('0x169'),'foreignKey':_0x8be6('0x193')});db[_0x8be6('0x195')][_0x8be6('0x12c')](db['Interval'],{'onDelete':_0x8be6('0x169'),'foreignKey':_0x8be6('0x157')});db[_0x8be6('0x195')][_0x8be6('0x12c')](db[_0x8be6('0x179')],{'onDelete':_0x8be6('0x169'),'foreignKey':_0x8be6('0x18d')});db[_0x8be6('0x5c')][_0x8be6('0x11f')](db[_0x8be6('0x194')],{'as':'Messages','onDelete':_0x8be6('0x14c'),'foreignKey':'OpenchannelInteractionId'});db[_0x8be6('0x5c')][_0x8be6('0x12c')](db[_0x8be6('0x5a')],{'as':'Account','foreignKey':_0x8be6('0x193')});db['OpenchannelInteraction'][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'as':_0x8be6('0x165'),'foreignKey':_0x8be6('0x166')});db[_0x8be6('0x5c')][_0x8be6('0x12c')](db['User'],{'as':_0x8be6('0x178'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x5c')]['belongsToMany'](db[_0x8be6('0x179')],{'through':_0x8be6('0x197'),'as':_0x8be6('0x17a')});db[_0x8be6('0x5c')][_0x8be6('0x12e')](db[_0x8be6('0x179')],{'through':_0x8be6('0x197'),'as':'ThroughTags'});db[_0x8be6('0x5c')][_0x8be6('0x12e')](db[_0x8be6('0x13')],{'as':_0x8be6('0x17d'),'through':_0x8be6('0x13a'),'foreignKey':'OpenchannelInteractionId'});db[_0x8be6('0x194')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'onDelete':_0x8be6('0x14c'),'as':_0x8be6('0x13')});db[_0x8be6('0x194')][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'onDelete':'cascade','as':_0x8be6('0x165')});db[_0x8be6('0x194')][_0x8be6('0x12c')](db[_0x8be6('0x5c')],{'onDelete':_0x8be6('0x14c'),'as':_0x8be6('0x180'),'foreignKey':_0x8be6('0x198')});db[_0x8be6('0x194')]['belongsTo'](db[_0x8be6('0xf2')],{'as':_0x8be6('0xf2'),'foreignKey':_0x8be6('0x189')});db[_0x8be6('0x194')][_0x8be6('0x12c')](db[_0x8be6('0x5a')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x8be6('0x5f')]['belongsToMany'](db['User'],{'as':_0x8be6('0x15a'),'through':_0x8be6('0x141'),'foreignKey':_0x8be6('0x196')});db[_0x8be6('0x5f')][_0x8be6('0x12e')](db[_0x8be6('0xec')],{'through':_0x8be6('0x199'),'as':_0x8be6('0x15b')});db[_0x8be6('0x61')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0x8be6('0x14c')});db[_0x8be6('0x61')][_0x8be6('0x11f')](db[_0x8be6('0x16e')],{'as':'Answers','foreignKey':_0x8be6('0x181')});db['ChatWebsite']['hasMany'](db[_0x8be6('0x6e')],{'as':_0x8be6('0x19a')});db[_0x8be6('0x61')][_0x8be6('0x11f')](db[_0x8be6('0x124')],{'as':'Interactions'});db['ChatWebsite'][_0x8be6('0x11f')](db[_0x8be6('0x63')],{'as':'Applications'});db['ChatWebsite'][_0x8be6('0x11f')](db[_0x8be6('0x66')],{'as':'Messages'});db[_0x8be6('0x61')][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':_0x8be6('0x173'),'foreignKey':_0x8be6('0x183')});db[_0x8be6('0x61')][_0x8be6('0x12c')](db[_0x8be6('0x82')],{'as':_0x8be6('0x82'),'foreignKey':'IntervalId'});db[_0x8be6('0x61')][_0x8be6('0x12c')](db['MailAccount'],{'as':_0x8be6('0x3d'),'foreignKey':'MailAccountId'});db[_0x8be6('0x61')]['belongsTo'](db[_0x8be6('0x84')],{'as':_0x8be6('0x175'),'foreignKey':_0x8be6('0x158')});db['ChatWebsite'][_0x8be6('0x12e')](db['User'],{'as':'Agents','through':_0x8be6('0x144')});db['OpenchannelQueueReport']['belongsTo'](db[_0x8be6('0x5a')],{});db[_0x8be6('0x19b')][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':_0x8be6('0x173'),'foreignKey':_0x8be6('0x183')});db[_0x8be6('0x19b')][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'as':'Contact','foreignKey':_0x8be6('0x166')});db[_0x8be6('0x19b')]['belongsTo'](db[_0x8be6('0x5c')],{});db[_0x8be6('0x19b')][_0x8be6('0x12c')](db['OpenchannelMessage'],{});db[_0x8be6('0x19b')][_0x8be6('0x12c')](db['User'],{});db[_0x8be6('0x19b')][_0x8be6('0x12c')](db[_0x8be6('0x5f')],{});db['ChatApplication'][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'as':'Agent','foreignKey':_0x8be6('0x11d'),'onDelete':_0x8be6('0x169')});db['ChatApplication']['belongsTo'](db[_0x8be6('0x6a')],{'as':'Queue','foreignKey':_0x8be6('0x19c'),'onDelete':_0x8be6('0x169')});db[_0x8be6('0x63')][_0x8be6('0x12c')](db[_0x8be6('0x61')],{'as':_0x8be6('0x19d'),'foreignKey':_0x8be6('0x181'),'onDelete':_0x8be6('0x169')});db[_0x8be6('0x63')][_0x8be6('0x12c')](db[_0x8be6('0x179')],{'onDelete':'restrict','foreignKey':_0x8be6('0x18d')});db['ChatInteraction']['hasMany'](db[_0x8be6('0x66')],{'as':_0x8be6('0x15f'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x19e')});db[_0x8be6('0x124')][_0x8be6('0x12c')](db[_0x8be6('0x61')],{'as':'Account','foreignKey':_0x8be6('0x181')});db['ChatInteraction'][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'as':'Contact','foreignKey':_0x8be6('0x166')});db[_0x8be6('0x124')][_0x8be6('0x12c')](db['User'],{'as':_0x8be6('0x178'),'foreignKey':'UserId'});db[_0x8be6('0x124')]['belongsToMany'](db[_0x8be6('0x179')],{'through':_0x8be6('0x19f'),'as':_0x8be6('0x17a')});db[_0x8be6('0x124')]['belongsToMany'](db[_0x8be6('0x179')],{'through':_0x8be6('0x19f'),'as':_0x8be6('0x17c')});db[_0x8be6('0x124')]['belongsToMany'](db[_0x8be6('0x13')],{'as':'Users','through':_0x8be6('0x136'),'foreignKey':_0x8be6('0x19e')});db[_0x8be6('0x66')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'onDelete':_0x8be6('0x14c'),'as':_0x8be6('0x13')});db[_0x8be6('0x66')][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'onDelete':_0x8be6('0x14c'),'as':'Contact','foreignKey':_0x8be6('0x166')});db[_0x8be6('0x66')][_0x8be6('0x12c')](db[_0x8be6('0x124')],{'onDelete':_0x8be6('0x14c'),'as':'Interaction','foreignKey':_0x8be6('0x19e')});db[_0x8be6('0x66')][_0x8be6('0x12c')](db['Attachment'],{'as':_0x8be6('0xf2'),'foreignKey':_0x8be6('0x189')});db[_0x8be6('0x66')][_0x8be6('0x12c')](db[_0x8be6('0x61')],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x181')});db[_0x8be6('0x68')][_0x8be6('0x11f')](db[_0x8be6('0xf2')],{'as':_0x8be6('0x17f'),'foreignKey':_0x8be6('0x182'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0x8be6('0x71')],{'onDelete':_0x8be6('0x14c'),'as':_0x8be6('0x165'),'foreignKey':_0x8be6('0x166')});db[_0x8be6('0x68')][_0x8be6('0x12c')](db[_0x8be6('0x61')],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x181')});db['ChatQueue'][_0x8be6('0x12e')](db['User'],{'as':_0x8be6('0x15a'),'through':'UserChatQueue','hooks':!![]});db[_0x8be6('0x6a')][_0x8be6('0x12e')](db['Team'],{'through':_0x8be6('0x1a0'),'as':_0x8be6('0x15b')});db[_0x8be6('0x6c')][_0x8be6('0x11f')](db[_0x8be6('0xd4')],{'as':_0x8be6('0x15f'),'foreignKey':_0x8be6('0x1a1'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0x6c')][_0x8be6('0x12e')](db[_0x8be6('0x13')],{'as':'Members','through':_0x8be6('0x1a2')});db[_0x8be6('0x6e')][_0x8be6('0x12c')](db[_0x8be6('0x61')],{'as':_0x8be6('0x19d'),'foreignKey':_0x8be6('0x181')});db[_0x8be6('0x6f')][_0x8be6('0x11f')](db['CmContact'],{'as':_0x8be6('0x12f'),'foreignKey':_0x8be6('0x1a3')});db[_0x8be6('0x71')][_0x8be6('0x11f')](db[_0x8be6('0x8f')],{'as':_0x8be6('0x1a4'),'foreignKey':_0x8be6('0x1a5')});db['CmContact'][_0x8be6('0x11f')](db[_0x8be6('0x73')],{'as':_0x8be6('0x150'),'foreignKey':_0x8be6('0x166')});db[_0x8be6('0x71')][_0x8be6('0x11f')](db[_0x8be6('0x76')],{'as':_0x8be6('0x121'),'foreignKey':'ContactId'});db[_0x8be6('0x71')][_0x8be6('0x11f')](db[_0x8be6('0x78')],{'as':_0x8be6('0x151'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0x8be6('0x79')],{'as':_0x8be6('0x79'),'foreignKey':'ContactId'});db[_0x8be6('0x71')]['hasMany'](db[_0x8be6('0xd9')],{'as':_0x8be6('0x153'),'foreignKey':_0x8be6('0x166')});db['CmContact'][_0x8be6('0x11f')](db[_0x8be6('0x5c')],{'as':_0x8be6('0x123'),'foreignKey':_0x8be6('0x166'),'onDelete':_0x8be6('0x169')});db[_0x8be6('0x71')][_0x8be6('0x11f')](db[_0x8be6('0x124')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0x8be6('0x169')});db[_0x8be6('0x71')][_0x8be6('0x11f')](db[_0x8be6('0x138')],{'as':_0x8be6('0x126'),'foreignKey':'ContactId','onDelete':_0x8be6('0x169')});db[_0x8be6('0x71')][_0x8be6('0x11f')](db[_0x8be6('0x4d')],{'as':_0x8be6('0x127'),'foreignKey':_0x8be6('0x166'),'onDelete':_0x8be6('0x169')});db[_0x8be6('0x71')][_0x8be6('0x11f')](db['MailInteraction'],{'as':_0x8be6('0x134'),'foreignKey':_0x8be6('0x166'),'onDelete':_0x8be6('0x169')});db[_0x8be6('0x71')]['belongsTo'](db[_0x8be6('0x6f')],{'as':'Company','foreignKey':_0x8be6('0x1a3')});db[_0x8be6('0x71')][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':_0x8be6('0x173'),'foreignKey':_0x8be6('0x183'),'onDelete':_0x8be6('0x14c')});db['CmContact'][_0x8be6('0x12e')](db[_0x8be6('0x13')],{'as':_0x8be6('0x17d'),'through':'cm_user_has_contacts'});db[_0x8be6('0x71')][_0x8be6('0x12e')](db[_0x8be6('0x179')],{'as':_0x8be6('0x17a'),'through':'cm_contact_has_tags'});db[_0x8be6('0x71')][_0x8be6('0x12e')](db['Tag'],{'through':_0x8be6('0x1a6'),'as':_0x8be6('0x17c')});db[_0x8be6('0x73')][_0x8be6('0x11f')](db[_0x8be6('0x90')],{'as':_0x8be6('0x1a7'),'foreignKey':_0x8be6('0x1a8')});db[_0x8be6('0x73')][_0x8be6('0x12c')](db['CmContact'],{'as':_0x8be6('0x165'),'foreignKey':'ContactId','onDelete':_0x8be6('0x14c')});db[_0x8be6('0x73')]['belongsTo'](db['CmList'],{'as':_0x8be6('0x173'),'foreignKey':_0x8be6('0x183'),'onDelete':_0x8be6('0x14c')});db['CmHopper'][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'as':_0x8be6('0x1a9'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x73')][_0x8be6('0x12c')](db[_0x8be6('0x1c')],{'as':_0x8be6('0x1aa'),'foreignKey':_0x8be6('0x14f'),'onDelete':'cascade'});db[_0x8be6('0x73')]['belongsTo'](db['Campaign'],{'as':_0x8be6('0xee'),'foreignKey':_0x8be6('0x1ab'),'onDelete':'cascade'});db[_0x8be6('0x73')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'as':_0x8be6('0x178'),'foreignKey':_0x8be6('0x1ac')});db[_0x8be6('0x75')][_0x8be6('0x12c')](db['CmContact'],{'as':_0x8be6('0x165'),'foreignKey':_0x8be6('0x166'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0x75')][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':_0x8be6('0x173'),'foreignKey':'ListId','onDelete':_0x8be6('0x14c')});db[_0x8be6('0x75')]['belongsTo'](db[_0x8be6('0x1c')],{'as':_0x8be6('0x1aa'),'foreignKey':_0x8be6('0x14f'),'onDelete':'cascade'});db[_0x8be6('0x75')][_0x8be6('0x12c')](db['Campaign'],{'as':_0x8be6('0xee'),'foreignKey':_0x8be6('0x1ab'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0x1ad')][_0x8be6('0x11f')](db[_0x8be6('0x81')],{'as':{'plural':_0x8be6('0x1ae'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0x8be6('0x14c'),'hooks':!![]});db[_0x8be6('0x1ad')]['hasMany'](db['Condition'],{'as':{'plural':_0x8be6('0x1af'),'singular':'OneAny'},'foreignKey':_0x8be6('0x1b0'),'onDelete':'cascade','hooks':!![]});db[_0x8be6('0x1ad')][_0x8be6('0x11f')](db['Action'],{'as':'Actions','foreignKey':_0x8be6('0x1b1'),'onDelete':_0x8be6('0x14c'),'hooks':!![]});db['Disposition'][_0x8be6('0x11f')](db['Disposition'],{'as':_0x8be6('0x16d'),'foreignKey':_0x8be6('0x1b2'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0x82')][_0x8be6('0x11f')](db[_0x8be6('0x82')],{'as':_0x8be6('0x1b3'),'foreignKey':_0x8be6('0x157'),'onDelete':_0x8be6('0x14c'),'hooks':!![],'required':![]});db[_0x8be6('0x82')][_0x8be6('0x11f')](db[_0x8be6('0x19')],{'as':_0x8be6('0x1b4'),'foreignKey':_0x8be6('0x157'),'onDelete':_0x8be6('0x169')});db['Interval'][_0x8be6('0x11f')](db['MailApplication'],{'as':_0x8be6('0x1b5'),'foreignKey':_0x8be6('0x157')});db[_0x8be6('0x82')]['hasMany'](db[_0x8be6('0x63')],{'as':'ChatApplications','foreignKey':_0x8be6('0x157')});db[_0x8be6('0x82')][_0x8be6('0x11f')](db[_0x8be6('0x4c')],{'as':_0x8be6('0x1b6'),'foreignKey':_0x8be6('0x157')});db['Interval'][_0x8be6('0x11f')](db['SmsApplication'],{'as':_0x8be6('0x1b7'),'foreignKey':_0x8be6('0x157')});db[_0x8be6('0x88')][_0x8be6('0x12c')](db[_0x8be6('0x3d')],{});db[_0x8be6('0x88')][_0x8be6('0x12c')](db['AnalyticDefaultReport'],{'foreignKey':_0x8be6('0x1b8')});db['Schedule'][_0x8be6('0x12c')](db['AnalyticCustomReport'],{'foreignKey':_0x8be6('0x1b9')});db['Sound'][_0x8be6('0x12e')](db[_0x8be6('0x1b')],{'as':_0x8be6('0x1ba'),'through':_0x8be6('0x1bb'),'onDelete':'restrict'});db[_0x8be6('0x179')][_0x8be6('0x12e')](db[_0x8be6('0x71')],{'through':'cm_contact_has_tags'});db['Tag'][_0x8be6('0x12e')](db[_0x8be6('0x124')],{'through':_0x8be6('0x19f')});db[_0x8be6('0x179')][_0x8be6('0x12e')](db[_0x8be6('0x128')],{'through':'mail_interaction_has_tags'});db[_0x8be6('0x179')][_0x8be6('0x12e')](db[_0x8be6('0x138')],{'through':_0x8be6('0x18f')});db[_0x8be6('0x179')][_0x8be6('0x12e')](db[_0x8be6('0x4d')],{'through':_0x8be6('0x187')});db[_0x8be6('0x179')][_0x8be6('0x12e')](db[_0x8be6('0x5c')],{'through':_0x8be6('0x197')});db[_0x8be6('0x179')][_0x8be6('0x12e')](db[_0x8be6('0x10e')],{'through':_0x8be6('0x1bc')});db[_0x8be6('0x8f')]['belongsTo'](db[_0x8be6('0x8d')],{'as':_0x8be6('0x1bd'),'foreignKey':_0x8be6('0x1be')});db[_0x8be6('0x90')][_0x8be6('0x12c')](db[_0x8be6('0x73')],{'as':'Hopper','foreignKey':'CmHopperId'});db[_0x8be6('0x8f')][_0x8be6('0x12c')](db['CmContact'],{'as':'Contact','foreignKey':_0x8be6('0x1a5')});db[_0x8be6('0x93')][_0x8be6('0x11f')](db[_0x8be6('0x81')],{'as':{'plural':_0x8be6('0x1bf'),'singular':_0x8be6('0x1c0')},'foreignKey':'TriggerAllId','onDelete':_0x8be6('0x14c'),'hooks':!![]});db[_0x8be6('0x93')][_0x8be6('0x11f')](db['Condition'],{'as':{'plural':_0x8be6('0x1c1'),'singular':'AnyCondition'},'foreignKey':_0x8be6('0x1c2'),'onDelete':'cascade','hooks':!![]});db[_0x8be6('0x93')]['hasMany'](db[_0x8be6('0x7d')],{'as':_0x8be6('0x1c3'),'foreignKey':_0x8be6('0x1c4'),'onDelete':_0x8be6('0x14c'),'hooks':!![]});db[_0x8be6('0x99')][_0x8be6('0x11f')](db[_0x8be6('0xa0')],{'as':_0x8be6('0x1c5'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1b9'),'hooks':!![]});db['AnalyticDefaultReport'][_0x8be6('0x11f')](db[_0x8be6('0xa0')],{'as':_0x8be6('0x1c5'),'onDelete':'cascade','foreignKey':_0x8be6('0x1b8')});db[_0x8be6('0x1c6')][_0x8be6('0x11f')](db['AnalyticFieldReport'],{'as':_0x8be6('0x1c5'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1c7')});db['AnalyticFieldReport'][_0x8be6('0x12c')](db[_0x8be6('0x1c6')],{'foreignKey':_0x8be6('0x1c7')});db[_0x8be6('0xa4')][_0x8be6('0x11f')](db['SalesforceConfiguration'],{'as':_0x8be6('0x1c8'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xa6')][_0x8be6('0x11f')](db[_0x8be6('0x1ca')],{'as':'Subjects','onDelete':_0x8be6('0x14c'),'foreignKey':'SubjectId'});db[_0x8be6('0xa6')][_0x8be6('0x11f')](db[_0x8be6('0x1ca')],{'as':_0x8be6('0x1cb'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1cc')});db[_0x8be6('0xa6')][_0x8be6('0x11f')](db[_0x8be6('0x1ca')],{'as':_0x8be6('0x1c5'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1cd')});db['SalesforceConfiguration'][_0x8be6('0x12c')](db[_0x8be6('0xa4')],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0x1ca')]['hasMany'](db[_0x8be6('0x1ca')],{'as':'Subject','foreignKey':'SubjectId'});db['SalesforceField'][_0x8be6('0x11f')](db[_0x8be6('0x1ca')],{'as':_0x8be6('0x1ce'),'foreignKey':_0x8be6('0x1cc')});db[_0x8be6('0x1ca')][_0x8be6('0x11f')](db['SalesforceField'],{'as':_0x8be6('0x1cf'),'foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0x1ca')]['belongsTo'](db[_0x8be6('0x94')],{'as':_0x8be6('0x94'),'foreignKey':'VariableId'});db[_0x8be6('0xa9')][_0x8be6('0x11f')](db[_0x8be6('0xaa')],{'as':_0x8be6('0x1c8'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xaa')][_0x8be6('0x11f')](db[_0x8be6('0xac')],{'as':_0x8be6('0x1d0'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1d1')});db['SugarcrmConfiguration'][_0x8be6('0x11f')](db[_0x8be6('0xac')],{'as':_0x8be6('0x1cb'),'onDelete':'cascade','foreignKey':_0x8be6('0x1cc')});db[_0x8be6('0xaa')][_0x8be6('0x11f')](db['SugarcrmField'],{'as':_0x8be6('0x1c5'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0xaa')][_0x8be6('0x12c')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xac')][_0x8be6('0x11f')](db['SugarcrmField'],{'as':_0x8be6('0x1d2'),'foreignKey':'SubjectId'});db[_0x8be6('0xac')][_0x8be6('0x11f')](db[_0x8be6('0xac')],{'as':_0x8be6('0x1ce'),'foreignKey':_0x8be6('0x1cc')});db[_0x8be6('0xac')]['hasMany'](db[_0x8be6('0xac')],{'as':_0x8be6('0x1cf'),'foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0xac')][_0x8be6('0x12c')](db[_0x8be6('0x94')],{'as':'Variable','foreignKey':_0x8be6('0x1d3')});db['DeskAccount']['hasMany'](db['DeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xb0')]['hasMany'](db['DeskField'],{'as':_0x8be6('0x1d0'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0xb0')][_0x8be6('0x11f')](db[_0x8be6('0x1d4')],{'as':_0x8be6('0x1cb'),'onDelete':_0x8be6('0x14c'),'foreignKey':'DescriptionId'});db[_0x8be6('0xb0')][_0x8be6('0x11f')](db[_0x8be6('0x1d4')],{'as':_0x8be6('0x1c5'),'onDelete':_0x8be6('0x14c'),'foreignKey':'FieldId'});db[_0x8be6('0xb0')][_0x8be6('0x12c')](db['DeskAccount'],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xb0')][_0x8be6('0x12e')](db[_0x8be6('0x179')],{'through':'int_desk_configuration_has_tags'});db[_0x8be6('0x1d4')][_0x8be6('0x11f')](db[_0x8be6('0x1d4')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8be6('0x1d4')][_0x8be6('0x11f')](db[_0x8be6('0x1d4')],{'as':_0x8be6('0x1ce'),'foreignKey':_0x8be6('0x1cc')});db['DeskField']['hasMany'](db[_0x8be6('0x1d4')],{'as':_0x8be6('0x1cf'),'foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0x1d4')][_0x8be6('0x12c')](db['Variable'],{'as':_0x8be6('0x94'),'foreignKey':_0x8be6('0x1d3')});db[_0x8be6('0xb2')][_0x8be6('0x11f')](db[_0x8be6('0x1d5')],{'as':'Configurations','onDelete':_0x8be6('0x14c'),'foreignKey':'AccountId'});db[_0x8be6('0x1d5')][_0x8be6('0x11f')](db[_0x8be6('0xb4')],{'as':_0x8be6('0x1d0'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0x1d5')][_0x8be6('0x11f')](db[_0x8be6('0xb4')],{'as':_0x8be6('0x1cb'),'onDelete':'cascade','foreignKey':_0x8be6('0x1cc')});db['ZohoConfiguration'][_0x8be6('0x11f')](db['ZohoField'],{'as':_0x8be6('0x1c5'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0x1d5')][_0x8be6('0x12c')](db[_0x8be6('0xb2')],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xb4')][_0x8be6('0x11f')](db[_0x8be6('0xb4')],{'as':'Subject','foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0xb4')][_0x8be6('0x11f')](db[_0x8be6('0xb4')],{'as':_0x8be6('0x1ce'),'foreignKey':_0x8be6('0x1cc')});db['ZohoField']['hasMany'](db[_0x8be6('0xb4')],{'as':'Field','foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0xb4')][_0x8be6('0x12c')](db[_0x8be6('0x94')],{'as':'Variable','foreignKey':_0x8be6('0x1d3')});db[_0x8be6('0x1d6')][_0x8be6('0x11f')](db[_0x8be6('0xb6')],{'as':_0x8be6('0x1c8'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xb6')][_0x8be6('0x11f')](db[_0x8be6('0xb8')],{'as':_0x8be6('0x1d0'),'foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0xb6')][_0x8be6('0x11f')](db[_0x8be6('0xb8')],{'as':_0x8be6('0x1cb'),'foreignKey':_0x8be6('0x1cc')});db[_0x8be6('0xb6')][_0x8be6('0x11f')](db[_0x8be6('0xb8')],{'as':'Fields','foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0xb6')][_0x8be6('0x12c')](db[_0x8be6('0x1d6')],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x1c9')});db['ZendeskConfiguration']['belongsToMany'](db[_0x8be6('0x179')],{'through':'int_zendesk_configuration_has_tags'});db[_0x8be6('0xb8')][_0x8be6('0x11f')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0xb8')][_0x8be6('0x11f')](db[_0x8be6('0xb8')],{'as':'Description','foreignKey':_0x8be6('0x1cc')});db[_0x8be6('0xb8')][_0x8be6('0x11f')](db[_0x8be6('0xb8')],{'as':_0x8be6('0x1cf'),'foreignKey':'FieldId'});db[_0x8be6('0xb8')]['belongsTo'](db[_0x8be6('0x94')],{'as':_0x8be6('0x94'),'foreignKey':_0x8be6('0x1d3')});db['FreshdeskAccount']['hasMany'](db[_0x8be6('0xbc')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x8be6('0xbc')]['hasMany'](db[_0x8be6('0xbd')],{'as':_0x8be6('0x1d0'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1d1')});db['FreshdeskConfiguration'][_0x8be6('0x11f')](db[_0x8be6('0xbd')],{'as':'Descriptions','onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1cc')});db[_0x8be6('0xbc')][_0x8be6('0x11f')](db[_0x8be6('0xbd')],{'as':_0x8be6('0x1c5'),'onDelete':_0x8be6('0x14c'),'foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0x8be6('0x12c')](db['FreshdeskAccount'],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xbc')][_0x8be6('0x12e')](db[_0x8be6('0x179')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x8be6('0x11f')](db[_0x8be6('0xbd')],{'as':_0x8be6('0x1d2'),'foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0xbd')][_0x8be6('0x11f')](db[_0x8be6('0xbd')],{'as':'Description','foreignKey':_0x8be6('0x1cc')});db[_0x8be6('0xbd')]['hasMany'](db['FreshdeskField'],{'as':'Field','foreignKey':_0x8be6('0x1cd')});db['FreshdeskField'][_0x8be6('0x12c')](db[_0x8be6('0x94')],{'as':_0x8be6('0x94'),'foreignKey':'VariableId'});db['VtigerAccount'][_0x8be6('0x11f')](db[_0x8be6('0xbf')],{'as':_0x8be6('0x1c8'),'onDelete':_0x8be6('0x14c'),'foreignKey':'AccountId'});db[_0x8be6('0xbf')][_0x8be6('0x11f')](db[_0x8be6('0xc1')],{'as':_0x8be6('0x1d0'),'foreignKey':'SubjectId'});db['VtigerConfiguration'][_0x8be6('0x11f')](db[_0x8be6('0xc1')],{'as':_0x8be6('0x1cb'),'foreignKey':_0x8be6('0x1cc')});db['VtigerConfiguration'][_0x8be6('0x11f')](db[_0x8be6('0xc1')],{'as':_0x8be6('0x1c5'),'foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0xbf')][_0x8be6('0x12c')](db[_0x8be6('0xbe')],{'as':'Account','foreignKey':'AccountId'});db[_0x8be6('0xc1')]['hasMany'](db[_0x8be6('0xc1')],{'as':_0x8be6('0x1d2'),'foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0xc1')][_0x8be6('0x11f')](db[_0x8be6('0xc1')],{'as':'Description','foreignKey':_0x8be6('0x1cc')});db['VtigerField'][_0x8be6('0x11f')](db[_0x8be6('0xc1')],{'as':_0x8be6('0x1cf'),'foreignKey':_0x8be6('0x1cd')});db['VtigerField'][_0x8be6('0x12c')](db[_0x8be6('0x94')],{'as':'Variable','foreignKey':_0x8be6('0x1d3')});db[_0x8be6('0xc3')]['hasMany'](db[_0x8be6('0x1d7')],{'as':_0x8be6('0x1c8'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1c9')});db['ServicenowConfiguration'][_0x8be6('0x11f')](db[_0x8be6('0xc6')],{'as':'Subjects','foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0x1d7')]['hasMany'](db['ServicenowField'],{'as':'Descriptions','foreignKey':_0x8be6('0x1cc')});db['ServicenowConfiguration']['hasMany'](db[_0x8be6('0xc6')],{'as':_0x8be6('0x1c5'),'foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0x1d7')][_0x8be6('0x12c')](db[_0x8be6('0xc3')],{'as':'Account','foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xc6')]['hasMany'](db['ServicenowField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8be6('0xc6')][_0x8be6('0x11f')](db[_0x8be6('0xc6')],{'as':_0x8be6('0x1ce'),'foreignKey':'DescriptionId'});db[_0x8be6('0xc6')][_0x8be6('0x11f')](db['ServicenowField'],{'as':'Field','foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0xc6')][_0x8be6('0x12c')](db[_0x8be6('0x94')],{'as':_0x8be6('0x94'),'foreignKey':_0x8be6('0x1d3')});db[_0x8be6('0xc8')][_0x8be6('0x11f')](db['Dynamics365Configuration'],{'as':_0x8be6('0x1c8'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xc8')][_0x8be6('0x12c')](db[_0x8be6('0x116')],{'as':_0x8be6('0x116'),'foreignKey':_0x8be6('0x168')});db['Dynamics365Configuration'][_0x8be6('0x11f')](db[_0x8be6('0xcb')],{'as':'Subjects','onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0x1d8')]['hasMany'](db['Dynamics365Field'],{'as':_0x8be6('0x1cb'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1cc')});db[_0x8be6('0x1d8')][_0x8be6('0x11f')](db['Dynamics365Field'],{'as':_0x8be6('0x1c5'),'onDelete':_0x8be6('0x14c'),'foreignKey':'FieldId'});db[_0x8be6('0x1d8')][_0x8be6('0x12c')](db[_0x8be6('0xc8')],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xcb')][_0x8be6('0x11f')](db[_0x8be6('0xcb')],{'as':_0x8be6('0x1d2'),'foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0xcb')]['hasMany'](db[_0x8be6('0xcb')],{'as':_0x8be6('0x1ce'),'foreignKey':'DescriptionId'});db[_0x8be6('0xcb')][_0x8be6('0x11f')](db[_0x8be6('0xcb')],{'as':'Field','foreignKey':'FieldId'});db[_0x8be6('0xcb')][_0x8be6('0x12c')](db[_0x8be6('0x94')],{'as':_0x8be6('0x94'),'foreignKey':_0x8be6('0x1d3')});db[_0x8be6('0x1d9')][_0x8be6('0x11f')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x8be6('0x1c9')});db['FreshsalesConfiguration']['hasMany'](db[_0x8be6('0xcf')],{'as':_0x8be6('0x1d0'),'foreignKey':_0x8be6('0x1d1')});db[_0x8be6('0x1da')]['hasMany'](db[_0x8be6('0xcf')],{'as':_0x8be6('0x1cb'),'foreignKey':_0x8be6('0x1cc')});db[_0x8be6('0x1da')][_0x8be6('0x11f')](db[_0x8be6('0xcf')],{'as':_0x8be6('0x1c5'),'foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0x1da')]['belongsTo'](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0x8be6('0x1c9')});db[_0x8be6('0xcf')][_0x8be6('0x11f')](db[_0x8be6('0xcf')],{'as':_0x8be6('0x1d2'),'foreignKey':'SubjectId'});db[_0x8be6('0xcf')][_0x8be6('0x11f')](db[_0x8be6('0xcf')],{'as':_0x8be6('0x1ce'),'foreignKey':'DescriptionId'});db[_0x8be6('0xcf')][_0x8be6('0x11f')](db[_0x8be6('0xcf')],{'as':_0x8be6('0x1cf'),'foreignKey':_0x8be6('0x1cd')});db[_0x8be6('0xcf')][_0x8be6('0x12c')](db['Variable'],{'as':_0x8be6('0x94'),'foreignKey':'VariableId'});db['ChatQueueReport']['belongsTo'](db['ChatWebsite'],{});db[_0x8be6('0xd2')][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':'List','foreignKey':_0x8be6('0x183')});db['ChatQueueReport'][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'as':_0x8be6('0x165'),'foreignKey':_0x8be6('0x166')});db[_0x8be6('0xd2')]['belongsTo'](db[_0x8be6('0x124')],{});db[_0x8be6('0xd2')][_0x8be6('0x12c')](db[_0x8be6('0x66')],{});db['ChatQueueReport'][_0x8be6('0x12c')](db[_0x8be6('0x13')],{});db[_0x8be6('0xd2')][_0x8be6('0x12c')](db['ChatQueue'],{});db[_0x8be6('0xd4')]['belongsTo'](db[_0x8be6('0x13')],{'onDelete':'cascade','foreignKey':_0x8be6('0x1db')});db[_0x8be6('0xd4')]['belongsTo'](db[_0x8be6('0x13')],{'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x1dc')});db[_0x8be6('0xd9')][_0x8be6('0x11f')](db[_0x8be6('0xd7')],{'foreignKey':_0x8be6('0x1dd'),'onDelete':_0x8be6('0x14c')});db['JscriptySessionReport']['hasMany'](db[_0x8be6('0xd6')],{'foreignKey':_0x8be6('0x1dd'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0xdb')][_0x8be6('0x12c')](db[_0x8be6('0x53')],{});db['SmsQueueReport'][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':'List','foreignKey':_0x8be6('0x183')});db[_0x8be6('0xdb')][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'as':_0x8be6('0x165'),'foreignKey':'ContactId'});db[_0x8be6('0xdb')][_0x8be6('0x12c')](db[_0x8be6('0x138')],{});db['SmsQueueReport'][_0x8be6('0x12c')](db[_0x8be6('0x57')],{});db[_0x8be6('0xdb')]['belongsTo'](db['User'],{});db['SmsQueueReport'][_0x8be6('0x12c')](db[_0x8be6('0x190')],{});db[_0x8be6('0xe1')]['hasMany'](db[_0x8be6('0xd9')],{'foreignKey':_0x8be6('0x1de')});db[_0x8be6('0xe1')][_0x8be6('0x11f')](db['JscriptyQuestionReport'],{'foreignKey':_0x8be6('0x1de')});db['JscriptyProject'][_0x8be6('0x11f')](db[_0x8be6('0xd6')],{'foreignKey':_0x8be6('0x1de')});db[_0x8be6('0xec')][_0x8be6('0x12e')](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':_0x8be6('0x133')});db['Team'][_0x8be6('0x12e')](db[_0x8be6('0x1c')],{'through':'TeamVoiceQueue','as':_0x8be6('0x13c')});db[_0x8be6('0xec')][_0x8be6('0x12e')](db[_0x8be6('0x3e')],{'through':'team_has_mail_queues','as':_0x8be6('0x13d')});db[_0x8be6('0xec')][_0x8be6('0x12e')](db[_0x8be6('0x6a')],{'through':_0x8be6('0x1a0'),'as':_0x8be6('0x1df')});db[_0x8be6('0xec')][_0x8be6('0x12e')](db[_0x8be6('0x50')],{'through':'team_has_fax_queues','as':_0x8be6('0x13e')});db[_0x8be6('0xec')][_0x8be6('0x12e')](db[_0x8be6('0x190')],{'through':_0x8be6('0x192'),'as':_0x8be6('0x13f')});db[_0x8be6('0xec')][_0x8be6('0x12e')](db[_0x8be6('0x5f')],{'through':_0x8be6('0x199'),'as':_0x8be6('0x140')});db['Team'][_0x8be6('0x12e')](db['WhatsappQueue'],{'through':_0x8be6('0x1e0'),'as':_0x8be6('0x142')});db[_0x8be6('0xec')][_0x8be6('0x12e')](db[_0x8be6('0x100')],{'through':_0x8be6('0x1e1'),'as':_0x8be6('0x1e2')});db[_0x8be6('0xee')][_0x8be6('0x11f')](db[_0x8be6('0x73')],{'as':_0x8be6('0x150'),'foreignKey':'CampaignId'});db['Campaign'][_0x8be6('0x11f')](db[_0x8be6('0x76')],{'as':_0x8be6('0x121'),'foreignKey':'CampaignId'});db[_0x8be6('0xee')][_0x8be6('0x11f')](db[_0x8be6('0x78')],{'as':_0x8be6('0x151'),'foreignKey':_0x8be6('0x1ab')});db[_0x8be6('0xee')][_0x8be6('0x11f')](db['CmHopperBlack'],{'as':_0x8be6('0x152'),'foreignKey':_0x8be6('0x1ab')});db[_0x8be6('0xee')][_0x8be6('0x12c')](db['Trunk'],{'as':_0x8be6('0x2b'),'foreignKey':_0x8be6('0x154')});db['Campaign'][_0x8be6('0x12c')](db[_0x8be6('0x2b')],{'as':'TrunkBackup','foreignKey':_0x8be6('0x156')});db[_0x8be6('0xee')]['belongsTo'](db[_0x8be6('0x82')],{'as':_0x8be6('0x82'),'foreignKey':_0x8be6('0x157')});db[_0x8be6('0xee')]['belongsTo'](db[_0x8be6('0xe7')],{'as':_0x8be6('0xe7'),'foreignKey':'SquareProjectId'});db[_0x8be6('0xee')][_0x8be6('0x12e')](db[_0x8be6('0xfe')],{'as':_0x8be6('0x131'),'through':_0x8be6('0x1e3')});db[_0x8be6('0xee')][_0x8be6('0x12e')](db['CmList'],{'as':'BlackLists','through':_0x8be6('0x1e4')});db[_0x8be6('0xf2')]['belongsTo'](db[_0x8be6('0x68')],{'as':_0x8be6('0x68'),'foreignKey':_0x8be6('0x182')});db[_0x8be6('0xf6')][_0x8be6('0x12c')](db['MailMessage'],{});db[_0x8be6('0xf6')][_0x8be6('0x12c')](db[_0x8be6('0x128')],{});db[_0x8be6('0xf6')][_0x8be6('0x12c')](db['MailAccount'],{'foreignKey':_0x8be6('0x1e5'),'as':'FromAccount'});db[_0x8be6('0xf6')][_0x8be6('0x12c')](db['User'],{'foreignKey':_0x8be6('0x1e6'),'as':_0x8be6('0x1e7')});db['MailTransferReport']['belongsTo'](db[_0x8be6('0x13')],{'foreignKey':_0x8be6('0x1e8'),'as':_0x8be6('0x1e9')});db['MailTransferReport'][_0x8be6('0x12c')](db[_0x8be6('0x3e')],{'foreignKey':_0x8be6('0x1ea'),'as':_0x8be6('0x1eb')});db[_0x8be6('0xf6')][_0x8be6('0x12c')](db['MailAccount'],{'foreignKey':_0x8be6('0x1ec'),'as':_0x8be6('0x1ed')});db[_0x8be6('0xf7')][_0x8be6('0x12c')](db[_0x8be6('0x66')],{});db[_0x8be6('0xf7')][_0x8be6('0x12c')](db[_0x8be6('0x124')],{});db[_0x8be6('0xf7')][_0x8be6('0x12c')](db[_0x8be6('0x61')],{'foreignKey':_0x8be6('0x1ee'),'as':_0x8be6('0x1ef')});db[_0x8be6('0xf7')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'foreignKey':_0x8be6('0x1e6'),'as':'FromAgent'});db[_0x8be6('0xf7')]['belongsTo'](db[_0x8be6('0x13')],{'foreignKey':_0x8be6('0x1e8'),'as':_0x8be6('0x1e9')});db[_0x8be6('0xf7')][_0x8be6('0x12c')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x8be6('0x1eb')});db[_0x8be6('0xf7')][_0x8be6('0x12c')](db['ChatWebsite'],{'foreignKey':_0x8be6('0x1f0'),'as':_0x8be6('0x1ed')});db['FaxTransferReport']['belongsTo'](db['FaxMessage'],{});db[_0x8be6('0xf9')][_0x8be6('0x12c')](db[_0x8be6('0x4d')],{});db[_0x8be6('0xf9')][_0x8be6('0x12c')](db[_0x8be6('0x4a')],{'foreignKey':_0x8be6('0x1f1'),'as':_0x8be6('0x1ef')});db[_0x8be6('0xf9')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'foreignKey':_0x8be6('0x1e6'),'as':_0x8be6('0x1e7')});db['FaxTransferReport'][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'foreignKey':_0x8be6('0x1e8'),'as':_0x8be6('0x1e9')});db[_0x8be6('0xf9')][_0x8be6('0x12c')](db[_0x8be6('0x50')],{'foreignKey':'ToFaxQueueId','as':_0x8be6('0x1eb')});db[_0x8be6('0xf9')][_0x8be6('0x12c')](db[_0x8be6('0x4a')],{'foreignKey':'ToFaxAccountId','as':_0x8be6('0x1ed')});db[_0x8be6('0x1f2')][_0x8be6('0x12c')](db[_0x8be6('0x194')],{});db[_0x8be6('0x1f2')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x8be6('0x1f2')]['belongsTo'](db[_0x8be6('0x5a')],{'foreignKey':_0x8be6('0x1f3'),'as':_0x8be6('0x1ef')});db['OpenchannelTransferReport'][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'foreignKey':_0x8be6('0x1e6'),'as':_0x8be6('0x1e7')});db[_0x8be6('0x1f2')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'foreignKey':_0x8be6('0x1e8'),'as':_0x8be6('0x1e9')});db[_0x8be6('0x1f2')][_0x8be6('0x12c')](db[_0x8be6('0x5f')],{'foreignKey':_0x8be6('0x1f4'),'as':'ToQueue'});db[_0x8be6('0x1f2')][_0x8be6('0x12c')](db['OpenchannelAccount'],{'foreignKey':_0x8be6('0x1f5'),'as':_0x8be6('0x1ed')});db[_0x8be6('0xfc')]['belongsTo'](db[_0x8be6('0x57')],{});db[_0x8be6('0xfc')][_0x8be6('0x12c')](db['SmsInteraction'],{});db['SmsTransferReport'][_0x8be6('0x12c')](db[_0x8be6('0x53')],{'foreignKey':'FromSmsAccountId','as':_0x8be6('0x1ef')});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x8be6('0x1e7')});db[_0x8be6('0xfc')]['belongsTo'](db[_0x8be6('0x13')],{'foreignKey':_0x8be6('0x1e8'),'as':_0x8be6('0x1e9')});db[_0x8be6('0xfc')][_0x8be6('0x12c')](db[_0x8be6('0x190')],{'foreignKey':_0x8be6('0x1f6'),'as':_0x8be6('0x1eb')});db[_0x8be6('0xfc')]['belongsTo'](db[_0x8be6('0x53')],{'foreignKey':_0x8be6('0x1f7'),'as':_0x8be6('0x1ed')});db[_0x8be6('0xfe')][_0x8be6('0x11f')](db[_0x8be6('0x16c')],{'as':_0x8be6('0x16d'),'foreignKey':_0x8be6('0x183'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0xfe')][_0x8be6('0x11f')](db[_0x8be6('0x7b')],{'as':_0x8be6('0x1f8'),'foreignKey':_0x8be6('0x183')});db[_0x8be6('0xfe')][_0x8be6('0x11f')](db[_0x8be6('0x71')],{'as':_0x8be6('0x12f'),'onDelete':_0x8be6('0x14c'),'foreignKey':'ListId'});db[_0x8be6('0xfe')][_0x8be6('0x11f')](db[_0x8be6('0x76')],{'as':_0x8be6('0x121'),'foreignKey':_0x8be6('0x183')});db[_0x8be6('0xfe')][_0x8be6('0x11f')](db[_0x8be6('0x78')],{'as':_0x8be6('0x122'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0x8be6('0x79')],{'as':'ReportAgentPreview','foreignKey':_0x8be6('0x183')});db[_0x8be6('0xfe')][_0x8be6('0x12e')](db[_0x8be6('0x1c')],{'as':_0x8be6('0x1f9'),'through':_0x8be6('0x159')});db[_0x8be6('0xfe')][_0x8be6('0x12e')](db['User'],{'as':_0x8be6('0x15a'),'through':_0x8be6('0x132')});db[_0x8be6('0x100')][_0x8be6('0x11f')](db[_0x8be6('0x19')],{'as':_0x8be6('0x1b4'),'onDelete':'cascade'});db['VoicePrefix'][_0x8be6('0x12e')](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':_0x8be6('0x1fa')});db[_0x8be6('0x100')][_0x8be6('0x12e')](db['Team'],{'through':_0x8be6('0x1e1'),'as':_0x8be6('0x15b')});db[_0x8be6('0x102')]['hasMany'](db[_0x8be6('0x13')],{'as':_0x8be6('0x17d'),'foreignKey':_0x8be6('0x12d')});db[_0x8be6('0x102')][_0x8be6('0x11f')](db[_0x8be6('0x104')],{'as':_0x8be6('0x1fb'),'foreignKey':_0x8be6('0x12d'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0x104')][_0x8be6('0x11f')](db[_0x8be6('0x106')],{'as':_0x8be6('0x1fc'),'foreignKey':_0x8be6('0x1fd'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0x10a')]['hasMany'](db[_0x8be6('0x16c')],{'as':_0x8be6('0x16d'),'foreignKey':_0x8be6('0x1fe'),'onDelete':_0x8be6('0x14c')});db[_0x8be6('0x10a')][_0x8be6('0x11f')](db[_0x8be6('0x16e')],{'as':_0x8be6('0x16f'),'foreignKey':_0x8be6('0x1fe')});db[_0x8be6('0x10a')]['hasMany'](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0x8be6('0x1fe')});db[_0x8be6('0x10a')]['hasMany'](db['WhatsappInteraction'],{'as':_0x8be6('0x171')});db[_0x8be6('0x10a')][_0x8be6('0x11f')](db['WhatsappApplication'],{'as':_0x8be6('0x172')});db[_0x8be6('0x10a')][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':'List','foreignKey':_0x8be6('0x183')});db[_0x8be6('0x10a')][_0x8be6('0x12c')](db[_0x8be6('0x84')],{'as':_0x8be6('0x175'),'foreignKey':_0x8be6('0x158')});db['WhatsappAccount'][_0x8be6('0x12e')](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':_0x8be6('0x1ff')});db[_0x8be6('0x10c')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'onDelete':_0x8be6('0x169')});db[_0x8be6('0x10c')]['belongsTo'](db[_0x8be6('0x114')],{'onDelete':_0x8be6('0x169')});db['WhatsappApplication']['belongsTo'](db[_0x8be6('0x10a')],{'onDelete':_0x8be6('0x169')});db[_0x8be6('0x10c')]['belongsTo'](db['Interval'],{'onDelete':_0x8be6('0x169'),'foreignKey':_0x8be6('0x157')});db[_0x8be6('0x10c')][_0x8be6('0x12c')](db[_0x8be6('0x179')],{'onDelete':_0x8be6('0x169'),'foreignKey':_0x8be6('0x18d')});db[_0x8be6('0x10e')][_0x8be6('0x11f')](db[_0x8be6('0x10f')],{'as':_0x8be6('0x15f'),'onDelete':_0x8be6('0x14c'),'foreignKey':_0x8be6('0x200')});db[_0x8be6('0x10e')]['belongsTo'](db['WhatsappAccount'],{'as':_0x8be6('0x177'),'foreignKey':_0x8be6('0x1fe')});db['WhatsappInteraction'][_0x8be6('0x12c')](db[_0x8be6('0x71')],{'as':_0x8be6('0x165'),'foreignKey':'ContactId'});db[_0x8be6('0x10e')][_0x8be6('0x12c')](db['User'],{'as':_0x8be6('0x178'),'foreignKey':_0x8be6('0x11d')});db[_0x8be6('0x10e')][_0x8be6('0x12e')](db['Tag'],{'through':_0x8be6('0x1bc'),'as':_0x8be6('0x17a')});db[_0x8be6('0x10e')]['belongsToMany'](db[_0x8be6('0x179')],{'through':'whatsapp_interaction_has_tags','as':_0x8be6('0x17c')});db[_0x8be6('0x10e')][_0x8be6('0x12e')](db[_0x8be6('0x13')],{'as':_0x8be6('0x17d'),'through':_0x8be6('0x13b'),'foreignKey':_0x8be6('0x200')});db[_0x8be6('0x10f')][_0x8be6('0x12c')](db['User'],{'as':'User'});db['WhatsappMessage'][_0x8be6('0x12c')](db['CmContact'],{'onDelete':_0x8be6('0x14c'),'as':_0x8be6('0x165')});db[_0x8be6('0x10f')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x8be6('0x10f')][_0x8be6('0x12c')](db[_0x8be6('0x10a')],{'as':_0x8be6('0x177'),'foreignKey':'WhatsappAccountId'});db[_0x8be6('0x111')][_0x8be6('0x12c')](db[_0x8be6('0x10a')],{});db['WhatsappQueueReport'][_0x8be6('0x12c')](db[_0x8be6('0xfe')],{'as':'List','foreignKey':_0x8be6('0x183')});db[_0x8be6('0x111')][_0x8be6('0x12c')](db['CmContact'],{'as':_0x8be6('0x165'),'foreignKey':_0x8be6('0x166')});db['WhatsappQueueReport']['belongsTo'](db[_0x8be6('0x10e')],{});db[_0x8be6('0x111')][_0x8be6('0x12c')](db[_0x8be6('0x114')],{});db[_0x8be6('0x111')][_0x8be6('0x12c')](db[_0x8be6('0x10f')],{});db['WhatsappQueueReport'][_0x8be6('0x12c')](db['User'],{});db[_0x8be6('0x112')]['belongsTo'](db[_0x8be6('0x10f')],{});db[_0x8be6('0x112')][_0x8be6('0x12c')](db[_0x8be6('0x10e')],{});db[_0x8be6('0x112')][_0x8be6('0x12c')](db[_0x8be6('0x10a')],{'foreignKey':_0x8be6('0x201'),'as':_0x8be6('0x1ef')});db[_0x8be6('0x112')][_0x8be6('0x12c')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0x8be6('0x1ed')});db['WhatsappTransferReport'][_0x8be6('0x12c')](db[_0x8be6('0x114')],{'foreignKey':'ToQueueId','as':'ToQueue'});db[_0x8be6('0x112')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'foreignKey':_0x8be6('0x1e6'),'as':_0x8be6('0x1e7')});db['WhatsappTransferReport']['belongsTo'](db[_0x8be6('0x13')],{'foreignKey':_0x8be6('0x1e8'),'as':_0x8be6('0x1e9')});db[_0x8be6('0x114')]['belongsToMany'](db[_0x8be6('0x13')],{'as':_0x8be6('0x15a'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0x8be6('0x114')]['belongsToMany'](db['Team'],{'through':_0x8be6('0x1e0'),'as':_0x8be6('0x15b')});db[_0x8be6('0x11a')][_0x8be6('0x12c')](db[_0x8be6('0x13')],{'as':_0x8be6('0x202'),'foreignKey':_0x8be6('0x11d'),'onDelete':_0x8be6('0x14c'),'hooks':!![]});db[_0x8be6('0x116')]['hasOne'](db[_0x8be6('0xc8')],{'as':_0x8be6('0xc8'),'onDelete':_0x8be6('0x169')});db[_0x8be6('0x116')][_0x8be6('0x11c')](db[_0x8be6('0x39')],{'as':_0x8be6('0x16a'),'onDelete':_0x8be6('0x169')});db[_0x8be6('0x116')][_0x8be6('0x11c')](db[_0x8be6('0x3b')],{'as':_0x8be6('0x16b'),'onDelete':_0x8be6('0x169')});module[_0x8be6('0x203')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xb507=['../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','UserId','userSetting','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','UserNotification','UserNotifications','SenderId','belongsTo','Groups','chat_group_has_users','belongsToMany','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','ChatInteraction','user_has_chat_interactions','FaxInteraction','user_has_openchannel_interactions','WhatsappInteraction','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','TrunkBackup','TrunkBackupId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','ScreenRecording','VoiceMailMessage','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','restrict','CloudProviderId','Imap','Smtp','Dispositions','CannedAnswer','Answers','List','ListId','Template','TemplateId','mandatoryDispositionPause','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','Account','ChatWebsiteId','ChatOfflineMessage','IntervalId','TagId','Items','FaxAccount','FaxAccountId','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Agent','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessageId','ChatGroupId','CompanyId','Phones','CmContactId','cm_contact_has_tags','AdditionalPhones','Queue','CampaignId','OwnerId','Automation','All','OneAll','Any','OneAny','Actions','AutomationId','Intervals','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','CmHopperId','AllCondition','AnyConditions','AnyCondition','Fields','AnalyticDefaultReport','MetricId','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','SugarcrmConfiguration','VariableId','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowField','Dynamics365Configuration','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','team_has_whatsapp_queues','TeamVoicePrefix','TrunkId','Lists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToQueue','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','FromAgent','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Contacts','userProfileId','UserProfileResource','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','sequelize','jstz','defaultsDeep','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8_general_ci','sequelizeHistory','mysql','utf8','database','username','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','Action','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport'];(function(_0x197b35,_0xf6507c){var _0x442dc2=function(_0x333504){while(--_0x333504){_0x197b35['push'](_0x197b35['shift']());}};_0x442dc2(++_0xf6507c);}(_0xb507,0x12e));var _0x7b50=function(_0x529a0f,_0x328763){_0x529a0f=_0x529a0f-0x0;var _0x187a88=_0xb507[_0x529a0f];return _0x187a88;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x7b50('0x0'));var _=require('lodash');var jstz=require(_0x7b50('0x1'));var timezone=jstz['determine']();config[_0x7b50('0x0')]=_[_0x7b50('0x2')](config[_0x7b50('0x0')],{'database':'motion2','username':_0x7b50('0x3'),'password':_0x7b50('0x4'),'options':{'host':_0x7b50('0x5'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x7b50('0x6')},'logging':![],'timezone':timezone[_0x7b50('0x7')](),'define':{'charset':'utf8','collate':_0x7b50('0x8')}}});config[_0x7b50('0x9')]=_[_0x7b50('0x2')](config['sequelizeHistory'],{'database':'motion2','username':_0x7b50('0x3'),'password':'xC@LL1234','options':{'host':_0x7b50('0x5'),'port':0xcea,'dialect':_0x7b50('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x7b50('0x7')](),'define':{'charset':_0x7b50('0xb'),'collate':_0x7b50('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7b50('0x0')][_0x7b50('0xc')],config[_0x7b50('0x0')][_0x7b50('0xd')],config[_0x7b50('0x0')]['password'],config[_0x7b50('0x0')][_0x7b50('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x7b50('0xc')],config[_0x7b50('0x9')][_0x7b50('0xd')],config[_0x7b50('0x9')]['password'],config[_0x7b50('0x9')][_0x7b50('0xe')])};db[_0x7b50('0xf')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x11'));db[_0x7b50('0x12')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x13'));db[_0x7b50('0x14')]=db[_0x7b50('0x0')]['import']('../api/voiceContext/voiceContext.model');db[_0x7b50('0x15')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x16'));db['VoiceMusicOnHold']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x7b50('0x0')]['import'](_0x7b50('0x17'));db[_0x7b50('0x18')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x19'));db['ScreenRecording']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x1a'));db[_0x7b50('0x1b')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x1c'));db['VoiceMailMessage']=db[_0x7b50('0x0')]['import'](_0x7b50('0x1d'));db[_0x7b50('0x1e')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0x7b50('0x0')]['import'](_0x7b50('0x1f'));db[_0x7b50('0x20')]=db['sequelize'][_0x7b50('0x10')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x7b50('0x21')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x22'));db[_0x7b50('0x23')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x24'));db[_0x7b50('0x25')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x26'));db[_0x7b50('0x27')]=db['sequelize']['import'](_0x7b50('0x28'));db['UserVoiceQueueRt']=db[_0x7b50('0x0')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x7b50('0x29')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x2a'));db['UserChatQueue']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x2b'));db[_0x7b50('0x2c')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x2d'));db[_0x7b50('0x2e')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x2f'));db['UserSmsQueue']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x30'));db[_0x7b50('0x31')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x32'));db[_0x7b50('0x33')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x34'));db[_0x7b50('0x35')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x36'));db[_0x7b50('0x37')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x38'));db[_0x7b50('0x39')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x3a'));db[_0x7b50('0x3b')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x3c'));db['MailInteraction']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x3d'));db[_0x7b50('0x3e')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/mailMessage/mailMessage.model');db[_0x7b50('0x3f')]=db[_0x7b50('0x0')]['import']('../api/mailApplication/mailApplication.model');db[_0x7b50('0x40')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/mailQueueReport/mailQueueReport.model');db[_0x7b50('0x41')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x42'));db[_0x7b50('0x43')]=db['sequelize']['import'](_0x7b50('0x44'));db['FaxAccount']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x45'));db[_0x7b50('0x46')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x47'));db['FaxInteraction']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x48'));db[_0x7b50('0x49')]=db['sequelize'][_0x7b50('0x10')]('../api/faxMessage/faxMessage.model');db[_0x7b50('0x4a')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x4b'));db[_0x7b50('0x4c')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x4d'));db[_0x7b50('0x4e')]=db[_0x7b50('0x0')]['import']('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x4f'));db[_0x7b50('0x50')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x51'));db['SmsMessage']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/smsMessage/smsMessage.model');db[_0x7b50('0x52')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x53'));db['OpenchannelAccount']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x54'));db[_0x7b50('0x55')]=db['sequelize']['import'](_0x7b50('0x56'));db[_0x7b50('0x57')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x58'));db['OpenchannelMessage']=db[_0x7b50('0x0')]['import'](_0x7b50('0x59'));db[_0x7b50('0x5a')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x5b'));db['ChatWebsite']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x5c'));db[_0x7b50('0x5d')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x5e'));db[_0x7b50('0x5f')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x60'));db['ChatInteraction']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x61'));db[_0x7b50('0x62')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x63'));db['ChatOfflineMessage']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x64'));db[_0x7b50('0x65')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x66'));db[_0x7b50('0x67')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x68'));db[_0x7b50('0x69')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x6a'));db[_0x7b50('0x6b')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x6c'));db[_0x7b50('0x6d')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x6e'));db[_0x7b50('0x6f')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/cmHopper/cmHopper.model');db[_0x7b50('0x70')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x71'));db[_0x7b50('0x72')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x73'));db[_0x7b50('0x74')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x7b50('0x75')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/cmCustomField/cmCustomField.model');db[_0x7b50('0x76')]=db['sequelize']['import']('../api/action/action.model');db['Automation']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x77'));db['CannedAnswer']=db['sequelize'][_0x7b50('0x10')]('../api/cannedAnswer/cannedAnswer.model');db[_0x7b50('0x78')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x79'));db[_0x7b50('0x7a')]=db['sequelize'][_0x7b50('0x10')]('../api/condition/condition.model');db[_0x7b50('0x7b')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x7c'));db[_0x7b50('0x7d')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/pause/pause.model');db[_0x7b50('0x7e')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x7f'));db['VoiceQueuesLog']=db[_0x7b50('0x0')]['import'](_0x7b50('0x80'));db[_0x7b50('0x81')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x82'));db[_0x7b50('0x83')]=db['sequelize'][_0x7b50('0x10')]('../api/sound/sound.model');db['Tag']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x84'));db[_0x7b50('0x85')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x86'));db[_0x7b50('0x87')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x88'));db[_0x7b50('0x89')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db['Template']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x8a'));db[_0x7b50('0x8b')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x8c'));db[_0x7b50('0x8d')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x8e'));db[_0x7b50('0x8f')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x90'));db[_0x7b50('0x91')]=db['sequelize']['import'](_0x7b50('0x92'));db[_0x7b50('0x93')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x94'));db['AnalyticDefaultReport']=db['sequelize']['import'](_0x7b50('0x95'));db['AnalyticExtractedReport']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x96'));db[_0x7b50('0x97')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x98'));db[_0x7b50('0x99')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x9a'));db['AnalyticTreeReport']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x7b50('0x9b')]=db[_0x7b50('0x0')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x7b50('0x9c')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x9d'));db[_0x7b50('0x9e')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x9f'));db[_0x7b50('0xa0')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xa1'));db[_0x7b50('0xa2')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xa3'));db[_0x7b50('0xa4')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xa5'));db['DeskConfiguration']=db[_0x7b50('0x0')]['import'](_0x7b50('0xa6'));db['DeskField']=db[_0x7b50('0x0')]['import'](_0x7b50('0xa7'));db[_0x7b50('0xa8')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xa9'));db[_0x7b50('0xaa')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xab'));db[_0x7b50('0xac')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xad'));db[_0x7b50('0xae')]=db[_0x7b50('0x0')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0x7b50('0xaf')]=db['sequelize']['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xb0'));db[_0x7b50('0xb1')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xb2'));db[_0x7b50('0xb3')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xb4'));db[_0x7b50('0xb5')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xb6'));db['VtigerConfiguration']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xb7'));db[_0x7b50('0xb8')]=db['sequelize']['import'](_0x7b50('0xb9'));db[_0x7b50('0xba')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xbb'));db[_0x7b50('0xbc')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xbd'));db[_0x7b50('0xbe')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xbf'));db['Dynamics365Configuration']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x7b50('0xc0')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xc1'));db[_0x7b50('0xc2')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xc3'));db[_0x7b50('0xc4')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xc5'));db[_0x7b50('0xc6')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xc7'));db[_0x7b50('0x8f')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x90'));db[_0x7b50('0xc8')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xc9'));db[_0x7b50('0xca')]=db['sequelize']['import'](_0x7b50('0xcb'));db[_0x7b50('0xcc')]=db['sequelize']['import'](_0x7b50('0xcd'));db['JscriptyAnswerReport']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xce'));db[_0x7b50('0xcf')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x7b50('0xd0')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xd1'));db[_0x7b50('0xd2')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x7b50('0x0')]['import'](_0x7b50('0xd3'));db[_0x7b50('0xd4')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xd5'));db[_0x7b50('0xd6')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xd7'));db[_0x7b50('0xd8')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xd9'));db['SquareOdbc']=db[_0x7b50('0x0')]['import'](_0x7b50('0xda'));db['SquareProject']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xdb'));db[_0x7b50('0xdc')]=db['sequelize'][_0x7b50('0x10')]('../api/squareRecording/squareRecording.model');db[_0x7b50('0xdd')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xde'));db[_0x7b50('0xdf')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xe0'));db[_0x7b50('0xe1')]=db['sequelize'][_0x7b50('0x10')]('../api/license/license.model');db[_0x7b50('0xe2')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xe3'));db['Migration']=db[_0x7b50('0x0')]['import'](_0x7b50('0xe4'));db[_0x7b50('0xe5')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xe6'));db[_0x7b50('0xe7')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xe8'));db[_0x7b50('0xe9')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/mailTransferReport/mailTransferReport.model');db[_0x7b50('0xea')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xeb'));db[_0x7b50('0xec')]=db['sequelize']['import'](_0x7b50('0xed'));db[_0x7b50('0xee')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xef'));db[_0x7b50('0xf0')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xf1'));db[_0x7b50('0xf2')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xf3'));db[_0x7b50('0xf4')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xf5'));db[_0x7b50('0xf6')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xf7'));db[_0x7b50('0xf8')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xf9'));db['UserProfileResource']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xfa'));db['UserNotification']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/userNotification/userNotification.model');db[_0x7b50('0xfb')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xfc'));db[_0x7b50('0xfd')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xfe'));db['WhatsappInteraction']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xff'));db[_0x7b50('0x100')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x101'));db[_0x7b50('0x102')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x103'));db[_0x7b50('0x104')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x105'));db[_0x7b50('0x106')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x107'));db[_0x7b50('0x108')]=db['sequelize']['import'](_0x7b50('0x109'));db[_0x7b50('0x10a')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x10b'));db['TeamVoicePrefix']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x7b50('0x10c')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x10d'));db[_0x7b50('0x10e')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x10f'));db[_0x7b50('0xf')][_0x7b50('0x110')](db[_0x7b50('0x1b')],{'as':_0x7b50('0x1b'),'onDelete':'cascade','foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x110')](db['UserSetting'],{'as':_0x7b50('0x112'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x18')],{'as':'Recordings','foreignKey':_0x7b50('0x111')});db['User'][_0x7b50('0x113')](db[_0x7b50('0x114')],{'as':_0x7b50('0x115'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')]['hasMany'](db['VoiceExtension'],{'as':_0x7b50('0x116'),'onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x72')],{'as':_0x7b50('0x118'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x119')],{'as':_0x7b50('0x11a'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x74')],{'as':_0x7b50('0x74'),'foreignKey':'UserId'});db['User'][_0x7b50('0x113')](db['OpenchannelInteraction'],{'as':_0x7b50('0x11b'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db['ChatInteraction'],{'as':_0x7b50('0x11c'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db['SmsInteraction'],{'as':_0x7b50('0x11d'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db['FaxInteraction'],{'as':_0x7b50('0x11e'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x11f')],{'as':'MailInteractions','foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x120')],{'as':_0x7b50('0x121'),'foreignKey':_0x7b50('0x122')});db[_0x7b50('0xf')][_0x7b50('0x123')](db['UserProfile'],{'as':_0x7b50('0xf6'),'foreignKey':'userProfileId'});db[_0x7b50('0xf')]['belongsToMany'](db[_0x7b50('0x67')],{'as':_0x7b50('0x124'),'through':_0x7b50('0x125')});db[_0x7b50('0xf')][_0x7b50('0x126')](db['CmContact'],{'as':'Contacts','through':_0x7b50('0x127')});db['User'][_0x7b50('0x126')](db['CmList'],{'as':'Lists','through':_0x7b50('0x128')});db['User']['belongsToMany'](db['Team'],{'through':_0x7b50('0x129')});db[_0x7b50('0xf')]['belongsToMany'](db[_0x7b50('0x11f')],{'as':_0x7b50('0x12a'),'through':_0x7b50('0x12b')});db['User'][_0x7b50('0x126')](db[_0x7b50('0x12c')],{'as':'ChatInteractions','through':_0x7b50('0x12d')});db['User'][_0x7b50('0x126')](db[_0x7b50('0x12e')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x7b50('0xf')][_0x7b50('0x126')](db['SmsInteraction'],{'as':_0x7b50('0x11d'),'through':'user_has_sms_interactions'});db['User'][_0x7b50('0x126')](db['OpenchannelInteraction'],{'as':_0x7b50('0x11b'),'through':_0x7b50('0x12f')});db[_0x7b50('0xf')][_0x7b50('0x126')](db[_0x7b50('0x130')],{'as':_0x7b50('0x131'),'through':_0x7b50('0x132')});db[_0x7b50('0xf')][_0x7b50('0x126')](db[_0x7b50('0x133')],{'as':_0x7b50('0x134'),'through':_0x7b50('0x29'),'required':![]});db[_0x7b50('0xf')][_0x7b50('0x126')](db['VoicePrefix'],{'as':_0x7b50('0x135'),'through':_0x7b50('0x10c'),'required':![]});db[_0x7b50('0xf')][_0x7b50('0x126')](db['MailQueue'],{'as':_0x7b50('0x136'),'through':'UserMailQueue','required':![]});db[_0x7b50('0xf')][_0x7b50('0x126')](db[_0x7b50('0x65')],{'as':_0x7b50('0x137'),'through':_0x7b50('0x138'),'required':![],'hooks':!![]});db[_0x7b50('0xf')][_0x7b50('0x126')](db[_0x7b50('0x4a')],{'as':_0x7b50('0x139'),'through':_0x7b50('0x2e'),'required':![]});db['User'][_0x7b50('0x126')](db[_0x7b50('0x52')],{'as':_0x7b50('0x13a'),'through':_0x7b50('0x13b'),'required':![]});db[_0x7b50('0xf')][_0x7b50('0x126')](db['OpenchannelQueue'],{'as':_0x7b50('0x13c'),'through':_0x7b50('0x31'),'required':![]});db[_0x7b50('0xf')]['belongsToMany'](db['WhatsappQueue'],{'as':_0x7b50('0x13d'),'through':_0x7b50('0x13e'),'required':![]});db[_0x7b50('0xf')]['belongsToMany'](db['CmList'],{'through':_0x7b50('0x128')});db[_0x7b50('0xf')]['belongsToMany'](db[_0x7b50('0x13f')],{'as':_0x7b50('0x140'),'through':_0x7b50('0x141')});db[_0x7b50('0xf')][_0x7b50('0x126')](db['FaxAccount'],{'as':_0x7b50('0x142'),'through':_0x7b50('0x143')});db['User']['belongsToMany'](db[_0x7b50('0x37')],{'as':_0x7b50('0x144'),'through':'user_has_mail_accounts'});db[_0x7b50('0xf')][_0x7b50('0x126')](db['OpenchannelAccount'],{'as':_0x7b50('0x145'),'through':_0x7b50('0x146')});db[_0x7b50('0xf')][_0x7b50('0x126')](db[_0x7b50('0x4e')],{'as':_0x7b50('0x147'),'through':_0x7b50('0x148')});db[_0x7b50('0xf')][_0x7b50('0x126')](db['WhatsappAccount'],{'as':_0x7b50('0x149'),'through':_0x7b50('0x14a')});db[_0x7b50('0x12')][_0x7b50('0x113')](db[_0x7b50('0x15')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x7b50('0x14b')});db[_0x7b50('0x14')][_0x7b50('0x113')](db['VoiceExtension'],{'onDelete':_0x7b50('0x117')});db['VoiceExtension'][_0x7b50('0x113')](db[_0x7b50('0x15')],{'as':_0x7b50('0x14c'),'onDelete':'cascade'});db[_0x7b50('0x14d')][_0x7b50('0x126')](db[_0x7b50('0x83')],{'as':_0x7b50('0x14e'),'through':_0x7b50('0x14f')});db['VoiceQueue'][_0x7b50('0x113')](db[_0x7b50('0x114')],{'as':_0x7b50('0x150'),'foreignKey':_0x7b50('0x151')});db[_0x7b50('0x133')]['hasMany'](db[_0x7b50('0x6f')],{'as':_0x7b50('0x152'),'foreignKey':_0x7b50('0x151')});db[_0x7b50('0x133')][_0x7b50('0x113')](db[_0x7b50('0x72')],{'as':_0x7b50('0x118'),'foreignKey':'VoiceQueueId'});db[_0x7b50('0x133')][_0x7b50('0x113')](db['CmHopperHistory'],{'as':_0x7b50('0x153'),'foreignKey':_0x7b50('0x151')});db[_0x7b50('0x133')][_0x7b50('0x113')](db[_0x7b50('0x74')],{'as':_0x7b50('0x74'),'foreignKey':_0x7b50('0x151')});db[_0x7b50('0x133')][_0x7b50('0x113')](db[_0x7b50('0x70')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x7b50('0x133')]['hasMany'](db[_0x7b50('0xd0')],{'as':_0x7b50('0x154'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['belongsTo'](db[_0x7b50('0x25')],{'as':_0x7b50('0x25'),'foreignKey':'TrunkId'});db[_0x7b50('0x133')][_0x7b50('0x123')](db[_0x7b50('0x25')],{'as':_0x7b50('0x155'),'foreignKey':_0x7b50('0x156')});db['VoiceQueue'][_0x7b50('0x123')](db[_0x7b50('0x7b')],{'as':_0x7b50('0x7b'),'foreignKey':'IntervalId'});db[_0x7b50('0x133')]['belongsTo'](db[_0x7b50('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x7b50('0x157')});db[_0x7b50('0x133')][_0x7b50('0x126')](db[_0x7b50('0xf2')],{'as':'Lists','through':_0x7b50('0x158')});db[_0x7b50('0x133')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':'UserVoiceQueue'});db[_0x7b50('0x133')]['belongsToMany'](db[_0x7b50('0xdf')],{'as':_0x7b50('0x15a'),'through':_0x7b50('0x10a')});db[_0x7b50('0x133')][_0x7b50('0x126')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x15b'),'through':'voice_queues_has_cm_blacklists'});db[_0x7b50('0x18')]['belongsTo'](db[_0x7b50('0xf')],{'as':_0x7b50('0xf'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0x15c')]['belongsTo'](db[_0x7b50('0xf')],{'as':_0x7b50('0xf'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0x1b')][_0x7b50('0x113')](db[_0x7b50('0x15d')],{'as':_0x7b50('0x15e'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x7b50('0x15f')});db['VoiceMailMessage']['belongsTo'](db[_0x7b50('0x1b')],{'foreignKey':_0x7b50('0x160'),'targetKey':_0x7b50('0x15f')});db[_0x7b50('0x1e')][_0x7b50('0x113')](db[_0x7b50('0x21')],{'as':_0x7b50('0x161'),'foreignKey':_0x7b50('0x162'),'constraints':![]});db['VoiceCallReport'][_0x7b50('0x113')](db[_0x7b50('0x20')],{'as':_0x7b50('0x163'),'foreignKey':_0x7b50('0x162'),'constraints':![]});db['VoiceCallReport'][_0x7b50('0x123')](db[_0x7b50('0xf')],{'as':_0x7b50('0xf'),'foreignKey':'UserId'});db[_0x7b50('0x1e')]['belongsTo'](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['MailServerIn'][_0x7b50('0x123')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x7b50('0x166')});db[_0x7b50('0x33')][_0x7b50('0x123')](db[_0x7b50('0x108')],{'as':_0x7b50('0x108'),'foreignKey':'CloudProviderId','onDelete':_0x7b50('0x167')});db[_0x7b50('0x35')]['belongsTo'](db['MailAccount'],{'as':_0x7b50('0x37'),'foreignKey':_0x7b50('0x166')});db[_0x7b50('0x35')][_0x7b50('0x123')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x7b50('0x168'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x37')][_0x7b50('0x110')](db[_0x7b50('0x33')],{'as':_0x7b50('0x169'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x37')][_0x7b50('0x110')](db['MailServerOut'],{'as':_0x7b50('0x16a'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x37')][_0x7b50('0x113')](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':_0x7b50('0x166'),'onDelete':_0x7b50('0x117')});db['MailAccount'][_0x7b50('0x113')](db[_0x7b50('0x16c')],{'as':_0x7b50('0x16d'),'foreignKey':_0x7b50('0x166')});db[_0x7b50('0x37')]['hasMany'](db['MailMessage'],{'as':_0x7b50('0x15e'),'foreignKey':_0x7b50('0x166')});db[_0x7b50('0x37')][_0x7b50('0x113')](db[_0x7b50('0x11f')],{'as':'Interactions'});db[_0x7b50('0x37')]['hasMany'](db['MailApplication'],{'as':_0x7b50('0x14c')});db[_0x7b50('0x37')][_0x7b50('0x123')](db['CmList'],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0x37')][_0x7b50('0x123')](db['Template'],{'as':_0x7b50('0x170'),'foreignKey':_0x7b50('0x171')});db['MailAccount']['belongsTo'](db['Pause'],{'as':_0x7b50('0x172'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x173')});db[_0x7b50('0x39')]['belongsToMany'](db[_0x7b50('0xf')],{'as':'Agents','through':_0x7b50('0x2c')});db['MailQueue'][_0x7b50('0x126')](db[_0x7b50('0xdf')],{'through':_0x7b50('0x174'),'as':_0x7b50('0x15a')});db[_0x7b50('0x11f')][_0x7b50('0x113')](db['MailMessage'],{'as':_0x7b50('0x15e'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x175')});db[_0x7b50('0x11f')][_0x7b50('0x123')](db[_0x7b50('0x37')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x7b50('0x11f')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':'ContactId'});db[_0x7b50('0x11f')]['belongsTo'](db[_0x7b50('0xf')],{'as':_0x7b50('0x176'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0x11f')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x178'),'as':_0x7b50('0x179')});db[_0x7b50('0x11f')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x178'),'as':_0x7b50('0x17a')});db[_0x7b50('0x11f')]['belongsToMany'](db[_0x7b50('0xf')],{'as':_0x7b50('0x17b'),'through':_0x7b50('0x12b'),'foreignKey':_0x7b50('0x175')});db[_0x7b50('0x3e')][_0x7b50('0x113')](db[_0x7b50('0xe5')],{'as':_0x7b50('0x17c'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x3e')][_0x7b50('0x123')](db['User'],{'as':_0x7b50('0xf')});db[_0x7b50('0x3e')]['belongsTo'](db[_0x7b50('0x6d')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x164')});db[_0x7b50('0x3e')]['belongsTo'](db['MailInteraction'],{'as':_0x7b50('0x17d'),'foreignKey':_0x7b50('0x175')});db['MailMessage']['belongsTo'](db['MailAccount'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x166')});db['MailMessage'][_0x7b50('0x123')](db[_0x7b50('0x13f')],{'as':'ChatWebsite','foreignKey':_0x7b50('0x17f')});db['MailMessage'][_0x7b50('0x123')](db[_0x7b50('0x180')],{'as':_0x7b50('0x180'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0x3f')][_0x7b50('0x123')](db['MailQueue'],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0x3f')][_0x7b50('0x123')](db[_0x7b50('0x37')],{'onDelete':_0x7b50('0x167')});db['MailApplication']['belongsTo'](db[_0x7b50('0x7b')],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x181')});db[_0x7b50('0x3f')][_0x7b50('0x123')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x7b50('0x182')});db[_0x7b50('0x40')][_0x7b50('0x123')](db[_0x7b50('0x37')],{});db[_0x7b50('0x40')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':'List','foreignKey':_0x7b50('0x16f')});db['MailQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['MailQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x11f')],{});db['MailQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x3e')],{});db[_0x7b50('0x40')][_0x7b50('0x123')](db[_0x7b50('0xf')],{});db['MailQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x39')],{});db[_0x7b50('0x41')][_0x7b50('0x113')](db[_0x7b50('0x43')],{'as':_0x7b50('0x183'),'onDelete':'cascade'});db[_0x7b50('0x184')][_0x7b50('0x113')](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':_0x7b50('0x185'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x184')][_0x7b50('0x113')](db['CannedAnswer'],{'as':_0x7b50('0x16d'),'foreignKey':'FaxAccountId'});db[_0x7b50('0x184')][_0x7b50('0x113')](db[_0x7b50('0x12e')],{'as':_0x7b50('0x186')});db[_0x7b50('0x184')][_0x7b50('0x113')](db[_0x7b50('0x46')],{'as':_0x7b50('0x14c')});db[_0x7b50('0x184')][_0x7b50('0x113')](db[_0x7b50('0x15')],{'as':_0x7b50('0x187'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x184')]['hasMany'](db[_0x7b50('0x49')],{'as':_0x7b50('0x15e')});db[_0x7b50('0x184')][_0x7b50('0x123')](db['Trunk'],{'as':_0x7b50('0x25')});db[_0x7b50('0x184')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':'ListId'});db[_0x7b50('0x184')]['belongsTo'](db[_0x7b50('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x7b50('0x157')});db['FaxAccount'][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x143')});db[_0x7b50('0x46')]['belongsTo'](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0x46')][_0x7b50('0x123')](db[_0x7b50('0x4a')],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0x46')]['belongsTo'](db[_0x7b50('0x184')],{'onDelete':'restrict'});db[_0x7b50('0x46')]['belongsTo'](db['Tag'],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x182')});db[_0x7b50('0x12e')]['hasMany'](db['FaxMessage'],{'as':_0x7b50('0x15e'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x188')});db[_0x7b50('0x12e')]['belongsTo'](db['FaxAccount'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x185')});db[_0x7b50('0x12e')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['FaxInteraction'][_0x7b50('0x123')](db['User'],{'as':_0x7b50('0x176'),'foreignKey':'UserId'});db['FaxInteraction'][_0x7b50('0x126')](db['Tag'],{'through':_0x7b50('0x189'),'as':_0x7b50('0x179')});db[_0x7b50('0x12e')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db['FaxInteraction']['belongsToMany'](db[_0x7b50('0xf')],{'as':_0x7b50('0x17b'),'through':_0x7b50('0x18a'),'foreignKey':_0x7b50('0x188')});db[_0x7b50('0x49')]['belongsTo'](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0xf')});db['FaxMessage'][_0x7b50('0x123')](db['FaxInteraction'],{'as':_0x7b50('0x17d'),'foreignKey':_0x7b50('0x188')});db[_0x7b50('0x49')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'onDelete':_0x7b50('0x117'),'as':'Contact'});db[_0x7b50('0x49')][_0x7b50('0x123')](db[_0x7b50('0xe5')],{'as':'Attachment','foreignKey':_0x7b50('0x18b')});db[_0x7b50('0x49')][_0x7b50('0x123')](db['FaxAccount'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x185')});db[_0x7b50('0x4a')]['belongsToMany'](db[_0x7b50('0xf')],{'as':'Agents','through':_0x7b50('0x2e')});db[_0x7b50('0x4a')][_0x7b50('0x126')](db['Team'],{'through':_0x7b50('0x18c'),'as':_0x7b50('0x15a')});db[_0x7b50('0x4c')]['belongsTo'](db[_0x7b50('0x184')],{});db[_0x7b50('0x4c')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db['FaxQueueReport'][_0x7b50('0x123')](db['CmContact'],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x4c')]['belongsTo'](db[_0x7b50('0x12e')],{});db['FaxQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x49')],{});db['FaxQueueReport']['belongsTo'](db[_0x7b50('0xf')],{});db['FaxQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x4a')],{});db[_0x7b50('0x4e')][_0x7b50('0x113')](db['Disposition'],{'as':_0x7b50('0x16b'),'foreignKey':_0x7b50('0x18d'),'onDelete':'cascade'});db[_0x7b50('0x4e')][_0x7b50('0x113')](db[_0x7b50('0x16c')],{'as':_0x7b50('0x16d'),'foreignKey':_0x7b50('0x18d')});db[_0x7b50('0x4e')][_0x7b50('0x113')](db[_0x7b50('0x18e')],{'as':_0x7b50('0x15e'),'foreignKey':_0x7b50('0x18d')});db['SmsAccount'][_0x7b50('0x113')](db[_0x7b50('0x50')],{'as':_0x7b50('0x186')});db[_0x7b50('0x4e')][_0x7b50('0x113')](db['SmsApplication'],{'as':_0x7b50('0x14c')});db[_0x7b50('0x4e')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0x4e')][_0x7b50('0x123')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x7b50('0x157')});db[_0x7b50('0x4e')]['belongsToMany'](db['User'],{'as':_0x7b50('0x159'),'through':_0x7b50('0x148')});db[_0x7b50('0x18f')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':'restrict'});db[_0x7b50('0x18f')][_0x7b50('0x123')](db['SmsQueue'],{'onDelete':'restrict'});db[_0x7b50('0x18f')][_0x7b50('0x123')](db[_0x7b50('0x4e')],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0x18f')][_0x7b50('0x123')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x7b50('0x181')});db[_0x7b50('0x18f')][_0x7b50('0x123')](db[_0x7b50('0x177')],{'onDelete':'restrict','foreignKey':_0x7b50('0x182')});db[_0x7b50('0x50')][_0x7b50('0x113')](db[_0x7b50('0x18e')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x7b50('0x190')});db['SmsInteraction'][_0x7b50('0x123')](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x7b50('0x50')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x50')][_0x7b50('0x123')](db['User'],{'as':'Owner','foreignKey':_0x7b50('0x111')});db[_0x7b50('0x50')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x191'),'as':'Tags'});db[_0x7b50('0x50')]['belongsToMany'](db[_0x7b50('0x177')],{'through':'sms_interaction_has_tags','as':_0x7b50('0x17a')});db['SmsInteraction'][_0x7b50('0x126')](db['User'],{'as':_0x7b50('0x17b'),'through':_0x7b50('0x192'),'foreignKey':'SmsInteractionId'});db[_0x7b50('0x18e')][_0x7b50('0x123')](db['User'],{'as':_0x7b50('0xf')});db[_0x7b50('0x18e')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x164')});db['SmsMessage'][_0x7b50('0x123')](db[_0x7b50('0x50')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x17d'),'foreignKey':_0x7b50('0x190')});db[_0x7b50('0x18e')][_0x7b50('0x123')](db[_0x7b50('0x4e')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x18d')});db[_0x7b50('0x52')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x13b'),'foreignKey':_0x7b50('0x193')});db[_0x7b50('0x52')][_0x7b50('0x126')](db[_0x7b50('0xdf')],{'through':_0x7b50('0x194'),'as':'Teams'});db['OpenchannelAccount']['hasMany'](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0x7b50('0x195')][_0x7b50('0x113')](db[_0x7b50('0x16c')],{'as':_0x7b50('0x16d'),'foreignKey':_0x7b50('0x196')});db['OpenchannelAccount'][_0x7b50('0x113')](db[_0x7b50('0x57')],{'as':_0x7b50('0x186'),'foreignKey':_0x7b50('0x196')});db[_0x7b50('0x195')][_0x7b50('0x113')](db['OpenchannelMessage'],{'as':_0x7b50('0x15e'),'foreignKey':'OpenchannelAccountId'});db[_0x7b50('0x195')]['hasMany'](db['OpenchannelApplication'],{'as':_0x7b50('0x14c'),'foreignKey':'OpenchannelAccountId'});db[_0x7b50('0x195')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0x195')]['belongsTo'](db[_0x7b50('0x7d')],{'as':_0x7b50('0x172'),'foreignKey':_0x7b50('0x157')});db[_0x7b50('0x195')][_0x7b50('0x126')](db['User'],{'as':_0x7b50('0x159'),'through':_0x7b50('0x146')});db[_0x7b50('0x55')][_0x7b50('0x123')](db['User'],{'onDelete':_0x7b50('0x167')});db['OpenchannelApplication'][_0x7b50('0x123')](db[_0x7b50('0x5a')],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x197')});db[_0x7b50('0x55')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x196')});db[_0x7b50('0x55')][_0x7b50('0x123')](db[_0x7b50('0x7b')],{'onDelete':_0x7b50('0x167'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x7b50('0x123')](db[_0x7b50('0x177')],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x182')});db[_0x7b50('0x57')][_0x7b50('0x113')](db[_0x7b50('0x198')],{'as':'Messages','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x199')});db['OpenchannelInteraction'][_0x7b50('0x123')](db[_0x7b50('0x195')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x7b50('0x57')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x57')][_0x7b50('0x123')](db['User'],{'as':_0x7b50('0x176'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0x57')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x19a'),'as':_0x7b50('0x179')});db['OpenchannelInteraction']['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x7b50('0x17a')});db[_0x7b50('0x57')]['belongsToMany'](db[_0x7b50('0xf')],{'as':_0x7b50('0x17b'),'through':_0x7b50('0x12f'),'foreignKey':_0x7b50('0x199')});db[_0x7b50('0x198')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0xf')});db[_0x7b50('0x198')][_0x7b50('0x123')](db['CmContact'],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x164')});db[_0x7b50('0x198')]['belongsTo'](db[_0x7b50('0x57')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x17d'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x7b50('0x123')](db['Attachment'],{'as':_0x7b50('0xe5'),'foreignKey':_0x7b50('0x18b')});db[_0x7b50('0x198')][_0x7b50('0x123')](db[_0x7b50('0x195')],{'as':'Account','foreignKey':_0x7b50('0x196')});db[_0x7b50('0x5a')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':'UserOpenchannelQueue','foreignKey':_0x7b50('0x197')});db[_0x7b50('0x5a')]['belongsToMany'](db['Team'],{'through':_0x7b50('0x19b'),'as':_0x7b50('0x15a')});db[_0x7b50('0x13f')]['hasMany'](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0x7b50('0x13f')][_0x7b50('0x113')](db[_0x7b50('0x16c')],{'as':'Answers','foreignKey':_0x7b50('0x17f')});db[_0x7b50('0x13f')][_0x7b50('0x113')](db['ChatProactiveAction'],{'as':_0x7b50('0x19c')});db[_0x7b50('0x13f')]['hasMany'](db[_0x7b50('0x12c')],{'as':'Interactions'});db[_0x7b50('0x13f')]['hasMany'](db['ChatApplication'],{'as':_0x7b50('0x14c')});db[_0x7b50('0x13f')][_0x7b50('0x113')](db[_0x7b50('0x62')],{'as':_0x7b50('0x15e')});db[_0x7b50('0x13f')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0x13f')]['belongsTo'](db[_0x7b50('0x7b')],{'as':_0x7b50('0x7b'),'foreignKey':'IntervalId'});db[_0x7b50('0x13f')][_0x7b50('0x123')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x7b50('0x166')});db['ChatWebsite'][_0x7b50('0x123')](db[_0x7b50('0x7d')],{'as':_0x7b50('0x172'),'foreignKey':_0x7b50('0x157')});db[_0x7b50('0x13f')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x141')});db[_0x7b50('0x5d')]['belongsTo'](db[_0x7b50('0x195')],{});db[_0x7b50('0x5d')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db['OpenchannelQueueReport'][_0x7b50('0x123')](db['CmContact'],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x5d')][_0x7b50('0x123')](db[_0x7b50('0x57')],{});db[_0x7b50('0x5d')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x7b50('0x5d')][_0x7b50('0x123')](db[_0x7b50('0xf')],{});db[_0x7b50('0x5d')][_0x7b50('0x123')](db[_0x7b50('0x5a')],{});db['ChatApplication'][_0x7b50('0x123')](db[_0x7b50('0xf')],{'as':_0x7b50('0x19d'),'foreignKey':_0x7b50('0x111'),'onDelete':'restrict'});db[_0x7b50('0x5f')][_0x7b50('0x123')](db[_0x7b50('0x65')],{'as':'Queue','foreignKey':_0x7b50('0x19e'),'onDelete':_0x7b50('0x167')});db['ChatApplication'][_0x7b50('0x123')](db['ChatWebsite'],{'as':_0x7b50('0x19f'),'foreignKey':'ChatWebsiteId','onDelete':_0x7b50('0x167')});db[_0x7b50('0x5f')]['belongsTo'](db['Tag'],{'onDelete':_0x7b50('0x167'),'foreignKey':'TagId'});db['ChatInteraction'][_0x7b50('0x113')](db[_0x7b50('0x62')],{'as':_0x7b50('0x15e'),'onDelete':_0x7b50('0x117'),'foreignKey':'ChatInteractionId'});db[_0x7b50('0x12c')][_0x7b50('0x123')](db['ChatWebsite'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x17f')});db[_0x7b50('0x12c')][_0x7b50('0x123')](db['CmContact'],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x12c')][_0x7b50('0x123')](db['User'],{'as':'Owner','foreignKey':_0x7b50('0x111')});db[_0x7b50('0x12c')][_0x7b50('0x126')](db['Tag'],{'through':_0x7b50('0x1a0'),'as':_0x7b50('0x179')});db[_0x7b50('0x12c')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x1a0'),'as':_0x7b50('0x17a')});db[_0x7b50('0x12c')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':'Users','through':_0x7b50('0x12d'),'foreignKey':_0x7b50('0x1a1')});db[_0x7b50('0x62')][_0x7b50('0x123')](db['User'],{'onDelete':'cascade','as':_0x7b50('0xf')});db[_0x7b50('0x62')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['ChatMessage'][_0x7b50('0x123')](db[_0x7b50('0x12c')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x17d'),'foreignKey':_0x7b50('0x1a1')});db[_0x7b50('0x62')][_0x7b50('0x123')](db[_0x7b50('0xe5')],{'as':'Attachment','foreignKey':_0x7b50('0x18b')});db[_0x7b50('0x62')]['belongsTo'](db[_0x7b50('0x13f')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x17f')});db[_0x7b50('0x180')][_0x7b50('0x113')](db[_0x7b50('0xe5')],{'as':_0x7b50('0x17c'),'foreignKey':_0x7b50('0x1a2'),'onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0x180')]['belongsTo'](db[_0x7b50('0x6d')],{'onDelete':'cascade','as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['ChatOfflineMessage'][_0x7b50('0x123')](db['ChatWebsite'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x17f')});db[_0x7b50('0x65')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x138'),'hooks':!![]});db[_0x7b50('0x65')][_0x7b50('0x126')](db['Team'],{'through':'team_has_chat_queues','as':_0x7b50('0x15a')});db[_0x7b50('0x67')][_0x7b50('0x113')](db[_0x7b50('0xcc')],{'as':_0x7b50('0x15e'),'foreignKey':_0x7b50('0x1a3'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x67')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x150'),'through':_0x7b50('0x125')});db['ChatProactiveAction'][_0x7b50('0x123')](db[_0x7b50('0x13f')],{'as':_0x7b50('0x19f'),'foreignKey':_0x7b50('0x17f')});db['CmCompany'][_0x7b50('0x113')](db[_0x7b50('0x6d')],{'as':'Contacts','foreignKey':_0x7b50('0x1a4')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x87')],{'as':_0x7b50('0x1a5'),'foreignKey':_0x7b50('0x1a6')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x6f')],{'as':'Hoppers','foreignKey':_0x7b50('0x165')});db[_0x7b50('0x6d')]['hasMany'](db['CmHopperFinal'],{'as':_0x7b50('0x118'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x6d')]['hasMany'](db[_0x7b50('0x119')],{'as':_0x7b50('0x153'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x74')],{'as':_0x7b50('0x74'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0xd0')],{'as':_0x7b50('0x154'),'foreignKey':'ContactId'});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x57')],{'as':_0x7b50('0x11b'),'foreignKey':_0x7b50('0x165'),'onDelete':'restrict'});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x12c')],{'as':'ChatInteractions','foreignKey':_0x7b50('0x165'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x6d')]['hasMany'](db[_0x7b50('0x50')],{'as':_0x7b50('0x11d'),'foreignKey':_0x7b50('0x165'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db['FaxInteraction'],{'as':_0x7b50('0x11e'),'foreignKey':'ContactId','onDelete':_0x7b50('0x167')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x11f')],{'as':_0x7b50('0x12a'),'foreignKey':_0x7b50('0x165'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x6d')][_0x7b50('0x123')](db[_0x7b50('0x6b')],{'as':'Company','foreignKey':_0x7b50('0x1a4')});db[_0x7b50('0x6d')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':'ListId','onDelete':_0x7b50('0x117')});db[_0x7b50('0x6d')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':'Users','through':_0x7b50('0x127')});db[_0x7b50('0x6d')]['belongsToMany'](db[_0x7b50('0x177')],{'as':_0x7b50('0x179'),'through':_0x7b50('0x1a7')});db[_0x7b50('0x6d')]['belongsToMany'](db[_0x7b50('0x177')],{'through':'cm_contact_has_tags','as':_0x7b50('0x17a')});db[_0x7b50('0x6f')][_0x7b50('0x113')](db['CmHopperAdditionalPhone'],{'as':_0x7b50('0x1a8'),'foreignKey':'CmHopperId'});db[_0x7b50('0x6f')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':'Contact','foreignKey':_0x7b50('0x165'),'onDelete':'cascade'});db[_0x7b50('0x6f')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':'ListId','onDelete':_0x7b50('0x117')});db[_0x7b50('0x6f')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'as':_0x7b50('0x19d'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0x6f')]['belongsTo'](db[_0x7b50('0x133')],{'as':_0x7b50('0x1a9'),'foreignKey':_0x7b50('0x151'),'onDelete':_0x7b50('0x117')});db['CmHopper'][_0x7b50('0x123')](db[_0x7b50('0xe2')],{'as':'Campaign','foreignKey':_0x7b50('0x1aa'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x6f')]['belongsTo'](db[_0x7b50('0xf')],{'as':_0x7b50('0x176'),'foreignKey':_0x7b50('0x1ab')});db['CmHopperBlack'][_0x7b50('0x123')](db['CmContact'],{'as':'Contact','foreignKey':_0x7b50('0x165'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x70')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':'List','foreignKey':_0x7b50('0x16f'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x70')]['belongsTo'](db['VoiceQueue'],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x7b50('0x70')][_0x7b50('0x123')](db['Campaign'],{'as':_0x7b50('0xe2'),'foreignKey':_0x7b50('0x1aa'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x1ac')]['hasMany'](db[_0x7b50('0x7a')],{'as':{'plural':_0x7b50('0x1ad'),'singular':_0x7b50('0x1ae')},'foreignKey':'AutomationAllId','onDelete':_0x7b50('0x117'),'hooks':!![]});db['Automation']['hasMany'](db[_0x7b50('0x7a')],{'as':{'plural':_0x7b50('0x1af'),'singular':_0x7b50('0x1b0')},'foreignKey':'AutomationAnyId','onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0x1ac')][_0x7b50('0x113')](db[_0x7b50('0x76')],{'as':_0x7b50('0x1b1'),'foreignKey':_0x7b50('0x1b2'),'onDelete':_0x7b50('0x117'),'hooks':!![]});db['Disposition'][_0x7b50('0x113')](db[_0x7b50('0x78')],{'as':'Dispositions','foreignKey':'ParentId','onDelete':_0x7b50('0x117')});db[_0x7b50('0x7b')][_0x7b50('0x113')](db[_0x7b50('0x7b')],{'as':_0x7b50('0x1b3'),'foreignKey':'IntervalId','onDelete':_0x7b50('0x117'),'hooks':!![],'required':![]});db[_0x7b50('0x7b')][_0x7b50('0x113')](db[_0x7b50('0x15')],{'as':_0x7b50('0x116'),'foreignKey':_0x7b50('0x181'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x7b')][_0x7b50('0x113')](db[_0x7b50('0x3f')],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0x7b50('0x7b')][_0x7b50('0x113')](db[_0x7b50('0x5f')],{'as':_0x7b50('0x1b4'),'foreignKey':_0x7b50('0x181')});db['Interval'][_0x7b50('0x113')](db[_0x7b50('0x46')],{'as':_0x7b50('0x1b5'),'foreignKey':_0x7b50('0x181')});db['Interval'][_0x7b50('0x113')](db[_0x7b50('0x18f')],{'as':_0x7b50('0x1b6'),'foreignKey':_0x7b50('0x181')});db[_0x7b50('0x81')][_0x7b50('0x123')](db[_0x7b50('0x37')],{});db[_0x7b50('0x81')][_0x7b50('0x123')](db['AnalyticDefaultReport'],{'foreignKey':_0x7b50('0x1b7')});db[_0x7b50('0x81')][_0x7b50('0x123')](db[_0x7b50('0x93')],{'foreignKey':'CustomReportId'});db[_0x7b50('0x83')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x7b50('0x1b8'),'through':_0x7b50('0x14f'),'onDelete':'restrict'});db[_0x7b50('0x177')]['belongsToMany'](db[_0x7b50('0x6d')],{'through':_0x7b50('0x1a7')});db[_0x7b50('0x177')][_0x7b50('0x126')](db[_0x7b50('0x12c')],{'through':_0x7b50('0x1a0')});db[_0x7b50('0x177')][_0x7b50('0x126')](db['MailInteraction'],{'through':_0x7b50('0x178')});db[_0x7b50('0x177')]['belongsToMany'](db[_0x7b50('0x50')],{'through':_0x7b50('0x191')});db[_0x7b50('0x177')][_0x7b50('0x126')](db[_0x7b50('0x12e')],{'through':_0x7b50('0x189')});db[_0x7b50('0x177')][_0x7b50('0x126')](db[_0x7b50('0x57')],{'through':_0x7b50('0x19a')});db[_0x7b50('0x177')][_0x7b50('0x126')](db[_0x7b50('0x130')],{'through':_0x7b50('0x1b9')});db[_0x7b50('0x87')][_0x7b50('0x123')](db[_0x7b50('0x85')],{'as':'ItemType','foreignKey':_0x7b50('0x1ba')});db[_0x7b50('0x89')][_0x7b50('0x123')](db[_0x7b50('0x6f')],{'as':_0x7b50('0x1bb'),'foreignKey':_0x7b50('0x1bc')});db[_0x7b50('0x87')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':'Contact','foreignKey':_0x7b50('0x1a6')});db[_0x7b50('0x8b')][_0x7b50('0x113')](db[_0x7b50('0x7a')],{'as':{'plural':'AllConditions','singular':_0x7b50('0x1bd')},'foreignKey':'TriggerAllId','onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0x8b')][_0x7b50('0x113')](db[_0x7b50('0x7a')],{'as':{'plural':_0x7b50('0x1be'),'singular':_0x7b50('0x1bf')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0x7b50('0x8b')][_0x7b50('0x113')](db['Action'],{'as':_0x7b50('0x1b1'),'foreignKey':'TriggerId','onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0x93')][_0x7b50('0x113')](db[_0x7b50('0x99')],{'as':_0x7b50('0x1c0'),'onDelete':_0x7b50('0x117'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x7b50('0x1c1')][_0x7b50('0x113')](db[_0x7b50('0x99')],{'as':'Fields','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1b7')});db[_0x7b50('0x97')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x7b50('0x1c0'),'onDelete':'cascade','foreignKey':_0x7b50('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x7b50('0x97')],{'foreignKey':_0x7b50('0x1c2')});db[_0x7b50('0x9b')]['hasMany'](db[_0x7b50('0x9c')],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c4')});db['SalesforceConfiguration'][_0x7b50('0x113')](db[_0x7b50('0x9e')],{'as':_0x7b50('0x1c5'),'onDelete':_0x7b50('0x117'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0x7b50('0x113')](db[_0x7b50('0x9e')],{'as':_0x7b50('0x1c6'),'onDelete':'cascade','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x9c')]['hasMany'](db[_0x7b50('0x9e')],{'as':'Fields','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x9c')]['belongsTo'](db[_0x7b50('0x9b')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0x9e')]['hasMany'](db['SalesforceField'],{'as':_0x7b50('0x1c9'),'foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0x9e')][_0x7b50('0x113')](db[_0x7b50('0x9e')],{'as':_0x7b50('0x1cb'),'foreignKey':'DescriptionId'});db[_0x7b50('0x9e')][_0x7b50('0x113')](db['SalesforceField'],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x9e')][_0x7b50('0x123')](db[_0x7b50('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x7b50('0xa0')]['hasMany'](db[_0x7b50('0x1cd')],{'as':'Configurations','onDelete':_0x7b50('0x117'),'foreignKey':'AccountId'});db[_0x7b50('0x1cd')][_0x7b50('0x113')](db['SugarcrmField'],{'as':_0x7b50('0x1c5'),'onDelete':_0x7b50('0x117'),'foreignKey':'SubjectId'});db[_0x7b50('0x1cd')][_0x7b50('0x113')](db[_0x7b50('0xa2')],{'as':_0x7b50('0x1c6'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c7')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':'Fields','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c8')});db['SugarcrmConfiguration'][_0x7b50('0x123')](db[_0x7b50('0xa0')],{'as':_0x7b50('0x17e'),'foreignKey':'AccountId'});db[_0x7b50('0xa2')]['hasMany'](db[_0x7b50('0xa2')],{'as':_0x7b50('0x1c9'),'foreignKey':'SubjectId'});db[_0x7b50('0xa2')]['hasMany'](db[_0x7b50('0xa2')],{'as':_0x7b50('0x1cb'),'foreignKey':_0x7b50('0x1c7')});db['SugarcrmField']['hasMany'](db[_0x7b50('0xa2')],{'as':_0x7b50('0x1cc'),'foreignKey':'FieldId'});db[_0x7b50('0xa2')]['belongsTo'](db[_0x7b50('0x8d')],{'as':_0x7b50('0x8d'),'foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0xa4')]['hasMany'](db[_0x7b50('0x1cf')],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0x1cf')][_0x7b50('0x113')](db[_0x7b50('0x1d0')],{'as':_0x7b50('0x1c5'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1ca')});db['DeskConfiguration'][_0x7b50('0x113')](db['DeskField'],{'as':'Descriptions','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x1cf')][_0x7b50('0x113')](db['DeskField'],{'as':_0x7b50('0x1c0'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x1cf')][_0x7b50('0x123')](db['DeskAccount'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db['DeskConfiguration'][_0x7b50('0x126')](db['Tag'],{'through':_0x7b50('0x1d1')});db[_0x7b50('0x1d0')][_0x7b50('0x113')](db['DeskField'],{'as':_0x7b50('0x1c9'),'foreignKey':_0x7b50('0x1ca')});db['DeskField'][_0x7b50('0x113')](db[_0x7b50('0x1d0')],{'as':'Description','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x1d0')][_0x7b50('0x113')](db[_0x7b50('0x1d0')],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x1d0')][_0x7b50('0x123')](db[_0x7b50('0x8d')],{'as':_0x7b50('0x8d'),'foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0xa8')][_0x7b50('0x113')](db[_0x7b50('0xaa')],{'as':_0x7b50('0x1c3'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZohoConfiguration'][_0x7b50('0x113')](db[_0x7b50('0xac')],{'as':_0x7b50('0x1c5'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0xaa')]['hasMany'](db[_0x7b50('0xac')],{'as':_0x7b50('0x1c6'),'onDelete':_0x7b50('0x117'),'foreignKey':'DescriptionId'});db[_0x7b50('0xaa')][_0x7b50('0x113')](db[_0x7b50('0xac')],{'as':_0x7b50('0x1c0'),'onDelete':_0x7b50('0x117'),'foreignKey':'FieldId'});db[_0x7b50('0xaa')][_0x7b50('0x123')](db[_0x7b50('0xa8')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xac')]['hasMany'](db[_0x7b50('0xac')],{'as':_0x7b50('0x1c9'),'foreignKey':'SubjectId'});db[_0x7b50('0xac')][_0x7b50('0x113')](db['ZohoField'],{'as':'Description','foreignKey':_0x7b50('0x1c7')});db['ZohoField']['hasMany'](db[_0x7b50('0xac')],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0xac')][_0x7b50('0x123')](db[_0x7b50('0x8d')],{'as':'Variable','foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0xae')][_0x7b50('0x113')](db[_0x7b50('0xaf')],{'as':'Configurations','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xaf')]['hasMany'](db[_0x7b50('0x1d2')],{'as':_0x7b50('0x1c5'),'foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0xaf')]['hasMany'](db[_0x7b50('0x1d2')],{'as':'Descriptions','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xaf')][_0x7b50('0x113')](db[_0x7b50('0x1d2')],{'as':_0x7b50('0x1c0'),'foreignKey':'FieldId'});db[_0x7b50('0xaf')][_0x7b50('0x123')](db[_0x7b50('0xae')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xaf')]['belongsToMany'](db['Tag'],{'through':_0x7b50('0x1d3')});db[_0x7b50('0x1d2')][_0x7b50('0x113')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0x1d2')][_0x7b50('0x113')](db['ZendeskField'],{'as':'Description','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x1d2')]['hasMany'](db['ZendeskField'],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x1d2')][_0x7b50('0x123')](db['Variable'],{'as':_0x7b50('0x8d'),'foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0x1d4')][_0x7b50('0x113')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xb1')][_0x7b50('0x113')](db[_0x7b50('0xb3')],{'as':_0x7b50('0x1c5'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1ca')});db['FreshdeskConfiguration'][_0x7b50('0x113')](db[_0x7b50('0xb3')],{'as':_0x7b50('0x1c6'),'onDelete':_0x7b50('0x117'),'foreignKey':'DescriptionId'});db[_0x7b50('0xb1')][_0x7b50('0x113')](db['FreshdeskField'],{'as':_0x7b50('0x1c0'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0xb1')]['belongsTo'](db[_0x7b50('0x1d4')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db['FreshdeskConfiguration'][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x1d5')});db['FreshdeskField'][_0x7b50('0x113')](db[_0x7b50('0xb3')],{'as':'Subject','foreignKey':_0x7b50('0x1ca')});db['FreshdeskField'][_0x7b50('0x113')](db['FreshdeskField'],{'as':_0x7b50('0x1cb'),'foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xb3')][_0x7b50('0x113')](db[_0x7b50('0xb3')],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0xb3')][_0x7b50('0x123')](db['Variable'],{'as':_0x7b50('0x8d'),'foreignKey':'VariableId'});db[_0x7b50('0xb5')][_0x7b50('0x113')](db['VtigerConfiguration'],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':'AccountId'});db[_0x7b50('0x1d6')][_0x7b50('0x113')](db[_0x7b50('0xb8')],{'as':'Subjects','foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0x1d6')][_0x7b50('0x113')](db[_0x7b50('0xb8')],{'as':_0x7b50('0x1c6'),'foreignKey':'DescriptionId'});db[_0x7b50('0x1d6')][_0x7b50('0x113')](db['VtigerField'],{'as':_0x7b50('0x1c0'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x1d6')]['belongsTo'](db[_0x7b50('0xb5')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xb8')][_0x7b50('0x113')](db[_0x7b50('0xb8')],{'as':_0x7b50('0x1c9'),'foreignKey':'SubjectId'});db[_0x7b50('0xb8')][_0x7b50('0x113')](db['VtigerField'],{'as':_0x7b50('0x1cb'),'foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xb8')][_0x7b50('0x113')](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0x7b50('0xb8')][_0x7b50('0x123')](db[_0x7b50('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x7b50('0xba')][_0x7b50('0x113')](db[_0x7b50('0xbc')],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c4')});db['ServicenowConfiguration'][_0x7b50('0x113')](db[_0x7b50('0x1d7')],{'as':'Subjects','foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x7b50('0x1c6'),'foreignKey':_0x7b50('0x1c7')});db['ServicenowConfiguration'][_0x7b50('0x113')](db['ServicenowField'],{'as':_0x7b50('0x1c0'),'foreignKey':'FieldId'});db[_0x7b50('0xbc')][_0x7b50('0x123')](db[_0x7b50('0xba')],{'as':'Account','foreignKey':_0x7b50('0x1c4')});db['ServicenowField'][_0x7b50('0x113')](db[_0x7b50('0x1d7')],{'as':'Subject','foreignKey':_0x7b50('0x1ca')});db['ServicenowField'][_0x7b50('0x113')](db[_0x7b50('0x1d7')],{'as':'Description','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x1d7')]['hasMany'](db[_0x7b50('0x1d7')],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x1d7')][_0x7b50('0x123')](db['Variable'],{'as':_0x7b50('0x8d'),'foreignKey':'VariableId'});db[_0x7b50('0xbe')][_0x7b50('0x113')](db[_0x7b50('0x1d8')],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':'AccountId'});db[_0x7b50('0xbe')][_0x7b50('0x123')](db[_0x7b50('0x108')],{'as':_0x7b50('0x108'),'foreignKey':_0x7b50('0x168')});db[_0x7b50('0x1d8')][_0x7b50('0x113')](db[_0x7b50('0xc0')],{'as':_0x7b50('0x1c5'),'onDelete':'cascade','foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0x1d8')]['hasMany'](db[_0x7b50('0xc0')],{'as':_0x7b50('0x1c6'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x1d8')][_0x7b50('0x113')](db['Dynamics365Field'],{'as':_0x7b50('0x1c0'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c8')});db['Dynamics365Configuration'][_0x7b50('0x123')](db[_0x7b50('0xbe')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xc0')][_0x7b50('0x113')](db[_0x7b50('0xc0')],{'as':'Subject','foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0xc0')][_0x7b50('0x113')](db[_0x7b50('0xc0')],{'as':_0x7b50('0x1cb'),'foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xc0')][_0x7b50('0x113')](db[_0x7b50('0xc0')],{'as':'Field','foreignKey':'FieldId'});db['Dynamics365Field'][_0x7b50('0x123')](db[_0x7b50('0x8d')],{'as':_0x7b50('0x8d'),'foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0xc2')][_0x7b50('0x113')](db['FreshsalesConfiguration'],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':'AccountId'});db[_0x7b50('0xc4')][_0x7b50('0x113')](db[_0x7b50('0xc6')],{'as':_0x7b50('0x1c5'),'foreignKey':_0x7b50('0x1ca')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xc4')][_0x7b50('0x113')](db[_0x7b50('0xc6')],{'as':_0x7b50('0x1c0'),'foreignKey':_0x7b50('0x1c8')});db['FreshsalesConfiguration'][_0x7b50('0x123')](db[_0x7b50('0xc2')],{'as':_0x7b50('0x17e'),'foreignKey':'AccountId'});db[_0x7b50('0xc6')]['hasMany'](db['FreshsalesField'],{'as':_0x7b50('0x1c9'),'foreignKey':'SubjectId'});db[_0x7b50('0xc6')][_0x7b50('0x113')](db[_0x7b50('0xc6')],{'as':'Description','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xc6')][_0x7b50('0x113')](db['FreshsalesField'],{'as':_0x7b50('0x1cc'),'foreignKey':'FieldId'});db[_0x7b50('0xc6')]['belongsTo'](db[_0x7b50('0x8d')],{'as':'Variable','foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0xca')]['belongsTo'](db[_0x7b50('0x13f')],{});db['ChatQueueReport'][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0xca')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0xca')][_0x7b50('0x123')](db['ChatInteraction'],{});db[_0x7b50('0xca')][_0x7b50('0x123')](db['ChatMessage'],{});db[_0x7b50('0xca')][_0x7b50('0x123')](db[_0x7b50('0xf')],{});db[_0x7b50('0xca')]['belongsTo'](db[_0x7b50('0x65')],{});db[_0x7b50('0xcc')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1d9')});db[_0x7b50('0xcc')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1da')});db['JscriptySessionReport'][_0x7b50('0x113')](db[_0x7b50('0xcf')],{'foreignKey':_0x7b50('0x1db'),'onDelete':_0x7b50('0x117')});db['JscriptySessionReport'][_0x7b50('0x113')](db[_0x7b50('0x1dc')],{'foreignKey':_0x7b50('0x1db'),'onDelete':_0x7b50('0x117')});db['SmsQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x4e')],{});db['SmsQueueReport'][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':'List','foreignKey':_0x7b50('0x16f')});db[_0x7b50('0xd2')][_0x7b50('0x123')](db['CmContact'],{'as':_0x7b50('0x164'),'foreignKey':'ContactId'});db[_0x7b50('0xd2')][_0x7b50('0x123')](db['SmsInteraction'],{});db[_0x7b50('0xd2')][_0x7b50('0x123')](db['SmsMessage'],{});db[_0x7b50('0xd2')]['belongsTo'](db['User'],{});db[_0x7b50('0xd2')][_0x7b50('0x123')](db[_0x7b50('0x52')],{});db[_0x7b50('0xd6')][_0x7b50('0x113')](db[_0x7b50('0xd0')],{'foreignKey':_0x7b50('0x1dd')});db[_0x7b50('0xd6')][_0x7b50('0x113')](db[_0x7b50('0xcf')],{'foreignKey':_0x7b50('0x1dd')});db[_0x7b50('0xd6')][_0x7b50('0x113')](db[_0x7b50('0x1dc')],{'foreignKey':_0x7b50('0x1dd')});db['Team'][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x129')});db[_0x7b50('0xdf')][_0x7b50('0x126')](db[_0x7b50('0x133')],{'through':_0x7b50('0x10a'),'as':_0x7b50('0x134')});db[_0x7b50('0xdf')]['belongsToMany'](db[_0x7b50('0x39')],{'through':_0x7b50('0x174'),'as':_0x7b50('0x136')});db[_0x7b50('0xdf')]['belongsToMany'](db[_0x7b50('0x65')],{'through':'team_has_chat_queues','as':_0x7b50('0x137')});db[_0x7b50('0xdf')][_0x7b50('0x126')](db['FaxQueue'],{'through':_0x7b50('0x18c'),'as':_0x7b50('0x139')});db[_0x7b50('0xdf')][_0x7b50('0x126')](db[_0x7b50('0x52')],{'through':_0x7b50('0x194'),'as':'SmsQueues'});db['Team'][_0x7b50('0x126')](db['OpenchannelQueue'],{'through':_0x7b50('0x19b'),'as':_0x7b50('0x13c')});db['Team'][_0x7b50('0x126')](db[_0x7b50('0x106')],{'through':_0x7b50('0x1de'),'as':'WhatsappQueues'});db[_0x7b50('0xdf')][_0x7b50('0x126')](db[_0x7b50('0xf4')],{'through':_0x7b50('0x1df'),'as':_0x7b50('0x135')});db[_0x7b50('0xe2')]['hasMany'](db[_0x7b50('0x6f')],{'as':_0x7b50('0x152'),'foreignKey':'CampaignId'});db[_0x7b50('0xe2')][_0x7b50('0x113')](db[_0x7b50('0x72')],{'as':'HopperFinals','foreignKey':_0x7b50('0x1aa')});db[_0x7b50('0xe2')]['hasMany'](db['CmHopperHistory'],{'as':_0x7b50('0x153'),'foreignKey':_0x7b50('0x1aa')});db[_0x7b50('0xe2')][_0x7b50('0x113')](db[_0x7b50('0x70')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db['Campaign'][_0x7b50('0x123')](db[_0x7b50('0x25')],{'as':_0x7b50('0x25'),'foreignKey':_0x7b50('0x1e0')});db['Campaign'][_0x7b50('0x123')](db[_0x7b50('0x25')],{'as':_0x7b50('0x155'),'foreignKey':_0x7b50('0x156')});db[_0x7b50('0xe2')][_0x7b50('0x123')](db[_0x7b50('0x7b')],{'as':_0x7b50('0x7b'),'foreignKey':'IntervalId'});db[_0x7b50('0xe2')][_0x7b50('0x123')](db['SquareProject'],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x7b50('0xe2')]['belongsToMany'](db[_0x7b50('0xf2')],{'as':_0x7b50('0x1e1'),'through':_0x7b50('0x1e2')});db[_0x7b50('0xe2')]['belongsToMany'](db[_0x7b50('0xf2')],{'as':_0x7b50('0x15b'),'through':_0x7b50('0x1e3')});db[_0x7b50('0xe5')][_0x7b50('0x123')](db['ChatOfflineMessage'],{'as':_0x7b50('0x180'),'foreignKey':_0x7b50('0x1a2')});db['MailTransferReport'][_0x7b50('0x123')](db[_0x7b50('0x3e')],{});db[_0x7b50('0xe9')]['belongsTo'](db['MailInteraction'],{});db[_0x7b50('0xe9')][_0x7b50('0x123')](db[_0x7b50('0x37')],{'foreignKey':_0x7b50('0x1e4'),'as':_0x7b50('0x1e5')});db[_0x7b50('0xe9')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':'FromAgent'});db[_0x7b50('0xe9')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e7'),'as':'ToAgent'});db['MailTransferReport']['belongsTo'](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x7b50('0x1e8')});db[_0x7b50('0xe9')]['belongsTo'](db[_0x7b50('0x37')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0x7b50('0xea')][_0x7b50('0x123')](db[_0x7b50('0x62')],{});db[_0x7b50('0xea')][_0x7b50('0x123')](db[_0x7b50('0x12c')],{});db[_0x7b50('0xea')][_0x7b50('0x123')](db['ChatWebsite'],{'foreignKey':_0x7b50('0x1e9'),'as':'FromAccount'});db[_0x7b50('0xea')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':'FromAgent'});db['ChatTransferReport'][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e7'),'as':'ToAgent'});db[_0x7b50('0xea')]['belongsTo'](db[_0x7b50('0x65')],{'foreignKey':_0x7b50('0x1ea'),'as':'ToQueue'});db[_0x7b50('0xea')][_0x7b50('0x123')](db[_0x7b50('0x13f')],{'foreignKey':_0x7b50('0x1eb'),'as':_0x7b50('0x1ec')});db[_0x7b50('0xec')][_0x7b50('0x123')](db['FaxMessage'],{});db[_0x7b50('0xec')][_0x7b50('0x123')](db[_0x7b50('0x12e')],{});db[_0x7b50('0xec')][_0x7b50('0x123')](db[_0x7b50('0x184')],{'foreignKey':_0x7b50('0x1ed'),'as':_0x7b50('0x1e5')});db[_0x7b50('0xec')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':'FromAgent'});db[_0x7b50('0xec')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e7'),'as':_0x7b50('0x1ee')});db['FaxTransferReport'][_0x7b50('0x123')](db[_0x7b50('0x4a')],{'foreignKey':_0x7b50('0x1ef'),'as':'ToQueue'});db[_0x7b50('0xec')][_0x7b50('0x123')](db['FaxAccount'],{'foreignKey':_0x7b50('0x1f0'),'as':_0x7b50('0x1ec')});db[_0x7b50('0xee')][_0x7b50('0x123')](db[_0x7b50('0x198')],{});db['OpenchannelTransferReport'][_0x7b50('0x123')](db[_0x7b50('0x57')],{});db[_0x7b50('0xee')][_0x7b50('0x123')](db[_0x7b50('0x195')],{'foreignKey':_0x7b50('0x1f1'),'as':'FromAccount'});db[_0x7b50('0xee')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':_0x7b50('0x1f2')});db[_0x7b50('0xee')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e7'),'as':'ToAgent'});db[_0x7b50('0xee')][_0x7b50('0x123')](db['OpenchannelQueue'],{'foreignKey':_0x7b50('0x1f3'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0x7b50('0x123')](db['OpenchannelAccount'],{'foreignKey':_0x7b50('0x1f4'),'as':_0x7b50('0x1ec')});db[_0x7b50('0xf0')]['belongsTo'](db[_0x7b50('0x18e')],{});db[_0x7b50('0xf0')]['belongsTo'](db[_0x7b50('0x50')],{});db[_0x7b50('0xf0')][_0x7b50('0x123')](db[_0x7b50('0x4e')],{'foreignKey':_0x7b50('0x1f5'),'as':_0x7b50('0x1e5')});db[_0x7b50('0xf0')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':'FromAgent'});db[_0x7b50('0xf0')]['belongsTo'](db[_0x7b50('0xf')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x7b50('0xf0')]['belongsTo'](db[_0x7b50('0x52')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db['SmsTransferReport'][_0x7b50('0x123')](db[_0x7b50('0x4e')],{'foreignKey':_0x7b50('0x1f6'),'as':_0x7b50('0x1ec')});db['CmList']['hasMany'](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':_0x7b50('0x16f'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0xf2')][_0x7b50('0x113')](db['CmCustomField'],{'as':_0x7b50('0x1f7'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0xf2')][_0x7b50('0x113')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x1f8'),'onDelete':_0x7b50('0x117'),'foreignKey':'ListId'});db['CmList'][_0x7b50('0x113')](db['CmHopperFinal'],{'as':_0x7b50('0x118'),'foreignKey':'ListId'});db[_0x7b50('0xf2')]['hasMany'](db[_0x7b50('0x119')],{'as':_0x7b50('0x11a'),'foreignKey':'ListId'});db[_0x7b50('0xf2')][_0x7b50('0x113')](db[_0x7b50('0x74')],{'as':_0x7b50('0x74'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0xf2')][_0x7b50('0x126')](db[_0x7b50('0x133')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x7b50('0xf2')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x128')});db[_0x7b50('0xf4')][_0x7b50('0x113')](db[_0x7b50('0x15')],{'as':'Extensions','onDelete':_0x7b50('0x117')});db[_0x7b50('0xf4')]['belongsToMany'](db['User'],{'as':_0x7b50('0x159'),'through':_0x7b50('0x10c')});db[_0x7b50('0xf4')]['belongsToMany'](db['Team'],{'through':_0x7b50('0x1df'),'as':_0x7b50('0x15a')});db[_0x7b50('0xf6')][_0x7b50('0x113')](db[_0x7b50('0xf')],{'as':_0x7b50('0x17b'),'foreignKey':_0x7b50('0x1f9')});db[_0x7b50('0xf6')][_0x7b50('0x113')](db[_0x7b50('0xf8')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x7b50('0x117')});db[_0x7b50('0xf8')][_0x7b50('0x113')](db[_0x7b50('0x1fa')],{'as':'Resources','foreignKey':_0x7b50('0x1fb'),'onDelete':'cascade'});db[_0x7b50('0xfb')][_0x7b50('0x113')](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':_0x7b50('0x1fc'),'onDelete':'cascade'});db[_0x7b50('0xfb')][_0x7b50('0x113')](db[_0x7b50('0x16c')],{'as':_0x7b50('0x16d'),'foreignKey':_0x7b50('0x1fc')});db['WhatsappAccount'][_0x7b50('0x113')](db[_0x7b50('0x100')],{'as':_0x7b50('0x15e'),'foreignKey':_0x7b50('0x1fc')});db[_0x7b50('0xfb')][_0x7b50('0x113')](db[_0x7b50('0x130')],{'as':'Interactions'});db[_0x7b50('0xfb')]['hasMany'](db[_0x7b50('0xfd')],{'as':_0x7b50('0x14c')});db[_0x7b50('0xfb')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':'List','foreignKey':_0x7b50('0x16f')});db[_0x7b50('0xfb')][_0x7b50('0x123')](db['Pause'],{'as':_0x7b50('0x172'),'foreignKey':_0x7b50('0x157')});db[_0x7b50('0xfb')]['belongsToMany'](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x14a')});db[_0x7b50('0xfd')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0xfd')][_0x7b50('0x123')](db['WhatsappQueue'],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0xfd')][_0x7b50('0x123')](db['WhatsappAccount'],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0xfd')][_0x7b50('0x123')](db[_0x7b50('0x7b')],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x181')});db[_0x7b50('0xfd')][_0x7b50('0x123')](db[_0x7b50('0x177')],{'onDelete':'restrict','foreignKey':_0x7b50('0x182')});db[_0x7b50('0x130')][_0x7b50('0x113')](db[_0x7b50('0x100')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x7b50('0x1fd')});db[_0x7b50('0x130')][_0x7b50('0x123')](db['WhatsappAccount'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1fc')});db['WhatsappInteraction'][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':'Contact','foreignKey':_0x7b50('0x165')});db[_0x7b50('0x130')][_0x7b50('0x123')](db['User'],{'as':_0x7b50('0x176'),'foreignKey':_0x7b50('0x111')});db['WhatsappInteraction'][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':'whatsapp_interaction_has_tags','as':_0x7b50('0x179')});db[_0x7b50('0x130')][_0x7b50('0x126')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction'][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x17b'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0x7b50('0x100')][_0x7b50('0x123')](db['User'],{'as':'User'});db['WhatsappMessage'][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'onDelete':'cascade','as':'Contact'});db['WhatsappMessage'][_0x7b50('0x123')](db['WhatsappInteraction'],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x17d'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x7b50('0x123')](db[_0x7b50('0xfb')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1fc')});db['WhatsappQueueReport']['belongsTo'](db[_0x7b50('0xfb')],{});db[_0x7b50('0x102')]['belongsTo'](db['CmList'],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0x102')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['WhatsappQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x130')],{});db['WhatsappQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x106')],{});db[_0x7b50('0x102')][_0x7b50('0x123')](db[_0x7b50('0x100')],{});db[_0x7b50('0x102')][_0x7b50('0x123')](db[_0x7b50('0xf')],{});db[_0x7b50('0x104')][_0x7b50('0x123')](db[_0x7b50('0x100')],{});db[_0x7b50('0x104')][_0x7b50('0x123')](db[_0x7b50('0x130')],{});db[_0x7b50('0x104')][_0x7b50('0x123')](db[_0x7b50('0xfb')],{'foreignKey':_0x7b50('0x1fe'),'as':_0x7b50('0x1e5')});db[_0x7b50('0x104')][_0x7b50('0x123')](db['WhatsappAccount'],{'foreignKey':_0x7b50('0x1ff'),'as':_0x7b50('0x1ec')});db['WhatsappTransferReport'][_0x7b50('0x123')](db[_0x7b50('0x106')],{'foreignKey':_0x7b50('0x200'),'as':_0x7b50('0x1e8')});db[_0x7b50('0x104')]['belongsTo'](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':'FromAgent'});db[_0x7b50('0x104')]['belongsTo'](db[_0x7b50('0xf')],{'foreignKey':'ToUserId','as':_0x7b50('0x1ee')});db[_0x7b50('0x106')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x13e'),'foreignKey':_0x7b50('0x201')});db[_0x7b50('0x106')]['belongsToMany'](db[_0x7b50('0xdf')],{'through':_0x7b50('0x1de'),'as':_0x7b50('0x15a')});db[_0x7b50('0x10e')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'as':_0x7b50('0x202'),'foreignKey':_0x7b50('0x111'),'onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0x108')][_0x7b50('0x110')](db[_0x7b50('0xbe')],{'as':_0x7b50('0xbe'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x108')][_0x7b50('0x110')](db[_0x7b50('0x33')],{'as':_0x7b50('0x169'),'onDelete':'restrict'});db[_0x7b50('0x108')]['hasOne'](db['MailServerOut'],{'as':_0x7b50('0x16a'),'onDelete':'restrict'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index f9082c0..3987717 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76dc=['./api/system','./api/pm2','./api/webbar','/apidoc','static','join','/www','root','snippet','/plugins','/server/files/plugins','get','route','resolve','path','express','./errors','./config/environment','default','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./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/reports/queue','./api/faxQueueReport','/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/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','./api/automation','./api/disposition','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/contact_item_types','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./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/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/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/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','./api/authGoogle','./api/authActiveDirectory','./api/jira','./api/rpc','/api/version','./api/version'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x76dc,0x111));var _0xc76d=function(_0x5949e7,_0x306b9c){_0x5949e7=_0x5949e7-0x0;var _0x5ef628=_0x76dc[_0x5949e7];return _0x5ef628;};'use strict';var path=require(_0xc76d('0x0'));var express=require(_0xc76d('0x1'));var errors=require(_0xc76d('0x2'));var config=require(_0xc76d('0x3'));var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports[_0xc76d('0x4')]=function(_0x28b29c){return setupLoggers(_0x28b29c)[_0xc76d('0x5')](function(){_0x28b29c[_0xc76d('0x6')](_0xc76d('0x7'),require('./api/user'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x8'),require(_0xc76d('0x9')));_0x28b29c[_0xc76d('0x6')]('/api/voice/contexts',require(_0xc76d('0xa')));_0x28b29c['use'](_0xc76d('0xb'),require(_0xc76d('0xc')));_0x28b29c[_0xc76d('0x6')]('/api/voice/mohs',require(_0xc76d('0xd')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xe'),require(_0xc76d('0xf')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x10'),require(_0xc76d('0x11')));_0x28b29c[_0xc76d('0x6')]('/api/screen/recordings',require('./api/screenRecording'));_0x28b29c['use'](_0xc76d('0x12'),require('./api/voiceMail'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x13'),require(_0xc76d('0x14')));_0x28b29c['use'](_0xc76d('0x15'),require(_0xc76d('0x16')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x17'),require(_0xc76d('0x18')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x19'),require(_0xc76d('0x1a')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x1b'),require(_0xc76d('0x1c')));_0x28b29c['use'](_0xc76d('0x1d'),require('./api/memberReport'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x1e'),require(_0xc76d('0x1f')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x20'),require(_0xc76d('0x21')));_0x28b29c[_0xc76d('0x6')]('/api/mail/out_servers',require(_0xc76d('0x22')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x23'),require(_0xc76d('0x24')));_0x28b29c['use'](_0xc76d('0x25'),require(_0xc76d('0x26')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x27'),require(_0xc76d('0x28')));_0x28b29c[_0xc76d('0x6')]('/api/mail/interactions',require(_0xc76d('0x29')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x2a'),require(_0xc76d('0x2b')));_0x28b29c['use'](_0xc76d('0x2c'),require(_0xc76d('0x2d')));_0x28b29c['use'](_0xc76d('0x2e'),require(_0xc76d('0x2f')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x30'),require(_0xc76d('0x31')));_0x28b29c[_0xc76d('0x6')]('/api/dashboards/items',require(_0xc76d('0x32')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x33'),require(_0xc76d('0x34')));_0x28b29c['use'](_0xc76d('0x35'),require('./api/faxApplication'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x36'),require(_0xc76d('0x37')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x38'),require('./api/faxMessage'));_0x28b29c['use']('/api/fax/queues',require('./api/faxQueue'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x39'),require(_0xc76d('0x3a')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x3b'),require('./api/smsAccount'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x3c'),require(_0xc76d('0x3d')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x3e'),require(_0xc76d('0x3f')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x40'),require(_0xc76d('0x41')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x42'),require(_0xc76d('0x43')));_0x28b29c[_0xc76d('0x6')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x44'),require(_0xc76d('0x45')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x46'),require(_0xc76d('0x47')));_0x28b29c['use']('/api/openchannel/messages',require(_0xc76d('0x48')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x49'),require('./api/openchannelQueue'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x4a'),require(_0xc76d('0x4b')));_0x28b29c['use']('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x4c'),require(_0xc76d('0x4d')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x4e'),require(_0xc76d('0x4f')));_0x28b29c['use'](_0xc76d('0x50'),require('./api/chatMessage'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x51'),require(_0xc76d('0x52')));_0x28b29c[_0xc76d('0x6')]('/api/chat/queues',require(_0xc76d('0x53')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x54'),require('./api/chatGroup'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x55'),require(_0xc76d('0x56')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x57'),require(_0xc76d('0x58')));_0x28b29c[_0xc76d('0x6')]('/api/cm/contacts',require(_0xc76d('0x59')));_0x28b29c['use'](_0xc76d('0x5a'),require('./api/cmHopper'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x5b'),require(_0xc76d('0x5c')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x5d'),require(_0xc76d('0x5e')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x5f'),require(_0xc76d('0x60')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x61'),require('./api/cmCustomField'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x62'),require(_0xc76d('0x63')));_0x28b29c['use']('/api/automations',require(_0xc76d('0x64')));_0x28b29c[_0xc76d('0x6')]('/api/canned_answers',require('./api/cannedAnswer'));_0x28b29c[_0xc76d('0x6')]('/api/dispositions',require(_0xc76d('0x65')));_0x28b29c[_0xc76d('0x6')]('/api/conditions',require(_0xc76d('0x66')));_0x28b29c[_0xc76d('0x6')]('/api/intervals',require(_0xc76d('0x67')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x68'),require(_0xc76d('0x69')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x6a'),require(_0xc76d('0x6b')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x6c'),require('./api/voiceQueuesLog'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x6d'),require(_0xc76d('0x6e')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x6f'),require('./api/sound'));_0x28b29c[_0xc76d('0x6')]('/api/tags',require('./api/tag'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x70'),require('./api/contactItemType'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x71'),require('./api/cmContactHasItem'));_0x28b29c['use'](_0xc76d('0x72'),require(_0xc76d('0x73')));_0x28b29c['use'](_0xc76d('0x74'),require(_0xc76d('0x75')));_0x28b29c['use'](_0xc76d('0x76'),require(_0xc76d('0x77')));_0x28b29c['use'](_0xc76d('0x78'),require(_0xc76d('0x79')));_0x28b29c['use'](_0xc76d('0x7a'),require(_0xc76d('0x7b')));_0x28b29c['use'](_0xc76d('0x7c'),require('./api/integrationReport'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x7d'),require('./api/analyticCustomReport'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x7e'),require(_0xc76d('0x7f')));_0x28b29c['use']('/api/analytics/extracted_reports',require(_0xc76d('0x80')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x81'),require(_0xc76d('0x82')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x83'),require('./api/analyticFieldReport'));_0x28b29c['use'](_0xc76d('0x84'),require(_0xc76d('0x85')));_0x28b29c['use'](_0xc76d('0x86'),require(_0xc76d('0x87')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x88'),require(_0xc76d('0x89')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x8a'),require('./api/intSalesforceField'));_0x28b29c['use'](_0xc76d('0x8b'),require(_0xc76d('0x8c')));_0x28b29c[_0xc76d('0x6')]('/api/integrations/sugarcrm/configurations',require(_0xc76d('0x8d')));_0x28b29c['use'](_0xc76d('0x8e'),require(_0xc76d('0x8f')));_0x28b29c[_0xc76d('0x6')]('/api/integrations/desk/accounts',require(_0xc76d('0x90')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x91'),require(_0xc76d('0x92')));_0x28b29c['use'](_0xc76d('0x93'),require(_0xc76d('0x94')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x95'),require('./api/intZohoAccount'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x96'),require('./api/intZohoConfiguration'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x97'),require(_0xc76d('0x98')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x99'),require(_0xc76d('0x9a')));_0x28b29c['use']('/api/integrations/zendesk/configurations',require(_0xc76d('0x9b')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x9c'),require('./api/intZendeskField'));_0x28b29c['use'](_0xc76d('0x9d'),require('./api/intFreshdeskAccount'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0x9e'),require(_0xc76d('0x9f')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xa0'),require(_0xc76d('0xa1')));_0x28b29c['use'](_0xc76d('0xa2'),require(_0xc76d('0xa3')));_0x28b29c['use'](_0xc76d('0xa4'),require(_0xc76d('0xa5')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xa6'),require('./api/intVtigerField'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xa7'),require('./api/intServicenowAccount'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xa8'),require('./api/intServicenowConfiguration'));_0x28b29c[_0xc76d('0x6')]('/api/integrations/servicenow/fields',require(_0xc76d('0xa9')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xaa'),require('./api/intDynamics365Account'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xab'),require('./api/intDynamics365Configuration'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xac'),require(_0xc76d('0xad')));_0x28b29c['use'](_0xc76d('0xae'),require('./api/intFreshsalesAccount'));_0x28b29c[_0xc76d('0x6')]('/api/integrations/freshsales/configurations',require(_0xc76d('0xaf')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xb0'),require('./api/intFreshsalesField'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xb1'),require(_0xc76d('0xb2')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xb3'),require(_0xc76d('0xb4')));_0x28b29c[_0xc76d('0x6')]('/api/chat/internal/messages',require(_0xc76d('0xb5')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xb6'),require(_0xc76d('0xb7')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xb8'),require('./api/jscriptyQuestionReport'));_0x28b29c[_0xc76d('0x6')]('/api/jscripty/sessions/reports',require(_0xc76d('0xb9')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xba'),require(_0xc76d('0xbb')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xbc'),require('./api/squareReport'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xbd'),require(_0xc76d('0xbe')));_0x28b29c['use']('/api/jscripty/projects',require('./api/jscriptyProject'));_0x28b29c[_0xc76d('0x6')]('/api/settings',require('./api/setting'));_0x28b29c['use'](_0xc76d('0xbf'),require('./api/squareOdbc'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xc0'),require(_0xc76d('0xc1')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xc2'),require('./api/squareRecording'));_0x28b29c[_0xc76d('0x6')]('/api/square/messages',require(_0xc76d('0xc3')));_0x28b29c['use'](_0xc76d('0xc4'),require(_0xc76d('0xc5')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xc6'),require('./api/license'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xc7'),require(_0xc76d('0xc8')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xc9'),require(_0xc76d('0xca')));_0x28b29c['use'](_0xc76d('0xcb'),require(_0xc76d('0xcc')));_0x28b29c[_0xc76d('0x6')]('/api/plugins',require(_0xc76d('0xcd')));_0x28b29c['use'](_0xc76d('0xce'),require(_0xc76d('0xcf')));_0x28b29c['use'](_0xc76d('0xd0'),require(_0xc76d('0xd1')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xd2'),require(_0xc76d('0xd3')));_0x28b29c[_0xc76d('0x6')]('/api/openchannel/reports/transfer',require(_0xc76d('0xd4')));_0x28b29c[_0xc76d('0x6')]('/api/sms/reports/transfer',require(_0xc76d('0xd5')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xd6'),require(_0xc76d('0xd7')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xd8'),require(_0xc76d('0xd9')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xda'),require(_0xc76d('0xdb')));_0x28b29c[_0xc76d('0x6')]('/api/userProfile/sections',require(_0xc76d('0xdc')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xdd'),require(_0xc76d('0xde')));_0x28b29c[_0xc76d('0x6')]('/api/userNotifications',require(_0xc76d('0xdf')));_0x28b29c['use'](_0xc76d('0xe0'),require('./api/whatsappAccount'));_0x28b29c[_0xc76d('0x6')]('/api/whatsapp/applications',require(_0xc76d('0xe1')));_0x28b29c[_0xc76d('0x6')]('/api/whatsapp/interactions',require(_0xc76d('0xe2')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xe3'),require('./api/whatsappMessage'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xe4'),require('./api/whatsappQueueReport'));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xe5'),require(_0xc76d('0xe6')));_0x28b29c['use'](_0xc76d('0xe7'),require(_0xc76d('0xe8')));_0x28b29c[_0xc76d('0x6')]('/api/cloudProviders',require(_0xc76d('0xe9')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xea'),require(_0xc76d('0xeb')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xec'),require(_0xc76d('0xed')));_0x28b29c[_0xc76d('0x6')]('/api/auth/local',require(_0xc76d('0xee')));_0x28b29c['use']('/api/auth/google',require(_0xc76d('0xef')));_0x28b29c['use']('/api/auth/activedirectory',require(_0xc76d('0xf0')));_0x28b29c[_0xc76d('0x6')]('/api/jira',require(_0xc76d('0xf1')));_0x28b29c['use']('/api/rpc',require(_0xc76d('0xf2')));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xf3'),require(_0xc76d('0xf4')));_0x28b29c['use']('/api/system',require(_0xc76d('0xf5')));_0x28b29c[_0xc76d('0x6')]('/api/pm2',require(_0xc76d('0xf6')));_0x28b29c[_0xc76d('0x6')]('/api/webbar',require(_0xc76d('0xf7')));_0x28b29c[_0xc76d('0x6')]('/api/logs',clientSideLogs);_0x28b29c['use'](_0xc76d('0xf8'),express[_0xc76d('0xf9')](path[_0xc76d('0xfa')](config['root'],_0xc76d('0xf8'))));_0x28b29c[_0xc76d('0x6')](_0xc76d('0xfb'),express['static'](path[_0xc76d('0xfa')](config[_0xc76d('0xfc')],'/www')));_0x28b29c[_0xc76d('0x6')]('/demo',express[_0xc76d('0xf9')](path[_0xc76d('0xfa')](config[_0xc76d('0xfc')],'/demo')));_0x28b29c[_0xc76d('0x6')]('/snippet',express[_0xc76d('0xf9')](path['join'](config[_0xc76d('0xfc')],_0xc76d('0xfd'),'3.0.0')));_0x28b29c['use'](_0xc76d('0xfe'),express['static'](path[_0xc76d('0xfa')](config[_0xc76d('0xfc')],_0xc76d('0xff'))));_0x28b29c['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0xc76d('0x100')](errors[0x194]);_0x28b29c[_0xc76d('0x101')]('/*')['get'](function(_0x4886b2,_0x2e599c){_0x2e599c['sendFile'](path[_0xc76d('0x102')](_0x28b29c[_0xc76d('0x100')]('appPath')+'/index.html'));});return _0x28b29c;});}; \ No newline at end of file +var _0x2305=['/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','./api/setting','./api/squareOdbc','/api/square/projects','/api/square/recordings','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfile/sections','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','join','root','/www','static','/demo','snippet','3.1.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount'];(function(_0x5a2291,_0x3ddda7){var _0x10e3f5=function(_0xc510cc){while(--_0xc510cc){_0x5a2291['push'](_0x5a2291['shift']());}};_0x10e3f5(++_0x3ddda7);}(_0x2305,0x7b));var _0x5230=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0x2305[_0x3d13bb];return _0x4b5a1b;};'use strict';var path=require(_0x5230('0x0'));var express=require(_0x5230('0x1'));var errors=require(_0x5230('0x2'));var config=require(_0x5230('0x3'));var setupLoggers=require(_0x5230('0x4'))[_0x5230('0x5')];var clientSideLogs=require(_0x5230('0x6'));exports[_0x5230('0x7')]=function(_0x223ba6){return setupLoggers(_0x223ba6)['then'](function(){_0x223ba6[_0x5230('0x8')]('/api/users',require(_0x5230('0x9')));_0x223ba6[_0x5230('0x8')](_0x5230('0xa'),require(_0x5230('0xb')));_0x223ba6[_0x5230('0x8')](_0x5230('0xc'),require(_0x5230('0xd')));_0x223ba6['use']('/api/voice/extensions',require(_0x5230('0xe')));_0x223ba6[_0x5230('0x8')](_0x5230('0xf'),require(_0x5230('0x10')));_0x223ba6[_0x5230('0x8')](_0x5230('0x11'),require(_0x5230('0x12')));_0x223ba6[_0x5230('0x8')](_0x5230('0x13'),require('./api/voiceRecording'));_0x223ba6['use'](_0x5230('0x14'),require(_0x5230('0x15')));_0x223ba6['use'](_0x5230('0x16'),require('./api/voiceMail'));_0x223ba6[_0x5230('0x8')](_0x5230('0x17'),require('./api/voiceMailMessage'));_0x223ba6[_0x5230('0x8')](_0x5230('0x18'),require(_0x5230('0x19')));_0x223ba6[_0x5230('0x8')](_0x5230('0x1a'),require(_0x5230('0x1b')));_0x223ba6[_0x5230('0x8')](_0x5230('0x1c'),require(_0x5230('0x1d')));_0x223ba6['use']('/api/voice/queues/reports',require(_0x5230('0x1e')));_0x223ba6[_0x5230('0x8')](_0x5230('0x1f'),require('./api/memberReport'));_0x223ba6['use'](_0x5230('0x20'),require(_0x5230('0x21')));_0x223ba6[_0x5230('0x8')](_0x5230('0x22'),require(_0x5230('0x23')));_0x223ba6[_0x5230('0x8')](_0x5230('0x24'),require(_0x5230('0x25')));_0x223ba6[_0x5230('0x8')]('/api/mail/accounts',require(_0x5230('0x26')));_0x223ba6['use'](_0x5230('0x27'),require('./api/mailQueue'));_0x223ba6['use'](_0x5230('0x28'),require(_0x5230('0x29')));_0x223ba6['use'](_0x5230('0x2a'),require(_0x5230('0x2b')));_0x223ba6[_0x5230('0x8')]('/api/mail/messages',require('./api/mailMessage'));_0x223ba6[_0x5230('0x8')](_0x5230('0x2c'),require('./api/mailApplication'));_0x223ba6[_0x5230('0x8')](_0x5230('0x2d'),require(_0x5230('0x2e')));_0x223ba6[_0x5230('0x8')](_0x5230('0x2f'),require('./api/dashboard'));_0x223ba6[_0x5230('0x8')](_0x5230('0x30'),require(_0x5230('0x31')));_0x223ba6['use'](_0x5230('0x32'),require(_0x5230('0x33')));_0x223ba6[_0x5230('0x8')](_0x5230('0x34'),require('./api/faxApplication'));_0x223ba6[_0x5230('0x8')](_0x5230('0x35'),require(_0x5230('0x36')));_0x223ba6['use'](_0x5230('0x37'),require(_0x5230('0x38')));_0x223ba6[_0x5230('0x8')](_0x5230('0x39'),require(_0x5230('0x3a')));_0x223ba6[_0x5230('0x8')](_0x5230('0x3b'),require(_0x5230('0x3c')));_0x223ba6[_0x5230('0x8')](_0x5230('0x3d'),require('./api/smsAccount'));_0x223ba6[_0x5230('0x8')](_0x5230('0x3e'),require(_0x5230('0x3f')));_0x223ba6['use']('/api/sms/interactions',require(_0x5230('0x40')));_0x223ba6[_0x5230('0x8')](_0x5230('0x41'),require(_0x5230('0x42')));_0x223ba6[_0x5230('0x8')](_0x5230('0x43'),require('./api/smsQueue'));_0x223ba6[_0x5230('0x8')](_0x5230('0x44'),require('./api/openchannelAccount'));_0x223ba6[_0x5230('0x8')]('/api/openchannel/applications',require(_0x5230('0x45')));_0x223ba6[_0x5230('0x8')]('/api/openchannel/interactions',require(_0x5230('0x46')));_0x223ba6[_0x5230('0x8')]('/api/openchannel/messages',require(_0x5230('0x47')));_0x223ba6[_0x5230('0x8')](_0x5230('0x48'),require(_0x5230('0x49')));_0x223ba6[_0x5230('0x8')](_0x5230('0x4a'),require(_0x5230('0x4b')));_0x223ba6[_0x5230('0x8')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x223ba6[_0x5230('0x8')](_0x5230('0x4c'),require(_0x5230('0x4d')));_0x223ba6[_0x5230('0x8')]('/api/chat/interactions',require(_0x5230('0x4e')));_0x223ba6[_0x5230('0x8')](_0x5230('0x4f'),require('./api/chatMessage'));_0x223ba6[_0x5230('0x8')]('/api/chat/offline_messages',require(_0x5230('0x50')));_0x223ba6['use'](_0x5230('0x51'),require(_0x5230('0x52')));_0x223ba6[_0x5230('0x8')](_0x5230('0x53'),require('./api/chatGroup'));_0x223ba6[_0x5230('0x8')](_0x5230('0x54'),require(_0x5230('0x55')));_0x223ba6[_0x5230('0x8')](_0x5230('0x56'),require(_0x5230('0x57')));_0x223ba6['use']('/api/cm/contacts',require(_0x5230('0x58')));_0x223ba6['use']('/api/cm/hopper',require(_0x5230('0x59')));_0x223ba6[_0x5230('0x8')]('/api/cm/hopper_black',require(_0x5230('0x5a')));_0x223ba6['use'](_0x5230('0x5b'),require(_0x5230('0x5c')));_0x223ba6['use']('/api/cm/hopper_history',require(_0x5230('0x5d')));_0x223ba6[_0x5230('0x8')]('/api/cm/custom_fields',require(_0x5230('0x5e')));_0x223ba6[_0x5230('0x8')]('/api/actions',require(_0x5230('0x5f')));_0x223ba6[_0x5230('0x8')](_0x5230('0x60'),require(_0x5230('0x61')));_0x223ba6[_0x5230('0x8')](_0x5230('0x62'),require('./api/cannedAnswer'));_0x223ba6['use']('/api/dispositions',require(_0x5230('0x63')));_0x223ba6['use'](_0x5230('0x64'),require(_0x5230('0x65')));_0x223ba6[_0x5230('0x8')](_0x5230('0x66'),require(_0x5230('0x67')));_0x223ba6['use'](_0x5230('0x68'),require(_0x5230('0x69')));_0x223ba6[_0x5230('0x8')](_0x5230('0x6a'),require('./api/cdr'));_0x223ba6[_0x5230('0x8')]('/api/voiceQueuesLog',require(_0x5230('0x6b')));_0x223ba6[_0x5230('0x8')]('/api/schedules',require('./api/schedule'));_0x223ba6[_0x5230('0x8')](_0x5230('0x6c'),require(_0x5230('0x6d')));_0x223ba6[_0x5230('0x8')](_0x5230('0x6e'),require('./api/tag'));_0x223ba6['use'](_0x5230('0x6f'),require(_0x5230('0x70')));_0x223ba6[_0x5230('0x8')](_0x5230('0x71'),require(_0x5230('0x72')));_0x223ba6[_0x5230('0x8')](_0x5230('0x73'),require(_0x5230('0x74')));_0x223ba6[_0x5230('0x8')](_0x5230('0x75'),require(_0x5230('0x76')));_0x223ba6['use'](_0x5230('0x77'),require(_0x5230('0x78')));_0x223ba6[_0x5230('0x8')](_0x5230('0x79'),require(_0x5230('0x7a')));_0x223ba6['use'](_0x5230('0x7b'),require(_0x5230('0x7c')));_0x223ba6[_0x5230('0x8')](_0x5230('0x7d'),require('./api/integrationReport'));_0x223ba6[_0x5230('0x8')](_0x5230('0x7e'),require(_0x5230('0x7f')));_0x223ba6[_0x5230('0x8')](_0x5230('0x80'),require(_0x5230('0x81')));_0x223ba6[_0x5230('0x8')](_0x5230('0x82'),require(_0x5230('0x83')));_0x223ba6['use'](_0x5230('0x84'),require('./api/analyticMetric'));_0x223ba6[_0x5230('0x8')](_0x5230('0x85'),require(_0x5230('0x86')));_0x223ba6[_0x5230('0x8')](_0x5230('0x87'),require('./api/analyticTreeReport'));_0x223ba6[_0x5230('0x8')]('/api/integrations/salesforce/accounts',require(_0x5230('0x88')));_0x223ba6[_0x5230('0x8')](_0x5230('0x89'),require(_0x5230('0x8a')));_0x223ba6[_0x5230('0x8')](_0x5230('0x8b'),require(_0x5230('0x8c')));_0x223ba6[_0x5230('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x5230('0x8d')));_0x223ba6[_0x5230('0x8')](_0x5230('0x8e'),require(_0x5230('0x8f')));_0x223ba6[_0x5230('0x8')](_0x5230('0x90'),require('./api/intSugarcrmField'));_0x223ba6[_0x5230('0x8')](_0x5230('0x91'),require(_0x5230('0x92')));_0x223ba6[_0x5230('0x8')](_0x5230('0x93'),require(_0x5230('0x94')));_0x223ba6[_0x5230('0x8')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x223ba6['use']('/api/integrations/zoho/accounts',require(_0x5230('0x95')));_0x223ba6[_0x5230('0x8')](_0x5230('0x96'),require(_0x5230('0x97')));_0x223ba6[_0x5230('0x8')]('/api/integrations/zoho/fields',require(_0x5230('0x98')));_0x223ba6[_0x5230('0x8')](_0x5230('0x99'),require('./api/intZendeskAccount'));_0x223ba6[_0x5230('0x8')]('/api/integrations/zendesk/configurations',require(_0x5230('0x9a')));_0x223ba6['use'](_0x5230('0x9b'),require(_0x5230('0x9c')));_0x223ba6[_0x5230('0x8')](_0x5230('0x9d'),require(_0x5230('0x9e')));_0x223ba6['use'](_0x5230('0x9f'),require(_0x5230('0xa0')));_0x223ba6[_0x5230('0x8')](_0x5230('0xa1'),require('./api/intFreshdeskField'));_0x223ba6[_0x5230('0x8')](_0x5230('0xa2'),require(_0x5230('0xa3')));_0x223ba6[_0x5230('0x8')](_0x5230('0xa4'),require('./api/intVtigerConfiguration'));_0x223ba6[_0x5230('0x8')]('/api/integrations/vtiger/fields',require(_0x5230('0xa5')));_0x223ba6['use'](_0x5230('0xa6'),require(_0x5230('0xa7')));_0x223ba6[_0x5230('0x8')](_0x5230('0xa8'),require('./api/intServicenowConfiguration'));_0x223ba6[_0x5230('0x8')]('/api/integrations/servicenow/fields',require(_0x5230('0xa9')));_0x223ba6[_0x5230('0x8')](_0x5230('0xaa'),require(_0x5230('0xab')));_0x223ba6[_0x5230('0x8')]('/api/integrations/dynamics365/configurations',require(_0x5230('0xac')));_0x223ba6['use'](_0x5230('0xad'),require(_0x5230('0xae')));_0x223ba6[_0x5230('0x8')](_0x5230('0xaf'),require('./api/intFreshsalesAccount'));_0x223ba6['use'](_0x5230('0xb0'),require('./api/intFreshsalesConfiguration'));_0x223ba6[_0x5230('0x8')](_0x5230('0xb1'),require('./api/intFreshsalesField'));_0x223ba6[_0x5230('0x8')](_0x5230('0xb2'),require(_0x5230('0xb3')));_0x223ba6[_0x5230('0x8')](_0x5230('0xb4'),require(_0x5230('0xb5')));_0x223ba6['use'](_0x5230('0xb6'),require(_0x5230('0xb7')));_0x223ba6['use'](_0x5230('0xb8'),require('./api/jscriptyAnswerReport'));_0x223ba6['use'](_0x5230('0xb9'),require('./api/jscriptyQuestionReport'));_0x223ba6[_0x5230('0x8')](_0x5230('0xba'),require(_0x5230('0xbb')));_0x223ba6['use'](_0x5230('0xbc'),require('./api/smsQueueReport'));_0x223ba6['use']('/api/square/reports',require(_0x5230('0xbd')));_0x223ba6[_0x5230('0x8')](_0x5230('0xbe'),require(_0x5230('0xbf')));_0x223ba6[_0x5230('0x8')]('/api/jscripty/projects',require(_0x5230('0xc0')));_0x223ba6[_0x5230('0x8')]('/api/settings',require(_0x5230('0xc1')));_0x223ba6[_0x5230('0x8')]('/api/square/odbc',require(_0x5230('0xc2')));_0x223ba6['use'](_0x5230('0xc3'),require('./api/squareProject'));_0x223ba6[_0x5230('0x8')](_0x5230('0xc4'),require('./api/squareRecording'));_0x223ba6['use'](_0x5230('0xc5'),require(_0x5230('0xc6')));_0x223ba6[_0x5230('0x8')]('/api/teams',require(_0x5230('0xc7')));_0x223ba6[_0x5230('0x8')](_0x5230('0xc8'),require(_0x5230('0xc9')));_0x223ba6['use'](_0x5230('0xca'),require(_0x5230('0xcb')));_0x223ba6['use'](_0x5230('0xcc'),require('./api/migration'));_0x223ba6[_0x5230('0x8')](_0x5230('0xcd'),require('./api/attachment'));_0x223ba6[_0x5230('0x8')](_0x5230('0xce'),require(_0x5230('0xcf')));_0x223ba6[_0x5230('0x8')](_0x5230('0xd0'),require(_0x5230('0xd1')));_0x223ba6['use'](_0x5230('0xd2'),require(_0x5230('0xd3')));_0x223ba6[_0x5230('0x8')](_0x5230('0xd4'),require(_0x5230('0xd5')));_0x223ba6[_0x5230('0x8')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x223ba6[_0x5230('0x8')](_0x5230('0xd6'),require(_0x5230('0xd7')));_0x223ba6[_0x5230('0x8')](_0x5230('0xd8'),require(_0x5230('0xd9')));_0x223ba6[_0x5230('0x8')](_0x5230('0xda'),require(_0x5230('0xdb')));_0x223ba6[_0x5230('0x8')]('/api/userProfiles',require('./api/userProfile'));_0x223ba6[_0x5230('0x8')](_0x5230('0xdc'),require('./api/userProfileSection'));_0x223ba6['use']('/api/userProfile/resources',require(_0x5230('0xdd')));_0x223ba6[_0x5230('0x8')](_0x5230('0xde'),require(_0x5230('0xdf')));_0x223ba6['use'](_0x5230('0xe0'),require(_0x5230('0xe1')));_0x223ba6[_0x5230('0x8')]('/api/whatsapp/applications',require(_0x5230('0xe2')));_0x223ba6[_0x5230('0x8')](_0x5230('0xe3'),require(_0x5230('0xe4')));_0x223ba6['use'](_0x5230('0xe5'),require('./api/whatsappMessage'));_0x223ba6['use']('/api/whatsapp/reports/queue',require(_0x5230('0xe6')));_0x223ba6[_0x5230('0x8')](_0x5230('0xe7'),require(_0x5230('0xe8')));_0x223ba6[_0x5230('0x8')](_0x5230('0xe9'),require(_0x5230('0xea')));_0x223ba6[_0x5230('0x8')]('/api/cloudProviders',require(_0x5230('0xeb')));_0x223ba6[_0x5230('0x8')](_0x5230('0xec'),require('./api/realtime'));_0x223ba6['use'](_0x5230('0xed'),require(_0x5230('0xee')));_0x223ba6[_0x5230('0x8')](_0x5230('0xef'),require(_0x5230('0xf0')));_0x223ba6[_0x5230('0x8')](_0x5230('0xf1'),require(_0x5230('0xf2')));_0x223ba6['use']('/api/auth/activedirectory',require(_0x5230('0xf3')));_0x223ba6[_0x5230('0x8')](_0x5230('0xf4'),require(_0x5230('0xf5')));_0x223ba6['use'](_0x5230('0xf6'),require(_0x5230('0xf7')));_0x223ba6[_0x5230('0x8')](_0x5230('0xf8'),require(_0x5230('0xf9')));_0x223ba6['use'](_0x5230('0xfa'),require(_0x5230('0xfb')));_0x223ba6['use'](_0x5230('0xfc'),require(_0x5230('0xfd')));_0x223ba6['use']('/api/webbar',require(_0x5230('0xfe')));_0x223ba6[_0x5230('0x8')]('/api/logs',clientSideLogs);_0x223ba6[_0x5230('0x8')](_0x5230('0xff'),express['static'](path[_0x5230('0x100')](config[_0x5230('0x101')],_0x5230('0xff'))));_0x223ba6[_0x5230('0x8')](_0x5230('0x102'),express[_0x5230('0x103')](path['join'](config[_0x5230('0x101')],_0x5230('0x102'))));_0x223ba6['use'](_0x5230('0x104'),express[_0x5230('0x103')](path[_0x5230('0x100')](config[_0x5230('0x101')],'/demo')));_0x223ba6[_0x5230('0x8')]('/snippet',express[_0x5230('0x103')](path[_0x5230('0x100')](config['root'],_0x5230('0x105'),_0x5230('0x106'))));_0x223ba6[_0x5230('0x8')]('/plugins',express[_0x5230('0x103')](path[_0x5230('0x100')](config[_0x5230('0x101')],_0x5230('0x107'))));_0x223ba6[_0x5230('0x108')](_0x5230('0x109'))[_0x5230('0x10a')](errors[0x194]);_0x223ba6[_0x5230('0x108')]('/*')[_0x5230('0x10a')](function(_0x1eca9d,_0x377257){_0x377257['sendFile'](path[_0x5230('0x10b')](_0x223ba6[_0x5230('0x10a')](_0x5230('0x10c'))+_0x5230('0x10d')));});return _0x223ba6;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 2b47d0f..903e5be 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e9d=['default','jayson/promise','../config/environment','listen','../api/user/user.rpc','../api/voiceRecording/voiceRecording.rpc','merge','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers'];(function(_0x30f8ed,_0x1309da){var _0x43bee0=function(_0x5795bb){while(--_0x5795bb){_0x30f8ed['push'](_0x30f8ed['shift']());}};_0x43bee0(++_0x1309da);}(_0x1e9d,0x1dd));var _0xd1e9=function(_0x384ddb,_0x31c977){_0x384ddb=_0x384ddb-0x0;var _0xe03005=_0x1e9d[_0x384ddb];return _0xe03005;};'use strict';var jayson=require(_0xd1e9('0x0'));var _=require('lodash');var config=require(_0xd1e9('0x1'));exports[_0xd1e9('0x2')]=function(){return new Promise(function(_0x10f10e,_0x3ac1ee){var _0x42e387={};_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x3')));_0x42e387=_['merge'](_0x42e387,require('../api/voiceExtension/voiceExtension.rpc'));_0x42e387=_['merge'](_0x42e387,require('../api/voiceQueue/voiceQueue.rpc'));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x4')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x6')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x7')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x8')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x9')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0xa')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0xb')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0xc')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0xd')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0xe')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0xf')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x10')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x11')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x12')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/mailApplication/mailApplication.rpc'));_0x42e387=_['merge'](_0x42e387,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/faxAccount/faxAccount.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x13')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x14')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x15')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x16')));_0x42e387=_['merge'](_0x42e387,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x17')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x18')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/smsMessage/smsMessage.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x19')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x1a')));_0x42e387=_['merge'](_0x42e387,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x1b')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x42e387=_['merge'](_0x42e387,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x1c')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/chatMessage/chatMessage.rpc'));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x1d')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x1e')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x1f')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x20')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x21')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x22')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x23')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/pause/pause.rpc'));_0x42e387=_['merge'](_0x42e387,require('../api/sound/sound.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x24')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x25')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/variable/variable.rpc'));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x26')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x27')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x28')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x29')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x2a')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x2b')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x2c')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x2d')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x2e')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x2f')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x30')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x31')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/setting/setting.rpc'));_0x42e387=_['merge'](_0x42e387,require('../api/squareOdbc/squareOdbc.rpc'));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x32')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x33')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/squareMessage/squareMessage.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x34')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/attachment/attachment.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x35')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x36')));_0x42e387=_['merge'](_0x42e387,require(_0xd1e9('0x37')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x38')));_0x42e387=_[_0xd1e9('0x5')](_0x42e387,require(_0xd1e9('0x39')));var _0x5a046e=jayson[_0xd1e9('0x3a')](_0x42e387)[_0xd1e9('0x3b')]();var _0x30bd76=config[_0xd1e9('0x3c')][_0xd1e9('0x3d')]||config[_0xd1e9('0x3d')]+0x1;var _0x1b33d0=config[_0xd1e9('0x3c')]['ip']||_0xd1e9('0x3e');_0x5a046e['on'](_0xd1e9('0x3f'),function(_0x4572bc){return _0x3ac1ee(_0x4572bc);});_0x5a046e['listen'](_0x30bd76,_0x1b33d0,function(){console[_0xd1e9('0x40')](_0xd1e9('0x41'),_0x1b33d0,_0x30bd76);require(_0xd1e9('0x42'))[_0xd1e9('0x43')]();return _0x10f10e('RPC\x20listening\x20on\x20'+_0x1b33d0+':'+_0x30bd76);});});}; \ No newline at end of file +var _0xc8e9=['../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../api/user/user.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc'];(function(_0xa2c378,_0xf2bde1){var _0x40eebc=function(_0x2101cc){while(--_0x2101cc){_0xa2c378['push'](_0xa2c378['shift']());}};_0x40eebc(++_0xf2bde1);}(_0xc8e9,0x18c));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var _=require(_0x9c8e('0x0'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x243a0d,_0xe09bc4){var _0x730907={};_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x1')));_0x730907=_['merge'](_0x730907,require('../api/voiceExtension/voiceExtension.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/voiceQueue/voiceQueue.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x3')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x4')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x5')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x6')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x7')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x8')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x9')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xa')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xb')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xc')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/mailQueue/mailQueue.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xd')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xe')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/mailApplication/mailApplication.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xf')));_0x730907=_['merge'](_0x730907,require('../api/faxAccount/faxAccount.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x10')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x11')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x12')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x13')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x14')));_0x730907=_['merge'](_0x730907,require('../api/smsAccount/smsAccount.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x15')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x16')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x17')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x18')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x19')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x1a')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x1b')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x1c')));_0x730907=_['merge'](_0x730907,require('../api/chatMessage/chatMessage.rpc'));_0x730907=_['merge'](_0x730907,require('../api/chatQueue/chatQueue.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/cmContact/cmContact.rpc'));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x1d')));_0x730907=_['merge'](_0x730907,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x1e')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x1f')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x20')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/pause/pause.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x21')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x22')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x23')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/trigger/trigger.rpc'));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x24')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x25')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x26')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x27')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x28')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x29')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x2a')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x2b')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x2c')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x2d')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x2e')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x2f')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x30')));_0x730907=_['merge'](_0x730907,require('../api/setting/setting.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x31')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x32')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/squareRecording/squareRecording.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x33')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x34')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x35')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x36')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x37')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x38')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x39')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x3a')));var _0x1b91c5=jayson['server'](_0x730907)[_0x9c8e('0x3b')]();var _0x587811=config[_0x9c8e('0x3c')]['port']||config[_0x9c8e('0x3d')]+0x1;var _0x551358=config[_0x9c8e('0x3c')]['ip']||'localhost';_0x1b91c5['on'](_0x9c8e('0x3e'),function(_0x33ce50){return _0xe09bc4(_0x33ce50);});_0x1b91c5[_0x9c8e('0x3f')](_0x587811,_0x551358,function(){console[_0x9c8e('0x40')](_0x9c8e('0x41'),_0x551358,_0x587811);require(_0x9c8e('0x42'))[_0x9c8e('0x43')]();return _0x243a0d(_0x9c8e('0x44')+_0x551358+':'+_0x587811);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 1cb4f59..22b0a66 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fd6=['SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','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','exec','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','setTimeout','setEncoding','utf8','headers','emit','ready','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','timeout','destroy','pipe','write','inherits','prototype','command','answer','sendRequest','ANSWER','getData','beep','noop','NO\x20MESSAGE','format','isArray','join','setContext'];(function(_0x7b818,_0x1770ad){var _0x49c658=function(_0x4416ec){while(--_0x4416ec){_0x7b818['push'](_0x7b818['shift']());}};_0x49c658(++_0x1770ad);}(_0x7fd6,0x157));var _0x67fd=function(_0x31210f,_0x4c5061){_0x31210f=_0x31210f-0x0;var _0x15b6d6=_0x7fd6[_0x31210f];return _0x15b6d6;};'use strict';var util=require(_0x67fd('0x0'));var _=require('lodash');var EventEmitter=require(_0x67fd('0x1'))[_0x67fd('0x2')];var AGIReply=require(_0x67fd('0x3'));var AGIError=require(_0x67fd('0x4'));function AGIChannel(_0x251423){var _0xbdd0c0=this,_0x4f52bc=new AGIReply(),_0x187f3e=![],_0x50238d={};EventEmitter['call'](_0xbdd0c0);_0x251423['setEncoding']('utf8');_0x251423[_0x67fd('0x5')](0x8*0x3c*0x3c*0x3e8);_0x4f52bc[_0x67fd('0x6')](_0x67fd('0x7'));_0x4f52bc['on'](_0x67fd('0x8'),function(_0x74be46){for(var _0x4245ee in _0x74be46){_0xbdd0c0[_0x4245ee]=_0x74be46[_0x4245ee];}_0xbdd0c0[_0x67fd('0x9')](_0x67fd('0xa'));});_0x4f52bc['on']('line',function(_0x25ce35){if(_0x25ce35[_0x67fd('0xb')]()==_0x67fd('0xc')){_0xbdd0c0[_0x67fd('0x9')](_0x67fd('0xc'));return;}if(_0x25ce35[_0x67fd('0xd')](0x0,0xb)=='520-Invalid'){_0x187f3e=!![];}if(_0x187f3e){_0x50238d['rx']+=_0x25ce35+'\x0a';if(_0x25ce35[_0x67fd('0xe')](_0x67fd('0xf'))!=-0x1){_0x187f3e=![];}}else{_0x50238d['rx']=_0x25ce35;}if(_0x187f3e){return;}if(typeof _0x50238d['cb']==_0x67fd('0x10')){var _0x133c2f=_0x50238d['rx'][_0x67fd('0xd')](0x0,0x3),_0x13dd7c=null,_0x41876c=null;_0x133c2f=parseInt(_0x133c2f);if(isNaN(_0x133c2f)){_0x50238d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x67fd('0x11')});return;}if(_0x133c2f!=0xc8){_0x50238d['cb'](null,{'code':_0x133c2f,'result':-0x1,'extra':'KO'});return;}_0x13dd7c=_0x50238d['rx'][_0x67fd('0xd')](0x4)[_0x67fd('0x12')](_0x67fd('0x13'),'');if(_0x13dd7c['indexOf']('\x20')!=-0x1){_0x13dd7c=_0x13dd7c[_0x67fd('0x14')](0x0,_0x13dd7c[_0x67fd('0x15')]('\x20'));}if(_[_0x67fd('0x16')](_0x13dd7c,'-1')){_0x13dd7c=parseInt(_0x13dd7c);}_0x41876c=_0x50238d['rx'][_0x67fd('0x17')]('\x20');if(_0x41876c['length']==0x3){_0x41876c=_0x41876c[0x2][_0x67fd('0xd')](0x1,_0x41876c[0x2][_0x67fd('0x18')]-0x1);}else if(_0x41876c['length']>0x3){var _0x285828=/\((.+)\)/;var _0x260a90=_0x50238d['rx'][_0x67fd('0x19')](_0x285828);if(_0x260a90){_0x41876c=_0x260a90[0x1];}else{_0x41876c=null;}}else{_0x41876c=null;}_0x50238d['cb'](null,{'code':_0x133c2f,'result':_0x13dd7c,'extra':_0x41876c});}});_0x251423['on'](_0x67fd('0x1a'),function(_0x412a1c){_0xbdd0c0[_0x67fd('0x9')](_0x67fd('0x1a'),new AGIError(_0x67fd('0x1b'),_0x412a1c['code']));});_0x251423['on'](_0x67fd('0x1c'),function(){_0xbdd0c0['emit'](_0x67fd('0x1c'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x251423['on'](_0x67fd('0x1d'),function(){_0xbdd0c0[_0x67fd('0x9')](_0x67fd('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x251423[_0x67fd('0x1e')]();});_0x251423[_0x67fd('0x1f')](_0x4f52bc);this['command']=function(_0x9409fb,_0x20f8b6){var _0x9409fb=_0x9409fb||'',_0x20f8b6=typeof _0x20f8b6==_0x67fd('0x10')?_0x20f8b6:new Function();_0x50238d={'tx':_0x9409fb,'rx':'','cb':_0x20f8b6};_0x251423[_0x67fd('0x20')](_0x9409fb+'\x0a');},this[_0x67fd('0x1c')]=function(){_0x251423[_0x67fd('0x1e')]();};}util[_0x67fd('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x67fd('0x22')]['sendRequest']=function(_0x2e7999){return this[_0x67fd('0x23')]['sync'](this,_0x2e7999);};AGIChannel['prototype'][_0x67fd('0x24')]=function(){return this[_0x67fd('0x25')](_0x67fd('0x26'));};AGIChannel[_0x67fd('0x22')][_0x67fd('0x27')]=function(_0x8d4eff,_0x4d7360,_0x9b095a){_0x8d4eff=_0x8d4eff===undefined?_0x67fd('0x28'):_0x8d4eff;_0x4d7360=_0x4d7360===undefined?'5':_0x4d7360;_0x9b095a=_0x9b095a===undefined?'1':_0x9b095a;return this[_0x67fd('0x25')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x8d4eff,_0x4d7360*0x3e8,_0x9b095a));};AGIChannel[_0x67fd('0x22')][_0x67fd('0x29')]=function(_0x39c569){_0x39c569=_0x39c569||_0x67fd('0x2a');return this[_0x67fd('0x25')](util[_0x67fd('0x2b')]('VERBOSE\x20\x22%s\x22',_0x39c569));};AGIChannel[_0x67fd('0x22')]['exec']=function(_0x235f8a,_0x9b424b){if(_[_0x67fd('0x2c')](_0x9b424b)){return this[_0x67fd('0x25')](util['format']('EXEC\x20%s\x20%s',_0x235f8a,_0x9b424b[_0x67fd('0x2d')](',')));}return this['sendRequest'](util[_0x67fd('0x2b')]('EXEC\x20%s\x20%s',_0x235f8a,_0x9b424b));};AGIChannel['prototype'][_0x67fd('0x2e')]=function(_0x38101b){return this[_0x67fd('0x25')](util[_0x67fd('0x2b')](_0x67fd('0x2f'),_0x38101b));};AGIChannel[_0x67fd('0x22')][_0x67fd('0x30')]=function(_0x4977ef){return this['sendRequest'](util[_0x67fd('0x2b')](_0x67fd('0x31'),_0x4977ef));};AGIChannel['prototype']['setPriority']=function(_0x4514ce){return this[_0x67fd('0x25')](util[_0x67fd('0x2b')](_0x67fd('0x32'),_0x4514ce));};AGIChannel[_0x67fd('0x22')][_0x67fd('0xc')]=function(){return this[_0x67fd('0x25')](_0x67fd('0x33'));};AGIChannel[_0x67fd('0x22')][_0x67fd('0x34')]=function(_0x3f114a,_0x48ffb9){var _0x3074ac=_[_0x67fd('0x35')](_0x48ffb9)||_['isNumber'](_0x48ffb9)?_0x48ffb9['toString']():_0x48ffb9;return this[_0x67fd('0x25')](util['format'](_0x67fd('0x36'),_0x3f114a,_0x3074ac?_0x3074ac[_0x67fd('0x37')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x67fd('0x22')][_0x67fd('0x38')]=function(_0x66a7bf,_0x1e8af4){return this[_0x67fd('0x25')](util[_0x67fd('0x2b')](_0x67fd('0x39'),_0x66a7bf,_0x1e8af4));};AGIChannel[_0x67fd('0x22')][_0x67fd('0x3a')]=function(_0x332af3,_0x5c78f6){return this[_0x67fd('0x25')](util[_0x67fd('0x2b')](_0x67fd('0x3b'),_0x332af3,_0x5c78f6));};AGIChannel[_0x67fd('0x22')][_0x67fd('0x3c')]=function(_0x18de55,_0x55cf3a){return this['sendRequest'](util[_0x67fd('0x2b')](_0x67fd('0x3d'),_0x18de55,_0x55cf3a));};AGIChannel[_0x67fd('0x22')][_0x67fd('0x3e')]=function(_0x46c4c2,_0x595c7b,_0xd094f7){_0x595c7b=_0x595c7b||this[_0x67fd('0x3f')];_0xd094f7=_0xd094f7||0x1;this[_0x67fd('0x2e')](_0x46c4c2);this[_0x67fd('0x30')](_0x595c7b);this['setPriority'](_0xd094f7);return this['noop'](util['format'](_0x67fd('0x40'),_0x46c4c2,_0x595c7b,_0xd094f7));};AGIChannel[_0x67fd('0x22')]['getVariable']=function(_0x7d4916){return this[_0x67fd('0x25')](util[_0x67fd('0x2b')](_0x67fd('0x41'),_0x7d4916));};AGIChannel[_0x67fd('0x22')][_0x67fd('0x42')]=function(_0x48f775,_0x401d3d,_0x86f0e9,_0x1795ea,_0x499bc1,_0xa84cc){_0x401d3d=_0x401d3d||_0x67fd('0x43');_0x86f0e9=_0x86f0e9||'';_0x1795ea=_0x1795ea===undefined?-0x1:_0x1795ea==='-1'?-0x1:_0x1795ea*0x3e8;_0x499bc1=_0x499bc1===undefined?'':'s='+_0x499bc1;_0xa84cc=_0xa84cc?'BEEP':'';return this[_0x67fd('0x25')](util[_0x67fd('0x2b')](_0x67fd('0x44'),_0x48f775,_0x401d3d,_0x86f0e9,_0x1795ea,_0xa84cc,_0x499bc1));};AGIChannel['prototype'][_0x67fd('0x45')]=function(_0x428a60,_0x26ebe6){_0x26ebe6=_0x26ebe6||'';return this[_0x67fd('0x25')](util[_0x67fd('0x2b')](_0x67fd('0x46'),_0x428a60,_0x26ebe6));};AGIChannel['prototype'][_0x67fd('0x47')]=function(_0x577c9a){return this[_0x67fd('0x48')](_0x67fd('0x49'),_0x577c9a);};AGIChannel[_0x67fd('0x22')]['wait']=function(_0x7eb681){return this['exec'](_0x67fd('0x4a'),_0x7eb681);};AGIChannel[_0x67fd('0x22')][_0x67fd('0x1a')]=function(_0x2fe428,_0x4a3154){this[_0x67fd('0x29')](util[_0x67fd('0x2b')](_0x67fd('0x4b'),_0x2fe428['id'],_0x2fe428[_0x67fd('0x4c')],_0x4a3154));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x67fd('0x4d')]=AGIChannel; \ No newline at end of file +var _0x0b62=['prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setExtension','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./error','setEncoding','utf8','setTimeout','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','command','function','write','inherits'];(function(_0x1ed4ae,_0x3d6af9){var _0x37debd=function(_0x158679){while(--_0x158679){_0x1ed4ae['push'](_0x1ed4ae['shift']());}};_0x37debd(++_0x3d6af9);}(_0x0b62,0x177));var _0x20b6=function(_0xce7869,_0x360876){_0xce7869=_0xce7869-0x0;var _0x9062a=_0x0b62[_0xce7869];return _0x9062a;};'use strict';var util=require(_0x20b6('0x0'));var _=require(_0x20b6('0x1'));var EventEmitter=require('events')[_0x20b6('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x20b6('0x3'));function AGIChannel(_0x1c823a){var _0x3c062c=this,_0x714b86=new AGIReply(),_0x44154f=![],_0x195273={};EventEmitter['call'](_0x3c062c);_0x1c823a[_0x20b6('0x4')](_0x20b6('0x5'));_0x1c823a[_0x20b6('0x6')](0x8*0x3c*0x3c*0x3e8);_0x714b86[_0x20b6('0x4')](_0x20b6('0x5'));_0x714b86['on'](_0x20b6('0x7'),function(_0x1e07d5){for(var _0x106144 in _0x1e07d5){_0x3c062c[_0x106144]=_0x1e07d5[_0x106144];}_0x3c062c[_0x20b6('0x8')]('ready');});_0x714b86['on'](_0x20b6('0x9'),function(_0x4e85c6){if(_0x4e85c6[_0x20b6('0xa')]()==_0x20b6('0xb')){_0x3c062c[_0x20b6('0x8')](_0x20b6('0xb'));return;}if(_0x4e85c6[_0x20b6('0xc')](0x0,0xb)==_0x20b6('0xd')){_0x44154f=!![];}if(_0x44154f){_0x195273['rx']+=_0x4e85c6+'\x0a';if(_0x4e85c6[_0x20b6('0xe')](_0x20b6('0xf'))!=-0x1){_0x44154f=![];}}else{_0x195273['rx']=_0x4e85c6;}if(_0x44154f){return;}if(typeof _0x195273['cb']=='function'){var _0x238291=_0x195273['rx'][_0x20b6('0xc')](0x0,0x3),_0x5e83b0=null,_0x3918a6=null;_0x238291=parseInt(_0x238291);if(isNaN(_0x238291)){_0x195273['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x20b6('0x10')});return;}if(_0x238291!=0xc8){_0x195273['cb'](null,{'code':_0x238291,'result':-0x1,'extra':'KO'});return;}_0x5e83b0=_0x195273['rx'][_0x20b6('0xc')](0x4)[_0x20b6('0x11')]('result=','');if(_0x5e83b0[_0x20b6('0x12')]('\x20')!=-0x1){_0x5e83b0=_0x5e83b0[_0x20b6('0x13')](0x0,_0x5e83b0[_0x20b6('0x12')]('\x20'));}if(_[_0x20b6('0x14')](_0x5e83b0,'-1')){_0x5e83b0=parseInt(_0x5e83b0);}_0x3918a6=_0x195273['rx'][_0x20b6('0x15')]('\x20');if(_0x3918a6[_0x20b6('0x16')]==0x3){_0x3918a6=_0x3918a6[0x2]['substring'](0x1,_0x3918a6[0x2][_0x20b6('0x16')]-0x1);}else if(_0x3918a6[_0x20b6('0x16')]>0x3){var _0x23e254=/\((.+)\)/;var _0x5192ba=_0x195273['rx'][_0x20b6('0x17')](_0x23e254);if(_0x5192ba){_0x3918a6=_0x5192ba[0x1];}else{_0x3918a6=null;}}else{_0x3918a6=null;}_0x195273['cb'](null,{'code':_0x238291,'result':_0x5e83b0,'extra':_0x3918a6});}});_0x1c823a['on'](_0x20b6('0x18'),function(_0x354930){_0x3c062c['emit'](_0x20b6('0x18'),new AGIError(_0x20b6('0x19'),_0x354930[_0x20b6('0x1a')]));});_0x1c823a['on'](_0x20b6('0x1b'),function(){_0x3c062c[_0x20b6('0x8')](_0x20b6('0x1b'),new AGIError(_0x20b6('0x1c')));});_0x1c823a['on'](_0x20b6('0x1d'),function(){_0x3c062c[_0x20b6('0x8')](_0x20b6('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1c823a[_0x20b6('0x1e')]();});_0x1c823a['pipe'](_0x714b86);this[_0x20b6('0x1f')]=function(_0x2f6b9a,_0x3878b5){var _0x2f6b9a=_0x2f6b9a||'',_0x3878b5=typeof _0x3878b5==_0x20b6('0x20')?_0x3878b5:new Function();_0x195273={'tx':_0x2f6b9a,'rx':'','cb':_0x3878b5};_0x1c823a[_0x20b6('0x21')](_0x2f6b9a+'\x0a');},this['close']=function(){_0x1c823a['destroy']();};}util[_0x20b6('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x20b6('0x23')][_0x20b6('0x24')]=function(_0x501453){return this['command'][_0x20b6('0x25')](this,_0x501453);};AGIChannel[_0x20b6('0x23')][_0x20b6('0x26')]=function(){return this['sendRequest'](_0x20b6('0x27'));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x28')]=function(_0x9ce6fc,_0x3861f2,_0x448146){_0x9ce6fc=_0x9ce6fc===undefined?_0x20b6('0x29'):_0x9ce6fc;_0x3861f2=_0x3861f2===undefined?'5':_0x3861f2;_0x448146=_0x448146===undefined?'1':_0x448146;return this[_0x20b6('0x24')](util[_0x20b6('0x2a')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x9ce6fc,_0x3861f2*0x3e8,_0x448146));};AGIChannel[_0x20b6('0x23')]['noop']=function(_0x410377){_0x410377=_0x410377||_0x20b6('0x2b');return this[_0x20b6('0x24')](util['format'](_0x20b6('0x2c'),_0x410377));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x2d')]=function(_0xb21276,_0x38b9ff){if(_[_0x20b6('0x2e')](_0x38b9ff)){return this[_0x20b6('0x24')](util['format'](_0x20b6('0x2f'),_0xb21276,_0x38b9ff[_0x20b6('0x30')](',')));}return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x2f'),_0xb21276,_0x38b9ff));};AGIChannel['prototype']['setContext']=function(_0xdec1d2){return this[_0x20b6('0x24')](util['format'](_0x20b6('0x31'),_0xdec1d2));};AGIChannel['prototype']['setExtension']=function(_0x4d1e09){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x32'),_0x4d1e09));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x33')]=function(_0x57f30b){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')]('SET\x20PRIORITY\x20%s',_0x57f30b));};AGIChannel[_0x20b6('0x23')][_0x20b6('0xb')]=function(){return this[_0x20b6('0x24')]('HANGUP');};AGIChannel[_0x20b6('0x23')][_0x20b6('0x34')]=function(_0x1893f1,_0x59dad0){var _0x3219d5=_[_0x20b6('0x35')](_0x59dad0)||_[_0x20b6('0x36')](_0x59dad0)?_0x59dad0[_0x20b6('0x37')]():_0x59dad0;return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x38'),_0x1893f1,_0x3219d5?_0x3219d5[_0x20b6('0x37')]()[_0x20b6('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x39')]=function(_0x5e499e,_0x39b7be){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x3a'),_0x5e499e,_0x39b7be));};AGIChannel['prototype'][_0x20b6('0x3b')]=function(_0x269049,_0x4263f7){return this['sendRequest'](util[_0x20b6('0x2a')](_0x20b6('0x3c'),_0x269049,_0x4263f7));};AGIChannel['prototype'][_0x20b6('0x3d')]=function(_0x49eae0,_0x53ae09){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x3e'),_0x49eae0,_0x53ae09));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x3f')]=function(_0x1782dd,_0x3cd581,_0x5f479e){_0x3cd581=_0x3cd581||this[_0x20b6('0x40')];_0x5f479e=_0x5f479e||0x1;this[_0x20b6('0x41')](_0x1782dd);this[_0x20b6('0x42')](_0x3cd581);this['setPriority'](_0x5f479e);return this[_0x20b6('0x43')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x1782dd,_0x3cd581,_0x5f479e));};AGIChannel['prototype'][_0x20b6('0x44')]=function(_0x16fa7d){return this['sendRequest'](util[_0x20b6('0x2a')](_0x20b6('0x45'),_0x16fa7d));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x46')]=function(_0x3eb27f,_0x11edc3,_0x9d7ae3,_0x186190,_0x167eab,_0x5aab15){_0x11edc3=_0x11edc3||_0x20b6('0x47');_0x9d7ae3=_0x9d7ae3||'';_0x186190=_0x186190===undefined?-0x1:_0x186190==='-1'?-0x1:_0x186190*0x3e8;_0x167eab=_0x167eab===undefined?'':'s='+_0x167eab;_0x5aab15=_0x5aab15?_0x20b6('0x48'):'';return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x49'),_0x3eb27f,_0x11edc3,_0x9d7ae3,_0x186190,_0x5aab15,_0x167eab));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x4a')]=function(_0x3e7df0,_0x192f71){_0x192f71=_0x192f71||'';return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x4b'),_0x3e7df0,_0x192f71));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x4c')]=function(_0x549056){return this[_0x20b6('0x2d')]('AGI',_0x549056);};AGIChannel[_0x20b6('0x23')][_0x20b6('0x4d')]=function(_0x414629){return this['exec'](_0x20b6('0x4e'),_0x414629);};AGIChannel[_0x20b6('0x23')][_0x20b6('0x18')]=function(_0x351d3e,_0x2112ce){this['noop'](util[_0x20b6('0x2a')](_0x20b6('0x4f'),_0x351d3e['id'],_0x351d3e[_0x20b6('0x50')],_0x2112ce));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x20b6('0x51')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 33cdd57..cc2ef9d 100644 --- a/server/services/agi/error.js +++ b/server/services/agi/error.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b3b=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format'];(function(_0x2b608e,_0x2b9d76){var _0x2aca67=function(_0x1a6ac5){while(--_0x1a6ac5){_0x2b608e['push'](_0x2b608e['shift']());}};_0x2aca67(++_0x2b9d76);}(_0x8b3b,0x12d));var _0xb8b3=function(_0x52fa1e,_0x39a40f){_0x52fa1e=_0x52fa1e-0x0;var _0x26849d=_0x8b3b[_0x52fa1e];return _0x26849d;};'use strict';var util=require(_0xb8b3('0x0'));var error={'E_AGI_UNDEFINED':_0xb8b3('0x1'),'E_AGI_ARGUMENT_PORT':_0xb8b3('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xb8b3('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xb8b3('0x4'),'E_AGI_SOCKET_ERROR':_0xb8b3('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xb8b3('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb8b3('0x7'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0xce2e2a){var _0xce2e2a=_0xce2e2a||null,_0x4753fa=_0x4753fa||[],_0x170e00=0x1,_0x124b13='';if(!error[_0xce2e2a]){_0xce2e2a=_0xb8b3('0x8');}_0x4753fa['push'](error[_0xce2e2a]);while(arguments[_0x170e00]){_0x4753fa[_0xb8b3('0x9')](arguments[_0x170e00]);_0x170e00++;}_0x124b13=util[_0xb8b3('0xa')]['apply'](util,_0x4753fa);this['message']=_0x124b13;this[_0xb8b3('0xb')]=_0xce2e2a;}module[_0xb8b3('0xc')]=AGIError; \ No newline at end of file +var _0x6f37=['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.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name','util'];(function(_0x5d04c0,_0x312567){var _0xee356e=function(_0x19b13f){while(--_0x19b13f){_0x5d04c0['push'](_0x5d04c0['shift']());}};_0xee356e(++_0x312567);}(_0x6f37,0x1d0));var _0x76f3=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x6f37[_0x7ad123];return _0x37d073;};'use strict';var util=require(_0x76f3('0x0'));var error={'E_AGI_UNDEFINED':_0x76f3('0x1'),'E_AGI_ARGUMENT_PORT':_0x76f3('0x2'),'E_AGI_SERVER_ERROR':_0x76f3('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x76f3('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x76f3('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x76f3('0x6'),'E_AGI_COMMAND_EMPTY':_0x76f3('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x76f3('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x329679){var _0x329679=_0x329679||null,_0x54b080=_0x54b080||[],_0x3a9076=0x1,_0x16e204='';if(!error[_0x329679]){_0x329679=_0x76f3('0x9');}_0x54b080[_0x76f3('0xa')](error[_0x329679]);while(arguments[_0x3a9076]){_0x54b080['push'](arguments[_0x3a9076]);_0x3a9076++;}_0x16e204=util[_0x76f3('0xb')][_0x76f3('0xc')](util,_0x54b080);this[_0x76f3('0xd')]=_0x16e204;this[_0x76f3('0xe')]=_0x329679;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 3268340..2dd9cd4 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4f6=['./error','../../config/environment','redis','defaults','localhost','subscribe','emit','E_AGI_SERVER_ERROR','message','agi','parse','projectUpdate','exports','events','EventEmitter','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4f6,0x13d));var _0x6d4f=function(_0x5352aa,_0x13fbee){_0x5352aa=_0x5352aa-0x0;var _0x19b8ad=_0xd4f6[_0x5352aa];return _0x19b8ad;};'use strict';var _=require('lodash');var EventEmitter=require(_0x6d4f('0x0'))[_0x6d4f('0x1')];var Redis=require(_0x6d4f('0x2'));var AGIError=require(_0x6d4f('0x3'));var config=require(_0x6d4f('0x4'));config[_0x6d4f('0x5')]=_[_0x6d4f('0x6')](config['redis'],{'host':_0x6d4f('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x6d4f('0x5')]);sub[_0x6d4f('0x8')]('agi',function(_0x20526e){if(_0x20526e)return eventEmitter[_0x6d4f('0x9')]('error',new AGIError(_0x6d4f('0xa'),_0x20526e));});sub['on'](_0x6d4f('0xb'),function(_0x60686e,_0x95f5db){if(_0x60686e!==_0x6d4f('0xc'))return;try{var _0xfadccc=JSON[_0x6d4f('0xd')](_0x95f5db);eventEmitter[_0x6d4f('0x9')](_0x6d4f('0xe'),_0xfadccc);}catch(_0x3e03d4){eventEmitter[_0x6d4f('0x9')]('error',new AGIError(_0x6d4f('0xa'),_0x3e03d4));}});module[_0x6d4f('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x1935=['defaults','redis','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR','message','projectUpdate','error','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1935,0x71));var _0x5193=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x1935[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x5193('0x0'));var EventEmitter=require(_0x5193('0x1'))[_0x5193('0x2')];var Redis=require(_0x5193('0x3'));var AGIError=require(_0x5193('0x4'));var config=require(_0x5193('0x5'));config['redis']=_[_0x5193('0x6')](config[_0x5193('0x7')],{'host':_0x5193('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x5193('0x7')]);sub[_0x5193('0x9')](_0x5193('0xa'),function(_0x5a9aab){if(_0x5a9aab)return eventEmitter[_0x5193('0xb')]('error',new AGIError(_0x5193('0xc'),_0x5a9aab));});sub['on'](_0x5193('0xd'),function(_0xcfe9ec,_0x3adcf6){if(_0xcfe9ec!==_0x5193('0xa'))return;try{var _0x3754a8=JSON['parse'](_0x3adcf6);eventEmitter['emit'](_0x5193('0xe'),_0x3754a8);}catch(_0x3a37f4){eventEmitter[_0x5193('0xb')](_0x5193('0xf'),new AGIError(_0x5193('0xc'),_0x3a37f4));}});module[_0x5193('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 23d4237..ef9ddb4 100644 --- a/server/services/agi/graph/index.js +++ b/server/services/agi/graph/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09eb=['getdigits','getsecretdigits','numberOfEdges','prototype','vertices','addEdge','edges','push','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','target','default','agicommand','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x09eb,0x1b0));var _0xb09e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x09eb[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xb09e('0x0'));var logger=require(_0xb09e('0x1'))('agi');var verticesWithRetry=[_0xb09e('0x2'),_0xb09e('0x3'),_0xb09e('0x4')];var Graph=function(){this['vertices']={};this['edges']={};this[_0xb09e('0x5')]=0x0;};Graph[_0xb09e('0x6')]['addVertex']=function(_0x1f93f9){this[_0xb09e('0x7')][_0x1f93f9['id']]=_0x1f93f9;this['edges'][_0x1f93f9['id']]=[];};Graph[_0xb09e('0x6')][_0xb09e('0x8')]=function(_0xd85de4,_0x19ef9f,_0x4546a5){this[_0xb09e('0x9')][_0xd85de4][_0xb09e('0xa')]({'target':_0x19ef9f,'condition':_0x4546a5});this[_0xb09e('0x5')]+=0x1;};Graph['prototype'][_0xb09e('0xb')]=function(){return _[_0xb09e('0xb')](this[_0xb09e('0x7')]);};Graph[_0xb09e('0x6')]['relations']=function(){return this['numberOfEdges'];};Graph['prototype'][_0xb09e('0xc')]=function(_0x1df274){return this['vertices'][_0x1df274];};Graph['prototype'][_0xb09e('0xd')]=function(_0x11e6bb,_0x57bed0){if(!this[_0xb09e('0x7')][_0x11e6bb]){return logger[_0xb09e('0xe')](_0xb09e('0xf'));}var _0xbcd061=_0x57bed0(this[_0xb09e('0x7')][_0x11e6bb]);if(!_0xbcd061){return logger[_0xb09e('0xe')](_0xb09e('0x10'));}if(this[_0xb09e('0x9')][_0x11e6bb][_0xb09e('0x11')]===0x0){return logger[_0xb09e('0xe')]('no\x20edge/s\x20available');}for(var _0xe4edcb=0x0,_0x244b60=[],_0x290074=![];_0xe4edcb\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','close','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','listening','connection','lodash','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','nextTick','error','stack','deleted','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','evtHangup','then','catch','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa34b,0x1ac));var _0xba34=function(_0xb8e47e,_0xd5670f){_0xb8e47e=_0xb8e47e-0x0;var _0xfff2aa=_0xa34b[_0xb8e47e];return _0xfff2aa;};'use strict';var _=require(_0xba34('0x0'));var syncho=require('syncho');var util=require(_0xba34('0x1'));var config=require(_0xba34('0x2'));var logger=require(_0xba34('0x3'))(_0xba34('0x4'));var utilLicense=require(_0xba34('0x5'));var rpc=require(_0xba34('0x6'));var Project=require(_0xba34('0x7'));var AGIEmitter=require(_0xba34('0x8'))[_0xba34('0x9')];var projects=[];config[_0xba34('0x4')]=_[_0xba34('0xa')](config['agi'],{'ip':_0xba34('0xb'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x458f71){process[_0xba34('0xc')](function(){syncho(function(){try{setChannelVariables(_0x458f71);agiHandler(_0x458f71);}catch(_0x50f5e4){logger[_0xba34('0xd')](_0x50f5e4[_0xba34('0xe')]);}});});}function projectUpdateHandler(_0x3844ab){try{var _0x1fe186=_['findIndex'](projects,['id',_0x3844ab['id']]);if(_0x1fe186>-0x1){if(_0x3844ab[_0xba34('0xf')]===!![]){projects['splice'](_0x1fe186,0x1);}else{projects[_0x1fe186]=_0x3844ab;}}else{projects['push'](_0x3844ab);}}catch(_0x403220){logger[_0xba34('0xd')](_0x403220[_0xba34('0xe')]);}}function listeningHandler(){console[_0xba34('0x10')](_0xba34('0x11'),config['agi'][_0xba34('0x12')]);logger[_0xba34('0x13')](util[_0xba34('0x14')](_0xba34('0x15'),config[_0xba34('0x4')]['ip'],config[_0xba34('0x4')][_0xba34('0x12')]));}function errorHandler(_0x592fb2){if(_0x592fb2&&_0x592fb2[_0xba34('0x16')]&&_0x592fb2[_0xba34('0x17')]){logger[_0xba34('0xd')](util[_0xba34('0x14')](_0xba34('0x18'),_0x592fb2[_0xba34('0x16')],_0x592fb2[_0xba34('0x17')]));}else{logger[_0xba34('0xd')](util['format'](_0xba34('0x19'),_0x592fb2['stack']));}}function closeHandler(){logger['info'](util[_0xba34('0x14')](_0xba34('0x1a'),this['arg_1'],this['calleridname'],this['callerid'],this['dnid'],this[_0xba34('0x1b')]));try{createSquareReport(this);}catch(_0x44cee5){logger[_0xba34('0xd')](_0x44cee5['stack']);}}function timeoutHandler(){logger['info'](util[_0xba34('0x14')](_0xba34('0x1c'),this['arg_1'],this[_0xba34('0x1d')],this[_0xba34('0x1e')],this[_0xba34('0x1f')],this[_0xba34('0x1b')]));}function hangupHandler(){logger['info'](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0xba34('0x1e')],this['dnid'],this[_0xba34('0x1b')]));this[_0xba34('0x20')]=!![];}function createSquareReport(_0x173531,_0x519ca3){rpc['createSquareReport'](_0x173531)[_0xba34('0x21')](function(_0x3b657a){if(_0x519ca3){_0x519ca3(null,_0x3b657a);}})[_0xba34('0x22')](function(_0x3e6965){if(_0x519ca3){_0x519ca3(null,_0x3e6965);}});}function setChannelVariables(_0x534dfd){for(var _0xfc539d in _0x534dfd){if(_0x534dfd[_0xba34('0x23')](_0xfc539d)){if(_0xfc539d[_0xba34('0x24')](_0xba34('0x25'))===0x0){_0x534dfd[_0xfc539d['substring'](0x4)]=_0x534dfd[_0xfc539d];delete _0x534dfd[_0xfc539d];}}}}function agiHandler(_0x56ca76){logger[_0xba34('0x26')](_0xba34('0x27'),JSON[_0xba34('0x28')](_0x56ca76,null,0x2));logger[_0xba34('0x13')](util[_0xba34('0x14')](_0xba34('0x29'),_0x56ca76[_0xba34('0x2a')],_0x56ca76[_0xba34('0x1d')],_0x56ca76['callerid'],_0x56ca76['dnid'],_0x56ca76['uniqueid']));_0x56ca76['on'](_0xba34('0xd'),errorHandler);_0x56ca76['on'](_0xba34('0x2b'),closeHandler);_0x56ca76['on']('timeout',timeoutHandler);_0x56ca76[_0xba34('0x20')]=![];_0x56ca76['on'](_0xba34('0x2c'),hangupHandler);var _0x51a0ca=_[_0xba34('0x2d')](projects,['name',_0x56ca76[_0xba34('0x2a')]]);if(!_0x51a0ca)return Project[_0xba34('0x2e')](_0x56ca76);if(!_0x51a0ca[_0xba34('0x2f')])return Project[_0xba34('0x30')](_0x56ca76);return Project[_0xba34('0x31')](_0x51a0ca,_0x56ca76);}function main(){var _0x1480c4;return utilLicense[_0xba34('0x32')]()['then'](function(_0x34d0ef){if(!_0x34d0ef)return;if(_0x34d0ef[_0xba34('0x33')]){if(_0x34d0ef[_0xba34('0x34')]&&_0x34d0ef[_0xba34('0x34')]>0x0){logger['info'](util[_0xba34('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x34d0ef[_0xba34('0x34')]));_0x1480c4=_0x34d0ef['callysquare'];}else{logger[_0xba34('0x13')](_0xba34('0x35'));}}else{logger[_0xba34('0x13')](_0xba34('0x36'));_0x1480c4=-0x1;}})[_0xba34('0x21')](function(){return Project[_0xba34('0x37')]();})[_0xba34('0x21')](function(_0x2d3828){projects=_0x2d3828;return;})[_0xba34('0x22')](function(_0x484717){logger[_0xba34('0xd')]('[LICENSE]',_0x484717['stack']);})['finally'](function(){var _0x2af0f9=require('./server')(config[_0xba34('0x4')]['port'],config[_0xba34('0x4')]['ip'],_0x1480c4);_0x2af0f9['on']('error',errorHandler);_0x2af0f9['on'](_0xba34('0x38'),listeningHandler);_0x2af0f9['on'](_0xba34('0x39'),connectionHandler);_0x2af0f9['on'](_0xba34('0x2b'),closeHandler);});}main(); \ No newline at end of file +var _0xb233=['connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events','EventEmitter','defaults','projectUpdate','stack','findIndex','splice','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','debug','variables','close','timeout','find','handleNotFound','production','handleUnpublished','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally'];(function(_0xc75ef6,_0x288e5a){var _0x1f3214=function(_0x565083){while(--_0x565083){_0xc75ef6['push'](_0xc75ef6['shift']());}};_0x1f3214(++_0x288e5a);}(_0xb233,0x11e));var _0x3b23=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0xb233[_0x5f49c0];return _0x5ab653;};'use strict';var _=require(_0x3b23('0x0'));var syncho=require(_0x3b23('0x1'));var util=require(_0x3b23('0x2'));var config=require(_0x3b23('0x3'));var logger=require(_0x3b23('0x4'))(_0x3b23('0x5'));var utilLicense=require(_0x3b23('0x6'));var rpc=require('./rpc');var Project=require(_0x3b23('0x7'));var AGIEmitter=require(_0x3b23('0x8'))[_0x3b23('0x9')];var projects=[];config[_0x3b23('0x5')]=_[_0x3b23('0xa')](config[_0x3b23('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x3b23('0xb'),projectUpdateHandler);function connectionHandler(_0x357aa8){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x357aa8);agiHandler(_0x357aa8);}catch(_0x3dc935){logger['error'](_0x3dc935[_0x3b23('0xc')]);}});});}function projectUpdateHandler(_0x5985c9){try{var _0x63949e=_[_0x3b23('0xd')](projects,['id',_0x5985c9['id']]);if(_0x63949e>-0x1){if(_0x5985c9['deleted']===!![]){projects[_0x3b23('0xe')](_0x63949e,0x1);}else{projects[_0x63949e]=_0x5985c9;}}else{projects[_0x3b23('0xf')](_0x5985c9);}}catch(_0x3d3bb6){logger[_0x3b23('0x10')](_0x3d3bb6[_0x3b23('0xc')]);}}function listeningHandler(){console[_0x3b23('0x11')](_0x3b23('0x12'),config[_0x3b23('0x5')][_0x3b23('0x13')]);logger[_0x3b23('0x14')](util[_0x3b23('0x15')](_0x3b23('0x16'),config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x32d10d){if(_0x32d10d&&_0x32d10d[_0x3b23('0x17')]&&_0x32d10d[_0x3b23('0x18')]){logger['error'](util[_0x3b23('0x15')]('[%s]\x20%s',_0x32d10d['name'],_0x32d10d[_0x3b23('0x18')]));}else{logger[_0x3b23('0x10')](util[_0x3b23('0x15')](_0x3b23('0x19'),_0x32d10d['stack']));}}function closeHandler(){logger[_0x3b23('0x14')](util[_0x3b23('0x15')](_0x3b23('0x1a'),this['arg_1'],this['calleridname'],this['callerid'],this[_0x3b23('0x1b')],this[_0x3b23('0x1c')]));try{createSquareReport(this);}catch(_0x34c2fa){logger[_0x3b23('0x10')](_0x34c2fa[_0x3b23('0xc')]);}}function timeoutHandler(){logger[_0x3b23('0x14')](util['format'](_0x3b23('0x1d'),this[_0x3b23('0x1e')],this[_0x3b23('0x1f')],this[_0x3b23('0x20')],this[_0x3b23('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0x3b23('0x14')](util[_0x3b23('0x15')](_0x3b23('0x21'),this['arg_1'],this[_0x3b23('0x1f')],this['callerid'],this['dnid'],this[_0x3b23('0x1c')]));this[_0x3b23('0x22')]=!![];}function createSquareReport(_0x375e62,_0x224bcc){rpc[_0x3b23('0x23')](_0x375e62)[_0x3b23('0x24')](function(_0x297a15){if(_0x224bcc){_0x224bcc(null,_0x297a15);}})[_0x3b23('0x25')](function(_0x767b25){if(_0x224bcc){_0x224bcc(null,_0x767b25);}});}function setChannelVariables(_0x382fca){for(var _0x406168 in _0x382fca){if(_0x382fca[_0x3b23('0x26')](_0x406168)){if(_0x406168[_0x3b23('0x27')](_0x3b23('0x28'))===0x0){_0x382fca[_0x406168['substring'](0x4)]=_0x382fca[_0x406168];delete _0x382fca[_0x406168];}}}}function agiHandler(_0x5af762){logger[_0x3b23('0x29')](_0x3b23('0x2a'),JSON['stringify'](_0x5af762,null,0x2));logger[_0x3b23('0x14')](util[_0x3b23('0x15')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5af762[_0x3b23('0x1e')],_0x5af762[_0x3b23('0x1f')],_0x5af762[_0x3b23('0x20')],_0x5af762[_0x3b23('0x1b')],_0x5af762['uniqueid']));_0x5af762['on'](_0x3b23('0x10'),errorHandler);_0x5af762['on'](_0x3b23('0x2b'),closeHandler);_0x5af762['on'](_0x3b23('0x2c'),timeoutHandler);_0x5af762['evtHangup']=![];_0x5af762['on']('hangup',hangupHandler);var _0x3edce5=_[_0x3b23('0x2d')](projects,[_0x3b23('0x17'),_0x5af762[_0x3b23('0x1e')]]);if(!_0x3edce5)return Project[_0x3b23('0x2e')](_0x5af762);if(!_0x3edce5[_0x3b23('0x2f')])return Project[_0x3b23('0x30')](_0x5af762);return Project[_0x3b23('0x31')](_0x3edce5,_0x5af762);}function main(){var _0x9c7b02;return utilLicense['getLicense']()['then'](function(_0x23e06f){if(!_0x23e06f)return;if(_0x23e06f[_0x3b23('0x32')]){if(_0x23e06f[_0x3b23('0x33')]&&_0x23e06f[_0x3b23('0x33')]>0x0){logger[_0x3b23('0x14')](util['format'](_0x3b23('0x34'),_0x23e06f[_0x3b23('0x33')]));_0x9c7b02=_0x23e06f[_0x3b23('0x33')];}else{logger[_0x3b23('0x14')](_0x3b23('0x35'));}}else{logger[_0x3b23('0x14')](_0x3b23('0x36'));_0x9c7b02=-0x1;}})[_0x3b23('0x24')](function(){return Project['getAll']();})[_0x3b23('0x24')](function(_0x1ce96f){projects=_0x1ce96f;return;})[_0x3b23('0x25')](function(_0x28ad9f){logger['error']('[LICENSE]',_0x28ad9f[_0x3b23('0xc')]);})[_0x3b23('0x37')](function(){var _0x1f3b11=require('./server')(config[_0x3b23('0x5')]['port'],config[_0x3b23('0x5')]['ip'],_0x9c7b02);_0x1f3b11['on'](_0x3b23('0x10'),errorHandler);_0x1f3b11['on']('listening',listeningHandler);_0x1f3b11['on'](_0x3b23('0x38'),connectionHandler);_0x1f3b11['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 564d29b..ca4ea84 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd620=['then','error','message','result','sendMailMessage','bluebird','jayson/promise','request'];(function(_0x292e87,_0x9b2eb5){var _0x5186f6=function(_0x2eb5b6){while(--_0x2eb5b6){_0x292e87['push'](_0x292e87['shift']());}};_0x5186f6(++_0x9b2eb5);}(_0xd620,0x1c5));var _0x0d62=function(_0x3bb452,_0x4cdaaa){_0x3bb452=_0x3bb452-0x0;var _0x46dad9=_0xd620[_0x3bb452];return _0x46dad9;};'use strict';var BPromise=require(_0x0d62('0x0'));var jayson=require(_0x0d62('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x204394,_0xf493e9){return new BPromise(function(_0xac0685,_0x35dbc9){return client[_0x0d62('0x2')](_0x204394,_0xf493e9)[_0x0d62('0x3')](function(_0xfb2fb7){if(_0xfb2fb7[_0x0d62('0x4')]){return _0x35dbc9(_0xfb2fb7[_0x0d62('0x4')][_0x0d62('0x5')]);}else{return _0xac0685(_0xfb2fb7[_0x0d62('0x6')]);}})['catch'](function(_0xef3732){return _0x35dbc9(_0xef3732);});});}exports[_0x0d62('0x7')]=function(_0x105ffd,_0x3a5346){return request('SendMail',{'account':_0x105ffd,'message':_0x3a5346});}; \ No newline at end of file +var _0x8f92=['http','request','then','error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x8f92,0x1aa));var _0x28f9=function(_0x569187,_0x214d62){_0x569187=_0x569187-0x0;var _0x1a254f=_0x8f92[_0x569187];return _0x1a254f;};'use strict';var BPromise=require(_0x28f9('0x0'));var jayson=require(_0x28f9('0x1'));var client=jayson[_0x28f9('0x2')][_0x28f9('0x3')]({'port':0x232b});function request(_0x483d36,_0x3de36d){return new BPromise(function(_0x5f2cea,_0x43d925){return client[_0x28f9('0x4')](_0x483d36,_0x3de36d)[_0x28f9('0x5')](function(_0x506a90){if(_0x506a90[_0x28f9('0x6')]){return _0x43d925(_0x506a90[_0x28f9('0x6')]['message']);}else{return _0x5f2cea(_0x506a90[_0x28f9('0x7')]);}})[_0x28f9('0x8')](function(_0xeb449d){return _0x43d925(_0xeb449d);});});}exports[_0x28f9('0x9')]=function(_0x1a948c,_0x2c344d){return request(_0x28f9('0xa'),{'account':_0x1a948c,'message':_0x2c344d});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 46b752e..4a95324 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1333=['finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','continueAt','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','../../config/logger','agi','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found'];(function(_0x539d44,_0x186d7f){var _0x3babd5=function(_0x495195){while(--_0x495195){_0x539d44['push'](_0x539d44['shift']());}};_0x3babd5(++_0x186d7f);}(_0x1333,0x1d8));var _0x3133=function(_0x1d113b,_0x50030c){_0x1d113b=_0x1d113b-0x0;var _0x38f77b=_0x1333[_0x1d113b];return _0x38f77b;};'use strict';var _=require(_0x3133('0x0'));var moment=require('moment');var parser=require(_0x3133('0x1'));var util=require(_0x3133('0x2'));var logger=require(_0x3133('0x3'))(_0x3133('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x3133('0x5'));var Graph=require(_0x3133('0x6'));var Vertices=require(_0x3133('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x3133('0x8')]()[_0x3133('0x9')](function(_0x4719c6){logger[_0x3133('0xa')](_0x3133('0xb'),_0x4719c6[_0x3133('0xc')]);return[];});}function addVertex(_0x52861e,_0x1e889a,_0x439063){_0x1e889a[_0x3133('0xd')]=_0x439063;if(_0x1e889a[_0x3133('0xe')](_0x3133('0xf'))){_0x1e889a[_0x3133('0x10')]=parseInt(_0x1e889a[_0x3133('0xf')],0xa);}_0x52861e[_0x3133('0x11')](_[_0x3133('0x12')](_0x1e889a,_0x3133('0x13')));}function initGraph(_0xebd73b,_0x2154b4){var _0x45dd84=new Graph();for(var _0x3a0e44 in _0xebd73b){if(_0xebd73b[_0x3133('0xe')](_0x3a0e44)){if(_[_0x3133('0x14')](_0xebd73b[_0x3a0e44])){for(var _0x507fe4=0x0;_0x507fe4<_0xebd73b[_0x3a0e44][_0x3133('0x15')];_0x507fe4+=0x1){addVertex(_0x45dd84,_0xebd73b[_0x3a0e44][_0x507fe4],_0x3a0e44);}}else{addVertex(_0x45dd84,_0xebd73b[_0x3a0e44],_0x3a0e44);}}}for(var _0x3a19d6=0x0;_0x3a19d6<_0x2154b4[_0x3133('0x15')];_0x3a19d6+=0x1){if(_0x2154b4[_0x3a19d6][_0x3133('0x16')]&&_0x2154b4[_0x3a19d6][_0x3133('0x17')]){_0x45dd84[_0x3133('0x18')](_0x2154b4[_0x3a19d6][_0x3133('0x16')],_0x2154b4[_0x3a19d6][_0x3133('0x17')],_0x2154b4[_0x3a19d6][_0x3133('0x19')]);}}return _0x45dd84;}function getRoot(_0x486efd){return parser['toJson'](_0x486efd,{'object':!![]})[_0x3133('0x1a')][_0x3133('0x1b')];}function inspect(_0x27bebf){return util[_0x3133('0x1c')](_0x27bebf,{'showHidden':![],'depth':null});}function initialize(_0x53a088,_0x1f3c70){var _0x2d7f67=getRoot(_0x53a088[_0x3133('0x1d')]);if(!_0x2d7f67||!_0x2d7f67[_0x3133('0x1e')])return;var _0x1a8510,_0x4b2f62,_0x135ce7;logger[_0x3133('0x1f')]('root',JSON[_0x3133('0x20')](_0x2d7f67,null,0x2));_0x1f3c70[_0x3133('0x21')]=moment()[_0x3133('0x22')](_0x3133('0x23'));_0x1a8510=initGraph(_[_0x3133('0x12')](_0x2d7f67,_0x3133('0x13')),_0x2d7f67[_0x3133('0x13')]);_0x4b2f62=new Vertices(_0x1f3c70,rpc,mailRpc);logger[_0x3133('0x24')](util[_0x3133('0x22')](_0x3133('0x25'),_0x1f3c70[_0x3133('0x26')],_0x1f3c70[_0x3133('0x27')],_0x1f3c70[_0x3133('0x28')],_0x1f3c70[_0x3133('0x29')],_0x1f3c70['uniqueid']));_0x1a8510[_0x3133('0x2a')](_0x2d7f67[_0x3133('0x1e')]['id'],function(_0x5df159){try{_0x5df159=_0x4b2f62[_0x3133('0x2b')](_0x5df159);logger['debug']('vertex',JSON[_0x3133('0x20')](_0x5df159,null,0x2));if(_0x5df159[_0x3133('0xd')]===_0x3133('0x2c')){logger[_0x3133('0x24')](_0x3133('0x2d'));_0x1f3c70['context']=_0x5df159[_0x3133('0x2e')]||_0x1f3c70['context'];_0x1f3c70[_0x3133('0x2f')]=_0x5df159[_0x3133('0x2f')];_0x1f3c70[_0x3133('0x30')]=_0x5df159[_0x3133('0x30')]?_0x5df159[_0x3133('0x30')]-0x1:0x1;return null;}else if(_0x5df159&&_0x4b2f62[_0x5df159[_0x3133('0xd')]]){_0x135ce7=_0x4b2f62[_0x5df159[_0x3133('0xd')]](_0x5df159);logger[_0x3133('0x24')](_0x3133('0x31'),JSON[_0x3133('0x20')](_0x135ce7,null,0x2));if(_0x135ce7&&_0x135ce7[_0x3133('0x32')]===AGI_CODE_SUCCESS&&_0x135ce7[_0x3133('0x33')]!==AGI_RESULT_ERROR&&!_0x1f3c70[_0x3133('0x34')]){logger[_0x3133('0x1f')](_0x3133('0x31'),inspect(_0x135ce7));return _[_0x3133('0x35')](_0x135ce7[_0x3133('0x33')])?null:_0x135ce7[_0x3133('0x33')][_0x3133('0x36')]();}else{logger[_0x3133('0xa')](_0x3133('0x31'),inspect(_0x135ce7));return null;}}else{logger['error'](_0x3133('0x37'));return null;}}catch(_0x58bde8){logger['error'](_0x58bde8['stack']);return null;}});if(_0x2d7f67[_0x3133('0x38')]){logger[_0x3133('0x24')](util['format'](_0x3133('0x39'),_0x1f3c70['arg_1'],_0x1f3c70[_0x3133('0x27')],_0x1f3c70[_0x3133('0x28')],_0x1f3c70[_0x3133('0x29')],_0x1f3c70[_0x3133('0x3a')]));_0x1a8510[_0x3133('0x2a')](_0x2d7f67[_0x3133('0x38')]['id'],function(_0xad2726){try{_0xad2726=_0x4b2f62[_0x3133('0x2b')](_0xad2726);logger['debug'](_0x3133('0x3b'),JSON[_0x3133('0x20')](_0xad2726,null,0x2));if(_0xad2726&&_0x4b2f62[_0xad2726['agicommand']]){_0x135ce7=_0x4b2f62[_0xad2726['agicommand']](_0xad2726);if(_0x135ce7){logger['debug']('response',inspect(_0x135ce7));return _[_0x3133('0x35')](_0x135ce7[_0x3133('0x33')])?null:_0x135ce7['result']['toString']();}else{logger[_0x3133('0xa')]('response',inspect(_0x135ce7));return null;}}else{logger[_0x3133('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0xba81d2){logger[_0x3133('0xa')](_0xba81d2['stack']);return null;}});}logger[_0x3133('0x24')](util[_0x3133('0x22')](_0x3133('0x3c'),_0x1f3c70['arg_1'],_0x1f3c70['calleridname'],_0x1f3c70[_0x3133('0x28')],_0x1f3c70[_0x3133('0x29')],_0x1f3c70[_0x3133('0x3a')]));logger['info'](util[_0x3133('0x22')](_0x3133('0x3d'),_0x1f3c70[_0x3133('0x2e')],_0x1f3c70[_0x3133('0x2f')],parseInt(_0x1f3c70['priority'],0xa)+0x1));_0x1f3c70['continueAt'](_0x1f3c70[_0x3133('0x2e')],_0x1f3c70['extension'],parseInt(_0x1f3c70[_0x3133('0x30')],0xa)+0x1);_0x1f3c70[_0x3133('0x3e')]();}function handleNotFound(_0x326cf2){logger[_0x3133('0xa')](util[_0x3133('0x22')]('Project\x20%s\x20not\x20found',_0x326cf2[_0x3133('0x26')]));_0x326cf2[_0x3133('0x3f')](_0x326cf2[_0x3133('0x2e')],_0x326cf2[_0x3133('0x2f')],parseInt(_0x326cf2['priority'],0xa)+0x1);_0x326cf2[_0x3133('0x3e')]();}function handleUnpublished(_0x346da2){logger['error'](util['format'](_0x3133('0x40'),_0x346da2[_0x3133('0x26')]));_0x346da2['continueAt'](_0x346da2[_0x3133('0x2e')],_0x346da2['extension'],parseInt(_0x346da2[_0x3133('0x30')],0xa)+0x1);_0x346da2[_0x3133('0x3e')]();}module[_0x3133('0x41')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x1bd2=['extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','arg_1','callerid','uniqueid','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','../../config/logger','agi','./mailRpc','./graph','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','retry','maxRetry','addVertex','omit','hasOwnProperty','isArray','length','source','target','value','toJson','mxGraphModel','root','production','debug','stringify','format','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','traverseBFS','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context'];(function(_0xd38de,_0xecd845){var _0x2c394c=function(_0x2ce989){while(--_0x2ce989){_0xd38de['push'](_0xd38de['shift']());}};_0x2c394c(++_0xecd845);}(_0x1bd2,0x174));var _0x21bd=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x1bd2[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x21bd('0x0'));var moment=require('moment');var parser=require(_0x21bd('0x1'));var util=require(_0x21bd('0x2'));var logger=require(_0x21bd('0x3'))(_0x21bd('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x21bd('0x5'));var Graph=require(_0x21bd('0x6'));var Vertices=require(_0x21bd('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x21bd('0x8')](function(_0x1cbadc){logger[_0x21bd('0x9')](_0x21bd('0xa'),_0x1cbadc[_0x21bd('0xb')]);return[];});}function addVertex(_0x426550,_0x583821,_0xe12a59){_0x583821['agicommand']=_0xe12a59;if(_0x583821['hasOwnProperty'](_0x21bd('0xc'))){_0x583821[_0x21bd('0xd')]=parseInt(_0x583821[_0x21bd('0xc')],0xa);}_0x426550[_0x21bd('0xe')](_[_0x21bd('0xf')](_0x583821,'mxCell'));}function initGraph(_0x428cd4,_0x5007a7){var _0x521cae=new Graph();for(var _0x24e20e in _0x428cd4){if(_0x428cd4[_0x21bd('0x10')](_0x24e20e)){if(_[_0x21bd('0x11')](_0x428cd4[_0x24e20e])){for(var _0x1ed59a=0x0;_0x1ed59a<_0x428cd4[_0x24e20e][_0x21bd('0x12')];_0x1ed59a+=0x1){addVertex(_0x521cae,_0x428cd4[_0x24e20e][_0x1ed59a],_0x24e20e);}}else{addVertex(_0x521cae,_0x428cd4[_0x24e20e],_0x24e20e);}}}for(var _0x2a2bb4=0x0;_0x2a2bb4<_0x5007a7[_0x21bd('0x12')];_0x2a2bb4+=0x1){if(_0x5007a7[_0x2a2bb4][_0x21bd('0x13')]&&_0x5007a7[_0x2a2bb4][_0x21bd('0x14')]){_0x521cae['addEdge'](_0x5007a7[_0x2a2bb4][_0x21bd('0x13')],_0x5007a7[_0x2a2bb4][_0x21bd('0x14')],_0x5007a7[_0x2a2bb4][_0x21bd('0x15')]);}}return _0x521cae;}function getRoot(_0x2b6707){return parser[_0x21bd('0x16')](_0x2b6707,{'object':!![]})[_0x21bd('0x17')][_0x21bd('0x18')];}function inspect(_0x491569){return util['inspect'](_0x491569,{'showHidden':![],'depth':null});}function initialize(_0x4c78f3,_0x3cb75d){var _0x5b5dfd=getRoot(_0x4c78f3[_0x21bd('0x19')]);if(!_0x5b5dfd||!_0x5b5dfd['start'])return;var _0x29d8a2,_0x599e5c,_0x644bcb;logger[_0x21bd('0x1a')](_0x21bd('0x18'),JSON[_0x21bd('0x1b')](_0x5b5dfd,null,0x2));_0x3cb75d['joinAt']=moment()[_0x21bd('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0x29d8a2=initGraph(_[_0x21bd('0xf')](_0x5b5dfd,_0x21bd('0x1d')),_0x5b5dfd[_0x21bd('0x1d')]);_0x599e5c=new Vertices(_0x3cb75d,rpc,mailRpc);logger[_0x21bd('0x1e')](util[_0x21bd('0x1c')](_0x21bd('0x1f'),_0x3cb75d['arg_1'],_0x3cb75d[_0x21bd('0x20')],_0x3cb75d['callerid'],_0x3cb75d[_0x21bd('0x21')],_0x3cb75d['uniqueid']));_0x29d8a2[_0x21bd('0x22')](_0x5b5dfd[_0x21bd('0x23')]['id'],function(_0x1b3c5e){try{_0x1b3c5e=_0x599e5c[_0x21bd('0x24')](_0x1b3c5e);logger[_0x21bd('0x1a')](_0x21bd('0x25'),JSON['stringify'](_0x1b3c5e,null,0x2));if(_0x1b3c5e['agicommand']===_0x21bd('0x26')){logger[_0x21bd('0x1e')](_0x21bd('0x27'));_0x3cb75d[_0x21bd('0x28')]=_0x1b3c5e[_0x21bd('0x28')]||_0x3cb75d[_0x21bd('0x28')];_0x3cb75d[_0x21bd('0x29')]=_0x1b3c5e[_0x21bd('0x29')];_0x3cb75d[_0x21bd('0x2a')]=_0x1b3c5e[_0x21bd('0x2a')]?_0x1b3c5e['priority']-0x1:0x1;return null;}else if(_0x1b3c5e&&_0x599e5c[_0x1b3c5e['agicommand']]){_0x644bcb=_0x599e5c[_0x1b3c5e['agicommand']](_0x1b3c5e);logger['info'](_0x21bd('0x2b'),JSON[_0x21bd('0x1b')](_0x644bcb,null,0x2));if(_0x644bcb&&_0x644bcb[_0x21bd('0x2c')]===AGI_CODE_SUCCESS&&_0x644bcb[_0x21bd('0x2d')]!==AGI_RESULT_ERROR&&!_0x3cb75d['evtHangup']){logger[_0x21bd('0x1a')]('response',inspect(_0x644bcb));return _['isUndefined'](_0x644bcb[_0x21bd('0x2d')])?null:_0x644bcb['result'][_0x21bd('0x2e')]();}else{logger[_0x21bd('0x9')](_0x21bd('0x2b'),inspect(_0x644bcb));return null;}}else{logger[_0x21bd('0x9')](_0x21bd('0x2f'));return null;}}catch(_0xa55117){logger[_0x21bd('0x9')](_0xa55117[_0x21bd('0xb')]);return null;}});if(_0x5b5dfd[_0x21bd('0x30')]){logger[_0x21bd('0x1e')](util[_0x21bd('0x1c')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3cb75d[_0x21bd('0x31')],_0x3cb75d[_0x21bd('0x20')],_0x3cb75d[_0x21bd('0x32')],_0x3cb75d[_0x21bd('0x21')],_0x3cb75d[_0x21bd('0x33')]));_0x29d8a2[_0x21bd('0x22')](_0x5b5dfd[_0x21bd('0x30')]['id'],function(_0x5714f0){try{_0x5714f0=_0x599e5c[_0x21bd('0x24')](_0x5714f0);logger[_0x21bd('0x1a')]('vertex',JSON['stringify'](_0x5714f0,null,0x2));if(_0x5714f0&&_0x599e5c[_0x5714f0['agicommand']]){_0x644bcb=_0x599e5c[_0x5714f0['agicommand']](_0x5714f0);if(_0x644bcb){logger[_0x21bd('0x1a')](_0x21bd('0x2b'),inspect(_0x644bcb));return _[_0x21bd('0x34')](_0x644bcb[_0x21bd('0x2d')])?null:_0x644bcb[_0x21bd('0x2d')][_0x21bd('0x2e')]();}else{logger[_0x21bd('0x9')](_0x21bd('0x2b'),inspect(_0x644bcb));return null;}}else{logger['error'](_0x21bd('0x2f'));return null;}}catch(_0x32fe6c){logger[_0x21bd('0x9')](_0x32fe6c[_0x21bd('0xb')]);return null;}});}logger[_0x21bd('0x1e')](util[_0x21bd('0x1c')](_0x21bd('0x35'),_0x3cb75d[_0x21bd('0x31')],_0x3cb75d[_0x21bd('0x20')],_0x3cb75d[_0x21bd('0x32')],_0x3cb75d['dnid'],_0x3cb75d[_0x21bd('0x33')]));logger[_0x21bd('0x1e')](util[_0x21bd('0x1c')](_0x21bd('0x36'),_0x3cb75d[_0x21bd('0x28')],_0x3cb75d['extension'],parseInt(_0x3cb75d['priority'],0xa)+0x1));_0x3cb75d[_0x21bd('0x37')](_0x3cb75d['context'],_0x3cb75d[_0x21bd('0x29')],parseInt(_0x3cb75d[_0x21bd('0x2a')],0xa)+0x1);_0x3cb75d[_0x21bd('0x38')]();}function handleNotFound(_0x2b7dc3){logger[_0x21bd('0x9')](util[_0x21bd('0x1c')]('Project\x20%s\x20not\x20found',_0x2b7dc3[_0x21bd('0x31')]));_0x2b7dc3[_0x21bd('0x37')](_0x2b7dc3[_0x21bd('0x28')],_0x2b7dc3[_0x21bd('0x29')],parseInt(_0x2b7dc3['priority'],0xa)+0x1);_0x2b7dc3[_0x21bd('0x38')]();}function handleUnpublished(_0x3cc0c0){logger[_0x21bd('0x9')](util[_0x21bd('0x1c')](_0x21bd('0x39'),_0x3cc0c0[_0x21bd('0x31')]));_0x3cc0c0[_0x21bd('0x37')](_0x3cc0c0[_0x21bd('0x28')],_0x3cc0c0['extension'],parseInt(_0x3cc0c0[_0x21bd('0x2a')],0xa)+0x1);_0x3cc0c0[_0x21bd('0x38')]();}module[_0x21bd('0x3a')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 957fa7a..f556429 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9370=['_localBuffer','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','length','split','slice','trim','emit','headers','exports','stream','Transform','call'];(function(_0x5bbd92,_0x586bfd){var _0x512eb0=function(_0x573838){while(--_0x573838){_0x5bbd92['push'](_0x5bbd92['shift']());}};_0x512eb0(++_0x586bfd);}(_0x9370,0xc9));var _0x0937=function(_0xeb46fa,_0x29c63f){_0xeb46fa=_0xeb46fa-0x0;var _0x5585d6=_0x9370[_0xeb46fa];return _0x5585d6;};'use strict';var util=require('util');var Transform=require(_0x0937('0x0'))[_0x0937('0x1')];function AGIReply(_0x5ea133){Transform[_0x0937('0x2')](this,_0x5ea133);this[_0x0937('0x3')]='';this[_0x0937('0x4')]=![];}util[_0x0937('0x5')](AGIReply,Transform);AGIReply['prototype'][_0x0937('0x6')]=function(_0x19cc0d,_0x25a270,_0x69de38){var _0x241f3b='\x0a',_0x3f9745=['\x0a\x0a',_0x0937('0x7')],_0x323c00=-0x1,_0x51f5e4=-0x1,_0x27f2cd='',_0x2e13ff=0x0,_0x533af0='',_0x35ca2d='';this['_localBuffer']+=_0x19cc0d['toString']();_0x533af0=this[_0x0937('0x3')];if(!this[_0x0937('0x4')]){_0x2e13ff=0x0;while(_0x3f9745[_0x2e13ff]){while((_0x51f5e4=_0x533af0[_0x0937('0x8')](_0x3f9745[_0x2e13ff]))!=-0x1){_0x27f2cd=_0x3f9745[_0x2e13ff];_0x35ca2d=_0x533af0[_0x0937('0x9')](0x0,_0x51f5e4);_0x533af0=_0x533af0[_0x0937('0x9')](_0x51f5e4+_0x27f2cd[_0x0937('0xa')]);var _0x27d642=_0x35ca2d[_0x0937('0xb')](_0x241f3b),_0x5bc517=0x0,_0x2a38d3={},_0x58336c='',_0x4620db='',_0x42e681=-0x1;while(_0x27d642[_0x5bc517]){_0x42e681=_0x27d642[_0x5bc517][_0x0937('0x8')](':');if(_0x42e681!=-0x1){_0x58336c=_0x27d642[_0x5bc517][_0x0937('0xc')](0x0,_0x42e681)[_0x0937('0xd')]();_0x4620db=_0x27d642[_0x5bc517][_0x0937('0xc')](_0x42e681+0x1)[_0x0937('0xd')]();if(_0x58336c[_0x0937('0xa')]>0x0){_0x2a38d3[_0x58336c]=_0x4620db;}}else{}_0x5bc517++;}this[_0x0937('0xe')](_0x0937('0xf'),_0x2a38d3);this['_inBody']=!![];}_0x2e13ff++;}this['_localBuffer']=_0x533af0;}else{while((_0x323c00=_0x533af0[_0x0937('0x8')](_0x241f3b))!=-0x1){_0x35ca2d=_0x533af0[_0x0937('0x9')](0x0,_0x323c00);this[_0x0937('0xe')]('line',_0x35ca2d);_0x533af0=_0x533af0['substring'](_0x323c00+_0x241f3b[_0x0937('0xa')]);}this[_0x0937('0x3')]=_0x533af0;}_0x69de38();};module[_0x0937('0x10')]=AGIReply; \ No newline at end of file +var _0xfc33=['Transform','call','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','_localBuffer','substring','length','slice','trim','emit','exports','util','stream'];(function(_0x14e8b9,_0x78433f){var _0x49279e=function(_0x202eb1){while(--_0x202eb1){_0x14e8b9['push'](_0x14e8b9['shift']());}};_0x49279e(++_0x78433f);}(_0xfc33,0x16e));var _0x3fc3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xfc33[_0x5d6456];return _0x4d66c1;};'use strict';var util=require(_0x3fc3('0x0'));var Transform=require(_0x3fc3('0x1'))[_0x3fc3('0x2')];function AGIReply(_0x2a952d){Transform[_0x3fc3('0x3')](this,_0x2a952d);this['_localBuffer']='';this[_0x3fc3('0x4')]=![];}util[_0x3fc3('0x5')](AGIReply,Transform);AGIReply[_0x3fc3('0x6')]['_transform']=function(_0x2b73a2,_0x110161,_0x1e7af4){var _0x1dfb48='\x0a',_0x5bdc39=['\x0a\x0a',_0x3fc3('0x7')],_0x504a95=-0x1,_0x21788c=-0x1,_0xc54c24='',_0x127b7e=0x0,_0x4a1a1a='',_0x2852d5='';this['_localBuffer']+=_0x2b73a2[_0x3fc3('0x8')]();_0x4a1a1a=this[_0x3fc3('0x9')];if(!this['_inBody']){_0x127b7e=0x0;while(_0x5bdc39[_0x127b7e]){while((_0x21788c=_0x4a1a1a['indexOf'](_0x5bdc39[_0x127b7e]))!=-0x1){_0xc54c24=_0x5bdc39[_0x127b7e];_0x2852d5=_0x4a1a1a[_0x3fc3('0xa')](0x0,_0x21788c);_0x4a1a1a=_0x4a1a1a['substring'](_0x21788c+_0xc54c24[_0x3fc3('0xb')]);var _0x27d18a=_0x2852d5['split'](_0x1dfb48),_0x2ff025=0x0,_0x3946d4={},_0x11c228='',_0x496b4f='',_0x3df05f=-0x1;while(_0x27d18a[_0x2ff025]){_0x3df05f=_0x27d18a[_0x2ff025]['indexOf'](':');if(_0x3df05f!=-0x1){_0x11c228=_0x27d18a[_0x2ff025][_0x3fc3('0xc')](0x0,_0x3df05f)[_0x3fc3('0xd')]();_0x496b4f=_0x27d18a[_0x2ff025]['slice'](_0x3df05f+0x1)[_0x3fc3('0xd')]();if(_0x11c228['length']>0x0){_0x3946d4[_0x11c228]=_0x496b4f;}}else{}_0x2ff025++;}this['emit']('headers',_0x3946d4);this[_0x3fc3('0x4')]=!![];}_0x127b7e++;}this['_localBuffer']=_0x4a1a1a;}else{while((_0x504a95=_0x4a1a1a['indexOf'](_0x1dfb48))!=-0x1){_0x2852d5=_0x4a1a1a[_0x3fc3('0xa')](0x0,_0x504a95);this[_0x3fc3('0xe')]('line',_0x2852d5);_0x4a1a1a=_0x4a1a1a[_0x3fc3('0xa')](_0x504a95+_0x1dfb48[_0x3fc3('0xb')]);}this[_0x3fc3('0x9')]=_0x4a1a1a;}_0x1e7af4();};module[_0x3fc3('0xf')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 542edfc..f7b9cbf 100644 --- a/server/services/agi/rpc/index.js +++ b/server/services/agi/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ef8=['ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ListId','then','getPauseById','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','client','http','error','message','result','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','phone','getTrunkById'];(function(_0x11c9e9,_0x4429d8){var _0x55d261=function(_0x3f1742){while(--_0x3f1742){_0x11c9e9['push'](_0x11c9e9['shift']());}};_0x55d261(++_0x4429d8);}(_0x9ef8,0x17f));var _0x89ef=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0x9ef8[_0x187279];return _0x3da59d;};'use strict';var _=require(_0x89ef('0x0'));var moment=require(_0x89ef('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x89ef('0x2')][_0x89ef('0x3')]({'port':0x2329});function request(_0x6ad29a,_0x50f8c4){return new Promise(function(_0x1c43bc,_0x3797b4){return client['request'](_0x6ad29a,_0x50f8c4)['then'](function(_0x5048ab){if(_0x5048ab[_0x89ef('0x4')]){return _0x3797b4(_0x5048ab[_0x89ef('0x4')][_0x89ef('0x5')]);}else{return _0x1c43bc(_0x5048ab[_0x89ef('0x6')]);}})[_0x89ef('0x7')](function(_0x373288){return _0x3797b4(_0x373288);});});}exports[_0x89ef('0x8')]=function(){return request(_0x89ef('0x9'),{'options':{'raw':![],'attributes':['id',_0x89ef('0xa'),'production']}});};exports[_0x89ef('0xb')]=function(_0x4687cb){return request(_0x89ef('0xc'),{'options':{'raw':![],'where':{'name':_0x4687cb},'attributes':['production']}});};exports[_0x89ef('0xd')]=function(_0x7f5df1){return request(_0x89ef('0xe'),{'options':{'raw':![],'where':{'id':_0x7f5df1},'include':[{'model':_0x89ef('0xf'),'as':_0x89ef('0x10'),'include':[{'model':'CloudProvider','as':_0x89ef('0x11')}]}],'attributes':['id','name',_0x89ef('0x12')],'smtp':!![]}});};exports[_0x89ef('0x13')]=function(_0x4d73be){return request(_0x89ef('0xc'),{'options':{'where':{'id':_0x4d73be},'attributes':[_0x89ef('0xa')]}});};exports[_0x89ef('0x14')]=function(_0x145e85){return request(_0x89ef('0x15'),{'options':{'where':{'id':_0x145e85},'attributes':['name']}});};exports[_0x89ef('0x16')]=function(_0x4b73a4){return request('ShowVariable',{'options':{'where':{'id':_0x4b73a4},'attributes':[_0x89ef('0xa')]}});};exports[_0x89ef('0x17')]=function(_0x5ee4ce){return request(_0x89ef('0x18'),{'options':{'where':{'id':_0x5ee4ce},'attributes':['dsn']}});};exports[_0x89ef('0x19')]=function(_0x4ed8fa){return request(_0x89ef('0x1a'),{'options':{'where':{'id':_0x4ed8fa},'attributes':[_0x89ef('0xa')]}});};exports[_0x89ef('0x1b')]=function(_0x1189d7){return request('GetContactByPhone',{'options':{'where':{'phone':_0x1189d7[_0x89ef('0x1c')]},'attributes':['id']}});};exports[_0x89ef('0x1d')]=function(_0x16c776){return request(_0x89ef('0x1e'),{'options':{'where':{'id':_0x16c776},'attributes':[_0x89ef('0xa')]}});};exports[_0x89ef('0x1f')]=function(_0x399968){return request(_0x89ef('0x20'),{'options':{'where':{'id':_0x399968},'attributes':[_0x89ef('0x21')]}});};exports[_0x89ef('0x22')]=function(_0x417629){return request(_0x89ef('0x23'),{'options':{'raw':![],'where':{'id':_0x417629},'include':[{'model':_0x89ef('0x24'),'as':_0x89ef('0x25')}]}});};exports[_0x89ef('0x26')]=function(_0x26afd6){return request(_0x89ef('0x27'),{'options':{'where':{'id':_0x26afd6},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x53c151){return request('CreateSmsMessage',{'body':_0x53c151});};exports[_0x89ef('0x28')]=function(_0xef997a){return request('CreateSquareDetailsReport',{'body':_0xef997a});};exports['createSquareReport']=function(_0x143dc3){return request(_0x89ef('0x29'),{'body':_['merge'](_0x143dc3,{'project_name':_0x143dc3['arg_1'],'prev_project_name':_0x143dc3[_0x89ef('0x2a')]||'','is_subproject':_0x143dc3[_0x89ef('0x2a')]?!![]:![],'leaveAt':moment()[_0x89ef('0x2b')](_0x89ef('0x2c'))})});};exports[_0x89ef('0x2d')]=function(_0x3f7d5f){return request(_0x89ef('0x2e'),{'body':_0x3f7d5f});};exports['createSquareMessage']=function(_0x461e20){return request(_0x89ef('0x2f'),{'body':_0x461e20});};exports[_0x89ef('0x30')]=function(_0x3acacc){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3acacc['phone'],'ListId':_0x3acacc[_0x89ef('0x31')]}}})[_0x89ef('0x32')](function(_0xe415bf){if(_0xe415bf){return _0xe415bf;}return request('CreateCmContact',{'body':_0x3acacc});});};exports[_0x89ef('0x33')]=function(_0x8c3748){return request('ShowPause',{'options':{'where':{'id':_0x8c3748},'attributes':[_0x89ef('0xa')]}});};exports[_0x89ef('0x34')]=function(_0x1dadd5,_0x128f4e){return request('LoginUser',{'body':{'interface':_0x128f4e},'options':{'where':_0x1dadd5}});};exports[_0x89ef('0x35')]=function(_0x122b7b,_0x5ec239,_0x44dc26){return request(_0x89ef('0x36'),{'body':{'type':_0x5ec239,'uniqueid':_0x44dc26},'options':{'where':_0x122b7b}});};exports[_0x89ef('0x37')]=function(_0x47c71d){return request(_0x89ef('0x38'),{'body':{},'options':{'where':_0x47c71d}});};exports[_0x89ef('0x39')]=function(_0x1b5b83){return request(_0x89ef('0x3a'),{'body':{},'options':{'where':_0x1b5b83}});}; \ No newline at end of file +var _0x8135=['ShowSound','save_name','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById'];(function(_0x276574,_0x14aba5){var _0x25faa5=function(_0x3811c1){while(--_0x3811c1){_0x276574['push'](_0x276574['shift']());}};_0x25faa5(++_0x14aba5);}(_0x8135,0x99));var _0x5813=function(_0x52c40b,_0x336f94){_0x52c40b=_0x52c40b-0x0;var _0x179429=_0x8135[_0x52c40b];return _0x179429;};'use strict';var _=require('lodash');var moment=require(_0x5813('0x0'));var jayson=require(_0x5813('0x1'));var client=jayson[_0x5813('0x2')][_0x5813('0x3')]({'port':0x2329});function request(_0x4b43a8,_0x1fced6){return new Promise(function(_0x196ea8,_0xf23c29){return client[_0x5813('0x4')](_0x4b43a8,_0x1fced6)[_0x5813('0x5')](function(_0x5c8ff5){if(_0x5c8ff5['error']){return _0xf23c29(_0x5c8ff5[_0x5813('0x6')][_0x5813('0x7')]);}else{return _0x196ea8(_0x5c8ff5[_0x5813('0x8')]);}})[_0x5813('0x9')](function(_0x3101ea){return _0xf23c29(_0x3101ea);});});}exports[_0x5813('0xa')]=function(){return request(_0x5813('0xb'),{'options':{'raw':![],'attributes':['id',_0x5813('0xc'),_0x5813('0xd')]}});};exports[_0x5813('0xe')]=function(_0x3adb65){return request(_0x5813('0xf'),{'options':{'raw':![],'where':{'name':_0x3adb65},'attributes':[_0x5813('0xd')]}});};exports[_0x5813('0x10')]=function(_0x3012b5){return request(_0x5813('0x11'),{'options':{'raw':![],'where':{'id':_0x3012b5},'include':[{'model':_0x5813('0x12'),'as':'Smtp','include':[{'model':_0x5813('0x13'),'as':_0x5813('0x13')}]}],'attributes':['id',_0x5813('0xc'),'email'],'smtp':!![]}});};exports[_0x5813('0x14')]=function(_0x5076d){return request('ShowSquareProject',{'options':{'where':{'id':_0x5076d},'attributes':[_0x5813('0xc')]}});};exports[_0x5813('0x15')]=function(_0x57df76){return request(_0x5813('0x16'),{'options':{'where':{'id':_0x57df76},'attributes':[_0x5813('0xc')]}});};exports[_0x5813('0x17')]=function(_0x5044e9){return request(_0x5813('0x18'),{'options':{'where':{'id':_0x5044e9},'attributes':[_0x5813('0xc')]}});};exports['getSquareOdbcById']=function(_0x2834e6){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2834e6},'attributes':['dsn']}});};exports['getUserById']=function(_0x5705c9){return request('ShowUser',{'options':{'where':{'id':_0x5705c9},'attributes':[_0x5813('0xc')]}});};exports[_0x5813('0x19')]=function(_0x1e43df){return request('GetContactByPhone',{'options':{'where':{'phone':_0x1e43df[_0x5813('0x1a')]},'attributes':['id']}});};exports[_0x5813('0x1b')]=function(_0x7b7ee8){return request(_0x5813('0x1c'),{'options':{'where':{'id':_0x7b7ee8},'attributes':['name']}});};exports[_0x5813('0x1d')]=function(_0x383196){return request(_0x5813('0x1e'),{'options':{'where':{'id':_0x383196},'attributes':[_0x5813('0x1f')]}});};exports['getIntervalById']=function(_0x1f2506){return request(_0x5813('0x20'),{'options':{'raw':![],'where':{'id':_0x1f2506},'include':[{'model':_0x5813('0x21'),'as':'Intervals'}]}});};exports[_0x5813('0x22')]=function(_0xd116c0){return request(_0x5813('0x23'),{'options':{'where':{'id':_0xd116c0},'attributes':['id',_0x5813('0xc')]}});};exports[_0x5813('0x24')]=function(_0x183f7d){return request(_0x5813('0x25'),{'body':_0x183f7d});};exports[_0x5813('0x26')]=function(_0x5b4189){return request(_0x5813('0x27'),{'body':_0x5b4189});};exports[_0x5813('0x28')]=function(_0x23c6c7){return request(_0x5813('0x29'),{'body':_[_0x5813('0x2a')](_0x23c6c7,{'project_name':_0x23c6c7[_0x5813('0x2b')],'prev_project_name':_0x23c6c7[_0x5813('0x2c')]||'','is_subproject':_0x23c6c7['arg_2']?!![]:![],'leaveAt':moment()[_0x5813('0x2d')](_0x5813('0x2e'))})});};exports[_0x5813('0x2f')]=function(_0x4c9385){return request(_0x5813('0x30'),{'body':_0x4c9385});};exports[_0x5813('0x31')]=function(_0x56d18c){return request('CreateSquareMessage',{'body':_0x56d18c});};exports[_0x5813('0x32')]=function(_0x17acb5){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x17acb5['phone'],'ListId':_0x17acb5[_0x5813('0x33')]}}})[_0x5813('0x5')](function(_0x3a9bed){if(_0x3a9bed){return _0x3a9bed;}return request(_0x5813('0x34'),{'body':_0x17acb5});});};exports['getPauseById']=function(_0x520db4){return request(_0x5813('0x35'),{'options':{'where':{'id':_0x520db4},'attributes':[_0x5813('0xc')]}});};exports[_0x5813('0x36')]=function(_0x534b5c,_0x2e6665){return request(_0x5813('0x37'),{'body':{'interface':_0x2e6665},'options':{'where':_0x534b5c}});};exports[_0x5813('0x38')]=function(_0x5981da,_0x363275,_0x41b7a7){return request(_0x5813('0x39'),{'body':{'type':_0x363275,'uniqueid':_0x41b7a7},'options':{'where':_0x5981da}});};exports['agentUnpause']=function(_0x247ba1){return request(_0x5813('0x3a'),{'body':{},'options':{'where':_0x247ba1}});};exports[_0x5813('0x3b')]=function(_0x424430){return request(_0x5813('0x3c'),{'body':{},'options':{'where':_0x424430}});}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index 5e84195..3484cbf 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2070=['exports'];(function(_0x7835a,_0x7ef740){var _0xd46e11=function(_0xe43fad){while(--_0xe43fad){_0x7835a['push'](_0x7835a['shift']());}};_0xd46e11(++_0x7ef740);}(_0x2070,0x1a2));var _0x0207=function(_0xf3510,_0x39b4f2){_0xf3510=_0xf3510-0x0;var _0x51736e=_0x2070[_0xf3510];return _0x51736e;};var polly=require('./polly');var lex=require('./lex');module[_0x0207('0x0')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xe225=['exports','./lex'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0xe225,0x1bd));var _0x5e22=function(_0x15a2cb,_0x571a10){_0x15a2cb=_0x15a2cb-0x0;var _0x26d3f6=_0xe225[_0x15a2cb];return _0x26d3f6;};var polly=require('./polly');var lex=require(_0x5e22('0x0'));module[_0x5e22('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 0eac8d7..80be1a0 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ea3=['./lib/api','exports'];(function(_0x385083,_0x402c4e){var _0x318c49=function(_0x38002d){while(--_0x38002d){_0x385083['push'](_0x385083['shift']());}};_0x318c49(++_0x402c4e);}(_0x4ea3,0x70));var _0x34ea=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4ea3[_0x5ddb1c];return _0x354adc;};'use strict';var lex=require(_0x34ea('0x0'));module[_0x34ea('0x1')]=function(_0x324f65,_0x3ab582,_0x588172,_0x374ec1,_0x494b56,_0x269d4c){return lex(_0x324f65,_0x3ab582,_0x588172,_0x374ec1,_0x494b56,_0x269d4c);}; \ No newline at end of file +var _0xe5b5=['exports','./lib/api'];(function(_0x4d715d,_0x550e17){var _0x30df86=function(_0x21c558){while(--_0x21c558){_0x4d715d['push'](_0x4d715d['shift']());}};_0x30df86(++_0x550e17);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0xe5b5[_0x1b3a5c];return _0x2ae8cb;};'use strict';var lex=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]=function(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763){return lex(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 784ab0f..42c306a 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x44d7b0,_0x379471){var _0x28b4ff=function(_0x54025f){while(--_0x54025f){_0x44d7b0['push'](_0x44d7b0['shift']());}};_0x28b4ff(++_0x379471);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x262f45,_0x4a12e3){var _0x25bf5d=function(_0x226c52){while(--_0x226c52){_0x262f45['push'](_0x262f45['shift']());}};_0x25bf5d(++_0x4a12e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 3b092aa..6542892 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var polly=require('./lib/api');module['exports']=function(_0x22c33e,_0x44038f,_0x342733,_0x262d43,_0x1db356,_0x4044b8,_0x3f5f17){return polly(_0x22c33e,_0x44038f,_0x342733,_0x262d43,_0x1db356,_0x4044b8,_0x3f5f17);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x5e048b,_0x594df4,_0x2eb825,_0x2c5175,_0x3613bc,_0x4fe964,_0x35a1f5){return polly(_0x5e048b,_0x594df4,_0x2eb825,_0x2c5175,_0x3613bc,_0x4fe964,_0x35a1f5);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js index 8ed3a1d..d362d25 100644 --- a/server/services/agi/scripts/aws/polly/lib/api.js +++ b/server/services/agi/scripts/aws/polly/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0c5=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xc0c5,0x184));var _0x5c0c=function(_0x1fa841,_0x37a70c){_0x1fa841=_0x1fa841-0x0;var _0x384b67=_0xc0c5[_0x1fa841];return _0x384b67;};'use strict';var fs=require('fs');var path=require(_0x5c0c('0x0'));var BPromise=require(_0x5c0c('0x1'));var rs=require(_0x5c0c('0x2'));var AWS=require(_0x5c0c('0x3'));function pollyResult(_0x352bfa,_0x30bbc8,_0x211a7e){return new BPromise(function(_0x3c2b66,_0x3583f1){_0x352bfa[_0x5c0c('0x4')](_0x30bbc8,function(_0x1de20a,_0x4e4da2){if(_0x1de20a){_0x3583f1(_0x1de20a);}else if(_0x4e4da2){if(_0x4e4da2[_0x5c0c('0x5')]instanceof Buffer){fs[_0x5c0c('0x6')](_0x211a7e,_0x4e4da2['AudioStream'],function(_0x21e4a6){if(_0x21e4a6){_0x3583f1(_0x21e4a6);}else{_0x3c2b66();}});}else{_0x3583f1(new Error(_0x5c0c('0x7')));}}else{_0x3583f1(new Error(_0x5c0c('0x8')));}});});}module[_0x5c0c('0x9')]=function(_0xe7a8d0,_0x2d1a36,_0x2cdddf,_0x172078,_0x2a5d4f,_0xb2f9fc,_0xe8ed11){var _0x2925e2=new AWS['Polly']({'accessKeyId':_0xe7a8d0,'secretAccessKey':_0x2d1a36,'region':_0x2cdddf});var _0x1bfd26={'Text':_0x2a5d4f,'TextType':_0xb2f9fc||_0x5c0c('0xa'),'OutputFormat':_0x5c0c('0xb'),'VoiceId':_0x172078};return pollyResult(_0x2925e2,_0x1bfd26,_0xe8ed11);}; \ No newline at end of file +var _0xd6f4=['Polly','text','mp3','synthesizeSpeech','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x583c44,_0x10db41){var _0x22b717=function(_0xd1bf91){while(--_0xd1bf91){_0x583c44['push'](_0x583c44['shift']());}};_0x22b717(++_0x10db41);}(_0xd6f4,0x176));var _0x4d6f=function(_0x513480,_0x15c4d3){_0x513480=_0x513480-0x0;var _0x3b0136=_0xd6f4[_0x513480];return _0x3b0136;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x135f91,_0x2e69c3,_0x2fb902){return new BPromise(function(_0x56a643,_0x203fe6){_0x135f91[_0x4d6f('0x0')](_0x2e69c3,function(_0x3e7c0f,_0x30c380){if(_0x3e7c0f){_0x203fe6(_0x3e7c0f);}else if(_0x30c380){if(_0x30c380['AudioStream']instanceof Buffer){fs['writeFile'](_0x2fb902,_0x30c380['AudioStream'],function(_0x41a3b3){if(_0x41a3b3){_0x203fe6(_0x41a3b3);}else{_0x56a643();}});}else{_0x203fe6(new Error(_0x4d6f('0x1')));}}else{_0x203fe6(new Error(_0x4d6f('0x2')));}});});}module[_0x4d6f('0x3')]=function(_0x31e794,_0x3b95ec,_0xf4f743,_0x5ab854,_0xf047a9,_0xa771da,_0x33ec18){var _0x130b9e=new AWS[(_0x4d6f('0x4'))]({'accessKeyId':_0x31e794,'secretAccessKey':_0x3b95ec,'region':_0xf4f743});var _0x43842c={'Text':_0xf047a9,'TextType':_0xa771da||_0x4d6f('0x5'),'OutputFormat':_0x4d6f('0x6'),'VoiceId':_0x5ab854};return pollyResult(_0x130b9e,_0x43842c,_0x33ec18);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js index 8c4149d..8ec7d8b 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcbf=['exports','./lib/api'];(function(_0x4f71d4,_0x482e56){var _0x2ebd44=function(_0x4f6b0d){while(--_0x4f6b0d){_0x4f71d4['push'](_0x4f71d4['shift']());}};_0x2ebd44(++_0x482e56);}(_0xbcbf,0x77));var _0xfbcb=function(_0x4dec2d,_0x1580d0){_0x4dec2d=_0x4dec2d-0x0;var _0x10bcea=_0xbcbf[_0x4dec2d];return _0x10bcea;};'use strict';var asr=require(_0xfbcb('0x0'));module[_0xfbcb('0x1')]=function(_0x36fd3e,_0x1b3b63,_0x3c1ad6,_0x7eb323){return asr(_0x36fd3e,_0x1b3b63,_0x3c1ad6);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x4df8e7,_0x272223,_0x2b238a,_0x4768ef){return asr(_0x4df8e7,_0x272223,_0x2b238a);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js index 3ca8784..ecc2b51 100644 --- a/server/services/agi/scripts/google/asr/lib/api.js +++ b/server/services/agi/scripts/google/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32ef=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x32ef,0xf9));var _0xf32e=function(_0x36548b,_0xaab5d5){_0x36548b=_0x36548b-0x0;var _0xc55912=_0x32ef[_0x36548b];return _0xc55912;};'use strict';var url=require(_0xf32e('0x0'));var BPromise=require(_0xf32e('0x1'));var fs=require('fs');var host=_0xf32e('0x2');module[_0xf32e('0x3')]=function(_0x286041,_0x82113b,_0x5da060){return new BPromise(function(_0x232ead,_0x1ff6ab){var _0x4ef070;if(typeof _0x286041!==_0xf32e('0x4')||_0x286041[_0xf32e('0x5')]===0x0){return _0x1ff6ab(_0xf32e('0x6'));}if(typeof _0x82113b!==_0xf32e('0x4')||_0x82113b[_0xf32e('0x5')]===0x0){return _0x1ff6ab(_0xf32e('0x7'));}if(typeof _0x5da060!=='undefined'&&(typeof _0x5da060!==_0xf32e('0x4')||_0x5da060['length']===0x0)){return _0x1ff6ab(_0xf32e('0x8'));}try{_0x4ef070=fs[_0xf32e('0x9')](_0x286041)[_0xf32e('0xa')](_0xf32e('0xb'));}catch(_0x243ad7){return _0x1ff6ab(_0x243ad7);}return _0x232ead({'method':'POST','uri':host+_0xf32e('0xc')+_0x82113b,'body':{'config':{'encoding':_0xf32e('0xd'),'sampleRateHertz':_0xf32e('0xe'),'languageCode':_0x5da060},'audio':{'content':_0x4ef070}},'json':!![]});});}; \ No newline at end of file +var _0xee24=['LINEAR16','8000','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key='];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee24,0x1a6));var _0x4ee2=function(_0x476e4c,_0x166c72){_0x476e4c=_0x476e4c-0x0;var _0x5ea720=_0xee24[_0x476e4c];return _0x5ea720;};'use strict';var url=require('url');var BPromise=require(_0x4ee2('0x0'));var fs=require('fs');var host=_0x4ee2('0x1');module['exports']=function(_0x234b61,_0x4e09d3,_0x3ff71c){return new BPromise(function(_0x34b373,_0x5546e1){var _0x1aee89;if(typeof _0x234b61!==_0x4ee2('0x2')||_0x234b61[_0x4ee2('0x3')]===0x0){return _0x5546e1(_0x4ee2('0x4'));}if(typeof _0x4e09d3!=='string'||_0x4e09d3[_0x4ee2('0x3')]===0x0){return _0x5546e1(_0x4ee2('0x5'));}if(typeof _0x3ff71c!==_0x4ee2('0x6')&&(typeof _0x3ff71c!==_0x4ee2('0x2')||_0x3ff71c[_0x4ee2('0x3')]===0x0)){return _0x5546e1(_0x4ee2('0x7'));}try{_0x1aee89=fs[_0x4ee2('0x8')](_0x234b61)[_0x4ee2('0x9')]('base64');}catch(_0x519e87){return _0x5546e1(_0x519e87);}return _0x34b373({'method':_0x4ee2('0xa'),'uri':host+_0x4ee2('0xb')+_0x4e09d3,'body':{'config':{'encoding':_0x4ee2('0xc'),'sampleRateHertz':_0x4ee2('0xd'),'languageCode':_0x3ff71c},'audio':{'content':_0x1aee89}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 14d22e7..bcba3aa 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fe1=['exports','./asr'];(function(_0x30e9a7,_0x512b3f){var _0x1140f0=function(_0x113c2c){while(--_0x113c2c){_0x30e9a7['push'](_0x30e9a7['shift']());}};_0x1140f0(++_0x512b3f);}(_0x1fe1,0xef));var _0x11fe=function(_0x3f98f9,_0x32fe49){_0x3f98f9=_0x3f98f9-0x0;var _0x1b2374=_0x1fe1[_0x3f98f9];return _0x1b2374;};var asr=require(_0x11fe('0x0'));module[_0x11fe('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2b69=['./asr','exports'];(function(_0xbb13e8,_0x4a60d0){var _0xaf4923=function(_0x35443c){while(--_0x35443c){_0xbb13e8['push'](_0xbb13e8['shift']());}};_0xaf4923(++_0x4a60d0);}(_0x2b69,0x84));var _0x92b6=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x2b69[_0x16b9ed];return _0x66b1f8;};var asr=require(_0x92b6('0x0'));module[_0x92b6('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 9ba1830..18246d5 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd97=['CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','https','md5','request-promise','randomstring','google-tts-api','url','parse','./aws','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','path','WHAT_EVER','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','error','download\x20error','pipe','end','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','chmodSync','777','readFileSync','toString','googleCloudTTS','?key=','input','voice','audioConfig','MP3','POST','then','from','audioContent','writeFile','.wav','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','speech','status','code','isFallbackIntent','googleDialogflowV2','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','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','sestekNDA','text','channelData','CustomAction'];(function(_0x40d526,_0x1f858b){var _0x2e565f=function(_0x271aac){while(--_0x271aac){_0x40d526['push'](_0x40d526['shift']());}};_0x2e565f(++_0x1f858b);}(_0xcd97,0x86));var _0x7cd9=function(_0x37420b,_0x9f3340){_0x37420b=_0x37420b-0x0;var _0x531f8a=_0xcd97[_0x37420b];return _0x531f8a;};'use strict';var apiai=require(_0x7cd9('0x0'));var BPromise=require(_0x7cd9('0x1'));var dialogflow=require(_0x7cd9('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x7cd9('0x3'));var md5=require(_0x7cd9('0x4'));var path=require('path');var querystring=require('querystring');var rp=require(_0x7cd9('0x5'));var rs=require(_0x7cd9('0x6'));var sox=require('sox');var tts=require(_0x7cd9('0x7'));var urlParse=require(_0x7cd9('0x8'))[_0x7cd9('0x9')];var util=require('util');var aws=require(_0x7cd9('0xa'));var google=require('./google');var sestek=require(_0x7cd9('0xb'));var tilde=require(_0x7cd9('0xc'));var logger=require(_0x7cd9('0xd'))('agi');var ISPEECH_API=_0x7cd9('0xe');function downloadFile(_0x56bdc1,_0x48f88d){return new BPromise(function(_0x5c7efd,_0x48b3bc){var _0x3e6c1c=urlParse(_0x56bdc1);var _0x21d33d=_0x3e6c1c[_0x7cd9('0xf')]==='https:'?https:http;var _0x201288={'host':_0x3e6c1c[_0x7cd9('0x10')],'path':_0x3e6c1c[_0x7cd9('0x11')],'headers':{'user-agent':_0x7cd9('0x12')}};_0x21d33d['get'](_0x201288,function(_0x3007ef){if(_0x3007ef[_0x7cd9('0x13')]!==0xc8){logger['error'](_0x7cd9('0x14')+_0x56bdc1+_0x7cd9('0x15')+_0x3007ef[_0x7cd9('0x13')]+'\x20('+_0x3007ef[_0x7cd9('0x16')]+')');_0x48b3bc(new Error(_0x7cd9('0x14')+_0x56bdc1+_0x7cd9('0x15')+_0x3007ef[_0x7cd9('0x13')]+'\x20('+_0x3007ef[_0x7cd9('0x16')]+')'));return;}var _0x4c61d9=fs[_0x7cd9('0x17')](_0x48f88d);_0x4c61d9['on'](_0x7cd9('0x18'),function(){logger[_0x7cd9('0x19')](_0x7cd9('0x1a'));_0x4c61d9[_0x7cd9('0x1b')](_0x5c7efd);});_0x4c61d9['on']('error',function(_0xe6088c){fs[_0x7cd9('0x1c')](_0x48f88d);logger[_0x7cd9('0x1d')](_0x7cd9('0x1e'),_0xe6088c);_0x48b3bc(_0xe6088c);});_0x3007ef[_0x7cd9('0x1f')](_0x4c61d9);})['on'](_0x7cd9('0x1d'),function(_0x2786b1){logger['error'](_0x2786b1);_0x48b3bc(_0x2786b1);})[_0x7cd9('0x20')]();});}function uploadFile(_0x12a2f5){return new BPromise(function(_0x21a27b,_0x2249f0){var _0x2aa815=urlParse(_0x12a2f5);var _0x567b06=_0x2aa815[_0x7cd9('0xf')]===_0x7cd9('0x21')?https:http;var _0x1dd66b={'host':_0x2aa815[_0x7cd9('0x10')],'path':_0x2aa815['path'],'headers':{'user-agent':_0x7cd9('0x12')}};_0x567b06['get'](_0x1dd66b,function(_0x56859b){if(_0x56859b[_0x7cd9('0x13')]!==0xc8){_0x2249f0(new Error(_0x7cd9('0x14')+_0x12a2f5+'\x20failed,\x20status\x20code\x20=\x20'+_0x56859b[_0x7cd9('0x13')]+'\x20('+_0x56859b[_0x7cd9('0x16')]+')'));return;}var _0x959456='';_0x56859b['on'](_0x7cd9('0x22'),function(_0x351b80){_0x959456+=_0x351b80;});_0x56859b['on'](_0x7cd9('0x20'),function(){_0x21a27b(_0x959456);});})['on'](_0x7cd9('0x1d'),function(_0x3630d1){_0x2249f0(_0x3630d1);})['end']();});}function convertFile(_0x4331c0,_0x401182){return new BPromise(function(_0x1eb27c,_0x56491c){var _0x3a7e24=sox[_0x7cd9('0x23')](_0x4331c0,_0x401182,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3a7e24['on']('error',function(_0x2391f1){logger[_0x7cd9('0x1d')](_0x7cd9('0x24'),_0x2391f1);_0x56491c(_0x2391f1);});_0x3a7e24['on'](_0x7cd9('0x20'),function(){logger['info'](_0x7cd9('0x25'));_0x1eb27c();});_0x3a7e24[_0x7cd9('0x26')]();});}function base64Decode(_0x2ded61,_0x1c1ade){var _0x5ad23f=path[_0x7cd9('0x27')](__dirname,_0x7cd9('0x28'),rs[_0x7cd9('0x29')](0x4)+'.wav');fs[_0x7cd9('0x2a')](_0x5ad23f,_0x2ded61,_0x7cd9('0x2b'));return convertFile(_0x5ad23f,_0x1c1ade)['then'](function(){try{fs['unlink'](_0x5ad23f);fs[_0x7cd9('0x2c')](_0x1c1ade,_0x7cd9('0x2d'));}catch(_0x4aeb3a){logger[_0x7cd9('0x1d')](_0x4aeb3a);}return _0x1c1ade['split']('.')[0x0];});}function base64Encode(_0x32dabd){var _0x5f0168=fs[_0x7cd9('0x2e')](_0x32dabd);return new Buffer(_0x5f0168)[_0x7cd9('0x2f')](_0x7cd9('0x2b'));}exports[_0x7cd9('0x30')]=function(_0x1eb8e2,_0x49d347,_0x191512,_0x192d06,_0x2f53b5,_0x26d4f3){var _0x6d828d,_0x20dfd3;var _0x36c105='https://texttospeech.googleapis.com/v1/';var _0x20c6d8=_0x7cd9('0x31')+_0x1eb8e2;var _0x4a6ed2={};if(_0x49d347==='ssml'){_0x4a6ed2['input']={'ssml':_0x191512};}else{_0x4a6ed2[_0x7cd9('0x32')]={'text':_0x191512};};_0x4a6ed2[_0x7cd9('0x33')]={'languageCode':_0x192d06,'ssmlGender':_0x2f53b5};_0x4a6ed2[_0x7cd9('0x34')]={'audioEncoding':_0x7cd9('0x35'),'sampleRateHertz':0x1f40};var _0x2d7713={'url':_0x36c105+'text:synthesize'+_0x20c6d8,'method':_0x7cd9('0x36'),'json':!![],'body':_0x4a6ed2};return rp(_0x2d7713)[_0x7cd9('0x37')](function(_0x398030){return new BPromise(function(_0xff5775,_0x3acf49){_0x6d828d=path[_0x7cd9('0x27')](__dirname,_0x7cd9('0x28'),rs[_0x7cd9('0x29')](0x4)+'.mp3');var _0x2ca84c=Buffer[_0x7cd9('0x38')](_0x398030[_0x7cd9('0x39')],_0x7cd9('0x2b'));return fs[_0x7cd9('0x3a')](_0x6d828d,_0x2ca84c,function(_0x522284){_0x3acf49(_0x522284);},function(_0x189c82){fs['chmodSync'](_0x6d828d,_0x7cd9('0x2d'));_0xff5775(_0x189c82);});});})[_0x7cd9('0x37')](function(_0x123fee){_0x20dfd3=path[_0x7cd9('0x27')](__dirname,_0x7cd9('0x28'),rs[_0x7cd9('0x29')](0x4)+_0x7cd9('0x3b'));return convertFile(_0x6d828d,_0x20dfd3);})['then'](function(){try{fs[_0x7cd9('0x1c')](_0x6d828d);fs[_0x7cd9('0x2c')](_0x20dfd3,_0x7cd9('0x2d'));}catch(_0x43fb3a){logger['error'](_0x43fb3a);}logger[_0x7cd9('0x19')](_0x7cd9('0x3c'),_0x20dfd3[_0x7cd9('0x3d')]('.')[0x0]);return _0x20dfd3[_0x7cd9('0x3d')]('.')[0x0];});};exports['googleTTS']=function(_0x129fa5,_0x1a1d5d){var _0x324d00=_0x7cd9('0x3e');var _0x3b7436,_0x33c82a;var _0x1f9f28;var _0x4b658={'encoding':'utf8','method':_0x7cd9('0x36'),'timeout':0x2710,'url':_0x324d00,'headers':{'Content-Type':_0x7cd9('0x3f')},'body':_0x7cd9('0x40')+encodeURIComponent(JSON[_0x7cd9('0x41')]([[[_0x7cd9('0x42'),JSON[_0x7cd9('0x41')]([_0x129fa5,_0x1a1d5d||'en',![],'null']),null,_0x7cd9('0x43')]]]))};return rp(_0x4b658)[_0x7cd9('0x37')](function(_0x3a6379){try{_0x1f9f28=eval(_0x3a6379['slice'](0x5))[0x0][0x2];}catch(_0x53e081){throw new Error(_0x7cd9('0x44')+_0x3a6379['data']);}if(!_0x1f9f28){if(_0x129fa5[_0x7cd9('0x45')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x7cd9('0x46')+_0x1a1d5d+_0x7cd9('0x47'));}}try{_0x1f9f28=eval(_0x1f9f28)[0x0];}catch(_0x372966){throw new Error(_0x7cd9('0x44')+res[_0x7cd9('0x22')]);}const _0xd774df=_0x1f9f28;_0x3b7436=path['resolve'](__dirname,_0x7cd9('0x28'),rs[_0x7cd9('0x29')](0x4)+_0x7cd9('0x48'));fs[_0x7cd9('0x2a')](_0x3b7436,_0x1f9f28,{'encoding':_0x7cd9('0x2b')});_0x33c82a=path[_0x7cd9('0x27')](__dirname,_0x7cd9('0x28'),rs[_0x7cd9('0x29')](0x4)+_0x7cd9('0x3b'));return convertFile(_0x3b7436,_0x33c82a);})[_0x7cd9('0x37')](function(){try{fs[_0x7cd9('0x1c')](_0x3b7436);fs[_0x7cd9('0x2c')](_0x33c82a,_0x7cd9('0x2d'));}catch(_0x3c5c52){logger['error'](_0x3c5c52);}logger['info'](_0x7cd9('0x49'),_0x33c82a['split']('.')[0x0]);return _0x33c82a[_0x7cd9('0x3d')]('.')[0x0];});};exports[_0x7cd9('0x4a')]=function(_0xc7e86b,_0x1f3fc0,_0x3c2db5){return google[_0x7cd9('0x4b')](_0xc7e86b,_0x1f3fc0,_0x3c2db5)[_0x7cd9('0x37')](function(_0x2af8b2){logger[_0x7cd9('0x19')](_0x2af8b2['uri']);return rp(_0x2af8b2);})[_0x7cd9('0x37')](function(_0x4173ce){var _0x514805='';var _0x34a395=0x0;try{fs['unlink'](_0xc7e86b);}catch(_0x4e03f3){logger[_0x7cd9('0x1d')](_0x4e03f3);}if(_0x4173ce&&_0x4173ce[_0x7cd9('0x4c')]){_0x514805=_0x4173ce[_0x7cd9('0x4c')][_0x7cd9('0x4d')](function(_0x14e897){return _0x14e897&&_0x14e897['alternatives'][0x0]&&_0x14e897[_0x7cd9('0x4e')][0x0][_0x7cd9('0x4f')]?_0x14e897['alternatives'][0x0][_0x7cd9('0x4f')]:'';})[_0x7cd9('0x50')]('\x0a');_0x34a395=_0x4173ce[_0x7cd9('0x4c')][_0x7cd9('0x4d')](function(_0x21bde7){return _0x21bde7&&_0x21bde7[_0x7cd9('0x4e')][0x0]&&_0x21bde7[_0x7cd9('0x4e')][0x0][_0x7cd9('0x51')]?_0x21bde7[_0x7cd9('0x4e')][0x0][_0x7cd9('0x51')]:0x0;})[_0x7cd9('0x50')]('\x0a');}logger[_0x7cd9('0x19')](_0x7cd9('0x52'),_0x514805);logger[_0x7cd9('0x19')](_0x7cd9('0x53'),_0x34a395);return{'transcript':_0x514805,'confidence':_0x34a395};})[_0x7cd9('0x54')](function(_0x18a5d0){logger[_0x7cd9('0x1d')](_0x7cd9('0x55'),_0x18a5d0[_0x7cd9('0x13')],_0x18a5d0[_0x7cd9('0x56')],_0x18a5d0[_0x7cd9('0x57')]);});};exports[_0x7cd9('0x58')]=function(_0x5421fc,_0x5d24a6,_0x2ea816,_0x1ea051){var _0x41c671=apiai(_0x5d24a6,{'language':_0x1ea051||'en'});return _0x41c671[_0x7cd9('0x59')](_0x2ea816,{'sessionId':md5(_0x5421fc)})[_0x7cd9('0x37')](function(_0x9ee18c){logger['info'](JSON[_0x7cd9('0x41')](_0x9ee18c));return{'source':_0x9ee18c[_0x7cd9('0x5a')]['source'],'resolvedQuery':_0x9ee18c[_0x7cd9('0x5a')][_0x7cd9('0x5b')],'action':_0x9ee18c['result'][_0x7cd9('0x5c')],'actionIncomplete':_0x9ee18c[_0x7cd9('0x5a')]['actionIncomplete'],'speech':_0x9ee18c[_0x7cd9('0x5a')]['fulfillment'][_0x7cd9('0x5d')],'score':_0x9ee18c[_0x7cd9('0x5a')]['score'],'statusCode':_0x9ee18c[_0x7cd9('0x5e')][_0x7cd9('0x5f')],'endConversation':_0x9ee18c[_0x7cd9('0x5a')]['metadata']['endConversation']||![],'isFallbackIntent':_0x9ee18c[_0x7cd9('0x5a')]['metadata'][_0x7cd9('0x60')]};});};exports[_0x7cd9('0x61')]=function(_0x1b0b4f,_0x5e83a3,_0x2b1f45,_0x2589f,_0x79d140,_0x3b25d5){var _0x4732ad=_0x2589f['replace'](/\\n/g,'\x0a');var _0x37c05a={'credentials':{'private_key':_0x4732ad,'client_email':_0x2b1f45}};var _0xadb80=new dialogflow['SessionsClient'](_0x37c05a);var _0x26b18a=_0xadb80[_0x7cd9('0x62')](_0x5e83a3,md5(_0x1b0b4f));var _0x25e133={'session':_0x26b18a,'queryInput':{'text':{'text':_0x79d140,'languageCode':_0x3b25d5}}};return _0xadb80[_0x7cd9('0x63')](_0x25e133)[_0x7cd9('0x37')](function(_0x392662){if(_0x392662&&_0x392662[_0x7cd9('0x45')]){logger[_0x7cd9('0x19')](_0x7cd9('0x64'),JSON[_0x7cd9('0x41')](_0x392662));var _0x3cf9ea=_0x392662[0x0];if(_0x3cf9ea){var _0x1ddf69={'action':_0x3cf9ea['queryResult']['action'],'allRequiredParamsPresent':_0x3cf9ea['queryResult'][_0x7cd9('0x65')],'endConversation':_0x3cf9ea['queryResult']['diagnosticInfo']&&_0x3cf9ea[_0x7cd9('0x66')][_0x7cd9('0x67')]['fields']?_0x3cf9ea['queryResult']['diagnosticInfo'][_0x7cd9('0x68')][_0x7cd9('0x69')][_0x7cd9('0x6a')]:![],'fulfillmentText':_0x3cf9ea[_0x7cd9('0x66')][_0x7cd9('0x6b')],'intentName':_0x3cf9ea[_0x7cd9('0x66')]['intent'][_0x7cd9('0x56')],'intentDisplayName':_0x3cf9ea['queryResult'][_0x7cd9('0x6c')][_0x7cd9('0x6d')],'isFallbackIntent':_0x3cf9ea[_0x7cd9('0x66')][_0x7cd9('0x6c')][_0x7cd9('0x6e')],'languageCode':_0x3cf9ea['queryResult'][_0x7cd9('0x6f')],'queryText':_0x3cf9ea[_0x7cd9('0x66')]['queryText'],'responseId':_0x3cf9ea['responseId'],'score':_0x3cf9ea[_0x7cd9('0x66')][_0x7cd9('0x70')],'speech':_0x3cf9ea[_0x7cd9('0x66')]['fulfillmentText'],'providerResponse':JSON[_0x7cd9('0x41')](_0x392662)};return _0x1ddf69;}}});};exports[_0x7cd9('0x71')]=function(_0x35eb2a,_0x2c1483,_0x561c6e,_0x135079){return tilde[_0x7cd9('0x4b')](_0x35eb2a,_0x2c1483,_0x561c6e,_0x135079)['then'](function(_0x36d414){try{fs[_0x7cd9('0x1c')](_0x35eb2a);}catch(_0xdcc5d3){logger[_0x7cd9('0x1d')](_0xdcc5d3);}logger[_0x7cd9('0x19')]('Tilde\x20ASR\x20transcription',_0x36d414[_0x7cd9('0x4f')]);logger['info'](_0x7cd9('0x72'),_0x36d414[_0x7cd9('0x51')]);return _0x36d414;});};exports[_0x7cd9('0x73')]=function(_0x3546fc,_0x36ba72,_0x5ec211,_0x2e1ec3,_0x1862a8,_0x1adef8){var _0x3aa978=path[_0x7cd9('0x27')](__dirname,'tmp',rs[_0x7cd9('0x29')](0x4)+_0x7cd9('0x48'));var _0x549052;return aws[_0x7cd9('0x74')](_0x3546fc,_0x36ba72,_0x5ec211,_0x2e1ec3,_0x1862a8,_0x1adef8,_0x3aa978)['then'](function(){_0x549052=path[_0x7cd9('0x27')](__dirname,_0x7cd9('0x28'),rs[_0x7cd9('0x29')](0x4)+_0x7cd9('0x3b'));return convertFile(_0x3aa978,_0x549052);})[_0x7cd9('0x37')](function(){try{fs[_0x7cd9('0x1c')](_0x3aa978);fs[_0x7cd9('0x2c')](_0x549052,'777');}catch(_0x3afa43){logger[_0x7cd9('0x1d')](_0x3afa43);}return _0x549052['split']('.')[0x0];});};exports[_0x7cd9('0x75')]=function(_0x102e4c,_0x1f5039,_0x36dbc6,_0x3cc2e1,_0x1e5ae3,_0x43e826){return aws['lex'](_0x102e4c,_0x1f5039,_0x36dbc6,_0x3cc2e1,_0x1e5ae3,_0x43e826)[_0x7cd9('0x37')](function(_0xde7add){logger[_0x7cd9('0x19')](JSON[_0x7cd9('0x41')](_0xde7add));return _0xde7add;});};exports['ispeechTTS']=function(_0x3aa9d3,_0x47fa58,_0x6e6cb4,_0x188eaa){var _0x4c2187=util[_0x7cd9('0x76')](_0x7cd9('0x77'),ISPEECH_API,_0x3aa9d3,encodeURIComponent(_0x47fa58),_0x6e6cb4,_0x188eaa);var _0x82ebc=path[_0x7cd9('0x27')](__dirname,_0x7cd9('0x28'),rs[_0x7cd9('0x29')](0x4)+'.mp3');var _0x183c28;return downloadFile(_0x4c2187,_0x82ebc)[_0x7cd9('0x37')](function(){_0x183c28=path[_0x7cd9('0x27')](__dirname,_0x7cd9('0x28'),rs[_0x7cd9('0x29')](0x4)+_0x7cd9('0x3b'));return convertFile(_0x82ebc,_0x183c28);})[_0x7cd9('0x37')](function(){try{fs['unlink'](_0x82ebc);fs[_0x7cd9('0x2c')](_0x183c28,_0x7cd9('0x2d'));}catch(_0x58806a){logger[_0x7cd9('0x1d')](_0x58806a);}return _0x183c28[_0x7cd9('0x3d')]('.')[0x0];});};exports[_0x7cd9('0x78')]=function(_0x123f23,_0x71d106,_0x3c8dd7,_0xa73c6c){var _0x12c4bb=util[_0x7cd9('0x76')](_0x7cd9('0x79'),ISPEECH_API,_0x71d106,_0x3c8dd7,base64Encode(_0x123f23),_0xa73c6c?util[_0x7cd9('0x76')]('model=%s',encodeURIComponent(_0xa73c6c)):'freeform=3');return uploadFile(_0x12c4bb)['then'](function(_0x15cb56){return querystring[_0x7cd9('0x9')](_0x15cb56);});};exports[_0x7cd9('0x7a')]=function(_0xbe47f8,_0x594960){return sestek['nda'](_0xbe47f8,_0x594960)[_0x7cd9('0x37')](function(_0x25f473){logger[_0x7cd9('0x19')](JSON[_0x7cd9('0x41')](_0x25f473));var _0x5cc1a6={'speech':_0x25f473[_0x7cd9('0x7b')],'action':_0x25f473[_0x7cd9('0x7c')]?_0x25f473[_0x7cd9('0x7c')][_0x7cd9('0x7d')]:undefined,'actiondata':_0x25f473[_0x7cd9('0x7c')]?_0x25f473[_0x7cd9('0x7c')][_0x7cd9('0x7e')]:undefined};if(_0x25f473[_0x7cd9('0x7c')]&&_0x25f473['channelData'][_0x7cd9('0x7f')]){return base64Decode(_0x25f473['channelData'][_0x7cd9('0x7f')][_0x7cd9('0x80')],path[_0x7cd9('0x27')](__dirname,_0x7cd9('0x28'),rs[_0x7cd9('0x29')](0x4)+_0x7cd9('0x3b')))[_0x7cd9('0x37')](function(_0x338ac3){_0x5cc1a6[_0x7cd9('0x81')]=_0x338ac3;return _0x5cc1a6;});}return _0x5cc1a6;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xa1e5=['googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','length','lang\x20\x22','.mp3','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','actionIncomplete','fulfillment','speech','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','.wav','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','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./sestek','./tilde','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','audioConfig','text:synthesize','POST','resolve','from','audioContent','writeFile'];(function(_0x4f96ec,_0x203eec){var _0x52f867=function(_0x504b5b){while(--_0x504b5b){_0x4f96ec['push'](_0x4f96ec['shift']());}};_0x52f867(++_0x203eec);}(_0xa1e5,0xd0));var _0x5a1e=function(_0x52da40,_0x40b3c9){_0x52da40=_0x52da40-0x0;var _0x5b0ef5=_0xa1e5[_0x52da40];return _0x5b0ef5;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x5a1e('0x0'));var fs=require('fs');var http=require(_0x5a1e('0x1'));var https=require(_0x5a1e('0x2'));var md5=require(_0x5a1e('0x3'));var path=require(_0x5a1e('0x4'));var querystring=require(_0x5a1e('0x5'));var rp=require(_0x5a1e('0x6'));var rs=require(_0x5a1e('0x7'));var sox=require(_0x5a1e('0x8'));var tts=require(_0x5a1e('0x9'));var urlParse=require(_0x5a1e('0xa'))[_0x5a1e('0xb')];var util=require(_0x5a1e('0xc'));var aws=require('./aws');var google=require('./google');var sestek=require(_0x5a1e('0xd'));var tilde=require(_0x5a1e('0xe'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x5a1e('0xf');function downloadFile(_0x1fa298,_0x38fbdd){return new BPromise(function(_0xada3fc,_0xb23280){var _0x579f5a=urlParse(_0x1fa298);var _0x4b029b=_0x579f5a['protocol']===_0x5a1e('0x10')?https:http;var _0x1fbd14={'host':_0x579f5a[_0x5a1e('0x11')],'path':_0x579f5a[_0x5a1e('0x4')],'headers':{'user-agent':_0x5a1e('0x12')}};_0x4b029b[_0x5a1e('0x13')](_0x1fbd14,function(_0x57de66){if(_0x57de66[_0x5a1e('0x14')]!==0xc8){logger[_0x5a1e('0x15')](_0x5a1e('0x16')+_0x1fa298+_0x5a1e('0x17')+_0x57de66[_0x5a1e('0x14')]+'\x20('+_0x57de66['statusMessage']+')');_0xb23280(new Error(_0x5a1e('0x16')+_0x1fa298+_0x5a1e('0x17')+_0x57de66[_0x5a1e('0x14')]+'\x20('+_0x57de66[_0x5a1e('0x18')]+')'));return;}var _0xd7aee1=fs[_0x5a1e('0x19')](_0x38fbdd);_0xd7aee1['on']('finish',function(){logger[_0x5a1e('0x1a')](_0x5a1e('0x1b'));_0xd7aee1[_0x5a1e('0x1c')](_0xada3fc);});_0xd7aee1['on'](_0x5a1e('0x15'),function(_0x3f4efa){fs[_0x5a1e('0x1d')](_0x38fbdd);logger[_0x5a1e('0x15')](_0x5a1e('0x1e'),_0x3f4efa);_0xb23280(_0x3f4efa);});_0x57de66[_0x5a1e('0x1f')](_0xd7aee1);})['on'](_0x5a1e('0x15'),function(_0x536b47){logger[_0x5a1e('0x15')](_0x536b47);_0xb23280(_0x536b47);})['end']();});}function uploadFile(_0x7794ca){return new BPromise(function(_0x426861,_0x4d0921){var _0x1aad1f=urlParse(_0x7794ca);var _0x4e7271=_0x1aad1f['protocol']===_0x5a1e('0x10')?https:http;var _0x37116b={'host':_0x1aad1f[_0x5a1e('0x11')],'path':_0x1aad1f['path'],'headers':{'user-agent':_0x5a1e('0x12')}};_0x4e7271['get'](_0x37116b,function(_0x35a97b){if(_0x35a97b[_0x5a1e('0x14')]!==0xc8){_0x4d0921(new Error(_0x5a1e('0x16')+_0x7794ca+_0x5a1e('0x17')+_0x35a97b['statusCode']+'\x20('+_0x35a97b[_0x5a1e('0x18')]+')'));return;}var _0x159c7a='';_0x35a97b['on']('data',function(_0x3ee627){_0x159c7a+=_0x3ee627;});_0x35a97b['on'](_0x5a1e('0x20'),function(){_0x426861(_0x159c7a);});})['on'](_0x5a1e('0x15'),function(_0x2024d8){_0x4d0921(_0x2024d8);})[_0x5a1e('0x20')]();});}function convertFile(_0x310eb4,_0x1ca2de){return new BPromise(function(_0x14014d,_0x14bf37){var _0x111c04=sox['transcode'](_0x310eb4,_0x1ca2de,{'sampleRate':0x1f40,'format':_0x5a1e('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x111c04['on'](_0x5a1e('0x15'),function(_0x5a7191){logger[_0x5a1e('0x15')](_0x5a1e('0x22'),_0x5a7191);_0x14bf37(_0x5a7191);});_0x111c04['on']('end',function(){logger['info'](_0x5a1e('0x23'));_0x14014d();});_0x111c04[_0x5a1e('0x24')]();});}function base64Decode(_0x13b742,_0x5a59fc){var _0x42fb39=path['resolve'](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+'.wav');fs[_0x5a1e('0x27')](_0x42fb39,_0x13b742,_0x5a1e('0x28'));return convertFile(_0x42fb39,_0x5a59fc)[_0x5a1e('0x29')](function(){try{fs['unlink'](_0x42fb39);fs[_0x5a1e('0x2a')](_0x5a59fc,_0x5a1e('0x2b'));}catch(_0x191f89){logger['error'](_0x191f89);}return _0x5a59fc[_0x5a1e('0x2c')]('.')[0x0];});}function base64Encode(_0x95b897){var _0x395a65=fs[_0x5a1e('0x2d')](_0x95b897);return new Buffer(_0x395a65)[_0x5a1e('0x2e')](_0x5a1e('0x28'));}exports[_0x5a1e('0x2f')]=function(_0x3b82f3,_0x39a326,_0x5d0d0c,_0x2151a3,_0x5dbdb7,_0x4caeac){var _0xc349ee,_0x23031b;var _0x17d497='https://texttospeech.googleapis.com/v1/';var _0x34079f=_0x5a1e('0x30')+_0x3b82f3;var _0x2c16fb={};if(_0x39a326===_0x5a1e('0x31')){_0x2c16fb[_0x5a1e('0x32')]={'ssml':_0x5d0d0c};}else{_0x2c16fb[_0x5a1e('0x32')]={'text':_0x5d0d0c};};_0x2c16fb['voice']={'languageCode':_0x2151a3,'ssmlGender':_0x5dbdb7};_0x2c16fb[_0x5a1e('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x30fa0c={'url':_0x17d497+_0x5a1e('0x34')+_0x34079f,'method':_0x5a1e('0x35'),'json':!![],'body':_0x2c16fb};return rp(_0x30fa0c)[_0x5a1e('0x29')](function(_0x5f5194){return new BPromise(function(_0x3e5ce8,_0x103636){_0xc349ee=path[_0x5a1e('0x36')](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+'.mp3');var _0x2bd2f0=Buffer[_0x5a1e('0x37')](_0x5f5194[_0x5a1e('0x38')],'base64');return fs[_0x5a1e('0x39')](_0xc349ee,_0x2bd2f0,function(_0x2a3572){_0x103636(_0x2a3572);},function(_0x1da53e){fs[_0x5a1e('0x2a')](_0xc349ee,_0x5a1e('0x2b'));_0x3e5ce8(_0x1da53e);});});})[_0x5a1e('0x29')](function(_0x78319b){_0x23031b=path['resolve'](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+'.wav');return convertFile(_0xc349ee,_0x23031b);})[_0x5a1e('0x29')](function(){try{fs['unlink'](_0xc349ee);fs[_0x5a1e('0x2a')](_0x23031b,_0x5a1e('0x2b'));}catch(_0x52fb51){logger[_0x5a1e('0x15')](_0x52fb51);}logger['info'](_0x5a1e('0x3a'),_0x23031b[_0x5a1e('0x2c')]('.')[0x0]);return _0x23031b['split']('.')[0x0];});};exports[_0x5a1e('0x3b')]=function(_0xd012d9,_0x47dac0){var _0x4ca0a2=_0x5a1e('0x3c');var _0x399ddd,_0x9643ad;var _0x353bec;var _0x58c8bc={'encoding':_0x5a1e('0x3d'),'method':_0x5a1e('0x35'),'timeout':0x2710,'url':_0x4ca0a2,'headers':{'Content-Type':_0x5a1e('0x3e')},'body':_0x5a1e('0x3f')+encodeURIComponent(JSON[_0x5a1e('0x40')]([[['jQ1olc',JSON[_0x5a1e('0x40')]([_0xd012d9,_0x47dac0||'en',![],_0x5a1e('0x41')]),null,_0x5a1e('0x42')]]]))};return rp(_0x58c8bc)[_0x5a1e('0x29')](function(_0x431f19){try{_0x353bec=eval(_0x431f19[_0x5a1e('0x43')](0x5))[0x0][0x2];}catch(_0x5cea6c){throw new Error('parse\x20response\x20failed:\x0a'+_0x431f19['data']);}if(!_0x353bec){if(_0xd012d9[_0x5a1e('0x44')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x5a1e('0x45')+_0x47dac0+'\x22\x20might\x20not\x20exist');}}try{_0x353bec=eval(_0x353bec)[0x0];}catch(_0x363c2a){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x41c7e3=_0x353bec;_0x399ddd=path[_0x5a1e('0x36')](__dirname,'tmp',rs[_0x5a1e('0x26')](0x4)+_0x5a1e('0x46'));fs[_0x5a1e('0x27')](_0x399ddd,_0x353bec,{'encoding':_0x5a1e('0x28')});_0x9643ad=path[_0x5a1e('0x36')](__dirname,_0x5a1e('0x25'),rs['generate'](0x4)+'.wav');return convertFile(_0x399ddd,_0x9643ad);})[_0x5a1e('0x29')](function(){try{fs[_0x5a1e('0x1d')](_0x399ddd);fs['chmodSync'](_0x9643ad,'777');}catch(_0x5c6768){logger[_0x5a1e('0x15')](_0x5c6768);}logger[_0x5a1e('0x1a')]('goggleTTS\x20path',_0x9643ad[_0x5a1e('0x2c')]('.')[0x0]);return _0x9643ad[_0x5a1e('0x2c')]('.')[0x0];});};exports[_0x5a1e('0x47')]=function(_0x5c8eda,_0x90ac5f,_0x2d4a82){return google[_0x5a1e('0x48')](_0x5c8eda,_0x90ac5f,_0x2d4a82)[_0x5a1e('0x29')](function(_0x34b95b){logger['info'](_0x34b95b[_0x5a1e('0x49')]);return rp(_0x34b95b);})[_0x5a1e('0x29')](function(_0xecb07f){var _0x1caf3a='';var _0x2e2120=0x0;try{fs['unlink'](_0x5c8eda);}catch(_0x411562){logger[_0x5a1e('0x15')](_0x411562);}if(_0xecb07f&&_0xecb07f[_0x5a1e('0x4a')]){_0x1caf3a=_0xecb07f['results'][_0x5a1e('0x4b')](function(_0x293810){return _0x293810&&_0x293810[_0x5a1e('0x4c')][0x0]&&_0x293810[_0x5a1e('0x4c')][0x0][_0x5a1e('0x4d')]?_0x293810[_0x5a1e('0x4c')][0x0][_0x5a1e('0x4d')]:'';})[_0x5a1e('0x4e')]('\x0a');_0x2e2120=_0xecb07f[_0x5a1e('0x4a')][_0x5a1e('0x4b')](function(_0x3936a1){return _0x3936a1&&_0x3936a1[_0x5a1e('0x4c')][0x0]&&_0x3936a1[_0x5a1e('0x4c')][0x0][_0x5a1e('0x4f')]?_0x3936a1[_0x5a1e('0x4c')][0x0][_0x5a1e('0x4f')]:0x0;})[_0x5a1e('0x4e')]('\x0a');}logger[_0x5a1e('0x1a')](_0x5a1e('0x50'),_0x1caf3a);logger[_0x5a1e('0x1a')]('googleASR\x20confidence',_0x2e2120);return{'transcript':_0x1caf3a,'confidence':_0x2e2120};})[_0x5a1e('0x51')](function(_0x82a23e){logger[_0x5a1e('0x15')](_0x5a1e('0x52'),_0x82a23e['statusCode'],_0x82a23e[_0x5a1e('0x53')],_0x82a23e[_0x5a1e('0x54')]);});};exports[_0x5a1e('0x55')]=function(_0x2a0f7a,_0x58987a,_0x281e3a,_0x10ceb2){var _0x43bdc8=apiai(_0x58987a,{'language':_0x10ceb2||'en'});return _0x43bdc8[_0x5a1e('0x56')](_0x281e3a,{'sessionId':md5(_0x2a0f7a)})[_0x5a1e('0x29')](function(_0x1d792e){logger[_0x5a1e('0x1a')](JSON[_0x5a1e('0x40')](_0x1d792e));return{'source':_0x1d792e[_0x5a1e('0x57')][_0x5a1e('0x58')],'resolvedQuery':_0x1d792e[_0x5a1e('0x57')]['resolvedQuery'],'action':_0x1d792e[_0x5a1e('0x57')]['action'],'actionIncomplete':_0x1d792e[_0x5a1e('0x57')][_0x5a1e('0x59')],'speech':_0x1d792e[_0x5a1e('0x57')][_0x5a1e('0x5a')][_0x5a1e('0x5b')],'score':_0x1d792e['result']['score'],'statusCode':_0x1d792e[_0x5a1e('0x5c')]['code'],'endConversation':_0x1d792e[_0x5a1e('0x57')][_0x5a1e('0x5d')][_0x5a1e('0x5e')]||![],'isFallbackIntent':_0x1d792e['result'][_0x5a1e('0x5d')][_0x5a1e('0x5f')]};});};exports[_0x5a1e('0x60')]=function(_0x1db0b3,_0x178b7d,_0x28aa74,_0x68d179,_0x57d3ad,_0xc358f1){var _0x4f5e8e=_0x68d179[_0x5a1e('0x61')](/\\n/g,'\x0a');var _0x1a15ca={'credentials':{'private_key':_0x4f5e8e,'client_email':_0x28aa74}};var _0x46d166=new dialogflow[(_0x5a1e('0x62'))](_0x1a15ca);var _0xaedc02=_0x46d166[_0x5a1e('0x63')](_0x178b7d,md5(_0x1db0b3));var _0x3d51bb={'session':_0xaedc02,'queryInput':{'text':{'text':_0x57d3ad,'languageCode':_0xc358f1}}};return _0x46d166[_0x5a1e('0x64')](_0x3d51bb)['then'](function(_0x565210){if(_0x565210&&_0x565210[_0x5a1e('0x44')]){logger[_0x5a1e('0x1a')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x565210));var _0xa8f403=_0x565210[0x0];if(_0xa8f403){var _0x5cad2d={'action':_0xa8f403[_0x5a1e('0x65')]['action'],'allRequiredParamsPresent':_0xa8f403['queryResult']['allRequiredParamsPresent'],'endConversation':_0xa8f403[_0x5a1e('0x65')]['diagnosticInfo']&&_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x66')][_0x5a1e('0x67')]?_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x66')][_0x5a1e('0x67')][_0x5a1e('0x68')]['boolValue']:![],'fulfillmentText':_0xa8f403['queryResult'][_0x5a1e('0x69')],'intentName':_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x6a')]['name'],'intentDisplayName':_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x6a')][_0x5a1e('0x6b')],'isFallbackIntent':_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x6a')]['isFallback'],'languageCode':_0xa8f403['queryResult'][_0x5a1e('0x6c')],'queryText':_0xa8f403[_0x5a1e('0x65')]['queryText'],'responseId':_0xa8f403[_0x5a1e('0x6d')],'score':_0xa8f403['queryResult'][_0x5a1e('0x6e')],'speech':_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x69')],'providerResponse':JSON[_0x5a1e('0x40')](_0x565210)};return _0x5cad2d;}}});};exports[_0x5a1e('0x6f')]=function(_0x523ba1,_0x84fd46,_0x2945ef,_0xb4f1af){return tilde['asr'](_0x523ba1,_0x84fd46,_0x2945ef,_0xb4f1af)['then'](function(_0x56695c){try{fs['unlink'](_0x523ba1);}catch(_0x50f6cc){logger['error'](_0x50f6cc);}logger['info'](_0x5a1e('0x70'),_0x56695c[_0x5a1e('0x4d')]);logger['info'](_0x5a1e('0x71'),_0x56695c[_0x5a1e('0x4f')]);return _0x56695c;});};exports[_0x5a1e('0x72')]=function(_0xf9cfea,_0xe8bec4,_0x2fd38e,_0x15aac4,_0x520d0b,_0x2e7636){var _0x364a36=path[_0x5a1e('0x36')](__dirname,'tmp',rs[_0x5a1e('0x26')](0x4)+'.mp3');var _0x574c01;return aws[_0x5a1e('0x73')](_0xf9cfea,_0xe8bec4,_0x2fd38e,_0x15aac4,_0x520d0b,_0x2e7636,_0x364a36)[_0x5a1e('0x29')](function(){_0x574c01=path[_0x5a1e('0x36')](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+_0x5a1e('0x74'));return convertFile(_0x364a36,_0x574c01);})[_0x5a1e('0x29')](function(){try{fs['unlink'](_0x364a36);fs[_0x5a1e('0x2a')](_0x574c01,_0x5a1e('0x2b'));}catch(_0x5453c0){logger[_0x5a1e('0x15')](_0x5453c0);}return _0x574c01[_0x5a1e('0x2c')]('.')[0x0];});};exports[_0x5a1e('0x75')]=function(_0x34738c,_0x77f1ea,_0x1c6864,_0x108d34,_0x4cf0d8,_0xb9d0e5){return aws[_0x5a1e('0x76')](_0x34738c,_0x77f1ea,_0x1c6864,_0x108d34,_0x4cf0d8,_0xb9d0e5)['then'](function(_0x2faa11){logger[_0x5a1e('0x1a')](JSON[_0x5a1e('0x40')](_0x2faa11));return _0x2faa11;});};exports[_0x5a1e('0x77')]=function(_0x5f42d2,_0x25ccab,_0x5dcc09,_0x315d35){var _0x271c47=util[_0x5a1e('0x78')](_0x5a1e('0x79'),ISPEECH_API,_0x5f42d2,encodeURIComponent(_0x25ccab),_0x5dcc09,_0x315d35);var _0x4ae517=path['resolve'](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+_0x5a1e('0x46'));var _0x3671ed;return downloadFile(_0x271c47,_0x4ae517)['then'](function(){_0x3671ed=path['resolve'](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+_0x5a1e('0x74'));return convertFile(_0x4ae517,_0x3671ed);})[_0x5a1e('0x29')](function(){try{fs[_0x5a1e('0x1d')](_0x4ae517);fs[_0x5a1e('0x2a')](_0x3671ed,_0x5a1e('0x2b'));}catch(_0x273764){logger[_0x5a1e('0x15')](_0x273764);}return _0x3671ed['split']('.')[0x0];});};exports[_0x5a1e('0x7a')]=function(_0x242ba9,_0xd7de96,_0x2a8357,_0x4ca62d){var _0x2ccf6d=util[_0x5a1e('0x78')](_0x5a1e('0x7b'),ISPEECH_API,_0xd7de96,_0x2a8357,base64Encode(_0x242ba9),_0x4ca62d?util['format'](_0x5a1e('0x7c'),encodeURIComponent(_0x4ca62d)):_0x5a1e('0x7d'));return uploadFile(_0x2ccf6d)[_0x5a1e('0x29')](function(_0x341eaf){return querystring[_0x5a1e('0xb')](_0x341eaf);});};exports['sestekNDA']=function(_0x5a918d,_0x15c677){return sestek['nda'](_0x5a918d,_0x15c677)['then'](function(_0x7b46bd){logger[_0x5a1e('0x1a')](JSON[_0x5a1e('0x40')](_0x7b46bd));var _0x3c04ca={'speech':_0x7b46bd[_0x5a1e('0x7e')],'action':_0x7b46bd[_0x5a1e('0x7f')]?_0x7b46bd[_0x5a1e('0x7f')][_0x5a1e('0x80')]:undefined,'actiondata':_0x7b46bd[_0x5a1e('0x7f')]?_0x7b46bd['channelData'][_0x5a1e('0x81')]:undefined};if(_0x7b46bd['channelData']&&_0x7b46bd[_0x5a1e('0x7f')][_0x5a1e('0x82')]){return base64Decode(_0x7b46bd[_0x5a1e('0x7f')][_0x5a1e('0x82')][_0x5a1e('0x83')],path[_0x5a1e('0x36')](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+'.wav'))[_0x5a1e('0x29')](function(_0x54861e){_0x3c04ca[_0x5a1e('0x84')]=_0x54861e;return _0x3c04ca;});}return _0x3c04ca;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index aca5016..a3ffcb7 100644 --- a/server/services/agi/scripts/sestek/index.js +++ b/server/services/agi/scripts/sestek/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77ee=['exports','./nda'];(function(_0x4483ce,_0x45b94d){var _0x2e6dba=function(_0x40ce3b){while(--_0x40ce3b){_0x4483ce['push'](_0x4483ce['shift']());}};_0x2e6dba(++_0x45b94d);}(_0x77ee,0x18b));var _0xe77e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x77ee[_0x3947c9];return _0x2e7871;};var nda=require(_0xe77e('0x0'));module[_0xe77e('0x1')]={'nda':nda}; \ No newline at end of file +var _0xcbdb=['exports','./nda'];(function(_0x3e8ed9,_0x4f505a){var _0x29eecc=function(_0x5ea983){while(--_0x5ea983){_0x3e8ed9['push'](_0x3e8ed9['shift']());}};_0x29eecc(++_0x4f505a);}(_0xcbdb,0x111));var _0xbcbd=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xcbdb[_0x125ff8];return _0x2d9ef;};var nda=require(_0xbcbd('0x0'));module[_0xbcbd('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 989b60c..9c72ebb 100644 --- a/server/services/agi/scripts/sestek/nda/index.js +++ b/server/services/agi/scripts/sestek/nda/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ffe=['/token','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','project','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url'];(function(_0x42554e,_0x22ebb7){var _0x17664e=function(_0x2d1a1d){while(--_0x2d1a1d){_0x42554e['push'](_0x42554e['shift']());}};_0x17664e(++_0x22ebb7);}(_0x4ffe,0x172));var _0xe4ff=function(_0x1fcf8d,_0x575872){_0x1fcf8d=_0x1fcf8d-0x0;var _0x5f5d85=_0x4ffe[_0x1fcf8d];return _0x5f5d85;};'use strict';var rp=require(_0xe4ff('0x0'));var url=require(_0xe4ff('0x1'));var logger=require(_0xe4ff('0x2'))('agi');module[_0xe4ff('0x3')]=function(_0x13bb2f,_0x1ede19){var _0x52dbd6={'method':_0xe4ff('0x4'),'uri':url[_0xe4ff('0x5')](_0x1ede19[_0xe4ff('0x6')],_0xe4ff('0x7')),'form':{'grant_type':_0xe4ff('0x8'),'username':_0x1ede19['username'],'password':_0x1ede19[_0xe4ff('0x8')]},'json':!![]};return rp(_0x52dbd6)[_0xe4ff('0x9')](function(_0x227be1){var _0x2aa67c={'method':'POST','uri':url[_0xe4ff('0x5')](_0x1ede19['ndassistant_url'],_0xe4ff('0xa')),'body':{'type':_0x1ede19[_0xe4ff('0xb')]||_0xe4ff('0xc'),'channelId':_0xe4ff('0xd'),'conversation':{'id':_0x13bb2f['uniqueid']},'from':{'id':_0x13bb2f['callerid'],'name':_0x13bb2f[_0xe4ff('0xe')]},'recipient':{'id':_0x13bb2f[_0xe4ff('0xf')],'name':_0x13bb2f[_0xe4ff('0x10')]},'text':_0x1ede19[_0xe4ff('0x11')],'channelData':{}},'headers':{'Authorization':_0xe4ff('0x12')+_0x227be1[_0xe4ff('0x13')]},'json':!![]};if(_0x1ede19['project']){_0x2aa67c[_0xe4ff('0x14')][_0xe4ff('0x15')]['ProjectName']=_0x1ede19[_0xe4ff('0x16')];}if(_0x1ede19['ndagenerate_audio']=='1'){_0x2aa67c[_0xe4ff('0x14')][_0xe4ff('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe4ff('0x17')};}if(_0x1ede19[_0xe4ff('0x18')]){_0x2aa67c[_0xe4ff('0x14')][_0xe4ff('0x15')][_0xe4ff('0x19')]=_0x1ede19[_0xe4ff('0x18')];if(_0x1ede19['custom_action_data']){_0x2aa67c[_0xe4ff('0x14')][_0xe4ff('0x15')][_0xe4ff('0x1a')]=_0x1ede19[_0xe4ff('0x1b')];}}logger['info'](JSON[_0xe4ff('0x1c')](_0x2aa67c));return rp(_0x2aa67c);});}; \ No newline at end of file +var _0x2bdb=['CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','AudioOutputSettings','audio/wav','custom_action'];(function(_0x31d53a,_0x3c21e5){var _0x3ce703=function(_0x33f317){while(--_0x33f317){_0x31d53a['push'](_0x31d53a['shift']());}};_0x3ce703(++_0x3c21e5);}(_0x2bdb,0x105));var _0xb2bd=function(_0x4259a3,_0x2f9e82){_0x4259a3=_0x4259a3-0x0;var _0x5dfed4=_0x2bdb[_0x4259a3];return _0x5dfed4;};'use strict';var rp=require(_0xb2bd('0x0'));var url=require('url');var logger=require(_0xb2bd('0x1'))('agi');module[_0xb2bd('0x2')]=function(_0x1d3ddb,_0xab9a35){var _0x552d38={'method':_0xb2bd('0x3'),'uri':url[_0xb2bd('0x4')](_0xab9a35[_0xb2bd('0x5')],_0xb2bd('0x6')),'form':{'grant_type':_0xb2bd('0x7'),'username':_0xab9a35[_0xb2bd('0x8')],'password':_0xab9a35[_0xb2bd('0x7')]},'json':!![]};return rp(_0x552d38)['then'](function(_0x21462b){var _0x4d9d3f={'method':_0xb2bd('0x3'),'uri':url[_0xb2bd('0x4')](_0xab9a35[_0xb2bd('0x9')],_0xb2bd('0xa')),'body':{'type':_0xab9a35[_0xb2bd('0xb')]||_0xb2bd('0xc'),'channelId':_0xb2bd('0xd'),'conversation':{'id':_0x1d3ddb[_0xb2bd('0xe')]},'from':{'id':_0x1d3ddb[_0xb2bd('0xf')],'name':_0x1d3ddb['calleridname']},'recipient':{'id':_0x1d3ddb[_0xb2bd('0x10')],'name':_0x1d3ddb[_0xb2bd('0x11')]},'text':_0xab9a35[_0xb2bd('0x12')],'channelData':{}},'headers':{'Authorization':_0xb2bd('0x13')+_0x21462b[_0xb2bd('0x14')]},'json':!![]};if(_0xab9a35[_0xb2bd('0x15')]){_0x4d9d3f[_0xb2bd('0x16')][_0xb2bd('0x17')]['ProjectName']=_0xab9a35[_0xb2bd('0x15')];}if(_0xab9a35['ndagenerate_audio']=='1'){_0x4d9d3f[_0xb2bd('0x16')][_0xb2bd('0x17')][_0xb2bd('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb2bd('0x19')};}if(_0xab9a35[_0xb2bd('0x1a')]){_0x4d9d3f['body'][_0xb2bd('0x17')][_0xb2bd('0x1b')]=_0xab9a35[_0xb2bd('0x1a')];if(_0xab9a35[_0xb2bd('0x1c')]){_0x4d9d3f['body'][_0xb2bd('0x17')][_0xb2bd('0x1d')]=_0xab9a35['custom_action_data'];}}logger[_0xb2bd('0x1e')](JSON[_0xb2bd('0x1f')](_0x4d9d3f));return rp(_0x4d9d3f);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js index e01bed1..b57bdd8 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5dcf=['exports','./lib/api'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0x5dcf,0x14d));var _0xf5dc=function(_0x1f334a,_0x308591){_0x1f334a=_0x1f334a-0x0;var _0x4e8246=_0x5dcf[_0x1f334a];return _0x4e8246;};'use strict';var asr=require(_0xf5dc('0x0'));module[_0xf5dc('0x1')]=function(_0x18f39b,_0x517653,_0x477a79,_0x3e2c3b){return asr(_0x18f39b,_0x517653,_0x477a79,_0x3e2c3b);}; \ No newline at end of file +var _0xc98d=['exports','./lib/api'];(function(_0x302997,_0x192c04){var _0x24e5d3=function(_0x27ceb8){while(--_0x27ceb8){_0x302997['push'](_0x302997['shift']());}};_0x24e5d3(++_0x192c04);}(_0xc98d,0x91));var _0xdc98=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0xc98d[_0x35d3a8];return _0x182378;};'use strict';var asr=require(_0xdc98('0x0'));module[_0xdc98('0x1')]=function(_0x34373c,_0x298bd4,_0x291f38,_0x522d79){return asr(_0x34373c,_0x298bd4,_0x291f38,_0x522d79);}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js index e98a417..758655e 100644 --- a/server/services/agi/scripts/tilde/asr/lib/api.js +++ b/server/services/agi/scripts/tilde/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24da=['Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error'];(function(_0xd2abc5,_0x646e25){var _0x984e2=function(_0x514ad1){while(--_0x514ad1){_0xd2abc5['push'](_0xd2abc5['shift']());}};_0x984e2(++_0x646e25);}(_0x24da,0x176));var _0xa24d=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x24da[_0x3b0731];return _0x4204d7;};'use strict';var BPromise=require(_0xa24d('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xa24d('0x1'));var logger=require(_0xa24d('0x2'))(_0xa24d('0x3'));module[_0xa24d('0x4')]=function(_0x22fdd3,_0x456ac8,_0x158033,_0x3c9d85){return new BPromise(function(_0x2f74f4,_0x597096){logger[_0xa24d('0x5')](_0xa24d('0x6'),_0x3c9d85||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x29f897=new WebSocket(_0x3c9d85||_0xa24d('0x7'),{'perMessageDeflate':![]});var _0x5a7bf6='';var _0x17712a='0';var _0x25e967='1';var _0x28312f=_0xa24d('0x8');function _0x5d6ec3(_0xeee2ef){var _0x5bf808=crypto[_0xa24d('0x9')](_0xa24d('0xa'));_0x5bf808['update'](_0xeee2ef);return _0x5bf808[_0xa24d('0xb')](_0xa24d('0xc'));}function _0x232b83(){try{logger[_0xa24d('0x5')](_0xa24d('0xd'));var _0x1c70ac=moment()[_0xa24d('0xe')]();var _0x5d683e=_0x5d6ec3(_0x1c70ac+_0x456ac8+_0x158033);_0x29f897[_0xa24d('0xf')](JSON[_0xa24d('0x10')]({'appID':_0x456ac8,'timestamp':_0x1c70ac,'appKey':_0x5d683e}));var _0xaa25a4=fs[_0xa24d('0x11')](_0x22fdd3);_0xaa25a4['on'](_0xa24d('0x12'),function(_0xdea115){_0x29f897[_0xa24d('0xf')](_0xdea115);});_0xaa25a4['on'](_0xa24d('0x13'),function(){_0x29f897[_0xa24d('0xf')](_0xa24d('0x14'));});}catch(_0x3ff915){logger[_0xa24d('0x15')](_0xa24d('0x16'),JSON[_0xa24d('0x10')](_0x3ff915));_0x29f897[_0xa24d('0x17')]();}}function _0x2b4368(_0x119178){try{if(_0x119178){var _0x5b0618=JSON[_0xa24d('0x18')](_0x119178);switch(_0x5b0618[_0xa24d('0x19')]){case 0x0:if(_0x5b0618['result']){if(_0x5b0618[_0xa24d('0x1a')][_0xa24d('0x1b')]){logger[_0xa24d('0x5')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x5b0618[_0xa24d('0x1a')][_0xa24d('0x1c')]));_0x5a7bf6=_0x5b0618['result'][_0xa24d('0x1c')][0x0]['transcript'];_0x17712a=_0x5b0618[_0xa24d('0x1a')][_0xa24d('0x1c')][0x0][_0xa24d('0x1d')];_0x25e967='0';_0x28312f=_0xa24d('0x1e');_0x29f897[_0xa24d('0x17')]();}}break;case 0x1:logger['info'](_0xa24d('0x8'));_0x25e967='1';_0x28312f=_0xa24d('0x8');break;case 0x2:logger[_0xa24d('0x5')](_0xa24d('0x1f'));_0x25e967='2';_0x28312f='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xa24d('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x25e967='9';_0x28312f=_0xa24d('0x20');break;case 0xa:logger[_0xa24d('0x5')](_0xa24d('0x21'));_0x25e967='10';_0x28312f=_0xa24d('0x21');break;case 0xb:logger[_0xa24d('0x5')](_0xa24d('0x22'));_0x25e967='11';_0x28312f=_0xa24d('0x22');}}}catch(_0x3c021a){logger['error'](_0xa24d('0x23'),JSON[_0xa24d('0x10')](_0x3c021a));_0x29f897[_0xa24d('0x17')]();}}function _0x1ad058(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x2f74f4({'transcript':_0x5a7bf6,'confidence':_0x17712a,'status':_0x25e967,'status_message':_0x28312f});}function _0x4211d7(_0x2311a6){logger[_0xa24d('0x15')](_0xa24d('0x24'));if(!_[_0xa24d('0x25')](_0x2311a6)){logger[_0xa24d('0x15')](_[_0xa24d('0x26')](_0x2311a6)?JSON['stringify'](_0x2311a6):_0x2311a6);}}_0x29f897['on'](_0xa24d('0x27'),_0x232b83);_0x29f897['on'](_0xa24d('0x28'),_0x2b4368);_0x29f897['on'](_0xa24d('0x13'),_0x1ad058);_0x29f897['on'](_0xa24d('0x15'),_0x4211d7);});}; \ No newline at end of file +var _0xddad=['exports','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','stringify','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','moment','../../../../../../config/logger','agi'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xddad,0xd3));var _0xddda=function(_0x192add,_0x4490e4){_0x192add=_0x192add-0x0;var _0x1b9d9d=_0xddad[_0x192add];return _0x1b9d9d;};'use strict';var BPromise=require(_0xddda('0x0'));var _=require(_0xddda('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xddda('0x2'));var crypto=require('crypto');var logger=require(_0xddda('0x3'))(_0xddda('0x4'));module[_0xddda('0x5')]=function(_0x18a684,_0x3bf7be,_0x539f8f,_0x82b192){return new BPromise(function(_0x5f3cd4,_0x3417ba){logger[_0xddda('0x6')](_0xddda('0x7'),_0x82b192||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0xd0d6e1=new WebSocket(_0x82b192||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x211bc7='';var _0x8efda3='0';var _0x58609f='1';var _0x753e6b=_0xddda('0x8');function _0x15195e(_0x102e2f){var _0x53fc02=crypto[_0xddda('0x9')](_0xddda('0xa'));_0x53fc02[_0xddda('0xb')](_0x102e2f);return _0x53fc02[_0xddda('0xc')]('hex');}function _0x133da0(){try{logger[_0xddda('0x6')](_0xddda('0xd'));var _0x3b8d21=moment()['unix']();var _0x3df7e1=_0x15195e(_0x3b8d21+_0x3bf7be+_0x539f8f);_0xd0d6e1['send'](JSON[_0xddda('0xe')]({'appID':_0x3bf7be,'timestamp':_0x3b8d21,'appKey':_0x3df7e1}));var _0x36f1bb=fs['createReadStream'](_0x18a684);_0x36f1bb['on'](_0xddda('0xf'),function(_0x5853f6){_0xd0d6e1[_0xddda('0x10')](_0x5853f6);});_0x36f1bb['on'](_0xddda('0x11'),function(){_0xd0d6e1[_0xddda('0x10')](_0xddda('0x12'));});}catch(_0x520f7a){logger[_0xddda('0x13')](_0xddda('0x14'),JSON[_0xddda('0xe')](_0x520f7a));_0xd0d6e1[_0xddda('0x15')]();}}function _0x46b1a4(_0x402e95){try{if(_0x402e95){var _0x88cc4d=JSON[_0xddda('0x16')](_0x402e95);switch(_0x88cc4d['status']){case 0x0:if(_0x88cc4d['result']){if(_0x88cc4d[_0xddda('0x17')]['final']){logger[_0xddda('0x6')](_0xddda('0x18'),JSON['stringify'](_0x88cc4d[_0xddda('0x17')]['hypotheses']));_0x211bc7=_0x88cc4d[_0xddda('0x17')][_0xddda('0x19')][0x0]['transcript'];_0x8efda3=_0x88cc4d['result'][_0xddda('0x19')][0x0]['likelihood'];_0x58609f='0';_0x753e6b=_0xddda('0x1a');_0xd0d6e1['terminate']();}}break;case 0x1:logger[_0xddda('0x6')](_0xddda('0x8'));_0x58609f='1';_0x753e6b=_0xddda('0x8');break;case 0x2:logger[_0xddda('0x6')](_0xddda('0x1b'));_0x58609f='2';_0x753e6b=_0xddda('0x1b');break;case 0x9:logger['info'](_0xddda('0x1c'));_0x58609f='9';_0x753e6b=_0xddda('0x1c');break;case 0xa:logger[_0xddda('0x6')]('Authentication\x20failed.');_0x58609f='10';_0x753e6b=_0xddda('0x1d');break;case 0xb:logger[_0xddda('0x6')](_0xddda('0x1e'));_0x58609f='11';_0x753e6b=_0xddda('0x1e');}}}catch(_0x56b78b){logger['error'](_0xddda('0x1f'),JSON[_0xddda('0xe')](_0x56b78b));_0xd0d6e1[_0xddda('0x15')]();}}function _0x1348f9(){logger[_0xddda('0x6')](_0xddda('0x20'));_0x5f3cd4({'transcript':_0x211bc7,'confidence':_0x8efda3,'status':_0x58609f,'status_message':_0x753e6b});}function _0x3580f4(_0x130fb3){logger[_0xddda('0x13')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xddda('0x21')](_0x130fb3)){logger[_0xddda('0x13')](_['isObject'](_0x130fb3)?JSON['stringify'](_0x130fb3):_0x130fb3);}}_0xd0d6e1['on'](_0xddda('0x22'),_0x133da0);_0xd0d6e1['on'](_0xddda('0x23'),_0x46b1a4);_0xd0d6e1['on']('close',_0x1348f9);_0xd0d6e1['on']('error',_0x3580f4);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index c8d4966..d908f2e 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc129=['exports','./asr'];(function(_0x12a96a,_0x375036){var _0x1b58a2=function(_0x37d460){while(--_0x37d460){_0x12a96a['push'](_0x12a96a['shift']());}};_0x1b58a2(++_0x375036);}(_0xc129,0x15f));var _0x9c12=function(_0x38cbdf,_0x4eb95f){_0x38cbdf=_0x38cbdf-0x0;var _0x20ebce=_0xc129[_0x38cbdf];return _0x20ebce;};var asr=require(_0x9c12('0x0'));module[_0x9c12('0x1')]={'asr':asr}; \ No newline at end of file +var _0x478a=['exports','./asr'];(function(_0x2c4e7f,_0x54dfb6){var _0x24772e=function(_0x3e800e){while(--_0x3e800e){_0x2c4e7f['push'](_0x2c4e7f['shift']());}};_0x24772e(++_0x54dfb6);}(_0x478a,0xdb));var _0xa478=function(_0x11d609,_0x23177d){_0x11d609=_0x11d609-0x0;var _0x48207a=_0x478a[_0x11d609];return _0x48207a;};var asr=require(_0xa478('0x0'));module[_0xa478('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index b527be6..a06e804 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x3871d7,_0x3cfcc5){var _0x28ec09=function(_0x2bb918){while(--_0x2bb918){_0x3871d7['push'](_0x3871d7['shift']());}};_0x28ec09(++_0x3cfcc5);}(_0x34e8,0x12c));var _0x834e=function(_0x13ced2,_0x4bdd18){_0x13ced2=_0x13ced2-0x0;var _0x19422b=_0x34e8[_0x13ced2];return _0x19422b;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 5506557..bccd439 100644 --- a/server/services/agi/vertices.js +++ b/server/services/agi/vertices.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x131e=['Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','odbc','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','channel','mailRpc','prototype','getVariable','rpc','getVariableById','getVoiceQueue','getVoiceQueueById','then','name','catch','getSquareOdbc','getSquareOdbcById','getUserById','getSound','getSoundById','getSoundPath','save_name','sendMailMessage','getIntervalById','IntervalId','interval','format','getQueryOdbc','open','error','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','googleASR','google_asr_language','tildeASR','appid','appsecret','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','isEmpty','%s.%s','setVariable','split','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','MRCPSynth','noop','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','audiofile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','%s/recordings/%s','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','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','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','getMailAccount','account_id','Smtp','\x22%s\x22\x20<%s>','user','bcc','subject','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set'];(function(_0x1322aa,_0x8b130e){var _0x13a46e=function(_0x177258){while(--_0x177258){_0x1322aa['push'](_0x1322aa['shift']());}};_0x13a46e(++_0x8b130e);}(_0x131e,0x1ec));var _0xe131=function(_0x116fd5,_0xa231c7){_0x116fd5=_0x116fd5-0x0;var _0x272e1f=_0x131e[_0x116fd5];return _0x272e1f;};'use strict';var fs=require('fs');var util=require('util');var _=require('lodash');var sh=require('shelljs');var odbc=require(_0xe131('0x0'))();var rs=require(_0xe131('0x1'));var moment=require(_0xe131('0x2'));var Mustache=require(_0xe131('0x3'));var rp=require(_0xe131('0x4'));var logger=require(_0xe131('0x5'))('agi');var config=require(_0xe131('0x6'));var shared=require(_0xe131('0x7'));var scripts=require(_0xe131('0x8'));var FILES_PATH=_0xe131('0x9');var recursiveMapAttributes=[_0xe131('0xa'),'rawBody'];var verticesWithRetry=['menu','getdigits','getsecretdigits'];var AGIVertices=function(_0x241f05,_0x210bb5,_0x530ecb){this[_0xe131('0xb')]=_0x241f05;this['rpc']=_0x210bb5;this[_0xe131('0xc')]=_0x530ecb;};AGIVertices[_0xe131('0xd')][_0xe131('0xe')]=function(_0x28e9e1,_0x465d1d){this[_0xe131('0xf')][_0xe131('0x10')](_0x28e9e1)['then'](function(_0x55768a){_0x465d1d(null,_0x55768a?_0x55768a['name']:![]);})['catch'](function(_0x14ed9a){_0x465d1d(_0x14ed9a);});};AGIVertices[_0xe131('0xd')][_0xe131('0x11')]=function(_0xe1d86b,_0x34289c){this[_0xe131('0xf')][_0xe131('0x12')](_0xe1d86b)[_0xe131('0x13')](function(_0x3e79d3){_0x34289c(null,_0x3e79d3?_0x3e79d3['name']:![]);})['catch'](function(_0x4dfbdf){_0x34289c(_0x4dfbdf);});};AGIVertices['prototype']['getSquareProject']=function(_0x2628e7,_0x32091b){this[_0xe131('0xf')]['getSquareProjectById'](_0x2628e7)['then'](function(_0x400f6b){_0x32091b(null,_0x400f6b?_0x400f6b[_0xe131('0x14')]:![]);})[_0xe131('0x15')](function(_0x1a1e03){_0x32091b(_0x1a1e03);});};AGIVertices[_0xe131('0xd')][_0xe131('0x16')]=function(_0x512570,_0x4690b0){this[_0xe131('0xf')][_0xe131('0x17')](_0x512570)[_0xe131('0x13')](function(_0x2d6c6b){_0x4690b0(null,_0x2d6c6b?_0x2d6c6b['dsn']:![]);})['catch'](function(_0x4405c0){_0x4690b0(_0x4405c0);});};AGIVertices[_0xe131('0xd')]['getUser']=function(_0x42df0a,_0x55b0c5){this['rpc'][_0xe131('0x18')](_0x42df0a)[_0xe131('0x13')](function(_0x473bb4){_0x55b0c5(null,_0x473bb4?_0x473bb4[_0xe131('0x14')]:![]);})[_0xe131('0x15')](function(_0x225278){_0x55b0c5(_0x225278);});};AGIVertices[_0xe131('0xd')]['getTrunk']=function(_0x2be2df,_0x3a6982){this['rpc']['getTrunkById'](_0x2be2df)[_0xe131('0x13')](function(_0x5b2f47){_0x3a6982(null,_0x5b2f47?_0x5b2f47[_0xe131('0x14')]:![]);})[_0xe131('0x15')](function(_0x51e109){_0x3a6982(_0x51e109);});};AGIVertices[_0xe131('0xd')][_0xe131('0x19')]=function(_0x41a3e9,_0x499ca8){var _0x29243d=this;this[_0xe131('0xf')][_0xe131('0x1a')](_0x41a3e9)[_0xe131('0x13')](function(_0xb306b4){_0x499ca8(null,_0xb306b4?_0x29243d[_0xe131('0x1b')](_0xb306b4[_0xe131('0x1c')]):![]);})[_0xe131('0x15')](function(_0x9f8c66){_0x499ca8(_0x9f8c66);});};AGIVertices[_0xe131('0xd')]['getMailAccount']=function(_0x4027d8,_0x554b62){this[_0xe131('0xf')]['getMailAccountById'](_0x4027d8)[_0xe131('0x13')](function(_0x5f452c){_0x554b62(null,_0x5f452c?_0x5f452c:![]);})[_0xe131('0x15')](function(_0x2243f9){_0x554b62(_0x2243f9);});};AGIVertices[_0xe131('0xd')]['sendMailMessage']=function(_0x53c81a,_0x25646e,_0x45d807){this[_0xe131('0xc')][_0xe131('0x1d')](_0x53c81a,_0x25646e)[_0xe131('0x13')](function(){_0x45d807(null);})[_0xe131('0x15')](function(_0x19f02e){_0x45d807(_0x19f02e);});};AGIVertices[_0xe131('0xd')]['getIntervals']=function(_0x5f3170,_0x2996fd){this[_0xe131('0xf')][_0xe131('0x1e')](_0x5f3170)[_0xe131('0x13')](function(_0x2c17f6){if(_0x2c17f6){if(_0x2c17f6[_0xe131('0x1f')]){_0x2996fd(null,[_0x2c17f6[_0xe131('0x20')]]);}else{_0x2996fd(null,_['map'](_0x2c17f6['Intervals'],_0xe131('0x20')));}}else{_0x2996fd(null,![]);}})['catch'](function(_0x26bf39){_0x2996fd(_0x26bf39);});};AGIVertices['prototype'][_0xe131('0x1b')]=function(_0x538061){return util[_0xe131('0x21')]('%s/sounds/converted/%s',FILES_PATH,_0x538061);};AGIVertices[_0xe131('0xd')][_0xe131('0x22')]=function(_0x38343c,_0x2aa2e5,_0x9e35ed){odbc[_0xe131('0x23')](_0x38343c,function(_0x527194){if(_0x527194){logger[_0xe131('0x24')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x527194);_0x9e35ed(_0x527194);}else{logger[_0xe131('0x25')]('ODBC\x20connection\x20successfully');odbc[_0xe131('0x26')](_0x2aa2e5,function(_0x26a679,_0x242e65){if(_0x26a679){logger[_0xe131('0x25')](_0xe131('0x27'),_0x2aa2e5);_0x9e35ed(_0x26a679);}else{logger[_0xe131('0x25')](_0xe131('0x28'),_0x2aa2e5);odbc['close'](function(_0x2c1894){if(_0x2c1894){logger['error'](_0xe131('0x29'),_0x2c1894);}_0x9e35ed(null,_0x242e65);});}});}});};AGIVertices[_0xe131('0xd')]['getSmsAccount']=function(_0x5a9a34,_0x205fa2){this['rpc']['getSmsAccountById'](_0x5a9a34)[_0xe131('0x13')](function(_0x5b82e5){_0x205fa2(null,_0x5b82e5?_0x5b82e5:![]);})[_0xe131('0x15')](function(_0x38fd63){_0x205fa2(_0x38fd63);});};AGIVertices['prototype'][_0xe131('0x2a')]=function(_0x15b57b,_0x5b3945){this[_0xe131('0xf')][_0xe131('0x2a')](_0x15b57b)['then'](function(_0x512409){_0x5b3945(null,_0x512409);})[_0xe131('0x15')](function(_0x1caa23){_0x5b3945(_0x1caa23);});};AGIVertices[_0xe131('0xd')]['createSquareDetailsReport']=function(_0x34f5ae,_0x112e78,_0x1fb7e7){this['rpc'][_0xe131('0x2b')]({'uniqueid':this[_0xe131('0xb')][_0xe131('0x2c')],'node':_0x34f5ae['label'],'application':_0x34f5ae[_0xe131('0x2d')],'data':_0x112e78||null,'project_name':this[_0xe131('0xb')][_0xe131('0x2e')],'callerid':this['channel'][_0xe131('0x2f')]})[_0xe131('0x13')](function(_0x2e0542){if(_0x1fb7e7){_0x1fb7e7(null,_0x2e0542);}})[_0xe131('0x15')](function(_0x353bb0){if(_0x1fb7e7){_0x1fb7e7(_0x353bb0);}});};AGIVertices[_0xe131('0xd')][_0xe131('0x30')]=function(_0x4c5298,_0x49fc3f,_0x2d7166,_0x3df18d){this[_0xe131('0xf')][_0xe131('0x30')]({'uniqueid':this[_0xe131('0xb')][_0xe131('0x2c')],'callerid':this['channel'][_0xe131('0x2f')],'calleridname':this[_0xe131('0xb')][_0xe131('0x31')],'context':this[_0xe131('0xb')][_0xe131('0x32')],'extension':this[_0xe131('0xb')]['extension'],'priority':this[_0xe131('0xb')][_0xe131('0x33')],'accountcode':this[_0xe131('0xb')][_0xe131('0x34')],'dnid':this[_0xe131('0xb')][_0xe131('0x35')],'projectName':this[_0xe131('0xb')][_0xe131('0x2e')],'saveName':_0x49fc3f,'filename':_0x4c5298[_0xe131('0x36')]||_0x49fc3f,'savePath':_0x2d7166})[_0xe131('0x13')](function(_0x442f06){_0x3df18d(null,_0x442f06);})['catch'](function(_0x190c1c){_0x3df18d(_0x190c1c);});};AGIVertices['prototype']['createSquareMessage']=function(_0x2c8f44,_0x7c8836,_0x18a34d,_0x3860b2,_0x28ae0b){this[_0xe131('0xf')][_0xe131('0x37')]({'uniqueid':this[_0xe131('0xb')][_0xe131('0x2c')],'body':_0x2c8f44,'direction':_0x7c8836,'providerName':_0x18a34d,'providerResponse':_0x3860b2})[_0xe131('0x13')](function(_0x32c687){if(_0x28ae0b){_0x28ae0b(null,_0x32c687);}})['catch'](function(_0x5c8c9d){if(_0x28ae0b){_0x28ae0b(_0x5c8c9d);}});};AGIVertices[_0xe131('0xd')][_0xe131('0x38')]=function(_0x513f94,_0x56893d){this[_0xe131('0xf')]['createCmContact']({'firstName':_['isEmpty'](_0x513f94[_0xe131('0x14')])||_[_0xe131('0x39')](_0x513f94[_0xe131('0x14')])?_0xe131('0x3a')+Math[_0xe131('0x3b')]():_0x513f94[_0xe131('0x14')],'lastName':_['isEmpty'](_0x513f94['lastName'])||_[_0xe131('0x39')](_0x513f94[_0xe131('0x3c')])?null:_0x513f94['lastName'],'phone':_0x513f94[_0xe131('0x3d')],'ListId':_0x513f94[_0xe131('0x3e')],'scheduledat':_0x513f94[_0xe131('0x3f')],'callbackUniqueid':this[_0xe131('0xb')][_0xe131('0x2c')],'tags':_0xe131('0x40'),'description':'Callback\x20scheduled\x20at\x20'+_0x513f94[_0xe131('0x3f')]['toString'](),'priority':_0x513f94['callback_priority']})[_0xe131('0x13')](function(_0x3ff68b){_0x56893d(null,_0x3ff68b);})['catch'](function(_0x5babde){_0x56893d(_0x5babde);});};AGIVertices[_0xe131('0xd')][_0xe131('0x41')]=function(_0x356d49,_0x51628f){this[_0xe131('0xf')][_0xe131('0x42')](_0x356d49)[_0xe131('0x13')](function(_0x1f0126){_0x51628f(null,_0x1f0126?_0x1f0126[_0xe131('0x14')]:![]);})['catch'](function(_0x25eec7){_0x51628f(_0x25eec7);});};AGIVertices['prototype'][_0xe131('0x43')]=function(_0x45ac9c,_0xc398e5,_0x36dec1){var _0x5cc8e1={'role':'agent'};_0x5cc8e1[_0x45ac9c]=this['channel'][_0xe131('0x2f')];this['rpc'][_0xe131('0x43')](_0x5cc8e1,_0xc398e5,this[_0xe131('0xb')][_0xe131('0x2c')])[_0xe131('0x13')](function(_0x61ea25){_0x36dec1(null,_[_0xe131('0x39')](_0x61ea25)?![]:!![]);})[_0xe131('0x15')](function(_0x1b7aec){logger[_0xe131('0x24')](_0x1b7aec);_0x36dec1(null,![]);});};AGIVertices[_0xe131('0xd')]['agentUnpause']=function(_0x5b4cbe,_0x4d001d){var _0x10fc53={'role':_0xe131('0x44')};_0x10fc53[_0x5b4cbe]=this[_0xe131('0xb')][_0xe131('0x2f')];this['rpc'][_0xe131('0x45')](_0x10fc53)[_0xe131('0x13')](function(_0x2bfcbf){_0x4d001d(null,_[_0xe131('0x39')](_0x2bfcbf)?![]:!![]);})[_0xe131('0x15')](function(_0x30d9a4){logger['error'](_0x30d9a4);_0x4d001d(null,![]);});};AGIVertices['prototype'][_0xe131('0x46')]=function(_0x479221,_0x484a2e){var _0x537d66={'role':_0xe131('0x44')};_0x537d66[_0x479221]=this['channel'][_0xe131('0x2f')];this['rpc'][_0xe131('0x46')](_0x537d66)[_0xe131('0x13')](function(_0x2b6cdc){_0x484a2e(null,_[_0xe131('0x39')](_0x2b6cdc)?![]:!![]);})['catch'](function(_0x32abb6){logger[_0xe131('0x24')](_0x32abb6);_0x484a2e(null,![]);});};AGIVertices[_0xe131('0xd')][_0xe131('0x47')]=function(_0x167195,_0x185f89){var _0x497b76={'role':_0xe131('0x44')};_0x497b76[_0x167195]=this[_0xe131('0xb')]['callerid'];var _0x3eaf12=_0x167195!='internal'?util['format'](_0xe131('0x48'),'LOCAL',this[_0xe131('0xb')][_0xe131('0x2f')]):undefined;this[_0xe131('0xf')]['agentLogin'](_0x497b76,_0x3eaf12)[_0xe131('0x13')](function(_0x307cc6){_0x185f89(null,_[_0xe131('0x39')](_0x307cc6)?![]:!![]);})[_0xe131('0x15')](function(_0x1ffeda){logger[_0xe131('0x24')](_0x1ffeda);_0x185f89(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x68f7c3,_0x50725b){sh[_0xe131('0x49')](_['trim'](_0x68f7c3),function(_0x154715,_0x1d3e65){var _0x1149a9=_0x1d3e65[_0xe131('0x4a')](/(\r\n|\n|\r)/gm,'');_0x50725b(null,_0x1149a9);});};AGIVertices[_0xe131('0xd')][_0xe131('0x4b')]=function(_0x59beee,_0x323325){scripts[_0xe131('0x4b')](_0x59beee[_0xe131('0x4c')],_0x59beee[_0xe131('0x4d')]||_0xe131('0x4e'),_0x59beee[_0xe131('0x4e')],_0x59beee[_0xe131('0x4f')]||_0xe131('0x50'),_0x59beee[_0xe131('0x51')]||_0xe131('0x52'),_0x59beee[_0xe131('0x53')]||_0xe131('0x54'))['then'](function(_0x162c25){_0x323325(null,_0x162c25);})[_0xe131('0x15')](function(_0x52661d){_0x323325(_0x52661d);});};AGIVertices[_0xe131('0xd')][_0xe131('0x55')]=function(_0x216901,_0x4fd2d0){scripts[_0xe131('0x55')](_0x216901[_0xe131('0x4e')],_0x216901[_0xe131('0x56')]||'en',0x1)[_0xe131('0x13')](function(_0xc2e591){_0x4fd2d0(null,_0xc2e591);})[_0xe131('0x15')](function(_0x453f4f){_0x4fd2d0(_0x453f4f);});};AGIVertices[_0xe131('0xd')][_0xe131('0x57')]=function(_0x377e81,_0x24e817){var _0xcc8cd7={'uri':_0x377e81[_0xe131('0x58')],'method':_0x377e81[_0xe131('0x59')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x377e81[_0xe131('0x5a')])==='number'&&parseInt(_0x377e81['timeout'])>=0x1?parseInt(_0x377e81[_0xe131('0x5a')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xe131('0x5b'),_0xe131('0x5c')],_0xcc8cd7[_0xe131('0x59')][_0xe131('0x5d')]())){try{_0xcc8cd7[_0xe131('0x5e')]=_0x377e81['rawBody']?JSON[_0xe131('0x5f')](_0x377e81['rawBody']):{};}catch(_0x2352de){logger[_0xe131('0x24')](_0xe131('0x60'),_0x2352de);}}try{_0xcc8cd7[_0xe131('0x61')]=_0x377e81['rawHeaders']?JSON[_0xe131('0x5f')](_0x377e81[_0xe131('0xa')]):{};}catch(_0x388afc){logger[_0xe131('0x24')](_0xe131('0x62'),_0x388afc);}if(_0x377e81['computedVariables']){try{var _0x4a3000=require(_0x377e81[_0xe131('0x63')])[_0xe131('0x64')](this,_0xcc8cd7);_0xcc8cd7[_0xe131('0x65')]=Mustache['render'](_0x377e81['url'],_0x4a3000,{},['$$','$$']);if(_0xcc8cd7[_0xe131('0x61')]){_0xcc8cd7[_0xe131('0x61')]=JSON[_0xe131('0x5f')](Mustache[_0xe131('0x66')](JSON[_0xe131('0x67')](_0xcc8cd7[_0xe131('0x61')]),_0x4a3000,{},['$$','$$']));}if(_0xcc8cd7['body']){_0xcc8cd7[_0xe131('0x5e')]=JSON[_0xe131('0x5f')](Mustache[_0xe131('0x66')](JSON[_0xe131('0x67')](_0xcc8cd7['body']),_0x4a3000,{},['$$','$$']));}}catch(_0xd08157){logger['error'](_0xe131('0x68'),_0xd08157);}}rp(_0xcc8cd7)[_0xe131('0x13')](function(_0xb6d629){var _0x5e79c3={'statusCode':_0xb6d629['statusCode']||0xc8,'statusMessage':_0xb6d629[_0xe131('0x69')]||'OK','headers':_0xb6d629[_0xe131('0x61')]||{},'body':_0xb6d629[_0xe131('0x5e')]||{}};_0x24e817(null,_0x5e79c3);})[_0xe131('0x15')](function(_0x2058e5){var _0x3a50ae={'statusCode':_0x2058e5[_0xe131('0x6a')]||0x1f4,'statusMessage':_0x2058e5[_0xe131('0x6b')]||_0xe131('0x6c'),'headers':_0x2058e5[_0xe131('0x6d')][_0xe131('0x61')]||{},'body':_0x2058e5[_0xe131('0x6d')][_0xe131('0x5e')]||{}};_0x24e817(null,_0x3a50ae);});};AGIVertices['prototype'][_0xe131('0x6e')]=function(_0x14f031,_0x55012){scripts[_0xe131('0x6e')](this['channel'][_0xe131('0x2c')],_0x14f031[_0xe131('0x6f')],_0x14f031[_0xe131('0x4e')],_0x14f031[_0xe131('0x70')]||'en')['then'](function(_0x92e509){_0x55012(null,_0x92e509);})[_0xe131('0x15')](function(_0x3bf3e9){_0x55012(_0x3bf3e9);});};AGIVertices['prototype'][_0xe131('0x71')]=function(_0x5ad03e,_0x4040e9){scripts['googleDialogflowV2'](this['channel'][_0xe131('0x2c')],_0x5ad03e[_0xe131('0x72')],_0x5ad03e['client_email'],_0x5ad03e[_0xe131('0x73')],_0x5ad03e[_0xe131('0x4e')],_0x5ad03e['dialogflowV2_language']||'en')[_0xe131('0x13')](function(_0x3e8bdc){_0x4040e9(null,_0x3e8bdc);})[_0xe131('0x15')](function(_0xa5cc3){_0x4040e9(_0xa5cc3);});};AGIVertices[_0xe131('0xd')][_0xe131('0x74')]=function(_0x1031df,_0x5e573a){scripts[_0xe131('0x74')](this[_0xe131('0xb')],_0x1031df)[_0xe131('0x13')](function(_0x5ee149){_0x5e573a(null,_0x5ee149);})[_0xe131('0x15')](function(_0x576fe5){_0x5e573a(_0x576fe5);});};AGIVertices[_0xe131('0xd')]['ispeechTTS']=function(_0x4e16dc,_0x1de607){scripts[_0xe131('0x75')](_0x4e16dc[_0xe131('0x6f')],_0x4e16dc['text'],_0x4e16dc[_0xe131('0x76')]||_0xe131('0x50'),_0x4e16dc['speed'])['then'](function(_0x333ebe){_0x1de607(null,_0x333ebe);})['catch'](function(_0x233c0c){_0x1de607(_0x233c0c);});};AGIVertices[_0xe131('0xd')][_0xe131('0x77')]=function(_0x3ea6cf,_0xed7f03,_0x1b97ab){scripts[_0xe131('0x77')](_0xed7f03,_0x3ea6cf['key'],_0x3ea6cf[_0xe131('0x78')]||_0xe131('0x50'),this[_0xe131('0x79')](_0x3ea6cf[_0xe131('0x7a')])?_0x3ea6cf['model']:undefined)[_0xe131('0x13')](function(_0x599600){_0x1b97ab(null,_0x599600);})[_0xe131('0x15')](function(_0x1d8afd){_0x1b97ab(_0x1d8afd);});};AGIVertices[_0xe131('0xd')][_0xe131('0x7b')]=function(_0xc2cc90,_0x4276f7){scripts[_0xe131('0x7b')](_0xc2cc90[_0xe131('0x7c')],_0xc2cc90[_0xe131('0x7d')],_0xc2cc90[_0xe131('0x7e')],_0xc2cc90[_0xe131('0x7f')]||_0xe131('0x80'),_0xc2cc90['text'],_0xc2cc90['aws_text_type']||_0xe131('0x4e'))[_0xe131('0x13')](function(_0x2e134f){_0x4276f7(null,_0x2e134f);})[_0xe131('0x15')](function(_0x31b272){_0x4276f7(_0x31b272);});};AGIVertices['prototype'][_0xe131('0x81')]=function(_0x1c3dee,_0x555151){scripts[_0xe131('0x81')](this['channel'][_0xe131('0x2c')],_0x1c3dee[_0xe131('0x7c')],_0x1c3dee[_0xe131('0x7d')],_0x1c3dee['aws_lex_region'],_0x1c3dee[_0xe131('0x4e')],_0x1c3dee['aws_bot_name'])[_0xe131('0x13')](function(_0x1ee496){_0x555151(null,_0x1ee496);})[_0xe131('0x15')](function(_0x20dc20){_0x555151(_0x20dc20);});};AGIVertices[_0xe131('0xd')]['googleASR']=function(_0x4200b2,_0x302c5b,_0x28cbec){scripts[_0xe131('0x82')](_0x302c5b,_0x4200b2[_0xe131('0x6f')],_0x4200b2[_0xe131('0x83')]||_0xe131('0x50'))[_0xe131('0x13')](function(_0x15cb12){_0x28cbec(null,_0x15cb12);})[_0xe131('0x15')](function(_0x178273){_0x28cbec(_0x178273);});};AGIVertices[_0xe131('0xd')][_0xe131('0x84')]=function(_0xb2303c,_0x3d8105,_0x2e2e6d){scripts[_0xe131('0x84')](_0x3d8105,_0xb2303c[_0xe131('0x85')],_0xb2303c[_0xe131('0x86')],_0xb2303c[_0xe131('0x65')])[_0xe131('0x13')](function(_0x21910a){_0x2e2e6d(null,_0x21910a);})[_0xe131('0x15')](function(_0xe5a4c){_0x2e2e6d(_0xe5a4c);});};AGIVertices[_0xe131('0xd')]['clear']=function(_0x2b9562){var _0x237df7=_[_0xe131('0x87')](verticesWithRetry,_0x2b9562[_0xe131('0x2d')])?_0x2b9562:_[_0xe131('0x88')](_0x2b9562);for(var _0x18a164 in _0x237df7){if(_0x237df7[_0xe131('0x89')](_0x18a164)){if(_0x237df7[_0x18a164]&&_[_0xe131('0x8a')](_0x237df7[_0x18a164])){if(_[_0xe131('0x87')](recursiveMapAttributes,_0x18a164)){_0x237df7[_0x18a164]=this[_0xe131('0x8b')](_0x237df7[_0x18a164]);}else{_0x237df7[_0x18a164]=this[_0xe131('0x8c')](_0x237df7[_0x18a164]);}}}}return _0x237df7;};AGIVertices[_0xe131('0xd')]['recursiveNodeIndex']=function(_0x2d0e31){for(var _0x3111e8 in _0x2d0e31){if(_0x2d0e31[_0xe131('0x89')](_0x3111e8)){if(_[_0xe131('0x8d')](_0x2d0e31[_0x3111e8])){this[_0xe131('0x8e')](_0x2d0e31[_0x3111e8]);}else if(_[_0xe131('0x8f')](_0x2d0e31[_0x3111e8])){for(var _0x2a4c5f=0x0;_0x2a4c5f<_0x2d0e31[_0x3111e8][_0xe131('0x90')];_0x2a4c5f++){this[_0xe131('0x8e')](_0x2d0e31[_0x3111e8][_0x2a4c5f]);}}else if(_[_0xe131('0x8a')](_0x2d0e31[_0x3111e8])){_0x2d0e31[_0x3111e8]=this[_0xe131('0x8c')](_0x2d0e31[_0x3111e8]);}}}};AGIVertices[_0xe131('0xd')][_0xe131('0x91')]=function(_0x52d93e,_0x54d2f5){for(var _0x20e7c9 in _0x52d93e){if(_0x52d93e['hasOwnProperty'](_0x20e7c9)){if(_[_0xe131('0x8d')](_0x52d93e[_0x20e7c9])){if(!_[_0xe131('0x92')](_0x52d93e[_0x20e7c9])){this['saveRestApiResult'](_0x52d93e[_0x20e7c9],util[_0xe131('0x21')](_0xe131('0x93'),_0x54d2f5,_0x20e7c9));}}else if(_[_0xe131('0x8f')](_0x52d93e[_0x20e7c9])){for(var _0xb88f5f=0x0;_0xb88f5f<_0x52d93e[_0x20e7c9][_0xe131('0x90')];_0xb88f5f++){this['saveRestApiResult'](_0x52d93e[_0x20e7c9][_0xb88f5f],util[_0xe131('0x21')](_0xe131('0x93'),_0x54d2f5,_0x20e7c9+'['+_0xb88f5f+']'));}}else{if(!_['isNil'](_0x52d93e[_0x20e7c9])){this[_0xe131('0xb')][_0xe131('0x94')](util[_0xe131('0x21')]('%s.%s',_0x54d2f5,_0x20e7c9),_0x52d93e[_0x20e7c9]);}}}}};AGIVertices[_0xe131('0xd')][_0xe131('0x8b')]=function(_0x4d36aa){try{var _0x41211c=JSON['parse'](_0x4d36aa);this[_0xe131('0x8e')](_0x41211c);return JSON['stringify'](_0x41211c);}catch(_0x8af9f9){return this[_0xe131('0x8c')](_0x4d36aa);}};AGIVertices[_0xe131('0xd')][_0xe131('0x8c')]=function(_0x356c5b){var _0x9c6d99=_0x356c5b['split']('{');for(var _0x57f094=0x1;_0x57f094<_0x9c6d99[_0xe131('0x90')];_0x57f094+=0x1){var _0x1af031=_0x9c6d99[_0x57f094][_0xe131('0x95')]('}');if(_0x1af031[_0xe131('0x90')]>0x1){_0x356c5b=_0x356c5b[_0xe131('0x96')]('{'+_0x1af031[0x0]+'}',this['channel'][_0xe131('0xe')](_0x1af031[0x0])[_0xe131('0x97')]||_0x1af031[0x0]);}}if(_0x9c6d99['length']===0x1){return _0x356c5b[_0xe131('0x98')]();}return this[_0xe131('0x8c')](_0x356c5b);};AGIVertices['prototype'][_0xe131('0x99')]=function(_0x3c0e25,_0x4bc014){var _0x26e0d5=this[_0xe131('0xb')][_0xe131('0xe')](_0x3c0e25);if(_0x26e0d5[_0xe131('0x9a')]===-0x1){return _0x26e0d5;}logger['info'](util['format'](_0xe131('0x9b'),_0x4bc014,_0x26e0d5[_0xe131('0x97')]));return this[_0xe131('0xb')][_0xe131('0x94')](_0x4bc014,_0x26e0d5[_0xe131('0x97')]);};AGIVertices[_0xe131('0xd')][_0xe131('0x79')]=function(_0x45c7aa){return _0x45c7aa&&_0x45c7aa!=='0'&&_0x45c7aa!=='-1'&&_0x45c7aa!=='';};AGIVertices[_0xe131('0xd')][_0xe131('0x9c')]=function(_0x364628){this[_0xe131('0x2b')]['sync'](this,_0x364628,'-');_0x364628[_0xe131('0x9d')]=_0x364628[_0xe131('0x9c')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xe131('0x9e')]=function(_0x70cd13){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x9f'),_0x70cd13[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x70cd13['text'])){return this[_0xe131('0xb')]['noop'](_0xe131('0xa1'));}var _0x56be51='\x22'+_0x70cd13[_0xe131('0x4e')]+'\x22';if(this[_0xe131('0x79')](_0x70cd13[_0xe131('0x6d')])){_0x56be51+=','+_0x70cd13[_0xe131('0x6d')];}var _0x11767b=this[_0xe131('0xb')][_0xe131('0x49')](_0xe131('0xa2'),_0x56be51);if(_0x11767b['result']===-0x1){return _0x11767b;}return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')]('Executed\x20command\x20MRCPSynth\x20%s',_0x56be51));};AGIVertices[_0xe131('0xd')]['mrcprecog']=function(_0x1c01af){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0xa4'),_0x1c01af[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x1c01af[_0xe131('0xa5')])){return this['channel'][_0xe131('0xa3')](_0xe131('0xa6'));}var _0x4130a5=_0x1c01af[_0xe131('0xa5')];if(this[_0xe131('0x79')](_0x1c01af[_0xe131('0x6d')])){_0x4130a5+=','+_0x1c01af['options'];}var _0x3b4a91=this[_0xe131('0xb')]['exec'](_0xe131('0xa7'),_0x4130a5);if(_0x3b4a91[_0xe131('0x9a')]===-0x1){return _0x3b4a91;}var _0x41193d=this[_0xe131('0x99')](_0xe131('0xa8'),_0xe131('0xa9'));if(_0x41193d['result']===-0x1){return _0x41193d;}var _0x5a6bdf=this[_0xe131('0x99')](_0xe131('0xaa'),_0xe131('0xab'));if(_0x5a6bdf[_0xe131('0x9a')]===-0x1){return _0x5a6bdf;}var _0x3cf1ec=this[_0xe131('0x99')](_0xe131('0xac'),_0xe131('0xad'));if(_0x3cf1ec[_0xe131('0x9a')]===-0x1){return _0x3cf1ec;}return this[_0xe131('0xb')]['noop'](util['format'](_0xe131('0xae'),_0x4130a5));};AGIVertices[_0xe131('0xd')][_0xe131('0xaf')]=function(_0x475045){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0xb0'),_0x475045[_0xe131('0xa0')]));return this[_0xe131('0xb')][_0xe131('0xaf')]([_0x475045[_0xe131('0xb1')],_0x475045['args']]);};AGIVertices[_0xe131('0xd')][_0xe131('0xb2')]=function(_0x512247){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0xb3'),_0x512247[_0xe131('0xa0')]));if(this[_0xe131('0x79')](_0x512247[_0xe131('0x5a')])){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0xb4'),_0x512247['timeout']));var _0x166fe5=this[_0xe131('0xb')][_0xe131('0xb5')](_0x512247['timeout']);if(_0x166fe5[_0xe131('0x9a')]===-0x1){return _0x166fe5;}}return this[_0xe131('0xb')][_0xe131('0xb2')]();};AGIVertices[_0xe131('0xd')][_0xe131('0x40')]=function(_0x1170c5){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0xb6'),_0x1170c5[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x1170c5[_0xe131('0x3e')])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x1170c5,_0xe131('0xb7'));}_0x1170c5[_0xe131('0x3f')]=moment();if(this[_0xe131('0x79')](_0x1170c5[_0xe131('0xb8')])){_0x1170c5[_0xe131('0x3f')]=moment()[_0xe131('0xb9')](_0x1170c5[_0xe131('0xb8')],_0xe131('0xba'));}if(!this[_0xe131('0x79')](_0x1170c5[_0xe131('0xbb')])){_0x1170c5[_0xe131('0xbb')]=0x2;}this[_0xe131('0x38')][_0xe131('0x64')](this,_0x1170c5);return this['channel'][_0xe131('0xa3')](util['format'](_0xe131('0xbc'),_0x1170c5[_0xe131('0x3d')],_0x1170c5['list_id'],_0x1170c5[_0xe131('0x3f')]));};AGIVertices[_0xe131('0xd')][_0xe131('0xbd')]=function(_0x54087c){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0xbe'),_0x54087c['label']));var _0xb037e1=this[_0xe131('0xb')][_0xe131('0x49')](_0x54087c[_0xe131('0xbf')],_0x54087c['options']);if(_0xb037e1[_0xe131('0x9a')]===-0x1){return _0xb037e1;}return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0xc0'),_0x54087c[_0xe131('0xbf')],_0x54087c[_0xe131('0x6d')]));};AGIVertices[_0xe131('0xd')][_0xe131('0xc1')]=function(_0x4462a8){logger['info'](util[_0xe131('0x21')](_0xe131('0xc2'),_0x4462a8[_0xe131('0xa0')]));if(!this['isConfigured'](_0x4462a8[_0xe131('0x4e')])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0xa1'));}var _0x2d2567='\x22'+_0x4462a8[_0xe131('0x4e')]+'\x22';if(this[_0xe131('0x79')](_0x4462a8['options'])){_0x2d2567+=','+_0x4462a8[_0xe131('0x6d')];}var _0x400b37=this[_0xe131('0xb')][_0xe131('0x49')](_0xe131('0xa2'),_0x2d2567);if(_0x400b37[_0xe131('0x9a')]===-0x1){return _0x400b37;}return this[_0xe131('0xb')][_0xe131('0xa3')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x2d2567));};AGIVertices['prototype'][_0xe131('0xc3')]=function(_0x2232af){logger['info'](util['format'](_0xe131('0xc4'),_0x2232af[_0xe131('0xa0')]));if(!this['isConfigured'](_0x2232af[_0xe131('0x4e')])){return this[_0xe131('0xb')]['noop'](_0xe131('0xa1'));}var _0x2cb942='\x22'+_0x2232af['text']+'\x22';if(this['isConfigured'](_0x2232af['options'])){_0x2cb942+=','+_0x2232af[_0xe131('0x6d')];}var _0x4dba48=this[_0xe131('0xb')][_0xe131('0x49')](_0xe131('0xa2'),_0x2cb942);if(_0x4dba48[_0xe131('0x9a')]===-0x1){return _0x4dba48;}return this['channel'][_0xe131('0xa3')](util[_0xe131('0x21')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2cb942));};AGIVertices[_0xe131('0xd')][_0xe131('0xc5')]=function(_0x3d8d47){logger[_0xe131('0x25')](util['format'](_0xe131('0xc6'),_0x3d8d47[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x3d8d47[_0xe131('0xa5')])){return this[_0xe131('0xb')][_0xe131('0xa3')]('no\x20grammar\x20configured');}var _0x24ab16=_0x3d8d47[_0xe131('0xa5')];if(this[_0xe131('0x79')](_0x3d8d47[_0xe131('0x6d')])){_0x24ab16+=','+_0x3d8d47[_0xe131('0x6d')];}var _0x3a2bd1=this[_0xe131('0xb')]['exec'](_0xe131('0xa7'),_0x24ab16);if(_0x3a2bd1['result']===-0x1){return _0x3a2bd1;}var _0x35acd5=this[_0xe131('0x99')]('RECOG_CONFIDENCE()',_0xe131('0xc7'));if(_0x35acd5['result']===-0x1){return _0x35acd5;}var _0x4da72d=this[_0xe131('0x99')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x4da72d[_0xe131('0x9a')]===-0x1){return _0x4da72d;}var _0x2c0dca=this['getAndSetVariable'](_0xe131('0xac'),_0xe131('0xc8'));if(_0x2c0dca[_0xe131('0x9a')]===-0x1){return _0x2c0dca;}return this[_0xe131('0xb')]['noop'](util[_0xe131('0x21')](_0xe131('0xae'),_0x24ab16));};AGIVertices[_0xe131('0xd')]['sestekasr']=function(_0x18630d){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0xc9'),_0x18630d[_0xe131('0xa0')]));if(!this['isConfigured'](_0x18630d['grammar'])){return this[_0xe131('0xb')][_0xe131('0xa3')]('no\x20grammar\x20configured');}var _0x5b5c9d=_0x18630d[_0xe131('0xa5')];if(this['isConfigured'](_0x18630d[_0xe131('0x6d')])){_0x5b5c9d+=','+_0x18630d[_0xe131('0x6d')];}var _0x4c74dc=this[_0xe131('0xb')][_0xe131('0x49')](_0xe131('0xa7'),_0x5b5c9d);if(_0x4c74dc['result']===-0x1){return _0x4c74dc;}var _0x3da3de=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xe131('0xca'));if(_0x3da3de[_0xe131('0x9a')]===-0x1){return _0x3da3de;}var _0x1e2cc3=this['getAndSetVariable'](_0xe131('0xaa'),_0xe131('0xcb'));if(_0x1e2cc3[_0xe131('0x9a')]===-0x1){return _0x1e2cc3;}var _0x351f25=this[_0xe131('0x99')](_0xe131('0xac'),_0xe131('0xcc'));if(_0x351f25[_0xe131('0x9a')]===-0x1){return _0x351f25;}return this['channel'][_0xe131('0xa3')](util['format'](_0xe131('0xae'),_0x5b5c9d));};AGIVertices[_0xe131('0xd')][_0xe131('0xcd')]=function(_0x11aa4e){logger[_0xe131('0x25')](util[_0xe131('0x21')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x11aa4e[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x11aa4e[_0xe131('0xce')])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x11aa4e,_0xe131('0xcf'));}var _0x38f1bc=this[_0xe131('0x16')][_0xe131('0x64')](this,_0x11aa4e[_0xe131('0xce')]);if(!_0x38f1bc){return this[_0xe131('0xb')][_0xe131('0x24')](_0x11aa4e,_0xe131('0xd0'));}if(!this['isConfigured'](_0x11aa4e[_0xe131('0x26')])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x11aa4e,_0xe131('0xd1'));}var _0x27525c=_0x11aa4e[_0xe131('0x26')][_0xe131('0x4a')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe131('0xb')]['noop'](util['format'](_0xe131('0xd2'),_0x27525c));var _0x2871f3=this[_0xe131('0x22')][_0xe131('0x64')](this,_0x38f1bc,_0x27525c);this[_0xe131('0x2b')][_0xe131('0x64')](this,_0x11aa4e,_0x27525c);if(!this[_0xe131('0x79')](_0x11aa4e[_0xe131('0xd3')])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0xd4'));}var _0x95cbc1=this[_0xe131('0xe')][_0xe131('0x64')](this,_0x11aa4e[_0xe131('0xd3')]);if(!_0x95cbc1){return this[_0xe131('0xb')][_0xe131('0x24')](_0x11aa4e,'no\x20variable\x20found');}var _0x416d90=this;_0x2871f3['forEach'](function(_0x319233,_0x42efba){Object[_0xe131('0xd5')](_0x319233)['forEach'](function(_0x34ef70){_0x416d90['channel'][_0xe131('0x94')](util[_0xe131('0x21')]('%s[%s][%s]',_0x95cbc1,_0x42efba,_0x34ef70),_0x319233[_0x34ef70]);});});this[_0xe131('0xb')][_0xe131('0x94')](util[_0xe131('0x21')](_0xe131('0xd6'),_0x95cbc1),_0x2871f3[_0xe131('0x90')]);return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0xd7'),_0x95cbc1));};AGIVertices[_0xe131('0xd')][_0xe131('0xd8')]=function(_0x4daf8f){logger[_0xe131('0xd9')](util[_0xe131('0x21')](_0xe131('0xda'),_0x4daf8f[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x4daf8f[_0xe131('0xdb')])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x4daf8f,_0xe131('0xdc'));}var _0x1253c4=this[_0xe131('0xdd')][_0xe131('0x64')](this,_0x4daf8f[_0xe131('0xdb')]);if(!_0x1253c4){return this['channel']['error'](_0x4daf8f,_0xe131('0xde'));}var _0x40a62d=this[_0xe131('0xb')][_0xe131('0x49')]('DIAL',[util[_0xe131('0x21')]('SIP/%s',_0x1253c4),_0x4daf8f[_0xe131('0x5a')],_0x4daf8f[_0xe131('0xdf')],_0x4daf8f[_0xe131('0x58')]]);if(_0x40a62d['result']===-0x1){return _0x40a62d;}return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0xe0'),_0xe131('0xe1')));};AGIVertices[_0xe131('0xd')][_0xe131('0xe2')]=function(_0x44cc7a){logger[_0xe131('0x25')](util['format'](_0xe131('0xe3'),_0x44cc7a[_0xe131('0xa0')]));if(!this['isConfigured'](_0x44cc7a[_0xe131('0x6f')])){return this[_0xe131('0xb')][_0xe131('0xa3')]('no\x20key\x20configured');}if(!this[_0xe131('0x79')](_0x44cc7a[_0xe131('0x4e')])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0xa1'));}this[_0xe131('0xb')][_0xe131('0xe4')]=!![];this[_0xe131('0x2b')](_0x44cc7a);this[_0xe131('0x37')](_0x44cc7a['text'],'in','','');this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0xe5'),_0x44cc7a['text']));var _0x2dab4b=this['googleDialogflow'][_0xe131('0x64')](this,_0x44cc7a);if(_0x2dab4b){for(var _0x2cbb18 in _0x2dab4b){if(_0x2dab4b[_0xe131('0x89')](_0x2cbb18)){this[_0xe131('0xb')][_0xe131('0x94')](util[_0xe131('0x21')](_0xe131('0xe6'),_0x2cbb18['toUpperCase']()),_0x2dab4b[_0x2cbb18]);}}this[_0xe131('0x37')](_0x2dab4b[_0xe131('0xe7')],_0xe131('0xe8'),_0xe131('0xe2'),'');return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')]('Dialogflow\x20Result\x20%s',_0x2dab4b[_0xe131('0xe7')]));}return this[_0xe131('0xb')][_0xe131('0x24')](_0x44cc7a,_0xe131('0xe9'));};AGIVertices['prototype']['dialogflowV2']=function(_0x2299ee){logger[_0xe131('0x25')](util['format'](_0xe131('0xea'),_0x2299ee[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x2299ee[_0xe131('0x72')])){return this[_0xe131('0xb')]['noop'](_0xe131('0xeb'));}if(!this['isConfigured'](_0x2299ee[_0xe131('0xec')])){return this[_0xe131('0xb')][_0xe131('0xa3')]('no\x20client_email\x20configured');}if(!this[_0xe131('0x79')](_0x2299ee['private_key'])){return this[_0xe131('0xb')]['noop'](_0xe131('0xed'));}if(!this[_0xe131('0x79')](_0x2299ee['dialogflowV2_language'])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0xee'));}if(!this[_0xe131('0x79')](_0x2299ee[_0xe131('0x4e')])){return this[_0xe131('0xb')]['noop']('no\x20text\x20configured');}this[_0xe131('0xb')][_0xe131('0xe4')]=!![];this[_0xe131('0x2b')](_0x2299ee);this[_0xe131('0x37')](_0x2299ee['text'],'in','','');this[_0xe131('0xb')]['noop'](util[_0xe131('0x21')](_0xe131('0xef'),_0x2299ee[_0xe131('0x4e')]));var _0x38282d=this[_0xe131('0x71')][_0xe131('0x64')](this,_0x2299ee);if(_0x38282d){for(var _0x31e3d7 in _0x38282d){if(_0x38282d[_0xe131('0x89')](_0x31e3d7)){if(_0x31e3d7!==_0xe131('0xf0')){this[_0xe131('0xb')][_0xe131('0x94')](util[_0xe131('0x21')]('DIALOGFLOW_%s',_0x31e3d7['toUpperCase']()),_0x38282d[_0x31e3d7]);}}}this['createSquareMessage'](_0x38282d[_0xe131('0xe7')],_0xe131('0xe8'),_0xe131('0xf1'),_0x38282d['providerResponse']);return this[_0xe131('0xb')]['noop'](util['format']('DialogflowV2\x20Result\x20%s',_0x38282d[_0xe131('0xe7')]));}return this['channel']['error'](_0x2299ee,_0xe131('0xf2'));};AGIVertices[_0xe131('0xd')][_0xe131('0xf3')]=function(_0x215b53){logger['info'](util[_0xe131('0x21')](_0xe131('0xf4'),_0x215b53[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x215b53[_0xe131('0xf5')])){return this[_0xe131('0xb')][_0xe131('0xa3')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x215b53['username'])){return this[_0xe131('0xb')]['noop']('no\x20username\x20configured');}if(!this[_0xe131('0x79')](_0x215b53['password'])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0xf6'));}if(!this['isConfigured'](_0x215b53['ndassistant_url'])){return this['channel'][_0xe131('0xa3')](_0xe131('0xa1'));}this[_0xe131('0xb')][_0xe131('0xe4')]=!![];this[_0xe131('0x2b')](_0x215b53);this[_0xe131('0x37')](_0x215b53[_0xe131('0x4e')],'in','','');this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0xf7'),_0x215b53[_0xe131('0x4e')]));var _0x289404=this[_0xe131('0x74')]['sync'](this,_0x215b53);if(_0x289404){for(var _0x559fbb in _0x289404){if(_0x289404[_0xe131('0x89')](_0x559fbb)){this[_0xe131('0xb')][_0xe131('0x94')](util['format']('SESTEK_NDA_%s',_0x559fbb['toUpperCase']()),_0x289404[_0x559fbb]);}}this['createSquareMessage'](_0x289404[_0xe131('0xe7')],_0xe131('0xe8'),_0xe131('0xf3'),'');if(_0x289404['audiofile']){this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0xf8'),_0x289404['audiofile']));var _0x42d21f=this['channel'][_0xe131('0xf9')](_0x289404[_0xe131('0xfa')]);try{fs[_0xe131('0xfb')](_0x289404[_0xe131('0xfa')]+'.wav');}catch(_0x151517){logger[_0xe131('0x24')](_0x151517);}return _0x42d21f;}else{return this[_0xe131('0xb')]['noop'](util['format'](_0xe131('0xfc'),_0x289404['speech']));}}return this[_0xe131('0xb')]['error'](_0x215b53,_0xe131('0xfd'));};AGIVertices[_0xe131('0xd')][_0xe131('0xfe')]=function(_0x3422a3){logger[_0xe131('0x25')](util['format'](_0xe131('0xff'),_0x3422a3['label']));return this['channel'][_0xe131('0xa3')](_0xe131('0xfe'));};AGIVertices[_0xe131('0xd')][_0xe131('0x100')]=function(_0x24ab84){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x101'),_0x24ab84[_0xe131('0xa0')]));var _0x327e8d='';if(_0x24ab84[_0xe131('0x102')]){if(!this['isConfigured'](_0x24ab84['trunk_id'])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x24ab84,'no\x20trunk\x20selected');}else{var _0x2df61f=parseInt(_0x24ab84['trunk_id'],0xa);if(isNaN(_0x2df61f)){_0x327e8d=_0x24ab84[_0xe131('0x102')];}else{_0x327e8d=this[_0xe131('0x103')]['sync'](this,_0x24ab84[_0xe131('0x102')]);if(!_0x327e8d){return this['channel'][_0xe131('0x24')](_0x24ab84,_0xe131('0x104'));}}}}else if(_0x24ab84['trunk_name']){_0x327e8d=_0x24ab84[_0xe131('0x105')];}else{return this[_0xe131('0xb')]['error'](_0x24ab84,_0xe131('0x106'));}var _0x2f30dc=this[_0xe131('0xb')][_0xe131('0x49')]('DIAL',[util['format']('SIP/%s/%s',_0x327e8d,_0x24ab84[_0xe131('0x3d')]),_0x24ab84[_0xe131('0x5a')],_0x24ab84['opts'],_0x24ab84[_0xe131('0x58')]]);if(_0x2f30dc[_0xe131('0x9a')]===-0x1){return _0x2f30dc;}return this[_0xe131('0xb')]['noop'](util[_0xe131('0x21')](_0xe131('0xe0'),'DIAL'));};AGIVertices[_0xe131('0xd')][_0xe131('0x107')]=function(_0xc170ec){logger[_0xe131('0x25')](util[_0xe131('0x21')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0xc170ec[_0xe131('0xa0')]));return this[_0xe131('0xb')][_0xe131('0xa3')]('finally');};AGIVertices[_0xe131('0xd')][_0xe131('0x108')]=function(_0x4d2af4){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x109'),_0x4d2af4[_0xe131('0xa0')]));if(_0x4d2af4['retry']===0x0){return this[_0xe131('0x9c')](_0x4d2af4);}_0x4d2af4['retry']-=0x1;if(!this[_0xe131('0x79')](_0x4d2af4['file_id'])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x4d2af4,_0xe131('0x10a'));}var _0x407124=this[_0xe131('0x19')][_0xe131('0x64')](this,_0x4d2af4[_0xe131('0x10b')]);if(!_0x407124){return this['channel']['error'](_0x4d2af4,_0xe131('0x10c'));}if(!this[_0xe131('0x79')](_0x4d2af4[_0xe131('0xd3')])){return this['channel'][_0xe131('0x24')](_0xe131('0xd4'));}var _0x55045a=this[_0xe131('0xb')][_0xe131('0x10d')](_0x407124,_0x4d2af4['response'],_0x4d2af4['maxdigit']);var _0x21996f=_0x55045a[_0xe131('0x9a')]?_0x55045a[_0xe131('0x9a')][_0xe131('0x98')]():'';logger[_0xe131('0x25')]('test',JSON['stringify'](_0x55045a));if(_0x55045a[_0xe131('0x9a')]===-0x1){this[_0xe131('0x2b')]['sync'](this,_0x4d2af4,_0x21996f);return _0x55045a;}else if(_0x55045a['extra']===_0xe131('0x5a')){_0x55045a[_0xe131('0x9a')]=_0x21996f[_0xe131('0x90')]>=parseInt(_0x4d2af4[_0xe131('0x10e')])?'x':'i';}else{_0x55045a[_0xe131('0x9a')]=_0x21996f['length']>=parseInt(_0x4d2af4[_0xe131('0x10e')])&&_0x21996f[_0xe131('0x90')]<=parseInt(_0x4d2af4[_0xe131('0x10f')])?'x':'i';}var _0x15c76b=this[_0xe131('0xe')][_0xe131('0x64')](this,_0x4d2af4[_0xe131('0xd3')]);if(!_0x15c76b){return this[_0xe131('0xb')][_0xe131('0x24')](_0x4d2af4,_0xe131('0x110'));}this[_0xe131('0xb')][_0xe131('0x94')](_0x15c76b,_0x21996f);if(this['isConfigured'](_0x4d2af4[_0xe131('0x111')])){var _0x4e4122=parseInt(_0x4d2af4[_0xe131('0x111')],0xa);var _0x625b49=rs[_0xe131('0x112')]({'charset':'*','length':_0x4e4122});var _0x4a31af=_0x21996f[_0xe131('0x90')];if(_0x4a31af>0x0){if(_0x4a31af>_0x4e4122){this['createSquareDetailsReport'][_0xe131('0x64')](this,_0x4d2af4,_0x4d2af4[_0xe131('0x113')]===_0xe131('0x114')?_0x625b49+_0x21996f[_0xe131('0x115')](_0x4e4122):_0x21996f['substr'](0x0,_0x4a31af-_0x4e4122)+_0x625b49);}else{this[_0xe131('0x2b')][_0xe131('0x64')](this,_0x4d2af4,rs['generate']({'charset':'*','length':_0x4a31af}));}}else{this[_0xe131('0x2b')][_0xe131('0x64')](this,_0x4d2af4,'');}}else{this[_0xe131('0x2b')]['sync'](this,_0x4d2af4,_0x21996f);}return _0x55045a;};AGIVertices['prototype'][_0xe131('0x116')]=function(_0x5bda79){logger[_0xe131('0x25')](util['format'](_0xe131('0x117'),_0x5bda79[_0xe131('0xa0')]));return this[_0xe131('0x108')](_0x5bda79);};AGIVertices[_0xe131('0xd')]['goal']=function(_0x1ed3c2){logger[_0xe131('0x25')](util['format'](_0xe131('0x118'),_0x1ed3c2['label']));this[_0xe131('0x2b')]['sync'](this,_0x1ed3c2,_0x1ed3c2['goalname']);return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x119'),_0x1ed3c2['goalname']));};AGIVertices[_0xe131('0xd')]['awspolly']=function(_0x52288a){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x11a'),_0x52288a[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x52288a[_0xe131('0x7c')])||!this[_0xe131('0x79')](_0x52288a[_0xe131('0x7d')])){return this['channel'][_0xe131('0xa3')](_0xe131('0x11b'));}if(!this[_0xe131('0x79')](_0x52288a[_0xe131('0x4e')])){return this[_0xe131('0xb')]['noop']('no\x20text\x20configured');}this[_0xe131('0xb')]['noop'](util['format'](_0xe131('0x11c'),_0x52288a[_0xe131('0x4e')]));var _0x1ca98a=this[_0xe131('0x7b')][_0xe131('0x64')](this,_0x52288a);if(_0x1ca98a){this['channel'][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x11d'),_0x1ca98a));var _0x4a834b=this['channel']['streamFile'](_0x1ca98a);try{fs[_0xe131('0xfb')](_0x1ca98a+_0xe131('0x11e'));}catch(_0x50f527){logger[_0xe131('0x24')](_0x50f527);}return _0x4a834b;}return this[_0xe131('0xb')][_0xe131('0x24')](_0x52288a,_0xe131('0x11f'));};AGIVertices[_0xe131('0xd')]['awslex']=function(_0x3977d7){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x120'),_0x3977d7[_0xe131('0xa0')]));if(!this['isConfigured'](_0x3977d7[_0xe131('0x7c')])||!this[_0xe131('0x79')](_0x3977d7[_0xe131('0x7d')])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0x11b'));}if(!this['isConfigured'](_0x3977d7[_0xe131('0x121')])){return this['channel'][_0xe131('0xa3')](_0xe131('0x122'));}if(!this['isConfigured'](_0x3977d7[_0xe131('0x4e')])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0xa1'));}this[_0xe131('0xb')]['bot']=!![];this[_0xe131('0x2b')](_0x3977d7);this[_0xe131('0x37')](_0x3977d7['text'],'in','','');this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x123'),_0x3977d7[_0xe131('0x4e')]));var _0x50f9f3=this[_0xe131('0x81')][_0xe131('0x64')](this,_0x3977d7);if(_0x50f9f3){for(var _0x5be4ff in _0x50f9f3){if(_0x50f9f3[_0xe131('0x89')](_0x5be4ff)&&_['isString'](_0x50f9f3[_0x5be4ff])){this[_0xe131('0xb')][_0xe131('0x94')](util[_0xe131('0x21')]('AWS_LEX_%s',_0x5be4ff[_0xe131('0x5d')]()),_0x50f9f3[_0x5be4ff]);}}if(_[_0xe131('0x39')](_0x50f9f3['message'])){return this[_0xe131('0xb')][_0xe131('0xa3')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xe131('0x37')](_0x50f9f3[_0xe131('0x6b')],_0xe131('0xe8'),_0xe131('0x124'),'');return this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0x125'),_0x50f9f3['message']));}}return this[_0xe131('0xb')][_0xe131('0x24')](_0x3977d7,_0xe131('0x126'));};AGIVertices[_0xe131('0xd')][_0xe131('0x127')]=function(_0x8a7363){logger[_0xe131('0x25')](util[_0xe131('0x21')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x8a7363['label'],_0x8a7363[_0xe131('0x5a')]));if(!this['isConfigured'](_0x8a7363['key'])){return this['channel'][_0xe131('0xa3')](_0xe131('0x128'));}var _0xe8d976=_0xe131('0x129');var _0x3062ad=util[_0xe131('0x21')]('%s/recordings/%s',FILES_PATH,rs[_0xe131('0x112')](0x4));var _0x2ac772=util[_0xe131('0x21')](_0xe131('0x93'),_0x3062ad,_0xe8d976);var _0x754789=!![];if(_0x8a7363[_0xe131('0x12a')]===_0xe131('0x12b')){_0x754789=![];}var _0x37f319=this[_0xe131('0xb')][_0xe131('0x12c')](_0x3062ad,_0xe8d976,_0x8a7363['intKey'],_0x8a7363[_0xe131('0x5a')],undefined,_0x754789);if(_0x37f319[_0xe131('0x9a')]!==-0x1){this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0x12d'),_0x2ac772));var _0x321393=this[_0xe131('0x82')]['sync'](this,_0x8a7363,_0x2ac772);if(_0x321393){for(var _0x3d78ce in _0x321393){if(_0x321393[_0xe131('0x89')](_0x3d78ce)){this[_0xe131('0xb')]['setVariable'](util[_0xe131('0x21')](_0xe131('0x12e'),_0x3d78ce[_0xe131('0x5d')]()),_0x321393[_0x3d78ce]);}}return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x12f'),JSON[_0xe131('0x67')](_0x321393)));}}return _0x37f319;};AGIVertices[_0xe131('0xd')]['tildeasr']=function(_0x349957){logger[_0xe131('0x25')](util[_0xe131('0x21')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x349957[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x349957[_0xe131('0x85')])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0x130'));}if(!this['isConfigured'](_0x349957[_0xe131('0x86')])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0x131'));}var _0x192b40=_0xe131('0x129');var _0x332576=util[_0xe131('0x21')]('%s/recordings/%s',FILES_PATH,rs[_0xe131('0x112')](0x4));var _0x30d91a=util[_0xe131('0x21')]('%s.%s',_0x332576,_0x192b40);var _0x1e389f=!![];if(_0x349957[_0xe131('0x12a')]==='NOBEEP'){_0x1e389f=![];}var _0x53a1a4=this['channel'][_0xe131('0x12c')](_0x332576,_0x192b40,_0x349957[_0xe131('0x132')],_0x349957[_0xe131('0x5a')],undefined,_0x1e389f);if(_0x53a1a4['result']!==-0x1){this[_0xe131('0xb')]['noop'](util[_0xe131('0x21')](_0xe131('0x133'),_0x30d91a));var _0x3524f3=this['tildeASR'][_0xe131('0x64')](this,_0x349957,_0x30d91a);if(_0x3524f3){for(var _0x1e0883 in _0x3524f3){if(_0x3524f3[_0xe131('0x89')](_0x1e0883)){this['channel']['setVariable'](util['format'](_0xe131('0x134'),_0x1e0883[_0xe131('0x5d')]()),_0x3524f3[_0x1e0883]);}}return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x135'),JSON['stringify'](_0x3524f3)));}}return _0x53a1a4;};AGIVertices[_0xe131('0xd')][_0xe131('0x136')]=function(_0x29af6e){logger['info'](util['format'](_0xe131('0x137'),_0x29af6e[_0xe131('0xa0')]));return this['channel'][_0xe131('0x138')](_0x29af6e[_0xe131('0x32')],_0x29af6e[_0xe131('0x139')],_0x29af6e[_0xe131('0x33')]);};AGIVertices[_0xe131('0xd')][_0xe131('0x13a')]=function(_0x48fa3d){logger['info'](util[_0xe131('0x21')](_0xe131('0x13b'),_0x48fa3d['label']));if(!this['isConfigured'](_0x48fa3d[_0xe131('0x13c')])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x48fa3d,_0xe131('0x13d'));}try{var _0x28fe02=eval(_0x48fa3d[_0xe131('0x13c')])?_0xe131('0x13e'):_0xe131('0x13f');this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x140'),_0x48fa3d[_0xe131('0x13c')],_0x28fe02));return{'code':0xc8,'result':_0x28fe02};}catch(_0x3a82b9){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xe131('0xd')][_0xe131('0x141')]=function(_0x126aad){logger[_0xe131('0x25')](util[_0xe131('0x21')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x126aad[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x126aad[_0xe131('0x142')])){return this['channel']['error'](_0x126aad,'no\x20interval\x20configured');}var _0x21fac1=this[_0xe131('0x143')][_0xe131('0x64')](this,_0x126aad['interval_id']);if(!_0x21fac1){return this[_0xe131('0xb')]['error'](_0x126aad,_0xe131('0x144'));}for(var _0x3e502c=0x0;_0x3e502c<_0x21fac1[_0xe131('0x90')];_0x3e502c+=0x1){var _0x332983=this[_0xe131('0xb')][_0xe131('0xe')](util[_0xe131('0x21')](_0xe131('0x145'),_0x21fac1[_0x3e502c]));if(_0x332983[_0xe131('0x9a')]===-0x1){return _0x332983;}logger[_0xe131('0x25')](util[_0xe131('0x21')]('IFTIME\x20%s\x20%s',_0x21fac1[_0x3e502c],_0x332983[_0xe131('0x97')]));if(_0x332983[_0xe131('0x97')]===_0xe131('0x13e')){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x146'),_0x21fac1[_0x3e502c],_0xe131('0x13e')));this[_0xe131('0xb')]['noop'](util[_0xe131('0x21')](_0xe131('0x146'),_0x21fac1[_0x3e502c],_0xe131('0x13e')));return{'code':0xc8,'result':'true'};}else{logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x146'),_0x21fac1[_0x3e502c],_0xe131('0x13f')));this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0x146'),_0x21fac1[_0x3e502c],_0xe131('0x13f')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xe131('0xd')][_0xe131('0x147')]=function(_0x288461){logger[_0xe131('0x25')](util['format'](_0xe131('0x148'),_0x288461[_0xe131('0xa0')]));return this[_0xe131('0xb')][_0xe131('0x147')]();};AGIVertices[_0xe131('0xd')][_0xe131('0x149')]=function(_0x199680){logger[_0xe131('0x25')](util[_0xe131('0x21')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x199680[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x199680[_0xe131('0x6f')])){return this[_0xe131('0xb')]['noop'](_0xe131('0x128'));}var _0x548459=_0xe131('0x129');var _0x7881bb=util[_0xe131('0x21')](_0xe131('0x14a'),FILES_PATH,rs[_0xe131('0x112')](0x4));var _0x2afd78=util[_0xe131('0x21')](_0xe131('0x93'),_0x7881bb,_0x548459);var _0x5d9881=!![];if(_0x199680[_0xe131('0x12a')]==='NOBEEP'){_0x5d9881=![];}var _0x577545=this[_0xe131('0xb')][_0xe131('0x12c')](_0x7881bb,_0x548459,_0x199680[_0xe131('0x132')],_0x199680[_0xe131('0x5a')],undefined,_0x5d9881);if(_0x577545['result']!==-0x1){this['channel'][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x14b'),_0x2afd78));var _0x321c94=this[_0xe131('0x77')]['sync'](this,_0x199680,_0x2afd78);if(_0x321c94){for(var _0x4582e1 in _0x321c94){if(_0x321c94[_0xe131('0x89')](_0x4582e1)){this[_0xe131('0xb')]['setVariable'](util[_0xe131('0x21')](_0xe131('0x14c'),_0x4582e1[_0xe131('0x5d')]()),_0x321c94[_0x4582e1]);}}return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x14d'),JSON['stringify'](_0x321c94)));}}return _0x577545;};AGIVertices[_0xe131('0xd')][_0xe131('0x14e')]=function(_0x2662c0){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x14f'),_0x2662c0['label']));if(!this[_0xe131('0x79')](_0x2662c0['key'])){return this[_0xe131('0xb')]['noop'](_0xe131('0x128'));}if(!this[_0xe131('0x79')](_0x2662c0[_0xe131('0x4e')])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0xa1'));}this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0x150'),_0x2662c0[_0xe131('0x4e')]));var _0x279f71=this[_0xe131('0x75')][_0xe131('0x64')](this,_0x2662c0);if(_0x279f71){this['channel'][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x14b'),_0x279f71));var _0x5ef105=this[_0xe131('0xb')]['streamFile'](_0x279f71,_0x2662c0['intKey']);try{fs[_0xe131('0xfb')](_0x279f71+_0xe131('0x11e'));}catch(_0x329bed){logger[_0xe131('0x24')](_0x329bed);}return _0x5ef105;}return this[_0xe131('0xb')][_0xe131('0x24')](_0x2662c0,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['login']=function(_0x2721a8){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x151'),_0x2721a8[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x2721a8[_0xe131('0x152')])){return this[_0xe131('0xb')]['error'](_0x2721a8,_0xe131('0x153'));}logger[_0xe131('0x25')](util['format'](_0xe131('0x154'),this[_0xe131('0xb')][_0xe131('0x2f')],_0x2721a8[_0xe131('0x152')]));var _0x2ae46b=this['agentLogin']['sync'](this,_0x2721a8['findBy']);if(_0x2ae46b){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x155'),this[_0xe131('0xb')][_0xe131('0x2f')],_0x2721a8[_0xe131('0x152')]));this[_0xe131('0xb')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xe131('0x2f')],_0x2721a8[_0xe131('0x152')]));return{'code':0xc8,'result':_0xe131('0x156')};}else{logger['info'](util[_0xe131('0x21')](_0xe131('0x157'),this['channel'][_0xe131('0x2f')],_0x2721a8[_0xe131('0x152')]));this['channel']['noop'](util[_0xe131('0x21')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe131('0xb')][_0xe131('0x2f')],_0x2721a8[_0xe131('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe131('0xd')][_0xe131('0x158')]=function(_0x339a46){logger[_0xe131('0x25')](util['format'](_0xe131('0x159'),_0x339a46[_0xe131('0xa0')]));if(!this['isConfigured'](_0x339a46[_0xe131('0x152')])){return this['channel'][_0xe131('0x24')](_0x339a46,_0xe131('0x153'));}logger[_0xe131('0x25')](util['format'](_0xe131('0x154'),this['channel'][_0xe131('0x2f')],_0x339a46[_0xe131('0x152')]));var _0x15c62e=this['agentLogout']['sync'](this,_0x339a46[_0xe131('0x152')]);if(_0x15c62e){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x155'),this['channel'][_0xe131('0x2f')],_0x339a46[_0xe131('0x152')]));this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0x155'),this[_0xe131('0xb')][_0xe131('0x2f')],_0x339a46[_0xe131('0x152')]));return{'code':0xc8,'result':_0xe131('0x156')};}else{logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x157'),this[_0xe131('0xb')][_0xe131('0x2f')],_0x339a46[_0xe131('0x152')]));this['channel'][_0xe131('0xa3')](util[_0xe131('0x21')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xe131('0x2f')],_0x339a46[_0xe131('0x152')]));return{'code':0xc8,'result':_0xe131('0x15a')};}};AGIVertices[_0xe131('0xd')]['math']=function(_0x24589f){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x15b'),_0x24589f['label']));if(!this['isConfigured'](_0x24589f[_0xe131('0x15c')])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x24589f,_0xe131('0x15d'));}this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0x15e'),_0x24589f[_0xe131('0x15c')]));var _0x647ccb=eval(_0x24589f[_0xe131('0x15c')]);if(!this['isConfigured'](_0x24589f[_0xe131('0xd3')])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0xd4'));}var _0x8bcfdb=this[_0xe131('0xe')][_0xe131('0x64')](this,_0x24589f[_0xe131('0xd3')]);if(!_0x8bcfdb){return this[_0xe131('0xb')][_0xe131('0x24')](_0x24589f,_0xe131('0x110'));}if(_['isArray'](_0x647ccb)){var _0x4fadfd=this;_0x647ccb[_0xe131('0x15f')](function(_0xafb26a,_0x4b25f5){_0x4fadfd['channel']['setVariable'](util[_0xe131('0x21')](_0xe131('0x160'),_0x8bcfdb,_0x4b25f5),_0xafb26a);});return this['channel'][_0xe131('0xa3')](util[_0xe131('0x21')]('variable\x20%s[key]\x20set',_0x8bcfdb));}else{return this[_0xe131('0xb')][_0xe131('0x94')](_0x8bcfdb,_0x647ccb);}};AGIVertices[_0xe131('0xd')][_0xe131('0x161')]=function(_0x2afc7a){logger['info'](util[_0xe131('0x21')](_0xe131('0x162'),_0x2afc7a[_0xe131('0xa0')]));if(_0x2afc7a['retry']===0x0){return this['maxRetry'](_0x2afc7a);}_0x2afc7a[_0xe131('0x9d')]-=0x1;if(!this['isConfigured'](_0x2afc7a['file_id'])){return this['channel'][_0xe131('0x24')](_0x2afc7a,_0xe131('0x10a'));}var _0x497b2d=this[_0xe131('0x19')][_0xe131('0x64')](this,_0x2afc7a[_0xe131('0x10b')]);if(!_0x497b2d){return this['channel'][_0xe131('0x24')](_0x2afc7a,'no\x20file\x20audio\x20found');}var _0x58b0a6=this[_0xe131('0xb')][_0xe131('0x10d')](_0x497b2d,_0x2afc7a[_0xe131('0x163')],_0x2afc7a[_0xe131('0x164')]);var _0x97d1c7=_0x58b0a6[_0xe131('0x9a')];if(_0x58b0a6['result']===-0x1){this[_0xe131('0x2b')][_0xe131('0x64')](this,_0x2afc7a,'-1');return _0x58b0a6;}else if(_0x58b0a6[_0xe131('0x97')]===_0xe131('0x5a')){_0x58b0a6['result']=_0x58b0a6['result'][_0xe131('0x90')]>0x0?_0x58b0a6[_0xe131('0x9a')]:'t';}else if(_['isEmpty'](_0x58b0a6[_0xe131('0x9a')])){_0x58b0a6[_0xe131('0x9a')]='#';_0x97d1c7='#';}if(!this['isConfigured'](_0x2afc7a[_0xe131('0xd3')])){this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0xd4'));}else{var _0x22f101=this[_0xe131('0xe')][_0xe131('0x64')](this,_0x2afc7a['variable_id']);if(!_0x22f101){return this[_0xe131('0xb')][_0xe131('0x24')](_0x2afc7a,'no\x20variable\x20found');}this[_0xe131('0xb')]['setVariable'](_0x22f101,_0x97d1c7);}this[_0xe131('0x2b')][_0xe131('0x64')](this,_0x2afc7a,_0x97d1c7);return _0x58b0a6;};AGIVertices[_0xe131('0xd')][_0xe131('0xa3')]=function(_0x512dc3){logger[_0xe131('0x25')](util['format'](_0xe131('0x165'),_0x512dc3[_0xe131('0xa0')]));return this[_0xe131('0xb')]['noop'](_0x512dc3[_0xe131('0x166')]||_0x512dc3['label']);};AGIVertices[_0xe131('0xd')]['pause']=function(_0x26f347){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x167'),_0x26f347['label']));if(!this[_0xe131('0x79')](_0x26f347[_0xe131('0x152')])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x26f347,_0xe131('0x153'));}logger[_0xe131('0x25')](util[_0xe131('0x21')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xe131('0xb')][_0xe131('0x2f')],_0x26f347[_0xe131('0x152')]));var _0x4585de=this[_0xe131('0x41')][_0xe131('0x64')](this,_0x26f347[_0xe131('0x168')]);var _0x1ed29a=this['agentPause'][_0xe131('0x64')](this,_0x26f347[_0xe131('0x152')],_0x4585de);if(_0x1ed29a){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xe131('0x2f')],_0x26f347[_0xe131('0x152')]));this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x155'),this[_0xe131('0xb')][_0xe131('0x2f')],_0x26f347[_0xe131('0x152')]));return{'code':0xc8,'result':_0xe131('0x156')};}else{logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x157'),this['channel']['callerid'],_0x26f347[_0xe131('0x152')]));this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x155'),this[_0xe131('0xb')][_0xe131('0x2f')],_0x26f347[_0xe131('0x152')]));return{'code':0xc8,'result':_0xe131('0x15a')};}};AGIVertices[_0xe131('0xd')][_0xe131('0x169')]=function(_0x2f6918){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x16a'),_0x2f6918['label']));if(!this[_0xe131('0x79')](_0x2f6918[_0xe131('0x10b')])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x2f6918,_0xe131('0x10a'));}var _0x476801=this[_0xe131('0x19')][_0xe131('0x64')](this,_0x2f6918[_0xe131('0x10b')]);if(!_0x476801){return this[_0xe131('0xb')][_0xe131('0x24')](_0x2f6918,_0xe131('0x10c'));}var _0x43261d=this['channel'][_0xe131('0x49')]('PLAYBACK',[_0x476801,_0x2f6918[_0xe131('0xdf')]]);if(_0x43261d[_0xe131('0x9a')]===-0x1){return _0x43261d;}return this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0xc0'),_0xe131('0x16b'),_0x476801));};AGIVertices[_0xe131('0xd')][_0xe131('0x16c')]=function(_0x3f988d){logger[_0xe131('0x25')](util[_0xe131('0x21')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x3f988d[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x3f988d[_0xe131('0x16d')])){return this['channel'][_0xe131('0x24')](_0x3f988d,_0xe131('0x16e'));}var _0x5c0b6f='';var _0x4aa44d=parseInt(_0x3f988d[_0xe131('0x16d')],0xa);if(isNaN(_0x4aa44d)){_0x5c0b6f=_0x3f988d['queue_id'];}else{_0x5c0b6f=this[_0xe131('0x11')]['sync'](this,_0x3f988d[_0xe131('0x16d')]);if(!_0x5c0b6f){return this[_0xe131('0xb')]['error'](_0x3f988d,_0xe131('0x16f'));}}var _0x196687='';if(this['isConfigured'](_0x3f988d[_0xe131('0x10b')])){var _0x5579a7=this[_0xe131('0x19')][_0xe131('0x64')](this,_0x3f988d['file_id']);if(_0x5579a7){_0x196687=_0x5579a7;}}this['createSquareDetailsReport'][_0xe131('0x64')](this,_0x3f988d,_0x5c0b6f);if(_0x3f988d[_0xe131('0xdf')]['indexOf']('x')<0x0){_0x3f988d[_0xe131('0xdf')]+='x';}if(_0x3f988d[_0xe131('0xdf')][_0xe131('0x170')]('X')<0x0){_0x3f988d[_0xe131('0xdf')]+='X';}this[_0xe131('0xb')][_0xe131('0x94')](_0xe131('0x171'),_0x5c0b6f?_0x5c0b6f['toLowerCase']():'');var _0x2b734a=this[_0xe131('0xb')][_0xe131('0x49')](_0xe131('0x172'),[_0x5c0b6f,_0x3f988d['opts'],_0x3f988d[_0xe131('0x58')],_0x196687,_0x3f988d[_0xe131('0x5a')],_0x3f988d[_0xe131('0xaf')],_0x3f988d[_0xe131('0x173')],_0x3f988d[_0xe131('0x174')],'',_0x3f988d['position']]);if(_0x2b734a[_0xe131('0x9a')]===-0x1){return _0x2b734a;}return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0xc0'),'QUEUE',_0x5c0b6f));};AGIVertices[_0xe131('0xd')][_0xe131('0x175')]=function(_0x1725fe){logger[_0xe131('0x25')](util['format'](_0xe131('0x176'),_0x1725fe[_0xe131('0xa0')]));var _0x4152f5=_0x1725fe[_0xe131('0x177')]||_0xe131('0x129');var _0x1f4aa1=util[_0xe131('0x21')](_0xe131('0x178'),this[_0xe131('0xb')][_0xe131('0x2c')],rs[_0xe131('0x112')](0x5));var _0xb80acc=util[_0xe131('0x21')]('%s/recordings/%s.%s',FILES_PATH,_0x1f4aa1,_0x4152f5);var _0x25b810=util['format'](_0xe131('0x14a'),FILES_PATH,_0x1f4aa1);this[_0xe131('0x30')]['sync'](this,_0x1725fe,_0x1f4aa1,_0xb80acc);this[_0xe131('0xb')][_0xe131('0x94')](_0xe131('0x179'),_0x1f4aa1);logger['info'](_0xe131('0x17a'),_0x25b810,_0x4152f5,_0x1725fe[_0xe131('0x17b')],_0x1725fe[_0xe131('0x5a')]);return this['channel'][_0xe131('0x12c')](_0x25b810,_0x4152f5,_0x1725fe[_0xe131('0x17b')],_0x1725fe[_0xe131('0x5a')],undefined,!![]);};AGIVertices[_0xe131('0xd')]['restapi']=function(_0x585402){logger[_0xe131('0x25')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x585402[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x585402[_0xe131('0x58')])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0x17c'));}var _0xed47d8=this[_0xe131('0x57')][_0xe131('0x64')](this,_0x585402);logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x17d'),util[_0xe131('0x17e')](_0xed47d8,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x585402['variable_id'])){return this[_0xe131('0xb')]['noop'](_0xe131('0x17f'));}var _0x18988e=this['getVariable'][_0xe131('0x64')](this,_0x585402[_0xe131('0xd3')]);if(!_0x18988e){return this[_0xe131('0xb')][_0xe131('0x24')](_0x585402,'no\x20variable\x20found');}this[_0xe131('0xb')]['setVariable'](util['format'](_0xe131('0x180'),_0x18988e),_0xed47d8['statusCode']?_0xed47d8['statusCode']:_0xe131('0x181'));this[_0xe131('0xb')][_0xe131('0x94')](util[_0xe131('0x21')](_0xe131('0x182'),_0x18988e),_0xed47d8[_0xe131('0x69')]?_0xed47d8['statusMessage']:'OK');if(_0xed47d8[_0xe131('0x5e')]){try{this[_0xe131('0x91')](_0xed47d8[_0xe131('0x5e')],_0x18988e);}catch(_0x5c1f55){logger[_0xe131('0x24')](util[_0xe131('0x21')](_0xe131('0x183'),_0x18988e));}}return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0xd7'),_0x18988e));};AGIVertices[_0xe131('0xd')]['saydigits']=function(_0x5cb21c){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x184'),_0x5cb21c[_0xe131('0xa0')]));return this[_0xe131('0xb')][_0xe131('0x185')](_0x5cb21c['digits'][_0xe131('0x4a')](/\s+/g,''),_0x5cb21c[_0xe131('0x17b')]);};AGIVertices[_0xe131('0xd')]['saynumber']=function(_0x50062a){logger[_0xe131('0x25')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x50062a[_0xe131('0xa0')]));return this[_0xe131('0xb')][_0xe131('0x186')](_0x50062a['number'][_0xe131('0x4a')](/\s+/g,''),_0x50062a[_0xe131('0x17b')]);};AGIVertices['prototype']['sayphonetic']=function(_0x1579f3){logger[_0xe131('0x25')](util['format'](_0xe131('0x187'),_0x1579f3[_0xe131('0xa0')]));return this[_0xe131('0xb')]['sayPhonetic'](_0x1579f3[_0xe131('0x4e')],_0x1579f3[_0xe131('0x17b')]);};AGIVertices[_0xe131('0xd')][_0xe131('0x188')]=function(_0x56f5f0){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x189'),_0x56f5f0[_0xe131('0xa0')]));if(!this['isConfigured'](_0x56f5f0['account_id'])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0x18a'));}var _0x1d5a79=this[_0xe131('0x18b')][_0xe131('0x64')](this,_0x56f5f0[_0xe131('0x18c')]);if(!_0x1d5a79||!_0x1d5a79[_0xe131('0x18d')]){return this[_0xe131('0xb')][_0xe131('0x24')](_0x56f5f0,'no\x20mail\x20account\x20found');}var _0x578cb6={'from':util[_0xe131('0x21')](_0xe131('0x18e'),_0x1d5a79[_0xe131('0x14')],_0x1d5a79['email']||_0x1d5a79['Smtp'][_0xe131('0x18f')]),'to':_0x56f5f0['to']||'','cc':_0x56f5f0['cc']||'','bcc':_0x56f5f0[_0xe131('0x190')]||'','subject':_0x56f5f0[_0xe131('0x191')],'html':_0x56f5f0[_0xe131('0x4e')],'text':_0x56f5f0[_0xe131('0x4e')]};if(this[_0xe131('0x79')](_0x56f5f0[_0xe131('0x192')])){}logger[_0xe131('0xd9')](_0xe131('0x193'),JSON[_0xe131('0x67')](_0x578cb6));this[_0xe131('0x2b')][_0xe131('0x64')](this,_0x56f5f0,_0x56f5f0[_0xe131('0x18c')]);this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x1d5a79[_0xe131('0x14')]));this[_0xe131('0x1d')][_0xe131('0x64')](this,_0x1d5a79['smtpOptions'],_0x578cb6);return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0x194'));};AGIVertices[_0xe131('0xd')][_0xe131('0x195')]=function(_0x594d42){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x196'),_0x594d42[_0xe131('0xa0')]));return this[_0xe131('0xb')]['noop'](_0xe131('0x197'));};AGIVertices[_0xe131('0xd')][_0xe131('0x198')]=function(_0x5b55ce){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x199'),_0x5b55ce[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x5b55ce[_0xe131('0x19a')])){return this['channel'][_0xe131('0xa3')](_0xe131('0x19b'));}var _0xc2960d=this[_0xe131('0x19c')]['sync'](this,_0x5b55ce[_0xe131('0x19a')]);if(!_0xc2960d){return this[_0xe131('0xb')][_0xe131('0x24')](_0x5b55ce,'no\x20sms\x20account\x20found');}var _0x2e61b1={'body':_0x5b55ce['sms_text'],'phone':_0x5b55ce['to']||'','SmsAccountId':_0xc2960d['id']};logger['debug']('sendSMS\x20message',JSON[_0xe131('0x67')](_0x2e61b1));this[_0xe131('0x2b')][_0xe131('0x64')](this,_0x5b55ce,_0x5b55ce[_0xe131('0x19a')]);this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0x19d'),_0xc2960d[_0xe131('0x14')]));this[_0xe131('0x2a')][_0xe131('0x64')](this,_0x2e61b1);return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0x19e'));};AGIVertices[_0xe131('0xd')][_0xe131('0x19f')]=function(_0xb8556){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x1a0'),_0xb8556[_0xe131('0xa0')]));if(!this['isConfigured'](_0xb8556[_0xe131('0xd3')])){return this[_0xe131('0xb')][_0xe131('0x24')](_0xb8556,'no\x20variable\x20selected');}var _0x5774a2=this[_0xe131('0xe')]['sync'](this,_0xb8556[_0xe131('0xd3')]);if(!_0x5774a2){return this[_0xe131('0xb')]['error'](_0xb8556,_0xe131('0x110'));}return this[_0xe131('0xb')]['setVariable'](_0x5774a2,_0xb8556[_0xe131('0x1a1')]);};AGIVertices[_0xe131('0xd')][_0xe131('0x1a2')]=function(_0x45e075){logger['info'](util[_0xe131('0x21')](_0xe131('0x1a3'),_0x45e075[_0xe131('0xa0')]));this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0x1a4'));if(_0x45e075[_0xe131('0xb2')]===_0xe131('0x1a5')){this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0x1a6'));return this['channel'][_0xe131('0xb2')]();}return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0x1a7'));};AGIVertices[_0xe131('0xd')]['subproject']=function(_0x238d9a){logger[_0xe131('0x25')](util['format'](_0xe131('0x1a8'),_0x238d9a['label']));if(!this[_0xe131('0x79')](_0x238d9a[_0xe131('0x1a9')])){return this['channel']['error'](_0x238d9a,_0xe131('0x1aa'));}var _0x4e6d05=this['getSquareProject'][_0xe131('0x64')](this,_0x238d9a['project_id']);if(!this[_0xe131('0x79')](_0x4e6d05)){return this['channel'][_0xe131('0x24')](_0x238d9a,util[_0xe131('0x21')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x238d9a[_0xe131('0x1a9')]));}if(_0x4e6d05===this['channel']['arg_1']){return this[_0xe131('0xb')][_0xe131('0x24')](_0x238d9a,_0xe131('0x1ab'));}this['createSquareDetailsReport']['sync'](this,_0x238d9a,_0x4e6d05);var _0x4fe188=this[_0xe131('0xb')]['exec'](_0xe131('0x1ac'),util[_0xe131('0x21')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0xe131('0x1ad')]||_0xe131('0x1ae'),_0x4e6d05,this[_0xe131('0xb')]['arg_1']));if(_0x4fe188[_0xe131('0x9a')]===-0x1){return _0x4fe188;}return this['channel']['noop'](util[_0xe131('0x21')](_0xe131('0xc0'),'AGI',_0x4e6d05));};AGIVertices[_0xe131('0xd')][_0xe131('0x1af')]=function(_0x155b8b){logger['info'](util[_0xe131('0x21')](_0xe131('0x1b0'),_0x155b8b[_0xe131('0xa0')]));var _0x271570=this[_0xe131('0x1b1')][_0xe131('0x64')](this,_0x155b8b[_0xe131('0xb1')]);this[_0xe131('0x2b')]['sync'](this,_0x155b8b,_0x155b8b[_0xe131('0xb1')]);if(this['isConfigured'](_0x155b8b[_0xe131('0xd3')])){var _0x410a8d=this[_0xe131('0xe')][_0xe131('0x64')](this,_0x155b8b[_0xe131('0xd3')]);if(_0x410a8d){this[_0xe131('0xb')][_0xe131('0x94')](_0x410a8d,_0x271570);return this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0x1b2'),_0x155b8b['command'],_0x410a8d));}}return this[_0xe131('0xb')][_0xe131('0xa3')](util['format'](_0xe131('0x1b3'),_0x155b8b[_0xe131('0xb1')]));};AGIVertices[_0xe131('0xd')][_0xe131('0x1b4')]=function(_0x50971d){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x1b5'),_0x50971d['label']));_0x50971d['text']=_0x50971d[_0xe131('0x4e')][_0xe131('0x4a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe131('0x79')](_0x50971d[_0xe131('0x4c')])){return this[_0xe131('0xb')]['noop'](_0xe131('0x1b6'));}if(!this[_0xe131('0x79')](_0x50971d['text'])){return this[_0xe131('0xb')][_0xe131('0xa3')](_0xe131('0xa1'));}this['channel'][_0xe131('0xa3')](util[_0xe131('0x21')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x50971d[_0xe131('0x4e')]));var _0x23d469=this[_0xe131('0x4b')][_0xe131('0x64')](this,_0x50971d);if(_0x23d469){this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x1b7'),_0x23d469));var _0x187323=this['channel']['streamFile'](_0x23d469);try{fs['unlink'](_0x23d469+'.wav');}catch(_0x35d830){logger[_0xe131('0x24')](_0x35d830);}return _0x187323;}return this[_0xe131('0xb')]['error'](_0x50971d,_0xe131('0x1b8'));};AGIVertices['prototype'][_0xe131('0x1b9')]=function(_0x2e283d){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x1ba'),_0x2e283d[_0xe131('0xa0')]));_0x2e283d[_0xe131('0x4e')]=_0x2e283d[_0xe131('0x4e')][_0xe131('0x4a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe131('0x79')](_0x2e283d['text'])){return this[_0xe131('0xb')]['noop'](_0xe131('0xa1'));}this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x1bb'),_0x2e283d[_0xe131('0x4e')]));var _0x5ac1c1=this['googleTTS'][_0xe131('0x64')](this,_0x2e283d);if(_0x5ac1c1){this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0x1bc'),_0x5ac1c1));var _0x3b572c=this[_0xe131('0xb')][_0xe131('0xf9')](_0x5ac1c1);try{fs[_0xe131('0xfb')](_0x5ac1c1+_0xe131('0x11e'));}catch(_0x503131){logger[_0xe131('0x24')](_0x503131);}return _0x3b572c;}return this[_0xe131('0xb')][_0xe131('0x24')](_0x2e283d,_0xe131('0x1bd'));};AGIVertices[_0xe131('0xd')][_0xe131('0x1be')]=function(_0x93d387){logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x1bf'),_0x93d387[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x93d387['findBy'])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x93d387,_0xe131('0x153'));}logger[_0xe131('0x25')](util['format'](_0xe131('0x154'),this[_0xe131('0xb')]['callerid'],_0x93d387[_0xe131('0x152')]));var _0x8d11b0=this['agentUnpause'][_0xe131('0x64')](this,_0x93d387[_0xe131('0x152')]);if(_0x8d11b0){logger[_0xe131('0x25')](util['format'](_0xe131('0x155'),this[_0xe131('0xb')][_0xe131('0x2f')],_0x93d387[_0xe131('0x152')]));this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xe131('0x2f')],_0x93d387[_0xe131('0x152')]));return{'code':0xc8,'result':_0xe131('0x156')};}else{logger[_0xe131('0x25')](util[_0xe131('0x21')](_0xe131('0x157'),this[_0xe131('0xb')]['callerid'],_0x93d387[_0xe131('0x152')]));this[_0xe131('0xb')]['noop'](util['format'](_0xe131('0x157'),this[_0xe131('0xb')]['callerid'],_0x93d387[_0xe131('0x152')]));return{'code':0xc8,'result':_0xe131('0x15a')};}};AGIVertices[_0xe131('0xd')]['voicemail']=function(_0x310fbd){logger['info'](util[_0xe131('0x21')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x310fbd['label']));var _0x32e864=this[_0xe131('0xb')][_0xe131('0x49')](_0xe131('0x1c0'),[_0x310fbd['mailbox'],_0x310fbd[_0xe131('0x6d')]]);if(_0x32e864[_0xe131('0x9a')]===-0x1){return _0x32e864;}return this[_0xe131('0xb')][_0xe131('0xa3')](util[_0xe131('0x21')](_0xe131('0xc0'),_0xe131('0x1c0'),_0x310fbd[_0xe131('0x1c1')]));};AGIVertices[_0xe131('0xd')][_0xe131('0x1c2')]=function(_0x4df92c){logger['info'](util[_0xe131('0x21')](_0xe131('0x1c3'),_0x4df92c[_0xe131('0xa0')]));if(!this[_0xe131('0x79')](_0x4df92c[_0xe131('0xd3')])){return this[_0xe131('0xb')][_0xe131('0x24')](_0x4df92c,'no\x20variable\x20selected');}var _0x5a6428=this[_0xe131('0xe')][_0xe131('0x64')](this,_0x4df92c[_0xe131('0xd3')]);if(!_0x5a6428){return this[_0xe131('0xb')]['error'](_0x4df92c,_0xe131('0x110'));}var _0x3ae414=this[_0xe131('0xb')][_0xe131('0xe')](_0x5a6428);return{'code':0xc8,'result':_0x3ae414[_0xe131('0x97')]?_0x3ae414[_0xe131('0x97')]:'-'};};String[_0xe131('0xd')][_0xe131('0x96')]=function(_0x476fd7,_0x11072d){return this['split'](_0x476fd7)[_0xe131('0x1c4')](_0x11072d);};module[_0xe131('0x1c5')]=AGIVertices; \ No newline at end of file +var _0xe1e8=['../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','mailRpc','getVariable','rpc','getVariableById','name','catch','prototype','getVoiceQueue','getSquareProjectById','then','getSquareOdbcById','dsn','getTrunk','getTrunkById','getSound','getSoundById','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','getSoundPath','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','method','number','timeout','includes','POST','PUT','toUpperCase','body','parse','rawBody','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','ispeechASR','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','replaceAllVariables','saveRestApiResult','hasOwnProperty','%s.%s','length','setVariable','split','replaceAll','extra','getAndSetVariable','result','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','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','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','speech','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','condition','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','%s/recordings/%s','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','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','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','getSquareProject','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','shelljs','moment','mustache','request-promise','../../config/logger'];(function(_0x3cfc9d,_0x35cf54){var _0x23f5a8=function(_0x3d1804){while(--_0x3d1804){_0x3cfc9d['push'](_0x3cfc9d['shift']());}};_0x23f5a8(++_0x35cf54);}(_0xe1e8,0x1cb));var _0x8e1e=function(_0x2888dd,_0x2b6f0b){_0x2888dd=_0x2888dd-0x0;var _0x477f79=_0xe1e8[_0x2888dd];return _0x477f79;};'use strict';var fs=require('fs');var util=require(_0x8e1e('0x0'));var _=require('lodash');var sh=require(_0x8e1e('0x1'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x8e1e('0x2'));var Mustache=require(_0x8e1e('0x3'));var rp=require(_0x8e1e('0x4'));var logger=require(_0x8e1e('0x5'))('agi');var config=require('../../config/environment');var shared=require(_0x8e1e('0x6'));var scripts=require(_0x8e1e('0x7'));var FILES_PATH=_0x8e1e('0x8');var recursiveMapAttributes=[_0x8e1e('0x9'),'rawBody'];var verticesWithRetry=[_0x8e1e('0xa'),_0x8e1e('0xb'),_0x8e1e('0xc')];var AGIVertices=function(_0x5b3ba8,_0x4f6994,_0x4007f3){this[_0x8e1e('0xd')]=_0x5b3ba8;this['rpc']=_0x4f6994;this[_0x8e1e('0xe')]=_0x4007f3;};AGIVertices['prototype'][_0x8e1e('0xf')]=function(_0x2446a2,_0x1eb5a4){this[_0x8e1e('0x10')][_0x8e1e('0x11')](_0x2446a2)['then'](function(_0x23695e){_0x1eb5a4(null,_0x23695e?_0x23695e[_0x8e1e('0x12')]:![]);})[_0x8e1e('0x13')](function(_0x57919e){_0x1eb5a4(_0x57919e);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x15')]=function(_0x3b5e9f,_0x161bb7){this['rpc']['getVoiceQueueById'](_0x3b5e9f)['then'](function(_0x11269c){_0x161bb7(null,_0x11269c?_0x11269c[_0x8e1e('0x12')]:![]);})[_0x8e1e('0x13')](function(_0x1bd383){_0x161bb7(_0x1bd383);});};AGIVertices[_0x8e1e('0x14')]['getSquareProject']=function(_0x522c55,_0x2d2dc2){this[_0x8e1e('0x10')][_0x8e1e('0x16')](_0x522c55)[_0x8e1e('0x17')](function(_0x4738f3){_0x2d2dc2(null,_0x4738f3?_0x4738f3[_0x8e1e('0x12')]:![]);})['catch'](function(_0x2c8221){_0x2d2dc2(_0x2c8221);});};AGIVertices[_0x8e1e('0x14')]['getSquareOdbc']=function(_0x4e9fd4,_0x7726c1){this[_0x8e1e('0x10')][_0x8e1e('0x18')](_0x4e9fd4)[_0x8e1e('0x17')](function(_0x325028){_0x7726c1(null,_0x325028?_0x325028[_0x8e1e('0x19')]:![]);})['catch'](function(_0x7ad0a5){_0x7726c1(_0x7ad0a5);});};AGIVertices['prototype']['getUser']=function(_0x4e2e6d,_0x849b18){this[_0x8e1e('0x10')]['getUserById'](_0x4e2e6d)[_0x8e1e('0x17')](function(_0x47972b){_0x849b18(null,_0x47972b?_0x47972b[_0x8e1e('0x12')]:![]);})['catch'](function(_0x4e5a22){_0x849b18(_0x4e5a22);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1a')]=function(_0x309fbd,_0xcac731){this['rpc'][_0x8e1e('0x1b')](_0x309fbd)[_0x8e1e('0x17')](function(_0x10ae15){_0xcac731(null,_0x10ae15?_0x10ae15['name']:![]);})['catch'](function(_0xbd295f){_0xcac731(_0xbd295f);});};AGIVertices['prototype'][_0x8e1e('0x1c')]=function(_0x3e797d,_0x7e733f){var _0x296129=this;this[_0x8e1e('0x10')][_0x8e1e('0x1d')](_0x3e797d)[_0x8e1e('0x17')](function(_0x370ee2){_0x7e733f(null,_0x370ee2?_0x296129['getSoundPath'](_0x370ee2['save_name']):![]);})[_0x8e1e('0x13')](function(_0x1ad99e){_0x7e733f(_0x1ad99e);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1e')]=function(_0x50dbb9,_0x227fd3){this[_0x8e1e('0x10')][_0x8e1e('0x1f')](_0x50dbb9)[_0x8e1e('0x17')](function(_0x2d5c0e){_0x227fd3(null,_0x2d5c0e?_0x2d5c0e:![]);})['catch'](function(_0x37239d){_0x227fd3(_0x37239d);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x20')]=function(_0x1027c9,_0x302c52,_0x2b4b98){this['mailRpc'][_0x8e1e('0x20')](_0x1027c9,_0x302c52)[_0x8e1e('0x17')](function(){_0x2b4b98(null);})['catch'](function(_0x33a3d7){_0x2b4b98(_0x33a3d7);});};AGIVertices['prototype'][_0x8e1e('0x21')]=function(_0x167554,_0x29fedd){this[_0x8e1e('0x10')]['getIntervalById'](_0x167554)['then'](function(_0xcc54f9){if(_0xcc54f9){if(_0xcc54f9[_0x8e1e('0x22')]){_0x29fedd(null,[_0xcc54f9[_0x8e1e('0x23')]]);}else{_0x29fedd(null,_['map'](_0xcc54f9['Intervals'],_0x8e1e('0x23')));}}else{_0x29fedd(null,![]);}})[_0x8e1e('0x13')](function(_0x26de3b){_0x29fedd(_0x26de3b);});};AGIVertices['prototype'][_0x8e1e('0x24')]=function(_0x3e7190){return util['format'](_0x8e1e('0x25'),FILES_PATH,_0x3e7190);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x26')]=function(_0x53847e,_0x4c4a39,_0x46de06){odbc[_0x8e1e('0x27')](_0x53847e,function(_0x577c10){if(_0x577c10){logger[_0x8e1e('0x28')](_0x8e1e('0x29'),_0x577c10);_0x46de06(_0x577c10);}else{logger[_0x8e1e('0x2a')](_0x8e1e('0x2b'));odbc[_0x8e1e('0x2c')](_0x4c4a39,function(_0x49644c,_0x515635){if(_0x49644c){logger[_0x8e1e('0x2a')](_0x8e1e('0x2d'),_0x4c4a39);_0x46de06(_0x49644c);}else{logger[_0x8e1e('0x2a')](_0x8e1e('0x2e'),_0x4c4a39);odbc[_0x8e1e('0x2f')](function(_0x43d39b){if(_0x43d39b){logger[_0x8e1e('0x28')](_0x8e1e('0x30'),_0x43d39b);}_0x46de06(null,_0x515635);});}});}});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x31')]=function(_0x371ecc,_0x31f2fa){this[_0x8e1e('0x10')][_0x8e1e('0x32')](_0x371ecc)[_0x8e1e('0x17')](function(_0x3c372c){_0x31f2fa(null,_0x3c372c?_0x3c372c:![]);})[_0x8e1e('0x13')](function(_0x37241e){_0x31f2fa(_0x37241e);});};AGIVertices[_0x8e1e('0x14')]['createSmsMessage']=function(_0x25b4e9,_0x5ce91f){this[_0x8e1e('0x10')][_0x8e1e('0x33')](_0x25b4e9)['then'](function(_0x3aeb1d){_0x5ce91f(null,_0x3aeb1d);})[_0x8e1e('0x13')](function(_0x45cebd){_0x5ce91f(_0x45cebd);});};AGIVertices['prototype'][_0x8e1e('0x34')]=function(_0x50f510,_0x35d3a3,_0x5cdd82){this[_0x8e1e('0x10')][_0x8e1e('0x34')]({'uniqueid':this[_0x8e1e('0xd')][_0x8e1e('0x35')],'node':_0x50f510[_0x8e1e('0x36')],'application':_0x50f510[_0x8e1e('0x37')],'data':_0x35d3a3||null,'project_name':this[_0x8e1e('0xd')][_0x8e1e('0x38')],'callerid':this[_0x8e1e('0xd')][_0x8e1e('0x39')]})[_0x8e1e('0x17')](function(_0x21fded){if(_0x5cdd82){_0x5cdd82(null,_0x21fded);}})[_0x8e1e('0x13')](function(_0xa0818f){if(_0x5cdd82){_0x5cdd82(_0xa0818f);}});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x3a')]=function(_0x2e1e52,_0x246005,_0x4a22a7,_0x4cce17){this['rpc']['createSquareRecording']({'uniqueid':this['channel'][_0x8e1e('0x35')],'callerid':this[_0x8e1e('0xd')][_0x8e1e('0x39')],'calleridname':this['channel'][_0x8e1e('0x3b')],'context':this[_0x8e1e('0xd')][_0x8e1e('0x3c')],'extension':this['channel'][_0x8e1e('0x3d')],'priority':this[_0x8e1e('0xd')]['priority'],'accountcode':this[_0x8e1e('0xd')][_0x8e1e('0x3e')],'dnid':this[_0x8e1e('0xd')][_0x8e1e('0x3f')],'projectName':this['channel'][_0x8e1e('0x38')],'saveName':_0x246005,'filename':_0x2e1e52[_0x8e1e('0x40')]||_0x246005,'savePath':_0x4a22a7})[_0x8e1e('0x17')](function(_0x46a0a3){_0x4cce17(null,_0x46a0a3);})['catch'](function(_0x467ead){_0x4cce17(_0x467ead);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x41')]=function(_0x3b2275,_0x12c866,_0x3cf22d,_0x5c7e02,_0x1af1d1){this['rpc']['createSquareMessage']({'uniqueid':this[_0x8e1e('0xd')][_0x8e1e('0x35')],'body':_0x3b2275,'direction':_0x12c866,'providerName':_0x3cf22d,'providerResponse':_0x5c7e02})[_0x8e1e('0x17')](function(_0xcfa9dc){if(_0x1af1d1){_0x1af1d1(null,_0xcfa9dc);}})[_0x8e1e('0x13')](function(_0x3b2158){if(_0x1af1d1){_0x1af1d1(_0x3b2158);}});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x42')]=function(_0x358b16,_0x4d6bae){this[_0x8e1e('0x10')][_0x8e1e('0x42')]({'firstName':_[_0x8e1e('0x43')](_0x358b16['name'])||_[_0x8e1e('0x44')](_0x358b16['name'])?_0x8e1e('0x45')+Math[_0x8e1e('0x46')]():_0x358b16[_0x8e1e('0x12')],'lastName':_[_0x8e1e('0x43')](_0x358b16[_0x8e1e('0x47')])||_[_0x8e1e('0x44')](_0x358b16[_0x8e1e('0x47')])?null:_0x358b16[_0x8e1e('0x47')],'phone':_0x358b16['phone'],'ListId':_0x358b16[_0x8e1e('0x48')],'scheduledat':_0x358b16[_0x8e1e('0x49')],'callbackUniqueid':this['channel'][_0x8e1e('0x35')],'tags':'callback','description':_0x8e1e('0x4a')+_0x358b16[_0x8e1e('0x49')][_0x8e1e('0x4b')](),'priority':_0x358b16[_0x8e1e('0x4c')]})['then'](function(_0x2ee543){_0x4d6bae(null,_0x2ee543);})[_0x8e1e('0x13')](function(_0x11c032){_0x4d6bae(_0x11c032);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x4d')]=function(_0x59159c,_0x328295){this[_0x8e1e('0x10')]['getPauseById'](_0x59159c)['then'](function(_0x56a108){_0x328295(null,_0x56a108?_0x56a108[_0x8e1e('0x12')]:![]);})['catch'](function(_0x467c03){_0x328295(_0x467c03);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x4e')]=function(_0xf96bd4,_0x35923c,_0x5be17f){var _0x8e5786={'role':'agent'};_0x8e5786[_0xf96bd4]=this[_0x8e1e('0xd')]['callerid'];this[_0x8e1e('0x10')][_0x8e1e('0x4e')](_0x8e5786,_0x35923c,this['channel'][_0x8e1e('0x35')])[_0x8e1e('0x17')](function(_0x99095b){_0x5be17f(null,_[_0x8e1e('0x44')](_0x99095b)?![]:!![]);})[_0x8e1e('0x13')](function(_0x57afe0){logger[_0x8e1e('0x28')](_0x57afe0);_0x5be17f(null,![]);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x4f')]=function(_0x106455,_0xeef8c1){var _0x148c90={'role':_0x8e1e('0x50')};_0x148c90[_0x106455]=this[_0x8e1e('0xd')][_0x8e1e('0x39')];this[_0x8e1e('0x10')]['agentUnpause'](_0x148c90)[_0x8e1e('0x17')](function(_0x1cc22e){_0xeef8c1(null,_[_0x8e1e('0x44')](_0x1cc22e)?![]:!![]);})[_0x8e1e('0x13')](function(_0x2cf7e4){logger['error'](_0x2cf7e4);_0xeef8c1(null,![]);});};AGIVertices[_0x8e1e('0x14')]['agentLogout']=function(_0x480837,_0x5558d9){var _0x28e4e8={'role':_0x8e1e('0x50')};_0x28e4e8[_0x480837]=this[_0x8e1e('0xd')][_0x8e1e('0x39')];this[_0x8e1e('0x10')][_0x8e1e('0x51')](_0x28e4e8)[_0x8e1e('0x17')](function(_0x8e963d){_0x5558d9(null,_['isNil'](_0x8e963d)?![]:!![]);})[_0x8e1e('0x13')](function(_0x13f752){logger[_0x8e1e('0x28')](_0x13f752);_0x5558d9(null,![]);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x52')]=function(_0x5c0222,_0x14566a){var _0x3bc117={'role':'agent'};_0x3bc117[_0x5c0222]=this['channel'][_0x8e1e('0x39')];var _0x289c19=_0x5c0222!=_0x8e1e('0x53')?util[_0x8e1e('0x54')](_0x8e1e('0x55'),_0x8e1e('0x56'),this[_0x8e1e('0xd')][_0x8e1e('0x39')]):undefined;this[_0x8e1e('0x10')][_0x8e1e('0x52')](_0x3bc117,_0x289c19)[_0x8e1e('0x17')](function(_0x2221ed){_0x14566a(null,_[_0x8e1e('0x44')](_0x2221ed)?![]:!![]);})[_0x8e1e('0x13')](function(_0x3c2d74){logger[_0x8e1e('0x28')](_0x3c2d74);_0x14566a(null,![]);});};AGIVertices['prototype'][_0x8e1e('0x57')]=function(_0x2ea49d,_0x214984){sh[_0x8e1e('0x58')](_[_0x8e1e('0x59')](_0x2ea49d),function(_0x2ed1d2,_0x228993){var _0x2bce82=_0x228993[_0x8e1e('0x5a')](/(\r\n|\n|\r)/gm,'');_0x214984(null,_0x2bce82);});};AGIVertices['prototype'][_0x8e1e('0x5b')]=function(_0x44cb2f,_0x3b5742){scripts[_0x8e1e('0x5b')](_0x44cb2f[_0x8e1e('0x5c')],_0x44cb2f['google_cloud_tts_text_type']||_0x8e1e('0x5d'),_0x44cb2f[_0x8e1e('0x5d')],_0x44cb2f['languageCode']||'en-US',_0x44cb2f[_0x8e1e('0x5e')]||_0x8e1e('0x5f'),_0x44cb2f[_0x8e1e('0x60')]||'MP3')[_0x8e1e('0x17')](function(_0x1cd36a){_0x3b5742(null,_0x1cd36a);})['catch'](function(_0x10cb55){_0x3b5742(_0x10cb55);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x61')]=function(_0x1f7734,_0x2e2dfc){scripts[_0x8e1e('0x61')](_0x1f7734[_0x8e1e('0x5d')],_0x1f7734[_0x8e1e('0x62')]||'en',0x1)['then'](function(_0x4182a8){_0x2e2dfc(null,_0x4182a8);})[_0x8e1e('0x13')](function(_0xd73d3b){_0x2e2dfc(_0xd73d3b);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x63')]=function(_0x43a43d,_0x4c36f2){var _0x5acc9f={'uri':_0x43a43d['url'],'method':_0x43a43d[_0x8e1e('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x43a43d['timeout'])===_0x8e1e('0x65')&&parseInt(_0x43a43d[_0x8e1e('0x66')])>=0x1?parseInt(_0x43a43d['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x8e1e('0x67')]([_0x8e1e('0x68'),_0x8e1e('0x69')],_0x5acc9f[_0x8e1e('0x64')][_0x8e1e('0x6a')]())){try{_0x5acc9f[_0x8e1e('0x6b')]=_0x43a43d['rawBody']?JSON[_0x8e1e('0x6c')](_0x43a43d[_0x8e1e('0x6d')]):{};}catch(_0x2b8ee5){logger[_0x8e1e('0x28')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2b8ee5);}}try{_0x5acc9f['headers']=_0x43a43d['rawHeaders']?JSON[_0x8e1e('0x6c')](_0x43a43d[_0x8e1e('0x9')]):{};}catch(_0x2e3fc5){logger['error'](_0x8e1e('0x6e'),_0x2e3fc5);}if(_0x43a43d[_0x8e1e('0x6f')]){try{var _0x12a5ff=require(_0x43a43d[_0x8e1e('0x6f')])[_0x8e1e('0x70')](this,_0x5acc9f);_0x5acc9f[_0x8e1e('0x71')]=Mustache[_0x8e1e('0x72')](_0x43a43d[_0x8e1e('0x73')],_0x12a5ff,{},['$$','$$']);if(_0x5acc9f[_0x8e1e('0x74')]){_0x5acc9f[_0x8e1e('0x74')]=JSON[_0x8e1e('0x6c')](Mustache[_0x8e1e('0x72')](JSON[_0x8e1e('0x75')](_0x5acc9f[_0x8e1e('0x74')]),_0x12a5ff,{},['$$','$$']));}if(_0x5acc9f[_0x8e1e('0x6b')]){_0x5acc9f['body']=JSON[_0x8e1e('0x6c')](Mustache[_0x8e1e('0x72')](JSON[_0x8e1e('0x75')](_0x5acc9f['body']),_0x12a5ff,{},['$$','$$']));}}catch(_0x4791ad){logger[_0x8e1e('0x28')](_0x8e1e('0x76'),_0x4791ad);}}rp(_0x5acc9f)['then'](function(_0x4c142e){var _0x466199={'statusCode':_0x4c142e['statusCode']||0xc8,'statusMessage':_0x4c142e[_0x8e1e('0x77')]||'OK','headers':_0x4c142e[_0x8e1e('0x74')]||{},'body':_0x4c142e['body']||{}};_0x4c36f2(null,_0x466199);})[_0x8e1e('0x13')](function(_0x2bbb49){var _0x3d22f1={'statusCode':_0x2bbb49[_0x8e1e('0x78')]||0x1f4,'statusMessage':_0x2bbb49['message']||_0x8e1e('0x79'),'headers':_0x2bbb49[_0x8e1e('0x7a')]['headers']||{},'body':_0x2bbb49[_0x8e1e('0x7a')]['body']||{}};_0x4c36f2(null,_0x3d22f1);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x7b')]=function(_0x502f8d,_0x537168){scripts[_0x8e1e('0x7b')](this['channel']['uniqueid'],_0x502f8d['key'],_0x502f8d[_0x8e1e('0x5d')],_0x502f8d[_0x8e1e('0x7c')]||'en')['then'](function(_0x210113){_0x537168(null,_0x210113);})[_0x8e1e('0x13')](function(_0x3fb325){_0x537168(_0x3fb325);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x7d')]=function(_0x980dbf,_0x432189){scripts[_0x8e1e('0x7d')](this['channel'][_0x8e1e('0x35')],_0x980dbf[_0x8e1e('0x7e')],_0x980dbf[_0x8e1e('0x7f')],_0x980dbf[_0x8e1e('0x80')],_0x980dbf[_0x8e1e('0x5d')],_0x980dbf[_0x8e1e('0x81')]||'en')['then'](function(_0x1b4e82){_0x432189(null,_0x1b4e82);})['catch'](function(_0x17e7f8){_0x432189(_0x17e7f8);});};AGIVertices['prototype'][_0x8e1e('0x82')]=function(_0x4afb47,_0x4d05c7){scripts['sestekNDA'](this['channel'],_0x4afb47)[_0x8e1e('0x17')](function(_0x283956){_0x4d05c7(null,_0x283956);})['catch'](function(_0x29a039){_0x4d05c7(_0x29a039);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x83')]=function(_0x255bca,_0x9b9b6a){scripts[_0x8e1e('0x83')](_0x255bca[_0x8e1e('0x84')],_0x255bca[_0x8e1e('0x5d')],_0x255bca[_0x8e1e('0x85')]||_0x8e1e('0x86'),_0x255bca['speed'])[_0x8e1e('0x17')](function(_0xf67938){_0x9b9b6a(null,_0xf67938);})[_0x8e1e('0x13')](function(_0x38c630){_0x9b9b6a(_0x38c630);});};AGIVertices['prototype'][_0x8e1e('0x87')]=function(_0x45327d,_0xf5db95,_0x10ab36){scripts[_0x8e1e('0x87')](_0xf5db95,_0x45327d['key'],_0x45327d['ispeech_asr_language']||'en-US',this['isConfigured'](_0x45327d[_0x8e1e('0x88')])?_0x45327d[_0x8e1e('0x88')]:undefined)[_0x8e1e('0x17')](function(_0x253b18){_0x10ab36(null,_0x253b18);})['catch'](function(_0x5d827f){_0x10ab36(_0x5d827f);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x89')]=function(_0x6c8aad,_0x31eaef){scripts[_0x8e1e('0x89')](_0x6c8aad['aws_access_key_id'],_0x6c8aad[_0x8e1e('0x8a')],_0x6c8aad[_0x8e1e('0x8b')],_0x6c8aad[_0x8e1e('0x8c')]||_0x8e1e('0x8d'),_0x6c8aad['text'],_0x6c8aad[_0x8e1e('0x8e')]||_0x8e1e('0x5d'))[_0x8e1e('0x17')](function(_0xabbe06){_0x31eaef(null,_0xabbe06);})['catch'](function(_0x2176e7){_0x31eaef(_0x2176e7);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x8f')]=function(_0xf4169e,_0x1090b7){scripts[_0x8e1e('0x8f')](this[_0x8e1e('0xd')][_0x8e1e('0x35')],_0xf4169e[_0x8e1e('0x90')],_0xf4169e[_0x8e1e('0x8a')],_0xf4169e[_0x8e1e('0x91')],_0xf4169e[_0x8e1e('0x5d')],_0xf4169e[_0x8e1e('0x92')])[_0x8e1e('0x17')](function(_0x476bd5){_0x1090b7(null,_0x476bd5);})[_0x8e1e('0x13')](function(_0x2109ee){_0x1090b7(_0x2109ee);});};AGIVertices[_0x8e1e('0x14')]['googleASR']=function(_0x1ac36c,_0x43a392,_0x202177){scripts[_0x8e1e('0x93')](_0x43a392,_0x1ac36c[_0x8e1e('0x84')],_0x1ac36c[_0x8e1e('0x94')]||_0x8e1e('0x86'))['then'](function(_0x17901f){_0x202177(null,_0x17901f);})['catch'](function(_0x15250f){_0x202177(_0x15250f);});};AGIVertices[_0x8e1e('0x14')]['tildeASR']=function(_0x5d6f2a,_0x34958a,_0x2354b4){scripts[_0x8e1e('0x95')](_0x34958a,_0x5d6f2a[_0x8e1e('0x96')],_0x5d6f2a['appsecret'],_0x5d6f2a[_0x8e1e('0x71')])['then'](function(_0x2a386f){_0x2354b4(null,_0x2a386f);})['catch'](function(_0x33d27b){_0x2354b4(_0x33d27b);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x97')]=function(_0x1c5688){var _0x5a7521=_['includes'](verticesWithRetry,_0x1c5688['agicommand'])?_0x1c5688:_[_0x8e1e('0x98')](_0x1c5688);for(var _0x52d06b in _0x5a7521){if(_0x5a7521['hasOwnProperty'](_0x52d06b)){if(_0x5a7521[_0x52d06b]&&_[_0x8e1e('0x99')](_0x5a7521[_0x52d06b])){if(_[_0x8e1e('0x67')](recursiveMapAttributes,_0x52d06b)){_0x5a7521[_0x52d06b]=this[_0x8e1e('0x9a')](_0x5a7521[_0x52d06b]);}else{_0x5a7521[_0x52d06b]=this['replaceAllVariables'](_0x5a7521[_0x52d06b]);}}}}return _0x5a7521;};AGIVertices['prototype'][_0x8e1e('0x9b')]=function(_0x25a459){for(var _0x3f8d84 in _0x25a459){if(_0x25a459['hasOwnProperty'](_0x3f8d84)){if(_[_0x8e1e('0x9c')](_0x25a459[_0x3f8d84])){this[_0x8e1e('0x9b')](_0x25a459[_0x3f8d84]);}else if(_[_0x8e1e('0x9d')](_0x25a459[_0x3f8d84])){for(var _0x3dd46f=0x0;_0x3dd46f<_0x25a459[_0x3f8d84]['length'];_0x3dd46f++){this[_0x8e1e('0x9b')](_0x25a459[_0x3f8d84][_0x3dd46f]);}}else if(_[_0x8e1e('0x99')](_0x25a459[_0x3f8d84])){_0x25a459[_0x3f8d84]=this[_0x8e1e('0x9e')](_0x25a459[_0x3f8d84]);}}}};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x9f')]=function(_0x49617e,_0x3f408d){for(var _0x536698 in _0x49617e){if(_0x49617e[_0x8e1e('0xa0')](_0x536698)){if(_[_0x8e1e('0x9c')](_0x49617e[_0x536698])){if(!_[_0x8e1e('0x43')](_0x49617e[_0x536698])){this[_0x8e1e('0x9f')](_0x49617e[_0x536698],util[_0x8e1e('0x54')](_0x8e1e('0xa1'),_0x3f408d,_0x536698));}}else if(_['isArray'](_0x49617e[_0x536698])){for(var _0x870fc6=0x0;_0x870fc6<_0x49617e[_0x536698][_0x8e1e('0xa2')];_0x870fc6++){this[_0x8e1e('0x9f')](_0x49617e[_0x536698][_0x870fc6],util['format']('%s.%s',_0x3f408d,_0x536698+'['+_0x870fc6+']'));}}else{if(!_[_0x8e1e('0x44')](_0x49617e[_0x536698])){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0xa1'),_0x3f408d,_0x536698),_0x49617e[_0x536698]);}}}}};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x9a')]=function(_0x426ebc){try{var _0x3326d2=JSON['parse'](_0x426ebc);this[_0x8e1e('0x9b')](_0x3326d2);return JSON[_0x8e1e('0x75')](_0x3326d2);}catch(_0x1dd8a4){return this[_0x8e1e('0x9e')](_0x426ebc);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x51c7f9){var _0x10784f=_0x51c7f9[_0x8e1e('0xa4')]('{');for(var _0x364ea3=0x1;_0x364ea3<_0x10784f[_0x8e1e('0xa2')];_0x364ea3+=0x1){var _0x38cf00=_0x10784f[_0x364ea3]['split']('}');if(_0x38cf00['length']>0x1){_0x51c7f9=_0x51c7f9[_0x8e1e('0xa5')]('{'+_0x38cf00[0x0]+'}',this[_0x8e1e('0xd')][_0x8e1e('0xf')](_0x38cf00[0x0])[_0x8e1e('0xa6')]||_0x38cf00[0x0]);}}if(_0x10784f[_0x8e1e('0xa2')]===0x1){return _0x51c7f9['toString']();}return this[_0x8e1e('0x9e')](_0x51c7f9);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xa7')]=function(_0x4c26f7,_0x529d69){var _0x4b52d9=this['channel'][_0x8e1e('0xf')](_0x4c26f7);if(_0x4b52d9[_0x8e1e('0xa8')]===-0x1){return _0x4b52d9;}logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x529d69,_0x4b52d9[_0x8e1e('0xa6')]));return this['channel']['setVariable'](_0x529d69,_0x4b52d9[_0x8e1e('0xa6')]);};AGIVertices['prototype']['isConfigured']=function(_0x41f4e7){return _0x41f4e7&&_0x41f4e7!=='0'&&_0x41f4e7!=='-1'&&_0x41f4e7!=='';};AGIVertices['prototype'][_0x8e1e('0xa9')]=function(_0x4cc46c){this[_0x8e1e('0x34')]['sync'](this,_0x4cc46c,'-');_0x4cc46c[_0x8e1e('0xaa')]=_0x4cc46c[_0x8e1e('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8e1e('0x14')]['mrcpsynth']=function(_0x141933){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xab'),_0x141933[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x141933['text'])){return this['channel']['noop'](_0x8e1e('0xad'));}var _0x53e298='\x22'+_0x141933[_0x8e1e('0x5d')]+'\x22';if(this['isConfigured'](_0x141933[_0x8e1e('0x7a')])){_0x53e298+=','+_0x141933[_0x8e1e('0x7a')];}var _0x9701e=this[_0x8e1e('0xd')][_0x8e1e('0x58')](_0x8e1e('0xae'),_0x53e298);if(_0x9701e[_0x8e1e('0xa8')]===-0x1){return _0x9701e;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xb0'),_0x53e298));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xb1')]=function(_0x37609a){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0xb2'),_0x37609a[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x37609a[_0x8e1e('0xb3')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xb4'));}var _0x340409=_0x37609a[_0x8e1e('0xb3')];if(this[_0x8e1e('0xac')](_0x37609a['options'])){_0x340409+=','+_0x37609a[_0x8e1e('0x7a')];}var _0x31c257=this[_0x8e1e('0xd')]['exec']('MRCPRecog',_0x340409);if(_0x31c257['result']===-0x1){return _0x31c257;}var _0x4c3c3f=this[_0x8e1e('0xa7')](_0x8e1e('0xb5'),_0x8e1e('0xb6'));if(_0x4c3c3f[_0x8e1e('0xa8')]===-0x1){return _0x4c3c3f;}var _0x104836=this['getAndSetVariable'](_0x8e1e('0xb7'),'MRCP_RECOG_TRANSCRIPT');if(_0x104836[_0x8e1e('0xa8')]===-0x1){return _0x104836;}var _0x1ebe00=this[_0x8e1e('0xa7')]('RECOG_INSTANCE()',_0x8e1e('0xb8'));if(_0x1ebe00[_0x8e1e('0xa8')]===-0x1){return _0x1ebe00;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('Executed\x20command\x20MRCPRecog\x20%s',_0x340409));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xb9')]=function(_0x148d32){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0xba'),_0x148d32[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')][_0x8e1e('0xb9')]([_0x148d32[_0x8e1e('0xbb')],_0x148d32[_0x8e1e('0xbc')]]);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xbd')]=function(_0x3312e0){logger['info'](util[_0x8e1e('0x54')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x3312e0[_0x8e1e('0x36')]));if(this[_0x8e1e('0xac')](_0x3312e0[_0x8e1e('0x66')])){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xbe'),_0x3312e0['timeout']));var _0x63bc85=this[_0x8e1e('0xd')][_0x8e1e('0xbf')](_0x3312e0[_0x8e1e('0x66')]);if(_0x63bc85[_0x8e1e('0xa8')]===-0x1){return _0x63bc85;}}return this['channel'][_0x8e1e('0xbd')]();};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xc0')]=function(_0x3f7cc1){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xc1'),_0x3f7cc1[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x3f7cc1[_0x8e1e('0x48')])){return this['channel'][_0x8e1e('0x28')](_0x3f7cc1,_0x8e1e('0xc2'));}_0x3f7cc1[_0x8e1e('0x49')]=moment();if(this[_0x8e1e('0xac')](_0x3f7cc1[_0x8e1e('0xc3')])){_0x3f7cc1[_0x8e1e('0x49')]=moment()[_0x8e1e('0xc4')](_0x3f7cc1[_0x8e1e('0xc3')],_0x8e1e('0xc5'));}if(!this[_0x8e1e('0xac')](_0x3f7cc1[_0x8e1e('0x4c')])){_0x3f7cc1[_0x8e1e('0x4c')]=0x2;}this[_0x8e1e('0x42')][_0x8e1e('0x70')](this,_0x3f7cc1);return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xc6'),_0x3f7cc1[_0x8e1e('0xc7')],_0x3f7cc1['list_id'],_0x3f7cc1[_0x8e1e('0x49')]));};AGIVertices[_0x8e1e('0x14')]['custom_app']=function(_0x23be1d){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x23be1d[_0x8e1e('0x36')]));var _0x3bbf82=this['channel'][_0x8e1e('0x58')](_0x23be1d[_0x8e1e('0xc8')],_0x23be1d['options']);if(_0x3bbf82[_0x8e1e('0xa8')]===-0x1){return _0x3bbf82;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xc9'),_0x23be1d[_0x8e1e('0xc8')],_0x23be1d[_0x8e1e('0x7a')]));};AGIVertices['prototype'][_0x8e1e('0xca')]=function(_0xaefae6){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xcb'),_0xaefae6[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0xaefae6['text'])){return this[_0x8e1e('0xd')]['noop'](_0x8e1e('0xad'));}var _0x58c2c4='\x22'+_0xaefae6[_0x8e1e('0x5d')]+'\x22';if(this[_0x8e1e('0xac')](_0xaefae6[_0x8e1e('0x7a')])){_0x58c2c4+=','+_0xaefae6[_0x8e1e('0x7a')];}var _0x11a599=this[_0x8e1e('0xd')]['exec'](_0x8e1e('0xae'),_0x58c2c4);if(_0x11a599[_0x8e1e('0xa8')]===-0x1){return _0x11a599;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xb0'),_0x58c2c4));};AGIVertices['prototype']['sestektts']=function(_0x3b0031){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xcc'),_0x3b0031[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x3b0031[_0x8e1e('0x5d')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0xad'));}var _0x2edf57='\x22'+_0x3b0031[_0x8e1e('0x5d')]+'\x22';if(this[_0x8e1e('0xac')](_0x3b0031[_0x8e1e('0x7a')])){_0x2edf57+=','+_0x3b0031['options'];}var _0x34483d=this[_0x8e1e('0xd')]['exec'](_0x8e1e('0xae'),_0x2edf57);if(_0x34483d['result']===-0x1){return _0x34483d;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xb0'),_0x2edf57));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xcd')]=function(_0x2c916b){logger['info'](util['format'](_0x8e1e('0xce'),_0x2c916b[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x2c916b['grammar'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20grammar\x20configured');}var _0x4736af=_0x2c916b[_0x8e1e('0xb3')];if(this[_0x8e1e('0xac')](_0x2c916b[_0x8e1e('0x7a')])){_0x4736af+=','+_0x2c916b['options'];}var _0x203fc6=this[_0x8e1e('0xd')][_0x8e1e('0x58')]('MRCPRecog',_0x4736af);if(_0x203fc6[_0x8e1e('0xa8')]===-0x1){return _0x203fc6;}var _0x37c55e=this['getAndSetVariable'](_0x8e1e('0xb5'),_0x8e1e('0xcf'));if(_0x37c55e[_0x8e1e('0xa8')]===-0x1){return _0x37c55e;}var _0x5e0ac3=this[_0x8e1e('0xa7')](_0x8e1e('0xb7'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x5e0ac3['result']===-0x1){return _0x5e0ac3;}var _0x400f24=this[_0x8e1e('0xa7')](_0x8e1e('0xd0'),_0x8e1e('0xd1'));if(_0x400f24[_0x8e1e('0xa8')]===-0x1){return _0x400f24;}return this[_0x8e1e('0xd')]['noop'](util[_0x8e1e('0x54')](_0x8e1e('0xd2'),_0x4736af));};AGIVertices[_0x8e1e('0x14')]['sestekasr']=function(_0x1a3f7){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0xd3'),_0x1a3f7[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x1a3f7['grammar'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20grammar\x20configured');}var _0x5c9c5e=_0x1a3f7[_0x8e1e('0xb3')];if(this[_0x8e1e('0xac')](_0x1a3f7[_0x8e1e('0x7a')])){_0x5c9c5e+=','+_0x1a3f7[_0x8e1e('0x7a')];}var _0x2a348c=this[_0x8e1e('0xd')]['exec']('MRCPRecog',_0x5c9c5e);if(_0x2a348c[_0x8e1e('0xa8')]===-0x1){return _0x2a348c;}var _0x54884b=this[_0x8e1e('0xa7')](_0x8e1e('0xb5'),_0x8e1e('0xd4'));if(_0x54884b['result']===-0x1){return _0x54884b;}var _0x3d5961=this[_0x8e1e('0xa7')](_0x8e1e('0xb7'),_0x8e1e('0xd5'));if(_0x3d5961[_0x8e1e('0xa8')]===-0x1){return _0x3d5961;}var _0xe93eb=this[_0x8e1e('0xa7')](_0x8e1e('0xd0'),_0x8e1e('0xd6'));if(_0xe93eb['result']===-0x1){return _0xe93eb;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5c9c5e));};AGIVertices[_0x8e1e('0x14')]['database']=function(_0x4b8ac1){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0xd7'),_0x4b8ac1[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x4b8ac1[_0x8e1e('0xd8')])){return this['channel'][_0x8e1e('0x28')](_0x4b8ac1,_0x8e1e('0xd9'));}var _0x3109ce=this[_0x8e1e('0xda')][_0x8e1e('0x70')](this,_0x4b8ac1[_0x8e1e('0xd8')]);if(!_0x3109ce){return this['channel'][_0x8e1e('0x28')](_0x4b8ac1,_0x8e1e('0xdb'));}if(!this[_0x8e1e('0xac')](_0x4b8ac1[_0x8e1e('0x2c')])){return this[_0x8e1e('0xd')]['error'](_0x4b8ac1,_0x8e1e('0xdc'));}var _0x20f95=_0x4b8ac1[_0x8e1e('0x2c')][_0x8e1e('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0x8e1e('0x54')]('query:\x20%s',_0x20f95));var _0x56770b=this['getQueryOdbc'][_0x8e1e('0x70')](this,_0x3109ce,_0x20f95);this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x4b8ac1,_0x20f95);if(!this[_0x8e1e('0xac')](_0x4b8ac1[_0x8e1e('0xdd')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xde'));}var _0x4a2962=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x4b8ac1[_0x8e1e('0xdd')]);if(!_0x4a2962){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x4b8ac1,_0x8e1e('0xdf'));}var _0x231496=this;_0x56770b['forEach'](function(_0x191b88,_0x83fc1d){Object[_0x8e1e('0xe0')](_0x191b88)['forEach'](function(_0x4ad69d){_0x231496['channel']['setVariable'](util['format'](_0x8e1e('0xe1'),_0x4a2962,_0x83fc1d,_0x4ad69d),_0x191b88[_0x4ad69d]);});});this['channel'][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0xe2'),_0x4a2962),_0x56770b[_0x8e1e('0xa2')]);return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format']('variable\x20%s\x20set',_0x4a2962));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xe3')]=function(_0x17e2ad){logger[_0x8e1e('0xe4')](util['format'](_0x8e1e('0xe5'),_0x17e2ad[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x17e2ad[_0x8e1e('0xe6')])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x17e2ad,_0x8e1e('0xe7'));}var _0xa119ca=this[_0x8e1e('0xe8')][_0x8e1e('0x70')](this,_0x17e2ad[_0x8e1e('0xe6')]);if(!_0xa119ca){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x17e2ad,'no\x20user\x20found');}var _0x2ed616=this[_0x8e1e('0xd')][_0x8e1e('0x58')](_0x8e1e('0xe9'),[util['format'](_0x8e1e('0xea'),_0xa119ca),_0x17e2ad['timeout'],_0x17e2ad[_0x8e1e('0xeb')],_0x17e2ad['url']]);if(_0x2ed616[_0x8e1e('0xa8')]===-0x1){return _0x2ed616;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format'](_0x8e1e('0xec'),_0x8e1e('0xe9')));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xed')]=function(_0x3c1903){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xee'),_0x3c1903[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x3c1903[_0x8e1e('0x84')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20key\x20configured');}if(!this[_0x8e1e('0xac')](_0x3c1903['text'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x8e1e('0x34')](_0x3c1903);this[_0x8e1e('0x41')](_0x3c1903['text'],'in','','');this['channel'][_0x8e1e('0xaf')](util['format'](_0x8e1e('0xef'),_0x3c1903[_0x8e1e('0x5d')]));var _0x21178f=this[_0x8e1e('0x7b')]['sync'](this,_0x3c1903);if(_0x21178f){for(var _0x386ce2 in _0x21178f){if(_0x21178f[_0x8e1e('0xa0')](_0x386ce2)){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util['format'](_0x8e1e('0xf0'),_0x386ce2[_0x8e1e('0x6a')]()),_0x21178f[_0x386ce2]);}}this[_0x8e1e('0x41')](_0x21178f['speech'],_0x8e1e('0xf1'),_0x8e1e('0xed'),'');return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xf2'),_0x21178f['speech']));}return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x3c1903,_0x8e1e('0xf3'));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xf4')]=function(_0x15af23){logger['info'](util[_0x8e1e('0x54')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x15af23[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x15af23['dialogflowV2_project_id'])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0xf5'));}if(!this[_0x8e1e('0xac')](_0x15af23[_0x8e1e('0x7f')])){return this['channel']['noop'](_0x8e1e('0xf6'));}if(!this['isConfigured'](_0x15af23[_0x8e1e('0x80')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0xf7'));}if(!this[_0x8e1e('0xac')](_0x15af23['dialogflowV2_language'])){return this['channel']['noop'](_0x8e1e('0xf8'));}if(!this[_0x8e1e('0xac')](_0x15af23['text'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xad'));}this['channel'][_0x8e1e('0xf9')]=!![];this[_0x8e1e('0x34')](_0x15af23);this[_0x8e1e('0x41')](_0x15af23[_0x8e1e('0x5d')],'in','','');this['channel']['noop'](util[_0x8e1e('0x54')](_0x8e1e('0xfa'),_0x15af23[_0x8e1e('0x5d')]));var _0x508d67=this[_0x8e1e('0x7d')]['sync'](this,_0x15af23);if(_0x508d67){for(var _0x4fcf81 in _0x508d67){if(_0x508d67['hasOwnProperty'](_0x4fcf81)){if(_0x4fcf81!=='providerResponse'){this[_0x8e1e('0xd')]['setVariable'](util[_0x8e1e('0x54')]('DIALOGFLOW_%s',_0x4fcf81[_0x8e1e('0x6a')]()),_0x508d67[_0x4fcf81]);}}}this[_0x8e1e('0x41')](_0x508d67[_0x8e1e('0xfb')],_0x8e1e('0xf1'),_0x8e1e('0xf4'),_0x508d67['providerResponse']);return this[_0x8e1e('0xd')]['noop'](util[_0x8e1e('0x54')](_0x8e1e('0xfc'),_0x508d67[_0x8e1e('0xfb')]));}return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x15af23,_0x8e1e('0xfd'));};AGIVertices['prototype'][_0x8e1e('0xfe')]=function(_0x43d19c){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0xff'),_0x43d19c[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x43d19c['ndauth_url'])){return this['channel']['noop'](_0x8e1e('0x100'));}if(!this[_0x8e1e('0xac')](_0x43d19c[_0x8e1e('0x101')])){return this[_0x8e1e('0xd')]['noop'](_0x8e1e('0x102'));}if(!this[_0x8e1e('0xac')](_0x43d19c['password'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x103'));}if(!this['isConfigured'](_0x43d19c[_0x8e1e('0x104')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xad'));}this[_0x8e1e('0xd')][_0x8e1e('0xf9')]=!![];this[_0x8e1e('0x34')](_0x43d19c);this[_0x8e1e('0x41')](_0x43d19c['text'],'in','','');this[_0x8e1e('0xd')]['noop'](util['format'](_0x8e1e('0x105'),_0x43d19c[_0x8e1e('0x5d')]));var _0x50b587=this[_0x8e1e('0x82')][_0x8e1e('0x70')](this,_0x43d19c);if(_0x50b587){for(var _0x337174 in _0x50b587){if(_0x50b587[_0x8e1e('0xa0')](_0x337174)){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0x106'),_0x337174[_0x8e1e('0x6a')]()),_0x50b587[_0x337174]);}}this[_0x8e1e('0x41')](_0x50b587[_0x8e1e('0xfb')],'out',_0x8e1e('0xfe'),'');if(_0x50b587[_0x8e1e('0x107')]){this[_0x8e1e('0xd')]['noop'](util[_0x8e1e('0x54')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x50b587[_0x8e1e('0x107')]));var _0x356f5d=this[_0x8e1e('0xd')][_0x8e1e('0x108')](_0x50b587[_0x8e1e('0x107')]);try{fs[_0x8e1e('0x109')](_0x50b587[_0x8e1e('0x107')]+_0x8e1e('0x10a'));}catch(_0x2762e0){logger['error'](_0x2762e0);}return _0x356f5d;}else{return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format']('SestekNDA\x20Result\x20%s',_0x50b587[_0x8e1e('0xfb')]));}}return this['channel'][_0x8e1e('0x28')](_0x43d19c,_0x8e1e('0x10b'));};AGIVertices['prototype'][_0x8e1e('0x10c')]=function(_0x11dc32){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x10d'),_0x11dc32[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x10c'));};AGIVertices['prototype'][_0x8e1e('0x10e')]=function(_0x355ab9){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x10f'),_0x355ab9[_0x8e1e('0x36')]));var _0x148b82='';if(_0x355ab9[_0x8e1e('0x110')]){if(!this[_0x8e1e('0xac')](_0x355ab9['trunk_id'])){return this[_0x8e1e('0xd')]['error'](_0x355ab9,_0x8e1e('0x111'));}else{var _0xf93da0=parseInt(_0x355ab9['trunk_id'],0xa);if(isNaN(_0xf93da0)){_0x148b82=_0x355ab9[_0x8e1e('0x110')];}else{_0x148b82=this['getTrunk'][_0x8e1e('0x70')](this,_0x355ab9['trunk_id']);if(!_0x148b82){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x355ab9,_0x8e1e('0x112'));}}}}else if(_0x355ab9[_0x8e1e('0x113')]){_0x148b82=_0x355ab9[_0x8e1e('0x113')];}else{return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x355ab9,_0x8e1e('0x111'));}var _0x596334=this[_0x8e1e('0xd')]['exec'](_0x8e1e('0xe9'),[util[_0x8e1e('0x54')](_0x8e1e('0x114'),_0x148b82,_0x355ab9['phone']),_0x355ab9[_0x8e1e('0x66')],_0x355ab9[_0x8e1e('0xeb')],_0x355ab9[_0x8e1e('0x73')]]);if(_0x596334[_0x8e1e('0xa8')]===-0x1){return _0x596334;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xec'),_0x8e1e('0xe9')));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x115')]=function(_0x3c5c75){logger['info'](util['format'](_0x8e1e('0x116'),_0x3c5c75[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')]['noop'](_0x8e1e('0x115'));};AGIVertices['prototype'][_0x8e1e('0xb')]=function(_0x7409fe){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x117'),_0x7409fe['label']));if(_0x7409fe[_0x8e1e('0xaa')]===0x0){return this[_0x8e1e('0xa9')](_0x7409fe);}_0x7409fe[_0x8e1e('0xaa')]-=0x1;if(!this['isConfigured'](_0x7409fe[_0x8e1e('0x118')])){return this['channel'][_0x8e1e('0x28')](_0x7409fe,_0x8e1e('0x119'));}var _0x40bdde=this[_0x8e1e('0x1c')][_0x8e1e('0x70')](this,_0x7409fe['file_id']);if(!_0x40bdde){return this['channel'][_0x8e1e('0x28')](_0x7409fe,'no\x20file\x20audio\x20found');}if(!this[_0x8e1e('0xac')](_0x7409fe[_0x8e1e('0xdd')])){return this['channel'][_0x8e1e('0x28')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1b9172=this[_0x8e1e('0xd')][_0x8e1e('0x11a')](_0x40bdde,_0x7409fe[_0x8e1e('0x11b')],_0x7409fe['maxdigit']);var _0x35e28f=_0x1b9172[_0x8e1e('0xa8')]?_0x1b9172[_0x8e1e('0xa8')][_0x8e1e('0x4b')]():'';logger[_0x8e1e('0x2a')](_0x8e1e('0x11c'),JSON[_0x8e1e('0x75')](_0x1b9172));if(_0x1b9172[_0x8e1e('0xa8')]===-0x1){this[_0x8e1e('0x34')]['sync'](this,_0x7409fe,_0x35e28f);return _0x1b9172;}else if(_0x1b9172[_0x8e1e('0xa6')]===_0x8e1e('0x66')){_0x1b9172[_0x8e1e('0xa8')]=_0x35e28f[_0x8e1e('0xa2')]>=parseInt(_0x7409fe[_0x8e1e('0x11d')])?'x':'i';}else{_0x1b9172[_0x8e1e('0xa8')]=_0x35e28f[_0x8e1e('0xa2')]>=parseInt(_0x7409fe[_0x8e1e('0x11d')])&&_0x35e28f[_0x8e1e('0xa2')]<=parseInt(_0x7409fe['maxdigit'])?'x':'i';}var _0x588a6e=this[_0x8e1e('0xf')]['sync'](this,_0x7409fe['variable_id']);if(!_0x588a6e){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x7409fe,'no\x20variable\x20found');}this[_0x8e1e('0xd')]['setVariable'](_0x588a6e,_0x35e28f);if(this[_0x8e1e('0xac')](_0x7409fe[_0x8e1e('0x11e')])){var _0x41a1e1=parseInt(_0x7409fe[_0x8e1e('0x11e')],0xa);var _0x3fb234=rs[_0x8e1e('0x11f')]({'charset':'*','length':_0x41a1e1});var _0x1b3faa=_0x35e28f[_0x8e1e('0xa2')];if(_0x1b3faa>0x0){if(_0x1b3faa>_0x41a1e1){this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x7409fe,_0x7409fe[_0x8e1e('0x120')]===_0x8e1e('0x121')?_0x3fb234+_0x35e28f['substr'](_0x41a1e1):_0x35e28f[_0x8e1e('0x122')](0x0,_0x1b3faa-_0x41a1e1)+_0x3fb234);}else{this['createSquareDetailsReport'][_0x8e1e('0x70')](this,_0x7409fe,rs[_0x8e1e('0x11f')]({'charset':'*','length':_0x1b3faa}));}}else{this['createSquareDetailsReport']['sync'](this,_0x7409fe,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x7409fe,_0x35e28f);}return _0x1b9172;};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xc')]=function(_0x1394cc){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x123'),_0x1394cc['label']));return this[_0x8e1e('0xb')](_0x1394cc);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x124')]=function(_0x41f6df){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x125'),_0x41f6df['label']));this['createSquareDetailsReport']['sync'](this,_0x41f6df,_0x41f6df[_0x8e1e('0x126')]);return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x127'),_0x41f6df['goalname']));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x128')]=function(_0x144267){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x129'),_0x144267[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x144267['aws_access_key_id'])||!this[_0x8e1e('0xac')](_0x144267[_0x8e1e('0x8a')])){return this[_0x8e1e('0xd')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x8e1e('0xac')](_0x144267[_0x8e1e('0x5d')])){return this[_0x8e1e('0xd')]['noop'](_0x8e1e('0xad'));}this['channel']['noop'](util[_0x8e1e('0x54')](_0x8e1e('0x12a'),_0x144267[_0x8e1e('0x5d')]));var _0x36001b=this['awsPolly'][_0x8e1e('0x70')](this,_0x144267);if(_0x36001b){this['channel'][_0x8e1e('0xaf')](util['format'](_0x8e1e('0x12b'),_0x36001b));var _0x40dbca=this[_0x8e1e('0xd')][_0x8e1e('0x108')](_0x36001b);try{fs[_0x8e1e('0x109')](_0x36001b+_0x8e1e('0x10a'));}catch(_0x4ddce6){logger[_0x8e1e('0x28')](_0x4ddce6);}return _0x40dbca;}return this['channel'][_0x8e1e('0x28')](_0x144267,_0x8e1e('0x12c'));};AGIVertices[_0x8e1e('0x14')]['awslex']=function(_0x15434a){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x12d'),_0x15434a[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x15434a[_0x8e1e('0x90')])||!this['isConfigured'](_0x15434a[_0x8e1e('0x8a')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x12e'));}if(!this[_0x8e1e('0xac')](_0x15434a['aws_bot_name'])){return this[_0x8e1e('0xd')]['noop'](_0x8e1e('0x12f'));}if(!this['isConfigured'](_0x15434a[_0x8e1e('0x5d')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0xad'));}this[_0x8e1e('0xd')]['bot']=!![];this[_0x8e1e('0x34')](_0x15434a);this['createSquareMessage'](_0x15434a['text'],'in','','');this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x130'),_0x15434a[_0x8e1e('0x5d')]));var _0x383d23=this[_0x8e1e('0x8f')]['sync'](this,_0x15434a);if(_0x383d23){for(var _0xabf58c in _0x383d23){if(_0x383d23[_0x8e1e('0xa0')](_0xabf58c)&&_['isString'](_0x383d23[_0xabf58c])){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util['format'](_0x8e1e('0x131'),_0xabf58c[_0x8e1e('0x6a')]()),_0x383d23[_0xabf58c]);}}if(_['isNil'](_0x383d23[_0x8e1e('0x132')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x133'));}else{this[_0x8e1e('0x41')](_0x383d23['message'],_0x8e1e('0xf1'),_0x8e1e('0x134'),'');return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('Amazon\x20Lex\x20Result\x20%s',_0x383d23['message']));}}return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x15434a,_0x8e1e('0x135'));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x136')]=function(_0x4a0c97){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x137'),_0x4a0c97[_0x8e1e('0x36')],_0x4a0c97['timeout']));if(!this['isConfigured'](_0x4a0c97['key'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20key\x20configured');}var _0x4efda5='wav';var _0x4421ee=util[_0x8e1e('0x54')]('%s/recordings/%s',FILES_PATH,rs[_0x8e1e('0x11f')](0x4));var _0x3f72a5=util[_0x8e1e('0x54')](_0x8e1e('0xa1'),_0x4421ee,_0x4efda5);var _0x5a5f66=!![];if(_0x4a0c97[_0x8e1e('0x138')]==='NOBEEP'){_0x5a5f66=![];}var _0x43a570=this[_0x8e1e('0xd')][_0x8e1e('0x139')](_0x4421ee,_0x4efda5,_0x4a0c97[_0x8e1e('0x13a')],_0x4a0c97[_0x8e1e('0x66')],undefined,_0x5a5f66);if(_0x43a570['result']!==-0x1){this['channel']['noop'](util[_0x8e1e('0x54')](_0x8e1e('0x13b'),_0x3f72a5));var _0xaacb5c=this['googleASR'][_0x8e1e('0x70')](this,_0x4a0c97,_0x3f72a5);if(_0xaacb5c){for(var _0x193d97 in _0xaacb5c){if(_0xaacb5c[_0x8e1e('0xa0')](_0x193d97)){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0x13c'),_0x193d97['toUpperCase']()),_0xaacb5c[_0x193d97]);}}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x13d'),JSON['stringify'](_0xaacb5c)));}}return _0x43a570;};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x13e')]=function(_0x216ff7){logger['info'](util['format'](_0x8e1e('0x13f'),_0x216ff7[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x216ff7[_0x8e1e('0x96')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x140'));}if(!this[_0x8e1e('0xac')](_0x216ff7[_0x8e1e('0x141')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x142'));}var _0x25f8f5=_0x8e1e('0x143');var _0xf857ff=util[_0x8e1e('0x54')]('%s/recordings/%s',FILES_PATH,rs[_0x8e1e('0x11f')](0x4));var _0x121022=util[_0x8e1e('0x54')](_0x8e1e('0xa1'),_0xf857ff,_0x25f8f5);var _0x2d9e26=!![];if(_0x216ff7[_0x8e1e('0x138')]===_0x8e1e('0x144')){_0x2d9e26=![];}var _0x1581b5=this[_0x8e1e('0xd')][_0x8e1e('0x139')](_0xf857ff,_0x25f8f5,_0x216ff7[_0x8e1e('0x13a')],_0x216ff7[_0x8e1e('0x66')],undefined,_0x2d9e26);if(_0x1581b5[_0x8e1e('0xa8')]!==-0x1){this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format'](_0x8e1e('0x145'),_0x121022));var _0x2e83e2=this[_0x8e1e('0x95')]['sync'](this,_0x216ff7,_0x121022);if(_0x2e83e2){for(var _0x30e1ef in _0x2e83e2){if(_0x2e83e2[_0x8e1e('0xa0')](_0x30e1ef)){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0x146'),_0x30e1ef[_0x8e1e('0x6a')]()),_0x2e83e2[_0x30e1ef]);}}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('TildeASR\x20Result\x20%s',JSON[_0x8e1e('0x75')](_0x2e83e2)));}}return _0x1581b5;};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x147')]=function(_0x27946c){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x148'),_0x27946c[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')][_0x8e1e('0x149')](_0x27946c[_0x8e1e('0x3c')],_0x27946c['extension'],_0x27946c[_0x8e1e('0x14a')]);};AGIVertices['prototype'][_0x8e1e('0x14b')]=function(_0x20ad4b){logger['info'](util[_0x8e1e('0x54')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x20ad4b['label']));if(!this[_0x8e1e('0xac')](_0x20ad4b[_0x8e1e('0x14c')])){return this['channel']['error'](_0x20ad4b,'no\x20condition\x20configured');}try{var _0x361b64=eval(_0x20ad4b[_0x8e1e('0x14c')])?_0x8e1e('0x14d'):'false';this['channel']['noop'](util[_0x8e1e('0x54')](_0x8e1e('0x14e'),_0x20ad4b[_0x8e1e('0x14c')],_0x361b64));return{'code':0xc8,'result':_0x361b64};}catch(_0x267938){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x14f')]=function(_0x2c0cfb){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x2c0cfb['label']));if(!this[_0x8e1e('0xac')](_0x2c0cfb[_0x8e1e('0x150')])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x2c0cfb,_0x8e1e('0x151'));}var _0x3b6ecf=this['getIntervals'][_0x8e1e('0x70')](this,_0x2c0cfb[_0x8e1e('0x150')]);if(!_0x3b6ecf){return this[_0x8e1e('0xd')]['error'](_0x2c0cfb,_0x8e1e('0x152'));}for(var _0x1f544d=0x0;_0x1f544d<_0x3b6ecf[_0x8e1e('0xa2')];_0x1f544d+=0x1){var _0x385258=this['channel'][_0x8e1e('0xf')](util[_0x8e1e('0x54')](_0x8e1e('0x153'),_0x3b6ecf[_0x1f544d]));if(_0x385258[_0x8e1e('0xa8')]===-0x1){return _0x385258;}logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('IFTIME\x20%s\x20%s',_0x3b6ecf[_0x1f544d],_0x385258[_0x8e1e('0xa6')]));if(_0x385258[_0x8e1e('0xa6')]===_0x8e1e('0x14d')){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('IFTIME\x20%s\x20%s',_0x3b6ecf[_0x1f544d],'true'));this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x154'),_0x3b6ecf[_0x1f544d],_0x8e1e('0x14d')));return{'code':0xc8,'result':_0x8e1e('0x14d')};}else{logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x154'),_0x3b6ecf[_0x1f544d],_0x8e1e('0x155')));this['channel']['noop'](util['format'](_0x8e1e('0x154'),_0x3b6ecf[_0x1f544d],_0x8e1e('0x155')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x156')]=function(_0x3e6fb9){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x157'),_0x3e6fb9[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')][_0x8e1e('0x156')]();};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x158')]=function(_0x4a862a){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x159'),_0x4a862a[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x4a862a['key'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x15a'));}var _0x51eb82='wav';var _0x387344=util[_0x8e1e('0x54')](_0x8e1e('0x15b'),FILES_PATH,rs[_0x8e1e('0x11f')](0x4));var _0x51c22f=util[_0x8e1e('0x54')](_0x8e1e('0xa1'),_0x387344,_0x51eb82);var _0x3610ac=!![];if(_0x4a862a[_0x8e1e('0x138')]==='NOBEEP'){_0x3610ac=![];}var _0x531df3=this['channel'][_0x8e1e('0x139')](_0x387344,_0x51eb82,_0x4a862a[_0x8e1e('0x13a')],_0x4a862a[_0x8e1e('0x66')],undefined,_0x3610ac);if(_0x531df3['result']!==-0x1){this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x15c'),_0x51c22f));var _0x586926=this[_0x8e1e('0x87')][_0x8e1e('0x70')](this,_0x4a862a,_0x51c22f);if(_0x586926){for(var _0x34e847 in _0x586926){if(_0x586926[_0x8e1e('0xa0')](_0x34e847)){this['channel'][_0x8e1e('0xa3')](util[_0x8e1e('0x54')]('ISPEECH_ASR_%s',_0x34e847[_0x8e1e('0x6a')]()),_0x586926[_0x34e847]);}}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x15d'),JSON['stringify'](_0x586926)));}}return _0x531df3;};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x15e')]=function(_0x58452c){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x15f'),_0x58452c['label']));if(!this['isConfigured'](_0x58452c[_0x8e1e('0x84')])){return this['channel'][_0x8e1e('0xaf')]('no\x20key\x20configured');}if(!this[_0x8e1e('0xac')](_0x58452c[_0x8e1e('0x5d')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20text\x20configured');}this[_0x8e1e('0xd')]['noop'](util['format'](_0x8e1e('0x160'),_0x58452c[_0x8e1e('0x5d')]));var _0x57f964=this[_0x8e1e('0x83')][_0x8e1e('0x70')](this,_0x58452c);if(_0x57f964){this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x15c'),_0x57f964));var _0x20a5c3=this[_0x8e1e('0xd')][_0x8e1e('0x108')](_0x57f964,_0x58452c[_0x8e1e('0x13a')]);try{fs[_0x8e1e('0x109')](_0x57f964+_0x8e1e('0x10a'));}catch(_0x4fd2d5){logger[_0x8e1e('0x28')](_0x4fd2d5);}return _0x20a5c3;}return this[_0x8e1e('0xd')]['error'](_0x58452c,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x8e1e('0x14')]['login']=function(_0x342fc2){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x161'),_0x342fc2[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x342fc2[_0x8e1e('0x162')])){return this['channel'][_0x8e1e('0x28')](_0x342fc2,_0x8e1e('0x163'));}logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x164'),this[_0x8e1e('0xd')]['callerid'],_0x342fc2[_0x8e1e('0x162')]));var _0x4ef528=this['agentLogin']['sync'](this,_0x342fc2['findBy']);if(_0x4ef528){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x165'),this[_0x8e1e('0xd')]['callerid'],_0x342fc2[_0x8e1e('0x162')]));this[_0x8e1e('0xd')]['noop'](util['format'](_0x8e1e('0x165'),this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x342fc2[_0x8e1e('0x162')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x8e1e('0x39')],_0x342fc2[_0x8e1e('0x162')]));this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x166'),this['channel'][_0x8e1e('0x39')],_0x342fc2[_0x8e1e('0x162')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8e1e('0x14')]['logout']=function(_0x253699){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x167'),_0x253699[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x253699['findBy'])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x253699,'no\x20find\x20by\x20configured');}logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x164'),this[_0x8e1e('0xd')]['callerid'],_0x253699[_0x8e1e('0x162')]));var _0x5bbf48=this[_0x8e1e('0x51')]['sync'](this,_0x253699[_0x8e1e('0x162')]);if(_0x5bbf48){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x165'),this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x253699[_0x8e1e('0x162')]));this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x165'),this['channel'][_0x8e1e('0x39')],_0x253699[_0x8e1e('0x162')]));return{'code':0xc8,'result':_0x8e1e('0x168')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x8e1e('0x39')],_0x253699[_0x8e1e('0x162')]));this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x166'),this['channel'][_0x8e1e('0x39')],_0x253699['findBy']));return{'code':0xc8,'result':_0x8e1e('0x169')};}};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x16a')]=function(_0x4e10ed){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x16b'),_0x4e10ed['label']));if(!this['isConfigured'](_0x4e10ed[_0x8e1e('0x16c')])){return this[_0x8e1e('0xd')]['error'](_0x4e10ed,_0x8e1e('0x16d'));}this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('math\x20%s',_0x4e10ed[_0x8e1e('0x16c')]));var _0x18a0ad=eval(_0x4e10ed[_0x8e1e('0x16c')]);if(!this[_0x8e1e('0xac')](_0x4e10ed[_0x8e1e('0xdd')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xde'));}var _0xcc6d9c=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x4e10ed[_0x8e1e('0xdd')]);if(!_0xcc6d9c){return this['channel'][_0x8e1e('0x28')](_0x4e10ed,_0x8e1e('0xdf'));}if(_[_0x8e1e('0x9d')](_0x18a0ad)){var _0x1d332e=this;_0x18a0ad['forEach'](function(_0xdf163f,_0x48337d){_0x1d332e['channel'][_0x8e1e('0xa3')](util['format'](_0x8e1e('0x16e'),_0xcc6d9c,_0x48337d),_0xdf163f);});return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x16f'),_0xcc6d9c));}else{return this[_0x8e1e('0xd')][_0x8e1e('0xa3')](_0xcc6d9c,_0x18a0ad);}};AGIVertices['prototype'][_0x8e1e('0xa')]=function(_0x230a87){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x170'),_0x230a87[_0x8e1e('0x36')]));if(_0x230a87['retry']===0x0){return this[_0x8e1e('0xa9')](_0x230a87);}_0x230a87[_0x8e1e('0xaa')]-=0x1;if(!this['isConfigured'](_0x230a87[_0x8e1e('0x118')])){return this[_0x8e1e('0xd')]['error'](_0x230a87,_0x8e1e('0x119'));}var _0x1dcaa5=this[_0x8e1e('0x1c')][_0x8e1e('0x70')](this,_0x230a87[_0x8e1e('0x118')]);if(!_0x1dcaa5){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x230a87,'no\x20file\x20audio\x20found');}var _0x466520=this[_0x8e1e('0xd')][_0x8e1e('0x11a')](_0x1dcaa5,_0x230a87[_0x8e1e('0x11b')],_0x230a87[_0x8e1e('0x171')]);var _0x485396=_0x466520[_0x8e1e('0xa8')];if(_0x466520['result']===-0x1){this['createSquareDetailsReport'][_0x8e1e('0x70')](this,_0x230a87,'-1');return _0x466520;}else if(_0x466520[_0x8e1e('0xa6')]===_0x8e1e('0x66')){_0x466520[_0x8e1e('0xa8')]=_0x466520[_0x8e1e('0xa8')][_0x8e1e('0xa2')]>0x0?_0x466520['result']:'t';}else if(_[_0x8e1e('0x43')](_0x466520[_0x8e1e('0xa8')])){_0x466520['result']='#';_0x485396='#';}if(!this['isConfigured'](_0x230a87[_0x8e1e('0xdd')])){this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x19d97c=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x230a87[_0x8e1e('0xdd')]);if(!_0x19d97c){return this['channel'][_0x8e1e('0x28')](_0x230a87,_0x8e1e('0xdf'));}this['channel']['setVariable'](_0x19d97c,_0x485396);}this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x230a87,_0x485396);return _0x466520;};AGIVertices['prototype'][_0x8e1e('0xaf')]=function(_0x5b5d7f){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x172'),_0x5b5d7f[_0x8e1e('0x36')]));return this['channel'][_0x8e1e('0xaf')](_0x5b5d7f[_0x8e1e('0x173')]||_0x5b5d7f[_0x8e1e('0x36')]);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x174')]=function(_0x497c17){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x175'),_0x497c17[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x497c17[_0x8e1e('0x162')])){return this[_0x8e1e('0xd')]['error'](_0x497c17,'no\x20find\x20by\x20configured');}logger['info'](util[_0x8e1e('0x54')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x497c17[_0x8e1e('0x162')]));var _0xf79115=this[_0x8e1e('0x4d')][_0x8e1e('0x70')](this,_0x497c17[_0x8e1e('0x176')]);var _0x4bfa04=this[_0x8e1e('0x4e')][_0x8e1e('0x70')](this,_0x497c17['findBy'],_0xf79115);if(_0x4bfa04){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x165'),this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x497c17['findBy']));this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format'](_0x8e1e('0x165'),this['channel']['callerid'],_0x497c17[_0x8e1e('0x162')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x8e1e('0x39')],_0x497c17['findBy']));this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format'](_0x8e1e('0x165'),this[_0x8e1e('0xd')]['callerid'],_0x497c17['findBy']));return{'code':0xc8,'result':_0x8e1e('0x169')};}};AGIVertices[_0x8e1e('0x14')]['playback']=function(_0xdbbacf){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x177'),_0xdbbacf['label']));if(!this[_0x8e1e('0xac')](_0xdbbacf[_0x8e1e('0x118')])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0xdbbacf,_0x8e1e('0x119'));}var _0x476d74=this['getSound'][_0x8e1e('0x70')](this,_0xdbbacf[_0x8e1e('0x118')]);if(!_0x476d74){return this['channel'][_0x8e1e('0x28')](_0xdbbacf,_0x8e1e('0x178'));}var _0x3023aa=this[_0x8e1e('0xd')][_0x8e1e('0x58')](_0x8e1e('0x179'),[_0x476d74,_0xdbbacf[_0x8e1e('0xeb')]]);if(_0x3023aa[_0x8e1e('0xa8')]===-0x1){return _0x3023aa;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xc9'),_0x8e1e('0x179'),_0x476d74));};AGIVertices['prototype']['queue']=function(_0x3b4b68){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x17a'),_0x3b4b68['label']));if(!this[_0x8e1e('0xac')](_0x3b4b68[_0x8e1e('0x17b')])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x3b4b68,_0x8e1e('0x17c'));}var _0x12876b='';var _0x3199b6=parseInt(_0x3b4b68[_0x8e1e('0x17b')],0xa);if(isNaN(_0x3199b6)){_0x12876b=_0x3b4b68[_0x8e1e('0x17b')];}else{_0x12876b=this[_0x8e1e('0x15')][_0x8e1e('0x70')](this,_0x3b4b68[_0x8e1e('0x17b')]);if(!_0x12876b){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x3b4b68,'no\x20queue\x20found');}}var _0x313549='';if(this[_0x8e1e('0xac')](_0x3b4b68[_0x8e1e('0x118')])){var _0x1636d7=this[_0x8e1e('0x1c')][_0x8e1e('0x70')](this,_0x3b4b68[_0x8e1e('0x118')]);if(_0x1636d7){_0x313549=_0x1636d7;}}this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x3b4b68,_0x12876b);if(_0x3b4b68['opts'][_0x8e1e('0x17d')]('x')<0x0){_0x3b4b68[_0x8e1e('0xeb')]+='x';}if(_0x3b4b68[_0x8e1e('0xeb')][_0x8e1e('0x17d')]('X')<0x0){_0x3b4b68[_0x8e1e('0xeb')]+='X';}this['channel'][_0x8e1e('0xa3')]('XMCS-QUEUE',_0x12876b?_0x12876b['toLowerCase']():'');var _0x39fab6=this[_0x8e1e('0xd')]['exec'](_0x8e1e('0x17e'),[_0x12876b,_0x3b4b68['opts'],_0x3b4b68[_0x8e1e('0x73')],_0x313549,_0x3b4b68[_0x8e1e('0x66')],_0x3b4b68[_0x8e1e('0xb9')],_0x3b4b68[_0x8e1e('0x17f')],_0x3b4b68[_0x8e1e('0x180')],'',_0x3b4b68[_0x8e1e('0x181')]]);if(_0x39fab6['result']===-0x1){return _0x39fab6;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('Executed\x20command\x20%s\x20%s',_0x8e1e('0x17e'),_0x12876b));};AGIVertices['prototype']['record']=function(_0x2d084d){logger['info'](util['format'](_0x8e1e('0x182'),_0x2d084d[_0x8e1e('0x36')]));var _0x1d7e97=_0x2d084d[_0x8e1e('0x183')]||_0x8e1e('0x143');var _0x426da2=util[_0x8e1e('0x54')](_0x8e1e('0x184'),this[_0x8e1e('0xd')]['uniqueid'],rs[_0x8e1e('0x11f')](0x5));var _0x497ed0=util[_0x8e1e('0x54')](_0x8e1e('0x185'),FILES_PATH,_0x426da2,_0x1d7e97);var _0x3104e3=util[_0x8e1e('0x54')](_0x8e1e('0x15b'),FILES_PATH,_0x426da2);this[_0x8e1e('0x3a')][_0x8e1e('0x70')](this,_0x2d084d,_0x426da2,_0x497ed0);this[_0x8e1e('0xd')][_0x8e1e('0xa3')]('RECORDING_SAVENAME',_0x426da2);logger[_0x8e1e('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x3104e3,_0x1d7e97,_0x2d084d[_0x8e1e('0x186')],_0x2d084d[_0x8e1e('0x66')]);return this[_0x8e1e('0xd')][_0x8e1e('0x139')](_0x3104e3,_0x1d7e97,_0x2d084d[_0x8e1e('0x186')],_0x2d084d['timeout'],undefined,!![]);};AGIVertices['prototype'][_0x8e1e('0x187')]=function(_0x1f0a86){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x188'),_0x1f0a86[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x1f0a86[_0x8e1e('0x73')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x189'));}var _0x5328aa=this[_0x8e1e('0x63')][_0x8e1e('0x70')](this,_0x1f0a86);logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x18a'),util[_0x8e1e('0x18b')](_0x5328aa,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x1f0a86[_0x8e1e('0xdd')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x18c'));}var _0x13869b=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x1f0a86['variable_id']);if(!_0x13869b){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x1f0a86,_0x8e1e('0xdf'));}this['channel'][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0x18d'),_0x13869b),_0x5328aa['statusCode']?_0x5328aa[_0x8e1e('0x78')]:_0x8e1e('0x18e'));this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util['format']('%s_STATUS_MESSAGE',_0x13869b),_0x5328aa[_0x8e1e('0x77')]?_0x5328aa[_0x8e1e('0x77')]:'OK');if(_0x5328aa[_0x8e1e('0x6b')]){try{this[_0x8e1e('0x9f')](_0x5328aa[_0x8e1e('0x6b')],_0x13869b);}catch(_0x4f208a){logger[_0x8e1e('0x28')](util[_0x8e1e('0x54')](_0x8e1e('0x18f'),_0x13869b));}}return this['channel']['noop'](util['format'](_0x8e1e('0x190'),_0x13869b));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x191')]=function(_0x1f13b5){logger['info'](util['format'](_0x8e1e('0x192'),_0x1f13b5[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')][_0x8e1e('0x193')](_0x1f13b5[_0x8e1e('0x194')][_0x8e1e('0x5a')](/\s+/g,''),_0x1f13b5[_0x8e1e('0x186')]);};AGIVertices['prototype'][_0x8e1e('0x195')]=function(_0x2d7784){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x196'),_0x2d7784['label']));return this[_0x8e1e('0xd')][_0x8e1e('0x197')](_0x2d7784[_0x8e1e('0x65')][_0x8e1e('0x5a')](/\s+/g,''),_0x2d7784[_0x8e1e('0x186')]);};AGIVertices['prototype']['sayphonetic']=function(_0x4fc6e1){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x198'),_0x4fc6e1['label']));return this[_0x8e1e('0xd')][_0x8e1e('0x199')](_0x4fc6e1[_0x8e1e('0x5d')],_0x4fc6e1[_0x8e1e('0x186')]);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x19a')]=function(_0x113b07){logger['info'](util[_0x8e1e('0x54')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x113b07['label']));if(!this['isConfigured'](_0x113b07[_0x8e1e('0x19b')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x19c'));}var _0x55ed99=this['getMailAccount']['sync'](this,_0x113b07['account_id']);if(!_0x55ed99||!_0x55ed99[_0x8e1e('0x19d')]){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x113b07,'no\x20mail\x20account\x20found');}var _0x225cec={'from':util['format'](_0x8e1e('0x19e'),_0x55ed99['name'],_0x55ed99[_0x8e1e('0x19f')]||_0x55ed99[_0x8e1e('0x19d')][_0x8e1e('0x1a0')]),'to':_0x113b07['to']||'','cc':_0x113b07['cc']||'','bcc':_0x113b07[_0x8e1e('0x1a1')]||'','subject':_0x113b07[_0x8e1e('0x1a2')],'html':_0x113b07[_0x8e1e('0x5d')],'text':_0x113b07[_0x8e1e('0x5d')]};if(this[_0x8e1e('0xac')](_0x113b07[_0x8e1e('0x1a3')])){}logger[_0x8e1e('0xe4')]('sendMail\x20message',JSON[_0x8e1e('0x75')](_0x225cec));this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x113b07,_0x113b07[_0x8e1e('0x19b')]);this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x1a4'),_0x55ed99[_0x8e1e('0x12')]));this[_0x8e1e('0x20')]['sync'](this,_0x55ed99[_0x8e1e('0x1a5')],_0x225cec);return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x1a6'));};AGIVertices['prototype'][_0x8e1e('0x1a7')]=function(_0x3e3309){logger['info'](util['format'](_0x8e1e('0x1a8'),_0x3e3309[_0x8e1e('0x36')]));return this['channel'][_0x8e1e('0xaf')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1a9')]=function(_0x40e20e){logger[_0x8e1e('0x2a')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x40e20e[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x40e20e[_0x8e1e('0x1aa')])){return this[_0x8e1e('0xd')]['noop']('no\x20sms\x20account\x20configured');}var _0x156aaa=this[_0x8e1e('0x31')][_0x8e1e('0x70')](this,_0x40e20e['sms_account_id']);if(!_0x156aaa){return this['channel']['error'](_0x40e20e,_0x8e1e('0x1ab'));}var _0x2c097e={'body':_0x40e20e['sms_text'],'phone':_0x40e20e['to']||'','SmsAccountId':_0x156aaa['id']};logger[_0x8e1e('0xe4')]('sendSMS\x20message',JSON[_0x8e1e('0x75')](_0x2c097e));this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x40e20e,_0x40e20e[_0x8e1e('0x1aa')]);this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x1ac'),_0x156aaa[_0x8e1e('0x12')]));this[_0x8e1e('0x33')][_0x8e1e('0x70')](this,_0x2c097e);return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x1ad'));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1ae')]=function(_0x4f7d11){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x1af'),_0x4f7d11['label']));if(!this[_0x8e1e('0xac')](_0x4f7d11[_0x8e1e('0xdd')])){return this['channel'][_0x8e1e('0x28')](_0x4f7d11,'no\x20variable\x20selected');}var _0x4e5a02=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x4f7d11[_0x8e1e('0xdd')]);if(!_0x4e5a02){return this['channel']['error'](_0x4f7d11,_0x8e1e('0xdf'));}return this[_0x8e1e('0xd')][_0x8e1e('0xa3')](_0x4e5a02,_0x4f7d11[_0x8e1e('0x1b0')]);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1b1')]=function(_0x548c2f){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x1b2'),_0x548c2f[_0x8e1e('0x36')]));this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x1b3'));if(_0x548c2f[_0x8e1e('0xbd')]==='yes'){this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x1b4'));return this[_0x8e1e('0xd')][_0x8e1e('0xbd')]();}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('Skipped\x20Answer');};AGIVertices[_0x8e1e('0x14')]['subproject']=function(_0x18f6db){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x1b5'),_0x18f6db[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x18f6db['project_id'])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x18f6db,'no\x20subproject\x20selected');}var _0x4e56d7=this[_0x8e1e('0x1b6')]['sync'](this,_0x18f6db['project_id']);if(!this['isConfigured'](_0x4e56d7)){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x18f6db,util[_0x8e1e('0x54')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x18f6db['project_id']));}if(_0x4e56d7===this[_0x8e1e('0xd')][_0x8e1e('0x38')]){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x18f6db,_0x8e1e('0x1b7'));}this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x18f6db,_0x4e56d7);var _0x59dc27=this['channel'][_0x8e1e('0x58')](_0x8e1e('0x1b8'),util['format'](_0x8e1e('0x1b9'),config[_0x8e1e('0xb9')][_0x8e1e('0x1ba')]||_0x8e1e('0x1bb'),_0x4e56d7,this[_0x8e1e('0xd')][_0x8e1e('0x38')]));if(_0x59dc27[_0x8e1e('0xa8')]===-0x1){return _0x59dc27;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xc9'),_0x8e1e('0x1b8'),_0x4e56d7));};AGIVertices['prototype'][_0x8e1e('0x1bc')]=function(_0x550c90){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x1bd'),_0x550c90[_0x8e1e('0x36')]));var _0x1f83f0=this[_0x8e1e('0x57')]['sync'](this,_0x550c90[_0x8e1e('0xbb')]);this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x550c90,_0x550c90[_0x8e1e('0xbb')]);if(this[_0x8e1e('0xac')](_0x550c90[_0x8e1e('0xdd')])){var _0x256d0b=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x550c90['variable_id']);if(_0x256d0b){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](_0x256d0b,_0x1f83f0);return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x1be'),_0x550c90[_0x8e1e('0xbb')],_0x256d0b));}}return this['channel']['noop'](util[_0x8e1e('0x54')](_0x8e1e('0x1bf'),_0x550c90[_0x8e1e('0xbb')]));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1c0')]=function(_0x1477de){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x1c1'),_0x1477de[_0x8e1e('0x36')]));_0x1477de[_0x8e1e('0x5d')]=_0x1477de['text'][_0x8e1e('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8e1e('0xac')](_0x1477de[_0x8e1e('0x5c')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x1c2'));}if(!this[_0x8e1e('0xac')](_0x1477de[_0x8e1e('0x5d')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xad'));}this[_0x8e1e('0xd')]['noop'](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x1477de[_0x8e1e('0x5d')]));var _0x587067=this['googleCloudTTS'][_0x8e1e('0x70')](this,_0x1477de);if(_0x587067){this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x1c3'),_0x587067));var _0x195e13=this[_0x8e1e('0xd')][_0x8e1e('0x108')](_0x587067);try{fs['unlink'](_0x587067+'.wav');}catch(_0x219566){logger[_0x8e1e('0x28')](_0x219566);}return _0x195e13;}return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x1477de,_0x8e1e('0x1c4'));};AGIVertices[_0x8e1e('0x14')]['tts']=function(_0x1d96fc){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1d96fc[_0x8e1e('0x36')]));_0x1d96fc[_0x8e1e('0x5d')]=_0x1d96fc[_0x8e1e('0x5d')][_0x8e1e('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8e1e('0xac')](_0x1d96fc[_0x8e1e('0x5d')])){return this['channel'][_0x8e1e('0xaf')]('no\x20text\x20configured');}this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format'](_0x8e1e('0x1c5'),_0x1d96fc['text']));var _0x2f4dcf=this[_0x8e1e('0x61')][_0x8e1e('0x70')](this,_0x1d96fc);if(_0x2f4dcf){this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x1c6'),_0x2f4dcf));var _0x35fae0=this[_0x8e1e('0xd')][_0x8e1e('0x108')](_0x2f4dcf);try{fs[_0x8e1e('0x109')](_0x2f4dcf+'.wav');}catch(_0x324b85){logger[_0x8e1e('0x28')](_0x324b85);}return _0x35fae0;}return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x1d96fc,_0x8e1e('0x1c7'));};AGIVertices['prototype'][_0x8e1e('0x1c8')]=function(_0x50e0c1){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x1c9'),_0x50e0c1[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x50e0c1[_0x8e1e('0x162')])){return this['channel'][_0x8e1e('0x28')](_0x50e0c1,_0x8e1e('0x163'));}logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x164'),this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x50e0c1[_0x8e1e('0x162')]));var _0x33f43f=this['agentUnpause']['sync'](this,_0x50e0c1['findBy']);if(_0x33f43f){logger[_0x8e1e('0x2a')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x50e0c1[_0x8e1e('0x162')]));this[_0x8e1e('0xd')]['noop'](util[_0x8e1e('0x54')](_0x8e1e('0x165'),this['channel'][_0x8e1e('0x39')],_0x50e0c1[_0x8e1e('0x162')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x50e0c1[_0x8e1e('0x162')]));this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x166'),this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x50e0c1['findBy']));return{'code':0xc8,'result':_0x8e1e('0x169')};}};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1ca')]=function(_0x32cc08){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x32cc08[_0x8e1e('0x36')]));var _0x293134=this['channel'][_0x8e1e('0x58')](_0x8e1e('0x1cb'),[_0x32cc08[_0x8e1e('0x1cc')],_0x32cc08[_0x8e1e('0x7a')]]);if(_0x293134[_0x8e1e('0xa8')]===-0x1){return _0x293134;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xc9'),'VOICEMAIL',_0x32cc08[_0x8e1e('0x1cc')]));};AGIVertices[_0x8e1e('0x14')]['vswitch']=function(_0x5adff8){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x1cd'),_0x5adff8['label']));if(!this[_0x8e1e('0xac')](_0x5adff8[_0x8e1e('0xdd')])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x5adff8,_0x8e1e('0x1ce'));}var _0x3ca2e7=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x5adff8[_0x8e1e('0xdd')]);if(!_0x3ca2e7){return this[_0x8e1e('0xd')]['error'](_0x5adff8,_0x8e1e('0xdf'));}var _0x327e64=this[_0x8e1e('0xd')][_0x8e1e('0xf')](_0x3ca2e7);return{'code':0xc8,'result':_0x327e64['extra']?_0x327e64[_0x8e1e('0xa6')]:'-'};};String[_0x8e1e('0x14')]['replaceAll']=function(_0x21f308,_0x547476){return this[_0x8e1e('0xa4')](_0x21f308)[_0x8e1e('0x1cf')](_0x547476);};module[_0x8e1e('0x1d0')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 2d73218..11a17a5 100644 --- a/server/services/ami/acw/index.js +++ b/server/services/ami/acw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3a9=['[ACW][START]\x20%s','message','prototype','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally'];(function(_0x5f30f3,_0x474b66){var _0x40e184=function(_0x151c1c){while(--_0x151c1c){_0x5f30f3['push'](_0x5f30f3['shift']());}};_0x40e184(++_0x474b66);}(_0xf3a9,0xd4));var _0x9f3a=function(_0x3882d0,_0x34d1da){_0x3882d0=_0x3882d0-0x0;var _0x5012ab=_0xf3a9[_0x3882d0];return _0x5012ab;};'use strict';var _=require('lodash');var moment=require(_0x9f3a('0x0'));var ami=require('../ami');var logger=require(_0x9f3a('0x1'))('acw');var RpcUser=require(_0x9f3a('0x2'));var RpcVoiceAgentReport=require(_0x9f3a('0x3'));function Acw(_0x47f9b1){this['voiceQueues']=_0x47f9b1[_0x9f3a('0x4')];this[_0x9f3a('0x5')]=_0x47f9b1[_0x9f3a('0x5')];this[_0x9f3a('0x6')]=_0x47f9b1[_0x9f3a('0x6')];this[_0x9f3a('0x7')]={};ami['on'](_0x9f3a('0x8'),this[_0x9f3a('0x9')][_0x9f3a('0xa')](this));ami['on'](_0x9f3a('0xb'),this[_0x9f3a('0xc')][_0x9f3a('0xa')](this));ami['on'](_0x9f3a('0xd'),this['syncHangup']['bind'](this));ami['on'](_0x9f3a('0xe'),this['syncAgentRingNoAnswer'][_0x9f3a('0xa')](this));ami['on']('attendedtransfer',this[_0x9f3a('0xf')][_0x9f3a('0xa')](this));ami['on'](_0x9f3a('0x10'),this['syncBlindTransfer'][_0x9f3a('0xa')](this));ami['on'](_0x9f3a('0x11'),this[_0x9f3a('0x12')]['bind'](this));}function getDiff(_0x342a54){var _0x360513=moment()[_0x9f3a('0x13')](0x0);var _0x199a39=moment(_0x342a54)[_0x9f3a('0x13')](0x0);return _0x360513[_0x9f3a('0x14')](_0x199a39,_0x9f3a('0x15'));}Acw['prototype'][_0x9f3a('0x16')]=function(_0x5b37bb){try{var _0x474b64=this;var _0x368ea3=this[_0x9f3a('0x7')][_0x5b37bb]['interface'];var _0x2a929c=this['channels'][_0x5b37bb][_0x9f3a('0x17')];var _0x3fa265=this[_0x9f3a('0x4')][_0x2a929c];var _0x43c2e3=![];var _0x464862=_0x9f3a('0x18');if(_0x3fa265[_0x9f3a('0x19')]){if(_0x3fa265[_0x9f3a('0x1a')][_0x9f3a('0x1b')]){_0x43c2e3=!![];_0x464862=_0x3fa265['mandatoryDispositionPause']['name'];}}return ami[_0x9f3a('0x1c')]({'action':_0x9f3a('0x1d'),'interface':_0x368ea3,'paused':!![],'reason':_0x464862})[_0x9f3a('0x1e')](function(){if(_0x474b64[_0x9f3a('0x5')][_0x368ea3]){return RpcUser[_0x9f3a('0x1f')](_0x474b64[_0x9f3a('0x5')][_0x368ea3]['id'])[_0x9f3a('0x1e')](function(_0x3fd1ed){if(_0x3fd1ed&&!_0x3fd1ed['voicePause']){logger[_0x9f3a('0x20')](_0x9f3a('0x21'),_0x5b37bb,_0x368ea3,_0x2a929c);var _0x24c83c=_0x474b64[_0x9f3a('0x7')][_0x5b37bb][_0x9f3a('0x22')]&&_0x474b64[_0x9f3a('0x7')][_0x5b37bb][_0x9f3a('0x23')]?_0x474b64[_0x9f3a('0x7')][_0x5b37bb]['destlinkedid']:_0x5b37bb;return RpcUser[_0x9f3a('0x24')](_0x474b64[_0x9f3a('0x5')][_0x368ea3],_0x464862,_0x24c83c)[_0x9f3a('0x1e')](function(){if(!_0x43c2e3){_0x474b64['timers'][_0x368ea3]={};logger[_0x9f3a('0x20')](_0x9f3a('0x25'),_0x5b37bb,_0x474b64[_0x9f3a('0x4')][_0x2a929c][_0x9f3a('0x26')],_0x368ea3,_0x2a929c);_0x474b64['timers'][_0x368ea3][_0x9f3a('0x27')]=setTimeout(_0x474b64[_0x9f3a('0x28')][_0x9f3a('0xa')](_0x474b64,_0x368ea3),_0x474b64['voiceQueues'][_0x2a929c][_0x9f3a('0x26')]*0x3e8);_0x474b64[_0x9f3a('0x6')][_0x368ea3][_0x9f3a('0x29')]=moment()[_0x9f3a('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');_0x474b64[_0x9f3a('0x6')][_0x368ea3][_0x9f3a('0x2b')]=_0x5b37bb;_0x474b64[_0x9f3a('0x6')][_0x368ea3][_0x9f3a('0x17')]=_0x2a929c;_0x474b64[_0x9f3a('0x6')][_0x368ea3][_0x9f3a('0x2c')]=function(){var _0x320c09=getDiff(_0x474b64[_0x9f3a('0x6')][_0x368ea3]['lastPauseAt']);clearTimeout(_0x474b64[_0x9f3a('0x6')][_0x368ea3][_0x9f3a('0x27')]);_0x474b64[_0x9f3a('0x6')][_0x368ea3][_0x9f3a('0x27')]=![];RpcVoiceAgentReport[_0x9f3a('0x2d')]({'acwtime':_0x320c09},_0x474b64[_0x9f3a('0x6')][_0x368ea3][_0x9f3a('0x2b')],_0x368ea3)[_0x9f3a('0x1e')](function(_0x1c7b93){logger[_0x9f3a('0x20')](_0x9f3a('0x2e'),_0x5b37bb,_0x320c09,_0x1c7b93);})[_0x9f3a('0x2f')](function(_0x39ecb3){logger[_0x9f3a('0x30')](_0x9f3a('0x31'),_0x5b37bb,_0x39ecb3);});delete _0x474b64[_0x9f3a('0x6')][_0x368ea3];};}});}else{logger[_0x9f3a('0x20')](_0x9f3a('0x32'),_0x5b37bb,_0x368ea3,_0x2a929c);}});}})[_0x9f3a('0x2f')](function(){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5b37bb,_0x474b64[_0x9f3a('0x4')][_0x2a929c][_0x9f3a('0x26')],_0x368ea3,_0x2a929c);})[_0x9f3a('0x33')](function(){delete _0x474b64[_0x9f3a('0x7')][_0x5b37bb];});}catch(_0x37e283){logger[_0x9f3a('0x30')](_0x9f3a('0x34'),_0x37e283[_0x9f3a('0x35')]);}};Acw[_0x9f3a('0x36')][_0x9f3a('0x28')]=function(_0x100b4d){try{var _0x54298e=this;if(_0x54298e[_0x9f3a('0x6')][_0x100b4d]){_0x54298e[_0x9f3a('0x6')][_0x100b4d][_0x9f3a('0x27')]=![];var _0x5dc9a0=_0x54298e[_0x9f3a('0x6')][_0x100b4d][_0x9f3a('0x2b')];var _0x190383=_0x54298e[_0x9f3a('0x6')][_0x100b4d][_0x9f3a('0x17')];var _0x4f5c36=_0x54298e[_0x9f3a('0x4')][_0x190383]['acwTimeout'];logger[_0x9f3a('0x20')]('[%s][TIMER][STOP][AGENT:%s]',_0x5dc9a0,_0x100b4d);RpcUser[_0x9f3a('0x37')](this[_0x9f3a('0x5')][_0x100b4d]);RpcVoiceAgentReport[_0x9f3a('0x2d')]({'acwtime':_0x4f5c36,'agentacw':!![]},_0x5dc9a0,_0x100b4d)[_0x9f3a('0x1e')](function(_0x3de522){logger[_0x9f3a('0x20')](_0x9f3a('0x2e'),_0x5dc9a0,_0x4f5c36,_0x3de522);})[_0x9f3a('0x2f')](function(_0x12d7a5){logger[_0x9f3a('0x30')](_0x9f3a('0x31'),_0x5dc9a0,_0x12d7a5);});}else{logger['error'](_0x9f3a('0x38'),_0x100b4d);if(_0x54298e[_0x9f3a('0x6')]){logger[_0x9f3a('0x20')](_0x9f3a('0x39'),JSON[_0x9f3a('0x3a')](_0x54298e['timers']));}}}catch(_0x21dc49){logger[_0x9f3a('0x30')](_0x9f3a('0x3b'),_0x21dc49['message']);}};Acw[_0x9f3a('0x36')][_0x9f3a('0x9')]=function(_0x5e504a){try{if(this[_0x9f3a('0x4')][_0x5e504a['queue']]&&(this[_0x9f3a('0x4')][_0x5e504a[_0x9f3a('0x17')]][_0x9f3a('0x3c')]||this['voiceQueues'][_0x5e504a['queue']][_0x9f3a('0x19')])){if(this['agents'][_0x5e504a[_0x9f3a('0x3d')]]){this[_0x9f3a('0x7')][_0x5e504a[_0x9f3a('0x2b')]]={'queue':_0x5e504a['queue'],'interface':_0x5e504a[_0x9f3a('0x3d')],'destlinkedid':_0x5e504a[_0x9f3a('0x23')]};}}}catch(_0x315dd7){logger[_0x9f3a('0x30')](_0x9f3a('0x3e'),_0x315dd7[_0x9f3a('0x35')]);}};Acw['prototype'][_0x9f3a('0x12')]=function(_0x4d402e){try{if(this['voiceQueues'][_0x4d402e[_0x9f3a('0x17')]]&&(this[_0x9f3a('0x4')][_0x4d402e[_0x9f3a('0x17')]][_0x9f3a('0x3c')]||this['voiceQueues'][_0x4d402e[_0x9f3a('0x17')]][_0x9f3a('0x19')])){if(this[_0x9f3a('0x5')][_0x4d402e['interface']]){this['channels'][_0x4d402e[_0x9f3a('0x2b')]]={'queue':_0x4d402e[_0x9f3a('0x17')],'interface':_0x4d402e[_0x9f3a('0x3d')]};}}}catch(_0x38198d){logger[_0x9f3a('0x30')](_0x9f3a('0x3f'),_0x38198d[_0x9f3a('0x35')]);}};Acw['prototype'][_0x9f3a('0xc')]=function(_0x3a5020){try{if(this[_0x9f3a('0x7')][_0x3a5020[_0x9f3a('0x2b')]]&&_[_0x9f3a('0x40')](this[_0x9f3a('0x7')][_0x3a5020['uniqueid']][_0x9f3a('0x22')])){logger[_0x9f3a('0x20')](_0x9f3a('0x41'),_0x3a5020[_0x9f3a('0x2b')]);this['startAcw'](_0x3a5020[_0x9f3a('0x2b')]);}else if(this[_0x9f3a('0x7')][_0x3a5020['linkedid']]&&_[_0x9f3a('0x40')](this[_0x9f3a('0x7')][_0x3a5020[_0x9f3a('0x42')]][_0x9f3a('0x22')])){logger[_0x9f3a('0x20')](_0x9f3a('0x43'),_0x3a5020[_0x9f3a('0x42')]);this['startAcw'](_0x3a5020[_0x9f3a('0x42')]);}}catch(_0x548100){logger[_0x9f3a('0x30')]('[ACW][syncHangupRequest]\x20%s',_0x548100[_0x9f3a('0x35')]);}};Acw[_0x9f3a('0x36')]['syncHangup']=function(_0xb7490d){try{if(this['channels'][_0xb7490d['uniqueid']]&&this[_0x9f3a('0x7')][_0xb7490d[_0x9f3a('0x2b')]]['attended']){logger[_0x9f3a('0x20')](_0x9f3a('0x44'),_0xb7490d[_0x9f3a('0x2b')]);this['startAcw'](_0xb7490d['uniqueid']);}else if(this[_0x9f3a('0x7')][_0xb7490d[_0x9f3a('0x42')]]&&this[_0x9f3a('0x7')][_0xb7490d[_0x9f3a('0x42')]]['attended']){logger['info'](_0x9f3a('0x45'),_0xb7490d['linkedid']);this['startAcw'](_0xb7490d[_0x9f3a('0x42')]);}}catch(_0x2cecd3){logger[_0x9f3a('0x30')](_0x9f3a('0x46'),_0x2cecd3['message']);}};Acw['prototype']['syncAttendedTransfer']=function(_0x18c4bd){try{if(!_['isNil'](this['channels'][_0x18c4bd[_0x9f3a('0x47')]])){this[_0x9f3a('0x16')](_0x18c4bd[_0x9f3a('0x47')]);if(this[_0x9f3a('0x7')][_0x18c4bd[_0x9f3a('0x48')]]){this['channels'][_0x18c4bd[_0x9f3a('0x48')]][_0x9f3a('0x22')]=!![];this[_0x9f3a('0x7')][_0x18c4bd[_0x9f3a('0x49')]]=this[_0x9f3a('0x7')][_0x18c4bd['secondtransfereruniqueid']];delete this[_0x9f3a('0x7')][_0x18c4bd[_0x9f3a('0x48')]];}}else if(!_[_0x9f3a('0x4a')](this['channels'][_0x18c4bd['transfertargetuniqueid']])){this[_0x9f3a('0x16')](_0x18c4bd[_0x9f3a('0x49')]);if(this[_0x9f3a('0x7')][_0x18c4bd[_0x9f3a('0x4b')]]){this[_0x9f3a('0x7')][_0x18c4bd[_0x9f3a('0x4b')]]['attended']=!![];this[_0x9f3a('0x7')][_0x18c4bd['transfereeuniqueid']]=this[_0x9f3a('0x7')][_0x18c4bd[_0x9f3a('0x4b')]];delete this['channels'][_0x18c4bd[_0x9f3a('0x4b')]];}}}catch(_0x150c9b){logger[_0x9f3a('0x30')](_0x9f3a('0x4c'),_0x150c9b[_0x9f3a('0x35')]);}};Acw[_0x9f3a('0x36')][_0x9f3a('0x4d')]=function(_0x25c649){try{if(this[_0x9f3a('0x7')][_0x25c649[_0x9f3a('0x4e')]]){logger[_0x9f3a('0x20')](_0x9f3a('0x4f'),JSON[_0x9f3a('0x3a')](_0x25c649[_0x9f3a('0x4e')]));this[_0x9f3a('0x16')](_0x25c649[_0x9f3a('0x4e')]);}else if(this['channels'][_0x25c649['transfererlinkedid']]){logger['info'](_0x9f3a('0x50'),JSON['stringify'](_0x25c649[_0x9f3a('0x51')]));this[_0x9f3a('0x16')](_0x25c649[_0x9f3a('0x51')]);}}catch(_0x59fb4c){logger['error'](_0x9f3a('0x52'),_0x59fb4c['message']);}};Acw[_0x9f3a('0x36')][_0x9f3a('0x53')]=function(_0x4247f5){try{if(this[_0x9f3a('0x4')][_0x4247f5['queue']]&&this[_0x9f3a('0x4')][_0x4247f5[_0x9f3a('0x17')]][_0x9f3a('0x54')]===_0x9f3a('0x55')){if(this[_0x9f3a('0x5')][_0x4247f5[_0x9f3a('0x3d')]]){logger[_0x9f3a('0x20')](_0x9f3a('0x56'),_0x4247f5[_0x9f3a('0x2b')],_0x4247f5[_0x9f3a('0x3d')],_0x4247f5[_0x9f3a('0x17')]);return RpcUser[_0x9f3a('0x24')](this[_0x9f3a('0x5')][_0x4247f5['interface']],'Auto-Pause',_0x4247f5['uniqueid']);}}}catch(_0x26793f){logger['error'](_0x9f3a('0x57'),_0x26793f['message']);}};module['exports']=Acw; \ No newline at end of file +var _0x2852=['[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','../../../config/logger','acw','voiceQueues','agents','timers','channels','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','bind','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','info','attended','destlinkedid','savePause','acwTimeout','timer','lastPauseAt','format','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','prototype','queue','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause'];(function(_0x3a57b0,_0x23145a){var _0x2b8f3e=function(_0x1c721a){while(--_0x1c721a){_0x3a57b0['push'](_0x3a57b0['shift']());}};_0x2b8f3e(++_0x23145a);}(_0x2852,0x1d5));var _0x2285=function(_0x2d7e67,_0x44850d){_0x2d7e67=_0x2d7e67-0x0;var _0x5c41e1=_0x2852[_0x2d7e67];return _0x5c41e1;};'use strict';var _=require('lodash');var moment=require(_0x2285('0x0'));var ami=require(_0x2285('0x1'));var logger=require(_0x2285('0x2'))(_0x2285('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x128de7){this[_0x2285('0x4')]=_0x128de7[_0x2285('0x4')];this[_0x2285('0x5')]=_0x128de7[_0x2285('0x5')];this[_0x2285('0x6')]=_0x128de7[_0x2285('0x6')];this[_0x2285('0x7')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x2285('0x8'),this[_0x2285('0x9')]['bind'](this));ami['on'](_0x2285('0xa'),this[_0x2285('0xb')]['bind'](this));ami['on'](_0x2285('0xc'),this[_0x2285('0xd')][_0x2285('0xe')](this));ami['on']('attendedtransfer',this[_0x2285('0xf')][_0x2285('0xe')](this));ami['on']('blindtransfer',this[_0x2285('0x10')][_0x2285('0xe')](this));ami['on'](_0x2285('0x11'),this[_0x2285('0x12')][_0x2285('0xe')](this));}function getDiff(_0x15079a){var _0x139851=moment()[_0x2285('0x13')](0x0);var _0x57cc0b=moment(_0x15079a)[_0x2285('0x13')](0x0);return _0x139851[_0x2285('0x14')](_0x57cc0b,_0x2285('0x15'));}Acw['prototype'][_0x2285('0x16')]=function(_0x25cdb6){try{var _0x416871=this;var _0x2d15dc=this['channels'][_0x25cdb6][_0x2285('0x17')];var _0x107350=this[_0x2285('0x7')][_0x25cdb6]['queue'];var _0x54e808=this[_0x2285('0x4')][_0x107350];var _0x2ae2f8=![];var _0x245d33=_0x2285('0x18');if(_0x54e808[_0x2285('0x19')]){if(_0x54e808[_0x2285('0x1a')][_0x2285('0x1b')]){_0x2ae2f8=!![];_0x245d33=_0x54e808[_0x2285('0x1a')][_0x2285('0x1b')];}}return ami[_0x2285('0x1c')]({'action':_0x2285('0x1d'),'interface':_0x2d15dc,'paused':!![],'reason':_0x245d33})['then'](function(){if(_0x416871[_0x2285('0x5')][_0x2d15dc]){return RpcUser['getAgent'](_0x416871[_0x2285('0x5')][_0x2d15dc]['id'])[_0x2285('0x1e')](function(_0x583ecc){if(_0x583ecc&&!_0x583ecc['voicePause']){logger[_0x2285('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x25cdb6,_0x2d15dc,_0x107350);var _0x2360bc=_0x416871[_0x2285('0x7')][_0x25cdb6][_0x2285('0x20')]&&_0x416871[_0x2285('0x7')][_0x25cdb6][_0x2285('0x21')]?_0x416871[_0x2285('0x7')][_0x25cdb6][_0x2285('0x21')]:_0x25cdb6;return RpcUser[_0x2285('0x22')](_0x416871[_0x2285('0x5')][_0x2d15dc],_0x245d33,_0x2360bc)['then'](function(){if(!_0x2ae2f8){_0x416871['timers'][_0x2d15dc]={};logger[_0x2285('0x1f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x25cdb6,_0x416871[_0x2285('0x4')][_0x107350][_0x2285('0x23')],_0x2d15dc,_0x107350);_0x416871[_0x2285('0x6')][_0x2d15dc][_0x2285('0x24')]=setTimeout(_0x416871['stopAcw'][_0x2285('0xe')](_0x416871,_0x2d15dc),_0x416871[_0x2285('0x4')][_0x107350][_0x2285('0x23')]*0x3e8);_0x416871['timers'][_0x2d15dc][_0x2285('0x25')]=moment()[_0x2285('0x26')]('YYYY-MM-DD\x20HH:mm:ss');_0x416871['timers'][_0x2d15dc]['uniqueid']=_0x25cdb6;_0x416871[_0x2285('0x6')][_0x2d15dc]['queue']=_0x107350;_0x416871['timers'][_0x2d15dc][_0x2285('0x27')]=function(){var _0x351336=getDiff(_0x416871['timers'][_0x2d15dc][_0x2285('0x25')]);clearTimeout(_0x416871[_0x2285('0x6')][_0x2d15dc][_0x2285('0x24')]);_0x416871['timers'][_0x2d15dc]['timer']=![];RpcVoiceAgentReport[_0x2285('0x28')]({'acwtime':_0x351336},_0x416871[_0x2285('0x6')][_0x2d15dc][_0x2285('0x29')],_0x2d15dc)[_0x2285('0x1e')](function(_0xf36941){logger['info'](_0x2285('0x2a'),_0x25cdb6,_0x351336,_0xf36941);})[_0x2285('0x2b')](function(_0x53c8a1){logger[_0x2285('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x25cdb6,_0x53c8a1);});delete _0x416871[_0x2285('0x6')][_0x2d15dc];};}});}else{logger[_0x2285('0x1f')](_0x2285('0x2d'),_0x25cdb6,_0x2d15dc,_0x107350);}});}})[_0x2285('0x2b')](function(){logger[_0x2285('0x2c')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x25cdb6,_0x416871[_0x2285('0x4')][_0x107350]['acwTimeout'],_0x2d15dc,_0x107350);})[_0x2285('0x2e')](function(){delete _0x416871[_0x2285('0x7')][_0x25cdb6];});}catch(_0x558808){logger[_0x2285('0x2c')]('[ACW][START]\x20%s',_0x558808[_0x2285('0x2f')]);}};Acw[_0x2285('0x30')]['stopAcw']=function(_0x2a1793){try{var _0x35e63a=this;if(_0x35e63a[_0x2285('0x6')][_0x2a1793]){_0x35e63a[_0x2285('0x6')][_0x2a1793][_0x2285('0x24')]=![];var _0x1e6ff8=_0x35e63a[_0x2285('0x6')][_0x2a1793][_0x2285('0x29')];var _0x2eec78=_0x35e63a[_0x2285('0x6')][_0x2a1793][_0x2285('0x31')];var _0x3e10b3=_0x35e63a[_0x2285('0x4')][_0x2eec78][_0x2285('0x23')];logger['info'](_0x2285('0x32'),_0x1e6ff8,_0x2a1793);RpcUser['saveUnpause'](this[_0x2285('0x5')][_0x2a1793]);RpcVoiceAgentReport[_0x2285('0x28')]({'acwtime':_0x3e10b3,'agentacw':!![]},_0x1e6ff8,_0x2a1793)[_0x2285('0x1e')](function(_0x9b276c){logger[_0x2285('0x1f')](_0x2285('0x2a'),_0x1e6ff8,_0x3e10b3,_0x9b276c);})[_0x2285('0x2b')](function(_0x113e3a){logger[_0x2285('0x2c')](_0x2285('0x33'),_0x1e6ff8,_0x113e3a);});}else{logger[_0x2285('0x2c')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x2a1793);if(_0x35e63a[_0x2285('0x6')]){logger[_0x2285('0x1f')](_0x2285('0x34'),JSON[_0x2285('0x35')](_0x35e63a[_0x2285('0x6')]));}}}catch(_0x2709c0){logger[_0x2285('0x2c')]('[ACW][STOP]\x20%s',_0x2709c0['message']);}};Acw['prototype'][_0x2285('0x36')]=function(_0x3fee1f){try{if(this[_0x2285('0x4')][_0x3fee1f[_0x2285('0x31')]]&&(this['voiceQueues'][_0x3fee1f['queue']][_0x2285('0x3')]||this['voiceQueues'][_0x3fee1f[_0x2285('0x31')]]['mandatoryDisposition'])){if(this[_0x2285('0x5')][_0x3fee1f[_0x2285('0x17')]]){this[_0x2285('0x7')][_0x3fee1f[_0x2285('0x29')]]={'queue':_0x3fee1f[_0x2285('0x31')],'interface':_0x3fee1f[_0x2285('0x17')],'destlinkedid':_0x3fee1f[_0x2285('0x21')]};}}}catch(_0x25c8ac){logger[_0x2285('0x2c')](_0x2285('0x37'),_0x25c8ac[_0x2285('0x2f')]);}};Acw['prototype'][_0x2285('0x12')]=function(_0x222507){try{if(this[_0x2285('0x4')][_0x222507['queue']]&&(this[_0x2285('0x4')][_0x222507[_0x2285('0x31')]][_0x2285('0x3')]||this[_0x2285('0x4')][_0x222507['queue']]['mandatoryDisposition'])){if(this[_0x2285('0x5')][_0x222507['interface']]){this[_0x2285('0x7')][_0x222507[_0x2285('0x29')]]={'queue':_0x222507['queue'],'interface':_0x222507[_0x2285('0x17')]};}}}catch(_0x12a8e9){logger[_0x2285('0x2c')](_0x2285('0x38'),_0x12a8e9['message']);}};Acw[_0x2285('0x30')][_0x2285('0x9')]=function(_0x2d9b59){try{if(this[_0x2285('0x7')][_0x2d9b59[_0x2285('0x29')]]&&_[_0x2285('0x39')](this['channels'][_0x2d9b59[_0x2285('0x29')]][_0x2285('0x20')])){logger[_0x2285('0x1f')](_0x2285('0x3a'),_0x2d9b59[_0x2285('0x29')]);this['startAcw'](_0x2d9b59[_0x2285('0x29')]);}else if(this[_0x2285('0x7')][_0x2d9b59[_0x2285('0x3b')]]&&_[_0x2285('0x39')](this['channels'][_0x2d9b59[_0x2285('0x3b')]]['attended'])){logger[_0x2285('0x1f')](_0x2285('0x3c'),_0x2d9b59[_0x2285('0x3b')]);this[_0x2285('0x16')](_0x2d9b59[_0x2285('0x3b')]);}}catch(_0x2740a0){logger[_0x2285('0x2c')](_0x2285('0x3d'),_0x2740a0['message']);}};Acw[_0x2285('0x30')][_0x2285('0xb')]=function(_0x31a897){try{if(this[_0x2285('0x7')][_0x31a897[_0x2285('0x29')]]&&this[_0x2285('0x7')][_0x31a897['uniqueid']][_0x2285('0x20')]){logger[_0x2285('0x1f')](_0x2285('0x3e'),_0x31a897[_0x2285('0x29')]);this['startAcw'](_0x31a897[_0x2285('0x29')]);}else if(this[_0x2285('0x7')][_0x31a897[_0x2285('0x3b')]]&&this[_0x2285('0x7')][_0x31a897[_0x2285('0x3b')]][_0x2285('0x20')]){logger[_0x2285('0x1f')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x31a897[_0x2285('0x3b')]);this[_0x2285('0x16')](_0x31a897[_0x2285('0x3b')]);}}catch(_0x1a4614){logger[_0x2285('0x2c')](_0x2285('0x3f'),_0x1a4614[_0x2285('0x2f')]);}};Acw[_0x2285('0x30')][_0x2285('0xf')]=function(_0x2e4bfd){try{if(!_[_0x2285('0x40')](this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x41')]])){this[_0x2285('0x16')](_0x2e4bfd['transfereeuniqueid']);if(this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x42')]]){this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x42')]][_0x2285('0x20')]=!![];this[_0x2285('0x7')][_0x2e4bfd['transfertargetuniqueid']]=this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x42')]];delete this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x42')]];}}else if(!_['isNil'](this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x43')]])){this[_0x2285('0x16')](_0x2e4bfd[_0x2285('0x43')]);if(this[_0x2285('0x7')][_0x2e4bfd['origtransfereruniqueid']]){this[_0x2285('0x7')][_0x2e4bfd['origtransfereruniqueid']]['attended']=!![];this['channels'][_0x2e4bfd[_0x2285('0x41')]]=this['channels'][_0x2e4bfd['origtransfereruniqueid']];delete this[_0x2285('0x7')][_0x2e4bfd['origtransfereruniqueid']];}}}catch(_0x313a1a){logger[_0x2285('0x2c')](_0x2285('0x44'),_0x313a1a[_0x2285('0x2f')]);}};Acw['prototype'][_0x2285('0x10')]=function(_0x531b46){try{if(this[_0x2285('0x7')][_0x531b46[_0x2285('0x45')]]){logger['info'](_0x2285('0x46'),JSON[_0x2285('0x35')](_0x531b46[_0x2285('0x45')]));this[_0x2285('0x16')](_0x531b46[_0x2285('0x45')]);}else if(this[_0x2285('0x7')][_0x531b46['transfererlinkedid']]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x2285('0x35')](_0x531b46['transfererlinkedid']));this['startAcw'](_0x531b46[_0x2285('0x47')]);}}catch(_0x2de104){logger[_0x2285('0x2c')](_0x2285('0x48'),_0x2de104[_0x2285('0x2f')]);}};Acw[_0x2285('0x30')]['syncAgentRingNoAnswer']=function(_0x194490){try{if(this[_0x2285('0x4')][_0x194490['queue']]&&this[_0x2285('0x4')][_0x194490[_0x2285('0x31')]][_0x2285('0x49')]===_0x2285('0x4a')){if(this[_0x2285('0x5')][_0x194490['interface']]){logger['info'](_0x2285('0x4b'),_0x194490[_0x2285('0x29')],_0x194490[_0x2285('0x17')],_0x194490[_0x2285('0x31')]);return RpcUser[_0x2285('0x22')](this['agents'][_0x194490[_0x2285('0x17')]],_0x2285('0x4c'),_0x194490[_0x2285('0x29')]);}}}catch(_0x1891be){logger['error'](_0x2285('0x4d'),_0x1891be[_0x2285('0x2f')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index f08d9c2..384235e 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb18=['Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','info','once','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','close','exports','asterisk-manager','bluebird','util','../../config/logger','ami','username','asterisk','password','keepConnected'];(function(_0x71ae3c,_0x404627){var _0x194072=function(_0x13c008){while(--_0x13c008){_0x71ae3c['push'](_0x71ae3c['shift']());}};_0x194072(++_0x404627);}(_0xdb18,0x87));var _0x8db1=function(_0x3c8e34,_0x10c03b){_0x3c8e34=_0x3c8e34-0x0;var _0x391f03=_0xdb18[_0x3c8e34];return _0x391f03;};'use strict';var Manager=require(_0x8db1('0x0'));var BPromise=require(_0x8db1('0x1'));var util=require(_0x8db1('0x2'));var logger=require(_0x8db1('0x3'))(_0x8db1('0x4'));var config=require('../../config/environment');var ami=new Manager(config['asterisk']['port'],config['asterisk']['ip'],config['asterisk'][_0x8db1('0x5')],config[_0x8db1('0x6')][_0x8db1('0x7')],!![]);ami[_0x8db1('0x8')]();ami[_0x8db1('0x9')]=BPromise[_0x8db1('0xa')](ami[_0x8db1('0xb')]);function error(_0x1f074c){logger[_0x8db1('0xc')](util[_0x8db1('0xd')](_0x8db1('0xe'),config[_0x8db1('0x6')][_0x8db1('0x5')],config[_0x8db1('0x6')]['ip'],config[_0x8db1('0x6')][_0x8db1('0xf')],util[_0x8db1('0x10')](_0x1f074c,![],null)));}function close(){logger['error'](util[_0x8db1('0xd')](_0x8db1('0x11'),config['asterisk'][_0x8db1('0x5')],config[_0x8db1('0x6')]['ip'],config[_0x8db1('0x6')][_0x8db1('0xf')]));}ami[_0x8db1('0x12')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0x8db1('0x13')]=function(){return function(){return ami['Action']({'action':_0x8db1('0x14')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':_0x8db1('0x15')});};};ami[_0x8db1('0x16')]=function(){return function(){return ami[_0x8db1('0x9')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x8db1('0x9')]({'action':'coreshowchannels'});};};function connect(){logger[_0x8db1('0x17')](util[_0x8db1('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x8db1('0x6')][_0x8db1('0x5')],config[_0x8db1('0x6')]['ip'],config[_0x8db1('0x6')][_0x8db1('0xf')]));ami[_0x8db1('0x18')]('error',error);ami[_0x8db1('0x18')]('close',close);}ami['on'](_0x8db1('0x19'),connect);ami['on']('shutdown',function(_0x236789){logger[_0x8db1('0x17')](util[_0x8db1('0xd')](_0x8db1('0x1a'),config['asterisk'][_0x8db1('0x5')],config[_0x8db1('0x6')]['ip'],config['asterisk'][_0x8db1('0xf')],util['inspect'](_0x236789,![],null)));});ami['on'](_0x8db1('0x1b'),function(){logger['info'](util[_0x8db1('0xd')](_0x8db1('0x1c'),config['asterisk']['username'],config[_0x8db1('0x6')]['ip'],config[_0x8db1('0x6')]['port']));return Promise[_0x8db1('0x1d')]()[_0x8db1('0x1e')](ami[_0x8db1('0x12')]())['then'](ami[_0x8db1('0x13')]())['then'](ami[_0x8db1('0x1f')]())[_0x8db1('0x1e')](ami[_0x8db1('0x16')]())[_0x8db1('0x1e')](ami['actionCoreShowChannels']())[_0x8db1('0x20')](function(_0x4ab950){logger['error'](_0x8db1('0x21'),util[_0x8db1('0x10')](_0x4ab950,{'showHidden':![],'depth':null}));});});ami[_0x8db1('0x18')]('error',error);ami[_0x8db1('0x18')](_0x8db1('0x22'),close);module[_0x8db1('0x23')]=ami; \ No newline at end of file +var _0x198b=['once','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','asterisk','port','password','Action','promisify','action','error','username','format','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x198b,0x18d));var _0xb198=function(_0x432601,_0x3852b0){_0x432601=_0x432601-0x0;var _0x41b0d1=_0x198b[_0x432601];return _0x41b0d1;};'use strict';var Manager=require(_0xb198('0x0'));var BPromise=require(_0xb198('0x1'));var util=require(_0xb198('0x2'));var logger=require(_0xb198('0x3'))(_0xb198('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0xb198('0x5')][_0xb198('0x6')],config['asterisk']['ip'],config[_0xb198('0x5')]['username'],config[_0xb198('0x5')][_0xb198('0x7')],!![]);ami['keepConnected']();ami[_0xb198('0x8')]=BPromise[_0xb198('0x9')](ami[_0xb198('0xa')]);function error(_0x254f41){logger[_0xb198('0xb')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xb198('0x5')][_0xb198('0xc')],config[_0xb198('0x5')]['ip'],config[_0xb198('0x5')][_0xb198('0x6')],util['inspect'](_0x254f41,![],null)));}function close(){logger['error'](util[_0xb198('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xb198('0x5')][_0xb198('0xc')],config[_0xb198('0x5')]['ip'],config['asterisk'][_0xb198('0x6')]));}ami[_0xb198('0xe')]=function(){return function(){return ami['Action']({'action':_0xb198('0xf')});};};ami[_0xb198('0x10')]=function(){return function(){return ami['Action']({'action':_0xb198('0x11')});};};ami[_0xb198('0x12')]=function(){return function(){return ami[_0xb198('0x8')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xb198('0x8')]({'action':_0xb198('0x13')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xb198('0x8')]({'action':_0xb198('0x14')});};};function connect(){logger[_0xb198('0x15')](util[_0xb198('0xd')](_0xb198('0x16'),config[_0xb198('0x5')][_0xb198('0xc')],config[_0xb198('0x5')]['ip'],config[_0xb198('0x5')][_0xb198('0x6')]));ami[_0xb198('0x17')](_0xb198('0xb'),error);ami['once']('close',close);}ami['on']('connect',connect);ami['on'](_0xb198('0x18'),function(_0x46351a){logger[_0xb198('0x15')](util['format'](_0xb198('0x19'),config[_0xb198('0x5')][_0xb198('0xc')],config[_0xb198('0x5')]['ip'],config[_0xb198('0x5')][_0xb198('0x6')],util[_0xb198('0x1a')](_0x46351a,![],null)));});ami['on']('fullybooted',function(){logger[_0xb198('0x15')](util[_0xb198('0xd')](_0xb198('0x1b'),config[_0xb198('0x5')]['username'],config[_0xb198('0x5')]['ip'],config[_0xb198('0x5')][_0xb198('0x6')]));return Promise[_0xb198('0x1c')]()[_0xb198('0x1d')](ami[_0xb198('0xe')]())[_0xb198('0x1d')](ami['actionDeviceStateList']())[_0xb198('0x1d')](ami[_0xb198('0x12')]())[_0xb198('0x1d')](ami[_0xb198('0x1e')]())[_0xb198('0x1d')](ami[_0xb198('0x1f')]())[_0xb198('0x20')](function(_0x1dbdb5){logger[_0xb198('0xb')](_0xb198('0x21'),util[_0xb198('0x1a')](_0x1dbdb5,{'showHidden':![],'depth':null}));});});ami[_0xb198('0x17')](_0xb198('0xb'),error);ami[_0xb198('0x17')]('close',close);module[_0xb198('0x22')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 1a2ef89..7178814 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x70e0,0x17b));var _0x070e=function(_0x3e6c6a,_0x108295){_0x3e6c6a=_0x3e6c6a-0x0;var _0x253ded=_0x70e0[_0x3e6c6a];return _0x253ded;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file +var _0x9c44=['ami','client','http','Request','then','debug','rpc','memberReport','error','message','result','exports','../../config/logger'];(function(_0x49003c,_0x9b09ab){var _0x342c42=function(_0x64c0be){while(--_0x64c0be){_0x49003c['push'](_0x49003c['shift']());}};_0x342c42(++_0x9b09ab);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var client=jayson[_0x49c4('0x2')][_0x49c4('0x3')]({'port':0x2329});client[_0x49c4('0x4')]=function(_0x2ad237,_0x4e0313){return new BPromise(function(_0x4941f1,_0x41a183){return client['request'](_0x2ad237,_0x4e0313)[_0x49c4('0x5')](function(_0x6030ae){logger[_0x49c4('0x6')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x4e0313,_0x6030ae);if(_0x6030ae['error']){logger[_0x49c4('0x9')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x6030ae[_0x49c4('0x9')]['message'],_0x4e0313);return _0x41a183(_0x6030ae['error'][_0x49c4('0xa')]);}else{return _0x4941f1(_0x6030ae[_0x49c4('0xb')]);}})['catch'](function(_0xb611a1){logger[_0x49c4('0x9')]('rpc','memberReport',_0x2ad237,_0xb611a1,_0x4e0313);return _0x41a183(_0xb611a1);});});};module[_0x49c4('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 296cf4a..9427d4b 100644 --- a/server/services/ami/dialer/index.js +++ b/server/services/ami/dialer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bb1=['strategy','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','rescheduleContact','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','ivr','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countbusyretry','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','countnoanswerretry','dialGlobalMaxRetry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','available','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','filter','online','handlePreviewRecallNotifications','map','Agent','user:%s','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:dialPreviewRecallReminder','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','isOutboundQueue','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','stateGlobal','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','swapAdditionalPhones','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','talking','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','loggedIn','erlangCallToSecond','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','temp','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[getContactCampaign2]','not_inuse','getContactDialer','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','dialLimitQueue','[handlePredictive][limitChannel]','tryOriginatePredictive','countReScheduled','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','uuid','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictiveCalls','syncQueueSummary','../ami','defaults','localhost','socket.io-emitter','redis','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','env','XCALLY_IP_AGI','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','emit','type','outbound','inspect','format','voice:queue:%s','name','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','getSeconds','debug','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','[unlockQueueStatus][undefined]','queueStatusComplete','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','\x20NOT\x20Active','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','[ifTime][Action]','isTrunkReachable','active','SIP/%s','status','reachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','content','indexOf','catch','push','Action','command','true','all','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncCampaigns]','checkDialMethod','dialMethod','predictive','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','\x20Interval\x20is\x20overtime:\x20','AMI\x20IfTime','Error','queue','uniqueId','uniqueid','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','agent','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','dropreason','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','CampaignId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','agents','stateinterface','merge','syncQueueStatusComplete'];(function(_0x2b78bb,_0x334a06){var _0x46d242=function(_0x3281c8){while(--_0x3281c8){_0x2b78bb['push'](_0x2b78bb['shift']());}};_0x46d242(++_0x334a06);}(_0x4bb1,0x133));var _0x14bb=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0x4bb1[_0x2842b4];return _0x2b9521;};'use strict';var util=require(_0x14bb('0x0'));var _=require('lodash');var uuid=require(_0x14bb('0x1'));var moment=require(_0x14bb('0x2'));var rr=require('rr');var Redis=require(_0x14bb('0x3'));var utils=require('./utils');var hopperUtils=require(_0x14bb('0x4'));var ut=require(_0x14bb('0x5'));var config=require(_0x14bb('0x6'));var logger=require(_0x14bb('0x7'))('dialer');var loggerBooked=require(_0x14bb('0x7'))(_0x14bb('0x8'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x14bb('0x7'))(_0x14bb('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x14bb('0xa'));var ami=require(_0x14bb('0xb'));config['redis']=_[_0x14bb('0xc')](config['redis'],{'host':_0x14bb('0xd'),'port':0x18eb});var io=require(_0x14bb('0xe'))(new Redis(config[_0x14bb('0xf')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x14bb('0x10'));var RpcSetting=require(_0x14bb('0x11'));var Interval=require(_0x14bb('0x12'));var Action=require(_0x14bb('0x13'));var History=require(_0x14bb('0x14'));var Final=require(_0x14bb('0x15'));var AgentComplete=require(_0x14bb('0x16'));var QueueCallerAbandon=require(_0x14bb('0x17'));var Hangup=require('./models/hangup');var ipAgi=process[_0x14bb('0x18')][_0x14bb('0x19')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x14bb('0x1a')][_0x14bb('0x1b')]=function(_0x6ac7a2){this[_0x14bb('0x1c')]=this['tail']?this['tail'][_0x14bb('0x1d')](_0x6ac7a2):_0x6ac7a2();};function Dialer(_0x40fc35,_0x1dccec){this[_0x14bb('0x1e')]=new Sequence();this[_0x14bb('0x1f')]=_0x1dccec;this[_0x14bb('0x20')]=_0x40fc35[_0x14bb('0x20')];this['campaigns']=_0x40fc35[_0x14bb('0x21')];this['agents']=_0x40fc35['agents'];this['trunks']=_0x40fc35[_0x14bb('0x22')];this[_0x14bb('0x23')]=config[_0x14bb('0x23')]||0x2;this[_0x14bb('0x24')]={};this[_0x14bb('0x25')]={};this[_0x14bb('0x26')]={};this['uniqueId']={};this[_0x14bb('0x27')]={};this[_0x14bb('0x28')]={};this[_0x14bb('0x29')]={};this[_0x14bb('0x2a')]={};this[_0x14bb('0x2b')]={};this[_0x14bb('0x2c')]={};this[_0x14bb('0x2d')]={};ami['on'](_0x14bb('0x2e'),this[_0x14bb('0x2f')][_0x14bb('0x30')](this));ami['on']('queuecallerabandon',this[_0x14bb('0x31')][_0x14bb('0x30')](this));ami['on']('originateresponse',this[_0x14bb('0x32')]['bind'](this));ami['on'](_0x14bb('0x33'),this['syncAgentComplete'][_0x14bb('0x30')](this));ami['on'](_0x14bb('0x34'),this[_0x14bb('0xa')][_0x14bb('0x30')](this));ami['on']('custom:queuesummarycomplete',this[_0x14bb('0x35')][_0x14bb('0x30')](this));ami['on'](_0x14bb('0x36'),this[_0x14bb('0x37')][_0x14bb('0x30')](this));ami['on'](_0x14bb('0x38'),this['syncNewExten'][_0x14bb('0x30')](this));ami['on'](_0x14bb('0x39'),this[_0x14bb('0x3a')]['bind'](this));ami['on'](_0x14bb('0x3b'),this[_0x14bb('0x3c')][_0x14bb('0x30')](this));ami['on'](_0x14bb('0x3d'),this['syncQueueStatusComplete']['bind'](this));this[_0x14bb('0x3e')]();this[_0x14bb('0x3f')]();RpcSetting[_0x14bb('0x40')]()[_0x14bb('0x41')](function(_0x258420){previewRecallmeReminderInterval=_0x258420['previewRecallmeReminderInterval'];});}function isNotNull(_0x2c53f2){return _0x2c53f2!==null&&!_[_0x14bb('0x42')](_0x2c53f2);}function msgResponse(_0x2099a5,_0x435fbe,_0x3562f7){return{'action':_0x2099a5,'response':_0x435fbe,'message':_0x3562f7,'stack':_0x3562f7};}function emit(_0x2345c5,_0x229248,_0x1a444a){io['to'](_0x2345c5)[_0x14bb('0x43')](_0x229248,_0x1a444a);}function emitOutboundVoiceQueueSummary(_0x15d56a){if(_0x15d56a[_0x14bb('0x44')]===_0x14bb('0x45')){logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x14bb('0x46')](_0x15d56a,{'showHidden':![],'depth':null}));emit(util[_0x14bb('0x47')](_0x14bb('0x48'),_0x15d56a[_0x14bb('0x49')]),'voice_queue:save',_0x15d56a);}}function checkGetDataPredictive(_0x49974f){if(isNotNull(_0x49974f)&&!_[_0x14bb('0x4a')](_0x49974f)){loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x4c'));loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x4d'),_0x49974f[_0x14bb('0x4e')]);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x4f'),_0x49974f[_0x14bb('0x50')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49974f[_0x14bb('0x51')]);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x52'),_0x49974f[_0x14bb('0x53')]);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x54'),_0x49974f[_0x14bb('0x55')]);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x56'),_0x49974f['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x14bb('0x57'));if(_0x49974f['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x49974f[_0x14bb('0x58')])&&_0x49974f[_0x14bb('0x58')]>0x0){return!![];}loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x59'));if(!_[_0x14bb('0x42')](_0x49974f[_0x14bb('0x55')])&&_0x49974f['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x14bb('0x4b')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x14bb('0x5a'));}}else{loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x5b'));}return![];}function mergeDataErlangB(_0x44ce7b){return function(_0x5c181a){loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x5c'));loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x5d'),_0x5c181a[_0x14bb('0x5e')]);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x5f'),_0x5c181a['erlangCallToSecond']);loggerPredictive[_0x14bb('0x4b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c181a['erlangAbandonmentRate']);loggerPredictive['info'](_0x14bb('0x60'),_0x5c181a[_0x14bb('0x61')]);loggerPredictive['info'](_0x14bb('0x62'),_0x5c181a[_0x14bb('0x63')]);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x57'));_['merge'](_0x44ce7b,_0x5c181a);};}function ifInterval(_0x255b80,_0x115775){if(_[_0x14bb('0x42')](_0x115775)){return![];}return utils[_0x14bb('0x64')](undefined,_0x115775)<_0x255b80*0x3c;}function clearPredictiveAttributes(_0x2bfb72){if(_0x2bfb72[_0x14bb('0x29')]){_0x2bfb72[_0x14bb('0x29')]=undefined;loggerPredictive[_0x14bb('0x65')](_0x2bfb72[_0x14bb('0x49')],_0x14bb('0x66'));}if(_0x2bfb72[_0x14bb('0x28')]){_0x2bfb72['startPredictive']=undefined;loggerPredictive[_0x14bb('0x65')](_0x2bfb72[_0x14bb('0x49')],_0x14bb('0x67'));}if(_0x2bfb72[_0x14bb('0x68')]){clearInterval(_0x2bfb72['handlePredictive']);_0x2bfb72['handlePredictive']=undefined;loggerPredictive['debug'](_0x2bfb72['name'],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x1d3355,_0x54f7c4){return function(_0x532436){loggerPredictive[_0x14bb('0x69')](_0x54f7c4[_0x14bb('0x49')],_0x1d3355);loggerPredictive[_0x14bb('0x69')](_0x532436['stack']);clearPredictiveAttributes(_0x54f7c4);};}function loggerCatch(_0x4ba769){return function(_0xdfc12b){logger[_0x14bb('0x69')](_0x4ba769,util[_0x14bb('0x46')](_0xdfc12b,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x5d10b6,_0x559772,_0x4fc810){return function(_0x429c24){utils[_0x14bb('0x6a')](_0x559772,_0x4fc810,0x0);logger[_0x14bb('0x69')](_0x5d10b6,util[_0x14bb('0x46')](_0x429c24,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2a261f){return function(_0x27d1e1){if(isNotNull(_0x27d1e1)&&isNotNull(_0x27d1e1[0x0])){if(_0x27d1e1[0x0][_0x14bb('0x6b')]>0x0){_0x2a261f[_0x14bb('0x6c')]=utils[_0x14bb('0x6d')][_0x14bb('0x6e')];logger[_0x14bb('0x4b')](_0x14bb('0x6f')+_0x2a261f['name'],_0x27d1e1[0x0][_0x14bb('0x6b')],_0x14bb('0x70'));}else{_0x2a261f[_0x14bb('0x6c')]=utils[_0x14bb('0x6d')][_0x14bb('0x71')];logger[_0x14bb('0x4b')](_0x14bb('0x72')+_0x2a261f[_0x14bb('0x49')]);}}};}function createObjHistory(_0x22928a,_0x54d2ff,_0x3f53c2,_0x163880,_0x46423e){_0x22928a[_0x14bb('0x6c')]=_0x3f53c2;var _0xb42fe7=new Action(_0x22928a,_0x54d2ff);var _0xbd369a=new History(_0xb42fe7);_0xbd369a[_0x14bb('0x73')]=_0x163880;_0xbd369a[_0x14bb('0x74')]=_0x46423e;_0xbd369a[_0x14bb('0x75')]=_0xb42fe7['starttime'];return _0xbd369a;}function unlockQueueStatus(_0x51f69d,_0xd970ac){setTimeout(function(){if(_['isUndefined'](_0x51f69d['queueStatusComplete'])){loggerBooked['error'](_0x14bb('0x76'),_0xd970ac);}_0x51f69d[_0x14bb('0x77')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0xd970ac,JSON[_0x14bb('0x78')](_[_0x14bb('0x79')](_0x51f69d,[_0x14bb('0x49'),_0x14bb('0x77')])));},0x1f3);}function checkInterval(_0x32162a){return function(){if(!isNotNull(_0x32162a[_0x14bb('0x7a')])){_0x32162a['message']=utils['CAMPAIGN_STATUS'][_0x14bb('0x7b')];throw _0x32162a[_0x14bb('0x49')]+_0x14bb('0x7c');}if(!isNotNull(_0x32162a['Interval'][_0x14bb('0x7d')])){_0x32162a[_0x14bb('0x6c')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x32162a['name']+_0x14bb('0x7c');}if(!isNotNull(_[_0x14bb('0x4a')](_0x32162a[_0x14bb('0x7a')][_0x14bb('0x7d')]))){_0x32162a['message']=utils[_0x14bb('0x6d')][_0x14bb('0x7b')];throw _0x32162a['name']+_0x14bb('0x7c');}};}function checkIsIVRCampaignActive(_0x130676){return function(){if(!utils[_0x14bb('0x7e')](_0x130676)){_0x130676[_0x14bb('0x6c')]=utils[_0x14bb('0x6d')]['INACTIVE'];throw _0x130676['name']+_0x14bb('0x7f');}};}function emitCampaignSummary(_0x2cd000){if(utils['isIVRCampaign'](_0x2cd000)){emit(util[_0x14bb('0x47')]('campaign:ivr:%s',_0x2cd000[_0x14bb('0x49')]),'campaign:save',_0x2cd000);}}function loggerCatchQueueSummary(_0x115438,_0x2bdf5f){return function(_0x6b97ef){clearPredictiveAttributes(_0x2bdf5f);emitCampaignSummary(_0x2bdf5f);loggerSyncQueueSummary[_0x14bb('0x65')](_0x115438,util[_0x14bb('0x46')](_0x6b97ef,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x21acbc){if(_0x21acbc[_0x14bb('0x80')]){if(_0x21acbc[_0x14bb('0x81')]===0x0){_0x21acbc[_0x14bb('0x80')]=![];_0x21acbc['message']=utils['CAMPAIGN_STATUS'][_0x14bb('0x82')];loggerSyncQueueSummary['debug'](_0x14bb('0x83'),_0x21acbc[_0x14bb('0x49')],_0x14bb('0x84'));}else{_0x21acbc['message']=utils[_0x14bb('0x6d')][_0x14bb('0x85')];loggerSyncQueueSummary[_0x14bb('0x65')](_0x14bb('0x83'),_0x21acbc[_0x14bb('0x49')],'is\x20disactive');}emitCampaignSummary(_0x21acbc);}}function myreject(_0x2c0cd8){return function(_0x867659){return _0x2c0cd8(msgResponse(_0x14bb('0x86'),'Error',JSON[_0x14bb('0x78')](_0x867659)));};}Dialer[_0x14bb('0x1a')][_0x14bb('0x87')]=function(_0x421268){return!_[_0x14bb('0x42')](_0x421268)&&_0x421268&&!_[_0x14bb('0x42')](_0x421268[_0x14bb('0x49')])&&!_[_0x14bb('0x42')](_0x421268[_0x14bb('0x88')])&&_0x421268[_0x14bb('0x88')]&&(this[_0x14bb('0x22')][util[_0x14bb('0x47')](_0x14bb('0x89'),_0x421268[_0x14bb('0x49')])][_0x14bb('0x8a')]===_0x14bb('0x8b')||this[_0x14bb('0x22')][util[_0x14bb('0x47')]('SIP/%s',_0x421268['name'])][_0x14bb('0x8a')]==='unmonitored');};Dialer[_0x14bb('0x1a')]['checkIsTrunkReachable']=function(_0xf5b158){var _0x47f87d=this;return function(){if(!_0x47f87d[_0x14bb('0x87')](_0xf5b158[_0x14bb('0x8c')])){if(!_0x47f87d[_0x14bb('0x87')](_0xf5b158[_0x14bb('0x8d')])){_0xf5b158[_0x14bb('0x6c')]=utils[_0x14bb('0x6d')][_0x14bb('0x8e')];throw _0xf5b158['name']+_0x14bb('0x8f');}}};};Dialer[_0x14bb('0x1a')]['checkIfTime']=function(_0x2c7a70,_0x5f1b17,_0x5d48a3,_0x15629f){var _0x4281df=this;return function(){var _0x29a931=!![];return _0x4281df['ifTimeIvr'](_0x2c7a70,_0x5f1b17,_0x5d48a3,_0x15629f,_0x29a931);};};Dialer[_0x14bb('0x1a')]['checkIfTimeIntervals']=function(_0x1c6fe3,_0x2bb29b,_0x984124,_0x590cd2){var _0x3fc554=this;return function(){var _0x489810=![];return _0x3fc554[_0x14bb('0x90')](_0x1c6fe3['Intervals'],_0x2bb29b,_0x984124,_0x590cd2,_0x489810);};};Dialer[_0x14bb('0x1a')][_0x14bb('0x90')]=function(_0x53f902,_0x3b5b5e,_0x283ba8,_0x11c60b,_0x2a07a3){var _0x15b77e=[];return new Promise(function(_0xbefa38,_0x4fda92){if(!isNotNull(_0x53f902)){_0x11c60b[_0x14bb('0x6c')]=utils[_0x14bb('0x6d')][_0x14bb('0x7b')];return _0x4fda92(msgResponse(_0x14bb('0x91'),_0x14bb('0x92'),_0x283ba8+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x14bb('0x4a')](_0x53f902)){_0x11c60b['message']=utils[_0x14bb('0x6d')]['EMPTY_INTERVAL'];return _0x4fda92(msgResponse('ifTime',_0x14bb('0x92'),_0x283ba8+_0x14bb('0x93')));}if(_0x3b5b5e&&_[_0x14bb('0x42')](config[_0x14bb('0x94')][_0x3b5b5e])){_0x11c60b[_0x14bb('0x6c')]=utils[_0x14bb('0x6d')][_0x14bb('0x95')];return _0x4fda92(msgResponse(_0x14bb('0x91'),'Failure',_0x283ba8+_0x14bb('0x96')+_0x3b5b5e));}if(_[_0x14bb('0x97')](_0x53f902)){for(var _0x59fd96=0x0;_0x59fd96<_0x53f902['length'];_0x59fd96+=0x1){_0x15b77e['push'](ami['Action']({'action':'command','command':util[_0x14bb('0x47')](_0x14bb('0x98'),_0x53f902[_0x59fd96]['interval'],!_[_0x14bb('0x42')](config[_0x14bb('0x94')][_0x3b5b5e])?_0x3b5b5e:'')})['then'](function(_0x1dc6a6){return _0x1dc6a6[_0x14bb('0x99')][_0x14bb('0x9a')]('true')>=0x0;})[_0x14bb('0x9b')](myreject(_0x4fda92)));}}else{_0x15b77e[_0x14bb('0x9c')](ami[_0x14bb('0x9d')]({'action':_0x14bb('0x9e'),'command':util[_0x14bb('0x47')](_0x14bb('0x98'),_0x53f902,!_[_0x14bb('0x42')](config[_0x14bb('0x94')][_0x3b5b5e])?_0x3b5b5e:'')})[_0x14bb('0x41')](function(_0x2173b7){return _0x2173b7[_0x14bb('0x99')]['indexOf'](_0x14bb('0x9f'))>=0x0;})['catch'](myreject(_0x4fda92)));}Promise[_0x14bb('0xa0')](_0x15b77e)[_0x14bb('0x41')](function(_0x1d2b4f){var _0x535fe4=_[_0x14bb('0xa1')](_0x1d2b4f);if(_0x535fe4){return _0xbefa38(_0x535fe4);}else{_0x11c60b[_0x14bb('0x6c')]=_0x2a07a3?utils[_0x14bb('0x6d')][_0x14bb('0xa2')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x4fda92(msgResponse(_0x14bb('0xa3'),_0x14bb('0x92'),_0x14bb('0xa4')+_0x2a07a3+'\x20'+_0x283ba8+'\x20Interval\x20is\x20overtime:\x20'+util[_0x14bb('0x46')](_0x53f902,{'showHidden':![],'depth':null})+_0x14bb('0xa5')+_0x3b5b5e));}})['catch'](function(_0x17f834){return _0x4fda92(msgResponse(_0x14bb('0x91'),_0x14bb('0x92'),JSON[_0x14bb('0x78')](_0x17f834)));});});};Dialer[_0x14bb('0x1a')][_0x14bb('0x3e')]=function(){var _0x3d9eef=this;return cmHopper[_0x14bb('0xa6')]({'active':![]},{'where':{'active':!![]}})[_0x14bb('0x41')](function(){setInterval(function(){_0x3d9eef[_0x14bb('0xa7')]();},0x3e8);});};Dialer[_0x14bb('0x1a')][_0x14bb('0xa7')]=function(){var _0x428d71=this;var _0x78cebc;for(var _0x1162e3 in this[_0x14bb('0x21')]){if(typeof this[_0x14bb('0x21')][_0x1162e3]!==_0x14bb('0xa8')){_0x78cebc=this[_0x14bb('0x21')][_0x1162e3];if(utils['isIVRCampaign'](_0x78cebc)&&utils[_0x14bb('0x7e')](_0x78cebc)){_0x78cebc[_0x14bb('0x80')]=!![];Promise[_0x14bb('0xa9')]()[_0x14bb('0x41')](checkIsIVRCampaignActive(_0x78cebc))[_0x14bb('0x41')](checkInterval(_0x78cebc))[_0x14bb('0x41')](_0x428d71['checkIsTrunkReachable'](_0x78cebc))[_0x14bb('0x41')](_0x428d71[_0x14bb('0xaa')](_0x78cebc[_0x14bb('0xab')],_0x78cebc[_0x14bb('0xac')],_0x78cebc[_0x14bb('0x49')],_0x78cebc))[_0x14bb('0x41')](_0x428d71[_0x14bb('0xad')](_0x78cebc[_0x14bb('0x7a')],_0x78cebc[_0x14bb('0xac')],_0x78cebc[_0x14bb('0x49')],_0x78cebc))[_0x14bb('0x41')](_0x428d71['launchHandleIvr'](_0x78cebc))[_0x14bb('0x9b')](loggerCatchQueueSummary(_0x14bb('0xae'),_0x78cebc));}else{notSendMessagesCampaign(_0x78cebc);}}}};Dialer[_0x14bb('0x1a')][_0x14bb('0xaf')]=function(_0x58dc55){if(_0x58dc55[_0x14bb('0xb0')]!==_0x14bb('0xb1')){clearPredictiveAttributes(_0x58dc55);}switch(_0x58dc55[_0x14bb('0xb0')]){case _0x14bb('0xb2'):this[_0x14bb('0xb3')](_0x58dc55,0x1);break;case _0x14bb('0xb4'):this[_0x14bb('0xb3')](_0x58dc55,_0x58dc55[_0x14bb('0xb5')]);break;case _0x14bb('0xb1'):this[_0x14bb('0xb1')](_0x58dc55);break;case _0x14bb('0x8'):this[_0x14bb('0xb3')](_0x58dc55,0x1);break;default:logger[_0x14bb('0x69')](_0x14bb('0xb6'),_0x58dc55['name'],_0x14bb('0xb7'));}};Dialer[_0x14bb('0x1a')][_0x14bb('0x91')]=function(_0xffb50,_0x5b3466){var _0x51276f=_0xffb50['dialTimezone'];var _0x2309e3=_0x5b3466?_0xffb50[_0x14bb('0xab')]:_0xffb50[_0x14bb('0x7a')][_0x14bb('0x7d')];logger[_0x14bb('0xb8')](_0x14bb('0xb9'),_0x2309e3,_0x51276f,_0xffb50[_0x14bb('0x49')],util[_0x14bb('0x47')](_0x14bb('0xba'),_0xffb50[_0x14bb('0x49')],_0xffb50['id']));var _0x36f565=null;return Interval[_0x14bb('0xbb')](_0x2309e3,_0x51276f)[_0x14bb('0x41')](function(_0x75eb90){if(_0x75eb90===!![]){return _0x75eb90;}else{_0xffb50[_0x14bb('0x6c')]=_0x5b3466?utils[_0x14bb('0x6d')][_0x14bb('0xa2')]:utils['CAMPAIGN_STATUS'][_0x14bb('0xbc')];_0x36f565=msgResponse(_0x14bb('0xa3'),_0x14bb('0x92'),_0x14bb('0xa4')+_0x5b3466+'\x20'+_0xffb50[_0x14bb('0x49')]+_0x14bb('0xbd')+util[_0x14bb('0x46')](_0x2309e3,{'showHidden':![],'depth':null})+_0x14bb('0xa5')+_0x51276f);}if(_0x36f565!==null){logger[_0x14bb('0xb8')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x36f565);_0x36f565['isGlobal']=_0x5b3466;throw _0x36f565;}})[_0x14bb('0x9b')](function(_0x164ede){logger[_0x14bb('0x69')](_0x14bb('0xbe'),_0x164ede);throw msgResponse('[ifTime][Action]',_0x14bb('0xbf'),util['inspect'](_0x164ede,{'showHidden':![],'depth':null}));});};Dialer[_0x14bb('0x1a')][_0x14bb('0x2f')]=function(_0xc5ba21){if(this[_0x14bb('0x20')][_0xc5ba21[_0x14bb('0xc0')]]){if(this[_0x14bb('0xc1')][_0xc5ba21['uniqueid']]&&this[_0x14bb('0xc1')][_0xc5ba21[_0x14bb('0xc2')]][_0x14bb('0x44')]!=='ivr'){this['updateOriginated'](this[_0x14bb('0x20')][_0xc5ba21[_0x14bb('0xc0')]]);this['uniqueId'][_0xc5ba21['uniqueid']]['answertime']=moment()[_0x14bb('0x47')](_0x14bb('0xc3'));}}};Dialer['prototype'][_0x14bb('0xc4')]=function(_0x473d89){var _0x4973a6=this['uniqueId'][_0x473d89[_0x14bb('0xc2')]];if(this[_0x14bb('0x20')][_0x473d89[_0x14bb('0xc0')]]){if(_0x4973a6&&_0x4973a6[_0x14bb('0x44')]!=='ivr'){delete this[_0x14bb('0xc1')][_0x473d89[_0x14bb('0xc2')]];this[_0x14bb('0x20')][_0x473d89[_0x14bb('0xc0')]]['outboundAnswerCallsDay']+=0x1;var _0x25a4c1=new AgentComplete(_0x4973a6,_0x473d89);if(_0x473d89['reason']===_0x14bb('0xc5')){_0x25a4c1[_0x14bb('0xc6')]=this[_0x14bb('0x20')][_0x473d89[_0x14bb('0xc0')]][_0x14bb('0xc7')]&&this[_0x14bb('0x20')][_0x473d89['queue']]['dialAgiAfterHangupAgent']?moment()[_0x14bb('0x47')](_0x14bb('0xc3')):undefined;}hopperUtils[_0x14bb('0xc8')](_0x25a4c1)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0xc9')));hopperUtils[_0x14bb('0xca')](_0x25a4c1)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0xcb')));}}};Dialer[_0x14bb('0x1a')]['syncQueueCallerAbandon']=function(_0x265c24){var _0x19f33c=this[_0x14bb('0xc1')][_0x265c24['uniqueid']];var _0x29b9c1=this;var _0x1e0af5=![];var _0x15f260;var _0x270bd4;if(this[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]]){if(_0x19f33c&&_0x19f33c[_0x14bb('0x44')]!=='ivr'){delete this[_0x14bb('0xc1')][_0x265c24[_0x14bb('0xc2')]];this[_0x14bb('0xcc')](this[_0x14bb('0x20')][_0x265c24['queue']]);_0x19f33c[_0x14bb('0xcd')]=moment()[_0x14bb('0x47')]('YYYY-MM-DD\x20HH:mm:ss');var _0x583e71=new QueueCallerAbandon(_0x19f33c,_0x265c24);if(utils['getSeconds'](_0x19f33c['droptime'],_0x19f33c[_0x14bb('0xce')])>=_0x19f33c['dialQueueTimeout']){this[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0x51')]+=0x1;this[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0xcf')]+=0x1;this[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0xd0')]+=0x1;_0x583e71[_0x14bb('0x73')]=0xa;_0x583e71[_0x14bb('0x74')]=_0x14bb('0xd1');_0x583e71['dropreason']='TIMEOUT';_0x583e71[_0x14bb('0xc6')]=this[_0x14bb('0x20')][_0x265c24['queue']][_0x14bb('0xc7')]?moment()[_0x14bb('0x47')](_0x14bb('0xc3')):undefined;_0x583e71['countdropretry']+=0x1;_0x583e71[_0x14bb('0xd2')]+=0x1;_0x15f260=this[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0xd3')];_0x270bd4=this[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0xd4')];hopperUtils[_0x14bb('0xd5')](_0x583e71,_0x583e71[_0x14bb('0x73')],_0x19f33c[_0x14bb('0xd6')])[_0x14bb('0x41')](function(_0xbc1bdb){_0x1e0af5=_0xbc1bdb[_0x14bb('0xd7')]==0x1;if(_0x583e71[_0x14bb('0xd8')]>=_0x29b9c1[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0xd9')]){_0x29b9c1[_0x14bb('0xda')](_0x583e71,_0xbc1bdb[_0x14bb('0xd7')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x583e71['countdropretry'],'scheduledat':moment()[_0x14bb('0xdb')](_0x29b9c1[_0x14bb('0x20')][_0x265c24['queue']]['dialDropRetryFrequency'],_0x14bb('0xdc'))['format'](_0x14bb('0xc3')),'ContactId':_0x19f33c[_0x14bb('0xdd')],'ListId':_0x19f33c[_0x14bb('0xde')],'VoiceQueueId':_0x19f33c[_0x14bb('0xdf')]||undefined,'CampaignId':_0x19f33c['CampaignId']||undefined})[_0x14bb('0x9b')](loggerCatch(_0x14bb('0xe0')));var _0x2bf462=new History(_0x583e71);_0x2bf462[_0x14bb('0x73')]=0xa;_0x2bf462['statedesc']=_0x14bb('0xd1');_0x2bf462[_0x14bb('0xe1')]=moment()[_0x14bb('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x2bf462['endtime']=_0x2bf462[_0x14bb('0xe1')];_0x2bf462[_0x14bb('0xe2')]=_0x583e71['calleridname'];_0x2bf462[_0x14bb('0xe3')]=_0x583e71[_0x14bb('0xe3')];hopperUtils['createHistory'](_0x2bf462)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0xe4')));}})[_0x14bb('0x41')](function(){if(_0x1e0af5)hopperUtils['swapAdditionalPhones'](_0x583e71,_0x15f260,_0x270bd4)[_0x14bb('0x41')](function(){return 0x1;});});}else{this[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0x53')]+=0x1;this[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0xe5')]+=0x1;_0x583e71[_0x14bb('0x73')]=0xb;_0x583e71['statedesc']=_0x14bb('0xe6');_0x583e71[_0x14bb('0xe7')]='CALLEREXIT';_0x583e71[_0x14bb('0xe8')]+=0x1;_0x583e71[_0x14bb('0xd2')]+=0x1;_0x15f260=this['voiceQueues'][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0xe9')];_0x270bd4=this[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0xd4')];hopperUtils[_0x14bb('0xd5')](_0x583e71,_0x583e71[_0x14bb('0x73')],_0x19f33c[_0x14bb('0xd6')])[_0x14bb('0x41')](function(_0x22cf40){if(_0x583e71[_0x14bb('0xe8')]>=_0x29b9c1['voiceQueues'][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0xea')]){_0x29b9c1[_0x14bb('0xda')](_0x583e71,_0x22cf40[_0x14bb('0xd7')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x583e71[_0x14bb('0xe8')],'scheduledat':moment()[_0x14bb('0xdb')](_0x29b9c1[_0x14bb('0x20')][_0x265c24[_0x14bb('0xc0')]][_0x14bb('0xe9')],'minutes')[_0x14bb('0x47')](_0x14bb('0xc3')),'ContactId':_0x19f33c[_0x14bb('0xdd')],'ListId':_0x19f33c[_0x14bb('0xde')],'VoiceQueueId':_0x19f33c[_0x14bb('0xdf')]||undefined,'CampaignId':_0x19f33c[_0x14bb('0xeb')]||undefined})['catch'](loggerCatch(_0x14bb('0xec')));var _0xf65da4=new History(_0x583e71);_0xf65da4[_0x14bb('0x73')]=0xb;_0xf65da4[_0x14bb('0x74')]=_0x14bb('0xe6');_0xf65da4[_0x14bb('0xe1')]=moment()['format'](_0x14bb('0xc3'));_0xf65da4[_0x14bb('0x75')]=_0xf65da4[_0x14bb('0xe1')];_0xf65da4['calleridname']=_0x583e71['calleridname'];_0xf65da4[_0x14bb('0xe3')]=_0x583e71[_0x14bb('0xe3')];hopperUtils[_0x14bb('0xc8')](_0xf65da4)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0xed')));}})['then'](function(){if(_0x1e0af5)hopperUtils['swapAdditionalPhones'](_0x583e71,_0x15f260,_0x270bd4)[_0x14bb('0x41')](function(){return 0x1;});});}}}};Dialer[_0x14bb('0x1a')][_0x14bb('0xee')]=function(_0x2c8345){if(this[_0x14bb('0x25')][_0x2c8345[_0x14bb('0xc2')]]){this[_0x14bb('0x25')][_0x2c8345[_0x14bb('0xc2')]][_0x14bb('0xef')]=_0x2c8345[_0x14bb('0xef')];}if(this[_0x14bb('0xc1')][_0x2c8345[_0x14bb('0xc2')]]){this[_0x14bb('0xc1')][_0x2c8345[_0x14bb('0xc2')]][_0x14bb('0xef')]=_0x2c8345[_0x14bb('0xef')];}};Dialer['prototype'][_0x14bb('0x3c')]=function(_0x336ca6){if(!this[_0x14bb('0x25')][_0x336ca6[_0x14bb('0xf0')]]){return;}var _0x428e9b=this[_0x14bb('0x20')][this[_0x14bb('0x25')][_0x336ca6[_0x14bb('0xf0')]][_0x14bb('0xc0')]]['strategy']||_0x14bb('0xf1');if(_0x428e9b===_0x14bb('0xf2')){if(this[_0x14bb('0x25')][_0x336ca6[_0x14bb('0xf0')]]&&_[_0x14bb('0xf3')](this[_0x14bb('0x25')][_0x336ca6[_0x14bb('0xf0')]][_0x14bb('0xf4')])&&_0x336ca6[_0x14bb('0x8a')]==='1'&&_0x336ca6[_0x14bb('0xf5')]==='0'){if(this[_0x14bb('0xf6')][_0x336ca6[_0x14bb('0xf7')]]){if(!this['agents'][_0x336ca6[_0x14bb('0xf7')]][_0x14bb('0xf4')]){this[_0x14bb('0xf6')][_0x336ca6[_0x14bb('0xf7')]][_0x14bb('0xf4')]=!![];this[_0x14bb('0x25')][_0x336ca6['actionid']][_0x14bb('0xf4')]=!![];this[_0x14bb('0x25')][_0x336ca6[_0x14bb('0xf0')]][_0x14bb('0xf7')]=_0x336ca6[_0x14bb('0xf7')];}}}}else if(_0x428e9b==='rrmemory'){if(this[_0x14bb('0x25')][_0x336ca6[_0x14bb('0xf0')]]){if(this['agents'][_0x336ca6[_0x14bb('0xf7')]]){this['actions'][_0x336ca6[_0x14bb('0xf0')]][_0x14bb('0xf7')]=_0x336ca6[_0x14bb('0xf7')];if(_[_0x14bb('0xf3')](this[_0x14bb('0x2b')][this['actions'][_0x336ca6['actionid']]['queue']])){this[_0x14bb('0x2b')][this[_0x14bb('0x25')][_0x336ca6['actionid']][_0x14bb('0xc0')]]=[];}this['queueBooked'][this['actions'][_0x336ca6[_0x14bb('0xf0')]][_0x14bb('0xc0')]][_0x14bb('0x9c')](_[_0x14bb('0xf8')](_[_0x14bb('0x79')](this[_0x14bb('0x25')][_0x336ca6[_0x14bb('0xf0')]],['idHopper',_0x14bb('0xf7')]),{'status':_0x336ca6['status'],'paused':_0x336ca6[_0x14bb('0xf5')]}));}}}};Dialer[_0x14bb('0x1a')][_0x14bb('0xf9')]=function(_0x2de9bc){if(!this['actions'][_0x2de9bc[_0x14bb('0xf0')]]){return;}var _0xa52848=this;var _0x3616ae=this['voiceQueues'][this['actions'][_0x2de9bc[_0x14bb('0xf0')]]['queue']];var _0x29f5e1=_0x3616ae[_0x14bb('0xfa')]||'rrmemory';if(_0x29f5e1===_0x14bb('0xf2')){if(this['actions'][_0x2de9bc[_0x14bb('0xf0')]]&&this[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]]['stateinterface']){this[_0x14bb('0x1f')]['run'](this[_0x14bb('0x25')][_0x2de9bc['actionid']][_0x14bb('0xfb')],this[_0x14bb('0x25')][_0x2de9bc['actionid']]['stateinterface'])[_0x14bb('0x9b')](function(_0x5588a5){logger[_0x14bb('0x69')](_0x14bb('0xfc'),util[_0x14bb('0x46')](_0x5588a5,{'showHidden':![],'depth':null}));})[_0x14bb('0x1d')](function(){_0xa52848[_0x14bb('0xcc')](_0xa52848[_0x14bb('0x20')][_0xa52848[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]][_0x14bb('0xc0')]]);_0xa52848[_0x14bb('0xf6')][_0xa52848[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]]['stateinterface']][_0x14bb('0xf4')]=![];delete _0xa52848['actions'][_0x2de9bc[_0x14bb('0xf0')]];unlockQueueStatus(_0x3616ae);});}else{this[_0x14bb('0xcc')](this[_0x14bb('0x20')][this['actions'][_0x2de9bc[_0x14bb('0xf0')]]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]]['ContactId'],'ListId':this[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]][_0x14bb('0xde')],'VoiceQueueId':this[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]][_0x14bb('0xdf')]||undefined,'CampaignId':this[_0x14bb('0x25')][_0x2de9bc['actionid']][_0x14bb('0xeb')]||undefined})[_0x14bb('0x9b')](loggerCatch(_0x14bb('0xfd')));delete this['actions'][_0x2de9bc[_0x14bb('0xf0')]];unlockQueueStatus(_0x3616ae);}}else if(_0x29f5e1===_0x14bb('0xf1')){var _0x232804;if(this[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]]&&!_[_0x14bb('0x4a')](this[_0x14bb('0x2b')][this[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]]['queue']])){if(this[_0x14bb('0x2c')][_0xa52848[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]][_0x14bb('0xc0')]]){this[_0x14bb('0x2c')][_0xa52848[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]][_0x14bb('0xc0')]]=this['queueBookedRR'][this[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]]['queue']]?this[_0x14bb('0x2c')][this['actions'][_0x2de9bc[_0x14bb('0xf0')]][_0x14bb('0xc0')]]:this[_0x14bb('0x2b')][this[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]][_0x14bb('0xc0')]]?this[_0x14bb('0x2b')][this[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]][_0x14bb('0xc0')]][_0x14bb('0xfe')]||0x0:0x0;}this[_0x14bb('0x2b')][this[_0x14bb('0x25')][_0x2de9bc[_0x14bb('0xf0')]][_0x14bb('0xc0')]]['_rr']=this[_0x14bb('0x2c')][this['actions'][_0x2de9bc[_0x14bb('0xf0')]][_0x14bb('0xc0')]];for(var _0x17b256=0x0;_0x17b256=_0x398c15['dialGlobalMaxRetry']){_0x3af5e3['stateGlobal'](_0x18f5b4,_0x270c0a,_0x1dd7c4,_0x14bb('0x128'));}else{if(_0x18f5b4[_0x14bb('0x126')]>=_0x398c15[_0x14bb('0x129')]){_0x3af5e3[_0x14bb('0x12a')](_0x18f5b4,_0x270c0a,_0x1dd7c4,_0x14bb('0x12b'));}else{hopperUtils[_0x14bb('0x107')]({'active':![],'countmachineretry':_0x18f5b4[_0x14bb('0x126')],'scheduledat':moment()[_0x14bb('0xdb')](_0x398c15['dialMachineRetryFrequency'],_0x14bb('0xdc'))[_0x14bb('0x47')](_0x14bb('0xc3')),'ContactId':_0x18f5b4[_0x14bb('0xdd')],'ListId':_0x18f5b4[_0x14bb('0xde')],'VoiceQueueId':_0x18f5b4[_0x14bb('0xdf')]||undefined,'CampaignId':_0x18f5b4[_0x14bb('0xeb')]||undefined})[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x12c')));_0x270c0a({'reschedule':0x1});}}});}if(_0x8743e0['type']===_0x14bb('0x10b')&&this[_0x14bb('0x21')][_0x8743e0[_0x14bb('0xc0')]]['dialAMDActive']&&_0x4948b8[_0x14bb('0x115')]===_0x14bb('0x116')){delete this['uniqueId'][_0x4948b8['uniqueid']];this[_0x14bb('0xcc')](this[_0x14bb('0x21')][_0x8743e0[_0x14bb('0xc0')]]);_0x16e9b6=new Hangup(_0x8743e0,_0x4948b8);_0x16e9b6[_0x14bb('0x73')]=0x12;_0x16e9b6['statedesc']=_0x14bb('0x12d');_0x16e9b6[_0x14bb('0x119')]=_0x14bb('0x11a');ami[_0x14bb('0x43')]('custom:amd',ut[_0x14bb('0x11c')](_0x16e9b6,_0x14bb('0x11d')));this[_0x14bb('0x11e')](_0x16e9b6,_0x14bb('0x12e'),'[syncHangupInAMDIvr]');}if(_0x8743e0[_0x14bb('0x44')]===_0x14bb('0x10b')&&this[_0x14bb('0x21')][_0x8743e0[_0x14bb('0xc0')]]['dialAMDActive']&&_0x4948b8[_0x14bb('0x115')]===_0x14bb('0x121')){return new Promise(function(_0x1feba1,_0x7cc5c0){delete _0x3af5e3[_0x14bb('0xc1')][_0x4948b8['uniqueid']];_0x3af5e3[_0x14bb('0xcc')](_0x3af5e3[_0x14bb('0x21')][_0x8743e0[_0x14bb('0xc0')]]);_0x3af5e3['campaigns'][_0x8743e0['queue']][_0x14bb('0x117')]+=0x1;_0x3af5e3[_0x14bb('0x21')][_0x8743e0[_0x14bb('0xc0')]][_0x14bb('0x118')]+=0x1;var _0x548110=_0x3af5e3[_0x14bb('0x21')][_0x8743e0['queue']];var _0x1de423=new Hangup(_0x8743e0,_0x4948b8);_0x1de423[_0x14bb('0x73')]=0x13;_0x1de423[_0x14bb('0x74')]='Machine';_0x1de423['membername']=_0x14bb('0x11a');_0x1de423[_0x14bb('0x126')]+=0x1;_0x1de423[_0x14bb('0xd2')]+=0x1;_0x1de423[_0x14bb('0x11d')]=!![];ami['emit'](_0x14bb('0x11b'),ut[_0x14bb('0x11c')](_0x1de423,_0x14bb('0x11d')));hopperUtils[_0x14bb('0xc8')](_0x1de423)[_0x14bb('0x9b')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1de423['countbusyretry']+_0x1de423[_0x14bb('0x124')]+_0x1de423[_0x14bb('0x12f')]+_0x1de423[_0x14bb('0x125')]+_0x1de423[_0x14bb('0xd8')]+_0x1de423['countabandonedretry']+_0x1de423[_0x14bb('0x126')]+_0x1de423['countagentrejectretry']>=_0x548110[_0x14bb('0x130')]){_0x3af5e3['stateGlobal'](_0x1de423,_0x1feba1,_0x7cc5c0,'reason19\x20machine....');}else{if(_0x1de423['countmachineretry']>=_0x548110[_0x14bb('0x129')]){_0x3af5e3[_0x14bb('0x12a')](_0x1de423,_0x1feba1,_0x7cc5c0,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x1de423[_0x14bb('0x126')],'scheduledat':moment()[_0x14bb('0xdb')](_0x548110[_0x14bb('0x131')],_0x14bb('0xdc'))[_0x14bb('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1de423['ContactId'],'ListId':_0x1de423[_0x14bb('0xde')],'VoiceQueueId':_0x1de423[_0x14bb('0xdf')]||undefined,'CampaignId':_0x1de423[_0x14bb('0xeb')]||undefined})[_0x14bb('0x9b')](loggerCatch('[rescheduleContact][Machine]'));_0x1feba1({'reschedule':0x1});}}});}}};Dialer[_0x14bb('0x1a')][_0x14bb('0x37')]=function(_0x3b9b61){var _0x4fec64=this['uniqueId'][_0x3b9b61[_0x14bb('0xc2')]];var _0x571f27;if(_0x4fec64&&_0x4fec64[_0x14bb('0x44')]===_0x14bb('0x10b')){delete this[_0x14bb('0xc1')][_0x3b9b61[_0x14bb('0xc2')]];this[_0x14bb('0xcc')](this['campaigns'][_0x4fec64['queue']]);this[_0x14bb('0x21')][_0x4fec64[_0x14bb('0xc0')]][_0x14bb('0x132')]+=0x1;_0x571f27=new Hangup(_0x4fec64,_0x3b9b61);hopperUtils[_0x14bb('0xc8')](_0x571f27)[_0x14bb('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x14bb('0xca')](_0x571f27)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x133')));}if(_0x4fec64&&_0x4fec64[_0x14bb('0x44')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x4fec64[_0x14bb('0xc0')]][_0x14bb('0x134')])){delete this[_0x14bb('0xc1')][_0x3b9b61[_0x14bb('0xc2')]];this[_0x14bb('0xcc')](this['voiceQueues'][_0x4fec64['queue']]);this[_0x14bb('0x20')][_0x4fec64['queue']][_0x14bb('0x117')]+=0x1;this[_0x14bb('0x20')][_0x4fec64[_0x14bb('0xc0')]][_0x14bb('0x118')]+=0x1;_0x571f27=new Hangup(_0x4fec64,_0x3b9b61);_0x571f27[_0x14bb('0x73')]=0x10;_0x571f27['statedesc']=_0x14bb('0x135');_0x571f27['membername']=_0x14bb('0x136');hopperUtils[_0x14bb('0xc8')](_0x571f27)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x137')));hopperUtils['moveContactManagedDialer'](_0x571f27)[_0x14bb('0x9b')](loggerCatch('[syncHangupIvr]'));}if(_0x4fec64&&_0x4fec64['type']!==_0x14bb('0x10b')&&!isNotNull(this[_0x14bb('0x20')][_0x4fec64['queue']][_0x14bb('0x134')])){delete this[_0x14bb('0xc1')][_0x3b9b61['uniqueid']];this[_0x14bb('0xcc')](this['voiceQueues'][_0x4fec64['queue']]);this[_0x14bb('0x20')][_0x4fec64[_0x14bb('0xc0')]][_0x14bb('0x138')]+=0x1;_0x571f27=new Hangup(_0x4fec64,_0x3b9b61);_0x571f27[_0x14bb('0x73')]=0xc;_0x571f27[_0x14bb('0x74')]=_0x3b9b61[_0x14bb('0x139')];_0x571f27['membername']=_0x14bb('0x13a');hopperUtils[_0x14bb('0xc8')](_0x571f27)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x137')));hopperUtils[_0x14bb('0xca')](_0x571f27)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x133')));}};Dialer[_0x14bb('0x1a')][_0x14bb('0xa')]=function(_0x4ff8a2){var _0x515a25=this;if(!_0x515a25[_0x14bb('0x2d')][_0x4ff8a2[_0x14bb('0x49')]]){_0x515a25['queuesSummary'][_0x4ff8a2['name']]={'running':![]};}else if(_0x515a25[_0x14bb('0x2d')][_0x4ff8a2[_0x14bb('0x49')]]['running']===!![]){return;}else if(_0x515a25['queuesSummary'][_0x4ff8a2[_0x14bb('0x49')]]['running']===![]){_0x515a25['queuesSummary'][_0x4ff8a2[_0x14bb('0x49')]][_0x14bb('0x13b')]=!![];}var _0x5a30f0=_0x515a25[_0x14bb('0x20')][_0x4ff8a2[_0x14bb('0x49')]];var _0x5b19c5=_0x5a30f0[_0x14bb('0x6c')]!==utils[_0x14bb('0x6d')][_0x14bb('0x82')];var _0x28e6a2=utils[_0x14bb('0x13c')](_0x5a30f0);_0x5a30f0[_0x14bb('0x13d')]=utils['getQueueCampaignStatusMessage'](_0x5a30f0,_0x515a25[_0x14bb('0x22')]);Promise[_0x14bb('0xa9')]()[_0x14bb('0x41')](function(){if(_0x5a30f0[_0x14bb('0x13d')]===utils[_0x14bb('0x6d')]['INACTIVE']){if(_0x5b19c5){clearPredictiveAttributes(_0x5a30f0);_0x4ff8a2[_0x14bb('0x28')]=undefined;_0x4ff8a2[_0x14bb('0x29')]=undefined;}if(_0x5a30f0[_0x14bb('0x13d')]===utils[_0x14bb('0x6d')][_0x14bb('0x82')]){_0x4ff8a2[_0x14bb('0x13e')]=0x0;_0x4ff8a2[_0x14bb('0xf5')]=0x0;_0x4ff8a2['inUse']=0x0;_0x4ff8a2['talking']=0x0;_0x4ff8a2[_0x14bb('0x13f')]=0x0;}}else if(_0x5a30f0[_0x14bb('0x13d')]===utils[_0x14bb('0x6d')][_0x14bb('0x140')]&&!_0x28e6a2){return _0x515a25[_0x14bb('0x91')](_0x5a30f0,!![])[_0x14bb('0x41')](function(){return _0x515a25[_0x14bb('0x91')](_0x5a30f0,![]);})[_0x14bb('0x41')](function(){return _0x515a25[_0x14bb('0xaf')](_0x5a30f0);})[_0x14bb('0x9b')](function(_0x4c1440){loggerSyncQueueSummary[_0x14bb('0x65')]('[syncQueueSummary]',util[_0x14bb('0x46')](_0x4c1440,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5a30f0);});}else{clearPredictiveAttributes(_0x5a30f0);}})['then'](function(){var _0xbbf02b=_0x4ff8a2[_0x14bb('0x141')](_0x5a30f0);if(_0xbbf02b||_0x5a30f0[_0x14bb('0x142')]){_0x5a30f0['queueSummaryCountersUpdated']=![];_0x4ff8a2[_0x14bb('0x143')](_0x5a30f0);Object[_0x14bb('0x144')](_0x5a30f0,_0x4ff8a2);emitOutboundVoiceQueueSummary(_0x4ff8a2);}_0x515a25['queuesSummary'][_0x5a30f0[_0x14bb('0x49')]][_0x14bb('0x13b')]=![];})[_0x14bb('0x9b')](function(_0x1cd610){logger[_0x14bb('0x69')](_0x14bb('0x145'),util[_0x14bb('0x46')](_0x1cd610,{'showHidden':![],'depth':null}));_0x515a25[_0x14bb('0x2d')][_0x5a30f0['name']][_0x14bb('0x13b')]=![];});};Dialer['prototype'][_0x14bb('0x35')]=_[_0x14bb('0x146')](function(){var _0x2a96ce=_['filter'](this[_0x14bb('0x20')],function(_0x461ba7){return _0x461ba7[_0x14bb('0x147')];});var _0x3db9b7=_[_0x14bb('0x148')](this['agents'],function(_0x307a6a){return _0x307a6a[_0x14bb('0x149')]&&_0x307a6a[_0x14bb('0x8a')]==='reachable';});if(_0x2a96ce[_0x14bb('0xff')]>0x0&&_0x3db9b7[_0x14bb('0xff')]>0x0){return Promise[_0x14bb('0xa9')]()[_0x14bb('0x41')](cmHopper[_0x14bb('0x14a')](_[_0x14bb('0x14b')](_0x2a96ce,'id'),previewRecallmeReminderInterval,_[_0x14bb('0x14b')](_0x3db9b7,'id')))[_0x14bb('0x41')](function(_0x3c3d7a){for(var _0x27d0c8=0x0;_0x27d0c8<_0x3c3d7a['length'];_0x27d0c8++){var _0x31e6cd=_0x3c3d7a[_0x27d0c8][_0x14bb('0x14c')][_0x14bb('0x49')];if(_0x31e6cd)io['to'](util['format'](_0x14bb('0x14d'),_0x31e6cd))[_0x14bb('0x43')]('user:dialPreviewRecallReminder',{'hopper':_0x3c3d7a[_0x27d0c8]});}})[_0x14bb('0x9b')](function(_0x677d2c){logger[_0x14bb('0x69')](_0x14bb('0x14e'),_0x677d2c);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x14bb('0x1a')]['loopClearZombieChannels']=function(){var _0x178bac=this;setInterval(function(){_0x178bac[_0x14bb('0x14f')](_0x178bac[_0x14bb('0xc1')],_0x14bb('0x150'));_0x178bac[_0x14bb('0x14f')](_0x178bac[_0x14bb('0x25')],_0x14bb('0x151'));},0x32c8);};Dialer[_0x14bb('0x1a')]['clearZombieChannels']=function(_0x1d8ab0,_0x46c97){var _0x165ec3=this;for(var _0x44271e in _0x1d8ab0){if(typeof _0x1d8ab0[_0x44271e]!==_0x14bb('0xa8')){this[_0x14bb('0x1e')][_0x14bb('0x1b')](function(){if(!_[_0x14bb('0xf3')](_0x1d8ab0[_0x44271e])){return ami[_0x14bb('0x9d')]({'action':_0x14bb('0x8a'),'channel':_0x1d8ab0[_0x44271e]['channel']})[_0x14bb('0x9b')](function(_0x2dcd2a){if(_0x2dcd2a[_0x14bb('0x6c')]===_0x14bb('0x152')){setTimeout(function(){if(_0x1d8ab0[_0x44271e]&&_0x1d8ab0[_0x44271e][_0x14bb('0x44')]!==_0x14bb('0x10b')){_0x165ec3['updateOriginated'](_0x165ec3[_0x14bb('0x20')][_0x1d8ab0[_0x44271e][_0x14bb('0xc0')]]);logger[_0x14bb('0x69')](_0x14bb('0x153'),_0x46c97,_0x44271e,_0x1d8ab0[_0x44271e]['queue']);delete _0x1d8ab0[_0x44271e];}if(_0x1d8ab0[_0x44271e]&&_0x1d8ab0[_0x44271e]['type']===_0x14bb('0x10b')){_0x165ec3['updateOriginated'](_0x165ec3[_0x14bb('0x21')][_0x1d8ab0[_0x44271e][_0x14bb('0xc0')]]);logger[_0x14bb('0x69')]('[Dialer][checkChannel][ivr]',_0x46c97,_0x44271e,_0x1d8ab0[_0x44271e]['queue']);delete _0x1d8ab0[_0x44271e];}},0x2328);}});}});}}};Dialer[_0x14bb('0x1a')][_0x14bb('0x154')]=function(_0x5a0194){return Promise['resolve']()[_0x14bb('0x41')](voiceQueueRt['getVoiceQueueRtPauses'](_0x5a0194))[_0x14bb('0x9b')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x464eed){if(!_[_0x14bb('0x42')](_0x464eed)&&_0x464eed!==null){if(typeof _0x464eed[_0x14bb('0x81')]!==_0x14bb('0xa8')){if(_0x464eed['originated']>0x0){_0x464eed[_0x14bb('0x81')]-=0x1;}else{logger[_0x14bb('0x69')](_0x14bb('0x155'));}}}else{logger['error'](_0x14bb('0x156'));}};Dialer['prototype'][_0x14bb('0x157')]=function(_0x176734,_0x5c5dab){var _0x2a8d2f=this;return function(_0x4af428){_0x2a8d2f['updateOriginated'](_0x5c5dab);logger[_0x14bb('0x69')](_0x176734,util['inspect'](_0x4af428,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x14bb('0x158')]=function(_0x176c9f,_0x2c7868,_0x55cf5b){var _0x1e58b6={'state':0x19,'statedesc':_0x14bb('0x159')};this[_0x14bb('0xcc')](_0x2c7868);this['saveInDb'](_['merge'](_0x1e58b6,_['pick'](_0x55cf5b,[_0x14bb('0xdd'),_0x14bb('0xde'),_0x14bb('0x15a'),_0x14bb('0xdf'),_0x14bb('0xeb')])),'[emptyContact][createHistory]',_0x14bb('0x15b'));logger[_0x14bb('0x69')](_0x176c9f);};Dialer['prototype'][_0x14bb('0x11e')]=function(_0x54e7c7,_0x549c84,_0x5f22dd){hopperUtils[_0x14bb('0xc8')](_0x54e7c7)[_0x14bb('0x9b')](loggerCatch(_0x549c84));hopperUtils['moveContactManagedDialer'](_0x54e7c7)[_0x14bb('0x9b')](loggerCatch(_0x5f22dd));};Dialer[_0x14bb('0x1a')]['queueCallerAbandonCreateState']=function(_0x305d79,_0x328270){hopperUtils['createHistory'](_0x305d79)['catch'](loggerCatch(_0x14bb('0xc9')));if(_0x328270==0x0){hopperUtils[_0x14bb('0xca')](_0x305d79)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x15c')));}};Dialer[_0x14bb('0x1a')]['checkPreviewRecallReminder']=function(_0x1a990b){return Promise[_0x14bb('0xa9')]()[_0x14bb('0x41')](cmHopper[_0x14bb('0x14a')](_0x1a990b['id'],previewRecallmeReminderInterval))[_0x14bb('0x41')](function(_0x1fe4dc){for(var _0x1f9ebf=0x0;_0x1f9ebf<_0x1fe4dc['length'];_0x1f9ebf++){var _0x53251d=_0x1fe4dc[_0x1f9ebf]['Agent'][_0x14bb('0x49')];if(_0x53251d)io['to'](util[_0x14bb('0x47')](_0x14bb('0x14d'),_0x53251d))[_0x14bb('0x43')](_0x14bb('0x15d'),{'hopper':_0x1fe4dc[_0x1f9ebf]});}})[_0x14bb('0x9b')](function(){});};Dialer[_0x14bb('0x1a')]['launchHandleIvr']=function(_0x1d3f8d){var _0x2c4318=this;return function(){_0x2c4318[_0x14bb('0x15e')](_0x1d3f8d);};};Dialer[_0x14bb('0x1a')][_0x14bb('0x15f')]=function(_0x53667d,_0x4555b5){var _0x26face=this;var _0x5a8479=uuid['v4']();this[_0x14bb('0x25')][_0x5a8479]=new Action(_0x53667d,_0x4555b5,_0x5a8479);return new Promise(function(_0x4d7116,_0x175d45){if(_['isUndefined'](_0x53667d)&&typeof _0x53667d!==_0x14bb('0x160')){return _0x175d45(msgResponse(_0x14bb('0x161'),_0x14bb('0x92'),_0x14bb('0x162')));}if(_['isUndefined'](_0x4555b5['phone'])||_0x4555b5[_0x14bb('0x163')]===null){return _0x175d45(msgResponse(_0x14bb('0x161'),'Failure',_0x14bb('0x164')));}var _0x203be8={'XMD-CALLERID':_0x26face[_0x14bb('0x25')][_0x5a8479][_0x14bb('0x165')](),'XMD-AGI':_0x53667d[_0x14bb('0x134')]?util[_0x14bb('0x47')]('\x22agi://%s/square,%s\x22',ipAgi,_0x53667d[_0x14bb('0x134')]):_0x14bb('0x166'),'XMD-AGIAFTER':_0x53667d['dialQueueProject2']?util[_0x14bb('0x47')](_0x14bb('0x167'),ipAgi,_0x53667d['dialQueueProject2']):_0x14bb('0x166'),'XMD-QUEUE':utils[_0x14bb('0x168')](_0x53667d)?util[_0x14bb('0x47')]('\x22%s,%s%s,,,%s\x22',_0x53667d['name'],_0x53667d[_0x14bb('0x169')]||'',_0x53667d[_0x14bb('0x16a')]?'c':'',_0x53667d[_0x14bb('0x16b')]||0x3):_0x14bb('0x166'),'XMD-CONTACTID':_0x4555b5['ContactId'],'XMD-CDRTYPE':_0x14bb('0x16c'),'CALLERID(all)':_0x26face[_0x14bb('0x25')][_0x5a8479]['getCaller'](),'XMD-AMD':_0x53667d[_0x14bb('0x114')]?_0x14bb('0x140'):_0x14bb('0x166'),'XMD-DESTINATION':_0x14bb('0x113')};if(_0x53667d['dialAMDActive']){_0x203be8[_0x14bb('0x16d')]=_0x53667d[_0x14bb('0x16e')]||0x9c4;_0x203be8[_0x14bb('0x16f')]=_0x53667d[_0x14bb('0x170')]||0x5dc;_0x203be8[_0x14bb('0x171')]=_0x53667d[_0x14bb('0x172')]||0x320;_0x203be8[_0x14bb('0x173')]=_0x53667d[_0x14bb('0x174')]||0x1388;_0x203be8[_0x14bb('0x175')]=_0x53667d[_0x14bb('0x176')]||0x64;_0x203be8[_0x14bb('0x177')]=_0x53667d[_0x14bb('0x178')]||0x32;_0x203be8[_0x14bb('0x179')]=_0x53667d[_0x14bb('0x17a')]||0x3;_0x203be8[_0x14bb('0x17b')]=_0x53667d[_0x14bb('0x17c')]||0x100;_0x203be8['XMD-AMDMAXIMUMWORDLENGTH']=_0x53667d[_0x14bb('0x17d')]||0x1388;}if(utils[_0x14bb('0x168')](_0x53667d)){_0x203be8[_0x14bb('0x17e')]=_0x4555b5[_0x14bb('0xdf')];}else{_0x203be8[_0x14bb('0x17f')]=_0x4555b5[_0x14bb('0xeb')];}for(var _0x1a6a6c in _0x4555b5[_0x14bb('0x180')]){if(typeof _0x4555b5['Contact'][_0x1a6a6c]!==_0x14bb('0xa8')){if(isNotNull(_0x4555b5[_0x14bb('0x180')][_0x1a6a6c])&&_0x1a6a6c!=='id'&&_0x1a6a6c!==_0x14bb('0x181')&&_0x1a6a6c!==_0x14bb('0x182')&&_0x1a6a6c!==_0x14bb('0x183')){_0x203be8[util[_0x14bb('0x47')](_0x14bb('0x184'),_0x14bb('0x185'),_[_0x14bb('0x186')](_0x1a6a6c))]=_0x4555b5[_0x14bb('0x180')][_0x1a6a6c];}}}var _0x345c8f=_0x26face[_0x14bb('0x87')](_0x53667d[_0x14bb('0x8c')])?utils['getCallerId'](_0x53667d[_0x14bb('0x8c')][_0x14bb('0x187')],_0x53667d['dialOriginateCallerIdName'],_0x53667d[_0x14bb('0x188')]>0x0?utils[_0x14bb('0x189')](_0x53667d[_0x14bb('0x18a')],_0x53667d['dialRandomLastDigitCallerIdNumber']):_0x53667d['dialOriginateCallerIdNumber']):utils['getCallerId'](_['isNil'](_0x53667d[_0x14bb('0x8d')])?_0x53667d[_0x14bb('0x8c')]['callerid']:_0x53667d[_0x14bb('0x8d')][_0x14bb('0x187')],_0x53667d[_0x14bb('0x18b')],_0x53667d['dialRandomLastDigitCallerIdNumber']>0x0?utils['getCallerIdRandom'](_0x53667d['dialOriginateCallerIdNumber'],_0x53667d[_0x14bb('0x188')]):_0x53667d[_0x14bb('0x18a')]);if(_0x345c8f){_0x203be8[_0x14bb('0x18c')]=_0x26face[_0x14bb('0x25')][_0x5a8479][_0x14bb('0x18d')]=utils[_0x14bb('0x18e')](_0x345c8f);_0x203be8['XMD-ORIGINATECALLERIDNUM']=_0x4555b5[_0x14bb('0x163')];}_0x53667d[_0x14bb('0x18f')]=_0x203be8;return ami[_0x14bb('0x9d')]({'actionid':_0x5a8479,'action':_0x14bb('0x161'),'channel':_0x26face[_0x14bb('0x87')](_0x53667d['Trunk'])?util[_0x14bb('0x47')](_0x14bb('0x190'),_0x53667d[_0x14bb('0x8c')][_0x14bb('0x49')],isNotNull(_0x53667d[_0x14bb('0x191')])?_0x53667d['dialPrefix'][_0x14bb('0x192')]()||'':'',_0x53667d[_0x14bb('0x193')]>0x0?_0x4555b5['phone'][_0x14bb('0x194')](_0x53667d['dialCutDigit']):_0x4555b5['phone']):util[_0x14bb('0x47')](_0x14bb('0x190'),_[_0x14bb('0xf3')](_0x53667d[_0x14bb('0x8d')])?_0x53667d[_0x14bb('0x8c')][_0x14bb('0x49')]:_0x53667d['TrunkBackup'][_0x14bb('0x49')],isNotNull(_0x53667d[_0x14bb('0x191')])?_0x53667d[_0x14bb('0x191')]['trim']()||'':'',_0x53667d[_0x14bb('0x193')]>0x0?_0x4555b5[_0x14bb('0x163')][_0x14bb('0x194')](_0x53667d[_0x14bb('0x193')]):_0x4555b5[_0x14bb('0x163')]),'callerid':_0x345c8f,'Exten':_0x14bb('0x113'),'Context':_0x14bb('0x195'),'Priority':'1','variable':_0x203be8,'timeout':(_0x53667d['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5a8479})[_0x14bb('0x41')](function(_0x4d4643){return _0x4d7116(_0x4d4643);})[_0x14bb('0x9b')](function(_0x4c6ad8){_0x53667d[_0x14bb('0x196')]+=0x1;var _0x35165e=new History(_0x26face['actions'][_0x5a8479]);logger[_0x14bb('0x69')](util[_0x14bb('0x47')](_0x14bb('0x197'),JSON[_0x14bb('0x78')](_0x4c6ad8)));_0x35165e[_0x14bb('0x73')]=0xe;_0x35165e[_0x14bb('0x74')]=_0x14bb('0x198');_0x35165e[_0x14bb('0xe1')]=moment()[_0x14bb('0x47')](_0x14bb('0xc3'));_0x35165e[_0x14bb('0x75')]=_0x35165e[_0x14bb('0xe1')];hopperUtils[_0x14bb('0xc8')](_0x35165e)[_0x14bb('0x9b')](loggerCatch('[originate][error]'));_0x26face[_0x14bb('0xca')](_0x35165e)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x199')))['finally'](function(){delete _0x26face[_0x14bb('0x25')][_0x5a8479];return _0x175d45(msgResponse('originate',_0x14bb('0xbf'),_0x14bb('0x19a')));});});});};Dialer[_0x14bb('0x1a')][_0x14bb('0x19b')]=function(_0x5d0b4d,_0x1cb428,_0x5b46cd){var _0x15aed6=new History(_0x1cb428);if(_0x15aed6[_0x14bb('0x123')]+_0x15aed6[_0x14bb('0x124')]+_0x15aed6[_0x14bb('0x12f')]+_0x15aed6[_0x14bb('0x125')]+_0x15aed6[_0x14bb('0xd8')]+_0x15aed6[_0x14bb('0xe8')]+_0x15aed6[_0x14bb('0x126')]+_0x15aed6[_0x14bb('0x127')]>=_0x5b46cd[_0x14bb('0x130')]-0x1){return!![];}switch(_0x5d0b4d){case 0x3:if(_0x15aed6[_0x14bb('0x12f')]>=_0x5b46cd[_0x14bb('0x19c')]-0x1){return!![];}hopperUtils[_0x14bb('0x107')]({'active':![],'countnoanswerretry':_0x15aed6[_0x14bb('0x12f')]+=0x1,'scheduledat':moment()[_0x14bb('0xdb')](_0x5b46cd['dialNoAnswerRetryFrequency'],'minutes')[_0x14bb('0x47')](_0x14bb('0xc3')),'ContactId':_0x15aed6[_0x14bb('0xdd')],'ListId':_0x15aed6[_0x14bb('0xde')],'VoiceQueueId':_0x15aed6[_0x14bb('0xdf')]||undefined,'CampaignId':_0x15aed6[_0x14bb('0xeb')]||undefined})[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x19d')));break;case 0x5:if(_0x15aed6[_0x14bb('0x123')]>=_0x5b46cd[_0x14bb('0x19e')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x15aed6[_0x14bb('0x123')]+=0x1,'scheduledat':moment()['add'](_0x5b46cd[_0x14bb('0x19f')],_0x14bb('0xdc'))[_0x14bb('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x15aed6[_0x14bb('0xdd')],'ListId':_0x15aed6['ListId'],'VoiceQueueId':_0x15aed6['VoiceQueueId']||undefined,'CampaignId':_0x15aed6['CampaignId']||undefined})[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x1a0')));break;case 0x8:if(_0x15aed6[_0x14bb('0x124')]>=_0x5b46cd[_0x14bb('0x1a1')]-0x1){return!![];}hopperUtils[_0x14bb('0x107')]({'active':![],'countcongestionretry':_0x15aed6[_0x14bb('0x124')]+=0x1,'scheduledat':moment()[_0x14bb('0xdb')](_0x5b46cd['dialCongestionRetryFrequency'],'minutes')[_0x14bb('0x47')](_0x14bb('0xc3')),'ContactId':_0x15aed6['ContactId'],'ListId':_0x15aed6[_0x14bb('0xde')],'VoiceQueueId':_0x15aed6[_0x14bb('0xdf')]||undefined,'CampaignId':_0x15aed6[_0x14bb('0xeb')]||undefined})[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x1a2')));break;case 0x0:if(_0x15aed6[_0x14bb('0x125')]>=_0x5b46cd[_0x14bb('0x1a3')]-0x1){return!![];}else{hopperUtils[_0x14bb('0x107')]({'active':![],'countnosuchnumberretry':_0x15aed6[_0x14bb('0x125')]+=0x1,'scheduledat':moment()[_0x14bb('0xdb')](_0x5b46cd[_0x14bb('0x1a4')],_0x14bb('0xdc'))['format'](_0x14bb('0xc3')),'ContactId':_0x15aed6[_0x14bb('0xdd')],'ListId':_0x15aed6[_0x14bb('0xde')],'VoiceQueueId':_0x15aed6[_0x14bb('0xdf')]||undefined,'CampaignId':_0x15aed6[_0x14bb('0xeb')]||undefined})[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x1a5')));}break;case 0xa:if(_0x15aed6[_0x14bb('0xd8')]>=_0x5b46cd[_0x14bb('0xd9')]-0x1){return!![];}hopperUtils[_0x14bb('0x107')]({'active':![],'countdropretry':_0x15aed6[_0x14bb('0xd8')]+=0x1,'scheduledat':moment()['add'](_0x5b46cd['dialDropRetryFrequency'],_0x14bb('0xdc'))['format'](_0x14bb('0xc3')),'ContactId':_0x15aed6['ContactId'],'ListId':_0x15aed6[_0x14bb('0xde')],'VoiceQueueId':_0x15aed6[_0x14bb('0xdf')]||undefined,'CampaignId':_0x15aed6[_0x14bb('0xeb')]||undefined})['catch'](loggerCatch(_0x14bb('0xe0')));break;case 0xb:if(_0x15aed6[_0x14bb('0xe8')]>=_0x5b46cd[_0x14bb('0xea')]-0x1){return!![];}hopperUtils[_0x14bb('0x107')]({'active':![],'countabandonedretry':_0x15aed6[_0x14bb('0xe8')]+=0x1,'scheduledat':moment()[_0x14bb('0xdb')](_0x5b46cd['dialAbandonedRetryFrequency'],_0x14bb('0xdc'))[_0x14bb('0x47')](_0x14bb('0xc3')),'ContactId':_0x15aed6[_0x14bb('0xdd')],'ListId':_0x15aed6['ListId'],'VoiceQueueId':_0x15aed6[_0x14bb('0xdf')]||undefined,'CampaignId':_0x15aed6[_0x14bb('0xeb')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x15aed6['countmachineretry']>=_0x5b46cd[_0x14bb('0x129')]-0x1){return!![];}hopperUtils[_0x14bb('0x107')]({'active':![],'countmachineretry':_0x15aed6[_0x14bb('0x126')]+=0x1,'scheduledat':moment()[_0x14bb('0xdb')](_0x5b46cd[_0x14bb('0x131')],_0x14bb('0xdc'))[_0x14bb('0x47')](_0x14bb('0xc3')),'ContactId':_0x15aed6[_0x14bb('0xdd')],'ListId':_0x15aed6['ListId'],'VoiceQueueId':_0x15aed6[_0x14bb('0xdf')]||undefined,'CampaignId':_0x15aed6['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x15aed6[_0x14bb('0x127')]>=_0x5b46cd['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x14bb('0x107')]({'active':![],'countagentrejectretry':_0x15aed6[_0x14bb('0x127')]+=0x1,'scheduledat':moment()['add'](_0x5b46cd[_0x14bb('0x1a6')],'minutes')[_0x14bb('0x47')](_0x14bb('0xc3')),'ContactId':_0x15aed6['ContactId'],'ListId':_0x15aed6[_0x14bb('0xde')],'VoiceQueueId':_0x15aed6[_0x14bb('0xdf')]||undefined,'CampaignId':_0x15aed6[_0x14bb('0xeb')]||undefined})[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x1a7')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x3fb917,_0xb5f26d,_0x265920){var _0xc39bc3=this;var _0x128c20=new History(_0x3fb917);var _0x14197a=![];var _0x566f71;var _0x53d8dd;return new Promise(function(_0x3b929d,_0x316abe){if(_[_0x14bb('0x42')](_0xb5f26d)&&typeof _0xb5f26d!==_0x14bb('0x160')){return _0x316abe(msgResponse(_0x14bb('0x1a8'),_0x14bb('0x92'),'entity\x20is\x20undefine'));}if(_[_0x14bb('0x42')](_0x265920)&&typeof _0x265920!==_0x14bb('0x160')){return _0x316abe(msgResponse(_0x14bb('0x1a8'),_0x14bb('0x92'),_0x14bb('0x1a9')));}hopperUtils['verifyAdditionalPhones'](_0x128c20,_0x265920[_0x14bb('0x1aa')],_0xb5f26d)[_0x14bb('0x41')](function(_0x1b001f){if(_0x1b001f['additional']==0x1)_0x14197a=!![];switch(_0x265920['reason']){case'0':_0xb5f26d['outboundNoSuchCallsDay']+=0x1;_0x128c20[_0x14bb('0x73')]=0x0;_0x128c20[_0x14bb('0x74')]=_0x14bb('0x1ab');_0x128c20[_0x14bb('0x125')]+=0x1;_0x128c20[_0x14bb('0xd2')]+=0x1;ami[_0x14bb('0x43')](_0x14bb('0x1ac'),ut['buildObj'](_0x3fb917,_0x14bb('0x1ad')));_0x566f71=_0xb5f26d[_0x14bb('0x1a4')];_0x53d8dd=_0xb5f26d[_0x14bb('0xd4')];hopperUtils[_0x14bb('0xc8')](_0x128c20)['catch'](loggerCatch(_0x14bb('0x1ae')));if(_0xc39bc3[_0x14bb('0x19b')](0x0,_0x3fb917,_0xb5f26d)&&!_0x14197a){if(_0x128c20['countnosuchnumberretry']>=_0xb5f26d[_0x14bb('0x1a3')]){_0xc39bc3[_0x14bb('0x12a')](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1af'));}else{_0xc39bc3[_0x14bb('0x1b0')](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1af'));}}break;case'3':_0xb5f26d[_0x14bb('0x1b1')]+=0x1;_0x128c20[_0x14bb('0x73')]=0x3;_0x128c20['statedesc']=_0x14bb('0x1b2');_0x128c20['countnoanswerretry']+=0x1;_0x128c20[_0x14bb('0xd2')]+=0x1;var _0x55b6f6=ut['buildNoAnswerEventPayload'](_0x3fb917,_0xb5f26d);ami[_0x14bb('0x43')]('custom:agentnoanswer',_0x55b6f6);_0x566f71=_0xb5f26d[_0x14bb('0x1b3')];_0x53d8dd=_0xb5f26d[_0x14bb('0xd4')];hopperUtils[_0x14bb('0xc8')](_0x128c20)[_0x14bb('0x9b')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0xc39bc3[_0x14bb('0x19b')](0x3,_0x3fb917,_0xb5f26d)&&!_0x14197a){if(_0x128c20[_0x14bb('0x12f')]>=_0xb5f26d[_0x14bb('0x19c')]){_0xc39bc3[_0x14bb('0x12a')](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1b4'));}else{_0xc39bc3[_0x14bb('0x1b0')](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1b4'));}}break;case'5':_0xb5f26d[_0x14bb('0x1b5')]+=0x1;_0x128c20['state']=0x5;_0x128c20[_0x14bb('0x74')]='Busy';_0x128c20[_0x14bb('0x123')]+=0x1;_0x128c20['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut[_0x14bb('0x11c')](_0x3fb917,_0x14bb('0x1b6')));_0x566f71=_0xb5f26d['dialBusyRetryFrequency'];_0x53d8dd=_0xb5f26d[_0x14bb('0xd4')];hopperUtils[_0x14bb('0xc8')](_0x128c20)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x1b7')));if(_0xc39bc3['checkRetriveMax'](0x5,_0x3fb917,_0xb5f26d)&&!_0x14197a){if(_0x128c20[_0x14bb('0x123')]>=_0xb5f26d[_0x14bb('0x19e')]){_0xc39bc3['createStateFinal'](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1b8'));}else{_0xc39bc3['stateGlobal'](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1b8'));}}break;case'8':_0xb5f26d[_0x14bb('0x1b9')]+=0x1;_0x128c20[_0x14bb('0x73')]=0x8;_0x128c20[_0x14bb('0x74')]=_0x14bb('0x1ba');_0x128c20[_0x14bb('0x124')]+=0x1;_0x128c20[_0x14bb('0xd2')]+=0x1;_0x566f71=_0xb5f26d[_0x14bb('0x1bb')];_0x53d8dd=_0xb5f26d[_0x14bb('0xd4')];ami[_0x14bb('0x43')](_0x14bb('0x1bc'),ut[_0x14bb('0x11c')](_0x3fb917,_0x14bb('0x1bd')));hopperUtils['createHistory'](_0x128c20)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x1be')));if(_0xc39bc3[_0x14bb('0x19b')](0x8,_0x3fb917,_0xb5f26d)&&!_0x14197a){if(_0x128c20[_0x14bb('0x124')]>=_0xb5f26d['dialCongestionMaxRetry']){_0xc39bc3['createStateFinal'](_0x128c20,_0x3b929d,_0x316abe,'reason\x208\x20congestion');}else{_0xc39bc3['stateGlobal'](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1bf'));}}break;case'11':_0xb5f26d[_0x14bb('0x1c0')]+=0x1;_0x128c20[_0x14bb('0x73')]=0xb;_0x128c20[_0x14bb('0x74')]=_0x14bb('0xe6');_0x128c20[_0x14bb('0xe8')]+=0x1;_0x128c20[_0x14bb('0xd2')]+=0x1;_0x566f71=_0xb5f26d[_0x14bb('0xe9')];_0x53d8dd=_0xb5f26d[_0x14bb('0xd4')];hopperUtils[_0x14bb('0xc8')](_0x128c20)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0xed')));if(_0xc39bc3[_0x14bb('0x19b')](0xb,_0x3fb917,_0xb5f26d)&&!_0x14197a){if(_0x128c20[_0x14bb('0xe8')]>=_0xb5f26d['dialAbandonedMaxRetry']){_0xc39bc3[_0x14bb('0x12a')](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1c1'));}else{_0xc39bc3[_0x14bb('0x1b0')](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1c1'));}}break;case'20':_0xb5f26d[_0x14bb('0x1c2')]+=0x1;_0x128c20[_0x14bb('0x73')]=0x14;_0x128c20['statedesc']=_0x14bb('0x1c3');_0x128c20[_0x14bb('0x127')]+=0x1;_0x128c20[_0x14bb('0xd2')]+=0x1;_0x566f71=_0xb5f26d['dialAgentRejectRetryFrequency'];_0x53d8dd=_0xb5f26d[_0x14bb('0xd4')];ami[_0x14bb('0x43')](_0x14bb('0x1c4'),ut['buildObj'](_0x3fb917,_0x14bb('0x1c5')));hopperUtils[_0x14bb('0xc8')](_0x128c20)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x1c6')));if(_0xc39bc3[_0x14bb('0x19b')](0x14,_0x3fb917,_0xb5f26d)&&!_0x14197a){if(_0x128c20[_0x14bb('0x127')]>=_0xb5f26d[_0x14bb('0x1c7')]){_0xc39bc3[_0x14bb('0x12a')](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1c8'));}else{_0xc39bc3['stateGlobal'](_0x128c20,_0x3b929d,_0x316abe,_0x14bb('0x1c8'));}}break;default:_0xb5f26d[_0x14bb('0x138')]+=0x1;_0x128c20['state']=0xc;_0x128c20['statedesc']=_0x265920[_0x14bb('0x1aa')];_0x566f71=_0xb5f26d[_0x14bb('0x1a6')];_0x53d8dd=_0xb5f26d['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x128c20)[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x1c9')));if(_0xc39bc3[_0x14bb('0x19b')](_0x265920['reason'],_0x3fb917,_0xb5f26d)&&!_0x14197a){if(_0x128c20['countbusyretry']+_0x128c20[_0x14bb('0x124')]+_0x128c20[_0x14bb('0x12f')]+_0x128c20[_0x14bb('0x125')]+_0x128c20[_0x14bb('0xd8')]+_0x128c20['countabandonedretry']+_0x128c20[_0x14bb('0x126')]+_0x128c20[_0x14bb('0x127')]>=_0xb5f26d[_0x14bb('0x130')]){_0xc39bc3[_0x14bb('0x1b0')](_0x128c20,_0x3b929d,_0x316abe,_0x265920[_0x14bb('0x1aa')]);}else{_0xc39bc3[_0x14bb('0x12a')](_0x128c20,_0x3b929d,_0x316abe,_0x265920[_0x14bb('0x1aa')]);}}}})[_0x14bb('0x41')](function(){if(_0x14197a){hopperUtils[_0x14bb('0x1ca')](_0x128c20,_0x566f71,_0x53d8dd)[_0x14bb('0x41')](function(){return _0x3b929d(0x1);});}});});};Dialer[_0x14bb('0x1a')][_0x14bb('0x1b0')]=function(_0x12005d,_0x1ff6f4,_0xf0e49d,_0x499c35){var _0x10226d=new Final(_0x12005d);_0x10226d[_0x14bb('0x73')]=0xf;_0x10226d[_0x14bb('0x74')]=_0x14bb('0x1cb');this[_0x14bb('0x12a')](_0x10226d,_0x1ff6f4,_0xf0e49d,_0x499c35);};Dialer[_0x14bb('0x1a')]['createStateFinal']=function(_0x439824,_0x5d0060,_0x42a42e,_0x153766){hopperUtils[_0x14bb('0xca')](_0x439824)['then'](function(){return _0x5d0060(msgResponse('[callProgressDetecting]',_0x14bb('0x10d'),_0x153766));})['catch'](function(){return _0x42a42e(msgResponse(_0x14bb('0x1cc'),'Failure',_0x14bb('0x1cd')));});};Dialer['prototype']['predictive']=function(_0x24f26c){var _0x12bcef=_0x24f26c[_0x14bb('0x1ce')]/0x64;var _0x4110e5=_0x24f26c['outboundDropCallsDayTimeout']/(_0x24f26c[_0x14bb('0xcf')]+_0x24f26c[_0x14bb('0x117')]);var _0x534976=Math[_0x14bb('0x1cf')](_0x24f26c[_0x14bb('0x1d0')]*(_0x24f26c['predictiveIntervalMaxThreshold']/0x64));var _0x2bcec6=Math[_0x14bb('0x1cf')](_0x24f26c['predictiveIntervalAvailable']*(_0x24f26c['predictiveIntervalMinThreshold']/0x64));var _0x583354=_0x24f26c[_0x14bb('0x13e')]+_0x24f26c[_0x14bb('0x1d1')];var _0xbffee1=Math[_0x14bb('0x1d2')](_0x24f26c['erlangCalls']*_0x24f26c[_0x14bb('0x63')]*_0x24f26c[_0x14bb('0x1d3')]*_0x24f26c['predictiveIntervalMultiplicativeFactor']);if(_[_0x14bb('0x42')](_0x24f26c[_0x14bb('0x29')])){if(!_[_0x14bb('0x42')](_0x24f26c[_0x14bb('0x28')])){_0x24f26c[_0x14bb('0x28')]=undefined;loggerPredictive['error'](_0x14bb('0x1d4'),_0x14bb('0x1d5'));}if(!_[_0x14bb('0x42')](_0x24f26c[_0x14bb('0x68')])){loggerPredictive[_0x14bb('0x69')](_0x14bb('0x1d4'),_0x14bb('0x1d6'));clearInterval(_0x24f26c['handlePredictive']);_0x24f26c[_0x14bb('0x68')]=undefined;}_0x24f26c[_0x14bb('0x29')]=moment()['format'](_0x14bb('0xc3'));loggerPredictive[_0x14bb('0x4b')](_0x24f26c[_0x14bb('0x49')],_0x14bb('0x1d7'),_0x24f26c['startProgressive']);this[_0x14bb('0xb3')](_0x24f26c,0x1);}else if(ifInterval(_0x24f26c['dialPredictiveInterval'],_0x24f26c[_0x14bb('0x29')])){this[_0x14bb('0xb3')](_0x24f26c,0x1);loggerPredictiveCalls['info'](_0x14bb('0x1d8'),_0x24f26c[_0x14bb('0x29')],_0x24f26c[_0x14bb('0x49')]);_0x24f26c[_0x14bb('0x5e')]=0x0;_0x24f26c[_0x14bb('0xd0')]=0x0;}else if(_0x12bcef<_0x4110e5&&_0x24f26c[_0x14bb('0x1d9')]===_0x14bb('0x1da')){clearPredictiveAttributes(_0x24f26c);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x1db'),_0x14bb('0x1dc'),_0x4110e5,_0x14bb('0x29'),_0x24f26c[_0x14bb('0x49')]);}else if(_0xbffee1<_0x24f26c[_0x14bb('0xd0')]&&_0x24f26c[_0x14bb('0x1d9')]===_0x14bb('0x1da')){clearPredictiveAttributes(_0x24f26c);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x1dd'),_0x14bb('0x1de'),_0xbffee1,_0x14bb('0x1df'),_0x24f26c[_0x14bb('0xd0')],_0x14bb('0x29'),_0x24f26c[_0x14bb('0x49')]);}else if(!ifInterval(_0x24f26c[_0x14bb('0x1e0')],_0x24f26c[_0x14bb('0x29')])&&_[_0x14bb('0x42')](_0x24f26c['startPredictive'])&&!_['isUndefined'](_0x24f26c[_0x14bb('0x29')])){_0x24f26c[_0x14bb('0x28')]=moment()[_0x14bb('0x47')](_0x14bb('0xc3'));loggerPredictive['info'](_0x24f26c[_0x14bb('0x49')],_0x14bb('0x1e1'),_0x24f26c[_0x14bb('0x28')]);hopperUtils[_0x14bb('0x1e2')](_0x24f26c['dialPredictiveInterval'])[_0x14bb('0x41')](this[_0x14bb('0x1e3')](_0x24f26c))[_0x14bb('0x41')](mergeDataErlangB(_0x24f26c))[_0x14bb('0x41')](this[_0x14bb('0x1e4')](_0x24f26c))['catch'](loggerCatchPredictive(_0x14bb('0x1e5'),_0x24f26c));}else if(!ifInterval(_0x24f26c[_0x14bb('0x1e0')],_0x24f26c[_0x14bb('0x28')])){_0x24f26c['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x24f26c[_0x14bb('0x28')]=moment()[_0x14bb('0x47')](_0x14bb('0xc3'));loggerPredictive[_0x14bb('0x4b')](_0x24f26c[_0x14bb('0x49')],_0x14bb('0x1e6'),_0x24f26c[_0x14bb('0x28')]);clearInterval(_0x24f26c[_0x14bb('0x68')]);_0x24f26c['handlePredictive']=undefined;hopperUtils[_0x14bb('0x1e2')](_0x24f26c[_0x14bb('0x1e0')])[_0x14bb('0x41')](this[_0x14bb('0x1e3')](_0x24f26c))[_0x14bb('0x41')](mergeDataErlangB(_0x24f26c))['then'](this[_0x14bb('0x1e4')](_0x24f26c))[_0x14bb('0x9b')](loggerCatchPredictive(_0x14bb('0x1e7'),_0x24f26c));}else if(_0x24f26c[_0x14bb('0x1d0')]&&_0x583354<_0x24f26c['predictiveIntervalAvailable']-_0x2bcec6){clearPredictiveAttributes(_0x24f26c);loggerPredictive['info'](_0x24f26c[_0x14bb('0x49')],_0x14bb('0x1e8'),_0x583354,_0x14bb('0x1e9'),_0x24f26c[_0x14bb('0x1d0')],'-',_0x2bcec6,'=',_0x24f26c[_0x14bb('0x1d0')]-_0x2bcec6,')');}else if(_0x24f26c[_0x14bb('0x1d0')]&&_0x583354>_0x24f26c['predictiveIntervalAvailable']+_0x534976){clearPredictiveAttributes(_0x24f26c);loggerPredictive['info'](_0x24f26c[_0x14bb('0x49')],_0x14bb('0x1e8'),_0x583354,_0x14bb('0x1ea'),_0x24f26c['predictiveIntervalAvailable'],'+',_0x534976,'=',_0x24f26c[_0x14bb('0x1d0')]+_0x534976,')');}};Dialer[_0x14bb('0x1a')][_0x14bb('0x1e3')]=function(_0x19bf2c){var _0x1f220b=this;return function(_0x536018){return new Promise(function(_0x54835e,_0x61e580){_[_0x14bb('0xf8')](_0x19bf2c,_0x536018[0x0]);if(checkGetDataPredictive(_0x536018[0x0])){var _0x20536f=_0x19bf2c[_0x14bb('0x1d0')]=_0x19bf2c[_0x14bb('0x1d1')]+_0x19bf2c[_0x14bb('0x13e')];var _0x20e4e3=_0x19bf2c[_0x14bb('0x1e0')]*0x3c;var _0x2fcf16=_0x536018[0x0][_0x14bb('0x58')]+_0x536018[0x0][_0x14bb('0x55')];var _0x511c35=(_0x536018[0x0][_0x14bb('0x50')]+_0x536018[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x536018[0x0][_0x14bb('0x53')])/_0x536018[0x0]['predictiveIntervalTotalCalls'];_0x19bf2c[_0x14bb('0x1d3')]=_0x511c35>0x0?_0x511c35:0x1;switch(_0x19bf2c[_0x14bb('0x1d9')]){case _0x14bb('0x1da'):var _0x40b0dd=_0x19bf2c['dialPredictiveOptimizationPercentage']/0x64;return _0x1f220b[_0x14bb('0x1eb')](_0x20536f,_0x20e4e3,_0x2fcf16,_0x511c35,_0x40b0dd)['then'](function(_0x4303ba){return _0x54835e(_0x4303ba);});case'agentBusyFactor':var _0x1c6f29=_0x19bf2c[_0x14bb('0x1ce')]/0x64;return _0x1f220b[_0x14bb('0x1ec')](_0x20536f,_0x20e4e3,_0x2fcf16,_0x511c35,_0x1c6f29)[_0x14bb('0x41')](function(_0x6877f7){return _0x54835e(_0x6877f7);});default:return _0x61e580(msgResponse('[getDataPredictive]',_0x14bb('0x92'),_0x14bb('0x1ed')));}}else{return _0x61e580(msgResponse(_0x14bb('0x1ee'),_0x14bb('0x92'),_0x14bb('0x1ef')));}});};};Dialer['prototype'][_0x14bb('0x1f0')]=function(_0x195fea){var _0x80793e=this;return function(_0x2f7b23){return new Promise(function(_0x590ed0,_0x2f491e){_[_0x14bb('0xf8')](_0x195fea,_0x2f7b23[0x0]);if(checkGetDataPredictive(_0x2f7b23[0x0])){loggerPredictive[_0x14bb('0x4b')](JSON[_0x14bb('0x78')](_0x2f7b23[0x0]));if(_0x195fea[_0x14bb('0x1d9')]===_0x14bb('0x1da')){return _0x80793e[_0x14bb('0x154')](_0x195fea['id'])[_0x14bb('0x41')](function(_0xc108d2){var _0x313d7c=_0x195fea['loggedIn']-_0xc108d2[0x0]['outboundQueuePauses'];var _0x443121=_0x195fea[_0x14bb('0x1e0')]*0x3c;var _0xd80709=_0x2f7b23[0x0][_0x14bb('0x58')]+_0x2f7b23[0x0][_0x14bb('0x55')];var _0x4f582a=(_0x2f7b23[0x0][_0x14bb('0x50')]+_0x2f7b23[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2f7b23[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2f7b23[0x0][_0x14bb('0x4e')];var _0x386569=_0x195fea[_0x14bb('0x1ce')]/0x64;_0x195fea[_0x14bb('0x1f1')]=_0xc108d2[0x0][_0x14bb('0x1f2')]||0x0;_0x195fea[_0x14bb('0x1d3')]=_0x4f582a>0x0?_0x4f582a:0x1;return _0x80793e[_0x14bb('0x1eb')](_0x313d7c,_0x443121,_0xd80709,_0x4f582a,_0x386569);})[_0x14bb('0x41')](function(_0x1a291a){return _0x590ed0(_0x1a291a);})['catch'](function(_0x4efee9){return _0x2f491e(msgResponse(_0x14bb('0x1f3'),_0x14bb('0x92'),JSON[_0x14bb('0x78')](_0x4efee9)));});}if(_0x195fea['dialPredictiveOptimization']==='agentBusyFactor'){return _0x80793e[_0x14bb('0x154')](_0x195fea['id'])[_0x14bb('0x41')](function(_0x4f97ac){var _0x25f59d=_0x195fea[_0x14bb('0x1f4')]-_0x4f97ac[0x0][_0x14bb('0x1f2')];var _0x8833cf=_0x195fea[_0x14bb('0x1e0')]*0x3c;var _0x37501f=_0x2f7b23[0x0][_0x14bb('0x58')]+_0x2f7b23[0x0][_0x14bb('0x55')];var _0xc84b59=(_0x2f7b23[0x0][_0x14bb('0x50')]+_0x2f7b23[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2f7b23[0x0][_0x14bb('0x53')])/_0x2f7b23[0x0][_0x14bb('0x4e')];var _0x5e66e8=_0x195fea['dialPredictiveOptimizationPercentage']/0x64;_0x195fea[_0x14bb('0x1f1')]=_0x4f97ac[0x0][_0x14bb('0x1f2')]||0x0;_0x195fea['predictiveIntervalHitRate']=_0xc84b59>0x0?_0xc84b59:0x1;return _0x80793e[_0x14bb('0x1ec')](_0x25f59d,_0x8833cf,_0x37501f,_0xc84b59,_0x5e66e8);})[_0x14bb('0x41')](function(_0x5655e7){return _0x590ed0(_0x5655e7);})[_0x14bb('0x9b')](function(_0x1c0b6a){return _0x2f491e(msgResponse(_0x14bb('0x1f3'),'Failure',JSON['stringify'](_0x1c0b6a)));});}}else{return _0x2f491e(msgResponse(_0x14bb('0x1ee'),_0x14bb('0x92'),'check\x20failure'));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x4876d9){var _0x17c4d5=this;return function(){var _0x552ded=0x0;var _0x339b13=Math['floor'](_0x4876d9[_0x14bb('0x1f5')]*0x3e8);if(_0x339b13>0x0){_0x339b13=_0x339b13<0x64?0x64:_0x339b13;loggerPredictive['info'](_0x4876d9[_0x14bb('0x49')],'one\x20call\x20every:',_0x339b13,_0x14bb('0x1f6'));_0x4876d9['handlePredictive']=setInterval(function(){_0x17c4d5[_0x14bb('0x68')](_0x4876d9);loggerPredictiveCalls[_0x14bb('0x4b')](_0x14bb('0x1f7'),_0x552ded+=0x1);},_0x339b13);}else{loggerPredictive[_0x14bb('0x4b')](_0x4876d9[_0x14bb('0x49')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x14bb('0x1a')][_0x14bb('0x1f8')]=function(_0x1fd000,_0x1b85a5){var _0x31dcd4=this;return function(_0x3fc426){if(_[_0x14bb('0x4a')](_0x3fc426)){if(_[_0x14bb('0xf3')](_0x1b85a5[_0x14bb('0x15a')])||!_0x1b85a5[_0x14bb('0x1f9')]){if(_0x1fd000[_0x14bb('0xb0')]===_0x14bb('0x8')){_0x1fd000[_0x14bb('0x77')]=_['isUndefined'](_0x1fd000[_0x14bb('0x77')])?!![]:_0x1fd000[_0x14bb('0x77')];var _0x2a1687=uuid['v4']();_0x31dcd4[_0x14bb('0x25')][_0x2a1687]=new Action(_0x1fd000,_0x1b85a5,_0x2a1687);loggerBooked[_0x14bb('0x4b')](_0x14bb('0x1fa'),_0x2a1687,_0x14bb('0x1fb'),JSON[_0x14bb('0x78')](_0x1fd000['queueStatusComplete']),'Queue:\x20',_0x1fd000['name']);if(_0x1fd000[_0x14bb('0x77')]){_0x1fd000[_0x14bb('0x77')]=![];_0x31dcd4[_0x14bb('0x2b')][_0x31dcd4[_0x14bb('0x25')][_0x2a1687]['queue']]=[];ami[_0x14bb('0x9d')]({'actionid':_0x2a1687,'action':_0x14bb('0x1fc'),'queue':_0x1fd000[_0x14bb('0x49')]})[_0x14bb('0x9b')](function(){_0x31dcd4[_0x14bb('0xcc')](_0x1fd000);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x31dcd4[_0x14bb('0x25')][_0x2a1687][_0x14bb('0xdd')],'ListId':_0x31dcd4[_0x14bb('0x25')][_0x2a1687][_0x14bb('0xde')],'VoiceQueueId':_0x31dcd4[_0x14bb('0x25')][_0x2a1687][_0x14bb('0xdf')]||undefined,'CampaignId':_0x31dcd4[_0x14bb('0x25')][_0x2a1687][_0x14bb('0xeb')]||undefined})[_0x14bb('0x9b')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x31dcd4[_0x14bb('0x25')][_0x2a1687];});}else{loggerBooked[_0x14bb('0x4b')](_0x14bb('0x1fd'),JSON[_0x14bb('0x78')](_0x1fd000[_0x14bb('0x77')]),'Queue:\x20',_0x1fd000[_0x14bb('0x49')]);_0x31dcd4[_0x14bb('0xcc')](_0x1fd000);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x31dcd4[_0x14bb('0x25')][_0x2a1687]['ContactId'],'ListId':_0x31dcd4[_0x14bb('0x25')][_0x2a1687][_0x14bb('0xde')],'VoiceQueueId':_0x31dcd4['actions'][_0x2a1687]['VoiceQueueId']||undefined,'CampaignId':_0x31dcd4['actions'][_0x2a1687][_0x14bb('0xeb')]||undefined})[_0x14bb('0x9b')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x31dcd4[_0x14bb('0x25')][_0x2a1687];}}else{return _0x31dcd4[_0x14bb('0x15f')](_0x1fd000,_0x1b85a5);}}else{if(utils['getSeconds'](undefined,_0x1b85a5['scheduledat'])<_0x1fd000['dialRecallMeTimeout']*0x3c){if(_0x1b85a5[_0x14bb('0x14c')]&&!_0x1b85a5[_0x14bb('0x14c')]['voicePause']){_0x31dcd4['preview'][_0x14bb('0x104')](_0x1b85a5['id'])[_0x14bb('0x1d')](function(){_0x31dcd4[_0x14bb('0xcc')](_0x1fd000);});}else{hopperUtils['unlockContact']({'active':![]},_0x1b85a5['id'],0x1)[_0x14bb('0x1d')](function(){_0x31dcd4[_0x14bb('0xcc')](_0x1fd000);});}}else{_0x1fd000[_0x14bb('0x1fe')]+=0x1;_0x31dcd4[_0x14bb('0xcc')](_0x1fd000);if(_0x1fd000[_0x14bb('0x1ff')]){hopperUtils[_0x14bb('0x107')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1b85a5['ContactId'],'ListId':_0x1b85a5['ListId'],'VoiceQueueId':_0x1b85a5[_0x14bb('0xdf')]||undefined,'CampaignId':_0x1b85a5[_0x14bb('0xeb')]||undefined})['catch'](loggerCatch(_0x14bb('0x200')));hopperUtils[_0x14bb('0xc8')](createObjHistory(_0x1fd000,_0x1b85a5,utils[_0x14bb('0x6d')][_0x14bb('0x201')],0x17,'RecallInQueue'))[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x202')));}else{_0x31dcd4[_0x14bb('0x11e')](createObjHistory(_0x1fd000,_0x1b85a5,utils[_0x14bb('0x6d')][_0x14bb('0x203')],0x16,_0x14bb('0x204')),'[Originate][HistoryRecallClose][historyCatch]',_0x14bb('0x205'));}}}}else{_0x1fd000[_0x14bb('0x206')]+=0x1;_0x31dcd4['saveInDb'](createObjHistory(_0x1fd000,_0x1b85a5,utils[_0x14bb('0x6d')][_0x14bb('0x207')],0xd,'Blacklist'),'[Originate][historyBlacklist]',_0x14bb('0x208'));throw _0x14bb('0x209');}};};Dialer['prototype'][_0x14bb('0x15e')]=function(_0x57de85){var _0x8e6c69=this;var _0x10c33b=_0x57de85['limitCalls']-_0x57de85[_0x14bb('0x81')]-_0x57de85[_0x14bb('0x20a')];emitCampaignSummary(_0x57de85);if(_0x10c33b>0x0){if(_0x10c33b>this[_0x14bb('0x23')]){_0x10c33b=this[_0x14bb('0x23')];}_0x57de85['temp']+=_0x10c33b;hopperUtils['getContactDialerIvr'](_0x57de85['id'],_0x10c33b,_0x57de85[_0x14bb('0x20b')],_0x57de85)[_0x14bb('0x41')](function(_0xb4d283){_0x57de85[_0x14bb('0x20a')]-=_0x10c33b;_0x57de85[_0x14bb('0x20a')]=_0x57de85[_0x14bb('0x20a')]>0x0?_0x57de85[_0x14bb('0x20a')]:0x0;if(!utils[_0x14bb('0x20c')](_0xb4d283)){_0x57de85['message']=utils[_0x14bb('0x6d')][_0x14bb('0x71')];logger[_0x14bb('0x4b')](_0x14bb('0x20d')+_0x57de85['name']);}else{_0x57de85[_0x14bb('0x81')]+=_0xb4d283[_0x14bb('0xff')];_0x57de85['message']=utils[_0x14bb('0x6d')][_0x14bb('0x20e')];for(var _0x415030=0x0;_0x415030<_0xb4d283[_0x14bb('0xff')];_0x415030+=0x1){_0x57de85[_0x14bb('0x20f')]+=0x1;if(_['isNil'](_0xb4d283[_0x415030])||_[_0x14bb('0xf3')](_0xb4d283[_0x415030][_0x14bb('0x180')])||_[_0x14bb('0xf3')](_0xb4d283[_0x415030][_0x14bb('0x163')])){_0x8e6c69[_0x14bb('0x158')](_0x14bb('0x210'),_0x57de85,_0xb4d283[_0x415030]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x14bb('0x79')](_0xb4d283[_0x415030],[_0x14bb('0xeb'),'phone']))['then'](_0x8e6c69[_0x14bb('0x1f8')](_0x57de85,_0xb4d283[_0x415030]))[_0x14bb('0x9b')](_0x8e6c69[_0x14bb('0x157')]('[actionOriginateIvr]\x20',_0x57de85));}}}})[_0x14bb('0x9b')](loggerGetContactDialer(_0x14bb('0x211'),_0x57de85,_0x10c33b));}};Dialer[_0x14bb('0x1a')]['handlePower']=function(_0x4aebdb,_0xc52153){var _0x411b5c=this;var _0x3b11ab=[];if(_0xc52153<0x1||_0x4aebdb[_0x14bb('0xb0')]==='booked'){_0xc52153=0x1;}var _0x144189=Math[_0x14bb('0x1d2')](_0x4aebdb['available']*_0xc52153)-_0x4aebdb[_0x14bb('0x81')]-_0x4aebdb[_0x14bb('0x20a')];if(_0x4aebdb['dialLimitQueue']>0x0){var _0x250417=_0x4aebdb['dialLimitQueue']-_0x4aebdb[_0x14bb('0x81')]-_0x4aebdb[_0x14bb('0x1d1')]-_0x4aebdb[_0x14bb('0x20a')]-_0x4aebdb[_0x14bb('0x13f')];if(_0x144189>_0x250417){_0x144189=_0x250417;}}if(_0x144189>0x0){if(_0x4aebdb[_0x14bb('0xb0')]===_0x14bb('0x8')){_0x144189=0x1;}if(_0x144189>this[_0x14bb('0x23')]){_0x144189=this[_0x14bb('0x23')];}_0x4aebdb['temp']+=_0x144189;for(var _0x3fbf45 in this[_0x14bb('0xf6')]){if(typeof this[_0x14bb('0xf6')][_0x3fbf45]!=='undefined'){if(this[_0x14bb('0xf6')][_0x3fbf45][_0x14bb('0x73')]===_0x14bb('0x212')&&this[_0x14bb('0xf6')][_0x3fbf45][_0x14bb('0x8a')]===_0x14bb('0x8b')){_0x3b11ab['push'](this['agents'][_0x3fbf45]['id']);}}}hopperUtils[_0x14bb('0x213')](_0x4aebdb,_0x3b11ab,_0x144189)[_0x14bb('0x41')](function(_0x4499aa){_0x4aebdb[_0x14bb('0x20a')]-=_0x144189;_0x4aebdb['temp']=_0x4aebdb[_0x14bb('0x20a')]>0x0?_0x4aebdb[_0x14bb('0x20a')]:0x0;if(!utils['checkContactEmpty'](_0x4499aa)){hopperUtils['countReScheduled'](_0x4aebdb)[_0x14bb('0x41')](sendMessageReschedule(_0x4aebdb))[_0x14bb('0x9b')](loggerCatch(_0x14bb('0x214')));}else{_0x4aebdb[_0x14bb('0x81')]+=_0x4499aa[_0x14bb('0xff')];_0x4aebdb[_0x14bb('0x6c')]=_0x4aebdb[_0x14bb('0xb0')]===_0x14bb('0x8')?utils[_0x14bb('0x6d')][_0x14bb('0x140')]:utils[_0x14bb('0x6d')][_0x14bb('0x20e')];for(var _0x59939e=0x0;_0x59939e<_0x4499aa[_0x14bb('0xff')];_0x59939e+=0x1){if(_[_0x14bb('0xf3')](_0x4499aa[_0x59939e])||_['isNil'](_0x4499aa[_0x59939e][_0x14bb('0x180')])||_[_0x14bb('0xf3')](_0x4499aa[_0x59939e][_0x14bb('0x163')])){_0x411b5c[_0x14bb('0x158')]('[actionOriginate]\x20',_0x4aebdb,_0x4499aa[_0x59939e]);}else{hopperUtils[_0x14bb('0x215')](_[_0x14bb('0x79')](_0x4499aa[_0x59939e],['VoiceQueueId',_0x14bb('0x163')]))[_0x14bb('0x41')](_0x411b5c[_0x14bb('0x1f8')](_0x4aebdb,_0x4499aa[_0x59939e]))[_0x14bb('0x9b')](_0x411b5c[_0x14bb('0x157')](_0x14bb('0x210'),_0x4aebdb));}}}})['catch'](loggerGetContactDialer(_0x14bb('0x216'),_0x4aebdb,_0x144189));}};Dialer[_0x14bb('0x1a')][_0x14bb('0x68')]=function(_0x4aca40){if(_0x4aca40[_0x14bb('0x217')]>0x0){var _0x1208ae=_0x4aca40['dialLimitQueue']-_0x4aca40[_0x14bb('0x81')]-_0x4aca40[_0x14bb('0x1d1')];if(_0x1208ae>0x0){this['tryOriginatePredictive'](_0x4aca40);}else{loggerPredictiveCalls[_0x14bb('0x4b')](_0x14bb('0x218'));}}else{this[_0x14bb('0x219')](_0x4aca40);}};Dialer[_0x14bb('0x1a')][_0x14bb('0x219')]=function(_0xfc26b5){var _0x1dfbcf=this;var _0x5b43dd=[];_0xfc26b5[_0x14bb('0x81')]+=0x1;for(var _0xd3562e in this[_0x14bb('0xf6')]){if(typeof this[_0x14bb('0xf6')][_0xd3562e]!=='undefined'){if(this['agents'][_0xd3562e][_0x14bb('0x73')]===_0x14bb('0x212')&&this['agents'][_0xd3562e][_0x14bb('0x8a')]==='reachable'){_0x5b43dd[_0x14bb('0x9c')](this['agents'][_0xd3562e]['id']);}}}return this[_0x14bb('0x213')](_0xfc26b5['id'],_0x5b43dd,0x1,_0xfc26b5[_0x14bb('0x20b')],_0xfc26b5)[_0x14bb('0x41')](function(_0x14d945){if(!utils[_0x14bb('0x20c')](_0x14d945)){utils[_0x14bb('0x6a')](_0xfc26b5,0x1,0x0);return hopperUtils[_0x14bb('0x21a')](_0xfc26b5)['then'](sendMessageReschedule(_0xfc26b5))[_0x14bb('0x9b')](loggerCatch('[countReScheduled]\x20'));}else{_0xfc26b5['message']=utils[_0x14bb('0x6d')][_0x14bb('0x20e')];if(_[_0x14bb('0xf3')](_0x14d945[0x0])||_[_0x14bb('0xf3')](_0x14d945[0x0]['Contact'])||_[_0x14bb('0xf3')](_0x14d945[0x0][_0x14bb('0x163')])){_0x1dfbcf[_0x14bb('0x158')](_0x14bb('0x210'),_0xfc26b5,_0x14d945[0x0]);}else{return hopperUtils[_0x14bb('0x215')](_['pick'](_0x14d945[0x0],['VoiceQueueId',_0x14bb('0x163')]))['then'](_0x1dfbcf[_0x14bb('0x1f8')](_0xfc26b5,_0x14d945[0x0]))['catch'](_0x1dfbcf[_0x14bb('0x157')](_0x14bb('0x21b'),_0xfc26b5));}}})['catch'](loggerGetContactDialer(_0x14bb('0x21c'),_0xfc26b5,0x1));};Dialer[_0x14bb('0x1a')][_0x14bb('0x1eb')]=function(_0x756ac,_0x3bc7ce,_0x2bfa1e,_0x6a712b,_0x247953,_0xbabcca){loggerPredictive[_0x14bb('0x4b')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x21d'),_0x756ac);loggerPredictive['info'](_0x14bb('0x21e'),_0x3bc7ce);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x21f'),_0x2bfa1e);loggerPredictive['info'](_0x14bb('0x220'),_0x6a712b);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x221'),_0x247953);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x57'));return new Promise(function(_0x3b4101,_0x3c9494){if(_0x756ac<=0x0||isNaN(_0x756ac)){return _0x3c9494(msgResponse(_0x14bb('0x222'),_0x14bb('0xbf'),_0x14bb('0x223')+_0x756ac));}if(_0x2bfa1e<=0x0||isNaN(_0x2bfa1e)){return _0x3c9494(msgResponse(_0x14bb('0x222'),_0x14bb('0xbf'),_0x14bb('0x224')+_0x2bfa1e));}if(_0x6a712b<=0x0||isNaN(_0x6a712b)){return _0x3c9494(msgResponse(_0x14bb('0x222'),_0x14bb('0xbf'),_0x14bb('0x225')+_0x6a712b));}if(_0x3bc7ce<=0x0||isNaN(_0x3bc7ce)){return _0x3c9494(msgResponse(_0x14bb('0x222'),_0x14bb('0xbf'),_0x14bb('0x226')+_0x3bc7ce));}if(_0x247953<=0x0||isNaN(_0x247953)){return _0x3c9494(msgResponse(_0x14bb('0x222'),'Error','Amax\x20=\x20'+_0x247953));}_0xbabcca=_0xbabcca||0x0;var _0x329bf0=0x1/_0x2bfa1e;var _0x423385=0x0;var _0x244ba3=0x0;var _0x363297=0x0;var _0x298dc6=0x0;for(var _0x3a7abd=0x0;_0x363297<_0x247953;_0x3a7abd+=0x1){_0x244ba3=_0x3a7abd/_0x3bc7ce;_0x423385=(_0x6a712b*_0x244ba3+_0xbabcca)/_0x329bf0;_0x363297=utils[_0x14bb('0x227')](_0x423385,_0x756ac);_0x298dc6=_0x423385/_0x756ac*(0x1-utils['erlangb'](_0x423385,_0x756ac));}return _0x3b4101({'erlangCalls':_0x3a7abd,'erlangCallToSecond':_0x3bc7ce/_0x3a7abd,'erlangAbandonmentRate':_0x363297,'erlangBusyFactor':_0x298dc6});});};Dialer['prototype']['busyFactor']=function(_0x32a784,_0x1bf0e3,_0x319b68,_0x1f9af1,_0x4b71a2,_0x653749){loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x228'));loggerPredictive['info'](_0x14bb('0x21d'),_0x32a784);loggerPredictive[_0x14bb('0x4b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1bf0e3);loggerPredictive[_0x14bb('0x4b')]('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',_0x319b68);loggerPredictive[_0x14bb('0x4b')]('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',_0x1f9af1);loggerPredictive[_0x14bb('0x4b')](_0x14bb('0x229'),_0x4b71a2);loggerPredictive['info'](_0x14bb('0x57'));return new Promise(function(_0x29e174,_0x3dcae8){if(_0x32a784<=0x0||isNaN(_0x32a784)){return _0x3dcae8(msgResponse(_0x14bb('0x22a'),'Error',_0x14bb('0x223')+_0x32a784));}if(_0x319b68<=0x0||isNaN(_0x319b68)){return _0x3dcae8(msgResponse('[busyFactor]',_0x14bb('0xbf'),_0x14bb('0x224')+_0x319b68));}if(_0x1f9af1<=0x0||isNaN(_0x1f9af1)){return _0x3dcae8(msgResponse(_0x14bb('0x22a'),_0x14bb('0xbf'),_0x14bb('0x225')+_0x1f9af1));}if(_0x1bf0e3<=0x0||isNaN(_0x1bf0e3)){return _0x3dcae8(msgResponse(_0x14bb('0x22a'),_0x14bb('0xbf'),'interval\x20=\x20'+_0x1bf0e3));}if(_0x4b71a2<=0x0||isNaN(_0x4b71a2)){return _0x3dcae8(msgResponse(_0x14bb('0x22a'),_0x14bb('0xbf'),_0x14bb('0x22b')+_0x4b71a2));}_0x653749=_0x653749||0x0;var _0x58ecfd=0x1/_0x319b68;var _0x32246b=0x0;var _0x3cc21d=0x0;var _0x505b47=0x0;var _0x55b883=0x0;for(var _0x3b21d1=0x0;_0x55b883<_0x4b71a2;_0x3b21d1+=0x1){_0x3cc21d=_0x3b21d1/_0x1bf0e3;_0x32246b=(_0x1f9af1*_0x3cc21d+_0x653749)/_0x58ecfd;_0x505b47=utils['erlangb'](_0x32246b,_0x32a784);_0x55b883=_0x32246b/_0x32a784*(0x1-utils['erlangb'](_0x32246b,_0x32a784));}return _0x29e174({'erlangCalls':_0x3b21d1,'erlangCallToSecond':_0x1bf0e3/_0x3b21d1,'erlangAbandonmentRate':_0x505b47,'erlangBusyFactor':_0x55b883});});};module[_0x14bb('0x22c')]=Dialer; \ No newline at end of file +var _0x0a57=['AGI','[syncHangupIvr]','outboundUnknownCallsDay','cause-txt','queuesSummary','running','isPreviewCampaign','statusMessage','available','inUse','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','syncQueueSummaryComplete','filter','length','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','emptyContact','notFound','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','object','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','originate','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','outboundBusyCallsDay','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','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','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','loggedIn','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','[actionOriginate]\x20','checkIsBlackList','loggerHandler','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[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','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','lodash','uuid','moment','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummarycomplete','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','debug','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','contacts','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:ivr:%s','campaign:save','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','Error','isTrunkReachable','active','trunks','SIP/%s','status','reachable','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','push','command','then','indexOf','true','Action','iftime\x20%s,%s','content','catch','all','some','OVERTIME_INTERVAL','Global:\x20','Timezone:\x20','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','[ifTime][Action]','queue','uniqueId','uniqueid','ivr','updateOriginated','answertime','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','moveContactManagedDialer','droptime','responsetime','predictiveIntervalErlangCallsDroppedCalls','state','statedesc','Drop','TIMEOUT','countdropretry','countglobal','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','dialDropRetryFrequency','minutes','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','add','ContactId','ListId','[rescheduleContact][Abandoned]','syncNewExten','actions','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','isNil','locked','stateinterface','idHopper','paused','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','response','callProgressDetecting','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','amd','saveInDb','MACHINE','Machine','countmachineretry','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','countagentrejectretry','createStateFinal','ivrAnswerCallsDay','dialQueueProject','AnswerAGI'];(function(_0x4da78e,_0x13cb84){var _0x4463b1=function(_0x41aaf1){while(--_0x41aaf1){_0x4da78e['push'](_0x4da78e['shift']());}};_0x4463b1(++_0x13cb84);}(_0x0a57,0xe0));var _0x70a5=function(_0xadf7fc,_0x2afcc9){_0xadf7fc=_0xadf7fc-0x0;var _0x256935=_0x0a57[_0xadf7fc];return _0x256935;};'use strict';var util=require('util');var _=require(_0x70a5('0x0'));var uuid=require(_0x70a5('0x1'));var moment=require(_0x70a5('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x70a5('0x3'));var hopperUtils=require(_0x70a5('0x4'));var ut=require('../preview/util/util');var config=require(_0x70a5('0x5'));var logger=require(_0x70a5('0x6'))('dialer');var loggerBooked=require(_0x70a5('0x6'))('booked');var loggerPredictive=require(_0x70a5('0x6'))(_0x70a5('0x7'));var loggerPredictiveCalls=require('../../../config/logger')(_0x70a5('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x70a5('0x9'));var ami=require(_0x70a5('0xa'));config['redis']=_['defaults'](config[_0x70a5('0xb')],{'host':_0x70a5('0xc'),'port':0x18eb});var io=require(_0x70a5('0xd'))(new Redis(config[_0x70a5('0xb')]));var cmHopper=require(_0x70a5('0xe'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x70a5('0xf'));var Interval=require(_0x70a5('0x10'));var Action=require(_0x70a5('0x11'));var History=require(_0x70a5('0x12'));var Final=require(_0x70a5('0x13'));var AgentComplete=require(_0x70a5('0x14'));var QueueCallerAbandon=require(_0x70a5('0x15'));var Hangup=require(_0x70a5('0x16'));var ipAgi=process[_0x70a5('0x17')][_0x70a5('0x18')]||_0x70a5('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x70a5('0x1a')][_0x70a5('0x1b')]=function(_0x222de9){this[_0x70a5('0x1c')]=this[_0x70a5('0x1c')]?this[_0x70a5('0x1c')]['finally'](_0x222de9):_0x222de9();};function Dialer(_0xb9791e,_0x1a022e){this[_0x70a5('0x1d')]=new Sequence();this[_0x70a5('0x1e')]=_0x1a022e;this[_0x70a5('0x1f')]=_0xb9791e[_0x70a5('0x1f')];this[_0x70a5('0x20')]=_0xb9791e['campaigns'];this[_0x70a5('0x21')]=_0xb9791e['agents'];this['trunks']=_0xb9791e['trunks'];this[_0x70a5('0x22')]=config['maxNumberOriginate']||0x2;this[_0x70a5('0x23')]={};this['actions']={};this['contactsId']={};this['uniqueId']={};this['optionPredictive']={};this[_0x70a5('0x24')]={};this[_0x70a5('0x25')]={};this[_0x70a5('0x26')]={};this[_0x70a5('0x27')]={};this['queueBookedRR']={};this['queuesSummary']={};ami['on'](_0x70a5('0x28'),this[_0x70a5('0x29')][_0x70a5('0x2a')](this));ami['on']('queuecallerabandon',this[_0x70a5('0x2b')][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x2c'),this[_0x70a5('0x2d')]['bind'](this));ami['on']('agentcomplete',this[_0x70a5('0x2e')]['bind'](this));ami['on']('custom:queuesummary',this[_0x70a5('0x9')]['bind'](this));ami['on'](_0x70a5('0x2f'),this['syncQueueSummaryComplete'][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x30'),this[_0x70a5('0x31')][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x32'),this['syncNewExten'][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x33'),this[_0x70a5('0x34')][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x35'),this['syncQueueMember'][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x36'),this[_0x70a5('0x37')][_0x70a5('0x2a')](this));this[_0x70a5('0x38')]();this[_0x70a5('0x39')]();RpcSetting['getSettings']()['then'](function(_0x3107e3){previewRecallmeReminderInterval=_0x3107e3[_0x70a5('0x3a')];});}function isNotNull(_0x34f419){return _0x34f419!==null&&!_[_0x70a5('0x3b')](_0x34f419);}function msgResponse(_0x1d5d96,_0x370ce2,_0x1ad2e4){return{'action':_0x1d5d96,'response':_0x370ce2,'message':_0x1ad2e4,'stack':_0x1ad2e4};}function emit(_0x4c272c,_0x4b1e8f,_0x412b2c){io['to'](_0x4c272c)[_0x70a5('0x3c')](_0x4b1e8f,_0x412b2c);}function emitOutboundVoiceQueueSummary(_0x26d51a){if(_0x26d51a[_0x70a5('0x3d')]===_0x70a5('0x3e')){logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x70a5('0x3f')](_0x26d51a,{'showHidden':![],'depth':null}));emit(util[_0x70a5('0x40')](_0x70a5('0x41'),_0x26d51a[_0x70a5('0x42')]),_0x70a5('0x43'),_0x26d51a);}}function checkGetDataPredictive(_0x4e733e){if(isNotNull(_0x4e733e)&&!_[_0x70a5('0x44')](_0x4e733e)){loggerPredictive[_0x70a5('0x45')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x70a5('0x45')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e733e[_0x70a5('0x46')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x47'),_0x4e733e[_0x70a5('0x48')]);loggerPredictive[_0x70a5('0x45')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e733e[_0x70a5('0x49')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4a'),_0x4e733e[_0x70a5('0x4b')]);loggerPredictive[_0x70a5('0x45')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e733e['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x70a5('0x4c'),_0x4e733e[_0x70a5('0x4d')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4e'));if(_0x4e733e['predictiveIntervalTotalCalls']>0x0){if(!_[_0x70a5('0x3b')](_0x4e733e[_0x70a5('0x4d')])&&_0x4e733e[_0x70a5('0x4d')]>0x0){return!![];}loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4f'));if(!_[_0x70a5('0x3b')](_0x4e733e[_0x70a5('0x50')])&&_0x4e733e[_0x70a5('0x50')]>0x0){return!![];}loggerPredictive['info'](_0x70a5('0x51'));}else{loggerPredictive[_0x70a5('0x45')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x70a5('0x45')](_0x70a5('0x52'));}return![];}function mergeDataErlangB(_0x156341){return function(_0x56b970){loggerPredictive[_0x70a5('0x45')](_0x70a5('0x53'));loggerPredictive[_0x70a5('0x45')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x56b970[_0x70a5('0x54')]);loggerPredictive['info'](_0x70a5('0x55'),_0x56b970[_0x70a5('0x56')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x57'),_0x56b970[_0x70a5('0x58')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x59'),_0x56b970[_0x70a5('0x5a')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x57'),_0x56b970[_0x70a5('0x58')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4e'));_[_0x70a5('0x5b')](_0x156341,_0x56b970);};}function ifInterval(_0x53e943,_0x415393){if(_['isUndefined'](_0x415393)){return![];}return utils[_0x70a5('0x5c')](undefined,_0x415393)<_0x53e943*0x3c;}function clearPredictiveAttributes(_0x1c307e){if(_0x1c307e[_0x70a5('0x25')]){_0x1c307e['startProgressive']=undefined;loggerPredictive[_0x70a5('0x5d')](_0x1c307e[_0x70a5('0x42')],_0x70a5('0x5e'));}if(_0x1c307e['startPredictive']){_0x1c307e['startPredictive']=undefined;loggerPredictive[_0x70a5('0x5d')](_0x1c307e[_0x70a5('0x42')],_0x70a5('0x5f'));}if(_0x1c307e[_0x70a5('0x60')]){clearInterval(_0x1c307e[_0x70a5('0x60')]);_0x1c307e[_0x70a5('0x60')]=undefined;loggerPredictive[_0x70a5('0x5d')](_0x1c307e[_0x70a5('0x42')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x389066,_0x46778f){return function(_0x3d5291){loggerPredictive['error'](_0x46778f[_0x70a5('0x42')],_0x389066);loggerPredictive[_0x70a5('0x61')](_0x3d5291[_0x70a5('0x62')]);clearPredictiveAttributes(_0x46778f);};}function loggerCatch(_0x36dd8e){return function(_0x4cf494){logger[_0x70a5('0x61')](_0x36dd8e,util[_0x70a5('0x3f')](_0x4cf494,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x19d605,_0x21ee38,_0x5c72b7){return function(_0x49902b){utils[_0x70a5('0x63')](_0x21ee38,_0x5c72b7,0x0);logger[_0x70a5('0x61')](_0x19d605,util[_0x70a5('0x3f')](_0x49902b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x395796){return function(_0x554ae2){if(isNotNull(_0x554ae2)&&isNotNull(_0x554ae2[0x0])){if(_0x554ae2[0x0][_0x70a5('0x64')]>0x0){_0x395796[_0x70a5('0x65')]=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger[_0x70a5('0x45')]('[getContactDialer2][ReScheduled]'+_0x395796[_0x70a5('0x42')],_0x554ae2[0x0][_0x70a5('0x64')],_0x70a5('0x66'));}else{_0x395796['message']=utils[_0x70a5('0x67')][_0x70a5('0x68')];logger['info'](_0x70a5('0x69')+_0x395796[_0x70a5('0x42')]);}}};}function createObjHistory(_0x1d9b64,_0x165792,_0x398a0b,_0x3dff13,_0x5a5a0f){_0x1d9b64[_0x70a5('0x65')]=_0x398a0b;var _0x21b0de=new Action(_0x1d9b64,_0x165792);var _0x2609af=new History(_0x21b0de);_0x2609af['state']=_0x3dff13;_0x2609af['statedesc']=_0x5a5a0f;_0x2609af['endtime']=_0x21b0de[_0x70a5('0x6a')];return _0x2609af;}function unlockQueueStatus(_0x47264a,_0x3f4a47){setTimeout(function(){if(_[_0x70a5('0x3b')](_0x47264a[_0x70a5('0x6b')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x3f4a47);}_0x47264a['queueStatusComplete']=!![];loggerBooked[_0x70a5('0x45')](_0x70a5('0x6c'),_0x3f4a47,JSON[_0x70a5('0x6d')](_[_0x70a5('0x6e')](_0x47264a,[_0x70a5('0x42'),_0x70a5('0x6b')])));},0x1f3);}function checkInterval(_0x5790d6){return function(){if(!isNotNull(_0x5790d6[_0x70a5('0x6f')])){_0x5790d6[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x70')];throw _0x5790d6['name']+_0x70a5('0x71');}if(!isNotNull(_0x5790d6[_0x70a5('0x6f')]['Intervals'])){_0x5790d6[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x70')];throw _0x5790d6[_0x70a5('0x42')]+_0x70a5('0x71');}if(!isNotNull(_['isEmpty'](_0x5790d6[_0x70a5('0x6f')]['Intervals']))){_0x5790d6['message']=utils[_0x70a5('0x67')][_0x70a5('0x70')];throw _0x5790d6[_0x70a5('0x42')]+_0x70a5('0x71');}};}function checkIsIVRCampaignActive(_0x4a7050){return function(){if(!utils[_0x70a5('0x72')](_0x4a7050)){_0x4a7050[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x73')];throw _0x4a7050[_0x70a5('0x42')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x2d4711){if(utils[_0x70a5('0x74')](_0x2d4711)){emit(util[_0x70a5('0x40')](_0x70a5('0x75'),_0x2d4711['name']),_0x70a5('0x76'),_0x2d4711);}}function loggerCatchQueueSummary(_0x30c364,_0x495170){return function(_0x1ee127){clearPredictiveAttributes(_0x495170);emitCampaignSummary(_0x495170);loggerSyncQueueSummary[_0x70a5('0x5d')](_0x30c364,util[_0x70a5('0x3f')](_0x1ee127,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x24d511){if(_0x24d511['sendMessageOneNotActive']){if(_0x24d511[_0x70a5('0x77')]===0x0){_0x24d511[_0x70a5('0x78')]=![];_0x24d511[_0x70a5('0x65')]=utils[_0x70a5('0x67')]['INACTIVE'];loggerSyncQueueSummary[_0x70a5('0x5d')](_0x70a5('0x79'),_0x24d511[_0x70a5('0x42')],'is\x20not\x20active');}else{_0x24d511[_0x70a5('0x65')]=utils['CAMPAIGN_STATUS'][_0x70a5('0x7a')];loggerSyncQueueSummary[_0x70a5('0x5d')](_0x70a5('0x79'),_0x24d511['name'],_0x70a5('0x7b'));}emitCampaignSummary(_0x24d511);}}function myreject(_0x50654e){return function(_0x1b9ccd){return _0x50654e(msgResponse('[ifTime][Action]',_0x70a5('0x7c'),JSON['stringify'](_0x1b9ccd)));};}Dialer[_0x70a5('0x1a')][_0x70a5('0x7d')]=function(_0x260ea0){return!_['isUndefined'](_0x260ea0)&&_0x260ea0&&!_[_0x70a5('0x3b')](_0x260ea0[_0x70a5('0x42')])&&!_[_0x70a5('0x3b')](_0x260ea0[_0x70a5('0x7e')])&&_0x260ea0['active']&&(this[_0x70a5('0x7f')][util['format'](_0x70a5('0x80'),_0x260ea0[_0x70a5('0x42')])][_0x70a5('0x81')]===_0x70a5('0x82')||this[_0x70a5('0x7f')][util['format'](_0x70a5('0x80'),_0x260ea0[_0x70a5('0x42')])][_0x70a5('0x81')]==='unmonitored');};Dialer[_0x70a5('0x1a')][_0x70a5('0x83')]=function(_0xf97e17){var _0x1c2a9d=this;return function(){if(!_0x1c2a9d[_0x70a5('0x7d')](_0xf97e17[_0x70a5('0x84')])){if(!_0x1c2a9d['isTrunkReachable'](_0xf97e17[_0x70a5('0x85')])){_0xf97e17[_0x70a5('0x65')]=utils['CAMPAIGN_STATUS'][_0x70a5('0x86')];throw _0xf97e17[_0x70a5('0x42')]+_0x70a5('0x87');}}};};Dialer['prototype'][_0x70a5('0x88')]=function(_0x2fac37,_0x595300,_0x1130bf,_0x4007c2){var _0x212b60=this;return function(){var _0x8eccc3=!![];return _0x212b60[_0x70a5('0x89')](_0x2fac37,_0x595300,_0x1130bf,_0x4007c2,_0x8eccc3);};};Dialer['prototype'][_0x70a5('0x8a')]=function(_0x44d74d,_0x67619a,_0x53fcd1,_0x3a0b93){var _0x5a950d=this;return function(){var _0x22649a=![];return _0x5a950d[_0x70a5('0x89')](_0x44d74d['Intervals'],_0x67619a,_0x53fcd1,_0x3a0b93,_0x22649a);};};Dialer['prototype'][_0x70a5('0x89')]=function(_0x383609,_0x2c5afc,_0x6832a8,_0x21b99e,_0x29a8de){var _0x55c37a=[];return new Promise(function(_0x1fa33b,_0x54994d){if(!isNotNull(_0x383609)){_0x21b99e[_0x70a5('0x65')]=utils['CAMPAIGN_STATUS'][_0x70a5('0x70')];return _0x54994d(msgResponse(_0x70a5('0x8b'),_0x70a5('0x8c'),_0x6832a8+_0x70a5('0x8d')));}if(_['isEmpty'](_0x383609)){_0x21b99e[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x8e')];return _0x54994d(msgResponse('ifTime','Failure',_0x6832a8+_0x70a5('0x8f')));}if(_0x2c5afc&&_[_0x70a5('0x3b')](config[_0x70a5('0x90')][_0x2c5afc])){_0x21b99e[_0x70a5('0x65')]=utils['CAMPAIGN_STATUS'][_0x70a5('0x91')];return _0x54994d(msgResponse(_0x70a5('0x8b'),_0x70a5('0x8c'),_0x6832a8+_0x70a5('0x92')+_0x2c5afc));}if(_['isArray'](_0x383609)){for(var _0xd508fd=0x0;_0xd508fd<_0x383609['length'];_0xd508fd+=0x1){_0x55c37a[_0x70a5('0x93')](ami['Action']({'action':_0x70a5('0x94'),'command':util[_0x70a5('0x40')]('iftime\x20%s,%s',_0x383609[_0xd508fd]['interval'],!_['isUndefined'](config['timezones'][_0x2c5afc])?_0x2c5afc:'')})[_0x70a5('0x95')](function(_0x44f4eb){return _0x44f4eb['content'][_0x70a5('0x96')](_0x70a5('0x97'))>=0x0;})['catch'](myreject(_0x54994d)));}}else{_0x55c37a[_0x70a5('0x93')](ami[_0x70a5('0x98')]({'action':_0x70a5('0x94'),'command':util[_0x70a5('0x40')](_0x70a5('0x99'),_0x383609,!_[_0x70a5('0x3b')](config[_0x70a5('0x90')][_0x2c5afc])?_0x2c5afc:'')})['then'](function(_0x3b0096){return _0x3b0096[_0x70a5('0x9a')]['indexOf'](_0x70a5('0x97'))>=0x0;})[_0x70a5('0x9b')](myreject(_0x54994d)));}Promise[_0x70a5('0x9c')](_0x55c37a)[_0x70a5('0x95')](function(_0x351c3d){var _0x4c8d20=_[_0x70a5('0x9d')](_0x351c3d);if(_0x4c8d20){return _0x1fa33b(_0x4c8d20);}else{_0x21b99e[_0x70a5('0x65')]=_0x29a8de?utils['CAMPAIGN_STATUS']['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x70a5('0x9e')];return _0x54994d(msgResponse('[ifTime][promiseAll]',_0x70a5('0x8c'),_0x70a5('0x9f')+_0x29a8de+'\x20'+_0x6832a8+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x383609,{'showHidden':![],'depth':null})+_0x70a5('0xa0')+_0x2c5afc));}})[_0x70a5('0x9b')](function(_0x30fe12){return _0x54994d(msgResponse(_0x70a5('0x8b'),_0x70a5('0x8c'),JSON['stringify'](_0x30fe12)));});});};Dialer[_0x70a5('0x1a')][_0x70a5('0x38')]=function(){var _0xd4a2dc=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0xd4a2dc[_0x70a5('0xa1')]();},0x3e8);});};Dialer[_0x70a5('0x1a')][_0x70a5('0xa1')]=function(){var _0x2e30b7=this;var _0x56875d;for(var _0x2dbe6a in this[_0x70a5('0x20')]){if(typeof this[_0x70a5('0x20')][_0x2dbe6a]!==_0x70a5('0xa2')){_0x56875d=this[_0x70a5('0x20')][_0x2dbe6a];if(utils[_0x70a5('0x74')](_0x56875d)&&utils[_0x70a5('0x72')](_0x56875d)){_0x56875d[_0x70a5('0x78')]=!![];Promise[_0x70a5('0xa3')]()[_0x70a5('0x95')](checkIsIVRCampaignActive(_0x56875d))[_0x70a5('0x95')](checkInterval(_0x56875d))['then'](_0x2e30b7[_0x70a5('0x83')](_0x56875d))[_0x70a5('0x95')](_0x2e30b7[_0x70a5('0x88')](_0x56875d[_0x70a5('0xa4')],_0x56875d[_0x70a5('0xa5')],_0x56875d[_0x70a5('0x42')],_0x56875d))[_0x70a5('0x95')](_0x2e30b7[_0x70a5('0x8a')](_0x56875d['Interval'],_0x56875d['dialTimezone'],_0x56875d[_0x70a5('0x42')],_0x56875d))['then'](_0x2e30b7['launchHandleIvr'](_0x56875d))[_0x70a5('0x9b')](loggerCatchQueueSummary('[syncCampaigns]',_0x56875d));}else{notSendMessagesCampaign(_0x56875d);}}}};Dialer['prototype'][_0x70a5('0xa6')]=function(_0x13d7a9){if(_0x13d7a9[_0x70a5('0xa7')]!==_0x70a5('0x7')){clearPredictiveAttributes(_0x13d7a9);}switch(_0x13d7a9[_0x70a5('0xa7')]){case _0x70a5('0xa8'):this[_0x70a5('0xa9')](_0x13d7a9,0x1);break;case _0x70a5('0xaa'):this[_0x70a5('0xa9')](_0x13d7a9,_0x13d7a9[_0x70a5('0xab')]);break;case'predictive':this[_0x70a5('0x7')](_0x13d7a9);break;case _0x70a5('0xac'):this[_0x70a5('0xa9')](_0x13d7a9,0x1);break;default:logger[_0x70a5('0x61')](_0x70a5('0xad'),_0x13d7a9[_0x70a5('0x42')],'method\x20not\x20recognized');}};Dialer['prototype']['ifTime']=function(_0x56762c,_0x123560){var _0x21ed98=_0x56762c[_0x70a5('0xa5')];var _0x54d331=_0x123560?_0x56762c[_0x70a5('0xa4')]:_0x56762c['Interval']['Intervals'];logger[_0x70a5('0xae')](_0x70a5('0xaf'),_0x54d331,_0x21ed98,_0x56762c['name'],util['format'](_0x70a5('0xb0'),_0x56762c['name'],_0x56762c['id']));var _0x44fb2c=null;return Interval[_0x70a5('0xb1')](_0x54d331,_0x21ed98)['then'](function(_0x26a4c7){if(_0x26a4c7===!![]){return _0x26a4c7;}else{_0x56762c[_0x70a5('0x65')]=_0x123560?utils[_0x70a5('0x67')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x70a5('0x9e')];_0x44fb2c=msgResponse('[ifTime][promiseAll]',_0x70a5('0x8c'),_0x70a5('0x9f')+_0x123560+'\x20'+_0x56762c[_0x70a5('0x42')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x54d331,{'showHidden':![],'depth':null})+_0x70a5('0xa0')+_0x21ed98);}if(_0x44fb2c!==null){logger[_0x70a5('0xae')](_0x70a5('0xb2'),_0x44fb2c);_0x44fb2c[_0x70a5('0xb3')]=_0x123560;throw _0x44fb2c;}})[_0x70a5('0x9b')](function(_0x539a9e){logger[_0x70a5('0x61')]('AMI\x20IfTime',_0x539a9e);throw msgResponse(_0x70a5('0xb4'),_0x70a5('0x7c'),util[_0x70a5('0x3f')](_0x539a9e,{'showHidden':![],'depth':null}));});};Dialer[_0x70a5('0x1a')][_0x70a5('0x29')]=function(_0x3f0bfb){if(this[_0x70a5('0x1f')][_0x3f0bfb[_0x70a5('0xb5')]]){if(this[_0x70a5('0xb6')][_0x3f0bfb[_0x70a5('0xb7')]]&&this[_0x70a5('0xb6')][_0x3f0bfb[_0x70a5('0xb7')]][_0x70a5('0x3d')]!==_0x70a5('0xb8')){this[_0x70a5('0xb9')](this['voiceQueues'][_0x3f0bfb[_0x70a5('0xb5')]]);this['uniqueId'][_0x3f0bfb[_0x70a5('0xb7')]][_0x70a5('0xba')]=moment()[_0x70a5('0x40')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x70a5('0x1a')][_0x70a5('0x2e')]=function(_0xafcbb6){var _0xae3f9=this[_0x70a5('0xb6')][_0xafcbb6['uniqueid']];if(this['voiceQueues'][_0xafcbb6[_0x70a5('0xb5')]]){if(_0xae3f9&&_0xae3f9[_0x70a5('0x3d')]!=='ivr'){delete this[_0x70a5('0xb6')][_0xafcbb6[_0x70a5('0xb7')]];this[_0x70a5('0x1f')][_0xafcbb6['queue']][_0x70a5('0xbb')]+=0x1;var _0x6acc38=new AgentComplete(_0xae3f9,_0xafcbb6);if(_0xafcbb6[_0x70a5('0xbc')]===_0x70a5('0xbd')){_0x6acc38[_0x70a5('0xbe')]=this[_0x70a5('0x1f')][_0xafcbb6[_0x70a5('0xb5')]][_0x70a5('0xbf')]&&this[_0x70a5('0x1f')][_0xafcbb6[_0x70a5('0xb5')]][_0x70a5('0xc0')]?moment()[_0x70a5('0x40')](_0x70a5('0xc1')):undefined;}hopperUtils['createHistory'](_0x6acc38)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x70a5('0xc2')](_0x6acc38)[_0x70a5('0x9b')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x70a5('0x2b')]=function(_0x4e6149){var _0x3c79f8=this[_0x70a5('0xb6')][_0x4e6149[_0x70a5('0xb7')]];var _0x4f56b5=this;var _0x302fd7=![];var _0x1e47ef;var _0x2aeaa4;if(this['voiceQueues'][_0x4e6149['queue']]){if(_0x3c79f8&&_0x3c79f8['type']!==_0x70a5('0xb8')){delete this[_0x70a5('0xb6')][_0x4e6149[_0x70a5('0xb7')]];this[_0x70a5('0xb9')](this['voiceQueues'][_0x4e6149['queue']]);_0x3c79f8['droptime']=moment()['format'](_0x70a5('0xc1'));var _0x118055=new QueueCallerAbandon(_0x3c79f8,_0x4e6149);if(utils[_0x70a5('0x5c')](_0x3c79f8[_0x70a5('0xc3')],_0x3c79f8[_0x70a5('0xc4')])>=_0x3c79f8['dialQueueTimeout']){this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0x49')]+=0x1;this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xc5')]+=0x1;_0x118055[_0x70a5('0xc6')]=0xa;_0x118055[_0x70a5('0xc7')]=_0x70a5('0xc8');_0x118055['dropreason']=_0x70a5('0xc9');_0x118055[_0x70a5('0xbe')]=this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]]['dialQueueProject2']?moment()['format'](_0x70a5('0xc1')):undefined;_0x118055[_0x70a5('0xca')]+=0x1;_0x118055[_0x70a5('0xcb')]+=0x1;_0x1e47ef=this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]]['dialDropRetryFrequency'];_0x2aeaa4=this['voiceQueues'][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xcc')];hopperUtils['verifyAdditionalPhones'](_0x118055,_0x118055[_0x70a5('0xc6')],_0x3c79f8[_0x70a5('0xcd')])[_0x70a5('0x95')](function(_0x2b1bf3){_0x302fd7=_0x2b1bf3[_0x70a5('0xce')]==0x1;if(_0x118055[_0x70a5('0xca')]>=_0x4f56b5[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xcf')]){_0x4f56b5[_0x70a5('0xd0')](_0x118055,_0x2b1bf3['additional']);}else{hopperUtils[_0x70a5('0xd1')]({'active':![],'countdropretry':_0x118055[_0x70a5('0xca')],'scheduledat':moment()['add'](_0x4f56b5[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xd2')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x3c79f8['ContactId'],'ListId':_0x3c79f8['ListId'],'VoiceQueueId':_0x3c79f8[_0x70a5('0xd4')]||undefined,'CampaignId':_0x3c79f8[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0xd6')));var _0x244c48=new History(_0x118055);_0x244c48[_0x70a5('0xc6')]=0xa;_0x244c48['statedesc']=_0x70a5('0xc8');_0x244c48['starttime']=moment()[_0x70a5('0x40')](_0x70a5('0xc1'));_0x244c48[_0x70a5('0xd7')]=_0x244c48['starttime'];_0x244c48[_0x70a5('0xd8')]=_0x118055[_0x70a5('0xd8')];_0x244c48[_0x70a5('0xd9')]=_0x118055[_0x70a5('0xd9')];hopperUtils[_0x70a5('0xda')](_0x244c48)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0xdb')));}})[_0x70a5('0x95')](function(){if(_0x302fd7)hopperUtils[_0x70a5('0xdc')](_0x118055,_0x1e47ef,_0x2aeaa4)[_0x70a5('0x95')](function(){return 0x1;});});}else{this['voiceQueues'][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0x4b')]+=0x1;this[_0x70a5('0x1f')][_0x4e6149['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x118055[_0x70a5('0xc6')]=0xb;_0x118055[_0x70a5('0xc7')]=_0x70a5('0xdd');_0x118055[_0x70a5('0xde')]=_0x70a5('0xdf');_0x118055[_0x70a5('0xe0')]+=0x1;_0x118055[_0x70a5('0xcb')]+=0x1;_0x1e47ef=this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xe1')];_0x2aeaa4=this['voiceQueues'][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xcc')];hopperUtils[_0x70a5('0xe2')](_0x118055,_0x118055[_0x70a5('0xc6')],_0x3c79f8['voiceQueue'])[_0x70a5('0x95')](function(_0x4382b9){if(_0x118055[_0x70a5('0xe0')]>=_0x4f56b5[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xe3')]){_0x4f56b5[_0x70a5('0xd0')](_0x118055,_0x4382b9[_0x70a5('0xce')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x118055[_0x70a5('0xe0')],'scheduledat':moment()[_0x70a5('0xe4')](_0x4f56b5[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xe1')],'minutes')[_0x70a5('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3c79f8[_0x70a5('0xe5')],'ListId':_0x3c79f8[_0x70a5('0xe6')],'VoiceQueueId':_0x3c79f8[_0x70a5('0xd4')]||undefined,'CampaignId':_0x3c79f8[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0xe7')));var _0x4b5556=new History(_0x118055);_0x4b5556[_0x70a5('0xc6')]=0xb;_0x4b5556[_0x70a5('0xc7')]='Abandoned';_0x4b5556[_0x70a5('0x6a')]=moment()[_0x70a5('0x40')](_0x70a5('0xc1'));_0x4b5556[_0x70a5('0xd7')]=_0x4b5556[_0x70a5('0x6a')];_0x4b5556[_0x70a5('0xd8')]=_0x118055['calleridname'];_0x4b5556[_0x70a5('0xd9')]=_0x118055[_0x70a5('0xd9')];hopperUtils[_0x70a5('0xda')](_0x4b5556)[_0x70a5('0x9b')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x302fd7)hopperUtils[_0x70a5('0xdc')](_0x118055,_0x1e47ef,_0x2aeaa4)['then'](function(){return 0x1;});});}}}};Dialer[_0x70a5('0x1a')][_0x70a5('0xe8')]=function(_0x3cca78){if(this['actions'][_0x3cca78[_0x70a5('0xb7')]]){this[_0x70a5('0xe9')][_0x3cca78[_0x70a5('0xb7')]]['channel']=_0x3cca78[_0x70a5('0xea')];}if(this[_0x70a5('0xb6')][_0x3cca78['uniqueid']]){this['uniqueId'][_0x3cca78[_0x70a5('0xb7')]][_0x70a5('0xea')]=_0x3cca78[_0x70a5('0xea')];}};Dialer[_0x70a5('0x1a')][_0x70a5('0xeb')]=function(_0x1ad46e){if(!this['actions'][_0x1ad46e[_0x70a5('0xec')]]){return;}var _0x25578c=this[_0x70a5('0x1f')][this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]][_0x70a5('0xb5')]][_0x70a5('0xed')]||_0x70a5('0xee');if(_0x25578c===_0x70a5('0xef')){if(this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]]&&_[_0x70a5('0xf0')](this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]][_0x70a5('0xf1')])&&_0x1ad46e[_0x70a5('0x81')]==='1'&&_0x1ad46e['paused']==='0'){if(this[_0x70a5('0x21')][_0x1ad46e['stateinterface']]){if(!this[_0x70a5('0x21')][_0x1ad46e[_0x70a5('0xf2')]][_0x70a5('0xf1')]){this[_0x70a5('0x21')][_0x1ad46e[_0x70a5('0xf2')]][_0x70a5('0xf1')]=!![];this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]][_0x70a5('0xf1')]=!![];this['actions'][_0x1ad46e[_0x70a5('0xec')]]['stateinterface']=_0x1ad46e[_0x70a5('0xf2')];}}}}else if(_0x25578c==='rrmemory'){if(this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]]){if(this[_0x70a5('0x21')][_0x1ad46e['stateinterface']]){this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]][_0x70a5('0xf2')]=_0x1ad46e[_0x70a5('0xf2')];if(_[_0x70a5('0xf0')](this[_0x70a5('0x27')][this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]]['queue']])){this['queueBooked'][this[_0x70a5('0xe9')][_0x1ad46e['actionid']][_0x70a5('0xb5')]]=[];}this['queueBooked'][this[_0x70a5('0xe9')][_0x1ad46e['actionid']][_0x70a5('0xb5')]]['push'](_[_0x70a5('0x5b')](_['pick'](this[_0x70a5('0xe9')][_0x1ad46e['actionid']],[_0x70a5('0xf3'),'stateinterface']),{'status':_0x1ad46e[_0x70a5('0x81')],'paused':_0x1ad46e[_0x70a5('0xf4')]}));}}}};Dialer[_0x70a5('0x1a')][_0x70a5('0x37')]=function(_0x537fe1){if(!this['actions'][_0x537fe1[_0x70a5('0xec')]]){return;}var _0xb02792=this;var _0x118cb2=this[_0x70a5('0x1f')][this['actions'][_0x537fe1[_0x70a5('0xec')]]['queue']];var _0x5baa5c=_0x118cb2[_0x70a5('0xed')]||'rrmemory';if(_0x5baa5c==='roundrobin'){if(this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]&&this[_0x70a5('0xe9')][_0x537fe1['actionid']][_0x70a5('0xf2')]){this[_0x70a5('0x1e')][_0x70a5('0xf5')](this['actions'][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xf3')],this['actions'][_0x537fe1['actionid']][_0x70a5('0xf2')])[_0x70a5('0x9b')](function(_0x48acaf){logger[_0x70a5('0x61')](_0x70a5('0xf6'),util[_0x70a5('0x3f')](_0x48acaf,{'showHidden':![],'depth':null}));})[_0x70a5('0xf7')](function(){_0xb02792[_0x70a5('0xb9')](_0xb02792[_0x70a5('0x1f')][_0xb02792[_0x70a5('0xe9')][_0x537fe1['actionid']][_0x70a5('0xb5')]]);_0xb02792[_0x70a5('0x21')][_0xb02792[_0x70a5('0xe9')][_0x537fe1['actionid']][_0x70a5('0xf2')]][_0x70a5('0xf1')]=![];delete _0xb02792[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]];unlockQueueStatus(_0x118cb2);});}else{this[_0x70a5('0xb9')](this[_0x70a5('0x1f')][this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xb5')]]);hopperUtils[_0x70a5('0xd1')]({'active':![],'ContactId':this['actions'][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xe5')],'ListId':this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xe6')],'VoiceQueueId':this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xd4')]||undefined,'CampaignId':this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0xf8')));delete this['actions'][_0x537fe1[_0x70a5('0xec')]];unlockQueueStatus(_0x118cb2);}}else if(_0x5baa5c===_0x70a5('0xee')){var _0x36d082;if(this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]&&!_[_0x70a5('0x44')](this['queueBooked'][this[_0x70a5('0xe9')][_0x537fe1['actionid']]['queue']])){if(this[_0x70a5('0xf9')][_0xb02792['actions'][_0x537fe1['actionid']][_0x70a5('0xb5')]]){this['queueBookedRR'][_0xb02792[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]['queue']]=this[_0x70a5('0xf9')][this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]['queue']]?this[_0x70a5('0xf9')][this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]['queue']]:this[_0x70a5('0x27')][this[_0x70a5('0xe9')][_0x537fe1['actionid']][_0x70a5('0xb5')]]?this['queueBooked'][this['actions'][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xb5')]][_0x70a5('0xfa')]||0x0:0x0;}this[_0x70a5('0x27')][this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]['queue']][_0x70a5('0xfa')]=this['queueBookedRR'][this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]['queue']];for(var _0x2dbeed=0x0;_0x2dbeed=_0x2f7e0d[_0x70a5('0x11b')]){_0x247a35[_0x70a5('0x11c')](_0x15bdeb,_0x286e6e,_0x50208f,_0x70a5('0x11d'));}else{if(_0x15bdeb[_0x70a5('0x114')]>=_0x2f7e0d[_0x70a5('0x11e')]){_0x247a35['createStateFinal'](_0x15bdeb,_0x286e6e,_0x50208f,_0x70a5('0x11f'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x15bdeb[_0x70a5('0x114')],'scheduledat':moment()['add'](_0x2f7e0d[_0x70a5('0x120')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x15bdeb['ContactId'],'ListId':_0x15bdeb[_0x70a5('0xe6')],'VoiceQueueId':_0x15bdeb[_0x70a5('0xd4')]||undefined,'CampaignId':_0x15bdeb[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x121')));_0x286e6e({'reschedule':0x1});}}});}if(_0x2a3a45[_0x70a5('0x3d')]==='ivr'&&this[_0x70a5('0x20')][_0x2a3a45['queue']]['dialAMDActive']&&_0x588c94['value']==='HANGUP'){delete this[_0x70a5('0xb6')][_0x588c94[_0x70a5('0xb7')]];this[_0x70a5('0xb9')](this[_0x70a5('0x20')][_0x2a3a45[_0x70a5('0xb5')]]);_0x3ec748=new Hangup(_0x2a3a45,_0x588c94);_0x3ec748[_0x70a5('0xc6')]=0x12;_0x3ec748['statedesc']='HangupInAMD';_0x3ec748[_0x70a5('0x10d')]='AMD';ami['emit'](_0x70a5('0x115'),ut[_0x70a5('0x10f')](_0x3ec748,_0x70a5('0x110')));this[_0x70a5('0x111')](_0x3ec748,_0x70a5('0x122'),'[syncHangupInAMDIvr]');}if(_0x2a3a45[_0x70a5('0x3d')]==='ivr'&&this[_0x70a5('0x20')][_0x2a3a45[_0x70a5('0xb5')]][_0x70a5('0x108')]&&_0x588c94[_0x70a5('0x109')]==='MACHINE'){return new Promise(function(_0x265f2a,_0x46097f){delete _0x247a35['uniqueId'][_0x588c94[_0x70a5('0xb7')]];_0x247a35[_0x70a5('0xb9')](_0x247a35[_0x70a5('0x20')][_0x2a3a45[_0x70a5('0xb5')]]);_0x247a35[_0x70a5('0x20')][_0x2a3a45[_0x70a5('0xb5')]][_0x70a5('0xbb')]+=0x1;_0x247a35[_0x70a5('0x20')][_0x2a3a45[_0x70a5('0xb5')]][_0x70a5('0x10b')]+=0x1;var _0x261802=_0x247a35['campaigns'][_0x2a3a45[_0x70a5('0xb5')]];var _0x5d2cb4=new Hangup(_0x2a3a45,_0x588c94);_0x5d2cb4[_0x70a5('0xc6')]=0x13;_0x5d2cb4[_0x70a5('0xc7')]=_0x70a5('0x113');_0x5d2cb4['membername']=_0x70a5('0x10e');_0x5d2cb4[_0x70a5('0x114')]+=0x1;_0x5d2cb4[_0x70a5('0xcb')]+=0x1;_0x5d2cb4[_0x70a5('0x110')]=!![];ami[_0x70a5('0x3c')](_0x70a5('0x115'),ut[_0x70a5('0x10f')](_0x5d2cb4,_0x70a5('0x110')));hopperUtils[_0x70a5('0xda')](_0x5d2cb4)[_0x70a5('0x9b')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5d2cb4['countbusyretry']+_0x5d2cb4['countcongestionretry']+_0x5d2cb4[_0x70a5('0x119')]+_0x5d2cb4[_0x70a5('0x11a')]+_0x5d2cb4[_0x70a5('0xca')]+_0x5d2cb4[_0x70a5('0xe0')]+_0x5d2cb4[_0x70a5('0x114')]+_0x5d2cb4[_0x70a5('0x123')]>=_0x261802[_0x70a5('0x11b')]){_0x247a35[_0x70a5('0x11c')](_0x5d2cb4,_0x265f2a,_0x46097f,_0x70a5('0x11d'));}else{if(_0x5d2cb4[_0x70a5('0x114')]>=_0x261802['dialMachineMaxRetry']){_0x247a35[_0x70a5('0x124')](_0x5d2cb4,_0x265f2a,_0x46097f,_0x70a5('0x11f'));}else{hopperUtils[_0x70a5('0xd1')]({'active':![],'countmachineretry':_0x5d2cb4[_0x70a5('0x114')],'scheduledat':moment()[_0x70a5('0xe4')](_0x261802[_0x70a5('0x120')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x5d2cb4[_0x70a5('0xe5')],'ListId':_0x5d2cb4['ListId'],'VoiceQueueId':_0x5d2cb4[_0x70a5('0xd4')]||undefined,'CampaignId':_0x5d2cb4[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch('[rescheduleContact][Machine]'));_0x265f2a({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x70a5('0x31')]=function(_0x2911b9){var _0x4ca141=this[_0x70a5('0xb6')][_0x2911b9['uniqueid']];var _0x3073d6;if(_0x4ca141&&_0x4ca141[_0x70a5('0x3d')]==='ivr'){delete this[_0x70a5('0xb6')][_0x2911b9[_0x70a5('0xb7')]];this[_0x70a5('0xb9')](this['campaigns'][_0x4ca141[_0x70a5('0xb5')]]);this[_0x70a5('0x20')][_0x4ca141['queue']][_0x70a5('0x125')]+=0x1;_0x3073d6=new Hangup(_0x4ca141,_0x2911b9);hopperUtils[_0x70a5('0xda')](_0x3073d6)[_0x70a5('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x70a5('0xc2')](_0x3073d6)[_0x70a5('0x9b')](loggerCatch('[syncHangupIvr]'));}if(_0x4ca141&&_0x4ca141[_0x70a5('0x3d')]!==_0x70a5('0xb8')&&isNotNull(this['voiceQueues'][_0x4ca141[_0x70a5('0xb5')]][_0x70a5('0x126')])){delete this[_0x70a5('0xb6')][_0x2911b9[_0x70a5('0xb7')]];this['updateOriginated'](this[_0x70a5('0x1f')][_0x4ca141[_0x70a5('0xb5')]]);this['voiceQueues'][_0x4ca141['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x4ca141['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x3073d6=new Hangup(_0x4ca141,_0x2911b9);_0x3073d6[_0x70a5('0xc6')]=0x10;_0x3073d6[_0x70a5('0xc7')]=_0x70a5('0x127');_0x3073d6[_0x70a5('0x10d')]=_0x70a5('0x128');hopperUtils[_0x70a5('0xda')](_0x3073d6)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x70a5('0xc2')](_0x3073d6)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x129')));}if(_0x4ca141&&_0x4ca141[_0x70a5('0x3d')]!==_0x70a5('0xb8')&&!isNotNull(this[_0x70a5('0x1f')][_0x4ca141[_0x70a5('0xb5')]][_0x70a5('0x126')])){delete this[_0x70a5('0xb6')][_0x2911b9[_0x70a5('0xb7')]];this[_0x70a5('0xb9')](this[_0x70a5('0x1f')][_0x4ca141[_0x70a5('0xb5')]]);this['voiceQueues'][_0x4ca141['queue']][_0x70a5('0x12a')]+=0x1;_0x3073d6=new Hangup(_0x4ca141,_0x2911b9);_0x3073d6['state']=0xc;_0x3073d6[_0x70a5('0xc7')]=_0x2911b9[_0x70a5('0x12b')];_0x3073d6['membername']='Unknow';hopperUtils[_0x70a5('0xda')](_0x3073d6)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x3073d6)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x129')));}};Dialer[_0x70a5('0x1a')]['syncQueueSummary']=function(_0x3fcc65){var _0x49d4dc=this;if(!_0x49d4dc[_0x70a5('0x12c')][_0x3fcc65[_0x70a5('0x42')]]){_0x49d4dc[_0x70a5('0x12c')][_0x3fcc65['name']]={'running':![]};}else if(_0x49d4dc['queuesSummary'][_0x3fcc65[_0x70a5('0x42')]][_0x70a5('0x12d')]===!![]){return;}else if(_0x49d4dc['queuesSummary'][_0x3fcc65[_0x70a5('0x42')]][_0x70a5('0x12d')]===![]){_0x49d4dc[_0x70a5('0x12c')][_0x3fcc65[_0x70a5('0x42')]][_0x70a5('0x12d')]=!![];}var _0x5df0b3=_0x49d4dc['voiceQueues'][_0x3fcc65['name']];var _0x1140b5=_0x5df0b3[_0x70a5('0x65')]!==utils[_0x70a5('0x67')]['INACTIVE'];var _0x6ca961=utils[_0x70a5('0x12e')](_0x5df0b3);_0x5df0b3[_0x70a5('0x12f')]=utils['getQueueCampaignStatusMessage'](_0x5df0b3,_0x49d4dc[_0x70a5('0x7f')]);Promise[_0x70a5('0xa3')]()[_0x70a5('0x95')](function(){if(_0x5df0b3['statusMessage']===utils[_0x70a5('0x67')][_0x70a5('0x73')]){if(_0x1140b5){clearPredictiveAttributes(_0x5df0b3);_0x3fcc65[_0x70a5('0x24')]=undefined;_0x3fcc65[_0x70a5('0x25')]=undefined;}if(_0x5df0b3[_0x70a5('0x12f')]===utils['CAMPAIGN_STATUS'][_0x70a5('0x73')]){_0x3fcc65[_0x70a5('0x130')]=0x0;_0x3fcc65[_0x70a5('0xf4')]=0x0;_0x3fcc65[_0x70a5('0x131')]=0x0;_0x3fcc65['talking']=0x0;_0x3fcc65[_0x70a5('0x132')]=0x0;}}else if(_0x5df0b3['statusMessage']===utils[_0x70a5('0x67')][_0x70a5('0x133')]&&!_0x6ca961){return _0x49d4dc[_0x70a5('0x8b')](_0x5df0b3,!![])['then'](function(){return _0x49d4dc[_0x70a5('0x8b')](_0x5df0b3,![]);})[_0x70a5('0x95')](function(){return _0x49d4dc[_0x70a5('0xa6')](_0x5df0b3);})[_0x70a5('0x9b')](function(_0x4e6c96){loggerSyncQueueSummary['debug'](_0x70a5('0x134'),util[_0x70a5('0x3f')](_0x4e6c96,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5df0b3);});}else{clearPredictiveAttributes(_0x5df0b3);}})[_0x70a5('0x95')](function(){var _0x493345=_0x3fcc65[_0x70a5('0x135')](_0x5df0b3);if(_0x493345||_0x5df0b3[_0x70a5('0x136')]){_0x5df0b3[_0x70a5('0x136')]=![];_0x3fcc65['updateReportFromOutboundQueue'](_0x5df0b3);Object[_0x70a5('0x137')](_0x5df0b3,_0x3fcc65);emitOutboundVoiceQueueSummary(_0x3fcc65);}_0x49d4dc[_0x70a5('0x12c')][_0x5df0b3['name']]['running']=![];})[_0x70a5('0x9b')](function(_0x5a2c88){logger[_0x70a5('0x61')](_0x70a5('0x134'),util['inspect'](_0x5a2c88,{'showHidden':![],'depth':null}));_0x49d4dc[_0x70a5('0x12c')][_0x5df0b3[_0x70a5('0x42')]]['running']=![];});};Dialer['prototype'][_0x70a5('0x138')]=_['throttle'](function(){var _0x5ee674=_['filter'](this[_0x70a5('0x1f')],function(_0x4f208b){return _0x4f208b['dialPreviewRecallmeReminder'];});var _0x3e5227=_[_0x70a5('0x139')](this[_0x70a5('0x21')],function(_0x47d19e){return _0x47d19e['online']&&_0x47d19e[_0x70a5('0x81')]===_0x70a5('0x82');});if(_0x5ee674['length']>0x0&&_0x3e5227[_0x70a5('0x13a')]>0x0){return Promise['resolve']()[_0x70a5('0x95')](cmHopper[_0x70a5('0x13b')](_[_0x70a5('0x13c')](_0x5ee674,'id'),previewRecallmeReminderInterval,_['map'](_0x3e5227,'id')))['then'](function(_0x3bbde7){for(var _0x40c7ea=0x0;_0x40c7ea<_0x3bbde7[_0x70a5('0x13a')];_0x40c7ea++){var _0x42c5b0=_0x3bbde7[_0x40c7ea][_0x70a5('0x13d')][_0x70a5('0x42')];if(_0x42c5b0)io['to'](util[_0x70a5('0x40')](_0x70a5('0x13e'),_0x42c5b0))[_0x70a5('0x3c')](_0x70a5('0x13f'),{'hopper':_0x3bbde7[_0x40c7ea]});}})[_0x70a5('0x9b')](function(_0x40d714){logger[_0x70a5('0x61')](_0x70a5('0x140'),_0x40d714);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x70a5('0x1a')][_0x70a5('0x39')]=function(){var _0x4c3a8a=this;setInterval(function(){_0x4c3a8a['clearZombieChannels'](_0x4c3a8a[_0x70a5('0xb6')],_0x70a5('0x141'));_0x4c3a8a[_0x70a5('0x142')](_0x4c3a8a[_0x70a5('0xe9')],_0x70a5('0x143'));},0x32c8);};Dialer[_0x70a5('0x1a')][_0x70a5('0x142')]=function(_0x20e739,_0x4e1e06){var _0x16e013=this;for(var _0x1b8f87 in _0x20e739){if(typeof _0x20e739[_0x1b8f87]!==_0x70a5('0xa2')){this[_0x70a5('0x1d')][_0x70a5('0x1b')](function(){if(!_[_0x70a5('0xf0')](_0x20e739[_0x1b8f87])){return ami[_0x70a5('0x98')]({'action':_0x70a5('0x81'),'channel':_0x20e739[_0x1b8f87]['channel']})[_0x70a5('0x9b')](function(_0x2e31c9){if(_0x2e31c9[_0x70a5('0x65')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x20e739[_0x1b8f87]&&_0x20e739[_0x1b8f87][_0x70a5('0x3d')]!=='ivr'){_0x16e013[_0x70a5('0xb9')](_0x16e013[_0x70a5('0x1f')][_0x20e739[_0x1b8f87]['queue']]);logger[_0x70a5('0x61')]('[Dialer][checkChannel]',_0x4e1e06,_0x1b8f87,_0x20e739[_0x1b8f87]['queue']);delete _0x20e739[_0x1b8f87];}if(_0x20e739[_0x1b8f87]&&_0x20e739[_0x1b8f87][_0x70a5('0x3d')]===_0x70a5('0xb8')){_0x16e013['updateOriginated'](_0x16e013[_0x70a5('0x20')][_0x20e739[_0x1b8f87][_0x70a5('0xb5')]]);logger[_0x70a5('0x61')](_0x70a5('0x144'),_0x4e1e06,_0x1b8f87,_0x20e739[_0x1b8f87][_0x70a5('0xb5')]);delete _0x20e739[_0x1b8f87];}},0x2328);}});}});}}};Dialer['prototype'][_0x70a5('0x145')]=function(_0x5ec25a){return Promise['resolve']()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x5ec25a))[_0x70a5('0x9b')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x70a5('0x1a')][_0x70a5('0xb9')]=function(_0xab8b06){if(!_['isUndefined'](_0xab8b06)&&_0xab8b06!==null){if(typeof _0xab8b06[_0x70a5('0x77')]!==_0x70a5('0xa2')){if(_0xab8b06[_0x70a5('0x77')]>0x0){_0xab8b06[_0x70a5('0x77')]-=0x1;}else{logger[_0x70a5('0x61')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x70a5('0x61')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x70a5('0x1a')]['loggerHandler']=function(_0x3ea446,_0xdf1f42){var _0x1c869f=this;return function(_0x145d24){_0x1c869f[_0x70a5('0xb9')](_0xdf1f42);logger[_0x70a5('0x61')](_0x3ea446,util[_0x70a5('0x3f')](_0x145d24,{'showHidden':![],'depth':null}));};};Dialer[_0x70a5('0x1a')][_0x70a5('0x146')]=function(_0xd3a41d,_0x3732b4,_0x580c76){var _0x23f13a={'state':0x19,'statedesc':_0x70a5('0x147')};this[_0x70a5('0xb9')](_0x3732b4);this[_0x70a5('0x111')](_[_0x70a5('0x5b')](_0x23f13a,_[_0x70a5('0x6e')](_0x580c76,[_0x70a5('0xe5'),'ListId',_0x70a5('0x148'),_0x70a5('0xd4'),'CampaignId'])),_0x70a5('0x149'),'[emptyContact]');logger[_0x70a5('0x61')](_0xd3a41d);};Dialer[_0x70a5('0x1a')][_0x70a5('0x111')]=function(_0x36fc9b,_0x484158,_0x3681e7){hopperUtils['createHistory'](_0x36fc9b)[_0x70a5('0x9b')](loggerCatch(_0x484158));hopperUtils['moveContactManagedDialer'](_0x36fc9b)[_0x70a5('0x9b')](loggerCatch(_0x3681e7));};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x4b5fbc,_0x11e9d1){hopperUtils[_0x70a5('0xda')](_0x4b5fbc)[_0x70a5('0x9b')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x11e9d1==0x0){hopperUtils[_0x70a5('0xc2')](_0x4b5fbc)['catch'](loggerCatch(_0x70a5('0x14a')));}};Dialer[_0x70a5('0x1a')][_0x70a5('0x140')]=function(_0x1c3953){return Promise[_0x70a5('0xa3')]()[_0x70a5('0x95')](cmHopper['handlePreviewRecallNotifications'](_0x1c3953['id'],previewRecallmeReminderInterval))[_0x70a5('0x95')](function(_0x18373b){for(var _0x22fc04=0x0;_0x22fc04<_0x18373b[_0x70a5('0x13a')];_0x22fc04++){var _0x4a8867=_0x18373b[_0x22fc04][_0x70a5('0x13d')]['name'];if(_0x4a8867)io['to'](util[_0x70a5('0x40')](_0x70a5('0x13e'),_0x4a8867))[_0x70a5('0x3c')]('user:dialPreviewRecallReminder',{'hopper':_0x18373b[_0x22fc04]});}})[_0x70a5('0x9b')](function(){});};Dialer[_0x70a5('0x1a')]['launchHandleIvr']=function(_0x3440e2){var _0x803509=this;return function(){_0x803509[_0x70a5('0x14b')](_0x3440e2);};};Dialer[_0x70a5('0x1a')]['actionOriginate']=function(_0x93bb94,_0x26592c){var _0x5d2f4e=this;var _0x2af464=uuid['v4']();this[_0x70a5('0xe9')][_0x2af464]=new Action(_0x93bb94,_0x26592c,_0x2af464);return new Promise(function(_0x204b50,_0x15b9bb){if(_[_0x70a5('0x3b')](_0x93bb94)&&typeof _0x93bb94!==_0x70a5('0x14c')){return _0x15b9bb(msgResponse('originate',_0x70a5('0x8c'),'voiceQueue\x20is\x20undefine'));}if(_[_0x70a5('0x3b')](_0x26592c[_0x70a5('0x14d')])||_0x26592c[_0x70a5('0x14d')]===null){return _0x15b9bb(msgResponse('originate',_0x70a5('0x8c'),_0x70a5('0x14e')));}var _0x406e5e={'XMD-CALLERID':_0x5d2f4e['actions'][_0x2af464][_0x70a5('0x14f')](),'XMD-AGI':_0x93bb94[_0x70a5('0x126')]?util[_0x70a5('0x40')]('\x22agi://%s/square,%s\x22',ipAgi,_0x93bb94[_0x70a5('0x126')]):'NONE','XMD-AGIAFTER':_0x93bb94[_0x70a5('0xbf')]?util['format'](_0x70a5('0x150'),ipAgi,_0x93bb94[_0x70a5('0xbf')]):'NONE','XMD-QUEUE':utils[_0x70a5('0x151')](_0x93bb94)?util['format'](_0x70a5('0x152'),_0x93bb94[_0x70a5('0x42')],_0x93bb94[_0x70a5('0x153')]||'',_0x93bb94[_0x70a5('0xc0')]?'c':'',_0x93bb94['dialQueueTimeout']||0x3):_0x70a5('0x154'),'XMD-CONTACTID':_0x26592c[_0x70a5('0xe5')],'XMD-CDRTYPE':_0x70a5('0x155'),'CALLERID(all)':_0x5d2f4e[_0x70a5('0xe9')][_0x2af464][_0x70a5('0x14f')](),'XMD-AMD':_0x93bb94[_0x70a5('0x108')]?_0x70a5('0x133'):_0x70a5('0x154'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x93bb94['dialAMDActive']){_0x406e5e[_0x70a5('0x156')]=_0x93bb94['dialAMDInitialSilence']||0x9c4;_0x406e5e[_0x70a5('0x157')]=_0x93bb94[_0x70a5('0x158')]||0x5dc;_0x406e5e[_0x70a5('0x159')]=_0x93bb94[_0x70a5('0x15a')]||0x320;_0x406e5e[_0x70a5('0x15b')]=_0x93bb94['dialAMDTotalAnalysisTime']||0x1388;_0x406e5e[_0x70a5('0x15c')]=_0x93bb94[_0x70a5('0x15d')]||0x64;_0x406e5e[_0x70a5('0x15e')]=_0x93bb94['dialAMDBetweenWordsSilence']||0x32;_0x406e5e[_0x70a5('0x15f')]=_0x93bb94[_0x70a5('0x160')]||0x3;_0x406e5e['XMD-AMDSILENCETHRESHOLD']=_0x93bb94['dialAMDSilenceThreshold']||0x100;_0x406e5e[_0x70a5('0x161')]=_0x93bb94[_0x70a5('0x162')]||0x1388;}if(utils['isOutboundQueue'](_0x93bb94)){_0x406e5e['XMD-VOICEQUEUEID']=_0x26592c[_0x70a5('0xd4')];}else{_0x406e5e[_0x70a5('0x163')]=_0x26592c[_0x70a5('0xd5')];}for(var _0x4225f8 in _0x26592c[_0x70a5('0x164')]){if(typeof _0x26592c['Contact'][_0x4225f8]!==_0x70a5('0xa2')){if(isNotNull(_0x26592c['Contact'][_0x4225f8])&&_0x4225f8!=='id'&&_0x4225f8!==_0x70a5('0x165')&&_0x4225f8!=='createdAt'&&_0x4225f8!=='updatedAt'){_0x406e5e[util[_0x70a5('0x40')]('%s%s',_0x70a5('0x166'),_[_0x70a5('0x167')](_0x4225f8))]=_0x26592c[_0x70a5('0x164')][_0x4225f8];}}}var _0x573b11=_0x5d2f4e[_0x70a5('0x7d')](_0x93bb94[_0x70a5('0x84')])?utils['getCallerId'](_0x93bb94[_0x70a5('0x84')][_0x70a5('0x168')],_0x93bb94[_0x70a5('0x169')],_0x93bb94[_0x70a5('0x16a')]>0x0?utils['getCallerIdRandom'](_0x93bb94[_0x70a5('0x16b')],_0x93bb94[_0x70a5('0x16a')]):_0x93bb94[_0x70a5('0x16b')]):utils['getCallerId'](_[_0x70a5('0xf0')](_0x93bb94[_0x70a5('0x85')])?_0x93bb94[_0x70a5('0x84')][_0x70a5('0x168')]:_0x93bb94['TrunkBackup'][_0x70a5('0x168')],_0x93bb94[_0x70a5('0x169')],_0x93bb94[_0x70a5('0x16a')]>0x0?utils[_0x70a5('0x16c')](_0x93bb94[_0x70a5('0x16b')],_0x93bb94[_0x70a5('0x16a')]):_0x93bb94[_0x70a5('0x16b')]);if(_0x573b11){_0x406e5e[_0x70a5('0x16d')]=_0x5d2f4e[_0x70a5('0xe9')][_0x2af464][_0x70a5('0x16e')]=utils['extractCalleridName'](_0x573b11);_0x406e5e[_0x70a5('0x16f')]=_0x26592c[_0x70a5('0x14d')];}_0x93bb94[_0x70a5('0x170')]=_0x406e5e;return ami['Action']({'actionid':_0x2af464,'action':_0x70a5('0x171'),'channel':_0x5d2f4e[_0x70a5('0x7d')](_0x93bb94[_0x70a5('0x84')])?util[_0x70a5('0x40')](_0x70a5('0x172'),_0x93bb94[_0x70a5('0x84')][_0x70a5('0x42')],isNotNull(_0x93bb94[_0x70a5('0x173')])?_0x93bb94[_0x70a5('0x173')][_0x70a5('0x174')]()||'':'',_0x93bb94[_0x70a5('0x175')]>0x0?_0x26592c[_0x70a5('0x14d')][_0x70a5('0x176')](_0x93bb94[_0x70a5('0x175')]):_0x26592c['phone']):util[_0x70a5('0x40')](_0x70a5('0x172'),_[_0x70a5('0xf0')](_0x93bb94[_0x70a5('0x85')])?_0x93bb94['Trunk'][_0x70a5('0x42')]:_0x93bb94['TrunkBackup'][_0x70a5('0x42')],isNotNull(_0x93bb94['dialPrefix'])?_0x93bb94[_0x70a5('0x173')][_0x70a5('0x174')]()||'':'',_0x93bb94['dialCutDigit']>0x0?_0x26592c[_0x70a5('0x14d')][_0x70a5('0x176')](_0x93bb94[_0x70a5('0x175')]):_0x26592c['phone']),'callerid':_0x573b11,'Exten':_0x70a5('0x107'),'Context':'from-sip','Priority':'1','variable':_0x406e5e,'timeout':(_0x93bb94[_0x70a5('0x177')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2af464})[_0x70a5('0x95')](function(_0x1ab3f2){return _0x204b50(_0x1ab3f2);})[_0x70a5('0x9b')](function(_0x41f4f2){_0x93bb94[_0x70a5('0x178')]+=0x1;var _0x3466bc=new History(_0x5d2f4e[_0x70a5('0xe9')][_0x2af464]);logger[_0x70a5('0x61')](util[_0x70a5('0x40')](_0x70a5('0x179'),JSON[_0x70a5('0x6d')](_0x41f4f2)));_0x3466bc['state']=0xe;_0x3466bc[_0x70a5('0xc7')]=_0x70a5('0x17a');_0x3466bc['starttime']=moment()['format'](_0x70a5('0xc1'));_0x3466bc[_0x70a5('0xd7')]=_0x3466bc[_0x70a5('0x6a')];hopperUtils['createHistory'](_0x3466bc)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x17b')));_0x5d2f4e[_0x70a5('0xc2')](_0x3466bc)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x17b')))[_0x70a5('0xf7')](function(){delete _0x5d2f4e[_0x70a5('0xe9')][_0x2af464];return _0x15b9bb(msgResponse('originate',_0x70a5('0x7c'),_0x70a5('0x17c')));});});});};Dialer[_0x70a5('0x1a')][_0x70a5('0x17d')]=function(_0x240d65,_0x405eb2,_0x54215a){var _0x4c4ef2=new History(_0x405eb2);if(_0x4c4ef2[_0x70a5('0x117')]+_0x4c4ef2[_0x70a5('0x118')]+_0x4c4ef2[_0x70a5('0x119')]+_0x4c4ef2[_0x70a5('0x11a')]+_0x4c4ef2[_0x70a5('0xca')]+_0x4c4ef2[_0x70a5('0xe0')]+_0x4c4ef2[_0x70a5('0x114')]+_0x4c4ef2[_0x70a5('0x123')]>=_0x54215a['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x240d65){case 0x3:if(_0x4c4ef2[_0x70a5('0x119')]>=_0x54215a[_0x70a5('0x17e')]-0x1){return!![];}hopperUtils[_0x70a5('0xd1')]({'active':![],'countnoanswerretry':_0x4c4ef2[_0x70a5('0x119')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a['dialNoAnswerRetryFrequency'],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2['CampaignId']||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x17f')));break;case 0x5:if(_0x4c4ef2[_0x70a5('0x117')]>=_0x54215a[_0x70a5('0x180')]-0x1){return!![];}hopperUtils[_0x70a5('0xd1')]({'active':![],'countbusyretry':_0x4c4ef2[_0x70a5('0x117')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a['dialBusyRetryFrequency'],'minutes')['format'](_0x70a5('0xc1')),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x181')));break;case 0x8:if(_0x4c4ef2[_0x70a5('0x118')]>=_0x54215a['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x70a5('0xd1')]({'active':![],'countcongestionretry':_0x4c4ef2[_0x70a5('0x118')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a[_0x70a5('0x182')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2[_0x70a5('0xd5')]||undefined})['catch'](loggerCatch(_0x70a5('0x183')));break;case 0x0:if(_0x4c4ef2[_0x70a5('0x11a')]>=_0x54215a[_0x70a5('0x184')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4c4ef2[_0x70a5('0x11a')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a[_0x70a5('0x185')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2['ListId'],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2['CampaignId']||undefined})[_0x70a5('0x9b')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x4c4ef2[_0x70a5('0xca')]>=_0x54215a[_0x70a5('0xcf')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4c4ef2['countdropretry']+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a['dialDropRetryFrequency'],'minutes')[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x4c4ef2['ContactId'],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2['VoiceQueueId']||undefined,'CampaignId':_0x4c4ef2[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0xd6')));break;case 0xb:if(_0x4c4ef2[_0x70a5('0xe0')]>=_0x54215a[_0x70a5('0xe3')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4c4ef2[_0x70a5('0xe0')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a['dialAbandonedRetryFrequency'],_0x70a5('0xd3'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x4c4ef2[_0x70a5('0x114')]>=_0x54215a[_0x70a5('0x11e')]-0x1){return!![];}hopperUtils[_0x70a5('0xd1')]({'active':![],'countmachineretry':_0x4c4ef2[_0x70a5('0x114')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a[_0x70a5('0x120')],_0x70a5('0xd3'))['format'](_0x70a5('0xc1')),'ContactId':_0x4c4ef2['ContactId'],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2['CampaignId']||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x121')));break;case 0x14:if(_0x4c4ef2['countagentrejectretry']>=_0x54215a[_0x70a5('0x186')]-0x1){return!![];}hopperUtils[_0x70a5('0xd1')]({'active':![],'countagentrejectretry':_0x4c4ef2[_0x70a5('0x123')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a[_0x70a5('0x187')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2['ListId'],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2['CampaignId']||undefined})[_0x70a5('0x9b')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x70a5('0x1a')]['callProgressDetecting']=function(_0x387f79,_0x58f9ab,_0xcf7d48){var _0x54ef2b=this;var _0x263a00=new History(_0x387f79);var _0x31e810=![];var _0x140f23;var _0x10827c;return new Promise(function(_0x38db5d,_0xa26883){if(_[_0x70a5('0x3b')](_0x58f9ab)&&typeof _0x58f9ab!==_0x70a5('0x14c')){return _0xa26883(msgResponse(_0x70a5('0x188'),_0x70a5('0x8c'),_0x70a5('0x189')));}if(_[_0x70a5('0x3b')](_0xcf7d48)&&typeof _0xcf7d48!==_0x70a5('0x14c')){return _0xa26883(msgResponse('[callProgressDetecting]',_0x70a5('0x8c'),_0x70a5('0x18a')));}hopperUtils[_0x70a5('0xe2')](_0x263a00,_0xcf7d48['reason'],_0x58f9ab)[_0x70a5('0x95')](function(_0x2bd9ba){if(_0x2bd9ba['additional']==0x1)_0x31e810=!![];switch(_0xcf7d48[_0x70a5('0xbc')]){case'0':_0x58f9ab['outboundNoSuchCallsDay']+=0x1;_0x263a00[_0x70a5('0xc6')]=0x0;_0x263a00[_0x70a5('0xc7')]='NoSuchNumber';_0x263a00[_0x70a5('0x11a')]+=0x1;_0x263a00[_0x70a5('0xcb')]+=0x1;ami['emit'](_0x70a5('0x18b'),ut[_0x70a5('0x10f')](_0x387f79,_0x70a5('0x18c')));_0x140f23=_0x58f9ab[_0x70a5('0x185')];_0x10827c=_0x58f9ab['callAdditionalPhoneAfterMin'];hopperUtils[_0x70a5('0xda')](_0x263a00)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x54ef2b[_0x70a5('0x17d')](0x0,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00[_0x70a5('0x11a')]>=_0x58f9ab[_0x70a5('0x184')]){_0x54ef2b[_0x70a5('0x124')](_0x263a00,_0x38db5d,_0xa26883,'reason\x200\x20no\x20such\x20number....');}else{_0x54ef2b[_0x70a5('0x11c')](_0x263a00,_0x38db5d,_0xa26883,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x58f9ab['outboundNoAnswerCallsDay']+=0x1;_0x263a00[_0x70a5('0xc6')]=0x3;_0x263a00[_0x70a5('0xc7')]='NoAnswer';_0x263a00[_0x70a5('0x119')]+=0x1;_0x263a00[_0x70a5('0xcb')]+=0x1;var _0x20388a=ut['buildNoAnswerEventPayload'](_0x387f79,_0x58f9ab);ami[_0x70a5('0x3c')](_0x70a5('0x18d'),_0x20388a);_0x140f23=_0x58f9ab[_0x70a5('0x18e')];_0x10827c=_0x58f9ab['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x263a00)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x18f')));if(_0x54ef2b['checkRetriveMax'](0x3,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00[_0x70a5('0x119')]>=_0x58f9ab[_0x70a5('0x17e')]){_0x54ef2b[_0x70a5('0x124')](_0x263a00,_0x38db5d,_0xa26883,'reason\x203\x20ringing\x20no\x20answer');}else{_0x54ef2b[_0x70a5('0x11c')](_0x263a00,_0x38db5d,_0xa26883,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x58f9ab[_0x70a5('0x190')]+=0x1;_0x263a00[_0x70a5('0xc6')]=0x5;_0x263a00[_0x70a5('0xc7')]=_0x70a5('0x191');_0x263a00['countbusyretry']+=0x1;_0x263a00['countglobal']+=0x1;ami[_0x70a5('0x3c')](_0x70a5('0x192'),ut[_0x70a5('0x10f')](_0x387f79,_0x70a5('0x193')));_0x140f23=_0x58f9ab[_0x70a5('0x194')];_0x10827c=_0x58f9ab[_0x70a5('0xcc')];hopperUtils[_0x70a5('0xda')](_0x263a00)[_0x70a5('0x9b')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x54ef2b['checkRetriveMax'](0x5,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00['countbusyretry']>=_0x58f9ab[_0x70a5('0x180')]){_0x54ef2b[_0x70a5('0x124')](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x195'));}else{_0x54ef2b[_0x70a5('0x11c')](_0x263a00,_0x38db5d,_0xa26883,'reason\x205\x20busy');}}break;case'8':_0x58f9ab[_0x70a5('0x196')]+=0x1;_0x263a00[_0x70a5('0xc6')]=0x8;_0x263a00[_0x70a5('0xc7')]='Congestion';_0x263a00[_0x70a5('0x118')]+=0x1;_0x263a00['countglobal']+=0x1;_0x140f23=_0x58f9ab[_0x70a5('0x182')];_0x10827c=_0x58f9ab['callAdditionalPhoneAfterMin'];ami['emit'](_0x70a5('0x197'),ut['buildObj'](_0x387f79,_0x70a5('0x198')));hopperUtils['createHistory'](_0x263a00)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x199')));if(_0x54ef2b['checkRetriveMax'](0x8,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00[_0x70a5('0x118')]>=_0x58f9ab['dialCongestionMaxRetry']){_0x54ef2b[_0x70a5('0x124')](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x19a'));}else{_0x54ef2b['stateGlobal'](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x19a'));}}break;case'11':_0x58f9ab[_0x70a5('0x19b')]+=0x1;_0x263a00['state']=0xb;_0x263a00[_0x70a5('0xc7')]='Abandoned';_0x263a00[_0x70a5('0xe0')]+=0x1;_0x263a00[_0x70a5('0xcb')]+=0x1;_0x140f23=_0x58f9ab[_0x70a5('0xe1')];_0x10827c=_0x58f9ab[_0x70a5('0xcc')];hopperUtils['createHistory'](_0x263a00)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x19c')));if(_0x54ef2b['checkRetriveMax'](0xb,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00[_0x70a5('0xe0')]>=_0x58f9ab[_0x70a5('0xe3')]){_0x54ef2b['createStateFinal'](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x19d'));}else{_0x54ef2b['stateGlobal'](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x19d'));}}break;case'20':_0x58f9ab['outboundRejectCallsDay']+=0x1;_0x263a00[_0x70a5('0xc6')]=0x14;_0x263a00['statedesc']=_0x70a5('0x19e');_0x263a00['countagentrejectretry']+=0x1;_0x263a00[_0x70a5('0xcb')]+=0x1;_0x140f23=_0x58f9ab[_0x70a5('0x187')];_0x10827c=_0x58f9ab['callAdditionalPhoneAfterMin'];ami[_0x70a5('0x3c')](_0x70a5('0x19f'),ut[_0x70a5('0x10f')](_0x387f79,'agentreject'));hopperUtils[_0x70a5('0xda')](_0x263a00)['catch'](loggerCatch(_0x70a5('0x1a0')));if(_0x54ef2b['checkRetriveMax'](0x14,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00[_0x70a5('0x123')]>=_0x58f9ab[_0x70a5('0x186')]){_0x54ef2b[_0x70a5('0x124')](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x1a1'));}else{_0x54ef2b[_0x70a5('0x11c')](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x1a1'));}}break;default:_0x58f9ab[_0x70a5('0x12a')]+=0x1;_0x263a00[_0x70a5('0xc6')]=0xc;_0x263a00[_0x70a5('0xc7')]=_0xcf7d48[_0x70a5('0xbc')];_0x140f23=_0x58f9ab['dialAgentRejectRetryFrequency'];_0x10827c=_0x58f9ab[_0x70a5('0xcc')];hopperUtils['createHistory'](_0x263a00)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1a2')));if(_0x54ef2b[_0x70a5('0x17d')](_0xcf7d48['reason'],_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00['countbusyretry']+_0x263a00[_0x70a5('0x118')]+_0x263a00[_0x70a5('0x119')]+_0x263a00[_0x70a5('0x11a')]+_0x263a00['countdropretry']+_0x263a00['countabandonedretry']+_0x263a00[_0x70a5('0x114')]+_0x263a00[_0x70a5('0x123')]>=_0x58f9ab[_0x70a5('0x11b')]){_0x54ef2b[_0x70a5('0x11c')](_0x263a00,_0x38db5d,_0xa26883,_0xcf7d48[_0x70a5('0xbc')]);}else{_0x54ef2b['createStateFinal'](_0x263a00,_0x38db5d,_0xa26883,_0xcf7d48['reason']);}}}})[_0x70a5('0x95')](function(){if(_0x31e810){hopperUtils['swapAdditionalPhones'](_0x263a00,_0x140f23,_0x10827c)[_0x70a5('0x95')](function(){return _0x38db5d(0x1);});}});});};Dialer[_0x70a5('0x1a')][_0x70a5('0x11c')]=function(_0x507980,_0x8c44b5,_0x209e6f,_0x2620fc){var _0x448ffd=new Final(_0x507980);_0x448ffd['state']=0xf;_0x448ffd[_0x70a5('0xc7')]='Global';this['createStateFinal'](_0x448ffd,_0x8c44b5,_0x209e6f,_0x2620fc);};Dialer[_0x70a5('0x1a')][_0x70a5('0x124')]=function(_0x23e969,_0xd46d74,_0xca206d,_0x46fd34){hopperUtils[_0x70a5('0xc2')](_0x23e969)['then'](function(){return _0xd46d74(msgResponse('[callProgressDetecting]',_0x70a5('0x1a3'),_0x46fd34));})[_0x70a5('0x9b')](function(){return _0xca206d(msgResponse('[moveContactManagedDialer][0]',_0x70a5('0x8c'),'contact\x20not\x20moved'));});};Dialer[_0x70a5('0x1a')][_0x70a5('0x7')]=function(_0x124743){var _0x24a089=_0x124743[_0x70a5('0x1a4')]/0x64;var _0x5251e1=_0x124743[_0x70a5('0x1a5')]/(_0x124743['outboundDropCallsDayTimeout']+_0x124743[_0x70a5('0xbb')]);var _0x1aecd7=Math['round'](_0x124743[_0x70a5('0x1a6')]*(_0x124743[_0x70a5('0x1a7')]/0x64));var _0xca0b8=Math['round'](_0x124743[_0x70a5('0x1a6')]*(_0x124743[_0x70a5('0x1a8')]/0x64));var _0x5d0799=_0x124743[_0x70a5('0x130')]+_0x124743[_0x70a5('0x1a9')];var _0x1c2143=Math[_0x70a5('0x1aa')](_0x124743[_0x70a5('0x54')]*_0x124743[_0x70a5('0x58')]*_0x124743[_0x70a5('0x1ab')]*_0x124743[_0x70a5('0x1ac')]);if(_[_0x70a5('0x3b')](_0x124743['startProgressive'])){if(!_['isUndefined'](_0x124743[_0x70a5('0x24')])){_0x124743[_0x70a5('0x24')]=undefined;loggerPredictive[_0x70a5('0x61')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x124743[_0x70a5('0x60')])){loggerPredictive[_0x70a5('0x61')](_0x70a5('0x1ad'),_0x70a5('0x1ae'));clearInterval(_0x124743[_0x70a5('0x60')]);_0x124743[_0x70a5('0x60')]=undefined;}_0x124743[_0x70a5('0x25')]=moment()[_0x70a5('0x40')](_0x70a5('0xc1'));loggerPredictive[_0x70a5('0x45')](_0x124743[_0x70a5('0x42')],_0x70a5('0x1af'),_0x124743[_0x70a5('0x25')]);this[_0x70a5('0xa9')](_0x124743,0x1);}else if(ifInterval(_0x124743[_0x70a5('0x1b0')],_0x124743[_0x70a5('0x25')])){this[_0x70a5('0xa9')](_0x124743,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x124743[_0x70a5('0x25')],_0x124743[_0x70a5('0x42')]);_0x124743[_0x70a5('0x54')]=0x0;_0x124743[_0x70a5('0xc5')]=0x0;}else if(_0x24a089<_0x5251e1&&_0x124743[_0x70a5('0x1b1')]===_0x70a5('0x1b2')){clearPredictiveAttributes(_0x124743);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1b3'),_0x70a5('0x1b4'),_0x5251e1,_0x70a5('0x25'),_0x124743[_0x70a5('0x42')]);}else if(_0x1c2143<_0x124743['predictiveIntervalErlangCallsDroppedCalls']&&_0x124743[_0x70a5('0x1b1')]===_0x70a5('0x1b2')){clearPredictiveAttributes(_0x124743);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1b5'),_0x70a5('0x1b6'),_0x1c2143,_0x70a5('0x1b7'),_0x124743[_0x70a5('0xc5')],_0x70a5('0x25'),_0x124743['name']);}else if(!ifInterval(_0x124743[_0x70a5('0x1b0')],_0x124743[_0x70a5('0x25')])&&_[_0x70a5('0x3b')](_0x124743['startPredictive'])&&!_[_0x70a5('0x3b')](_0x124743['startProgressive'])){_0x124743[_0x70a5('0x24')]=moment()['format'](_0x70a5('0xc1'));loggerPredictive[_0x70a5('0x45')](_0x124743[_0x70a5('0x42')],'started\x20in\x20predictive\x20at',_0x124743[_0x70a5('0x24')]);hopperUtils[_0x70a5('0x1b8')](_0x124743[_0x70a5('0x1b0')])['then'](this[_0x70a5('0x1b9')](_0x124743))[_0x70a5('0x95')](mergeDataErlangB(_0x124743))[_0x70a5('0x95')](this[_0x70a5('0x1ba')](_0x124743))['catch'](loggerCatchPredictive(_0x70a5('0x1bb'),_0x124743));}else if(!ifInterval(_0x124743[_0x70a5('0x1b0')],_0x124743[_0x70a5('0x24')])){_0x124743[_0x70a5('0xc5')]=0x0;_0x124743['startPredictive']=moment()[_0x70a5('0x40')](_0x70a5('0xc1'));loggerPredictive['info'](_0x124743[_0x70a5('0x42')],_0x70a5('0x1bc'),_0x124743[_0x70a5('0x24')]);clearInterval(_0x124743['handlePredictive']);_0x124743['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x124743[_0x70a5('0x1b0')])[_0x70a5('0x95')](this[_0x70a5('0x1b9')](_0x124743))[_0x70a5('0x95')](mergeDataErlangB(_0x124743))[_0x70a5('0x95')](this[_0x70a5('0x1ba')](_0x124743))[_0x70a5('0x9b')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x124743));}else if(_0x124743[_0x70a5('0x1a6')]&&_0x5d0799<_0x124743['predictiveIntervalAvailable']-_0xca0b8){clearPredictiveAttributes(_0x124743);loggerPredictive[_0x70a5('0x45')](_0x124743[_0x70a5('0x42')],_0x70a5('0x1bd'),_0x5d0799,')\x20are\x20less\x20than\x20threshold\x20(',_0x124743['predictiveIntervalAvailable'],'-',_0xca0b8,'=',_0x124743[_0x70a5('0x1a6')]-_0xca0b8,')');}else if(_0x124743[_0x70a5('0x1a6')]&&_0x5d0799>_0x124743[_0x70a5('0x1a6')]+_0x1aecd7){clearPredictiveAttributes(_0x124743);loggerPredictive[_0x70a5('0x45')](_0x124743['name'],_0x70a5('0x1bd'),_0x5d0799,_0x70a5('0x1be'),_0x124743[_0x70a5('0x1a6')],'+',_0x1aecd7,'=',_0x124743[_0x70a5('0x1a6')]+_0x1aecd7,')');}};Dialer[_0x70a5('0x1a')][_0x70a5('0x1b9')]=function(_0x59c8d7){var _0xd4bcc4=this;return function(_0x172915){return new Promise(function(_0x26e118,_0x3f5a81){_['merge'](_0x59c8d7,_0x172915[0x0]);if(checkGetDataPredictive(_0x172915[0x0])){var _0x35b911=_0x59c8d7['predictiveIntervalAvailable']=_0x59c8d7[_0x70a5('0x1a9')]+_0x59c8d7[_0x70a5('0x130')];var _0x6f416c=_0x59c8d7[_0x70a5('0x1b0')]*0x3c;var _0x356a30=_0x172915[0x0][_0x70a5('0x4d')]+_0x172915[0x0][_0x70a5('0x50')];var _0x4debcc=(_0x172915[0x0][_0x70a5('0x48')]+_0x172915[0x0][_0x70a5('0x49')]+_0x172915[0x0][_0x70a5('0x4b')])/_0x172915[0x0][_0x70a5('0x46')];_0x59c8d7[_0x70a5('0x1ab')]=_0x4debcc>0x0?_0x4debcc:0x1;switch(_0x59c8d7['dialPredictiveOptimization']){case _0x70a5('0x1b2'):var _0x3a8aa1=_0x59c8d7[_0x70a5('0x1a4')]/0x64;return _0xd4bcc4[_0x70a5('0x1bf')](_0x35b911,_0x6f416c,_0x356a30,_0x4debcc,_0x3a8aa1)[_0x70a5('0x95')](function(_0x23b800){return _0x26e118(_0x23b800);});case _0x70a5('0x1c0'):var _0xd9446e=_0x59c8d7[_0x70a5('0x1a4')]/0x64;return _0xd4bcc4[_0x70a5('0x1c1')](_0x35b911,_0x6f416c,_0x356a30,_0x4debcc,_0xd9446e)[_0x70a5('0x95')](function(_0x5eecb1){return _0x26e118(_0x5eecb1);});default:return _0x3f5a81(msgResponse(_0x70a5('0x1c2'),'Failure','Unknown\x20Predictive'));}}else{return _0x3f5a81(msgResponse(_0x70a5('0x1c2'),_0x70a5('0x8c'),'check\x20failure'));}});};};Dialer[_0x70a5('0x1a')]['getDataPredictiveOld']=function(_0x395edc){var _0x6810dc=this;return function(_0xeaa9f5){return new Promise(function(_0x1b30da,_0xc4a30){_[_0x70a5('0x5b')](_0x395edc,_0xeaa9f5[0x0]);if(checkGetDataPredictive(_0xeaa9f5[0x0])){loggerPredictive[_0x70a5('0x45')](JSON[_0x70a5('0x6d')](_0xeaa9f5[0x0]));if(_0x395edc[_0x70a5('0x1b1')]===_0x70a5('0x1b2')){return _0x6810dc[_0x70a5('0x145')](_0x395edc['id'])[_0x70a5('0x95')](function(_0x2ab187){var _0x16289b=_0x395edc['loggedIn']-_0x2ab187[0x0]['outboundQueuePauses'];var _0x20a00d=_0x395edc[_0x70a5('0x1b0')]*0x3c;var _0x4fdb8c=_0xeaa9f5[0x0][_0x70a5('0x4d')]+_0xeaa9f5[0x0][_0x70a5('0x50')];var _0x1af25a=(_0xeaa9f5[0x0]['predictiveIntervalAnsweredCalls']+_0xeaa9f5[0x0][_0x70a5('0x49')]+_0xeaa9f5[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xeaa9f5[0x0]['predictiveIntervalTotalCalls'];var _0x1bfeb4=_0x395edc[_0x70a5('0x1a4')]/0x64;_0x395edc[_0x70a5('0x1c3')]=_0x2ab187[0x0][_0x70a5('0x1c4')]||0x0;_0x395edc[_0x70a5('0x1ab')]=_0x1af25a>0x0?_0x1af25a:0x1;return _0x6810dc['abandonmentRate'](_0x16289b,_0x20a00d,_0x4fdb8c,_0x1af25a,_0x1bfeb4);})[_0x70a5('0x95')](function(_0x46e80c){return _0x1b30da(_0x46e80c);})[_0x70a5('0x9b')](function(_0xe8dbdc){return _0xc4a30(msgResponse(_0x70a5('0x1c5'),'Failure',JSON[_0x70a5('0x6d')](_0xe8dbdc)));});}if(_0x395edc[_0x70a5('0x1b1')]==='agentBusyFactor'){return _0x6810dc[_0x70a5('0x145')](_0x395edc['id'])[_0x70a5('0x95')](function(_0x357266){var _0x5dd77c=_0x395edc[_0x70a5('0x1c6')]-_0x357266[0x0][_0x70a5('0x1c4')];var _0x4b3274=_0x395edc[_0x70a5('0x1b0')]*0x3c;var _0x1f13c8=_0xeaa9f5[0x0]['predictiveIntervalAvgTalktime']+_0xeaa9f5[0x0][_0x70a5('0x50')];var _0x13ea15=(_0xeaa9f5[0x0][_0x70a5('0x48')]+_0xeaa9f5[0x0][_0x70a5('0x49')]+_0xeaa9f5[0x0][_0x70a5('0x4b')])/_0xeaa9f5[0x0][_0x70a5('0x46')];var _0x137a69=_0x395edc[_0x70a5('0x1a4')]/0x64;_0x395edc[_0x70a5('0x1c3')]=_0x357266[0x0]['outboundQueuePauses']||0x0;_0x395edc['predictiveIntervalHitRate']=_0x13ea15>0x0?_0x13ea15:0x1;return _0x6810dc[_0x70a5('0x1c1')](_0x5dd77c,_0x4b3274,_0x1f13c8,_0x13ea15,_0x137a69);})[_0x70a5('0x95')](function(_0x2cd9ce){return _0x1b30da(_0x2cd9ce);})[_0x70a5('0x9b')](function(_0x23b47e){return _0xc4a30(msgResponse('[CatchErlangB]',_0x70a5('0x8c'),JSON[_0x70a5('0x6d')](_0x23b47e)));});}}else{return _0xc4a30(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x70a5('0x1a')][_0x70a5('0x1ba')]=function(_0x21fb1e){var _0xe1f711=this;return function(){var _0x969ba6=0x0;var _0x49805e=Math[_0x70a5('0x1aa')](_0x21fb1e['erlangCallToSecond']*0x3e8);if(_0x49805e>0x0){_0x49805e=_0x49805e<0x64?0x64:_0x49805e;loggerPredictive[_0x70a5('0x45')](_0x21fb1e[_0x70a5('0x42')],'one\x20call\x20every:',_0x49805e,_0x70a5('0x1c7'));_0x21fb1e['handlePredictive']=setInterval(function(){_0xe1f711[_0x70a5('0x60')](_0x21fb1e);loggerPredictiveCalls[_0x70a5('0x45')](_0x70a5('0x1c8'),_0x969ba6+=0x1);},_0x49805e);}else{loggerPredictive['info'](_0x21fb1e[_0x70a5('0x42')],_0x70a5('0x1c9'));}};};Dialer[_0x70a5('0x1a')][_0x70a5('0x1ca')]=function(_0x54115e,_0x439eb6){var _0x40961f=this;return function(_0x50c50d){if(_['isEmpty'](_0x50c50d)){if(_[_0x70a5('0xf0')](_0x439eb6[_0x70a5('0x148')])||!_0x439eb6[_0x70a5('0x1cb')]){if(_0x54115e['dialMethod']===_0x70a5('0xac')){_0x54115e[_0x70a5('0x6b')]=_['isUndefined'](_0x54115e[_0x70a5('0x6b')])?!![]:_0x54115e[_0x70a5('0x6b')];var _0x5427ea=uuid['v4']();_0x40961f[_0x70a5('0xe9')][_0x5427ea]=new Action(_0x54115e,_0x439eb6,_0x5427ea);loggerBooked['info']('[booked][checkContactBlack]',_0x5427ea,_0x70a5('0x1cc'),JSON['stringify'](_0x54115e[_0x70a5('0x6b')]),_0x70a5('0x1cd'),_0x54115e[_0x70a5('0x42')]);if(_0x54115e[_0x70a5('0x6b')]){_0x54115e[_0x70a5('0x6b')]=![];_0x40961f['queueBooked'][_0x40961f[_0x70a5('0xe9')][_0x5427ea]['queue']]=[];ami[_0x70a5('0x98')]({'actionid':_0x5427ea,'action':_0x70a5('0x1ce'),'queue':_0x54115e[_0x70a5('0x42')]})['catch'](function(){_0x40961f[_0x70a5('0xb9')](_0x54115e);hopperUtils[_0x70a5('0xd1')]({'active':![],'ContactId':_0x40961f[_0x70a5('0xe9')][_0x5427ea][_0x70a5('0xe5')],'ListId':_0x40961f['actions'][_0x5427ea]['ListId'],'VoiceQueueId':_0x40961f[_0x70a5('0xe9')][_0x5427ea]['VoiceQueueId']||undefined,'CampaignId':_0x40961f[_0x70a5('0xe9')][_0x5427ea][_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1cf')));delete _0x40961f[_0x70a5('0xe9')][_0x5427ea];});}else{loggerBooked['info'](_0x70a5('0x1d0'),JSON['stringify'](_0x54115e[_0x70a5('0x6b')]),_0x70a5('0x1cd'),_0x54115e[_0x70a5('0x42')]);_0x40961f[_0x70a5('0xb9')](_0x54115e);hopperUtils[_0x70a5('0xd1')]({'active':![],'ContactId':_0x40961f['actions'][_0x5427ea][_0x70a5('0xe5')],'ListId':_0x40961f[_0x70a5('0xe9')][_0x5427ea][_0x70a5('0xe6')],'VoiceQueueId':_0x40961f[_0x70a5('0xe9')][_0x5427ea][_0x70a5('0xd4')]||undefined,'CampaignId':_0x40961f[_0x70a5('0xe9')][_0x5427ea][_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1cf')));delete _0x40961f[_0x70a5('0xe9')][_0x5427ea];}}else{return _0x40961f[_0x70a5('0x1d1')](_0x54115e,_0x439eb6);}}else{if(utils[_0x70a5('0x5c')](undefined,_0x439eb6[_0x70a5('0x1d2')])<_0x54115e[_0x70a5('0x1d3')]*0x3c){if(_0x439eb6[_0x70a5('0x13d')]&&!_0x439eb6[_0x70a5('0x13d')][_0x70a5('0x1d4')]){_0x40961f[_0x70a5('0x1e')][_0x70a5('0xf5')](_0x439eb6['id'])[_0x70a5('0xf7')](function(){_0x40961f[_0x70a5('0xb9')](_0x54115e);});}else{hopperUtils[_0x70a5('0x1d5')]({'active':![]},_0x439eb6['id'],0x1)[_0x70a5('0xf7')](function(){_0x40961f['updateOriginated'](_0x54115e);});}}else{_0x54115e[_0x70a5('0x1d6')]+=0x1;_0x40961f[_0x70a5('0xb9')](_0x54115e);if(_0x54115e[_0x70a5('0x1d7')]){hopperUtils[_0x70a5('0xd1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x439eb6['ContactId'],'ListId':_0x439eb6['ListId'],'VoiceQueueId':_0x439eb6[_0x70a5('0xd4')]||undefined,'CampaignId':_0x439eb6[_0x70a5('0xd5')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x70a5('0xda')](createObjHistory(_0x54115e,_0x439eb6,utils['CAMPAIGN_STATUS'][_0x70a5('0x1d8')],0x17,_0x70a5('0x1d9')))[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1da')));}else{_0x40961f[_0x70a5('0x111')](createObjHistory(_0x54115e,_0x439eb6,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x70a5('0x1db'),_0x70a5('0x1dc'));}}}}else{_0x54115e[_0x70a5('0x1dd')]+=0x1;_0x40961f[_0x70a5('0x111')](createObjHistory(_0x54115e,_0x439eb6,utils[_0x70a5('0x67')][_0x70a5('0x1de')],0xd,_0x70a5('0x1df')),_0x70a5('0x1e0'),'[Originate][MoveBlacklist]');throw _0x70a5('0x1e1');}};};Dialer[_0x70a5('0x1a')]['handleIvr']=function(_0x3f8c24){var _0x40e3c0=this;var _0x3f0d7c=_0x3f8c24[_0x70a5('0x1e2')]-_0x3f8c24[_0x70a5('0x77')]-_0x3f8c24[_0x70a5('0x1e3')];emitCampaignSummary(_0x3f8c24);if(_0x3f0d7c>0x0){if(_0x3f0d7c>this[_0x70a5('0x22')]){_0x3f0d7c=this[_0x70a5('0x22')];}_0x3f8c24[_0x70a5('0x1e3')]+=_0x3f0d7c;hopperUtils[_0x70a5('0x1e4')](_0x3f8c24['id'],_0x3f0d7c,_0x3f8c24[_0x70a5('0x1e5')],_0x3f8c24)['then'](function(_0x5226f5){_0x3f8c24['temp']-=_0x3f0d7c;_0x3f8c24[_0x70a5('0x1e3')]=_0x3f8c24[_0x70a5('0x1e3')]>0x0?_0x3f8c24[_0x70a5('0x1e3')]:0x0;if(!utils[_0x70a5('0x1e6')](_0x5226f5)){_0x3f8c24[_0x70a5('0x65')]=utils[_0x70a5('0x67')]['NO_AVAILABLE_CONTACTS'];logger[_0x70a5('0x45')]('[getContactCampaign2][Empty]'+_0x3f8c24[_0x70a5('0x42')]);}else{_0x3f8c24['originated']+=_0x5226f5[_0x70a5('0x13a')];_0x3f8c24[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x1e7')];for(var _0x5738a6=0x0;_0x5738a6<_0x5226f5['length'];_0x5738a6+=0x1){_0x3f8c24[_0x70a5('0x1e8')]+=0x1;if(_[_0x70a5('0xf0')](_0x5226f5[_0x5738a6])||_['isNil'](_0x5226f5[_0x5738a6][_0x70a5('0x164')])||_[_0x70a5('0xf0')](_0x5226f5[_0x5738a6][_0x70a5('0x14d')])){_0x40e3c0[_0x70a5('0x146')]('[actionOriginate]\x20',_0x3f8c24,_0x5226f5[_0x5738a6]);}else{hopperUtils[_0x70a5('0x1e9')](_[_0x70a5('0x6e')](_0x5226f5[_0x5738a6],['CampaignId',_0x70a5('0x14d')]))[_0x70a5('0x95')](_0x40e3c0['checkContactBlack'](_0x3f8c24,_0x5226f5[_0x5738a6]))[_0x70a5('0x9b')](_0x40e3c0['loggerHandler'](_0x70a5('0x1ea'),_0x3f8c24));}}}})['catch'](loggerGetContactDialer(_0x70a5('0x1eb'),_0x3f8c24,_0x3f0d7c));}};Dialer[_0x70a5('0x1a')][_0x70a5('0xa9')]=function(_0x4b4c1f,_0x5f30a5){var _0x18f6d2=this;var _0x4ea08a=[];if(_0x5f30a5<0x1||_0x4b4c1f[_0x70a5('0xa7')]===_0x70a5('0xac')){_0x5f30a5=0x1;}var _0x5d772b=Math[_0x70a5('0x1aa')](_0x4b4c1f['available']*_0x5f30a5)-_0x4b4c1f['originated']-_0x4b4c1f['temp'];if(_0x4b4c1f['dialLimitQueue']>0x0){var _0x5b1ca0=_0x4b4c1f[_0x70a5('0x1ec')]-_0x4b4c1f['originated']-_0x4b4c1f[_0x70a5('0x1a9')]-_0x4b4c1f['temp']-_0x4b4c1f[_0x70a5('0x132')];if(_0x5d772b>_0x5b1ca0){_0x5d772b=_0x5b1ca0;}}if(_0x5d772b>0x0){if(_0x4b4c1f[_0x70a5('0xa7')]==='booked'){_0x5d772b=0x1;}if(_0x5d772b>this[_0x70a5('0x22')]){_0x5d772b=this[_0x70a5('0x22')];}_0x4b4c1f[_0x70a5('0x1e3')]+=_0x5d772b;for(var _0xfc721d in this[_0x70a5('0x21')]){if(typeof this[_0x70a5('0x21')][_0xfc721d]!==_0x70a5('0xa2')){if(this[_0x70a5('0x21')][_0xfc721d][_0x70a5('0xc6')]===_0x70a5('0x1ed')&&this[_0x70a5('0x21')][_0xfc721d][_0x70a5('0x81')]===_0x70a5('0x82')){_0x4ea08a['push'](this[_0x70a5('0x21')][_0xfc721d]['id']);}}}hopperUtils[_0x70a5('0x1ee')](_0x4b4c1f,_0x4ea08a,_0x5d772b)[_0x70a5('0x95')](function(_0x5dfa79){_0x4b4c1f[_0x70a5('0x1e3')]-=_0x5d772b;_0x4b4c1f[_0x70a5('0x1e3')]=_0x4b4c1f[_0x70a5('0x1e3')]>0x0?_0x4b4c1f[_0x70a5('0x1e3')]:0x0;if(!utils[_0x70a5('0x1e6')](_0x5dfa79)){hopperUtils[_0x70a5('0x1ef')](_0x4b4c1f)[_0x70a5('0x95')](sendMessageReschedule(_0x4b4c1f))[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1f0')));}else{_0x4b4c1f['originated']+=_0x5dfa79[_0x70a5('0x13a')];_0x4b4c1f[_0x70a5('0x65')]=_0x4b4c1f['dialMethod']===_0x70a5('0xac')?utils[_0x70a5('0x67')][_0x70a5('0x133')]:utils[_0x70a5('0x67')][_0x70a5('0x1e7')];for(var _0x413798=0x0;_0x413798<_0x5dfa79[_0x70a5('0x13a')];_0x413798+=0x1){if(_[_0x70a5('0xf0')](_0x5dfa79[_0x413798])||_['isNil'](_0x5dfa79[_0x413798][_0x70a5('0x164')])||_[_0x70a5('0xf0')](_0x5dfa79[_0x413798][_0x70a5('0x14d')])){_0x18f6d2[_0x70a5('0x146')](_0x70a5('0x1f1'),_0x4b4c1f,_0x5dfa79[_0x413798]);}else{hopperUtils[_0x70a5('0x1f2')](_[_0x70a5('0x6e')](_0x5dfa79[_0x413798],[_0x70a5('0xd4'),_0x70a5('0x14d')]))[_0x70a5('0x95')](_0x18f6d2[_0x70a5('0x1ca')](_0x4b4c1f,_0x5dfa79[_0x413798]))[_0x70a5('0x9b')](_0x18f6d2[_0x70a5('0x1f3')](_0x70a5('0x1f1'),_0x4b4c1f));}}}})['catch'](loggerGetContactDialer(_0x70a5('0x1f4'),_0x4b4c1f,_0x5d772b));}};Dialer[_0x70a5('0x1a')][_0x70a5('0x60')]=function(_0x2092fc){if(_0x2092fc[_0x70a5('0x1ec')]>0x0){var _0x52b39d=_0x2092fc[_0x70a5('0x1ec')]-_0x2092fc[_0x70a5('0x77')]-_0x2092fc[_0x70a5('0x1a9')];if(_0x52b39d>0x0){this[_0x70a5('0x1f5')](_0x2092fc);}else{loggerPredictiveCalls[_0x70a5('0x45')](_0x70a5('0x1f6'));}}else{this[_0x70a5('0x1f5')](_0x2092fc);}};Dialer['prototype'][_0x70a5('0x1f5')]=function(_0x5de46a){var _0x4e7bfe=this;var _0x374ebf=[];_0x5de46a[_0x70a5('0x77')]+=0x1;for(var _0x6cd3ad in this[_0x70a5('0x21')]){if(typeof this['agents'][_0x6cd3ad]!==_0x70a5('0xa2')){if(this['agents'][_0x6cd3ad][_0x70a5('0xc6')]===_0x70a5('0x1ed')&&this[_0x70a5('0x21')][_0x6cd3ad][_0x70a5('0x81')]===_0x70a5('0x82')){_0x374ebf[_0x70a5('0x93')](this['agents'][_0x6cd3ad]['id']);}}}return this[_0x70a5('0x1ee')](_0x5de46a['id'],_0x374ebf,0x1,_0x5de46a[_0x70a5('0x1e5')],_0x5de46a)[_0x70a5('0x95')](function(_0x18687f){if(!utils[_0x70a5('0x1e6')](_0x18687f)){utils[_0x70a5('0x63')](_0x5de46a,0x1,0x0);return hopperUtils[_0x70a5('0x1ef')](_0x5de46a)['then'](sendMessageReschedule(_0x5de46a))[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1f0')));}else{_0x5de46a[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x1e7')];if(_[_0x70a5('0xf0')](_0x18687f[0x0])||_['isNil'](_0x18687f[0x0][_0x70a5('0x164')])||_['isNil'](_0x18687f[0x0][_0x70a5('0x14d')])){_0x4e7bfe[_0x70a5('0x146')]('[actionOriginate]\x20',_0x5de46a,_0x18687f[0x0]);}else{return hopperUtils[_0x70a5('0x1f2')](_[_0x70a5('0x6e')](_0x18687f[0x0],[_0x70a5('0xd4'),'phone']))[_0x70a5('0x95')](_0x4e7bfe['checkContactBlack'](_0x5de46a,_0x18687f[0x0]))[_0x70a5('0x9b')](_0x4e7bfe[_0x70a5('0x1f3')](_0x70a5('0x1f7'),_0x5de46a));}}})[_0x70a5('0x9b')](loggerGetContactDialer(_0x70a5('0x1f8'),_0x5de46a,0x1));};Dialer['prototype'][_0x70a5('0x1bf')]=function(_0x211a18,_0x3e80a1,_0x5bac1a,_0x3aab59,_0x5a8572,_0x10a6b1){loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1f9'));loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fa'),_0x211a18);loggerPredictive['info'](_0x70a5('0x1fb'),_0x3e80a1);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fc'),_0x5bac1a);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fd'),_0x3aab59);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fe'),_0x5a8572);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4e'));return new Promise(function(_0x16926f,_0x41114e){if(_0x211a18<=0x0||isNaN(_0x211a18)){return _0x41114e(msgResponse(_0x70a5('0x1ff'),_0x70a5('0x7c'),_0x70a5('0x200')+_0x211a18));}if(_0x5bac1a<=0x0||isNaN(_0x5bac1a)){return _0x41114e(msgResponse('[abandonmentRate]','Error',_0x70a5('0x201')+_0x5bac1a));}if(_0x3aab59<=0x0||isNaN(_0x3aab59)){return _0x41114e(msgResponse(_0x70a5('0x1ff'),'Error',_0x70a5('0x202')+_0x3aab59));}if(_0x3e80a1<=0x0||isNaN(_0x3e80a1)){return _0x41114e(msgResponse(_0x70a5('0x1ff'),_0x70a5('0x7c'),_0x70a5('0x203')+_0x3e80a1));}if(_0x5a8572<=0x0||isNaN(_0x5a8572)){return _0x41114e(msgResponse(_0x70a5('0x1ff'),_0x70a5('0x7c'),'Amax\x20=\x20'+_0x5a8572));}_0x10a6b1=_0x10a6b1||0x0;var _0x1ac017=0x1/_0x5bac1a;var _0x4c7e5d=0x0;var _0x2b0685=0x0;var _0x4aa6b5=0x0;var _0x1bade2=0x0;for(var _0x2323ef=0x0;_0x4aa6b5<_0x5a8572;_0x2323ef+=0x1){_0x2b0685=_0x2323ef/_0x3e80a1;_0x4c7e5d=(_0x3aab59*_0x2b0685+_0x10a6b1)/_0x1ac017;_0x4aa6b5=utils['erlangb'](_0x4c7e5d,_0x211a18);_0x1bade2=_0x4c7e5d/_0x211a18*(0x1-utils[_0x70a5('0x204')](_0x4c7e5d,_0x211a18));}return _0x16926f({'erlangCalls':_0x2323ef,'erlangCallToSecond':_0x3e80a1/_0x2323ef,'erlangAbandonmentRate':_0x4aa6b5,'erlangBusyFactor':_0x1bade2});});};Dialer['prototype'][_0x70a5('0x1c1')]=function(_0x58c0bf,_0xb0dcd1,_0x49d676,_0x3cc5eb,_0x42b400,_0x37ed03){loggerPredictive[_0x70a5('0x45')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fa'),_0x58c0bf);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fb'),_0xb0dcd1);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fc'),_0x49d676);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fd'),_0x3cc5eb);loggerPredictive['info'](_0x70a5('0x205'),_0x42b400);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4e'));return new Promise(function(_0x32a659,_0x394093){if(_0x58c0bf<=0x0||isNaN(_0x58c0bf)){return _0x394093(msgResponse(_0x70a5('0x206'),'Error',_0x70a5('0x200')+_0x58c0bf));}if(_0x49d676<=0x0||isNaN(_0x49d676)){return _0x394093(msgResponse(_0x70a5('0x206'),_0x70a5('0x7c'),_0x70a5('0x201')+_0x49d676));}if(_0x3cc5eb<=0x0||isNaN(_0x3cc5eb)){return _0x394093(msgResponse(_0x70a5('0x206'),_0x70a5('0x7c'),_0x70a5('0x202')+_0x3cc5eb));}if(_0xb0dcd1<=0x0||isNaN(_0xb0dcd1)){return _0x394093(msgResponse(_0x70a5('0x206'),'Error','interval\x20=\x20'+_0xb0dcd1));}if(_0x42b400<=0x0||isNaN(_0x42b400)){return _0x394093(msgResponse('[busyFactor]',_0x70a5('0x7c'),_0x70a5('0x207')+_0x42b400));}_0x37ed03=_0x37ed03||0x0;var _0x37cd59=0x1/_0x49d676;var _0x538de3=0x0;var _0x44ded7=0x0;var _0x5e245e=0x0;var _0x490443=0x0;for(var _0x4c9fa2=0x0;_0x490443<_0x42b400;_0x4c9fa2+=0x1){_0x44ded7=_0x4c9fa2/_0xb0dcd1;_0x538de3=(_0x3cc5eb*_0x44ded7+_0x37ed03)/_0x37cd59;_0x5e245e=utils[_0x70a5('0x204')](_0x538de3,_0x58c0bf);_0x490443=_0x538de3/_0x58c0bf*(0x1-utils[_0x70a5('0x204')](_0x538de3,_0x58c0bf));}return _0x32a659({'erlangCalls':_0x4c9fa2,'erlangCallToSecond':_0xb0dcd1/_0x4c9fa2,'erlangAbandonmentRate':_0x5e245e,'erlangBusyFactor':_0x490443});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index d3dd14d..c113dff 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bd3=['getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype'];(function(_0x1b8b95,_0x3ea343){var _0x3657ae=function(_0x3703e1){while(--_0x3703e1){_0x1b8b95['push'](_0x1b8b95['shift']());}};_0x3657ae(++_0x3ea343);}(_0x3bd3,0x119));var _0x33bd=function(_0x5c1cdc,_0x322014){_0x5c1cdc=_0x5c1cdc-0x0;var _0x2e8317=_0x3bd3[_0x5c1cdc];return _0x2e8317;};'use strict';var util=require(_0x33bd('0x0'));var _=require(_0x33bd('0x1'));var moment=require(_0x33bd('0x2'));function checkNameSurname(_0x21d2b4,_0x33a951,_0x373a60){var _0x491262='';if(!_[_0x33bd('0x3')](_0x33a951)&&_0x33bd('0x4')===typeof _0x33a951){_0x491262+=_0x33a951;}if(!_[_0x33bd('0x3')](_0x373a60)&&_0x33bd('0x4')===typeof _0x373a60){_0x491262+='\x20'+_0x373a60;}if(_0x491262!==''){return _0x491262;}return _0x21d2b4;}function Action(_0x124019,_0x2e6572,_0x527571){this[_0x33bd('0x5')]=_0x124019;this[_0x33bd('0x6')]=_0x527571||undefined;this[_0x33bd('0x7')]=checkNameSurname(_0x2e6572[_0x33bd('0x8')]['phone'],_0x2e6572[_0x33bd('0x8')][_0x33bd('0x9')],_0x2e6572[_0x33bd('0x8')][_0x33bd('0xa')]);this['number']=_0x2e6572[_0x33bd('0xb')];this[_0x33bd('0xc')]=_0x124019[_0x33bd('0x7')];this[_0x33bd('0xd')]=_0x2e6572[_0x33bd('0xd')]||![];this[_0x33bd('0xe')]=_0x124019['type'];this[_0x33bd('0xf')]=_0x124019['dialQueueTimeout']||0x3;this['scheduledat']=_0x2e6572[_0x33bd('0x10')];this['countbusyretry']=_0x2e6572[_0x33bd('0x11')];this['countcongestionretry']=_0x2e6572[_0x33bd('0x12')];this[_0x33bd('0x13')]=_0x2e6572['countnoanswerretry'];this[_0x33bd('0x14')]=_0x2e6572[_0x33bd('0x14')];this['countdropretry']=_0x2e6572[_0x33bd('0x15')];this[_0x33bd('0x16')]=_0x2e6572[_0x33bd('0x16')];this[_0x33bd('0x17')]=_0x2e6572[_0x33bd('0x17')];this[_0x33bd('0x18')]=_0x2e6572['countagentrejectretry'];this[_0x33bd('0x19')]=_0x2e6572[_0x33bd('0x19')];this[_0x33bd('0x1a')]=_0x2e6572['ListId'];this[_0x33bd('0x1b')]=_0x2e6572[_0x33bd('0x1b')];this['VoiceQueueId']=_0x2e6572[_0x33bd('0x1c')];this[_0x33bd('0x1d')]=_0x2e6572['CampaignId'];this['idHopper']=_0x2e6572['id'];this[_0x33bd('0x1e')]=_0x2e6572[_0x33bd('0x8')][_0x33bd('0x9')]||'';this[_0x33bd('0x1f')]=moment()[_0x33bd('0x20')](_0x33bd('0x21'));this[_0x33bd('0x22')]=_0x2e6572[_0x33bd('0x22')];this[_0x33bd('0x23')]=_0x2e6572[_0x33bd('0x23')];this[_0x33bd('0x24')]=_0x2e6572['callbackat'];this['recallme']=_0x2e6572[_0x33bd('0x25')];this[_0x33bd('0x26')]='';this[_0x33bd('0x27')]='';}Action[_0x33bd('0x28')][_0x33bd('0x29')]=function(){return util[_0x33bd('0x20')](_0x33bd('0x2a'),this[_0x33bd('0x7')],this[_0x33bd('0x5')][_0x33bd('0x2b')]>0x0?this['number'][_0x33bd('0x2c')](this[_0x33bd('0x5')][_0x33bd('0x2b')]):this['number']);};Action[_0x33bd('0x28')]['getQueue']=function(){return this['queue'];};module[_0x33bd('0x2d')]=Action; \ No newline at end of file +var _0xb691=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb691,0x192));var _0x1b69=function(_0x21233e,_0x2d39c1){_0x21233e=_0x21233e-0x0;var _0x3752c9=_0xb691[_0x21233e];return _0x3752c9;};'use strict';var util=require(_0x1b69('0x0'));var _=require(_0x1b69('0x1'));var moment=require('moment');function checkNameSurname(_0x501e9c,_0x301dbf,_0x1acb56){var _0x25943f='';if(!_[_0x1b69('0x2')](_0x301dbf)&&_0x1b69('0x3')===typeof _0x301dbf){_0x25943f+=_0x301dbf;}if(!_[_0x1b69('0x2')](_0x1acb56)&&_0x1b69('0x3')===typeof _0x1acb56){_0x25943f+='\x20'+_0x1acb56;}if(_0x25943f!==''){return _0x25943f;}return _0x501e9c;}function Action(_0xc4ab38,_0x24a3a0,_0x53b120){this[_0x1b69('0x4')]=_0xc4ab38;this[_0x1b69('0x5')]=_0x53b120||undefined;this[_0x1b69('0x6')]=checkNameSurname(_0x24a3a0[_0x1b69('0x7')][_0x1b69('0x8')],_0x24a3a0[_0x1b69('0x7')][_0x1b69('0x9')],_0x24a3a0[_0x1b69('0x7')][_0x1b69('0xa')]);this['number']=_0x24a3a0['phone'];this[_0x1b69('0xb')]=_0xc4ab38[_0x1b69('0x6')];this['active']=_0x24a3a0[_0x1b69('0xc')]||![];this[_0x1b69('0xd')]=_0xc4ab38[_0x1b69('0xd')];this[_0x1b69('0xe')]=_0xc4ab38[_0x1b69('0xe')]||0x3;this[_0x1b69('0xf')]=_0x24a3a0['scheduledat'];this['countbusyretry']=_0x24a3a0[_0x1b69('0x10')];this[_0x1b69('0x11')]=_0x24a3a0[_0x1b69('0x11')];this['countnoanswerretry']=_0x24a3a0[_0x1b69('0x12')];this[_0x1b69('0x13')]=_0x24a3a0[_0x1b69('0x13')];this[_0x1b69('0x14')]=_0x24a3a0[_0x1b69('0x14')];this[_0x1b69('0x15')]=_0x24a3a0[_0x1b69('0x15')];this[_0x1b69('0x16')]=_0x24a3a0[_0x1b69('0x16')];this[_0x1b69('0x17')]=_0x24a3a0[_0x1b69('0x17')];this['ContactId']=_0x24a3a0[_0x1b69('0x18')];this[_0x1b69('0x19')]=_0x24a3a0[_0x1b69('0x19')];this[_0x1b69('0x1a')]=_0x24a3a0['UserId'];this['VoiceQueueId']=_0x24a3a0[_0x1b69('0x1b')];this[_0x1b69('0x1c')]=_0x24a3a0[_0x1b69('0x1c')];this['idHopper']=_0x24a3a0['id'];this[_0x1b69('0x1d')]=_0x24a3a0[_0x1b69('0x7')][_0x1b69('0x9')]||'';this['starttime']=moment()['format'](_0x1b69('0x1e'));this['callback']=_0x24a3a0[_0x1b69('0x1f')];this[_0x1b69('0x20')]=_0x24a3a0[_0x1b69('0x20')];this['callbackat']=_0x24a3a0[_0x1b69('0x21')];this[_0x1b69('0x22')]=_0x24a3a0['recallme'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x1b69('0x23')][_0x1b69('0x24')]=function(){return util['format'](_0x1b69('0x25'),this[_0x1b69('0x6')],this[_0x1b69('0x4')][_0x1b69('0x26')]>0x0?this[_0x1b69('0x27')]['substring'](this[_0x1b69('0x4')]['dialCutDigit']):this[_0x1b69('0x27')]);};Action['prototype'][_0x1b69('0x28')]=function(){return this[_0x1b69('0xb')];};module[_0x1b69('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index ce73301..d74105d 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x453d=['calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','state','statedesc','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x453d,0x158));var _0xd453=function(_0x592fd7,_0x1fc443){_0x592fd7=_0x592fd7-0x0;var _0x3a6933=_0x453d[_0x592fd7];return _0x3a6933;};'use strict';var moment=require(_0xd453('0x0'));var utils=require('../utils');function AgentComplete(_0x3b54dc,_0x353d30){this[_0xd453('0x1')]=0x4;this[_0xd453('0x2')]='Answer';this[_0xd453('0x3')]=_0x3b54dc[_0xd453('0x3')];this['type']=_0x3b54dc['type'];this[_0xd453('0x4')]=_0x3b54dc[_0xd453('0x5')]===_0xd453('0x6')?'queue':_0x3b54dc[_0xd453('0x5')];this[_0xd453('0x7')]=_0x3b54dc[_0xd453('0x7')];this[_0xd453('0x8')]=_0x3b54dc['countcongestionretry'];this['countnoanswerretry']=_0x3b54dc['countnoanswerretry'];this[_0xd453('0x9')]=_0x3b54dc[_0xd453('0x7')]+_0x3b54dc[_0xd453('0x8')]+_0x3b54dc['countnoanswerretry']+_0x3b54dc[_0xd453('0xa')]+_0x3b54dc[_0xd453('0xb')]+_0x3b54dc['countabandonedretry']+_0x3b54dc[_0xd453('0xc')]+_0x3b54dc[_0xd453('0xd')];this['countnosuchnumberretry']=_0x3b54dc['countnosuchnumberretry'];this[_0xd453('0xb')]=_0x3b54dc[_0xd453('0xb')];this[_0xd453('0xe')]=_0x3b54dc[_0xd453('0xe')];this[_0xd453('0xc')]=_0x3b54dc['countmachineretry'];this[_0xd453('0xd')]=_0x3b54dc[_0xd453('0xd')];this['uniqueid']=_0x353d30[_0xd453('0xf')];this[_0xd453('0x10')]=_0x3b54dc[_0xd453('0x11')];this[_0xd453('0x12')]=_0x3b54dc[_0xd453('0x13')];this[_0xd453('0x14')]=_0x3b54dc[_0xd453('0x14')];this[_0xd453('0x15')]=_0x3b54dc['responsetime'];this[_0xd453('0x16')]=_0x3b54dc[_0xd453('0x16')];this[_0xd453('0x17')]=moment()['format'](_0xd453('0x18'));this[_0xd453('0x19')]=utils[_0xd453('0x1a')](_0x3b54dc[_0xd453('0x15')],_0x3b54dc['starttime']);this[_0xd453('0x1b')]=utils[_0xd453('0x1a')](_0x3b54dc['answertime'],_0x3b54dc[_0xd453('0x15')]);this[_0xd453('0x1c')]=utils[_0xd453('0x1a')](this[_0xd453('0x17')],_0x3b54dc[_0xd453('0x16')]);this[_0xd453('0x1d')]=_0x353d30[_0xd453('0x1d')];this[_0xd453('0x1e')]=_0x353d30[_0xd453('0x1e')];this['reason']=_0x353d30[_0xd453('0x1f')];this['callback']=_0x3b54dc[_0xd453('0x20')];this['callbackuniqueid']=_0x3b54dc[_0xd453('0x21')];this[_0xd453('0x22')]=_0x3b54dc[_0xd453('0x22')];this[_0xd453('0x23')]=_0x3b54dc[_0xd453('0x23')];this['ContactId']=_0x3b54dc[_0xd453('0x24')];this[_0xd453('0x25')]=_0x3b54dc[_0xd453('0x25')];this[_0xd453('0x26')]=_0x3b54dc['UserId'];this['VoiceQueueId']=_0x3b54dc[_0xd453('0x27')];this[_0xd453('0x28')]=_0x3b54dc[_0xd453('0x28')];this[_0xd453('0x29')]=_0x3b54dc[_0xd453('0x29')]||'';this[_0xd453('0x2a')]=_0x3b54dc[_0xd453('0x2a')]||'';this['agiafterat']=_0x3b54dc[_0xd453('0x2b')];}module[_0xd453('0x2c')]=AgentComplete; \ No newline at end of file +var _0x1637=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','holdtime','talktime','membername','callback','callbackat'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x1637,0x198));var _0x7163=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x1637[_0x47fd36];return _0x21a0fc;};'use strict';var moment=require(_0x7163('0x0'));var utils=require(_0x7163('0x1'));function AgentComplete(_0x43ea67,_0x46aac3){this[_0x7163('0x2')]=0x4;this[_0x7163('0x3')]=_0x7163('0x4');this[_0x7163('0x5')]=_0x43ea67[_0x7163('0x5')];this[_0x7163('0x6')]=_0x43ea67[_0x7163('0x6')];this['campaigntype']=_0x43ea67[_0x7163('0x6')]===_0x7163('0x7')?_0x7163('0x8'):_0x43ea67['type'];this[_0x7163('0x9')]=_0x43ea67[_0x7163('0x9')];this[_0x7163('0xa')]=_0x43ea67[_0x7163('0xa')];this[_0x7163('0xb')]=_0x43ea67[_0x7163('0xb')];this['countglobal']=_0x43ea67[_0x7163('0x9')]+_0x43ea67[_0x7163('0xa')]+_0x43ea67[_0x7163('0xb')]+_0x43ea67[_0x7163('0xc')]+_0x43ea67[_0x7163('0xd')]+_0x43ea67[_0x7163('0xe')]+_0x43ea67[_0x7163('0xf')]+_0x43ea67[_0x7163('0x10')];this[_0x7163('0xc')]=_0x43ea67[_0x7163('0xc')];this['countdropretry']=_0x43ea67[_0x7163('0xd')];this[_0x7163('0xe')]=_0x43ea67[_0x7163('0xe')];this['countmachineretry']=_0x43ea67[_0x7163('0xf')];this[_0x7163('0x10')]=_0x43ea67[_0x7163('0x10')];this[_0x7163('0x11')]=_0x46aac3['uniqueid'];this['calleridname']=_0x43ea67[_0x7163('0x12')];this[_0x7163('0x13')]=_0x43ea67['number'];this[_0x7163('0x14')]=_0x43ea67[_0x7163('0x14')];this[_0x7163('0x15')]=_0x43ea67[_0x7163('0x15')];this['answertime']=_0x43ea67[_0x7163('0x16')];this[_0x7163('0x17')]=moment()[_0x7163('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7163('0x19')]=utils[_0x7163('0x1a')](_0x43ea67['responsetime'],_0x43ea67[_0x7163('0x14')]);this[_0x7163('0x1b')]=utils[_0x7163('0x1a')](_0x43ea67[_0x7163('0x16')],_0x43ea67[_0x7163('0x15')]);this[_0x7163('0x1c')]=utils[_0x7163('0x1a')](this['endtime'],_0x43ea67[_0x7163('0x16')]);this['queue']=_0x46aac3['queue'];this[_0x7163('0x1d')]=_0x46aac3['membername'];this['reason']=_0x46aac3['reason'];this[_0x7163('0x1e')]=_0x43ea67[_0x7163('0x1e')];this['callbackuniqueid']=_0x43ea67['callbackuniqueid'];this[_0x7163('0x1f')]=_0x43ea67[_0x7163('0x1f')];this['recallme']=_0x43ea67['recallme'];this[_0x7163('0x20')]=_0x43ea67[_0x7163('0x20')];this[_0x7163('0x21')]=_0x43ea67['ListId'];this[_0x7163('0x22')]=_0x43ea67[_0x7163('0x22')];this[_0x7163('0x23')]=_0x43ea67[_0x7163('0x23')];this[_0x7163('0x24')]=_0x43ea67[_0x7163('0x24')];this['originatecalleridnum']=_0x43ea67['originatecalleridnum']||'';this[_0x7163('0x25')]=_0x43ea67[_0x7163('0x25')]||'';this['agiafterat']=_0x43ea67[_0x7163('0x26')];}module[_0x7163('0x27')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index a997af4..af212c7 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19de=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','outbound','queue'];(function(_0x4ebcdd,_0xe7253d){var _0x4e6f65=function(_0xad6a13){while(--_0xad6a13){_0x4ebcdd['push'](_0x4ebcdd['shift']());}};_0x4e6f65(++_0xe7253d);}(_0x19de,0x1a8));var _0xe19d=function(_0x2a0978,_0x233a96){_0x2a0978=_0x2a0978-0x0;var _0x13f78d=_0x19de[_0x2a0978];return _0x13f78d;};'use strict';function Final(_0x3117e2){this[_0xe19d('0x0')]=_0x3117e2[_0xe19d('0x0')];this[_0xe19d('0x1')]=_0x3117e2[_0xe19d('0x1')];this[_0xe19d('0x2')]=_0x3117e2[_0xe19d('0x2')];this['campaigntype']=_0x3117e2[_0xe19d('0x2')]===_0xe19d('0x3')?_0xe19d('0x4'):_0x3117e2[_0xe19d('0x2')];this[_0xe19d('0x5')]=_0x3117e2['countbusyretry'];this[_0xe19d('0x6')]=_0x3117e2[_0xe19d('0x6')];this[_0xe19d('0x7')]=_0x3117e2[_0xe19d('0x7')];this[_0xe19d('0x8')]=_0x3117e2[_0xe19d('0x5')]+_0x3117e2[_0xe19d('0x6')]+_0x3117e2[_0xe19d('0x7')]+_0x3117e2[_0xe19d('0x9')]+_0x3117e2[_0xe19d('0xa')]+_0x3117e2[_0xe19d('0xb')]+_0x3117e2[_0xe19d('0xc')]+_0x3117e2[_0xe19d('0xd')];this[_0xe19d('0x9')]=_0x3117e2[_0xe19d('0x9')];this[_0xe19d('0xa')]=_0x3117e2[_0xe19d('0xa')];this[_0xe19d('0xb')]=_0x3117e2[_0xe19d('0xb')];this[_0xe19d('0xc')]=_0x3117e2[_0xe19d('0xc')];this['countagentrejectretry']=_0x3117e2[_0xe19d('0xd')];this[_0xe19d('0x4')]=_0x3117e2['queue'];this[_0xe19d('0xe')]=_0x3117e2[_0xe19d('0xe')];this[_0xe19d('0xf')]=_0x3117e2['calleridnum'];this[_0xe19d('0x10')]=_0x3117e2[_0xe19d('0x10')];this[_0xe19d('0x11')]=_0x3117e2['responsetime'];this[_0xe19d('0x12')]=_0x3117e2[_0xe19d('0x11')];this[_0xe19d('0x13')]=_0x3117e2[_0xe19d('0x13')]||0x0;this[_0xe19d('0x14')]=_0x3117e2[_0xe19d('0x14')]||0x0;this[_0xe19d('0x15')]=_0x3117e2['talktime']||0x0;this[_0xe19d('0x16')]=_0x3117e2['callback'];this[_0xe19d('0x17')]=_0x3117e2['callbackuniqueid'];this['callbackat']=_0x3117e2['callbackat'];this[_0xe19d('0x18')]=_0x3117e2[_0xe19d('0x18')];this[_0xe19d('0x19')]=_0x3117e2[_0xe19d('0x19')];this[_0xe19d('0x1a')]=_0x3117e2[_0xe19d('0x1a')];this[_0xe19d('0x1b')]=_0x3117e2['UserId'];this[_0xe19d('0x1c')]=_0x3117e2[_0xe19d('0x1c')];this[_0xe19d('0x1d')]=_0x3117e2[_0xe19d('0x1d')];this['originatecalleridnum']=_0x3117e2['originatecalleridnum']||'';this[_0xe19d('0x1e')]=_0x3117e2[_0xe19d('0x1e')]||'';this[_0xe19d('0x1f')]=_0x3117e2[_0xe19d('0x1f')];this[_0xe19d('0x20')]=_0x3117e2[_0xe19d('0x20')];}module['exports']=Final; \ No newline at end of file +var _0xb0cb=['scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid'];(function(_0x34b5ca,_0x594010){var _0x2d72c0=function(_0x4ae1d3){while(--_0x4ae1d3){_0x34b5ca['push'](_0x34b5ca['shift']());}};_0x2d72c0(++_0x594010);}(_0xb0cb,0x102));var _0xbb0c=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xb0cb[_0x22b68a];return _0x1ac67a;};'use strict';function Final(_0x4711ce){this[_0xbb0c('0x0')]=_0x4711ce[_0xbb0c('0x0')];this[_0xbb0c('0x1')]=_0x4711ce[_0xbb0c('0x1')];this[_0xbb0c('0x2')]=_0x4711ce[_0xbb0c('0x2')];this[_0xbb0c('0x3')]=_0x4711ce[_0xbb0c('0x2')]===_0xbb0c('0x4')?'queue':_0x4711ce[_0xbb0c('0x2')];this[_0xbb0c('0x5')]=_0x4711ce[_0xbb0c('0x5')];this[_0xbb0c('0x6')]=_0x4711ce[_0xbb0c('0x6')];this[_0xbb0c('0x7')]=_0x4711ce[_0xbb0c('0x7')];this[_0xbb0c('0x8')]=_0x4711ce[_0xbb0c('0x5')]+_0x4711ce[_0xbb0c('0x6')]+_0x4711ce['countnoanswerretry']+_0x4711ce[_0xbb0c('0x9')]+_0x4711ce[_0xbb0c('0xa')]+_0x4711ce['countabandonedretry']+_0x4711ce[_0xbb0c('0xb')]+_0x4711ce[_0xbb0c('0xc')];this[_0xbb0c('0x9')]=_0x4711ce[_0xbb0c('0x9')];this[_0xbb0c('0xa')]=_0x4711ce[_0xbb0c('0xa')];this[_0xbb0c('0xd')]=_0x4711ce[_0xbb0c('0xd')];this[_0xbb0c('0xb')]=_0x4711ce[_0xbb0c('0xb')];this[_0xbb0c('0xc')]=_0x4711ce[_0xbb0c('0xc')];this['queue']=_0x4711ce[_0xbb0c('0xe')];this[_0xbb0c('0xf')]=_0x4711ce[_0xbb0c('0xf')];this[_0xbb0c('0x10')]=_0x4711ce['calleridnum'];this['starttime']=_0x4711ce[_0xbb0c('0x11')];this[_0xbb0c('0x12')]=_0x4711ce[_0xbb0c('0x12')];this[_0xbb0c('0x13')]=_0x4711ce[_0xbb0c('0x12')];this['ringtime']=_0x4711ce[_0xbb0c('0x14')]||0x0;this[_0xbb0c('0x15')]=_0x4711ce[_0xbb0c('0x15')]||0x0;this[_0xbb0c('0x16')]=_0x4711ce[_0xbb0c('0x16')]||0x0;this[_0xbb0c('0x17')]=_0x4711ce[_0xbb0c('0x17')];this[_0xbb0c('0x18')]=_0x4711ce[_0xbb0c('0x18')];this['callbackat']=_0x4711ce[_0xbb0c('0x19')];this[_0xbb0c('0x1a')]=_0x4711ce[_0xbb0c('0x1a')];this[_0xbb0c('0x1b')]=_0x4711ce[_0xbb0c('0x1b')];this[_0xbb0c('0x1c')]=_0x4711ce[_0xbb0c('0x1c')];this[_0xbb0c('0x1d')]=_0x4711ce['UserId'];this[_0xbb0c('0x1e')]=_0x4711ce[_0xbb0c('0x1e')];this[_0xbb0c('0x1f')]=_0x4711ce[_0xbb0c('0x1f')];this[_0xbb0c('0x20')]=_0x4711ce[_0xbb0c('0x20')]||'';this[_0xbb0c('0x21')]=_0x4711ce[_0xbb0c('0x21')]||'';this[_0xbb0c('0x22')]=_0x4711ce[_0xbb0c('0x22')];this[_0xbb0c('0x23')]=_0x4711ce[_0xbb0c('0x23')];}module[_0xbb0c('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index a963deb..70ebb9d 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8bc=['starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0xd1ebe8,_0x352777){var _0x2773b0=function(_0x547e94){while(--_0x547e94){_0xd1ebe8['push'](_0xd1ebe8['shift']());}};_0x2773b0(++_0x352777);}(_0xf8bc,0x18c));var _0xcf8b=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0xf8bc[_0x4cce65];return _0x4d1b45;};'use strict';var moment=require(_0xcf8b('0x0'));var utils=require(_0xcf8b('0x1'));function Hangup(_0x1ee7ed,_0x9eb791){this[_0xcf8b('0x2')]=0x4;this[_0xcf8b('0x3')]=_0xcf8b('0x4');this[_0xcf8b('0x5')]=_0x1ee7ed[_0xcf8b('0x5')];this[_0xcf8b('0x6')]=_0x1ee7ed[_0xcf8b('0x6')];this[_0xcf8b('0x7')]=_0x1ee7ed[_0xcf8b('0x6')]===_0xcf8b('0x8')?_0xcf8b('0x9'):_0x1ee7ed[_0xcf8b('0x6')];this['amd']=_0x1ee7ed['amd']||![];this['countbusyretry']=_0x1ee7ed[_0xcf8b('0xa')];this[_0xcf8b('0xb')]=_0x1ee7ed['countcongestionretry'];this['countnoanswerretry']=_0x1ee7ed[_0xcf8b('0xc')];this[_0xcf8b('0xd')]=_0x1ee7ed[_0xcf8b('0xa')]+_0x1ee7ed[_0xcf8b('0xb')]+_0x1ee7ed[_0xcf8b('0xc')]+_0x1ee7ed[_0xcf8b('0xe')]+_0x1ee7ed[_0xcf8b('0xf')]+_0x1ee7ed[_0xcf8b('0x10')]+_0x1ee7ed[_0xcf8b('0x11')]+_0x1ee7ed[_0xcf8b('0x12')];this[_0xcf8b('0xe')]=_0x1ee7ed[_0xcf8b('0xe')];this[_0xcf8b('0xf')]=_0x1ee7ed[_0xcf8b('0xf')];this[_0xcf8b('0x10')]=_0x1ee7ed[_0xcf8b('0x10')];this[_0xcf8b('0x11')]=_0x1ee7ed[_0xcf8b('0x11')];this[_0xcf8b('0x12')]=_0x1ee7ed[_0xcf8b('0x12')];this[_0xcf8b('0x13')]=_0x9eb791['uniqueid'];this[_0xcf8b('0x14')]=_0x1ee7ed[_0xcf8b('0x15')];this[_0xcf8b('0x16')]=_0x1ee7ed[_0xcf8b('0x17')];this[_0xcf8b('0x18')]=_0x1ee7ed[_0xcf8b('0x18')];this['responsetime']=_0x1ee7ed[_0xcf8b('0x19')];this[_0xcf8b('0x1a')]=moment()[_0xcf8b('0x1b')](_0xcf8b('0x1c'));this['ringtime']=utils[_0xcf8b('0x1d')](_0x1ee7ed[_0xcf8b('0x19')],_0x1ee7ed[_0xcf8b('0x18')]);this[_0xcf8b('0x1e')]=0x0;this['talktime']=utils[_0xcf8b('0x1d')](this['endtime'],_0x1ee7ed[_0xcf8b('0x19')]);this[_0xcf8b('0x9')]=_0x1ee7ed['queue'];this[_0xcf8b('0x1f')]='IVR';this['reason']=_0x9eb791['cause-txt'];this[_0xcf8b('0x20')]=_0x1ee7ed[_0xcf8b('0x20')];this[_0xcf8b('0x21')]=_0x1ee7ed[_0xcf8b('0x21')];this['callbackat']=_0x1ee7ed[_0xcf8b('0x22')];this[_0xcf8b('0x23')]=_0x1ee7ed[_0xcf8b('0x23')];this[_0xcf8b('0x24')]=_0x1ee7ed[_0xcf8b('0x24')];this[_0xcf8b('0x25')]=_0x1ee7ed[_0xcf8b('0x25')];this[_0xcf8b('0x26')]=_0x1ee7ed[_0xcf8b('0x26')];this[_0xcf8b('0x27')]=_0x1ee7ed[_0xcf8b('0x27')];this['CampaignId']=_0x1ee7ed[_0xcf8b('0x28')];}module[_0xcf8b('0x29')]=Hangup; \ No newline at end of file +var _0xe7ba=['Answer','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','ringtime','getSeconds','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc'];(function(_0x7340c0,_0x20b8e6){var _0x3ca19c=function(_0x5e4611){while(--_0x5e4611){_0x7340c0['push'](_0x7340c0['shift']());}};_0x3ca19c(++_0x20b8e6);}(_0xe7ba,0x7a));var _0xae7b=function(_0xb09943,_0x4ac90c){_0xb09943=_0xb09943-0x0;var _0x110eb1=_0xe7ba[_0xb09943];return _0x110eb1;};'use strict';var moment=require(_0xae7b('0x0'));var utils=require(_0xae7b('0x1'));function Hangup(_0x46321f,_0x480fab){this[_0xae7b('0x2')]=0x4;this[_0xae7b('0x3')]=_0xae7b('0x4');this['scheduledat']=_0x46321f['scheduledat'];this[_0xae7b('0x5')]=_0x46321f[_0xae7b('0x5')];this[_0xae7b('0x6')]=_0x46321f[_0xae7b('0x5')]===_0xae7b('0x7')?_0xae7b('0x8'):_0x46321f['type'];this[_0xae7b('0x9')]=_0x46321f[_0xae7b('0x9')]||![];this[_0xae7b('0xa')]=_0x46321f[_0xae7b('0xa')];this[_0xae7b('0xb')]=_0x46321f[_0xae7b('0xb')];this[_0xae7b('0xc')]=_0x46321f[_0xae7b('0xc')];this['countglobal']=_0x46321f[_0xae7b('0xa')]+_0x46321f[_0xae7b('0xb')]+_0x46321f[_0xae7b('0xc')]+_0x46321f['countnosuchnumberretry']+_0x46321f[_0xae7b('0xd')]+_0x46321f[_0xae7b('0xe')]+_0x46321f[_0xae7b('0xf')]+_0x46321f[_0xae7b('0x10')];this['countnosuchnumberretry']=_0x46321f[_0xae7b('0x11')];this[_0xae7b('0xd')]=_0x46321f['countdropretry'];this[_0xae7b('0xe')]=_0x46321f[_0xae7b('0xe')];this[_0xae7b('0xf')]=_0x46321f[_0xae7b('0xf')];this['countagentrejectretry']=_0x46321f[_0xae7b('0x10')];this[_0xae7b('0x12')]=_0x480fab[_0xae7b('0x12')];this[_0xae7b('0x13')]=_0x46321f[_0xae7b('0x14')];this[_0xae7b('0x15')]=_0x46321f['number'];this[_0xae7b('0x16')]=_0x46321f[_0xae7b('0x16')];this[_0xae7b('0x17')]=_0x46321f[_0xae7b('0x17')];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xae7b('0x18')]=utils[_0xae7b('0x19')](_0x46321f[_0xae7b('0x17')],_0x46321f['starttime']);this[_0xae7b('0x1a')]=0x0;this[_0xae7b('0x1b')]=utils['getSeconds'](this['endtime'],_0x46321f[_0xae7b('0x17')]);this[_0xae7b('0x8')]=_0x46321f[_0xae7b('0x8')];this[_0xae7b('0x1c')]=_0xae7b('0x1d');this[_0xae7b('0x1e')]=_0x480fab[_0xae7b('0x1f')];this[_0xae7b('0x20')]=_0x46321f[_0xae7b('0x20')];this['callbackuniqueid']=_0x46321f[_0xae7b('0x21')];this[_0xae7b('0x22')]=_0x46321f[_0xae7b('0x22')];this['recallme']=_0x46321f[_0xae7b('0x23')];this[_0xae7b('0x24')]=_0x46321f[_0xae7b('0x24')];this['ListId']=_0x46321f[_0xae7b('0x25')];this[_0xae7b('0x26')]=_0x46321f[_0xae7b('0x26')];this[_0xae7b('0x27')]=_0x46321f[_0xae7b('0x27')];this['CampaignId']=_0x46321f[_0xae7b('0x28')];}module[_0xae7b('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index f52bc68..b118019 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6140=['calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','name'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0x6140,0xa8));var _0x0614=function(_0x35e15a,_0x321e66){_0x35e15a=_0x35e15a-0x0;var _0x15b571=_0x6140[_0x35e15a];return _0x15b571;};'use strict';var utils=require(_0x0614('0x0'));function History(_0x5ed204){this[_0x0614('0x1')]=_0x5ed204['uniqueid'];this[_0x0614('0x2')]=_0x5ed204[_0x0614('0x2')]||undefined;this[_0x0614('0x3')]=_0x5ed204[_0x0614('0x3')];this[_0x0614('0x4')]=_0x5ed204[_0x0614('0x3')]===_0x0614('0x5')?_0x0614('0x6'):_0x5ed204[_0x0614('0x3')];this[_0x0614('0x7')]=_0x5ed204[_0x0614('0x7')];this['countcongestionretry']=_0x5ed204['countcongestionretry'];this['countnoanswerretry']=_0x5ed204[_0x0614('0x8')];this[_0x0614('0x9')]=_0x5ed204['countbusyretry']+_0x5ed204['countcongestionretry']+_0x5ed204[_0x0614('0x8')]+_0x5ed204['countnosuchnumberretry']+_0x5ed204[_0x0614('0xa')]+_0x5ed204['countabandonedretry']+_0x5ed204[_0x0614('0xb')]+_0x5ed204[_0x0614('0xc')];this[_0x0614('0xd')]=_0x5ed204[_0x0614('0xd')];this[_0x0614('0xa')]=_0x5ed204['countdropretry'];this[_0x0614('0xe')]=_0x5ed204[_0x0614('0xe')];this[_0x0614('0xb')]=_0x5ed204[_0x0614('0xb')];this[_0x0614('0xc')]=_0x5ed204[_0x0614('0xc')];this[_0x0614('0x6')]=_0x5ed204['queue'];this[_0x0614('0xf')]=_0x5ed204[_0x0614('0x10')];this[_0x0614('0x11')]=_0x5ed204['number'];this['starttime']=_0x5ed204[_0x0614('0x12')];this[_0x0614('0x13')]=_0x5ed204[_0x0614('0x13')];this[_0x0614('0x14')]=_0x5ed204[_0x0614('0x13')];this[_0x0614('0x15')]=utils['getSeconds'](_0x5ed204[_0x0614('0x13')],_0x5ed204['starttime']);this[_0x0614('0x16')]=0x0;this[_0x0614('0x17')]=0x0;this[_0x0614('0x18')]=_0x5ed204[_0x0614('0x18')];this[_0x0614('0x19')]=_0x5ed204[_0x0614('0x19')];this['callbackat']=_0x5ed204['callbackat'];this[_0x0614('0x1a')]=_0x5ed204['recallme'];this['ContactId']=_0x5ed204[_0x0614('0x1b')];this['ListId']=_0x5ed204[_0x0614('0x1c')];this[_0x0614('0x1d')]=_0x5ed204[_0x0614('0x1d')];this['VoiceQueueId']=_0x5ed204[_0x0614('0x1e')];this['CampaignId']=_0x5ed204[_0x0614('0x1f')];this[_0x0614('0x20')]=_0x5ed204[_0x0614('0x20')]||'';this[_0x0614('0x21')]=_0x5ed204[_0x0614('0x21')]||'';this[_0x0614('0x22')]=_0x5ed204['state'];this[_0x0614('0x23')]=_0x5ed204[_0x0614('0x23')];}module[_0x0614('0x24')]=History; \ No newline at end of file +var _0xa360=['calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry'];(function(_0x2f09f7,_0x461707){var _0x1b266c=function(_0xbff8dc){while(--_0xbff8dc){_0x2f09f7['push'](_0x2f09f7['shift']());}};_0x1b266c(++_0x461707);}(_0xa360,0x108));var _0x0a36=function(_0xdfc539,_0x351741){_0xdfc539=_0xdfc539-0x0;var _0x4d5a6b=_0xa360[_0xdfc539];return _0x4d5a6b;};'use strict';var utils=require(_0x0a36('0x0'));function History(_0x1cb5c8){this[_0x0a36('0x1')]=_0x1cb5c8['uniqueid'];this['scheduledat']=_0x1cb5c8[_0x0a36('0x2')]||undefined;this[_0x0a36('0x3')]=_0x1cb5c8['type'];this[_0x0a36('0x4')]=_0x1cb5c8[_0x0a36('0x3')]===_0x0a36('0x5')?_0x0a36('0x6'):_0x1cb5c8[_0x0a36('0x3')];this[_0x0a36('0x7')]=_0x1cb5c8['countbusyretry'];this['countcongestionretry']=_0x1cb5c8[_0x0a36('0x8')];this['countnoanswerretry']=_0x1cb5c8['countnoanswerretry'];this[_0x0a36('0x9')]=_0x1cb5c8[_0x0a36('0x7')]+_0x1cb5c8[_0x0a36('0x8')]+_0x1cb5c8[_0x0a36('0xa')]+_0x1cb5c8[_0x0a36('0xb')]+_0x1cb5c8[_0x0a36('0xc')]+_0x1cb5c8[_0x0a36('0xd')]+_0x1cb5c8['countmachineretry']+_0x1cb5c8[_0x0a36('0xe')];this[_0x0a36('0xb')]=_0x1cb5c8[_0x0a36('0xb')];this[_0x0a36('0xc')]=_0x1cb5c8[_0x0a36('0xc')];this[_0x0a36('0xd')]=_0x1cb5c8['countabandonedretry'];this[_0x0a36('0xf')]=_0x1cb5c8['countmachineretry'];this[_0x0a36('0xe')]=_0x1cb5c8[_0x0a36('0xe')];this[_0x0a36('0x6')]=_0x1cb5c8[_0x0a36('0x6')];this[_0x0a36('0x10')]=_0x1cb5c8['name'];this[_0x0a36('0x11')]=_0x1cb5c8[_0x0a36('0x12')];this['starttime']=_0x1cb5c8[_0x0a36('0x13')];this['responsetime']=_0x1cb5c8[_0x0a36('0x14')];this[_0x0a36('0x15')]=_0x1cb5c8[_0x0a36('0x14')];this[_0x0a36('0x16')]=utils[_0x0a36('0x17')](_0x1cb5c8[_0x0a36('0x14')],_0x1cb5c8[_0x0a36('0x13')]);this[_0x0a36('0x18')]=0x0;this[_0x0a36('0x19')]=0x0;this[_0x0a36('0x1a')]=_0x1cb5c8['callback'];this[_0x0a36('0x1b')]=_0x1cb5c8[_0x0a36('0x1b')];this[_0x0a36('0x1c')]=_0x1cb5c8[_0x0a36('0x1c')];this[_0x0a36('0x1d')]=_0x1cb5c8[_0x0a36('0x1d')];this[_0x0a36('0x1e')]=_0x1cb5c8[_0x0a36('0x1e')];this[_0x0a36('0x1f')]=_0x1cb5c8[_0x0a36('0x1f')];this[_0x0a36('0x20')]=_0x1cb5c8[_0x0a36('0x20')];this[_0x0a36('0x21')]=_0x1cb5c8[_0x0a36('0x21')];this[_0x0a36('0x22')]=_0x1cb5c8[_0x0a36('0x22')];this['originatecalleridnum']=_0x1cb5c8[_0x0a36('0x23')]||'';this[_0x0a36('0x24')]=_0x1cb5c8[_0x0a36('0x24')]||'';this[_0x0a36('0x25')]=_0x1cb5c8[_0x0a36('0x25')];this[_0x0a36('0x26')]=_0x1cb5c8['statedesc'];}module[_0x0a36('0x27')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 4d89684..b37ba0e 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7459=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid'];(function(_0x9e8065,_0x41f238){var _0x373557=function(_0x910705){while(--_0x910705){_0x9e8065['push'](_0x9e8065['shift']());}};_0x373557(++_0x41f238);}(_0x7459,0x1c2));var _0x9745=function(_0x4f1cc5,_0x784565){_0x4f1cc5=_0x4f1cc5-0x0;var _0x5b630d=_0x7459[_0x4f1cc5];return _0x5b630d;};'use strict';var utils=require(_0x9745('0x0'));function QueueCallerAbandon(_0x3202cd,_0x2547c0){this[_0x9745('0x1')]=_0x3202cd[_0x9745('0x1')];this[_0x9745('0x2')]=_0x3202cd[_0x9745('0x2')];this[_0x9745('0x3')]=_0x3202cd[_0x9745('0x2')]===_0x9745('0x4')?_0x9745('0x5'):_0x3202cd[_0x9745('0x2')];this['countbusyretry']=_0x3202cd[_0x9745('0x6')];this[_0x9745('0x7')]=_0x3202cd[_0x9745('0x7')];this[_0x9745('0x8')]=_0x3202cd[_0x9745('0x8')];this[_0x9745('0x9')]=_0x3202cd[_0x9745('0x6')]+_0x3202cd[_0x9745('0x7')]+_0x3202cd[_0x9745('0x8')]+_0x3202cd[_0x9745('0xa')]+_0x3202cd[_0x9745('0xb')]+_0x3202cd[_0x9745('0xc')]+_0x3202cd['countmachineretry']+_0x3202cd[_0x9745('0xd')];this[_0x9745('0xa')]=_0x3202cd[_0x9745('0xa')];this['countdropretry']=_0x3202cd[_0x9745('0xb')];this['countabandonedretry']=_0x3202cd[_0x9745('0xc')];this[_0x9745('0xe')]=_0x3202cd[_0x9745('0xe')];this[_0x9745('0xd')]=_0x3202cd[_0x9745('0xd')];this['uniqueid']=_0x2547c0[_0x9745('0xf')];this[_0x9745('0x10')]=_0x3202cd[_0x9745('0x11')];this[_0x9745('0x12')]=_0x3202cd[_0x9745('0x13')];this[_0x9745('0x14')]=_0x3202cd[_0x9745('0x14')];this[_0x9745('0x15')]=_0x3202cd[_0x9745('0x15')];this[_0x9745('0x16')]=_0x3202cd[_0x9745('0x16')];this[_0x9745('0x17')]=_0x3202cd[_0x9745('0x17')];this[_0x9745('0x18')]=this[_0x9745('0x16')];this[_0x9745('0x19')]=utils[_0x9745('0x1a')](_0x3202cd[_0x9745('0x15')],_0x3202cd[_0x9745('0x14')]);this[_0x9745('0x1b')]=utils[_0x9745('0x1a')](this[_0x9745('0x16')],_0x3202cd['responsetime']);this[_0x9745('0x1c')]=0x0;this['queue']=_0x2547c0[_0x9745('0x5')];this[_0x9745('0x1d')]=_0x2547c0[_0x9745('0x1e')];this[_0x9745('0x1f')]=_0x2547c0[_0x9745('0x1f')];this[_0x9745('0x20')]=_0x3202cd[_0x9745('0x20')];this[_0x9745('0x21')]=_0x3202cd[_0x9745('0x21')];this['callbackat']=_0x3202cd['callbackat'];this[_0x9745('0x22')]=_0x3202cd[_0x9745('0x22')];this[_0x9745('0x23')]=_0x3202cd['ContactId'];this['ListId']=_0x3202cd[_0x9745('0x24')];this[_0x9745('0x25')]=_0x3202cd['UserId'];this[_0x9745('0x26')]=_0x3202cd['VoiceQueueId'];this[_0x9745('0x27')]=_0x3202cd['CampaignId'];this[_0x9745('0x28')]=_0x3202cd[_0x9745('0x28')]||'';this['originatecalleridname']=_0x3202cd['originatecalleridname']||'';this[_0x9745('0x29')]=_0x3202cd[_0x9745('0x29')];this['state']=_0x3202cd['state'];this[_0x9745('0x2a')]=_0x3202cd['statedesc'];}module[_0x9745('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0x6149=['countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','dropreason','endtime','droptime','ringtime','holdtime','getSeconds','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','campaigntype','type','outbound','queue'];(function(_0x541ade,_0xd86dfb){var _0x30096e=function(_0x33b81d){while(--_0x33b81d){_0x541ade['push'](_0x541ade['shift']());}};_0x30096e(++_0xd86dfb);}(_0x6149,0x84));var _0x9614=function(_0x50449e,_0x93cbf9){_0x50449e=_0x50449e-0x0;var _0x1cc098=_0x6149[_0x50449e];return _0x1cc098;};'use strict';var utils=require(_0x9614('0x0'));function QueueCallerAbandon(_0x2b07ab,_0x134307){this[_0x9614('0x1')]=_0x2b07ab[_0x9614('0x1')];this['type']=_0x2b07ab['type'];this[_0x9614('0x2')]=_0x2b07ab[_0x9614('0x3')]===_0x9614('0x4')?_0x9614('0x5'):_0x2b07ab[_0x9614('0x3')];this['countbusyretry']=_0x2b07ab[_0x9614('0x6')];this[_0x9614('0x7')]=_0x2b07ab[_0x9614('0x7')];this['countnoanswerretry']=_0x2b07ab['countnoanswerretry'];this[_0x9614('0x8')]=_0x2b07ab[_0x9614('0x6')]+_0x2b07ab[_0x9614('0x7')]+_0x2b07ab[_0x9614('0x9')]+_0x2b07ab[_0x9614('0xa')]+_0x2b07ab[_0x9614('0xb')]+_0x2b07ab['countabandonedretry']+_0x2b07ab['countmachineretry']+_0x2b07ab[_0x9614('0xc')];this[_0x9614('0xa')]=_0x2b07ab[_0x9614('0xa')];this['countdropretry']=_0x2b07ab[_0x9614('0xb')];this['countabandonedretry']=_0x2b07ab[_0x9614('0xd')];this[_0x9614('0xe')]=_0x2b07ab[_0x9614('0xe')];this['countagentrejectretry']=_0x2b07ab[_0x9614('0xc')];this['uniqueid']=_0x134307[_0x9614('0xf')];this[_0x9614('0x10')]=_0x2b07ab[_0x9614('0x11')];this[_0x9614('0x12')]=_0x2b07ab[_0x9614('0x13')];this['starttime']=_0x2b07ab[_0x9614('0x14')];this[_0x9614('0x15')]=_0x2b07ab['responsetime'];this['droptime']=_0x2b07ab['droptime'];this[_0x9614('0x16')]=_0x2b07ab['dropreason'];this[_0x9614('0x17')]=this[_0x9614('0x18')];this[_0x9614('0x19')]=utils['getSeconds'](_0x2b07ab[_0x9614('0x15')],_0x2b07ab[_0x9614('0x14')]);this[_0x9614('0x1a')]=utils[_0x9614('0x1b')](this[_0x9614('0x18')],_0x2b07ab['responsetime']);this[_0x9614('0x1c')]=0x0;this[_0x9614('0x5')]=_0x134307['queue'];this['membername']=_0x134307[_0x9614('0x1d')];this[_0x9614('0x1e')]=_0x134307[_0x9614('0x1e')];this[_0x9614('0x1f')]=_0x2b07ab[_0x9614('0x1f')];this[_0x9614('0x20')]=_0x2b07ab[_0x9614('0x20')];this[_0x9614('0x21')]=_0x2b07ab['callbackat'];this[_0x9614('0x22')]=_0x2b07ab['recallme'];this['ContactId']=_0x2b07ab[_0x9614('0x23')];this[_0x9614('0x24')]=_0x2b07ab[_0x9614('0x24')];this['UserId']=_0x2b07ab[_0x9614('0x25')];this[_0x9614('0x26')]=_0x2b07ab[_0x9614('0x26')];this[_0x9614('0x27')]=_0x2b07ab[_0x9614('0x27')];this[_0x9614('0x28')]=_0x2b07ab['originatecalleridnum']||'';this[_0x9614('0x29')]=_0x2b07ab[_0x9614('0x29')]||'';this[_0x9614('0x2a')]=_0x2b07ab[_0x9614('0x2a')];this['state']=_0x2b07ab[_0x9614('0x2b')];this[_0x9614('0x2c')]=_0x2b07ab[_0x9614('0x2c')];}module[_0x9614('0x2d')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 9024242..8545543 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x3cdbdf,_0x5772f0){var _0x2e1fa1=function(_0x19533a){while(--_0x19533a){_0x3cdbdf['push'](_0x3cdbdf['shift']());}};_0x2e1fa1(++_0x5772f0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file +var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x2054ad,_0x6e57ca){var _0x4d874b=function(_0x50e27e){while(--_0x50e27e){_0x2054ad['push'](_0x2054ad['shift']());}};_0x4d874b(++_0x6e57ca);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 5499f95..2893a1f 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71a3=['originated','Trunk','name','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','TrunkBackup','includes','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','replace','random','getCallerIdRandom','error','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','lodash','moment','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x71a3,0x16f));var _0x371a=function(_0x842ed3,_0x201599){_0x842ed3=_0x842ed3-0x0;var _0x1af6d7=_0x71a3[_0x842ed3];return _0x1af6d7;};'use strict';var _=require(_0x371a('0x0'));var moment=require(_0x371a('0x1'));var util=require(_0x371a('0x2'));var logger=require('../../../../config/logger')(_0x371a('0x3'));var timezones=require(_0x371a('0x4'))[_0x371a('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x371a('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0x371a('0x7'),'DEACTIVATED':_0x371a('0x8'),'DISACTIVED':_0x371a('0x9'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0x371a('0xa'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x371a('0xb'),'NULL_INTERVAL':_0x371a('0xc'),'OVERTIME_INTERVAL':_0x371a('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0x371a('0xe'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x371a('0xf'),'RUNNING':_0x371a('0x10'),'UNKNOWN_TIMEZONE':_0x371a('0x11'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x371a('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x385765){return _0x385765[_0x371a('0x13')]===_0x371a('0x14');}exports[_0x371a('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x513a80){return _0x513a80[_0x371a('0x16')]===_0x371a('0x17');}exports[_0x371a('0x18')]=isIVRCampaign;function isOutboundQueue(_0x403e11){return _0x403e11[_0x371a('0x16')]===_0x371a('0x19');}exports[_0x371a('0x1a')]=isOutboundQueue;function isQueueCampaignActive(_0x39620f){return _0x39620f[_0x371a('0x1b')];}exports[_0x371a('0x1c')]=isQueueCampaignActive;function isIVRCampaignActive(_0x25ffe8){return _0x25ffe8[_0x371a('0x1d')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x478df4,_0x4c350a){var _0x4d6480=moment(_0x478df4)[_0x371a('0x1e')](0x0);var _0x12a589=moment(_0x4c350a)[_0x371a('0x1e')](0x0);return _0x4d6480[_0x371a('0x1f')](_0x12a589,_0x371a('0x20'));}exports[_0x371a('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x1b8ab2,_0x1e8b32){var _0xb82eac=![];var _0x52d12f=_0x1b8ab2[_0x371a('0x13')]!==_0x1e8b32['dialMethod']||_0x1b8ab2[_0x371a('0x1b')]!==_0x1e8b32[_0x371a('0x1b')]||_0x1b8ab2[_0x371a('0x22')]!==_0x1e8b32[_0x371a('0x22')];var _0x36cca8=_0x1b8ab2[_0x371a('0x23')]!==_0x1e8b32[_0x371a('0x23')]||_0x1b8ab2[_0x371a('0x24')]!==_0x1e8b32[_0x371a('0x24')]||_0x1b8ab2[_0x371a('0x25')]!==_0x1e8b32['loggedInDb']||_0x1b8ab2[_0x371a('0x26')]!==_0x1e8b32[_0x371a('0x26')]||_0x1b8ab2[_0x371a('0x27')]!==_0x1e8b32[_0x371a('0x27')]||_0x1b8ab2[_0x371a('0x28')]!==_0x1e8b32[_0x371a('0x28')]||_0x1b8ab2[_0x371a('0x29')]!==_0x1e8b32[_0x371a('0x29')]||_0x1b8ab2[_0x371a('0x2a')]!==_0x1e8b32[_0x371a('0x2a')]||_0x1b8ab2[_0x371a('0x2b')]!==_0x1e8b32[_0x371a('0x2b')];if(_0x1b8ab2[_0x371a('0x2c')]&&_0x1e8b32[_0x371a('0x2c')]){_0xb82eac=_0x1b8ab2[_0x371a('0x2c')][_0x371a('0x2d')]!==_0x1e8b32[_0x371a('0x2c')]['name']||_0x1b8ab2['Trunk'][_0x371a('0x1d')]!==_0x1e8b32[_0x371a('0x2c')]['active'];}return _0x52d12f||_0x36cca8||_0xb82eac;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x155be3){var _0x4ae04e=null;var _0x4e6f73=_0x155be3['dialTimezone'];if(_[_0x371a('0x2e')](_0x155be3[_0x371a('0x2f')])||_['isNil'](_0x155be3[_0x371a('0x30')])||_['isNil'](_0x155be3['Interval'][_0x371a('0x31')])){_0x4ae04e=CAMPAIGN_STATUS[_0x371a('0x32')];}else if(_[_0x371a('0x33')](_0x155be3[_0x371a('0x2f')])||_['isEmpty'](_0x155be3[_0x371a('0x30')][_0x371a('0x31')])){_0x4ae04e=CAMPAIGN_STATUS[_0x371a('0x34')];}else if(_0x4e6f73&&!timezones[_0x4e6f73]){_0x4ae04e=CAMPAIGN_STATUS[_0x371a('0x35')];}return _0x4ae04e;}function checkAnyValidTrunk(_0x25ab30,_0x293c34){var _0x5975e3=null;var _0x1d11ed=_0x371a('0x36');var _0x3cb172=[_0x371a('0x37'),_0x371a('0x38')];var _0x37ecb7=!![];if(_0x25ab30[_0x371a('0x2c')]&&_0x25ab30['Trunk']['active']){_0x1d11ed+=_0x25ab30[_0x371a('0x2c')][_0x371a('0x2d')];_0x5975e3=_0x293c34[_0x1d11ed];_0x37ecb7=_0x3cb172['includes'](_0x5975e3['status']);}else if(_0x25ab30['TrunkBackup']&&_0x25ab30[_0x371a('0x39')][_0x371a('0x1d')]){_0x1d11ed+=_0x25ab30[_0x371a('0x39')][_0x371a('0x2d')];_0x5975e3=_0x293c34[_0x1d11ed];_0x37ecb7=_0x3cb172[_0x371a('0x3a')](_0x5975e3[_0x371a('0x3b')]);}return _0x37ecb7;}function getQueueCampaignStatusMessage(_0x5775ca,_0x27e541){var _0x49e5ea=CAMPAIGN_STATUS[_0x371a('0x6')];var _0x47f37b=isPreviewCampaign(_0x5775ca);if(!isQueueCampaignActive(_0x5775ca)){if(_0x47f37b){_0x49e5ea=CAMPAIGN_STATUS[_0x371a('0x3c')];}else{if(_0x5775ca[_0x371a('0x2b')]===0x0&&_0x5775ca[_0x371a('0x27')]===0x0&&_0x5775ca['waiting']===0x0&&(_0x5775ca[_0x371a('0x28')]||0x0)===0x0){_0x49e5ea=CAMPAIGN_STATUS[_0x371a('0x3c')];}else{_0x49e5ea=CAMPAIGN_STATUS[_0x371a('0x3d')];}}}else if(_0x5775ca[_0x371a('0x24')]===0x0){_0x49e5ea=CAMPAIGN_STATUS[_0x371a('0x3e')];}else if(!checkAnyValidTrunk(_0x5775ca,_0x27e541)){_0x49e5ea=CAMPAIGN_STATUS[_0x371a('0x3f')];}else if(!isPreviewCampaign(_0x5775ca)){var _0x2ad6dd=checkAnyValidQueueCampaignInterval(_0x5775ca);if(_0x2ad6dd){_0x49e5ea=_0x2ad6dd;}}return _0x49e5ea;}exports[_0x371a('0x40')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x13190a){var _0x59fe37=CAMPAIGN_STATUS[_0x371a('0x3d')];if(_0x13190a[_0x371a('0x2b')]===0x0&&_0x13190a[_0x371a('0x27')]===0x0&&_0x13190a[_0x371a('0x29')]===0x0&&(_0x13190a[_0x371a('0x28')]||0x0)===0x0){_0x59fe37=CAMPAIGN_STATUS[_0x371a('0x3c')];}return _0x59fe37;}exports[_0x371a('0x41')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5a4f14){var _0xde0abd=_0x5a4f14['match'](/"(.*?)"/);return _0xde0abd?_0xde0abd[0x1]:_0x5a4f14;}exports[_0x371a('0x42')]=extractCalleridName;function getCallerId(_0x3c7e78,_0x2b1525,_0x4530b9){if(!_[_0x371a('0x43')](_0x4530b9)&&typeof _0x4530b9===_0x371a('0x44')&&!_[_0x371a('0x33')](_0x4530b9)){if(!_['isUndefined'](_0x2b1525)&&typeof _0x2b1525===_0x371a('0x44')&&!_[_0x371a('0x33')](_0x2b1525)){return util[_0x371a('0x45')](_0x371a('0x46'),_0x2b1525,_0x4530b9);}return util[_0x371a('0x45')](_0x371a('0x46'),_0x4530b9,_0x4530b9);}if(!_[_0x371a('0x43')](_0x3c7e78)&&typeof _0x3c7e78===_0x371a('0x44')&&!_['isEmpty'](_0x3c7e78)){return _0x3c7e78;}return'\x22\x22\x20<>';}exports[_0x371a('0x47')]=getCallerId;function getCallerIdRandom(_0x25bae6,_0x2563de){var _0x5906fc;var _0x36b3b3;var _0x243360;if(_0x2563de<=0x0){_0x2563de=0x1;}_0x5906fc=new RegExp(_0x371a('0x48')+_0x2563de+'}$');_0x36b3b3=Math['pow'](0xa,_0x2563de-0x1);_0x243360=Math['pow'](0xa,_0x2563de)-0x1;return util[_0x371a('0x45')]('%s',_[_0x371a('0x49')](_0x25bae6,_0x5906fc,_[_0x371a('0x4a')](_0x36b3b3,_0x243360)['toString']()));}exports[_0x371a('0x4b')]=getCallerIdRandom;function decrementOriginate(_0x22db58){if(_0x22db58[_0x371a('0x2b')]&&_0x22db58[_0x371a('0x2b')]>0x0){_0x22db58['originated']-=0x1;}else{logger[_0x371a('0x4c')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x371a('0x4d')]=decrementOriginate;function checkContactEmpty(_0x68e38a){return _0x68e38a&&_0x68e38a[_0x371a('0x4e')]>0x0;}exports[_0x371a('0x4f')]=checkContactEmpty;function erlangb(_0xac1691,_0x3242c1){if(_0x3242c1===0x0){return 0x0;}var _0x5eea7d=0x1;for(var _0x1a6b70=0x1;_0x1a6b70<=_0x3242c1;_0x1a6b70+=0x1){_0x5eea7d=0x1+_0x5eea7d*_0x1a6b70/_0xac1691;}return 0x1/_0x5eea7d;}exports[_0x371a('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x5863cd,_0x5ba889,_0x5ca3c7){if(_0x5ba889>_0x5ca3c7){for(var _0x83235a=0x0;_0x83235a<_0x5ba889-_0x5ca3c7;_0x83235a+=0x1){decrementOriginate(_0x5863cd);}}}exports[_0x371a('0x51')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0xa4b5=['diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','unmonitored','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','string','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','checkContactLowerLimitOriginate','lodash','moment','util','../../../../config/logger','dialer','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','dialMethod','preview','type','ivr','isIVRCampaign','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds'];(function(_0x3c57a3,_0x2d9495){var _0x234cb3=function(_0x35d394){while(--_0x35d394){_0x3c57a3['push'](_0x3c57a3['shift']());}};_0x234cb3(++_0x2d9495);}(_0xa4b5,0xe2));var _0x5a4b=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa4b5[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x5a4b('0x0'));var moment=require(_0x5a4b('0x1'));var util=require(_0x5a4b('0x2'));var logger=require(_0x5a4b('0x3'))(_0x5a4b('0x4'));var timezones=require('../../../../config/environment/shared')['timezones'];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x5a4b('0x5'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x5a4b('0x6'),'DISACTIVED':_0x5a4b('0x7'),'EMPTY_INTERVAL':_0x5a4b('0x8'),'INACTIVE':_0x5a4b('0x9'),'NO_AGENTS_LOGGED':_0x5a4b('0xa'),'NO_AVAILABLE_CONTACTS':_0x5a4b('0xb'),'NULL_INTERVAL':_0x5a4b('0xc'),'OVERTIME_INTERVAL':_0x5a4b('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0x5a4b('0xe'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x5a4b('0xf'),'RUNNING':_0x5a4b('0x10'),'UNKNOWN_TIMEZONE':_0x5a4b('0x11'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x42fccb){return _0x42fccb[_0x5a4b('0x12')]===_0x5a4b('0x13');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x46e24e){return _0x46e24e[_0x5a4b('0x14')]===_0x5a4b('0x15');}exports[_0x5a4b('0x16')]=isIVRCampaign;function isOutboundQueue(_0x7ac507){return _0x7ac507[_0x5a4b('0x14')]==='outbound';}exports[_0x5a4b('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x437852){return _0x437852[_0x5a4b('0x18')];}exports[_0x5a4b('0x19')]=isQueueCampaignActive;function isIVRCampaignActive(_0x5194f4){return _0x5194f4[_0x5a4b('0x1a')];}exports[_0x5a4b('0x1b')]=isIVRCampaignActive;function getSeconds(_0x3f1605,_0xcfd917){var _0x3bee84=moment(_0x3f1605)['milliseconds'](0x0);var _0x1c38f0=moment(_0xcfd917)[_0x5a4b('0x1c')](0x0);return _0x3bee84[_0x5a4b('0x1d')](_0x1c38f0,_0x5a4b('0x1e'));}exports[_0x5a4b('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x195ecb,_0x13a3e9){var _0x2f84b5=![];var _0x356d49=_0x195ecb['dialMethod']!==_0x13a3e9[_0x5a4b('0x12')]||_0x195ecb[_0x5a4b('0x18')]!==_0x13a3e9[_0x5a4b('0x18')]||_0x195ecb[_0x5a4b('0x20')]!==_0x13a3e9['message'];var _0x4e623f=_0x195ecb[_0x5a4b('0x21')]!==_0x13a3e9['available']||_0x195ecb[_0x5a4b('0x22')]!==_0x13a3e9['loggedIn']||_0x195ecb[_0x5a4b('0x23')]!==_0x13a3e9[_0x5a4b('0x23')]||_0x195ecb[_0x5a4b('0x24')]!==_0x13a3e9[_0x5a4b('0x24')]||_0x195ecb[_0x5a4b('0x25')]!==_0x13a3e9[_0x5a4b('0x25')]||_0x195ecb[_0x5a4b('0x26')]!==_0x13a3e9[_0x5a4b('0x26')]||_0x195ecb[_0x5a4b('0x27')]!==_0x13a3e9[_0x5a4b('0x27')]||_0x195ecb[_0x5a4b('0x28')]!==_0x13a3e9[_0x5a4b('0x28')]||_0x195ecb[_0x5a4b('0x29')]!==_0x13a3e9[_0x5a4b('0x29')];if(_0x195ecb['Trunk']&&_0x13a3e9['Trunk']){_0x2f84b5=_0x195ecb[_0x5a4b('0x2a')][_0x5a4b('0x2b')]!==_0x13a3e9[_0x5a4b('0x2a')][_0x5a4b('0x2b')]||_0x195ecb[_0x5a4b('0x2a')][_0x5a4b('0x1a')]!==_0x13a3e9[_0x5a4b('0x2a')][_0x5a4b('0x1a')];}return _0x356d49||_0x4e623f||_0x2f84b5;}exports[_0x5a4b('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x12ea15){var _0x4fb336=null;var _0x518a81=_0x12ea15[_0x5a4b('0x2d')];if(_[_0x5a4b('0x2e')](_0x12ea15[_0x5a4b('0x2f')])||_['isNil'](_0x12ea15[_0x5a4b('0x30')])||_[_0x5a4b('0x2e')](_0x12ea15[_0x5a4b('0x30')][_0x5a4b('0x31')])){_0x4fb336=CAMPAIGN_STATUS[_0x5a4b('0x32')];}else if(_[_0x5a4b('0x33')](_0x12ea15[_0x5a4b('0x2f')])||_[_0x5a4b('0x33')](_0x12ea15[_0x5a4b('0x30')][_0x5a4b('0x31')])){_0x4fb336=CAMPAIGN_STATUS[_0x5a4b('0x34')];}else if(_0x518a81&&!timezones[_0x518a81]){_0x4fb336=CAMPAIGN_STATUS[_0x5a4b('0x35')];}return _0x4fb336;}function checkAnyValidTrunk(_0x1520fc,_0x5be3fa){var _0x4c4c=null;var _0x11a276=_0x5a4b('0x36');var _0x4a361e=['reachable',_0x5a4b('0x37')];var _0x29511f=!![];if(_0x1520fc[_0x5a4b('0x2a')]&&_0x1520fc[_0x5a4b('0x2a')]['active']){_0x11a276+=_0x1520fc[_0x5a4b('0x2a')][_0x5a4b('0x2b')];_0x4c4c=_0x5be3fa[_0x11a276];_0x29511f=_0x4a361e[_0x5a4b('0x38')](_0x4c4c[_0x5a4b('0x39')]);}else if(_0x1520fc['TrunkBackup']&&_0x1520fc[_0x5a4b('0x3a')][_0x5a4b('0x1a')]){_0x11a276+=_0x1520fc['TrunkBackup'][_0x5a4b('0x2b')];_0x4c4c=_0x5be3fa[_0x11a276];_0x29511f=_0x4a361e[_0x5a4b('0x38')](_0x4c4c['status']);}return _0x29511f;}function getQueueCampaignStatusMessage(_0x108ceb,_0x2e99dd){var _0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3b')];var _0x29796e=isPreviewCampaign(_0x108ceb);if(!isQueueCampaignActive(_0x108ceb)){if(_0x29796e){_0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3c')];}else{if(_0x108ceb[_0x5a4b('0x29')]===0x0&&_0x108ceb['talking']===0x0&&_0x108ceb[_0x5a4b('0x27')]===0x0&&(_0x108ceb['pTalking']||0x0)===0x0){_0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3c')];}else{_0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3d')];}}}else if(_0x108ceb['loggedIn']===0x0){_0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3e')];}else if(!checkAnyValidTrunk(_0x108ceb,_0x2e99dd)){_0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3f')];}else if(!isPreviewCampaign(_0x108ceb)){var _0x28cd6f=checkAnyValidQueueCampaignInterval(_0x108ceb);if(_0x28cd6f){_0xe5aa23=_0x28cd6f;}}return _0xe5aa23;}exports[_0x5a4b('0x40')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x193749){var _0x4472b2=CAMPAIGN_STATUS['DISACTIVED'];if(_0x193749[_0x5a4b('0x29')]===0x0&&_0x193749['talking']===0x0&&_0x193749[_0x5a4b('0x27')]===0x0&&(_0x193749[_0x5a4b('0x26')]||0x0)===0x0){_0x4472b2=CAMPAIGN_STATUS[_0x5a4b('0x3c')];}return _0x4472b2;}exports[_0x5a4b('0x41')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x11819e){var _0x4ebf54=_0x11819e['match'](/"(.*?)"/);return _0x4ebf54?_0x4ebf54[0x1]:_0x11819e;}exports[_0x5a4b('0x42')]=extractCalleridName;function getCallerId(_0x26395b,_0x5151a9,_0x1d50df){if(!_['isUndefined'](_0x1d50df)&&typeof _0x1d50df===_0x5a4b('0x43')&&!_['isEmpty'](_0x1d50df)){if(!_['isUndefined'](_0x5151a9)&&typeof _0x5151a9===_0x5a4b('0x43')&&!_[_0x5a4b('0x33')](_0x5151a9)){return util[_0x5a4b('0x44')](_0x5a4b('0x45'),_0x5151a9,_0x1d50df);}return util['format'](_0x5a4b('0x45'),_0x1d50df,_0x1d50df);}if(!_[_0x5a4b('0x46')](_0x26395b)&&typeof _0x26395b===_0x5a4b('0x43')&&!_[_0x5a4b('0x33')](_0x26395b)){return _0x26395b;}return _0x5a4b('0x47');}exports[_0x5a4b('0x48')]=getCallerId;function getCallerIdRandom(_0x3b18a4,_0x30987a){var _0x3e439e;var _0x2d5159;var _0x296900;if(_0x30987a<=0x0){_0x30987a=0x1;}_0x3e439e=new RegExp(_0x5a4b('0x49')+_0x30987a+'}$');_0x2d5159=Math['pow'](0xa,_0x30987a-0x1);_0x296900=Math[_0x5a4b('0x4a')](0xa,_0x30987a)-0x1;return util[_0x5a4b('0x44')]('%s',_[_0x5a4b('0x4b')](_0x3b18a4,_0x3e439e,_[_0x5a4b('0x4c')](_0x2d5159,_0x296900)[_0x5a4b('0x4d')]()));}exports[_0x5a4b('0x4e')]=getCallerIdRandom;function decrementOriginate(_0x47ffa0){if(_0x47ffa0[_0x5a4b('0x29')]&&_0x47ffa0[_0x5a4b('0x29')]>0x0){_0x47ffa0[_0x5a4b('0x29')]-=0x1;}else{logger[_0x5a4b('0x4f')](_0x5a4b('0x50'));}}exports[_0x5a4b('0x51')]=decrementOriginate;function checkContactEmpty(_0x392c53){return _0x392c53&&_0x392c53[_0x5a4b('0x52')]>0x0;}exports[_0x5a4b('0x53')]=checkContactEmpty;function erlangb(_0x46ddca,_0x5da848){if(_0x5da848===0x0){return 0x0;}var _0xf92fde=0x1;for(var _0x5a7135=0x1;_0x5a7135<=_0x5da848;_0x5a7135+=0x1){_0xf92fde=0x1+_0xf92fde*_0x5a7135/_0x46ddca;}return 0x1/_0xf92fde;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x179da0,_0xae7156,_0x214fc0){if(_0xae7156>_0x214fc0){for(var _0x1c3b9=0x0;_0x1c3b9<_0xae7156-_0x214fc0;_0x1c3b9+=0x1){decrementOriginate(_0x179da0);}}}exports[_0x5a4b('0x54')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index d819be0..de31d24 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x2b39b0,_0x2c3f8d){var _0x5f508e=function(_0x16ec8e){while(--_0x16ec8e){_0x2b39b0['push'](_0x2b39b0['shift']());}};_0x5f508e(++_0x2c3f8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x5002b5,_0x15dd3e){var _0x35892d=function(_0x5f03ae){while(--_0x5f03ae){_0x5002b5['push'](_0x5002b5['shift']());}};_0x35892d(++_0x15dd3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 2289c83..d87eefc 100644 --- a/server/services/ami/fax/index.js +++ b/server/services/ami/fax/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa95f=['checkTrunk','FaxAccountId','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','variablesAction','Action','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','Empty\x20path','exports','util','lodash','bluebird','uuid','path','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','filename','info','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','application/pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][failure]','checkAfterSend'];(function(_0x5a91fb,_0x466890){var _0x562f49=function(_0x572594){while(--_0x572594){_0x5a91fb['push'](_0x5a91fb['shift']());}};_0x562f49(++_0x466890);}(_0xa95f,0x104));var _0xfa95=function(_0x3aff53,_0x3ac7aa){_0x3aff53=_0x3aff53-0x0;var _0x4f3f4b=_0xa95f[_0x3aff53];return _0x4f3f4b;};'use strict';var util=require(_0xfa95('0x0'));var _=require(_0xfa95('0x1'));var BPromise=require(_0xfa95('0x2'));var uuid=require(_0xfa95('0x3'));var moment=require('moment');var path=require(_0xfa95('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xfa95('0x5'));var logger=require(_0xfa95('0x6'))(_0xfa95('0x7'));var ami=require(_0xfa95('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0xfa95('0x9'));var ut=require(_0xfa95('0xa'));var Action=require(_0xfa95('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0xfa95('0xc'));function Fax(_0x307f61){this[_0xfa95('0xd')]={};this[_0xfa95('0xe')]=_0x307f61[_0xfa95('0xe')];this[_0xfa95('0xf')]=_0x307f61[_0xfa95('0xf')];this[_0xfa95('0x10')]={};ami['on'](_0xfa95('0x11'),this[_0xfa95('0x12')]['bind'](this));ami['on'](_0xfa95('0x13'),this[_0xfa95('0x14')][_0xfa95('0x15')](this));ami['on'](_0xfa95('0x16'),this['syncNewState'][_0xfa95('0x15')](this));ami['on'](_0xfa95('0x17'),this[_0xfa95('0x18')]['bind'](this));ami['on'](_0xfa95('0x19'),this[_0xfa95('0x1a')][_0xfa95('0x15')](this));ami['on'](_0xfa95('0x1b'),this[_0xfa95('0x1c')][_0xfa95('0x15')](this));ami['on']('hangup',this[_0xfa95('0x1d')][_0xfa95('0x15')](this));ami['on'](_0xfa95('0x1e'),this[_0xfa95('0x1f')][_0xfa95('0x15')](this));}Fax[_0xfa95('0x20')][_0xfa95('0x12')]=function(_0x5a175d){if(_0x5a175d[_0xfa95('0x21')]===_0xfa95('0x22')){for(var _0x3796f9 in this[_0xfa95('0xe')]){if(this[_0xfa95('0xe')][_0xfa95('0x23')](_0x3796f9)){if(_0x5a175d['exten']===this[_0xfa95('0xe')][_0x3796f9][_0xfa95('0x24')]){this[_0xfa95('0xd')][_0x5a175d[_0xfa95('0x25')]]={};this[_0xfa95('0xd')][_0x5a175d[_0xfa95('0x25')]][_0xfa95('0x26')]=_0x5a175d[_0xfa95('0x26')];this['channels'][_0x5a175d[_0xfa95('0x25')]]['id']=this['faxAccounts'][_0x3796f9]['id'];this[_0xfa95('0xd')][_0x5a175d[_0xfa95('0x25')]]['name']=this[_0xfa95('0xe')][_0x3796f9][_0xfa95('0x27')];logger['info'](_0x5a175d['uniqueid'],_0xfa95('0x28'));}}}}if(this[_0xfa95('0x10')][_0x5a175d[_0xfa95('0x25')]]){this[_0xfa95('0xd')][_0x5a175d[_0xfa95('0x25')]]={};this['channels'][_0x5a175d[_0xfa95('0x25')]][_0xfa95('0x26')]=_0x5a175d[_0xfa95('0x26')];logger['info'](_0x5a175d[_0xfa95('0x25')],_0xfa95('0x28'));}};Fax['prototype'][_0xfa95('0x14')]=function(_0x1c4b4c){if(this[_0xfa95('0xd')][_0x1c4b4c[_0xfa95('0x25')]]){for(var _0x1d4d5c in _0x1c4b4c[_0xfa95('0x29')]){if(_0x1c4b4c[_0xfa95('0x29')][_0xfa95('0x23')](_0x1d4d5c)){this['channels'][_0x1c4b4c[_0xfa95('0x25')]][_0x1d4d5c]=_0x1c4b4c['value'];}}}};Fax['prototype']['syncNewState']=function(_0x47ffd7){if(this[_0xfa95('0xd')][_0x47ffd7[_0xfa95('0x25')]]){this[_0xfa95('0xd')][_0x47ffd7[_0xfa95('0x25')]][_0xfa95('0x2a')]=_0x47ffd7[_0xfa95('0x2a')];this[_0xfa95('0xd')][_0x47ffd7[_0xfa95('0x25')]][_0xfa95('0x2b')]=_0x47ffd7[_0xfa95('0x2b')];}};Fax[_0xfa95('0x20')][_0xfa95('0x18')]=function(_0x5cdda4){if(this['channels'][_0x5cdda4['uniqueid']]){for(var _0x1de30f in _0x5cdda4[_0xfa95('0x29')]){if(_0x5cdda4[_0xfa95('0x29')][_0xfa95('0x23')](_0x1de30f)){this['channels'][_0x5cdda4[_0xfa95('0x25')]][_0x1de30f]=_0x5cdda4[_0xfa95('0x2c')];}}}};Fax['prototype'][_0xfa95('0x1a')]=function(_0x213392){if(this[_0xfa95('0xd')][_0x213392[_0xfa95('0x25')]]){this['channels'][_0x213392[_0xfa95('0x25')]][_0xfa95('0x2d')]=_0x213392['operation'];this[_0xfa95('0xd')][_0x213392[_0xfa95('0x25')]]['status']=_0x213392[_0xfa95('0x2e')];this[_0xfa95('0xd')][_0x213392[_0xfa95('0x25')]][_0xfa95('0x24')]=_0x213392[_0xfa95('0x24')];this[_0xfa95('0xd')][_0x213392[_0xfa95('0x25')]][_0xfa95('0x2f')]=_0x213392[_0xfa95('0x2f')];logger[_0xfa95('0x30')](_0x213392['uniqueid'],_0xfa95('0x31'));}};Fax[_0xfa95('0x20')][_0xfa95('0x1c')]=function(_0x1c0a01){var _0x52086a=this;if(this[_0xfa95('0xd')][_0x1c0a01[_0xfa95('0x25')]]){var _0x436078=this[_0xfa95('0xd')][_0x1c0a01['uniqueid']]['id'];this[_0xfa95('0xd')][_0x1c0a01[_0xfa95('0x25')]]['remotestationid']=_0x1c0a01['remotestationid'];this[_0xfa95('0xd')][_0x1c0a01[_0xfa95('0x25')]]['pagestransferred']=_0x1c0a01[_0xfa95('0x32')];this[_0xfa95('0xd')][_0x1c0a01[_0xfa95('0x25')]][_0xfa95('0x24')]=_0x1c0a01['localstationid'];this[_0xfa95('0xd')][_0x1c0a01[_0xfa95('0x25')]][_0xfa95('0x33')]=_0x1c0a01[_0xfa95('0x33')];this[_0xfa95('0xd')][_0x1c0a01[_0xfa95('0x25')]][_0xfa95('0x34')]=_0x1c0a01[_0xfa95('0x34')];this['channels'][_0x1c0a01[_0xfa95('0x25')]]['filename']=_0x1c0a01['filename'];this[_0xfa95('0xd')][_0x1c0a01[_0xfa95('0x25')]][_0xfa95('0x35')]=_0x1c0a01[_0xfa95('0x35')];if(this['channels'][_0x1c0a01[_0xfa95('0x25')]][_0xfa95('0x32')]>0x0){tiff2pdf(_0x1c0a01[_0xfa95('0x2f')],_0xfa95('0x36'),function(_0x209f98){logger['info'](_0x1c0a01[_0xfa95('0x25')],_0xfa95('0x37'),_0x209f98[_0xfa95('0x38')]);attachment['create']({'name':path[_0xfa95('0x39')](_0x1c0a01['filename'])[_0xfa95('0x27')],'basename':path[_0xfa95('0x39')](_0x1c0a01[_0xfa95('0x2f')])[_0xfa95('0x27')]+'.pdf','type':_0xfa95('0x3a')})[_0xfa95('0x3b')](function(_0x56a800){faxAccount[_0xfa95('0x3c')](_0x436078,{'from':_0x1c0a01[_0xfa95('0x35')],'mapKey':_0xfa95('0x7'),'body':path[_0xfa95('0x39')](_0x1c0a01[_0xfa95('0x2f')])[_0xfa95('0x27')]+'.pdf','AttachmentId':_0x56a800['id']})[_0xfa95('0x3d')](function(_0xd80e79){logger['error'](_0x1c0a01['uniqueid'],_0xfa95('0x3e'),JSON[_0xfa95('0x3f')](_0xd80e79));});})['catch'](function(_0x26e77a){logger[_0xfa95('0x40')](_0x1c0a01[_0xfa95('0x25')],_0xfa95('0x41'),JSON[_0xfa95('0x3f')](_0x26e77a));});});}logger['info'](_0x1c0a01[_0xfa95('0x25')],_0xfa95('0x41'));}};Fax[_0xfa95('0x20')][_0xfa95('0x1f')]=function(_0x24b09e){if(this['actions'][_0x24b09e['uniqueid']]){_[_0xfa95('0x42')](this[_0xfa95('0xd')][_0x24b09e[_0xfa95('0x25')]],_['pick'](_0x24b09e,[_0xfa95('0x43'),_0xfa95('0x44')]));}};function updateStatus(_0xf6e071){if(_0xf6e071[_0xfa95('0x45')]){faxMessage[_0xfa95('0x46')](_0xf6e071[_0xfa95('0x45')],{'failMessage':_0xfa95('0x47')})['then'](function(_0x14e75d){ut[_0xfa95('0x48')](_0xfa95('0x49'),_0x14e75d);})['catch'](function(_0x40744e){ut['logger'](_0xfa95('0x4a'),_0x40744e);});}else{ut[_0xfa95('0x48')](_0xfa95('0x4b'));}}Fax['prototype'][_0xfa95('0x4c')]=function(_0x3d5297,_0x5df007,_0x4e84c4){var _0xcc2aac=this;var _0x4e2cb6={};if(_0x5df007){_0x4e2cb6={'read':_0x5df007};}else{_0x4e2cb6={'failMessage':_0x4e84c4};}if(this['actions'][_0x3d5297][_0xfa95('0x45')]){faxMessage[_0xfa95('0x46')](this[_0xfa95('0x10')][_0x3d5297]['AttachmentId'],_0x4e2cb6)[_0xfa95('0x3b')](function(_0x8e7cd9){ut[_0xfa95('0x48')](_0xfa95('0x4d'),_0x8e7cd9);})[_0xfa95('0x3d')](function(_0x160ce0){ut['logger']('[Fax][Message][NoUpdate1]',_0x160ce0);})['finally'](function(){delete _0xcc2aac[_0xfa95('0xd')][_0x3d5297];delete _0xcc2aac[_0xfa95('0x10')][_0x3d5297];});}else{ut[_0xfa95('0x48')](_0xfa95('0x4e'));delete this[_0xfa95('0xd')][_0x3d5297];delete this[_0xfa95('0x10')][_0x3d5297];}};Fax['prototype'][_0xfa95('0x1d')]=function(_0x1db870){var _0x27669a=this;if(this[_0xfa95('0xd')][_0x1db870[_0xfa95('0x25')]]){if(this['actions'][_0x1db870[_0xfa95('0x25')]]){this[_0xfa95('0xd')][_0x1db870[_0xfa95('0x25')]]['id']=this[_0xfa95('0x10')][_0x1db870['uniqueid']]['id'];this['channels'][_0x1db870[_0xfa95('0x25')]][_0xfa95('0x27')]=this[_0xfa95('0x10')][_0x1db870['uniqueid']][_0xfa95('0x27')];}logger[_0xfa95('0x30')](_0x1db870['uniqueid'],this[_0xfa95('0x10')][_0x1db870[_0xfa95('0x25')]]?_0xfa95('0x4f'):_0xfa95('0x50'),JSON['stringify'](this[_0xfa95('0xd')][_0x1db870[_0xfa95('0x25')]]));if(this['actions'][_0x1db870[_0xfa95('0x25')]]){if(this[_0xfa95('0xd')][_0x1db870[_0xfa95('0x25')]]['faxpages']>0x0&&this[_0xfa95('0xd')][_0x1db870[_0xfa95('0x25')]][_0xfa95('0x19')]===_0xfa95('0x51')){this[_0xfa95('0x4c')](_0x1db870[_0xfa95('0x25')],!![]);}else{this[_0xfa95('0x4c')](_0x1db870['uniqueid'],![],this['channels'][_0x1db870[_0xfa95('0x25')]][_0xfa95('0x52')]?_0xfa95('0x53')+this[_0xfa95('0xd')][_0x1db870[_0xfa95('0x25')]][_0xfa95('0x52')]:_0xfa95('0x54'));}}}};Fax[_0xfa95('0x20')]['send']=function(_0x45e175){var _0xe03689=this;return new BPromise(function(_0x1c0128,_0x4b2e74){_0xe03689[_0xfa95('0x55')](_0x45e175,_0xe03689[_0xfa95('0xe')][_0x45e175['FaxAccountId']])[_0xfa95('0x3b')](function(_0x4b546a){ut[_0xfa95('0x48')]('[Fax][execOriginate][success]',_0x4b546a);_0x1c0128(ut['message']('Fax\x20received'));})['catch'](function(_0x312882){ut[_0xfa95('0x48')](_0xfa95('0x56'),_0x312882);updateStatus(_0x45e175);_0x4b2e74(ut[_0xfa95('0x38')]('Fax\x20failed'));});});};Fax['prototype'][_0xfa95('0x57')]=function(_0x5f4286){var _0xc80d6f=this;return new BPromise(function(_0x3b69ed,_0x4d9f79){var _0xd7026a=_0xc80d6f[_0xfa95('0x58')](_0xc80d6f[_0xfa95('0xe')][_0x5f4286[_0xfa95('0x59')]]['Trunk'],_0x5f4286);if(_0xd7026a[_0xfa95('0x5a')]){_0x3b69ed(ut[_0xfa95('0x38')](_0xfa95('0x5b')));}else{_0x4d9f79(ut[_0xfa95('0x38')](_0xd7026a[_0xfa95('0x38')]));}});};function originate(_0x40af2e,_0x3cae50,_0x180d77){return new BPromise(function(_0x31f49b,_0x4abdfd){if(_0x180d77){var _0x4d9993=util[_0xfa95('0x5c')](_0xfa95('0x5d'),path[_0xfa95('0x39')](_0x40af2e['path'])[_0xfa95('0x27')],_0x40af2e['path']);gs[_0xfa95('0x5e')](_0x4d9993)['then'](function(){_0x40af2e[_0xfa95('0x4')]=util[_0xfa95('0x5c')](_0xfa95('0x5f'),path[_0xfa95('0x39')](_0x40af2e['path'])[_0xfa95('0x60')],path[_0xfa95('0x39')](_0x40af2e['path'])[_0xfa95('0x27')]);_0x3cae50[_0xfa95('0x61')]=_0x40af2e[_0xfa95('0x4')];ut[_0xfa95('0x48')](_0xfa95('0x62'),'');ami['Action'](ut[_0xfa95('0x63')](_0x40af2e,_0x3cae50))[_0xfa95('0x3b')](function(_0xa0c3f0){_0x31f49b(_0xa0c3f0);})[_0xfa95('0x3d')](function(_0x5580eb){_0x4abdfd(_0x5580eb);});})['catch'](function(_0x35f1b2){_0x4abdfd(_0x35f1b2);});}else{ami[_0xfa95('0x64')](ut[_0xfa95('0x63')](_0x40af2e,_0x3cae50))[_0xfa95('0x3b')](function(_0x2a5b75){_0x31f49b(_0x2a5b75);})[_0xfa95('0x3d')](function(_0x28e0d8){_0x4abdfd(_0x28e0d8);});}});}Fax['prototype'][_0xfa95('0x55')]=function(_0x4d42ee,_0x2f0c4c){var _0x1e99e7=this;return new BPromise(function(_0xff5af6,_0xea5dc8){var _0x29da9a=uuid['v4']();var _0x31a7bd=ut[_0xfa95('0x65')](_0x4d42ee,_0x2f0c4c);_0x1e99e7[_0xfa95('0x10')][_0x29da9a]=new Action(_0x29da9a,_0x2f0c4c,_0x4d42ee);var _0x548dd3=_0x1e99e7[_0xfa95('0x10')][_0x29da9a];if(path['parse'](_0x4d42ee[_0xfa95('0x4')])[_0xfa95('0x66')]===_0xfa95('0x67')){originate(_0x548dd3,_0x31a7bd,!![])[_0xfa95('0x3b')](function(_0x253bb4){_0xff5af6(_0x253bb4);})[_0xfa95('0x3d')](function(_0x32eb70){_0xea5dc8(_0x32eb70);});}else{originate(_0x548dd3,_0x31a7bd,![])[_0xfa95('0x3b')](function(_0x533801){_0xff5af6(_0x533801);})['catch'](function(_0x17f083){_0xea5dc8(_0x17f083);});}});};Fax[_0xfa95('0x20')][_0xfa95('0x68')]=function(_0x3a89eb){return!_[_0xfa95('0x69')](_0x3a89eb)&&!_['isNil'](_0x3a89eb[_0xfa95('0x27')])&&!_['isNil'](_0x3a89eb['active'])&&_0x3a89eb[_0xfa95('0x6a')]&&!_['isNil'](this['trunks'][util[_0xfa95('0x5c')]('SIP/%s',_0x3a89eb[_0xfa95('0x27')])])&&!_[_0xfa95('0x69')](this[_0xfa95('0xf')][util[_0xfa95('0x5c')](_0xfa95('0x6b'),_0x3a89eb['name'])][_0xfa95('0x2e')])&&(this['trunks'][util['format'](_0xfa95('0x6b'),_0x3a89eb[_0xfa95('0x27')])][_0xfa95('0x2e')]===_0xfa95('0x6c')||this[_0xfa95('0xf')][util[_0xfa95('0x5c')](_0xfa95('0x6b'),_0x3a89eb[_0xfa95('0x27')])]['status']===_0xfa95('0x6d'));};Fax[_0xfa95('0x20')]['checkTrunk']=function(_0x4fd7f2,_0x2f4cf3){if(!this['isTrunkReachable'](_0x4fd7f2)){ut[_0xfa95('0x48')](_0xfa95('0x6e'),_['isNil'](_0x4fd7f2)?'':_0x4fd7f2['name']+_0xfa95('0x6f'));return{'isValid':![],'message':_0xfa95('0x70')};}if(_[_0xfa95('0x69')](_0x2f4cf3[_0xfa95('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xfa95('0x3f')](_0x2f4cf3));return{'isValid':![],'message':_0xfa95('0x71')};}if(_['isNil'](_0x2f4cf3['path'])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0xfa95('0x3f')](_0x2f4cf3));return{'isValid':![],'message':_0xfa95('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xfa95('0x73')]=Fax; \ No newline at end of file +var _0xc7ea=['util','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','prototype','channelstate','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isNil','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports'];(function(_0x7a502,_0x3c3e75){var _0x39bbbc=function(_0x2eb9a7){while(--_0x2eb9a7){_0x7a502['push'](_0x7a502['shift']());}};_0x39bbbc(++_0x3c3e75);}(_0xc7ea,0xe8));var _0xac7e=function(_0x32a370,_0x4dab40){_0x32a370=_0x32a370-0x0;var _0x358b58=_0xc7ea[_0x32a370];return _0x358b58;};'use strict';var util=require(_0xac7e('0x0'));var _=require('lodash');var BPromise=require(_0xac7e('0x1'));var uuid=require(_0xac7e('0x2'));var moment=require(_0xac7e('0x3'));var path=require(_0xac7e('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xac7e('0x5'));var logger=require(_0xac7e('0x6'))(_0xac7e('0x7'));var ami=require(_0xac7e('0x8'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0xac7e('0x9'));var faxAccount=require(_0xac7e('0xa'));var attachment=require(_0xac7e('0xb'));var faxMessage=require(_0xac7e('0xc'));function Fax(_0x1f8280){this[_0xac7e('0xd')]={};this[_0xac7e('0xe')]=_0x1f8280[_0xac7e('0xe')];this[_0xac7e('0xf')]=_0x1f8280['trunks'];this['actions']={};ami['on'](_0xac7e('0x10'),this[_0xac7e('0x11')][_0xac7e('0x12')](this));ami['on'](_0xac7e('0x13'),this[_0xac7e('0x14')]['bind'](this));ami['on'](_0xac7e('0x15'),this[_0xac7e('0x16')][_0xac7e('0x12')](this));ami['on']('newexten',this['syncNewExten'][_0xac7e('0x12')](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on'](_0xac7e('0x17'),this[_0xac7e('0x18')][_0xac7e('0x12')](this));ami['on'](_0xac7e('0x19'),this[_0xac7e('0x1a')]['bind'](this));ami['on']('originateresponse',this[_0xac7e('0x1b')][_0xac7e('0x12')](this));}Fax['prototype'][_0xac7e('0x11')]=function(_0x2e31bb){if(_0x2e31bb[_0xac7e('0x1c')]==='from-voip-provider'){for(var _0x3d7ced in this['faxAccounts']){if(this['faxAccounts'][_0xac7e('0x1d')](_0x3d7ced)){if(_0x2e31bb[_0xac7e('0x1e')]===this[_0xac7e('0xe')][_0x3d7ced][_0xac7e('0x1f')]){this[_0xac7e('0xd')][_0x2e31bb[_0xac7e('0x20')]]={};this[_0xac7e('0xd')][_0x2e31bb[_0xac7e('0x20')]][_0xac7e('0x21')]=_0x2e31bb[_0xac7e('0x21')];this[_0xac7e('0xd')][_0x2e31bb['uniqueid']]['id']=this['faxAccounts'][_0x3d7ced]['id'];this[_0xac7e('0xd')][_0x2e31bb[_0xac7e('0x20')]][_0xac7e('0x22')]=this[_0xac7e('0xe')][_0x3d7ced][_0xac7e('0x22')];logger[_0xac7e('0x23')](_0x2e31bb[_0xac7e('0x20')],_0xac7e('0x24'));}}}}if(this[_0xac7e('0x25')][_0x2e31bb[_0xac7e('0x20')]]){this['channels'][_0x2e31bb[_0xac7e('0x20')]]={};this[_0xac7e('0xd')][_0x2e31bb[_0xac7e('0x20')]][_0xac7e('0x21')]=_0x2e31bb['channel'];logger[_0xac7e('0x23')](_0x2e31bb['uniqueid'],_0xac7e('0x24'));}};Fax['prototype'][_0xac7e('0x14')]=function(_0xc55627){if(this[_0xac7e('0xd')][_0xc55627['uniqueid']]){for(var _0x14ea70 in _0xc55627[_0xac7e('0x26')]){if(_0xc55627[_0xac7e('0x26')]['hasOwnProperty'](_0x14ea70)){this[_0xac7e('0xd')][_0xc55627[_0xac7e('0x20')]][_0x14ea70]=_0xc55627[_0xac7e('0x27')];}}}};Fax[_0xac7e('0x28')][_0xac7e('0x16')]=function(_0x2c0414){if(this['channels'][_0x2c0414[_0xac7e('0x20')]]){this[_0xac7e('0xd')][_0x2c0414[_0xac7e('0x20')]][_0xac7e('0x29')]=_0x2c0414['channelstate'];this[_0xac7e('0xd')][_0x2c0414['uniqueid']][_0xac7e('0x2a')]=_0x2c0414[_0xac7e('0x2a')];}};Fax[_0xac7e('0x28')][_0xac7e('0x2b')]=function(_0xaa2ac4){if(this[_0xac7e('0xd')][_0xaa2ac4[_0xac7e('0x20')]]){for(var _0x2c2815 in _0xaa2ac4[_0xac7e('0x26')]){if(_0xaa2ac4['variable'][_0xac7e('0x1d')](_0x2c2815)){this['channels'][_0xaa2ac4[_0xac7e('0x20')]][_0x2c2815]=_0xaa2ac4[_0xac7e('0x27')];}}}};Fax['prototype'][_0xac7e('0x2c')]=function(_0x6911c){if(this[_0xac7e('0xd')][_0x6911c[_0xac7e('0x20')]]){this[_0xac7e('0xd')][_0x6911c['uniqueid']]['operation']=_0x6911c[_0xac7e('0x2d')];this[_0xac7e('0xd')][_0x6911c[_0xac7e('0x20')]]['status']=_0x6911c[_0xac7e('0x2e')];this[_0xac7e('0xd')][_0x6911c[_0xac7e('0x20')]][_0xac7e('0x1f')]=_0x6911c[_0xac7e('0x1f')];this['channels'][_0x6911c[_0xac7e('0x20')]][_0xac7e('0x2f')]=_0x6911c[_0xac7e('0x2f')];logger[_0xac7e('0x23')](_0x6911c['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0xac7e('0x28')][_0xac7e('0x18')]=function(_0x4ca995){var _0x1be327=this;if(this['channels'][_0x4ca995[_0xac7e('0x20')]]){var _0x1fdfed=this['channels'][_0x4ca995['uniqueid']]['id'];this[_0xac7e('0xd')][_0x4ca995['uniqueid']][_0xac7e('0x30')]=_0x4ca995['remotestationid'];this[_0xac7e('0xd')][_0x4ca995['uniqueid']][_0xac7e('0x31')]=_0x4ca995['pagestransferred'];this[_0xac7e('0xd')][_0x4ca995['uniqueid']][_0xac7e('0x1f')]=_0x4ca995[_0xac7e('0x1f')];this[_0xac7e('0xd')][_0x4ca995[_0xac7e('0x20')]][_0xac7e('0x32')]=_0x4ca995[_0xac7e('0x32')];this['channels'][_0x4ca995[_0xac7e('0x20')]][_0xac7e('0x33')]=_0x4ca995[_0xac7e('0x33')];this[_0xac7e('0xd')][_0x4ca995[_0xac7e('0x20')]][_0xac7e('0x2f')]=_0x4ca995[_0xac7e('0x2f')];this[_0xac7e('0xd')][_0x4ca995['uniqueid']][_0xac7e('0x34')]=_0x4ca995[_0xac7e('0x34')];if(this[_0xac7e('0xd')][_0x4ca995[_0xac7e('0x20')]]['pagestransferred']>0x0){tiff2pdf(_0x4ca995['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x7685bf){logger[_0xac7e('0x23')](_0x4ca995[_0xac7e('0x20')],_0xac7e('0x35'),_0x7685bf[_0xac7e('0x36')]);attachment[_0xac7e('0x37')]({'name':path['parse'](_0x4ca995[_0xac7e('0x2f')])[_0xac7e('0x22')],'basename':path[_0xac7e('0x38')](_0x4ca995[_0xac7e('0x2f')])[_0xac7e('0x22')]+_0xac7e('0x39'),'type':_0xac7e('0x3a')})[_0xac7e('0x3b')](function(_0x5736b4){faxAccount[_0xac7e('0x3c')](_0x1fdfed,{'from':_0x4ca995['calleridnum'],'mapKey':_0xac7e('0x7'),'body':path[_0xac7e('0x38')](_0x4ca995['filename'])[_0xac7e('0x22')]+_0xac7e('0x39'),'AttachmentId':_0x5736b4['id']})[_0xac7e('0x3d')](function(_0x4574bf){logger['error'](_0x4ca995[_0xac7e('0x20')],_0xac7e('0x3e'),JSON[_0xac7e('0x3f')](_0x4574bf));});})['catch'](function(_0x18094c){logger[_0xac7e('0x40')](_0x4ca995[_0xac7e('0x20')],'\x20receiveFax\x20',JSON[_0xac7e('0x3f')](_0x18094c));});});}logger[_0xac7e('0x23')](_0x4ca995[_0xac7e('0x20')],_0xac7e('0x41'));}};Fax[_0xac7e('0x28')][_0xac7e('0x1b')]=function(_0x52e2fc){if(this[_0xac7e('0x25')][_0x52e2fc[_0xac7e('0x20')]]){_[_0xac7e('0x42')](this['channels'][_0x52e2fc[_0xac7e('0x20')]],_[_0xac7e('0x43')](_0x52e2fc,[_0xac7e('0x44'),_0xac7e('0x45')]));}};function updateStatus(_0x53bea6){if(_0x53bea6[_0xac7e('0x46')]){faxMessage['update'](_0x53bea6[_0xac7e('0x46')],{'failMessage':_0xac7e('0x47')})[_0xac7e('0x3b')](function(_0x18faee){ut[_0xac7e('0x48')]('[Fax][Message][Error][Updated]',_0x18faee);})['catch'](function(_0x28a88f){ut['logger'](_0xac7e('0x49'),_0x28a88f);});}else{ut[_0xac7e('0x48')](_0xac7e('0x4a'));}}Fax['prototype'][_0xac7e('0x4b')]=function(_0x5e9265,_0x50d933,_0x3eac3f){var _0x282008=this;var _0x689779={};if(_0x50d933){_0x689779={'read':_0x50d933};}else{_0x689779={'failMessage':_0x3eac3f};}if(this['actions'][_0x5e9265][_0xac7e('0x46')]){faxMessage['update'](this[_0xac7e('0x25')][_0x5e9265][_0xac7e('0x46')],_0x689779)['then'](function(_0x50983b){ut[_0xac7e('0x48')]('[Fax][Message][Updated]',_0x50983b);})['catch'](function(_0x34ea25){ut[_0xac7e('0x48')](_0xac7e('0x4c'),_0x34ea25);})[_0xac7e('0x4d')](function(){delete _0x282008[_0xac7e('0xd')][_0x5e9265];delete _0x282008[_0xac7e('0x25')][_0x5e9265];});}else{ut['logger'](_0xac7e('0x4e'));delete this[_0xac7e('0xd')][_0x5e9265];delete this[_0xac7e('0x25')][_0x5e9265];}};Fax[_0xac7e('0x28')][_0xac7e('0x1a')]=function(_0x7f079f){var _0x10581d=this;if(this[_0xac7e('0xd')][_0x7f079f[_0xac7e('0x20')]]){if(this[_0xac7e('0x25')][_0x7f079f[_0xac7e('0x20')]]){this[_0xac7e('0xd')][_0x7f079f['uniqueid']]['id']=this[_0xac7e('0x25')][_0x7f079f[_0xac7e('0x20')]]['id'];this['channels'][_0x7f079f[_0xac7e('0x20')]][_0xac7e('0x22')]=this[_0xac7e('0x25')][_0x7f079f['uniqueid']]['name'];}logger[_0xac7e('0x23')](_0x7f079f['uniqueid'],this[_0xac7e('0x25')][_0x7f079f[_0xac7e('0x20')]]?_0xac7e('0x4f'):_0xac7e('0x50'),JSON[_0xac7e('0x3f')](this['channels'][_0x7f079f['uniqueid']]));if(this['actions'][_0x7f079f[_0xac7e('0x20')]]){if(this[_0xac7e('0xd')][_0x7f079f[_0xac7e('0x20')]]['faxpages']>0x0&&this['channels'][_0x7f079f[_0xac7e('0x20')]][_0xac7e('0x51')]===_0xac7e('0x52')){this[_0xac7e('0x4b')](_0x7f079f[_0xac7e('0x20')],!![]);}else{this[_0xac7e('0x4b')](_0x7f079f[_0xac7e('0x20')],![],this[_0xac7e('0xd')][_0x7f079f[_0xac7e('0x20')]][_0xac7e('0x53')]?_0xac7e('0x54')+this[_0xac7e('0xd')][_0x7f079f[_0xac7e('0x20')]][_0xac7e('0x53')]:_0xac7e('0x55'));}}}};Fax[_0xac7e('0x28')][_0xac7e('0x56')]=function(_0x557c8d){var _0xeeb2b7=this;return new BPromise(function(_0xddb5a0,_0x305546){_0xeeb2b7[_0xac7e('0x57')](_0x557c8d,_0xeeb2b7['faxAccounts'][_0x557c8d[_0xac7e('0x58')]])[_0xac7e('0x3b')](function(_0x3e8fd2){ut[_0xac7e('0x48')](_0xac7e('0x59'),_0x3e8fd2);_0xddb5a0(ut[_0xac7e('0x36')]('Fax\x20received'));})[_0xac7e('0x3d')](function(_0x394292){ut[_0xac7e('0x48')](_0xac7e('0x5a'),_0x394292);updateStatus(_0x557c8d);_0x305546(ut['message'](_0xac7e('0x5b')));});});};Fax['prototype'][_0xac7e('0x5c')]=function(_0x415a97){var _0x532109=this;return new BPromise(function(_0x35bad2,_0x3df4d8){var _0x4776e8=_0x532109[_0xac7e('0x5d')](_0x532109[_0xac7e('0xe')][_0x415a97[_0xac7e('0x58')]][_0xac7e('0x5e')],_0x415a97);if(_0x4776e8[_0xac7e('0x5f')]){_0x35bad2(ut['message']('Trunk\x20Reachable'));}else{_0x3df4d8(ut[_0xac7e('0x36')](_0x4776e8[_0xac7e('0x36')]));}});};function originate(_0x55487d,_0x5a8514,_0x3b11a7){return new BPromise(function(_0x180ad1,_0x1c39fb){if(_0x3b11a7){var _0x27f8cc=util['format'](_0xac7e('0x60'),path['parse'](_0x55487d[_0xac7e('0x4')])[_0xac7e('0x22')],_0x55487d[_0xac7e('0x4')]);gs[_0xac7e('0x61')](_0x27f8cc)['then'](function(){_0x55487d[_0xac7e('0x4')]=util[_0xac7e('0x62')]('%s/%s.tif',path[_0xac7e('0x38')](_0x55487d[_0xac7e('0x4')])[_0xac7e('0x63')],path['parse'](_0x55487d[_0xac7e('0x4')])['name']);_0x5a8514[_0xac7e('0x64')]=_0x55487d['path'];ut[_0xac7e('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0xac7e('0x65')](ut[_0xac7e('0x66')](_0x55487d,_0x5a8514))[_0xac7e('0x3b')](function(_0x1c8b1a){_0x180ad1(_0x1c8b1a);})[_0xac7e('0x3d')](function(_0x5a4c9c){_0x1c39fb(_0x5a4c9c);});})[_0xac7e('0x3d')](function(_0x441a1e){_0x1c39fb(_0x441a1e);});}else{ami[_0xac7e('0x65')](ut[_0xac7e('0x66')](_0x55487d,_0x5a8514))[_0xac7e('0x3b')](function(_0x4bd032){_0x180ad1(_0x4bd032);})[_0xac7e('0x3d')](function(_0x3c8ba){_0x1c39fb(_0x3c8ba);});}});}Fax['prototype']['execOriginate']=function(_0x273f39,_0x3eec87){var _0x39c9c4=this;return new BPromise(function(_0x4558da,_0x5a0993){var _0x45ecc3=uuid['v4']();var _0xbf8bc5=ut[_0xac7e('0x67')](_0x273f39,_0x3eec87);_0x39c9c4[_0xac7e('0x25')][_0x45ecc3]=new Action(_0x45ecc3,_0x3eec87,_0x273f39);var _0x3ff8c8=_0x39c9c4['actions'][_0x45ecc3];if(path[_0xac7e('0x38')](_0x273f39[_0xac7e('0x4')])[_0xac7e('0x68')]===_0xac7e('0x39')){originate(_0x3ff8c8,_0xbf8bc5,!![])[_0xac7e('0x3b')](function(_0x5a10cb){_0x4558da(_0x5a10cb);})[_0xac7e('0x3d')](function(_0x593c3f){_0x5a0993(_0x593c3f);});}else{originate(_0x3ff8c8,_0xbf8bc5,![])[_0xac7e('0x3b')](function(_0x1f68c3){_0x4558da(_0x1f68c3);})[_0xac7e('0x3d')](function(_0x499378){_0x5a0993(_0x499378);});}});};Fax[_0xac7e('0x28')]['isTrunkReachable']=function(_0x4aec94){return!_[_0xac7e('0x69')](_0x4aec94)&&!_[_0xac7e('0x69')](_0x4aec94[_0xac7e('0x22')])&&!_['isNil'](_0x4aec94['active'])&&_0x4aec94['active']&&!_[_0xac7e('0x69')](this[_0xac7e('0xf')][util[_0xac7e('0x62')]('SIP/%s',_0x4aec94['name'])])&&!_[_0xac7e('0x69')](this[_0xac7e('0xf')][util[_0xac7e('0x62')](_0xac7e('0x6a'),_0x4aec94[_0xac7e('0x22')])]['status'])&&(this[_0xac7e('0xf')][util[_0xac7e('0x62')](_0xac7e('0x6a'),_0x4aec94[_0xac7e('0x22')])][_0xac7e('0x2e')]===_0xac7e('0x6b')||this[_0xac7e('0xf')][util['format']('SIP/%s',_0x4aec94['name'])][_0xac7e('0x2e')]===_0xac7e('0x6c'));};Fax[_0xac7e('0x28')]['checkTrunk']=function(_0x1d6e76,_0x1fce61){if(!this[_0xac7e('0x6d')](_0x1d6e76)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xac7e('0x69')](_0x1d6e76)?'':_0x1d6e76['name']+_0xac7e('0x6e'));return{'isValid':![],'message':_0xac7e('0x6f')};}if(_['isNil'](_0x1fce61[_0xac7e('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xac7e('0x3f')](_0x1fce61));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x1fce61[_0xac7e('0x4')])){ut['logger'](_0xac7e('0x70'),JSON[_0xac7e('0x3f')](_0x1fce61));return{'isValid':![],'message':_0xac7e('0x71')};}return{'isValid':!![],'message':_0xac7e('0x72')};};module[_0xac7e('0x73')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index e9a38bb..e8670cd 100644 --- a/server/services/ami/fax/rpcDb.js +++ b/server/services/ami/fax/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8ef=['lodash','../rpc/faxAccount','notify','resolve','then','catch','bluebird','preview'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xe8ef,0x1ae));var _0xfe8e=function(_0x59bbe9,_0x4a631b){_0x59bbe9=_0x59bbe9-0x0;var _0x46535e=_0xe8ef[_0x59bbe9];return _0x46535e;};'use strict';var util=require('util');var BPromise=require(_0xfe8e('0x0'));var logger=require('../../../config/logger')(_0xfe8e('0x1'));var _=require(_0xfe8e('0x2'));var faxAccount=require(_0xfe8e('0x3'));function loggerCatch(_0x4cc321){return function(_0x4f4626){logger['error'](_0x4cc321,util['inspect'](_0x4f4626,{'showHidden':![],'depth':null}));};}exports[_0xfe8e('0x4')]=function(_0x1b1b03,_0x276fb7){return BPromise[_0xfe8e('0x5')]()[_0xfe8e('0x6')](faxAccount[_0xfe8e('0x4')](_0x1b1b03,_0x276fb7))[_0xfe8e('0x7')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x0f90=['../../../config/logger','lodash','inspect','notify','resolve','then','catch','[Notify]\x20','util'];(function(_0x198ed8,_0x1c0ba3){var _0x3f031c=function(_0x43dd9a){while(--_0x43dd9a){_0x198ed8['push'](_0x198ed8['shift']());}};_0x3f031c(++_0x1c0ba3);}(_0x0f90,0xb3));var _0x00f9=function(_0x4c1e76,_0x430881){_0x4c1e76=_0x4c1e76-0x0;var _0x59b5a7=_0x0f90[_0x4c1e76];return _0x59b5a7;};'use strict';var util=require(_0x00f9('0x0'));var BPromise=require('bluebird');var logger=require(_0x00f9('0x1'))('preview');var _=require(_0x00f9('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x259b8b){return function(_0x3a261f){logger['error'](_0x259b8b,util[_0x00f9('0x3')](_0x3a261f,{'showHidden':![],'depth':null}));};}exports[_0x00f9('0x4')]=function(_0x1b4799,_0x181076){return BPromise[_0x00f9('0x5')]()[_0x00f9('0x6')](faxAccount[_0x00f9('0x4')](_0x1b4799,_0x181076))[_0x00f9('0x7')](loggerCatch(_0x00f9('0x8')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index e8d3b91..19b5ef2 100644 --- a/server/services/ami/fax/util/gs.js +++ b/server/services/ami/fax/util/gs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6781=['util','../../../../config/logger','fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x1f55ff,_0x420354){var _0x3055b1=function(_0x42a1b1){while(--_0x42a1b1){_0x1f55ff['push'](_0x1f55ff['shift']());}};_0x3055b1(++_0x420354);}(_0x6781,0x190));var _0x1678=function(_0x9133a,_0x263b44){_0x9133a=_0x9133a-0x0;var _0x215b54=_0x6781[_0x9133a];return _0x215b54;};'use strict';var util=require(_0x1678('0x0'));var logger=require(_0x1678('0x1'))(_0x1678('0x2'));var BPromise=require(_0x1678('0x3'));var exec=require(_0x1678('0x4'))['exec'];exports[_0x1678('0x5')]=function(_0x17079b){return new BPromise(function(_0x2659e9,_0x3106a8){exec(_0x17079b,function(_0x224057,_0x540e8b,_0xf71e3){logger[_0x1678('0x6')]('Exec\x20gs',_0x540e8b);if(_0x224057){logger[_0x1678('0x6')](_0x1678('0x7'),_0x1678('0x8'),util[_0x1678('0x9')](_0x224057,{'showHidden':![],'depth':null}),_0x540e8b,_0xf71e3);_0x3106a8(_0x224057);}_0x2659e9(_0x540e8b);});});}; \ No newline at end of file +var _0x6d63=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','bluebird','child_process','exec'];(function(_0x9c31ca,_0x90bff1){var _0x51941c=function(_0x14706a){while(--_0x14706a){_0x9c31ca['push'](_0x9c31ca['shift']());}};_0x51941c(++_0x90bff1);}(_0x6d63,0xef));var _0x36d6=function(_0x1e0209,_0x1088ef){_0x1e0209=_0x1e0209-0x0;var _0x2de180=_0x6d63[_0x1e0209];return _0x2de180;};'use strict';var util=require(_0x36d6('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x36d6('0x1'));var exec=require(_0x36d6('0x2'))[_0x36d6('0x3')];exports[_0x36d6('0x4')]=function(_0x5d0449){return new BPromise(function(_0x5221d6,_0x14fa3b){exec(_0x5d0449,function(_0x366c3d,_0x2c0b8f,_0x6736b1){logger[_0x36d6('0x5')](_0x36d6('0x6'),_0x2c0b8f);if(_0x366c3d){logger['info']('Exec\x20gs',_0x36d6('0x7'),util[_0x36d6('0x8')](_0x366c3d,{'showHidden':![],'depth':null}),_0x2c0b8f,_0x6736b1);_0x14fa3b(_0x366c3d);}_0x5221d6(_0x2c0b8f);});});}; \ No newline at end of file diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js index 4810baa..828465d 100644 --- a/server/services/ami/fax/util/util.js +++ b/server/services/ami/fax/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6367=['localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','format','\x22%s\x22\x20<%s>','lodash','../../../../config/logger','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','\x22%s\x22','gateway','faxdetect'];(function(_0x2f3982,_0x27d5e6){var _0x307256=function(_0x249063){while(--_0x249063){_0x2f3982['push'](_0x2f3982['shift']());}};_0x307256(++_0x27d5e6);}(_0x6367,0x1d5));var _0x7636=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6367[_0x4cf98e];return _0x1623ac;};'use strict';var util=require('util');var _=require(_0x7636('0x0'));var moment=require('moment');var logger=require(_0x7636('0x1'))(_0x7636('0x2'));exports[_0x7636('0x3')]=function(_0x42b2f0){return{'message':_0x42b2f0};};exports[_0x7636('0x4')]=function(_0x56442f,_0x2e205c){logger[_0x7636('0x5')](_0x56442f,util[_0x7636('0x6')](_0x2e205c,{'showHidden':![],'depth':null}));};exports[_0x7636('0x7')]=function(_0x5297d0,_0x2e1ce7){var _0x529c46={'XMF-ECM':_0x2e1ce7['ecm'],'XMF-HEADERINFO':_0x2e1ce7[_0x7636('0x8')],'XMF-MINRATE':_0x2e1ce7[_0x7636('0x9')],'XMF-MAXRATE':_0x2e1ce7[_0x7636('0xa')],'XMF-MODEM':util['format'](_0x7636('0xb'),_0x2e1ce7['modem']),'XMF-GATEWAY':_0x2e1ce7[_0x7636('0xc')],'XMF-FAXDETECT':_0x2e1ce7[_0x7636('0xd')],'XMF-T38TIMEOUT':_0x2e1ce7['t38timeout'],'XMF-LOCALSTATIONID':_0x2e1ce7[_0x7636('0xe')],'XMF-PATH':_0x5297d0[_0x7636('0xf')]};return _0x529c46;};exports[_0x7636('0x10')]=function(_0x2f7e28,_0x467ca4){return{'actionid':_0x2f7e28[_0x7636('0x11')],'action':_0x7636('0x12'),'channel':_0x2f7e28[_0x7636('0x13')],'Exten':_0x7636('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0x7636('0x15')](_0x7636('0x16'),_0x2f7e28['headerinfo']?_0x2f7e28[_0x7636('0x8')]:'',_0x2f7e28[_0x7636('0xe')]),'variable':_0x467ca4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2f7e28['uniqueid']};}; \ No newline at end of file +var _0x7fe7=['fax','message','logger','info','inspect','ecm','headerinfo','maxrate','format','modem','gateway','t38timeout','localstationid','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','moment'];(function(_0x3b10df,_0x46d3ec){var _0x50501e=function(_0x28b8b5){while(--_0x28b8b5){_0x3b10df['push'](_0x3b10df['shift']());}};_0x50501e(++_0x46d3ec);}(_0x7fe7,0x1b7));var _0x77fe=function(_0x30cb96,_0x31b9e1){_0x30cb96=_0x30cb96-0x0;var _0xeff506=_0x7fe7[_0x30cb96];return _0xeff506;};'use strict';var util=require(_0x77fe('0x0'));var _=require('lodash');var moment=require(_0x77fe('0x1'));var logger=require('../../../../config/logger')(_0x77fe('0x2'));exports[_0x77fe('0x3')]=function(_0x5055d3){return{'message':_0x5055d3};};exports[_0x77fe('0x4')]=function(_0x1e70ba,_0xea6ce3){logger[_0x77fe('0x5')](_0x1e70ba,util[_0x77fe('0x6')](_0xea6ce3,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x13c712,_0x5cf1c6){var _0x3e2431={'XMF-ECM':_0x5cf1c6[_0x77fe('0x7')],'XMF-HEADERINFO':_0x5cf1c6[_0x77fe('0x8')],'XMF-MINRATE':_0x5cf1c6['minrate'],'XMF-MAXRATE':_0x5cf1c6[_0x77fe('0x9')],'XMF-MODEM':util[_0x77fe('0xa')]('\x22%s\x22',_0x5cf1c6[_0x77fe('0xb')]),'XMF-GATEWAY':_0x5cf1c6[_0x77fe('0xc')],'XMF-FAXDETECT':_0x5cf1c6['faxdetect'],'XMF-T38TIMEOUT':_0x5cf1c6[_0x77fe('0xd')],'XMF-LOCALSTATIONID':_0x5cf1c6[_0x77fe('0xe')],'XMF-PATH':_0x13c712['path']};return _0x3e2431;};exports[_0x77fe('0xf')]=function(_0x15a9d8,_0xa315c4){return{'actionid':_0x15a9d8[_0x77fe('0x10')],'action':_0x77fe('0x11'),'channel':_0x15a9d8['channel'],'Exten':_0x77fe('0x12'),'Context':_0x77fe('0x13'),'Priority':'1','callerid':util[_0x77fe('0xa')](_0x77fe('0x14'),_0x15a9d8[_0x77fe('0x8')]?_0x15a9d8[_0x77fe('0x8')]:'',_0x15a9d8[_0x77fe('0xe')]),'variable':_0xa315c4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x15a9d8['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 359fbba..cad2b6d 100644 --- a/server/services/ami/index.js +++ b/server/services/ami/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x883a=['./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','hour','get','getAgents','initAgents','then','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','inspect','util','moment','./server','./realtime','./report','./acw'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x883a,0x1bc));var _0xa883=function(_0x193b87,_0x66e5c6){_0x193b87=_0x193b87-0x0;var _0x54e4a0=_0x883a[_0x193b87];return _0x54e4a0;};'use strict';var util=require(_0xa883('0x0'));var moment=require(_0xa883('0x1'));var server=require(_0xa883('0x2'));var Realtime=require(_0xa883('0x3'));var Report=require(_0xa883('0x4'));var Acw=require(_0xa883('0x5'));var Trigger=require(_0xa883('0x6'));var Dialer=require(_0xa883('0x7'));var Preview=require('./preview');var Fax=require(_0xa883('0x8'));var user=require(_0xa883('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xa883('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xa883('0xb'));var trigger=require(_0xa883('0xc'));var template=require('./rpc/template');var cmHopperHistory=require(_0xa883('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xa883('0xe'));var faxAccount=require(_0xa883('0xf'));var zendesk=require(_0xa883('0x10'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xa883('0x11'));var freshdesk=require(_0xa883('0x12'));var desk=require(_0xa883('0x13'));var zoho=require(_0xa883('0x14'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xa883('0x15'));var servicenow=require(_0xa883('0x16'));var dynamics365=require(_0xa883('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xa883('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xa883('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa883('0x1a')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()['then'](user[_0xa883('0x1b')]())['then'](realtime[_0xa883('0x1c')]())[_0xa883('0x1d')](user[_0xa883('0x1e')]())[_0xa883('0x1d')](realtime['initTelephones']())[_0xa883('0x1d')](trunk['getTrunks']())[_0xa883('0x1d')](realtime[_0xa883('0x1f')]())['then'](voiceQueue[_0xa883('0x20')]())[_0xa883('0x1d')](realtime[_0xa883('0x21')]())[_0xa883('0x1d')](trigger[_0xa883('0x22')]())[_0xa883('0x1d')](realtime[_0xa883('0x23')]())[_0xa883('0x1d')](template['getTemplates']())[_0xa883('0x1d')](realtime[_0xa883('0x24')]())['then'](zendesk['getZendeskAccounts']())[_0xa883('0x1d')](realtime[_0xa883('0x25')]())['then'](salesforce[_0xa883('0x26')]())[_0xa883('0x1d')](realtime[_0xa883('0x27')]())['then'](sugarcrm[_0xa883('0x28')]())[_0xa883('0x1d')](realtime[_0xa883('0x29')]())[_0xa883('0x1d')](freshdesk['getFreshdeskAccounts']())[_0xa883('0x1d')](realtime[_0xa883('0x2a')]())[_0xa883('0x1d')](desk[_0xa883('0x2b')]())[_0xa883('0x1d')](realtime[_0xa883('0x2c')]())[_0xa883('0x1d')](zoho[_0xa883('0x2d')]())[_0xa883('0x1d')](realtime[_0xa883('0x2e')]())['then'](vtiger[_0xa883('0x2f')]())['then'](realtime['initVtigerAccounts']())[_0xa883('0x1d')](freshsales[_0xa883('0x30')]())['then'](realtime[_0xa883('0x31')]())[_0xa883('0x1d')](servicenow['getServicenowAccounts']())[_0xa883('0x1d')](realtime[_0xa883('0x32')]())[_0xa883('0x1d')](dynamics365[_0xa883('0x33')]())['then'](realtime[_0xa883('0x34')]())[_0xa883('0x1d')](campaign[_0xa883('0x35')]())['then'](realtime[_0xa883('0x36')]())[_0xa883('0x1d')](voiceExtension[_0xa883('0x37')]())[_0xa883('0x1d')](realtime[_0xa883('0x38')]())['then'](faxAccount[_0xa883('0x39')]())[_0xa883('0x1d')](realtime[_0xa883('0x3a')]())[_0xa883('0x1d')](function(){return realtime;});}function initParams(){return Promise[_0xa883('0x3b')]()[_0xa883('0x1d')](voiceQueueReport[_0xa883('0x3c')]())[_0xa883('0x1d')](realtime[_0xa883('0x3d')]())[_0xa883('0x1d')](cmHopperHistory[_0xa883('0x3e')]())[_0xa883('0x1d')](realtime[_0xa883('0x3f')]())[_0xa883('0x1d')](cmHopperHistory[_0xa883('0x40')]())[_0xa883('0x1d')](realtime[_0xa883('0x41')]())[_0xa883('0x1d')](voiceCallReport[_0xa883('0x42')]())[_0xa883('0x1d')](realtime[_0xa883('0x43')]())[_0xa883('0x44')](function(_0x5b99d9){logger[_0xa883('0x45')](_0xa883('0x46'),util['inspect'](_0x5b99d9,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa883('0x47')](realtime,preview,fax)[_0xa883('0x1d')](function(){return initRealtime();})[_0xa883('0x1d')](function(){return initParams();})[_0xa883('0x1d')](function(){report[_0xa883('0x48')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x99777f){logger['error'](_0xa883('0x49'),util[_0xa883('0x4a')](_0x99777f,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x73ed=['getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','util','moment','./realtime','./report','./acw','./trigger','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','ami','get','hour','then','getAgents'];(function(_0x46e94c,_0x461216){var _0x597221=function(_0x17b6d9){while(--_0x17b6d9){_0x46e94c['push'](_0x46e94c['shift']());}};_0x597221(++_0x461216);}(_0x73ed,0x1a4));var _0xd73e=function(_0x232155,_0x2f87ea){_0x232155=_0x232155-0x0;var _0x19a588=_0x73ed[_0x232155];return _0x19a588;};'use strict';var util=require(_0xd73e('0x0'));var moment=require(_0xd73e('0x1'));var server=require('./server');var Realtime=require(_0xd73e('0x2'));var Report=require(_0xd73e('0x3'));var Acw=require(_0xd73e('0x4'));var Trigger=require(_0xd73e('0x5'));var Dialer=require('./dialer');var Preview=require(_0xd73e('0x6'));var Fax=require('./fax');var user=require(_0xd73e('0x7'));var voiceQueue=require(_0xd73e('0x8'));var voiceQueueReport=require(_0xd73e('0x9'));var voiceCallReport=require(_0xd73e('0xa'));var trunk=require(_0xd73e('0xb'));var trigger=require('./rpc/trigger');var template=require(_0xd73e('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0xd73e('0xd'));var faxAccount=require(_0xd73e('0xe'));var zendesk=require(_0xd73e('0xf'));var salesforce=require(_0xd73e('0x10'));var sugarcrm=require(_0xd73e('0x11'));var freshdesk=require(_0xd73e('0x12'));var desk=require(_0xd73e('0x13'));var zoho=require(_0xd73e('0x14'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xd73e('0x15'));var servicenow=require(_0xd73e('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xd73e('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xd73e('0x18')](_0xd73e('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xd73e('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0xd73e('0x1a')](user[_0xd73e('0x1b')]())['then'](realtime['initAgents']())['then'](user[_0xd73e('0x1c')]())['then'](realtime['initTelephones']())[_0xd73e('0x1a')](trunk[_0xd73e('0x1d')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x1e')]())[_0xd73e('0x1a')](voiceQueue[_0xd73e('0x1f')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x20')]())['then'](trigger[_0xd73e('0x21')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x22')]())[_0xd73e('0x1a')](template['getTemplates']())[_0xd73e('0x1a')](realtime['initTemplates']())[_0xd73e('0x1a')](zendesk[_0xd73e('0x23')]())['then'](realtime[_0xd73e('0x24')]())[_0xd73e('0x1a')](salesforce[_0xd73e('0x25')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x26')]())[_0xd73e('0x1a')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xd73e('0x27')]())[_0xd73e('0x1a')](freshdesk[_0xd73e('0x28')]())[_0xd73e('0x1a')](realtime['initFreshdeskAccounts']())[_0xd73e('0x1a')](desk[_0xd73e('0x29')]())['then'](realtime['initDeskAccounts']())[_0xd73e('0x1a')](zoho['getZohoAccounts']())[_0xd73e('0x1a')](realtime['initZohoAccounts']())[_0xd73e('0x1a')](vtiger[_0xd73e('0x2a')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x2b')]())['then'](freshsales[_0xd73e('0x2c')]())['then'](realtime[_0xd73e('0x2d')]())['then'](servicenow[_0xd73e('0x2e')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0xd73e('0x2f')]())[_0xd73e('0x1a')](realtime['initDynamics365Accounts']())[_0xd73e('0x1a')](campaign[_0xd73e('0x30')]())[_0xd73e('0x1a')](realtime['initCampaigns']())[_0xd73e('0x1a')](voiceExtension[_0xd73e('0x31')]())['then'](realtime['initVoiceExtensions']())[_0xd73e('0x1a')](faxAccount[_0xd73e('0x32')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x33')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xd73e('0x34')]()[_0xd73e('0x1a')](voiceQueueReport[_0xd73e('0x35')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x36')]())['then'](cmHopperHistory[_0xd73e('0x37')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0xd73e('0x1a')](cmHopperHistory[_0xd73e('0x38')]())['then'](realtime[_0xd73e('0x39')]())[_0xd73e('0x1a')](voiceCallReport[_0xd73e('0x3a')]())['then'](realtime[_0xd73e('0x3b')]())[_0xd73e('0x3c')](function(_0x343bba){logger[_0xd73e('0x3d')](_0xd73e('0x3e'),util['inspect'](_0x343bba,{'showHidden':![],'depth':null}));});}function main(){return server[_0xd73e('0x3f')](realtime,preview,fax)[_0xd73e('0x1a')](function(){return initRealtime();})[_0xd73e('0x1a')](function(){return initParams();})[_0xd73e('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xd73e('0x3c')](function(_0xc119ab){logger[_0xd73e('0x3d')]('[index.js][main]',util['inspect'](_0xc119ab,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 2719c2b..09b5833 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfe2=['defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','idle','inuse','statePause','toNumber','format','voiceStatusQueue','interface','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis'];(function(_0x19e57f,_0x4ae750){var _0x469556=function(_0xf6968b){while(--_0xf6968b){_0x19e57f['push'](_0x19e57f['shift']());}};_0x469556(++_0x4ae750);}(_0xdfe2,0x1b1));var _0x2dfe=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xdfe2[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0x2dfe('0x0'));var util=require(_0x2dfe('0x1'));var moment=require(_0x2dfe('0x2'));var md5=require(_0x2dfe('0x3'));var Redis=require(_0x2dfe('0x4'));var config=require(_0x2dfe('0x5'));config[_0x2dfe('0x6')]=_[_0x2dfe('0x7')](config[_0x2dfe('0x6')],{'host':_0x2dfe('0x8'),'port':0x18eb});var io=require(_0x2dfe('0x9'))(new Redis(config[_0x2dfe('0x6')]));function Agent(_0x135a73){this['id']=_0x135a73['id']||0x0;this[_0x2dfe('0xa')]=_0x135a73[_0x2dfe('0xa')]||'';this[_0x2dfe('0xb')]=_0x135a73['email']||'';this[_0x2dfe('0xc')]=_0x135a73['accountcode']||'';this[_0x2dfe('0xd')]=_0x135a73[_0x2dfe('0xd')]||'';this[_0x2dfe('0xe')]=_0x2dfe('0xf');this[_0x2dfe('0x10')]=0x0;this[_0x2dfe('0x11')]=_0x2dfe('0xf');this[_0x2dfe('0x12')]='';this[_0x2dfe('0x13')]='';this[_0x2dfe('0x14')]='';this['interface']='';this[_0x2dfe('0x15')]=_0x135a73[_0x2dfe('0x15')]||![];this[_0x2dfe('0x16')]=_0x2dfe('0xf');this[_0x2dfe('0x17')]=0x0;this[_0x2dfe('0x18')]='';this['voiceStatusQueue']='';this[_0x2dfe('0x19')]=![];this[_0x2dfe('0x1a')]=![];this['md5']='';}Agent[_0x2dfe('0x1b')]['updateStatusRealtime']=function(_0x575b2f){var _0x8e414d;if(_0x575b2f&&_0x575b2f['state']){_0x8e414d=_0x575b2f[_0x2dfe('0xe')]['toLowerCase']();switch(_0x8e414d){case'not_inuse':_0x8e414d=_0x2dfe('0x1c');break;case _0x2dfe('0x1d'):_0x8e414d='talking';break;}}if(_0x8e414d&&this['voiceStatus']!==_0x8e414d||_0x575b2f[_0x2dfe('0x1e')]){this['voiceStatusTime']=_[_0x2dfe('0x1f')](moment()[_0x2dfe('0x20')]('x'));}if(_0x8e414d){this['voiceStatus']=_0x8e414d;}var _0x194f2f={'id':this['id'],'name':this['name'],'email':this[_0x2dfe('0xb')],'accountcode':this[_0x2dfe('0xc')],'fullname':this[_0x2dfe('0xd')],'state':this[_0x2dfe('0xe')],'stateTime':this['stateTime'],'status':this[_0x2dfe('0x11')],'address':this['address'],'online':this[_0x2dfe('0x15')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x2dfe('0x18')],'voiceStatusQueue':this[_0x2dfe('0x21')],'interface':this[_0x2dfe('0x22')],'onhold':this[_0x2dfe('0x19')]};var _0x1b630b=md5(JSON['stringify'](_0x194f2f));if(this[_0x2dfe('0x3')]!==_0x1b630b){this['md5']=_0x1b630b;io['to'](util[_0x2dfe('0x20')](_0x2dfe('0x23'),_0x194f2f[_0x2dfe('0xa')]))[_0x2dfe('0x24')](_0x2dfe('0x25'),_0x194f2f);io['emit'](_0x2dfe('0x26'),_0x194f2f);}};module[_0x2dfe('0x27')]=Agent; \ No newline at end of file +var _0xc67b=['stateTime','address','mobile','interface','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','format','name','fullname','status','online','user:%s','emit','user:presence','lodash','util','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','email','accountcode','state','unknown'];(function(_0x8f2dd,_0x4ae215){var _0x3143a3=function(_0xf716e5){while(--_0xf716e5){_0x8f2dd['push'](_0x8f2dd['shift']());}};_0x3143a3(++_0x4ae215);}(_0xc67b,0x104));var _0xbc67=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc67b[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xbc67('0x0'));var util=require(_0xbc67('0x1'));var moment=require(_0xbc67('0x2'));var md5=require(_0xbc67('0x3'));var Redis=require(_0xbc67('0x4'));var config=require(_0xbc67('0x5'));config['redis']=_[_0xbc67('0x6')](config[_0xbc67('0x7')],{'host':_0xbc67('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbc67('0x7')]));function Agent(_0x20ad01){this['id']=_0x20ad01['id']||0x0;this['name']=_0x20ad01['name']||'';this['email']=_0x20ad01[_0xbc67('0x9')]||'';this['accountcode']=_0x20ad01[_0xbc67('0xa')]||'';this['fullname']=_0x20ad01['fullname']||'';this[_0xbc67('0xb')]=_0xbc67('0xc');this[_0xbc67('0xd')]=0x0;this['status']=_0xbc67('0xc');this[_0xbc67('0xe')]='';this['phone']='';this[_0xbc67('0xf')]='';this[_0xbc67('0x10')]='';this['online']=_0x20ad01['online']||![];this[_0xbc67('0x11')]=_0xbc67('0xc');this[_0xbc67('0x12')]=0x0;this[_0xbc67('0x13')]='';this[_0xbc67('0x14')]='';this[_0xbc67('0x15')]=![];this[_0xbc67('0x16')]=![];this['md5']='';}Agent[_0xbc67('0x17')][_0xbc67('0x18')]=function(_0x12cfcb){var _0x5ad901;if(_0x12cfcb&&_0x12cfcb['state']){_0x5ad901=_0x12cfcb[_0xbc67('0xb')][_0xbc67('0x19')]();switch(_0x5ad901){case _0xbc67('0x1a'):_0x5ad901=_0xbc67('0x1b');break;case _0xbc67('0x1c'):_0x5ad901=_0xbc67('0x1d');break;}}if(_0x5ad901&&this[_0xbc67('0x11')]!==_0x5ad901||_0x12cfcb[_0xbc67('0x1e')]){this[_0xbc67('0x12')]=_['toNumber'](moment()[_0xbc67('0x1f')]('x'));}if(_0x5ad901){this[_0xbc67('0x11')]=_0x5ad901;}var _0x1d32a3={'id':this['id'],'name':this[_0xbc67('0x20')],'email':this[_0xbc67('0x9')],'accountcode':this['accountcode'],'fullname':this[_0xbc67('0x21')],'state':this[_0xbc67('0xb')],'stateTime':this[_0xbc67('0xd')],'status':this[_0xbc67('0x22')],'address':this[_0xbc67('0xe')],'online':this[_0xbc67('0x23')],'voiceStatus':this[_0xbc67('0x11')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xbc67('0x13')],'voiceStatusQueue':this[_0xbc67('0x14')],'interface':this[_0xbc67('0x10')],'onhold':this['onhold']};var _0xe4c0f8=md5(JSON['stringify'](_0x1d32a3));if(this[_0xbc67('0x3')]!==_0xe4c0f8){this[_0xbc67('0x3')]=_0xe4c0f8;io['to'](util[_0xbc67('0x1f')](_0xbc67('0x24'),_0x1d32a3['name']))[_0xbc67('0x25')]('user:save',_0x1d32a3);io[_0xbc67('0x25')](_0xbc67('0x26'),_0x1d32a3);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index bb39e3f..d372988 100644 --- a/server/services/ami/model/campaign.js +++ b/server/services/ami/model/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0db0=['ivrTotalCallsDays','message','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','dialQueueProject','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay'];(function(_0x33e68c,_0x3774b0){var _0x123ffe=function(_0x27cef3){while(--_0x27cef3){_0x33e68c['push'](_0x33e68c['shift']());}};_0x123ffe(++_0x3774b0);}(_0x0db0,0x151));var _0x00db=function(_0x42f41b,_0x67e11f){_0x42f41b=_0x42f41b-0x0;var _0x4a4e89=_0x0db0[_0x42f41b];return _0x4a4e89;};'use strict';function Campaign(_0x2b53f4){this['id']=_0x2b53f4['id']||0x0;this[_0x00db('0x0')]=_0x2b53f4[_0x00db('0x0')]||'';this['type']=_0x2b53f4[_0x00db('0x1')]||_0x00db('0x2');this[_0x00db('0x3')]=0x0;this[_0x00db('0x4')]=0x0;this[_0x00db('0x5')]=0x0;this[_0x00db('0x6')]=0x0;this[_0x00db('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0x00db('0x8')]=_0x2b53f4[_0x00db('0x8')];this['limitCalls']=_0x2b53f4['limitCalls'];this[_0x00db('0x9')]=_0x2b53f4[_0x00db('0x9')]||null;this['dialGlobalInterval']=_0x2b53f4[_0x00db('0xa')]?_0x2b53f4[_0x00db('0xa')]:null;this[_0x00db('0xb')]=_0x2b53f4[_0x00db('0xb')];this[_0x00db('0xc')]=_0x2b53f4[_0x00db('0xc')];this[_0x00db('0xd')]=_0x2b53f4[_0x00db('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x2b53f4[_0x00db('0xe')];this[_0x00db('0xf')]=_0x2b53f4[_0x00db('0xf')];this['dialBusyMaxRetry']=_0x2b53f4[_0x00db('0x10')];this[_0x00db('0x11')]=_0x2b53f4['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x2b53f4[_0x00db('0x12')];this['dialNoAnswerRetryFrequency']=_0x2b53f4['dialNoAnswerRetryFrequency'];this[_0x00db('0x13')]=_0x2b53f4[_0x00db('0x13')];this['dialNoSuchNumberMaxRetry']=_0x2b53f4[_0x00db('0x14')]||0x3;this[_0x00db('0x15')]=_0x2b53f4[_0x00db('0x15')]||0x96;this[_0x00db('0x16')]=_0x2b53f4[_0x00db('0x16')]||0x3;this[_0x00db('0x17')]=_0x2b53f4[_0x00db('0x17')]||0x96;this[_0x00db('0x18')]=_0x2b53f4[_0x00db('0x18')]||0x3;this[_0x00db('0x19')]=_0x2b53f4[_0x00db('0x19')]||0x96;this[_0x00db('0x1a')]=_0x2b53f4['dialMachineMaxRetry']||0x3;this[_0x00db('0x1b')]=_0x2b53f4[_0x00db('0x1b')]||0x96;this[_0x00db('0x1c')]=_0x2b53f4[_0x00db('0x1c')]||0x3;this[_0x00db('0x1d')]=_0x2b53f4[_0x00db('0x1d')]||0x96;this[_0x00db('0x1e')]=_0x2b53f4[_0x00db('0x1e')]||'DESC';this[_0x00db('0x1f')]=_0x2b53f4[_0x00db('0x1f')]||undefined;this[_0x00db('0x20')]=_0x2b53f4[_0x00db('0x20')]||undefined;this['dialCutDigit']=_0x2b53f4['dialCutDigit']||undefined;this['TrunkBackup']=_0x2b53f4[_0x00db('0x21')]?_0x2b53f4[_0x00db('0x21')]:undefined;this[_0x00db('0x22')]=_0x2b53f4[_0x00db('0x22')]?_0x2b53f4[_0x00db('0x22')]:undefined;this[_0x00db('0x23')]=_0x2b53f4[_0x00db('0x23')]?_0x2b53f4[_0x00db('0x23')]:undefined;this['SquareProject']=_0x2b53f4['SquareProject']?_0x2b53f4['SquareProject']:undefined;this[_0x00db('0x24')]=_0x2b53f4[_0x00db('0x25')]?_0x2b53f4['SquareProject'][_0x00db('0x0')]:undefined;this[_0x00db('0x26')]=_0x2b53f4[_0x00db('0x26')]||![];this[_0x00db('0x27')]=_0x2b53f4[_0x00db('0x27')];this['dialAMDGreeting']=_0x2b53f4[_0x00db('0x28')];this[_0x00db('0x29')]=_0x2b53f4[_0x00db('0x29')];this[_0x00db('0x2a')]=_0x2b53f4[_0x00db('0x2a')];this[_0x00db('0x2b')]=_0x2b53f4[_0x00db('0x2b')];this[_0x00db('0x2c')]=_0x2b53f4[_0x00db('0x2c')];this[_0x00db('0x2d')]=_0x2b53f4[_0x00db('0x2d')];this[_0x00db('0x2e')]=_0x2b53f4[_0x00db('0x2e')];this[_0x00db('0x2f')]=_0x2b53f4[_0x00db('0x2f')];}module[_0x00db('0x30')]=Campaign; \ No newline at end of file +var _0x1208=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x4e324f,_0x4f0cfc){var _0x4e6076=function(_0x4b8227){while(--_0x4b8227){_0x4e324f['push'](_0x4e324f['shift']());}};_0x4e6076(++_0x4f0cfc);}(_0x1208,0x119));var _0x8120=function(_0x3bdbfa,_0x5f0d24){_0x3bdbfa=_0x3bdbfa-0x0;var _0x80bd85=_0x1208[_0x3bdbfa];return _0x80bd85;};'use strict';function Campaign(_0x46fc7c){this['id']=_0x46fc7c['id']||0x0;this[_0x8120('0x0')]=_0x46fc7c[_0x8120('0x0')]||'';this[_0x8120('0x1')]=_0x46fc7c[_0x8120('0x1')]||_0x8120('0x2');this[_0x8120('0x3')]=0x0;this[_0x8120('0x4')]=0x0;this[_0x8120('0x5')]=0x0;this[_0x8120('0x6')]=0x0;this[_0x8120('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0x8120('0x8')]=_0x46fc7c[_0x8120('0x8')];this[_0x8120('0x9')]=_0x46fc7c[_0x8120('0x9')];this[_0x8120('0xa')]=_0x46fc7c[_0x8120('0xa')]||null;this[_0x8120('0xb')]=_0x46fc7c[_0x8120('0xb')]?_0x46fc7c[_0x8120('0xb')]:null;this[_0x8120('0xc')]=_0x46fc7c[_0x8120('0xc')];this[_0x8120('0xd')]=_0x46fc7c[_0x8120('0xd')];this[_0x8120('0xe')]=_0x46fc7c[_0x8120('0xe')]||0x1e;this[_0x8120('0xf')]=_0x46fc7c['dialCongestionMaxRetry'];this[_0x8120('0x10')]=_0x46fc7c[_0x8120('0x10')];this[_0x8120('0x11')]=_0x46fc7c['dialBusyMaxRetry'];this[_0x8120('0x12')]=_0x46fc7c[_0x8120('0x12')];this[_0x8120('0x13')]=_0x46fc7c[_0x8120('0x13')];this['dialNoAnswerRetryFrequency']=_0x46fc7c[_0x8120('0x14')];this[_0x8120('0x15')]=_0x46fc7c['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x46fc7c[_0x8120('0x16')]||0x3;this[_0x8120('0x17')]=_0x46fc7c[_0x8120('0x17')]||0x96;this[_0x8120('0x18')]=_0x46fc7c[_0x8120('0x18')]||0x3;this[_0x8120('0x19')]=_0x46fc7c[_0x8120('0x19')]||0x96;this[_0x8120('0x1a')]=_0x46fc7c[_0x8120('0x1a')]||0x3;this[_0x8120('0x1b')]=_0x46fc7c[_0x8120('0x1b')]||0x96;this['dialMachineMaxRetry']=_0x46fc7c['dialMachineMaxRetry']||0x3;this[_0x8120('0x1c')]=_0x46fc7c[_0x8120('0x1c')]||0x96;this[_0x8120('0x1d')]=_0x46fc7c[_0x8120('0x1d')]||0x3;this[_0x8120('0x1e')]=_0x46fc7c[_0x8120('0x1e')]||0x96;this[_0x8120('0x1f')]=_0x46fc7c[_0x8120('0x1f')]||'DESC';this[_0x8120('0x20')]=_0x46fc7c[_0x8120('0x20')]||undefined;this[_0x8120('0x21')]=_0x46fc7c['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x8120('0x22')]=_0x46fc7c['dialCutDigit']||undefined;this[_0x8120('0x23')]=_0x46fc7c[_0x8120('0x23')]?_0x46fc7c[_0x8120('0x23')]:undefined;this[_0x8120('0x24')]=_0x46fc7c[_0x8120('0x24')]?_0x46fc7c[_0x8120('0x24')]:undefined;this[_0x8120('0x25')]=_0x46fc7c[_0x8120('0x25')]?_0x46fc7c[_0x8120('0x25')]:undefined;this['SquareProject']=_0x46fc7c[_0x8120('0x26')]?_0x46fc7c[_0x8120('0x26')]:undefined;this[_0x8120('0x27')]=_0x46fc7c[_0x8120('0x26')]?_0x46fc7c[_0x8120('0x26')]['name']:undefined;this[_0x8120('0x28')]=_0x46fc7c[_0x8120('0x28')]||![];this[_0x8120('0x29')]=_0x46fc7c[_0x8120('0x29')];this[_0x8120('0x2a')]=_0x46fc7c[_0x8120('0x2a')];this[_0x8120('0x2b')]=_0x46fc7c['dialAMDAfterGreetingSilence'];this[_0x8120('0x2c')]=_0x46fc7c[_0x8120('0x2c')];this['dialAMDMinWordLength']=_0x46fc7c[_0x8120('0x2d')];this[_0x8120('0x2e')]=_0x46fc7c[_0x8120('0x2e')];this[_0x8120('0x2f')]=_0x46fc7c['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x46fc7c['dialAMDSilenceThreshold'];this[_0x8120('0x30')]=_0x46fc7c[_0x8120('0x30')];}module[_0x8120('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 30e0390..f56bffb 100644 --- a/server/services/ami/model/channel.js +++ b/server/services/ami/model/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bb3=['duration','type','tag','monitor','queue','monitors','transfercalleridnum','transferType','starttime','channel','destinationchannel','calleridnum','calleridname','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata'];(function(_0x42e841,_0xefa623){var _0x51306c=function(_0x250572){while(--_0x250572){_0x42e841['push'](_0x42e841['shift']());}};_0x51306c(++_0xefa623);}(_0x9bb3,0x134));var _0x39bb=function(_0x3d7234,_0x53a4bc){_0x3d7234=_0x3d7234-0x0;var _0x1fbbd9=_0x9bb3[_0x3d7234];return _0x1fbbd9;};'use strict';function Channel(){this[_0x39bb('0x0')]=null;this[_0x39bb('0x1')]='';this[_0x39bb('0x2')]='';this[_0x39bb('0x3')]=0x0;this[_0x39bb('0x4')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x39bb('0x5')]=0x0;this[_0x39bb('0x6')]='';this[_0x39bb('0x7')]=0x0;this[_0x39bb('0x8')]=0x0;this[_0x39bb('0x9')]=0x0;this[_0x39bb('0xa')]=![];this[_0x39bb('0xb')]=null;this[_0x39bb('0xc')]=null;this[_0x39bb('0xd')]=![];this[_0x39bb('0xe')]=![];this[_0x39bb('0xf')]='';this[_0x39bb('0x10')]='';this[_0x39bb('0x11')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x39bb('0x12')]=null;this[_0x39bb('0x13')]=null;this['disposition']=null;this[_0x39bb('0x14')]=![];this['monitorFilename']=null;this[_0x39bb('0x15')]=null;this[_0x39bb('0x16')]=[];this[_0x39bb('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x39bb('0x18')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x80b2=['type','tag','disposition','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80b2,0x141));var _0x280b=function(_0x595b17,_0x2191c2){_0x595b17=_0x595b17-0x0;var _0xd8228e=_0x80b2[_0x595b17];return _0xd8228e;};'use strict';function Channel(){this[_0x280b('0x0')]=null;this[_0x280b('0x1')]='';this['destinationchannel']='';this[_0x280b('0x2')]=0x0;this[_0x280b('0x3')]='';this['connectedlinenum']=undefined;this[_0x280b('0x4')]=undefined;this[_0x280b('0x5')]=0x0;this[_0x280b('0x6')]='';this[_0x280b('0x7')]=0x0;this[_0x280b('0x8')]=0x0;this['exten']=0x0;this[_0x280b('0x9')]=![];this[_0x280b('0xa')]=null;this['endtime']=null;this[_0x280b('0xb')]=![];this[_0x280b('0xc')]=![];this[_0x280b('0xd')]='';this['lastdata']='';this[_0x280b('0xe')]=0x0;this[_0x280b('0xf')]=0x0;this[_0x280b('0x10')]=0x0;this[_0x280b('0x11')]=null;this[_0x280b('0x12')]=null;this[_0x280b('0x13')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x280b('0x14')]=null;this[_0x280b('0x15')]=[];this[_0x280b('0x16')]=undefined;this[_0x280b('0x17')]=undefined;this[_0x280b('0x18')]=undefined;this['mohtime']=0x0;}module[_0x280b('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index fa4cf40..f342eaa 100644 --- a/server/services/ami/model/deskAccount.js +++ b/server/services/ami/model/deskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f10=['exports','name','username','authType','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x532412,_0x1b8cce){var _0x55da2c=function(_0x16eb55){while(--_0x16eb55){_0x532412['push'](_0x532412['shift']());}};_0x55da2c(++_0x1b8cce);}(_0x7f10,0x18d));var _0x07f1=function(_0x892fed,_0xb9234d){_0x892fed=_0x892fed-0x0;var _0x301ff4=_0x7f10[_0x892fed];return _0x301ff4;};'use strict';function DeskAccount(_0x208f23){this['id']=_0x208f23['id']||0x0;this[_0x07f1('0x0')]=_0x208f23[_0x07f1('0x0')]||'';this[_0x07f1('0x1')]=_0x208f23['username']||'';this['remoteUri']=_0x208f23['remoteUri']||'';this[_0x07f1('0x2')]=_0x208f23['authType']||'';this[_0x07f1('0x3')]=_0x208f23[_0x07f1('0x3')]||'';this['consumerKey']=_0x208f23['consumerKey']||'';this[_0x07f1('0x4')]=_0x208f23[_0x07f1('0x4')]||'';this['token']=_0x208f23[_0x07f1('0x5')]||'';this[_0x07f1('0x6')]=_0x208f23[_0x07f1('0x6')]||'';this[_0x07f1('0x7')]=_0x208f23[_0x07f1('0x7')]||'';this[_0x07f1('0x8')]=_0x208f23[_0x07f1('0x8')]||'';this[_0x07f1('0x9')]=_0x208f23['Configurations']||{};}module[_0x07f1('0xa')]=DeskAccount; \ No newline at end of file +var _0x4bec=['username','remoteUri','authType','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x4bec,0x1ee));var _0xc4be=function(_0x42dfef,_0x2d28ac){_0x42dfef=_0x42dfef-0x0;var _0x4d222e=_0x4bec[_0x42dfef];return _0x4d222e;};'use strict';function DeskAccount(_0x3dca3f){this['id']=_0x3dca3f['id']||0x0;this[_0xc4be('0x0')]=_0x3dca3f[_0xc4be('0x0')]||'';this[_0xc4be('0x1')]=_0x3dca3f['username']||'';this['remoteUri']=_0x3dca3f[_0xc4be('0x2')]||'';this[_0xc4be('0x3')]=_0x3dca3f[_0xc4be('0x3')]||'';this[_0xc4be('0x4')]=_0x3dca3f[_0xc4be('0x4')]||'';this['consumerKey']=_0x3dca3f['consumerKey']||'';this[_0xc4be('0x5')]=_0x3dca3f[_0xc4be('0x5')]||'';this[_0xc4be('0x6')]=_0x3dca3f[_0xc4be('0x6')]||'';this['tokenSecret']=_0x3dca3f[_0xc4be('0x7')]||'';this[_0xc4be('0x8')]=_0x3dca3f[_0xc4be('0x8')]||'';this[_0xc4be('0x9')]=_0x3dca3f[_0xc4be('0x9')]||'';this['Configurations']=_0x3dca3f[_0xc4be('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 2b4d599..8a2bee9 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb0e=['Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x1c0b0c,_0x47e92f){var _0x14f482=function(_0x41ecf5){while(--_0x41ecf5){_0x1c0b0c['push'](_0x1c0b0c['shift']());}};_0x14f482(++_0x47e92f);}(_0xbb0e,0xdb));var _0xebb0=function(_0x5b75cd,_0x325f6e){_0x5b75cd=_0x5b75cd-0x0;var _0x3dc75a=_0xbb0e[_0x5b75cd];return _0x3dc75a;};'use strict';function Dynamics365Account(_0x3f4d16){this['id']=_0x3f4d16['id']||0x0;this[_0xebb0('0x0')]=_0x3f4d16[_0xebb0('0x0')]||'';this[_0xebb0('0x1')]=_0x3f4d16['username']||'';this['password']=_0x3f4d16[_0xebb0('0x2')]||'';this[_0xebb0('0x3')]=_0x3f4d16[_0xebb0('0x3')]||'';this[_0xebb0('0x4')]=_0x3f4d16[_0xebb0('0x4')]||'';this[_0xebb0('0x5')]=_0x3f4d16[_0xebb0('0x5')]||'';this['clientSecret']=_0x3f4d16[_0xebb0('0x6')]||{};this[_0xebb0('0x7')]=_0x3f4d16[_0xebb0('0x7')]||'';this[_0xebb0('0x8')]=_0x3f4d16[_0xebb0('0x8')]||![];this[_0xebb0('0x9')]=_0x3f4d16[_0xebb0('0x9')]||{};this[_0xebb0('0xa')]=_0x3f4d16[_0xebb0('0xa')]||{};}module[_0xebb0('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xa36e=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0x158b7b,_0x59eaa4){var _0x10e595=function(_0x432640){while(--_0x432640){_0x158b7b['push'](_0x158b7b['shift']());}};_0x10e595(++_0x59eaa4);}(_0xa36e,0xb3));var _0xea36=function(_0x404ed7,_0x2567c5){_0x404ed7=_0x404ed7-0x0;var _0x27a8bc=_0xa36e[_0x404ed7];return _0x27a8bc;};'use strict';function Dynamics365Account(_0x5becd1){this['id']=_0x5becd1['id']||0x0;this[_0xea36('0x0')]=_0x5becd1[_0xea36('0x0')]||'';this[_0xea36('0x1')]=_0x5becd1['username']||'';this[_0xea36('0x2')]=_0x5becd1['password']||'';this[_0xea36('0x3')]=_0x5becd1['remoteUri']||'';this[_0xea36('0x4')]=_0x5becd1[_0xea36('0x4')]||'';this[_0xea36('0x5')]=_0x5becd1[_0xea36('0x5')]||'';this[_0xea36('0x6')]=_0x5becd1[_0xea36('0x6')]||{};this[_0xea36('0x7')]=_0x5becd1[_0xea36('0x7')]||'';this[_0xea36('0x8')]=_0x5becd1[_0xea36('0x8')]||![];this[_0xea36('0x9')]=_0x5becd1[_0xea36('0x9')]||{};this['CloudProvider']=_0x5becd1[_0xea36('0xa')]||{};}module[_0xea36('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index cec1c26..12729c0 100644 --- a/server/services/ami/model/faxAccount.js +++ b/server/services/ami/model/faxAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4862=['ecm','headerinfo','localstationid','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x4d3831,_0x3817b8){var _0x5f3939=function(_0x2e21e1){while(--_0x2e21e1){_0x4d3831['push'](_0x4d3831['shift']());}};_0x5f3939(++_0x3817b8);}(_0x4862,0x1ce));var _0x2486=function(_0x17ede9,_0x27d731){_0x17ede9=_0x17ede9-0x0;var _0x35b71d=_0x4862[_0x17ede9];return _0x35b71d;};'use strict';function FaxAccount(_0x19e07a){this['id']=_0x19e07a['id']||0x0;this[_0x2486('0x0')]=_0x19e07a[_0x2486('0x0')]||'';this[_0x2486('0x1')]=_0x19e07a[_0x2486('0x1')];this[_0x2486('0x2')]=_0x19e07a[_0x2486('0x2')];this[_0x2486('0x3')]=_0x19e07a[_0x2486('0x3')];this[_0x2486('0x4')]=_0x19e07a[_0x2486('0x4')];this['minrate']=_0x19e07a['minrate']||0x960;this[_0x2486('0x5')]=_0x19e07a[_0x2486('0x5')]||0x3840;this['modem']=_0x19e07a['modem']||_0x2486('0x6');this[_0x2486('0x7')]=_0x19e07a[_0x2486('0x7')]||'no';this[_0x2486('0x8')]=_0x19e07a['faxdetect']||'no';this[_0x2486('0x9')]=_0x19e07a[_0x2486('0x9')]||0x1388;this['tech']=_0x19e07a[_0x2486('0xa')]||_0x2486('0xb');this[_0x2486('0xc')]=_0x19e07a[_0x2486('0xc')]?_0x19e07a[_0x2486('0xc')]:undefined;this[_0x2486('0xd')]=_0x19e07a[_0x2486('0xd')];this[_0x2486('0xe')]=_0x19e07a[_0x2486('0xe')];}module[_0x2486('0xf')]=FaxAccount; \ No newline at end of file +var _0xbb69=['ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name'];(function(_0x5344f6,_0x34d749){var _0x35ca27=function(_0x360729){while(--_0x360729){_0x5344f6['push'](_0x5344f6['shift']());}};_0x35ca27(++_0x34d749);}(_0xbb69,0x1ca));var _0x9bb6=function(_0x52923d,_0x204ee8){_0x52923d=_0x52923d-0x0;var _0x2a3598=_0xbb69[_0x52923d];return _0x2a3598;};'use strict';function FaxAccount(_0x28e6b4){this['id']=_0x28e6b4['id']||0x0;this[_0x9bb6('0x0')]=_0x28e6b4['name']||'';this['description']=_0x28e6b4['description'];this['ecm']=_0x28e6b4[_0x9bb6('0x1')];this[_0x9bb6('0x2')]=_0x28e6b4[_0x9bb6('0x2')];this[_0x9bb6('0x3')]=_0x28e6b4['localstationid'];this['minrate']=_0x28e6b4[_0x9bb6('0x4')]||0x960;this[_0x9bb6('0x5')]=_0x28e6b4['maxrate']||0x3840;this[_0x9bb6('0x6')]=_0x28e6b4['modem']||_0x9bb6('0x7');this[_0x9bb6('0x8')]=_0x28e6b4[_0x9bb6('0x8')]||'no';this[_0x9bb6('0x9')]=_0x28e6b4[_0x9bb6('0x9')]||'no';this[_0x9bb6('0xa')]=_0x28e6b4[_0x9bb6('0xa')]||0x1388;this[_0x9bb6('0xb')]=_0x28e6b4[_0x9bb6('0xb')]||_0x9bb6('0xc');this[_0x9bb6('0xd')]=_0x28e6b4[_0x9bb6('0xd')]?_0x28e6b4[_0x9bb6('0xd')]:undefined;this[_0x9bb6('0xe')]=_0x28e6b4[_0x9bb6('0xe')];this[_0x9bb6('0xf')]=_0x28e6b4[_0x9bb6('0xf')];}module[_0x9bb6('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 3af601a..41a17d2 100644 --- a/server/services/ami/model/freshdeskAccount.js +++ b/server/services/ami/model/freshdeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x081c=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x52f73e,_0x1afe38){var _0x4d632c=function(_0x1de822){while(--_0x1de822){_0x52f73e['push'](_0x52f73e['shift']());}};_0x4d632c(++_0x1afe38);}(_0x081c,0xd8));var _0xc081=function(_0x44714c,_0x2ac454){_0x44714c=_0x44714c-0x0;var _0x57d4d5=_0x081c[_0x44714c];return _0x57d4d5;};'use strict';function FreshdeskAccount(_0x4d27cc){this['id']=_0x4d27cc['id']||0x0;this[_0xc081('0x0')]=_0x4d27cc[_0xc081('0x0')]||'';this[_0xc081('0x1')]=_0x4d27cc['username']||'';this[_0xc081('0x2')]=_0x4d27cc[_0xc081('0x3')]||'';this[_0xc081('0x4')]=_0x4d27cc['remoteUri']||'';this['serverUrl']=_0x4d27cc[_0xc081('0x5')]||'';this[_0xc081('0x6')]=_0x4d27cc[_0xc081('0x6')]||{};}module[_0xc081('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xf5c4=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf5c4,0x137));var _0x4f5c=function(_0x9db9e,_0x4a52b0){_0x9db9e=_0x9db9e-0x0;var _0x12af4a=_0xf5c4[_0x9db9e];return _0x12af4a;};'use strict';function FreshdeskAccount(_0x33b180){this['id']=_0x33b180['id']||0x0;this[_0x4f5c('0x0')]=_0x33b180[_0x4f5c('0x0')]||'';this['username']=_0x33b180[_0x4f5c('0x1')]||'';this[_0x4f5c('0x2')]=_0x33b180[_0x4f5c('0x3')]||'';this['remoteUri']=_0x33b180[_0x4f5c('0x4')]||'';this[_0x4f5c('0x5')]=_0x33b180[_0x4f5c('0x5')]||'';this['Configurations']=_0x33b180[_0x4f5c('0x6')]||{};}module[_0x4f5c('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 948fee3..aac9821 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc65=['token','remoteUri','serverUrl','Configurations','exports','username','apiKey'];(function(_0x78b684,_0x4bfa17){var _0x44a824=function(_0x626eb2){while(--_0x626eb2){_0x78b684['push'](_0x78b684['shift']());}};_0x44a824(++_0x4bfa17);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x932842,_0x5be2c5){_0x932842=_0x932842-0x0;var _0x12a047=_0xfc65[_0x932842];return _0x12a047;};'use strict';function FreshsalesAccount(_0x2c4f5f){this['id']=_0x2c4f5f['id']||0x0;this['name']=_0x2c4f5f['name']||'';this[_0x5fc6('0x0')]=_0x2c4f5f[_0x5fc6('0x0')]||'';this[_0x5fc6('0x1')]=_0x2c4f5f[_0x5fc6('0x2')]||'';this[_0x5fc6('0x3')]=_0x2c4f5f[_0x5fc6('0x3')]||'';this[_0x5fc6('0x4')]=_0x2c4f5f[_0x5fc6('0x4')]||'';this[_0x5fc6('0x5')]=_0x2c4f5f[_0x5fc6('0x5')]||{};}module[_0x5fc6('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x41d9=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x22e4fd){this['id']=_0x22e4fd['id']||0x0;this[_0x941d('0x0')]=_0x22e4fd[_0x941d('0x0')]||'';this[_0x941d('0x1')]=_0x22e4fd[_0x941d('0x1')]||'';this[_0x941d('0x2')]=_0x22e4fd[_0x941d('0x3')]||'';this['remoteUri']=_0x22e4fd[_0x941d('0x4')]||'';this[_0x941d('0x5')]=_0x22e4fd['serverUrl']||'';this[_0x941d('0x6')]=_0x22e4fd[_0x941d('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 43cbeb9..0688829 100644 --- a/server/services/ami/model/queueReport.js +++ b/server/services/ami/model/queueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddad=['holdtime','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority'];(function(_0x3363b9,_0x151c2b){var _0x5518ff=function(_0x37f078){while(--_0x37f078){_0x3363b9['push'](_0x3363b9['shift']());}};_0x5518ff(++_0x151c2b);}(_0xddad,0xf0));var _0xddda=function(_0x5a0e1d,_0x261edc){_0x5a0e1d=_0x5a0e1d-0x0;var _0x320dc0=_0xddad[_0x5a0e1d];return _0x320dc0;};'use strict';function QueueReport(){this[_0xddda('0x0')]=_0xddda('0x1');this[_0xddda('0x2')]='';this[_0xddda('0x3')]='';this['calleridname']='';this[_0xddda('0x4')]='';this['queuecallerjoinAt']=null;this[_0xddda('0x5')]=null;this[_0xddda('0x6')]=0x1;this['count']=0x1;this[_0xddda('0x7')]=![];this[_0xddda('0x8')]=null;this[_0xddda('0x9')]=![];this['queuecallercompleteAt']=null;this[_0xddda('0xa')]=![];this[_0xddda('0xb')]=null;this[_0xddda('0xc')]=0x1;this[_0xddda('0xd')]='';this[_0xddda('0xe')]='';this[_0xddda('0xf')]='';this[_0xddda('0x10')]='';this[_0xddda('0x11')]='';this[_0xddda('0x12')]='';this[_0xddda('0x13')]='';this[_0xddda('0x14')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0xddda('0x15')]=_0xddda('0x16');this['routealias']=null;this[_0xddda('0x17')]=0x0;this[_0xddda('0x18')]={};}module[_0xddda('0x19')]=QueueReport; \ No newline at end of file +var _0x62e5=['count','queuecallerabandon','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','type','inbound','uniqueid','queue','queuecallerleaveAt','position'];(function(_0x4c637c,_0x4e901f){var _0x3eb8d0=function(_0x5ba2f1){while(--_0x5ba2f1){_0x4c637c['push'](_0x4c637c['shift']());}};_0x3eb8d0(++_0x4e901f);}(_0x62e5,0x1aa));var _0x562e=function(_0x4642e4,_0x1177b6){_0x4642e4=_0x4642e4-0x0;var _0x5ccf90=_0x62e5[_0x4642e4];return _0x5ccf90;};'use strict';function QueueReport(){this[_0x562e('0x0')]=_0x562e('0x1');this[_0x562e('0x2')]='';this['calleridnum']='';this['calleridname']='';this[_0x562e('0x3')]='';this['queuecallerjoinAt']=null;this[_0x562e('0x4')]=null;this[_0x562e('0x5')]=0x1;this[_0x562e('0x6')]=0x1;this[_0x562e('0x7')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x562e('0x8')]=![];this[_0x562e('0x9')]=null;this[_0x562e('0xa')]=0x1;this[_0x562e('0xb')]='';this[_0x562e('0xc')]='';this['connectedlinename']='';this[_0x562e('0xd')]='';this[_0x562e('0xe')]='';this[_0x562e('0xf')]='';this['priority']='';this[_0x562e('0x10')]=0x0;this[_0x562e('0x11')]=![];this[_0x562e('0x12')]='';this[_0x562e('0x13')]=_0x562e('0x14');this[_0x562e('0x15')]=null;this[_0x562e('0x16')]=0x0;this[_0x562e('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 478465a..18d4d85 100644 --- a/server/services/ami/model/salesforceAccount.js +++ b/server/services/ami/model/salesforceAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b1e=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x6b1e,0x9a));var _0xe6b1=function(_0x5d5067,_0x48b950){_0x5d5067=_0x5d5067-0x0;var _0x6382c7=_0x6b1e[_0x5d5067];return _0x6382c7;};'use strict';function SalesforceAccount(_0x13eaa0){this['id']=_0x13eaa0['id']||0x0;this['name']=_0x13eaa0['name']||'';this[_0xe6b1('0x0')]=_0x13eaa0[_0xe6b1('0x0')]||'';this[_0xe6b1('0x1')]=_0x13eaa0['remoteUri']||'';this[_0xe6b1('0x2')]=_0x13eaa0[_0xe6b1('0x2')]||'';this['clientId']=_0x13eaa0[_0xe6b1('0x3')]||'';this['clientSecret']=_0x13eaa0[_0xe6b1('0x4')]||'';this[_0xe6b1('0x5')]=_0x13eaa0[_0xe6b1('0x5')]||'';this[_0xe6b1('0x6')]=_0x13eaa0[_0xe6b1('0x6')]||_0xe6b1('0x7');this[_0xe6b1('0x8')]=_0x13eaa0['serverUrl']||'';this[_0xe6b1('0x9')]=_0x13eaa0[_0xe6b1('0x9')]||{};}module[_0xe6b1('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x920c=['clientSecret','securityToken','type','serverUrl','Configurations','name','username','remoteUri','password'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0x920c,0x152));var _0xc920=function(_0x21ac3a,_0x2111bb){_0x21ac3a=_0x21ac3a-0x0;var _0x8f97a9=_0x920c[_0x21ac3a];return _0x8f97a9;};'use strict';function SalesforceAccount(_0x5b58ab){this['id']=_0x5b58ab['id']||0x0;this[_0xc920('0x0')]=_0x5b58ab[_0xc920('0x0')]||'';this[_0xc920('0x1')]=_0x5b58ab['username']||'';this['remoteUri']=_0x5b58ab[_0xc920('0x2')]||'';this['password']=_0x5b58ab[_0xc920('0x3')]||'';this['clientId']=_0x5b58ab['clientId']||'';this[_0xc920('0x4')]=_0x5b58ab[_0xc920('0x4')]||'';this[_0xc920('0x5')]=_0x5b58ab[_0xc920('0x5')]||'';this[_0xc920('0x6')]=_0x5b58ab[_0xc920('0x6')]||'integrationTab';this[_0xc920('0x7')]=_0x5b58ab[_0xc920('0x7')]||'';this[_0xc920('0x8')]=_0x5b58ab[_0xc920('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index d9e3ad7..fa0476b 100644 --- a/server/services/ami/model/servicenowAccount.js +++ b/server/services/ami/model/servicenowAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06d0=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x11f310,_0x566f6f){var _0x49012b=function(_0x34b5e5){while(--_0x34b5e5){_0x11f310['push'](_0x11f310['shift']());}};_0x49012b(++_0x566f6f);}(_0x06d0,0x136));var _0x006d=function(_0x555a54,_0x8faa61){_0x555a54=_0x555a54-0x0;var _0x2ea6c0=_0x06d0[_0x555a54];return _0x2ea6c0;};'use strict';function ServicenowAccount(_0x54f003){this['id']=_0x54f003['id']||0x0;this[_0x006d('0x0')]=_0x54f003[_0x006d('0x0')]||'';this[_0x006d('0x1')]=_0x54f003[_0x006d('0x1')]||'';this[_0x006d('0x2')]=_0x54f003['password']||'';this['remoteUri']=_0x54f003[_0x006d('0x3')]||'';this[_0x006d('0x4')]=_0x54f003['serverUrl']||'';this['Configurations']=_0x54f003[_0x006d('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xc40d=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x1a1e9a,_0x2b3f6d){var _0x5e0f72=function(_0x577845){while(--_0x577845){_0x1a1e9a['push'](_0x1a1e9a['shift']());}};_0x5e0f72(++_0x2b3f6d);}(_0xc40d,0x115));var _0xdc40=function(_0x45dccf,_0x2b4c7a){_0x45dccf=_0x45dccf-0x0;var _0x3546df=_0xc40d[_0x45dccf];return _0x3546df;};'use strict';function ServicenowAccount(_0x3c9cd2){this['id']=_0x3c9cd2['id']||0x0;this[_0xdc40('0x0')]=_0x3c9cd2[_0xdc40('0x0')]||'';this[_0xdc40('0x1')]=_0x3c9cd2[_0xdc40('0x1')]||'';this[_0xdc40('0x2')]=_0x3c9cd2['password']||'';this[_0xdc40('0x3')]=_0x3c9cd2['remoteUri']||'';this[_0xdc40('0x4')]=_0x3c9cd2['serverUrl']||'';this[_0xdc40('0x5')]=_0x3c9cd2[_0xdc40('0x5')]||{};}module[_0xdc40('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 89ab531..9ffa22c 100644 --- a/server/services/ami/model/sugarcrmAccount.js +++ b/server/services/ami/model/sugarcrmAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a67=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xb24231,_0xa95d43){var _0x244b1c=function(_0x5865b7){while(--_0x5865b7){_0xb24231['push'](_0xb24231['shift']());}};_0x244b1c(++_0xa95d43);}(_0x4a67,0x156));var _0x74a6=function(_0x56b627,_0x57d9c1){_0x56b627=_0x56b627-0x0;var _0x37e5a8=_0x4a67[_0x56b627];return _0x37e5a8;};'use strict';function SugarcrmAccount(_0x28e800){this['id']=_0x28e800['id']||0x0;this[_0x74a6('0x0')]=_0x28e800[_0x74a6('0x0')]||'';this[_0x74a6('0x1')]=_0x28e800['username']||'';this[_0x74a6('0x2')]=_0x28e800['password']||'';this[_0x74a6('0x3')]=_0x28e800[_0x74a6('0x3')]||'';this[_0x74a6('0x4')]=_0x28e800[_0x74a6('0x4')]||'';this['Configurations']=_0x28e800[_0x74a6('0x5')]||{};}module[_0x74a6('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x8ba1=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x2aa83a,_0x4b5c0b){var _0x36a653=function(_0x3fdc46){while(--_0x3fdc46){_0x2aa83a['push'](_0x2aa83a['shift']());}};_0x36a653(++_0x4b5c0b);}(_0x8ba1,0x19e));var _0x18ba=function(_0x45922d,_0x505f14){_0x45922d=_0x45922d-0x0;var _0x131aca=_0x8ba1[_0x45922d];return _0x131aca;};'use strict';function SugarcrmAccount(_0x599f46){this['id']=_0x599f46['id']||0x0;this[_0x18ba('0x0')]=_0x599f46[_0x18ba('0x0')]||'';this['username']=_0x599f46[_0x18ba('0x1')]||'';this[_0x18ba('0x2')]=_0x599f46[_0x18ba('0x2')]||'';this['remoteUri']=_0x599f46[_0x18ba('0x3')]||'';this[_0x18ba('0x4')]=_0x599f46['serverUrl']||'';this[_0x18ba('0x5')]=_0x599f46[_0x18ba('0x5')]||{};}module[_0x18ba('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index e650823..ff75834 100644 --- a/server/services/ami/model/telephone.js +++ b/server/services/ami/model/telephone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa204=['address','exports','name','accountcode','state','stateTime','status','unknown'];(function(_0x3bcd9b,_0x217495){var _0xe5d251=function(_0x2963d3){while(--_0x2963d3){_0x3bcd9b['push'](_0x3bcd9b['shift']());}};_0xe5d251(++_0x217495);}(_0xa204,0x152));var _0x4a20=function(_0x34247a,_0xb9fc7){_0x34247a=_0x34247a-0x0;var _0x53aa73=_0xa204[_0x34247a];return _0x53aa73;};'use strict';function Telephone(_0x32f09f){this['id']=_0x32f09f['id']||0x0;this[_0x4a20('0x0')]=_0x32f09f['name']||'';this[_0x4a20('0x1')]=_0x32f09f[_0x4a20('0x1')]||'';this[_0x4a20('0x2')]='unknown';this[_0x4a20('0x3')]=0x0;this[_0x4a20('0x4')]=_0x4a20('0x5');this[_0x4a20('0x6')]='';}module[_0x4a20('0x7')]=Telephone; \ No newline at end of file +var _0xb7a5=['unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x163596,_0x3fb94f){var _0x3837b5=function(_0x3efab9){while(--_0x3efab9){_0x163596['push'](_0x163596['shift']());}};_0x3837b5(++_0x3fb94f);}(_0xb7a5,0x67));var _0x5b7a=function(_0x232752,_0xd84381){_0x232752=_0x232752-0x0;var _0x326df8=_0xb7a5[_0x232752];return _0x326df8;};'use strict';function Telephone(_0x292ba6){this['id']=_0x292ba6['id']||0x0;this[_0x5b7a('0x0')]=_0x292ba6[_0x5b7a('0x0')]||'';this['accountcode']=_0x292ba6[_0x5b7a('0x1')]||'';this['state']=_0x5b7a('0x2');this[_0x5b7a('0x3')]=0x0;this[_0x5b7a('0x4')]='unknown';this[_0x5b7a('0x5')]='';}module[_0x5b7a('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 56142a2..0fc5054 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x5e092f,_0x226a3d){var _0x69fd61=function(_0x1ee62a){while(--_0x1ee62a){_0x5e092f['push'](_0x5e092f['shift']());}};_0x69fd61(++_0x226a3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x21bf65,_0x3025ce){var _0xcc3629=function(_0x196711){while(--_0x196711){_0x21bf65['push'](_0x21bf65['shift']());}};_0xcc3629(++_0x3025ce);}(_0xb10b,0x12a));var _0xbb10=function(_0x18d710,_0x153c7c){_0x18d710=_0x18d710-0x0;var _0x54f4eb=_0xb10b[_0x18d710];return _0x54f4eb;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index f63df69..283fa53 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0x5eb8,0xb0));var _0x85eb=function(_0x38de33,_0x4361bb){_0x38de33=_0x38de33-0x0;var _0x40f16d=_0x5eb8[_0x38de33];return _0x40f16d;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x1fa274,_0x27a51f){var _0x5601e0=function(_0x146c2c){while(--_0x146c2c){_0x1fa274['push'](_0x1fa274['shift']());}};_0x5601e0(++_0x27a51f);}(_0x4fc2,0x111));var _0x24fc=function(_0x18841e,_0x64e61f){_0x18841e=_0x18841e-0x0;var _0x49db81=_0x4fc2[_0x18841e];return _0x49db81;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index e5b7dc6..aa0d02d 100644 --- a/server/services/ami/model/trunk.js +++ b/server/services/ami/model/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6572=['active','name','unknown','status','registry','domain','domainport','stateRegistry','registrationtime','address','defaultuser','exports'];(function(_0x152aa1,_0x307718){var _0x1bc01a=function(_0xd3211e){while(--_0xd3211e){_0x152aa1['push'](_0x152aa1['shift']());}};_0x1bc01a(++_0x307718);}(_0x6572,0x1ec));var _0x2657=function(_0x584665,_0x2071af){_0x584665=_0x584665-0x0;var _0x4292e7=_0x6572[_0x584665];return _0x4292e7;};'use strict';function Trunk(_0x3b715b){this['id']=_0x3b715b['id']||0x0;this['active']=_0x3b715b[_0x2657('0x0')]||![];this['name']=_0x3b715b[_0x2657('0x1')]||'';this['state']=_0x2657('0x2');this['stateTime']=0x0;this[_0x2657('0x3')]=_0x2657('0x2');this[_0x2657('0x4')]=_0x3b715b[_0x2657('0x4')]&&_0x3b715b[_0x2657('0x4')]['indexOf'](':')?_0x3b715b[_0x2657('0x4')]['split'](':')[0x0]:'';this['host']='';this['port']='';this[_0x2657('0x5')]='';this[_0x2657('0x6')]='';this['refresh']='';this[_0x2657('0x7')]='unknown';this[_0x2657('0x8')]='';this[_0x2657('0x9')]='';this[_0x2657('0xa')]=_0x3b715b['defaultuser']||'';}module[_0x2657('0xb')]=Trunk; \ No newline at end of file +var _0x7924=['exports','active','name','state','unknown','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7924,0x100));var _0x4792=function(_0x3cd451,_0x26e81a){_0x3cd451=_0x3cd451-0x0;var _0x571ce6=_0x7924[_0x3cd451];return _0x571ce6;};'use strict';function Trunk(_0x92874a){this['id']=_0x92874a['id']||0x0;this[_0x4792('0x0')]=_0x92874a[_0x4792('0x0')]||![];this[_0x4792('0x1')]=_0x92874a[_0x4792('0x1')]||'';this[_0x4792('0x2')]=_0x4792('0x3');this['stateTime']=0x0;this[_0x4792('0x4')]=_0x4792('0x3');this[_0x4792('0x5')]=_0x92874a[_0x4792('0x5')]&&_0x92874a[_0x4792('0x5')][_0x4792('0x6')](':')?_0x92874a[_0x4792('0x5')][_0x4792('0x7')](':')[0x0]:'';this[_0x4792('0x8')]='';this[_0x4792('0x9')]='';this[_0x4792('0xa')]='';this[_0x4792('0xb')]='';this[_0x4792('0xc')]='';this[_0x4792('0xd')]='unknown';this[_0x4792('0xe')]='';this['address']='';this[_0x4792('0xf')]=_0x92874a['defaultuser']||'';}module[_0x4792('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 6dacddb..9014c84 100644 --- a/server/services/ami/model/voiceExtension.js +++ b/server/services/ami/model/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a9d=['recordingFormat','none','mandatoryDisposition'];(function(_0x27f4fd,_0x59eb22){var _0x541fd6=function(_0x496947){while(--_0x496947){_0x27f4fd['push'](_0x27f4fd['shift']());}};_0x541fd6(++_0x59eb22);}(_0x0a9d,0x7e));var _0xd0a9=function(_0x102a48,_0xa47f8a){_0x102a48=_0x102a48-0x0;var _0x4dddb6=_0x0a9d[_0x102a48];return _0x4dddb6;};'use strict';function voiceExtension(_0x1de64f){this['id']=_0x1de64f['id']||0x0;this['exten']=_0x1de64f['exten']||'';this[_0xd0a9('0x0')]=_0x1de64f['recordingFormat']||_0xd0a9('0x1');this['mandatoryDisposition']=_0x1de64f[_0xd0a9('0x2')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x6e72=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x4df408,_0x46500f){var _0x40308f=function(_0x478229){while(--_0x478229){_0x4df408['push'](_0x4df408['shift']());}};_0x40308f(++_0x46500f);}(_0x6e72,0xa4));var _0x26e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e72[_0x14add3];return _0x4a174f;};'use strict';function voiceExtension(_0x4af276){this['id']=_0x4af276['id']||0x0;this[_0x26e7('0x0')]=_0x4af276[_0x26e7('0x0')]||'';this[_0x26e7('0x1')]=_0x4af276[_0x26e7('0x1')]||_0x26e7('0x2');this['mandatoryDisposition']=_0x4af276[_0x26e7('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 8c49629..2b2df64 100644 --- a/server/services/ami/model/voiceQueue.js +++ b/server/services/ami/model/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeada=['notInUse','onHold','paused','unavailable','unknown','acw','acwTimeout','autopause','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','roundrobin','wrandom','name','monitor_format','type','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','loggedIn'];(function(_0x181466,_0x473f4e){var _0x1b68ec=function(_0x27ecee){while(--_0x27ecee){_0x181466['push'](_0x181466['shift']());}};_0x1b68ec(++_0x473f4e);}(_0xeada,0x15d));var _0xaead=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xeada[_0x2641f9];return _0x585741;};'use strict';var monitorFormat={'wav':_0xaead('0x0'),'wav49':_0xaead('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0xaead('0x2'),'leastrecent':_0xaead('0x3'),'linear':'linear','random':'random','ringall':'ringall','rr':_0xaead('0x4'),'rrmemory':'rrmemory','rrordered':'rrordered','wrandom':_0xaead('0x5')};function VoiceQueue(_0x4cf2a1){this['id']=_0x4cf2a1['id']||0x0;this['name']=_0x4cf2a1[_0xaead('0x6')]||'';this['monitor_format']=_0x4cf2a1[_0xaead('0x7')]||'';this[_0xaead('0x8')]=_0x4cf2a1['type']||'inbound';this['waiting']=0x0;this['total']=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0xaead('0x9')]=0x0;this[_0xaead('0xa')]=0x0;this[_0xaead('0xb')]=0x0;this[_0xaead('0xc')]=0x0;this[_0xaead('0xd')]=0x0;this[_0xaead('0xe')]=0x0;this[_0xaead('0xf')]=0x0;this['invalid']=0x0;this[_0xaead('0x10')]=0x0;this[_0xaead('0x11')]=0x0;this[_0xaead('0x12')]=0x0;this[_0xaead('0x13')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this['talking']=0x0;this[_0xaead('0x14')]=0x0;this[_0xaead('0x15')]=0x0;this[_0xaead('0x16')]=_0x4cf2a1['acw']||![];this['acwTimeout']=_0x4cf2a1[_0xaead('0x17')]||0xa;this[_0xaead('0x18')]=_0x4cf2a1[_0xaead('0x18')]||'no';this['sendMessageOneNotActive']=!![];this[_0xaead('0x19')]='';this[_0xaead('0x1a')]='';this[_0xaead('0x1b')]=0x0;this[_0xaead('0x1c')]=0x0;this[_0xaead('0x1d')]=_0x4cf2a1[_0xaead('0x1d')]||null;this[_0xaead('0x1e')]=_0x4cf2a1[_0xaead('0x1e')]?_0x4cf2a1[_0xaead('0x1e')]:null;this[_0xaead('0x1f')]=_0x4cf2a1[_0xaead('0x1f')];this[_0xaead('0x20')]=_0x4cf2a1[_0xaead('0x20')]||_0xaead('0x21');this[_0xaead('0x22')]=_0x4cf2a1[_0xaead('0x22')]||0x0;this[_0xaead('0x23')]=_0x4cf2a1[_0xaead('0x23')]||0x0;this[_0xaead('0x24')]=_0x4cf2a1[_0xaead('0x24')]||0x1;this[_0xaead('0x25')]=_0x4cf2a1[_0xaead('0x25')]||_0xaead('0x26');this[_0xaead('0x27')]=_0x4cf2a1[_0xaead('0x27')]||0.03;this[_0xaead('0x28')]=_0x4cf2a1[_0xaead('0x28')]||0x258;this[_0xaead('0x29')]=_0x4cf2a1[_0xaead('0x29')]||_0xaead('0x2a');this[_0xaead('0x2b')]=_0x4cf2a1[_0xaead('0x2b')]||'anonymous';this[_0xaead('0x2c')]=_0x4cf2a1['dialOriginateTimeout']||0x1e;this[_0xaead('0x2d')]=_0x4cf2a1[_0xaead('0x2d')]||_0xaead('0x2e');this[_0xaead('0x2f')]=_0x4cf2a1[_0xaead('0x2f')]||0x3;this[_0xaead('0x30')]=_0x4cf2a1[_0xaead('0x30')]||undefined;this[_0xaead('0x31')]=_0x4cf2a1['dialCongestionMaxRetry']||0x3;this[_0xaead('0x32')]=_0x4cf2a1[_0xaead('0x32')]||0x96;this['dialBusyMaxRetry']=_0x4cf2a1[_0xaead('0x33')]||0x3;this[_0xaead('0x34')]=_0x4cf2a1[_0xaead('0x34')]||0x96;this[_0xaead('0x35')]=_0x4cf2a1[_0xaead('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4cf2a1[_0xaead('0x36')]||0x96;this[_0xaead('0x37')]=_0x4cf2a1['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4cf2a1[_0xaead('0x38')]||0x96;this['dialDropMaxRetry']=_0x4cf2a1[_0xaead('0x39')]||0x3;this[_0xaead('0x3a')]=_0x4cf2a1[_0xaead('0x3a')]||0x96;this[_0xaead('0x3b')]=_0x4cf2a1[_0xaead('0x3b')]||0x3;this['dialAbandonedRetryFrequency']=_0x4cf2a1[_0xaead('0x3c')]||0x96;this[_0xaead('0x3d')]=_0x4cf2a1[_0xaead('0x3d')]||0x3;this[_0xaead('0x3e')]=_0x4cf2a1[_0xaead('0x3e')]||0x96;this['dialAgentRejectMaxRetry']=_0x4cf2a1[_0xaead('0x3f')]||0x3;this[_0xaead('0x40')]=_0x4cf2a1[_0xaead('0x40')]||0x96;this[_0xaead('0x41')]=_0x4cf2a1[_0xaead('0x41')]||0x3;this[_0xaead('0x42')]=_0x4cf2a1['dialGlobalMaxRetry']||0x4;this[_0xaead('0x43')]=_0x4cf2a1[_0xaead('0x43')]?_0x4cf2a1[_0xaead('0x43')]:undefined;this[_0xaead('0x44')]=_0x4cf2a1['TrunkBackup']?_0x4cf2a1[_0xaead('0x44')]:undefined;this[_0xaead('0x45')]=_0x4cf2a1['dialPrefix']||undefined;this[_0xaead('0x46')]=_0x4cf2a1[_0xaead('0x46')]?_0x4cf2a1['Interval']:undefined;this['dialOrderByScheduledAt']=_0x4cf2a1[_0xaead('0x47')]||'DESC';this[_0xaead('0x48')]=_0x4cf2a1[_0xaead('0x48')]||undefined;this[_0xaead('0x49')]=_0x4cf2a1[_0xaead('0x49')]||undefined;this['strategy']=strategy[_0x4cf2a1[_0xaead('0x4a')]];this['queueStatusComplete']=!![];this[_0xaead('0x4b')]=_0x4cf2a1[_0xaead('0x4b')]||![];this['dialAMDInitialSilence']=_0x4cf2a1[_0xaead('0x4c')];this[_0xaead('0x4d')]=_0x4cf2a1[_0xaead('0x4d')];this[_0xaead('0x4e')]=_0x4cf2a1[_0xaead('0x4e')];this[_0xaead('0x4f')]=_0x4cf2a1[_0xaead('0x4f')];this[_0xaead('0x50')]=_0x4cf2a1[_0xaead('0x50')];this[_0xaead('0x51')]=_0x4cf2a1[_0xaead('0x51')];this['dialAMDMaximumNumberOfWords']=_0x4cf2a1[_0xaead('0x52')];this[_0xaead('0x53')]=_0x4cf2a1[_0xaead('0x53')];this[_0xaead('0x54')]=_0x4cf2a1[_0xaead('0x54')];this[_0xaead('0x55')]=0x0;this[_0xaead('0x56')]=0x0;this[_0xaead('0x57')]=_0x4cf2a1[_0xaead('0x57')];this['outboundAnswerCallsDay']=0x0;this[_0xaead('0x58')]=0x0;this[_0xaead('0x59')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xaead('0x5a')]=0x0;this[_0xaead('0x5b')]=0x0;this[_0xaead('0x5c')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xaead('0x5d')]=0x0;this[_0xaead('0x5e')]=0x0;this[_0xaead('0x5f')]=0x0;this[_0xaead('0x60')]=undefined;this[_0xaead('0x61')]=undefined;this[_0xaead('0x62')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xaead('0x63')]=0x0;this[_0xaead('0x64')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xaead('0x65')]=0x0;this[_0xaead('0x66')]=0x0;this[_0xaead('0x67')]=0x0;this[_0xaead('0x68')]=0x0;this[_0xaead('0x69')]=0x0;this['predictiveIntervalMaxThreshold']=_0x4cf2a1[_0xaead('0x6a')]||0x14;this[_0xaead('0x6b')]=_0x4cf2a1['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xaead('0x6c')]=0x1;this[_0xaead('0x6d')]=0x0;this[_0xaead('0x6e')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4cf2a1[_0xaead('0x6f')]||0x1e;this[_0xaead('0x70')]=_0x4cf2a1[_0xaead('0x70')]||![];this[_0xaead('0x71')]=!!_0x4cf2a1['dialPreviewAutoRecallMe']||![];this[_0xaead('0x72')]=!!_0x4cf2a1['dialPreviewRecallmeReminder']||![];this[_0xaead('0x73')]=_0x4cf2a1[_0xaead('0x73')]||undefined;this[_0xaead('0x74')]=_0x4cf2a1[_0xaead('0x74')]||![];this[_0xaead('0x75')]=_0x4cf2a1[_0xaead('0x75')]||![];this[_0xaead('0x7')]=monitorFormat[_0x4cf2a1[_0xaead('0x7')]]?monitorFormat[_0x4cf2a1['monitor_format']]:undefined;this[_0xaead('0x76')]=_0x4cf2a1[_0xaead('0x76')]||![];this[_0xaead('0x77')]=_0x4cf2a1['mandatoryDispositionPause']?_0x4cf2a1[_0xaead('0x77')]:undefined;this[_0xaead('0x78')]=![];}module[_0xaead('0x79')]=VoiceQueue; \ No newline at end of file +var _0xb1c0=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','sumDuration','sumHoldTime','sumBillable','abandoned','busy','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x352992,_0x320de0){var _0x18c4f3=function(_0x579c14){while(--_0x579c14){_0x352992['push'](_0x352992['shift']());}};_0x18c4f3(++_0x320de0);}(_0xb1c0,0xb8));var _0x0b1c=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb1c0[_0x4e676e];return _0x336a3c;};'use strict';var monitorFormat={'wav':_0x0b1c('0x0'),'wav49':_0x0b1c('0x1'),'gsm':_0x0b1c('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0x0b1c('0x3'),'linear':_0x0b1c('0x4'),'random':_0x0b1c('0x5'),'ringall':_0x0b1c('0x6'),'rr':_0x0b1c('0x7'),'rrmemory':_0x0b1c('0x8'),'rrordered':_0x0b1c('0x9'),'wrandom':'wrandom'};function VoiceQueue(_0x4d3158){this['id']=_0x4d3158['id']||0x0;this[_0x0b1c('0xa')]=_0x4d3158[_0x0b1c('0xa')]||'';this['monitor_format']=_0x4d3158[_0x0b1c('0xb')]||'';this['type']=_0x4d3158[_0x0b1c('0xc')]||_0x0b1c('0xd');this[_0x0b1c('0xe')]=0x0;this[_0x0b1c('0xf')]=0x0;this['answered']=0x0;this[_0x0b1c('0x10')]=0x0;this[_0x0b1c('0x11')]=0x0;this[_0x0b1c('0x12')]=0x0;this['unmanaged']=0x0;this[_0x0b1c('0x13')]=0x0;this['available']=0x0;this[_0x0b1c('0x14')]=0x0;this['inUse']=0x0;this[_0x0b1c('0x15')]=0x0;this[_0x0b1c('0x16')]=0x0;this[_0x0b1c('0x17')]=0x0;this[_0x0b1c('0x18')]=0x0;this[_0x0b1c('0x19')]=0x0;this[_0x0b1c('0x1a')]=0x0;this[_0x0b1c('0x1b')]=0x0;this[_0x0b1c('0x1c')]=0x0;this['unavailable']=0x0;this[_0x0b1c('0x1d')]=0x0;this['acw']=_0x4d3158[_0x0b1c('0x1e')]||![];this[_0x0b1c('0x1f')]=_0x4d3158[_0x0b1c('0x1f')]||0xa;this[_0x0b1c('0x20')]=_0x4d3158[_0x0b1c('0x20')]||'no';this[_0x0b1c('0x21')]=!![];this[_0x0b1c('0x22')]='';this['statusMessage']='';this[_0x0b1c('0x23')]=0x0;this[_0x0b1c('0x24')]=0x0;this[_0x0b1c('0x25')]=_0x4d3158[_0x0b1c('0x25')]||null;this['dialGlobalInterval']=_0x4d3158[_0x0b1c('0x26')]?_0x4d3158[_0x0b1c('0x26')]:null;this[_0x0b1c('0x27')]=_0x4d3158[_0x0b1c('0x27')];this[_0x0b1c('0x28')]=_0x4d3158[_0x0b1c('0x28')]||_0x0b1c('0x29');this[_0x0b1c('0x2a')]=_0x4d3158[_0x0b1c('0x2a')]||0x0;this[_0x0b1c('0x2b')]=_0x4d3158[_0x0b1c('0x2b')]||0x0;this[_0x0b1c('0x2c')]=_0x4d3158[_0x0b1c('0x2c')]||0x1;this[_0x0b1c('0x2d')]=_0x4d3158[_0x0b1c('0x2d')]||_0x0b1c('0x2e');this[_0x0b1c('0x2f')]=_0x4d3158['dialPredictiveOptimizationPercentage']||0.03;this[_0x0b1c('0x30')]=_0x4d3158[_0x0b1c('0x30')]||0x258;this[_0x0b1c('0x31')]=_0x4d3158[_0x0b1c('0x31')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x4d3158[_0x0b1c('0x32')]||'anonymous';this[_0x0b1c('0x33')]=_0x4d3158[_0x0b1c('0x33')]||0x1e;this['dialQueueOptions']=_0x4d3158[_0x0b1c('0x34')]||_0x0b1c('0x35');this[_0x0b1c('0x36')]=_0x4d3158[_0x0b1c('0x36')]||0x3;this[_0x0b1c('0x37')]=_0x4d3158[_0x0b1c('0x37')]||undefined;this[_0x0b1c('0x38')]=_0x4d3158[_0x0b1c('0x38')]||0x3;this[_0x0b1c('0x39')]=_0x4d3158[_0x0b1c('0x39')]||0x96;this['dialBusyMaxRetry']=_0x4d3158[_0x0b1c('0x3a')]||0x3;this['dialBusyRetryFrequency']=_0x4d3158[_0x0b1c('0x3b')]||0x96;this[_0x0b1c('0x3c')]=_0x4d3158[_0x0b1c('0x3c')]||0x3;this[_0x0b1c('0x3d')]=_0x4d3158[_0x0b1c('0x3d')]||0x96;this[_0x0b1c('0x3e')]=_0x4d3158[_0x0b1c('0x3e')]||0x3;this[_0x0b1c('0x3f')]=_0x4d3158[_0x0b1c('0x3f')]||0x96;this[_0x0b1c('0x40')]=_0x4d3158['dialDropMaxRetry']||0x3;this[_0x0b1c('0x41')]=_0x4d3158[_0x0b1c('0x41')]||0x96;this[_0x0b1c('0x42')]=_0x4d3158['dialAbandonedMaxRetry']||0x3;this[_0x0b1c('0x43')]=_0x4d3158[_0x0b1c('0x43')]||0x96;this['dialMachineMaxRetry']=_0x4d3158[_0x0b1c('0x44')]||0x3;this[_0x0b1c('0x45')]=_0x4d3158['dialMachineRetryFrequency']||0x96;this[_0x0b1c('0x46')]=_0x4d3158['dialAgentRejectMaxRetry']||0x3;this[_0x0b1c('0x47')]=_0x4d3158[_0x0b1c('0x47')]||0x96;this['callAdditionalPhoneAfterMin']=_0x4d3158[_0x0b1c('0x48')]||0x3;this[_0x0b1c('0x49')]=_0x4d3158[_0x0b1c('0x49')]||0x4;this[_0x0b1c('0x4a')]=_0x4d3158[_0x0b1c('0x4a')]?_0x4d3158[_0x0b1c('0x4a')]:undefined;this[_0x0b1c('0x4b')]=_0x4d3158[_0x0b1c('0x4b')]?_0x4d3158[_0x0b1c('0x4b')]:undefined;this[_0x0b1c('0x4c')]=_0x4d3158[_0x0b1c('0x4c')]||undefined;this[_0x0b1c('0x4d')]=_0x4d3158[_0x0b1c('0x4d')]?_0x4d3158[_0x0b1c('0x4d')]:undefined;this['dialOrderByScheduledAt']=_0x4d3158[_0x0b1c('0x4e')]||_0x0b1c('0x4f');this[_0x0b1c('0x50')]=_0x4d3158[_0x0b1c('0x50')]||undefined;this[_0x0b1c('0x51')]=_0x4d3158[_0x0b1c('0x51')]||undefined;this[_0x0b1c('0x52')]=strategy[_0x4d3158[_0x0b1c('0x52')]];this[_0x0b1c('0x53')]=!![];this[_0x0b1c('0x54')]=_0x4d3158[_0x0b1c('0x54')]||![];this[_0x0b1c('0x55')]=_0x4d3158[_0x0b1c('0x55')];this[_0x0b1c('0x56')]=_0x4d3158['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x4d3158[_0x0b1c('0x57')];this['dialAMDTotalAnalysisTime']=_0x4d3158[_0x0b1c('0x58')];this[_0x0b1c('0x59')]=_0x4d3158['dialAMDMinWordLength'];this[_0x0b1c('0x5a')]=_0x4d3158[_0x0b1c('0x5a')];this[_0x0b1c('0x5b')]=_0x4d3158[_0x0b1c('0x5b')];this[_0x0b1c('0x5c')]=_0x4d3158[_0x0b1c('0x5c')];this[_0x0b1c('0x5d')]=_0x4d3158[_0x0b1c('0x5d')];this[_0x0b1c('0x5e')]=0x0;this[_0x0b1c('0x5f')]=0x0;this[_0x0b1c('0x60')]=_0x4d3158[_0x0b1c('0x60')];this['outboundAnswerCallsDay']=0x0;this[_0x0b1c('0x61')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x0b1c('0x62')]=0x0;this[_0x0b1c('0x63')]=0x0;this[_0x0b1c('0x64')]=0x0;this[_0x0b1c('0x65')]=0x0;this[_0x0b1c('0x66')]=0x0;this[_0x0b1c('0x67')]=0x0;this[_0x0b1c('0x68')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x0b1c('0x69')]=0x0;this[_0x0b1c('0x6a')]=0x0;this[_0x0b1c('0x6b')]=0x0;this[_0x0b1c('0x6c')]=undefined;this[_0x0b1c('0x6d')]=undefined;this['handlePredictive']=undefined;this[_0x0b1c('0x6e')]=1.05;this[_0x0b1c('0x6f')]=0x0;this[_0x0b1c('0x70')]=0x0;this[_0x0b1c('0x71')]=0x0;this[_0x0b1c('0x72')]=0x0;this[_0x0b1c('0x73')]=0x0;this[_0x0b1c('0x74')]=0x0;this[_0x0b1c('0x75')]=0x0;this[_0x0b1c('0x76')]=0x0;this[_0x0b1c('0x77')]=_0x4d3158[_0x0b1c('0x78')]||0x14;this['predictiveIntervalMinThreshold']=_0x4d3158['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x0b1c('0x79')]=0x0;this[_0x0b1c('0x7a')]=0x0;this[_0x0b1c('0x7b')]=0x1;this[_0x0b1c('0x7c')]=0x0;this[_0x0b1c('0x7d')]=0x0;this[_0x0b1c('0x7e')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4d3158['dialRecallMeTimeout']||0x1e;this[_0x0b1c('0x7f')]=_0x4d3158[_0x0b1c('0x7f')]||![];this[_0x0b1c('0x80')]=!!_0x4d3158['dialPreviewAutoRecallMe']||![];this[_0x0b1c('0x81')]=!!_0x4d3158[_0x0b1c('0x81')]||![];this[_0x0b1c('0x82')]=_0x4d3158[_0x0b1c('0x82')]||undefined;this[_0x0b1c('0x83')]=_0x4d3158[_0x0b1c('0x83')]||![];this[_0x0b1c('0x84')]=_0x4d3158['dialAgiAfterHangupAgent']||![];this[_0x0b1c('0xb')]=monitorFormat[_0x4d3158['monitor_format']]?monitorFormat[_0x4d3158['monitor_format']]:undefined;this[_0x0b1c('0x85')]=_0x4d3158[_0x0b1c('0x85')]||![];this[_0x0b1c('0x86')]=_0x4d3158[_0x0b1c('0x86')]?_0x4d3158['mandatoryDispositionPause']:undefined;this[_0x0b1c('0x87')]=![];}module[_0x0b1c('0x88')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 1367c75..e8139c8 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc474=['answered','inUse','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','paused','pTalking','sumBillable','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','type','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','unavailable','loggedin','callers','length','SIP/','online','includes','status','booked','keys','dialer','exten','compareToInboundQueue','compareToOutboundQueue','prototype','updateReportFromOutboundQueue','outboundAbandonedCallsDay','outboundNoSuchCallsDay','preview','exports','available','loggedIn','loggedInDb','ringing','talking','waiting'];(function(_0x32f5f0,_0x251be8){var _0x5e5a86=function(_0x38ca60){while(--_0x38ca60){_0x32f5f0['push'](_0x32f5f0['shift']());}};_0x5e5a86(++_0x251be8);}(_0xc474,0xfc));var _0x4c47=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xc474[_0xc4001c];return _0x49f7bc;};'use strict';var INBOUND_COUNTERS=[_0x4c47('0x0'),_0x4c47('0x1'),_0x4c47('0x2'),'paused',_0x4c47('0x3'),_0x4c47('0x4'),_0x4c47('0x5')];var OUTBOUND_COUNTERS=[_0x4c47('0x0'),_0x4c47('0x6'),_0x4c47('0x7'),_0x4c47('0x1'),_0x4c47('0x2'),'originated','outboundAbandonedCallsDay',_0x4c47('0x8'),_0x4c47('0x9'),_0x4c47('0xa'),_0x4c47('0xb'),_0x4c47('0xc'),'outboundNoSuchCallsDay',_0x4c47('0xd'),_0x4c47('0xe'),'outboundUnknownCallsDay',_0x4c47('0xf'),_0x4c47('0x10'),_0x4c47('0x4'),_0x4c47('0x11'),'sumDuration',_0x4c47('0x12'),'waiting'];function VoiceQueueSummary(_0xe03aab){this['id']=_0xe03aab['id'];this[_0x4c47('0x13')]=_0xe03aab[_0x4c47('0x13')];this['strategy']=_0xe03aab[_0x4c47('0x14')];this[_0x4c47('0x15')]=_0xe03aab['abandoned']||0x0;this[_0x4c47('0x6')]=_0xe03aab['answered']||0x0;this[_0x4c47('0x0')]=_0xe03aab[_0x4c47('0x0')]||0x0;this[_0x4c47('0x16')]=_0xe03aab[_0x4c47('0x16')]||0x0;this['inUse']=_0xe03aab[_0x4c47('0x7')]||0x0;this[_0x4c47('0x17')]=_0xe03aab[_0x4c47('0x17')]||0x0;this[_0x4c47('0x1')]=_0xe03aab['loggedIn']||0x0;this['loggedInDb']=_0xe03aab['loggedInDb']||0x0;this[_0x4c47('0x18')]=_0xe03aab[_0x4c47('0x18')]||0x0;this[_0x4c47('0x19')]=_0xe03aab['notInUse']||0x0;this[_0x4c47('0xf')]=_0xe03aab[_0x4c47('0xf')]||0x0;this[_0x4c47('0x3')]=_0xe03aab[_0x4c47('0x3')]||0x0;this['ringInUse']=_0xe03aab[_0x4c47('0x1a')];this['sumBillable']=_0xe03aab[_0x4c47('0x11')];this[_0x4c47('0x1b')]=_0xe03aab[_0x4c47('0x1b')];this[_0x4c47('0x1c')]=_0xe03aab['sumHoldTime']||0x0;this[_0x4c47('0x4')]=_0xe03aab[_0x4c47('0x4')]||0x0;this[_0x4c47('0x12')]=_0xe03aab[_0x4c47('0x12')]||0x0;this[_0x4c47('0x1d')]=_0xe03aab[_0x4c47('0x1d')];this['unavailable']=_0xe03aab['unavailable']||0x0;this['unknown']=_0xe03aab[_0x4c47('0x1e')]||0x0;this[_0x4c47('0x1f')]=_0xe03aab['unmanaged']||0x0;this[_0x4c47('0x5')]=_0xe03aab['waiting']||0x0;if(_0xe03aab[_0x4c47('0x1d')]==='outbound'){this['pTalking']=_0xe03aab['pTalking']||0x0;this[_0x4c47('0x20')]=_0xe03aab[_0x4c47('0x20')];this[_0x4c47('0x21')]=_0xe03aab['dialMethod'];this[_0x4c47('0x22')]=_0xe03aab[_0x4c47('0x22')];this[_0x4c47('0x23')]=_0xe03aab[_0x4c47('0x23')];this[_0x4c47('0x24')]=_0xe03aab[_0x4c47('0x24')];this[_0x4c47('0x25')]=_0xe03aab[_0x4c47('0x25')];this['temp']=_0xe03aab[_0x4c47('0x26')];this[_0x4c47('0x27')]=_0xe03aab['outboundAnswerAgiCallsDay'];this['outboundAnswerCallsDay']=_0xe03aab[_0x4c47('0x8')];this['outboundBlacklistCallsDay']=_0xe03aab['outboundBlacklistCallsDay'];this[_0x4c47('0xa')]=_0xe03aab[_0x4c47('0xa')];this[_0x4c47('0xb')]=_0xe03aab[_0x4c47('0xb')];this[_0x4c47('0x28')]=_0xe03aab['outboundDropCallsDayACS'];this[_0x4c47('0x29')]=_0xe03aab['outboundDropCallsDayCallersExit'];this[_0x4c47('0x2a')]=_0xe03aab[_0x4c47('0x2a')];this[_0x4c47('0xc')]=_0xe03aab['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0xe03aab['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0xe03aab[_0x4c47('0x2b')];this[_0x4c47('0xd')]=_0xe03aab[_0x4c47('0xd')];this['outboundRejectCallsDay']=_0xe03aab[_0x4c47('0xe')];this['outboundUnknownCallsDay']=_0xe03aab[_0x4c47('0x2c')];this[_0x4c47('0x2d')]=_0xe03aab[_0x4c47('0x2d')];this[_0x4c47('0x2e')]=_0xe03aab[_0x4c47('0x2e')];this[_0x4c47('0x2f')]=_0xe03aab[_0x4c47('0x2f')];this[_0x4c47('0x30')]=_0xe03aab['predictiveIntervalDroppedCallsCallersExit'];this[_0x4c47('0x31')]=_0xe03aab[_0x4c47('0x31')];this[_0x4c47('0x32')]=_0xe03aab[_0x4c47('0x32')];this['predictiveIntervalErlangCallsDroppedCalls']=_0xe03aab['predictiveIntervalErlangCallsDroppedCalls'];this['predictiveIntervalHitRate']=_0xe03aab[_0x4c47('0x33')];this[_0x4c47('0x34')]=_0xe03aab[_0x4c47('0x34')];this['predictiveIntervalPauses']=_0xe03aab['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0xe03aab['predictiveIntervalAvailable'];this[_0x4c47('0x35')]=_0xe03aab[_0x4c47('0x35')];this[_0x4c47('0x36')]=_0xe03aab[_0x4c47('0x36')];this[_0x4c47('0x37')]=_0xe03aab['erlangCalls'];this[_0x4c47('0x38')]=_0xe03aab[_0x4c47('0x38')];this['erlangAbandonmentRate']=_0xe03aab[_0x4c47('0x39')];this[_0x4c47('0x3a')]=_0xe03aab[_0x4c47('0x3a')];this[_0x4c47('0x3b')]=_0xe03aab[_0x4c47('0x3b')];this['startProgressive']=_0xe03aab[_0x4c47('0x3c')];this[_0x4c47('0x3d')]=_0xe03aab[_0x4c47('0x3d')];this[_0x4c47('0x3e')]=_0xe03aab[_0x4c47('0x3e')];}if(_0xe03aab['Trunk']){this[_0x4c47('0x3f')]={'id':_0xe03aab[_0x4c47('0x3f')]['id'],'name':_0xe03aab['Trunk'][_0x4c47('0x13')],'active':_0xe03aab['Trunk'][_0x4c47('0x40')],'callerid':_0xe03aab[_0x4c47('0x3f')][_0x4c47('0x41')]};}}VoiceQueueSummary['prototype']['createReport']=function(_0x164105,_0x4b52f5,_0x1c1246,_0x5e1dba){this[_0x4c47('0x2')]=0x0;this[_0x4c47('0x4')]=0x0;this[_0x4c47('0xf')]=0x0;this['unknown']=0x0;this[_0x4c47('0x19')]=0x0;this[_0x4c47('0x7')]=0x0;this[_0x4c47('0x16')]=0x0;this[_0x4c47('0x17')]=0x0;this[_0x4c47('0x42')]=0x0;this[_0x4c47('0x3')]=0x0;this[_0x4c47('0x1a')]=0x0;this[_0x4c47('0x18')]=0x0;if(_0x1c1246){if(_0x1c1246[_0x4c47('0x0')]){this[_0x4c47('0x0')]=Number(_0x1c1246['available']);}if(_0x1c1246[_0x4c47('0x43')]){this[_0x4c47('0x1')]=Number(_0x1c1246['loggedin']);}if(_0x1c1246['callers']){this[_0x4c47('0x5')]=Number(_0x1c1246[_0x4c47('0x44')]);}}for(var _0x4fca32=0x0;_0x4fca32<_0x164105[_0x4c47('0x45')];_0x4fca32++){var _0x3922da=_0x4b52f5[_0x4c47('0x46')+_0x164105[_0x4fca32][_0x4c47('0x13')]];if(_0x3922da&&_0x3922da[_0x4c47('0x47')]){this['loggedInDb']+=0x1;}if(_0x164105[_0x4fca32]['incall']==='1'){this[_0x4c47('0x4')]+=0x1;}if(_0x164105[_0x4fca32][_0x4c47('0xf')]==='1'&&!['2','7','8'][_0x4c47('0x48')](_0x164105[_0x4fca32][_0x4c47('0x49')])){this[_0x4c47('0xf')]+=0x1;}switch(_0x164105[_0x4fca32][_0x4c47('0x49')]){case'0':this[_0x4c47('0x1e')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x4c47('0x7')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x4c47('0x17')]+=0x1;break;case'5':this[_0x4c47('0x42')]+=0x1;break;case'6':this[_0x4c47('0x3')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x4c47('0x18')]+=0x1;break;}}if(this[_0x4c47('0x21')]===_0x4c47('0x4a')){var _0x51fb93=Object[_0x4c47('0x4b')](_0x5e1dba);for(var _0x4ccb67=0x0;_0x4ccb67<_0x51fb93[_0x4c47('0x45')];_0x4ccb67++){var _0x5cdba2=_0x51fb93[_0x4ccb67];var _0x3263ff=_0x5e1dba[_0x5cdba2];if(_0x3263ff['queue']===this[_0x4c47('0x13')]&&_0x3263ff[_0x4c47('0x1d')]===_0x4c47('0x4c')&&_0x3263ff[_0x4c47('0x4d')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this[_0x4c47('0x4')]>this['inUse']){this[_0x4c47('0x4')]=this[_0x4c47('0x7')];}this[_0x4c47('0x10')]=0x0;}return this;};VoiceQueueSummary['prototype'][_0x4c47('0x4e')]=function(_0x2f2447){var _0x49196f=![];if(_0x2f2447){_0x49196f=INBOUND_COUNTERS['some'](function(_0x59d746){return this[_0x59d746]!==_0x2f2447[_0x59d746];},this);}return _0x49196f;};VoiceQueueSummary['prototype'][_0x4c47('0x4f')]=function(_0x3f403b){var _0x4048e7=![];var _0x386af4=![];var _0x5d2618=![];if(_0x3f403b){_0x4048e7=this[_0x4c47('0x21')]!==_0x3f403b[_0x4c47('0x21')]||this[_0x4c47('0x20')]!==_0x3f403b[_0x4c47('0x20')]||this[_0x4c47('0x3d')]!==_0x3f403b[_0x4c47('0x3d')]||this[_0x4c47('0x3e')]!==_0x3f403b[_0x4c47('0x3e')];_0x386af4=OUTBOUND_COUNTERS['some'](function(_0x1a9d6d){return this[_0x1a9d6d]!==_0x3f403b[_0x1a9d6d];},this);if(this[_0x4c47('0x3f')]&&_0x3f403b[_0x4c47('0x3f')]){_0x5d2618=this['Trunk']['name']!==_0x3f403b['Trunk'][_0x4c47('0x13')]||this[_0x4c47('0x3f')][_0x4c47('0x40')]!==_0x3f403b[_0x4c47('0x3f')][_0x4c47('0x40')];}}return _0x4048e7||_0x386af4||_0x5d2618;};VoiceQueueSummary[_0x4c47('0x50')][_0x4c47('0x51')]=function(_0x140df9){this[_0x4c47('0x6')]=_0x140df9[_0x4c47('0x6')];this['message']=_0x140df9['message'];this[_0x4c47('0x3e')]=_0x140df9[_0x4c47('0x3e')];this[_0x4c47('0x36')]=_0x140df9[_0x4c47('0x36')];this[_0x4c47('0x52')]=_0x140df9[_0x4c47('0x52')];this['outboundAnswerCallsDay']=_0x140df9[_0x4c47('0x8')];this['outboundBlacklistCallsDay']=_0x140df9['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x140df9[_0x4c47('0xa')];this[_0x4c47('0xb')]=_0x140df9[_0x4c47('0xb')];this[_0x4c47('0xc')]=_0x140df9[_0x4c47('0xc')];this[_0x4c47('0x53')]=_0x140df9[_0x4c47('0x53')];this['outboundReCallsDay']=_0x140df9['outboundReCallsDay'];this[_0x4c47('0xe')]=_0x140df9['outboundRejectCallsDay'];this[_0x4c47('0x2c')]=_0x140df9[_0x4c47('0x2c')];this[_0x4c47('0x11')]=_0x140df9['sumBillable'];this[_0x4c47('0x1b')]=_0x140df9[_0x4c47('0x1b')];this[_0x4c47('0x12')]=_0x140df9[_0x4c47('0x12')];if(this[_0x4c47('0x21')]===_0x4c47('0x54')){this[_0x4c47('0x10')]=_0x140df9['pTalking'];}};module[_0x4c47('0x55')]=VoiceQueueSummary; \ No newline at end of file +var _0xdc97=['notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','name','callerid','createReport','loggedin','callers','length','SIP/','online','status','keys','queue','dialer','exten','xcally-motion-preview','some','prototype','dialActive','active','updateReportFromOutboundQueue','outboundAbandonedCallsDay','outboundBusyCallsDay','preview','exports','available','loggedIn','loggedInDb','ringing','waiting','inUse','originated','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','paused','pTalking','talking','sumBillable','sumDuration','total','strategy','abandoned','answered','busy','invalid','onHold'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x466594,_0x58bbfe){_0x466594=_0x466594-0x0;var _0x1e03f4=_0xdc97[_0x466594];return _0x1e03f4;};'use strict';var INBOUND_COUNTERS=[_0x7dc9('0x0'),_0x7dc9('0x1'),_0x7dc9('0x2'),'paused',_0x7dc9('0x3'),'talking',_0x7dc9('0x4')];var OUTBOUND_COUNTERS=[_0x7dc9('0x0'),'answered',_0x7dc9('0x5'),_0x7dc9('0x1'),_0x7dc9('0x2'),_0x7dc9('0x6'),'outboundAbandonedCallsDay',_0x7dc9('0x7'),'outboundBlacklistCallsDay','outboundBusyCallsDay',_0x7dc9('0x8'),_0x7dc9('0x9'),_0x7dc9('0xa'),_0x7dc9('0xb'),_0x7dc9('0xc'),'outboundUnknownCallsDay',_0x7dc9('0xd'),_0x7dc9('0xe'),_0x7dc9('0xf'),_0x7dc9('0x10'),_0x7dc9('0x11'),_0x7dc9('0x12'),_0x7dc9('0x4')];function VoiceQueueSummary(_0x4e8e65){this['id']=_0x4e8e65['id'];this['name']=_0x4e8e65['name'];this['strategy']=_0x4e8e65[_0x7dc9('0x13')];this[_0x7dc9('0x14')]=_0x4e8e65['abandoned']||0x0;this[_0x7dc9('0x15')]=_0x4e8e65[_0x7dc9('0x15')]||0x0;this[_0x7dc9('0x0')]=_0x4e8e65[_0x7dc9('0x0')]||0x0;this[_0x7dc9('0x16')]=_0x4e8e65[_0x7dc9('0x16')]||0x0;this['inUse']=_0x4e8e65[_0x7dc9('0x5')]||0x0;this[_0x7dc9('0x17')]=_0x4e8e65[_0x7dc9('0x17')]||0x0;this[_0x7dc9('0x1')]=_0x4e8e65[_0x7dc9('0x1')]||0x0;this[_0x7dc9('0x2')]=_0x4e8e65[_0x7dc9('0x2')]||0x0;this[_0x7dc9('0x18')]=_0x4e8e65[_0x7dc9('0x18')]||0x0;this['notInUse']=_0x4e8e65[_0x7dc9('0x19')]||0x0;this['paused']=_0x4e8e65[_0x7dc9('0xd')]||0x0;this[_0x7dc9('0x3')]=_0x4e8e65['ringing']||0x0;this[_0x7dc9('0x1a')]=_0x4e8e65[_0x7dc9('0x1a')];this[_0x7dc9('0x10')]=_0x4e8e65[_0x7dc9('0x10')];this[_0x7dc9('0x11')]=_0x4e8e65[_0x7dc9('0x11')];this[_0x7dc9('0x1b')]=_0x4e8e65[_0x7dc9('0x1b')]||0x0;this[_0x7dc9('0xf')]=_0x4e8e65[_0x7dc9('0xf')]||0x0;this['total']=_0x4e8e65['total']||0x0;this[_0x7dc9('0x1c')]=_0x4e8e65[_0x7dc9('0x1c')];this['unavailable']=_0x4e8e65[_0x7dc9('0x1d')]||0x0;this[_0x7dc9('0x1e')]=_0x4e8e65['unknown']||0x0;this[_0x7dc9('0x1f')]=_0x4e8e65[_0x7dc9('0x1f')]||0x0;this[_0x7dc9('0x4')]=_0x4e8e65['waiting']||0x0;if(_0x4e8e65[_0x7dc9('0x1c')]===_0x7dc9('0x20')){this[_0x7dc9('0xe')]=_0x4e8e65['pTalking']||0x0;this['dialActive']=_0x4e8e65['dialActive'];this[_0x7dc9('0x21')]=_0x4e8e65[_0x7dc9('0x21')];this['dialOriginateCallerIdName']=_0x4e8e65['dialOriginateCallerIdName'];this[_0x7dc9('0x22')]=_0x4e8e65['dialOriginateCallerIdNumber'];this[_0x7dc9('0x23')]=_0x4e8e65[_0x7dc9('0x23')];this[_0x7dc9('0x24')]=_0x4e8e65[_0x7dc9('0x24')];this[_0x7dc9('0x25')]=_0x4e8e65[_0x7dc9('0x25')];this[_0x7dc9('0x26')]=_0x4e8e65[_0x7dc9('0x26')];this[_0x7dc9('0x7')]=_0x4e8e65[_0x7dc9('0x7')];this[_0x7dc9('0x27')]=_0x4e8e65[_0x7dc9('0x27')];this['outboundBusyCallsDay']=_0x4e8e65['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x4e8e65['outboundCongestionCallsDay'];this['outboundDropCallsDayACS']=_0x4e8e65['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x4e8e65['outboundDropCallsDayCallersExit'];this[_0x7dc9('0x28')]=_0x4e8e65[_0x7dc9('0x28')];this[_0x7dc9('0x9')]=_0x4e8e65[_0x7dc9('0x9')];this[_0x7dc9('0xa')]=_0x4e8e65[_0x7dc9('0xa')];this['outboundOriginateFailureCallsDay']=_0x4e8e65['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0x4e8e65[_0x7dc9('0xb')];this['outboundRejectCallsDay']=_0x4e8e65[_0x7dc9('0xc')];this[_0x7dc9('0x29')]=_0x4e8e65[_0x7dc9('0x29')];this[_0x7dc9('0x2a')]=_0x4e8e65[_0x7dc9('0x2a')];this[_0x7dc9('0x2b')]=_0x4e8e65[_0x7dc9('0x2b')];this[_0x7dc9('0x2c')]=_0x4e8e65['predictiveIntervalAvgTalktime'];this[_0x7dc9('0x2d')]=_0x4e8e65['predictiveIntervalDroppedCallsCallersExit'];this[_0x7dc9('0x2e')]=_0x4e8e65[_0x7dc9('0x2e')];this[_0x7dc9('0x2f')]=_0x4e8e65[_0x7dc9('0x2f')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x4e8e65[_0x7dc9('0x30')];this['predictiveIntervalHitRate']=_0x4e8e65[_0x7dc9('0x31')];this['predictiveIntervalMultiplicativeFactor']=_0x4e8e65['predictiveIntervalMultiplicativeFactor'];this[_0x7dc9('0x32')]=_0x4e8e65[_0x7dc9('0x32')];this[_0x7dc9('0x33')]=_0x4e8e65[_0x7dc9('0x33')];this['predictiveIntervalTotalCalls']=_0x4e8e65[_0x7dc9('0x34')];this[_0x7dc9('0x6')]=_0x4e8e65[_0x7dc9('0x6')];this[_0x7dc9('0x35')]=_0x4e8e65[_0x7dc9('0x35')];this[_0x7dc9('0x36')]=_0x4e8e65[_0x7dc9('0x36')];this[_0x7dc9('0x37')]=_0x4e8e65[_0x7dc9('0x37')];this[_0x7dc9('0x38')]=_0x4e8e65[_0x7dc9('0x38')];this[_0x7dc9('0x39')]=_0x4e8e65['startPredictive'];this[_0x7dc9('0x3a')]=_0x4e8e65[_0x7dc9('0x3a')];this[_0x7dc9('0x3b')]=_0x4e8e65[_0x7dc9('0x3b')];this['statusMessage']=_0x4e8e65[_0x7dc9('0x3c')];}if(_0x4e8e65[_0x7dc9('0x3d')]){this[_0x7dc9('0x3d')]={'id':_0x4e8e65[_0x7dc9('0x3d')]['id'],'name':_0x4e8e65[_0x7dc9('0x3d')][_0x7dc9('0x3e')],'active':_0x4e8e65['Trunk']['active'],'callerid':_0x4e8e65[_0x7dc9('0x3d')][_0x7dc9('0x3f')]};}}VoiceQueueSummary['prototype'][_0x7dc9('0x40')]=function(_0x4a37ec,_0x315d65,_0x2a91fe,_0x3bca9c){this['loggedInDb']=0x0;this[_0x7dc9('0xf')]=0x0;this[_0x7dc9('0xd')]=0x0;this[_0x7dc9('0x1e')]=0x0;this[_0x7dc9('0x19')]=0x0;this[_0x7dc9('0x5')]=0x0;this[_0x7dc9('0x16')]=0x0;this[_0x7dc9('0x17')]=0x0;this['unavailable']=0x0;this[_0x7dc9('0x3')]=0x0;this['ringInUse']=0x0;this['onHold']=0x0;if(_0x2a91fe){if(_0x2a91fe[_0x7dc9('0x0')]){this[_0x7dc9('0x0')]=Number(_0x2a91fe[_0x7dc9('0x0')]);}if(_0x2a91fe[_0x7dc9('0x41')]){this[_0x7dc9('0x1')]=Number(_0x2a91fe[_0x7dc9('0x41')]);}if(_0x2a91fe[_0x7dc9('0x42')]){this[_0x7dc9('0x4')]=Number(_0x2a91fe[_0x7dc9('0x42')]);}}for(var _0x573b48=0x0;_0x573b48<_0x4a37ec[_0x7dc9('0x43')];_0x573b48++){var _0x1971c7=_0x315d65[_0x7dc9('0x44')+_0x4a37ec[_0x573b48][_0x7dc9('0x3e')]];if(_0x1971c7&&_0x1971c7[_0x7dc9('0x45')]){this[_0x7dc9('0x2')]+=0x1;}if(_0x4a37ec[_0x573b48]['incall']==='1'){this[_0x7dc9('0xf')]+=0x1;}if(_0x4a37ec[_0x573b48][_0x7dc9('0xd')]==='1'&&!['2','7','8']['includes'](_0x4a37ec[_0x573b48][_0x7dc9('0x46')])){this[_0x7dc9('0xd')]+=0x1;}switch(_0x4a37ec[_0x573b48][_0x7dc9('0x46')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x7dc9('0x19')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x7dc9('0x17')]+=0x1;break;case'5':this[_0x7dc9('0x1d')]+=0x1;break;case'6':this[_0x7dc9('0x3')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x7dc9('0x21')]==='booked'){var _0xad7278=Object[_0x7dc9('0x47')](_0x3bca9c);for(var _0x5e2d59=0x0;_0x5e2d59<_0xad7278[_0x7dc9('0x43')];_0x5e2d59++){var _0x1d6c0a=_0xad7278[_0x5e2d59];var _0x1f2a6e=_0x3bca9c[_0x1d6c0a];if(_0x1f2a6e[_0x7dc9('0x48')]===this[_0x7dc9('0x3e')]&&_0x1f2a6e[_0x7dc9('0x1c')]===_0x7dc9('0x49')&&_0x1f2a6e[_0x7dc9('0x4a')]===_0x7dc9('0x4b')){this[_0x7dc9('0xf')]+=0x1;}}if(this[_0x7dc9('0xf')]>this[_0x7dc9('0x5')]){this[_0x7dc9('0xf')]=this['inUse'];}this[_0x7dc9('0xe')]=0x0;}return this;};VoiceQueueSummary['prototype']['compareToInboundQueue']=function(_0x446103){var _0x22423e=![];if(_0x446103){_0x22423e=INBOUND_COUNTERS[_0x7dc9('0x4c')](function(_0x3902aa){return this[_0x3902aa]!==_0x446103[_0x3902aa];},this);}return _0x22423e;};VoiceQueueSummary[_0x7dc9('0x4d')]['compareToOutboundQueue']=function(_0x1ae85b){var _0x2b2142=![];var _0x34f7b1=![];var _0x4a9b75=![];if(_0x1ae85b){_0x2b2142=this[_0x7dc9('0x21')]!==_0x1ae85b[_0x7dc9('0x21')]||this[_0x7dc9('0x4e')]!==_0x1ae85b[_0x7dc9('0x4e')]||this[_0x7dc9('0x3b')]!==_0x1ae85b[_0x7dc9('0x3b')]||this['statusMessage']!==_0x1ae85b[_0x7dc9('0x3c')];_0x34f7b1=OUTBOUND_COUNTERS[_0x7dc9('0x4c')](function(_0x2b0941){return this[_0x2b0941]!==_0x1ae85b[_0x2b0941];},this);if(this[_0x7dc9('0x3d')]&&_0x1ae85b[_0x7dc9('0x3d')]){_0x4a9b75=this[_0x7dc9('0x3d')][_0x7dc9('0x3e')]!==_0x1ae85b[_0x7dc9('0x3d')][_0x7dc9('0x3e')]||this[_0x7dc9('0x3d')][_0x7dc9('0x4f')]!==_0x1ae85b[_0x7dc9('0x3d')]['active'];}}return _0x2b2142||_0x34f7b1||_0x4a9b75;};VoiceQueueSummary[_0x7dc9('0x4d')][_0x7dc9('0x50')]=function(_0x38df9a){this[_0x7dc9('0x15')]=_0x38df9a[_0x7dc9('0x15')];this['message']=_0x38df9a[_0x7dc9('0x3b')];this[_0x7dc9('0x3c')]=_0x38df9a[_0x7dc9('0x3c')];this[_0x7dc9('0x6')]=_0x38df9a[_0x7dc9('0x6')];this[_0x7dc9('0x51')]=_0x38df9a['outboundAbandonedCallsDay'];this['outboundAnswerCallsDay']=_0x38df9a['outboundAnswerCallsDay'];this[_0x7dc9('0x27')]=_0x38df9a[_0x7dc9('0x27')];this[_0x7dc9('0x52')]=_0x38df9a[_0x7dc9('0x52')];this['outboundCongestionCallsDay']=_0x38df9a['outboundCongestionCallsDay'];this[_0x7dc9('0x9')]=_0x38df9a[_0x7dc9('0x9')];this[_0x7dc9('0xa')]=_0x38df9a[_0x7dc9('0xa')];this[_0x7dc9('0xb')]=_0x38df9a[_0x7dc9('0xb')];this[_0x7dc9('0xc')]=_0x38df9a['outboundRejectCallsDay'];this[_0x7dc9('0x29')]=_0x38df9a[_0x7dc9('0x29')];this[_0x7dc9('0x10')]=_0x38df9a[_0x7dc9('0x10')];this[_0x7dc9('0x11')]=_0x38df9a['sumDuration'];this[_0x7dc9('0x12')]=_0x38df9a[_0x7dc9('0x12')];if(this[_0x7dc9('0x21')]===_0x7dc9('0x53')){this[_0x7dc9('0xe')]=_0x38df9a[_0x7dc9('0xe')];}};module[_0x7dc9('0x54')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 64b16a2..92980d3 100644 --- a/server/services/ami/model/vtigerAccount.js +++ b/server/services/ami/model/vtigerAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc03=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x7aef09,_0x192202){var _0x224203=function(_0x864545){while(--_0x864545){_0x7aef09['push'](_0x7aef09['shift']());}};_0x224203(++_0x192202);}(_0xdc03,0x19e));var _0x3dc0=function(_0x2baf12,_0x2540e1){_0x2baf12=_0x2baf12-0x0;var _0xfa0d7b=_0xdc03[_0x2baf12];return _0xfa0d7b;};'use strict';function VtigerAccount(_0x366d1b){this['id']=_0x366d1b['id']||0x0;this[_0x3dc0('0x0')]=_0x366d1b[_0x3dc0('0x0')]||'';this[_0x3dc0('0x1')]=_0x366d1b['username']||'';this[_0x3dc0('0x2')]=_0x366d1b[_0x3dc0('0x2')]||'';this[_0x3dc0('0x3')]=_0x366d1b[_0x3dc0('0x3')]||'';this['serverUrl']=_0x366d1b[_0x3dc0('0x4')]||'';this[_0x3dc0('0x5')]=_0x366d1b['Configurations']||{};}module[_0x3dc0('0x6')]=VtigerAccount; \ No newline at end of file +var _0x64da=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1a5687,_0xc2188f){var _0x257d5c=function(_0x4a1783){while(--_0x4a1783){_0x1a5687['push'](_0x1a5687['shift']());}};_0x257d5c(++_0xc2188f);}(_0x64da,0x76));var _0xa64d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x64da[_0xa464c9];return _0x3d73c4;};'use strict';function VtigerAccount(_0x2c95e7){this['id']=_0x2c95e7['id']||0x0;this[_0xa64d('0x0')]=_0x2c95e7['name']||'';this[_0xa64d('0x1')]=_0x2c95e7[_0xa64d('0x1')]||'';this[_0xa64d('0x2')]=_0x2c95e7[_0xa64d('0x2')]||'';this['remoteUri']=_0x2c95e7[_0xa64d('0x3')]||'';this[_0xa64d('0x4')]=_0x2c95e7['serverUrl']||'';this['Configurations']=_0x2c95e7[_0xa64d('0x5')]||{};}module[_0xa64d('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 6756209..af7c6fd 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c88=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5c88,0x11e));var _0x85c8=function(_0x297a05,_0xdde71c){_0x297a05=_0x297a05-0x0;var _0x2b0517=_0x5c88[_0x297a05];return _0x2b0517;};'use strict';function ZendeskAccount(_0x3b8f72){this['id']=_0x3b8f72['id']||0x0;this[_0x85c8('0x0')]=_0x3b8f72[_0x85c8('0x0')]||'';this[_0x85c8('0x1')]=_0x3b8f72['username']||'';this['password']=_0x3b8f72[_0x85c8('0x2')]||'';this['token']=_0x3b8f72['token']||'';this[_0x85c8('0x3')]=_0x3b8f72['remoteUri']||'';this[_0x85c8('0x4')]=_0x3b8f72[_0x85c8('0x4')]||'';this[_0x85c8('0x5')]=_0x3b8f72[_0x85c8('0x5')]||_0x85c8('0x6');this[_0x85c8('0x7')]=_0x3b8f72[_0x85c8('0x7')]||'';this[_0x85c8('0x8')]=_0x3b8f72[_0x85c8('0x8')]||{};}module[_0x85c8('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x053f=['password','token','remoteUri','authType','type','integrationTab','serverUrl','exports','name','username'];(function(_0x21f078,_0x26fbe3){var _0x1f4967=function(_0x362bcc){while(--_0x362bcc){_0x21f078['push'](_0x21f078['shift']());}};_0x1f4967(++_0x26fbe3);}(_0x053f,0xbc));var _0xf053=function(_0x544f53,_0x816985){_0x544f53=_0x544f53-0x0;var _0x3704b7=_0x053f[_0x544f53];return _0x3704b7;};'use strict';function ZendeskAccount(_0x2cc51d){this['id']=_0x2cc51d['id']||0x0;this[_0xf053('0x0')]=_0x2cc51d[_0xf053('0x0')]||'';this[_0xf053('0x1')]=_0x2cc51d[_0xf053('0x1')]||'';this['password']=_0x2cc51d[_0xf053('0x2')]||'';this[_0xf053('0x3')]=_0x2cc51d['token']||'';this[_0xf053('0x4')]=_0x2cc51d[_0xf053('0x4')]||'';this[_0xf053('0x5')]=_0x2cc51d[_0xf053('0x5')]||'';this['type']=_0x2cc51d[_0xf053('0x6')]||_0xf053('0x7');this[_0xf053('0x8')]=_0x2cc51d[_0xf053('0x8')]||'';this['Configurations']=_0x2cc51d['Configurations']||{};}module[_0xf053('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index b9edf6e..b69cc76 100644 --- a/server/services/ami/model/zohoAccount.js +++ b/server/services/ami/model/zohoAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d6c=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4d6c,0xc6));var _0xc4d6=function(_0x34e0c3,_0x2878b4){_0x34e0c3=_0x34e0c3-0x0;var _0x111e97=_0x4d6c[_0x34e0c3];return _0x111e97;};'use strict';function ZohoAccount(_0x41ddf8){this['id']=_0x41ddf8['id']||0x0;this[_0xc4d6('0x0')]=_0x41ddf8['name']||'';this['description']=_0x41ddf8[_0xc4d6('0x1')]||'';this[_0xc4d6('0x2')]=_0x41ddf8['host']||'';this[_0xc4d6('0x3')]=_0x41ddf8[_0xc4d6('0x3')]||'';this[_0xc4d6('0x4')]=_0x41ddf8[_0xc4d6('0x4')]||'';this[_0xc4d6('0x5')]=_0x41ddf8[_0xc4d6('0x5')]||'';this[_0xc4d6('0x6')]=_0x41ddf8[_0xc4d6('0x6')]||'';this[_0xc4d6('0x7')]=_0x41ddf8['code']||'';this[_0xc4d6('0x8')]=_0x41ddf8[_0xc4d6('0x8')]||'';this[_0xc4d6('0x9')]=_0x41ddf8['Configurations']||{};}module[_0xc4d6('0xa')]=ZohoAccount; \ No newline at end of file +var _0xcc15=['refreshToken','Configurations','name','description','zone','clientId','clientSecret','serverUrl','code'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xcc15,0x65));var _0x5cc1=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xcc15[_0x8c43de];return _0xa6591b;};'use strict';function ZohoAccount(_0x556756){this['id']=_0x556756['id']||0x0;this[_0x5cc1('0x0')]=_0x556756[_0x5cc1('0x0')]||'';this[_0x5cc1('0x1')]=_0x556756['description']||'';this['host']=_0x556756['host']||'';this[_0x5cc1('0x2')]=_0x556756[_0x5cc1('0x2')]||'';this[_0x5cc1('0x3')]=_0x556756['clientId']||'';this['clientSecret']=_0x556756[_0x5cc1('0x4')]||'';this[_0x5cc1('0x5')]=_0x556756[_0x5cc1('0x5')]||'';this[_0x5cc1('0x6')]=_0x556756[_0x5cc1('0x6')]||'';this[_0x5cc1('0x7')]=_0x556756[_0x5cc1('0x7')]||'';this[_0x5cc1('0x8')]=_0x556756[_0x5cc1('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 49da2fe..060f266 100644 --- a/server/services/ami/preview/action.js +++ b/server/services/ami/preview/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf2f=['lodash','moment','isNil','string','uniqueid','idContact','queue','name','dialAnswer','Agent','format','SIP/%s','membername','calleridname','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0xcf2f,0xa7));var _0xfcf2=function(_0xec968d,_0x5e640d){_0xec968d=_0xec968d-0x0;var _0x33873d=_0xcf2f[_0xec968d];return _0x33873d;};'use strict';var util=require(_0xfcf2('0x0'));var _=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));function checkNameSurname(_0x3165cf,_0x343fc4,_0x5637be){var _0x16c210='';if(!_[_0xfcf2('0x3')](_0x343fc4)&&_0xfcf2('0x4')===typeof _0x343fc4){_0x16c210+=_0x343fc4;}if(!_[_0xfcf2('0x3')](_0x5637be)&&_0xfcf2('0x4')===typeof _0x5637be){_0x16c210+='\x20'+_0x5637be;}if(_0x16c210!==''){return _0x16c210;}return _0x3165cf;}function Action(_0x167a77,_0x1e6d99,_0x3a4950,_0x41d4bd,_0x157f48){this[_0xfcf2('0x5')]=_0x3a4950||undefined;this[_0xfcf2('0x6')]=_0x167a77['id'];this[_0xfcf2('0x7')]=_0x1e6d99[_0xfcf2('0x8')];this['type']=_0x1e6d99['type'];this['campaigntype']=_0xfcf2('0x7');this[_0xfcf2('0x9')]=![];this['membername']=_[_0xfcf2('0x3')](_0x167a77[_0xfcf2('0xa')])?undefined:_0x167a77[_0xfcf2('0xa')][_0xfcf2('0x8')];this['channelAgent']=this['membername']?util[_0xfcf2('0xb')](_0xfcf2('0xc'),this[_0xfcf2('0xd')]):_0x41d4bd||undefined;this[_0xfcf2('0xe')]=checkNameSurname(_0x167a77['Contact'][_0xfcf2('0xf')],_0x167a77['Contact']['firstName'],_0x167a77['Contact'][_0xfcf2('0x10')]);this['active']=_0x167a77[_0xfcf2('0x11')]||![];this[_0xfcf2('0x12')]=_0x167a77[_0xfcf2('0xf')];this[_0xfcf2('0x13')]=_0x167a77[_0xfcf2('0x13')];this[_0xfcf2('0x14')]=_0x167a77[_0xfcf2('0x14')]||0x0;this['countcongestionretry']=_0x167a77[_0xfcf2('0x15')]||0x0;this[_0xfcf2('0x16')]=_0x167a77[_0xfcf2('0x16')]||0x0;this['countglobal']=(_0x167a77[_0xfcf2('0x14')]||0x0)+(_0x167a77[_0xfcf2('0x15')]||0x0)+(_0x167a77[_0xfcf2('0x16')]||0x0)+(_0x167a77[_0xfcf2('0x17')]||0x0)+(_0x167a77[_0xfcf2('0x18')]||0x0)+(_0x167a77['countabandonedretry']||0x0)+(_0x167a77[_0xfcf2('0x19')]||0x0)+(_0x167a77[_0xfcf2('0x1a')]||0x0);this['countnosuchnumberretry']=_0x167a77[_0xfcf2('0x17')]||0x0;this[_0xfcf2('0x18')]=_0x167a77[_0xfcf2('0x18')]||0x0;this[_0xfcf2('0x1b')]=_0x167a77[_0xfcf2('0x1b')]||0x0;this[_0xfcf2('0x19')]=_0x167a77[_0xfcf2('0x19')]||0x0;this[_0xfcf2('0x1a')]=_0x167a77[_0xfcf2('0x1a')]||0x0;this['callback']=_0x167a77[_0xfcf2('0x1c')];this[_0xfcf2('0x1d')]=_0x167a77[_0xfcf2('0x1d')];this['callbackat']=_0x167a77[_0xfcf2('0x1e')];this[_0xfcf2('0x1f')]=_0x167a77['recallme'];this[_0xfcf2('0x20')]=_0x167a77[_0xfcf2('0x20')];this['ListId']=_0x167a77[_0xfcf2('0x21')];this[_0xfcf2('0x22')]=_[_0xfcf2('0x3')](_0x167a77[_0xfcf2('0xa')])?_0x167a77['UserId']:_0x167a77[_0xfcf2('0xa')]['id'];this[_0xfcf2('0x23')]=_0x167a77[_0xfcf2('0x23')];this[_0xfcf2('0x24')]='';this[_0xfcf2('0x25')]='';}Action[_0xfcf2('0x26')][_0xfcf2('0x27')]=function(){return util[_0xfcf2('0xb')](_0xfcf2('0x28'),this['calleridname'],this['number']);};module[_0xfcf2('0x29')]=Action; \ No newline at end of file +var _0x5430=['ContactId','ListId','UserId','isNil','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','util','lodash','moment','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','callback','callbackuniqueid','recallme'];(function(_0x289cec,_0x4cbaae){var _0x535158=function(_0x4eda7c){while(--_0x4eda7c){_0x289cec['push'](_0x289cec['shift']());}};_0x535158(++_0x4cbaae);}(_0x5430,0x10c));var _0x0543=function(_0x8ba20,_0x131d07){_0x8ba20=_0x8ba20-0x0;var _0x558111=_0x5430[_0x8ba20];return _0x558111;};'use strict';var util=require(_0x0543('0x0'));var _=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));function checkNameSurname(_0x4078bf,_0x114bf2,_0x3b93d7){var _0x5518f8='';if(!_['isNil'](_0x114bf2)&&_0x0543('0x3')===typeof _0x114bf2){_0x5518f8+=_0x114bf2;}if(!_['isNil'](_0x3b93d7)&&'string'===typeof _0x3b93d7){_0x5518f8+='\x20'+_0x3b93d7;}if(_0x5518f8!==''){return _0x5518f8;}return _0x4078bf;}function Action(_0xce0b65,_0x45b909,_0x9754ba,_0x319568,_0x46bca7){this['uniqueid']=_0x9754ba||undefined;this[_0x0543('0x4')]=_0xce0b65['id'];this[_0x0543('0x5')]=_0x45b909[_0x0543('0x6')];this[_0x0543('0x7')]=_0x45b909[_0x0543('0x7')];this[_0x0543('0x8')]='queue';this[_0x0543('0x9')]=![];this[_0x0543('0xa')]=_['isNil'](_0xce0b65[_0x0543('0xb')])?undefined:_0xce0b65[_0x0543('0xb')][_0x0543('0x6')];this[_0x0543('0xc')]=this[_0x0543('0xa')]?util[_0x0543('0xd')](_0x0543('0xe'),this[_0x0543('0xa')]):_0x319568||undefined;this[_0x0543('0xf')]=checkNameSurname(_0xce0b65[_0x0543('0x10')][_0x0543('0x11')],_0xce0b65[_0x0543('0x10')]['firstName'],_0xce0b65[_0x0543('0x10')][_0x0543('0x12')]);this['active']=_0xce0b65['active']||![];this[_0x0543('0x13')]=_0xce0b65[_0x0543('0x11')];this[_0x0543('0x14')]=_0xce0b65[_0x0543('0x14')];this[_0x0543('0x15')]=_0xce0b65['countbusyretry']||0x0;this[_0x0543('0x16')]=_0xce0b65[_0x0543('0x16')]||0x0;this[_0x0543('0x17')]=_0xce0b65[_0x0543('0x17')]||0x0;this[_0x0543('0x18')]=(_0xce0b65[_0x0543('0x15')]||0x0)+(_0xce0b65[_0x0543('0x16')]||0x0)+(_0xce0b65['countnoanswerretry']||0x0)+(_0xce0b65[_0x0543('0x19')]||0x0)+(_0xce0b65['countdropretry']||0x0)+(_0xce0b65['countabandonedretry']||0x0)+(_0xce0b65[_0x0543('0x1a')]||0x0)+(_0xce0b65[_0x0543('0x1b')]||0x0);this[_0x0543('0x19')]=_0xce0b65['countnosuchnumberretry']||0x0;this[_0x0543('0x1c')]=_0xce0b65['countdropretry']||0x0;this[_0x0543('0x1d')]=_0xce0b65[_0x0543('0x1d')]||0x0;this['countmachineretry']=_0xce0b65[_0x0543('0x1a')]||0x0;this[_0x0543('0x1b')]=_0xce0b65[_0x0543('0x1b')]||0x0;this[_0x0543('0x1e')]=_0xce0b65[_0x0543('0x1e')];this[_0x0543('0x1f')]=_0xce0b65['callbackuniqueid'];this['callbackat']=_0xce0b65['callbackat'];this[_0x0543('0x20')]=_0xce0b65[_0x0543('0x20')];this[_0x0543('0x21')]=_0xce0b65[_0x0543('0x21')];this[_0x0543('0x22')]=_0xce0b65[_0x0543('0x22')];this[_0x0543('0x23')]=_[_0x0543('0x24')](_0xce0b65[_0x0543('0xb')])?_0xce0b65[_0x0543('0x23')]:_0xce0b65[_0x0543('0xb')]['id'];this[_0x0543('0x25')]=_0xce0b65['VoiceQueueId'];this[_0x0543('0x26')]='';this[_0x0543('0x27')]='';}Action[_0x0543('0x28')]['getCaller']=function(){return util[_0x0543('0xd')](_0x0543('0x29'),this[_0x0543('0xf')],this[_0x0543('0x2a')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 22aeab9..14eae36 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','exports','util','uuid','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../rpc/cmHopperAdditionalPhone','./util/util','../dialer/utils','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','hangup','bind','hanguprequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','blindtransfer','syncBlindTransfer','loopCampaigns','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','name','voice_queue_channel:remove','emit','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','message','DEACTIVATED','syncCampaigns','dialMethod','booked','type','outbound','clearZombieChannels','hasOwnProperty','setMessage','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','stringify','dialAnswer','pick','contactId','UserId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','logger2','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','dialActive','isTrunkReachable','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','logCustomer','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','complete','total','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','sumBillable','talktime','[syncHangup][talking][decrement]','pTalking:\x20','linkedid','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','activeContact','swapAdditionalPhones','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','verifyAdditionalPhones','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedretry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','queueSummaryCountersUpdated','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','SIP/%s','reachable','unmonitored','execRun','unlockContact','active','getContactPreview','recallme','validateContact','checkIsBlackList','VoiceQueueId','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Campaign'];(function(_0x5bc746,_0x282c9b){var _0x5e8baf=function(_0x2cd4f9){while(--_0x2cd4f9){_0x5bc746['push'](_0x5bc746['shift']());}};_0x5e8baf(++_0x282c9b);}(_0x6aa7,0x178));var _0x76aa=function(_0x58a56c,_0xa6109a){_0x58a56c=_0x58a56c-0x0;var _0x4ca69a=_0x6aa7[_0x58a56c];return _0x4ca69a;};'use strict';var util=require(_0x76aa('0x0'));var _=require('lodash');var uuid=require(_0x76aa('0x1'));var moment=require(_0x76aa('0x2'));var Redis=require(_0x76aa('0x3'));var config=require(_0x76aa('0x4'));var logger=require('../../../config/logger')(_0x76aa('0x5'));var loggerAction=require(_0x76aa('0x6'))(_0x76aa('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0x76aa('0x8'));var Action=require('./action');var ut=require(_0x76aa('0x9'));var utils=require(_0x76aa('0xa'));config[_0x76aa('0xb')]=_['defaults'](config[_0x76aa('0xb')],{'host':_0x76aa('0xc'),'port':0x18eb});var io=require(_0x76aa('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x76aa('0xe')][_0x76aa('0xf')]=function(_0x41643a){this[_0x76aa('0x10')]=this[_0x76aa('0x10')]?this[_0x76aa('0x10')][_0x76aa('0x11')](_0x41643a):_0x41643a();};function Preview(_0x8dc35c){this[_0x76aa('0x12')]=new Sequence();this[_0x76aa('0x13')]=_0x8dc35c['voiceQueues'];this[_0x76aa('0x14')]=_0x8dc35c['trunks'];this[_0x76aa('0x15')]={};this[_0x76aa('0x16')]=_0x8dc35c[_0x76aa('0x16')];this[_0x76aa('0x17')]=0x0;ami['on'](_0x76aa('0x18'),this['syncOriginateResponse']['bind'](this));ami['on'](_0x76aa('0x19'),this['syncHangup'][_0x76aa('0x1a')](this));ami['on'](_0x76aa('0x1b'),this['syncHangupRequest'][_0x76aa('0x1a')](this));ami['on']('dialend',this[_0x76aa('0x1c')]['bind'](this));ami['on'](_0x76aa('0x1d'),this[_0x76aa('0x1e')][_0x76aa('0x1a')](this));ami['on'](_0x76aa('0x1f'),this[_0x76aa('0x20')][_0x76aa('0x1a')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x76aa('0x1a')](this));ami['on'](_0x76aa('0x21'),this[_0x76aa('0x22')][_0x76aa('0x1a')](this));this[_0x76aa('0x23')](this[_0x76aa('0x13')]);}function emit(_0x19af92,_0x2eaf48,_0x385157){io['to'](_0x19af92)['emit'](_0x2eaf48,_0x385157);}function emitVoiceQueueChannelRemove(_0x39ac5a){logger[_0x76aa('0x24')](_0x76aa('0x25'),JSON['stringify'](_0x39ac5a));emit(util[_0x76aa('0x26')](_0x76aa('0x27'),_0x39ac5a[_0x76aa('0x28')]),_0x76aa('0x29'),_0x39ac5a);io[_0x76aa('0x2a')](_0x76aa('0x2b'),_0x39ac5a);}function notSendMessagesQueue(_0x3cd039){if(_0x3cd039[_0x76aa('0x2c')]){if(_0x3cd039[_0x76aa('0x2d')]===0x0&&_0x3cd039[_0x76aa('0x2e')]===0x0){_0x3cd039[_0x76aa('0x2c')]=![];_0x3cd039[_0x76aa('0x2f')]=0x0;_0x3cd039[_0x76aa('0x30')]=0x0;_0x3cd039['message']=utils[_0x76aa('0x31')][_0x76aa('0x32')];ut[_0x76aa('0x33')](_0x76aa('0x34'),_0x3cd039[_0x76aa('0x28')]+_0x76aa('0x35'));}else{_0x3cd039[_0x76aa('0x36')]=utils[_0x76aa('0x31')][_0x76aa('0x37')];ut[_0x76aa('0x33')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3cd039[_0x76aa('0x28')]+'\x20is\x20deactivated');}}}Preview[_0x76aa('0xe')][_0x76aa('0x23')]=function(){var _0x2dec94=this;setInterval(function(){_0x2dec94[_0x76aa('0x38')]();},0x7cf);};Preview[_0x76aa('0xe')][_0x76aa('0x38')]=function(){var _0x2ee0f9=this[_0x76aa('0x13')];this[_0x76aa('0x17')]+=0x1;for(var _0x3ea05a in _0x2ee0f9){if(_0x2ee0f9['hasOwnProperty'](_0x3ea05a)&&(_0x2ee0f9[_0x3ea05a][_0x76aa('0x39')]===_0x76aa('0x5')||_0x2ee0f9[_0x3ea05a][_0x76aa('0x39')]===_0x76aa('0x3a'))&&_0x2ee0f9[_0x3ea05a][_0x76aa('0x3b')]===_0x76aa('0x3c')){if(this[_0x76aa('0x17')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x76aa('0x3d')]();}}if(_0x2ee0f9[_0x76aa('0x3e')](_0x3ea05a)&&_0x2ee0f9[_0x3ea05a]['dialMethod']===_0x76aa('0x5')&&_0x2ee0f9[_0x3ea05a]['type']===_0x76aa('0x3c')){if(_0x2ee0f9[_0x3ea05a]['dialActive']){this[_0x76aa('0x3f')](_0x2ee0f9[_0x3ea05a]);if(_0x2ee0f9[_0x3ea05a]['dialPreviewAutoRecallMe'])this['recallMe'](_0x2ee0f9[_0x3ea05a]);}else{notSendMessagesQueue(_0x2ee0f9[_0x3ea05a]);}}}};Preview[_0x76aa('0xe')][_0x76aa('0x40')]=function(_0x198fcb){var _0x37dfab=this;this['sequence']['enqueue'](function(){if(!_[_0x76aa('0x41')](_0x37dfab[_0x76aa('0x15')][_0x198fcb])){loggerAction[_0x76aa('0x24')](_0x76aa('0x42'),_0x198fcb,_0x76aa('0x43'),_0x37dfab['actions'][_0x198fcb][_0x76aa('0x44')],'originated:\x20',JSON['stringify'](_0x37dfab[_0x76aa('0x13')][_0x37dfab[_0x76aa('0x15')][_0x198fcb][_0x76aa('0x44')]][_0x76aa('0x2d')]),'pTalking:\x20',JSON[_0x76aa('0x45')](_0x37dfab[_0x76aa('0x13')][_0x37dfab[_0x76aa('0x15')][_0x198fcb]['queue']][_0x76aa('0x2e')]),JSON[_0x76aa('0x45')](_0x37dfab[_0x76aa('0x15')][_0x198fcb][_0x76aa('0x46')]),JSON[_0x76aa('0x45')](_[_0x76aa('0x47')](_0x37dfab[_0x76aa('0x15')][_0x198fcb],[_0x76aa('0x48'),_0x76aa('0x49'),'VoiceQueueId',_0x76aa('0x4a')])));return ami[_0x76aa('0x4b')]({'action':_0x76aa('0x4c'),'channel':_0x37dfab[_0x76aa('0x15')][_0x198fcb][_0x76aa('0x4d')]})[_0x76aa('0x4e')](function(_0x572fdb){if(_0x572fdb['message']===_0x76aa('0x4f')){setTimeout(function(){if(_0x37dfab[_0x76aa('0x15')][_0x198fcb]){ut[_0x76aa('0x50')](_0x37dfab[_0x76aa('0x13')][_0x37dfab['actions'][_0x198fcb][_0x76aa('0x44')]],_0x76aa('0x51'));if(_0x37dfab[_0x76aa('0x15')][_0x198fcb][_0x76aa('0x46')]===!![]){ut[_0x76aa('0x52')](_0x37dfab['campaignsPreview'][_0x37dfab[_0x76aa('0x15')][_0x198fcb]['queue']],_0x76aa('0x51'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x198fcb,_0x37dfab['actions'][_0x198fcb][_0x76aa('0x44')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x198fcb,_0x37dfab['actions'][_0x198fcb][_0x76aa('0x44')]);delete _0x37dfab[_0x76aa('0x15')][_0x198fcb];}},0x2328);}});}});};Preview[_0x76aa('0xe')][_0x76aa('0x3d')]=function(){var _0x27a52e=this;loggerAction['info'](_0x76aa('0x53'),_[_0x76aa('0x54')](this[_0x76aa('0x15')]));for(var _0x2d6b7f in this[_0x76aa('0x15')]){if(_0x27a52e['actions'][_0x76aa('0x3e')](_0x2d6b7f)){_0x27a52e[_0x76aa('0x40')](_0x2d6b7f);}}};Preview['prototype'][_0x76aa('0x55')]=function(_0x5a984e){var _0x3aa858=this;rpcDb[_0x76aa('0x56')](_0x5a984e['id'],ut[_0x76aa('0x57')](this[_0x76aa('0x16')]))[_0x76aa('0x58')](function(_0x3e0315){if(!_[_0x76aa('0x41')](_0x3e0315)){for(var _0x165858=0x0;_0x165858<_0x3e0315[_0x76aa('0x59')];_0x165858+=0x1){if(ut[_0x76aa('0x5a')](_0x3e0315[_0x165858]['scheduledat'])<_0x5a984e[_0x76aa('0x5b')]*0x3c){if(_0x3e0315[_0x165858]['Agent']&&!_0x3e0315[_0x165858][_0x76aa('0x5c')][_0x76aa('0x5d')]){_0x3aa858[_0x76aa('0x5e')](_0x3e0315[_0x165858]['id'])[_0x76aa('0x58')](ut['logger2']('[RecallMe]'))[_0x76aa('0x4e')](ut['logger2'](_0x76aa('0x5f')));}else{rpcDb[_0x76aa('0x60')](_0x3e0315[_0x165858]['id']);}}else{var _0x4315b3=new Action(_0x3e0315[_0x165858],_0x5a984e);_0x4315b3[_0x76aa('0x61')]=moment()[_0x76aa('0x26')](_0x76aa('0x62'));_0x5a984e['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x4315b3,0x17,_0x76aa('0x63'));if(_0x5a984e[_0x76aa('0x64')]){rpcDb[_0x76aa('0x65')](ut[_0x76aa('0x66')](_0x3e0315[_0x165858]));rpcDb[_0x76aa('0x67')](_0x4315b3,_0x76aa('0x68'));}else{ut['logCustomer'](_0x4315b3,0x16,_0x76aa('0x69'));rpcDb[_0x76aa('0x67')](_0x4315b3,_0x76aa('0x6a'));rpcDb['createCustomerFinal'](_0x4315b3,_0x76aa('0x6a'));}}}}})['catch'](ut[_0x76aa('0x6b')]('[getContactRecallMe]'));};Preview[_0x76aa('0xe')][_0x76aa('0x3f')]=function(_0x3c63e5){_0x3c63e5[_0x76aa('0x2c')]=!![];if(ut[_0x76aa('0x6c')](_0x3c63e5[_0x76aa('0x6d')])){_0x3c63e5[_0x76aa('0x36')]=utils['CAMPAIGN_STATUS'][_0x76aa('0x6e')];}else if(!ut['isActive'](_0x3c63e5[_0x76aa('0x6f')])){_0x3c63e5[_0x76aa('0x36')]=utils[_0x76aa('0x31')][_0x76aa('0x32')];}else if(!this[_0x76aa('0x70')](_0x3c63e5[_0x76aa('0x71')])){if(!this[_0x76aa('0x70')](_0x3c63e5['TrunkBackup'])){_0x3c63e5[_0x76aa('0x36')]=utils[_0x76aa('0x31')][_0x76aa('0x72')];}else{_0x3c63e5[_0x76aa('0x36')]=utils['CAMPAIGN_STATUS'][_0x76aa('0x73')];}}else{_0x3c63e5[_0x76aa('0x36')]=utils[_0x76aa('0x31')][_0x76aa('0x73')];}};Preview[_0x76aa('0xe')][_0x76aa('0x74')]=function(_0x4e6c09,_0x295b2c,_0xbf78c7){var _0x2886eb=this;var _0x3620d0=this[_0x76aa('0x15')][_0x295b2c];var _0x2fdc4f=this[_0x76aa('0x13')][_0x3620d0['queue']];var _0x4910fb;var _0x2c59a6=![];var _0x3b0d8a=0x2;var _0x5713e7=0x3;if(_0x2fdc4f){switch(_0xbf78c7){case'1':_0x2fdc4f[_0x76aa('0x75')]+=0x1;_0x3620d0[_0x76aa('0x76')]+=0x1;_0x3620d0['countglobal']=ut[_0x76aa('0x77')](_0x3620d0);ut[_0x76aa('0x78')](_0x3620d0,0x0,_0x76aa('0x79'));ami[_0x76aa('0x2a')](_0x76aa('0x7a'),ut[_0x76aa('0x7b')](_0x3620d0,_0x76aa('0x7c')));rpcDb[_0x76aa('0x67')](_0x3620d0,_0x76aa('0x7d'));_0x2886eb['verifyAdditionalPhones'](_0x3620d0,'0',_0x2fdc4f)[_0x76aa('0x58')](function(_0x49156c){_0x2c59a6=_0x49156c[_0x76aa('0x7e')]==0x1;_0x3b0d8a=_0x2fdc4f[_0x76aa('0x7f')];_0x5713e7=_0x2fdc4f[_0x76aa('0x80')];if(!_0x2c59a6){if(ut[_0x76aa('0x77')](_0x3620d0)>=_0x2fdc4f[_0x76aa('0x81')]){_0x4910fb=ut[_0x76aa('0x82')](_0x3620d0,0xf,_0x76aa('0x83'));rpcDb[_0x76aa('0x84')](_0x4910fb,_0x76aa('0x85'));}else{if(_0x3620d0['countnosuchnumberretry']>=_0x2fdc4f[_0x76aa('0x86')]){rpcDb[_0x76aa('0x84')](_0x3620d0,_0x76aa('0x85'));}else{rpcDb[_0x76aa('0x87')](ut[_0x76aa('0x88')](_0x3620d0,_0x76aa('0x76'),_0x2fdc4f[_0x76aa('0x7f')]),_0x3620d0[_0x76aa('0x89')],_0x3620d0['activeContact']);}}delete this[_0x76aa('0x15')][_0x4e6c09['linkedid']];}else{_0x3620d0[_0x76aa('0x76')]++;logger[_0x76aa('0x24')](_0x76aa('0x8a'),_0x3620d0[_0x76aa('0x76')]);logger[_0x76aa('0x24')]('id',_0x3620d0[_0x76aa('0x8b')]);_0x2886eb[_0x76aa('0x8c')]({'id':_0x3620d0['idContact'],'field':{'countnosuchnumberretry':_0x3620d0[_0x76aa('0x76')]}})[_0x76aa('0x58')](function(){_0x2886eb['swapAdditionalPhones'](_0x3620d0,_0x3b0d8a,_0x5713e7)['then'](function(){});});}});break;case _0x76aa('0x8d'):var _0x13389d=moment()['format'](_0x76aa('0x62'));_0x3620d0[_0x76aa('0x8e')]=_0x13389d;_0x3620d0[_0x76aa('0x8f')]=_0x13389d;_0x3620d0['dialAnswer']=!![];_0x2fdc4f[_0x76aa('0x2e')]+=0x1;logger['info'](_0x76aa('0x90'),_0x3620d0[_0x76aa('0x91')],_0x76aa('0x92'),_0x2fdc4f[_0x76aa('0x28')],'pTalking:\x20',_0x2fdc4f['pTalking']);ami[_0x76aa('0x2a')]('custom:agentconnect',ut[_0x76aa('0x7b')](_0x3620d0,_0x76aa('0x93'),this[_0x76aa('0x13')][_0x3620d0[_0x76aa('0x44')]]));if(_0x2fdc4f[_0x76aa('0x94')]){ami[_0x76aa('0x2a')](_0x76aa('0x95'),ut[_0x76aa('0x96')](_0x3620d0));}break;case'16':ami[_0x76aa('0x2a')]('custom:agentcomplete',ut[_0x76aa('0x7b')](_0x3620d0,_0x76aa('0x97'),this[_0x76aa('0x13')][_0x3620d0[_0x76aa('0x44')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x3620d0,'complete'));_0x2fdc4f['outboundAnswerCallsDay']+=0x1;_0x2fdc4f[_0x76aa('0x98')]+=0x1;_0x2fdc4f['answered']+=0x1;ut[_0x76aa('0x52')](_0x2fdc4f,_0x76aa('0x99'));_0x3620d0[_0x76aa('0x9a')]=ut[_0x76aa('0x77')](_0x3620d0);ut['logCustomer'](_0x3620d0,0x4,_0x76aa('0x9b'));rpcDb['createCustomerHistory'](_0x3620d0,_0x76aa('0x9c'));rpcDb[_0x76aa('0x84')](_0x3620d0,_0x76aa('0x9d'));rpcDb[_0x76aa('0x9e')](_0x3620d0);_0x2fdc4f[_0x76aa('0x9f')]+=_0x3620d0['talktime'];_0x2fdc4f[_0x76aa('0xa0')]+=_0x3620d0[_0x76aa('0xa1')];logger[_0x76aa('0x24')](_0x76aa('0xa2'),_0x3620d0[_0x76aa('0x91')],_0x76aa('0x92'),_0x2fdc4f[_0x76aa('0x28')],_0x76aa('0xa3'),_0x2fdc4f['pTalking']);delete this[_0x76aa('0x15')][_0x4e6c09[_0x76aa('0xa4')]];break;case'BUSY':_0x2fdc4f[_0x76aa('0xa5')]+=0x1;_0x3620d0[_0x76aa('0xa6')]+=0x1;_0x3620d0[_0x76aa('0x9a')]=ut[_0x76aa('0x77')](_0x3620d0);ut[_0x76aa('0x78')](_0x3620d0,0x5,_0x76aa('0xa7'));_0x3b0d8a=_0x2fdc4f[_0x76aa('0xa8')];_0x5713e7=_0x2fdc4f['callAdditionalPhoneAfterMin'];ami[_0x76aa('0x2a')]('custom:agentbusy',ut['buildObj'](_0x3620d0,_0x76aa('0xa9')));rpcDb[_0x76aa('0x67')](_0x3620d0,'[callProgressDetectingCustomer][logBusy]');_0x2886eb['verifyAdditionalPhones'](_0x3620d0,'5',_0x2fdc4f)[_0x76aa('0x58')](function(_0x14b5a2){_0x2c59a6=_0x14b5a2[_0x76aa('0x7e')]==0x1;if(!_0x2c59a6){if(ut['totalGlobal'](_0x3620d0)>=_0x2fdc4f['dialGlobalMaxRetry']){_0x4910fb=ut[_0x76aa('0x82')](_0x3620d0,0xf,_0x76aa('0x83'));rpcDb[_0x76aa('0x84')](_0x4910fb,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x3620d0[_0x76aa('0xa6')]>=_0x2fdc4f['dialBusyMaxRetry']){rpcDb[_0x76aa('0x84')](_0x3620d0,_0x76aa('0xaa'));}else{rpcDb[_0x76aa('0x87')](ut[_0x76aa('0x88')](_0x3620d0,_0x76aa('0xa6'),_0x2fdc4f['dialBusyRetryFrequency']),_0x3620d0['unlockAgent'],_0x3620d0[_0x76aa('0xab')]);}}}else{_0x3620d0[_0x76aa('0xa6')]++;_0x2886eb[_0x76aa('0x8c')]({'id':_0x3620d0['idContact'],'field':{'countbusyretry':_0x3620d0[_0x76aa('0xa6')]}})[_0x76aa('0x58')](function(){_0x2886eb[_0x76aa('0xac')](_0x3620d0,_0x3b0d8a,_0x5713e7)[_0x76aa('0x58')](function(){});});}});break;case _0x76aa('0xad'):_0x2fdc4f['outboundNoAnswerCallsDay']+=0x1;_0x3620d0[_0x76aa('0xae')]+=0x1;_0x3620d0['countglobal']=ut[_0x76aa('0x77')](_0x3620d0);ut[_0x76aa('0x78')](_0x3620d0,0x3,_0x76aa('0xaf'));_0x3b0d8a=_0x2fdc4f[_0x76aa('0xb0')];_0x5713e7=_0x2fdc4f[_0x76aa('0x80')];var _0x238ecc=ut['buildNoAnswerEventPayload'](_0x3620d0,_0x2fdc4f);ami['emit']('custom:agentnoanswer',_0x238ecc);rpcDb['createCustomerHistory'](_0x3620d0,'[callProgressDetectingCustomer][logNoAnswer]');_0x2886eb[_0x76aa('0xb1')](_0x3620d0,'3',_0x2fdc4f)[_0x76aa('0x58')](function(_0x52c5be){_0x2c59a6=_0x52c5be['additional']==0x1;if(!_0x2c59a6){if(ut['totalGlobal'](_0x3620d0)>=_0x2fdc4f[_0x76aa('0x81')]){_0x4910fb=ut[_0x76aa('0x82')](_0x3620d0,0xf,_0x76aa('0x83'));rpcDb['createCustomerFinal'](_0x4910fb,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x3620d0[_0x76aa('0xae')]>=_0x2fdc4f[_0x76aa('0xb2')]){rpcDb[_0x76aa('0x84')](_0x3620d0,_0x76aa('0xb3'));}else{rpcDb[_0x76aa('0x87')](ut['scheduledAt'](_0x3620d0,'countnoanswerretry',_0x2fdc4f[_0x76aa('0xb0')]),_0x3620d0['unlockAgent'],_0x3620d0['activeContact']);}}}else{_0x3620d0['countnoanswerretry']++;_0x2886eb[_0x76aa('0x8c')]({'id':_0x3620d0[_0x76aa('0x8b')],'field':{'countnoanswerretry':_0x3620d0['countnoanswerretry']}})[_0x76aa('0x58')](function(){_0x2886eb[_0x76aa('0xac')](_0x3620d0,_0x3b0d8a,_0x5713e7)['then'](function(){});});}});break;case _0x76aa('0xb4'):_0x2fdc4f[_0x76aa('0xb5')]+=0x1;_0x3620d0[_0x76aa('0xb6')]+=0x1;_0x3620d0[_0x76aa('0x9a')]=ut[_0x76aa('0x77')](_0x3620d0);ut[_0x76aa('0x78')](_0x3620d0,0x8,_0x76aa('0xb7'));_0x3b0d8a=_0x2fdc4f[_0x76aa('0xb8')];_0x5713e7=_0x2fdc4f[_0x76aa('0x80')];ami['emit'](_0x76aa('0xb9'),ut[_0x76aa('0x7b')](_0x3620d0,'congestion'));rpcDb[_0x76aa('0x67')](_0x3620d0,_0x76aa('0xba'));_0x2886eb[_0x76aa('0xb1')](_0x3620d0,'8',_0x2fdc4f)['then'](function(_0x2276ac){_0x2c59a6=_0x2276ac[_0x76aa('0x7e')]==0x1;if(!_0x2c59a6){if(ut['totalGlobal'](_0x3620d0)>=_0x2fdc4f[_0x76aa('0x81')]){_0x4910fb=ut[_0x76aa('0x82')](_0x3620d0,0xf,_0x76aa('0x83'));rpcDb['createCustomerFinal'](_0x4910fb,_0x76aa('0xbb'));}else{if(_0x3620d0[_0x76aa('0xb6')]>=_0x2fdc4f['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x3620d0,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x76aa('0x87')](ut[_0x76aa('0x88')](_0x3620d0,_0x76aa('0xb6'),_0x2fdc4f[_0x76aa('0xa8')]),_0x3620d0['unlockAgent'],_0x3620d0['activeContact']);}}}else{_0x3620d0['countcongestionretry']++;_0x2886eb[_0x76aa('0x8c')]({'id':_0x3620d0['idContact'],'field':{'countcongestionretry':_0x3620d0[_0x76aa('0xb6')]}})[_0x76aa('0x58')](function(){_0x2886eb['swapAdditionalPhones'](_0x3620d0,_0x3b0d8a,_0x5713e7)[_0x76aa('0x58')](function(){});});}});break;case _0x76aa('0xbc'):_0x2fdc4f['outboundRejectCallsDay']+=0x1;_0x3620d0[_0x76aa('0xbd')]+=0x1;_0x3620d0[_0x76aa('0x9a')]=ut[_0x76aa('0x77')](_0x3620d0);ut[_0x76aa('0x78')](_0x3620d0,0x14,_0x76aa('0xbe'));_0x3b0d8a=_0x2fdc4f[_0x76aa('0xbf')];_0x5713e7=_0x2fdc4f['callAdditionalPhoneAfterMin'];ami[_0x76aa('0x2a')]('custom:agentreject',ut['buildObj'](_0x3620d0,'agentreject'));rpcDb['createCustomerHistory'](_0x3620d0,'[syncHangupRequest][logAgentReject]');_0x2886eb[_0x76aa('0xb1')](_0x3620d0,'20',_0x2fdc4f)[_0x76aa('0x58')](function(_0x432159){_0x2c59a6=_0x432159[_0x76aa('0x7e')]==0x1;if(!_0x2c59a6){if(ut['totalGlobal'](_0x3620d0)>=_0x2fdc4f[_0x76aa('0x81')]){_0x4910fb=ut[_0x76aa('0x82')](_0x3620d0,0x14,_0x76aa('0xbe'));rpcDb[_0x76aa('0x84')](_0x4910fb,_0x76aa('0xc0'));}else{if(_0x3620d0['countagentrejectretry']>=_0x2fdc4f[_0x76aa('0xc1')]){rpcDb[_0x76aa('0x84')](_0x3620d0,_0x76aa('0xc0'));}else{rpcDb[_0x76aa('0x87')](ut[_0x76aa('0x88')](_0x3620d0,_0x76aa('0xbd'),_0x2fdc4f[_0x76aa('0xbf')]),_0x3620d0['unlockAgent'],_0x3620d0[_0x76aa('0xab')]);}}}else{_0x3620d0[_0x76aa('0xae')]++;_0x2886eb['incrementPreviewCounters']({'id':_0x3620d0['idContact'],'field':{'countnoanswerretry':_0x3620d0[_0x76aa('0xae')]}})[_0x76aa('0x58')](function(){_0x2886eb['swapAdditionalPhones'](_0x3620d0,_0x3b0d8a,_0x5713e7)[_0x76aa('0x58')](function(){});});}});break;case'ABANDONED':_0x2fdc4f[_0x76aa('0xc2')]+=0x1;_0x3620d0['countabandonedretry']+=0x1;_0x3620d0[_0x76aa('0x9a')]=ut[_0x76aa('0x77')](_0x3620d0);ut[_0x76aa('0x78')](_0x3620d0,0xb,_0x76aa('0xc3'));rpcDb[_0x76aa('0x67')](_0x3620d0,'[callProgressDetectingCustomer][logAbandoned]');_0x2886eb[_0x76aa('0xb1')](_0x3620d0,'11',_0x2fdc4f)['then'](function(_0x1af32e){_0x2c59a6=_0x1af32e[_0x76aa('0x7e')]==0x1;if(!_0x2c59a6){if(ut['totalGlobal'](_0x3620d0)>=_0x2fdc4f['dialGlobalMaxRetry']){_0x4910fb=ut[_0x76aa('0x82')](_0x3620d0,0xf,_0x76aa('0x83'));rpcDb[_0x76aa('0x84')](_0x4910fb,_0x76aa('0xc4'));}else{if(_0x3620d0['countabandonedetry']>=_0x2fdc4f['dialAbandonedMaxRety']){rpcDb[_0x76aa('0x84')](_0x3620d0,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x76aa('0x87')](ut['scheduledAt'](_0x3620d0,_0x76aa('0xc5'),_0x2fdc4f[_0x76aa('0xc6')]),_0x3620d0['unlockAgent'],_0x3620d0[_0x76aa('0xab')]);}}}else{_0x3620d0['countnoanswerretry']++;_0x2886eb['incrementPreviewCounters']({'id':_0x3620d0[_0x76aa('0x8b')],'field':{'countnoanswerretry':_0x3620d0[_0x76aa('0xae')]}})['then'](function(){_0x2886eb[_0x76aa('0xac')](_0x3620d0,_0x3b0d8a,_0x5713e7)[_0x76aa('0x58')](function(){});});}});break;case'18':_0x2fdc4f[_0x76aa('0xc7')]+=0x1;_0x3620d0['countmachineretry']+=0x1;_0x3620d0[_0x76aa('0x9a')]=ut[_0x76aa('0x77')](_0x3620d0);ut[_0x76aa('0x78')](_0x3620d0,0x12,_0x4e6c09[_0x76aa('0xc8')]||_0x4e6c09[_0x76aa('0xc9')]);ami[_0x76aa('0x2a')](_0x76aa('0xca'),ut[_0x76aa('0x7b')](_0x3620d0,_0x76aa('0xcb')));rpcDb[_0x76aa('0x67')](_0x3620d0,_0x76aa('0xcc'));_0x2886eb[_0x76aa('0xb1')](_0x3620d0,'18',_0x2fdc4f)['then'](function(_0x4586fb){_0x2c59a6=_0x4586fb[_0x76aa('0x7e')]==0x1;if(!_0x2c59a6){if(ut['totalGlobal'](_0x3620d0)>=_0x2fdc4f[_0x76aa('0x81')]){_0x4910fb=ut[_0x76aa('0x82')](_0x3620d0,0x12,'Global');rpcDb['createCustomerFinal'](_0x4910fb,_0x76aa('0xcc'));}else{rpcDb[_0x76aa('0x84')](_0x3620d0,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x3620d0[_0x76aa('0xae')]++;_0x2886eb[_0x76aa('0x8c')]({'id':_0x3620d0[_0x76aa('0x8b')],'field':{'countnoanswerretry':_0x3620d0['countnoanswerretry']}})[_0x76aa('0x58')](function(){_0x2886eb[_0x76aa('0xac')](_0x3620d0,_0x3b0d8a,_0x5713e7)['then'](function(){});});}});delete this[_0x76aa('0x15')][_0x4e6c09[_0x76aa('0xa4')]];break;case'19':_0x2fdc4f[_0x76aa('0xc7')]+=0x1;_0x3620d0[_0x76aa('0x9a')]=ut[_0x76aa('0x77')](_0x3620d0);ut[_0x76aa('0x78')](_0x3620d0,0x13,_0x4e6c09['cause-txt']||_0x4e6c09[_0x76aa('0xc9')]);ami['emit'](_0x76aa('0xca'),ut[_0x76aa('0x7b')](_0x3620d0,_0x76aa('0xcb')));rpcDb['createCustomerHistory'](_0x3620d0,'[callProgressDetectingCustomer][machine]');_0x2886eb[_0x76aa('0xb1')](_0x3620d0,'18',_0x2fdc4f)[_0x76aa('0x58')](function(_0x19982e){_0x2c59a6=_0x19982e[_0x76aa('0x7e')]==0x1;if(!_0x2c59a6){if(ut[_0x76aa('0x77')](_0x3620d0)>=_0x2fdc4f[_0x76aa('0x81')]){_0x4910fb=ut['cloneAction'](_0x3620d0,0xf,'Global');rpcDb[_0x76aa('0x84')](_0x4910fb,_0x76aa('0xcd'));}else{rpcDb[_0x76aa('0x84')](_0x3620d0,_0x76aa('0xcd'));}}else{_0x3620d0['countnoanswerretry']++;_0x2886eb[_0x76aa('0x8c')]({'id':_0x3620d0['idContact'],'field':{'countnoanswerretry':_0x3620d0['countnoanswerretry']}})[_0x76aa('0x58')](function(){_0x2886eb[_0x76aa('0xac')](_0x3620d0,_0x3b0d8a,_0x5713e7)[_0x76aa('0x58')](function(){});});}});delete this['actions'][_0x4e6c09[_0x76aa('0xa4')]];break;default:if(_0x3620d0[_0x76aa('0x46')]){ut[_0x76aa('0x52')](_0x2fdc4f,_0x76aa('0xce'));ut[_0x76aa('0xcf')](_0x76aa('0xd0')+_0x2fdc4f[_0x76aa('0x28')],_0x4e6c09);}_0x2fdc4f['outboundUnknownCallsDay']+=0x1;_0x3620d0[_0x76aa('0x9a')]=ut[_0x76aa('0x77')](_0x3620d0);ut[_0x76aa('0x78')](_0x3620d0,0xc,_0x4e6c09[_0x76aa('0xc8')]||_0x4e6c09[_0x76aa('0xc9')]);_0x3b0d8a=_0x2fdc4f[_0x76aa('0xbf')];_0x5713e7=_0x2fdc4f['callAdditionalPhoneAfterMin'];rpcDb[_0x76aa('0x67')](_0x3620d0,_0x76aa('0xd1'));_0x2886eb[_0x76aa('0xb1')](_0x3620d0,'20',_0x2fdc4f)[_0x76aa('0x58')](function(_0x58f065){_0x2c59a6=_0x58f065[_0x76aa('0x7e')]==0x1;if(!_0x2c59a6){if(ut[_0x76aa('0x77')](_0x3620d0)>=_0x2fdc4f[_0x76aa('0x81')]){_0x4910fb=ut[_0x76aa('0x82')](_0x3620d0,0xf,_0x76aa('0x83'));rpcDb['createCustomerFinal'](_0x4910fb,_0x76aa('0xd2'));}else{rpcDb[_0x76aa('0x84')](_0x3620d0,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x4e6c09[_0x76aa('0xa4')]];}else{_0x2886eb[_0x76aa('0xac')](_0x3620d0,_0x3b0d8a,_0x5713e7)[_0x76aa('0x58')](function(){});}});}if(!(_0x3620d0[_0x76aa('0x46')]&&_0xbf78c7==='16')){ut[_0x76aa('0x50')](_0x2fdc4f,_0x76aa('0xd3'));logger['info'](_0x76aa('0xd4'),_0x3620d0[_0x76aa('0x91')],_0x76aa('0x92'),_0x2fdc4f[_0x76aa('0x28')],_0x76aa('0xd5'),_0x2fdc4f[_0x76aa('0x2d')]);}if(_0xbf78c7!=='ANSWER'){delete this[_0x76aa('0x15')][_0x4e6c09[_0x76aa('0xa4')]];delete this[_0x76aa('0x15')][_0x4e6c09[_0x76aa('0xd6')]];}_0x2fdc4f[_0x76aa('0xd7')]=!![];}};Preview[_0x76aa('0xe')]['callProgressDetectingAgent']=function(_0x3152d1,_0x4d0d76,_0x1482e5){if(_['isUndefined'](_0x4d0d76)&&_0x76aa('0xd8')!==typeof _0x4d0d76){return;}if(_[_0x76aa('0xd9')](_0x1482e5)&&'object'!==typeof _0x1482e5){return;}switch(_0x1482e5[_0x76aa('0xda')]){case'0':ut[_0x76aa('0xdb')](_0x3152d1,0x0,_0x76aa('0x79'));rpcDb['createAgentHistory'](_0x3152d1,_0x76aa('0xdc'));break;case'3':ut[_0x76aa('0xdb')](_0x3152d1,0x3,'NoAnswer');rpcDb[_0x76aa('0xdd')](_0x3152d1,_0x76aa('0xde'));break;case'5':ut[_0x76aa('0xdb')](_0x3152d1,0x5,_0x76aa('0xa7'));rpcDb[_0x76aa('0xdd')](_0x3152d1,_0x76aa('0xdf'));break;case'8':ut['logAgent'](_0x3152d1,0x8,_0x76aa('0xb7'));rpcDb[_0x76aa('0xdd')](_0x3152d1,_0x76aa('0xe0'));break;case'22':ut[_0x76aa('0xdb')](_0x3152d1,0x16,_0x76aa('0xe1'));rpcDb[_0x76aa('0xdd')](_0x3152d1,_0x76aa('0xe2'));break;default:ut[_0x76aa('0xdb')](_0x3152d1,0xc,_0x1482e5[_0x76aa('0xda')]);rpcDb[_0x76aa('0xdd')](_0x3152d1,_0x76aa('0xe0'));}ut['updateOriginated'](_0x4d0d76,_0x76aa('0xe3'));logger[_0x76aa('0x24')](_0x76aa('0xe4'),_0x3152d1[_0x76aa('0x91')],_0x76aa('0x92'),_0x4d0d76[_0x76aa('0x28')],_0x76aa('0xd5'),_0x4d0d76[_0x76aa('0x2d')]);delete this['actions'][_0x3152d1[_0x76aa('0x91')]];};Preview['prototype'][_0x76aa('0xb1')]=function(_0xae171,_0x2045a2,_0x5ce3ea){return cmHopperAdditionalPhone[_0x76aa('0xb1')](_0xae171,_0x2045a2,_0x5ce3ea)[_0x76aa('0x4e')](logger[_0x76aa('0x24')](_0x76aa('0xe5')));};Preview[_0x76aa('0xe')]['swapAdditionalPhones']=function(_0x2c6647,_0x4d8c38,_0x2e2f07){return cmHopperAdditionalPhone[_0x76aa('0xac')](_0x2c6647,_0x4d8c38,_0x2e2f07)['catch'](logger[_0x76aa('0x24')](_0x76aa('0xe6')));};Preview[_0x76aa('0xe')][_0x76aa('0x8c')]=function(_0x112046){return Promise[_0x76aa('0xe7')]()[_0x76aa('0x58')](cmHopperAdditionalPhone[_0x76aa('0x8c')](_0x112046))['catch'](logger[_0x76aa('0x24')](_0x76aa('0xe8')));};Preview[_0x76aa('0xe')][_0x76aa('0xe9')]=function(_0x3168e1,_0xd5e0e2,_0x41de8e,_0x260bca,_0x559940){var _0x37331b=this;return new Promise(function(_0x28a40a,_0x13d96a){if(_['isNil'](_0xd5e0e2)||_[_0x76aa('0x41')](_0xd5e0e2[_0x76aa('0xea')])||_[_0x76aa('0x41')](_0xd5e0e2[_0x76aa('0xeb')])||_[_0x76aa('0x41')](_0xd5e0e2['VoiceQueueId'])){_0x13d96a(ut[_0x76aa('0x36')]('Contact\x20is\x20undefined',_0x260bca,_0x559940));return;}var _0x35e12a=uuid['v4']();var _0x25df39=_0x37331b[_0x76aa('0x13')][_0xd5e0e2[_0x76aa('0x43')][_0x76aa('0x28')]];var _0x5e68bd=_0x41de8e?_0x37331b[_0x76aa('0x16')][_0x41de8e]['id']:undefined;_0x37331b['actions'][_0x35e12a]=new Action(_0xd5e0e2,_0x25df39,_0x35e12a,_0x41de8e,_0x5e68bd);var _0x577463=_0x37331b[_0x76aa('0x15')][_0x35e12a];_0x577463[_0x76aa('0x89')]=_0x260bca;_0x577463['activeContact']=_0x559940;_0x577463[_0x76aa('0xec')]=_0x41de8e;if(_['isEmpty'](_0x3168e1)){_0x37331b[_0x76aa('0xed')](_0x577463,_0x25df39,_0xd5e0e2,_0x41de8e)[_0x76aa('0x58')](function(_0x2e4046){logger[_0x76aa('0x24')](_0x76aa('0xee'),_0x76aa('0xef')+_0x577463['queue']+_0x76aa('0xf0')+_0x577463[_0x76aa('0x8b')],JSON[_0x76aa('0x45')](_0x2e4046));ami[_0x76aa('0x2a')](_0x76aa('0xf1'),ut[_0x76aa('0x7b')](_0x577463,_0x76aa('0xf2'),_0x37331b[_0x76aa('0x13')][_0x577463[_0x76aa('0x44')]]));_0x28a40a(ut[_0x76aa('0x36')](_0x76aa('0xf3')));})[_0x76aa('0x4e')](function(_0x17e02c){ut[_0x76aa('0x33')](_0x76aa('0xf4'),_0x17e02c);_0x13d96a(ut[_0x76aa('0x36')](_0x76aa('0xf5'),_0x260bca,_0x559940));});}else{_0x25df39[_0x76aa('0xf6')]+=0x1;ut['logBlacklist'](_0x577463);rpcDb[_0x76aa('0xf7')](_0x577463,'[Blacklist][error]');delete _0x37331b[_0x76aa('0x15')][_0x35e12a];_0x13d96a(ut[_0x76aa('0x36')]('Contact\x20in\x20black\x20List',_0x260bca,_0x559940));}});};Preview[_0x76aa('0xe')]['isTrunkReachable']=function(_0x272e84){return!_[_0x76aa('0x41')](_0x272e84)&&!_[_0x76aa('0x41')](_0x272e84['name'])&&!_[_0x76aa('0x41')](_0x272e84['active'])&&_0x272e84['active']&&!_[_0x76aa('0x41')](this['trunks'][util[_0x76aa('0x26')]('SIP/%s',_0x272e84['name'])])&&!_[_0x76aa('0x41')](this[_0x76aa('0x14')][util[_0x76aa('0x26')](_0x76aa('0xf8'),_0x272e84[_0x76aa('0x28')])][_0x76aa('0x4c')])&&(this[_0x76aa('0x14')][util[_0x76aa('0x26')](_0x76aa('0xf8'),_0x272e84[_0x76aa('0x28')])][_0x76aa('0x4c')]===_0x76aa('0xf9')||this[_0x76aa('0x14')][util[_0x76aa('0x26')]('SIP/%s',_0x272e84[_0x76aa('0x28')])][_0x76aa('0x4c')]===_0x76aa('0xfa'));};Preview[_0x76aa('0xe')]['run']=function(_0x120ad9,_0x50a349){return this[_0x76aa('0xfb')](_0x120ad9,_0x50a349)['then'](function(_0x455e90){return _['pick'](_0x455e90,[_0x76aa('0x36')]);})['catch'](function(_0x31b7a8){if(_0x31b7a8['unlock']){rpcDb[_0x76aa('0xfc')](_0x120ad9);}if(_0x31b7a8[_0x76aa('0xfd')]){rpcDb['disableContact'](_0x120ad9);}throw _[_0x76aa('0x47')](_0x31b7a8,['message']);});};Preview[_0x76aa('0xe')]['execRun']=function(_0x1974e1,_0x5648ab){var _0x5bf806=this;var _0x8577e7,_0x867c24;return rpcDb[_0x76aa('0xfe')](_0x1974e1)[_0x76aa('0x58')](function(_0x1f56f6){if(!_[_0x76aa('0x41')](_0x1f56f6[0x0])){_0x867c24=_0x1f56f6[0x0][_0x76aa('0xff')]?![]:!![];_0x8577e7=_0x1f56f6[0x0][_0x76aa('0xff')]?!![]:![];_0x8577e7=_0x5648ab?!![]:_0x8577e7;}var _0x2e95a1=_0x5bf806[_0x76aa('0x100')](_0x1f56f6);if(_0x2e95a1['isValid']){rpcDb[_0x76aa('0x101')](_[_0x76aa('0x47')](_0x1f56f6[0x0],[_0x76aa('0x102'),_0x76aa('0xeb')]))[_0x76aa('0x58')](function(_0x1aeeb5){_0x5bf806[_0x76aa('0xe9')](_0x1aeeb5,_0x1f56f6[0x0],_0x5648ab,_0x867c24,_0x8577e7)[_0x76aa('0x58')](function(_0x1cb8ad){return _0x1cb8ad;})[_0x76aa('0x4e')](function(_0x181303){throw _0x181303;});})[_0x76aa('0x4e')](function(_0x3274a9){ut[_0x76aa('0x33')]('[Preview][checkIsBlackList]',_0x3274a9);throw ut['message'](_0x76aa('0x103'),_0x867c24,_0x8577e7);});}else{throw ut[_0x76aa('0x36')](_0x2e95a1[_0x76aa('0x36')],_0x867c24,_0x8577e7);}})['catch'](function(_0x4db099){ut[_0x76aa('0x33')](_0x76aa('0x104'),_0x4db099);throw ut[_0x76aa('0x36')]('Call\x20unsuccessful',![],!![]);});};Preview[_0x76aa('0xe')][_0x76aa('0x100')]=function(_0x4830c8){if(_['isNil'](_0x4830c8)||_['isEmpty'](_0x4830c8)||!_[_0x76aa('0x41')](_0x4830c8[0x0][_0x76aa('0x5c')])&&_[_0x76aa('0x41')](_0x4830c8[0x0]['Agent'][_0x76aa('0x28')])){ut[_0x76aa('0x33')]('[Preview][validateContact][Empty\x20Contact]',_0x4830c8);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x328d1a=this[_0x76aa('0x13')][_0x4830c8[0x0][_0x76aa('0x43')]['name']];_0x328d1a[_0x76aa('0x36')]=utils[_0x76aa('0x31')]['ACTIVE'];if(_[_0x76aa('0x41')](_0x328d1a)){ut[_0x76aa('0x33')]('[Preview][validateContact][Empty\x20Campaign]',_0x328d1a);return{'isValid':![],'message':_0x76aa('0x105')};}if(!this[_0x76aa('0x70')](_0x328d1a['Trunk'])){ut[_0x76aa('0x33')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20'+_0x328d1a[_0x76aa('0x28')]+_0x76aa('0x106'));if(!this[_0x76aa('0x70')](_0x328d1a[_0x76aa('0x107')])){ut[_0x76aa('0x33')](_0x76aa('0x108'),_0x328d1a[_0x76aa('0x28')]+_0x76aa('0x109'));return{'isValid':![],'message':_0x76aa('0x10a')};}}if(!ut[_0x76aa('0x10b')](_0x328d1a['dialActive'])){ut['logger'](_0x76aa('0x10c'),_0x328d1a[_0x76aa('0x28')]+_0x76aa('0x10d'));return{'isValid':![],'message':_0x76aa('0x10e')+_0x328d1a[_0x76aa('0x28')]+_0x76aa('0x10d')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x76aa('0xe')][_0x76aa('0xed')]=function(_0x17f15e,_0x29fbf6,_0x38694d,_0xf0b932){var _0x1c8cf5=this;return new Promise(function(_0x5a8d0f,_0x5f513d){var _0x54e70c=_0x17f15e[_0x76aa('0x91')];var _0x2bd86e=_0x1c8cf5[_0x76aa('0x70')](_0x29fbf6[_0x76aa('0x71')])?util[_0x76aa('0x26')]('SIP/%s/%s%s',_0x29fbf6['Trunk'][_0x76aa('0x28')],_[_0x76aa('0x41')](_0x29fbf6[_0x76aa('0x10f')])?'':_0x29fbf6[_0x76aa('0x10f')][_0x76aa('0x110')]()||'',_0x29fbf6['dialCutDigit']>0x0?_0x38694d[_0x76aa('0xeb')]['substring'](_0x29fbf6[_0x76aa('0x111')]):_0x38694d['phone']):util['format'](_0x76aa('0x112'),_['isNil'](_0x29fbf6[_0x76aa('0x107')])?_0x29fbf6[_0x76aa('0x71')][_0x76aa('0x28')]:_0x29fbf6[_0x76aa('0x107')][_0x76aa('0x28')],_[_0x76aa('0x41')](_0x29fbf6[_0x76aa('0x10f')])?'':_0x29fbf6[_0x76aa('0x10f')]['trim']()||'',_0x29fbf6[_0x76aa('0x111')]>0x0?_0x38694d[_0x76aa('0xeb')][_0x76aa('0x113')](_0x29fbf6[_0x76aa('0x111')]):_0x38694d[_0x76aa('0xeb')]);var _0x4e9063=_0x1c8cf5[_0x76aa('0x70')](_0x29fbf6['Trunk'])?ut[_0x76aa('0x114')](_0x29fbf6['Trunk'][_0x76aa('0x115')],_0x29fbf6['dialOriginateCallerIdName'],_0x29fbf6[_0x76aa('0x116')]>0x0?ut['getCallerIdRandom'](_0x29fbf6[_0x76aa('0x117')],_0x29fbf6[_0x76aa('0x116')]):_0x29fbf6[_0x76aa('0x117')]):ut['getCallerId'](_['isNil'](_0x29fbf6[_0x76aa('0x107')])?_0x29fbf6['Trunk'][_0x76aa('0x115')]:_0x29fbf6[_0x76aa('0x107')][_0x76aa('0x115')],_0x29fbf6['dialOriginateCallerIdName'],_0x29fbf6['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x29fbf6['dialOriginateCallerIdNumber'],_0x29fbf6[_0x76aa('0x116')]):_0x29fbf6[_0x76aa('0x117')]);if(_0x4e9063){_0x17f15e[_0x76aa('0x118')]=ut[_0x76aa('0x119')](_0x4e9063);_0x17f15e[_0x76aa('0x11a')]=ut[_0x76aa('0x11b')](_0x4e9063);}var _0x450f64=ut[_0x76aa('0x11c')](_0x29fbf6,_0x38694d,_0x2bd86e,_0x4e9063,_0x54e70c,_0x17f15e);_[_0x76aa('0x11d')](_0x17f15e,ut[_0x76aa('0x11e')](_0x450f64));_0x17f15e[_0x76aa('0x61')]=moment()[_0x76aa('0x26')](_0x76aa('0x62'));_0x29fbf6['variables']=_0x450f64;var _0x2b12e9=ut['variablesAction'](_0x17f15e,_0x29fbf6,_0x450f64,_0x17f15e[_0x76aa('0xab')],_0xf0b932);return ami[_0x76aa('0x4b')](_0x2b12e9)[_0x76aa('0x58')](function(_0x3fb275){_0x29fbf6[_0x76aa('0x2d')]+=0x1;logger[_0x76aa('0x24')](_0x76aa('0x11f'),_0x54e70c,_0x76aa('0x92'),_0x29fbf6[_0x76aa('0x28')],_0x76aa('0xd5'),_0x29fbf6[_0x76aa('0x2d')]);_0x5a8d0f(_0x3fb275);})['catch'](function(_0x5cada7){ut[_0x76aa('0xdb')](_0x17f15e,0xe,_0x76aa('0x120'));rpcDb['createAgentHistory'](_0x17f15e,_0x76aa('0x121'));_0x5f513d(_0x5cada7);});});};Preview[_0x76aa('0xe')][_0x76aa('0x1e')]=function(_0x138f0b){if(this[_0x76aa('0x15')][_0x138f0b[_0x76aa('0xa4')]]){this[_0x76aa('0x15')][_0x138f0b['linkedid']][_0x76aa('0x4d')]=_0x138f0b[_0x76aa('0x4d')];}};Preview['prototype']['syncOriginateResponse']=function(_0x30a6e5){var _0x28ab3f=this;var _0x97833d=this[_0x76aa('0x15')][_0x30a6e5[_0x76aa('0x122')]];if(_0x97833d){if(_0x97833d[_0x76aa('0xec')]&&this[_0x76aa('0x16')][_0x97833d[_0x76aa('0xec')]]){ut[_0x76aa('0x123')](_0x97833d,this[_0x76aa('0x16')][_0x97833d[_0x76aa('0xec')]][_0x76aa('0x28')],this[_0x76aa('0x16')][_0x97833d['lookAgent']]['id']);}var _0x493a63=_[_0x76aa('0x124')](_0x97833d);_0x493a63[_0x76aa('0x8e')]=moment()[_0x76aa('0x26')](_0x76aa('0x62'));var _0x59a7d3=_0x28ab3f['campaignsPreview'][_0x97833d[_0x76aa('0x44')]];if(ut[_0x76aa('0x125')](_0x30a6e5[_0x76aa('0x126')])){if(_0x97833d['unlockAgent']){rpcDb['unlockContact'](_0x97833d['idContact']);}if(_0x97833d[_0x76aa('0xab')]){rpcDb['disableContact'](_0x97833d[_0x76aa('0x8b')]);}ami[_0x76aa('0x2a')](_0x76aa('0x127'),ut[_0x76aa('0x7b')](_0x97833d,_0x76aa('0x128'),this[_0x76aa('0x13')][_0x97833d[_0x76aa('0x44')]]));this[_0x76aa('0x129')](_0x493a63,_0x59a7d3,_0x30a6e5);}else{_0x97833d[_0x76aa('0x61')]=moment()[_0x76aa('0x26')](_0x76aa('0x62'));ut[_0x76aa('0xdb')](_0x493a63,0x4,_0x76aa('0x9b'));rpcDb[_0x76aa('0xdd')](_0x493a63,_0x76aa('0x12a'));}}};Preview[_0x76aa('0xe')]['syncHangup']=function(_0x275653){var _0x5e8cec=this[_0x76aa('0x15')][_0x275653['linkedid']];var _0x17bd1a;if(_0x5e8cec){_0x17bd1a=this['campaignsPreview'][_0x5e8cec[_0x76aa('0x44')]];logger['info']('[syncHangup][talking]',_0x275653[_0x76aa('0xa4')],_0x76aa('0x92'),_0x17bd1a[_0x76aa('0x28')],_0x76aa('0xa3'),_0x17bd1a[_0x76aa('0x2e')]);}if(this[_0x76aa('0x15')][_0x275653['linkedid']]&&_0x275653[_0x76aa('0xa4')]!==_0x275653[_0x76aa('0x91')]){if(_0x275653[_0x76aa('0x12b')]==='16'&&this[_0x76aa('0x15')][_0x275653['linkedid']][_0x76aa('0x46')]){this[_0x76aa('0x74')](_0x275653,_0x275653[_0x76aa('0xa4')],_0x275653[_0x76aa('0x12b')]);}else if(this[_0x76aa('0x15')][_0x275653[_0x76aa('0xa4')]][_0x76aa('0x46')]){logger[_0x76aa('0x24')](_0x76aa('0x12c'),_0x275653[_0x76aa('0xa4')],_0x275653[_0x76aa('0x12b')],_0x76aa('0x92'),_0x17bd1a['name'],'pTalking:\x20',_0x17bd1a[_0x76aa('0x2e')]);this[_0x76aa('0x74')](_0x275653,_0x275653[_0x76aa('0xa4')],_0x275653[_0x76aa('0x12b')]);}}else if(_0x5e8cec&&_[_0x76aa('0x41')](_0x5e8cec[_0x76aa('0x12d')])&&_0x17bd1a[_0x76aa('0x12e')]&&_0x275653[_0x76aa('0xa4')]===_0x275653[_0x76aa('0x91')]&&_[_0x76aa('0x41')](_0x275653[_0x76aa('0xda')])&&_0x275653['cause']==='16'&&_0x275653[_0x76aa('0x12f')]==='6'&&_['isUndefined'](_0x5e8cec[_0x76aa('0x130')])){if(_0x5e8cec[_0x76aa('0x89')]){rpcDb[_0x76aa('0xfc')](_0x5e8cec[_0x76aa('0x8b')]);}if(_0x5e8cec[_0x76aa('0xab')]){rpcDb['disableContact'](_0x5e8cec['idContact']);}_0x275653[_0x76aa('0xda')]='22';this['callProgressDetectingAgent'](_0x5e8cec,_0x17bd1a,_0x275653);}else if(_0x5e8cec&&_0x5e8cec[_0x76aa('0x130')]){if(_0x275653[_0x76aa('0x12b')]==='16'&&this[_0x76aa('0x15')][_0x275653[_0x76aa('0xa4')]][_0x76aa('0x46')]){logger['info']('[syncHangup][talking][transfer]',_0x275653[_0x76aa('0xa4')],_0x275653[_0x76aa('0x12b')],_0x76aa('0x92'),_0x17bd1a[_0x76aa('0x28')],_0x76aa('0xa3'),_0x17bd1a[_0x76aa('0x2e')]);this[_0x76aa('0x74')](_0x275653,_0x275653[_0x76aa('0xa4')],_0x275653[_0x76aa('0x12b')]);}else if(this[_0x76aa('0x15')][_0x275653['linkedid']][_0x76aa('0x46')]){logger[_0x76aa('0x24')]('[syncHangup][talking][cause]',_0x275653[_0x76aa('0xa4')],_0x275653[_0x76aa('0x12b')],_0x76aa('0x92'),_0x17bd1a[_0x76aa('0x28')],_0x76aa('0xa3'),_0x17bd1a[_0x76aa('0x2e')]);this[_0x76aa('0x74')](_0x275653,_0x275653['linkedid'],_0x275653[_0x76aa('0x12b')]);}}};Preview[_0x76aa('0xe')][_0x76aa('0x1c')]=function(_0x2f2a27){if(this['actions'][_0x2f2a27[_0x76aa('0xd6')]]&&_0x2f2a27[_0x76aa('0xd6')]!==_0x2f2a27[_0x76aa('0x131')]){this[_0x76aa('0x74')](_0x2f2a27,_0x2f2a27[_0x76aa('0xd6')],_0x2f2a27[_0x76aa('0xc9')]);}};Preview[_0x76aa('0xe')][_0x76aa('0x132')]=function(_0x1f7f1d){if(this[_0x76aa('0x15')][_0x1f7f1d[_0x76aa('0xa4')]]&&_0x1f7f1d[_0x76aa('0xa4')]!==_0x1f7f1d[_0x76aa('0x91')]&&!this[_0x76aa('0x15')][_0x1f7f1d['linkedid']]['dialAnswer']){if(_0x1f7f1d[_0x76aa('0x12b')]==='1'){this[_0x76aa('0x74')](_0x1f7f1d,_0x1f7f1d['linkedid'],_0x1f7f1d[_0x76aa('0x12b')]);}}};Preview['prototype'][_0x76aa('0x133')]=function(_0x2e9c1a,_0x1b4f9e,_0x4218e4){if(this[_0x76aa('0x15')][_0x2e9c1a]){if(_[_0x76aa('0x41')](this[_0x76aa('0x15')][_0x2e9c1a][_0x76aa('0x134')])){this['actions'][_0x2e9c1a][_0x76aa('0x134')]={};}this[_0x76aa('0x15')][_0x2e9c1a]['variables'][_0x1b4f9e]=_0x4218e4;}};Preview['prototype'][_0x76aa('0x20')]=function(_0xcd05b0){try{if(!_[_0x76aa('0x41')](_0xcd05b0)){if(ut[_0x76aa('0x135')](_[_0x76aa('0x136')](_0xcd05b0['variable'])[0x0])){this[_0x76aa('0x133')](_0xcd05b0['uniqueid'],_[_0x76aa('0x136')](_0xcd05b0[_0x76aa('0x137')])[0x0],_0xcd05b0[_0x76aa('0x138')]);}}}catch(_0x23c297){logger[_0x76aa('0x139')](_0x76aa('0x13a'),util[_0x76aa('0x13b')](_0x23c297,{'showHidden':![],'depth':null}));}};Preview[_0x76aa('0xe')][_0x76aa('0x13c')]=function(_0x29c147){if(_0x29c147){if(this[_0x76aa('0x15')][_0x29c147[_0x76aa('0x13d')]]){this[_0x76aa('0x15')][_0x29c147['transfertargetlinkedid']][_0x76aa('0x130')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x4ae6f1){if(_0x4ae6f1){if(this[_0x76aa('0x15')][_0x4ae6f1['transfererlinkedid']]){this['actions'][_0x4ae6f1['transfererlinkedid']]['transfer']=!![];}}};module[_0x76aa('0x13e')]=Preview; \ No newline at end of file +var _0xb43b=['custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','logAgent','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','called','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','isTrunkReachable','active','trunks','SIP/%s','reachable','execRun','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','phone','substring','TrunkBackup','trim','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','agents','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./action','../dialer/utils','redis','defaults','localhost','prototype','tail','finally','campaignsPreview','voiceQueues','actions','clockClearZombieChannels','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','syncDialEnd','syncNewExten','varset','syncAttendedTransfer','loopCampaigns','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','DEACTIVATED','name','\x20is\x20deactivated','syncCampaigns','dialMethod','type','outbound','clearZombieChannels','hasOwnProperty','dialActive','setMessage','recallMe','clearZombieChannel','sequence','enqueue','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','stringify','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','NoSuchNumber','emit','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','pTalking','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','sumBillable','talktime','uniqueid','BUSY','outboundBusyCallsDay','countbusyretry','countglobal','Busy','dialBusyRetryFrequency','[callProgressDetectingCustomer][logBusy]','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus'];(function(_0x262a69,_0x1f67fe){var _0x43ca44=function(_0x43b543){while(--_0x43b543){_0x262a69['push'](_0x262a69['shift']());}};_0x43ca44(++_0x1f67fe);}(_0xb43b,0x1b2));var _0xbb43=function(_0x181aad,_0x2cea9d){_0x181aad=_0x181aad-0x0;var _0x216edf=_0xb43b[_0x181aad];return _0x216edf;};'use strict';var util=require(_0xbb43('0x0'));var _=require(_0xbb43('0x1'));var uuid=require('uuid');var moment=require(_0xbb43('0x2'));var Redis=require(_0xbb43('0x3'));var config=require(_0xbb43('0x4'));var logger=require('../../../config/logger')(_0xbb43('0x5'));var loggerAction=require(_0xbb43('0x6'))(_0xbb43('0x7'));var ami=require(_0xbb43('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xbb43('0x9'));var ut=require('./util/util');var utils=require(_0xbb43('0xa'));config[_0xbb43('0xb')]=_[_0xbb43('0xc')](config[_0xbb43('0xb')],{'host':_0xbb43('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbb43('0xb')]));var Sequence=function(){};Sequence[_0xbb43('0xe')]['enqueue']=function(_0x7e0fc2){this[_0xbb43('0xf')]=this[_0xbb43('0xf')]?this[_0xbb43('0xf')][_0xbb43('0x10')](_0x7e0fc2):_0x7e0fc2();};function Preview(_0x2bef86){this['sequence']=new Sequence();this[_0xbb43('0x11')]=_0x2bef86[_0xbb43('0x12')];this['trunks']=_0x2bef86['trunks'];this[_0xbb43('0x13')]={};this['agents']=_0x2bef86['agents'];this[_0xbb43('0x14')]=0x0;ami['on']('originateresponse',this[_0xbb43('0x15')][_0xbb43('0x16')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xbb43('0x17'),this[_0xbb43('0x18')]['bind'](this));ami['on']('dialend',this[_0xbb43('0x19')]['bind'](this));ami['on']('newexten',this[_0xbb43('0x1a')][_0xbb43('0x16')](this));ami['on'](_0xbb43('0x1b'),this['syncVarSet'][_0xbb43('0x16')](this));ami['on']('attendedtransfer',this[_0xbb43('0x1c')][_0xbb43('0x16')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xbb43('0x16')](this));this[_0xbb43('0x1d')](this[_0xbb43('0x11')]);}function emit(_0x2bf2d4,_0x5bcce7,_0x40a650){io['to'](_0x2bf2d4)['emit'](_0x5bcce7,_0x40a650);}function emitVoiceQueueChannelRemove(_0x3a257d){logger['info'](_0xbb43('0x1e'),JSON['stringify'](_0x3a257d));emit(util[_0xbb43('0x1f')](_0xbb43('0x20'),_0x3a257d['name']),_0xbb43('0x21'),_0x3a257d);io['emit'](_0xbb43('0x22'),_0x3a257d);}function notSendMessagesQueue(_0x298ce2){if(_0x298ce2[_0xbb43('0x23')]){if(_0x298ce2['originated']===0x0&&_0x298ce2['pTalking']===0x0){_0x298ce2['sendMessageOneNotActive']=![];_0x298ce2[_0xbb43('0x24')]=0x0;_0x298ce2[_0xbb43('0x25')]=0x0;_0x298ce2['message']=utils[_0xbb43('0x26')][_0xbb43('0x27')];ut[_0xbb43('0x28')](_0xbb43('0x29'),_0x298ce2['name']+'\x20is\x20not\x20active');}else{_0x298ce2[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x2b')];ut[_0xbb43('0x28')](_0xbb43('0x29'),_0x298ce2[_0xbb43('0x2c')]+_0xbb43('0x2d'));}}}Preview[_0xbb43('0xe')]['loopCampaigns']=function(){var _0x2ad6da=this;setInterval(function(){_0x2ad6da['syncCampaigns']();},0x7cf);};Preview[_0xbb43('0xe')][_0xbb43('0x2e')]=function(){var _0x34f5b2=this[_0xbb43('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x157d62 in _0x34f5b2){if(_0x34f5b2['hasOwnProperty'](_0x157d62)&&(_0x34f5b2[_0x157d62]['dialMethod']==='preview'||_0x34f5b2[_0x157d62][_0xbb43('0x2f')]==='booked')&&_0x34f5b2[_0x157d62][_0xbb43('0x30')]===_0xbb43('0x31')){if(this[_0xbb43('0x14')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xbb43('0x32')]();}}if(_0x34f5b2[_0xbb43('0x33')](_0x157d62)&&_0x34f5b2[_0x157d62][_0xbb43('0x2f')]===_0xbb43('0x5')&&_0x34f5b2[_0x157d62][_0xbb43('0x30')]===_0xbb43('0x31')){if(_0x34f5b2[_0x157d62][_0xbb43('0x34')]){this[_0xbb43('0x35')](_0x34f5b2[_0x157d62]);if(_0x34f5b2[_0x157d62]['dialPreviewAutoRecallMe'])this[_0xbb43('0x36')](_0x34f5b2[_0x157d62]);}else{notSendMessagesQueue(_0x34f5b2[_0x157d62]);}}}};Preview[_0xbb43('0xe')][_0xbb43('0x37')]=function(_0x244d66){var _0x4015ec=this;this[_0xbb43('0x38')][_0xbb43('0x39')](function(){if(!_[_0xbb43('0x3a')](_0x4015ec[_0xbb43('0x13')][_0x244d66])){loggerAction[_0xbb43('0x3b')](_0xbb43('0x3c'),_0x244d66,_0xbb43('0x3d'),_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')],_0xbb43('0x3f'),JSON[_0xbb43('0x40')](_0x4015ec['campaignsPreview'][_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]]['originated']),_0xbb43('0x41'),JSON[_0xbb43('0x40')](_0x4015ec[_0xbb43('0x11')][_0x4015ec['actions'][_0x244d66]['queue']]['pTalking']),JSON[_0xbb43('0x40')](_0x4015ec[_0xbb43('0x13')][_0x244d66]['dialAnswer']),JSON['stringify'](_[_0xbb43('0x42')](_0x4015ec[_0xbb43('0x13')][_0x244d66],[_0xbb43('0x43'),_0xbb43('0x44'),_0xbb43('0x45'),'ListId'])));return ami[_0xbb43('0x46')]({'action':_0xbb43('0x47'),'channel':_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x48')]})[_0xbb43('0x49')](function(_0x531d96){if(_0x531d96[_0xbb43('0x2a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4015ec[_0xbb43('0x13')][_0x244d66]){ut[_0xbb43('0x4a')](_0x4015ec['campaignsPreview'][_0x4015ec[_0xbb43('0x13')][_0x244d66]['queue']],_0xbb43('0x4b'));if(_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x4c')]===!![]){ut[_0xbb43('0x4d')](_0x4015ec['campaignsPreview'][_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]],'[clearZombieChannel]');ut[_0xbb43('0x4e')]('[Dialer][checkChannel][pTalking][Preview]'+_0x244d66,_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]);}ut[_0xbb43('0x4e')](_0xbb43('0x4f')+_0x244d66,_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]);delete _0x4015ec['actions'][_0x244d66];}},0x2328);}});}});};Preview[_0xbb43('0xe')]['clearZombieChannels']=function(){var _0x307f1e=this;loggerAction[_0xbb43('0x3b')](_0xbb43('0x50'),_[_0xbb43('0x51')](this['actions']));for(var _0x4622ea in this[_0xbb43('0x13')]){if(_0x307f1e[_0xbb43('0x13')][_0xbb43('0x33')](_0x4622ea)){_0x307f1e[_0xbb43('0x37')](_0x4622ea);}}};Preview[_0xbb43('0xe')][_0xbb43('0x36')]=function(_0x3592fb){var _0x5a662b=this;rpcDb[_0xbb43('0x52')](_0x3592fb['id'],ut[_0xbb43('0x53')](this['agents']))[_0xbb43('0x54')](function(_0x5d4c19){if(!_['isNil'](_0x5d4c19)){for(var _0x4d7034=0x0;_0x4d7034<_0x5d4c19['length'];_0x4d7034+=0x1){if(ut[_0xbb43('0x55')](_0x5d4c19[_0x4d7034]['scheduledat'])<_0x3592fb[_0xbb43('0x56')]*0x3c){if(_0x5d4c19[_0x4d7034]['Agent']&&!_0x5d4c19[_0x4d7034][_0xbb43('0x57')][_0xbb43('0x58')]){_0x5a662b[_0xbb43('0x59')](_0x5d4c19[_0x4d7034]['id'])['then'](ut[_0xbb43('0x5a')]('[RecallMe]'))[_0xbb43('0x49')](ut[_0xbb43('0x5a')](_0xbb43('0x5b')));}else{rpcDb[_0xbb43('0x5c')](_0x5d4c19[_0x4d7034]['id']);}}else{var _0x417ad9=new Action(_0x5d4c19[_0x4d7034],_0x3592fb);_0x417ad9[_0xbb43('0x5d')]=moment()[_0xbb43('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3592fb[_0xbb43('0x5e')]+=0x1;ut[_0xbb43('0x5f')](_0x417ad9,0x17,_0xbb43('0x60'));if(_0x3592fb[_0xbb43('0x61')]){rpcDb['rescheduleContactInQueue'](ut[_0xbb43('0x62')](_0x5d4c19[_0x4d7034]));rpcDb[_0xbb43('0x63')](_0x417ad9,_0xbb43('0x64'));}else{ut[_0xbb43('0x5f')](_0x417ad9,0x16,'RecallFailedTimeout');rpcDb[_0xbb43('0x63')](_0x417ad9,_0xbb43('0x65'));rpcDb[_0xbb43('0x66')](_0x417ad9,'[HistoryRecallClose]');}}}}})[_0xbb43('0x49')](ut[_0xbb43('0x5a')](_0xbb43('0x67')));};Preview[_0xbb43('0xe')][_0xbb43('0x35')]=function(_0x59c805){_0x59c805['sendMessageOneNotActive']=!![];if(ut[_0xbb43('0x68')](_0x59c805['loggedIn'])){_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')]['NO_AGENTS_LOGGED'];}else if(!ut[_0xbb43('0x69')](_0x59c805[_0xbb43('0x34')])){_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x27')];}else if(!this['isTrunkReachable'](_0x59c805[_0xbb43('0x6a')])){if(!this['isTrunkReachable'](_0x59c805['TrunkBackup'])){_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x6b')];}else{_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')]['ACTIVE'];}}else{_0x59c805['message']=utils[_0xbb43('0x26')][_0xbb43('0x6c')];}};Preview[_0xbb43('0xe')][_0xbb43('0x6d')]=function(_0x99cb09,_0x38d540,_0x44691b){var _0x14fce0=this;var _0x1a3f98=this['actions'][_0x38d540];var _0x1b6f96=this[_0xbb43('0x11')][_0x1a3f98[_0xbb43('0x3e')]];var _0x3675d9;var _0x22bceb=![];var _0x1fae27=0x2;var _0x3f7262=0x3;if(_0x1b6f96){switch(_0x44691b){case'1':_0x1b6f96[_0xbb43('0x6e')]+=0x1;_0x1a3f98[_0xbb43('0x6f')]+=0x1;_0x1a3f98['countglobal']=ut['totalGlobal'](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x0,_0xbb43('0x70'));ami[_0xbb43('0x71')](_0xbb43('0x72'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0x74')));rpcDb[_0xbb43('0x63')](_0x1a3f98,'[callProgressDetectingCustomer][logNoSuch]');_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'0',_0x1b6f96)['then'](function(_0x5a6ff0){_0x22bceb=_0x5a6ff0[_0xbb43('0x76')]==0x1;_0x1fae27=_0x1b6f96[_0xbb43('0x77')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x1a3f98['countnosuchnumberretry']>=_0x1b6f96[_0xbb43('0x7d')]){rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0x7e'));}else{rpcDb[_0xbb43('0x7f')](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0x6f'),_0x1b6f96[_0xbb43('0x77')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98[_0xbb43('0x82')]);}}delete this['actions'][_0x99cb09[_0xbb43('0x83')]];}else{_0x1a3f98[_0xbb43('0x6f')]++;logger[_0xbb43('0x3b')](_0xbb43('0x84'),_0x1a3f98[_0xbb43('0x6f')]);logger[_0xbb43('0x3b')]('id',_0x1a3f98['idContact']);_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnosuchnumberretry':_0x1a3f98[_0xbb43('0x6f')]}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case _0xbb43('0x88'):var _0x6f04b3=moment()[_0xbb43('0x1f')](_0xbb43('0x89'));_0x1a3f98[_0xbb43('0x8a')]=_0x6f04b3;_0x1a3f98[_0xbb43('0x8b')]=_0x6f04b3;_0x1a3f98[_0xbb43('0x4c')]=!![];_0x1b6f96[_0xbb43('0x8c')]+=0x1;logger[_0xbb43('0x3b')](_0xbb43('0x8d'),_0x1a3f98['uniqueid'],_0xbb43('0x8e'),_0x1b6f96['name'],_0xbb43('0x41'),_0x1b6f96[_0xbb43('0x8c')]);ami[_0xbb43('0x71')](_0xbb43('0x8f'),ut[_0xbb43('0x73')](_0x1a3f98,'connect',this['campaignsPreview'][_0x1a3f98[_0xbb43('0x3e')]]));if(_0x1b6f96[_0xbb43('0x90')]){ami['emit'](_0xbb43('0x91'),ut[_0xbb43('0x92')](_0x1a3f98));}break;case'16':ami[_0xbb43('0x71')](_0xbb43('0x93'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0x94'),this[_0xbb43('0x11')][_0x1a3f98[_0xbb43('0x3e')]]));emitVoiceQueueChannelRemove(ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0x94')));_0x1b6f96[_0xbb43('0x95')]+=0x1;_0x1b6f96[_0xbb43('0x96')]+=0x1;_0x1b6f96[_0xbb43('0x97')]+=0x1;ut[_0xbb43('0x4d')](_0x1b6f96,'[16]');_0x1a3f98['countglobal']=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x4,_0xbb43('0x98'));rpcDb['createCustomerHistory'](_0x1a3f98,_0xbb43('0x99'));rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0x9a'));rpcDb[_0xbb43('0x9b')](_0x1a3f98);_0x1b6f96[_0xbb43('0x9c')]+=_0x1a3f98['talktime'];_0x1b6f96[_0xbb43('0x9d')]+=_0x1a3f98[_0xbb43('0x9e')];logger[_0xbb43('0x3b')]('[syncHangup][talking][decrement]',_0x1a3f98[_0xbb43('0x9f')],_0xbb43('0x8e'),_0x1b6f96[_0xbb43('0x2c')],_0xbb43('0x41'),_0x1b6f96[_0xbb43('0x8c')]);delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0x83')]];break;case _0xbb43('0xa0'):_0x1b6f96[_0xbb43('0xa1')]+=0x1;_0x1a3f98[_0xbb43('0xa2')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut['totalGlobal'](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x5,_0xbb43('0xa4'));_0x1fae27=_0x1b6f96[_0xbb43('0xa5')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];ami[_0xbb43('0x71')]('custom:agentbusy',ut['buildObj'](_0x1a3f98,'busy'));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xa6'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'5',_0x1b6f96)[_0xbb43('0x54')](function(_0x8d5a8d){_0x22bceb=_0x8d5a8d[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96['dialGlobalMaxRetry']){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x1a3f98[_0xbb43('0xa2')]>=_0x1b6f96['dialBusyMaxRetry']){rpcDb[_0xbb43('0x66')](_0x1a3f98,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xbb43('0x7f')](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0xa2'),_0x1b6f96[_0xbb43('0xa5')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98[_0xbb43('0x82')]);}}}else{_0x1a3f98[_0xbb43('0xa2')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98['idContact'],'field':{'countbusyretry':_0x1a3f98[_0xbb43('0xa2')]}})[_0xbb43('0x54')](function(){_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)[_0xbb43('0x54')](function(){});});}});break;case _0xbb43('0xa7'):_0x1b6f96[_0xbb43('0xa8')]+=0x1;_0x1a3f98['countnoanswerretry']+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x3,_0xbb43('0xa9'));_0x1fae27=_0x1b6f96[_0xbb43('0xaa')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];var _0x4f356d=ut[_0xbb43('0xab')](_0x1a3f98,_0x1b6f96);ami['emit'](_0xbb43('0xac'),_0x4f356d);rpcDb[_0xbb43('0x63')](_0x1a3f98,'[callProgressDetectingCustomer][logNoAnswer]');_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'3',_0x1b6f96)[_0xbb43('0x54')](function(_0x4d9668){_0x22bceb=_0x4d9668['additional']==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xad'));}else{if(_0x1a3f98[_0xbb43('0xae')]>=_0x1b6f96[_0xbb43('0xaf')]){rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0xb0'));}else{rpcDb['rescheduleContact'](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0xae'),_0x1b6f96[_0xbb43('0xaa')]),_0x1a3f98['unlockAgent'],_0x1a3f98['activeContact']);}}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98[_0xbb43('0xae')]}})['then'](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case _0xbb43('0xb1'):_0x1b6f96[_0xbb43('0xb2')]+=0x1;_0x1a3f98[_0xbb43('0xb3')]+=0x1;_0x1a3f98['countglobal']=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x8,'Congestion');_0x1fae27=_0x1b6f96['dialCongestionRetryFrequency'];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];ami[_0xbb43('0x71')](_0xbb43('0xb4'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0xb5')));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xb6'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'8',_0x1b6f96)['then'](function(_0xaa42f9){_0x22bceb=_0xaa42f9[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut['cloneAction'](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb['createCustomerFinal'](_0x3675d9,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x1a3f98[_0xbb43('0xb3')]>=_0x1b6f96[_0xbb43('0xb7')]){rpcDb[_0xbb43('0x66')](_0x1a3f98,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1a3f98,_0xbb43('0xb3'),_0x1b6f96[_0xbb43('0xa5')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98[_0xbb43('0x82')]);}}}else{_0x1a3f98[_0xbb43('0xb3')]++;_0x14fce0['incrementPreviewCounters']({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countcongestionretry':_0x1a3f98['countcongestionretry']}})[_0xbb43('0x54')](function(){_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case'CANCEL':_0x1b6f96[_0xbb43('0xb8')]+=0x1;_0x1a3f98[_0xbb43('0xb9')]+=0x1;_0x1a3f98['countglobal']=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x14,_0xbb43('0xba'));_0x1fae27=_0x1b6f96[_0xbb43('0xbb')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];ami[_0xbb43('0x71')](_0xbb43('0xbc'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0xbd')));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xbe'));_0x14fce0['verifyAdditionalPhones'](_0x1a3f98,'20',_0x1b6f96)[_0xbb43('0x54')](function(_0x5bbbf4){_0x22bceb=_0x5bbbf4[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0x14,_0xbb43('0xba'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xbf'));}else{if(_0x1a3f98[_0xbb43('0xb9')]>=_0x1b6f96[_0xbb43('0xc0')]){rpcDb['createCustomerFinal'](_0x1a3f98,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xbb43('0x7f')](ut[_0xbb43('0x80')](_0x1a3f98,'countagentrejectretry',_0x1b6f96[_0xbb43('0xbb')]),_0x1a3f98['unlockAgent'],_0x1a3f98[_0xbb43('0x82')]);}}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98[_0xbb43('0xae')]}})[_0xbb43('0x54')](function(){_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)[_0xbb43('0x54')](function(){});});}});break;case _0xbb43('0xc1'):_0x1b6f96[_0xbb43('0xc2')]+=0x1;_0x1a3f98[_0xbb43('0xc3')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0xb,_0xbb43('0xc4'));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xc5'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'11',_0x1b6f96)[_0xbb43('0x54')](function(_0x14cd97){_0x22bceb=_0x14cd97[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96['dialGlobalMaxRetry']){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb['createCustomerFinal'](_0x3675d9,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x1a3f98[_0xbb43('0xc6')]>=_0x1b6f96['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x1a3f98,_0xbb43('0xc5'));}else{rpcDb['rescheduleContact'](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0xc3'),_0x1b6f96[_0xbb43('0xc7')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98['activeContact']);}}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98['countnoanswerretry']}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case'18':_0x1b6f96[_0xbb43('0xc8')]+=0x1;_0x1a3f98[_0xbb43('0xc9')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x12,_0x99cb09[_0xbb43('0xca')]||_0x99cb09[_0xbb43('0xcb')]);ami[_0xbb43('0x71')](_0xbb43('0xcc'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0xcd')));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xce'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'18',_0x1b6f96)['then'](function(_0x1f5a0a){_0x22bceb=_0x1f5a0a[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut['cloneAction'](_0x1a3f98,0x12,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xce'));}else{rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0xce'));}}else{_0x1a3f98['countnoanswerretry']++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98['countnoanswerretry']}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0x83')]];break;case'19':_0x1b6f96[_0xbb43('0xc8')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut['logCustomer'](_0x1a3f98,0x13,_0x99cb09[_0xbb43('0xca')]||_0x99cb09[_0xbb43('0xcb')]);ami[_0xbb43('0x71')](_0xbb43('0xcc'),ut[_0xbb43('0x73')](_0x1a3f98,'amd'));rpcDb[_0xbb43('0x63')](_0x1a3f98,'[callProgressDetectingCustomer][machine]');_0x14fce0['verifyAdditionalPhones'](_0x1a3f98,'18',_0x1b6f96)[_0xbb43('0x54')](function(_0x54fd3b){_0x22bceb=_0x54fd3b[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,'Global');rpcDb['createCustomerFinal'](_0x3675d9,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0xcf'));}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98[_0xbb43('0xae')]}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});delete this[_0xbb43('0x13')][_0x99cb09['linkedid']];break;default:if(_0x1a3f98[_0xbb43('0x4c')]){ut[_0xbb43('0x4d')](_0x1b6f96,_0xbb43('0xd0'));ut[_0xbb43('0x4e')](_0xbb43('0xd1')+_0x1b6f96[_0xbb43('0x2c')],_0x99cb09);}_0x1b6f96[_0xbb43('0xc8')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut['logCustomer'](_0x1a3f98,0xc,_0x99cb09[_0xbb43('0xca')]||_0x99cb09[_0xbb43('0xcb')]);_0x1fae27=_0x1b6f96[_0xbb43('0xbb')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xd2'));_0x14fce0['verifyAdditionalPhones'](_0x1a3f98,'20',_0x1b6f96)[_0xbb43('0x54')](function(_0x2965ec){_0x22bceb=_0x2965ec[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xd3'));}else{rpcDb['createCustomerFinal'](_0x1a3f98,_0xbb43('0xd3'));}delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0x83')]];}else{_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)[_0xbb43('0x54')](function(){});}});}if(!(_0x1a3f98['dialAnswer']&&_0x44691b==='16')){ut['updateOriginated'](_0x1b6f96,_0xbb43('0xd4'));logger[_0xbb43('0x3b')]('[originated][decrement][callProgressDetectingCustomer]',_0x1a3f98[_0xbb43('0x9f')],'\x20Queue',_0x1b6f96[_0xbb43('0x2c')],_0xbb43('0x3f'),_0x1b6f96[_0xbb43('0xd5')]);}if(_0x44691b!=='ANSWER'){delete this['actions'][_0x99cb09['linkedid']];delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0xd6')]];}_0x1b6f96[_0xbb43('0xd7')]=!![];}};Preview[_0xbb43('0xe')][_0xbb43('0xd8')]=function(_0x53b9ee,_0xb54a91,_0x7271d0){if(_[_0xbb43('0xd9')](_0xb54a91)&&_0xbb43('0xda')!==typeof _0xb54a91){return;}if(_[_0xbb43('0xd9')](_0x7271d0)&&_0xbb43('0xda')!==typeof _0x7271d0){return;}switch(_0x7271d0['reason']){case'0':ut['logAgent'](_0x53b9ee,0x0,_0xbb43('0x70'));rpcDb[_0xbb43('0xdb')](_0x53b9ee,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x53b9ee,0x3,_0xbb43('0xa9'));rpcDb['createAgentHistory'](_0x53b9ee,_0xbb43('0xdc'));break;case'5':ut[_0xbb43('0xdd')](_0x53b9ee,0x5,_0xbb43('0xa4'));rpcDb[_0xbb43('0xdb')](_0x53b9ee,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xbb43('0xdd')](_0x53b9ee,0x8,_0xbb43('0xde'));rpcDb[_0xbb43('0xdb')](_0x53b9ee,_0xbb43('0xdf'));break;case'22':ut[_0xbb43('0xdd')](_0x53b9ee,0x16,_0xbb43('0xe0'));rpcDb['createAgentHistory'](_0x53b9ee,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xbb43('0xdd')](_0x53b9ee,0xc,_0x7271d0[_0xbb43('0xe1')]);rpcDb[_0xbb43('0xdb')](_0x53b9ee,_0xbb43('0xdf'));}ut[_0xbb43('0x4a')](_0xb54a91,'[callProgressDetectingAgent]');logger['info'](_0xbb43('0xe2'),_0x53b9ee[_0xbb43('0x9f')],_0xbb43('0x8e'),_0xb54a91['name'],_0xbb43('0x3f'),_0xb54a91[_0xbb43('0xd5')]);delete this[_0xbb43('0x13')][_0x53b9ee['uniqueid']];};Preview[_0xbb43('0xe')]['verifyAdditionalPhones']=function(_0x2719ce,_0x235409,_0x3386bc){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x2719ce,_0x235409,_0x3386bc)[_0xbb43('0x49')](logger[_0xbb43('0x3b')](_0xbb43('0xe3')));};Preview[_0xbb43('0xe')][_0xbb43('0x87')]=function(_0x34e8b8,_0x339b30,_0x4122e7){return cmHopperAdditionalPhone[_0xbb43('0x87')](_0x34e8b8,_0x339b30,_0x4122e7)[_0xbb43('0x49')](logger[_0xbb43('0x3b')](_0xbb43('0xe4')));};Preview[_0xbb43('0xe')][_0xbb43('0x85')]=function(_0x5e2afe){return Promise[_0xbb43('0xe5')]()[_0xbb43('0x54')](cmHopperAdditionalPhone[_0xbb43('0x85')](_0x5e2afe))[_0xbb43('0x49')](logger[_0xbb43('0x3b')](_0xbb43('0xe6')));};Preview[_0xbb43('0xe')][_0xbb43('0xe7')]=function(_0x1f8f78,_0x3a05be,_0x2dd161,_0x2d2127,_0x3c537a){var _0x36af9a=this;return new Promise(function(_0x199b58,_0x357e45){if(_[_0xbb43('0x3a')](_0x3a05be)||_['isNil'](_0x3a05be[_0xbb43('0xe8')])||_['isNil'](_0x3a05be['phone'])||_[_0xbb43('0x3a')](_0x3a05be[_0xbb43('0x45')])){_0x357e45(ut['message']('Contact\x20is\x20undefined',_0x2d2127,_0x3c537a));return;}var _0x3fce74=uuid['v4']();var _0x5911fc=_0x36af9a['campaignsPreview'][_0x3a05be[_0xbb43('0x3d')]['name']];var _0x41f3fe=_0x2dd161?_0x36af9a['agents'][_0x2dd161]['id']:undefined;_0x36af9a[_0xbb43('0x13')][_0x3fce74]=new Action(_0x3a05be,_0x5911fc,_0x3fce74,_0x2dd161,_0x41f3fe);var _0x5fdbcd=_0x36af9a['actions'][_0x3fce74];_0x5fdbcd[_0xbb43('0x81')]=_0x2d2127;_0x5fdbcd[_0xbb43('0x82')]=_0x3c537a;_0x5fdbcd[_0xbb43('0xe9')]=_0x2dd161;if(_[_0xbb43('0xea')](_0x1f8f78)){_0x36af9a[_0xbb43('0xeb')](_0x5fdbcd,_0x5911fc,_0x3a05be,_0x2dd161)['then'](function(_0x6b0dd){logger[_0xbb43('0x3b')](_0xbb43('0xec'),_0xbb43('0xed')+_0x5fdbcd[_0xbb43('0x3e')]+'\x20IdHopper:\x20'+_0x5fdbcd[_0xbb43('0x86')],JSON[_0xbb43('0x40')](_0x6b0dd));ami[_0xbb43('0x71')]('custom:agentcalled',ut['buildObj'](_0x5fdbcd,_0xbb43('0xee'),_0x36af9a[_0xbb43('0x11')][_0x5fdbcd[_0xbb43('0x3e')]]));_0x199b58(ut['message']('Calling'));})[_0xbb43('0x49')](function(_0x1ab4c4){ut[_0xbb43('0x28')](_0xbb43('0xef'),_0x1ab4c4);_0x357e45(ut[_0xbb43('0x2a')]('Call\x20failed',_0x2d2127,_0x3c537a));});}else{_0x5911fc[_0xbb43('0xf0')]+=0x1;ut[_0xbb43('0xf1')](_0x5fdbcd);rpcDb[_0xbb43('0xf2')](_0x5fdbcd,_0xbb43('0xf3'));delete _0x36af9a[_0xbb43('0x13')][_0x3fce74];_0x357e45(ut[_0xbb43('0x2a')]('Contact\x20in\x20black\x20List',_0x2d2127,_0x3c537a));}});};Preview[_0xbb43('0xe')][_0xbb43('0xf4')]=function(_0x12f7a9){return!_['isNil'](_0x12f7a9)&&!_[_0xbb43('0x3a')](_0x12f7a9['name'])&&!_[_0xbb43('0x3a')](_0x12f7a9[_0xbb43('0xf5')])&&_0x12f7a9[_0xbb43('0xf5')]&&!_[_0xbb43('0x3a')](this['trunks'][util[_0xbb43('0x1f')]('SIP/%s',_0x12f7a9[_0xbb43('0x2c')])])&&!_[_0xbb43('0x3a')](this[_0xbb43('0xf6')][util[_0xbb43('0x1f')](_0xbb43('0xf7'),_0x12f7a9['name'])][_0xbb43('0x47')])&&(this[_0xbb43('0xf6')][util[_0xbb43('0x1f')](_0xbb43('0xf7'),_0x12f7a9[_0xbb43('0x2c')])]['status']===_0xbb43('0xf8')||this[_0xbb43('0xf6')][util[_0xbb43('0x1f')]('SIP/%s',_0x12f7a9[_0xbb43('0x2c')])]['status']==='unmonitored');};Preview['prototype']['run']=function(_0x44b3de,_0x5d7629){return this[_0xbb43('0xf9')](_0x44b3de,_0x5d7629)[_0xbb43('0x54')](function(_0x20be22){return _[_0xbb43('0x42')](_0x20be22,['message']);})[_0xbb43('0x49')](function(_0x12c97f){if(_0x12c97f['unlock']){rpcDb[_0xbb43('0xfa')](_0x44b3de);}if(_0x12c97f[_0xbb43('0xf5')]){rpcDb['disableContact'](_0x44b3de);}throw _['pick'](_0x12c97f,[_0xbb43('0x2a')]);});};Preview[_0xbb43('0xe')][_0xbb43('0xf9')]=function(_0x5d6ec2,_0x17065d){var _0x59fc4a=this;var _0x448d75,_0x33edab;return rpcDb[_0xbb43('0xfb')](_0x5d6ec2)[_0xbb43('0x54')](function(_0x55df31){if(!_[_0xbb43('0x3a')](_0x55df31[0x0])){_0x33edab=_0x55df31[0x0][_0xbb43('0xfc')]?![]:!![];_0x448d75=_0x55df31[0x0][_0xbb43('0xfc')]?!![]:![];_0x448d75=_0x17065d?!![]:_0x448d75;}var _0x7c7f55=_0x59fc4a[_0xbb43('0xfd')](_0x55df31);if(_0x7c7f55['isValid']){rpcDb[_0xbb43('0xfe')](_[_0xbb43('0x42')](_0x55df31[0x0],['VoiceQueueId','phone']))[_0xbb43('0x54')](function(_0x4d0023){_0x59fc4a[_0xbb43('0xe7')](_0x4d0023,_0x55df31[0x0],_0x17065d,_0x33edab,_0x448d75)[_0xbb43('0x54')](function(_0x36fddb){return _0x36fddb;})[_0xbb43('0x49')](function(_0x6bbd30){throw _0x6bbd30;});})[_0xbb43('0x49')](function(_0x21a044){ut[_0xbb43('0x28')](_0xbb43('0xff'),_0x21a044);throw ut[_0xbb43('0x2a')]('Call\x20unsuccessful',_0x33edab,_0x448d75);});}else{throw ut[_0xbb43('0x2a')](_0x7c7f55[_0xbb43('0x2a')],_0x33edab,_0x448d75);}})[_0xbb43('0x49')](function(_0x544418){ut[_0xbb43('0x28')](_0xbb43('0x100'),_0x544418);throw ut[_0xbb43('0x2a')](_0xbb43('0x101'),![],!![]);});};Preview[_0xbb43('0xe')]['validateContact']=function(_0x3f4ab7){if(_['isNil'](_0x3f4ab7)||_['isEmpty'](_0x3f4ab7)||!_['isNil'](_0x3f4ab7[0x0]['Agent'])&&_[_0xbb43('0x3a')](_0x3f4ab7[0x0][_0xbb43('0x57')][_0xbb43('0x2c')])){ut[_0xbb43('0x28')](_0xbb43('0x102'),_0x3f4ab7);return{'isValid':![],'message':_0xbb43('0x103')};}var _0x108e6d=this['campaignsPreview'][_0x3f4ab7[0x0][_0xbb43('0x3d')][_0xbb43('0x2c')]];_0x108e6d[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x6c')];if(_[_0xbb43('0x3a')](_0x108e6d)){ut[_0xbb43('0x28')](_0xbb43('0x104'),_0x108e6d);return{'isValid':![],'message':_0xbb43('0x105')};}if(!this[_0xbb43('0xf4')](_0x108e6d[_0xbb43('0x6a')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xbb43('0x106')+_0x108e6d[_0xbb43('0x2c')]+_0xbb43('0x107'));if(!this[_0xbb43('0xf4')](_0x108e6d['TrunkBackup'])){ut[_0xbb43('0x28')](_0xbb43('0x108'),_0x108e6d[_0xbb43('0x2c')]+_0xbb43('0x109'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut['isActive'](_0x108e6d[_0xbb43('0x34')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x108e6d[_0xbb43('0x2c')]+_0xbb43('0x10a'));return{'isValid':![],'message':_0xbb43('0x106')+_0x108e6d[_0xbb43('0x2c')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xbb43('0x10b')};};Preview[_0xbb43('0xe')][_0xbb43('0xeb')]=function(_0x581645,_0x4e7cdb,_0x3eaada,_0x1c9c7f){var _0x1d5376=this;return new Promise(function(_0x2ba34c,_0x30e984){var _0x5d7a43=_0x581645[_0xbb43('0x9f')];var _0x540b8d=_0x1d5376[_0xbb43('0xf4')](_0x4e7cdb[_0xbb43('0x6a')])?util[_0xbb43('0x1f')](_0xbb43('0x10c'),_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x2c')],_['isNil'](_0x4e7cdb[_0xbb43('0x10d')])?'':_0x4e7cdb[_0xbb43('0x10d')]['trim']()||'',_0x4e7cdb[_0xbb43('0x10e')]>0x0?_0x3eaada[_0xbb43('0x10f')][_0xbb43('0x110')](_0x4e7cdb[_0xbb43('0x10e')]):_0x3eaada[_0xbb43('0x10f')]):util[_0xbb43('0x1f')](_0xbb43('0x10c'),_[_0xbb43('0x3a')](_0x4e7cdb['TrunkBackup'])?_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x2c')]:_0x4e7cdb[_0xbb43('0x111')][_0xbb43('0x2c')],_['isNil'](_0x4e7cdb[_0xbb43('0x10d')])?'':_0x4e7cdb[_0xbb43('0x10d')][_0xbb43('0x112')]()||'',_0x4e7cdb[_0xbb43('0x10e')]>0x0?_0x3eaada[_0xbb43('0x10f')][_0xbb43('0x110')](_0x4e7cdb[_0xbb43('0x10e')]):_0x3eaada[_0xbb43('0x10f')]);var _0x1f211d=_0x1d5376[_0xbb43('0xf4')](_0x4e7cdb['Trunk'])?ut[_0xbb43('0x113')](_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x114')],_0x4e7cdb['dialOriginateCallerIdName'],_0x4e7cdb[_0xbb43('0x115')]>0x0?ut[_0xbb43('0x116')](_0x4e7cdb[_0xbb43('0x117')],_0x4e7cdb[_0xbb43('0x115')]):_0x4e7cdb[_0xbb43('0x117')]):ut['getCallerId'](_[_0xbb43('0x3a')](_0x4e7cdb[_0xbb43('0x111')])?_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x114')]:_0x4e7cdb[_0xbb43('0x111')][_0xbb43('0x114')],_0x4e7cdb['dialOriginateCallerIdName'],_0x4e7cdb[_0xbb43('0x115')]>0x0?ut[_0xbb43('0x116')](_0x4e7cdb[_0xbb43('0x117')],_0x4e7cdb[_0xbb43('0x115')]):_0x4e7cdb[_0xbb43('0x117')]);if(_0x1f211d){_0x581645[_0xbb43('0x118')]=ut[_0xbb43('0x119')](_0x1f211d);_0x581645[_0xbb43('0x11a')]=ut[_0xbb43('0x11b')](_0x1f211d);}var _0x19260c=ut[_0xbb43('0x11c')](_0x4e7cdb,_0x3eaada,_0x540b8d,_0x1f211d,_0x5d7a43,_0x581645);_[_0xbb43('0x11d')](_0x581645,ut[_0xbb43('0x11e')](_0x19260c));_0x581645[_0xbb43('0x5d')]=moment()['format'](_0xbb43('0x89'));_0x4e7cdb[_0xbb43('0x11f')]=_0x19260c;var _0x1baf8c=ut[_0xbb43('0x120')](_0x581645,_0x4e7cdb,_0x19260c,_0x581645[_0xbb43('0x82')],_0x1c9c7f);return ami[_0xbb43('0x46')](_0x1baf8c)['then'](function(_0x4345e4){_0x4e7cdb[_0xbb43('0xd5')]+=0x1;logger[_0xbb43('0x3b')](_0xbb43('0x121'),_0x5d7a43,_0xbb43('0x8e'),_0x4e7cdb[_0xbb43('0x2c')],_0xbb43('0x3f'),_0x4e7cdb[_0xbb43('0xd5')]);_0x2ba34c(_0x4345e4);})[_0xbb43('0x49')](function(_0x510584){ut[_0xbb43('0xdd')](_0x581645,0xe,_0xbb43('0x122'));rpcDb[_0xbb43('0xdb')](_0x581645,_0xbb43('0x123'));_0x30e984(_0x510584);});});};Preview[_0xbb43('0xe')]['syncNewExten']=function(_0x26825d){if(this['actions'][_0x26825d['linkedid']]){this['actions'][_0x26825d[_0xbb43('0x83')]][_0xbb43('0x48')]=_0x26825d['channel'];}};Preview['prototype'][_0xbb43('0x15')]=function(_0x59d31f){var _0x400c6e=this;var _0x26c450=this[_0xbb43('0x13')][_0x59d31f[_0xbb43('0x124')]];if(_0x26c450){if(_0x26c450[_0xbb43('0xe9')]&&this['agents'][_0x26c450[_0xbb43('0xe9')]]){ut[_0xbb43('0x125')](_0x26c450,this[_0xbb43('0x126')][_0x26c450[_0xbb43('0xe9')]][_0xbb43('0x2c')],this[_0xbb43('0x126')][_0x26c450['lookAgent']]['id']);}var _0x756278=_[_0xbb43('0x127')](_0x26c450);_0x756278[_0xbb43('0x8a')]=moment()[_0xbb43('0x1f')](_0xbb43('0x89'));var _0x4cd83a=_0x400c6e[_0xbb43('0x11')][_0x26c450[_0xbb43('0x3e')]];if(ut[_0xbb43('0x128')](_0x59d31f[_0xbb43('0x129')])){if(_0x26c450[_0xbb43('0x81')]){rpcDb[_0xbb43('0xfa')](_0x26c450[_0xbb43('0x86')]);}if(_0x26c450[_0xbb43('0x82')]){rpcDb[_0xbb43('0x5c')](_0x26c450['idContact']);}ami[_0xbb43('0x71')](_0xbb43('0x12a'),ut[_0xbb43('0x73')](_0x26c450,_0xbb43('0x12b'),this[_0xbb43('0x11')][_0x26c450[_0xbb43('0x3e')]]));this[_0xbb43('0xd8')](_0x756278,_0x4cd83a,_0x59d31f);}else{_0x26c450['starttime']=moment()[_0xbb43('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xbb43('0xdd')](_0x756278,0x4,'Answer');rpcDb[_0xbb43('0xdb')](_0x756278,_0xbb43('0x12c'));}}};Preview[_0xbb43('0xe')][_0xbb43('0x12d')]=function(_0x31d75c){var _0x570d24=this['actions'][_0x31d75c['linkedid']];var _0x1d4d0b;if(_0x570d24){_0x1d4d0b=this[_0xbb43('0x11')][_0x570d24['queue']];logger['info'](_0xbb43('0x12e'),_0x31d75c[_0xbb43('0x83')],_0xbb43('0x8e'),_0x1d4d0b[_0xbb43('0x2c')],_0xbb43('0x41'),_0x1d4d0b['pTalking']);}if(this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]]&&_0x31d75c['linkedid']!==_0x31d75c['uniqueid']){if(_0x31d75c[_0xbb43('0x12f')]==='16'&&this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]]['dialAnswer']){this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c['linkedid'],_0x31d75c[_0xbb43('0x12f')]);}else if(this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]][_0xbb43('0x4c')]){logger[_0xbb43('0x3b')]('[syncHangup][talking][cause]',_0x31d75c[_0xbb43('0x83')],_0x31d75c[_0xbb43('0x12f')],_0xbb43('0x8e'),_0x1d4d0b[_0xbb43('0x2c')],_0xbb43('0x41'),_0x1d4d0b['pTalking']);this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c[_0xbb43('0x83')],_0x31d75c['cause']);}}else if(_0x570d24&&_['isNil'](_0x570d24[_0xbb43('0x130')])&&_0x1d4d0b[_0xbb43('0x131')]&&_0x31d75c['linkedid']===_0x31d75c['uniqueid']&&_[_0xbb43('0x3a')](_0x31d75c[_0xbb43('0xe1')])&&_0x31d75c[_0xbb43('0x12f')]==='16'&&_0x31d75c[_0xbb43('0x132')]==='6'&&_['isUndefined'](_0x570d24[_0xbb43('0x133')])){if(_0x570d24['unlockAgent']){rpcDb[_0xbb43('0xfa')](_0x570d24[_0xbb43('0x86')]);}if(_0x570d24[_0xbb43('0x82')]){rpcDb['disableContact'](_0x570d24[_0xbb43('0x86')]);}_0x31d75c[_0xbb43('0xe1')]='22';this[_0xbb43('0xd8')](_0x570d24,_0x1d4d0b,_0x31d75c);}else if(_0x570d24&&_0x570d24[_0xbb43('0x133')]){if(_0x31d75c[_0xbb43('0x12f')]==='16'&&this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]]['dialAnswer']){logger[_0xbb43('0x3b')]('[syncHangup][talking][transfer]',_0x31d75c[_0xbb43('0x83')],_0x31d75c[_0xbb43('0x12f')],_0xbb43('0x8e'),_0x1d4d0b[_0xbb43('0x2c')],'pTalking:\x20',_0x1d4d0b[_0xbb43('0x8c')]);this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c['linkedid'],_0x31d75c[_0xbb43('0x12f')]);}else if(this['actions'][_0x31d75c[_0xbb43('0x83')]][_0xbb43('0x4c')]){logger[_0xbb43('0x3b')]('[syncHangup][talking][cause]',_0x31d75c['linkedid'],_0x31d75c[_0xbb43('0x12f')],'\x20Queue',_0x1d4d0b[_0xbb43('0x2c')],'pTalking:\x20',_0x1d4d0b[_0xbb43('0x8c')]);this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c[_0xbb43('0x83')],_0x31d75c[_0xbb43('0x12f')]);}}};Preview[_0xbb43('0xe')][_0xbb43('0x19')]=function(_0xa1e9ba){if(this[_0xbb43('0x13')][_0xa1e9ba['destlinkedid']]&&_0xa1e9ba[_0xbb43('0xd6')]!==_0xa1e9ba[_0xbb43('0x134')]){this[_0xbb43('0x6d')](_0xa1e9ba,_0xa1e9ba[_0xbb43('0xd6')],_0xa1e9ba['dialstatus']);}};Preview[_0xbb43('0xe')][_0xbb43('0x18')]=function(_0x3178f7){if(this[_0xbb43('0x13')][_0x3178f7[_0xbb43('0x83')]]&&_0x3178f7[_0xbb43('0x83')]!==_0x3178f7['uniqueid']&&!this['actions'][_0x3178f7['linkedid']][_0xbb43('0x4c')]){if(_0x3178f7['cause']==='1'){this[_0xbb43('0x6d')](_0x3178f7,_0x3178f7[_0xbb43('0x83')],_0x3178f7['cause']);}}};Preview[_0xbb43('0xe')][_0xbb43('0x135')]=function(_0xea8659,_0x157391,_0x2b60f0){if(this['actions'][_0xea8659]){if(_[_0xbb43('0x3a')](this[_0xbb43('0x13')][_0xea8659]['variables'])){this['actions'][_0xea8659][_0xbb43('0x11f')]={};}this['actions'][_0xea8659][_0xbb43('0x11f')][_0x157391]=_0x2b60f0;}};Preview[_0xbb43('0xe')]['syncVarSet']=function(_0x18a8d3){try{if(!_[_0xbb43('0x3a')](_0x18a8d3)){if(ut['filterKey'](_[_0xbb43('0x136')](_0x18a8d3['variable'])[0x0])){this['addVariable'](_0x18a8d3['uniqueid'],_['keys'](_0x18a8d3[_0xbb43('0x137')])[0x0],_0x18a8d3[_0xbb43('0x138')]);}}}catch(_0x21ba01){logger[_0xbb43('0x139')](_0xbb43('0x13a'),util[_0xbb43('0x13b')](_0x21ba01,{'showHidden':![],'depth':null}));}};Preview[_0xbb43('0xe')][_0xbb43('0x1c')]=function(_0x53b812){if(_0x53b812){if(this[_0xbb43('0x13')][_0x53b812[_0xbb43('0x13c')]]){this[_0xbb43('0x13')][_0x53b812[_0xbb43('0x13c')]][_0xbb43('0x133')]=!![];}}};Preview[_0xbb43('0xe')]['syncBlindTransfer']=function(_0x47c884){if(_0x47c884){if(this[_0xbb43('0x13')][_0x47c884[_0xbb43('0x13d')]]){this[_0xbb43('0x13')][_0x47c884['transfererlinkedid']][_0xbb43('0x133')]=!![];}}};module[_0xbb43('0x13e')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index fb5e8f2..3112228 100644 --- a/server/services/ami/preview/rpcDb.js +++ b/server/services/ami/preview/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8bb=['[voiceQueueReport]\x20','getContactRecallMe','util','bluebird','../../../config/logger','preview','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','checkIsBlackList','getContactPreview','then','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create'];(function(_0xd6b4d1,_0x1a0189){var _0x59098b=function(_0x2bafd6){while(--_0x2bafd6){_0xd6b4d1['push'](_0xd6b4d1['shift']());}};_0x59098b(++_0x1a0189);}(_0xd8bb,0xb6));var _0xbd8b=function(_0x2d58e7,_0x828fab){_0x2d58e7=_0x2d58e7-0x0;var _0x59e6f=_0xd8bb[_0x2d58e7];return _0x59e6f;};'use strict';var util=require(_0xbd8b('0x0'));var BPromise=require(_0xbd8b('0x1'));var logger=require(_0xbd8b('0x2'))(_0xbd8b('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xbd8b('0x4'));var agentReportPreview=require(_0xbd8b('0x5'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x36fbea){return function(_0x466526){logger[_0xbd8b('0x6')](_0x36fbea,util[_0xbd8b('0x7')](_0x466526,{'showHidden':![],'depth':null}));};}function create(_0x2c270d){return cmHopperHistory[_0xbd8b('0x8')](_0x2c270d)[_0xbd8b('0x9')](loggerCatch(_0xbd8b('0xa')));}function createAgent(_0x6f9392){return BPromise[_0xbd8b('0xb')]()['then'](agentReportPreview['createHistory'](_0x6f9392))[_0xbd8b('0x9')](loggerCatch(_0xbd8b('0xa')));}function moveContact(_0x50b092){return cmHopper[_0xbd8b('0xc')](_0x50b092,!![])[_0xbd8b('0x9')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xbd8b('0xd')]=function(_0x3e65cf){return cmHopperBlack[_0xbd8b('0xd')](_0x3e65cf)[_0xbd8b('0x9')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xbd8b('0xe')]=function(_0x2735f4){return BPromise[_0xbd8b('0xb')]()[_0xbd8b('0xf')](cmHopper['getContactPreview'](_0x2735f4))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0xbd8b('0x8')]=function(_0x2e53f6,_0x57b911){create(_0x2e53f6)[_0xbd8b('0x9')](loggerCatch(_0x57b911));moveContact(_0x2e53f6)[_0xbd8b('0x9')](loggerCatch(_0x57b911));};exports[_0xbd8b('0x10')]=function(_0x38ade9,_0x2d79f1){createAgent(_0x38ade9)['catch'](loggerCatch(_0x2d79f1));};exports[_0xbd8b('0x11')]=function(_0x446a30,_0x40806a){create(_0x446a30)[_0xbd8b('0x9')](loggerCatch(_0x40806a));};exports['createCustomerFinal']=function(_0x281eff,_0x10bd8a){moveContact(_0x281eff)[_0xbd8b('0x9')](loggerCatch(_0x10bd8a));};exports[_0xbd8b('0x12')]=function(_0x686edd,_0x4e3da8,_0x41414c){if(_0x4e3da8){_0x686edd[_0xbd8b('0x13')]=null;}if(_0x41414c){_0x686edd['active']=![];}return cmHopper[_0xbd8b('0x12')](_0x686edd)[_0xbd8b('0x9')](loggerCatch(_0xbd8b('0x14')));};exports[_0xbd8b('0x15')]=function(_0x45ad84){return cmHopper['countReScheduled'](_0x45ad84)[_0xbd8b('0x9')](loggerCatch('[countReScheduled]\x20'));};exports[_0xbd8b('0x16')]=function(_0x404562){return cmHopper[_0xbd8b('0x16')]({'UserId':null},_0x404562,0x1)[_0xbd8b('0x9')](loggerCatch(_0xbd8b('0x17')));};exports[_0xbd8b('0x18')]=function(_0x1f36c9){return cmHopper[_0xbd8b('0x16')]({'active':![]},_0x1f36c9,0x1)[_0xbd8b('0x9')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x12fa12){var _0x23508c={};_0x23508c['type']=_0x12fa12[_0xbd8b('0x19')];_0x23508c[_0xbd8b('0x1a')]=_0x12fa12[_0xbd8b('0x1a')];_0x23508c['calleridnum']=_0x12fa12['calleridnum'];_0x23508c[_0xbd8b('0x1b')]=_0x12fa12['calleridname'];_0x23508c[_0xbd8b('0x1c')]=_0x12fa12[_0xbd8b('0x1c')];_0x23508c[_0xbd8b('0x1d')]=_0x12fa12[_0xbd8b('0x1e')];_0x23508c['queuecallerleaveAt']=_0x12fa12[_0xbd8b('0x1e')];_0x23508c[_0xbd8b('0x1f')]=0x1;_0x23508c[_0xbd8b('0x20')]=_0x12fa12[_0xbd8b('0x21')];_0x23508c['connectedlinename']=_0x12fa12[_0xbd8b('0x22')];_0x23508c[_0xbd8b('0x23')]=_0xbd8b('0x24');_0x23508c[_0xbd8b('0x25')]='xcally-motion-preview';_0x23508c[_0xbd8b('0x26')]=0x0;_0x23508c['assigned']=0x1;_0x23508c[_0xbd8b('0x27')]=_0x12fa12['membername'];_0x23508c[_0xbd8b('0x28')]=_0xbd8b('0x29');return BPromise[_0xbd8b('0xb')]()[_0xbd8b('0xf')](voiceQueueReport[_0xbd8b('0x2a')](_0x23508c))[_0xbd8b('0x9')](loggerCatch(_0xbd8b('0x2b')));};exports[_0xbd8b('0x2c')]=function(_0x4e35d5,_0x5e08f7){return BPromise[_0xbd8b('0xb')]()[_0xbd8b('0xf')](cmHopper[_0xbd8b('0x2c')](_0x4e35d5,_0x5e08f7))[_0xbd8b('0x9')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x36959b){return cmHopper[_0xbd8b('0x12')](_0x36959b,!![],!![])[_0xbd8b('0x9')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x6f73=['inspect','createHistory','catch','resolve','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error'];(function(_0x9e670b,_0x1ea251){var _0x17188f=function(_0x1e525e){while(--_0x1e525e){_0x9e670b['push'](_0x9e670b['shift']());}};_0x17188f(++_0x1ea251);}(_0x6f73,0x92));var _0x36f7=function(_0x35ba2f,_0x554cb7){_0x35ba2f=_0x35ba2f-0x0;var _0x4b8bc6=_0x6f73[_0x35ba2f];return _0x4b8bc6;};'use strict';var util=require(_0x36f7('0x0'));var BPromise=require(_0x36f7('0x1'));var logger=require(_0x36f7('0x2'))(_0x36f7('0x3'));var cmHopper=require(_0x36f7('0x4'));var cmHopperHistory=require(_0x36f7('0x5'));var cmHopperBlack=require(_0x36f7('0x6'));var agentReportPreview=require(_0x36f7('0x7'));var voiceQueueReport=require(_0x36f7('0x8'));function loggerCatch(_0x2bd7a2){return function(_0x2ab764){logger[_0x36f7('0x9')](_0x2bd7a2,util[_0x36f7('0xa')](_0x2ab764,{'showHidden':![],'depth':null}));};}function create(_0x245e58){return cmHopperHistory[_0x36f7('0xb')](_0x245e58)[_0x36f7('0xc')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x99fd86){return BPromise[_0x36f7('0xd')]()[_0x36f7('0xe')](agentReportPreview['createHistory'](_0x99fd86))['catch'](loggerCatch(_0x36f7('0xf')));}function moveContact(_0x23a021){return cmHopper[_0x36f7('0x10')](_0x23a021,!![])[_0x36f7('0xc')](loggerCatch(_0x36f7('0x11')));}exports[_0x36f7('0x12')]=function(_0x59bda1){return cmHopperBlack[_0x36f7('0x12')](_0x59bda1)[_0x36f7('0xc')](loggerCatch(_0x36f7('0x13')));};exports[_0x36f7('0x14')]=function(_0x26dd1a){return BPromise['resolve']()[_0x36f7('0xe')](cmHopper[_0x36f7('0x14')](_0x26dd1a))[_0x36f7('0xc')](loggerCatch('[getContactPreview]\x20'));};exports[_0x36f7('0xb')]=function(_0x1e97f9,_0x318f21){create(_0x1e97f9)['catch'](loggerCatch(_0x318f21));moveContact(_0x1e97f9)[_0x36f7('0xc')](loggerCatch(_0x318f21));};exports[_0x36f7('0x15')]=function(_0x358331,_0x55774d){createAgent(_0x358331)['catch'](loggerCatch(_0x55774d));};exports[_0x36f7('0x16')]=function(_0x2266c0,_0x36cd50){create(_0x2266c0)['catch'](loggerCatch(_0x36cd50));};exports[_0x36f7('0x17')]=function(_0x43c1e7,_0x3021e2){moveContact(_0x43c1e7)[_0x36f7('0xc')](loggerCatch(_0x3021e2));};exports['rescheduleContact']=function(_0x490598,_0x43c11d,_0x11b3e0){if(_0x43c11d){_0x490598[_0x36f7('0x18')]=null;}if(_0x11b3e0){_0x490598[_0x36f7('0x19')]=![];}return cmHopper[_0x36f7('0x1a')](_0x490598)[_0x36f7('0xc')](loggerCatch(_0x36f7('0x1b')));};exports[_0x36f7('0x1c')]=function(_0x2d48ab){return cmHopper[_0x36f7('0x1c')](_0x2d48ab)['catch'](loggerCatch(_0x36f7('0x1d')));};exports[_0x36f7('0x1e')]=function(_0x2a31ea){return cmHopper[_0x36f7('0x1e')]({'UserId':null},_0x2a31ea,0x1)[_0x36f7('0xc')](loggerCatch(_0x36f7('0x1f')));};exports['disableContact']=function(_0x49806){return cmHopper['unlockContact']({'active':![]},_0x49806,0x1)[_0x36f7('0xc')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x4aa437){var _0x4f7682={};_0x4f7682[_0x36f7('0x20')]=_0x4aa437[_0x36f7('0x20')];_0x4f7682[_0x36f7('0x21')]=_0x4aa437[_0x36f7('0x21')];_0x4f7682['calleridnum']=_0x4aa437['calleridnum'];_0x4f7682[_0x36f7('0x22')]=_0x4aa437[_0x36f7('0x22')];_0x4f7682[_0x36f7('0x23')]=_0x4aa437[_0x36f7('0x23')];_0x4f7682[_0x36f7('0x24')]=_0x4aa437[_0x36f7('0x25')];_0x4f7682['queuecallerleaveAt']=_0x4aa437[_0x36f7('0x25')];_0x4f7682[_0x36f7('0x26')]=0x1;_0x4f7682['queuecallercompleteAt']=_0x4aa437[_0x36f7('0x27')];_0x4f7682[_0x36f7('0x28')]=_0x4aa437[_0x36f7('0x29')];_0x4f7682[_0x36f7('0x2a')]='from-sip';_0x4f7682[_0x36f7('0x2b')]='xcally-motion-preview';_0x4f7682[_0x36f7('0x2c')]=0x0;_0x4f7682[_0x36f7('0x2d')]=0x1;_0x4f7682[_0x36f7('0x2e')]=_0x4aa437[_0x36f7('0x29')];_0x4f7682[_0x36f7('0x2f')]='COMPLETED';return BPromise[_0x36f7('0xd')]()[_0x36f7('0xe')](voiceQueueReport['create'](_0x4f7682))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x36f7('0x30')]=function(_0x26b352,_0x2f3f22){return BPromise['resolve']()[_0x36f7('0xe')](cmHopper[_0x36f7('0x30')](_0x26b352,_0x2f3f22))[_0x36f7('0xc')](loggerCatch(_0x36f7('0x31')));};exports[_0x36f7('0x32')]=function(_0x2e0f07){return cmHopper[_0x36f7('0x1a')](_0x2e0f07,!![],!![])[_0x36f7('0xc')](loggerCatch(_0x36f7('0x33')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index ed89098..eef79c1 100644 --- a/server/services/ami/preview/util/util.js +++ b/server/services/ami/preview/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f75=['moment','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','logger','loggerError','error','logger2','info','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','logLookAgent','membername','UserId','ringtime','getSeconds','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','active','scheduledat','add','minutes','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','seconds','createBody','ContactId','CampaignId','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridNumber','match','keys','variables','toLowerCase','buildNoAnswerEventPayload','util','lodash'];(function(_0x40d898,_0x507ef6){var _0x133d32=function(_0x1a5389){while(--_0x1a5389){_0x40d898['push'](_0x40d898['shift']());}};_0x133d32(++_0x507ef6);}(_0x5f75,0x96));var _0x55f7=function(_0x520db8,_0x4606b5){_0x520db8=_0x520db8-0x0;var _0x4e658b=_0x5f75[_0x520db8];return _0x4e658b;};'use strict';var util=require(_0x55f7('0x0'));var _=require(_0x55f7('0x1'));var moment=require(_0x55f7('0x2'));var logger=require('../../../../config/logger')(_0x55f7('0x3'));var ipAgi=process[_0x55f7('0x4')][_0x55f7('0x5')]||_0x55f7('0x6');var utils=require(_0x55f7('0x7'));exports[_0x55f7('0x8')]=function(_0x550286){return function(_0x1e4b41){logger['error'](_0x550286,util[_0x55f7('0x9')](_0x1e4b41,{'showHidden':![],'depth':null}));};};exports[_0x55f7('0xa')]=function(_0x4212ba,_0x1bd425){logger['info'](_0x4212ba,util[_0x55f7('0x9')](_0x1bd425,{'showHidden':![],'depth':null}));};exports[_0x55f7('0xb')]=function(_0x366183,_0x1b613e){logger[_0x55f7('0xc')](_0x366183,util['inspect'](_0x1b613e,{'showHidden':![],'depth':null}));};exports[_0x55f7('0xd')]=function(_0x22a810){return function(_0x46d9f3){logger[_0x55f7('0xe')](_0x22a810,util[_0x55f7('0x9')](_0x46d9f3,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x9e8d74,_0x504777,_0x1913d0){return{'message':_0x9e8d74,'unlock':_0x504777,'active':_0x1913d0};};exports[_0x55f7('0xf')]=function(_0xe7bf4e,_0x24a741,_0x2d5551){if(!_[_0x55f7('0x10')](_0x2d5551)&&'string'===typeof _0x2d5551&&!_[_0x55f7('0x11')](_0x2d5551)){if(!_['isUndefined'](_0x24a741)&&_0x55f7('0x12')===typeof _0x24a741&&!_[_0x55f7('0x11')](_0x24a741)){return util[_0x55f7('0x13')]('\x22%s\x22\x20<%s>',_0x24a741,_0x2d5551);}return util[_0x55f7('0x13')](_0x55f7('0x14'),_0x2d5551,_0x2d5551);}if(!_['isUndefined'](_0xe7bf4e)&&_0x55f7('0x12')===typeof _0xe7bf4e&&!_[_0x55f7('0x11')](_0xe7bf4e)){return _0xe7bf4e;}return _0x55f7('0x15');};exports[_0x55f7('0x16')]=function(_0x2c2ff1){if(_[_0x55f7('0x17')](_0x2c2ff1)){return![];}return _0x2c2ff1;};exports[_0x55f7('0x18')]=function(_0x9fd424,_0x5e0072,_0x5eefbd,_0x584ddc,_0x575cc0,_0x32ddad){var _0x2903f2={'XMD-QUEUE':_0x5e0072[_0x55f7('0x19')]?_0x5e0072['Queue']['name']:'','XMD-CALLERID':_0x584ddc,'XMD-CALLERID-PREVIEW':_0x32ddad?util[_0x55f7('0x13')](_0x55f7('0x14'),_0x32ddad[_0x55f7('0x1a')],_0x32ddad[_0x55f7('0x1b')]):_0x584ddc,'XMD-DIALID':_0x575cc0,'XMD-CONTACTID':_0x5e0072['ContactId'],'XMD-CDRTYPE':_0x55f7('0x1c'),'CALLERID(all)':_0x584ddc,'XMD-VOICEQUEUEID':_0x5e0072[_0x55f7('0x1d')],'XMD-DIALCHANNEL':_0x5eefbd,'XMD-DIALTIMEOUT':_0x9fd424[_0x55f7('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x55f7('0x1f'),_0x9fd424[_0x55f7('0x20')]?'g':'',_[_0x55f7('0x11')](_0x9fd424['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x9fd424['dialPreviewUrl']||'','XMD-AGI':_0x9fd424[_0x55f7('0x21')]?util[_0x55f7('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x9fd424['dialQueueProject']):_0x55f7('0x22'),'XMD-AGIAFTER':_0x9fd424[_0x55f7('0x20')]?util[_0x55f7('0x13')](_0x55f7('0x23'),ipAgi,_0x9fd424[_0x55f7('0x20')]):_0x55f7('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x32ddad?_0x32ddad[_0x55f7('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x32ddad?_0x32ddad[_0x55f7('0x25')]:'','XMD-DESTINATION':_0x55f7('0x26'),'SIPADDHEADER':_0x55f7('0x27')};if(!_[_0x55f7('0x11')](_0x9fd424[_0x55f7('0x28')])){_0x2903f2[util[_0x55f7('0x13')]('%s',_0x55f7('0x29'))]=_0x9fd424[_0x55f7('0x28')];_0x2903f2[util['format']('%s',_0x55f7('0x2a'))]=_0x575cc0;}if(_0x5e0072&&_0x5e0072['Contact']){for(var _0x5e610c in _0x5e0072[_0x55f7('0x2b')]){if(_0x5e0072[_0x55f7('0x2b')][_0x55f7('0x2c')](_0x5e610c)){if(!_[_0x55f7('0x17')](_0x5e0072[_0x55f7('0x2b')][_0x5e610c])&&_0x5e610c!=='id'&&_0x5e610c!==_0x55f7('0x2d')&&_0x5e610c!==_0x55f7('0x2e')&&_0x5e610c!==_0x55f7('0x2f')){_0x2903f2[util['format'](_0x55f7('0x30'),_0x55f7('0x31'),_[_0x55f7('0x32')](_0x5e610c))]=_0x5e0072[_0x55f7('0x2b')][_0x5e610c];}}}}return _0x2903f2;};exports['toLowerVariables']=function(_0xc196fb){var _0xa8bc63={};for(var _0x44cbee in _0xc196fb){if(_0xc196fb[_0x55f7('0x2c')](_0x44cbee)){_0xa8bc63[util[_0x55f7('0x13')]('%s',_[_0x55f7('0x33')](_0x44cbee))]=_0xc196fb[_0x44cbee];}}return{'variables':_0xa8bc63};};exports[_0x55f7('0x34')]=function(_0x4f5acf,_0xa80a0e){if(!_[_0x55f7('0x17')](_0x4f5acf)){if(_0x4f5acf['hasOwnProperty'](_0x55f7('0x35'))){if(_0x4f5acf[_0x55f7('0x35')]>0x0){_0x4f5acf[_0x55f7('0x35')]-=0x1;}else{logger[_0x55f7('0xc')](_0x55f7('0x36'),_0xa80a0e);}}}else{logger[_0x55f7('0xc')](_0x55f7('0x37'),_0xa80a0e);}};exports[_0x55f7('0x38')]=function(_0x4618cf){var _0x36eebb=moment()[_0x55f7('0x13')](_0x55f7('0x39'));_0x4618cf[_0x55f7('0x3a')]=0xd;_0x4618cf[_0x55f7('0x3b')]=_0x55f7('0x3c');_0x4618cf[_0x55f7('0x3d')]=_0x36eebb;_0x4618cf[_0x55f7('0x3e')]=_0x36eebb;_0x4618cf[_0x55f7('0x3f')]=_0x36eebb;};exports[_0x55f7('0x40')]=function(_0x51155a,_0x587802,_0x48bf95){var _0x85c4ef=moment()[_0x55f7('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x51155a[_0x55f7('0x3a')]=_0x587802;_0x51155a[_0x55f7('0x3b')]=_0x48bf95;_0x51155a[_0x55f7('0x3e')]=_0x85c4ef;_0x51155a['ringtime']=utils['getSeconds'](_0x51155a[_0x55f7('0x3e')],_0x51155a[_0x55f7('0x3d')]);};exports[_0x55f7('0x41')]=function(_0x1daf24,_0x568dfb,_0x327d66){_0x1daf24[_0x55f7('0x42')]=_0x568dfb;_0x1daf24[_0x55f7('0x43')]=_0x327d66;};exports['logCustomer']=function(_0x4694b4,_0x1d5f44,_0x56ee5b){var _0x8a006e=moment()[_0x55f7('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x4694b4[_0x55f7('0x3a')]=_0x1d5f44;_0x4694b4[_0x55f7('0x3b')]=_0x56ee5b;_0x4694b4[_0x55f7('0x3e')]=_0x4694b4[_0x55f7('0x3e')]?_0x4694b4['responsetime']:_0x8a006e;_0x4694b4[_0x55f7('0x3f')]=_0x4694b4['endtime']?_0x4694b4['endtime']:_0x8a006e;_0x4694b4[_0x55f7('0x44')]=utils[_0x55f7('0x45')](_0x4694b4[_0x55f7('0x3e')]||0x0,_0x4694b4[_0x55f7('0x3d')]||0x0);_0x4694b4['talktime']=_0x4694b4[_0x55f7('0x46')]?utils[_0x55f7('0x45')](_0x4694b4['endtime'],_0x4694b4[_0x55f7('0x46')]):0x0;};exports[_0x55f7('0x47')]=function(_0x891dca){return _0x891dca===_0x55f7('0x48');};exports[_0x55f7('0x49')]=function(_0x48f2f6,_0x3a7ca8,_0x18cb48,_0x278959,_0x231487){var _0x6e63f9=_0x278959?_0x55f7('0x4a'):_0x48f2f6[_0x55f7('0x1a')];_0x6e63f9=_0x231487?_0x55f7('0x4b'):_0x6e63f9;return{'actionid':_0x48f2f6[_0x55f7('0x4c')],'action':'originate','channel':_0x48f2f6[_0x55f7('0x4d')],'callerid':util[_0x55f7('0x13')]('\x22%s\x22\x20<%s>',_0x6e63f9,_0x48f2f6['calleridnum']),'Exten':_0x55f7('0x26'),'Context':'from-sip','Priority':'1','variable':_0x18cb48,'timeout':(_0x3a7ca8['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x48f2f6[_0x55f7('0x4c')]};};exports[_0x55f7('0x4e')]=function(_0xf24b93){return _0xf24b93[_0x55f7('0x4f')]+_0xf24b93[_0x55f7('0x50')]+_0xf24b93[_0x55f7('0x51')]+_0xf24b93[_0x55f7('0x52')]+_0xf24b93[_0x55f7('0x53')];};exports[_0x55f7('0x54')]=function(_0x46379c){var _0x3eefa4=_[_0x55f7('0x55')](_0x46379c);_0x3eefa4[_0x55f7('0x3a')]=0xf;_0x3eefa4[_0x55f7('0x3b')]=_0x55f7('0x56');return _0x3eefa4;};exports['scheduledAt']=function(_0xf1106e,_0x18da8b,_0x43a16b){var _0x183ab2={};_0x183ab2[_0x18da8b]=_0xf1106e[_0x18da8b];_0x183ab2[_0x55f7('0x57')]=![];_0x183ab2[_0x55f7('0x58')]=moment()[_0x55f7('0x59')](_0x43a16b,_0x55f7('0x5a'))['format'](_0x55f7('0x39'));_0x183ab2['ContactId']=_0xf1106e['ContactId'];_0x183ab2['ListId']=_0xf1106e[_0x55f7('0x5b')];_0x183ab2[_0x55f7('0x1d')]=_0xf1106e[_0x55f7('0x1d')]||undefined;return _0x183ab2;};exports[_0x55f7('0x5c')]=function(_0x463a48,_0x4e627b){if(!_[_0x55f7('0x17')](_0x463a48)){if(_0x463a48['pTalking']>0x0){_0x463a48['pTalking']-=0x1;}else{logger[_0x55f7('0xc')](_0x4e627b,_0x55f7('0x5d'));}}else{logger[_0x55f7('0xc')](_0x4e627b,_0x55f7('0x5e'));}};exports[_0x55f7('0x5f')]=function(_0x3657d8){if(_0x3657d8<=0x0){return!![];}return![];};function buildObj(_0x405944,_0x3414aa,_0x25b314){_0x405944[_0x55f7('0x60')]=_0x3414aa;_0x405944['name']=_0x405944[_0x55f7('0x61')];_0x405944[_0x55f7('0x62')]=_0x405944['channelAgent'];_0x405944[_0x55f7('0x63')]=_0x55f7('0x64');if(_0x25b314){_0x405944[_0x55f7('0x65')]=_0x25b314[_0x55f7('0x65')];}return _0x405944;}exports['buildObj']=buildObj;exports[_0x55f7('0x66')]=function(_0x5af3ab){var _0x1a0cfc={};_0x1a0cfc[_0x55f7('0x61')]=_0x5af3ab[_0x55f7('0x61')];_0x1a0cfc[_0x55f7('0x62')]=_0x5af3ab[_0x55f7('0x4d')];_0x1a0cfc[_0x55f7('0x4c')]=_0x5af3ab[_0x55f7('0x4c')];return _0x1a0cfc;};exports[_0x55f7('0x67')]=function(_0x49d82f){var _0x14fa6e=[];for(var _0x14a60e in _0x49d82f){if(_0x49d82f[_0x55f7('0x2c')](_0x14a60e)){if(!_[_0x55f7('0x17')](_0x49d82f[_0x14a60e])&&_0x49d82f[_0x14a60e][_0x55f7('0x3a')]===_0x55f7('0x68')&&_0x49d82f[_0x14a60e][_0x55f7('0x69')]===_0x55f7('0x6a')){_0x14fa6e[_0x55f7('0x6b')](_0x49d82f[_0x14a60e]['id']);}}}return _0x14fa6e;};exports[_0x55f7('0x6c')]=function(_0x145f87){var _0x95e72f=moment()['milliseconds'](0x0);var _0x1de71f=moment(_0x145f87)[_0x55f7('0x6d')](0x0);return _0x95e72f['diff'](_0x1de71f,_0x55f7('0x6e'));};exports[_0x55f7('0x6f')]=function(_0x2d2314){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2d2314[_0x55f7('0x70')],'ListId':_0x2d2314['ListId'],'VoiceQueueId':_0x2d2314['VoiceQueueId']||undefined,'CampaignId':_0x2d2314[_0x55f7('0x71')]||undefined};};exports['filterKey']=function(_0x53a1be){if(_0x53a1be==='uniqueid'||_0x53a1be===_0x55f7('0x72')||_0x53a1be===_0x55f7('0x61')||_0x53a1be===_0x55f7('0x73')||_0x53a1be===_0x55f7('0x74')||_0x53a1be===_0x55f7('0x75')||_0x53a1be===_0x55f7('0x42')||_0x53a1be===_0x55f7('0x4d')||_0x53a1be==='calleridname'||_0x53a1be===_0x55f7('0x57')||_0x53a1be==='calleridnum'||_0x53a1be==='scheduledat'||_0x53a1be===_0x55f7('0x4f')||_0x53a1be==='countcongestionretry'||_0x53a1be===_0x55f7('0x51')||_0x53a1be===_0x55f7('0x76')||_0x53a1be===_0x55f7('0x77')||_0x53a1be==='callbackuniqueid'||_0x53a1be===_0x55f7('0x78')||_0x53a1be==='recallme'||_0x53a1be===_0x55f7('0x70')||_0x53a1be===_0x55f7('0x5b')||_0x53a1be==='UserId'||_0x53a1be===_0x55f7('0x1d')||_0x53a1be===_0x55f7('0x79')||_0x53a1be===_0x55f7('0x7a')||_0x53a1be===_0x55f7('0x7b')||_0x53a1be===_0x55f7('0x7c')||_0x53a1be==='xmd-listid'||_0x53a1be===_0x55f7('0x7d')||_0x53a1be===_0x55f7('0x7e')||_0x53a1be===_0x55f7('0x7f')||_0x53a1be===_0x55f7('0x80')||_0x53a1be===_0x55f7('0x81')||_0x53a1be===_0x55f7('0x82')||_0x53a1be===_0x55f7('0x83')||_0x53a1be===_0x55f7('0x84')||_0x53a1be===_0x55f7('0x85')||_0x53a1be==='xmd-agi'||_0x53a1be===_0x55f7('0x86')||_0x53a1be===_0x55f7('0x87')||_0x53a1be==='rtpaudioqosjitter'||_0x53a1be===_0x55f7('0x88')||_0x53a1be===_0x55f7('0x89')||_0x53a1be===_0x55f7('0x8a')||_0x53a1be===_0x55f7('0x8b')||_0x53a1be===_0x55f7('0x8c')||_0x53a1be==='rtpaudioqos'||_0x53a1be==='rtpaudioqosbridged'||_0x53a1be===_0x55f7('0x8d')||_0x53a1be===_0x55f7('0x88')||_0x53a1be==='rtpaudioqosloss'||_0x53a1be===_0x55f7('0x8a')||_0x53a1be==='rtpaudioqosrtt'||_0x53a1be==='rtpaudioqosrttbridged'||_0x53a1be==='bridgepeer'||_0x53a1be===_0x55f7('0x8e')||_0x53a1be==='state'||_0x53a1be===_0x55f7('0x3b')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x5c929c,_0x5c51f3){var _0x1175e6,_0x1affeb,_0xf25f1f;if(_0x5c51f3<=0x0){_0x5c51f3=0x1;}_0x1175e6=new RegExp(_0x55f7('0x8f')+_0x5c51f3+'}$');_0x1affeb=Math['pow'](0xa,_0x5c51f3-0x1);_0xf25f1f=Math[_0x55f7('0x90')](0xa,_0x5c51f3)-0x1;return util['format']('%s',_['replace'](_0x5c929c,_0x1175e6,_[_0x55f7('0x91')](_0x1affeb,_0xf25f1f)));};exports['extractCalleridName']=function(_0x56b2ec){var _0x375196=_0x56b2ec['match'](/"(.*?)"/);return _0x375196?_0x375196[0x1]:_0x56b2ec;};exports[_0x55f7('0x92')]=function(_0x4c9706){var _0x390697=_0x4c9706[_0x55f7('0x93')](/<(.*?)>/);return _0x390697?_0x390697[0x1]:_0x4c9706;};function buildNoAnswerEventPayload(_0x133174,_0xb28ed0){var _0x19b194=buildObj(_0x133174,'noanswer');if(!_[_0x55f7('0x11')](_0xb28ed0['variables'])){Object[_0x55f7('0x94')](_0xb28ed0[_0x55f7('0x95')])['forEach'](function(_0x3113c8){_0x19b194[_0x3113c8[_0x55f7('0x96')]()]=_0xb28ed0['variables'][_0x3113c8];});}return _0x19b194;}exports[_0x55f7('0x97')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xbff6=['replace','match','extractCalleridNumber','toLowerCase','variables','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','error','inspect','logger','logger2','info','message','getCallerId','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','string','isActive','isNil','addVariables','Queue','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLower','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','getSeconds','logLookAgent','membername','UserId','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','channelAgent','calleridnum','from-sip','uniqueid','totalGlobal','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','queue','interface','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','createBody','filterKey','idContact','campaigntype','dialAnswer','active','callback','callbackat','sipcallid','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow'];(function(_0x83b514,_0x1a0cbe){var _0x250c0f=function(_0xcd8eb9){while(--_0xcd8eb9){_0x83b514['push'](_0x83b514['shift']());}};_0x250c0f(++_0x1a0cbe);}(_0xbff6,0x8e));var _0x6bff=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbff6[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x6bff('0x0'));var _=require(_0x6bff('0x1'));var moment=require(_0x6bff('0x2'));var logger=require(_0x6bff('0x3'))(_0x6bff('0x4'));var ipAgi=process[_0x6bff('0x5')][_0x6bff('0x6')]||_0x6bff('0x7');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x1c7864){return function(_0x1d814a){logger[_0x6bff('0x8')](_0x1c7864,util[_0x6bff('0x9')](_0x1d814a,{'showHidden':![],'depth':null}));};};exports[_0x6bff('0xa')]=function(_0x2267bb,_0x525250){logger['info'](_0x2267bb,util[_0x6bff('0x9')](_0x525250,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x2d6dcb,_0x2826c7){logger[_0x6bff('0x8')](_0x2d6dcb,util[_0x6bff('0x9')](_0x2826c7,{'showHidden':![],'depth':null}));};exports[_0x6bff('0xb')]=function(_0x564abd){return function(_0x14ec84){logger[_0x6bff('0xc')](_0x564abd,util[_0x6bff('0x9')](_0x14ec84,{'showHidden':![],'depth':null}));};};exports[_0x6bff('0xd')]=function(_0x6aa3b9,_0x55550a,_0x10a1fa){return{'message':_0x6aa3b9,'unlock':_0x55550a,'active':_0x10a1fa};};exports[_0x6bff('0xe')]=function(_0x145fa3,_0x25df88,_0x7c0006){if(!_['isUndefined'](_0x7c0006)&&'string'===typeof _0x7c0006&&!_[_0x6bff('0xf')](_0x7c0006)){if(!_[_0x6bff('0x10')](_0x25df88)&&'string'===typeof _0x25df88&&!_[_0x6bff('0xf')](_0x25df88)){return util[_0x6bff('0x11')](_0x6bff('0x12'),_0x25df88,_0x7c0006);}return util[_0x6bff('0x11')]('\x22%s\x22\x20<%s>',_0x7c0006,_0x7c0006);}if(!_[_0x6bff('0x10')](_0x145fa3)&&_0x6bff('0x13')===typeof _0x145fa3&&!_[_0x6bff('0xf')](_0x145fa3)){return _0x145fa3;}return'\x22\x22\x20<>';};exports[_0x6bff('0x14')]=function(_0x3f68ca){if(_[_0x6bff('0x15')](_0x3f68ca)){return![];}return _0x3f68ca;};exports[_0x6bff('0x16')]=function(_0x545057,_0x138544,_0x26d83a,_0x594037,_0x343900,_0x44e08e){var _0x25acbf={'XMD-QUEUE':_0x138544[_0x6bff('0x17')]?_0x138544['Queue']['name']:'','XMD-CALLERID':_0x594037,'XMD-CALLERID-PREVIEW':_0x44e08e?util[_0x6bff('0x11')](_0x6bff('0x12'),_0x44e08e[_0x6bff('0x18')],_0x44e08e['calleridnum']):_0x594037,'XMD-DIALID':_0x343900,'XMD-CONTACTID':_0x138544[_0x6bff('0x19')],'XMD-CDRTYPE':_0x6bff('0x1a'),'CALLERID(all)':_0x594037,'XMD-VOICEQUEUEID':_0x138544['VoiceQueueId'],'XMD-DIALCHANNEL':_0x26d83a,'XMD-DIALTIMEOUT':_0x545057[_0x6bff('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x6bff('0x11')](_0x6bff('0x1c'),_0x545057['dialQueueProject2']?'g':'',_[_0x6bff('0xf')](_0x545057[_0x6bff('0x1d')])?'':_0x6bff('0x1e')),'XMD-DIALURL':_0x545057[_0x6bff('0x1f')]||'','XMD-AGI':_0x545057[_0x6bff('0x20')]?util[_0x6bff('0x11')](_0x6bff('0x21'),ipAgi,_0x545057[_0x6bff('0x20')]):'NONE','XMD-AGIAFTER':_0x545057[_0x6bff('0x22')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x545057[_0x6bff('0x22')]):_0x6bff('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x44e08e?_0x44e08e[_0x6bff('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x44e08e?_0x44e08e[_0x6bff('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x545057[_0x6bff('0x1d')])){_0x25acbf[util['format']('%s',_0x6bff('0x26'))]=_0x545057[_0x6bff('0x1d')];_0x25acbf[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x343900;}if(_0x138544&&_0x138544[_0x6bff('0x27')]){for(var _0x1bc49b in _0x138544[_0x6bff('0x27')]){if(_0x138544[_0x6bff('0x27')][_0x6bff('0x28')](_0x1bc49b)){if(!_[_0x6bff('0x15')](_0x138544[_0x6bff('0x27')][_0x1bc49b])&&_0x1bc49b!=='id'&&_0x1bc49b!==_0x6bff('0x29')&&_0x1bc49b!==_0x6bff('0x2a')&&_0x1bc49b!==_0x6bff('0x2b')){_0x25acbf[util['format']('%s%s',_0x6bff('0x2c'),_[_0x6bff('0x2d')](_0x1bc49b))]=_0x138544['Contact'][_0x1bc49b];}}}}return _0x25acbf;};exports['toLowerVariables']=function(_0x47a215){var _0x48329d={};for(var _0xa6b0e1 in _0x47a215){if(_0x47a215[_0x6bff('0x28')](_0xa6b0e1)){_0x48329d[util[_0x6bff('0x11')]('%s',_[_0x6bff('0x2e')](_0xa6b0e1))]=_0x47a215[_0xa6b0e1];}}return{'variables':_0x48329d};};exports[_0x6bff('0x2f')]=function(_0xe114f4,_0x252d3d){if(!_[_0x6bff('0x15')](_0xe114f4)){if(_0xe114f4[_0x6bff('0x28')](_0x6bff('0x30'))){if(_0xe114f4['originated']>0x0){_0xe114f4['originated']-=0x1;}else{logger[_0x6bff('0x8')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x252d3d);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x252d3d);}};exports[_0x6bff('0x31')]=function(_0x34703b){var _0x38b8ec=moment()[_0x6bff('0x11')](_0x6bff('0x32'));_0x34703b[_0x6bff('0x33')]=0xd;_0x34703b[_0x6bff('0x34')]=_0x6bff('0x35');_0x34703b[_0x6bff('0x36')]=_0x38b8ec;_0x34703b[_0x6bff('0x37')]=_0x38b8ec;_0x34703b['endtime']=_0x38b8ec;};exports[_0x6bff('0x38')]=function(_0x2223f7,_0x393098,_0x2aec2b){var _0x334fa5=moment()[_0x6bff('0x11')](_0x6bff('0x32'));_0x2223f7[_0x6bff('0x33')]=_0x393098;_0x2223f7[_0x6bff('0x34')]=_0x2aec2b;_0x2223f7['responsetime']=_0x334fa5;_0x2223f7[_0x6bff('0x39')]=utils[_0x6bff('0x3a')](_0x2223f7[_0x6bff('0x37')],_0x2223f7[_0x6bff('0x36')]);};exports[_0x6bff('0x3b')]=function(_0x3a7cb1,_0x2f293d,_0x542078){_0x3a7cb1[_0x6bff('0x3c')]=_0x2f293d;_0x3a7cb1[_0x6bff('0x3d')]=_0x542078;};exports['logCustomer']=function(_0x5f1fa6,_0x8c5792,_0x196156){var _0x1c7921=moment()['format'](_0x6bff('0x32'));_0x5f1fa6[_0x6bff('0x33')]=_0x8c5792;_0x5f1fa6[_0x6bff('0x34')]=_0x196156;_0x5f1fa6[_0x6bff('0x37')]=_0x5f1fa6[_0x6bff('0x37')]?_0x5f1fa6[_0x6bff('0x37')]:_0x1c7921;_0x5f1fa6[_0x6bff('0x3e')]=_0x5f1fa6[_0x6bff('0x3e')]?_0x5f1fa6[_0x6bff('0x3e')]:_0x1c7921;_0x5f1fa6[_0x6bff('0x39')]=utils['getSeconds'](_0x5f1fa6['responsetime']||0x0,_0x5f1fa6[_0x6bff('0x36')]||0x0);_0x5f1fa6[_0x6bff('0x3f')]=_0x5f1fa6[_0x6bff('0x40')]?utils['getSeconds'](_0x5f1fa6['endtime'],_0x5f1fa6[_0x6bff('0x40')]):0x0;};exports[_0x6bff('0x41')]=function(_0x24692e){return _0x24692e===_0x6bff('0x42');};exports[_0x6bff('0x43')]=function(_0x9aefbe,_0x253f2f,_0x46a37c,_0xca6525,_0x179e09){var _0xa0c472=_0xca6525?_0x6bff('0x44'):_0x9aefbe[_0x6bff('0x18')];_0xa0c472=_0x179e09?'BOOKED':_0xa0c472;return{'actionid':_0x9aefbe['uniqueid'],'action':'originate','channel':_0x9aefbe[_0x6bff('0x45')],'callerid':util[_0x6bff('0x11')](_0x6bff('0x12'),_0xa0c472,_0x9aefbe[_0x6bff('0x46')]),'Exten':'xcally-motion-preview','Context':_0x6bff('0x47'),'Priority':'1','variable':_0x46a37c,'timeout':(_0x253f2f['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x9aefbe[_0x6bff('0x48')]};};exports[_0x6bff('0x49')]=function(_0x1e1a80){return _0x1e1a80['countbusyretry']+_0x1e1a80['countcongestionretry']+_0x1e1a80[_0x6bff('0x4a')]+_0x1e1a80[_0x6bff('0x4b')]+_0x1e1a80[_0x6bff('0x4c')];};exports[_0x6bff('0x4d')]=function(_0x59e1f6){var _0x2bb372=_[_0x6bff('0x4e')](_0x59e1f6);_0x2bb372[_0x6bff('0x33')]=0xf;_0x2bb372[_0x6bff('0x34')]=_0x6bff('0x4f');return _0x2bb372;};exports['scheduledAt']=function(_0x5cf8bc,_0x37392a,_0x506213){var _0x2f2cf3={};_0x2f2cf3[_0x37392a]=_0x5cf8bc[_0x37392a];_0x2f2cf3['active']=![];_0x2f2cf3[_0x6bff('0x50')]=moment()[_0x6bff('0x51')](_0x506213,_0x6bff('0x52'))['format'](_0x6bff('0x32'));_0x2f2cf3[_0x6bff('0x19')]=_0x5cf8bc[_0x6bff('0x19')];_0x2f2cf3['ListId']=_0x5cf8bc[_0x6bff('0x53')];_0x2f2cf3[_0x6bff('0x54')]=_0x5cf8bc[_0x6bff('0x54')]||undefined;return _0x2f2cf3;};exports[_0x6bff('0x55')]=function(_0x11c881,_0x598cc8){if(!_[_0x6bff('0x15')](_0x11c881)){if(_0x11c881[_0x6bff('0x56')]>0x0){_0x11c881['pTalking']-=0x1;}else{logger[_0x6bff('0x8')](_0x598cc8,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x6bff('0x8')](_0x598cc8,_0x6bff('0x57'));}};exports[_0x6bff('0x58')]=function(_0x3e50d4){if(_0x3e50d4<=0x0){return!![];}return![];};function buildObj(_0x54b35a,_0x39c793,_0x3694f1){_0x54b35a['lastevent']=_0x39c793;_0x54b35a[_0x6bff('0x59')]=_0x54b35a[_0x6bff('0x5a')];_0x54b35a[_0x6bff('0x5b')]=_0x54b35a[_0x6bff('0x45')];_0x54b35a['motionChannel']=_0x6bff('0x5c');if(_0x3694f1){_0x54b35a[_0x6bff('0x5d')]=_0x3694f1[_0x6bff('0x5d')];}return _0x54b35a;}exports['buildObj']=buildObj;exports['buildAcw']=function(_0x24cb94){var _0x9960b={};_0x9960b[_0x6bff('0x5a')]=_0x24cb94[_0x6bff('0x5a')];_0x9960b['interface']=_0x24cb94[_0x6bff('0x45')];_0x9960b[_0x6bff('0x48')]=_0x24cb94[_0x6bff('0x48')];return _0x9960b;};exports[_0x6bff('0x5e')]=function(_0x1149ed){var _0x4f21cf=[];for(var _0x5557be in _0x1149ed){if(_0x1149ed[_0x6bff('0x28')](_0x5557be)){if(!_['isNil'](_0x1149ed[_0x5557be])&&_0x1149ed[_0x5557be][_0x6bff('0x33')]===_0x6bff('0x5f')&&_0x1149ed[_0x5557be][_0x6bff('0x60')]===_0x6bff('0x61')){_0x4f21cf[_0x6bff('0x62')](_0x1149ed[_0x5557be]['id']);}}}return _0x4f21cf;};exports[_0x6bff('0x63')]=function(_0x3397e8){var _0x2d5d2b=moment()[_0x6bff('0x64')](0x0);var _0x5e235c=moment(_0x3397e8)[_0x6bff('0x64')](0x0);return _0x2d5d2b[_0x6bff('0x65')](_0x5e235c,'seconds');};exports[_0x6bff('0x66')]=function(_0x3e4067){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3e4067[_0x6bff('0x19')],'ListId':_0x3e4067['ListId'],'VoiceQueueId':_0x3e4067['VoiceQueueId']||undefined,'CampaignId':_0x3e4067['CampaignId']||undefined};};exports[_0x6bff('0x67')]=function(_0x14d664){if(_0x14d664===_0x6bff('0x48')||_0x14d664===_0x6bff('0x68')||_0x14d664==='queue'||_0x14d664==='type'||_0x14d664===_0x6bff('0x69')||_0x14d664===_0x6bff('0x6a')||_0x14d664===_0x6bff('0x3c')||_0x14d664===_0x6bff('0x45')||_0x14d664===_0x6bff('0x18')||_0x14d664===_0x6bff('0x6b')||_0x14d664===_0x6bff('0x46')||_0x14d664===_0x6bff('0x50')||_0x14d664==='countbusyretry'||_0x14d664==='countcongestionretry'||_0x14d664===_0x6bff('0x4a')||_0x14d664==='countglobal'||_0x14d664===_0x6bff('0x6c')||_0x14d664==='callbackuniqueid'||_0x14d664===_0x6bff('0x6d')||_0x14d664==='recallme'||_0x14d664===_0x6bff('0x19')||_0x14d664===_0x6bff('0x53')||_0x14d664===_0x6bff('0x3d')||_0x14d664==='VoiceQueueId'||_0x14d664===_0x6bff('0x6e')||_0x14d664==='xmd-voicequeueid'||_0x14d664==='xmd-queue'||_0x14d664==='xmd-phone'||_0x14d664===_0x6bff('0x6f')||_0x14d664==='xmd-dialurl'||_0x14d664===_0x6bff('0x70')||_0x14d664===_0x6bff('0x71')||_0x14d664===_0x6bff('0x72')||_0x14d664===_0x6bff('0x73')||_0x14d664===_0x6bff('0x74')||_0x14d664==='xmd-cdrtype'||_0x14d664===_0x6bff('0x75')||_0x14d664===_0x6bff('0x76')||_0x14d664===_0x6bff('0x77')||_0x14d664===_0x6bff('0x78')||_0x14d664==='rtpaudioqosbridged'||_0x14d664===_0x6bff('0x79')||_0x14d664===_0x6bff('0x7a')||_0x14d664===_0x6bff('0x7b')||_0x14d664===_0x6bff('0x7c')||_0x14d664===_0x6bff('0x7d')||_0x14d664===_0x6bff('0x7e')||_0x14d664==='rtpaudioqos'||_0x14d664==='rtpaudioqosbridged'||_0x14d664===_0x6bff('0x79')||_0x14d664===_0x6bff('0x7a')||_0x14d664===_0x6bff('0x7b')||_0x14d664===_0x6bff('0x7c')||_0x14d664==='rtpaudioqosrtt'||_0x14d664===_0x6bff('0x7e')||_0x14d664===_0x6bff('0x7f')||_0x14d664===_0x6bff('0x80')||_0x14d664===_0x6bff('0x33')||_0x14d664===_0x6bff('0x34')){return![];}return!![];};exports[_0x6bff('0x81')]=function(_0x259718,_0x94a91a){var _0xa15147,_0x43cd85,_0x51362b;if(_0x94a91a<=0x0){_0x94a91a=0x1;}_0xa15147=new RegExp(_0x6bff('0x82')+_0x94a91a+'}$');_0x43cd85=Math[_0x6bff('0x83')](0xa,_0x94a91a-0x1);_0x51362b=Math['pow'](0xa,_0x94a91a)-0x1;return util['format']('%s',_[_0x6bff('0x84')](_0x259718,_0xa15147,_['random'](_0x43cd85,_0x51362b)));};exports['extractCalleridName']=function(_0x1e793b){var _0x452fa5=_0x1e793b[_0x6bff('0x85')](/"(.*?)"/);return _0x452fa5?_0x452fa5[0x1]:_0x1e793b;};exports[_0x6bff('0x86')]=function(_0x941178){var _0x5488e5=_0x941178[_0x6bff('0x85')](/<(.*?)>/);return _0x5488e5?_0x5488e5[0x1]:_0x941178;};function buildNoAnswerEventPayload(_0xa6c68b,_0x4240d3){var _0x5d8afd=buildObj(_0xa6c68b,'noanswer');if(!_[_0x6bff('0xf')](_0x4240d3['variables'])){Object['keys'](_0x4240d3['variables'])['forEach'](function(_0x5e069b){_0x5d8afd[_0x5e069b[_0x6bff('0x87')]()]=_0x4240d3[_0x6bff('0x88')][_0x5e069b];});}return _0x5d8afd;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index cb06fba..889fb53 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ca2=['voicequeuechannelhangup','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x7ca2,0x1e1));var _0x27ca=function(_0x260264,_0x153e09){_0x260264=_0x260264-0x0;var _0x714674=_0x7ca2[_0x260264];return _0x714674;};'use strict';exports[_0x27ca('0x0')]={'queue':{'type':_0x27ca('0x1'),'required':!![]},'interface':{'type':_0x27ca('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x27ca('0x2'),'required':![]},'paused':{'type':_0x27ca('0x3'),'required':![]}};exports[_0x27ca('0x4')]={'queue':{'type':_0x27ca('0x1'),'required':!![]},'interface':{'type':_0x27ca('0x1'),'required':!![]}};exports[_0x27ca('0x5')]={'interface':{'type':_0x27ca('0x1'),'required':!![]},'paused':{'type':_0x27ca('0x3')},'reason':{'type':'string','required':![]}};exports[_0x27ca('0x6')]={'module':{'type':_0x27ca('0x1'),'required':![]}};exports[_0x27ca('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x27ca('0x8')]={'uniqueid':{'type':_0x27ca('0x1'),'required':!![]},'filename':{'type':_0x27ca('0x1')},'format':{'type':_0x27ca('0x1')},'mixmonitorid':{'type':_0x27ca('0x1')}};exports[_0x27ca('0x9')]={'uniqueid':{'type':_0x27ca('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x27ca('0x1'),'required':!![]},'context':{'type':_0x27ca('0x1')}}; \ No newline at end of file +var _0xeab3=['voicequeuechannelhangup','queueadd','string','boolean','queueremove','queuepause','voicequeuechannel','voicechannel'];(function(_0x247402,_0x269fc8){var _0x438ef9=function(_0x4ecd5e){while(--_0x4ecd5e){_0x247402['push'](_0x247402['shift']());}};_0x438ef9(++_0x269fc8);}(_0xeab3,0x121));var _0x3eab=function(_0x26299e,_0x394ad1){_0x26299e=_0x26299e-0x0;var _0x6c4f4a=_0xeab3[_0x26299e];return _0x6c4f4a;};'use strict';exports[_0x3eab('0x0')]={'queue':{'type':_0x3eab('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x3eab('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x3eab('0x2'),'required':![]}};exports[_0x3eab('0x3')]={'queue':{'type':_0x3eab('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x3eab('0x4')]={'interface':{'type':_0x3eab('0x1'),'required':!![]},'paused':{'type':_0x3eab('0x2')},'reason':{'type':_0x3eab('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x3eab('0x1'),'required':![]}};exports[_0x3eab('0x5')]={'uniqueid':{'type':_0x3eab('0x1'),'required':!![]}};exports[_0x3eab('0x6')]={'uniqueid':{'type':_0x3eab('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x3eab('0x1')},'mixmonitorid':{'type':_0x3eab('0x1')}};exports[_0x3eab('0x7')]={'uniqueid':{'type':_0x3eab('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x3eab('0x1'),'required':!![]},'exten':{'type':_0x3eab('0x1'),'required':!![]},'context':{'type':_0x3eab('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 3e003f6..8cdd144 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2032,0xd9));var _0x2203=function(_0x20760d,_0x1357b0){_0x20760d=_0x20760d-0x0;var _0x41b9b8=_0x2032[_0x20760d];return _0x41b9b8;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file +var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0xdc6179,_0x228c8d){var _0x3c24c4=function(_0x586212){while(--_0x586212){_0xdc6179['push'](_0xdc6179['shift']());}};_0x3c24c4(++_0x228c8d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ed50b,_0x176349){_0x5ed50b=_0x5ed50b-0x0;var _0x20ea2b=_0x5f2f[_0x5ed50b];return _0x20ea2b;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 5d28fb2..be9804a 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9f6=['assign','mergeDBDataToRealtime'];(function(_0x1c7a59,_0x4384d5){var _0x349e2c=function(_0x1e1ca7){while(--_0x1e1ca7){_0x1c7a59['push'](_0x1c7a59['shift']());}};_0x349e2c(++_0x4384d5);}(_0xe9f6,0x1e8));var _0x6e9f=function(_0x36c6e6,_0x263d4f){_0x36c6e6=_0x36c6e6-0x0;var _0x35e0c2=_0xe9f6[_0x36c6e6];return _0x35e0c2;};'use strict';function mergeDBDataToRealtime(_0x3dfcda,_0x397fb4){var _0x263635=Object[_0x6e9f('0x0')]({},_0x3dfcda);for(var _0x1ab8fa in _0x397fb4){if(_0x263635['hasOwnProperty'](_0x1ab8fa)){_0x263635[_0x1ab8fa]=_0x397fb4[_0x1ab8fa];}}return _0x263635;}exports[_0x6e9f('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x543d=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x327429,_0x3d2ccb){var _0x237393=function(_0x47be6b){while(--_0x47be6b){_0x327429['push'](_0x327429['shift']());}};_0x237393(++_0x3d2ccb);}(_0x543d,0x1e1));var _0xd543=function(_0x50f112,_0xd38e53){_0x50f112=_0x50f112-0x0;var _0x4ecf28=_0x543d[_0x50f112];return _0x4ecf28;};'use strict';function mergeDBDataToRealtime(_0x5c9a2a,_0x474766){var _0x3fd9c2=Object[_0xd543('0x0')]({},_0x5c9a2a);for(var _0x37432e in _0x474766){if(_0x3fd9c2[_0xd543('0x1')](_0x37432e)){_0x3fd9c2[_0x37432e]=_0x474766[_0x37432e];}}return _0x3fd9c2;}exports[_0xd543('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 7a5957a..43e293e 100644 --- a/server/services/ami/report/index.js +++ b/server/services/ami/report/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9db7=['length','connectedlinenum','accountcode','assigned','lastAssignedTo','isNil','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','getAgentByInternal','keys','split','internal','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','ANSWERED','callerid','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','getCallType','channel','UserId','membername','monitors','monitorFilename','createdAt','connectedlinename','originatecalleridnum','xcally-motion-dialer','isArray','voiceDialReport','startsWith','Local','substring','indexOf','phone','findAgent','transfererlinkedid','exports','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','find','name','interface','format'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9db7,0x96));var _0x79db=function(_0x4d76a6,_0x3517dc){_0x4d76a6=_0x4d76a6-0x0;var _0x1a7e9c=_0x9db7[_0x4d76a6];return _0x1a7e9c;};'use strict';var _=require('lodash');var moment=require(_0x79db('0x0'));var util=require(_0x79db('0x1'));var config=require('../../../config/environment');var ami=require(_0x79db('0x2'));var RpcVoiceAgentReport=require(_0x79db('0x3'));var RpcVoiceCallReport=require(_0x79db('0x4'));var RpcVoiceDialReport=require(_0x79db('0x5'));var RpcMemberReport=require(_0x79db('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x79db('0x7'));var RpcVoiceTransferReport=require(_0x79db('0x8'));var VoiceQueueReport=require(_0x79db('0x9'));var VoiceCallReport=require(_0x79db('0xa'));var VoiceAgentReport=require(_0x79db('0xb'));var VoiceDialReport=require(_0x79db('0xc'));var UserReport=require(_0x79db('0xd'));function Report(_0x553561){this[_0x79db('0xe')]=_0x553561;this[_0x79db('0xf')]=_0x553561[_0x79db('0xf')];this[_0x79db('0x10')]=_0x553561[_0x79db('0x10')];}Report[_0x79db('0x11')]['sync']=function(_0x1fd735){var _0x4a0654=new VoiceQueueReport(this[_0x79db('0xe')]);var _0x205b48=new VoiceAgentReport(this[_0x79db('0xe')]);var _0x415759=new VoiceDialReport(this['realtime']);var _0xdc2e0c=new VoiceCallReport(this[_0x79db('0xe')]);var _0x3a010a=new UserReport(this[_0x79db('0xe')]);if(config['xdr']&&config[_0x79db('0x12')][_0x79db('0x13')]){ami['on'](_0x79db('0x14'),this[_0x79db('0x15')][_0x79db('0x16')](this));ami['on'](_0x79db('0x17'),this[_0x79db('0x18')]['bind'](this));ami['on'](_0x79db('0x19'),this['voiceAgentReport'][_0x79db('0x16')](this));ami['on'](_0x79db('0x1a'),this['voiceDialReport'][_0x79db('0x16')](this));ami['on'](_0x79db('0x1b'),this[_0x79db('0x1c')][_0x79db('0x16')](this));ami['on']('attendedtransfer',this[_0x79db('0x1d')][_0x79db('0x16')](this));}};Report[_0x79db('0x11')]['findAgent']=function(_0x2772ae){var _0x3a0426;_0x3a0426=_[_0x79db('0x1e')](this['agents'],function(_0x1c3a8c){return _0x1c3a8c['accountcode']==_0x2772ae||_0x1c3a8c[_0x79db('0x1f')]==_0x2772ae;});if(_['isNil'](_0x3a0426)){var _0x46bc41=_[_0x79db('0x1e')](this['telephones'],function(_0x2e184b){return _0x2e184b['accountcode']==_0x2772ae||_0x2e184b['name']==_0x2772ae;});if(_0x46bc41){_0x3a0426=_[_0x79db('0x1e')](this[_0x79db('0xf')],function(_0x4ead31){return _0x4ead31[_0x79db('0x20')]==util[_0x79db('0x21')]('SIP/%s',_0x46bc41[_0x79db('0x1f')]);});}}return _0x3a0426;};Report[_0x79db('0x11')][_0x79db('0x15')]=function(_0x5a62d1){for(var _0x1c7a8b=0x0;_0x1c7a8b<_0x5a62d1[_0x79db('0x22')];_0x1c7a8b+=0x1){var _0x4568cd=this['findAgent'](_0x5a62d1[_0x1c7a8b][_0x79db('0x23')]);if(_0x4568cd){_0x5a62d1[_0x1c7a8b][_0x79db('0x24')]=_0x4568cd[_0x79db('0x24')];_0x5a62d1[_0x1c7a8b][_0x79db('0x25')]=!![];_0x5a62d1[_0x1c7a8b][_0x79db('0x26')]=_0x4568cd['name'];_0x5a62d1[_0x1c7a8b]['interface']=_[_0x79db('0x27')](_0x4568cd['interface'])?util[_0x79db('0x21')](_0x79db('0x28'),_0x4568cd['name']):_0x4568cd[_0x79db('0x20')];if(_0x5a62d1[_0x1c7a8b][_0x79db('0x29')]){_0x5a62d1[_0x1c7a8b][_0x79db('0x2a')]=moment()[_0x79db('0x21')](_0x79db('0x2b'));}if(_0x5a62d1[_0x1c7a8b]['queuecallerexit']){_0x5a62d1[_0x1c7a8b][_0x79db('0x2c')]=moment()['format'](_0x79db('0x2b'));}RpcMemberReport[_0x79db('0x15')](_0x5a62d1[_0x1c7a8b]);}RpcVoiceQueueReport[_0x79db('0x2d')](_0x5a62d1[_0x1c7a8b]);}};function extractCalleridNumber(_0x177a97){var _0x8475cc=_0x177a97[_0x79db('0x2e')](/<(.*?)>/);return _0x8475cc?_0x8475cc[0x1]:_0x177a97;}Report[_0x79db('0x11')][_0x79db('0x2f')]=function(_0xfbc875){for(var _0x13ad88=0x0;_0x13ad88','calleridname','transfers','transfereelinkedid','uniqueid','linkedid','UserId','membername','monitor','length','monitorFilename','monitors','filename','createdAt','connectedlinename','originatecalleridnum','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','lastIndexOf','transfererlinkedid','exports','lodash','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','isNil','format','SIP/%s','name','connectedlinenum','assigned','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','prototype','getAgentByInternal','keys','getCallType','split','agents','calleridnum','outbound','destination','exten','type','dialer','lastapplication','queue','lastdata'];(function(_0x452c04,_0x38217a){var _0x40225f=function(_0x1b6532){while(--_0x1b6532){_0x452c04['push'](_0x452c04['shift']());}};_0x40225f(++_0x38217a);}(_0x5833,0x141));var _0x3583=function(_0xab2284,_0x40eb02){_0xab2284=_0xab2284-0x0;var _0xc19888=_0x5833[_0xab2284];return _0xc19888;};'use strict';var _=require(_0x3583('0x0'));var moment=require('moment');var util=require(_0x3583('0x1'));var config=require(_0x3583('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x3583('0x3'));var RpcVoiceCallReport=require(_0x3583('0x4'));var RpcVoiceDialReport=require(_0x3583('0x5'));var RpcMemberReport=require(_0x3583('0x6'));var RpcVoiceQueueReport=require(_0x3583('0x7'));var RpcVoiceRecording=require(_0x3583('0x8'));var RpcVoiceTransferReport=require(_0x3583('0x9'));var VoiceQueueReport=require(_0x3583('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x3583('0xb'));var VoiceDialReport=require(_0x3583('0xc'));var UserReport=require(_0x3583('0xd'));function Report(_0x143b8b){this[_0x3583('0xe')]=_0x143b8b;this['agents']=_0x143b8b['agents'];this['telephones']=_0x143b8b[_0x3583('0xf')];}Report['prototype'][_0x3583('0x10')]=function(_0x1b1f5c){var _0x5e4dc6=new VoiceQueueReport(this[_0x3583('0xe')]);var _0x38c51c=new VoiceAgentReport(this[_0x3583('0xe')]);var _0x4200f4=new VoiceDialReport(this['realtime']);var _0x38b672=new VoiceCallReport(this[_0x3583('0xe')]);var _0x48c052=new UserReport(this['realtime']);if(config[_0x3583('0x11')]&&config['xdr']['disabled']){ami['on'](_0x3583('0x12'),this[_0x3583('0x13')][_0x3583('0x14')](this));ami['on'](_0x3583('0x15'),this[_0x3583('0x16')]['bind'](this));ami['on'](_0x3583('0x17'),this[_0x3583('0x18')][_0x3583('0x14')](this));ami['on'](_0x3583('0x19'),this['voiceDialReport'][_0x3583('0x14')](this));ami['on'](_0x3583('0x1a'),this[_0x3583('0x1b')]['bind'](this));ami['on']('attendedtransfer',this[_0x3583('0x1c')][_0x3583('0x14')](this));}};Report['prototype'][_0x3583('0x1d')]=function(_0x54b148){var _0xaf9eac;_0xaf9eac=_[_0x3583('0x1e')](this['agents'],function(_0x1a13dd){return _0x1a13dd[_0x3583('0x1f')]==_0x54b148||_0x1a13dd['name']==_0x54b148;});if(_[_0x3583('0x20')](_0xaf9eac)){var _0x51d7a3=_[_0x3583('0x1e')](this['telephones'],function(_0x2b358f){return _0x2b358f[_0x3583('0x1f')]==_0x54b148||_0x2b358f['name']==_0x54b148;});if(_0x51d7a3){_0xaf9eac=_[_0x3583('0x1e')](this['agents'],function(_0x2edb2b){return _0x2edb2b['interface']==util[_0x3583('0x21')](_0x3583('0x22'),_0x51d7a3[_0x3583('0x23')]);});}}return _0xaf9eac;};Report['prototype'][_0x3583('0x13')]=function(_0x4e2bfb){for(var _0x5ccf72=0x0;_0x5ccf72<_0x4e2bfb['length'];_0x5ccf72+=0x1){var _0x3598ba=this[_0x3583('0x1d')](_0x4e2bfb[_0x5ccf72][_0x3583('0x24')]);if(_0x3598ba){_0x4e2bfb[_0x5ccf72][_0x3583('0x1f')]=_0x3598ba[_0x3583('0x1f')];_0x4e2bfb[_0x5ccf72][_0x3583('0x25')]=!![];_0x4e2bfb[_0x5ccf72]['lastAssignedTo']=_0x3598ba[_0x3583('0x23')];_0x4e2bfb[_0x5ccf72][_0x3583('0x26')]=_[_0x3583('0x20')](_0x3598ba['interface'])?util[_0x3583('0x21')](_0x3583('0x22'),_0x3598ba[_0x3583('0x23')]):_0x3598ba[_0x3583('0x26')];if(_0x4e2bfb[_0x5ccf72]['queuecallercomplete']){_0x4e2bfb[_0x5ccf72][_0x3583('0x27')]=moment()[_0x3583('0x21')](_0x3583('0x28'));}if(_0x4e2bfb[_0x5ccf72][_0x3583('0x29')]){_0x4e2bfb[_0x5ccf72]['queuecallerexitAt']=moment()[_0x3583('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x3583('0x13')](_0x4e2bfb[_0x5ccf72]);}RpcVoiceQueueReport[_0x3583('0x2a')](_0x4e2bfb[_0x5ccf72]);}};function extractCalleridNumber(_0x1d861f){var _0x52a9f6=_0x1d861f[_0x3583('0x2b')](/<(.*?)>/);return _0x52a9f6?_0x52a9f6[0x1]:_0x1d861f;}Report[_0x3583('0x2c')][_0x3583('0x2d')]=function(_0x20c5b2){for(var _0x34ba59=0x0;_0x34ba590x0?!![]:![];if(!_0x5cb3d){return this['syncQueueSummaryComplete'](this[_0x7a91('0x14')][_0x7a91('0x67')]);}};VoiceQueueReport[_0x7a91('0xb')][_0x7a91('0x1c')]=function(_0x9606d){var _0x3cb1a3=this[_0x7a91('0x14')]['id'];if(this['summary'][_0x7a91('0x5d')][_0x3cb1a3]&&this[_0x7a91('0x14')][_0x7a91('0x5d')][_0x3cb1a3][_0x9606d['actionid']]){this[_0x7a91('0x14')][_0x7a91('0x5d')][_0x3cb1a3][_0x9606d['actionid']][_0x7a91('0xf')][_0x7a91('0x68')](_0x9606d);}};VoiceQueueReport[_0x7a91('0xb')][_0x7a91('0x17')]=function(_0xeb5c84){var _0x28f0e5=this;try{if(this['isNotNull'](_0xeb5c84)&&this[_0x7a91('0x55')](_0xeb5c84[_0x7a91('0x4c')])){logger[_0x7a91('0x4f')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x7a91('0x3f')](_0xeb5c84,{'showHidden':![],'depth':null}));var _0x206a9b=this['voiceQueues'][_0xeb5c84['queue']];if(_0x206a9b){logger[_0x7a91('0x69')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x206a9b[_0x7a91('0x54')]);this[_0x7a91('0x14')][_0x7a91('0x58')][_0x206a9b[_0x7a91('0x54')]]={'summaryEvent':_0xeb5c84};this['summary'][_0x7a91('0x66')]+=0x1;return ami[_0x7a91('0x57')]({'action':'queuestatus','queue':_0x206a9b[_0x7a91('0x54')]})[_0x7a91('0x5a')](function(_0x508e0a){if(!_0x28f0e5[_0x7a91('0x14')]['queuestatus'][_0xeb5c84['actionid']]){_0x28f0e5[_0x7a91('0x14')][_0x7a91('0x5d')][_0xeb5c84['actionid']]={};}_0x28f0e5[_0x7a91('0x14')][_0x7a91('0x5d')][_0xeb5c84[_0x7a91('0x5b')]][_0x508e0a[_0x7a91('0x5b')]]={'queue':_0x206a9b[_0x7a91('0x54')],'agents':[]};})[_0x7a91('0x3a')](function(_0x1c49f4){throw _0x1c49f4;});}}}catch(_0x161987){logger[_0x7a91('0x3d')](_0x7a91('0x6a'),util[_0x7a91('0x3f')](_0x161987,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a91('0x1a')]=function(_0x4df559){if(this[_0x7a91('0x14')][_0x7a91('0x66')]>0x0){this[_0x7a91('0x14')][_0x7a91('0x67')]=_0x4df559;return;}logger[_0x7a91('0x4f')](_0x7a91('0x6b'),util[_0x7a91('0x3f')](_0x4df559,{'showHidden':![],'depth':null}));this[_0x7a91('0x14')]=initializeSummary();ami[_0x7a91('0x47')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x7a91('0xb')]['syncQueueCallerJoin']=function(_0x584644){try{if(this[_0x7a91('0x55')](_0x584644)){logger['debug'](_0x7a91('0x6c'),_0x584644[_0x7a91('0x49')],util[_0x7a91('0x3f')](_0x584644,{'showHidden':![],'depth':null}));if(_[_0x7a91('0x56')](this[_0x7a91('0x40')][_0x584644[_0x7a91('0x49')]])){this[_0x7a91('0x40')][_0x584644[_0x7a91('0x49')]]=[];}if(_['isUndefined'](this[_0x7a91('0x10')][_0x584644[_0x7a91('0x49')]])){this[_0x7a91('0x10')][_0x584644[_0x7a91('0x49')]]={};}var _0x34e00f=new QueueReport();_0x34e00f[_0x7a91('0x4c')]=_0x584644[_0x7a91('0x4c')];_0x34e00f[_0x7a91('0x63')]=this[_0x7a91('0x12')][_0x34e00f[_0x7a91('0x4c')]]&&this[_0x7a91('0x12')][_0x34e00f['queue']][_0x7a91('0x63')]?this[_0x7a91('0x12')][_0x34e00f[_0x7a91('0x4c')]][_0x7a91('0x63')]||_0x7a91('0x6d'):_0x7a91('0x6d');_0x34e00f['queuecallerjoinAt']=moment()[_0x7a91('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x34e00f['position']=_0x584644[_0x7a91('0x6e')];_0x34e00f[_0x7a91('0x6f')]=_0x584644[_0x7a91('0x6f')];_0x34e00f[_0x7a91('0x49')]=_0x584644['uniqueid'];_0x34e00f[_0x7a91('0x70')]=this[_0x7a91('0x10')][_0x584644[_0x7a91('0x49')]]['routealias'];logger[_0x7a91('0x69')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x34e00f[_0x7a91('0x4c')],_0x34e00f['type']);_[_0x7a91('0x71')](_0x34e00f,_[_0x7a91('0x72')](_0x584644,_['keys'](_0x34e00f)));this[_0x7a91('0x40')][_0x584644['uniqueid']]['push'](_0x34e00f);this[_0x7a91('0x10')][_0x584644[_0x7a91('0x49')]]=_0x34e00f;this[_0x7a91('0x73')](_0x34e00f,_0x7a91('0x1e'));}}catch(_0xea62a3){logger[_0x7a91('0x3d')]('[%s][voiceQueueReport][queuecallerjoin]',_0x584644[_0x7a91('0x49')],util['inspect'](_0xea62a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a91('0xb')][_0x7a91('0x20')]=function(_0xb7ae88){try{if(this[_0x7a91('0x55')](_0xb7ae88)){logger[_0x7a91('0x4f')]('[%s][voiceQueueReport][queuecallerabandon]',_0xb7ae88['uniqueid'],util[_0x7a91('0x3f')](_0xb7ae88,{'showHidden':![],'depth':null}));if(this[_0x7a91('0x40')][_0xb7ae88['uniqueid']]){var _0x21ddd4=_[_0x7a91('0x74')](this[_0x7a91('0x40')][_0xb7ae88[_0x7a91('0x49')]]);_0x21ddd4[_0x7a91('0x75')]=![];_0x21ddd4[_0x7a91('0x76')]=null;_0x21ddd4['holdtime']=_0xb7ae88['holdtime'];_0x21ddd4[_0x7a91('0x77')]=_0xb7ae88[_0x7a91('0x77')];_0x21ddd4['queuecallerabandon']=!![];_0x21ddd4[_0x7a91('0x78')]=moment()[_0x7a91('0x4a')](_0x7a91('0x79'));_0x21ddd4[_0x7a91('0x50')]=_0x7a91('0x7a');_0x21ddd4['lastAssignedTo']=null;logger[_0x7a91('0x69')](_0x7a91('0x7b'),_0x21ddd4[_0x7a91('0x4c')],_0x21ddd4[_0x7a91('0x63')]);this['channels'][_0xb7ae88[_0x7a91('0x49')]]=_0x21ddd4;this['emitVoiceQueueChannelRemove'](_0x21ddd4,'queuecallerabandon');}}}catch(_0x2337bc){logger[_0x7a91('0x3d')](_0x7a91('0x7c'),_0xb7ae88[_0x7a91('0x49')],util[_0x7a91('0x3f')](_0x2337bc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a91('0xb')][_0x7a91('0x22')]=function(_0x4a601){try{if(this[_0x7a91('0x55')](_0x4a601)){logger['debug'](_0x7a91('0x7d'),_0x4a601['uniqueid'],util['inspect'](_0x4a601,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4a601[_0x7a91('0x49')]]){var _0x3c64d9=_[_0x7a91('0x74')](this[_0x7a91('0x40')][_0x4a601[_0x7a91('0x49')]]);_0x3c64d9[_0x7a91('0x7e')]=moment()['format'](_0x7a91('0x79'));_0x3c64d9[_0x7a91('0x7f')]=_0x4a601[_0x7a91('0x7f')];_0x3c64d9[_0x7a91('0x80')]=_0x4a601[_0x7a91('0x80')];logger['info'](_0x7a91('0x81'),_0x3c64d9[_0x7a91('0x4c')],_0x3c64d9[_0x7a91('0x63')],_0x4a601[_0x7a91('0x7f')],_0x4a601[_0x7a91('0x80')]);this[_0x7a91('0x10')][_0x4a601['uniqueid']]=_0x3c64d9;this['emitVoiceQueueChannelSave'](_0x3c64d9,_0x7a91('0x21'));}}}catch(_0x20a743){logger[_0x7a91('0x3d')](_0x7a91('0x7d'),_0x4a601[_0x7a91('0x49')],util[_0x7a91('0x3f')](_0x20a743,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a91('0x26')]=function(_0x224fd6){try{if(this[_0x7a91('0x55')](_0x224fd6)){logger[_0x7a91('0x4f')]('[%s][voiceQueueReport][agentconnect]',_0x224fd6[_0x7a91('0x49')],util[_0x7a91('0x3f')](_0x224fd6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x224fd6[_0x7a91('0x49')]]){var _0x16159c=_['last'](this[_0x7a91('0x40')][_0x224fd6['uniqueid']]);_0x16159c[_0x7a91('0x75')]=!![];_0x16159c[_0x7a91('0x50')]='COMPLETEDBYAGENT';logger[_0x7a91('0x69')](_0x7a91('0x82'),_0x16159c[_0x7a91('0x4c')],_0x16159c[_0x7a91('0x63')]);}}}catch(_0x5e903a){logger[_0x7a91('0x3d')](_0x7a91('0x83'),_0x224fd6[_0x7a91('0x49')],util['inspect'](_0x5e903a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a91('0xb')][_0x7a91('0x24')]=function(_0x215f6f){try{if(this[_0x7a91('0x55')](_0x215f6f)){logger['debug'](_0x7a91('0x84'),_0x215f6f[_0x7a91('0x49')],util[_0x7a91('0x3f')](_0x215f6f,{'showHidden':![],'depth':null}));if(this[_0x7a91('0x40')][_0x215f6f[_0x7a91('0x49')]]){var _0xb9b6fd=_['last'](this[_0x7a91('0x40')][_0x215f6f[_0x7a91('0x49')]]);_0xb9b6fd[_0x7a91('0x1f')]=![];_0xb9b6fd['queuecallerabandonAt']=null;_0xb9b6fd[_0x7a91('0x85')]=!![];_0xb9b6fd[_0x7a91('0x86')]=_0x215f6f['membername'];_0xb9b6fd[_0x7a91('0x87')]=_0x215f6f[_0x7a91('0x87')];_0xb9b6fd[_0x7a91('0x75')]=!![];_0xb9b6fd[_0x7a91('0x88')]=![];_0xb9b6fd[_0x7a91('0x89')]=null;if(!_0xb9b6fd[_0x7a91('0x8a')]){if(_0x215f6f[_0x7a91('0x8b')]==_0x7a91('0x8a')){_0xb9b6fd[_0x7a91('0x50')]=_0x7a91('0x8c');logger[_0x7a91('0x69')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0xb9b6fd[_0x7a91('0x4c')],_0xb9b6fd[_0x7a91('0x63')]);}else{if(_['startsWith'](_0x215f6f['channel']['toLowerCase'](),_0x7a91('0x8d'))){if(this[_0x7a91('0x40')][_0x215f6f[_0x7a91('0x8e')]]){var _0x2dbe53=_[_0x7a91('0x74')](this[_0x7a91('0x40')][_0x215f6f[_0x7a91('0x8e')]]);_0x2dbe53['queuecallercomplete']=![];_0x2dbe53[_0x7a91('0x88')]=!![];_0x2dbe53[_0x7a91('0x89')]=moment(_0xb9b6fd[_0x7a91('0x8f')])[_0x7a91('0x90')](_0x215f6f['holdtime'],_0x7a91('0x91'))[_0x7a91('0x4a')](_0x7a91('0x79'));_0x2dbe53[_0x7a91('0x50')]='FORWARDTRANSFER';_0x2dbe53[_0x7a91('0x8a')]=!![];_0x2dbe53['transfertype']='FORWARD';_0x2dbe53['transferexten']=_0x215f6f[_0x7a91('0x92')];_0x2dbe53[_0x7a91('0x93')]=_0x215f6f[_0x7a91('0x49')];logger[_0x7a91('0x69')](_0x7a91('0x94'),_0x2dbe53[_0x7a91('0x4c')],_0x2dbe53['type']);var _0xda0b8a=this['queueReports'][_0x215f6f[_0x7a91('0x8e')]];this['queueReports'][_0x215f6f[_0x7a91('0x8e')]]=this[_0x7a91('0x40')][_0x215f6f[_0x7a91('0x49')]];this['queueReports'][_0x215f6f[_0x7a91('0x49')]]=_0xda0b8a;}}else{_0xb9b6fd[_0x7a91('0x50')]=_0x7a91('0x95')+_0x215f6f['reason'][_0x7a91('0x96')]();logger[_0x7a91('0x69')](_0x7a91('0x97'),_0xb9b6fd[_0x7a91('0x4c')],_0xb9b6fd[_0x7a91('0x63')],_0xb9b6fd[_0x7a91('0x50')]);}}}this[_0x7a91('0x10')][_0x215f6f[_0x7a91('0x49')]]=_0xb9b6fd;this['emitVoiceQueueChannelRemove'](_0xb9b6fd,_0x7a91('0x23'));}}}catch(_0x3ef2c1){logger[_0x7a91('0x3d')](_0x7a91('0x84'),_0x215f6f['uniqueid'],util[_0x7a91('0x3f')](_0x3ef2c1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a91('0x28')]=function(_0x243efe){try{if(this['isNotNull'](_0x243efe)){logger['debug'](_0x7a91('0x98'),_0x243efe['uniqueid'],util['inspect'](_0x243efe,{'showHidden':![],'depth':null}));this[_0x7a91('0x99')](_0x243efe[_0x7a91('0x49')],_[_0x7a91('0x9a')](_0x243efe[_0x7a91('0x9b')])[0x0],_0x243efe[_0x7a91('0x9c')]);if(this[_0x7a91('0x40')][_0x243efe[_0x7a91('0x49')]]){var _0x1ef69c=_['last'](this['queueReports'][_0x243efe[_0x7a91('0x49')]]);if(_0x1ef69c){if(this[_0x7a91('0x55')](_0x243efe[_0x7a91('0x9b')])&&this[_0x7a91('0x55')](_0x243efe[_0x7a91('0x9b')][_0x7a91('0x5d')])){switch(_0x243efe[_0x7a91('0x9c')]){case _0x7a91('0x9d'):_0x1ef69c[_0x7a91('0x88')]=![];_0x1ef69c['queuecallerexitAt']=null;break;case _0x7a91('0x9e'):_0x1ef69c[_0x7a91('0x9f')]=_0x7a91('0xa0');_0x1ef69c[_0x7a91('0x88')]=!![];_0x1ef69c[_0x7a91('0x89')]=moment()[_0x7a91('0x4a')](_0x7a91('0x79'));_0x1ef69c[_0x7a91('0x7e')]=moment()['format'](_0x7a91('0x79'));logger[_0x7a91('0x4f')](_0x7a91('0xa1'),_0x243efe['uniqueid'],util['inspect'](_0x1ef69c,{'showHidden':![],'depth':null}));ami[_0x7a91('0x47')]('custom:timeout',_0x1ef69c);break;default:_0x1ef69c['queuecallerexit']=!![];_0x1ef69c[_0x7a91('0x89')]=moment()[_0x7a91('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1ef69c['queuecallerleaveAt']=moment()[_0x7a91('0x4a')](_0x7a91('0x79'));}_0x1ef69c[_0x7a91('0x1f')]=![];_0x1ef69c[_0x7a91('0x78')]=null;_0x1ef69c[_0x7a91('0x50')]=_0x243efe['value'];this[_0x7a91('0x10')][_0x243efe[_0x7a91('0x49')]]=_0x1ef69c;this[_0x7a91('0x45')](_0x1ef69c,_0x7a91('0x27'));}else if(this[_0x7a91('0x55')](_0x243efe[_0x7a91('0x9b')])&&this[_0x7a91('0x55')](_0x243efe['variable'][_0x7a91('0xa2')])){if(!_0x1ef69c[_0x7a91('0x1f')]){_0x1ef69c['queuecallerexit']=!![];_0x1ef69c['queuecallerexitAt']=moment()[_0x7a91('0x4a')](_0x7a91('0x79'));_0x1ef69c[_0x7a91('0x50')]=_0x7a91('0xa3');_0x1ef69c[_0x7a91('0x7e')]=moment()['format'](_0x7a91('0x79'));this[_0x7a91('0x10')][_0x243efe[_0x7a91('0x49')]]=_0x1ef69c;}}logger['info'](_0x7a91('0xa4'),_0x243efe[_0x7a91('0x49')],_0x1ef69c[_0x7a91('0x4c')],_0x1ef69c[_0x7a91('0x63')],_[_0x7a91('0x9a')](_0x243efe['variable'])[0x0],_0x243efe[_0x7a91('0x9c')]);_0x1ef69c['variables']=this[_0x7a91('0x15')][_0x243efe[_0x7a91('0x49')]];}}}}catch(_0x44bb8f){logger[_0x7a91('0x3d')](_0x7a91('0x98'),_0x243efe[_0x7a91('0x49')],util[_0x7a91('0x3f')](_0x44bb8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a91('0x99')]=function(_0x50d4c4,_0x389218,_0x25f88a){var _0x36afa9=[_0x7a91('0xa5'),_0x7a91('0xa6'),_0x7a91('0xa7'),_0x7a91('0xa8'),_0x7a91('0xa9'),_0x7a91('0xaa'),_0x7a91('0xab'),_0x7a91('0xac'),'sipcallid',_0x7a91('0xad'),_0x7a91('0xae'),_0x7a91('0xaf'),_0x7a91('0xb0'),_0x7a91('0xb1'),_0x7a91('0xb2'),_0x7a91('0xb3'),_0x7a91('0xb4'),_0x7a91('0xb5'),_0x7a91('0xb6')];if(!_[_0x7a91('0xb7')](_0x389218)&&!_[_0x7a91('0xb8')](_0x36afa9,_0x389218)){if(_['isUndefined'](this[_0x7a91('0x15')][_0x50d4c4])){this[_0x7a91('0x15')][_0x50d4c4]={};}this[_0x7a91('0x15')][_0x50d4c4][_0x389218]=_0x25f88a;}};VoiceQueueReport[_0x7a91('0xb')][_0x7a91('0xb9')]=function(_0x347029,_0x317f75,_0x1fb157){var _0x41e424={};for(var _0x73c016=0x0;_0x73c0160x0?!![]:![];if(!_0x53abaf){return this[_0x7a04('0x6b')](this['summary']['completeEvent']);}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0x1a')]=function(_0x4b1cf1){var _0x23fc67=this['summary']['id'];if(this[_0x7a04('0x14')][_0x7a04('0x64')][_0x23fc67]&&this[_0x7a04('0x14')][_0x7a04('0x64')][_0x23fc67][_0x4b1cf1['actionid']]){this[_0x7a04('0x14')]['queuestatus'][_0x23fc67][_0x4b1cf1['actionid']]['agents'][_0x7a04('0x6c')](_0x4b1cf1);}};VoiceQueueReport[_0x7a04('0x37')]['syncQueueSummary']=function(_0x1c6798){var _0x214889=this;try{if(this[_0x7a04('0x56')](_0x1c6798)&&this[_0x7a04('0x56')](_0x1c6798[_0x7a04('0x4c')])){logger[_0x7a04('0x48')](_0x7a04('0x6d'),util[_0x7a04('0x40')](_0x1c6798,{'showHidden':![],'depth':null}));var _0x52ccca=this[_0x7a04('0x65')][_0x1c6798[_0x7a04('0x4c')]];if(_0x52ccca){logger[_0x7a04('0x6e')](_0x7a04('0x6f'),_0x52ccca['name']);this[_0x7a04('0x14')][_0x7a04('0x5a')][_0x52ccca['name']]={'summaryEvent':_0x1c6798};this[_0x7a04('0x14')][_0x7a04('0x6a')]+=0x1;return ami[_0x7a04('0x59')]({'action':_0x7a04('0x64'),'queue':_0x52ccca[_0x7a04('0x70')]})[_0x7a04('0x71')](function(_0x180502){if(!_0x214889[_0x7a04('0x14')][_0x7a04('0x64')][_0x1c6798[_0x7a04('0x5d')]]){_0x214889[_0x7a04('0x14')][_0x7a04('0x64')][_0x1c6798[_0x7a04('0x5d')]]={};}_0x214889[_0x7a04('0x14')][_0x7a04('0x64')][_0x1c6798['actionid']][_0x180502[_0x7a04('0x5d')]]={'queue':_0x52ccca[_0x7a04('0x70')],'agents':[]};})[_0x7a04('0x3c')](function(_0x50a3c0){throw _0x50a3c0;});}}}catch(_0x2ec29a){logger[_0x7a04('0x3f')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x2ec29a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0x6b')]=function(_0x1b90d9){if(this[_0x7a04('0x14')][_0x7a04('0x6a')]>0x0){this[_0x7a04('0x14')][_0x7a04('0x72')]=_0x1b90d9;return;}logger[_0x7a04('0x48')](_0x7a04('0x73'),util['inspect'](_0x1b90d9,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami['emit'](_0x7a04('0x74'),{});};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0x1d')]=function(_0x4166d0){try{if(this[_0x7a04('0x56')](_0x4166d0)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x4166d0[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x4166d0,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x4166d0[_0x7a04('0x75')]])){this['queueReports'][_0x4166d0[_0x7a04('0x75')]]=[];}if(_[_0x7a04('0x57')](this['channels'][_0x4166d0[_0x7a04('0x75')]])){this[_0x7a04('0x11')][_0x4166d0['uniqueid']]={};}var _0x40d731=new QueueReport();_0x40d731[_0x7a04('0x4c')]=_0x4166d0[_0x7a04('0x4c')];_0x40d731[_0x7a04('0x54')]=this[_0x7a04('0x65')][_0x40d731[_0x7a04('0x4c')]]&&this[_0x7a04('0x65')][_0x40d731[_0x7a04('0x4c')]]['type']?this[_0x7a04('0x65')][_0x40d731[_0x7a04('0x4c')]][_0x7a04('0x54')]||_0x7a04('0x66'):_0x7a04('0x66');_0x40d731[_0x7a04('0x76')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));_0x40d731[_0x7a04('0x78')]=_0x4166d0[_0x7a04('0x78')];_0x40d731[_0x7a04('0x79')]=_0x4166d0[_0x7a04('0x79')];_0x40d731['uniqueid']=_0x4166d0['uniqueid'];_0x40d731[_0x7a04('0x7a')]=this[_0x7a04('0x11')][_0x4166d0[_0x7a04('0x75')]]['routealias'];logger[_0x7a04('0x6e')](_0x7a04('0x7b'),_0x40d731[_0x7a04('0x4c')],_0x40d731['type']);_[_0x7a04('0x7c')](_0x40d731,_[_0x7a04('0x7d')](_0x4166d0,_[_0x7a04('0x7e')](_0x40d731)));this[_0x7a04('0xf')][_0x4166d0['uniqueid']]['push'](_0x40d731);this[_0x7a04('0x11')][_0x4166d0['uniqueid']]=_0x40d731;this['emitVoiceQueueChannelSave'](_0x40d731,_0x7a04('0x1c'));}}catch(_0x371c00){logger[_0x7a04('0x3f')](_0x7a04('0x7f'),_0x4166d0[_0x7a04('0x75')],util['inspect'](_0x371c00,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0x1f')]=function(_0x31bac4){try{if(this['isNotNull'](_0x31bac4)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x31bac4[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x31bac4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x31bac4[_0x7a04('0x75')]]){var _0x2d8f1a=_['last'](this[_0x7a04('0xf')][_0x31bac4['uniqueid']]);_0x2d8f1a[_0x7a04('0x80')]=![];_0x2d8f1a['queuecallercompleteAt']=null;_0x2d8f1a[_0x7a04('0x81')]=_0x31bac4['holdtime'];_0x2d8f1a[_0x7a04('0x82')]=_0x31bac4[_0x7a04('0x82')];_0x2d8f1a[_0x7a04('0x1e')]=!![];_0x2d8f1a[_0x7a04('0x83')]=moment()[_0x7a04('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d8f1a[_0x7a04('0x84')]='ABANDONED';_0x2d8f1a[_0x7a04('0x85')]=null;logger[_0x7a04('0x6e')](_0x7a04('0x86'),_0x2d8f1a[_0x7a04('0x4c')],_0x2d8f1a[_0x7a04('0x54')]);this[_0x7a04('0x11')][_0x31bac4[_0x7a04('0x75')]]=_0x2d8f1a;this[_0x7a04('0x44')](_0x2d8f1a,_0x7a04('0x1e'));}}}catch(_0x3ecdb7){logger['error'](_0x7a04('0x87'),_0x31bac4[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x3ecdb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0x21')]=function(_0x5b7b91){try{if(this[_0x7a04('0x56')](_0x5b7b91)){logger[_0x7a04('0x48')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b7b91[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x5b7b91,{'showHidden':![],'depth':null}));if(this[_0x7a04('0xf')][_0x5b7b91[_0x7a04('0x75')]]){var _0x5d2a68=_['last'](this['queueReports'][_0x5b7b91[_0x7a04('0x75')]]);_0x5d2a68[_0x7a04('0x88')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));_0x5d2a68['connectedlinenum']=_0x5b7b91[_0x7a04('0x89')];_0x5d2a68[_0x7a04('0x8a')]=_0x5b7b91[_0x7a04('0x8a')];logger[_0x7a04('0x6e')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5d2a68[_0x7a04('0x4c')],_0x5d2a68[_0x7a04('0x54')],_0x5b7b91[_0x7a04('0x89')],_0x5b7b91[_0x7a04('0x8a')]);this[_0x7a04('0x11')][_0x5b7b91[_0x7a04('0x75')]]=_0x5d2a68;this[_0x7a04('0x47')](_0x5d2a68,_0x7a04('0x20'));}}}catch(_0x2e6b0d){logger[_0x7a04('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b7b91[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x2e6b0d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a04('0x25')]=function(_0x1ee801){try{if(this[_0x7a04('0x56')](_0x1ee801)){logger[_0x7a04('0x48')]('[%s][voiceQueueReport][agentconnect]',_0x1ee801[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x1ee801,{'showHidden':![],'depth':null}));if(this[_0x7a04('0xf')][_0x1ee801[_0x7a04('0x75')]]){var _0x2c5714=_[_0x7a04('0x8b')](this['queueReports'][_0x1ee801[_0x7a04('0x75')]]);_0x2c5714[_0x7a04('0x80')]=!![];_0x2c5714[_0x7a04('0x84')]=_0x7a04('0x8c');logger[_0x7a04('0x6e')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x2c5714[_0x7a04('0x4c')],_0x2c5714[_0x7a04('0x54')]);}}}catch(_0x3e6747){logger[_0x7a04('0x3f')](_0x7a04('0x8d'),_0x1ee801[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x3e6747,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a04('0x23')]=function(_0x5dfde8){try{if(this[_0x7a04('0x56')](_0x5dfde8)){logger[_0x7a04('0x48')](_0x7a04('0x8e'),_0x5dfde8[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x5dfde8,{'showHidden':![],'depth':null}));if(this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x75')]]){var _0x37e2bd=_[_0x7a04('0x8b')](this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x75')]]);_0x37e2bd[_0x7a04('0x1e')]=![];_0x37e2bd[_0x7a04('0x83')]=null;_0x37e2bd[_0x7a04('0x8f')]=!![];_0x37e2bd[_0x7a04('0x85')]=_0x5dfde8[_0x7a04('0x90')];_0x37e2bd['holdtime']=_0x5dfde8[_0x7a04('0x81')];_0x37e2bd['queuecallercomplete']=!![];_0x37e2bd[_0x7a04('0x91')]=![];_0x37e2bd[_0x7a04('0x92')]=null;if(!_0x37e2bd[_0x7a04('0x93')]){if(_0x5dfde8[_0x7a04('0x94')]==_0x7a04('0x93')){_0x37e2bd[_0x7a04('0x84')]=_0x7a04('0x95');logger[_0x7a04('0x6e')](_0x7a04('0x96'),_0x37e2bd[_0x7a04('0x4c')],_0x37e2bd[_0x7a04('0x54')]);}else{if(_[_0x7a04('0x97')](_0x5dfde8[_0x7a04('0x3b')][_0x7a04('0x98')](),'local/')){if(this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x99')]]){var _0x5b22b8=_[_0x7a04('0x8b')](this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x99')]]);_0x5b22b8['queuecallercomplete']=![];_0x5b22b8[_0x7a04('0x91')]=!![];_0x5b22b8[_0x7a04('0x92')]=moment(_0x37e2bd[_0x7a04('0x76')])[_0x7a04('0x9a')](_0x5dfde8[_0x7a04('0x81')],_0x7a04('0x9b'))[_0x7a04('0x4b')](_0x7a04('0x77'));_0x5b22b8['queuecallerexitreason']=_0x7a04('0x9c');_0x5b22b8[_0x7a04('0x93')]=!![];_0x5b22b8[_0x7a04('0x9d')]=_0x7a04('0x9e');_0x5b22b8[_0x7a04('0x9f')]=_0x5dfde8[_0x7a04('0xa0')];_0x5b22b8[_0x7a04('0xa1')]=_0x5dfde8[_0x7a04('0x75')];logger[_0x7a04('0x6e')](_0x7a04('0xa2'),_0x5b22b8[_0x7a04('0x4c')],_0x5b22b8[_0x7a04('0x54')]);var _0x2889c1=this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x99')]];this['queueReports'][_0x5dfde8[_0x7a04('0x99')]]=this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x75')]];this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x75')]]=_0x2889c1;}}else{_0x37e2bd[_0x7a04('0x84')]=_0x7a04('0xa3')+_0x5dfde8[_0x7a04('0x94')][_0x7a04('0xa4')]();logger[_0x7a04('0x6e')](_0x7a04('0xa5'),_0x37e2bd[_0x7a04('0x4c')],_0x37e2bd[_0x7a04('0x54')],_0x37e2bd[_0x7a04('0x84')]);}}}this[_0x7a04('0x11')][_0x5dfde8[_0x7a04('0x75')]]=_0x37e2bd;this[_0x7a04('0x44')](_0x37e2bd,_0x7a04('0x22'));}}}catch(_0x47829e){logger[_0x7a04('0x3f')](_0x7a04('0x8e'),_0x5dfde8[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x47829e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0xa6')]=function(_0x342c59){try{if(this[_0x7a04('0x56')](_0x342c59)){logger['debug']('[%s][voiceQueueReport][varset]',_0x342c59[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x342c59,{'showHidden':![],'depth':null}));this['addVariable'](_0x342c59[_0x7a04('0x75')],_[_0x7a04('0x7e')](_0x342c59[_0x7a04('0xa7')])[0x0],_0x342c59[_0x7a04('0xa8')]);if(this[_0x7a04('0xf')][_0x342c59[_0x7a04('0x75')]]){var _0x2c6002=_[_0x7a04('0x8b')](this[_0x7a04('0xf')][_0x342c59['uniqueid']]);if(_0x2c6002){if(this[_0x7a04('0x56')](_0x342c59[_0x7a04('0xa7')])&&this[_0x7a04('0x56')](_0x342c59['variable']['queuestatus'])){switch(_0x342c59[_0x7a04('0xa8')]){case _0x7a04('0xa9'):_0x2c6002[_0x7a04('0x91')]=![];_0x2c6002[_0x7a04('0x92')]=null;break;case _0x7a04('0xaa'):_0x2c6002[_0x7a04('0xab')]='timeout';_0x2c6002[_0x7a04('0x91')]=!![];_0x2c6002[_0x7a04('0x92')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2c6002['queuecallerleaveAt']=moment()['format'](_0x7a04('0x77'));logger[_0x7a04('0x48')](_0x7a04('0xac'),_0x342c59['uniqueid'],util[_0x7a04('0x40')](_0x2c6002,{'showHidden':![],'depth':null}));ami[_0x7a04('0x46')](_0x7a04('0xad'),_0x2c6002);break;default:_0x2c6002[_0x7a04('0x91')]=!![];_0x2c6002[_0x7a04('0x92')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));_0x2c6002[_0x7a04('0x88')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));}_0x2c6002['queuecallerabandon']=![];_0x2c6002[_0x7a04('0x83')]=null;_0x2c6002[_0x7a04('0x84')]=_0x342c59[_0x7a04('0xa8')];this[_0x7a04('0x11')][_0x342c59[_0x7a04('0x75')]]=_0x2c6002;this['emitVoiceQueueChannelRemove'](_0x2c6002,_0x7a04('0x26'));}else if(this[_0x7a04('0x56')](_0x342c59['variable'])&&this[_0x7a04('0x56')](_0x342c59[_0x7a04('0xa7')]['queueposition'])){if(!_0x2c6002[_0x7a04('0x1e')]){_0x2c6002[_0x7a04('0x91')]=!![];_0x2c6002[_0x7a04('0x92')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));_0x2c6002['queuecallerexitreason']=_0x7a04('0xae');_0x2c6002[_0x7a04('0x88')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));this[_0x7a04('0x11')][_0x342c59[_0x7a04('0x75')]]=_0x2c6002;}}logger[_0x7a04('0x6e')](_0x7a04('0xaf'),_0x342c59[_0x7a04('0x75')],_0x2c6002[_0x7a04('0x4c')],_0x2c6002[_0x7a04('0x54')],_[_0x7a04('0x7e')](_0x342c59['variable'])[0x0],_0x342c59[_0x7a04('0xa8')]);_0x2c6002[_0x7a04('0x15')]=this[_0x7a04('0x15')][_0x342c59[_0x7a04('0x75')]];}}}}catch(_0x26614e){logger[_0x7a04('0x3f')](_0x7a04('0xb0'),_0x342c59['uniqueid'],util[_0x7a04('0x40')](_0x26614e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0xb1')]=function(_0x579ec9,_0x310a37,_0x4e0bf1){var _0x554459=[_0x7a04('0xb2'),_0x7a04('0xb3'),_0x7a04('0xb4'),_0x7a04('0xb5'),_0x7a04('0xb6'),_0x7a04('0xb7'),_0x7a04('0xb8'),'rtpaudioqosrttbridged',_0x7a04('0xb9'),_0x7a04('0xba'),_0x7a04('0xbb'),_0x7a04('0xbc'),'membercalls',_0x7a04('0xbd'),_0x7a04('0xbe'),_0x7a04('0xbf'),_0x7a04('0x90'),_0x7a04('0xc0'),_0x7a04('0xc1')];if(!_['isNil'](_0x310a37)&&!_['includes'](_0x554459,_0x310a37)){if(_[_0x7a04('0x57')](this[_0x7a04('0x15')][_0x579ec9])){this[_0x7a04('0x15')][_0x579ec9]={};}this[_0x7a04('0x15')][_0x579ec9][_0x310a37]=_0x4e0bf1;}};VoiceQueueReport['prototype'][_0x7a04('0xc2')]=function(_0x1f56d3,_0x1cb49b,_0x4a4da1){var _0x5c19d5={};for(var _0x1a57e1=0x0;_0x1a57e1=0x0?moment(_0x36ec1b[_0xe510('0x1a')])[_0xe510('0xe')](_0x36ec1b[_0xe510('0x19')],_0xe510('0xf')):null,'data1':_0xe510('0x1b'),'data2':_0x36ec1b['accountcode'],'data3':_0x36ec1b[_0xe510('0x12')],'data4':_0x36ec1b[_0xe510('0x1c')]||null,'role':_0xe510('0x14'),'internal':_0x36ec1b[_0xe510('0x15')]?_['toNumber'](_0x36ec1b[_0xe510('0x15')]):undefined,'uniqueid':_0x36ec1b['uniqueid']},'log':_0xe510('0x8')});}; \ No newline at end of file +var _0x7c9a=['diff','seconds','inbound','calleridnum','exten','queue','agent','uniqueid','voiceDialReport','membername','starttime','endtime','outbound','accountcode','dialstring','toNumber','moment','lodash','util','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt'];(function(_0x148847,_0x5e8097){var _0xfd164e=function(_0x3fe191){while(--_0x3fe191){_0x148847['push'](_0x148847['shift']());}};_0xfd164e(++_0x5e8097);}(_0x7c9a,0x14f));var _0xa7c9=function(_0x2c5250,_0x158244){_0x2c5250=_0x2c5250-0x0;var _0x2da5be=_0x7c9a[_0x2c5250];return _0x2da5be;};'use strict';var moment=require(_0xa7c9('0x0'));var _=require(_0xa7c9('0x1'));var util=require(_0xa7c9('0x2'));var client=require('../client');exports[_0xa7c9('0x3')]=function(_0x3570a8){var _0x52ef2e=_0x3570a8['queuecallercompleteAt']||_0x3570a8[_0xa7c9('0x4')];return client[_0xa7c9('0x5')](_0xa7c9('0x6'),{'body':{'channel':'voice','membername':_0x3570a8[_0xa7c9('0x7')],'interface':_[_0xa7c9('0x8')](_0x3570a8[_0xa7c9('0x9')])?util[_0xa7c9('0xa')](_0xa7c9('0xb'),_0x3570a8['lastAssignedTo']):_0x3570a8[_0xa7c9('0x9')],'type':'TALKING','enterAt':_0x3570a8[_0xa7c9('0xc')],'exitAt':_0x52ef2e,'duration':moment(_0x52ef2e)[_0xa7c9('0xd')](_0x3570a8[_0xa7c9('0xc')],_0xa7c9('0xe')),'data1':_0xa7c9('0xf'),'data2':_0x3570a8[_0xa7c9('0x10')],'data3':_0x3570a8[_0xa7c9('0x11')],'data4':null,'data5':_0x3570a8[_0xa7c9('0x12')],'role':_0xa7c9('0x13'),'internal':_0x3570a8['accountcode']?_['toNumber'](_0x3570a8['accountcode']):undefined,'uniqueid':_0x3570a8[_0xa7c9('0x14')]},'log':_0xa7c9('0x6')});};exports[_0xa7c9('0x15')]=function(_0x48ec9a){return client['Request'](_0xa7c9('0x6'),{'body':{'channel':'voice','membername':_0x48ec9a[_0xa7c9('0x16')],'interface':_0x48ec9a[_0xa7c9('0x9')],'type':'TALKING','enterAt':_0x48ec9a[_0xa7c9('0x17')],'exitAt':_0x48ec9a[_0xa7c9('0x18')],'duration':moment(_0x48ec9a[_0xa7c9('0x18')])[_0xa7c9('0xd')](_0x48ec9a['starttime'],_0xa7c9('0xe'))>=0x0?moment(_0x48ec9a[_0xa7c9('0x18')])[_0xa7c9('0xd')](_0x48ec9a[_0xa7c9('0x17')],_0xa7c9('0xe')):null,'data1':_0xa7c9('0x19'),'data2':_0x48ec9a[_0xa7c9('0x1a')],'data3':_0x48ec9a[_0xa7c9('0x11')],'data4':_0x48ec9a[_0xa7c9('0x1b')]||null,'role':_0xa7c9('0x13'),'internal':_0x48ec9a[_0xa7c9('0x1a')]?_[_0xa7c9('0x1c')](_0x48ec9a[_0xa7c9('0x1a')]):undefined,'uniqueid':_0x48ec9a[_0xa7c9('0x14')]},'log':_0xa7c9('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 5896e9f..14c8ae8 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0102=['ShowSetting','stopRecordingOnTransfer','getSettings','Request'];(function(_0x27c0e0,_0x217360){var _0x47d780=function(_0xa8422d){while(--_0xa8422d){_0x27c0e0['push'](_0x27c0e0['shift']());}};_0x47d780(++_0x217360);}(_0x0102,0x186));var _0x2010=function(_0x383112,_0x3a1a78){_0x383112=_0x383112-0x0;var _0x3363f3=_0x0102[_0x383112];return _0x3363f3;};'use strict';var client=require('../client');exports[_0x2010('0x0')]=function(){return client[_0x2010('0x1')](_0x2010('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2010('0x3'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file +var _0x6554=['../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x6554,0x181));var _0x4655=function(_0x3906b4,_0x2d2c76){_0x3906b4=_0x3906b4-0x0;var _0x39892f=_0x6554[_0x3906b4];return _0x39892f;};'use strict';var client=require(_0x4655('0x0'));exports[_0x4655('0x1')]=function(){return client[_0x4655('0x2')](_0x4655('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4655('0x4'),_0x4655('0x5')]},'log':_0x4655('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index fc002ca..1b0de6e 100644 --- a/server/services/ami/rpc/template.js +++ b/server/services/ami/rpc/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b84=['Request','GetTemplate','html','../client','getTemplates'];(function(_0x1d3a68,_0x55cb1e){var _0x1a569f=function(_0x7331c7){while(--_0x7331c7){_0x1d3a68['push'](_0x1d3a68['shift']());}};_0x1a569f(++_0x55cb1e);}(_0x2b84,0x1ed));var _0x42b8=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x2b84[_0x187ee1];return _0x388160;};'use strict';var client=require(_0x42b8('0x0'));exports[_0x42b8('0x1')]=function(_0x5ee2af){return function(_0x201156){return client[_0x42b8('0x2')](_0x42b8('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x42b8('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x2bc5=['GetTemplate','name','Request'];(function(_0xb71c35,_0x129343){var _0x39224f=function(_0x26eee8){while(--_0x26eee8){_0xb71c35['push'](_0xb71c35['shift']());}};_0x39224f(++_0x129343);}(_0x2bc5,0x1bb));var _0x52bc=function(_0x5b95af,_0x1b27a5){_0x5b95af=_0x5b95af-0x0;var _0x57da28=_0x2bc5[_0x5b95af];return _0x57da28;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x5b2cbf){return function(_0x39f03e){return client[_0x52bc('0x0')](_0x52bc('0x1'),{'options':{'raw':!![],'attributes':['id',_0x52bc('0x2'),'html']},'log':_0x52bc('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index a9cc76c..462bcd8 100644 --- a/server/services/ami/rpc/trigger.js +++ b/server/services/ami/rpc/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d06=['status','Condition','AllConditions','field','operator','value','AnyConditions','Actions','action','data1','data2','data3','data6','data7','../client','getTriggers','Request','channel'];(function(_0x35698c,_0x3ab432){var _0x57d81d=function(_0xd3f999){while(--_0xd3f999){_0x35698c['push'](_0x35698c['shift']());}};_0x57d81d(++_0x3ab432);}(_0x7d06,0x7a));var _0x67d0=function(_0x10bd31,_0xf7377c){_0x10bd31=_0x10bd31-0x0;var _0xe43c11=_0x7d06[_0x10bd31];return _0xe43c11;};'use strict';var client=require(_0x67d0('0x0'));exports[_0x67d0('0x1')]=function(_0x19c924){return function(_0x2142fe){return client[_0x67d0('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x67d0('0x3'),_0x67d0('0x4')],'include':[{'model':_0x67d0('0x5'),'as':_0x67d0('0x6'),'attributes':['id',_0x67d0('0x7'),_0x67d0('0x8'),_0x67d0('0x9')]},{'model':_0x67d0('0x5'),'as':_0x67d0('0xa'),'attributes':['id',_0x67d0('0x7'),_0x67d0('0x8'),'value']},{'model':'Action','as':_0x67d0('0xb'),'attributes':['id',_0x67d0('0xc'),_0x67d0('0xd'),_0x67d0('0xe'),_0x67d0('0xf'),'data4','data5',_0x67d0('0x10'),_0x67d0('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xd513=['data7','../client','getTriggers','GetTrigger','name','channel','AllConditions','field','operator','value','Condition','AnyConditions','Action','Actions','action','data2','data3','data5'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd513,0x7f));var _0x3d51=function(_0x3c74fc,_0x1f46b3){_0x3c74fc=_0x3c74fc-0x0;var _0x3f44cd=_0xd513[_0x3c74fc];return _0x3f44cd;};'use strict';var client=require(_0x3d51('0x0'));exports[_0x3d51('0x1')]=function(_0x53879e){return function(_0x39bc0c){return client['Request'](_0x3d51('0x2'),{'options':{'raw':![],'attributes':['id',_0x3d51('0x3'),_0x3d51('0x4'),'status'],'include':[{'model':'Condition','as':_0x3d51('0x5'),'attributes':['id',_0x3d51('0x6'),_0x3d51('0x7'),_0x3d51('0x8')]},{'model':_0x3d51('0x9'),'as':_0x3d51('0xa'),'attributes':['id',_0x3d51('0x6'),_0x3d51('0x7'),_0x3d51('0x8')]},{'model':_0x3d51('0xb'),'as':_0x3d51('0xc'),'attributes':['id',_0x3d51('0xd'),'data1',_0x3d51('0xe'),_0x3d51('0xf'),'data4',_0x3d51('0x10'),'data6',_0x3d51('0x11')]}]},'log':_0x3d51('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 3096fb9..737f83d 100644 --- a/server/services/ami/rpc/trunk.js +++ b/server/services/ami/rpc/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa639=['name','../client','getTrunks','Request','GetTrunk'];(function(_0x1bb217,_0x1bda1e){var _0x15d51e=function(_0x5dac47){while(--_0x5dac47){_0x1bb217['push'](_0x1bb217['shift']());}};_0x15d51e(++_0x1bda1e);}(_0xa639,0x187));var _0x9a63=function(_0xcdf6c1,_0x38f64c){_0xcdf6c1=_0xcdf6c1-0x0;var _0x5625a8=_0xa639[_0xcdf6c1];return _0x5625a8;};'use strict';var client=require(_0x9a63('0x0'));exports[_0x9a63('0x1')]=function(_0x41f05a){return function(_0x56b348){return client[_0x9a63('0x2')](_0x9a63('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9a63('0x4'),'registry','defaultuser']},'log':_0x9a63('0x3')});};}; \ No newline at end of file +var _0xbe7c=['../client','getTrunks','Request','name','registry','GetTrunk'];(function(_0x4f8ccf,_0x8388e4){var _0x379001=function(_0x3e9659){while(--_0x3e9659){_0x4f8ccf['push'](_0x4f8ccf['shift']());}};_0x379001(++_0x8388e4);}(_0xbe7c,0x108));var _0xcbe7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbe7c[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0xcbe7('0x0'));exports[_0xcbe7('0x1')]=function(_0x2d8733){return function(_0x192c99){return client[_0xcbe7('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xcbe7('0x3'),_0xcbe7('0x4'),'defaultuser']},'log':_0xcbe7('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 4bf77ac..9099296 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x329376,_0x17c063){var _0x152cd8=function(_0x32c7b0){while(--_0x32c7b0){_0x329376['push'](_0x329376['shift']());}};_0x152cd8(++_0x17c063);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x2ea100,_0x347ad5){var _0x4bdbeb=function(_0x106c7d){while(--_0x106c7d){_0x2ea100['push'](_0x2ea100['shift']());}};_0x4bdbeb(++_0x347ad5);}(_0x70e0,0x17b));var _0x070e=function(_0x4a9446,_0x3d2ade){_0x4a9446=_0x4a9446-0x0;var _0x23c972=_0x70e0[_0x4a9446];return _0x23c972;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index d905a9f..a096833 100644 --- a/server/services/ami/rpc/voiceAgentReport.js +++ b/server/services/ami/rpc/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa263=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x8ea3c1,_0x42a733){var _0xe58c78=function(_0xaafe30){while(--_0xaafe30){_0x8ea3c1['push'](_0x8ea3c1['shift']());}};_0xe58c78(++_0x42a733);}(_0xa263,0x11c));var _0x3a26=function(_0xca79ab,_0x11116e){_0xca79ab=_0xca79ab-0x0;var _0x56b675=_0xa263[_0xca79ab];return _0x56b675;};'use strict';var client=require(_0x3a26('0x0'));exports[_0x3a26('0x1')]=function(_0x5759e7){return client[_0x3a26('0x2')](_0x3a26('0x3'),{'body':_0x5759e7,'log':_0x3a26('0x3')});};exports[_0x3a26('0x4')]=function(_0x18766f,_0x4e66e9,_0x39c1a6){return client[_0x3a26('0x2')](_0x3a26('0x5'),{'body':_0x18766f,'options':{'where':{'uniqueid':_0x4e66e9,'interface':_0x39c1a6,'agentcomplete':!![]}},'log':_0x3a26('0x5')});}; \ No newline at end of file +var _0x643c=['Request','UpdateVoiceAgentReport','../client','CreateVoiceAgentReport'];(function(_0x143ca5,_0x45019d){var _0x31fb7b=function(_0x4ff1be){while(--_0x4ff1be){_0x143ca5['push'](_0x143ca5['shift']());}};_0x31fb7b(++_0x45019d);}(_0x643c,0xba));var _0xc643=function(_0x31bdee,_0x5d888e){_0x31bdee=_0x31bdee-0x0;var _0x187af1=_0x643c[_0x31bdee];return _0x187af1;};'use strict';var client=require(_0xc643('0x0'));exports['create']=function(_0x472314){return client['Request'](_0xc643('0x1'),{'body':_0x472314,'log':_0xc643('0x1')});};exports['update']=function(_0x4e845f,_0x107471,_0x481146){return client[_0xc643('0x2')](_0xc643('0x3'),{'body':_0x4e845f,'options':{'where':{'uniqueid':_0x107471,'interface':_0x481146,'agentcomplete':!![]}},'log':_0xc643('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 27916ed..6fd011a 100644 --- a/server/services/ami/rpc/voiceCallReport.js +++ b/server/services/ami/rpc/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdff1=['day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','GetVoiceCallReports','moment','lodash','Request','CreateVoiceCallReport','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','startOf'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xdff1,0x1d2));var _0x1dff=function(_0x3a63ab,_0x4eccab){_0x3a63ab=_0x3a63ab-0x0;var _0x2e4b8f=_0xdff1[_0x3a63ab];return _0x2e4b8f;};'use strict';var moment=require(_0x1dff('0x0'));var util=require('util');var _=require(_0x1dff('0x1'));var client=require('../client');exports['create']=function(_0x2fcd8f){return client[_0x1dff('0x2')](_0x1dff('0x3'),{'body':_['merge'](_0x2fcd8f,{'source':_0x2fcd8f[_0x1dff('0x4')],'destinationcontext':_0x2fcd8f[_0x1dff('0x5')],'callerid':_0x2fcd8f[_0x1dff('0x6')],'amaflags':'DOCUMENTATION'}),'log':_0x1dff('0x3')});};exports[_0x1dff('0x7')]=function(){return function(){return client[_0x1dff('0x2')](_0x1dff('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x1dff('0x9')](_0x1dff('0xa'))[_0x1dff('0xb')](_0x1dff('0xc')),moment()['endOf']('day')[_0x1dff('0xb')](_0x1dff('0xc'))]}},'attributes':[_0x1dff('0xd'),_0x1dff('0xe'),'duration',_0x1dff('0xf')]},'log':_0x1dff('0x10')});};}; \ No newline at end of file +var _0x9851=['billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','merge','calleridnum','callerid','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition'];(function(_0x26de31,_0x1d53f8){var _0x54aa37=function(_0x29c1b5){while(--_0x29c1b5){_0x26de31['push'](_0x26de31['shift']());}};_0x54aa37(++_0x1d53f8);}(_0x9851,0x1a6));var _0x1985=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9851[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x1985('0x0'));var util=require(_0x1985('0x1'));var _=require('lodash');var client=require(_0x1985('0x2'));exports[_0x1985('0x3')]=function(_0xd89d68){return client[_0x1985('0x4')]('CreateVoiceCallReport',{'body':_[_0x1985('0x5')](_0xd89d68,{'source':_0xd89d68[_0x1985('0x6')],'destinationcontext':_0xd89d68['context'],'callerid':_0xd89d68[_0x1985('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x1985('0x8')});};exports[_0x1985('0x9')]=function(){return function(){return client[_0x1985('0x4')](_0x1985('0xa'),{'options':{'where':{'type':[_0x1985('0xb')],'createdAt':{'$between':[moment()[_0x1985('0xc')]('day')[_0x1985('0xd')](_0x1985('0xe')),moment()[_0x1985('0xf')](_0x1985('0x10'))[_0x1985('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x1985('0x11'),_0x1985('0x12'),'duration',_0x1985('0x13')]},'log':_0x1985('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 9dfdd3b..a0f9eb5 100644 --- a/server/services/ami/rpc/voiceDialReport.js +++ b/server/services/ami/rpc/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc47b=['../client','create','CreateVoiceDialReport'];(function(_0x33923b,_0xc583ef){var _0xc4513b=function(_0x4b8a4d){while(--_0x4b8a4d){_0x33923b['push'](_0x33923b['shift']());}};_0xc4513b(++_0xc583ef);}(_0xc47b,0x171));var _0xbc47=function(_0x46855c,_0x3f54f8){_0x46855c=_0x46855c-0x0;var _0x32a370=_0xc47b[_0x46855c];return _0x32a370;};'use strict';var client=require(_0xbc47('0x0'));exports[_0xbc47('0x1')]=function(_0x57da60){return client['Request'](_0xbc47('0x2'),{'body':_0x57da60,'log':_0xbc47('0x2')});}; \ No newline at end of file +var _0x5046=['../client','Request','CreateVoiceDialReport'];(function(_0x8dcd93,_0x51b2e7){var _0x2d272e=function(_0x5928e2){while(--_0x5928e2){_0x8dcd93['push'](_0x8dcd93['shift']());}};_0x2d272e(++_0x51b2e7);}(_0x5046,0x183));var _0x6504=function(_0x5c684b,_0x31ecd9){_0x5c684b=_0x5c684b-0x0;var _0x45d114=_0x5046[_0x5c684b];return _0x45d114;};'use strict';var client=require(_0x6504('0x0'));exports['create']=function(_0x2d1f75){return client[_0x6504('0x1')](_0x6504('0x2'),{'body':_0x2d1f75,'log':_0x6504('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 3f65b7b..d35a954 100644 --- a/server/services/ami/rpc/voiceExtension.js +++ b/server/services/ami/rpc/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde9d=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0xde9d,0x156));var _0xdde9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xde9d[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0xdde9('0x0'));exports[_0xdde9('0x1')]=function(){return function(){return client[_0xdde9('0x2')](_0xdde9('0x3'),{'options':{'raw':!![],'attributes':['id',_0xdde9('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xdde9('0x1')});};}; \ No newline at end of file +var _0x4d46=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x28022a,_0x31eb0c){var _0x4b9d20=function(_0x1468bc){while(--_0x1468bc){_0x28022a['push'](_0x28022a['shift']());}};_0x4b9d20(++_0x31eb0c);}(_0x4d46,0x197));var _0x64d4=function(_0x3f8965,_0x3c80b9){_0x3f8965=_0x3f8965-0x0;var _0xcdf5c9=_0x4d46[_0x3f8965];return _0xcdf5c9;};'use strict';var client=require(_0x64d4('0x0'));exports[_0x64d4('0x1')]=function(){return function(){return client[_0x64d4('0x2')](_0x64d4('0x3'),{'options':{'raw':!![],'attributes':['id',_0x64d4('0x4'),_0x64d4('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 5129a75..f49fd31 100644 --- a/server/services/ami/rpc/voiceQueue.js +++ b/server/services/ami/rpc/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1db0=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x375e7b,_0x1c630f){var _0x596c18=function(_0x4917ad){while(--_0x4917ad){_0x375e7b['push'](_0x375e7b['shift']());}};_0x596c18(++_0x1c630f);}(_0x1db0,0x107));var _0x01db=function(_0x17158c,_0x58cb92){_0x17158c=_0x17158c-0x0;var _0x734f31=_0x1db0[_0x17158c];return _0x734f31;};'use strict';var client=require('../client');exports[_0x01db('0x0')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0x01db('0x1'),_0x01db('0x2'),_0x01db('0x3'),_0x01db('0x4'),_0x01db('0x5'),'dialActive',_0x01db('0x6'),_0x01db('0x7'),_0x01db('0x8'),_0x01db('0x9'),_0x01db('0xa'),_0x01db('0xb'),_0x01db('0xc'),'dialOriginateCallerIdName',_0x01db('0xd'),_0x01db('0xe'),_0x01db('0xf'),_0x01db('0x10'),_0x01db('0x11'),_0x01db('0x12'),_0x01db('0x13'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x01db('0x14'),_0x01db('0x15'),'dialGlobalMaxRetry',_0x01db('0x16'),'dialGlobalInterval',_0x01db('0x17'),_0x01db('0x18'),_0x01db('0x19'),_0x01db('0x1a'),'dialAMDGreeting',_0x01db('0x1b'),_0x01db('0x1c'),_0x01db('0x1d'),_0x01db('0x1e'),_0x01db('0x1f'),_0x01db('0x20'),_0x01db('0x21'),'timeout','dialRecallMeTimeout',_0x01db('0x22'),_0x01db('0x23'),'dialAgiAfterHangupAgent',_0x01db('0x24'),_0x01db('0x25'),_0x01db('0x4'),_0x01db('0x26'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x01db('0x27'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x01db('0x28'),_0x01db('0x29'),_0x01db('0x2a'),_0x01db('0x2b'),_0x01db('0x2c'),'dialAgentRejectRetryFrequency',_0x01db('0x2d'),'dialPredictiveIntervalMaxThreshold',_0x01db('0x2e'),_0x01db('0x2f'),_0x01db('0x30')],'include':[{'model':'Trunk','as':_0x01db('0x31'),'attributes':['id',_0x01db('0x32'),_0x01db('0x33'),_0x01db('0x34')]},{'model':_0x01db('0x35'),'as':_0x01db('0x36'),'attributes':['id',_0x01db('0x32')]},{'model':_0x01db('0x31'),'as':_0x01db('0x37'),'attributes':['id','name',_0x01db('0x33'),'active']},{'model':_0x01db('0x38'),'as':_0x01db('0x38'),'attributes':['id',_0x01db('0x32')],'include':[{'model':_0x01db('0x38'),'as':_0x01db('0x39'),'attributes':['id',_0x01db('0x32'),_0x01db('0x3a')]}]}]},'log':_0x01db('0x0')});};}; \ No newline at end of file +var _0xbdf1=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','getVoiceQueues','Request','GetVoiceQueue','name','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence'];(function(_0x789052,_0x422a0c){var _0x405831=function(_0x451272){while(--_0x451272){_0x789052['push'](_0x789052['shift']());}};_0x405831(++_0x422a0c);}(_0xbdf1,0xdc));var _0x1bdf=function(_0x191567,_0x231109){_0x191567=_0x191567-0x0;var _0x140553=_0xbdf1[_0x191567];return _0x140553;};'use strict';var client=require('../client');exports[_0x1bdf('0x0')]=function(){return function(){return client[_0x1bdf('0x1')](_0x1bdf('0x2'),{'options':{'raw':![],'attributes':['id',_0x1bdf('0x3'),'acw','acwTimeout',_0x1bdf('0x4'),_0x1bdf('0x5'),'type',_0x1bdf('0x6'),_0x1bdf('0x7'),'dialLimitChannel',_0x1bdf('0x8'),_0x1bdf('0x9'),_0x1bdf('0xa'),_0x1bdf('0xb'),_0x1bdf('0xc'),'dialOriginateCallerIdName',_0x1bdf('0xd'),'dialOriginateTimeout',_0x1bdf('0xe'),_0x1bdf('0xf'),_0x1bdf('0x10'),_0x1bdf('0x11'),_0x1bdf('0x12'),_0x1bdf('0x13'),_0x1bdf('0x14'),_0x1bdf('0x15'),_0x1bdf('0x16'),_0x1bdf('0x17'),_0x1bdf('0x18'),'dialGlobalInterval',_0x1bdf('0x19'),_0x1bdf('0x1a'),'dialAMDActive',_0x1bdf('0x1b'),_0x1bdf('0x1c'),_0x1bdf('0x1d'),_0x1bdf('0x1e'),_0x1bdf('0x1f'),_0x1bdf('0x20'),_0x1bdf('0x21'),_0x1bdf('0x22'),_0x1bdf('0x23'),_0x1bdf('0x24'),_0x1bdf('0x25'),'dialRecallInQueue',_0x1bdf('0x26'),_0x1bdf('0x27'),_0x1bdf('0x28'),_0x1bdf('0x29'),'monitor_format','strategy',_0x1bdf('0x2a'),_0x1bdf('0x2b'),'dialNoSuchNumberMaxRetry',_0x1bdf('0x2c'),_0x1bdf('0x2d'),'dialDropRetryFrequency',_0x1bdf('0x2e'),_0x1bdf('0x2f'),_0x1bdf('0x30'),_0x1bdf('0x31'),_0x1bdf('0x32'),_0x1bdf('0x33'),_0x1bdf('0x34'),'dialPredictiveIntervalMaxThreshold',_0x1bdf('0x35'),_0x1bdf('0x36'),_0x1bdf('0x37')],'include':[{'model':_0x1bdf('0x38'),'as':_0x1bdf('0x38'),'attributes':['id',_0x1bdf('0x3'),_0x1bdf('0x39'),_0x1bdf('0x3a')]},{'model':_0x1bdf('0x3b'),'as':_0x1bdf('0x3c'),'attributes':['id',_0x1bdf('0x3')]},{'model':_0x1bdf('0x38'),'as':'TrunkBackup','attributes':['id',_0x1bdf('0x3'),_0x1bdf('0x39'),_0x1bdf('0x3a')]},{'model':'Interval','as':_0x1bdf('0x3d'),'attributes':['id',_0x1bdf('0x3')],'include':[{'model':_0x1bdf('0x3d'),'as':'Intervals','attributes':['id',_0x1bdf('0x3'),'interval']}]}]},'log':_0x1bdf('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index ee03353..76dea90 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x561d76,_0x4ad160){var _0x261f88=function(_0x2aff04){while(--_0x2aff04){_0x561d76['push'](_0x561d76['shift']());}};_0x261f88(++_0x4ad160);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0xa84652,_0x2b4f05){var _0xbe6fb1=function(_0x591469){while(--_0x591469){_0xa84652['push'](_0xa84652['shift']());}};_0xbe6fb1(++_0x2b4f05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index e97cfec..1faecba 100644 --- a/server/services/ami/rpc/voiceQueueRt.js +++ b/server/services/ami/rpc/voiceQueueRt.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x977d=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x26d1d2,_0x2c825c){var _0x5ab422=function(_0x3342bd){while(--_0x3342bd){_0x26d1d2['push'](_0x26d1d2['shift']());}};_0x5ab422(++_0x2c825c);}(_0x977d,0x12a));var _0xd977=function(_0x6c553c,_0x23a34a){_0x6c553c=_0x6c553c-0x0;var _0x1a18f5=_0x977d[_0x6c553c];return _0x1a18f5;};'use strict';var client=require(_0xd977('0x0'));exports[_0xd977('0x1')]=function(_0x1c115c){return function(){return client[_0xd977('0x2')](_0xd977('0x3'),{'options':{'where':{'VoiceQueueId':_0x1c115c,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xbf71=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xbf71,0x164));var _0x1bf7=function(_0x394ed2,_0x160fa8){_0x394ed2=_0x394ed2-0x0;var _0x5a9de1=_0xbf71[_0x394ed2];return _0x5a9de1;};'use strict';var client=require('../client');exports[_0x1bf7('0x0')]=function(_0x3bbf36){return function(){return client[_0x1bf7('0x1')](_0x1bf7('0x2'),{'options':{'where':{'VoiceQueueId':_0x3bbf36,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index c52ba2f..df6a630 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x844cf9,_0x13fdc6){var _0x15ed0b=function(_0x17c77f){while(--_0x17c77f){_0x844cf9['push'](_0x844cf9['shift']());}};_0x15ed0b(++_0x13fdc6);}(_0x7a54,0x106));var _0x47a5=function(_0x302a0a,_0xff95d9){_0x302a0a=_0x302a0a-0x0;var _0x2f9103=_0x7a54[_0x302a0a];return _0x2f9103;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x5642d7,_0x291444){var _0x3bdbda=function(_0x31f70c){while(--_0x31f70c){_0x5642d7['push'](_0x5642d7['shift']());}};_0x3bdbda(++_0x291444);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index fcb00e0..0207ff0 100644 --- a/server/services/ami/rpc/voiceTransferReport.js +++ b/server/services/ami/rpc/voiceTransferReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a50=['blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','extension','blind','attendedTransfer','result','secondtransfererconnectedlinename','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3a50,0x68));var _0x03a5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3a50[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x03a5('0x0'));exports['transfers']={};exports[_0x03a5('0x1')]=function(_0x1eeb7d){return client[_0x03a5('0x2')](_0x03a5('0x3'),{'body':{'result':_0x1eeb7d['result'],'transfererchannel':_0x1eeb7d[_0x03a5('0x4')],'transferercalleridnum':_0x1eeb7d[_0x03a5('0x5')],'transferercalleridname':_0x1eeb7d['transferercalleridname'],'transfererconnectedlinenum':_0x1eeb7d['transfererconnectedlinenum'],'transfererconnectedlinename':_0x1eeb7d[_0x03a5('0x6')],'transfereraccountcode':_0x1eeb7d[_0x03a5('0x7')],'transferercontext':_0x1eeb7d[_0x03a5('0x8')],'transfererexten':_0x1eeb7d[_0x03a5('0x9')],'transfererlinkedid':_0x1eeb7d[_0x03a5('0xa')],'transfereechannel':_0x1eeb7d[_0x03a5('0xb')],'transfereecalleridnum':_0x1eeb7d[_0x03a5('0xc')],'transfereecalleridname':_0x1eeb7d[_0x03a5('0xd')],'transfereeconnectedlinenum':_0x1eeb7d[_0x03a5('0xe')],'transfereeconnectedlinename':_0x1eeb7d[_0x03a5('0xf')],'transfereeaccountcode':_0x1eeb7d[_0x03a5('0x10')],'transfereecontext':_0x1eeb7d['transfereecontext'],'transfereeexten':_0x1eeb7d[_0x03a5('0x11')],'transfereelinkedid':_0x1eeb7d[_0x03a5('0x12')],'isexternal':_0x1eeb7d[_0x03a5('0x13')],'context':_0x1eeb7d['context'],'extension':_0x1eeb7d[_0x03a5('0x14')],'type':_0x03a5('0x15')},'log':_0x03a5('0x3')});};exports[_0x03a5('0x16')]=function(_0xb635e){return client[_0x03a5('0x2')](_0x03a5('0x3'),{'body':{'result':_0xb635e[_0x03a5('0x17')],'transfererchannel':_0xb635e['origtransfererchannel'],'transferercalleridnum':_0xb635e['origtransferercalleridnum'],'transferercalleridname':_0xb635e['origtransferercalleridname'],'transfererconnectedlinenum':_0xb635e['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xb635e[_0x03a5('0x18')],'transfereraccountcode':_0xb635e['origtransfereraccountcode'],'transferercontext':_0xb635e[_0x03a5('0x19')],'transfererexten':_0xb635e['secondtransfererexten'],'transfererlinkedid':_0xb635e['origtransfererlinkedid'],'transfereechannel':_0xb635e[_0x03a5('0x1a')],'transfereecalleridnum':_0xb635e[_0x03a5('0x1b')],'transfereecalleridname':_0xb635e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xb635e[_0x03a5('0x1c')],'transfereeconnectedlinename':_0xb635e[_0x03a5('0x1d')],'transfereeaccountcode':_0xb635e[_0x03a5('0x1e')],'transfereecontext':_0xb635e['transfertargetcontext'],'transfereeexten':_0xb635e[_0x03a5('0x1f')],'transfereelinkedid':_0xb635e[_0x03a5('0x20')],'isexternal':_0xb635e['isexternal'],'context':_0xb635e[_0x03a5('0x21')],'extension':_0xb635e['origtransfererexten'],'type':_0x03a5('0x22')},'log':_0x03a5('0x3')});}; \ No newline at end of file +var _0xd2b9=['transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname'];(function(_0x3cb516,_0x4f170d){var _0x43a4a7=function(_0x430a7e){while(--_0x430a7e){_0x3cb516['push'](_0x3cb516['shift']());}};_0x43a4a7(++_0x4f170d);}(_0xd2b9,0x1e9));var _0x9d2b=function(_0x2ec3aa,_0x29bd65){_0x2ec3aa=_0x2ec3aa-0x0;var _0x284ab2=_0xd2b9[_0x2ec3aa];return _0x284ab2;};'use strict';var client=require(_0x9d2b('0x0'));exports[_0x9d2b('0x1')]={};exports[_0x9d2b('0x2')]=function(_0x39e0cc){return client[_0x9d2b('0x3')](_0x9d2b('0x4'),{'body':{'result':_0x39e0cc[_0x9d2b('0x5')],'transfererchannel':_0x39e0cc['transfererchannel'],'transferercalleridnum':_0x39e0cc[_0x9d2b('0x6')],'transferercalleridname':_0x39e0cc[_0x9d2b('0x7')],'transfererconnectedlinenum':_0x39e0cc[_0x9d2b('0x8')],'transfererconnectedlinename':_0x39e0cc[_0x9d2b('0x9')],'transfereraccountcode':_0x39e0cc[_0x9d2b('0xa')],'transferercontext':_0x39e0cc['transferercontext'],'transfererexten':_0x39e0cc[_0x9d2b('0xb')],'transfererlinkedid':_0x39e0cc[_0x9d2b('0xc')],'transfereechannel':_0x39e0cc['transfereechannel'],'transfereecalleridnum':_0x39e0cc[_0x9d2b('0xd')],'transfereecalleridname':_0x39e0cc[_0x9d2b('0xe')],'transfereeconnectedlinenum':_0x39e0cc[_0x9d2b('0xf')],'transfereeconnectedlinename':_0x39e0cc['transfereeconnectedlinename'],'transfereeaccountcode':_0x39e0cc[_0x9d2b('0x10')],'transfereecontext':_0x39e0cc[_0x9d2b('0x11')],'transfereeexten':_0x39e0cc[_0x9d2b('0x12')],'transfereelinkedid':_0x39e0cc[_0x9d2b('0x13')],'isexternal':_0x39e0cc[_0x9d2b('0x14')],'context':_0x39e0cc[_0x9d2b('0x15')],'extension':_0x39e0cc[_0x9d2b('0x16')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0x9d2b('0x17')]=function(_0x51e75b){return client['Request'](_0x9d2b('0x4'),{'body':{'result':_0x51e75b[_0x9d2b('0x5')],'transfererchannel':_0x51e75b['origtransfererchannel'],'transferercalleridnum':_0x51e75b[_0x9d2b('0x18')],'transferercalleridname':_0x51e75b[_0x9d2b('0x19')],'transfererconnectedlinenum':_0x51e75b[_0x9d2b('0x1a')],'transfererconnectedlinename':_0x51e75b[_0x9d2b('0x1b')],'transfereraccountcode':_0x51e75b['origtransfereraccountcode'],'transferercontext':_0x51e75b[_0x9d2b('0x1c')],'transfererexten':_0x51e75b[_0x9d2b('0x1d')],'transfererlinkedid':_0x51e75b[_0x9d2b('0x1e')],'transfereechannel':_0x51e75b['transfertargetchannel'],'transfereecalleridnum':_0x51e75b[_0x9d2b('0x1f')],'transfereecalleridname':_0x51e75b[_0x9d2b('0x20')],'transfereeconnectedlinenum':_0x51e75b[_0x9d2b('0x21')],'transfereeconnectedlinename':_0x51e75b[_0x9d2b('0x22')],'transfereeaccountcode':_0x51e75b[_0x9d2b('0x23')],'transfereecontext':_0x51e75b[_0x9d2b('0x24')],'transfereeexten':_0x51e75b[_0x9d2b('0x25')],'transfereelinkedid':_0x51e75b[_0x9d2b('0x26')],'isexternal':_0x51e75b[_0x9d2b('0x14')],'context':_0x51e75b[_0x9d2b('0x27')],'extension':_0x51e75b[_0x9d2b('0x28')],'type':_0x9d2b('0x29')},'log':_0x9d2b('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index c294c02..a65b763 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb94=['find','omit','undefined','values','channels','voicechannel','map','channel','filename','uniqueid','wav','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','status','stop','%s.%s','StopMixMonitor\x20Success','queueChannels','type','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','validate','Hangup','voicequeuechannelredirect','Redirect','trunks','run','Event\x20name\x20mandatory','custom:','event','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','jayson/promise','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','error','asterisk','username','ami\x20disconnected','pick','keys','module','action','Reload','then','message','isConnected','join','command','Command','Action','content','catch','voiceQueues','hasOwnProperty','length'];(function(_0xb78fcf,_0x5c86dc){var _0x50aab3=function(_0x5883c7){while(--_0x5883c7){_0xb78fcf['push'](_0xb78fcf['shift']());}};_0x50aab3(++_0x5c86dc);}(_0xdb94,0xe5));var _0x4db9=function(_0x4f7418,_0x423267){_0x4f7418=_0x4f7418-0x0;var _0x392e0b=_0xdb94[_0x4f7418];return _0x392e0b;};'use strict';var _=require('lodash');var util=require(_0x4db9('0x0'));var jayson=require(_0x4db9('0x1'));var schema=require('validate');var moment=require(_0x4db9('0x2'));var config=require(_0x4db9('0x3'));var properties=require(_0x4db9('0x4'));var ami=require(_0x4db9('0x5'));var VoiceQueueSummary=require(_0x4db9('0x6'));exports['listen']=function(_0x39eccb,_0x541226,_0x1d21a8){return new Promise(function(_0xc76bc1,_0x1dddb9){var _0x3404f6={'QueuePause':function(_0x42a857){return new Promise(function(_0x57c701){var _0x45d5a3=util[_0x4db9('0x7')](_0x4db9('0x8'),_0x4db9('0x9'),_0x42a857[_0x4db9('0xa')]);if(_0x39eccb['timers']&&_0x39eccb[_0x4db9('0xb')][_0x45d5a3]&&_0x39eccb[_0x4db9('0xb')][_0x45d5a3][_0x4db9('0xc')]){_0x39eccb[_0x4db9('0xb')][_0x45d5a3][_0x4db9('0xd')]();}if(_0x39eccb[_0x4db9('0xe')][_0x45d5a3]){_0x39eccb['agents'][_0x45d5a3][_0x4db9('0xf')]({'statePause':_0x42a857[_0x4db9('0x10')]?!![]:![]});}_0x57c701({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x549c92){var _0x19f2d3=this;return new Promise(function(_0x3ac147,_0x34ec92){if(ami['isConnected']()==![]){return _0x34ec92(_0x19f2d3[_0x4db9('0x11')](0x1f4,[config[_0x4db9('0x12')]['ip'],config[_0x4db9('0x12')][_0x4db9('0x13')],_0x4db9('0x14')]['join']('\x20')));}_0x549c92=_[_0x4db9('0x15')](_0x549c92,_[_0x4db9('0x16')](properties['reload'][_0x4db9('0x17')]));_0x549c92[_0x4db9('0x18')]=_0x4db9('0x19');return ami['Action'](_0x549c92)[_0x4db9('0x1a')](function(_0x3b0863){_0x3ac147({'code':0xc8,'message':_0x3b0863['message']});})['catch'](function(_0x493923){_0x34ec92(_0x19f2d3[_0x4db9('0x11')](0x1f5,_0x493923[_0x4db9('0x1b')]));});});},'Command':function(_0x48ff99){var _0x375515=this;return new Promise(function(_0x1f6b24,_0x353718){if(ami[_0x4db9('0x1c')]()==![]){return _0x353718(_0x375515[_0x4db9('0x11')](0x1f4,[config[_0x4db9('0x12')]['ip'],config[_0x4db9('0x12')][_0x4db9('0x13')],_0x4db9('0x14')][_0x4db9('0x1d')]('\x20')));}_0x48ff99=_[_0x4db9('0x15')](_0x48ff99,_0x4db9('0x1e'));_0x48ff99['action']=_0x4db9('0x1f');return ami[_0x4db9('0x20')](_0x48ff99)['then'](function(_0x37c81f){_0x1f6b24({'code':0xc8,'message':_0x37c81f[_0x4db9('0x21')]});})[_0x4db9('0x22')](function(_0x402898){_0x353718(_0x375515['error'](0x1f5,_0x402898[_0x4db9('0x1b')]));});});},'VoiceQueues':function(){return new Promise(function(_0x506cc9){var _0x1cf805=[];for(var _0x1c82b6 in _0x39eccb[_0x4db9('0x23')]){if(_0x39eccb[_0x4db9('0x23')][_0x4db9('0x24')](_0x1c82b6)){var _0x622db6=_0x39eccb[_0x4db9('0x23')][_0x1c82b6];var _0x5e7d29=new VoiceQueueSummary(_0x622db6);_0x1cf805['push'](_0x5e7d29);}}_0x506cc9({'count':_0x1cf805[_0x4db9('0x25')],'rows':_0x1cf805});});},'UpdateVoiceQueue':function(_0x5ce6cc){return new Promise(function(_0x910137,_0x2653be){var _0x38d5e2=_[_0x4db9('0x26')](_0x39eccb[_0x4db9('0x23')],{'id':parseInt(_0x5ce6cc['id'])});var _0x3c3fcf=_[_0x4db9('0x27')](_0x5ce6cc,['id']);if(_0x38d5e2){for(var _0x373a7d in _0x3c3fcf){if(typeof _0x3c3fcf[_0x373a7d]!=='undefined'&&typeof _0x38d5e2[_0x373a7d]!==_0x4db9('0x28')){_0x38d5e2[_0x373a7d]=_0x3c3fcf[_0x373a7d];}}_0x910137(_0x38d5e2);}else{_0x2653be();}});},'VoiceChannels':function(){return new Promise(function(_0x57c1af){var _0x3b0663=_[_0x4db9('0x29')](_0x39eccb[_0x4db9('0x2a')]);_0x57c1af({'count':_0x3b0663[_0x4db9('0x25')],'rows':_0x3b0663});});},'VoiceChannelMixMonitor':function(_0x341bc5){var _0x4b6130=this;return new Promise(function(_0x2d6d00,_0x7ef35){if(ami[_0x4db9('0x1c')]()==![]){return _0x7ef35(_0x4b6130[_0x4db9('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x4db9('0x13')],_0x4db9('0x14')]['join']('\x20')));}var _0x5e93aa=schema(properties[_0x4db9('0x2b')])['validate'](_0x341bc5);if(_0x5e93aa['length']>0x0){return _0x7ef35(_0x4b6130[_0x4db9('0x11')](0x1f4,_[_0x4db9('0x2c')](_0x5e93aa,'message')[_0x4db9('0x1d')](',\x20')));}var _0x11e27e=_[_0x4db9('0x26')](_0x39eccb[_0x4db9('0x2a')],{'uniqueid':_0x341bc5['uniqueid']});if(_0x11e27e&&_0x11e27e[_0x4db9('0x2d')]){var _0x4f3594=util['format']('%s.%s',_0x341bc5[_0x4db9('0x2e')]||_0x341bc5[_0x4db9('0x2f')],_0x341bc5['format']||_0x4db9('0x30'));return ami[_0x4db9('0x20')]({'action':'MixMonitor','channel':_0x11e27e['channel'],'file':_0x4f3594,'options':'ai(mixmonitorid)'})[_0x4db9('0x1a')](function(_0x52613e){var _0x29dc69=_['find'](_0x11e27e[_0x4db9('0x31')],{'filename':_0x4db9('0x32')+_0x4f3594[_0x4db9('0x33')]()});if(_[_0x4db9('0x34')](_0x29dc69)){_0x11e27e[_0x4db9('0x31')]['push']({'filename':_0x4db9('0x32')+_0x4f3594['toLowerCase'](),'createdAt':moment()[_0x4db9('0x7')](_0x4db9('0x35')),'mixmonitorid':_0x52613e[_0x4db9('0x36')],'status':_0x4db9('0x37')});}else{_0x29dc69[_0x4db9('0x36')]=_0x52613e[_0x4db9('0x36')];_0x29dc69['status']=_0x4db9('0x37');}_0x2d6d00({'code':0xc8,'message':[_0x341bc5[_0x4db9('0x2f')],'MixMonitor\x20Success',_0x52613e['mixmonitorid']][_0x4db9('0x1d')]('\x20'),'mixmonitorid':_0x52613e[_0x4db9('0x36')]});})[_0x4db9('0x22')](function(_0x2149ce){_0x7ef35(_0x4b6130[_0x4db9('0x11')](0x1f5,[_0x341bc5[_0x4db9('0x2f')],_0x2149ce[_0x4db9('0x1b')][_0x4db9('0x33')]()][_0x4db9('0x1d')]('\x20')));});}else{return _0x7ef35(_0x4b6130[_0x4db9('0x11')](0x1f5,_0x4db9('0x38')));}});},'VoiceChannelStopMixMonitor':function(_0x3254d1){var _0x489967=this;return new Promise(function(_0x2716d6,_0x4a2121){if(ami[_0x4db9('0x1c')]()==![]){return _0x4a2121(_0x489967[_0x4db9('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x4db9('0x13')],_0x4db9('0x14')][_0x4db9('0x1d')]('\x20')));}var _0x5ddcd4=schema(properties[_0x4db9('0x2b')])['validate'](_0x3254d1);if(_0x5ddcd4[_0x4db9('0x25')]>0x0){return _0x4a2121(_0x489967[_0x4db9('0x11')](0x1f4,_[_0x4db9('0x2c')](_0x5ddcd4,_0x4db9('0x1b'))[_0x4db9('0x1d')](',\x20')));}var _0x4eeff3=_[_0x4db9('0x26')](_0x39eccb[_0x4db9('0x2a')],{'uniqueid':_0x3254d1[_0x4db9('0x2f')]});if(_0x4eeff3){return Promise[_0x4db9('0x39')]()[_0x4db9('0x1a')](function(){if(_0x4eeff3['channel']){return ami[_0x4db9('0x20')]({'action':_0x4db9('0x3a'),'channel':_0x4eeff3[_0x4db9('0x2d')],'mixmonitorid':_0x3254d1[_0x4db9('0x36')]})[_0x4db9('0x22')](function(){});}})[_0x4db9('0x1a')](function(){if(_0x4eeff3[_0x4db9('0x3b')]){return ami[_0x4db9('0x20')]({'action':_0x4db9('0x3a'),'channel':_0x4eeff3['destinationchannel'],'mixmonitorid':_0x3254d1[_0x4db9('0x36')]})['catch'](function(){});}})['then'](function(){var _0x21d18d=_[_0x4db9('0x26')](_0x4eeff3['monitors'],{'mixmonitorid':_0x3254d1['mixmonitorid']});if(_0x21d18d){_0x21d18d[_0x4db9('0x3c')]=_0x4db9('0x3d');}})[_0x4db9('0x1a')](function(){var _0x7f0aac=util[_0x4db9('0x7')](_0x4db9('0x3e'),_0x3254d1[_0x4db9('0x2e')]||_0x3254d1[_0x4db9('0x2f')],_0x3254d1[_0x4db9('0x7')]||_0x4db9('0x30'));var _0x43312c=_['find'](_0x4eeff3[_0x4db9('0x31')],{'filename':_0x4db9('0x32')+_0x7f0aac['toLowerCase']()});if(_0x43312c){_0x43312c[_0x4db9('0x3c')]='stop';}})[_0x4db9('0x1a')](function(){_0x2716d6({'code':0xc8,'message':[_0x3254d1[_0x4db9('0x2f')],_0x4db9('0x3f')][_0x4db9('0x1d')]('\x20')});})[_0x4db9('0x22')](function(_0x19ff38){_0x4a2121(_0x489967[_0x4db9('0x11')](0x1f5,[_0x3254d1[_0x4db9('0x2f')],_0x19ff38[_0x4db9('0x1b')][_0x4db9('0x33')]()][_0x4db9('0x1d')]('\x20')));});}else{return _0x4a2121(_0x489967[_0x4db9('0x11')](0x1f5,_0x4db9('0x38')));}});},'VoiceQueuesChannels':function(_0x52d50a){var _0x47d2b6=this;return new Promise(function(_0x5ececc){var _0x161e2e=_['values'](_0x39eccb[_0x4db9('0x40')]);var _0x4c2842={'count':_0x161e2e[_0x4db9('0x25')],'rows':_0x161e2e};if(_0x52d50a&&_0x52d50a[_0x4db9('0x41')]){if(!['inbound','outbound'][_0x4db9('0x42')](_0x52d50a[_0x4db9('0x41')])){return _0x1dddb9(_0x47d2b6[_0x4db9('0x11')](0x190,_0x4db9('0x43')));}var _0x40b388=_[_0x4db9('0x44')](_0x161e2e,function(_0x1a563f){return _0x1a563f[_0x4db9('0x41')]===_0x52d50a['type'];});_0x4c2842[_0x4db9('0x45')]=_0x40b388[_0x4db9('0x25')];_0x4c2842[_0x4db9('0x46')]=_0x40b388;}_0x5ececc(_0x4c2842);});},'VoiceQueuesChannel':function(_0xcaf3aa){var _0x1a2046=this;return new Promise(function(_0x4b15ac,_0x319d69){var _0x351b61=schema(properties[_0x4db9('0x47')])['validate'](_0xcaf3aa);if(_0x351b61[_0x4db9('0x25')]>0x0){return _0x319d69(_0x1a2046[_0x4db9('0x11')](0x1f4,_[_0x4db9('0x2c')](_0x351b61,'message')[_0x4db9('0x1d')](',\x20')));}var _0x5d971f=_[_0x4db9('0x26')](_0x39eccb[_0x4db9('0x40')],{'uniqueid':_0xcaf3aa[_0x4db9('0x2f')]});if(_0x5d971f){_0x4b15ac(_0x5d971f);}else{return _0x319d69(_0x1a2046['error'](0x1f5,_0x4db9('0x38')));}});},'VoiceQueuesChannelHangup':function(_0x475ed6){var _0x5a8a1b=this;return new Promise(function(_0x4598b9,_0x37f635){if(ami[_0x4db9('0x1c')]()==![]){return _0x37f635(_0x5a8a1b[_0x4db9('0x11')](0x1f4,[config[_0x4db9('0x12')]['ip'],config[_0x4db9('0x12')][_0x4db9('0x13')],_0x4db9('0x14')]['join']('\x20')));}var _0x420a95=schema(properties[_0x4db9('0x48')])[_0x4db9('0x49')](_0x475ed6);if(_0x420a95['length']>0x0){return _0x37f635(_0x5a8a1b[_0x4db9('0x11')](0x1f4,_[_0x4db9('0x2c')](_0x420a95,_0x4db9('0x1b'))[_0x4db9('0x1d')](',\x20')));}var _0x58cf13=_[_0x4db9('0x26')](_0x39eccb[_0x4db9('0x40')],{'uniqueid':_0x475ed6[_0x4db9('0x2f')]});if(_0x58cf13&&_0x58cf13[_0x4db9('0x2d')]){return ami[_0x4db9('0x20')]({'action':_0x4db9('0x4a'),'channel':_0x58cf13[_0x4db9('0x2d')]})[_0x4db9('0x1a')](function(_0x54abdd){_0x4598b9({'code':0xc8,'message':[_0x475ed6[_0x4db9('0x2f')],_0x54abdd[_0x4db9('0x1b')][_0x4db9('0x33')]()]['join']('\x20')});})['catch'](function(_0x3e41c){_0x37f635(_0x5a8a1b[_0x4db9('0x11')](0x1f5,[_0x475ed6['uniqueid'],_0x3e41c[_0x4db9('0x1b')]['toLowerCase']()][_0x4db9('0x1d')]('\x20')));});}else{return _0x37f635(_0x5a8a1b[_0x4db9('0x11')](0x1f5,_0x4db9('0x38')));}});},'VoiceQueuesChannelRedirect':function(_0x3abcc4){var _0x471a49=this;return new Promise(function(_0x2024ec,_0x325523){if(ami[_0x4db9('0x1c')]()==![]){return _0x325523(_0x471a49['error'](0x1f4,[config[_0x4db9('0x12')]['ip'],config[_0x4db9('0x12')][_0x4db9('0x13')],_0x4db9('0x14')][_0x4db9('0x1d')]('\x20')));}var _0x3ae99c=schema(properties[_0x4db9('0x4b')])[_0x4db9('0x49')](_0x3abcc4);if(_0x3ae99c['length']>0x0){return _0x325523(_0x471a49[_0x4db9('0x11')](0x1f4,_['map'](_0x3ae99c,'message')['join'](',\x20')));}var _0x3bb18f=_[_0x4db9('0x26')](_0x39eccb[_0x4db9('0x40')],{'uniqueid':_0x3abcc4[_0x4db9('0x2f')]});if(_0x3bb18f&&_0x3bb18f[_0x4db9('0x2d')]){return ami[_0x4db9('0x20')]({'action':_0x4db9('0x4c'),'channel':_0x3bb18f[_0x4db9('0x2d')],'exten':_0x3abcc4['exten'],'context':_0x3abcc4['context']||_0x3bb18f['context'],'priority':0x1})['then'](function(_0x339122){_0x2024ec({'code':0xc8,'message':[_0x3abcc4[_0x4db9('0x2f')],_0x339122[_0x4db9('0x1b')][_0x4db9('0x33')]()][_0x4db9('0x1d')]('\x20')});})[_0x4db9('0x22')](function(_0x3fe61c){_0x325523(_0x471a49[_0x4db9('0x11')](0x1f5,[_0x3abcc4['uniqueid'],_0x3fe61c[_0x4db9('0x1b')][_0x4db9('0x33')]()][_0x4db9('0x1d')]('\x20')));});}else{return _0x325523(_0x471a49['error'](0x1f5,_0x4db9('0x38')));}});},'Agents':function(_0x553182){return new Promise(function(_0x54fc62){var _0x5d6829=_['values'](_0x39eccb[_0x4db9('0xe')]);if(_0x553182&&_0x553182['id']){var _0x433e4f=_['find'](_0x5d6829,function(_0x40984f){return _0x40984f['id']===_0x553182['id'];});_0x54fc62(_0x433e4f);}else{_0x54fc62({'count':_0x5d6829[_0x4db9('0x25')],'rows':_0x5d6829});}});},'Telephones':function(){return new Promise(function(_0x34eb34){var _0x302b5b=_[_0x4db9('0x29')](_0x39eccb['telephones']);_0x34eb34({'count':_0x302b5b['length'],'rows':_0x302b5b});});},'Trunks':function(){return new Promise(function(_0x5975e7){var _0x92b8a0=_['values'](_0x39eccb[_0x4db9('0x4d')]);_0x5975e7({'count':_0x92b8a0['length'],'rows':_0x92b8a0});});},'OutboundChannels':function(){return new Promise(function(_0x3bc13f){var _0x13fa02=_[_0x4db9('0x29')](_0x39eccb['outboundChannels']);_0x3bc13f({'count':_0x13fa02[_0x4db9('0x25')],'rows':_0x13fa02});});},'Outbound':function(){return new Promise(function(_0x5ef663){_0x5ef663(_0x39eccb['outbound']);});},'Campaigns':function(){return new Promise(function(_0xd4f320){var _0x203403=_[_0x4db9('0x29')](_0x39eccb['campaigns']);_0xd4f320({'count':_0x203403[_0x4db9('0x25')],'rows':_0x203403});});},'VoiceQueuesPreview':function(_0x53395c){var _0x5667d2=this;return new Promise(function(_0x69f158,_0x28696c){_0x541226[_0x4db9('0x4e')](_0x53395c['id'])[_0x4db9('0x1a')](function(_0x2dd788){_0x69f158({'code':0xc8,'message':_0x2dd788[_0x4db9('0x1b')]});})['catch'](function(_0x1bbb22){_0x28696c(_0x5667d2[_0x4db9('0x11')](0x1f4,_0x1bbb22[_0x4db9('0x1b')]));});});},'EventManager':function(_0xcef195){var _0x4f0f59=this;return new Promise(function(_0x79177d,_0x47449b){if(!_0xcef195['event']){return _0x47449b(_0x4f0f59[_0x4db9('0x11')](0x1f4,_0x4db9('0x4f')));}ami['emit'](_0x4db9('0x50')+_0xcef195[_0x4db9('0x51')],_0xcef195[_0x4db9('0x1b')]);_0x79177d({'code':0xc8,'message':_0xcef195});});},'FaxAccounts':function(){return new Promise(function(_0xe62afd){var _0x5459b4=_[_0x4db9('0x29')](_0x39eccb['faxAccounts']);_0xe62afd({'count':_0x5459b4[_0x4db9('0x25')],'rows':_0x5459b4});});},'SendFax':function(_0x1643b1){var _0x390319=this;return new Promise(function(_0x34c2af,_0x5df6c2){_0x1d21a8['send'](_0x1643b1)[_0x4db9('0x1a')](function(_0x1b6f96){_0x34c2af({'code':0xc8,'message':_0x1b6f96[_0x4db9('0x1b')]});})[_0x4db9('0x22')](function(_0x43e147){_0x5df6c2(_0x390319[_0x4db9('0x11')](0x1f4,_0x43e147[_0x4db9('0x1b')]));});});},'CheckAfterSend':function(_0x582a04){var _0x435026=this;return new Promise(function(_0x335b9e,_0xf6e17d){_0x1d21a8[_0x4db9('0x52')](_0x582a04)['then'](function(_0x7a3928){_0x335b9e({'code':0xc8,'message':_0x7a3928[_0x4db9('0x1b')]});})[_0x4db9('0x22')](function(_0x3dbb18){_0xf6e17d(_0x435026[_0x4db9('0x11')](0x1f4,_0x3dbb18[_0x4db9('0x1b')]));});});}};var _0x2b1c59=jayson[_0x4db9('0x53')](_0x3404f6)[_0x4db9('0x54')]();_0x2b1c59['on'](_0x4db9('0x11'),function(_0x208e20){return _0x1dddb9(_0x208e20);});_0x2b1c59[_0x4db9('0x55')](0x232a,_0x4db9('0x56'),function(){console[_0x4db9('0x57')](_0x4db9('0x58'),0x232a);return _0xc76bc1('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x2675=['outbound','includes','filter','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','values','trunks','run','emit','custom:','event','faxAccounts','send','checkAfterSend','server','http','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','moment','../../../config/environment','../ami','../model/voiceQueueSummary','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','pick','keys','reload','module','action','Reload','Action','then','message','catch','join','command','Command','voiceQueues','hasOwnProperty','push','find','omit','undefined','length','ami\x20disconnected','voicechannel','validate','map','channels','uniqueid','channel','%s.%s','filename','format','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','type','inbound'];(function(_0x541095,_0x582b30){var _0x5a2c40=function(_0xb7650f){while(--_0xb7650f){_0x541095['push'](_0x541095['shift']());}};_0x5a2c40(++_0x582b30);}(_0x2675,0x75));var _0x5267=function(_0x369826,_0x110b43){_0x369826=_0x369826-0x0;var _0xcc4c29=_0x2675[_0x369826];return _0xcc4c29;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var moment=require(_0x5267('0x1'));var config=require(_0x5267('0x2'));var properties=require('../properties');var ami=require(_0x5267('0x3'));var VoiceQueueSummary=require(_0x5267('0x4'));exports['listen']=function(_0x328776,_0xf2b350,_0x4bd042){return new Promise(function(_0x10f92c,_0x20f065){var _0xc56cd5={'QueuePause':function(_0x527c16){return new Promise(function(_0x9e0a27){var _0x46bfdf=util['format'](_0x5267('0x5'),'SIP',_0x527c16[_0x5267('0x6')]);if(_0x328776[_0x5267('0x7')]&&_0x328776[_0x5267('0x7')][_0x46bfdf]&&_0x328776['timers'][_0x46bfdf][_0x5267('0x8')]){_0x328776['timers'][_0x46bfdf][_0x5267('0x9')]();}if(_0x328776['agents'][_0x46bfdf]){_0x328776[_0x5267('0xa')][_0x46bfdf][_0x5267('0xb')]({'statePause':_0x527c16[_0x5267('0xc')]?!![]:![]});}_0x9e0a27({'code':0xc8,'message':_0x5267('0xd')});});},'Reload':function(_0x1d7090){var _0x1171b9=this;return new Promise(function(_0x20785c,_0x36dc17){if(ami[_0x5267('0xe')]()==![]){return _0x36dc17(_0x1171b9[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')][_0x5267('0x11')],'ami\x20disconnected']['join']('\x20')));}_0x1d7090=_[_0x5267('0x12')](_0x1d7090,_[_0x5267('0x13')](properties[_0x5267('0x14')][_0x5267('0x15')]));_0x1d7090[_0x5267('0x16')]=_0x5267('0x17');return ami[_0x5267('0x18')](_0x1d7090)[_0x5267('0x19')](function(_0x15d81e){_0x20785c({'code':0xc8,'message':_0x15d81e[_0x5267('0x1a')]});})[_0x5267('0x1b')](function(_0x1ab03){_0x36dc17(_0x1171b9['error'](0x1f5,_0x1ab03[_0x5267('0x1a')]));});});},'Command':function(_0x2afd38){var _0x5069e8=this;return new Promise(function(_0x20cb50,_0x56733e){if(ami[_0x5267('0xe')]()==![]){return _0x56733e(_0x5069e8[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')][_0x5267('0x11')],'ami\x20disconnected'][_0x5267('0x1c')]('\x20')));}_0x2afd38=_['pick'](_0x2afd38,_0x5267('0x1d'));_0x2afd38[_0x5267('0x16')]=_0x5267('0x1e');return ami['Action'](_0x2afd38)['then'](function(_0x5546e2){_0x20cb50({'code':0xc8,'message':_0x5546e2['content']});})['catch'](function(_0x26c7f8){_0x56733e(_0x5069e8[_0x5267('0xf')](0x1f5,_0x26c7f8[_0x5267('0x1a')]));});});},'VoiceQueues':function(){return new Promise(function(_0x279377){var _0x11c8ea=[];for(var _0x40d1be in _0x328776[_0x5267('0x1f')]){if(_0x328776[_0x5267('0x1f')][_0x5267('0x20')](_0x40d1be)){var _0x59f112=_0x328776['voiceQueues'][_0x40d1be];var _0x354111=new VoiceQueueSummary(_0x59f112);_0x11c8ea[_0x5267('0x21')](_0x354111);}}_0x279377({'count':_0x11c8ea['length'],'rows':_0x11c8ea});});},'UpdateVoiceQueue':function(_0x45373e){return new Promise(function(_0x52504e,_0x4d7c2a){var _0x43e7e7=_[_0x5267('0x22')](_0x328776[_0x5267('0x1f')],{'id':parseInt(_0x45373e['id'])});var _0x2d2ace=_[_0x5267('0x23')](_0x45373e,['id']);if(_0x43e7e7){for(var _0x4f3d4d in _0x2d2ace){if(typeof _0x2d2ace[_0x4f3d4d]!=='undefined'&&typeof _0x43e7e7[_0x4f3d4d]!==_0x5267('0x24')){_0x43e7e7[_0x4f3d4d]=_0x2d2ace[_0x4f3d4d];}}_0x52504e(_0x43e7e7);}else{_0x4d7c2a();}});},'VoiceChannels':function(){return new Promise(function(_0x10a68c){var _0x24496d=_['values'](_0x328776['channels']);_0x10a68c({'count':_0x24496d[_0x5267('0x25')],'rows':_0x24496d});});},'VoiceChannelMixMonitor':function(_0x3ef2a8){var _0x1fa725=this;return new Promise(function(_0x5bec7e,_0x59b091){if(ami[_0x5267('0xe')]()==![]){return _0x59b091(_0x1fa725[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')]['username'],_0x5267('0x26')][_0x5267('0x1c')]('\x20')));}var _0x4344c5=schema(properties[_0x5267('0x27')])[_0x5267('0x28')](_0x3ef2a8);if(_0x4344c5[_0x5267('0x25')]>0x0){return _0x59b091(_0x1fa725[_0x5267('0xf')](0x1f4,_[_0x5267('0x29')](_0x4344c5,'message')['join'](',\x20')));}var _0x39e309=_['find'](_0x328776[_0x5267('0x2a')],{'uniqueid':_0x3ef2a8[_0x5267('0x2b')]});if(_0x39e309&&_0x39e309[_0x5267('0x2c')]){var _0x3a729c=util['format'](_0x5267('0x2d'),_0x3ef2a8[_0x5267('0x2e')]||_0x3ef2a8[_0x5267('0x2b')],_0x3ef2a8[_0x5267('0x2f')]||_0x5267('0x30'));return ami[_0x5267('0x18')]({'action':_0x5267('0x31'),'channel':_0x39e309[_0x5267('0x2c')],'file':_0x3a729c,'options':'ai(mixmonitorid)'})[_0x5267('0x19')](function(_0x4fdee0){var _0x391235=_[_0x5267('0x22')](_0x39e309[_0x5267('0x32')],{'filename':_0x5267('0x33')+_0x3a729c[_0x5267('0x34')]()});if(_[_0x5267('0x35')](_0x391235)){_0x39e309[_0x5267('0x32')]['push']({'filename':_0x5267('0x33')+_0x3a729c[_0x5267('0x34')](),'createdAt':moment()[_0x5267('0x2f')](_0x5267('0x36')),'mixmonitorid':_0x4fdee0[_0x5267('0x37')],'status':_0x5267('0x38')});}else{_0x391235[_0x5267('0x37')]=_0x4fdee0['mixmonitorid'];_0x391235[_0x5267('0x39')]='rec';}_0x5bec7e({'code':0xc8,'message':[_0x3ef2a8[_0x5267('0x2b')],'MixMonitor\x20Success',_0x4fdee0['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x4fdee0[_0x5267('0x37')]});})['catch'](function(_0xf33688){_0x59b091(_0x1fa725[_0x5267('0xf')](0x1f5,[_0x3ef2a8[_0x5267('0x2b')],_0xf33688[_0x5267('0x1a')]['toLowerCase']()][_0x5267('0x1c')]('\x20')));});}else{return _0x59b091(_0x1fa725[_0x5267('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x54a5e5){var _0x3e1483=this;return new Promise(function(_0x560cdf,_0x12df83){if(ami[_0x5267('0xe')]()==![]){return _0x12df83(_0x3e1483[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')][_0x5267('0x11')],_0x5267('0x26')]['join']('\x20')));}var _0x50736e=schema(properties[_0x5267('0x27')])['validate'](_0x54a5e5);if(_0x50736e[_0x5267('0x25')]>0x0){return _0x12df83(_0x3e1483[_0x5267('0xf')](0x1f4,_['map'](_0x50736e,_0x5267('0x1a'))[_0x5267('0x1c')](',\x20')));}var _0x299a13=_[_0x5267('0x22')](_0x328776[_0x5267('0x2a')],{'uniqueid':_0x54a5e5[_0x5267('0x2b')]});if(_0x299a13){return Promise[_0x5267('0x3a')]()[_0x5267('0x19')](function(){if(_0x299a13[_0x5267('0x2c')]){return ami['Action']({'action':_0x5267('0x3b'),'channel':_0x299a13[_0x5267('0x2c')],'mixmonitorid':_0x54a5e5[_0x5267('0x37')]})[_0x5267('0x1b')](function(){});}})[_0x5267('0x19')](function(){if(_0x299a13['destinationchannel']){return ami[_0x5267('0x18')]({'action':'StopMixMonitor','channel':_0x299a13[_0x5267('0x3c')],'mixmonitorid':_0x54a5e5['mixmonitorid']})['catch'](function(){});}})[_0x5267('0x19')](function(){var _0x56d33f=_[_0x5267('0x22')](_0x299a13[_0x5267('0x32')],{'mixmonitorid':_0x54a5e5[_0x5267('0x37')]});if(_0x56d33f){_0x56d33f[_0x5267('0x39')]='stop';}})[_0x5267('0x19')](function(){var _0x4ee826=util['format'](_0x5267('0x2d'),_0x54a5e5[_0x5267('0x2e')]||_0x54a5e5['uniqueid'],_0x54a5e5['format']||_0x5267('0x30'));var _0xe0439e=_[_0x5267('0x22')](_0x299a13[_0x5267('0x32')],{'filename':_0x5267('0x33')+_0x4ee826[_0x5267('0x34')]()});if(_0xe0439e){_0xe0439e[_0x5267('0x39')]=_0x5267('0x3d');}})[_0x5267('0x19')](function(){_0x560cdf({'code':0xc8,'message':[_0x54a5e5[_0x5267('0x2b')],_0x5267('0x3e')][_0x5267('0x1c')]('\x20')});})[_0x5267('0x1b')](function(_0x4693d9){_0x12df83(_0x3e1483['error'](0x1f5,[_0x54a5e5[_0x5267('0x2b')],_0x4693d9[_0x5267('0x1a')][_0x5267('0x34')]()]['join']('\x20')));});}else{return _0x12df83(_0x3e1483[_0x5267('0xf')](0x1f5,_0x5267('0x3f')));}});},'VoiceQueuesChannels':function(_0x31b722){var _0x2a97f1=this;return new Promise(function(_0x119546){var _0x1457cf=_['values'](_0x328776[_0x5267('0x40')]);var _0x5318d0={'count':_0x1457cf[_0x5267('0x25')],'rows':_0x1457cf};if(_0x31b722&&_0x31b722[_0x5267('0x41')]){if(![_0x5267('0x42'),_0x5267('0x43')][_0x5267('0x44')](_0x31b722[_0x5267('0x41')])){return _0x20f065(_0x2a97f1[_0x5267('0xf')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x57ca8f=_[_0x5267('0x45')](_0x1457cf,function(_0x15b5c9){return _0x15b5c9['type']===_0x31b722[_0x5267('0x41')];});_0x5318d0['count']=_0x57ca8f['length'];_0x5318d0[_0x5267('0x46')]=_0x57ca8f;}_0x119546(_0x5318d0);});},'VoiceQueuesChannel':function(_0x79cee1){var _0x1b11e4=this;return new Promise(function(_0x194519,_0x2be9da){var _0x3e7e6a=schema(properties[_0x5267('0x47')])[_0x5267('0x28')](_0x79cee1);if(_0x3e7e6a[_0x5267('0x25')]>0x0){return _0x2be9da(_0x1b11e4[_0x5267('0xf')](0x1f4,_['map'](_0x3e7e6a,_0x5267('0x1a'))[_0x5267('0x1c')](',\x20')));}var _0x3c7c37=_[_0x5267('0x22')](_0x328776[_0x5267('0x40')],{'uniqueid':_0x79cee1[_0x5267('0x2b')]});if(_0x3c7c37){_0x194519(_0x3c7c37);}else{return _0x2be9da(_0x1b11e4['error'](0x1f5,_0x5267('0x3f')));}});},'VoiceQueuesChannelHangup':function(_0x5ad1ce){var _0x1522d6=this;return new Promise(function(_0x3b0b6a,_0x19fd1c){if(ami['isConnected']()==![]){return _0x19fd1c(_0x1522d6[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')][_0x5267('0x11')],_0x5267('0x26')][_0x5267('0x1c')]('\x20')));}var _0x4e809c=schema(properties[_0x5267('0x48')])[_0x5267('0x28')](_0x5ad1ce);if(_0x4e809c[_0x5267('0x25')]>0x0){return _0x19fd1c(_0x1522d6[_0x5267('0xf')](0x1f4,_['map'](_0x4e809c,'message')[_0x5267('0x1c')](',\x20')));}var _0x5393e9=_[_0x5267('0x22')](_0x328776[_0x5267('0x40')],{'uniqueid':_0x5ad1ce['uniqueid']});if(_0x5393e9&&_0x5393e9['channel']){return ami[_0x5267('0x18')]({'action':_0x5267('0x49'),'channel':_0x5393e9[_0x5267('0x2c')]})['then'](function(_0x457dca){_0x3b0b6a({'code':0xc8,'message':[_0x5ad1ce[_0x5267('0x2b')],_0x457dca[_0x5267('0x1a')][_0x5267('0x34')]()]['join']('\x20')});})['catch'](function(_0x540ab8){_0x19fd1c(_0x1522d6[_0x5267('0xf')](0x1f5,[_0x5ad1ce[_0x5267('0x2b')],_0x540ab8[_0x5267('0x1a')][_0x5267('0x34')]()][_0x5267('0x1c')]('\x20')));});}else{return _0x19fd1c(_0x1522d6[_0x5267('0xf')](0x1f5,_0x5267('0x3f')));}});},'VoiceQueuesChannelRedirect':function(_0x7c513c){var _0x486b02=this;return new Promise(function(_0x1ddfad,_0x667b5d){if(ami['isConnected']()==![]){return _0x667b5d(_0x486b02[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')][_0x5267('0x11')],_0x5267('0x26')][_0x5267('0x1c')]('\x20')));}var _0x4915f4=schema(properties[_0x5267('0x4a')])[_0x5267('0x28')](_0x7c513c);if(_0x4915f4[_0x5267('0x25')]>0x0){return _0x667b5d(_0x486b02[_0x5267('0xf')](0x1f4,_[_0x5267('0x29')](_0x4915f4,_0x5267('0x1a'))['join'](',\x20')));}var _0x4222e8=_[_0x5267('0x22')](_0x328776[_0x5267('0x40')],{'uniqueid':_0x7c513c[_0x5267('0x2b')]});if(_0x4222e8&&_0x4222e8[_0x5267('0x2c')]){return ami[_0x5267('0x18')]({'action':'Redirect','channel':_0x4222e8[_0x5267('0x2c')],'exten':_0x7c513c[_0x5267('0x4b')],'context':_0x7c513c[_0x5267('0x4c')]||_0x4222e8[_0x5267('0x4c')],'priority':0x1})['then'](function(_0x516e6e){_0x1ddfad({'code':0xc8,'message':[_0x7c513c['uniqueid'],_0x516e6e[_0x5267('0x1a')]['toLowerCase']()][_0x5267('0x1c')]('\x20')});})['catch'](function(_0x3992b2){_0x667b5d(_0x486b02[_0x5267('0xf')](0x1f5,[_0x7c513c[_0x5267('0x2b')],_0x3992b2[_0x5267('0x1a')][_0x5267('0x34')]()][_0x5267('0x1c')]('\x20')));});}else{return _0x667b5d(_0x486b02[_0x5267('0xf')](0x1f5,_0x5267('0x3f')));}});},'Agents':function(_0x489b9a){return new Promise(function(_0x489f46){var _0x5853e9=_[_0x5267('0x4d')](_0x328776[_0x5267('0xa')]);if(_0x489b9a&&_0x489b9a['id']){var _0x2ab2be=_[_0x5267('0x22')](_0x5853e9,function(_0x4974d1){return _0x4974d1['id']===_0x489b9a['id'];});_0x489f46(_0x2ab2be);}else{_0x489f46({'count':_0x5853e9[_0x5267('0x25')],'rows':_0x5853e9});}});},'Telephones':function(){return new Promise(function(_0x3c17de){var _0x3c547f=_[_0x5267('0x4d')](_0x328776['telephones']);_0x3c17de({'count':_0x3c547f[_0x5267('0x25')],'rows':_0x3c547f});});},'Trunks':function(){return new Promise(function(_0x2c3904){var _0x50a5e6=_[_0x5267('0x4d')](_0x328776[_0x5267('0x4e')]);_0x2c3904({'count':_0x50a5e6['length'],'rows':_0x50a5e6});});},'OutboundChannels':function(){return new Promise(function(_0x47e235){var _0x1521c4=_[_0x5267('0x4d')](_0x328776['outboundChannels']);_0x47e235({'count':_0x1521c4['length'],'rows':_0x1521c4});});},'Outbound':function(){return new Promise(function(_0xc1fca9){_0xc1fca9(_0x328776[_0x5267('0x43')]);});},'Campaigns':function(){return new Promise(function(_0x35b302){var _0x14bc66=_[_0x5267('0x4d')](_0x328776['campaigns']);_0x35b302({'count':_0x14bc66[_0x5267('0x25')],'rows':_0x14bc66});});},'VoiceQueuesPreview':function(_0x2c5d28){var _0x538786=this;return new Promise(function(_0x26c628,_0x12cdfe){_0xf2b350[_0x5267('0x4f')](_0x2c5d28['id'])[_0x5267('0x19')](function(_0xb8c52c){_0x26c628({'code':0xc8,'message':_0xb8c52c[_0x5267('0x1a')]});})[_0x5267('0x1b')](function(_0x84ff5){_0x12cdfe(_0x538786['error'](0x1f4,_0x84ff5['message']));});});},'EventManager':function(_0x1ac20f){var _0xbf7a4c=this;return new Promise(function(_0x3f729f,_0x3a6ad7){if(!_0x1ac20f['event']){return _0x3a6ad7(_0xbf7a4c[_0x5267('0xf')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x5267('0x50')](_0x5267('0x51')+_0x1ac20f[_0x5267('0x52')],_0x1ac20f[_0x5267('0x1a')]);_0x3f729f({'code':0xc8,'message':_0x1ac20f});});},'FaxAccounts':function(){return new Promise(function(_0x579f88){var _0x4fb8f3=_[_0x5267('0x4d')](_0x328776[_0x5267('0x53')]);_0x579f88({'count':_0x4fb8f3[_0x5267('0x25')],'rows':_0x4fb8f3});});},'SendFax':function(_0x360a1b){var _0x162506=this;return new Promise(function(_0x371302,_0x5e1ba4){_0x4bd042[_0x5267('0x54')](_0x360a1b)['then'](function(_0x418a03){_0x371302({'code':0xc8,'message':_0x418a03['message']});})[_0x5267('0x1b')](function(_0x20888d){_0x5e1ba4(_0x162506[_0x5267('0xf')](0x1f4,_0x20888d[_0x5267('0x1a')]));});});},'CheckAfterSend':function(_0x164cc1){var _0x1ccb6c=this;return new Promise(function(_0x449c4d,_0x256228){_0x4bd042[_0x5267('0x55')](_0x164cc1)[_0x5267('0x19')](function(_0x555c8){_0x449c4d({'code':0xc8,'message':_0x555c8['message']});})[_0x5267('0x1b')](function(_0x14baf4){_0x256228(_0x1ccb6c['error'](0x1f4,_0x14baf4[_0x5267('0x1a')]));});});}};var _0x18d985=jayson[_0x5267('0x56')](_0xc56cd5)[_0x5267('0x57')]();_0x18d985['on'](_0x5267('0xf'),function(_0x37b007){return _0x20f065(_0x37b007);});_0x18d985[_0x5267('0x58')](0x232a,'127.0.0.1',function(){console[_0x5267('0x59')](_0x5267('0x5a'),0x232a);return _0x10f92c(_0x5267('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 04189f0..e75a555 100644 --- a/server/services/ami/trigger/cmContact/index.js +++ b/server/services/ami/trigger/cmContact/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c06=['../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','updatedAt','resolve','then','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','user:%s','format','action','toLowerCase','merge','lodash','bluebird','ioredis','util'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x0c06,0x158));var _0x60c0=function(_0x3cff58,_0x2d79f9){_0x3cff58=_0x3cff58-0x0;var _0x2a52f2=_0x0c06[_0x3cff58];return _0x2a52f2;};'use strict';var _=require(_0x60c0('0x0'));var BPromise=require(_0x60c0('0x1'));var Redis=require(_0x60c0('0x2'));var util=require(_0x60c0('0x3'));var config=require(_0x60c0('0x4'));var logger=require(_0x60c0('0x5'))('trigger');var cmContactRpc=require(_0x60c0('0x6'));config[_0x60c0('0x7')]=_[_0x60c0('0x8')](config[_0x60c0('0x7')],{'host':_0x60c0('0x9'),'port':0x18eb});var io=require(_0x60c0('0xa'))(new Redis(config['redis']));function emit(_0x5035cd,_0x602a70,_0x147032,_0x54e064,_0x2932ec){logger[_0x60c0('0xb')](_0x60c0('0xc'),_0x5035cd,_0x602a70['id'],_0x147032,_0x54e064,JSON[_0x60c0('0xd')](_0x2932ec));io['to'](_0x147032)[_0x60c0('0xe')](_0x54e064,_0x2932ec);}exports['exec']=function(_0x5a7d3d,_0x1d6cf6,_0x495400,_0x4e93cd){var _0x1287ea,_0x306d9b;var _0x31fe68={};var _0x56117b;var _0x41ad06=Number(_0x495400[_0x60c0('0xf')]);var _0x469c6a=_0x495400[_0x60c0('0x10')]?Boolean(Number(_0x495400[_0x60c0('0x10')])):![];var _0x29f273;var _0x24097e=![];if(!_['isNil'](_0x495400['data5'])){if(_0x495400[_0x60c0('0x11')]=='1')_0x24097e=!![];}if(!_0x24097e){if(_0x4e93cd[_0x60c0('0x12')]){_0x31fe68['id']=_0x4e93cd[_0x60c0('0x12')];}}if(!_0x31fe68['id']){_0x31fe68[_0x60c0('0x13')]=_0x41ad06;_0x29f273=_0x495400[_0x60c0('0x14')]&&_0x495400['data3']!=='0'?_0x495400[_0x60c0('0x14')][_0x60c0('0x15')](','):[_0x60c0('0x16')];_0x31fe68[_0x60c0('0x17')]=_[_0x60c0('0x18')](_0x29f273,function(_0x5b44e9){var _0x11fd4b={};_0x11fd4b[_0x5b44e9]=_0x4e93cd[_0x60c0('0x19')]?_0x4e93cd[_0x60c0('0x1a')]:_0x4e93cd[_0x60c0('0x1b')];return _0x11fd4b;});_0x56117b=_0x4e93cd[_0x60c0('0x19')]?_0x4e93cd['destcalleridnum']:_0x4e93cd[_0x60c0('0x1b')];}var _0x524fba=['id',_0x60c0('0x1c'),_0x60c0('0x1d'),_0x60c0('0x16'),_0x60c0('0x1e'),'fax',_0x60c0('0x13'),_0x60c0('0x1f'),'scheduledAt',_0x60c0('0x20')];var _0x36bb98=_['union'](_0x524fba,_0x29f273);BPromise[_0x60c0('0x21')]()[_0x60c0('0x22')](cmContactRpc[_0x60c0('0x23')]({'attributes':_0x36bb98,'where':_0x31fe68,'phone':_0x56117b}))[_0x60c0('0x22')](function(_0x1c565b){_0x306d9b=_0x1c565b;if(!_[_0x60c0('0x24')](_0x306d9b)){if(_0x306d9b[_0x60c0('0x25')]===0x1){_0x1287ea=_0x306d9b[0x0];logger[_0x60c0('0xb')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x4e93cd[_0x60c0('0x26')],_0x1d6cf6['id'],_0x1287ea['id']);}else{logger[_0x60c0('0xb')](_0x60c0('0x27'),_0x4e93cd[_0x60c0('0x26')],_0x1d6cf6['id'],_['map'](_0x306d9b,'id')[_0x60c0('0x28')](','));}return;}else{logger[_0x60c0('0xb')](_0x60c0('0x29'),_0x4e93cd[_0x60c0('0x26')],_0x1d6cf6['id']);var _0x532312={'ListId':_0x41ad06};var _0x576025=_0x495400['data4']&&_0x495400['data4']!=='0'?_0x495400[_0x60c0('0x2a')]:_0x60c0('0x16');if(_0x469c6a){logger['info'](_0x60c0('0x2b'),_0x4e93cd['uniqueid'],_0x1d6cf6['id']);_0x532312[_0x576025]=_['isNil'](_0x4e93cd['routeId'])?_0x4e93cd[_0x60c0('0x1b')]:_0x4e93cd['destcalleridnum'];if(_[_0x60c0('0x2c')](_0x4e93cd[_0x60c0('0x19')])){_0x532312[_0x60c0('0x1c')]=_0x4e93cd[_0x60c0('0x2d')]&&_0x4e93cd[_0x60c0('0x2d')]!==_0x60c0('0x2e')?_0x4e93cd[_0x60c0('0x2d')]:_0x60c0('0x2f');}else{_0x532312[_0x60c0('0x1c')]=_0x4e93cd['destcalleridname']&&_0x4e93cd[_0x60c0('0x30')]!==_0x60c0('0x2e')?_0x4e93cd[_0x60c0('0x30')]:_0x60c0('0x2f');}return BPromise[_0x60c0('0x21')]()['then'](cmContactRpc[_0x60c0('0x31')](_0x532312))['then'](function(_0x210457){_0x1287ea=_0x210457;_0x306d9b['push'](_0x210457);if(_0x1287ea){logger[_0x60c0('0xb')](_0x60c0('0x32'),_0x4e93cd[_0x60c0('0x26')],_0x1d6cf6['id'],_0x1287ea['id']);}return;});}else{logger[_0x60c0('0xb')](_0x60c0('0x33'),_0x4e93cd['uniqueid'],_0x1d6cf6['id']);_0x532312[_0x576025]=_[_0x60c0('0x2c')](_0x4e93cd[_0x60c0('0x19')])?_0x4e93cd[_0x60c0('0x1b')]:_0x4e93cd['destcalleridnum'];if(_[_0x60c0('0x2c')](_0x4e93cd[_0x60c0('0x19')])){_0x532312[_0x60c0('0x1c')]=_0x4e93cd[_0x60c0('0x2d')]&&_0x4e93cd['calleridname']!==_0x60c0('0x2e')?_0x4e93cd[_0x60c0('0x2d')]:_0x60c0('0x2f');}else{_0x532312[_0x60c0('0x1c')]=_0x4e93cd['destcalleridname']&&_0x4e93cd[_0x60c0('0x30')]!==_0x60c0('0x2e')?_0x4e93cd[_0x60c0('0x30')]:'Unknown';}_0x1287ea=_0x532312;_0x306d9b[_0x60c0('0x34')](_0x532312);return;}}})[_0x60c0('0x22')](function(){if(_0x5a7d3d){emit(_0x4e93cd[_0x60c0('0x26')],_0x1d6cf6,util['format'](_0x60c0('0x35'),_0x5a7d3d['name']),util[_0x60c0('0x36')]('trigger:%s',_0x495400[_0x60c0('0x37')][_0x60c0('0x38')]()),{'evt':_[_0x60c0('0x39')](_0x4e93cd,{'autoCreate':_0x469c6a}),'contact':_0x1287ea===undefined?{}:_0x1287ea,'contacts':_0x306d9b[_0x60c0('0x25')]===0x0?undefined:_0x306d9b});}});}; \ No newline at end of file +var _0x9825=['[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','','resolve','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','name','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','exec','data1','data2','data5','xmd-contactid','ListId','data3','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','then','getContacts','isEmpty','length','info','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','data4'];(function(_0x388da2,_0x571cad){var _0x2b1a45=function(_0x10f0e2){while(--_0x10f0e2){_0x388da2['push'](_0x388da2['shift']());}};_0x2b1a45(++_0x571cad);}(_0x9825,0x19f));var _0x5982=function(_0x5b9cfe,_0x34be08){_0x5b9cfe=_0x5b9cfe-0x0;var _0x38bb6b=_0x9825[_0x5b9cfe];return _0x38bb6b;};'use strict';var _=require('lodash');var BPromise=require(_0x5982('0x0'));var Redis=require(_0x5982('0x1'));var util=require(_0x5982('0x2'));var config=require(_0x5982('0x3'));var logger=require(_0x5982('0x4'))('trigger');var cmContactRpc=require(_0x5982('0x5'));config['redis']=_[_0x5982('0x6')](config[_0x5982('0x7')],{'host':_0x5982('0x8'),'port':0x18eb});var io=require(_0x5982('0x9'))(new Redis(config[_0x5982('0x7')]));function emit(_0x2decc0,_0x1be7d3,_0x40393f,_0x3a9cc6,_0xd6f5ef){logger['info']('[CM][%s][%s]',_0x2decc0,_0x1be7d3['id'],_0x40393f,_0x3a9cc6,JSON['stringify'](_0xd6f5ef));io['to'](_0x40393f)['emit'](_0x3a9cc6,_0xd6f5ef);}exports[_0x5982('0xa')]=function(_0x1d0102,_0x35fb3f,_0x42e38f,_0x144309){var _0x4037b7,_0x2d7130;var _0x53d616={};var _0x403018;var _0x5357eb=Number(_0x42e38f[_0x5982('0xb')]);var _0x5e7a62=_0x42e38f[_0x5982('0xc')]?Boolean(Number(_0x42e38f[_0x5982('0xc')])):![];var _0x351d69;var _0x5a4a6d=![];if(!_['isNil'](_0x42e38f[_0x5982('0xd')])){if(_0x42e38f[_0x5982('0xd')]=='1')_0x5a4a6d=!![];}if(!_0x5a4a6d){if(_0x144309[_0x5982('0xe')]){_0x53d616['id']=_0x144309['xmd-contactid'];}}if(!_0x53d616['id']){_0x53d616[_0x5982('0xf')]=_0x5357eb;_0x351d69=_0x42e38f[_0x5982('0x10')]&&_0x42e38f[_0x5982('0x10')]!=='0'?_0x42e38f[_0x5982('0x10')]['split'](','):['phone'];_0x53d616[_0x5982('0x11')]=_[_0x5982('0x12')](_0x351d69,function(_0x4ff385){var _0x211a5d={};_0x211a5d[_0x4ff385]=_0x144309[_0x5982('0x13')]?_0x144309[_0x5982('0x14')]:_0x144309[_0x5982('0x15')];return _0x211a5d;});_0x403018=_0x144309[_0x5982('0x13')]?_0x144309[_0x5982('0x14')]:_0x144309[_0x5982('0x15')];}var _0xa4a1e9=['id',_0x5982('0x16'),_0x5982('0x17'),_0x5982('0x18'),_0x5982('0x19'),_0x5982('0x1a'),_0x5982('0xf'),_0x5982('0x1b'),_0x5982('0x1c'),_0x5982('0x1d')];var _0x433a8c=_[_0x5982('0x1e')](_0xa4a1e9,_0x351d69);BPromise['resolve']()[_0x5982('0x1f')](cmContactRpc[_0x5982('0x20')]({'attributes':_0x433a8c,'where':_0x53d616,'phone':_0x403018}))[_0x5982('0x1f')](function(_0x1a4a75){_0x2d7130=_0x1a4a75;if(!_[_0x5982('0x21')](_0x2d7130)){if(_0x2d7130[_0x5982('0x22')]===0x1){_0x4037b7=_0x2d7130[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x144309['uniqueid'],_0x35fb3f['id'],_0x4037b7['id']);}else{logger[_0x5982('0x23')](_0x5982('0x24'),_0x144309['uniqueid'],_0x35fb3f['id'],_['map'](_0x2d7130,'id')[_0x5982('0x25')](','));}return;}else{logger[_0x5982('0x23')](_0x5982('0x26'),_0x144309[_0x5982('0x27')],_0x35fb3f['id']);var _0x409496={'ListId':_0x5357eb};var _0x3a2685=_0x42e38f['data4']&&_0x42e38f[_0x5982('0x28')]!=='0'?_0x42e38f[_0x5982('0x28')]:_0x5982('0x18');if(_0x5e7a62){logger[_0x5982('0x23')](_0x5982('0x29'),_0x144309[_0x5982('0x27')],_0x35fb3f['id']);_0x409496[_0x3a2685]=_[_0x5982('0x2a')](_0x144309[_0x5982('0x13')])?_0x144309[_0x5982('0x15')]:_0x144309['destcalleridnum'];if(_[_0x5982('0x2a')](_0x144309[_0x5982('0x13')])){_0x409496[_0x5982('0x16')]=_0x144309[_0x5982('0x2b')]&&_0x144309[_0x5982('0x2b')]!==''?_0x144309['calleridname']:_0x5982('0x2c');}else{_0x409496[_0x5982('0x16')]=_0x144309[_0x5982('0x2d')]&&_0x144309[_0x5982('0x2d')]!==_0x5982('0x2e')?_0x144309[_0x5982('0x2d')]:_0x5982('0x2c');}return BPromise[_0x5982('0x2f')]()[_0x5982('0x1f')](cmContactRpc['createContact'](_0x409496))[_0x5982('0x1f')](function(_0x46a977){_0x4037b7=_0x46a977;_0x2d7130['push'](_0x46a977);if(_0x4037b7){logger[_0x5982('0x23')](_0x5982('0x30'),_0x144309[_0x5982('0x27')],_0x35fb3f['id'],_0x4037b7['id']);}return;});}else{logger[_0x5982('0x23')](_0x5982('0x31'),_0x144309['uniqueid'],_0x35fb3f['id']);_0x409496[_0x3a2685]=_[_0x5982('0x2a')](_0x144309[_0x5982('0x13')])?_0x144309[_0x5982('0x15')]:_0x144309[_0x5982('0x14')];if(_[_0x5982('0x2a')](_0x144309['routeId'])){_0x409496['firstName']=_0x144309[_0x5982('0x2b')]&&_0x144309[_0x5982('0x2b')]!==''?_0x144309['calleridname']:_0x5982('0x2c');}else{_0x409496[_0x5982('0x16')]=_0x144309[_0x5982('0x2d')]&&_0x144309['destcalleridname']!==_0x5982('0x2e')?_0x144309['destcalleridname']:'Unknown';}_0x4037b7=_0x409496;_0x2d7130[_0x5982('0x32')](_0x409496);return;}}})['then'](function(){if(_0x1d0102){emit(_0x144309[_0x5982('0x27')],_0x35fb3f,util[_0x5982('0x33')](_0x5982('0x34'),_0x1d0102[_0x5982('0x35')]),util[_0x5982('0x33')]('trigger:%s',_0x42e38f[_0x5982('0x36')][_0x5982('0x37')]()),{'evt':_[_0x5982('0x38')](_0x144309,{'autoCreate':_0x5e7a62}),'contact':_0x4037b7===undefined?{}:_0x4037b7,'contacts':_0x2d7130['length']===0x0?undefined:_0x2d7130});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 6383908..281bd0a 100644 --- a/server/services/ami/trigger/index.js +++ b/server/services/ami/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d11=['data1','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','600','winapp','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','action','jscripty','trigger:%s','contactmanager','exec','queue','routeId','urlforward','script','parse','query','channel','AllConditions','every','checkConditions','AnyConditions','some','field','account','ChatWebsiteId','operator','upperFirst','AccountId','value','event','agent','membername','lastevent','null','substatus','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','../ami','defaults','redis','popup','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:offlineMessage','prototype','emit','info','stringify','motionChannel','undefined','voice','checkTriggers','agents','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','toLowerCase','motionbar','browser'];(function(_0x593782,_0xa09fd8){var _0x5f35be=function(_0xf81837){while(--_0xf81837){_0x593782['push'](_0x593782['shift']());}};_0x5f35be(++_0xa09fd8);}(_0x1d11,0xb6));var _0x11d1=function(_0x4a55c5,_0x345ff4){_0x4a55c5=_0x4a55c5-0x0;var _0x56548a=_0x1d11[_0x4a55c5];return _0x56548a;};'use strict';var util=require(_0x11d1('0x0'));var _=require(_0x11d1('0x1'));var url=require(_0x11d1('0x2'));var Mustache=require(_0x11d1('0x3'));var Redis=require(_0x11d1('0x4'));var urlforward=require(_0x11d1('0x5'));var integration=require(_0x11d1('0x6'));var cmContact=require(_0x11d1('0x7'));var script=require(_0x11d1('0x8'));var config=require(_0x11d1('0x9'));var logger=require(_0x11d1('0xa'))('trigger');var ami=require(_0x11d1('0xb'));config['redis']=_[_0x11d1('0xc')](config[_0x11d1('0xd')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x11d1('0xd')]));var operators={'equals':function(_0x4098b0,_0x5494d6){return _0x4098b0==_0x5494d6;},'not_equals':function(_0x4dbc69,_0x2a3075){return _0x4dbc69!=_0x2a3075;}};var barAndWebActions=[_0x11d1('0xe'),_0x11d1('0x2'),'winapp'];function Trigger(_0x5b0ff5){this[_0x11d1('0xf')]=_0x5b0ff5[_0x11d1('0xf')];this['agents']=_0x5b0ff5['agents'];this[_0x11d1('0x10')]=_0x5b0ff5[_0x11d1('0x10')];this[_0x11d1('0x11')]=_0x5b0ff5[_0x11d1('0x11')];this['voiceExtensions']=_0x5b0ff5[_0x11d1('0x12')];this[_0x11d1('0x13')]=_0x5b0ff5[_0x11d1('0x13')];this['freshdeskAccounts']=_0x5b0ff5[_0x11d1('0x14')];this[_0x11d1('0x15')]=_0x5b0ff5[_0x11d1('0x15')];this[_0x11d1('0x16')]=_0x5b0ff5[_0x11d1('0x16')];this['zohoAccounts']=_0x5b0ff5[_0x11d1('0x17')];this['deskAccounts']=_0x5b0ff5[_0x11d1('0x18')];this[_0x11d1('0x19')]=_0x5b0ff5[_0x11d1('0x19')];this[_0x11d1('0x1a')]=_0x5b0ff5[_0x11d1('0x1a')];this[_0x11d1('0x1b')]=_0x5b0ff5['dynamics365Accounts'];this[_0x11d1('0x1c')]=_0x5b0ff5[_0x11d1('0x1c')];this[_0x11d1('0x1d')]={'zendesk':this[_0x11d1('0x13')],'salesforce':this[_0x11d1('0x15')],'freshdesk':this[_0x11d1('0x14')],'sugarcrm':this[_0x11d1('0x16')],'zoho':this[_0x11d1('0x17')],'desk':this[_0x11d1('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x11d1('0x1c')],'servicenow':this[_0x11d1('0x1a')]};ami['on']('custom:agentcalled',this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on'](_0x11d1('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x11d1('0x21'),this[_0x11d1('0x1e')]['bind'](this));ami['on'](_0x11d1('0x22'),this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on'](_0x11d1('0x23'),this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on'](_0x11d1('0x24'),this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on']('custom:agentbusy',this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on'](_0x11d1('0x25'),this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on']('custom:agentreject',this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on']('custom:amd',this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on'](_0x11d1('0x26'),this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on'](_0x11d1('0x27'),this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on'](_0x11d1('0x28'),this[_0x11d1('0x29')]['bind'](this));ami['on'](_0x11d1('0x2a'),this[_0x11d1('0x29')][_0x11d1('0x1f')](this));ami['on'](_0x11d1('0x2b'),this['syncAgentDial'][_0x11d1('0x1f')](this));ami['on']('custom:newinteraction',this[_0x11d1('0x1e')]['bind'](this));ami['on']('custom:closedinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0x11d1('0x2c'),this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on']('custom:incomingmessage',this[_0x11d1('0x1e')]['bind'](this));ami['on'](_0x11d1('0x2d'),this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on'](_0x11d1('0x2e'),this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on']('custom:rejectmessage',this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));ami['on'](_0x11d1('0x2f'),this[_0x11d1('0x1e')][_0x11d1('0x1f')](this));}Trigger[_0x11d1('0x30')][_0x11d1('0x31')]=function(_0x4fa55c,_0x321b04,_0x555f09){logger[_0x11d1('0x32')](_0x4fa55c,_0x321b04,JSON[_0x11d1('0x33')](_0x555f09));io['to'](_0x4fa55c)['emit'](_0x321b04,_0x555f09);};Trigger['prototype'][_0x11d1('0x1e')]=function(_0x22d19d){var _0x3f8d3f=_['clone'](_0x22d19d);if(typeof _0x3f8d3f[_0x11d1('0x34')]===_0x11d1('0x35')){_0x3f8d3f[_0x11d1('0x34')]=_0x11d1('0x36');}this[_0x11d1('0x37')](_0x3f8d3f);};Trigger[_0x11d1('0x30')][_0x11d1('0x29')]=function(_0x751937){if(this[_0x11d1('0x38')][_0x751937[_0x11d1('0x39')]]){this[_0x11d1('0x1e')](_0x751937);}};Trigger['prototype'][_0x11d1('0x37')]=function(_0x5ba549){var _0x1d8a1c;for(var _0x3f4ac3 in this['triggers']){if(this[_0x11d1('0xf')][_0x11d1('0x3a')](_0x3f4ac3)){if(this['triggers'][_0x3f4ac3][_0x11d1('0x3b')]){_0x1d8a1c=this[_0x11d1('0x3c')](this['triggers'][_0x3f4ac3],_0x5ba549);if(_0x1d8a1c){_[_0x11d1('0x3d')](_0x5ba549,_0x5ba549[_0x11d1('0x3e')]);for(var _0x1b50e2=0x0,_0x2e7bbb,_0x1eeaec,_0x3c18a6;_0x1b50e20x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x27c22a,_0x13531d){var _0xf94833=function(_0x2d8691){while(--_0x2d8691){_0x27c22a['push'](_0x27c22a['shift']());}};_0xf94833(++_0x13531d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index af1fa34..75d5d82 100644 --- a/server/services/ami/trigger/integration/dynamics365.js +++ b/server/services/ami/trigger/integration/dynamics365.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5027=['%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','string','type','nameField','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','odata-entityid','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','uniqueid','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','error','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','data2','data5','POST','remoteUri','username','password','clientSecret','then','access_token','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','systemuserid','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x5027,0x16d));var _0x7502=function(_0x3f51f7,_0x5c1e73){_0x3f51f7=_0x3f51f7-0x0;var _0xbdf109=_0x5027[_0x3f51f7];return _0xbdf109;};'use strict';var _=require(_0x7502('0x0'));var rp=require(_0x7502('0x1'));var util=require(_0x7502('0x2'));var intUtil=require(_0x7502('0x3'));var md5=require(_0x7502('0x4'));var Redis=require(_0x7502('0x5'));var logger=require(_0x7502('0x6'))('dynamics365');var config=require(_0x7502('0x7'));config['redis']=_[_0x7502('0x8')](config[_0x7502('0x9')],{'host':_0x7502('0xa'),'port':0x18eb});var io=require(_0x7502('0xb'))(new Redis(config[_0x7502('0x9')]));function getAuthToken(_0x1ca862,_0x23cb5a,_0x390078){if(_0x1ca862[_0x7502('0xc')]){_0x1ca862['remoteUri']=_0x1ca862[_0x7502('0xd')][_0x7502('0xe')];_0x1ca862[_0x7502('0xf')]=_0x1ca862[_0x7502('0xd')][_0x7502('0x10')];return Promise['resolve'](_0x1ca862[_0x7502('0xd')][_0x7502('0x11')]);}var _0xdcdbad={'method':_0x7502('0x12'),'uri':_0x23cb5a,'form':{'client_id':_0x1ca862['clientId'],'resource':_0x1ca862[_0x7502('0x13')],'username':_0x1ca862[_0x7502('0x14')],'password':_0x1ca862[_0x7502('0x15')],'grant_type':'password','client_secret':_0x1ca862[_0x7502('0x16')]},'json':!![]};return rp(_0xdcdbad)[_0x7502('0x17')](function(_0x41f619){return _0x41f619[_0x7502('0x18')];})['catch'](function(_0x1877ab){logger['error']('['+[_0x390078[_0x7502('0x19')]()]+_0x7502('0x1a'));return _0x1877ab[_0x7502('0x1b')];});}function getUser(_0x4c6d0a,_0x2bebee,_0x575cd9,_0x2b5203,_0x3b4cac,_0x438018){return new Promise(function(_0x3b3902,_0x2833b5){return getAuthToken(_0x2bebee,_0x2b5203,_0x438018)['then'](function(_0x156da8){var _0x2dd792={'method':_0x7502('0x1c'),'uri':_0x3b4cac+_0x7502('0x1d'),'headers':{'Authorization':_0x7502('0x1e')+_0x156da8,'OData-Version':_0x7502('0x1f')},'json':!![]};return rp(_0x2dd792);})[_0x7502('0x17')](function(_0x31024a){var _0x4eb208=_0x31024a[_0x7502('0x20')];var _0x8fdd81=![];var _0x496bfa=null;if(!_['isNil'](_0x575cd9)){if(intUtil[_0x7502('0x21')](_0x575cd9[_0x7502('0x22')])){_0x4c6d0a[_0x7502('0x23')]=_0x575cd9[_0x7502('0x22')];for(_0x496bfa=0x0;_0x496bfa<_0x4eb208[_0x7502('0x24')];_0x496bfa++){if(_0x4eb208[_0x496bfa][_0x7502('0x25')]===_0x575cd9['email']&&!_0x4eb208[_0x496bfa][_0x7502('0x26')]){_0x8fdd81=!![];logger[_0x7502('0x27')]('['+[_0x438018[_0x7502('0x19')]()]+']\x20Agent\x20found\x20'+_0x4eb208[_0x496bfa]['systemuserid']+'!');_0x4c6d0a[_0x7502('0x28')]=_0x4eb208[_0x496bfa]['systemuserid'];}}}}if(!_0x8fdd81){logger[_0x7502('0x27')]('['+[_0x438018[_0x7502('0x19')]()]+_0x7502('0x29'));_0x4c6d0a['userEmail']=_0x2bebee[_0x7502('0x14')];for(_0x496bfa=0x0;_0x496bfa<_0x4eb208[_0x7502('0x24')];_0x496bfa++){if(_0x4eb208[_0x496bfa]['internalemailaddress']===_0x2bebee['username']){_0x4c6d0a[_0x7502('0x28')]=_0x4eb208[_0x496bfa][_0x7502('0x2a')];}}}_0x3b3902(_0x4c6d0a);})[_0x7502('0x2b')](function(_0x489053){_0x2833b5(_0x489053[_0x7502('0x1b')]);});});}function createEndUser(_0x3ef6f1,_0x12a8b5,_0x2d1483,_0x29de37,_0x2d3173,_0x4137fd,_0xc65970){return new Promise(function(_0x1487b0,_0x4228f6){return getAuthToken(_0x12a8b5,_0x2d1483,_0x4137fd)[_0x7502('0x17')](function(_0x25bdc0){var _0x242c09=_0x4137fd[_0x7502('0x2c')]()===_0x7502('0x2d')?_0x2d3173[_0x7502('0x2e')]:_0x2d3173[_0x7502('0x2f')];var _0x59c966={'method':'POST','uri':_0x29de37+_0x7502('0x30'),'body':{'fullname':_0x242c09,'firstname':_0x242c09,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x7502('0x31')+_0x3ef6f1[_0x7502('0x28')]+')'},'headers':{'Authorization':_0x7502('0x1e')+_0x25bdc0,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x59c966['body'][_0xc65970]=_0x242c09;return rp(_0x59c966);})[_0x7502('0x17')](function(_0x129113){var _0x7e6f42=_0x129113[_0x7502('0x32')]['odata-entityid'];var _0x3b112e=_0x7e6f42[_0x7502('0x33')](_0x7e6f42[_0x7502('0x34')]('(')+0x1,_0x7e6f42['lastIndexOf'](')'));_0x3ef6f1[_0x7502('0x35')]=_0x3b112e;_0x1487b0(_0x3ef6f1);})[_0x7502('0x2b')](function(_0x37e139){_0x4228f6(_0x37e139[_0x7502('0x1b')]);});});}function getEndUser(_0x574901,_0x5a8946,_0x5c9a91,_0x2cf97b,_0x528c3a,_0x1c85f6,_0xe96cc8,_0x587835){var _0x3db65d=_0x1c85f6[_0x7502('0x2c')]()==='outbound'?_0x528c3a[_0x7502('0x2e')]:_0x528c3a['calleridnum'];return getAuthToken(_0x5a8946,_0x5c9a91,_0x1c85f6)[_0x7502('0x17')](function(_0x2d6443){_0x587835=_0x587835?_0x587835:_0x7502('0x36');var _0x3adafc={'method':'GET','uri':_0x2cf97b+_0x7502('0x37')+_0x587835+_0x7502('0x38')+_0x587835+_0x7502('0x39')+_0x3db65d[_0x7502('0x3a')]('+',_0x7502('0x3b'))+'\x27','headers':{'Authorization':_0x7502('0x1e')+_0x2d6443,'If-None-Match':null,'OData-Version':_0x7502('0x1f')},'json':!![]};return rp(_0x3adafc);})[_0x7502('0x17')](function(_0x415b8a){var _0x4090de=![];if(!_0x415b8a)return _0x4090de;var _0x3de097=_0x415b8a[_0x7502('0x20')];for(var _0x10fe04=0x0;_0x10fe04<_0x3de097[_0x7502('0x24')];_0x10fe04++){if(_0x3de097[_0x10fe04][_0x587835]===_0x3db65d){_0x4090de=!![];_0x574901[_0x7502('0x35')]=_0x3de097[_0x10fe04][_0x7502('0x3c')];}}return _0x4090de;})[_0x7502('0x17')](function(_0x13a9fe){if(_0x13a9fe)return _0x574901;if(_0xe96cc8===_0x7502('0x3d')){logger[_0x7502('0x27')]('['+[_0x1c85f6[_0x7502('0x19')]()]+_0x7502('0x3e'));return _0x574901;}return createEndUser(_0x574901,_0x5a8946,_0x5c9a91,_0x2cf97b,_0x528c3a,_0x1c85f6,_0x587835)[_0x7502('0x17')](function(_0x96c204){logger[_0x7502('0x27')]('['+[_0x1c85f6[_0x7502('0x19')]()]+']\x20Enduser\x20created!',_0x96c204[_0x7502('0x35')]);return _0x96c204;});});}function getCustomFields(_0x28818d,_0x1e385c,_0x4ab987){var _0x39ddce={};if(_0x28818d[_0x7502('0x24')]>0x0){_['forEach'](_0x28818d,function(_0x2bd50d){if(_['includes']([_0x7502('0x3f'),'picklist'],_0x2bd50d[_0x7502('0x40')])&&_0x2bd50d[_0x7502('0x41')]&&!_0x2bd50d['customField']){var _0x410e18=_0x2bd50d[_0x7502('0x42')][_0x7502('0x2c')]();var _0x899e03=_0x410e18[_0x7502('0x33')](0x0,_0x410e18[_0x7502('0x43')]('_'));var _0x10d6c8=_0x410e18['substring'](_0x410e18[_0x7502('0x43')]('_')+0x1);if(_0x899e03===_0x4ab987){_0x39ddce[_0x10d6c8]=_0x2bd50d[_0x7502('0x44')];}}});}return _0x39ddce;}function getTicket(_0x46655f,_0x226e85,_0x494793,_0x1c7ddd,_0x431f27,_0x5e5c58,_0xffbc6d){return new Promise(function(_0x3cc784,_0x2e813c){var _0x4c1a74;return getAuthToken(_0x226e85,_0x494793,_0xffbc6d)[_0x7502('0x17')](function(_0x50731c){if(_0x5e5c58[_0x7502('0x45')]===_0x7502('0x46')){_0x4c1a74={'method':_0x7502('0x12'),'uri':_0x1c7ddd+_0x7502('0x47'),'body':Object[_0x7502('0x48')]({},{'title':intUtil['getString'](_0x5e5c58[_0x7502('0x49')],_0x431f27,'\x20'),'description':intUtil[_0x7502('0x4a')](_0x5e5c58[_0x7502('0x4b')],_0x431f27,'\x0a'),'customerid_contact@odata.bind':_0x46655f[_0x7502('0x35')]?_0x7502('0x4c')+_0x46655f[_0x7502('0x35')]+')':undefined,'ownerid@odata.bind':_0x7502('0x31')+_0x46655f[_0x7502('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x5e5c58[_0x7502('0x4d')],_0x431f27,_0x5e5c58[_0x7502('0x45')])),'headers':{'Authorization':_0x7502('0x1e')+_0x50731c,'OData-Version':_0x7502('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5e5c58[_0x7502('0x45')]===_0x7502('0x4e')){var _0x5e94ee=_0x46655f[_0x7502('0x35')]?[{'partyid_systemuser@odata.bind':_0x7502('0x31')+_0x46655f[_0x7502('0x28')]+')','participationtypemask':_0x46655f[_0x7502('0x4f')]===_0x7502('0x50')?0x2:0x1},{'partyid_contact@odata.bind':_0x7502('0x4c')+_0x46655f['enduserId']+')','participationtypemask':_0x46655f[_0x7502('0x4f')]===_0x7502('0x50')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x46655f['userId']+')','participationtypemask':_0x46655f[_0x7502('0x4f')]===_0x7502('0x50')?0x2:0x1}];_0x4c1a74={'method':'POST','uri':_0x1c7ddd+'phonecalls','body':Object[_0x7502('0x48')]({},{'subject':intUtil[_0x7502('0x4a')](_0x5e5c58[_0x7502('0x49')],_0x431f27,'\x20'),'phonenumber':String(_0x431f27[_0x7502('0x2f')]),'description':intUtil['getString'](_0x5e5c58['Descriptions'],_0x431f27,'\x0a'),'regardingobjectid_contact@odata.bind':_0x46655f[_0x7502('0x35')]?_0x7502('0x4c')+_0x46655f[_0x7502('0x35')]+')':undefined,'ownerid@odata.bind':_0x7502('0x31')+_0x46655f['userId']+')','directioncode':_0x46655f['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':_0x5e94ee},getCustomFields(_0x5e5c58['Fields'],_0x431f27,_0x5e5c58['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x50731c,'OData-Version':_0x7502('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4c1a74);})[_0x7502('0x17')](function(_0xf81e78){var _0x1efe88=_0xf81e78[_0x7502('0x32')][_0x7502('0x51')];var _0x55a53a=_0x1efe88[_0x7502('0x33')](_0x1efe88[_0x7502('0x34')]('(')+0x1,_0x1efe88[_0x7502('0x34')](')'));_0x46655f[_0x7502('0x52')]=_0x55a53a;_0x3cc784(_0x46655f);})['catch'](function(_0x4f508c){_0x2e813c(_0x4f508c['message']);});});}function emit(_0x2e4222,_0x4b344b,_0x21d95f,_0x2a0a26){var _0x272cac={'uri':util[_0x7502('0x53')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x2e4222,_0x21d95f,_0x2a0a26)};io['to'](util[_0x7502('0x53')](_0x7502('0x54'),_0x4b344b))[_0x7502('0x55')](_0x7502('0x56'),_0x272cac);}exports['cs']=function(_0x29b776,_0x3a575c,_0x5993f6,_0x3d67ba,_0x30644f,_0x55524a,_0x300d2b,_0x4cd321){var _0x5c710b={};_0x55524a[_0x7502('0x13')]=_0x55524a[_0x7502('0xc')]?intUtil['stripTrailingSlash'](_0x55524a[_0x7502('0xd')][_0x7502('0xe')]):intUtil[_0x7502('0x57')](_0x55524a[_0x7502('0x13')]);_0x55524a['serverUrl']=intUtil[_0x7502('0x57')](_0x55524a[_0x7502('0x58')]);_0x5c710b[_0x7502('0x4f')]=_0x4cd321===_0x7502('0x50')||_0x4cd321===_0x7502('0x59')?_0x7502('0x50'):'outbound';var _0x213106=_0x55524a['modernAuthentication']?util[_0x7502('0x53')]('%s/api/data/v9.0/',_0x55524a[_0x7502('0xd')][_0x7502('0xe')]):util[_0x7502('0x53')](_0x7502('0x5a'),_0x55524a[_0x7502('0x13')]);var _0x2785d4=util[_0x7502('0x53')]('https://login.microsoftonline.com/%s/oauth2/token',_0x55524a[_0x7502('0xf')]);var _0x5d1c8f=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55524a[_0x7502('0x58')],_0x3a575c[_0x7502('0x5b')],md5(_0x3a575c[_0x7502('0x5b')]));if(_0x30644f&&_0x30644f['monitor_format']){logger[_0x7502('0x27')]('[QUEUE]',_0x7502('0x5c'));_0x3a575c['recordingURL']=_0x5d1c8f;}else if(_0x300d2b&&_0x300d2b[_0x7502('0x5d')]&&_0x300d2b['recordingFormat']!=='none'){logger['info'](_0x7502('0x5e'),_0x7502('0x5c'));_0x3a575c[_0x7502('0x5f')]=_0x5d1c8f;}else{_0x3a575c[_0x7502('0x5f')]='';}return getUser(_0x5c710b,_0x55524a,_0x3d67ba,_0x2785d4,_0x213106,_0x4cd321)[_0x7502('0x17')](function(_0x456130){logger['info']('['+_0x4cd321[_0x7502('0x19')]()+_0x7502('0x60'),_0x456130[_0x7502('0x28')]);logger['info']('['+_0x4cd321[_0x7502('0x19')]()+']\x20The\x20User\x20email\x20is:',_0x456130['userEmail']);return getEndUser(_0x456130,_0x55524a,_0x2785d4,_0x213106,_0x3a575c,_0x4cd321,_0x5993f6[_0x7502('0x61')],_0x5993f6[_0x7502('0x62')]);})[_0x7502('0x17')](function(_0x17243e){logger['info']('['+_0x4cd321[_0x7502('0x19')]()+_0x7502('0x63'),_0x17243e[_0x7502('0x35')]);logger['info']('['+_0x4cd321['toUpperCase']()+_0x7502('0x64'),_0x3a575c[_0x7502('0x2f')]);return getTicket(_0x17243e,_0x55524a,_0x2785d4,_0x213106,_0x3a575c,_0x5993f6,_0x4cd321);})['then'](function(_0x2f236e){logger[_0x7502('0x27')](util['format']('['+_0x4cd321[_0x7502('0x19')]()+_0x7502('0x65'),_0x5993f6['ticketType'],_0x2f236e[_0x7502('0x52')]));logger[_0x7502('0x27')](util['format']('['+_0x4cd321[_0x7502('0x19')]()+_0x7502('0x66'),_0x4cd321));if(_0x4cd321!==_0x7502('0x59')&&_0x5993f6[_0x7502('0x67')]){logger['info']('['+_0x4cd321[_0x7502('0x19')]()+']',_0x7502('0x68'));emit(_0x55524a[_0x7502('0x13')],_0x3d67ba['name'],_0x5993f6[_0x7502('0x45')],_0x2f236e[_0x7502('0x52')]);}})['catch'](function(_0x5d1ba4){logger[_0x7502('0x69')]('['+_0x4cd321[_0x7502('0x19')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x5d1ba4[_0x7502('0x1b')]);console[_0x7502('0x69')]('Error\x20running\x20Dynamics365\x20integration',_0x5d1ba4);});}; \ No newline at end of file +var _0x88a1=['then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','userId','outbound','calleridnum','contacts','Bearer\x20','body','odata-entityid','lastIndexOf','enduserId','toLowerCase','destcalleridnum','&$filter=','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','string','picklist','type','customField','idField','substring','indexOf','content','incidents','assign','getString','Descriptions','Fields','ticketType','/systemusers(','callDirection','/contacts(','queue','Subjects','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','ioredis','../../../../config/environment','redis','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x88a1,0x198));var _0x188a=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0x88a1[_0x5c1345];return _0x1c070d;};'use strict';var _=require('lodash');var rp=require(_0x188a('0x0'));var util=require(_0x188a('0x1'));var intUtil=require(_0x188a('0x2'));var md5=require('md5');var Redis=require(_0x188a('0x3'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x188a('0x4'));config[_0x188a('0x5')]=_['defaults'](config[_0x188a('0x5')],{'host':_0x188a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x2fab85,_0x23d854,_0x41c7cd){if(_0x2fab85[_0x188a('0x7')]){_0x2fab85[_0x188a('0x8')]=_0x2fab85[_0x188a('0x9')][_0x188a('0xa')];_0x2fab85[_0x188a('0xb')]=_0x2fab85[_0x188a('0x9')][_0x188a('0xc')];return Promise[_0x188a('0xd')](_0x2fab85['CloudProvider'][_0x188a('0xe')]);}var _0x2f351c={'method':_0x188a('0xf'),'uri':_0x23d854,'form':{'client_id':_0x2fab85[_0x188a('0x10')],'resource':_0x2fab85[_0x188a('0x8')],'username':_0x2fab85[_0x188a('0x11')],'password':_0x2fab85[_0x188a('0x12')],'grant_type':_0x188a('0x12'),'client_secret':_0x2fab85[_0x188a('0x13')]},'json':!![]};return rp(_0x2f351c)[_0x188a('0x14')](function(_0x144d86){return _0x144d86[_0x188a('0x15')];})[_0x188a('0x16')](function(_0x396ebb){logger[_0x188a('0x17')]('['+[_0x41c7cd['toUpperCase']()]+_0x188a('0x18'));return _0x396ebb[_0x188a('0x19')];});}function getUser(_0xc58444,_0x48fa01,_0x496291,_0x126a9f,_0x1db8e7,_0x403f8b){return new Promise(function(_0x5f2a24,_0x512eb8){return getAuthToken(_0x48fa01,_0x126a9f,_0x403f8b)[_0x188a('0x14')](function(_0x547fca){var _0x23ef8f={'method':_0x188a('0x1a'),'uri':_0x1db8e7+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x547fca,'OData-Version':_0x188a('0x1b')},'json':!![]};return rp(_0x23ef8f);})[_0x188a('0x14')](function(_0x21b967){var _0x5168e0=_0x21b967[_0x188a('0x1c')];var _0x38ceaf=![];var _0x169b44=null;if(!_[_0x188a('0x1d')](_0x496291)){if(intUtil[_0x188a('0x1e')](_0x496291[_0x188a('0x1f')])){_0xc58444[_0x188a('0x20')]=_0x496291[_0x188a('0x1f')];for(_0x169b44=0x0;_0x169b44<_0x5168e0['length'];_0x169b44++){if(_0x5168e0[_0x169b44][_0x188a('0x21')]===_0x496291['email']&&!_0x5168e0[_0x169b44][_0x188a('0x22')]){_0x38ceaf=!![];logger[_0x188a('0x23')]('['+[_0x403f8b[_0x188a('0x24')]()]+_0x188a('0x25')+_0x5168e0[_0x169b44][_0x188a('0x26')]+'!');_0xc58444['userId']=_0x5168e0[_0x169b44][_0x188a('0x26')];}}}}if(!_0x38ceaf){logger[_0x188a('0x23')]('['+[_0x403f8b[_0x188a('0x24')]()]+_0x188a('0x27'));_0xc58444[_0x188a('0x20')]=_0x48fa01['username'];for(_0x169b44=0x0;_0x169b44<_0x5168e0[_0x188a('0x28')];_0x169b44++){if(_0x5168e0[_0x169b44][_0x188a('0x21')]===_0x48fa01[_0x188a('0x11')]){_0xc58444[_0x188a('0x29')]=_0x5168e0[_0x169b44][_0x188a('0x26')];}}}_0x5f2a24(_0xc58444);})[_0x188a('0x16')](function(_0x1ed05d){_0x512eb8(_0x1ed05d[_0x188a('0x19')]);});});}function createEndUser(_0x37b581,_0x26d977,_0x4d7d11,_0x551f87,_0x52a9f7,_0xbd215,_0x3b05de){return new Promise(function(_0x20a59a,_0x197b14){return getAuthToken(_0x26d977,_0x4d7d11,_0xbd215)[_0x188a('0x14')](function(_0x5d480f){var _0x5c51d0=_0xbd215['toLowerCase']()===_0x188a('0x2a')?_0x52a9f7['destcalleridnum']:_0x52a9f7[_0x188a('0x2b')];var _0x41ea25={'method':'POST','uri':_0x551f87+_0x188a('0x2c'),'body':{'fullname':_0x5c51d0,'firstname':_0x5c51d0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x37b581['userId']+')'},'headers':{'Authorization':_0x188a('0x2d')+_0x5d480f,'OData-Version':_0x188a('0x1b')},'json':!![],'resolveWithFullResponse':!![]};_0x41ea25[_0x188a('0x2e')][_0x3b05de]=_0x5c51d0;return rp(_0x41ea25);})[_0x188a('0x14')](function(_0x14aed6){var _0xa80e8c=_0x14aed6['headers'][_0x188a('0x2f')];var _0xce3ce6=_0xa80e8c['substring'](_0xa80e8c[_0x188a('0x30')]('(')+0x1,_0xa80e8c[_0x188a('0x30')](')'));_0x37b581[_0x188a('0x31')]=_0xce3ce6;_0x20a59a(_0x37b581);})['catch'](function(_0x178c75){_0x197b14(_0x178c75[_0x188a('0x19')]);});});}function getEndUser(_0x395e04,_0x3d959c,_0x4d80ec,_0x141b18,_0x1b7e55,_0x1f3c59,_0x1c708e,_0x37211c){var _0x469044=_0x1f3c59[_0x188a('0x32')]()===_0x188a('0x2a')?_0x1b7e55[_0x188a('0x33')]:_0x1b7e55['calleridnum'];return getAuthToken(_0x3d959c,_0x4d80ec,_0x1f3c59)[_0x188a('0x14')](function(_0x3a6cd1){_0x37211c=_0x37211c?_0x37211c:'telephone1';var _0x34bd0f={'method':_0x188a('0x1a'),'uri':_0x141b18+'contacts?$select='+_0x37211c+_0x188a('0x34')+_0x37211c+'\x20eq\x20\x27'+_0x469044[_0x188a('0x35')]('+',_0x188a('0x36'))+'\x27','headers':{'Authorization':_0x188a('0x2d')+_0x3a6cd1,'If-None-Match':null,'OData-Version':_0x188a('0x1b')},'json':!![]};return rp(_0x34bd0f);})['then'](function(_0x530bf0){var _0x2d883a=![];if(!_0x530bf0)return _0x2d883a;var _0xc9cec6=_0x530bf0[_0x188a('0x1c')];for(var _0x386375=0x0;_0x386375<_0xc9cec6['length'];_0x386375++){if(_0xc9cec6[_0x386375][_0x37211c]===_0x469044){_0x2d883a=!![];_0x395e04[_0x188a('0x31')]=_0xc9cec6[_0x386375][_0x188a('0x37')];}}return _0x2d883a;})[_0x188a('0x14')](function(_0xe9b884){if(_0xe9b884)return _0x395e04;if(_0x1c708e===_0x188a('0x38')){logger['info']('['+[_0x1f3c59['toUpperCase']()]+_0x188a('0x39'));return _0x395e04;}return createEndUser(_0x395e04,_0x3d959c,_0x4d80ec,_0x141b18,_0x1b7e55,_0x1f3c59,_0x37211c)[_0x188a('0x14')](function(_0x4125f3){logger[_0x188a('0x23')]('['+[_0x1f3c59[_0x188a('0x24')]()]+']\x20Enduser\x20created!',_0x4125f3[_0x188a('0x31')]);return _0x4125f3;});});}function getCustomFields(_0x1a5d3b,_0x149bd8,_0x9d5a41){var _0x171c5e={};if(_0x1a5d3b[_0x188a('0x28')]>0x0){_[_0x188a('0x3a')](_0x1a5d3b,function(_0x3d7954){if(_['includes']([_0x188a('0x3b'),_0x188a('0x3c')],_0x3d7954[_0x188a('0x3d')])&&_0x3d7954['nameField']&&!_0x3d7954[_0x188a('0x3e')]){var _0x5cfa73=_0x3d7954[_0x188a('0x3f')][_0x188a('0x32')]();var _0x48e5ad=_0x5cfa73[_0x188a('0x40')](0x0,_0x5cfa73['indexOf']('_'));var _0x975944=_0x5cfa73['substring'](_0x5cfa73[_0x188a('0x41')]('_')+0x1);if(_0x48e5ad===_0x9d5a41){_0x171c5e[_0x975944]=_0x3d7954[_0x188a('0x42')];}}});}return _0x171c5e;}function getTicket(_0x50f6ce,_0x242ca5,_0x4b4de6,_0x557577,_0x1cac6c,_0x3f2fbd,_0x5f00b4){return new Promise(function(_0x36f449,_0x520bb2){var _0x5796d6;return getAuthToken(_0x242ca5,_0x4b4de6,_0x5f00b4)[_0x188a('0x14')](function(_0x4b1a97){if(_0x3f2fbd['ticketType']==='incident'){_0x5796d6={'method':_0x188a('0xf'),'uri':_0x557577+_0x188a('0x43'),'body':Object[_0x188a('0x44')]({},{'title':intUtil[_0x188a('0x45')](_0x3f2fbd['Subjects'],_0x1cac6c,'\x20'),'description':intUtil['getString'](_0x3f2fbd[_0x188a('0x46')],_0x1cac6c,'\x0a'),'customerid_contact@odata.bind':_0x50f6ce[_0x188a('0x31')]?'/contacts('+_0x50f6ce[_0x188a('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x50f6ce[_0x188a('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x3f2fbd[_0x188a('0x47')],_0x1cac6c,_0x3f2fbd[_0x188a('0x48')])),'headers':{'Authorization':_0x188a('0x2d')+_0x4b1a97,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3f2fbd[_0x188a('0x48')]==='phonecall'){var _0x5924de=_0x50f6ce['enduserId']?[{'partyid_systemuser@odata.bind':_0x188a('0x49')+_0x50f6ce[_0x188a('0x29')]+')','participationtypemask':_0x50f6ce[_0x188a('0x4a')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x188a('0x4b')+_0x50f6ce['enduserId']+')','participationtypemask':_0x50f6ce[_0x188a('0x4a')]===_0x188a('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x188a('0x49')+_0x50f6ce[_0x188a('0x29')]+')','participationtypemask':_0x50f6ce[_0x188a('0x4a')]===_0x188a('0x4c')?0x2:0x1}];_0x5796d6={'method':'POST','uri':_0x557577+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0x188a('0x45')](_0x3f2fbd[_0x188a('0x4d')],_0x1cac6c,'\x20'),'phonenumber':String(_0x1cac6c['calleridnum']),'description':intUtil['getString'](_0x3f2fbd[_0x188a('0x46')],_0x1cac6c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x50f6ce[_0x188a('0x31')]?'/contacts('+_0x50f6ce[_0x188a('0x31')]+')':undefined,'ownerid@odata.bind':_0x188a('0x49')+_0x50f6ce['userId']+')','directioncode':_0x50f6ce[_0x188a('0x4a')]===_0x188a('0x4c')?![]:!![],'phonecall_activity_parties':_0x5924de},getCustomFields(_0x3f2fbd['Fields'],_0x1cac6c,_0x3f2fbd['ticketType'])),'headers':{'Authorization':_0x188a('0x2d')+_0x4b1a97,'OData-Version':_0x188a('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5796d6);})['then'](function(_0x2426ac){var _0x5eab9f=_0x2426ac['headers'][_0x188a('0x2f')];var _0x3c5335=_0x5eab9f[_0x188a('0x40')](_0x5eab9f[_0x188a('0x30')]('(')+0x1,_0x5eab9f['lastIndexOf'](')'));_0x50f6ce[_0x188a('0x4e')]=_0x3c5335;_0x36f449(_0x50f6ce);})[_0x188a('0x16')](function(_0x546cfb){_0x520bb2(_0x546cfb['message']);});});}function emit(_0x38cfb7,_0x2a927d,_0x431a80,_0x5027cc){var _0x1a5d86={'uri':util[_0x188a('0x4f')](_0x188a('0x50'),_0x38cfb7,_0x431a80,_0x5027cc)};io['to'](util[_0x188a('0x4f')](_0x188a('0x51'),_0x2a927d))[_0x188a('0x52')](_0x188a('0x53'),_0x1a5d86);}exports['cs']=function(_0x39dcfc,_0x5d8328,_0x543a1c,_0x10ca1b,_0xf20bac,_0x425927,_0x427e85,_0x3028ec){var _0x5c6fed={};_0x425927[_0x188a('0x8')]=_0x425927[_0x188a('0x7')]?intUtil[_0x188a('0x54')](_0x425927[_0x188a('0x9')][_0x188a('0xa')]):intUtil['stripTrailingSlash'](_0x425927[_0x188a('0x8')]);_0x425927[_0x188a('0x55')]=intUtil[_0x188a('0x54')](_0x425927['serverUrl']);_0x5c6fed[_0x188a('0x4a')]=_0x3028ec===_0x188a('0x4c')||_0x3028ec===_0x188a('0x56')?_0x188a('0x4c'):'outbound';var _0x4baefc=_0x425927[_0x188a('0x7')]?util['format'](_0x188a('0x57'),_0x425927[_0x188a('0x9')][_0x188a('0xa')]):util[_0x188a('0x4f')](_0x188a('0x57'),_0x425927[_0x188a('0x8')]);var _0x84ed73=util['format'](_0x188a('0x58'),_0x425927[_0x188a('0xb')]);var _0x548122=util[_0x188a('0x4f')](_0x188a('0x59'),_0x425927['serverUrl'],_0x5d8328[_0x188a('0x5a')],md5(_0x5d8328[_0x188a('0x5a')]));if(_0xf20bac&&_0xf20bac[_0x188a('0x5b')]){logger['info'](_0x188a('0x5c'),'Recording\x20is\x20enabled!');_0x5d8328[_0x188a('0x5d')]=_0x548122;}else if(_0x427e85&&_0x427e85['recordingFormat']&&_0x427e85[_0x188a('0x5e')]!=='none'){logger[_0x188a('0x23')](_0x188a('0x5f'),_0x188a('0x60'));_0x5d8328[_0x188a('0x5d')]=_0x548122;}else{_0x5d8328[_0x188a('0x5d')]='';}return getUser(_0x5c6fed,_0x425927,_0x10ca1b,_0x84ed73,_0x4baefc,_0x3028ec)[_0x188a('0x14')](function(_0x518da5){logger[_0x188a('0x23')]('['+_0x3028ec[_0x188a('0x24')]()+_0x188a('0x61'),_0x518da5[_0x188a('0x29')]);logger[_0x188a('0x23')]('['+_0x3028ec[_0x188a('0x24')]()+']\x20The\x20User\x20email\x20is:',_0x518da5[_0x188a('0x20')]);return getEndUser(_0x518da5,_0x425927,_0x84ed73,_0x4baefc,_0x5d8328,_0x3028ec,_0x543a1c['moduleCreate'],_0x543a1c[_0x188a('0x62')]);})[_0x188a('0x14')](function(_0x15614f){logger['info']('['+_0x3028ec[_0x188a('0x24')]()+_0x188a('0x63'),_0x15614f[_0x188a('0x31')]);logger['info']('['+_0x3028ec['toUpperCase']()+_0x188a('0x64'),_0x5d8328['calleridnum']);return getTicket(_0x15614f,_0x425927,_0x84ed73,_0x4baefc,_0x5d8328,_0x543a1c,_0x3028ec);})['then'](function(_0x549b31){logger[_0x188a('0x23')](util[_0x188a('0x4f')]('['+_0x3028ec['toUpperCase']()+_0x188a('0x65'),_0x543a1c['ticketType'],_0x549b31[_0x188a('0x4e')]));logger[_0x188a('0x23')](util[_0x188a('0x4f')]('['+_0x3028ec['toUpperCase']()+_0x188a('0x66'),_0x3028ec));if(_0x3028ec!==_0x188a('0x56')&&_0x543a1c[_0x188a('0x67')]){logger[_0x188a('0x23')]('['+_0x3028ec[_0x188a('0x24')]()+']',_0x188a('0x68'));emit(_0x425927[_0x188a('0x8')],_0x10ca1b['name'],_0x543a1c[_0x188a('0x48')],_0x549b31[_0x188a('0x4e')]);}})['catch'](function(_0x4fdeb7){logger[_0x188a('0x17')]('['+_0x3028ec[_0x188a('0x24')]()+_0x188a('0x69'),_0x4fdeb7[_0x188a('0x19')]);console[_0x188a('0x17')](_0x188a('0x6a'),_0x4fdeb7);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 8ebb469..97ffe8a 100644 --- a/server/services/ami/trigger/integration/freshdesk.js +++ b/server/services/ami/trigger/integration/freshdesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7e9=['destcalleridname','destcalleridnum','[OUTBOUND]','unmanaged','lastevent','toUpperCase','Authorization','error','lodash','request-promise','md5','util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','info','merge','calleridname','calleridnum','getString','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','[HTTP]','stringify','map','forEach','includes','string','type','nameField','customField','toLowerCase','content','picklist','idField','toString','variable','variableName','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','recordingURL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7e9,0xbc));var _0x9c7e=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xc7e9[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x9c7e('0x0'));var rp=require(_0x9c7e('0x1'));var md5=require(_0x9c7e('0x2'));var util=require(_0x9c7e('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x9c7e('0x4'));var logger=require(_0x9c7e('0x5'))(_0x9c7e('0x6'));config[_0x9c7e('0x7')]=_[_0x9c7e('0x8')](config['redis'],{'host':_0x9c7e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0x9c7e('0xa')};function emit(_0x58ac2f,_0x296e00,_0x32fc62){io['to'](_0x58ac2f)[_0x9c7e('0xb')](_0x296e00,_0x32fc62);}function getTicket(_0x54f9a9,_0x129478,_0x4481a2,_0x1961f4,_0x1c9add){logger[_0x9c7e('0xc')]('Creating\x20new\x20ticket...');var _0x42e851=_[_0x9c7e('0xd')]({'responder_id':_0x129478['id'],'requester_id':_0x4481a2['id'],'name':util['format']('Caller\x20-\x20%s',_0x1c9add[_0x9c7e('0xe')]),'phone':_0x1c9add[_0x9c7e('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x1961f4['Subjects'],_0x1c9add,'\x20'),'description':intUtil[_0x9c7e('0x10')](_0x1961f4[_0x9c7e('0x11')],_0x1c9add,_0x9c7e('0x12')),'tags':getTags(_0x1961f4['Tags'],_0x9c7e('0x13'))},getCustomFields(_0x1961f4[_0x9c7e('0x14')],_0x1c9add));_0x42e851[_0x9c7e('0x15')]=_[_0x9c7e('0x16')](_[_0x9c7e('0x17')](_0x42e851[_0x9c7e('0x15')],'id'),_0x9c7e('0x18'));return request({'uri':util[_0x9c7e('0x19')](_0x9c7e('0x1a'),_0x54f9a9[_0x9c7e('0x1b')]),'method':_0x9c7e('0x1c'),'body':_0x42e851})[_0x9c7e('0x1d')](function(_0x3f3477){logger[_0x9c7e('0xc')](_0x9c7e('0x1e'));return _0x3f3477;});}function getUser(_0x2f09d6,_0x354f48){if(intUtil[_0x9c7e('0x1f')](_0x354f48)){return request({'uri':util[_0x9c7e('0x19')](_0x9c7e('0x20'),_0x2f09d6[_0x9c7e('0x1b')]),'qs':{'email':_0x354f48}})[_0x9c7e('0x1d')](function(_0x31b5a6){if(_0x31b5a6['length']){logger[_0x9c7e('0xc')](_0x9c7e('0x21'));return _[_0x9c7e('0x22')](_0x31b5a6,function(_0x40cdac){return _0x40cdac[_0x9c7e('0x23')][_0x9c7e('0x24')]===_0x354f48;});}else{logger[_0x9c7e('0xc')](_0x9c7e('0x25'));return request({'uri':util[_0x9c7e('0x19')](_0x9c7e('0x26'),_0x2f09d6[_0x9c7e('0x1b')])})[_0x9c7e('0x1d')](function(_0xf46e88){logger['info'](_0x9c7e('0x27'));return _0xf46e88;});}});}else{logger[_0x9c7e('0xc')](_0x9c7e('0x28'));return request({'uri':util[_0x9c7e('0x19')](_0x9c7e('0x26'),_0x2f09d6[_0x9c7e('0x1b')])})[_0x9c7e('0x1d')](function(_0x298fe3){logger[_0x9c7e('0xc')](_0x9c7e('0x27'));return _0x298fe3;});}}function getEndUser(_0x224773,_0x3492f5,_0x5e7f9f){logger[_0x9c7e('0xc')]('Searching\x20enduser\x20with\x20phone',_0x5e7f9f);return request({'uri':util[_0x9c7e('0x19')]('%s/api/v2/contacts',_0x224773['remoteUri']),'qs':{'phone':_0x5e7f9f}})[_0x9c7e('0x1d')](function(_0x63dbba){if(_0x63dbba[_0x9c7e('0x29')]){logger[_0x9c7e('0xc')](_0x9c7e('0x2a'));return _['find'](_0x63dbba,{'phone':_0x5e7f9f});}else{logger['info'](_0x9c7e('0x2b'));return request({'uri':util[_0x9c7e('0x19')](_0x9c7e('0x2c'),_0x224773[_0x9c7e('0x1b')]),'method':'POST','body':{'name':_0x3492f5,'phone':_0x5e7f9f}})[_0x9c7e('0x1d')](function(_0x1b8fbd){logger[_0x9c7e('0xc')](_0x9c7e('0x2d'));return _0x1b8fbd;});}});}function getAuth(_0x19a3cf){return util[_0x9c7e('0x19')]('Basic\x20%s',new Buffer(_0x19a3cf['apiKey']+':X')['toString']('base64'));}function request(_0x367d62){logger['debug'](_0x9c7e('0x2e'),JSON[_0x9c7e('0x2f')](_0x367d62));return rp(_['defaults'](_0x367d62,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x365abc,_0xfae191){var _0x4a5912=[];if(_0x365abc&&_0x365abc[_0x9c7e('0x29')]>0x0){_0x4a5912=_[_0x9c7e('0x30')](_0x365abc,_0xfae191);}return _0x4a5912;}function getCustomFields(_0x4e4076,_0x53ca96){var _0x163a00=[];var _0x238901={'custom_fields':[]};if(_0x4e4076[_0x9c7e('0x29')]>0x0){_[_0x9c7e('0x31')](_0x4e4076,function(_0x19aa5b){if(_[_0x9c7e('0x32')]([_0x9c7e('0x33'),'picklist'],_0x19aa5b[_0x9c7e('0x34')])&&_0x19aa5b[_0x9c7e('0x35')]&&!_0x19aa5b[_0x9c7e('0x36')]){_0x238901[_0x19aa5b[_0x9c7e('0x35')][_0x9c7e('0x37')]()]=_0x19aa5b[_0x9c7e('0x38')]['toString']();}else if(_[_0x9c7e('0x32')]([_0x9c7e('0x33'),_0x9c7e('0x39')],_0x19aa5b[_0x9c7e('0x34')])&&_0x19aa5b[_0x9c7e('0x3a')]&&_0x19aa5b[_0x9c7e('0x36')]){_0x238901[_0x9c7e('0x15')]['push']({'id':_0x19aa5b['idField'],'value':_0x19aa5b['content'][_0x9c7e('0x3b')]()});}else if(_0x19aa5b[_0x9c7e('0x34')]===_0x9c7e('0x3c')&&_0x19aa5b[_0x9c7e('0x3d')]&&_0x19aa5b[_0x9c7e('0x3a')]&&_0x19aa5b[_0x9c7e('0x36')]){_0x53ca96[_0x19aa5b[_0x9c7e('0x3d')]]&&_0x238901[_0x9c7e('0x15')]['push']({'id':_0x19aa5b[_0x9c7e('0x3a')],'value':_0x53ca96[_0x19aa5b[_0x9c7e('0x3d')]]['toString']()});}else if(_0x19aa5b[_0x9c7e('0x34')]==='customVariable'&&_0x19aa5b['Variable']&&_0x19aa5b[_0x9c7e('0x3e')][_0x9c7e('0x13')]&&_0x19aa5b[_0x9c7e('0x3a')]&&_0x19aa5b[_0x9c7e('0x36')]){_0x53ca96[_0x19aa5b[_0x9c7e('0x3e')][_0x9c7e('0x13')][_0x9c7e('0x37')]()]&&_0x238901[_0x9c7e('0x15')]['push']({'id':_0x19aa5b['idField'],'value':_0x53ca96[_0x19aa5b[_0x9c7e('0x3e')][_0x9c7e('0x13')][_0x9c7e('0x37')]()]['toString']()});}});}return _0x238901;}exports['queue']=function(_0x4c3bd0,_0x338800,_0x334deb,_0x3b92e0,_0x5c549e,_0x5f38e0){var _0x390e5b,_0x133983;_0x5f38e0[_0x9c7e('0x1b')]=intUtil[_0x9c7e('0x3f')](_0x5f38e0['remoteUri']);_0x5f38e0[_0x9c7e('0x40')]=intUtil['stripTrailingSlash'](_0x5f38e0[_0x9c7e('0x40')]);if(_0x5c549e&&_0x5c549e[_0x9c7e('0x41')]){logger[_0x9c7e('0xc')](_0x9c7e('0x42'),_0x9c7e('0x43'));_0x338800['recordingURL']=util['format'](_0x9c7e('0x44'),_0x5f38e0[_0x9c7e('0x40')],_0x338800[_0x9c7e('0x45')],md5(_0x338800['uniqueid']));}else{_0x338800['recordingURL']='';}headers['Authorization']=getAuth(_0x5f38e0);return getUser(_0x5f38e0,_0x3b92e0[_0x9c7e('0x24')])[_0x9c7e('0x1d')](function(_0x266d08){_0x390e5b=_0x266d08;logger[_0x9c7e('0xc')](_0x9c7e('0x46'),_0x390e5b['id']);return getEndUser(_0x5f38e0,_0x338800['calleridname'],_0x338800[_0x9c7e('0xf')]);})['then'](function(_0xff0084){_0x133983=_0xff0084;logger['info'](_0x9c7e('0x47'),_0x133983['id']);return getTicket(_0x5f38e0,_0x390e5b,_0x133983,_0x334deb,_0x338800);})['then'](function(_0x24e9f7){if(_0x24e9f7&&_0x24e9f7['id']){logger['info'](_0x9c7e('0x1e'));logger[_0x9c7e('0xc')](_0x9c7e('0x48'),_0x24e9f7['id']);logger[_0x9c7e('0xc')](_0x9c7e('0x42'),_0x9c7e('0x49'));emit(util[_0x9c7e('0x19')](_0x9c7e('0x4a'),_0x3b92e0['name']),_0x9c7e('0x4b'),{'uri':util[_0x9c7e('0x19')](_0x9c7e('0x4c'),_0x5f38e0['remoteUri'],_0x24e9f7['id'])});}})[_0x9c7e('0x4d')](function(_0x228b63){logger['error'](_0x9c7e('0x42'),JSON['stringify'](_0x228b63));});};exports[_0x9c7e('0x4e')]=function(_0x301710,_0x4c0d8a,_0x22a2df,_0x4a1399,_0x3cfa06,_0x3282cf,_0x2b745c){var _0x42c719,_0xead05b;_0x3282cf[_0x9c7e('0x1b')]=intUtil['stripTrailingSlash'](_0x3282cf['remoteUri']);_0x3282cf['serverUrl']=intUtil[_0x9c7e('0x3f')](_0x3282cf[_0x9c7e('0x40')]);if(_0x2b745c&&_0x2b745c[_0x9c7e('0x4f')]&&_0x2b745c['recordingFormat']!==_0x9c7e('0x50')){logger[_0x9c7e('0xc')]('[OUTBOUND]',_0x9c7e('0x43'));_0x4c0d8a[_0x9c7e('0x51')]=util[_0x9c7e('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3282cf[_0x9c7e('0x40')],_0x4c0d8a['uniqueid'],md5(_0x4c0d8a['uniqueid']));}headers['Authorization']=getAuth(_0x3282cf);return getUser(_0x3282cf,_0x4a1399['email'])[_0x9c7e('0x1d')](function(_0x99a26){_0x42c719=_0x99a26;logger[_0x9c7e('0xc')](_0x9c7e('0x46'),_0x42c719['id']);return getEndUser(_0x3282cf,_0x4c0d8a[_0x9c7e('0x52')],_0x4c0d8a[_0x9c7e('0x53')]);})[_0x9c7e('0x1d')](function(_0x3ef42c){_0xead05b=_0x3ef42c;logger[_0x9c7e('0xc')](_0x9c7e('0x47'),_0xead05b['id']);return getTicket(_0x3282cf,_0x42c719,_0xead05b,_0x22a2df,_0x4c0d8a);})[_0x9c7e('0x1d')](function(_0x584f09){if(_0x584f09&&_0x584f09['id']){logger[_0x9c7e('0xc')]('Ticket\x20created!');logger['info'](_0x9c7e('0x48'),_0x584f09['id']);logger[_0x9c7e('0xc')](_0x9c7e('0x54'),_0x9c7e('0x49'));emit(util[_0x9c7e('0x19')](_0x9c7e('0x4a'),_0x4a1399[_0x9c7e('0x13')]),_0x9c7e('0x4b'),{'uri':util[_0x9c7e('0x19')]('%s/helpdesk/tickets/%d',_0x3282cf['remoteUri'],_0x584f09['id'])});}})[_0x9c7e('0x4d')](function(_0x463966){logger['error'](_0x9c7e('0x54'),JSON['stringify'](_0x463966));});};exports[_0x9c7e('0x55')]=function(_0x5d1bad,_0x35fa69,_0x2bc6c1,_0x2e6064,_0x7019c8,_0x4712df){var _0x18c55b,_0x14ee3f;_0x4712df['remoteUri']=intUtil['stripTrailingSlash'](_0x4712df[_0x9c7e('0x1b')]);_0x4712df[_0x9c7e('0x40')]=intUtil[_0x9c7e('0x3f')](_0x4712df['serverUrl']);if(_0x7019c8&&_0x7019c8[_0x9c7e('0x41')]){logger['info']('['+_0x35fa69[_0x9c7e('0x56')][_0x9c7e('0x57')]()+']',_0x9c7e('0x43'));_0x35fa69[_0x9c7e('0x51')]=util[_0x9c7e('0x19')](_0x9c7e('0x44'),_0x4712df[_0x9c7e('0x40')],_0x35fa69[_0x9c7e('0x45')],md5(_0x35fa69['uniqueid']));}else{_0x35fa69[_0x9c7e('0x51')]='';}headers[_0x9c7e('0x58')]=getAuth(_0x4712df);return getUser(_0x4712df,'')['then'](function(_0x358821){_0x18c55b=_0x358821;logger[_0x9c7e('0xc')]('The\x20User\x20ID\x20is:',_0x18c55b['id']);return getEndUser(_0x4712df,_0x35fa69[_0x9c7e('0xe')],_0x35fa69[_0x9c7e('0xf')]);})[_0x9c7e('0x1d')](function(_0x27d344){_0x14ee3f=_0x27d344;logger['info']('The\x20Enduser\x20ID\x20is:',_0x14ee3f['id']);return getTicket(_0x4712df,_0x18c55b,_0x14ee3f,_0x2bc6c1,_0x35fa69);})[_0x9c7e('0x1d')](function(_0x5a2237){if(_0x5a2237){logger[_0x9c7e('0xc')](_0x9c7e('0x1e'));logger[_0x9c7e('0xc')](_0x9c7e('0x48'),_0x5a2237['id']);}})[_0x9c7e('0x4d')](function(_0xd0f169){logger[_0x9c7e('0x59')]('['+_0x35fa69['lastevent'][_0x9c7e('0x57')]()+']',JSON['stringify'](_0xd0f169));});}; \ No newline at end of file +var _0xab66=['variableName','customVariable','name','Variable','push','queue','stripTrailingSlash','serverUrl','recordingURL','uniqueid','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','stringify','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','user:%s','trigger:browser:url','unmanaged','monitor_format','toUpperCase','lodash','./util','../../../../config/environment','freshdesk','redis','localhost','application/json','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','debug','[HTTP]','defaults','GET','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField'];(function(_0xc60d76,_0x365b64){var _0x2b2732=function(_0x27b864){while(--_0x27b864){_0xc60d76['push'](_0xc60d76['shift']());}};_0x2b2732(++_0x365b64);}(_0xab66,0x1d8));var _0x6ab6=function(_0x579eae,_0x282832){_0x579eae=_0x579eae-0x0;var _0x41b1a0=_0xab66[_0x579eae];return _0x41b1a0;};'use strict';var _=require(_0x6ab6('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x6ab6('0x1'));var config=require(_0x6ab6('0x2'));var logger=require('../../../../config/logger')(_0x6ab6('0x3'));config[_0x6ab6('0x4')]=_['defaults'](config['redis'],{'host':_0x6ab6('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6ab6('0x4')]));var headers={'Content-Type':_0x6ab6('0x6'),'Accept':'application/json'};function emit(_0x1258b6,_0x3686ae,_0x424715){io['to'](_0x1258b6)['emit'](_0x3686ae,_0x424715);}function getTicket(_0x39bff6,_0x705902,_0x49af56,_0x32837b,_0x168d44){logger['info'](_0x6ab6('0x7'));var _0x86cac8=_[_0x6ab6('0x8')]({'responder_id':_0x705902['id'],'requester_id':_0x49af56['id'],'name':util['format'](_0x6ab6('0x9'),_0x168d44[_0x6ab6('0xa')]),'phone':_0x168d44['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6ab6('0xb')](_0x32837b[_0x6ab6('0xc')],_0x168d44,'\x20'),'description':intUtil[_0x6ab6('0xb')](_0x32837b[_0x6ab6('0xd')],_0x168d44,_0x6ab6('0xe')),'tags':getTags(_0x32837b[_0x6ab6('0xf')],'name')},getCustomFields(_0x32837b[_0x6ab6('0x10')],_0x168d44));_0x86cac8[_0x6ab6('0x11')]=_[_0x6ab6('0x12')](_[_0x6ab6('0x13')](_0x86cac8[_0x6ab6('0x11')],'id'),_0x6ab6('0x14'));return request({'uri':util['format'](_0x6ab6('0x15'),_0x39bff6[_0x6ab6('0x16')]),'method':_0x6ab6('0x17'),'body':_0x86cac8})[_0x6ab6('0x18')](function(_0x1d2fa1){logger[_0x6ab6('0x19')](_0x6ab6('0x1a'));return _0x1d2fa1;});}function getUser(_0x4a4cdd,_0x205dcf){if(intUtil[_0x6ab6('0x1b')](_0x205dcf)){return request({'uri':util['format'](_0x6ab6('0x1c'),_0x4a4cdd['remoteUri']),'qs':{'email':_0x205dcf}})['then'](function(_0x3be1f3){if(_0x3be1f3['length']){logger[_0x6ab6('0x19')]('Agent\x20found!');return _[_0x6ab6('0x1d')](_0x3be1f3,function(_0x90857c){return _0x90857c[_0x6ab6('0x1e')]['email']===_0x205dcf;});}else{logger[_0x6ab6('0x19')](_0x6ab6('0x1f'));return request({'uri':util[_0x6ab6('0x20')]('%s/api/v2/agents/me',_0x4a4cdd['remoteUri'])})[_0x6ab6('0x18')](function(_0x1ed30d){logger[_0x6ab6('0x19')](_0x6ab6('0x21'));return _0x1ed30d;});}});}else{logger[_0x6ab6('0x19')](_0x6ab6('0x22'));return request({'uri':util['format'](_0x6ab6('0x23'),_0x4a4cdd['remoteUri'])})[_0x6ab6('0x18')](function(_0x510ecc){logger[_0x6ab6('0x19')](_0x6ab6('0x21'));return _0x510ecc;});}}function getEndUser(_0x219a33,_0x23814f,_0x96a2b2){logger['info']('Searching\x20enduser\x20with\x20phone',_0x96a2b2);return request({'uri':util[_0x6ab6('0x20')](_0x6ab6('0x24'),_0x219a33[_0x6ab6('0x16')]),'qs':{'phone':_0x96a2b2}})[_0x6ab6('0x18')](function(_0x4cbf6c){if(_0x4cbf6c[_0x6ab6('0x25')]){logger[_0x6ab6('0x19')](_0x6ab6('0x26'));return _[_0x6ab6('0x1d')](_0x4cbf6c,{'phone':_0x96a2b2});}else{logger[_0x6ab6('0x19')](_0x6ab6('0x27'));return request({'uri':util[_0x6ab6('0x20')]('%s/api/v2/contacts',_0x219a33[_0x6ab6('0x16')]),'method':_0x6ab6('0x17'),'body':{'name':_0x23814f,'phone':_0x96a2b2}})['then'](function(_0x2e357f){logger[_0x6ab6('0x19')](_0x6ab6('0x28'));return _0x2e357f;});}});}function getAuth(_0x7435c5){return util[_0x6ab6('0x20')](_0x6ab6('0x29'),new Buffer(_0x7435c5['apiKey']+':X')[_0x6ab6('0x2a')]('base64'));}function request(_0x14f004){logger[_0x6ab6('0x2b')](_0x6ab6('0x2c'),JSON['stringify'](_0x14f004));return rp(_[_0x6ab6('0x2d')](_0x14f004,{'method':_0x6ab6('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x56369a,_0x47cce2){var _0x18ef77=[];if(_0x56369a&&_0x56369a[_0x6ab6('0x25')]>0x0){_0x18ef77=_['map'](_0x56369a,_0x47cce2);}return _0x18ef77;}function getCustomFields(_0x499c16,_0x531b09){var _0x4a9a8a=[];var _0x384671={'custom_fields':[]};if(_0x499c16[_0x6ab6('0x25')]>0x0){_['forEach'](_0x499c16,function(_0x382e0a){if(_[_0x6ab6('0x2f')]([_0x6ab6('0x30'),_0x6ab6('0x31')],_0x382e0a[_0x6ab6('0x32')])&&_0x382e0a['nameField']&&!_0x382e0a['customField']){_0x384671[_0x382e0a[_0x6ab6('0x33')][_0x6ab6('0x34')]()]=_0x382e0a[_0x6ab6('0x35')][_0x6ab6('0x2a')]();}else if(_[_0x6ab6('0x2f')](['string',_0x6ab6('0x31')],_0x382e0a[_0x6ab6('0x32')])&&_0x382e0a[_0x6ab6('0x36')]&&_0x382e0a[_0x6ab6('0x37')]){_0x384671[_0x6ab6('0x11')]['push']({'id':_0x382e0a['idField'],'value':_0x382e0a[_0x6ab6('0x35')][_0x6ab6('0x2a')]()});}else if(_0x382e0a[_0x6ab6('0x32')]==='variable'&&_0x382e0a[_0x6ab6('0x38')]&&_0x382e0a['idField']&&_0x382e0a[_0x6ab6('0x37')]){_0x531b09[_0x382e0a[_0x6ab6('0x38')]]&&_0x384671[_0x6ab6('0x11')]['push']({'id':_0x382e0a['idField'],'value':_0x531b09[_0x382e0a[_0x6ab6('0x38')]][_0x6ab6('0x2a')]()});}else if(_0x382e0a[_0x6ab6('0x32')]===_0x6ab6('0x39')&&_0x382e0a['Variable']&&_0x382e0a['Variable'][_0x6ab6('0x3a')]&&_0x382e0a[_0x6ab6('0x36')]&&_0x382e0a[_0x6ab6('0x37')]){_0x531b09[_0x382e0a[_0x6ab6('0x3b')][_0x6ab6('0x3a')]['toLowerCase']()]&&_0x384671[_0x6ab6('0x11')][_0x6ab6('0x3c')]({'id':_0x382e0a[_0x6ab6('0x36')],'value':_0x531b09[_0x382e0a['Variable'][_0x6ab6('0x3a')]['toLowerCase']()][_0x6ab6('0x2a')]()});}});}return _0x384671;}exports[_0x6ab6('0x3d')]=function(_0x16e32b,_0x42b204,_0x199ce6,_0x2872fa,_0x13a842,_0x5e6755){var _0x370a35,_0x11617b;_0x5e6755[_0x6ab6('0x16')]=intUtil[_0x6ab6('0x3e')](_0x5e6755[_0x6ab6('0x16')]);_0x5e6755[_0x6ab6('0x3f')]=intUtil[_0x6ab6('0x3e')](_0x5e6755['serverUrl']);if(_0x13a842&&_0x13a842['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x42b204[_0x6ab6('0x40')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e6755[_0x6ab6('0x3f')],_0x42b204[_0x6ab6('0x41')],md5(_0x42b204[_0x6ab6('0x41')]));}else{_0x42b204[_0x6ab6('0x40')]='';}headers[_0x6ab6('0x42')]=getAuth(_0x5e6755);return getUser(_0x5e6755,_0x2872fa[_0x6ab6('0x43')])[_0x6ab6('0x18')](function(_0x5a1754){_0x370a35=_0x5a1754;logger['info']('The\x20User\x20ID\x20is:',_0x370a35['id']);return getEndUser(_0x5e6755,_0x42b204[_0x6ab6('0xa')],_0x42b204[_0x6ab6('0x44')]);})['then'](function(_0x578d3a){_0x11617b=_0x578d3a;logger['info'](_0x6ab6('0x45'),_0x11617b['id']);return getTicket(_0x5e6755,_0x370a35,_0x11617b,_0x199ce6,_0x42b204);})[_0x6ab6('0x18')](function(_0x34f070){if(_0x34f070&&_0x34f070['id']){logger[_0x6ab6('0x19')](_0x6ab6('0x1a'));logger[_0x6ab6('0x19')](_0x6ab6('0x46'),_0x34f070['id']);logger[_0x6ab6('0x19')](_0x6ab6('0x47'),_0x6ab6('0x48'));emit(util[_0x6ab6('0x20')]('user:%s',_0x2872fa[_0x6ab6('0x3a')]),'trigger:browser:url',{'uri':util[_0x6ab6('0x20')]('%s/helpdesk/tickets/%d',_0x5e6755['remoteUri'],_0x34f070['id'])});}})[_0x6ab6('0x49')](function(_0x41fac1){logger[_0x6ab6('0x4a')]('[QUEUE]',JSON[_0x6ab6('0x4b')](_0x41fac1));});};exports[_0x6ab6('0x4c')]=function(_0x23657d,_0x16a4e9,_0x5b8159,_0x3b2d2f,_0x33e922,_0x1f75c0,_0x29b94f){var _0x26a851,_0x4db968;_0x1f75c0['remoteUri']=intUtil['stripTrailingSlash'](_0x1f75c0[_0x6ab6('0x16')]);_0x1f75c0['serverUrl']=intUtil[_0x6ab6('0x3e')](_0x1f75c0[_0x6ab6('0x3f')]);if(_0x29b94f&&_0x29b94f[_0x6ab6('0x4d')]&&_0x29b94f[_0x6ab6('0x4d')]!=='none'){logger['info'](_0x6ab6('0x4e'),_0x6ab6('0x4f'));_0x16a4e9[_0x6ab6('0x40')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1f75c0['serverUrl'],_0x16a4e9[_0x6ab6('0x41')],md5(_0x16a4e9[_0x6ab6('0x41')]));}headers['Authorization']=getAuth(_0x1f75c0);return getUser(_0x1f75c0,_0x3b2d2f[_0x6ab6('0x43')])[_0x6ab6('0x18')](function(_0x19ef10){_0x26a851=_0x19ef10;logger['info'](_0x6ab6('0x50'),_0x26a851['id']);return getEndUser(_0x1f75c0,_0x16a4e9[_0x6ab6('0x51')],_0x16a4e9[_0x6ab6('0x52')]);})['then'](function(_0x2e6d62){_0x4db968=_0x2e6d62;logger[_0x6ab6('0x19')](_0x6ab6('0x45'),_0x4db968['id']);return getTicket(_0x1f75c0,_0x26a851,_0x4db968,_0x5b8159,_0x16a4e9);})[_0x6ab6('0x18')](function(_0x5df007){if(_0x5df007&&_0x5df007['id']){logger[_0x6ab6('0x19')](_0x6ab6('0x1a'));logger['info'](_0x6ab6('0x46'),_0x5df007['id']);logger[_0x6ab6('0x19')](_0x6ab6('0x4e'),_0x6ab6('0x48'));emit(util[_0x6ab6('0x20')](_0x6ab6('0x53'),_0x3b2d2f[_0x6ab6('0x3a')]),_0x6ab6('0x54'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x1f75c0['remoteUri'],_0x5df007['id'])});}})[_0x6ab6('0x49')](function(_0x5b06c9){logger[_0x6ab6('0x4a')](_0x6ab6('0x4e'),JSON[_0x6ab6('0x4b')](_0x5b06c9));});};exports[_0x6ab6('0x55')]=function(_0x289068,_0x1536d8,_0x250dac,_0x5dbd19,_0x4181cb,_0x2f6022){var _0x1da245,_0x2e23e4;_0x2f6022[_0x6ab6('0x16')]=intUtil[_0x6ab6('0x3e')](_0x2f6022[_0x6ab6('0x16')]);_0x2f6022['serverUrl']=intUtil['stripTrailingSlash'](_0x2f6022[_0x6ab6('0x3f')]);if(_0x4181cb&&_0x4181cb[_0x6ab6('0x56')]){logger[_0x6ab6('0x19')]('['+_0x1536d8['lastevent'][_0x6ab6('0x57')]()+']',_0x6ab6('0x4f'));_0x1536d8[_0x6ab6('0x40')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f6022[_0x6ab6('0x3f')],_0x1536d8[_0x6ab6('0x41')],md5(_0x1536d8[_0x6ab6('0x41')]));}else{_0x1536d8['recordingURL']='';}headers[_0x6ab6('0x42')]=getAuth(_0x2f6022);return getUser(_0x2f6022,'')['then'](function(_0x5924ee){_0x1da245=_0x5924ee;logger[_0x6ab6('0x19')](_0x6ab6('0x50'),_0x1da245['id']);return getEndUser(_0x2f6022,_0x1536d8[_0x6ab6('0xa')],_0x1536d8['calleridnum']);})['then'](function(_0x540ece){_0x2e23e4=_0x540ece;logger['info'](_0x6ab6('0x45'),_0x2e23e4['id']);return getTicket(_0x2f6022,_0x1da245,_0x2e23e4,_0x250dac,_0x1536d8);})[_0x6ab6('0x18')](function(_0x539bb7){if(_0x539bb7){logger['info'](_0x6ab6('0x1a'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x539bb7['id']);}})[_0x6ab6('0x49')](function(_0x1d8589){logger[_0x6ab6('0x4a')]('['+_0x1536d8['lastevent'][_0x6ab6('0x57')]()+']',JSON[_0x6ab6('0x4b')](_0x1d8589));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index d45d162..2b63331 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa3b=['error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','Admin\x20selected','catch','/api/lookup?q=','&f=','&entities=contact','then','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','serverUrl','remoteUri','username','toLowerCase','outbound','destcalleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','util','bluebird','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found'];(function(_0x44e7b9,_0xf7f5cc){var _0x1de7ac=function(_0x307551){while(--_0x307551){_0x44e7b9['push'](_0x44e7b9['shift']());}};_0x1de7ac(++_0xf7f5cc);}(_0xaa3b,0x13c));var _0xbaa3=function(_0x53a167,_0x4bf6c7){_0x53a167=_0x53a167-0x0;var _0x150263=_0xaa3b[_0x53a167];return _0x150263;};'use strict';var _=require('lodash');var rp=require(_0xbaa3('0x0'));var md5=require('md5');var util=require(_0xbaa3('0x1'));var moment=require('moment');var Promise=require(_0xbaa3('0x2'));var Redis=require(_0xbaa3('0x3'));var intUtil=require(_0xbaa3('0x4'));var config=require('../../../../config/environment');var logger=require(_0xbaa3('0x5'))('freshsales');config['redis']=_[_0xbaa3('0x6')](config[_0xbaa3('0x7')],{'host':_0xbaa3('0x8'),'port':0x18eb});var io=require(_0xbaa3('0x9'))(new Redis(config[_0xbaa3('0x7')]));function getAdminId(_0x45d8bd,_0x20f80c,_0x4cd3cc,_0x3ab2de){return new Promise(function(_0x49ea8d,_0x251dad){var _0x8b8c0f=![];var _0x5ee79d={'method':_0xbaa3('0xa'),'uri':_0x3ab2de+_0xbaa3('0xb'),'json':!![]};_0x5ee79d[_0xbaa3('0xc')]=_0x4cd3cc;logger[_0xbaa3('0xd')](_0xbaa3('0xe'));return rp(_0x5ee79d)['then'](function(_0x2bc455){if(_0x2bc455){var _0x4f5f4f=_0x2bc455[_0xbaa3('0xf')];var _0x428be7=null;for(_0x428be7=0x0;_0x428be7<_0x4f5f4f[_0xbaa3('0x10')];_0x428be7++){if(_0x4f5f4f[_0x428be7]['email']===_0x45d8bd[_0xbaa3('0x11')]){_0x45d8bd[_0xbaa3('0x12')]=_0x4f5f4f[_0x428be7]['id'];_0x8b8c0f=!![];}}if(_0x8b8c0f){logger[_0xbaa3('0xd')]('Admin\x20found:',_0x45d8bd[_0xbaa3('0x12')]);_0x49ea8d(_0x45d8bd);}else{_0x251dad({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x251dad({'statusCode':0x194,'message':_0xbaa3('0x13')});}})['catch'](function(_0x3b1cd0){logger[_0xbaa3('0x14')]('['+[_0x20f80c[_0xbaa3('0x15')]()]+']',_0x3b1cd0[_0xbaa3('0x16')]);_0x251dad(_0x3b1cd0);});});}function getUser(_0x507553,_0x47bec7,_0x4024a7){return function(_0x3c3f14){return new Promise(function(_0x59be54,_0xef6d7a){var _0xda8c4d={'method':_0xbaa3('0xa'),'uri':_0x4024a7+_0xbaa3('0xb'),'json':!![]};_0xda8c4d[_0xbaa3('0xc')]=_0x47bec7;logger[_0xbaa3('0xd')]('Getting\x20user\x20list');return rp(_0xda8c4d)['then'](function(_0x24a13c){if(_0x24a13c){var _0x3a1f9a=_0x24a13c[_0xbaa3('0xf')];var _0x456957=![];var _0x9897c7=null;if(_0x3c3f14[_0xbaa3('0x17')]!==null){logger[_0xbaa3('0xd')](_0xbaa3('0x18'),_0x3c3f14[_0xbaa3('0x17')]);_0x3c3f14[_0xbaa3('0x19')]=_0x3c3f14['agentEmail'];for(_0x9897c7=0x0;_0x9897c7<_0x3a1f9a[_0xbaa3('0x10')];_0x9897c7++){if(_0x3a1f9a[_0x9897c7][_0xbaa3('0x1a')]===_0x3c3f14[_0xbaa3('0x17')]){_0x456957=!![];_0x3c3f14[_0xbaa3('0x1b')]=_0x3a1f9a[_0x9897c7]['id'];logger[_0xbaa3('0xd')](_0xbaa3('0x1c'),_0x3c3f14[_0xbaa3('0x1b')]);}}}if(!_0x456957){logger[_0xbaa3('0xd')](_0xbaa3('0x1d'));_0x3c3f14[_0xbaa3('0x19')]=_0x3c3f14[_0xbaa3('0x11')];_0x3c3f14['userId']=_0x3c3f14['adminId'];_0x456957=!![];}if(_0x456957){_0x59be54(_0x3c3f14);}else{_0xef6d7a({'statusCode':0x194,'message':_0xbaa3('0x13')});}}else{_0xef6d7a({'statusCode':0x194,'message':_0xbaa3('0x13')});}})[_0xbaa3('0x1e')](function(_0x1f43c9){logger[_0xbaa3('0x14')]('['+[_0x507553[_0xbaa3('0x15')]()]+']',_0x1f43c9[_0xbaa3('0x16')]);_0xef6d7a(_0x1f43c9);});});};}function searchContact(_0x9d8cdd,_0x2145b4,_0x1af904,_0x2365f2){return new Promise(function(_0x24f9e4,_0x56e654){var _0x5cfde3={'method':_0xbaa3('0xa'),'headers':_0x2145b4,'uri':_0x9d8cdd+_0xbaa3('0x1f')+_0x2365f2+_0xbaa3('0x20')+_0x1af904+_0xbaa3('0x21'),'json':!![]};rp(_0x5cfde3)[_0xbaa3('0x22')](function(_0x1a6dae){var _0x5b83bb=_[_0xbaa3('0x23')](_0x1a6dae['contacts'][_0xbaa3('0x24')],[_0x1af904,_0x2365f2]);_0x24f9e4(_0x5b83bb);})[_0xbaa3('0x1e')](function(_0x553fc6){_0x56e654(_0x553fc6);});});}function getEndUser(_0x491a6e,_0x5a145f,_0x2ebe62){return function(_0x5eb1e2){return new Promise(function(_0x18b588,_0x1b2bfb){logger['info'](util[_0xbaa3('0x25')](_0xbaa3('0x26'),_0x5eb1e2[_0xbaa3('0x27')]));searchContact(_0x2ebe62,_0x5a145f,_0xbaa3('0x28'),_0x5eb1e2[_0xbaa3('0x27')])[_0xbaa3('0x22')](function(_0x5108f1){if(_0x5108f1){_0x5eb1e2[_0xbaa3('0x29')]=_0x5108f1['id'];logger[_0xbaa3('0xd')](_0xbaa3('0x2a'),_0x5eb1e2['endUserId']);return _0x18b588(_0x5eb1e2);}searchContact(_0x2ebe62,_0x5a145f,_0xbaa3('0x2b'),_0x5eb1e2['contactNumber'])[_0xbaa3('0x22')](function(_0x5cf9bb){if(_0x5cf9bb){_0x5eb1e2[_0xbaa3('0x29')]=_0x5cf9bb['id'];logger[_0xbaa3('0xd')](_0xbaa3('0x2c'),_0x5eb1e2['endUserId']);return _0x18b588(_0x5eb1e2);}createEndUser(_0x5eb1e2,_0x491a6e,_0x5a145f,_0x2ebe62)[_0xbaa3('0x22')](function(_0x18496f){logger['info'](_0xbaa3('0x2d'),_0x18496f['endUserId']);return _0x18b588(_0x18496f);});});})[_0xbaa3('0x1e')](function(_0x37316d){_0x1b2bfb(_0x37316d);});});};}function createEndUser(_0x71817c,_0x27fe9c,_0x26c781,_0xcd30ef){return new Promise(function(_0x1e7d90,_0x45f54f){var _0x2b9da9=moment();var _0xd9d8e5={'method':_0xbaa3('0x2e'),'uri':_0xcd30ef+_0xbaa3('0x2f'),'body':{'contact':{'last_name':_0x71817c[_0xbaa3('0x27')],'work_number':_0x71817c[_0xbaa3('0x27')],'mobile_number':_0x71817c[_0xbaa3('0x27')],'owner_id':_0x71817c[_0xbaa3('0x1b')],'created_at':_0x2b9da9[_0xbaa3('0x25')](_0xbaa3('0x30'))}},'json':!![]};_0xd9d8e5[_0xbaa3('0xc')]=_0x26c781;logger[_0xbaa3('0xd')](_0xbaa3('0x31'));return rp(_0xd9d8e5)[_0xbaa3('0x22')](function(_0x19a8bd){_0x71817c[_0xbaa3('0x29')]=_0x19a8bd[_0xbaa3('0x32')]['id'];_0x1e7d90(_0x71817c);})[_0xbaa3('0x1e')](function(_0xa38aaa){logger['error']('['+[_0x27fe9c[_0xbaa3('0x15')]()]+']',_0xa38aaa[_0xbaa3('0x16')]);_0x45f54f(_0xa38aaa[_0xbaa3('0x16')]);});});}function getTicket(_0x1ce4d1,_0x56f53b,_0x3084aa,_0x765543,_0x426aa7){return function(_0x412d87){logger[_0xbaa3('0xd')](_0xbaa3('0x33'));return new Promise(function(_0x21d844,_0x7b31ca){var _0x5ace2f=moment();var _0x1d1519={'method':_0xbaa3('0x2e'),'uri':_0x3084aa+'/api/tasks','body':{'title':intUtil[_0xbaa3('0x34')](_0x765543[_0xbaa3('0x35')],_0x426aa7,'\x20'),'description':intUtil['getString'](_0x765543[_0xbaa3('0x36')],_0x426aa7,'\x0a'),'owner_id':_0x412d87[_0xbaa3('0x1b')],'creater_id':_0x412d87['adminId'],'targetable_id':_0x412d87[_0xbaa3('0x29')],'targetable_type':_0xbaa3('0x37'),'created_at':_0x5ace2f[_0xbaa3('0x25')](_0xbaa3('0x30')),'due_date':_0x5ace2f['add'](0x1e,'m')['format'](_0xbaa3('0x30'))},'json':!![]};_0x1d1519[_0xbaa3('0xc')]=_0x56f53b;return rp(_0x1d1519)['then'](function(_0x191c00){_0x412d87['ticketId']=_0x191c00[_0xbaa3('0x38')]['id'];logger[_0xbaa3('0xd')](_0xbaa3('0x39'),_0x412d87['ticketId']);_0x21d844(_0x412d87);})['catch'](function(_0x4a6896){logger['error']('['+[_0x1ce4d1[_0xbaa3('0x15')]()]+']',_0x4a6896[_0xbaa3('0x16')]);_0x7b31ca(_0x4a6896[_0xbaa3('0x16')]);});});};}function emit(_0x54a748,_0x3066ad,_0x25b681){var _0x2a01af={'uri':_0x54a748+_0xbaa3('0x3a')+_0x25b681};io['to'](util['format'](_0xbaa3('0x3b'),_0x3066ad))[_0xbaa3('0x3c')](_0xbaa3('0x3d'),_0x2a01af);}exports['cs']=function(_0x2f6170,_0x4cfa41,_0xa81142,_0x270177,_0x488bc6,_0x19d303,_0x18bd9a,_0x484c72){var _0x27e46d={};var _0x421206={'Authorization':_0xbaa3('0x3e')+_0x19d303[_0xbaa3('0x3f')]};_0x19d303['remoteUri']=intUtil['stripTrailingSlash'](_0x19d303['remoteUri']);_0x19d303['serverUrl']=intUtil['stripTrailingSlash'](_0x19d303[_0xbaa3('0x40')]);var _0xc1eee=_0x19d303[_0xbaa3('0x41')];_0x27e46d[_0xbaa3('0x11')]=_0x19d303[_0xbaa3('0x42')];_0x27e46d[_0xbaa3('0x27')]=_0x484c72[_0xbaa3('0x43')]()===_0xbaa3('0x44')?_0x4cfa41[_0xbaa3('0x45')]:_0x4cfa41['calleridnum'];_0x27e46d[_0xbaa3('0x46')]=_0x484c72==='queue'||_0x484c72===_0xbaa3('0x47')?_0xbaa3('0x48'):'outbound';if(_0x270177){_0x27e46d[_0xbaa3('0x17')]=_0x270177[_0xbaa3('0x1a')];}var _0x3f2546=util['format'](_0xbaa3('0x49'),_0x19d303['serverUrl'],_0x4cfa41['uniqueid'],md5(_0x4cfa41[_0xbaa3('0x4a')]));if(_0x488bc6&&_0x488bc6[_0xbaa3('0x4b')]){logger['info'](_0xbaa3('0x4c'),_0xbaa3('0x4d'));_0x4cfa41[_0xbaa3('0x4e')]=_0x3f2546;}else if(_0x18bd9a&&_0x18bd9a['recordingFormat']&&_0x18bd9a['recordingFormat']!=='none'){logger[_0xbaa3('0xd')](_0xbaa3('0x4f'),_0xbaa3('0x4d'));_0x4cfa41['recordingURL']=_0x3f2546;}else{_0x4cfa41[_0xbaa3('0x4e')]='';}return getAdminId(_0x27e46d,_0x484c72,_0x421206,_0xc1eee)[_0xbaa3('0x22')](getUser(_0x484c72,_0x421206,_0xc1eee))[_0xbaa3('0x22')](getEndUser(_0x484c72,_0x421206,_0xc1eee))[_0xbaa3('0x22')](getTicket(_0x484c72,_0x421206,_0xc1eee,_0xa81142,_0x4cfa41))['then'](function(_0x5d4830){logger[_0xbaa3('0xd')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x5d4830['ticketId']));if(_0x484c72!==_0xbaa3('0x47')){logger[_0xbaa3('0xd')]('['+[_0x484c72[_0xbaa3('0x15')]()]+']',_0xbaa3('0x50'));emit(_0xc1eee,_0x270177[_0xbaa3('0x51')],_0x5d4830[_0xbaa3('0x29')]);}})[_0xbaa3('0x1e')](function(_0x34f02f){logger[_0xbaa3('0x14')]('['+[_0x484c72['toUpperCase']()]+_0xbaa3('0x52'),util[_0xbaa3('0x53')](_0x34f02f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7d96=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','headers','Getting\x20admin\x20information','users','length','email','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userId','User\x20found:','userEmail','error','/api/lookup?q=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','then','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','POST','/api/tasks','Subjects','getString','Descriptions','Contact','ticketId','task','Task\x20created:','user:%s','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x54bbef,_0x1aab38){var _0x9dc657=function(_0x2a782e){while(--_0x2a782e){_0x54bbef['push'](_0x54bbef['shift']());}};_0x9dc657(++_0x1aab38);}(_0x7d96,0x102));var _0x67d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x67d9('0x0'));var rp=require(_0x67d9('0x1'));var md5=require(_0x67d9('0x2'));var util=require(_0x67d9('0x3'));var moment=require(_0x67d9('0x4'));var Promise=require('bluebird');var Redis=require(_0x67d9('0x5'));var intUtil=require(_0x67d9('0x6'));var config=require('../../../../config/environment');var logger=require(_0x67d9('0x7'))(_0x67d9('0x8'));config[_0x67d9('0x9')]=_[_0x67d9('0xa')](config[_0x67d9('0x9')],{'host':_0x67d9('0xb'),'port':0x18eb});var io=require(_0x67d9('0xc'))(new Redis(config[_0x67d9('0x9')]));function getAdminId(_0x1cfd9a,_0x266d17,_0x2b85ef,_0x59557d){return new Promise(function(_0x572363,_0x193268){var _0x56f916=![];var _0x3433bf={'method':'GET','uri':_0x59557d+'/api/selector/owners','json':!![]};_0x3433bf[_0x67d9('0xd')]=_0x2b85ef;logger['info'](_0x67d9('0xe'));return rp(_0x3433bf)['then'](function(_0x23a245){if(_0x23a245){var _0x11f640=_0x23a245[_0x67d9('0xf')];var _0x3465fb=null;for(_0x3465fb=0x0;_0x3465fb<_0x11f640[_0x67d9('0x10')];_0x3465fb++){if(_0x11f640[_0x3465fb][_0x67d9('0x11')]===_0x1cfd9a['adminEmail']){_0x1cfd9a[_0x67d9('0x12')]=_0x11f640[_0x3465fb]['id'];_0x56f916=!![];}}if(_0x56f916){logger[_0x67d9('0x13')](_0x67d9('0x14'),_0x1cfd9a[_0x67d9('0x12')]);_0x572363(_0x1cfd9a);}else{_0x193268({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x193268({'statusCode':0x194,'message':_0x67d9('0x15')});}})[_0x67d9('0x16')](function(_0x523886){logger['error']('['+[_0x266d17[_0x67d9('0x17')]()]+']',_0x523886[_0x67d9('0x18')]);_0x193268(_0x523886);});});}function getUser(_0x365e8e,_0x3470cf,_0x4706f5){return function(_0x14a126){return new Promise(function(_0x32f747,_0x80435b){var _0x30c2b2={'method':_0x67d9('0x19'),'uri':_0x4706f5+_0x67d9('0x1a'),'json':!![]};_0x30c2b2[_0x67d9('0xd')]=_0x3470cf;logger['info'](_0x67d9('0x1b'));return rp(_0x30c2b2)['then'](function(_0x4b8415){if(_0x4b8415){var _0x356ba9=_0x4b8415['users'];var _0x57e6d4=![];var _0x4d1b32=null;if(_0x14a126['agentEmail']!==null){logger['info'](_0x67d9('0x1c'),_0x14a126[_0x67d9('0x1d')]);_0x14a126['userEmail']=_0x14a126[_0x67d9('0x1d')];for(_0x4d1b32=0x0;_0x4d1b32<_0x356ba9[_0x67d9('0x10')];_0x4d1b32++){if(_0x356ba9[_0x4d1b32][_0x67d9('0x11')]===_0x14a126[_0x67d9('0x1d')]){_0x57e6d4=!![];_0x14a126[_0x67d9('0x1e')]=_0x356ba9[_0x4d1b32]['id'];logger[_0x67d9('0x13')](_0x67d9('0x1f'),_0x14a126['userId']);}}}if(!_0x57e6d4){logger[_0x67d9('0x13')]('Admin\x20selected');_0x14a126[_0x67d9('0x20')]=_0x14a126['adminEmail'];_0x14a126[_0x67d9('0x1e')]=_0x14a126[_0x67d9('0x12')];_0x57e6d4=!![];}if(_0x57e6d4){_0x32f747(_0x14a126);}else{_0x80435b({'statusCode':0x194,'message':_0x67d9('0x15')});}}else{_0x80435b({'statusCode':0x194,'message':_0x67d9('0x15')});}})[_0x67d9('0x16')](function(_0x140314){logger[_0x67d9('0x21')]('['+[_0x365e8e[_0x67d9('0x17')]()]+']',_0x140314['message']);_0x80435b(_0x140314);});});};}function searchContact(_0x20a9d2,_0x2325d0,_0x2cd683,_0x36f739){return new Promise(function(_0x2d7a88,_0x493751){var _0x42815f={'method':_0x67d9('0x19'),'headers':_0x2325d0,'uri':_0x20a9d2+_0x67d9('0x22')+_0x36f739+'&f='+_0x2cd683+_0x67d9('0x23'),'json':!![]};rp(_0x42815f)['then'](function(_0x4e924b){var _0x26cf09=_[_0x67d9('0x24')](_0x4e924b[_0x67d9('0x25')][_0x67d9('0x25')],[_0x2cd683,_0x36f739]);_0x2d7a88(_0x26cf09);})[_0x67d9('0x16')](function(_0x389015){_0x493751(_0x389015);});});}function getEndUser(_0xad7cbb,_0x2d97cf,_0x3941ca){return function(_0x4b64fe){return new Promise(function(_0x577ae1,_0x1dc339){logger['info'](util['format'](_0x67d9('0x26'),_0x4b64fe['contactNumber']));searchContact(_0x3941ca,_0x2d97cf,_0x67d9('0x27'),_0x4b64fe[_0x67d9('0x28')])[_0x67d9('0x29')](function(_0x4b4628){if(_0x4b4628){_0x4b64fe[_0x67d9('0x2a')]=_0x4b4628['id'];logger['info'](_0x67d9('0x2b'),_0x4b64fe[_0x67d9('0x2a')]);return _0x577ae1(_0x4b64fe);}searchContact(_0x3941ca,_0x2d97cf,_0x67d9('0x2c'),_0x4b64fe[_0x67d9('0x28')])['then'](function(_0x5271eb){if(_0x5271eb){_0x4b64fe[_0x67d9('0x2a')]=_0x5271eb['id'];logger[_0x67d9('0x13')](_0x67d9('0x2d'),_0x4b64fe[_0x67d9('0x2a')]);return _0x577ae1(_0x4b64fe);}createEndUser(_0x4b64fe,_0xad7cbb,_0x2d97cf,_0x3941ca)[_0x67d9('0x29')](function(_0x24fa6b){logger['info'](_0x67d9('0x2e'),_0x24fa6b[_0x67d9('0x2a')]);return _0x577ae1(_0x24fa6b);});});})[_0x67d9('0x16')](function(_0x4e1e31){_0x1dc339(_0x4e1e31);});});};}function createEndUser(_0x3acb14,_0x545d32,_0x3bb68a,_0x1e2c96){return new Promise(function(_0x1c241d,_0x273948){var _0x497464=moment();var _0x24d1f2={'method':'POST','uri':_0x1e2c96+_0x67d9('0x2f'),'body':{'contact':{'last_name':_0x3acb14[_0x67d9('0x28')],'work_number':_0x3acb14['contactNumber'],'mobile_number':_0x3acb14[_0x67d9('0x28')],'owner_id':_0x3acb14[_0x67d9('0x1e')],'created_at':_0x497464[_0x67d9('0x30')](_0x67d9('0x31'))}},'json':!![]};_0x24d1f2[_0x67d9('0xd')]=_0x3bb68a;logger[_0x67d9('0x13')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x24d1f2)['then'](function(_0x14386f){_0x3acb14[_0x67d9('0x2a')]=_0x14386f[_0x67d9('0x32')]['id'];_0x1c241d(_0x3acb14);})['catch'](function(_0x5a1ee8){logger[_0x67d9('0x21')]('['+[_0x545d32['toUpperCase']()]+']',_0x5a1ee8[_0x67d9('0x18')]);_0x273948(_0x5a1ee8[_0x67d9('0x18')]);});});}function getTicket(_0x475216,_0x15d834,_0x2fab45,_0x1b8b86,_0x25b753){return function(_0x9cc64e){logger[_0x67d9('0x13')](_0x67d9('0x33'));return new Promise(function(_0x16f9a6,_0xe73ad5){var _0x1b3d0a=moment();var _0x14c77d={'method':_0x67d9('0x34'),'uri':_0x2fab45+_0x67d9('0x35'),'body':{'title':intUtil['getString'](_0x1b8b86[_0x67d9('0x36')],_0x25b753,'\x20'),'description':intUtil[_0x67d9('0x37')](_0x1b8b86[_0x67d9('0x38')],_0x25b753,'\x0a'),'owner_id':_0x9cc64e[_0x67d9('0x1e')],'creater_id':_0x9cc64e['adminId'],'targetable_id':_0x9cc64e['endUserId'],'targetable_type':_0x67d9('0x39'),'created_at':_0x1b3d0a['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1b3d0a['add'](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x14c77d[_0x67d9('0xd')]=_0x15d834;return rp(_0x14c77d)[_0x67d9('0x29')](function(_0x1fd65c){_0x9cc64e[_0x67d9('0x3a')]=_0x1fd65c[_0x67d9('0x3b')]['id'];logger[_0x67d9('0x13')](_0x67d9('0x3c'),_0x9cc64e[_0x67d9('0x3a')]);_0x16f9a6(_0x9cc64e);})['catch'](function(_0x566456){logger[_0x67d9('0x21')]('['+[_0x475216[_0x67d9('0x17')]()]+']',_0x566456[_0x67d9('0x18')]);_0xe73ad5(_0x566456[_0x67d9('0x18')]);});});};}function emit(_0x788530,_0x36ffe7,_0x1ef696){var _0x3c2f64={'uri':_0x788530+'/contacts/'+_0x1ef696};io['to'](util[_0x67d9('0x30')](_0x67d9('0x3d'),_0x36ffe7))['emit']('trigger:browser:url',_0x3c2f64);}exports['cs']=function(_0x236ad4,_0x48b1a8,_0x29e651,_0x24cef1,_0x1bed2f,_0x4be564,_0x3028a5,_0x4e0a9a){var _0x140d6d={};var _0xa85fac={'Authorization':_0x67d9('0x3e')+_0x4be564['apiKey']};_0x4be564[_0x67d9('0x3f')]=intUtil[_0x67d9('0x40')](_0x4be564[_0x67d9('0x3f')]);_0x4be564[_0x67d9('0x41')]=intUtil[_0x67d9('0x40')](_0x4be564['serverUrl']);var _0x28ef28=_0x4be564[_0x67d9('0x3f')];_0x140d6d[_0x67d9('0x42')]=_0x4be564[_0x67d9('0x43')];_0x140d6d['contactNumber']=_0x4e0a9a['toLowerCase']()===_0x67d9('0x44')?_0x48b1a8[_0x67d9('0x45')]:_0x48b1a8[_0x67d9('0x46')];_0x140d6d['callDirection']=_0x4e0a9a===_0x67d9('0x47')||_0x4e0a9a===_0x67d9('0x48')?_0x67d9('0x47'):_0x67d9('0x44');if(_0x24cef1){_0x140d6d[_0x67d9('0x1d')]=_0x24cef1[_0x67d9('0x11')];}var _0x50f6e5=util[_0x67d9('0x30')](_0x67d9('0x49'),_0x4be564[_0x67d9('0x41')],_0x48b1a8[_0x67d9('0x4a')],md5(_0x48b1a8[_0x67d9('0x4a')]));if(_0x1bed2f&&_0x1bed2f[_0x67d9('0x4b')]){logger[_0x67d9('0x13')](_0x67d9('0x4c'),_0x67d9('0x4d'));_0x48b1a8[_0x67d9('0x4e')]=_0x50f6e5;}else if(_0x3028a5&&_0x3028a5['recordingFormat']&&_0x3028a5['recordingFormat']!==_0x67d9('0x4f')){logger[_0x67d9('0x13')]('[OUTBOUND]',_0x67d9('0x4d'));_0x48b1a8[_0x67d9('0x4e')]=_0x50f6e5;}else{_0x48b1a8[_0x67d9('0x4e')]='';}return getAdminId(_0x140d6d,_0x4e0a9a,_0xa85fac,_0x28ef28)[_0x67d9('0x29')](getUser(_0x4e0a9a,_0xa85fac,_0x28ef28))[_0x67d9('0x29')](getEndUser(_0x4e0a9a,_0xa85fac,_0x28ef28))[_0x67d9('0x29')](getTicket(_0x4e0a9a,_0xa85fac,_0x28ef28,_0x29e651,_0x48b1a8))[_0x67d9('0x29')](function(_0x19069b){logger['info'](util[_0x67d9('0x30')]('The\x20ticket\x20ID\x20is:\x20%s',_0x19069b[_0x67d9('0x3a')]));if(_0x4e0a9a!==_0x67d9('0x48')){logger[_0x67d9('0x13')]('['+[_0x4e0a9a['toUpperCase']()]+']',_0x67d9('0x50'));emit(_0x28ef28,_0x24cef1[_0x67d9('0x51')],_0x19069b[_0x67d9('0x2a')]);}})[_0x67d9('0x16')](function(_0x4e9cd4){logger['error']('['+[_0x4e0a9a[_0x67d9('0x17')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x67d9('0x52')](_0x4e9cd4,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 53e76bb..747d73a 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc7a=['freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','Configurations','data3','queue','log','unmanaged','data1','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./sugarcrm','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm'];(function(_0x2e868b,_0x196766){var _0x51c240=function(_0x384e43){while(--_0x384e43){_0x2e868b['push'](_0x2e868b['shift']());}};_0x51c240(++_0x196766);}(_0xcc7a,0x16b));var _0xacc7=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0xcc7a[_0x557fd2];return _0x1b54a2;};'use strict';var _=require(_0xacc7('0x0'));var util=require(_0xacc7('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xacc7('0x2'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0xacc7('0x3'));var vtiger=require(_0xacc7('0x4'));var servicenow=require(_0xacc7('0x5'));var dynamics365=require(_0xacc7('0x6'));var freshsales=require(_0xacc7('0x7'));var integrations=[_0xacc7('0x8'),_0xacc7('0x9'),_0xacc7('0xa'),_0xacc7('0xb'),_0xacc7('0xc'),_0xacc7('0xd'),_0xacc7('0xe'),_0xacc7('0xf'),_0xacc7('0x10'),_0xacc7('0x11')];exports[_0xacc7('0x12')]=function(_0x1be63c,_0x2ac7f0,_0x41da11,_0xd352d1,_0x4a6149,_0x62d684){if(_0x41da11){if(_[_0xacc7('0x13')](integrations,_0x1be63c['data1'][_0xacc7('0x14')]())){try{var _0x449cbc=null;var _0x5a5a46='';var _0x2393d3=_0x41da11[_0x1be63c['data1'][_0xacc7('0x14')]()];if(_0x2393d3){var _0x556cd4=_0x2393d3[_0x1be63c['data2']];if(_0x556cd4){var _0x2706b4=_['find'](_0x556cd4[_0xacc7('0x15')],{'id':parseInt(_0x1be63c[_0xacc7('0x16')],0xa)});if(_0x2706b4){if(_0xd352d1){if(_0x4a6149&&_0x2ac7f0[_0xacc7('0x17')]){_0x5a5a46=_0xacc7('0x17');}else if(_0x2ac7f0['routeId']){_0x5a5a46='outbound';}else{console[_0xacc7('0x18')]('EVENT\x20UNKNOWN',_0x2ac7f0);}}else{_0x5a5a46=_0xacc7('0x19');}switch(_0x1be63c[_0xacc7('0x1a')][_0xacc7('0x14')]()){case _0xacc7('0x8'):zendesk[_0x5a5a46](_0x1be63c,_0x2ac7f0,_0x2706b4,_0xd352d1,_0x4a6149,_0x556cd4,_0x62d684);break;case _0xacc7('0x9'):salesforce[_0x5a5a46](_0x1be63c,_0x2ac7f0,_0x2706b4,_0xd352d1,_0x4a6149,_0x556cd4,_0x62d684);break;case _0xacc7('0xa'):sugarcrm[_0x5a5a46](_0x1be63c,_0x2ac7f0,_0x2706b4,_0xd352d1,_0x4a6149,_0x556cd4,_0x62d684);break;case _0xacc7('0xb'):freshdesk[_0x5a5a46](_0x1be63c,_0x2ac7f0,_0x2706b4,_0xd352d1,_0x4a6149,_0x556cd4,_0x62d684);break;case _0xacc7('0xc'):zoho[_0x5a5a46](_0x1be63c,_0x2ac7f0,_0x2706b4,_0xd352d1,_0x4a6149,_0x556cd4,_0x62d684);break;case'desk':desk[_0x5a5a46](_0x1be63c,_0x2ac7f0,_0x2706b4,_0xd352d1,_0x4a6149,_0x556cd4,_0x62d684);break;case _0xacc7('0xe'):vtiger[_0x5a5a46](_0x1be63c,_0x2ac7f0,_0x2706b4,_0xd352d1,_0x4a6149,_0x556cd4,_0x62d684);break;case'freshsales':freshsales['cs'](_0x1be63c,_0x2ac7f0,_0x2706b4,_0xd352d1,_0x4a6149,_0x556cd4,_0x62d684,_0x5a5a46);break;case _0xacc7('0x11'):servicenow['cs'](_0x1be63c,_0x2ac7f0,_0x2706b4,_0xd352d1,_0x4a6149,_0x556cd4,_0x62d684,_0x5a5a46);break;case _0xacc7('0xf'):dynamics365['cs'](_0x1be63c,_0x2ac7f0,_0x2706b4,_0xd352d1,_0x4a6149,_0x556cd4,_0x62d684,_0x5a5a46);break;default:console[_0xacc7('0x18')](_0xacc7('0x1b'));}}else{_0x449cbc=require(_0xacc7('0x1c'))(_0x1be63c[_0xacc7('0x1a')][_0xacc7('0x14')]());_0x449cbc[_0xacc7('0x1d')](_0xacc7('0x1e'),util[_0xacc7('0x1f')]('%s\x20configuration\x20#%s\x20not\x20found',_0x1be63c[_0xacc7('0x1a')][_0xacc7('0x14')](),_0x1be63c[_0xacc7('0x16')]));}}else{_0x449cbc=require('../../../../config/logger')(_0x1be63c[_0xacc7('0x1a')]['toLowerCase']());_0x449cbc[_0xacc7('0x1d')]('[EXEC]',util[_0xacc7('0x1f')](_0xacc7('0x20'),_0x1be63c[_0xacc7('0x1a')][_0xacc7('0x14')](),_0x1be63c[_0xacc7('0x21')]));}}else{}}catch(_0x5bcc79){console[_0xacc7('0x1d')](_0x5bcc79);}}}}; \ No newline at end of file +var _0xfb91=['./dynamics365','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','salesforce','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./desk','./servicenow'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0xfb91,0x1da));var _0x1fb9=function(_0x30e69f,_0x3010ab){_0x30e69f=_0x30e69f-0x0;var _0x5008e4=_0xfb91[_0x30e69f];return _0x5008e4;};'use strict';var _=require(_0x1fb9('0x0'));var util=require(_0x1fb9('0x1'));var zendesk=require(_0x1fb9('0x2'));var salesforce=require(_0x1fb9('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x1fb9('0x4'));var zoho=require('./zoho');var desk=require(_0x1fb9('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0x1fb9('0x6'));var dynamics365=require(_0x1fb9('0x7'));var freshsales=require('./freshsales');var integrations=[_0x1fb9('0x8'),'salesforce',_0x1fb9('0x9'),_0x1fb9('0xa'),_0x1fb9('0xb'),_0x1fb9('0xc'),_0x1fb9('0xd'),_0x1fb9('0xe'),_0x1fb9('0xf'),_0x1fb9('0x10')];exports[_0x1fb9('0x11')]=function(_0x597df5,_0x21362b,_0x1128f6,_0x3e367d,_0x102e47,_0x5f5a36){if(_0x1128f6){if(_[_0x1fb9('0x12')](integrations,_0x597df5[_0x1fb9('0x13')][_0x1fb9('0x14')]())){try{var _0x356131=null;var _0x3bcae9='';var _0x4d34d6=_0x1128f6[_0x597df5[_0x1fb9('0x13')][_0x1fb9('0x14')]()];if(_0x4d34d6){var _0x5abd95=_0x4d34d6[_0x597df5[_0x1fb9('0x15')]];if(_0x5abd95){var _0x3e7b5f=_[_0x1fb9('0x16')](_0x5abd95[_0x1fb9('0x17')],{'id':parseInt(_0x597df5['data3'],0xa)});if(_0x3e7b5f){if(_0x3e367d){if(_0x102e47&&_0x21362b[_0x1fb9('0x18')]){_0x3bcae9=_0x1fb9('0x18');}else if(_0x21362b[_0x1fb9('0x19')]){_0x3bcae9=_0x1fb9('0x1a');}else{console[_0x1fb9('0x1b')](_0x1fb9('0x1c'),_0x21362b);}}else{_0x3bcae9='unmanaged';}switch(_0x597df5[_0x1fb9('0x13')][_0x1fb9('0x14')]()){case _0x1fb9('0x8'):zendesk[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0x1d'):salesforce[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0x9'):sugarcrm[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0xa'):freshdesk[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0xb'):zoho[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0xc'):desk[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0xd'):vtiger[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0xf'):freshsales['cs'](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36,_0x3bcae9);break;case _0x1fb9('0x10'):servicenow['cs'](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36,_0x3bcae9);break;case _0x1fb9('0xe'):dynamics365['cs'](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36,_0x3bcae9);break;default:console['log'](_0x1fb9('0x1e'));}}else{_0x356131=require(_0x1fb9('0x1f'))(_0x597df5[_0x1fb9('0x13')][_0x1fb9('0x14')]());_0x356131[_0x1fb9('0x20')](_0x1fb9('0x21'),util[_0x1fb9('0x22')](_0x1fb9('0x23'),_0x597df5['data1']['toLowerCase'](),_0x597df5['data3']));}}else{_0x356131=require('../../../../config/logger')(_0x597df5[_0x1fb9('0x13')][_0x1fb9('0x14')]());_0x356131[_0x1fb9('0x20')](_0x1fb9('0x21'),util[_0x1fb9('0x22')](_0x1fb9('0x24'),_0x597df5[_0x1fb9('0x13')]['toLowerCase'](),_0x597df5[_0x1fb9('0x15')]));}}else{}}catch(_0x32fc0d){console['error'](_0x32fc0d);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index 5b9e5f3..a35b0ba 100644 --- a/server/services/ami/trigger/integration/salesforce.js +++ b/server/services/ami/trigger/integration/salesforce.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a4e=['forEach','includes','string','picklist','type','idField','variableName','toString','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','uniqueid','recordingURL','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','error','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','unmanaged','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ActivityDate','utc','IsRecurrence','endUserType','lead','account','WhatId','ticketType','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','find','execute','length','Email','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','cloneDeep','additionalSearchContact','$or','additionalSearchLead','merge','Lead','additionalSearchAccount','Contact','Account','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','contact','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Company','No\x20Company','upperFirst'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x9a4e,0x128));var _0xe9a4=function(_0x68856e,_0x51f851){_0x68856e=_0x68856e-0x0;var _0x2dbc08=_0x9a4e[_0x68856e];return _0x2dbc08;};'use strict';var _=require(_0xe9a4('0x0'));var rp=require(_0xe9a4('0x1'));var moment=require(_0xe9a4('0x2'));var BPromise=require(_0xe9a4('0x3'));var md5=require(_0xe9a4('0x4'));var jsforce=require(_0xe9a4('0x5'));var util=require('util');var Redis=require(_0xe9a4('0x6'));var intUtil=require(_0xe9a4('0x7'));var config=require(_0xe9a4('0x8'));var logger=require(_0xe9a4('0x9'))(_0xe9a4('0xa'));config[_0xe9a4('0xb')]=_[_0xe9a4('0xc')](config[_0xe9a4('0xb')],{'host':_0xe9a4('0xd'),'port':0x18eb});var io=require(_0xe9a4('0xe'))(new Redis(config[_0xe9a4('0xb')]));function emit(_0x100d1a,_0xf9b052,_0x6627f7){io['to'](_0x100d1a)[_0xe9a4('0xf')](_0xf9b052,_0x6627f7);}function getTicket(_0xe1ed6d,_0x229f49,_0x3304c1,_0x5e99dd,_0x2e56ca,_0x2f39d0,_0x21af80,_0x12ed30){var _0x237e1a=Object[_0xe9a4('0x10')]({},{'OwnerId':_0x229f49['id'],'Subject':intUtil[_0xe9a4('0x11')](_0x5e99dd[_0xe9a4('0x12')],_0x2e56ca,'\x20'),'Description':intUtil[_0xe9a4('0x11')](_0x5e99dd[_0xe9a4('0x13')],_0x2e56ca,'\x0a')},getCustomFields(_0x2f39d0,_0x2e56ca));if(_0x3304c1){if(_0x5e99dd['ticketType']==='Task'){_0x237e1a[_0xe9a4('0x14')]=moment[_0xe9a4('0x15')]();_0x237e1a['IsReminderSet']=![];_0x237e1a[_0xe9a4('0x16')]=![];if(_0x3304c1[_0xe9a4('0x17')]==='contact'||_0x3304c1[_0xe9a4('0x17')]===_0xe9a4('0x18')){_0x237e1a['WhoId']=_0x3304c1['id'];}else if(_0x3304c1['endUserType']===_0xe9a4('0x19')){_0x237e1a[_0xe9a4('0x1a')]=_0x3304c1['id'];}}else if(_0x5e99dd[_0xe9a4('0x1b')]===_0xe9a4('0x1c')){if(_0x3304c1['endUserType']==='contact'){_0x237e1a[_0xe9a4('0x1d')]=_0x3304c1['id'];}else if(_0x3304c1[_0xe9a4('0x17')]===_0xe9a4('0x19')){_0x237e1a[_0xe9a4('0x1e')]=_0x3304c1['id'];}else if(_0x3304c1[_0xe9a4('0x17')]===_0xe9a4('0x18')&&_0x5e99dd[_0xe9a4('0x1f')]){_0x237e1a[_0x5e99dd[_0xe9a4('0x1f')]]=_0x3304c1['id'];}else{logger[_0xe9a4('0x20')](_0xe9a4('0x21'));}}}return _0x21af80[_0xe9a4('0x22')](_0x5e99dd['ticketType'])[_0xe9a4('0x23')](_0x237e1a);}function getUser(_0x3b8c3d,_0x12c725,_0x128a1b){if(!_['isNil'](_0x12c725)&&intUtil['validateEmail'](_0x12c725)){var _0x268e08={'Email':_0x12c725};var _0xc962ef={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x128a1b[_0xe9a4('0x22')]('User')[_0xe9a4('0x24')](_0x268e08,_0xc962ef)[_0xe9a4('0x25')]()['then'](function(_0x36f372){if(_0x36f372[_0xe9a4('0x26')]){var _0x524973=_[_0xe9a4('0x24')](_0x36f372,function(_0x51cf79){return _0x51cf79[_0xe9a4('0x27')]===_0x12c725;});if(_0x524973){logger[_0xe9a4('0x20')]('Agent\x20%s\x20found.',_0x12c725);return BPromise['resolve']({'id':_0x524973['Id'],'name':_0x524973[_0xe9a4('0x28')]});}}else{logger['info'](_0xe9a4('0x29'),_0x12c725);return _0x128a1b[_0xe9a4('0x2a')]()['then'](function(_0x34bd2d){return BPromise[_0xe9a4('0x2b')]({'id':_0x34bd2d[_0xe9a4('0x2c')],'name':_0x34bd2d[_0xe9a4('0x2d')]});});}});}else{logger[_0xe9a4('0x20')](_0xe9a4('0x29'),_0x12c725);return _0x128a1b['identity']()[_0xe9a4('0x2e')](function(_0x1aaa1a){return BPromise['resolve']({'id':_0x1aaa1a[_0xe9a4('0x2c')],'name':_0x1aaa1a['display_name']});});}}function getEndUser(_0x1b52af,_0x4389ce,_0x2a5ece,_0x1951bd,_0x931161){var _0x17e47b={'$or':{'Phone':_0x1951bd}};var _0x1753e6={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe9a4('0x2b')]()[_0xe9a4('0x2e')](function(){logger[_0xe9a4('0x20')](_0xe9a4('0x2f'),_0x1951bd,_0x4389ce['moduleSearch']);switch(_0x4389ce['moduleSearch']){case'contact_lead':var _0x4eeec3=_[_0xe9a4('0x30')](_0x17e47b);if(_0x4389ce[_0xe9a4('0x31')]){var _0x1223cd={};_0x1223cd[_0x4389ce[_0xe9a4('0x31')]]=_0x1951bd;_['merge'](_0x4eeec3[_0xe9a4('0x32')],_0x1223cd);}return _0x931161['sobject']('Contact')[_0xe9a4('0x24')](_0x4eeec3,_0x1753e6)[_0xe9a4('0x25')]()[_0xe9a4('0x2e')](function(_0x52323f){if(_0x52323f&&_0x52323f[_0xe9a4('0x26')]){return _0x52323f;}else{var _0x5d64c2=_[_0xe9a4('0x30')](_0x17e47b);if(_0x4389ce[_0xe9a4('0x33')]){var _0x55e3bb={};_0x55e3bb[_0x4389ce[_0xe9a4('0x33')]]=_0x1951bd;_[_0xe9a4('0x34')](_0x5d64c2[_0xe9a4('0x32')],_0x55e3bb);}return _0x931161['sobject'](_0xe9a4('0x35'))[_0xe9a4('0x24')](_0x5d64c2,_0x1753e6);}});case'account_contact_lead':var _0x5578df=_[_0xe9a4('0x30')](_0x17e47b);if(_0x4389ce[_0xe9a4('0x36')]){var _0x1223cd={};_0x1223cd[_0x4389ce['additionalSearchAccount']]=_0x1951bd;_['merge'](_0x5578df[_0xe9a4('0x32')],_0x1223cd);}return _0x931161[_0xe9a4('0x22')]('Account')[_0xe9a4('0x24')](_0x5578df,_0x1753e6)[_0xe9a4('0x25')]()['then'](function(_0xd23ce6){if(_0xd23ce6&&_0xd23ce6['length']){return _0xd23ce6;}else{var _0x176186=_['cloneDeep'](_0x17e47b);if(_0x4389ce[_0xe9a4('0x31')]){var _0x630f76={};_0x630f76[_0x4389ce[_0xe9a4('0x31')]]=_0x1951bd;_['merge'](_0x176186['$or'],_0x630f76);}return _0x931161[_0xe9a4('0x22')]('Contact')[_0xe9a4('0x24')](_0x176186,_0x1753e6)[_0xe9a4('0x2e')](function(_0x43a25d){if(_0x43a25d&&_0x43a25d[_0xe9a4('0x26')]){return _0x43a25d;}else{var _0xa4d0e7=_[_0xe9a4('0x30')](_0x17e47b);if(_0x4389ce['additionalSearchLead']){var _0x3c8ec0={};_0x3c8ec0[_0x4389ce[_0xe9a4('0x33')]]=_0x1951bd;_[_0xe9a4('0x34')](_0xa4d0e7[_0xe9a4('0x32')],_0x3c8ec0);}return _0x931161[_0xe9a4('0x22')](_0xe9a4('0x35'))['find'](_0xa4d0e7,_0x1753e6);}});}});case'contact':var _0x4eeec3=_[_0xe9a4('0x30')](_0x17e47b);if(_0x4389ce[_0xe9a4('0x31')]){var _0x1223cd={};_0x1223cd[_0x4389ce[_0xe9a4('0x31')]]=_0x1951bd;_[_0xe9a4('0x34')](_0x4eeec3[_0xe9a4('0x32')],_0x1223cd);}return _0x931161['sobject'](_0xe9a4('0x37'))['find'](_0x4eeec3,_0x1753e6)['execute']();case _0xe9a4('0x18'):var _0x245310=_[_0xe9a4('0x30')](_0x17e47b);if(_0x4389ce['additionalSearchLead']){var _0x1223cd={};_0x1223cd[_0x4389ce[_0xe9a4('0x33')]]=_0x1951bd;_[_0xe9a4('0x34')](_0x245310[_0xe9a4('0x32')],_0x1223cd);}return _0x931161[_0xe9a4('0x22')]('Lead')[_0xe9a4('0x24')](_0x245310,_0x1753e6);case _0xe9a4('0x19'):var _0x5578df=_[_0xe9a4('0x30')](_0x17e47b);if(_0x4389ce[_0xe9a4('0x36')]){var _0x1223cd={};_0x1223cd[_0x4389ce[_0xe9a4('0x36')]]=_0x1951bd;_[_0xe9a4('0x34')](_0x5578df[_0xe9a4('0x32')],_0x1223cd);}return _0x931161[_0xe9a4('0x22')](_0xe9a4('0x38'))['find'](_0x5578df,_0x1753e6);default:return null;}})[_0xe9a4('0x2e')](function(_0x2b3460){if(_0x2b3460&&_0x2b3460['length']){var _0x2d2c96=_['first'](_0x2b3460);if(_0x2d2c96){return BPromise[_0xe9a4('0x2b')]({'id':_0x2d2c96['Id'],'name':_0x2d2c96[_0xe9a4('0x28')],'phone':_0x2d2c96['Phone'],'endUserType':_0x2d2c96['attributes']['type'][_0xe9a4('0x39')]()});}}})[_0xe9a4('0x2e')](function(_0x1c23ab){if(_0x1c23ab){logger[_0xe9a4('0x20')](_0xe9a4('0x3a'),_0x1c23ab[_0xe9a4('0x17')],_0x1951bd);return BPromise[_0xe9a4('0x2b')](_0x1c23ab);}else{logger[_0xe9a4('0x20')](_0xe9a4('0x3b'),_0x1951bd);var _0x1c9dd1={'Phone':_0x1951bd};if(_0x4389ce[_0xe9a4('0x3c')]){if(_0x4389ce[_0xe9a4('0x3c')]===_0xe9a4('0x3d')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1951bd,_0x4389ce[_0xe9a4('0x3c')]);_0x1c9dd1['LastName']=_0x2a5ece!==_0xe9a4('0x3e')?_0x2a5ece:util[_0xe9a4('0x3f')](_0xe9a4('0x40'),_0x1951bd);}else if(_0x4389ce[_0xe9a4('0x3c')]===_0xe9a4('0x18')){logger[_0xe9a4('0x20')](_0xe9a4('0x41'),_0x1951bd,_0x4389ce[_0xe9a4('0x3c')]);_0x1c9dd1[_0xe9a4('0x42')]=_0x2a5ece!==_0xe9a4('0x3e')?_0x2a5ece:util['format']('Caller\x20-\x20%s',_0x1951bd);_0x1c9dd1[_0xe9a4('0x43')]=_0xe9a4('0x44');}else if(_0x4389ce[_0xe9a4('0x3c')]===_0xe9a4('0x19')){logger[_0xe9a4('0x20')](_0xe9a4('0x41'),_0x1951bd,_0x4389ce[_0xe9a4('0x3c')]);_0x1c9dd1[_0xe9a4('0x28')]=_0x2a5ece!==''?_0x2a5ece:util[_0xe9a4('0x3f')](_0xe9a4('0x40'),_0x1951bd);}else{return null;}}return _0x931161['sobject'](_[_0xe9a4('0x45')](_0x4389ce['moduleCreate']))[_0xe9a4('0x23')](_0x1c9dd1)[_0xe9a4('0x2e')](function(_0x24655f){return BPromise['resolve']({'id':_0x24655f['id'],'endUserType':_0x4389ce[_0xe9a4('0x3c')]});});}});}function getCustomFields(_0x160828,_0x1b6859){var _0x2a392f={};if(_0x160828[_0xe9a4('0x26')]>0x0){_[_0xe9a4('0x46')](_0x160828,function(_0x280630){if(_[_0xe9a4('0x47')]([_0xe9a4('0x48'),_0xe9a4('0x49')],_0x280630[_0xe9a4('0x4a')])&&_0x280630[_0xe9a4('0x4b')]){_0x2a392f[_0x280630[_0xe9a4('0x4b')]]=_0x280630['content']['toString']();}else if(_0x280630[_0xe9a4('0x4a')]==='variable'&&_0x280630['variableName']&&_0x280630[_0xe9a4('0x4b')]){_0x1b6859[_0x280630[_0xe9a4('0x4c')]]&&(_0x2a392f[_0x280630[_0xe9a4('0x4b')]]=_0x1b6859[_0x280630[_0xe9a4('0x4c')]][_0xe9a4('0x4d')]());}else if(_0x280630[_0xe9a4('0x4a')]==='customVariable'&&_0x280630['Variable']&&_0x280630[_0xe9a4('0x4e')]['name']&&_0x280630[_0xe9a4('0x4b')]){_0x1b6859[_0x280630[_0xe9a4('0x4e')][_0xe9a4('0x4f')]['toLowerCase']()]&&(_0x2a392f[_0x280630[_0xe9a4('0x4b')]]=_0x1b6859[_0x280630[_0xe9a4('0x4e')][_0xe9a4('0x4f')][_0xe9a4('0x39')]()]['toString']());}});}return _0x2a392f;}function getConnection(_0x1be127){var _0x47d78d=_0x1be127[_0xe9a4('0x50')][_0xe9a4('0x51')](_0x1be127['securityToken']);var _0x187a1d=new jsforce[(_0xe9a4('0x52'))]({'oauth2':{'loginUrl':_0x1be127[_0xe9a4('0x53')]||_0xe9a4('0x54'),'clientId':_0x1be127[_0xe9a4('0x55')],'clientSecret':_0x1be127[_0xe9a4('0x56')]}});return _0x187a1d['login'](_0x1be127['username'],_0x47d78d)['then'](function(){logger[_0xe9a4('0x20')]('Connection\x20established.');return _0x187a1d;});}exports[_0xe9a4('0x57')]=function(_0x1fc048,_0x2f443b,_0x1867d2,_0x4a2c4c,_0x2d8acc,_0xc2a079){var _0x4ef44d,_0x269dfd,_0x142859,_0x1a4695;_0xc2a079[_0xe9a4('0x58')]=intUtil[_0xe9a4('0x59')](_0xc2a079[_0xe9a4('0x58')]);_0xc2a079[_0xe9a4('0x53')]=intUtil[_0xe9a4('0x59')](_0xc2a079['remoteUri']);if(_0x2d8acc&&_0x2d8acc[_0xe9a4('0x5a')]){logger[_0xe9a4('0x20')](_0xe9a4('0x5b'),'Recording\x20is\x20enabled!');_0x2f443b['recordingURL']=util[_0xe9a4('0x3f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xc2a079['serverUrl'],_0x2f443b[_0xe9a4('0x5c')],md5(_0x2f443b[_0xe9a4('0x5c')]));}else{_0x2f443b[_0xe9a4('0x5d')]='';}return getConnection(_0xc2a079)[_0xe9a4('0x2e')](function(_0x444374){_0x1a4695=_0x444374;return getUser(_0xc2a079,_0x4a2c4c['email'],_0x1a4695);})[_0xe9a4('0x2e')](function(_0x13fb1c){_0x4ef44d=_0x13fb1c;return getEndUser(_0xc2a079,_0x1867d2,_0x2f443b[_0xe9a4('0x5e')],_0x2f443b['calleridnum'],_0x1a4695);})['then'](function(_0x2f27bc){_0x269dfd=_0x2f27bc;return getTicket(_0xc2a079,_0x4ef44d,_0x269dfd,_0x1867d2,_0x2f443b,_0x1867d2[_0xe9a4('0x5f')],_0x1a4695,'queue');})[_0xe9a4('0x2e')](function(_0xc7bdab){_0x142859=_0xc7bdab;logger[_0xe9a4('0x20')](_0xe9a4('0x60'),_0x142859['id']);logger['info'](_0xe9a4('0x61'),_0x142859['id'],_0x4a2c4c[_0xe9a4('0x4f')],_0xc2a079[_0xe9a4('0x4a')]);switch(_0xc2a079['type']){case _0xe9a4('0x62'):emit(util[_0xe9a4('0x3f')]('user:%s',_0x4a2c4c[_0xe9a4('0x4f')]),_0xe9a4('0x63'),{'recordId':_0x142859['id']});break;case _0xe9a4('0x64'):emit(util['format'](_0xe9a4('0x65'),_0x4a2c4c['name']),_0xe9a4('0x66'),{'uri':util[_0xe9a4('0x3f')](_0xe9a4('0x67'),_0x1a4695['instanceUrl'],_0x142859['id'])});break;default:logger[_0xe9a4('0x68')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xe9a4('0x69')](function(_0x57193d){logger[_0xe9a4('0x68')](_0xe9a4('0x5b'),_0x57193d);});};exports[_0xe9a4('0x6a')]=function(_0x4deb6c,_0x382e95,_0x468611,_0x2373c8,_0x46bba0,_0x16249a,_0x1c682b){var _0x1781b5,_0x450a40,_0x4ea46c,_0x717344;_0x16249a['serverUrl']=intUtil[_0xe9a4('0x59')](_0x16249a[_0xe9a4('0x58')]);_0x16249a[_0xe9a4('0x53')]=intUtil['stripTrailingSlash'](_0x16249a[_0xe9a4('0x53')]);if(_0x1c682b&&_0x1c682b[_0xe9a4('0x6b')]&&_0x1c682b[_0xe9a4('0x6b')]!==_0xe9a4('0x6c')){logger['info'](_0xe9a4('0x6d'),_0xe9a4('0x6e'));_0x382e95[_0xe9a4('0x5d')]=util[_0xe9a4('0x3f')](_0xe9a4('0x6f'),_0x16249a[_0xe9a4('0x58')],_0x382e95['uniqueid'],md5(_0x382e95[_0xe9a4('0x5c')]));}return getConnection(_0x16249a)[_0xe9a4('0x2e')](function(_0x2ddfe4){_0x717344=_0x2ddfe4;return getUser(_0x16249a,_0x2373c8['email'],_0x717344);})[_0xe9a4('0x2e')](function(_0x2eba3b){_0x1781b5=_0x2eba3b;return getEndUser(_0x16249a,_0x468611,_0x382e95[_0xe9a4('0x70')],_0x382e95['destcalleridnum'],_0x717344);})['then'](function(_0x581c95){_0x450a40=_0x581c95;return getTicket(_0x16249a,_0x1781b5,_0x450a40,_0x468611,_0x382e95,_0x468611['Fields'],_0x717344,'outbound');})[_0xe9a4('0x2e')](function(_0x25f265){_0x4ea46c=_0x25f265;logger['info'](_0xe9a4('0x71'),_0x4ea46c['id']);logger[_0xe9a4('0x20')](_0xe9a4('0x72'),_0x4ea46c['id'],_0x2373c8[_0xe9a4('0x4f')],_0x16249a[_0xe9a4('0x4a')]);switch(_0x16249a[_0xe9a4('0x4a')]){case _0xe9a4('0x62'):emit(util['format'](_0xe9a4('0x65'),_0x2373c8['name']),_0xe9a4('0x63'),{'recordId':_0x4ea46c['id']});break;case'newTab':emit(util[_0xe9a4('0x3f')](_0xe9a4('0x65'),_0x2373c8[_0xe9a4('0x4f')]),_0xe9a4('0x66'),{'uri':util[_0xe9a4('0x3f')](_0xe9a4('0x67'),_0x717344[_0xe9a4('0x73')],_0x4ea46c['id'])});break;default:logger[_0xe9a4('0x68')](_0xe9a4('0x6d'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xe9a4('0x69')](function(_0x5a55d9){logger[_0xe9a4('0x68')]('[OUTBOUND]',_0x5a55d9);});};exports[_0xe9a4('0x74')]=function(_0x1accc9,_0x256962,_0x556c89,_0x3cde03,_0x369579,_0x4a0ee9){var _0x5ab709,_0x3b0e88,_0x3bde35,_0x126b95;_0x4a0ee9[_0xe9a4('0x58')]=intUtil[_0xe9a4('0x59')](_0x4a0ee9['serverUrl']);_0x4a0ee9[_0xe9a4('0x53')]=intUtil['stripTrailingSlash'](_0x4a0ee9[_0xe9a4('0x53')]);if(_0x369579&&_0x369579[_0xe9a4('0x5a')]){logger[_0xe9a4('0x20')]('['+_0x256962[_0xe9a4('0x75')][_0xe9a4('0x76')]()+']','Recording\x20is\x20enabled!');_0x256962[_0xe9a4('0x5d')]=util[_0xe9a4('0x3f')](_0xe9a4('0x6f'),_0x4a0ee9['serverUrl'],_0x256962[_0xe9a4('0x5c')],md5(_0x256962[_0xe9a4('0x5c')]));}else{_0x256962[_0xe9a4('0x5d')]='';}return getConnection(_0x4a0ee9)[_0xe9a4('0x2e')](function(_0x4940e9){_0x126b95=_0x4940e9;if(!_[_0xe9a4('0x77')](_0x3cde03)){return getUser(_0x4a0ee9,_0x3cde03[_0xe9a4('0x4f')],_0x126b95);}else{return getUser(_0x4a0ee9,null,_0x126b95);}})['then'](function(_0x46e403){_0x5ab709=_0x46e403;return getEndUser(_0x4a0ee9,_0x556c89,_0x256962[_0xe9a4('0x5e')],_0x256962['calleridnum'],_0x126b95);})['then'](function(_0x96c9d4){_0x3b0e88=_0x96c9d4;return getTicket(_0x4a0ee9,_0x5ab709,_0x3b0e88,_0x556c89,_0x256962,_0x556c89[_0xe9a4('0x5f')],_0x126b95);})['then'](function(_0x3525a9){_0x3bde35=_0x3525a9;logger[_0xe9a4('0x20')]('['+_0x256962['lastevent'][_0xe9a4('0x76')]()+_0xe9a4('0x78'),_0x3bde35['id']);logger['info']('['+_0x256962['lastevent']['toUpperCase']()+_0xe9a4('0x79'),_0x4a0ee9[_0xe9a4('0x4a')]);})['catch'](function(_0x1a3400){logger[_0xe9a4('0x68')]('['+_0x256962[_0xe9a4('0x75')]['toUpperCase']()+']',_0x1a3400);});}; \ No newline at end of file +var _0x93cf=['WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','$or','find','account_contact_lead','additionalSearchAccount','first','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','forEach','includes','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Salesforce\x20account\x20type\x20not\x20recognized','toUpperCase','Fields','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','socket.io-emitter','assign','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0x93cf,0xe2));var _0xf93c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x93cf[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf93c('0x0'));var rp=require(_0xf93c('0x1'));var moment=require(_0xf93c('0x2'));var BPromise=require(_0xf93c('0x3'));var md5=require('md5');var jsforce=require(_0xf93c('0x4'));var util=require('util');var Redis=require(_0xf93c('0x5'));var intUtil=require(_0xf93c('0x6'));var config=require(_0xf93c('0x7'));var logger=require('../../../../config/logger')(_0xf93c('0x8'));config[_0xf93c('0x9')]=_[_0xf93c('0xa')](config[_0xf93c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf93c('0xb'))(new Redis(config[_0xf93c('0x9')]));function emit(_0x4ec137,_0x51fc42,_0x42975f){io['to'](_0x4ec137)['emit'](_0x51fc42,_0x42975f);}function getTicket(_0x5c3e94,_0xe91a82,_0x307e0e,_0x2751e7,_0x5b9d60,_0x23845c,_0x1417b0,_0xfd43f6){var _0x1c7d83=Object[_0xf93c('0xc')]({},{'OwnerId':_0xe91a82['id'],'Subject':intUtil[_0xf93c('0xd')](_0x2751e7['Subjects'],_0x5b9d60,'\x20'),'Description':intUtil[_0xf93c('0xd')](_0x2751e7[_0xf93c('0xe')],_0x5b9d60,'\x0a')},getCustomFields(_0x23845c,_0x5b9d60));if(_0x307e0e){if(_0x2751e7[_0xf93c('0xf')]===_0xf93c('0x10')){_0x1c7d83[_0xf93c('0x11')]=moment[_0xf93c('0x12')]();_0x1c7d83[_0xf93c('0x13')]=![];_0x1c7d83[_0xf93c('0x14')]=![];if(_0x307e0e[_0xf93c('0x15')]===_0xf93c('0x16')||_0x307e0e[_0xf93c('0x15')]===_0xf93c('0x17')){_0x1c7d83[_0xf93c('0x18')]=_0x307e0e['id'];}else if(_0x307e0e[_0xf93c('0x15')]===_0xf93c('0x19')){_0x1c7d83['WhatId']=_0x307e0e['id'];}}else if(_0x2751e7[_0xf93c('0xf')]===_0xf93c('0x1a')){if(_0x307e0e[_0xf93c('0x15')]==='contact'){_0x1c7d83[_0xf93c('0x1b')]=_0x307e0e['id'];}else if(_0x307e0e[_0xf93c('0x15')]==='account'){_0x1c7d83[_0xf93c('0x1c')]=_0x307e0e['id'];}else if(_0x307e0e['endUserType']==='lead'&&_0x2751e7['leadId']){_0x1c7d83[_0x2751e7[_0xf93c('0x1d')]]=_0x307e0e['id'];}else{logger[_0xf93c('0x1e')](_0xf93c('0x1f'));}}}return _0x1417b0[_0xf93c('0x20')](_0x2751e7['ticketType'])[_0xf93c('0x21')](_0x1c7d83);}function getUser(_0x2b1a64,_0x234174,_0x97625f){if(!_[_0xf93c('0x22')](_0x234174)&&intUtil[_0xf93c('0x23')](_0x234174)){var _0x14587e={'Email':_0x234174};var _0x29faa7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x97625f[_0xf93c('0x20')](_0xf93c('0x24'))['find'](_0x14587e,_0x29faa7)[_0xf93c('0x25')]()[_0xf93c('0x26')](function(_0x334840){if(_0x334840[_0xf93c('0x27')]){var _0x3314df=_['find'](_0x334840,function(_0x5d6268){return _0x5d6268['Email']===_0x234174;});if(_0x3314df){logger[_0xf93c('0x1e')](_0xf93c('0x28'),_0x234174);return BPromise[_0xf93c('0x29')]({'id':_0x3314df['Id'],'name':_0x3314df[_0xf93c('0x2a')]});}}else{logger[_0xf93c('0x1e')](_0xf93c('0x2b'),_0x234174);return _0x97625f[_0xf93c('0x2c')]()[_0xf93c('0x26')](function(_0x9dacaa){return BPromise['resolve']({'id':_0x9dacaa[_0xf93c('0x2d')],'name':_0x9dacaa['display_name']});});}});}else{logger[_0xf93c('0x1e')](_0xf93c('0x2b'),_0x234174);return _0x97625f[_0xf93c('0x2c')]()['then'](function(_0x2802c6){return BPromise['resolve']({'id':_0x2802c6[_0xf93c('0x2d')],'name':_0x2802c6[_0xf93c('0x2e')]});});}}function getEndUser(_0x40c0cf,_0x16773c,_0x4ba091,_0x5398ad,_0x1039a9){var _0x174cd6={'$or':{'Phone':_0x5398ad}};var _0x4b7fc5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf93c('0x29')]()[_0xf93c('0x26')](function(){logger['info'](_0xf93c('0x2f'),_0x5398ad,_0x16773c[_0xf93c('0x30')]);switch(_0x16773c[_0xf93c('0x30')]){case'contact_lead':var _0x17b5e5=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x32')]){var _0x33458b={};_0x33458b[_0x16773c['additionalSearchContact']]=_0x5398ad;_[_0xf93c('0x33')](_0x17b5e5['$or'],_0x33458b);}return _0x1039a9['sobject'](_0xf93c('0x34'))['find'](_0x17b5e5,_0x4b7fc5)[_0xf93c('0x25')]()['then'](function(_0x1e6d64){if(_0x1e6d64&&_0x1e6d64[_0xf93c('0x27')]){return _0x1e6d64;}else{var _0x4e7d00=_['cloneDeep'](_0x174cd6);if(_0x16773c[_0xf93c('0x35')]){var _0x28b669={};_0x28b669[_0x16773c[_0xf93c('0x35')]]=_0x5398ad;_[_0xf93c('0x33')](_0x4e7d00[_0xf93c('0x36')],_0x28b669);}return _0x1039a9[_0xf93c('0x20')]('Lead')[_0xf93c('0x37')](_0x4e7d00,_0x4b7fc5);}});case _0xf93c('0x38'):var _0x411c2b=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x39')]){var _0x33458b={};_0x33458b[_0x16773c[_0xf93c('0x39')]]=_0x5398ad;_[_0xf93c('0x33')](_0x411c2b['$or'],_0x33458b);}return _0x1039a9[_0xf93c('0x20')]('Account')['find'](_0x411c2b,_0x4b7fc5)[_0xf93c('0x25')]()[_0xf93c('0x26')](function(_0x1a4315){if(_0x1a4315&&_0x1a4315[_0xf93c('0x27')]){return _0x1a4315;}else{var _0x46b4ed=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x32')]){var _0x5c81ca={};_0x5c81ca[_0x16773c[_0xf93c('0x32')]]=_0x5398ad;_[_0xf93c('0x33')](_0x46b4ed['$or'],_0x5c81ca);}return _0x1039a9[_0xf93c('0x20')](_0xf93c('0x34'))['find'](_0x46b4ed,_0x4b7fc5)['then'](function(_0x489e92){if(_0x489e92&&_0x489e92['length']){return _0x489e92;}else{var _0x35cdd6=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x35')]){var _0x35714a={};_0x35714a[_0x16773c['additionalSearchLead']]=_0x5398ad;_[_0xf93c('0x33')](_0x35cdd6[_0xf93c('0x36')],_0x35714a);}return _0x1039a9[_0xf93c('0x20')]('Lead')['find'](_0x35cdd6,_0x4b7fc5);}});}});case _0xf93c('0x16'):var _0x17b5e5=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x32')]){var _0x33458b={};_0x33458b[_0x16773c[_0xf93c('0x32')]]=_0x5398ad;_[_0xf93c('0x33')](_0x17b5e5[_0xf93c('0x36')],_0x33458b);}return _0x1039a9['sobject'](_0xf93c('0x34'))['find'](_0x17b5e5,_0x4b7fc5)['execute']();case _0xf93c('0x17'):var _0x19fb69=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c['additionalSearchLead']){var _0x33458b={};_0x33458b[_0x16773c[_0xf93c('0x35')]]=_0x5398ad;_[_0xf93c('0x33')](_0x19fb69['$or'],_0x33458b);}return _0x1039a9[_0xf93c('0x20')]('Lead')[_0xf93c('0x37')](_0x19fb69,_0x4b7fc5);case'account':var _0x411c2b=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x39')]){var _0x33458b={};_0x33458b[_0x16773c[_0xf93c('0x39')]]=_0x5398ad;_[_0xf93c('0x33')](_0x411c2b['$or'],_0x33458b);}return _0x1039a9['sobject']('Account')[_0xf93c('0x37')](_0x411c2b,_0x4b7fc5);default:return null;}})['then'](function(_0x4d41ab){if(_0x4d41ab&&_0x4d41ab[_0xf93c('0x27')]){var _0x3cb9d0=_[_0xf93c('0x3a')](_0x4d41ab);if(_0x3cb9d0){return BPromise['resolve']({'id':_0x3cb9d0['Id'],'name':_0x3cb9d0['Name'],'phone':_0x3cb9d0[_0xf93c('0x3b')],'endUserType':_0x3cb9d0[_0xf93c('0x3c')]['type'][_0xf93c('0x3d')]()});}}})['then'](function(_0x2bbd7f){if(_0x2bbd7f){logger[_0xf93c('0x1e')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x2bbd7f[_0xf93c('0x15')],_0x5398ad);return BPromise['resolve'](_0x2bbd7f);}else{logger[_0xf93c('0x1e')](_0xf93c('0x3e'),_0x5398ad);var _0x5eb593={'Phone':_0x5398ad};if(_0x16773c[_0xf93c('0x3f')]){if(_0x16773c[_0xf93c('0x3f')]===_0xf93c('0x16')){logger[_0xf93c('0x1e')](_0xf93c('0x40'),_0x5398ad,_0x16773c[_0xf93c('0x3f')]);_0x5eb593[_0xf93c('0x41')]=_0x4ba091!==_0xf93c('0x42')?_0x4ba091:util[_0xf93c('0x43')](_0xf93c('0x44'),_0x5398ad);}else if(_0x16773c['moduleCreate']===_0xf93c('0x17')){logger[_0xf93c('0x1e')](_0xf93c('0x40'),_0x5398ad,_0x16773c[_0xf93c('0x3f')]);_0x5eb593['LastName']=_0x4ba091!==_0xf93c('0x42')?_0x4ba091:util[_0xf93c('0x43')](_0xf93c('0x44'),_0x5398ad);_0x5eb593[_0xf93c('0x45')]=_0xf93c('0x46');}else if(_0x16773c[_0xf93c('0x3f')]==='account'){logger[_0xf93c('0x1e')](_0xf93c('0x40'),_0x5398ad,_0x16773c[_0xf93c('0x3f')]);_0x5eb593[_0xf93c('0x2a')]=_0x4ba091!==_0xf93c('0x42')?_0x4ba091:util['format'](_0xf93c('0x44'),_0x5398ad);}else{return null;}}return _0x1039a9[_0xf93c('0x20')](_['upperFirst'](_0x16773c['moduleCreate']))['create'](_0x5eb593)[_0xf93c('0x26')](function(_0x416a88){return BPromise[_0xf93c('0x29')]({'id':_0x416a88['id'],'endUserType':_0x16773c['moduleCreate']});});}});}function getCustomFields(_0x19b564,_0x537737){var _0x56e436={};if(_0x19b564[_0xf93c('0x27')]>0x0){_[_0xf93c('0x47')](_0x19b564,function(_0x5ba48a){if(_[_0xf93c('0x48')](['string',_0xf93c('0x49')],_0x5ba48a['type'])&&_0x5ba48a[_0xf93c('0x4a')]){_0x56e436[_0x5ba48a[_0xf93c('0x4a')]]=_0x5ba48a[_0xf93c('0x4b')]['toString']();}else if(_0x5ba48a[_0xf93c('0x4c')]===_0xf93c('0x4d')&&_0x5ba48a[_0xf93c('0x4e')]&&_0x5ba48a[_0xf93c('0x4a')]){_0x537737[_0x5ba48a['variableName']]&&(_0x56e436[_0x5ba48a[_0xf93c('0x4a')]]=_0x537737[_0x5ba48a['variableName']][_0xf93c('0x4f')]());}else if(_0x5ba48a[_0xf93c('0x4c')]===_0xf93c('0x50')&&_0x5ba48a[_0xf93c('0x51')]&&_0x5ba48a[_0xf93c('0x51')][_0xf93c('0x52')]&&_0x5ba48a[_0xf93c('0x4a')]){_0x537737[_0x5ba48a[_0xf93c('0x51')]['name'][_0xf93c('0x3d')]()]&&(_0x56e436[_0x5ba48a[_0xf93c('0x4a')]]=_0x537737[_0x5ba48a['Variable'][_0xf93c('0x52')][_0xf93c('0x3d')]()][_0xf93c('0x4f')]());}});}return _0x56e436;}function getConnection(_0x18e42e){var _0x3050ca=_0x18e42e[_0xf93c('0x53')]['concat'](_0x18e42e[_0xf93c('0x54')]);var _0x53a1c1=new jsforce[(_0xf93c('0x55'))]({'oauth2':{'loginUrl':_0x18e42e[_0xf93c('0x56')]||_0xf93c('0x57'),'clientId':_0x18e42e['clientId'],'clientSecret':_0x18e42e[_0xf93c('0x58')]}});return _0x53a1c1['login'](_0x18e42e[_0xf93c('0x59')],_0x3050ca)[_0xf93c('0x26')](function(){logger[_0xf93c('0x1e')](_0xf93c('0x5a'));return _0x53a1c1;});}exports[_0xf93c('0x5b')]=function(_0x42de91,_0x3303da,_0x31b0f6,_0x313cb8,_0x913ec7,_0xc31f9f){var _0x346236,_0xd0f92e,_0x548814,_0x4ab638;_0xc31f9f['serverUrl']=intUtil[_0xf93c('0x5c')](_0xc31f9f['serverUrl']);_0xc31f9f[_0xf93c('0x56')]=intUtil[_0xf93c('0x5c')](_0xc31f9f[_0xf93c('0x56')]);if(_0x913ec7&&_0x913ec7[_0xf93c('0x5d')]){logger[_0xf93c('0x1e')]('[QUEUE]',_0xf93c('0x5e'));_0x3303da[_0xf93c('0x5f')]=util[_0xf93c('0x43')](_0xf93c('0x60'),_0xc31f9f[_0xf93c('0x61')],_0x3303da[_0xf93c('0x62')],md5(_0x3303da['uniqueid']));}else{_0x3303da[_0xf93c('0x5f')]='';}return getConnection(_0xc31f9f)[_0xf93c('0x26')](function(_0x27a452){_0x4ab638=_0x27a452;return getUser(_0xc31f9f,_0x313cb8[_0xf93c('0x63')],_0x4ab638);})['then'](function(_0x248681){_0x346236=_0x248681;return getEndUser(_0xc31f9f,_0x31b0f6,_0x3303da['calleridname'],_0x3303da[_0xf93c('0x64')],_0x4ab638);})[_0xf93c('0x26')](function(_0xad0ffe){_0xd0f92e=_0xad0ffe;return getTicket(_0xc31f9f,_0x346236,_0xd0f92e,_0x31b0f6,_0x3303da,_0x31b0f6['Fields'],_0x4ab638,_0xf93c('0x5b'));})[_0xf93c('0x26')](function(_0x15a5db){_0x548814=_0x15a5db;logger[_0xf93c('0x1e')](_0xf93c('0x65'),_0x548814['id']);logger[_0xf93c('0x1e')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x548814['id'],_0x313cb8[_0xf93c('0x52')],_0xc31f9f[_0xf93c('0x4c')]);switch(_0xc31f9f[_0xf93c('0x4c')]){case _0xf93c('0x66'):emit(util[_0xf93c('0x43')](_0xf93c('0x67'),_0x313cb8[_0xf93c('0x52')]),_0xf93c('0x68'),{'recordId':_0x548814['id']});break;case _0xf93c('0x69'):emit(util[_0xf93c('0x43')](_0xf93c('0x67'),_0x313cb8[_0xf93c('0x52')]),_0xf93c('0x6a'),{'uri':util[_0xf93c('0x43')](_0xf93c('0x6b'),_0x4ab638[_0xf93c('0x6c')],_0x548814['id'])});break;default:logger[_0xf93c('0x6d')](_0xf93c('0x6e'));}})[_0xf93c('0x6f')](function(_0x59b945){logger[_0xf93c('0x6d')](_0xf93c('0x70'),_0x59b945);});};exports[_0xf93c('0x71')]=function(_0x316608,_0x59b3d3,_0x4d488a,_0x1b5023,_0x3aa766,_0x6e083a,_0x36c10c){var _0xf7ac30,_0x428931,_0x5f698f,_0xa1fc14;_0x6e083a[_0xf93c('0x61')]=intUtil['stripTrailingSlash'](_0x6e083a[_0xf93c('0x61')]);_0x6e083a[_0xf93c('0x56')]=intUtil[_0xf93c('0x5c')](_0x6e083a[_0xf93c('0x56')]);if(_0x36c10c&&_0x36c10c[_0xf93c('0x72')]&&_0x36c10c[_0xf93c('0x72')]!==_0xf93c('0x73')){logger[_0xf93c('0x1e')](_0xf93c('0x74'),_0xf93c('0x5e'));_0x59b3d3[_0xf93c('0x5f')]=util[_0xf93c('0x43')](_0xf93c('0x60'),_0x6e083a['serverUrl'],_0x59b3d3[_0xf93c('0x62')],md5(_0x59b3d3[_0xf93c('0x62')]));}return getConnection(_0x6e083a)[_0xf93c('0x26')](function(_0x5ca51e){_0xa1fc14=_0x5ca51e;return getUser(_0x6e083a,_0x1b5023[_0xf93c('0x63')],_0xa1fc14);})['then'](function(_0x2a1229){_0xf7ac30=_0x2a1229;return getEndUser(_0x6e083a,_0x4d488a,_0x59b3d3[_0xf93c('0x75')],_0x59b3d3[_0xf93c('0x76')],_0xa1fc14);})['then'](function(_0x492cb8){_0x428931=_0x492cb8;return getTicket(_0x6e083a,_0xf7ac30,_0x428931,_0x4d488a,_0x59b3d3,_0x4d488a['Fields'],_0xa1fc14,_0xf93c('0x71'));})[_0xf93c('0x26')](function(_0x3a3fae){_0x5f698f=_0x3a3fae;logger[_0xf93c('0x1e')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x5f698f['id']);logger[_0xf93c('0x1e')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5f698f['id'],_0x1b5023['name'],_0x6e083a['type']);switch(_0x6e083a[_0xf93c('0x4c')]){case'integrationTab':emit(util[_0xf93c('0x43')](_0xf93c('0x67'),_0x1b5023[_0xf93c('0x52')]),_0xf93c('0x68'),{'recordId':_0x5f698f['id']});break;case _0xf93c('0x69'):emit(util[_0xf93c('0x43')](_0xf93c('0x67'),_0x1b5023[_0xf93c('0x52')]),_0xf93c('0x6a'),{'uri':util[_0xf93c('0x43')]('%s/%s/e',_0xa1fc14[_0xf93c('0x6c')],_0x5f698f['id'])});break;default:logger[_0xf93c('0x6d')](_0xf93c('0x74'),_0xf93c('0x77'));}})[_0xf93c('0x6f')](function(_0x222238){logger['error'](_0xf93c('0x74'),_0x222238);});};exports['unmanaged']=function(_0x4b229b,_0x2538ae,_0x19479c,_0x46ceee,_0x1dc9c1,_0x4fde60){var _0x1048aa,_0x42f260,_0x3004e5,_0x53155a;_0x4fde60[_0xf93c('0x61')]=intUtil['stripTrailingSlash'](_0x4fde60['serverUrl']);_0x4fde60['remoteUri']=intUtil['stripTrailingSlash'](_0x4fde60[_0xf93c('0x56')]);if(_0x1dc9c1&&_0x1dc9c1[_0xf93c('0x5d')]){logger[_0xf93c('0x1e')]('['+_0x2538ae['lastevent'][_0xf93c('0x78')]()+']',_0xf93c('0x5e'));_0x2538ae['recordingURL']=util[_0xf93c('0x43')](_0xf93c('0x60'),_0x4fde60[_0xf93c('0x61')],_0x2538ae[_0xf93c('0x62')],md5(_0x2538ae[_0xf93c('0x62')]));}else{_0x2538ae[_0xf93c('0x5f')]='';}return getConnection(_0x4fde60)[_0xf93c('0x26')](function(_0x4be46a){_0x53155a=_0x4be46a;if(!_['isNil'](_0x46ceee)){return getUser(_0x4fde60,_0x46ceee['name'],_0x53155a);}else{return getUser(_0x4fde60,null,_0x53155a);}})[_0xf93c('0x26')](function(_0x3d8958){_0x1048aa=_0x3d8958;return getEndUser(_0x4fde60,_0x19479c,_0x2538ae['calleridname'],_0x2538ae['calleridnum'],_0x53155a);})[_0xf93c('0x26')](function(_0x57b784){_0x42f260=_0x57b784;return getTicket(_0x4fde60,_0x1048aa,_0x42f260,_0x19479c,_0x2538ae,_0x19479c[_0xf93c('0x79')],_0x53155a);})[_0xf93c('0x26')](function(_0x37443f){_0x3004e5=_0x37443f;logger[_0xf93c('0x1e')]('['+_0x2538ae[_0xf93c('0x7a')][_0xf93c('0x78')]()+_0xf93c('0x7b'),_0x3004e5['id']);logger[_0xf93c('0x1e')]('['+_0x2538ae[_0xf93c('0x7a')][_0xf93c('0x78')]()+_0xf93c('0x7c'),_0x4fde60['type']);})['catch'](function(_0x2379cf){logger['error']('['+_0x2538ae[_0xf93c('0x7a')]['toUpperCase']()+']',_0x2379cf);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index c35b062..bf4049e 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe6f=['socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','endUserId','],\x20getEndUser\x20crm','includes','picklist','type','customField','nameField','toLowerCase','toString','string','idField','content','variable','variableName','customVariable','Variable','name','outbound','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','label_entry','incident','Incident','Incident\x20-\x20','forEach','push','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','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xfe6f,0x151));var _0xffe6=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xfe6f[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0xffe6('0x0'));var Promise=require(_0xffe6('0x1'));var rp=require(_0xffe6('0x2'));var util=require('util');var md5=require(_0xffe6('0x3'));var Redis=require(_0xffe6('0x4'));var intUtil=require(_0xffe6('0x5'));var config=require(_0xffe6('0x6'));var logger=require(_0xffe6('0x7'))(_0xffe6('0x8'));config[_0xffe6('0x9')]=_[_0xffe6('0xa')](config[_0xffe6('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xffe6('0xb'))(new Redis(config[_0xffe6('0x9')]));function getAdminUser(_0xa6b017,_0x5d3f26,_0xe943a8,_0x2daca5,_0x4e4dbf,_0x408787){return new Promise(function(_0x570bd5,_0xa04ba){var _0x41a7b7={'method':_0xffe6('0xc'),'uri':_0x2daca5+_0xffe6('0xd')+'&'+_0x4e4dbf+'&'+_0x408787,'auth':_0x5d3f26,'json':!![]};return rp(_0x41a7b7)[_0xffe6('0xe')](function(_0x70e9d){if(_0x70e9d[_0xffe6('0xf')]['length']>0x0){_0xe943a8['adminId']=_0x70e9d[_0xffe6('0xf')][0x0][_0xffe6('0x10')];}logger[_0xffe6('0x11')]('['+[_0xa6b017[_0xffe6('0x12')]()]+_0xffe6('0x13'),_0xe943a8);_0x570bd5(_0xe943a8);})[_0xffe6('0x14')](function(_0x5263e9){logger[_0xffe6('0x15')]('['+[_0xa6b017[_0xffe6('0x12')]()]+']',_0x5263e9[_0xffe6('0x16')]);_0xa04ba(_0x5263e9['message']);});});}function getUser(_0x323529,_0x3b8139,_0x140600,_0x390470,_0x7dc657){return function(_0x497103){logger['info']('['+[_0x323529[_0xffe6('0x12')]()]+_0xffe6('0x17'),_0x497103);return new Promise(function(_0x128317,_0x4eb06e){if(intUtil[_0xffe6('0x18')](_0x497103[_0xffe6('0x19')])){var _0x1862d1={'method':_0xffe6('0xc'),'uri':_0x140600+_0xffe6('0x1a')+_0x497103[_0xffe6('0x19')]+'&'+_0x390470+'&'+_0x7dc657,'auth':_0x3b8139,'json':!![]};logger[_0xffe6('0x11')]('['+[_0x323529['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x1862d1);return rp(_0x1862d1)[_0xffe6('0xe')](function(_0x4293e2){logger[_0xffe6('0x11')]('['+[_0x323529[_0xffe6('0x12')]()]+_0xffe6('0x1b'),_0x4293e2);if(_0x4293e2[_0xffe6('0xf')]['length']>0x0&&String(_0x4293e2[_0xffe6('0xf')][0x0][_0xffe6('0x1c')])===_0xffe6('0x1d')){_0x497103[_0xffe6('0x1e')]=_0x4293e2[_0xffe6('0xf')][0x0][_0xffe6('0x10')];}else{_0x497103[_0xffe6('0x1e')]=_0x497103[_0xffe6('0x1f')];_0x497103['userEmail']=_0x497103[_0xffe6('0x20')];}logger[_0xffe6('0x11')]('['+[_0x323529['toUpperCase']()]+_0xffe6('0x21'),_0x497103);_0x128317(_0x497103);})[_0xffe6('0x14')](function(_0x41aadb){logger[_0xffe6('0x15')]('['+[_0x323529[_0xffe6('0x12')]()]+']',_0x41aadb['message']);_0x4eb06e(_0x41aadb['message']);});}else{logger['info']('['+[_0x323529['toUpperCase']()]+_0xffe6('0x22'));_0x497103[_0xffe6('0x1e')]=_0x497103[_0xffe6('0x1f')];_0x497103[_0xffe6('0x19')]=_0x497103[_0xffe6('0x20')];_0x128317(_0x497103);}});};}function createEndUser(_0x5663ef,_0x63478a,_0x3ea4f1,_0x254f24,_0x525914){logger[_0xffe6('0x11')]('['+[_0x5663ef[_0xffe6('0x12')]()]+_0xffe6('0x23'),_0x3ea4f1);return new Promise(function(_0x5c20c3,_0x5e6f8e){var _0x3b9d51={'method':_0xffe6('0x24'),'uri':_0x254f24+_0xffe6('0x25')+_0x525914,'body':{'user_name':_0x3ea4f1['endUserNumber'],'roles':_0xffe6('0x26'),'first_name':_0x3ea4f1[_0xffe6('0x27')],'active':_0xffe6('0x1d'),'date_format':'System','phone':_0x3ea4f1['endUserNumber']},'auth':_0x63478a,'json':!![]};return rp(_0x3b9d51)[_0xffe6('0xe')](function(_0x4edaab){logger[_0xffe6('0x11')]('['+[_0x5663ef[_0xffe6('0x12')]()]+_0xffe6('0x28'),_0x4edaab[_0xffe6('0xf')]);_0x3ea4f1['endUserId']=_0x4edaab[_0xffe6('0xf')][_0xffe6('0x10')];_0x5c20c3(_0x3ea4f1);})[_0xffe6('0x14')](function(_0x4fb37a){logger[_0xffe6('0x15')]('['+[_0x5663ef['toUpperCase']()]+']',_0x4fb37a['message']);_0x5e6f8e(_0x4fb37a['message']);});});}function getEndUser(_0x5c7fc6,_0x4e3401,_0x5f49cd,_0xf2beac,_0x590c16){return function(_0x21cd29){logger[_0xffe6('0x11')]('['+[_0x5c7fc6[_0xffe6('0x12')]()]+_0xffe6('0x29'),_0x21cd29);return new Promise(function(_0x323468,_0x259d41){var _0x45c7df={'method':_0xffe6('0xc'),'uri':_0x5f49cd+_0xffe6('0x2a')+_0x21cd29[_0xffe6('0x27')]+'&'+_0xf2beac+'&'+_0x590c16,'auth':_0x4e3401,'json':!![]};return rp(_0x45c7df)['then'](function(_0x5f445a){if(_0x5f445a[_0xffe6('0xf')][_0xffe6('0x2b')]>0x0){_0x21cd29[_0xffe6('0x2c')]=_0x5f445a[_0xffe6('0xf')][0x0]['sys_id'];logger[_0xffe6('0x11')]('['+[_0x5c7fc6['toUpperCase']()]+_0xffe6('0x2d'),_0x21cd29);_0x323468(_0x21cd29);}else{return createEndUser(_0x5c7fc6,_0x4e3401,_0x21cd29,_0x5f49cd,_0xf2beac)['then'](function(_0x108d29){logger[_0xffe6('0x11')]('['+[_0x5c7fc6[_0xffe6('0x12')]()]+'],\x20createEndUser\x20crm',_0x108d29);_0x323468(_0x108d29);});}})[_0xffe6('0x14')](function(_0x3d34dd){logger['error']('['+[_0x5c7fc6[_0xffe6('0x12')]()]+']',_0x3d34dd[_0xffe6('0x16')]);_0x259d41(_0x3d34dd[_0xffe6('0x16')]);});});};}function getCustomFields(_0x5571b4,_0x3e314a){var _0x445559={};if(_0x5571b4[_0xffe6('0x2b')]>0x0){_['forEach'](_0x5571b4,function(_0xce2926){if(_[_0xffe6('0x2e')](['string',_0xffe6('0x2f')],_0xce2926[_0xffe6('0x30')])&&_0xce2926['nameField']&&!_0xce2926[_0xffe6('0x31')]){_0x445559[_0xce2926[_0xffe6('0x32')][_0xffe6('0x33')]()]=_0xce2926['content'][_0xffe6('0x34')]();}else if(_['includes']([_0xffe6('0x35'),_0xffe6('0x2f')],_0xce2926[_0xffe6('0x30')])&&_0xce2926[_0xffe6('0x36')]&&_0xce2926[_0xffe6('0x31')]){_0x445559[_0xce2926['idField'][_0xffe6('0x33')]()]=_0xce2926[_0xffe6('0x37')]['toString']();}else if(_0xce2926['type']===_0xffe6('0x38')&&_0xce2926[_0xffe6('0x39')]&&_0xce2926[_0xffe6('0x36')]&&_0xce2926['customField']){_0x445559[_0xce2926[_0xffe6('0x36')][_0xffe6('0x33')]()]=_0x3e314a[_0xce2926[_0xffe6('0x39')]][_0xffe6('0x34')]();}else if(_0xce2926[_0xffe6('0x30')]===_0xffe6('0x3a')&&_0xce2926['Variable']&&_0xce2926[_0xffe6('0x3b')][_0xffe6('0x3c')]&&_0xce2926['idField']&&_0xce2926[_0xffe6('0x31')]){_0x445559[_0xce2926[_0xffe6('0x36')][_0xffe6('0x33')]()]=_0x3e314a[_0xce2926[_0xffe6('0x3b')][_0xffe6('0x3c')][_0xffe6('0x33')]()][_0xffe6('0x34')]();}});}return _0x445559;}function getTicket(_0x466cff,_0x56df33,_0x33901f,_0x331710,_0x121dd1,_0x53b125){return function(_0x1d1539){logger[_0xffe6('0x11')]('['+[_0x466cff[_0xffe6('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x1d1539);return new Promise(function(_0xa3a702,_0x277f86){var _0x423898=_0x466cff[_0xffe6('0x33')]()===_0xffe6('0x3d')?_0x1d1539[_0xffe6('0x1e')]:_0x1d1539[_0xffe6('0x2c')];var _0x5b6299={'method':_0xffe6('0x24'),'uri':_0x33901f+'incident'+'?'+_0x53b125,'body':Object['assign']({},{'active':_0xffe6('0x1d'),'caller_id':_0x423898,'assigned_to':_0x1d1539[_0xffe6('0x1e')],'short_description':intUtil[_0xffe6('0x3e')](_0x331710[_0xffe6('0x3f')],_0x121dd1,'\x20'),'description':intUtil[_0xffe6('0x3e')](_0x331710['Descriptions'],_0x121dd1,'\x0a')},getCustomFields(_0x331710[_0xffe6('0x40')],_0x121dd1)),'auth':_0x56df33,'json':!![]};return rp(_0x5b6299)[_0xffe6('0xe')](function(_0x553494){logger[_0xffe6('0x11')]('['+[_0x466cff[_0xffe6('0x12')]()]+_0xffe6('0x41'),_0x553494[_0xffe6('0xf')]);_0x1d1539[_0xffe6('0x42')]=_0x553494[_0xffe6('0xf')][_0xffe6('0x10')];_0x1d1539[_0xffe6('0x43')]=_0x553494[_0xffe6('0xf')][_0xffe6('0x44')];logger[_0xffe6('0x11')]('['+[_0x466cff[_0xffe6('0x12')]()]+']\x20getTicket\x20crm',_0x1d1539);_0xa3a702(_0x1d1539);})['catch'](function(_0xf134ff){logger['error']('['+[_0x466cff[_0xffe6('0x12')]()]+']',_0xf134ff[_0xffe6('0x16')]);_0x277f86(_0xf134ff[_0xffe6('0x16')]);});});};}function createRemoteTag(_0x5ee85a,_0x4ea90a,_0x1ab124,_0x37fba2){return new Promise(function(_0x1db81a,_0x45eaf9){var _0x53d348={'method':_0xffe6('0x24'),'uri':_0x1ab124+_0xffe6('0x45')+'?'+_0x37fba2,'body':{'short_description':_0x5ee85a,'global':!![],'active':!![],'name':_0x5ee85a},'auth':_0x4ea90a,'json':!![]};return rp(_0x53d348)['then'](function(_0x1cf742){var _0x57307c=_0x1cf742[_0xffe6('0xf')][_0xffe6('0x10')];_0x1db81a(_0x57307c);});});}function getRemoteTag(_0x19496e,_0x49f184,_0x5e41bd,_0x11fc83,_0x288b67){return new Promise(function(_0x23949f,_0x3752d9){var _0x2c521b={'method':_0xffe6('0xc'),'uri':_0x5e41bd+_0xffe6('0x45')+'?sysparm_query=name%3D'+_0x19496e+'&'+_0x11fc83,'auth':_0x49f184,'json':!![]};return rp(_0x2c521b)[_0xffe6('0xe')](function(_0x3f6270){if(_0x3f6270[_0xffe6('0xf')][_0xffe6('0x2b')]>0x0){var _0x18f362=_0x3f6270['result'][0x0][_0xffe6('0x10')];_0x23949f(_0x18f362);}else{return createRemoteTag(_0x19496e,_0x49f184,_0x5e41bd,_0x11fc83)[_0xffe6('0xe')](function(_0x5bb5da){_0x23949f(_0x5bb5da);});}});});}function assignTagToIncident(_0x5cf2be,_0x575880,_0x1b17d2,_0xeb45bd,_0x3c5ee9){return new Promise(function(_0x39a14b,_0x62154e){var _0x3437ca={'method':_0xffe6('0x24'),'uri':_0x1b17d2+_0xffe6('0x46')+'?'+_0x3c5ee9,'body':{'label':_0x5cf2be,'table':_0xffe6('0x47'),'id_type':_0xffe6('0x48'),'table_key':_0xeb45bd[_0xffe6('0x42')],'title':_0xffe6('0x49')+_0xeb45bd[_0xffe6('0x43')],'id_display':_0xeb45bd[_0xffe6('0x43')]},'auth':_0x575880,'json':!![]};return rp(_0x3437ca)[_0xffe6('0xe')](function(_0x109412){_0x39a14b();})[_0xffe6('0x14')](function(){_0x39a14b();});});}function manageTags(_0x3e60ee,_0x545e7d,_0xbc6cc4,_0x5e7a62,_0x3386ff,_0x2c47a9,_0x438bde){return new Promise(function(_0x42eb74,_0x4a4023){var _0x6bede3=[];_0x545e7d[_0xffe6('0x4a')](function(_0x4e8820){_0x6bede3[_0xffe6('0x4b')](getRemoteTag(_0x4e8820,_0xbc6cc4,_0x5e7a62,_0x2c47a9,_0x438bde));});return Promise[_0xffe6('0x4c')](_0x6bede3)[_0xffe6('0xe')](function(_0x2cc511){if(_0x2cc511['length']){logger[_0xffe6('0x11')]('['+[_0x3e60ee[_0xffe6('0x12')]()]+_0xffe6('0x4d'),_0x2cc511);var _0x385f72=[];_0x2cc511[_0xffe6('0x4a')](function(_0x138411){_0x385f72['push'](assignTagToIncident(_0x138411,_0xbc6cc4,_0x5e7a62,_0x3386ff,_0x2c47a9));});return Promise[_0xffe6('0x4c')](_0x385f72)['then'](function(){_0x42eb74();})[_0xffe6('0x14')](function(){_0x42eb74();});}else{_0x42eb74();}});});}function getTags(_0x57dd33,_0xd0127d,_0xe3dffd,_0x23754f,_0x595874,_0x814436){return function(_0x1ad502){return new Promise(function(_0x19bfbf,_0x5d8a90){var _0x289c74=[];var _0x3a5f0c=_0x23754f[_0xffe6('0x4e')];if(_0x3a5f0c&&_0x3a5f0c[_0xffe6('0x2b')]>0x0){_0x289c74=_[_0xffe6('0x4f')](_0x3a5f0c,'name');}if(_0x289c74['length']>0x0){return manageTags(_0x57dd33,_0x289c74,_0xd0127d,_0xe3dffd,_0x1ad502,_0x595874,_0x814436)[_0xffe6('0xe')](function(){_0x19bfbf(_0x1ad502);});}else{_0x19bfbf(_0x1ad502);}});};}function emit(_0x414aea,_0x55903b,_0xed0652){var _0x48337c=_0xffe6('0x50')+_0xffe6('0x51')+_0xffe6('0x52')+_0xffe6('0x53');var _0x30318c={'uri':_0x414aea+_0xffe6('0x54')+_0xed0652+_0x48337c};io['to'](util[_0xffe6('0x55')]('user:%s',_0x55903b))[_0xffe6('0x56')](_0xffe6('0x57'),_0x30318c);}exports['cs']=function(_0x20ae05,_0x503686,_0x176780,_0x59d216,_0x6173b9,_0x20dbb6,_0x5aabf2,_0x527c62){var _0x44a8d9={};var _0x68fa52={'user':_0x20dbb6[_0xffe6('0x58')],'pass':_0x20dbb6[_0xffe6('0x59')]};var _0x5a6abd=_0xffe6('0x5a');var _0x2cc601=_0xffe6('0x5b');_0x20dbb6[_0xffe6('0x5c')]=intUtil['stripTrailingSlash'](_0x20dbb6[_0xffe6('0x5c')]);_0x20dbb6[_0xffe6('0x5d')]=intUtil[_0xffe6('0x5e')](_0x20dbb6[_0xffe6('0x5d')]);var _0x15e332=util[_0xffe6('0x55')](_0xffe6('0x5f'),_0x20dbb6[_0xffe6('0x5c')]);_0x44a8d9['userEmail']=!_[_0xffe6('0x60')](_0x59d216)?_0x59d216['email']:null;_0x44a8d9[_0xffe6('0x20')]=_0x20dbb6[_0xffe6('0x61')];_0x44a8d9[_0xffe6('0x27')]=_0x527c62['toLowerCase']()===_0xffe6('0x3d')?_0x503686[_0xffe6('0x62')]:_0x503686[_0xffe6('0x63')];_0x44a8d9[_0xffe6('0x64')]=_0x527c62===_0xffe6('0x65')||_0x527c62===_0xffe6('0x66')?_0xffe6('0x65'):_0xffe6('0x3d');var _0x4d8682=util[_0xffe6('0x55')](_0xffe6('0x67'),_0x20dbb6['serverUrl'],_0x503686[_0xffe6('0x68')],md5(_0x503686[_0xffe6('0x68')]));if(_0x6173b9&&_0x6173b9[_0xffe6('0x69')]){logger['info'](_0xffe6('0x6a'),_0xffe6('0x6b'));_0x503686[_0xffe6('0x6c')]=_0x4d8682;}else if(_0x5aabf2&&_0x5aabf2[_0xffe6('0x6d')]&&_0x5aabf2['recordingFormat']!==_0xffe6('0x6e')){logger[_0xffe6('0x11')]('[OUTBOUND]',_0xffe6('0x6b'));_0x503686['recordingURL']=_0x4d8682;}else{_0x503686[_0xffe6('0x6c')]='';}return getAdminUser(_0x527c62,_0x68fa52,_0x44a8d9,_0x15e332,_0x2cc601,_0x5a6abd)['then'](getUser(_0x527c62,_0x68fa52,_0x15e332,_0x2cc601,_0x5a6abd))[_0xffe6('0xe')](getEndUser(_0x527c62,_0x68fa52,_0x15e332,_0x2cc601,_0x5a6abd))['then'](getTicket(_0x527c62,_0x68fa52,_0x15e332,_0x176780,_0x503686,_0x2cc601))[_0xffe6('0xe')](function(_0x365947){logger[_0xffe6('0x11')](util[_0xffe6('0x55')](_0xffe6('0x6f'),_0x365947[_0xffe6('0x42')]));logger['info'](util[_0xffe6('0x55')](_0xffe6('0x70'),_0x527c62));if(_0x527c62!==_0xffe6('0x66')){logger[_0xffe6('0x11')]('['+[_0x527c62[_0xffe6('0x12')]()]+']',_0xffe6('0x71'));emit(_0x20dbb6[_0xffe6('0x5c')],_0x59d216[_0xffe6('0x3c')],_0x365947[_0xffe6('0x42')]);}})['catch'](function(_0x2fc970){logger['error']('['+[_0x527c62[_0xffe6('0x12')]()]+_0xffe6('0x72'),util[_0xffe6('0x73')](_0x2fc970,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc5a3=['label_entry','Incident','Incident\x20-\x20','push','all','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','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','info','],\x20getAdminUser\x20crm','catch','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','sys_id','adminEmail','error',']\x20using\x20admin\x20profile','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label'];(function(_0xf36a76,_0x3967b3){var _0x414aa5=function(_0x84dc89){while(--_0x84dc89){_0xf36a76['push'](_0xf36a76['shift']());}};_0x414aa5(++_0x3967b3);}(_0xc5a3,0x103));var _0x3c5a=function(_0x45269d,_0x474648){_0x45269d=_0x45269d-0x0;var _0x252895=_0xc5a3[_0x45269d];return _0x252895;};'use strict';var _=require(_0x3c5a('0x0'));var Promise=require(_0x3c5a('0x1'));var rp=require('request-promise');var util=require(_0x3c5a('0x2'));var md5=require(_0x3c5a('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x3c5a('0x4'));var logger=require(_0x3c5a('0x5'))(_0x3c5a('0x6'));config[_0x3c5a('0x7')]=_[_0x3c5a('0x8')](config[_0x3c5a('0x7')],{'host':_0x3c5a('0x9'),'port':0x18eb});var io=require(_0x3c5a('0xa'))(new Redis(config[_0x3c5a('0x7')]));function getAdminUser(_0x2cec66,_0x272b5c,_0x120acb,_0x43ecac,_0x15dbe8,_0x1212a9){return new Promise(function(_0x57d789,_0x2f3b32){var _0x22f7ad={'method':'GET','uri':_0x43ecac+_0x3c5a('0xb')+'&'+_0x15dbe8+'&'+_0x1212a9,'auth':_0x272b5c,'json':!![]};return rp(_0x22f7ad)[_0x3c5a('0xc')](function(_0x31e21a){if(_0x31e21a[_0x3c5a('0xd')]['length']>0x0){_0x120acb[_0x3c5a('0xe')]=_0x31e21a[_0x3c5a('0xd')][0x0]['sys_id'];}logger[_0x3c5a('0xf')]('['+[_0x2cec66['toUpperCase']()]+_0x3c5a('0x10'),_0x120acb);_0x57d789(_0x120acb);})[_0x3c5a('0x11')](function(_0x27158b){logger['error']('['+[_0x2cec66[_0x3c5a('0x12')]()]+']',_0x27158b[_0x3c5a('0x13')]);_0x2f3b32(_0x27158b['message']);});});}function getUser(_0x2288aa,_0x1c4372,_0x455022,_0x3722a8,_0x2e225c){return function(_0x2a0cf8){logger['info']('['+[_0x2288aa[_0x3c5a('0x12')]()]+_0x3c5a('0x14'),_0x2a0cf8);return new Promise(function(_0x44dfb2,_0xef5893){if(intUtil[_0x3c5a('0x15')](_0x2a0cf8[_0x3c5a('0x16')])){var _0x538029={'method':_0x3c5a('0x17'),'uri':_0x455022+'sys_user?sysparm_query=email%3D'+_0x2a0cf8['userEmail']+'&'+_0x3722a8+'&'+_0x2e225c,'auth':_0x1c4372,'json':!![]};logger[_0x3c5a('0xf')]('['+[_0x2288aa['toUpperCase']()]+_0x3c5a('0x18'),_0x538029);return rp(_0x538029)[_0x3c5a('0xc')](function(_0x5f0a00){logger[_0x3c5a('0xf')]('['+[_0x2288aa[_0x3c5a('0x12')]()]+_0x3c5a('0x19'),_0x5f0a00);if(_0x5f0a00[_0x3c5a('0xd')][_0x3c5a('0x1a')]>0x0&&String(_0x5f0a00[_0x3c5a('0xd')][0x0][_0x3c5a('0x1b')])===_0x3c5a('0x1c')){_0x2a0cf8['userId']=_0x5f0a00[_0x3c5a('0xd')][0x0][_0x3c5a('0x1d')];}else{_0x2a0cf8['userId']=_0x2a0cf8['adminId'];_0x2a0cf8[_0x3c5a('0x16')]=_0x2a0cf8[_0x3c5a('0x1e')];}logger[_0x3c5a('0xf')]('['+[_0x2288aa['toUpperCase']()]+'],\x20getUser\x20crm',_0x2a0cf8);_0x44dfb2(_0x2a0cf8);})[_0x3c5a('0x11')](function(_0x49e88c){logger[_0x3c5a('0x1f')]('['+[_0x2288aa[_0x3c5a('0x12')]()]+']',_0x49e88c[_0x3c5a('0x13')]);_0xef5893(_0x49e88c['message']);});}else{logger['info']('['+[_0x2288aa[_0x3c5a('0x12')]()]+_0x3c5a('0x20'));_0x2a0cf8[_0x3c5a('0x21')]=_0x2a0cf8[_0x3c5a('0xe')];_0x2a0cf8[_0x3c5a('0x16')]=_0x2a0cf8['adminEmail'];_0x44dfb2(_0x2a0cf8);}});};}function createEndUser(_0x192197,_0x378662,_0x519d2a,_0x21a86f,_0x376885){logger[_0x3c5a('0xf')]('['+[_0x192197['toUpperCase']()]+_0x3c5a('0x22'),_0x519d2a);return new Promise(function(_0x1ce089,_0x55cf27){var _0x2fe463={'method':_0x3c5a('0x23'),'uri':_0x21a86f+_0x3c5a('0x24')+_0x376885,'body':{'user_name':_0x519d2a[_0x3c5a('0x25')],'roles':_0x3c5a('0x26'),'first_name':_0x519d2a[_0x3c5a('0x25')],'active':_0x3c5a('0x1c'),'date_format':_0x3c5a('0x27'),'phone':_0x519d2a[_0x3c5a('0x25')]},'auth':_0x378662,'json':!![]};return rp(_0x2fe463)[_0x3c5a('0xc')](function(_0x49f8b8){logger['info']('['+[_0x192197['toUpperCase']()]+'],\x20EndUser\x20schema',_0x49f8b8['result']);_0x519d2a['endUserId']=_0x49f8b8[_0x3c5a('0xd')]['sys_id'];_0x1ce089(_0x519d2a);})[_0x3c5a('0x11')](function(_0xcb74fb){logger[_0x3c5a('0x1f')]('['+[_0x192197[_0x3c5a('0x12')]()]+']',_0xcb74fb['message']);_0x55cf27(_0xcb74fb[_0x3c5a('0x13')]);});});}function getEndUser(_0x2443ad,_0x1c90a2,_0x19e27f,_0xba130,_0x40de37){return function(_0x4e0750){logger[_0x3c5a('0xf')]('['+[_0x2443ad['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x4e0750);return new Promise(function(_0x5d11a5,_0x5e7e23){var _0x501bf0={'method':_0x3c5a('0x17'),'uri':_0x19e27f+_0x3c5a('0x28')+_0x4e0750[_0x3c5a('0x25')]+'&'+_0xba130+'&'+_0x40de37,'auth':_0x1c90a2,'json':!![]};return rp(_0x501bf0)['then'](function(_0x29d8ef){if(_0x29d8ef[_0x3c5a('0xd')][_0x3c5a('0x1a')]>0x0){_0x4e0750[_0x3c5a('0x29')]=_0x29d8ef[_0x3c5a('0xd')][0x0]['sys_id'];logger[_0x3c5a('0xf')]('['+[_0x2443ad[_0x3c5a('0x12')]()]+_0x3c5a('0x2a'),_0x4e0750);_0x5d11a5(_0x4e0750);}else{return createEndUser(_0x2443ad,_0x1c90a2,_0x4e0750,_0x19e27f,_0xba130)[_0x3c5a('0xc')](function(_0x4767b8){logger[_0x3c5a('0xf')]('['+[_0x2443ad[_0x3c5a('0x12')]()]+'],\x20createEndUser\x20crm',_0x4767b8);_0x5d11a5(_0x4767b8);});}})[_0x3c5a('0x11')](function(_0x193d77){logger[_0x3c5a('0x1f')]('['+[_0x2443ad[_0x3c5a('0x12')]()]+']',_0x193d77[_0x3c5a('0x13')]);_0x5e7e23(_0x193d77['message']);});});};}function getCustomFields(_0x4d566b,_0x12b792){var _0x36c2f1={};if(_0x4d566b[_0x3c5a('0x1a')]>0x0){_[_0x3c5a('0x2b')](_0x4d566b,function(_0x200fd1){if(_[_0x3c5a('0x2c')]([_0x3c5a('0x2d'),_0x3c5a('0x2e')],_0x200fd1[_0x3c5a('0x2f')])&&_0x200fd1['nameField']&&!_0x200fd1[_0x3c5a('0x30')]){_0x36c2f1[_0x200fd1[_0x3c5a('0x31')][_0x3c5a('0x32')]()]=_0x200fd1[_0x3c5a('0x33')][_0x3c5a('0x34')]();}else if(_['includes'](['string',_0x3c5a('0x2e')],_0x200fd1[_0x3c5a('0x2f')])&&_0x200fd1[_0x3c5a('0x35')]&&_0x200fd1[_0x3c5a('0x30')]){_0x36c2f1[_0x200fd1[_0x3c5a('0x35')][_0x3c5a('0x32')]()]=_0x200fd1[_0x3c5a('0x33')][_0x3c5a('0x34')]();}else if(_0x200fd1[_0x3c5a('0x2f')]===_0x3c5a('0x36')&&_0x200fd1[_0x3c5a('0x37')]&&_0x200fd1['idField']&&_0x200fd1[_0x3c5a('0x30')]){_0x36c2f1[_0x200fd1[_0x3c5a('0x35')]['toLowerCase']()]=_0x12b792[_0x200fd1['variableName']][_0x3c5a('0x34')]();}else if(_0x200fd1[_0x3c5a('0x2f')]==='customVariable'&&_0x200fd1[_0x3c5a('0x38')]&&_0x200fd1[_0x3c5a('0x38')][_0x3c5a('0x39')]&&_0x200fd1[_0x3c5a('0x35')]&&_0x200fd1[_0x3c5a('0x30')]){_0x36c2f1[_0x200fd1[_0x3c5a('0x35')][_0x3c5a('0x32')]()]=_0x12b792[_0x200fd1['Variable'][_0x3c5a('0x39')][_0x3c5a('0x32')]()][_0x3c5a('0x34')]();}});}return _0x36c2f1;}function getTicket(_0x36d694,_0x14dd64,_0x170848,_0x3b9afb,_0x44c646,_0x4822d5){return function(_0x7b86cc){logger[_0x3c5a('0xf')]('['+[_0x36d694[_0x3c5a('0x12')]()]+_0x3c5a('0x3a'),_0x7b86cc);return new Promise(function(_0x3d7416,_0x2ec76d){var _0xf53092=_0x36d694[_0x3c5a('0x32')]()==='outbound'?_0x7b86cc['userId']:_0x7b86cc['endUserId'];var _0x11f8c2={'method':_0x3c5a('0x23'),'uri':_0x170848+'incident'+'?'+_0x4822d5,'body':Object[_0x3c5a('0x3b')]({},{'active':_0x3c5a('0x1c'),'caller_id':_0xf53092,'assigned_to':_0x7b86cc[_0x3c5a('0x21')],'short_description':intUtil[_0x3c5a('0x3c')](_0x3b9afb['Subjects'],_0x44c646,'\x20'),'description':intUtil['getString'](_0x3b9afb[_0x3c5a('0x3d')],_0x44c646,'\x0a')},getCustomFields(_0x3b9afb[_0x3c5a('0x3e')],_0x44c646)),'auth':_0x14dd64,'json':!![]};return rp(_0x11f8c2)['then'](function(_0x1e5b65){logger[_0x3c5a('0xf')]('['+[_0x36d694[_0x3c5a('0x12')]()]+_0x3c5a('0x3f'),_0x1e5b65[_0x3c5a('0xd')]);_0x7b86cc[_0x3c5a('0x40')]=_0x1e5b65['result'][_0x3c5a('0x1d')];_0x7b86cc[_0x3c5a('0x41')]=_0x1e5b65[_0x3c5a('0xd')]['number'];logger[_0x3c5a('0xf')]('['+[_0x36d694[_0x3c5a('0x12')]()]+_0x3c5a('0x42'),_0x7b86cc);_0x3d7416(_0x7b86cc);})[_0x3c5a('0x11')](function(_0x172fc7){logger[_0x3c5a('0x1f')]('['+[_0x36d694[_0x3c5a('0x12')]()]+']',_0x172fc7[_0x3c5a('0x13')]);_0x2ec76d(_0x172fc7[_0x3c5a('0x13')]);});});};}function createRemoteTag(_0x29adee,_0x10669d,_0x1053ad,_0x3199d8){return new Promise(function(_0x380b25,_0x212135){var _0x2b0a61={'method':_0x3c5a('0x23'),'uri':_0x1053ad+_0x3c5a('0x43')+'?'+_0x3199d8,'body':{'short_description':_0x29adee,'global':!![],'active':!![],'name':_0x29adee},'auth':_0x10669d,'json':!![]};return rp(_0x2b0a61)['then'](function(_0x545112){var _0x1f067a=_0x545112[_0x3c5a('0xd')][_0x3c5a('0x1d')];_0x380b25(_0x1f067a);});});}function getRemoteTag(_0x23beed,_0x2e31de,_0x219be5,_0x321925,_0x3b20d4){return new Promise(function(_0x54b9ee,_0x23836b){var _0x2d2078={'method':_0x3c5a('0x17'),'uri':_0x219be5+_0x3c5a('0x43')+'?sysparm_query=name%3D'+_0x23beed+'&'+_0x321925,'auth':_0x2e31de,'json':!![]};return rp(_0x2d2078)['then'](function(_0x13a3fc){if(_0x13a3fc[_0x3c5a('0xd')][_0x3c5a('0x1a')]>0x0){var _0x188f8c=_0x13a3fc['result'][0x0][_0x3c5a('0x1d')];_0x54b9ee(_0x188f8c);}else{return createRemoteTag(_0x23beed,_0x2e31de,_0x219be5,_0x321925)[_0x3c5a('0xc')](function(_0x4dad40){_0x54b9ee(_0x4dad40);});}});});}function assignTagToIncident(_0x30d4eb,_0x25f42c,_0x51ebb9,_0x11966c,_0x589eae){return new Promise(function(_0xee8f15,_0x37d5db){var _0x4d099e={'method':_0x3c5a('0x23'),'uri':_0x51ebb9+_0x3c5a('0x44')+'?'+_0x589eae,'body':{'label':_0x30d4eb,'table':'incident','id_type':_0x3c5a('0x45'),'table_key':_0x11966c[_0x3c5a('0x40')],'title':_0x3c5a('0x46')+_0x11966c[_0x3c5a('0x41')],'id_display':_0x11966c['ticketNumber']},'auth':_0x25f42c,'json':!![]};return rp(_0x4d099e)['then'](function(_0x1bcc94){_0xee8f15();})[_0x3c5a('0x11')](function(){_0xee8f15();});});}function manageTags(_0x4687da,_0x2d6f18,_0x22b7e8,_0x196189,_0x3eaaa2,_0xdd7b1c,_0x28c696){return new Promise(function(_0x40b263,_0x14302a){var _0x319281=[];_0x2d6f18[_0x3c5a('0x2b')](function(_0x7e1d19){_0x319281[_0x3c5a('0x47')](getRemoteTag(_0x7e1d19,_0x22b7e8,_0x196189,_0xdd7b1c,_0x28c696));});return Promise[_0x3c5a('0x48')](_0x319281)[_0x3c5a('0xc')](function(_0x5a071d){if(_0x5a071d['length']){logger[_0x3c5a('0xf')]('['+[_0x4687da[_0x3c5a('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5a071d);var _0x423bf9=[];_0x5a071d[_0x3c5a('0x2b')](function(_0x1483de){_0x423bf9['push'](assignTagToIncident(_0x1483de,_0x22b7e8,_0x196189,_0x3eaaa2,_0xdd7b1c));});return Promise['all'](_0x423bf9)[_0x3c5a('0xc')](function(){_0x40b263();})[_0x3c5a('0x11')](function(){_0x40b263();});}else{_0x40b263();}});});}function getTags(_0x11c4df,_0x169c4a,_0x20dc21,_0x293de1,_0x41ac30,_0x249a21){return function(_0x5cbe9b){return new Promise(function(_0x1bd0c7,_0x141956){var _0x449934=[];var _0x169e67=_0x293de1['Tags'];if(_0x169e67&&_0x169e67[_0x3c5a('0x1a')]>0x0){_0x449934=_[_0x3c5a('0x49')](_0x169e67,_0x3c5a('0x39'));}if(_0x449934[_0x3c5a('0x1a')]>0x0){return manageTags(_0x11c4df,_0x449934,_0x169c4a,_0x20dc21,_0x5cbe9b,_0x41ac30,_0x249a21)['then'](function(){_0x1bd0c7(_0x5cbe9b);});}else{_0x1bd0c7(_0x5cbe9b);}});};}function emit(_0x311c33,_0x1aaf50,_0x4695e8){var _0x2b0456=_0x3c5a('0x4a')+_0x3c5a('0x4b')+_0x3c5a('0x4c')+_0x3c5a('0x4d');var _0x1da373={'uri':_0x311c33+_0x3c5a('0x4e')+_0x4695e8+_0x2b0456};io['to'](util[_0x3c5a('0x4f')](_0x3c5a('0x50'),_0x1aaf50))[_0x3c5a('0x51')](_0x3c5a('0x52'),_0x1da373);}exports['cs']=function(_0x1e75c6,_0x167bf6,_0x337841,_0x1cb35b,_0x3eab7c,_0x211eea,_0x4fa339,_0x293d52){var _0x1000cf={};var _0x25ecc4={'user':_0x211eea[_0x3c5a('0x53')],'pass':_0x211eea[_0x3c5a('0x54')]};var _0x1f0be3=_0x3c5a('0x55');var _0x270bb3=_0x3c5a('0x56');_0x211eea[_0x3c5a('0x57')]=intUtil[_0x3c5a('0x58')](_0x211eea[_0x3c5a('0x57')]);_0x211eea[_0x3c5a('0x59')]=intUtil['stripTrailingSlash'](_0x211eea[_0x3c5a('0x59')]);var _0x522c18=util[_0x3c5a('0x4f')](_0x3c5a('0x5a'),_0x211eea[_0x3c5a('0x57')]);_0x1000cf['userEmail']=!_[_0x3c5a('0x5b')](_0x1cb35b)?_0x1cb35b['email']:null;_0x1000cf[_0x3c5a('0x1e')]=_0x211eea[_0x3c5a('0x5c')];_0x1000cf[_0x3c5a('0x25')]=_0x293d52['toLowerCase']()===_0x3c5a('0x5d')?_0x167bf6[_0x3c5a('0x5e')]:_0x167bf6[_0x3c5a('0x5f')];_0x1000cf[_0x3c5a('0x60')]=_0x293d52===_0x3c5a('0x61')||_0x293d52===_0x3c5a('0x62')?'queue':_0x3c5a('0x5d');var _0x40e363=util[_0x3c5a('0x4f')](_0x3c5a('0x63'),_0x211eea['serverUrl'],_0x167bf6[_0x3c5a('0x64')],md5(_0x167bf6[_0x3c5a('0x64')]));if(_0x3eab7c&&_0x3eab7c['monitor_format']){logger[_0x3c5a('0xf')]('[QUEUE]',_0x3c5a('0x65'));_0x167bf6[_0x3c5a('0x66')]=_0x40e363;}else if(_0x4fa339&&_0x4fa339[_0x3c5a('0x67')]&&_0x4fa339[_0x3c5a('0x67')]!==_0x3c5a('0x68')){logger[_0x3c5a('0xf')]('[OUTBOUND]',_0x3c5a('0x65'));_0x167bf6[_0x3c5a('0x66')]=_0x40e363;}else{_0x167bf6['recordingURL']='';}return getAdminUser(_0x293d52,_0x25ecc4,_0x1000cf,_0x522c18,_0x270bb3,_0x1f0be3)[_0x3c5a('0xc')](getUser(_0x293d52,_0x25ecc4,_0x522c18,_0x270bb3,_0x1f0be3))[_0x3c5a('0xc')](getEndUser(_0x293d52,_0x25ecc4,_0x522c18,_0x270bb3,_0x1f0be3))[_0x3c5a('0xc')](getTicket(_0x293d52,_0x25ecc4,_0x522c18,_0x337841,_0x167bf6,_0x270bb3))[_0x3c5a('0xc')](function(_0xf251ce){logger[_0x3c5a('0xf')](util[_0x3c5a('0x4f')]('The\x20ticket\x20ID\x20is:\x20%s',_0xf251ce[_0x3c5a('0x40')]));logger[_0x3c5a('0xf')](util['format'](_0x3c5a('0x69'),_0x293d52));if(_0x293d52!==_0x3c5a('0x62')){logger[_0x3c5a('0xf')]('['+[_0x293d52[_0x3c5a('0x12')]()]+']',_0x3c5a('0x6a'));emit(_0x211eea[_0x3c5a('0x57')],_0x1cb35b[_0x3c5a('0x39')],_0xf251ce[_0x3c5a('0x40')]);}})['catch'](function(_0x468f81){logger[_0x3c5a('0x1f')]('['+[_0x293d52[_0x3c5a('0x12')]()]+_0x3c5a('0x6b'),util[_0x3c5a('0x6c')](_0x468f81,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 77d1176..ff68082 100644 --- a/server/services/ami/trigger/integration/sugarcrm.js +++ b/server/services/ami/trigger/integration/sugarcrm.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc86=['catch','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','localhost','socket.io-emitter','POST','emit','name','getString','Subjects','assigned_user_id','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','Calls','apiKey','toString','base64','stringify','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','entry_list','find','value','Agent\x20found!','resolve','name_value_list','user_id','Searching\x20enduser\x20with\x20phone','Contacts','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','%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...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','charAt','user:%s','error','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','Ticket\x20created!'];(function(_0x2377e3,_0x2c0352){var _0x2a6d1b=function(_0x536523){while(--_0x536523){_0x2377e3['push'](_0x2377e3['shift']());}};_0x2a6d1b(++_0x2c0352);}(_0xbc86,0x178));var _0x6bc8=function(_0x195ebc,_0x453d90){_0x195ebc=_0x195ebc-0x0;var _0x519456=_0xbc86[_0x195ebc];return _0x519456;};'use strict';var _=require(_0x6bc8('0x0'));var rp=require(_0x6bc8('0x1'));var BPromise=require(_0x6bc8('0x2'));var md5=require(_0x6bc8('0x3'));var util=require(_0x6bc8('0x4'));var Redis=require(_0x6bc8('0x5'));var intUtil=require(_0x6bc8('0x6'));var config=require(_0x6bc8('0x7'));var logger=require(_0x6bc8('0x8'))(_0x6bc8('0x9'));config['redis']=_[_0x6bc8('0xa')](config['redis'],{'host':_0x6bc8('0xb'),'port':0x18eb});var io=require(_0x6bc8('0xc'))(new Redis(config['redis']));var def={'method':_0x6bc8('0xd'),'json':!![]};function emit(_0x4e26cd,_0x3958a8,_0x134e49){io['to'](_0x4e26cd)[_0x6bc8('0xe')](_0x3958a8,_0x134e49);}function getTicket(_0x2bc628,_0x44e4cc,_0x3541b5,_0xe81d4,_0x3b804a,_0x35b68e,_0x26db96,_0x730182){logger['info']('Creating\x20new\x20ticket...');var _0x17d47f=new Date();var _0x8289b3=[{'name':_0x6bc8('0xf'),'value':intUtil[_0x6bc8('0x10')](_0xe81d4[_0x6bc8('0x11')],_0x3b804a,'\x20')},{'name':_0x6bc8('0x12'),'value':_0x44e4cc['id']},{'name':'created_by','value':_0x44e4cc['id']},{'name':_0x6bc8('0x13'),'value':intUtil[_0x6bc8('0x10')](_0xe81d4[_0x6bc8('0x14')],_0x3b804a,'\x0a')},{'name':'date_start','value':_0x17d47f[_0x6bc8('0x15')]()[_0x6bc8('0x16')](0x0,0x13)[_0x6bc8('0x17')]('T','\x20')},{'name':_0x6bc8('0x18'),'value':'0'},{'name':_0x6bc8('0x19'),'value':'15'},{'name':_0x6bc8('0x1a'),'value':_0x3541b5['id']},{'name':_0x6bc8('0x1b'),'value':'Contacts'},{'name':_0x6bc8('0x1c'),'value':_0x3541b5['name']},{'name':_0x6bc8('0x1d'),'value':_0x730182}];if(_0x35b68e[_0x6bc8('0x1e')]){_[_0x6bc8('0x1f')](_0x35b68e,function(_0x378662){if(_0x3b804a[_0x378662[_0x6bc8('0x20')]]){_0x8289b3[_0x6bc8('0x21')]({'name':_0x378662[_0x6bc8('0x22')],'value':_0x3b804a[_0x378662[_0x6bc8('0x20')]]});}});}return request({'form':{'method':_0x6bc8('0x23'),'input_type':_0x6bc8('0x24'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x26db96['id'],'module_name':_0x6bc8('0x25'),'name_value_list':_0x8289b3})}});}function getAuth(_0x13712d){return util['format']('Basic\x20%s',new Buffer(_0x13712d[_0x6bc8('0x26')]+':X')[_0x6bc8('0x27')](_0x6bc8('0x28')));}function getServerInfo(_0x5ace35){return request({'form':{'method':'get_server_info','input_type':_0x6bc8('0x24'),'response_type':'JSON','rest_data':JSON[_0x6bc8('0x29')]({'session':_0x5ace35['id']})}});}function getUser(_0x313d8f,_0x5ae098,_0x250fed){if(!_[_0x6bc8('0x2a')](_0x5ae098)){logger[_0x6bc8('0x2b')](_0x6bc8('0x2c'),_0x5ae098);return request({'form':{'method':_0x6bc8('0x2d'),'input_type':_0x6bc8('0x24'),'response_type':_0x6bc8('0x24'),'rest_data':JSON[_0x6bc8('0x29')]({'session':_0x250fed['id'],'module_name':_0x6bc8('0x2e'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x5ae098),'order_by':'','offset':'0','select_fields':['id',_0x6bc8('0xf'),_0x6bc8('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x52e446){if(_0x52e446[_0x6bc8('0x30')][_0x6bc8('0x1e')]){var _0xc20ed9=_[_0x6bc8('0x31')](_0x52e446[_0x6bc8('0x30')],function(_0x1d3e8f){return _0x1d3e8f['name_value_list']['user_name'][_0x6bc8('0x32')]===_0x5ae098;});if(_0xc20ed9){logger['info'](_0x6bc8('0x33'));return BPromise[_0x6bc8('0x34')]({'id':_0xc20ed9['name_value_list']['id'][_0x6bc8('0x32')],'name':_0xc20ed9[_0x6bc8('0x35')][_0x6bc8('0xf')][_0x6bc8('0x32')]});}}logger[_0x6bc8('0x2b')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x250fed['name_value_list']['user_id']['value'],'name':_0x250fed['name_value_list']['user_name']['value']});});}else{logger[_0x6bc8('0x2b')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x6bc8('0x34')]({'id':_0x250fed[_0x6bc8('0x35')][_0x6bc8('0x36')][_0x6bc8('0x32')],'name':_0x250fed[_0x6bc8('0x35')][_0x6bc8('0x2f')][_0x6bc8('0x32')]});}}function getEndUser(_0x1f4a8e,_0x5adb7d,_0x3672c7,_0x5e9ef5){logger[_0x6bc8('0x2b')](_0x6bc8('0x37'),_0x3672c7);return request({'form':{'method':_0x6bc8('0x2d'),'input_type':_0x6bc8('0x24'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5e9ef5['id'],'module_name':_0x6bc8('0x38'),'query':util[_0x6bc8('0x39')](_0x6bc8('0x3a'),_0x3672c7),'order_by':'','offset':'0','select_fields':['id',_0x6bc8('0xf'),_0x6bc8('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6bc8('0x3c')](function(_0x239b3d){if(_0x239b3d['entry_list'][_0x6bc8('0x1e')]){var _0x5e9e46=_[_0x6bc8('0x31')](_0x239b3d[_0x6bc8('0x30')],function(_0x32be51){return _0x32be51[_0x6bc8('0x35')][_0x6bc8('0x3b')][_0x6bc8('0x32')]===_0x3672c7;});if(_0x5e9e46){logger[_0x6bc8('0x2b')](_0x6bc8('0x3d'));return BPromise[_0x6bc8('0x34')]({'id':_0x5e9e46[_0x6bc8('0x35')]['id'][_0x6bc8('0x32')],'name':_0x5e9e46[_0x6bc8('0x35')][_0x6bc8('0xf')]['value'],'phone':_0x5e9e46[_0x6bc8('0x35')][_0x6bc8('0x3b')][_0x6bc8('0x32')]});}}else{logger['info'](_0x6bc8('0x3e'));return request({'form':{'method':_0x6bc8('0x23'),'input_type':_0x6bc8('0x24'),'response_type':_0x6bc8('0x24'),'rest_data':JSON[_0x6bc8('0x29')]({'session':_0x5e9ef5['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x5adb7d!==''?_0x5adb7d:util['format'](_0x6bc8('0x3f'),_0x3672c7)},{'name':_0x6bc8('0x3b'),'value':_0x3672c7}]})}})[_0x6bc8('0x3c')](function(_0x2a2b3f){logger[_0x6bc8('0x2b')](_0x6bc8('0x40'));return BPromise[_0x6bc8('0x34')]({'id':_0x2a2b3f['id'],'name':_0x2a2b3f['entry_list']['first_name']['value'],'phone':_0x2a2b3f[_0x6bc8('0x30')][_0x6bc8('0x3b')][_0x6bc8('0x32')]});});}});}function request(_0x54f81c){logger[_0x6bc8('0x41')]('[HTTP]',JSON['stringify'](_0x54f81c));return rp(_[_0x6bc8('0x42')](def,_0x54f81c));}function getTags(_0x59f3f9,_0x21d267){var _0x3fb691=[];if(_0x59f3f9&&_0x59f3f9['length']>0x0){_0x3fb691=_[_0x6bc8('0x43')](_0x59f3f9,_0x21d267);}return _0x3fb691;}function getCustomFields(_0x2cf109,_0xcc9cba){var _0xc2a303=[];var _0x5a961b={'custom_fields':[]};if(_0x2cf109[_0x6bc8('0x1e')]>0x0){_[_0x6bc8('0x1f')](_0x2cf109,function(_0x3dc556){if(_0x3dc556[_0x6bc8('0x44')]===_0x6bc8('0x45')&&_0x3dc556[_0x6bc8('0x46')]&&!_0x3dc556[_0x6bc8('0x47')]){_0x5a961b[_0x3dc556[_0x6bc8('0x46')][_0x6bc8('0x48')]()]=_0x3dc556[_0x6bc8('0x49')]['toString']();}else if(_0x3dc556[_0x6bc8('0x44')]==='string'&&_0x3dc556[_0x6bc8('0x22')]&&_0x3dc556['customField']){_0x5a961b[_0x6bc8('0x4a')][_0x6bc8('0x21')]({'id':_0x3dc556['idField'],'value':_0x3dc556[_0x6bc8('0x49')][_0x6bc8('0x27')]()});}else if(_0x3dc556[_0x6bc8('0x44')]==='variable'&&_0x3dc556[_0x6bc8('0x20')]&&_0x3dc556[_0x6bc8('0x22')]&&_0x3dc556['customField']){_0xcc9cba[_0x3dc556[_0x6bc8('0x20')]]&&_0x5a961b['custom_fields']['push']({'id':_0x3dc556[_0x6bc8('0x22')],'value':_0xcc9cba[_0x3dc556['variableName']][_0x6bc8('0x27')]()});}else if(_0x3dc556['type']===_0x6bc8('0x4b')&&_0x3dc556[_0x6bc8('0x4c')]&&_0x3dc556['Variable'][_0x6bc8('0xf')]&&_0x3dc556['idField']&&_0x3dc556['customField']){_0xcc9cba[_0x3dc556[_0x6bc8('0x4c')]['name'][_0x6bc8('0x48')]()]&&_0x5a961b['custom_fields'][_0x6bc8('0x21')]({'id':_0x3dc556[_0x6bc8('0x22')],'value':_0xcc9cba[_0x3dc556[_0x6bc8('0x4c')][_0x6bc8('0xf')]['toLowerCase']()][_0x6bc8('0x27')]()});}});}return _0x5a961b;}function getConnection(_0x625a6a){return request({'method':_0x6bc8('0xd'),'form':{'method':_0x6bc8('0x4d'),'input_type':_0x6bc8('0x24'),'response_type':_0x6bc8('0x24'),'rest_data':JSON[_0x6bc8('0x29')]({'user_auth':{'user_name':_0x625a6a[_0x6bc8('0x4e')],'password':_0x625a6a[_0x6bc8('0x4f')],'encryption':'PLAIN'},'application':_0x6bc8('0x50')})}})[_0x6bc8('0x3c')](function(_0x2e5d1b){var _0x1ee101=_0x2e5d1b;if(_0x1ee101['id']){def[_0x6bc8('0x51')]=_0x1ee101['id'];return BPromise[_0x6bc8('0x34')](_0x1ee101);}else{throw new Error(util['format'](_0x6bc8('0x52'),_0x625a6a['id']));}});}function setRelationship(_0x4555ce,_0x53dff0,_0x1e7237,_0xa591dc){return request({'form':{'method':_0x6bc8('0x53'),'input_type':_0x6bc8('0x24'),'response_type':_0x6bc8('0x24'),'rest_data':JSON[_0x6bc8('0x29')]({'session':_0x4555ce['id'],'module_name':'Calls','module_id':_0x1e7237['id'],'link_field_name':_0xa591dc,'related_ids':[_0x53dff0['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x6bc8('0x54')]=function(_0x2f6470,_0x3b85b8,_0x2c3fc4,_0x5d2396,_0x2ff110,_0x2c858a){var _0x495553,_0x434678,_0x5489fe,_0x2b5930;_0x2c858a['remoteUri']=intUtil[_0x6bc8('0x55')](_0x2c858a[_0x6bc8('0x56')]);_0x2c858a['serverUrl']=intUtil[_0x6bc8('0x55')](_0x2c858a[_0x6bc8('0x57')]);def[_0x6bc8('0x58')]=util['format'](_0x6bc8('0x59'),_0x2c858a[_0x6bc8('0x56')]);if(_0x2ff110&&_0x2ff110[_0x6bc8('0x5a')]){logger[_0x6bc8('0x2b')](_0x6bc8('0x5b'),'Recording\x20is\x20enabled!');_0x3b85b8[_0x6bc8('0x5c')]=util[_0x6bc8('0x39')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2c858a[_0x6bc8('0x57')],_0x3b85b8[_0x6bc8('0x5d')],md5(_0x3b85b8[_0x6bc8('0x5d')]));}else{_0x3b85b8['recordingURL']='';}return getConnection(_0x2c858a)[_0x6bc8('0x3c')](function(_0x567f9f){_0x2b5930=_0x567f9f;return getUser(_0x2c858a,_0x5d2396[_0x6bc8('0xf')],_0x2b5930);})[_0x6bc8('0x3c')](function(_0x33dca3){_0x495553=_0x33dca3;logger['info'](_0x6bc8('0x5e'),_0x495553['id']);return getEndUser(_0x2c858a,_0x3b85b8['calleridname'],_0x3b85b8[_0x6bc8('0x5f')],_0x2b5930);})['then'](function(_0x4a807b){_0x434678=_0x4a807b;logger[_0x6bc8('0x2b')](_0x6bc8('0x60'),_0x434678['id']);return getTicket(_0x2c858a,_0x495553,_0x434678,_0x2c3fc4,_0x3b85b8,_0x2c3fc4[_0x6bc8('0x61')],_0x2b5930,_0x6bc8('0x62'));})[_0x6bc8('0x3c')](function(_0xb1381){_0x5489fe=_0xb1381;logger[_0x6bc8('0x2b')]('Ticket\x20created!');logger[_0x6bc8('0x2b')]('The\x20Ticket\x20ID\x20is:',_0x5489fe['id']);return setRelationship(_0x2b5930,_0x495553,_0x5489fe,_0x6bc8('0x63'));})['then'](function(){return setRelationship(_0x2b5930,_0x434678,_0x5489fe,_0x6bc8('0x64'));})[_0x6bc8('0x3c')](function(){return getServerInfo(_0x2b5930);})[_0x6bc8('0x3c')](function(_0xc9a2a4){var _0x37472b=parseInt(_0xc9a2a4[_0x6bc8('0x65')]['charAt'](0x0));var _0x2f55a8=util[_0x6bc8('0x39')](_0x6bc8('0x66'),_0x2c858a[_0x6bc8('0x56')],_0x5489fe['id']);if(_0x37472b>0x6){_0x2f55a8=util[_0x6bc8('0x39')](_0x6bc8('0x67'),_0x2c858a[_0x6bc8('0x56')],_0x5489fe['id']);}logger['info'](_0x6bc8('0x5b'),_0x6bc8('0x68'));emit(util[_0x6bc8('0x39')]('user:%s',_0x5d2396[_0x6bc8('0xf')]),_0x6bc8('0x69'),{'uri':_0x2f55a8});})['catch'](function(_0x5574be){logger['error'](_0x6bc8('0x5b'),JSON[_0x6bc8('0x29')](_0x5574be));});};exports[_0x6bc8('0x6a')]=function(_0x558521,_0x3fc296,_0x2ebdcf,_0x2e7bec,_0x417ce8,_0x1792c2,_0xf13342){var _0x5a0437,_0x206c55,_0x4d54ba,_0x2badf9;_0x1792c2[_0x6bc8('0x56')]=intUtil[_0x6bc8('0x55')](_0x1792c2[_0x6bc8('0x56')]);_0x1792c2[_0x6bc8('0x57')]=intUtil[_0x6bc8('0x55')](_0x1792c2['serverUrl']);def[_0x6bc8('0x58')]=util[_0x6bc8('0x39')](_0x6bc8('0x59'),_0x1792c2['remoteUri']);if(_0xf13342&&_0xf13342[_0x6bc8('0x6b')]&&_0xf13342[_0x6bc8('0x6b')]!==_0x6bc8('0x6c')){logger[_0x6bc8('0x2b')](_0x6bc8('0x6d'),_0x6bc8('0x6e'));_0x3fc296[_0x6bc8('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1792c2[_0x6bc8('0x57')],_0x3fc296[_0x6bc8('0x5d')],md5(_0x3fc296[_0x6bc8('0x5d')]));}return getConnection(_0x1792c2)[_0x6bc8('0x3c')](function(_0x41b243){_0x2badf9=_0x41b243;return getUser(_0x1792c2,_0x2e7bec['name'],_0x2badf9);})[_0x6bc8('0x3c')](function(_0x248ff9){_0x5a0437=_0x248ff9;logger[_0x6bc8('0x2b')](_0x6bc8('0x5e'),_0x5a0437['id']);return getEndUser(_0x1792c2,_0x3fc296[_0x6bc8('0x6f')],_0x3fc296[_0x6bc8('0x70')],_0x2badf9);})['then'](function(_0x30fd67){_0x206c55=_0x30fd67;logger[_0x6bc8('0x2b')](_0x6bc8('0x60'),_0x206c55['id']);return getTicket(_0x1792c2,_0x5a0437,_0x206c55,_0x2ebdcf,_0x3fc296,_0x2ebdcf[_0x6bc8('0x61')],_0x2badf9,_0x6bc8('0x71'));})[_0x6bc8('0x3c')](function(_0x25b2d1){_0x4d54ba=_0x25b2d1;logger[_0x6bc8('0x2b')]('Ticket\x20created!');logger[_0x6bc8('0x2b')](_0x6bc8('0x72'),_0x4d54ba['id']);return setRelationship(_0x2badf9,_0x5a0437,_0x4d54ba,_0x6bc8('0x63'));})[_0x6bc8('0x3c')](function(){return setRelationship(_0x2badf9,_0x206c55,_0x4d54ba,'contacts');})[_0x6bc8('0x3c')](function(){return getServerInfo(_0x2badf9);})['then'](function(_0x43c518){var _0x34f68f=parseInt(_0x43c518[_0x6bc8('0x65')][_0x6bc8('0x73')](0x0));var _0x173ffc=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1792c2['remoteUri'],_0x4d54ba['id']);if(_0x34f68f>0x6){_0x173ffc=util[_0x6bc8('0x39')](_0x6bc8('0x67'),_0x1792c2[_0x6bc8('0x56')],_0x4d54ba['id']);}logger[_0x6bc8('0x2b')]('[OUTBOUND]',_0x6bc8('0x68'));emit(util[_0x6bc8('0x39')](_0x6bc8('0x74'),_0x2e7bec[_0x6bc8('0xf')]),'trigger:browser:url',{'uri':_0x173ffc});})['catch'](function(_0x329b54){logger[_0x6bc8('0x75')]('[OUTBOUND]',JSON[_0x6bc8('0x29')](_0x329b54));});};exports[_0x6bc8('0x76')]=function(_0x49946d,_0x5f3fde,_0x1ad5bc,_0x59e3f5,_0x1d5ed9,_0x1f2692){var _0x368620,_0x4f9686,_0x5a68b7,_0xc15c95;_0x1f2692[_0x6bc8('0x56')]=intUtil[_0x6bc8('0x55')](_0x1f2692['remoteUri']);_0x1f2692['serverUrl']=intUtil['stripTrailingSlash'](_0x1f2692[_0x6bc8('0x57')]);def['uri']=util[_0x6bc8('0x39')](_0x6bc8('0x59'),_0x1f2692[_0x6bc8('0x56')]);if(_0x1d5ed9&&_0x1d5ed9[_0x6bc8('0x5a')]){logger[_0x6bc8('0x2b')]('['+_0x5f3fde[_0x6bc8('0x77')][_0x6bc8('0x78')]()+']','Recording\x20is\x20enabled!');_0x5f3fde[_0x6bc8('0x5c')]=util['format'](_0x6bc8('0x79'),_0x1f2692[_0x6bc8('0x57')],_0x5f3fde[_0x6bc8('0x5d')],md5(_0x5f3fde[_0x6bc8('0x5d')]));}else{_0x5f3fde[_0x6bc8('0x5c')]='';}return getConnection(_0x1f2692)[_0x6bc8('0x3c')](function(_0x40559b){_0xc15c95=_0x40559b;if(!_['isNil'](_0x59e3f5)){return getUser(_0x1f2692,_0x59e3f5[_0x6bc8('0xf')],_0xc15c95);}else{return getUser(_0x1f2692,null,_0xc15c95);}})[_0x6bc8('0x3c')](function(_0x3e217d){_0x368620=_0x3e217d;logger['info'](_0x6bc8('0x5e'),_0x368620['id']);return getEndUser(_0x1f2692,_0x5f3fde[_0x6bc8('0x7a')],_0x5f3fde[_0x6bc8('0x5f')],_0xc15c95);})['then'](function(_0x36691a){_0x4f9686=_0x36691a;logger[_0x6bc8('0x2b')](_0x6bc8('0x60'),_0x4f9686['id']);return getTicket(_0x1f2692,_0x368620,_0x4f9686,_0x1ad5bc,_0x5f3fde,_0x1ad5bc[_0x6bc8('0x61')],_0xc15c95,'Inbound');})[_0x6bc8('0x3c')](function(_0x559737){_0x5a68b7=_0x559737;logger[_0x6bc8('0x2b')](_0x6bc8('0x7b'));logger[_0x6bc8('0x2b')]('The\x20Ticket\x20ID\x20is:',_0x5a68b7['id']);return setRelationship(_0xc15c95,_0x368620,_0x5a68b7,_0x6bc8('0x63'));})[_0x6bc8('0x3c')](function(){return setRelationship(_0xc15c95,_0x4f9686,_0x5a68b7,_0x6bc8('0x64'));})[_0x6bc8('0x3c')](function(){return getServerInfo(_0xc15c95);})[_0x6bc8('0x7c')](function(_0x302d67){logger[_0x6bc8('0x75')]('['+_0x5f3fde[_0x6bc8('0x77')][_0x6bc8('0x78')]()+']',JSON['stringify'](_0x302d67));});}; \ No newline at end of file +var _0x63ea=['custom_fields','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','Outbound','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','unmanaged','lastevent','toUpperCase','calleridname','The\x20Ticket\x20ID\x20is:','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','type','string','customField','toLowerCase','content'];(function(_0x2bbd2d,_0x37c3c4){var _0x257dc9=function(_0x1928ff){while(--_0x1928ff){_0x2bbd2d['push'](_0x2bbd2d['shift']());}};_0x257dc9(++_0x37c3c4);}(_0x63ea,0xb4));var _0xa63e=function(_0x32085d,_0x16cf84){_0x32085d=_0x32085d-0x0;var _0x668485=_0x63ea[_0x32085d];return _0x668485;};'use strict';var _=require(_0xa63e('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0xa63e('0x1'));var util=require(_0xa63e('0x2'));var Redis=require(_0xa63e('0x3'));var intUtil=require('./util');var config=require(_0xa63e('0x4'));var logger=require(_0xa63e('0x5'))(_0xa63e('0x6'));config[_0xa63e('0x7')]=_[_0xa63e('0x8')](config[_0xa63e('0x7')],{'host':_0xa63e('0x9'),'port':0x18eb});var io=require(_0xa63e('0xa'))(new Redis(config[_0xa63e('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x1bea8,_0x1f807e,_0x4e2eef){io['to'](_0x1bea8)['emit'](_0x1f807e,_0x4e2eef);}function getTicket(_0xb07835,_0x1895fd,_0x2342ab,_0x19359c,_0x23aaf4,_0x64c709,_0x4ad962,_0x5d21c5){logger[_0xa63e('0xb')](_0xa63e('0xc'));var _0x5eb8bc=new Date();var _0xe54701=[{'name':_0xa63e('0xd'),'value':intUtil[_0xa63e('0xe')](_0x19359c[_0xa63e('0xf')],_0x23aaf4,'\x20')},{'name':_0xa63e('0x10'),'value':_0x1895fd['id']},{'name':'created_by','value':_0x1895fd['id']},{'name':_0xa63e('0x11'),'value':intUtil[_0xa63e('0xe')](_0x19359c[_0xa63e('0x12')],_0x23aaf4,'\x0a')},{'name':_0xa63e('0x13'),'value':_0x5eb8bc[_0xa63e('0x14')]()[_0xa63e('0x15')](0x0,0x13)[_0xa63e('0x16')]('T','\x20')},{'name':_0xa63e('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xa63e('0x18'),'value':_0x2342ab['id']},{'name':_0xa63e('0x19'),'value':_0xa63e('0x1a')},{'name':_0xa63e('0x1b'),'value':_0x2342ab[_0xa63e('0xd')]},{'name':_0xa63e('0x1c'),'value':_0x5d21c5}];if(_0x64c709[_0xa63e('0x1d')]){_[_0xa63e('0x1e')](_0x64c709,function(_0x1b4fd3){if(_0x23aaf4[_0x1b4fd3[_0xa63e('0x1f')]]){_0xe54701[_0xa63e('0x20')]({'name':_0x1b4fd3[_0xa63e('0x21')],'value':_0x23aaf4[_0x1b4fd3[_0xa63e('0x1f')]]});}});}return request({'form':{'method':_0xa63e('0x22'),'input_type':_0xa63e('0x23'),'response_type':'JSON','rest_data':JSON[_0xa63e('0x24')]({'session':_0x4ad962['id'],'module_name':_0xa63e('0x25'),'name_value_list':_0xe54701})}});}function getAuth(_0x363bf0){return util[_0xa63e('0x26')](_0xa63e('0x27'),new Buffer(_0x363bf0['apiKey']+':X')[_0xa63e('0x28')](_0xa63e('0x29')));}function getServerInfo(_0xc3a876){return request({'form':{'method':_0xa63e('0x2a'),'input_type':_0xa63e('0x23'),'response_type':_0xa63e('0x23'),'rest_data':JSON['stringify']({'session':_0xc3a876['id']})}});}function getUser(_0x2689a2,_0x9a8144,_0xd77739){if(!_[_0xa63e('0x2b')](_0x9a8144)){logger['info'](_0xa63e('0x2c'),_0x9a8144);return request({'form':{'method':_0xa63e('0x2d'),'input_type':_0xa63e('0x23'),'response_type':_0xa63e('0x23'),'rest_data':JSON[_0xa63e('0x24')]({'session':_0xd77739['id'],'module_name':_0xa63e('0x2e'),'query':util[_0xa63e('0x26')](_0xa63e('0x2f'),_0x9a8144),'order_by':'','offset':'0','select_fields':['id',_0xa63e('0xd'),_0xa63e('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa63e('0x31')](function(_0xbed636){if(_0xbed636[_0xa63e('0x32')][_0xa63e('0x1d')]){var _0xac8e1e=_[_0xa63e('0x33')](_0xbed636[_0xa63e('0x32')],function(_0x1dcb6f){return _0x1dcb6f[_0xa63e('0x34')]['user_name'][_0xa63e('0x35')]===_0x9a8144;});if(_0xac8e1e){logger[_0xa63e('0xb')](_0xa63e('0x36'));return BPromise[_0xa63e('0x37')]({'id':_0xac8e1e[_0xa63e('0x34')]['id'][_0xa63e('0x35')],'name':_0xac8e1e[_0xa63e('0x34')][_0xa63e('0xd')]['value']});}}logger[_0xa63e('0xb')](_0xa63e('0x38'));return BPromise[_0xa63e('0x37')]({'id':_0xd77739[_0xa63e('0x34')][_0xa63e('0x39')]['value'],'name':_0xd77739[_0xa63e('0x34')][_0xa63e('0x30')]['value']});});}else{logger[_0xa63e('0xb')](_0xa63e('0x3a'));return BPromise[_0xa63e('0x37')]({'id':_0xd77739[_0xa63e('0x34')][_0xa63e('0x39')][_0xa63e('0x35')],'name':_0xd77739['name_value_list'][_0xa63e('0x30')]['value']});}}function getEndUser(_0x102a7e,_0x2be09b,_0x2548d3,_0x559d5){logger[_0xa63e('0xb')](_0xa63e('0x3b'),_0x2548d3);return request({'form':{'method':_0xa63e('0x2d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa63e('0x24')]({'session':_0x559d5['id'],'module_name':_0xa63e('0x1a'),'query':util[_0xa63e('0x26')](_0xa63e('0x3c'),_0x2548d3),'order_by':'','offset':'0','select_fields':['id',_0xa63e('0xd'),_0xa63e('0x3d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa63e('0x31')](function(_0x593d86){if(_0x593d86['entry_list'][_0xa63e('0x1d')]){var _0x1721ac=_[_0xa63e('0x33')](_0x593d86[_0xa63e('0x32')],function(_0x3b57ed){return _0x3b57ed[_0xa63e('0x34')][_0xa63e('0x3d')]['value']===_0x2548d3;});if(_0x1721ac){logger[_0xa63e('0xb')](_0xa63e('0x3e'));return BPromise['resolve']({'id':_0x1721ac[_0xa63e('0x34')]['id'][_0xa63e('0x35')],'name':_0x1721ac['name_value_list'][_0xa63e('0xd')][_0xa63e('0x35')],'phone':_0x1721ac[_0xa63e('0x34')][_0xa63e('0x3d')][_0xa63e('0x35')]});}}else{logger[_0xa63e('0xb')](_0xa63e('0x3f'));return request({'form':{'method':'set_entry','input_type':_0xa63e('0x23'),'response_type':_0xa63e('0x23'),'rest_data':JSON['stringify']({'session':_0x559d5['id'],'module_name':_0xa63e('0x1a'),'name_value_list':[{'name':_0xa63e('0x40'),'value':_0x2be09b!==_0xa63e('0x41')?_0x2be09b:util[_0xa63e('0x26')](_0xa63e('0x42'),_0x2548d3)},{'name':_0xa63e('0x3d'),'value':_0x2548d3}]})}})[_0xa63e('0x31')](function(_0x44688){logger[_0xa63e('0xb')](_0xa63e('0x43'));return BPromise['resolve']({'id':_0x44688['id'],'name':_0x44688[_0xa63e('0x32')][_0xa63e('0x40')][_0xa63e('0x35')],'phone':_0x44688[_0xa63e('0x32')]['phone_home'][_0xa63e('0x35')]});});}});}function request(_0xbbaba7){logger[_0xa63e('0x44')](_0xa63e('0x45'),JSON[_0xa63e('0x24')](_0xbbaba7));return rp(_[_0xa63e('0x46')](def,_0xbbaba7));}function getTags(_0x504048,_0x4f8b98){var _0x27d883=[];if(_0x504048&&_0x504048[_0xa63e('0x1d')]>0x0){_0x27d883=_['map'](_0x504048,_0x4f8b98);}return _0x27d883;}function getCustomFields(_0x27f7c7,_0x56dbf4){var _0x50e0d4=[];var _0x19bbe1={'custom_fields':[]};if(_0x27f7c7[_0xa63e('0x1d')]>0x0){_['forEach'](_0x27f7c7,function(_0x25fc92){if(_0x25fc92[_0xa63e('0x47')]===_0xa63e('0x48')&&_0x25fc92['nameField']&&!_0x25fc92[_0xa63e('0x49')]){_0x19bbe1[_0x25fc92['nameField'][_0xa63e('0x4a')]()]=_0x25fc92[_0xa63e('0x4b')][_0xa63e('0x28')]();}else if(_0x25fc92['type']===_0xa63e('0x48')&&_0x25fc92[_0xa63e('0x21')]&&_0x25fc92[_0xa63e('0x49')]){_0x19bbe1[_0xa63e('0x4c')][_0xa63e('0x20')]({'id':_0x25fc92['idField'],'value':_0x25fc92[_0xa63e('0x4b')]['toString']()});}else if(_0x25fc92[_0xa63e('0x47')]===_0xa63e('0x4d')&&_0x25fc92[_0xa63e('0x1f')]&&_0x25fc92[_0xa63e('0x21')]&&_0x25fc92['customField']){_0x56dbf4[_0x25fc92[_0xa63e('0x1f')]]&&_0x19bbe1['custom_fields'][_0xa63e('0x20')]({'id':_0x25fc92[_0xa63e('0x21')],'value':_0x56dbf4[_0x25fc92[_0xa63e('0x1f')]][_0xa63e('0x28')]()});}else if(_0x25fc92[_0xa63e('0x47')]===_0xa63e('0x4e')&&_0x25fc92['Variable']&&_0x25fc92[_0xa63e('0x4f')][_0xa63e('0xd')]&&_0x25fc92[_0xa63e('0x21')]&&_0x25fc92[_0xa63e('0x49')]){_0x56dbf4[_0x25fc92[_0xa63e('0x4f')]['name'][_0xa63e('0x4a')]()]&&_0x19bbe1[_0xa63e('0x4c')][_0xa63e('0x20')]({'id':_0x25fc92[_0xa63e('0x21')],'value':_0x56dbf4[_0x25fc92[_0xa63e('0x4f')][_0xa63e('0xd')][_0xa63e('0x4a')]()][_0xa63e('0x28')]()});}});}return _0x19bbe1;}function getConnection(_0x40c90e){return request({'method':'POST','form':{'method':_0xa63e('0x50'),'input_type':_0xa63e('0x23'),'response_type':'JSON','rest_data':JSON[_0xa63e('0x24')]({'user_auth':{'user_name':_0x40c90e[_0xa63e('0x51')],'password':_0x40c90e[_0xa63e('0x52')],'encryption':_0xa63e('0x53')},'application':_0xa63e('0x54')})}})[_0xa63e('0x31')](function(_0x41d4a8){var _0x48d1f9=_0x41d4a8;if(_0x48d1f9['id']){def[_0xa63e('0x55')]=_0x48d1f9['id'];return BPromise[_0xa63e('0x37')](_0x48d1f9);}else{throw new Error(util['format'](_0xa63e('0x56'),_0x40c90e['id']));}});}function setRelationship(_0x4cf7d6,_0x41f502,_0x2590ea,_0x5b5650){return request({'form':{'method':_0xa63e('0x57'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa63e('0x24')]({'session':_0x4cf7d6['id'],'module_name':_0xa63e('0x25'),'module_id':_0x2590ea['id'],'link_field_name':_0x5b5650,'related_ids':[_0x41f502['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa63e('0x58')]=function(_0x8e9675,_0x5a10fe,_0x34665e,_0x57dbc0,_0x278dab,_0x1b38bf){var _0x262e36,_0x188c56,_0xa95349,_0x4d25f6;_0x1b38bf[_0xa63e('0x59')]=intUtil[_0xa63e('0x5a')](_0x1b38bf['remoteUri']);_0x1b38bf[_0xa63e('0x5b')]=intUtil['stripTrailingSlash'](_0x1b38bf[_0xa63e('0x5b')]);def['uri']=util['format'](_0xa63e('0x5c'),_0x1b38bf[_0xa63e('0x59')]);if(_0x278dab&&_0x278dab[_0xa63e('0x5d')]){logger[_0xa63e('0xb')](_0xa63e('0x5e'),_0xa63e('0x5f'));_0x5a10fe['recordingURL']=util[_0xa63e('0x26')](_0xa63e('0x60'),_0x1b38bf[_0xa63e('0x5b')],_0x5a10fe[_0xa63e('0x61')],md5(_0x5a10fe[_0xa63e('0x61')]));}else{_0x5a10fe[_0xa63e('0x62')]='';}return getConnection(_0x1b38bf)['then'](function(_0x59127c){_0x4d25f6=_0x59127c;return getUser(_0x1b38bf,_0x57dbc0[_0xa63e('0xd')],_0x4d25f6);})['then'](function(_0x5bf9d9){_0x262e36=_0x5bf9d9;logger[_0xa63e('0xb')](_0xa63e('0x63'),_0x262e36['id']);return getEndUser(_0x1b38bf,_0x5a10fe['calleridname'],_0x5a10fe[_0xa63e('0x64')],_0x4d25f6);})[_0xa63e('0x31')](function(_0x4976cf){_0x188c56=_0x4976cf;logger[_0xa63e('0xb')](_0xa63e('0x65'),_0x188c56['id']);return getTicket(_0x1b38bf,_0x262e36,_0x188c56,_0x34665e,_0x5a10fe,_0x34665e['Fields'],_0x4d25f6,_0xa63e('0x66'));})[_0xa63e('0x31')](function(_0x4c0fa8){_0xa95349=_0x4c0fa8;logger[_0xa63e('0xb')](_0xa63e('0x67'));logger[_0xa63e('0xb')]('The\x20Ticket\x20ID\x20is:',_0xa95349['id']);return setRelationship(_0x4d25f6,_0x262e36,_0xa95349,_0xa63e('0x68'));})['then'](function(){return setRelationship(_0x4d25f6,_0x188c56,_0xa95349,_0xa63e('0x69'));})['then'](function(){return getServerInfo(_0x4d25f6);})[_0xa63e('0x31')](function(_0x82cbd6){var _0x3975a8=parseInt(_0x82cbd6[_0xa63e('0x6a')][_0xa63e('0x6b')](0x0));var _0x3b766d=util[_0xa63e('0x26')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1b38bf['remoteUri'],_0xa95349['id']);if(_0x3975a8>0x6){_0x3b766d=util['format'](_0xa63e('0x6c'),_0x1b38bf[_0xa63e('0x59')],_0xa95349['id']);}logger['info'](_0xa63e('0x5e'),_0xa63e('0x6d'));emit(util[_0xa63e('0x26')](_0xa63e('0x6e'),_0x57dbc0[_0xa63e('0xd')]),_0xa63e('0x6f'),{'uri':_0x3b766d});})[_0xa63e('0x70')](function(_0x4a2ad7){logger[_0xa63e('0x71')](_0xa63e('0x5e'),JSON[_0xa63e('0x24')](_0x4a2ad7));});};exports[_0xa63e('0x72')]=function(_0x3d063f,_0x18d31e,_0x585b43,_0x16f476,_0xfeb79c,_0x367127,_0x23e46b){var _0x5b0718,_0x557a19,_0x13919d,_0x5e01c9;_0x367127[_0xa63e('0x59')]=intUtil[_0xa63e('0x5a')](_0x367127[_0xa63e('0x59')]);_0x367127['serverUrl']=intUtil[_0xa63e('0x5a')](_0x367127['serverUrl']);def[_0xa63e('0x73')]=util['format'](_0xa63e('0x5c'),_0x367127[_0xa63e('0x59')]);if(_0x23e46b&&_0x23e46b['recordingFormat']&&_0x23e46b[_0xa63e('0x74')]!==_0xa63e('0x75')){logger[_0xa63e('0xb')](_0xa63e('0x76'),_0xa63e('0x5f'));_0x18d31e[_0xa63e('0x62')]=util[_0xa63e('0x26')](_0xa63e('0x60'),_0x367127[_0xa63e('0x5b')],_0x18d31e[_0xa63e('0x61')],md5(_0x18d31e[_0xa63e('0x61')]));}return getConnection(_0x367127)['then'](function(_0x1b3dd4){_0x5e01c9=_0x1b3dd4;return getUser(_0x367127,_0x16f476[_0xa63e('0xd')],_0x5e01c9);})[_0xa63e('0x31')](function(_0x5ed8c9){_0x5b0718=_0x5ed8c9;logger[_0xa63e('0xb')](_0xa63e('0x63'),_0x5b0718['id']);return getEndUser(_0x367127,_0x18d31e[_0xa63e('0x77')],_0x18d31e['destcalleridnum'],_0x5e01c9);})['then'](function(_0x261bbb){_0x557a19=_0x261bbb;logger[_0xa63e('0xb')](_0xa63e('0x65'),_0x557a19['id']);return getTicket(_0x367127,_0x5b0718,_0x557a19,_0x585b43,_0x18d31e,_0x585b43[_0xa63e('0x78')],_0x5e01c9,_0xa63e('0x79'));})[_0xa63e('0x31')](function(_0xbf1824){_0x13919d=_0xbf1824;logger[_0xa63e('0xb')](_0xa63e('0x67'));logger[_0xa63e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x13919d['id']);return setRelationship(_0x5e01c9,_0x5b0718,_0x13919d,'users');})[_0xa63e('0x31')](function(){return setRelationship(_0x5e01c9,_0x557a19,_0x13919d,'contacts');})[_0xa63e('0x31')](function(){return getServerInfo(_0x5e01c9);})[_0xa63e('0x31')](function(_0x22f060){var _0x117331=parseInt(_0x22f060[_0xa63e('0x6a')]['charAt'](0x0));var _0x15458c=util[_0xa63e('0x26')](_0xa63e('0x7a'),_0x367127['remoteUri'],_0x13919d['id']);if(_0x117331>0x6){_0x15458c=util['format'](_0xa63e('0x6c'),_0x367127[_0xa63e('0x59')],_0x13919d['id']);}logger['info'](_0xa63e('0x76'),_0xa63e('0x6d'));emit(util[_0xa63e('0x26')]('user:%s',_0x16f476['name']),_0xa63e('0x6f'),{'uri':_0x15458c});})[_0xa63e('0x70')](function(_0x4cf4bb){logger[_0xa63e('0x71')](_0xa63e('0x76'),JSON[_0xa63e('0x24')](_0x4cf4bb));});};exports[_0xa63e('0x7b')]=function(_0xb94184,_0xa98dd2,_0x2a9692,_0x2e947f,_0x10a84c,_0x47af17){var _0x46f86e,_0x4e24fe,_0x1e68ae,_0x477e04;_0x47af17[_0xa63e('0x59')]=intUtil['stripTrailingSlash'](_0x47af17[_0xa63e('0x59')]);_0x47af17['serverUrl']=intUtil[_0xa63e('0x5a')](_0x47af17[_0xa63e('0x5b')]);def[_0xa63e('0x73')]=util[_0xa63e('0x26')](_0xa63e('0x5c'),_0x47af17[_0xa63e('0x59')]);if(_0x10a84c&&_0x10a84c[_0xa63e('0x5d')]){logger['info']('['+_0xa98dd2[_0xa63e('0x7c')][_0xa63e('0x7d')]()+']',_0xa63e('0x5f'));_0xa98dd2[_0xa63e('0x62')]=util[_0xa63e('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x47af17[_0xa63e('0x5b')],_0xa98dd2[_0xa63e('0x61')],md5(_0xa98dd2[_0xa63e('0x61')]));}else{_0xa98dd2[_0xa63e('0x62')]='';}return getConnection(_0x47af17)[_0xa63e('0x31')](function(_0x466476){_0x477e04=_0x466476;if(!_[_0xa63e('0x2b')](_0x2e947f)){return getUser(_0x47af17,_0x2e947f[_0xa63e('0xd')],_0x477e04);}else{return getUser(_0x47af17,null,_0x477e04);}})[_0xa63e('0x31')](function(_0x35a940){_0x46f86e=_0x35a940;logger['info'](_0xa63e('0x63'),_0x46f86e['id']);return getEndUser(_0x47af17,_0xa98dd2[_0xa63e('0x7e')],_0xa98dd2[_0xa63e('0x64')],_0x477e04);})[_0xa63e('0x31')](function(_0x2ae000){_0x4e24fe=_0x2ae000;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4e24fe['id']);return getTicket(_0x47af17,_0x46f86e,_0x4e24fe,_0x2a9692,_0xa98dd2,_0x2a9692[_0xa63e('0x78')],_0x477e04,_0xa63e('0x66'));})[_0xa63e('0x31')](function(_0x3dd457){_0x1e68ae=_0x3dd457;logger[_0xa63e('0xb')](_0xa63e('0x67'));logger[_0xa63e('0xb')](_0xa63e('0x7f'),_0x1e68ae['id']);return setRelationship(_0x477e04,_0x46f86e,_0x1e68ae,_0xa63e('0x68'));})[_0xa63e('0x31')](function(){return setRelationship(_0x477e04,_0x4e24fe,_0x1e68ae,_0xa63e('0x69'));})[_0xa63e('0x31')](function(){return getServerInfo(_0x477e04);})['catch'](function(_0x4a66f7){logger[_0xa63e('0x71')]('['+_0xa98dd2[_0xa63e('0x7c')][_0xa63e('0x7d')]()+']',JSON[_0xa63e('0x24')](_0x4a66f7));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js index 9732d83..eb8369d 100644 --- a/server/services/ami/trigger/integration/util.js +++ b/server/services/ami/trigger/integration/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd90=['join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','length','type','string','content','variable','variableName','push','toString','customVariable','Variable','toLowerCase','name','keyValue','keyType','key','format','%s:\x20%s','keyContent'];(function(_0x57966a,_0x477964){var _0x191765=function(_0x106a01){while(--_0x106a01){_0x57966a['push'](_0x57966a['shift']());}};_0x191765(++_0x477964);}(_0xbd90,0x1db));var _0x0bd9=function(_0x7846be,_0x3b11a8){_0x7846be=_0x7846be-0x0;var _0x322526=_0xbd90[_0x7846be];return _0x322526;};'use strict';var _=require(_0x0bd9('0x0'));var util=require('util');exports['getString']=function(_0x1914bb,_0x312179,_0x429135){var _0x1d7eec=[];if(_0x1914bb['length']>0x0){var _0x58a441=_['sortBy'](_0x1914bb,['id']);for(var _0x3a9a1e=0x0;_0x3a9a1e<_0x58a441[_0x0bd9('0x1')];_0x3a9a1e++){var _0x508e90=_0x58a441[_0x3a9a1e];if(_0x508e90[_0x0bd9('0x2')]===_0x0bd9('0x3')){_0x1d7eec['push'](_0x508e90[_0x0bd9('0x4')]);}else if(_0x508e90[_0x0bd9('0x2')]===_0x0bd9('0x5')&&_0x508e90[_0x0bd9('0x6')]){_0x312179[_0x508e90[_0x0bd9('0x6')]]&&_0x1d7eec[_0x0bd9('0x7')](_0x312179[_0x508e90['variableName']][_0x0bd9('0x8')]());}else if(_0x508e90[_0x0bd9('0x2')]===_0x0bd9('0x9')&&_0x508e90[_0x0bd9('0xa')]&&_0x508e90[_0x0bd9('0xa')]['name']){_0x312179[_0x508e90[_0x0bd9('0xa')]['name'][_0x0bd9('0xb')]()]&&_0x1d7eec[_0x0bd9('0x7')](_0x312179[_0x508e90[_0x0bd9('0xa')][_0x0bd9('0xc')]['toLowerCase']()][_0x0bd9('0x8')]());}else if(_0x508e90['type']===_0x0bd9('0xd')){if(_0x508e90[_0x0bd9('0xe')]===_0x0bd9('0x3')&&_0x508e90[_0x0bd9('0xf')]){_0x1d7eec[_0x0bd9('0x7')](util[_0x0bd9('0x10')](_0x0bd9('0x11'),_0x508e90[_0x0bd9('0xf')],_0x508e90[_0x0bd9('0x12')]));}else if(_0x508e90[_0x0bd9('0xe')]==='variable'&&_0x508e90[_0x0bd9('0x6')]&&_0x508e90['key']){_0x312179[_0x508e90[_0x0bd9('0x6')]]&&_0x1d7eec[_0x0bd9('0x7')](util['format'](_0x0bd9('0x11'),_0x508e90[_0x0bd9('0xf')],_0x312179[_0x508e90[_0x0bd9('0x6')]]));}else if(_0x508e90[_0x0bd9('0xe')]===_0x0bd9('0x9')&&_0x508e90['Variable']&&_0x508e90[_0x0bd9('0xa')][_0x0bd9('0xc')]&&_0x508e90['key']){_0x312179[_0x508e90[_0x0bd9('0xa')]['name']['toLowerCase']()]&&_0x1d7eec[_0x0bd9('0x7')](util[_0x0bd9('0x10')](_0x0bd9('0x11'),_0x508e90[_0x0bd9('0xf')],_0x312179[_0x508e90[_0x0bd9('0xa')][_0x0bd9('0xc')][_0x0bd9('0xb')]()]));}}}}return _0x1d7eec[_0x0bd9('0x13')](_0x429135);};exports[_0x0bd9('0x14')]=function(_0x115ec1){var _0x5d1a63=_0x115ec1[_0x0bd9('0x15')](-0x1);if(_0x5d1a63==='/'){_0x115ec1=_0x115ec1[_0x0bd9('0x16')](0x0,_0x115ec1[_0x0bd9('0x17')](_0x5d1a63));}return _0x115ec1;};exports['validateEmail']=function(_0x5cc936){if(!_[_0x0bd9('0x18')](_0x5cc936)&&_0x5cc936!==''){var _0x11d39e=/^(([^<>()\[\]\\.,;:\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 _0x11d39e[_0x0bd9('0x19')](String(_0x5cc936)[_0x0bd9('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x1cdb=['isNil','test','lodash','util','sortBy','length','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','customVariable','join','substring','lastIndexOf'];(function(_0x2496b8,_0x292f47){var _0x2672f7=function(_0x160388){while(--_0x160388){_0x2496b8['push'](_0x2496b8['shift']());}};_0x2672f7(++_0x292f47);}(_0x1cdb,0x9e));var _0xb1cd=function(_0x157bc0,_0x1163d5){_0x157bc0=_0x157bc0-0x0;var _0x2b5b70=_0x1cdb[_0x157bc0];return _0x2b5b70;};'use strict';var _=require(_0xb1cd('0x0'));var util=require(_0xb1cd('0x1'));exports['getString']=function(_0xfbfdbb,_0x9a04a0,_0x21743f){var _0x5e47a0=[];if(_0xfbfdbb['length']>0x0){var _0x22f8f4=_[_0xb1cd('0x2')](_0xfbfdbb,['id']);for(var _0x553c7e=0x0;_0x553c7e<_0x22f8f4[_0xb1cd('0x3')];_0x553c7e++){var _0x50a652=_0x22f8f4[_0x553c7e];if(_0x50a652[_0xb1cd('0x4')]===_0xb1cd('0x5')){_0x5e47a0[_0xb1cd('0x6')](_0x50a652[_0xb1cd('0x7')]);}else if(_0x50a652[_0xb1cd('0x4')]===_0xb1cd('0x8')&&_0x50a652[_0xb1cd('0x9')]){_0x9a04a0[_0x50a652[_0xb1cd('0x9')]]&&_0x5e47a0[_0xb1cd('0x6')](_0x9a04a0[_0x50a652[_0xb1cd('0x9')]][_0xb1cd('0xa')]());}else if(_0x50a652[_0xb1cd('0x4')]==='customVariable'&&_0x50a652[_0xb1cd('0xb')]&&_0x50a652['Variable'][_0xb1cd('0xc')]){_0x9a04a0[_0x50a652[_0xb1cd('0xb')]['name'][_0xb1cd('0xd')]()]&&_0x5e47a0[_0xb1cd('0x6')](_0x9a04a0[_0x50a652[_0xb1cd('0xb')][_0xb1cd('0xc')][_0xb1cd('0xd')]()][_0xb1cd('0xa')]());}else if(_0x50a652['type']===_0xb1cd('0xe')){if(_0x50a652[_0xb1cd('0xf')]===_0xb1cd('0x5')&&_0x50a652[_0xb1cd('0x10')]){_0x5e47a0[_0xb1cd('0x6')](util[_0xb1cd('0x11')](_0xb1cd('0x12'),_0x50a652['key'],_0x50a652[_0xb1cd('0x13')]));}else if(_0x50a652[_0xb1cd('0xf')]===_0xb1cd('0x8')&&_0x50a652[_0xb1cd('0x9')]&&_0x50a652[_0xb1cd('0x10')]){_0x9a04a0[_0x50a652['variableName']]&&_0x5e47a0[_0xb1cd('0x6')](util['format']('%s:\x20%s',_0x50a652['key'],_0x9a04a0[_0x50a652[_0xb1cd('0x9')]]));}else if(_0x50a652['keyType']===_0xb1cd('0x14')&&_0x50a652[_0xb1cd('0xb')]&&_0x50a652[_0xb1cd('0xb')][_0xb1cd('0xc')]&&_0x50a652[_0xb1cd('0x10')]){_0x9a04a0[_0x50a652[_0xb1cd('0xb')][_0xb1cd('0xc')][_0xb1cd('0xd')]()]&&_0x5e47a0['push'](util['format'](_0xb1cd('0x12'),_0x50a652[_0xb1cd('0x10')],_0x9a04a0[_0x50a652[_0xb1cd('0xb')][_0xb1cd('0xc')][_0xb1cd('0xd')]()]));}}}}return _0x5e47a0[_0xb1cd('0x15')](_0x21743f);};exports['stripTrailingSlash']=function(_0xb9935d){var _0x134044=_0xb9935d['slice'](-0x1);if(_0x134044==='/'){_0xb9935d=_0xb9935d[_0xb1cd('0x16')](0x0,_0xb9935d[_0xb1cd('0x17')](_0x134044));}return _0xb9935d;};exports['validateEmail']=function(_0x34b48f){if(!_[_0xb1cd('0x18')](_0x34b48f)&&_0x34b48f!==''){var _0x3e53ff=/^(([^<>()\[\]\\.,;:\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 _0x3e53ff[_0xb1cd('0x19')](String(_0x34b48f)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index affb82f..32d4794 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x1c4b82,_0x57ed06){var _0x2881a0=function(_0x354dd3){while(--_0x354dd3){_0x1c4b82['push'](_0x1c4b82['shift']());}};_0x2881a0(++_0x57ed06);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x2ecae0,_0x1ed524){var _0x29caff=function(_0x383719){while(--_0x383719){_0x2ecae0['push'](_0x2ecae0['shift']());}};_0x29caff(++_0x1ed524);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 634e4c4..0fc4a20 100644 --- a/server/services/ami/trigger/integration/zendesk.js +++ b/server/services/ami/trigger/integration/zendesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14ab=['Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','email','destcalleridname','[OUTBOUND]','user:%s','%s/agent/tickets/%s','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/environment','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','%s/users.json','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','toString','[HTTP]','stringify','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','string','idField','custom_fields','push','content','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','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...','trigger:browser:url','/api/v2'];(function(_0x375cf2,_0x5e55b7){var _0xb22759=function(_0x41e298){while(--_0x41e298){_0x375cf2['push'](_0x375cf2['shift']());}};_0xb22759(++_0x5e55b7);}(_0x14ab,0x1db));var _0xb14a=function(_0x346f4e,_0x284793){_0x346f4e=_0x346f4e-0x0;var _0xa2392c=_0x14ab[_0x346f4e];return _0xa2392c;};'use strict';var _=require(_0xb14a('0x0'));var rp=require(_0xb14a('0x1'));var md5=require('md5');var util=require(_0xb14a('0x2'));var Redis=require(_0xb14a('0x3'));var intUtil=require(_0xb14a('0x4'));var config=require(_0xb14a('0x5'));var logger=require('../../../../config/logger')(_0xb14a('0x6'));config['redis']=_[_0xb14a('0x7')](config[_0xb14a('0x8')],{'host':_0xb14a('0x9'),'port':0x18eb});var io=require(_0xb14a('0xa'))(new Redis(config[_0xb14a('0x8')]));function emit(_0x3cec28,_0x1c6dcd,_0x10a898){io['to'](_0x3cec28)[_0xb14a('0xb')](_0x1c6dcd,_0x10a898);}var headers={'Content-Type':_0xb14a('0xc'),'Accept':'application/json'};function getTicket(_0x5ba006,_0x1d1587,_0x3e439d,_0x10e7c0,_0x4c0636){logger['info'](_0xb14a('0xd'));return request({'uri':util[_0xb14a('0xe')](_0xb14a('0xf'),_0x5ba006[_0xb14a('0x10')]),'method':_0xb14a('0x11'),'body':{'ticket':_[_0xb14a('0x12')]({'requester_id':_0x3e439d['id'],'submitter_id':_0x1d1587?_0x1d1587['id']:undefined,'assignee_id':_0x1d1587?_0x1d1587['id']:undefined,'tags':getTags(_0x10e7c0[_0xb14a('0x13')],_0xb14a('0x14')),'subject':intUtil[_0xb14a('0x15')](_0x10e7c0['Subjects'],_0x4c0636,'\x20'),'description':intUtil[_0xb14a('0x15')](_0x10e7c0[_0xb14a('0x16')],_0x4c0636,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb14a('0x15')](_0x10e7c0[_0xb14a('0x16')],_0x4c0636,'\x0a')}},getCustomFields(_0x10e7c0[_0xb14a('0x17')],_0x4c0636))}})[_0xb14a('0x18')](function(_0xaf7bd4){logger[_0xb14a('0x19')](_0xb14a('0x1a'));return _0xaf7bd4[_0xb14a('0x1b')];});}function getUser(_0xdbe1bc,_0x5af08c){if(intUtil[_0xb14a('0x1c')](_0x5af08c)){logger[_0xb14a('0x19')](_0xb14a('0x1d'),_0x5af08c);return request({'uri':util['format'](_0xb14a('0x1e'),_0xdbe1bc[_0xb14a('0x10')]),'qs':{'query':util['format'](_0xb14a('0x1f'),_0x5af08c)}})[_0xb14a('0x18')](function(_0x4058b1){if(_0x4058b1[_0xb14a('0x20')]){logger[_0xb14a('0x19')]('Agent\x20found!');return _['find'](_0x4058b1['results'],{'email':_0x5af08c,'role':_0xb14a('0x21')});}else{logger[_0xb14a('0x19')](_0xb14a('0x22'));return request({'uri':util[_0xb14a('0xe')](_0xb14a('0x23'),_0xdbe1bc['remoteUri'])})['then'](function(_0xaf36cb){logger[_0xb14a('0x19')]('Admin\x20account\x20selected.');return _0xaf36cb[_0xb14a('0x24')];});}});}else{logger[_0xb14a('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xb14a('0x23'),_0xdbe1bc[_0xb14a('0x10')])})[_0xb14a('0x18')](function(_0x3293ed){logger[_0xb14a('0x19')](_0xb14a('0x25'));return _0x3293ed['user'];});}}function getEndUser(_0x5a42d8,_0x119c9e,_0x4352aa){logger[_0xb14a('0x19')](_0xb14a('0x26'),_0x4352aa);return request({'uri':util[_0xb14a('0xe')]('%s/search.json',_0x5a42d8[_0xb14a('0x10')]),'qs':{'query':util[_0xb14a('0xe')](_0xb14a('0x27'),_0x4352aa)}})[_0xb14a('0x18')](function(_0x350430){var _0xfada89;if(_0x350430[_0xb14a('0x28')][_0xb14a('0x29')]){_0x350430['results']=_[_0xb14a('0x2a')](_0x350430[_0xb14a('0x28')],{'suspended':![],'role':_0xb14a('0x2b')});if(_0x350430[_0xb14a('0x28')][_0xb14a('0x29')]){_0xfada89=_[_0xb14a('0x2c')](_0x350430[_0xb14a('0x28')]);}}if(_0xfada89){logger[_0xb14a('0x19')](_0xb14a('0x2d'));return _0xfada89;}else{logger[_0xb14a('0x19')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xb14a('0xe')](_0xb14a('0x2e'),_0x5a42d8[_0xb14a('0x10')]),'method':_0xb14a('0x11'),'body':{'user':{'role':_0xb14a('0x2b'),'name':util[_0xb14a('0xe')]('Caller\x20-\x20%s',_0x119c9e||_0x4352aa),'phone':_0x4352aa}}})[_0xb14a('0x18')](function(_0x1aa3f6){logger['info'](_0xb14a('0x2f'));return _0x1aa3f6['user'];});}});}function getAuth(_0x521aa1){var _0x28514d;if(_0x521aa1['authType']===_0xb14a('0x30')){_0x28514d=util[_0xb14a('0xe')](_0xb14a('0x31'),_0x521aa1[_0xb14a('0x32')],_0x521aa1[_0xb14a('0x30')]);}else if(_0x521aa1[_0xb14a('0x33')]===_0xb14a('0x34')){_0x28514d=util[_0xb14a('0xe')](_0xb14a('0x35'),_0x521aa1[_0xb14a('0x32')],_0x521aa1[_0xb14a('0x34')]);}return util[_0xb14a('0xe')]('Basic\x20%s',new Buffer(_0x28514d)[_0xb14a('0x36')]('base64'));}function request(_0x2aaa7d){logger['debug'](_0xb14a('0x37'),JSON[_0xb14a('0x38')](_0x2aaa7d));return rp(_[_0xb14a('0x7')](_0x2aaa7d,{'method':_0xb14a('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x366566,_0x4c6155){var _0x3d5527=[];if(_0x366566&&_0x366566[_0xb14a('0x29')]>0x0){_0x3d5527=_[_0xb14a('0x3a')](_0x366566,_0x4c6155);}return _0x3d5527;}function getCustomFields(_0x3572e3,_0x4a1d2d){var _0x37f18f=[];var _0x5dd7fe={'custom_fields':[]};if(_0x3572e3['length']>0x0){_[_0xb14a('0x3b')](_0x3572e3,function(_0x26b03c){if(_[_0xb14a('0x3c')](['string',_0xb14a('0x3d')],_0x26b03c[_0xb14a('0x3e')])&&_0x26b03c[_0xb14a('0x3f')]&&!_0x26b03c[_0xb14a('0x40')]){_0x5dd7fe[_0x26b03c[_0xb14a('0x3f')][_0xb14a('0x41')]()]=_0x26b03c['content']['toString']();}else if(_[_0xb14a('0x3c')]([_0xb14a('0x42'),_0xb14a('0x3d')],_0x26b03c[_0xb14a('0x3e')])&&_0x26b03c[_0xb14a('0x43')]&&_0x26b03c[_0xb14a('0x40')]){_0x5dd7fe[_0xb14a('0x44')][_0xb14a('0x45')]({'id':_0x26b03c[_0xb14a('0x43')],'value':_0x26b03c[_0xb14a('0x46')][_0xb14a('0x36')]()});}else if(_0x26b03c[_0xb14a('0x3e')]==='variable'&&_0x26b03c[_0xb14a('0x47')]&&_0x26b03c[_0xb14a('0x43')]&&_0x26b03c['customField']){_0x4a1d2d[_0x26b03c[_0xb14a('0x47')]]&&_0x5dd7fe[_0xb14a('0x44')][_0xb14a('0x45')]({'id':_0x26b03c['idField'],'value':_0x4a1d2d[_0x26b03c[_0xb14a('0x47')]][_0xb14a('0x36')]()});}else if(_0x26b03c[_0xb14a('0x3e')]===_0xb14a('0x48')&&_0x26b03c[_0xb14a('0x49')]&&_0x26b03c[_0xb14a('0x49')][_0xb14a('0x14')]&&_0x26b03c['idField']&&_0x26b03c[_0xb14a('0x40')]){_0x4a1d2d[_0x26b03c['Variable'][_0xb14a('0x14')][_0xb14a('0x41')]()]&&_0x5dd7fe['custom_fields']['push']({'id':_0x26b03c[_0xb14a('0x43')],'value':_0x4a1d2d[_0x26b03c[_0xb14a('0x49')][_0xb14a('0x14')]['toLowerCase']()][_0xb14a('0x36')]()});}});}return _0x5dd7fe;}exports[_0xb14a('0x4a')]=function(_0x5a1c1b,_0x4c478f,_0x3b872a,_0x43c6a7,_0x2cd41e,_0x509335){var _0x5825f8,_0x148a7a;_0x509335[_0xb14a('0x10')]=intUtil[_0xb14a('0x4b')](_0x509335[_0xb14a('0x10')]);_0x509335[_0xb14a('0x4c')]=intUtil[_0xb14a('0x4b')](_0x509335['serverUrl']);if(_0x2cd41e&&_0x2cd41e[_0xb14a('0x4d')]){logger[_0xb14a('0x19')](_0xb14a('0x4e'),_0xb14a('0x4f'));_0x4c478f[_0xb14a('0x50')]=util[_0xb14a('0xe')](_0xb14a('0x51'),_0x509335[_0xb14a('0x4c')],_0x4c478f[_0xb14a('0x52')],md5(_0x4c478f['uniqueid']));}else{_0x4c478f[_0xb14a('0x50')]='';}headers[_0xb14a('0x53')]=getAuth(_0x509335);return getUser(_0x509335,_0x43c6a7['email'])[_0xb14a('0x18')](function(_0x2f9fc9){_0x5825f8=_0x2f9fc9;logger[_0xb14a('0x19')](_0xb14a('0x54'),_0x5825f8['id']);return getEndUser(_0x509335,_0x4c478f[_0xb14a('0x55')],_0x4c478f[_0xb14a('0x56')]);})[_0xb14a('0x18')](function(_0x1a6e22){_0x148a7a=_0x1a6e22;logger['info'](_0xb14a('0x57'),_0x148a7a['id']);return getTicket(_0x509335,_0x5825f8,_0x148a7a,_0x3b872a,_0x4c478f);})[_0xb14a('0x18')](function(_0x8714f5){if(_0x8714f5){logger['info'](_0xb14a('0x58'),_0x8714f5['id']);switch(_0x509335['type']){case'integrationTab':logger['info']('[QUEUE]',_0xb14a('0x59'));return request({'uri':util[_0xb14a('0xe')](_0xb14a('0x5a'),_0x509335['remoteUri'],_0x5825f8['id'],_0x8714f5['id']),'method':_0xb14a('0x11')});case _0xb14a('0x5b'):logger[_0xb14a('0x19')]('[QUEUE]',_0xb14a('0x5c'));emit(util['format']('user:%s',_0x43c6a7[_0xb14a('0x14')]),_0xb14a('0x5d'),{'uri':util[_0xb14a('0xe')]('%s/agent/tickets/%s',_0x509335['remoteUri']['replace'](_0xb14a('0x5e'),''),_0x8714f5['id'])});break;default:logger['error'](_0xb14a('0x4e'),_0xb14a('0x5f'));}}})[_0xb14a('0x60')](function(_0x3bc42a){logger[_0xb14a('0x61')](_0xb14a('0x62'),util[_0xb14a('0x63')](_0x3bc42a,{'showHidden':!![],'depth':null}));});};exports[_0xb14a('0x64')]=function(_0x256080,_0xb7ac44,_0x3a8b12,_0x5b3417,_0x3261d7,_0xfcfda1,_0x3efbf3){var _0x22aa6e,_0x339153;_0xfcfda1[_0xb14a('0x10')]=intUtil[_0xb14a('0x4b')](_0xfcfda1[_0xb14a('0x10')]);_0xfcfda1['serverUrl']=intUtil['stripTrailingSlash'](_0xfcfda1[_0xb14a('0x4c')]);if(_0x3efbf3&&_0x3efbf3[_0xb14a('0x65')]&&_0x3efbf3[_0xb14a('0x65')]!==_0xb14a('0x66')){logger[_0xb14a('0x19')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0xb7ac44[_0xb14a('0x50')]=util[_0xb14a('0xe')](_0xb14a('0x51'),_0xfcfda1[_0xb14a('0x4c')],_0xb7ac44[_0xb14a('0x52')],md5(_0xb7ac44['uniqueid']));}headers['Authorization']=getAuth(_0xfcfda1);return getUser(_0xfcfda1,_0x5b3417[_0xb14a('0x67')])[_0xb14a('0x18')](function(_0x395421){_0x22aa6e=_0x395421;logger['info'](_0xb14a('0x54'),_0x22aa6e['id']);return getEndUser(_0xfcfda1,_0xb7ac44[_0xb14a('0x68')],_0xb7ac44['destcalleridnum']);})[_0xb14a('0x18')](function(_0x54ceac){_0x339153=_0x54ceac;logger[_0xb14a('0x19')](_0xb14a('0x57'),_0x339153['id']);return getTicket(_0xfcfda1,_0x22aa6e,_0x339153,_0x3a8b12,_0xb7ac44);})[_0xb14a('0x18')](function(_0x261449){if(_0x261449){logger[_0xb14a('0x19')]('The\x20Ticket\x20ID\x20is:',_0x261449['id']);switch(_0xfcfda1[_0xb14a('0x3e')]){case'integrationTab':logger[_0xb14a('0x19')](_0xb14a('0x69'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xb14a('0x5a'),_0xfcfda1['remoteUri'],_0x22aa6e['id'],_0x261449['id']),'method':_0xb14a('0x11')});case _0xb14a('0x5b'):logger[_0xb14a('0x19')](_0xb14a('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb14a('0xe')](_0xb14a('0x6a'),_0x5b3417['name']),'trigger:browser:url',{'uri':util[_0xb14a('0xe')](_0xb14a('0x6b'),_0xfcfda1['remoteUri'][_0xb14a('0x6c')](_0xb14a('0x5e'),''),_0x261449['id'])});break;default:logger[_0xb14a('0x61')](_0xb14a('0x69'),_0xb14a('0x5f'));}}})['catch'](function(_0x5cc4bd){logger[_0xb14a('0x61')](_0xb14a('0x6d'),util['inspect'](_0x5cc4bd,{'showHidden':!![],'depth':null}));});};exports[_0xb14a('0x6e')]=function(_0x563c75,_0x17c593,_0x2ebe4f,_0x594251,_0x4949ac,_0xbe241a){var _0xac7202,_0x396f22;_0xbe241a['remoteUri']=intUtil[_0xb14a('0x4b')](_0xbe241a[_0xb14a('0x10')]);_0xbe241a['serverUrl']=intUtil[_0xb14a('0x4b')](_0xbe241a['serverUrl']);if(_0x4949ac&&_0x4949ac[_0xb14a('0x4d')]){logger['info']('['+_0x17c593[_0xb14a('0x6f')][_0xb14a('0x70')]()+']',_0xb14a('0x4f'));_0x17c593[_0xb14a('0x50')]=util[_0xb14a('0xe')](_0xb14a('0x51'),_0xbe241a[_0xb14a('0x4c')],_0x17c593['uniqueid'],md5(_0x17c593['uniqueid']));}else{_0x17c593['recordingURL']='';}headers[_0xb14a('0x53')]=getAuth(_0xbe241a);return getUser(_0xbe241a)[_0xb14a('0x18')](function(_0x1b57d1){_0xac7202=_0x1b57d1;logger[_0xb14a('0x19')](_0xb14a('0x54'),_0xac7202['id']);return getEndUser(_0xbe241a,_0x17c593[_0xb14a('0x55')],_0x17c593[_0xb14a('0x56')]);})['then'](function(_0x15207b){_0x396f22=_0x15207b;logger[_0xb14a('0x19')](_0xb14a('0x57'),_0x396f22['id']);return getTicket(_0xbe241a,_0xac7202,_0x396f22,_0x2ebe4f,_0x17c593);})[_0xb14a('0x18')](function(_0x561c7d){if(_0x561c7d){logger[_0xb14a('0x19')](_0xb14a('0x58'),_0x561c7d['id']);}})[_0xb14a('0x60')](function(_0x1a0135){logger[_0xb14a('0x61')]('['+_0x17c593[_0xb14a('0x6f')]['toUpperCase']()+']'+_0xb14a('0x71'),util[_0xb14a('0x63')](_0x1a0135,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xffc9=['Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','destcalleridname','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','inspect','unmanaged','lastevent','\x20Error\x20running\x20Zendesk\x20integration','md5','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','format','count','Agent\x20found!','find','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','%s:%s','username','password','authType','token','Basic\x20%s','toString','base64','[HTTP]','stringify','forEach','includes','type','nameField','customField','content','string','custom_fields','variableName','push','idField','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]'];(function(_0x51369c,_0x5ec552){var _0x387ee9=function(_0x21ed9e){while(--_0x21ed9e){_0x51369c['push'](_0x51369c['shift']());}};_0x387ee9(++_0x5ec552);}(_0xffc9,0x14d));var _0x9ffc=function(_0x34bb44,_0x347cf6){_0x34bb44=_0x34bb44-0x0;var _0x5edef3=_0xffc9[_0x34bb44];return _0x5edef3;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x9ffc('0x0'));var util=require('util');var Redis=require(_0x9ffc('0x1'));var intUtil=require(_0x9ffc('0x2'));var config=require('../../../../config/environment');var logger=require(_0x9ffc('0x3'))(_0x9ffc('0x4'));config[_0x9ffc('0x5')]=_[_0x9ffc('0x6')](config[_0x9ffc('0x5')],{'host':_0x9ffc('0x7'),'port':0x18eb});var io=require(_0x9ffc('0x8'))(new Redis(config[_0x9ffc('0x5')]));function emit(_0x54eea7,_0x376b5a,_0x2a5de1){io['to'](_0x54eea7)['emit'](_0x376b5a,_0x2a5de1);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x25ffd7,_0x496071,_0x108491,_0x436b54,_0x3744fc){logger[_0x9ffc('0x9')](_0x9ffc('0xa'));return request({'uri':util['format'](_0x9ffc('0xb'),_0x25ffd7[_0x9ffc('0xc')]),'method':'POST','body':{'ticket':_[_0x9ffc('0xd')]({'requester_id':_0x108491['id'],'submitter_id':_0x496071?_0x496071['id']:undefined,'assignee_id':_0x496071?_0x496071['id']:undefined,'tags':getTags(_0x436b54[_0x9ffc('0xe')],_0x9ffc('0xf')),'subject':intUtil[_0x9ffc('0x10')](_0x436b54[_0x9ffc('0x11')],_0x3744fc,'\x20'),'description':intUtil['getString'](_0x436b54['Descriptions'],_0x3744fc,'\x0a'),'comment':{'public':![],'body':intUtil[_0x9ffc('0x10')](_0x436b54[_0x9ffc('0x12')],_0x3744fc,'\x0a')}},getCustomFields(_0x436b54['Fields'],_0x3744fc))}})[_0x9ffc('0x13')](function(_0x3018aa){logger[_0x9ffc('0x9')](_0x9ffc('0x14'));return _0x3018aa['ticket'];});}function getUser(_0x2e55a9,_0x1ef986){if(intUtil[_0x9ffc('0x15')](_0x1ef986)){logger[_0x9ffc('0x9')](_0x9ffc('0x16'),_0x1ef986);return request({'uri':util['format']('%s/search.json',_0x2e55a9[_0x9ffc('0xc')]),'qs':{'query':util[_0x9ffc('0x17')]('type:user\x20role:agent\x20email:%s',_0x1ef986)}})[_0x9ffc('0x13')](function(_0x1ebe01){if(_0x1ebe01[_0x9ffc('0x18')]){logger[_0x9ffc('0x9')](_0x9ffc('0x19'));return _[_0x9ffc('0x1a')](_0x1ebe01['results'],{'email':_0x1ef986,'role':'agent'});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x2e55a9[_0x9ffc('0xc')])})[_0x9ffc('0x13')](function(_0x26b57a){logger[_0x9ffc('0x9')](_0x9ffc('0x1b'));return _0x26b57a[_0x9ffc('0x1c')];});}});}else{logger[_0x9ffc('0x9')](_0x9ffc('0x1d'));return request({'uri':util[_0x9ffc('0x17')](_0x9ffc('0x1e'),_0x2e55a9[_0x9ffc('0xc')])})[_0x9ffc('0x13')](function(_0x5101c2){logger['info']('Admin\x20account\x20selected.');return _0x5101c2[_0x9ffc('0x1c')];});}}function getEndUser(_0xde8bf3,_0x1fbd6c,_0x42b317){logger[_0x9ffc('0x9')](_0x9ffc('0x1f'),_0x42b317);return request({'uri':util[_0x9ffc('0x17')]('%s/search.json',_0xde8bf3[_0x9ffc('0xc')]),'qs':{'query':util[_0x9ffc('0x17')](_0x9ffc('0x20'),_0x42b317)}})['then'](function(_0x271835){var _0x13923f;if(_0x271835[_0x9ffc('0x21')]['length']){_0x271835[_0x9ffc('0x21')]=_[_0x9ffc('0x22')](_0x271835[_0x9ffc('0x21')],{'suspended':![],'role':_0x9ffc('0x23')});if(_0x271835[_0x9ffc('0x21')][_0x9ffc('0x24')]){_0x13923f=_[_0x9ffc('0x25')](_0x271835[_0x9ffc('0x21')]);}}if(_0x13923f){logger['info'](_0x9ffc('0x26'));return _0x13923f;}else{logger[_0x9ffc('0x9')](_0x9ffc('0x27'));return request({'uri':util[_0x9ffc('0x17')](_0x9ffc('0x28'),_0xde8bf3[_0x9ffc('0xc')]),'method':'POST','body':{'user':{'role':_0x9ffc('0x23'),'name':util[_0x9ffc('0x17')]('Caller\x20-\x20%s',_0x1fbd6c||_0x42b317),'phone':_0x42b317}}})[_0x9ffc('0x13')](function(_0x2cd816){logger[_0x9ffc('0x9')](_0x9ffc('0x29'));return _0x2cd816['user'];});}});}function getAuth(_0x2f51a1){var _0x4ff17f;if(_0x2f51a1['authType']==='password'){_0x4ff17f=util[_0x9ffc('0x17')](_0x9ffc('0x2a'),_0x2f51a1[_0x9ffc('0x2b')],_0x2f51a1[_0x9ffc('0x2c')]);}else if(_0x2f51a1[_0x9ffc('0x2d')]===_0x9ffc('0x2e')){_0x4ff17f=util[_0x9ffc('0x17')]('%s/token:%s',_0x2f51a1[_0x9ffc('0x2b')],_0x2f51a1['token']);}return util[_0x9ffc('0x17')](_0x9ffc('0x2f'),new Buffer(_0x4ff17f)[_0x9ffc('0x30')](_0x9ffc('0x31')));}function request(_0x46379a){logger['debug'](_0x9ffc('0x32'),JSON[_0x9ffc('0x33')](_0x46379a));return rp(_[_0x9ffc('0x6')](_0x46379a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x473731,_0x5d9ccd){var _0x547e43=[];if(_0x473731&&_0x473731[_0x9ffc('0x24')]>0x0){_0x547e43=_['map'](_0x473731,_0x5d9ccd);}return _0x547e43;}function getCustomFields(_0x277496,_0xef6872){var _0x3edc5f=[];var _0x41932a={'custom_fields':[]};if(_0x277496[_0x9ffc('0x24')]>0x0){_[_0x9ffc('0x34')](_0x277496,function(_0x338ea4){if(_[_0x9ffc('0x35')](['string','picklist'],_0x338ea4[_0x9ffc('0x36')])&&_0x338ea4[_0x9ffc('0x37')]&&!_0x338ea4[_0x9ffc('0x38')]){_0x41932a[_0x338ea4[_0x9ffc('0x37')]['toLowerCase']()]=_0x338ea4[_0x9ffc('0x39')][_0x9ffc('0x30')]();}else if(_['includes']([_0x9ffc('0x3a'),'picklist'],_0x338ea4[_0x9ffc('0x36')])&&_0x338ea4['idField']&&_0x338ea4[_0x9ffc('0x38')]){_0x41932a[_0x9ffc('0x3b')]['push']({'id':_0x338ea4['idField'],'value':_0x338ea4[_0x9ffc('0x39')]['toString']()});}else if(_0x338ea4[_0x9ffc('0x36')]==='variable'&&_0x338ea4[_0x9ffc('0x3c')]&&_0x338ea4['idField']&&_0x338ea4[_0x9ffc('0x38')]){_0xef6872[_0x338ea4['variableName']]&&_0x41932a['custom_fields'][_0x9ffc('0x3d')]({'id':_0x338ea4[_0x9ffc('0x3e')],'value':_0xef6872[_0x338ea4[_0x9ffc('0x3c')]][_0x9ffc('0x30')]()});}else if(_0x338ea4['type']===_0x9ffc('0x3f')&&_0x338ea4[_0x9ffc('0x40')]&&_0x338ea4[_0x9ffc('0x40')][_0x9ffc('0xf')]&&_0x338ea4['idField']&&_0x338ea4[_0x9ffc('0x38')]){_0xef6872[_0x338ea4[_0x9ffc('0x40')]['name']['toLowerCase']()]&&_0x41932a[_0x9ffc('0x3b')][_0x9ffc('0x3d')]({'id':_0x338ea4[_0x9ffc('0x3e')],'value':_0xef6872[_0x338ea4['Variable'][_0x9ffc('0xf')][_0x9ffc('0x41')]()][_0x9ffc('0x30')]()});}});}return _0x41932a;}exports[_0x9ffc('0x42')]=function(_0x1e4942,_0x263395,_0x22ecae,_0x5cc98c,_0x5cecc3,_0x37651d){var _0x6f7a22,_0x3f575e;_0x37651d[_0x9ffc('0xc')]=intUtil[_0x9ffc('0x43')](_0x37651d[_0x9ffc('0xc')]);_0x37651d[_0x9ffc('0x44')]=intUtil['stripTrailingSlash'](_0x37651d[_0x9ffc('0x44')]);if(_0x5cecc3&&_0x5cecc3[_0x9ffc('0x45')]){logger[_0x9ffc('0x9')](_0x9ffc('0x46'),_0x9ffc('0x47'));_0x263395['recordingURL']=util[_0x9ffc('0x17')](_0x9ffc('0x48'),_0x37651d['serverUrl'],_0x263395['uniqueid'],md5(_0x263395[_0x9ffc('0x49')]));}else{_0x263395[_0x9ffc('0x4a')]='';}headers[_0x9ffc('0x4b')]=getAuth(_0x37651d);return getUser(_0x37651d,_0x5cc98c[_0x9ffc('0x4c')])['then'](function(_0x53270e){_0x6f7a22=_0x53270e;logger[_0x9ffc('0x9')](_0x9ffc('0x4d'),_0x6f7a22['id']);return getEndUser(_0x37651d,_0x263395['calleridname'],_0x263395[_0x9ffc('0x4e')]);})['then'](function(_0x4b8b7f){_0x3f575e=_0x4b8b7f;logger[_0x9ffc('0x9')](_0x9ffc('0x4f'),_0x3f575e['id']);return getTicket(_0x37651d,_0x6f7a22,_0x3f575e,_0x22ecae,_0x263395);})[_0x9ffc('0x13')](function(_0x208c43){if(_0x208c43){logger[_0x9ffc('0x9')](_0x9ffc('0x50'),_0x208c43['id']);switch(_0x37651d[_0x9ffc('0x36')]){case'integrationTab':logger[_0x9ffc('0x9')](_0x9ffc('0x46'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x9ffc('0x17')](_0x9ffc('0x51'),_0x37651d[_0x9ffc('0xc')],_0x6f7a22['id'],_0x208c43['id']),'method':_0x9ffc('0x52')});case _0x9ffc('0x53'):logger[_0x9ffc('0x9')](_0x9ffc('0x46'),_0x9ffc('0x54'));emit(util[_0x9ffc('0x17')](_0x9ffc('0x55'),_0x5cc98c[_0x9ffc('0xf')]),'trigger:browser:url',{'uri':util[_0x9ffc('0x17')](_0x9ffc('0x56'),_0x37651d[_0x9ffc('0xc')][_0x9ffc('0x57')](_0x9ffc('0x58'),''),_0x208c43['id'])});break;default:logger[_0x9ffc('0x59')](_0x9ffc('0x46'),_0x9ffc('0x5a'));}}})[_0x9ffc('0x5b')](function(_0x406ea2){logger[_0x9ffc('0x59')](_0x9ffc('0x5c'),util['inspect'](_0x406ea2,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x561d15,_0x30dfc5,_0x2a9d3d,_0x4df815,_0x313bdc,_0x5549e5,_0xb61dbe){var _0x42d6ff,_0xad5a58;_0x5549e5[_0x9ffc('0xc')]=intUtil['stripTrailingSlash'](_0x5549e5['remoteUri']);_0x5549e5[_0x9ffc('0x44')]=intUtil[_0x9ffc('0x43')](_0x5549e5[_0x9ffc('0x44')]);if(_0xb61dbe&&_0xb61dbe[_0x9ffc('0x5d')]&&_0xb61dbe[_0x9ffc('0x5d')]!=='none'){logger['info']('[OUTBOUND]',_0x9ffc('0x47'));_0x30dfc5['recordingURL']=util[_0x9ffc('0x17')](_0x9ffc('0x48'),_0x5549e5[_0x9ffc('0x44')],_0x30dfc5[_0x9ffc('0x49')],md5(_0x30dfc5['uniqueid']));}headers['Authorization']=getAuth(_0x5549e5);return getUser(_0x5549e5,_0x4df815[_0x9ffc('0x4c')])[_0x9ffc('0x13')](function(_0x135e24){_0x42d6ff=_0x135e24;logger[_0x9ffc('0x9')](_0x9ffc('0x4d'),_0x42d6ff['id']);return getEndUser(_0x5549e5,_0x30dfc5[_0x9ffc('0x5e')],_0x30dfc5['destcalleridnum']);})[_0x9ffc('0x13')](function(_0x5f24e6){_0xad5a58=_0x5f24e6;logger[_0x9ffc('0x9')](_0x9ffc('0x4f'),_0xad5a58['id']);return getTicket(_0x5549e5,_0x42d6ff,_0xad5a58,_0x2a9d3d,_0x30dfc5);})['then'](function(_0x4bf831){if(_0x4bf831){logger['info'](_0x9ffc('0x50'),_0x4bf831['id']);switch(_0x5549e5[_0x9ffc('0x36')]){case'integrationTab':logger[_0x9ffc('0x9')](_0x9ffc('0x5f'),_0x9ffc('0x60'));return request({'uri':util[_0x9ffc('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5549e5[_0x9ffc('0xc')],_0x42d6ff['id'],_0x4bf831['id']),'method':_0x9ffc('0x52')});case _0x9ffc('0x53'):logger[_0x9ffc('0x9')](_0x9ffc('0x5f'),_0x9ffc('0x54'));emit(util[_0x9ffc('0x17')](_0x9ffc('0x55'),_0x4df815[_0x9ffc('0xf')]),'trigger:browser:url',{'uri':util['format'](_0x9ffc('0x56'),_0x5549e5[_0x9ffc('0xc')]['replace']('/api/v2',''),_0x4bf831['id'])});break;default:logger[_0x9ffc('0x59')](_0x9ffc('0x5f'),_0x9ffc('0x5a'));}}})[_0x9ffc('0x5b')](function(_0x391b42){logger[_0x9ffc('0x59')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x9ffc('0x61')](_0x391b42,{'showHidden':!![],'depth':null}));});};exports[_0x9ffc('0x62')]=function(_0x4facf2,_0x570b39,_0x249a16,_0xde35d1,_0x23c613,_0x474c14){var _0x157d78,_0x55ed14;_0x474c14[_0x9ffc('0xc')]=intUtil[_0x9ffc('0x43')](_0x474c14[_0x9ffc('0xc')]);_0x474c14[_0x9ffc('0x44')]=intUtil['stripTrailingSlash'](_0x474c14['serverUrl']);if(_0x23c613&&_0x23c613[_0x9ffc('0x45')]){logger['info']('['+_0x570b39[_0x9ffc('0x63')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x570b39[_0x9ffc('0x4a')]=util['format'](_0x9ffc('0x48'),_0x474c14[_0x9ffc('0x44')],_0x570b39['uniqueid'],md5(_0x570b39[_0x9ffc('0x49')]));}else{_0x570b39['recordingURL']='';}headers['Authorization']=getAuth(_0x474c14);return getUser(_0x474c14)['then'](function(_0x39dd47){_0x157d78=_0x39dd47;logger[_0x9ffc('0x9')](_0x9ffc('0x4d'),_0x157d78['id']);return getEndUser(_0x474c14,_0x570b39['calleridname'],_0x570b39['calleridnum']);})['then'](function(_0x3fc4d8){_0x55ed14=_0x3fc4d8;logger[_0x9ffc('0x9')](_0x9ffc('0x4f'),_0x55ed14['id']);return getTicket(_0x474c14,_0x157d78,_0x55ed14,_0x249a16,_0x570b39);})['then'](function(_0x3a6079){if(_0x3a6079){logger[_0x9ffc('0x9')](_0x9ffc('0x50'),_0x3a6079['id']);}})[_0x9ffc('0x5b')](function(_0x3182fb){logger[_0x9ffc('0x59')]('['+_0x570b39['lastevent']['toUpperCase']()+']'+_0x9ffc('0x64'),util[_0x9ffc('0x61')](_0x3182fb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js index cc3458f..7622e09 100644 --- a/server/services/ami/trigger/integration/zoho.js +++ b/server/services/ami/trigger/integration/zoho.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5989=['stringify','length','forEach','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','findIndex','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','What_Id','$se_module','talktime','Call_Duration','mm:ss','answertime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','err','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','recordingURL','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','calleridnum','request-promise','md5','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]'];(function(_0x48b50f,_0x27f519){var _0x2c6e65=function(_0x599482){while(--_0x599482){_0x48b50f['push'](_0x48b50f['shift']());}};_0x2c6e65(++_0x27f519);}(_0x5989,0x1ae));var _0x9598=function(_0x148202,_0x132b6a){_0x148202=_0x148202-0x0;var _0x1b15ad=_0x5989[_0x148202];return _0x1b15ad;};'use strict';var _=require('lodash');var rp=require(_0x9598('0x0'));var md5=require(_0x9598('0x1'));var util=require('util');var intUtil=require(_0x9598('0x2'));var moment=require(_0x9598('0x3'));var Redis=require('ioredis');var BPromise=require(_0x9598('0x4'));var config=require(_0x9598('0x5'));var logger=require(_0x9598('0x6'))(_0x9598('0x7'));config[_0x9598('0x8')]=_['defaults'](config[_0x9598('0x8')],{'host':_0x9598('0x9'),'port':0x18eb});var io=require(_0x9598('0xa'))(new Redis(config[_0x9598('0x8')]));function emit(_0x35e460,_0xcf8f5e,_0xce0b77){io['to'](_0x35e460)[_0x9598('0xb')](_0xcf8f5e,_0xce0b77);}function request(_0x3fd25d){logger[_0x9598('0xc')](_0x9598('0xd'),JSON[_0x9598('0xe')](_0x3fd25d));return rp(_0x3fd25d);}function getCustomFields(_0xfebc1c,_0x9c0419){var _0x2006ff={};if(_0xfebc1c[_0x9598('0xf')]>0x0){_[_0x9598('0x10')](_0xfebc1c,function(_0x4114cf){if(_['includes'](['string','picklist'],_0x4114cf[_0x9598('0x11')])&&_0x4114cf[_0x9598('0x12')]){_0x2006ff[_0x4114cf[_0x9598('0x12')]]=_0x4114cf[_0x9598('0x13')][_0x9598('0x14')]();}else if(_0x4114cf[_0x9598('0x11')]===_0x9598('0x15')&&_0x4114cf[_0x9598('0x16')]&&_0x4114cf[_0x9598('0x12')]&&_0x9c0419[_0x4114cf['variableName']]){_0x2006ff[_0x4114cf[_0x9598('0x12')]]=_0x9c0419[_0x4114cf[_0x9598('0x16')]][_0x9598('0x14')]();}else if(_0x4114cf[_0x9598('0x11')]===_0x9598('0x17')&&_0x4114cf[_0x9598('0x18')]&&_0x4114cf['Variable'][_0x9598('0x19')]&&_0x4114cf[_0x9598('0x12')]&&_0x9c0419[_0x4114cf[_0x9598('0x18')][_0x9598('0x19')][_0x9598('0x1a')]()]){_0x2006ff[_0x4114cf['idField']]=_0x9c0419[_0x4114cf['Variable'][_0x9598('0x19')]['toLowerCase']()][_0x9598('0x14')]();}});}return _0x2006ff;}function getName(_0x38affb){if(_0x38affb[_0x9598('0x1b')]('\x20')>0x0){var _0x1cbe7a=_0x38affb[_0x9598('0x1c')](/ (.+)/);if(_0x1cbe7a[0x1]){return _0x1cbe7a;}}return[_0x38affb,_0x38affb];}var accountsTokens={};function getAccessToken(_0x265410){return new Promise(function(_0x47466d,_0x497774){if(!_[_0x9598('0x1d')](accountsTokens[_0x265410['id']])&&!_[_0x9598('0x1d')](accountsTokens[_0x265410['id']]['access_token'])){if(moment()[_0x9598('0x1e')](accountsTokens[_0x265410['id']][_0x9598('0x1f')])){_0x47466d(accountsTokens[_0x265410['id']][_0x9598('0x20')]);}}var _0x460826;switch(_0x265410[_0x9598('0x21')]){case'US':_0x460826=_0x9598('0x22');break;case'AU':_0x460826=_0x9598('0x23');break;case'EU':_0x460826=_0x9598('0x24');break;case'IN':_0x460826='https://accounts.zoho.in';break;case'CN':_0x460826='https://accounts.zoho.com.cn';break;default:_0x460826=_0x9598('0x24');break;}var _0x56ab4b={'method':_0x9598('0x25'),'uri':_0x460826+_0x9598('0x26'),'qs':{'refresh_token':_0x265410[_0x9598('0x27')],'client_id':_0x265410['clientId'],'client_secret':_0x265410[_0x9598('0x28')],'grant_type':_0x9598('0x29')},'json':!![]};return rp(_0x56ab4b)[_0x9598('0x2a')](function(_0x493570){accountsTokens[_0x265410['id']]={'access_token':_0x493570[_0x9598('0x20')],'expires_in':moment()['add'](_0x493570[_0x9598('0x1f')],'seconds')};_0x47466d(_0x493570['access_token']);})[_0x9598('0x2b')](function(_0x1c75c0){logger[_0x9598('0x2c')]('Failing\x20creating\x20the\x20access_token',_0x1c75c0[_0x9598('0x2d')]);_0x497774(_0x1c75c0);});});}function getUser(_0x3ebd12,_0x299160,_0x15c43b,_0xff3808){logger[_0x9598('0x2e')](_0x9598('0x2f'));return request({'method':_0x9598('0x30'),'uri':util[_0x9598('0x31')](_0x9598('0x32'),_0x299160),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x9598('0x33')+_0x3ebd12},'json':!![]})['then'](function(_0x1650d5){if(_0x1650d5['users']){var _0x1dee9a=-0x1;if(_['isArrayLikeObject'](_0x1650d5[_0x9598('0x34')])){if(!_[_0x9598('0x1d')](_0xff3808)){_0x1dee9a=_[_0x9598('0x35')](_0x1650d5[_0x9598('0x34')],function(_0x4ec4af){return _0x4ec4af['email']===_0xff3808;});}if(_0x1dee9a>=0x0){logger[_0x9598('0x2e')](_0x9598('0x36'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x1dee9a=_[_0x9598('0x35')](_0x1650d5['users'],function(_0x1fcc70){return _0x1fcc70[_0x9598('0x37')][_0x9598('0x19')]===_0x9598('0x38');});}return _0x1650d5[_0x9598('0x34')][_0x1dee9a];}else{if(_0x1650d5[_0x9598('0x39')][_0x9598('0x37')][_0x9598('0x19')]===_0x9598('0x38')){logger['info'](_0x9598('0x3a'));user=_0x1650d5['user'];return user;}else{logger[_0x9598('0x2c')](_0x9598('0x3b'),JSON['stringify'](_0x1650d5));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x9598('0xe')](_0x1650d5));}}}else{logger['error'](_0x9598('0x3b'),JSON[_0x9598('0xe')](_0x1650d5));throw new Error(_0x9598('0x3c')+JSON[_0x9598('0xe')](_0x1650d5));}})[_0x9598('0x2b')](function(_0x98f4b){console[_0x9598('0x2c')](_0x98f4b);});}function getZohoUser(_0x9e6de8,_0xac2a68){return new BPromise(function(_0x142880,_0x863ab7){request(_0x9e6de8)[_0x9598('0x2a')](function(_0x42b59a){var _0x1da3ab=null;if(_0x42b59a){_0x1da3ab=_0x42b59a[_0x9598('0x3d')][0x0];_0x1da3ab['enduserType']=_0xac2a68;}_0x142880(_0x1da3ab);})[_0x9598('0x2b')](function(_0x34c6b4){_0x863ab7(_0x34c6b4);});});}function createEndUser(_0x4a79d0,_0x58c469,_0xd57bf6,_0x47aa5f,_0x1cc97a,_0x1e87b4){var _0xd57bf6=getName(_0xd57bf6);return request({'method':_0x9598('0x25'),'uri':_0x9598('0x3e')+_0x58c469+_0x9598('0x3f')+_[_0x9598('0x40')](_0x1e87b4[_0x9598('0x41')])+'s','body':{'data':[{'Last_Name':_0xd57bf6[0x1],'First_Name':_0xd57bf6[0x0],'Phone':_0x47aa5f,'Owner':{'name':!_['isNil'](_0x1cc97a[_0x9598('0x42')]['name'])?_0x1cc97a[_0x9598('0x42')][_0x9598('0x19')]:!_[_0x9598('0x1d')](_0x1cc97a[_0x9598('0x43')])?_0x1cc97a['first_name']+'\x20'+_0x1cc97a[_0x9598('0x44')]:_0x1cc97a['last_name'],'id':_0x1cc97a['id']}}]},'headers':{'Authorization':_0x9598('0x33')+_0x4a79d0},'json':!![]})[_0x9598('0x2a')](function(_0x15b36f){if(_0x15b36f&&_0x15b36f['data'][0x0][_0x9598('0x45')]===_0x9598('0x46')){var _0x5030c0=_0x15b36f[_0x9598('0x3d')][0x0][_0x9598('0x47')];_0x5030c0['enduserType']=_[_0x9598('0x40')](_0x1e87b4[_0x9598('0x41')])+'s';return _0x5030c0;}logger[_0x9598('0x2c')](_0x9598('0x3b'),JSON['stringify'](data));throw new Error(_0x9598('0x48')+JSON[_0x9598('0xe')](data));})[_0x9598('0x2b')](function(_0x3acae2){console[_0x9598('0x49')](_0x9598('0x4a'),_0x3acae2);});}function getEndUser(_0x2dba7f,_0x9ae4d2,_0xcf78d4,_0x3a9b4b,_0x1fc921,_0x1cef20,_0x36ec66){var _0x557da8={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2dba7f},'json':!![]};switch(_0x36ec66[_0x9598('0x4b')]){case _0x9598('0x4c'):_0x557da8[_0x9598('0x4d')]=_0x9598('0x3e')+_0x9ae4d2+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x1fc921+'))';return getZohoUser(_0x557da8,_0x9598('0x4e'))['then'](function(_0x113003){if(_0x113003)return _0x113003;_0x557da8[_0x9598('0x4d')]=_0x9598('0x3e')+_0x9ae4d2+_0x9598('0x4f')+_0x1fc921+'))';return getZohoUser(_0x557da8,_0x9598('0x50'))[_0x9598('0x2a')](function(_0x393c20){if(_0x393c20)return _0x393c20;if(_0x36ec66[_0x9598('0x41')]!=_0x9598('0x51')){return createEndUser(_0x2dba7f,_0x9ae4d2,_0x3a9b4b,_0x1fc921,_0x1cef20,_0x36ec66);}else{return{};}});});break;case _0x9598('0x52'):_0x557da8['uri']=_0x9598('0x3e')+_0x9ae4d2+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x1fc921+'))';return getZohoUser(_0x557da8,_0x9598('0x4e'))[_0x9598('0x2a')](function(_0x216cd6){if(_0x216cd6)return _0x216cd6;if(_0x36ec66[_0x9598('0x41')]!=_0x9598('0x51')){return createEndUser(_0x2dba7f,_0x9ae4d2,_0x3a9b4b,_0x1fc921,_0x1cef20,_0x36ec66);}else{return{};}});break;case _0x9598('0x53'):_0x557da8[_0x9598('0x4d')]=_0x9598('0x3e')+_0x9ae4d2+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1fc921+'))';return getZohoUser(_0x557da8,_0x9598('0x50'))[_0x9598('0x2a')](function(_0x3e01af){if(_0x3e01af)return _0x3e01af;if(_0x36ec66[_0x9598('0x41')]!=_0x9598('0x51')){return createEndUser(_0x2dba7f,_0x9ae4d2,_0x3a9b4b,_0x1fc921,_0x1cef20,_0x36ec66);}else{return{};}});break;}}function getCall(_0x132854,_0x278e96,_0x3e35a4,_0x4aa1e7,_0x1c9163,_0x240963,_0x2fb4d4,_0x32d7ee){logger['info'](_0x9598('0x54'));var _0x1e1043={};_0x1e1043[_0x9598('0x55')]={'name':!_[_0x9598('0x1d')](_0x4aa1e7[_0x9598('0x42')][_0x9598('0x19')])&&!_['isNil'](_0x4aa1e7[_0x9598('0x37')][_0x9598('0x19')])&&_0x4aa1e7[_0x9598('0x37')][_0x9598('0x19')]===_0x9598('0x56')?_0x4aa1e7[_0x9598('0x42')][_0x9598('0x19')]:!_[_0x9598('0x1d')](_0x4aa1e7[_0x9598('0x43')])?_0x4aa1e7[_0x9598('0x43')]+'\x20'+_0x4aa1e7[_0x9598('0x44')]:_0x4aa1e7['last_name'],'id':_0x4aa1e7['id']};_0x1e1043[_0x9598('0x57')]=intUtil[_0x9598('0x58')](_0x240963[_0x9598('0x59')],_0x2fb4d4,'\x20');_0x1e1043[_0x9598('0x5a')]=intUtil[_0x9598('0x58')](_0x240963[_0x9598('0x5b')],_0x2fb4d4,'\x0a');if(_0x1c9163[_0x9598('0x5c')]==='Contacts'){_0x1e1043[_0x9598('0x5d')]={'name':!_[_0x9598('0x1d')](_0x1c9163['Full_Name'])?_0x1c9163[_0x9598('0x5e')]:!_[_0x9598('0x1d')](_0x1c9163[_0x9598('0x5f')])?_0x1c9163['First_Name']+'\x20'+_0x1c9163['Last_Name']:_0x1c9163['Last_Name'],'id':_0x1c9163['id']};}if(_0x1c9163[_0x9598('0x5c')]==='Leads'){_0x1e1043[_0x9598('0x60')]={'name':!_[_0x9598('0x1d')](_0x1c9163[_0x9598('0x5e')])?_0x1c9163['Full_Name']:!_[_0x9598('0x1d')](_0x1c9163[_0x9598('0x5f')])?_0x1c9163[_0x9598('0x5f')]+'\x20'+_0x1c9163['Last_Name']:_0x1c9163['Last_Name'],'id':_0x1c9163['id']};_0x1e1043[_0x9598('0x61')]=_[_0x9598('0x40')](_0x1c9163[_0x9598('0x5c')]);}if(_0x2fb4d4[_0x9598('0x62')]){_0x1e1043[_0x9598('0x63')]=moment['utc'](parseInt(_0x2fb4d4[_0x9598('0x62')])*0x3e8)[_0x9598('0x31')](_0x9598('0x64'));}else if(_0x2fb4d4[_0x9598('0x65')]&&_0x2fb4d4['endtime']){_0x1e1043['Call_Duration']=moment['utc'](moment(_0x2fb4d4['endtime'],_0x9598('0x66'))['diff'](moment(_0x2fb4d4[_0x9598('0x67')],_0x9598('0x66'))))['format'](_0x9598('0x64'));}switch(_0x2fb4d4[_0x9598('0x68')]){case _0x9598('0x69'):_0x1e1043[_0x9598('0x6a')]=_0x9598('0x6b');break;case'complete':case'connect':_0x1e1043[_0x9598('0x6a')]='Answered';break;case'rejected':_0x1e1043[_0x9598('0x6a')]=_0x9598('0x6c');break;case _0x9598('0x6d'):_0x1e1043['Call_Result']=_0x9598('0x6e');break;case'timeout':_0x1e1043[_0x9598('0x6a')]='Timeout';default:}_0x1e1043[_0x9598('0x6f')]=(_0x32d7ee===_0x9598('0x70')?moment(_0x2fb4d4[_0x9598('0x67')])[_0x9598('0x31')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x2fb4d4[_0x9598('0x71')])[_0x9598('0x31')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x9598('0x31')](_0x9598('0x66'));_0x1e1043[_0x9598('0x72')]=_0x32d7ee||_0x9598('0x73');_0x1e1043=_['merge'](_0x1e1043,getCustomFields(_0x240963[_0x9598('0x74')],_0x2fb4d4));return request({'method':'POST','uri':_0x9598('0x3e')+_0x278e96+_0x9598('0x75'),'headers':{'Authorization':_0x9598('0x33')+_0x132854},'body':{'data':[_0x1e1043]},'json':!![]})[_0x9598('0x2a')](function(_0x33133d){if(_0x33133d&&_0x33133d['data'][0x0][_0x9598('0x45')]===_0x9598('0x46')){logger['info']('Call\x20created!');return{'id':_0x33133d[_0x9598('0x3d')][0x0][_0x9598('0x47')]['id']};}})['catch'](function(_0x3377f3){logger[_0x9598('0x2e')]('err',_0x3377f3[_0x9598('0x2d')]);console['log'](_0x9598('0x76'),_0x3377f3);});}exports['queue']=function(_0x179cd5,_0x29f6e3,_0x56d14f,_0x2cd082,_0x272704,_0x79cdfe){var _0x44d92e,_0x4c9c9c,_0x2472c6;_0x79cdfe[_0x9598('0x77')]=intUtil[_0x9598('0x78')](_0x79cdfe[_0x9598('0x77')]);_0x79cdfe[_0x9598('0x79')]=intUtil[_0x9598('0x78')](_0x79cdfe[_0x9598('0x79')]);if(_0x272704&&_0x272704['monitor_format']){logger[_0x9598('0x2e')]('[QUEUE]',_0x9598('0x7a'));_0x29f6e3['recordingURL']=_0x79cdfe[_0x9598('0x79')]+_0x9598('0x7b')+_0x29f6e3['uniqueid']+_0x9598('0x7c')+md5(_0x29f6e3[_0x9598('0x7d')]);}else{_0x29f6e3[_0x9598('0x7e')]='';}var _0x3864dc=_0x79cdfe['host']===_0x9598('0x7f')?'eu':_0x9598('0x80');return getAccessToken(_0x79cdfe)[_0x9598('0x2a')](function(_0x393b27){_0x2472c6=_0x393b27;return getUser(_0x2472c6,_0x3864dc,_0x79cdfe,_0x2cd082[_0x9598('0x81')]);})['then'](function(_0x4529e1){_0x44d92e=_0x4529e1;logger[_0x9598('0x2e')](_0x9598('0x82'),_0x44d92e['id']);return getEndUser(_0x2472c6,_0x3864dc,_0x79cdfe,_0x29f6e3[_0x9598('0x83')],_0x29f6e3['calleridnum'],_0x44d92e,_0x56d14f);})['then'](function(_0x489bdc){_0x4c9c9c=_0x489bdc;return getCall(_0x2472c6,_0x3864dc,_0x79cdfe,_0x44d92e,_0x4c9c9c,_0x56d14f,_0x29f6e3,'Inbound');})[_0x9598('0x2a')](function(_0x45fd31){if(_0x45fd31){logger[_0x9598('0x2e')](_0x9598('0x84'),_0x45fd31['id']);logger[_0x9598('0x2e')](_0x9598('0x85'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9598('0x31')](_0x9598('0x86'),_0x2cd082['name']),_0x9598('0x87'),{'uri':'https://crm.'+_0x79cdfe['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x45fd31['id']});}})['catch'](function(_0x8d08ea){logger['error'](_0x9598('0x85'),JSON[_0x9598('0xe')](_0x8d08ea));});};exports[_0x9598('0x70')]=function(_0x2f3093,_0xa6ba3e,_0x3ae79e,_0x383003,_0xa29430,_0xfe9c56,_0x5e86d1){var _0x27e50e,_0x453254,_0x444fbd;_0xfe9c56[_0x9598('0x77')]=intUtil['stripTrailingSlash'](_0xfe9c56[_0x9598('0x77')]);_0xfe9c56[_0x9598('0x79')]=intUtil[_0x9598('0x78')](_0xfe9c56[_0x9598('0x79')]);if(_0x5e86d1&&_0x5e86d1['recordingFormat']&&_0x5e86d1[_0x9598('0x88')]!=='none'){logger[_0x9598('0x2e')](_0x9598('0x89'),_0x9598('0x7a'));_0xa6ba3e[_0x9598('0x7e')]=_0xfe9c56[_0x9598('0x79')]+_0x9598('0x7b')+_0xa6ba3e['uniqueid']+_0x9598('0x7c')+md5(_0xa6ba3e[_0x9598('0x7d')]);}var _0x400d62=_0xfe9c56[_0x9598('0x77')]===_0x9598('0x7f')?'eu':_0x9598('0x80');return getAccessToken(_0xfe9c56)[_0x9598('0x2a')](function(_0xc7890b){_0x444fbd=_0xc7890b;return getUser(_0x444fbd,_0x400d62,_0xfe9c56,_0x383003[_0x9598('0x81')]);})[_0x9598('0x2a')](function(_0x3a9a44){_0x27e50e=_0x3a9a44;logger['info'](_0x9598('0x82'),_0x27e50e['id']);return getEndUser(_0x444fbd,_0x400d62,_0xfe9c56,_0xa6ba3e[_0x9598('0x8a')],_0xa6ba3e[_0x9598('0x8b')],_0x27e50e,_0x3ae79e);})[_0x9598('0x2a')](function(_0x2e55e2){_0x453254=_0x2e55e2;return getCall(_0x444fbd,_0x400d62,_0xfe9c56,_0x27e50e,_0x453254,_0x3ae79e,_0xa6ba3e,_0x9598('0x8c'));})[_0x9598('0x2a')](function(_0x4529ec){if(_0x4529ec){logger[_0x9598('0x2e')](_0x9598('0x84'),_0x4529ec['id']);logger[_0x9598('0x2e')](_0x9598('0x89'),_0x9598('0x8d'));emit(util['format'](_0x9598('0x86'),_0x383003['name']),_0x9598('0x87'),{'uri':_0x9598('0x8e')+_0xfe9c56[_0x9598('0x77')]+_0x9598('0x8f')+_0x4529ec['id']});}})[_0x9598('0x2b')](function(_0x16a6f7){logger[_0x9598('0x2c')](_0x9598('0x89'),JSON['stringify'](_0x16a6f7));});};exports[_0x9598('0x90')]=function(_0x5c5d31,_0x25092a,_0x4782e5,_0x492cb3,_0x50fa24,_0x3bb1c3){var _0x48a371,_0x567e33,_0x35c74d;_0x3bb1c3[_0x9598('0x77')]=intUtil['stripTrailingSlash'](_0x3bb1c3[_0x9598('0x77')]);_0x3bb1c3['serverUrl']=intUtil[_0x9598('0x78')](_0x3bb1c3[_0x9598('0x79')]);if(_0x50fa24&&_0x50fa24[_0x9598('0x91')]){logger[_0x9598('0x2e')]('['+_0x25092a[_0x9598('0x68')][_0x9598('0x92')]()+']',_0x9598('0x7a'));_0x25092a[_0x9598('0x7e')]=_0x3bb1c3[_0x9598('0x79')]+_0x9598('0x7b')+_0x25092a[_0x9598('0x7d')]+_0x9598('0x7c')+md5(_0x25092a[_0x9598('0x7d')]);}else{_0x25092a['recordingURL']='';}var _0x3d2db2=_0x3bb1c3[_0x9598('0x77')]===_0x9598('0x7f')?'eu':_0x9598('0x80');return getAccessToken(_0x3bb1c3)[_0x9598('0x2a')](function(_0x2284ad){_0x35c74d=_0x2284ad;return getUser(_0x35c74d,_0x3d2db2,_0x3bb1c3);})['then'](function(_0x5ce9ed){_0x48a371=_0x5ce9ed;logger[_0x9598('0x2e')](_0x9598('0x82'),_0x48a371['id']);return getEndUser(_0x35c74d,_0x3d2db2,_0x3bb1c3,_0x25092a[_0x9598('0x83')],_0x25092a[_0x9598('0x93')],_0x48a371,_0x4782e5);})[_0x9598('0x2a')](function(_0x484131){_0x567e33=_0x484131;return getCall(_0x35c74d,_0x3d2db2,_0x3bb1c3,_0x48a371,_0x567e33,_0x4782e5,_0x25092a,'Inbound');})[_0x9598('0x2a')](function(_0x4cfa03){if(_0x4cfa03){logger['info'](_0x9598('0x84'),_0x4cfa03['id']);}})['catch'](function(_0x805b4){logger[_0x9598('0x2c')]('['+_0x25092a[_0x9598('0x68')][_0x9598('0x92')]()+']',JSON['stringify'](_0x805b4));});}; \ No newline at end of file +var _0x5620=['agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','com','destcalleridname','destcalleridnum','Outbound','user:%s','unmanaged','toUpperCase','The\x20User\x20ID\x20is:','lodash','md5','util','bluebird','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','includes','type','idField','content','variable','variableName','toString','Variable','name','toLowerCase','indexOf','split','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','isNil','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','Creating\x20new\x20call...','Owner','administrator','first_name','Subject','getString','Subjects','Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound'];(function(_0x156725,_0x451ecf){var _0x33a40d=function(_0x5a0efc){while(--_0x5a0efc){_0x156725['push'](_0x156725['shift']());}};_0x33a40d(++_0x451ecf);}(_0x5620,0xbf));var _0x0562=function(_0x36feb2,_0x53abef){_0x36feb2=_0x36feb2-0x0;var _0x292b43=_0x5620[_0x36feb2];return _0x292b43;};'use strict';var _=require(_0x0562('0x0'));var rp=require('request-promise');var md5=require(_0x0562('0x1'));var util=require(_0x0562('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0x0562('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0562('0x4'))('zoho');config[_0x0562('0x5')]=_[_0x0562('0x6')](config[_0x0562('0x5')],{'host':_0x0562('0x7'),'port':0x18eb});var io=require(_0x0562('0x8'))(new Redis(config[_0x0562('0x5')]));function emit(_0x5f47ba,_0x55e78c,_0xa0840){io['to'](_0x5f47ba)['emit'](_0x55e78c,_0xa0840);}function request(_0x2a4ad9){logger[_0x0562('0x9')](_0x0562('0xa'),JSON[_0x0562('0xb')](_0x2a4ad9));return rp(_0x2a4ad9);}function getCustomFields(_0x259b6f,_0x538cb8){var _0xef7f27={};if(_0x259b6f[_0x0562('0xc')]>0x0){_[_0x0562('0xd')](_0x259b6f,function(_0x9732ee){if(_[_0x0562('0xe')](['string','picklist'],_0x9732ee[_0x0562('0xf')])&&_0x9732ee[_0x0562('0x10')]){_0xef7f27[_0x9732ee[_0x0562('0x10')]]=_0x9732ee[_0x0562('0x11')]['toString']();}else if(_0x9732ee[_0x0562('0xf')]===_0x0562('0x12')&&_0x9732ee[_0x0562('0x13')]&&_0x9732ee[_0x0562('0x10')]&&_0x538cb8[_0x9732ee['variableName']]){_0xef7f27[_0x9732ee[_0x0562('0x10')]]=_0x538cb8[_0x9732ee['variableName']][_0x0562('0x14')]();}else if(_0x9732ee[_0x0562('0xf')]==='customVariable'&&_0x9732ee[_0x0562('0x15')]&&_0x9732ee['Variable'][_0x0562('0x16')]&&_0x9732ee[_0x0562('0x10')]&&_0x538cb8[_0x9732ee[_0x0562('0x15')]['name'][_0x0562('0x17')]()]){_0xef7f27[_0x9732ee['idField']]=_0x538cb8[_0x9732ee[_0x0562('0x15')]['name'][_0x0562('0x17')]()][_0x0562('0x14')]();}});}return _0xef7f27;}function getName(_0x494277){if(_0x494277[_0x0562('0x18')]('\x20')>0x0){var _0x2f6771=_0x494277[_0x0562('0x19')](/ (.+)/);if(_0x2f6771[0x1]){return _0x2f6771;}}return[_0x494277,_0x494277];}var accountsTokens={};function getAccessToken(_0x90626d){return new Promise(function(_0x5dbc61,_0x2f6d34){if(!_['isNil'](accountsTokens[_0x90626d['id']])&&!_['isNil'](accountsTokens[_0x90626d['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x90626d['id']][_0x0562('0x1a')])){_0x5dbc61(accountsTokens[_0x90626d['id']][_0x0562('0x1b')]);}}var _0x17a454;switch(_0x90626d[_0x0562('0x1c')]){case'US':_0x17a454=_0x0562('0x1d');break;case'AU':_0x17a454='https://accounts.zoho.com.au';break;case'EU':_0x17a454='https://accounts.zoho.eu';break;case'IN':_0x17a454=_0x0562('0x1e');break;case'CN':_0x17a454=_0x0562('0x1f');break;default:_0x17a454=_0x0562('0x20');break;}var _0x3eb41c={'method':_0x0562('0x21'),'uri':_0x17a454+'/oauth/v2/token','qs':{'refresh_token':_0x90626d[_0x0562('0x22')],'client_id':_0x90626d[_0x0562('0x23')],'client_secret':_0x90626d[_0x0562('0x24')],'grant_type':_0x0562('0x25')},'json':!![]};return rp(_0x3eb41c)[_0x0562('0x26')](function(_0xade948){accountsTokens[_0x90626d['id']]={'access_token':_0xade948[_0x0562('0x1b')],'expires_in':moment()[_0x0562('0x27')](_0xade948[_0x0562('0x1a')],_0x0562('0x28'))};_0x5dbc61(_0xade948[_0x0562('0x1b')]);})['catch'](function(_0x229669){logger[_0x0562('0x29')](_0x0562('0x2a'),_0x229669[_0x0562('0x2b')]);_0x2f6d34(_0x229669);});});}function getUser(_0x5e09e1,_0x49f584,_0x51ac77,_0x5373c4){logger[_0x0562('0x2c')]('Search\x20user');return request({'method':_0x0562('0x2d'),'uri':util[_0x0562('0x2e')](_0x0562('0x2f'),_0x49f584),'qs':{'type':_0x0562('0x30')},'headers':{'Authorization':_0x0562('0x31')+_0x5e09e1},'json':!![]})[_0x0562('0x26')](function(_0x24bd4a){if(_0x24bd4a[_0x0562('0x32')]){var _0x263185=-0x1;if(_[_0x0562('0x33')](_0x24bd4a['users'])){if(!_[_0x0562('0x34')](_0x5373c4)){_0x263185=_[_0x0562('0x35')](_0x24bd4a['users'],function(_0x4d5e90){return _0x4d5e90[_0x0562('0x36')]===_0x5373c4;});}if(_0x263185>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x0562('0x2c')](_0x0562('0x37'));_0x263185=_['findIndex'](_0x24bd4a[_0x0562('0x32')],function(_0x189f02){return _0x189f02[_0x0562('0x38')]['name']===_0x0562('0x39');});}return _0x24bd4a[_0x0562('0x32')][_0x263185];}else{if(_0x24bd4a[_0x0562('0x3a')][_0x0562('0x38')][_0x0562('0x16')]===_0x0562('0x39')){logger['info'](_0x0562('0x37'));user=_0x24bd4a[_0x0562('0x3a')];return user;}else{logger[_0x0562('0x29')](_0x0562('0x3b'),JSON['stringify'](_0x24bd4a));throw new Error(_0x0562('0x3c')+JSON['stringify'](_0x24bd4a));}}}else{logger[_0x0562('0x29')](_0x0562('0x3b'),JSON[_0x0562('0xb')](_0x24bd4a));throw new Error(_0x0562('0x3c')+JSON[_0x0562('0xb')](_0x24bd4a));}})[_0x0562('0x3d')](function(_0x249923){console['error'](_0x249923);});}function getZohoUser(_0x4ed9b2,_0x3fb56d){return new BPromise(function(_0x265d2b,_0x3b5a95){request(_0x4ed9b2)['then'](function(_0x1bd333){var _0x579da8=null;if(_0x1bd333){_0x579da8=_0x1bd333[_0x0562('0x3e')][0x0];_0x579da8['enduserType']=_0x3fb56d;}_0x265d2b(_0x579da8);})['catch'](function(_0x4e17d7){_0x3b5a95(_0x4e17d7);});});}function createEndUser(_0x3df711,_0xd3b10e,_0x46e0a3,_0x2633b5,_0x12437c,_0x541126){var _0x46e0a3=getName(_0x46e0a3);return request({'method':_0x0562('0x21'),'uri':_0x0562('0x3f')+_0xd3b10e+_0x0562('0x40')+_[_0x0562('0x41')](_0x541126[_0x0562('0x42')])+'s','body':{'data':[{'Last_Name':_0x46e0a3[0x1],'First_Name':_0x46e0a3[0x0],'Phone':_0x2633b5,'Owner':{'name':!_['isNil'](_0x12437c[_0x0562('0x43')]['name'])?_0x12437c[_0x0562('0x43')][_0x0562('0x16')]:!_[_0x0562('0x34')](_0x12437c['first_name'])?_0x12437c['first_name']+'\x20'+_0x12437c[_0x0562('0x44')]:_0x12437c[_0x0562('0x44')],'id':_0x12437c['id']}}]},'headers':{'Authorization':_0x0562('0x31')+_0x3df711},'json':!![]})['then'](function(_0x22afb1){if(_0x22afb1&&_0x22afb1[_0x0562('0x3e')][0x0][_0x0562('0x45')]===_0x0562('0x46')){var _0x173490=_0x22afb1[_0x0562('0x3e')][0x0][_0x0562('0x47')];_0x173490['enduserType']=_['startCase'](_0x541126['moduleCreate'])+'s';return _0x173490;}logger[_0x0562('0x29')](_0x0562('0x3b'),JSON[_0x0562('0xb')](data));throw new Error(_0x0562('0x48')+JSON['stringify'](data));})['catch'](function(_0x5c1de2){console[_0x0562('0x49')](_0x0562('0x4a'),_0x5c1de2);});}function getEndUser(_0x5a3e84,_0x2ad0da,_0x4b2b0c,_0x292c5c,_0x4b1c1a,_0x265908,_0x1ced54){var _0x22cf79={'method':_0x0562('0x2d'),'uri':'','headers':{'Authorization':_0x0562('0x31')+_0x5a3e84},'json':!![]};switch(_0x1ced54[_0x0562('0x4b')]){case _0x0562('0x4c'):_0x22cf79['uri']=_0x0562('0x3f')+_0x2ad0da+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4b1c1a+'))';return getZohoUser(_0x22cf79,'Contacts')['then'](function(_0x52186a){if(_0x52186a)return _0x52186a;_0x22cf79[_0x0562('0x4d')]=_0x0562('0x3f')+_0x2ad0da+_0x0562('0x4e')+_0x4b1c1a+'))';return getZohoUser(_0x22cf79,_0x0562('0x4f'))[_0x0562('0x26')](function(_0x4fbab8){if(_0x4fbab8)return _0x4fbab8;if(_0x1ced54['moduleCreate']!='nothing'){return createEndUser(_0x5a3e84,_0x2ad0da,_0x292c5c,_0x4b1c1a,_0x265908,_0x1ced54);}else{return{};}});});break;case _0x0562('0x50'):_0x22cf79[_0x0562('0x4d')]=_0x0562('0x3f')+_0x2ad0da+_0x0562('0x51')+_0x4b1c1a+'))';return getZohoUser(_0x22cf79,'Contacts')[_0x0562('0x26')](function(_0x3508f1){if(_0x3508f1)return _0x3508f1;if(_0x1ced54[_0x0562('0x42')]!=_0x0562('0x52')){return createEndUser(_0x5a3e84,_0x2ad0da,_0x292c5c,_0x4b1c1a,_0x265908,_0x1ced54);}else{return{};}});break;case'lead':_0x22cf79[_0x0562('0x4d')]=_0x0562('0x3f')+_0x2ad0da+_0x0562('0x4e')+_0x4b1c1a+'))';return getZohoUser(_0x22cf79,_0x0562('0x4f'))['then'](function(_0x298111){if(_0x298111)return _0x298111;if(_0x1ced54['moduleCreate']!='nothing'){return createEndUser(_0x5a3e84,_0x2ad0da,_0x292c5c,_0x4b1c1a,_0x265908,_0x1ced54);}else{return{};}});break;}}function getCall(_0x1b9470,_0x3bb2ec,_0x2cfe0f,_0x4abba4,_0x431b41,_0x4ca2a9,_0x262bba,_0xa4c75c){logger[_0x0562('0x2c')](_0x0562('0x53'));var _0x5a2b08={};_0x5a2b08[_0x0562('0x54')]={'name':!_[_0x0562('0x34')](_0x4abba4[_0x0562('0x43')]['name'])&&!_[_0x0562('0x34')](_0x4abba4[_0x0562('0x38')][_0x0562('0x16')])&&_0x4abba4[_0x0562('0x38')][_0x0562('0x16')]===_0x0562('0x55')?_0x4abba4[_0x0562('0x43')][_0x0562('0x16')]:!_['isNil'](_0x4abba4[_0x0562('0x56')])?_0x4abba4[_0x0562('0x56')]+'\x20'+_0x4abba4[_0x0562('0x44')]:_0x4abba4['last_name'],'id':_0x4abba4['id']};_0x5a2b08[_0x0562('0x57')]=intUtil[_0x0562('0x58')](_0x4ca2a9[_0x0562('0x59')],_0x262bba,'\x20');_0x5a2b08[_0x0562('0x5a')]=intUtil[_0x0562('0x58')](_0x4ca2a9[_0x0562('0x5b')],_0x262bba,'\x0a');if(_0x431b41[_0x0562('0x5c')]==='Contacts'){_0x5a2b08[_0x0562('0x5d')]={'name':!_[_0x0562('0x34')](_0x431b41['Full_Name'])?_0x431b41[_0x0562('0x5e')]:!_[_0x0562('0x34')](_0x431b41['First_Name'])?_0x431b41[_0x0562('0x5f')]+'\x20'+_0x431b41['Last_Name']:_0x431b41[_0x0562('0x60')],'id':_0x431b41['id']};}if(_0x431b41[_0x0562('0x5c')]===_0x0562('0x4f')){_0x5a2b08[_0x0562('0x61')]={'name':!_[_0x0562('0x34')](_0x431b41[_0x0562('0x5e')])?_0x431b41['Full_Name']:!_[_0x0562('0x34')](_0x431b41[_0x0562('0x5f')])?_0x431b41['First_Name']+'\x20'+_0x431b41[_0x0562('0x60')]:_0x431b41[_0x0562('0x60')],'id':_0x431b41['id']};_0x5a2b08[_0x0562('0x62')]=_['startCase'](_0x431b41[_0x0562('0x5c')]);}if(_0x262bba['talktime']){_0x5a2b08[_0x0562('0x63')]=moment[_0x0562('0x64')](parseInt(_0x262bba[_0x0562('0x65')])*0x3e8)['format'](_0x0562('0x66'));}else if(_0x262bba[_0x0562('0x67')]&&_0x262bba[_0x0562('0x68')]){_0x5a2b08[_0x0562('0x63')]=moment[_0x0562('0x64')](moment(_0x262bba[_0x0562('0x68')],_0x0562('0x69'))[_0x0562('0x6a')](moment(_0x262bba[_0x0562('0x6b')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0x0562('0x66'));}switch(_0x262bba[_0x0562('0x6c')]){case _0x0562('0x6d'):_0x5a2b08[_0x0562('0x6e')]=_0x0562('0x6f');break;case _0x0562('0x70'):case _0x0562('0x71'):_0x5a2b08[_0x0562('0x6e')]=_0x0562('0x72');break;case _0x0562('0x73'):_0x5a2b08['Call_Result']=_0x0562('0x74');break;case _0x0562('0x75'):_0x5a2b08['Call_Result']=_0x0562('0x76');break;case _0x0562('0x77'):_0x5a2b08[_0x0562('0x6e')]=_0x0562('0x78');default:}_0x5a2b08[_0x0562('0x79')]=(_0xa4c75c===_0x0562('0x7a')?moment(_0x262bba[_0x0562('0x6b')])['format'](_0x0562('0x69')):moment(_0x262bba[_0x0562('0x7b')])[_0x0562('0x2e')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x0562('0x2e')]('YYYY-MM-DDTHH:mm:ss');_0x5a2b08[_0x0562('0x7c')]=_0xa4c75c||_0x0562('0x7d');_0x5a2b08=_['merge'](_0x5a2b08,getCustomFields(_0x4ca2a9[_0x0562('0x7e')],_0x262bba));return request({'method':'POST','uri':_0x0562('0x3f')+_0x3bb2ec+_0x0562('0x7f'),'headers':{'Authorization':_0x0562('0x31')+_0x1b9470},'body':{'data':[_0x5a2b08]},'json':!![]})[_0x0562('0x26')](function(_0x27c1bd){if(_0x27c1bd&&_0x27c1bd[_0x0562('0x3e')][0x0][_0x0562('0x45')]===_0x0562('0x46')){logger[_0x0562('0x2c')]('Call\x20created!');return{'id':_0x27c1bd['data'][0x0][_0x0562('0x47')]['id']};}})[_0x0562('0x3d')](function(_0x51a069){logger[_0x0562('0x2c')](_0x0562('0x80'),_0x51a069[_0x0562('0x2b')]);console[_0x0562('0x49')](_0x0562('0x80'),_0x51a069);});}exports[_0x0562('0x81')]=function(_0x3da65d,_0x7c80d9,_0xad4693,_0x2d49ec,_0xb53a14,_0x4ac8fb){var _0x4356b2,_0x3758fc,_0x10218c;_0x4ac8fb[_0x0562('0x82')]=intUtil[_0x0562('0x83')](_0x4ac8fb[_0x0562('0x82')]);_0x4ac8fb[_0x0562('0x84')]=intUtil['stripTrailingSlash'](_0x4ac8fb[_0x0562('0x84')]);if(_0xb53a14&&_0xb53a14[_0x0562('0x85')]){logger[_0x0562('0x2c')]('[QUEUE]',_0x0562('0x86'));_0x7c80d9['recordingURL']=_0x4ac8fb['serverUrl']+_0x0562('0x87')+_0x7c80d9['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x7c80d9[_0x0562('0x88')]);}else{_0x7c80d9[_0x0562('0x89')]='';}var _0x317971=_0x4ac8fb[_0x0562('0x82')]===_0x0562('0x8a')?'eu':'com';return getAccessToken(_0x4ac8fb)[_0x0562('0x26')](function(_0x2c23e0){_0x10218c=_0x2c23e0;return getUser(_0x10218c,_0x317971,_0x4ac8fb,_0x2d49ec['email']);})[_0x0562('0x26')](function(_0x192226){_0x4356b2=_0x192226;logger[_0x0562('0x2c')]('The\x20User\x20ID\x20is:',_0x4356b2['id']);return getEndUser(_0x10218c,_0x317971,_0x4ac8fb,_0x7c80d9[_0x0562('0x8b')],_0x7c80d9['calleridnum'],_0x4356b2,_0xad4693);})[_0x0562('0x26')](function(_0x8af2cf){_0x3758fc=_0x8af2cf;return getCall(_0x10218c,_0x317971,_0x4ac8fb,_0x4356b2,_0x3758fc,_0xad4693,_0x7c80d9,_0x0562('0x7d'));})['then'](function(_0x34e217){if(_0x34e217){logger[_0x0562('0x2c')](_0x0562('0x8c'),_0x34e217['id']);logger['info']('[QUEUE]',_0x0562('0x8d'));emit(util[_0x0562('0x2e')]('user:%s',_0x2d49ec[_0x0562('0x16')]),_0x0562('0x8e'),{'uri':_0x0562('0x8f')+_0x4ac8fb['host']+_0x0562('0x90')+_0x34e217['id']});}})[_0x0562('0x3d')](function(_0x597d5c){logger[_0x0562('0x29')]('[QUEUE]',JSON['stringify'](_0x597d5c));});};exports[_0x0562('0x7a')]=function(_0x26910c,_0xfe2793,_0x49b1a2,_0x4475f3,_0x31ee04,_0x5f45cd,_0x1f6bfb){var _0x4ace56,_0x5b48c1,_0x16eb92;_0x5f45cd[_0x0562('0x82')]=intUtil[_0x0562('0x83')](_0x5f45cd['host']);_0x5f45cd[_0x0562('0x84')]=intUtil[_0x0562('0x83')](_0x5f45cd['serverUrl']);if(_0x1f6bfb&&_0x1f6bfb[_0x0562('0x91')]&&_0x1f6bfb['recordingFormat']!==_0x0562('0x92')){logger['info'](_0x0562('0x93'),_0x0562('0x86'));_0xfe2793['recordingURL']=_0x5f45cd['serverUrl']+_0x0562('0x87')+_0xfe2793[_0x0562('0x88')]+_0x0562('0x94')+md5(_0xfe2793['uniqueid']);}var _0xb83ef8=_0x5f45cd['host']===_0x0562('0x8a')?'eu':_0x0562('0x95');return getAccessToken(_0x5f45cd)[_0x0562('0x26')](function(_0x447a4e){_0x16eb92=_0x447a4e;return getUser(_0x16eb92,_0xb83ef8,_0x5f45cd,_0x4475f3['email']);})[_0x0562('0x26')](function(_0x261d03){_0x4ace56=_0x261d03;logger['info']('The\x20User\x20ID\x20is:',_0x4ace56['id']);return getEndUser(_0x16eb92,_0xb83ef8,_0x5f45cd,_0xfe2793[_0x0562('0x96')],_0xfe2793[_0x0562('0x97')],_0x4ace56,_0x49b1a2);})['then'](function(_0x11e443){_0x5b48c1=_0x11e443;return getCall(_0x16eb92,_0xb83ef8,_0x5f45cd,_0x4ace56,_0x5b48c1,_0x49b1a2,_0xfe2793,_0x0562('0x98'));})[_0x0562('0x26')](function(_0x51dcdb){if(_0x51dcdb){logger[_0x0562('0x2c')](_0x0562('0x8c'),_0x51dcdb['id']);logger[_0x0562('0x2c')](_0x0562('0x93'),_0x0562('0x8d'));emit(util[_0x0562('0x2e')](_0x0562('0x99'),_0x4475f3[_0x0562('0x16')]),_0x0562('0x8e'),{'uri':_0x0562('0x8f')+_0x5f45cd['host']+_0x0562('0x90')+_0x51dcdb['id']});}})[_0x0562('0x3d')](function(_0xb059cc){logger[_0x0562('0x29')](_0x0562('0x93'),JSON[_0x0562('0xb')](_0xb059cc));});};exports[_0x0562('0x9a')]=function(_0x27405c,_0x58cb44,_0x5aaf83,_0xba04aa,_0x3e8a43,_0x12a447){var _0x1f777d,_0x4a0063,_0xde6817;_0x12a447[_0x0562('0x82')]=intUtil[_0x0562('0x83')](_0x12a447[_0x0562('0x82')]);_0x12a447[_0x0562('0x84')]=intUtil[_0x0562('0x83')](_0x12a447[_0x0562('0x84')]);if(_0x3e8a43&&_0x3e8a43[_0x0562('0x85')]){logger[_0x0562('0x2c')]('['+_0x58cb44[_0x0562('0x6c')][_0x0562('0x9b')]()+']',_0x0562('0x86'));_0x58cb44['recordingURL']=_0x12a447[_0x0562('0x84')]+'/api/voice/recordings/'+_0x58cb44[_0x0562('0x88')]+'/downloads?type=uniqueid&token='+md5(_0x58cb44['uniqueid']);}else{_0x58cb44[_0x0562('0x89')]='';}var _0x35a5b4=_0x12a447[_0x0562('0x82')]===_0x0562('0x8a')?'eu':_0x0562('0x95');return getAccessToken(_0x12a447)[_0x0562('0x26')](function(_0x13dc99){_0xde6817=_0x13dc99;return getUser(_0xde6817,_0x35a5b4,_0x12a447);})[_0x0562('0x26')](function(_0x81b17d){_0x1f777d=_0x81b17d;logger[_0x0562('0x2c')](_0x0562('0x9c'),_0x1f777d['id']);return getEndUser(_0xde6817,_0x35a5b4,_0x12a447,_0x58cb44[_0x0562('0x8b')],_0x58cb44['calleridnum'],_0x1f777d,_0x5aaf83);})[_0x0562('0x26')](function(_0x4e21bf){_0x4a0063=_0x4e21bf;return getCall(_0xde6817,_0x35a5b4,_0x12a447,_0x1f777d,_0x4a0063,_0x5aaf83,_0x58cb44,'Inbound');})[_0x0562('0x26')](function(_0x287d02){if(_0x287d02){logger[_0x0562('0x2c')](_0x0562('0x8c'),_0x287d02['id']);}})[_0x0562('0x3d')](function(_0x2df741){logger[_0x0562('0x29')]('['+_0x58cb44[_0x0562('0x6c')][_0x0562('0x9b')]()+']',JSON[_0x0562('0xb')](_0x2df741));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index db11173..252d6f0 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bde=['shelljs','mustache','../../../../config/logger','trigger','Script','exec','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x0bde,0xcb));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var util=require(_0xe0bd('0x0'));var sh=require(_0xe0bd('0x1'));var Mustache=require(_0xe0bd('0x2'));var logger=require(_0xe0bd('0x3'))(_0xe0bd('0x4'));exports['exec']=function(_0x101857,_0x523532){var _0x58355f=_0x101857['data2']?_0x101857['data2']:_0xe0bd('0x5');var _0x48715c=_0x101857['data3']?Mustache['render'](_0x101857['data3'],_0x523532):_0x523532;sh[_0xe0bd('0x6')](_0x48715c,function(_0x383e9d,_0x2e6047,_0x505f3f){if(_0x383e9d!==0x0){logger[_0xe0bd('0x7')](util['format'](_0xe0bd('0x8'),_0x58355f,_0x48715c,_0x383e9d,_0x505f3f));}else{logger[_0xe0bd('0x9')](util[_0xe0bd('0xa')](_0xe0bd('0xb'),_0x58355f,_0x48715c,_0x2e6047));}});}; \ No newline at end of file +var _0xc22a=['info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','exec','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc22a,0x6f));var _0xac22=function(_0x41595e,_0x1cd078){_0x41595e=_0x41595e-0x0;var _0x270b13=_0xc22a[_0x41595e];return _0x270b13;};'use strict';var util=require(_0xac22('0x0'));var sh=require('shelljs');var Mustache=require(_0xac22('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0xac22('0x2')]=function(_0x4773c5,_0x9ade20){var _0x205b76=_0x4773c5[_0xac22('0x3')]?_0x4773c5[_0xac22('0x3')]:_0xac22('0x4');var _0x2a9112=_0x4773c5[_0xac22('0x5')]?Mustache[_0xac22('0x6')](_0x4773c5[_0xac22('0x5')],_0x9ade20):_0x9ade20;sh['exec'](_0x2a9112,function(_0x3ad423,_0x444793,_0x196cc8){if(_0x3ad423!==0x0){logger[_0xac22('0x7')](util['format'](_0xac22('0x8'),_0x205b76,_0x2a9112,_0x3ad423,_0x196cc8));}else{logger[_0xac22('0x9')](util[_0xac22('0xa')](_0xac22('0xb'),_0x205b76,_0x2a9112,_0x444793));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index 956a9eb..89c2967 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf1=['name','request-promise','util','lodash','../../../../config/logger','exec','data1','toUpperCase','data2','number','data5','data6','render','error','GET','DELETE','POST','parse','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','statusCode'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xbaf1,0xd3));var _0x1baf=function(_0x1fd909,_0x3794fa){_0x1fd909=_0x1fd909-0x0;var _0x3e9f0a=_0xbaf1[_0x1fd909];return _0x3e9f0a;};'use strict';var rp=require(_0x1baf('0x0'));var util=require(_0x1baf('0x1'));var _=require(_0x1baf('0x2'));var Mustache=require('mustache');var logger=require(_0x1baf('0x3'))('trigger');exports[_0x1baf('0x4')]=function(_0x23b08f,_0xa02c6f){var _0x7278c2,_0x4df9dd;var _0x5e4677={'method':_0x23b08f[_0x1baf('0x5')][_0x1baf('0x6')](),'uri':Mustache['render'](_0x23b08f[_0x1baf('0x7')],_0xa02c6f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x23b08f['data5'])===_0x1baf('0x8')&&parseInt(_0x23b08f[_0x1baf('0x9')])>=0x1&&parseInt(_0x23b08f['data5'])<=0xa?parseInt(_0x23b08f[_0x1baf('0x9')])*0x3e8:0x5*0x3e8};try{_0x5e4677['headers']=_0x23b08f[_0x1baf('0xa')]?JSON['parse'](Mustache[_0x1baf('0xb')](_0x23b08f[_0x1baf('0xa')],_0xa02c6f)):{};}catch(_0x458c06){logger[_0x1baf('0xc')](_0x458c06['stack']);}switch(_0x23b08f[_0x1baf('0x5')]['toUpperCase']()){case _0x1baf('0xd'):case _0x1baf('0xe'):_0x7278c2=null;_0x5e4677['qs']=_0xa02c6f;break;case _0x1baf('0xf'):case'PUT':if(_0x23b08f['data7']){try{_0x7278c2=JSON[_0x1baf('0x10')](Mustache[_0x1baf('0xb')](_0x23b08f[_0x1baf('0x11')],_0xa02c6f));_0x5e4677[_0x1baf('0x12')]=_0x7278c2;}catch(_0x3d40e7){logger['error'](_0x3d40e7[_0x1baf('0x13')]);logger[_0x1baf('0xc')](_0x1baf('0x14'));}}else{_0x7278c2=_0xa02c6f;_0x5e4677[_0x1baf('0x12')]=_0x7278c2;}break;}logger[_0x1baf('0x15')](util[_0x1baf('0x16')](_0x1baf('0x17'),_0x23b08f[_0x1baf('0x5')],_0x23b08f[_0x1baf('0x7')],JSON[_0x1baf('0x18')](_0x5e4677)));rp(_0x5e4677)[_0x1baf('0x19')](function(_0xe8a282){_0x7278c2=!_['isNil'](_0x7278c2)?_0x1baf('0x1a')+_0x7278c2:'';_0x4df9dd=typeof _0xe8a282[_0x1baf('0x12')]===_0x1baf('0x1b')?JSON[_0x1baf('0x18')](_0xe8a282[_0x1baf('0x12')]):_0xe8a282['body'];logger[_0x1baf('0x15')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x23b08f['data1'],_0x23b08f[_0x1baf('0x7')],_0xe8a282[_0x1baf('0x1c')],_0x4df9dd));})['catch'](function(_0x4b2e22){logger['error'](util[_0x1baf('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x23b08f[_0x1baf('0x5')],_0x23b08f[_0x1baf('0x7')],_0x4b2e22[_0x1baf('0x1c')],_0x4b2e22[_0x1baf('0x1d')],_0x4b2e22['message']));});}; \ No newline at end of file +var _0xb9fe=['PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','trigger','exec','data1','toUpperCase','render','data5','number','headers','data6','parse','stack','GET','DELETE','POST'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xb9fe,0xeb));var _0xeb9f=function(_0x52f31e,_0x228812){_0x52f31e=_0x52f31e-0x0;var _0xccce8f=_0xb9fe[_0x52f31e];return _0xccce8f;};'use strict';var rp=require(_0xeb9f('0x0'));var util=require(_0xeb9f('0x1'));var _=require('lodash');var Mustache=require(_0xeb9f('0x2'));var logger=require('../../../../config/logger')(_0xeb9f('0x3'));exports[_0xeb9f('0x4')]=function(_0x11e0c9,_0x2d0d88){var _0xc4d0bc,_0x1c8bf8;var _0x5c4aa5={'method':_0x11e0c9[_0xeb9f('0x5')][_0xeb9f('0x6')](),'uri':Mustache[_0xeb9f('0x7')](_0x11e0c9['data2'],_0x2d0d88),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x11e0c9[_0xeb9f('0x8')])===_0xeb9f('0x9')&&parseInt(_0x11e0c9['data5'])>=0x1&&parseInt(_0x11e0c9[_0xeb9f('0x8')])<=0xa?parseInt(_0x11e0c9['data5'])*0x3e8:0x5*0x3e8};try{_0x5c4aa5[_0xeb9f('0xa')]=_0x11e0c9[_0xeb9f('0xb')]?JSON[_0xeb9f('0xc')](Mustache[_0xeb9f('0x7')](_0x11e0c9[_0xeb9f('0xb')],_0x2d0d88)):{};}catch(_0x59770b){logger['error'](_0x59770b[_0xeb9f('0xd')]);}switch(_0x11e0c9[_0xeb9f('0x5')][_0xeb9f('0x6')]()){case _0xeb9f('0xe'):case _0xeb9f('0xf'):_0xc4d0bc=null;_0x5c4aa5['qs']=_0x2d0d88;break;case _0xeb9f('0x10'):case _0xeb9f('0x11'):if(_0x11e0c9[_0xeb9f('0x12')]){try{_0xc4d0bc=JSON[_0xeb9f('0xc')](Mustache[_0xeb9f('0x7')](_0x11e0c9[_0xeb9f('0x12')],_0x2d0d88));_0x5c4aa5[_0xeb9f('0x13')]=_0xc4d0bc;}catch(_0x2a55b0){logger[_0xeb9f('0x14')](_0x2a55b0[_0xeb9f('0xd')]);logger['error'](_0xeb9f('0x15'));}}else{_0xc4d0bc=_0x2d0d88;_0x5c4aa5[_0xeb9f('0x13')]=_0xc4d0bc;}break;}logger[_0xeb9f('0x16')](util[_0xeb9f('0x17')](_0xeb9f('0x18'),_0x11e0c9[_0xeb9f('0x5')],_0x11e0c9[_0xeb9f('0x19')],JSON['stringify'](_0x5c4aa5)));rp(_0x5c4aa5)[_0xeb9f('0x1a')](function(_0x535f1c){_0xc4d0bc=!_[_0xeb9f('0x1b')](_0xc4d0bc)?_0xeb9f('0x1c')+_0xc4d0bc:'';_0x1c8bf8=typeof _0x535f1c[_0xeb9f('0x13')]===_0xeb9f('0x1d')?JSON['stringify'](_0x535f1c['body']):_0x535f1c[_0xeb9f('0x13')];logger['info'](util['format'](_0xeb9f('0x1e'),_0x11e0c9[_0xeb9f('0x5')],_0x11e0c9[_0xeb9f('0x19')],_0x535f1c[_0xeb9f('0x1f')],_0x1c8bf8));})[_0xeb9f('0x20')](function(_0x352ec3){logger[_0xeb9f('0x14')](util[_0xeb9f('0x17')](_0xeb9f('0x21'),_0x11e0c9[_0xeb9f('0x5')],_0x11e0c9[_0xeb9f('0x19')],_0x352ec3[_0xeb9f('0x1f')],_0x352ec3[_0xeb9f('0x22')],_0x352ec3[_0xeb9f('0x23')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index d22b509..f8ae144 100644 --- a/server/services/email/client.js +++ b/server/services/email/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b9e=['bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc','error','result','catch','exports','jayson/promise'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0x2b9e,0x125));var _0xe2b9=function(_0x452ada,_0x1be434){_0x452ada=_0x452ada-0x0;var _0x47d04c=_0x2b9e[_0x452ada];return _0x47d04c;};'use strict';var jayson=require(_0xe2b9('0x0'));var BPromise=require(_0xe2b9('0x1'));var logger=require(_0xe2b9('0x2'))(_0xe2b9('0x3'));var client=jayson[_0xe2b9('0x4')][_0xe2b9('0x5')]({'port':0x2329});client[_0xe2b9('0x6')]=function(_0x55c27b,_0x346386){return new BPromise(function(_0x5d0cfb,_0x577b15){return client['request'](_0x55c27b,_0x346386)[_0xe2b9('0x7')](function(_0x2e0dbc){logger[_0xe2b9('0x8')](_0xe2b9('0x9'),'routing',_0x55c27b,_0x346386,_0x2e0dbc);if(_0x2e0dbc['error']){logger[_0xe2b9('0xa')](_0xe2b9('0x9'),_0xe2b9('0x3'),_0x55c27b,_0x2e0dbc[_0xe2b9('0xa')]['message'],_0x346386);return _0x577b15(_0x2e0dbc[_0xe2b9('0xa')]['message']);}else{return _0x5d0cfb(_0x2e0dbc[_0xe2b9('0xb')]);}})[_0xe2b9('0xc')](function(_0x5550b1){logger[_0xe2b9('0xa')](_0xe2b9('0x9'),'routing',_0x55c27b,_0x5550b1,_0x346386);return _0x577b15(_0x5550b1);});});};module[_0xe2b9('0xd')]=client; \ No newline at end of file +var _0x3c9e=['error','message','result','catch','rpc','exports','bluebird','../../config/logger','http','request','debug','routing'];(function(_0x44b04c,_0x5786a3){var _0x1d2442=function(_0x5d6671){while(--_0x5d6671){_0x44b04c['push'](_0x44b04c['shift']());}};_0x1d2442(++_0x5786a3);}(_0x3c9e,0xc6));var _0xe3c9=function(_0x3852fd,_0x5b321f){_0x3852fd=_0x3852fd-0x0;var _0x186388=_0x3c9e[_0x3852fd];return _0x186388;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe3c9('0x0'));var logger=require(_0xe3c9('0x1'))('routing');var client=jayson['client'][_0xe3c9('0x2')]({'port':0x2329});client['Request']=function(_0x427e91,_0x296042){return new BPromise(function(_0x3cc05d,_0x267ffd){return client[_0xe3c9('0x3')](_0x427e91,_0x296042)['then'](function(_0x239eb6){logger[_0xe3c9('0x4')]('rpc',_0xe3c9('0x5'),_0x427e91,_0x296042,_0x239eb6);if(_0x239eb6[_0xe3c9('0x6')]){logger[_0xe3c9('0x6')]('rpc',_0xe3c9('0x5'),_0x427e91,_0x239eb6[_0xe3c9('0x6')][_0xe3c9('0x7')],_0x296042);return _0x267ffd(_0x239eb6[_0xe3c9('0x6')]['message']);}else{return _0x3cc05d(_0x239eb6[_0xe3c9('0x8')]);}})[_0xe3c9('0x9')](function(_0x447191){logger[_0xe3c9('0x6')](_0xe3c9('0xa'),'routing',_0x427e91,_0x447191,_0x296042);return _0x267ffd(_0x447191);});});};module[_0xe3c9('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1eda0a0..662e9a7 100644 --- a/server/services/email/index.js +++ b/server/services/email/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd51e=['error','./lib/email','./rpc/setting','../../config/logger','email','resolve','getMailAccounts','then','refresh','mailAccounts','getSettings','catch'];(function(_0x145b93,_0x4cf77a){var _0x596ac2=function(_0x2c418d){while(--_0x2c418d){_0x145b93['push'](_0x145b93['shift']());}};_0x596ac2(++_0x4cf77a);}(_0xd51e,0xd9));var _0xed51=function(_0x1ec548,_0x2908f7){_0x1ec548=_0x1ec548-0x0;var _0x2cebbf=_0xd51e[_0x1ec548];return _0x2cebbf;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0xed51('0x0'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xed51('0x1'));var logger=require(_0xed51('0x2'))(_0xed51('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xed51('0x4')]()['then'](mailAccount[_0xed51('0x5')]())[_0xed51('0x6')](realtime['initMailAccounts']())[_0xed51('0x6')](function(){email[_0xed51('0x7')](realtime[_0xed51('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xed51('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xed51('0x9')]();})[_0xed51('0x6')](function(_0x3e8836){return setInterval(initRealtime,_0x3e8836['loginMailFrequency']*0x3e8);})[_0xed51('0xa')](function(_0x239f9b){logger[_0xed51('0xb')]('Email\x20service\x20initialization',_0x239f9b);});}main(); \ No newline at end of file +var _0x2672=['error','Email\x20service\x20initialization','./server','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','then','getMailAccounts','initMailAccounts','listen','loginMailFrequency'];(function(_0x619193,_0x46011d){var _0x4855d9=function(_0x396c08){while(--_0x396c08){_0x619193['push'](_0x619193['shift']());}};_0x4855d9(++_0x46011d);}(_0x2672,0x9e));var _0x2267=function(_0x4b8fee,_0x13f97b){_0x4b8fee=_0x4b8fee-0x0;var _0x56828b=_0x2672[_0x4b8fee];return _0x56828b;};'use strict';var server=require(_0x2267('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x2267('0x1'));var mailAccount=require(_0x2267('0x2'));var setting=require(_0x2267('0x3'));var logger=require(_0x2267('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x2267('0x5')]()[_0x2267('0x6')](mailAccount[_0x2267('0x7')]())[_0x2267('0x6')](realtime[_0x2267('0x8')]())[_0x2267('0x6')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x2267('0x9')](realtime,email)[_0x2267('0x6')](function(){return initRealtime();})[_0x2267('0x6')](function(){return setting['getSettings']();})['then'](function(_0x3f6518){return setInterval(initRealtime,_0x3f6518[_0x2267('0xa')]*0x3e8);})['catch'](function(_0x590c75){logger[_0x2267('0xb')](_0x2267('0xc'),_0x590c75);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 7d9a21e..83dba4d 100644 --- a/server/services/email/lib/email.js +++ b/server/services/email/lib/email.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9710=['firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','error','lastSync','handleImapError','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','smtp','prototype','emit','name','status','Imap','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','imapAccounts','box','bind','handleImapEmail','end','handleImapEnd','messageStatus','connected','total','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x9710,0x1f4));var _0x0971=function(_0x431b62,_0x535f19){_0x431b62=_0x431b62-0x0;var _0x2db63f=_0x9710[_0x431b62];return _0x2db63f;};'use strict';var _=require(_0x0971('0x0'));var moment=require(_0x0971('0x1'));var BPromise=require(_0x0971('0x2'));var md5=require(_0x0971('0x3'));var Redis=require(_0x0971('0x4'));var config=require(_0x0971('0x5'));var logger=require(_0x0971('0x6'))(_0x0971('0x7'));config[_0x0971('0x8')]=_[_0x0971('0x9')](config[_0x0971('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0971('0x8')]));var EmailImap=require(_0x0971('0xa'));var EmailSmtp=require(_0x0971('0xb'));var mailAccount=require(_0x0971('0xc'));var md5Accounts={};function EmailChannel(_0x869dd1){logger[_0x0971('0xd')]('start\x20email\x20channel');this[_0x0971('0xe')]=_0x869dd1['mailAccounts'];this['imapAccounts']={};this[_0x0971('0xf')]=new EmailSmtp();}EmailChannel[_0x0971('0x10')][_0x0971('0x11')]=function(_0x59a02f){var _0x4c5b39=this[_0x0971('0xe')][_0x59a02f];var _0x3976c6={'id':_0x4c5b39['id'],'name':_0x4c5b39[_0x0971('0x12')],'key':_0x4c5b39['key'],'active':_0x4c5b39['active'],'Imap':{'status':_0x4c5b39['Imap'][_0x0971('0x13')],'messageStatus':_0x4c5b39[_0x0971('0x14')]['messageStatus'],'total':_0x4c5b39['Imap']['total']}};if(_[_0x0971('0x15')](md5Accounts[_0x59a02f])){md5Accounts[_0x59a02f]={};}var _0x2bd437=md5(JSON[_0x0971('0x16')](_0x3976c6));if(md5Accounts[_0x59a02f]['md5']!==_0x2bd437){md5Accounts[_0x59a02f][_0x0971('0x3')]=_0x2bd437;io[_0x0971('0x11')](_0x0971('0x17'),_0x3976c6);}};EmailChannel[_0x0971('0x10')][_0x0971('0x18')]=function(_0x8bee7f){for(var _0x4bcbcf in _0x8bee7f){if(_0x8bee7f[_0x0971('0x19')](_0x4bcbcf)){if(_0x8bee7f[_0x4bcbcf][_0x0971('0x14')]&&_0x8bee7f[_0x4bcbcf]['active']){var _0x245a9d=_0x8bee7f[_0x4bcbcf][_0x0971('0x14')];if(!_0x245a9d[_0x0971('0x1a')]&&_0x8bee7f[_0x4bcbcf]['provider']!==_0x0971('0x1b'))_0x245a9d[_0x0971('0x1a')]=_0x8bee7f[_0x4bcbcf][_0x0971('0x1c')];if(!this[_0x0971('0x1d')][_0x0971('0x19')](_0x245a9d['id'])){this[_0x0971('0x1d')][_0x245a9d['id']]=new EmailImap(_0x245a9d,_0x8bee7f[_0x4bcbcf]['email']);this['imapAccounts'][_0x245a9d['id']]['on'](_0x0971('0x1e'),this['handleImapBox'][_0x0971('0x1f')](this,_0x4bcbcf));this['imapAccounts'][_0x245a9d['id']]['on'](_0x0971('0x7'),this[_0x0971('0x20')][_0x0971('0x1f')](this,_0x4bcbcf));this[_0x0971('0x1d')][_0x245a9d['id']]['on'](_0x0971('0x21'),this[_0x0971('0x22')][_0x0971('0x1f')](this,_0x4bcbcf));this[_0x0971('0x1d')][_0x245a9d['id']]['on']('error',this['handleImapError'][_0x0971('0x1f')](this,_0x4bcbcf));}}else{if(_[_0x0971('0x15')](this[_0x0971('0xe')][_0x4bcbcf]['Imap'])){this['mailAccounts'][_0x4bcbcf]['Imap']={};}this['mailAccounts'][_0x4bcbcf][_0x0971('0x14')]['status']='disabled';this[_0x0971('0xe')][_0x4bcbcf][_0x0971('0x14')][_0x0971('0x23')]='';this[_0x0971('0x11')](_0x4bcbcf);}}}};EmailChannel[_0x0971('0x10')]['handleImapBox']=function(_0x651968,_0x26e16d){if(this[_0x0971('0xe')][_0x651968]){this['mailAccounts'][_0x651968][_0x0971('0x14')][_0x0971('0x13')]=_0x0971('0x24');this[_0x0971('0xe')][_0x651968]['Imap'][_0x0971('0x23')]=_0x26e16d['name'];if(_0x26e16d['messages']){this[_0x0971('0xe')][_0x651968][_0x0971('0x14')][_0x0971('0x25')]=_0x26e16d[_0x0971('0x26')][_0x0971('0x25')];}return this[_0x0971('0x11')](_0x651968);}};EmailChannel[_0x0971('0x10')][_0x0971('0x20')]=function(_0x4a301c,_0x5880e5){logger[_0x0971('0xd')](_0x0971('0x27'),_0x5880e5[_0x0971('0x28')],_0x5880e5[_0x0971('0x29')],_0x5880e5[_0x0971('0x2a')],_0x4a301c);if(this[_0x0971('0xe')][_0x4a301c]){return mailAccount['notify'](_0x4a301c,_0x5880e5)[_0x0971('0x2b')](function(_0x5ad002){if(_0x5ad002){logger['info'](_0x0971('0x2c'));}})[_0x0971('0x2d')](function(_0x308b2c){logger[_0x0971('0x2e')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x0971('0x16')](_0x308b2c));});}};EmailChannel[_0x0971('0x10')]['handleImapEnd']=function(_0x4247ad){if(this['mailAccounts'][_0x4247ad]&&this['mailAccounts'][_0x4247ad]['Imap']){if(this[_0x0971('0x1d')][this[_0x0971('0xe')][_0x4247ad][_0x0971('0x14')]['id']]){delete this[_0x0971('0x1d')][this[_0x0971('0xe')][_0x4247ad][_0x0971('0x14')]['id']];}this[_0x0971('0xe')][_0x4247ad][_0x0971('0x14')][_0x0971('0x2f')]=moment();this[_0x0971('0x11')](_0x4247ad);}};EmailChannel['prototype'][_0x0971('0x30')]=function(_0x56717c,_0x113300){if(this[_0x0971('0xe')][_0x56717c]){this[_0x0971('0xe')][_0x56717c][_0x0971('0x14')][_0x0971('0x13')]=_0x0971('0x2e');this[_0x0971('0xe')][_0x56717c][_0x0971('0x14')][_0x0971('0x23')]=_0x113300;return this['emit'](_0x56717c);}};EmailChannel[_0x0971('0x10')]['sendMail']=function(_0x4fa057,_0x9a1085){return this[_0x0971('0xf')][_0x0971('0x31')](_0x4fa057,_0x9a1085);};EmailChannel[_0x0971('0x10')][_0x0971('0x32')]=function(_0x82d492){var _0x15be39=this;if(this[_0x0971('0xe')][_0x82d492['id']]){if(_['isNil'](this[_0x0971('0xe')][_0x82d492['id']][_0x0971('0x33')])){this[_0x0971('0xe')][_0x82d492['id']][_0x0971('0x33')]={};}this['mailAccounts'][_0x82d492['id']]['Smtp'][_0x0971('0x2f')]=moment();return new BPromise(function(_0xd7cd64,_0x3ca0fc){return _0x15be39[_0x0971('0xf')]['verify'](_0x82d492)['then'](function(_0x172488){_0x15be39[_0x0971('0xe')][_0x82d492['id']][_0x0971('0x33')][_0x0971('0x13')]='verified';_0x15be39['mailAccounts'][_0x82d492['id']][_0x0971('0x33')][_0x0971('0x23')]='';_0x15be39['emit'](_0x82d492['id']);_0xd7cd64(_0x172488);})[_0x0971('0x2d')](function(_0x5ae598){_0x15be39[_0x0971('0xe')][_0x82d492['id']][_0x0971('0x33')]['status']='error';_0x15be39[_0x0971('0xe')][_0x82d492['id']]['Smtp'][_0x0971('0x23')]=_0x5ae598;_0x15be39[_0x0971('0x11')](_0x82d492['id']);_0x3ca0fc(_0x5ae598);});});}return this[_0x0971('0xf')][_0x0971('0x34')](_0x82d492);};module[_0x0971('0x35')]=EmailChannel; \ No newline at end of file +var _0xc57e=['bind','end','handleImapEnd','error','handleImapError','disabled','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','then','verified','verify','exports','lodash','bluebird','md5','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','emit','name','key','status','messageStatus','Imap','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','active','service','provider','custom','box','handleImapBox'];(function(_0x40c8cc,_0x3b3c41){var _0x58f8f4=function(_0x512062){while(--_0x512062){_0x40c8cc['push'](_0x40c8cc['shift']());}};_0x58f8f4(++_0x3b3c41);}(_0xc57e,0xc5));var _0xec57=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc57e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xec57('0x0'));var moment=require('moment');var BPromise=require(_0xec57('0x1'));var md5=require(_0xec57('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xec57('0x3'))(_0xec57('0x4'));config['redis']=_[_0xec57('0x5')](config[_0xec57('0x6')],{'host':_0xec57('0x7'),'port':0x18eb});var io=require(_0xec57('0x8'))(new Redis(config[_0xec57('0x6')]));var EmailImap=require(_0xec57('0x9'));var EmailSmtp=require(_0xec57('0xa'));var mailAccount=require(_0xec57('0xb'));var md5Accounts={};function EmailChannel(_0x5acd28){logger[_0xec57('0xc')](_0xec57('0xd'));this[_0xec57('0xe')]=_0x5acd28[_0xec57('0xe')];this[_0xec57('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0xec57('0x10')]=function(_0x47c57d){var _0x3a65d3=this[_0xec57('0xe')][_0x47c57d];var _0x5efd40={'id':_0x3a65d3['id'],'name':_0x3a65d3[_0xec57('0x11')],'key':_0x3a65d3[_0xec57('0x12')],'active':_0x3a65d3['active'],'Imap':{'status':_0x3a65d3['Imap'][_0xec57('0x13')],'messageStatus':_0x3a65d3['Imap'][_0xec57('0x14')],'total':_0x3a65d3[_0xec57('0x15')][_0xec57('0x16')]}};if(_[_0xec57('0x17')](md5Accounts[_0x47c57d])){md5Accounts[_0x47c57d]={};}var _0x2b7e98=md5(JSON[_0xec57('0x18')](_0x5efd40));if(md5Accounts[_0x47c57d]['md5']!==_0x2b7e98){md5Accounts[_0x47c57d][_0xec57('0x2')]=_0x2b7e98;io[_0xec57('0x10')](_0xec57('0x19'),_0x5efd40);}};EmailChannel[_0xec57('0x1a')][_0xec57('0x1b')]=function(_0x3e799e){for(var _0x24bca5 in _0x3e799e){if(_0x3e799e[_0xec57('0x1c')](_0x24bca5)){if(_0x3e799e[_0x24bca5][_0xec57('0x15')]&&_0x3e799e[_0x24bca5][_0xec57('0x1d')]){var _0xd4b72a=_0x3e799e[_0x24bca5][_0xec57('0x15')];if(!_0xd4b72a[_0xec57('0x1e')]&&_0x3e799e[_0x24bca5][_0xec57('0x1f')]!==_0xec57('0x20'))_0xd4b72a[_0xec57('0x1e')]=_0x3e799e[_0x24bca5]['provider'];if(!this[_0xec57('0xf')][_0xec57('0x1c')](_0xd4b72a['id'])){this['imapAccounts'][_0xd4b72a['id']]=new EmailImap(_0xd4b72a,_0x3e799e[_0x24bca5][_0xec57('0x4')]);this[_0xec57('0xf')][_0xd4b72a['id']]['on'](_0xec57('0x21'),this[_0xec57('0x22')][_0xec57('0x23')](this,_0x24bca5));this[_0xec57('0xf')][_0xd4b72a['id']]['on'](_0xec57('0x4'),this['handleImapEmail'][_0xec57('0x23')](this,_0x24bca5));this['imapAccounts'][_0xd4b72a['id']]['on'](_0xec57('0x24'),this[_0xec57('0x25')]['bind'](this,_0x24bca5));this['imapAccounts'][_0xd4b72a['id']]['on'](_0xec57('0x26'),this[_0xec57('0x27')]['bind'](this,_0x24bca5));}}else{if(_[_0xec57('0x17')](this[_0xec57('0xe')][_0x24bca5][_0xec57('0x15')])){this['mailAccounts'][_0x24bca5]['Imap']={};}this['mailAccounts'][_0x24bca5][_0xec57('0x15')][_0xec57('0x13')]=_0xec57('0x28');this[_0xec57('0xe')][_0x24bca5][_0xec57('0x15')][_0xec57('0x14')]='';this['emit'](_0x24bca5);}}}};EmailChannel['prototype'][_0xec57('0x22')]=function(_0x5bcc09,_0x4fd209){if(this[_0xec57('0xe')][_0x5bcc09]){this[_0xec57('0xe')][_0x5bcc09][_0xec57('0x15')][_0xec57('0x13')]=_0xec57('0x29');this[_0xec57('0xe')][_0x5bcc09][_0xec57('0x15')][_0xec57('0x14')]=_0x4fd209[_0xec57('0x11')];if(_0x4fd209[_0xec57('0x2a')]){this[_0xec57('0xe')][_0x5bcc09]['Imap'][_0xec57('0x16')]=_0x4fd209[_0xec57('0x2a')][_0xec57('0x16')];}return this[_0xec57('0x10')](_0x5bcc09);}};EmailChannel['prototype'][_0xec57('0x2b')]=function(_0x26fe11,_0x59e6a2){logger['info'](_0xec57('0x2c'),_0x59e6a2['firstName'],_0x59e6a2[_0xec57('0x2d')],_0x59e6a2['from'],_0x26fe11);if(this[_0xec57('0xe')][_0x26fe11]){return mailAccount['notify'](_0x26fe11,_0x59e6a2)['then'](function(_0x4b9ece){if(_0x4b9ece){logger[_0xec57('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0xec57('0x2e')](function(_0x4a1a1c){logger[_0xec57('0x26')](_0xec57('0x2f'),JSON[_0xec57('0x18')](_0x4a1a1c));});}};EmailChannel[_0xec57('0x1a')]['handleImapEnd']=function(_0x2b4b37){if(this[_0xec57('0xe')][_0x2b4b37]&&this[_0xec57('0xe')][_0x2b4b37]['Imap']){if(this[_0xec57('0xf')][this[_0xec57('0xe')][_0x2b4b37][_0xec57('0x15')]['id']]){delete this[_0xec57('0xf')][this[_0xec57('0xe')][_0x2b4b37][_0xec57('0x15')]['id']];}this[_0xec57('0xe')][_0x2b4b37]['Imap'][_0xec57('0x30')]=moment();this[_0xec57('0x10')](_0x2b4b37);}};EmailChannel[_0xec57('0x1a')][_0xec57('0x27')]=function(_0xa3a6d1,_0x2cea5e){if(this['mailAccounts'][_0xa3a6d1]){this[_0xec57('0xe')][_0xa3a6d1][_0xec57('0x15')][_0xec57('0x13')]='error';this[_0xec57('0xe')][_0xa3a6d1]['Imap'][_0xec57('0x14')]=_0x2cea5e;return this[_0xec57('0x10')](_0xa3a6d1);}};EmailChannel[_0xec57('0x1a')][_0xec57('0x31')]=function(_0x1f64fa,_0x30bca1){return this[_0xec57('0x32')][_0xec57('0x33')](_0x1f64fa,_0x30bca1);};EmailChannel[_0xec57('0x1a')][_0xec57('0x34')]=function(_0x7a7007){var _0x45e568=this;if(this[_0xec57('0xe')][_0x7a7007['id']]){if(_[_0xec57('0x17')](this[_0xec57('0xe')][_0x7a7007['id']][_0xec57('0x35')])){this['mailAccounts'][_0x7a7007['id']][_0xec57('0x35')]={};}this['mailAccounts'][_0x7a7007['id']]['Smtp'][_0xec57('0x30')]=moment();return new BPromise(function(_0xe5ff31,_0x38a1fd){return _0x45e568['smtp']['verify'](_0x7a7007)[_0xec57('0x36')](function(_0x2bd0c5){_0x45e568['mailAccounts'][_0x7a7007['id']]['Smtp']['status']=_0xec57('0x37');_0x45e568[_0xec57('0xe')][_0x7a7007['id']][_0xec57('0x35')][_0xec57('0x14')]='';_0x45e568[_0xec57('0x10')](_0x7a7007['id']);_0xe5ff31(_0x2bd0c5);})[_0xec57('0x2e')](function(_0x289e7d){_0x45e568[_0xec57('0xe')][_0x7a7007['id']][_0xec57('0x35')][_0xec57('0x13')]=_0xec57('0x26');_0x45e568[_0xec57('0xe')][_0x7a7007['id']][_0xec57('0x35')][_0xec57('0x14')]=_0x289e7d;_0x45e568[_0xec57('0x10')](_0x7a7007['id']);_0x38a1fd(_0x289e7d);});});}return this[_0xec57('0x32')][_0xec57('0x38')](_0x7a7007);};module[_0xec57('0x39')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 9fbce08..6660f2a 100644 --- a/server/services/email/lib/imap.js +++ b/server/services/email/lib/imap.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3d6=['ready','bind','once','end','error','handleError','connect','inherits','getAccount','connTimeout','authTimeout','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','user','password','host','port','tls','autotls','required','prototype','handleReady','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageEnd','handleSimpleParser','parser','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','events','EventEmitter','./utils','../../../config/logger','email','mailbox','imap','account'];(function(_0x379109,_0x53e490){var _0xa78d6d=function(_0x554a53){while(--_0x554a53){_0x379109['push'](_0x379109['shift']());}};_0xa78d6d(++_0x53e490);}(_0xb3d6,0xa8));var _0x6b3d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb3d6[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x6b3d('0x0'));var util=require('util');var Imap=require('imap');var simpleParser=require('mailparser')['simpleParser'];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x6b3d('0x1'))[_0x6b3d('0x2')];var utils=require(_0x6b3d('0x3'));var logger=require(_0x6b3d('0x4'))(_0x6b3d('0x5'));function EmailImap(_0xf94659,_0x28f54c){this[_0x6b3d('0x6')]=_0xf94659[_0x6b3d('0x6')];this['account']=this['getAccount'](_0xf94659,_0x28f54c);this[_0x6b3d('0x7')]=new Imap(this[_0x6b3d('0x8')]);this[_0x6b3d('0x7')]['once'](_0x6b3d('0x9'),this['handleReady'][_0x6b3d('0xa')](this));this[_0x6b3d('0x7')][_0x6b3d('0xb')](_0x6b3d('0xc'),this['handleEnd'][_0x6b3d('0xa')](this));this[_0x6b3d('0x7')]['on'](_0x6b3d('0xd'),this[_0x6b3d('0xe')]['bind'](this));this[_0x6b3d('0x7')][_0x6b3d('0xf')]();}util[_0x6b3d('0x10')](EmailImap,EventEmitter);EmailImap['prototype'][_0x6b3d('0x11')]=function(_0x478720,_0xfa9f8a){var _0x205f25={'connTimeout':_0x478720[_0x6b3d('0x12')]?_0x478720[_0x6b3d('0x12')]*0x3e8:0x2710,'authTimeout':_0x478720[_0x6b3d('0x13')]?_0x478720['authTimeout']*0x3e8:0x1388};if(_0x478720['service']){_0x205f25['user']=_0x478720['user'];if(_0x478720[_0x6b3d('0x14')]){_0x205f25['xoauth2']=utils[_0x6b3d('0x15')](_0x478720[_0x6b3d('0x16')][_0x6b3d('0x17')],_0x478720[_0x6b3d('0x18')]);}else{_0x205f25[_0x6b3d('0x19')]=_0x478720[_0x6b3d('0x19')];}}else{if(_0x478720['authentication']){_0x205f25[_0x6b3d('0x18')]=_0x478720[_0x6b3d('0x18')];_0x205f25['password']=_0x478720['password'];}}_0x205f25['email']=_0xfa9f8a||_0x478720[_0x6b3d('0x18')]||'anonymous@xcally.com';_0x205f25[_0x6b3d('0x1a')]=_0x478720['host'];_0x205f25[_0x6b3d('0x1b')]=_0x478720['port']||0x3e1;if(_0x478720[_0x6b3d('0x1c')]){_0x205f25[_0x6b3d('0x1c')]=!![];}else{_0x205f25[_0x6b3d('0x1c')]=![];_0x205f25[_0x6b3d('0x1d')]=_0x6b3d('0x1e');}return _0x205f25;};EmailImap[_0x6b3d('0x1f')][_0x6b3d('0x20')]=function(){this[_0x6b3d('0x7')][_0x6b3d('0x21')](this['mailbox'],![],this['handleOpenBox'][_0x6b3d('0xa')](this));};EmailImap[_0x6b3d('0x1f')][_0x6b3d('0x22')]=function(_0x9fbee0,_0x207279){if(_0x9fbee0){this[_0x6b3d('0xe')](_0x9fbee0,!![]);}else{this[_0x6b3d('0x23')](_0x6b3d('0x24'),_0x207279);this[_0x6b3d('0x25')]();}};EmailImap[_0x6b3d('0x1f')][_0x6b3d('0x26')]=function(_0x14d8a3){if(_0x14d8a3){this[_0x6b3d('0xe')](_0x14d8a3,!![]);}else{this['imap'][_0x6b3d('0xc')]();}};EmailImap[_0x6b3d('0x1f')]['readUnseen']=function(){this[_0x6b3d('0x7')][_0x6b3d('0x27')]([_0x6b3d('0x28')],this[_0x6b3d('0x29')][_0x6b3d('0xa')](this));};EmailImap['prototype'][_0x6b3d('0x29')]=function(_0x1c2fa3,_0x57d65e){if(_0x1c2fa3){this[_0x6b3d('0xe')](_0x1c2fa3,!![]);}else{if(_0x57d65e[_0x6b3d('0x2a')]){try{var _0x36710b=this[_0x6b3d('0x7')][_0x6b3d('0x2b')](_0x57d65e,{'bodies':'','markSeen':!![]});_0x36710b['on']('message',this[_0x6b3d('0x2c')][_0x6b3d('0xa')](this));_0x36710b[_0x6b3d('0xb')](_0x6b3d('0xd'),this[_0x6b3d('0x2d')][_0x6b3d('0xa')](this));_0x36710b['once']('end',this[_0x6b3d('0x2e')][_0x6b3d('0xa')](this));}catch(_0x167960){logger[_0x6b3d('0xd')](_0x167960);}}else{this[_0x6b3d('0x7')][_0x6b3d('0x2f')](!![],this[_0x6b3d('0x26')][_0x6b3d('0xa')](this));}}};EmailImap['prototype'][_0x6b3d('0x2c')]=function(_0x13f872){_0x13f872['on'](_0x6b3d('0x30'),this[_0x6b3d('0x31')]['bind'](this));_0x13f872[_0x6b3d('0xb')]('attributes',this['handleMessageAttributes'][_0x6b3d('0xa')](this));_0x13f872[_0x6b3d('0xb')](_0x6b3d('0xc'),this[_0x6b3d('0x32')][_0x6b3d('0xa')](this));};EmailImap[_0x6b3d('0x1f')][_0x6b3d('0x31')]=function(_0x19fb3e){simpleParser(_0x19fb3e,{'Iconv':Iconv},this[_0x6b3d('0x33')][_0x6b3d('0xa')](this));};EmailImap[_0x6b3d('0x1f')]['handleMessageAttributes']=function(){};EmailImap[_0x6b3d('0x1f')][_0x6b3d('0x32')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x580eb6,_0x26224e){if(_0x580eb6){logger[_0x6b3d('0xd')](_0x580eb6);}else{var _0x457d13=this;utils[_0x6b3d('0x34')](this['account'],_0x26224e,function(_0x72b10f){_0x457d13['emit'](_0x6b3d('0x5'),_0x72b10f);});}};EmailImap['prototype'][_0x6b3d('0x2e')]=function(){this[_0x6b3d('0x7')]['closeBox'](!![],this[_0x6b3d('0x26')][_0x6b3d('0xa')](this));};EmailImap['prototype']['handleFetchError']=function(_0x548b10){this[_0x6b3d('0xe')](_0x548b10);this['imap'][_0x6b3d('0x2f')](!![],this[_0x6b3d('0x26')][_0x6b3d('0xa')](this));};EmailImap[_0x6b3d('0x1f')][_0x6b3d('0x35')]=function(){this[_0x6b3d('0x23')](_0x6b3d('0xc'));};EmailImap['prototype'][_0x6b3d('0xe')]=function(_0x525ce8,_0x4f87bc){logger[_0x6b3d('0xd')](_0x6b3d('0xe'),this[_0x6b3d('0x8')][_0x6b3d('0x5')],JSON[_0x6b3d('0x36')](_0x525ce8));var _0x389ee3='';if(_0x525ce8){if(_0x525ce8[_0x6b3d('0x37')]){_0x389ee3=_0x525ce8[_0x6b3d('0x37')];}else{for(var _0x104d47 in _0x525ce8){if(_0x525ce8[_0x6b3d('0x38')](_0x104d47)){_0x389ee3+=_[_0x6b3d('0x39')](_0x104d47)+':\x20'+_0x525ce8[_0x104d47]+'\x0a';}}}}if(_0x4f87bc){this[_0x6b3d('0x7')]['end']();}else{this[_0x6b3d('0x23')]('error',_0x389ee3);this[_0x6b3d('0x23')](_0x6b3d('0xc'));}};module[_0x6b3d('0x3a')]=EmailImap; \ No newline at end of file +var _0xc84f=['anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','handleFetchError','handleEnd','textCode','hasOwnProperty','exports','util','mailparser','simpleParser','iconv','Iconv','./utils','../../../config/logger','email','account','getAccount','once','ready','handleReady','imap','bind','error','connect','inherits','prototype','connTimeout','service','user','generateXOAuth2Token','CloudProvider','data5','password','authentication'];(function(_0x1edb23,_0x537a2e){var _0x1df779=function(_0x400ae5){while(--_0x400ae5){_0x1edb23['push'](_0x1edb23['shift']());}};_0x1df779(++_0x537a2e);}(_0xc84f,0x197));var _0xfc84=function(_0xe34cb7,_0x1433d5){_0xe34cb7=_0xe34cb7-0x0;var _0x4acd3b=_0xc84f[_0xe34cb7];return _0x4acd3b;};'use strict';var _=require('lodash');var util=require(_0xfc84('0x0'));var Imap=require('imap');var simpleParser=require(_0xfc84('0x1'))[_0xfc84('0x2')];var Iconv=require(_0xfc84('0x3'))[_0xfc84('0x4')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0xfc84('0x5'));var logger=require(_0xfc84('0x6'))(_0xfc84('0x7'));function EmailImap(_0x35b16a,_0x5d2ae7){this['mailbox']=_0x35b16a['mailbox'];this[_0xfc84('0x8')]=this[_0xfc84('0x9')](_0x35b16a,_0x5d2ae7);this['imap']=new Imap(this[_0xfc84('0x8')]);this['imap'][_0xfc84('0xa')](_0xfc84('0xb'),this[_0xfc84('0xc')]['bind'](this));this[_0xfc84('0xd')][_0xfc84('0xa')]('end',this['handleEnd'][_0xfc84('0xe')](this));this[_0xfc84('0xd')]['on'](_0xfc84('0xf'),this['handleError'][_0xfc84('0xe')](this));this[_0xfc84('0xd')][_0xfc84('0x10')]();}util[_0xfc84('0x11')](EmailImap,EventEmitter);EmailImap[_0xfc84('0x12')][_0xfc84('0x9')]=function(_0x3b56e7,_0x4918ee){var _0x2eaf16={'connTimeout':_0x3b56e7[_0xfc84('0x13')]?_0x3b56e7['connTimeout']*0x3e8:0x2710,'authTimeout':_0x3b56e7['authTimeout']?_0x3b56e7['authTimeout']*0x3e8:0x1388};if(_0x3b56e7[_0xfc84('0x14')]){_0x2eaf16[_0xfc84('0x15')]=_0x3b56e7[_0xfc84('0x15')];if(_0x3b56e7['modernAuthentication']){_0x2eaf16['xoauth2']=utils[_0xfc84('0x16')](_0x3b56e7[_0xfc84('0x17')][_0xfc84('0x18')],_0x3b56e7[_0xfc84('0x15')]);}else{_0x2eaf16[_0xfc84('0x19')]=_0x3b56e7['password'];}}else{if(_0x3b56e7[_0xfc84('0x1a')]){_0x2eaf16[_0xfc84('0x15')]=_0x3b56e7[_0xfc84('0x15')];_0x2eaf16[_0xfc84('0x19')]=_0x3b56e7[_0xfc84('0x19')];}}_0x2eaf16['email']=_0x4918ee||_0x3b56e7[_0xfc84('0x15')]||_0xfc84('0x1b');_0x2eaf16[_0xfc84('0x1c')]=_0x3b56e7['host'];_0x2eaf16['port']=_0x3b56e7[_0xfc84('0x1d')]||0x3e1;if(_0x3b56e7['tls']){_0x2eaf16[_0xfc84('0x1e')]=!![];}else{_0x2eaf16[_0xfc84('0x1e')]=![];_0x2eaf16[_0xfc84('0x1f')]=_0xfc84('0x20');}return _0x2eaf16;};EmailImap['prototype'][_0xfc84('0xc')]=function(){this[_0xfc84('0xd')][_0xfc84('0x21')](this['mailbox'],![],this[_0xfc84('0x22')]['bind'](this));};EmailImap[_0xfc84('0x12')][_0xfc84('0x22')]=function(_0x5f3251,_0x5393e9){if(_0x5f3251){this[_0xfc84('0x23')](_0x5f3251,!![]);}else{this[_0xfc84('0x24')](_0xfc84('0x25'),_0x5393e9);this[_0xfc84('0x26')]();}};EmailImap[_0xfc84('0x12')][_0xfc84('0x27')]=function(_0x32b3dd){if(_0x32b3dd){this['handleError'](_0x32b3dd,!![]);}else{this['imap'][_0xfc84('0x28')]();}};EmailImap[_0xfc84('0x12')]['readUnseen']=function(){this[_0xfc84('0xd')][_0xfc84('0x29')]([_0xfc84('0x2a')],this[_0xfc84('0x2b')][_0xfc84('0xe')](this));};EmailImap[_0xfc84('0x12')][_0xfc84('0x2b')]=function(_0x203de5,_0x4e56ba){if(_0x203de5){this['handleError'](_0x203de5,!![]);}else{if(_0x4e56ba[_0xfc84('0x2c')]){try{var _0xce185a=this[_0xfc84('0xd')][_0xfc84('0x2d')](_0x4e56ba,{'bodies':'','markSeen':!![]});_0xce185a['on'](_0xfc84('0x2e'),this[_0xfc84('0x2f')][_0xfc84('0xe')](this));_0xce185a[_0xfc84('0xa')](_0xfc84('0xf'),this['handleFetchError'][_0xfc84('0xe')](this));_0xce185a[_0xfc84('0xa')](_0xfc84('0x28'),this[_0xfc84('0x30')][_0xfc84('0xe')](this));}catch(_0x2da0da){logger[_0xfc84('0xf')](_0x2da0da);}}else{this[_0xfc84('0xd')][_0xfc84('0x31')](!![],this[_0xfc84('0x27')]['bind'](this));}}};EmailImap[_0xfc84('0x12')][_0xfc84('0x2f')]=function(_0x277464){_0x277464['on'](_0xfc84('0x32'),this[_0xfc84('0x33')][_0xfc84('0xe')](this));_0x277464['once'](_0xfc84('0x34'),this['handleMessageAttributes'][_0xfc84('0xe')](this));_0x277464['once'](_0xfc84('0x28'),this[_0xfc84('0x35')][_0xfc84('0xe')](this));};EmailImap[_0xfc84('0x12')]['handleMessageBody']=function(_0x137ccd){simpleParser(_0x137ccd,{'Iconv':Iconv},this[_0xfc84('0x36')]['bind'](this));};EmailImap[_0xfc84('0x12')][_0xfc84('0x37')]=function(){};EmailImap[_0xfc84('0x12')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0xfc84('0x36')]=function(_0x2caf0d,_0xfe0a64){if(_0x2caf0d){logger[_0xfc84('0xf')](_0x2caf0d);}else{var _0x5636be=this;utils[_0xfc84('0x38')](this[_0xfc84('0x8')],_0xfe0a64,function(_0x2af70f){_0x5636be[_0xfc84('0x24')]('email',_0x2af70f);});}};EmailImap[_0xfc84('0x12')][_0xfc84('0x30')]=function(){this[_0xfc84('0xd')][_0xfc84('0x31')](!![],this['handleCloseBox'][_0xfc84('0xe')](this));};EmailImap[_0xfc84('0x12')][_0xfc84('0x39')]=function(_0x3d0996){this['handleError'](_0x3d0996);this[_0xfc84('0xd')][_0xfc84('0x31')](!![],this[_0xfc84('0x27')][_0xfc84('0xe')](this));};EmailImap[_0xfc84('0x12')][_0xfc84('0x3a')]=function(){this[_0xfc84('0x24')](_0xfc84('0x28'));};EmailImap[_0xfc84('0x12')][_0xfc84('0x23')]=function(_0x3b7fe3,_0x4e415e){logger[_0xfc84('0xf')](_0xfc84('0x23'),this[_0xfc84('0x8')][_0xfc84('0x7')],JSON['stringify'](_0x3b7fe3));var _0x3d345e='';if(_0x3b7fe3){if(_0x3b7fe3[_0xfc84('0x3b')]){_0x3d345e=_0x3b7fe3[_0xfc84('0x3b')];}else{for(var _0x4cbc16 in _0x3b7fe3){if(_0x3b7fe3[_0xfc84('0x3c')](_0x4cbc16)){_0x3d345e+=_['upperFirst'](_0x4cbc16)+':\x20'+_0x3b7fe3[_0x4cbc16]+'\x0a';}}}}if(_0x4e415e){this['imap']['end']();}else{this['emit'](_0xfc84('0xf'),_0x3d345e);this[_0xfc84('0x24')](_0xfc84('0x28'));}};module[_0xfc84('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 6723e71..b4c4ef4 100644 --- a/server/services/email/lib/smtp.js +++ b/server/services/email/lib/smtp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb822=['nodemailer','nodemailer-plugin-inline-base64','send','createTransport','compile','verify','toString','exports'];(function(_0x14a835,_0x548c25){var _0x5010d7=function(_0x303a46){while(--_0x303a46){_0x14a835['push'](_0x14a835['shift']());}};_0x5010d7(++_0x548c25);}(_0xb822,0x168));var _0x2b82=function(_0x216906,_0x52cb01){_0x216906=_0x216906-0x0;var _0x2159d4=_0xb822[_0x216906];return _0x2159d4;};'use strict';var nodemailer=require(_0x2b82('0x0'));var inlineBase64=require(_0x2b82('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x2b82('0x2')]=function(_0x2e9fe1,_0x53b35c){return new Promise(function(_0x238da8,_0xc570c8){var _0x2eed9d=nodemailer[_0x2b82('0x3')](_0x2e9fe1);_0x2eed9d['use'](_0x2b82('0x4'),inlineBase64());_0x2eed9d['sendMail'](_0x53b35c,function(_0x226c87,_0x54094e){if(_0x226c87){_0xc570c8(_0x226c87['toString']());}else{_0x238da8(_0x54094e);}});});};EmailSmtp['prototype'][_0x2b82('0x5')]=function(_0x5d2ebd){return new Promise(function(_0x31e9e6,_0x4bc3c2){var _0x3328b7=nodemailer[_0x2b82('0x3')](_0x5d2ebd);_0x3328b7[_0x2b82('0x5')](function(_0x3e6387,_0x16963f){if(_0x3e6387){_0x4bc3c2(_0x3e6387[_0x2b82('0x6')]());}else{if(_0x16963f){_0x31e9e6(_0x16963f);}else{_0x4bc3c2('Not\x20verifired');}}});});};module[_0x2b82('0x7')]=EmailSmtp; \ No newline at end of file +var _0xb311=['use','compile','prototype','toString','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','createTransport'];(function(_0x1864bb,_0x2575d4){var _0x3aacad=function(_0x4f9379){while(--_0x4f9379){_0x1864bb['push'](_0x1864bb['shift']());}};_0x3aacad(++_0x2575d4);}(_0xb311,0x1a0));var _0x1b31=function(_0x4f65f6,_0x431083){_0x4f65f6=_0x4f65f6-0x0;var _0x542202=_0xb311[_0x4f65f6];return _0x542202;};'use strict';var nodemailer=require(_0x1b31('0x0'));var inlineBase64=require(_0x1b31('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x1b31('0x2')]=function(_0x11ce15,_0x42653d){return new Promise(function(_0xfec26c,_0x1a6423){var _0x1d39d7=nodemailer[_0x1b31('0x3')](_0x11ce15);_0x1d39d7[_0x1b31('0x4')](_0x1b31('0x5'),inlineBase64());_0x1d39d7['sendMail'](_0x42653d,function(_0x411f42,_0xeef1ca){if(_0x411f42){_0x1a6423(_0x411f42['toString']());}else{_0xfec26c(_0xeef1ca);}});});};EmailSmtp[_0x1b31('0x6')]['verify']=function(_0x35c5c9){return new Promise(function(_0x1c771e,_0x5d0b6d){var _0x4302de=nodemailer[_0x1b31('0x3')](_0x35c5c9);_0x4302de['verify'](function(_0x8e2e7b,_0x3580ed){if(_0x8e2e7b){_0x5d0b6d(_0x8e2e7b[_0x1b31('0x7')]());}else{if(_0x3580ed){_0x1c771e(_0x3580ed);}else{_0x5d0b6d(_0x1b31('0x8'));}}});});};module[_0x1b31('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 0088ab8..dda5879 100644 --- a/server/services/email/lib/utils.js +++ b/server/services/email/lib/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb9e=['substring','indexOf','slice','join','Anonymous','pop','length','isEmpty','html','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originCc','bcc','type','attachment','attachment-','%s-%s','root','writeFileSync','push','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name'];(function(_0x3a2afc,_0x496c83){var _0x386eae=function(_0x200aa7){while(--_0x200aa7){_0x3a2afc['push'](_0x3a2afc['shift']());}};_0x386eae(++_0x496c83);}(_0xeb9e,0x81));var _0xeeb9=function(_0x2d5a3d,_0x1e7b55){_0x2d5a3d=_0x2d5a3d-0x0;var _0x43c7e4=_0xeb9e[_0x2d5a3d];return _0x43c7e4;};'use strict';var _=require(_0xeeb9('0x0'));var moment=require(_0xeeb9('0x1'));var random=require(_0xeeb9('0x2'));var fs=require('fs');var path=require(_0xeeb9('0x3'));var util=require(_0xeeb9('0x4'));var tnef=require(_0xeeb9('0x5'));var logger=require('../../../config/logger')(_0xeeb9('0x6'));var config=require(_0xeeb9('0x7'));function getAddress(_0x975d12){var _0x290ecf=_[_0xeeb9('0x8')](_0x975d12[_0xeeb9('0x9')]);return _0x290ecf&&_0x290ecf[_0xeeb9('0xa')]?_0x290ecf[_0xeeb9('0xa')]:_0xeeb9('0xb')+random[_0xeeb9('0xc')](0x6)+_0xeeb9('0xd');}function getFirstName(_0x54d50a){var _0x468807=_['head'](_0x54d50a['value']);if(_0x468807&&_0x468807[_0xeeb9('0xe')]){if(_0x468807['name']==_0x468807[_0xeeb9('0xa')]){return _0x468807[_0xeeb9('0xe')][_0xeeb9('0xf')](0x0,_0x468807[_0xeeb9('0xe')][_0xeeb9('0x10')]('@'));}var _0x6fe4c9=_0x468807[_0xeeb9('0xe')]['split'](/\s+/);return _0x6fe4c9['length']>0x1?_0x6fe4c9[_0xeeb9('0x11')](0x0,-0x1)[_0xeeb9('0x12')]('\x20'):_0x468807[_0xeeb9('0xe')];}return _0xeeb9('0x13');}function getLastName(_0x22c690){var _0x5df2e0=_[_0xeeb9('0x8')](_0x22c690[_0xeeb9('0x9')]);if(_0x5df2e0&&_0x5df2e0[_0xeeb9('0xe')]){var _0x13e5ab=_0x5df2e0[_0xeeb9('0xe')]['split'](/\s+/);return _0x13e5ab['length']>0x1?_0x13e5ab[_0xeeb9('0x14')]():'';}return'';}function getMails(_0x548f11,_0x5b1c37){var _0x28c805='';for(var _0x11f28d=0x0;_0x11f28d<_0x5b1c37[_0xeeb9('0x9')][_0xeeb9('0x15')];_0x11f28d+=0x1){if(_0x5b1c37[_0xeeb9('0x9')][_0x11f28d][_0xeeb9('0xa')]!==_0x548f11){if(!_[_0xeeb9('0x16')](_0x28c805)){_0x28c805+=',';}_0x28c805+=_0x5b1c37['value'][_0x11f28d][_0xeeb9('0xe')]||_0x5b1c37[_0xeeb9('0x9')][_0x11f28d][_0xeeb9('0xa')]||'';_0x28c805+='\x20<';_0x28c805+=_0x5b1c37[_0xeeb9('0x9')][_0x11f28d][_0xeeb9('0xa')]?_0x5b1c37[_0xeeb9('0x9')][_0x11f28d][_0xeeb9('0xa')]:'anonymous'+random[_0xeeb9('0xc')](0x6)+_0xeeb9('0xd');_0x28c805+='>';}}return _0x28c805;}function parseEmail(_0x2aa1d1,_0x4f8fa1,_0x1a1116){if(_0x4f8fa1[_0xeeb9('0x17')]){var _0x25a099=/)<[^<]*)*<\/script>/gi;while(_0x25a099['test'](_0x4f8fa1['html'])){_0x4f8fa1[_0xeeb9('0x17')]=_0x4f8fa1[_0xeeb9('0x17')]['replace'](_0x25a099,'');}if(_0x4f8fa1[_0xeeb9('0x17')][_0xeeb9('0x18')](_0xeeb9('0x19'))){var _0x3d865b=[];_0x4f8fa1[_0xeeb9('0x1a')][_0xeeb9('0x1b')](_0x42a549=>{_0x3d865b['push'](_0x42a549['filename']);});var _0x3f03d6=/]+>/g;var _0x135126=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5e6489=_0x4f8fa1[_0xeeb9('0x17')][_0xeeb9('0x1c')](_0x135126,_0xeeb9('0x1d'));var _0x28846e=_0x5e6489['replace'](_0x3f03d6,_0xeeb9('0x1e'));for(let _0x541cd5=0x0;_0x541cd5<_0x3d865b['length'];_0x541cd5++){var _0x1c8ce7=_0x28846e['replace'](_0xeeb9('0x1e'),_0xeeb9('0x1f')+_0x3d865b[_0x541cd5]+_0xeeb9('0x20'));_0x28846e=_0x1c8ce7;}_0x4f8fa1[_0xeeb9('0x17')]=_0x28846e;}_0x1a1116[_0xeeb9('0x21')]=_0x4f8fa1['html'];}else{_0x1a1116['body']=_0x4f8fa1[_0xeeb9('0x22')];}if(_0x1a1116[_0xeeb9('0x21')]){_0x1a1116[_0xeeb9('0x21')]=_0x1a1116[_0xeeb9('0x21')][_0xeeb9('0x1c')](/0x0){var _0x34a37e=['Auto-Submitted:\x20auto-replied',_0xeeb9('0x2e'),_0xeeb9('0x2f')];for(var _0x5cde1e=0x0;_0x5cde1e<_0x4f8fa1['headerLines'][_0xeeb9('0x15')];_0x5cde1e++){var _0x5f223c=_[_0xeeb9('0x10')](_0x34a37e,_0x4f8fa1[_0xeeb9('0x2d')][_0x5cde1e][_0xeeb9('0x30')]);if(_0x5f223c>=0x0){_0x1a1116[_0xeeb9('0x31')]=!![];}}}return _0x1a1116;}exports[_0xeeb9('0x32')]=function(_0x3084ea,_0x5ba2ca,_0x2edf9b){var _0x48add0={'from':getAddress(_0x5ba2ca[_0xeeb9('0x33')]),'firstName':getFirstName(_0x5ba2ca[_0xeeb9('0x33')]),'lastName':getLastName(_0x5ba2ca[_0xeeb9('0x33')]),'mapKey':'email','message':{'from':getMails(_0x3084ea['email'],_0x5ba2ca[_0xeeb9('0x33')]),'to':_0x3084ea[_0xeeb9('0x6')],'cc':'','subject':_0x5ba2ca[_0xeeb9('0x34')]||'','messageId':_0x5ba2ca[_0xeeb9('0x35')],'inReplyTo':_0x5ba2ca['inReplyTo'],'sentAt':moment(_0x5ba2ca[_0xeeb9('0x36')])[_0xeeb9('0x37')](_0xeeb9('0x38')),'attach':![],'attachments':[]}};if(!_0x5ba2ca[_0xeeb9('0x17')]&&!_0x5ba2ca[_0xeeb9('0x22')]){var _0x1ce65d=_[_0xeeb9('0x39')](_0x5ba2ca['attachments'],{'contentType':_0xeeb9('0x3a')});if(_0x1ce65d[_0xeeb9('0x15')]){logger[_0xeeb9('0x3b')](util[_0xeeb9('0x37')](_0xeeb9('0x3c'),_0x5ba2ca[_0xeeb9('0x35')]));tnef[_0xeeb9('0x3d')](_['first'](_0x1ce65d)['content'],function(_0x3af2e9,_0x3cb58e){if(_0x3cb58e){_0x5ba2ca[_0xeeb9('0x17')]=_0x3cb58e[_0xeeb9('0x3e')]||_0xeeb9('0x3f');if(_0x3cb58e[_0xeeb9('0x40')]){for(var _0x20b6a6=0x0;_0x20b6a6<_0x3cb58e[_0xeeb9('0x40')]['length'];_0x20b6a6++){var _0xdfead3=_0x3cb58e[_0xeeb9('0x40')][_0x20b6a6];_0x48add0[_0xeeb9('0x23')][_0xeeb9('0x1a')][_0xeeb9('0x2c')]({'filename':_0xdfead3[_0xeeb9('0x41')],'content':Buffer[_0xeeb9('0x33')](_0xdfead3[_0xeeb9('0x42')])});}}}_0x2edf9b(parseEmail(_0x3084ea,_0x5ba2ca,_0x48add0));});}else{_0x5ba2ca[_0xeeb9('0x17')]='

Empty\x20message

';_0x2edf9b(parseEmail(_0x3084ea,_0x5ba2ca,_0x48add0));}}else{_0x2edf9b(parseEmail(_0x3084ea,_0x5ba2ca,_0x48add0));}};exports[_0xeeb9('0x43')]=function(_0x4c2fb3,_0x38d0df){var _0x1f6f56=[_0xeeb9('0x44')+(_0x38d0df||''),_0xeeb9('0x45')+_0x4c2fb3,'',''];return Buffer[_0xeeb9('0x33')](_0x1f6f56[_0xeeb9('0x12')](''),_0xeeb9('0x46'))['toString'](_0xeeb9('0x47'));}; \ No newline at end of file +var _0x3a07=['YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','auth=Bearer\x20','utf-8','toString','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','@xcally.com','name','substring','length','slice','join','Anonymous','head','split','isEmpty','generate','html','test','replace','includes','attachments','forEach','filename','_SRC','_IMG','\x20]','body','textAsHtml','0x1?_0x962ae4[_0x73a0('0xf')](0x0,-0x1)[_0x73a0('0x10')]('\x20'):_0x31119d['name'];}return _0x73a0('0x11');}function getLastName(_0x259294){var _0x4617ec=_[_0x73a0('0x12')](_0x259294[_0x73a0('0x8')]);if(_0x4617ec&&_0x4617ec[_0x73a0('0xc')]){var _0x3b8a9a=_0x4617ec[_0x73a0('0xc')][_0x73a0('0x13')](/\s+/);return _0x3b8a9a[_0x73a0('0xe')]>0x1?_0x3b8a9a['pop']():'';}return'';}function getMails(_0x1a0796,_0x2483be){var _0x4ff62f='';for(var _0x52f775=0x0;_0x52f775<_0x2483be[_0x73a0('0x8')][_0x73a0('0xe')];_0x52f775+=0x1){if(_0x2483be['value'][_0x52f775][_0x73a0('0x9')]!==_0x1a0796){if(!_[_0x73a0('0x14')](_0x4ff62f)){_0x4ff62f+=',';}_0x4ff62f+=_0x2483be[_0x73a0('0x8')][_0x52f775][_0x73a0('0xc')]||_0x2483be['value'][_0x52f775][_0x73a0('0x9')]||'';_0x4ff62f+='\x20<';_0x4ff62f+=_0x2483be[_0x73a0('0x8')][_0x52f775][_0x73a0('0x9')]?_0x2483be['value'][_0x52f775][_0x73a0('0x9')]:_0x73a0('0xa')+random[_0x73a0('0x15')](0x6)+_0x73a0('0xb');_0x4ff62f+='>';}}return _0x4ff62f;}function parseEmail(_0x36ee72,_0x1f5f6d,_0x40e86e){if(_0x1f5f6d[_0x73a0('0x16')]){var _0x83c8ee=/)<[^<]*)*<\/script>/gi;while(_0x83c8ee[_0x73a0('0x17')](_0x1f5f6d[_0x73a0('0x16')])){_0x1f5f6d['html']=_0x1f5f6d[_0x73a0('0x16')][_0x73a0('0x18')](_0x83c8ee,'');}if(_0x1f5f6d[_0x73a0('0x16')][_0x73a0('0x19')]('{_0x411171['push'](_0x10798c[_0x73a0('0x1c')]);});var _0x3dd23d=/]+>/g;var _0x3f8f8b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5a0a3f=_0x1f5f6d[_0x73a0('0x16')][_0x73a0('0x18')](_0x3f8f8b,_0x73a0('0x1d'));var _0x385ca9=_0x5a0a3f[_0x73a0('0x18')](_0x3dd23d,_0x73a0('0x1e'));for(let _0x1b12cf=0x0;_0x1b12cf<_0x411171[_0x73a0('0xe')];_0x1b12cf++){var _0xe5fbdd=_0x385ca9[_0x73a0('0x18')](_0x73a0('0x1e'),'\x20[Attachment:\x20'+_0x411171[_0x1b12cf]+_0x73a0('0x1f'));_0x385ca9=_0xe5fbdd;}_0x1f5f6d[_0x73a0('0x16')]=_0x385ca9;}_0x40e86e[_0x73a0('0x20')]=_0x1f5f6d['html'];}else{_0x40e86e[_0x73a0('0x20')]=_0x1f5f6d[_0x73a0('0x21')];}if(_0x40e86e[_0x73a0('0x20')]){_0x40e86e['body']=_0x40e86e[_0x73a0('0x20')][_0x73a0('0x18')](/0x0){var _0x3f4ebe=[_0x73a0('0x32'),_0x73a0('0x33'),'Precedence:\x20auto_reply'];for(var _0x164bc4=0x0;_0x164bc4<_0x1f5f6d[_0x73a0('0x31')][_0x73a0('0xe')];_0x164bc4++){var _0x2864a2=_[_0x73a0('0x34')](_0x3f4ebe,_0x1f5f6d[_0x73a0('0x31')][_0x164bc4][_0x73a0('0x35')]);if(_0x2864a2>=0x0){_0x40e86e[_0x73a0('0x36')]=!![];}}}return _0x40e86e;}exports[_0x73a0('0x37')]=function(_0x483e96,_0x456197,_0x196c66){var _0x5ccd71={'from':getAddress(_0x456197['from']),'firstName':getFirstName(_0x456197[_0x73a0('0x38')]),'lastName':getLastName(_0x456197[_0x73a0('0x38')]),'mapKey':_0x73a0('0x6'),'message':{'from':getMails(_0x483e96[_0x73a0('0x6')],_0x456197[_0x73a0('0x38')]),'to':_0x483e96[_0x73a0('0x6')],'cc':'','subject':_0x456197[_0x73a0('0x39')]||'','messageId':_0x456197[_0x73a0('0x3a')],'inReplyTo':_0x456197[_0x73a0('0x3b')],'sentAt':moment(_0x456197['date'])['format'](_0x73a0('0x3c')),'attach':![],'attachments':[]}};if(!_0x456197[_0x73a0('0x16')]&&!_0x456197[_0x73a0('0x21')]){var _0x2900b7=_['filter'](_0x456197[_0x73a0('0x1a')],{'contentType':_0x73a0('0x3d')});if(_0x2900b7[_0x73a0('0xe')]){logger[_0x73a0('0x3e')](util[_0x73a0('0x29')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x456197[_0x73a0('0x3a')]));tnef[_0x73a0('0x3f')](_[_0x73a0('0x40')](_0x2900b7)[_0x73a0('0x2f')],function(_0xdadd88,_0x24743c){if(_0x24743c){_0x456197[_0x73a0('0x16')]=_0x24743c[_0x73a0('0x41')]||_0x73a0('0x42');if(_0x24743c[_0x73a0('0x43')]){for(var _0x2b7a53=0x0;_0x2b7a53<_0x24743c[_0x73a0('0x43')]['length'];_0x2b7a53++){var _0x485076=_0x24743c[_0x73a0('0x43')][_0x2b7a53];_0x5ccd71[_0x73a0('0x23')][_0x73a0('0x1a')][_0x73a0('0x30')]({'filename':_0x485076[_0x73a0('0x44')],'content':Buffer['from'](_0x485076[_0x73a0('0x45')])});}}}_0x196c66(parseEmail(_0x483e96,_0x456197,_0x5ccd71));});}else{_0x456197[_0x73a0('0x16')]=_0x73a0('0x42');_0x196c66(parseEmail(_0x483e96,_0x456197,_0x5ccd71));}}else{_0x196c66(parseEmail(_0x483e96,_0x456197,_0x5ccd71));}};exports['generateXOAuth2Token']=function(_0x284df3,_0x371f52){var _0x28e372=['user='+(_0x371f52||''),_0x73a0('0x46')+_0x284df3,'',''];return Buffer[_0x73a0('0x38')](_0x28e372[_0x73a0('0x10')](''),_0x73a0('0x47'))[_0x73a0('0x48')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 4adb68d..4b11439 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed6c=['key','active','Smtp','exports','lodash','name','Service'];(function(_0x4f1c92,_0x259090){var _0x5570b5=function(_0x36b3e0){while(--_0x36b3e0){_0x4f1c92['push'](_0x4f1c92['shift']());}};_0x5570b5(++_0x259090);}(_0xed6c,0xba));var _0xced6=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xed6c[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xced6('0x0'));function MailAccount(_0x2bca07){this['id']=_0x2bca07['id']||0x0;this[_0xced6('0x1')]=_0x2bca07[_0xced6('0x1')]||_0xced6('0x2');this[_0xced6('0x3')]=_0x2bca07[_0xced6('0x3')]||'SERV';this['active']=_0x2bca07[_0xced6('0x4')]||![];this['Imap']=_0x2bca07['Imap']||[];this[_0xced6('0x5')]=_0x2bca07[_0xced6('0x5')]||[];}module[_0xced6('0x6')]=MailAccount; \ No newline at end of file +var _0xafa8=['exports','lodash','name','Service','key','SERV','active','Smtp'];(function(_0x187f4b,_0x1a4475){var _0x3d709a=function(_0x530a54){while(--_0x530a54){_0x187f4b['push'](_0x187f4b['shift']());}};_0x3d709a(++_0x1a4475);}(_0xafa8,0xc9));var _0x8afa=function(_0x5a92ad,_0x2219a6){_0x5a92ad=_0x5a92ad-0x0;var _0x2466f8=_0xafa8[_0x5a92ad];return _0x2466f8;};'use strict';var _=require(_0x8afa('0x0'));function MailAccount(_0x1c800a){this['id']=_0x1c800a['id']||0x0;this['name']=_0x1c800a[_0x8afa('0x1')]||_0x8afa('0x2');this[_0x8afa('0x3')]=_0x1c800a[_0x8afa('0x3')]||_0x8afa('0x4');this['active']=_0x1c800a[_0x8afa('0x5')]||![];this['Imap']=_0x1c800a['Imap']||[];this['Smtp']=_0x1c800a[_0x8afa('0x6')]||[];}module[_0x8afa('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 0ced0d8..c065a18 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43ec=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','lodash','../model/mailAccount','mailAccounts'];(function(_0x33585d,_0x4150cd){var _0x330bb7=function(_0x498acc){while(--_0x498acc){_0x33585d['push'](_0x33585d['shift']());}};_0x330bb7(++_0x4150cd);}(_0x43ec,0x195));var _0xc43e=function(_0x2b5fa7,_0x1b475e){_0x2b5fa7=_0x2b5fa7-0x0;var _0x53fa13=_0x43ec[_0x2b5fa7];return _0x53fa13;};'use strict';var _=require(_0xc43e('0x0'));var MailAccount=require(_0xc43e('0x1'));var Realtime=function(){this[_0xc43e('0x2')]={};};function freeIsNotKey(_0x3d2503,_0x3cda9b,_0x345d36){var _0x5efaff=_[_0xc43e('0x3')](_0x3d2503,function(_0x1a9c8c,_0x16e189){return _0x1a9c8c[_0x345d36];});for(var _0x10343f in _0x3cda9b){if(_0x3cda9b[_0xc43e('0x4')](_0x10343f)){if(!_0x5efaff[_0x10343f]){delete _0x3cda9b[_0x10343f];}}}}Realtime[_0xc43e('0x5')][_0xc43e('0x6')]=function(_0x3242b3,_0x19e0f5){for(var _0x3626b3 in _0x19e0f5){if(_0x3242b3[_0xc43e('0x4')](_0x3626b3)){_0x3242b3[_0x3626b3]=_0x19e0f5[_0x3626b3];}}};Realtime['prototype'][_0xc43e('0x7')]=function(){var _0x5d50a2=this;return function(_0x21b33d){if(_0x21b33d){freeIsNotKey(_0x21b33d,_0x5d50a2[_0xc43e('0x2')],'id');for(var _0x2dbffb=0x0,_0x12b57c={},_0x499f8d={};_0x2dbffb<_0x21b33d['length'];_0x2dbffb+=0x1){_0x12b57c=_0x21b33d[_0x2dbffb];if(_['isUndefined'](_0x5d50a2[_0xc43e('0x2')][_0x12b57c['id']])){_0x5d50a2['mailAccounts'][_0x12b57c['id']]=new MailAccount(_0x12b57c);}else{_['merge'](_0x5d50a2[_0xc43e('0x2')][_0x12b57c['id']],_0x12b57c);}}}return _0x5d50a2[_0xc43e('0x2')];};};module['exports']=Realtime; \ No newline at end of file +var _0xbf0a=['exports','lodash','../model/mailAccount','mailAccounts','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','length','isUndefined'];(function(_0x13a20d,_0x413e40){var _0x3c58eb=function(_0x3bd1f1){while(--_0x3bd1f1){_0x13a20d['push'](_0x13a20d['shift']());}};_0x3c58eb(++_0x413e40);}(_0xbf0a,0x1e1));var _0xabf0=function(_0x297372,_0x5d3ed2){_0x297372=_0x297372-0x0;var _0x554392=_0xbf0a[_0x297372];return _0x554392;};'use strict';var _=require(_0xabf0('0x0'));var MailAccount=require(_0xabf0('0x1'));var Realtime=function(){this[_0xabf0('0x2')]={};};function freeIsNotKey(_0x94e5f2,_0x1c9138,_0xd9d32d){var _0x5ceb52=_['mapKeys'](_0x94e5f2,function(_0x19e309,_0x5e2fbf){return _0x19e309[_0xd9d32d];});for(var _0x2a8602 in _0x1c9138){if(_0x1c9138['hasOwnProperty'](_0x2a8602)){if(!_0x5ceb52[_0x2a8602]){delete _0x1c9138[_0x2a8602];}}}}Realtime['prototype'][_0xabf0('0x3')]=function(_0x310c6c,_0x351190){for(var _0x57cf43 in _0x351190){if(_0x310c6c[_0xabf0('0x4')](_0x57cf43)){_0x310c6c[_0x57cf43]=_0x351190[_0x57cf43];}}};Realtime[_0xabf0('0x5')][_0xabf0('0x6')]=function(){var _0x459994=this;return function(_0xe08518){if(_0xe08518){freeIsNotKey(_0xe08518,_0x459994[_0xabf0('0x2')],'id');for(var _0x5f2f92=0x0,_0x26f175={},_0x3d391b={};_0x5f2f92<_0xe08518[_0xabf0('0x7')];_0x5f2f92+=0x1){_0x26f175=_0xe08518[_0x5f2f92];if(_[_0xabf0('0x8')](_0x459994[_0xabf0('0x2')][_0x26f175['id']])){_0x459994[_0xabf0('0x2')][_0x26f175['id']]=new MailAccount(_0x26f175);}else{_['merge'](_0x459994[_0xabf0('0x2')][_0x26f175['id']],_0x26f175);}}}return _0x459994[_0xabf0('0x2')];};};module[_0xabf0('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 20adff1..f23867d 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe367=['active','key','ListId','TemplateId','MailServerIn','type','data5','MailServerOut','CloudProvider','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','provider','service','email'];(function(_0x153f4d,_0x55c776){var _0x9cddf2=function(_0x5b6d2e){while(--_0x5b6d2e){_0x153f4d['push'](_0x153f4d['shift']());}};_0x9cddf2(++_0x55c776);}(_0xe367,0x116));var _0x7e36=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe367[_0x25e7cb];return _0x375d92;};'use strict';var client=require(_0x7e36('0x0'));exports[_0x7e36('0x1')]=function(){return function(){return client[_0x7e36('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x7e36('0x3'),_0x7e36('0x4'),_0x7e36('0x5'),_0x7e36('0x6'),_0x7e36('0x7'),_0x7e36('0x8'),_0x7e36('0x9'),_0x7e36('0xa')],'raw':![],'include':[{'model':_0x7e36('0xb'),'as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0x7e36('0x3'),_0x7e36('0x5'),_0x7e36('0xc'),_0x7e36('0xd')],'as':'CloudProvider'}]},{'model':_0x7e36('0xe'),'as':'Smtp','include':[{'model':'CloudProvider','attributes':['id',_0x7e36('0x3'),'service',_0x7e36('0xc'),_0x7e36('0xd')],'as':_0x7e36('0xf')}]}]},'log':_0x7e36('0x10')});};};exports[_0x7e36('0x11')]=function(_0x4c38ac,_0x1cf5ed){return client[_0x7e36('0x2')](_0x7e36('0x12'),{'account':{'id':_0x4c38ac},'body':_0x1cf5ed,'log':_0x7e36('0x12')});}; \ No newline at end of file +var _0x77d4=['TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','Smtp','name','data5','getMailAccount','notify','Request','getMailAccounts','GetMailAccount','provider','service','key','ListId'];(function(_0x394fbd,_0x39ae7c){var _0x57caaa=function(_0x834563){while(--_0x834563){_0x394fbd['push'](_0x394fbd['shift']());}};_0x57caaa(++_0x39ae7c);}(_0x77d4,0x108));var _0x477d=function(_0x35eda9,_0x557d12){_0x35eda9=_0x35eda9-0x0;var _0x4c145b=_0x77d4[_0x35eda9];return _0x4c145b;};'use strict';var client=require('../client');exports[_0x477d('0x0')]=function(){return function(){return client['Request'](_0x477d('0x1'),{'options':{'attributes':['id','name',_0x477d('0x2'),_0x477d('0x3'),'email','active',_0x477d('0x4'),_0x477d('0x5'),_0x477d('0x6')],'raw':![],'include':[{'model':_0x477d('0x7'),'as':_0x477d('0x8'),'include':[{'model':_0x477d('0x9'),'attributes':['id','name','service',_0x477d('0xa'),'data5'],'as':'CloudProvider'}]},{'model':_0x477d('0xb'),'as':_0x477d('0xc'),'include':[{'model':_0x477d('0x9'),'attributes':['id',_0x477d('0xd'),_0x477d('0x3'),'type',_0x477d('0xe')],'as':'CloudProvider'}]}]},'log':_0x477d('0xf')});};};exports[_0x477d('0x10')]=function(_0x55ace3,_0x472012){return client[_0x477d('0x11')]('NotifyMailAccount',{'account':{'id':_0x55ace3},'body':_0x472012,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 2c29305..ce02975 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb37=['GetSettings','../client','ShowSetting','loginMailFrequency'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb37,0x195));var _0x7db3=function(_0x438fbe,_0x3c15d5){_0x438fbe=_0x438fbe-0x0;var _0x1e7569=_0xdb37[_0x438fbe];return _0x1e7569;};'use strict';var client=require(_0x7db3('0x0'));exports['getSettings']=function(){return client['Request'](_0x7db3('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7db3('0x2')]},'log':_0x7db3('0x3')});}; \ No newline at end of file +var _0xddd9=['ShowSetting','GetSettings','../client','getSettings'];(function(_0x4d4b29,_0x1c674c){var _0x4053cb=function(_0x20ac25){while(--_0x20ac25){_0x4d4b29['push'](_0x4d4b29['shift']());}};_0x4053cb(++_0x1c674c);}(_0xddd9,0x1ee));var _0x9ddd=function(_0x20501e,_0x352f29){_0x20501e=_0x20501e-0x0;var _0x50e0d1=_0xddd9[_0x20501e];return _0x50e0d1;};'use strict';var client=require(_0x9ddd('0x0'));exports[_0x9ddd('0x1')]=function(){return client['Request'](_0x9ddd('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x9ddd('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index a0b466a..f6c1631 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index d5876e8..c0455cf 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb11f=['exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xb11f,0x16d));var _0xfb11=function(_0x13a370,_0x52765b){_0x13a370=_0x13a370-0x0;var _0x5b643c=_0xb11f[_0x13a370];return _0x5b643c;};'use strict';var _=require(_0xfb11('0x0'));var http=require(_0xfb11('0x1'));var express=require(_0xfb11('0x2'));var sticky=require(_0xfb11('0x3'));var Redis=require(_0xfb11('0x4'));var config=require(_0xfb11('0x5'));var app=express();var server=http[_0xfb11('0x6')](app);server[_0xfb11('0x7')]=0xdbba0;if(sticky[_0xfb11('0x8')](server,config[_0xfb11('0x9')])){var socketio=require(_0xfb11('0xa'))(server,{'transports':[_0xfb11('0xb'),_0xfb11('0xc')]});config[_0xfb11('0xd')]=_[_0xfb11('0xe')](config[_0xfb11('0xd')],{'host':_0xfb11('0xf'),'port':0x18eb});socketio[_0xfb11('0x10')](require(_0xfb11('0x11'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0xfb11('0x12'))['default']();require(_0xfb11('0x13'))[_0xfb11('0x14')](socketio);require(_0xfb11('0x15'))[_0xfb11('0x14')](app);require(_0xfb11('0x16'))[_0xfb11('0x14')](app);}else{server[_0xfb11('0x17')](_0xfb11('0x18'),function(){console[_0xfb11('0x19')](_0xfb11('0x1a'),config[_0xfb11('0x9')]);});}exports=module[_0xfb11('0x1b')]=app; \ No newline at end of file +var _0x83ae=['Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','listen','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/express','once','listening','log'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x83ae,0x151));var _0xe83a=function(_0x558fff,_0x45d409){_0x558fff=_0x558fff-0x0;var _0x5d19d6=_0x83ae[_0x558fff];return _0x5d19d6;};'use strict';var _=require(_0xe83a('0x0'));var http=require(_0xe83a('0x1'));var express=require(_0xe83a('0x2'));var sticky=require(_0xe83a('0x3'));var Redis=require(_0xe83a('0x4'));var config=require(_0xe83a('0x5'));var app=express();var server=http[_0xe83a('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0xe83a('0x7')](server,config['port'])){var socketio=require(_0xe83a('0x8'))(server,{'transports':[_0xe83a('0x9'),'polling']});config[_0xe83a('0xa')]=_[_0xe83a('0xb')](config['redis'],{'host':_0xe83a('0xc'),'port':0x18eb});socketio[_0xe83a('0xd')](require(_0xe83a('0xe'))({'pubClient':new Redis(config[_0xe83a('0xa')]),'subClient':new Redis(config[_0xe83a('0xa')])}));require('../../config/triggers')[_0xe83a('0xf')]();require('../../config/socketio')[_0xe83a('0xf')](socketio);require(_0xe83a('0x10'))[_0xe83a('0xf')](app);require('../../routes')['default'](app);}else{server[_0xe83a('0x11')](_0xe83a('0x12'),function(){console[_0xe83a('0x13')](_0xe83a('0x14'),config['port']);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 2d2daa0..edcb8e8 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['message','result','catch','exports','../../config/logger','routing','client','Request','request','then','debug','rpc','error'];(function(_0x1aa008,_0x4a778e){var _0x5eb141=function(_0x4a6651){while(--_0x4a6651){_0x1aa008['push'](_0x1aa008['shift']());}};_0x5eb141(++_0x4a778e);}(_0x66fa,0xe1));var _0xa66f=function(_0x1a6b55,_0x67971d){_0x1a6b55=_0x1a6b55-0x0;var _0x1df140=_0x66fa[_0x1a6b55];return _0x1df140;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xa66f('0x0'))(_0xa66f('0x1'));var client=jayson[_0xa66f('0x2')]['http']({'port':0x2329});client[_0xa66f('0x3')]=function(_0x2fcfc7,_0x19716a){return new BPromise(function(_0x5e1f03,_0x49fc89){return client[_0xa66f('0x4')](_0x2fcfc7,_0x19716a)[_0xa66f('0x5')](function(_0x4540da){logger[_0xa66f('0x6')](_0xa66f('0x7'),_0xa66f('0x1'),_0x2fcfc7,_0x19716a,_0x4540da);if(_0x4540da[_0xa66f('0x8')]){logger['error']('rpc','routing',_0x2fcfc7,_0x4540da[_0xa66f('0x8')]['message'],_0x19716a);return _0x49fc89(_0x4540da[_0xa66f('0x8')][_0xa66f('0x9')]);}else{return _0x5e1f03(_0x4540da[_0xa66f('0xa')]);}})[_0xa66f('0xb')](function(_0xbcdd6b){logger['error'](_0xa66f('0x7'),'routing',_0x2fcfc7,_0xbcdd6b,_0x19716a);return _0x49fc89(_0xbcdd6b);});});};module[_0xa66f('0xc')]=client; \ No newline at end of file +var _0xbc03=['exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','rpc','error','message','catch'];(function(_0x3c3c0a,_0x55292c){var _0xf63fd6=function(_0x3076fa){while(--_0x3076fa){_0x3c3c0a['push'](_0x3c3c0a['shift']());}};_0xf63fd6(++_0x55292c);}(_0xbc03,0x9d));var _0x3bc0=function(_0x311fdd,_0x1d3fcd){_0x311fdd=_0x311fdd-0x0;var _0x2a34ed=_0xbc03[_0x311fdd];return _0x2a34ed;};'use strict';var jayson=require(_0x3bc0('0x0'));var BPromise=require('bluebird');var logger=require(_0x3bc0('0x1'))(_0x3bc0('0x2'));var client=jayson[_0x3bc0('0x3')][_0x3bc0('0x4')]({'port':0x2329});client[_0x3bc0('0x5')]=function(_0x242841,_0xa0b6e5){return new BPromise(function(_0x1c4a4e,_0x542e97){return client[_0x3bc0('0x6')](_0x242841,_0xa0b6e5)[_0x3bc0('0x7')](function(_0x2b2a29){logger['debug'](_0x3bc0('0x8'),_0x3bc0('0x2'),_0x242841,_0xa0b6e5,_0x2b2a29);if(_0x2b2a29[_0x3bc0('0x9')]){logger[_0x3bc0('0x9')](_0x3bc0('0x8'),_0x3bc0('0x2'),_0x242841,_0x2b2a29['error']['message'],_0xa0b6e5);return _0x542e97(_0x2b2a29[_0x3bc0('0x9')][_0x3bc0('0xa')]);}else{return _0x1c4a4e(_0x2b2a29['result']);}})[_0x3bc0('0xb')](function(_0x1e482b){logger[_0x3bc0('0x9')](_0x3bc0('0x8'),_0x3bc0('0x2'),_0x242841,_0x1e482b,_0xa0b6e5);return _0x542e97(_0x1e482b);});});};module[_0x3bc0('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index dd7ff4e..73106a9 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d27=['getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues'];(function(_0x2d0c5d,_0x515c9d){var _0x304237=function(_0x821f23){while(--_0x821f23){_0x2d0c5d['push'](_0x2d0c5d['shift']());}};_0x304237(++_0x515c9d);}(_0x4d27,0x126));var _0x74d2=function(_0x17087e,_0x1e6e45){_0x17087e=_0x17087e-0x0;var _0x25a5c3=_0x4d27[_0x17087e];return _0x25a5c3;};'use strict';var BPromise=require(_0x74d2('0x0'));var server=require(_0x74d2('0x1'));var Realtime=require(_0x74d2('0x2'));var user=require(_0x74d2('0x3'));var interval=require(_0x74d2('0x4'));var openchannelQueue=require(_0x74d2('0x5'));var chatQueue=require(_0x74d2('0x6'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x74d2('0x7'));var whatsappQueue=require(_0x74d2('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x74d2('0x9')]()[_0x74d2('0xa')](user[_0x74d2('0xb')]())[_0x74d2('0xa')](realtime[_0x74d2('0xc')]())[_0x74d2('0xa')](interval[_0x74d2('0xd')]())[_0x74d2('0xa')](realtime[_0x74d2('0xe')]())['then'](openchannelQueue[_0x74d2('0xf')]())[_0x74d2('0xa')](realtime['initOpenchannelQueues']())[_0x74d2('0xa')](chatQueue[_0x74d2('0x10')]())[_0x74d2('0xa')](realtime[_0x74d2('0x11')]())[_0x74d2('0xa')](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())['then'](mailQueue[_0x74d2('0x12')]())['then'](realtime[_0x74d2('0x13')]())[_0x74d2('0xa')](faxQueue[_0x74d2('0x14')]())[_0x74d2('0xa')](realtime['initFaxQueues']())['then'](whatsappQueue[_0x74d2('0x15')]())[_0x74d2('0xa')](realtime[_0x74d2('0x16')]())[_0x74d2('0xa')](function(){return realtime;});}function main(){return server[_0x74d2('0x17')](realtime)[_0x74d2('0xa')](function(_0x586510){return initRealtime();})[_0x74d2('0xa')](function(_0x211f76){return setInterval(initRealtime,0x1388);})[_0x74d2('0x18')](function(_0x17c330){console[_0x74d2('0x19')](_0x17c330);});}main(); \ No newline at end of file +var _0xa183=['./rpc/whatsappQueue','resolve','then','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0xa183,0x131));var _0x3a18=function(_0x36f017,_0x243828){_0x36f017=_0x36f017-0x0;var _0x1f11ad=_0xa183[_0x36f017];return _0x1f11ad;};'use strict';var BPromise=require(_0x3a18('0x0'));var server=require(_0x3a18('0x1'));var Realtime=require('./realtime');var user=require(_0x3a18('0x2'));var interval=require(_0x3a18('0x3'));var openchannelQueue=require(_0x3a18('0x4'));var chatQueue=require(_0x3a18('0x5'));var smsQueue=require(_0x3a18('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x3a18('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x3a18('0x8')]()[_0x3a18('0x9')](user['getAgents']())[_0x3a18('0x9')](realtime[_0x3a18('0xa')]())['then'](interval['getIntervals']())[_0x3a18('0x9')](realtime[_0x3a18('0xb')]())[_0x3a18('0x9')](openchannelQueue[_0x3a18('0xc')]())[_0x3a18('0x9')](realtime[_0x3a18('0xd')]())['then'](chatQueue[_0x3a18('0xe')]())[_0x3a18('0x9')](realtime['initChatQueues']())[_0x3a18('0x9')](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0x3a18('0x9')](mailQueue[_0x3a18('0xf')]())[_0x3a18('0x9')](realtime[_0x3a18('0x10')]())[_0x3a18('0x9')](faxQueue[_0x3a18('0x11')]())[_0x3a18('0x9')](realtime[_0x3a18('0x12')]())[_0x3a18('0x9')](whatsappQueue[_0x3a18('0x13')]())[_0x3a18('0x9')](realtime[_0x3a18('0x14')]())[_0x3a18('0x9')](function(){return realtime;});}function main(){return server[_0x3a18('0x15')](realtime)['then'](function(_0x9f100){return initRealtime();})['then'](function(_0x5080c6){return setInterval(initRealtime,0x1388);})[_0x3a18('0x16')](function(_0xadea89){console[_0x3a18('0x17')](_0xadea89);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index d587d34..946fa39 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x5a9017,_0x4312fc){var _0x596e52=function(_0x35843d){while(--_0x35843d){_0x5a9017['push'](_0x5a9017['shift']());}};_0x596e52(++_0x4312fc);}(_0x814b,0x1a2));var _0xb814=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x814b[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x3fb2d4,_0x44a3a8){var _0x4cfd9a=function(_0x35f723){while(--_0x35f723){_0x3fb2d4['push'](_0x3fb2d4['shift']());}};_0x4cfd9a(++_0x44a3a8);}(_0x326f,0xd1));var _0xf326=function(_0x6f8730,_0x5eefc4){_0x6f8730=_0x6f8730-0x0;var _0x2963e8=_0x326f[_0x6f8730];return _0x2963e8;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 8d0d834..89794c8 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc151=['request','error','message','result','sendMailMessage','bluebird','jayson/promise','client'];(function(_0x330998,_0x26db4e){var _0x1c2c8f=function(_0x251d88){while(--_0x251d88){_0x330998['push'](_0x330998['shift']());}};_0x1c2c8f(++_0x26db4e);}(_0xc151,0x85));var _0x1c15=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc151[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x1c15('0x0'));var jayson=require(_0x1c15('0x1'));var client=jayson[_0x1c15('0x2')]['http']({'port':0x232b});function request(_0xa3f535,_0x1398a4){return new BPromise(function(_0x55174c,_0x1eeee1){return client[_0x1c15('0x3')](_0xa3f535,_0x1398a4)['then'](function(_0x4c81c8){if(_0x4c81c8[_0x1c15('0x4')]){return _0x1eeee1(_0x4c81c8[_0x1c15('0x4')][_0x1c15('0x5')]);}else{return _0x55174c(_0x4c81c8[_0x1c15('0x6')]);}})['catch'](function(_0x17aa5a){return _0x1eeee1(_0x17aa5a);});});}exports[_0x1c15('0x7')]=function(_0x1e98a5,_0x47bda6){return request('SendMail',{'account':_0x1e98a5,'message':_0x47bda6});}; \ No newline at end of file +var _0xed8c=['error','message','result','catch','bluebird','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed8c,0x94));var _0xced8=function(_0x1bc884,_0x48f8c5){_0x1bc884=_0x1bc884-0x0;var _0x291c15=_0xed8c[_0x1bc884];return _0x291c15;};'use strict';var BPromise=require(_0xced8('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xced8('0x1')]({'port':0x232b});function request(_0x1c4c22,_0x2e5cac){return new BPromise(function(_0x1ca08d,_0xd54e15){return client[_0xced8('0x2')](_0x1c4c22,_0x2e5cac)[_0xced8('0x3')](function(_0xa3a8e9){if(_0xa3a8e9[_0xced8('0x4')]){return _0xd54e15(_0xa3a8e9[_0xced8('0x4')][_0xced8('0x5')]);}else{return _0x1ca08d(_0xa3a8e9[_0xced8('0x6')]);}})[_0xced8('0x7')](function(_0x4c7e21){return _0xd54e15(_0x4c7e21);});});}exports['sendMailMessage']=function(_0x20d32c,_0x2f8293){return request('SendMail',{'account':_0x20d32c,'message':_0x2f8293});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 786f351..be24fd6 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a12=['CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','sms','whatsapp','length','StatusTime','Status','mailStatus','faxCapacity','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype'];(function(_0x650286,_0x8bfeae){var _0x570922=function(_0x1a3ce5){while(--_0x1a3ce5){_0x650286['push'](_0x650286['shift']());}};_0x570922(++_0x8bfeae);}(_0x1a12,0x8d));var _0x21a1=function(_0x4f492c,_0x2f5d87){_0x4f492c=_0x4f492c-0x0;var _0x347ea5=_0x1a12[_0x4f492c];return _0x347ea5;};'use strict';var _=require(_0x21a1('0x0'));var moment=require(_0x21a1('0x1'));var md5=require(_0x21a1('0x2'));var Redis=require(_0x21a1('0x3'));var config=require(_0x21a1('0x4'));config[_0x21a1('0x5')]=_['defaults'](config['redis'],{'host':_0x21a1('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21a1('0x5')]));function Agent(_0x4e4574){this['id']=_0x4e4574['id']||0x0;this[_0x21a1('0x7')]=_0x4e4574[_0x21a1('0x7')]||'';this[_0x21a1('0x8')]=_0x4e4574['online']||!![];this[_0x21a1('0x9')]=_0x4e4574[_0x21a1('0x9')]||![];this[_0x21a1('0xa')]=_0x4e4574[_0x21a1('0xa')]||![];this[_0x21a1('0xb')]=_0x4e4574[_0x21a1('0xb')]||![];this['faxPause']=_0x4e4574[_0x21a1('0xc')]||![];this[_0x21a1('0xd')]=_0x4e4574[_0x21a1('0xd')]||![];this[_0x21a1('0xe')]=_0x4e4574[_0x21a1('0xe')]||![];this[_0x21a1('0xf')]=_0x21a1('0x10');this[_0x21a1('0x11')]=0x0;this['chatCapacity']=_0x4e4574['chatCapacity']||0x0;this[_0x21a1('0x12')]=0x0;this['mailStatus']=_0x21a1('0x10');this[_0x21a1('0x13')]=0x0;this[_0x21a1('0x14')]=_0x4e4574[_0x21a1('0x14')]||0x0;this[_0x21a1('0x15')]=0x0;this[_0x21a1('0x16')]='unknown';this[_0x21a1('0x17')]=0x0;this['faxCapacity']=_0x4e4574['faxCapacity']||0x0;this[_0x21a1('0x18')]=0x0;this[_0x21a1('0x19')]='unknown';this['smsStatusTime']=0x0;this[_0x21a1('0x1a')]=_0x4e4574[_0x21a1('0x1a')]||0x0;this[_0x21a1('0x1b')]=0x0;this[_0x21a1('0x1c')]=_0x21a1('0x10');this[_0x21a1('0x1d')]=0x0;this['whatsappCapacity']=_0x4e4574[_0x21a1('0x1e')]||0x0;this[_0x21a1('0x1f')]=0x0;this['openchannelStatus']='unknown';this[_0x21a1('0x20')]=0x0;this[_0x21a1('0x21')]=_0x4e4574[_0x21a1('0x21')]||0x0;this[_0x21a1('0x22')]=0x0;this[_0x21a1('0x23')]=![];this[_0x21a1('0x24')]=undefined;this[_0x21a1('0x2')]='';this[_0x21a1('0x25')]={};this[_0x21a1('0x26')]={};this[_0x21a1('0x27')]={};this[_0x21a1('0x28')]={};this[_0x21a1('0x29')]={};this[_0x21a1('0x2a')]={};this[_0x21a1('0x2b')]();}Agent[_0x21a1('0x2c')]['getChannelStatus']=function(_0x3bd849){if(this[_0x3bd849+_0x21a1('0x2d')]>0x0){if(this[_0x3bd849+'Capacity']>0x0&&this[_0x3bd849+'CurrentCapacity']>=this[_0x3bd849+_0x21a1('0x2e')]){return _0x21a1('0x2f');}else{return _0x21a1('0x30');}}else{return _0x21a1('0x31');}};Agent[_0x21a1('0x2c')]['updateRealtime']=function(){var _0x464376=['mail',_0x21a1('0x32'),_0x21a1('0x33'),'fax',_0x21a1('0x34'),_0x21a1('0x35')];for(var _0x439511=0x0;_0x439511<_0x464376[_0x21a1('0x36')];_0x439511+=0x1){var _0x248ad9=this['getChannelStatus'](_0x464376[_0x439511]);if(this[_0x464376[_0x439511]+'Status']!==_0x248ad9){this[_0x464376[_0x439511]+_0x21a1('0x37')]=_['toNumber'](moment()['format']('x'));}this[_0x464376[_0x439511]+_0x21a1('0x38')]=_0x248ad9;}var _0x247ad8={'id':this['id'],'name':this[_0x21a1('0x7')],'online':this['online'],'voicePause':this[_0x21a1('0x9')],'chatPause':this[_0x21a1('0xa')],'mailPause':this[_0x21a1('0xb')],'smsPause':this[_0x21a1('0xd')],'faxPause':this[_0x21a1('0xc')],'openchannelPause':this[_0x21a1('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x21a1('0x12')],'mailStatus':this[_0x21a1('0x39')],'mailStatusTime':this[_0x21a1('0x13')],'mailCapacity':this[_0x21a1('0x14')],'mailCurrentCapacity':this[_0x21a1('0x15')],'faxStatus':this[_0x21a1('0x16')],'faxStatusTime':this[_0x21a1('0x17')],'faxCapacity':this[_0x21a1('0x3a')],'faxCurrentCapacity':this[_0x21a1('0x18')],'smsStatus':this[_0x21a1('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x21a1('0x1a')],'smsCurrentCapacity':this[_0x21a1('0x1b')],'whatsappStatus':this[_0x21a1('0x1c')],'whatsappStatusTime':this[_0x21a1('0x1d')],'whatsappCapacity':this[_0x21a1('0x1e')],'whatsappCurrentCapacity':this[_0x21a1('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x21a1('0x21')],'openchannelCurrentCapacity':this[_0x21a1('0x22')],'busy':this[_0x21a1('0x23')],'busyQueue':this[_0x21a1('0x24')],'chatWaitingInteractions':this[_0x21a1('0x25')],'faxWaitingInteractions':this[_0x21a1('0x26')],'mailWaitingInteractions':this[_0x21a1('0x27')],'openchannelWaitingInteractions':this[_0x21a1('0x28')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0x21a1('0x2a')]};var _0x4da854=md5(JSON['stringify'](_0x247ad8));if(this[_0x21a1('0x2')]!==_0x4da854){this[_0x21a1('0x2')]=_0x4da854;io[_0x21a1('0x3b')](_0x21a1('0x3c'),_0x247ad8);}};module[_0x21a1('0x3d')]=Agent; \ No newline at end of file +var _0x19c3=['mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','updateRealtime','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','prototype','mail','chat','openchannel','sms','whatsapp','length','Status','StatusTime','format','online','chatStatus','mailStatus','mailStatusTime','whatsappStatusTime','openchannelWaitingInteractions','whatsappWaitingInteractions','stringify','md5','emit','user:save','exports','lodash','moment','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailCapacity'];(function(_0x110ddb,_0x52c82e){var _0x2fa7e5=function(_0x30c6c3){while(--_0x30c6c3){_0x110ddb['push'](_0x110ddb['shift']());}};_0x2fa7e5(++_0x52c82e);}(_0x19c3,0x75));var _0x319c=function(_0x29b645,_0x588989){_0x29b645=_0x29b645-0x0;var _0x46b57f=_0x19c3[_0x29b645];return _0x46b57f;};'use strict';var _=require(_0x319c('0x0'));var moment=require(_0x319c('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x319c('0x2'));config['redis']=_[_0x319c('0x3')](config['redis'],{'host':_0x319c('0x4'),'port':0x18eb});var io=require(_0x319c('0x5'))(new Redis(config[_0x319c('0x6')]));function Agent(_0x1d633c){this['id']=_0x1d633c['id']||0x0;this['name']=_0x1d633c[_0x319c('0x7')]||'';this['online']=_0x1d633c['online']||!![];this[_0x319c('0x8')]=_0x1d633c[_0x319c('0x8')]||![];this[_0x319c('0x9')]=_0x1d633c[_0x319c('0x9')]||![];this[_0x319c('0xa')]=_0x1d633c[_0x319c('0xa')]||![];this[_0x319c('0xb')]=_0x1d633c['faxPause']||![];this['smsPause']=_0x1d633c[_0x319c('0xc')]||![];this[_0x319c('0xd')]=_0x1d633c[_0x319c('0xd')]||![];this['chatStatus']=_0x319c('0xe');this[_0x319c('0xf')]=0x0;this[_0x319c('0x10')]=_0x1d633c[_0x319c('0x10')]||0x0;this[_0x319c('0x11')]=0x0;this['mailStatus']=_0x319c('0xe');this['mailStatusTime']=0x0;this[_0x319c('0x12')]=_0x1d633c[_0x319c('0x12')]||0x0;this[_0x319c('0x13')]=0x0;this[_0x319c('0x14')]=_0x319c('0xe');this[_0x319c('0x15')]=0x0;this[_0x319c('0x16')]=_0x1d633c['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0x319c('0x17')]=_0x319c('0xe');this[_0x319c('0x18')]=0x0;this[_0x319c('0x19')]=_0x1d633c[_0x319c('0x19')]||0x0;this[_0x319c('0x1a')]=0x0;this[_0x319c('0x1b')]=_0x319c('0xe');this['whatsappStatusTime']=0x0;this[_0x319c('0x1c')]=_0x1d633c['whatsappCapacity']||0x0;this[_0x319c('0x1d')]=0x0;this[_0x319c('0x1e')]='unknown';this[_0x319c('0x1f')]=0x0;this['openchannelCapacity']=_0x1d633c[_0x319c('0x20')]||0x0;this[_0x319c('0x21')]=0x0;this[_0x319c('0x22')]=![];this[_0x319c('0x23')]=undefined;this['md5']='';this[_0x319c('0x24')]={};this[_0x319c('0x25')]={};this[_0x319c('0x26')]={};this['openchannelWaitingInteractions']={};this[_0x319c('0x27')]={};this['whatsappWaitingInteractions']={};this[_0x319c('0x28')]();}Agent['prototype'][_0x319c('0x29')]=function(_0x2789de){if(this[_0x2789de+'CurrentCapacity']>0x0){if(this[_0x2789de+_0x319c('0x2a')]>0x0&&this[_0x2789de+_0x319c('0x2b')]>=this[_0x2789de+'Capacity']){return _0x319c('0x2c');}else{return _0x319c('0x2d');}}else{return'idle';}};Agent[_0x319c('0x2e')][_0x319c('0x28')]=function(){var _0x52525b=[_0x319c('0x2f'),_0x319c('0x30'),_0x319c('0x31'),'fax',_0x319c('0x32'),_0x319c('0x33')];for(var _0x2a0330=0x0;_0x2a0330<_0x52525b[_0x319c('0x34')];_0x2a0330+=0x1){var _0x49cdc6=this['getChannelStatus'](_0x52525b[_0x2a0330]);if(this[_0x52525b[_0x2a0330]+_0x319c('0x35')]!==_0x49cdc6){this[_0x52525b[_0x2a0330]+_0x319c('0x36')]=_['toNumber'](moment()[_0x319c('0x37')]('x'));}this[_0x52525b[_0x2a0330]+'Status']=_0x49cdc6;}var _0x8c43a5={'id':this['id'],'name':this[_0x319c('0x7')],'online':this[_0x319c('0x38')],'voicePause':this['voicePause'],'chatPause':this[_0x319c('0x9')],'mailPause':this[_0x319c('0xa')],'smsPause':this[_0x319c('0xc')],'faxPause':this[_0x319c('0xb')],'openchannelPause':this[_0x319c('0xd')],'chatStatus':this[_0x319c('0x39')],'chatStatusTime':this[_0x319c('0xf')],'chatCapacity':this[_0x319c('0x10')],'chatCurrentCapacity':this[_0x319c('0x11')],'mailStatus':this[_0x319c('0x3a')],'mailStatusTime':this[_0x319c('0x3b')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x319c('0x13')],'faxStatus':this[_0x319c('0x14')],'faxStatusTime':this[_0x319c('0x15')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x319c('0x17')],'smsStatusTime':this[_0x319c('0x18')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x319c('0x1b')],'whatsappStatusTime':this[_0x319c('0x3c')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x319c('0x1d')],'openchannelStatus':this[_0x319c('0x1e')],'openchannelStatusTime':this[_0x319c('0x1f')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x319c('0x23')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x319c('0x25')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0x319c('0x3d')],'smsWaitingInteractions':this[_0x319c('0x27')],'whatsappWaitingInteractions':this[_0x319c('0x3e')]};var _0x12e85c=md5(JSON[_0x319c('0x3f')](_0x8c43a5));if(this[_0x319c('0x40')]!==_0x12e85c){this[_0x319c('0x40')]=_0x12e85c;io[_0x319c('0x41')](_0x319c('0x42'),_0x8c43a5);}};module[_0x319c('0x43')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index c91ee1e..27ceac7 100644 --- a/server/services/routing/model/chatQueue.js +++ b/server/services/routing/model/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0148=['length','online','chatPause','available','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused'];(function(_0x5cb2fe,_0x5fca5f){var _0x4ce860=function(_0x5474f9){while(--_0x5474f9){_0x5cb2fe['push'](_0x5cb2fe['shift']());}};_0x4ce860(++_0x5fca5f);}(_0x0148,0x1d9));var _0x8014=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x0148[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x8014('0x0'));var md5=require(_0x8014('0x1'));var util=require(_0x8014('0x2'));var Redis=require(_0x8014('0x3'));var config=require(_0x8014('0x4'));config[_0x8014('0x5')]=_[_0x8014('0x6')](config['redis'],{'host':_0x8014('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x3ae205){this['id']=_0x3ae205['id']||0x0;this[_0x8014('0x8')]=_0x3ae205[_0x8014('0x8')]||'';this[_0x8014('0x9')]=_0x3ae205[_0x8014('0x9')]||0xa;this[_0x8014('0xa')]=_0x3ae205[_0x8014('0xa')]||_0x8014('0xb');this[_0x8014('0xc')]=_0x3ae205[_0x8014('0xc')];this[_0x8014('0xd')]={};this['waiting']=0x0;this[_0x8014('0x1')]='';this[_0x8014('0xe')]();this[_0x8014('0xf')]();}ChatQueue[_0x8014('0x10')][_0x8014('0xe')]=function(){var _0x2938e5=this[_0x8014('0xd')]['_rr'];this[_0x8014('0xd')]=_['map'](this['Agents'],'id');this[_0x8014('0xd')][_0x8014('0x11')]=_0x2938e5;};ChatQueue[_0x8014('0x10')][_0x8014('0xf')]=function(){this[_0x8014('0x12')]=0x0;this[_0x8014('0x13')]=0x0;for(var _0x36deb0=0x0;_0x36deb0=0x0?this[_0x8014('0x17')]:0x0;var _0x246bcf={'id':this['id'],'available':this[_0x8014('0x17')],'loggedIn':this[_0x8014('0x12')],'name':this[_0x8014('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x33506a=md5(JSON['stringify'](_0x246bcf));if(this[_0x8014('0x1')]!==_0x33506a){this['md5']=_0x33506a;io['to'](util[_0x8014('0x18')](_0x8014('0x19'),_0x246bcf[_0x8014('0x8')]))[_0x8014('0x1a')](_0x8014('0x1b'),_0x246bcf);}};module[_0x8014('0x1c')]=ChatQueue; \ No newline at end of file +var _0x3d3c=['chatPause','paused','available','stringify','format','emit','chat_queue:save','exports','lodash','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','online'];(function(_0x265055,_0x156dbc){var _0x6dc78a=function(_0x16c1e5){while(--_0x16c1e5){_0x265055['push'](_0x265055['shift']());}};_0x6dc78a(++_0x156dbc);}(_0x3d3c,0x1ac));var _0xc3d3=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x3d3c[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xc3d3('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xc3d3('0x1'));var config=require('../../../config/environment');config[_0xc3d3('0x2')]=_[_0xc3d3('0x3')](config['redis'],{'host':_0xc3d3('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc3d3('0x2')]));function ChatQueue(_0x92567f){this['id']=_0x92567f['id']||0x0;this[_0xc3d3('0x5')]=_0x92567f[_0xc3d3('0x5')]||'';this[_0xc3d3('0x6')]=_0x92567f[_0xc3d3('0x6')]||0xa;this[_0xc3d3('0x7')]=_0x92567f['strategy']||_0xc3d3('0x8');this[_0xc3d3('0x9')]=_0x92567f[_0xc3d3('0x9')];this[_0xc3d3('0xa')]={};this[_0xc3d3('0xb')]=0x0;this[_0xc3d3('0xc')]='';this[_0xc3d3('0xd')]();this[_0xc3d3('0xe')]();}ChatQueue[_0xc3d3('0xf')][_0xc3d3('0xd')]=function(){var _0x13553a=this[_0xc3d3('0xa')]['_rr'];this[_0xc3d3('0xa')]=_[_0xc3d3('0x10')](this[_0xc3d3('0x9')],'id');this[_0xc3d3('0xa')][_0xc3d3('0x11')]=_0x13553a;};ChatQueue['prototype'][_0xc3d3('0xe')]=function(){this[_0xc3d3('0x12')]=0x0;this['paused']=0x0;for(var _0x2ba82e=0x0;_0x2ba82e=0x0?this[_0xc3d3('0x16')]:0x0;var _0xdade64={'id':this['id'],'available':this[_0xc3d3('0x16')],'loggedIn':this[_0xc3d3('0x12')],'name':this['name'],'paused':this[_0xc3d3('0x15')],'waiting':this['waiting']};var _0x30fa73=md5(JSON[_0xc3d3('0x17')](_0xdade64));if(this[_0xc3d3('0xc')]!==_0x30fa73){this[_0xc3d3('0xc')]=_0x30fa73;io['to'](util[_0xc3d3('0x18')]('chat:queue:%s',_0xdade64[_0xc3d3('0x5')]))[_0xc3d3('0x19')](_0xc3d3('0x1a'),_0xdade64);}};module[_0xc3d3('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index b03bf1c..c07fc78 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f6e=['faxPause','available','stringify','format','emit','fax_queue:save','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','loggedIn','paused','length','online'];(function(_0x37064f,_0x1d70e0){var _0x276426=function(_0x131752){while(--_0x131752){_0x37064f['push'](_0x37064f['shift']());}};_0x276426(++_0x1d70e0);}(_0x7f6e,0x114));var _0xe7f6=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x7f6e[_0x50007c];return _0x5c1ec7;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xe7f6('0x0'));var Redis=require(_0xe7f6('0x1'));var config=require(_0xe7f6('0x2'));config[_0xe7f6('0x3')]=_[_0xe7f6('0x4')](config['redis'],{'host':_0xe7f6('0x5'),'port':0x18eb});var io=require(_0xe7f6('0x6'))(new Redis(config[_0xe7f6('0x3')]));function FaxQueue(_0x232ad3){this['id']=_0x232ad3['id']||0x0;this[_0xe7f6('0x7')]=_0x232ad3[_0xe7f6('0x7')]||'';this[_0xe7f6('0x8')]=_0x232ad3[_0xe7f6('0x8')]||0xa;this[_0xe7f6('0x9')]=_0x232ad3['strategy']||'beepall';this[_0xe7f6('0xa')]=_0x232ad3[_0xe7f6('0xa')];this[_0xe7f6('0xb')]={};this[_0xe7f6('0xc')]=0x0;this[_0xe7f6('0xd')]='';this[_0xe7f6('0xe')]();this[_0xe7f6('0xf')]();}FaxQueue['prototype'][_0xe7f6('0xe')]=function(){var _0x3e002e=this[_0xe7f6('0xb')][_0xe7f6('0x10')];this['mapAgentsId']=_['map'](this[_0xe7f6('0xa')],'id');this['mapAgentsId'][_0xe7f6('0x10')]=_0x3e002e;};FaxQueue['prototype']['updateRealtime']=function(){this[_0xe7f6('0x11')]=0x0;this[_0xe7f6('0x12')]=0x0;for(var _0x4e6595=0x0;_0x4e6595=0x0?this[_0xe7f6('0x16')]:0x0;var _0x479168={'id':this['id'],'available':this[_0xe7f6('0x16')],'loggedIn':this[_0xe7f6('0x11')],'name':this[_0xe7f6('0x7')],'paused':this[_0xe7f6('0x12')],'waiting':this[_0xe7f6('0xc')]};var _0x476137=md5(JSON[_0xe7f6('0x17')](_0x479168));if(this[_0xe7f6('0xd')]!==_0x476137){this['md5']=_0x476137;io['to'](util[_0xe7f6('0x18')]('fax:queue:%s',_0x479168[_0xe7f6('0x7')]))[_0xe7f6('0x19')](_0xe7f6('0x1a'),_0x479168);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x9ec8=['name','format','fax:queue:%s','emit','fax_queue:save','md5','../../../config/environment','defaults','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','prototype','updateRouting','mapAgentsId','map','_rr','loggedIn','paused','length','online','available'];(function(_0x5679cd,_0x5dc7a5){var _0x308a2e=function(_0x761822){while(--_0x761822){_0x5679cd['push'](_0x5679cd['shift']());}};_0x308a2e(++_0x5dc7a5);}(_0x9ec8,0x6d));var _0x89ec=function(_0x5f2203,_0x41f4b1){_0x5f2203=_0x5f2203-0x0;var _0x2c4f42=_0x9ec8[_0x5f2203];return _0x2c4f42;};'use strict';var _=require('lodash');var md5=require(_0x89ec('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x89ec('0x1'));config['redis']=_[_0x89ec('0x2')](config[_0x89ec('0x3')],{'host':_0x89ec('0x4'),'port':0x18eb});var io=require(_0x89ec('0x5'))(new Redis(config['redis']));function FaxQueue(_0x119362){this['id']=_0x119362['id']||0x0;this['name']=_0x119362['name']||'';this[_0x89ec('0x6')]=_0x119362['timeout']||0xa;this[_0x89ec('0x7')]=_0x119362[_0x89ec('0x7')]||_0x89ec('0x8');this[_0x89ec('0x9')]=_0x119362[_0x89ec('0x9')];this['mapAgentsId']={};this[_0x89ec('0xa')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x89ec('0xb')][_0x89ec('0xc')]=function(){var _0x513b92=this[_0x89ec('0xd')]['_rr'];this[_0x89ec('0xd')]=_[_0x89ec('0xe')](this[_0x89ec('0x9')],'id');this['mapAgentsId'][_0x89ec('0xf')]=_0x513b92;};FaxQueue[_0x89ec('0xb')]['updateRealtime']=function(){this[_0x89ec('0x10')]=0x0;this[_0x89ec('0x11')]=0x0;for(var _0x1982f8=0x0;_0x1982f8=0x0?this[_0x89ec('0x14')]:0x0;var _0x5493ac={'id':this['id'],'available':this[_0x89ec('0x14')],'loggedIn':this[_0x89ec('0x10')],'name':this[_0x89ec('0x15')],'paused':this[_0x89ec('0x11')],'waiting':this['waiting']};var _0x448812=md5(JSON['stringify'](_0x5493ac));if(this[_0x89ec('0x0')]!==_0x448812){this[_0x89ec('0x0')]=_0x448812;io['to'](util[_0x89ec('0x16')](_0x89ec('0x17'),_0x5493ac[_0x89ec('0x15')]))[_0x89ec('0x18')](_0x89ec('0x19'),_0x5493ac);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 477ce4f..57d0674 100644 --- a/server/services/routing/model/interval.js +++ b/server/services/routing/model/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79fb=['Intervals','name'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x79fb,0x15f));var _0xb79f=function(_0x121bf9,_0x6d6a1a){_0x121bf9=_0x121bf9-0x0;var _0x33e68f=_0x79fb[_0x121bf9];return _0x33e68f;};'use strict';function Interval(_0x50cb1){this['id']=_0x50cb1['id']||0x0;this['name']=_0x50cb1[_0xb79f('0x0')]||'';this[_0xb79f('0x1')]=_0x50cb1['Intervals']||{};}module['exports']=Interval; \ No newline at end of file +var _0xd623=['Intervals','exports'];(function(_0x33bb4f,_0x28ad88){var _0x5e0f07=function(_0x544eb2){while(--_0x544eb2){_0x33bb4f['push'](_0x33bb4f['shift']());}};_0x5e0f07(++_0x28ad88);}(_0xd623,0xea));var _0x3d62=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xd623[_0x2c7618];return _0x5ce3f0;};'use strict';function Interval(_0x5ab4e0){this['id']=_0x5ab4e0['id']||0x0;this['name']=_0x5ab4e0['name']||'';this[_0x3d62('0x0')]=_0x5ab4e0[_0x3d62('0x0')]||{};}module[_0x3d62('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 2657721..d8537c4 100644 --- a/server/services/routing/model/mailQueue.js +++ b/server/services/routing/model/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6267=['loggedIn','mailPause','available','format','mail:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','paused','length','online'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6267,0x163));var _0x7626=function(_0x240d70,_0x51a60f){_0x240d70=_0x240d70-0x0;var _0x13bf0f=_0x6267[_0x240d70];return _0x13bf0f;};'use strict';var _=require(_0x7626('0x0'));var md5=require(_0x7626('0x1'));var util=require(_0x7626('0x2'));var Redis=require(_0x7626('0x3'));var config=require(_0x7626('0x4'));config[_0x7626('0x5')]=_[_0x7626('0x6')](config['redis'],{'host':_0x7626('0x7'),'port':0x18eb});var io=require(_0x7626('0x8'))(new Redis(config['redis']));function MailQueue(_0x66f09d){this['id']=_0x66f09d['id']||0x0;this['name']=_0x66f09d[_0x7626('0x9')]||'';this['timeout']=_0x66f09d['timeout']||0xa;this['strategy']=_0x66f09d[_0x7626('0xa')]||_0x7626('0xb');this[_0x7626('0xc')]=_0x66f09d[_0x7626('0xc')];this['mapAgentsId']={};this[_0x7626('0xd')]=0x0;this[_0x7626('0x1')]='';this[_0x7626('0xe')]();this['updateRealtime']();}MailQueue[_0x7626('0xf')][_0x7626('0xe')]=function(){var _0x3521a8=this[_0x7626('0x10')][_0x7626('0x11')];this[_0x7626('0x10')]=_[_0x7626('0x12')](this['Agents'],'id');this['mapAgentsId'][_0x7626('0x11')]=_0x3521a8;};MailQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x7626('0x13')]=0x0;for(var _0x45f8bc=0x0;_0x45f8bc=0x0?this[_0x7626('0x18')]:0x0;var _0x1f982d={'id':this['id'],'available':this[_0x7626('0x18')],'loggedIn':this[_0x7626('0x16')],'name':this[_0x7626('0x9')],'paused':this[_0x7626('0x13')],'waiting':this[_0x7626('0xd')]};var _0x580eef=md5(JSON['stringify'](_0x1f982d));if(this['md5']!==_0x580eef){this['md5']=_0x580eef;io['to'](util[_0x7626('0x19')](_0x7626('0x1a'),_0x1f982d['name']))[_0x7626('0x1b')]('mail_queue:save',_0x1f982d);}};module[_0x7626('0x1c')]=MailQueue; \ No newline at end of file +var _0x20b1=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','loggedIn','paused','length','online','mailPause','available','stringify','format','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults'];(function(_0x5059ff,_0x564bbc){var _0x585146=function(_0x51bae9){while(--_0x51bae9){_0x5059ff['push'](_0x5059ff['shift']());}};_0x585146(++_0x564bbc);}(_0x20b1,0x1db));var _0x120b=function(_0x544186,_0x4ac13a){_0x544186=_0x544186-0x0;var _0x99b00a=_0x20b1[_0x544186];return _0x99b00a;};'use strict';var _=require(_0x120b('0x0'));var md5=require(_0x120b('0x1'));var util=require('util');var Redis=require(_0x120b('0x2'));var config=require(_0x120b('0x3'));config['redis']=_[_0x120b('0x4')](config[_0x120b('0x5')],{'host':_0x120b('0x6'),'port':0x18eb});var io=require(_0x120b('0x7'))(new Redis(config[_0x120b('0x5')]));function MailQueue(_0x10827e){this['id']=_0x10827e['id']||0x0;this[_0x120b('0x8')]=_0x10827e[_0x120b('0x8')]||'';this[_0x120b('0x9')]=_0x10827e['timeout']||0xa;this[_0x120b('0xa')]=_0x10827e[_0x120b('0xa')]||_0x120b('0xb');this[_0x120b('0xc')]=_0x10827e[_0x120b('0xc')];this[_0x120b('0xd')]={};this[_0x120b('0xe')]=0x0;this['md5']='';this[_0x120b('0xf')]();this['updateRealtime']();}MailQueue['prototype'][_0x120b('0xf')]=function(){var _0x165b75=this[_0x120b('0xd')][_0x120b('0x10')];this[_0x120b('0xd')]=_['map'](this[_0x120b('0xc')],'id');this['mapAgentsId'][_0x120b('0x10')]=_0x165b75;};MailQueue[_0x120b('0x11')][_0x120b('0x12')]=function(){this[_0x120b('0x13')]=0x0;this[_0x120b('0x14')]=0x0;for(var _0x1d9b8b=0x0;_0x1d9b8b=0x0?this[_0x120b('0x18')]:0x0;var _0x52564e={'id':this['id'],'available':this[_0x120b('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x120b('0x8')],'paused':this['paused'],'waiting':this[_0x120b('0xe')]};var _0x17f0e1=md5(JSON[_0x120b('0x19')](_0x52564e));if(this['md5']!==_0x17f0e1){this[_0x120b('0x1')]=_0x17f0e1;io['to'](util[_0x120b('0x1a')]('mail:queue:%s',_0x52564e[_0x120b('0x8')]))[_0x120b('0x1b')](_0x120b('0x1c'),_0x52564e);}};module[_0x120b('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 2e64946..602d409 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x3ed7ff,_0xf3f180){var _0x300239=function(_0x1a39c8){while(--_0x1a39c8){_0x3ed7ff['push'](_0x3ed7ff['shift']());}};_0x300239(++_0xf3f180);}(_0x814b,0x1a2));var _0xb814=function(_0x3e1829,_0xc8ccda){_0x3e1829=_0x3e1829-0x0;var _0x129345=_0x814b[_0x3e1829];return _0x129345;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0xe6f4ef,_0x4e34cc){var _0x4f3447=function(_0x1538ff){while(--_0x1538ff){_0xe6f4ef['push'](_0xe6f4ef['shift']());}};_0x4f3447(++_0x4e34cc);}(_0xadb5,0xad));var _0x5adb=function(_0x5a3eaf,_0x18c9e0){_0x5a3eaf=_0x5a3eaf-0x0;var _0xab5e8c=_0xadb5[_0x5a3eaf];return _0xab5e8c;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index f2e50c2..f1a4495 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ab0=['Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','smsPause','available','waiting','stringify','format','emit','sms_queue:save','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x268dc9,_0xd3b345){var _0x4cb743=function(_0x32f5e4){while(--_0x32f5e4){_0x268dc9['push'](_0x268dc9['shift']());}};_0x4cb743(++_0xd3b345);}(_0x4ab0,0xd5));var _0x04ab=function(_0x2ec555,_0x249265){_0x2ec555=_0x2ec555-0x0;var _0x3a02f8=_0x4ab0[_0x2ec555];return _0x3a02f8;};'use strict';var _=require('lodash');var md5=require(_0x04ab('0x0'));var util=require(_0x04ab('0x1'));var Redis=require(_0x04ab('0x2'));var config=require(_0x04ab('0x3'));config[_0x04ab('0x4')]=_['defaults'](config['redis'],{'host':_0x04ab('0x5'),'port':0x18eb});var io=require(_0x04ab('0x6'))(new Redis(config['redis']));function SmsQueue(_0xfe58ca){this['id']=_0xfe58ca['id']||0x0;this[_0x04ab('0x7')]=_0xfe58ca['name']||'';this[_0x04ab('0x8')]=_0xfe58ca[_0x04ab('0x8')]||0xa;this[_0x04ab('0x9')]=_0xfe58ca['strategy']||_0x04ab('0xa');this[_0x04ab('0xb')]=_0xfe58ca[_0x04ab('0xb')];this[_0x04ab('0xc')]={};this['waiting']=0x0;this[_0x04ab('0x0')]='';this[_0x04ab('0xd')]();this[_0x04ab('0xe')]();}SmsQueue[_0x04ab('0xf')]['updateRouting']=function(){var _0x3f91fe=this[_0x04ab('0xc')][_0x04ab('0x10')];this[_0x04ab('0xc')]=_[_0x04ab('0x11')](this[_0x04ab('0xb')],'id');this['mapAgentsId'][_0x04ab('0x10')]=_0x3f91fe;};SmsQueue['prototype'][_0x04ab('0xe')]=function(){this[_0x04ab('0x12')]=0x0;this[_0x04ab('0x13')]=0x0;for(var _0x428798=0x0;_0x428798=0x0?this['available']:0x0;var _0x45c328={'id':this['id'],'available':this[_0x04ab('0x16')],'loggedIn':this[_0x04ab('0x12')],'name':this[_0x04ab('0x7')],'paused':this[_0x04ab('0x13')],'waiting':this[_0x04ab('0x17')]};var _0x32c2bb=md5(JSON[_0x04ab('0x18')](_0x45c328));if(this[_0x04ab('0x0')]!==_0x32c2bb){this['md5']=_0x32c2bb;io['to'](util[_0x04ab('0x19')]('sms:queue:%s',_0x45c328[_0x04ab('0x7')]))[_0x04ab('0x1a')](_0x04ab('0x1b'),_0x45c328);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xed95=['stringify','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','loggedIn','paused','length','available','name'];(function(_0x1ae250,_0xf9b815){var _0x2cd60f=function(_0x27214a){while(--_0x27214a){_0x1ae250['push'](_0x1ae250['shift']());}};_0x2cd60f(++_0xf9b815);}(_0xed95,0xb9));var _0x5ed9=function(_0x5e4980,_0x691712){_0x5e4980=_0x5e4980-0x0;var _0x55d652=_0xed95[_0x5e4980];return _0x55d652;};'use strict';var _=require(_0x5ed9('0x0'));var md5=require(_0x5ed9('0x1'));var util=require(_0x5ed9('0x2'));var Redis=require(_0x5ed9('0x3'));var config=require(_0x5ed9('0x4'));config[_0x5ed9('0x5')]=_[_0x5ed9('0x6')](config[_0x5ed9('0x5')],{'host':_0x5ed9('0x7'),'port':0x18eb});var io=require(_0x5ed9('0x8'))(new Redis(config[_0x5ed9('0x5')]));function SmsQueue(_0x15b734){this['id']=_0x15b734['id']||0x0;this['name']=_0x15b734['name']||'';this[_0x5ed9('0x9')]=_0x15b734[_0x5ed9('0x9')]||0xa;this[_0x5ed9('0xa')]=_0x15b734[_0x5ed9('0xa')]||_0x5ed9('0xb');this[_0x5ed9('0xc')]=_0x15b734['Agents'];this['mapAgentsId']={};this[_0x5ed9('0xd')]=0x0;this[_0x5ed9('0x1')]='';this[_0x5ed9('0xe')]();this[_0x5ed9('0xf')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x28e087=this[_0x5ed9('0x10')][_0x5ed9('0x11')];this[_0x5ed9('0x10')]=_['map'](this[_0x5ed9('0xc')],'id');this[_0x5ed9('0x10')][_0x5ed9('0x11')]=_0x28e087;};SmsQueue['prototype']['updateRealtime']=function(){this[_0x5ed9('0x12')]=0x0;this[_0x5ed9('0x13')]=0x0;for(var _0x5e952c=0x0;_0x5e952c=0x0?this['available']:0x0;var _0x5a3ac1={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5ed9('0x12')],'name':this[_0x5ed9('0x16')],'paused':this[_0x5ed9('0x13')],'waiting':this[_0x5ed9('0xd')]};var _0x4b510b=md5(JSON[_0x5ed9('0x17')](_0x5a3ac1));if(this[_0x5ed9('0x1')]!==_0x4b510b){this['md5']=_0x4b510b;io['to'](util['format']('sms:queue:%s',_0x5a3ac1[_0x5ed9('0x16')]))[_0x5ed9('0x18')]('sms_queue:save',_0x5a3ac1);}};module[_0x5ed9('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 8634f9d..09d377f 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6ea=['ioredis','../../../config/environment','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','online','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','lodash','md5','util'];(function(_0x456032,_0x1a799d){var _0x1a53cd=function(_0x162cc8){while(--_0x162cc8){_0x456032['push'](_0x456032['shift']());}};_0x1a53cd(++_0x1a799d);}(_0xa6ea,0xe7));var _0xaa6e=function(_0x4c14e1,_0x4cd805){_0x4c14e1=_0x4c14e1-0x0;var _0x225172=_0xa6ea[_0x4c14e1];return _0x225172;};'use strict';var _=require(_0xaa6e('0x0'));var md5=require(_0xaa6e('0x1'));var util=require(_0xaa6e('0x2'));var Redis=require(_0xaa6e('0x3'));var config=require(_0xaa6e('0x4'));config['redis']=_['defaults'](config[_0xaa6e('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaa6e('0x5')]));function WhatsappQueue(_0x406450){this['id']=_0x406450['id']||0x0;this[_0xaa6e('0x6')]=_0x406450['name']||'';this[_0xaa6e('0x7')]=_0x406450[_0xaa6e('0x7')]||0xa;this[_0xaa6e('0x8')]=_0x406450[_0xaa6e('0x8')]||'beepall';this[_0xaa6e('0x9')]=_0x406450['Agents'];this[_0xaa6e('0xa')]={};this[_0xaa6e('0xb')]=0x0;this[_0xaa6e('0x1')]='';this[_0xaa6e('0xc')]();this['updateRealtime']();}WhatsappQueue[_0xaa6e('0xd')][_0xaa6e('0xc')]=function(){var _0x39f111=this[_0xaa6e('0xa')][_0xaa6e('0xe')];this[_0xaa6e('0xa')]=_[_0xaa6e('0xf')](this[_0xaa6e('0x9')],'id');this[_0xaa6e('0xa')][_0xaa6e('0xe')]=_0x39f111;};WhatsappQueue['prototype'][_0xaa6e('0x10')]=function(){this[_0xaa6e('0x11')]=0x0;this['paused']=0x0;for(var _0x5775ad=0x0;_0x5775ad=0x0?this[_0xaa6e('0x15')]:0x0;var _0x15f530={'id':this['id'],'available':this[_0xaa6e('0x15')],'loggedIn':this[_0xaa6e('0x11')],'name':this[_0xaa6e('0x6')],'paused':this[_0xaa6e('0x14')],'waiting':this['waiting']};var _0x2166fb=md5(JSON[_0xaa6e('0x16')](_0x15f530));if(this[_0xaa6e('0x1')]!==_0x2166fb){this[_0xaa6e('0x1')]=_0x2166fb;io['to'](util[_0xaa6e('0x17')](_0xaa6e('0x18'),_0x15f530['name']))['emit'](_0xaa6e('0x19'),_0x15f530);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x80d2=['_rr','map','Agents','loggedIn','paused','length','online','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','socket.io-emitter','timeout','strategy','beepall','waiting','updateRouting','updateRealtime','prototype','mapAgentsId'];(function(_0x52f73c,_0x3c9d42){var _0x2ea27a=function(_0x23d805){while(--_0x23d805){_0x52f73c['push'](_0x52f73c['shift']());}};_0x2ea27a(++_0x3c9d42);}(_0x80d2,0x14d));var _0x280d=function(_0x1e3328,_0x5a5efa){_0x1e3328=_0x1e3328-0x0;var _0x236314=_0x80d2[_0x1e3328];return _0x236314;};'use strict';var _=require(_0x280d('0x0'));var md5=require(_0x280d('0x1'));var util=require(_0x280d('0x2'));var Redis=require(_0x280d('0x3'));var config=require('../../../config/environment');config[_0x280d('0x4')]=_[_0x280d('0x5')](config[_0x280d('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x280d('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x297534){this['id']=_0x297534['id']||0x0;this['name']=_0x297534['name']||'';this[_0x280d('0x7')]=_0x297534['timeout']||0xa;this['strategy']=_0x297534[_0x280d('0x8')]||_0x280d('0x9');this['Agents']=_0x297534['Agents'];this['mapAgentsId']={};this[_0x280d('0xa')]=0x0;this[_0x280d('0x1')]='';this[_0x280d('0xb')]();this[_0x280d('0xc')]();}WhatsappQueue[_0x280d('0xd')]['updateRouting']=function(){var _0x28489b=this[_0x280d('0xe')][_0x280d('0xf')];this['mapAgentsId']=_[_0x280d('0x10')](this[_0x280d('0x11')],'id');this[_0x280d('0xe')][_0x280d('0xf')]=_0x28489b;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x280d('0x12')]=0x0;this[_0x280d('0x13')]=0x0;for(var _0x5f41c2=0x0;_0x5f41c2=0x0?this[_0x280d('0x17')]:0x0;var _0x24bf27={'id':this['id'],'available':this[_0x280d('0x17')],'loggedIn':this[_0x280d('0x12')],'name':this['name'],'paused':this[_0x280d('0x13')],'waiting':this[_0x280d('0xa')]};var _0x4278ad=md5(JSON[_0x280d('0x18')](_0x24bf27));if(this[_0x280d('0x1')]!==_0x4278ad){this[_0x280d('0x1')]=_0x4278ad;io['to'](util['format'](_0x280d('0x19'),_0x24bf27['name']))[_0x280d('0x1a')](_0x280d('0x1b'),_0x24bf27);}};module[_0x280d('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 77a1ee0..39570c4 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x102f37,_0xfc35a8){var _0x5c4882=function(_0x4a04d){while(--_0x4a04d){_0x102f37['push'](_0x102f37['shift']());}};_0x5c4882(++_0xfc35a8);}(_0xb10b,0x12a));var _0xbb10=function(_0x2aa48b,_0x5a4446){_0x2aa48b=_0x2aa48b-0x0;var _0x48caf8=_0xb10b[_0x2aa48b];return _0x48caf8;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4f92bc,_0x53a24d){var _0x2a64be=function(_0x29ad3d){while(--_0x29ad3d){_0x4f92bc['push'](_0x4f92bc['shift']());}};_0x2a64be(++_0x53a24d);}(_0xb10b,0x12a));var _0xbb10=function(_0x163157,_0x59eea5){_0x163157=_0x163157-0x0;var _0x3db535=_0xb10b[_0x163157];return _0x3db535;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 28eef06..b194424 100644 --- a/server/services/routing/rpc/chatInteraction.js +++ b/server/services/routing/rpc/chatInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5dd=['../client','update','Request','updateChatInteraction','addTagsToChatInteraction'];(function(_0x503f02,_0x402ba2){var _0x21c997=function(_0x225a3f){while(--_0x225a3f){_0x503f02['push'](_0x503f02['shift']());}};_0x21c997(++_0x402ba2);}(_0xe5dd,0xc8));var _0xde5d=function(_0x48a0dc,_0x495770){_0x48a0dc=_0x48a0dc-0x0;var _0x7446b5=_0xe5dd[_0x48a0dc];return _0x7446b5;};'use strict';var client=require(_0xde5d('0x0'));exports[_0xde5d('0x1')]=function(_0x553287,_0x1c23b5){return client[_0xde5d('0x2')]('UpdateChatInteraction',{'body':_0x1c23b5,'options':{'where':{'id':_0x553287}},'log':_0xde5d('0x3')});};exports['addTags']=function(_0x2db68a,_0x73a7ce){return client['Request']('AddTagsToChatInteraction',{'body':_0x73a7ce,'options':{'where':{'id':_0x2db68a}},'log':_0xde5d('0x4')});}; \ No newline at end of file +var _0x7744=['update','UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0x7744,0xd9));var _0x4774=function(_0x88a523,_0x4c930c){_0x88a523=_0x88a523-0x0;var _0x3deebf=_0x7744[_0x88a523];return _0x3deebf;};'use strict';var client=require('../client');exports[_0x4774('0x0')]=function(_0x5f0040,_0x45437a){return client['Request'](_0x4774('0x1'),{'body':_0x45437a,'options':{'where':{'id':_0x5f0040}},'log':_0x4774('0x2')});};exports[_0x4774('0x3')]=function(_0x582b3d,_0x38b53a){return client[_0x4774('0x4')](_0x4774('0x5'),{'body':_0x38b53a,'options':{'where':{'id':_0x582b3d}},'log':_0x4774('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 892d197..61c2be6 100644 --- a/server/services/routing/rpc/chatMessage.js +++ b/server/services/routing/rpc/chatMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2f5=['createChatMessage','../client','create','Request'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0xb2f5,0x119));var _0x5b2f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb2f5[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x5b2f('0x0'));exports[_0x5b2f('0x1')]=function(_0x57862d){return client[_0x5b2f('0x2')]('CreateChatMessage',{'body':_0x57862d,'log':_0x5b2f('0x3')});}; \ No newline at end of file +var _0x462b=['../client','create','createChatMessage'];(function(_0x1c6bb9,_0x3da46d){var _0x250a79=function(_0x52b87b){while(--_0x52b87b){_0x1c6bb9['push'](_0x1c6bb9['shift']());}};_0x250a79(++_0x3da46d);}(_0x462b,0x78));var _0xb462=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x462b[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0xb462('0x0'));exports[_0xb462('0x1')]=function(_0x52a12f){return client['Request']('CreateChatMessage',{'body':_0x52a12f,'log':_0xb462('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 7fc7ad9..9cf0aa3 100644 --- a/server/services/routing/rpc/chatQueue.js +++ b/server/services/routing/rpc/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcca7=['name','online','chatPause','../client','getChatQueues','Request','GetChatQueue','strategy','Agents'];(function(_0x4cd3c8,_0x388502){var _0x13da7e=function(_0x53c400){while(--_0x53c400){_0x4cd3c8['push'](_0x4cd3c8['shift']());}};_0x13da7e(++_0x388502);}(_0xcca7,0x1aa));var _0x7cca=function(_0x410c42,_0x12cd12){_0x410c42=_0x410c42-0x0;var _0x4c674e=_0xcca7[_0x410c42];return _0x4c674e;};'use strict';var client=require(_0x7cca('0x0'));exports[_0x7cca('0x1')]=function(){return function(){return client[_0x7cca('0x2')](_0x7cca('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x7cca('0x4')],'include':[{'model':'User','as':_0x7cca('0x5'),'attributes':['id',_0x7cca('0x6'),_0x7cca('0x7'),_0x7cca('0x8')]}]},'log':_0x7cca('0x1')});};}; \ No newline at end of file +var _0x008c=['online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','strategy','User','Agents'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x008c,0x188));var _0xc008=function(_0x226879,_0x30a56b){_0x226879=_0x226879-0x0;var _0x20964c=_0x008c[_0x226879];return _0x20964c;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(){return function(){return client[_0xc008('0x2')](_0xc008('0x3'),{'options':{'raw':![],'attributes':['id',_0xc008('0x4'),'timeout',_0xc008('0x5')],'include':[{'model':_0xc008('0x6'),'as':_0xc008('0x7'),'attributes':['id',_0xc008('0x4'),_0xc008('0x8'),_0xc008('0x9')]}]},'log':_0xc008('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 90c220b..52121fa 100644 --- a/server/services/routing/rpc/chatQueueReport.js +++ b/server/services/routing/rpc/chatQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd846=['../client','create','CreateChatQueueReport','Request','DESC'];(function(_0xb1cb46,_0x1d7849){var _0x345aea=function(_0x40fdc0){while(--_0x40fdc0){_0xb1cb46['push'](_0xb1cb46['shift']());}};_0x345aea(++_0x1d7849);}(_0xd846,0x195));var _0x6d84=function(_0x4b14e0,_0xf4c70a){_0x4b14e0=_0x4b14e0-0x0;var _0x5d42f7=_0xd846[_0x4b14e0];return _0x5d42f7;};'use strict';var client=require(_0x6d84('0x0'));exports[_0x6d84('0x1')]=function(_0x43e017){return client['Request']('CreateChatQueueReport',{'body':_0x43e017,'log':_0x6d84('0x2')});};exports['update']=function(_0x47e90f,_0x15fb0c){return client[_0x6d84('0x3')]('UpdateChatQueueReport',{'body':_0x15fb0c,'options':{'where':{'uniqueid':_0x47e90f},'order':[['id',_0x6d84('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xf257=['UpdateChatQueueReport','DESC','Request','CreateChatQueueReport'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xf257,0x82));var _0x7f25=function(_0x47b37e,_0x5afb98){_0x47b37e=_0x47b37e-0x0;var _0x1c1eb9=_0xf257[_0x47b37e];return _0x1c1eb9;};'use strict';var client=require('../client');exports['create']=function(_0x259e06){return client[_0x7f25('0x0')](_0x7f25('0x1'),{'body':_0x259e06,'log':_0x7f25('0x1')});};exports['update']=function(_0x159dd1,_0x2aca61){return client[_0x7f25('0x0')](_0x7f25('0x2'),{'body':_0x2aca61,'options':{'where':{'uniqueid':_0x159dd1},'order':[['id',_0x7f25('0x3')]],'limit':0x1},'log':_0x7f25('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 2ef7e90..15d8cc3 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x4872c9,_0x3efc87){var _0x445cc8=function(_0x316488){while(--_0x316488){_0x4872c9['push'](_0x4872c9['shift']());}};_0x445cc8(++_0x3efc87);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x7a54,0x106));var _0x47a5=function(_0x48358e,_0x5bdf26){_0x48358e=_0x48358e-0x0;var _0x54b0c4=_0x7a54[_0x48358e];return _0x54b0c4;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index eac473e..c537373 100644 --- a/server/services/routing/rpc/faxMessage.js +++ b/server/services/routing/rpc/faxMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd31=['create','CreateFaxMessage','createFaxMessage'];(function(_0x3144ea,_0x4b44e4){var _0x2ece49=function(_0x4d85da){while(--_0x4d85da){_0x3144ea['push'](_0x3144ea['shift']());}};_0x2ece49(++_0x4b44e4);}(_0xcd31,0x162));var _0x1cd3=function(_0x5badd3,_0x2f4b82){_0x5badd3=_0x5badd3-0x0;var _0x5b3848=_0xcd31[_0x5badd3];return _0x5b3848;};'use strict';var client=require('../client');exports[_0x1cd3('0x0')]=function(_0x4fb77d){return client['Request'](_0x1cd3('0x1'),{'body':_0x4fb77d,'log':_0x1cd3('0x2')});}; \ No newline at end of file +var _0xb171=['Request','CreateFaxMessage','createFaxMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb171,0xc3));var _0x1b17=function(_0x1c3bdc,_0x260648){_0x1c3bdc=_0x1c3bdc-0x0;var _0x3bbb8c=_0xb171[_0x1c3bdc];return _0x3bbb8c;};'use strict';var client=require('../client');exports[_0x1b17('0x0')]=function(_0x94018d){return client[_0x1b17('0x1')](_0x1b17('0x2'),{'body':_0x94018d,'log':_0x1b17('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9ec3628..6948723 100644 --- a/server/services/routing/rpc/faxQueue.js +++ b/server/services/routing/rpc/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x122e=['Agents','online','faxPause','../client','getFaxQueues','GetFaxQueue','name','timeout','strategy','User'];(function(_0x529fe5,_0x340ab3){var _0x3dc198=function(_0x21b6a6){while(--_0x21b6a6){_0x529fe5['push'](_0x529fe5['shift']());}};_0x3dc198(++_0x340ab3);}(_0x122e,0xf3));var _0xe122=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x122e[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xe122('0x0'));exports[_0xe122('0x1')]=function(){return function(){return client['Request'](_0xe122('0x2'),{'options':{'raw':![],'attributes':['id',_0xe122('0x3'),_0xe122('0x4'),_0xe122('0x5')],'include':[{'model':_0xe122('0x6'),'as':_0xe122('0x7'),'attributes':['id',_0xe122('0x3'),_0xe122('0x8'),_0xe122('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x33ee=['faxPause','getFaxQueues','../client','GetFaxQueue','name','timeout','strategy','Agents','online'];(function(_0x465134,_0xed60ce){var _0x39f39b=function(_0x590ff3){while(--_0x590ff3){_0x465134['push'](_0x465134['shift']());}};_0x39f39b(++_0xed60ce);}(_0x33ee,0xfe));var _0xe33e=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x33ee[_0x2b9b7f];return _0x4ed19a;};'use strict';var client=require(_0xe33e('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0xe33e('0x1'),{'options':{'raw':![],'attributes':['id',_0xe33e('0x2'),_0xe33e('0x3'),_0xe33e('0x4')],'include':[{'model':'User','as':_0xe33e('0x5'),'attributes':['id',_0xe33e('0x2'),_0xe33e('0x6'),_0xe33e('0x7')]}]},'log':_0xe33e('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index cfa3d57..70b4dc0 100644 --- a/server/services/routing/rpc/faxQueueReport.js +++ b/server/services/routing/rpc/faxQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa491=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x4d8c86,_0x591f8f){var _0x512ae3=function(_0x4d9d87){while(--_0x4d9d87){_0x4d8c86['push'](_0x4d8c86['shift']());}};_0x512ae3(++_0x591f8f);}(_0xa491,0xc6));var _0x1a49=function(_0x4e9b70,_0x5a33a4){_0x4e9b70=_0x4e9b70-0x0;var _0x4a75cf=_0xa491[_0x4e9b70];return _0x4a75cf;};'use strict';var client=require(_0x1a49('0x0'));exports[_0x1a49('0x1')]=function(_0x522f88){return client[_0x1a49('0x2')](_0x1a49('0x3'),{'body':_0x522f88,'log':_0x1a49('0x3')});};exports[_0x1a49('0x4')]=function(_0x41cf68,_0x1b3b03){return client['Request'](_0x1a49('0x5'),{'body':_0x1b3b03,'options':{'where':{'uniqueid':_0x41cf68},'order':[['id','DESC']],'limit':0x1},'log':_0x1a49('0x5')});}; \ No newline at end of file +var _0x83ea=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','../client'];(function(_0x5cb63b,_0x54bed5){var _0x4e58b6=function(_0xab13cc){while(--_0xab13cc){_0x5cb63b['push'](_0x5cb63b['shift']());}};_0x4e58b6(++_0x54bed5);}(_0x83ea,0x158));var _0xa83e=function(_0x2bfbe3,_0xee1735){_0x2bfbe3=_0x2bfbe3-0x0;var _0x32feff=_0x83ea[_0x2bfbe3];return _0x32feff;};'use strict';var client=require(_0xa83e('0x0'));exports[_0xa83e('0x1')]=function(_0x4916d3){return client[_0xa83e('0x2')](_0xa83e('0x3'),{'body':_0x4916d3,'log':_0xa83e('0x3')});};exports['update']=function(_0x38dc58,_0x47e1ac){return client[_0xa83e('0x2')]('UpdateFaxQueueReport',{'body':_0x47e1ac,'options':{'where':{'uniqueid':_0x38dc58},'order':[['id','DESC']],'limit':0x1},'log':_0xa83e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f20ed23..907eb3c 100644 --- a/server/services/routing/rpc/interval.js +++ b/server/services/routing/rpc/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1989=['name','Interval','Intervals','interval','../client','getIntervals','Request'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0x1989,0x74));var _0x9198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1989[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x9198('0x0'));exports[_0x9198('0x1')]=function(){return function(){return client[_0x9198('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x9198('0x3')],'include':[{'model':_0x9198('0x4'),'as':_0x9198('0x5'),'attributes':['id',_0x9198('0x3'),_0x9198('0x6')]}]},'log':_0x9198('0x1')});};}; \ No newline at end of file +var _0x5325=['getIntervals','../client','Request','GetInterval','name','Interval','interval'];(function(_0x514816,_0x57c091){var _0x5c3a43=function(_0xd4a413){while(--_0xd4a413){_0x514816['push'](_0x514816['shift']());}};_0x5c3a43(++_0x57c091);}(_0x5325,0x8d));var _0x5532=function(_0x332630,_0x23dbf9){_0x332630=_0x332630-0x0;var _0x5d754a=_0x5325[_0x332630];return _0x5d754a;};'use strict';var client=require(_0x5532('0x0'));exports['getIntervals']=function(){return function(){return client[_0x5532('0x1')](_0x5532('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5532('0x3')],'include':[{'model':_0x5532('0x4'),'as':'Intervals','attributes':['id',_0x5532('0x3'),_0x5532('0x5')]}]},'log':_0x5532('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index da76feb..411fc7c 100644 --- a/server/services/routing/rpc/mailInteraction.js +++ b/server/services/routing/rpc/mailInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x21dff8,_0x879b42){var _0x109fce=function(_0x393188){while(--_0x393188){_0x21dff8['push'](_0x21dff8['shift']());}};_0x109fce(++_0x879b42);}(_0x5f2f,0x73));var _0xf5f2=function(_0x45d3df,_0x5f4ceb){_0x45d3df=_0x45d3df-0x0;var _0x40279a=_0x5f2f[_0x45d3df];return _0x40279a;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(_0x2dcf60,_0x1a7be1){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'body':_0x1a7be1,'options':{'where':{'id':_0x2dcf60}},'log':_0xf5f2('0x4')});};exports[_0xf5f2('0x5')]=function(_0x501fbd,_0x4854b6){return client[_0xf5f2('0x2')](_0xf5f2('0x6'),{'body':_0x4854b6,'options':{'where':{'id':_0x501fbd}},'log':_0xf5f2('0x7')});}; \ No newline at end of file +var _0x1893=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x36005e,_0x100293){var _0x5dfb56=function(_0x5c94fd){while(--_0x5c94fd){_0x36005e['push'](_0x36005e['shift']());}};_0x5dfb56(++_0x100293);}(_0x1893,0xa2));var _0x3189=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1893[_0x4b369d];return _0x571a98;};'use strict';var client=require('../client');exports['update']=function(_0x1bfe8b,_0x3aec2b){return client[_0x3189('0x0')](_0x3189('0x1'),{'body':_0x3aec2b,'options':{'where':{'id':_0x1bfe8b}},'log':_0x3189('0x2')});};exports[_0x3189('0x3')]=function(_0x3953a2,_0x5371db){return client[_0x3189('0x0')](_0x3189('0x4'),{'body':_0x5371db,'options':{'where':{'id':_0x3953a2}},'log':_0x3189('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index a14b190..c5da4ab 100644 --- a/server/services/routing/rpc/mailMessage.js +++ b/server/services/routing/rpc/mailMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc18c=['CreateMailMessage','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc18c,0x1bb));var _0xcc18=function(_0x44b564,_0x9033f7){_0x44b564=_0x44b564-0x0;var _0x489618=_0xc18c[_0x44b564];return _0x489618;};'use strict';var client=require('../client');exports['create']=function(_0xa92afa){return client[_0xcc18('0x0')](_0xcc18('0x1'),{'body':_0xa92afa,'log':'createMailMessage'});}; \ No newline at end of file +var _0xc77e=['CreateMailMessage','../client','create'];(function(_0x481f30,_0xf7326b){var _0x65bc7d=function(_0x20655c){while(--_0x20655c){_0x481f30['push'](_0x481f30['shift']());}};_0x65bc7d(++_0xf7326b);}(_0xc77e,0x7c));var _0xec77=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc77e[_0x19950b];return _0x3c6b41;};'use strict';var client=require(_0xec77('0x0'));exports[_0xec77('0x1')]=function(_0x21420b){return client['Request'](_0xec77('0x2'),{'body':_0x21420b,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 183b88f..fe519d7 100644 --- a/server/services/routing/rpc/mailQueue.js +++ b/server/services/routing/rpc/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc580=['timeout','strategy','User','Agents','online','mailPause','getMailQueues','Request','GetMailQueue','name'];(function(_0x2ab324,_0x49fbac){var _0x427c10=function(_0x4674c2){while(--_0x4674c2){_0x2ab324['push'](_0x2ab324['shift']());}};_0x427c10(++_0x49fbac);}(_0xc580,0xa6));var _0x0c58=function(_0x4e3081,_0x76b09f){_0x4e3081=_0x4e3081-0x0;var _0x1980a3=_0xc580[_0x4e3081];return _0x1980a3;};'use strict';var client=require('../client');exports[_0x0c58('0x0')]=function(){return function(){return client[_0x0c58('0x1')](_0x0c58('0x2'),{'options':{'raw':![],'attributes':['id',_0x0c58('0x3'),_0x0c58('0x4'),_0x0c58('0x5')],'include':[{'model':_0x0c58('0x6'),'as':_0x0c58('0x7'),'attributes':['id',_0x0c58('0x3'),_0x0c58('0x8'),_0x0c58('0x9')]}]},'log':_0x0c58('0x0')});};}; \ No newline at end of file +var _0x2c20=['GetMailQueue','name','strategy','User','Agents','mailPause','../client','getMailQueues'];(function(_0x3b4020,_0x200bfd){var _0x3372a0=function(_0x332b60){while(--_0x332b60){_0x3b4020['push'](_0x3b4020['shift']());}};_0x3372a0(++_0x200bfd);}(_0x2c20,0x1ae));var _0x02c2=function(_0x1af80e,_0x8a8525){_0x1af80e=_0x1af80e-0x0;var _0x347585=_0x2c20[_0x1af80e];return _0x347585;};'use strict';var client=require(_0x02c2('0x0'));exports[_0x02c2('0x1')]=function(){return function(){return client['Request'](_0x02c2('0x2'),{'options':{'raw':![],'attributes':['id',_0x02c2('0x3'),'timeout',_0x02c2('0x4')],'include':[{'model':_0x02c2('0x5'),'as':_0x02c2('0x6'),'attributes':['id',_0x02c2('0x3'),'online',_0x02c2('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 9e233f3..ccd33a7 100644 --- a/server/services/routing/rpc/mailQueueReport.js +++ b/server/services/routing/rpc/mailQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7015=['DESC','../client','create','CreateMailQueueReport','update','Request','UpdateMailQueueReport'];(function(_0x2fc8c9,_0x6854bc){var _0x2ec8eb=function(_0x2a2497){while(--_0x2a2497){_0x2fc8c9['push'](_0x2fc8c9['shift']());}};_0x2ec8eb(++_0x6854bc);}(_0x7015,0x1cf));var _0x5701=function(_0x60947d,_0x2b7167){_0x60947d=_0x60947d-0x0;var _0x3109b7=_0x7015[_0x60947d];return _0x3109b7;};'use strict';var client=require(_0x5701('0x0'));exports[_0x5701('0x1')]=function(_0x18cbf6){return client['Request'](_0x5701('0x2'),{'body':_0x18cbf6,'log':'CreateMailQueueReport'});};exports[_0x5701('0x3')]=function(_0xfc068d,_0x2093b9){return client[_0x5701('0x4')](_0x5701('0x5'),{'body':_0x2093b9,'options':{'where':{'uniqueid':_0xfc068d},'order':[['id',_0x5701('0x6')]],'limit':0x1},'log':_0x5701('0x5')});}; \ No newline at end of file +var _0xe8f0=['DESC','UpdateMailQueueReport','create','Request','CreateMailQueueReport'];(function(_0x26a10d,_0xe5c001){var _0xf90201=function(_0x48535b){while(--_0x48535b){_0x26a10d['push'](_0x26a10d['shift']());}};_0xf90201(++_0xe5c001);}(_0xe8f0,0x66));var _0x0e8f=function(_0x339053,_0x2039a0){_0x339053=_0x339053-0x0;var _0x570f45=_0xe8f0[_0x339053];return _0x570f45;};'use strict';var client=require('../client');exports[_0x0e8f('0x0')]=function(_0x49d07c){return client[_0x0e8f('0x1')](_0x0e8f('0x2'),{'body':_0x49d07c,'log':_0x0e8f('0x2')});};exports['update']=function(_0x15568d,_0x3f23c6){return client[_0x0e8f('0x1')]('UpdateMailQueueReport',{'body':_0x3f23c6,'options':{'where':{'uniqueid':_0x15568d},'order':[['id',_0x0e8f('0x3')]],'limit':0x1},'log':_0x0e8f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 44f704a..b386889 100644 --- a/server/services/routing/rpc/openchannelInteraction.js +++ b/server/services/routing/rpc/openchannelInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x840f=['UpdateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x840f,0xcb));var _0xf840=function(_0x1e20f5,_0x2f2e0d){_0x1e20f5=_0x1e20f5-0x0;var _0x581060=_0x840f[_0x1e20f5];return _0x581060;};'use strict';var client=require(_0xf840('0x0'));exports['update']=function(_0x36206a,_0x567311){return client['Request'](_0xf840('0x1'),{'body':_0x567311,'options':{'where':{'id':_0x36206a}},'log':'updateOpenchannelInteraction'});};exports[_0xf840('0x2')]=function(_0x573069,_0xae7c27){return client[_0xf840('0x3')](_0xf840('0x4'),{'body':_0xae7c27,'options':{'where':{'id':_0x573069}},'log':_0xf840('0x5')});}; \ No newline at end of file +var _0x41ac=['updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','UpdateOpenchannelInteraction'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x41ac,0x8a));var _0xc41a=function(_0x51d8bf,_0x575a5b){_0x51d8bf=_0x51d8bf-0x0;var _0x3f06fd=_0x41ac[_0x51d8bf];return _0x3f06fd;};'use strict';var client=require(_0xc41a('0x0'));exports['update']=function(_0x11e9f5,_0xae08c9){return client['Request'](_0xc41a('0x1'),{'body':_0xae08c9,'options':{'where':{'id':_0x11e9f5}},'log':_0xc41a('0x2')});};exports[_0xc41a('0x3')]=function(_0x1ba86b,_0xadecc6){return client[_0xc41a('0x4')](_0xc41a('0x5'),{'body':_0xadecc6,'options':{'where':{'id':_0x1ba86b}},'log':_0xc41a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 74a3d6f..00ebbef 100644 --- a/server/services/routing/rpc/openchannelMessage.js +++ b/server/services/routing/rpc/openchannelMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd35=['create','Request','CreateOpenchannelMessage','../client'];(function(_0x45d2af,_0xa0bd38){var _0x67d39=function(_0x701e43){while(--_0x701e43){_0x45d2af['push'](_0x45d2af['shift']());}};_0x67d39(++_0xa0bd38);}(_0xcd35,0x13f));var _0x5cd3=function(_0x41b3ad,_0x13ccb1){_0x41b3ad=_0x41b3ad-0x0;var _0x1af0a4=_0xcd35[_0x41b3ad];return _0x1af0a4;};'use strict';var client=require(_0x5cd3('0x0'));exports[_0x5cd3('0x1')]=function(_0x208d63){return client[_0x5cd3('0x2')](_0x5cd3('0x3'),{'body':_0x208d63,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xf4a2=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xf4a2,0x144));var _0x2f4a=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0xf4a2[_0x446208];return _0xe49563;};'use strict';var client=require(_0x2f4a('0x0'));exports[_0x2f4a('0x1')]=function(_0x2bde25){return client[_0x2f4a('0x2')](_0x2f4a('0x3'),{'body':_0x2bde25,'log':_0x2f4a('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index f6563f9..b468de8 100644 --- a/server/services/routing/rpc/openchannelQueue.js +++ b/server/services/routing/rpc/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2242=['timeout','User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','name'];(function(_0x83aee0,_0x3db4ec){var _0x348fd7=function(_0x31dbd1){while(--_0x31dbd1){_0x83aee0['push'](_0x83aee0['shift']());}};_0x348fd7(++_0x3db4ec);}(_0x2242,0x1a3));var _0x2224=function(_0x277a3b,_0x12ee43){_0x277a3b=_0x277a3b-0x0;var _0x4e4978=_0x2242[_0x277a3b];return _0x4e4978;};'use strict';var client=require(_0x2224('0x0'));exports[_0x2224('0x1')]=function(){return function(){return client[_0x2224('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x2224('0x3'),_0x2224('0x4'),'strategy'],'include':[{'model':_0x2224('0x5'),'as':_0x2224('0x6'),'attributes':['id','name',_0x2224('0x7'),_0x2224('0x8')]}]},'log':_0x2224('0x1')});};}; \ No newline at end of file +var _0x0482=['name','timeout','strategy','User','online','openchannelPause','getOpenchannelQueues','../client','GetOpenchannelQueue'];(function(_0x7eee7,_0x3779a1){var _0x469f62=function(_0x553717){while(--_0x553717){_0x7eee7['push'](_0x7eee7['shift']());}};_0x469f62(++_0x3779a1);}(_0x0482,0xf1));var _0x2048=function(_0x1cd71f,_0x2a9d19){_0x1cd71f=_0x1cd71f-0x0;var _0x33d362=_0x0482[_0x1cd71f];return _0x33d362;};'use strict';var client=require(_0x2048('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x2048('0x1'),{'options':{'raw':![],'attributes':['id',_0x2048('0x2'),_0x2048('0x3'),_0x2048('0x4')],'include':[{'model':_0x2048('0x5'),'as':'Agents','attributes':['id',_0x2048('0x2'),_0x2048('0x6'),_0x2048('0x7')]}]},'log':_0x2048('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 1936ac3..a0b37e6 100644 --- a/server/services/routing/rpc/openchannelQueueReport.js +++ b/server/services/routing/rpc/openchannelQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2334=['UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x4165d6,_0x3229f5){var _0x188c3e=function(_0x1b9ff6){while(--_0x1b9ff6){_0x4165d6['push'](_0x4165d6['shift']());}};_0x188c3e(++_0x3229f5);}(_0x2334,0x6a));var _0x4233=function(_0x42183e,_0x3b3353){_0x42183e=_0x42183e-0x0;var _0x4c1315=_0x2334[_0x42183e];return _0x4c1315;};'use strict';var client=require('../client');exports[_0x4233('0x0')]=function(_0x6ec2de){return client[_0x4233('0x1')]('CreateOpenchannelQueueReport',{'body':_0x6ec2de,'log':_0x4233('0x2')});};exports[_0x4233('0x3')]=function(_0x39c610,_0x4f8981){return client[_0x4233('0x1')](_0x4233('0x4'),{'body':_0x4f8981,'options':{'where':{'uniqueid':_0x39c610},'order':[['id','DESC']],'limit':0x1},'log':_0x4233('0x4')});}; \ No newline at end of file +var _0xb10b=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','Request'];(function(_0x3eeb3c,_0x523f21){var _0x498420=function(_0x58b2a5){while(--_0x58b2a5){_0x3eeb3c['push'](_0x3eeb3c['shift']());}};_0x498420(++_0x523f21);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a4a49,_0xf73c87){_0x1a4a49=_0x1a4a49-0x0;var _0x3be8cd=_0xb10b[_0x1a4a49];return _0x3be8cd;};'use strict';var client=require(_0xbb10('0x0'));exports['create']=function(_0x390ae2){return client[_0xbb10('0x1')](_0xbb10('0x2'),{'body':_0x390ae2,'log':'CreateOpenchannelQueueReport'});};exports[_0xbb10('0x3')]=function(_0x9bbed,_0x460981){return client[_0xbb10('0x1')](_0xbb10('0x4'),{'body':_0x460981,'options':{'where':{'uniqueid':_0x9bbed},'order':[['id',_0xbb10('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index cba77bd..7fb3ca1 100644 --- a/server/services/routing/rpc/smsInteraction.js +++ b/server/services/routing/rpc/smsInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['updateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction'];(function(_0x3ee7ed,_0x2e311b){var _0x50cc41=function(_0x354a39){while(--_0x354a39){_0x3ee7ed['push'](_0x3ee7ed['shift']());}};_0x50cc41(++_0x2e311b);}(_0x9ffd,0x1d7));var _0xd9ff=function(_0x3aec71,_0x350115){_0x3aec71=_0x3aec71-0x0;var _0x36e481=_0x9ffd[_0x3aec71];return _0x36e481;};'use strict';var client=require(_0xd9ff('0x0'));exports[_0xd9ff('0x1')]=function(_0x13fd7e,_0x223887){return client['Request'](_0xd9ff('0x2'),{'body':_0x223887,'options':{'where':{'id':_0x13fd7e}},'log':_0xd9ff('0x3')});};exports[_0xd9ff('0x4')]=function(_0x96ee9a,_0x44c750){return client['Request']('AddTagsToSmsInteraction',{'body':_0x44c750,'options':{'where':{'id':_0x96ee9a}},'log':_0xd9ff('0x5')});}; \ No newline at end of file +var _0xdb13=['UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request'];(function(_0x48066a,_0x423850){var _0x2b66c1=function(_0x222015){while(--_0x222015){_0x48066a['push'](_0x48066a['shift']());}};_0x2b66c1(++_0x423850);}(_0xdb13,0x10c));var _0x3db1=function(_0x35f680,_0x34bdde){_0x35f680=_0x35f680-0x0;var _0x170dbb=_0xdb13[_0x35f680];return _0x170dbb;};'use strict';var client=require('../client');exports[_0x3db1('0x0')]=function(_0x366725,_0x38d692){return client[_0x3db1('0x1')](_0x3db1('0x2'),{'body':_0x38d692,'options':{'where':{'id':_0x366725}},'log':_0x3db1('0x3')});};exports['addTags']=function(_0x3352e3,_0x41fb5d){return client[_0x3db1('0x1')](_0x3db1('0x4'),{'body':_0x41fb5d,'options':{'where':{'id':_0x3352e3}},'log':_0x3db1('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 907fc0f..ecc319d 100644 --- a/server/services/routing/rpc/smsMessage.js +++ b/server/services/routing/rpc/smsMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7e1=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0xda63e0,_0x49b7de){var _0xba676d=function(_0x4e646f){while(--_0x4e646f){_0xda63e0['push'](_0xda63e0['shift']());}};_0xba676d(++_0x49b7de);}(_0xf7e1,0x150));var _0x1f7e=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xf7e1[_0x4b73a2];return _0x383c66;};'use strict';var client=require(_0x1f7e('0x0'));exports[_0x1f7e('0x1')]=function(_0x2a1491){return client[_0x1f7e('0x2')](_0x1f7e('0x3'),{'body':_0x2a1491,'log':_0x1f7e('0x4')});}; \ No newline at end of file +var _0x7300=['create','Request','createSmsMessage'];(function(_0x378f5e,_0x84b9c7){var _0x6a43ed=function(_0xd80806){while(--_0xd80806){_0x378f5e['push'](_0x378f5e['shift']());}};_0x6a43ed(++_0x84b9c7);}(_0x7300,0x15f));var _0x0730=function(_0x46b301,_0x107175){_0x46b301=_0x46b301-0x0;var _0x22ffad=_0x7300[_0x46b301];return _0x22ffad;};'use strict';var client=require('../client');exports[_0x0730('0x0')]=function(_0x20ff8b){return client[_0x0730('0x1')]('CreateSmsMessage',{'body':_0x20ff8b,'log':_0x0730('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 061faaf..e845cb1 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x181dfe,_0xf84557){var _0x40c38f=function(_0x3aa818){while(--_0x3aa818){_0x181dfe['push'](_0x181dfe['shift']());}};_0x40c38f(++_0xf84557);}(_0x70e0,0x17b));var _0x070e=function(_0x516f44,_0x84949){_0x516f44=_0x516f44-0x0;var _0x34b2fd=_0x70e0[_0x516f44];return _0x34b2fd;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x4c0935,_0x5a124c){var _0x1e4352=function(_0x3f3aa4){while(--_0x3f3aa4){_0x4c0935['push'](_0x4c0935['shift']());}};_0x1e4352(++_0x5a124c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index ef134de..d194b00 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x48f91e,_0x5d17c7){var _0x19aafe=function(_0x31e983){while(--_0x31e983){_0x48f91e['push'](_0x48f91e['shift']());}};_0x19aafe(++_0x5d17c7);}(_0x70e0,0x17b));var _0x070e=function(_0x43cf6c,_0x18da04){_0x43cf6c=_0x43cf6c-0x0;var _0x4bf24e=_0x70e0[_0x43cf6c];return _0x4bf24e;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x3ec69d,_0xf8aade){var _0x394c7e=function(_0x16764b){while(--_0x16764b){_0x3ec69d['push'](_0x3ec69d['shift']());}};_0x394c7e(++_0xf8aade);}(_0x008c,0x188));var _0xc008=function(_0x20455f,_0x423034){_0x20455f=_0x20455f-0x0;var _0x185213=_0x008c[_0x20455f];return _0x185213;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 9009cd2..3a0acab 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x5ba0c1,_0x4e623c){var _0x4e0815=function(_0xb794e7){while(--_0xb794e7){_0x5ba0c1['push'](_0x5ba0c1['shift']());}};_0x4e0815(++_0x4e623c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x2fecb2,_0x40a995){var _0x3e009a=function(_0x4081c5){while(--_0x4081c5){_0x2fecb2['push'](_0x2fecb2['shift']());}};_0x3e009a(++_0x40a995);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index fe3c681..6535df8 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbf5=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xeb9d32,_0x3d4ef7){_0xeb9d32=_0xeb9d32-0x0;var _0x5a3762=_0xdbf5[_0xeb9d32];return _0x5a3762;};'use strict';var client=require('../client');exports[_0x5dbf('0x0')]=function(_0x52289f,_0x4bde73){return client[_0x5dbf('0x1')](_0x5dbf('0x2'),{'body':_0x4bde73,'options':{'where':{'id':_0x52289f}},'log':_0x5dbf('0x3')});};exports[_0x5dbf('0x4')]=function(_0x38b629,_0x1a1ea9){return client[_0x5dbf('0x1')](_0x5dbf('0x5'),{'body':_0x1a1ea9,'options':{'where':{'id':_0x38b629}},'log':_0x5dbf('0x6')});}; \ No newline at end of file +var _0x3831=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3831,0x14c));var _0x1383=function(_0x19a7d3,_0x487155){_0x19a7d3=_0x19a7d3-0x0;var _0x569a8e=_0x3831[_0x19a7d3];return _0x569a8e;};'use strict';var client=require(_0x1383('0x0'));exports['update']=function(_0x1c3e35,_0x42a46a){return client[_0x1383('0x1')](_0x1383('0x2'),{'body':_0x42a46a,'options':{'where':{'id':_0x1c3e35}},'log':_0x1383('0x3')});};exports['addTags']=function(_0x2fdf72,_0x573874){return client[_0x1383('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x573874,'options':{'where':{'id':_0x2fdf72}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 6aed663..063c839 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4534=['CreateWhatsappMessage','createWhatsappMessage'];(function(_0x20d278,_0x26717e){var _0x106535=function(_0x7d29df){while(--_0x7d29df){_0x20d278['push'](_0x20d278['shift']());}};_0x106535(++_0x26717e);}(_0x4534,0xec));var _0x4453=function(_0x4cf32c,_0x222b9e){_0x4cf32c=_0x4cf32c-0x0;var _0x383710=_0x4534[_0x4cf32c];return _0x383710;};'use strict';var client=require('../client');exports['create']=function(_0x53de76){return client['Request'](_0x4453('0x0'),{'body':_0x53de76,'log':_0x4453('0x1')});}; \ No newline at end of file +var _0x42ca=['../client','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x1067cb,_0x21d610){var _0x2fa954=function(_0x5effe4){while(--_0x5effe4){_0x1067cb['push'](_0x1067cb['shift']());}};_0x2fa954(++_0x21d610);}(_0x42ca,0x138));var _0xa42c=function(_0x54c191,_0x4a04ef){_0x54c191=_0x54c191-0x0;var _0x40ee4a=_0x42ca[_0x54c191];return _0x40ee4a;};'use strict';var client=require(_0xa42c('0x0'));exports['create']=function(_0x47fd65){return client[_0xa42c('0x1')](_0xa42c('0x2'),{'body':_0x47fd65,'log':_0xa42c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 2bfc138..0378689 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2350=['getWhatsappQueues','../client','Request','name','timeout','strategy','User','Agents','online','whatsappPause'];(function(_0x45dafa,_0x171e29){var _0xeb385a=function(_0x2491d0){while(--_0x2491d0){_0x45dafa['push'](_0x45dafa['shift']());}};_0xeb385a(++_0x171e29);}(_0x2350,0x8d));var _0x0235=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0x2350[_0x4706a6];return _0x1bb705;};'use strict';var client=require(_0x0235('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x0235('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x0235('0x2'),_0x0235('0x3'),_0x0235('0x4')],'include':[{'model':_0x0235('0x5'),'as':_0x0235('0x6'),'attributes':['id',_0x0235('0x2'),_0x0235('0x7'),_0x0235('0x8')]}]},'log':_0x0235('0x9')});};}; \ No newline at end of file +var _0xc5b7=['online','getWhatsappQueues','../client','GetWhatsappQueue','timeout','strategy','User'];(function(_0x4d4c19,_0x3147ff){var _0xf9e510=function(_0x5b9442){while(--_0x5b9442){_0x4d4c19['push'](_0x4d4c19['shift']());}};_0xf9e510(++_0x3147ff);}(_0xc5b7,0x175));var _0x7c5b=function(_0x1f8e0a,_0x1faad9){_0x1f8e0a=_0x1f8e0a-0x0;var _0x5c2028=_0xc5b7[_0x1f8e0a];return _0x5c2028;};'use strict';var client=require(_0x7c5b('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x7c5b('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x7c5b('0x2'),_0x7c5b('0x3')],'include':[{'model':_0x7c5b('0x4'),'as':'Agents','attributes':['id','name',_0x7c5b('0x5'),'whatsappPause']}]},'log':_0x7c5b('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 168a892..cc0bb8b 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c4f=['DESC','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x857728,_0x27828c){var _0x4ab8ad=function(_0x432516){while(--_0x432516){_0x857728['push'](_0x857728['shift']());}};_0x4ab8ad(++_0x27828c);}(_0x0c4f,0x1cf));var _0xf0c4=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x0c4f[_0x40220a];return _0x3903cc;};'use strict';var client=require('../client');exports[_0xf0c4('0x0')]=function(_0x378418){return client[_0xf0c4('0x1')](_0xf0c4('0x2'),{'body':_0x378418,'log':_0xf0c4('0x2')});};exports[_0xf0c4('0x3')]=function(_0x39d16c,_0x1ebc3f){return client[_0xf0c4('0x1')](_0xf0c4('0x4'),{'body':_0x1ebc3f,'options':{'where':{'uniqueid':_0x39d16c},'order':[['id',_0xf0c4('0x5')]],'limit':0x1},'log':_0xf0c4('0x4')});}; \ No newline at end of file +var _0xd2ae=['update','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x19f642,_0xbe241c){var _0x533e55=function(_0x4f5e4c){while(--_0x4f5e4c){_0x19f642['push'](_0x19f642['shift']());}};_0x533e55(++_0xbe241c);}(_0xd2ae,0x8d));var _0xed2a=function(_0x288518,_0x1fa9a9){_0x288518=_0x288518-0x0;var _0x4e21fa=_0xd2ae[_0x288518];return _0x4e21fa;};'use strict';var client=require(_0xed2a('0x0'));exports[_0xed2a('0x1')]=function(_0xf4b547){return client[_0xed2a('0x2')]('CreateWhatsappQueueReport',{'body':_0xf4b547,'log':_0xed2a('0x3')});};exports[_0xed2a('0x4')]=function(_0x25897a,_0x52e547){return client[_0xed2a('0x2')]('UpdateWhatsappQueueReport',{'body':_0x52e547,'options':{'where':{'uniqueid':_0x25897a},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 7af4947..112d73a 100644 --- a/server/services/routing/server/applications/agent.js +++ b/server/services/routing/server/applications/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x142b=['format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','join','find','agents','timeout','createQueue','atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','info','next','agent','stop','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x406df3,_0x4b5900){var _0x563b2e=function(_0x5ebe75){while(--_0x5ebe75){_0x406df3['push'](_0x406df3['shift']());}};_0x563b2e(++_0x4b5900);}(_0x142b,0x88));var _0xb142=function(_0x19273e,_0x5219c1){_0x19273e=_0x19273e-0x0;var _0x27c005=_0x142b[_0x19273e];return _0x27c005;};'use strict';var schema=require(_0xb142('0x0'));var _=require(_0xb142('0x1'));var util=require(_0xb142('0x2'));var seqqueue=require(_0xb142('0x3'));var logger=require(_0xb142('0x4'))('routing');var strategy=require(_0xb142('0x5'));var queue=schema({'name':{'type':_0xb142('0x6'),'required':!![],'message':_0xb142('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x54826f,_0xac441d,_0x53ef84){return logger['info'](util[_0xb142('0x8')](_0xb142('0x9'),_0x54826f,_0xac441d['name'],_0x53ef84));}function handleFindAgent(_0x5444cd){return function(_0x524a41){return _0x524a41[_0xb142('0xa')][_0xb142('0xb')]()===_0x5444cd['toLowerCase']();};}exports[_0xb142('0xc')]=function(_0x4d5b1f,_0x1564cc,_0x23db74,_0x51612d){return function(_0x564bd0){try{var _0x1e1c20={'name':_0x1564cc[0x0],'timeout':_0x1564cc[0x1]};var _0x3921b2=queue['validate'](_0x1e1c20,{'typecast':!![]});if(_0x3921b2[_0xb142('0xd')]){logger[_0xb142('0xe')](_0xb142('0xf'),_0x4d5b1f,_['map'](_0x3921b2,'message')[_0xb142('0x10')](',\x20'));_0x564bd0['stop']();}else{var _0x356457=_[_0xb142('0x11')](_0x23db74[_0xb142('0x12')],handleFindAgent(_0x1e1c20['name']));if(_0x356457){var _0x30dbb1=(_0x1e1c20[_0xb142('0x13')]||0xa)*0x3e8;var _0x50bb09,_0x3320fa;var _0x35cbd2=seqqueue[_0xb142('0x14')](_0x30dbb1);_0x35cbd2['id']=_0x4d5b1f;_0x35cbd2[_0xb142('0x15')]=_0x30dbb1;_0x35cbd2[_0xb142('0x16')]=_0x51612d[_0xb142('0x16')];writeLog(_0x4d5b1f,_0x356457,util[_0xb142('0x8')](_0xb142('0x17'),_0x30dbb1));_0x23db74['rules'][_0x4d5b1f]['on'](_0xb142('0x18'),function(){logger['info'](_0xb142('0x19'),_0x4d5b1f);clearTimeout(_0x3320fa);_0x3320fa=undefined;_0x35cbd2[_0xb142('0x1a')]();if(_0x23db74[_0xb142('0x1b')][_0x4d5b1f]){delete _0x23db74[_0xb142('0x1b')][_0x4d5b1f];}_0x564bd0['stop']();});_0x23db74[_0xb142('0x1b')][_0x4d5b1f]['on'](_0xb142('0x1c'),function(){if(_0x23db74[_0xb142('0x1b')][_0x4d5b1f]){delete _0x23db74[_0xb142('0x1b')][_0x4d5b1f];}});_0x3320fa=setTimeout(function(){logger[_0xb142('0x1d')]('[%s][AGENT]\x20ROUTING\x20END',_0x4d5b1f);clearTimeout(_0x3320fa);_0x35cbd2['close']();_0x564bd0[_0xb142('0x1e')]();},_0x30dbb1);strategy[_0xb142('0x1f')](_0x35cbd2,_0x356457,_0x23db74,_0x51612d);}else{logger[_0xb142('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x4d5b1f,_0x1e1c20[_0xb142('0xa')]);_0x564bd0[_0xb142('0x20')]();}}}catch(_0x5067ee){console[_0xb142('0x21')](_0x5067ee);logger[_0xb142('0xe')](_0xb142('0x22'),_0x4d5b1f,_0x5067ee[_0xb142('0x23')]);_0x564bd0[_0xb142('0x20')]();}};}; \ No newline at end of file +var _0x92f4=['next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','../../../../config/logger','routing','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','find','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END'];(function(_0x443817,_0x5853f7){var _0x1a57f6=function(_0x5ad374){while(--_0x5ad374){_0x443817['push'](_0x443817['shift']());}};_0x1a57f6(++_0x5853f7);}(_0x92f4,0x10f));var _0x492f=function(_0x515cc0,_0x248d5c){_0x515cc0=_0x515cc0-0x0;var _0x59e40e=_0x92f4[_0x515cc0];return _0x59e40e;};'use strict';var schema=require('validate');var _=require(_0x492f('0x0'));var util=require(_0x492f('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x492f('0x2'))(_0x492f('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x492f('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x492f('0x5'),'message':_0x492f('0x6')}});function writeLog(_0x363558,_0x47ab5b,_0x5aad18){return logger[_0x492f('0x7')](util[_0x492f('0x8')](_0x492f('0x9'),_0x363558,_0x47ab5b[_0x492f('0xa')],_0x5aad18));}function handleFindAgent(_0x24e949){return function(_0x7469c9){return _0x7469c9[_0x492f('0xa')][_0x492f('0xb')]()===_0x24e949['toLowerCase']();};}exports[_0x492f('0xc')]=function(_0x2c1969,_0x57b3db,_0x5dce97,_0x2fc69d){return function(_0x3fe8a0){try{var _0x4ffe2b={'name':_0x57b3db[0x0],'timeout':_0x57b3db[0x1]};var _0x3299ad=queue[_0x492f('0xd')](_0x4ffe2b,{'typecast':!![]});if(_0x3299ad[_0x492f('0xe')]){logger[_0x492f('0xf')](_0x492f('0x10'),_0x2c1969,_[_0x492f('0x11')](_0x3299ad,_0x492f('0x12'))[_0x492f('0x13')](',\x20'));_0x3fe8a0['stop']();}else{var _0x5beeac=_[_0x492f('0x14')](_0x5dce97['agents'],handleFindAgent(_0x4ffe2b[_0x492f('0xa')]));if(_0x5beeac){var _0x59970f=(_0x4ffe2b[_0x492f('0x15')]||0xa)*0x3e8;var _0x5c13b9,_0x11edc7;var _0xa52f71=seqqueue[_0x492f('0x16')](_0x59970f);_0xa52f71['id']=_0x2c1969;_0xa52f71[_0x492f('0x17')]=_0x59970f;_0xa52f71[_0x492f('0x18')]=_0x2fc69d[_0x492f('0x18')];writeLog(_0x2c1969,_0x5beeac,util[_0x492f('0x8')](_0x492f('0x19'),_0x59970f));_0x5dce97[_0x492f('0x1a')][_0x2c1969]['on'](_0x492f('0x1b'),function(){logger[_0x492f('0x7')](_0x492f('0x1c'),_0x2c1969);clearTimeout(_0x11edc7);_0x11edc7=undefined;_0xa52f71[_0x492f('0x1d')]();if(_0x5dce97[_0x492f('0x1a')][_0x2c1969]){delete _0x5dce97[_0x492f('0x1a')][_0x2c1969];}_0x3fe8a0[_0x492f('0x1e')]();});_0x5dce97[_0x492f('0x1a')][_0x2c1969]['on'](_0x492f('0x1f'),function(){if(_0x5dce97[_0x492f('0x1a')][_0x2c1969]){delete _0x5dce97[_0x492f('0x1a')][_0x2c1969];}});_0x11edc7=setTimeout(function(){logger[_0x492f('0x7')](_0x492f('0x20'),_0x2c1969);clearTimeout(_0x11edc7);_0xa52f71[_0x492f('0x1d')]();_0x3fe8a0[_0x492f('0x21')]();},_0x59970f);strategy['agent'](_0xa52f71,_0x5beeac,_0x5dce97,_0x2fc69d);}else{logger[_0x492f('0xf')](_0x492f('0x22'),_0x2c1969,_0x4ffe2b[_0x492f('0xa')]);_0x3fe8a0[_0x492f('0x1e')]();}}}catch(_0x1cbfe3){console[_0x492f('0x23')](_0x1cbfe3);logger[_0x492f('0xf')](_0x492f('0x24'),_0x2c1969,_0x1cbfe3[_0x492f('0x25')]);_0x3fe8a0[_0x492f('0x1e')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 14e5bfc..bc881b1 100644 --- a/server/services/routing/server/applications/amazonlex.js +++ b/server/services/routing/server/applications/amazonlex.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b3=['upperFirst','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','stringify','Failed','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId'];(function(_0x32e758,_0x13c271){var _0x349316=function(_0x27a9da){while(--_0x27a9da){_0x32e758['push'](_0x32e758['shift']());}};_0x349316(++_0x13c271);}(_0xd8b3,0x132));var _0x3d8b=function(_0x30b159,_0x3fbb50){_0x30b159=_0x30b159-0x0;var _0x23c3f9=_0xd8b3[_0x30b159];return _0x23c3f9;};'use strict';var _=require(_0x3d8b('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x3d8b('0x1'));var logger=require('../../../../config/logger')(_0x3d8b('0x2'));var rpc={'chatMessage':require(_0x3d8b('0x3')),'openchannelMessage':require(_0x3d8b('0x4')),'mailMessage':require(_0x3d8b('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3d8b('0x6')),'whatsappMessage':require(_0x3d8b('0x7'))};exports[_0x3d8b('0x8')]=function(_0x5a9a57,_0x7ec6c8){return function(_0x54189b){try{if(!_[_0x3d8b('0x9')](this[_0x3d8b('0xa')][_0x3d8b('0xb')])){logger[_0x3d8b('0xc')](_0x3d8b('0xd'),_0x5a9a57,_0x3d8b('0xe'));return _0x54189b[_0x3d8b('0xf')]();}var _0x3cb1a6={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x3d8b('0x10')),'direction':_0x3d8b('0x11')};if(this[_0x3d8b('0x12')]===_0x3d8b('0x13')||this['channel']===_0x3d8b('0x14')){_0x3cb1a6[_0x3d8b('0x15')]=this[_0x3d8b('0xa')][_0x3d8b('0x15')];}var _0x43a8d4=this[_0x3d8b('0x12')];if(_0x43a8d4==='chat'){_0x3cb1a6[_0x3d8b('0x16')]=this['account']['id'];}else{_0x3cb1a6[_[_0x3d8b('0x17')](_0x43a8d4)+'AccountId']=this[_0x3d8b('0x18')]['id'];}_0x3cb1a6[_[_0x3d8b('0x17')](_0x43a8d4)+_0x3d8b('0x19')]=this[_0x3d8b('0xa')]['id'];if(this['interaction'][_0x3d8b('0x1a')]){var _0x1f4446=_0x7ec6c8[0x4];if(!_[_0x3d8b('0x1b')](_0x1f4446)){_0x3cb1a6[_0x3d8b('0x1c')]=utils[_0x3d8b('0x1d')](_0x1f4446,this);return rpc[_0x43a8d4+_0x3d8b('0x1e')][_0x3d8b('0x1f')](_0x3cb1a6)[_0x3d8b('0x20')](function(_0x4b3ae4){logger['info']('[%s][AMAZONLEX]\x20%s',_0x5a9a57,_0x3cb1a6[_0x3d8b('0x1c')]);})[_0x3d8b('0x21')](function(_0x5e3666){logger[_0x3d8b('0x22')](_0x3d8b('0xd'),_0x5a9a57,JSON['stringify'](_0x5e3666));})[_0x3d8b('0x23')](function(){logger[_0x3d8b('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5a9a57);_0x54189b[_0x3d8b('0x24')]();});}else{logger[_0x3d8b('0xc')](_0x3d8b('0x25'),_0x5a9a57);_0x54189b['stop']();}}else{var _0x307b8f=this;var _0x1336d3=new AWS[(_0x3d8b('0x26'))]({'accessKeyId':_0x7ec6c8[0x0],'secretAccessKey':_0x7ec6c8[0x1],'region':_0x7ec6c8[0x2]});var _0x4d361e={'botAlias':_0x3d8b('0x27'),'botName':_0x7ec6c8[0x3],'inputText':this[_0x3d8b('0x28')][_0x3d8b('0x1c')],'userId':this['channel']+':'+this[_0x3d8b('0xa')]['id'][_0x3d8b('0x29')]()};_0x1336d3[_0x3d8b('0x2a')](_0x4d361e,function(_0x380c58,_0x295b26){if(_0x380c58){logger[_0x3d8b('0x22')](_0x3d8b('0xd'),_0x5a9a57,_0x380c58[_0x3d8b('0x28')]);_0x54189b['next']();}else if(_0x295b26&&_0x295b26['message']){_0x307b8f[_0x3d8b('0x1c')][_0x3d8b('0x2b')]=_0x295b26;_0x3cb1a6[_0x3d8b('0x1c')]=_0x295b26[_0x3d8b('0x28')];_0x3cb1a6[_0x3d8b('0x2c')]=_0x3d8b('0x2b');_0x3cb1a6['providerResponse']=JSON[_0x3d8b('0x2d')](_0x295b26);return rpc[_0x43a8d4+_0x3d8b('0x1e')]['create'](_0x3cb1a6)[_0x3d8b('0x20')](function(_0x18c8d1){logger[_0x3d8b('0xc')](_0x3d8b('0xd'),_0x5a9a57,_0x3cb1a6[_0x3d8b('0x1c')]);if(_0x295b26['dialogState']==_0x3d8b('0x2e')){_0x54189b['next']();}else{_0x54189b[_0x3d8b('0x24')]();}})['catch'](function(_0x431bbe){logger[_0x3d8b('0x22')](_0x3d8b('0xd'),_0x5a9a57,JSON[_0x3d8b('0x2d')](_0x431bbe));_0x54189b['next']();});}else{_0x54189b[_0x3d8b('0xf')]();}});}}catch(_0x17b44e){logger[_0x3d8b('0x22')](_0x3d8b('0xd'),_0x5a9a57,JSON[_0x3d8b('0x2d')](_0x17b44e));_0x54189b[_0x3d8b('0x24')]();}};}; \ No newline at end of file +var _0x4069=['InteractionId','interaction','created','Message','then','[%s][AMAZONLEX]\x20%s','body','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','message','postText','amazonlex','dialogState','Failed','catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','upperFirst','AccountId'];(function(_0xeeab64,_0x470b12){var _0x38ec96=function(_0x504a40){while(--_0x504a40){_0xeeab64['push'](_0xeeab64['shift']());}};_0x38ec96(++_0x470b12);}(_0x4069,0x1cc));var _0x9406=function(_0x3e6a26,_0x4b8e0a){_0x3e6a26=_0x3e6a26-0x0;var _0xde755c=_0x4069[_0x3e6a26];return _0xde755c;};'use strict';var _=require(_0x9406('0x0'));var moment=require(_0x9406('0x1'));var AWS=require('aws-sdk');var utils=require(_0x9406('0x2'));var logger=require(_0x9406('0x3'))(_0x9406('0x4'));var rpc={'chatMessage':require(_0x9406('0x5')),'openchannelMessage':require(_0x9406('0x6')),'mailMessage':require(_0x9406('0x7')),'smsMessage':require(_0x9406('0x8')),'faxMessage':require(_0x9406('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x32d151,_0x45b679){return function(_0x2f7f73){try{if(!_[_0x9406('0xa')](this['interaction'][_0x9406('0xb')])){logger[_0x9406('0xc')]('[%s][AMAZONLEX]\x20%s',_0x32d151,_0x9406('0xd'));return _0x2f7f73[_0x9406('0xe')]();}var _0x205c69={'ContactId':this[_0x9406('0xf')]['id'],'sentAt':moment()['format'](_0x9406('0x10')),'direction':_0x9406('0x11')};if(this[_0x9406('0x12')]===_0x9406('0x13')||this[_0x9406('0x12')]==='whatsapp'){_0x205c69[_0x9406('0x14')]=this['interaction'][_0x9406('0x14')];}var _0x2f3794=this[_0x9406('0x12')];if(_0x2f3794==='chat'){_0x205c69[_0x9406('0x15')]=this['account']['id'];}else{_0x205c69[_[_0x9406('0x16')](_0x2f3794)+_0x9406('0x17')]=this['account']['id'];}_0x205c69[_[_0x9406('0x16')](_0x2f3794)+_0x9406('0x18')]=this[_0x9406('0x19')]['id'];if(this[_0x9406('0x19')][_0x9406('0x1a')]){var _0x1dfe4a=_0x45b679[0x4];if(!_['isEmpty'](_0x1dfe4a)){_0x205c69['body']=utils['getMustacheRender'](_0x1dfe4a,this);return rpc[_0x2f3794+_0x9406('0x1b')]['create'](_0x205c69)[_0x9406('0x1c')](function(_0x51e19f){logger[_0x9406('0xc')](_0x9406('0x1d'),_0x32d151,_0x205c69[_0x9406('0x1e')]);})['catch'](function(_0x517c7a){logger[_0x9406('0x1f')](_0x9406('0x1d'),_0x32d151,JSON[_0x9406('0x20')](_0x517c7a));})[_0x9406('0x21')](function(){logger[_0x9406('0xc')](_0x9406('0x22'),_0x32d151);_0x2f7f73['stop']();});}else{logger[_0x9406('0xc')](_0x9406('0x23'),_0x32d151);_0x2f7f73[_0x9406('0x24')]();}}else{var _0xbab73a=this;var _0x4ac1c6=new AWS[(_0x9406('0x25'))]({'accessKeyId':_0x45b679[0x0],'secretAccessKey':_0x45b679[0x1],'region':_0x45b679[0x2]});var _0x4a1c6a={'botAlias':'$LATEST','botName':_0x45b679[0x3],'inputText':this[_0x9406('0x26')]['body'],'userId':this[_0x9406('0x12')]+':'+this[_0x9406('0x19')]['id']['toString']()};_0x4ac1c6[_0x9406('0x27')](_0x4a1c6a,function(_0x1ab7b6,_0x588fd3){if(_0x1ab7b6){logger[_0x9406('0x1f')](_0x9406('0x1d'),_0x32d151,_0x1ab7b6[_0x9406('0x26')]);_0x2f7f73[_0x9406('0xe')]();}else if(_0x588fd3&&_0x588fd3['message']){_0xbab73a[_0x9406('0x1e')][_0x9406('0x28')]=_0x588fd3;_0x205c69[_0x9406('0x1e')]=_0x588fd3[_0x9406('0x26')];_0x205c69['providerName']=_0x9406('0x28');_0x205c69['providerResponse']=JSON[_0x9406('0x20')](_0x588fd3);return rpc[_0x2f3794+_0x9406('0x1b')]['create'](_0x205c69)[_0x9406('0x1c')](function(_0x5c845d){logger[_0x9406('0xc')](_0x9406('0x1d'),_0x32d151,_0x205c69[_0x9406('0x1e')]);if(_0x588fd3[_0x9406('0x29')]==_0x9406('0x2a')){_0x2f7f73[_0x9406('0xe')]();}else{_0x2f7f73[_0x9406('0x24')]();}})[_0x9406('0x2b')](function(_0x1e82dc){logger[_0x9406('0x1f')](_0x9406('0x1d'),_0x32d151,JSON[_0x9406('0x20')](_0x1e82dc));_0x2f7f73['next']();});}else{_0x2f7f73[_0x9406('0xe')]();}});}}catch(_0x3cec25){logger['error'](_0x9406('0x1d'),_0x32d151,JSON[_0x9406('0x20')](_0x3cec25));_0x2f7f73[_0x9406('0x24')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 51bd04b..d70cede 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4303=['contact','format','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','Message','html','','replace','','headers','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent'];(function(_0x2f8f1f,_0x4ef157){var _0x1af674=function(_0x579d6d){while(--_0x579d6d){_0x2f8f1f['push'](_0x2f8f1f['shift']());}};_0x1af674(++_0x4ef157);}(_0x4303,0x1cc));var _0x3430=function(_0x536941,_0x36adbf){_0x536941=_0x536941-0x0;var _0x5ebabe=_0x4303[_0x536941];return _0x5ebabe;};'use strict';var _=require(_0x3430('0x0'));var moment=require(_0x3430('0x1'));var utils=require(_0x3430('0x2'));var logger=require(_0x3430('0x3'))(_0x3430('0x4'));var rpc={'chatMessage':require(_0x3430('0x5')),'openchannelMessage':require(_0x3430('0x6')),'mailMessage':require(_0x3430('0x7')),'smsMessage':require(_0x3430('0x8')),'faxMessage':require(_0x3430('0x9')),'whatsappMessage':require(_0x3430('0xa')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x3430('0xb')),'mailInteraction':require(_0x3430('0xc')),'smsInteraction':require(_0x3430('0xd')),'faxInteraction':require(_0x3430('0xe')),'whatsappInteraction':require(_0x3430('0xf'))};var mailRpc=require(_0x3430('0x10'));exports[_0x3430('0x11')]=function(_0x8f71dd,_0x396dfb,_0x5cd2d9,_0x2b4f05){return function(_0x3a821b){try{var _0x2b2072=this[_0x3430('0x12')];if(_0x2b2072===_0x3430('0x13')&&_0x2b4f05[_0x3430('0x14')][_0x3430('0x15')]){logger[_0x3430('0x16')](_0x3430('0x17'),_0x8f71dd,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x3a821b[_0x3430('0x18')]();}if(_0x396dfb[0x0]==='1'&&(_[_0x3430('0x19')](this[_0x3430('0x1a')][_0x3430('0x1b')])||!this['interaction'][_0x3430('0x1b')])){logger[_0x3430('0x16')](_0x3430('0x17'),_0x8f71dd,'Autoreply\x20already\x20sent');return _0x3a821b['next']();}if(_0x396dfb[0x0]==='2'&&this[_0x3430('0x1a')]['autoreplyExecuted']){logger[_0x3430('0x16')](_0x3430('0x1c'),_0x8f71dd,_0x3430('0x1d'));return _0x3a821b[_0x3430('0x18')]();}var _0x5b5b0f={'ContactId':this[_0x3430('0x1e')]['id'],'sentAt':moment()[_0x3430('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3430('0x20')};if(this[_0x3430('0x12')]===_0x3430('0x13')){_0x5b5b0f['body']=utils[_0x3430('0x21')](_0x396dfb[0x2],this);}else{_0x5b5b0f[_0x3430('0x14')]=utils[_0x3430('0x21')](_0x396dfb[0x1],this);}if(this[_0x3430('0x22')]){_0x5b5b0f['to']=this['message'][_0x3430('0x23')]||'';if(this[_0x3430('0x12')]===_0x3430('0x13')&&_0x396dfb[0x1]==='1'){_0x5b5b0f['cc']=this[_0x3430('0x22')]['cc']||'';}_0x5b5b0f[_0x3430('0x23')]=this['message']['to']||'';_0x5b5b0f['phone']=this[_0x3430('0x22')][_0x3430('0x24')]||'';_0x5b5b0f[_0x3430('0x25')]=!![];if(this[_0x3430('0x22')][_0x3430('0x26')]){_0x5b5b0f[_0x3430('0x26')]='';_0x5b5b0f[_0x3430('0x26')]+=_[_0x3430('0x27')](this[_0x3430('0x22')][_0x3430('0x26')],'Re:')?'':_0x3430('0x28');_0x5b5b0f['subject']+=this['message'][_0x3430('0x26')];}}if(this['channel']==='chat'){_0x5b5b0f[_0x3430('0x29')]=this[_0x3430('0x2a')]['id'];}else{_0x5b5b0f[_[_0x3430('0x2b')](this['channel'])+_0x3430('0x2c')]=this[_0x3430('0x2a')]['id'];}_0x5b5b0f[_[_0x3430('0x2b')](this['channel'])+'InteractionId']=this[_0x3430('0x1a')]['id'];var _0x1b54ce=this[_0x3430('0x1a')];if(rpc[this[_0x3430('0x12')]+_0x3430('0x2d')]){if(this['channel']===_0x3430('0x13')){_0x5b5b0f['inReplyTo']=this['message']['messageId'];_0x5b5b0f[_0x3430('0x2e')]=_0x3430('0x2f')+_[_0x3430('0x30')](_0x5b5b0f[_0x3430('0x14')],_0x3430('0x31'),'','replace','';_0x23ba1a[_0x2ee4('0x31')]={'Auto-Submitted':_0x2ee4('0x32'),'X-Auto-Response-Suppress':_0x2ee4('0x33'),'Precedence':_0x2ee4('0x34')};return mailRpc[_0x2ee4('0x35')](this['account'][_0x2ee4('0x36')],_0x23ba1a)[_0x2ee4('0x37')](function(_0x5f17b3){logger['info'](_0x2ee4('0x38'),_0x52e289);_0x23ba1a['messageId']=_0x5f17b3[_0x2ee4('0x1d')][_0x2ee4('0x2b')];return rpc[_0x24390a+_0x2ee4('0x39')]['create'](_0x23ba1a);})[_0x2ee4('0x37')](function(_0x32cca9){logger[_0x2ee4('0x12')](_0x2ee4('0xe'),_0x52e289,JSON[_0x2ee4('0x3a')](_0x32cca9));})[_0x2ee4('0x3b')](function(_0x4c474c){logger[_0x2ee4('0x3c')](_0x2ee4('0x3d'),_0x52e289,JSON[_0x2ee4('0x3a')](_0x4c474c));})[_0x2ee4('0x3e')](function(){Promise[_0x2ee4('0x3f')]()[_0x2ee4('0x37')](function(){if(_0x3d64fb[0x0]!=='2'||_0x1c2020[_0x2ee4('0x15')])return;return rpc[_0x24390a+_0x2ee4('0x40')][_0x2ee4('0x41')](_0x1c2020['id'],{'autoreplyExecuted':!![]})[_0x2ee4('0x37')](function(_0x27645a){logger[_0x2ee4('0x12')](_0x2ee4('0x16'),_0x52e289,JSON['stringify'](_0x27645a));})[_0x2ee4('0x3b')](function(_0x3768b9){logger[_0x2ee4('0x3c')](_0x2ee4('0x42'),_0x52e289,JSON[_0x2ee4('0x3a')](_0x3768b9));});})[_0x2ee4('0x37')](function(){_0x4c43b8['next']();});});}else{return rpc[this[_0x2ee4('0xc')]+'Message'][_0x2ee4('0x43')](_0x23ba1a)['then'](function(){logger[_0x2ee4('0x12')](_0x2ee4('0xe'),_0x52e289,_0x23ba1a[_0x2ee4('0xd')]);})[_0x2ee4('0x3b')](function(_0x263496){logger[_0x2ee4('0x3c')](_0x2ee4('0xe'),_0x52e289,JSON[_0x2ee4('0x3a')](_0x263496));})[_0x2ee4('0x3e')](function(){Promise[_0x2ee4('0x3f')]()[_0x2ee4('0x37')](function(){if(_0x3d64fb[0x0]!=='2'||_0x1c2020[_0x2ee4('0x15')])return;return rpc[_0x24390a+'Interaction'][_0x2ee4('0x41')](_0x1c2020['id'],{'autoreplyExecuted':!![]})[_0x2ee4('0x37')](function(_0x2139a8){logger[_0x2ee4('0x12')](_0x2ee4('0x16'),_0x52e289,JSON[_0x2ee4('0x3a')](_0x2139a8));})[_0x2ee4('0x3b')](function(_0x41a48a){logger[_0x2ee4('0x3c')](_0x2ee4('0x42'),_0x52e289,JSON['stringify'](_0x41a48a));});})['then'](function(){_0x4c43b8[_0x2ee4('0x14')]();});});}}}catch(_0x7deec1){logger[_0x2ee4('0x3c')]('[%s][AUTOREPLY]\x20%s',_0x52e289,JSON[_0x2ee4('0x3a')](_0x7deec1));_0x4c43b8[_0x2ee4('0x44')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 48486df..45d4238 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd352=['../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','stringify','finally','[%s][CLOSE]\x20%s','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x246890,_0x46b964){var _0x2b2a5a=function(_0x4f1232){while(--_0x4f1232){_0x246890['push'](_0x246890['shift']());}};_0x2b2a5a(++_0x46b964);}(_0xd352,0xb2));var _0x2d35=function(_0x399dbc,_0x48ada2){_0x399dbc=_0x399dbc-0x0;var _0x586e79=_0xd352[_0x399dbc];return _0x586e79;};'use strict';var moment=require('moment');var logger=require(_0x2d35('0x0'))(_0x2d35('0x1'));var rpc={'chatInteraction':require(_0x2d35('0x2')),'openchannelInteraction':require(_0x2d35('0x3')),'smsInteraction':require(_0x2d35('0x4')),'mailInteraction':require(_0x2d35('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x2d35('0x6'))};exports[_0x2d35('0x7')]=function(_0x1507bb,_0x113ad6,_0x465e55,_0x7414c){return function(_0x523d79){try{logger[_0x2d35('0x8')](_0x2d35('0x9'),_0x1507bb,_0x113ad6[0x0]);var _0x50f19b={'closed':0x1,'closedAt':moment()[_0x2d35('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x2d35('0xb'),'disposition':_0x113ad6[0x0]};if(rpc[_0x7414c[_0x2d35('0xc')]+_0x2d35('0xd')]){rpc[_0x7414c[_0x2d35('0xc')]+_0x2d35('0xd')][_0x2d35('0xe')](_0x7414c[_0x2d35('0xf')]['id'],_0x50f19b)[_0x2d35('0x10')](function(_0x315306){logger[_0x2d35('0x8')](_0x2d35('0x11'),_0x1507bb,_0x7414c[_0x2d35('0xf')]['id']);})['catch'](function(_0x33f101){logger[_0x2d35('0x12')]('[%s][CLOSE]\x20%s',_0x1507bb,JSON[_0x2d35('0x13')](_0x33f101));})[_0x2d35('0x14')](function(){_0x523d79['stop']();});}}catch(_0x304e14){logger[_0x2d35('0x12')](_0x2d35('0x15'),_0x1507bb,JSON['stringify'](_0x304e14));_0x523d79[_0x2d35('0x16')]();}};}; \ No newline at end of file +var _0xa185=['channel','Interaction','update','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0xf967ad,_0x551845){var _0x588ac9=function(_0x33bf07){while(--_0x33bf07){_0xf967ad['push'](_0xf967ad['shift']());}};_0x588ac9(++_0x551845);}(_0xa185,0x186));var _0x5a18=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa185[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x5a18('0x0'));var logger=require('../../../../config/logger')(_0x5a18('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x5a18('0x2')),'faxInteraction':require(_0x5a18('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x206e22,_0x26e07b,_0x374a1c,_0x5b2b3b){return function(_0x46e493){try{logger[_0x5a18('0x4')](_0x5a18('0x5'),_0x206e22,_0x26e07b[0x0]);var _0x116f12={'closed':0x1,'closedAt':moment()[_0x5a18('0x6')](_0x5a18('0x7')),'closeReason':_0x5a18('0x8'),'disposition':_0x26e07b[0x0]};if(rpc[_0x5b2b3b[_0x5a18('0x9')]+_0x5a18('0xa')]){rpc[_0x5b2b3b['channel']+_0x5a18('0xa')][_0x5a18('0xb')](_0x5b2b3b[_0x5a18('0xc')]['id'],_0x116f12)['then'](function(_0x1fc6ab){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x206e22,_0x5b2b3b['interaction']['id']);})[_0x5a18('0xd')](function(_0x409c55){logger[_0x5a18('0xe')](_0x5a18('0xf'),_0x206e22,JSON[_0x5a18('0x10')](_0x409c55));})[_0x5a18('0x11')](function(){_0x46e493[_0x5a18('0x12')]();});}}catch(_0x27c9d0){logger[_0x5a18('0xe')]('[%s][CLOSE]\x20%s',_0x206e22,JSON[_0x5a18('0x10')](_0x27c9d0));_0x46e493[_0x5a18('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 0452485..9480db3 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd68=['InteractionId','created','isEmpty','body','Message','create','then','info','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','dialogflow','fulfillment','speech','providerName','providerResponse','stringify','metadata','endConversation','lodash','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','upperFirst'];(function(_0x3c025e,_0x136a29){var _0x1389e5=function(_0x54db1d){while(--_0x54db1d){_0x3c025e['push'](_0x3c025e['shift']());}};_0x1389e5(++_0x136a29);}(_0xdd68,0x196));var _0x8dd6=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0xdd68[_0x1857c6];return _0x51011c;};'use strict';var _=require(_0x8dd6('0x0'));var moment=require('moment');var apiai=require(_0x8dd6('0x1'));var md5=require(_0x8dd6('0x2'));var utils=require(_0x8dd6('0x3'));var logger=require(_0x8dd6('0x4'))('routing');var rpc={'chatMessage':require(_0x8dd6('0x5')),'openchannelMessage':require(_0x8dd6('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x8dd6('0x7')),'faxMessage':require(_0x8dd6('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x8dd6('0x9')]=function(_0x4c021f,_0x476bad){return function(_0x51f78e){try{if(!_[_0x8dd6('0xa')](this[_0x8dd6('0xb')][_0x8dd6('0xc')])){logger['info'](_0x8dd6('0xd'),_0x4c021f,_0x8dd6('0xe'));return _0x51f78e[_0x8dd6('0xf')]();}var _0x2dc6ea={'ContactId':this[_0x8dd6('0x10')]['id'],'sentAt':moment()[_0x8dd6('0x11')](_0x8dd6('0x12')),'direction':_0x8dd6('0x13')};if(this[_0x8dd6('0x14')]===_0x8dd6('0x15')||this[_0x8dd6('0x14')]===_0x8dd6('0x16')){_0x2dc6ea[_0x8dd6('0x17')]=this['interaction'][_0x8dd6('0x17')];}var _0x3221ce=this[_0x8dd6('0x14')];if(_0x3221ce==='chat'){_0x2dc6ea['ChatWebsiteId']=this[_0x8dd6('0x18')]['id'];}else{_0x2dc6ea[_['upperFirst'](_0x3221ce)+'AccountId']=this[_0x8dd6('0x18')]['id'];}_0x2dc6ea[_[_0x8dd6('0x19')](_0x3221ce)+_0x8dd6('0x1a')]=this[_0x8dd6('0xb')]['id'];if(this[_0x8dd6('0xb')][_0x8dd6('0x1b')]){var _0x31e123=_0x476bad[0x2];if(!_[_0x8dd6('0x1c')](_0x31e123)){_0x2dc6ea[_0x8dd6('0x1d')]=utils['getMustacheRender'](_0x31e123,this);return rpc[_0x3221ce+_0x8dd6('0x1e')][_0x8dd6('0x1f')](_0x2dc6ea)[_0x8dd6('0x20')](function(_0x168a30){logger[_0x8dd6('0x21')](_0x8dd6('0xd'),_0x4c021f,_0x2dc6ea[_0x8dd6('0x1d')]);})[_0x8dd6('0x22')](function(_0x5c579e){logger[_0x8dd6('0x23')](_0x8dd6('0xd'),_0x4c021f,JSON['stringify'](_0x5c579e));})[_0x8dd6('0x24')](function(){logger[_0x8dd6('0x21')](_0x8dd6('0x25'),_0x4c021f);_0x51f78e[_0x8dd6('0x26')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4c021f);_0x51f78e['stop']();}}else{var _0x138216=this;var _0xe6b099=apiai(_0x476bad[0x0],{'language':_0x476bad[0x1]||'en'});return _0xe6b099['textRequest'](this[_0x8dd6('0x27')][_0x8dd6('0x1d')],{'sessionId':md5(this[_0x8dd6('0xb')]['id'])})[_0x8dd6('0x20')](function(_0x3a4c9f){_0x138216['body'][_0x8dd6('0x28')]=_0x3a4c9f;_0x2dc6ea[_0x8dd6('0x1d')]=_0x3a4c9f['result'][_0x8dd6('0x29')][_0x8dd6('0x2a')];_0x2dc6ea[_0x8dd6('0x2b')]='dialogflow';_0x2dc6ea[_0x8dd6('0x2c')]=JSON[_0x8dd6('0x2d')](_0x3a4c9f);return rpc[_0x3221ce+_0x8dd6('0x1e')][_0x8dd6('0x1f')](_0x2dc6ea)[_0x8dd6('0x20')](function(_0x5b77f2){logger[_0x8dd6('0x21')](_0x8dd6('0xd'),_0x4c021f,_0x2dc6ea['body']);if(_0x3a4c9f['result'][_0x8dd6('0x2e')][_0x8dd6('0x2f')]){_0x51f78e[_0x8dd6('0xf')]();}else{_0x51f78e[_0x8dd6('0x26')]();}})[_0x8dd6('0x22')](function(_0x3da00d){logger[_0x8dd6('0x23')](_0x8dd6('0xd'),_0x4c021f,JSON[_0x8dd6('0x2d')](_0x3da00d));_0x51f78e[_0x8dd6('0xf')]();});})[_0x8dd6('0x22')](function(_0x3592d7){logger[_0x8dd6('0x23')](_0x8dd6('0xd'),_0x4c021f,_0x3592d7[_0x8dd6('0x27')]);_0x51f78e[_0x8dd6('0xf')]();});}}catch(_0x2e20d7){logger[_0x8dd6('0x23')](_0x8dd6('0xd'),_0x4c021f,JSON[_0x8dd6('0x2d')](_0x2e20d7));_0x51f78e[_0x8dd6('0x26')]();}};}; \ No newline at end of file +var _0xc949=['[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','account','body','getMustacheRender','create','then','catch','error','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','speech','providerName','stringify','Message','metadata','endConversation','lodash','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xc949,0x181));var _0x9c94=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xc949[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x9c94('0x0'));var moment=require('moment');var apiai=require(_0x9c94('0x1'));var md5=require(_0x9c94('0x2'));var utils=require(_0x9c94('0x3'));var logger=require(_0x9c94('0x4'))('routing');var rpc={'chatMessage':require(_0x9c94('0x5')),'openchannelMessage':require(_0x9c94('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x9c94('0x7')),'faxMessage':require(_0x9c94('0x8')),'whatsappMessage':require(_0x9c94('0x9'))};exports[_0x9c94('0xa')]=function(_0x57fcd7,_0xf373e){return function(_0x360e7b){try{if(!_[_0x9c94('0xb')](this[_0x9c94('0xc')][_0x9c94('0xd')])){logger[_0x9c94('0xe')](_0x9c94('0xf'),_0x57fcd7,_0x9c94('0x10'));return _0x360e7b[_0x9c94('0x11')]();}var _0x3287f8={'ContactId':this['contact']['id'],'sentAt':moment()[_0x9c94('0x12')](_0x9c94('0x13')),'direction':_0x9c94('0x14')};if(this[_0x9c94('0x15')]===_0x9c94('0x16')||this[_0x9c94('0x15')]===_0x9c94('0x17')){_0x3287f8[_0x9c94('0x18')]=this[_0x9c94('0xc')][_0x9c94('0x18')];}var _0x4440b2=this[_0x9c94('0x15')];if(_0x4440b2===_0x9c94('0x19')){_0x3287f8[_0x9c94('0x1a')]=this['account']['id'];}else{_0x3287f8[_[_0x9c94('0x1b')](_0x4440b2)+'AccountId']=this[_0x9c94('0x1c')]['id'];}_0x3287f8[_[_0x9c94('0x1b')](_0x4440b2)+'InteractionId']=this[_0x9c94('0xc')]['id'];if(this['interaction']['created']){var _0xf4054e=_0xf373e[0x2];if(!_['isEmpty'](_0xf4054e)){_0x3287f8[_0x9c94('0x1d')]=utils[_0x9c94('0x1e')](_0xf4054e,this);return rpc[_0x4440b2+'Message'][_0x9c94('0x1f')](_0x3287f8)[_0x9c94('0x20')](function(_0x412804){logger[_0x9c94('0xe')](_0x9c94('0xf'),_0x57fcd7,_0x3287f8[_0x9c94('0x1d')]);})[_0x9c94('0x21')](function(_0x5cb39c){logger[_0x9c94('0x22')](_0x9c94('0xf'),_0x57fcd7,JSON['stringify'](_0x5cb39c));})[_0x9c94('0x23')](function(){logger[_0x9c94('0xe')](_0x9c94('0x24'),_0x57fcd7);_0x360e7b[_0x9c94('0x25')]();});}else{logger[_0x9c94('0xe')](_0x9c94('0x26'),_0x57fcd7);_0x360e7b[_0x9c94('0x25')]();}}else{var _0x23cdf5=this;var _0x8fe4fb=apiai(_0xf373e[0x0],{'language':_0xf373e[0x1]||'en'});return _0x8fe4fb[_0x9c94('0x27')](this[_0x9c94('0x28')][_0x9c94('0x1d')],{'sessionId':md5(this[_0x9c94('0xc')]['id'])})[_0x9c94('0x20')](function(_0x5b1020){_0x23cdf5[_0x9c94('0x1d')][_0x9c94('0x29')]=_0x5b1020;_0x3287f8['body']=_0x5b1020[_0x9c94('0x2a')][_0x9c94('0x2b')][_0x9c94('0x2c')];_0x3287f8[_0x9c94('0x2d')]=_0x9c94('0x29');_0x3287f8['providerResponse']=JSON[_0x9c94('0x2e')](_0x5b1020);return rpc[_0x4440b2+_0x9c94('0x2f')]['create'](_0x3287f8)[_0x9c94('0x20')](function(_0x4cfb9c){logger[_0x9c94('0xe')](_0x9c94('0xf'),_0x57fcd7,_0x3287f8[_0x9c94('0x1d')]);if(_0x5b1020[_0x9c94('0x2a')][_0x9c94('0x30')][_0x9c94('0x31')]){_0x360e7b[_0x9c94('0x11')]();}else{_0x360e7b['stop']();}})['catch'](function(_0xc4a819){logger[_0x9c94('0x22')](_0x9c94('0xf'),_0x57fcd7,JSON['stringify'](_0xc4a819));_0x360e7b[_0x9c94('0x11')]();});})['catch'](function(_0x356ee8){logger[_0x9c94('0x22')](_0x9c94('0xf'),_0x57fcd7,_0x356ee8['message']);_0x360e7b['next']();});}}catch(_0x1f4e4f){logger[_0x9c94('0x22')](_0x9c94('0xf'),_0x57fcd7,JSON['stringify'](_0x1f4e4f));_0x360e7b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 0d30dfc..08f00ca 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd08a=['[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','detectIntent','then','length','dialogflowV2','queryResult','fields','diagnosticInfo','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','all','next','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','catch','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','isEmpty','getMustacheRender','error','stringify','stop'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd08a,0xf8));var _0xad08=function(_0x42a5bf,_0x44388b){_0x42a5bf=_0x42a5bf-0x0;var _0x182b4f=_0xd08a[_0x42a5bf];return _0x182b4f;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0xad08('0x0'));var moment=require(_0xad08('0x1'));var Promise=require(_0xad08('0x2'));var logger=require(_0xad08('0x3'))(_0xad08('0x4'));var utils=require(_0xad08('0x5'));var rpc={'chatMessage':require(_0xad08('0x6')),'openchannelMessage':require(_0xad08('0x7')),'mailMessage':require(_0xad08('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xad08('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x547d9b,_0x4ff0a5,_0x108836,_0x22821d){return new Promise(function(_0x5f0e6e,_0x334c18){var _0x548879=_[_0xad08('0xa')](_0x108836);_0x548879[_0xad08('0xb')]=_0x22821d;return rpc[_0x4ff0a5+_0xad08('0xc')][_0xad08('0xd')](_0x548879)['then'](function(){logger[_0xad08('0xe')](_0xad08('0xf'),_0x547d9b,_0x548879[_0xad08('0xb')]);_0x5f0e6e();})[_0xad08('0x10')](function(_0x158154){logger['error'](_0xad08('0xf'),_0x547d9b,JSON['stringify'](_0x158154));_0x334c18(_0x158154);});});}exports[_0xad08('0x11')]=function(_0x149e89,_0x5a3b6d){return function(_0x3c91b8){try{if(!_[_0xad08('0x12')](this[_0xad08('0x13')][_0xad08('0x14')])){logger[_0xad08('0xe')](_0xad08('0xf'),_0x149e89,_0xad08('0x15'));return _0x3c91b8['next']();}var _0x588c59={'ContactId':this[_0xad08('0x16')]['id'],'sentAt':moment()[_0xad08('0x17')](_0xad08('0x18')),'direction':_0xad08('0x19')};if(this[_0xad08('0x1a')]===_0xad08('0x1b')||this['channel']===_0xad08('0x1c')){_0x588c59[_0xad08('0x1d')]=this[_0xad08('0x13')][_0xad08('0x1d')];}var _0x2f7158=this[_0xad08('0x1a')];if(_0x2f7158===_0xad08('0x1e')){_0x588c59['ChatWebsiteId']=this[_0xad08('0x1f')]['id'];}else{_0x588c59[_[_0xad08('0x20')](_0x2f7158)+_0xad08('0x21')]=this['account']['id'];}_0x588c59[_[_0xad08('0x20')](_0x2f7158)+_0xad08('0x22')]=this[_0xad08('0x13')]['id'];if(this[_0xad08('0x13')]['created']){var _0x5a5c8f=_0x5a3b6d[0x4];if(!_[_0xad08('0x23')](_0x5a5c8f)){_0x588c59[_0xad08('0xb')]=utils[_0xad08('0x24')](_0x5a5c8f,this);return rpc[_0x2f7158+_0xad08('0xc')][_0xad08('0xd')](_0x588c59)['then'](function(_0x3275a0){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x149e89,_0x588c59[_0xad08('0xb')]);})[_0xad08('0x10')](function(_0x19ebae){logger[_0xad08('0x25')]('[%s][DIALOGFLOWV2]\x20%s',_0x149e89,JSON[_0xad08('0x26')](_0x19ebae));})['finally'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x149e89);_0x3c91b8[_0xad08('0x27')]();});}else{logger[_0xad08('0xe')](_0xad08('0x28'),_0x149e89);_0x3c91b8[_0xad08('0x27')]();}}else{var _0x4580e4=this;var _0x3b37b4=_0x5a3b6d[0x2][_0xad08('0x29')](/\\n/g,'\x0a');var _0x256be5={'credentials':{'private_key':_0x3b37b4,'client_email':_0x5a3b6d[0x1]}};var _0x206f29=new dialogflow['SessionsClient'](_0x256be5);var _0x59a0e6=_0x206f29[_0xad08('0x2a')](_0x5a3b6d[0x0],md5(_0x4580e4['interaction']['id']));var _0x158086={'session':_0x59a0e6,'queryInput':{'text':{'text':_0x4580e4['message'][_0xad08('0xb')],'languageCode':_0x5a3b6d[0x3]||'en'}}};return _0x206f29[_0xad08('0x2b')](_0x158086)[_0xad08('0x2c')](function(_0x1581dd){if(_0x1581dd&&_0x1581dd[_0xad08('0x2d')]){_0x4580e4[_0xad08('0xb')][_0xad08('0x2e')]=_0x1581dd;var _0xd6c96=_0x1581dd[0x0];var _0x353c6e=_0xd6c96[_0xad08('0x2f')]['diagnosticInfo']&&_0xd6c96['queryResult']['diagnosticInfo'][_0xad08('0x30')]?_0xd6c96['queryResult'][_0xad08('0x31')][_0xad08('0x30')]['end_conversation']['boolValue']:![];_0x4580e4[_0xad08('0xb')]['DIALOGFLOWV2_ACTION']=_0xd6c96[_0xad08('0x2f')][_0xad08('0x32')];_0x4580e4['body'][_0xad08('0x33')]=_0xd6c96[_0xad08('0x2f')][_0xad08('0x34')];_0x4580e4[_0xad08('0xb')][_0xad08('0x35')]=_0xd6c96[_0xad08('0x2f')][_0xad08('0x31')]&&_0xd6c96[_0xad08('0x2f')][_0xad08('0x31')][_0xad08('0x30')]?_0xd6c96[_0xad08('0x2f')][_0xad08('0x31')][_0xad08('0x30')][_0xad08('0x36')][_0xad08('0x37')]:![];_0x4580e4['body'][_0xad08('0x38')]=_0xd6c96[_0xad08('0x2f')][_0xad08('0x39')][_0xad08('0x3a')];_0x4580e4['body'][_0xad08('0x3b')]=_0xd6c96[_0xad08('0x2f')][_0xad08('0x39')]['displayName'];_0x4580e4[_0xad08('0xb')][_0xad08('0x3c')]=_0xd6c96['queryResult'][_0xad08('0x39')][_0xad08('0x3d')];_0x4580e4['body'][_0xad08('0x3e')]=_0xd6c96[_0xad08('0x2f')][_0xad08('0x3f')];_0x4580e4[_0xad08('0xb')][_0xad08('0x40')]=_0xd6c96[_0xad08('0x2f')]['queryText'];_0x4580e4[_0xad08('0xb')][_0xad08('0x41')]=_0xd6c96[_0xad08('0x2f')]['intentDetectionConfidence'];_0x588c59[_0xad08('0x42')]='dialogflowV2';_0x588c59[_0xad08('0x43')]=JSON[_0xad08('0x26')](_0x1581dd);var _0x3272a6=[];for(var _0x23201e=0x0;_0x23201e<_0x1581dd[_0xad08('0x2d')];_0x23201e++){var _0x517a7a=_0x1581dd[_0x23201e];if(_0x517a7a&&_0x517a7a['queryResult']&&_0x517a7a[_0xad08('0x2f')][_0xad08('0x44')]){_0x3272a6[_0xad08('0x45')](createMessage(_0x149e89,_0x2f7158,_0x588c59,_0x517a7a[_0xad08('0x2f')][_0xad08('0x44')]));}}return Promise[_0xad08('0x46')](_0x3272a6)['then'](function(){if(_0x353c6e){_0x3c91b8[_0xad08('0x47')]();}else{_0x3c91b8['stop']();}})[_0xad08('0x10')](function(_0x2abec1){logger[_0xad08('0x25')](_0xad08('0xf'),_0x149e89,JSON[_0xad08('0x26')](_0x2abec1));_0x3c91b8[_0xad08('0x47')]();});}})[_0xad08('0x10')](function(_0x40a8f8){logger['error'](_0xad08('0xf'),_0x149e89,_0x40a8f8['message']);_0x3c91b8[_0xad08('0x47')]();});}}catch(_0x4668c0){logger['error'](_0xad08('0xf'),_0x149e89,JSON[_0xad08('0x26')](_0x4668c0));_0x3c91b8[_0xad08('0x27')]();}};}; \ No newline at end of file +var _0x6d03=['DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','lodash','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','Message','create','[%s][DIALOGFLOWV2]\x20%s','catch','error','consequence','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','isEmpty','getMustacheRender','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','message','then','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue'];(function(_0x22e953,_0x10a297){var _0x2d4bdc=function(_0x3fc8f4){while(--_0x3fc8f4){_0x22e953['push'](_0x22e953['shift']());}};_0x2d4bdc(++_0x10a297);}(_0x6d03,0x177));var _0x36d0=function(_0x24c6b0,_0x53d017){_0x24c6b0=_0x24c6b0-0x0;var _0x17159d=_0x6d03[_0x24c6b0];return _0x17159d;};'use strict';var _=require(_0x36d0('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x36d0('0x1'));var moment=require(_0x36d0('0x2'));var Promise=require(_0x36d0('0x3'));var logger=require(_0x36d0('0x4'))(_0x36d0('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x36d0('0x6')),'openchannelMessage':require(_0x36d0('0x7')),'mailMessage':require(_0x36d0('0x8')),'smsMessage':require(_0x36d0('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x36d0('0xa'))};function createMessage(_0x31ced6,_0x3c4646,_0x3267c9,_0x1a1490){return new Promise(function(_0x296659,_0x4b0899){var _0x36cc21=_[_0x36d0('0xb')](_0x3267c9);_0x36cc21[_0x36d0('0xc')]=_0x1a1490;return rpc[_0x3c4646+_0x36d0('0xd')][_0x36d0('0xe')](_0x36cc21)['then'](function(){logger['info'](_0x36d0('0xf'),_0x31ced6,_0x36cc21[_0x36d0('0xc')]);_0x296659();})[_0x36d0('0x10')](function(_0x28beee){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x31ced6,JSON['stringify'](_0x28beee));_0x4b0899(_0x28beee);});});}exports[_0x36d0('0x12')]=function(_0x525e43,_0x4d62c9){return function(_0x4a27a0){try{if(!_['isNil'](this['interaction'][_0x36d0('0x13')])){logger[_0x36d0('0x14')](_0x36d0('0xf'),_0x525e43,_0x36d0('0x15'));return _0x4a27a0[_0x36d0('0x16')]();}var _0x44e2a7={'ContactId':this[_0x36d0('0x17')]['id'],'sentAt':moment()[_0x36d0('0x18')](_0x36d0('0x19')),'direction':_0x36d0('0x1a')};if(this[_0x36d0('0x1b')]==='sms'||this['channel']===_0x36d0('0x1c')){_0x44e2a7[_0x36d0('0x1d')]=this['interaction'][_0x36d0('0x1d')];}var _0x163cf7=this[_0x36d0('0x1b')];if(_0x163cf7===_0x36d0('0x1e')){_0x44e2a7[_0x36d0('0x1f')]=this[_0x36d0('0x20')]['id'];}else{_0x44e2a7[_[_0x36d0('0x21')](_0x163cf7)+'AccountId']=this[_0x36d0('0x20')]['id'];}_0x44e2a7[_['upperFirst'](_0x163cf7)+_0x36d0('0x22')]=this[_0x36d0('0x23')]['id'];if(this[_0x36d0('0x23')]['created']){var _0x378d04=_0x4d62c9[0x4];if(!_[_0x36d0('0x24')](_0x378d04)){_0x44e2a7[_0x36d0('0xc')]=utils[_0x36d0('0x25')](_0x378d04,this);return rpc[_0x163cf7+'Message'][_0x36d0('0xe')](_0x44e2a7)['then'](function(_0x2d3cd5){logger[_0x36d0('0x14')](_0x36d0('0xf'),_0x525e43,_0x44e2a7[_0x36d0('0xc')]);})[_0x36d0('0x10')](function(_0x32b9ad){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x525e43,JSON[_0x36d0('0x26')](_0x32b9ad));})[_0x36d0('0x27')](function(){logger[_0x36d0('0x14')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x525e43);_0x4a27a0[_0x36d0('0x28')]();});}else{logger['info'](_0x36d0('0x29'),_0x525e43);_0x4a27a0[_0x36d0('0x28')]();}}else{var _0x5cefc8=this;var _0x263fad=_0x4d62c9[0x2]['replace'](/\\n/g,'\x0a');var _0x25d204={'credentials':{'private_key':_0x263fad,'client_email':_0x4d62c9[0x1]}};var _0x1c88db=new dialogflow[(_0x36d0('0x2a'))](_0x25d204);var _0x2e73dd=_0x1c88db['sessionPath'](_0x4d62c9[0x0],md5(_0x5cefc8[_0x36d0('0x23')]['id']));var _0x5067d4={'session':_0x2e73dd,'queryInput':{'text':{'text':_0x5cefc8[_0x36d0('0x2b')][_0x36d0('0xc')],'languageCode':_0x4d62c9[0x3]||'en'}}};return _0x1c88db['detectIntent'](_0x5067d4)[_0x36d0('0x2c')](function(_0xf73115){if(_0xf73115&&_0xf73115[_0x36d0('0x2d')]){_0x5cefc8['body'][_0x36d0('0x2e')]=_0xf73115;var _0x580ec3=_0xf73115[0x0];var _0x317206=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')]&&_0x580ec3['queryResult'][_0x36d0('0x30')]['fields']?_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')][_0x36d0('0x31')]['end_conversation'][_0x36d0('0x32')]:![];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x33')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x34')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x35')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x36')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x37')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')]&&_0x580ec3['queryResult'][_0x36d0('0x30')][_0x36d0('0x31')]?_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')]['fields'][_0x36d0('0x38')][_0x36d0('0x32')]:![];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x39')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x3a')]['name'];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x3b')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x3a')][_0x36d0('0x3c')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x3d')]=_0x580ec3[_0x36d0('0x2f')]['intent'][_0x36d0('0x3e')];_0x5cefc8[_0x36d0('0xc')]['DIALOGFLOWV2_LANGUAGECODE']=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x3f')];_0x5cefc8[_0x36d0('0xc')]['DIALOGFLOWV2_QUERYTEXT']=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x40')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x41')]=_0x580ec3['queryResult'][_0x36d0('0x42')];_0x44e2a7[_0x36d0('0x43')]=_0x36d0('0x2e');_0x44e2a7[_0x36d0('0x44')]=JSON[_0x36d0('0x26')](_0xf73115);var _0x5aa7b4=[];for(var _0x3e3bfd=0x0;_0x3e3bfd<_0xf73115['length'];_0x3e3bfd++){var _0x56a7cd=_0xf73115[_0x3e3bfd];if(_0x56a7cd&&_0x56a7cd[_0x36d0('0x2f')]&&_0x56a7cd['queryResult'][_0x36d0('0x45')]){_0x5aa7b4[_0x36d0('0x46')](createMessage(_0x525e43,_0x163cf7,_0x44e2a7,_0x56a7cd[_0x36d0('0x2f')][_0x36d0('0x45')]));}}return Promise['all'](_0x5aa7b4)[_0x36d0('0x2c')](function(){if(_0x317206){_0x4a27a0[_0x36d0('0x16')]();}else{_0x4a27a0['stop']();}})[_0x36d0('0x10')](function(_0x44a98f){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x525e43,JSON[_0x36d0('0x26')](_0x44a98f));_0x4a27a0[_0x36d0('0x16')]();});}})[_0x36d0('0x10')](function(_0x489f55){logger['error'](_0x36d0('0xf'),_0x525e43,_0x489f55[_0x36d0('0x2b')]);_0x4a27a0[_0x36d0('0x16')]();});}}catch(_0x511694){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x525e43,JSON[_0x36d0('0x26')](_0x511694));_0x4a27a0[_0x36d0('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 6c15f47..021895f 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe624=['./utils','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','length','error','map','message','stop','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text'];(function(_0x4f708c,_0x56a9c4){var _0x134ed1=function(_0x184aef){while(--_0x184aef){_0x4f708c['push'](_0x4f708c['shift']());}};_0x134ed1(++_0x56a9c4);}(_0xe624,0x65));var _0x4e62=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xe624[_0x411add];return _0x238242;};'use strict';var schema=require(_0x4e62('0x0'));var _=require(_0x4e62('0x1'));var htmlToText=require(_0x4e62('0x2'));var utils=require(_0x4e62('0x3'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0x4e62('0x4'),'required':!![],'message':_0x4e62('0x5')},'priorityTrue':{'type':_0x4e62('0x6'),'message':_0x4e62('0x7')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x4e62('0x8')]=function(_0x235f92,_0x29d2e3){return function(_0x319ca8){try{var _0x39986a={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x29d2e3[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x29d2e3[0x1],'priorityFalse':_0x29d2e3[0x2]};var _0x3b86c4=gotoif[_0x4e62('0x0')](_0x39986a,{'typecast':!![]});if(_0x3b86c4[_0x4e62('0x9')]){logger[_0x4e62('0xa')]('[%s][GOTOIF]\x20%s',_0x235f92,_[_0x4e62('0xb')](_0x3b86c4,_0x4e62('0xc'))['join'](',\x20'));_0x319ca8[_0x4e62('0xd')]();}else{try{var _0x5917e7=eval('('+_0x39986a[_0x4e62('0xe')]+')');var _0x283df8=_0x5917e7?_0x39986a[_0x4e62('0xf')]:_0x39986a['priorityFalse'];logger['info'](_0x4e62('0x10'),_0x235f92,_0x39986a[_0x4e62('0xe')],_0x5917e7,_0x283df8||_0x4e62('0x11'));if(_0x283df8){var _0x4365c=_[_0x4e62('0x12')](_0x319ca8[_0x4e62('0x13')](),{'p':_0x283df8});if(_0x4365c>=0x0){logger[_0x4e62('0x14')](_0x4e62('0x15'),_0x235f92,_0x283df8||_0x4e62('0x11'),_0x4365c);_0x319ca8[_0x4e62('0x11')](_0x4365c);}else{logger['info'](_0x4e62('0x16'),_0x235f92,_0x283df8||_0x4e62('0x11'));_0x319ca8[_0x4e62('0xd')]();}}else{_0x319ca8[_0x4e62('0x11')]();}}catch(_0x47f609){logger[_0x4e62('0xa')](_0x4e62('0x17'),_0x235f92,_0x47f609[_0x4e62('0xc')]);_0x319ca8[_0x4e62('0xd')]();}}}catch(_0x56e7f8){logger[_0x4e62('0xa')](_0x4e62('0x18'),_0x235f92,JSON[_0x4e62('0x19')](_0x56e7f8));_0x319ca8[_0x4e62('0xd')]();}};}; \ No newline at end of file +var _0x095e=['replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString'];(function(_0x6547e1,_0x15d31e){var _0xf4e6d7=function(_0x306148){while(--_0x306148){_0x6547e1['push'](_0x6547e1['shift']());}};_0xf4e6d7(++_0x15d31e);}(_0x095e,0x118));var _0xe095=function(_0x442f3c,_0x46dfff){_0x442f3c=_0x442f3c-0x0;var _0x1dd35b=_0x095e[_0x442f3c];return _0x1dd35b;};'use strict';var schema=require(_0xe095('0x0'));var _=require(_0xe095('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0xe095('0x2'))(_0xe095('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xe095('0x4')},'priorityTrue':{'type':'number','message':_0xe095('0x5')},'priorityFalse':{'type':_0xe095('0x6'),'message':_0xe095('0x7')}});exports[_0xe095('0x8')]=function(_0x2b2d20,_0x5d3f00){return function(_0x2b820a){try{var _0x5202d3={'condition':htmlToText[_0xe095('0x9')](utils['getMustacheRender'](_0x5d3f00[0x0],this),{'wordwrap':![]})[_0xe095('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5d3f00[0x1],'priorityFalse':_0x5d3f00[0x2]};var _0x3d5241=gotoif[_0xe095('0x0')](_0x5202d3,{'typecast':!![]});if(_0x3d5241[_0xe095('0xb')]){logger['error'](_0xe095('0xc'),_0x2b2d20,_[_0xe095('0xd')](_0x3d5241,_0xe095('0xe'))[_0xe095('0xf')](',\x20'));_0x2b820a[_0xe095('0x10')]();}else{try{var _0x52fc87=eval('('+_0x5202d3[_0xe095('0x11')]+')');var _0x103f65=_0x52fc87?_0x5202d3[_0xe095('0x12')]:_0x5202d3[_0xe095('0x13')];logger[_0xe095('0x14')](_0xe095('0x15'),_0x2b2d20,_0x5202d3[_0xe095('0x11')],_0x52fc87,_0x103f65||_0xe095('0x16'));if(_0x103f65){var _0x3da7f9=_[_0xe095('0x17')](_0x2b820a[_0xe095('0x18')](),{'p':_0x103f65});if(_0x3da7f9>=0x0){logger[_0xe095('0x14')](_0xe095('0x19'),_0x2b2d20,_0x103f65||'next',_0x3da7f9);_0x2b820a['next'](_0x3da7f9);}else{logger[_0xe095('0x14')](_0xe095('0x1a'),_0x2b2d20,_0x103f65||_0xe095('0x16'));_0x2b820a[_0xe095('0x10')]();}}else{_0x2b820a[_0xe095('0x16')]();}}catch(_0x3b268a){logger[_0xe095('0x1b')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2b2d20,_0x3b268a[_0xe095('0xe')]);_0x2b820a[_0xe095('0x10')]();}}}catch(_0x3b6f33){logger[_0xe095('0x1b')](_0xe095('0xc'),_0x2b2d20,JSON[_0xe095('0x1c')](_0x3b6f33));_0x2b820a[_0xe095('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index cab7f13..ef15ee1 100644 --- a/server/services/routing/server/applications/gotop.js +++ b/server/services/routing/server/applications/gotop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fb3=['[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','rules','info','priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length'];(function(_0x3e6cd7,_0x584a59){var _0x1062e5=function(_0x48849c){while(--_0x48849c){_0x3e6cd7['push'](_0x3e6cd7['shift']());}};_0x1062e5(++_0x584a59);}(_0x3fb3,0x19d));var _0x33fb=function(_0x31ebb7,_0x19953b){_0x31ebb7=_0x31ebb7-0x0;var _0x370376=_0x3fb3[_0x31ebb7];return _0x370376;};'use strict';var schema=require(_0x33fb('0x0'));var _=require(_0x33fb('0x1'));var logger=require(_0x33fb('0x2'))(_0x33fb('0x3'));var gotop=schema({'priority':{'type':_0x33fb('0x4'),'required':!![],'message':_0x33fb('0x5')}});exports['consequence']=function(_0x195fa8,_0x22bbfb){return function(_0x16f94c){try{var _0x53f169={'priority':_0x22bbfb[0x0]};var _0x3ab4cc=gotop['validate'](_0x53f169,{'typecast':!![]});if(_0x3ab4cc[_0x33fb('0x6')]){logger['error'](_0x33fb('0x7'),_0x195fa8,_[_0x33fb('0x8')](_0x3ab4cc,_0x33fb('0x9'))[_0x33fb('0xa')](',\x20'));_0x16f94c[_0x33fb('0xb')]();}else{logger['info'](_0x33fb('0xc'),_0x195fa8,_0x53f169['priority']);if(_0x53f169['priority']){var _0x4a8090=_['findIndex'](_0x16f94c[_0x33fb('0xd')](),{'p':_0x53f169['priority']});if(_0x4a8090>=0x0){logger[_0x33fb('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x195fa8,_0x53f169[_0x33fb('0xf')]||_0x33fb('0x10'),_0x4a8090);_0x16f94c[_0x33fb('0x10')](_0x4a8090);}else{logger[_0x33fb('0xe')](_0x33fb('0x11'),_0x195fa8,_0x53f169[_0x33fb('0xf')]||_0x33fb('0x10'));_0x16f94c[_0x33fb('0xb')]();}}else{_0x16f94c[_0x33fb('0x10')]();}}}catch(_0x2059f5){logger[_0x33fb('0x12')]('[%s][GOTOP]\x20%s',_0x195fa8,JSON[_0x33fb('0x13')](_0x2059f5));_0x16f94c['stop']();}};}; \ No newline at end of file +var _0xe926=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','message','stop','info'];(function(_0x3ecf2c,_0x4f4340){var _0x29bab3=function(_0x4764f8){while(--_0x4764f8){_0x3ecf2c['push'](_0x3ecf2c['shift']());}};_0x29bab3(++_0x4f4340);}(_0xe926,0xb2));var _0x6e92=function(_0x405385,_0x56f573){_0x405385=_0x405385-0x0;var _0x43837b=_0xe926[_0x405385];return _0x43837b;};'use strict';var schema=require('validate');var _=require(_0x6e92('0x0'));var logger=require('../../../../config/logger')(_0x6e92('0x1'));var gotop=schema({'priority':{'type':_0x6e92('0x2'),'required':!![],'message':_0x6e92('0x3')}});exports[_0x6e92('0x4')]=function(_0x40edc1,_0x22d742){return function(_0xa3ef0f){try{var _0x16fd24={'priority':_0x22d742[0x0]};var _0x1e3a5f=gotop[_0x6e92('0x5')](_0x16fd24,{'typecast':!![]});if(_0x1e3a5f[_0x6e92('0x6')]){logger[_0x6e92('0x7')](_0x6e92('0x8'),_0x40edc1,_['map'](_0x1e3a5f,_0x6e92('0x9'))['join'](',\x20'));_0xa3ef0f[_0x6e92('0xa')]();}else{logger[_0x6e92('0xb')](_0x6e92('0xc'),_0x40edc1,_0x16fd24[_0x6e92('0xd')]);if(_0x16fd24['priority']){var _0x16b5aa=_[_0x6e92('0xe')](_0xa3ef0f['rules'](),{'p':_0x16fd24['priority']});if(_0x16b5aa>=0x0){logger['info'](_0x6e92('0xf'),_0x40edc1,_0x16fd24[_0x6e92('0xd')]||'next',_0x16b5aa);_0xa3ef0f[_0x6e92('0x10')](_0x16b5aa);}else{logger['info'](_0x6e92('0x11'),_0x40edc1,_0x16fd24[_0x6e92('0xd')]||_0x6e92('0x10'));_0xa3ef0f[_0x6e92('0xa')]();}}else{_0xa3ef0f[_0x6e92('0x10')]();}}}catch(_0x2784d4){logger[_0x6e92('0x7')](_0x6e92('0x8'),_0x40edc1,JSON[_0x6e92('0x12')](_0x2784d4));_0xa3ef0f[_0x6e92('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index d47350f..67b67c8 100644 --- a/server/services/routing/server/applications/message.js +++ b/server/services/routing/server/applications/message.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x464b=['contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','then','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0x5c634a,_0x566d35){var _0x4c0be2=function(_0xa57df1){while(--_0xa57df1){_0x5c634a['push'](_0x5c634a['shift']());}};_0x4c0be2(++_0x566d35);}(_0x464b,0x161));var _0xb464=function(_0x3ed13,_0x45158a){_0x3ed13=_0x3ed13-0x0;var _0x1c9d05=_0x464b[_0x3ed13];return _0x1c9d05;};'use strict';var _=require(_0xb464('0x0'));var utils=require(_0xb464('0x1'));var logger=require(_0xb464('0x2'))(_0xb464('0x3'));var rpc={'chatMessage':require(_0xb464('0x4')),'openchannelMessage':require(_0xb464('0x5')),'mailMessage':require(_0xb464('0x6')),'smsMessage':require(_0xb464('0x7')),'faxMessage':require(_0xb464('0x8')),'whatsappMessage':require(_0xb464('0x9'))};exports[_0xb464('0xa')]=function(_0x274da9,_0x4553f7){return function(_0x58b7ff){try{var _0xca093a={'body':utils['getMustacheRender'](_0x4553f7[0x0],this),'ContactId':this[_0xb464('0xb')]['id']};if(this[_0xb464('0xc')]===_0xb464('0xd')){_0xca093a[_0xb464('0xe')]=this[_0xb464('0xf')]['id'];}else{_0xca093a[_[_0xb464('0x10')](this[_0xb464('0xc')])+_0xb464('0x11')]=this[_0xb464('0xf')]['id'];}_0xca093a[_[_0xb464('0x10')](this[_0xb464('0xc')])+_0xb464('0x12')]=this[_0xb464('0x13')]['id'];if(rpc[this[_0xb464('0xc')]+'Message']){return rpc[this[_0xb464('0xc')]+'Message']['create'](_0xca093a)[_0xb464('0x14')](function(_0x3af139){logger['info']('[%s][MESSAGE]\x20%s',_0x274da9,_0xca093a[_0xb464('0x15')]);_0x58b7ff[_0xb464('0x16')]();})[_0xb464('0x17')](function(_0x495302){logger[_0xb464('0x18')](_0xb464('0x19'),_0x274da9,JSON[_0xb464('0x1a')](_0x495302));_0x58b7ff[_0xb464('0x1b')]();});}}catch(_0x364326){logger[_0xb464('0x18')](_0xb464('0x19'),_0x274da9,JSON[_0xb464('0x1a')](_0x364326));_0x58b7ff['stop']();}};}; \ No newline at end of file +var _0x8603=['./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','account','upperFirst','AccountId','channel','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error'];(function(_0x31ad87,_0xb82bee){var _0x5dc642=function(_0xd42334){while(--_0xd42334){_0x31ad87['push'](_0x31ad87['shift']());}};_0x5dc642(++_0xb82bee);}(_0x8603,0x190));var _0x3860=function(_0x41d81a,_0x32ffc9){_0x41d81a=_0x41d81a-0x0;var _0x372a1b=_0x8603[_0x41d81a];return _0x372a1b;};'use strict';var _=require('lodash');var utils=require(_0x3860('0x0'));var logger=require(_0x3860('0x1'))(_0x3860('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3860('0x3')),'smsMessage':require(_0x3860('0x4')),'faxMessage':require(_0x3860('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3860('0x6')]=function(_0x56f8c5,_0xb0fc24){return function(_0x40739b){try{var _0x1eca44={'body':utils[_0x3860('0x7')](_0xb0fc24[0x0],this),'ContactId':this[_0x3860('0x8')]['id']};if(this['channel']==='chat'){_0x1eca44['ChatWebsiteId']=this[_0x3860('0x9')]['id'];}else{_0x1eca44[_[_0x3860('0xa')](this['channel'])+_0x3860('0xb')]=this[_0x3860('0x9')]['id'];}_0x1eca44[_['upperFirst'](this[_0x3860('0xc')])+_0x3860('0xd')]=this['interaction']['id'];if(rpc[this[_0x3860('0xc')]+_0x3860('0xe')]){return rpc[this['channel']+_0x3860('0xe')][_0x3860('0xf')](_0x1eca44)[_0x3860('0x10')](function(_0x1ea619){logger[_0x3860('0x11')](_0x3860('0x12'),_0x56f8c5,_0x1eca44[_0x3860('0x13')]);_0x40739b[_0x3860('0x14')]();})[_0x3860('0x15')](function(_0x46264d){logger['error'](_0x3860('0x12'),_0x56f8c5,JSON[_0x3860('0x16')](_0x46264d));_0x40739b[_0x3860('0x17')]();});}}catch(_0x37d9ab){logger[_0x3860('0x18')](_0x3860('0x12'),_0x56f8c5,JSON[_0x3860('0x16')](_0x37d9ab));_0x40739b[_0x3860('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 7de124d..5ee98a1 100644 --- a/server/services/routing/server/applications/noop.js +++ b/server/services/routing/server/applications/noop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbded=['consequence','info','getMustacheRender','next','error','stringify','./utils','routing'];(function(_0x3719ec,_0x4638c2){var _0x53af3a=function(_0xd55f21){while(--_0xd55f21){_0x3719ec['push'](_0x3719ec['shift']());}};_0x53af3a(++_0x4638c2);}(_0xbded,0x1ce));var _0xdbde=function(_0x2072d4,_0x29e371){_0x2072d4=_0x2072d4-0x0;var _0x3ffab1=_0xbded[_0x2072d4];return _0x3ffab1;};'use strict';var utils=require(_0xdbde('0x0'));var logger=require('../../../../config/logger')(_0xdbde('0x1'));exports[_0xdbde('0x2')]=function(_0x51b356,_0x51568c){return function(_0xdcc9e1){try{logger[_0xdbde('0x3')]('[%s][NOOP]\x20%s',_0x51b356,utils[_0xdbde('0x4')](_0x51568c[0x0],this));_0xdcc9e1[_0xdbde('0x5')]();}catch(_0x2b52a3){logger[_0xdbde('0x6')]('[%s][NOOP]\x20%s',_0x51b356,JSON[_0xdbde('0x7')](_0x2b52a3));_0xdcc9e1['stop']();}};}; \ No newline at end of file +var _0x6c1f=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','./utils','../../../../config/logger','routing'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6c1f,0xc3));var _0xf6c1=function(_0x2e4a0f,_0x3a9bb6){_0x2e4a0f=_0x2e4a0f-0x0;var _0x25a3cd=_0x6c1f[_0x2e4a0f];return _0x25a3cd;};'use strict';var utils=require(_0xf6c1('0x0'));var logger=require(_0xf6c1('0x1'))(_0xf6c1('0x2'));exports[_0xf6c1('0x3')]=function(_0x376ca5,_0x2682a1){return function(_0x5aae4a){try{logger[_0xf6c1('0x4')](_0xf6c1('0x5'),_0x376ca5,utils[_0xf6c1('0x6')](_0x2682a1[0x0],this));_0x5aae4a[_0xf6c1('0x7')]();}catch(_0x5503d1){logger['error'](_0xf6c1('0x5'),_0x376ca5,JSON[_0xf6c1('0x8')](_0x5503d1));_0x5aae4a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index b6f0b8e..d016b1c 100644 --- a/server/services/routing/server/applications/queue.js +++ b/server/services/routing/server/applications/queue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cce=['queue','joinAt','clone','push','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','interaction','channel','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','create','create\x20queue\x20report','accepted','update','catch','error','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','validate','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','log','stack','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','queue_id','account'];(function(_0x47f751,_0x2a6dbc){var _0x63ef66=function(_0x5890c7){while(--_0x5890c7){_0x47f751['push'](_0x47f751['shift']());}};_0x63ef66(++_0x2a6dbc);}(_0x5cce,0x8f));var _0xe5cc=function(_0x4cc998,_0x3b890a){_0x4cc998=_0x4cc998-0x0;var _0x9576d3=_0x5cce[_0x4cc998];return _0x9576d3;};'use strict';var schema=require('validate');var _=require(_0xe5cc('0x0'));var util=require(_0xe5cc('0x1'));var seqqueue=require(_0xe5cc('0x2'));var moment=require(_0xe5cc('0x3'));var Redis=require('ioredis');var config=require(_0xe5cc('0x4'));var logger=require(_0xe5cc('0x5'))('routing');var strategy=require(_0xe5cc('0x6'));config[_0xe5cc('0x7')]=_[_0xe5cc('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xe5cc('0x9'),_0xe5cc('0xa'),_0xe5cc('0xb'),'from',_0xe5cc('0xc')];function emit(_0x4de99c,_0x47acb1,_0x4f7a4a){io['to'](_0x4de99c)['emit'](_0x47acb1,_0x4f7a4a);}function emitChannelQueueInteraction(_0x1f8e85,_0x53b807,_0xb08ba0,_0x7169ee,_0x85ac84,_0x1a8564,_0x4dc5a0,_0x53ff9d){var _0x4cec30=_[_0xe5cc('0xd')](_0xb08ba0);_0x4cec30[_0xe5cc('0x9')]=_0x53ff9d;_0x4cec30[_0xe5cc('0xb')]=_0x53b807;_0x4cec30['account']=_0x7169ee;_0x4cec30['id']=_0x85ac84;if(_0x1a8564){attributes[_0xe5cc('0xe')](_[_0xe5cc('0xf')](_0x1f8e85)+_0xe5cc('0x10'));_0x4dc5a0[util['format'](_0xe5cc('0x11'),_0x1f8e85)][_0x85ac84]=_[_0xe5cc('0x12')](_0x4cec30,attributes);}else{delete _0x4dc5a0[util[_0xe5cc('0x13')](_0xe5cc('0x11'),_0x1f8e85)][_0x85ac84];}emit(util[_0xe5cc('0x13')](_0xe5cc('0x14'),_0x1f8e85,_0x53b807),util[_0xe5cc('0x13')](_0xe5cc('0x15'),_0x1f8e85,_0x1a8564?_0xe5cc('0x16'):_0xe5cc('0x17')),_[_0xe5cc('0x12')](_0x4cec30,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xe5cc('0x18')),'smsQueueReport':require(_0xe5cc('0x19')),'faxQueueReport':require(_0xe5cc('0x1a')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xe5cc('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xe5cc('0x1c'),'message':_0xe5cc('0x1d')}});function startRouting(_0x56a2c8,_0x5a8214,_0x209a74,_0x3a0934){if(_0x56a2c8&&_0x5a8214&&_0x209a74){_0x5a8214[_0xe5cc('0x1e')]+=0x1;var _0x5cc790={'uniqueid':_0x56a2c8,'from':_0x209a74[_0xe5cc('0x1f')]?_0x209a74['body'][_0xe5cc('0x20')]:'','joinAt':moment()[_0xe5cc('0x13')](_0xe5cc('0x21')),'ContactId':_0x209a74[_0xe5cc('0x22')]?_0x209a74['contact']['id']:null,'ListId':_0x209a74[_0xe5cc('0x23')]?_0x209a74[_0xe5cc('0x23')]['id']:null};_0x5cc790[_[_0xe5cc('0x24')](_0x209a74['channel'])+_0xe5cc('0x25')]=_0x5a8214['id']||null;_0x5cc790[_[_0xe5cc('0x24')](_0x209a74['channel'])+_0xe5cc('0x10')]=_0x209a74[_0xe5cc('0x26')]?_0x209a74[_0xe5cc('0x26')]['id']:null;_0x5cc790[_[_0xe5cc('0x24')](_0x209a74[_0xe5cc('0x27')])+'MessageId']=_0x209a74['message']?_0x209a74['message']['id']:null;_0x5cc790[_[_0xe5cc('0x24')](_0x209a74[_0xe5cc('0x27')])+(_0x209a74[_0xe5cc('0x27')]!==_0xe5cc('0x28')?'AccountId':_0xe5cc('0x29'))]=_0x209a74[_0xe5cc('0xa')]?_0x209a74[_0xe5cc('0xa')]['id']:null;logger[_0xe5cc('0x2a')](util[_0xe5cc('0x13')](_0xe5cc('0x2b'),_0x56a2c8,_0x5a8214[_0xe5cc('0x2c')]));emitChannelQueueInteraction(_0x209a74[_0xe5cc('0x27')],_0x5a8214[_0xe5cc('0x2c')],_0x5cc790,_0x209a74['account'][_0xe5cc('0x2c')],_0x209a74[_0xe5cc('0x2d')]['id'],!![],_0x3a0934,_0x5a8214['id']);if(rpc[_0x209a74[_0xe5cc('0x27')]+_0xe5cc('0x2e')]){return rpc[_0x209a74['channel']+_0xe5cc('0x2e')][_0xe5cc('0x2f')](_0x5cc790)['catch'](function(_0x59907e){logger['error'](_0xe5cc('0x30'));});}}}function stopRouting(_0x4f6bee,_0x28d672,_0x172541,_0x1c87d1){if(_0x4f6bee&&_0x28d672){_0x28d672[_0xe5cc('0x1e')]-=0x1;var _0x179e5f={'leaveAt':moment()[_0xe5cc('0x13')](_0xe5cc('0x21')),'acceptAt':moment()[_0xe5cc('0x13')](_0xe5cc('0x21')),'reason':_0xe5cc('0x31')};logger['info'](util[_0xe5cc('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x4f6bee,_0x28d672['name']));emitChannelQueueInteraction(_0x172541['channel'],_0x28d672['name'],_0x172541[_0xe5cc('0x1f')],_0x172541[_0xe5cc('0xa')]['name'],_0x172541['message']['id'],![],_0x1c87d1,_0x28d672['id']);if(rpc[_0x172541['channel']+_0xe5cc('0x2e')]){return rpc[_0x172541[_0xe5cc('0x27')]+'QueueReport'][_0xe5cc('0x32')](_0x4f6bee,_0x179e5f)[_0xe5cc('0x33')](function(_0x3c066c){logger[_0xe5cc('0x34')]('update\x20queue\x20report');});}}}function endRouting(_0x385a99,_0x13877f,_0x438930,_0xf4a103){if(_0x385a99&&_0x13877f){_0x13877f[_0xe5cc('0x1e')]-=0x1;var _0x19aa19={'leaveAt':moment()[_0xe5cc('0x13')](_0xe5cc('0x21')),'exitAt':moment()[_0xe5cc('0x13')](_0xe5cc('0x21')),'reason':_0xe5cc('0x35')};logger[_0xe5cc('0x2a')](util[_0xe5cc('0x13')](_0xe5cc('0x36'),_0x385a99,_0x13877f[_0xe5cc('0x2c')]));emitChannelQueueInteraction(_0x438930[_0xe5cc('0x27')],_0x13877f[_0xe5cc('0x2c')],_0x438930['body'],_0x438930[_0xe5cc('0xa')][_0xe5cc('0x2c')],_0x438930[_0xe5cc('0x2d')]['id'],![],_0xf4a103);if(rpc[_0x438930[_0xe5cc('0x27')]+_0xe5cc('0x2e')]){return rpc[_0x438930[_0xe5cc('0x27')]+_0xe5cc('0x2e')][_0xe5cc('0x32')](_0x385a99,_0x19aa19)[_0xe5cc('0x33')](function(_0x813d2e){logger[_0xe5cc('0x34')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x1369ca){return function(_0x1ed326){return _0x1ed326[_0xe5cc('0x2c')]['toLowerCase']()===_0x1369ca[_0xe5cc('0x37')]();};}exports['consequence']=function(_0x1e914b,_0x2299a5,_0x4f0c59,_0xe27beb){return function(_0x58613c){try{var _0x5d414b={'name':_0x2299a5[0x0],'timeout':_0x2299a5[0x1]};var _0x39b1ba=queue[_0xe5cc('0x38')](_0x5d414b,{'typecast':!![]});if(_0x39b1ba[_0xe5cc('0x39')]){logger[_0xe5cc('0x34')](_0xe5cc('0x3a'),_0x1e914b,_['map'](_0x39b1ba,_0xe5cc('0x2d'))[_0xe5cc('0x3b')](',\x20'));_0x58613c[_0xe5cc('0x3c')]();}else{var _0x28b38c=_[_0xe5cc('0x3d')](_0x4f0c59[_0xe27beb[_0xe5cc('0x27')]+_0xe5cc('0x3e')],handleFindQueue(_0x5d414b['name']));if(_0x28b38c){startRouting(_0x1e914b,_0x28b38c,_0xe27beb,_0x4f0c59);var _0x3a3f4f=(_0x28b38c[_0xe5cc('0x35')]||0xa)*0x3e8;var _0x492e7e=(_0x5d414b[_0xe5cc('0x35')]||0x14)*0x3e8;var _0x1e5aa4;if(_0x3a3f4f>_0x492e7e){_0x492e7e=_0x3a3f4f;}var _0x5e8a43=seqqueue[_0xe5cc('0x3f')](_0x3a3f4f);_0x5e8a43['id']=_0x1e914b;_0x5e8a43[_0xe5cc('0x40')]=_0x3a3f4f;_0x5e8a43[_0xe5cc('0x41')]=_0x492e7e;_0x5e8a43[_0xe5cc('0x27')]=_0xe27beb[_0xe5cc('0x27')];_0x4f0c59[_0xe5cc('0x42')][_0x1e914b]['on'](_0xe5cc('0x43'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x1e914b);stopRouting(_0x1e914b,_0x28b38c,_0xe27beb,_0x4f0c59);clearTimeout(_0x1e5aa4);_0x1e5aa4=undefined;_0x5e8a43[_0xe5cc('0x44')](!![]);if(_0x4f0c59[_0xe5cc('0x42')][_0x1e914b]){delete _0x4f0c59[_0xe5cc('0x42')][_0x1e914b];}_0x58613c[_0xe5cc('0x3c')]();});_0x4f0c59['rules'][_0x1e914b]['on'](_0xe5cc('0x45'),function(){if(_0x4f0c59['rules'][_0x1e914b]){delete _0x4f0c59[_0xe5cc('0x42')][_0x1e914b];}});_0x1e5aa4=setTimeout(function(){logger[_0xe5cc('0x2a')](_0xe5cc('0x46'),_0x1e914b);endRouting(_0x1e914b,_0x28b38c,_0xe27beb,_0x4f0c59);clearTimeout(_0x1e5aa4);_0x5e8a43['close'](!![]);_0x58613c[_0xe5cc('0x47')]();},_0x492e7e);switch(_0x28b38c[_0xe5cc('0x48')]){case'rrmemory':strategy[_0xe5cc('0x49')](_0x5e8a43,_0x28b38c,_0x4f0c59,_0xe27beb);break;default:strategy[_0xe5cc('0x4a')](_0x5e8a43,_0x28b38c,_0x4f0c59,_0xe27beb);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1e914b,_0x5d414b[_0xe5cc('0x2c')]);_0x58613c[_0xe5cc('0x3c')]();}}}catch(_0x18d7c9){console[_0xe5cc('0x4b')](_0x18d7c9);logger[_0xe5cc('0x34')]('[%s][QUEUE]\x20%s',_0x1e914b,_0x18d7c9[_0xe5cc('0x4c')]);_0x58613c[_0xe5cc('0x3c')]();}};}; \ No newline at end of file +var _0x8027=['accepted','info','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','validate','length','error','[%s][QUEUE]\x20%s','map','join','stop','find','timeout','createQueue','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','push','capitalize','format','pick','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','timeout\x20is\x20a\x20number','waiting','body','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x8027,0x1f1));var _0x7802=function(_0x20c809,_0x26b566){_0x20c809=_0x20c809-0x0;var _0x1064a1=_0x8027[_0x20c809];return _0x1064a1;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x7802('0x0'));var seqqueue=require(_0x7802('0x1'));var moment=require(_0x7802('0x2'));var Redis=require(_0x7802('0x3'));var config=require(_0x7802('0x4'));var logger=require(_0x7802('0x5'))(_0x7802('0x6'));var strategy=require('./strategy');config[_0x7802('0x7')]=_[_0x7802('0x8')](config[_0x7802('0x7')],{'host':_0x7802('0x9'),'port':0x18eb});var io=require(_0x7802('0xa'))(new Redis(config[_0x7802('0x7')]));var attributes=['id',_0x7802('0xb'),_0x7802('0xc'),_0x7802('0xd'),'from',_0x7802('0xe')];function emit(_0x10fac7,_0x1f0dc0,_0x3338ad){io['to'](_0x10fac7)[_0x7802('0xf')](_0x1f0dc0,_0x3338ad);}function emitChannelQueueInteraction(_0x288901,_0x56dc8a,_0x37acab,_0x610626,_0x1bf9c1,_0x8c7d31,_0x2a3ec0,_0x297559){var _0x473cb2=_[_0x7802('0x10')](_0x37acab);_0x473cb2[_0x7802('0xb')]=_0x297559;_0x473cb2[_0x7802('0xd')]=_0x56dc8a;_0x473cb2[_0x7802('0xc')]=_0x610626;_0x473cb2['id']=_0x1bf9c1;if(_0x8c7d31){attributes[_0x7802('0x11')](_[_0x7802('0x12')](_0x288901)+'InteractionId');_0x2a3ec0[util[_0x7802('0x13')]('%sQueuesWaitingInteractions',_0x288901)][_0x1bf9c1]=_[_0x7802('0x14')](_0x473cb2,attributes);}else{delete _0x2a3ec0[util[_0x7802('0x13')](_0x7802('0x15'),_0x288901)][_0x1bf9c1];}emit(util[_0x7802('0x13')]('%s:queue:%s',_0x288901,_0x56dc8a),util[_0x7802('0x13')](_0x7802('0x16'),_0x288901,_0x8c7d31?_0x7802('0x17'):_0x7802('0x18')),_[_0x7802('0x14')](_0x473cb2,attributes));}var rpc={'openchannelQueueReport':require(_0x7802('0x19')),'mailQueueReport':require(_0x7802('0x1a')),'chatQueueReport':require(_0x7802('0x1b')),'smsQueueReport':require(_0x7802('0x1c')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x7802('0x1d'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x7802('0x1e')}});function startRouting(_0x51d947,_0x9c4065,_0x54f6b2,_0x25c5f9){if(_0x51d947&&_0x9c4065&&_0x54f6b2){_0x9c4065[_0x7802('0x1f')]+=0x1;var _0x4cc8b9={'uniqueid':_0x51d947,'from':_0x54f6b2[_0x7802('0x20')]?_0x54f6b2[_0x7802('0x20')]['from']:'','joinAt':moment()[_0x7802('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54f6b2['contact']?_0x54f6b2['contact']['id']:null,'ListId':_0x54f6b2[_0x7802('0x21')]?_0x54f6b2['list']['id']:null};_0x4cc8b9[_[_0x7802('0x22')](_0x54f6b2['channel'])+_0x7802('0x23')]=_0x9c4065['id']||null;_0x4cc8b9[_[_0x7802('0x22')](_0x54f6b2[_0x7802('0x24')])+_0x7802('0x25')]=_0x54f6b2[_0x7802('0x26')]?_0x54f6b2[_0x7802('0x26')]['id']:null;_0x4cc8b9[_[_0x7802('0x22')](_0x54f6b2[_0x7802('0x24')])+_0x7802('0x27')]=_0x54f6b2['message']?_0x54f6b2[_0x7802('0x28')]['id']:null;_0x4cc8b9[_[_0x7802('0x22')](_0x54f6b2[_0x7802('0x24')])+(_0x54f6b2[_0x7802('0x24')]!==_0x7802('0x29')?'AccountId':_0x7802('0x2a'))]=_0x54f6b2['account']?_0x54f6b2[_0x7802('0xc')]['id']:null;logger['info'](util[_0x7802('0x13')](_0x7802('0x2b'),_0x51d947,_0x9c4065[_0x7802('0x2c')]));emitChannelQueueInteraction(_0x54f6b2[_0x7802('0x24')],_0x9c4065[_0x7802('0x2c')],_0x4cc8b9,_0x54f6b2[_0x7802('0xc')]['name'],_0x54f6b2['message']['id'],!![],_0x25c5f9,_0x9c4065['id']);if(rpc[_0x54f6b2[_0x7802('0x24')]+'QueueReport']){return rpc[_0x54f6b2['channel']+_0x7802('0x2d')]['create'](_0x4cc8b9)[_0x7802('0x2e')](function(_0x2c18e8){logger['error'](_0x7802('0x2f'));});}}}function stopRouting(_0x387502,_0x419d7a,_0x335442,_0x400d9a){if(_0x387502&&_0x419d7a){_0x419d7a[_0x7802('0x1f')]-=0x1;var _0x377532={'leaveAt':moment()['format'](_0x7802('0x30')),'acceptAt':moment()[_0x7802('0x13')](_0x7802('0x30')),'reason':_0x7802('0x31')};logger[_0x7802('0x32')](util[_0x7802('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x387502,_0x419d7a['name']));emitChannelQueueInteraction(_0x335442[_0x7802('0x24')],_0x419d7a[_0x7802('0x2c')],_0x335442['body'],_0x335442[_0x7802('0xc')]['name'],_0x335442[_0x7802('0x28')]['id'],![],_0x400d9a,_0x419d7a['id']);if(rpc[_0x335442[_0x7802('0x24')]+_0x7802('0x2d')]){return rpc[_0x335442[_0x7802('0x24')]+'QueueReport']['update'](_0x387502,_0x377532)[_0x7802('0x2e')](function(_0x5c3bf6){logger['error'](_0x7802('0x33'));});}}}function endRouting(_0x5cab51,_0xfe88fb,_0x4d5054,_0x36595d){if(_0x5cab51&&_0xfe88fb){_0xfe88fb[_0x7802('0x1f')]-=0x1;var _0x1c8b64={'leaveAt':moment()[_0x7802('0x13')](_0x7802('0x30')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x7802('0x32')](util[_0x7802('0x13')](_0x7802('0x34'),_0x5cab51,_0xfe88fb[_0x7802('0x2c')]));emitChannelQueueInteraction(_0x4d5054[_0x7802('0x24')],_0xfe88fb[_0x7802('0x2c')],_0x4d5054[_0x7802('0x20')],_0x4d5054['account'][_0x7802('0x2c')],_0x4d5054[_0x7802('0x28')]['id'],![],_0x36595d);if(rpc[_0x4d5054[_0x7802('0x24')]+'QueueReport']){return rpc[_0x4d5054[_0x7802('0x24')]+_0x7802('0x2d')][_0x7802('0x35')](_0x5cab51,_0x1c8b64)[_0x7802('0x2e')](function(_0x942a13){logger['error'](_0x7802('0x33'));});}}}function handleFindQueue(_0x2ae1b0){return function(_0x225ea5){return _0x225ea5['name']['toLowerCase']()===_0x2ae1b0[_0x7802('0x36')]();};}exports[_0x7802('0x37')]=function(_0x2fd949,_0x36120b,_0x516c1e,_0x4e9489){return function(_0x2c2ca0){try{var _0x480a36={'name':_0x36120b[0x0],'timeout':_0x36120b[0x1]};var _0x19db5a=queue[_0x7802('0x38')](_0x480a36,{'typecast':!![]});if(_0x19db5a[_0x7802('0x39')]){logger[_0x7802('0x3a')](_0x7802('0x3b'),_0x2fd949,_[_0x7802('0x3c')](_0x19db5a,_0x7802('0x28'))[_0x7802('0x3d')](',\x20'));_0x2c2ca0[_0x7802('0x3e')]();}else{var _0x361ffb=_[_0x7802('0x3f')](_0x516c1e[_0x4e9489[_0x7802('0x24')]+'Queues'],handleFindQueue(_0x480a36[_0x7802('0x2c')]));if(_0x361ffb){startRouting(_0x2fd949,_0x361ffb,_0x4e9489,_0x516c1e);var _0x2b950f=(_0x361ffb[_0x7802('0x40')]||0xa)*0x3e8;var _0x24e3bf=(_0x480a36[_0x7802('0x40')]||0x14)*0x3e8;var _0x368bd7;if(_0x2b950f>_0x24e3bf){_0x24e3bf=_0x2b950f;}var _0x5e03e3=seqqueue[_0x7802('0x41')](_0x2b950f);_0x5e03e3['id']=_0x2fd949;_0x5e03e3[_0x7802('0x42')]=_0x2b950f;_0x5e03e3['qtimeout']=_0x24e3bf;_0x5e03e3['channel']=_0x4e9489['channel'];_0x516c1e['rules'][_0x2fd949]['on'](_0x7802('0x43'),function(){logger[_0x7802('0x32')](_0x7802('0x44'),_0x2fd949);stopRouting(_0x2fd949,_0x361ffb,_0x4e9489,_0x516c1e);clearTimeout(_0x368bd7);_0x368bd7=undefined;_0x5e03e3['close'](!![]);if(_0x516c1e[_0x7802('0x45')][_0x2fd949]){delete _0x516c1e['rules'][_0x2fd949];}_0x2c2ca0[_0x7802('0x3e')]();});_0x516c1e['rules'][_0x2fd949]['on'](_0x7802('0x46'),function(){if(_0x516c1e['rules'][_0x2fd949]){delete _0x516c1e[_0x7802('0x45')][_0x2fd949];}});_0x368bd7=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x2fd949);endRouting(_0x2fd949,_0x361ffb,_0x4e9489,_0x516c1e);clearTimeout(_0x368bd7);_0x5e03e3[_0x7802('0x47')](!![]);_0x2c2ca0[_0x7802('0x48')]();},_0x24e3bf);switch(_0x361ffb[_0x7802('0x49')]){case _0x7802('0x4a'):strategy['rrmemory'](_0x5e03e3,_0x361ffb,_0x516c1e,_0x4e9489);break;default:strategy[_0x7802('0x4b')](_0x5e03e3,_0x361ffb,_0x516c1e,_0x4e9489);}}else{logger[_0x7802('0x3a')](_0x7802('0x4c'),_0x2fd949,_0x480a36[_0x7802('0x2c')]);_0x2c2ca0[_0x7802('0x3e')]();}}}catch(_0xa3283b){console[_0x7802('0x4d')](_0xa3283b);logger['error']('[%s][QUEUE]\x20%s',_0x2fd949,_0xa3283b['stack']);_0x2c2ca0['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index a9d3809..c47706b 100644 --- a/server/services/routing/server/applications/strategy/agent.js +++ b/server/services/routing/server/applications/strategy/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a19=['prototype','push','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busy','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','agent','realtime','handleTimeout','bind','drained','handleDrained'];(function(_0x1a18b6,_0x1cb6bf){var _0x68584=function(_0x35ada2){while(--_0x35ada2){_0x1a18b6['push'](_0x1a18b6['shift']());}};_0x68584(++_0x1cb6bf);}(_0x9a19,0x114));var _0x99a1=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0x9a19[_0x18f152];return _0xa10b34;};'use strict';var _=require(_0x99a1('0x0'));var uuid=require(_0x99a1('0x1'));var util=require(_0x99a1('0x2'));var logger=require('../../../../../config/logger')(_0x99a1('0x3'));var Agent=function(_0x2ba463,_0x112bcc,_0x25da2d,_0x214082){this[_0x99a1('0x4')]=uuid['v4']();this[_0x99a1('0x5')]=_0x2ba463;this[_0x99a1('0x6')]=_0x112bcc;this[_0x99a1('0x7')]=_0x25da2d;this[_0x99a1('0x3')]=_0x214082;this[_0x99a1('0x5')]['push'](this['handleRun']['bind'](this),this[_0x99a1('0x8')][_0x99a1('0x9')](this));this['squeue']['on']('timeout',this[_0x99a1('0x8')][_0x99a1('0x9')](this));this[_0x99a1('0x5')]['on'](_0x99a1('0xa'),this[_0x99a1('0xb')]['bind'](this));};Agent[_0x99a1('0xc')][_0x99a1('0xd')]=function(){this[_0x99a1('0x5')][_0x99a1('0xd')](this[_0x99a1('0xe')][_0x99a1('0x9')](this),this[_0x99a1('0x8')][_0x99a1('0x9')](this));};Agent[_0x99a1('0xc')][_0x99a1('0xb')]=function(){this[_0x99a1('0x8')](!![]);};Agent[_0x99a1('0xc')][_0x99a1('0xe')]=function(){logger[_0x99a1('0xf')](_0x99a1('0x10'),this['squeue']['id'],this[_0x99a1('0x6')]['id']);if(_[_0x99a1('0x11')](this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']])){logger[_0x99a1('0xf')](_0x99a1('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x99a1('0xd')][_0x99a1('0x9')](this),0x3e8);}else{if(this[_0x99a1('0x3')][_0x99a1('0x14')]||util[_0x99a1('0x15')](this[_0x99a1('0x5')]['id'],this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']],this[_0x99a1('0x5')][_0x99a1('0x16')],![])){this['realtime'][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']]['busy']=!![];this[_0x99a1('0x7')]['agents'][this[_0x99a1('0x6')]['id']][_0x99a1('0x17')]=undefined;util[_0x99a1('0x18')](this[_0x99a1('0x7')],this['routing'],this[_0x99a1('0x6')],this[_0x99a1('0x5')]['channel']);util[_0x99a1('0x19')](this['notificationId'],this[_0x99a1('0x5')]['id'],this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']],null,this[_0x99a1('0x3')]);util[_0x99a1('0x1a')](this['squeue']['id'],this[_0x99a1('0x7')]['agents'][this['agent']['id']],_0x99a1('0x1b')+(this[_0x99a1('0x3')][_0x99a1('0x14')]?_0x99a1('0x1c'):''));}else{logger[_0x99a1('0xf')](_0x99a1('0x1d'),this[_0x99a1('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x99a1('0xd')]['bind'](this),0x3e8);}}};Agent[_0x99a1('0xc')][_0x99a1('0x8')]=function(_0x26fbae){if(_['isNil'](this[_0x99a1('0x7')][_0x99a1('0x12')][this['agent']['id']])){return logger[_0x99a1('0xf')](_0x99a1('0x13'),this[_0x99a1('0x5')]['id'],this[_0x99a1('0x6')]['id']);}else{logger[_0x99a1('0xf')](_0x99a1('0x1e'),this[_0x99a1('0x5')]['id'],this[_0x99a1('0x6')]['id']);util['hideNotification'](this['notificationId'],this[_0x99a1('0x5')]['id'],this['realtime'][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']],null,this['routing']);this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']][_0x99a1('0x1f')]=![];this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']][_0x99a1('0x17')]=undefined;util[_0x99a1('0x20')](this[_0x99a1('0x7')],this[_0x99a1('0x3')],this[_0x99a1('0x6')],this[_0x99a1('0x5')][_0x99a1('0x16')]);util['writeLog'](this['squeue']['id'],this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']],_0x26fbae?_0x99a1('0x21'):_0x99a1('0x22'));}if(!_0x26fbae){setTimeout(this[_0x99a1('0xd')][_0x99a1('0x9')](this),0x3e8);}};function agent(_0x54840d,_0x355f9d,_0x506613,_0x551d85){return new Agent(_0x54840d,_0x355f9d,_0x506613,_0x551d85);}module[_0x99a1('0x23')]=agent; \ No newline at end of file +var _0xdb94=['agents','channel','busy','busyQueue','showNotification','notificationId','writeLog','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','exports','uuid','./util','routing','squeue','realtime','push','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xdb94,0xe5));var _0x4db9=function(_0x1f03fd,_0x5045ed){_0x1f03fd=_0x1f03fd-0x0;var _0x5ab16b=_0xdb94[_0x1f03fd];return _0x5ab16b;};'use strict';var _=require('lodash');var uuid=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var logger=require('../../../../../config/logger')(_0x4db9('0x2'));var Agent=function(_0x3b24a6,_0x25b510,_0x2e85f4,_0x1f05d4){this['notificationId']=uuid['v4']();this[_0x4db9('0x3')]=_0x3b24a6;this['agent']=_0x25b510;this[_0x4db9('0x4')]=_0x2e85f4;this[_0x4db9('0x2')]=_0x1f05d4;this[_0x4db9('0x3')][_0x4db9('0x5')](this[_0x4db9('0x6')]['bind'](this),this[_0x4db9('0x7')][_0x4db9('0x8')](this));this[_0x4db9('0x3')]['on'](_0x4db9('0x9'),this[_0x4db9('0x7')]['bind'](this));this[_0x4db9('0x3')]['on'](_0x4db9('0xa'),this[_0x4db9('0xb')][_0x4db9('0x8')](this));};Agent[_0x4db9('0xc')][_0x4db9('0x5')]=function(){this['squeue'][_0x4db9('0x5')](this[_0x4db9('0x6')]['bind'](this),this['handleTimeout'][_0x4db9('0x8')](this));};Agent[_0x4db9('0xc')][_0x4db9('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0x4db9('0xc')][_0x4db9('0x6')]=function(){logger[_0x4db9('0xd')](_0x4db9('0xe'),this[_0x4db9('0x3')]['id'],this['agent']['id']);if(_[_0x4db9('0xf')](this[_0x4db9('0x4')]['agents'][this[_0x4db9('0x10')]['id']])){logger[_0x4db9('0xd')](_0x4db9('0x11'),this['squeue']['id'],this[_0x4db9('0x10')]['id']);setTimeout(this[_0x4db9('0x5')]['bind'](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0x4db9('0x12')](this[_0x4db9('0x3')]['id'],this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],this[_0x4db9('0x3')][_0x4db9('0x14')],![])){this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x15')]=!![];this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x16')]=undefined;util['saveWaitingNotification'](this[_0x4db9('0x4')],this[_0x4db9('0x2')],this['agent'],this[_0x4db9('0x3')][_0x4db9('0x14')]);util[_0x4db9('0x17')](this[_0x4db9('0x18')],this['squeue']['id'],this[_0x4db9('0x4')]['agents'][this[_0x4db9('0x10')]['id']],null,this[_0x4db9('0x2')]);util[_0x4db9('0x19')](this[_0x4db9('0x3')]['id'],this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],'RINGING'+(this['routing'][_0x4db9('0x1a')]?':FORCED':''));}else{logger[_0x4db9('0xd')](_0x4db9('0x1b'),this[_0x4db9('0x3')]['id'],this[_0x4db9('0x10')]['id']);setTimeout(this[_0x4db9('0x5')][_0x4db9('0x8')](this),0x3e8);}}};Agent[_0x4db9('0xc')][_0x4db9('0x7')]=function(_0x4c4a47){if(_[_0x4db9('0xf')](this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']])){return logger[_0x4db9('0xd')](_0x4db9('0x11'),this[_0x4db9('0x3')]['id'],this['agent']['id']);}else{logger[_0x4db9('0xd')](_0x4db9('0x1c'),this[_0x4db9('0x3')]['id'],this[_0x4db9('0x10')]['id']);util['hideNotification'](this['notificationId'],this[_0x4db9('0x3')]['id'],this[_0x4db9('0x4')]['agents'][this['agent']['id']],null,this[_0x4db9('0x2')]);this['realtime']['agents'][this[_0x4db9('0x10')]['id']][_0x4db9('0x15')]=![];this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x16')]=undefined;util[_0x4db9('0x1d')](this['realtime'],this[_0x4db9('0x2')],this['agent'],this['squeue']['channel']);util[_0x4db9('0x19')](this[_0x4db9('0x3')]['id'],this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],_0x4c4a47?'STOP':'TIMEOUT');}if(!_0x4c4a47){setTimeout(this['push'][_0x4db9('0x8')](this),0x3e8);}};function agent(_0x52613e,_0x29dc69,_0x52711a,_0xaf383e){return new Agent(_0x52613e,_0x29dc69,_0x52711a,_0xaf383e);}module[_0x4db9('0x1e')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index feaff78..7078d83 100644 --- a/server/services/routing/server/applications/strategy/beepall.js +++ b/server/services/routing/server/applications/strategy/beepall.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd546=['removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','queue','routing','squeue','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','push','isNil','Agents','length','realtime','debug','isAgentAvailable','channel','writeLog','agents','RINGING','busy','busyQueue','name','saveWaitingNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xd546,0x17e));var _0x6d54=function(_0x4d6123,_0xc17294){_0x4d6123=_0x4d6123-0x0;var _0x1c1d70=_0xd546[_0x4d6123];return _0x1c1d70;};'use strict';var _=require(_0x6d54('0x0'));var uuid=require(_0x6d54('0x1'));var util=require(_0x6d54('0x2'));var logger=require(_0x6d54('0x3'))('routing');var Beepall=function(_0xa5fb90,_0x54df67,_0x2288bf,_0x2d545e){this[_0x6d54('0x4')]=uuid['v4']();this['squeue']=_0xa5fb90;this[_0x6d54('0x5')]=_0x54df67;this['realtime']=_0x2288bf;this[_0x6d54('0x6')]=_0x2d545e;this[_0x6d54('0x7')]['push'](this[_0x6d54('0x8')]['bind'](this),this[_0x6d54('0x9')][_0x6d54('0xa')](this));this[_0x6d54('0x7')]['on'](_0x6d54('0xb'),this[_0x6d54('0x9')][_0x6d54('0xa')](this));this[_0x6d54('0x7')]['on'](_0x6d54('0xc'),this[_0x6d54('0xd')]['bind'](this));};Beepall[_0x6d54('0xe')][_0x6d54('0xf')]=function(){this[_0x6d54('0x7')][_0x6d54('0xf')](this['handleRun'][_0x6d54('0xa')](this),this[_0x6d54('0x9')][_0x6d54('0xa')](this));};Beepall['prototype'][_0x6d54('0xd')]=function(){this[_0x6d54('0x9')](!![]);};Beepall['prototype'][_0x6d54('0x8')]=function(){var _0x29cd6d=!![];if(!_[_0x6d54('0x10')](this[_0x6d54('0x5')])&&!_[_0x6d54('0x10')](this['queue']['Agents'])&&this[_0x6d54('0x5')][_0x6d54('0x11')][_0x6d54('0x12')]>0x0){for(var _0x3ef39d=0x0,_0x1233b7;_0x3ef39d0x0){for(var _0xcc65a0=0x0,_0x40fa5c;_0xcc65a00x0&&_0x196488[_0x5a5c84+_0xac48('0x28')]>=_0x196488[_0x5a5c84+'Capacity']){writeLog(_0x2308ac,_0x196488,_0x5a5c84[_0xac48('0x29')]()+_0xac48('0x2a'));return![];}}return!![];};exports[_0xac48('0x2b')]=function(_0x32e8b7,_0x2b380a,_0x458957,_0x1b60f5,_0x1a2326){return sendNotification(!![],_0x32e8b7,_0x2b380a,_0x458957,_0x1b60f5,_0x1a2326);};exports[_0xac48('0x2c')]=function(_0xcb0301,_0x4efe55,_0x27670c,_0x354834,_0x32d715){return sendNotification(![],_0xcb0301,_0x4efe55,_0x27670c,_0x354834,_0x32d715);};exports['checkWaitingNotifications']=function(_0x1e7f37,_0x2c01bf,_0x458180){var _0x4da67e=_0x2c01bf['interaction'][_0xac48('0x2d')];if(!_0x4da67e&&_0x458180){_0x4da67e=_0x458180['id'];}var _0x59841b=_[_0xac48('0x2e')](_0x1e7f37[_0x2c01bf[_0xac48('0x2f')]+_0xac48('0x30')],function(_0xfcee30){var _0x5afe98=_[_0xac48('0x31')](_0x2c01bf[_0xac48('0x2f')])+'InteractionId';return _0xfcee30[_0x5afe98]===_0x2c01bf[_0xac48('0x32')]['id'];});if(!_0x59841b&&_0x4da67e){_0x59841b=_[_0xac48('0x2e')](_0x1e7f37[_0xac48('0x33')][_0x4da67e][_0x2c01bf[_0xac48('0x2f')]+_0xac48('0x34')],function(_0x42a05a){return _0x42a05a['id']===_0x2c01bf[_0xac48('0x32')]['id'];});}return _0x59841b;};exports[_0xac48('0x35')]=function(_0x184687,_0x84756d,_0x50cab4,_0x39e245){_0x184687[_0xac48('0x33')][_0x50cab4['id']][_0x39e245+'WaitingInteractions'][_0x84756d[_0xac48('0x19')]['id']]={'id':_0x84756d[_0xac48('0x32')]['id']};};exports[_0xac48('0x36')]=function(_0x298d24,_0x49d5bc,_0x2eb2e8,_0x35679a){delete _0x298d24[_0xac48('0x33')][_0x2eb2e8['id']][_0x35679a+_0xac48('0x34')][_0x49d5bc[_0xac48('0x19')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file +var _0x63b5=['notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','notification:%s','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','InteractionId','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','user:%s','name','emit','user:save','split','\x20interaction','account'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x63b5,0x1e8));var _0x563b=function(_0x1c334e,_0x295494){_0x1c334e=_0x1c334e-0x0;var _0x524cb5=_0x63b5[_0x1c334e];return _0x524cb5;};'use strict';var _=require(_0x563b('0x0'));var util=require(_0x563b('0x1'));var utils=require(_0x563b('0x2'));var Redis=require(_0x563b('0x3'));var config=require('../../../../../config/environment');var logger=require(_0x563b('0x4'))(_0x563b('0x5'));config[_0x563b('0x6')]=_[_0x563b('0x7')](config[_0x563b('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x563b('0x8'))(new Redis(config[_0x563b('0x6')]));function sendNotification(_0x1af8e1,_0x55c034,_0x1c9fed,_0xd5ea99,_0x38db21,_0x73286f){io['to'](util['format'](_0x563b('0x9'),_0xd5ea99[_0x563b('0xa')]))[_0x563b('0xb')](_0x563b('0xc'),_0xd5ea99);var _0x12bfd4=_0x73286f||{};var _0x560cde=_0x1c9fed[_0x563b('0xd')]('.');var _0x505a60={'uniqueid':_0x55c034,'channel':_0x560cde[0x0],'id':_0x560cde[0x1],'title':_0x560cde[0x0]+_0x563b('0xe'),'interactionId':_0x560cde[0x2],'queue':_0x38db21?_0x38db21[_0x563b('0xa')]:null,'sound':_0x12bfd4[_0x563b('0xf')][_0x563b('0x10')],'shake':_0x12bfd4[_0x563b('0xf')][_0x563b('0x11')]};try{if(!_0x12bfd4[_0x563b('0x12')]){_0x12bfd4['body']={};}if(_0x38db21){_0x12bfd4[_0x563b('0x12')][_0x563b('0x13')]=_0x38db21;}else if(_0x12bfd4[_0x563b('0x12')][_0x563b('0x13')]){delete _0x12bfd4[_0x563b('0x12')]['queue'];}_0x505a60[_0x563b('0x14')]=utils[_0x563b('0x15')](_0x12bfd4[_0x563b('0xf')][_0x563b('0x16')],_0x12bfd4);}catch(_0x3ef417){_0x505a60[_0x563b('0x14')]=_0x563b('0x17');logger[_0x563b('0x18')](util[_0x563b('0x19')](_0x563b('0x1a'),_0x55c034,_0x3ef417[_0x563b('0x1b')]));}io['to'](util[_0x563b('0x19')](_0x563b('0x9'),_0xd5ea99['name']))[_0x563b('0xb')](util[_0x563b('0x19')](_0x563b('0x1c'),_0x1af8e1?_0x563b('0x1d'):'remove'),_0x505a60);}function writeLog(_0x42dc2a,_0x155eb0,_0xe38e3){return logger[_0x563b('0x1e')](util[_0x563b('0x19')](_0x563b('0x1f'),_0x42dc2a,_0x155eb0[_0x563b('0xa')],_0xe38e3));}exports[_0x563b('0x20')]=function(_0x65d083,_0x21c81a,_0x5d6f80,_0x35fee7){if(_0x21c81a[_0x563b('0x21')]){writeLog(_0x65d083,_0x21c81a,_0x563b('0x22'));return![];}if(!_0x21c81a[_0x563b('0x23')]){writeLog(_0x65d083,_0x21c81a,_0x563b('0x24'));return![];}if(_0x21c81a[_0x5d6f80+'Pause']){writeLog(_0x65d083,_0x21c81a,_0x563b('0x25'));return![];}if(_0x35fee7&&_0x21c81a[_0x563b('0x26')](_0x5d6f80+'Capacity')&&_0x21c81a[_0x563b('0x26')](_0x5d6f80+_0x563b('0x27'))){if(_0x21c81a[_0x5d6f80+_0x563b('0x28')]>0x0&&_0x21c81a[_0x5d6f80+_0x563b('0x27')]>=_0x21c81a[_0x5d6f80+_0x563b('0x28')]){writeLog(_0x65d083,_0x21c81a,_0x5d6f80[_0x563b('0x29')]()+_0x563b('0x2a'));return![];}}return!![];};exports[_0x563b('0x2b')]=function(_0x1c5dfb,_0x1e7980,_0x56d93a,_0x40b846,_0x362387){return sendNotification(!![],_0x1c5dfb,_0x1e7980,_0x56d93a,_0x40b846,_0x362387);};exports['hideNotification']=function(_0x2c7d3a,_0x498a9e,_0x24bd3b,_0x5cf0b1,_0x2854fd){return sendNotification(![],_0x2c7d3a,_0x498a9e,_0x24bd3b,_0x5cf0b1,_0x2854fd);};exports[_0x563b('0x2c')]=function(_0x5b6226,_0x201a87,_0x1416ff){var _0x6cccce=_0x201a87[_0x563b('0x2d')][_0x563b('0x2e')];if(!_0x6cccce&&_0x1416ff){_0x6cccce=_0x1416ff['id'];}var _0x270769=_[_0x563b('0x2f')](_0x5b6226[_0x201a87[_0x563b('0x30')]+_0x563b('0x31')],function(_0x547d95){var _0x4c64f2=_['capitalize'](_0x201a87[_0x563b('0x30')])+_0x563b('0x32');return _0x547d95[_0x4c64f2]===_0x201a87[_0x563b('0x2d')]['id'];});if(!_0x270769&&_0x6cccce){_0x270769=_['some'](_0x5b6226[_0x563b('0x33')][_0x6cccce][_0x201a87['channel']+_0x563b('0x34')],function(_0x547838){return _0x547838['id']===_0x201a87[_0x563b('0x2d')]['id'];});}return _0x270769;};exports[_0x563b('0x35')]=function(_0x26fe32,_0x3f7e8e,_0x261254,_0x1e4410){_0x26fe32['agents'][_0x261254['id']][_0x1e4410+'WaitingInteractions'][_0x3f7e8e[_0x563b('0x1b')]['id']]={'id':_0x3f7e8e[_0x563b('0x2d')]['id']};};exports[_0x563b('0x36')]=function(_0x150c69,_0x1bde8d,_0x5613b0,_0x6e13f2){delete _0x150c69[_0x563b('0x33')][_0x5613b0['id']][_0x6e13f2+_0x563b('0x34')][_0x1bde8d[_0x563b('0x1b')]['id']];};exports[_0x563b('0x37')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 8bff8ec..a67c691 100644 --- a/server/services/routing/server/applications/system.js +++ b/server/services/routing/server/applications/system.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11cf=['[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map','message','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','[%s][SYSTEM]\x20no\x20variable','body'];(function(_0x54bdf4,_0x48c889){var _0x181ea3=function(_0x3049c3){while(--_0x3049c3){_0x54bdf4['push'](_0x54bdf4['shift']());}};_0x181ea3(++_0x48c889);}(_0x11cf,0x10b));var _0xf11c=function(_0x38d4ac,_0x19cf87){_0x38d4ac=_0x38d4ac-0x0;var _0x3497fb=_0x11cf[_0x38d4ac];return _0x3497fb;};'use strict';var schema=require(_0xf11c('0x0'));var sh=require(_0xf11c('0x1'));var _=require(_0xf11c('0x2'));var utils=require(_0xf11c('0x3'));var logger=require(_0xf11c('0x4'))(_0xf11c('0x5'));var system=schema({'command':{'type':_0xf11c('0x6'),'required':!![],'message':_0xf11c('0x7')}});exports[_0xf11c('0x8')]=function(_0x3dd46d,_0x205615){return function(_0x3bb28e){try{var _0x2832b8={'command':_0x205615[0x0]};var _0xf45288=system[_0xf11c('0x0')](_0x2832b8,{'typecast':!![]});if(_0xf45288['length']){logger[_0xf11c('0x9')]('[%s][SYSTEM]\x20%s',_0x3dd46d,_[_0xf11c('0xa')](_0xf45288,_0xf11c('0xb'))['join'](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3dd46d);_0x3bb28e[_0xf11c('0xc')]();}else{var _0x35bce6=this;var _0xbb1281=utils[_0xf11c('0xd')](_0x205615[0x0],this);logger[_0xf11c('0xe')](_0xf11c('0xf'),_0x3dd46d,_0xbb1281);sh[_0xf11c('0x10')](_[_0xf11c('0x11')](_0xbb1281),function(_0xd2aabc,_0x43d2ea){logger[_0xf11c('0xe')](_0xf11c('0x12'),_0x3dd46d,_0xd2aabc);if(_0xd2aabc==0x0){var _0x553856=_0x43d2ea['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x205615[0x1])||_['isEmpty'](_0x205615[0x1])){logger[_0xf11c('0xe')](_0xf11c('0x13'),_0x3dd46d);_0x35bce6[_0xf11c('0x14')][_0x205615[0x1]]=_0x553856;}else{logger[_0xf11c('0xe')](_0xf11c('0x15'),_0x3dd46d,_0x205615[0x1],_0x553856);_0x35bce6[_0xf11c('0x14')][_0x205615[0x1]]=_0x553856;}}_0x3bb28e[_0xf11c('0xc')]();});}}catch(_0x120e2b){logger[_0xf11c('0x9')]('[%s][SYSTEM]\x20%s',_0x3dd46d,_[_0xf11c('0x16')](_0x120e2b)?JSON[_0xf11c('0x17')](_0x120e2b):_0x120e2b);logger[_0xf11c('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3dd46d);_0x3bb28e['next']();}};}; \ No newline at end of file +var _0xb299=['./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','lodash'];(function(_0x408753,_0x5176e1){var _0x1ba6f1=function(_0x2ed00d){while(--_0x2ed00d){_0x408753['push'](_0x408753['shift']());}};_0x1ba6f1(++_0x5176e1);}(_0xb299,0x1c0));var _0x9b29=function(_0xd5af76,_0x52af43){_0xd5af76=_0xd5af76-0x0;var _0x2cc372=_0xb299[_0xd5af76];return _0x2cc372;};'use strict';var schema=require(_0x9b29('0x0'));var sh=require('shelljs');var _=require(_0x9b29('0x1'));var utils=require(_0x9b29('0x2'));var logger=require('../../../../config/logger')(_0x9b29('0x3'));var system=schema({'command':{'type':_0x9b29('0x4'),'required':!![],'message':_0x9b29('0x5')}});exports[_0x9b29('0x6')]=function(_0x218fd7,_0x4449ce){return function(_0x36cd4c){try{var _0x464f25={'command':_0x4449ce[0x0]};var _0x9206db=system[_0x9b29('0x0')](_0x464f25,{'typecast':!![]});if(_0x9206db['length']){logger[_0x9b29('0x7')](_0x9b29('0x8'),_0x218fd7,_['map'](_0x9206db,_0x9b29('0x9'))[_0x9b29('0xa')](',\x20'));logger[_0x9b29('0xb')](_0x9b29('0xc'),_0x218fd7);_0x36cd4c[_0x9b29('0xd')]();}else{var _0x156aab=this;var _0x3a419c=utils[_0x9b29('0xe')](_0x4449ce[0x0],this);logger[_0x9b29('0xb')](_0x9b29('0xf'),_0x218fd7,_0x3a419c);sh[_0x9b29('0x10')](_[_0x9b29('0x11')](_0x3a419c),function(_0x4be8f0,_0x58d571){logger['info'](_0x9b29('0x12'),_0x218fd7,_0x4be8f0);if(_0x4be8f0==0x0){var _0x188019=_0x58d571['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x9b29('0x13')](_0x4449ce[0x1])||_[_0x9b29('0x14')](_0x4449ce[0x1])){logger[_0x9b29('0xb')](_0x9b29('0x15'),_0x218fd7);_0x156aab[_0x9b29('0x16')][_0x4449ce[0x1]]=_0x188019;}else{logger[_0x9b29('0xb')](_0x9b29('0x17'),_0x218fd7,_0x4449ce[0x1],_0x188019);_0x156aab[_0x9b29('0x16')][_0x4449ce[0x1]]=_0x188019;}}_0x36cd4c[_0x9b29('0xd')]();});}}catch(_0x7f6e68){logger[_0x9b29('0x7')](_0x9b29('0x8'),_0x218fd7,_[_0x9b29('0x18')](_0x7f6e68)?JSON['stringify'](_0x7f6e68):_0x7f6e68);logger['info'](_0x9b29('0xc'),_0x218fd7);_0x36cd4c[_0x9b29('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index ccfb57a..395e5ec 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5732=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','catch','finally','next','stringify','validate','lodash'];(function(_0x52990d,_0x137e84){var _0x920ba6=function(_0xaa383){while(--_0xaa383){_0x52990d['push'](_0x52990d['shift']());}};_0x920ba6(++_0x137e84);}(_0x5732,0x1b1));var _0x2573=function(_0x4cbf02,_0xa9219){_0x4cbf02=_0x4cbf02-0x0;var _0x39dde0=_0x5732[_0x4cbf02];return _0x39dde0;};'use strict';var schema=require(_0x2573('0x0'));var _=require(_0x2573('0x1'));var rpc={'chatInteraction':require(_0x2573('0x2')),'openchannelInteraction':require(_0x2573('0x3')),'smsInteraction':require(_0x2573('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x2573('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x2573('0x6'))(_0x2573('0x7'));var tag=schema({'tag':{'type':_0x2573('0x8'),'required':!![],'message':_0x2573('0x9')}});exports[_0x2573('0xa')]=function(_0x316358,_0x22b8a1,_0x4ae3cc,_0x41fae8){return function(_0x28915b){try{var _0x3488a4={'tag':_0x22b8a1[0x0]};var _0x4e8f6a=tag[_0x2573('0x0')](_0x3488a4,{'typecast':!![]});if(_0x4e8f6a[_0x2573('0xb')]){logger[_0x2573('0xc')](_0x2573('0xd'),_0x316358,_[_0x2573('0xe')](_0x4e8f6a,_0x2573('0xf'))[_0x2573('0x10')](',\x20'));logger[_0x2573('0x11')](_0x2573('0x12'),_0x316358);_0x28915b['next']();}else{var _0x33f30a={'ids':[_0x22b8a1[0x0]]};if(rpc[_0x41fae8['channel']+_0x2573('0x13')]){rpc[_0x41fae8['channel']+_0x2573('0x13')][_0x2573('0x14')](_0x41fae8[_0x2573('0x15')]['id'],_0x33f30a)[_0x2573('0x16')](function(_0x46f490){logger[_0x2573('0x11')](_0x2573('0x17'),_0x316358,_0x22b8a1[0x1],_0x41fae8[_0x2573('0x18')],_0x41fae8[_0x2573('0x15')]['id']);})[_0x2573('0x19')](function(_0x462513){logger[_0x2573('0xc')](_0x2573('0xd'),_0x316358,JSON['stringify'](_0x462513));logger[_0x2573('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x316358);})[_0x2573('0x1a')](function(){_0x28915b[_0x2573('0x1b')]();});}}}catch(_0x53cb27){logger[_0x2573('0xc')](_0x2573('0xd'),_0x316358,_['isObject'](_0x53cb27)?JSON[_0x2573('0x1c')](_0x53cb27):_0x53cb27);logger['info'](_0x2573('0x12'),_0x316358);_0x28915b[_0x2573('0x1b')]();}};}; \ No newline at end of file +var _0x88d1=['channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','finally','next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x38dad7,_0x1bf5c0){var _0x2e6f84=function(_0x190ee3){while(--_0x190ee3){_0x38dad7['push'](_0x38dad7['shift']());}};_0x2e6f84(++_0x1bf5c0);}(_0x88d1,0xea));var _0x188d=function(_0x4abb17,_0x6fd616){_0x4abb17=_0x4abb17-0x0;var _0x2187a1=_0x88d1[_0x4abb17];return _0x2187a1;};'use strict';var schema=require(_0x188d('0x0'));var _=require(_0x188d('0x1'));var rpc={'chatInteraction':require(_0x188d('0x2')),'openchannelInteraction':require(_0x188d('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x188d('0x4')),'whatsappInteraction':require(_0x188d('0x5'))};var logger=require('../../../../config/logger')(_0x188d('0x6'));var tag=schema({'tag':{'type':_0x188d('0x7'),'required':!![],'message':_0x188d('0x8')}});exports[_0x188d('0x9')]=function(_0x23401a,_0x20185a,_0x43b4a2,_0x1be07b){return function(_0x4a39d6){try{var _0x1f1f14={'tag':_0x20185a[0x0]};var _0x24e2bb=tag[_0x188d('0x0')](_0x1f1f14,{'typecast':!![]});if(_0x24e2bb['length']){logger[_0x188d('0xa')](_0x188d('0xb'),_0x23401a,_[_0x188d('0xc')](_0x24e2bb,'message')[_0x188d('0xd')](',\x20'));logger[_0x188d('0xe')](_0x188d('0xf'),_0x23401a);_0x4a39d6['next']();}else{var _0x3091c7={'ids':[_0x20185a[0x0]]};if(rpc[_0x1be07b[_0x188d('0x10')]+'Interaction']){rpc[_0x1be07b[_0x188d('0x10')]+_0x188d('0x11')][_0x188d('0x12')](_0x1be07b[_0x188d('0x13')]['id'],_0x3091c7)[_0x188d('0x14')](function(_0x1d7f2f){logger[_0x188d('0xe')](_0x188d('0x15'),_0x23401a,_0x20185a[0x1],_0x1be07b[_0x188d('0x10')],_0x1be07b['interaction']['id']);})[_0x188d('0x16')](function(_0xbb4e34){logger[_0x188d('0xa')]('[%s][TAG]\x20%s',_0x23401a,JSON['stringify'](_0xbb4e34));logger['info'](_0x188d('0xf'),_0x23401a);})[_0x188d('0x17')](function(){_0x4a39d6['next']();});}}}catch(_0x3e278e){logger[_0x188d('0xa')](_0x188d('0xb'),_0x23401a,_['isObject'](_0x3e278e)?JSON['stringify'](_0x3e278e):_0x3e278e);logger[_0x188d('0xe')](_0x188d('0xf'),_0x23401a);_0x4a39d6[_0x188d('0x18')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 648d945..e212d71 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x23b3=['urlOnRing','?params=','title','jsonrpc','login','utf8','POST','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','isObject','stringify','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer'];(function(_0x1bf8cc,_0x118778){var _0x322d20=function(_0x36953d){while(--_0x36953d){_0x1bf8cc['push'](_0x1bf8cc['shift']());}};_0x322d20(++_0x118778);}(_0x23b3,0x78));var _0x323b=function(_0x10b967,_0xb32c4d){_0x10b967=_0x10b967-0x0;var _0x264da2=_0x23b3[_0x10b967];return _0x264da2;};'use strict';var rp=require('request-promise');var logger=require(_0x323b('0x0'))('routing');var _=require(_0x323b('0x1'));var arr=[];exports[_0x323b('0x2')]=function(_0x4582ea,_0x65414b){return function(_0x58fb5b){var _0x4a5156=_0x65414b[0xa];var _0x47aebb=_0x65414b[0xb];var _0x4684ae=_0x65414b[0xc];var _0x2c4b11=_0x65414b[0xd];var _0x147965=_0x65414b[0xe];var _0x2d581b=_0x65414b[0xf][_0x323b('0x3')](/\n/g,_0x323b('0x4'));var _0x1729df=_0x65414b[0x10][_0x323b('0x3')](/\n/g,'\x20');if(!arr[_0x323b('0x5')](_0x47aebb)){arr[_0x323b('0x6')](_0x47aebb);var _0x3eae9d=_0x65414b[0x3];var _0x4a70de=_0x65414b[0x4];var _0x5ae7ee=_0x65414b[0x1];var _0x518b91=_0x65414b[0x0];var _0x2c7c01={};_0x2c7c01[_0x323b('0x7')]=_0x65414b[0x8]+'?params='+_0x4684ae+'|'+_0x4a5156+'|'+_0x2c4b11+'|'+_0x47aebb+'|'+_0x147965;_0x2c7c01[_0x323b('0x8')]=_0x65414b[0x7]+_0x323b('0x9')+_0x4684ae+'|'+_0x4a5156+'|'+_0x2c4b11+'|'+_0x47aebb+'|'+_0x147965+'|'+_0x2d581b+'|'+_0x1729df;_0x2c7c01[_0x323b('0xa')]=_0x65414b[0x9];var _0x305cc3={};_0x305cc3[_0x323b('0xb')]='2.0';_0x305cc3['method']=_0x323b('0xc');var _0x1da9a3=[];_0x1da9a3[_0x323b('0x6')](_0x65414b[0x2]);_0x1da9a3[_0x323b('0x6')](_0x65414b[0x5]);_0x1da9a3[_0x323b('0x6')](_0x65414b[0x6]);_0x305cc3['params']=_0x1da9a3;_0x305cc3['id']=0x1;var _0x27a5df=JSON['stringify'](_0x305cc3);var _0x4bed12={'encoding':_0x323b('0xd'),'method':_0x323b('0xe'),'timeout':0x2710,'url':_0x3eae9d,'headers':{'Content-Type':_0x323b('0xf')},'body':_0x27a5df};return rp(_0x4bed12)['then'](function(_0x2f8894){const _0x435848=JSON[_0x323b('0x10')](_0x2f8894);if(!_0x435848[_0x323b('0x11')][_0x323b('0x12')]){throw new Error(_0x323b('0x13'));}var _0x21ab3e=_0x47aebb;var _0x5cfb21='channelId='+_0x5ae7ee+_0x323b('0x14')+_0x518b91+_0x323b('0x15')+_0x21ab3e+_0x323b('0x16')+JSON['stringify'](_0x2c7c01);var _0x2b0f20=_0x4a70de+'?'+_0x5cfb21;return rp(_0x2b0f20);})['then'](function(_0x25dbc4){logger['info'](_0x323b('0x17'),_0x4582ea,_0x25dbc4);_0x58fb5b[_0x323b('0x18')]();})['catch'](function(_0x3a40af){logger[_0x323b('0x19')](_0x323b('0x1a'),_0x4582ea,_[_0x323b('0x1b')](_0x3a40af)?JSON[_0x323b('0x1c')](_0x3a40af):_0x3a40af);_0x58fb5b[_0x323b('0x18')]();});}else{logger[_0x323b('0x1d')](_0x323b('0x1e'),_0x4582ea);_0x58fb5b[_0x323b('0x1f')]();}};}; \ No newline at end of file +var _0xda27=['urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','login','push','utf8','POST','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','next','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes'];(function(_0x38cd66,_0x3d3354){var _0x4bf620=function(_0x291d69){while(--_0x291d69){_0x38cd66['push'](_0x38cd66['shift']());}};_0x4bf620(++_0x3d3354);}(_0xda27,0x101));var _0x7da2=function(_0x2dea9b,_0x6f3b03){_0x2dea9b=_0x2dea9b-0x0;var _0x6fcafd=_0xda27[_0x2dea9b];return _0x6fcafd;};'use strict';var rp=require('request-promise');var logger=require(_0x7da2('0x0'))(_0x7da2('0x1'));var _=require(_0x7da2('0x2'));var arr=[];exports[_0x7da2('0x3')]=function(_0x79073e,_0x4ee5d7){return function(_0xd94e58){var _0x30d5a9=_0x4ee5d7[0xa];var _0x2adf3c=_0x4ee5d7[0xb];var _0x4297c9=_0x4ee5d7[0xc];var _0x35f46f=_0x4ee5d7[0xd];var _0x2d0c82=_0x4ee5d7[0xe];var _0x3356ce=_0x4ee5d7[0xf][_0x7da2('0x4')](/\n/g,_0x7da2('0x5'));var _0x271cb3=_0x4ee5d7[0x10][_0x7da2('0x4')](/\n/g,'\x20');if(!arr[_0x7da2('0x6')](_0x2adf3c)){arr['push'](_0x2adf3c);var _0x38a96e=_0x4ee5d7[0x3];var _0x24ee1c=_0x4ee5d7[0x4];var _0x322068=_0x4ee5d7[0x1];var _0x43de95=_0x4ee5d7[0x0];var _0x5ed35e={};_0x5ed35e[_0x7da2('0x7')]=_0x4ee5d7[0x8]+_0x7da2('0x8')+_0x4297c9+'|'+_0x30d5a9+'|'+_0x35f46f+'|'+_0x2adf3c+'|'+_0x2d0c82;_0x5ed35e[_0x7da2('0x9')]=_0x4ee5d7[0x7]+'?params='+_0x4297c9+'|'+_0x30d5a9+'|'+_0x35f46f+'|'+_0x2adf3c+'|'+_0x2d0c82+'|'+_0x3356ce+'|'+_0x271cb3;_0x5ed35e['title']=_0x4ee5d7[0x9];var _0x5b04f0={};_0x5b04f0[_0x7da2('0xa')]=_0x7da2('0xb');_0x5b04f0['method']=_0x7da2('0xc');var _0x49c1fa=[];_0x49c1fa[_0x7da2('0xd')](_0x4ee5d7[0x2]);_0x49c1fa[_0x7da2('0xd')](_0x4ee5d7[0x5]);_0x49c1fa[_0x7da2('0xd')](_0x4ee5d7[0x6]);_0x5b04f0['params']=_0x49c1fa;_0x5b04f0['id']=0x1;var _0xc6d8c1=JSON['stringify'](_0x5b04f0);var _0xaebc89={'encoding':_0x7da2('0xe'),'method':_0x7da2('0xf'),'timeout':0x2710,'url':_0x38a96e,'headers':{'Content-Type':_0x7da2('0x10')},'body':_0xc6d8c1};return rp(_0xaebc89)[_0x7da2('0x11')](function(_0x1fcf25){const _0x517c1e=JSON[_0x7da2('0x12')](_0x1fcf25);if(!_0x517c1e['result'][_0x7da2('0x13')]){throw new Error(_0x7da2('0x14'));}var _0x4f5dc2=_0x2adf3c;var _0x46325a=_0x7da2('0x15')+_0x322068+_0x7da2('0x16')+_0x43de95+_0x7da2('0x17')+_0x4f5dc2+_0x7da2('0x18')+JSON['stringify'](_0x5ed35e);var _0x3df139=_0x24ee1c+'?'+_0x46325a;return rp(_0x3df139);})[_0x7da2('0x11')](function(_0xa90325){logger[_0x7da2('0x19')](_0x7da2('0x1a'),_0x79073e,_0xa90325);_0xd94e58[_0x7da2('0x1b')]();})[_0x7da2('0x1c')](function(_0x1beb06){logger[_0x7da2('0x1d')](_0x7da2('0x1e'),_0x79073e,_[_0x7da2('0x1f')](_0x1beb06)?JSON['stringify'](_0x1beb06):_0x1beb06);_0xd94e58[_0x7da2('0x1b')]();});}else{logger[_0x7da2('0x19')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x79073e);_0xd94e58[_0x7da2('0x20')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index da4cc73..42bbee7 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x1e597d,_0x3776d0){var _0x140f31=function(_0x8b5999){while(--_0x8b5999){_0x1e597d['push'](_0x1e597d['shift']());}};_0x140f31(++_0x3776d0);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x43e1c5,_0xcb6209){var _0x240cd5=function(_0x55e94e){while(--_0x55e94e){_0x43e1c5['push'](_0x43e1c5['shift']());}};_0x240cd5(++_0xcb6209);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 3c851bb..fc5b213 100644 --- a/server/services/routing/server/index.js +++ b/server/services/routing/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6b0=['IntervalId','Intervals','map','interval','listen','rules','channel','interaction','checkWaitingNotifications','applications','length','existsSync','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','message','tag','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','format','./interval','./applications/','priority','info','on\x20interval','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','complete','Skipped\x20routing\x20for\x20%s','stack','agent','agents','busyQueue','emit','end','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil'];(function(_0x187b19,_0x141627){var _0x311c27=function(_0x5a9d5a){while(--_0x5a9d5a){_0x187b19['push'](_0x187b19['shift']());}};_0x311c27(++_0x141627);}(_0xc6b0,0x121));var _0x0c6b=function(_0x39dc51,_0xf62016){_0x39dc51=_0x39dc51-0x0;var _0x521695=_0xc6b0[_0x39dc51];return _0x521695;};'use strict';var _=require(_0x0c6b('0x0'));var util=require(_0x0c6b('0x1'));var path=require(_0x0c6b('0x2'));var fs=require('fs');var jayson=require(_0x0c6b('0x3'));var BPromise=require(_0x0c6b('0x4'));var utils=require(_0x0c6b('0x5'));var sUtils=require(_0x0c6b('0x6'));var logger=require('../../../config/logger')(_0x0c6b('0x7'));var rpc={'openchannelQueueReport':require(_0x0c6b('0x8')),'mailQueueReport':require(_0x0c6b('0x9')),'chatQueueReport':require(_0x0c6b('0xa')),'smsQueueReport':require(_0x0c6b('0xb')),'faxQueueReport':require(_0x0c6b('0xc')),'whatsappQueueReport':require(_0x0c6b('0xd'))};var RuleEngine=require(_0x0c6b('0xe'));function getId(_0x2f4002,_0x261cee,_0x580715){return util['format'](_0x0c6b('0xf'),_0x2f4002,_0x261cee||0x0,_0x580715||0x0);}function getIntervals(_0x16f0c8,_0x49736d){var _0x4da895=[];if(!_[_0x0c6b('0x10')](_0x49736d[_0x0c6b('0x11')])&&!_['isNil'](_0x16f0c8[_0x49736d[_0x0c6b('0x11')]])&&!_[_0x0c6b('0x10')](_0x16f0c8[_0x49736d[_0x0c6b('0x11')]][_0x0c6b('0x12')])){_0x4da895=_[_0x0c6b('0x13')](_0x16f0c8[_0x49736d[_0x0c6b('0x11')]][_0x0c6b('0x12')],'interval');}else if(!_[_0x0c6b('0x10')](_0x49736d[_0x0c6b('0x14')])){_0x4da895=[_0x49736d['interval']];}return _0x4da895;}exports[_0x0c6b('0x15')]=function(_0x58cfdb){_0x58cfdb[_0x0c6b('0x16')]={};return new BPromise(function(_0x414794,_0x12a13a){var _0x383799={'Start':function(_0x9e2e85){var _0x1ee6c1=this;return new Promise(function(_0x508dfd,_0x4a3ff6){if(_0x9e2e85){try{var _0x2ef839=[];var _0x2c0bbb=getId(_0x9e2e85[_0x0c6b('0x17')],_0x9e2e85['message']?_0x9e2e85['message']['id']:0x0,_0x9e2e85[_0x0c6b('0x18')]?_0x9e2e85['interaction']['id']:0x0);var _0x482b37=sUtils[_0x0c6b('0x19')](_0x58cfdb,_0x9e2e85);if(!_0x482b37&&_0x9e2e85[_0x0c6b('0x1a')]&&_['isArray'](_0x9e2e85['applications'])&&_0x9e2e85[_0x0c6b('0x1a')][_0x0c6b('0x1b')]){for(var _0x12f471=0x0;_0x12f471<_0x9e2e85[_0x0c6b('0x1a')][_0x0c6b('0x1b')];_0x12f471+=0x1){var _0xdd79cf=_0x9e2e85[_0x0c6b('0x1a')][_0x12f471];if(fs[_0x0c6b('0x1c')](path['join'](__dirname,_0x0c6b('0x1a'),_0xdd79cf[_0x0c6b('0x1d')]+_0x0c6b('0x1e')))){var _0x33ec26=[];switch(_0xdd79cf[_0x0c6b('0x1d')][_0x0c6b('0x1f')]()){case _0x0c6b('0x20'):var _0x5ad93a=_0xdd79cf[_0x0c6b('0x21')][_0x0c6b('0x22')](',');if(_0x9e2e85[_0x0c6b('0x17')]===_0x0c6b('0x23')){_0x33ec26['push'](_0x5ad93a[0x0]);_0x33ec26[_0x0c6b('0x24')](_0x5ad93a[0x1]);_0x33ec26[_0x0c6b('0x24')](_0x5ad93a[_0x0c6b('0x25')](0x2,_0x5ad93a[_0x0c6b('0x1b')])[_0x0c6b('0x26')](','));}else{_0x33ec26[_0x0c6b('0x24')](_0x5ad93a[0x0]);_0x33ec26[_0x0c6b('0x24')](_0x5ad93a[_0x0c6b('0x25')](0x1,_0x5ad93a[_0x0c6b('0x1b')])[_0x0c6b('0x26')](','));}break;case _0x0c6b('0x27'):var _0xe5902d=_0xdd79cf[_0x0c6b('0x21')]['split'](',');_0x33ec26[_0x0c6b('0x24')](_0xe5902d[0x0]);_0x33ec26[_0x0c6b('0x24')](_0xe5902d[0x1]);_0x33ec26[_0x0c6b('0x24')](_0xe5902d[_0x0c6b('0x25')](0x2,_0xe5902d['length'])[_0x0c6b('0x26')](','));break;case _0x0c6b('0x28'):var _0x22fa1a=_0xdd79cf[_0x0c6b('0x21')][_0x0c6b('0x22')](',');_0x33ec26[_0x0c6b('0x24')](_0x22fa1a[0x0]);_0x33ec26[_0x0c6b('0x24')](_0x22fa1a[0x1]);_0x33ec26[_0x0c6b('0x24')](_0x22fa1a[0x2]);_0x33ec26['push'](_0x22fa1a[0x3]);_0x33ec26[_0x0c6b('0x24')](_0x22fa1a[_0x0c6b('0x25')](0x4,_0x22fa1a[_0x0c6b('0x1b')])[_0x0c6b('0x26')](','));break;case'amazonlex':var _0x2049eb=_0xdd79cf['appdata'][_0x0c6b('0x22')](',');_0x33ec26[_0x0c6b('0x24')](_0x2049eb[0x0]);_0x33ec26[_0x0c6b('0x24')](_0x2049eb[0x1]);_0x33ec26[_0x0c6b('0x24')](_0x2049eb[0x2]);_0x33ec26[_0x0c6b('0x24')](_0x2049eb[0x3]);_0x33ec26[_0x0c6b('0x24')](_0x2049eb[_0x0c6b('0x25')](0x4,_0x2049eb[_0x0c6b('0x1b')])['join'](','));break;case _0x0c6b('0x29'):_0x33ec26[_0x0c6b('0x24')](_0xdd79cf[_0x0c6b('0x21')]);break;case _0x0c6b('0x2a'):_0x33ec26[_0x0c6b('0x24')](_0xdd79cf['TagId']);_0x33ec26['push'](_0xdd79cf[_0x0c6b('0x21')]);break;case _0x0c6b('0x2b'):var _0x5c25fa=utils[_0x0c6b('0x2c')](_0x9e2e85[_0x0c6b('0x2d')]['notificationTemplate'],_0x9e2e85);var _0x5eaf0b=_0xdd79cf[_0x0c6b('0x21')][_0x0c6b('0x22')](',');_0x33ec26[_0x0c6b('0x24')](_0x5eaf0b[0x0]);_0x33ec26[_0x0c6b('0x24')](_0x5eaf0b[0x1]);_0x33ec26[_0x0c6b('0x24')](_0x5eaf0b[0x2]);_0x33ec26[_0x0c6b('0x24')](_0x5eaf0b[0x3]);_0x33ec26[_0x0c6b('0x24')](_0x5eaf0b[0x4]);_0x33ec26[_0x0c6b('0x24')](_0x5eaf0b[0x5]);_0x33ec26[_0x0c6b('0x24')](_0x5eaf0b[0x6]);_0x33ec26['push'](_0x5eaf0b[0x7]);_0x33ec26['push'](_0x5eaf0b[0x8]);_0x33ec26[_0x0c6b('0x24')](_0x5eaf0b[0x9]);_0x33ec26[_0x0c6b('0x24')](_0x5eaf0b[0xa]);_0x33ec26[_0x0c6b('0x24')](_0x9e2e85[_0x0c6b('0x18')]['id']);_0x33ec26[_0x0c6b('0x24')](_0x9e2e85[_0x0c6b('0x29')]['id']);_0x33ec26[_0x0c6b('0x24')](_0xdd79cf[_0x0c6b('0x2e')]);_0x33ec26['push'](_0x9e2e85[_0x0c6b('0x18')][_0x0c6b('0x2f')]);_0x33ec26[_0x0c6b('0x24')](_0x9e2e85['body'][_0x0c6b('0x30')]);_0x33ec26[_0x0c6b('0x24')](_0x5c25fa);break;default:_0x33ec26=_[_0x0c6b('0x10')](_0xdd79cf[_0x0c6b('0x21')])?[]:_0xdd79cf[_0x0c6b('0x21')][_0x0c6b('0x22')](',');}var _0x552ee7={'id':util[_0x0c6b('0x31')]('%s:%s:%s',_0x2c0bbb,_0xdd79cf['id'],_0xdd79cf['app']),'condition':require(_0x0c6b('0x32'))['condition'](_0x2c0bbb,getIntervals(_0x58cfdb['intervals'],_0xdd79cf),_0x58cfdb),'consequence':require(_0x0c6b('0x33')+_0xdd79cf[_0x0c6b('0x1d')])['consequence'](_0x2c0bbb,_0x33ec26,_0x58cfdb,_0x9e2e85),'p':_0xdd79cf[_0x0c6b('0x34')]||0x0};logger[_0x0c6b('0x35')]('Push\x20new\x20rule',_0x552ee7['id'],_0x0c6b('0x36'),getIntervals(_0x58cfdb[_0x0c6b('0x37')],_0xdd79cf)[_0x0c6b('0x26')]('\x20|\x20'));_0x2ef839[_0x0c6b('0x24')](_0x552ee7);}else{logger[_0x0c6b('0x38')](_0x0c6b('0x39'),path[_0x0c6b('0x26')](__dirname,_0x0c6b('0x1a'),_0xdd79cf[_0x0c6b('0x1d')]+_0x0c6b('0x1e')));}}_0x58cfdb[_0x0c6b('0x16')][_0x2c0bbb]=new RuleEngine(_0x2ef839);_0x58cfdb['rules'][_0x2c0bbb][_0x0c6b('0x3a')](_0x9e2e85,function(_0x913d9c){logger['info'](_0x0c6b('0x3b'),JSON[_0x0c6b('0x3c')](_0x913d9c[_0x0c6b('0x3d')]));if(_0x58cfdb['rules'][_0x2c0bbb]){_0x58cfdb['rules'][_0x2c0bbb]['emit'](_0x0c6b('0x3e'));}});return _0x508dfd({'code':0xc8,'message':_0x9e2e85});}else{if(_0x482b37){logger[_0x0c6b('0x35')](util[_0x0c6b('0x31')](_0x0c6b('0x3f'),_0x2c0bbb));}else{logger[_0x0c6b('0x35')]('No\x20applications\x20to\x20execute');}return _0x508dfd({'code':0xc8,'message':_0x9e2e85});}}catch(_0x33becb){logger[_0x0c6b('0x38')](_0x33becb[_0x0c6b('0x40')]);return _0x4a3ff6(_0x1ee6c1[_0x0c6b('0x38')](0x1f4,_0x33becb));}}return _0x4a3ff6('routing\x20is\x20empty');});},'AcceptMessage':function(_0x3bcf7f){var _0x4db1ea=this;return new Promise(function(_0x1b70c4,_0xd0f86){if(_0x3bcf7f[_0x0c6b('0x41')]&&_0x3bcf7f[_0x0c6b('0x41')]['id']){if(_0x58cfdb[_0x0c6b('0x42')][_0x3bcf7f['agent']['id']]){_0x58cfdb[_0x0c6b('0x42')][_0x3bcf7f['agent']['id']]['busy']=![];_0x58cfdb[_0x0c6b('0x42')][_0x3bcf7f[_0x0c6b('0x41')]['id']][_0x0c6b('0x43')]=undefined;}}if(_0x3bcf7f[_0x0c6b('0x29')]&&_0x3bcf7f['message']['id']){try{var _0x1fc005=getId(_0x3bcf7f[_0x0c6b('0x17')],_0x3bcf7f['message']?_0x3bcf7f[_0x0c6b('0x29')]['id']:0x0,_0x3bcf7f[_0x0c6b('0x18')]?_0x3bcf7f[_0x0c6b('0x18')]['id']:0x0);if(_0x58cfdb[_0x0c6b('0x16')][_0x1fc005]){_0x58cfdb[_0x0c6b('0x16')][_0x1fc005][_0x0c6b('0x44')](_0x0c6b('0x45'));if(rpc[_0x3bcf7f[_0x0c6b('0x17')]+'QueueReport']){rpc[_0x3bcf7f[_0x0c6b('0x17')]+'QueueReport'][_0x0c6b('0x46')](_0x1fc005,{'UserId':_0x3bcf7f['message'][_0x0c6b('0x47')]})[_0x0c6b('0x48')](function(){logger[_0x0c6b('0x38')](_0x0c6b('0x49'));});}}return _0x1b70c4({'code':0xc8,'message':_0x3bcf7f});}catch(_0x4ebd14){logger['error'](_0x4ebd14[_0x0c6b('0x40')]);return _0xd0f86(_0x4db1ea['error'](0x1f4,_0x4ebd14));}}logger[_0x0c6b('0x38')]('message\x20is\x20empty');return _0xd0f86(_0x4db1ea[_0x0c6b('0x38')](0x1f4,_0x0c6b('0x4a')));});},'RejectMessage':function(_0x54a95b){var _0x1b3838=this;return new Promise(function(_0x31564a,_0x4756a3){if(_0x54a95b[_0x0c6b('0x41')]&&_0x54a95b[_0x0c6b('0x41')]['id']){try{if(_0x58cfdb[_0x0c6b('0x42')][_0x54a95b[_0x0c6b('0x41')]['id']]){_0x58cfdb[_0x0c6b('0x42')][_0x54a95b['agent']['id']][_0x0c6b('0x4b')]=![];_0x58cfdb[_0x0c6b('0x42')][_0x54a95b[_0x0c6b('0x41')]['id']][_0x0c6b('0x43')]=undefined;}return _0x31564a({'code':0xc8,'message':_0x54a95b});}catch(_0x271116){logger[_0x0c6b('0x38')](_0x271116['stack']);return _0x4756a3(_0x1b3838[_0x0c6b('0x38')](0x1f4,_0x271116));}}logger[_0x0c6b('0x38')]('message\x20is\x20empty');return _0x4756a3(_0x1b3838['error'](0x1f4,_0x0c6b('0x4a')));});},'AbandonInteraction':function(_0xfdba86){var _0x5de6f1=this;return new Promise(function(_0x144fe7,_0x414381){if(_0xfdba86[_0x0c6b('0x17')]&&_0xfdba86[_0x0c6b('0x18')]&&_0xfdba86['interaction']['id']){try{var _0x20341c=getId(_0xfdba86[_0x0c6b('0x17')],_0xfdba86[_0x0c6b('0x29')]?_0xfdba86[_0x0c6b('0x29')]['id']:0x0,_0xfdba86['interaction']?_0xfdba86[_0x0c6b('0x18')]['id']:0x0);if(_0x58cfdb['rules'][_0x20341c]){_0x58cfdb['rules'][_0x20341c]['emit'](_0x0c6b('0x45'));}return _0x144fe7({'code':0xc8,'message':_0xfdba86});}catch(_0x2bbf3d){logger[_0x0c6b('0x38')](_0x2bbf3d[_0x0c6b('0x40')]);return _0x414381(_0x5de6f1[_0x0c6b('0x38')](0x1f4,_0x2bbf3d));}}logger[_0x0c6b('0x38')](_0x0c6b('0x4a'));return _0x414381(_0x5de6f1[_0x0c6b('0x38')](0x1f4,_0x0c6b('0x4a')));});},'AgentCapacity':function(_0x447943){var _0xb1cb99=this;return new Promise(function(_0x9ec1aa,_0x374786){if(_0x58cfdb[_0x0c6b('0x42')][_0x0c6b('0x4c')](_0x447943['id'])){for(var _0x531bb5 in _0x447943['capacity']){if(_0x447943[_0x0c6b('0x4d')][_0x0c6b('0x4c')](_0x531bb5)){if(_0x58cfdb[_0x0c6b('0x42')][_0x447943['id']]['hasOwnProperty'](_0x531bb5+_0x0c6b('0x4e'))){_0x58cfdb['agents'][_0x447943['id']][_0x531bb5+_0x0c6b('0x4e')]=parseInt(_0x447943['capacity'][_0x531bb5],0xa);}}}_0x58cfdb[_0x0c6b('0x42')][_0x447943['id']]['updateRealtime']();return _0x9ec1aa({'code':0xc8,'message':_0x58cfdb[_0x0c6b('0x42')][_0x447943['id']]});}else{return _0x374786(_0xb1cb99[_0x0c6b('0x38')](0x1f4,_0x0c6b('0x4f')));}});},'Agents':function(_0x577838){return new Promise(function(_0x2c4b1c){var _0x3a076d=_[_0x0c6b('0x50')](_0x58cfdb[_0x0c6b('0x42')]);if(_0x577838&&_0x577838['id']){var _0x4d7d79=_[_0x0c6b('0x51')](_0x3a076d,function(_0x1e2d39){return _0x1e2d39['id']===_0x577838['id'];});_0x2c4b1c(_0x4d7d79);}else{_0x2c4b1c({'count':_0x3a076d[_0x0c6b('0x1b')],'rows':_0x3a076d});}});},'ChatQueues':function(){return new Promise(function(_0xaf10e4){var _0x561abd=[];for(var _0x923642 in _0x58cfdb[_0x0c6b('0x52')]){if(_0x58cfdb[_0x0c6b('0x52')][_0x0c6b('0x4c')](_0x923642)){var _0x44b71c=_0x58cfdb['chatQueues'][_0x923642];var _0x3aad43={'id':_0x44b71c['id'],'available':_0x44b71c[_0x0c6b('0x53')],'loggedIn':_0x44b71c[_0x0c6b('0x54')],'name':_0x44b71c[_0x0c6b('0x55')],'paused':_0x44b71c[_0x0c6b('0x56')],'waiting':_0x44b71c[_0x0c6b('0x57')]};_0x561abd[_0x0c6b('0x24')](_0x3aad43);}}_0xaf10e4({'count':_0x561abd['length'],'rows':_0x561abd});});},'MailQueues':function(){return new Promise(function(_0x3c9156){var _0x3d88c0=[];for(var _0x2a6229 in _0x58cfdb['mailQueues']){if(_0x58cfdb['mailQueues'][_0x0c6b('0x4c')](_0x2a6229)){var _0x413745=_0x58cfdb['mailQueues'][_0x2a6229];var _0x3ab7f5={'id':_0x413745['id'],'available':_0x413745['available'],'loggedIn':_0x413745[_0x0c6b('0x54')],'name':_0x413745[_0x0c6b('0x55')],'paused':_0x413745['paused'],'waiting':_0x413745['waiting']};_0x3d88c0[_0x0c6b('0x24')](_0x3ab7f5);}}_0x3c9156({'count':_0x3d88c0[_0x0c6b('0x1b')],'rows':_0x3d88c0});});},'OpenchannelQueues':function(){return new Promise(function(_0x3e3cdc){var _0x365b78=[];for(var _0x356fff in _0x58cfdb['openchannelQueues']){if(_0x58cfdb[_0x0c6b('0x58')][_0x0c6b('0x4c')](_0x356fff)){var _0x494305=_0x58cfdb['openchannelQueues'][_0x356fff];var _0x15d5d4={'id':_0x494305['id'],'available':_0x494305['available'],'loggedIn':_0x494305[_0x0c6b('0x54')],'name':_0x494305[_0x0c6b('0x55')],'paused':_0x494305[_0x0c6b('0x56')],'waiting':_0x494305[_0x0c6b('0x57')]};_0x365b78['push'](_0x15d5d4);}}_0x3e3cdc({'count':_0x365b78['length'],'rows':_0x365b78});});},'SmsQueues':function(){return new Promise(function(_0x4f4c99){var _0x278430=[];for(var _0x13e8f6 in _0x58cfdb[_0x0c6b('0x59')]){if(_0x58cfdb[_0x0c6b('0x59')][_0x0c6b('0x4c')](_0x13e8f6)){var _0x52b7ba=_0x58cfdb[_0x0c6b('0x59')][_0x13e8f6];var _0x20799b={'id':_0x52b7ba['id'],'available':_0x52b7ba[_0x0c6b('0x53')],'loggedIn':_0x52b7ba['loggedIn'],'name':_0x52b7ba[_0x0c6b('0x55')],'paused':_0x52b7ba[_0x0c6b('0x56')],'waiting':_0x52b7ba[_0x0c6b('0x57')]};_0x278430[_0x0c6b('0x24')](_0x20799b);}}_0x4f4c99({'count':_0x278430['length'],'rows':_0x278430});});},'FaxQueues':function(){return new Promise(function(_0x17d5bd){var _0xd9c1f8=[];for(var _0x151606 in _0x58cfdb[_0x0c6b('0x5a')]){if(_0x58cfdb[_0x0c6b('0x5a')][_0x0c6b('0x4c')](_0x151606)){var _0x36468e=_0x58cfdb[_0x0c6b('0x5a')][_0x151606];var _0x4cf31f={'id':_0x36468e['id'],'available':_0x36468e['available'],'loggedIn':_0x36468e[_0x0c6b('0x54')],'name':_0x36468e['name'],'paused':_0x36468e[_0x0c6b('0x56')],'waiting':_0x36468e[_0x0c6b('0x57')]};_0xd9c1f8[_0x0c6b('0x24')](_0x4cf31f);}}_0x17d5bd({'count':_0xd9c1f8['length'],'rows':_0xd9c1f8});});},'WhatsappQueues':function(){return new Promise(function(_0x7bd68a){var _0x435733=[];for(var _0x138d60 in _0x58cfdb['whatsappQueues']){if(_0x58cfdb[_0x0c6b('0x5b')][_0x0c6b('0x4c')](_0x138d60)){var _0x26e161=_0x58cfdb[_0x0c6b('0x5b')][_0x138d60];var _0x55bcbf={'id':_0x26e161['id'],'available':_0x26e161[_0x0c6b('0x53')],'loggedIn':_0x26e161['loggedIn'],'name':_0x26e161[_0x0c6b('0x55')],'paused':_0x26e161['paused'],'waiting':_0x26e161[_0x0c6b('0x57')]};_0x435733['push'](_0x55bcbf);}}_0x7bd68a({'count':_0x435733[_0x0c6b('0x1b')],'rows':_0x435733});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xe629ee){var _0x483e71=_[_0x0c6b('0x50')](_0x58cfdb['chatQueuesWaitingInteractions']);_0xe629ee({'count':_0x483e71['length'],'rows':_0x483e71});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2ac421){var _0x4125f1=_[_0x0c6b('0x50')](_0x58cfdb[_0x0c6b('0x5c')]);_0x2ac421({'count':_0x4125f1[_0x0c6b('0x1b')],'rows':_0x4125f1});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x518826){var _0x3a50c6=_['values'](_0x58cfdb[_0x0c6b('0x5d')]);_0x518826({'count':_0x3a50c6['length'],'rows':_0x3a50c6});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x23cb38){var _0x430857=_['values'](_0x58cfdb[_0x0c6b('0x5e')]);_0x23cb38({'count':_0x430857[_0x0c6b('0x1b')],'rows':_0x430857});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2720dd){var _0x34d7bd=_[_0x0c6b('0x50')](_0x58cfdb[_0x0c6b('0x5f')]);_0x2720dd({'count':_0x34d7bd[_0x0c6b('0x1b')],'rows':_0x34d7bd});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x300c70){var _0x16df35=_[_0x0c6b('0x50')](_0x58cfdb[_0x0c6b('0x60')]);_0x300c70({'count':_0x16df35[_0x0c6b('0x1b')],'rows':_0x16df35});});}};var _0x42f668=jayson[_0x0c6b('0x61')](_0x383799)[_0x0c6b('0x62')]();_0x42f668['on']('error',function(_0x4c0356){logger[_0x0c6b('0x38')](JSON['stringify'](_0x4c0356));return _0x12a13a(_0x4c0356);});_0x42f668[_0x0c6b('0x15')](0x232c,'127.0.0.1',function(){console[_0x0c6b('0x63')](_0x0c6b('0x64'),0x232c);return _0x414794(_0x0c6b('0x65')+0x232c);});});}; \ No newline at end of file +var _0x76f8=['getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','condition','intervals','./applications/','consequence','priority','info','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn','paused','waiting','mailQueues','openchannelQueues','name','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','existsSync','join','app','autoreply','split','mail','push','slice','length','dialogflow','appdata','amazonlex','tag','TagId','tvox'];(function(_0x30e762,_0x2d70fa){var _0x473bbf=function(_0x4aefea){while(--_0x4aefea){_0x30e762['push'](_0x30e762['shift']());}};_0x473bbf(++_0x2d70fa);}(_0x76f8,0x16f));var _0x876f=function(_0xfa79b7,_0x23f2a0){_0xfa79b7=_0xfa79b7-0x0;var _0x4e7f64=_0x76f8[_0xfa79b7];return _0x4e7f64;};'use strict';var _=require(_0x876f('0x0'));var util=require('util');var path=require(_0x876f('0x1'));var fs=require('fs');var jayson=require(_0x876f('0x2'));var BPromise=require(_0x876f('0x3'));var utils=require(_0x876f('0x4'));var sUtils=require(_0x876f('0x5'));var logger=require(_0x876f('0x6'))(_0x876f('0x7'));var rpc={'openchannelQueueReport':require(_0x876f('0x8')),'mailQueueReport':require(_0x876f('0x9')),'chatQueueReport':require(_0x876f('0xa')),'smsQueueReport':require(_0x876f('0xb')),'faxQueueReport':require(_0x876f('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x876f('0xd'));function getId(_0x51c8ed,_0x4ea7ce,_0x6bc99d){return util[_0x876f('0xe')]('%s.%s.%s',_0x51c8ed,_0x4ea7ce||0x0,_0x6bc99d||0x0);}function getIntervals(_0x2bceab,_0x54dbe8){var _0x3273a1=[];if(!_[_0x876f('0xf')](_0x54dbe8[_0x876f('0x10')])&&!_[_0x876f('0xf')](_0x2bceab[_0x54dbe8[_0x876f('0x10')]])&&!_['isNil'](_0x2bceab[_0x54dbe8[_0x876f('0x10')]][_0x876f('0x11')])){_0x3273a1=_['map'](_0x2bceab[_0x54dbe8[_0x876f('0x10')]][_0x876f('0x11')],_0x876f('0x12'));}else if(!_[_0x876f('0xf')](_0x54dbe8[_0x876f('0x12')])){_0x3273a1=[_0x54dbe8['interval']];}return _0x3273a1;}exports[_0x876f('0x13')]=function(_0x440405){_0x440405[_0x876f('0x14')]={};return new BPromise(function(_0x1e1c1a,_0x3fc0b6){var _0x42911b={'Start':function(_0xc93219){var _0x272f14=this;return new Promise(function(_0x34aabc,_0x373b62){if(_0xc93219){try{var _0x59fc6f=[];var _0x4c2dff=getId(_0xc93219[_0x876f('0x15')],_0xc93219[_0x876f('0x16')]?_0xc93219[_0x876f('0x16')]['id']:0x0,_0xc93219['interaction']?_0xc93219[_0x876f('0x17')]['id']:0x0);var _0xc3c21c=sUtils['checkWaitingNotifications'](_0x440405,_0xc93219);if(!_0xc3c21c&&_0xc93219[_0x876f('0x18')]&&_[_0x876f('0x19')](_0xc93219[_0x876f('0x18')])&&_0xc93219[_0x876f('0x18')]['length']){for(var _0x2beece=0x0;_0x2beece<_0xc93219[_0x876f('0x18')]['length'];_0x2beece+=0x1){var _0x3286d7=_0xc93219[_0x876f('0x18')][_0x2beece];if(fs[_0x876f('0x1a')](path[_0x876f('0x1b')](__dirname,'applications',_0x3286d7[_0x876f('0x1c')]+'.js'))){var _0x3fda93=[];switch(_0x3286d7[_0x876f('0x1c')]['toLowerCase']()){case _0x876f('0x1d'):var _0x55569=_0x3286d7['appdata'][_0x876f('0x1e')](',');if(_0xc93219[_0x876f('0x15')]===_0x876f('0x1f')){_0x3fda93[_0x876f('0x20')](_0x55569[0x0]);_0x3fda93[_0x876f('0x20')](_0x55569[0x1]);_0x3fda93[_0x876f('0x20')](_0x55569[_0x876f('0x21')](0x2,_0x55569[_0x876f('0x22')])[_0x876f('0x1b')](','));}else{_0x3fda93[_0x876f('0x20')](_0x55569[0x0]);_0x3fda93[_0x876f('0x20')](_0x55569[_0x876f('0x21')](0x1,_0x55569[_0x876f('0x22')])['join'](','));}break;case _0x876f('0x23'):var _0x54e140=_0x3286d7[_0x876f('0x24')][_0x876f('0x1e')](',');_0x3fda93[_0x876f('0x20')](_0x54e140[0x0]);_0x3fda93['push'](_0x54e140[0x1]);_0x3fda93[_0x876f('0x20')](_0x54e140[_0x876f('0x21')](0x2,_0x54e140['length'])['join'](','));break;case'dialogflowv2':var _0x4bda20=_0x3286d7[_0x876f('0x24')][_0x876f('0x1e')](',');_0x3fda93[_0x876f('0x20')](_0x4bda20[0x0]);_0x3fda93['push'](_0x4bda20[0x1]);_0x3fda93[_0x876f('0x20')](_0x4bda20[0x2]);_0x3fda93['push'](_0x4bda20[0x3]);_0x3fda93[_0x876f('0x20')](_0x4bda20[_0x876f('0x21')](0x4,_0x4bda20[_0x876f('0x22')])[_0x876f('0x1b')](','));break;case _0x876f('0x25'):var _0x16f9c1=_0x3286d7['appdata'][_0x876f('0x1e')](',');_0x3fda93[_0x876f('0x20')](_0x16f9c1[0x0]);_0x3fda93['push'](_0x16f9c1[0x1]);_0x3fda93[_0x876f('0x20')](_0x16f9c1[0x2]);_0x3fda93['push'](_0x16f9c1[0x3]);_0x3fda93[_0x876f('0x20')](_0x16f9c1[_0x876f('0x21')](0x4,_0x16f9c1[_0x876f('0x22')])[_0x876f('0x1b')](','));break;case _0x876f('0x16'):_0x3fda93[_0x876f('0x20')](_0x3286d7[_0x876f('0x24')]);break;case _0x876f('0x26'):_0x3fda93['push'](_0x3286d7[_0x876f('0x27')]);_0x3fda93['push'](_0x3286d7[_0x876f('0x24')]);break;case _0x876f('0x28'):var _0x3d23e7=utils[_0x876f('0x29')](_0xc93219[_0x876f('0x2a')][_0x876f('0x2b')],_0xc93219);var _0x92d35b=_0x3286d7[_0x876f('0x24')][_0x876f('0x1e')](',');_0x3fda93[_0x876f('0x20')](_0x92d35b[0x0]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x1]);_0x3fda93['push'](_0x92d35b[0x2]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x3]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x4]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x5]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x6]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x7]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x8]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x9]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0xa]);_0x3fda93[_0x876f('0x20')](_0xc93219[_0x876f('0x17')]['id']);_0x3fda93[_0x876f('0x20')](_0xc93219[_0x876f('0x16')]['id']);_0x3fda93[_0x876f('0x20')](_0x3286d7[_0x876f('0x2c')]);_0x3fda93['push'](_0xc93219[_0x876f('0x17')][_0x876f('0x2d')]);_0x3fda93[_0x876f('0x20')](_0xc93219[_0x876f('0x2e')][_0x876f('0x2e')]);_0x3fda93[_0x876f('0x20')](_0x3d23e7);break;default:_0x3fda93=_[_0x876f('0xf')](_0x3286d7['appdata'])?[]:_0x3286d7['appdata'][_0x876f('0x1e')](',');}var _0x1758e3={'id':util['format']('%s:%s:%s',_0x4c2dff,_0x3286d7['id'],_0x3286d7[_0x876f('0x1c')]),'condition':require('./interval')[_0x876f('0x2f')](_0x4c2dff,getIntervals(_0x440405[_0x876f('0x30')],_0x3286d7),_0x440405),'consequence':require(_0x876f('0x31')+_0x3286d7['app'])[_0x876f('0x32')](_0x4c2dff,_0x3fda93,_0x440405,_0xc93219),'p':_0x3286d7[_0x876f('0x33')]||0x0};logger[_0x876f('0x34')]('Push\x20new\x20rule',_0x1758e3['id'],_0x876f('0x35'),getIntervals(_0x440405[_0x876f('0x30')],_0x3286d7)[_0x876f('0x1b')]('\x20|\x20'));_0x59fc6f[_0x876f('0x20')](_0x1758e3);}else{logger[_0x876f('0x36')](_0x876f('0x37'),path[_0x876f('0x1b')](__dirname,_0x876f('0x18'),_0x3286d7[_0x876f('0x1c')]+_0x876f('0x38')));}}_0x440405[_0x876f('0x14')][_0x4c2dff]=new RuleEngine(_0x59fc6f);_0x440405['rules'][_0x4c2dff][_0x876f('0x39')](_0xc93219,function(_0x1f112e){logger[_0x876f('0x34')]('Applications\x20executed',JSON[_0x876f('0x3a')](_0x1f112e['matchPath']));if(_0x440405[_0x876f('0x14')][_0x4c2dff]){_0x440405['rules'][_0x4c2dff][_0x876f('0x3b')](_0x876f('0x3c'));}});return _0x34aabc({'code':0xc8,'message':_0xc93219});}else{if(_0xc3c21c){logger[_0x876f('0x34')](util[_0x876f('0xe')]('Skipped\x20routing\x20for\x20%s',_0x4c2dff));}else{logger['info'](_0x876f('0x3d'));}return _0x34aabc({'code':0xc8,'message':_0xc93219});}}catch(_0x239af7){logger[_0x876f('0x36')](_0x239af7[_0x876f('0x3e')]);return _0x373b62(_0x272f14[_0x876f('0x36')](0x1f4,_0x239af7));}}return _0x373b62(_0x876f('0x3f'));});},'AcceptMessage':function(_0x935e89){var _0x4da848=this;return new Promise(function(_0x482166,_0x3a9b3e){if(_0x935e89[_0x876f('0x40')]&&_0x935e89[_0x876f('0x40')]['id']){if(_0x440405[_0x876f('0x41')][_0x935e89[_0x876f('0x40')]['id']]){_0x440405['agents'][_0x935e89[_0x876f('0x40')]['id']]['busy']=![];_0x440405[_0x876f('0x41')][_0x935e89[_0x876f('0x40')]['id']][_0x876f('0x42')]=undefined;}}if(_0x935e89[_0x876f('0x16')]&&_0x935e89['message']['id']){try{var _0x41d4a2=getId(_0x935e89[_0x876f('0x15')],_0x935e89[_0x876f('0x16')]?_0x935e89[_0x876f('0x16')]['id']:0x0,_0x935e89[_0x876f('0x17')]?_0x935e89['interaction']['id']:0x0);if(_0x440405[_0x876f('0x14')][_0x41d4a2]){_0x440405[_0x876f('0x14')][_0x41d4a2][_0x876f('0x3b')](_0x876f('0x43'));if(rpc[_0x935e89[_0x876f('0x15')]+_0x876f('0x44')]){rpc[_0x935e89[_0x876f('0x15')]+'QueueReport'][_0x876f('0x45')](_0x41d4a2,{'UserId':_0x935e89[_0x876f('0x16')][_0x876f('0x46')]})['catch'](function(){logger[_0x876f('0x36')](_0x876f('0x47'));});}}return _0x482166({'code':0xc8,'message':_0x935e89});}catch(_0x21877d){logger[_0x876f('0x36')](_0x21877d[_0x876f('0x3e')]);return _0x3a9b3e(_0x4da848[_0x876f('0x36')](0x1f4,_0x21877d));}}logger[_0x876f('0x36')](_0x876f('0x48'));return _0x3a9b3e(_0x4da848['error'](0x1f4,_0x876f('0x48')));});},'RejectMessage':function(_0x202426){var _0x4f5e1f=this;return new Promise(function(_0xd6c5f4,_0x1362ec){if(_0x202426['agent']&&_0x202426[_0x876f('0x40')]['id']){try{if(_0x440405['agents'][_0x202426[_0x876f('0x40')]['id']]){_0x440405['agents'][_0x202426[_0x876f('0x40')]['id']][_0x876f('0x49')]=![];_0x440405[_0x876f('0x41')][_0x202426[_0x876f('0x40')]['id']]['busyQueue']=undefined;}return _0xd6c5f4({'code':0xc8,'message':_0x202426});}catch(_0x144432){logger[_0x876f('0x36')](_0x144432[_0x876f('0x3e')]);return _0x1362ec(_0x4f5e1f[_0x876f('0x36')](0x1f4,_0x144432));}}logger[_0x876f('0x36')](_0x876f('0x48'));return _0x1362ec(_0x4f5e1f[_0x876f('0x36')](0x1f4,_0x876f('0x48')));});},'AbandonInteraction':function(_0x5ca1e6){var _0x38930a=this;return new Promise(function(_0x406fee,_0x11d1cb){if(_0x5ca1e6[_0x876f('0x15')]&&_0x5ca1e6['interaction']&&_0x5ca1e6[_0x876f('0x17')]['id']){try{var _0x1fbc7a=getId(_0x5ca1e6[_0x876f('0x15')],_0x5ca1e6[_0x876f('0x16')]?_0x5ca1e6[_0x876f('0x16')]['id']:0x0,_0x5ca1e6[_0x876f('0x17')]?_0x5ca1e6['interaction']['id']:0x0);if(_0x440405[_0x876f('0x14')][_0x1fbc7a]){_0x440405[_0x876f('0x14')][_0x1fbc7a]['emit'](_0x876f('0x43'));}return _0x406fee({'code':0xc8,'message':_0x5ca1e6});}catch(_0x207798){logger[_0x876f('0x36')](_0x207798['stack']);return _0x11d1cb(_0x38930a[_0x876f('0x36')](0x1f4,_0x207798));}}logger[_0x876f('0x36')](_0x876f('0x48'));return _0x11d1cb(_0x38930a[_0x876f('0x36')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x565bd5){var _0x3c4175=this;return new Promise(function(_0x287262,_0xddd7ad){if(_0x440405['agents']['hasOwnProperty'](_0x565bd5['id'])){for(var _0x483aba in _0x565bd5[_0x876f('0x4a')]){if(_0x565bd5[_0x876f('0x4a')][_0x876f('0x4b')](_0x483aba)){if(_0x440405[_0x876f('0x41')][_0x565bd5['id']][_0x876f('0x4b')](_0x483aba+_0x876f('0x4c'))){_0x440405[_0x876f('0x41')][_0x565bd5['id']][_0x483aba+_0x876f('0x4c')]=parseInt(_0x565bd5['capacity'][_0x483aba],0xa);}}}_0x440405[_0x876f('0x41')][_0x565bd5['id']][_0x876f('0x4d')]();return _0x287262({'code':0xc8,'message':_0x440405[_0x876f('0x41')][_0x565bd5['id']]});}else{return _0xddd7ad(_0x3c4175[_0x876f('0x36')](0x1f4,_0x876f('0x4e')));}});},'Agents':function(_0x414335){return new Promise(function(_0x19e8fd){var _0x1c4942=_['values'](_0x440405[_0x876f('0x41')]);if(_0x414335&&_0x414335['id']){var _0xfdbf29=_[_0x876f('0x4f')](_0x1c4942,function(_0x481663){return _0x481663['id']===_0x414335['id'];});_0x19e8fd(_0xfdbf29);}else{_0x19e8fd({'count':_0x1c4942[_0x876f('0x22')],'rows':_0x1c4942});}});},'ChatQueues':function(){return new Promise(function(_0x34b8f6){var _0x4518cc=[];for(var _0x1f9ca0 in _0x440405[_0x876f('0x50')]){if(_0x440405['chatQueues'][_0x876f('0x4b')](_0x1f9ca0)){var _0x26f52d=_0x440405[_0x876f('0x50')][_0x1f9ca0];var _0x5e6c65={'id':_0x26f52d['id'],'available':_0x26f52d[_0x876f('0x51')],'loggedIn':_0x26f52d[_0x876f('0x52')],'name':_0x26f52d['name'],'paused':_0x26f52d[_0x876f('0x53')],'waiting':_0x26f52d[_0x876f('0x54')]};_0x4518cc[_0x876f('0x20')](_0x5e6c65);}}_0x34b8f6({'count':_0x4518cc[_0x876f('0x22')],'rows':_0x4518cc});});},'MailQueues':function(){return new Promise(function(_0x254823){var _0x4b4f98=[];for(var _0x436102 in _0x440405[_0x876f('0x55')]){if(_0x440405['mailQueues'][_0x876f('0x4b')](_0x436102)){var _0xf4222f=_0x440405[_0x876f('0x55')][_0x436102];var _0x1bc74c={'id':_0xf4222f['id'],'available':_0xf4222f[_0x876f('0x51')],'loggedIn':_0xf4222f['loggedIn'],'name':_0xf4222f['name'],'paused':_0xf4222f[_0x876f('0x53')],'waiting':_0xf4222f[_0x876f('0x54')]};_0x4b4f98[_0x876f('0x20')](_0x1bc74c);}}_0x254823({'count':_0x4b4f98[_0x876f('0x22')],'rows':_0x4b4f98});});},'OpenchannelQueues':function(){return new Promise(function(_0x280ba4){var _0x5d5cd2=[];for(var _0x259264 in _0x440405[_0x876f('0x56')]){if(_0x440405['openchannelQueues'][_0x876f('0x4b')](_0x259264)){var _0x3863d4=_0x440405[_0x876f('0x56')][_0x259264];var _0x282650={'id':_0x3863d4['id'],'available':_0x3863d4[_0x876f('0x51')],'loggedIn':_0x3863d4[_0x876f('0x52')],'name':_0x3863d4[_0x876f('0x57')],'paused':_0x3863d4[_0x876f('0x53')],'waiting':_0x3863d4[_0x876f('0x54')]};_0x5d5cd2[_0x876f('0x20')](_0x282650);}}_0x280ba4({'count':_0x5d5cd2[_0x876f('0x22')],'rows':_0x5d5cd2});});},'SmsQueues':function(){return new Promise(function(_0x36910b){var _0xde505a=[];for(var _0x4fc56f in _0x440405[_0x876f('0x58')]){if(_0x440405['smsQueues']['hasOwnProperty'](_0x4fc56f)){var _0x5e0e4b=_0x440405['smsQueues'][_0x4fc56f];var _0xcb2ff1={'id':_0x5e0e4b['id'],'available':_0x5e0e4b[_0x876f('0x51')],'loggedIn':_0x5e0e4b[_0x876f('0x52')],'name':_0x5e0e4b[_0x876f('0x57')],'paused':_0x5e0e4b[_0x876f('0x53')],'waiting':_0x5e0e4b[_0x876f('0x54')]};_0xde505a[_0x876f('0x20')](_0xcb2ff1);}}_0x36910b({'count':_0xde505a[_0x876f('0x22')],'rows':_0xde505a});});},'FaxQueues':function(){return new Promise(function(_0x1c757a){var _0x4bd42a=[];for(var _0x369954 in _0x440405[_0x876f('0x59')]){if(_0x440405[_0x876f('0x59')]['hasOwnProperty'](_0x369954)){var _0x557ebe=_0x440405[_0x876f('0x59')][_0x369954];var _0x28b4bd={'id':_0x557ebe['id'],'available':_0x557ebe[_0x876f('0x51')],'loggedIn':_0x557ebe[_0x876f('0x52')],'name':_0x557ebe['name'],'paused':_0x557ebe[_0x876f('0x53')],'waiting':_0x557ebe[_0x876f('0x54')]};_0x4bd42a[_0x876f('0x20')](_0x28b4bd);}}_0x1c757a({'count':_0x4bd42a[_0x876f('0x22')],'rows':_0x4bd42a});});},'WhatsappQueues':function(){return new Promise(function(_0x137115){var _0xc417d0=[];for(var _0x3901a0 in _0x440405[_0x876f('0x5a')]){if(_0x440405[_0x876f('0x5a')][_0x876f('0x4b')](_0x3901a0)){var _0x238f69=_0x440405['whatsappQueues'][_0x3901a0];var _0x3ffd87={'id':_0x238f69['id'],'available':_0x238f69[_0x876f('0x51')],'loggedIn':_0x238f69[_0x876f('0x52')],'name':_0x238f69[_0x876f('0x57')],'paused':_0x238f69[_0x876f('0x53')],'waiting':_0x238f69[_0x876f('0x54')]};_0xc417d0[_0x876f('0x20')](_0x3ffd87);}}_0x137115({'count':_0xc417d0[_0x876f('0x22')],'rows':_0xc417d0});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x174618){var _0x3a0626=_['values'](_0x440405[_0x876f('0x5b')]);_0x174618({'count':_0x3a0626['length'],'rows':_0x3a0626});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x370104){var _0x383e8a=_[_0x876f('0x5c')](_0x440405[_0x876f('0x5d')]);_0x370104({'count':_0x383e8a[_0x876f('0x22')],'rows':_0x383e8a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x181f3f){var _0x446fcb=_[_0x876f('0x5c')](_0x440405[_0x876f('0x5e')]);_0x181f3f({'count':_0x446fcb[_0x876f('0x22')],'rows':_0x446fcb});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1e6314){var _0x571a82=_[_0x876f('0x5c')](_0x440405[_0x876f('0x5f')]);_0x1e6314({'count':_0x571a82[_0x876f('0x22')],'rows':_0x571a82});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x576fee){var _0x3cad2e=_[_0x876f('0x5c')](_0x440405[_0x876f('0x60')]);_0x576fee({'count':_0x3cad2e['length'],'rows':_0x3cad2e});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5bb956){var _0x456fb0=_[_0x876f('0x5c')](_0x440405[_0x876f('0x61')]);_0x5bb956({'count':_0x456fb0[_0x876f('0x22')],'rows':_0x456fb0});});}};var _0x3515ac=jayson['server'](_0x42911b)['http']();_0x3515ac['on'](_0x876f('0x36'),function(_0x14db25){logger['error'](JSON['stringify'](_0x14db25));return _0x3fc0b6(_0x14db25);});_0x3515ac['listen'](0x232c,_0x876f('0x62'),function(){console[_0x876f('0x63')](_0x876f('0x64'),0x232c);return _0x1e1c1a(_0x876f('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 1957547..04cd0fc 100644 --- a/server/services/routing/server/interval.js +++ b/server/services/routing/server/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2360=['Command','format','indexOf','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','util','bluebird','jayson/promise','lodash','routing','client','http','request','then','error','message','result','catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2360,0x106));var _0x0236=function(_0x304292,_0xcb4fb6){_0x304292=_0x304292-0x0;var _0x1b5918=_0x2360[_0x304292];return _0x1b5918;};'use strict';var util=require(_0x0236('0x0'));var BPromise=require(_0x0236('0x1'));var jayson=require(_0x0236('0x2'));var _=require(_0x0236('0x3'));var logger=require('../../../config/logger')(_0x0236('0x4'));var client=jayson[_0x0236('0x5')][_0x0236('0x6')]({'port':0x232a});function request(_0x1f8fd6,_0x17ad27){return new BPromise(function(_0x39dd81,_0x6baca7){return client[_0x0236('0x7')](_0x1f8fd6,_0x17ad27)[_0x0236('0x8')](function(_0x41a0a0){if(_0x41a0a0[_0x0236('0x9')]){return _0x6baca7(_0x41a0a0['error'][_0x0236('0xa')]);}else{return _0x39dd81(_0x41a0a0[_0x0236('0xb')]);}})[_0x0236('0xc')](function(_0x2cbdf9){return _0x6baca7(_0x2cbdf9);});});}exports[_0x0236('0xd')]=function(_0x251cc0,_0x9fb220,_0x4ebaf7){return function(_0x10afb6){if(_0x4ebaf7['rules']&&!_0x4ebaf7['rules'][_0x251cc0]){logger[_0x0236('0xe')](_0x0236('0xf'),_0x251cc0);return _0x10afb6[_0x0236('0x10')]();}var _0x5e967b=[];for(var _0x17e273=0x0;_0x17e273<_0x9fb220['length'];_0x17e273+=0x1){_0x5e967b[_0x0236('0x11')](request(_0x0236('0x12'),{'command':util[_0x0236('0x13')]('iftime\x20%s',_0x9fb220[_0x17e273])})[_0x0236('0x8')](function(_0x215d55){return _0x215d55&&_0x215d55[_0x0236('0xa')]&&_0x215d55[_0x0236('0xa')][_0x0236('0x14')]('true')>=0x0?!![]:![];})[_0x0236('0xc')](function(_0x3c877a){logger['error']('[%s][INTERVAL]\x20%s',_0x251cc0,_0x9fb220[_0x17e273]);}));}BPromise['all'](_0x5e967b)[_0x0236('0x8')](function(_0x5b28dd){var _0x252f5e=_[_0x0236('0x15')](_0x5b28dd);logger[_0x0236('0xe')](_0x0236('0x16'),_0x251cc0,_0x9fb220['join'](_0x0236('0x17')),_0x252f5e);_0x10afb6[_0x0236('0x18')](_0x252f5e);})['catch'](function(_0x27d91d){console[_0x0236('0x19')](_0x27d91d);logger['error'](_0x0236('0x16'),_0x251cc0,_0x9fb220[_0x0236('0x1a')]('\x20|\x20'),_0x27d91d[_0x0236('0x1b')]);_0x10afb6['stop']();});};}; \ No newline at end of file +var _0x9d3e=['message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x9d3e,0x15e));var _0xe9d3=function(_0x16856a,_0x41c46b){_0x16856a=_0x16856a-0x0;var _0x3b9791=_0x9d3e[_0x16856a];return _0x3b9791;};'use strict';var util=require(_0xe9d3('0x0'));var BPromise=require(_0xe9d3('0x1'));var jayson=require(_0xe9d3('0x2'));var _=require(_0xe9d3('0x3'));var logger=require(_0xe9d3('0x4'))('routing');var client=jayson[_0xe9d3('0x5')][_0xe9d3('0x6')]({'port':0x232a});function request(_0xbf2f88,_0x351f2f){return new BPromise(function(_0x759b7d,_0x50230a){return client[_0xe9d3('0x7')](_0xbf2f88,_0x351f2f)[_0xe9d3('0x8')](function(_0x2145fd){if(_0x2145fd[_0xe9d3('0x9')]){return _0x50230a(_0x2145fd[_0xe9d3('0x9')][_0xe9d3('0xa')]);}else{return _0x759b7d(_0x2145fd['result']);}})[_0xe9d3('0xb')](function(_0x24f03d){return _0x50230a(_0x24f03d);});});}exports[_0xe9d3('0xc')]=function(_0x48554d,_0x3c6cb0,_0x2f04d7){return function(_0x400c3e){if(_0x2f04d7[_0xe9d3('0xd')]&&!_0x2f04d7[_0xe9d3('0xd')][_0x48554d]){logger[_0xe9d3('0xe')](_0xe9d3('0xf'),_0x48554d);return _0x400c3e[_0xe9d3('0x10')]();}var _0x5c1cb1=[];for(var _0x3772aa=0x0;_0x3772aa<_0x3c6cb0['length'];_0x3772aa+=0x1){_0x5c1cb1[_0xe9d3('0x11')](request('Command',{'command':util[_0xe9d3('0x12')](_0xe9d3('0x13'),_0x3c6cb0[_0x3772aa])})[_0xe9d3('0x8')](function(_0xa81d17){return _0xa81d17&&_0xa81d17['message']&&_0xa81d17[_0xe9d3('0xa')]['indexOf'](_0xe9d3('0x14'))>=0x0?!![]:![];})[_0xe9d3('0xb')](function(_0x23d206){logger['error'](_0xe9d3('0x15'),_0x48554d,_0x3c6cb0[_0x3772aa]);}));}BPromise[_0xe9d3('0x16')](_0x5c1cb1)[_0xe9d3('0x8')](function(_0x3eb18){var _0x3f0d77=_[_0xe9d3('0x17')](_0x3eb18);logger[_0xe9d3('0xe')](_0xe9d3('0x18'),_0x48554d,_0x3c6cb0[_0xe9d3('0x19')](_0xe9d3('0x1a')),_0x3f0d77);_0x400c3e[_0xe9d3('0x1b')](_0x3f0d77);})[_0xe9d3('0xb')](function(_0x29a674){console[_0xe9d3('0x1c')](_0x29a674);logger[_0xe9d3('0x9')](_0xe9d3('0x18'),_0x48554d,_0x3c6cb0['join'](_0xe9d3('0x1a')),_0x29a674[_0xe9d3('0x1d')]);_0x400c3e[_0xe9d3('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index f73e50e..50a1fbc 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee5b=['type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','now','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','agentcomplete','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','agentconnectAt','complete','[%s][agents][agentcomplete]','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','diffTime','agent','[%s][agents][hangup]','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','membername','interface','calleridnum','connectedlinenum'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xee5b,0x1f4));var _0xbee5=function(_0x31466c,_0x276d58){_0x31466c=_0x31466c-0x0;var _0xf4fb73=_0xee5b[_0x31466c];return _0xf4fb73;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var utils=require(_0xbee5('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x203bba,_0x4f850a){utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x4'),_0x203bba[_0xbee5('0x5')],_0x203bba['channel'],_0x203bba['queue'],_0x203bba[_0xbee5('0x6')],_0x203bba[_0xbee5('0x7')],_0x203bba[_0xbee5('0x8')],_0x203bba[_0xbee5('0x9')],_0x203bba['lastevent']));if(_0x203bba['queue']){utils['getVoiceQueueByName'](_0x203bba['queue'])['then'](function(_0x20c66c){if(_0x20c66c){_0x203bba[_0xbee5('0xa')]=_0x20c66c[_0xbee5('0xa')];_0x203bba[_0xbee5('0xb')]=_0x203bba['agentcomplete']?_0x20c66c[_0xbee5('0xc')]:![];_0x203bba[_0xbee5('0xd')]=_0x203bba[_0xbee5('0xb')]?_0x20c66c[_0xbee5('0xe')]:0x0;}utils[_0xbee5('0xf')](_0xbee5('0x10'),_0x203bba);});}else{utils[_0xbee5('0xf')](_0xbee5('0x10'),_0x203bba);}if(_0x4f850a){delete transfers[_0x203bba[_0xbee5('0x5')]];}else{delete agents[_0x203bba['destuniqueid']];}}exports[_0xbee5('0x11')]=function(_0x532a78){try{utils[_0xbee5('0x12')](util[_0xbee5('0x3')](_0xbee5('0x13'),_0x532a78['uniqueid']),_0x532a78);agents[_0x532a78['destuniqueid']]=_0x532a78;agents[_0x532a78[_0xbee5('0x14')]]['agentcalledAt']=utils[_0xbee5('0x15')]();agents[_0x532a78['destuniqueid']][_0xbee5('0x16')]=_0xbee5('0x17');agents[_0x532a78[_0xbee5('0x14')]]['connectedlinenum']=null;agents[_0x532a78[_0xbee5('0x14')]][_0xbee5('0x18')]=null;utils['info'](util[_0xbee5('0x3')](_0xbee5('0x19'),_0x532a78[_0xbee5('0x5')],agents[_0x532a78[_0xbee5('0x14')]][_0xbee5('0x6')],_0x532a78[_0xbee5('0x14')]));}catch(_0x982404){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x13'),_0x532a78[_0xbee5('0x5')]),_0x982404);}};exports[_0xbee5('0x1b')]=function(_0x35d7d3){try{if(!_[_0xbee5('0x1c')](agents[_0x35d7d3[_0xbee5('0x14')]])){utils['debug'](util['format'](_0xbee5('0x1d'),_0x35d7d3['uniqueid']),_0x35d7d3);utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x1e'),_0x35d7d3[_0xbee5('0x5')],agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x6')],_0x35d7d3[_0xbee5('0x14')]));agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x1b')]=!![];agents[_0x35d7d3['destuniqueid']]['agentringnoanswerAt']=utils['now']();agents[_0x35d7d3['destuniqueid']]['lastevent']=_0xbee5('0x1f');agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x20')]=_0xbee5('0x1f');agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x21')]=_0x35d7d3[_0xbee5('0x22')]?parseInt(_0x35d7d3['ringtime'])/0x3e8:0x0;agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x23')]=0x0;unanswered[_0xbee5('0x24')](_0x35d7d3[_0xbee5('0x14')]);}}catch(_0x1a8bcc){utils['error'](util[_0xbee5('0x3')](_0xbee5('0x1d'),_0x35d7d3[_0xbee5('0x5')]),_0x1a8bcc);}};exports[_0xbee5('0x25')]=function(_0xa57f85){try{_[_0xbee5('0x26')](agents,function(_0x34b7df,_0x36e8bb){if(_0x34b7df[_0xbee5('0x5')]==_0xa57f85['uniqueid']&&!_[_0xbee5('0x27')](unanswered,_0x34b7df['destuniqueid'])){utils[_0xbee5('0x12')](util['format'](_0xbee5('0x28'),_0xa57f85['uniqueid']),_0xa57f85);utils[_0xbee5('0x2')](util['format'](_0xbee5('0x29'),_0xa57f85[_0xbee5('0x5')],_0x34b7df[_0xbee5('0x6')],_0x34b7df[_0xbee5('0x14')]));_0x34b7df['agentringnoanswer']=!![];_0x34b7df[_0xbee5('0x2a')]=utils[_0xbee5('0x15')]();_0x34b7df[_0xbee5('0x16')]=_0xbee5('0x2b');_0x34b7df['reason']=_0xbee5('0x2b');_0x34b7df[_0xbee5('0x21')]=_0xa57f85[_0xbee5('0x21')];_0x34b7df[_0xbee5('0x23')]=0x0;writeDB(_0x34b7df);}});}catch(_0x4c3428){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x28'),_0xa57f85[_0xbee5('0x5')]),_0x4c3428);}};exports['agentconnect']=function(_0x3c8a87){try{if(agents[_0x3c8a87['destuniqueid']]){utils[_0xbee5('0x12')](util['format']('[%s][agents][agentconnect]',_0x3c8a87['uniqueid']),_0x3c8a87);utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x2c'),_0x3c8a87[_0xbee5('0x5')],agents[_0x3c8a87[_0xbee5('0x14')]][_0xbee5('0x6')],_0x3c8a87[_0xbee5('0x14')]));agents[_0x3c8a87[_0xbee5('0x14')]]['agentconnectAt']=utils[_0xbee5('0x15')]();agents[_0x3c8a87['destuniqueid']][_0xbee5('0x9')]=_0x3c8a87[_0xbee5('0x9')];agents[_0x3c8a87[_0xbee5('0x14')]][_0xbee5('0x18')]=_0x3c8a87['connectedlinename'];agents[_0x3c8a87[_0xbee5('0x14')]]['holdtime']=_0x3c8a87['ringtime'];agents[_0x3c8a87[_0xbee5('0x14')]][_0xbee5('0x16')]=_0xbee5('0x2d');_[_0xbee5('0x26')](agents,function(_0x5a2b14,_0xf3dd5){if(_0x5a2b14[_0xbee5('0x14')]!=_0x3c8a87[_0xbee5('0x14')]&&_0x5a2b14[_0xbee5('0x5')]==_0x3c8a87[_0xbee5('0x5')]){_0x5a2b14[_0xbee5('0x23')]=0x0;_0x5a2b14[_0xbee5('0x21')]=_0x3c8a87[_0xbee5('0x22')];_0x5a2b14[_0xbee5('0x1b')]=!![];_0x5a2b14[_0xbee5('0x2a')]=utils['now']();_0x5a2b14[_0xbee5('0x16')]=_0xbee5('0x2e');_0x5a2b14['reason']=_0xbee5('0x2e');_0x5a2b14[_0xbee5('0x2f')]=_0x3c8a87[_0xbee5('0x14')];_0x5a2b14[_0xbee5('0x30')]=_0x3c8a87['membername'];writeDB(_0x5a2b14);}});}}catch(_0x4cfe54){utils['error'](util[_0xbee5('0x3')](_0xbee5('0x31'),_0x3c8a87[_0xbee5('0x5')]),_0x4cfe54);}};exports[_0xbee5('0x32')]=function(_0x4012fd){try{if(!_[_0xbee5('0x1c')](agents[_0x4012fd[_0xbee5('0x14')]])){utils[_0xbee5('0x12')](util[_0xbee5('0x3')]('[%s][agents][agentcomplete]',_0x4012fd['uniqueid']),_0x4012fd);utils[_0xbee5('0x2')](util['format'](_0xbee5('0x33'),_0x4012fd[_0xbee5('0x5')],agents[_0x4012fd['destuniqueid']][_0xbee5('0x6')],_0x4012fd[_0xbee5('0x14')]));agents[_0x4012fd['destuniqueid']]['agentcomplete']=!![];agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x34')]=utils['now']();agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x23')]=utils['diffTime'](agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x34')],agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x35')]);agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x20')]=_0x4012fd[_0xbee5('0x20')];agents[_0x4012fd['destuniqueid']][_0xbee5('0x16')]=_0xbee5('0x36');writeDB(agents[_0x4012fd[_0xbee5('0x14')]]);}}catch(_0x1d7388){utils['error'](util[_0xbee5('0x3')](_0xbee5('0x37'),_0x4012fd[_0xbee5('0x5')]),_0x1d7388);}};exports['blindtransfer']=function(_0x44d4b1){try{if(!_[_0xbee5('0x1c')](agents[_0x44d4b1['transfereruniqueid']])){utils['debug'](util['format'](_0xbee5('0x38'),_0x44d4b1['uniqueid']),_0x44d4b1);utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x39'),_0x44d4b1[_0xbee5('0x5')],agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x6')],agents[_0x44d4b1['transfereruniqueid']][_0xbee5('0x5')]));agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x3b')]=!![];agents[_0x44d4b1[_0xbee5('0x3a')]]['transfertype']=_0xbee5('0x3c');agents[_0x44d4b1['transfereruniqueid']][_0xbee5('0x3d')]=_0x44d4b1[_0xbee5('0x3e')];agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x3f')]=agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x5')];}}catch(_0xe8902){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x38'),_0x44d4b1[_0xbee5('0x5')]),_0xe8902);}};exports[_0xbee5('0x40')]=function(_0xeebac7){try{utils[_0xbee5('0x12')](util[_0xbee5('0x3')]('[%s][agents][attendedtransfer]',_0xeebac7[_0xbee5('0x41')]),_0xeebac7);if(_0xeebac7[_0xbee5('0x41')]==_0xeebac7[_0xbee5('0x42')]){if(!_['isNil'](agents[_0xeebac7[_0xbee5('0x43')]])){utils[_0xbee5('0x2')](util[_0xbee5('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0xeebac7[_0xbee5('0x41')],agents[_0xeebac7['secondtransfereruniqueid']][_0xbee5('0x6')]));agents[_0xeebac7['secondtransfereruniqueid']][_0xbee5('0x3b')]=!![];agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x44')]='ATTENDED';agents[_0xeebac7['secondtransfereruniqueid']]['transferexten']=_0xeebac7[_0xbee5('0x45')];agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x3f')]=_0xeebac7['origtransfereruniqueid'];}if(_0xeebac7[_0xbee5('0x46')]&&agents[_0xeebac7['transfereeuniqueid']]){agents[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x47')]=0x1;transfers[_0xeebac7[_0xbee5('0x46')]]=_['clone'](agents[_0xeebac7[_0xbee5('0x46')]]);transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x8')]=agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x8')];transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x48')]=agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x48')];transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x49')]=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x35')]=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x21')]=0x0;transfers[_0xeebac7['transfereeuniqueid']][_0xbee5('0x47')]=0x2;}}else if(_0xeebac7['secondtransfereruniqueid']==_0xeebac7['secondtransfererlinkedid']){if(!_[_0xbee5('0x1c')](agents[_0xeebac7[_0xbee5('0x41')]])){utils['info'](util['format'](_0xbee5('0x4a'),_0xeebac7['origtransfereruniqueid'],agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x6')]));agents[_0xeebac7['origtransfereruniqueid']][_0xbee5('0x3b')]=!![];agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x44')]=_0xbee5('0x4b');agents[_0xeebac7['origtransfereruniqueid']][_0xbee5('0x3d')]=_0xeebac7['secondtransfererexten'];agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x3f')]=_0xeebac7['secondtransfereruniqueid'];}if(_0xeebac7[_0xbee5('0x4c')]&&agents[_0xeebac7[_0xbee5('0x4c')]]){agents[_0xeebac7['transfertargetuniqueid']][_0xbee5('0x47')]=0x1;transfers[_0xeebac7[_0xbee5('0x4c')]]=_['clone'](agents[_0xeebac7[_0xbee5('0x4c')]]);transfers[_0xeebac7['transfertargetuniqueid']][_0xbee5('0x8')]=agents[_0xeebac7['origtransfereruniqueid']][_0xbee5('0x8')];transfers[_0xeebac7['transfertargetuniqueid']]['calleridname']=agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x48')];transfers[_0xeebac7[_0xbee5('0x4c')]][_0xbee5('0x49')]=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x4c')]]['agentconnectAt']=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x4c')]][_0xbee5('0x21')]=0x0;transfers[_0xeebac7[_0xbee5('0x4c')]][_0xbee5('0x47')]=0x2;}}}catch(_0xf77d34){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x4d'),_0xeebac7['origtransfereruniqueid']),_0xf77d34);}};exports[_0xbee5('0x4e')]=function(_0xe9796a){try{utils[_0xbee5('0x12')](util[_0xbee5('0x3')]('[%s][agents][hangup]',_0xe9796a[_0xbee5('0x5')]),_0xe9796a);if(agents[_0xe9796a[_0xbee5('0x5')]]&&agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x20')]===_0xbee5('0x1f')){if(_0xe9796a[_0xbee5('0x4f')]==='21'){agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x20')]=_0xbee5('0x50');agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x16')]=_0xbee5('0x50');}utils['info'](util[_0xbee5('0x3')](_0xbee5('0x51'),_0xe9796a['uniqueid'],agents[_0xe9796a[_0xbee5('0x5')]]['membername'],agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x20')],agents[_0xe9796a['uniqueid']][_0xbee5('0x16')]));writeDB(agents[_0xe9796a['uniqueid']]);var _0x4b7ebc=unanswered['indexOf'](_0xe9796a['uniqueid']);if(_0x4b7ebc>-0x1){unanswered['splice'](_0x4b7ebc,0x1);}}if(transfers[_0xe9796a['uniqueid']]){transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x32')]=!![];transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x34')]=utils[_0xbee5('0x15')]();transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x23')]=utils[_0xbee5('0x52')](transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x34')],transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x35')]);transfers[_0xe9796a['uniqueid']][_0xbee5('0x20')]=_0xbee5('0x53');transfers[_0xe9796a['uniqueid']]['lastevent']=_0xbee5('0x36');utils[_0xbee5('0x2')](util[_0xbee5('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xe9796a[_0xbee5('0x5')],transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x6')],transfers[_0xe9796a['uniqueid']]['reason'],transfers[_0xe9796a['uniqueid']][_0xbee5('0x16')]));writeDB(transfers[_0xe9796a[_0xbee5('0x5')]],!![]);}if(agents[_0xe9796a[_0xbee5('0x5')]]&&agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x35')]){agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x32')]=!![];agents[_0xe9796a[_0xbee5('0x5')]]['agentcompleteAt']=utils['now']();agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x23')]=utils['diffTime'](agents[_0xe9796a['uniqueid']][_0xbee5('0x34')],agents[_0xe9796a['uniqueid']]['agentconnectAt']);agents[_0xe9796a[_0xbee5('0x5')]]['reason']=agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x3b')]?'transfer':_0xbee5('0x53');agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x16')]=_0xbee5('0x36');utils[_0xbee5('0x2')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xe9796a[_0xbee5('0x5')],agents[_0xe9796a['uniqueid']][_0xbee5('0x6')],agents[_0xe9796a['uniqueid']][_0xbee5('0x20')],agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x16')]));writeDB(agents[_0xe9796a[_0xbee5('0x5')]]);}}catch(_0x182207){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x54'),_0xe9796a[_0xbee5('0x5')]),_0x182207);}}; \ No newline at end of file +var _0xe1e3=['agentcompleteAt','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transferexten','transfereeuniqueid','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transferuniqueid','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','complete','lodash','util','format','uniqueid','channel','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','then','agentcomplete','acwtime','agentacw','acwTimeout','CreateVoiceAgentReport','[%s][agents][agentcalled]','destuniqueid','now','called','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','debug','agentringnoanswer','agentringnoanswerAt','timeout','talktime','error','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinenum','connectedlinename','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime'];(function(_0x22d369,_0x2ce92b){var _0x247bd2=function(_0x29f7af){while(--_0x29f7af){_0x22d369['push'](_0x22d369['shift']());}};_0x247bd2(++_0x2ce92b);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x3db54a,_0x4bac11){_0x3db54a=_0x3db54a-0x0;var _0x1c0134=_0xe1e3[_0x3db54a];return _0x1c0134;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0xdbdabb,_0x5e9f9a){utils['info'](util[_0x3e1e('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0xdbdabb[_0x3e1e('0x3')],_0xdbdabb[_0x3e1e('0x4')],_0xdbdabb[_0x3e1e('0x5')],_0xdbdabb[_0x3e1e('0x6')],_0xdbdabb[_0x3e1e('0x7')],_0xdbdabb[_0x3e1e('0x8')],_0xdbdabb['connectedlinenum'],_0xdbdabb[_0x3e1e('0x9')]));if(_0xdbdabb[_0x3e1e('0x5')]){utils[_0x3e1e('0xa')](_0xdbdabb[_0x3e1e('0x5')])[_0x3e1e('0xb')](function(_0x1e5173){if(_0x1e5173){_0xdbdabb['type']=_0x1e5173['type'];_0xdbdabb['agentacw']=_0xdbdabb[_0x3e1e('0xc')]?_0x1e5173['acw']:![];_0xdbdabb[_0x3e1e('0xd')]=_0xdbdabb[_0x3e1e('0xe')]?_0x1e5173[_0x3e1e('0xf')]:0x0;}utils['request'](_0x3e1e('0x10'),_0xdbdabb);});}else{utils['request']('CreateVoiceAgentReport',_0xdbdabb);}if(_0x5e9f9a){delete transfers[_0xdbdabb['uniqueid']];}else{delete agents[_0xdbdabb['destuniqueid']];}}exports['agentcalled']=function(_0x14ad58){try{utils['debug'](util['format'](_0x3e1e('0x11'),_0x14ad58[_0x3e1e('0x3')]),_0x14ad58);agents[_0x14ad58[_0x3e1e('0x12')]]=_0x14ad58;agents[_0x14ad58['destuniqueid']]['agentcalledAt']=utils[_0x3e1e('0x13')]();agents[_0x14ad58[_0x3e1e('0x12')]]['lastevent']=_0x3e1e('0x14');agents[_0x14ad58[_0x3e1e('0x12')]]['connectedlinenum']=null;agents[_0x14ad58[_0x3e1e('0x12')]]['connectedlinename']=null;utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')](_0x3e1e('0x16'),_0x14ad58[_0x3e1e('0x3')],agents[_0x14ad58[_0x3e1e('0x12')]][_0x3e1e('0x6')],_0x14ad58['destuniqueid']));}catch(_0x5dccb8){utils['error'](util[_0x3e1e('0x2')](_0x3e1e('0x11'),_0x14ad58[_0x3e1e('0x3')]),_0x5dccb8);}};exports['agentringnoanswer']=function(_0x1c5acd){try{if(!_['isNil'](agents[_0x1c5acd[_0x3e1e('0x12')]])){utils[_0x3e1e('0x17')](util[_0x3e1e('0x2')]('[%s][agents][agentringnoanswer]',_0x1c5acd[_0x3e1e('0x3')]),_0x1c5acd);utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x1c5acd['uniqueid'],agents[_0x1c5acd[_0x3e1e('0x12')]][_0x3e1e('0x6')],_0x1c5acd['destuniqueid']));agents[_0x1c5acd[_0x3e1e('0x12')]][_0x3e1e('0x18')]=!![];agents[_0x1c5acd[_0x3e1e('0x12')]][_0x3e1e('0x19')]=utils[_0x3e1e('0x13')]();agents[_0x1c5acd[_0x3e1e('0x12')]][_0x3e1e('0x9')]=_0x3e1e('0x1a');agents[_0x1c5acd['destuniqueid']]['reason']=_0x3e1e('0x1a');agents[_0x1c5acd[_0x3e1e('0x12')]]['holdtime']=_0x1c5acd['ringtime']?parseInt(_0x1c5acd['ringtime'])/0x3e8:0x0;agents[_0x1c5acd[_0x3e1e('0x12')]][_0x3e1e('0x1b')]=0x0;unanswered['push'](_0x1c5acd[_0x3e1e('0x12')]);}}catch(_0x5ac814){utils[_0x3e1e('0x1c')](util[_0x3e1e('0x2')]('[%s][agents][agentringnoanswer]',_0x1c5acd[_0x3e1e('0x3')]),_0x5ac814);}};exports[_0x3e1e('0x1d')]=function(_0x45ed0e){try{_['forIn'](agents,function(_0xdef39,_0x4ec149){if(_0xdef39['uniqueid']==_0x45ed0e['uniqueid']&&!_[_0x3e1e('0x1e')](unanswered,_0xdef39['destuniqueid'])){utils['debug'](util[_0x3e1e('0x2')](_0x3e1e('0x1f'),_0x45ed0e[_0x3e1e('0x3')]),_0x45ed0e);utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x45ed0e['uniqueid'],_0xdef39['membername'],_0xdef39['destuniqueid']));_0xdef39[_0x3e1e('0x18')]=!![];_0xdef39[_0x3e1e('0x19')]=utils[_0x3e1e('0x13')]();_0xdef39[_0x3e1e('0x9')]=_0x3e1e('0x20');_0xdef39[_0x3e1e('0x21')]=_0x3e1e('0x20');_0xdef39[_0x3e1e('0x22')]=_0x45ed0e['holdtime'];_0xdef39[_0x3e1e('0x1b')]=0x0;writeDB(_0xdef39);}});}catch(_0x348ef5){utils['error'](util[_0x3e1e('0x2')](_0x3e1e('0x1f'),_0x45ed0e[_0x3e1e('0x3')]),_0x348ef5);}};exports[_0x3e1e('0x23')]=function(_0x55a082){try{if(agents[_0x55a082['destuniqueid']]){utils[_0x3e1e('0x17')](util[_0x3e1e('0x2')]('[%s][agents][agentconnect]',_0x55a082[_0x3e1e('0x3')]),_0x55a082);utils[_0x3e1e('0x15')](util['format'](_0x3e1e('0x24'),_0x55a082[_0x3e1e('0x3')],agents[_0x55a082[_0x3e1e('0x12')]][_0x3e1e('0x6')],_0x55a082[_0x3e1e('0x12')]));agents[_0x55a082['destuniqueid']][_0x3e1e('0x25')]=utils[_0x3e1e('0x13')]();agents[_0x55a082[_0x3e1e('0x12')]][_0x3e1e('0x26')]=_0x55a082['connectedlinenum'];agents[_0x55a082[_0x3e1e('0x12')]][_0x3e1e('0x27')]=_0x55a082[_0x3e1e('0x27')];agents[_0x55a082[_0x3e1e('0x12')]][_0x3e1e('0x22')]=_0x55a082[_0x3e1e('0x28')];agents[_0x55a082[_0x3e1e('0x12')]]['lastevent']=_0x3e1e('0x29');_['forIn'](agents,function(_0x53bdf5,_0x4f598e){if(_0x53bdf5[_0x3e1e('0x12')]!=_0x55a082[_0x3e1e('0x12')]&&_0x53bdf5['uniqueid']==_0x55a082[_0x3e1e('0x3')]){_0x53bdf5[_0x3e1e('0x1b')]=0x0;_0x53bdf5['holdtime']=_0x55a082[_0x3e1e('0x28')];_0x53bdf5[_0x3e1e('0x18')]=!![];_0x53bdf5['agentringnoanswerAt']=utils['now']();_0x53bdf5[_0x3e1e('0x9')]='answered_elsewhere';_0x53bdf5['reason']=_0x3e1e('0x2a');_0x53bdf5[_0x3e1e('0x2b')]=_0x55a082[_0x3e1e('0x12')];_0x53bdf5[_0x3e1e('0x2c')]=_0x55a082[_0x3e1e('0x6')];writeDB(_0x53bdf5);}});}}catch(_0x55ea1d){utils['error'](util[_0x3e1e('0x2')](_0x3e1e('0x2d'),_0x55a082[_0x3e1e('0x3')]),_0x55ea1d);}};exports['agentcomplete']=function(_0x1124d0){try{if(!_[_0x3e1e('0x2e')](agents[_0x1124d0[_0x3e1e('0x12')]])){utils['debug'](util[_0x3e1e('0x2')]('[%s][agents][agentcomplete]',_0x1124d0['uniqueid']),_0x1124d0);utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')](_0x3e1e('0x2f'),_0x1124d0[_0x3e1e('0x3')],agents[_0x1124d0['destuniqueid']]['membername'],_0x1124d0['destuniqueid']));agents[_0x1124d0['destuniqueid']][_0x3e1e('0xc')]=!![];agents[_0x1124d0[_0x3e1e('0x12')]]['agentcompleteAt']=utils['now']();agents[_0x1124d0[_0x3e1e('0x12')]][_0x3e1e('0x1b')]=utils[_0x3e1e('0x30')](agents[_0x1124d0['destuniqueid']][_0x3e1e('0x31')],agents[_0x1124d0['destuniqueid']][_0x3e1e('0x25')]);agents[_0x1124d0[_0x3e1e('0x12')]][_0x3e1e('0x21')]=_0x1124d0[_0x3e1e('0x21')];agents[_0x1124d0[_0x3e1e('0x12')]][_0x3e1e('0x9')]='complete';writeDB(agents[_0x1124d0[_0x3e1e('0x12')]]);}}catch(_0x1ce1cd){utils['error'](util[_0x3e1e('0x2')](_0x3e1e('0x32'),_0x1124d0['uniqueid']),_0x1ce1cd);}};exports[_0x3e1e('0x33')]=function(_0x347b3f){try{if(!_[_0x3e1e('0x2e')](agents[_0x347b3f[_0x3e1e('0x34')]])){utils['debug'](util[_0x3e1e('0x2')](_0x3e1e('0x35'),_0x347b3f[_0x3e1e('0x3')]),_0x347b3f);utils[_0x3e1e('0x15')](util['format'](_0x3e1e('0x36'),_0x347b3f[_0x3e1e('0x3')],agents[_0x347b3f[_0x3e1e('0x34')]][_0x3e1e('0x6')],agents[_0x347b3f[_0x3e1e('0x34')]][_0x3e1e('0x3')]));agents[_0x347b3f[_0x3e1e('0x34')]][_0x3e1e('0x37')]=!![];agents[_0x347b3f['transfereruniqueid']][_0x3e1e('0x38')]='blind';agents[_0x347b3f['transfereruniqueid']]['transferexten']=_0x347b3f[_0x3e1e('0x39')];agents[_0x347b3f[_0x3e1e('0x34')]]['transferuniqueid']=agents[_0x347b3f[_0x3e1e('0x34')]]['uniqueid'];}}catch(_0x5b2416){utils[_0x3e1e('0x1c')](util['format']('[%s][agents][blindtransfer]',_0x347b3f['uniqueid']),_0x5b2416);}};exports[_0x3e1e('0x3a')]=function(_0xe577b2){try{utils[_0x3e1e('0x17')](util[_0x3e1e('0x2')](_0x3e1e('0x3b'),_0xe577b2[_0x3e1e('0x3c')]),_0xe577b2);if(_0xe577b2[_0x3e1e('0x3c')]==_0xe577b2['origtransfererlinkedid']){if(!_[_0x3e1e('0x2e')](agents[_0xe577b2['secondtransfereruniqueid']])){utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')](_0x3e1e('0x3d'),_0xe577b2['origtransfereruniqueid'],agents[_0xe577b2['secondtransfereruniqueid']][_0x3e1e('0x6')]));agents[_0xe577b2[_0x3e1e('0x3e')]]['transfer']=!![];agents[_0xe577b2[_0x3e1e('0x3e')]]['transfertype']='ATTENDED';agents[_0xe577b2[_0x3e1e('0x3e')]][_0x3e1e('0x3f')]=_0xe577b2['origtransfererexten'];agents[_0xe577b2[_0x3e1e('0x3e')]]['transferuniqueid']=_0xe577b2['origtransfereruniqueid'];}if(_0xe577b2[_0x3e1e('0x40')]&&agents[_0xe577b2['transfereeuniqueid']]){agents[_0xe577b2[_0x3e1e('0x40')]]['agententerreason']=0x1;transfers[_0xe577b2[_0x3e1e('0x40')]]=_['clone'](agents[_0xe577b2[_0x3e1e('0x40')]]);transfers[_0xe577b2[_0x3e1e('0x40')]]['calleridnum']=agents[_0xe577b2['secondtransfereruniqueid']]['calleridnum'];transfers[_0xe577b2[_0x3e1e('0x40')]][_0x3e1e('0x41')]=agents[_0xe577b2[_0x3e1e('0x3e')]]['calleridname'];transfers[_0xe577b2[_0x3e1e('0x40')]][_0x3e1e('0x42')]=utils[_0x3e1e('0x13')]();transfers[_0xe577b2['transfereeuniqueid']]['agentconnectAt']=utils[_0x3e1e('0x13')]();transfers[_0xe577b2['transfereeuniqueid']][_0x3e1e('0x22')]=0x0;transfers[_0xe577b2[_0x3e1e('0x40')]][_0x3e1e('0x43')]=0x2;}}else if(_0xe577b2['secondtransfereruniqueid']==_0xe577b2[_0x3e1e('0x44')]){if(!_['isNil'](agents[_0xe577b2[_0x3e1e('0x3c')]])){utils[_0x3e1e('0x15')](util['format'](_0x3e1e('0x3d'),_0xe577b2['origtransfereruniqueid'],agents[_0xe577b2[_0x3e1e('0x3c')]]['membername']));agents[_0xe577b2[_0x3e1e('0x3c')]]['transfer']=!![];agents[_0xe577b2[_0x3e1e('0x3c')]][_0x3e1e('0x38')]=_0x3e1e('0x45');agents[_0xe577b2['origtransfereruniqueid']][_0x3e1e('0x3f')]=_0xe577b2[_0x3e1e('0x46')];agents[_0xe577b2['origtransfereruniqueid']][_0x3e1e('0x47')]=_0xe577b2['secondtransfereruniqueid'];}if(_0xe577b2['transfertargetuniqueid']&&agents[_0xe577b2['transfertargetuniqueid']]){agents[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x43')]=0x1;transfers[_0xe577b2[_0x3e1e('0x48')]]=_[_0x3e1e('0x49')](agents[_0xe577b2[_0x3e1e('0x48')]]);transfers[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x8')]=agents[_0xe577b2['origtransfereruniqueid']][_0x3e1e('0x8')];transfers[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x41')]=agents[_0xe577b2[_0x3e1e('0x3c')]][_0x3e1e('0x41')];transfers[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x42')]=utils[_0x3e1e('0x13')]();transfers[_0xe577b2['transfertargetuniqueid']]['agentconnectAt']=utils[_0x3e1e('0x13')]();transfers[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x22')]=0x0;transfers[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x43')]=0x2;}}}catch(_0x2e950d){utils[_0x3e1e('0x1c')](util[_0x3e1e('0x2')](_0x3e1e('0x3b'),_0xe577b2[_0x3e1e('0x3c')]),_0x2e950d);}};exports[_0x3e1e('0x4a')]=function(_0x50ba57){try{utils['debug'](util['format'](_0x3e1e('0x4b'),_0x50ba57[_0x3e1e('0x3')]),_0x50ba57);if(agents[_0x50ba57[_0x3e1e('0x3')]]&&agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x21')]==='timeout'){if(_0x50ba57[_0x3e1e('0x4c')]==='21'){agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x21')]=_0x3e1e('0x4d');agents[_0x50ba57[_0x3e1e('0x3')]]['lastevent']=_0x3e1e('0x4d');}utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')](_0x3e1e('0x4e'),_0x50ba57[_0x3e1e('0x3')],agents[_0x50ba57[_0x3e1e('0x3')]]['membername'],agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x21')],agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x9')]));writeDB(agents[_0x50ba57[_0x3e1e('0x3')]]);var _0x372581=unanswered['indexOf'](_0x50ba57[_0x3e1e('0x3')]);if(_0x372581>-0x1){unanswered[_0x3e1e('0x4f')](_0x372581,0x1);}}if(transfers[_0x50ba57[_0x3e1e('0x3')]]){transfers[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0xc')]=!![];transfers[_0x50ba57[_0x3e1e('0x3')]]['agentcompleteAt']=utils[_0x3e1e('0x13')]();transfers[_0x50ba57['uniqueid']][_0x3e1e('0x1b')]=utils[_0x3e1e('0x30')](transfers[_0x50ba57['uniqueid']][_0x3e1e('0x31')],transfers[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x25')]);transfers[_0x50ba57[_0x3e1e('0x3')]]['reason']=_0x3e1e('0x50');transfers[_0x50ba57['uniqueid']][_0x3e1e('0x9')]=_0x3e1e('0x51');utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')](_0x3e1e('0x4e'),_0x50ba57[_0x3e1e('0x3')],transfers[_0x50ba57['uniqueid']][_0x3e1e('0x6')],transfers[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x21')],transfers[_0x50ba57[_0x3e1e('0x3')]]['lastevent']));writeDB(transfers[_0x50ba57[_0x3e1e('0x3')]],!![]);}if(agents[_0x50ba57[_0x3e1e('0x3')]]&&agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x25')]){agents[_0x50ba57['uniqueid']][_0x3e1e('0xc')]=!![];agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x31')]=utils[_0x3e1e('0x13')]();agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x1b')]=utils['diffTime'](agents[_0x50ba57['uniqueid']]['agentcompleteAt'],agents[_0x50ba57[_0x3e1e('0x3')]]['agentconnectAt']);agents[_0x50ba57[_0x3e1e('0x3')]]['reason']=agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x37')]?_0x3e1e('0x37'):_0x3e1e('0x50');agents[_0x50ba57['uniqueid']][_0x3e1e('0x9')]='complete';utils[_0x3e1e('0x15')](util['format'](_0x3e1e('0x4e'),_0x50ba57[_0x3e1e('0x3')],agents[_0x50ba57['uniqueid']][_0x3e1e('0x6')],agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x21')],agents[_0x50ba57['uniqueid']]['lastevent']));writeDB(agents[_0x50ba57[_0x3e1e('0x3')]]);}}catch(_0x20bb6d){utils[_0x3e1e('0x1c')](util['format'](_0x3e1e('0x4b'),_0x50ba57['uniqueid']),_0x20bb6d);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 7627573..cec9c54 100644 --- a/server/services/xdr/calls.controller.js +++ b/server/services/xdr/calls.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ab2=['exten','now','DOCUMENTATION','error','newstate','debug','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','disposition','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','mohtime','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','split','substring','includes','execif','set','lastapplication','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','uniqueid','transfereeuniqueid','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','blinds','recording','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','format','context'];(function(_0x436017,_0x47c412){var _0x50ed01=function(_0x1dd020){while(--_0x1dd020){_0x436017['push'](_0x436017['shift']());}};_0x50ed01(++_0x47c412);}(_0x9ab2,0x192));var _0x29ab=function(_0x44e598,_0x3bf3a5){_0x44e598=_0x44e598-0x0;var _0x55ea69=_0x9ab2[_0x44e598];return _0x55ea69;};'use strict';var _=require(_0x29ab('0x0'));var util=require(_0x29ab('0x1'));var utils=require('./utils');var transfers=require(_0x29ab('0x2'));var dispositions=[_0x29ab('0x3'),_0x29ab('0x4'),_0x29ab('0x4'),_0x29ab('0x3'),_0x29ab('0x3'),'NO\x20ANSWER','ANSWERED',_0x29ab('0x5'),_0x29ab('0x4'),'FAILED','FAILED'];var channels={};function writeDB(_0x23b804){var _0xedb791;if(transfers['blinds'][_0x23b804[_0x29ab('0x6')]]){_0xedb791=_0x23b804['uniqueid'];_0x23b804['uniqueid']=transfers['blinds'][_0x23b804[_0x29ab('0x6')]][_0x29ab('0x7')];}utils['info'](util['format'](_0x29ab('0x8'),_0x23b804[_0x29ab('0x6')],_0x23b804[_0x29ab('0x9')],_0x23b804[_0x29ab('0xa')],_0x23b804[_0x29ab('0xb')],_0x23b804[_0x29ab('0xc')],_0x23b804[_0x29ab('0xd')],_0x23b804['connectedlinenum'],_0x23b804[_0x29ab('0xe')]));if(_0x23b804['accountcode']){utils[_0x29ab('0xf')](_0x23b804[_0x29ab('0x10')])[_0x29ab('0x11')](function(_0x9cddf8){if(_0x9cddf8){_0x23b804[_0x29ab('0x12')]=_0x9cddf8['id'];}utils[_0x29ab('0x13')](_0x29ab('0x14'),_0x23b804);});}else{utils[_0x29ab('0x13')](_0x29ab('0x14'),_0x23b804);}if(channels[_0x23b804[_0x29ab('0x6')]]){delete channels[_0x23b804[_0x29ab('0x6')]];}else if(_0xedb791&&channels[_0xedb791]){if(!transfers[_0x29ab('0x15')][_0xedb791][_0x29ab('0x16')])delete transfers['blinds'][_0xedb791];delete channels[_0xedb791];}}exports[_0x29ab('0x17')]=function(_0xfab02c){try{utils['debug'](util['format'](_0x29ab('0x18'),_0xfab02c[_0x29ab('0x6')]),_0xfab02c);if(_0xfab02c[_0x29ab('0x6')]==_0xfab02c[_0x29ab('0x19')]&&_0xfab02c[_0x29ab('0x9')]!=_0x29ab('0x1a')){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0xfab02c[_0x29ab('0x6')],_0xfab02c[_0x29ab('0x1d')],_0xfab02c['exten']));channels[_0xfab02c[_0x29ab('0x6')]]={'uniqueid':_0xfab02c[_0x29ab('0x6')],'accountcode':_0xfab02c[_0x29ab('0x10')],'source':_0xfab02c[_0x29ab('0xd')],'destination':_0xfab02c[_0x29ab('0x1e')],'destinationcontext':_0xfab02c[_0x29ab('0x1d')],'channel':_0xfab02c[_0x29ab('0x9')],'starttime':utils[_0x29ab('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x29ab('0x20')};}}catch(_0x5a99a0){utils[_0x29ab('0x21')](util[_0x29ab('0x1c')](_0x29ab('0x18'),_0xfab02c[_0x29ab('0x6')]),_0x5a99a0);}};exports[_0x29ab('0x22')]=function(_0x8c650b){try{utils[_0x29ab('0x23')](util[_0x29ab('0x1c')](_0x29ab('0x24'),_0x8c650b[_0x29ab('0x6')]),_0x8c650b);if(!_[_0x29ab('0x25')](channels[_0x8c650b[_0x29ab('0x6')]])&&_0x8c650b[_0x29ab('0x26')]==0x6){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x8c650b[_0x29ab('0x6')],_0x8c650b[_0x29ab('0x1d')],_0x8c650b['channel']));if(_['isNil'](channels[_0x8c650b[_0x29ab('0x6')]]['systemanswertime'])){channels[_0x8c650b[_0x29ab('0x6')]][_0x29ab('0x27')]=utils[_0x29ab('0x1f')]();}}else if(!_[_0x29ab('0x25')](channels[_0x8c650b[_0x29ab('0x19')]])&&_0x8c650b['channelstate']==0x6&&_0x8c650b['context']!=_0x29ab('0x28')){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x8c650b[_0x29ab('0x6')],_0x8c650b['linkedid'],_0x8c650b[_0x29ab('0x1d')],_0x8c650b['channel']));channels[_0x8c650b[_0x29ab('0x19')]][_0x29ab('0x10')]=_0x8c650b[_0x29ab('0x10')];channels[_0x8c650b[_0x29ab('0x19')]][_0x29ab('0x29')]=_0x8c650b['channel'];if(_[_0x29ab('0x25')](channels[_0x8c650b[_0x29ab('0x19')]][_0x29ab('0x2a')])){channels[_0x8c650b[_0x29ab('0x19')]][_0x29ab('0x2a')]=utils['now']();}channels[_0x8c650b[_0x29ab('0x19')]][_0x29ab('0x2b')]=dispositions[_['toNumber'](_0x8c650b[_0x29ab('0x26')])]||_0x29ab('0x2c');}}catch(_0x58cf0e){utils[_0x29ab('0x21')](util[_0x29ab('0x1c')](_0x29ab('0x24'),_0x8c650b['uniqueid']),_0x58cf0e);}};exports[_0x29ab('0x2d')]=function(_0x3798c0){try{if(!_[_0x29ab('0x25')](channels[_0x3798c0[_0x29ab('0x6')]])){utils['debug'](util[_0x29ab('0x1c')](_0x29ab('0x2e'),_0x3798c0[_0x29ab('0x6')]),_0x3798c0);if(_[_0x29ab('0x25')](channels[_0x3798c0[_0x29ab('0x6')]][_0x29ab('0x2f')])){channels[_0x3798c0[_0x29ab('0x6')]][_0x29ab('0x2f')]=_0x3798c0[_0x29ab('0x30')]+'\x20<'+_0x3798c0[_0x29ab('0xd')]+'>';}utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x3798c0[_0x29ab('0x6')],channels[_0x3798c0[_0x29ab('0x6')]]['callerid'],_0x3798c0[_0x29ab('0x31')]));channels[_0x3798c0[_0x29ab('0x6')]][_0x29ab('0x32')]=utils[_0x29ab('0x1f')]();channels[_0x3798c0[_0x29ab('0x6')]][_0x29ab('0x33')]=utils[_0x29ab('0x34')](channels[_0x3798c0['uniqueid']]['endtime'],channels[_0x3798c0[_0x29ab('0x6')]][_0x29ab('0x35')]);channels[_0x3798c0['uniqueid']][_0x29ab('0x36')]=channels[_0x3798c0[_0x29ab('0x6')]]['answertime']?utils[_0x29ab('0x34')](channels[_0x3798c0[_0x29ab('0x6')]][_0x29ab('0x32')],channels[_0x3798c0[_0x29ab('0x6')]][_0x29ab('0x2a')]):0x0;writeDB(channels[_0x3798c0[_0x29ab('0x6')]]);}}catch(_0x1c3e00){utils[_0x29ab('0x21')](util['format']('[%s][calls][hangup]',_0x3798c0[_0x29ab('0x6')]),_0x1c3e00);}};exports['attendedtransfer']=function(_0x2cce66){try{if(!_[_0x29ab('0x25')](channels[_0x2cce66[_0x29ab('0x37')]])){utils[_0x29ab('0x23')](util[_0x29ab('0x1c')](_0x29ab('0x38'),_0x2cce66[_0x29ab('0x39')]),_0x2cce66);if(channels[_0x2cce66[_0x29ab('0x37')]][_0x29ab('0x9')]==_0x2cce66[_0x29ab('0x3a')]){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')](_0x29ab('0x3b'),_0x2cce66[_0x29ab('0x39')],_0x2cce66[_0x29ab('0x37')],_0x2cce66[_0x29ab('0x3c')]));channels[_0x2cce66[_0x29ab('0x37')]][_0x29ab('0x29')]=_0x2cce66[_0x29ab('0x3c')];channels[_0x2cce66[_0x29ab('0x37')]][_0x29ab('0x3d')]=_0x29ab('0x3e');}else if(channels[_0x2cce66[_0x29ab('0x37')]][_0x29ab('0x9')]=_0x2cce66[_0x29ab('0x3f')]){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')](_0x29ab('0x3b'),_0x2cce66[_0x29ab('0x39')],_0x2cce66[_0x29ab('0x37')],_0x2cce66[_0x29ab('0x40')]));channels[_0x2cce66[_0x29ab('0x37')]][_0x29ab('0x29')]=_0x2cce66[_0x29ab('0x40')];channels[_0x2cce66[_0x29ab('0x37')]]['userfield']=_0x29ab('0x3e');}}}catch(_0x49f944){utils['error'](util[_0x29ab('0x1c')](_0x29ab('0x38'),_0x2cce66['origtransfereruniqueid']),_0x49f944);}};exports[_0x29ab('0x41')]=function(_0x565a6d){try{if(!_['isNil'](channels[_0x565a6d[_0x29ab('0x6')]])){utils[_0x29ab('0x23')](util['format'](_0x29ab('0x42'),_0x565a6d['uniqueid']),_0x565a6d);channels[_0x565a6d[_0x29ab('0x6')]]['musiconholdstartAt']=utils[_0x29ab('0x1f')]();utils[_0x29ab('0x1b')](util['format'](_0x29ab('0x43'),_0x565a6d['uniqueid'],channels[_0x565a6d[_0x29ab('0x6')]][_0x29ab('0x44')]));}}catch(_0x1823d4){utils['error'](util[_0x29ab('0x1c')](_0x29ab('0x42'),_0x565a6d[_0x29ab('0x6')]),_0x1823d4);}};exports[_0x29ab('0x45')]=function(_0x4a9e10){try{if(!_['isNil'](channels[_0x4a9e10[_0x29ab('0x6')]])){utils[_0x29ab('0x23')](util['format']('[%s][calls][musiconholdstop]',_0x4a9e10['uniqueid']),_0x4a9e10);if(!_[_0x29ab('0x25')](channels[_0x4a9e10[_0x29ab('0x6')]]['musiconholdstartAt'])){channels[_0x4a9e10[_0x29ab('0x6')]][_0x29ab('0x46')]+=utils['diffTime'](utils[_0x29ab('0x1f')](),channels[_0x4a9e10[_0x29ab('0x6')]][_0x29ab('0x44')]);utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x4a9e10[_0x29ab('0x6')],channels[_0x4a9e10[_0x29ab('0x6')]][_0x29ab('0x46')]));delete channels[_0x4a9e10[_0x29ab('0x6')]][_0x29ab('0x44')];}}}catch(_0x5e35a2){utils['error'](util[_0x29ab('0x1c')]('[%s][calls][musiconholdstop]',_0x4a9e10['uniqueid']),_0x5e35a2);}};exports['varset']=function(_0x17e3d5){try{if(!_[_0x29ab('0x25')](channels[_0x17e3d5['uniqueid']])){utils[_0x29ab('0x23')](util[_0x29ab('0x1c')](_0x29ab('0x47'),_0x17e3d5[_0x29ab('0x6')]),_0x17e3d5);if(!_['isNil'](_0x17e3d5['variable'][_0x29ab('0x48')])){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')](_0x29ab('0x49'),_0x17e3d5['uniqueid'],_0x17e3d5[_0x29ab('0x4a')]));channels[_0x17e3d5['uniqueid']]['source']=_0x17e3d5[_0x29ab('0x4a')];}if(!_['isNil'](_0x17e3d5[_0x29ab('0x4b')][_0x29ab('0x4c')])){utils['info'](util[_0x29ab('0x1c')](_0x29ab('0x4d'),_0x17e3d5[_0x29ab('0x6')],_0x17e3d5[_0x29ab('0x4a')]));channels[_0x17e3d5[_0x29ab('0x6')]][_0x29ab('0x4e')]=_0x17e3d5[_0x29ab('0x4a')];channels[_0x17e3d5['uniqueid']][_0x29ab('0x2f')]='\x22'+_0x17e3d5['value']+_0x29ab('0x4f')+_0x17e3d5[_0x29ab('0x4a')]+'>';}if(!_[_0x29ab('0x25')](_0x17e3d5['variable'][_0x29ab('0x50')])||!_[_0x29ab('0x25')](_0x17e3d5['variable'][_0x29ab('0x51')])){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')](_0x29ab('0x52'),_0x17e3d5[_0x29ab('0x6')],!_[_0x29ab('0x25')](_0x17e3d5[_0x29ab('0x4b')][_0x29ab('0x50')])?_0x29ab('0x50'):_0x29ab('0x51'),_0x17e3d5['value']));channels[_0x17e3d5[_0x29ab('0x6')]]['callerid']=_0x17e3d5[_0x29ab('0x4a')];}if(!_[_0x29ab('0x25')](_0x17e3d5[_0x29ab('0x4b')]['xmd-queue'])||!_[_0x29ab('0x25')](_0x17e3d5['variable'][_0x29ab('0x53')])){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')](_0x29ab('0x52'),_0x17e3d5['uniqueid'],!_[_0x29ab('0x25')](_0x17e3d5[_0x29ab('0x4b')][_0x29ab('0x54')])?_0x29ab('0x54'):_0x29ab('0x53'),_0x17e3d5[_0x29ab('0x4a')]));channels[_0x17e3d5[_0x29ab('0x6')]]['lastapplication']=_0x29ab('0x55');channels[_0x17e3d5['uniqueid']][_0x29ab('0x56')]=_0x17e3d5[_0x29ab('0x4a')];channels[_0x17e3d5[_0x29ab('0x6')]][_0x29ab('0xa')]=!![];}if(!_['isNil'](_0x17e3d5['variable'][_0x29ab('0x57')])){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')](_0x29ab('0x58'),_0x17e3d5[_0x29ab('0x6')],_0x17e3d5['value']));channels[_0x17e3d5[_0x29ab('0x6')]][_0x29ab('0x59')]=_0x17e3d5[_0x29ab('0x4a')];}if(!_['isNil'](_0x17e3d5[_0x29ab('0x4b')]['xmd-cdrtype'])){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')](_0x29ab('0x5a'),_0x17e3d5['uniqueid'],_0x17e3d5[_0x29ab('0x4a')]));channels[_0x17e3d5['uniqueid']][_0x29ab('0x5b')]=_0x17e3d5[_0x29ab('0x4a')];}if(!_[_0x29ab('0x25')](_0x17e3d5[_0x29ab('0x4b')][_0x29ab('0x5c')])){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')](_0x29ab('0x5d'),_0x17e3d5[_0x29ab('0x6')],_0x17e3d5[_0x29ab('0x4a')]));channels[_0x17e3d5['uniqueid']]['routeid']=_0x17e3d5['value'];}if(!_[_0x29ab('0x25')](_0x17e3d5['variable'][_0x29ab('0x5e')])){utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x17e3d5[_0x29ab('0x6')],_0x17e3d5[_0x29ab('0x4a')]));channels[_0x17e3d5['uniqueid']][_0x29ab('0x5e')]=_0x17e3d5[_0x29ab('0x4a')];}}}catch(_0x50c783){utils[_0x29ab('0x21')](util[_0x29ab('0x1c')](_0x29ab('0x47'),_0x17e3d5[_0x29ab('0x6')]),_0x50c783);}};exports[_0x29ab('0x5f')]=function(_0x4b9a2b){try{if(!_[_0x29ab('0x25')](channels[_0x4b9a2b['uniqueid']])){utils[_0x29ab('0x23')](util[_0x29ab('0x1c')](_0x29ab('0x60'),_0x4b9a2b[_0x29ab('0x6')]),_0x4b9a2b);utils[_0x29ab('0x1b')](util[_0x29ab('0x1c')](_0x29ab('0x61'),_0x4b9a2b[_0x29ab('0x6')],_0x4b9a2b[_0x29ab('0x62')],_0x4b9a2b[_0x29ab('0x63')]));if(_0x4b9a2b[_0x29ab('0x62')][_0x29ab('0x64')]()=='set'&&_[_0x29ab('0x65')](_0x4b9a2b['appdata'][_0x29ab('0x64')](),'cdr')){var _0x3340ce=_0x4b9a2b[_0x29ab('0x63')][_0x29ab('0x66')]('=');var _0x4d81f0=_0x3340ce[0x0][_0x29ab('0x67')](_0x3340ce[0x0]['lastIndexOf']('(')+0x1,_0x3340ce[0x0]['lastIndexOf'](')'));var _0x265793=_0x3340ce[0x1];channels[_0x4b9a2b['uniqueid']][_0x4d81f0]=_0x265793;}if(!_[_0x29ab('0x68')]([_0x29ab('0x2d'),'noop',_0x29ab('0x69'),_0x29ab('0x6a'),'gotoif'],_0x4b9a2b[_0x29ab('0x62')]['toLowerCase']())){channels[_0x4b9a2b[_0x29ab('0x6')]][_0x29ab('0x6b')]=_0x4b9a2b[_0x29ab('0x62')];channels[_0x4b9a2b[_0x29ab('0x6')]][_0x29ab('0x56')]=_0x4b9a2b[_0x29ab('0x63')];}}}catch(_0x29e153){utils[_0x29ab('0x21')](util[_0x29ab('0x1c')]('[%s][calls][newexten]',_0x4b9a2b['uniqueid']),_0x29e153);}}; \ No newline at end of file +var _0x4d87=['[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','gotoif','lastapplication','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','CreateVoiceCallReport','recording','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','debug','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','userfield','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstartAt','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid'];(function(_0x5ae3d8,_0x5ed67f){var _0x34723d=function(_0x26a985){while(--_0x26a985){_0x5ae3d8['push'](_0x5ae3d8['shift']());}};_0x34723d(++_0x5ed67f);}(_0x4d87,0xf0));var _0x74d8=function(_0x57414d,_0x140b6a){_0x57414d=_0x57414d-0x0;var _0x24a2fc=_0x4d87[_0x57414d];return _0x24a2fc;};'use strict';var _=require('lodash');var util=require(_0x74d8('0x0'));var utils=require(_0x74d8('0x1'));var transfers=require(_0x74d8('0x2'));var dispositions=['NO\x20ANSWER',_0x74d8('0x3'),_0x74d8('0x3'),'NO\x20ANSWER','NO\x20ANSWER',_0x74d8('0x4'),_0x74d8('0x5'),_0x74d8('0x6'),_0x74d8('0x3'),'FAILED','FAILED'];var channels={};function writeDB(_0x54c5f6){var _0x4149ee;if(transfers[_0x74d8('0x7')][_0x54c5f6[_0x74d8('0x8')]]){_0x4149ee=_0x54c5f6[_0x74d8('0x8')];_0x54c5f6[_0x74d8('0x8')]=transfers[_0x74d8('0x7')][_0x54c5f6['uniqueid']][_0x74d8('0x9')];}utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0xc'),_0x54c5f6[_0x74d8('0x8')],_0x54c5f6[_0x74d8('0xd')],_0x54c5f6[_0x74d8('0xe')],_0x54c5f6[_0x74d8('0xf')],_0x54c5f6[_0x74d8('0x10')],_0x54c5f6['calleridnum'],_0x54c5f6[_0x74d8('0x11')],_0x54c5f6[_0x74d8('0x12')]));if(_0x54c5f6['accountcode']){utils[_0x74d8('0x13')](_0x54c5f6[_0x74d8('0x14')])[_0x74d8('0x15')](function(_0x2d3c09){if(_0x2d3c09){_0x54c5f6[_0x74d8('0x16')]=_0x2d3c09['id'];}utils['request']('CreateVoiceCallReport',_0x54c5f6);});}else{utils['request'](_0x74d8('0x17'),_0x54c5f6);}if(channels[_0x54c5f6[_0x74d8('0x8')]]){delete channels[_0x54c5f6[_0x74d8('0x8')]];}else if(_0x4149ee&&channels[_0x4149ee]){if(!transfers[_0x74d8('0x7')][_0x4149ee][_0x74d8('0x18')])delete transfers[_0x74d8('0x7')][_0x4149ee];delete channels[_0x4149ee];}}exports['newchannel']=function(_0x2da434){try{utils['debug'](util[_0x74d8('0xb')](_0x74d8('0x19'),_0x2da434[_0x74d8('0x8')]),_0x2da434);if(_0x2da434[_0x74d8('0x8')]==_0x2da434[_0x74d8('0x1a')]&&_0x2da434[_0x74d8('0xd')]!=_0x74d8('0x1b')){utils['info'](util[_0x74d8('0xb')](_0x74d8('0x1c'),_0x2da434['uniqueid'],_0x2da434[_0x74d8('0x1d')],_0x2da434[_0x74d8('0x1e')]));channels[_0x2da434[_0x74d8('0x8')]]={'uniqueid':_0x2da434[_0x74d8('0x8')],'accountcode':_0x2da434[_0x74d8('0x14')],'source':_0x2da434[_0x74d8('0x1f')],'destination':_0x2da434[_0x74d8('0x1e')],'destinationcontext':_0x2da434[_0x74d8('0x1d')],'channel':_0x2da434[_0x74d8('0xd')],'starttime':utils[_0x74d8('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x74d8('0x4'),'amaflags':_0x74d8('0x21')};}}catch(_0x24d5d3){utils[_0x74d8('0x22')](util[_0x74d8('0xb')](_0x74d8('0x19'),_0x2da434[_0x74d8('0x8')]),_0x24d5d3);}};exports[_0x74d8('0x23')]=function(_0x43ee53){try{utils['debug'](util[_0x74d8('0xb')](_0x74d8('0x24'),_0x43ee53[_0x74d8('0x8')]),_0x43ee53);if(!_[_0x74d8('0x25')](channels[_0x43ee53[_0x74d8('0x8')]])&&_0x43ee53[_0x74d8('0x26')]==0x6){utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0x27'),_0x43ee53[_0x74d8('0x8')],_0x43ee53[_0x74d8('0x1d')],_0x43ee53['channel']));if(_[_0x74d8('0x25')](channels[_0x43ee53[_0x74d8('0x8')]]['systemanswertime'])){channels[_0x43ee53[_0x74d8('0x8')]][_0x74d8('0x28')]=utils[_0x74d8('0x20')]();}}else if(!_[_0x74d8('0x25')](channels[_0x43ee53['linkedid']])&&_0x43ee53[_0x74d8('0x26')]==0x6&&_0x43ee53[_0x74d8('0x1d')]!=_0x74d8('0x29')){utils[_0x74d8('0xa')](util['format'](_0x74d8('0x2a'),_0x43ee53[_0x74d8('0x8')],_0x43ee53[_0x74d8('0x1a')],_0x43ee53[_0x74d8('0x1d')],_0x43ee53['channel']));channels[_0x43ee53[_0x74d8('0x1a')]][_0x74d8('0x14')]=_0x43ee53[_0x74d8('0x14')];channels[_0x43ee53['linkedid']][_0x74d8('0x2b')]=_0x43ee53[_0x74d8('0xd')];if(_[_0x74d8('0x25')](channels[_0x43ee53[_0x74d8('0x1a')]][_0x74d8('0x2c')])){channels[_0x43ee53[_0x74d8('0x1a')]][_0x74d8('0x2c')]=utils[_0x74d8('0x20')]();}channels[_0x43ee53[_0x74d8('0x1a')]][_0x74d8('0x2d')]=dispositions[_[_0x74d8('0x2e')](_0x43ee53[_0x74d8('0x26')])]||_0x74d8('0x5');}}catch(_0x5615ab){utils[_0x74d8('0x22')](util[_0x74d8('0xb')]('[%s][calls][newstate]',_0x43ee53[_0x74d8('0x8')]),_0x5615ab);}};exports[_0x74d8('0x2f')]=function(_0x448eae){try{if(!_[_0x74d8('0x25')](channels[_0x448eae[_0x74d8('0x8')]])){utils[_0x74d8('0x30')](util[_0x74d8('0xb')](_0x74d8('0x31'),_0x448eae['uniqueid']),_0x448eae);if(_[_0x74d8('0x25')](channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x32')])){channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x32')]=_0x448eae[_0x74d8('0x33')]+'\x20<'+_0x448eae[_0x74d8('0x1f')]+'>';}utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0x34'),_0x448eae['uniqueid'],channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x32')],_0x448eae[_0x74d8('0x35')]));channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x36')]=utils[_0x74d8('0x20')]();channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x37')]=utils[_0x74d8('0x38')](channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x36')],channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x39')]);channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x3a')]=channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x2c')]?utils[_0x74d8('0x38')](channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x36')],channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x2c')]):0x0;writeDB(channels[_0x448eae['uniqueid']]);}}catch(_0x2f7ff4){utils[_0x74d8('0x22')](util[_0x74d8('0xb')]('[%s][calls][hangup]',_0x448eae[_0x74d8('0x8')]),_0x2f7ff4);}};exports['attendedtransfer']=function(_0x52fa7d){try{if(!_[_0x74d8('0x25')](channels[_0x52fa7d[_0x74d8('0x3b')]])){utils[_0x74d8('0x30')](util[_0x74d8('0xb')](_0x74d8('0x3c'),_0x52fa7d[_0x74d8('0x3d')]),_0x52fa7d);if(channels[_0x52fa7d[_0x74d8('0x3b')]][_0x74d8('0xd')]==_0x52fa7d['transfereechannel']){utils[_0x74d8('0xa')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x52fa7d[_0x74d8('0x3d')],_0x52fa7d[_0x74d8('0x3b')],_0x52fa7d[_0x74d8('0x3e')]));channels[_0x52fa7d[_0x74d8('0x3b')]]['destinationchannel']=_0x52fa7d['secondtransfererchannel'];channels[_0x52fa7d[_0x74d8('0x3b')]][_0x74d8('0x3f')]='_attended';}else if(channels[_0x52fa7d[_0x74d8('0x3b')]][_0x74d8('0xd')]=_0x52fa7d[_0x74d8('0x40')]){utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0x41'),_0x52fa7d[_0x74d8('0x3d')],_0x52fa7d['localtwolinkedid'],_0x52fa7d[_0x74d8('0x42')]));channels[_0x52fa7d['localtwolinkedid']][_0x74d8('0x2b')]=_0x52fa7d['origtransfererchannel'];channels[_0x52fa7d[_0x74d8('0x3b')]][_0x74d8('0x3f')]='_attended';}}}catch(_0xf42f24){utils['error'](util[_0x74d8('0xb')](_0x74d8('0x3c'),_0x52fa7d[_0x74d8('0x3d')]),_0xf42f24);}};exports['musiconholdstart']=function(_0x4821b4){try{if(!_[_0x74d8('0x25')](channels[_0x4821b4[_0x74d8('0x8')]])){utils[_0x74d8('0x30')](util['format']('[%s][calls][musiconholdstart]',_0x4821b4[_0x74d8('0x8')]),_0x4821b4);channels[_0x4821b4[_0x74d8('0x8')]][_0x74d8('0x43')]=utils['now']();utils[_0x74d8('0xa')](util[_0x74d8('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4821b4[_0x74d8('0x8')],channels[_0x4821b4[_0x74d8('0x8')]][_0x74d8('0x43')]));}}catch(_0xab72b2){utils[_0x74d8('0x22')](util[_0x74d8('0xb')](_0x74d8('0x44'),_0x4821b4[_0x74d8('0x8')]),_0xab72b2);}};exports['musiconholdstop']=function(_0x686293){try{if(!_['isNil'](channels[_0x686293[_0x74d8('0x8')]])){utils['debug'](util[_0x74d8('0xb')](_0x74d8('0x45'),_0x686293['uniqueid']),_0x686293);if(!_[_0x74d8('0x25')](channels[_0x686293[_0x74d8('0x8')]]['musiconholdstartAt'])){channels[_0x686293[_0x74d8('0x8')]][_0x74d8('0x46')]+=utils[_0x74d8('0x38')](utils[_0x74d8('0x20')](),channels[_0x686293['uniqueid']]['musiconholdstartAt']);utils['info'](util[_0x74d8('0xb')](_0x74d8('0x47'),_0x686293[_0x74d8('0x8')],channels[_0x686293['uniqueid']][_0x74d8('0x46')]));delete channels[_0x686293[_0x74d8('0x8')]][_0x74d8('0x43')];}}}catch(_0x4a3d30){utils[_0x74d8('0x22')](util['format'](_0x74d8('0x45'),_0x686293[_0x74d8('0x8')]),_0x4a3d30);}};exports[_0x74d8('0x48')]=function(_0x3af18c){try{if(!_[_0x74d8('0x25')](channels[_0x3af18c[_0x74d8('0x8')]])){utils[_0x74d8('0x30')](util[_0x74d8('0xb')]('[%s][calls][varset]',_0x3af18c[_0x74d8('0x8')]),_0x3af18c);if(!_['isNil'](_0x3af18c[_0x74d8('0x49')][_0x74d8('0x4a')])){utils['info'](util[_0x74d8('0xb')](_0x74d8('0x4b'),_0x3af18c[_0x74d8('0x8')],_0x3af18c[_0x74d8('0x4c')]));channels[_0x3af18c[_0x74d8('0x8')]][_0x74d8('0x4d')]=_0x3af18c[_0x74d8('0x4c')];}if(!_[_0x74d8('0x25')](_0x3af18c['variable'][_0x74d8('0x4e')])){utils[_0x74d8('0xa')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x3af18c[_0x74d8('0x8')],_0x3af18c[_0x74d8('0x4c')]));channels[_0x3af18c['uniqueid']][_0x74d8('0x4f')]=_0x3af18c[_0x74d8('0x4c')];channels[_0x3af18c[_0x74d8('0x8')]]['callerid']='\x22'+_0x3af18c[_0x74d8('0x4c')]+_0x74d8('0x50')+_0x3af18c[_0x74d8('0x4c')]+'>';}if(!_['isNil'](_0x3af18c[_0x74d8('0x49')][_0x74d8('0x51')])||!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')]['xmd-callerid'])){utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0x52'),_0x3af18c[_0x74d8('0x8')],!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')][_0x74d8('0x51')])?_0x74d8('0x51'):_0x74d8('0x53'),_0x3af18c[_0x74d8('0x4c')]));channels[_0x3af18c[_0x74d8('0x8')]][_0x74d8('0x32')]=_0x3af18c[_0x74d8('0x4c')];}if(!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')][_0x74d8('0x54')])||!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')][_0x74d8('0x55')])){utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0x52'),_0x3af18c['uniqueid'],!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')]['xmd-queue'])?_0x74d8('0x54'):'xmcs-queue',_0x3af18c['value']));channels[_0x3af18c['uniqueid']]['lastapplication']=_0x74d8('0x56');channels[_0x3af18c['uniqueid']][_0x74d8('0x57')]=_0x3af18c[_0x74d8('0x4c')];channels[_0x3af18c[_0x74d8('0x8')]][_0x74d8('0xe')]=!![];}if(!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')]['xmd-contactid'])){utils[_0x74d8('0xa')](util['format'](_0x74d8('0x58'),_0x3af18c['uniqueid'],_0x3af18c['value']));channels[_0x3af18c['uniqueid']][_0x74d8('0x59')]=_0x3af18c[_0x74d8('0x4c')];}if(!_[_0x74d8('0x25')](_0x3af18c['variable']['xmd-cdrtype'])){utils['info'](util[_0x74d8('0xb')](_0x74d8('0x5a'),_0x3af18c[_0x74d8('0x8')],_0x3af18c[_0x74d8('0x4c')]));channels[_0x3af18c[_0x74d8('0x8')]][_0x74d8('0x5b')]=_0x3af18c[_0x74d8('0x4c')];}if(!_[_0x74d8('0x25')](_0x3af18c['variable'][_0x74d8('0x5c')])){utils['info'](util[_0x74d8('0xb')](_0x74d8('0x5d'),_0x3af18c[_0x74d8('0x8')],_0x3af18c[_0x74d8('0x4c')]));channels[_0x3af18c[_0x74d8('0x8')]]['routeid']=_0x3af18c[_0x74d8('0x4c')];}if(!_[_0x74d8('0x25')](_0x3af18c['variable']['sipcallid'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x3af18c['uniqueid'],_0x3af18c['value']));channels[_0x3af18c[_0x74d8('0x8')]][_0x74d8('0x5e')]=_0x3af18c[_0x74d8('0x4c')];}}}catch(_0x2e9e2b){utils[_0x74d8('0x22')](util[_0x74d8('0xb')](_0x74d8('0x5f'),_0x3af18c[_0x74d8('0x8')]),_0x2e9e2b);}};exports['newexten']=function(_0x29b6ce){try{if(!_['isNil'](channels[_0x29b6ce[_0x74d8('0x8')]])){utils[_0x74d8('0x30')](util[_0x74d8('0xb')](_0x74d8('0x60'),_0x29b6ce[_0x74d8('0x8')]),_0x29b6ce);utils[_0x74d8('0xa')](util['format'](_0x74d8('0x61'),_0x29b6ce[_0x74d8('0x8')],_0x29b6ce[_0x74d8('0x62')],_0x29b6ce[_0x74d8('0x63')]));if(_0x29b6ce['application'][_0x74d8('0x64')]()==_0x74d8('0x65')&&_[_0x74d8('0x66')](_0x29b6ce[_0x74d8('0x63')][_0x74d8('0x64')](),_0x74d8('0x67'))){var _0x1d597b=_0x29b6ce[_0x74d8('0x63')][_0x74d8('0x68')]('=');var _0x474bd5=_0x1d597b[0x0][_0x74d8('0x69')](_0x1d597b[0x0][_0x74d8('0x6a')]('(')+0x1,_0x1d597b[0x0][_0x74d8('0x6a')](')'));var _0x2cb93f=_0x1d597b[0x1];channels[_0x29b6ce[_0x74d8('0x8')]][_0x474bd5]=_0x2cb93f;}if(!_[_0x74d8('0x6b')]([_0x74d8('0x2f'),_0x74d8('0x6c'),'execif',_0x74d8('0x65'),_0x74d8('0x6d')],_0x29b6ce[_0x74d8('0x62')][_0x74d8('0x64')]())){channels[_0x29b6ce[_0x74d8('0x8')]][_0x74d8('0x6e')]=_0x29b6ce[_0x74d8('0x62')];channels[_0x29b6ce[_0x74d8('0x8')]][_0x74d8('0x57')]=_0x29b6ce['appdata'];}}}catch(_0x37746e){utils[_0x74d8('0x22')](util[_0x74d8('0xb')](_0x74d8('0x60'),_0x29b6ce[_0x74d8('0x8')]),_0x37746e);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index d72e3f8..0dc7efd 100644 --- a/server/services/xdr/core.controller.js +++ b/server/services/xdr/core.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb44b=['./utils','info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x50ad01,_0x31cfed){var _0x31a9bd=function(_0x2ec517){while(--_0x2ec517){_0x50ad01['push'](_0x50ad01['shift']());}};_0x31a9bd(++_0x31cfed);}(_0xb44b,0x12c));var _0xbb44=function(_0x4b55e8,_0x41ba7e){_0x4b55e8=_0x4b55e8-0x0;var _0x46e844=_0xb44b[_0x4b55e8];return _0x46e844;};'use strict';var utils=require(_0xbb44('0x0'));exports['connect']=function(){utils[_0xbb44('0x1')]('[core]\x20connected');};exports[_0xbb44('0x2')]=function(){utils[_0xbb44('0x1')](_0xbb44('0x3'));};exports[_0xbb44('0x4')]=function(){utils[_0xbb44('0x1')](_0xbb44('0x5'));};exports['error']=function(_0x2d0a01){utils[_0xbb44('0x6')](_0xbb44('0x7'),_0x2d0a01);};exports[_0xbb44('0x8')]=function(){utils['info'](_0xbb44('0x9'));};exports['managerevent']=function(_0x4d83e8){}; \ No newline at end of file +var _0xc7dd=['[core]\x20error','close','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x467222,_0x53f75a){var _0x3258e2=function(_0x1c746c){while(--_0x1c746c){_0x467222['push'](_0x467222['shift']());}};_0x3258e2(++_0x53f75a);}(_0xc7dd,0x1e6));var _0xdc7d=function(_0x4f5c2a,_0x465535){_0x4f5c2a=_0x4f5c2a-0x0;var _0x1b2e6e=_0xc7dd[_0x4f5c2a];return _0x1b2e6e;};'use strict';var utils=require(_0xdc7d('0x0'));exports[_0xdc7d('0x1')]=function(){utils[_0xdc7d('0x2')](_0xdc7d('0x3'));};exports[_0xdc7d('0x4')]=function(){utils[_0xdc7d('0x2')](_0xdc7d('0x5'));};exports[_0xdc7d('0x6')]=function(){utils[_0xdc7d('0x2')](_0xdc7d('0x7'));};exports[_0xdc7d('0x8')]=function(_0x306df7){utils[_0xdc7d('0x8')](_0xdc7d('0x9'),_0x306df7);};exports[_0xdc7d('0xa')]=function(){utils[_0xdc7d('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x1e90e0){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index acbd76b..081b6f1 100644 --- a/server/services/xdr/dials.controller.js +++ b/server/services/xdr/dials.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab7b=['isNil','variable','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]'];(function(_0x20320d,_0x8bbafe){var _0x19491b=function(_0x1152c7){while(--_0x1152c7){_0x20320d['push'](_0x20320d['shift']());}};_0x19491b(++_0x8bbafe);}(_0xab7b,0x145));var _0xbab7=function(_0x5dc927,_0x49f4a1){_0x5dc927=_0x5dc927-0x0;var _0x416440=_0xab7b[_0x5dc927];return _0x416440;};'use strict';var _=require(_0xbab7('0x0'));var util=require(_0xbab7('0x1'));var utils=require('./utils');var dials={};function writeDB(_0xc6383e){utils[_0xbab7('0x2')](util[_0xbab7('0x3')](_0xbab7('0x4'),_0xc6383e[_0xbab7('0x5')],_0xc6383e[_0xbab7('0x6')],_0xc6383e[_0xbab7('0x7')],_0xc6383e[_0xbab7('0x8')],_0xc6383e[_0xbab7('0x9')],_0xc6383e[_0xbab7('0xa')]));utils[_0xbab7('0xb')]('CreateVoiceDialReport',_0xc6383e);delete dials[_0xc6383e['uniqueid']];}exports[_0xbab7('0xc')]=function(_0x1e7568){try{utils[_0xbab7('0xd')](util[_0xbab7('0x3')](_0xbab7('0xe'),_0x1e7568[_0xbab7('0x5')]),_0x1e7568);utils[_0xbab7('0x2')](util[_0xbab7('0x3')](_0xbab7('0xf'),_0x1e7568[_0xbab7('0x5')],_0x1e7568[_0xbab7('0x10')],_0x1e7568[_0xbab7('0x11')]));if(_0x1e7568[_0xbab7('0x10')]['toLowerCase']()=='set'&&_[_0xbab7('0x12')](_0x1e7568[_0xbab7('0x11')][_0xbab7('0x13')](),_0xbab7('0x14'))){var _0x351a07=_0x1e7568[_0xbab7('0x11')][_0xbab7('0x15')]('=');dials[_0x1e7568[_0xbab7('0x5')]]={'routeId':_0x351a07[0x1]};}}catch(_0x12e7cc){utils[_0xbab7('0x16')](util['format'](_0xbab7('0xe'),_0x1e7568[_0xbab7('0x5')]),_0x12e7cc);}};exports[_0xbab7('0x17')]=function(_0x17a167){try{utils[_0xbab7('0xd')](util[_0xbab7('0x3')](_0xbab7('0x18'),_0x17a167['uniqueid']),_0x17a167);if(!_[_0xbab7('0x19')](_0x17a167[_0xbab7('0x1a')]['outboundrouteid'])){utils[_0xbab7('0x2')](util[_0xbab7('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x17a167[_0xbab7('0x5')],_0x17a167[_0xbab7('0x1b')]));dials[_0x17a167[_0xbab7('0x5')]]={'routeId':_0x17a167[_0xbab7('0x1b')]};}}catch(_0x54f7d9){utils[_0xbab7('0x16')](util[_0xbab7('0x3')](_0xbab7('0x18'),_0x17a167[_0xbab7('0x5')]),_0x54f7d9);}};exports[_0xbab7('0x1c')]=function(_0x24a28f){try{if(!_[_0xbab7('0x19')](dials[_0x24a28f[_0xbab7('0x5')]])){utils[_0xbab7('0xd')](util[_0xbab7('0x3')](_0xbab7('0x1d'),_0x24a28f[_0xbab7('0x5')]),_0x24a28f);dials[_0x24a28f[_0xbab7('0x5')]]=_[_0xbab7('0x1e')](dials[_0x24a28f[_0xbab7('0x5')]],_0x24a28f);dials[_0x24a28f[_0xbab7('0x5')]][_0xbab7('0x1f')]=utils['now']();dials[_0x24a28f[_0xbab7('0x5')]][_0xbab7('0x20')]=_0xbab7('0x21');utils['info'](util['format'](_0xbab7('0x22'),_0x24a28f[_0xbab7('0x5')],dials[_0x24a28f['uniqueid']]['starttime']));}}catch(_0x5db752){utils[_0xbab7('0x16')](util['format'](_0xbab7('0x1d'),_0x24a28f['uniqueid']),_0x5db752);}};exports[_0xbab7('0x23')]=function(_0x7d57fc){try{if(!_[_0xbab7('0x19')](dials[_0x7d57fc[_0xbab7('0x5')]])){utils['debug'](util[_0xbab7('0x3')](_0xbab7('0x24'),_0x7d57fc[_0xbab7('0x5')]),_0x7d57fc);dials[_0x7d57fc['uniqueid']][_0xbab7('0xa')]=_0x7d57fc['dialstatus'];if(_0x7d57fc[_0xbab7('0xa')]==_0xbab7('0x25')){dials[_0x7d57fc[_0xbab7('0x5')]]=_[_0xbab7('0x1e')](dials[_0x7d57fc[_0xbab7('0x5')]],_0x7d57fc);dials[_0x7d57fc[_0xbab7('0x5')]][_0xbab7('0x26')]=utils[_0xbab7('0x27')]();dials[_0x7d57fc['uniqueid']][_0xbab7('0x20')]='connect';utils['info'](util['format'](_0xbab7('0x28'),_0x7d57fc[_0xbab7('0x5')],_0x7d57fc['dialstatus'],dials[_0x7d57fc[_0xbab7('0x5')]][_0xbab7('0x26')]));}else{utils[_0xbab7('0x2')](util[_0xbab7('0x3')](_0xbab7('0x29'),_0x7d57fc['uniqueid'],_0x7d57fc[_0xbab7('0xa')]));}}}catch(_0x5ebb41){utils[_0xbab7('0x16')](util[_0xbab7('0x3')](_0xbab7('0x24'),_0x7d57fc[_0xbab7('0x5')]),_0x5ebb41);}};exports[_0xbab7('0x2a')]=function(_0x1e10c5){try{if(!_[_0xbab7('0x19')](dials[_0x1e10c5[_0xbab7('0x5')]])){utils[_0xbab7('0xd')](util[_0xbab7('0x3')]('[%s][dials][hangup]',_0x1e10c5[_0xbab7('0x5')]),_0x1e10c5);utils[_0xbab7('0x2')](util[_0xbab7('0x3')](_0xbab7('0x2b'),_0x1e10c5[_0xbab7('0x5')],_0x1e10c5['calleridnum'],_0x1e10c5['calleridname'],_0x1e10c5[_0xbab7('0x2c')]));dials[_0x1e10c5[_0xbab7('0x5')]]=_[_0xbab7('0x1e')](dials[_0x1e10c5[_0xbab7('0x5')]],{'endtime':utils[_0xbab7('0x27')](),'lastevent':_0xbab7('0x2d')});dials[_0x1e10c5[_0xbab7('0x5')]][_0xbab7('0x2e')]=utils[_0xbab7('0x2f')](dials[_0x1e10c5[_0xbab7('0x5')]][_0xbab7('0x30')],dials[_0x1e10c5[_0xbab7('0x5')]][_0xbab7('0x1f')]);dials[_0x1e10c5[_0xbab7('0x5')]]['holdtime']=utils[_0xbab7('0x2f')](dials[_0x1e10c5[_0xbab7('0x5')]][_0xbab7('0x26')]||dials[_0x1e10c5['uniqueid']][_0xbab7('0x30')],dials[_0x1e10c5[_0xbab7('0x5')]][_0xbab7('0x1f')]);dials[_0x1e10c5['uniqueid']][_0xbab7('0x31')]=dials[_0x1e10c5[_0xbab7('0x5')]][_0xbab7('0x26')]?utils['diffTime'](dials[_0x1e10c5[_0xbab7('0x5')]][_0xbab7('0x30')],dials[_0x1e10c5['uniqueid']][_0xbab7('0x26')]):0x0;writeDB(dials[_0x1e10c5[_0xbab7('0x5')]]);}}catch(_0x592e47){utils['error'](util[_0xbab7('0x3')]('[%s][dials][hangup]',_0x1e10c5[_0xbab7('0x5')]),_0x592e47);}}; \ No newline at end of file +var _0xd906=['now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','dialstatus','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','answertime','billableseconds','lodash','./utils','info','format','uniqueid','dialstring','connectedlinenum','request','CreateVoiceDialReport','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','debug','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign'];(function(_0x3fc787,_0x46144e){var _0x3d2ee3=function(_0x5af0ba){while(--_0x5af0ba){_0x3fc787['push'](_0x3fc787['shift']());}};_0x3d2ee3(++_0x46144e);}(_0xd906,0xa8));var _0x6d90=function(_0x2e9681,_0x3386e7){_0x2e9681=_0x2e9681-0x0;var _0x3d1c9f=_0xd906[_0x2e9681];return _0x3d1c9f;};'use strict';var _=require(_0x6d90('0x0'));var util=require('util');var utils=require(_0x6d90('0x1'));var dials={};function writeDB(_0x5ec2d8){utils[_0x6d90('0x2')](util[_0x6d90('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x5ec2d8[_0x6d90('0x4')],_0x5ec2d8['channel'],_0x5ec2d8[_0x6d90('0x5')],_0x5ec2d8['calleridnum'],_0x5ec2d8[_0x6d90('0x6')],_0x5ec2d8['dialstatus']));utils[_0x6d90('0x7')](_0x6d90('0x8'),_0x5ec2d8);delete dials[_0x5ec2d8[_0x6d90('0x4')]];}exports['newexten']=function(_0x4fe79f){try{utils['debug'](util['format'](_0x6d90('0x9'),_0x4fe79f[_0x6d90('0x4')]),_0x4fe79f);utils[_0x6d90('0x2')](util[_0x6d90('0x3')](_0x6d90('0xa'),_0x4fe79f[_0x6d90('0x4')],_0x4fe79f[_0x6d90('0xb')],_0x4fe79f[_0x6d90('0xc')]));if(_0x4fe79f[_0x6d90('0xb')][_0x6d90('0xd')]()==_0x6d90('0xe')&&_[_0x6d90('0xf')](_0x4fe79f[_0x6d90('0xc')]['toLowerCase'](),_0x6d90('0x10'))){var _0x38d47c=_0x4fe79f[_0x6d90('0xc')]['split']('=');dials[_0x4fe79f[_0x6d90('0x4')]]={'routeId':_0x38d47c[0x1]};}}catch(_0x1dc31f){utils[_0x6d90('0x11')](util[_0x6d90('0x3')](_0x6d90('0x9'),_0x4fe79f[_0x6d90('0x4')]),_0x1dc31f);}};exports[_0x6d90('0x12')]=function(_0x3c1b08){try{utils[_0x6d90('0x13')](util[_0x6d90('0x3')](_0x6d90('0x14'),_0x3c1b08['uniqueid']),_0x3c1b08);if(!_[_0x6d90('0x15')](_0x3c1b08['variable'][_0x6d90('0x16')])){utils[_0x6d90('0x2')](util[_0x6d90('0x3')](_0x6d90('0x17'),_0x3c1b08['uniqueid'],_0x3c1b08[_0x6d90('0x18')]));dials[_0x3c1b08[_0x6d90('0x4')]]={'routeId':_0x3c1b08[_0x6d90('0x18')]};}}catch(_0x344465){utils[_0x6d90('0x11')](util[_0x6d90('0x3')](_0x6d90('0x14'),_0x3c1b08[_0x6d90('0x4')]),_0x344465);}};exports[_0x6d90('0x19')]=function(_0x3c7f4d){try{if(!_[_0x6d90('0x15')](dials[_0x3c7f4d['uniqueid']])){utils[_0x6d90('0x13')](util[_0x6d90('0x3')](_0x6d90('0x1a'),_0x3c7f4d[_0x6d90('0x4')]),_0x3c7f4d);dials[_0x3c7f4d[_0x6d90('0x4')]]=_[_0x6d90('0x1b')](dials[_0x3c7f4d[_0x6d90('0x4')]],_0x3c7f4d);dials[_0x3c7f4d[_0x6d90('0x4')]]['starttime']=utils[_0x6d90('0x1c')]();dials[_0x3c7f4d[_0x6d90('0x4')]][_0x6d90('0x1d')]=_0x6d90('0x1e');utils[_0x6d90('0x2')](util['format'](_0x6d90('0x1f'),_0x3c7f4d[_0x6d90('0x4')],dials[_0x3c7f4d[_0x6d90('0x4')]][_0x6d90('0x20')]));}}catch(_0x1aa6c5){utils[_0x6d90('0x11')](util[_0x6d90('0x3')]('[%s][dials][dialbegin]',_0x3c7f4d['uniqueid']),_0x1aa6c5);}};exports[_0x6d90('0x21')]=function(_0x135d2e){try{if(!_[_0x6d90('0x15')](dials[_0x135d2e[_0x6d90('0x4')]])){utils['debug'](util[_0x6d90('0x3')](_0x6d90('0x22'),_0x135d2e[_0x6d90('0x4')]),_0x135d2e);dials[_0x135d2e[_0x6d90('0x4')]]['dialstatus']=_0x135d2e[_0x6d90('0x23')];if(_0x135d2e[_0x6d90('0x23')]=='ANSWER'){dials[_0x135d2e[_0x6d90('0x4')]]=_[_0x6d90('0x1b')](dials[_0x135d2e[_0x6d90('0x4')]],_0x135d2e);dials[_0x135d2e['uniqueid']]['answertime']=utils[_0x6d90('0x1c')]();dials[_0x135d2e[_0x6d90('0x4')]]['lastevent']=_0x6d90('0x24');utils['info'](util[_0x6d90('0x3')](_0x6d90('0x25'),_0x135d2e['uniqueid'],_0x135d2e[_0x6d90('0x23')],dials[_0x135d2e[_0x6d90('0x4')]]['answertime']));}else{utils['info'](util[_0x6d90('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x135d2e['uniqueid'],_0x135d2e[_0x6d90('0x23')]));}}}catch(_0x464ac7){utils[_0x6d90('0x11')](util['format'](_0x6d90('0x22'),_0x135d2e[_0x6d90('0x4')]),_0x464ac7);}};exports['hangup']=function(_0x6a4c9e){try{if(!_['isNil'](dials[_0x6a4c9e[_0x6d90('0x4')]])){utils['debug'](util[_0x6d90('0x3')](_0x6d90('0x26'),_0x6a4c9e[_0x6d90('0x4')]),_0x6a4c9e);utils[_0x6d90('0x2')](util[_0x6d90('0x3')](_0x6d90('0x27'),_0x6a4c9e[_0x6d90('0x4')],_0x6a4c9e['calleridnum'],_0x6a4c9e[_0x6d90('0x28')],_0x6a4c9e[_0x6d90('0x29')]));dials[_0x6a4c9e[_0x6d90('0x4')]]=_['assign'](dials[_0x6a4c9e[_0x6d90('0x4')]],{'endtime':utils['now'](),'lastevent':_0x6d90('0x2a')});dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2b')]=utils[_0x6d90('0x2c')](dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2d')],dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x20')]);dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2e')]=utils[_0x6d90('0x2c')](dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2f')]||dials[_0x6a4c9e['uniqueid']][_0x6d90('0x2d')],dials[_0x6a4c9e['uniqueid']][_0x6d90('0x20')]);dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x30')]=dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2f')]?utils[_0x6d90('0x2c')](dials[_0x6a4c9e['uniqueid']]['endtime'],dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2f')]):0x0;writeDB(dials[_0x6a4c9e[_0x6d90('0x4')]]);}}catch(_0x19bee7){utils[_0x6d90('0x11')](util[_0x6d90('0x3')]('[%s][dials][hangup]',_0x6a4c9e['uniqueid']),_0x19bee7);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 3aa6298..b56b6d1 100644 --- a/server/services/xdr/index.js +++ b/server/services/xdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa031=['env','local','asterisk','port','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','debug','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s]dialbegin','dialend','../../config/environment','xdr','disabled'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0xa031,0x7f));var _0x1a03=function(_0x56f574,_0x4e0b28){_0x56f574=_0x56f574-0x0;var _0x72e8b2=_0xa031[_0x56f574];return _0x72e8b2;};var AsteriskManager=require('asterisk-manager');var config=require(_0x1a03('0x0'));var utils=require('./utils');var util=require('util');var isXDREnabled=config[_0x1a03('0x1')]&&config[_0x1a03('0x1')][_0x1a03('0x2')]?!config[_0x1a03('0x1')][_0x1a03('0x2')]:!![];var isProduction=config[_0x1a03('0x3')]==='production'||![];var isLocalAsterisk=config[_0x1a03('0x1')]&&config[_0x1a03('0x1')][_0x1a03('0x4')]===!![]||![];var ami=new AsteriskManager(config[_0x1a03('0x5')][_0x1a03('0x6')],config[_0x1a03('0x5')]['ip'],config[_0x1a03('0x5')]['username'],config[_0x1a03('0x5')][_0x1a03('0x7')],!![]);ami[_0x1a03('0x8')]();if(!isXDREnabled){utils[_0x1a03('0x9')](_0x1a03('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x1a03('0x9')](_0x1a03('0xb'));}else{var agents=require(_0x1a03('0xc'));var calls=require('./calls.controller');var queues=require(_0x1a03('0xd'));var recordings=require(_0x1a03('0xe'));var members=require(_0x1a03('0xf'));var dials=require(_0x1a03('0x10'));var transfers=require(_0x1a03('0x11'));var core=require(_0x1a03('0x12'));ami['on']('connect',core[_0x1a03('0x13')]);ami['on'](_0x1a03('0x14'),core[_0x1a03('0x14')]);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x1a03('0x15'),core[_0x1a03('0x15')]);ami['on'](_0x1a03('0x16'),core[_0x1a03('0x16')]);ami['on'](_0x1a03('0x17'),core['managerevent']);ami['on'](_0x1a03('0x18'),function(_0x1be0c2){try{utils['debug'](util[_0x1a03('0x19')](_0x1a03('0x1a'),_0x1be0c2[_0x1a03('0x1b')]),_0x1be0c2);members[_0x1a03('0x18')](_0x1be0c2);}catch(_0x596ab2){utils['error'](util[_0x1a03('0x19')]('[%s][index][devicestatechange]',_0x1be0c2[_0x1a03('0x1b')]),_0x596ab2);}});ami['on'](_0x1a03('0x1c'),function(_0xbe9cce){try{utils['debug'](util[_0x1a03('0x19')]('[%s][index][agentcalled]',_0xbe9cce['uniqueid']),_0xbe9cce);agents[_0x1a03('0x1c')](_0xbe9cce);}catch(_0x246cc5){utils[_0x1a03('0x15')](util[_0x1a03('0x19')](_0x1a03('0x1d'),_0xbe9cce[_0x1a03('0x1e')]),_0x246cc5);}});ami['on'](_0x1a03('0x1f'),function(_0x18d4a7){try{utils[_0x1a03('0x20')](util['format'](_0x1a03('0x21'),_0x18d4a7['uniqueid']),_0x18d4a7);agents[_0x1a03('0x1f')](_0x18d4a7);}catch(_0x13c31f){utils[_0x1a03('0x15')](util['format'](_0x1a03('0x21'),_0x18d4a7[_0x1a03('0x1e')]),_0x13c31f);}});ami['on'](_0x1a03('0x22'),function(_0xe44569){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')]('[%s][index][agentconnect]',_0xe44569[_0x1a03('0x1e')]),_0xe44569);agents[_0x1a03('0x22')](_0xe44569);queues[_0x1a03('0x22')](_0xe44569);}catch(_0x3c6960){utils[_0x1a03('0x15')](util['format'](_0x1a03('0x23'),_0xe44569[_0x1a03('0x1e')]),_0x3c6960);}});ami['on'](_0x1a03('0x24'),function(_0x3e6d2f){try{utils['debug'](util[_0x1a03('0x19')](_0x1a03('0x25'),_0x3e6d2f['uniqueid']),_0x3e6d2f);agents[_0x1a03('0x24')](_0x3e6d2f);queues[_0x1a03('0x24')](_0x3e6d2f);members[_0x1a03('0x24')](_0x3e6d2f);}catch(_0x18cda3){utils[_0x1a03('0x15')](util['format'](_0x1a03('0x25'),_0x3e6d2f[_0x1a03('0x1e')]),_0x18cda3);}});ami['on'](_0x1a03('0x26'),function(_0x1ea852){try{utils['debug'](util[_0x1a03('0x19')](_0x1a03('0x27'),_0x1ea852[_0x1a03('0x1e')]),_0x1ea852);agents['queuecallerabandon'](_0x1ea852);queues['queuecallerabandon'](_0x1ea852);}catch(_0x1dcf2a){utils[_0x1a03('0x15')](util[_0x1a03('0x19')](_0x1a03('0x27'),_0x1ea852['uniqueid']),_0x1dcf2a);}});ami['on'](_0x1a03('0x28'),function(_0x259e1d){try{utils['debug'](util[_0x1a03('0x19')](_0x1a03('0x29'),_0x259e1d[_0x1a03('0x1e')]),_0x259e1d);queues['queuecallerjoin'](_0x259e1d);recordings[_0x1a03('0x28')](_0x259e1d);}catch(_0x245667){utils[_0x1a03('0x15')](util['format'](_0x1a03('0x29'),_0x259e1d[_0x1a03('0x1e')]),_0x245667);}});ami['on'](_0x1a03('0x2a'),function(_0x118cea){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')](_0x1a03('0x2b'),_0x118cea[_0x1a03('0x1e')]),_0x118cea);queues[_0x1a03('0x2a')](_0x118cea);}catch(_0x36d802){utils[_0x1a03('0x15')](util[_0x1a03('0x19')](_0x1a03('0x2b'),_0x118cea[_0x1a03('0x1e')]),_0x36d802);}});ami['on']('musiconholdstart',function(_0x126765){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')](_0x1a03('0x2c'),_0x126765['uniqueid']),_0x126765);queues[_0x1a03('0x2d')](_0x126765);calls[_0x1a03('0x2d')](_0x126765);}catch(_0x54277b){utils[_0x1a03('0x15')](util['format']('[%s][index][musiconholdstart]',_0x126765[_0x1a03('0x1e')]),_0x54277b);}});ami['on'](_0x1a03('0x2e'),function(_0x4c8dab){try{utils[_0x1a03('0x20')](util['format'](_0x1a03('0x2f'),_0x4c8dab['uniqueid']),_0x4c8dab);queues[_0x1a03('0x2e')](_0x4c8dab);calls[_0x1a03('0x2e')](_0x4c8dab);}catch(_0x5c162c){utils[_0x1a03('0x15')](util[_0x1a03('0x19')]('[%s][index][musiconholdstop]',_0x4c8dab['uniqueid']),_0x5c162c);}});ami['on']('newstate',function(_0x1df3cc){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')](_0x1a03('0x30'),_0x1df3cc['uniqueid']),_0x1df3cc);calls[_0x1a03('0x31')](_0x1df3cc);recordings['newstate'](_0x1df3cc);}catch(_0x3c0051){utils[_0x1a03('0x15')](util[_0x1a03('0x19')](_0x1a03('0x30'),_0x1df3cc[_0x1a03('0x1e')]),_0x3c0051);}});ami['on'](_0x1a03('0x32'),function(_0x495e98){try{utils['debug'](util[_0x1a03('0x19')](_0x1a03('0x33'),_0x495e98[_0x1a03('0x1e')]),_0x495e98);calls[_0x1a03('0x32')](_0x495e98);recordings[_0x1a03('0x32')](_0x495e98);dials[_0x1a03('0x32')](_0x495e98);agents['hangup'](_0x495e98);queues['hangup'](_0x495e98);}catch(_0x4dcbc8){utils['error'](util[_0x1a03('0x19')](_0x1a03('0x33'),_0x495e98[_0x1a03('0x1e')]),_0x4dcbc8);}});ami['on']('cdr',function(_0x294d0d){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')](_0x1a03('0x34'),_0x294d0d[_0x1a03('0x1e')]),_0x294d0d);members['cdr'](_0x294d0d);}catch(_0x291ba5){utils[_0x1a03('0x15')](util['format'](_0x1a03('0x34'),_0x294d0d['uniqueid']),_0x291ba5);}});ami['on']('blindtransfer',function(_0x12fe60){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')](_0x1a03('0x35'),_0x12fe60[_0x1a03('0x1e')]),_0x12fe60);queues[_0x1a03('0x36')](_0x12fe60);agents[_0x1a03('0x36')](_0x12fe60);transfers[_0x1a03('0x36')](_0x12fe60);recordings['blindtransfer'](_0x12fe60);}catch(_0x2f944f){utils['error'](util[_0x1a03('0x19')](_0x1a03('0x35'),_0x12fe60[_0x1a03('0x1e')]),_0x2f944f);}});ami['on'](_0x1a03('0x37'),function(_0x197e04){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')]('[%s][index][attendedtransfer]',_0x197e04[_0x1a03('0x38')]),_0x197e04);queues[_0x1a03('0x37')](_0x197e04);transfers[_0x1a03('0x37')](_0x197e04);agents[_0x1a03('0x37')](_0x197e04);calls[_0x1a03('0x37')](_0x197e04);}catch(_0x349f11){utils['error'](util['format']('[%s][index][attendedtransfer]',_0x197e04[_0x1a03('0x38')]),_0x349f11);}});ami['on']('varset',function(_0x9acf3b){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')](_0x1a03('0x39'),_0x9acf3b[_0x1a03('0x1e')]),_0x9acf3b);queues[_0x1a03('0x3a')](_0x9acf3b);recordings['varset'](_0x9acf3b);calls[_0x1a03('0x3a')](_0x9acf3b);dials[_0x1a03('0x3a')](_0x9acf3b);}catch(_0x33dc7c){utils[_0x1a03('0x15')](util[_0x1a03('0x19')]('[%s][index][varset]',_0x9acf3b[_0x1a03('0x1e')]),_0x33dc7c);}});ami['on'](_0x1a03('0x3b'),function(_0x36b125){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')](_0x1a03('0x3c'),_0x36b125[_0x1a03('0x1e')]),_0x36b125);calls[_0x1a03('0x3b')](_0x36b125);recordings[_0x1a03('0x3b')](_0x36b125);dials[_0x1a03('0x3b')](_0x36b125);}catch(_0x1e596a){utils[_0x1a03('0x15')](util[_0x1a03('0x19')](_0x1a03('0x3c'),_0x36b125[_0x1a03('0x1e')]),_0x1e596a);}});ami['on'](_0x1a03('0x3d'),function(_0x1e3314){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')](_0x1a03('0x3e'),_0x1e3314[_0x1a03('0x1e')]),_0x1e3314);calls[_0x1a03('0x3d')](_0x1e3314);recordings['newchannel'](_0x1e3314);}catch(_0x29b602){utils[_0x1a03('0x15')](util['format']('[%s][index][newchannel]',_0x1e3314[_0x1a03('0x1e')]),_0x29b602);}});ami['on']('dialbegin',function(_0x4ca77c){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')]('[%s][index][dialbegin]',_0x4ca77c[_0x1a03('0x1e')]),_0x4ca77c);dials['dialbegin'](_0x4ca77c);}catch(_0x2a10ed){utils[_0x1a03('0x15')](util[_0x1a03('0x19')](_0x1a03('0x3f'),_0x4ca77c[_0x1a03('0x1e')]),_0x2a10ed);}});ami['on']('dialend',function(_0x267805){try{utils[_0x1a03('0x20')](util[_0x1a03('0x19')]('[%s][index][dialend]',_0x267805[_0x1a03('0x1e')]),_0x267805);dials[_0x1a03('0x40')](_0x267805);}catch(_0x87e8c7){utils[_0x1a03('0x15')](util['format']('[%s][index][dialend]',_0x267805[_0x1a03('0x1e')]),_0x87e8c7);}});} \ No newline at end of file +var _0xd8e6=['managerevent','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','production','asterisk','port','username','keepConnected','XDR\x20DISABLED','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','connect','shutdown','fullybooted','error','close'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8e6,0x6f));var _0x6d8e=function(_0x17304b,_0x1a98f8){_0x17304b=_0x17304b-0x0;var _0x28894d=_0xd8e6[_0x17304b];return _0x28894d;};var AsteriskManager=require(_0x6d8e('0x0'));var config=require('../../config/environment');var utils=require(_0x6d8e('0x1'));var util=require(_0x6d8e('0x2'));var isXDREnabled=config[_0x6d8e('0x3')]&&config['xdr'][_0x6d8e('0x4')]?!config['xdr']['disabled']:!![];var isProduction=config['env']===_0x6d8e('0x5')||![];var isLocalAsterisk=config['xdr']&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x6d8e('0x6')][_0x6d8e('0x7')],config[_0x6d8e('0x6')]['ip'],config['asterisk'][_0x6d8e('0x8')],config[_0x6d8e('0x6')]['password'],!![]);ami[_0x6d8e('0x9')]();if(!isXDREnabled){utils['info'](_0x6d8e('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x6d8e('0xb')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x6d8e('0xc'));var calls=require(_0x6d8e('0xd'));var queues=require(_0x6d8e('0xe'));var recordings=require(_0x6d8e('0xf'));var members=require(_0x6d8e('0x10'));var dials=require(_0x6d8e('0x11'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0x6d8e('0x12'),core['connect']);ami['on'](_0x6d8e('0x13'),core[_0x6d8e('0x13')]);ami['on'](_0x6d8e('0x14'),core[_0x6d8e('0x14')]);ami['on'](_0x6d8e('0x15'),core[_0x6d8e('0x15')]);ami['on']('close',core[_0x6d8e('0x16')]);ami['on'](_0x6d8e('0x17'),core['managerevent']);ami['on']('devicestatechange',function(_0x582f82){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x1a'),_0x582f82[_0x6d8e('0x1b')]),_0x582f82);members['devicestatechange'](_0x582f82);}catch(_0x34939d){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')]('[%s][index][devicestatechange]',_0x582f82[_0x6d8e('0x1b')]),_0x34939d);}});ami['on'](_0x6d8e('0x1c'),function(_0x3e273e){try{utils[_0x6d8e('0x18')](util['format'](_0x6d8e('0x1d'),_0x3e273e['uniqueid']),_0x3e273e);agents['agentcalled'](_0x3e273e);}catch(_0x43952e){utils['error'](util[_0x6d8e('0x19')](_0x6d8e('0x1d'),_0x3e273e[_0x6d8e('0x1e')]),_0x43952e);}});ami['on'](_0x6d8e('0x1f'),function(_0x3889bf){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')]('[%s][index][agentringnoanswer]',_0x3889bf[_0x6d8e('0x1e')]),_0x3889bf);agents['agentringnoanswer'](_0x3889bf);}catch(_0x2e3883){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x20'),_0x3889bf[_0x6d8e('0x1e')]),_0x2e3883);}});ami['on'](_0x6d8e('0x21'),function(_0x2484fd){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')]('[%s][index][agentconnect]',_0x2484fd['uniqueid']),_0x2484fd);agents[_0x6d8e('0x21')](_0x2484fd);queues[_0x6d8e('0x21')](_0x2484fd);}catch(_0x2ad645){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x22'),_0x2484fd['uniqueid']),_0x2ad645);}});ami['on'](_0x6d8e('0x23'),function(_0x28b778){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')]('[%s][index][agentcomplete]',_0x28b778['uniqueid']),_0x28b778);agents[_0x6d8e('0x23')](_0x28b778);queues[_0x6d8e('0x23')](_0x28b778);members['agentcomplete'](_0x28b778);}catch(_0x3c92ca){utils[_0x6d8e('0x15')](util['format'](_0x6d8e('0x24'),_0x28b778['uniqueid']),_0x3c92ca);}});ami['on'](_0x6d8e('0x25'),function(_0x9c66f2){try{utils['debug'](util[_0x6d8e('0x19')](_0x6d8e('0x26'),_0x9c66f2[_0x6d8e('0x1e')]),_0x9c66f2);agents[_0x6d8e('0x25')](_0x9c66f2);queues['queuecallerabandon'](_0x9c66f2);}catch(_0x2e645c){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x26'),_0x9c66f2[_0x6d8e('0x1e')]),_0x2e645c);}});ami['on'](_0x6d8e('0x27'),function(_0x343fd4){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x28'),_0x343fd4[_0x6d8e('0x1e')]),_0x343fd4);queues[_0x6d8e('0x27')](_0x343fd4);recordings[_0x6d8e('0x27')](_0x343fd4);}catch(_0x39f591){utils['error'](util[_0x6d8e('0x19')](_0x6d8e('0x28'),_0x343fd4[_0x6d8e('0x1e')]),_0x39f591);}});ami['on']('queuecallerleave',function(_0x5b09cc){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x29'),_0x5b09cc[_0x6d8e('0x1e')]),_0x5b09cc);queues[_0x6d8e('0x2a')](_0x5b09cc);}catch(_0x32f539){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x29'),_0x5b09cc[_0x6d8e('0x1e')]),_0x32f539);}});ami['on'](_0x6d8e('0x2b'),function(_0x356bb5){try{utils[_0x6d8e('0x18')](util['format'](_0x6d8e('0x2c'),_0x356bb5['uniqueid']),_0x356bb5);queues[_0x6d8e('0x2b')](_0x356bb5);calls[_0x6d8e('0x2b')](_0x356bb5);}catch(_0x223e18){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x2c'),_0x356bb5[_0x6d8e('0x1e')]),_0x223e18);}});ami['on']('musiconholdstop',function(_0x39a33f){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x2d'),_0x39a33f[_0x6d8e('0x1e')]),_0x39a33f);queues[_0x6d8e('0x2e')](_0x39a33f);calls[_0x6d8e('0x2e')](_0x39a33f);}catch(_0x2674d6){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')]('[%s][index][musiconholdstop]',_0x39a33f[_0x6d8e('0x1e')]),_0x2674d6);}});ami['on'](_0x6d8e('0x2f'),function(_0x41c484){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x30'),_0x41c484['uniqueid']),_0x41c484);calls[_0x6d8e('0x2f')](_0x41c484);recordings[_0x6d8e('0x2f')](_0x41c484);}catch(_0x59eaea){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x30'),_0x41c484['uniqueid']),_0x59eaea);}});ami['on']('hangup',function(_0x530c84){try{utils['debug'](util[_0x6d8e('0x19')](_0x6d8e('0x31'),_0x530c84[_0x6d8e('0x1e')]),_0x530c84);calls[_0x6d8e('0x32')](_0x530c84);recordings['hangup'](_0x530c84);dials[_0x6d8e('0x32')](_0x530c84);agents[_0x6d8e('0x32')](_0x530c84);queues[_0x6d8e('0x32')](_0x530c84);}catch(_0x582790){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x31'),_0x530c84[_0x6d8e('0x1e')]),_0x582790);}});ami['on'](_0x6d8e('0x33'),function(_0x21cec0){try{utils[_0x6d8e('0x18')](util['format'](_0x6d8e('0x34'),_0x21cec0[_0x6d8e('0x1e')]),_0x21cec0);members[_0x6d8e('0x33')](_0x21cec0);}catch(_0x41ac14){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x34'),_0x21cec0[_0x6d8e('0x1e')]),_0x41ac14);}});ami['on'](_0x6d8e('0x35'),function(_0x31c49d){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x36'),_0x31c49d[_0x6d8e('0x1e')]),_0x31c49d);queues[_0x6d8e('0x35')](_0x31c49d);agents[_0x6d8e('0x35')](_0x31c49d);transfers[_0x6d8e('0x35')](_0x31c49d);recordings[_0x6d8e('0x35')](_0x31c49d);}catch(_0x3ef2cb){utils['error'](util[_0x6d8e('0x19')]('[%s][index][blindtransfer]',_0x31c49d[_0x6d8e('0x1e')]),_0x3ef2cb);}});ami['on']('attendedtransfer',function(_0x513149){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x37'),_0x513149['origtransfereruniqueid']),_0x513149);queues[_0x6d8e('0x38')](_0x513149);transfers[_0x6d8e('0x38')](_0x513149);agents[_0x6d8e('0x38')](_0x513149);calls[_0x6d8e('0x38')](_0x513149);}catch(_0x139c76){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x37'),_0x513149[_0x6d8e('0x39')]),_0x139c76);}});ami['on'](_0x6d8e('0x3a'),function(_0x38744d){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x3b'),_0x38744d[_0x6d8e('0x1e')]),_0x38744d);queues[_0x6d8e('0x3a')](_0x38744d);recordings['varset'](_0x38744d);calls['varset'](_0x38744d);dials[_0x6d8e('0x3a')](_0x38744d);}catch(_0x5b060c){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')]('[%s][index][varset]',_0x38744d[_0x6d8e('0x1e')]),_0x5b060c);}});ami['on'](_0x6d8e('0x3c'),function(_0x8df544){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x3d'),_0x8df544[_0x6d8e('0x1e')]),_0x8df544);calls['newexten'](_0x8df544);recordings[_0x6d8e('0x3c')](_0x8df544);dials[_0x6d8e('0x3c')](_0x8df544);}catch(_0x47d460){utils['error'](util[_0x6d8e('0x19')](_0x6d8e('0x3d'),_0x8df544[_0x6d8e('0x1e')]),_0x47d460);}});ami['on']('newchannel',function(_0x1d2995){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x3e'),_0x1d2995['uniqueid']),_0x1d2995);calls['newchannel'](_0x1d2995);recordings['newchannel'](_0x1d2995);}catch(_0x179fb6){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x3e'),_0x1d2995[_0x6d8e('0x1e')]),_0x179fb6);}});ami['on'](_0x6d8e('0x3f'),function(_0x247927){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')]('[%s][index][dialbegin]',_0x247927[_0x6d8e('0x1e')]),_0x247927);dials[_0x6d8e('0x3f')](_0x247927);}catch(_0x534183){utils['error'](util[_0x6d8e('0x19')](_0x6d8e('0x40'),_0x247927[_0x6d8e('0x1e')]),_0x534183);}});ami['on'](_0x6d8e('0x41'),function(_0x1c72b0){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')]('[%s][index][dialend]',_0x1c72b0[_0x6d8e('0x1e')]),_0x1c72b0);dials['dialend'](_0x1c72b0);}catch(_0x4b9639){utils[_0x6d8e('0x15')](util['format'](_0x6d8e('0x42'),_0x1c72b0[_0x6d8e('0x1e')]),_0x4b9639);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index ab1fccc..9723c79 100644 --- a/server/services/xdr/members.controller.js +++ b/server/services/xdr/members.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7097=['queue','assign','cdr','[%s][members][cdr]','channel','data1','data2','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','type','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','format','[%s][members][writeDB]','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','error','agentcomplete','[%s][members][agentcomplete]'];(function(_0x79c1a4,_0x378b01){var _0x2e8272=function(_0xcf42a4){while(--_0xcf42a4){_0x79c1a4['push'](_0x79c1a4['shift']());}};_0x2e8272(++_0x378b01);}(_0x7097,0xe0));var _0x7709=function(_0x1c0692,_0x114154){_0x1c0692=_0x1c0692-0x0;var _0x508b97=_0x7097[_0x1c0692];return _0x508b97;};'use strict';var _=require(_0x7709('0x0'));var util=require('util');var utils=require(_0x7709('0x1'));var members={};var exclude=[_0x7709('0x2'),_0x7709('0x3')];function writeDB(_0x5ba6cc){utils[_0x7709('0x4')](util['format'](_0x7709('0x5'),_0x5ba6cc[_0x7709('0x6')],_0x5ba6cc[_0x7709('0x7')],_0x5ba6cc['channel'],_0x5ba6cc['data2'],_0x5ba6cc[_0x7709('0x8')],_0x5ba6cc[_0x7709('0x9')]));if(_0x5ba6cc[_0x7709('0x7')]){utils[_0x7709('0xa')](_0x5ba6cc[_0x7709('0x7')])[_0x7709('0xb')](function(_0x49e2c2){if(_0x49e2c2){_0x5ba6cc['membername']=_0x49e2c2[_0x7709('0xc')];_0x5ba6cc[_0x7709('0xd')]=_0x49e2c2[_0x7709('0xd')];utils[_0x7709('0xe')]('CreateMemberReport',_0x5ba6cc);}else{utils[_0x7709('0xf')](_0x5ba6cc['interface'][_0x7709('0x10')]('/')[0x1])[_0x7709('0xb')](function(_0x19f1b2){if(_0x19f1b2){_0x5ba6cc[_0x7709('0x8')]=_0x19f1b2['name'];_0x5ba6cc[_0x7709('0xd')]=_0x19f1b2[_0x7709('0xd')];utils[_0x7709('0xe')](_0x7709('0x11'),_0x5ba6cc);}});}})['catch'](function(_0x4d9887){utils['error'](util[_0x7709('0x12')](_0x7709('0x13'),_0x5ba6cc[_0x7709('0x6')]),_0x4d9887);});}delete members[_0x5ba6cc[_0x7709('0x7')]];}function startsWith(_0x29d38a,_0xcdc0ae){return _[_0x7709('0x14')](_0x29d38a,function(_0x34a40b){return _['startsWith'](_0xcdc0ae,_0x34a40b);});}exports[_0x7709('0x15')]=function(_0x313f11){try{utils[_0x7709('0x16')](util[_0x7709('0x12')](_0x7709('0x17'),members[_0x313f11['device']]?members[_0x313f11[_0x7709('0x18')]][_0x7709('0x6')]:_0x313f11[_0x7709('0x18')]),_0x313f11);utils[_0x7709('0x4')](util[_0x7709('0x12')](_0x7709('0x19'),members[_0x313f11[_0x7709('0x18')]]?members[_0x313f11['device']][_0x7709('0x6')]:_0x313f11[_0x7709('0x18')],_0x313f11[_0x7709('0x1a')],_0x313f11[_0x7709('0x18')]));switch(_0x313f11[_0x7709('0x1a')]){case _0x7709('0x1b'):case _0x7709('0x1c'):if(!startsWith(exclude,_0x313f11[_0x7709('0x18')])){members[_0x313f11[_0x7709('0x18')]]={'channel':_0x7709('0x1d'),'interface':_0x313f11[_0x7709('0x18')],'type':_0x7709('0x1e'),'enterAt':utils[_0x7709('0x1f')](),'role':_0x7709('0x20')};}break;case'NOT_INUSE':if(!_[_0x7709('0x21')](members[_0x313f11[_0x7709('0x18')]])){members[_0x313f11[_0x7709('0x18')]][_0x7709('0x22')]=utils[_0x7709('0x1f')]();members[_0x313f11[_0x7709('0x18')]][_0x7709('0x23')]=utils[_0x7709('0x24')](members[_0x313f11[_0x7709('0x18')]][_0x7709('0x22')],members[_0x313f11[_0x7709('0x18')]][_0x7709('0x25')]);if(members[_0x313f11['device']]['uniqueid']){writeDB(members[_0x313f11[_0x7709('0x18')]]);}}break;default:break;}}catch(_0x47868e){utils[_0x7709('0x26')](util[_0x7709('0x12')](_0x7709('0x17'),members[_0x313f11[_0x7709('0x18')]]?members[_0x313f11[_0x7709('0x18')]]['uniqueid']:_0x313f11[_0x7709('0x18')]),_0x47868e);}};exports[_0x7709('0x27')]=function(_0x3a481a){try{if(!_['isNil'](members[_0x3a481a[_0x7709('0x7')]])){utils[_0x7709('0x16')](util['format'](_0x7709('0x28'),_0x3a481a[_0x7709('0x6')]),_0x3a481a);utils[_0x7709('0x4')](util[_0x7709('0x12')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x3a481a[_0x7709('0x6')],_0x3a481a[_0x7709('0x7')],_0x3a481a[_0x7709('0x29')]));members[_0x3a481a[_0x7709('0x7')]]=_[_0x7709('0x2a')](members[_0x3a481a['interface']],{'data4':_0x3a481a[_0x7709('0x29')],'uniqueid':_0x3a481a[_0x7709('0x6')]});}}catch(_0x4c04ae){utils[_0x7709('0x26')](util[_0x7709('0x12')](_0x7709('0x28'),_0x3a481a['uniqueid']),_0x4c04ae);}};exports[_0x7709('0x2b')]=function(_0x2957f6){try{utils[_0x7709('0x16')](util['format'](_0x7709('0x2c'),_0x2957f6[_0x7709('0x6')]),_0x2957f6);if(_0x2957f6[_0x7709('0x2d')]){var _0x2f48c6=_0x2957f6['channel']['split']('-')[0x0];if(!_[_0x7709('0x21')](members[_0x2f48c6])){members[_0x2f48c6]=_[_0x7709('0x2a')](members[_0x2f48c6],{'data1':members[_0x2f48c6][_0x7709('0x2e')]||_0x2957f6[_0x7709('0x9')],'data2':members[_0x2f48c6][_0x7709('0x2f')]||_0x2957f6['source'],'data3':members[_0x2f48c6][_0x7709('0x30')]||_0x2957f6[_0x7709('0x31')],'uniqueid':members[_0x2f48c6][_0x7709('0x6')]||_0x2957f6['uniqueid']});utils[_0x7709('0x4')](util[_0x7709('0x12')](_0x7709('0x32'),_0x2957f6['uniqueid'],members[_0x2f48c6][_0x7709('0x2e')],members[_0x2f48c6][_0x7709('0x2f')],members[_0x2f48c6][_0x7709('0x30')]));if(members[_0x2f48c6][_0x7709('0x22')]){writeDB(members[_0x2f48c6]);}}}if(_0x2957f6['destinationchannel']){var _0x4d3a70=_0x2957f6[_0x7709('0x33')][_0x7709('0x10')]('-')[0x0];if(!_[_0x7709('0x21')](members[_0x4d3a70])){members[_0x4d3a70]=_[_0x7709('0x2a')](members[_0x4d3a70],{'data1':members[_0x4d3a70][_0x7709('0x2e')]||_0x2957f6[_0x7709('0x9')],'data2':members[_0x4d3a70]['data2']||_0x2957f6[_0x7709('0x34')],'data3':members[_0x4d3a70][_0x7709('0x30')]||_0x2957f6[_0x7709('0x31')],'uniqueid':members[_0x4d3a70][_0x7709('0x6')]||_0x2957f6[_0x7709('0x6')]});utils[_0x7709('0x4')](util[_0x7709('0x12')](_0x7709('0x32'),_0x2957f6[_0x7709('0x6')],members[_0x4d3a70][_0x7709('0x2e')],members[_0x4d3a70][_0x7709('0x2f')],members[_0x4d3a70][_0x7709('0x30')]));if(members[_0x4d3a70][_0x7709('0x22')]){writeDB(members[_0x4d3a70]);}}}}catch(_0x249191){utils['error'](util[_0x7709('0x12')](_0x7709('0x2c'),_0x2957f6[_0x7709('0x6')]),_0x249191);}}; \ No newline at end of file +var _0x3164=['state','BUSY','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','[%s][members][cdr]','data1','data3','destinationchannel','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','error','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','data2','membername','type','interface','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','uniqueid','[%s][members][devicestatechange]\x20state:%s\x20interface:%s'];(function(_0x256320,_0x543d5d){var _0x570241=function(_0x24f019){while(--_0x24f019){_0x256320['push'](_0x256320['shift']());}};_0x570241(++_0x543d5d);}(_0x3164,0x182));var _0x4316=function(_0x48d3fa,_0x3808a6){_0x48d3fa=_0x48d3fa-0x0;var _0x4c4995=_0x3164[_0x48d3fa];return _0x4c4995;};'use strict';var _=require(_0x4316('0x0'));var util=require(_0x4316('0x1'));var utils=require(_0x4316('0x2'));var members={};var exclude=[_0x4316('0x3'),_0x4316('0x4')];function writeDB(_0x588480){utils[_0x4316('0x5')](util[_0x4316('0x6')](_0x4316('0x7'),_0x588480['uniqueid'],_0x588480['interface'],_0x588480[_0x4316('0x8')],_0x588480[_0x4316('0x9')],_0x588480[_0x4316('0xa')],_0x588480[_0x4316('0xb')]));if(_0x588480[_0x4316('0xc')]){utils[_0x4316('0xd')](_0x588480[_0x4316('0xc')])[_0x4316('0xe')](function(_0x3e2d05){if(_0x3e2d05){_0x588480[_0x4316('0xa')]=_0x3e2d05[_0x4316('0xf')];_0x588480[_0x4316('0x10')]=_0x3e2d05[_0x4316('0x10')];utils[_0x4316('0x11')]('CreateMemberReport',_0x588480);}else{utils[_0x4316('0x12')](_0x588480[_0x4316('0xc')][_0x4316('0x13')]('/')[0x1])[_0x4316('0xe')](function(_0x47a510){if(_0x47a510){_0x588480[_0x4316('0xa')]=_0x47a510[_0x4316('0xf')];_0x588480[_0x4316('0x10')]=_0x47a510[_0x4316('0x10')];utils['request'](_0x4316('0x14'),_0x588480);}});}})['catch'](function(_0x4d8daa){utils['error'](util[_0x4316('0x6')](_0x4316('0x15'),_0x588480['uniqueid']),_0x4d8daa);});}delete members[_0x588480[_0x4316('0xc')]];}function startsWith(_0x486a64,_0x133121){return _[_0x4316('0x16')](_0x486a64,function(_0x211d87){return _[_0x4316('0x17')](_0x133121,_0x211d87);});}exports[_0x4316('0x18')]=function(_0x2d579f){try{utils[_0x4316('0x19')](util[_0x4316('0x6')](_0x4316('0x1a'),members[_0x2d579f[_0x4316('0x1b')]]?members[_0x2d579f['device']][_0x4316('0x1c')]:_0x2d579f[_0x4316('0x1b')]),_0x2d579f);utils['info'](util['format'](_0x4316('0x1d'),members[_0x2d579f[_0x4316('0x1b')]]?members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x1c')]:_0x2d579f[_0x4316('0x1b')],_0x2d579f['state'],_0x2d579f[_0x4316('0x1b')]));switch(_0x2d579f[_0x4316('0x1e')]){case'INUSE':case _0x4316('0x1f'):if(!startsWith(exclude,_0x2d579f[_0x4316('0x1b')])){members[_0x2d579f[_0x4316('0x1b')]]={'channel':'voice','interface':_0x2d579f[_0x4316('0x1b')],'type':_0x4316('0x20'),'enterAt':utils[_0x4316('0x21')](),'role':'agent'};}break;case _0x4316('0x22'):if(!_[_0x4316('0x23')](members[_0x2d579f[_0x4316('0x1b')]])){members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x24')]=utils[_0x4316('0x21')]();members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x25')]=utils[_0x4316('0x26')](members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x24')],members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x27')]);if(members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x1c')]){writeDB(members[_0x2d579f[_0x4316('0x1b')]]);}}break;default:break;}}catch(_0x28e2a2){utils['error'](util['format'](_0x4316('0x1a'),members[_0x2d579f[_0x4316('0x1b')]]?members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x1c')]:_0x2d579f[_0x4316('0x1b')]),_0x28e2a2);}};exports['agentcomplete']=function(_0xf66a01){try{if(!_['isNil'](members[_0xf66a01[_0x4316('0xc')]])){utils['debug'](util[_0x4316('0x6')]('[%s][members][agentcomplete]',_0xf66a01[_0x4316('0x1c')]),_0xf66a01);utils[_0x4316('0x5')](util['format'](_0x4316('0x28'),_0xf66a01['uniqueid'],_0xf66a01[_0x4316('0xc')],_0xf66a01[_0x4316('0x29')]));members[_0xf66a01[_0x4316('0xc')]]=_[_0x4316('0x2a')](members[_0xf66a01[_0x4316('0xc')]],{'data4':_0xf66a01[_0x4316('0x29')],'uniqueid':_0xf66a01[_0x4316('0x1c')]});}}catch(_0x9790b8){utils['error'](util[_0x4316('0x6')](_0x4316('0x2b'),_0xf66a01['uniqueid']),_0x9790b8);}};exports['cdr']=function(_0x5f3ff9){try{utils[_0x4316('0x19')](util[_0x4316('0x6')](_0x4316('0x2c'),_0x5f3ff9[_0x4316('0x1c')]),_0x5f3ff9);if(_0x5f3ff9['channel']){var _0x67db3a=_0x5f3ff9[_0x4316('0x8')][_0x4316('0x13')]('-')[0x0];if(!_[_0x4316('0x23')](members[_0x67db3a])){members[_0x67db3a]=_[_0x4316('0x2a')](members[_0x67db3a],{'data1':members[_0x67db3a][_0x4316('0x2d')]||_0x5f3ff9['type'],'data2':members[_0x67db3a][_0x4316('0x9')]||_0x5f3ff9['source'],'data3':members[_0x67db3a][_0x4316('0x2e')]||_0x5f3ff9['destination'],'uniqueid':members[_0x67db3a][_0x4316('0x1c')]||_0x5f3ff9[_0x4316('0x1c')]});utils[_0x4316('0x5')](util[_0x4316('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5f3ff9[_0x4316('0x1c')],members[_0x67db3a][_0x4316('0x2d')],members[_0x67db3a]['data2'],members[_0x67db3a][_0x4316('0x2e')]));if(members[_0x67db3a][_0x4316('0x24')]){writeDB(members[_0x67db3a]);}}}if(_0x5f3ff9[_0x4316('0x2f')]){var _0x523093=_0x5f3ff9[_0x4316('0x2f')][_0x4316('0x13')]('-')[0x0];if(!_[_0x4316('0x23')](members[_0x523093])){members[_0x523093]=_[_0x4316('0x2a')](members[_0x523093],{'data1':members[_0x523093][_0x4316('0x2d')]||_0x5f3ff9[_0x4316('0xb')],'data2':members[_0x523093][_0x4316('0x9')]||_0x5f3ff9[_0x4316('0x30')],'data3':members[_0x523093][_0x4316('0x2e')]||_0x5f3ff9[_0x4316('0x31')],'uniqueid':members[_0x523093][_0x4316('0x1c')]||_0x5f3ff9[_0x4316('0x1c')]});utils[_0x4316('0x5')](util[_0x4316('0x6')](_0x4316('0x32'),_0x5f3ff9[_0x4316('0x1c')],members[_0x523093][_0x4316('0x2d')],members[_0x523093][_0x4316('0x9')],members[_0x523093][_0x4316('0x2e')]));if(members[_0x523093][_0x4316('0x24')]){writeDB(members[_0x523093]);}}}}catch(_0x568adf){utils[_0x4316('0x33')](util['format']('[%s][members][cdr]',_0x5f3ff9[_0x4316('0x1c')]),_0x568adf);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index affec36..f42392e 100644 --- a/server/services/xdr/queues.controller.js +++ b/server/services/xdr/queues.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1e0=['info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','[%s][queues][queuecallerjoin]','position','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallercomplete','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','debug','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','holdtime','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','membername','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash'];(function(_0x3e1ed0,_0x4e2a92){var _0x35acc1=function(_0x4125ba){while(--_0x4125ba){_0x3e1ed0['push'](_0x3e1ed0['shift']());}};_0x35acc1(++_0x4e2a92);}(_0xe1e0,0x119));var _0x0e1e=function(_0x135fab,_0x1ffab9){_0x135fab=_0x135fab-0x0;var _0x357c50=_0xe1e0[_0x135fab];return _0x357c50;};'use strict';var _=require(_0x0e1e('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x37fc96){utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')](_0x0e1e('0x3'),_0x37fc96['uniqueid'],_0x37fc96[_0x0e1e('0x4')],_0x37fc96[_0x0e1e('0x5')],_0x37fc96[_0x0e1e('0x6')],_0x37fc96[_0x0e1e('0x7')],_0x37fc96['accountcode'],_0x37fc96[_0x0e1e('0x8')]));if(_0x37fc96[_0x0e1e('0x5')]){utils['getVoiceQueueByName'](_0x37fc96['queue'])[_0x0e1e('0x9')](function(_0x27ada2){if(_0x27ada2){_0x37fc96[_0x0e1e('0xa')]=_0x27ada2[_0x0e1e('0xa')];}utils[_0x0e1e('0xb')](_0x0e1e('0xc'),_0x37fc96);});}else{utils[_0x0e1e('0xb')]('CreateVoiceQueueReport',_0x37fc96);}if(_0x37fc96[_0x0e1e('0xd')]){delete queues[_0x37fc96['transfereduniqueid']];}else{delete queues[_0x37fc96[_0x0e1e('0xe')]];}}exports['queuecallerjoin']=function(_0x6cc0ca){try{utils['debug'](util[_0x0e1e('0x2')](_0x0e1e('0xf'),_0x6cc0ca[_0x0e1e('0xe')]),_0x6cc0ca);utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x6cc0ca['uniqueid'],_0x6cc0ca['queue'],_0x6cc0ca['position']));queues[_0x6cc0ca['uniqueid']]=_['assign'](_0x6cc0ca,{'originalposition':_0x6cc0ca[_0x0e1e('0x10')],'queuecallerjoinAt':utils[_0x0e1e('0x11')](),'mohtime':0x0});}catch(_0xa7a53d){utils[_0x0e1e('0x12')](util['format'](_0x0e1e('0xf'),_0x6cc0ca['uniqueid']),_0xa7a53d);}};exports[_0x0e1e('0x13')]=function(_0x36308e){try{if(!_[_0x0e1e('0x14')](queues[_0x36308e[_0x0e1e('0xe')]])){utils['debug'](util[_0x0e1e('0x2')](_0x0e1e('0x15'),_0x36308e[_0x0e1e('0xe')]),_0x36308e);if(queues[_0x36308e[_0x0e1e('0xe')]][_0x0e1e('0x16')]){if(!queues[_0x36308e['uniqueid']]['queuecallerabandon']&&!queues[_0x36308e[_0x0e1e('0xe')]]['queuecallerexit']){queues[_0x36308e[_0x0e1e('0xe')]][_0x0e1e('0x17')]=!![];queues[_0x36308e[_0x0e1e('0xe')]]['queuecallercompleteAt']=utils[_0x0e1e('0x11')]();queues[_0x36308e[_0x0e1e('0xe')]][_0x0e1e('0x8')]=_0x0e1e('0x18');}utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x36308e[_0x0e1e('0xe')],queues[_0x36308e[_0x0e1e('0xe')]][_0x0e1e('0x19')],queues[_0x36308e[_0x0e1e('0xe')]][_0x0e1e('0x8')]));writeDB(queues[_0x36308e[_0x0e1e('0xe')]]);}else if(queues[_0x36308e['uniqueid']][_0x0e1e('0xd')]){utils['info'](util[_0x0e1e('0x2')](_0x0e1e('0x1a'),_0x36308e[_0x0e1e('0xe')],queues[_0x36308e['uniqueid']][_0x0e1e('0x19')],queues[_0x36308e[_0x0e1e('0xe')]][_0x0e1e('0xd')]));queues[queues[_0x36308e[_0x0e1e('0xe')]][_0x0e1e('0xd')]]=queues[_0x36308e[_0x0e1e('0xe')]];queues[queues[_0x36308e['uniqueid']][_0x0e1e('0xd')]][_0x0e1e('0x1b')]=0x2;delete queues[_0x36308e[_0x0e1e('0xe')]];}}}catch(_0x2a333e){utils[_0x0e1e('0x12')](util[_0x0e1e('0x2')](_0x0e1e('0x15'),_0x36308e[_0x0e1e('0xe')]),_0x2a333e);}};exports[_0x0e1e('0x1c')]=function(_0x40a972){try{utils[_0x0e1e('0x1d')](util[_0x0e1e('0x2')](_0x0e1e('0x1e'),_0x40a972[_0x0e1e('0xe')]),_0x40a972);if(!_[_0x0e1e('0x14')](_0x40a972[_0x0e1e('0x1f')]['queuestatus'])&&_0x40a972[_0x0e1e('0x20')][_0x0e1e('0x21')]()!==_0x0e1e('0x22')){if(!_['isNil'](queues[_0x40a972[_0x0e1e('0xe')]])){queues[_0x40a972[_0x0e1e('0xe')]][_0x0e1e('0x23')]=![];queues[_0x40a972[_0x0e1e('0xe')]][_0x0e1e('0x24')]=null;queues[_0x40a972[_0x0e1e('0xe')]][_0x0e1e('0x25')]=!![];queues[_0x40a972[_0x0e1e('0xe')]][_0x0e1e('0x26')]=utils['now']();queues[_0x40a972[_0x0e1e('0xe')]]['queuecallerexitreason']=_0x40a972['value'][_0x0e1e('0x21')]();utils['info'](util[_0x0e1e('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x40a972[_0x0e1e('0xe')],queues[_0x40a972[_0x0e1e('0xe')]][_0x0e1e('0x19')],_0x40a972['value'],queues[_0x40a972[_0x0e1e('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x40a972[_0x0e1e('0xe')]]);}}else if(!_[_0x0e1e('0x14')](_0x40a972[_0x0e1e('0x1f')]['queueposition'])){if(!_[_0x0e1e('0x14')](queues[_0x40a972[_0x0e1e('0xe')]])&&!queues[_0x40a972[_0x0e1e('0xe')]][_0x0e1e('0x23')]){queues[_0x40a972['uniqueid']][_0x0e1e('0x23')]=![];queues[_0x40a972[_0x0e1e('0xe')]][_0x0e1e('0x24')]=null;queues[_0x40a972[_0x0e1e('0xe')]][_0x0e1e('0x25')]=!![];queues[_0x40a972[_0x0e1e('0xe')]][_0x0e1e('0x26')]=utils[_0x0e1e('0x11')]();queues[_0x40a972['uniqueid']][_0x0e1e('0x8')]='EXITWITHKEY';utils[_0x0e1e('0x1')](util['format'](_0x0e1e('0x27'),_0x40a972[_0x0e1e('0xe')],queues[_0x40a972[_0x0e1e('0xe')]][_0x0e1e('0x19')],_0x40a972[_0x0e1e('0x20')],queues[_0x40a972[_0x0e1e('0xe')]]['queuecallerexitreason']));}}}catch(_0x1164b5){utils[_0x0e1e('0x12')](util['format']('[%s][queues][varset]',_0x40a972[_0x0e1e('0xe')]),_0x1164b5);}};exports[_0x0e1e('0x23')]=function(_0x4a939f){try{if(!_[_0x0e1e('0x14')](queues[_0x4a939f[_0x0e1e('0xe')]])){utils[_0x0e1e('0x1d')](util[_0x0e1e('0x2')](_0x0e1e('0x28'),_0x4a939f['uniqueid']),_0x4a939f);queues[_0x4a939f['uniqueid']]['queuecallerexit']=![];queues[_0x4a939f[_0x0e1e('0xe')]][_0x0e1e('0x26')]=null;queues[_0x4a939f[_0x0e1e('0xe')]][_0x0e1e('0x23')]=!![];queues[_0x4a939f[_0x0e1e('0xe')]]['queuecallerabandonAt']=utils[_0x0e1e('0x11')]();queues[_0x4a939f[_0x0e1e('0xe')]][_0x0e1e('0x8')]='ABANDONED';utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')](_0x0e1e('0x29'),_0x4a939f[_0x0e1e('0xe')],queues[_0x4a939f[_0x0e1e('0xe')]][_0x0e1e('0x19')],queues[_0x4a939f[_0x0e1e('0xe')]][_0x0e1e('0x8')]));}}catch(_0x4b3469){utils[_0x0e1e('0x12')](util[_0x0e1e('0x2')](_0x0e1e('0x28'),_0x4a939f[_0x0e1e('0xe')]),_0x4b3469);}};exports[_0x0e1e('0x2a')]=function(_0x257b60){try{if(!_['isNil'](queues[_0x257b60[_0x0e1e('0xe')]])){utils[_0x0e1e('0x1d')](util[_0x0e1e('0x2')](_0x0e1e('0x2b'),_0x257b60[_0x0e1e('0xe')]),_0x257b60);utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x257b60[_0x0e1e('0xe')],queues[_0x257b60['uniqueid']][_0x0e1e('0x19')],_0x257b60[_0x0e1e('0x2c')],_0x257b60['connectedlinename']));queues[_0x257b60['uniqueid']][_0x0e1e('0x2a')]=!![];queues[_0x257b60[_0x0e1e('0xe')]][_0x0e1e('0x16')]=utils[_0x0e1e('0x11')]();queues[_0x257b60['uniqueid']][_0x0e1e('0x2d')]=utils[_0x0e1e('0x2e')](queues[_0x257b60['uniqueid']][_0x0e1e('0x16')],queues[_0x257b60['uniqueid']]['queuecallerjoinAt']);queues[_0x257b60[_0x0e1e('0xe')]][_0x0e1e('0x10')]=_0x257b60[_0x0e1e('0x10')];queues[_0x257b60[_0x0e1e('0xe')]][_0x0e1e('0x2f')]=_0x257b60[_0x0e1e('0x2f')];queues[_0x257b60[_0x0e1e('0xe')]][_0x0e1e('0x2c')]=_0x257b60[_0x0e1e('0x2c')];queues[_0x257b60[_0x0e1e('0xe')]][_0x0e1e('0x30')]=_0x257b60[_0x0e1e('0x30')];}}catch(_0x7e7341){utils[_0x0e1e('0x12')](util['format'](_0x0e1e('0x2b'),_0x257b60[_0x0e1e('0xe')]),_0x7e7341);}};exports[_0x0e1e('0x31')]=function(_0x3f1188){try{if(!_[_0x0e1e('0x14')](queues[_0x3f1188[_0x0e1e('0xe')]])){utils[_0x0e1e('0x1d')](util[_0x0e1e('0x2')](_0x0e1e('0x32'),_0x3f1188[_0x0e1e('0xe')]),_0x3f1188);utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3f1188['uniqueid'],queues[_0x3f1188['uniqueid']][_0x0e1e('0x19')],_0x3f1188['membername'],_0x3f1188[_0x0e1e('0x33')]));queues[_0x3f1188['uniqueid']]['queuecallerabandon']=![];queues[_0x3f1188[_0x0e1e('0xe')]][_0x0e1e('0x23')]=![];queues[_0x3f1188['uniqueid']][_0x0e1e('0x24')]=null;queues[_0x3f1188[_0x0e1e('0xe')]][_0x0e1e('0x25')]=![];queues[_0x3f1188[_0x0e1e('0xe')]][_0x0e1e('0x8')]=null;queues[_0x3f1188['uniqueid']]['queuecallerexitAt']=null;queues[_0x3f1188[_0x0e1e('0xe')]][_0x0e1e('0x34')]=!![];queues[_0x3f1188[_0x0e1e('0xe')]]['accountcode']=_0x3f1188['destaccountcode'];queues[_0x3f1188[_0x0e1e('0xe')]][_0x0e1e('0x6')]=_0x3f1188[_0x0e1e('0x35')];}}catch(_0x50b9fc){utils[_0x0e1e('0x12')](util['format'](_0x0e1e('0x32'),_0x3f1188[_0x0e1e('0xe')]),_0x50b9fc);}};exports['agentcomplete']=function(_0x162098){try{if(!_[_0x0e1e('0x14')](queues[_0x162098[_0x0e1e('0xe')]])){if(queues[_0x162098[_0x0e1e('0xe')]][_0x0e1e('0x16')]){utils[_0x0e1e('0x1d')](util[_0x0e1e('0x2')](_0x0e1e('0x36'),_0x162098['uniqueid']),_0x162098);queues[_0x162098[_0x0e1e('0xe')]][_0x0e1e('0x23')]=![];queues[_0x162098[_0x0e1e('0xe')]][_0x0e1e('0x23')]=![];queues[_0x162098[_0x0e1e('0xe')]][_0x0e1e('0x24')]=null;queues[_0x162098[_0x0e1e('0xe')]][_0x0e1e('0x25')]=![];queues[_0x162098['uniqueid']][_0x0e1e('0x26')]=null;queues[_0x162098[_0x0e1e('0xe')]]['assigned']=!![];queues[_0x162098[_0x0e1e('0xe')]][_0x0e1e('0x6')]=_0x162098[_0x0e1e('0x35')];queues[_0x162098[_0x0e1e('0xe')]]['queuecallercomplete']=!![];queues[_0x162098['uniqueid']][_0x0e1e('0x37')]=utils[_0x0e1e('0x11')]();if(_0x162098[_0x0e1e('0x38')]==_0x0e1e('0x39')){if(!queues[_0x162098[_0x0e1e('0xe')]]['transfer']){queues[_0x162098['uniqueid']][_0x0e1e('0x8')]=_0x0e1e('0x3a');}}else{queues[_0x162098[_0x0e1e('0xe')]]['queuecallerexitreason']=_0x0e1e('0x3b')+_0x162098['reason'][_0x0e1e('0x21')]();}utils['info'](util[_0x0e1e('0x2')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x162098[_0x0e1e('0xe')],queues[_0x162098[_0x0e1e('0xe')]][_0x0e1e('0x19')],_0x162098[_0x0e1e('0x35')],queues[_0x162098['uniqueid']][_0x0e1e('0x8')]));writeDB(queues[_0x162098[_0x0e1e('0xe')]]);}}}catch(_0x5ba0d8){utils[_0x0e1e('0x12')](util[_0x0e1e('0x2')](_0x0e1e('0x36'),_0x162098[_0x0e1e('0xe')]),_0x5ba0d8);}};exports[_0x0e1e('0x3c')]=function(_0x27908d){try{if(!_['isNil'](queues[_0x27908d[_0x0e1e('0x3d')]])){utils[_0x0e1e('0x1d')](util[_0x0e1e('0x2')](_0x0e1e('0x3e'),_0x27908d[_0x0e1e('0xe')]),_0x27908d);queues[_0x27908d[_0x0e1e('0x3d')]][_0x0e1e('0x39')]=!![];queues[_0x27908d[_0x0e1e('0x3d')]][_0x0e1e('0x3f')]=_0x0e1e('0x40');queues[_0x27908d[_0x0e1e('0x3d')]][_0x0e1e('0x41')]=_0x27908d['extension'];queues[_0x27908d['transfereeuniqueid']]['transferuniqueid']=_0x27908d[_0x0e1e('0x3d')];queues[_0x27908d[_0x0e1e('0x3d')]][_0x0e1e('0x8')]='BLINDTRANSFER';utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x27908d[_0x0e1e('0xe')],queues[_0x27908d[_0x0e1e('0x3d')]]['name'],_0x27908d[_0x0e1e('0x3d')],_0x27908d[_0x0e1e('0x42')]));}}catch(_0x73bae6){utils[_0x0e1e('0x12')](util[_0x0e1e('0x2')](_0x0e1e('0x3e'),_0x27908d[_0x0e1e('0xe')]),_0x73bae6);}};exports['attendedtransfer']=function(_0x1fac76){try{utils[_0x0e1e('0x1d')](util['format'](_0x0e1e('0x43'),_0x1fac76['origtransfereruniqueid']),_0x1fac76);if(_0x1fac76[_0x0e1e('0x44')]==_0x1fac76['origtransfererlinkedid']){if(!_[_0x0e1e('0x14')](queues[_0x1fac76[_0x0e1e('0x45')]])){utils[_0x0e1e('0x1')](util['format'](_0x0e1e('0x46'),_0x1fac76[_0x0e1e('0x44')],queues[_0x1fac76[_0x0e1e('0x45')]][_0x0e1e('0x19')],_0x1fac76[_0x0e1e('0x47')]));queues[_0x1fac76[_0x0e1e('0x45')]][_0x0e1e('0x39')]=!![];queues[_0x1fac76[_0x0e1e('0x45')]][_0x0e1e('0x3f')]=_0x0e1e('0x48');queues[_0x1fac76[_0x0e1e('0x45')]][_0x0e1e('0x41')]=_0x1fac76[_0x0e1e('0x47')];queues[_0x1fac76[_0x0e1e('0x45')]][_0x0e1e('0x49')]=_0x1fac76[_0x0e1e('0x44')];queues[_0x1fac76[_0x0e1e('0x45')]][_0x0e1e('0x8')]=_0x0e1e('0x4a');}if(!_[_0x0e1e('0x14')](queues[_0x1fac76[_0x0e1e('0x4b')]])){if(_0x1fac76[_0x0e1e('0x4c')]&&queues[_0x1fac76[_0x0e1e('0x4c')]]){queues[_0x1fac76[_0x0e1e('0x4c')]]['queuecallerenterreason']=0x1;queues[_0x1fac76[_0x0e1e('0x3d')]]=_[_0x0e1e('0x4d')](queues[_0x1fac76[_0x0e1e('0x4c')]]);queues[_0x1fac76['transfereeuniqueid']]['transfereduniqueid']=_0x1fac76[_0x0e1e('0x4e')];queues[_0x1fac76[_0x0e1e('0x3d')]][_0x0e1e('0x1b')]=0x2;queues[_0x1fac76[_0x0e1e('0x3d')]][_0x0e1e('0x7')]=queues[_0x1fac76['secondtransfererlinkedid']][_0x0e1e('0x7')];queues[_0x1fac76[_0x0e1e('0x3d')]][_0x0e1e('0x4f')]=queues[_0x1fac76[_0x0e1e('0x45')]][_0x0e1e('0x4f')];queues[_0x1fac76[_0x0e1e('0x3d')]][_0x0e1e('0x50')]=utils[_0x0e1e('0x11')]();queues[_0x1fac76[_0x0e1e('0x3d')]]['queuecallerleaveAt']=utils[_0x0e1e('0x11')]();queues[_0x1fac76['transfereeuniqueid']][_0x0e1e('0x2d')]=0x0;queues[_0x1fac76[_0x0e1e('0x3d')]]['mohtime']=0x0;utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')](_0x0e1e('0x51'),_0x1fac76[_0x0e1e('0x44')],queues[_0x1fac76[_0x0e1e('0x3d')]][_0x0e1e('0x19')],queues[_0x1fac76[_0x0e1e('0x3d')]][_0x0e1e('0x7')],queues[_0x1fac76[_0x0e1e('0x3d')]][_0x0e1e('0x4f')]));}else{utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1fac76['origtransfereruniqueid'],queues[_0x1fac76[_0x0e1e('0x4b')]]['name'],_0x1fac76[_0x0e1e('0x45')]));queues[_0x1fac76[_0x0e1e('0x4b')]]['transfereduniqueid']=_0x1fac76[_0x0e1e('0x45')];}}}else if(_0x1fac76[_0x0e1e('0x52')]==_0x1fac76[_0x0e1e('0x45')]){if(!_[_0x0e1e('0x14')](queues[_0x1fac76[_0x0e1e('0x4b')]])){utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1fac76[_0x0e1e('0x44')],queues[_0x1fac76[_0x0e1e('0x4b')]][_0x0e1e('0x19')],_0x1fac76[_0x0e1e('0x52')],_0x1fac76[_0x0e1e('0x53')]));queues[_0x1fac76[_0x0e1e('0x4b')]][_0x0e1e('0x39')]=!![];queues[_0x1fac76['origtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x1fac76[_0x0e1e('0x4b')]][_0x0e1e('0x41')]=_0x1fac76[_0x0e1e('0x53')];queues[_0x1fac76['origtransfererlinkedid']]['transferuniqueid']=_0x1fac76[_0x0e1e('0x52')];queues[_0x1fac76[_0x0e1e('0x4b')]]['queuecallerexitreason']=_0x0e1e('0x4a');}if(!_[_0x0e1e('0x14')](queues[_0x1fac76[_0x0e1e('0x45')]])){if(_0x1fac76[_0x0e1e('0x54')]&&queues[_0x1fac76[_0x0e1e('0x54')]]){queues[_0x1fac76[_0x0e1e('0x54')]][_0x0e1e('0x1b')]=0x1;queues[_0x1fac76['transfertargetuniqueid']]=_[_0x0e1e('0x4d')](queues[_0x1fac76[_0x0e1e('0x54')]]);queues[_0x1fac76[_0x0e1e('0x4e')]][_0x0e1e('0xd')]=_0x1fac76[_0x0e1e('0x4e')];queues[_0x1fac76[_0x0e1e('0x4e')]][_0x0e1e('0x1b')]=0x2;queues[_0x1fac76[_0x0e1e('0x4e')]][_0x0e1e('0x7')]=queues[_0x1fac76[_0x0e1e('0x4b')]][_0x0e1e('0x7')];queues[_0x1fac76[_0x0e1e('0x4e')]]['calleridname']=queues[_0x1fac76['origtransfererlinkedid']][_0x0e1e('0x4f')];queues[_0x1fac76['transfertargetuniqueid']][_0x0e1e('0x50')]=utils['now']();queues[_0x1fac76[_0x0e1e('0x4e')]][_0x0e1e('0x16')]=utils[_0x0e1e('0x11')]();queues[_0x1fac76[_0x0e1e('0x4e')]][_0x0e1e('0x2d')]=0x0;queues[_0x1fac76[_0x0e1e('0x4e')]][_0x0e1e('0x55')]=0x0;utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1fac76[_0x0e1e('0x44')],queues[_0x1fac76[_0x0e1e('0x4e')]][_0x0e1e('0x19')],queues[_0x1fac76['transfertargetuniqueid']][_0x0e1e('0xd')],queues[_0x1fac76[_0x0e1e('0x4e')]]['calleridnum'],queues[_0x1fac76['transfertargetuniqueid']]['calleridname']));}else{utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')](_0x0e1e('0x56'),_0x1fac76[_0x0e1e('0x44')],queues[_0x1fac76['secondtransfererlinkedid']][_0x0e1e('0x19')],_0x1fac76[_0x0e1e('0x4b')]));queues[_0x1fac76[_0x0e1e('0x45')]][_0x0e1e('0xd')]=_0x1fac76[_0x0e1e('0x4b')];}}}}catch(_0x1419b7){utils[_0x0e1e('0x12')](util[_0x0e1e('0x2')](_0x0e1e('0x43'),_0x1fac76[_0x0e1e('0x44')]),_0x1419b7);}};exports[_0x0e1e('0x57')]=function(_0x1a94b3){try{if(!_[_0x0e1e('0x14')](queues[_0x1a94b3[_0x0e1e('0xe')]])){utils['debug'](util['format'](_0x0e1e('0x58'),_0x1a94b3['uniqueid']),_0x1a94b3);queues[_0x1a94b3[_0x0e1e('0xe')]]['musiconholdstartAt']=utils['now']();utils['info'](util[_0x0e1e('0x2')](_0x0e1e('0x59'),_0x1a94b3['uniqueid'],queues[_0x1a94b3[_0x0e1e('0xe')]][_0x0e1e('0x19')],queues[_0x1a94b3[_0x0e1e('0xe')]][_0x0e1e('0x5a')]));}}catch(_0x3be5de){utils[_0x0e1e('0x12')](util[_0x0e1e('0x2')](_0x0e1e('0x58'),_0x1a94b3[_0x0e1e('0xe')]),_0x3be5de);}};exports[_0x0e1e('0x5b')]=function(_0x4927dc){try{if(!_[_0x0e1e('0x14')](queues[_0x4927dc['uniqueid']])){if(!_[_0x0e1e('0x14')](queues[_0x4927dc[_0x0e1e('0xe')]][_0x0e1e('0x5a')])){utils[_0x0e1e('0x1d')](util[_0x0e1e('0x2')](_0x0e1e('0x5c'),_0x4927dc[_0x0e1e('0xe')]),_0x4927dc);queues[_0x4927dc[_0x0e1e('0xe')]][_0x0e1e('0x55')]+=utils[_0x0e1e('0x2e')](utils[_0x0e1e('0x11')](),queues[_0x4927dc[_0x0e1e('0xe')]][_0x0e1e('0x5a')]);utils[_0x0e1e('0x1')](util[_0x0e1e('0x2')](_0x0e1e('0x5d'),_0x4927dc['uniqueid'],queues[_0x4927dc[_0x0e1e('0xe')]][_0x0e1e('0x19')],queues[_0x4927dc[_0x0e1e('0xe')]]['mohtime']));delete queues[_0x4927dc[_0x0e1e('0xe')]][_0x0e1e('0x5a')];}}}catch(_0x2f5d7c){utils['error'](util[_0x0e1e('0x2')](_0x0e1e('0x5c'),_0x4927dc['uniqueid']),_0x2f5d7c);}}; \ No newline at end of file +var _0x959c=['calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','format','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone'];(function(_0x152c99,_0x4b5e30){var _0x5ccf95=function(_0x269259){while(--_0x269259){_0x152c99['push'](_0x152c99['shift']());}};_0x5ccf95(++_0x4b5e30);}(_0x959c,0x19f));var _0xc959=function(_0x4a40a4,_0x50d977){_0x4a40a4=_0x4a40a4-0x0;var _0x34cfe1=_0x959c[_0x4a40a4];return _0x34cfe1;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xc959('0x0'));var queues={};function writeDB(_0x50b2cc){utils[_0xc959('0x1')](util['format'](_0xc959('0x2'),_0x50b2cc[_0xc959('0x3')],_0x50b2cc[_0xc959('0x4')],_0x50b2cc['queue'],_0x50b2cc[_0xc959('0x5')],_0x50b2cc[_0xc959('0x6')],_0x50b2cc[_0xc959('0x7')],_0x50b2cc[_0xc959('0x8')]));if(_0x50b2cc[_0xc959('0x9')]){utils[_0xc959('0xa')](_0x50b2cc[_0xc959('0x9')])[_0xc959('0xb')](function(_0x38e26a){if(_0x38e26a){_0x50b2cc[_0xc959('0xc')]=_0x38e26a[_0xc959('0xc')];}utils[_0xc959('0xd')](_0xc959('0xe'),_0x50b2cc);});}else{utils[_0xc959('0xd')](_0xc959('0xe'),_0x50b2cc);}if(_0x50b2cc[_0xc959('0xf')]){delete queues[_0x50b2cc[_0xc959('0xf')]];}else{delete queues[_0x50b2cc[_0xc959('0x3')]];}}exports[_0xc959('0x10')]=function(_0xb642ff){try{utils[_0xc959('0x11')](util['format'](_0xc959('0x12'),_0xb642ff['uniqueid']),_0xb642ff);utils['info'](util[_0xc959('0x13')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0xb642ff[_0xc959('0x3')],_0xb642ff[_0xc959('0x9')],_0xb642ff[_0xc959('0x14')]));queues[_0xb642ff['uniqueid']]=_[_0xc959('0x15')](_0xb642ff,{'originalposition':_0xb642ff[_0xc959('0x14')],'queuecallerjoinAt':utils[_0xc959('0x16')](),'mohtime':0x0});}catch(_0x27b7be){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x12'),_0xb642ff[_0xc959('0x3')]),_0x27b7be);}};exports['hangup']=function(_0x190278){try{if(!_[_0xc959('0x18')](queues[_0x190278[_0xc959('0x3')]])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x19'),_0x190278[_0xc959('0x3')]),_0x190278);if(queues[_0x190278[_0xc959('0x3')]][_0xc959('0x1a')]){if(!queues[_0x190278['uniqueid']][_0xc959('0x1b')]&&!queues[_0x190278[_0xc959('0x3')]][_0xc959('0x1c')]){queues[_0x190278['uniqueid']][_0xc959('0x1d')]=!![];queues[_0x190278[_0xc959('0x3')]][_0xc959('0x1e')]=utils[_0xc959('0x16')]();queues[_0x190278[_0xc959('0x3')]][_0xc959('0x8')]=_0xc959('0x1f');}utils[_0xc959('0x1')](util[_0xc959('0x13')](_0xc959('0x20'),_0x190278['uniqueid'],queues[_0x190278['uniqueid']][_0xc959('0x21')],queues[_0x190278[_0xc959('0x3')]][_0xc959('0x8')]));writeDB(queues[_0x190278[_0xc959('0x3')]]);}else if(queues[_0x190278[_0xc959('0x3')]][_0xc959('0xf')]){utils['info'](util[_0xc959('0x13')](_0xc959('0x22'),_0x190278[_0xc959('0x3')],queues[_0x190278[_0xc959('0x3')]][_0xc959('0x21')],queues[_0x190278[_0xc959('0x3')]][_0xc959('0xf')]));queues[queues[_0x190278[_0xc959('0x3')]][_0xc959('0xf')]]=queues[_0x190278[_0xc959('0x3')]];queues[queues[_0x190278[_0xc959('0x3')]]['transfereduniqueid']][_0xc959('0x23')]=0x2;delete queues[_0x190278['uniqueid']];}}}catch(_0x5c619d){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x19'),_0x190278[_0xc959('0x3')]),_0x5c619d);}};exports[_0xc959('0x24')]=function(_0x148823){try{utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x25'),_0x148823[_0xc959('0x3')]),_0x148823);if(!_[_0xc959('0x18')](_0x148823[_0xc959('0x26')]['queuestatus'])&&_0x148823[_0xc959('0x27')][_0xc959('0x28')]()!==_0xc959('0x29')){if(!_[_0xc959('0x18')](queues[_0x148823[_0xc959('0x3')]])){queues[_0x148823[_0xc959('0x3')]][_0xc959('0x1b')]=![];queues[_0x148823[_0xc959('0x3')]][_0xc959('0x2a')]=null;queues[_0x148823[_0xc959('0x3')]][_0xc959('0x1c')]=!![];queues[_0x148823[_0xc959('0x3')]]['queuecallerexitAt']=utils[_0xc959('0x16')]();queues[_0x148823[_0xc959('0x3')]][_0xc959('0x8')]=_0x148823[_0xc959('0x27')]['toUpperCase']();utils[_0xc959('0x1')](util[_0xc959('0x13')](_0xc959('0x2b'),_0x148823[_0xc959('0x3')],queues[_0x148823[_0xc959('0x3')]][_0xc959('0x21')],_0x148823['value'],queues[_0x148823[_0xc959('0x3')]][_0xc959('0x8')]));writeDB(queues[_0x148823[_0xc959('0x3')]]);}}else if(!_[_0xc959('0x18')](_0x148823[_0xc959('0x26')][_0xc959('0x2c')])){if(!_[_0xc959('0x18')](queues[_0x148823[_0xc959('0x3')]])&&!queues[_0x148823[_0xc959('0x3')]]['queuecallerabandon']){queues[_0x148823['uniqueid']][_0xc959('0x1b')]=![];queues[_0x148823['uniqueid']]['queuecallerabandonAt']=null;queues[_0x148823[_0xc959('0x3')]][_0xc959('0x1c')]=!![];queues[_0x148823[_0xc959('0x3')]][_0xc959('0x2d')]=utils['now']();queues[_0x148823[_0xc959('0x3')]][_0xc959('0x8')]=_0xc959('0x2e');utils[_0xc959('0x1')](util['format'](_0xc959('0x2f'),_0x148823[_0xc959('0x3')],queues[_0x148823[_0xc959('0x3')]][_0xc959('0x21')],_0x148823[_0xc959('0x27')],queues[_0x148823['uniqueid']][_0xc959('0x8')]));}}}catch(_0x39c4a2){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x25'),_0x148823[_0xc959('0x3')]),_0x39c4a2);}};exports[_0xc959('0x1b')]=function(_0x2cb6fe){try{if(!_[_0xc959('0x18')](queues[_0x2cb6fe[_0xc959('0x3')]])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x30'),_0x2cb6fe[_0xc959('0x3')]),_0x2cb6fe);queues[_0x2cb6fe[_0xc959('0x3')]][_0xc959('0x1c')]=![];queues[_0x2cb6fe[_0xc959('0x3')]][_0xc959('0x2d')]=null;queues[_0x2cb6fe[_0xc959('0x3')]]['queuecallerabandon']=!![];queues[_0x2cb6fe[_0xc959('0x3')]][_0xc959('0x2a')]=utils[_0xc959('0x16')]();queues[_0x2cb6fe[_0xc959('0x3')]][_0xc959('0x8')]=_0xc959('0x31');utils[_0xc959('0x1')](util[_0xc959('0x13')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2cb6fe[_0xc959('0x3')],queues[_0x2cb6fe[_0xc959('0x3')]]['name'],queues[_0x2cb6fe[_0xc959('0x3')]]['queuecallerexitreason']));}}catch(_0x3fe969){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x30'),_0x2cb6fe[_0xc959('0x3')]),_0x3fe969);}};exports[_0xc959('0x32')]=function(_0x3cf53b){try{if(!_[_0xc959('0x18')](queues[_0x3cf53b['uniqueid']])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x33'),_0x3cf53b['uniqueid']),_0x3cf53b);utils[_0xc959('0x1')](util['format'](_0xc959('0x34'),_0x3cf53b[_0xc959('0x3')],queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x21')],_0x3cf53b[_0xc959('0x35')],_0x3cf53b[_0xc959('0x36')]));queues[_0x3cf53b['uniqueid']][_0xc959('0x32')]=!![];queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x1a')]=utils[_0xc959('0x16')]();queues[_0x3cf53b['uniqueid']]['holdtime']=utils[_0xc959('0x37')](queues[_0x3cf53b['uniqueid']][_0xc959('0x1a')],queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x38')]);queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x14')]=_0x3cf53b[_0xc959('0x14')];queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x39')]=_0x3cf53b[_0xc959('0x39')];queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x35')]=_0x3cf53b['connectedlinenum'];queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x36')]=_0x3cf53b[_0xc959('0x36')];}}catch(_0x219b51){utils[_0xc959('0x17')](util[_0xc959('0x13')]('[%s][queues][queuecallerleave]',_0x3cf53b[_0xc959('0x3')]),_0x219b51);}};exports[_0xc959('0x3a')]=function(_0x3e7b1b){try{if(!_['isNil'](queues[_0x3e7b1b[_0xc959('0x3')]])){utils[_0xc959('0x11')](util['format'](_0xc959('0x3b'),_0x3e7b1b['uniqueid']),_0x3e7b1b);utils[_0xc959('0x1')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3e7b1b['uniqueid'],queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x21')],_0x3e7b1b[_0xc959('0x3c')],_0x3e7b1b[_0xc959('0x3d')]));queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x1b')]=![];queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x1b')]=![];queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x2a')]=null;queues[_0x3e7b1b[_0xc959('0x3')]]['queuecallerexit']=![];queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x8')]=null;queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x2d')]=null;queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x3e')]=!![];queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x7')]=_0x3e7b1b[_0xc959('0x3d')];queues[_0x3e7b1b['uniqueid']][_0xc959('0x5')]=_0x3e7b1b[_0xc959('0x3c')];}}catch(_0x53aff6){utils[_0xc959('0x17')](util['format'](_0xc959('0x3b'),_0x3e7b1b[_0xc959('0x3')]),_0x53aff6);}};exports[_0xc959('0x3f')]=function(_0x2b24ae){try{if(!_['isNil'](queues[_0x2b24ae[_0xc959('0x3')]])){if(queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x1a')]){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x40'),_0x2b24ae[_0xc959('0x3')]),_0x2b24ae);queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x1b')]=![];queues[_0x2b24ae['uniqueid']][_0xc959('0x1b')]=![];queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x2a')]=null;queues[_0x2b24ae[_0xc959('0x3')]]['queuecallerexit']=![];queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x2d')]=null;queues[_0x2b24ae['uniqueid']][_0xc959('0x3e')]=!![];queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x5')]=_0x2b24ae[_0xc959('0x3c')];queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x1d')]=!![];queues[_0x2b24ae[_0xc959('0x3')]]['queuecallercompleteAt']=utils[_0xc959('0x16')]();if(_0x2b24ae['reason']==_0xc959('0x41')){if(!queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x41')]){queues[_0x2b24ae[_0xc959('0x3')]]['queuecallerexitreason']=_0xc959('0x42');}}else{queues[_0x2b24ae[_0xc959('0x3')]]['queuecallerexitreason']='COMPLETEDBY'+_0x2b24ae['reason'][_0xc959('0x28')]();}utils['info'](util['format'](_0xc959('0x43'),_0x2b24ae['uniqueid'],queues[_0x2b24ae['uniqueid']][_0xc959('0x21')],_0x2b24ae[_0xc959('0x3c')],queues[_0x2b24ae['uniqueid']][_0xc959('0x8')]));writeDB(queues[_0x2b24ae['uniqueid']]);}}}catch(_0x3d33a3){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x40'),_0x2b24ae[_0xc959('0x3')]),_0x3d33a3);}};exports[_0xc959('0x44')]=function(_0x2317b5){try{if(!_[_0xc959('0x18')](queues[_0x2317b5[_0xc959('0x45')]])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x46'),_0x2317b5[_0xc959('0x3')]),_0x2317b5);queues[_0x2317b5[_0xc959('0x45')]][_0xc959('0x41')]=!![];queues[_0x2317b5[_0xc959('0x45')]][_0xc959('0x47')]='BLIND';queues[_0x2317b5['transfereeuniqueid']][_0xc959('0x48')]=_0x2317b5[_0xc959('0x49')];queues[_0x2317b5[_0xc959('0x45')]][_0xc959('0x4a')]=_0x2317b5[_0xc959('0x45')];queues[_0x2317b5[_0xc959('0x45')]][_0xc959('0x8')]=_0xc959('0x4b');utils[_0xc959('0x1')](util[_0xc959('0x13')](_0xc959('0x4c'),_0x2317b5['uniqueid'],queues[_0x2317b5['transfereeuniqueid']][_0xc959('0x21')],_0x2317b5[_0xc959('0x45')],_0x2317b5[_0xc959('0x49')]));}}catch(_0x12ed11){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x46'),_0x2317b5['uniqueid']),_0x12ed11);}};exports['attendedtransfer']=function(_0x22da07){try{utils[_0xc959('0x11')](util[_0xc959('0x13')]('[%s][queues][attendedtransfer]',_0x22da07[_0xc959('0x4d')]),_0x22da07);if(_0x22da07[_0xc959('0x4d')]==_0x22da07[_0xc959('0x4e')]){if(!_[_0xc959('0x18')](queues[_0x22da07[_0xc959('0x4f')]])){utils['info'](util[_0xc959('0x13')](_0xc959('0x50'),_0x22da07[_0xc959('0x4d')],queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x21')],_0x22da07['origtransfererexten']));queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x41')]=!![];queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x47')]=_0xc959('0x51');queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x48')]=_0x22da07['origtransfererexten'];queues[_0x22da07['secondtransfererlinkedid']]['transferuniqueid']=_0x22da07[_0xc959('0x4d')];queues[_0x22da07[_0xc959('0x4f')]]['queuecallerexitreason']=_0xc959('0x52');}if(!_[_0xc959('0x18')](queues[_0x22da07[_0xc959('0x4e')]])){if(_0x22da07[_0xc959('0x53')]&&queues[_0x22da07['transfereelinkedid']]){queues[_0x22da07[_0xc959('0x53')]][_0xc959('0x23')]=0x1;queues[_0x22da07[_0xc959('0x45')]]=_[_0xc959('0x54')](queues[_0x22da07[_0xc959('0x53')]]);queues[_0x22da07[_0xc959('0x45')]][_0xc959('0xf')]=_0x22da07['transfertargetuniqueid'];queues[_0x22da07['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x22da07[_0xc959('0x45')]][_0xc959('0x6')]=queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x6')];queues[_0x22da07[_0xc959('0x45')]][_0xc959('0x55')]=queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x55')];queues[_0x22da07[_0xc959('0x45')]]['queuecallerjoinAt']=utils[_0xc959('0x16')]();queues[_0x22da07[_0xc959('0x45')]]['queuecallerleaveAt']=utils[_0xc959('0x16')]();queues[_0x22da07['transfereeuniqueid']][_0xc959('0x56')]=0x0;queues[_0x22da07[_0xc959('0x45')]][_0xc959('0x57')]=0x0;utils[_0xc959('0x1')](util[_0xc959('0x13')](_0xc959('0x58'),_0x22da07[_0xc959('0x4d')],queues[_0x22da07[_0xc959('0x45')]]['name'],queues[_0x22da07[_0xc959('0x45')]][_0xc959('0x6')],queues[_0x22da07[_0xc959('0x45')]][_0xc959('0x55')]));}else{utils[_0xc959('0x1')](util[_0xc959('0x13')](_0xc959('0x59'),_0x22da07[_0xc959('0x4d')],queues[_0x22da07['origtransfererlinkedid']][_0xc959('0x21')],_0x22da07[_0xc959('0x4f')]));queues[_0x22da07[_0xc959('0x4e')]]['transfereduniqueid']=_0x22da07['secondtransfererlinkedid'];}}}else if(_0x22da07['secondtransfereruniqueid']==_0x22da07[_0xc959('0x4f')]){if(!_[_0xc959('0x18')](queues[_0x22da07[_0xc959('0x4e')]])){utils[_0xc959('0x1')](util[_0xc959('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x22da07[_0xc959('0x4d')],queues[_0x22da07[_0xc959('0x4e')]]['name'],_0x22da07[_0xc959('0x5a')],_0x22da07[_0xc959('0x5b')]));queues[_0x22da07[_0xc959('0x4e')]]['transfer']=!![];queues[_0x22da07[_0xc959('0x4e')]][_0xc959('0x47')]=_0xc959('0x51');queues[_0x22da07[_0xc959('0x4e')]][_0xc959('0x48')]=_0x22da07[_0xc959('0x5b')];queues[_0x22da07[_0xc959('0x4e')]][_0xc959('0x4a')]=_0x22da07['secondtransfereruniqueid'];queues[_0x22da07['origtransfererlinkedid']]['queuecallerexitreason']=_0xc959('0x52');}if(!_[_0xc959('0x18')](queues[_0x22da07[_0xc959('0x4f')]])){if(_0x22da07['transfertargetlinkedid']&&queues[_0x22da07[_0xc959('0x5c')]]){queues[_0x22da07[_0xc959('0x5c')]][_0xc959('0x23')]=0x1;queues[_0x22da07[_0xc959('0x5d')]]=_[_0xc959('0x54')](queues[_0x22da07[_0xc959('0x5c')]]);queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0xf')]=_0x22da07[_0xc959('0x5d')];queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x23')]=0x2;queues[_0x22da07['transfertargetuniqueid']][_0xc959('0x6')]=queues[_0x22da07['origtransfererlinkedid']][_0xc959('0x6')];queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x55')]=queues[_0x22da07[_0xc959('0x4e')]][_0xc959('0x55')];queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x38')]=utils[_0xc959('0x16')]();queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x1a')]=utils[_0xc959('0x16')]();queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x56')]=0x0;queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x57')]=0x0;utils[_0xc959('0x1')](util[_0xc959('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x22da07['origtransfereruniqueid'],queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x21')],queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0xf')],queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x6')],queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x55')]));}else{utils['info'](util['format'](_0xc959('0x59'),_0x22da07[_0xc959('0x4d')],queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x21')],_0x22da07[_0xc959('0x4e')]));queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0xf')]=_0x22da07[_0xc959('0x4e')];}}}}catch(_0x5f442f){utils['error'](util[_0xc959('0x13')](_0xc959('0x5e'),_0x22da07['origtransfereruniqueid']),_0x5f442f);}};exports['musiconholdstart']=function(_0x5a6148){try{if(!_['isNil'](queues[_0x5a6148['uniqueid']])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x5f'),_0x5a6148[_0xc959('0x3')]),_0x5a6148);queues[_0x5a6148['uniqueid']][_0xc959('0x60')]=utils[_0xc959('0x16')]();utils[_0xc959('0x1')](util['format'](_0xc959('0x61'),_0x5a6148[_0xc959('0x3')],queues[_0x5a6148[_0xc959('0x3')]][_0xc959('0x21')],queues[_0x5a6148[_0xc959('0x3')]][_0xc959('0x60')]));}}catch(_0x2864cb){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x5f'),_0x5a6148[_0xc959('0x3')]),_0x2864cb);}};exports[_0xc959('0x62')]=function(_0x213a85){try{if(!_[_0xc959('0x18')](queues[_0x213a85[_0xc959('0x3')]])){if(!_[_0xc959('0x18')](queues[_0x213a85[_0xc959('0x3')]][_0xc959('0x60')])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x63'),_0x213a85[_0xc959('0x3')]),_0x213a85);queues[_0x213a85[_0xc959('0x3')]][_0xc959('0x57')]+=utils[_0xc959('0x37')](utils[_0xc959('0x16')](),queues[_0x213a85[_0xc959('0x3')]]['musiconholdstartAt']);utils[_0xc959('0x1')](util[_0xc959('0x13')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x213a85[_0xc959('0x3')],queues[_0x213a85[_0xc959('0x3')]][_0xc959('0x21')],queues[_0x213a85['uniqueid']][_0xc959('0x57')]));delete queues[_0x213a85[_0xc959('0x3')]][_0xc959('0x60')];}}}catch(_0x202efb){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x63'),_0x213a85[_0xc959('0x3')]),_0x202efb);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 5821da6..78e143e 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a88=['substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./utils','./transfers.controller','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','getUserByInternal','accountcode','then','name','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','info','context','exten','channel','error','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','.wav49','value','replace','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr','split'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a88,0x1a3));var _0x82a8=function(_0x36c9df,_0x3fde39){_0x36c9df=_0x36c9df-0x0;var _0x1f44b2=_0x2a88[_0x36c9df];return _0x1f44b2;};'use strict';var _=require(_0x82a8('0x0'));var util=require(_0x82a8('0x1'));var utils=require(_0x82a8('0x2'));var transfers=require(_0x82a8('0x3'));var recordings={};function writeDB(_0x10083a){var _0x567f8f;utils['info'](util[_0x82a8('0x4')](_0x82a8('0x5'),_0x10083a['uniqueid']));if(transfers[_0x82a8('0x6')][_0x10083a[_0x82a8('0x7')]]){_0x567f8f=_0x10083a[_0x82a8('0x7')];_0x10083a['uniqueid']=transfers['blinds'][_0x10083a['uniqueid']][_0x82a8('0x8')];}if(_0x10083a['accountcode']){utils[_0x82a8('0x9')](_0x10083a[_0x82a8('0xa')])[_0x82a8('0xb')](function(_0x7b54f4){if(_0x7b54f4){_0x10083a['membername']=_0x7b54f4[_0x82a8('0xc')];_0x10083a['UserId']=_0x7b54f4['id'];}utils[_0x82a8('0xd')](_0x82a8('0xe'),_0x10083a);});}else{utils[_0x82a8('0xd')]('CreateVoiceRecording',_0x10083a);}if(_0x567f8f)delete transfers['blinds'][_0x567f8f];}exports['newchannel']=function(_0x2ba1f3){try{utils[_0x82a8('0xf')](util[_0x82a8('0x4')](_0x82a8('0x10'),_0x2ba1f3['uniqueid']),_0x2ba1f3);if(_0x2ba1f3[_0x82a8('0x7')]==_0x2ba1f3[_0x82a8('0x11')]){utils[_0x82a8('0x12')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2ba1f3[_0x82a8('0x7')],_0x2ba1f3[_0x82a8('0x13')],_0x2ba1f3[_0x82a8('0x14')]));recordings[_0x2ba1f3['uniqueid']]={'uniqueid':_0x2ba1f3['uniqueid'],'accountcode':_0x2ba1f3['accountcode'],'exten':_0x2ba1f3[_0x82a8('0x14')],'context':_0x2ba1f3['context'],'channel':_0x2ba1f3[_0x82a8('0x15')],'monitors':[]};}}catch(_0x1da5ff){utils[_0x82a8('0x16')](util[_0x82a8('0x4')](_0x82a8('0x10'),_0x2ba1f3[_0x82a8('0x7')]),_0x1da5ff);}};exports['newstate']=function(_0x2cff74){try{utils['debug'](util['format'](_0x82a8('0x17'),_0x2cff74[_0x82a8('0x7')]),_0x2cff74);if(!_[_0x82a8('0x18')](recordings[_0x2cff74[_0x82a8('0x7')]])&&_0x2cff74[_0x82a8('0x19')]==0x6){utils[_0x82a8('0x12')](util[_0x82a8('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2cff74[_0x82a8('0x7')],_0x2cff74['context'],_0x2cff74[_0x82a8('0x15')]));}else if(!_['isNil'](recordings[_0x2cff74[_0x82a8('0x11')]])&&_0x2cff74[_0x82a8('0x19')]==0x6&&_0x2cff74['context']!=_0x82a8('0x1a')){utils['info'](util[_0x82a8('0x4')](_0x82a8('0x1b'),_0x2cff74[_0x82a8('0x7')],_0x2cff74['linkedid'],_0x2cff74[_0x82a8('0x13')],_0x2cff74['channel']));recordings[_0x2cff74['linkedid']][_0x82a8('0xa')]=_0x2cff74[_0x82a8('0xa')];}}catch(_0x508f3e){utils['error'](util['format'](_0x82a8('0x17'),_0x2cff74[_0x82a8('0x7')]),_0x508f3e);}};exports['varset']=function(_0x30a8b7){try{if(!_[_0x82a8('0x18')](_0x30a8b7['variable'])&&!_[_0x82a8('0x18')](_0x30a8b7[_0x82a8('0x1c')][_0x82a8('0x1d')])){utils[_0x82a8('0xf')](util[_0x82a8('0x4')](_0x82a8('0x1e'),_0x30a8b7[_0x82a8('0x7')]),_0x30a8b7);utils[_0x82a8('0x12')](util[_0x82a8('0x4')](_0x82a8('0x1f'),_0x30a8b7[_0x82a8('0x7')],_0x30a8b7[_0x82a8('0x1c')],_0x30a8b7['value']));if(_[_0x82a8('0x20')](_0x30a8b7['value'],_0x82a8('0x21'))){_0x30a8b7[_0x82a8('0x22')]=_0x30a8b7[_0x82a8('0x22')][_0x82a8('0x23')](_0x82a8('0x21'),'.WAV');}if(recordings[_0x30a8b7[_0x82a8('0x11')]]){var _0x4282d6=_[_0x82a8('0x24')](recordings[_0x30a8b7['linkedid']][_0x82a8('0x25')],{'value':_0x30a8b7[_0x82a8('0x22')]});if(_['isNil'](_0x4282d6)){recordings[_0x30a8b7['linkedid']][_0x82a8('0x25')]['push']({'value':_0x30a8b7[_0x82a8('0x22')]});}}}}catch(_0x567ee9){utils[_0x82a8('0x16')](util['format']('[%s][recordings][varset]',_0x30a8b7['uniqueid']),_0x567ee9);}};exports[_0x82a8('0x26')]=function(_0x3f7ee8){try{if(!_[_0x82a8('0x18')](recordings[_0x3f7ee8[_0x82a8('0x7')]])){utils[_0x82a8('0xf')](util[_0x82a8('0x4')](_0x82a8('0x27'),_0x3f7ee8['uniqueid']),_0x3f7ee8);utils[_0x82a8('0x12')](util[_0x82a8('0x4')](_0x82a8('0x28'),_0x3f7ee8[_0x82a8('0x7')],_0x3f7ee8[_0x82a8('0x29')],_0x3f7ee8[_0x82a8('0x2a')],_0x3f7ee8['cause-txt']));recordings[_0x3f7ee8[_0x82a8('0x7')]][_0x82a8('0x29')]=_0x3f7ee8[_0x82a8('0x29')];recordings[_0x3f7ee8['uniqueid']][_0x82a8('0x2a')]=_0x3f7ee8[_0x82a8('0x2a')];recordings[_0x3f7ee8[_0x82a8('0x7')]][_0x82a8('0x2b')]=_0x3f7ee8[_0x82a8('0x2b')];recordings[_0x3f7ee8[_0x82a8('0x7')]][_0x82a8('0x2c')]=_0x3f7ee8[_0x82a8('0x2c')];if(recordings[_0x3f7ee8[_0x82a8('0x7')]][_0x82a8('0x2d')]=='outbound'&&recordings[_0x3f7ee8[_0x82a8('0x7')]][_0x82a8('0xa')]){recordings[_0x3f7ee8['uniqueid']][_0x82a8('0x2b')]=recordings[_0x3f7ee8[_0x82a8('0x7')]][_0x82a8('0xa')];recordings[_0x3f7ee8[_0x82a8('0x7')]][_0x82a8('0x2c')]='';}recordings[_0x3f7ee8[_0x82a8('0x7')]][_0x82a8('0x25')][_0x82a8('0x2e')](function(_0x23859e){var _0x5abee3=_[_0x82a8('0x2f')](recordings[_0x3f7ee8[_0x82a8('0x7')]]);_0x5abee3[_0x82a8('0x22')]=_0x23859e[_0x82a8('0x22')];writeDB(_0x5abee3);});delete recordings[_0x3f7ee8['uniqueid']];}}catch(_0x40762b){utils[_0x82a8('0x16')](util[_0x82a8('0x4')]('[%s][recordings][hangup]',_0x3f7ee8[_0x82a8('0x7')]),_0x40762b);}};exports[_0x82a8('0x30')]=function(_0x27971e){try{if(!_[_0x82a8('0x18')](recordings[_0x27971e[_0x82a8('0x7')]])){utils[_0x82a8('0xf')](util[_0x82a8('0x4')](_0x82a8('0x31'),_0x27971e[_0x82a8('0x7')]),_0x27971e);utils['info'](util[_0x82a8('0x4')](_0x82a8('0x32'),_0x27971e[_0x82a8('0x7')],_0x27971e[_0x82a8('0x33')],_0x27971e[_0x82a8('0x34')]));if(_0x27971e[_0x82a8('0x33')]['toLowerCase']()==_0x82a8('0x35')&&_[_0x82a8('0x36')](_0x27971e[_0x82a8('0x34')]['toLowerCase'](),_0x82a8('0x37'))){var _0x5b552f=_0x27971e[_0x82a8('0x34')][_0x82a8('0x38')]('=');var _0x588fca=_0x5b552f[0x0][_0x82a8('0x39')](_0x5b552f[0x0][_0x82a8('0x3a')]('(')+0x1,_0x5b552f[0x0][_0x82a8('0x3a')](')'));var _0x1e7423=_0x5b552f[0x1];recordings[_0x27971e[_0x82a8('0x7')]][_0x588fca]=_0x1e7423;}}}catch(_0x5dcf0c){utils[_0x82a8('0x16')](util[_0x82a8('0x4')]('[%s][recordings][newexten]',_0x27971e[_0x82a8('0x7')]),_0x5dcf0c);}};exports[_0x82a8('0x3b')]=function(_0x39e59a){try{if(!_[_0x82a8('0x18')](recordings[_0x39e59a['uniqueid']])){utils[_0x82a8('0xf')](util[_0x82a8('0x4')](_0x82a8('0x3c'),_0x39e59a[_0x82a8('0x7')]),_0x39e59a);utils[_0x82a8('0x12')](util[_0x82a8('0x4')](_0x82a8('0x3d'),_0x39e59a['uniqueid'],_0x39e59a[_0x82a8('0x3e')]));recordings[_0x39e59a[_0x82a8('0x7')]]['queue']=_0x39e59a['queue'];}}catch(_0x105bae){utils[_0x82a8('0x16')](util['format'](_0x82a8('0x3c'),_0x39e59a[_0x82a8('0x7')]),_0x105bae);}};exports['blindtransfer']=function(_0x19d505){try{utils['debug'](util[_0x82a8('0x4')]('[%s][recordings][blindtransfer]',_0x19d505[_0x82a8('0x7')]),_0x19d505);utils['info'](util['format'](_0x82a8('0x3f'),_0x19d505[_0x82a8('0x7')],_0x19d505['transferercalleridnum'],_0x19d505[_0x82a8('0x40')],_0x19d505[_0x82a8('0x41')],_0x19d505[_0x82a8('0x42')]));if(recordings[_0x19d505[_0x82a8('0x43')]]&&transfers[_0x82a8('0x6')][_0x19d505[_0x82a8('0x43')]]){transfers[_0x82a8('0x6')][_0x19d505[_0x82a8('0x43')]]['recording']=!![];}}catch(_0x715ff0){utils[_0x82a8('0x16')](util['format']('[%s][recordings][blindtransfer]',_0x19d505[_0x82a8('0x7')]),_0x715ff0);}}; \ No newline at end of file +var _0x5aac=['mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','type','outbound','connectedlinename','clone','[%s][recordings][hangup]','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','debug','linkedid','format','context','exten','channel','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','variable'];(function(_0x44a329,_0x45f280){var _0x45f2a3=function(_0x272e62){while(--_0x272e62){_0x44a329['push'](_0x44a329['shift']());}};_0x45f2a3(++_0x45f280);}(_0x5aac,0x6e));var _0xc5aa=function(_0x39550b,_0x58fc71){_0x39550b=_0x39550b-0x0;var _0x1a347f=_0x5aac[_0x39550b];return _0x1a347f;};'use strict';var _=require(_0xc5aa('0x0'));var util=require(_0xc5aa('0x1'));var utils=require(_0xc5aa('0x2'));var transfers=require(_0xc5aa('0x3'));var recordings={};function writeDB(_0x3f90aa){var _0x5df0a3;utils[_0xc5aa('0x4')](util['format'](_0xc5aa('0x5'),_0x3f90aa['uniqueid']));if(transfers[_0xc5aa('0x6')][_0x3f90aa[_0xc5aa('0x7')]]){_0x5df0a3=_0x3f90aa[_0xc5aa('0x7')];_0x3f90aa['uniqueid']=transfers[_0xc5aa('0x6')][_0x3f90aa[_0xc5aa('0x7')]][_0xc5aa('0x8')];}if(_0x3f90aa[_0xc5aa('0x9')]){utils[_0xc5aa('0xa')](_0x3f90aa[_0xc5aa('0x9')])[_0xc5aa('0xb')](function(_0x4b4566){if(_0x4b4566){_0x3f90aa[_0xc5aa('0xc')]=_0x4b4566[_0xc5aa('0xd')];_0x3f90aa['UserId']=_0x4b4566['id'];}utils[_0xc5aa('0xe')]('CreateVoiceRecording',_0x3f90aa);});}else{utils['request'](_0xc5aa('0xf'),_0x3f90aa);}if(_0x5df0a3)delete transfers[_0xc5aa('0x6')][_0x5df0a3];}exports[_0xc5aa('0x10')]=function(_0x3e6fc6){try{utils[_0xc5aa('0x11')](util['format']('[%s][recordings][newchannel]',_0x3e6fc6[_0xc5aa('0x7')]),_0x3e6fc6);if(_0x3e6fc6[_0xc5aa('0x7')]==_0x3e6fc6[_0xc5aa('0x12')]){utils[_0xc5aa('0x4')](util[_0xc5aa('0x13')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3e6fc6['uniqueid'],_0x3e6fc6[_0xc5aa('0x14')],_0x3e6fc6[_0xc5aa('0x15')]));recordings[_0x3e6fc6[_0xc5aa('0x7')]]={'uniqueid':_0x3e6fc6[_0xc5aa('0x7')],'accountcode':_0x3e6fc6[_0xc5aa('0x9')],'exten':_0x3e6fc6[_0xc5aa('0x15')],'context':_0x3e6fc6[_0xc5aa('0x14')],'channel':_0x3e6fc6[_0xc5aa('0x16')],'monitors':[]};}}catch(_0x4aaa66){utils['error'](util[_0xc5aa('0x13')](_0xc5aa('0x17'),_0x3e6fc6[_0xc5aa('0x7')]),_0x4aaa66);}};exports['newstate']=function(_0x1f3f00){try{utils['debug'](util[_0xc5aa('0x13')](_0xc5aa('0x18'),_0x1f3f00[_0xc5aa('0x7')]),_0x1f3f00);if(!_[_0xc5aa('0x19')](recordings[_0x1f3f00['uniqueid']])&&_0x1f3f00[_0xc5aa('0x1a')]==0x6){utils[_0xc5aa('0x4')](util[_0xc5aa('0x13')](_0xc5aa('0x1b'),_0x1f3f00[_0xc5aa('0x7')],_0x1f3f00['context'],_0x1f3f00['channel']));}else if(!_[_0xc5aa('0x19')](recordings[_0x1f3f00[_0xc5aa('0x12')]])&&_0x1f3f00[_0xc5aa('0x1a')]==0x6&&_0x1f3f00[_0xc5aa('0x14')]!=_0xc5aa('0x1c')){utils[_0xc5aa('0x4')](util['format'](_0xc5aa('0x1d'),_0x1f3f00['uniqueid'],_0x1f3f00[_0xc5aa('0x12')],_0x1f3f00[_0xc5aa('0x14')],_0x1f3f00[_0xc5aa('0x16')]));recordings[_0x1f3f00['linkedid']][_0xc5aa('0x9')]=_0x1f3f00[_0xc5aa('0x9')];}}catch(_0x37b6e9){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x18'),_0x1f3f00[_0xc5aa('0x7')]),_0x37b6e9);}};exports['varset']=function(_0x1ca2e8){try{if(!_[_0xc5aa('0x19')](_0x1ca2e8['variable'])&&!_[_0xc5aa('0x19')](_0x1ca2e8[_0xc5aa('0x1f')][_0xc5aa('0x20')])){utils[_0xc5aa('0x11')](util['format'](_0xc5aa('0x21'),_0x1ca2e8[_0xc5aa('0x7')]),_0x1ca2e8);utils[_0xc5aa('0x4')](util[_0xc5aa('0x13')](_0xc5aa('0x22'),_0x1ca2e8[_0xc5aa('0x7')],_0x1ca2e8[_0xc5aa('0x1f')],_0x1ca2e8[_0xc5aa('0x23')]));if(_[_0xc5aa('0x24')](_0x1ca2e8[_0xc5aa('0x23')],'.wav49')){_0x1ca2e8['value']=_0x1ca2e8[_0xc5aa('0x23')][_0xc5aa('0x25')](_0xc5aa('0x26'),_0xc5aa('0x27'));}if(recordings[_0x1ca2e8[_0xc5aa('0x12')]]){var _0x4e2138=_[_0xc5aa('0x28')](recordings[_0x1ca2e8[_0xc5aa('0x12')]][_0xc5aa('0x29')],{'value':_0x1ca2e8[_0xc5aa('0x23')]});if(_['isNil'](_0x4e2138)){recordings[_0x1ca2e8[_0xc5aa('0x12')]][_0xc5aa('0x29')]['push']({'value':_0x1ca2e8[_0xc5aa('0x23')]});}}}}catch(_0x2be8df){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x21'),_0x1ca2e8[_0xc5aa('0x7')]),_0x2be8df);}};exports[_0xc5aa('0x2a')]=function(_0x3eed9e){try{if(!_['isNil'](recordings[_0x3eed9e['uniqueid']])){utils[_0xc5aa('0x11')](util[_0xc5aa('0x13')]('[%s][recordings][hangup]',_0x3eed9e[_0xc5aa('0x7')]),_0x3eed9e);utils[_0xc5aa('0x4')](util['format'](_0xc5aa('0x2b'),_0x3eed9e['uniqueid'],_0x3eed9e[_0xc5aa('0x2c')],_0x3eed9e[_0xc5aa('0x2d')],_0x3eed9e[_0xc5aa('0x2e')]));recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x2c')]=_0x3eed9e[_0xc5aa('0x2c')];recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x2d')]=_0x3eed9e[_0xc5aa('0x2d')];recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x2f')]=_0x3eed9e[_0xc5aa('0x2f')];recordings[_0x3eed9e[_0xc5aa('0x7')]]['connectedlinename']=_0x3eed9e['connectedlinename'];if(recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x30')]==_0xc5aa('0x31')&&recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x9')]){recordings[_0x3eed9e['uniqueid']]['connectedlinenum']=recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x9')];recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x32')]='';}recordings[_0x3eed9e['uniqueid']][_0xc5aa('0x29')]['forEach'](function(_0x2af5d4){var _0x24e918=_[_0xc5aa('0x33')](recordings[_0x3eed9e['uniqueid']]);_0x24e918['value']=_0x2af5d4[_0xc5aa('0x23')];writeDB(_0x24e918);});delete recordings[_0x3eed9e[_0xc5aa('0x7')]];}}catch(_0x2c2bf8){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x34'),_0x3eed9e[_0xc5aa('0x7')]),_0x2c2bf8);}};exports['newexten']=function(_0x55cf1d){try{if(!_[_0xc5aa('0x19')](recordings[_0x55cf1d['uniqueid']])){utils[_0xc5aa('0x11')](util[_0xc5aa('0x13')](_0xc5aa('0x35'),_0x55cf1d[_0xc5aa('0x7')]),_0x55cf1d);utils[_0xc5aa('0x4')](util[_0xc5aa('0x13')](_0xc5aa('0x36'),_0x55cf1d['uniqueid'],_0x55cf1d[_0xc5aa('0x37')],_0x55cf1d[_0xc5aa('0x38')]));if(_0x55cf1d[_0xc5aa('0x37')][_0xc5aa('0x39')]()==_0xc5aa('0x3a')&&_['startsWith'](_0x55cf1d[_0xc5aa('0x38')][_0xc5aa('0x39')](),'cdr')){var _0x1a7da8=_0x55cf1d['appdata']['split']('=');var _0x3d6baf=_0x1a7da8[0x0]['substring'](_0x1a7da8[0x0][_0xc5aa('0x3b')]('(')+0x1,_0x1a7da8[0x0]['lastIndexOf'](')'));var _0x463676=_0x1a7da8[0x1];recordings[_0x55cf1d['uniqueid']][_0x3d6baf]=_0x463676;}}}catch(_0x5a44a4){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x35'),_0x55cf1d[_0xc5aa('0x7')]),_0x5a44a4);}};exports[_0xc5aa('0x3c')]=function(_0x3bef96){try{if(!_[_0xc5aa('0x19')](recordings[_0x3bef96[_0xc5aa('0x7')]])){utils[_0xc5aa('0x11')](util[_0xc5aa('0x13')](_0xc5aa('0x3d'),_0x3bef96[_0xc5aa('0x7')]),_0x3bef96);utils['info'](util[_0xc5aa('0x13')](_0xc5aa('0x3e'),_0x3bef96[_0xc5aa('0x7')],_0x3bef96['queue']));recordings[_0x3bef96[_0xc5aa('0x7')]][_0xc5aa('0x3f')]=_0x3bef96[_0xc5aa('0x3f')];}}catch(_0x162d91){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x3d'),_0x3bef96[_0xc5aa('0x7')]),_0x162d91);}};exports[_0xc5aa('0x40')]=function(_0x1a3549){try{utils[_0xc5aa('0x11')](util[_0xc5aa('0x13')](_0xc5aa('0x41'),_0x1a3549[_0xc5aa('0x7')]),_0x1a3549);utils[_0xc5aa('0x4')](util[_0xc5aa('0x13')](_0xc5aa('0x42'),_0x1a3549[_0xc5aa('0x7')],_0x1a3549[_0xc5aa('0x43')],_0x1a3549['transferercalleridname'],_0x1a3549['transfereecalleridnum'],_0x1a3549[_0xc5aa('0x44')]));if(recordings[_0x1a3549[_0xc5aa('0x45')]]&&transfers[_0xc5aa('0x6')][_0x1a3549[_0xc5aa('0x45')]]){transfers['blinds'][_0x1a3549[_0xc5aa('0x45')]][_0xc5aa('0x46')]=!![];}}catch(_0x1401f2){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x41'),_0x1a3549[_0xc5aa('0x7')]),_0x1401f2);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 67ebd86..ff6a943 100644 --- a/server/services/xdr/transfers.controller.js +++ b/server/services/xdr/transfers.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37a0=['transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','isNil','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','info','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','blindtransfer','debug','format','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blinds'];(function(_0xe853ce,_0x3eda47){var _0x10926c=function(_0x4d87f4){while(--_0x4d87f4){_0xe853ce['push'](_0xe853ce['shift']());}};_0x10926c(++_0x3eda47);}(_0x37a0,0x1dd));var _0x037a=function(_0x1d0aed,_0x4077dd){_0x1d0aed=_0x1d0aed-0x0;var _0xecf2bc=_0x37a0[_0x1d0aed];return _0xecf2bc;};'use strict';var _=require(_0x037a('0x0'));var util=require(_0x037a('0x1'));var utils=require('./utils');function writeDB(_0x143797){utils[_0x037a('0x2')](util['format'](_0x037a('0x3'),_0x143797[_0x037a('0x4')]===_0x037a('0x5')?_0x143797['origtransfereruniqueid']:_0x143797[_0x037a('0x6')],_0x143797[_0x037a('0x4')]));utils[_0x037a('0x7')]('CreateVoiceTransferReport',_0x143797);}exports['blinds']={};exports[_0x037a('0x8')]=function(_0x2bd7bd){try{utils[_0x037a('0x9')](util[_0x037a('0xa')](_0x037a('0xb'),_0x2bd7bd[_0x037a('0x6')]),_0x2bd7bd);utils[_0x037a('0x2')](util[_0x037a('0xa')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2bd7bd[_0x037a('0x6')],_0x2bd7bd[_0x037a('0xc')],_0x2bd7bd[_0x037a('0xd')],_0x2bd7bd[_0x037a('0xe')],_0x2bd7bd[_0x037a('0xf')]));_0x2bd7bd[_0x037a('0x4')]='blind';exports[_0x037a('0x10')][_0x2bd7bd[_0x037a('0x11')]]=_0x2bd7bd;writeDB(_0x2bd7bd);}catch(_0x1f69a0){utils[_0x037a('0x12')](util[_0x037a('0xa')](_0x037a('0xb'),_0x2bd7bd['uniqueid']),_0x1f69a0);}};exports[_0x037a('0x13')]=function(_0x2e25a2){try{utils[_0x037a('0x9')](util[_0x037a('0xa')](_0x037a('0x14'),_0x2e25a2[_0x037a('0x15')]),_0x2e25a2);utils[_0x037a('0x2')](util['format'](_0x037a('0x16'),_0x2e25a2['origtransfereruniqueid'],_0x2e25a2['origtransferercalleridnum'],_0x2e25a2[_0x037a('0x17')],_0x2e25a2[_0x037a('0x18')],_0x2e25a2[_0x037a('0x19')]));_0x2e25a2=_[_0x037a('0x1a')](_0x2e25a2,{'transfererchannel':_0x2e25a2['origtransfererchannel'],'transferercalleridnum':_0x2e25a2[_0x037a('0x1b')],'transferercalleridname':_0x2e25a2[_0x037a('0x17')],'transfererconnectedlinenum':_0x2e25a2[_0x037a('0x1c')],'transfererconnectedlinename':_0x2e25a2['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2e25a2[_0x037a('0x1d')],'transferercontext':_0x2e25a2['secondtransferercontext'],'transfererexten':_0x2e25a2['secondtransfererexten'],'transfererlinkedid':_0x2e25a2[_0x037a('0x1e')],'context':_0x2e25a2[_0x037a('0x1f')],'extension':_0x2e25a2['origtransfererexten'],'type':_0x037a('0x5')});if(_[_0x037a('0x20')](_0x2e25a2['transfereechannel'])){_0x2e25a2=_[_0x037a('0x1a')](_0x2e25a2,{'transfereechannel':_0x2e25a2[_0x037a('0x21')],'transfereecalleridnum':_0x2e25a2['transfertargetcalleridnum'],'transfereecalleridname':_0x2e25a2[_0x037a('0x19')],'transfereeconnectedlinenum':_0x2e25a2['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2e25a2[_0x037a('0x22')],'transfereeaccountcode':_0x2e25a2[_0x037a('0x23')],'transfereecontext':_0x2e25a2[_0x037a('0x24')],'transfereeexten':_0x2e25a2[_0x037a('0x25')],'transfereelinkedid':_0x2e25a2['transfertargetlinkedid']});}writeDB(_0x2e25a2);}catch(_0x181928){utils[_0x037a('0x12')](util[_0x037a('0xa')]('[%s][transfers][attendedtransfer]',_0x2e25a2[_0x037a('0x15')]),_0x181928);}}; \ No newline at end of file +var _0x6002=['blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransfererexten','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds'];(function(_0x4a38d3,_0x4d2235){var _0x39835c=function(_0x125749){while(--_0x125749){_0x4a38d3['push'](_0x4a38d3['shift']());}};_0x39835c(++_0x4d2235);}(_0x6002,0x1ec));var _0x2600=function(_0x19159c,_0xf0c39e){_0x19159c=_0x19159c-0x0;var _0x57691a=_0x6002[_0x19159c];return _0x57691a;};'use strict';var _=require(_0x2600('0x0'));var util=require(_0x2600('0x1'));var utils=require(_0x2600('0x2'));function writeDB(_0x1894bf){utils[_0x2600('0x3')](util[_0x2600('0x4')](_0x2600('0x5'),_0x1894bf[_0x2600('0x6')]===_0x2600('0x7')?_0x1894bf[_0x2600('0x8')]:_0x1894bf[_0x2600('0x9')],_0x1894bf['type']));utils['request'](_0x2600('0xa'),_0x1894bf);}exports[_0x2600('0xb')]={};exports[_0x2600('0xc')]=function(_0x9ddd5e){try{utils[_0x2600('0xd')](util[_0x2600('0x4')](_0x2600('0xe'),_0x9ddd5e[_0x2600('0x9')]),_0x9ddd5e);utils[_0x2600('0x3')](util['format'](_0x2600('0xf'),_0x9ddd5e['uniqueid'],_0x9ddd5e[_0x2600('0x10')],_0x9ddd5e['transferercalleridname'],_0x9ddd5e[_0x2600('0x11')],_0x9ddd5e[_0x2600('0x12')]));_0x9ddd5e['type']=_0x2600('0x13');exports['blinds'][_0x9ddd5e[_0x2600('0x14')]]=_0x9ddd5e;writeDB(_0x9ddd5e);}catch(_0x56aec9){utils[_0x2600('0x15')](util[_0x2600('0x4')](_0x2600('0xe'),_0x9ddd5e[_0x2600('0x9')]),_0x56aec9);}};exports[_0x2600('0x16')]=function(_0x2462b1){try{utils['debug'](util[_0x2600('0x4')]('[%s][transfers][attendedtransfer]',_0x2462b1[_0x2600('0x8')]),_0x2462b1);utils[_0x2600('0x3')](util[_0x2600('0x4')](_0x2600('0x17'),_0x2462b1['origtransfereruniqueid'],_0x2462b1[_0x2600('0x18')],_0x2462b1[_0x2600('0x19')],_0x2462b1[_0x2600('0x1a')],_0x2462b1[_0x2600('0x1b')]));_0x2462b1=_[_0x2600('0x1c')](_0x2462b1,{'transfererchannel':_0x2462b1[_0x2600('0x1d')],'transferercalleridnum':_0x2462b1['origtransferercalleridnum'],'transferercalleridname':_0x2462b1['origtransferercalleridname'],'transfererconnectedlinenum':_0x2462b1[_0x2600('0x1e')],'transfererconnectedlinename':_0x2462b1[_0x2600('0x1f')],'transfereraccountcode':_0x2462b1[_0x2600('0x20')],'transferercontext':_0x2462b1[_0x2600('0x21')],'transfererexten':_0x2462b1['secondtransfererexten'],'transfererlinkedid':_0x2462b1[_0x2600('0x22')],'context':_0x2462b1['origtransferercontext'],'extension':_0x2462b1[_0x2600('0x23')],'type':_0x2600('0x7')});if(_['isNil'](_0x2462b1[_0x2600('0x24')])){_0x2462b1=_[_0x2600('0x1c')](_0x2462b1,{'transfereechannel':_0x2462b1['transfertargetchannel'],'transfereecalleridnum':_0x2462b1[_0x2600('0x1a')],'transfereecalleridname':_0x2462b1[_0x2600('0x1b')],'transfereeconnectedlinenum':_0x2462b1[_0x2600('0x25')],'transfereeconnectedlinename':_0x2462b1[_0x2600('0x26')],'transfereeaccountcode':_0x2462b1[_0x2600('0x27')],'transfereecontext':_0x2462b1['transfertargetcontext'],'transfereeexten':_0x2462b1['transfertargetexten'],'transfereelinkedid':_0x2462b1[_0x2600('0x28')]});}writeDB(_0x2462b1);}catch(_0x3c00ea){utils['error'](util['format'](_0x2600('0x29'),_0x2462b1[_0x2600('0x8')]),_0x3c00ea);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 80c6094..311f1ad 100644 --- a/server/services/xdr/utils.js +++ b/server/services/xdr/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4af=['internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','info','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','catch','[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','util','client','../../config/logger','inspect','debug','error','request','[utils][request]\x20name:%s','GetUser'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd4af,0xe5));var _0xfd4a=function(_0x1d8cc4,_0x295607){_0x1d8cc4=_0x1d8cc4-0x0;var _0x1ddd4b=_0xd4af[_0x1d8cc4];return _0x1ddd4b;};'use strict';var BPromise=require(_0xfd4a('0x0'));var jayson=require(_0xfd4a('0x1'));var moment=require('moment');var util=require(_0xfd4a('0x2'));var client=jayson[_0xfd4a('0x3')]['http']({'port':0x2329});var logger=require(_0xfd4a('0x4'))('xdr');exports['info']=function(_0x59bc6c,_0x40d705){logger['info'](_0x59bc6c,_0x40d705?util[_0xfd4a('0x5')](_0x40d705,{'showHidden':![],'depth':null}):'');};exports[_0xfd4a('0x6')]=function(_0x5282c3,_0x37a733){logger['debug'](_0x5282c3,_0x37a733?util[_0xfd4a('0x5')](_0x37a733,{'showHidden':![],'depth':null}):'');};exports[_0xfd4a('0x7')]=function(_0x2e3da8,_0x3dc503){logger[_0xfd4a('0x7')](_0x2e3da8,_0x3dc503?util[_0xfd4a('0x5')](_0x3dc503,{'showHidden':![],'depth':null}):'');};exports[_0xfd4a('0x8')]=function(_0x7425fe,_0x3f0b82){return client[_0xfd4a('0x8')](_0x7425fe,{'body':_0x3f0b82})['then'](function(_0x25600b){logger[_0xfd4a('0x6')](_0xfd4a('0x9'),_0x7425fe,_0x25600b?util[_0xfd4a('0x5')](_0x25600b,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x1e11af){logger['error'](_0xfd4a('0x9'),_0x7425fe,_0x1e11af?util['inspect'](_0x1e11af,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3fe67d){return client[_0xfd4a('0x8')](_0xfd4a('0xa'),{'options':{'raw':!![],'attributes':['id',_0xfd4a('0xb'),_0xfd4a('0xc'),_0xfd4a('0xd')],'where':_0x3fe67d,'limit':0x1}})[_0xfd4a('0xe')](function(_0x398f1f){logger[_0xfd4a('0x6')](_0xfd4a('0xf'),JSON[_0xfd4a('0x10')](_0x3fe67d),_0x398f1f?util[_0xfd4a('0x5')](_0x398f1f,{'showHidden':![],'depth':null}):'');return _0x398f1f[_0xfd4a('0x11')][_0xfd4a('0x12')]?_0x398f1f[_0xfd4a('0x11')][0x0]:null;});}exports[_0xfd4a('0x13')]=function(_0x587ddd){return new BPromise(function(_0x33a5da,_0x4b6678){if(_0x587ddd){return getUser({'internal':_0x587ddd})[_0xfd4a('0xe')](function(_0x24340e){logger['info'](_0xfd4a('0x14'),_0x587ddd,_0x24340e?_0xfd4a('0x15'):_0xfd4a('0x16'));return _0x33a5da(_0x24340e);})['catch'](function(_0x3f85ff){logger[_0xfd4a('0x7')]('[utils][getUserByInternal]',_0x3f85ff?util[_0xfd4a('0x5')](_0x3f85ff,{'showHidden':![],'depth':null}):'');return _0x33a5da(null);});}return _0x33a5da(null);});};exports[_0xfd4a('0x17')]=function(_0x1d221b){return new BPromise(function(_0x2dec51,_0x10a0c8){if(_0x1d221b){return getUser({'interface':_0x1d221b})[_0xfd4a('0xe')](function(_0xd82ec5){logger[_0xfd4a('0x18')](_0xfd4a('0x19'),_0x1d221b,_0xd82ec5?_0xfd4a('0x15'):_0xfd4a('0x16'));return _0x2dec51(_0xd82ec5);})['catch'](function(_0x4a3ea1){logger[_0xfd4a('0x7')]('[utils][getUserByInterface]',_0x4a3ea1?util['inspect'](_0x4a3ea1,{'showHidden':![],'depth':null}):'');return _0x2dec51(null);});}return _0x2dec51(null);});};exports[_0xfd4a('0x1a')]=function(_0x4bcd9d){return new BPromise(function(_0x224faf,_0x1b2a1f){if(_0x4bcd9d){return getUser({'name':_0x4bcd9d})['then'](function(_0x54ee9e){logger[_0xfd4a('0x18')](_0xfd4a('0x1b'),_0x4bcd9d,_0x54ee9e?'found':_0xfd4a('0x16'));return _0x224faf(_0x54ee9e);})[_0xfd4a('0x1c')](function(_0x135096){logger[_0xfd4a('0x7')](_0xfd4a('0x1d'),_0x135096?util[_0xfd4a('0x5')](_0x135096,{'showHidden':![],'depth':null}):'');return _0x224faf(null);});}return _0x224faf(null);});};exports['getVoiceQueueByName']=function(_0x494370){return new BPromise(function(_0x56896f,_0x3fc039){if(_0x494370){return client[_0xfd4a('0x8')](_0xfd4a('0x1e'),{'options':{'raw':!![],'attributes':['id','name',_0xfd4a('0x1f'),_0xfd4a('0x20'),_0xfd4a('0x21')],'where':{'name':_0x494370},'limit':0x1}})['then'](function(_0x2b6665){logger[_0xfd4a('0x6')](_0xfd4a('0x22'),_0x494370,_0x2b6665?util[_0xfd4a('0x5')](_0x2b6665,{'showHidden':![],'depth':null}):'');logger[_0xfd4a('0x18')](_0xfd4a('0x23'),_0x494370,_0x2b6665?_0xfd4a('0x15'):_0xfd4a('0x16'));return _0x56896f(_0x2b6665[_0xfd4a('0x11')][_0xfd4a('0x12')]?_0x2b6665[_0xfd4a('0x11')][0x0]:null);})['catch'](function(_0x5cfb4a){logger[_0xfd4a('0x7')]('[utils][getVoiceQueueByName]',_0x5cfb4a?util[_0xfd4a('0x5')](_0x5cfb4a,{'showHidden':![],'depth':null}):'');return _0x56896f(null);});}return _0x56896f(null);});};exports[_0xfd4a('0x24')]=function(_0x174459,_0x483be6){return moment(_0x174459)[_0xfd4a('0x25')](_0x483be6,_0xfd4a('0x26'))['format'](_0xfd4a('0x27'));};exports[_0xfd4a('0x28')]=function(_0x4af594,_0x315b3f){return moment(_0x4af594)[_0xfd4a('0x29')](_0x315b3f,_0xfd4a('0x26'))[_0xfd4a('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xfd4a('0x2b')]=function(_0x1b558b,_0x1ce2a2){return moment(_0x1b558b)[_0xfd4a('0x2c')](moment(_0x1ce2a2),'seconds');};exports['sumTime']=function(_0xc92246,_0xcd4d71){return parseInt(_0xc92246,0xa)+parseInt(_0xcd4d71,0xa);};exports[_0xfd4a('0x2d')]=function(){return moment()['format'](_0xfd4a('0x27'));};exports['isAfter']=function(_0x832c43,_0x1495a0){if(_0x1495a0){return moment(_0x832c43)[_0xfd4a('0x2e')](_0x1495a0);}return!![];};exports[_0xfd4a('0x2f')]=function(_0x20be72,_0x45972b){if(_0x45972b){return moment(_0x20be72)[_0xfd4a('0x2f')](_0x45972b);}else if(_0x20be72){return!![];}return![];}; \ No newline at end of file +var _0x1b03=['client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','found','[utils][getUserByInterface]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util'];(function(_0x2428e9,_0x1ff5f3){var _0x50d9d9=function(_0x55afd2){while(--_0x55afd2){_0x2428e9['push'](_0x2428e9['shift']());}};_0x50d9d9(++_0x1ff5f3);}(_0x1b03,0x191));var _0x31b0=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1b03[_0x4cf98e];return _0x1623ac;};'use strict';var BPromise=require(_0x31b0('0x0'));var jayson=require(_0x31b0('0x1'));var moment=require(_0x31b0('0x2'));var util=require(_0x31b0('0x3'));var client=jayson[_0x31b0('0x4')][_0x31b0('0x5')]({'port':0x2329});var logger=require(_0x31b0('0x6'))(_0x31b0('0x7'));exports[_0x31b0('0x8')]=function(_0x3f2d49,_0x2eafb9){logger[_0x31b0('0x8')](_0x3f2d49,_0x2eafb9?util[_0x31b0('0x9')](_0x2eafb9,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x257e68,_0x4a05d6){logger[_0x31b0('0xa')](_0x257e68,_0x4a05d6?util['inspect'](_0x4a05d6,{'showHidden':![],'depth':null}):'');};exports[_0x31b0('0xb')]=function(_0x27c57b,_0x22466e){logger['error'](_0x27c57b,_0x22466e?util['inspect'](_0x22466e,{'showHidden':![],'depth':null}):'');};exports[_0x31b0('0xc')]=function(_0x5994e8,_0x4176e6){return client[_0x31b0('0xc')](_0x5994e8,{'body':_0x4176e6})[_0x31b0('0xd')](function(_0x39e133){logger[_0x31b0('0xa')](_0x31b0('0xe'),_0x5994e8,_0x39e133?util[_0x31b0('0x9')](_0x39e133,{'showHidden':![],'depth':null}):'');})[_0x31b0('0xf')](function(_0x27810d){logger[_0x31b0('0xb')](_0x31b0('0xe'),_0x5994e8,_0x27810d?util[_0x31b0('0x9')](_0x27810d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x291945){return client['request'](_0x31b0('0x10'),{'options':{'raw':!![],'attributes':['id','internal',_0x31b0('0x11'),'interface'],'where':_0x291945,'limit':0x1}})[_0x31b0('0xd')](function(_0x14f1de){logger[_0x31b0('0xa')](_0x31b0('0x12'),JSON[_0x31b0('0x13')](_0x291945),_0x14f1de?util[_0x31b0('0x9')](_0x14f1de,{'showHidden':![],'depth':null}):'');return _0x14f1de[_0x31b0('0x14')][_0x31b0('0x15')]?_0x14f1de[_0x31b0('0x14')][0x0]:null;});}exports[_0x31b0('0x16')]=function(_0x115b2a){return new BPromise(function(_0x1e2814,_0x47ad16){if(_0x115b2a){return getUser({'internal':_0x115b2a})[_0x31b0('0xd')](function(_0x14edcd){logger[_0x31b0('0x8')](_0x31b0('0x17'),_0x115b2a,_0x14edcd?'found':_0x31b0('0x18'));return _0x1e2814(_0x14edcd);})[_0x31b0('0xf')](function(_0x213dd2){logger[_0x31b0('0xb')](_0x31b0('0x19'),_0x213dd2?util[_0x31b0('0x9')](_0x213dd2,{'showHidden':![],'depth':null}):'');return _0x1e2814(null);});}return _0x1e2814(null);});};exports['getUserByInterface']=function(_0x38f7b3){return new BPromise(function(_0x456f91,_0x29d480){if(_0x38f7b3){return getUser({'interface':_0x38f7b3})[_0x31b0('0xd')](function(_0x6eb99d){logger[_0x31b0('0x8')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x38f7b3,_0x6eb99d?_0x31b0('0x1a'):_0x31b0('0x18'));return _0x456f91(_0x6eb99d);})[_0x31b0('0xf')](function(_0x5a6c2d){logger['error'](_0x31b0('0x1b'),_0x5a6c2d?util[_0x31b0('0x9')](_0x5a6c2d,{'showHidden':![],'depth':null}):'');return _0x456f91(null);});}return _0x456f91(null);});};exports['getUserByName']=function(_0x33c0e8){return new BPromise(function(_0x5b915e,_0x14196b){if(_0x33c0e8){return getUser({'name':_0x33c0e8})[_0x31b0('0xd')](function(_0x3c11e9){logger[_0x31b0('0x8')]('[utils][getUserByName]\x20name:%s\x20%s',_0x33c0e8,_0x3c11e9?_0x31b0('0x1a'):_0x31b0('0x18'));return _0x5b915e(_0x3c11e9);})[_0x31b0('0xf')](function(_0x2e8e63){logger[_0x31b0('0xb')]('[utils][getUserByName]',_0x2e8e63?util[_0x31b0('0x9')](_0x2e8e63,{'showHidden':![],'depth':null}):'');return _0x5b915e(null);});}return _0x5b915e(null);});};exports[_0x31b0('0x1c')]=function(_0x4bc63d){return new BPromise(function(_0x56baff,_0x323996){if(_0x4bc63d){return client['request'](_0x31b0('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x31b0('0x11'),'type',_0x31b0('0x1e'),_0x31b0('0x1f')],'where':{'name':_0x4bc63d},'limit':0x1}})[_0x31b0('0xd')](function(_0x124f80){logger[_0x31b0('0xa')](_0x31b0('0x20'),_0x4bc63d,_0x124f80?util[_0x31b0('0x9')](_0x124f80,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x4bc63d,_0x124f80?'found':_0x31b0('0x18'));return _0x56baff(_0x124f80[_0x31b0('0x14')][_0x31b0('0x15')]?_0x124f80['result'][0x0]:null);})['catch'](function(_0xe91562){logger[_0x31b0('0xb')](_0x31b0('0x21'),_0xe91562?util[_0x31b0('0x9')](_0xe91562,{'showHidden':![],'depth':null}):'');return _0x56baff(null);});}return _0x56baff(null);});};exports[_0x31b0('0x22')]=function(_0x3aaed5,_0xfdb669){return moment(_0x3aaed5)[_0x31b0('0x23')](_0xfdb669,_0x31b0('0x24'))[_0x31b0('0x25')](_0x31b0('0x26'));};exports['subtractTime']=function(_0x3aae04,_0x5dc9c8){return moment(_0x3aae04)['subtract'](_0x5dc9c8,_0x31b0('0x24'))[_0x31b0('0x25')](_0x31b0('0x26'));};exports[_0x31b0('0x27')]=function(_0x342bb2,_0x18dc47){return moment(_0x342bb2)[_0x31b0('0x28')](moment(_0x18dc47),'seconds');};exports[_0x31b0('0x29')]=function(_0x21bc76,_0x164697){return parseInt(_0x21bc76,0xa)+parseInt(_0x164697,0xa);};exports[_0x31b0('0x2a')]=function(){return moment()[_0x31b0('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x31b0('0x2b')]=function(_0x350689,_0x3f7cd4){if(_0x3f7cd4){return moment(_0x350689)[_0x31b0('0x2b')](_0x3f7cd4);}return!![];};exports[_0x31b0('0x2c')]=function(_0xee8738,_0x2cce80){if(_0x2cce80){return moment(_0xee8738)[_0x31b0('0x2c')](_0x2cce80);}else if(_0xee8738){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 3bc5d2e..f04c8bb 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa859=['path','util','./loggers','safeTemplate','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','timestamp','error','api','auth','set','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','\x20body=%s','body','method','headers','x-forwarded-for','connection','remoteAddress','url','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','statusCode','agent_name','test','setupLoggers','fs-extra','lodash','express-winston'];(function(_0x1dbd01,_0xaaf7dc){var _0x25655e=function(_0x2a0d2b){while(--_0x2a0d2b){_0x1dbd01['push'](_0x1dbd01['shift']());}};_0x25655e(++_0xaaf7dc);}(_0xa859,0x11d));var _0x9a85=function(_0x160453,_0xbcd12c){_0x160453=_0x160453-0x0;var _0x566dc6=_0xa859[_0x160453];return _0x566dc6;};var fs=require(_0x9a85('0x0'));var _=require(_0x9a85('0x1'));var ewinston=require(_0x9a85('0x2'));var path=require(_0x9a85('0x3'));var util=require(_0x9a85('0x4'));var fileLogger=require(_0x9a85('0x5'))['fileLogger'];var safeTemplate=require('./safe-template')[_0x9a85('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0x9a85('0x7')];function ClientSideLogger(){function _0xfd12e3(_0x5aa302){var _0x36b332=path[_0x9a85('0x8')](_0x9a85('0x9'),_0x9a85('0xa'),_0x9a85('0xb'));var _0x49d957=path[_0x9a85('0x8')](_0x9a85('0xc'),_0x5aa302[_0x9a85('0xd')]+'-'+_0x5aa302[_0x9a85('0xe')]);return fs[_0x9a85('0xf')](path[_0x9a85('0x8')](_0x36b332,_0x49d957))[_0x9a85('0x10')](function(){var _0x34c951=fileLogger(_0x9a85('0xc'),path[_0x9a85('0x8')](_0x36b332,_0x49d957));return _0x34c951;})[_0x9a85('0x11')](function(_0x7d86da){throw _0x7d86da;});}this[_0x9a85('0xa')]=function(_0x48ddba,_0x2fc623,_0x311848,_0x174ece){return _0xfd12e3(_0x48ddba[_0x9a85('0x12')])[_0x9a85('0x10')](function(_0x2e8f20){var _0x2137a0=_0x2e8f20[_0x2fc623];return _0x2137a0;})[_0x9a85('0x10')](function(_0x641712){var _0x227b2e=_0x48ddba[_0x9a85('0x12')]?_0x48ddba[_0x9a85('0x12')]['id']:_0x9a85('0x13');var _0x29b2e7=_0x174ece[_0x9a85('0x14')];var _0x1dac8e=_0x174ece[_0x9a85('0x15')];var _0x446d1e=new Date(Number(_0x1dac8e));return _0x641712(_0x227b2e,_0x446d1e,_0x311848,_0x29b2e7);})['catch'](function(_0x1e6a6c){fileLogger(_0x9a85('0xc'))[_0x9a85('0x16')](_0x1e6a6c);});};}function setupLoggers(_0x26a4cc){return new Promise(function(_0x12dba3){var _0x1fba70=new ClientSideLogger();var _0x43a0be=fileLogger(_0x9a85('0x17'));var _0x9e8fda=fileLogger(_0x9a85('0x18'));_0x26a4cc[_0x9a85('0x19')](_0x9a85('0x1a'),_0x1fba70);_0x26a4cc[_0x9a85('0x1b')](ewinston['logger']({'winstonInstance':_0x43a0be,'meta':![],'statusLevels':!![],'msg':function(_0xbc9240,_0x3a209a){var _0x126afa=_0x9a85('0x1c');if(!_['isEmpty'](_0xbc9240['body'])){_0x126afa+=_0x9a85('0x1d');var _0x48de7=_0xbc9240[_0x9a85('0x1e')];maskSensitiveData(_0x48de7);}return safeTemplate(util['format'](_0x126afa,_0xbc9240[_0x9a85('0x1f')],_0xbc9240[_0x9a85('0x20')][_0x9a85('0x21')]?_0xbc9240['headers']['x-forwarded-for']:_0xbc9240[_0x9a85('0x22')][_0x9a85('0x23')]||_0xbc9240['ip'],_0xbc9240[_0x9a85('0x24')],_0x3a209a['statusCode'],_0x3a209a['responseTime'],_0xbc9240['user']?_0xbc9240[_0x9a85('0x12')]['id']:null,_0xbc9240[_0x9a85('0x12')]?_0xbc9240['user']['name']:null,_0xbc9240[_0x9a85('0x12')]?_0xbc9240[_0x9a85('0x12')]['role']:null,_0x48de7?util[_0x9a85('0x25')](_0x48de7,![],null):''));}}));_0x26a4cc[_0x9a85('0x1b')](ewinston[_0x9a85('0x26')]({'winstonInstance':_0x9e8fda,'meta':![],'statusLevels':!![],'msg':function(_0x6d9eb1,_0x40e10c){var _0x3ef7c3=_0x9a85('0x27');if(_0x6d9eb1[_0x9a85('0x1e')]&&_0x6d9eb1[_0x9a85('0x1e')][_0x9a85('0x28')]&&_0x6d9eb1['body'][_0x9a85('0x29')]){_0x3ef7c3=_0x9a85('0x2a');}return util[_0x9a85('0x2b')](_0x3ef7c3,_0x6d9eb1[_0x9a85('0x1f')],_0x6d9eb1[_0x9a85('0x20')][_0x9a85('0x21')]?_0x6d9eb1[_0x9a85('0x20')]['x-forwarded-for']:_0x6d9eb1[_0x9a85('0x22')][_0x9a85('0x23')]||_0x6d9eb1['ip'],_0x6d9eb1[_0x9a85('0x24')],_0x40e10c[_0x9a85('0x2c')],_0x40e10c['responseTime'],_0x6d9eb1[_0x9a85('0x12')]?_0x6d9eb1[_0x9a85('0x12')]['id']:null,_0x6d9eb1[_0x9a85('0x12')]?_0x6d9eb1[_0x9a85('0x12')][_0x9a85('0xe')]:null,_0x6d9eb1[_0x9a85('0x12')]?_0x6d9eb1[_0x9a85('0x12')][_0x9a85('0xd')]:null,_0x6d9eb1[_0x9a85('0x1e')]&&_0x6d9eb1[_0x9a85('0x1e')][_0x9a85('0x28')]?_0x6d9eb1[_0x9a85('0x1e')][_0x9a85('0x28')]:'other',_0x6d9eb1[_0x9a85('0x1e')]&&_0x6d9eb1[_0x9a85('0x1e')][_0x9a85('0x29')]?_0x6d9eb1[_0x9a85('0x1e')]['agent_id']:'',_0x6d9eb1[_0x9a85('0x1e')]&&_0x6d9eb1[_0x9a85('0x1e')][_0x9a85('0x2d')]?_0x6d9eb1[_0x9a85('0x1e')][_0x9a85('0x2d')]:'');},'ignoreRoute':function(_0x493b20){var _0x275f26=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x275f26[_0x9a85('0x2e')](_0x493b20[_0x9a85('0x24')]);}}));return _0x12dba3();});}exports[_0x9a85('0x2f')]=setupLoggers; \ No newline at end of file +var _0xf9b9=['format','method','connection','responseTime','other','test','url','setupLoggers','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','name','ensureDir','then','catch','user','no-user','timestamp','error','api','auth','set','client-side-logger','logger','\x20body=%s','body','x-forwarded-for','headers','remoteAddress','statusCode','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)'];(function(_0xbba9a4,_0x5bbb54){var _0x4d9fcb=function(_0x4e8752){while(--_0x4e8752){_0xbba9a4['push'](_0xbba9a4['shift']());}};_0x4d9fcb(++_0x5bbb54);}(_0xf9b9,0x158));var _0x9f9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9b9[_0x3dd15e];return _0x231fd0;};var fs=require('fs-extra');var _=require(_0x9f9b('0x0'));var ewinston=require(_0x9f9b('0x1'));var path=require(_0x9f9b('0x2'));var util=require(_0x9f9b('0x3'));var fileLogger=require(_0x9f9b('0x4'))[_0x9f9b('0x5')];var safeTemplate=require(_0x9f9b('0x6'))[_0x9f9b('0x7')];var maskSensitiveData=require(_0x9f9b('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x2e55be(_0x4e0533){var _0xbf1dc8=path[_0x9f9b('0x9')](_0x9f9b('0xa'),_0x9f9b('0xb'),_0x9f9b('0xc'));var _0x17a1a7=path['join'](_0x9f9b('0xd'),_0x4e0533['role']+'-'+_0x4e0533[_0x9f9b('0xe')]);return fs[_0x9f9b('0xf')](path['join'](_0xbf1dc8,_0x17a1a7))[_0x9f9b('0x10')](function(){var _0x2b957e=fileLogger(_0x9f9b('0xd'),path[_0x9f9b('0x9')](_0xbf1dc8,_0x17a1a7));return _0x2b957e;})[_0x9f9b('0x11')](function(_0x4d096b){throw _0x4d096b;});}this[_0x9f9b('0xb')]=function(_0x1f740a,_0x508bf1,_0x4f32e7,_0x15d630){return _0x2e55be(_0x1f740a[_0x9f9b('0x12')])[_0x9f9b('0x10')](function(_0x1263ae){var _0x988877=_0x1263ae[_0x508bf1];return _0x988877;})['then'](function(_0x15d635){var _0x2e0acc=_0x1f740a[_0x9f9b('0x12')]?_0x1f740a['user']['id']:_0x9f9b('0x13');var _0x29377d=_0x15d630['data'];var _0x3465c0=_0x15d630[_0x9f9b('0x14')];var _0x2ff257=new Date(Number(_0x3465c0));return _0x15d635(_0x2e0acc,_0x2ff257,_0x4f32e7,_0x29377d);})[_0x9f9b('0x11')](function(_0xba4308){fileLogger(_0x9f9b('0xd'))[_0x9f9b('0x15')](_0xba4308);});};}function setupLoggers(_0x227bc4){return new Promise(function(_0x549436){var _0x2e52b1=new ClientSideLogger();var _0xaa525e=fileLogger(_0x9f9b('0x16'));var _0x13eebb=fileLogger(_0x9f9b('0x17'));_0x227bc4[_0x9f9b('0x18')](_0x9f9b('0x19'),_0x2e52b1);_0x227bc4['use'](ewinston[_0x9f9b('0x1a')]({'winstonInstance':_0xaa525e,'meta':![],'statusLevels':!![],'msg':function(_0x181ef6,_0x5dfd97){var _0x209259='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x181ef6['body'])){_0x209259+=_0x9f9b('0x1b');var _0x569768=_0x181ef6[_0x9f9b('0x1c')];maskSensitiveData(_0x569768);}return safeTemplate(util['format'](_0x209259,_0x181ef6['method'],_0x181ef6['headers'][_0x9f9b('0x1d')]?_0x181ef6[_0x9f9b('0x1e')][_0x9f9b('0x1d')]:_0x181ef6['connection'][_0x9f9b('0x1f')]||_0x181ef6['ip'],_0x181ef6['url'],_0x5dfd97[_0x9f9b('0x20')],_0x5dfd97['responseTime'],_0x181ef6[_0x9f9b('0x12')]?_0x181ef6['user']['id']:null,_0x181ef6[_0x9f9b('0x12')]?_0x181ef6['user']['name']:null,_0x181ef6['user']?_0x181ef6[_0x9f9b('0x12')][_0x9f9b('0x21')]:null,_0x569768?util[_0x9f9b('0x22')](_0x569768,![],null):''));}}));_0x227bc4[_0x9f9b('0x23')](ewinston[_0x9f9b('0x1a')]({'winstonInstance':_0x13eebb,'meta':![],'statusLevels':!![],'msg':function(_0x93ad49,_0x1534f7){var _0x1be879=_0x9f9b('0x24');if(_0x93ad49[_0x9f9b('0x1c')]&&_0x93ad49[_0x9f9b('0x1c')][_0x9f9b('0x25')]&&_0x93ad49[_0x9f9b('0x1c')][_0x9f9b('0x26')]){_0x1be879=_0x9f9b('0x27');}return util[_0x9f9b('0x28')](_0x1be879,_0x93ad49[_0x9f9b('0x29')],_0x93ad49['headers'][_0x9f9b('0x1d')]?_0x93ad49[_0x9f9b('0x1e')][_0x9f9b('0x1d')]:_0x93ad49[_0x9f9b('0x2a')][_0x9f9b('0x1f')]||_0x93ad49['ip'],_0x93ad49['url'],_0x1534f7[_0x9f9b('0x20')],_0x1534f7[_0x9f9b('0x2b')],_0x93ad49[_0x9f9b('0x12')]?_0x93ad49[_0x9f9b('0x12')]['id']:null,_0x93ad49[_0x9f9b('0x12')]?_0x93ad49[_0x9f9b('0x12')][_0x9f9b('0xe')]:null,_0x93ad49[_0x9f9b('0x12')]?_0x93ad49[_0x9f9b('0x12')][_0x9f9b('0x21')]:null,_0x93ad49[_0x9f9b('0x1c')]&&_0x93ad49[_0x9f9b('0x1c')][_0x9f9b('0x25')]?_0x93ad49['body'][_0x9f9b('0x25')]:_0x9f9b('0x2c'),_0x93ad49[_0x9f9b('0x1c')]&&_0x93ad49[_0x9f9b('0x1c')]['agent_id']?_0x93ad49[_0x9f9b('0x1c')][_0x9f9b('0x26')]:'',_0x93ad49[_0x9f9b('0x1c')]&&_0x93ad49[_0x9f9b('0x1c')]['agent_name']?_0x93ad49['body']['agent_name']:'');},'ignoreRoute':function(_0x5cd3ed){var _0xb71f39=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xb71f39[_0x9f9b('0x2d')](_0x5cd3ed[_0x9f9b('0x2e')]);}}));return _0x549436();});}exports[_0x9f9b('0x2f')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index be6cfde..609a55f 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6bc6=['minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','format','MMM','monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','source','join','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','monthsShort','concat','exports','circularMonthInterval','clone','hours'];(function(_0x288d3a,_0x1122a6){var _0x233d36=function(_0xa59ec7){while(--_0xa59ec7){_0x288d3a['push'](_0x288d3a['shift']());}};_0x233d36(++_0x1122a6);}(_0x6bc6,0x1e6));var _0x66bc=function(_0x1af8d3,_0x544d86){_0x1af8d3=_0x1af8d3-0x0;var _0x3a50c5=_0x6bc6[_0x1af8d3];return _0x3a50c5;};var _=require(_0x66bc('0x0'));var moment=require(_0x66bc('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x66bc('0x2')](function(_0x73de16){return _0x73de16[_0x66bc('0x3')];})[_0x66bc('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x132f19){if(!_0x132f19[_0x66bc('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x487492){var _0x1782cd=_0x487492[_0x66bc('0x6')](':')[_0x66bc('0x2')](function(_0x1a72e9){return parseInt(_0x1a72e9,0xa);});var _0x5660d0=_0x1782cd[0x0];var _0x22fc6b=_0x1782cd[0x1];if(_0x5660d0<0x0||_0x5660d0>0x17||_0x22fc6b<0x0||_0x22fc6b>0x3b){throw new Error(EINVALID_DATE);}return[_0x5660d0,_0x22fc6b];}function circularDoWInterval(_0x55263b,_0x544973){if(_0x55263b===_0x544973){return[_0x55263b];}else{var _0x2ca93c=moment['locale']();moment[_0x66bc('0x7')]('en');var _0x502c74=moment[_0x66bc('0x8')]()[_0x66bc('0x2')](function(_0x2fb7dd){return _0x2fb7dd[_0x66bc('0x9')]();});moment[_0x66bc('0x7')](_0x2ca93c);var _0x35a9c9=_0x502c74[_0x66bc('0xa')](_0x55263b);var _0x1c242f=_0x502c74[_0x66bc('0xa')](_0x544973);if(_0x1c242f>_0x35a9c9){return _0x502c74[_0x66bc('0xb')](_0x35a9c9,_0x1c242f+0x1);}else{var _0x3497bb=_0x502c74[_0x66bc('0xb')](0x0,_0x1c242f+0x1);var _0xa02c24=_0x502c74[_0x66bc('0xb')](_0x35a9c9);return _0xa02c24['concat'](_0x3497bb);}}}module['exports']['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x20dfac,_0x5523e5){if(_0x20dfac===_0x5523e5){return[_0x20dfac];}else{var _0x5cd2ec=moment[_0x66bc('0x7')]();moment[_0x66bc('0x7')]('en');var _0x4480cc=moment[_0x66bc('0xc')]()[_0x66bc('0x2')](function(_0x3ccbcf){return _0x3ccbcf[_0x66bc('0x9')]();});moment[_0x66bc('0x7')](_0x5cd2ec);var _0x39b8d0=_0x4480cc['indexOf'](_0x20dfac);var _0x3db86a=_0x4480cc[_0x66bc('0xa')](_0x5523e5);if(_0x3db86a>_0x39b8d0){return _0x4480cc[_0x66bc('0xb')](_0x39b8d0,_0x3db86a+0x1);}else{var _0x54cebf=_0x4480cc[_0x66bc('0xb')](0x0,_0x3db86a+0x1);var _0x15f45f=_0x4480cc[_0x66bc('0xb')](_0x39b8d0);return _0x15f45f[_0x66bc('0xd')](_0x54cebf);}}}module[_0x66bc('0xe')][_0x66bc('0xf')]=circularMonthInterval;function parseDom(_0x378b92){var _0x1be53c=parseInt(_0x378b92,0xa);if(_0x1be53c<0x1||_0x1be53c>0x1f){throw new Error(EINVALID_DATE);}return _0x1be53c;}function timeCompare(_0x3f4ad9,_0x2451b1,_0xbd2750){var _0x2fcb10=_0x3f4ad9['clone']();var _0x15f768=extractTime(_0x2451b1);var _0x2087d0=_0x15f768[0x0];var _0x1f15d7=_0x15f768[0x1];var _0x584706=_0x3f4ad9[_0x66bc('0x10')]()[_0x66bc('0x11')](_0x2087d0)[_0x66bc('0x12')](_0x1f15d7);throwIfDateNotValid(_0x584706);var _0x222713=extractTime(_0xbd2750);var _0x4a25a3=_0x222713[0x0];var _0x1777e8=_0x222713[0x1];var _0x385c68=_0x3f4ad9['clone']()[_0x66bc('0x11')](_0x4a25a3)[_0x66bc('0x12')](_0x1777e8);throwIfDateNotValid(_0x385c68);if(_0x385c68[_0x66bc('0x13')](_0x584706)){var _0x17d108=_0x2fcb10['clone']()[_0x66bc('0x14')](_0x66bc('0x15'));var _0x169e91=_0x2fcb10['clone']()[_0x66bc('0x16')](_0x66bc('0x15'));return _0x2fcb10[_0x66bc('0x17')](_0x584706,_0x169e91,undefined,'[]')||_0x2fcb10[_0x66bc('0x17')](_0x17d108,_0x385c68,undefined,'[]');}else{return _0x2fcb10[_0x66bc('0x17')](_0x584706,_0x385c68,undefined,'[]');}}module['exports'][_0x66bc('0x18')]=timeCompare;function dowCompare(_0x1dcf66,_0x1f0251,_0x28fc14){var _0x44e1aa=_0x1dcf66[_0x66bc('0x7')]('en')['format'](_0x66bc('0x19'))[_0x66bc('0x9')]();return circularDoWInterval(_0x1f0251,_0x28fc14)[_0x66bc('0x1a')](_0x44e1aa);}module[_0x66bc('0xe')][_0x66bc('0x1b')]=dowCompare;function domCompare(_0x121404,_0x18adce,_0x19c866){var _0x39e541=_0x121404[_0x66bc('0x1c')]();if(_0x18adce===_0x19c866){return _0x39e541===_0x18adce;}else{var _0x5638a8=_0x121404[_0x66bc('0x1d')]();var _0x3bd65f=_0x18adce<_0x19c866;let _0x193daa=![];var _0x28f760=0x0;var _0x1ed8f2=0x0;if(_0x3bd65f){_0x28f760=Math[_0x66bc('0x1e')](0x1,_0x18adce);_0x1ed8f2=Math[_0x66bc('0x1f')](_0x19c866,_0x5638a8);_0x193daa=_0x39e541>=_0x28f760&&_0x39e541<=_0x1ed8f2;}else{_0x28f760=Math[_0x66bc('0x1f')](_0x18adce,_0x5638a8);_0x1ed8f2=Math[_0x66bc('0x1e')](0x1,_0x19c866);_0x193daa=_0x39e541>=_0x28f760||_0x39e541<=_0x1ed8f2;}return _0x193daa;}}module[_0x66bc('0xe')][_0x66bc('0x20')]=domCompare;function monthCompare(_0x19f0df,_0x16b535,_0x2fe387){var _0x2fe91d=_0x19f0df[_0x66bc('0x7')]('en')[_0x66bc('0x21')](_0x66bc('0x22'))['toLowerCase']();return circularMonthInterval(_0x16b535,_0x2fe387)[_0x66bc('0x1a')](_0x2fe91d);}module[_0x66bc('0xe')][_0x66bc('0x23')]=monthCompare;function iftime(_0x179ee1,_0x335823=moment['tz'][_0x66bc('0x24')](),_0x67026c=moment()){if(!validateRx[_0x66bc('0x25')](_0x179ee1)){throw new Error(EINVALID_STRING);}else{var _0x30d6c5=(moment[_0x66bc('0x26')](_0x67026c)?_0x67026c[_0x66bc('0x10')]():moment(_0x67026c))['tz'](_0x335823)[_0x66bc('0x7')]('en');throwIfDateNotValid(_0x30d6c5);var _0x33cff0=_0x179ee1[_0x66bc('0x6')](',');var _0x3f0ba4=_0x33cff0[0x0];var _0x147b5c=_0x33cff0[0x1];var _0x1cf308=_0x33cff0[0x2];var _0x42ee08=_0x33cff0[0x3];let _0x4b63ab=!![];if(_0x3f0ba4!=='*'){var _0x13560f=_0x3f0ba4['split']('-');var _0x26b8dc=_[_0x66bc('0x27')](_0x13560f[0x0],0x5,'0');var _0x214994=_0x13560f[_0x66bc('0x28')]===0x2?_[_0x66bc('0x27')](_0x13560f[0x1],0x5,'0'):_0x26b8dc;_0x4b63ab=timeCompare(_0x30d6c5,_0x26b8dc,_0x214994);}let _0xd88fc1=!![];if(_0x147b5c!=='*'){var _0x35f77c=_0x147b5c['split']('-');var _0x3afbf3=_0x35f77c[0x0];var _0x5c7fa0=_0x35f77c[_0x66bc('0x28')]===0x2?_0x35f77c[0x1]:_0x3afbf3;_0xd88fc1=dowCompare(_0x30d6c5,_0x3afbf3,_0x5c7fa0);}let _0x5c1780=!![];if(_0x1cf308!=='*'){var _0x2611fe=_0x1cf308['split']('-');var _0x43579d=parseDom(_0x2611fe[0x0]);var _0x19ceff=_0x2611fe[_0x66bc('0x28')]===0x2?parseDom(_0x2611fe[0x1]):_0x43579d;_0x5c1780=domCompare(_0x30d6c5,_0x43579d,_0x19ceff);}let _0xf314bd=!![];if(_0x42ee08!=='*'){var _0x22d727=_0x42ee08[_0x66bc('0x6')]('-');var _0x392979=_0x22d727[0x0];var _0x33e7f2=_0x22d727[_0x66bc('0x28')]===0x2?_0x22d727[0x1]:_0x22d727[0x0];_0xf314bd=monthCompare(_0x30d6c5,_0x392979,_0x33e7f2);}return _0x4b63ab&&_0xd88fc1&&_0x5c1780&&_0xf314bd;}}module[_0x66bc('0xe')][_0x66bc('0x29')]=iftime; \ No newline at end of file +var _0xd355=['padStart','lodash','moment-timezone','map','source','join','Date\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice','concat','circularDoWInterval','monthsShort','exports','clone','hours','minutes','startOf','day','endOf','isBetween','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','MMM','monthCompare','isMoment','length'];(function(_0x5c2b5f,_0x1e5cc2){var _0x257b82=function(_0xccd343){while(--_0xccd343){_0x5c2b5f['push'](_0x5c2b5f['shift']());}};_0x257b82(++_0x1e5cc2);}(_0xd355,0xb5));var _0x5d35=function(_0x4bd203,_0x29b162){_0x4bd203=_0x4bd203-0x0;var _0x2f6ba4=_0xd355[_0x4bd203];return _0x2f6ba4;};var _=require(_0x5d35('0x0'));var moment=require(_0x5d35('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x5d35('0x2')](function(_0x432a11){return _0x432a11[_0x5d35('0x3')];})[_0x5d35('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0x5d35('0x5');function throwIfDateNotValid(_0x1f5dad){if(!_0x1f5dad[_0x5d35('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x15b4f0){var _0x2be274=_0x15b4f0[_0x5d35('0x7')](':')[_0x5d35('0x2')](function(_0x5477ed){return parseInt(_0x5477ed,0xa);});var _0x32b431=_0x2be274[0x0];var _0x50a9fe=_0x2be274[0x1];if(_0x32b431<0x0||_0x32b431>0x17||_0x50a9fe<0x0||_0x50a9fe>0x3b){throw new Error(EINVALID_DATE);}return[_0x32b431,_0x50a9fe];}function circularDoWInterval(_0x182109,_0x4197ec){if(_0x182109===_0x4197ec){return[_0x182109];}else{var _0x598e3e=moment[_0x5d35('0x8')]();moment[_0x5d35('0x8')]('en');var _0x1866f1=moment['weekdaysShort']()[_0x5d35('0x2')](function(_0x22e275){return _0x22e275[_0x5d35('0x9')]();});moment[_0x5d35('0x8')](_0x598e3e);var _0x117dd6=_0x1866f1[_0x5d35('0xa')](_0x182109);var _0x2582cb=_0x1866f1[_0x5d35('0xa')](_0x4197ec);if(_0x2582cb>_0x117dd6){return _0x1866f1[_0x5d35('0xb')](_0x117dd6,_0x2582cb+0x1);}else{var _0x2fcf11=_0x1866f1[_0x5d35('0xb')](0x0,_0x2582cb+0x1);var _0x447435=_0x1866f1[_0x5d35('0xb')](_0x117dd6);return _0x447435[_0x5d35('0xc')](_0x2fcf11);}}}module['exports'][_0x5d35('0xd')]=circularDoWInterval;function circularMonthInterval(_0x5f30d6,_0x6350a9){if(_0x5f30d6===_0x6350a9){return[_0x5f30d6];}else{var _0x460290=moment['locale']();moment['locale']('en');var _0x3b9453=moment[_0x5d35('0xe')]()[_0x5d35('0x2')](function(_0x240711){return _0x240711[_0x5d35('0x9')]();});moment[_0x5d35('0x8')](_0x460290);var _0x15008a=_0x3b9453[_0x5d35('0xa')](_0x5f30d6);var _0x192ad8=_0x3b9453['indexOf'](_0x6350a9);if(_0x192ad8>_0x15008a){return _0x3b9453['slice'](_0x15008a,_0x192ad8+0x1);}else{var _0xdfd3a4=_0x3b9453[_0x5d35('0xb')](0x0,_0x192ad8+0x1);var _0x59ab8e=_0x3b9453[_0x5d35('0xb')](_0x15008a);return _0x59ab8e[_0x5d35('0xc')](_0xdfd3a4);}}}module[_0x5d35('0xf')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x5eba82){var _0x5db746=parseInt(_0x5eba82,0xa);if(_0x5db746<0x1||_0x5db746>0x1f){throw new Error(EINVALID_DATE);}return _0x5db746;}function timeCompare(_0x3d3253,_0x32d498,_0x5d26da){var _0x3e7912=_0x3d3253[_0x5d35('0x10')]();var _0x8f0c75=extractTime(_0x32d498);var _0x35c829=_0x8f0c75[0x0];var _0x338ade=_0x8f0c75[0x1];var _0x27b99a=_0x3d3253['clone']()[_0x5d35('0x11')](_0x35c829)['minutes'](_0x338ade);throwIfDateNotValid(_0x27b99a);var _0x99b141=extractTime(_0x5d26da);var _0x11e162=_0x99b141[0x0];var _0x3eaff4=_0x99b141[0x1];var _0x4d2aae=_0x3d3253[_0x5d35('0x10')]()[_0x5d35('0x11')](_0x11e162)[_0x5d35('0x12')](_0x3eaff4);throwIfDateNotValid(_0x4d2aae);if(_0x4d2aae['isBefore'](_0x27b99a)){var _0x2bd250=_0x3e7912[_0x5d35('0x10')]()[_0x5d35('0x13')](_0x5d35('0x14'));var _0xf3b564=_0x3e7912[_0x5d35('0x10')]()[_0x5d35('0x15')](_0x5d35('0x14'));return _0x3e7912['isBetween'](_0x27b99a,_0xf3b564,undefined,'[]')||_0x3e7912[_0x5d35('0x16')](_0x2bd250,_0x4d2aae,undefined,'[]');}else{return _0x3e7912[_0x5d35('0x16')](_0x27b99a,_0x4d2aae,undefined,'[]');}}module['exports']['timeCompare']=timeCompare;function dowCompare(_0x27bbc2,_0x5b6709,_0x926522){var _0x56abac=_0x27bbc2['locale']('en')['format'](_0x5d35('0x17'))[_0x5d35('0x9')]();return circularDoWInterval(_0x5b6709,_0x926522)[_0x5d35('0x18')](_0x56abac);}module[_0x5d35('0xf')][_0x5d35('0x19')]=dowCompare;function domCompare(_0x545808,_0x46a879,_0x449cae){var _0x2016d5=_0x545808[_0x5d35('0x1a')]();if(_0x46a879===_0x449cae){return _0x2016d5===_0x46a879;}else{var _0x34df9c=_0x545808[_0x5d35('0x1b')]();var _0x25973b=_0x46a879<_0x449cae;let _0x2ee996=![];var _0x36a666=0x0;var _0x6b9fc8=0x0;if(_0x25973b){_0x36a666=Math[_0x5d35('0x1c')](0x1,_0x46a879);_0x6b9fc8=Math[_0x5d35('0x1d')](_0x449cae,_0x34df9c);_0x2ee996=_0x2016d5>=_0x36a666&&_0x2016d5<=_0x6b9fc8;}else{_0x36a666=Math[_0x5d35('0x1d')](_0x46a879,_0x34df9c);_0x6b9fc8=Math['max'](0x1,_0x449cae);_0x2ee996=_0x2016d5>=_0x36a666||_0x2016d5<=_0x6b9fc8;}return _0x2ee996;}}module[_0x5d35('0xf')][_0x5d35('0x1e')]=domCompare;function monthCompare(_0x2fd61f,_0x3f125c,_0x4d7eb8){var _0xd8c6ec=_0x2fd61f[_0x5d35('0x8')]('en')['format'](_0x5d35('0x1f'))[_0x5d35('0x9')]();return circularMonthInterval(_0x3f125c,_0x4d7eb8)[_0x5d35('0x18')](_0xd8c6ec);}module['exports'][_0x5d35('0x20')]=monthCompare;function iftime(_0x16964d,_0x57b6a2=moment['tz']['guess'](),_0x172b44=moment()){if(!validateRx['test'](_0x16964d)){throw new Error(EINVALID_STRING);}else{var _0x293906=(moment[_0x5d35('0x21')](_0x172b44)?_0x172b44['clone']():moment(_0x172b44))['tz'](_0x57b6a2)[_0x5d35('0x8')]('en');throwIfDateNotValid(_0x293906);var _0x594a42=_0x16964d[_0x5d35('0x7')](',');var _0x4acfb4=_0x594a42[0x0];var _0x2ecc60=_0x594a42[0x1];var _0x588b44=_0x594a42[0x2];var _0x4fa7ca=_0x594a42[0x3];let _0x2ad703=!![];if(_0x4acfb4!=='*'){var _0x2f9994=_0x4acfb4['split']('-');var _0x43d4b8=_['padStart'](_0x2f9994[0x0],0x5,'0');var _0x1592d7=_0x2f9994[_0x5d35('0x22')]===0x2?_[_0x5d35('0x23')](_0x2f9994[0x1],0x5,'0'):_0x43d4b8;_0x2ad703=timeCompare(_0x293906,_0x43d4b8,_0x1592d7);}let _0x36ab70=!![];if(_0x2ecc60!=='*'){var _0x53bf2a=_0x2ecc60['split']('-');var _0x6925c7=_0x53bf2a[0x0];var _0x5cc86b=_0x53bf2a[_0x5d35('0x22')]===0x2?_0x53bf2a[0x1]:_0x6925c7;_0x36ab70=dowCompare(_0x293906,_0x6925c7,_0x5cc86b);}let _0x363f4d=!![];if(_0x588b44!=='*'){var _0x568d30=_0x588b44[_0x5d35('0x7')]('-');var _0x550c77=parseDom(_0x568d30[0x0]);var _0x151dfc=_0x568d30[_0x5d35('0x22')]===0x2?parseDom(_0x568d30[0x1]):_0x550c77;_0x363f4d=domCompare(_0x293906,_0x550c77,_0x151dfc);}let _0x4c796f=!![];if(_0x4fa7ca!=='*'){var _0x59d36d=_0x4fa7ca['split']('-');var _0x4b63e8=_0x59d36d[0x0];var _0x5193ab=_0x59d36d[_0x5d35('0x22')]===0x2?_0x59d36d[0x1]:_0x59d36d[0x0];_0x4c796f=monthCompare(_0x293906,_0x4b63e8,_0x5193ab);}return _0x2ad703&&_0x36ab70&&_0x363f4d&&_0x4c796f;}}module['exports']['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 01cf932..42f51de 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a63=['util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','meta','keys','length','stringify','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','path'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x9a63,0x170));var _0x39a6=function(_0x78c442,_0x1d9dad){_0x78c442=_0x78c442-0x0;var _0x345210=_0x9a63[_0x78c442];return _0x345210;};'use strict';var path=require(_0x39a6('0x0'));var util=require(_0x39a6('0x1'));var moment=require(_0x39a6('0x2'));var winston=require(_0x39a6('0x3'));var config=require(_0x39a6('0x4'));var debugLevel=config[_0x39a6('0x5')]?config[_0x39a6('0x5')][_0x39a6('0x6')]():_0x39a6('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x39a6('0x8'),'error':_0x39a6('0x9'),'warn':_0x39a6('0xa'),'info':_0x39a6('0xb'),'print':_0x39a6('0xc'),'success':_0x39a6('0xd'),'http':_0x39a6('0xe'),'verbose':_0x39a6('0xf'),'debug':'bold\x20blue','silly':_0x39a6('0x10')};winston[_0x39a6('0x11')](XC_LOG_COLORS);function getLogFileName(_0x489bfd,_0x14fa2f,_0x34e287){var _0x4799bb=_0x489bfd||_0x39a6('0x12');return path['join'](_0x4799bb,util[_0x39a6('0x13')](_0x39a6('0x14'),_0x14fa2f,_0x34e287));}function formatter(_0x3ede41,_0x5147bd){_0x5147bd['message']=_0x5147bd[_0x39a6('0x15')][_0x39a6('0x16')](/@@{/g,_0x39a6('0x17'))[_0x39a6('0x16')](/}@@/g,_0x39a6('0x18'))[_0x39a6('0x16')](/@{/g,'{{')[_0x39a6('0x16')](/}@/g,'}}');return util[_0x39a6('0x13')](_0x39a6('0x19'),moment()[_0x39a6('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5147bd[_0x39a6('0x1a')][_0x39a6('0x1b')](),_0x3ede41,_0x5147bd['message']);}function fileFormat(_0x776296,_0x3d83cb){_0x3d83cb[_0x39a6('0x15')]=_0x3d83cb[_0x39a6('0x15')][_0x39a6('0x16')](/@@{/g,_0x39a6('0x17'))[_0x39a6('0x16')](/}@@/g,_0x39a6('0x18'))[_0x39a6('0x16')](/@{/g,'{{')[_0x39a6('0x16')](/}@/g,'}}');var _0x29f36d=_0x3d83cb[_0x39a6('0x1c')]&&Object[_0x39a6('0x1d')](_0x3d83cb[_0x39a6('0x1c')])[_0x39a6('0x1e')]?'\x0a\x09'+JSON[_0x39a6('0x1f')](_0x3d83cb[_0x39a6('0x1c')]):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format'](_0x39a6('0x20')),_0x3d83cb[_0x39a6('0x1a')]['toUpperCase'](),_0x776296,_0x3d83cb[_0x39a6('0x15')],_0x29f36d);}function consoleLogger(){var _0x46a98c=new winston[(_0x39a6('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x39a6('0x22'))][(_0x39a6('0x23'))]({'level':_0x39a6('0x24'),'json':![],'formatter':function(_0x264b22){return formatter('',_0x264b22);}})]});return _0x46a98c;}function fileLogger(_0x1f0e8c,_0x408d9e){var _0x9e8bd9=new winston[(_0x39a6('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x39a6('0x22'))][(_0x39a6('0x25'))]({'name':util[_0x39a6('0x13')](_0x39a6('0x26'),_0x1f0e8c,_0x39a6('0x27')),'filename':getLogFileName(_0x408d9e,_0x1f0e8c,_0x39a6('0x27')),'level':_0x39a6('0x27'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x566b2b){return fileFormat(_0x1f0e8c,_0x566b2b);}}),new winston[(_0x39a6('0x22'))][(_0x39a6('0x25'))]({'name':util[_0x39a6('0x13')](_0x39a6('0x26'),_0x1f0e8c,debugLevel),'filename':getLogFileName(_0x408d9e,_0x1f0e8c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x34a4be){return fileFormat(_0x1f0e8c,_0x34a4be);}}),new winston[(_0x39a6('0x22'))][(_0x39a6('0x23'))]({'level':_0x39a6('0x24'),'json':![],'formatter':function(_0x1149a3){return fileFormat(_0x1f0e8c,_0x1149a3);}})]});return _0x9e8bd9;}exports[_0x39a6('0x28')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x7933=['consoleLogger','fileLogger','path','moment','../config/environment','debugLevel','toLowerCase','info','bold\x20yellow','bold\x20green','bold\x20magenta','bold\x20blue','/var/log/xcally','join','format','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','keys','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','warn','File','%s-%s','error','Console'];(function(_0x2e334b,_0x19ad28){var _0x459a56=function(_0xab9ada){while(--_0xab9ada){_0x2e334b['push'](_0x2e334b['shift']());}};_0x459a56(++_0x19ad28);}(_0x7933,0x178));var _0x3793=function(_0x19b5b9,_0x5ce4ac){_0x19b5b9=_0x19b5b9-0x0;var _0x1287cd=_0x7933[_0x19b5b9];return _0x1287cd;};'use strict';var path=require(_0x3793('0x0'));var util=require('util');var moment=require(_0x3793('0x1'));var winston=require('winston');var config=require(_0x3793('0x2'));var debugLevel=config[_0x3793('0x3')]?config[_0x3793('0x3')][_0x3793('0x4')]():_0x3793('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':_0x3793('0x6'),'info':'white','print':'bold\x20white','success':_0x3793('0x7'),'http':'gray','verbose':_0x3793('0x8'),'debug':_0x3793('0x9'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x3dfc01,_0x48fffc,_0x5c483d){var _0x569b85=_0x3dfc01||_0x3793('0xa');return path[_0x3793('0xb')](_0x569b85,util[_0x3793('0xc')]('%s-%s.log',_0x48fffc,_0x5c483d));}function formatter(_0x12ef5a,_0x51d7f5){_0x51d7f5[_0x3793('0xd')]=_0x51d7f5[_0x3793('0xd')][_0x3793('0xe')](/@@{/g,_0x3793('0xf'))[_0x3793('0xe')](/}@@/g,_0x3793('0x10'))[_0x3793('0xe')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x3793('0xc')](_0x3793('0x11'),moment()[_0x3793('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),_0x51d7f5[_0x3793('0x12')][_0x3793('0x13')](),_0x12ef5a,_0x51d7f5[_0x3793('0xd')]);}function fileFormat(_0x1f2340,_0x45d0df){_0x45d0df[_0x3793('0xd')]=_0x45d0df['message'][_0x3793('0xe')](/@@{/g,'{{{')[_0x3793('0xe')](/}@@/g,'}}}')[_0x3793('0xe')](/@{/g,'{{')[_0x3793('0xe')](/}@/g,'}}');var _0x2df20a=_0x45d0df['meta']&&Object[_0x3793('0x14')](_0x45d0df[_0x3793('0x15')])[_0x3793('0x16')]?'\x0a\x09'+JSON['stringify'](_0x45d0df[_0x3793('0x15')]):'';return util['format'](_0x3793('0x17'),moment()[_0x3793('0xc')](_0x3793('0x18')),_0x45d0df[_0x3793('0x12')][_0x3793('0x13')](),_0x1f2340,_0x45d0df['message'],_0x2df20a);}function consoleLogger(){var _0x14ddb0=new winston[(_0x3793('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3793('0x1a'))]['Console']({'level':_0x3793('0x1b'),'json':![],'formatter':function(_0x30de8e){return formatter('',_0x30de8e);}})]});return _0x14ddb0;}function fileLogger(_0x4cb449,_0x37e2bb){var _0x2d1784=new winston[(_0x3793('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3793('0x1a'))][(_0x3793('0x1c'))]({'name':util[_0x3793('0xc')](_0x3793('0x1d'),_0x4cb449,_0x3793('0x1e')),'filename':getLogFileName(_0x37e2bb,_0x4cb449,_0x3793('0x1e')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2de8d2){return fileFormat(_0x4cb449,_0x2de8d2);}}),new winston[(_0x3793('0x1a'))][(_0x3793('0x1c'))]({'name':util[_0x3793('0xc')](_0x3793('0x1d'),_0x4cb449,debugLevel),'filename':getLogFileName(_0x37e2bb,_0x4cb449,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3bbf87){return fileFormat(_0x4cb449,_0x3bbf87);}}),new winston[(_0x3793('0x1a'))][(_0x3793('0x1f'))]({'level':_0x3793('0x1b'),'json':![],'formatter':function(_0x4ad299){return fileFormat(_0x4cb449,_0x4ad299);}})]});return _0x2d1784;}exports[_0x3793('0x20')]=consoleLogger;exports[_0x3793('0x21')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 13fc3b4..439e65c 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdb28,0x106));var _0x8db2=function(_0x22f466,_0x547f5b){_0x22f466=_0x22f466-0x0;var _0x5ee13=_0xdb28[_0x22f466];return _0x5ee13;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file +var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x4a8072,_0x435bab){var _0x11a4fe=function(_0x24b69a){while(--_0x24b69a){_0x4a8072['push'](_0x4a8072['shift']());}};_0x11a4fe(++_0x435bab);}(_0x2ef3,0xba));var _0x32ef=function(_0x1bde91,_0x1acb49){_0x1bde91=_0x1bde91-0x0;var _0x34f7b0=_0x2ef3[_0x1bde91];return _0x34f7b0;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 96b348a..8620fbe 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['{\x20{\x20','string','replace','map','keys','reduce','exports','safeTemplate','lodash'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5decce,_0x37ed61){_0x5decce=_0x5decce-0x0;var _0x3fffd6=_0x9ffd[_0x5decce];return _0x3fffd6;};var _=require(_0xd9ff('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x413161){return _0x413161==='{{'?_0xd9ff('0x1'):'\x20}\x20}';}function safeTemplate(_0x3480c0){var _0x1530b1=_0x3480c0;if(typeof _0x3480c0===_0xd9ff('0x2')){_0x1530b1=_0x3480c0[_0xd9ff('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x3480c0)){_0x1530b1=_0x3480c0[_0xd9ff('0x4')](function(_0x111697){return safeTemplate(_0x111697);});}else if(_['isPlainObject'](_0x3480c0)){_0x1530b1=Object[_0xd9ff('0x5')](_0x3480c0)[_0xd9ff('0x6')](function(_0x13ea8c,_0x270eb2){_0x13ea8c[_0x270eb2]=safeTemplate(_0x3480c0[_0x270eb2]);return _0x13ea8c;},{});}return _0x1530b1;}module[_0xd9ff('0x7')][_0xd9ff('0x8')]=safeTemplate; \ No newline at end of file +var _0x36ee=['replace','isArray','map','isPlainObject','keys','reduce','safeTemplate','{\x20{\x20','string'];(function(_0x7001ce,_0x458c3e){var _0xacd96a=function(_0x3dc27c){while(--_0x3dc27c){_0x7001ce['push'](_0x7001ce['shift']());}};_0xacd96a(++_0x458c3e);}(_0x36ee,0xe8));var _0xe36e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x36ee[_0x501510];return _0x1e6ee5;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4889d8){return _0x4889d8==='{{'?_0xe36e('0x0'):'\x20}\x20}';}function safeTemplate(_0xf6b517){var _0x4018bf=_0xf6b517;if(typeof _0xf6b517===_0xe36e('0x1')){_0x4018bf=_0xf6b517[_0xe36e('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xe36e('0x3')](_0xf6b517)){_0x4018bf=_0xf6b517[_0xe36e('0x4')](function(_0x29e692){return safeTemplate(_0x29e692);});}else if(_[_0xe36e('0x5')](_0xf6b517)){_0x4018bf=Object[_0xe36e('0x6')](_0xf6b517)[_0xe36e('0x7')](function(_0x21be0b,_0x1aa596){_0x21be0b[_0x1aa596]=safeTemplate(_0xf6b517[_0x1aa596]);return _0x21be0b;},{});}return _0x4018bf;}module['exports'][_0xe36e('0x8')]=safeTemplate; \ No newline at end of file -- 1.7.1